Built motion from commit 72b93698.|2.5.36
authorAndrea Amorese <andrea.amorese@xenialab.it>
Mon, 4 Oct 2021 16:21:16 +0000 (18:21 +0200)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Mon, 4 Oct 2021 16:21:16 +0000 (18:21 +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 046c1b1..b1d0e32 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-10-04T15:50:36.494Z",
+    "time": "2021-10-04T16:06:05.810Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index e4a8755..4acaa1b 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-10-04T15:50:36.494Z",
+    "time": "2021-10-04T16:06:05.810Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 2ada645..c612acf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd065=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd065,0xe2));var _0x5d06=function(_0x15bada,_0x141848){_0x15bada=_0x15bada-0x0;var _0x4e808c=_0xd065[_0x15bada];return _0x4e808c;};'use strict';var Sequelize=require(_0x5d06('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4ddb53){return this['getDataValue'](_0x5d06('0x1'));}},'action':{'type':Sequelize[_0x5d06('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5d06('0x3'),'integration',_0x5d06('0x4'),_0x5d06('0x5'),_0x5d06('0x6'),_0x5d06('0x7'),_0x5d06('0x8'),_0x5d06('0x9')]],'msg':_0x5d06('0xa')}},'comment':_0x5d06('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5d06('0xb')},'data2':{'type':Sequelize[_0x5d06('0x2')](0x1000),'comment':_0x5d06('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x5d06('0x2')](0x1000),'comments':_0x5d06('0xd')},'data5':{'type':Sequelize[_0x5d06('0x2')](0x1000),'comments':_0x5d06('0xe')},'data6':{'type':Sequelize[_0x5d06('0x2')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x5d06('0xf')],'comments':_0x5d06('0x10')}};
\ No newline at end of file
+var _0x4434=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','STRING','contactManager','integration','motionbar','urlForward','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]'];(function(_0x2ffc82,_0x4938e8){var _0x1ddef0=function(_0x8217c4){while(--_0x8217c4){_0x2ffc82['push'](_0x2ffc82['shift']());}};_0x1ddef0(++_0x4938e8);}(_0x4434,0x175));var _0x4443=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4434[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x4443('0x0')]={'name':{'type':Sequelize[_0x4443('0x1')],'get':function(_0x416689){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x4443('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4443('0x3'),_0x4443('0x4'),_0x4443('0x5'),'jscripty',_0x4443('0x6'),'browser','bot',_0x4443('0x7')]],'msg':_0x4443('0x8')}},'comment':_0x4443('0x8')},'data1':{'type':Sequelize[_0x4443('0x2')](0x1000),'comment':_0x4443('0x9')},'data2':{'type':Sequelize[_0x4443('0x2')](0x1000),'comment':_0x4443('0xa')},'data3':{'type':Sequelize[_0x4443('0x2')](0x1000),'comment':_0x4443('0xb')},'data4':{'type':Sequelize[_0x4443('0x2')](0x1000),'comments':_0x4443('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x4443('0xd')},'data6':{'type':Sequelize[_0x4443('0x2')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x4443('0xe')],'comments':_0x4443('0xf')}};
\ No newline at end of file
index 6dc6da3..c77bc1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcecf=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','body','find','catch','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xcecf,0x190));var _0xfcec=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcecf[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xfcec('0x0'));var rimraf=require(_0xfcec('0x1'));var zipdir=require(_0xfcec('0x2'));var jsonpatch=require(_0xfcec('0x3'));var rp=require(_0xfcec('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfcec('0x5'));var path=require(_0xfcec('0x6'));var sox=require(_0xfcec('0x7'));var csv=require(_0xfcec('0x8'));var ejs=require(_0xfcec('0x9'));var fs=require('fs');var fs_extra=require(_0xfcec('0xa'));var _=require(_0xfcec('0xb'));var squel=require(_0xfcec('0xc'));var crypto=require('crypto');var jsforce=require(_0xfcec('0xd'));var deskjs=require(_0xfcec('0xe'));var toCsv=require(_0xfcec('0x8'));var querystring=require(_0xfcec('0xf'));var Papa=require(_0xfcec('0x10'));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(_0xfcec('0x11'));var logger=require('../../config/logger')(_0xfcec('0x12'));var utils=require(_0xfcec('0x13'));var config=require(_0xfcec('0x14'));var licenseUtil=require(_0xfcec('0x15'));var db=require(_0xfcec('0x16'))['db'];function respondWithStatusCode(_0x4977fb,_0x5d7c9e){_0x5d7c9e=_0x5d7c9e||0xcc;return function(_0x5bad51){if(_0x5bad51){return _0x4977fb[_0xfcec('0x17')](_0x5d7c9e);}return _0x4977fb[_0xfcec('0x18')](_0x5d7c9e)[_0xfcec('0x19')]();};}function respondWithResult(_0x8526f3,_0xe1600c){_0xe1600c=_0xe1600c||0xc8;return function(_0x183982){if(_0x183982){return _0x8526f3[_0xfcec('0x18')](_0xe1600c)[_0xfcec('0x1a')](_0x183982);}};}function respondWithFilteredResult(_0x251d56,_0x33160c){return function(_0x4c480f){if(_0x4c480f){var _0x5415f9=typeof _0x33160c['offset']===_0xfcec('0x1b')&&typeof _0x33160c[_0xfcec('0x1c')]===_0xfcec('0x1b');var _0x4c744b=_0x4c480f[_0xfcec('0x1d')];var _0x5bb357=_0x5415f9?0x0:_0x33160c[_0xfcec('0x1e')];var _0xbc0bc5=_0x5415f9?_0x4c480f[_0xfcec('0x1d')]:_0x33160c[_0xfcec('0x1e')]+_0x33160c['limit'];var _0x176589;if(_0xbc0bc5>=_0x4c744b){_0xbc0bc5=_0x4c744b;_0x176589=0xc8;}else{_0x176589=0xce;}_0x251d56['status'](_0x176589);return _0x251d56['set'](_0xfcec('0x1f'),_0x5bb357+'-'+_0xbc0bc5+'/'+_0x4c744b)['json'](_0x4c480f);}return null;};}function patchUpdates(_0xb72157){return function(_0x500bc8){try{jsonpatch[_0xfcec('0x20')](_0x500bc8,_0xb72157,!![]);}catch(_0x3d3379){return BPromise[_0xfcec('0x21')](_0x3d3379);}return _0x500bc8[_0xfcec('0x22')]();};}function saveUpdates(_0x5672f1,_0x413cb8){return function(_0x46fb40){if(_0x46fb40){return _0x46fb40[_0xfcec('0x23')](_0x5672f1)[_0xfcec('0x24')](function(_0xc92597){return _0xc92597;});}return null;};}function removeEntity(_0x458d5e,_0x35b999){return function(_0x2b2da0){if(_0x2b2da0){return _0x2b2da0['destroy']()[_0xfcec('0x24')](function(){_0x458d5e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe571,_0x2cef5e){return function(_0x5b8ad6){if(!_0x5b8ad6){_0x2fe571[_0xfcec('0x17')](0x194);}return _0x5b8ad6;};}function handleError(_0x2e4f03,_0x307e82){_0x307e82=_0x307e82||0x1f4;return function(_0x3d0266){logger[_0xfcec('0x25')](_0x3d0266[_0xfcec('0x26')]);if(_0x3d0266[_0xfcec('0x27')]){delete _0x3d0266[_0xfcec('0x27')];}_0x2e4f03['status'](_0x307e82)['send'](_0x3d0266);};}exports[_0xfcec('0x23')]=function(_0x1ea0f9,_0x5de320){if(_0x1ea0f9[_0xfcec('0x28')]['id']){delete _0x1ea0f9[_0xfcec('0x28')]['id'];}return db['Action'][_0xfcec('0x29')]({'where':{'id':_0x1ea0f9['params']['id']}})['then'](handleEntityNotFound(_0x5de320,null))[_0xfcec('0x24')](saveUpdates(_0x1ea0f9[_0xfcec('0x28')],null))[_0xfcec('0x24')](respondWithResult(_0x5de320,null))[_0xfcec('0x2a')](handleError(_0x5de320,null));};exports['destroy']=function(_0x39d700,_0x268339){return db[_0xfcec('0x2b')][_0xfcec('0x29')]({'where':{'id':_0x39d700[_0xfcec('0x2c')]['id']}})['then'](handleEntityNotFound(_0x268339,null))[_0xfcec('0x24')](removeEntity(_0x268339,null))[_0xfcec('0x2a')](handleError(_0x268339,null));};
\ No newline at end of file
+var _0xb0a7=['undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x19463f,_0x501f50){var _0x24021e=function(_0x1881d5){while(--_0x1881d5){_0x19463f['push'](_0x19463f['shift']());}};_0x24021e(++_0x501f50);}(_0xb0a7,0x69));var _0x7b0a=function(_0xcb5ece,_0x2d699f){_0xcb5ece=_0xcb5ece-0x0;var _0x221fcc=_0xb0a7[_0xcb5ece];return _0x221fcc;};'use strict';var emlformat=require(_0x7b0a('0x0'));var rimraf=require(_0x7b0a('0x1'));var zipdir=require(_0x7b0a('0x2'));var jsonpatch=require(_0x7b0a('0x3'));var rp=require(_0x7b0a('0x4'));var moment=require(_0x7b0a('0x5'));var BPromise=require(_0x7b0a('0x6'));var Mustache=require(_0x7b0a('0x7'));var util=require(_0x7b0a('0x8'));var path=require(_0x7b0a('0x9'));var sox=require(_0x7b0a('0xa'));var csv=require(_0x7b0a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b0a('0xc'));var _=require('lodash');var squel=require(_0x7b0a('0xd'));var crypto=require(_0x7b0a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7b0a('0xf'));var toCsv=require(_0x7b0a('0xb'));var querystring=require(_0x7b0a('0x10'));var Papa=require(_0x7b0a('0x11'));var Redis=require(_0x7b0a('0x12'));var authService=require(_0x7b0a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b0a('0x14'));var logger=require(_0x7b0a('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b0a('0x16'));var db=require(_0x7b0a('0x17'))['db'];function respondWithStatusCode(_0x183e8c,_0x2c8e0d){_0x2c8e0d=_0x2c8e0d||0xcc;return function(_0x39e7ac){if(_0x39e7ac){return _0x183e8c[_0x7b0a('0x18')](_0x2c8e0d);}return _0x183e8c[_0x7b0a('0x19')](_0x2c8e0d)['end']();};}function respondWithResult(_0x5a2bd5,_0x2f69d4){_0x2f69d4=_0x2f69d4||0xc8;return function(_0x5b846e){if(_0x5b846e){return _0x5a2bd5['status'](_0x2f69d4)[_0x7b0a('0x1a')](_0x5b846e);}};}function respondWithFilteredResult(_0x22efb8,_0xc845ef){return function(_0x47d2f4){if(_0x47d2f4){var _0x1cf30d=typeof _0xc845ef['offset']===_0x7b0a('0x1b')&&typeof _0xc845ef[_0x7b0a('0x1c')]===_0x7b0a('0x1b');var _0x13bcb2=_0x47d2f4[_0x7b0a('0x1d')];var _0x48b7f4=_0x1cf30d?0x0:_0xc845ef['offset'];var _0x22a560=_0x1cf30d?_0x47d2f4[_0x7b0a('0x1d')]:_0xc845ef['offset']+_0xc845ef[_0x7b0a('0x1c')];var _0x39682a;if(_0x22a560>=_0x13bcb2){_0x22a560=_0x13bcb2;_0x39682a=0xc8;}else{_0x39682a=0xce;}_0x22efb8[_0x7b0a('0x19')](_0x39682a);return _0x22efb8[_0x7b0a('0x1e')](_0x7b0a('0x1f'),_0x48b7f4+'-'+_0x22a560+'/'+_0x13bcb2)[_0x7b0a('0x1a')](_0x47d2f4);}return null;};}function patchUpdates(_0x459fdb){return function(_0x194198){try{jsonpatch['apply'](_0x194198,_0x459fdb,!![]);}catch(_0xf382dd){return BPromise[_0x7b0a('0x20')](_0xf382dd);}return _0x194198['save']();};}function saveUpdates(_0x3043cb,_0x28fc51){return function(_0x195f41){if(_0x195f41){return _0x195f41[_0x7b0a('0x21')](_0x3043cb)[_0x7b0a('0x22')](function(_0x549193){return _0x549193;});}return null;};}function removeEntity(_0x321bc3,_0x51f0fe){return function(_0x317ddb){if(_0x317ddb){return _0x317ddb[_0x7b0a('0x23')]()[_0x7b0a('0x22')](function(){_0x321bc3[_0x7b0a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250b38,_0x2e1e3a){return function(_0x3a0a2e){if(!_0x3a0a2e){_0x250b38[_0x7b0a('0x18')](0x194);}return _0x3a0a2e;};}function handleError(_0x4d5c07,_0x58fdc2){_0x58fdc2=_0x58fdc2||0x1f4;return function(_0x2fca59){logger['error'](_0x2fca59[_0x7b0a('0x24')]);if(_0x2fca59[_0x7b0a('0x25')]){delete _0x2fca59[_0x7b0a('0x25')];}_0x4d5c07[_0x7b0a('0x19')](_0x58fdc2)[_0x7b0a('0x26')](_0x2fca59);};}exports[_0x7b0a('0x21')]=function(_0x384224,_0x4301a6){if(_0x384224[_0x7b0a('0x27')]['id']){delete _0x384224[_0x7b0a('0x27')]['id'];}return db[_0x7b0a('0x28')]['find']({'where':{'id':_0x384224[_0x7b0a('0x29')]['id']}})[_0x7b0a('0x22')](handleEntityNotFound(_0x4301a6,null))[_0x7b0a('0x22')](saveUpdates(_0x384224[_0x7b0a('0x27')],null))[_0x7b0a('0x22')](respondWithResult(_0x4301a6,null))[_0x7b0a('0x2a')](handleError(_0x4301a6,null));};exports[_0x7b0a('0x23')]=function(_0xeb2e9b,_0x12275d){return db[_0x7b0a('0x28')][_0x7b0a('0x2b')]({'where':{'id':_0xeb2e9b[_0x7b0a('0x29')]['id']}})[_0x7b0a('0x22')](handleEntityNotFound(_0x12275d,null))['then'](removeEntity(_0x12275d,null))[_0x7b0a('0x2a')](handleError(_0x12275d,null));};
\ No newline at end of file
index 32dcf8b..b7821e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4977=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x181f23,_0x5dfd3f){var _0x407610=function(_0x303317){while(--_0x303317){_0x181f23['push'](_0x181f23['shift']());}};_0x407610(++_0x5dfd3f);}(_0x4977,0x1cd));var _0x7497=function(_0x431e2b,_0x326936){_0x431e2b=_0x431e2b-0x0;var _0x4855b1=_0x4977[_0x431e2b];return _0x4855b1;};'use strict';var _=require(_0x7497('0x0'));var util=require(_0x7497('0x1'));var logger=require(_0x7497('0x2'))(_0x7497('0x3'));var moment=require(_0x7497('0x4'));var BPromise=require('bluebird');var rp=require(_0x7497('0x5'));var fs=require('fs');var path=require(_0x7497('0x6'));var rimraf=require(_0x7497('0x7'));var config=require(_0x7497('0x8'));var attributes=require(_0x7497('0x9'));module[_0x7497('0xa')]=function(_0x50f563,_0x170987){return _0x50f563[_0x7497('0xb')](_0x7497('0xc'),attributes,{'tableName':_0x7497('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8156=['./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x192d21,_0xa50541){var _0x18d6f0=function(_0x3a317b){while(--_0x3a317b){_0x192d21['push'](_0x192d21['shift']());}};_0x18d6f0(++_0xa50541);}(_0x8156,0xad));var _0x6815=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8156[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x6815('0x0'));var logger=require(_0x6815('0x1'))(_0x6815('0x2'));var moment=require(_0x6815('0x3'));var BPromise=require(_0x6815('0x4'));var rp=require(_0x6815('0x5'));var fs=require('fs');var path=require(_0x6815('0x6'));var rimraf=require(_0x6815('0x7'));var config=require(_0x6815('0x8'));var attributes=require(_0x6815('0x9'));module[_0x6815('0xa')]=function(_0xcf7396,_0x41f17f){return _0xcf7396[_0x6815('0xb')](_0x6815('0xc'),attributes,{'tableName':_0x6815('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ad798d..bb80c7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0x5fab,0x177));var _0xb5fa=function(_0x3adde2,_0x3062c3){_0x3adde2=_0x3adde2-0x0;var _0xd3726d=_0x5fab[_0x3adde2];return _0xd3726d;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x814b,0x1a2));var _0xb814=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x814b[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
index 4c55587..090e724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5df9=['./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x50904c,_0x4bb0a3){var _0x22395b=function(_0x5f1fbc){while(--_0x5f1fbc){_0x50904c['push'](_0x50904c['shift']());}};_0x22395b(++_0x4bb0a3);}(_0x5df9,0x181));var _0x95df=function(_0x106a99,_0x121e74){_0x106a99=_0x106a99-0x0;var _0x123d51=_0x5df9[_0x106a99];return _0x123d51;};'use strict';var multer=require(_0x95df('0x0'));var util=require(_0x95df('0x1'));var path=require('path');var timeout=require(_0x95df('0x2'));var express=require(_0x95df('0x3'));var router=express[_0x95df('0x4')]();var fs_extra=require(_0x95df('0x5'));var auth=require(_0x95df('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x95df('0x7'));router[_0x95df('0x8')](_0x95df('0x9'),auth[_0x95df('0xa')](),controller['update']);router[_0x95df('0xb')]('/:id',auth[_0x95df('0xa')](),controller[_0x95df('0xc')]);module[_0x95df('0xd')]=router;
\ No newline at end of file
+var _0x203a=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x203a,0x161));var _0xa203=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x203a[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0xa203('0x0'));var path=require(_0xa203('0x1'));var timeout=require(_0xa203('0x2'));var express=require(_0xa203('0x3'));var router=express['Router']();var fs_extra=require(_0xa203('0x4'));var auth=require(_0xa203('0x5'));var interaction=require(_0xa203('0x6'));var config=require(_0xa203('0x7'));var controller=require(_0xa203('0x8'));router[_0xa203('0x9')](_0xa203('0xa'),auth['isAuthenticated'](),controller[_0xa203('0xb')]);router[_0xa203('0xc')](_0xa203('0xa'),auth[_0xa203('0xd')](),controller[_0xa203('0xe')]);module[_0xa203('0xf')]=router;
\ No newline at end of file
index 796cf54..58a8eb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33c5=['STRING','TEXT','exports'];(function(_0x3b9877,_0x2f44b2){var _0xbd7c7d=function(_0x26f378){while(--_0x26f378){_0x3b9877['push'](_0x3b9877['shift']());}};_0xbd7c7d(++_0x2f44b2);}(_0x33c5,0xe6));var _0x533c=function(_0x22fe5c,_0x28645c){_0x22fe5c=_0x22fe5c-0x0;var _0x17a217=_0x33c5[_0x22fe5c];return _0x17a217;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
+var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0xe4d6c6,_0x3bdbf2){var _0x3a8935=function(_0x131483){while(--_0x131483){_0xe4d6c6['push'](_0xe4d6c6['shift']());}};_0x3a8935(++_0x3bdbf2);}(_0x5075,0x73));var _0x5507=function(_0x1f1837,_0x4b304e){_0x1f1837=_0x1f1837-0x0;var _0x25ab57=_0x5075[_0x1f1837];return _0x25ab57;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 924f72c..7151c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf56c=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','field','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','ValidationErrorItem','keyBy','metric','clone','output','web','fullPath','randomstring','generate','custom','cdr','endDate','startDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','SELECT','runReport','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf56c,0x67));var _0xcf56=function(_0x27c100,_0xf59b0a){_0x27c100=_0x27c100-0x0;var _0x412c36=_0xf56c[_0x27c100];return _0x412c36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf56('0x0'));var zipdir=require(_0xcf56('0x1'));var jsonpatch=require(_0xcf56('0x2'));var rp=require(_0xcf56('0x3'));var moment=require('moment');var BPromise=require(_0xcf56('0x4'));var Mustache=require(_0xcf56('0x5'));var util=require(_0xcf56('0x6'));var path=require(_0xcf56('0x7'));var sox=require(_0xcf56('0x8'));var csv=require(_0xcf56('0x9'));var ejs=require(_0xcf56('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf56('0xb'));var squel=require('squel');var crypto=require(_0xcf56('0xc'));var jsforce=require(_0xcf56('0xd'));var deskjs=require(_0xcf56('0xe'));var toCsv=require(_0xcf56('0x9'));var querystring=require(_0xcf56('0xf'));var Papa=require('papaparse');var Redis=require(_0xcf56('0x10'));var authService=require(_0xcf56('0x11'));var qs=require(_0xcf56('0x12'));var as=require(_0xcf56('0x13'));var hardwareService=require(_0xcf56('0x14'));var logger=require(_0xcf56('0x15'))(_0xcf56('0x16'));var utils=require('../../config/utils');var config=require(_0xcf56('0x17'));var licenseUtil=require(_0xcf56('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0xcf56('0x19'))[_0xcf56('0x1a')];function respondWithStatusCode(_0x238a96,_0x55694a){_0x55694a=_0x55694a||0xcc;return function(_0x18e492){if(_0x18e492){return _0x238a96[_0xcf56('0x1b')](_0x55694a);}return _0x238a96[_0xcf56('0x1c')](_0x55694a)[_0xcf56('0x1d')]();};}function respondWithResult(_0x507e45,_0x4cfd82){_0x4cfd82=_0x4cfd82||0xc8;return function(_0x4f71a4){if(_0x4f71a4){return _0x507e45[_0xcf56('0x1c')](_0x4cfd82)[_0xcf56('0x1e')](_0x4f71a4);}};}function respondWithFilteredResult(_0x53ba6e,_0x136eaf){return function(_0x25573e){if(_0x25573e){var _0x3014cc=typeof _0x136eaf[_0xcf56('0x1f')]==='undefined'&&typeof _0x136eaf[_0xcf56('0x20')]===_0xcf56('0x21');var _0x1ebfbd=_0x25573e[_0xcf56('0x22')];var _0xa9d099=_0x3014cc?0x0:_0x136eaf['offset'];var _0x582eb8=_0x3014cc?_0x25573e['count']:_0x136eaf[_0xcf56('0x1f')]+_0x136eaf['limit'];var _0x1aba5b;if(_0x582eb8>=_0x1ebfbd){_0x582eb8=_0x1ebfbd;_0x1aba5b=0xc8;}else{_0x1aba5b=0xce;}_0x53ba6e[_0xcf56('0x1c')](_0x1aba5b);return _0x53ba6e[_0xcf56('0x23')](_0xcf56('0x24'),_0xa9d099+'-'+_0x582eb8+'/'+_0x1ebfbd)['json'](_0x25573e);}return null;};}function patchUpdates(_0x58f74c){return function(_0x20b165){try{jsonpatch[_0xcf56('0x25')](_0x20b165,_0x58f74c,!![]);}catch(_0x2287cf){return BPromise[_0xcf56('0x26')](_0x2287cf);}return _0x20b165['save']();};}function saveUpdates(_0x51d0b9,_0x5168c7){return function(_0x76f174){if(_0x76f174){return _0x76f174[_0xcf56('0x27')](_0x51d0b9)[_0xcf56('0x28')](function(_0x2cb514){return _0x2cb514;});}return null;};}function removeEntity(_0x512f0b,_0x182ff2){return function(_0x2c7c8e){if(_0x2c7c8e){return _0x2c7c8e[_0xcf56('0x29')]()['then'](function(){var _0x37b942=_0x2c7c8e['get']({'plain':!![]});var _0x21f7e8=_0xcf56('0x2a');return db[_0xcf56('0x2b')][_0xcf56('0x29')]({'where':{'type':_0x21f7e8,'resourceId':_0x37b942['id']}})[_0xcf56('0x28')](function(){return _0x2c7c8e;});})['then'](function(){_0x512f0b[_0xcf56('0x1c')](0xcc)[_0xcf56('0x1d')]();});}};}function handleEntityNotFound(_0x24770d,_0x68a1c9){return function(_0x43a6d7){if(!_0x43a6d7){_0x24770d[_0xcf56('0x1b')](0x194);}return _0x43a6d7;};}function handleError(_0x3b4b98,_0x6fa042){_0x6fa042=_0x6fa042||0x1f4;return function(_0x53b326){logger[_0xcf56('0x2c')](_0x53b326[_0xcf56('0x2d')]);if(_0x53b326['name']){delete _0x53b326[_0xcf56('0x2e')];}_0x3b4b98[_0xcf56('0x1c')](_0x6fa042)[_0xcf56('0x2f')](_0x53b326);};}exports[_0xcf56('0x30')]=function(_0x4dd997,_0x5cdb28){var _0x581770={},_0x3cdfe8={},_0x1d7b91={'count':0x0,'rows':[]};var _0x322045=_[_0xcf56('0x31')](db[_0xcf56('0x32')][_0xcf56('0x33')],function(_0x36e8f2){return{'name':_0x36e8f2['fieldName'],'type':_0x36e8f2[_0xcf56('0x34')][_0xcf56('0x35')]};});_0x3cdfe8[_0xcf56('0x36')]=_[_0xcf56('0x31')](_0x322045,_0xcf56('0x2e'));_0x3cdfe8[_0xcf56('0x37')]=_[_0xcf56('0x38')](_0x4dd997[_0xcf56('0x37')]);_0x3cdfe8['filters']=_[_0xcf56('0x39')](_0x3cdfe8['model'],_0x3cdfe8[_0xcf56('0x37')]);_0x581770[_0xcf56('0x3a')]=_[_0xcf56('0x39')](_0x3cdfe8[_0xcf56('0x36')],qs[_0xcf56('0x3b')](_0x4dd997[_0xcf56('0x37')]['fields']));_0x581770['attributes']=_0x581770[_0xcf56('0x3a')][_0xcf56('0x3c')]?_0x581770[_0xcf56('0x3a')]:_0x3cdfe8[_0xcf56('0x36')];if(!_0x4dd997[_0xcf56('0x37')][_0xcf56('0x3d')](_0xcf56('0x3e'))){_0x581770[_0xcf56('0x20')]=qs['limit'](_0x4dd997[_0xcf56('0x37')][_0xcf56('0x20')]);_0x581770[_0xcf56('0x1f')]=qs[_0xcf56('0x1f')](_0x4dd997['query']['offset']);}_0x581770[_0xcf56('0x3f')]=qs['sort'](_0x4dd997[_0xcf56('0x37')][_0xcf56('0x40')]);_0x581770[_0xcf56('0x41')]=qs[_0xcf56('0x42')](_[_0xcf56('0x43')](_0x4dd997[_0xcf56('0x37')],_0x3cdfe8[_0xcf56('0x42')]),_0x322045);if(_0x4dd997[_0xcf56('0x37')][_0xcf56('0x44')]){_0x581770[_0xcf56('0x41')]=_[_0xcf56('0x45')](_0x581770['where'],{'$or':_[_0xcf56('0x31')](_0x322045,function(_0x5a6fc1){if(_0x5a6fc1[_0xcf56('0x34')]!==_0xcf56('0x46')){var _0x73e7a7={};_0x73e7a7[_0x5a6fc1[_0xcf56('0x2e')]]={'$like':'%'+_0x4dd997[_0xcf56('0x37')][_0xcf56('0x44')]+'%'};return _0x73e7a7;}})});}_0x581770=_[_0xcf56('0x45')]({},_0x581770,_0x4dd997[_0xcf56('0x47')]);var _0x53fc8a={'where':_0x581770[_0xcf56('0x41')]};return db['AnalyticCustomReport'][_0xcf56('0x22')](_0x53fc8a)[_0xcf56('0x28')](function(_0x21254e){_0x1d7b91[_0xcf56('0x22')]=_0x21254e;if(_0x4dd997[_0xcf56('0x37')][_0xcf56('0x48')]){_0x581770[_0xcf56('0x49')]=[{'all':!![]}];}return db[_0xcf56('0x32')][_0xcf56('0x4a')](_0x581770);})[_0xcf56('0x28')](function(_0x2bc781){_0x1d7b91[_0xcf56('0x4b')]=_0x2bc781;return _0x1d7b91;})[_0xcf56('0x28')](respondWithFilteredResult(_0x5cdb28,_0x581770))[_0xcf56('0x4c')](handleError(_0x5cdb28,null));};exports[_0xcf56('0x4d')]=function(_0x5576be,_0x1e273b){var _0x38f89b={'raw':![],'where':{'id':_0x5576be[_0xcf56('0x4e')]['id']}},_0x403b13={};_0x403b13[_0xcf56('0x36')]=_[_0xcf56('0x38')](db['AnalyticCustomReport']['rawAttributes']);_0x403b13[_0xcf56('0x37')]=_['keys'](_0x5576be[_0xcf56('0x37')]);_0x403b13['filters']=_[_0xcf56('0x39')](_0x403b13['model'],_0x403b13[_0xcf56('0x37')]);_0x38f89b[_0xcf56('0x3a')]=_['intersection'](_0x403b13[_0xcf56('0x36')],qs[_0xcf56('0x3b')](_0x5576be[_0xcf56('0x37')][_0xcf56('0x3b')]));_0x38f89b['attributes']=_0x38f89b[_0xcf56('0x3a')][_0xcf56('0x3c')]?_0x38f89b[_0xcf56('0x3a')]:_0x403b13[_0xcf56('0x36')];if(_0x5576be[_0xcf56('0x37')][_0xcf56('0x48')]){_0x38f89b[_0xcf56('0x49')]=[{'all':!![]}];}_0x38f89b=_[_0xcf56('0x45')]({},_0x38f89b,_0x5576be[_0xcf56('0x47')]);return db['AnalyticCustomReport'][_0xcf56('0x4f')](_0x38f89b)['then'](handleEntityNotFound(_0x1e273b,null))[_0xcf56('0x28')](respondWithResult(_0x1e273b,null))[_0xcf56('0x4c')](handleError(_0x1e273b,null));};exports[_0xcf56('0x50')]=function(_0xea043,_0x3aa6fa){return db[_0xcf56('0x32')][_0xcf56('0x50')](_0xea043[_0xcf56('0x51')],{})['then'](function(_0x13f953){var _0x1c720c=_0xea043[_0xcf56('0x52')][_0xcf56('0x53')]({'plain':!![]});if(!_0x1c720c)throw new Error(_0xcf56('0x54'));if(_0x1c720c[_0xcf56('0x55')]===_0xcf56('0x52')){var _0x31b508=_0x13f953[_0xcf56('0x53')]({'plain':!![]});var _0x2137a8=_0xcf56('0x56');return db[_0xcf56('0x57')][_0xcf56('0x4f')]({'where':{'name':_0x2137a8,'userProfileId':_0x1c720c['userProfileId']},'raw':!![]})[_0xcf56('0x28')](function(_0x221865){if(_0x221865&&_0x221865['autoAssociation']===0x0){return db['UserProfileResource'][_0xcf56('0x50')]({'name':_0x31b508[_0xcf56('0x2e')],'resourceId':_0x31b508['id'],'type':_0xcf56('0x2a'),'sectionId':_0x221865['id']},{})[_0xcf56('0x28')](function(){return _0x13f953;});}else{return _0x13f953;}})[_0xcf56('0x4c')](function(_0x267510){logger[_0xcf56('0x2c')](_0xcf56('0x58'),_0x267510);throw _0x267510;});}return _0x13f953;})['then'](respondWithResult(_0x3aa6fa,0xc9))[_0xcf56('0x4c')](handleError(_0x3aa6fa,null));};exports[_0xcf56('0x27')]=function(_0x5b18fb,_0x12b611){if(_0x5b18fb[_0xcf56('0x51')]['id']){delete _0x5b18fb[_0xcf56('0x51')]['id'];}return db['AnalyticCustomReport'][_0xcf56('0x4f')]({'where':{'id':_0x5b18fb['params']['id']}})[_0xcf56('0x28')](handleEntityNotFound(_0x12b611,null))['then'](saveUpdates(_0x5b18fb[_0xcf56('0x51')],null))[_0xcf56('0x28')](respondWithResult(_0x12b611,null))[_0xcf56('0x4c')](handleError(_0x12b611,null));};exports[_0xcf56('0x29')]=function(_0x480290,_0xdda138){return db[_0xcf56('0x32')][_0xcf56('0x4f')]({'where':{'id':_0x480290[_0xcf56('0x4e')]['id']}})[_0xcf56('0x28')](handleEntityNotFound(_0xdda138,null))[_0xcf56('0x28')](removeEntity(_0xdda138,null))[_0xcf56('0x4c')](handleError(_0xdda138,null));};exports['preview']=function(_0x37270b,_0x25502e){var _0x1f2551=0xa;var _0x25d126=['join',_0xcf56('0x59'),_0xcf56('0x5a'),_0xcf56('0x5b')];var _0xb5ba8b={'SUM':_0xcf56('0x5c'),'COUNT':_0xcf56('0x5d'),'COUNT DISTINCT':_0xcf56('0x5e'),'MAX':_0xcf56('0x5f'),'MIN':_0xcf56('0x60'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcf56('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcf56('0x62')};var _0x3f12dc={'SEC_TO_TIME':_0xcf56('0x63'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xcf56('0x64')};var _0x466999=function(_0xaf7ebe){return!_[_0xcf56('0x65')]([_0xcf56('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xcf56('0x67')],_0xaf7ebe);};var _0x2c48bc=function(_0x3545e6){if(!_0x3545e6||!_0x3545e6[_0xcf56('0x68')][_0xcf56('0x3c')]){return'';}for(var _0x2fc056='(',_0x86c3c7=0x0;_0x86c3c7<_0x3545e6[_0xcf56('0x68')][_0xcf56('0x3c')];_0x86c3c7+=0x1){_0x86c3c7>0x0&&(_0x2fc056+='\x20'+_0x3545e6['operator']+'\x20');_0x2fc056+=_0x3545e6[_0xcf56('0x68')][_0x86c3c7][_0xcf56('0x69')]?_0x2c48bc(_0x3545e6[_0xcf56('0x68')][_0x86c3c7][_0xcf56('0x69')]):_0x3545e6[_0xcf56('0x68')][_0x86c3c7]['field']+'\x20'+_0x3545e6['rules'][_0x86c3c7]['condition']+(_0x466999(_0x3545e6[_0xcf56('0x68')][_0x86c3c7][_0xcf56('0x6a')])?'\x20'+_0x3545e6['rules'][_0x86c3c7][_0xcf56('0x6b')]:'');}return _0x2fc056+')';};var _0x41ce8c={'where':{'id':_0x37270b[_0xcf56('0x4e')]['id']}},_0x452282,_0x537850,_0xf9c858,_0x577fd7,_0x53cb6b;_0x41ce8c=_[_0xcf56('0x45')]({},_0x41ce8c,_0x37270b['options']);return db[_0xcf56('0x32')][_0xcf56('0x4f')](_0x41ce8c)[_0xcf56('0x28')](function(_0x1eb3b7){if(_0x1eb3b7){_0x452282=_0x1eb3b7;return _0x1eb3b7[_0xcf56('0x6c')]();}return null;})[_0xcf56('0x28')](function(_0x26636f){if(_0x26636f){if(!_0x26636f[_0xcf56('0x3c')]){throw new db[(_0xcf56('0x6d'))]['ValidationErrorItem'](_0xcf56('0x6e'),0x193);}_0x537850=_0x26636f;return db[_0xcf56('0x6f')][_0xcf56('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x3dde81){if(_0x3dde81){_0xf9c858=_['keyBy'](_0x3dde81,'id');var _0x28d408;var _0x589bf0=squel[_0xcf56('0x70')]();_0x589bf0[_0xcf56('0x71')](_0x452282['table']);for(var _0x243bb9=0x0;_0x243bb9<_0x537850['length'];_0x243bb9+=0x1){_0x28d408=_0x537850[_0x243bb9][_0xcf56('0x72')]?_0xf9c858[_0x537850[_0x243bb9][_0xcf56('0x72')]]['metric']:_0x537850[_0x243bb9][_0xcf56('0x73')];_0x28d408=_0x537850[_0x243bb9][_0xcf56('0x74')]?_['replace'](_0xb5ba8b[_0x537850[_0x243bb9][_0xcf56('0x74')]],'%s',_0x28d408):_0x28d408;_0x28d408=_0x537850[_0x243bb9][_0xcf56('0x75')]?_[_0xcf56('0x76')](_0x3f12dc[_0x537850[_0x243bb9][_0xcf56('0x75')]],'%s',_0x28d408):_0x28d408;if(_0x537850[_0x243bb9][_0xcf56('0x77')]){_0x589bf0['group'](_0x28d408);}_0x537850[_0x243bb9][_0xcf56('0x78')]&&_0x589bf0[_0xcf56('0x3f')](_0x28d408,_0x537850[_0x243bb9][_0xcf56('0x78')]===_0xcf56('0x79')?![]:!![]);_0x589bf0[_0xcf56('0x73')](_0x28d408,_0x537850[_0x243bb9][_0xcf56('0x7a')]||_0x28d408);}if(_0x452282[_0xcf56('0x7b')]){_0x452282[_0xcf56('0x7b')]=JSON[_0xcf56('0x7c')](_0x452282[_0xcf56('0x7b')]);for(var _0x15f301=0x0;_0x15f301<_0x452282[_0xcf56('0x7b')][_0xcf56('0x3c')];_0x15f301+=0x1){if(_0x452282['joins'][_0x15f301][_0xcf56('0x34')]&&_[_0xcf56('0x65')](_0x25d126,_0x452282[_0xcf56('0x7b')][_0x15f301][_0xcf56('0x34')])&&_0x452282[_0xcf56('0x7b')][_0x15f301][_0xcf56('0x7d')]&&_0x452282['joins'][_0x15f301][_0xcf56('0x7e')]&&_0x452282[_0xcf56('0x7b')][_0x15f301][_0xcf56('0x7f')]){_0x589bf0[_0x452282['joins'][_0x15f301][_0xcf56('0x34')]](_0x452282[_0xcf56('0x7b')][_0x15f301][_0xcf56('0x7e')],null,util['format'](_0xcf56('0x80'),_0x452282[_0xcf56('0x81')],_0x452282[_0xcf56('0x7b')][_0x15f301]['parentKey'],_0x452282[_0xcf56('0x7b')][_0x15f301][_0xcf56('0x7e')],_0x452282[_0xcf56('0x7b')][_0x15f301]['foreignKey']));}}}if(_0x452282[_0xcf56('0x82')]){_0x452282[_0xcf56('0x82')]=JSON[_0xcf56('0x7c')](_0x452282[_0xcf56('0x82')]);_0x589bf0[_0xcf56('0x41')](_0x2c48bc(_0x452282['conditions'][_0xcf56('0x69')]));}_0x53cb6b=_0x589bf0['clone']();_0x589bf0[_0xcf56('0x20')](_0x1f2551);_0x589bf0[_0xcf56('0x1f')](0x0);logger[_0xcf56('0x83')]('Limited\x20Query:',_0x589bf0[_0xcf56('0x84')]());return dbH[_0xcf56('0x85')][_0xcf56('0x37')](_0x589bf0[_0xcf56('0x84')](),{'type':dbH[_0xcf56('0x85')][_0xcf56('0x86')]['SELECT']});}})['then'](respondWithResult(_0x25502e,null))[_0xcf56('0x4c')](handleError(_0x25502e,null));};function runReport(_0x243989,_0x272106,_0x4a02ac){var _0xe4fc55=_0x272106['name'];var _0x32aa73=0xa;var _0x47e79d=[_0xcf56('0x87'),_0xcf56('0x59'),'right_join',_0xcf56('0x5b')];var _0x1ba58f={'SUM':_0xcf56('0x5c'),'COUNT':_0xcf56('0x5d'),'COUNT DISTINCT':_0xcf56('0x5e'),'MAX':_0xcf56('0x5f'),'MIN':_0xcf56('0x60'),'AVG':_0xcf56('0x88'),'GROUP_CONCAT':_0xcf56('0x61'),'GROUP_CONCAT ASC':_0xcf56('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3dd820={'SEC_TO_TIME':_0xcf56('0x63'),'DATE':_0xcf56('0x8a'),'HOUR':_0xcf56('0x8b'),'ROUND':_0xcf56('0x8c'),'UNIX_TIMESTAMP':_0xcf56('0x64')};var _0xf922a2=function(_0xec9953){return!_['includes']([_0xcf56('0x66'),_0xcf56('0x8d'),_0xcf56('0x8e'),_0xcf56('0x67')],_0xec9953);};var _0x1bb065=function(_0x1229bc){if(!_0x1229bc||!_0x1229bc['rules'][_0xcf56('0x3c')]){return'';}for(var _0x2351a3='(',_0x475962=0x0;_0x475962<_0x1229bc[_0xcf56('0x68')][_0xcf56('0x3c')];_0x475962+=0x1){_0x475962>0x0&&(_0x2351a3+='\x20'+_0x1229bc[_0xcf56('0x8f')]+'\x20');_0x2351a3+=_0x1229bc['rules'][_0x475962]['group']?_0x1bb065(_0x1229bc['rules'][_0x475962][_0xcf56('0x69')]):_0x1229bc[_0xcf56('0x68')][_0x475962]['field']+'\x20'+_0x1229bc[_0xcf56('0x68')][_0x475962]['condition']+(_0xf922a2(_0x1229bc[_0xcf56('0x68')][_0x475962][_0xcf56('0x6a')])?'\x20'+_0x1229bc['rules'][_0x475962][_0xcf56('0x6b')]:'');}return _0x2351a3+')';};var _0x53e588={'where':{'id':_0x243989['id']}},_0x398c9d,_0x3b2173,_0x86e8e9,_0x541ef4,_0x2253c2;_0x53e588=_[_0xcf56('0x45')]({},_0x53e588,_0x4a02ac);return db['AnalyticCustomReport'][_0xcf56('0x4f')](_0x53e588)[_0xcf56('0x28')](function(_0x3cacbc){if(_0x3cacbc){_0x398c9d=_0x3cacbc;return _0x3cacbc['getFields']();}return null;})[_0xcf56('0x28')](function(_0x240e68){if(_0x240e68){if(!_0x240e68[_0xcf56('0x3c')]){throw new db['Sequelize'][(_0xcf56('0x90'))](_0xcf56('0x6e'),0x193);}_0x3b2173=_0x240e68;return db['AnalyticMetric'][_0xcf56('0x4a')]({'raw':!![]});}return null;})[_0xcf56('0x28')](function(_0x4965d0){if(_0x4965d0){_0x86e8e9=_[_0xcf56('0x91')](_0x4965d0,'id');var _0x487e1e;var _0x22cde4=squel['select']();_0x22cde4[_0xcf56('0x71')](_0x398c9d['table']);for(var _0xc1a645=0x0;_0xc1a645<_0x3b2173[_0xcf56('0x3c')];_0xc1a645+=0x1){_0x487e1e=_0x3b2173[_0xc1a645][_0xcf56('0x72')]?_0x86e8e9[_0x3b2173[_0xc1a645][_0xcf56('0x72')]][_0xcf56('0x92')]:_0x3b2173[_0xc1a645][_0xcf56('0x73')];_0x487e1e=_0x3b2173[_0xc1a645]['function']?_[_0xcf56('0x76')](_0x1ba58f[_0x3b2173[_0xc1a645][_0xcf56('0x74')]],'%s',_0x487e1e):_0x487e1e;_0x487e1e=_0x3b2173[_0xc1a645][_0xcf56('0x75')]?_[_0xcf56('0x76')](_0x3dd820[_0x3b2173[_0xc1a645][_0xcf56('0x75')]],'%s',_0x487e1e):_0x487e1e;if(_0x3b2173[_0xc1a645][_0xcf56('0x77')]){_0x22cde4['group'](_0x487e1e);}_0x3b2173[_0xc1a645][_0xcf56('0x78')]&&_0x22cde4[_0xcf56('0x3f')](_0x487e1e,_0x3b2173[_0xc1a645][_0xcf56('0x78')]===_0xcf56('0x79')?![]:!![]);_0x22cde4[_0xcf56('0x73')](_0x487e1e,_0x3b2173[_0xc1a645][_0xcf56('0x7a')]||_0x487e1e);}if(_0x398c9d[_0xcf56('0x7b')]){_0x398c9d[_0xcf56('0x7b')]=JSON['parse'](_0x398c9d['joins']);for(var _0x288ed5=0x0;_0x288ed5<_0x398c9d[_0xcf56('0x7b')][_0xcf56('0x3c')];_0x288ed5+=0x1){if(_0x398c9d[_0xcf56('0x7b')][_0x288ed5][_0xcf56('0x34')]&&_[_0xcf56('0x65')](_0x47e79d,_0x398c9d[_0xcf56('0x7b')][_0x288ed5][_0xcf56('0x34')])&&_0x398c9d[_0xcf56('0x7b')][_0x288ed5]['parentKey']&&_0x398c9d['joins'][_0x288ed5][_0xcf56('0x7e')]&&_0x398c9d[_0xcf56('0x7b')][_0x288ed5][_0xcf56('0x7f')]){_0x22cde4[_0x398c9d[_0xcf56('0x7b')][_0x288ed5][_0xcf56('0x34')]](_0x398c9d[_0xcf56('0x7b')][_0x288ed5][_0xcf56('0x7e')],null,util[_0xcf56('0x75')](_0xcf56('0x80'),_0x398c9d[_0xcf56('0x81')],_0x398c9d[_0xcf56('0x7b')][_0x288ed5]['parentKey'],_0x398c9d[_0xcf56('0x7b')][_0x288ed5][_0xcf56('0x7e')],_0x398c9d[_0xcf56('0x7b')][_0x288ed5][_0xcf56('0x7f')]));}}}if(_0x398c9d[_0xcf56('0x82')]){_0x398c9d['conditions']=JSON[_0xcf56('0x7c')](_0x398c9d['conditions']);_0x22cde4[_0xcf56('0x41')](_0x1bb065(_0x398c9d[_0xcf56('0x82')][_0xcf56('0x69')]));}_0x2253c2=_0x22cde4[_0xcf56('0x93')]();_0x22cde4[_0xcf56('0x20')](_0x32aa73);_0x22cde4['offset'](0x0);return;}})[_0xcf56('0x28')](function(){if(_0x272106[_0xcf56('0x94')]===_0xcf56('0x95')){return null;}var _0x5f1c0a=_[_0xcf56('0x45')](_0x272106,{'name':_0x272106[_0xcf56('0x96')]||_0x272106[_0xcf56('0x2e')]||_0x398c9d[_0xcf56('0x2e')],'basename':_0xe4fc55,'savename':util[_0xcf56('0x75')]('%s-%s.%s',_0x272106[_0xcf56('0x2e')]||_0x398c9d[_0xcf56('0x2e')],require(_0xcf56('0x97'))[_0xcf56('0x98')](0x4),_0x272106['output']||'csv'),'reportId':_0x398c9d['id'],'reportType':_0xcf56('0x99')});return db['AnalyticExtractedReport'][_0xcf56('0x50')](_0x5f1c0a,{'raw':!![]});})[_0xcf56('0x28')](function(_0x204791){if(_0x398c9d[_0xcf56('0x81')]===_0xcf56('0x9a')){_0x2253c2[_0xcf56('0x41')](_0x398c9d[_0xcf56('0x81')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x272106['startDate'],_0x272106[_0xcf56('0x9b')]);}else{_0x2253c2[_0xcf56('0x41')](_0x398c9d[_0xcf56('0x81')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x272106[_0xcf56('0x9c')],_0x272106['endDate']);}if(_0x204791){logger[_0xcf56('0x9d')](_0xcf56('0x9e'),_0x2253c2[_0xcf56('0x84')]());require('child_process')[_0xcf56('0x9f')](path[_0xcf56('0x87')](__dirname,_0xcf56('0xa0'),_0x204791[_0xcf56('0x94')]),[_0x204791['id'],_0x2253c2[_0xcf56('0x84')](),path[_0xcf56('0x87')](__dirname,_0xcf56('0xa1'),_0x204791[_0xcf56('0xa2')]),_0xe4fc55]);return _0x204791;}else{var _0x7b1d7e=squel['select']();_0x7b1d7e[_0xcf56('0x71')]('('+_0x2253c2[_0xcf56('0x84')]()+')','countTable');_0x7b1d7e[_0xcf56('0x73')]('COUNT(*)','count');_0x2253c2['limit'](_0x272106[_0xcf56('0x20')]||_0x32aa73);_0x2253c2[_0xcf56('0x1f')](_0x272106['offset']||0x0);return dbH[_0xcf56('0x85')][_0xcf56('0x37')](_0x7b1d7e[_0xcf56('0x84')](),{'type':dbH[_0xcf56('0x85')][_0xcf56('0x86')][_0xcf56('0xa3')]})[_0xcf56('0x28')](function(_0x1e07cd){if(!_0x1e07cd[_0xcf56('0x3c')]){_0x541ef4=0x0;}else{_0x541ef4=_0x1e07cd[0x0][_0xcf56('0x22')]||0x0;}return dbH['sequelize'][_0xcf56('0x37')](_0x2253c2[_0xcf56('0x84')](),{'type':dbH[_0xcf56('0x85')][_0xcf56('0x86')][_0xcf56('0xa3')]});})[_0xcf56('0x28')](function(_0x46624a){return{'rows':_0x46624a||[],'count':_0x541ef4};});}});}exports['run']=function(_0x30ed94,_0x791e98){return runReport(_0x30ed94[_0xcf56('0x4e')],_0x30ed94['query'],_0x30ed94[_0xcf56('0x47')])[_0xcf56('0x28')](respondWithResult(_0x791e98,null))[_0xcf56('0x4c')](handleError(_0x791e98,null));};exports[_0xcf56('0xa4')]=runReport;exports['query']=function(_0x3a4830,_0x3f7adc){var _0x5944eb=0xa;var _0x2e783f=['join',_0xcf56('0x59'),_0xcf56('0x5a'),_0xcf56('0x5b')];var _0x155e8d={'SUM':_0xcf56('0x5c'),'COUNT':_0xcf56('0x5d'),'COUNT DISTINCT':_0xcf56('0x5e'),'MAX':_0xcf56('0x5f'),'MIN':'MIN(%s)','AVG':_0xcf56('0x88'),'GROUP_CONCAT':_0xcf56('0x61'),'GROUP_CONCAT ASC':_0xcf56('0x89'),'GROUP_CONCAT DESC':_0xcf56('0x62')};var _0x58973b={'SEC_TO_TIME':_0xcf56('0x63'),'DATE':_0xcf56('0x8a'),'HOUR':_0xcf56('0x8b'),'ROUND':_0xcf56('0x8c'),'UNIX_TIMESTAMP':_0xcf56('0x64')};var _0x236c69=function(_0x5bd75e){return!_['includes'](['IS\x20NULL',_0xcf56('0x8d'),_0xcf56('0x8e'),_0xcf56('0x67')],_0x5bd75e);};var _0x46b82d=function(_0x4f96e6){if(!_0x4f96e6||!_0x4f96e6['rules'][_0xcf56('0x3c')]){return'';}for(var _0x2dbf70='(',_0x2e62ad=0x0;_0x2e62ad<_0x4f96e6[_0xcf56('0x68')][_0xcf56('0x3c')];_0x2e62ad+=0x1){_0x2e62ad>0x0&&(_0x2dbf70+='\x20'+_0x4f96e6[_0xcf56('0x8f')]+'\x20');_0x2dbf70+=_0x4f96e6[_0xcf56('0x68')][_0x2e62ad][_0xcf56('0x69')]?_0x46b82d(_0x4f96e6[_0xcf56('0x68')][_0x2e62ad][_0xcf56('0x69')]):_0x4f96e6[_0xcf56('0x68')][_0x2e62ad][_0xcf56('0x73')]+'\x20'+_0x4f96e6[_0xcf56('0x68')][_0x2e62ad][_0xcf56('0x6a')]+(_0x236c69(_0x4f96e6['rules'][_0x2e62ad][_0xcf56('0x6a')])?'\x20'+_0x4f96e6[_0xcf56('0x68')][_0x2e62ad][_0xcf56('0x6b')]:'');}return _0x2dbf70+')';};var _0x51c360={'where':{'id':_0x3a4830[_0xcf56('0x4e')]['id']}},_0x432830,_0x4edec8,_0x38e344,_0x4dc41c,_0x55e5ef;_0x51c360=_[_0xcf56('0x45')]({},_0x51c360,_0x3a4830[_0xcf56('0x47')]);return db['AnalyticCustomReport'][_0xcf56('0x4f')](_0x51c360)[_0xcf56('0x28')](function(_0x2d0dce){if(_0x2d0dce){_0x432830=_0x2d0dce;return _0x2d0dce['getFields']();}return null;})['then'](function(_0x2947bb){if(_0x2947bb){if(!_0x2947bb[_0xcf56('0x3c')]){throw new db[(_0xcf56('0x6d'))][(_0xcf56('0x90'))](_0xcf56('0x6e'),0x193);}_0x4edec8=_0x2947bb;return db[_0xcf56('0x6f')]['findAll']({'raw':!![]});}return null;})[_0xcf56('0x28')](function(_0x497562){if(_0x497562){_0x38e344=_[_0xcf56('0x91')](_0x497562,'id');var _0x404008;var _0x4be621=squel[_0xcf56('0x70')]();_0x4be621[_0xcf56('0x71')](_0x432830['table']);for(var _0x59d1d3=0x0;_0x59d1d3<_0x4edec8[_0xcf56('0x3c')];_0x59d1d3+=0x1){_0x404008=_0x4edec8[_0x59d1d3][_0xcf56('0x72')]?_0x38e344[_0x4edec8[_0x59d1d3]['MetricId']]['metric']:_0x4edec8[_0x59d1d3][_0xcf56('0x73')];_0x404008=_0x4edec8[_0x59d1d3][_0xcf56('0x74')]?_[_0xcf56('0x76')](_0x155e8d[_0x4edec8[_0x59d1d3][_0xcf56('0x74')]],'%s',_0x404008):_0x404008;_0x404008=_0x4edec8[_0x59d1d3][_0xcf56('0x75')]?_[_0xcf56('0x76')](_0x58973b[_0x4edec8[_0x59d1d3][_0xcf56('0x75')]],'%s',_0x404008):_0x404008;if(_0x4edec8[_0x59d1d3]['groupBy']){_0x4be621[_0xcf56('0x69')](_0x404008);}_0x4edec8[_0x59d1d3][_0xcf56('0x78')]&&_0x4be621['order'](_0x404008,_0x4edec8[_0x59d1d3][_0xcf56('0x78')]===_0xcf56('0x79')?![]:!![]);_0x4be621[_0xcf56('0x73')](_0x404008,_0x4edec8[_0x59d1d3]['alias']||_0x404008);}if(_0x432830['joins']){_0x432830[_0xcf56('0x7b')]=JSON[_0xcf56('0x7c')](_0x432830[_0xcf56('0x7b')]);for(var _0x3199f8=0x0;_0x3199f8<_0x432830[_0xcf56('0x7b')]['length'];_0x3199f8+=0x1){if(_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x34')]&&_[_0xcf56('0x65')](_0x2e783f,_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x34')])&&_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x7d')]&&_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x7e')]&&_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x7f')]){_0x4be621[_0x432830['joins'][_0x3199f8][_0xcf56('0x34')]](_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x7e')],null,util[_0xcf56('0x75')]('%s.%s\x20=\x20%s.%s',_0x432830[_0xcf56('0x81')],_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x7d')],_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x7e')],_0x432830[_0xcf56('0x7b')][_0x3199f8][_0xcf56('0x7f')]));}}}if(_0x432830[_0xcf56('0x82')]){_0x432830[_0xcf56('0x82')]=JSON[_0xcf56('0x7c')](_0x432830[_0xcf56('0x82')]);_0x4be621[_0xcf56('0x41')](_0x46b82d(_0x432830[_0xcf56('0x82')][_0xcf56('0x69')]));}_0x55e5ef=_0x4be621[_0xcf56('0x93')]();_0x4be621['limit'](_0x5944eb);_0x4be621[_0xcf56('0x1f')](0x0);logger['debug'](_0xcf56('0xa5'),_0x4be621[_0xcf56('0x84')]());return dbH[_0xcf56('0x85')][_0xcf56('0x37')](_0x4be621[_0xcf56('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0xcf56('0xa3')]});}})[_0xcf56('0x28')](function(){return{'sql':_0x55e5ef[_0xcf56('0x84')]()};})[_0xcf56('0x28')](respondWithResult(_0x3f7adc,null))[_0xcf56('0x4c')](handleError(_0x3f7adc,null));};
\ No newline at end of file
+var _0x8592=['metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','name','right_join','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','getFields','clone','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','SELECT','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','dbH','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','includeAll','include','catch','show','params','keys','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','merge','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId'];(function(_0x2da402,_0x14a691){var _0x31a57d=function(_0x3cfb60){while(--_0x3cfb60){_0x2da402['push'](_0x2da402['shift']());}};_0x31a57d(++_0x14a691);}(_0x8592,0xd5));var _0x2859=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x8592[_0x207a02];return _0xd995c3;};'use strict';var emlformat=require(_0x2859('0x0'));var rimraf=require(_0x2859('0x1'));var zipdir=require(_0x2859('0x2'));var jsonpatch=require(_0x2859('0x3'));var rp=require(_0x2859('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2859('0x5'));var util=require(_0x2859('0x6'));var path=require(_0x2859('0x7'));var sox=require(_0x2859('0x8'));var csv=require(_0x2859('0x9'));var ejs=require(_0x2859('0xa'));var fs=require('fs');var fs_extra=require(_0x2859('0xb'));var _=require(_0x2859('0xc'));var squel=require('squel');var crypto=require(_0x2859('0xd'));var jsforce=require(_0x2859('0xe'));var deskjs=require(_0x2859('0xf'));var toCsv=require(_0x2859('0x9'));var querystring=require(_0x2859('0x10'));var Papa=require(_0x2859('0x11'));var Redis=require(_0x2859('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2859('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2859('0x14'));var logger=require(_0x2859('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2859('0x16'));var db=require(_0x2859('0x17'))['db'];var dbH=require(_0x2859('0x17'))[_0x2859('0x18')];function respondWithStatusCode(_0x3155c8,_0xeef6f){_0xeef6f=_0xeef6f||0xcc;return function(_0x32e53f){if(_0x32e53f){return _0x3155c8[_0x2859('0x19')](_0xeef6f);}return _0x3155c8['status'](_0xeef6f)[_0x2859('0x1a')]();};}function respondWithResult(_0x14426c,_0x2ab3dc){_0x2ab3dc=_0x2ab3dc||0xc8;return function(_0x1bf983){if(_0x1bf983){return _0x14426c['status'](_0x2ab3dc)[_0x2859('0x1b')](_0x1bf983);}};}function respondWithFilteredResult(_0x160b9b,_0x33894c){return function(_0x3e3c83){if(_0x3e3c83){var _0x3bd5c4=typeof _0x33894c[_0x2859('0x1c')]==='undefined'&&typeof _0x33894c[_0x2859('0x1d')]==='undefined';var _0x89f4a6=_0x3e3c83[_0x2859('0x1e')];var _0x2a7ec0=_0x3bd5c4?0x0:_0x33894c[_0x2859('0x1c')];var _0x1287d0=_0x3bd5c4?_0x3e3c83[_0x2859('0x1e')]:_0x33894c['offset']+_0x33894c[_0x2859('0x1d')];var _0x427b6a;if(_0x1287d0>=_0x89f4a6){_0x1287d0=_0x89f4a6;_0x427b6a=0xc8;}else{_0x427b6a=0xce;}_0x160b9b[_0x2859('0x1f')](_0x427b6a);return _0x160b9b[_0x2859('0x20')](_0x2859('0x21'),_0x2a7ec0+'-'+_0x1287d0+'/'+_0x89f4a6)[_0x2859('0x1b')](_0x3e3c83);}return null;};}function patchUpdates(_0x272930){return function(_0x2cced2){try{jsonpatch[_0x2859('0x22')](_0x2cced2,_0x272930,!![]);}catch(_0x3a4019){return BPromise[_0x2859('0x23')](_0x3a4019);}return _0x2cced2[_0x2859('0x24')]();};}function saveUpdates(_0x34c30b,_0x560124){return function(_0x1b2a50){if(_0x1b2a50){return _0x1b2a50[_0x2859('0x25')](_0x34c30b)[_0x2859('0x26')](function(_0x16bb07){return _0x16bb07;});}return null;};}function removeEntity(_0x2b213a,_0x6fc930){return function(_0x2fd4c6){if(_0x2fd4c6){return _0x2fd4c6[_0x2859('0x27')]()[_0x2859('0x26')](function(){var _0x1652f7=_0x2fd4c6[_0x2859('0x28')]({'plain':!![]});var _0xd75a60=_0x2859('0x29');return db[_0x2859('0x2a')][_0x2859('0x27')]({'where':{'type':_0xd75a60,'resourceId':_0x1652f7['id']}})['then'](function(){return _0x2fd4c6;});})[_0x2859('0x26')](function(){_0x2b213a[_0x2859('0x1f')](0xcc)[_0x2859('0x1a')]();});}};}function handleEntityNotFound(_0x3f74ad,_0x55ae79){return function(_0x1a066e){if(!_0x1a066e){_0x3f74ad['sendStatus'](0x194);}return _0x1a066e;};}function handleError(_0xe501f3,_0x80ab91){_0x80ab91=_0x80ab91||0x1f4;return function(_0x103a41){logger[_0x2859('0x2b')](_0x103a41['stack']);if(_0x103a41['name']){delete _0x103a41['name'];}_0xe501f3[_0x2859('0x1f')](_0x80ab91)[_0x2859('0x2c')](_0x103a41);};}exports[_0x2859('0x2d')]=function(_0x557b8a,_0xcccc58){var _0x250759={},_0x2cec8a={},_0x2b26e5={'count':0x0,'rows':[]};var _0x1721db=_[_0x2859('0x2e')](db[_0x2859('0x2f')][_0x2859('0x30')],function(_0x556492){return{'name':_0x556492[_0x2859('0x31')],'type':_0x556492[_0x2859('0x32')][_0x2859('0x33')]};});_0x2cec8a[_0x2859('0x34')]=_[_0x2859('0x2e')](_0x1721db,'name');_0x2cec8a['query']=_['keys'](_0x557b8a[_0x2859('0x35')]);_0x2cec8a[_0x2859('0x36')]=_[_0x2859('0x37')](_0x2cec8a[_0x2859('0x34')],_0x2cec8a[_0x2859('0x35')]);_0x250759[_0x2859('0x38')]=_['intersection'](_0x2cec8a['model'],qs['fields'](_0x557b8a[_0x2859('0x35')][_0x2859('0x39')]));_0x250759[_0x2859('0x38')]=_0x250759[_0x2859('0x38')][_0x2859('0x3a')]?_0x250759[_0x2859('0x38')]:_0x2cec8a[_0x2859('0x34')];if(!_0x557b8a[_0x2859('0x35')]['hasOwnProperty']('nolimit')){_0x250759[_0x2859('0x1d')]=qs[_0x2859('0x1d')](_0x557b8a['query'][_0x2859('0x1d')]);_0x250759[_0x2859('0x1c')]=qs[_0x2859('0x1c')](_0x557b8a[_0x2859('0x35')][_0x2859('0x1c')]);}_0x250759[_0x2859('0x3b')]=qs['sort'](_0x557b8a[_0x2859('0x35')][_0x2859('0x3c')]);_0x250759[_0x2859('0x3d')]=qs[_0x2859('0x36')](_['pick'](_0x557b8a['query'],_0x2cec8a[_0x2859('0x36')]),_0x1721db);if(_0x557b8a[_0x2859('0x35')][_0x2859('0x3e')]){_0x250759[_0x2859('0x3d')]=_['merge'](_0x250759[_0x2859('0x3d')],{'$or':_[_0x2859('0x2e')](_0x1721db,function(_0x2bcb76){if(_0x2bcb76[_0x2859('0x32')]!==_0x2859('0x3f')){var _0x964b92={};_0x964b92[_0x2bcb76['name']]={'$like':'%'+_0x557b8a[_0x2859('0x35')][_0x2859('0x3e')]+'%'};return _0x964b92;}})});}_0x250759=_['merge']({},_0x250759,_0x557b8a['options']);var _0x2eec15={'where':_0x250759[_0x2859('0x3d')]};return db[_0x2859('0x2f')][_0x2859('0x1e')](_0x2eec15)['then'](function(_0x165b01){_0x2b26e5[_0x2859('0x1e')]=_0x165b01;if(_0x557b8a[_0x2859('0x35')][_0x2859('0x40')]){_0x250759[_0x2859('0x41')]=[{'all':!![]}];}return db[_0x2859('0x2f')]['findAll'](_0x250759);})[_0x2859('0x26')](function(_0x51b10b){_0x2b26e5['rows']=_0x51b10b;return _0x2b26e5;})[_0x2859('0x26')](respondWithFilteredResult(_0xcccc58,_0x250759))[_0x2859('0x42')](handleError(_0xcccc58,null));};exports[_0x2859('0x43')]=function(_0x1cd982,_0x869d88){var _0x45d6a4={'raw':![],'where':{'id':_0x1cd982[_0x2859('0x44')]['id']}},_0x19b0c7={};_0x19b0c7[_0x2859('0x34')]=_[_0x2859('0x45')](db[_0x2859('0x2f')][_0x2859('0x30')]);_0x19b0c7[_0x2859('0x35')]=_['keys'](_0x1cd982[_0x2859('0x35')]);_0x19b0c7[_0x2859('0x36')]=_[_0x2859('0x37')](_0x19b0c7[_0x2859('0x34')],_0x19b0c7['query']);_0x45d6a4[_0x2859('0x38')]=_[_0x2859('0x37')](_0x19b0c7[_0x2859('0x34')],qs[_0x2859('0x39')](_0x1cd982[_0x2859('0x35')][_0x2859('0x39')]));_0x45d6a4[_0x2859('0x38')]=_0x45d6a4[_0x2859('0x38')][_0x2859('0x3a')]?_0x45d6a4[_0x2859('0x38')]:_0x19b0c7['model'];if(_0x1cd982[_0x2859('0x35')][_0x2859('0x40')]){_0x45d6a4[_0x2859('0x41')]=[{'all':!![]}];}_0x45d6a4=_['merge']({},_0x45d6a4,_0x1cd982[_0x2859('0x46')]);return db[_0x2859('0x2f')][_0x2859('0x47')](_0x45d6a4)['then'](handleEntityNotFound(_0x869d88,null))[_0x2859('0x26')](respondWithResult(_0x869d88,null))[_0x2859('0x42')](handleError(_0x869d88,null));};exports[_0x2859('0x48')]=function(_0x7b8c04,_0x14ae22){return db[_0x2859('0x2f')]['create'](_0x7b8c04['body'],{})[_0x2859('0x26')](function(_0x5a71e5){var _0x48fc29=_0x7b8c04['user'][_0x2859('0x28')]({'plain':!![]});if(!_0x48fc29)throw new Error(_0x2859('0x49'));if(_0x48fc29['role']===_0x2859('0x4a')){var _0x90de85=_0x5a71e5[_0x2859('0x28')]({'plain':!![]});var _0x30a9b9=_0x2859('0x4b');return db[_0x2859('0x4c')]['find']({'where':{'name':_0x30a9b9,'userProfileId':_0x48fc29[_0x2859('0x4d')]},'raw':!![]})[_0x2859('0x26')](function(_0x469ec7){if(_0x469ec7&&_0x469ec7[_0x2859('0x4e')]===0x0){return db['UserProfileResource'][_0x2859('0x48')]({'name':_0x90de85['name'],'resourceId':_0x90de85['id'],'type':'CustomReports','sectionId':_0x469ec7['id']},{})[_0x2859('0x26')](function(){return _0x5a71e5;});}else{return _0x5a71e5;}})[_0x2859('0x42')](function(_0x18f6ef){logger[_0x2859('0x2b')](_0x2859('0x4f'),_0x18f6ef);throw _0x18f6ef;});}return _0x5a71e5;})[_0x2859('0x26')](respondWithResult(_0x14ae22,0xc9))['catch'](handleError(_0x14ae22,null));};exports['update']=function(_0xb02f58,_0x41fb0d){if(_0xb02f58['body']['id']){delete _0xb02f58[_0x2859('0x50')]['id'];}return db[_0x2859('0x2f')][_0x2859('0x47')]({'where':{'id':_0xb02f58[_0x2859('0x44')]['id']}})[_0x2859('0x26')](handleEntityNotFound(_0x41fb0d,null))[_0x2859('0x26')](saveUpdates(_0xb02f58[_0x2859('0x50')],null))['then'](respondWithResult(_0x41fb0d,null))['catch'](handleError(_0x41fb0d,null));};exports[_0x2859('0x27')]=function(_0xaf6106,_0x12ec55){return db[_0x2859('0x2f')][_0x2859('0x47')]({'where':{'id':_0xaf6106[_0x2859('0x44')]['id']}})[_0x2859('0x26')](handleEntityNotFound(_0x12ec55,null))[_0x2859('0x26')](removeEntity(_0x12ec55,null))[_0x2859('0x42')](handleError(_0x12ec55,null));};exports[_0x2859('0x51')]=function(_0x368e9b,_0x185dea){var _0x534b0e=0xa;var _0x10eb18=[_0x2859('0x52'),'left_join','right_join',_0x2859('0x53')];var _0x34e783={'SUM':_0x2859('0x54'),'COUNT':_0x2859('0x55'),'COUNT DISTINCT':_0x2859('0x56'),'MAX':_0x2859('0x57'),'MIN':_0x2859('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2859('0x59'),'GROUP_CONCAT DESC':_0x2859('0x5a')};var _0x114d38={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2859('0x5b'),'HOUR':_0x2859('0x5c'),'ROUND':_0x2859('0x5d'),'UNIX_TIMESTAMP':_0x2859('0x5e')};var _0x2555e0=function(_0x59515a){return!_[_0x2859('0x5f')]([_0x2859('0x60'),_0x2859('0x61'),_0x2859('0x62'),_0x2859('0x63')],_0x59515a);};var _0x35d92e=function(_0x4f3940){if(!_0x4f3940||!_0x4f3940[_0x2859('0x64')][_0x2859('0x3a')]){return'';}for(var _0x4cc54a='(',_0x3d390f=0x0;_0x3d390f<_0x4f3940[_0x2859('0x64')]['length'];_0x3d390f+=0x1){_0x3d390f>0x0&&(_0x4cc54a+='\x20'+_0x4f3940['operator']+'\x20');_0x4cc54a+=_0x4f3940['rules'][_0x3d390f]['group']?_0x35d92e(_0x4f3940[_0x2859('0x64')][_0x3d390f][_0x2859('0x65')]):_0x4f3940['rules'][_0x3d390f]['field']+'\x20'+_0x4f3940[_0x2859('0x64')][_0x3d390f][_0x2859('0x66')]+(_0x2555e0(_0x4f3940['rules'][_0x3d390f][_0x2859('0x66')])?'\x20'+_0x4f3940[_0x2859('0x64')][_0x3d390f][_0x2859('0x67')]:'');}return _0x4cc54a+')';};var _0x18ab39={'where':{'id':_0x368e9b[_0x2859('0x44')]['id']}},_0x4cd1e2,_0x5eac74,_0x377c8d,_0x2a71cb,_0x2eded0;_0x18ab39=_[_0x2859('0x68')]({},_0x18ab39,_0x368e9b[_0x2859('0x46')]);return db['AnalyticCustomReport']['find'](_0x18ab39)[_0x2859('0x26')](function(_0x3b2083){if(_0x3b2083){_0x4cd1e2=_0x3b2083;return _0x3b2083['getFields']();}return null;})[_0x2859('0x26')](function(_0x521b1c){if(_0x521b1c){if(!_0x521b1c[_0x2859('0x3a')]){throw new db[(_0x2859('0x69'))][(_0x2859('0x6a'))](_0x2859('0x6b'),0x193);}_0x5eac74=_0x521b1c;return db[_0x2859('0x6c')][_0x2859('0x6d')]({'raw':!![]});}return null;})[_0x2859('0x26')](function(_0x3a8d76){if(_0x3a8d76){_0x377c8d=_[_0x2859('0x6e')](_0x3a8d76,'id');var _0x49ca0d;var _0x291341=squel[_0x2859('0x6f')]();_0x291341[_0x2859('0x70')](_0x4cd1e2[_0x2859('0x71')]);for(var _0x1aaac2=0x0;_0x1aaac2<_0x5eac74[_0x2859('0x3a')];_0x1aaac2+=0x1){_0x49ca0d=_0x5eac74[_0x1aaac2][_0x2859('0x72')]?_0x377c8d[_0x5eac74[_0x1aaac2][_0x2859('0x72')]][_0x2859('0x73')]:_0x5eac74[_0x1aaac2][_0x2859('0x74')];_0x49ca0d=_0x5eac74[_0x1aaac2][_0x2859('0x75')]?_[_0x2859('0x76')](_0x34e783[_0x5eac74[_0x1aaac2][_0x2859('0x75')]],'%s',_0x49ca0d):_0x49ca0d;_0x49ca0d=_0x5eac74[_0x1aaac2][_0x2859('0x77')]?_[_0x2859('0x76')](_0x114d38[_0x5eac74[_0x1aaac2][_0x2859('0x77')]],'%s',_0x49ca0d):_0x49ca0d;if(_0x5eac74[_0x1aaac2][_0x2859('0x78')]){_0x291341[_0x2859('0x65')](_0x49ca0d);}_0x5eac74[_0x1aaac2][_0x2859('0x79')]&&_0x291341[_0x2859('0x3b')](_0x49ca0d,_0x5eac74[_0x1aaac2][_0x2859('0x79')]===_0x2859('0x7a')?![]:!![]);_0x291341[_0x2859('0x74')](_0x49ca0d,_0x5eac74[_0x1aaac2][_0x2859('0x7b')]||_0x49ca0d);}if(_0x4cd1e2[_0x2859('0x7c')]){_0x4cd1e2['joins']=JSON[_0x2859('0x7d')](_0x4cd1e2[_0x2859('0x7c')]);for(var _0xca7b8c=0x0;_0xca7b8c<_0x4cd1e2['joins'][_0x2859('0x3a')];_0xca7b8c+=0x1){if(_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c][_0x2859('0x32')]&&_[_0x2859('0x5f')](_0x10eb18,_0x4cd1e2['joins'][_0xca7b8c]['type'])&&_0x4cd1e2['joins'][_0xca7b8c]['parentKey']&&_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c]['foreignTable']&&_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c][_0x2859('0x7e')]){_0x291341[_0x4cd1e2['joins'][_0xca7b8c][_0x2859('0x32')]](_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c][_0x2859('0x7f')],null,util['format'](_0x2859('0x80'),_0x4cd1e2['table'],_0x4cd1e2['joins'][_0xca7b8c][_0x2859('0x81')],_0x4cd1e2['joins'][_0xca7b8c][_0x2859('0x7f')],_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c]['foreignKey']));}}}if(_0x4cd1e2['conditions']){_0x4cd1e2[_0x2859('0x82')]=JSON[_0x2859('0x7d')](_0x4cd1e2[_0x2859('0x82')]);_0x291341['where'](_0x35d92e(_0x4cd1e2[_0x2859('0x82')][_0x2859('0x65')]));}_0x2eded0=_0x291341['clone']();_0x291341[_0x2859('0x1d')](_0x534b0e);_0x291341['offset'](0x0);logger[_0x2859('0x83')](_0x2859('0x84'),_0x291341['toString']());return dbH[_0x2859('0x85')]['query'](_0x291341[_0x2859('0x86')](),{'type':dbH[_0x2859('0x85')][_0x2859('0x87')]['SELECT']});}})[_0x2859('0x26')](respondWithResult(_0x185dea,null))['catch'](handleError(_0x185dea,null));};function runReport(_0x2ed25e,_0x2e5605,_0x5b0e31){var _0xbf88d7=_0x2e5605[_0x2859('0x88')];var _0x24678d=0xa;var _0x3b18ec=[_0x2859('0x52'),'left_join',_0x2859('0x89'),_0x2859('0x53')];var _0x19a136={'SUM':_0x2859('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x2859('0x58'),'AVG':_0x2859('0x8a'),'GROUP_CONCAT':_0x2859('0x8b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2859('0x5a')};var _0x962ddc={'SEC_TO_TIME':_0x2859('0x8c'),'DATE':_0x2859('0x5b'),'HOUR':_0x2859('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24bd9f=function(_0x1d5056){return!_[_0x2859('0x5f')]([_0x2859('0x60'),_0x2859('0x61'),_0x2859('0x62'),_0x2859('0x63')],_0x1d5056);};var _0x5c6511=function(_0x18576b){if(!_0x18576b||!_0x18576b['rules'][_0x2859('0x3a')]){return'';}for(var _0x52ba6a='(',_0x55638f=0x0;_0x55638f<_0x18576b['rules'][_0x2859('0x3a')];_0x55638f+=0x1){_0x55638f>0x0&&(_0x52ba6a+='\x20'+_0x18576b['operator']+'\x20');_0x52ba6a+=_0x18576b[_0x2859('0x64')][_0x55638f]['group']?_0x5c6511(_0x18576b[_0x2859('0x64')][_0x55638f]['group']):_0x18576b[_0x2859('0x64')][_0x55638f][_0x2859('0x74')]+'\x20'+_0x18576b[_0x2859('0x64')][_0x55638f][_0x2859('0x66')]+(_0x24bd9f(_0x18576b[_0x2859('0x64')][_0x55638f][_0x2859('0x66')])?'\x20'+_0x18576b['rules'][_0x55638f][_0x2859('0x67')]:'');}return _0x52ba6a+')';};var _0x2761d9={'where':{'id':_0x2ed25e['id']}},_0x4df1da,_0x3842ae,_0x5be7f8,_0x203f4d,_0x4331b4;_0x2761d9=_[_0x2859('0x68')]({},_0x2761d9,_0x5b0e31);return db['AnalyticCustomReport'][_0x2859('0x47')](_0x2761d9)['then'](function(_0x40348f){if(_0x40348f){_0x4df1da=_0x40348f;return _0x40348f[_0x2859('0x8d')]();}return null;})[_0x2859('0x26')](function(_0x43c6ee){if(_0x43c6ee){if(!_0x43c6ee['length']){throw new db['Sequelize'][(_0x2859('0x6a'))](_0x2859('0x6b'),0x193);}_0x3842ae=_0x43c6ee;return db[_0x2859('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x46dbc5){if(_0x46dbc5){_0x5be7f8=_['keyBy'](_0x46dbc5,'id');var _0x61a35e;var _0x398ee4=squel[_0x2859('0x6f')]();_0x398ee4[_0x2859('0x70')](_0x4df1da[_0x2859('0x71')]);for(var _0x5957ee=0x0;_0x5957ee<_0x3842ae[_0x2859('0x3a')];_0x5957ee+=0x1){_0x61a35e=_0x3842ae[_0x5957ee]['MetricId']?_0x5be7f8[_0x3842ae[_0x5957ee][_0x2859('0x72')]][_0x2859('0x73')]:_0x3842ae[_0x5957ee]['field'];_0x61a35e=_0x3842ae[_0x5957ee][_0x2859('0x75')]?_[_0x2859('0x76')](_0x19a136[_0x3842ae[_0x5957ee]['function']],'%s',_0x61a35e):_0x61a35e;_0x61a35e=_0x3842ae[_0x5957ee][_0x2859('0x77')]?_[_0x2859('0x76')](_0x962ddc[_0x3842ae[_0x5957ee][_0x2859('0x77')]],'%s',_0x61a35e):_0x61a35e;if(_0x3842ae[_0x5957ee]['groupBy']){_0x398ee4[_0x2859('0x65')](_0x61a35e);}_0x3842ae[_0x5957ee][_0x2859('0x79')]&&_0x398ee4[_0x2859('0x3b')](_0x61a35e,_0x3842ae[_0x5957ee][_0x2859('0x79')]===_0x2859('0x7a')?![]:!![]);_0x398ee4[_0x2859('0x74')](_0x61a35e,_0x3842ae[_0x5957ee][_0x2859('0x7b')]||_0x61a35e);}if(_0x4df1da[_0x2859('0x7c')]){_0x4df1da['joins']=JSON[_0x2859('0x7d')](_0x4df1da[_0x2859('0x7c')]);for(var _0x162391=0x0;_0x162391<_0x4df1da[_0x2859('0x7c')][_0x2859('0x3a')];_0x162391+=0x1){if(_0x4df1da[_0x2859('0x7c')][_0x162391]['type']&&_['includes'](_0x3b18ec,_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x32')])&&_0x4df1da['joins'][_0x162391][_0x2859('0x81')]&&_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7f')]&&_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7e')]){_0x398ee4[_0x4df1da[_0x2859('0x7c')][_0x162391]['type']](_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7f')],null,util['format'](_0x2859('0x80'),_0x4df1da[_0x2859('0x71')],_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x81')],_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7f')],_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7e')]));}}}if(_0x4df1da[_0x2859('0x82')]){_0x4df1da['conditions']=JSON['parse'](_0x4df1da[_0x2859('0x82')]);_0x398ee4[_0x2859('0x3d')](_0x5c6511(_0x4df1da[_0x2859('0x82')][_0x2859('0x65')]));}_0x4331b4=_0x398ee4[_0x2859('0x8e')]();_0x398ee4[_0x2859('0x1d')](_0x24678d);_0x398ee4[_0x2859('0x1c')](0x0);return;}})['then'](function(){if(_0x2e5605[_0x2859('0x8f')]===_0x2859('0x90')){return null;}var _0x40b7f7=_[_0x2859('0x68')](_0x2e5605,{'name':_0x2e5605['fullPath']||_0x2e5605['name']||_0x4df1da[_0x2859('0x88')],'basename':_0xbf88d7,'savename':util['format']('%s-%s.%s',_0x2e5605[_0x2859('0x88')]||_0x4df1da[_0x2859('0x88')],require(_0x2859('0x91'))[_0x2859('0x92')](0x4),_0x2e5605[_0x2859('0x8f')]||_0x2859('0x93')),'reportId':_0x4df1da['id'],'reportType':_0x2859('0x94')});return db[_0x2859('0x95')][_0x2859('0x48')](_0x40b7f7,{'raw':!![]});})[_0x2859('0x26')](function(_0x927af6){if(_0x4df1da[_0x2859('0x71')]===_0x2859('0x96')){_0x4331b4[_0x2859('0x3d')](_0x4df1da['table']+_0x2859('0x97'),_0x2e5605[_0x2859('0x98')],_0x2e5605[_0x2859('0x99')]);}else{_0x4331b4[_0x2859('0x3d')](_0x4df1da[_0x2859('0x71')]+_0x2859('0x9a'),_0x2e5605[_0x2859('0x98')],_0x2e5605[_0x2859('0x99')]);}if(_0x927af6){logger[_0x2859('0x9b')](_0x2859('0x9c'),_0x4331b4[_0x2859('0x86')]());require(_0x2859('0x9d'))[_0x2859('0x9e')](path[_0x2859('0x52')](__dirname,_0x2859('0x9f'),_0x927af6[_0x2859('0x8f')]),[_0x927af6['id'],_0x4331b4[_0x2859('0x86')](),path[_0x2859('0x52')](__dirname,_0x2859('0xa0'),_0x927af6['savename']),_0xbf88d7]);return _0x927af6;}else{var _0x5a35ab=squel[_0x2859('0x6f')]();_0x5a35ab[_0x2859('0x70')]('('+_0x4331b4[_0x2859('0x86')]()+')','countTable');_0x5a35ab[_0x2859('0x74')](_0x2859('0xa1'),_0x2859('0x1e'));_0x4331b4[_0x2859('0x1d')](_0x2e5605[_0x2859('0x1d')]||_0x24678d);_0x4331b4[_0x2859('0x1c')](_0x2e5605[_0x2859('0x1c')]||0x0);return dbH[_0x2859('0x85')][_0x2859('0x35')](_0x5a35ab['toString'](),{'type':dbH[_0x2859('0x85')][_0x2859('0x87')]['SELECT']})[_0x2859('0x26')](function(_0x44d278){if(!_0x44d278[_0x2859('0x3a')]){_0x203f4d=0x0;}else{_0x203f4d=_0x44d278[0x0][_0x2859('0x1e')]||0x0;}return dbH[_0x2859('0x85')][_0x2859('0x35')](_0x4331b4[_0x2859('0x86')](),{'type':dbH[_0x2859('0x85')][_0x2859('0x87')][_0x2859('0xa2')]});})[_0x2859('0x26')](function(_0x48112e){return{'rows':_0x48112e||[],'count':_0x203f4d};});}});}exports['run']=function(_0x565301,_0x1218c2){return runReport(_0x565301[_0x2859('0x44')],_0x565301[_0x2859('0x35')],_0x565301[_0x2859('0x46')])[_0x2859('0x26')](respondWithResult(_0x1218c2,null))['catch'](handleError(_0x1218c2,null));};exports[_0x2859('0xa3')]=runReport;exports[_0x2859('0x35')]=function(_0x4eab39,_0x2def26){var _0x13955a=0xa;var _0x3cdd34=['join','left_join',_0x2859('0x89'),'cross_join'];var _0x21c54f={'SUM':'SUM(%s)','COUNT':_0x2859('0x55'),'COUNT DISTINCT':_0x2859('0x56'),'MAX':_0x2859('0x57'),'MIN':_0x2859('0x58'),'AVG':_0x2859('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2859('0x59'),'GROUP_CONCAT DESC':_0x2859('0x5a')};var _0x41387b={'SEC_TO_TIME':_0x2859('0x8c'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2859('0x5e')};var _0x3c3772=function(_0x527926){return!_[_0x2859('0x5f')]([_0x2859('0x60'),_0x2859('0x61'),_0x2859('0x62'),'IS\x20NOT\x20EMPTY'],_0x527926);};var _0x106cd2=function(_0x31145d){if(!_0x31145d||!_0x31145d['rules'][_0x2859('0x3a')]){return'';}for(var _0x1c6931='(',_0x13ab2f=0x0;_0x13ab2f<_0x31145d[_0x2859('0x64')]['length'];_0x13ab2f+=0x1){_0x13ab2f>0x0&&(_0x1c6931+='\x20'+_0x31145d['operator']+'\x20');_0x1c6931+=_0x31145d[_0x2859('0x64')][_0x13ab2f][_0x2859('0x65')]?_0x106cd2(_0x31145d[_0x2859('0x64')][_0x13ab2f][_0x2859('0x65')]):_0x31145d[_0x2859('0x64')][_0x13ab2f][_0x2859('0x74')]+'\x20'+_0x31145d['rules'][_0x13ab2f][_0x2859('0x66')]+(_0x3c3772(_0x31145d['rules'][_0x13ab2f][_0x2859('0x66')])?'\x20'+_0x31145d[_0x2859('0x64')][_0x13ab2f][_0x2859('0x67')]:'');}return _0x1c6931+')';};var _0x782a97={'where':{'id':_0x4eab39[_0x2859('0x44')]['id']}},_0x2eb99a,_0x5108a5,_0x477a28,_0x104ab2,_0xeea1a9;_0x782a97=_[_0x2859('0x68')]({},_0x782a97,_0x4eab39['options']);return db[_0x2859('0x2f')][_0x2859('0x47')](_0x782a97)[_0x2859('0x26')](function(_0x1bcdb7){if(_0x1bcdb7){_0x2eb99a=_0x1bcdb7;return _0x1bcdb7['getFields']();}return null;})['then'](function(_0x27712f){if(_0x27712f){if(!_0x27712f[_0x2859('0x3a')]){throw new db[(_0x2859('0x69'))][(_0x2859('0x6a'))](_0x2859('0x6b'),0x193);}_0x5108a5=_0x27712f;return db['AnalyticMetric'][_0x2859('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x3f3bb6){if(_0x3f3bb6){_0x477a28=_[_0x2859('0x6e')](_0x3f3bb6,'id');var _0x169a49;var _0x54d94a=squel[_0x2859('0x6f')]();_0x54d94a[_0x2859('0x70')](_0x2eb99a[_0x2859('0x71')]);for(var _0x34dc7b=0x0;_0x34dc7b<_0x5108a5[_0x2859('0x3a')];_0x34dc7b+=0x1){_0x169a49=_0x5108a5[_0x34dc7b][_0x2859('0x72')]?_0x477a28[_0x5108a5[_0x34dc7b][_0x2859('0x72')]][_0x2859('0x73')]:_0x5108a5[_0x34dc7b][_0x2859('0x74')];_0x169a49=_0x5108a5[_0x34dc7b][_0x2859('0x75')]?_[_0x2859('0x76')](_0x21c54f[_0x5108a5[_0x34dc7b][_0x2859('0x75')]],'%s',_0x169a49):_0x169a49;_0x169a49=_0x5108a5[_0x34dc7b][_0x2859('0x77')]?_['replace'](_0x41387b[_0x5108a5[_0x34dc7b][_0x2859('0x77')]],'%s',_0x169a49):_0x169a49;if(_0x5108a5[_0x34dc7b]['groupBy']){_0x54d94a['group'](_0x169a49);}_0x5108a5[_0x34dc7b][_0x2859('0x79')]&&_0x54d94a['order'](_0x169a49,_0x5108a5[_0x34dc7b][_0x2859('0x79')]===_0x2859('0x7a')?![]:!![]);_0x54d94a['field'](_0x169a49,_0x5108a5[_0x34dc7b]['alias']||_0x169a49);}if(_0x2eb99a[_0x2859('0x7c')]){_0x2eb99a[_0x2859('0x7c')]=JSON[_0x2859('0x7d')](_0x2eb99a[_0x2859('0x7c')]);for(var _0x5ca306=0x0;_0x5ca306<_0x2eb99a[_0x2859('0x7c')][_0x2859('0x3a')];_0x5ca306+=0x1){if(_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x32')]&&_[_0x2859('0x5f')](_0x3cdd34,_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x32')])&&_0x2eb99a['joins'][_0x5ca306][_0x2859('0x81')]&&_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x7f')]&&_0x2eb99a['joins'][_0x5ca306][_0x2859('0x7e')]){_0x54d94a[_0x2eb99a['joins'][_0x5ca306][_0x2859('0x32')]](_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x7f')],null,util[_0x2859('0x77')](_0x2859('0x80'),_0x2eb99a[_0x2859('0x71')],_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x81')],_0x2eb99a['joins'][_0x5ca306][_0x2859('0x7f')],_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x7e')]));}}}if(_0x2eb99a[_0x2859('0x82')]){_0x2eb99a['conditions']=JSON[_0x2859('0x7d')](_0x2eb99a['conditions']);_0x54d94a[_0x2859('0x3d')](_0x106cd2(_0x2eb99a[_0x2859('0x82')][_0x2859('0x65')]));}_0xeea1a9=_0x54d94a[_0x2859('0x8e')]();_0x54d94a[_0x2859('0x1d')](_0x13955a);_0x54d94a['offset'](0x0);logger['debug'](_0x2859('0x84'),_0x54d94a['toString']());return dbH[_0x2859('0x85')][_0x2859('0x35')](_0x54d94a[_0x2859('0x86')](),{'type':dbH[_0x2859('0x85')][_0x2859('0x87')]['SELECT']});}})[_0x2859('0x26')](function(){return{'sql':_0xeea1a9[_0x2859('0x86')]()};})[_0x2859('0x26')](respondWithResult(_0x2def26,null))[_0x2859('0x42')](handleError(_0x2def26,null));};
\ No newline at end of file
index 8c86e09..bf3d586 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1649=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x3f7bfd,_0x1d5c83){var _0xa94181=function(_0x25b394){while(--_0x25b394){_0x3f7bfd['push'](_0x3f7bfd['shift']());}};_0xa94181(++_0x1d5c83);}(_0x1649,0xc3));var _0x9164=function(_0x58b710,_0x4f08cb){_0x58b710=_0x58b710-0x0;var _0x5d0d37=_0x1649[_0x58b710];return _0x5d0d37;};'use strict';var _=require(_0x9164('0x0'));var util=require(_0x9164('0x1'));var logger=require(_0x9164('0x2'))(_0x9164('0x3'));var moment=require(_0x9164('0x4'));var BPromise=require('bluebird');var rp=require(_0x9164('0x5'));var fs=require('fs');var path=require(_0x9164('0x6'));var rimraf=require(_0x9164('0x7'));var config=require(_0x9164('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x9164('0x9')]=function(_0x5c66c6,_0x1c5804){return _0x5c66c6[_0x9164('0xa')](_0x9164('0xb'),attributes,{'tableName':_0x9164('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c45=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird'];(function(_0x40e0d6,_0xb1e94b){var _0x32cfe8=function(_0x31e355){while(--_0x31e355){_0x40e0d6['push'](_0x40e0d6['shift']());}};_0x32cfe8(++_0xb1e94b);}(_0x0c45,0x70));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x50c4('0x0'));var util=require(_0x50c4('0x1'));var logger=require(_0x50c4('0x2'))(_0x50c4('0x3'));var moment=require('moment');var BPromise=require(_0x50c4('0x4'));var rp=require(_0x50c4('0x5'));var fs=require('fs');var path=require(_0x50c4('0x6'));var rimraf=require('rimraf');var config=require(_0x50c4('0x7'));var attributes=require(_0x50c4('0x8'));module[_0x50c4('0x9')]=function(_0x31c092,_0x45dc5a){return _0x31c092[_0x50c4('0xa')](_0x50c4('0xb'),attributes,{'tableName':_0x50c4('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 38db434..1ee8b65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7440=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7440,0x167));var _0x0744=function(_0xf5cf24,_0x8aa845){_0xf5cf24=_0xf5cf24-0x0;var _0x1c2d88=_0x7440[_0xf5cf24];return _0x1c2d88;};'use strict';var _=require(_0x0744('0x0'));var util=require(_0x0744('0x1'));var moment=require(_0x0744('0x2'));var BPromise=require(_0x0744('0x3'));var rs=require(_0x0744('0x4'));var fs=require('fs');var Redis=require(_0x0744('0x5'));var db=require(_0x0744('0x6'))['db'];var utils=require(_0x0744('0x7'));var logger=require(_0x0744('0x8'))(_0x0744('0x9'));var config=require(_0x0744('0xa'));var jayson=require(_0x0744('0xb'));var client=jayson[_0x0744('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b66db,_0x18b8f7,_0x58f286){return new BPromise(function(_0x26e110,_0x4d6741){return client[_0x0744('0xd')](_0x1b66db,_0x58f286)[_0x0744('0xe')](function(_0x242aad){logger['info'](_0x0744('0xf'),_0x18b8f7,'request\x20sent');logger[_0x0744('0x10')](_0x0744('0x11'),_0x18b8f7,_0x0744('0x12'),JSON[_0x0744('0x13')](_0x242aad));if(_0x242aad[_0x0744('0x14')]){if(_0x242aad[_0x0744('0x14')][_0x0744('0x15')]===0x1f4){logger[_0x0744('0x14')](_0x0744('0xf'),_0x18b8f7,_0x242aad[_0x0744('0x14')][_0x0744('0x16')]);return _0x4d6741(_0x242aad['error'][_0x0744('0x16')]);}logger['error'](_0x0744('0xf'),_0x18b8f7,_0x242aad[_0x0744('0x14')][_0x0744('0x16')]);return _0x26e110(_0x242aad[_0x0744('0x14')][_0x0744('0x16')]);}else{logger[_0x0744('0x17')](_0x0744('0xf'),_0x18b8f7,_0x0744('0x12'));_0x26e110(_0x242aad[_0x0744('0x18')][_0x0744('0x16')]);}})['catch'](function(_0x43b3cb){logger[_0x0744('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x18b8f7,_0x43b3cb);_0x4d6741(_0x43b3cb);});});}
\ No newline at end of file
+var _0x1ab5=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1ab5,0x15b));var _0x51ab=function(_0x2f1277,_0x57d562){_0x2f1277=_0x2f1277-0x0;var _0x3bdbba=_0x1ab5[_0x2f1277];return _0x3bdbba;};'use strict';var _=require(_0x51ab('0x0'));var util=require(_0x51ab('0x1'));var moment=require(_0x51ab('0x2'));var BPromise=require(_0x51ab('0x3'));var rs=require(_0x51ab('0x4'));var fs=require('fs');var Redis=require(_0x51ab('0x5'));var db=require(_0x51ab('0x6'))['db'];var utils=require(_0x51ab('0x7'));var logger=require('../../config/logger')(_0x51ab('0x8'));var config=require(_0x51ab('0x9'));var jayson=require(_0x51ab('0xa'));var client=jayson[_0x51ab('0xb')][_0x51ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1bc877,_0x44bc18,_0x18b118){return new BPromise(function(_0x254066,_0x3ffaf2){return client[_0x51ab('0xd')](_0x1bc877,_0x18b118)[_0x51ab('0xe')](function(_0x5eca0e){logger[_0x51ab('0xf')](_0x51ab('0x10'),_0x44bc18,_0x51ab('0x11'));logger['debug'](_0x51ab('0x12'),_0x44bc18,'request\x20sent',JSON[_0x51ab('0x13')](_0x5eca0e));if(_0x5eca0e[_0x51ab('0x14')]){if(_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x15')]===0x1f4){logger[_0x51ab('0x14')](_0x51ab('0x10'),_0x44bc18,_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x16')]);return _0x3ffaf2(_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x16')]);}logger[_0x51ab('0x14')](_0x51ab('0x10'),_0x44bc18,_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x16')]);return _0x254066(_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x16')]);}else{logger[_0x51ab('0xf')](_0x51ab('0x10'),_0x44bc18,_0x51ab('0x11'));_0x254066(_0x5eca0e['result'][_0x51ab('0x16')]);}})[_0x51ab('0x17')](function(_0x27b888){logger[_0x51ab('0x14')](_0x51ab('0x10'),_0x44bc18,_0x27b888);_0x3ffaf2(_0x27b888);});});}
\ No newline at end of file
index 515deb3..4f6bbde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ab=['query','post','create','update','delete','destroy','exports','multer','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','/:id/query'];(function(_0x5c3cfd,_0x491545){var _0x3488f1=function(_0x3a3784){while(--_0x3a3784){_0x5c3cfd['push'](_0x5c3cfd['shift']());}};_0x3488f1(++_0x491545);}(_0xc4ab,0x1d5));var _0xbc4a=function(_0x17b2ba,_0x4a3ad8){_0x17b2ba=_0x17b2ba-0x0;var _0x2e7600=_0xc4ab[_0x17b2ba];return _0x2e7600;};'use strict';var multer=require(_0xbc4a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc4a('0x1'));var router=express[_0xbc4a('0x2')]();var fs_extra=require(_0xbc4a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbc4a('0x4'));var controller=require(_0xbc4a('0x5'));router[_0xbc4a('0x6')]('/',auth[_0xbc4a('0x7')](),controller[_0xbc4a('0x8')]);router[_0xbc4a('0x6')](_0xbc4a('0x9'),auth[_0xbc4a('0x7')](),controller['show']);router[_0xbc4a('0x6')](_0xbc4a('0xa'),auth[_0xbc4a('0x7')](),controller[_0xbc4a('0xb')]);router[_0xbc4a('0x6')]('/:id/run',auth[_0xbc4a('0x7')](),controller[_0xbc4a('0xc')]);router[_0xbc4a('0x6')](_0xbc4a('0xd'),auth[_0xbc4a('0x7')](),controller[_0xbc4a('0xe')]);router[_0xbc4a('0xf')]('/',auth[_0xbc4a('0x7')](),controller[_0xbc4a('0x10')]);router['put'](_0xbc4a('0x9'),auth[_0xbc4a('0x7')](),controller[_0xbc4a('0x11')]);router[_0xbc4a('0x12')](_0xbc4a('0x9'),auth[_0xbc4a('0x7')](),controller[_0xbc4a('0x13')]);module[_0xbc4a('0x14')]=router;
\ No newline at end of file
+var _0x6fd7=['show','preview','/:id/run','run','query','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x28dfff,_0x40dcff){var _0x351572=function(_0x42aecc){while(--_0x42aecc){_0x28dfff['push'](_0x28dfff['shift']());}};_0x351572(++_0x40dcff);}(_0x6fd7,0x11f));var _0x76fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fd7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x76fd('0x0'));var util=require(_0x76fd('0x1'));var path=require('path');var timeout=require(_0x76fd('0x2'));var express=require(_0x76fd('0x3'));var router=express['Router']();var fs_extra=require(_0x76fd('0x4'));var auth=require(_0x76fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x76fd('0x6'));var controller=require(_0x76fd('0x7'));router[_0x76fd('0x8')]('/',auth[_0x76fd('0x9')](),controller[_0x76fd('0xa')]);router[_0x76fd('0x8')](_0x76fd('0xb'),auth[_0x76fd('0x9')](),controller[_0x76fd('0xc')]);router[_0x76fd('0x8')]('/:id/preview',auth[_0x76fd('0x9')](),controller[_0x76fd('0xd')]);router['get'](_0x76fd('0xe'),auth[_0x76fd('0x9')](),controller[_0x76fd('0xf')]);router[_0x76fd('0x8')]('/:id/query',auth[_0x76fd('0x9')](),controller[_0x76fd('0x10')]);router['post']('/',auth[_0x76fd('0x9')](),controller[_0x76fd('0x11')]);router[_0x76fd('0x12')](_0x76fd('0xb'),auth[_0x76fd('0x9')](),controller[_0x76fd('0x13')]);router[_0x76fd('0x14')](_0x76fd('0xb'),auth[_0x76fd('0x9')](),controller[_0x76fd('0x15')]);module[_0x76fd('0x16')]=router;
\ No newline at end of file
index aed597a..e7e73d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x4f000c,_0x2c38a9){var _0x925288=function(_0x5f4f1b){while(--_0x5f4f1b){_0x4f000c['push'](_0x4f000c['shift']());}};_0x925288(++_0x2c38a9);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x5f48ed,_0x6f6e7){_0x5f48ed=_0x5f48ed-0x0;var _0xf06d87=_0x3f8a[_0x5f48ed];return _0xf06d87;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
+var _0x8958=['TEXT','exports'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x8958,0x93));var _0x8895=function(_0x4350ec,_0x3d0740){_0x4350ec=_0x4350ec-0x0;var _0x10c2fe=_0x8958[_0x4350ec];return _0x10c2fe;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 50619c1..11b2c9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x1e6c7e,_0xbd2c4e){var _0xb2d5f4=function(_0x58cde4){while(--_0x58cde4){_0x1e6c7e['push'](_0x1e6c7e['shift']());}};_0xb2d5f4(++_0xbd2c4e);}(_0x31f0,0xb7));var _0x031f=function(_0x542729,_0x1bc93e){_0x542729=_0x542729-0x0;var _0x306ec8=_0x31f0[_0x542729];return _0x306ec8;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
+var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x4e19d3,_0x5a30bf){var _0x96eade=function(_0x4d1cc9){while(--_0x4d1cc9){_0x4e19d3['push'](_0x4e19d3['shift']());}};_0x96eade(++_0x5a30bf);}(_0x524e,0x15e));var _0xe524=function(_0x318e0a,_0x9677c2){_0x318e0a=_0x318e0a-0x0;var _0x25201a=_0x524e[_0x318e0a];return _0x25201a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));};
\ No newline at end of file
index f019e49..3e1816b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dfd=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x2e4b92,_0x5e6ea4){var _0x11f5e1=function(_0x30bc78){while(--_0x30bc78){_0x2e4b92['push'](_0x2e4b92['shift']());}};_0x11f5e1(++_0x5e6ea4);}(_0x9dfd,0xfe));var _0xd9df=function(_0x4c866a,_0x3769c5){_0x4c866a=_0x4c866a-0x0;var _0x132bcf=_0x9dfd[_0x4c866a];return _0x132bcf;};'use strict';var _=require(_0xd9df('0x0'));var util=require(_0xd9df('0x1'));var logger=require(_0xd9df('0x2'))('api');var moment=require(_0xd9df('0x3'));var BPromise=require(_0xd9df('0x4'));var rp=require(_0xd9df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9df('0x6'));var config=require(_0xd9df('0x7'));var attributes=require(_0xd9df('0x8'));module[_0xd9df('0x9')]=function(_0xffcc4a,_0x526b2c){return _0xffcc4a['define'](_0xd9df('0xa'),attributes,{'tableName':_0xd9df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7732=['define','AnalyticDefaultReport','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7732,0x18e));var _0x2773=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x7732[_0x342700];return _0x53406f;};'use strict';var _=require('lodash');var util=require(_0x2773('0x0'));var logger=require(_0x2773('0x1'))(_0x2773('0x2'));var moment=require(_0x2773('0x3'));var BPromise=require('bluebird');var rp=require(_0x2773('0x4'));var fs=require('fs');var path=require(_0x2773('0x5'));var rimraf=require(_0x2773('0x6'));var config=require(_0x2773('0x7'));var attributes=require(_0x2773('0x8'));module['exports']=function(_0x5c235e,_0x4a38ac){return _0x5c235e[_0x2773('0x9')](_0x2773('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f1dbfb..08bb15a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b46=['../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','../../mysqldb'];(function(_0x1fe22b,_0x557292){var _0x5bf166=function(_0x1c8373){while(--_0x1c8373){_0x1fe22b['push'](_0x1fe22b['shift']());}};_0x5bf166(++_0x557292);}(_0x5b46,0x8c));var _0x65b4=function(_0x54af00,_0x2f4b28){_0x54af00=_0x54af00-0x0;var _0x499ac7=_0x5b46[_0x54af00];return _0x499ac7;};'use strict';var _=require('lodash');var util=require(_0x65b4('0x0'));var moment=require(_0x65b4('0x1'));var BPromise=require(_0x65b4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65b4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x65b4('0x4'))(_0x65b4('0x5'));var config=require(_0x65b4('0x6'));var jayson=require(_0x65b4('0x7'));var client=jayson['client'][_0x65b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x539955,_0xc3020c,_0x4b1759){return new BPromise(function(_0x5e05b5,_0x1d509a){return client['request'](_0x539955,_0x4b1759)['then'](function(_0x284ddd){logger[_0x65b4('0x9')](_0x65b4('0xa'),_0xc3020c,_0x65b4('0xb'));logger[_0x65b4('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0xc3020c,_0x65b4('0xb'),JSON['stringify'](_0x284ddd));if(_0x284ddd['error']){if(_0x284ddd[_0x65b4('0xd')][_0x65b4('0xe')]===0x1f4){logger[_0x65b4('0xd')](_0x65b4('0xa'),_0xc3020c,_0x284ddd[_0x65b4('0xd')][_0x65b4('0xf')]);return _0x1d509a(_0x284ddd[_0x65b4('0xd')]['message']);}logger[_0x65b4('0xd')](_0x65b4('0xa'),_0xc3020c,_0x284ddd[_0x65b4('0xd')][_0x65b4('0xf')]);return _0x5e05b5(_0x284ddd[_0x65b4('0xd')]['message']);}else{logger[_0x65b4('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc3020c,_0x65b4('0xb'));_0x5e05b5(_0x284ddd[_0x65b4('0x10')][_0x65b4('0xf')]);}})[_0x65b4('0x11')](function(_0x5046b3){logger['error'](_0x65b4('0xa'),_0xc3020c,_0x5046b3);_0x1d509a(_0x5046b3);});});}
\ No newline at end of file
+var _0xea83=['info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x50f29f,_0x2f73cc){var _0x35e9e9=function(_0x4cab88){while(--_0x4cab88){_0x50f29f['push'](_0x50f29f['shift']());}};_0x35e9e9(++_0x2f73cc);}(_0xea83,0x1aa));var _0x3ea8=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xea83[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require(_0x3ea8('0x0'));var util=require(_0x3ea8('0x1'));var moment=require(_0x3ea8('0x2'));var BPromise=require(_0x3ea8('0x3'));var rs=require(_0x3ea8('0x4'));var fs=require('fs');var Redis=require(_0x3ea8('0x5'));var db=require(_0x3ea8('0x6'))['db'];var utils=require(_0x3ea8('0x7'));var logger=require(_0x3ea8('0x8'))(_0x3ea8('0x9'));var config=require(_0x3ea8('0xa'));var jayson=require(_0x3ea8('0xb'));var client=jayson[_0x3ea8('0xc')][_0x3ea8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x159aae,_0x3bbeec,_0x1c8a5c){return new BPromise(function(_0x1ffbe8,_0xb5d1ad){return client[_0x3ea8('0xe')](_0x159aae,_0x1c8a5c)[_0x3ea8('0xf')](function(_0xc7fc68){logger[_0x3ea8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3bbeec,_0x3ea8('0x11'));logger[_0x3ea8('0x12')](_0x3ea8('0x13'),_0x3bbeec,'request\x20sent',JSON[_0x3ea8('0x14')](_0xc7fc68));if(_0xc7fc68[_0x3ea8('0x15')]){if(_0xc7fc68[_0x3ea8('0x15')]['code']===0x1f4){logger['error'](_0x3ea8('0x16'),_0x3bbeec,_0xc7fc68[_0x3ea8('0x15')][_0x3ea8('0x17')]);return _0xb5d1ad(_0xc7fc68[_0x3ea8('0x15')]['message']);}logger[_0x3ea8('0x15')](_0x3ea8('0x16'),_0x3bbeec,_0xc7fc68[_0x3ea8('0x15')][_0x3ea8('0x17')]);return _0x1ffbe8(_0xc7fc68['error'][_0x3ea8('0x17')]);}else{logger['info'](_0x3ea8('0x16'),_0x3bbeec,'request\x20sent');_0x1ffbe8(_0xc7fc68[_0x3ea8('0x18')][_0x3ea8('0x17')]);}})[_0x3ea8('0x19')](function(_0x4e0b84){logger[_0x3ea8('0x15')](_0x3ea8('0x16'),_0x3bbeec,_0x4e0b84);_0xb5d1ad(_0x4e0b84);});});}
\ No newline at end of file
index 73dd0f2..1bb482b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90af=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','/:id/preview','/:id/run','/:id/query','query','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x90ee04,_0x29220f){var _0x4a9274=function(_0x10b5ea){while(--_0x10b5ea){_0x90ee04['push'](_0x90ee04['shift']());}};_0x4a9274(++_0x29220f);}(_0x90af,0x157));var _0xf90a=function(_0x2db2fc,_0x59091d){_0x2db2fc=_0x2db2fc-0x0;var _0x3877f9=_0x90af[_0x2db2fc];return _0x3877f9;};'use strict';var multer=require(_0xf90a('0x0'));var util=require(_0xf90a('0x1'));var path=require(_0xf90a('0x2'));var timeout=require(_0xf90a('0x3'));var express=require(_0xf90a('0x4'));var router=express['Router']();var fs_extra=require(_0xf90a('0x5'));var auth=require(_0xf90a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf90a('0x7'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0xf90a('0x8')](),controller[_0xf90a('0x9')]);router[_0xf90a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf90a('0xb')]);router[_0xf90a('0xa')](_0xf90a('0xc'),auth[_0xf90a('0x8')](),controller['preview']);router[_0xf90a('0xa')](_0xf90a('0xd'),auth[_0xf90a('0x8')](),controller['run']);router[_0xf90a('0xa')](_0xf90a('0xe'),auth['isAuthenticated'](),controller[_0xf90a('0xf')]);router[_0xf90a('0x10')]('/',auth[_0xf90a('0x8')](),controller[_0xf90a('0x11')]);router[_0xf90a('0x12')](_0xf90a('0x13'),auth[_0xf90a('0x8')](),controller[_0xf90a('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf90a('0x15')]);module[_0xf90a('0x16')]=router;
\ No newline at end of file
+var _0x3e1d=['query','post','put','update','delete','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3e1d,0x13a));var _0xd3e1=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0x3e1d[_0x3be2e2];return _0x53b9c5;};'use strict';var multer=require('multer');var util=require(_0xd3e1('0x0'));var path=require('path');var timeout=require(_0xd3e1('0x1'));var express=require(_0xd3e1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd3e1('0x3'));var interaction=require(_0xd3e1('0x4'));var config=require(_0xd3e1('0x5'));var controller=require(_0xd3e1('0x6'));router[_0xd3e1('0x7')]('/',auth[_0xd3e1('0x8')](),controller[_0xd3e1('0x9')]);router['get'](_0xd3e1('0xa'),auth['isAuthenticated'](),controller[_0xd3e1('0xb')]);router[_0xd3e1('0x7')](_0xd3e1('0xc'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0xd')]);router[_0xd3e1('0x7')](_0xd3e1('0xe'),auth[_0xd3e1('0x8')](),controller['run']);router[_0xd3e1('0x7')](_0xd3e1('0xf'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0x10')]);router[_0xd3e1('0x11')]('/',auth[_0xd3e1('0x8')](),controller['create']);router[_0xd3e1('0x12')](_0xd3e1('0xa'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0x13')]);router[_0xd3e1('0x14')](_0xd3e1('0xa'),auth[_0xd3e1('0x8')](),controller['destroy']);module[_0xd3e1('0x15')]=router;
\ No newline at end of file
index 726781d..a4efb5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15d1=['sequelize','moment','STRING','ENUM','pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED'];(function(_0x3e5f6d,_0x121db6){var _0x1bea6e=function(_0x435c7c){while(--_0x435c7c){_0x3e5f6d['push'](_0x3e5f6d['shift']());}};_0x1bea6e(++_0x121db6);}(_0x15d1,0xdc));var _0x115d=function(_0x18cb0a,_0x172892){_0x18cb0a=_0x18cb0a-0x0;var _0x4c7286=_0x15d1[_0x18cb0a];return _0x4c7286;};'use strict';var Sequelize=require(_0x115d('0x0'));var moment=require(_0x115d('0x1'));module['exports']={'name':{'type':Sequelize[_0x115d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x115d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x115d('0x3')]('csv',_0x115d('0x4'),_0x115d('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x115d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x115d('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x115d('0x2')],'defaultValue':_0x115d('0x7')},'type':{'type':Sequelize[_0x115d('0x3')](_0x115d('0x8'),_0x115d('0x9')),'allowNull':![],'defaultValue':_0x115d('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x115d('0xa')]},'reportType':{'type':Sequelize[_0x115d('0x2')]}};
\ No newline at end of file
+var _0xa120=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa120,0xe2));var _0x0a12=function(_0xdea275,_0x357a1e){_0xdea275=_0xdea275-0x0;var _0xaa0974=_0xa120[_0xdea275];return _0xaa0974;};'use strict';var Sequelize=require(_0x0a12('0x0'));var moment=require(_0x0a12('0x1'));module[_0x0a12('0x2')]={'name':{'type':Sequelize[_0x0a12('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x0a12('0x4')](_0x0a12('0x5'),_0x0a12('0x6'),_0x0a12('0x7')),'allowNull':![],'defaultValue':_0x0a12('0x5')},'savename':{'type':Sequelize[_0x0a12('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0a12('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x0a12('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x0a12('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x0a12('0x9')},'reportId':{'type':Sequelize[_0x0a12('0xa')](0xb)[_0x0a12('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0ab4e0b..d90a0ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92b3=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','ExtractedReports','error','stack','name','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','AnalyticExtractedReport','include','findAll','rows','show','includeAll','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0xc368bb,_0x105301){var _0x3780d9=function(_0x5d7ed9){while(--_0x5d7ed9){_0xc368bb['push'](_0xc368bb['shift']());}};_0x3780d9(++_0x105301);}(_0x92b3,0x16b));var _0x392b=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x92b3[_0x543084];return _0x306a57;};'use strict';var emlformat=require(_0x392b('0x0'));var rimraf=require(_0x392b('0x1'));var zipdir=require(_0x392b('0x2'));var jsonpatch=require(_0x392b('0x3'));var rp=require(_0x392b('0x4'));var moment=require(_0x392b('0x5'));var BPromise=require(_0x392b('0x6'));var Mustache=require(_0x392b('0x7'));var util=require(_0x392b('0x8'));var path=require('path');var sox=require(_0x392b('0x9'));var csv=require('to-csv');var ejs=require(_0x392b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x392b('0xb'));var squel=require('squel');var crypto=require(_0x392b('0xc'));var jsforce=require(_0x392b('0xd'));var deskjs=require(_0x392b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x392b('0xf'));var Redis=require(_0x392b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x392b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x392b('0x12'))(_0x392b('0x13'));var utils=require('../../config/utils');var config=require(_0x392b('0x14'));var licenseUtil=require(_0x392b('0x15'));var db=require(_0x392b('0x16'))['db'];function respondWithStatusCode(_0x3c5243,_0x571a41){_0x571a41=_0x571a41||0xcc;return function(_0xe7a56e){if(_0xe7a56e){return _0x3c5243[_0x392b('0x17')](_0x571a41);}return _0x3c5243[_0x392b('0x18')](_0x571a41)[_0x392b('0x19')]();};}function respondWithResult(_0x1ccc7a,_0x4c7316){_0x4c7316=_0x4c7316||0xc8;return function(_0x304f81){if(_0x304f81){return _0x1ccc7a[_0x392b('0x18')](_0x4c7316)[_0x392b('0x1a')](_0x304f81);}};}function respondWithFilteredResult(_0x4be02e,_0x4820d7){return function(_0x5925a2){if(_0x5925a2){var _0x4ad85f=typeof _0x4820d7[_0x392b('0x1b')]===_0x392b('0x1c')&&typeof _0x4820d7['limit']===_0x392b('0x1c');var _0xffc9d2=_0x5925a2[_0x392b('0x1d')];var _0x337393=_0x4ad85f?0x0:_0x4820d7['offset'];var _0x219f2b=_0x4ad85f?_0x5925a2[_0x392b('0x1d')]:_0x4820d7[_0x392b('0x1b')]+_0x4820d7[_0x392b('0x1e')];var _0x57f26d;if(_0x219f2b>=_0xffc9d2){_0x219f2b=_0xffc9d2;_0x57f26d=0xc8;}else{_0x57f26d=0xce;}_0x4be02e['status'](_0x57f26d);return _0x4be02e[_0x392b('0x1f')](_0x392b('0x20'),_0x337393+'-'+_0x219f2b+'/'+_0xffc9d2)['json'](_0x5925a2);}return null;};}function patchUpdates(_0x3cf804){return function(_0x4147b2){try{jsonpatch['apply'](_0x4147b2,_0x3cf804,!![]);}catch(_0x4eabc2){return BPromise[_0x392b('0x21')](_0x4eabc2);}return _0x4147b2[_0x392b('0x22')]();};}function saveUpdates(_0x4b19f0,_0x1e2b0c){return function(_0x55dfef){if(_0x55dfef){return _0x55dfef[_0x392b('0x23')](_0x4b19f0)['then'](function(_0xe31f14){return _0xe31f14;});}return null;};}function removeEntity(_0x19855c,_0x771b6a){return function(_0x71ed98){if(_0x71ed98){return _0x71ed98[_0x392b('0x24')]()[_0x392b('0x25')](function(){var _0x385a88=_0x71ed98[_0x392b('0x26')]({'plain':!![]});var _0x511f4f=_0x392b('0x27');return db['UserProfileResource'][_0x392b('0x24')]({'where':{'type':_0x511f4f,'resourceId':_0x385a88['id']}})[_0x392b('0x25')](function(){return _0x71ed98;});})[_0x392b('0x25')](function(){_0x19855c[_0x392b('0x18')](0xcc)[_0x392b('0x19')]();});}};}function handleEntityNotFound(_0x3deb44,_0x2766d8){return function(_0x3d87e0){if(!_0x3d87e0){_0x3deb44[_0x392b('0x17')](0x194);}return _0x3d87e0;};}function handleError(_0x4e0dd5,_0x220733){_0x220733=_0x220733||0x1f4;return function(_0x442f33){logger[_0x392b('0x28')](_0x442f33[_0x392b('0x29')]);if(_0x442f33[_0x392b('0x2a')]){delete _0x442f33[_0x392b('0x2a')];}_0x4e0dd5[_0x392b('0x18')](_0x220733)['send'](_0x442f33);};}exports['index']=function(_0x22f779,_0x3cce22){var _0x419113={},_0x6cc81f={},_0x4e8db8={'count':0x0,'rows':[]};var _0x34bad5=_['map'](db['AnalyticExtractedReport'][_0x392b('0x2b')],function(_0x5bedd6){return{'name':_0x5bedd6[_0x392b('0x2c')],'type':_0x5bedd6[_0x392b('0x2d')]['key']};});_0x6cc81f[_0x392b('0x2e')]=_['map'](_0x34bad5,_0x392b('0x2a'));_0x6cc81f[_0x392b('0x2f')]=_[_0x392b('0x30')](_0x22f779[_0x392b('0x2f')]);_0x6cc81f[_0x392b('0x31')]=_['intersection'](_0x6cc81f[_0x392b('0x2e')],_0x6cc81f[_0x392b('0x2f')]);_0x419113['attributes']=_[_0x392b('0x32')](_0x6cc81f[_0x392b('0x2e')],qs[_0x392b('0x33')](_0x22f779[_0x392b('0x2f')][_0x392b('0x33')]));_0x419113[_0x392b('0x34')]=_0x419113['attributes'][_0x392b('0x35')]?_0x419113[_0x392b('0x34')]:_0x6cc81f[_0x392b('0x2e')];if(!_0x22f779['query'][_0x392b('0x36')](_0x392b('0x37'))){_0x419113['limit']=qs[_0x392b('0x1e')](_0x22f779[_0x392b('0x2f')]['limit']);_0x419113['offset']=qs[_0x392b('0x1b')](_0x22f779[_0x392b('0x2f')][_0x392b('0x1b')]);}_0x419113[_0x392b('0x38')]=qs[_0x392b('0x39')](_0x22f779[_0x392b('0x2f')]['sort']);_0x419113[_0x392b('0x3a')]=qs['filters'](_['pick'](_0x22f779[_0x392b('0x2f')],_0x6cc81f[_0x392b('0x31')]),_0x34bad5);if(_0x22f779['query'][_0x392b('0x3b')]){_0x419113[_0x392b('0x3a')]=_['merge'](_0x419113[_0x392b('0x3a')],{'$or':_[_0x392b('0x3c')](_0x34bad5,function(_0x5a9734){if(_0x5a9734[_0x392b('0x2d')]!==_0x392b('0x3d')){var _0x2d99f9={};_0x2d99f9[_0x5a9734[_0x392b('0x2a')]]={'$like':'%'+_0x22f779[_0x392b('0x2f')]['filter']+'%'};return _0x2d99f9;}})});}_0x419113=_[_0x392b('0x3e')]({},_0x419113,_0x22f779['options']);var _0x59a172={'where':_0x419113[_0x392b('0x3a')]};return db[_0x392b('0x3f')][_0x392b('0x1d')](_0x59a172)[_0x392b('0x25')](function(_0x5c5028){_0x4e8db8[_0x392b('0x1d')]=_0x5c5028;if(_0x22f779[_0x392b('0x2f')]['includeAll']){_0x419113[_0x392b('0x40')]=[{'all':!![]}];}return db[_0x392b('0x3f')][_0x392b('0x41')](_0x419113);})['then'](function(_0x4c2e51){_0x4e8db8[_0x392b('0x42')]=_0x4c2e51;return _0x4e8db8;})[_0x392b('0x25')](respondWithFilteredResult(_0x3cce22,_0x419113))['catch'](handleError(_0x3cce22,null));};exports[_0x392b('0x43')]=function(_0x745fde,_0x765839){var _0x40b368={'raw':!![],'where':{'id':_0x745fde['params']['id']}},_0x1404f9={};_0x1404f9[_0x392b('0x2e')]=_['keys'](db[_0x392b('0x3f')][_0x392b('0x2b')]);_0x1404f9[_0x392b('0x2f')]=_[_0x392b('0x30')](_0x745fde['query']);_0x1404f9['filters']=_[_0x392b('0x32')](_0x1404f9[_0x392b('0x2e')],_0x1404f9['query']);_0x40b368[_0x392b('0x34')]=_['intersection'](_0x1404f9['model'],qs[_0x392b('0x33')](_0x745fde[_0x392b('0x2f')][_0x392b('0x33')]));_0x40b368['attributes']=_0x40b368[_0x392b('0x34')][_0x392b('0x35')]?_0x40b368['attributes']:_0x1404f9[_0x392b('0x2e')];if(_0x745fde[_0x392b('0x2f')][_0x392b('0x44')]){_0x40b368['include']=[{'all':!![]}];}_0x40b368=_[_0x392b('0x3e')]({},_0x40b368,_0x745fde[_0x392b('0x45')]);return db['AnalyticExtractedReport']['find'](_0x40b368)['then'](handleEntityNotFound(_0x765839,null))[_0x392b('0x25')](respondWithResult(_0x765839,null))[_0x392b('0x46')](handleError(_0x765839,null));};exports[_0x392b('0x47')]=function(_0x261d33,_0xa8e00){return db[_0x392b('0x3f')][_0x392b('0x47')](_0x261d33['body'],{})['then'](function(_0x156118){var _0x27cb77=_0x261d33[_0x392b('0x48')][_0x392b('0x26')]({'plain':!![]});if(!_0x27cb77)throw new Error(_0x392b('0x49'));if(_0x27cb77[_0x392b('0x4a')]===_0x392b('0x48')){var _0x47f56a=_0x156118['get']({'plain':!![]});var _0x334e9a=_0x392b('0x27');return db[_0x392b('0x4b')][_0x392b('0x4c')]({'where':{'name':_0x334e9a,'userProfileId':_0x27cb77[_0x392b('0x4d')]},'raw':!![]})[_0x392b('0x25')](function(_0x25d797){if(_0x25d797&&_0x25d797[_0x392b('0x4e')]===0x0){return db[_0x392b('0x4f')][_0x392b('0x47')]({'name':_0x47f56a[_0x392b('0x2a')],'resourceId':_0x47f56a['id'],'type':_0x25d797[_0x392b('0x2a')],'sectionId':_0x25d797['id']},{})[_0x392b('0x25')](function(){return _0x156118;});}else{return _0x156118;}})[_0x392b('0x46')](function(_0x41055c){logger[_0x392b('0x28')](_0x392b('0x50'),_0x41055c);throw _0x41055c;});}return _0x156118;})[_0x392b('0x25')](respondWithResult(_0xa8e00,0xc9))['catch'](handleError(_0xa8e00,null));};exports['update']=function(_0x45f73e,_0x1d539b){if(_0x45f73e[_0x392b('0x51')]['id']){delete _0x45f73e[_0x392b('0x51')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x45f73e[_0x392b('0x52')]['id']}})[_0x392b('0x25')](handleEntityNotFound(_0x1d539b,null))[_0x392b('0x25')](saveUpdates(_0x45f73e['body'],null))[_0x392b('0x25')](respondWithResult(_0x1d539b,null))['catch'](handleError(_0x1d539b,null));};exports[_0x392b('0x24')]=function(_0x46166f,_0x24eb26){return db[_0x392b('0x3f')][_0x392b('0x4c')]({'where':{'id':_0x46166f[_0x392b('0x52')]['id']}})[_0x392b('0x25')](handleEntityNotFound(_0x24eb26,null))[_0x392b('0x25')](removeEntity(_0x24eb26,null))[_0x392b('0x46')](handleError(_0x24eb26,null));};exports[_0x392b('0x53')]=function(_0x4a2863,_0x48224e,_0x4fdd8d){return db[_0x392b('0x3f')][_0x392b('0x4c')]({'where':{'id':_0x4a2863[_0x392b('0x52')]['id']},'attributes':[_0x392b('0x2a'),_0x392b('0x54'),_0x392b('0x55'),_0x392b('0x56')],'raw':!![]})[_0x392b('0x25')](handleEntityNotFound(_0x48224e,null))[_0x392b('0x25')](function(_0x507a08){if(_0x507a08){if(!fs['existsSync'](path[_0x392b('0x57')](config['root'],_0x392b('0x58'),_0x507a08[_0x392b('0x55')]))){throw new db[(_0x392b('0x59'))][(_0x392b('0x5a'))](_0x392b('0x5b'));}if(_0x4a2863[_0x392b('0x2f')][_0x392b('0x5c')]){return _0x48224e[_0x392b('0x17')](0xc8);}return _0x48224e[_0x392b('0x53')](path['join'](config['root'],_0x392b('0x58'),_0x507a08[_0x392b('0x55')]),util[_0x392b('0x5d')](_0x392b('0x5e'),_0x507a08['basename']||_0x507a08[_0x392b('0x2a')],_0x507a08[_0x392b('0x56')][_0x392b('0x5f')]()));}})[_0x392b('0x46')](handleError(_0x48224e,null));};
\ No newline at end of file
+var _0x0d92=['reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','rawAttributes','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','output','existsSync','join','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply'];(function(_0x1ca3a7,_0x309ca5){var _0x1a49c8=function(_0x21537c){while(--_0x21537c){_0x1ca3a7['push'](_0x1ca3a7['shift']());}};_0x1a49c8(++_0x309ca5);}(_0x0d92,0xfc));var _0x20d9=function(_0x4c5114,_0x466755){_0x4c5114=_0x4c5114-0x0;var _0xedb3d8=_0x0d92[_0x4c5114];return _0xedb3d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20d9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20d9('0x1'));var rp=require(_0x20d9('0x2'));var moment=require(_0x20d9('0x3'));var BPromise=require(_0x20d9('0x4'));var Mustache=require('mustache');var util=require(_0x20d9('0x5'));var path=require(_0x20d9('0x6'));var sox=require(_0x20d9('0x7'));var csv=require(_0x20d9('0x8'));var ejs=require(_0x20d9('0x9'));var fs=require('fs');var fs_extra=require(_0x20d9('0xa'));var _=require(_0x20d9('0xb'));var squel=require(_0x20d9('0xc'));var crypto=require('crypto');var jsforce=require(_0x20d9('0xd'));var deskjs=require(_0x20d9('0xe'));var toCsv=require(_0x20d9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');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(_0x20d9('0xf'));var logger=require(_0x20d9('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x20d9('0x11'));var licenseUtil=require(_0x20d9('0x12'));var db=require(_0x20d9('0x13'))['db'];function respondWithStatusCode(_0x3131f3,_0x5552d0){_0x5552d0=_0x5552d0||0xcc;return function(_0x5dbcbf){if(_0x5dbcbf){return _0x3131f3[_0x20d9('0x14')](_0x5552d0);}return _0x3131f3[_0x20d9('0x15')](_0x5552d0)[_0x20d9('0x16')]();};}function respondWithResult(_0x4a126f,_0x6e20b2){_0x6e20b2=_0x6e20b2||0xc8;return function(_0xaca2e){if(_0xaca2e){return _0x4a126f[_0x20d9('0x15')](_0x6e20b2)[_0x20d9('0x17')](_0xaca2e);}};}function respondWithFilteredResult(_0x173371,_0x1aaa58){return function(_0x550ffa){if(_0x550ffa){var _0x2f7b12=typeof _0x1aaa58['offset']==='undefined'&&typeof _0x1aaa58[_0x20d9('0x18')]===_0x20d9('0x19');var _0x4c2ebd=_0x550ffa[_0x20d9('0x1a')];var _0x4a8cf5=_0x2f7b12?0x0:_0x1aaa58[_0x20d9('0x1b')];var _0x3d3058=_0x2f7b12?_0x550ffa[_0x20d9('0x1a')]:_0x1aaa58[_0x20d9('0x1b')]+_0x1aaa58['limit'];var _0x5d2170;if(_0x3d3058>=_0x4c2ebd){_0x3d3058=_0x4c2ebd;_0x5d2170=0xc8;}else{_0x5d2170=0xce;}_0x173371['status'](_0x5d2170);return _0x173371[_0x20d9('0x1c')]('Content-Range',_0x4a8cf5+'-'+_0x3d3058+'/'+_0x4c2ebd)[_0x20d9('0x17')](_0x550ffa);}return null;};}function patchUpdates(_0x2586ce){return function(_0x121124){try{jsonpatch[_0x20d9('0x1d')](_0x121124,_0x2586ce,!![]);}catch(_0x7d8c55){return BPromise[_0x20d9('0x1e')](_0x7d8c55);}return _0x121124[_0x20d9('0x1f')]();};}function saveUpdates(_0x4f845b,_0x132df4){return function(_0x2c409d){if(_0x2c409d){return _0x2c409d[_0x20d9('0x20')](_0x4f845b)[_0x20d9('0x21')](function(_0x2c0b61){return _0x2c0b61;});}return null;};}function removeEntity(_0x55cc42,_0x341a15){return function(_0x2eedf0){if(_0x2eedf0){return _0x2eedf0[_0x20d9('0x22')]()[_0x20d9('0x21')](function(){var _0x5143d3=_0x2eedf0[_0x20d9('0x23')]({'plain':!![]});var _0x421335=_0x20d9('0x24');return db[_0x20d9('0x25')]['destroy']({'where':{'type':_0x421335,'resourceId':_0x5143d3['id']}})[_0x20d9('0x21')](function(){return _0x2eedf0;});})[_0x20d9('0x21')](function(){_0x55cc42[_0x20d9('0x15')](0xcc)[_0x20d9('0x16')]();});}};}function handleEntityNotFound(_0x12c94b,_0x48ea2c){return function(_0x41ef01){if(!_0x41ef01){_0x12c94b['sendStatus'](0x194);}return _0x41ef01;};}function handleError(_0x28b0d8,_0x945b74){_0x945b74=_0x945b74||0x1f4;return function(_0x133246){logger[_0x20d9('0x26')](_0x133246[_0x20d9('0x27')]);if(_0x133246[_0x20d9('0x28')]){delete _0x133246[_0x20d9('0x28')];}_0x28b0d8[_0x20d9('0x15')](_0x945b74)[_0x20d9('0x29')](_0x133246);};}exports['index']=function(_0x3e16d4,_0x40d086){var _0x144bc8={},_0x3ec83b={},_0x2c249f={'count':0x0,'rows':[]};var _0x5704ee=_[_0x20d9('0x2a')](db[_0x20d9('0x2b')]['rawAttributes'],function(_0x19343b){return{'name':_0x19343b[_0x20d9('0x2c')],'type':_0x19343b[_0x20d9('0x2d')]['key']};});_0x3ec83b[_0x20d9('0x2e')]=_[_0x20d9('0x2a')](_0x5704ee,_0x20d9('0x28'));_0x3ec83b[_0x20d9('0x2f')]=_[_0x20d9('0x30')](_0x3e16d4['query']);_0x3ec83b[_0x20d9('0x31')]=_[_0x20d9('0x32')](_0x3ec83b['model'],_0x3ec83b[_0x20d9('0x2f')]);_0x144bc8[_0x20d9('0x33')]=_['intersection'](_0x3ec83b[_0x20d9('0x2e')],qs[_0x20d9('0x34')](_0x3e16d4['query']['fields']));_0x144bc8[_0x20d9('0x33')]=_0x144bc8[_0x20d9('0x33')][_0x20d9('0x35')]?_0x144bc8[_0x20d9('0x33')]:_0x3ec83b[_0x20d9('0x2e')];if(!_0x3e16d4['query'][_0x20d9('0x36')](_0x20d9('0x37'))){_0x144bc8[_0x20d9('0x18')]=qs[_0x20d9('0x18')](_0x3e16d4[_0x20d9('0x2f')][_0x20d9('0x18')]);_0x144bc8[_0x20d9('0x1b')]=qs[_0x20d9('0x1b')](_0x3e16d4['query']['offset']);}_0x144bc8[_0x20d9('0x38')]=qs[_0x20d9('0x39')](_0x3e16d4[_0x20d9('0x2f')][_0x20d9('0x39')]);_0x144bc8[_0x20d9('0x3a')]=qs[_0x20d9('0x31')](_[_0x20d9('0x3b')](_0x3e16d4[_0x20d9('0x2f')],_0x3ec83b[_0x20d9('0x31')]),_0x5704ee);if(_0x3e16d4['query'][_0x20d9('0x3c')]){_0x144bc8['where']=_['merge'](_0x144bc8[_0x20d9('0x3a')],{'$or':_[_0x20d9('0x2a')](_0x5704ee,function(_0x4d7118){if(_0x4d7118[_0x20d9('0x2d')]!==_0x20d9('0x3d')){var _0x4c9471={};_0x4c9471[_0x4d7118['name']]={'$like':'%'+_0x3e16d4['query'][_0x20d9('0x3c')]+'%'};return _0x4c9471;}})});}_0x144bc8=_[_0x20d9('0x3e')]({},_0x144bc8,_0x3e16d4[_0x20d9('0x3f')]);var _0x5f424a={'where':_0x144bc8['where']};return db[_0x20d9('0x2b')][_0x20d9('0x1a')](_0x5f424a)[_0x20d9('0x21')](function(_0x2f4ae6){_0x2c249f['count']=_0x2f4ae6;if(_0x3e16d4['query'][_0x20d9('0x40')]){_0x144bc8[_0x20d9('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x144bc8);})['then'](function(_0x5af63a){_0x2c249f[_0x20d9('0x42')]=_0x5af63a;return _0x2c249f;})[_0x20d9('0x21')](respondWithFilteredResult(_0x40d086,_0x144bc8))[_0x20d9('0x43')](handleError(_0x40d086,null));};exports[_0x20d9('0x44')]=function(_0x1cbacc,_0x53fdc3){var _0x4c4633={'raw':!![],'where':{'id':_0x1cbacc['params']['id']}},_0x45011c={};_0x45011c[_0x20d9('0x2e')]=_[_0x20d9('0x30')](db['AnalyticExtractedReport'][_0x20d9('0x45')]);_0x45011c[_0x20d9('0x2f')]=_[_0x20d9('0x30')](_0x1cbacc['query']);_0x45011c[_0x20d9('0x31')]=_[_0x20d9('0x32')](_0x45011c[_0x20d9('0x2e')],_0x45011c[_0x20d9('0x2f')]);_0x4c4633[_0x20d9('0x33')]=_[_0x20d9('0x32')](_0x45011c[_0x20d9('0x2e')],qs[_0x20d9('0x34')](_0x1cbacc['query'][_0x20d9('0x34')]));_0x4c4633['attributes']=_0x4c4633[_0x20d9('0x33')][_0x20d9('0x35')]?_0x4c4633[_0x20d9('0x33')]:_0x45011c['model'];if(_0x1cbacc[_0x20d9('0x2f')][_0x20d9('0x40')]){_0x4c4633[_0x20d9('0x41')]=[{'all':!![]}];}_0x4c4633=_[_0x20d9('0x3e')]({},_0x4c4633,_0x1cbacc[_0x20d9('0x3f')]);return db['AnalyticExtractedReport']['find'](_0x4c4633)[_0x20d9('0x21')](handleEntityNotFound(_0x53fdc3,null))[_0x20d9('0x21')](respondWithResult(_0x53fdc3,null))['catch'](handleError(_0x53fdc3,null));};exports['create']=function(_0x4106f8,_0x360b2b){return db[_0x20d9('0x2b')]['create'](_0x4106f8[_0x20d9('0x46')],{})['then'](function(_0x43c01c){var _0x5ba440=_0x4106f8[_0x20d9('0x47')][_0x20d9('0x23')]({'plain':!![]});if(!_0x5ba440)throw new Error(_0x20d9('0x48'));if(_0x5ba440[_0x20d9('0x49')]===_0x20d9('0x47')){var _0x43a38c=_0x43c01c[_0x20d9('0x23')]({'plain':!![]});var _0x3d6d57='ExtractedReports';return db[_0x20d9('0x4a')][_0x20d9('0x4b')]({'where':{'name':_0x3d6d57,'userProfileId':_0x5ba440[_0x20d9('0x4c')]},'raw':!![]})[_0x20d9('0x21')](function(_0x4c1212){if(_0x4c1212&&_0x4c1212[_0x20d9('0x4d')]===0x0){return db[_0x20d9('0x25')][_0x20d9('0x4e')]({'name':_0x43a38c[_0x20d9('0x28')],'resourceId':_0x43a38c['id'],'type':_0x4c1212[_0x20d9('0x28')],'sectionId':_0x4c1212['id']},{})[_0x20d9('0x21')](function(){return _0x43c01c;});}else{return _0x43c01c;}})[_0x20d9('0x43')](function(_0x4902ba){logger[_0x20d9('0x26')](_0x20d9('0x4f'),_0x4902ba);throw _0x4902ba;});}return _0x43c01c;})[_0x20d9('0x21')](respondWithResult(_0x360b2b,0xc9))[_0x20d9('0x43')](handleError(_0x360b2b,null));};exports[_0x20d9('0x20')]=function(_0x2f1689,_0x3213a4){if(_0x2f1689[_0x20d9('0x46')]['id']){delete _0x2f1689[_0x20d9('0x46')]['id'];}return db[_0x20d9('0x2b')][_0x20d9('0x4b')]({'where':{'id':_0x2f1689[_0x20d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x3213a4,null))[_0x20d9('0x21')](saveUpdates(_0x2f1689['body'],null))[_0x20d9('0x21')](respondWithResult(_0x3213a4,null))['catch'](handleError(_0x3213a4,null));};exports[_0x20d9('0x22')]=function(_0x4d73a4,_0x4eaf4e){return db[_0x20d9('0x2b')][_0x20d9('0x4b')]({'where':{'id':_0x4d73a4['params']['id']}})[_0x20d9('0x21')](handleEntityNotFound(_0x4eaf4e,null))[_0x20d9('0x21')](removeEntity(_0x4eaf4e,null))['catch'](handleError(_0x4eaf4e,null));};exports[_0x20d9('0x51')]=function(_0x49887d,_0x49deeb,_0x50e76b){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x49887d[_0x20d9('0x50')]['id']},'attributes':['name',_0x20d9('0x52'),'savename',_0x20d9('0x53')],'raw':!![]})[_0x20d9('0x21')](handleEntityNotFound(_0x49deeb,null))['then'](function(_0x5dbe0c){if(_0x5dbe0c){if(!fs[_0x20d9('0x54')](path[_0x20d9('0x55')](config['root'],_0x20d9('0x56'),_0x5dbe0c[_0x20d9('0x57')]))){throw new db['Sequelize'][(_0x20d9('0x58'))](_0x20d9('0x59'));}if(_0x49887d['query'][_0x20d9('0x5a')]){return _0x49deeb[_0x20d9('0x14')](0xc8);}return _0x49deeb[_0x20d9('0x51')](path['join'](config[_0x20d9('0x5b')],_0x20d9('0x56'),_0x5dbe0c[_0x20d9('0x57')]),util[_0x20d9('0x5c')](_0x20d9('0x5d'),_0x5dbe0c['basename']||_0x5dbe0c[_0x20d9('0x28')],_0x5dbe0c[_0x20d9('0x53')]['toLowerCase']()));}})['catch'](handleError(_0x49deeb,null));};
\ No newline at end of file
index d8affd3..26e2c46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf27b=['analytics_extracted_reports','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x11aee5,_0x27fa94){var _0x2e8c9d=function(_0x33ff83){while(--_0x33ff83){_0x11aee5['push'](_0x11aee5['shift']());}};_0x2e8c9d(++_0x27fa94);}(_0xf27b,0x1c3));var _0xbf27=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0xf27b[_0x59f0dc];return _0x5b5445;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbf27('0x0'));var BPromise=require(_0xbf27('0x1'));var rp=require(_0xbf27('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf27('0x3'));var config=require(_0xbf27('0x4'));var attributes=require(_0xbf27('0x5'));module['exports']=function(_0x115fad,_0x482d02){return _0x115fad[_0xbf27('0x6')](_0xbf27('0x7'),attributes,{'tableName':_0xbf27('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9129=['util','../../config/logger','api','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x5d77d3,_0x1fd3de){var _0x49c28f=function(_0x500cc9){while(--_0x500cc9){_0x5d77d3['push'](_0x5d77d3['shift']());}};_0x49c28f(++_0x1fd3de);}(_0x9129,0x137));var _0x9912=function(_0xf1226a,_0x29a250){_0xf1226a=_0xf1226a-0x0;var _0x1b8fe7=_0x9129[_0xf1226a];return _0x1b8fe7;};'use strict';var _=require(_0x9912('0x0'));var util=require(_0x9912('0x1'));var logger=require(_0x9912('0x2'))(_0x9912('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9912('0x4'));var rimraf=require(_0x9912('0x5'));var config=require(_0x9912('0x6'));var attributes=require(_0x9912('0x7'));module[_0x9912('0x8')]=function(_0x33d0ec,_0x2c310d){return _0x33d0ec[_0x9912('0x9')](_0x9912('0xa'),attributes,{'tableName':_0x9912('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 36b4beb..aba82bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e1f=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x1e3516,_0x58399e){var _0x3da6d4=function(_0x38bfc6){while(--_0x38bfc6){_0x1e3516['push'](_0x1e3516['shift']());}};_0x3da6d4(++_0x58399e);}(_0x8e1f,0x95));var _0xf8e1=function(_0x2a16f4,_0x2ce51d){_0x2a16f4=_0x2a16f4-0x0;var _0x37fd3c=_0x8e1f[_0x2a16f4];return _0x37fd3c;};'use strict';var _=require(_0xf8e1('0x0'));var util=require(_0xf8e1('0x1'));var moment=require('moment');var BPromise=require(_0xf8e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8e1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8e1('0x4'));var logger=require(_0xf8e1('0x5'))(_0xf8e1('0x6'));var config=require(_0xf8e1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x326787,_0x4e1fb2,_0x2678d8){return new BPromise(function(_0x59d6ec,_0x25beed){return client['request'](_0x326787,_0x2678d8)[_0xf8e1('0x8')](function(_0x555a48){logger[_0xf8e1('0x9')](_0xf8e1('0xa'),_0x4e1fb2,_0xf8e1('0xb'));logger['debug'](_0xf8e1('0xc'),_0x4e1fb2,_0xf8e1('0xb'),JSON[_0xf8e1('0xd')](_0x555a48));if(_0x555a48[_0xf8e1('0xe')]){if(_0x555a48[_0xf8e1('0xe')][_0xf8e1('0xf')]===0x1f4){logger[_0xf8e1('0xe')](_0xf8e1('0xa'),_0x4e1fb2,_0x555a48['error'][_0xf8e1('0x10')]);return _0x25beed(_0x555a48[_0xf8e1('0xe')][_0xf8e1('0x10')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4e1fb2,_0x555a48[_0xf8e1('0xe')]['message']);return _0x59d6ec(_0x555a48[_0xf8e1('0xe')][_0xf8e1('0x10')]);}else{logger[_0xf8e1('0x9')](_0xf8e1('0xa'),_0x4e1fb2,_0xf8e1('0xb'));_0x59d6ec(_0x555a48[_0xf8e1('0x11')][_0xf8e1('0x10')]);}})[_0xf8e1('0x12')](function(_0x2a5a9f){logger[_0xf8e1('0xe')](_0xf8e1('0xa'),_0x4e1fb2,_0x2a5a9f);_0x25beed(_0x2a5a9f);});});}
\ No newline at end of file
+var _0xfdf4=['AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0xfdf4,0xe6));var _0x4fdf=function(_0x34daed,_0x20a680){_0x34daed=_0x34daed-0x0;var _0x5bcafa=_0xfdf4[_0x34daed];return _0x5bcafa;};'use strict';var _=require(_0x4fdf('0x0'));var util=require(_0x4fdf('0x1'));var moment=require(_0x4fdf('0x2'));var BPromise=require(_0x4fdf('0x3'));var rs=require(_0x4fdf('0x4'));var fs=require('fs');var Redis=require(_0x4fdf('0x5'));var db=require(_0x4fdf('0x6'))['db'];var utils=require(_0x4fdf('0x7'));var logger=require('../../config/logger')(_0x4fdf('0x8'));var config=require(_0x4fdf('0x9'));var jayson=require(_0x4fdf('0xa'));var client=jayson[_0x4fdf('0xb')][_0x4fdf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x579ffe,_0x5897bc,_0x75a8ee){return new BPromise(function(_0x2c2460,_0x1b3398){return client['request'](_0x579ffe,_0x75a8ee)[_0x4fdf('0xd')](function(_0x183f9f){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5897bc,_0x4fdf('0xe'));logger[_0x4fdf('0xf')](_0x4fdf('0x10'),_0x5897bc,_0x4fdf('0xe'),JSON[_0x4fdf('0x11')](_0x183f9f));if(_0x183f9f[_0x4fdf('0x12')]){if(_0x183f9f['error'][_0x4fdf('0x13')]===0x1f4){logger[_0x4fdf('0x12')](_0x4fdf('0x14'),_0x5897bc,_0x183f9f[_0x4fdf('0x12')][_0x4fdf('0x15')]);return _0x1b3398(_0x183f9f[_0x4fdf('0x12')][_0x4fdf('0x15')]);}logger[_0x4fdf('0x12')](_0x4fdf('0x14'),_0x5897bc,_0x183f9f['error'][_0x4fdf('0x15')]);return _0x2c2460(_0x183f9f[_0x4fdf('0x12')]['message']);}else{logger[_0x4fdf('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5897bc,'request\x20sent');_0x2c2460(_0x183f9f[_0x4fdf('0x17')][_0x4fdf('0x15')]);}})[_0x4fdf('0x18')](function(_0x4ae4ce){logger[_0x4fdf('0x12')](_0x4fdf('0x14'),_0x5897bc,_0x4ae4ce);_0x1b3398(_0x4ae4ce);});});}
\ No newline at end of file
index 3be791e..762da53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x511f=['Router','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','download','create','put','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x57b053,_0x2a7746){var _0x275078=function(_0x357118){while(--_0x357118){_0x57b053['push'](_0x57b053['shift']());}};_0x275078(++_0x2a7746);}(_0x511f,0x6b));var _0xf511=function(_0x174cda,_0x5a4341){_0x174cda=_0x174cda-0x0;var _0xd1034f=_0x511f[_0x174cda];return _0xd1034f;};'use strict';var multer=require(_0xf511('0x0'));var util=require(_0xf511('0x1'));var path=require(_0xf511('0x2'));var timeout=require(_0xf511('0x3'));var express=require(_0xf511('0x4'));var router=express[_0xf511('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf511('0x6'));var controller=require(_0xf511('0x7'));router[_0xf511('0x8')]('/',auth[_0xf511('0x9')](),controller['index']);router['get'](_0xf511('0xa'),auth[_0xf511('0x9')](),controller['show']);router[_0xf511('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xf511('0xb')]);router['post']('/',auth[_0xf511('0x9')](),controller[_0xf511('0xc')]);router[_0xf511('0xd')](_0xf511('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf511('0xa'),auth[_0xf511('0x9')](),controller[_0xf511('0xe')]);module[_0xf511('0xf')]=router;
\ No newline at end of file
+var _0x87d2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','update','delete','util','connect-timeout','express','fs-extra'];(function(_0x53c3ac,_0x251df4){var _0x26c991=function(_0x4813bc){while(--_0x4813bc){_0x53c3ac['push'](_0x53c3ac['shift']());}};_0x26c991(++_0x251df4);}(_0x87d2,0x188));var _0x287d=function(_0x32bbaa,_0x2bc8f3){_0x32bbaa=_0x32bbaa-0x0;var _0x34077b=_0x87d2[_0x32bbaa];return _0x34077b;};'use strict';var multer=require('multer');var util=require(_0x287d('0x0'));var path=require('path');var timeout=require(_0x287d('0x1'));var express=require(_0x287d('0x2'));var router=express['Router']();var fs_extra=require(_0x287d('0x3'));var auth=require(_0x287d('0x4'));var interaction=require(_0x287d('0x5'));var config=require(_0x287d('0x6'));var controller=require(_0x287d('0x7'));router[_0x287d('0x8')]('/',auth['isAuthenticated'](),controller[_0x287d('0x9')]);router[_0x287d('0x8')](_0x287d('0xa'),auth[_0x287d('0xb')](),controller[_0x287d('0xc')]);router[_0x287d('0x8')](_0x287d('0xd'),auth[_0x287d('0xb')](),controller['download']);router[_0x287d('0xe')]('/',auth['isAuthenticated'](),controller[_0x287d('0xf')]);router['put']('/:id',auth[_0x287d('0xb')](),controller[_0x287d('0x10')]);router[_0x287d('0x11')](_0x287d('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 760d880..755d611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0f3=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2defca,_0x10da1c){var _0x39a8fe=function(_0x32585d){while(--_0x32585d){_0x2defca['push'](_0x2defca['shift']());}};_0x39a8fe(++_0x10da1c);}(_0xc0f3,0xea));var _0x3c0f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc0f3[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x3c0f('0x0'));module[_0x3c0f('0x1')]={'field':{'type':Sequelize[_0x3c0f('0x2')]},'alias':{'type':Sequelize[_0x3c0f('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x3c0f('0x3')]},'groupBy':{'type':Sequelize[_0x3c0f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3c0f('0x3')]},'custom':{'type':Sequelize[_0x3c0f('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8858=['sequelize','exports','STRING','BOOLEAN'];(function(_0x243b5a,_0x4c3ec0){var _0x3584f0=function(_0x3170f1){while(--_0x3170f1){_0x243b5a['push'](_0x243b5a['shift']());}};_0x3584f0(++_0x4c3ec0);}(_0x8858,0x94));var _0x8885=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x8858[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x8885('0x0'));module[_0x8885('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x8885('0x2')]},'function':{'type':Sequelize[_0x8885('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x8885('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8885('0x2')]},'custom':{'type':Sequelize[_0x8885('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 8d57aaa..03a7f81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d9f=['findAll','rows','show','keys','rawAttributes','filters','includeAll','options','catch','create','body','bulkCreate','params','destroy','bulkDestroy','ids','sequelize','transaction','CustomReportId','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','key','query','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include'];(function(_0x93c493,_0x5dab38){var _0x50e014=function(_0x10c6fc){while(--_0x10c6fc){_0x93c493['push'](_0x93c493['shift']());}};_0x50e014(++_0x5dab38);}(_0x4d9f,0x15f));var _0xf4d9=function(_0x507b33,_0x55bf87){_0x507b33=_0x507b33-0x0;var _0x106516=_0x4d9f[_0x507b33];return _0x106516;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf4d9('0x0'));var jsonpatch=require(_0xf4d9('0x1'));var rp=require('request-promise');var moment=require(_0xf4d9('0x2'));var BPromise=require(_0xf4d9('0x3'));var Mustache=require(_0xf4d9('0x4'));var util=require(_0xf4d9('0x5'));var path=require(_0xf4d9('0x6'));var sox=require(_0xf4d9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4d9('0x8'));var _=require(_0xf4d9('0x9'));var squel=require('squel');var crypto=require(_0xf4d9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf4d9('0xb'));var toCsv=require(_0xf4d9('0xc'));var querystring=require(_0xf4d9('0xd'));var Papa=require(_0xf4d9('0xe'));var Redis=require('ioredis');var authService=require(_0xf4d9('0xf'));var qs=require(_0xf4d9('0x10'));var as=require(_0xf4d9('0x11'));var hardwareService=require(_0xf4d9('0x12'));var logger=require(_0xf4d9('0x13'))(_0xf4d9('0x14'));var utils=require(_0xf4d9('0x15'));var config=require(_0xf4d9('0x16'));var licenseUtil=require(_0xf4d9('0x17'));var db=require(_0xf4d9('0x18'))['db'];function respondWithStatusCode(_0x32c857,_0x5362b9){_0x5362b9=_0x5362b9||0xcc;return function(_0x33395f){if(_0x33395f){return _0x32c857[_0xf4d9('0x19')](_0x5362b9);}return _0x32c857[_0xf4d9('0x1a')](_0x5362b9)[_0xf4d9('0x1b')]();};}function respondWithResult(_0x4ba179,_0x5d0d2f){_0x5d0d2f=_0x5d0d2f||0xc8;return function(_0x119460){if(_0x119460){return _0x4ba179['status'](_0x5d0d2f)[_0xf4d9('0x1c')](_0x119460);}};}function respondWithFilteredResult(_0x24e1e2,_0x4141ab){return function(_0x37fa9f){if(_0x37fa9f){var _0x5cbf6e=typeof _0x4141ab[_0xf4d9('0x1d')]===_0xf4d9('0x1e')&&typeof _0x4141ab['limit']===_0xf4d9('0x1e');var _0x42258c=_0x37fa9f[_0xf4d9('0x1f')];var _0x72d204=_0x5cbf6e?0x0:_0x4141ab[_0xf4d9('0x1d')];var _0x202d7a=_0x5cbf6e?_0x37fa9f[_0xf4d9('0x1f')]:_0x4141ab[_0xf4d9('0x1d')]+_0x4141ab[_0xf4d9('0x20')];var _0x33cdd9;if(_0x202d7a>=_0x42258c){_0x202d7a=_0x42258c;_0x33cdd9=0xc8;}else{_0x33cdd9=0xce;}_0x24e1e2[_0xf4d9('0x1a')](_0x33cdd9);return _0x24e1e2[_0xf4d9('0x21')](_0xf4d9('0x22'),_0x72d204+'-'+_0x202d7a+'/'+_0x42258c)[_0xf4d9('0x1c')](_0x37fa9f);}return null;};}function patchUpdates(_0x33f2bb){return function(_0x2a68dc){try{jsonpatch[_0xf4d9('0x23')](_0x2a68dc,_0x33f2bb,!![]);}catch(_0x4869ad){return BPromise[_0xf4d9('0x24')](_0x4869ad);}return _0x2a68dc[_0xf4d9('0x25')]();};}function saveUpdates(_0x1ba70b,_0x53a34a){return function(_0x1638bb){if(_0x1638bb){return _0x1638bb[_0xf4d9('0x26')](_0x1ba70b)[_0xf4d9('0x27')](function(_0x53a8e1){return _0x53a8e1;});}return null;};}function removeEntity(_0x437b3c,_0x105199){return function(_0x4f37a6){if(_0x4f37a6){return _0x4f37a6['destroy']()[_0xf4d9('0x27')](function(){_0x437b3c[_0xf4d9('0x1a')](0xcc)[_0xf4d9('0x1b')]();});}};}function handleEntityNotFound(_0x3f3402,_0x53cdd7){return function(_0x1ac852){if(!_0x1ac852){_0x3f3402['sendStatus'](0x194);}return _0x1ac852;};}function handleError(_0x154b63,_0xadebac){_0xadebac=_0xadebac||0x1f4;return function(_0x1ca211){logger[_0xf4d9('0x28')](_0x1ca211[_0xf4d9('0x29')]);if(_0x1ca211[_0xf4d9('0x2a')]){delete _0x1ca211['name'];}_0x154b63[_0xf4d9('0x1a')](_0xadebac)[_0xf4d9('0x2b')](_0x1ca211);};}exports['index']=function(_0x1be3be,_0x4047e2){var _0x10717c={},_0x4a0713={},_0x15792d={'count':0x0,'rows':[]};var _0x37eaf3=_[_0xf4d9('0x2c')](db[_0xf4d9('0x2d')]['rawAttributes'],function(_0x67172f){return{'name':_0x67172f[_0xf4d9('0x2e')],'type':_0x67172f[_0xf4d9('0x2f')][_0xf4d9('0x30')]};});_0x4a0713['model']=_['map'](_0x37eaf3,'name');_0x4a0713[_0xf4d9('0x31')]=_['keys'](_0x1be3be[_0xf4d9('0x31')]);_0x4a0713['filters']=_['intersection'](_0x4a0713[_0xf4d9('0x32')],_0x4a0713[_0xf4d9('0x31')]);_0x10717c['attributes']=_[_0xf4d9('0x33')](_0x4a0713[_0xf4d9('0x32')],qs[_0xf4d9('0x34')](_0x1be3be['query'][_0xf4d9('0x34')]));_0x10717c[_0xf4d9('0x35')]=_0x10717c['attributes'][_0xf4d9('0x36')]?_0x10717c[_0xf4d9('0x35')]:_0x4a0713[_0xf4d9('0x32')];if(!_0x1be3be[_0xf4d9('0x31')]['hasOwnProperty'](_0xf4d9('0x37'))){_0x10717c[_0xf4d9('0x20')]=qs[_0xf4d9('0x20')](_0x1be3be[_0xf4d9('0x31')][_0xf4d9('0x20')]);_0x10717c[_0xf4d9('0x1d')]=qs[_0xf4d9('0x1d')](_0x1be3be[_0xf4d9('0x31')][_0xf4d9('0x1d')]);}_0x10717c[_0xf4d9('0x38')]=qs[_0xf4d9('0x39')](_0x1be3be[_0xf4d9('0x31')][_0xf4d9('0x39')]);_0x10717c[_0xf4d9('0x3a')]=qs['filters'](_[_0xf4d9('0x3b')](_0x1be3be[_0xf4d9('0x31')],_0x4a0713['filters']),_0x37eaf3);if(_0x1be3be['query'][_0xf4d9('0x3c')]){_0x10717c['where']=_['merge'](_0x10717c[_0xf4d9('0x3a')],{'$or':_['map'](_0x37eaf3,function(_0x2e1b65){if(_0x2e1b65[_0xf4d9('0x2f')]!==_0xf4d9('0x3d')){var _0x2db496={};_0x2db496[_0x2e1b65['name']]={'$like':'%'+_0x1be3be[_0xf4d9('0x31')][_0xf4d9('0x3c')]+'%'};return _0x2db496;}})});}_0x10717c=_[_0xf4d9('0x3e')]({},_0x10717c,_0x1be3be['options']);var _0x3827cc={'where':_0x10717c[_0xf4d9('0x3a')]};return db[_0xf4d9('0x2d')][_0xf4d9('0x1f')](_0x3827cc)[_0xf4d9('0x27')](function(_0x29fb82){_0x15792d[_0xf4d9('0x1f')]=_0x29fb82;if(_0x1be3be[_0xf4d9('0x31')]['includeAll']){_0x10717c[_0xf4d9('0x3f')]=[{'all':!![]}];}return db[_0xf4d9('0x2d')][_0xf4d9('0x40')](_0x10717c);})['then'](function(_0x5fb787){_0x15792d[_0xf4d9('0x41')]=_0x5fb787;return _0x15792d;})['then'](respondWithFilteredResult(_0x4047e2,_0x10717c))['catch'](handleError(_0x4047e2,null));};exports[_0xf4d9('0x42')]=function(_0x391b71,_0x157b6e){var _0x4d7a54={'raw':![],'where':{'id':_0x391b71['params']['id']}},_0x1a49ea={};_0x1a49ea['model']=_[_0xf4d9('0x43')](db[_0xf4d9('0x2d')][_0xf4d9('0x44')]);_0x1a49ea[_0xf4d9('0x31')]=_['keys'](_0x391b71[_0xf4d9('0x31')]);_0x1a49ea[_0xf4d9('0x45')]=_[_0xf4d9('0x33')](_0x1a49ea['model'],_0x1a49ea['query']);_0x4d7a54[_0xf4d9('0x35')]=_[_0xf4d9('0x33')](_0x1a49ea[_0xf4d9('0x32')],qs[_0xf4d9('0x34')](_0x391b71['query'][_0xf4d9('0x34')]));_0x4d7a54[_0xf4d9('0x35')]=_0x4d7a54[_0xf4d9('0x35')][_0xf4d9('0x36')]?_0x4d7a54['attributes']:_0x1a49ea[_0xf4d9('0x32')];if(_0x391b71['query'][_0xf4d9('0x46')]){_0x4d7a54[_0xf4d9('0x3f')]=[{'all':!![]}];}_0x4d7a54=_['merge']({},_0x4d7a54,_0x391b71[_0xf4d9('0x47')]);return db[_0xf4d9('0x2d')]['find'](_0x4d7a54)[_0xf4d9('0x27')](handleEntityNotFound(_0x157b6e,null))[_0xf4d9('0x27')](respondWithResult(_0x157b6e,null))[_0xf4d9('0x48')](handleError(_0x157b6e,null));};exports['create']=function(_0x28f195,_0x23b22a){return db[_0xf4d9('0x2d')][_0xf4d9('0x49')](_0x28f195[_0xf4d9('0x4a')],{})[_0xf4d9('0x27')](respondWithResult(_0x23b22a,0xc9))[_0xf4d9('0x48')](handleError(_0x23b22a,null));};exports['bulkCreate']=function(_0x98d66b,_0xac7393){return db[_0xf4d9('0x2d')][_0xf4d9('0x4b')](_0x98d66b[_0xf4d9('0x4a')],{'raw':![],'individualHooks':!![]})[_0xf4d9('0x27')](respondWithResult(_0xac7393,0xc9))['catch'](handleError(_0xac7393,null));};exports[_0xf4d9('0x26')]=function(_0x126788,_0x158bed){if(_0x126788[_0xf4d9('0x4a')]['id']){delete _0x126788[_0xf4d9('0x4a')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x126788[_0xf4d9('0x4c')]['id']}})[_0xf4d9('0x27')](handleEntityNotFound(_0x158bed,null))[_0xf4d9('0x27')](saveUpdates(_0x126788['body'],null))[_0xf4d9('0x27')](respondWithResult(_0x158bed,null))[_0xf4d9('0x48')](handleError(_0x158bed,null));};exports[_0xf4d9('0x4d')]=function(_0xb0f3e6,_0x178409){return db['AnalyticFieldReport']['find']({'where':{'id':_0xb0f3e6['params']['id']}})['then'](handleEntityNotFound(_0x178409,null))[_0xf4d9('0x27')](removeEntity(_0x178409,null))[_0xf4d9('0x48')](handleError(_0x178409,null));};exports[_0xf4d9('0x4e')]=function(_0x5c351c,_0x4f9d97){return db['AnalyticFieldReport'][_0xf4d9('0x4d')]({'where':{'id':_0x5c351c[_0xf4d9('0x31')][_0xf4d9('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0xf4d9('0x27')](respondWithResult(_0x4f9d97,0xcc))[_0xf4d9('0x48')](handleError(_0x4f9d97,null));};exports['addFields']=function(_0x1d511e,_0x68f174,_0x410ff2){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x1d511e[_0xf4d9('0x4c')]['id']}})[_0xf4d9('0x27')](handleEntityNotFound(_0x68f174,null))[_0xf4d9('0x27')](function(_0x13fedd){if(_0x13fedd){return db[_0xf4d9('0x50')][_0xf4d9('0x51')](function(_0x4896d7){return db[_0xf4d9('0x2d')][_0xf4d9('0x4d')]({'where':{'CustomReportId':_0x1d511e[_0xf4d9('0x4c')]['id']},'transaction':_0x4896d7})[_0xf4d9('0x27')](function(_0x4fa0e9){var _0x2709ee=_['map'](_0x1d511e[_0xf4d9('0x4a')],function(_0x51b45c){delete _0x51b45c['id'];_0x51b45c[_0xf4d9('0x52')]=_0x1d511e['params']['id'];return _0x51b45c;});return db[_0xf4d9('0x2d')][_0xf4d9('0x4b')](_0x2709ee,{'transaction':_0x4896d7});});})[_0xf4d9('0x27')](function(){return db[_0xf4d9('0x2d')][_0xf4d9('0x40')]({'where':{'CustomReportId':_0x1d511e[_0xf4d9('0x4c')]['id']}});});}})[_0xf4d9('0x27')](respondWithResult(_0x68f174,null))[_0xf4d9('0x48')](handleError(_0x68f174,null));};
\ No newline at end of file
+var _0x57bd=['ids','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','error','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','intersection','create','body','catch','bulkCreate','find','params'];(function(_0x81a736,_0x1e437d){var _0x208d8c=function(_0x652e65){while(--_0x652e65){_0x81a736['push'](_0x81a736['shift']());}};_0x208d8c(++_0x1e437d);}(_0x57bd,0x185));var _0xd57b=function(_0x105b8b,_0x95a899){_0x105b8b=_0x105b8b-0x0;var _0x17ebda=_0x57bd[_0x105b8b];return _0x17ebda;};'use strict';var emlformat=require(_0xd57b('0x0'));var rimraf=require(_0xd57b('0x1'));var zipdir=require(_0xd57b('0x2'));var jsonpatch=require(_0xd57b('0x3'));var rp=require(_0xd57b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd57b('0x5'));var util=require('util');var path=require(_0xd57b('0x6'));var sox=require(_0xd57b('0x7'));var csv=require(_0xd57b('0x8'));var ejs=require(_0xd57b('0x9'));var fs=require('fs');var fs_extra=require(_0xd57b('0xa'));var _=require(_0xd57b('0xb'));var squel=require('squel');var crypto=require(_0xd57b('0xc'));var jsforce=require(_0xd57b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd57b('0x8'));var querystring=require(_0xd57b('0xe'));var Papa=require(_0xd57b('0xf'));var Redis=require(_0xd57b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd57b('0x11'));var logger=require(_0xd57b('0x12'))(_0xd57b('0x13'));var utils=require(_0xd57b('0x14'));var config=require(_0xd57b('0x15'));var licenseUtil=require(_0xd57b('0x16'));var db=require(_0xd57b('0x17'))['db'];function respondWithStatusCode(_0x43b0f5,_0x1ea3df){_0x1ea3df=_0x1ea3df||0xcc;return function(_0x36bec7){if(_0x36bec7){return _0x43b0f5[_0xd57b('0x18')](_0x1ea3df);}return _0x43b0f5[_0xd57b('0x19')](_0x1ea3df)[_0xd57b('0x1a')]();};}function respondWithResult(_0xccf9ad,_0x30caf0){_0x30caf0=_0x30caf0||0xc8;return function(_0x28d36e){if(_0x28d36e){return _0xccf9ad[_0xd57b('0x19')](_0x30caf0)[_0xd57b('0x1b')](_0x28d36e);}};}function respondWithFilteredResult(_0x197769,_0x47c986){return function(_0x2a0dc6){if(_0x2a0dc6){var _0x59b68a=typeof _0x47c986[_0xd57b('0x1c')]===_0xd57b('0x1d')&&typeof _0x47c986['limit']===_0xd57b('0x1d');var _0x4a0892=_0x2a0dc6[_0xd57b('0x1e')];var _0x119506=_0x59b68a?0x0:_0x47c986[_0xd57b('0x1c')];var _0x55a3b6=_0x59b68a?_0x2a0dc6[_0xd57b('0x1e')]:_0x47c986['offset']+_0x47c986[_0xd57b('0x1f')];var _0x4a8487;if(_0x55a3b6>=_0x4a0892){_0x55a3b6=_0x4a0892;_0x4a8487=0xc8;}else{_0x4a8487=0xce;}_0x197769[_0xd57b('0x19')](_0x4a8487);return _0x197769[_0xd57b('0x20')]('Content-Range',_0x119506+'-'+_0x55a3b6+'/'+_0x4a0892)[_0xd57b('0x1b')](_0x2a0dc6);}return null;};}function patchUpdates(_0x394472){return function(_0x3f7933){try{jsonpatch[_0xd57b('0x21')](_0x3f7933,_0x394472,!![]);}catch(_0x9492f8){return BPromise[_0xd57b('0x22')](_0x9492f8);}return _0x3f7933[_0xd57b('0x23')]();};}function saveUpdates(_0x2a7c65,_0x1df6c9){return function(_0x46d240){if(_0x46d240){return _0x46d240['update'](_0x2a7c65)['then'](function(_0x2c6079){return _0x2c6079;});}return null;};}function removeEntity(_0x3ccb45,_0x1c0e0d){return function(_0x471db7){if(_0x471db7){return _0x471db7[_0xd57b('0x24')]()[_0xd57b('0x25')](function(){_0x3ccb45[_0xd57b('0x19')](0xcc)[_0xd57b('0x1a')]();});}};}function handleEntityNotFound(_0x1604e4,_0x2634c1){return function(_0x21e7c9){if(!_0x21e7c9){_0x1604e4[_0xd57b('0x18')](0x194);}return _0x21e7c9;};}function handleError(_0x4f84b7,_0x2a9e46){_0x2a9e46=_0x2a9e46||0x1f4;return function(_0x1c18c4){logger[_0xd57b('0x26')](_0x1c18c4['stack']);if(_0x1c18c4[_0xd57b('0x27')]){delete _0x1c18c4[_0xd57b('0x27')];}_0x4f84b7[_0xd57b('0x19')](_0x2a9e46)[_0xd57b('0x28')](_0x1c18c4);};}exports['index']=function(_0x4561cb,_0x3c7140){var _0x264a0b={},_0x3fa723={},_0x45d389={'count':0x0,'rows':[]};var _0x4c6816=_[_0xd57b('0x29')](db[_0xd57b('0x2a')][_0xd57b('0x2b')],function(_0x27c58b){return{'name':_0x27c58b[_0xd57b('0x2c')],'type':_0x27c58b['type']['key']};});_0x3fa723[_0xd57b('0x2d')]=_[_0xd57b('0x29')](_0x4c6816,_0xd57b('0x27'));_0x3fa723['query']=_[_0xd57b('0x2e')](_0x4561cb[_0xd57b('0x2f')]);_0x3fa723[_0xd57b('0x30')]=_['intersection'](_0x3fa723['model'],_0x3fa723[_0xd57b('0x2f')]);_0x264a0b[_0xd57b('0x31')]=_['intersection'](_0x3fa723[_0xd57b('0x2d')],qs[_0xd57b('0x32')](_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x32')]));_0x264a0b[_0xd57b('0x31')]=_0x264a0b[_0xd57b('0x31')][_0xd57b('0x33')]?_0x264a0b['attributes']:_0x3fa723[_0xd57b('0x2d')];if(!_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x34')]('nolimit')){_0x264a0b[_0xd57b('0x1f')]=qs[_0xd57b('0x1f')](_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x1f')]);_0x264a0b[_0xd57b('0x1c')]=qs[_0xd57b('0x1c')](_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x1c')]);}_0x264a0b[_0xd57b('0x35')]=qs[_0xd57b('0x36')](_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x36')]);_0x264a0b['where']=qs[_0xd57b('0x30')](_[_0xd57b('0x37')](_0x4561cb['query'],_0x3fa723[_0xd57b('0x30')]),_0x4c6816);if(_0x4561cb['query'][_0xd57b('0x38')]){_0x264a0b[_0xd57b('0x39')]=_[_0xd57b('0x3a')](_0x264a0b['where'],{'$or':_[_0xd57b('0x29')](_0x4c6816,function(_0x1b847e){if(_0x1b847e[_0xd57b('0x3b')]!==_0xd57b('0x3c')){var _0x2f0460={};_0x2f0460[_0x1b847e['name']]={'$like':'%'+_0x4561cb[_0xd57b('0x2f')]['filter']+'%'};return _0x2f0460;}})});}_0x264a0b=_[_0xd57b('0x3a')]({},_0x264a0b,_0x4561cb[_0xd57b('0x3d')]);var _0x58cb0c={'where':_0x264a0b[_0xd57b('0x39')]};return db[_0xd57b('0x2a')][_0xd57b('0x1e')](_0x58cb0c)[_0xd57b('0x25')](function(_0x498cda){_0x45d389[_0xd57b('0x1e')]=_0x498cda;if(_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x3e')]){_0x264a0b[_0xd57b('0x3f')]=[{'all':!![]}];}return db[_0xd57b('0x2a')][_0xd57b('0x40')](_0x264a0b);})[_0xd57b('0x25')](function(_0x10de27){_0x45d389[_0xd57b('0x41')]=_0x10de27;return _0x45d389;})[_0xd57b('0x25')](respondWithFilteredResult(_0x3c7140,_0x264a0b))['catch'](handleError(_0x3c7140,null));};exports['show']=function(_0x3ea241,_0x1b79f7){var _0x1503cb={'raw':![],'where':{'id':_0x3ea241['params']['id']}},_0x98d5a4={};_0x98d5a4[_0xd57b('0x2d')]=_[_0xd57b('0x2e')](db[_0xd57b('0x2a')][_0xd57b('0x2b')]);_0x98d5a4[_0xd57b('0x2f')]=_[_0xd57b('0x2e')](_0x3ea241[_0xd57b('0x2f')]);_0x98d5a4[_0xd57b('0x30')]=_[_0xd57b('0x42')](_0x98d5a4[_0xd57b('0x2d')],_0x98d5a4[_0xd57b('0x2f')]);_0x1503cb[_0xd57b('0x31')]=_[_0xd57b('0x42')](_0x98d5a4['model'],qs[_0xd57b('0x32')](_0x3ea241[_0xd57b('0x2f')][_0xd57b('0x32')]));_0x1503cb[_0xd57b('0x31')]=_0x1503cb[_0xd57b('0x31')][_0xd57b('0x33')]?_0x1503cb[_0xd57b('0x31')]:_0x98d5a4[_0xd57b('0x2d')];if(_0x3ea241[_0xd57b('0x2f')][_0xd57b('0x3e')]){_0x1503cb['include']=[{'all':!![]}];}_0x1503cb=_[_0xd57b('0x3a')]({},_0x1503cb,_0x3ea241[_0xd57b('0x3d')]);return db[_0xd57b('0x2a')]['find'](_0x1503cb)[_0xd57b('0x25')](handleEntityNotFound(_0x1b79f7,null))[_0xd57b('0x25')](respondWithResult(_0x1b79f7,null))['catch'](handleError(_0x1b79f7,null));};exports[_0xd57b('0x43')]=function(_0x5990cd,_0x1a21a1){return db[_0xd57b('0x2a')][_0xd57b('0x43')](_0x5990cd[_0xd57b('0x44')],{})[_0xd57b('0x25')](respondWithResult(_0x1a21a1,0xc9))[_0xd57b('0x45')](handleError(_0x1a21a1,null));};exports[_0xd57b('0x46')]=function(_0x361138,_0x19fed7){return db[_0xd57b('0x2a')][_0xd57b('0x46')](_0x361138[_0xd57b('0x44')],{'raw':![],'individualHooks':!![]})[_0xd57b('0x25')](respondWithResult(_0x19fed7,0xc9))[_0xd57b('0x45')](handleError(_0x19fed7,null));};exports['update']=function(_0x1349c5,_0x242526){if(_0x1349c5[_0xd57b('0x44')]['id']){delete _0x1349c5[_0xd57b('0x44')]['id'];}return db[_0xd57b('0x2a')][_0xd57b('0x47')]({'where':{'id':_0x1349c5[_0xd57b('0x48')]['id']}})['then'](handleEntityNotFound(_0x242526,null))[_0xd57b('0x25')](saveUpdates(_0x1349c5[_0xd57b('0x44')],null))[_0xd57b('0x25')](respondWithResult(_0x242526,null))['catch'](handleError(_0x242526,null));};exports[_0xd57b('0x24')]=function(_0x3f5416,_0x5cc8ed){return db[_0xd57b('0x2a')][_0xd57b('0x47')]({'where':{'id':_0x3f5416['params']['id']}})[_0xd57b('0x25')](handleEntityNotFound(_0x5cc8ed,null))[_0xd57b('0x25')](removeEntity(_0x5cc8ed,null))[_0xd57b('0x45')](handleError(_0x5cc8ed,null));};exports['bulkDestroy']=function(_0x1b5653,_0x5250fa){return db[_0xd57b('0x2a')][_0xd57b('0x24')]({'where':{'id':_0x1b5653[_0xd57b('0x2f')][_0xd57b('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xd57b('0x25')](respondWithResult(_0x5250fa,0xcc))[_0xd57b('0x45')](handleError(_0x5250fa,null));};exports['addFields']=function(_0x1d6786,_0x2621d9,_0x59bc1e){return db[_0xd57b('0x4a')][_0xd57b('0x4b')]({'where':{'id':_0x1d6786[_0xd57b('0x48')]['id']}})['then'](handleEntityNotFound(_0x2621d9,null))[_0xd57b('0x25')](function(_0x37de0d){if(_0x37de0d){return db['sequelize'][_0xd57b('0x4c')](function(_0x1037ac){return db[_0xd57b('0x2a')]['destroy']({'where':{'CustomReportId':_0x1d6786[_0xd57b('0x48')]['id']},'transaction':_0x1037ac})[_0xd57b('0x25')](function(_0x2aa4e8){var _0x126f40=_[_0xd57b('0x29')](_0x1d6786[_0xd57b('0x44')],function(_0x4f18b8){delete _0x4f18b8['id'];_0x4f18b8['CustomReportId']=_0x1d6786[_0xd57b('0x48')]['id'];return _0x4f18b8;});return db[_0xd57b('0x2a')][_0xd57b('0x46')](_0x126f40,{'transaction':_0x1037ac});});})[_0xd57b('0x25')](function(){return db[_0xd57b('0x2a')][_0xd57b('0x40')]({'where':{'CustomReportId':_0x1d6786[_0xd57b('0x48')]['id']}});});}})[_0xd57b('0x25')](respondWithResult(_0x2621d9,null))[_0xd57b('0x45')](handleError(_0x2621d9,null));};
\ No newline at end of file
index 0ea3949..43f6d5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x902f=['analytics_report_fields','util','../../config/logger','api','moment','bluebird','rimraf','exports','AnalyticFieldReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x902f,0x1de));var _0xf902=function(_0x51377c,_0x2f7c8b){_0x51377c=_0x51377c-0x0;var _0x364511=_0x902f[_0x51377c];return _0x364511;};'use strict';var _=require('lodash');var util=require(_0xf902('0x0'));var logger=require(_0xf902('0x1'))(_0xf902('0x2'));var moment=require(_0xf902('0x3'));var BPromise=require(_0xf902('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf902('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0xf902('0x6')]=function(_0x5589de,_0x4e75f8){return _0x5589de['define'](_0xf902('0x7'),attributes,{'tableName':_0xf902('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd5c=['exports','AnalyticFieldReport','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xdd5c,0x156));var _0xcdd5=function(_0x45bcb1,_0x46cad0){_0x45bcb1=_0x45bcb1-0x0;var _0x4bd6a3=_0xdd5c[_0x45bcb1];return _0x4bd6a3;};'use strict';var _=require(_0xcdd5('0x0'));var util=require(_0xcdd5('0x1'));var logger=require(_0xcdd5('0x2'))('api');var moment=require(_0xcdd5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdd5('0x4'));var rimraf=require(_0xcdd5('0x5'));var config=require(_0xcdd5('0x6'));var attributes=require(_0xcdd5('0x7'));module[_0xcdd5('0x8')]=function(_0x3b14ee,_0x4942d6){return _0x3b14ee['define'](_0xcdd5('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fb3e771..4466191 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4601=['request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x4601,0xbf));var _0x1460=function(_0x55a625,_0x57ca32){_0x55a625=_0x55a625-0x0;var _0x3083da=_0x4601[_0x55a625];return _0x3083da;};'use strict';var _=require(_0x1460('0x0'));var util=require(_0x1460('0x1'));var moment=require('moment');var BPromise=require(_0x1460('0x2'));var rs=require(_0x1460('0x3'));var fs=require('fs');var Redis=require(_0x1460('0x4'));var db=require(_0x1460('0x5'))['db'];var utils=require(_0x1460('0x6'));var logger=require('../../config/logger')(_0x1460('0x7'));var config=require(_0x1460('0x8'));var jayson=require(_0x1460('0x9'));var client=jayson[_0x1460('0xa')][_0x1460('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ceb28,_0x84f761,_0x25b842){return new BPromise(function(_0x168e16,_0x452fa2){return client[_0x1460('0xc')](_0x1ceb28,_0x25b842)[_0x1460('0xd')](function(_0x112a60){logger[_0x1460('0xe')](_0x1460('0xf'),_0x84f761,_0x1460('0x10'));logger[_0x1460('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x84f761,_0x1460('0x10'),JSON['stringify'](_0x112a60));if(_0x112a60[_0x1460('0x12')]){if(_0x112a60[_0x1460('0x12')][_0x1460('0x13')]===0x1f4){logger['error'](_0x1460('0xf'),_0x84f761,_0x112a60['error'][_0x1460('0x14')]);return _0x452fa2(_0x112a60[_0x1460('0x12')][_0x1460('0x14')]);}logger['error'](_0x1460('0xf'),_0x84f761,_0x112a60[_0x1460('0x12')]['message']);return _0x168e16(_0x112a60['error'][_0x1460('0x14')]);}else{logger[_0x1460('0xe')](_0x1460('0xf'),_0x84f761,_0x1460('0x10'));_0x168e16(_0x112a60[_0x1460('0x15')][_0x1460('0x14')]);}})[_0x1460('0x16')](function(_0xe186ac){logger['error'](_0x1460('0xf'),_0x84f761,_0xe186ac);_0x452fa2(_0xe186ac);});});}
\ No newline at end of file
+var _0xb130=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x475def,_0x579a6e){var _0x109214=function(_0x2b3218){while(--_0x2b3218){_0x475def['push'](_0x475def['shift']());}};_0x109214(++_0x579a6e);}(_0xb130,0x86));var _0x0b13=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xb130[_0x119b3e];return _0x1169ae;};'use strict';var _=require(_0x0b13('0x0'));var util=require('util');var moment=require(_0x0b13('0x1'));var BPromise=require(_0x0b13('0x2'));var rs=require(_0x0b13('0x3'));var fs=require('fs');var Redis=require(_0x0b13('0x4'));var db=require(_0x0b13('0x5'))['db'];var utils=require(_0x0b13('0x6'));var logger=require(_0x0b13('0x7'))(_0x0b13('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0b13('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568722,_0x3f71b4,_0xc62cc4){return new BPromise(function(_0x19fdc2,_0x8280b5){return client[_0x0b13('0xa')](_0x568722,_0xc62cc4)[_0x0b13('0xb')](function(_0x2d11cd){logger[_0x0b13('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f71b4,_0x0b13('0xd'));logger[_0x0b13('0xe')](_0x0b13('0xf'),_0x3f71b4,'request\x20sent',JSON[_0x0b13('0x10')](_0x2d11cd));if(_0x2d11cd[_0x0b13('0x11')]){if(_0x2d11cd[_0x0b13('0x11')][_0x0b13('0x12')]===0x1f4){logger[_0x0b13('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f71b4,_0x2d11cd['error'][_0x0b13('0x13')]);return _0x8280b5(_0x2d11cd[_0x0b13('0x11')][_0x0b13('0x13')]);}logger['error'](_0x0b13('0x14'),_0x3f71b4,_0x2d11cd['error']['message']);return _0x19fdc2(_0x2d11cd[_0x0b13('0x11')][_0x0b13('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3f71b4,_0x0b13('0xd'));_0x19fdc2(_0x2d11cd[_0x0b13('0x15')][_0x0b13('0x13')]);}})[_0x0b13('0x16')](function(_0x485688){logger[_0x0b13('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f71b4,_0x485688);_0x8280b5(_0x485688);});});}
\ No newline at end of file
index 354c07a..5d0a27b 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(_0x57ae21,_0x20a9fc){var _0x53af5b=function(_0x57a1e4){while(--_0x57a1e4){_0x57ae21['push'](_0x57ae21['shift']());}};_0x53af5b(++_0x20a9fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x2715fe,_0x4e0f99){var _0x45f432=function(_0x636842){while(--_0x636842){_0x2715fe['push'](_0x2715fe['shift']());}};_0x45f432(++_0x4e0f99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 b769cb9..e14adad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85ed=['name','TEXT','sequelize','exports','STRING'];(function(_0x6678db,_0x5b9acd){var _0x36f7f1=function(_0x4f7100){while(--_0x4f7100){_0x6678db['push'](_0x6678db['shift']());}};_0x36f7f1(++_0x5b9acd);}(_0x85ed,0x66));var _0xd85e=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x85ed[_0x1ccbcc];return _0x1e873f;};'use strict';var Sequelize=require(_0xd85e('0x0'));module[_0xd85e('0x1')]={'name':{'type':Sequelize[_0xd85e('0x2')],'allowNull':![],'unique':_0xd85e('0x3')},'table':{'type':Sequelize[_0xd85e('0x2')]},'metric':{'type':Sequelize[_0xd85e('0x4')]},'description':{'type':Sequelize[_0xd85e('0x2')]}};
\ No newline at end of file
+var _0x9d62=['exports','STRING','name','sequelize'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9d62,0xaf));var _0x29d6=function(_0x4805f4,_0xdf483e){_0x4805f4=_0x4805f4-0x0;var _0x1c63d4=_0x9d62[_0x4805f4];return _0x1c63d4;};'use strict';var Sequelize=require(_0x29d6('0x0'));module[_0x29d6('0x1')]={'name':{'type':Sequelize[_0x29d6('0x2')],'allowNull':![],'unique':_0x29d6('0x3')},'table':{'type':Sequelize[_0x29d6('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x29d6('0x2')]}};
\ No newline at end of file
index e952398..53bf953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','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'];(function(_0x5efaf8,_0x4caaf5){var _0x68502f=function(_0x33fbdc){while(--_0x33fbdc){_0x5efaf8['push'](_0x5efaf8['shift']());}};_0x68502f(++_0x4caaf5);}(_0x55ca,0x126));var _0xa55c=function(_0x237815,_0x1ef2b0){_0x237815=_0x237815-0x0;var _0x5498ee=_0x55ca[_0x237815];return _0x5498ee;};'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(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
+var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x9b26e0,_0x4643d7){var _0x35c253=function(_0x12c449){while(--_0x12c449){_0x9b26e0['push'](_0x9b26e0['shift']());}};_0x35c253(++_0x4643d7);}(_0x24ca,0x1bc));var _0xa24c=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x24ca[_0x282a1f];return _0x296ea7;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));};
\ No newline at end of file
index 8c684b2..d85a1d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c32=['analytics_metrics','lodash','../../config/logger','moment','request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x1c4332,_0x47e66a){var _0xf4ff67=function(_0x306821){while(--_0x306821){_0x1c4332['push'](_0x1c4332['shift']());}};_0xf4ff67(++_0x47e66a);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var logger=require(_0x26c3('0x1'))('api');var moment=require(_0x26c3('0x2'));var BPromise=require('bluebird');var rp=require(_0x26c3('0x3'));var fs=require('fs');var path=require(_0x26c3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26c3('0x5'));module[_0x26c3('0x6')]=function(_0x421941,_0x402393){return _0x421941[_0x26c3('0x7')](_0x26c3('0x8'),attributes,{'tableName':_0x26c3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xba0d=['api','moment','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger'];(function(_0x536ba4,_0x58d964){var _0x4eae23=function(_0x4b6e91){while(--_0x4b6e91){_0x536ba4['push'](_0x536ba4['shift']());}};_0x4eae23(++_0x58d964);}(_0xba0d,0x8e));var _0xdba0=function(_0x5441eb,_0x395a7b){_0x5441eb=_0x5441eb-0x0;var _0x458a33=_0xba0d[_0x5441eb];return _0x458a33;};'use strict';var _=require(_0xdba0('0x0'));var util=require('util');var logger=require(_0xdba0('0x1'))(_0xdba0('0x2'));var moment=require(_0xdba0('0x3'));var BPromise=require('bluebird');var rp=require(_0xdba0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdba0('0x5'));var config=require(_0xdba0('0x6'));var attributes=require(_0xdba0('0x7'));module[_0xdba0('0x8')]=function(_0x592a53,_0x59e841){return _0x592a53[_0xdba0('0x9')](_0xdba0('0xa'),attributes,{'tableName':_0xdba0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e7401bc..c0e803a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa809=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xa809,0xf6));var _0x9a80=function(_0x605ebb,_0x135437){_0x605ebb=_0x605ebb-0x0;var _0x4627bb=_0xa809[_0x605ebb];return _0x4627bb;};'use strict';var _=require(_0x9a80('0x0'));var util=require(_0x9a80('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(_0x9a80('0x2'))('rpc');var config=require(_0x9a80('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x9a80('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49c691,_0x26eda3,_0x23fede){return new BPromise(function(_0xa729ab,_0x101d95){return client[_0x9a80('0x5')](_0x49c691,_0x23fede)['then'](function(_0x1b37bf){logger[_0x9a80('0x6')]('AnalyticMetric,\x20%s,\x20%s',_0x26eda3,_0x9a80('0x7'));logger[_0x9a80('0x8')](_0x9a80('0x9'),_0x26eda3,_0x9a80('0x7'),JSON[_0x9a80('0xa')](_0x1b37bf));if(_0x1b37bf[_0x9a80('0xb')]){if(_0x1b37bf[_0x9a80('0xb')][_0x9a80('0xc')]===0x1f4){logger[_0x9a80('0xb')](_0x9a80('0xd'),_0x26eda3,_0x1b37bf[_0x9a80('0xb')]['message']);return _0x101d95(_0x1b37bf[_0x9a80('0xb')][_0x9a80('0xe')]);}logger[_0x9a80('0xb')](_0x9a80('0xd'),_0x26eda3,_0x1b37bf[_0x9a80('0xb')][_0x9a80('0xe')]);return _0xa729ab(_0x1b37bf[_0x9a80('0xb')]['message']);}else{logger[_0x9a80('0x6')]('AnalyticMetric,\x20%s,\x20%s',_0x26eda3,_0x9a80('0x7'));_0xa729ab(_0x1b37bf[_0x9a80('0xf')][_0x9a80('0xe')]);}})[_0x9a80('0x10')](function(_0x22607a){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x26eda3,_0x22607a);_0x101d95(_0x22607a);});});}
\ No newline at end of file
+var _0x24be=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s'];(function(_0x1c9bf9,_0xf95651){var _0x4f948f=function(_0x20be74){while(--_0x20be74){_0x1c9bf9['push'](_0x1c9bf9['shift']());}};_0x4f948f(++_0xf95651);}(_0x24be,0x69));var _0xe24b=function(_0x55713f,_0x1eaecc){_0x55713f=_0x55713f-0x0;var _0x5adbba=_0x24be[_0x55713f];return _0x5adbba;};'use strict';var _=require(_0xe24b('0x0'));var util=require(_0xe24b('0x1'));var moment=require(_0xe24b('0x2'));var BPromise=require(_0xe24b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe24b('0x4'));var db=require(_0xe24b('0x5'))['db'];var utils=require(_0xe24b('0x6'));var logger=require(_0xe24b('0x7'))(_0xe24b('0x8'));var config=require(_0xe24b('0x9'));var jayson=require(_0xe24b('0xa'));var client=jayson[_0xe24b('0xb')][_0xe24b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23c1e5,_0x3d850c,_0x2d1f98){return new BPromise(function(_0x3d088e,_0x50e26e){return client['request'](_0x23c1e5,_0x2d1f98)[_0xe24b('0xd')](function(_0x1c29a5){logger['info'](_0xe24b('0xe'),_0x3d850c,_0xe24b('0xf'));logger[_0xe24b('0x10')](_0xe24b('0x11'),_0x3d850c,_0xe24b('0xf'),JSON[_0xe24b('0x12')](_0x1c29a5));if(_0x1c29a5['error']){if(_0x1c29a5[_0xe24b('0x13')][_0xe24b('0x14')]===0x1f4){logger[_0xe24b('0x13')](_0xe24b('0xe'),_0x3d850c,_0x1c29a5[_0xe24b('0x13')]['message']);return _0x50e26e(_0x1c29a5[_0xe24b('0x13')][_0xe24b('0x15')]);}logger[_0xe24b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3d850c,_0x1c29a5['error']['message']);return _0x3d088e(_0x1c29a5[_0xe24b('0x13')][_0xe24b('0x15')]);}else{logger[_0xe24b('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x3d850c,_0xe24b('0xf'));_0x3d088e(_0x1c29a5[_0xe24b('0x17')]['message']);}})['catch'](function(_0xf0ec55){logger['error'](_0xe24b('0xe'),_0x3d850c,_0xf0ec55);_0x50e26e(_0xf0ec55);});});}
\ No newline at end of file
index 1ab080d..804d722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc0d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x255e86,_0x547fb2){var _0x7daf7d=function(_0x1e31a8){while(--_0x1e31a8){_0x255e86['push'](_0x255e86['shift']());}};_0x7daf7d(++_0x547fb2);}(_0xdc0d,0x1db));var _0xddc0=function(_0x34d07d,_0x254b81){_0x34d07d=_0x34d07d-0x0;var _0x39ffcb=_0xdc0d[_0x34d07d];return _0x39ffcb;};'use strict';var multer=require(_0xddc0('0x0'));var util=require(_0xddc0('0x1'));var path=require('path');var timeout=require(_0xddc0('0x2'));var express=require('express');var router=express[_0xddc0('0x3')]();var fs_extra=require(_0xddc0('0x4'));var auth=require(_0xddc0('0x5'));var interaction=require(_0xddc0('0x6'));var config=require(_0xddc0('0x7'));var controller=require(_0xddc0('0x8'));router[_0xddc0('0x9')]('/',auth[_0xddc0('0xa')](),controller[_0xddc0('0xb')]);router['get'](_0xddc0('0xc'),auth[_0xddc0('0xa')](),controller[_0xddc0('0xd')]);router[_0xddc0('0xe')]('/',auth[_0xddc0('0xa')](),controller[_0xddc0('0xf')]);router['put'](_0xddc0('0xc'),auth[_0xddc0('0xa')](),controller[_0xddc0('0x10')]);router[_0xddc0('0x11')](_0xddc0('0xc'),auth[_0xddc0('0xa')](),controller[_0xddc0('0x12')]);module[_0xddc0('0x13')]=router;
\ No newline at end of file
+var _0xef8b=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','post','isAuthenticated','update','delete'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xef8b,0x192));var _0xbef8=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0xef8b[_0x51ec61];return _0x223200;};'use strict';var multer=require('multer');var util=require(_0xbef8('0x0'));var path=require(_0xbef8('0x1'));var timeout=require(_0xbef8('0x2'));var express=require(_0xbef8('0x3'));var router=express[_0xbef8('0x4')]();var fs_extra=require(_0xbef8('0x5'));var auth=require(_0xbef8('0x6'));var interaction=require(_0xbef8('0x7'));var config=require(_0xbef8('0x8'));var controller=require(_0xbef8('0x9'));router[_0xbef8('0xa')]('/',auth['isAuthenticated'](),controller[_0xbef8('0xb')]);router[_0xbef8('0xa')](_0xbef8('0xc'),auth['isAuthenticated'](),controller[_0xbef8('0xd')]);router[_0xbef8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xbef8('0xc'),auth[_0xbef8('0xf')](),controller[_0xbef8('0x10')]);router[_0xbef8('0x11')](_0xbef8('0xc'),auth[_0xbef8('0xf')](),controller[_0xbef8('0x12')]);module[_0xbef8('0x13')]=router;
\ No newline at end of file
index 0797c97..1f16519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe157=['TEXT','exports'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xe157,0x1a1));var _0x7e15=function(_0x580c58,_0x2889c2){_0x580c58=_0x580c58-0x0;var _0x4af490=_0xe157[_0x580c58];return _0x4af490;};'use strict';var Sequelize=require('sequelize');module[_0x7e15('0x0')]={'tree':{'type':Sequelize[_0x7e15('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x578a=['TEXT','sequelize','exports'];(function(_0x239ea4,_0x2413a9){var _0xe0a9ae=function(_0x4610f9){while(--_0x4610f9){_0x239ea4['push'](_0x239ea4['shift']());}};_0xe0a9ae(++_0x2413a9);}(_0x578a,0xd0));var _0xa578=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0x578a[_0xe4d6c6];return _0x3a8935;};'use strict';var Sequelize=require(_0xa578('0x0'));module[_0xa578('0x1')]={'tree':{'type':Sequelize[_0xa578('0x2')],'allowNull':![]}};
\ No newline at end of file
index ef6a4b9..9bac45d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f3a=['rows','catch','show','rawAttributes','includeAll','options','find','create','body','params','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','AnalyticTreeReport','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','include','findAll'];(function(_0x4c2774,_0x1a83cd){var _0x259ecd=function(_0x2dce95){while(--_0x2dce95){_0x4c2774['push'](_0x4c2774['shift']());}};_0x259ecd(++_0x1a83cd);}(_0x2f3a,0x13a));var _0xa2f3=function(_0x455831,_0x29821f){_0x455831=_0x455831-0x0;var _0x4e0691=_0x2f3a[_0x455831];return _0x4e0691;};'use strict';var emlformat=require(_0xa2f3('0x0'));var rimraf=require(_0xa2f3('0x1'));var zipdir=require(_0xa2f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa2f3('0x3'));var Mustache=require(_0xa2f3('0x4'));var util=require(_0xa2f3('0x5'));var path=require(_0xa2f3('0x6'));var sox=require(_0xa2f3('0x7'));var csv=require(_0xa2f3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require(_0xa2f3('0xa'));var crypto=require(_0xa2f3('0xb'));var jsforce=require(_0xa2f3('0xc'));var deskjs=require(_0xa2f3('0xd'));var toCsv=require(_0xa2f3('0x8'));var querystring=require(_0xa2f3('0xe'));var Papa=require(_0xa2f3('0xf'));var Redis=require(_0xa2f3('0x10'));var authService=require(_0xa2f3('0x11'));var qs=require(_0xa2f3('0x12'));var as=require(_0xa2f3('0x13'));var hardwareService=require(_0xa2f3('0x14'));var logger=require(_0xa2f3('0x15'))(_0xa2f3('0x16'));var utils=require(_0xa2f3('0x17'));var config=require(_0xa2f3('0x18'));var licenseUtil=require(_0xa2f3('0x19'));var db=require(_0xa2f3('0x1a'))['db'];function respondWithStatusCode(_0x5e6e18,_0x102d64){_0x102d64=_0x102d64||0xcc;return function(_0x5768ba){if(_0x5768ba){return _0x5e6e18['sendStatus'](_0x102d64);}return _0x5e6e18['status'](_0x102d64)['end']();};}function respondWithResult(_0xa3750d,_0x44c3d2){_0x44c3d2=_0x44c3d2||0xc8;return function(_0x5b5e1c){if(_0x5b5e1c){return _0xa3750d[_0xa2f3('0x1b')](_0x44c3d2)[_0xa2f3('0x1c')](_0x5b5e1c);}};}function respondWithFilteredResult(_0x53724f,_0x2f8dc1){return function(_0x308b4f){if(_0x308b4f){var _0x3d415b=typeof _0x2f8dc1[_0xa2f3('0x1d')]===_0xa2f3('0x1e')&&typeof _0x2f8dc1[_0xa2f3('0x1f')]===_0xa2f3('0x1e');var _0x1486df=_0x308b4f[_0xa2f3('0x20')];var _0x4b9444=_0x3d415b?0x0:_0x2f8dc1[_0xa2f3('0x1d')];var _0x3653be=_0x3d415b?_0x308b4f['count']:_0x2f8dc1[_0xa2f3('0x1d')]+_0x2f8dc1[_0xa2f3('0x1f')];var _0x4c4e6d;if(_0x3653be>=_0x1486df){_0x3653be=_0x1486df;_0x4c4e6d=0xc8;}else{_0x4c4e6d=0xce;}_0x53724f[_0xa2f3('0x1b')](_0x4c4e6d);return _0x53724f[_0xa2f3('0x21')]('Content-Range',_0x4b9444+'-'+_0x3653be+'/'+_0x1486df)[_0xa2f3('0x1c')](_0x308b4f);}return null;};}function patchUpdates(_0x23772b){return function(_0x35cb58){try{jsonpatch[_0xa2f3('0x22')](_0x35cb58,_0x23772b,!![]);}catch(_0x55e614){return BPromise[_0xa2f3('0x23')](_0x55e614);}return _0x35cb58[_0xa2f3('0x24')]();};}function saveUpdates(_0x1b053d,_0x51a978){return function(_0x5529ad){if(_0x5529ad){return _0x5529ad[_0xa2f3('0x25')](_0x1b053d)['then'](function(_0x4d0110){return _0x4d0110;});}return null;};}function removeEntity(_0x23aec6,_0xe3679d){return function(_0xf837e6){if(_0xf837e6){return _0xf837e6[_0xa2f3('0x26')]()[_0xa2f3('0x27')](function(){_0x23aec6[_0xa2f3('0x1b')](0xcc)[_0xa2f3('0x28')]();});}};}function handleEntityNotFound(_0x4a4577,_0x193f07){return function(_0x454a5c){if(!_0x454a5c){_0x4a4577['sendStatus'](0x194);}return _0x454a5c;};}function handleError(_0x26f80b,_0x447461){_0x447461=_0x447461||0x1f4;return function(_0x13c67a){logger[_0xa2f3('0x29')](_0x13c67a[_0xa2f3('0x2a')]);if(_0x13c67a[_0xa2f3('0x2b')]){delete _0x13c67a[_0xa2f3('0x2b')];}_0x26f80b['status'](_0x447461)[_0xa2f3('0x2c')](_0x13c67a);};}exports['index']=function(_0x4bdf65,_0xccb8f){var _0x1fcf85={},_0xaf8195={},_0x10d96b={'count':0x0,'rows':[]};var _0x5caf87=_[_0xa2f3('0x2d')](db[_0xa2f3('0x2e')]['rawAttributes'],function(_0x4b7966){return{'name':_0x4b7966[_0xa2f3('0x2f')],'type':_0x4b7966[_0xa2f3('0x30')]['key']};});_0xaf8195['model']=_[_0xa2f3('0x2d')](_0x5caf87,_0xa2f3('0x2b'));_0xaf8195[_0xa2f3('0x31')]=_[_0xa2f3('0x32')](_0x4bdf65[_0xa2f3('0x31')]);_0xaf8195[_0xa2f3('0x33')]=_[_0xa2f3('0x34')](_0xaf8195[_0xa2f3('0x35')],_0xaf8195['query']);_0x1fcf85['attributes']=_['intersection'](_0xaf8195[_0xa2f3('0x35')],qs['fields'](_0x4bdf65['query'][_0xa2f3('0x36')]));_0x1fcf85[_0xa2f3('0x37')]=_0x1fcf85[_0xa2f3('0x37')][_0xa2f3('0x38')]?_0x1fcf85['attributes']:_0xaf8195['model'];if(!_0x4bdf65[_0xa2f3('0x31')]['hasOwnProperty'](_0xa2f3('0x39'))){_0x1fcf85[_0xa2f3('0x1f')]=qs[_0xa2f3('0x1f')](_0x4bdf65['query']['limit']);_0x1fcf85[_0xa2f3('0x1d')]=qs[_0xa2f3('0x1d')](_0x4bdf65['query']['offset']);}_0x1fcf85[_0xa2f3('0x3a')]=qs['sort'](_0x4bdf65['query'][_0xa2f3('0x3b')]);_0x1fcf85['where']=qs[_0xa2f3('0x33')](_[_0xa2f3('0x3c')](_0x4bdf65[_0xa2f3('0x31')],_0xaf8195['filters']),_0x5caf87);if(_0x4bdf65[_0xa2f3('0x31')][_0xa2f3('0x3d')]){_0x1fcf85[_0xa2f3('0x3e')]=_[_0xa2f3('0x3f')](_0x1fcf85[_0xa2f3('0x3e')],{'$or':_[_0xa2f3('0x2d')](_0x5caf87,function(_0x5c23fa){if(_0x5c23fa[_0xa2f3('0x30')]!=='VIRTUAL'){var _0x2ba921={};_0x2ba921[_0x5c23fa[_0xa2f3('0x2b')]]={'$like':'%'+_0x4bdf65[_0xa2f3('0x31')][_0xa2f3('0x3d')]+'%'};return _0x2ba921;}})});}_0x1fcf85=_['merge']({},_0x1fcf85,_0x4bdf65['options']);var _0x276f0d={'where':_0x1fcf85[_0xa2f3('0x3e')]};return db['AnalyticTreeReport']['count'](_0x276f0d)['then'](function(_0x5573cc){_0x10d96b['count']=_0x5573cc;if(_0x4bdf65['query']['includeAll']){_0x1fcf85[_0xa2f3('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xa2f3('0x41')](_0x1fcf85);})[_0xa2f3('0x27')](function(_0x1ef855){_0x10d96b[_0xa2f3('0x42')]=_0x1ef855;return _0x10d96b;})['then'](respondWithFilteredResult(_0xccb8f,_0x1fcf85))[_0xa2f3('0x43')](handleError(_0xccb8f,null));};exports[_0xa2f3('0x44')]=function(_0x581879,_0x5e9b1a){var _0x151081={'raw':!![],'where':{'id':_0x581879['params']['id']}},_0x40cdc2={};_0x40cdc2[_0xa2f3('0x35')]=_[_0xa2f3('0x32')](db[_0xa2f3('0x2e')][_0xa2f3('0x45')]);_0x40cdc2[_0xa2f3('0x31')]=_['keys'](_0x581879[_0xa2f3('0x31')]);_0x40cdc2[_0xa2f3('0x33')]=_[_0xa2f3('0x34')](_0x40cdc2[_0xa2f3('0x35')],_0x40cdc2[_0xa2f3('0x31')]);_0x151081[_0xa2f3('0x37')]=_[_0xa2f3('0x34')](_0x40cdc2['model'],qs[_0xa2f3('0x36')](_0x581879[_0xa2f3('0x31')][_0xa2f3('0x36')]));_0x151081[_0xa2f3('0x37')]=_0x151081[_0xa2f3('0x37')][_0xa2f3('0x38')]?_0x151081[_0xa2f3('0x37')]:_0x40cdc2[_0xa2f3('0x35')];if(_0x581879[_0xa2f3('0x31')][_0xa2f3('0x46')]){_0x151081[_0xa2f3('0x40')]=[{'all':!![]}];}_0x151081=_[_0xa2f3('0x3f')]({},_0x151081,_0x581879[_0xa2f3('0x47')]);return db[_0xa2f3('0x2e')][_0xa2f3('0x48')](_0x151081)[_0xa2f3('0x27')](handleEntityNotFound(_0x5e9b1a,null))[_0xa2f3('0x27')](respondWithResult(_0x5e9b1a,null))[_0xa2f3('0x43')](handleError(_0x5e9b1a,null));};exports[_0xa2f3('0x49')]=function(_0x558896,_0x1d673b){return db[_0xa2f3('0x2e')][_0xa2f3('0x49')](_0x558896[_0xa2f3('0x4a')],{})[_0xa2f3('0x27')](respondWithResult(_0x1d673b,0xc9))[_0xa2f3('0x43')](handleError(_0x1d673b,null));};exports['update']=function(_0x14792b,_0x2a0ed3){if(_0x14792b[_0xa2f3('0x4a')]['id']){delete _0x14792b[_0xa2f3('0x4a')]['id'];}return db[_0xa2f3('0x2e')]['find']({'where':{'id':_0x14792b[_0xa2f3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a0ed3,null))['then'](saveUpdates(_0x14792b['body'],null))[_0xa2f3('0x27')](respondWithResult(_0x2a0ed3,null))['catch'](handleError(_0x2a0ed3,null));};exports[_0xa2f3('0x26')]=function(_0x9bd2d0,_0x1fa4d2){return db[_0xa2f3('0x2e')][_0xa2f3('0x48')]({'where':{'id':_0x9bd2d0['params']['id']}})[_0xa2f3('0x27')](handleEntityNotFound(_0x1fa4d2,null))[_0xa2f3('0x27')](removeEntity(_0x1fa4d2,null))['catch'](handleError(_0x1fa4d2,null));};
\ No newline at end of file
+var _0xcd29=['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','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0xa98bf9,_0x6c44fa){var _0xef2d77=function(_0xa6c6c9){while(--_0xa6c6c9){_0xa98bf9['push'](_0xa98bf9['shift']());}};_0xef2d77(++_0x6c44fa);}(_0xcd29,0x137));var _0x9cd2=function(_0x4431a1,_0x4b8792){_0x4431a1=_0x4431a1-0x0;var _0x41171b=_0xcd29[_0x4431a1];return _0x41171b;};'use strict';var emlformat=require(_0x9cd2('0x0'));var rimraf=require(_0x9cd2('0x1'));var zipdir=require(_0x9cd2('0x2'));var jsonpatch=require(_0x9cd2('0x3'));var rp=require(_0x9cd2('0x4'));var moment=require('moment');var BPromise=require(_0x9cd2('0x5'));var Mustache=require(_0x9cd2('0x6'));var util=require('util');var path=require(_0x9cd2('0x7'));var sox=require(_0x9cd2('0x8'));var csv=require(_0x9cd2('0x9'));var ejs=require(_0x9cd2('0xa'));var fs=require('fs');var fs_extra=require(_0x9cd2('0xb'));var _=require(_0x9cd2('0xc'));var squel=require(_0x9cd2('0xd'));var crypto=require(_0x9cd2('0xe'));var jsforce=require(_0x9cd2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9cd2('0x9'));var querystring=require(_0x9cd2('0x10'));var Papa=require(_0x9cd2('0x11'));var Redis=require(_0x9cd2('0x12'));var authService=require(_0x9cd2('0x13'));var qs=require(_0x9cd2('0x14'));var as=require(_0x9cd2('0x15'));var hardwareService=require(_0x9cd2('0x16'));var logger=require(_0x9cd2('0x17'))(_0x9cd2('0x18'));var utils=require(_0x9cd2('0x19'));var config=require(_0x9cd2('0x1a'));var licenseUtil=require(_0x9cd2('0x1b'));var db=require(_0x9cd2('0x1c'))['db'];function respondWithStatusCode(_0x100ae6,_0x4a1ddc){_0x4a1ddc=_0x4a1ddc||0xcc;return function(_0x5a99df){if(_0x5a99df){return _0x100ae6[_0x9cd2('0x1d')](_0x4a1ddc);}return _0x100ae6[_0x9cd2('0x1e')](_0x4a1ddc)[_0x9cd2('0x1f')]();};}function respondWithResult(_0x48c2b1,_0x30c8c9){_0x30c8c9=_0x30c8c9||0xc8;return function(_0x4f62bf){if(_0x4f62bf){return _0x48c2b1[_0x9cd2('0x1e')](_0x30c8c9)[_0x9cd2('0x20')](_0x4f62bf);}};}function respondWithFilteredResult(_0x131ee3,_0x30c248){return function(_0xedcf3d){if(_0xedcf3d){var _0x196498=typeof _0x30c248[_0x9cd2('0x21')]==='undefined'&&typeof _0x30c248[_0x9cd2('0x22')]===_0x9cd2('0x23');var _0x5f5dbb=_0xedcf3d[_0x9cd2('0x24')];var _0x4b2063=_0x196498?0x0:_0x30c248['offset'];var _0x2de0b8=_0x196498?_0xedcf3d[_0x9cd2('0x24')]:_0x30c248[_0x9cd2('0x21')]+_0x30c248[_0x9cd2('0x22')];var _0x4044a2;if(_0x2de0b8>=_0x5f5dbb){_0x2de0b8=_0x5f5dbb;_0x4044a2=0xc8;}else{_0x4044a2=0xce;}_0x131ee3[_0x9cd2('0x1e')](_0x4044a2);return _0x131ee3[_0x9cd2('0x25')](_0x9cd2('0x26'),_0x4b2063+'-'+_0x2de0b8+'/'+_0x5f5dbb)[_0x9cd2('0x20')](_0xedcf3d);}return null;};}function patchUpdates(_0x3fb01c){return function(_0x404e7c){try{jsonpatch[_0x9cd2('0x27')](_0x404e7c,_0x3fb01c,!![]);}catch(_0x41a84f){return BPromise[_0x9cd2('0x28')](_0x41a84f);}return _0x404e7c[_0x9cd2('0x29')]();};}function saveUpdates(_0x43568e,_0x60258d){return function(_0x3039d9){if(_0x3039d9){return _0x3039d9[_0x9cd2('0x2a')](_0x43568e)[_0x9cd2('0x2b')](function(_0x4a3f9a){return _0x4a3f9a;});}return null;};}function removeEntity(_0x59ff0d,_0x3e0796){return function(_0x51b9e3){if(_0x51b9e3){return _0x51b9e3['destroy']()[_0x9cd2('0x2b')](function(){_0x59ff0d[_0x9cd2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b4f1,_0x597fb9){return function(_0x5043f1){if(!_0x5043f1){_0x11b4f1[_0x9cd2('0x1d')](0x194);}return _0x5043f1;};}function handleError(_0x5df9ff,_0x2acce1){_0x2acce1=_0x2acce1||0x1f4;return function(_0x4e4a3e){logger['error'](_0x4e4a3e[_0x9cd2('0x2c')]);if(_0x4e4a3e[_0x9cd2('0x2d')]){delete _0x4e4a3e[_0x9cd2('0x2d')];}_0x5df9ff['status'](_0x2acce1)['send'](_0x4e4a3e);};}exports[_0x9cd2('0x2e')]=function(_0x26304d,_0x33cf03){var _0x5f4b1e={},_0x43d88e={},_0x577c40={'count':0x0,'rows':[]};var _0x4b250b=_[_0x9cd2('0x2f')](db['AnalyticTreeReport'][_0x9cd2('0x30')],function(_0x16a54b){return{'name':_0x16a54b[_0x9cd2('0x31')],'type':_0x16a54b[_0x9cd2('0x32')][_0x9cd2('0x33')]};});_0x43d88e[_0x9cd2('0x34')]=_[_0x9cd2('0x2f')](_0x4b250b,_0x9cd2('0x2d'));_0x43d88e[_0x9cd2('0x35')]=_[_0x9cd2('0x36')](_0x26304d[_0x9cd2('0x35')]);_0x43d88e['filters']=_[_0x9cd2('0x37')](_0x43d88e[_0x9cd2('0x34')],_0x43d88e[_0x9cd2('0x35')]);_0x5f4b1e[_0x9cd2('0x38')]=_[_0x9cd2('0x37')](_0x43d88e[_0x9cd2('0x34')],qs['fields'](_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x39')]));_0x5f4b1e[_0x9cd2('0x38')]=_0x5f4b1e[_0x9cd2('0x38')][_0x9cd2('0x3a')]?_0x5f4b1e[_0x9cd2('0x38')]:_0x43d88e['model'];if(!_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x3b')](_0x9cd2('0x3c'))){_0x5f4b1e[_0x9cd2('0x22')]=qs[_0x9cd2('0x22')](_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x22')]);_0x5f4b1e[_0x9cd2('0x21')]=qs['offset'](_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x21')]);}_0x5f4b1e[_0x9cd2('0x3d')]=qs[_0x9cd2('0x3e')](_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x3e')]);_0x5f4b1e['where']=qs[_0x9cd2('0x3f')](_[_0x9cd2('0x40')](_0x26304d[_0x9cd2('0x35')],_0x43d88e[_0x9cd2('0x3f')]),_0x4b250b);if(_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x41')]){_0x5f4b1e[_0x9cd2('0x42')]=_[_0x9cd2('0x43')](_0x5f4b1e[_0x9cd2('0x42')],{'$or':_[_0x9cd2('0x2f')](_0x4b250b,function(_0x2cbc1c){if(_0x2cbc1c[_0x9cd2('0x32')]!==_0x9cd2('0x44')){var _0x38baa4={};_0x38baa4[_0x2cbc1c[_0x9cd2('0x2d')]]={'$like':'%'+_0x26304d['query'][_0x9cd2('0x41')]+'%'};return _0x38baa4;}})});}_0x5f4b1e=_[_0x9cd2('0x43')]({},_0x5f4b1e,_0x26304d['options']);var _0x40e21d={'where':_0x5f4b1e['where']};return db[_0x9cd2('0x45')][_0x9cd2('0x24')](_0x40e21d)[_0x9cd2('0x2b')](function(_0x46221d){_0x577c40[_0x9cd2('0x24')]=_0x46221d;if(_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x46')]){_0x5f4b1e['include']=[{'all':!![]}];}return db[_0x9cd2('0x45')][_0x9cd2('0x47')](_0x5f4b1e);})[_0x9cd2('0x2b')](function(_0x1debfb){_0x577c40[_0x9cd2('0x48')]=_0x1debfb;return _0x577c40;})['then'](respondWithFilteredResult(_0x33cf03,_0x5f4b1e))[_0x9cd2('0x49')](handleError(_0x33cf03,null));};exports[_0x9cd2('0x4a')]=function(_0x4b00ba,_0x5d0cc6){var _0x1b1265={'raw':!![],'where':{'id':_0x4b00ba[_0x9cd2('0x4b')]['id']}},_0x503560={};_0x503560[_0x9cd2('0x34')]=_[_0x9cd2('0x36')](db['AnalyticTreeReport']['rawAttributes']);_0x503560[_0x9cd2('0x35')]=_[_0x9cd2('0x36')](_0x4b00ba[_0x9cd2('0x35')]);_0x503560['filters']=_[_0x9cd2('0x37')](_0x503560[_0x9cd2('0x34')],_0x503560[_0x9cd2('0x35')]);_0x1b1265[_0x9cd2('0x38')]=_[_0x9cd2('0x37')](_0x503560[_0x9cd2('0x34')],qs[_0x9cd2('0x39')](_0x4b00ba[_0x9cd2('0x35')]['fields']));_0x1b1265[_0x9cd2('0x38')]=_0x1b1265[_0x9cd2('0x38')][_0x9cd2('0x3a')]?_0x1b1265[_0x9cd2('0x38')]:_0x503560['model'];if(_0x4b00ba['query'][_0x9cd2('0x46')]){_0x1b1265['include']=[{'all':!![]}];}_0x1b1265=_[_0x9cd2('0x43')]({},_0x1b1265,_0x4b00ba['options']);return db['AnalyticTreeReport'][_0x9cd2('0x4c')](_0x1b1265)[_0x9cd2('0x2b')](handleEntityNotFound(_0x5d0cc6,null))[_0x9cd2('0x2b')](respondWithResult(_0x5d0cc6,null))['catch'](handleError(_0x5d0cc6,null));};exports[_0x9cd2('0x4d')]=function(_0x572e17,_0x589f66){return db['AnalyticTreeReport'][_0x9cd2('0x4d')](_0x572e17[_0x9cd2('0x4e')],{})['then'](respondWithResult(_0x589f66,0xc9))[_0x9cd2('0x49')](handleError(_0x589f66,null));};exports[_0x9cd2('0x2a')]=function(_0x1caf33,_0x408a43){if(_0x1caf33[_0x9cd2('0x4e')]['id']){delete _0x1caf33['body']['id'];}return db[_0x9cd2('0x45')]['find']({'where':{'id':_0x1caf33[_0x9cd2('0x4b')]['id']}})[_0x9cd2('0x2b')](handleEntityNotFound(_0x408a43,null))['then'](saveUpdates(_0x1caf33['body'],null))[_0x9cd2('0x2b')](respondWithResult(_0x408a43,null))[_0x9cd2('0x49')](handleError(_0x408a43,null));};exports[_0x9cd2('0x4f')]=function(_0x546874,_0x327f41){return db[_0x9cd2('0x45')][_0x9cd2('0x4c')]({'where':{'id':_0x546874[_0x9cd2('0x4b')]['id']}})[_0x9cd2('0x2b')](handleEntityNotFound(_0x327f41,null))[_0x9cd2('0x2b')](removeEntity(_0x327f41,null))[_0x9cd2('0x49')](handleError(_0x327f41,null));};
\ No newline at end of file
index db6f1dc..9a364e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab3b=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports'];(function(_0x477cd3,_0x4eebf7){var _0x203d27=function(_0x8fe188){while(--_0x8fe188){_0x477cd3['push'](_0x477cd3['shift']());}};_0x203d27(++_0x4eebf7);}(_0xab3b,0x13b));var _0xbab3=function(_0x1cc706,_0x25eda7){_0x1cc706=_0x1cc706-0x0;var _0x25487f=_0xab3b[_0x1cc706];return _0x25487f;};'use strict';var _=require(_0xbab3('0x0'));var util=require(_0xbab3('0x1'));var logger=require(_0xbab3('0x2'))(_0xbab3('0x3'));var moment=require('moment');var BPromise=require(_0xbab3('0x4'));var rp=require(_0xbab3('0x5'));var fs=require('fs');var path=require(_0xbab3('0x6'));var rimraf=require(_0xbab3('0x7'));var config=require('../../config/environment');var attributes=require(_0xbab3('0x8'));module[_0xbab3('0x9')]=function(_0x4fd5df,_0x5748fc){return _0x4fd5df[_0xbab3('0xa')](_0xbab3('0xb'),attributes,{'tableName':_0xbab3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf999=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2935e2,_0x9a6d5e){var _0x500019=function(_0x17f84d){while(--_0x17f84d){_0x2935e2['push'](_0x2935e2['shift']());}};_0x500019(++_0x9a6d5e);}(_0xf999,0x1f3));var _0x9f99=function(_0xae05de,_0x518819){_0xae05de=_0xae05de-0x0;var _0xb859db=_0xf999[_0xae05de];return _0xb859db;};'use strict';var _=require(_0x9f99('0x0'));var util=require(_0x9f99('0x1'));var logger=require(_0x9f99('0x2'))(_0x9f99('0x3'));var moment=require(_0x9f99('0x4'));var BPromise=require(_0x9f99('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f99('0x6'));var rimraf=require(_0x9f99('0x7'));var config=require('../../config/environment');var attributes=require(_0x9f99('0x8'));module[_0x9f99('0x9')]=function(_0x7cfc19,_0x1c569a){return _0x7cfc19[_0x9f99('0xa')](_0x9f99('0xb'),attributes,{'tableName':_0x9f99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d7dfb47..6967587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x221619,_0x28f3dd){_0x221619=_0x221619-0x0;var _0x39f32e=_0x7a54[_0x221619];return _0x39f32e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3d7486,_0x5529e5){var _0x54e078=function(_0x57dd9c){while(--_0x57dd9c){_0x3d7486['push'](_0x3d7486['shift']());}};_0x54e078(++_0x5529e5);}(_0x2ef3,0xba));var _0x32ef=function(_0x25f24f,_0x476d60){_0x25f24f=_0x25f24f-0x0;var _0x19b3f0=_0x2ef3[_0x25f24f];return _0x19b3f0;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
index 51883b5..dfae117 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x426a=['show','put','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index','get','/:id'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x426a,0x16c));var _0xa426=function(_0x3fda2c,_0x368d13){_0x3fda2c=_0x3fda2c-0x0;var _0x21b592=_0x426a[_0x3fda2c];return _0x21b592;};'use strict';var multer=require(_0xa426('0x0'));var util=require(_0xa426('0x1'));var path=require('path');var timeout=require(_0xa426('0x2'));var express=require(_0xa426('0x3'));var router=express['Router']();var fs_extra=require(_0xa426('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa426('0x5'));var config=require('../../config/environment');var controller=require(_0xa426('0x6'));router['get']('/',auth[_0xa426('0x7')](),controller[_0xa426('0x8')]);router[_0xa426('0x9')](_0xa426('0xa'),auth[_0xa426('0x7')](),controller[_0xa426('0xb')]);router['post']('/',auth[_0xa426('0x7')](),controller['create']);router[_0xa426('0xc')]('/:id',auth[_0xa426('0x7')](),controller[_0xa426('0xd')]);router['delete'](_0xa426('0xa'),auth[_0xa426('0x7')](),controller[_0xa426('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xed65=['express','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','path','connect-timeout'];(function(_0x2c944e,_0x26f659){var _0x2cc529=function(_0x3fbc4b){while(--_0x3fbc4b){_0x2c944e['push'](_0x2c944e['shift']());}};_0x2cc529(++_0x26f659);}(_0xed65,0xfd));var _0x5ed6=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xed65[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5ed6('0x0'));var timeout=require(_0x5ed6('0x1'));var express=require(_0x5ed6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5ed6('0x3'));var interaction=require(_0x5ed6('0x4'));var config=require('../../config/environment');var controller=require(_0x5ed6('0x5'));router[_0x5ed6('0x6')]('/',auth[_0x5ed6('0x7')](),controller[_0x5ed6('0x8')]);router[_0x5ed6('0x6')]('/:id',auth[_0x5ed6('0x7')](),controller[_0x5ed6('0x9')]);router[_0x5ed6('0xa')]('/',auth[_0x5ed6('0x7')](),controller[_0x5ed6('0xb')]);router[_0x5ed6('0xc')](_0x5ed6('0xd'),auth[_0x5ed6('0x7')](),controller['update']);router[_0x5ed6('0xe')](_0x5ed6('0xd'),auth[_0x5ed6('0x7')](),controller[_0x5ed6('0xf')]);module[_0x5ed6('0x10')]=router;
\ No newline at end of file
index 9c9dc16..ce95b89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2ef=['exports','STRING','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x297bb8,_0x105d42){_0x297bb8=_0x297bb8-0x0;var _0x1698b3=_0xb2ef[_0x297bb8];return _0x1698b3;};'use strict';var Sequelize=require(_0xfb2e('0x0'));module[_0xfb2e('0x1')]={'name':{'type':Sequelize[_0xfb2e('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfb2e('0x2')]}};
\ No newline at end of file
+var _0xb7a8=['exports','STRING'];(function(_0x4d3d46,_0x35282a){var _0x4b76d4=function(_0x1ca16d){while(--_0x1ca16d){_0x4d3d46['push'](_0x4d3d46['shift']());}};_0x4b76d4(++_0x35282a);}(_0xb7a8,0xec));var _0x8b7a=function(_0x54bbc4,_0x265a5b){_0x54bbc4=_0x54bbc4-0x0;var _0x478cfc=_0xb7a8[_0x54bbc4];return _0x478cfc;};'use strict';var Sequelize=require('sequelize');module[_0x8b7a('0x0')]={'name':{'type':Sequelize[_0x8b7a('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8b7a('0x1')]}};
\ No newline at end of file
index 80bb62e..2fea545 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5184=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','catch','show','includeAll','options','find','clone','params','get','updatedAt','body','omit','createdAt','create','file','originalname','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x5184,0x1ab));var _0x4518=function(_0x4f743c,_0x347fcf){_0x4f743c=_0x4f743c-0x0;var _0x6503b8=_0x5184[_0x4f743c];return _0x6503b8;};'use strict';var emlformat=require(_0x4518('0x0'));var rimraf=require(_0x4518('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4518('0x2'));var rp=require(_0x4518('0x3'));var moment=require(_0x4518('0x4'));var BPromise=require(_0x4518('0x5'));var Mustache=require(_0x4518('0x6'));var util=require(_0x4518('0x7'));var path=require(_0x4518('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4518('0x9'));var fs=require('fs');var fs_extra=require(_0x4518('0xa'));var _=require(_0x4518('0xb'));var squel=require(_0x4518('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4518('0xd'));var querystring=require(_0x4518('0xe'));var Papa=require(_0x4518('0xf'));var Redis=require(_0x4518('0x10'));var authService=require(_0x4518('0x11'));var qs=require(_0x4518('0x12'));var as=require(_0x4518('0x13'));var hardwareService=require(_0x4518('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4518('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4518('0x16'))['db'];function respondWithStatusCode(_0x3b45ef,_0xebbb8f){_0xebbb8f=_0xebbb8f||0xcc;return function(_0x31418f){if(_0x31418f){return _0x3b45ef[_0x4518('0x17')](_0xebbb8f);}return _0x3b45ef[_0x4518('0x18')](_0xebbb8f)[_0x4518('0x19')]();};}function respondWithResult(_0xee70a2,_0x34fe9c){_0x34fe9c=_0x34fe9c||0xc8;return function(_0x234365){if(_0x234365){return _0xee70a2[_0x4518('0x18')](_0x34fe9c)[_0x4518('0x1a')](_0x234365);}};}function respondWithFilteredResult(_0x4755a3,_0x5151af){return function(_0x155027){if(_0x155027){var _0x25fe5d=typeof _0x5151af[_0x4518('0x1b')]==='undefined'&&typeof _0x5151af[_0x4518('0x1c')]==='undefined';var _0x448665=_0x155027[_0x4518('0x1d')];var _0x3f3caf=_0x25fe5d?0x0:_0x5151af[_0x4518('0x1b')];var _0x3188d7=_0x25fe5d?_0x155027[_0x4518('0x1d')]:_0x5151af[_0x4518('0x1b')]+_0x5151af[_0x4518('0x1c')];var _0x1b3325;if(_0x3188d7>=_0x448665){_0x3188d7=_0x448665;_0x1b3325=0xc8;}else{_0x1b3325=0xce;}_0x4755a3['status'](_0x1b3325);return _0x4755a3['set'](_0x4518('0x1e'),_0x3f3caf+'-'+_0x3188d7+'/'+_0x448665)[_0x4518('0x1a')](_0x155027);}return null;};}function patchUpdates(_0x59ac10){return function(_0x16b6a6){try{jsonpatch[_0x4518('0x1f')](_0x16b6a6,_0x59ac10,!![]);}catch(_0x58da12){return BPromise[_0x4518('0x20')](_0x58da12);}return _0x16b6a6[_0x4518('0x21')]();};}function saveUpdates(_0x58bd9a,_0x367fb4){return function(_0x5dedf0){if(_0x5dedf0){return _0x5dedf0[_0x4518('0x22')](_0x58bd9a)[_0x4518('0x23')](function(_0x3f0ccc){return _0x3f0ccc;});}return null;};}function removeEntity(_0x2f18c2,_0x14d190){return function(_0x17b9fb){if(_0x17b9fb){return _0x17b9fb[_0x4518('0x24')]()[_0x4518('0x23')](function(){_0x2f18c2['status'](0xcc)[_0x4518('0x19')]();});}};}function handleEntityNotFound(_0x21079f,_0x5ed625){return function(_0x15ac99){if(!_0x15ac99){_0x21079f['sendStatus'](0x194);}return _0x15ac99;};}function handleError(_0x481a3a,_0x532891){_0x532891=_0x532891||0x1f4;return function(_0x427005){logger[_0x4518('0x25')](_0x427005[_0x4518('0x26')]);if(_0x427005[_0x4518('0x27')]){delete _0x427005['name'];}_0x481a3a['status'](_0x532891)[_0x4518('0x28')](_0x427005);};}exports[_0x4518('0x29')]=function(_0x569f53,_0x48934e){var _0x2bdfed={},_0x10f443={},_0x1999ba={'count':0x0,'rows':[]};var _0x307c1a=_[_0x4518('0x2a')](db[_0x4518('0x2b')][_0x4518('0x2c')],function(_0x488f64){return{'name':_0x488f64['fieldName'],'type':_0x488f64['type'][_0x4518('0x2d')]};});_0x10f443[_0x4518('0x2e')]=_[_0x4518('0x2a')](_0x307c1a,_0x4518('0x27'));_0x10f443[_0x4518('0x2f')]=_[_0x4518('0x30')](_0x569f53[_0x4518('0x2f')]);_0x10f443[_0x4518('0x31')]=_[_0x4518('0x32')](_0x10f443[_0x4518('0x2e')],_0x10f443['query']);_0x2bdfed[_0x4518('0x33')]=_[_0x4518('0x32')](_0x10f443['model'],qs['fields'](_0x569f53['query'][_0x4518('0x34')]));_0x2bdfed[_0x4518('0x33')]=_0x2bdfed['attributes'][_0x4518('0x35')]?_0x2bdfed[_0x4518('0x33')]:_0x10f443['model'];if(!_0x569f53[_0x4518('0x2f')][_0x4518('0x36')](_0x4518('0x37'))){_0x2bdfed['limit']=qs[_0x4518('0x1c')](_0x569f53['query'][_0x4518('0x1c')]);_0x2bdfed[_0x4518('0x1b')]=qs[_0x4518('0x1b')](_0x569f53[_0x4518('0x2f')][_0x4518('0x1b')]);}_0x2bdfed[_0x4518('0x38')]=qs[_0x4518('0x39')](_0x569f53[_0x4518('0x2f')][_0x4518('0x39')]);_0x2bdfed[_0x4518('0x3a')]=qs['filters'](_['pick'](_0x569f53[_0x4518('0x2f')],_0x10f443[_0x4518('0x31')]),_0x307c1a);if(_0x569f53[_0x4518('0x2f')][_0x4518('0x3b')]){_0x2bdfed[_0x4518('0x3a')]=_[_0x4518('0x3c')](_0x2bdfed[_0x4518('0x3a')],{'$or':_['map'](_0x307c1a,function(_0x1d5ffb){if(_0x1d5ffb[_0x4518('0x3d')]!==_0x4518('0x3e')){var _0x4e72a2={};_0x4e72a2[_0x1d5ffb[_0x4518('0x27')]]={'$like':'%'+_0x569f53['query'][_0x4518('0x3b')]+'%'};return _0x4e72a2;}})});}_0x2bdfed=_[_0x4518('0x3c')]({},_0x2bdfed,_0x569f53['options']);var _0x512199={'where':_0x2bdfed[_0x4518('0x3a')]};return db[_0x4518('0x2b')][_0x4518('0x1d')](_0x512199)['then'](function(_0x2fe40d){_0x1999ba['count']=_0x2fe40d;if(_0x569f53[_0x4518('0x2f')]['includeAll']){_0x2bdfed[_0x4518('0x3f')]=[{'all':!![]}];}return db[_0x4518('0x2b')][_0x4518('0x40')](_0x2bdfed);})[_0x4518('0x23')](function(_0x4759b3){_0x1999ba['rows']=_0x4759b3;return _0x1999ba;})[_0x4518('0x23')](respondWithFilteredResult(_0x48934e,_0x2bdfed))[_0x4518('0x41')](handleError(_0x48934e,null));};exports[_0x4518('0x42')]=function(_0x2eb325,_0x2c8bc8){var _0x1f506a={'raw':!![],'where':{'id':_0x2eb325['params']['id']}},_0x2eeac0={};_0x2eeac0[_0x4518('0x2e')]=_[_0x4518('0x30')](db[_0x4518('0x2b')][_0x4518('0x2c')]);_0x2eeac0[_0x4518('0x2f')]=_[_0x4518('0x30')](_0x2eb325[_0x4518('0x2f')]);_0x2eeac0[_0x4518('0x31')]=_[_0x4518('0x32')](_0x2eeac0[_0x4518('0x2e')],_0x2eeac0['query']);_0x1f506a['attributes']=_[_0x4518('0x32')](_0x2eeac0[_0x4518('0x2e')],qs[_0x4518('0x34')](_0x2eb325['query'][_0x4518('0x34')]));_0x1f506a[_0x4518('0x33')]=_0x1f506a[_0x4518('0x33')]['length']?_0x1f506a[_0x4518('0x33')]:_0x2eeac0[_0x4518('0x2e')];if(_0x2eb325[_0x4518('0x2f')][_0x4518('0x43')]){_0x1f506a[_0x4518('0x3f')]=[{'all':!![]}];}_0x1f506a=_[_0x4518('0x3c')]({},_0x1f506a,_0x2eb325[_0x4518('0x44')]);return db[_0x4518('0x2b')][_0x4518('0x45')](_0x1f506a)[_0x4518('0x23')](handleEntityNotFound(_0x2c8bc8,null))['then'](respondWithResult(_0x2c8bc8,null))[_0x4518('0x41')](handleError(_0x2c8bc8,null));};exports[_0x4518('0x46')]=function(_0x1f2460,_0x5d38f0){var _0x38a23d={'where':{'id':_0x1f2460[_0x4518('0x47')]['id']}},_0x10e0ac={};_0x10e0ac[_0x4518('0x2e')]=_[_0x4518('0x30')](db[_0x4518('0x2b')][_0x4518('0x2c')]);_0x38a23d[_0x4518('0x33')]=_['intersection'](_0x10e0ac[_0x4518('0x2e')],qs[_0x4518('0x34')](_0x1f2460[_0x4518('0x2f')][_0x4518('0x34')]));_0x38a23d[_0x4518('0x33')]=_0x38a23d[_0x4518('0x33')][_0x4518('0x35')]?_0x38a23d[_0x4518('0x33')]:_0x10e0ac[_0x4518('0x2e')];if(_0x1f2460[_0x4518('0x2f')][_0x4518('0x43')]){_0x38a23d[_0x4518('0x3f')]=[{'all':!![]}];}_0x38a23d=_[_0x4518('0x3c')]({},_0x38a23d,_0x1f2460[_0x4518('0x44')]);return db[_0x4518('0x2b')][_0x4518('0x45')](_0x38a23d)['then'](handleEntityNotFound(_0x5d38f0,null))[_0x4518('0x23')](function(_0x98e397){if(_0x98e397){var _0x50cce1=_0x98e397[_0x4518('0x48')]({'plain':!![]});_0x50cce1=qs['omit'](_0x50cce1,['id','createdAt',_0x4518('0x49')]);_0x1f2460[_0x4518('0x4a')]=_[_0x4518('0x4b')](_0x1f2460[_0x4518('0x4a')],['id',_0x4518('0x4c'),_0x4518('0x49')]);return db[_0x4518('0x2b')][_0x4518('0x4d')](_[_0x4518('0x3c')](_0x50cce1,_0x1f2460[_0x4518('0x4a')]),{'include':_0x1f2460[_0x4518('0x2f')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x4518('0x23')](respondWithResult(_0x5d38f0,0xc9))['catch'](handleError(_0x5d38f0,null));};exports[_0x4518('0x22')]=function(_0x1be00b,_0x16dc57){if(_0x1be00b[_0x4518('0x4a')]['id']){delete _0x1be00b[_0x4518('0x4a')]['id'];}return db[_0x4518('0x2b')][_0x4518('0x45')]({'where':{'id':_0x1be00b[_0x4518('0x47')]['id']}})['then'](handleEntityNotFound(_0x16dc57,null))[_0x4518('0x23')](saveUpdates(_0x1be00b[_0x4518('0x4a')],null))[_0x4518('0x23')](respondWithResult(_0x16dc57,null))[_0x4518('0x41')](handleError(_0x16dc57,null));};exports[_0x4518('0x24')]=function(_0x229860,_0x458989){return db[_0x4518('0x2b')][_0x4518('0x45')]({'where':{'id':_0x229860[_0x4518('0x47')]['id']}})[_0x4518('0x23')](handleEntityNotFound(_0x458989,null))[_0x4518('0x23')](removeEntity(_0x458989,null))[_0x4518('0x41')](handleError(_0x458989,null));};exports[_0x4518('0x4d')]=function(_0x28dad4,_0x556a5b,_0x138f05){_0x28dad4[_0x4518('0x4a')][_0x4518('0x27')]=_0x28dad4[_0x4518('0x4e')][_0x4518('0x4f')];_0x28dad4['body']['basename']=_0x28dad4[_0x4518('0x4e')]['filename'];_0x28dad4[_0x4518('0x4a')][_0x4518('0x3d')]=_0x28dad4[_0x4518('0x4e')][_0x4518('0x50')];return db[_0x4518('0x2b')][_0x4518('0x4d')](_0x28dad4[_0x4518('0x4a')])[_0x4518('0x23')](respondWithResult(_0x556a5b,0xc9))[_0x4518('0x41')](handleError(_0x556a5b,null));};exports[_0x4518('0x51')]=function(_0x15669d,_0x36554d,_0x2d2386){return db[_0x4518('0x2b')][_0x4518('0x52')]({'where':{'id':_0x15669d[_0x4518('0x47')]['id']},'raw':!![]})[_0x4518('0x23')](handleEntityNotFound(_0x36554d,null))['then'](function(_0x3bba37){if(_0x3bba37){var _0x29bdd5=_0x3bba37[_0x4518('0x53')]!==null;var _0xf884fc=path[_0x4518('0x54')](config[_0x4518('0x55')],_0x4518('0x56'));if(_0x29bdd5){_0xf884fc=path[_0x4518('0x54')](_0xf884fc,_0x4518('0x57'));}var _0x4adfae=path[_0x4518('0x54')](_0xf884fc,_0x3bba37['basename']);return _0x36554d['download'](_0x4adfae);}})['catch'](handleError(_0x36554d,null));};
\ No newline at end of file
+var _0x58e5=['Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','length','find','catch','clone','includeAll','get','createdAt','updatedAt','body','create','destroy','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','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','json','offset','undefined','limit','count','set'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x58e5,0x14a));var _0x558e=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x58e5[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require(_0x558e('0x0'));var rimraf=require(_0x558e('0x1'));var zipdir=require(_0x558e('0x2'));var jsonpatch=require(_0x558e('0x3'));var rp=require(_0x558e('0x4'));var moment=require('moment');var BPromise=require(_0x558e('0x5'));var Mustache=require(_0x558e('0x6'));var util=require(_0x558e('0x7'));var path=require('path');var sox=require(_0x558e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x558e('0x9'));var _=require(_0x558e('0xa'));var squel=require(_0x558e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x558e('0xc'));var toCsv=require(_0x558e('0xd'));var querystring=require(_0x558e('0xe'));var Papa=require(_0x558e('0xf'));var Redis=require(_0x558e('0x10'));var authService=require(_0x558e('0x11'));var qs=require(_0x558e('0x12'));var as=require(_0x558e('0x13'));var hardwareService=require(_0x558e('0x14'));var logger=require(_0x558e('0x15'))('api');var utils=require(_0x558e('0x16'));var config=require(_0x558e('0x17'));var licenseUtil=require(_0x558e('0x18'));var db=require(_0x558e('0x19'))['db'];function respondWithStatusCode(_0x3d8641,_0x20e13b){_0x20e13b=_0x20e13b||0xcc;return function(_0x9fe660){if(_0x9fe660){return _0x3d8641[_0x558e('0x1a')](_0x20e13b);}return _0x3d8641[_0x558e('0x1b')](_0x20e13b)['end']();};}function respondWithResult(_0xe98954,_0x193916){_0x193916=_0x193916||0xc8;return function(_0x448770){if(_0x448770){return _0xe98954[_0x558e('0x1b')](_0x193916)[_0x558e('0x1c')](_0x448770);}};}function respondWithFilteredResult(_0x4b9772,_0x11dc66){return function(_0x469cfa){if(_0x469cfa){var _0x45bbbb=typeof _0x11dc66[_0x558e('0x1d')]===_0x558e('0x1e')&&typeof _0x11dc66[_0x558e('0x1f')]==='undefined';var _0x10295e=_0x469cfa[_0x558e('0x20')];var _0x359658=_0x45bbbb?0x0:_0x11dc66['offset'];var _0x39072b=_0x45bbbb?_0x469cfa[_0x558e('0x20')]:_0x11dc66[_0x558e('0x1d')]+_0x11dc66['limit'];var _0x451f26;if(_0x39072b>=_0x10295e){_0x39072b=_0x10295e;_0x451f26=0xc8;}else{_0x451f26=0xce;}_0x4b9772[_0x558e('0x1b')](_0x451f26);return _0x4b9772[_0x558e('0x21')](_0x558e('0x22'),_0x359658+'-'+_0x39072b+'/'+_0x10295e)['json'](_0x469cfa);}return null;};}function patchUpdates(_0x577513){return function(_0x37bc36){try{jsonpatch[_0x558e('0x23')](_0x37bc36,_0x577513,!![]);}catch(_0x11357a){return BPromise[_0x558e('0x24')](_0x11357a);}return _0x37bc36[_0x558e('0x25')]();};}function saveUpdates(_0x48dc6,_0x2fdca3){return function(_0x2d998b){if(_0x2d998b){return _0x2d998b[_0x558e('0x26')](_0x48dc6)[_0x558e('0x27')](function(_0xc22a98){return _0xc22a98;});}return null;};}function removeEntity(_0x158200,_0x4979f9){return function(_0x3d7f5f){if(_0x3d7f5f){return _0x3d7f5f['destroy']()[_0x558e('0x27')](function(){_0x158200[_0x558e('0x1b')](0xcc)[_0x558e('0x28')]();});}};}function handleEntityNotFound(_0x485315,_0x4aa377){return function(_0x4d8559){if(!_0x4d8559){_0x485315[_0x558e('0x1a')](0x194);}return _0x4d8559;};}function handleError(_0x514146,_0xc915aa){_0xc915aa=_0xc915aa||0x1f4;return function(_0x38c574){logger[_0x558e('0x29')](_0x38c574[_0x558e('0x2a')]);if(_0x38c574[_0x558e('0x2b')]){delete _0x38c574[_0x558e('0x2b')];}_0x514146[_0x558e('0x1b')](_0xc915aa)[_0x558e('0x2c')](_0x38c574);};}exports[_0x558e('0x2d')]=function(_0x26e30e,_0x581dfd){var _0x2f69ff={},_0x5d7c68={},_0x2d3951={'count':0x0,'rows':[]};var _0x485250=_[_0x558e('0x2e')](db[_0x558e('0x2f')][_0x558e('0x30')],function(_0x2a4dca){return{'name':_0x2a4dca[_0x558e('0x31')],'type':_0x2a4dca[_0x558e('0x32')][_0x558e('0x33')]};});_0x5d7c68[_0x558e('0x34')]=_[_0x558e('0x2e')](_0x485250,_0x558e('0x2b'));_0x5d7c68[_0x558e('0x35')]=_[_0x558e('0x36')](_0x26e30e['query']);_0x5d7c68[_0x558e('0x37')]=_[_0x558e('0x38')](_0x5d7c68['model'],_0x5d7c68[_0x558e('0x35')]);_0x2f69ff[_0x558e('0x39')]=_[_0x558e('0x38')](_0x5d7c68[_0x558e('0x34')],qs[_0x558e('0x3a')](_0x26e30e['query'][_0x558e('0x3a')]));_0x2f69ff[_0x558e('0x39')]=_0x2f69ff[_0x558e('0x39')]['length']?_0x2f69ff[_0x558e('0x39')]:_0x5d7c68[_0x558e('0x34')];if(!_0x26e30e[_0x558e('0x35')]['hasOwnProperty']('nolimit')){_0x2f69ff[_0x558e('0x1f')]=qs[_0x558e('0x1f')](_0x26e30e['query'][_0x558e('0x1f')]);_0x2f69ff[_0x558e('0x1d')]=qs['offset'](_0x26e30e['query'][_0x558e('0x1d')]);}_0x2f69ff[_0x558e('0x3b')]=qs[_0x558e('0x3c')](_0x26e30e[_0x558e('0x35')][_0x558e('0x3c')]);_0x2f69ff['where']=qs[_0x558e('0x37')](_['pick'](_0x26e30e[_0x558e('0x35')],_0x5d7c68['filters']),_0x485250);if(_0x26e30e[_0x558e('0x35')][_0x558e('0x3d')]){_0x2f69ff[_0x558e('0x3e')]=_[_0x558e('0x3f')](_0x2f69ff[_0x558e('0x3e')],{'$or':_[_0x558e('0x2e')](_0x485250,function(_0x3e2135){if(_0x3e2135[_0x558e('0x32')]!==_0x558e('0x40')){var _0x45f4a0={};_0x45f4a0[_0x3e2135[_0x558e('0x2b')]]={'$like':'%'+_0x26e30e[_0x558e('0x35')][_0x558e('0x3d')]+'%'};return _0x45f4a0;}})});}_0x2f69ff=_[_0x558e('0x3f')]({},_0x2f69ff,_0x26e30e[_0x558e('0x41')]);var _0x3d9408={'where':_0x2f69ff[_0x558e('0x3e')]};return db[_0x558e('0x2f')]['count'](_0x3d9408)[_0x558e('0x27')](function(_0x2adcc1){_0x2d3951[_0x558e('0x20')]=_0x2adcc1;if(_0x26e30e['query']['includeAll']){_0x2f69ff[_0x558e('0x42')]=[{'all':!![]}];}return db[_0x558e('0x2f')][_0x558e('0x43')](_0x2f69ff);})[_0x558e('0x27')](function(_0x5a9e4c){_0x2d3951[_0x558e('0x44')]=_0x5a9e4c;return _0x2d3951;})['then'](respondWithFilteredResult(_0x581dfd,_0x2f69ff))['catch'](handleError(_0x581dfd,null));};exports['show']=function(_0x3cb938,_0xad148d){var _0xa10ea7={'raw':!![],'where':{'id':_0x3cb938[_0x558e('0x45')]['id']}},_0x516599={};_0x516599['model']=_[_0x558e('0x36')](db[_0x558e('0x2f')][_0x558e('0x30')]);_0x516599['query']=_[_0x558e('0x36')](_0x3cb938[_0x558e('0x35')]);_0x516599[_0x558e('0x37')]=_[_0x558e('0x38')](_0x516599[_0x558e('0x34')],_0x516599['query']);_0xa10ea7[_0x558e('0x39')]=_['intersection'](_0x516599['model'],qs['fields'](_0x3cb938[_0x558e('0x35')][_0x558e('0x3a')]));_0xa10ea7['attributes']=_0xa10ea7['attributes'][_0x558e('0x46')]?_0xa10ea7[_0x558e('0x39')]:_0x516599[_0x558e('0x34')];if(_0x3cb938[_0x558e('0x35')]['includeAll']){_0xa10ea7[_0x558e('0x42')]=[{'all':!![]}];}_0xa10ea7=_['merge']({},_0xa10ea7,_0x3cb938[_0x558e('0x41')]);return db[_0x558e('0x2f')][_0x558e('0x47')](_0xa10ea7)[_0x558e('0x27')](handleEntityNotFound(_0xad148d,null))[_0x558e('0x27')](respondWithResult(_0xad148d,null))[_0x558e('0x48')](handleError(_0xad148d,null));};exports[_0x558e('0x49')]=function(_0x2b0738,_0x404a53){var _0x5a1acd={'where':{'id':_0x2b0738[_0x558e('0x45')]['id']}},_0x5daee6={};_0x5daee6[_0x558e('0x34')]=_[_0x558e('0x36')](db[_0x558e('0x2f')][_0x558e('0x30')]);_0x5a1acd[_0x558e('0x39')]=_[_0x558e('0x38')](_0x5daee6[_0x558e('0x34')],qs[_0x558e('0x3a')](_0x2b0738['query']['fields']));_0x5a1acd['attributes']=_0x5a1acd['attributes'][_0x558e('0x46')]?_0x5a1acd['attributes']:_0x5daee6[_0x558e('0x34')];if(_0x2b0738[_0x558e('0x35')][_0x558e('0x4a')]){_0x5a1acd[_0x558e('0x42')]=[{'all':!![]}];}_0x5a1acd=_[_0x558e('0x3f')]({},_0x5a1acd,_0x2b0738[_0x558e('0x41')]);return db[_0x558e('0x2f')][_0x558e('0x47')](_0x5a1acd)['then'](handleEntityNotFound(_0x404a53,null))[_0x558e('0x27')](function(_0x4685a0){if(_0x4685a0){var _0x493cde=_0x4685a0[_0x558e('0x4b')]({'plain':!![]});_0x493cde=qs['omit'](_0x493cde,['id',_0x558e('0x4c'),_0x558e('0x4d')]);_0x2b0738['body']=_['omit'](_0x2b0738[_0x558e('0x4e')],['id',_0x558e('0x4c'),_0x558e('0x4d')]);return db['Attachment'][_0x558e('0x4f')](_[_0x558e('0x3f')](_0x493cde,_0x2b0738['body']),{'include':_0x2b0738['query'][_0x558e('0x4a')]?[{'all':!![]}]:undefined});}})[_0x558e('0x27')](respondWithResult(_0x404a53,0xc9))[_0x558e('0x48')](handleError(_0x404a53,null));};exports[_0x558e('0x26')]=function(_0x265194,_0x18870e){if(_0x265194[_0x558e('0x4e')]['id']){delete _0x265194[_0x558e('0x4e')]['id'];}return db[_0x558e('0x2f')][_0x558e('0x47')]({'where':{'id':_0x265194['params']['id']}})[_0x558e('0x27')](handleEntityNotFound(_0x18870e,null))[_0x558e('0x27')](saveUpdates(_0x265194[_0x558e('0x4e')],null))[_0x558e('0x27')](respondWithResult(_0x18870e,null))[_0x558e('0x48')](handleError(_0x18870e,null));};exports[_0x558e('0x50')]=function(_0xb73f18,_0xab9e47){return db[_0x558e('0x2f')][_0x558e('0x47')]({'where':{'id':_0xb73f18['params']['id']}})['then'](handleEntityNotFound(_0xab9e47,null))['then'](removeEntity(_0xab9e47,null))[_0x558e('0x48')](handleError(_0xab9e47,null));};exports[_0x558e('0x4f')]=function(_0x1fd415,_0x43eead,_0x106bf4){_0x1fd415[_0x558e('0x4e')][_0x558e('0x2b')]=_0x1fd415[_0x558e('0x51')][_0x558e('0x52')];_0x1fd415[_0x558e('0x4e')][_0x558e('0x53')]=_0x1fd415['file'][_0x558e('0x54')];_0x1fd415[_0x558e('0x4e')][_0x558e('0x32')]=_0x1fd415[_0x558e('0x51')][_0x558e('0x55')];return db['Attachment']['create'](_0x1fd415[_0x558e('0x4e')])[_0x558e('0x27')](respondWithResult(_0x43eead,0xc9))['catch'](handleError(_0x43eead,null));};exports['download']=function(_0x2f304f,_0x431352,_0x42a00c){return db['Attachment'][_0x558e('0x56')]({'where':{'id':_0x2f304f['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x431352,null))[_0x558e('0x27')](function(_0x92aabe){if(_0x92aabe){var _0x18f3a8=_0x92aabe[_0x558e('0x57')]!==null;var _0x103eac=path['join'](config[_0x558e('0x58')],'server/files/attachments/');if(_0x18f3a8){_0x103eac=path[_0x558e('0x59')](_0x103eac,_0x558e('0x5a'));}var _0x1a7490=path[_0x558e('0x59')](_0x103eac,_0x92aabe[_0x558e('0x53')]);return _0x431352['download'](_0x1a7490);}})[_0x558e('0x48')](handleError(_0x431352,null));};
\ No newline at end of file
index a1fae11..15a0b13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc301=['exports','define','Attachment','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x1817b9,_0x4f3b8f){var _0x44a231=function(_0x35ae02){while(--_0x35ae02){_0x1817b9['push'](_0x1817b9['shift']());}};_0x44a231(++_0x4f3b8f);}(_0xc301,0x123));var _0x1c30=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xc301[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x1c30('0x0'));var util=require('util');var logger=require(_0x1c30('0x1'))(_0x1c30('0x2'));var moment=require(_0x1c30('0x3'));var BPromise=require(_0x1c30('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c30('0x5'));var rimraf=require(_0x1c30('0x6'));var config=require(_0x1c30('0x7'));var attributes=require(_0x1c30('0x8'));module[_0x1c30('0x9')]=function(_0x2b205c,_0x4f1db7){return _0x2b205c[_0x1c30('0xa')](_0x1c30('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x314e=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','../../config/logger','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x314e,0x170));var _0xe314=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x314e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe314('0x0'));var util=require('util');var logger=require(_0xe314('0x1'))(_0xe314('0x2'));var moment=require(_0xe314('0x3'));var BPromise=require('bluebird');var rp=require(_0xe314('0x4'));var fs=require('fs');var path=require(_0xe314('0x5'));var rimraf=require(_0xe314('0x6'));var config=require(_0xe314('0x7'));var attributes=require(_0xe314('0x8'));module[_0xe314('0x9')]=function(_0x4d1300,_0x4ba0dc){return _0x4d1300[_0xe314('0xa')]('Attachment',attributes,{'tableName':_0xe314('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 834b3e3..180382e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb32d=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','options','raw','CreateAttachment','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x1d462b,_0x28863a){var _0x5daa75=function(_0x6c3ed3){while(--_0x6c3ed3){_0x1d462b['push'](_0x1d462b['shift']());}};_0x5daa75(++_0x28863a);}(_0xb32d,0x1da));var _0xdb32=function(_0x3e0f20,_0x4c1204){_0x3e0f20=_0x3e0f20-0x0;var _0x4dc50e=_0xb32d[_0x3e0f20];return _0x4dc50e;};'use strict';var _=require(_0xdb32('0x0'));var util=require(_0xdb32('0x1'));var moment=require(_0xdb32('0x2'));var BPromise=require(_0xdb32('0x3'));var rs=require(_0xdb32('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb32('0x5'));var logger=require(_0xdb32('0x6'))('rpc');var config=require(_0xdb32('0x7'));var jayson=require(_0xdb32('0x8'));var client=jayson[_0xdb32('0x9')][_0xdb32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6f4af0,_0x386309,_0x5bb076){return new BPromise(function(_0x3b0995,_0x2686db){return client[_0xdb32('0xb')](_0x6f4af0,_0x5bb076)[_0xdb32('0xc')](function(_0x30e03d){logger[_0xdb32('0xd')](_0xdb32('0xe'),_0x386309,_0xdb32('0xf'));logger[_0xdb32('0x10')](_0xdb32('0x11'),_0x386309,_0xdb32('0xf'),JSON[_0xdb32('0x12')](_0x30e03d));if(_0x30e03d[_0xdb32('0x13')]){if(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x14')]===0x1f4){logger[_0xdb32('0x13')](_0xdb32('0xe'),_0x386309,_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);return _0x2686db(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);}logger['error'](_0xdb32('0xe'),_0x386309,_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);return _0x3b0995(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);}else{logger['info'](_0xdb32('0xe'),_0x386309,_0xdb32('0xf'));_0x3b0995(_0x30e03d[_0xdb32('0x16')]['message']);}})['catch'](function(_0x59a5f8){logger['error'](_0xdb32('0xe'),_0x386309,_0x59a5f8);_0x2686db(_0x59a5f8);});});}exports['CreateAttachment']=function(_0x1fd22b){var _0xfab49a=this;return new Promise(function(_0x1ba5f4,_0x301cc3){return db['Attachment']['create'](_0x1fd22b['body'],{'raw':_0x1fd22b[_0xdb32('0x17')]?_0x1fd22b['options'][_0xdb32('0x18')]===undefined?!![]:![]:!![]})[_0xdb32('0xc')](function(_0x8a5f88){logger[_0xdb32('0xd')](_0xdb32('0x19'),_0x1fd22b);logger['debug'](_0xdb32('0x19'),_0x1fd22b,JSON[_0xdb32('0x12')](_0x8a5f88));_0x1ba5f4(_0x8a5f88);})[_0xdb32('0x1a')](function(_0x5a5a84){logger['error'](_0xdb32('0x19'),_0x5a5a84['message'],_0x1fd22b);_0x301cc3(_0xfab49a['error'](0x1f4,_0x5a5a84[_0xdb32('0x15')]));});});};
\ No newline at end of file
+var _0xd845=['client','http','request','then','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xc4e4b2,_0x522c41){var _0x11bdd4=function(_0x88e89e){while(--_0x88e89e){_0xc4e4b2['push'](_0xc4e4b2['shift']());}};_0x11bdd4(++_0x522c41);}(_0xd845,0x135));var _0x5d84=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd845[_0x432682];return _0x463d05;};'use strict';var _=require(_0x5d84('0x0'));var util=require(_0x5d84('0x1'));var moment=require(_0x5d84('0x2'));var BPromise=require(_0x5d84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d84('0x4'));var db=require(_0x5d84('0x5'))['db'];var utils=require(_0x5d84('0x6'));var logger=require(_0x5d84('0x7'))('rpc');var config=require(_0x5d84('0x8'));var jayson=require(_0x5d84('0x9'));var client=jayson[_0x5d84('0xa')][_0x5d84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1712cb,_0x3f0541,_0x537d0e){return new BPromise(function(_0x135c45,_0x493231){return client[_0x5d84('0xc')](_0x1712cb,_0x537d0e)[_0x5d84('0xd')](function(_0x579df0){logger[_0x5d84('0xe')](_0x5d84('0xf'),_0x3f0541,'request\x20sent');logger['debug'](_0x5d84('0x10'),_0x3f0541,_0x5d84('0x11'),JSON[_0x5d84('0x12')](_0x579df0));if(_0x579df0[_0x5d84('0x13')]){if(_0x579df0[_0x5d84('0x13')]['code']===0x1f4){logger[_0x5d84('0x13')](_0x5d84('0xf'),_0x3f0541,_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);return _0x493231(_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);}logger['error'](_0x5d84('0xf'),_0x3f0541,_0x579df0['error'][_0x5d84('0x14')]);return _0x135c45(_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);}else{logger['info'](_0x5d84('0xf'),_0x3f0541,_0x5d84('0x11'));_0x135c45(_0x579df0[_0x5d84('0x15')][_0x5d84('0x14')]);}})[_0x5d84('0x16')](function(_0x4c4dc6){logger[_0x5d84('0x13')]('Attachment,\x20%s,\x20%s',_0x3f0541,_0x4c4dc6);_0x493231(_0x4c4dc6);});});}exports[_0x5d84('0x17')]=function(_0x59a6be){var _0x3b3f63=this;return new Promise(function(_0x2494cd,_0x2ba609){return db[_0x5d84('0x18')][_0x5d84('0x19')](_0x59a6be[_0x5d84('0x1a')],{'raw':_0x59a6be[_0x5d84('0x1b')]?_0x59a6be['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x254ac6){logger[_0x5d84('0xe')](_0x5d84('0x17'),_0x59a6be);logger[_0x5d84('0x1c')](_0x5d84('0x17'),_0x59a6be,JSON[_0x5d84('0x12')](_0x254ac6));_0x2494cd(_0x254ac6);})[_0x5d84('0x16')](function(_0x554d80){logger['error']('CreateAttachment',_0x554d80['message'],_0x59a6be);_0x2ba609(_0x3b3f63[_0x5d84('0x13')](0x1f4,_0x554d80['message']));});});};
\ No newline at end of file
index df06aa7..41b4317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x56ddf0,_0x3b9dbf){var _0x54542c=function(_0x4ed8e6){while(--_0x4ed8e6){_0x56ddf0['push'](_0x56ddf0['shift']());}};_0x54542c(++_0x3b9dbf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x571825,_0x53a5ba){_0x571825=_0x571825-0x0;var _0x511d01=_0x5f2f[_0x571825];return _0x511d01;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x51172a,_0x14d44e){var _0xc98e9a=function(_0x560fd0){while(--_0x560fd0){_0x51172a['push'](_0x51172a['shift']());}};_0xc98e9a(++_0x14d44e);}(_0x757a,0xde));var _0xa757=function(_0x362e9f,_0x296609){_0x362e9f=_0x362e9f-0x0;var _0x39e161=_0x757a[_0x362e9f];return _0x39e161;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
index dd69f15..d7c7cfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c11=['callback','clientID','clientSecret','secret','callbackURL','Setting','findOne','blockDuration','then','User','map','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','/login','profile'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x9c11,0xc4));var _0x19c1=function(_0xb3bc9c,_0x36e6c3){_0xb3bc9c=_0xb3bc9c-0x0;var _0x20dc39=_0x9c11[_0xb3bc9c];return _0x20dc39;};'use strict';var _=require(_0x19c1('0x0'));var passport=require(_0x19c1('0x1'));var GoogleStrategy=require(_0x19c1('0x2'))[_0x19c1('0x3')];var moment=require(_0x19c1('0x4'));var db=require(_0x19c1('0x5'))['db'];var config=require(_0x19c1('0x6'));var signToken=require(_0x19c1('0x7'))[_0x19c1('0x8')];var utils=require('../../config/utils');exports[_0x19c1('0x9')]=passport[_0x19c1('0xa')](_0x19c1('0xb'),{'failureRedirect':_0x19c1('0xc'),'scope':[_0x19c1('0xd'),'email'],'session':![]});exports[_0x19c1('0xe')]=passport['authenticate'](_0x19c1('0xb'),{'failureRedirect':_0x19c1('0xc'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x19c1('0xb')]?config['google'][_0x19c1('0xf')]:'id','clientSecret':config['google']?config[_0x19c1('0xb')][_0x19c1('0x10')]:_0x19c1('0x11'),'callbackURL':config['google']?config[_0x19c1('0xb')][_0x19c1('0x12')]:''},function(_0x530680,_0x2f0c4b,_0x4be0ba,_0x396264){var _0x53eedb,_0x3fd23c;return db[_0x19c1('0x13')][_0x19c1('0x14')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x19c1('0x15')],'raw':!![]})[_0x19c1('0x16')](function(_0xa6478c){_0x53eedb=_0xa6478c;return db[_0x19c1('0x17')]['find']({'where':{'email':_[_0x19c1('0x18')](_0x4be0ba['emails'],'value'),'role':{'$or':[_0x19c1('0x19'),_0x19c1('0x1a'),_0x19c1('0x1b')]}}});})[_0x19c1('0x16')](function(_0x4ee6eb){_0x3fd23c=_0x4ee6eb;if(_0x3fd23c){if(_0x3fd23c['disabled']){return _0x396264(_0x19c1('0x1c'));}else if(_0x53eedb[_0x19c1('0x15')]>0x0){if(_0x3fd23c[_0x19c1('0x1d')]){if(moment(_0x3fd23c[_0x19c1('0x1e')])['add'](_0x53eedb['blockDuration'],_0x19c1('0x1f'))>moment()){return _0x396264(_0x19c1('0x1c'));}else{return utils[_0x19c1('0x20')](_0x3fd23c,0x0,![],null)[_0x19c1('0x16')](function(){return utils[_0x19c1('0x21')](_0x3fd23c);})[_0x19c1('0x16')](function(){return _0x396264(null,_0x3fd23c);});}}else{return utils[_0x19c1('0x21')](_0x3fd23c)['then'](function(){return _0x396264(null,_0x3fd23c);});}}else{return utils[_0x19c1('0x21')](_0x3fd23c)['then'](function(){return _0x396264(null,_0x3fd23c);});}}return _0x396264('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x19c1('0x22')](function(_0x5d245a){_0x396264(_0x5d245a);});}));
\ No newline at end of file
+var _0xd374=['add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','clientSecret','secret','Setting','allowedLoginAttempts','then','User','find','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt'];(function(_0x353e6c,_0x596af8){var _0x568a84=function(_0xd1791e){while(--_0xd1791e){_0x353e6c['push'](_0x353e6c['shift']());}};_0x568a84(++_0x596af8);}(_0xd374,0xdd));var _0x4d37=function(_0xe31c95,_0x1edf2c){_0xe31c95=_0xe31c95-0x0;var _0x4d1987=_0xd374[_0xe31c95];return _0x4d1987;};'use strict';var _=require(_0x4d37('0x0'));var passport=require(_0x4d37('0x1'));var GoogleStrategy=require(_0x4d37('0x2'))[_0x4d37('0x3')];var moment=require(_0x4d37('0x4'));var db=require(_0x4d37('0x5'))['db'];var config=require(_0x4d37('0x6'));var signToken=require('../../components/auth/service')[_0x4d37('0x7')];var utils=require(_0x4d37('0x8'));exports[_0x4d37('0x9')]=passport[_0x4d37('0xa')](_0x4d37('0xb'),{'failureRedirect':_0x4d37('0xc'),'scope':[_0x4d37('0xd'),_0x4d37('0xe')],'session':![]});exports[_0x4d37('0xf')]=passport['authenticate']('google',{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x4d37('0xb')]?config['google'][_0x4d37('0x10')]:'id','clientSecret':config['google']?config[_0x4d37('0xb')][_0x4d37('0x11')]:_0x4d37('0x12'),'callbackURL':config[_0x4d37('0xb')]?config[_0x4d37('0xb')]['callbackURL']:''},function(_0x3d4b8e,_0x794888,_0x1a5468,_0x33dd98){var _0x2a7317,_0x41bb1d;return db[_0x4d37('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x4d37('0x14'),'blockDuration'],'raw':!![]})[_0x4d37('0x15')](function(_0x2ae8cf){_0x2a7317=_0x2ae8cf;return db[_0x4d37('0x16')][_0x4d37('0x17')]({'where':{'email':_['map'](_0x1a5468['emails'],'value'),'role':{'$or':[_0x4d37('0x18'),'user',_0x4d37('0x19')]}}});})[_0x4d37('0x15')](function(_0x427670){_0x41bb1d=_0x427670;if(_0x41bb1d){if(_0x41bb1d[_0x4d37('0x1a')]){return _0x33dd98(_0x4d37('0x1b'));}else if(_0x2a7317[_0x4d37('0x1c')]>0x0){if(_0x41bb1d[_0x4d37('0x1d')]){if(moment(_0x41bb1d[_0x4d37('0x1e')])[_0x4d37('0x1f')](_0x2a7317[_0x4d37('0x1c')],_0x4d37('0x20'))>moment()){return _0x33dd98(_0x4d37('0x1b'));}else{return utils[_0x4d37('0x21')](_0x41bb1d,0x0,![],null)[_0x4d37('0x15')](function(){return utils[_0x4d37('0x22')](_0x41bb1d);})[_0x4d37('0x15')](function(){return _0x33dd98(null,_0x41bb1d);});}}else{return utils[_0x4d37('0x22')](_0x41bb1d)[_0x4d37('0x15')](function(){return _0x33dd98(null,_0x41bb1d);});}}else{return utils['getLicense'](_0x41bb1d)[_0x4d37('0x15')](function(){return _0x33dd98(null,_0x41bb1d);});}}return _0x33dd98('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x4d37('0x23')](function(_0x1fc787){_0x33dd98(_0x1fc787);});}));
\ No newline at end of file
index 61b8b47..01786e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ea=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','isMiddleware','exports','express'];(function(_0x410ccb,_0x464c7e){var _0x2d6ce6=function(_0x5b3a54){while(--_0x5b3a54){_0x410ccb['push'](_0x410ccb['shift']());}};_0x2d6ce6(++_0x464c7e);}(_0x36ea,0x10d));var _0xa36e=function(_0x3fc287,_0x5c3f36){_0x3fc287=_0x3fc287-0x0;var _0x33af9f=_0x36ea[_0x3fc287];return _0x33af9f;};'use strict';var express=require(_0xa36e('0x0'));var passport=require(_0xa36e('0x1'));var router=express[_0xa36e('0x2')]();var controller=require(_0xa36e('0x3'));var userController=require(_0xa36e('0x4'));var authService=require(_0xa36e('0x5'));router[_0xa36e('0x6')]('/',controller['login']);router[_0xa36e('0x6')](_0xa36e('0x7'),controller['callback'],authService[_0xa36e('0x8')],userController['login'],authService['setTokenCookie']);module[_0xa36e('0x9')]=router;
\ No newline at end of file
+var _0x1de4=['login','/callback','callback','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','get'];(function(_0x3d6618,_0x2ed011){var _0xc449b5=function(_0x55fdaa){while(--_0x55fdaa){_0x3d6618['push'](_0x3d6618['shift']());}};_0xc449b5(++_0x2ed011);}(_0x1de4,0x94));var _0x41de=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x1de4[_0x5317b5];return _0x3b7ce2;};'use strict';var express=require(_0x41de('0x0'));var passport=require(_0x41de('0x1'));var router=express[_0x41de('0x2')]();var controller=require(_0x41de('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x41de('0x4'));router[_0x41de('0x5')]('/',controller[_0x41de('0x6')]);router['get'](_0x41de('0x7'),controller[_0x41de('0x8')],authService['isMiddleware'],userController[_0x41de('0x6')],authService[_0x41de('0x9')]);module[_0x41de('0xa')]=router;
\ No newline at end of file
index d09bc8a..1b099c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33e1=['email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','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','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','Setting','findOne','allowedLoginAttempts','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','blockDuration','minutes','clearBlockUser','getLicense','catch','MailAccount','find'];(function(_0x161b63,_0x42354c){var _0x1c4ce3=function(_0x1af9c1){while(--_0x1af9c1){_0x161b63['push'](_0x161b63['shift']());}};_0x1c4ce3(++_0x42354c);}(_0x33e1,0x142));var _0x133e=function(_0xe2a909,_0x4867f6){_0xe2a909=_0xe2a909-0x0;var _0x1f912b=_0x33e1[_0xe2a909];return _0x1f912b;};'use strict';var util=require(_0x133e('0x0'));var passport=require(_0x133e('0x1'));var LocalStrategy=require(_0x133e('0x2'))[_0x133e('0x3')];var jayson=require(_0x133e('0x4'));var _=require('lodash');var rs=require(_0x133e('0x5'));var moment=require(_0x133e('0x6'));var db=require(_0x133e('0x7'))['db'];var authService=require(_0x133e('0x8'));var utils=require(_0x133e('0x9'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x4c0286,_0x47417b,_0x135836,_0x15435d){var _0x2e8179,_0x1c96ff;return db[_0x133e('0xa')][_0x133e('0xb')]({'where':{'id':0x1},'attributes':[_0x133e('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x51a1a6){_0x2e8179=_0x51a1a6;return _0x4c0286['findOne']({'attributes':['id',_0x133e('0xd'),_0x133e('0xe'),_0x133e('0xf'),_0x133e('0x10'),_0x133e('0x11'),_0x133e('0x12'),_0x133e('0x13'),_0x133e('0x14')],'where':{'name':_0x47417b,'role':{'$or':[_0x133e('0x15'),_0x133e('0x16'),'agent']}}});})[_0x133e('0x17')](function(_0x11eac4){if(!_0x11eac4||_0x11eac4&&_0x11eac4[_0x133e('0xd')]!==_0x47417b){throw new Error(_0x133e('0x18'));}else{_0x1c96ff=_0x11eac4;return _0x1c96ff;}})[_0x133e('0x17')](function(){_0x1c96ff[_0x133e('0x19')](_0x135836,function(_0x57df9a,_0x4e1547){var _0x3bbb5f=_0x1c96ff['loginAttempts']+0x1;if(_0x57df9a){return _0x15435d(_0x57df9a);}else if(!_0x4e1547){if(_0x1c96ff[_0x133e('0x11')]){return _0x15435d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2e8179[_0x133e('0xc')]>0x0){if(_0x1c96ff['blocked']){if(_0x2e8179['blockDuration']>0x0){if(moment(_0x1c96ff['blockedAt'])[_0x133e('0x1a')](_0x2e8179[_0x133e('0x1b')],_0x133e('0x1c'))>moment()){return _0x15435d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x133e('0x1d')](_0x1c96ff,_0x3bbb5f,![],null)[_0x133e('0x17')](function(){return _0x15435d(null,![],{'message':_0x133e('0x18')});});}}else{return _0x15435d(null,![],{'message':_0x133e('0x18')});}}else{if(_0x3bbb5f>=_0x2e8179[_0x133e('0xc')]){return utils[_0x133e('0x1d')](_0x1c96ff,0x0,!![],moment())[_0x133e('0x17')](function(){return _0x15435d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x133e('0x1d')](_0x1c96ff,_0x3bbb5f,![],null)[_0x133e('0x17')](function(){return _0x15435d(null,![],{'message':_0x133e('0x18')});});}}}else{return _0x15435d(null,![],{'message':_0x133e('0x18')});}}else{if(_0x1c96ff[_0x133e('0x11')]){return _0x15435d(null,![],{'message':_0x133e('0x18')});}else if(_0x2e8179['allowedLoginAttempts']>0x0){if(_0x1c96ff[_0x133e('0x12')]){if(_0x2e8179[_0x133e('0x1b')]>0x0){if(moment(_0x1c96ff[_0x133e('0x13')])[_0x133e('0x1a')](_0x2e8179['blockDuration'],_0x133e('0x1c'))>moment()){return _0x15435d(null,![],{'message':_0x133e('0x18')});}else{return utils['clearBlockUser'](_0x1c96ff,0x0,![],null)[_0x133e('0x17')](function(){return utils[_0x133e('0x1e')](_0x1c96ff);})[_0x133e('0x17')](function(){return _0x15435d(null,_0x1c96ff);});}}else{return _0x15435d(null,![],{'message':_0x133e('0x18')});}}else{return utils[_0x133e('0x1d')](_0x1c96ff,0x0,![],null)[_0x133e('0x17')](function(){return utils[_0x133e('0x1e')](_0x1c96ff);})['then'](function(){return _0x15435d(null,_0x1c96ff);})[_0x133e('0x1f')](function(_0x3d9107){return _0x15435d(null,![],_0x3d9107);});}}else{if(_0x1c96ff[_0x133e('0x12')]){return _0x15435d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x133e('0x1e')](_0x1c96ff)[_0x133e('0x17')](function(){return _0x15435d(null,_0x1c96ff);});}}}});})[_0x133e('0x1f')](function(_0x19dedd){return _0x15435d(null,![],_0x19dedd);});}function sendServiceMail(_0x8d8ed6){return db[_0x133e('0x20')][_0x133e('0x21')]({'where':{'service':!![]},'attributes':['id',_0x133e('0xd'),_0x133e('0x22')],'include':[{'model':db[_0x133e('0x23')],'as':_0x133e('0x24')}]})[_0x133e('0x17')](function(_0x2e9173){if(!_0x2e9173){throw new Error(_0x133e('0x25'));}var _0x24f4d9={'tls':{'rejectUnauthorized':![]}};if(_0x2e9173['Smtp']['service']){_0x24f4d9[_0x133e('0x26')]=_0x2e9173[_0x133e('0x24')][_0x133e('0x26')];}else{_0x24f4d9[_0x133e('0x27')]=_0x2e9173[_0x133e('0x24')][_0x133e('0x27')];_0x24f4d9[_0x133e('0x28')]=_0x2e9173[_0x133e('0x24')]['port'];_0x24f4d9[_0x133e('0x29')]=_0x2e9173['Smtp'][_0x133e('0x29')];}if(_0x2e9173['Smtp'][_0x133e('0x2a')]){_0x24f4d9['auth']={'user':_0x2e9173[_0x133e('0x24')][_0x133e('0x16')],'pass':_0x2e9173[_0x133e('0x24')][_0x133e('0x2b')]};}var _0x49bbc4={'account':_0x24f4d9,'message':_['merge']({'from':util[_0x133e('0x2c')]('\x22%s\x22\x20<%s>',_0x2e9173['name'],_0x2e9173[_0x133e('0x22')]||_0x2e9173[_0x133e('0x24')][_0x133e('0x16')])},_0x8d8ed6)};return client[_0x133e('0x2d')]('SendMail',_0x49bbc4);})[_0x133e('0x17')](function(_0x1b2fe4){if(_0x1b2fe4[_0x133e('0x2e')]){throw new Error(util[_0x133e('0x2c')](_0x133e('0x2f'),_0x1b2fe4[_0x133e('0x2e')][_0x133e('0x30')]||JSON[_0x133e('0x31')](_0x1b2fe4['error'])));}return!![];});}function handleError(_0x1a807c,_0x1469cc,_0x35900e){return _0x1a807c[_0x133e('0x32')](_0x1469cc||0x1f4)['send']({'message':_0x35900e?_0x35900e['message']||_0x35900e:''});}exports[_0x133e('0x33')]=function(_0x3b14db,_0x39179b,_0x2ca945){passport[_0x133e('0x19')](_0x133e('0x34'),function(_0x1a4dc3,_0x5f7fd7,_0x4699df){var _0x299518=_0x1a4dc3||_0x4699df;if(_0x299518){return handleError(_0x39179b,0x191,_0x299518);}if(!_0x5f7fd7){return handleError(_0x39179b,0x194,{'message':_0x133e('0x35')});}else{var _0x1e9c3c={'payload':{'id':_0x5f7fd7['id'],'role':_0x5f7fd7[_0x133e('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x133e('0x36')](_0x1e9c3c)[_0x133e('0x17')](function(_0x27b0c8){_0x39179b[_0x133e('0x37')]({'id':_0x5f7fd7['id'],'token':_0x27b0c8,'statusCall':'','isAlreadyLogged':_0x5f7fd7[_0x133e('0x38')]});});}})(_0x3b14db,_0x39179b,_0x2ca945);};exports[_0x133e('0x39')]=function(_0xca1b4,_0xb1c6e5,_0x54b0be){if(!_0xca1b4['body'][_0x133e('0x22')]){return handleError(_0xb1c6e5,0x1f4,{'message':_0x133e('0x3a')});}var _0x1455ff=rs['generate']();_0xca1b4[_0x133e('0x3b')][_0x133e('0x22')]=_0xca1b4[_0x133e('0x3b')][_0x133e('0x22')][_0x133e('0x3c')]()[_0x133e('0x3d')]();var _0x515369;return db[_0x133e('0xa')][_0x133e('0xb')]({'where':{'id':0x1},'attributes':[_0x133e('0xc'),_0x133e('0x1b')],'raw':!![]})[_0x133e('0x17')](function(_0x2de878){_0x515369=_0x2de878;return db[_0x133e('0x3e')][_0x133e('0x21')]({'where':{'email':_0xca1b4[_0x133e('0x3b')][_0x133e('0x22')]}});})[_0x133e('0x17')](function(_0x3a4ba2){if(!_0x3a4ba2){throw new Error(_0x133e('0x3f'));}if(_0x3a4ba2[_0x133e('0x11')]){throw new Error(_0x133e('0x40'));}if(_0x3a4ba2[_0x133e('0x12')]){if(moment(_0x3a4ba2[_0x133e('0x13')])[_0x133e('0x1a')](_0x515369[_0x133e('0x1b')],_0x133e('0x1c'))>moment()){throw new Error(_0x133e('0x41'));}else{_0x3a4ba2[_0x133e('0x12')]=![];_0x3a4ba2[_0x133e('0x13')]=null;}}_0x3a4ba2[_0x133e('0x42')]=_0x1455ff;_0x3a4ba2[_0x133e('0x43')]=Date[_0x133e('0x44')]()+0x36ee80;return _0x3a4ba2['save']();})[_0x133e('0x17')](function(){return sendServiceMail({'to':_0xca1b4[_0x133e('0x3b')][_0x133e('0x22')],'subject':_0x133e('0x45'),'text':_0x133e('0x46')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x133e('0x47')+_0xca1b4[_0x133e('0x48')]['host']+_0x133e('0x49')+_0x1455ff+'\x0a\x0a'+_0x133e('0x4a')});})['then'](function(){_0xb1c6e5[_0x133e('0x32')](0xc8)[_0x133e('0x4b')]({'message':_0x133e('0x4c')});})[_0x133e('0x1f')](function(_0x5d5554){return handleError(_0xb1c6e5,0x1f4,_0x5d5554);});};exports[_0x133e('0x4d')]=function(_0x4cb5f8,_0xe410bb,_0x4f4ec2){return db[_0x133e('0x3e')]['find']({'where':{'resetPasswordToken':_0x4cb5f8[_0x133e('0x4e')][_0x133e('0x4f')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x133e('0x17')](function(_0x56267b){if(!_0x56267b){throw new Error(_0x133e('0x50'));}return db[_0x133e('0xa')][_0x133e('0xb')]({'attributes':['id',_0x133e('0x51'),_0x133e('0x52'),_0x133e('0x53')]})[_0x133e('0x17')](function(_0x92278f){if(_0x92278f[_0x133e('0x51')])authService[_0x133e('0x54')](_0x4cb5f8[_0x133e('0x3b')][_0x133e('0xe')]);if(!_0x92278f[_0x133e('0x52')]||!_0x56267b[_0x133e('0x55')])return _0x56267b;authService[_0x133e('0x56')](_0x4cb5f8[_0x133e('0x3b')][_0x133e('0xe')],_0x56267b[_0x133e('0x55')],_0x92278f[_0x133e('0x53')]);return _0x56267b;})[_0x133e('0x17')](function(){_0x56267b[_0x133e('0xe')]=_0x4cb5f8['body'][_0x133e('0xe')];_0x56267b[_0x133e('0x42')]=null;_0x56267b[_0x133e('0x43')]=null;return _0x56267b[_0x133e('0x57')]();});})[_0x133e('0x17')](function(){_0xe410bb['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0x133e('0x1f')](function(_0x1adbe5){return handleError(_0xe410bb,0x1f4,_0x1adbe5);});};passport[_0x133e('0x58')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x532042,_0x3bdf78,_0x5e00a1){return localAuthenticate(db[_0x133e('0x3e')],_0x532042,_0x3bdf78,_0x5e00a1);}));
\ No newline at end of file
+var _0xeff5=['online','forgot','Email\x20parameter\x20is\x20missing','body','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','status','params','token','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','save','Password\x20reset!','use','util','passport-local','jayson/promise','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blocked','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','minutes','clearBlockUser','blockedAt','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x3a051f,_0x448120){var _0x487fad=function(_0x1ce6e7){while(--_0x1ce6e7){_0x3a051f['push'](_0x3a051f['shift']());}};_0x487fad(++_0x448120);}(_0xeff5,0x101));var _0x5eff=function(_0x26f916,_0x33c024){_0x26f916=_0x26f916-0x0;var _0x4b590e=_0xeff5[_0x26f916];return _0x4b590e;};'use strict';var util=require(_0x5eff('0x0'));var passport=require('passport');var LocalStrategy=require(_0x5eff('0x1'))['Strategy'];var jayson=require(_0x5eff('0x2'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0x5eff('0x3'))['db'];var authService=require(_0x5eff('0x4'));var utils=require(_0x5eff('0x5'));var client=jayson[_0x5eff('0x6')][_0x5eff('0x7')]({'port':0x232b});function localAuthenticate(_0x1722fe,_0x31e993,_0x446a04,_0x109f8e){var _0x386143,_0x2a1f37;return db[_0x5eff('0x8')][_0x5eff('0x9')]({'where':{'id':0x1},'attributes':[_0x5eff('0xa'),_0x5eff('0xb')],'raw':!![]})[_0x5eff('0xc')](function(_0x37debd){_0x386143=_0x37debd;return _0x1722fe[_0x5eff('0x9')]({'attributes':['id',_0x5eff('0xd'),_0x5eff('0xe'),'salt',_0x5eff('0xf'),'disabled',_0x5eff('0x10'),'blockedAt','loginAttempts'],'where':{'name':_0x31e993,'role':{'$or':['admin',_0x5eff('0x11'),'agent']}}});})[_0x5eff('0xc')](function(_0x599d96){if(!_0x599d96||_0x599d96&&_0x599d96[_0x5eff('0xd')]!==_0x31e993){throw new Error(_0x5eff('0x12'));}else{_0x2a1f37=_0x599d96;return _0x2a1f37;}})[_0x5eff('0xc')](function(){_0x2a1f37['authenticate'](_0x446a04,function(_0x404f60,_0x35dd15){var _0xc81e1d=_0x2a1f37['loginAttempts']+0x1;if(_0x404f60){return _0x109f8e(_0x404f60);}else if(!_0x35dd15){if(_0x2a1f37[_0x5eff('0x13')]){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});}else if(_0x386143[_0x5eff('0xa')]>0x0){if(_0x2a1f37[_0x5eff('0x10')]){if(_0x386143[_0x5eff('0xb')]>0x0){if(moment(_0x2a1f37['blockedAt'])['add'](_0x386143['blockDuration'],_0x5eff('0x14'))>moment()){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});}else{return utils[_0x5eff('0x15')](_0x2a1f37,_0xc81e1d,![],null)[_0x5eff('0xc')](function(){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});});}}else{return _0x109f8e(null,![],{'message':_0x5eff('0x12')});}}else{if(_0xc81e1d>=_0x386143['allowedLoginAttempts']){return utils['clearBlockUser'](_0x2a1f37,0x0,!![],moment())['then'](function(){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});});}else{return utils[_0x5eff('0x15')](_0x2a1f37,_0xc81e1d,![],null)[_0x5eff('0xc')](function(){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});});}}}else{return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2a1f37['disabled']){return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x386143[_0x5eff('0xa')]>0x0){if(_0x2a1f37[_0x5eff('0x10')]){if(_0x386143[_0x5eff('0xb')]>0x0){if(moment(_0x2a1f37[_0x5eff('0x16')])[_0x5eff('0x17')](_0x386143[_0x5eff('0xb')],_0x5eff('0x14'))>moment()){return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x2a1f37,0x0,![],null)[_0x5eff('0xc')](function(){return utils[_0x5eff('0x18')](_0x2a1f37);})[_0x5eff('0xc')](function(){return _0x109f8e(null,_0x2a1f37);});}}else{return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x5eff('0x15')](_0x2a1f37,0x0,![],null)[_0x5eff('0xc')](function(){return utils[_0x5eff('0x18')](_0x2a1f37);})[_0x5eff('0xc')](function(){return _0x109f8e(null,_0x2a1f37);})[_0x5eff('0x19')](function(_0x351eae){return _0x109f8e(null,![],_0x351eae);});}}else{if(_0x2a1f37[_0x5eff('0x10')]){return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5eff('0x18')](_0x2a1f37)['then'](function(){return _0x109f8e(null,_0x2a1f37);});}}}});})['catch'](function(_0x53dace){return _0x109f8e(null,![],_0x53dace);});}function sendServiceMail(_0x1a3d36){return db[_0x5eff('0x1a')][_0x5eff('0x1b')]({'where':{'service':!![]},'attributes':['id',_0x5eff('0xd'),_0x5eff('0x1c')],'include':[{'model':db[_0x5eff('0x1d')],'as':_0x5eff('0x1e')}]})[_0x5eff('0xc')](function(_0x775b1e){if(!_0x775b1e){throw new Error(_0x5eff('0x1f'));}var _0x48f4cc={'tls':{'rejectUnauthorized':![]}};if(_0x775b1e[_0x5eff('0x1e')]['service']){_0x48f4cc[_0x5eff('0x20')]=_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x20')];}else{_0x48f4cc[_0x5eff('0x21')]=_0x775b1e['Smtp']['host'];_0x48f4cc[_0x5eff('0x22')]=_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x22')];_0x48f4cc[_0x5eff('0x23')]=_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x23')];}if(_0x775b1e[_0x5eff('0x1e')]['authentication']){_0x48f4cc[_0x5eff('0x24')]={'user':_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x11')],'pass':_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x25')]};}var _0x3dee1a={'account':_0x48f4cc,'message':_[_0x5eff('0x26')]({'from':util[_0x5eff('0x27')](_0x5eff('0x28'),_0x775b1e[_0x5eff('0xd')],_0x775b1e[_0x5eff('0x1c')]||_0x775b1e[_0x5eff('0x1e')]['user'])},_0x1a3d36)};return client['request'](_0x5eff('0x29'),_0x3dee1a);})[_0x5eff('0xc')](function(_0x36fb55){if(_0x36fb55[_0x5eff('0x2a')]){throw new Error(util[_0x5eff('0x27')](_0x5eff('0x2b'),_0x36fb55[_0x5eff('0x2a')][_0x5eff('0x2c')]||JSON[_0x5eff('0x2d')](_0x36fb55[_0x5eff('0x2a')])));}return!![];});}function handleError(_0x26e44e,_0x1be615,_0x2b45b4){return _0x26e44e['status'](_0x1be615||0x1f4)[_0x5eff('0x2e')]({'message':_0x2b45b4?_0x2b45b4['message']||_0x2b45b4:''});}exports[_0x5eff('0x2f')]=function(_0x39c118,_0x17d568,_0x1e7ee2){passport[_0x5eff('0x30')]('local',function(_0x43a780,_0x400b09,_0x124ee9){var _0x59f49d=_0x43a780||_0x124ee9;if(_0x59f49d){return handleError(_0x17d568,0x191,_0x59f49d);}if(!_0x400b09){return handleError(_0x17d568,0x194,{'message':_0x5eff('0x31')});}else{var _0x8b09d8={'payload':{'id':_0x400b09['id'],'role':_0x400b09[_0x5eff('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x5eff('0x32')](_0x8b09d8)[_0x5eff('0xc')](function(_0x4f15d4){_0x17d568['json']({'id':_0x400b09['id'],'token':_0x4f15d4,'statusCall':'','isAlreadyLogged':_0x400b09[_0x5eff('0x33')]});});}})(_0x39c118,_0x17d568,_0x1e7ee2);};exports[_0x5eff('0x34')]=function(_0x19ceea,_0x4ceb60,_0x1fbb4c){if(!_0x19ceea['body'][_0x5eff('0x1c')]){return handleError(_0x4ceb60,0x1f4,{'message':_0x5eff('0x35')});}var _0x3687cf=rs['generate']();_0x19ceea[_0x5eff('0x36')]['email']=_0x19ceea[_0x5eff('0x36')][_0x5eff('0x1c')][_0x5eff('0x37')]()['toLowerCase']();var _0x2a3ff1;return db[_0x5eff('0x8')][_0x5eff('0x9')]({'where':{'id':0x1},'attributes':[_0x5eff('0xa'),_0x5eff('0xb')],'raw':!![]})[_0x5eff('0xc')](function(_0x5e0228){_0x2a3ff1=_0x5e0228;return db[_0x5eff('0x38')][_0x5eff('0x1b')]({'where':{'email':_0x19ceea[_0x5eff('0x36')][_0x5eff('0x1c')]}});})[_0x5eff('0xc')](function(_0x22cd26){if(!_0x22cd26){throw new Error(_0x5eff('0x39'));}if(_0x22cd26['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x22cd26[_0x5eff('0x10')]){if(moment(_0x22cd26[_0x5eff('0x16')])[_0x5eff('0x17')](_0x2a3ff1[_0x5eff('0xb')],'minutes')>moment()){throw new Error(_0x5eff('0x3a'));}else{_0x22cd26[_0x5eff('0x10')]=![];_0x22cd26[_0x5eff('0x16')]=null;}}_0x22cd26[_0x5eff('0x3b')]=_0x3687cf;_0x22cd26[_0x5eff('0x3c')]=Date[_0x5eff('0x3d')]()+0x36ee80;return _0x22cd26['save']();})['then'](function(){return sendServiceMail({'to':_0x19ceea[_0x5eff('0x36')][_0x5eff('0x1c')],'subject':_0x5eff('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5eff('0x3f')+_0x5eff('0x40')+_0x19ceea[_0x5eff('0x41')][_0x5eff('0x21')]+_0x5eff('0x42')+_0x3687cf+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5eff('0xc')](function(){_0x4ceb60[_0x5eff('0x43')](0xc8)[_0x5eff('0x2e')]({'message':'Reset\x20Email\x20sent!'});})[_0x5eff('0x19')](function(_0x16335e){return handleError(_0x4ceb60,0x1f4,_0x16335e);});};exports['reset']=function(_0x526a68,_0x215dbb,_0x594559){return db[_0x5eff('0x38')][_0x5eff('0x1b')]({'where':{'resetPasswordToken':_0x526a68[_0x5eff('0x44')][_0x5eff('0x45')],'resetPasswordExpires':{'$gt':Date[_0x5eff('0x3d')]()}}})[_0x5eff('0xc')](function(_0x2f8c5a){if(!_0x2f8c5a){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0x5eff('0x46'),'enforcePasswordHistory',_0x5eff('0x47')]})[_0x5eff('0xc')](function(_0x141381){if(_0x141381[_0x5eff('0x46')])authService['validatePasswordPattern'](_0x526a68[_0x5eff('0x36')][_0x5eff('0xe')]);if(!_0x141381[_0x5eff('0x48')]||!_0x2f8c5a[_0x5eff('0x49')])return _0x2f8c5a;authService['validatePasswordHistory'](_0x526a68[_0x5eff('0x36')][_0x5eff('0xe')],_0x2f8c5a['previousPasswords'],_0x141381[_0x5eff('0x47')]);return _0x2f8c5a;})[_0x5eff('0xc')](function(){_0x2f8c5a['password']=_0x526a68[_0x5eff('0x36')]['password'];_0x2f8c5a[_0x5eff('0x3b')]=null;_0x2f8c5a[_0x5eff('0x3c')]=null;return _0x2f8c5a[_0x5eff('0x4a')]();});})[_0x5eff('0xc')](function(){_0x215dbb[_0x5eff('0x43')](0xc8)[_0x5eff('0x2e')]({'message':_0x5eff('0x4b')});})[_0x5eff('0x19')](function(_0x370bdb){return handleError(_0x215dbb,0x1f4,_0x370bdb);});};passport[_0x5eff('0x4c')](new LocalStrategy({'usernameField':'name','passwordField':_0x5eff('0xe')},function(_0x3f18aa,_0x53c34b,_0x178f7f){return localAuthenticate(db['User'],_0x3f18aa,_0x53c34b,_0x178f7f);}));
\ No newline at end of file
index d40ec11..c60e1b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0810=['Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x485ff8,_0x514b5f){var _0x5c527e=function(_0x233f01){while(--_0x233f01){_0x485ff8['push'](_0x485ff8['shift']());}};_0x5c527e(++_0x514b5f);}(_0x0810,0xb8));var _0x0081=function(_0x2fa4ec,_0x13dc2e){_0x2fa4ec=_0x2fa4ec-0x0;var _0x5d9b86=_0x0810[_0x2fa4ec];return _0x5d9b86;};'use strict';var express=require('express');var router=express[_0x0081('0x0')]();var controller=require(_0x0081('0x1'));router['post']('/',controller['login']);router[_0x0081('0x2')](_0x0081('0x3'),controller[_0x0081('0x4')]);router[_0x0081('0x2')](_0x0081('0x5'),controller[_0x0081('0x6')]);module[_0x0081('0x7')]=router;
\ No newline at end of file
+var _0xe065=['login','/reset/:token','exports','Router','./authLocal.controller','post'];(function(_0x42e407,_0x22ff7b){var _0x2e55b6=function(_0x4b0e05){while(--_0x4b0e05){_0x42e407['push'](_0x42e407['shift']());}};_0x2e55b6(++_0x22ff7b);}(_0xe065,0xc9));var _0x5e06=function(_0x514461,_0x4744d6){_0x514461=_0x514461-0x0;var _0x4f8748=_0xe065[_0x514461];return _0x4f8748;};'use strict';var express=require('express');var router=express[_0x5e06('0x0')]();var controller=require(_0x5e06('0x1'));router[_0x5e06('0x2')]('/',controller[_0x5e06('0x3')]);router['post']('/forgot',controller['forgot']);router[_0x5e06('0x2')](_0x5e06('0x4'),controller['reset']);module[_0x5e06('0x5')]=router;
\ No newline at end of file
index 0a70d25..08e204f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x577b=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3b6732,_0x4e47a9){var _0x218263=function(_0x1d0749){while(--_0x1d0749){_0x3b6732['push'](_0x3b6732['shift']());}};_0x218263(++_0x4e47a9);}(_0x577b,0xc7));var _0xb577=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x577b[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xb577('0x0'));module[_0xb577('0x1')]={'name':{'type':Sequelize[_0xb577('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb577('0x2')]},'description':{'type':Sequelize[_0xb577('0x2')]},'status':{'type':Sequelize[_0xb577('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb577('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xe831=['exports','STRING','INTEGER','sequelize'];(function(_0xc0374e,_0x2de1fc){var _0x3cabe1=function(_0x2cfcae){while(--_0x2cfcae){_0xc0374e['push'](_0xc0374e['shift']());}};_0x3cabe1(++_0x2de1fc);}(_0xe831,0x137));var _0x1e83=function(_0x257115,_0x5504d8){_0x257115=_0x257115-0x0;var _0x4ec752=_0xe831[_0x257115];return _0x4ec752;};'use strict';var Sequelize=require(_0x1e83('0x0'));module[_0x1e83('0x1')]={'name':{'type':Sequelize[_0x1e83('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1e83('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1e83('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index 1494989..8739c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6970=['getActions','Action','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','Automation','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','keys','length','find','create','body','catch','addConditions','Condition','omit','ids','getConditions','findOne','map','nolimit','addActions'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x6970,0x1e2));var _0x0697=function(_0x1079d2,_0x12eee5){_0x1079d2=_0x1079d2-0x0;var _0x387a7c=_0x6970[_0x1079d2];return _0x387a7c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0697('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0697('0x1'));var moment=require(_0x0697('0x2'));var BPromise=require(_0x0697('0x3'));var Mustache=require('mustache');var util=require(_0x0697('0x4'));var path=require(_0x0697('0x5'));var sox=require(_0x0697('0x6'));var csv=require(_0x0697('0x7'));var ejs=require(_0x0697('0x8'));var fs=require('fs');var fs_extra=require(_0x0697('0x9'));var _=require(_0x0697('0xa'));var squel=require('squel');var crypto=require(_0x0697('0xb'));var jsforce=require(_0x0697('0xc'));var deskjs=require(_0x0697('0xd'));var toCsv=require(_0x0697('0x7'));var querystring=require(_0x0697('0xe'));var Papa=require(_0x0697('0xf'));var Redis=require(_0x0697('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0697('0x11'));var hardwareService=require(_0x0697('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0697('0x13'));var config=require(_0x0697('0x14'));var licenseUtil=require(_0x0697('0x15'));var db=require(_0x0697('0x16'))['db'];function respondWithStatusCode(_0x3a08d2,_0x24cd1d){_0x24cd1d=_0x24cd1d||0xcc;return function(_0x2d57db){if(_0x2d57db){return _0x3a08d2[_0x0697('0x17')](_0x24cd1d);}return _0x3a08d2['status'](_0x24cd1d)[_0x0697('0x18')]();};}function respondWithResult(_0x5adb23,_0x46a872){_0x46a872=_0x46a872||0xc8;return function(_0x53e732){if(_0x53e732){return _0x5adb23[_0x0697('0x19')](_0x46a872)[_0x0697('0x1a')](_0x53e732);}};}function respondWithFilteredResult(_0x4d052a,_0x9412f1){return function(_0x55109d){if(_0x55109d){var _0x45658b=typeof _0x9412f1['offset']===_0x0697('0x1b')&&typeof _0x9412f1[_0x0697('0x1c')]==='undefined';var _0x410acc=_0x55109d['count'];var _0x1e9faa=_0x45658b?0x0:_0x9412f1[_0x0697('0x1d')];var _0x10985f=_0x45658b?_0x55109d[_0x0697('0x1e')]:_0x9412f1['offset']+_0x9412f1['limit'];var _0x18da83;if(_0x10985f>=_0x410acc){_0x10985f=_0x410acc;_0x18da83=0xc8;}else{_0x18da83=0xce;}_0x4d052a[_0x0697('0x19')](_0x18da83);return _0x4d052a[_0x0697('0x1f')](_0x0697('0x20'),_0x1e9faa+'-'+_0x10985f+'/'+_0x410acc)['json'](_0x55109d);}return null;};}function patchUpdates(_0x115557){return function(_0x1ada4d){try{jsonpatch[_0x0697('0x21')](_0x1ada4d,_0x115557,!![]);}catch(_0x25778d){return BPromise[_0x0697('0x22')](_0x25778d);}return _0x1ada4d['save']();};}function saveUpdates(_0x2f10fd,_0x4a52c3){return function(_0x285477){if(_0x285477){return _0x285477[_0x0697('0x23')](_0x2f10fd)[_0x0697('0x24')](function(_0x103955){return _0x103955;});}return null;};}function removeEntity(_0x466ac3,_0x12ea57){return function(_0x4f8663){if(_0x4f8663){return _0x4f8663[_0x0697('0x25')]()[_0x0697('0x24')](function(){_0x466ac3[_0x0697('0x19')](0xcc)[_0x0697('0x18')]();});}};}function handleEntityNotFound(_0x389b5d,_0x5a496b){return function(_0x1618bc){if(!_0x1618bc){_0x389b5d['sendStatus'](0x194);}return _0x1618bc;};}function handleError(_0x5a8c56,_0x349dad){_0x349dad=_0x349dad||0x1f4;return function(_0x10764d){logger['error'](_0x10764d[_0x0697('0x26')]);if(_0x10764d[_0x0697('0x27')]){delete _0x10764d[_0x0697('0x27')];}_0x5a8c56[_0x0697('0x19')](_0x349dad)[_0x0697('0x28')](_0x10764d);};}exports['index']=function(_0x5b92eb,_0xeb0204){var _0x367535={},_0xed7536={},_0x1c868c={'count':0x0,'rows':[]};var _0x4d142f=_['map'](db[_0x0697('0x29')][_0x0697('0x2a')],function(_0x2f97a4){return{'name':_0x2f97a4['fieldName'],'type':_0x2f97a4[_0x0697('0x2b')][_0x0697('0x2c')]};});_0xed7536['model']=_['map'](_0x4d142f,_0x0697('0x27'));_0xed7536['query']=_['keys'](_0x5b92eb[_0x0697('0x2d')]);_0xed7536[_0x0697('0x2e')]=_[_0x0697('0x2f')](_0xed7536[_0x0697('0x30')],_0xed7536[_0x0697('0x2d')]);_0x367535[_0x0697('0x31')]=_[_0x0697('0x2f')](_0xed7536[_0x0697('0x30')],qs[_0x0697('0x32')](_0x5b92eb[_0x0697('0x2d')][_0x0697('0x32')]));_0x367535['attributes']=_0x367535['attributes']['length']?_0x367535[_0x0697('0x31')]:_0xed7536[_0x0697('0x30')];if(!_0x5b92eb[_0x0697('0x2d')][_0x0697('0x33')]('nolimit')){_0x367535['limit']=qs[_0x0697('0x1c')](_0x5b92eb[_0x0697('0x2d')]['limit']);_0x367535[_0x0697('0x1d')]=qs['offset'](_0x5b92eb[_0x0697('0x2d')]['offset']);}_0x367535[_0x0697('0x34')]=qs[_0x0697('0x35')](_0x5b92eb[_0x0697('0x2d')][_0x0697('0x35')]);_0x367535[_0x0697('0x36')]=qs[_0x0697('0x2e')](_[_0x0697('0x37')](_0x5b92eb[_0x0697('0x2d')],_0xed7536[_0x0697('0x2e')]),_0x4d142f);if(_0x5b92eb[_0x0697('0x2d')][_0x0697('0x38')]){_0x367535[_0x0697('0x36')]=_[_0x0697('0x39')](_0x367535[_0x0697('0x36')],{'$or':_['map'](_0x4d142f,function(_0x439b8f){if(_0x439b8f[_0x0697('0x2b')]!=='VIRTUAL'){var _0x5b7bb5={};_0x5b7bb5[_0x439b8f['name']]={'$like':'%'+_0x5b92eb[_0x0697('0x2d')][_0x0697('0x38')]+'%'};return _0x5b7bb5;}})});}_0x367535=_['merge']({},_0x367535,_0x5b92eb[_0x0697('0x3a')]);var _0x5203c9={'where':_0x367535['where']};return db[_0x0697('0x29')][_0x0697('0x1e')](_0x5203c9)[_0x0697('0x24')](function(_0x34d138){_0x1c868c[_0x0697('0x1e')]=_0x34d138;if(_0x5b92eb[_0x0697('0x2d')][_0x0697('0x3b')]){_0x367535[_0x0697('0x3c')]=[{'all':!![]}];}return db['Automation'][_0x0697('0x3d')](_0x367535);})[_0x0697('0x24')](function(_0xed21fc){_0x1c868c['rows']=_0xed21fc;return _0x1c868c;})[_0x0697('0x24')](respondWithFilteredResult(_0xeb0204,_0x367535))['catch'](handleError(_0xeb0204,null));};exports['show']=function(_0x3ef2bb,_0x429944){var _0x2a20fa={'raw':![],'where':{'id':_0x3ef2bb[_0x0697('0x3e')]['id']}},_0x21504f={};_0x21504f[_0x0697('0x30')]=_['keys'](db[_0x0697('0x29')][_0x0697('0x2a')]);_0x21504f[_0x0697('0x2d')]=_[_0x0697('0x3f')](_0x3ef2bb['query']);_0x21504f[_0x0697('0x2e')]=_[_0x0697('0x2f')](_0x21504f['model'],_0x21504f[_0x0697('0x2d')]);_0x2a20fa[_0x0697('0x31')]=_[_0x0697('0x2f')](_0x21504f[_0x0697('0x30')],qs[_0x0697('0x32')](_0x3ef2bb[_0x0697('0x2d')][_0x0697('0x32')]));_0x2a20fa[_0x0697('0x31')]=_0x2a20fa[_0x0697('0x31')][_0x0697('0x40')]?_0x2a20fa[_0x0697('0x31')]:_0x21504f[_0x0697('0x30')];if(_0x3ef2bb[_0x0697('0x2d')]['includeAll']){_0x2a20fa[_0x0697('0x3c')]=[{'all':!![]}];}_0x2a20fa=_[_0x0697('0x39')]({},_0x2a20fa,_0x3ef2bb[_0x0697('0x3a')]);return db['Automation'][_0x0697('0x41')](_0x2a20fa)[_0x0697('0x24')](handleEntityNotFound(_0x429944,null))[_0x0697('0x24')](respondWithResult(_0x429944,null))['catch'](handleError(_0x429944,null));};exports[_0x0697('0x42')]=function(_0x2c46e0,_0x524cc5){return db[_0x0697('0x29')][_0x0697('0x42')](_0x2c46e0[_0x0697('0x43')],{})[_0x0697('0x24')](respondWithResult(_0x524cc5,0xc9))[_0x0697('0x44')](handleError(_0x524cc5,null));};exports[_0x0697('0x23')]=function(_0xbfc5ba,_0x1f8271){if(_0xbfc5ba[_0x0697('0x43')]['id']){delete _0xbfc5ba[_0x0697('0x43')]['id'];}return db['Automation'][_0x0697('0x41')]({'where':{'id':_0xbfc5ba[_0x0697('0x3e')]['id']}})[_0x0697('0x24')](handleEntityNotFound(_0x1f8271,null))[_0x0697('0x24')](saveUpdates(_0xbfc5ba[_0x0697('0x43')],null))[_0x0697('0x24')](respondWithResult(_0x1f8271,null))[_0x0697('0x44')](handleError(_0x1f8271,null));};exports['destroy']=function(_0x3e7a60,_0xead16f){return db['Automation']['find']({'where':{'id':_0x3e7a60[_0x0697('0x3e')]['id']}})[_0x0697('0x24')](handleEntityNotFound(_0xead16f,null))[_0x0697('0x24')](removeEntity(_0xead16f,null))[_0x0697('0x44')](handleError(_0xead16f,null));};exports[_0x0697('0x45')]=function(_0x510690,_0x26eb75,_0x3e7cd3){return db[_0x0697('0x46')][_0x0697('0x41')]({'where':{'id':_0x510690[_0x0697('0x3e')]['id']}})[_0x0697('0x24')](handleEntityNotFound(_0x26eb75,null))['then'](function(_0x418ac2){if(_0x418ac2){return _0x418ac2[_0x0697('0x45')](_0x510690[_0x0697('0x43')]['ids'],_[_0x0697('0x47')](_0x510690[_0x0697('0x43')],[_0x0697('0x48'),'id'])||{});}})[_0x0697('0x24')](respondWithResult(_0x26eb75,null))[_0x0697('0x44')](handleError(_0x26eb75,null));};exports[_0x0697('0x49')]=function(_0x21ce33,_0x380d56,_0x532189){var _0x26da10={};var _0x34ccdb={};var _0xcc3d68;var _0x1b7191;return db[_0x0697('0x29')][_0x0697('0x4a')]({'where':{'id':_0x21ce33[_0x0697('0x3e')]['id']}})['then'](handleEntityNotFound(_0x380d56,null))[_0x0697('0x24')](function(_0x21201e){if(_0x21201e){_0xcc3d68=_0x21201e;_0x34ccdb['model']=_[_0x0697('0x3f')](db[_0x0697('0x46')][_0x0697('0x2a')]);_0x34ccdb[_0x0697('0x2d')]=_[_0x0697('0x3f')](_0x21ce33[_0x0697('0x2d')]);_0x34ccdb[_0x0697('0x2e')]=_['intersection'](_0x34ccdb[_0x0697('0x30')],_0x34ccdb[_0x0697('0x2d')]);_0x26da10[_0x0697('0x31')]=_[_0x0697('0x2f')](_0x34ccdb[_0x0697('0x30')],qs[_0x0697('0x32')](_0x21ce33[_0x0697('0x2d')][_0x0697('0x32')]));_0x26da10['attributes']=_0x26da10[_0x0697('0x31')][_0x0697('0x40')]?_0x26da10['attributes']:_0x34ccdb[_0x0697('0x30')];_0x26da10[_0x0697('0x34')]=qs[_0x0697('0x35')](_0x21ce33['query'][_0x0697('0x35')]);_0x26da10[_0x0697('0x36')]=qs[_0x0697('0x2e')](_['pick'](_0x21ce33[_0x0697('0x2d')],_0x34ccdb['filters']));if(_0x21ce33['query'][_0x0697('0x38')]){_0x26da10[_0x0697('0x36')]=_[_0x0697('0x39')](_0x26da10[_0x0697('0x36')],{'$or':_[_0x0697('0x4b')](_0x26da10[_0x0697('0x31')],function(_0x251876){var _0x12273={};_0x12273[_0x251876]={'$like':'%'+_0x21ce33['query'][_0x0697('0x38')]+'%'};return _0x12273;})});}_0x26da10=_[_0x0697('0x39')]({},_0x26da10,_0x21ce33[_0x0697('0x3a')]);return _0xcc3d68[_0x0697('0x49')](_0x26da10);}})['then'](function(_0x499aa7){if(_0x499aa7){_0x1b7191=_0x499aa7[_0x0697('0x40')];if(!_0x21ce33['query']['hasOwnProperty'](_0x0697('0x4c'))){_0x26da10[_0x0697('0x1c')]=qs[_0x0697('0x1c')](_0x21ce33[_0x0697('0x2d')]['limit']);_0x26da10[_0x0697('0x1d')]=qs[_0x0697('0x1d')](_0x21ce33['query'][_0x0697('0x1d')]);}return _0xcc3d68[_0x0697('0x49')](_0x26da10);}})[_0x0697('0x24')](function(_0x3c0b5a){if(_0x3c0b5a){return _0x3c0b5a?{'count':_0x1b7191,'rows':_0x3c0b5a}:null;}})[_0x0697('0x24')](respondWithResult(_0x380d56,null))[_0x0697('0x44')](handleError(_0x380d56,null));};exports[_0x0697('0x4d')]=function(_0x33716e,_0x45797c,_0x3f4662){return db['Action'][_0x0697('0x41')]({'where':{'id':_0x33716e[_0x0697('0x3e')]['id']}})[_0x0697('0x24')](handleEntityNotFound(_0x45797c,null))[_0x0697('0x24')](function(_0x5bec53){if(_0x5bec53){return _0x5bec53[_0x0697('0x4d')](_0x33716e['body']['ids'],_['omit'](_0x33716e[_0x0697('0x43')],[_0x0697('0x48'),'id'])||{});}})[_0x0697('0x24')](respondWithResult(_0x45797c,null))[_0x0697('0x44')](handleError(_0x45797c,null));};exports[_0x0697('0x4e')]=function(_0x3c35ff,_0x31ceb3,_0x103475){var _0x1d849a={};var _0x24b024={};var _0x23b53d;var _0x137a9c;return db[_0x0697('0x29')][_0x0697('0x4a')]({'where':{'id':_0x3c35ff[_0x0697('0x3e')]['id']}})['then'](handleEntityNotFound(_0x31ceb3,null))[_0x0697('0x24')](function(_0x207e8c){if(_0x207e8c){_0x23b53d=_0x207e8c;_0x24b024[_0x0697('0x30')]=_[_0x0697('0x3f')](db[_0x0697('0x4f')][_0x0697('0x2a')]);_0x24b024[_0x0697('0x2d')]=_[_0x0697('0x3f')](_0x3c35ff[_0x0697('0x2d')]);_0x24b024[_0x0697('0x2e')]=_[_0x0697('0x2f')](_0x24b024['model'],_0x24b024[_0x0697('0x2d')]);_0x1d849a[_0x0697('0x31')]=_['intersection'](_0x24b024[_0x0697('0x30')],qs[_0x0697('0x32')](_0x3c35ff[_0x0697('0x2d')][_0x0697('0x32')]));_0x1d849a[_0x0697('0x31')]=_0x1d849a[_0x0697('0x31')][_0x0697('0x40')]?_0x1d849a[_0x0697('0x31')]:_0x24b024[_0x0697('0x30')];_0x1d849a['order']=qs[_0x0697('0x35')](_0x3c35ff[_0x0697('0x2d')]['sort']);_0x1d849a['where']=qs[_0x0697('0x2e')](_[_0x0697('0x37')](_0x3c35ff[_0x0697('0x2d')],_0x24b024['filters']));if(_0x3c35ff[_0x0697('0x2d')][_0x0697('0x38')]){_0x1d849a[_0x0697('0x36')]=_[_0x0697('0x39')](_0x1d849a[_0x0697('0x36')],{'$or':_[_0x0697('0x4b')](_0x1d849a[_0x0697('0x31')],function(_0x3745f1){var _0x472972={};_0x472972[_0x3745f1]={'$like':'%'+_0x3c35ff[_0x0697('0x2d')][_0x0697('0x38')]+'%'};return _0x472972;})});}_0x1d849a=_[_0x0697('0x39')]({},_0x1d849a,_0x3c35ff['options']);return _0x23b53d[_0x0697('0x4e')](_0x1d849a);}})[_0x0697('0x24')](function(_0x1df6db){if(_0x1df6db){_0x137a9c=_0x1df6db[_0x0697('0x40')];if(!_0x3c35ff[_0x0697('0x2d')][_0x0697('0x33')](_0x0697('0x4c'))){_0x1d849a['limit']=qs[_0x0697('0x1c')](_0x3c35ff[_0x0697('0x2d')]['limit']);_0x1d849a[_0x0697('0x1d')]=qs['offset'](_0x3c35ff['query'][_0x0697('0x1d')]);}return _0x23b53d[_0x0697('0x4e')](_0x1d849a);}})[_0x0697('0x24')](function(_0x20e265){if(_0x20e265){return _0x20e265?{'count':_0x137a9c,'rows':_0x20e265}:null;}})['then'](respondWithResult(_0x31ceb3,null))['catch'](handleError(_0x31ceb3,null));};
\ No newline at end of file
+var _0x9e41=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','then','include','findAll','rows','catch','params','includeAll','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x55256b,_0x28779f){var _0x2b03f2=function(_0x24148c){while(--_0x24148c){_0x55256b['push'](_0x55256b['shift']());}};_0x2b03f2(++_0x28779f);}(_0x9e41,0x101));var _0x19e4=function(_0x4f02e9,_0x1ac79c){_0x4f02e9=_0x4f02e9-0x0;var _0x111b56=_0x9e41[_0x4f02e9];return _0x111b56;};'use strict';var emlformat=require(_0x19e4('0x0'));var rimraf=require(_0x19e4('0x1'));var zipdir=require(_0x19e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19e4('0x3'));var moment=require(_0x19e4('0x4'));var BPromise=require(_0x19e4('0x5'));var Mustache=require(_0x19e4('0x6'));var util=require(_0x19e4('0x7'));var path=require(_0x19e4('0x8'));var sox=require(_0x19e4('0x9'));var csv=require(_0x19e4('0xa'));var ejs=require(_0x19e4('0xb'));var fs=require('fs');var fs_extra=require(_0x19e4('0xc'));var _=require(_0x19e4('0xd'));var squel=require(_0x19e4('0xe'));var crypto=require('crypto');var jsforce=require(_0x19e4('0xf'));var deskjs=require(_0x19e4('0x10'));var toCsv=require(_0x19e4('0xa'));var querystring=require(_0x19e4('0x11'));var Papa=require(_0x19e4('0x12'));var Redis=require(_0x19e4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x19e4('0x14'));var as=require(_0x19e4('0x15'));var hardwareService=require(_0x19e4('0x16'));var logger=require(_0x19e4('0x17'))(_0x19e4('0x18'));var utils=require(_0x19e4('0x19'));var config=require(_0x19e4('0x1a'));var licenseUtil=require(_0x19e4('0x1b'));var db=require(_0x19e4('0x1c'))['db'];function respondWithStatusCode(_0x15b8df,_0x4f6a83){_0x4f6a83=_0x4f6a83||0xcc;return function(_0x164e4e){if(_0x164e4e){return _0x15b8df[_0x19e4('0x1d')](_0x4f6a83);}return _0x15b8df[_0x19e4('0x1e')](_0x4f6a83)['end']();};}function respondWithResult(_0x184bb4,_0x444d85){_0x444d85=_0x444d85||0xc8;return function(_0x4adb04){if(_0x4adb04){return _0x184bb4[_0x19e4('0x1e')](_0x444d85)[_0x19e4('0x1f')](_0x4adb04);}};}function respondWithFilteredResult(_0x5ea7c6,_0x337e33){return function(_0x59c48c){if(_0x59c48c){var _0x1b5ad1=typeof _0x337e33['offset']===_0x19e4('0x20')&&typeof _0x337e33[_0x19e4('0x21')]==='undefined';var _0xda24d=_0x59c48c['count'];var _0x27dd49=_0x1b5ad1?0x0:_0x337e33[_0x19e4('0x22')];var _0x4a5137=_0x1b5ad1?_0x59c48c['count']:_0x337e33['offset']+_0x337e33['limit'];var _0x38c793;if(_0x4a5137>=_0xda24d){_0x4a5137=_0xda24d;_0x38c793=0xc8;}else{_0x38c793=0xce;}_0x5ea7c6[_0x19e4('0x1e')](_0x38c793);return _0x5ea7c6[_0x19e4('0x23')](_0x19e4('0x24'),_0x27dd49+'-'+_0x4a5137+'/'+_0xda24d)['json'](_0x59c48c);}return null;};}function patchUpdates(_0x371a18){return function(_0x22a456){try{jsonpatch['apply'](_0x22a456,_0x371a18,!![]);}catch(_0x45c7f4){return BPromise[_0x19e4('0x25')](_0x45c7f4);}return _0x22a456[_0x19e4('0x26')]();};}function saveUpdates(_0x3293b2,_0x50b8fd){return function(_0xa05a00){if(_0xa05a00){return _0xa05a00[_0x19e4('0x27')](_0x3293b2)['then'](function(_0x56a070){return _0x56a070;});}return null;};}function removeEntity(_0x5e7527,_0x9ee83b){return function(_0x214449){if(_0x214449){return _0x214449[_0x19e4('0x28')]()['then'](function(){_0x5e7527[_0x19e4('0x1e')](0xcc)[_0x19e4('0x29')]();});}};}function handleEntityNotFound(_0x45275d,_0x20b260){return function(_0x3b2904){if(!_0x3b2904){_0x45275d['sendStatus'](0x194);}return _0x3b2904;};}function handleError(_0xc1bbe2,_0x24a408){_0x24a408=_0x24a408||0x1f4;return function(_0x1b1051){logger[_0x19e4('0x2a')](_0x1b1051[_0x19e4('0x2b')]);if(_0x1b1051[_0x19e4('0x2c')]){delete _0x1b1051[_0x19e4('0x2c')];}_0xc1bbe2[_0x19e4('0x1e')](_0x24a408)[_0x19e4('0x2d')](_0x1b1051);};}exports[_0x19e4('0x2e')]=function(_0x6eb957,_0x8be049){var _0x3f6224={},_0xf68ed5={},_0x3fe363={'count':0x0,'rows':[]};var _0x464e8a=_[_0x19e4('0x2f')](db[_0x19e4('0x30')][_0x19e4('0x31')],function(_0x42e111){return{'name':_0x42e111[_0x19e4('0x32')],'type':_0x42e111[_0x19e4('0x33')][_0x19e4('0x34')]};});_0xf68ed5['model']=_[_0x19e4('0x2f')](_0x464e8a,'name');_0xf68ed5['query']=_[_0x19e4('0x35')](_0x6eb957[_0x19e4('0x36')]);_0xf68ed5[_0x19e4('0x37')]=_[_0x19e4('0x38')](_0xf68ed5[_0x19e4('0x39')],_0xf68ed5[_0x19e4('0x36')]);_0x3f6224[_0x19e4('0x3a')]=_[_0x19e4('0x38')](_0xf68ed5[_0x19e4('0x39')],qs[_0x19e4('0x3b')](_0x6eb957['query'][_0x19e4('0x3b')]));_0x3f6224[_0x19e4('0x3a')]=_0x3f6224[_0x19e4('0x3a')][_0x19e4('0x3c')]?_0x3f6224[_0x19e4('0x3a')]:_0xf68ed5[_0x19e4('0x39')];if(!_0x6eb957[_0x19e4('0x36')]['hasOwnProperty'](_0x19e4('0x3d'))){_0x3f6224[_0x19e4('0x21')]=qs[_0x19e4('0x21')](_0x6eb957['query'][_0x19e4('0x21')]);_0x3f6224['offset']=qs[_0x19e4('0x22')](_0x6eb957[_0x19e4('0x36')]['offset']);}_0x3f6224[_0x19e4('0x3e')]=qs[_0x19e4('0x3f')](_0x6eb957[_0x19e4('0x36')]['sort']);_0x3f6224[_0x19e4('0x40')]=qs['filters'](_[_0x19e4('0x41')](_0x6eb957[_0x19e4('0x36')],_0xf68ed5['filters']),_0x464e8a);if(_0x6eb957[_0x19e4('0x36')][_0x19e4('0x42')]){_0x3f6224[_0x19e4('0x40')]=_[_0x19e4('0x43')](_0x3f6224['where'],{'$or':_['map'](_0x464e8a,function(_0x27c81b){if(_0x27c81b['type']!==_0x19e4('0x44')){var _0x4e1221={};_0x4e1221[_0x27c81b[_0x19e4('0x2c')]]={'$like':'%'+_0x6eb957['query']['filter']+'%'};return _0x4e1221;}})});}_0x3f6224=_['merge']({},_0x3f6224,_0x6eb957[_0x19e4('0x45')]);var _0x2e9ff4={'where':_0x3f6224[_0x19e4('0x40')]};return db[_0x19e4('0x30')][_0x19e4('0x46')](_0x2e9ff4)[_0x19e4('0x47')](function(_0x5e1b8b){_0x3fe363[_0x19e4('0x46')]=_0x5e1b8b;if(_0x6eb957[_0x19e4('0x36')]['includeAll']){_0x3f6224[_0x19e4('0x48')]=[{'all':!![]}];}return db[_0x19e4('0x30')][_0x19e4('0x49')](_0x3f6224);})[_0x19e4('0x47')](function(_0x5132c0){_0x3fe363[_0x19e4('0x4a')]=_0x5132c0;return _0x3fe363;})['then'](respondWithFilteredResult(_0x8be049,_0x3f6224))[_0x19e4('0x4b')](handleError(_0x8be049,null));};exports['show']=function(_0xb18265,_0x595bbd){var _0x1bdee6={'raw':![],'where':{'id':_0xb18265[_0x19e4('0x4c')]['id']}},_0x500c59={};_0x500c59['model']=_[_0x19e4('0x35')](db[_0x19e4('0x30')][_0x19e4('0x31')]);_0x500c59['query']=_[_0x19e4('0x35')](_0xb18265[_0x19e4('0x36')]);_0x500c59[_0x19e4('0x37')]=_[_0x19e4('0x38')](_0x500c59[_0x19e4('0x39')],_0x500c59[_0x19e4('0x36')]);_0x1bdee6[_0x19e4('0x3a')]=_['intersection'](_0x500c59[_0x19e4('0x39')],qs[_0x19e4('0x3b')](_0xb18265[_0x19e4('0x36')][_0x19e4('0x3b')]));_0x1bdee6[_0x19e4('0x3a')]=_0x1bdee6[_0x19e4('0x3a')]['length']?_0x1bdee6['attributes']:_0x500c59[_0x19e4('0x39')];if(_0xb18265[_0x19e4('0x36')][_0x19e4('0x4d')]){_0x1bdee6[_0x19e4('0x48')]=[{'all':!![]}];}_0x1bdee6=_[_0x19e4('0x43')]({},_0x1bdee6,_0xb18265[_0x19e4('0x45')]);return db['Automation']['find'](_0x1bdee6)['then'](handleEntityNotFound(_0x595bbd,null))[_0x19e4('0x47')](respondWithResult(_0x595bbd,null))[_0x19e4('0x4b')](handleError(_0x595bbd,null));};exports[_0x19e4('0x4e')]=function(_0x470ece,_0x33cb19){return db[_0x19e4('0x30')]['create'](_0x470ece[_0x19e4('0x4f')],{})[_0x19e4('0x47')](respondWithResult(_0x33cb19,0xc9))['catch'](handleError(_0x33cb19,null));};exports[_0x19e4('0x27')]=function(_0x261e09,_0x34fd7d){if(_0x261e09[_0x19e4('0x4f')]['id']){delete _0x261e09[_0x19e4('0x4f')]['id'];}return db[_0x19e4('0x30')][_0x19e4('0x50')]({'where':{'id':_0x261e09[_0x19e4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34fd7d,null))[_0x19e4('0x47')](saveUpdates(_0x261e09[_0x19e4('0x4f')],null))['then'](respondWithResult(_0x34fd7d,null))['catch'](handleError(_0x34fd7d,null));};exports[_0x19e4('0x28')]=function(_0xd32e8e,_0x3e94ed){return db['Automation'][_0x19e4('0x50')]({'where':{'id':_0xd32e8e[_0x19e4('0x4c')]['id']}})[_0x19e4('0x47')](handleEntityNotFound(_0x3e94ed,null))[_0x19e4('0x47')](removeEntity(_0x3e94ed,null))[_0x19e4('0x4b')](handleError(_0x3e94ed,null));};exports[_0x19e4('0x51')]=function(_0x24c457,_0xdd0912,_0x51e9f4){return db[_0x19e4('0x52')][_0x19e4('0x50')]({'where':{'id':_0x24c457[_0x19e4('0x4c')]['id']}})[_0x19e4('0x47')](handleEntityNotFound(_0xdd0912,null))['then'](function(_0x44cd59){if(_0x44cd59){return _0x44cd59[_0x19e4('0x51')](_0x24c457['body'][_0x19e4('0x53')],_[_0x19e4('0x54')](_0x24c457[_0x19e4('0x4f')],[_0x19e4('0x53'),'id'])||{});}})['then'](respondWithResult(_0xdd0912,null))[_0x19e4('0x4b')](handleError(_0xdd0912,null));};exports[_0x19e4('0x55')]=function(_0x3fcd3a,_0x37161c,_0x113b97){var _0x2a634d={};var _0x41ce6b={};var _0x3af5fa;var _0x53a89e;return db[_0x19e4('0x30')][_0x19e4('0x56')]({'where':{'id':_0x3fcd3a[_0x19e4('0x4c')]['id']}})[_0x19e4('0x47')](handleEntityNotFound(_0x37161c,null))[_0x19e4('0x47')](function(_0x1bf793){if(_0x1bf793){_0x3af5fa=_0x1bf793;_0x41ce6b[_0x19e4('0x39')]=_['keys'](db[_0x19e4('0x52')][_0x19e4('0x31')]);_0x41ce6b[_0x19e4('0x36')]=_['keys'](_0x3fcd3a[_0x19e4('0x36')]);_0x41ce6b[_0x19e4('0x37')]=_[_0x19e4('0x38')](_0x41ce6b[_0x19e4('0x39')],_0x41ce6b[_0x19e4('0x36')]);_0x2a634d['attributes']=_[_0x19e4('0x38')](_0x41ce6b[_0x19e4('0x39')],qs['fields'](_0x3fcd3a['query']['fields']));_0x2a634d['attributes']=_0x2a634d[_0x19e4('0x3a')][_0x19e4('0x3c')]?_0x2a634d[_0x19e4('0x3a')]:_0x41ce6b['model'];_0x2a634d[_0x19e4('0x3e')]=qs[_0x19e4('0x3f')](_0x3fcd3a[_0x19e4('0x36')][_0x19e4('0x3f')]);_0x2a634d[_0x19e4('0x40')]=qs[_0x19e4('0x37')](_['pick'](_0x3fcd3a[_0x19e4('0x36')],_0x41ce6b[_0x19e4('0x37')]));if(_0x3fcd3a['query'][_0x19e4('0x42')]){_0x2a634d['where']=_[_0x19e4('0x43')](_0x2a634d[_0x19e4('0x40')],{'$or':_['map'](_0x2a634d['attributes'],function(_0xfbaeed){var _0x2abf6d={};_0x2abf6d[_0xfbaeed]={'$like':'%'+_0x3fcd3a[_0x19e4('0x36')][_0x19e4('0x42')]+'%'};return _0x2abf6d;})});}_0x2a634d=_[_0x19e4('0x43')]({},_0x2a634d,_0x3fcd3a[_0x19e4('0x45')]);return _0x3af5fa[_0x19e4('0x55')](_0x2a634d);}})[_0x19e4('0x47')](function(_0x148e74){if(_0x148e74){_0x53a89e=_0x148e74[_0x19e4('0x3c')];if(!_0x3fcd3a['query'][_0x19e4('0x57')](_0x19e4('0x3d'))){_0x2a634d[_0x19e4('0x21')]=qs[_0x19e4('0x21')](_0x3fcd3a['query']['limit']);_0x2a634d['offset']=qs[_0x19e4('0x22')](_0x3fcd3a[_0x19e4('0x36')][_0x19e4('0x22')]);}return _0x3af5fa[_0x19e4('0x55')](_0x2a634d);}})[_0x19e4('0x47')](function(_0x327683){if(_0x327683){return _0x327683?{'count':_0x53a89e,'rows':_0x327683}:null;}})[_0x19e4('0x47')](respondWithResult(_0x37161c,null))[_0x19e4('0x4b')](handleError(_0x37161c,null));};exports[_0x19e4('0x58')]=function(_0x183b47,_0x3923c,_0xb115cf){return db[_0x19e4('0x59')][_0x19e4('0x50')]({'where':{'id':_0x183b47[_0x19e4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3923c,null))['then'](function(_0x21f686){if(_0x21f686){return _0x21f686[_0x19e4('0x58')](_0x183b47['body'][_0x19e4('0x53')],_['omit'](_0x183b47[_0x19e4('0x4f')],[_0x19e4('0x53'),'id'])||{});}})[_0x19e4('0x47')](respondWithResult(_0x3923c,null))[_0x19e4('0x4b')](handleError(_0x3923c,null));};exports['getActions']=function(_0x5aff32,_0x39af64,_0x5e898b){var _0x319116={};var _0x114a10={};var _0x21598d;var _0x4614bf;return db[_0x19e4('0x30')][_0x19e4('0x56')]({'where':{'id':_0x5aff32['params']['id']}})[_0x19e4('0x47')](handleEntityNotFound(_0x39af64,null))[_0x19e4('0x47')](function(_0x4dcb55){if(_0x4dcb55){_0x21598d=_0x4dcb55;_0x114a10['model']=_[_0x19e4('0x35')](db[_0x19e4('0x59')]['rawAttributes']);_0x114a10['query']=_[_0x19e4('0x35')](_0x5aff32['query']);_0x114a10[_0x19e4('0x37')]=_[_0x19e4('0x38')](_0x114a10[_0x19e4('0x39')],_0x114a10[_0x19e4('0x36')]);_0x319116[_0x19e4('0x3a')]=_[_0x19e4('0x38')](_0x114a10[_0x19e4('0x39')],qs['fields'](_0x5aff32[_0x19e4('0x36')][_0x19e4('0x3b')]));_0x319116[_0x19e4('0x3a')]=_0x319116[_0x19e4('0x3a')][_0x19e4('0x3c')]?_0x319116[_0x19e4('0x3a')]:_0x114a10[_0x19e4('0x39')];_0x319116[_0x19e4('0x3e')]=qs[_0x19e4('0x3f')](_0x5aff32[_0x19e4('0x36')][_0x19e4('0x3f')]);_0x319116['where']=qs[_0x19e4('0x37')](_['pick'](_0x5aff32['query'],_0x114a10[_0x19e4('0x37')]));if(_0x5aff32[_0x19e4('0x36')]['filter']){_0x319116[_0x19e4('0x40')]=_[_0x19e4('0x43')](_0x319116['where'],{'$or':_['map'](_0x319116[_0x19e4('0x3a')],function(_0x4b4468){var _0x1797bd={};_0x1797bd[_0x4b4468]={'$like':'%'+_0x5aff32['query']['filter']+'%'};return _0x1797bd;})});}_0x319116=_[_0x19e4('0x43')]({},_0x319116,_0x5aff32[_0x19e4('0x45')]);return _0x21598d[_0x19e4('0x5a')](_0x319116);}})[_0x19e4('0x47')](function(_0x3c9325){if(_0x3c9325){_0x4614bf=_0x3c9325[_0x19e4('0x3c')];if(!_0x5aff32[_0x19e4('0x36')]['hasOwnProperty'](_0x19e4('0x3d'))){_0x319116['limit']=qs[_0x19e4('0x21')](_0x5aff32[_0x19e4('0x36')][_0x19e4('0x21')]);_0x319116[_0x19e4('0x22')]=qs[_0x19e4('0x22')](_0x5aff32['query']['offset']);}return _0x21598d[_0x19e4('0x5a')](_0x319116);}})['then'](function(_0x48982e){if(_0x48982e){return _0x48982e?{'count':_0x4614bf,'rows':_0x48982e}:null;}})[_0x19e4('0x47')](respondWithResult(_0x39af64,null))['catch'](handleError(_0x39af64,null));};
\ No newline at end of file
index e5c5ede..2524e2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x801d=['tools_automations','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','Automation'];(function(_0x11a090,_0x79d6f8){var _0x1ff92e=function(_0x23064e){while(--_0x23064e){_0x11a090['push'](_0x11a090['shift']());}};_0x1ff92e(++_0x79d6f8);}(_0x801d,0x64));var _0xd801=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x801d[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0xd801('0x0'));var logger=require(_0xd801('0x1'))(_0xd801('0x2'));var moment=require(_0xd801('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd801('0x4'));var rimraf=require(_0xd801('0x5'));var config=require(_0xd801('0x6'));var attributes=require('./automation.attributes');module[_0xd801('0x7')]=function(_0x67483c,_0x377cb9){return _0x67483c[_0xd801('0x8')](_0xd801('0x9'),attributes,{'tableName':_0xd801('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe261=['moment','path','rimraf','../../config/environment','./automation.attributes','define','lodash','api'];(function(_0x325bc4,_0x4df462){var _0x330091=function(_0x22db60){while(--_0x22db60){_0x325bc4['push'](_0x325bc4['shift']());}};_0x330091(++_0x4df462);}(_0xe261,0xe6));var _0x1e26=function(_0x5d7b9f,_0x5b504a){_0x5d7b9f=_0x5d7b9f-0x0;var _0x53df66=_0xe261[_0x5d7b9f];return _0x53df66;};'use strict';var _=require(_0x1e26('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1e26('0x1'));var moment=require(_0x1e26('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e26('0x3'));var rimraf=require(_0x1e26('0x4'));var config=require(_0x1e26('0x5'));var attributes=require(_0x1e26('0x6'));module['exports']=function(_0x23af66,_0x4b37b0){return _0x23af66[_0x1e26('0x7')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4136111..2455ef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3870=['Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x3870,0x146));var _0x0387=function(_0x596f53,_0x769795){_0x596f53=_0x596f53-0x0;var _0x1d9466=_0x3870[_0x596f53];return _0x1d9466;};'use strict';var _=require(_0x0387('0x0'));var util=require(_0x0387('0x1'));var moment=require(_0x0387('0x2'));var BPromise=require('bluebird');var rs=require(_0x0387('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0387('0x4'))['db'];var utils=require(_0x0387('0x5'));var logger=require('../../config/logger')(_0x0387('0x6'));var config=require(_0x0387('0x7'));var jayson=require(_0x0387('0x8'));var client=jayson['client'][_0x0387('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25209b,_0x3169b6,_0x13073a){return new BPromise(function(_0x594efe,_0x46bbf2){return client[_0x0387('0xa')](_0x25209b,_0x13073a)[_0x0387('0xb')](function(_0x566566){logger[_0x0387('0xc')]('Automation,\x20%s,\x20%s',_0x3169b6,'request\x20sent');logger[_0x0387('0xd')](_0x0387('0xe'),_0x3169b6,_0x0387('0xf'),JSON[_0x0387('0x10')](_0x566566));if(_0x566566[_0x0387('0x11')]){if(_0x566566['error'][_0x0387('0x12')]===0x1f4){logger[_0x0387('0x11')](_0x0387('0x13'),_0x3169b6,_0x566566['error']['message']);return _0x46bbf2(_0x566566[_0x0387('0x11')][_0x0387('0x14')]);}logger['error']('Automation,\x20%s,\x20%s',_0x3169b6,_0x566566[_0x0387('0x11')][_0x0387('0x14')]);return _0x594efe(_0x566566[_0x0387('0x11')]['message']);}else{logger['info'](_0x0387('0x13'),_0x3169b6,'request\x20sent');_0x594efe(_0x566566[_0x0387('0x15')]['message']);}})[_0x0387('0x16')](function(_0x246fd0){logger[_0x0387('0x11')](_0x0387('0x13'),_0x3169b6,_0x246fd0);_0x46bbf2(_0x246fd0);});});}
\ No newline at end of file
+var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x35b70f,_0x29492d){var _0x4fdd28=function(_0x38e91e){while(--_0x38e91e){_0x35b70f['push'](_0x35b70f['shift']());}};_0x4fdd28(++_0x29492d);}(_0x14a0,0x8e));var _0x014a=function(_0x37c0f8,_0x4fe3ce){_0x37c0f8=_0x37c0f8-0x0;var _0x2bad68=_0x14a0[_0x37c0f8];return _0x2bad68;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Automation,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Automation,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});}
\ No newline at end of file
index e7bdfa0..1634944 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80d9=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','/:id/actions','getActions','post','create','addConditions','addActions','put','/:id','update','delete','destroy'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x80d9,0xb6));var _0x980d=function(_0x55ea15,_0x158830){_0x55ea15=_0x55ea15-0x0;var _0x381060=_0x80d9[_0x55ea15];return _0x381060;};'use strict';var multer=require(_0x980d('0x0'));var util=require(_0x980d('0x1'));var path=require(_0x980d('0x2'));var timeout=require(_0x980d('0x3'));var express=require(_0x980d('0x4'));var router=express[_0x980d('0x5')]();var fs_extra=require(_0x980d('0x6'));var auth=require(_0x980d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x980d('0x8'));var controller=require(_0x980d('0x9'));router[_0x980d('0xa')]('/',auth[_0x980d('0xb')](),controller[_0x980d('0xc')]);router[_0x980d('0xa')]('/:id',auth[_0x980d('0xb')](),controller[_0x980d('0xd')]);router[_0x980d('0xa')](_0x980d('0xe'),auth[_0x980d('0xb')](),controller['getConditions']);router[_0x980d('0xa')](_0x980d('0xf'),auth[_0x980d('0xb')](),controller[_0x980d('0x10')]);router[_0x980d('0x11')]('/',auth[_0x980d('0xb')](),controller[_0x980d('0x12')]);router['post'](_0x980d('0xe'),auth[_0x980d('0xb')](),controller[_0x980d('0x13')]);router['post'](_0x980d('0xf'),auth[_0x980d('0xb')](),controller[_0x980d('0x14')]);router[_0x980d('0x15')](_0x980d('0x16'),auth['isAuthenticated'](),controller[_0x980d('0x17')]);router[_0x980d('0x18')](_0x980d('0x16'),auth[_0x980d('0xb')](),controller[_0x980d('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x54ef=['/:id','show','/:id/conditions','isAuthenticated','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','index','get'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x54ef,0x112));var _0xf54e=function(_0x5a0622,_0x12b419){_0x5a0622=_0x5a0622-0x0;var _0x448119=_0x54ef[_0x5a0622];return _0x448119;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var fs_extra=require(_0xf54e('0x5'));var auth=require(_0xf54e('0x6'));var interaction=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var controller=require(_0xf54e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf54e('0xa')]);router[_0xf54e('0xb')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router['get'](_0xf54e('0xe'),auth[_0xf54e('0xf')](),controller['getConditions']);router[_0xf54e('0xb')](_0xf54e('0x10'),auth[_0xf54e('0xf')](),controller[_0xf54e('0x11')]);router['post']('/',auth[_0xf54e('0xf')](),controller[_0xf54e('0x12')]);router[_0xf54e('0x13')](_0xf54e('0xe'),auth['isAuthenticated'](),controller[_0xf54e('0x14')]);router['post']('/:id/actions',auth[_0xf54e('0xf')](),controller[_0xf54e('0x15')]);router[_0xf54e('0x16')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0x17')]);router[_0xf54e('0x18')](_0xf54e('0xc'),auth[_0xf54e('0xf')](),controller['destroy']);module[_0xf54e('0x19')]=router;
\ No newline at end of file
index d7264ec..474e6c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd159=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr'];(function(_0x3065bf,_0x29c51e){var _0x3a8ff=function(_0x5ea996){while(--_0x5ea996){_0x3065bf['push'](_0x3065bf['shift']());}};_0x3a8ff(++_0x29c51e);}(_0xd159,0x19d));var _0x9d15=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd159[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x9d15('0x0'));module[_0x9d15('0x1')]={'name':{'type':Sequelize[_0x9d15('0x2')],'unique':_0x9d15('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x9d15('0x4')),'allowNull':![],'defaultValue':_0x9d15('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9d15('0x5')],'defaultValue':0x0,'comment':_0x9d15('0x6')},'limitCalls':{'type':Sequelize[_0x9d15('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x9d15('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9d15('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9d15('0x7')](0x3)[_0x9d15('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x9d15('0x7')](0x3)[_0x9d15('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d15('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9d15('0x7')](0x5)[_0x9d15('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d15('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x9d15('0x7')](0x3)[_0x9d15('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x9d15('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d15('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9d15('0x7')](0x3)[_0x9d15('0x9')],'defaultValue':0x3,'comment':_0x9d15('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9d15('0x7')](0x5)[_0x9d15('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d15('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9d15('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9d15('0xf')},'dialTimezone':{'type':Sequelize[_0x9d15('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9d15('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x9d15('0x11'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9d15('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x9d15('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9d15('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x9d15('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9d15('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9d15('0x7')](0x9)[_0x9d15('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9d15('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9d15('0x7')](0x9)[_0x9d15('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9d15('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x9d15('0x7')](0x9)[_0x9d15('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9d15('0x7')](0x9)[_0x9d15('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x9d15('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9d15('0x7')](0x5)[_0x9d15('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9d15('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9d15('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9d15('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9d15('0x19')](_0x9d15('0x1a'),_0x9d15('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x9d15('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9d15('0x1c')},'dialCutDigit':{'type':Sequelize[_0x9d15('0x7')](0x3)[_0x9d15('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9d15('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d15('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d15('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x9d15('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d15('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x9d15('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d15('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9d15('0x7')](0x3)[_0x9d15('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d15('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9d15('0x7')](0x5)[_0x9d15('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d15('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x9d15('0x7')](0x3)[_0x9d15('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x9d15('0x7')](0x5)[_0x9d15('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9d15('0x7')](0x3)[_0x9d15('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d15('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9d15('0x7')](0x5)[_0x9d15('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d15('0x25')}};
\ No newline at end of file
+var _0x03cb=['#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)','#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)','name','ENUM','ivr','STRING','BOOLEAN','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\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','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x3492c8,_0x5a40aa){var _0xf3e965=function(_0x4f7ee9){while(--_0x4f7ee9){_0x3492c8['push'](_0x3492c8['shift']());}};_0xf3e965(++_0x5a40aa);}(_0x03cb,0x1dc));var _0xb03c=function(_0x359316,_0x57f2bf){_0x359316=_0x359316-0x0;var _0x76842b=_0x03cb[_0x359316];return _0x76842b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb03c('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb03c('0x1')](_0xb03c('0x2')),'allowNull':![],'defaultValue':_0xb03c('0x2')},'description':{'type':Sequelize[_0xb03c('0x3')]},'active':{'type':Sequelize[_0xb03c('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xb03c('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb03c('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x9')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb03c('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb03c('0xc')},'dialTimezone':{'type':Sequelize[_0xb03c('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb03c('0x3')],'defaultValue':_0xb03c('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xb03c('0x1')](_0xb03c('0xe'),'never',_0xb03c('0xf')),'defaultValue':_0xb03c('0xe')},'dialAMDActive':{'type':Sequelize[_0xb03c('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb03c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb03c('0x10')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb03c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb03c('0x11')},'dialAMDMinWordLength':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb03c('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb03c('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb03c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb03c('0x6')](0x5)[_0xb03c('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb03c('0x14')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb03c('0x1')]('DESC',_0xb03c('0x15')),'defaultValue':_0xb03c('0x16')},'dialPrefix':{'type':Sequelize[_0xb03c('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb03c('0x17')},'dialCutDigit':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb03c('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0x1c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0x1d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x1e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
index be79a2b..c377e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41ba=['onlyIfOpen','cm_contacts','phone\x20IS\x20NOT\x20NULL','insert','push','sequelize','all','removeLists','CmList','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','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','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','params','find','create','body','user','role','UserProfileSection','catch','clone','length','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','filters','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','include','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)'];(function(_0x55dcb5,_0x2f54db){var _0x5d3294=function(_0x23184d){while(--_0x23184d){_0x55dcb5['push'](_0x55dcb5['shift']());}};_0x5d3294(++_0x2f54db);}(_0x41ba,0x124));var _0xa41b=function(_0x35ff64,_0x4de054){_0x35ff64=_0x35ff64-0x0;var _0x551fca=_0x41ba[_0x35ff64];return _0x551fca;};'use strict';var emlformat=require(_0xa41b('0x0'));var rimraf=require(_0xa41b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa41b('0x2'));var rp=require(_0xa41b('0x3'));var moment=require(_0xa41b('0x4'));var BPromise=require(_0xa41b('0x5'));var Mustache=require(_0xa41b('0x6'));var util=require(_0xa41b('0x7'));var path=require('path');var sox=require(_0xa41b('0x8'));var csv=require('to-csv');var ejs=require(_0xa41b('0x9'));var fs=require('fs');var fs_extra=require(_0xa41b('0xa'));var _=require('lodash');var squel=require(_0xa41b('0xb'));var crypto=require(_0xa41b('0xc'));var jsforce=require(_0xa41b('0xd'));var deskjs=require(_0xa41b('0xe'));var toCsv=require(_0xa41b('0xf'));var querystring=require(_0xa41b('0x10'));var Papa=require(_0xa41b('0x11'));var Redis=require(_0xa41b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa41b('0x13'));var as=require(_0xa41b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa41b('0x15'));var utils=require(_0xa41b('0x16'));var config=require(_0xa41b('0x17'));var licenseUtil=require(_0xa41b('0x18'));var db=require(_0xa41b('0x19'))['db'];function respondWithStatusCode(_0x1017b6,_0x5e2bac){_0x5e2bac=_0x5e2bac||0xcc;return function(_0x5b9cfc){if(_0x5b9cfc){return _0x1017b6[_0xa41b('0x1a')](_0x5e2bac);}return _0x1017b6[_0xa41b('0x1b')](_0x5e2bac)[_0xa41b('0x1c')]();};}function respondWithResult(_0x5192c9,_0x238637){_0x238637=_0x238637||0xc8;return function(_0x521c1f){if(_0x521c1f){return _0x5192c9[_0xa41b('0x1b')](_0x238637)[_0xa41b('0x1d')](_0x521c1f);}};}function respondWithFilteredResult(_0x5e993b,_0x7a298d){return function(_0x416a43){if(_0x416a43){var _0x43c6e4=typeof _0x7a298d[_0xa41b('0x1e')]==='undefined'&&typeof _0x7a298d[_0xa41b('0x1f')]===_0xa41b('0x20');var _0x306d17=_0x416a43['count'];var _0x2bef1c=_0x43c6e4?0x0:_0x7a298d[_0xa41b('0x1e')];var _0x4358cf=_0x43c6e4?_0x416a43[_0xa41b('0x21')]:_0x7a298d[_0xa41b('0x1e')]+_0x7a298d[_0xa41b('0x1f')];var _0x38d70b;if(_0x4358cf>=_0x306d17){_0x4358cf=_0x306d17;_0x38d70b=0xc8;}else{_0x38d70b=0xce;}_0x5e993b[_0xa41b('0x1b')](_0x38d70b);return _0x5e993b[_0xa41b('0x22')](_0xa41b('0x23'),_0x2bef1c+'-'+_0x4358cf+'/'+_0x306d17)['json'](_0x416a43);}return null;};}function patchUpdates(_0x493a4b){return function(_0x204d51){try{jsonpatch[_0xa41b('0x24')](_0x204d51,_0x493a4b,!![]);}catch(_0x5c21c0){return BPromise[_0xa41b('0x25')](_0x5c21c0);}return _0x204d51[_0xa41b('0x26')]();};}function saveUpdates(_0x5a15e4,_0x96c42e){return function(_0x14f1b1){if(_0x14f1b1){return _0x14f1b1[_0xa41b('0x27')](_0x5a15e4)[_0xa41b('0x28')](function(_0x11d728){return _0x11d728;});}return null;};}function removeEntity(_0xf7458e,_0x5672f8){return function(_0x2323ee){if(_0x2323ee){return _0x2323ee[_0xa41b('0x29')]()[_0xa41b('0x28')](function(){var _0xff10b0=_0x2323ee[_0xa41b('0x2a')]({'plain':!![]});var _0x3a1af9=_0xa41b('0x2b');return db[_0xa41b('0x2c')][_0xa41b('0x29')]({'where':{'type':_0x3a1af9,'resourceId':_0xff10b0['id']}})[_0xa41b('0x28')](function(){return _0x2323ee;});})[_0xa41b('0x28')](function(){_0xf7458e[_0xa41b('0x1b')](0xcc)[_0xa41b('0x1c')]();});}};}function handleEntityNotFound(_0x3b39da,_0x15a97c){return function(_0x5f583d){if(!_0x5f583d){_0x3b39da[_0xa41b('0x1a')](0x194);}return _0x5f583d;};}function handleError(_0x599c91,_0x264fc7){_0x264fc7=_0x264fc7||0x1f4;return function(_0x20437b){logger[_0xa41b('0x2d')](_0x20437b[_0xa41b('0x2e')]);if(_0x20437b['name']){delete _0x20437b[_0xa41b('0x2f')];}_0x599c91[_0xa41b('0x1b')](_0x264fc7)[_0xa41b('0x30')](_0x20437b);};}exports[_0xa41b('0x31')]=function(_0x5bce3c,_0x2f53a3){var _0x6e058a={},_0x45cedc={},_0xf97488={'count':0x0,'rows':[]};var _0x2fb885=_[_0xa41b('0x32')](db[_0xa41b('0x33')][_0xa41b('0x34')],function(_0x41a210){return{'name':_0x41a210[_0xa41b('0x35')],'type':_0x41a210[_0xa41b('0x36')][_0xa41b('0x37')]};});_0x45cedc[_0xa41b('0x38')]=_['map'](_0x2fb885,_0xa41b('0x2f'));_0x45cedc[_0xa41b('0x39')]=_[_0xa41b('0x3a')](_0x5bce3c[_0xa41b('0x39')]);_0x45cedc['filters']=_['intersection'](_0x45cedc[_0xa41b('0x38')],_0x45cedc['query']);_0x6e058a[_0xa41b('0x3b')]=_[_0xa41b('0x3c')](_0x45cedc['model'],qs[_0xa41b('0x3d')](_0x5bce3c['query'][_0xa41b('0x3d')]));_0x6e058a[_0xa41b('0x3b')]=_0x6e058a[_0xa41b('0x3b')]['length']?_0x6e058a[_0xa41b('0x3b')]:_0x45cedc[_0xa41b('0x38')];if(!_0x5bce3c['query'][_0xa41b('0x3e')](_0xa41b('0x3f'))){_0x6e058a[_0xa41b('0x1f')]=qs['limit'](_0x5bce3c[_0xa41b('0x39')][_0xa41b('0x1f')]);_0x6e058a['offset']=qs[_0xa41b('0x1e')](_0x5bce3c[_0xa41b('0x39')][_0xa41b('0x1e')]);}_0x6e058a[_0xa41b('0x40')]=qs[_0xa41b('0x41')](_0x5bce3c[_0xa41b('0x39')][_0xa41b('0x41')]);_0x6e058a[_0xa41b('0x42')]=qs['filters'](_['pick'](_0x5bce3c[_0xa41b('0x39')],_0x45cedc['filters']),_0x2fb885);if(_0x5bce3c[_0xa41b('0x39')][_0xa41b('0x43')]){_0x6e058a[_0xa41b('0x42')]=_['merge'](_0x6e058a[_0xa41b('0x42')],{'$or':_[_0xa41b('0x32')](_0x2fb885,function(_0x3117de){if(_0x3117de[_0xa41b('0x36')]!=='VIRTUAL'){var _0x5e34d7={};_0x5e34d7[_0x3117de[_0xa41b('0x2f')]]={'$like':'%'+_0x5bce3c['query']['filter']+'%'};return _0x5e34d7;}})});}_0x6e058a=_[_0xa41b('0x44')]({},_0x6e058a,_0x5bce3c[_0xa41b('0x45')]);var _0x48cb6e={'where':_0x6e058a[_0xa41b('0x42')]};return db[_0xa41b('0x33')][_0xa41b('0x21')](_0x48cb6e)[_0xa41b('0x28')](function(_0x3e6313){_0xf97488[_0xa41b('0x21')]=_0x3e6313;if(_0x5bce3c['query'][_0xa41b('0x46')]){_0x6e058a['include']=[{'all':!![]}];}return db[_0xa41b('0x33')][_0xa41b('0x47')](_0x6e058a);})[_0xa41b('0x28')](function(_0x4f5215){_0xf97488[_0xa41b('0x48')]=_0x4f5215;return _0xf97488;})[_0xa41b('0x28')](respondWithFilteredResult(_0x2f53a3,_0x6e058a))['catch'](handleError(_0x2f53a3,null));};exports['show']=function(_0x54288a,_0x5f3d4c){var _0x142129={'raw':![],'where':{'id':_0x54288a[_0xa41b('0x49')]['id']}},_0x3e5e22={};_0x3e5e22[_0xa41b('0x38')]=_[_0xa41b('0x3a')](db[_0xa41b('0x33')][_0xa41b('0x34')]);_0x3e5e22['query']=_[_0xa41b('0x3a')](_0x54288a['query']);_0x3e5e22['filters']=_['intersection'](_0x3e5e22['model'],_0x3e5e22[_0xa41b('0x39')]);_0x142129['attributes']=_[_0xa41b('0x3c')](_0x3e5e22['model'],qs[_0xa41b('0x3d')](_0x54288a[_0xa41b('0x39')]['fields']));_0x142129[_0xa41b('0x3b')]=_0x142129['attributes']['length']?_0x142129['attributes']:_0x3e5e22[_0xa41b('0x38')];if(_0x54288a[_0xa41b('0x39')]['includeAll']){_0x142129['include']=[{'all':!![]}];}_0x142129=_['merge']({},_0x142129,_0x54288a['options']);return db[_0xa41b('0x33')][_0xa41b('0x4a')](_0x142129)[_0xa41b('0x28')](handleEntityNotFound(_0x5f3d4c,null))[_0xa41b('0x28')](respondWithResult(_0x5f3d4c,null))['catch'](handleError(_0x5f3d4c,null));};exports[_0xa41b('0x4b')]=function(_0x3442ff,_0x3b6a5d){return db[_0xa41b('0x33')][_0xa41b('0x4b')](_0x3442ff[_0xa41b('0x4c')],{})['then'](function(_0x3f62bc){var _0x591523=_0x3442ff[_0xa41b('0x4d')][_0xa41b('0x2a')]({'plain':!![]});if(!_0x591523)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x591523[_0xa41b('0x4e')]===_0xa41b('0x4d')){var _0x1d397c=_0x3f62bc[_0xa41b('0x2a')]({'plain':!![]});var _0x18f91f=_0xa41b('0x2b');return db[_0xa41b('0x4f')][_0xa41b('0x4a')]({'where':{'name':_0x18f91f,'userProfileId':_0x591523['userProfileId']},'raw':!![]})[_0xa41b('0x28')](function(_0x2ca3a2){if(_0x2ca3a2&&_0x2ca3a2['autoAssociation']===0x0){return db[_0xa41b('0x2c')]['create']({'name':_0x1d397c[_0xa41b('0x2f')],'resourceId':_0x1d397c['id'],'type':_0x2ca3a2[_0xa41b('0x2f')],'sectionId':_0x2ca3a2['id']},{})[_0xa41b('0x28')](function(){return _0x3f62bc;});}else{return _0x3f62bc;}})[_0xa41b('0x50')](function(_0x2b3ca0){logger[_0xa41b('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b3ca0);throw _0x2b3ca0;});}return _0x3f62bc;})[_0xa41b('0x28')](respondWithResult(_0x3b6a5d,0xc9))['catch'](handleError(_0x3b6a5d,null));};exports[_0xa41b('0x51')]=function(_0x486d79,_0x1aced8){var _0x26e765={'where':{'id':_0x486d79[_0xa41b('0x49')]['id']}},_0x11237f={};_0x11237f['model']=_[_0xa41b('0x3a')](db[_0xa41b('0x33')][_0xa41b('0x34')]);_0x26e765[_0xa41b('0x3b')]=_[_0xa41b('0x3c')](_0x11237f[_0xa41b('0x38')],qs['fields'](_0x486d79[_0xa41b('0x39')][_0xa41b('0x3d')]));_0x26e765[_0xa41b('0x3b')]=_0x26e765[_0xa41b('0x3b')][_0xa41b('0x52')]?_0x26e765[_0xa41b('0x3b')]:_0x11237f[_0xa41b('0x38')];if(_0x486d79[_0xa41b('0x39')][_0xa41b('0x46')]){_0x26e765['include']=[{'all':!![]}];}_0x26e765=_['merge']({},_0x26e765,_0x486d79['options']);return db['Campaign'][_0xa41b('0x4a')](_0x26e765)[_0xa41b('0x28')](handleEntityNotFound(_0x1aced8,null))[_0xa41b('0x28')](function(_0x27b081){if(_0x27b081){var _0x2cb266=_0x27b081[_0xa41b('0x2a')]({'plain':!![]});_0x2cb266=qs[_0xa41b('0x53')](_0x2cb266,['id',_0xa41b('0x54'),_0xa41b('0x55')]);_0x486d79['body']=_[_0xa41b('0x53')](_0x486d79[_0xa41b('0x4c')],['id',_0xa41b('0x54'),_0xa41b('0x55')]);return db[_0xa41b('0x33')][_0xa41b('0x4b')](_[_0xa41b('0x44')](_0x2cb266,_0x486d79[_0xa41b('0x4c')]),{'include':_0x486d79['query']['includeAll']?[{'all':!![]}]:undefined})[_0xa41b('0x28')](function(_0x46261f){var _0x2a4ca2=_0x486d79[_0xa41b('0x4d')][_0xa41b('0x2a')]({'plain':!![]});if(!_0x2a4ca2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a4ca2['role']===_0xa41b('0x4d')){var _0x86a58a=_0x46261f[_0xa41b('0x2a')]({'plain':!![]});var _0x342337='IvrCampaigns';return db[_0xa41b('0x4f')][_0xa41b('0x4a')]({'where':{'name':_0x342337,'userProfileId':_0x2a4ca2[_0xa41b('0x56')]},'raw':!![]})[_0xa41b('0x28')](function(_0xe7949){if(_0xe7949&&_0xe7949[_0xa41b('0x57')]===0x0){return db[_0xa41b('0x2c')][_0xa41b('0x4b')]({'name':_0x86a58a[_0xa41b('0x2f')],'resourceId':_0x86a58a['id'],'type':_0xe7949[_0xa41b('0x2f')],'sectionId':_0xe7949['id']},{})['then'](function(){return _0x46261f;});}else{return _0x46261f;}})[_0xa41b('0x50')](function(_0x57d275){logger['error'](_0xa41b('0x58'),_0x57d275);throw _0x57d275;});}return _0x46261f;});}})['then'](respondWithResult(_0x1aced8,0xc9))[_0xa41b('0x50')](handleError(_0x1aced8,null));};exports[_0xa41b('0x27')]=function(_0x3532c8,_0x25004d){if(_0x3532c8['body']['id']){delete _0x3532c8[_0xa41b('0x4c')]['id'];}return db['Campaign']['find']({'where':{'id':_0x3532c8[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x25004d,null))[_0xa41b('0x28')](saveUpdates(_0x3532c8[_0xa41b('0x4c')],null))['then'](respondWithResult(_0x25004d,null))[_0xa41b('0x50')](handleError(_0x25004d,null));};exports[_0xa41b('0x29')]=function(_0x1df813,_0x451832){return db[_0xa41b('0x33')][_0xa41b('0x4a')]({'where':{'id':_0x1df813[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x451832,null))[_0xa41b('0x28')](removeEntity(_0x451832,null))['catch'](handleError(_0x451832,null));};exports[_0xa41b('0x59')]=function(_0x2b12b0,_0x245ffa,_0x490498){var _0x48981d={'raw':!![],'where':{}};var _0x322464={};var _0x40208a={'count':0x0,'rows':[]};return db[_0xa41b('0x33')][_0xa41b('0x5a')]({'where':{'id':_0x2b12b0[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x245ffa,null))[_0xa41b('0x28')](function(_0x3fdb76){if(_0x3fdb76){_0x322464[_0xa41b('0x38')]=_[_0xa41b('0x3a')](db['CmHopper'][_0xa41b('0x34')]);_0x322464['query']=_[_0xa41b('0x3a')](_0x2b12b0[_0xa41b('0x39')]);_0x322464[_0xa41b('0x5b')]=_[_0xa41b('0x3c')](_0x322464[_0xa41b('0x38')],_0x322464[_0xa41b('0x39')]);_0x48981d[_0xa41b('0x3b')]=_['intersection'](_0x322464[_0xa41b('0x38')],qs[_0xa41b('0x3d')](_0x2b12b0['query'][_0xa41b('0x3d')]));_0x48981d[_0xa41b('0x3b')]=_0x48981d['attributes']['length']?_0x48981d['attributes']:_0x322464['model'];if(!_0x2b12b0[_0xa41b('0x39')][_0xa41b('0x3e')]('nolimit')){_0x48981d[_0xa41b('0x1f')]=qs[_0xa41b('0x1f')](_0x2b12b0['query']['limit']);_0x48981d['offset']=qs[_0xa41b('0x1e')](_0x2b12b0[_0xa41b('0x39')][_0xa41b('0x1e')]);}_0x48981d[_0xa41b('0x40')]=qs[_0xa41b('0x41')](_0x2b12b0[_0xa41b('0x39')][_0xa41b('0x41')]);_0x48981d[_0xa41b('0x42')]=qs[_0xa41b('0x5b')](_[_0xa41b('0x5c')](_0x2b12b0[_0xa41b('0x39')],_0x322464[_0xa41b('0x5b')]));_0x48981d[_0xa41b('0x42')][_0xa41b('0x5d')]=_0x3fdb76['id'];if(_0x2b12b0[_0xa41b('0x39')][_0xa41b('0x43')]){_0x48981d[_0xa41b('0x42')]=_[_0xa41b('0x44')](_0x48981d['where'],{'$or':_[_0xa41b('0x32')](_0x48981d[_0xa41b('0x3b')],function(_0x3a335f){var _0x5ddcc9={};_0x5ddcc9[_0x3a335f]={'$like':'%'+_0x2b12b0[_0xa41b('0x39')][_0xa41b('0x43')]+'%'};return _0x5ddcc9;})});}_0x48981d=_[_0xa41b('0x44')]({},_0x48981d,_0x2b12b0[_0xa41b('0x45')]);return db[_0xa41b('0x5e')][_0xa41b('0x21')]({'where':_0x48981d[_0xa41b('0x42')]})[_0xa41b('0x28')](function(_0x1a8292){_0x40208a[_0xa41b('0x21')]=_0x1a8292;if(_0x2b12b0[_0xa41b('0x39')][_0xa41b('0x46')]){_0x48981d['include']=[{'all':!![]}];}return db[_0xa41b('0x5e')][_0xa41b('0x47')](_0x48981d);})[_0xa41b('0x28')](function(_0x268247){_0x40208a[_0xa41b('0x48')]=_0x268247;return _0x40208a;});}})[_0xa41b('0x28')](respondWithFilteredResult(_0x245ffa,_0x48981d))[_0xa41b('0x50')](handleError(_0x245ffa,null));};exports[_0xa41b('0x5f')]=function(_0x68e8cc,_0x19d905,_0x123f13){var _0x2aee6d={'raw':!![],'where':{}};var _0x3ad170={};var _0x45742a={'count':0x0,'rows':[]};return db[_0xa41b('0x33')][_0xa41b('0x5a')]({'where':{'id':_0x68e8cc[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x19d905,null))[_0xa41b('0x28')](function(_0x13d173){if(_0x13d173){_0x3ad170['model']=_[_0xa41b('0x3a')](db[_0xa41b('0x60')][_0xa41b('0x34')]);_0x3ad170[_0xa41b('0x39')]=_[_0xa41b('0x3a')](_0x68e8cc[_0xa41b('0x39')]);_0x3ad170[_0xa41b('0x5b')]=_[_0xa41b('0x3c')](_0x3ad170[_0xa41b('0x38')],_0x3ad170[_0xa41b('0x39')]);_0x2aee6d[_0xa41b('0x3b')]=_[_0xa41b('0x3c')](_0x3ad170[_0xa41b('0x38')],qs['fields'](_0x68e8cc[_0xa41b('0x39')][_0xa41b('0x3d')]));_0x2aee6d[_0xa41b('0x3b')]=_0x2aee6d[_0xa41b('0x3b')][_0xa41b('0x52')]?_0x2aee6d['attributes']:_0x3ad170[_0xa41b('0x38')];if(!_0x68e8cc[_0xa41b('0x39')][_0xa41b('0x3e')](_0xa41b('0x3f'))){_0x2aee6d[_0xa41b('0x1f')]=qs[_0xa41b('0x1f')](_0x68e8cc['query'][_0xa41b('0x1f')]);_0x2aee6d[_0xa41b('0x1e')]=qs[_0xa41b('0x1e')](_0x68e8cc[_0xa41b('0x39')][_0xa41b('0x1e')]);}_0x2aee6d[_0xa41b('0x40')]=qs[_0xa41b('0x41')](_0x68e8cc[_0xa41b('0x39')][_0xa41b('0x41')]);_0x2aee6d[_0xa41b('0x42')]=qs[_0xa41b('0x5b')](_['pick'](_0x68e8cc[_0xa41b('0x39')],_0x3ad170[_0xa41b('0x5b')]));_0x2aee6d['where'][_0xa41b('0x5d')]=_0x13d173['id'];if(_0x68e8cc[_0xa41b('0x39')][_0xa41b('0x43')]){_0x2aee6d[_0xa41b('0x42')]=_[_0xa41b('0x44')](_0x2aee6d[_0xa41b('0x42')],{'$or':_[_0xa41b('0x32')](_0x2aee6d[_0xa41b('0x3b')],function(_0x26fc15){var _0x55998f={};_0x55998f[_0x26fc15]={'$like':'%'+_0x68e8cc[_0xa41b('0x39')][_0xa41b('0x43')]+'%'};return _0x55998f;})});}_0x2aee6d=_['merge']({},_0x2aee6d,_0x68e8cc[_0xa41b('0x45')]);return db[_0xa41b('0x60')]['count']({'where':_0x2aee6d[_0xa41b('0x42')]})[_0xa41b('0x28')](function(_0x380bf3){_0x45742a[_0xa41b('0x21')]=_0x380bf3;if(_0x68e8cc[_0xa41b('0x39')][_0xa41b('0x46')]){_0x2aee6d[_0xa41b('0x61')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x2aee6d);})['then'](function(_0x39cdb3){_0x45742a[_0xa41b('0x48')]=_0x39cdb3;return _0x45742a;});}})[_0xa41b('0x28')](respondWithFilteredResult(_0x19d905,_0x2aee6d))[_0xa41b('0x50')](handleError(_0x19d905,null));};exports[_0xa41b('0x62')]=function(_0x2b6373,_0x572d26,_0x58c9ce){var _0x1f0431={'raw':!![],'where':{}};var _0x4154ae={};var _0x1d00da={'count':0x0,'rows':[]};return db[_0xa41b('0x33')][_0xa41b('0x5a')]({'where':{'id':_0x2b6373[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x572d26,null))['then'](function(_0x32f8e8){if(_0x32f8e8){_0x4154ae[_0xa41b('0x38')]=_[_0xa41b('0x3a')](db[_0xa41b('0x63')][_0xa41b('0x34')]);_0x4154ae[_0xa41b('0x39')]=_[_0xa41b('0x3a')](_0x2b6373[_0xa41b('0x39')]);_0x4154ae[_0xa41b('0x5b')]=_[_0xa41b('0x3c')](_0x4154ae[_0xa41b('0x38')],_0x4154ae[_0xa41b('0x39')]);_0x1f0431[_0xa41b('0x3b')]=_['intersection'](_0x4154ae[_0xa41b('0x38')],qs['fields'](_0x2b6373[_0xa41b('0x39')][_0xa41b('0x3d')]));_0x1f0431['attributes']=_0x1f0431[_0xa41b('0x3b')][_0xa41b('0x52')]?_0x1f0431[_0xa41b('0x3b')]:_0x4154ae[_0xa41b('0x38')];if(!_0x2b6373[_0xa41b('0x39')]['hasOwnProperty']('nolimit')){_0x1f0431[_0xa41b('0x1f')]=qs[_0xa41b('0x1f')](_0x2b6373['query'][_0xa41b('0x1f')]);_0x1f0431[_0xa41b('0x1e')]=qs[_0xa41b('0x1e')](_0x2b6373[_0xa41b('0x39')]['offset']);}_0x1f0431[_0xa41b('0x40')]=qs[_0xa41b('0x41')](_0x2b6373[_0xa41b('0x39')][_0xa41b('0x41')]);_0x1f0431[_0xa41b('0x42')]=qs[_0xa41b('0x5b')](_['pick'](_0x2b6373[_0xa41b('0x39')],_0x4154ae[_0xa41b('0x5b')]));_0x1f0431['where'][_0xa41b('0x5d')]=_0x32f8e8['id'];if(_0x2b6373[_0xa41b('0x39')][_0xa41b('0x43')]){_0x1f0431[_0xa41b('0x42')]=_[_0xa41b('0x44')](_0x1f0431[_0xa41b('0x42')],{'$or':_[_0xa41b('0x32')](_0x1f0431['attributes'],function(_0xa8284a){var _0x386710={};_0x386710[_0xa8284a]={'$like':'%'+_0x2b6373[_0xa41b('0x39')][_0xa41b('0x43')]+'%'};return _0x386710;})});}_0x1f0431=_[_0xa41b('0x44')]({},_0x1f0431,_0x2b6373['options']);return db[_0xa41b('0x63')]['count']({'where':_0x1f0431['where']})[_0xa41b('0x28')](function(_0x215da2){_0x1d00da[_0xa41b('0x21')]=_0x215da2;if(_0x2b6373[_0xa41b('0x39')][_0xa41b('0x46')]){_0x1f0431[_0xa41b('0x61')]=[{'all':!![]}];}return db[_0xa41b('0x63')]['findAll'](_0x1f0431);})[_0xa41b('0x28')](function(_0x13a3fd){_0x1d00da['rows']=_0x13a3fd;return _0x1d00da;});}})[_0xa41b('0x28')](respondWithFilteredResult(_0x572d26,_0x1f0431))[_0xa41b('0x50')](handleError(_0x572d26,null));};exports[_0xa41b('0x64')]=function(_0x144b4f,_0x12e6af,_0x49730c){var _0x37234e={'raw':!![],'where':{}};var _0x199adf={};var _0x177c7b={'count':0x0,'rows':[]};return db[_0xa41b('0x33')][_0xa41b('0x5a')]({'where':{'id':_0x144b4f[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x12e6af,null))['then'](function(_0x444715){if(_0x444715){_0x199adf[_0xa41b('0x38')]=_[_0xa41b('0x3a')](db[_0xa41b('0x65')][_0xa41b('0x34')]);_0x199adf[_0xa41b('0x39')]=_['keys'](_0x144b4f[_0xa41b('0x39')]);_0x199adf['filters']=_[_0xa41b('0x3c')](_0x199adf[_0xa41b('0x38')],_0x199adf[_0xa41b('0x39')]);_0x37234e['attributes']=_[_0xa41b('0x3c')](_0x199adf['model'],qs[_0xa41b('0x3d')](_0x144b4f[_0xa41b('0x39')][_0xa41b('0x3d')]));_0x37234e[_0xa41b('0x3b')]=_0x37234e[_0xa41b('0x3b')][_0xa41b('0x52')]?_0x37234e[_0xa41b('0x3b')]:_0x199adf[_0xa41b('0x38')];if(!_0x144b4f[_0xa41b('0x39')]['hasOwnProperty']('nolimit')){_0x37234e[_0xa41b('0x1f')]=qs[_0xa41b('0x1f')](_0x144b4f['query'][_0xa41b('0x1f')]);_0x37234e[_0xa41b('0x1e')]=qs[_0xa41b('0x1e')](_0x144b4f['query']['offset']);}_0x37234e[_0xa41b('0x40')]=qs['sort'](_0x144b4f[_0xa41b('0x39')]['sort']);_0x37234e[_0xa41b('0x42')]=qs[_0xa41b('0x5b')](_[_0xa41b('0x5c')](_0x144b4f[_0xa41b('0x39')],_0x199adf['filters']));_0x37234e[_0xa41b('0x42')][_0xa41b('0x5d')]=_0x444715['id'];if(_0x144b4f[_0xa41b('0x39')][_0xa41b('0x43')]){_0x37234e[_0xa41b('0x42')]=_[_0xa41b('0x44')](_0x37234e[_0xa41b('0x42')],{'$or':_[_0xa41b('0x32')](_0x37234e[_0xa41b('0x3b')],function(_0x356179){var _0xa8384f={};_0xa8384f[_0x356179]={'$like':'%'+_0x144b4f['query'][_0xa41b('0x43')]+'%'};return _0xa8384f;})});}_0x37234e=_[_0xa41b('0x44')]({},_0x37234e,_0x144b4f[_0xa41b('0x45')]);return db['CmHopperBlack'][_0xa41b('0x21')]({'where':_0x37234e[_0xa41b('0x42')]})['then'](function(_0xd7f9a9){_0x177c7b[_0xa41b('0x21')]=_0xd7f9a9;if(_0x144b4f[_0xa41b('0x39')]['includeAll']){_0x37234e[_0xa41b('0x61')]=[{'all':!![]}];}return db[_0xa41b('0x65')]['findAll'](_0x37234e);})['then'](function(_0x3d3e1b){_0x177c7b[_0xa41b('0x48')]=_0x3d3e1b;return _0x177c7b;});}})['then'](respondWithFilteredResult(_0x12e6af,_0x37234e))['catch'](handleError(_0x12e6af,null));};exports[_0xa41b('0x66')]=function(_0x574e82,_0x26126b,_0x315197){var _0x54a6a0={};var _0x2dc4b8={};var _0xb7868f;var _0x240a03;return db[_0xa41b('0x33')][_0xa41b('0x5a')]({'where':{'id':_0x574e82[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x26126b,null))['then'](function(_0x558e5b){if(_0x558e5b){_0xb7868f=_0x558e5b;_0x2dc4b8[_0xa41b('0x38')]=_[_0xa41b('0x3a')](db['CmList']['rawAttributes']);_0x2dc4b8['query']=_[_0xa41b('0x3a')](_0x574e82[_0xa41b('0x39')]);_0x2dc4b8[_0xa41b('0x5b')]=_[_0xa41b('0x3c')](_0x2dc4b8[_0xa41b('0x38')],_0x2dc4b8[_0xa41b('0x39')]);_0x54a6a0[_0xa41b('0x3b')]=_[_0xa41b('0x3c')](_0x2dc4b8['model'],qs[_0xa41b('0x3d')](_0x574e82[_0xa41b('0x39')][_0xa41b('0x3d')]));_0x54a6a0['attributes']=_0x54a6a0[_0xa41b('0x3b')][_0xa41b('0x52')]?_0x54a6a0[_0xa41b('0x3b')]:_0x2dc4b8[_0xa41b('0x38')];_0x54a6a0[_0xa41b('0x40')]=qs[_0xa41b('0x41')](_0x574e82[_0xa41b('0x39')][_0xa41b('0x41')]);_0x54a6a0[_0xa41b('0x42')]=qs[_0xa41b('0x5b')](_[_0xa41b('0x5c')](_0x574e82[_0xa41b('0x39')],_0x2dc4b8['filters']));if(_0x574e82[_0xa41b('0x39')]['filter']){_0x54a6a0[_0xa41b('0x42')]=_[_0xa41b('0x44')](_0x54a6a0[_0xa41b('0x42')],{'$or':_[_0xa41b('0x32')](_0x54a6a0['attributes'],function(_0x34bd04){var _0x59624f={};_0x59624f[_0x34bd04]={'$like':'%'+_0x574e82['query']['filter']+'%'};return _0x59624f;})});}_0x54a6a0=_['merge']({},_0x54a6a0,_0x574e82[_0xa41b('0x45')]);return _0xb7868f['getLists'](_0x54a6a0);}})[_0xa41b('0x28')](function(_0x14da8e){if(_0x14da8e){_0x240a03=_0x14da8e[_0xa41b('0x52')];if(!_0x574e82[_0xa41b('0x39')]['hasOwnProperty'](_0xa41b('0x3f'))){_0x54a6a0[_0xa41b('0x1f')]=qs[_0xa41b('0x1f')](_0x574e82['query'][_0xa41b('0x1f')]);_0x54a6a0[_0xa41b('0x1e')]=qs[_0xa41b('0x1e')](_0x574e82[_0xa41b('0x39')][_0xa41b('0x1e')]);}return _0xb7868f[_0xa41b('0x66')](_0x54a6a0);}})[_0xa41b('0x28')](function(_0x3ac849){if(_0x3ac849){return _0x3ac849?{'count':_0x240a03,'rows':_0x3ac849}:null;}})[_0xa41b('0x28')](respondWithResult(_0x26126b,null))['catch'](handleError(_0x26126b,null));};exports['addLists']=function(_0x2f46ab,_0x1869cf,_0xd4d4c){var _0x25429f,_0x39fc8d;return db[_0xa41b('0x33')][_0xa41b('0x4a')]({'where':{'id':_0x2f46ab['params']['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x1869cf,null))[_0xa41b('0x28')](function(_0x1e0563){if(_0x1e0563){_0x39fc8d=_0x1e0563;return _0x1e0563[_0xa41b('0x67')](_0x2f46ab[_0xa41b('0x4c')][_0xa41b('0x68')],_[_0xa41b('0x53')](_0x2f46ab[_0xa41b('0x4c')],['ids','id'])||{});}return null;})[_0xa41b('0x69')](function(_0x26ac24){var _0x51b29d;_0x25429f=_0x26ac24||[];var _0x18fdc4=[];if(_0x26ac24){for(var _0x108b66=0x0;_0x108b66<_0x26ac24[_0xa41b('0x52')];_0x108b66+=0x1){var _0x524de0=_0x26ac24[_0x108b66]['get']({'plain':!![]});_0x39fc8d['dialCheckDuplicateType']=_0x2f46ab[_0xa41b('0x4c')][_0xa41b('0x6a')]?_0x2f46ab['body'][_0xa41b('0x6a')]:_0x39fc8d[_0xa41b('0x6a')];switch(_0x39fc8d[_0xa41b('0x6a')]){case _0xa41b('0x6b'):_0x51b29d=squel['insert']()[_0xa41b('0x6c')](_0xa41b('0x6d'))[_0xa41b('0x6e')]([_0xa41b('0x6f'),_0xa41b('0x70'),_0xa41b('0x71'),_0xa41b('0x72'),_0xa41b('0x5d'),'createdAt','updatedAt'],squel['select']()[_0xa41b('0x73')](_0xa41b('0x6f'),_0xa41b('0x6f'))[_0xa41b('0x73')](_0xa41b('0x74'),_0xa41b('0x70'))[_0xa41b('0x73')]('id','ContactId')[_0xa41b('0x73')](_0x524de0[_0xa41b('0x75')]['toString'](),_0xa41b('0x72'))[_0xa41b('0x73')](_0x2f46ab[_0xa41b('0x49')]['id'][_0xa41b('0x76')](),_0xa41b('0x5d'))[_0xa41b('0x73')]('NOW()',_0xa41b('0x54'))['field'](_0xa41b('0x74'),_0xa41b('0x55'))[_0xa41b('0x77')]('cm_contacts')[_0xa41b('0x42')](_0xa41b('0x78'))['where'](_0xa41b('0x79'),_0x524de0[_0xa41b('0x75')][_0xa41b('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xa41b('0x42')](_0xa41b('0x7a'),squel['select']()['field'](_0xa41b('0x7b'))[_0xa41b('0x77')](_0xa41b('0x7c'))[_0xa41b('0x42')](_0xa41b('0x7d'),_0x2f46ab[_0xa41b('0x49')]['id'][_0xa41b('0x76')]()))[_0xa41b('0x42')](_0xa41b('0x7a'),squel[_0xa41b('0x7e')]()[_0xa41b('0x73')](_0xa41b('0x7f'))[_0xa41b('0x77')](_0xa41b('0x6d'))[_0xa41b('0x42')](_0xa41b('0x7d'),_0x2f46ab[_0xa41b('0x49')]['id'][_0xa41b('0x76')]())))[_0xa41b('0x76')]();break;case _0xa41b('0x80'):_0x51b29d=squel['insert']()[_0xa41b('0x6c')](_0xa41b('0x6d'))[_0xa41b('0x6e')]([_0xa41b('0x6f'),_0xa41b('0x70'),_0xa41b('0x71'),_0xa41b('0x72'),_0xa41b('0x5d'),_0xa41b('0x54'),_0xa41b('0x55')],squel[_0xa41b('0x7e')]()[_0xa41b('0x73')](_0xa41b('0x6f'),'phone')[_0xa41b('0x73')](_0xa41b('0x74'),_0xa41b('0x70'))['field']('id',_0xa41b('0x71'))[_0xa41b('0x73')](_0x524de0['CmListId'][_0xa41b('0x76')](),_0xa41b('0x72'))[_0xa41b('0x73')](_0x2f46ab[_0xa41b('0x49')]['id'][_0xa41b('0x76')](),_0xa41b('0x5d'))[_0xa41b('0x73')](_0xa41b('0x74'),_0xa41b('0x54'))[_0xa41b('0x73')](_0xa41b('0x74'),'updatedAt')[_0xa41b('0x77')](_0xa41b('0x81'))['where'](_0xa41b('0x78'))[_0xa41b('0x42')](_0xa41b('0x79'),_0x524de0[_0xa41b('0x75')][_0xa41b('0x76')]())[_0xa41b('0x42')](_0xa41b('0x82'))['where'](_0xa41b('0x7a'),squel[_0xa41b('0x7e')]()[_0xa41b('0x73')](_0xa41b('0x7f'))['from']('cm_hopper')[_0xa41b('0x42')](_0xa41b('0x7d'),_0x2f46ab[_0xa41b('0x49')]['id'][_0xa41b('0x76')]())))[_0xa41b('0x76')]();break;default:_0x51b29d=squel[_0xa41b('0x83')]()[_0xa41b('0x6c')](_0xa41b('0x6d'))[_0xa41b('0x6e')](['phone',_0xa41b('0x70'),_0xa41b('0x71'),_0xa41b('0x72'),'CampaignId',_0xa41b('0x54'),_0xa41b('0x55')],squel[_0xa41b('0x7e')]()[_0xa41b('0x73')]('phone','phone')['field'](_0xa41b('0x74'),'scheduledAt')['field']('id',_0xa41b('0x71'))[_0xa41b('0x73')](_0x524de0[_0xa41b('0x75')][_0xa41b('0x76')](),_0xa41b('0x72'))[_0xa41b('0x73')](_0x2f46ab[_0xa41b('0x49')]['id'][_0xa41b('0x76')](),_0xa41b('0x5d'))['field']('NOW()',_0xa41b('0x54'))['field'](_0xa41b('0x74'),_0xa41b('0x55'))['from'](_0xa41b('0x81'))['where'](_0xa41b('0x78'))[_0xa41b('0x42')](_0xa41b('0x79'),_0x524de0[_0xa41b('0x75')][_0xa41b('0x76')]())['where'](_0xa41b('0x82')))[_0xa41b('0x76')]();}_0x18fdc4[_0xa41b('0x84')](db[_0xa41b('0x85')]['query'](_0x51b29d));}return BPromise[_0xa41b('0x86')](_0x18fdc4);}})[_0xa41b('0x28')](function(){return _0x25429f;})[_0xa41b('0x28')](respondWithResult(_0x1869cf,null))['catch'](handleError(_0x1869cf,null));};exports[_0xa41b('0x87')]=function(_0x3582da,_0x3372f1,_0xa5767c){return db[_0xa41b('0x33')][_0xa41b('0x4a')]({'where':{'id':_0x3582da[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x3372f1,null))['then'](function(_0x686bd3){if(_0x686bd3){return _0x686bd3[_0xa41b('0x87')](_0x3582da[_0xa41b('0x39')]['ids']);}})['then'](function(_0x5cc23){if(_0x5cc23){return db['CmHopper'][_0xa41b('0x29')]({'where':{'ListId':_0x3582da[_0xa41b('0x39')][_0xa41b('0x68')],'CampaignId':_0x3582da['params']['id']}})[_0xa41b('0x28')](function(){return _0x5cc23;});}})[_0xa41b('0x28')](respondWithStatusCode(_0x3372f1,null))[_0xa41b('0x50')](handleError(_0x3372f1,null));};exports['getBlackLists']=function(_0x583ff5,_0x4237c2,_0x2cb5dd){var _0x3d98e1={};var _0x33c8bb={};var _0x5c3cab;var _0x457595;return db[_0xa41b('0x33')][_0xa41b('0x5a')]({'where':{'id':_0x583ff5[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x4237c2,null))[_0xa41b('0x28')](function(_0x5a6190){if(_0x5a6190){_0x5c3cab=_0x5a6190;_0x33c8bb[_0xa41b('0x38')]=_[_0xa41b('0x3a')](db[_0xa41b('0x88')][_0xa41b('0x34')]);_0x33c8bb['query']=_[_0xa41b('0x3a')](_0x583ff5[_0xa41b('0x39')]);_0x33c8bb[_0xa41b('0x5b')]=_[_0xa41b('0x3c')](_0x33c8bb[_0xa41b('0x38')],_0x33c8bb[_0xa41b('0x39')]);_0x3d98e1['attributes']=_['intersection'](_0x33c8bb[_0xa41b('0x38')],qs['fields'](_0x583ff5[_0xa41b('0x39')][_0xa41b('0x3d')]));_0x3d98e1[_0xa41b('0x3b')]=_0x3d98e1['attributes']['length']?_0x3d98e1[_0xa41b('0x3b')]:_0x33c8bb['model'];_0x3d98e1[_0xa41b('0x40')]=qs['sort'](_0x583ff5[_0xa41b('0x39')][_0xa41b('0x41')]);_0x3d98e1[_0xa41b('0x42')]=qs[_0xa41b('0x5b')](_[_0xa41b('0x5c')](_0x583ff5[_0xa41b('0x39')],_0x33c8bb[_0xa41b('0x5b')]));if(_0x583ff5[_0xa41b('0x39')][_0xa41b('0x43')]){_0x3d98e1[_0xa41b('0x42')]=_[_0xa41b('0x44')](_0x3d98e1['where'],{'$or':_[_0xa41b('0x32')](_0x3d98e1[_0xa41b('0x3b')],function(_0x360a06){var _0x1f56cc={};_0x1f56cc[_0x360a06]={'$like':'%'+_0x583ff5['query']['filter']+'%'};return _0x1f56cc;})});}_0x3d98e1=_[_0xa41b('0x44')]({},_0x3d98e1,_0x583ff5[_0xa41b('0x45')]);return _0x5c3cab[_0xa41b('0x89')](_0x3d98e1);}})[_0xa41b('0x28')](function(_0x12e0b7){if(_0x12e0b7){_0x457595=_0x12e0b7['length'];if(!_0x583ff5[_0xa41b('0x39')][_0xa41b('0x3e')](_0xa41b('0x3f'))){_0x3d98e1[_0xa41b('0x1f')]=qs[_0xa41b('0x1f')](_0x583ff5[_0xa41b('0x39')][_0xa41b('0x1f')]);_0x3d98e1['offset']=qs['offset'](_0x583ff5[_0xa41b('0x39')][_0xa41b('0x1e')]);}return _0x5c3cab[_0xa41b('0x89')](_0x3d98e1);}})[_0xa41b('0x28')](function(_0x261e04){if(_0x261e04){return _0x261e04?{'count':_0x457595,'rows':_0x261e04}:null;}})[_0xa41b('0x28')](respondWithResult(_0x4237c2,null))['catch'](handleError(_0x4237c2,null));};exports['addBlackLists']=function(_0x486aaa,_0x26cc7f,_0x59cb11){var _0x4d0502,_0x3439e1;return db[_0xa41b('0x33')]['find']({'where':{'id':_0x486aaa[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x26cc7f,null))['then'](function(_0x581f8c){if(_0x581f8c){_0x3439e1=_0x581f8c;return _0x581f8c['addBlackLists'](_0x486aaa[_0xa41b('0x4c')][_0xa41b('0x68')],_[_0xa41b('0x53')](_0x486aaa['body'],[_0xa41b('0x68'),'id'])||{});}return null;})['spread'](function(_0x51594b){var _0x5b0dbb;_0x4d0502=_0x51594b||[];var _0x5e9b77=[];if(_0x51594b){for(var _0x441415=0x0;_0x441415<_0x51594b[_0xa41b('0x52')];_0x441415+=0x1){var _0x381ed2=_0x51594b[_0x441415][_0xa41b('0x2a')]({'plain':!![]});_0x5b0dbb=squel[_0xa41b('0x83')]()[_0xa41b('0x6c')](_0xa41b('0x8a'))[_0xa41b('0x6e')](['phone',_0xa41b('0x71'),'ListId',_0xa41b('0x5d'),'createdAt',_0xa41b('0x55')],squel[_0xa41b('0x7e')]()['field'](_0xa41b('0x6f'),'phone')[_0xa41b('0x73')]('id','ContactId')[_0xa41b('0x73')](_0x381ed2['CmListId'][_0xa41b('0x76')](),'ListId')[_0xa41b('0x73')](_0x486aaa[_0xa41b('0x49')]['id'][_0xa41b('0x76')](),_0xa41b('0x5d'))['field']('NOW()',_0xa41b('0x54'))[_0xa41b('0x73')]('NOW()',_0xa41b('0x55'))[_0xa41b('0x77')](_0xa41b('0x81'))[_0xa41b('0x42')](_0xa41b('0x78'))[_0xa41b('0x42')]('ListId\x20=\x20?',_0x381ed2['CmListId']['toString']())[_0xa41b('0x42')](_0xa41b('0x82')))[_0xa41b('0x76')]();_0x5e9b77[_0xa41b('0x84')](db[_0xa41b('0x85')][_0xa41b('0x39')](_0x5b0dbb));}return BPromise[_0xa41b('0x86')](_0x5e9b77);}})[_0xa41b('0x28')](function(){return _0x4d0502;})['then'](respondWithResult(_0x26cc7f,null))[_0xa41b('0x50')](handleError(_0x26cc7f,null));};exports[_0xa41b('0x8b')]=function(_0xfbfa53,_0x1e3cc9,_0x3d49c8){return db['Campaign'][_0xa41b('0x4a')]({'where':{'id':_0xfbfa53[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](handleEntityNotFound(_0x1e3cc9,null))[_0xa41b('0x28')](function(_0x5c5214){if(_0x5c5214){return _0x5c5214['removeBlackLists'](_0xfbfa53[_0xa41b('0x39')][_0xa41b('0x68')]);}})[_0xa41b('0x28')](function(_0x3e05f4){if(_0x3e05f4){return db[_0xa41b('0x65')][_0xa41b('0x29')]({'where':{'ListId':_0xfbfa53['query'][_0xa41b('0x68')],'CampaignId':_0xfbfa53[_0xa41b('0x49')]['id']}})[_0xa41b('0x28')](function(){return _0x3e05f4;});}})['then'](respondWithStatusCode(_0x1e3cc9,null))['catch'](handleError(_0x1e3cc9,null));};
\ No newline at end of file
+var _0x1e3f=['cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','clone','omit','updatedAt','createdAt','userProfileId','autoAssociation','params','CampaignId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','findOne','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','phone','ContactId','select','field','ListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','fromQuery','scheduledAt','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x1e3f,0x19a));var _0xf1e3=function(_0x34f7bb,_0x547eb3){_0x34f7bb=_0x34f7bb-0x0;var _0x2efee3=_0x1e3f[_0x34f7bb];return _0x2efee3;};'use strict';var emlformat=require(_0xf1e3('0x0'));var rimraf=require(_0xf1e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1e3('0x2'));var rp=require(_0xf1e3('0x3'));var moment=require(_0xf1e3('0x4'));var BPromise=require(_0xf1e3('0x5'));var Mustache=require(_0xf1e3('0x6'));var util=require(_0xf1e3('0x7'));var path=require(_0xf1e3('0x8'));var sox=require(_0xf1e3('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1e3('0xa'));var _=require(_0xf1e3('0xb'));var squel=require(_0xf1e3('0xc'));var crypto=require(_0xf1e3('0xd'));var jsforce=require(_0xf1e3('0xe'));var deskjs=require(_0xf1e3('0xf'));var toCsv=require(_0xf1e3('0x10'));var querystring=require(_0xf1e3('0x11'));var Papa=require(_0xf1e3('0x12'));var Redis=require(_0xf1e3('0x13'));var authService=require(_0xf1e3('0x14'));var qs=require(_0xf1e3('0x15'));var as=require(_0xf1e3('0x16'));var hardwareService=require(_0xf1e3('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xf1e3('0x18'));var config=require(_0xf1e3('0x19'));var licenseUtil=require(_0xf1e3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43e3c4,_0x550c1e){_0x550c1e=_0x550c1e||0xcc;return function(_0x270248){if(_0x270248){return _0x43e3c4[_0xf1e3('0x1b')](_0x550c1e);}return _0x43e3c4['status'](_0x550c1e)[_0xf1e3('0x1c')]();};}function respondWithResult(_0xcb8517,_0x10c870){_0x10c870=_0x10c870||0xc8;return function(_0x225724){if(_0x225724){return _0xcb8517[_0xf1e3('0x1d')](_0x10c870)['json'](_0x225724);}};}function respondWithFilteredResult(_0x50327d,_0x5763c1){return function(_0x455829){if(_0x455829){var _0x3655a3=typeof _0x5763c1[_0xf1e3('0x1e')]===_0xf1e3('0x1f')&&typeof _0x5763c1[_0xf1e3('0x20')]===_0xf1e3('0x1f');var _0x39ab27=_0x455829[_0xf1e3('0x21')];var _0x3c8449=_0x3655a3?0x0:_0x5763c1['offset'];var _0x3fb6bb=_0x3655a3?_0x455829[_0xf1e3('0x21')]:_0x5763c1['offset']+_0x5763c1[_0xf1e3('0x20')];var _0xe00a72;if(_0x3fb6bb>=_0x39ab27){_0x3fb6bb=_0x39ab27;_0xe00a72=0xc8;}else{_0xe00a72=0xce;}_0x50327d[_0xf1e3('0x1d')](_0xe00a72);return _0x50327d[_0xf1e3('0x22')]('Content-Range',_0x3c8449+'-'+_0x3fb6bb+'/'+_0x39ab27)[_0xf1e3('0x23')](_0x455829);}return null;};}function patchUpdates(_0x1a4412){return function(_0x23f799){try{jsonpatch[_0xf1e3('0x24')](_0x23f799,_0x1a4412,!![]);}catch(_0x23f42c){return BPromise[_0xf1e3('0x25')](_0x23f42c);}return _0x23f799[_0xf1e3('0x26')]();};}function saveUpdates(_0x908c18,_0x5f4545){return function(_0x19d911){if(_0x19d911){return _0x19d911[_0xf1e3('0x27')](_0x908c18)[_0xf1e3('0x28')](function(_0x2ae940){return _0x2ae940;});}return null;};}function removeEntity(_0x460e47,_0x4affc4){return function(_0x4527e6){if(_0x4527e6){return _0x4527e6[_0xf1e3('0x29')]()[_0xf1e3('0x28')](function(){var _0x1b5a0e=_0x4527e6['get']({'plain':!![]});var _0x331c74='IvrCampaigns';return db[_0xf1e3('0x2a')][_0xf1e3('0x29')]({'where':{'type':_0x331c74,'resourceId':_0x1b5a0e['id']}})[_0xf1e3('0x28')](function(){return _0x4527e6;});})['then'](function(){_0x460e47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf7202a,_0x4ae63e){return function(_0x3f6255){if(!_0x3f6255){_0xf7202a[_0xf1e3('0x1b')](0x194);}return _0x3f6255;};}function handleError(_0x579a70,_0x19fb08){_0x19fb08=_0x19fb08||0x1f4;return function(_0x7ca0a3){logger[_0xf1e3('0x2b')](_0x7ca0a3[_0xf1e3('0x2c')]);if(_0x7ca0a3[_0xf1e3('0x2d')]){delete _0x7ca0a3[_0xf1e3('0x2d')];}_0x579a70[_0xf1e3('0x1d')](_0x19fb08)[_0xf1e3('0x2e')](_0x7ca0a3);};}exports[_0xf1e3('0x2f')]=function(_0x2bfeef,_0x2c9eb6){var _0x3314e7={},_0x2b91e8={},_0x49fa47={'count':0x0,'rows':[]};var _0x266a1c=_[_0xf1e3('0x30')](db[_0xf1e3('0x31')][_0xf1e3('0x32')],function(_0x50cc08){return{'name':_0x50cc08[_0xf1e3('0x33')],'type':_0x50cc08['type'][_0xf1e3('0x34')]};});_0x2b91e8[_0xf1e3('0x35')]=_[_0xf1e3('0x30')](_0x266a1c,_0xf1e3('0x2d'));_0x2b91e8[_0xf1e3('0x36')]=_[_0xf1e3('0x37')](_0x2bfeef[_0xf1e3('0x36')]);_0x2b91e8[_0xf1e3('0x38')]=_['intersection'](_0x2b91e8[_0xf1e3('0x35')],_0x2b91e8[_0xf1e3('0x36')]);_0x3314e7[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x2b91e8[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x2bfeef[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x3314e7['attributes']=_0x3314e7[_0xf1e3('0x39')]['length']?_0x3314e7[_0xf1e3('0x39')]:_0x2b91e8[_0xf1e3('0x35')];if(!_0x2bfeef[_0xf1e3('0x36')][_0xf1e3('0x3c')](_0xf1e3('0x3d'))){_0x3314e7[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x2bfeef[_0xf1e3('0x36')]['limit']);_0x3314e7['offset']=qs['offset'](_0x2bfeef[_0xf1e3('0x36')][_0xf1e3('0x1e')]);}_0x3314e7[_0xf1e3('0x3e')]=qs[_0xf1e3('0x3f')](_0x2bfeef[_0xf1e3('0x36')][_0xf1e3('0x3f')]);_0x3314e7[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x2bfeef['query'],_0x2b91e8[_0xf1e3('0x38')]),_0x266a1c);if(_0x2bfeef['query'][_0xf1e3('0x42')]){_0x3314e7[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x3314e7[_0xf1e3('0x40')],{'$or':_[_0xf1e3('0x30')](_0x266a1c,function(_0x3b0674){if(_0x3b0674[_0xf1e3('0x44')]!==_0xf1e3('0x45')){var _0x57f718={};_0x57f718[_0x3b0674[_0xf1e3('0x2d')]]={'$like':'%'+_0x2bfeef[_0xf1e3('0x36')]['filter']+'%'};return _0x57f718;}})});}_0x3314e7=_[_0xf1e3('0x43')]({},_0x3314e7,_0x2bfeef[_0xf1e3('0x46')]);var _0x4aab43={'where':_0x3314e7['where']};return db['Campaign']['count'](_0x4aab43)['then'](function(_0x4b3cf1){_0x49fa47[_0xf1e3('0x21')]=_0x4b3cf1;if(_0x2bfeef['query'][_0xf1e3('0x47')]){_0x3314e7['include']=[{'all':!![]}];}return db[_0xf1e3('0x31')][_0xf1e3('0x48')](_0x3314e7);})['then'](function(_0xd13ce6){_0x49fa47[_0xf1e3('0x49')]=_0xd13ce6;return _0x49fa47;})[_0xf1e3('0x28')](respondWithFilteredResult(_0x2c9eb6,_0x3314e7))[_0xf1e3('0x4a')](handleError(_0x2c9eb6,null));};exports[_0xf1e3('0x4b')]=function(_0x57f31c,_0x5997f7){var _0x422dad={'raw':![],'where':{'id':_0x57f31c['params']['id']}},_0x3aa071={};_0x3aa071[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x31')][_0xf1e3('0x32')]);_0x3aa071['query']=_[_0xf1e3('0x37')](_0x57f31c[_0xf1e3('0x36')]);_0x3aa071[_0xf1e3('0x38')]=_[_0xf1e3('0x3a')](_0x3aa071[_0xf1e3('0x35')],_0x3aa071[_0xf1e3('0x36')]);_0x422dad[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x3aa071[_0xf1e3('0x35')],qs['fields'](_0x57f31c[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x422dad['attributes']=_0x422dad[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x422dad[_0xf1e3('0x39')]:_0x3aa071['model'];if(_0x57f31c[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x422dad[_0xf1e3('0x4d')]=[{'all':!![]}];}_0x422dad=_[_0xf1e3('0x43')]({},_0x422dad,_0x57f31c[_0xf1e3('0x46')]);return db['Campaign'][_0xf1e3('0x4e')](_0x422dad)[_0xf1e3('0x28')](handleEntityNotFound(_0x5997f7,null))[_0xf1e3('0x28')](respondWithResult(_0x5997f7,null))['catch'](handleError(_0x5997f7,null));};exports['create']=function(_0x5f0c9d,_0x6c426a){return db[_0xf1e3('0x31')][_0xf1e3('0x4f')](_0x5f0c9d[_0xf1e3('0x50')],{})[_0xf1e3('0x28')](function(_0x452034){var _0x1abfed=_0x5f0c9d['user'][_0xf1e3('0x51')]({'plain':!![]});if(!_0x1abfed)throw new Error(_0xf1e3('0x52'));if(_0x1abfed[_0xf1e3('0x53')]===_0xf1e3('0x54')){var _0x336f86=_0x452034[_0xf1e3('0x51')]({'plain':!![]});var _0x41a687=_0xf1e3('0x55');return db['UserProfileSection'][_0xf1e3('0x4e')]({'where':{'name':_0x41a687,'userProfileId':_0x1abfed['userProfileId']},'raw':!![]})['then'](function(_0x2b8854){if(_0x2b8854&&_0x2b8854['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x336f86[_0xf1e3('0x2d')],'resourceId':_0x336f86['id'],'type':_0x2b8854['name'],'sectionId':_0x2b8854['id']},{})['then'](function(){return _0x452034;});}else{return _0x452034;}})[_0xf1e3('0x4a')](function(_0x2088b6){logger[_0xf1e3('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2088b6);throw _0x2088b6;});}return _0x452034;})[_0xf1e3('0x28')](respondWithResult(_0x6c426a,0xc9))[_0xf1e3('0x4a')](handleError(_0x6c426a,null));};exports[_0xf1e3('0x56')]=function(_0x3683b4,_0x94bf9c){var _0x2317ec={'where':{'id':_0x3683b4['params']['id']}},_0x5159b4={};_0x5159b4[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x31')][_0xf1e3('0x32')]);_0x2317ec[_0xf1e3('0x39')]=_['intersection'](_0x5159b4[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x3683b4[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x2317ec[_0xf1e3('0x39')]=_0x2317ec[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x2317ec['attributes']:_0x5159b4[_0xf1e3('0x35')];if(_0x3683b4[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x2317ec[_0xf1e3('0x4d')]=[{'all':!![]}];}_0x2317ec=_['merge']({},_0x2317ec,_0x3683b4['options']);return db[_0xf1e3('0x31')][_0xf1e3('0x4e')](_0x2317ec)[_0xf1e3('0x28')](handleEntityNotFound(_0x94bf9c,null))[_0xf1e3('0x28')](function(_0x3b0a0d){if(_0x3b0a0d){var _0x2791cd=_0x3b0a0d[_0xf1e3('0x51')]({'plain':!![]});_0x2791cd=qs[_0xf1e3('0x57')](_0x2791cd,['id','createdAt',_0xf1e3('0x58')]);_0x3683b4[_0xf1e3('0x50')]=_[_0xf1e3('0x57')](_0x3683b4[_0xf1e3('0x50')],['id',_0xf1e3('0x59'),'updatedAt']);return db[_0xf1e3('0x31')]['create'](_[_0xf1e3('0x43')](_0x2791cd,_0x3683b4[_0xf1e3('0x50')]),{'include':_0x3683b4[_0xf1e3('0x36')][_0xf1e3('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x235241){var _0x51e7cb=_0x3683b4[_0xf1e3('0x54')]['get']({'plain':!![]});if(!_0x51e7cb)throw new Error(_0xf1e3('0x52'));if(_0x51e7cb[_0xf1e3('0x53')]===_0xf1e3('0x54')){var _0x4bcbe0=_0x235241[_0xf1e3('0x51')]({'plain':!![]});var _0x53f97b='IvrCampaigns';return db['UserProfileSection'][_0xf1e3('0x4e')]({'where':{'name':_0x53f97b,'userProfileId':_0x51e7cb[_0xf1e3('0x5a')]},'raw':!![]})[_0xf1e3('0x28')](function(_0x4053e2){if(_0x4053e2&&_0x4053e2[_0xf1e3('0x5b')]===0x0){return db[_0xf1e3('0x2a')][_0xf1e3('0x4f')]({'name':_0x4bcbe0[_0xf1e3('0x2d')],'resourceId':_0x4bcbe0['id'],'type':_0x4053e2[_0xf1e3('0x2d')],'sectionId':_0x4053e2['id']},{})['then'](function(){return _0x235241;});}else{return _0x235241;}})[_0xf1e3('0x4a')](function(_0x18e34b){logger[_0xf1e3('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18e34b);throw _0x18e34b;});}return _0x235241;});}})[_0xf1e3('0x28')](respondWithResult(_0x94bf9c,0xc9))['catch'](handleError(_0x94bf9c,null));};exports[_0xf1e3('0x27')]=function(_0x10de9c,_0x445a54){if(_0x10de9c[_0xf1e3('0x50')]['id']){delete _0x10de9c['body']['id'];}return db[_0xf1e3('0x31')]['find']({'where':{'id':_0x10de9c[_0xf1e3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x445a54,null))[_0xf1e3('0x28')](saveUpdates(_0x10de9c[_0xf1e3('0x50')],null))[_0xf1e3('0x28')](respondWithResult(_0x445a54,null))[_0xf1e3('0x4a')](handleError(_0x445a54,null));};exports[_0xf1e3('0x29')]=function(_0x36d983,_0x3d5d4a){return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x36d983['params']['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x3d5d4a,null))[_0xf1e3('0x28')](removeEntity(_0x3d5d4a,null))['catch'](handleError(_0x3d5d4a,null));};exports['getHoppers']=function(_0x103f28,_0x268fa0,_0x1af105){var _0x2a457d={'raw':!![],'where':{}};var _0x1e0c65={};var _0x2fb15d={'count':0x0,'rows':[]};return db[_0xf1e3('0x31')]['findOne']({'where':{'id':_0x103f28[_0xf1e3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x268fa0,null))[_0xf1e3('0x28')](function(_0x410fc6){if(_0x410fc6){_0x1e0c65['model']=_[_0xf1e3('0x37')](db['CmHopper']['rawAttributes']);_0x1e0c65[_0xf1e3('0x36')]=_[_0xf1e3('0x37')](_0x103f28[_0xf1e3('0x36')]);_0x1e0c65[_0xf1e3('0x38')]=_[_0xf1e3('0x3a')](_0x1e0c65['model'],_0x1e0c65['query']);_0x2a457d['attributes']=_[_0xf1e3('0x3a')](_0x1e0c65[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x103f28[_0xf1e3('0x36')]['fields']));_0x2a457d[_0xf1e3('0x39')]=_0x2a457d['attributes'][_0xf1e3('0x4c')]?_0x2a457d['attributes']:_0x1e0c65[_0xf1e3('0x35')];if(!_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x3c')]('nolimit')){_0x2a457d[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x103f28[_0xf1e3('0x36')]['limit']);_0x2a457d[_0xf1e3('0x1e')]=qs[_0xf1e3('0x1e')](_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x1e')]);}_0x2a457d[_0xf1e3('0x3e')]=qs['sort'](_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x3f')]);_0x2a457d['where']=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x103f28['query'],_0x1e0c65[_0xf1e3('0x38')]));_0x2a457d[_0xf1e3('0x40')][_0xf1e3('0x5d')]=_0x410fc6['id'];if(_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x42')]){_0x2a457d['where']=_['merge'](_0x2a457d['where'],{'$or':_[_0xf1e3('0x30')](_0x2a457d['attributes'],function(_0x1f57b7){var _0x442c78={};_0x442c78[_0x1f57b7]={'$like':'%'+_0x103f28['query'][_0xf1e3('0x42')]+'%'};return _0x442c78;})});}_0x2a457d=_[_0xf1e3('0x43')]({},_0x2a457d,_0x103f28[_0xf1e3('0x46')]);return db[_0xf1e3('0x5e')][_0xf1e3('0x21')]({'where':_0x2a457d['where']})[_0xf1e3('0x28')](function(_0x5b1a70){_0x2fb15d[_0xf1e3('0x21')]=_0x5b1a70;if(_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x2a457d[_0xf1e3('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0xf1e3('0x48')](_0x2a457d);})['then'](function(_0x252751){_0x2fb15d['rows']=_0x252751;return _0x2fb15d;});}})['then'](respondWithFilteredResult(_0x268fa0,_0x2a457d))[_0xf1e3('0x4a')](handleError(_0x268fa0,null));};exports['getHopperHistories']=function(_0x1b5434,_0x2c0ecf,_0x4f729a){var _0x4fca8b={'raw':!![],'where':{}};var _0x3d3d9f={};var _0xd8ddbb={'count':0x0,'rows':[]};return db[_0xf1e3('0x31')]['findOne']({'where':{'id':_0x1b5434[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x2c0ecf,null))['then'](function(_0x1fd997){if(_0x1fd997){_0x3d3d9f[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db['CmHopperHistory'][_0xf1e3('0x32')]);_0x3d3d9f[_0xf1e3('0x36')]=_['keys'](_0x1b5434[_0xf1e3('0x36')]);_0x3d3d9f[_0xf1e3('0x38')]=_[_0xf1e3('0x3a')](_0x3d3d9f[_0xf1e3('0x35')],_0x3d3d9f[_0xf1e3('0x36')]);_0x4fca8b['attributes']=_[_0xf1e3('0x3a')](_0x3d3d9f[_0xf1e3('0x35')],qs['fields'](_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x4fca8b[_0xf1e3('0x39')]=_0x4fca8b[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x4fca8b[_0xf1e3('0x39')]:_0x3d3d9f['model'];if(!_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x3c')]('nolimit')){_0x4fca8b[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x1b5434[_0xf1e3('0x36')]['limit']);_0x4fca8b[_0xf1e3('0x1e')]=qs['offset'](_0x1b5434['query'][_0xf1e3('0x1e')]);}_0x4fca8b[_0xf1e3('0x3e')]=qs[_0xf1e3('0x3f')](_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x3f')]);_0x4fca8b[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_['pick'](_0x1b5434['query'],_0x3d3d9f['filters']));_0x4fca8b[_0xf1e3('0x40')][_0xf1e3('0x5d')]=_0x1fd997['id'];if(_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x42')]){_0x4fca8b[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x4fca8b['where'],{'$or':_[_0xf1e3('0x30')](_0x4fca8b[_0xf1e3('0x39')],function(_0x5e8d12){var _0x2a646b={};_0x2a646b[_0x5e8d12]={'$like':'%'+_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x42')]+'%'};return _0x2a646b;})});}_0x4fca8b=_[_0xf1e3('0x43')]({},_0x4fca8b,_0x1b5434['options']);return db[_0xf1e3('0x5f')][_0xf1e3('0x21')]({'where':_0x4fca8b[_0xf1e3('0x40')]})[_0xf1e3('0x28')](function(_0x5a24c5){_0xd8ddbb[_0xf1e3('0x21')]=_0x5a24c5;if(_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x4fca8b[_0xf1e3('0x4d')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4fca8b);})[_0xf1e3('0x28')](function(_0x37a285){_0xd8ddbb[_0xf1e3('0x49')]=_0x37a285;return _0xd8ddbb;});}})[_0xf1e3('0x28')](respondWithFilteredResult(_0x2c0ecf,_0x4fca8b))[_0xf1e3('0x4a')](handleError(_0x2c0ecf,null));};exports[_0xf1e3('0x60')]=function(_0x284999,_0x5d1c96,_0x3c8aa1){var _0x16e75f={'raw':!![],'where':{}};var _0x13f9b3={};var _0x49126f={'count':0x0,'rows':[]};return db[_0xf1e3('0x31')]['findOne']({'where':{'id':_0x284999[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x5d1c96,null))['then'](function(_0x1d804a){if(_0x1d804a){_0x13f9b3[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x61')][_0xf1e3('0x32')]);_0x13f9b3['query']=_[_0xf1e3('0x37')](_0x284999['query']);_0x13f9b3['filters']=_[_0xf1e3('0x3a')](_0x13f9b3[_0xf1e3('0x35')],_0x13f9b3[_0xf1e3('0x36')]);_0x16e75f[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x13f9b3[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x284999[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x16e75f[_0xf1e3('0x39')]=_0x16e75f[_0xf1e3('0x39')]['length']?_0x16e75f['attributes']:_0x13f9b3['model'];if(!_0x284999[_0xf1e3('0x36')][_0xf1e3('0x3c')]('nolimit')){_0x16e75f[_0xf1e3('0x20')]=qs['limit'](_0x284999[_0xf1e3('0x36')][_0xf1e3('0x20')]);_0x16e75f[_0xf1e3('0x1e')]=qs[_0xf1e3('0x1e')](_0x284999[_0xf1e3('0x36')][_0xf1e3('0x1e')]);}_0x16e75f['order']=qs[_0xf1e3('0x3f')](_0x284999[_0xf1e3('0x36')]['sort']);_0x16e75f['where']=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x284999[_0xf1e3('0x36')],_0x13f9b3[_0xf1e3('0x38')]));_0x16e75f['where'][_0xf1e3('0x5d')]=_0x1d804a['id'];if(_0x284999[_0xf1e3('0x36')]['filter']){_0x16e75f[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x16e75f['where'],{'$or':_[_0xf1e3('0x30')](_0x16e75f[_0xf1e3('0x39')],function(_0x569ce5){var _0x3d5d87={};_0x3d5d87[_0x569ce5]={'$like':'%'+_0x284999[_0xf1e3('0x36')]['filter']+'%'};return _0x3d5d87;})});}_0x16e75f=_['merge']({},_0x16e75f,_0x284999[_0xf1e3('0x46')]);return db['CmHopperFinal'][_0xf1e3('0x21')]({'where':_0x16e75f[_0xf1e3('0x40')]})[_0xf1e3('0x28')](function(_0x5e5a7a){_0x49126f[_0xf1e3('0x21')]=_0x5e5a7a;if(_0x284999['query'][_0xf1e3('0x47')]){_0x16e75f[_0xf1e3('0x4d')]=[{'all':!![]}];}return db[_0xf1e3('0x61')][_0xf1e3('0x48')](_0x16e75f);})[_0xf1e3('0x28')](function(_0x3b7aaa){_0x49126f[_0xf1e3('0x49')]=_0x3b7aaa;return _0x49126f;});}})[_0xf1e3('0x28')](respondWithFilteredResult(_0x5d1c96,_0x16e75f))[_0xf1e3('0x4a')](handleError(_0x5d1c96,null));};exports[_0xf1e3('0x62')]=function(_0x2d1023,_0x236df5,_0x7112ca){var _0x13e07f={'raw':!![],'where':{}};var _0x5be996={};var _0x4a01f9={'count':0x0,'rows':[]};return db[_0xf1e3('0x31')][_0xf1e3('0x63')]({'where':{'id':_0x2d1023[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x236df5,null))[_0xf1e3('0x28')](function(_0x19edd6){if(_0x19edd6){_0x5be996[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db['CmHopperBlack']['rawAttributes']);_0x5be996[_0xf1e3('0x36')]=_['keys'](_0x2d1023[_0xf1e3('0x36')]);_0x5be996[_0xf1e3('0x38')]=_['intersection'](_0x5be996['model'],_0x5be996[_0xf1e3('0x36')]);_0x13e07f[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x5be996[_0xf1e3('0x35')],qs['fields'](_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x13e07f[_0xf1e3('0x39')]=_0x13e07f[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x13e07f['attributes']:_0x5be996[_0xf1e3('0x35')];if(!_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x3c')](_0xf1e3('0x3d'))){_0x13e07f[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x2d1023['query'][_0xf1e3('0x20')]);_0x13e07f[_0xf1e3('0x1e')]=qs[_0xf1e3('0x1e')](_0x2d1023['query']['offset']);}_0x13e07f[_0xf1e3('0x3e')]=qs[_0xf1e3('0x3f')](_0x2d1023[_0xf1e3('0x36')]['sort']);_0x13e07f[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x2d1023[_0xf1e3('0x36')],_0x5be996[_0xf1e3('0x38')]));_0x13e07f[_0xf1e3('0x40')][_0xf1e3('0x5d')]=_0x19edd6['id'];if(_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x42')]){_0x13e07f[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x13e07f[_0xf1e3('0x40')],{'$or':_['map'](_0x13e07f[_0xf1e3('0x39')],function(_0x3c4674){var _0x360900={};_0x360900[_0x3c4674]={'$like':'%'+_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x42')]+'%'};return _0x360900;})});}_0x13e07f=_['merge']({},_0x13e07f,_0x2d1023['options']);return db[_0xf1e3('0x64')][_0xf1e3('0x21')]({'where':_0x13e07f['where']})[_0xf1e3('0x28')](function(_0x11e94e){_0x4a01f9[_0xf1e3('0x21')]=_0x11e94e;if(_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x13e07f[_0xf1e3('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf1e3('0x48')](_0x13e07f);})[_0xf1e3('0x28')](function(_0x309fb8){_0x4a01f9[_0xf1e3('0x49')]=_0x309fb8;return _0x4a01f9;});}})[_0xf1e3('0x28')](respondWithFilteredResult(_0x236df5,_0x13e07f))[_0xf1e3('0x4a')](handleError(_0x236df5,null));};exports['getLists']=function(_0xe5eab9,_0x59a29e,_0x1589c3){var _0x536cfb={};var _0x44d67c={};var _0x1e4930;var _0x487aef;return db[_0xf1e3('0x31')][_0xf1e3('0x63')]({'where':{'id':_0xe5eab9[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x59a29e,null))[_0xf1e3('0x28')](function(_0x221d1a){if(_0x221d1a){_0x1e4930=_0x221d1a;_0x44d67c[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x65')][_0xf1e3('0x32')]);_0x44d67c[_0xf1e3('0x36')]=_[_0xf1e3('0x37')](_0xe5eab9[_0xf1e3('0x36')]);_0x44d67c[_0xf1e3('0x38')]=_['intersection'](_0x44d67c[_0xf1e3('0x35')],_0x44d67c[_0xf1e3('0x36')]);_0x536cfb[_0xf1e3('0x39')]=_['intersection'](_0x44d67c[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0xe5eab9['query'][_0xf1e3('0x3b')]));_0x536cfb[_0xf1e3('0x39')]=_0x536cfb['attributes'][_0xf1e3('0x4c')]?_0x536cfb[_0xf1e3('0x39')]:_0x44d67c[_0xf1e3('0x35')];_0x536cfb['order']=qs[_0xf1e3('0x3f')](_0xe5eab9['query'][_0xf1e3('0x3f')]);_0x536cfb[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0xe5eab9[_0xf1e3('0x36')],_0x44d67c['filters']));if(_0xe5eab9[_0xf1e3('0x36')]['filter']){_0x536cfb[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x536cfb[_0xf1e3('0x40')],{'$or':_[_0xf1e3('0x30')](_0x536cfb[_0xf1e3('0x39')],function(_0x40672a){var _0x4f887a={};_0x4f887a[_0x40672a]={'$like':'%'+_0xe5eab9['query'][_0xf1e3('0x42')]+'%'};return _0x4f887a;})});}_0x536cfb=_[_0xf1e3('0x43')]({},_0x536cfb,_0xe5eab9[_0xf1e3('0x46')]);return _0x1e4930[_0xf1e3('0x66')](_0x536cfb);}})['then'](function(_0x444bbf){if(_0x444bbf){_0x487aef=_0x444bbf[_0xf1e3('0x4c')];if(!_0xe5eab9[_0xf1e3('0x36')][_0xf1e3('0x3c')](_0xf1e3('0x3d'))){_0x536cfb['limit']=qs[_0xf1e3('0x20')](_0xe5eab9[_0xf1e3('0x36')][_0xf1e3('0x20')]);_0x536cfb[_0xf1e3('0x1e')]=qs[_0xf1e3('0x1e')](_0xe5eab9['query'][_0xf1e3('0x1e')]);}return _0x1e4930[_0xf1e3('0x66')](_0x536cfb);}})[_0xf1e3('0x28')](function(_0x195fb5){if(_0x195fb5){return _0x195fb5?{'count':_0x487aef,'rows':_0x195fb5}:null;}})[_0xf1e3('0x28')](respondWithResult(_0x59a29e,null))[_0xf1e3('0x4a')](handleError(_0x59a29e,null));};exports[_0xf1e3('0x67')]=function(_0x206f4b,_0x1976ad,_0x4c5a75){var _0x21c03c,_0x2c77b4;return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x206f4b[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x1976ad,null))['then'](function(_0x2b652d){if(_0x2b652d){_0x2c77b4=_0x2b652d;return _0x2b652d[_0xf1e3('0x67')](_0x206f4b[_0xf1e3('0x50')][_0xf1e3('0x68')],_['omit'](_0x206f4b[_0xf1e3('0x50')],[_0xf1e3('0x68'),'id'])||{});}return null;})[_0xf1e3('0x69')](function(_0xb1ac00){var _0x332864;_0x21c03c=_0xb1ac00||[];var _0x4be2bf=[];if(_0xb1ac00){for(var _0x3394bc=0x0;_0x3394bc<_0xb1ac00[_0xf1e3('0x4c')];_0x3394bc+=0x1){var _0x24761c=_0xb1ac00[_0x3394bc][_0xf1e3('0x51')]({'plain':!![]});_0x2c77b4[_0xf1e3('0x6a')]=_0x206f4b[_0xf1e3('0x50')][_0xf1e3('0x6a')]?_0x206f4b[_0xf1e3('0x50')][_0xf1e3('0x6a')]:_0x2c77b4[_0xf1e3('0x6a')];switch(_0x2c77b4[_0xf1e3('0x6a')]){case'always':_0x332864=squel[_0xf1e3('0x6b')]()[_0xf1e3('0x6c')]('cm_hopper')['fromQuery']([_0xf1e3('0x6d'),'scheduledAt',_0xf1e3('0x6e'),'ListId','CampaignId',_0xf1e3('0x59'),_0xf1e3('0x58')],squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')](_0xf1e3('0x6d'),'phone')[_0xf1e3('0x70')]('NOW()','scheduledAt')[_0xf1e3('0x70')]('id',_0xf1e3('0x6e'))[_0xf1e3('0x70')](_0x24761c['CmListId']['toString'](),_0xf1e3('0x71'))[_0xf1e3('0x70')](_0x206f4b[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')](),_0xf1e3('0x5d'))['field'](_0xf1e3('0x73'),_0xf1e3('0x59'))['field'](_0xf1e3('0x73'),_0xf1e3('0x58'))[_0xf1e3('0x74')](_0xf1e3('0x75'))[_0xf1e3('0x40')](_0xf1e3('0x76'))[_0xf1e3('0x40')]('ListId\x20=\x20?',_0x24761c[_0xf1e3('0x77')][_0xf1e3('0x72')]())[_0xf1e3('0x40')](_0xf1e3('0x78'))[_0xf1e3('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')](_0xf1e3('0x79'))[_0xf1e3('0x74')]('cm_hopper_final')[_0xf1e3('0x40')](_0xf1e3('0x7a'),_0x206f4b[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')]()))[_0xf1e3('0x40')](_0xf1e3('0x7b'),squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')]('COALESCE(phone,\x27\x27)')[_0xf1e3('0x74')](_0xf1e3('0x7c'))[_0xf1e3('0x40')](_0xf1e3('0x7a'),_0x206f4b['params']['id'][_0xf1e3('0x72')]())))[_0xf1e3('0x72')]();break;case'onlyIfOpen':_0x332864=squel[_0xf1e3('0x6b')]()[_0xf1e3('0x6c')]('cm_hopper')[_0xf1e3('0x7d')]([_0xf1e3('0x6d'),_0xf1e3('0x7e'),_0xf1e3('0x6e'),_0xf1e3('0x71'),'CampaignId','createdAt','updatedAt'],squel[_0xf1e3('0x6f')]()['field'](_0xf1e3('0x6d'),_0xf1e3('0x6d'))[_0xf1e3('0x70')](_0xf1e3('0x73'),_0xf1e3('0x7e'))[_0xf1e3('0x70')]('id',_0xf1e3('0x6e'))[_0xf1e3('0x70')](_0x24761c['CmListId'][_0xf1e3('0x72')](),_0xf1e3('0x71'))['field'](_0x206f4b[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')](),_0xf1e3('0x5d'))[_0xf1e3('0x70')](_0xf1e3('0x73'),'createdAt')[_0xf1e3('0x70')](_0xf1e3('0x73'),'updatedAt')['from'](_0xf1e3('0x75'))[_0xf1e3('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0xf1e3('0x7f'),_0x24761c[_0xf1e3('0x77')][_0xf1e3('0x72')]())[_0xf1e3('0x40')](_0xf1e3('0x78'))[_0xf1e3('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')]('COALESCE(phone,\x27\x27)')[_0xf1e3('0x74')](_0xf1e3('0x7c'))[_0xf1e3('0x40')]('CampaignId\x20=\x20?',_0x206f4b[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')]())))[_0xf1e3('0x72')]();break;default:_0x332864=squel[_0xf1e3('0x6b')]()[_0xf1e3('0x6c')](_0xf1e3('0x7c'))[_0xf1e3('0x7d')]([_0xf1e3('0x6d'),_0xf1e3('0x7e'),_0xf1e3('0x6e'),_0xf1e3('0x71'),_0xf1e3('0x5d'),_0xf1e3('0x59'),'updatedAt'],squel[_0xf1e3('0x6f')]()['field']('phone','phone')[_0xf1e3('0x70')](_0xf1e3('0x73'),_0xf1e3('0x7e'))[_0xf1e3('0x70')]('id',_0xf1e3('0x6e'))['field'](_0x24761c[_0xf1e3('0x77')][_0xf1e3('0x72')](),_0xf1e3('0x71'))['field'](_0x206f4b['params']['id'][_0xf1e3('0x72')](),_0xf1e3('0x5d'))[_0xf1e3('0x70')]('NOW()',_0xf1e3('0x59'))[_0xf1e3('0x70')]('NOW()',_0xf1e3('0x58'))['from']('cm_contacts')[_0xf1e3('0x40')](_0xf1e3('0x76'))[_0xf1e3('0x40')](_0xf1e3('0x7f'),_0x24761c[_0xf1e3('0x77')]['toString']())[_0xf1e3('0x40')](_0xf1e3('0x78')))['toString']();}_0x4be2bf[_0xf1e3('0x80')](db[_0xf1e3('0x81')][_0xf1e3('0x36')](_0x332864));}return BPromise[_0xf1e3('0x82')](_0x4be2bf);}})[_0xf1e3('0x28')](function(){return _0x21c03c;})[_0xf1e3('0x28')](respondWithResult(_0x1976ad,null))[_0xf1e3('0x4a')](handleError(_0x1976ad,null));};exports[_0xf1e3('0x83')]=function(_0x51d362,_0x357243,_0x7a942e){return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x51d362[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x357243,null))[_0xf1e3('0x28')](function(_0x7282d3){if(_0x7282d3){return _0x7282d3[_0xf1e3('0x83')](_0x51d362[_0xf1e3('0x36')][_0xf1e3('0x68')]);}})[_0xf1e3('0x28')](function(_0x14fac9){if(_0x14fac9){return db[_0xf1e3('0x5e')][_0xf1e3('0x29')]({'where':{'ListId':_0x51d362[_0xf1e3('0x36')][_0xf1e3('0x68')],'CampaignId':_0x51d362[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](function(){return _0x14fac9;});}})[_0xf1e3('0x28')](respondWithStatusCode(_0x357243,null))['catch'](handleError(_0x357243,null));};exports['getBlackLists']=function(_0x275c09,_0x305bcc,_0x3cd3fe){var _0x31dc9a={};var _0xc3df5a={};var _0x13d3ee;var _0x380a8a;return db[_0xf1e3('0x31')][_0xf1e3('0x63')]({'where':{'id':_0x275c09['params']['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x305bcc,null))[_0xf1e3('0x28')](function(_0x2d4571){if(_0x2d4571){_0x13d3ee=_0x2d4571;_0xc3df5a[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x65')][_0xf1e3('0x32')]);_0xc3df5a[_0xf1e3('0x36')]=_[_0xf1e3('0x37')](_0x275c09[_0xf1e3('0x36')]);_0xc3df5a['filters']=_[_0xf1e3('0x3a')](_0xc3df5a[_0xf1e3('0x35')],_0xc3df5a[_0xf1e3('0x36')]);_0x31dc9a[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0xc3df5a[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x275c09[_0xf1e3('0x36')]['fields']));_0x31dc9a['attributes']=_0x31dc9a[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x31dc9a[_0xf1e3('0x39')]:_0xc3df5a[_0xf1e3('0x35')];_0x31dc9a[_0xf1e3('0x3e')]=qs['sort'](_0x275c09[_0xf1e3('0x36')][_0xf1e3('0x3f')]);_0x31dc9a[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x275c09[_0xf1e3('0x36')],_0xc3df5a[_0xf1e3('0x38')]));if(_0x275c09[_0xf1e3('0x36')][_0xf1e3('0x42')]){_0x31dc9a[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x31dc9a[_0xf1e3('0x40')],{'$or':_['map'](_0x31dc9a[_0xf1e3('0x39')],function(_0x6a3cce){var _0x52d53b={};_0x52d53b[_0x6a3cce]={'$like':'%'+_0x275c09[_0xf1e3('0x36')][_0xf1e3('0x42')]+'%'};return _0x52d53b;})});}_0x31dc9a=_['merge']({},_0x31dc9a,_0x275c09['options']);return _0x13d3ee[_0xf1e3('0x84')](_0x31dc9a);}})['then'](function(_0x40956b){if(_0x40956b){_0x380a8a=_0x40956b[_0xf1e3('0x4c')];if(!_0x275c09['query'][_0xf1e3('0x3c')](_0xf1e3('0x3d'))){_0x31dc9a[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x275c09['query'][_0xf1e3('0x20')]);_0x31dc9a['offset']=qs[_0xf1e3('0x1e')](_0x275c09[_0xf1e3('0x36')]['offset']);}return _0x13d3ee[_0xf1e3('0x84')](_0x31dc9a);}})[_0xf1e3('0x28')](function(_0x1dbc2f){if(_0x1dbc2f){return _0x1dbc2f?{'count':_0x380a8a,'rows':_0x1dbc2f}:null;}})['then'](respondWithResult(_0x305bcc,null))[_0xf1e3('0x4a')](handleError(_0x305bcc,null));};exports[_0xf1e3('0x85')]=function(_0x4cc4a1,_0x76bcbf,_0xf3d7a4){var _0x4f733f,_0x31e024;return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x4cc4a1[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x76bcbf,null))[_0xf1e3('0x28')](function(_0x33669c){if(_0x33669c){_0x31e024=_0x33669c;return _0x33669c[_0xf1e3('0x85')](_0x4cc4a1['body'][_0xf1e3('0x68')],_[_0xf1e3('0x57')](_0x4cc4a1[_0xf1e3('0x50')],['ids','id'])||{});}return null;})['spread'](function(_0x3d0781){var _0x4b66dd;_0x4f733f=_0x3d0781||[];var _0x1d604a=[];if(_0x3d0781){for(var _0x3cc0ee=0x0;_0x3cc0ee<_0x3d0781['length'];_0x3cc0ee+=0x1){var _0xc1e4ba=_0x3d0781[_0x3cc0ee][_0xf1e3('0x51')]({'plain':!![]});_0x4b66dd=squel['insert']()[_0xf1e3('0x6c')](_0xf1e3('0x86'))[_0xf1e3('0x7d')](['phone',_0xf1e3('0x6e'),_0xf1e3('0x71'),_0xf1e3('0x5d'),'createdAt','updatedAt'],squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')](_0xf1e3('0x6d'),_0xf1e3('0x6d'))[_0xf1e3('0x70')]('id',_0xf1e3('0x6e'))['field'](_0xc1e4ba[_0xf1e3('0x77')][_0xf1e3('0x72')](),_0xf1e3('0x71'))[_0xf1e3('0x70')](_0x4cc4a1[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')](),_0xf1e3('0x5d'))[_0xf1e3('0x70')](_0xf1e3('0x73'),_0xf1e3('0x59'))['field']('NOW()',_0xf1e3('0x58'))[_0xf1e3('0x74')](_0xf1e3('0x75'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xf1e3('0x7f'),_0xc1e4ba[_0xf1e3('0x77')][_0xf1e3('0x72')]())['where'](_0xf1e3('0x78')))[_0xf1e3('0x72')]();_0x1d604a['push'](db[_0xf1e3('0x81')][_0xf1e3('0x36')](_0x4b66dd));}return BPromise[_0xf1e3('0x82')](_0x1d604a);}})[_0xf1e3('0x28')](function(){return _0x4f733f;})[_0xf1e3('0x28')](respondWithResult(_0x76bcbf,null))[_0xf1e3('0x4a')](handleError(_0x76bcbf,null));};exports[_0xf1e3('0x87')]=function(_0x52e523,_0x51c131,_0x1719f1){return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x52e523['params']['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x51c131,null))['then'](function(_0x42639f){if(_0x42639f){return _0x42639f[_0xf1e3('0x87')](_0x52e523[_0xf1e3('0x36')][_0xf1e3('0x68')]);}})['then'](function(_0x45fd13){if(_0x45fd13){return db['CmHopperBlack'][_0xf1e3('0x29')]({'where':{'ListId':_0x52e523['query'][_0xf1e3('0x68')],'CampaignId':_0x52e523[_0xf1e3('0x5c')]['id']}})['then'](function(){return _0x45fd13;});}})['then'](respondWithStatusCode(_0x51c131,null))['catch'](handleError(_0x51c131,null));};
\ No newline at end of file
index 03c6e75..8e567fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2ab276,_0x2fc401){var _0x46dfb1=function(_0x44f9fc){while(--_0x44f9fc){_0x2ab276['push'](_0x2ab276['shift']());}};_0x46dfb1(++_0x2fc401);}(_0x7a54,0x106));var _0x47a5=function(_0x4c3fe6,_0x3248c8){_0x4c3fe6=_0x4c3fe6-0x0;var _0x105bb1=_0x7a54[_0x4c3fe6];return _0x105bb1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3f581f,_0x4ea03c){var _0x1e0d19=function(_0x2b9d8a){while(--_0x2b9d8a){_0x3f581f['push'](_0x3f581f['shift']());}};_0x1e0d19(++_0x4ea03c);}(_0x7a54,0x106));var _0x47a5=function(_0x6cd864,_0x2f4c05){_0x6cd864=_0x6cd864-0x0;var _0xa1c1ae=_0x7a54[_0x6cd864];return _0xa1c1ae;};'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 bc23b43..6e95b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0506=['Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCampaign','Campaign','options','attributes','limit','include','map','model','then','lodash','util','moment','../../config/utils','rpc','client','http','request','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x0506,0x1d1));var _0x6050=function(_0x2dbc40,_0x16874f){_0x2dbc40=_0x2dbc40-0x0;var _0x38f85f=_0x0506[_0x2dbc40];return _0x38f85f;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var moment=require(_0x6050('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6050('0x3'));var logger=require('../../config/logger')(_0x6050('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6050('0x5')][_0x6050('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2a3644,_0x1a89fb,_0x3512ba){return new BPromise(function(_0xf64de5,_0x4068d3){return client[_0x6050('0x7')](_0x2a3644,_0x3512ba)['then'](function(_0x312217){logger['info'](_0x6050('0x8'),_0x1a89fb,_0x6050('0x9'));logger[_0x6050('0xa')](_0x6050('0xb'),_0x1a89fb,_0x6050('0x9'),JSON[_0x6050('0xc')](_0x312217));if(_0x312217[_0x6050('0xd')]){if(_0x312217[_0x6050('0xd')][_0x6050('0xe')]===0x1f4){logger[_0x6050('0xd')]('Campaign,\x20%s,\x20%s',_0x1a89fb,_0x312217[_0x6050('0xd')]['message']);return _0x4068d3(_0x312217[_0x6050('0xd')][_0x6050('0xf')]);}logger[_0x6050('0xd')](_0x6050('0x8'),_0x1a89fb,_0x312217['error'][_0x6050('0xf')]);return _0xf64de5(_0x312217['error'][_0x6050('0xf')]);}else{logger[_0x6050('0x10')](_0x6050('0x8'),_0x1a89fb,_0x6050('0x9'));_0xf64de5(_0x312217[_0x6050('0x11')][_0x6050('0xf')]);}})[_0x6050('0x12')](function(_0x388de4){logger[_0x6050('0xd')](_0x6050('0x8'),_0x1a89fb,_0x388de4);_0x4068d3(_0x388de4);});});}exports[_0x6050('0x13')]=function(_0x347899){var _0x47f33f=this;return new Promise(function(_0x1dd507,_0x3e1ef6){return db[_0x6050('0x14')]['findAll']({'raw':_0x347899['options']?_0x347899['options']['raw']===undefined?!![]:![]:!![],'where':_0x347899[_0x6050('0x15')]?_0x347899[_0x6050('0x15')]['where']||null:null,'attributes':_0x347899[_0x6050('0x15')]?_0x347899[_0x6050('0x15')][_0x6050('0x16')]||null:null,'limit':_0x347899[_0x6050('0x15')]?_0x347899[_0x6050('0x15')][_0x6050('0x17')]||null:null,'include':_0x347899['options']?_0x347899[_0x6050('0x15')][_0x6050('0x18')]?_[_0x6050('0x19')](_0x347899[_0x6050('0x15')][_0x6050('0x18')],function(_0x178d58){return{'model':db[_0x178d58[_0x6050('0x1a')]],'as':_0x178d58['as'],'attributes':_0x178d58[_0x6050('0x16')],'include':_0x178d58['include']?_[_0x6050('0x19')](_0x178d58['include'],function(_0x2a991b){return{'model':db[_0x2a991b[_0x6050('0x1a')]],'as':_0x2a991b['as'],'attributes':_0x2a991b[_0x6050('0x16')],'include':_0x2a991b[_0x6050('0x18')]?_[_0x6050('0x19')](_0x2a991b[_0x6050('0x18')],function(_0x4b46e0){return{'model':db[_0x4b46e0[_0x6050('0x1a')]],'as':_0x4b46e0['as'],'attributes':_0x4b46e0[_0x6050('0x16')]};}):[]};}):[]};}):[]:[]})[_0x6050('0x1b')](function(_0x38d135){logger['info'](_0x6050('0x13'),_0x347899);logger[_0x6050('0xa')](_0x6050('0x13'),_0x347899,JSON[_0x6050('0xc')](_0x38d135));_0x1dd507(_0x38d135);})[_0x6050('0x12')](function(_0x1cc3c0){logger[_0x6050('0xd')]('GetCampaign',_0x1cc3c0[_0x6050('0xf')],_0x347899);_0x3e1ef6(_0x47f33f[_0x6050('0xd')](0x1f4,_0x1cc3c0[_0x6050('0xf')]));});});};
\ No newline at end of file
+var _0xc6d8=['request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','model','attributes','map','include','then','GetCampaign','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x266d29,_0x2b6b29){var _0x33bbbd=function(_0x3b934d){while(--_0x3b934d){_0x266d29['push'](_0x266d29['shift']());}};_0x33bbbd(++_0x2b6b29);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x195690,_0x13d76e){_0x195690=_0x195690-0x0;var _0xcd8219=_0xc6d8[_0x195690];return _0xcd8219;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Campaign,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['GetCampaign']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['Campaign'][_0x8c6d('0x13')]({'raw':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')][_0x8c6d('0x15')]===undefined?!![]:![]:!![],'where':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['where']||null:null,'attributes':_0x3e5495['options']?_0x3e5495[_0x8c6d('0x14')]['attributes']||null:null,'limit':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['limit']||null:null,'include':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')]['include']?_['map'](_0x3e5495['options']['include'],function(_0x2a85b5){return{'model':db[_0x2a85b5[_0x8c6d('0x16')]],'as':_0x2a85b5['as'],'attributes':_0x2a85b5[_0x8c6d('0x17')],'include':_0x2a85b5['include']?_[_0x8c6d('0x18')](_0x2a85b5['include'],function(_0x15a9c4){return{'model':db[_0x15a9c4['model']],'as':_0x15a9c4['as'],'attributes':_0x15a9c4[_0x8c6d('0x17')],'include':_0x15a9c4[_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x15a9c4[_0x8c6d('0x19')],function(_0x1e6755){return{'model':db[_0x1e6755[_0x8c6d('0x16')]],'as':_0x1e6755['as'],'attributes':_0x1e6755[_0x8c6d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6d('0x1a')](function(_0x3eab38){logger['info']('GetCampaign',_0x3e5495);logger[_0x8c6d('0xd')](_0x8c6d('0x1b'),_0x3e5495,JSON[_0x8c6d('0xf')](_0x3eab38));_0x4c2f8d(_0x3eab38);})[_0x8c6d('0x12')](function(_0x370626){logger[_0x8c6d('0x10')](_0x8c6d('0x1b'),_0x370626[_0x8c6d('0x11')],_0x3e5495);_0x21b8ee(_0x5a22de[_0x8c6d('0x10')](0x1f4,_0x370626[_0x8c6d('0x11')]));});});};
\ No newline at end of file
index c5600b7..34b1d92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5099=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show'];(function(_0x4a6466,_0x1ea855){var _0x11d7c0=function(_0xc1c69a){while(--_0xc1c69a){_0x4a6466['push'](_0x4a6466['shift']());}};_0x11d7c0(++_0x1ea855);}(_0x5099,0x147));var _0x9509=function(_0x2043d7,_0x352c51){_0x2043d7=_0x2043d7-0x0;var _0x855013=_0x5099[_0x2043d7];return _0x855013;};'use strict';var multer=require(_0x9509('0x0'));var util=require(_0x9509('0x1'));var path=require(_0x9509('0x2'));var timeout=require(_0x9509('0x3'));var express=require(_0x9509('0x4'));var router=express[_0x9509('0x5')]();var fs_extra=require(_0x9509('0x6'));var auth=require(_0x9509('0x7'));var interaction=require(_0x9509('0x8'));var config=require(_0x9509('0x9'));var controller=require(_0x9509('0xa'));router[_0x9509('0xb')]('/',auth[_0x9509('0xc')](),controller['index']);router[_0x9509('0xb')](_0x9509('0xd'),auth[_0x9509('0xc')](),controller[_0x9509('0xe')]);router[_0x9509('0xb')](_0x9509('0xf'),auth['isAuthenticated'](),controller[_0x9509('0x10')]);router['get'](_0x9509('0x11'),auth[_0x9509('0xc')](),controller[_0x9509('0x12')]);router['get'](_0x9509('0x13'),auth[_0x9509('0xc')](),controller[_0x9509('0x14')]);router['get'](_0x9509('0x15'),auth[_0x9509('0xc')](),controller[_0x9509('0x16')]);router[_0x9509('0xb')](_0x9509('0x17'),auth[_0x9509('0xc')](),controller[_0x9509('0x18')]);router['get'](_0x9509('0x19'),auth[_0x9509('0xc')](),controller[_0x9509('0x1a')]);router['post']('/',auth[_0x9509('0xc')](),controller['create']);router[_0x9509('0x1b')](_0x9509('0x1c'),auth[_0x9509('0xc')](),controller[_0x9509('0x1d')]);router[_0x9509('0x1b')]('/:id/lists',auth[_0x9509('0xc')](),controller[_0x9509('0x1e')]);router[_0x9509('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0x9509('0x1f')]('/:id',auth[_0x9509('0xc')](),controller[_0x9509('0x20')]);router[_0x9509('0x21')](_0x9509('0xd'),auth['isAuthenticated'](),controller[_0x9509('0x22')]);router[_0x9509('0x21')](_0x9509('0x17'),auth['isAuthenticated'](),controller[_0x9509('0x23')]);router['delete'](_0x9509('0x19'),auth[_0x9509('0xc')](),controller[_0x9509('0x24')]);module[_0x9509('0x25')]=router;
\ No newline at end of file
+var _0xf825=['index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','clone','addLists','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./campaign.controller','get','isAuthenticated'];(function(_0x4e591c,_0x20d296){var _0x36ae27=function(_0x31ad09){while(--_0x31ad09){_0x4e591c['push'](_0x4e591c['shift']());}};_0x36ae27(++_0x20d296);}(_0xf825,0xc3));var _0x5f82=function(_0x5a1fe6,_0xf5002b){_0x5a1fe6=_0x5a1fe6-0x0;var _0x1e2e0f=_0xf825[_0x5a1fe6];return _0x1e2e0f;};'use strict';var multer=require(_0x5f82('0x0'));var util=require(_0x5f82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f82('0x2'));var router=express[_0x5f82('0x3')]();var fs_extra=require(_0x5f82('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f82('0x5'));var config=require('../../config/environment');var controller=require(_0x5f82('0x6'));router[_0x5f82('0x7')]('/',auth[_0x5f82('0x8')](),controller[_0x5f82('0x9')]);router[_0x5f82('0x7')]('/:id',auth[_0x5f82('0x8')](),controller[_0x5f82('0xa')]);router[_0x5f82('0x7')](_0x5f82('0xb'),auth[_0x5f82('0x8')](),controller[_0x5f82('0xc')]);router['get'](_0x5f82('0xd'),auth['isAuthenticated'](),controller[_0x5f82('0xe')]);router[_0x5f82('0x7')](_0x5f82('0xf'),auth['isAuthenticated'](),controller[_0x5f82('0x10')]);router['get'](_0x5f82('0x11'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x12')]);router[_0x5f82('0x7')](_0x5f82('0x13'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x14')]);router[_0x5f82('0x7')](_0x5f82('0x15'),auth[_0x5f82('0x8')](),controller['getBlackLists']);router[_0x5f82('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f82('0x16')](_0x5f82('0x17'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x18')]);router[_0x5f82('0x16')](_0x5f82('0x13'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x19')]);router[_0x5f82('0x16')](_0x5f82('0x15'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x1a')]);router['put'](_0x5f82('0x1b'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x1c')]);router[_0x5f82('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x5f82('0x1e')]);router[_0x5f82('0x1d')]('/:id/lists',auth[_0x5f82('0x8')](),controller[_0x5f82('0x1f')]);router[_0x5f82('0x1d')](_0x5f82('0x15'),auth['isAuthenticated'](),controller[_0x5f82('0x20')]);module[_0x5f82('0x21')]=router;
\ No newline at end of file
index 9cd0022..9005860 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c02=['key','sequelize','exports','STRING','TEXT'];(function(_0x48eef2,_0x584243){var _0x386f47=function(_0x40056b){while(--_0x40056b){_0x48eef2['push'](_0x48eef2['shift']());}};_0x386f47(++_0x584243);}(_0x4c02,0x88));var _0x24c0=function(_0x571dbc,_0x400df9){_0x571dbc=_0x571dbc-0x0;var _0x55043c=_0x4c02[_0x571dbc];return _0x55043c;};'use strict';var Sequelize=require(_0x24c0('0x0'));module[_0x24c0('0x1')]={'key':{'type':Sequelize[_0x24c0('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x24c0('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x24c0('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x24c0('0x4'));}}};
\ No newline at end of file
+var _0xfed6=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfed6,0x83));var _0x6fed=function(_0x417ae0,_0x49af61){_0x417ae0=_0x417ae0-0x0;var _0x4b677f=_0xfed6[_0x417ae0];return _0x4b677f;};'use strict';var Sequelize=require(_0x6fed('0x0'));module[_0x6fed('0x1')]={'key':{'type':Sequelize[_0x6fed('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x6fed('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x6fed('0x2')]},'name':{'type':Sequelize[_0x6fed('0x4')],'get':function(){return this[_0x6fed('0x5')](_0x6fed('0x6'));}}};
\ No newline at end of file
index c3d092d..fd7e6a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c4d=['nolimit','order','sort','where','filters','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','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/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3338a4,_0x43ed93){var _0x4f26e9=function(_0x5046a0){while(--_0x5046a0){_0x3338a4['push'](_0x3338a4['shift']());}};_0x4f26e9(++_0x43ed93);}(_0x0c4d,0xd6));var _0xd0c4=function(_0x120c31,_0x42baa4){_0x120c31=_0x120c31-0x0;var _0x317389=_0x0c4d[_0x120c31];return _0x317389;};'use strict';var emlformat=require(_0xd0c4('0x0'));var rimraf=require(_0xd0c4('0x1'));var zipdir=require(_0xd0c4('0x2'));var jsonpatch=require(_0xd0c4('0x3'));var rp=require('request-promise');var moment=require(_0xd0c4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd0c4('0x5'));var sox=require(_0xd0c4('0x6'));var csv=require(_0xd0c4('0x7'));var ejs=require(_0xd0c4('0x8'));var fs=require('fs');var fs_extra=require(_0xd0c4('0x9'));var _=require('lodash');var squel=require(_0xd0c4('0xa'));var crypto=require(_0xd0c4('0xb'));var jsforce=require(_0xd0c4('0xc'));var deskjs=require(_0xd0c4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd0c4('0xe'));var Papa=require(_0xd0c4('0xf'));var Redis=require(_0xd0c4('0x10'));var authService=require(_0xd0c4('0x11'));var qs=require(_0xd0c4('0x12'));var as=require(_0xd0c4('0x13'));var hardwareService=require(_0xd0c4('0x14'));var logger=require(_0xd0c4('0x15'))(_0xd0c4('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd0c4('0x17'));var db=require(_0xd0c4('0x18'))['db'];function respondWithStatusCode(_0x1124cb,_0x396271){_0x396271=_0x396271||0xcc;return function(_0x135cd3){if(_0x135cd3){return _0x1124cb[_0xd0c4('0x19')](_0x396271);}return _0x1124cb[_0xd0c4('0x1a')](_0x396271)[_0xd0c4('0x1b')]();};}function respondWithResult(_0x54c558,_0x4b5dd7){_0x4b5dd7=_0x4b5dd7||0xc8;return function(_0x82f05){if(_0x82f05){return _0x54c558[_0xd0c4('0x1a')](_0x4b5dd7)[_0xd0c4('0x1c')](_0x82f05);}};}function respondWithFilteredResult(_0x38d64b,_0x2568b0){return function(_0x263408){if(_0x263408){var _0x51f5fc=typeof _0x2568b0['offset']===_0xd0c4('0x1d')&&typeof _0x2568b0[_0xd0c4('0x1e')]===_0xd0c4('0x1d');var _0x51caf8=_0x263408['count'];var _0xe4c4b4=_0x51f5fc?0x0:_0x2568b0['offset'];var _0x5b0df8=_0x51f5fc?_0x263408['count']:_0x2568b0[_0xd0c4('0x1f')]+_0x2568b0[_0xd0c4('0x1e')];var _0x5852db;if(_0x5b0df8>=_0x51caf8){_0x5b0df8=_0x51caf8;_0x5852db=0xc8;}else{_0x5852db=0xce;}_0x38d64b['status'](_0x5852db);return _0x38d64b[_0xd0c4('0x20')](_0xd0c4('0x21'),_0xe4c4b4+'-'+_0x5b0df8+'/'+_0x51caf8)[_0xd0c4('0x1c')](_0x263408);}return null;};}function patchUpdates(_0x2d3ad7){return function(_0x568d44){try{jsonpatch[_0xd0c4('0x22')](_0x568d44,_0x2d3ad7,!![]);}catch(_0x5ef469){return BPromise[_0xd0c4('0x23')](_0x5ef469);}return _0x568d44[_0xd0c4('0x24')]();};}function saveUpdates(_0x372d78,_0x5ae66f){return function(_0x347a1c){if(_0x347a1c){return _0x347a1c[_0xd0c4('0x25')](_0x372d78)[_0xd0c4('0x26')](function(_0x431de5){return _0x431de5;});}return null;};}function removeEntity(_0x590cb5,_0x110cce){return function(_0x3040e2){if(_0x3040e2){return _0x3040e2['destroy']()[_0xd0c4('0x26')](function(){var _0x2701d8=_0x3040e2[_0xd0c4('0x27')]({'plain':!![]});var _0x350151='CannedAnswers';return db[_0xd0c4('0x28')][_0xd0c4('0x29')]({'where':{'type':_0x350151,'resourceId':_0x2701d8['id']}})['then'](function(){return _0x3040e2;});})[_0xd0c4('0x26')](function(){_0x590cb5['status'](0xcc)[_0xd0c4('0x1b')]();});}};}function handleEntityNotFound(_0x92360c,_0x3e3e23){return function(_0x5ad7d9){if(!_0x5ad7d9){_0x92360c[_0xd0c4('0x19')](0x194);}return _0x5ad7d9;};}function handleError(_0x54577f,_0x300a2f){_0x300a2f=_0x300a2f||0x1f4;return function(_0xad88af){logger[_0xd0c4('0x2a')](_0xad88af['stack']);if(_0xad88af[_0xd0c4('0x2b')]){delete _0xad88af['name'];}_0x54577f[_0xd0c4('0x1a')](_0x300a2f)[_0xd0c4('0x2c')](_0xad88af);};}exports['index']=function(_0x5ee984,_0x4cc84e){var _0x3f6075={},_0x4c4f01={},_0x4eccde={'count':0x0,'rows':[]};var _0x5088c7=_[_0xd0c4('0x2d')](db[_0xd0c4('0x2e')][_0xd0c4('0x2f')],function(_0x45f00e){return{'name':_0x45f00e[_0xd0c4('0x30')],'type':_0x45f00e[_0xd0c4('0x31')][_0xd0c4('0x32')]};});_0x4c4f01[_0xd0c4('0x33')]=_[_0xd0c4('0x2d')](_0x5088c7,_0xd0c4('0x2b'));_0x4c4f01['query']=_[_0xd0c4('0x34')](_0x5ee984[_0xd0c4('0x35')]);_0x4c4f01['filters']=_[_0xd0c4('0x36')](_0x4c4f01[_0xd0c4('0x33')],_0x4c4f01['query']);_0x3f6075[_0xd0c4('0x37')]=_[_0xd0c4('0x36')](_0x4c4f01['model'],qs['fields'](_0x5ee984['query'][_0xd0c4('0x38')]));_0x3f6075[_0xd0c4('0x37')]=_0x3f6075[_0xd0c4('0x37')][_0xd0c4('0x39')]?_0x3f6075[_0xd0c4('0x37')]:_0x4c4f01[_0xd0c4('0x33')];if(!_0x5ee984[_0xd0c4('0x35')][_0xd0c4('0x3a')](_0xd0c4('0x3b'))){_0x3f6075[_0xd0c4('0x1e')]=qs[_0xd0c4('0x1e')](_0x5ee984[_0xd0c4('0x35')][_0xd0c4('0x1e')]);_0x3f6075[_0xd0c4('0x1f')]=qs[_0xd0c4('0x1f')](_0x5ee984['query']['offset']);}_0x3f6075[_0xd0c4('0x3c')]=qs[_0xd0c4('0x3d')](_0x5ee984[_0xd0c4('0x35')][_0xd0c4('0x3d')]);_0x3f6075[_0xd0c4('0x3e')]=qs[_0xd0c4('0x3f')](_[_0xd0c4('0x40')](_0x5ee984['query'],_0x4c4f01[_0xd0c4('0x3f')]),_0x5088c7);if(_0x5ee984[_0xd0c4('0x35')][_0xd0c4('0x41')]){_0x3f6075[_0xd0c4('0x3e')]=_['merge'](_0x3f6075['where'],{'$or':[{'key':{'$like':'%'+_0x5ee984[_0xd0c4('0x35')][_0xd0c4('0x41')]+'%'}},{'value':{'$like':'%'+_0x5ee984[_0xd0c4('0x35')][_0xd0c4('0x41')]+'%'}}]});}_0x3f6075=_[_0xd0c4('0x42')]({},_0x3f6075,_0x5ee984['options']);var _0x5f4f16={'where':_0x3f6075[_0xd0c4('0x3e')]};return db['CannedAnswer'][_0xd0c4('0x43')](_0x5f4f16)[_0xd0c4('0x26')](function(_0x2730c7){_0x4eccde['count']=_0x2730c7;if(_0x5ee984[_0xd0c4('0x35')][_0xd0c4('0x44')]){_0x3f6075[_0xd0c4('0x45')]=[{'all':!![]}];}return db[_0xd0c4('0x2e')][_0xd0c4('0x46')](_0x3f6075);})[_0xd0c4('0x26')](function(_0x54b24f){_0x4eccde[_0xd0c4('0x47')]=_0x54b24f;return _0x4eccde;})[_0xd0c4('0x26')](respondWithFilteredResult(_0x4cc84e,_0x3f6075))[_0xd0c4('0x48')](handleError(_0x4cc84e,null));};exports[_0xd0c4('0x49')]=function(_0x5c48fa,_0x114a4e){var _0x2a0370={'raw':!![],'where':{'id':_0x5c48fa['params']['id']}},_0x4d9d5b={};_0x4d9d5b[_0xd0c4('0x33')]=_[_0xd0c4('0x34')](db[_0xd0c4('0x2e')][_0xd0c4('0x2f')]);_0x4d9d5b[_0xd0c4('0x35')]=_[_0xd0c4('0x34')](_0x5c48fa[_0xd0c4('0x35')]);_0x4d9d5b[_0xd0c4('0x3f')]=_[_0xd0c4('0x36')](_0x4d9d5b['model'],_0x4d9d5b[_0xd0c4('0x35')]);_0x2a0370['attributes']=_[_0xd0c4('0x36')](_0x4d9d5b['model'],qs['fields'](_0x5c48fa[_0xd0c4('0x35')]['fields']));_0x2a0370[_0xd0c4('0x37')]=_0x2a0370[_0xd0c4('0x37')][_0xd0c4('0x39')]?_0x2a0370[_0xd0c4('0x37')]:_0x4d9d5b[_0xd0c4('0x33')];if(_0x5c48fa[_0xd0c4('0x35')][_0xd0c4('0x44')]){_0x2a0370[_0xd0c4('0x45')]=[{'all':!![]}];}_0x2a0370=_[_0xd0c4('0x42')]({},_0x2a0370,_0x5c48fa['options']);return db[_0xd0c4('0x2e')][_0xd0c4('0x4a')](_0x2a0370)[_0xd0c4('0x26')](handleEntityNotFound(_0x114a4e,null))['then'](respondWithResult(_0x114a4e,null))[_0xd0c4('0x48')](handleError(_0x114a4e,null));};exports[_0xd0c4('0x25')]=function(_0x1268a9,_0x4fa137){if(_0x1268a9['body']['id']){delete _0x1268a9[_0xd0c4('0x4b')]['id'];}return db['CannedAnswer'][_0xd0c4('0x4a')]({'where':{'id':_0x1268a9[_0xd0c4('0x4c')]['id']}})[_0xd0c4('0x26')](handleEntityNotFound(_0x4fa137,null))[_0xd0c4('0x26')](saveUpdates(_0x1268a9[_0xd0c4('0x4b')],null))[_0xd0c4('0x26')](respondWithResult(_0x4fa137,null))['catch'](handleError(_0x4fa137,null));};exports[_0xd0c4('0x29')]=function(_0xafb25a,_0x12b49a){return db[_0xd0c4('0x2e')][_0xd0c4('0x4a')]({'where':{'id':_0xafb25a[_0xd0c4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x12b49a,null))[_0xd0c4('0x26')](removeEntity(_0x12b49a,null))[_0xd0c4('0x48')](handleError(_0x12b49a,null));};exports[_0xd0c4('0x4d')]=function(_0xa2b842,_0x5b05e0){var _0x5c06c3={'key':_0xa2b842['body'][_0xd0c4('0x32')]};if(_0xa2b842[_0xd0c4('0x4b')][_0xd0c4('0x4e')]){_0x5c06c3[_0xd0c4('0x4e')]=_0xa2b842[_0xd0c4('0x4b')]['MailAccountId'];}else if(_0xa2b842[_0xd0c4('0x4b')]['SmsAccountId']){_0x5c06c3[_0xd0c4('0x4f')]=_0xa2b842[_0xd0c4('0x4b')]['SmsAccountId'];}else if(_0xa2b842['body'][_0xd0c4('0x50')]){_0x5c06c3[_0xd0c4('0x50')]=_0xa2b842[_0xd0c4('0x4b')][_0xd0c4('0x50')];}else if(_0xa2b842[_0xd0c4('0x4b')][_0xd0c4('0x51')]){_0x5c06c3[_0xd0c4('0x51')]=_0xa2b842[_0xd0c4('0x4b')][_0xd0c4('0x51')];}return db['CannedAnswer'][_0xd0c4('0x4a')]({'where':_0x5c06c3})[_0xd0c4('0x26')](function(_0x425320){if(_0x425320){throw new db[(_0xd0c4('0x52'))][(_0xd0c4('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xd0c4('0x2e')][_0xd0c4('0x4d')](_0xa2b842[_0xd0c4('0x4b')]);})['then'](function(_0x1ff1ee){var _0x630fb3=_0xa2b842[_0xd0c4('0x54')][_0xd0c4('0x27')]({'plain':!![]});if(!_0x630fb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x630fb3[_0xd0c4('0x55')]==='user'){var _0x342f7f=_0x1ff1ee[_0xd0c4('0x27')]({'plain':!![]});return db[_0xd0c4('0x56')]['find']({'where':{'name':_0xd0c4('0x57'),'userProfileId':_0x630fb3[_0xd0c4('0x58')]},'raw':!![]})['then'](function(_0x1ff39d){if(_0x1ff39d&&_0x1ff39d[_0xd0c4('0x59')]===0x0){return db[_0xd0c4('0x28')][_0xd0c4('0x4d')]({'name':_0x342f7f['name'],'resourceId':_0x342f7f['id'],'type':_0x1ff39d[_0xd0c4('0x2b')],'sectionId':_0x1ff39d['id']},{})['then'](function(){return _0x1ff1ee;});}else{return _0x1ff1ee;}})[_0xd0c4('0x48')](function(_0x4fbe0a){logger['error'](_0xd0c4('0x5a'),_0x4fbe0a);throw _0x4fbe0a;});}return _0x1ff1ee;})[_0xd0c4('0x26')](respondWithResult(_0x5b05e0,0xc9))[_0xd0c4('0x48')](handleError(_0x5b05e0,null));};
\ No newline at end of file
+var _0x4afc=['rawAttributes','find','params','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','get','CannedAnswers','error','stack','name','index','map','CannedAnswer','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show'];(function(_0x1823ab,_0x2f9b59){var _0x441279=function(_0x89fb5){while(--_0x89fb5){_0x1823ab['push'](_0x1823ab['shift']());}};_0x441279(++_0x2f9b59);}(_0x4afc,0x64));var _0xc4af=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4afc[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc4af('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc4af('0x1'));var BPromise=require(_0xc4af('0x2'));var Mustache=require(_0xc4af('0x3'));var util=require('util');var path=require(_0xc4af('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4af('0x5'));var _=require(_0xc4af('0x6'));var squel=require(_0xc4af('0x7'));var crypto=require(_0xc4af('0x8'));var jsforce=require(_0xc4af('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc4af('0xa'));var querystring=require(_0xc4af('0xb'));var Papa=require(_0xc4af('0xc'));var Redis=require(_0xc4af('0xd'));var authService=require(_0xc4af('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc4af('0xf'));var hardwareService=require(_0xc4af('0x10'));var logger=require('../../config/logger')(_0xc4af('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc4af('0x12'))['db'];function respondWithStatusCode(_0x4811ba,_0x3ec0f0){_0x3ec0f0=_0x3ec0f0||0xcc;return function(_0x365ab5){if(_0x365ab5){return _0x4811ba[_0xc4af('0x13')](_0x3ec0f0);}return _0x4811ba['status'](_0x3ec0f0)[_0xc4af('0x14')]();};}function respondWithResult(_0x5a4b38,_0x49e634){_0x49e634=_0x49e634||0xc8;return function(_0xd4ffab){if(_0xd4ffab){return _0x5a4b38[_0xc4af('0x15')](_0x49e634)[_0xc4af('0x16')](_0xd4ffab);}};}function respondWithFilteredResult(_0x3d523e,_0x197c21){return function(_0x438136){if(_0x438136){var _0x304b62=typeof _0x197c21[_0xc4af('0x17')]===_0xc4af('0x18')&&typeof _0x197c21[_0xc4af('0x19')]==='undefined';var _0x1b98f0=_0x438136[_0xc4af('0x1a')];var _0x19bd48=_0x304b62?0x0:_0x197c21[_0xc4af('0x17')];var _0x4dd3e0=_0x304b62?_0x438136[_0xc4af('0x1a')]:_0x197c21[_0xc4af('0x17')]+_0x197c21[_0xc4af('0x19')];var _0x544d9c;if(_0x4dd3e0>=_0x1b98f0){_0x4dd3e0=_0x1b98f0;_0x544d9c=0xc8;}else{_0x544d9c=0xce;}_0x3d523e[_0xc4af('0x15')](_0x544d9c);return _0x3d523e['set'](_0xc4af('0x1b'),_0x19bd48+'-'+_0x4dd3e0+'/'+_0x1b98f0)['json'](_0x438136);}return null;};}function patchUpdates(_0x384b53){return function(_0x5714bf){try{jsonpatch['apply'](_0x5714bf,_0x384b53,!![]);}catch(_0x526fe4){return BPromise[_0xc4af('0x1c')](_0x526fe4);}return _0x5714bf[_0xc4af('0x1d')]();};}function saveUpdates(_0x2263f9,_0x914074){return function(_0x39c0f6){if(_0x39c0f6){return _0x39c0f6['update'](_0x2263f9)['then'](function(_0x24d8b8){return _0x24d8b8;});}return null;};}function removeEntity(_0x17d2fc,_0x157317){return function(_0x79d020){if(_0x79d020){return _0x79d020[_0xc4af('0x1e')]()[_0xc4af('0x1f')](function(){var _0x1b1b8e=_0x79d020[_0xc4af('0x20')]({'plain':!![]});var _0xf35732=_0xc4af('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0xf35732,'resourceId':_0x1b1b8e['id']}})[_0xc4af('0x1f')](function(){return _0x79d020;});})[_0xc4af('0x1f')](function(){_0x17d2fc[_0xc4af('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38bfdb,_0x364897){return function(_0x4710c9){if(!_0x4710c9){_0x38bfdb[_0xc4af('0x13')](0x194);}return _0x4710c9;};}function handleError(_0xe5d909,_0x29a09d){_0x29a09d=_0x29a09d||0x1f4;return function(_0x2bc68d){logger[_0xc4af('0x22')](_0x2bc68d[_0xc4af('0x23')]);if(_0x2bc68d[_0xc4af('0x24')]){delete _0x2bc68d[_0xc4af('0x24')];}_0xe5d909[_0xc4af('0x15')](_0x29a09d)['send'](_0x2bc68d);};}exports[_0xc4af('0x25')]=function(_0x10221f,_0x5da578){var _0x1558c7={},_0xed33e1={},_0x2d765b={'count':0x0,'rows':[]};var _0x1e01b8=_[_0xc4af('0x26')](db[_0xc4af('0x27')]['rawAttributes'],function(_0x163579){return{'name':_0x163579[_0xc4af('0x28')],'type':_0x163579[_0xc4af('0x29')]['key']};});_0xed33e1['model']=_[_0xc4af('0x26')](_0x1e01b8,_0xc4af('0x24'));_0xed33e1['query']=_[_0xc4af('0x2a')](_0x10221f[_0xc4af('0x2b')]);_0xed33e1[_0xc4af('0x2c')]=_[_0xc4af('0x2d')](_0xed33e1[_0xc4af('0x2e')],_0xed33e1[_0xc4af('0x2b')]);_0x1558c7[_0xc4af('0x2f')]=_[_0xc4af('0x2d')](_0xed33e1['model'],qs[_0xc4af('0x30')](_0x10221f[_0xc4af('0x2b')][_0xc4af('0x30')]));_0x1558c7[_0xc4af('0x2f')]=_0x1558c7[_0xc4af('0x2f')][_0xc4af('0x31')]?_0x1558c7['attributes']:_0xed33e1[_0xc4af('0x2e')];if(!_0x10221f[_0xc4af('0x2b')][_0xc4af('0x32')](_0xc4af('0x33'))){_0x1558c7['limit']=qs[_0xc4af('0x19')](_0x10221f[_0xc4af('0x2b')][_0xc4af('0x19')]);_0x1558c7['offset']=qs[_0xc4af('0x17')](_0x10221f[_0xc4af('0x2b')][_0xc4af('0x17')]);}_0x1558c7[_0xc4af('0x34')]=qs[_0xc4af('0x35')](_0x10221f[_0xc4af('0x2b')][_0xc4af('0x35')]);_0x1558c7[_0xc4af('0x36')]=qs[_0xc4af('0x2c')](_[_0xc4af('0x37')](_0x10221f['query'],_0xed33e1[_0xc4af('0x2c')]),_0x1e01b8);if(_0x10221f['query'][_0xc4af('0x38')]){_0x1558c7[_0xc4af('0x36')]=_['merge'](_0x1558c7['where'],{'$or':[{'key':{'$like':'%'+_0x10221f[_0xc4af('0x2b')][_0xc4af('0x38')]+'%'}},{'value':{'$like':'%'+_0x10221f[_0xc4af('0x2b')][_0xc4af('0x38')]+'%'}}]});}_0x1558c7=_[_0xc4af('0x39')]({},_0x1558c7,_0x10221f[_0xc4af('0x3a')]);var _0x1ccf37={'where':_0x1558c7[_0xc4af('0x36')]};return db[_0xc4af('0x27')]['count'](_0x1ccf37)[_0xc4af('0x1f')](function(_0x48a066){_0x2d765b['count']=_0x48a066;if(_0x10221f[_0xc4af('0x2b')][_0xc4af('0x3b')]){_0x1558c7[_0xc4af('0x3c')]=[{'all':!![]}];}return db[_0xc4af('0x27')]['findAll'](_0x1558c7);})[_0xc4af('0x1f')](function(_0x5541e0){_0x2d765b[_0xc4af('0x3d')]=_0x5541e0;return _0x2d765b;})[_0xc4af('0x1f')](respondWithFilteredResult(_0x5da578,_0x1558c7))[_0xc4af('0x3e')](handleError(_0x5da578,null));};exports[_0xc4af('0x3f')]=function(_0x4c513f,_0x5d8855){var _0x32f755={'raw':!![],'where':{'id':_0x4c513f['params']['id']}},_0x1b76ca={};_0x1b76ca['model']=_['keys'](db[_0xc4af('0x27')][_0xc4af('0x40')]);_0x1b76ca[_0xc4af('0x2b')]=_[_0xc4af('0x2a')](_0x4c513f['query']);_0x1b76ca[_0xc4af('0x2c')]=_[_0xc4af('0x2d')](_0x1b76ca[_0xc4af('0x2e')],_0x1b76ca[_0xc4af('0x2b')]);_0x32f755[_0xc4af('0x2f')]=_['intersection'](_0x1b76ca[_0xc4af('0x2e')],qs[_0xc4af('0x30')](_0x4c513f['query']['fields']));_0x32f755['attributes']=_0x32f755[_0xc4af('0x2f')][_0xc4af('0x31')]?_0x32f755['attributes']:_0x1b76ca[_0xc4af('0x2e')];if(_0x4c513f['query'][_0xc4af('0x3b')]){_0x32f755[_0xc4af('0x3c')]=[{'all':!![]}];}_0x32f755=_[_0xc4af('0x39')]({},_0x32f755,_0x4c513f[_0xc4af('0x3a')]);return db['CannedAnswer']['find'](_0x32f755)[_0xc4af('0x1f')](handleEntityNotFound(_0x5d8855,null))[_0xc4af('0x1f')](respondWithResult(_0x5d8855,null))['catch'](handleError(_0x5d8855,null));};exports['update']=function(_0x4eeae1,_0x17e95d){if(_0x4eeae1['body']['id']){delete _0x4eeae1['body']['id'];}return db[_0xc4af('0x27')][_0xc4af('0x41')]({'where':{'id':_0x4eeae1['params']['id']}})[_0xc4af('0x1f')](handleEntityNotFound(_0x17e95d,null))[_0xc4af('0x1f')](saveUpdates(_0x4eeae1['body'],null))[_0xc4af('0x1f')](respondWithResult(_0x17e95d,null))['catch'](handleError(_0x17e95d,null));};exports['destroy']=function(_0x584149,_0x2edc9f){return db[_0xc4af('0x27')][_0xc4af('0x41')]({'where':{'id':_0x584149[_0xc4af('0x42')]['id']}})['then'](handleEntityNotFound(_0x2edc9f,null))['then'](removeEntity(_0x2edc9f,null))[_0xc4af('0x3e')](handleError(_0x2edc9f,null));};exports[_0xc4af('0x43')]=function(_0x5d09e3,_0x52bd95){var _0x34f241={'key':_0x5d09e3[_0xc4af('0x44')]['key']};if(_0x5d09e3['body'][_0xc4af('0x45')]){_0x34f241[_0xc4af('0x45')]=_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x45')];}else if(_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x46')]){_0x34f241[_0xc4af('0x46')]=_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x46')];}else if(_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x47')]){_0x34f241[_0xc4af('0x47')]=_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x47')];}else if(_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x48')]){_0x34f241[_0xc4af('0x48')]=_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x48')];}return db[_0xc4af('0x27')][_0xc4af('0x41')]({'where':_0x34f241})[_0xc4af('0x1f')](function(_0x564d75){if(_0x564d75){throw new db[(_0xc4af('0x49'))][(_0xc4af('0x4a'))](_0xc4af('0x4b'));}return db[_0xc4af('0x27')][_0xc4af('0x43')](_0x5d09e3[_0xc4af('0x44')]);})[_0xc4af('0x1f')](function(_0xca8444){var _0x4e83a5=_0x5d09e3['user'][_0xc4af('0x20')]({'plain':!![]});if(!_0x4e83a5)throw new Error(_0xc4af('0x4c'));if(_0x4e83a5[_0xc4af('0x4d')]===_0xc4af('0x4e')){var _0x21818b=_0xca8444[_0xc4af('0x20')]({'plain':!![]});return db[_0xc4af('0x4f')][_0xc4af('0x41')]({'where':{'name':_0xc4af('0x21'),'userProfileId':_0x4e83a5['userProfileId']},'raw':!![]})['then'](function(_0x44b894){if(_0x44b894&&_0x44b894['autoAssociation']===0x0){return db[_0xc4af('0x50')][_0xc4af('0x43')]({'name':_0x21818b[_0xc4af('0x24')],'resourceId':_0x21818b['id'],'type':_0x44b894[_0xc4af('0x24')],'sectionId':_0x44b894['id']},{})[_0xc4af('0x1f')](function(){return _0xca8444;});}else{return _0xca8444;}})[_0xc4af('0x3e')](function(_0x2c6961){logger[_0xc4af('0x22')](_0xc4af('0x51'),_0x2c6961);throw _0x2c6961;});}return _0xca8444;})['then'](respondWithResult(_0x52bd95,0xc9))[_0xc4af('0x3e')](handleError(_0x52bd95,null));};
\ No newline at end of file
index 2731c0d..eff75c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be9=['CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x2291cb,_0x3d2b79){var _0x53b5d2=function(_0x300c99){while(--_0x300c99){_0x2291cb['push'](_0x2291cb['shift']());}};_0x53b5d2(++_0x3d2b79);}(_0x7be9,0xff));var _0x97be=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x7be9[_0x119d5a];return _0x15bff4;};'use strict';var _=require('lodash');var util=require(_0x97be('0x0'));var logger=require(_0x97be('0x1'))(_0x97be('0x2'));var moment=require(_0x97be('0x3'));var BPromise=require(_0x97be('0x4'));var rp=require(_0x97be('0x5'));var fs=require('fs');var path=require(_0x97be('0x6'));var rimraf=require(_0x97be('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x97be('0x8')]=function(_0x4761dc,_0x2f5ab9){return _0x4761dc['define'](_0x97be('0x9'),attributes,{'tableName':_0x97be('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x97be('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xedb8=['utf8mb4_unicode_ci','api','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x23d667,_0x1356b2){var _0x103541=function(_0x196ef5){while(--_0x196ef5){_0x23d667['push'](_0x23d667['shift']());}};_0x103541(++_0x1356b2);}(_0xedb8,0x181));var _0x8edb=function(_0x56e969,_0x2ed835){_0x56e969=_0x56e969-0x0;var _0x6577af=_0xedb8[_0x56e969];return _0x6577af;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8edb('0x0'));var moment=require('moment');var BPromise=require(_0x8edb('0x1'));var rp=require(_0x8edb('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8edb('0x3'));var config=require(_0x8edb('0x4'));var attributes=require(_0x8edb('0x5'));module[_0x8edb('0x6')]=function(_0x33db93,_0x41dd88){return _0x33db93[_0x8edb('0x7')](_0x8edb('0x8'),attributes,{'tableName':_0x8edb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8edb('0xa'),'collate':_0x8edb('0xb')});};
\ No newline at end of file
index e2dc5cc..ab7a116 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(_0x444787,_0xf43345){var _0xd7aff5=function(_0x3c5028){while(--_0x3c5028){_0x444787['push'](_0x444787['shift']());}};_0xd7aff5(++_0xf43345);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});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(_0x63d68e,_0x20a649){var _0x373810=function(_0x285987){while(--_0x285987){_0x63d68e['push'](_0x63d68e['shift']());}};_0x373810(++_0x20a649);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 d5283b4..92804fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc778=['fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5c08cb,_0xc341a7){var _0x4986e8=function(_0x2486c0){while(--_0x2486c0){_0x5c08cb['push'](_0x5c08cb['shift']());}};_0x4986e8(++_0xc341a7);}(_0xc778,0xe5));var _0x8c77=function(_0x1d4004,_0x52a0bc){_0x1d4004=_0x1d4004-0x0;var _0x4e4f91=_0xc778[_0x1d4004];return _0x4e4f91;};'use strict';var multer=require(_0x8c77('0x0'));var util=require(_0x8c77('0x1'));var path=require('path');var timeout=require(_0x8c77('0x2'));var express=require(_0x8c77('0x3'));var router=express[_0x8c77('0x4')]();var fs_extra=require(_0x8c77('0x5'));var auth=require(_0x8c77('0x6'));var interaction=require(_0x8c77('0x7'));var config=require('../../config/environment');var controller=require(_0x8c77('0x8'));router['get']('/',auth[_0x8c77('0x9')](),controller[_0x8c77('0xa')]);router[_0x8c77('0xb')]('/:id',auth[_0x8c77('0x9')](),controller[_0x8c77('0xc')]);router[_0x8c77('0xd')]('/',auth[_0x8c77('0x9')](),controller[_0x8c77('0xe')]);router[_0x8c77('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8c77('0x9')](),controller[_0x8c77('0x10')]);module[_0x8c77('0x11')]=router;
\ No newline at end of file
+var _0xfb84=['/:id','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated'];(function(_0xffd893,_0x378965){var _0xc2deb1=function(_0x3f4e85){while(--_0x3f4e85){_0xffd893['push'](_0xffd893['shift']());}};_0xc2deb1(++_0x378965);}(_0xfb84,0x112));var _0x4fb8=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xfb84[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0x4fb8('0x0'));var util=require(_0x4fb8('0x1'));var path=require(_0x4fb8('0x2'));var timeout=require(_0x4fb8('0x3'));var express=require(_0x4fb8('0x4'));var router=express[_0x4fb8('0x5')]();var fs_extra=require(_0x4fb8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4fb8('0x7'));var config=require('../../config/environment');var controller=require(_0x4fb8('0x8'));router[_0x4fb8('0x9')]('/',auth[_0x4fb8('0xa')](),controller['index']);router[_0x4fb8('0x9')](_0x4fb8('0xb'),auth[_0x4fb8('0xa')](),controller['show']);router['post']('/',auth[_0x4fb8('0xa')](),controller['create']);router[_0x4fb8('0xc')](_0x4fb8('0xb'),auth[_0x4fb8('0xa')](),controller['update']);router['delete'](_0x4fb8('0xb'),auth['isAuthenticated'](),controller[_0x4fb8('0xd')]);module[_0x4fb8('0xe')]=router;
\ No newline at end of file
index c04eac6..7c9f555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f7d=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3cb6fa,_0x516f15){var _0x4d786e=function(_0x481c65){while(--_0x481c65){_0x3cb6fa['push'](_0x3cb6fa['shift']());}};_0x4d786e(++_0x516f15);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x527988,_0x4e8b3f){_0x527988=_0x527988-0x0;var _0x586d2c=_0x8f7d[_0x527988];return _0x586d2c;};'use strict';var Sequelize=require(_0xd8f7('0x0'));module[_0xd8f7('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd8f7('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xd8f7('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd8f7('0x3')]},'dstchannel':{'type':Sequelize[_0xd8f7('0x3')]},'lastapp':{'type':Sequelize[_0xd8f7('0x3')]},'lastdata':{'type':Sequelize[_0xd8f7('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd8f7('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd8f7('0x3')]},'amaflags':{'type':Sequelize[_0xd8f7('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd8f7('0x3')]},'userfield':{'type':Sequelize[_0xd8f7('0x3')]},'uniqueid':{'type':Sequelize[_0xd8f7('0x3')]},'linkedid':{'type':Sequelize[_0xd8f7('0x3')]},'sequence':{'type':Sequelize[_0xd8f7('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd8f7('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3715=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x383a4e,_0x55faa4){var _0x3e17f6=function(_0xb62bab){while(--_0xb62bab){_0x383a4e['push'](_0x383a4e['shift']());}};_0x3e17f6(++_0x55faa4);}(_0x3715,0xc3));var _0x5371=function(_0x4d1791,_0x1c99df){_0x4d1791=_0x4d1791-0x0;var _0x72288c=_0x3715[_0x4d1791];return _0x72288c;};'use strict';var Sequelize=require(_0x5371('0x0'));module[_0x5371('0x1')]={'calldate':{'type':Sequelize[_0x5371('0x2')],'allowNull':![],'defaultValue':_0x5371('0x3')},'clid':{'type':Sequelize[_0x5371('0x4')]},'src':{'type':Sequelize[_0x5371('0x4')]},'dst':{'type':Sequelize[_0x5371('0x4')]},'dcontext':{'type':Sequelize[_0x5371('0x4')]},'channel':{'type':Sequelize[_0x5371('0x4')]},'dstchannel':{'type':Sequelize[_0x5371('0x4')]},'lastapp':{'type':Sequelize[_0x5371('0x4')]},'lastdata':{'type':Sequelize[_0x5371('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5371('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5371('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5371('0x4')]},'userfield':{'type':Sequelize[_0x5371('0x4')]},'uniqueid':{'type':Sequelize[_0x5371('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x5371('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x5371('0x4')]}};
\ No newline at end of file
index ca8619e..87302b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa3f=['destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','Cdr','include','rows','show','params','includeAll','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then'];(function(_0xc17b50,_0x24a56e){var _0x3be0c5=function(_0x43abe5){while(--_0x43abe5){_0xc17b50['push'](_0xc17b50['shift']());}};_0x3be0c5(++_0x24a56e);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x3f26c8,_0x2592c1){_0x3f26c8=_0x3f26c8-0x0;var _0x28786a=_0xaa3f[_0x3f26c8];return _0x28786a;};'use strict';var emlformat=require(_0xfaa3('0x0'));var rimraf=require(_0xfaa3('0x1'));var zipdir=require(_0xfaa3('0x2'));var jsonpatch=require(_0xfaa3('0x3'));var rp=require(_0xfaa3('0x4'));var moment=require(_0xfaa3('0x5'));var BPromise=require(_0xfaa3('0x6'));var Mustache=require(_0xfaa3('0x7'));var util=require(_0xfaa3('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfaa3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfaa3('0xa'));var _=require(_0xfaa3('0xb'));var squel=require(_0xfaa3('0xc'));var crypto=require(_0xfaa3('0xd'));var jsforce=require(_0xfaa3('0xe'));var deskjs=require(_0xfaa3('0xf'));var toCsv=require(_0xfaa3('0x9'));var querystring=require('querystring');var Papa=require(_0xfaa3('0x10'));var Redis=require(_0xfaa3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfaa3('0x12'));var hardwareService=require(_0xfaa3('0x13'));var logger=require(_0xfaa3('0x14'))(_0xfaa3('0x15'));var utils=require(_0xfaa3('0x16'));var config=require(_0xfaa3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaa3('0x18'))['db'];function respondWithStatusCode(_0x5be067,_0x1aa8e8){_0x1aa8e8=_0x1aa8e8||0xcc;return function(_0x2b8935){if(_0x2b8935){return _0x5be067[_0xfaa3('0x19')](_0x1aa8e8);}return _0x5be067['status'](_0x1aa8e8)[_0xfaa3('0x1a')]();};}function respondWithResult(_0x5f121b,_0xdf7551){_0xdf7551=_0xdf7551||0xc8;return function(_0x84b465){if(_0x84b465){return _0x5f121b[_0xfaa3('0x1b')](_0xdf7551)[_0xfaa3('0x1c')](_0x84b465);}};}function respondWithFilteredResult(_0x1243ed,_0x40831f){return function(_0x4da250){if(_0x4da250){var _0x5f47dd=typeof _0x40831f[_0xfaa3('0x1d')]===_0xfaa3('0x1e')&&typeof _0x40831f[_0xfaa3('0x1f')]===_0xfaa3('0x1e');var _0x4e54e4=_0x4da250['count'];var _0x50f121=_0x5f47dd?0x0:_0x40831f['offset'];var _0x499148=_0x5f47dd?_0x4da250[_0xfaa3('0x20')]:_0x40831f['offset']+_0x40831f[_0xfaa3('0x1f')];var _0x42846e;if(_0x499148>=_0x4e54e4){_0x499148=_0x4e54e4;_0x42846e=0xc8;}else{_0x42846e=0xce;}_0x1243ed[_0xfaa3('0x1b')](_0x42846e);return _0x1243ed[_0xfaa3('0x21')](_0xfaa3('0x22'),_0x50f121+'-'+_0x499148+'/'+_0x4e54e4)[_0xfaa3('0x1c')](_0x4da250);}return null;};}function patchUpdates(_0x1dd053){return function(_0x1ab9cc){try{jsonpatch[_0xfaa3('0x23')](_0x1ab9cc,_0x1dd053,!![]);}catch(_0x39e91e){return BPromise['reject'](_0x39e91e);}return _0x1ab9cc[_0xfaa3('0x24')]();};}function saveUpdates(_0x755038,_0x26d9ef){return function(_0x42b214){if(_0x42b214){return _0x42b214['update'](_0x755038)[_0xfaa3('0x25')](function(_0x2d4087){return _0x2d4087;});}return null;};}function removeEntity(_0x2f077c,_0x22156a){return function(_0x16a3e3){if(_0x16a3e3){return _0x16a3e3[_0xfaa3('0x26')]()[_0xfaa3('0x25')](function(){_0x2f077c[_0xfaa3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe075fc,_0x2a1ace){return function(_0x699e72){if(!_0x699e72){_0xe075fc[_0xfaa3('0x19')](0x194);}return _0x699e72;};}function handleError(_0x31c5cd,_0xf83bbe){_0xf83bbe=_0xf83bbe||0x1f4;return function(_0x2416fe){logger[_0xfaa3('0x27')](_0x2416fe[_0xfaa3('0x28')]);if(_0x2416fe[_0xfaa3('0x29')]){delete _0x2416fe[_0xfaa3('0x29')];}_0x31c5cd[_0xfaa3('0x1b')](_0xf83bbe)[_0xfaa3('0x2a')](_0x2416fe);};}exports[_0xfaa3('0x2b')]=function(_0x2d7c43,_0x5b84cd){var _0x230430={},_0x104343={},_0xc2e71={'count':0x0,'rows':[]};var _0x54bc09=_[_0xfaa3('0x2c')](db['Cdr'][_0xfaa3('0x2d')],function(_0x5d37bb){return{'name':_0x5d37bb[_0xfaa3('0x2e')],'type':_0x5d37bb[_0xfaa3('0x2f')][_0xfaa3('0x30')]};});_0x104343[_0xfaa3('0x31')]=_[_0xfaa3('0x2c')](_0x54bc09,_0xfaa3('0x29'));_0x104343[_0xfaa3('0x32')]=_[_0xfaa3('0x33')](_0x2d7c43['query']);_0x104343[_0xfaa3('0x34')]=_[_0xfaa3('0x35')](_0x104343[_0xfaa3('0x31')],_0x104343[_0xfaa3('0x32')]);_0x230430[_0xfaa3('0x36')]=_[_0xfaa3('0x35')](_0x104343[_0xfaa3('0x31')],qs[_0xfaa3('0x37')](_0x2d7c43[_0xfaa3('0x32')][_0xfaa3('0x37')]));_0x230430[_0xfaa3('0x36')]=_0x230430[_0xfaa3('0x36')][_0xfaa3('0x38')]?_0x230430[_0xfaa3('0x36')]:_0x104343[_0xfaa3('0x31')];if(!_0x2d7c43[_0xfaa3('0x32')]['hasOwnProperty'](_0xfaa3('0x39'))){_0x230430[_0xfaa3('0x1f')]=qs[_0xfaa3('0x1f')](_0x2d7c43[_0xfaa3('0x32')][_0xfaa3('0x1f')]);_0x230430[_0xfaa3('0x1d')]=qs[_0xfaa3('0x1d')](_0x2d7c43[_0xfaa3('0x32')]['offset']);}_0x230430[_0xfaa3('0x3a')]=qs[_0xfaa3('0x3b')](_0x2d7c43[_0xfaa3('0x32')]['sort']);_0x230430[_0xfaa3('0x3c')]=qs[_0xfaa3('0x34')](_['pick'](_0x2d7c43[_0xfaa3('0x32')],_0x104343[_0xfaa3('0x34')]),_0x54bc09);if(_0x2d7c43[_0xfaa3('0x32')][_0xfaa3('0x3d')]){_0x230430[_0xfaa3('0x3c')]=_[_0xfaa3('0x3e')](_0x230430['where'],{'$or':_['map'](_0x54bc09,function(_0x41498d){if(_0x41498d[_0xfaa3('0x2f')]!=='VIRTUAL'){var _0x4ae1c3={};_0x4ae1c3[_0x41498d[_0xfaa3('0x29')]]={'$like':'%'+_0x2d7c43['query'][_0xfaa3('0x3d')]+'%'};return _0x4ae1c3;}})});}_0x230430=_[_0xfaa3('0x3e')]({},_0x230430,_0x2d7c43[_0xfaa3('0x3f')]);var _0x3fb71d={'where':_0x230430[_0xfaa3('0x3c')]};return db[_0xfaa3('0x40')][_0xfaa3('0x20')](_0x3fb71d)[_0xfaa3('0x25')](function(_0x551cd5){_0xc2e71['count']=_0x551cd5;if(_0x2d7c43['query']['includeAll']){_0x230430[_0xfaa3('0x41')]=[{'all':!![]}];}return db[_0xfaa3('0x40')]['findAll'](_0x230430);})[_0xfaa3('0x25')](function(_0xa83a03){_0xc2e71[_0xfaa3('0x42')]=_0xa83a03;return _0xc2e71;})['then'](respondWithFilteredResult(_0x5b84cd,_0x230430))['catch'](handleError(_0x5b84cd,null));};exports[_0xfaa3('0x43')]=function(_0x4c19fc,_0x1701bc){var _0x57b77c={'raw':!![],'where':{'id':_0x4c19fc[_0xfaa3('0x44')]['id']}},_0x59b4d7={};_0x59b4d7[_0xfaa3('0x31')]=_['keys'](db[_0xfaa3('0x40')]['rawAttributes']);_0x59b4d7[_0xfaa3('0x32')]=_['keys'](_0x4c19fc[_0xfaa3('0x32')]);_0x59b4d7[_0xfaa3('0x34')]=_[_0xfaa3('0x35')](_0x59b4d7['model'],_0x59b4d7[_0xfaa3('0x32')]);_0x57b77c[_0xfaa3('0x36')]=_['intersection'](_0x59b4d7[_0xfaa3('0x31')],qs[_0xfaa3('0x37')](_0x4c19fc[_0xfaa3('0x32')][_0xfaa3('0x37')]));_0x57b77c['attributes']=_0x57b77c[_0xfaa3('0x36')][_0xfaa3('0x38')]?_0x57b77c['attributes']:_0x59b4d7[_0xfaa3('0x31')];if(_0x4c19fc['query'][_0xfaa3('0x45')]){_0x57b77c[_0xfaa3('0x41')]=[{'all':!![]}];}_0x57b77c=_[_0xfaa3('0x3e')]({},_0x57b77c,_0x4c19fc['options']);return db[_0xfaa3('0x40')]['find'](_0x57b77c)['then'](handleEntityNotFound(_0x1701bc,null))[_0xfaa3('0x25')](respondWithResult(_0x1701bc,null))[_0xfaa3('0x46')](handleError(_0x1701bc,null));};exports[_0xfaa3('0x47')]=function(_0x27feb6,_0x1a4fa4){return db[_0xfaa3('0x40')][_0xfaa3('0x47')](_0x27feb6['body'],{})[_0xfaa3('0x25')](respondWithResult(_0x1a4fa4,0xc9))[_0xfaa3('0x46')](handleError(_0x1a4fa4,null));};exports[_0xfaa3('0x48')]=function(_0x72f502,_0x431725){if(_0x72f502[_0xfaa3('0x49')]['id']){delete _0x72f502[_0xfaa3('0x49')]['id'];}return db['Cdr']['find']({'where':{'id':_0x72f502['params']['id']}})[_0xfaa3('0x25')](handleEntityNotFound(_0x431725,null))[_0xfaa3('0x25')](saveUpdates(_0x72f502[_0xfaa3('0x49')],null))[_0xfaa3('0x25')](respondWithResult(_0x431725,null))['catch'](handleError(_0x431725,null));};exports[_0xfaa3('0x26')]=function(_0x50336d,_0x513d3e){return db['Cdr']['find']({'where':{'id':_0x50336d['params']['id']}})[_0xfaa3('0x25')](handleEntityNotFound(_0x513d3e,null))[_0xfaa3('0x25')](removeEntity(_0x513d3e,null))[_0xfaa3('0x46')](handleError(_0x513d3e,null));};exports[_0xfaa3('0x4a')]=function(_0x32ab8d,_0x1c856b){return db[_0xfaa3('0x40')][_0xfaa3('0x4a')]()['then'](respondWithResult(_0x1c856b,null))[_0xfaa3('0x46')](handleError(_0x1c856b,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','Cdr','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(_0x560958,_0x1fc7bb){var _0x29b6b9=function(_0x40924d){while(--_0x40924d){_0x560958['push'](_0x560958['shift']());}};_0x29b6b9(++_0x1fc7bb);}(_0xc03e,0x15a));var _0xec03=function(_0x481604,_0x276ff8){_0x481604=_0x481604-0x0;var _0x1ca4ed=_0xc03e[_0x481604];return _0x1ca4ed;};'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['Cdr'][_0xec03('0x1f')](_0x454e91)['then'](function(_0x548b81){_0x35a9eb[_0xec03('0x1f')]=_0x548b81;if(_0x49f9ab[_0xec03('0x32')]['includeAll']){_0x2063ba[_0xec03('0x42')]=[{'all':!![]}];}return db['Cdr']['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 9e0315d..bc286f2 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(_0xd9e22d,_0x541020){var _0x4abe3b=function(_0x1f067f){while(--_0x1f067f){_0xd9e22d['push'](_0xd9e22d['shift']());}};_0x4abe3b(++_0x541020);}(_0x7a54,0x106));var _0x47a5=function(_0x57ca29,_0x6d2c36){_0x57ca29=_0x57ca29-0x0;var _0xdd6bf4=_0x7a54[_0x57ca29];return _0xdd6bf4;};'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(_0x97a647,_0x6d0f3e){var _0x151593=function(_0x588803){while(--_0x588803){_0x97a647['push'](_0x97a647['shift']());}};_0x151593(++_0x6d0f3e);}(_0x7a54,0x106));var _0x47a5=function(_0x357f46,_0x5371e5){_0x357f46=_0x357f46-0x0;var _0x3431d1=_0x7a54[_0x357f46];return _0x3431d1;};'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 f0074f1..3237cd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65c3=['jayson/promise','client','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3230ab,_0x46eac4){var _0x486975=function(_0x5b9129){while(--_0x5b9129){_0x3230ab['push'](_0x3230ab['shift']());}};_0x486975(++_0x46eac4);}(_0x65c3,0x174));var _0x365c=function(_0x222b63,_0x5a1691){_0x222b63=_0x222b63-0x0;var _0xc270a6=_0x65c3[_0x222b63];return _0xc270a6;};'use strict';var _=require(_0x365c('0x0'));var util=require(_0x365c('0x1'));var moment=require(_0x365c('0x2'));var BPromise=require(_0x365c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x365c('0x4'))['db'];var utils=require(_0x365c('0x5'));var logger=require('../../config/logger')(_0x365c('0x6'));var config=require(_0x365c('0x7'));var jayson=require(_0x365c('0x8'));var client=jayson[_0x365c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fabc0,_0x5e8ef4,_0x485850){return new BPromise(function(_0x59dbe4,_0x3c4d48){return client['request'](_0x4fabc0,_0x485850)[_0x365c('0xa')](function(_0x25414f){logger[_0x365c('0xb')](_0x365c('0xc'),_0x5e8ef4,_0x365c('0xd'));logger[_0x365c('0xe')](_0x365c('0xf'),_0x5e8ef4,_0x365c('0xd'),JSON['stringify'](_0x25414f));if(_0x25414f[_0x365c('0x10')]){if(_0x25414f[_0x365c('0x10')][_0x365c('0x11')]===0x1f4){logger[_0x365c('0x10')](_0x365c('0xc'),_0x5e8ef4,_0x25414f[_0x365c('0x10')]['message']);return _0x3c4d48(_0x25414f[_0x365c('0x10')][_0x365c('0x12')]);}logger[_0x365c('0x10')](_0x365c('0xc'),_0x5e8ef4,_0x25414f[_0x365c('0x10')][_0x365c('0x12')]);return _0x59dbe4(_0x25414f[_0x365c('0x10')][_0x365c('0x12')]);}else{logger[_0x365c('0xb')]('Cdr,\x20%s,\x20%s',_0x5e8ef4,'request\x20sent');_0x59dbe4(_0x25414f['result'][_0x365c('0x12')]);}})[_0x365c('0x13')](function(_0x267a92){logger[_0x365c('0x10')]('Cdr,\x20%s,\x20%s',_0x5e8ef4,_0x267a92);_0x3c4d48(_0x267a92);});});}
\ No newline at end of file
+var _0x20ce=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3f7313,_0x399ba6){var _0x2afe38=function(_0x2bf07d){while(--_0x2bf07d){_0x3f7313['push'](_0x3f7313['shift']());}};_0x2afe38(++_0x399ba6);}(_0x20ce,0xfe));var _0xe20c=function(_0x37a7b4,_0x3a3e6e){_0x37a7b4=_0x37a7b4-0x0;var _0x4f4277=_0x20ce[_0x37a7b4];return _0x4f4277;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require(_0xe20c('0x3'));var rs=require(_0xe20c('0x4'));var fs=require('fs');var Redis=require(_0xe20c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe20c('0x6'))(_0xe20c('0x7'));var config=require(_0xe20c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe20c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39eced,_0x2a4d38,_0x2474ed){return new BPromise(function(_0xd2ff53,_0x42433b){return client['request'](_0x39eced,_0x2474ed)[_0xe20c('0xa')](function(_0xe3a3b0){logger[_0xe20c('0xb')](_0xe20c('0xc'),_0x2a4d38,'request\x20sent');logger[_0xe20c('0xd')](_0xe20c('0xe'),_0x2a4d38,'request\x20sent',JSON[_0xe20c('0xf')](_0xe3a3b0));if(_0xe3a3b0['error']){if(_0xe3a3b0[_0xe20c('0x10')][_0xe20c('0x11')]===0x1f4){logger['error'](_0xe20c('0xc'),_0x2a4d38,_0xe3a3b0[_0xe20c('0x10')][_0xe20c('0x12')]);return _0x42433b(_0xe3a3b0[_0xe20c('0x10')]['message']);}logger[_0xe20c('0x10')](_0xe20c('0xc'),_0x2a4d38,_0xe3a3b0['error'][_0xe20c('0x12')]);return _0xd2ff53(_0xe3a3b0['error']['message']);}else{logger[_0xe20c('0xb')](_0xe20c('0xc'),_0x2a4d38,'request\x20sent');_0xd2ff53(_0xe3a3b0[_0xe20c('0x13')][_0xe20c('0x12')]);}})[_0xe20c('0x14')](function(_0x120c56){logger[_0xe20c('0x10')](_0xe20c('0xc'),_0x2a4d38,_0x120c56);_0x42433b(_0x120c56);});});}
\ No newline at end of file
index 6b7adbd..ee0c555 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(_0x26a382,_0x3d54db){var _0x14f9c8=function(_0x1b69f6){while(--_0x1b69f6){_0x26a382['push'](_0x26a382['shift']());}};_0x14f9c8(++_0x3d54db);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x8e7772,_0x9d77b0){var _0x408200=function(_0x1c61b6){while(--_0x1c61b6){_0x8e7772['push'](_0x8e7772['shift']());}};_0x408200(++_0x9d77b0);}(_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
index a85a64c..28bd926 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbca7=['*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xbca7,0x83));var _0x7bca=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xbca7[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x7bca('0x0'));module[_0x7bca('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7bca('0x2')],'allowNull':![],'defaultValue':_0x7bca('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7bca('0x2')]},'interval':{'type':Sequelize[_0x7bca('0x2')],'defaultValue':_0x7bca('0x4')}};
\ No newline at end of file
+var _0xe500=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe500,0x1e5));var _0x0e50=function(_0x4057f9,_0x17c5b5){_0x4057f9=_0x4057f9-0x0;var _0x5552b7=_0xe500[_0x4057f9];return _0x5552b7;};'use strict';var Sequelize=require(_0x0e50('0x0'));module[_0x0e50('0x1')]={'priority':{'type':Sequelize[_0x0e50('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0e50('0x3')],'allowNull':![],'defaultValue':_0x0e50('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0e50('0x3')]},'interval':{'type':Sequelize[_0x0e50('0x3')],'defaultValue':_0x0e50('0x5')}};
\ No newline at end of file
index 0931c6a..19874b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9063=['options','then','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','sendStatus','error','stack','name','show','params','ChatApplication','rawAttributes','query','keys','filters','model','fields','attributes','length','includeAll','include','merge'];(function(_0x3c915f,_0x2d8e8e){var _0x5ce65d=function(_0x3d8a2b){while(--_0x3d8a2b){_0x3c915f['push'](_0x3c915f['shift']());}};_0x5ce65d(++_0x2d8e8e);}(_0x9063,0x1a2));var _0x3906=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9063[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x3906('0x0'));var rimraf=require(_0x3906('0x1'));var zipdir=require(_0x3906('0x2'));var jsonpatch=require(_0x3906('0x3'));var rp=require(_0x3906('0x4'));var moment=require(_0x3906('0x5'));var BPromise=require(_0x3906('0x6'));var Mustache=require(_0x3906('0x7'));var util=require('util');var path=require(_0x3906('0x8'));var sox=require(_0x3906('0x9'));var csv=require(_0x3906('0xa'));var ejs=require(_0x3906('0xb'));var fs=require('fs');var fs_extra=require(_0x3906('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3906('0xd'));var deskjs=require(_0x3906('0xe'));var toCsv=require(_0x3906('0xa'));var querystring=require('querystring');var Papa=require(_0x3906('0xf'));var Redis=require(_0x3906('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3906('0x11'));var as=require(_0x3906('0x12'));var hardwareService=require(_0x3906('0x13'));var logger=require('../../config/logger')(_0x3906('0x14'));var utils=require(_0x3906('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3906('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c4e15,_0xc58c20){_0xc58c20=_0xc58c20||0xcc;return function(_0x2fd0ca){if(_0x2fd0ca){return _0x4c4e15['sendStatus'](_0xc58c20);}return _0x4c4e15['status'](_0xc58c20)[_0x3906('0x17')]();};}function respondWithResult(_0x3e69a4,_0x4a741f){_0x4a741f=_0x4a741f||0xc8;return function(_0x57d5e4){if(_0x57d5e4){return _0x3e69a4[_0x3906('0x18')](_0x4a741f)[_0x3906('0x19')](_0x57d5e4);}};}function respondWithFilteredResult(_0x30645c,_0x28211f){return function(_0x31774d){if(_0x31774d){var _0x7d7401=typeof _0x28211f[_0x3906('0x1a')]===_0x3906('0x1b')&&typeof _0x28211f[_0x3906('0x1c')]===_0x3906('0x1b');var _0x5b28bc=_0x31774d[_0x3906('0x1d')];var _0x56b52a=_0x7d7401?0x0:_0x28211f[_0x3906('0x1a')];var _0x3c6900=_0x7d7401?_0x31774d[_0x3906('0x1d')]:_0x28211f[_0x3906('0x1a')]+_0x28211f['limit'];var _0x149213;if(_0x3c6900>=_0x5b28bc){_0x3c6900=_0x5b28bc;_0x149213=0xc8;}else{_0x149213=0xce;}_0x30645c[_0x3906('0x18')](_0x149213);return _0x30645c[_0x3906('0x1e')](_0x3906('0x1f'),_0x56b52a+'-'+_0x3c6900+'/'+_0x5b28bc)[_0x3906('0x19')](_0x31774d);}return null;};}function patchUpdates(_0x553333){return function(_0x1495bc){try{jsonpatch[_0x3906('0x20')](_0x1495bc,_0x553333,!![]);}catch(_0x4710ac){return BPromise[_0x3906('0x21')](_0x4710ac);}return _0x1495bc['save']();};}function saveUpdates(_0x2a1ba8,_0x472411){return function(_0x3c3184){if(_0x3c3184){return _0x3c3184[_0x3906('0x22')](_0x2a1ba8)['then'](function(_0x5a3a57){return _0x5a3a57;});}return null;};}function removeEntity(_0x2027ee,_0x33edf1){return function(_0x343821){if(_0x343821){return _0x343821[_0x3906('0x23')]()['then'](function(){_0x2027ee[_0x3906('0x18')](0xcc)[_0x3906('0x17')]();});}};}function handleEntityNotFound(_0x5a471c,_0x4a2eea){return function(_0x229b3e){if(!_0x229b3e){_0x5a471c[_0x3906('0x24')](0x194);}return _0x229b3e;};}function handleError(_0x30f75b,_0x5911af){_0x5911af=_0x5911af||0x1f4;return function(_0x150d6b){logger[_0x3906('0x25')](_0x150d6b[_0x3906('0x26')]);if(_0x150d6b[_0x3906('0x27')]){delete _0x150d6b['name'];}_0x30f75b[_0x3906('0x18')](_0x5911af)['send'](_0x150d6b);};}exports[_0x3906('0x28')]=function(_0x59d276,_0x579524){var _0x21f846={'raw':!![],'where':{'id':_0x59d276[_0x3906('0x29')]['id']}},_0x669f56={};_0x669f56['model']=_['keys'](db[_0x3906('0x2a')][_0x3906('0x2b')]);_0x669f56[_0x3906('0x2c')]=_[_0x3906('0x2d')](_0x59d276[_0x3906('0x2c')]);_0x669f56[_0x3906('0x2e')]=_['intersection'](_0x669f56[_0x3906('0x2f')],_0x669f56[_0x3906('0x2c')]);_0x21f846['attributes']=_['intersection'](_0x669f56[_0x3906('0x2f')],qs['fields'](_0x59d276[_0x3906('0x2c')][_0x3906('0x30')]));_0x21f846['attributes']=_0x21f846[_0x3906('0x31')][_0x3906('0x32')]?_0x21f846[_0x3906('0x31')]:_0x669f56[_0x3906('0x2f')];if(_0x59d276[_0x3906('0x2c')][_0x3906('0x33')]){_0x21f846[_0x3906('0x34')]=[{'all':!![]}];}_0x21f846=_[_0x3906('0x35')]({},_0x21f846,_0x59d276[_0x3906('0x36')]);return db[_0x3906('0x2a')]['find'](_0x21f846)[_0x3906('0x37')](handleEntityNotFound(_0x579524,null))[_0x3906('0x37')](respondWithResult(_0x579524,null))[_0x3906('0x38')](handleError(_0x579524,null));};exports[_0x3906('0x22')]=function(_0x4aa6fd,_0x20f157){if(_0x4aa6fd[_0x3906('0x39')]['id']){delete _0x4aa6fd[_0x3906('0x39')]['id'];}return db[_0x3906('0x2a')][_0x3906('0x3a')]({'where':{'id':_0x4aa6fd[_0x3906('0x29')]['id']}})[_0x3906('0x37')](handleEntityNotFound(_0x20f157,null))[_0x3906('0x37')](saveUpdates(_0x4aa6fd[_0x3906('0x39')],null))[_0x3906('0x37')](respondWithResult(_0x20f157,null))[_0x3906('0x38')](handleError(_0x20f157,null));};exports[_0x3906('0x23')]=function(_0x2889e0,_0x2274a0){return db['ChatApplication']['find']({'where':{'id':_0x2889e0[_0x3906('0x29')]['id']}})[_0x3906('0x37')](handleEntityNotFound(_0x2274a0,null))['then'](removeEntity(_0x2274a0,null))[_0x3906('0x38')](handleError(_0x2274a0,null));};
\ No newline at end of file
+var _0x7070=['catch','update','body','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','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','offset','limit','undefined','set','json','save','then','destroy','error','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','model','fields','length','include','merge','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7070,0x1d7));var _0x0707=function(_0xc19d6,_0x4d5cf3){_0xc19d6=_0xc19d6-0x0;var _0x255f2b=_0x7070[_0xc19d6];return _0x255f2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0707('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0707('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0707('0x2'));var Mustache=require(_0x0707('0x3'));var util=require(_0x0707('0x4'));var path=require(_0x0707('0x5'));var sox=require('sox');var csv=require(_0x0707('0x6'));var ejs=require(_0x0707('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0707('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0707('0x9'));var toCsv=require(_0x0707('0x6'));var querystring=require(_0x0707('0xa'));var Papa=require(_0x0707('0xb'));var Redis=require(_0x0707('0xc'));var authService=require(_0x0707('0xd'));var qs=require(_0x0707('0xe'));var as=require(_0x0707('0xf'));var hardwareService=require(_0x0707('0x10'));var logger=require(_0x0707('0x11'))('api');var utils=require(_0x0707('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0707('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b55c6,_0x2bd4d8){_0x2bd4d8=_0x2bd4d8||0xcc;return function(_0x3eeea8){if(_0x3eeea8){return _0x3b55c6[_0x0707('0x14')](_0x2bd4d8);}return _0x3b55c6[_0x0707('0x15')](_0x2bd4d8)[_0x0707('0x16')]();};}function respondWithResult(_0x3b0f64,_0x111fd7){_0x111fd7=_0x111fd7||0xc8;return function(_0x380abc){if(_0x380abc){return _0x3b0f64[_0x0707('0x15')](_0x111fd7)['json'](_0x380abc);}};}function respondWithFilteredResult(_0x5bae3d,_0x3fce78){return function(_0x429da2){if(_0x429da2){var _0x1370b3=typeof _0x3fce78[_0x0707('0x17')]==='undefined'&&typeof _0x3fce78[_0x0707('0x18')]===_0x0707('0x19');var _0xe1cf0e=_0x429da2['count'];var _0x13d5de=_0x1370b3?0x0:_0x3fce78['offset'];var _0x471431=_0x1370b3?_0x429da2['count']:_0x3fce78[_0x0707('0x17')]+_0x3fce78[_0x0707('0x18')];var _0x1debb9;if(_0x471431>=_0xe1cf0e){_0x471431=_0xe1cf0e;_0x1debb9=0xc8;}else{_0x1debb9=0xce;}_0x5bae3d[_0x0707('0x15')](_0x1debb9);return _0x5bae3d[_0x0707('0x1a')]('Content-Range',_0x13d5de+'-'+_0x471431+'/'+_0xe1cf0e)[_0x0707('0x1b')](_0x429da2);}return null;};}function patchUpdates(_0x360caf){return function(_0x37d1fd){try{jsonpatch['apply'](_0x37d1fd,_0x360caf,!![]);}catch(_0x5c8731){return BPromise['reject'](_0x5c8731);}return _0x37d1fd[_0x0707('0x1c')]();};}function saveUpdates(_0x3f31e1,_0x1d133c){return function(_0x51dec4){if(_0x51dec4){return _0x51dec4['update'](_0x3f31e1)[_0x0707('0x1d')](function(_0x225a58){return _0x225a58;});}return null;};}function removeEntity(_0x370554,_0x3e9c41){return function(_0x3ba507){if(_0x3ba507){return _0x3ba507[_0x0707('0x1e')]()[_0x0707('0x1d')](function(){_0x370554[_0x0707('0x15')](0xcc)[_0x0707('0x16')]();});}};}function handleEntityNotFound(_0x3dc5fb,_0x392acd){return function(_0x373bca){if(!_0x373bca){_0x3dc5fb['sendStatus'](0x194);}return _0x373bca;};}function handleError(_0x14d68b,_0x1834e0){_0x1834e0=_0x1834e0||0x1f4;return function(_0x3be832){logger[_0x0707('0x1f')](_0x3be832['stack']);if(_0x3be832[_0x0707('0x20')]){delete _0x3be832[_0x0707('0x20')];}_0x14d68b[_0x0707('0x15')](_0x1834e0)[_0x0707('0x21')](_0x3be832);};}exports[_0x0707('0x22')]=function(_0x599090,_0x1a4f0b){var _0x3378a5={'raw':!![],'where':{'id':_0x599090[_0x0707('0x23')]['id']}},_0x2f0ed2={};_0x2f0ed2['model']=_[_0x0707('0x24')](db[_0x0707('0x25')][_0x0707('0x26')]);_0x2f0ed2[_0x0707('0x27')]=_[_0x0707('0x24')](_0x599090[_0x0707('0x27')]);_0x2f0ed2[_0x0707('0x28')]=_['intersection'](_0x2f0ed2['model'],_0x2f0ed2[_0x0707('0x27')]);_0x3378a5[_0x0707('0x29')]=_[_0x0707('0x2a')](_0x2f0ed2[_0x0707('0x2b')],qs['fields'](_0x599090[_0x0707('0x27')][_0x0707('0x2c')]));_0x3378a5['attributes']=_0x3378a5[_0x0707('0x29')][_0x0707('0x2d')]?_0x3378a5['attributes']:_0x2f0ed2[_0x0707('0x2b')];if(_0x599090[_0x0707('0x27')]['includeAll']){_0x3378a5[_0x0707('0x2e')]=[{'all':!![]}];}_0x3378a5=_[_0x0707('0x2f')]({},_0x3378a5,_0x599090['options']);return db[_0x0707('0x25')][_0x0707('0x30')](_0x3378a5)[_0x0707('0x1d')](handleEntityNotFound(_0x1a4f0b,null))[_0x0707('0x1d')](respondWithResult(_0x1a4f0b,null))[_0x0707('0x31')](handleError(_0x1a4f0b,null));};exports[_0x0707('0x32')]=function(_0x19c84,_0x5e5b1a){if(_0x19c84[_0x0707('0x33')]['id']){delete _0x19c84[_0x0707('0x33')]['id'];}return db[_0x0707('0x25')]['find']({'where':{'id':_0x19c84[_0x0707('0x23')]['id']}})[_0x0707('0x1d')](handleEntityNotFound(_0x5e5b1a,null))['then'](saveUpdates(_0x19c84[_0x0707('0x33')],null))[_0x0707('0x1d')](respondWithResult(_0x5e5b1a,null))[_0x0707('0x31')](handleError(_0x5e5b1a,null));};exports['destroy']=function(_0x362d24,_0x4d093c){return db[_0x0707('0x25')][_0x0707('0x30')]({'where':{'id':_0x362d24[_0x0707('0x23')]['id']}})[_0x0707('0x1d')](handleEntityNotFound(_0x4d093c,null))[_0x0707('0x1d')](removeEntity(_0x4d093c,null))[_0x0707('0x31')](handleError(_0x4d093c,null));};
\ No newline at end of file
index d1b74a4..c80b007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x761a=['../../config/environment','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','path','rimraf'];(function(_0x193314,_0x4bd544){var _0x375bda=function(_0x27b5a2){while(--_0x27b5a2){_0x193314['push'](_0x193314['shift']());}};_0x375bda(++_0x4bd544);}(_0x761a,0xe2));var _0xa761=function(_0x4f668b,_0x1be98e){_0x4f668b=_0x4f668b-0x0;var _0x3cfe00=_0x761a[_0x4f668b];return _0x3cfe00;};'use strict';var _=require('lodash');var util=require(_0xa761('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa761('0x1'));var BPromise=require(_0xa761('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa761('0x3'));var rimraf=require(_0xa761('0x4'));var config=require(_0xa761('0x5'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x16bcf1,_0x4d7b83){return _0x16bcf1[_0xa761('0x6')](_0xa761('0x7'),attributes,{'tableName':_0xa761('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa761('0x9'),'collate':_0xa761('0xa')});};
\ No newline at end of file
+var _0xac05=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','utf8mb4'];(function(_0x443383,_0x11d7b9){var _0x10552c=function(_0x47ff7e){while(--_0x47ff7e){_0x443383['push'](_0x443383['shift']());}};_0x10552c(++_0x11d7b9);}(_0xac05,0x1c3));var _0x5ac0=function(_0x4265fb,_0x5cc20a){_0x4265fb=_0x4265fb-0x0;var _0x295c3f=_0xac05[_0x4265fb];return _0x295c3f;};'use strict';var _=require(_0x5ac0('0x0'));var util=require(_0x5ac0('0x1'));var logger=require(_0x5ac0('0x2'))(_0x5ac0('0x3'));var moment=require(_0x5ac0('0x4'));var BPromise=require(_0x5ac0('0x5'));var rp=require(_0x5ac0('0x6'));var fs=require('fs');var path=require(_0x5ac0('0x7'));var rimraf=require(_0x5ac0('0x8'));var config=require(_0x5ac0('0x9'));var attributes=require('./chatApplication.attributes');module[_0x5ac0('0xa')]=function(_0xfcf73e,_0x5ca7e4){return _0xfcf73e[_0x5ac0('0xb')](_0x5ac0('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ac0('0xd'),'collate':_0x5ac0('0xe')});};
\ No newline at end of file
index 2519bf4..e55c951 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x851d=['request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x1983dc,_0xdbed78){var _0x2095b6=function(_0x478069){while(--_0x478069){_0x1983dc['push'](_0x1983dc['shift']());}};_0x2095b6(++_0xdbed78);}(_0x851d,0x6e));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd851('0x0'));var moment=require(_0xd851('0x1'));var BPromise=require(_0xd851('0x2'));var rs=require(_0xd851('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd851('0x4'))['db'];var utils=require(_0xd851('0x5'));var logger=require(_0xd851('0x6'))(_0xd851('0x7'));var config=require('../../config/environment');var jayson=require(_0xd851('0x8'));var client=jayson['client'][_0xd851('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c8ce6,_0x8ba727,_0x4b24c4){return new BPromise(function(_0x2570e9,_0x31e599){return client[_0xd851('0xa')](_0x1c8ce6,_0x4b24c4)['then'](function(_0x315b1f){logger[_0xd851('0xb')](_0xd851('0xc'),_0x8ba727,_0xd851('0xd'));logger[_0xd851('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x8ba727,_0xd851('0xd'),JSON['stringify'](_0x315b1f));if(_0x315b1f[_0xd851('0xf')]){if(_0x315b1f[_0xd851('0xf')][_0xd851('0x10')]===0x1f4){logger['error'](_0xd851('0xc'),_0x8ba727,_0x315b1f[_0xd851('0xf')][_0xd851('0x11')]);return _0x31e599(_0x315b1f[_0xd851('0xf')][_0xd851('0x11')]);}logger[_0xd851('0xf')](_0xd851('0xc'),_0x8ba727,_0x315b1f['error'][_0xd851('0x11')]);return _0x2570e9(_0x315b1f[_0xd851('0xf')][_0xd851('0x11')]);}else{logger['info'](_0xd851('0xc'),_0x8ba727,_0xd851('0xd'));_0x2570e9(_0x315b1f[_0xd851('0x12')][_0xd851('0x11')]);}})[_0xd851('0x13')](function(_0x3c22b7){logger['error'](_0xd851('0xc'),_0x8ba727,_0x3c22b7);_0x31e599(_0x3c22b7);});});}
\ No newline at end of file
+var _0x868b=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x868b,0x18e));var _0xb868=function(_0x41e7ea,_0x463af6){_0x41e7ea=_0x41e7ea-0x0;var _0x6a81e2=_0x868b[_0x41e7ea];return _0x6a81e2;};'use strict';var _=require('lodash');var util=require(_0xb868('0x0'));var moment=require(_0xb868('0x1'));var BPromise=require(_0xb868('0x2'));var rs=require(_0xb868('0x3'));var fs=require('fs');var Redis=require(_0xb868('0x4'));var db=require(_0xb868('0x5'))['db'];var utils=require(_0xb868('0x6'));var logger=require(_0xb868('0x7'))(_0xb868('0x8'));var config=require(_0xb868('0x9'));var jayson=require(_0xb868('0xa'));var client=jayson['client'][_0xb868('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6e1f,_0x1a6b28,_0x20279c){return new BPromise(function(_0xc7ab6d,_0x5c2096){return client[_0xb868('0xc')](_0x4c6e1f,_0x20279c)['then'](function(_0x3b8d00){logger[_0xb868('0xd')]('ChatApplication,\x20%s,\x20%s',_0x1a6b28,_0xb868('0xe'));logger[_0xb868('0xf')](_0xb868('0x10'),_0x1a6b28,'request\x20sent',JSON[_0xb868('0x11')](_0x3b8d00));if(_0x3b8d00['error']){if(_0x3b8d00[_0xb868('0x12')][_0xb868('0x13')]===0x1f4){logger[_0xb868('0x12')](_0xb868('0x14'),_0x1a6b28,_0x3b8d00[_0xb868('0x12')][_0xb868('0x15')]);return _0x5c2096(_0x3b8d00[_0xb868('0x12')]['message']);}logger[_0xb868('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1a6b28,_0x3b8d00[_0xb868('0x12')][_0xb868('0x15')]);return _0xc7ab6d(_0x3b8d00[_0xb868('0x12')]['message']);}else{logger[_0xb868('0xd')]('ChatApplication,\x20%s,\x20%s',_0x1a6b28,_0xb868('0xe'));_0xc7ab6d(_0x3b8d00[_0xb868('0x16')][_0xb868('0x15')]);}})['catch'](function(_0x4ce44e){logger['error'](_0xb868('0x14'),_0x1a6b28,_0x4ce44e);_0x5c2096(_0x4ce44e);});});}
\ No newline at end of file
index 6b5cd27..e4b6e41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fe4=['get','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x1fe4,0x18f));var _0x41fe=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x1fe4[_0xd39959];return _0x1ff69c;};'use strict';var multer=require('multer');var util=require(_0x41fe('0x0'));var path=require(_0x41fe('0x1'));var timeout=require(_0x41fe('0x2'));var express=require(_0x41fe('0x3'));var router=express[_0x41fe('0x4')]();var fs_extra=require(_0x41fe('0x5'));var auth=require(_0x41fe('0x6'));var interaction=require(_0x41fe('0x7'));var config=require(_0x41fe('0x8'));var controller=require('./chatApplication.controller');router[_0x41fe('0x9')](_0x41fe('0xa'),auth[_0x41fe('0xb')](),controller[_0x41fe('0xc')]);router[_0x41fe('0xd')](_0x41fe('0xa'),auth['isAuthenticated'](),controller[_0x41fe('0xe')]);router[_0x41fe('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x41fe('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x7707=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show','put','isAuthenticated','/:id','destroy','exports','util','connect-timeout','express'];(function(_0x4bb5d5,_0xdbdf58){var _0x7b0473=function(_0x2b529e){while(--_0x2b529e){_0x4bb5d5['push'](_0x4bb5d5['shift']());}};_0x7b0473(++_0xdbdf58);}(_0x7707,0xfd));var _0x7770=function(_0x58326d,_0x390169){_0x58326d=_0x58326d-0x0;var _0x25d24b=_0x7707[_0x58326d];return _0x25d24b;};'use strict';var multer=require('multer');var util=require(_0x7770('0x0'));var path=require('path');var timeout=require(_0x7770('0x1'));var express=require(_0x7770('0x2'));var router=express[_0x7770('0x3')]();var fs_extra=require(_0x7770('0x4'));var auth=require(_0x7770('0x5'));var interaction=require(_0x7770('0x6'));var config=require(_0x7770('0x7'));var controller=require(_0x7770('0x8'));router[_0x7770('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7770('0xa')]);router[_0x7770('0xb')]('/:id',auth[_0x7770('0xc')](),controller['update']);router['delete'](_0x7770('0xd'),auth[_0x7770('0xc')](),controller[_0x7770('0xe')]);module[_0x7770('0xf')]=router;
\ No newline at end of file
index b79f5db..b64c0d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2af8=['sequelize','STRING'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0x2af8,0xf6));var _0x82af=function(_0x58f623,_0xcb5963){_0x58f623=_0x58f623-0x0;var _0x49baeb=_0x2af8[_0x58f623];return _0x49baeb;};'use strict';var Sequelize=require(_0x82af('0x0'));module['exports']={'name':{'type':Sequelize[_0x82af('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82af('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb3f9=['exports','BOOLEAN','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x619848,_0xbe695d){_0x619848=_0x619848-0x0;var _0x5887fb=_0xb3f9[_0x619848];return _0x5887fb;};'use strict';var Sequelize=require(_0x9b3f('0x0'));module[_0x9b3f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9b3f('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 3be59a1..16c6d56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x115a=['where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x115a,0x199));var _0xa115=function(_0x5d4bd9,_0xc3b02c){_0x5d4bd9=_0x5d4bd9-0x0;var _0x52b688=_0x115a[_0x5d4bd9];return _0x52b688;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa115('0x0'));var zipdir=require(_0xa115('0x1'));var jsonpatch=require(_0xa115('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa115('0x3'));var Mustache=require(_0xa115('0x4'));var util=require(_0xa115('0x5'));var path=require('path');var sox=require(_0xa115('0x6'));var csv=require(_0xa115('0x7'));var ejs=require(_0xa115('0x8'));var fs=require('fs');var fs_extra=require(_0xa115('0x9'));var _=require(_0xa115('0xa'));var squel=require(_0xa115('0xb'));var crypto=require(_0xa115('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa115('0x7'));var querystring=require(_0xa115('0xd'));var Papa=require(_0xa115('0xe'));var Redis=require('ioredis');var authService=require(_0xa115('0xf'));var qs=require(_0xa115('0x10'));var as=require(_0xa115('0x11'));var hardwareService=require(_0xa115('0x12'));var logger=require('../../config/logger')(_0xa115('0x13'));var utils=require(_0xa115('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa115('0x15'))['db'];config[_0xa115('0x16')]=_['defaults'](config[_0xa115('0x16')],{'host':_0xa115('0x17'),'port':0x18eb});var socket=require(_0xa115('0x18'))(new Redis(config['redis']));require(_0xa115('0x19'))[_0xa115('0x1a')](socket);function respondWithStatusCode(_0x5684f8,_0x12a904){_0x12a904=_0x12a904||0xcc;return function(_0xde80a4){if(_0xde80a4){return _0x5684f8['sendStatus'](_0x12a904);}return _0x5684f8[_0xa115('0x1b')](_0x12a904)[_0xa115('0x1c')]();};}function respondWithResult(_0x4a5103,_0xa2a0ab){_0xa2a0ab=_0xa2a0ab||0xc8;return function(_0x217e22){if(_0x217e22){return _0x4a5103[_0xa115('0x1b')](_0xa2a0ab)['json'](_0x217e22);}};}function respondWithFilteredResult(_0xe1eaab,_0x16d916){return function(_0x4ac3e6){if(_0x4ac3e6){var _0x50cf6c=typeof _0x16d916[_0xa115('0x1d')]==='undefined'&&typeof _0x16d916[_0xa115('0x1e')]===_0xa115('0x1f');var _0x5615f7=_0x4ac3e6[_0xa115('0x20')];var _0x1cf91d=_0x50cf6c?0x0:_0x16d916[_0xa115('0x1d')];var _0x142c96=_0x50cf6c?_0x4ac3e6[_0xa115('0x20')]:_0x16d916[_0xa115('0x1d')]+_0x16d916['limit'];var _0x37db78;if(_0x142c96>=_0x5615f7){_0x142c96=_0x5615f7;_0x37db78=0xc8;}else{_0x37db78=0xce;}_0xe1eaab['status'](_0x37db78);return _0xe1eaab[_0xa115('0x21')](_0xa115('0x22'),_0x1cf91d+'-'+_0x142c96+'/'+_0x5615f7)[_0xa115('0x23')](_0x4ac3e6);}return null;};}function patchUpdates(_0x4339fc){return function(_0x3adb5b){try{jsonpatch['apply'](_0x3adb5b,_0x4339fc,!![]);}catch(_0x54556c){return BPromise[_0xa115('0x24')](_0x54556c);}return _0x3adb5b[_0xa115('0x25')]();};}function saveUpdates(_0x40fe19,_0x4563a6){return function(_0x5d4c58){if(_0x5d4c58){return _0x5d4c58[_0xa115('0x26')](_0x40fe19)[_0xa115('0x27')](function(_0x34fdbb){return _0x34fdbb;});}return null;};}function removeEntity(_0x4edb43,_0x4b2557){return function(_0x4094d6){if(_0x4094d6){return _0x4094d6[_0xa115('0x28')]()[_0xa115('0x27')](function(){_0x4edb43[_0xa115('0x1b')](0xcc)[_0xa115('0x1c')]();});}};}function handleEntityNotFound(_0x90672f,_0x4787c3){return function(_0x5d66cd){if(!_0x5d66cd){_0x90672f['sendStatus'](0x194);}return _0x5d66cd;};}function handleError(_0x2fb5b4,_0x14fee6){_0x14fee6=_0x14fee6||0x1f4;return function(_0x117aac){logger[_0xa115('0x29')](_0x117aac[_0xa115('0x2a')]);if(_0x117aac[_0xa115('0x2b')]){delete _0x117aac['name'];}_0x2fb5b4[_0xa115('0x1b')](_0x14fee6)[_0xa115('0x2c')](_0x117aac);};}exports[_0xa115('0x2d')]=function(_0x4ca891,_0x39514e){var _0x3c400e={},_0x22d6ed={},_0x5089e8={'count':0x0,'rows':[]};var _0x3c46ad=_[_0xa115('0x2e')](db[_0xa115('0x2f')][_0xa115('0x30')],function(_0x16bc4a){return{'name':_0x16bc4a['fieldName'],'type':_0x16bc4a[_0xa115('0x31')][_0xa115('0x32')]};});_0x22d6ed[_0xa115('0x33')]=_['map'](_0x3c46ad,_0xa115('0x2b'));_0x22d6ed[_0xa115('0x34')]=_[_0xa115('0x35')](_0x4ca891[_0xa115('0x34')]);_0x22d6ed[_0xa115('0x36')]=_[_0xa115('0x37')](_0x22d6ed[_0xa115('0x33')],_0x22d6ed[_0xa115('0x34')]);_0x3c400e[_0xa115('0x38')]=_[_0xa115('0x37')](_0x22d6ed[_0xa115('0x33')],qs['fields'](_0x4ca891[_0xa115('0x34')][_0xa115('0x39')]));_0x3c400e[_0xa115('0x38')]=_0x3c400e[_0xa115('0x38')][_0xa115('0x3a')]?_0x3c400e[_0xa115('0x38')]:_0x22d6ed[_0xa115('0x33')];if(!_0x4ca891[_0xa115('0x34')]['hasOwnProperty']('nolimit')){_0x3c400e[_0xa115('0x1e')]=qs[_0xa115('0x1e')](_0x4ca891[_0xa115('0x34')][_0xa115('0x1e')]);_0x3c400e[_0xa115('0x1d')]=qs['offset'](_0x4ca891[_0xa115('0x34')][_0xa115('0x1d')]);}_0x3c400e[_0xa115('0x3b')]=qs[_0xa115('0x3c')](_0x4ca891['query']['sort']);_0x3c400e[_0xa115('0x3d')]=qs['filters'](_[_0xa115('0x3e')](_0x4ca891['query'],_0x22d6ed[_0xa115('0x36')]),_0x3c46ad);if(_0x4ca891[_0xa115('0x34')][_0xa115('0x3f')]){_0x3c400e['where']=_[_0xa115('0x40')](_0x3c400e[_0xa115('0x3d')],{'$or':_[_0xa115('0x2e')](_0x3c46ad,function(_0x5ffb8c){if(_0x5ffb8c['type']!==_0xa115('0x41')){var _0x883c59={};_0x883c59[_0x5ffb8c[_0xa115('0x2b')]]={'$like':'%'+_0x4ca891[_0xa115('0x34')]['filter']+'%'};return _0x883c59;}})});}_0x3c400e=_[_0xa115('0x40')]({},_0x3c400e,_0x4ca891[_0xa115('0x42')]);var _0x48459d={'where':_0x3c400e[_0xa115('0x3d')]};return db['ChatGroup'][_0xa115('0x20')](_0x48459d)[_0xa115('0x27')](function(_0xeec617){_0x5089e8[_0xa115('0x20')]=_0xeec617;if(_0x4ca891['query']['includeAll']){_0x3c400e[_0xa115('0x43')]=[{'all':!![]}];}return db[_0xa115('0x2f')][_0xa115('0x44')](_0x3c400e);})[_0xa115('0x27')](function(_0x11ccc5){_0x5089e8['rows']=_0x11ccc5;return _0x5089e8;})[_0xa115('0x27')](respondWithFilteredResult(_0x39514e,_0x3c400e))[_0xa115('0x45')](handleError(_0x39514e,null));};exports['show']=function(_0xa658ae,_0x43dcc1){var _0xfc2d93={'raw':!![],'where':{'id':_0xa658ae[_0xa115('0x46')]['id']}},_0x41de6f={};_0x41de6f[_0xa115('0x33')]=_[_0xa115('0x35')](db[_0xa115('0x2f')][_0xa115('0x30')]);_0x41de6f[_0xa115('0x34')]=_[_0xa115('0x35')](_0xa658ae[_0xa115('0x34')]);_0x41de6f[_0xa115('0x36')]=_[_0xa115('0x37')](_0x41de6f[_0xa115('0x33')],_0x41de6f['query']);_0xfc2d93[_0xa115('0x38')]=_['intersection'](_0x41de6f['model'],qs[_0xa115('0x39')](_0xa658ae[_0xa115('0x34')][_0xa115('0x39')]));_0xfc2d93['attributes']=_0xfc2d93[_0xa115('0x38')][_0xa115('0x3a')]?_0xfc2d93[_0xa115('0x38')]:_0x41de6f[_0xa115('0x33')];if(_0xa658ae[_0xa115('0x34')][_0xa115('0x47')]){_0xfc2d93[_0xa115('0x43')]=[{'all':!![]}];}_0xfc2d93=_[_0xa115('0x40')]({},_0xfc2d93,_0xa658ae[_0xa115('0x42')]);return db[_0xa115('0x2f')][_0xa115('0x48')](_0xfc2d93)[_0xa115('0x27')](handleEntityNotFound(_0x43dcc1,null))[_0xa115('0x27')](respondWithResult(_0x43dcc1,null))['catch'](handleError(_0x43dcc1,null));};exports['create']=function(_0x1b1720,_0x183437){return db['ChatGroup'][_0xa115('0x49')](_0x1b1720['body'],{})['then'](respondWithResult(_0x183437,0xc9))[_0xa115('0x45')](handleError(_0x183437,null));};exports['update']=function(_0x175fec,_0x4daa60){if(_0x175fec['body']['id']){delete _0x175fec[_0xa115('0x4a')]['id'];}return db[_0xa115('0x2f')]['find']({'where':{'id':_0x175fec[_0xa115('0x46')]['id']}})[_0xa115('0x27')](handleEntityNotFound(_0x4daa60,null))[_0xa115('0x27')](saveUpdates(_0x175fec[_0xa115('0x4a')],null))[_0xa115('0x27')](respondWithResult(_0x4daa60,null))[_0xa115('0x45')](handleError(_0x4daa60,null));};exports[_0xa115('0x28')]=function(_0x40cb07,_0x2aa04c){return db[_0xa115('0x2f')][_0xa115('0x48')]({'where':{'id':_0x40cb07[_0xa115('0x46')]['id']}})[_0xa115('0x27')](handleEntityNotFound(_0x2aa04c,null))['then'](removeEntity(_0x2aa04c,null))[_0xa115('0x45')](handleError(_0x2aa04c,null));};exports[_0xa115('0x4b')]=function(_0x3d5af5,_0x3c4848){return db['ChatGroup']['describe']()[_0xa115('0x27')](respondWithResult(_0x3c4848,null))[_0xa115('0x45')](handleError(_0x3c4848,null));};exports[_0xa115('0x4c')]=function(_0x3bcff2,_0x3c4ec1,_0x56cddc){return db[_0xa115('0x4d')][_0xa115('0x20')]({'where':{'ChatGroupId':_0x3bcff2[_0xa115('0x46')]['id'],'ToId':_0x3bcff2[_0xa115('0x4e')]['id'],'read':![]}})[_0xa115('0x27')](function(_0x1ebb13){return{'id':_[_0xa115('0x4f')](_0x3bcff2['params']['id']),'count':_0x1ebb13};})[_0xa115('0x27')](respondWithResult(_0x3c4ec1,null))[_0xa115('0x45')](handleError(_0x3c4ec1,null));};exports[_0xa115('0x50')]=function(_0x5f8647,_0x5e72bc,_0x5b8274){return db['ChatGroup'][_0xa115('0x48')]({'where':{'id':_0x5f8647['params']['id']}})[_0xa115('0x27')](handleEntityNotFound(_0x5e72bc,null))[_0xa115('0x27')](function(_0x4ba969){if(_0x4ba969){return _0x4ba969[_0xa115('0x50')](_0x5f8647['body']['ids'],_[_0xa115('0x51')](_0x5f8647[_0xa115('0x4a')],[_0xa115('0x52'),'id'])||{});}})[_0xa115('0x27')](respondWithResult(_0x5e72bc,null))[_0xa115('0x45')](handleError(_0x5e72bc,null));};exports[_0xa115('0x53')]=function(_0x2a8548,_0x79c2c6,_0x4678cf){var _0x2dde50={};var _0x19ea4e={};var _0x154e02;var _0x219574;return db[_0xa115('0x2f')][_0xa115('0x54')]({'where':{'id':_0x2a8548['params']['id']}})[_0xa115('0x27')](handleEntityNotFound(_0x79c2c6,null))[_0xa115('0x27')](function(_0x51a2d5){if(_0x51a2d5){_0x154e02=_0x51a2d5;_0x19ea4e['model']=_[_0xa115('0x35')](db[_0xa115('0x55')][_0xa115('0x30')]);_0x19ea4e['query']=_['keys'](_0x2a8548['query']);_0x19ea4e[_0xa115('0x36')]=_[_0xa115('0x37')](_0x19ea4e['model'],_0x19ea4e[_0xa115('0x34')]);_0x2dde50[_0xa115('0x38')]=_[_0xa115('0x37')](_0x19ea4e[_0xa115('0x33')],qs[_0xa115('0x39')](_0x2a8548['query'][_0xa115('0x39')]));_0x2dde50[_0xa115('0x38')]=_0x2dde50['attributes']['length']?_0x2dde50[_0xa115('0x38')]:_0x19ea4e[_0xa115('0x33')];_0x2dde50[_0xa115('0x3b')]=qs[_0xa115('0x3c')](_0x2a8548[_0xa115('0x34')]['sort']);_0x2dde50[_0xa115('0x3d')]=qs[_0xa115('0x36')](_[_0xa115('0x3e')](_0x2a8548['query'],_0x19ea4e['filters']));if(_0x2a8548[_0xa115('0x34')][_0xa115('0x3f')]){_0x2dde50[_0xa115('0x3d')]=_['merge'](_0x2dde50[_0xa115('0x3d')],{'$or':_[_0xa115('0x2e')](_0x2dde50[_0xa115('0x38')],function(_0x185a49){var _0x2f4bf8={};_0x2f4bf8[_0x185a49]={'$like':'%'+_0x2a8548[_0xa115('0x34')][_0xa115('0x3f')]+'%'};return _0x2f4bf8;})});}_0x2dde50=_[_0xa115('0x40')]({},_0x2dde50,_0x2a8548[_0xa115('0x42')]);return _0x154e02[_0xa115('0x53')](_0x2dde50);}})['then'](function(_0x2786b1){if(_0x2786b1){_0x219574=_0x2786b1[_0xa115('0x3a')];if(!_0x2a8548[_0xa115('0x34')]['hasOwnProperty'](_0xa115('0x56'))){_0x2dde50[_0xa115('0x1e')]=qs[_0xa115('0x1e')](_0x2a8548[_0xa115('0x34')][_0xa115('0x1e')]);_0x2dde50[_0xa115('0x1d')]=qs['offset'](_0x2a8548[_0xa115('0x34')]['offset']);}return _0x154e02[_0xa115('0x53')](_0x2dde50);}})['then'](function(_0x3541c1){if(_0x3541c1){return _0x3541c1?{'count':_0x219574,'rows':_0x3541c1}:null;}})[_0xa115('0x27')](respondWithResult(_0x79c2c6,null))['catch'](handleError(_0x79c2c6,null));};exports['removeMembers']=function(_0x1c41f1,_0x598b42,_0x4e213e){return db['ChatGroup'][_0xa115('0x48')]({'where':{'id':_0x1c41f1[_0xa115('0x46')]['id']}})['then'](handleEntityNotFound(_0x598b42,null))[_0xa115('0x27')](function(_0x8bd00e){if(_0x8bd00e){return _0x8bd00e[_0xa115('0x57')](_0x1c41f1[_0xa115('0x34')][_0xa115('0x52')]);}})[_0xa115('0x27')](respondWithStatusCode(_0x598b42,null))[_0xa115('0x45')](handleError(_0x598b42,null));};exports[_0xa115('0x58')]=function(_0x336f46,_0x37474f,_0x229a0c){if(_0x336f46[_0xa115('0x4a')]['id']){delete _0x336f46[_0xa115('0x4a')]['id'];}return db['ChatGroup'][_0xa115('0x48')]({'where':{'id':_0x336f46['params']['id']}})[_0xa115('0x27')](handleEntityNotFound(_0x37474f,null))[_0xa115('0x27')](function(_0x306dd3){if(_0x306dd3){_0x336f46[_0xa115('0x4a')][_0xa115('0x59')]=_0x306dd3['id'];return db[_0xa115('0x4d')]['create'](_0x336f46[_0xa115('0x4a')]);}})[_0xa115('0x27')](respondWithResult(_0x37474f,null))['catch'](handleError(_0x37474f,null));};exports[_0xa115('0x5a')]=function(_0x2091a8,_0x1c17f7,_0x3c7c78){var _0x522cc5={};var _0x221a1e={};var _0x36f0a8;var _0x9b7c7e;return db[_0xa115('0x2f')][_0xa115('0x54')]({'where':{'id':_0x2091a8[_0xa115('0x46')]['id']}})[_0xa115('0x27')](handleEntityNotFound(_0x1c17f7,null))['then'](function(_0xfce804){if(_0xfce804){_0x36f0a8=_0xfce804;_0x221a1e['model']=_[_0xa115('0x35')](db[_0xa115('0x4d')][_0xa115('0x30')]);_0x221a1e[_0xa115('0x34')]=_['keys'](_0x2091a8[_0xa115('0x34')]);_0x221a1e[_0xa115('0x36')]=_['intersection'](_0x221a1e['model'],_0x221a1e[_0xa115('0x34')]);_0x522cc5[_0xa115('0x38')]=_[_0xa115('0x37')](_0x221a1e[_0xa115('0x33')],qs[_0xa115('0x39')](_0x2091a8['query'][_0xa115('0x39')]));_0x522cc5[_0xa115('0x38')]=_0x522cc5[_0xa115('0x38')][_0xa115('0x3a')]?_0x522cc5['attributes']:_0x221a1e[_0xa115('0x33')];_0x522cc5['order']=qs[_0xa115('0x3c')](_0x2091a8[_0xa115('0x34')][_0xa115('0x3c')]);_0x522cc5[_0xa115('0x3d')]=qs['filters'](_[_0xa115('0x3e')](_0x2091a8['query'],_0x221a1e[_0xa115('0x36')]));if(_0x2091a8[_0xa115('0x34')][_0xa115('0x3f')]){_0x522cc5[_0xa115('0x3d')]=_['merge'](_0x522cc5['where'],{'$or':_['map'](_0x522cc5['attributes'],function(_0x20586c){var _0x533bc5={};_0x533bc5[_0x20586c]={'$like':'%'+_0x2091a8[_0xa115('0x34')]['filter']+'%'};return _0x533bc5;})});}if(_0x2091a8[_0xa115('0x34')]['$gte']){var _0x2c9e80=_0x2091a8['query'][_0xa115('0x5b')]['split'](',');var _0x3019e6={};_0x3019e6[_0x2c9e80[0x0]]={'$gte':moment(_0x2c9e80[0x1])['format'](_0xa115('0x5c'))};_0x522cc5[_0xa115('0x3d')]=_[_0xa115('0x40')](_0x522cc5[_0xa115('0x3d')],_0x3019e6);}_0x522cc5=_[_0xa115('0x40')]({},_0x522cc5,_0x2091a8[_0xa115('0x42')]);return _0x36f0a8[_0xa115('0x5a')](_0x522cc5);}})[_0xa115('0x27')](function(_0x750132){if(_0x750132){_0x9b7c7e=_0x750132[_0xa115('0x3a')];if(!_0x2091a8[_0xa115('0x34')][_0xa115('0x5d')]('nolimit')){_0x522cc5[_0xa115('0x1e')]=qs[_0xa115('0x1e')](_0x2091a8[_0xa115('0x34')][_0xa115('0x1e')]);_0x522cc5['offset']=qs[_0xa115('0x1d')](_0x2091a8[_0xa115('0x34')]['offset']);}return _0x36f0a8[_0xa115('0x5a')](_0x522cc5);}})['then'](function(_0x449ebd){if(_0x449ebd){return _0x449ebd?{'count':_0x9b7c7e,'rows':_0x449ebd}:null;}})[_0xa115('0x27')](respondWithResult(_0x1c17f7,null))[_0xa115('0x45')](handleError(_0x1c17f7,null));};
\ No newline at end of file
+var _0x6a4e=['save','destroy','then','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','options','includeAll','include','catch','show','params','rawAttributes','merge','find','create','body','update','describe','ChatInternalMessage','user','toInteger','addMembers','omit','ids','findOne','User','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','split','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','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','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject'];(function(_0xd0d704,_0x17b971){var _0x2161a8=function(_0x42fd9b){while(--_0x42fd9b){_0xd0d704['push'](_0xd0d704['shift']());}};_0x2161a8(++_0x17b971);}(_0x6a4e,0x9a));var _0xe6a4=function(_0x168a13,_0x509ea8){_0x168a13=_0x168a13-0x0;var _0x590f06=_0x6a4e[_0x168a13];return _0x590f06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6a4('0x0'));var zipdir=require(_0xe6a4('0x1'));var jsonpatch=require(_0xe6a4('0x2'));var rp=require(_0xe6a4('0x3'));var moment=require(_0xe6a4('0x4'));var BPromise=require(_0xe6a4('0x5'));var Mustache=require(_0xe6a4('0x6'));var util=require('util');var path=require(_0xe6a4('0x7'));var sox=require(_0xe6a4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6a4('0x9'));var _=require(_0xe6a4('0xa'));var squel=require(_0xe6a4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe6a4('0xc'));var toCsv=require(_0xe6a4('0xd'));var querystring=require(_0xe6a4('0xe'));var Papa=require(_0xe6a4('0xf'));var Redis=require(_0xe6a4('0x10'));var authService=require(_0xe6a4('0x11'));var qs=require(_0xe6a4('0x12'));var as=require(_0xe6a4('0x13'));var hardwareService=require(_0xe6a4('0x14'));var logger=require('../../config/logger')(_0xe6a4('0x15'));var utils=require(_0xe6a4('0x16'));var config=require(_0xe6a4('0x17'));var licenseUtil=require(_0xe6a4('0x18'));var db=require(_0xe6a4('0x19'))['db'];config[_0xe6a4('0x1a')]=_[_0xe6a4('0x1b')](config[_0xe6a4('0x1a')],{'host':_0xe6a4('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6a4('0x1a')]));require(_0xe6a4('0x1d'))[_0xe6a4('0x1e')](socket);function respondWithStatusCode(_0x152950,_0x5d5692){_0x5d5692=_0x5d5692||0xcc;return function(_0x4c3369){if(_0x4c3369){return _0x152950[_0xe6a4('0x1f')](_0x5d5692);}return _0x152950[_0xe6a4('0x20')](_0x5d5692)[_0xe6a4('0x21')]();};}function respondWithResult(_0xff0ae3,_0x2aacef){_0x2aacef=_0x2aacef||0xc8;return function(_0x421220){if(_0x421220){return _0xff0ae3['status'](_0x2aacef)[_0xe6a4('0x22')](_0x421220);}};}function respondWithFilteredResult(_0x4deb7d,_0x1446ca){return function(_0x4a1233){if(_0x4a1233){var _0x109b8f=typeof _0x1446ca[_0xe6a4('0x23')]===_0xe6a4('0x24')&&typeof _0x1446ca['limit']===_0xe6a4('0x24');var _0xb3ee22=_0x4a1233[_0xe6a4('0x25')];var _0xdae3be=_0x109b8f?0x0:_0x1446ca['offset'];var _0x52341a=_0x109b8f?_0x4a1233[_0xe6a4('0x25')]:_0x1446ca[_0xe6a4('0x23')]+_0x1446ca[_0xe6a4('0x26')];var _0x23b652;if(_0x52341a>=_0xb3ee22){_0x52341a=_0xb3ee22;_0x23b652=0xc8;}else{_0x23b652=0xce;}_0x4deb7d[_0xe6a4('0x20')](_0x23b652);return _0x4deb7d[_0xe6a4('0x27')](_0xe6a4('0x28'),_0xdae3be+'-'+_0x52341a+'/'+_0xb3ee22)[_0xe6a4('0x22')](_0x4a1233);}return null;};}function patchUpdates(_0x394f37){return function(_0xf9d7c9){try{jsonpatch['apply'](_0xf9d7c9,_0x394f37,!![]);}catch(_0x2cb7df){return BPromise[_0xe6a4('0x29')](_0x2cb7df);}return _0xf9d7c9[_0xe6a4('0x2a')]();};}function saveUpdates(_0x223160,_0x313a0d){return function(_0x2bdccb){if(_0x2bdccb){return _0x2bdccb['update'](_0x223160)['then'](function(_0x2fe1b1){return _0x2fe1b1;});}return null;};}function removeEntity(_0x76f0c1,_0x1c1954){return function(_0x561dd1){if(_0x561dd1){return _0x561dd1[_0xe6a4('0x2b')]()[_0xe6a4('0x2c')](function(){_0x76f0c1[_0xe6a4('0x20')](0xcc)[_0xe6a4('0x21')]();});}};}function handleEntityNotFound(_0x1ca5b9,_0x56c71b){return function(_0x349ff9){if(!_0x349ff9){_0x1ca5b9['sendStatus'](0x194);}return _0x349ff9;};}function handleError(_0x443a3b,_0xb222d1){_0xb222d1=_0xb222d1||0x1f4;return function(_0x2607d8){logger['error'](_0x2607d8[_0xe6a4('0x2d')]);if(_0x2607d8[_0xe6a4('0x2e')]){delete _0x2607d8[_0xe6a4('0x2e')];}_0x443a3b[_0xe6a4('0x20')](_0xb222d1)[_0xe6a4('0x2f')](_0x2607d8);};}exports[_0xe6a4('0x30')]=function(_0x1faf35,_0x413235){var _0x51c94d={},_0x5a3275={},_0x5862d8={'count':0x0,'rows':[]};var _0x233660=_[_0xe6a4('0x31')](db[_0xe6a4('0x32')]['rawAttributes'],function(_0x242d5c){return{'name':_0x242d5c[_0xe6a4('0x33')],'type':_0x242d5c[_0xe6a4('0x34')][_0xe6a4('0x35')]};});_0x5a3275[_0xe6a4('0x36')]=_[_0xe6a4('0x31')](_0x233660,'name');_0x5a3275['query']=_[_0xe6a4('0x37')](_0x1faf35[_0xe6a4('0x38')]);_0x5a3275[_0xe6a4('0x39')]=_[_0xe6a4('0x3a')](_0x5a3275['model'],_0x5a3275[_0xe6a4('0x38')]);_0x51c94d[_0xe6a4('0x3b')]=_[_0xe6a4('0x3a')](_0x5a3275[_0xe6a4('0x36')],qs['fields'](_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x3c')]));_0x51c94d[_0xe6a4('0x3b')]=_0x51c94d[_0xe6a4('0x3b')][_0xe6a4('0x3d')]?_0x51c94d[_0xe6a4('0x3b')]:_0x5a3275[_0xe6a4('0x36')];if(!_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x3e')]('nolimit')){_0x51c94d['limit']=qs[_0xe6a4('0x26')](_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x26')]);_0x51c94d[_0xe6a4('0x23')]=qs[_0xe6a4('0x23')](_0x1faf35[_0xe6a4('0x38')]['offset']);}_0x51c94d[_0xe6a4('0x3f')]=qs[_0xe6a4('0x40')](_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x40')]);_0x51c94d['where']=qs['filters'](_['pick'](_0x1faf35[_0xe6a4('0x38')],_0x5a3275[_0xe6a4('0x39')]),_0x233660);if(_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x41')]){_0x51c94d[_0xe6a4('0x42')]=_['merge'](_0x51c94d[_0xe6a4('0x42')],{'$or':_[_0xe6a4('0x31')](_0x233660,function(_0x131f13){if(_0x131f13[_0xe6a4('0x34')]!=='VIRTUAL'){var _0x11f7ec={};_0x11f7ec[_0x131f13[_0xe6a4('0x2e')]]={'$like':'%'+_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x41')]+'%'};return _0x11f7ec;}})});}_0x51c94d=_['merge']({},_0x51c94d,_0x1faf35[_0xe6a4('0x43')]);var _0xacbf93={'where':_0x51c94d[_0xe6a4('0x42')]};return db[_0xe6a4('0x32')][_0xe6a4('0x25')](_0xacbf93)[_0xe6a4('0x2c')](function(_0x1138a8){_0x5862d8['count']=_0x1138a8;if(_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x44')]){_0x51c94d[_0xe6a4('0x45')]=[{'all':!![]}];}return db[_0xe6a4('0x32')]['findAll'](_0x51c94d);})['then'](function(_0x5ab920){_0x5862d8['rows']=_0x5ab920;return _0x5862d8;})[_0xe6a4('0x2c')](respondWithFilteredResult(_0x413235,_0x51c94d))[_0xe6a4('0x46')](handleError(_0x413235,null));};exports[_0xe6a4('0x47')]=function(_0x242846,_0x46426d){var _0x2ca174={'raw':!![],'where':{'id':_0x242846[_0xe6a4('0x48')]['id']}},_0x1bcff4={};_0x1bcff4[_0xe6a4('0x36')]=_[_0xe6a4('0x37')](db['ChatGroup'][_0xe6a4('0x49')]);_0x1bcff4[_0xe6a4('0x38')]=_['keys'](_0x242846[_0xe6a4('0x38')]);_0x1bcff4[_0xe6a4('0x39')]=_[_0xe6a4('0x3a')](_0x1bcff4[_0xe6a4('0x36')],_0x1bcff4['query']);_0x2ca174[_0xe6a4('0x3b')]=_[_0xe6a4('0x3a')](_0x1bcff4['model'],qs['fields'](_0x242846['query']['fields']));_0x2ca174[_0xe6a4('0x3b')]=_0x2ca174['attributes']['length']?_0x2ca174[_0xe6a4('0x3b')]:_0x1bcff4[_0xe6a4('0x36')];if(_0x242846[_0xe6a4('0x38')][_0xe6a4('0x44')]){_0x2ca174['include']=[{'all':!![]}];}_0x2ca174=_[_0xe6a4('0x4a')]({},_0x2ca174,_0x242846['options']);return db['ChatGroup'][_0xe6a4('0x4b')](_0x2ca174)[_0xe6a4('0x2c')](handleEntityNotFound(_0x46426d,null))[_0xe6a4('0x2c')](respondWithResult(_0x46426d,null))[_0xe6a4('0x46')](handleError(_0x46426d,null));};exports[_0xe6a4('0x4c')]=function(_0x474b2c,_0x2e7ab5){return db[_0xe6a4('0x32')][_0xe6a4('0x4c')](_0x474b2c[_0xe6a4('0x4d')],{})[_0xe6a4('0x2c')](respondWithResult(_0x2e7ab5,0xc9))[_0xe6a4('0x46')](handleError(_0x2e7ab5,null));};exports[_0xe6a4('0x4e')]=function(_0x7d8067,_0x1b56a8){if(_0x7d8067[_0xe6a4('0x4d')]['id']){delete _0x7d8067['body']['id'];}return db[_0xe6a4('0x32')][_0xe6a4('0x4b')]({'where':{'id':_0x7d8067[_0xe6a4('0x48')]['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0x1b56a8,null))['then'](saveUpdates(_0x7d8067[_0xe6a4('0x4d')],null))[_0xe6a4('0x2c')](respondWithResult(_0x1b56a8,null))[_0xe6a4('0x46')](handleError(_0x1b56a8,null));};exports[_0xe6a4('0x2b')]=function(_0x305c03,_0xec7f70){return db['ChatGroup'][_0xe6a4('0x4b')]({'where':{'id':_0x305c03[_0xe6a4('0x48')]['id']}})['then'](handleEntityNotFound(_0xec7f70,null))['then'](removeEntity(_0xec7f70,null))[_0xe6a4('0x46')](handleError(_0xec7f70,null));};exports[_0xe6a4('0x4f')]=function(_0x330e64,_0x57fc11){return db['ChatGroup'][_0xe6a4('0x4f')]()[_0xe6a4('0x2c')](respondWithResult(_0x57fc11,null))[_0xe6a4('0x46')](handleError(_0x57fc11,null));};exports['getUnread']=function(_0x5eddb1,_0x182a09,_0x488e89){return db[_0xe6a4('0x50')][_0xe6a4('0x25')]({'where':{'ChatGroupId':_0x5eddb1[_0xe6a4('0x48')]['id'],'ToId':_0x5eddb1[_0xe6a4('0x51')]['id'],'read':![]}})[_0xe6a4('0x2c')](function(_0xf3f516){return{'id':_[_0xe6a4('0x52')](_0x5eddb1['params']['id']),'count':_0xf3f516};})[_0xe6a4('0x2c')](respondWithResult(_0x182a09,null))[_0xe6a4('0x46')](handleError(_0x182a09,null));};exports[_0xe6a4('0x53')]=function(_0x5dcba5,_0xdce09a,_0x3765c6){return db[_0xe6a4('0x32')][_0xe6a4('0x4b')]({'where':{'id':_0x5dcba5['params']['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0xdce09a,null))[_0xe6a4('0x2c')](function(_0x425763){if(_0x425763){return _0x425763[_0xe6a4('0x53')](_0x5dcba5['body']['ids'],_[_0xe6a4('0x54')](_0x5dcba5[_0xe6a4('0x4d')],[_0xe6a4('0x55'),'id'])||{});}})['then'](respondWithResult(_0xdce09a,null))[_0xe6a4('0x46')](handleError(_0xdce09a,null));};exports['getMembers']=function(_0x5885ce,_0x1c55a0,_0x6b1b47){var _0x403ea0={};var _0xf56a0c={};var _0x1ebc6a;var _0x237663;return db[_0xe6a4('0x32')][_0xe6a4('0x56')]({'where':{'id':_0x5885ce[_0xe6a4('0x48')]['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0x1c55a0,null))[_0xe6a4('0x2c')](function(_0x2eaf69){if(_0x2eaf69){_0x1ebc6a=_0x2eaf69;_0xf56a0c['model']=_['keys'](db[_0xe6a4('0x57')][_0xe6a4('0x49')]);_0xf56a0c['query']=_[_0xe6a4('0x37')](_0x5885ce['query']);_0xf56a0c[_0xe6a4('0x39')]=_[_0xe6a4('0x3a')](_0xf56a0c[_0xe6a4('0x36')],_0xf56a0c['query']);_0x403ea0[_0xe6a4('0x3b')]=_[_0xe6a4('0x3a')](_0xf56a0c[_0xe6a4('0x36')],qs[_0xe6a4('0x3c')](_0x5885ce['query'][_0xe6a4('0x3c')]));_0x403ea0['attributes']=_0x403ea0['attributes']['length']?_0x403ea0['attributes']:_0xf56a0c['model'];_0x403ea0[_0xe6a4('0x3f')]=qs[_0xe6a4('0x40')](_0x5885ce[_0xe6a4('0x38')]['sort']);_0x403ea0[_0xe6a4('0x42')]=qs[_0xe6a4('0x39')](_['pick'](_0x5885ce[_0xe6a4('0x38')],_0xf56a0c[_0xe6a4('0x39')]));if(_0x5885ce[_0xe6a4('0x38')]['filter']){_0x403ea0[_0xe6a4('0x42')]=_[_0xe6a4('0x4a')](_0x403ea0[_0xe6a4('0x42')],{'$or':_[_0xe6a4('0x31')](_0x403ea0['attributes'],function(_0x4105a0){var _0x10aa7d={};_0x10aa7d[_0x4105a0]={'$like':'%'+_0x5885ce[_0xe6a4('0x38')][_0xe6a4('0x41')]+'%'};return _0x10aa7d;})});}_0x403ea0=_[_0xe6a4('0x4a')]({},_0x403ea0,_0x5885ce[_0xe6a4('0x43')]);return _0x1ebc6a[_0xe6a4('0x58')](_0x403ea0);}})['then'](function(_0x2acc94){if(_0x2acc94){_0x237663=_0x2acc94[_0xe6a4('0x3d')];if(!_0x5885ce[_0xe6a4('0x38')][_0xe6a4('0x3e')](_0xe6a4('0x59'))){_0x403ea0[_0xe6a4('0x26')]=qs[_0xe6a4('0x26')](_0x5885ce['query'][_0xe6a4('0x26')]);_0x403ea0[_0xe6a4('0x23')]=qs['offset'](_0x5885ce['query'][_0xe6a4('0x23')]);}return _0x1ebc6a[_0xe6a4('0x58')](_0x403ea0);}})[_0xe6a4('0x2c')](function(_0x1e7984){if(_0x1e7984){return _0x1e7984?{'count':_0x237663,'rows':_0x1e7984}:null;}})[_0xe6a4('0x2c')](respondWithResult(_0x1c55a0,null))['catch'](handleError(_0x1c55a0,null));};exports[_0xe6a4('0x5a')]=function(_0x507708,_0x1ae0f7,_0x24c832){return db['ChatGroup'][_0xe6a4('0x4b')]({'where':{'id':_0x507708['params']['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0x1ae0f7,null))[_0xe6a4('0x2c')](function(_0xc00984){if(_0xc00984){return _0xc00984[_0xe6a4('0x5a')](_0x507708[_0xe6a4('0x38')][_0xe6a4('0x55')]);}})[_0xe6a4('0x2c')](respondWithStatusCode(_0x1ae0f7,null))[_0xe6a4('0x46')](handleError(_0x1ae0f7,null));};exports[_0xe6a4('0x5b')]=function(_0x347d3b,_0x4912ba,_0x8dabb8){if(_0x347d3b[_0xe6a4('0x4d')]['id']){delete _0x347d3b[_0xe6a4('0x4d')]['id'];}return db['ChatGroup'][_0xe6a4('0x4b')]({'where':{'id':_0x347d3b[_0xe6a4('0x48')]['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0x4912ba,null))[_0xe6a4('0x2c')](function(_0x12a923){if(_0x12a923){_0x347d3b[_0xe6a4('0x4d')][_0xe6a4('0x5c')]=_0x12a923['id'];return db[_0xe6a4('0x50')][_0xe6a4('0x4c')](_0x347d3b[_0xe6a4('0x4d')]);}})[_0xe6a4('0x2c')](respondWithResult(_0x4912ba,null))['catch'](handleError(_0x4912ba,null));};exports[_0xe6a4('0x5d')]=function(_0x1b8a4e,_0x27db05,_0x538aa5){var _0x5b32e9={};var _0x4cd347={};var _0x32d1f6;var _0x26bd70;return db[_0xe6a4('0x32')]['findOne']({'where':{'id':_0x1b8a4e['params']['id']}})['then'](handleEntityNotFound(_0x27db05,null))['then'](function(_0x2798a9){if(_0x2798a9){_0x32d1f6=_0x2798a9;_0x4cd347[_0xe6a4('0x36')]=_[_0xe6a4('0x37')](db[_0xe6a4('0x50')]['rawAttributes']);_0x4cd347['query']=_[_0xe6a4('0x37')](_0x1b8a4e[_0xe6a4('0x38')]);_0x4cd347[_0xe6a4('0x39')]=_[_0xe6a4('0x3a')](_0x4cd347[_0xe6a4('0x36')],_0x4cd347[_0xe6a4('0x38')]);_0x5b32e9[_0xe6a4('0x3b')]=_[_0xe6a4('0x3a')](_0x4cd347[_0xe6a4('0x36')],qs[_0xe6a4('0x3c')](_0x1b8a4e['query'][_0xe6a4('0x3c')]));_0x5b32e9[_0xe6a4('0x3b')]=_0x5b32e9[_0xe6a4('0x3b')]['length']?_0x5b32e9[_0xe6a4('0x3b')]:_0x4cd347[_0xe6a4('0x36')];_0x5b32e9['order']=qs[_0xe6a4('0x40')](_0x1b8a4e[_0xe6a4('0x38')]['sort']);_0x5b32e9[_0xe6a4('0x42')]=qs[_0xe6a4('0x39')](_[_0xe6a4('0x5e')](_0x1b8a4e[_0xe6a4('0x38')],_0x4cd347[_0xe6a4('0x39')]));if(_0x1b8a4e['query'][_0xe6a4('0x41')]){_0x5b32e9['where']=_['merge'](_0x5b32e9[_0xe6a4('0x42')],{'$or':_[_0xe6a4('0x31')](_0x5b32e9[_0xe6a4('0x3b')],function(_0x44df43){var _0x3e2a10={};_0x3e2a10[_0x44df43]={'$like':'%'+_0x1b8a4e['query'][_0xe6a4('0x41')]+'%'};return _0x3e2a10;})});}if(_0x1b8a4e[_0xe6a4('0x38')][_0xe6a4('0x5f')]){var _0xd0dc74=_0x1b8a4e[_0xe6a4('0x38')][_0xe6a4('0x5f')][_0xe6a4('0x60')](',');var _0x5a1cab={};_0x5a1cab[_0xd0dc74[0x0]]={'$gte':moment(_0xd0dc74[0x1])[_0xe6a4('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b32e9['where']=_[_0xe6a4('0x4a')](_0x5b32e9[_0xe6a4('0x42')],_0x5a1cab);}_0x5b32e9=_[_0xe6a4('0x4a')]({},_0x5b32e9,_0x1b8a4e['options']);return _0x32d1f6[_0xe6a4('0x5d')](_0x5b32e9);}})['then'](function(_0x3f09f1){if(_0x3f09f1){_0x26bd70=_0x3f09f1[_0xe6a4('0x3d')];if(!_0x1b8a4e[_0xe6a4('0x38')]['hasOwnProperty'](_0xe6a4('0x59'))){_0x5b32e9[_0xe6a4('0x26')]=qs[_0xe6a4('0x26')](_0x1b8a4e[_0xe6a4('0x38')][_0xe6a4('0x26')]);_0x5b32e9['offset']=qs[_0xe6a4('0x23')](_0x1b8a4e['query'][_0xe6a4('0x23')]);}return _0x32d1f6[_0xe6a4('0x5d')](_0x5b32e9);}})[_0xe6a4('0x2c')](function(_0x18d151){if(_0x18d151){return _0x18d151?{'count':_0x26bd70,'rows':_0x18d151}:null;}})[_0xe6a4('0x2c')](respondWithResult(_0x27db05,null))[_0xe6a4('0x46')](handleError(_0x27db05,null));};
\ No newline at end of file
index 48b226f..f776a4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeca=['emit','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xbeca,0xdf));var _0xabec=function(_0x157e1d,_0x2ac5d2){_0x157e1d=_0x157e1d-0x0;var _0x493d29=_0xbeca[_0x157e1d];return _0x493d29;};'use strict';var EventEmitter=require(_0xabec('0x0'));var ChatGroup=require(_0xabec('0x1'))['db'][_0xabec('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xabec('0x3')](0x0);var events={'afterCreate':_0xabec('0x4'),'afterUpdate':_0xabec('0x5'),'afterDestroy':_0xabec('0x6')};function emitEvent(_0x341b14){return function(_0x2b0fea,_0x3ed5e9,_0x3ba894){ChatGroupEvents[_0xabec('0x7')](_0x341b14+':'+_0x2b0fea['id'],_0x2b0fea);ChatGroupEvents['emit'](_0x341b14,_0x2b0fea);_0x3ba894(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xabec('0x8')](e,emitEvent(event));}}module[_0xabec('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x6c64=['ChatGroup','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x31778e,_0x4a03bb){var _0x470dcb=function(_0x38dbbf){while(--_0x38dbbf){_0x31778e['push'](_0x31778e['shift']());}};_0x470dcb(++_0x4a03bb);}(_0x6c64,0xdf));var _0x46c6=function(_0x538268,_0x55c0e1){_0x538268=_0x538268-0x0;var _0x1645c3=_0x6c64[_0x538268];return _0x1645c3;};'use strict';var EventEmitter=require(_0x46c6('0x0'));var ChatGroup=require(_0x46c6('0x1'))['db'][_0x46c6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x46c6('0x3'),'afterDestroy':_0x46c6('0x4')};function emitEvent(_0x2a797c){return function(_0x5eb94c,_0x3e0a71,_0xf1b108){ChatGroupEvents[_0x46c6('0x5')](_0x2a797c+':'+_0x5eb94c['id'],_0x5eb94c);ChatGroupEvents[_0x46c6('0x5')](_0x2a797c,_0x5eb94c);_0xf1b108(null);};}for(var e in events){if(events[_0x46c6('0x6')](e)){var event=events[e];ChatGroup[_0x46c6('0x7')](e,emitEvent(event));}}module[_0x46c6('0x8')]=ChatGroupEvents;
\ No newline at end of file
index f558019..a94be68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ea5=['../../config/environment','exports','define','ChatGroup','chat_groups','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x54d9bb,_0x526b01){var _0x4e678b=function(_0x5534ea){while(--_0x5534ea){_0x54d9bb['push'](_0x54d9bb['shift']());}};_0x4e678b(++_0x526b01);}(_0x8ea5,0x165));var _0x58ea=function(_0x1feca7,_0x5a0f7a){_0x1feca7=_0x1feca7-0x0;var _0x5e560f=_0x8ea5[_0x1feca7];return _0x5e560f;};'use strict';var _=require('lodash');var util=require(_0x58ea('0x0'));var logger=require(_0x58ea('0x1'))('api');var moment=require(_0x58ea('0x2'));var BPromise=require(_0x58ea('0x3'));var rp=require(_0x58ea('0x4'));var fs=require('fs');var path=require(_0x58ea('0x5'));var rimraf=require('rimraf');var config=require(_0x58ea('0x6'));var attributes=require('./chatGroup.attributes');module[_0x58ea('0x7')]=function(_0x143c87,_0x5a8989){return _0x143c87[_0x58ea('0x8')](_0x58ea('0x9'),attributes,{'tableName':_0x58ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed04=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','chat_groups','lodash'];(function(_0x36988b,_0x211f65){var _0x4946cc=function(_0x5218a5){while(--_0x5218a5){_0x36988b['push'](_0x36988b['shift']());}};_0x4946cc(++_0x211f65);}(_0xed04,0x99));var _0x4ed0=function(_0x4e7962,_0x1de67b){_0x4e7962=_0x4e7962-0x0;var _0x1d30b9=_0xed04[_0x4e7962];return _0x1d30b9;};'use strict';var _=require(_0x4ed0('0x0'));var util=require(_0x4ed0('0x1'));var logger=require('../../config/logger')(_0x4ed0('0x2'));var moment=require(_0x4ed0('0x3'));var BPromise=require(_0x4ed0('0x4'));var rp=require(_0x4ed0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ed0('0x6'));var config=require(_0x4ed0('0x7'));var attributes=require(_0x4ed0('0x8'));module[_0x4ed0('0x9')]=function(_0x292d7c,_0x169af1){return _0x292d7c['define']('ChatGroup',attributes,{'tableName':_0x4ed0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 400d0d2..9e08f8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdab2=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x91db9,_0x5b4ac6){var _0xb1fb2a=function(_0x3fa648){while(--_0x3fa648){_0x91db9['push'](_0x91db9['shift']());}};_0xb1fb2a(++_0x5b4ac6);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var moment=require('moment');var BPromise=require(_0x2dab('0x2'));var rs=require(_0x2dab('0x3'));var fs=require('fs');var Redis=require(_0x2dab('0x4'));var db=require(_0x2dab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dab('0x6'))(_0x2dab('0x7'));var config=require(_0x2dab('0x8'));var jayson=require(_0x2dab('0x9'));var client=jayson[_0x2dab('0xa')][_0x2dab('0xb')]({'port':0x232a});config[_0x2dab('0xc')]=_[_0x2dab('0xd')](config[_0x2dab('0xc')],{'host':_0x2dab('0xe'),'port':0x18eb});var socket=require(_0x2dab('0xf'))(new Redis(config[_0x2dab('0xc')]));require(_0x2dab('0x10'))['register'](socket);function respondWithRpcPromise(_0x596950,_0x26852f,_0x18db7b){return new BPromise(function(_0x1e258e,_0x4bc28b){return client['request'](_0x596950,_0x18db7b)[_0x2dab('0x11')](function(_0x3e7252){logger[_0x2dab('0x12')](_0x2dab('0x13'),_0x26852f,_0x2dab('0x14'));logger['debug'](_0x2dab('0x15'),_0x26852f,_0x2dab('0x14'),JSON['stringify'](_0x3e7252));if(_0x3e7252[_0x2dab('0x16')]){if(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x17')]===0x1f4){logger['error'](_0x2dab('0x13'),_0x26852f,_0x3e7252[_0x2dab('0x16')]['message']);return _0x4bc28b(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x18')]);}logger[_0x2dab('0x16')](_0x2dab('0x13'),_0x26852f,_0x3e7252[_0x2dab('0x16')]['message']);return _0x1e258e(_0x3e7252[_0x2dab('0x16')][_0x2dab('0x18')]);}else{logger[_0x2dab('0x12')](_0x2dab('0x13'),_0x26852f,_0x2dab('0x14'));_0x1e258e(_0x3e7252[_0x2dab('0x19')]['message']);}})[_0x2dab('0x1a')](function(_0x366e7c){logger[_0x2dab('0x16')]('ChatGroup,\x20%s,\x20%s',_0x26852f,_0x366e7c);_0x4bc28b(_0x366e7c);});});}
\ No newline at end of file
+var _0x36eb=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x1c7294,_0x43d230){var _0x55c507=function(_0x2bcdb3){while(--_0x2bcdb3){_0x1c7294['push'](_0x1c7294['shift']());}};_0x55c507(++_0x43d230);}(_0x36eb,0x111));var _0xb36e=function(_0x5bd183,_0x333604){_0x5bd183=_0x5bd183-0x0;var _0x32dd6b=_0x36eb[_0x5bd183];return _0x32dd6b;};'use strict';var _=require(_0xb36e('0x0'));var util=require('util');var moment=require(_0xb36e('0x1'));var BPromise=require('bluebird');var rs=require(_0xb36e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb36e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb36e('0x4'));var jayson=require(_0xb36e('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0xb36e('0x6')]=_[_0xb36e('0x7')](config[_0xb36e('0x6')],{'host':_0xb36e('0x8'),'port':0x18eb});var socket=require(_0xb36e('0x9'))(new Redis(config['redis']));require(_0xb36e('0xa'))[_0xb36e('0xb')](socket);function respondWithRpcPromise(_0x5e20be,_0x10d7f6,_0x510cb2){return new BPromise(function(_0x266cc3,_0x2f8620){return client[_0xb36e('0xc')](_0x5e20be,_0x510cb2)[_0xb36e('0xd')](function(_0x4d8ec5){logger[_0xb36e('0xe')](_0xb36e('0xf'),_0x10d7f6,_0xb36e('0x10'));logger['debug'](_0xb36e('0x11'),_0x10d7f6,_0xb36e('0x10'),JSON[_0xb36e('0x12')](_0x4d8ec5));if(_0x4d8ec5[_0xb36e('0x13')]){if(_0x4d8ec5[_0xb36e('0x13')]['code']===0x1f4){logger[_0xb36e('0x13')](_0xb36e('0xf'),_0x10d7f6,_0x4d8ec5[_0xb36e('0x13')][_0xb36e('0x14')]);return _0x2f8620(_0x4d8ec5[_0xb36e('0x13')][_0xb36e('0x14')]);}logger[_0xb36e('0x13')]('ChatGroup,\x20%s,\x20%s',_0x10d7f6,_0x4d8ec5[_0xb36e('0x13')]['message']);return _0x266cc3(_0x4d8ec5[_0xb36e('0x13')][_0xb36e('0x14')]);}else{logger[_0xb36e('0xe')](_0xb36e('0xf'),_0x10d7f6,_0xb36e('0x10'));_0x266cc3(_0x4d8ec5['result'][_0xb36e('0x14')]);}})[_0xb36e('0x15')](function(_0x2c9b3c){logger[_0xb36e('0x13')](_0xb36e('0xf'),_0x10d7f6,_0x2c9b3c);_0x2f8620(_0x2c9b3c);});});}
\ No newline at end of file
index cb442fd..94cc61c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e5b=['register','length','chatGroup:','./chatGroup.events','save','removeListener'];(function(_0x560e1a,_0x2529ed){var _0x4335e2=function(_0x35aa66){while(--_0x35aa66){_0x560e1a['push'](_0x560e1a['shift']());}};_0x4335e2(++_0x2529ed);}(_0x8e5b,0xe1));var _0xb8e5=function(_0x29ccec,_0x2a6a99){_0x29ccec=_0x29ccec-0x0;var _0xc2882c=_0x8e5b[_0x29ccec];return _0xc2882c;};'use strict';var ChatGroupEvents=require(_0xb8e5('0x0'));var events=[_0xb8e5('0x1'),'remove','update'];function createListener(_0x1d3ec1,_0x21eb7a){return function(_0x41f9b4){_0x21eb7a['emit'](_0x1d3ec1,_0x41f9b4);};}function removeListener(_0x5bbc3e,_0x44ba49){return function(){ChatGroupEvents[_0xb8e5('0x2')](_0x5bbc3e,_0x44ba49);};}exports[_0xb8e5('0x3')]=function(_0x3d81bb){for(var _0x158c32=0x0,_0x2841c0=events[_0xb8e5('0x4')];_0x158c32<_0x2841c0;_0x158c32++){var _0x14d45b=events[_0x158c32];var _0x474d2a=createListener(_0xb8e5('0x5')+_0x14d45b,_0x3d81bb);ChatGroupEvents['on'](_0x14d45b,_0x474d2a);}};
\ No newline at end of file
+var _0x4955=['emit','removeListener','register','length','chatGroup:','remove','update'];(function(_0x52b828,_0x412d29){var _0x38fd5a=function(_0x2dae25){while(--_0x2dae25){_0x52b828['push'](_0x52b828['shift']());}};_0x38fd5a(++_0x412d29);}(_0x4955,0x91));var _0x5495=function(_0x3efac0,_0x299a97){_0x3efac0=_0x3efac0-0x0;var _0x1cb83f=_0x4955[_0x3efac0];return _0x1cb83f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x5495('0x0'),_0x5495('0x1')];function createListener(_0x25e834,_0x44739d){return function(_0x33a9f9){_0x44739d[_0x5495('0x2')](_0x25e834,_0x33a9f9);};}function removeListener(_0x3f91f2,_0x46dbff){return function(){ChatGroupEvents[_0x5495('0x3')](_0x3f91f2,_0x46dbff);};}exports[_0x5495('0x4')]=function(_0x2c4091){for(var _0x327ac7=0x0,_0x31f890=events[_0x5495('0x5')];_0x327ac7<_0x31f890;_0x327ac7++){var _0x31816d=events[_0x327ac7];var _0x5e755d=createListener(_0x5495('0x6')+_0x31816d,_0x2c4091);ChatGroupEvents['on'](_0x31816d,_0x5e755d);}};
\ No newline at end of file
index 593cdd5..3376dd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c37=['getMessages','post','/:id/members','addMembers','put','/:id','update','delete','destroy','removeMembers','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','getMembers','/:id/messages'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x8c37,0xd9));var _0x78c3=function(_0xb8e48d,_0x1670bd){_0xb8e48d=_0xb8e48d-0x0;var _0xd2a426=_0x8c37[_0xb8e48d];return _0xd2a426;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x78c3('0x0'));var timeout=require(_0x78c3('0x1'));var express=require('express');var router=express[_0x78c3('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x78c3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x78c3('0x4'));var controller=require(_0x78c3('0x5'));router[_0x78c3('0x6')]('/',auth[_0x78c3('0x7')](),controller['index']);router[_0x78c3('0x6')](_0x78c3('0x8'),auth['isAuthenticated'](),controller[_0x78c3('0x9')]);router[_0x78c3('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x78c3('0xa')]);router[_0x78c3('0x6')]('/:id/unread',auth[_0x78c3('0x7')](),controller['getUnread']);router[_0x78c3('0x6')]('/:id/members',auth[_0x78c3('0x7')](),controller[_0x78c3('0xb')]);router[_0x78c3('0x6')](_0x78c3('0xc'),auth[_0x78c3('0x7')](),controller[_0x78c3('0xd')]);router[_0x78c3('0xe')]('/',auth[_0x78c3('0x7')](),controller['create']);router[_0x78c3('0xe')](_0x78c3('0xf'),auth[_0x78c3('0x7')](),controller[_0x78c3('0x10')]);router[_0x78c3('0xe')](_0x78c3('0xc'),auth[_0x78c3('0x7')](),controller['addMessage']);router[_0x78c3('0x11')](_0x78c3('0x12'),auth['isAuthenticated'](),controller[_0x78c3('0x13')]);router[_0x78c3('0x14')](_0x78c3('0x12'),auth[_0x78c3('0x7')](),controller[_0x78c3('0x15')]);router['delete'](_0x78c3('0xf'),auth[_0x78c3('0x7')](),controller[_0x78c3('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x07eb=['Router','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express'];(function(_0x8eafd0,_0x3bfcd5){var _0x5de482=function(_0x273137){while(--_0x273137){_0x8eafd0['push'](_0x8eafd0['shift']());}};_0x5de482(++_0x3bfcd5);}(_0x07eb,0xf7));var _0xb07e=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x07eb[_0x54ea7a];return _0x65a10d;};'use strict';var multer=require(_0xb07e('0x0'));var util=require(_0xb07e('0x1'));var path=require(_0xb07e('0x2'));var timeout=require(_0xb07e('0x3'));var express=require(_0xb07e('0x4'));var router=express[_0xb07e('0x5')]();var fs_extra=require(_0xb07e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb07e('0x7'));var config=require('../../config/environment');var controller=require(_0xb07e('0x8'));router[_0xb07e('0x9')]('/',auth[_0xb07e('0xa')](),controller['index']);router[_0xb07e('0x9')](_0xb07e('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb07e('0x9')](_0xb07e('0xc'),auth[_0xb07e('0xa')](),controller[_0xb07e('0xd')]);router[_0xb07e('0x9')](_0xb07e('0xe'),auth[_0xb07e('0xa')](),controller[_0xb07e('0xf')]);router[_0xb07e('0x9')](_0xb07e('0x10'),auth['isAuthenticated'](),controller[_0xb07e('0x11')]);router['get'](_0xb07e('0x12'),auth[_0xb07e('0xa')](),controller[_0xb07e('0x13')]);router[_0xb07e('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb07e('0x14')](_0xb07e('0x10'),auth[_0xb07e('0xa')](),controller[_0xb07e('0x15')]);router[_0xb07e('0x14')](_0xb07e('0x12'),auth[_0xb07e('0xa')](),controller[_0xb07e('0x16')]);router[_0xb07e('0x17')](_0xb07e('0xc'),auth['isAuthenticated'](),controller[_0xb07e('0x18')]);router[_0xb07e('0x19')](_0xb07e('0xc'),auth['isAuthenticated'](),controller[_0xb07e('0x1a')]);router[_0xb07e('0x19')](_0xb07e('0x10'),auth['isAuthenticated'](),controller[_0xb07e('0x1b')]);module['exports']=router;
\ No newline at end of file
index dc7d134..ad533b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c0d=['DATE','long','out','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x18012f,_0x4d169c){var _0x5e847=function(_0x350981){while(--_0x350981){_0x18012f['push'](_0x18012f['shift']());}};_0x5e847(++_0x4d169c);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x1e5066,_0x2f4db6){_0x1e5066=_0x1e5066-0x0;var _0x1cbd7a=_0x3c0d[_0x1e5066];return _0x1cbd7a;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd3c0('0x0')]},'ratingType':{'type':Sequelize[_0xd3c0('0x1')](_0xd3c0('0x2'),_0xd3c0('0x3')),'defaultValue':_0xd3c0('0x2')},'ratingMessage':{'type':Sequelize[_0xd3c0('0x4')]},'pathTranscript':{'type':Sequelize[_0xd3c0('0x4')]},'mailTranscript':{'type':Sequelize[_0xd3c0('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd3c0('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd3c0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd3c0('0x5')]},'browserName':{'type':Sequelize[_0xd3c0('0x5')]},'browserVersion':{'type':Sequelize[_0xd3c0('0x5')]},'osName':{'type':Sequelize[_0xd3c0('0x5')]},'osVersion':{'type':Sequelize[_0xd3c0('0x5')]},'deviceModel':{'type':Sequelize[_0xd3c0('0x5')]},'deviceVendor':{'type':Sequelize[_0xd3c0('0x5')]},'deviceType':{'type':Sequelize[_0xd3c0('0x5')]},'referer':{'type':Sequelize[_0xd3c0('0x4')]},'customerIp':{'type':Sequelize[_0xd3c0('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xd3c0('0x7'))},'read1stAt':{'type':Sequelize[_0xd3c0('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd3c0('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd3c0('0x5')]},'customerPort':{'type':Sequelize[_0xd3c0('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xd3c0('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6cb4=['star','thumb','TEXT','STRING','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x8f15dd,_0x1b132c){var _0x6a2868=function(_0x51da5f){while(--_0x51da5f){_0x8f15dd['push'](_0x8f15dd['shift']());}};_0x6a2868(++_0x1b132c);}(_0x6cb4,0xff));var _0x46cb=function(_0xa09324,_0x2a1d7f){_0xa09324=_0xa09324-0x0;var _0x426959=_0x6cb4[_0xa09324];return _0x426959;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'closed':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x46cb('0x3')]},'ratingType':{'type':Sequelize[_0x46cb('0x4')](_0x46cb('0x5'),_0x46cb('0x6')),'defaultValue':_0x46cb('0x5')},'ratingMessage':{'type':Sequelize[_0x46cb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x46cb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x46cb('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x46cb('0x8')]},'note':{'type':Sequelize[_0x46cb('0x8')]},'browserName':{'type':Sequelize[_0x46cb('0x8')]},'browserVersion':{'type':Sequelize[_0x46cb('0x8')]},'osName':{'type':Sequelize[_0x46cb('0x8')]},'osVersion':{'type':Sequelize[_0x46cb('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x46cb('0x8')]},'deviceType':{'type':Sequelize[_0x46cb('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x46cb('0x8')]},'formData':{'type':Sequelize[_0x46cb('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x46cb('0x9')]},'lastMsgAt':{'type':Sequelize[_0x46cb('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x46cb('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x46cb('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]}};
\ No newline at end of file
index d8d6717..54e0954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x25546a,_0x42926b){_0x25546a=_0x25546a-0x0;var _0x4566d7=_0x9ffd[_0x25546a];return _0x4566d7;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
+var _0x14a0=['t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ChatInteractionId','rows','show','params','intersection','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','customUpdate','CmContact','Contact','abandon','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','transcript-%s.txt','now','ChatMessage','Messages','format','agentAlias','System','customer','agentIdentifier','%s%d','agent_alias','alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','chatInteractionTags:save','removeTags','files','server','attachments','firstName','lastName','Account','get','Chat','Owner','N.A.','closedAt','osName','referer','customerPort','existsSync','createReadStream','pipe','out','views','transcript-','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','merge','contact','agent','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','ChatInteraction','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','select','color','tools_tags','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','length','getFullTextValue','ContactId','buildExpression','text','start','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x14a0,0x8e));var _0x014a=function(_0x18747c,_0x3e3091){_0x18747c=_0x18747c-0x0;var _0x15323b=_0x14a0[_0x18747c];return _0x15323b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x014a('0xf'));var logger=require(_0x014a('0x10'))('api');var utils=require(_0x014a('0x11'));var config=require(_0x014a('0x12'));var licenseUtil=require(_0x014a('0x13'));var db=require(_0x014a('0x14'))['db'];config[_0x014a('0x15')]=_[_0x014a('0x16')](config[_0x014a('0x15')],{'host':_0x014a('0x17'),'port':0x18eb});var socket=require(_0x014a('0x18'))(new Redis(config[_0x014a('0x15')]));require(_0x014a('0x19'))[_0x014a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x014a('0x1b')][_0x014a('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x014a('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x128c46,_0x59a4ea,_0x16e6fc,_0x17e4be){return new BPromise(function(_0x20f148,_0x12da95){var _0x2c26ac=_0x17e4be||client;return _0x2c26ac[_0x014a('0x1d')](_0x128c46,_0x16e6fc)[_0x014a('0x1e')](function(_0x263b07){logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));logger[_0x014a('0x22')](_0x014a('0x23'),_0x59a4ea,_0x014a('0x21'),JSON['stringify'](_0x263b07));if(_0x263b07[_0x014a('0x24')]){if(_0x263b07[_0x014a('0x24')][_0x014a('0x25')]===0x1f4){logger[_0x014a('0x24')](_0x014a('0x20'),_0x59a4ea,_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);return _0x12da95(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}logger['error'](_0x014a('0x20'),_0x59a4ea,_0x263b07['error'][_0x014a('0x26')]);return _0x20f148(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}else{logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));_0x20f148(_0x263b07[_0x014a('0x27')][_0x014a('0x26')]);}})[_0x014a('0x28')](function(_0x4c2627){logger[_0x014a('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x59a4ea,_0x4c2627);_0x12da95(_0x4c2627);});});}function respondWithStatusCode(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0xcc;return function(_0x4f1c44){if(_0x4f1c44){return _0x39a432['sendStatus'](_0x28701e);}return _0x39a432[_0x014a('0x29')](_0x28701e)[_0x014a('0x2a')]();};}function respondWithResult(_0x143346,_0x5ed71b){_0x5ed71b=_0x5ed71b||0xc8;return function(_0x183f19){if(_0x183f19){return _0x143346[_0x014a('0x29')](_0x5ed71b)['json'](_0x183f19);}};}function respondWithFilteredResult(_0x31dc95,_0x2560a6){return function(_0x496040){if(_0x496040){var _0x4f9c1c=typeof _0x2560a6[_0x014a('0x2b')]===_0x014a('0x2c')&&typeof _0x2560a6[_0x014a('0x2d')]===_0x014a('0x2c');var _0x4ea00c=_0x496040[_0x014a('0x2e')];var _0x147e7e=_0x4f9c1c?0x0:_0x2560a6[_0x014a('0x2b')];var _0x402d3b=_0x4f9c1c?_0x496040[_0x014a('0x2e')]:_0x2560a6[_0x014a('0x2b')]+_0x2560a6[_0x014a('0x2d')];var _0x1dae8e;if(_0x402d3b>=_0x4ea00c){_0x402d3b=_0x4ea00c;_0x1dae8e=0xc8;}else{_0x1dae8e=0xce;}_0x31dc95[_0x014a('0x29')](_0x1dae8e);return _0x31dc95[_0x014a('0x2f')](_0x014a('0x30'),_0x147e7e+'-'+_0x402d3b+'/'+_0x4ea00c)['json'](_0x496040);}return null;};}function patchUpdates(_0x105d4a){return function(_0x41ead8){try{jsonpatch[_0x014a('0x31')](_0x41ead8,_0x105d4a,!![]);}catch(_0x457883){return BPromise[_0x014a('0x32')](_0x457883);}return _0x41ead8[_0x014a('0x33')]();};}function saveUpdates(_0x211d18,_0x4dd025){return function(_0x116a24){if(_0x116a24){return _0x116a24[_0x014a('0x34')](_0x211d18)['then'](function(_0x415f83){return _0x415f83;});}return null;};}function removeEntity(_0x12de94,_0x40738f){return function(_0x467032){if(_0x467032){return _0x467032[_0x014a('0x35')]()[_0x014a('0x1e')](function(){_0x12de94[_0x014a('0x29')](0xcc)[_0x014a('0x2a')]();});}};}function handleEntityNotFound(_0x5e37e4,_0x19cee1){return function(_0x1dfe6e){if(!_0x1dfe6e){_0x5e37e4[_0x014a('0x36')](0x194);}return _0x1dfe6e;};}function handleError(_0x1f31c8,_0x5127f3){_0x5127f3=_0x5127f3||0x1f4;return function(_0x427c7a){logger[_0x014a('0x24')](_0x427c7a[_0x014a('0x37')]);if(_0x427c7a[_0x014a('0x38')]){delete _0x427c7a[_0x014a('0x38')];}_0x1f31c8[_0x014a('0x29')](_0x5127f3)[_0x014a('0x39')](_0x427c7a);};}function getMustacheRender(_0x36187b,_0x1ec350){return Mustache['render'](_0x36187b,_[_0x014a('0x3a')](_0x1ec350['body'],{'contact':_0x1ec350[_0x014a('0x3b')],'message':_0x1ec350[_0x014a('0x26')],'agent':_0x1ec350[_0x014a('0x3c')],'interaction':_0x1ec350[_0x014a('0x3d')],'account':_0x1ec350[_0x014a('0x3e')]}))||'';}function getInteractionUsers(_0x55126d,_0x1c6f6f){return new BPromise(function(_0x3f4a61,_0x51dca8){try{if(_0x1c6f6f[_0x55126d['id']]){_0x55126d[_0x014a('0x3f')]=_[_0x014a('0x40')](_0x1c6f6f[_0x55126d['id']],function(_0x3e5ecf){return{'id':_0x3e5ecf['id'],'fullname':_0x3e5ecf[_0x014a('0x41')]};});}}catch(_0x3788d6){_0x51dca8(_0x3788d6);}_0x3f4a61(_0x55126d);});}function getInteractionTags(_0x313eb8,_0x17b1b6){return new BPromise(function(_0x764fbe,_0x2beddc){try{if(_0x313eb8['TagIds']){_0x313eb8[_0x014a('0x42')]=[];_0x313eb8[_0x014a('0x43')][_0x014a('0x44')](',')[_0x014a('0x45')](function(_0x5f1a91){_0x313eb8[_0x014a('0x42')][_0x014a('0x46')](_0x17b1b6[_0x5f1a91]);});}delete _0x313eb8[_0x014a('0x43')];}catch(_0x1355dd){_0x2beddc(_0x1355dd);}_0x764fbe(_0x313eb8);});}function updateChatInteraction(_0x1dc647,_0x430a56,_0x5f2969){return new BPromise(function(_0x361866,_0x2830e1){return getInteractionUsers(_0x1dc647,_0x5f2969)['then'](function(_0xc086b3){return getInteractionTags(_0xc086b3,_0x430a56);})[_0x014a('0x1e')](function(_0x2c45f1){_0x361866(_0x2c45f1);})['catch'](function(_0x5bcf8){_0x2830e1(_0x5bcf8);});});}exports['index']=function(_0x5ab5e8,_0x67b30f){var _0x29c9ca={},_0x5aa496={},_0x1557ad={'count':0x0,'rows':[]};var _0x11c0d5=_[_0x014a('0x40')](db[_0x014a('0x47')][_0x014a('0x48')],function(_0xbaf8c6){return{'name':_0xbaf8c6['fieldName'],'type':_0xbaf8c6[_0x014a('0x49')][_0x014a('0x4a')]};});_0x5aa496[_0x014a('0x4b')]=_['map'](_0x11c0d5,'name');_0x5aa496[_0x014a('0x4c')]=_['keys'](_0x5ab5e8['query']);_0x5aa496[_0x014a('0x4d')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],_0x5aa496[_0x014a('0x4c')]);_0x29c9ca[_0x014a('0x4e')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x4f')]));_0x29c9ca[_0x014a('0x4e')]=_0x29c9ca[_0x014a('0x4e')]['length']?_0x29c9ca[_0x014a('0x4e')]:_0x5aa496[_0x014a('0x4b')];if(!_0x5ab5e8['query'][_0x014a('0x50')](_0x014a('0x51'))){_0x29c9ca[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x2d')]);_0x29c9ca[_0x014a('0x2b')]=qs[_0x014a('0x2b')](_0x5ab5e8['query'][_0x014a('0x2b')]);}_0x29c9ca[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x53')]);_0x29c9ca['where']=qs[_0x014a('0x4d')](_['pick'](_0x5ab5e8[_0x014a('0x4c')],_0x5aa496[_0x014a('0x4d')]),_0x11c0d5);var _0x40e02b=[];var _0x479dc0=squel[_0x014a('0x54')]()['field']('id')['field']('name')['field'](_0x014a('0x55'))['from'](_0x014a('0x56'));var _0x5b5318=squel['select']()[_0x014a('0x57')]('u.id')[_0x014a('0x57')](_0x014a('0x58'))[_0x014a('0x57')](_0x014a('0x59'))[_0x014a('0x5a')](_0x014a('0x5b'),'ui')[_0x014a('0x5c')](_0x014a('0x5d'),'u',_0x014a('0x5e'));var _0x3fc9ab=squel['select']()['from'](_0x014a('0x5f'),'i')[_0x014a('0x5c')](_0x014a('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x014a('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x014a('0x5c')](_0x014a('0x61'),'a',_0x014a('0x62'))[_0x014a('0x5c')]('chat_messages','me',_0x014a('0x63'))[_0x014a('0x5c')](_0x014a('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x014a('0x5c')]('tools_tags','t',_0x014a('0x65'));var _0x47074f=squel[_0x014a('0x66')]();var _0x24d433=[];var _0xd0334a=squel[_0x014a('0x66')]();var _0x4e9260;if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x67')]){_0x4e9260=as[_0x014a('0x68')](_0x5ab5e8['query'][_0x014a('0x67')]);var _0x17f9d7=_0x4e9260[_0x014a('0x69')];for(var _0xa4fd8d=0x0;_0xa4fd8d<_0x4e9260[_0x014a('0x6a')]['length'];_0xa4fd8d++){var _0x8ac9cd=_0x4e9260[_0x014a('0x6a')][_0xa4fd8d];var _0x63c341='i';var _0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x8ac9cd[_0x014a('0x57')]]);if(!_0x37a7b8){switch(_0x8ac9cd[_0x014a('0x57')]){case _0x014a('0x6c'):if(_0x8ac9cd[_0x014a('0x6d')]==0x1){_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd[_0x014a('0x57')]+'`\x20=\x200');}else{_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd['field']+'`\x20>\x200');}break;case'Contact':if(_0x8ac9cd['operator']==='$substring'){if(_0x8ac9cd[_0x014a('0x6d')][_0x014a('0x44')]('\x20')[_0x014a('0x6f')]>0x1){_0x47074f[_0x17f9d7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x014a('0x70')](_0x8ac9cd[_0x014a('0x6d')]),null);}else{var _0x3071c8='%'+_0x8ac9cd[_0x014a('0x6d')]+'%';_0x47074f[_0x17f9d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3071c8,_0x3071c8,_0x3071c8);}}else{_0x37a7b8=_['find'](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x71')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x71');_0x58e087=as[_0x014a('0x72')](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}break;case'Tag':var _0x2d87e3=_0x8ac9cd[_0x014a('0x6d')]['split'](',')[_0x014a('0x40')](function(_0x3e39c9){return Number(_0x3e39c9);});_0x2d87e3['forEach'](function(_0x14f2e2){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f2e2+',%');});_0x24d433=_[_0x014a('0x75')](_0x24d433,_0x2d87e3);break;case _0x014a('0x76'):if(_0x8ac9cd[_0x014a('0x77')]===_0x014a('0x78')){_0x47074f[_0x17f9d7](_0x014a('0x79'),'%'+_0x8ac9cd['value']+'%',null);}else{_0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x7a')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x7a');_0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')]['end']);}break;case _0x014a('0x7b'):_0x58e087=as[_0x014a('0x72')]('me',null,_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);break;}}else{var _0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087['text'],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}}}else{var _0x55bca3=_(_0x5ab5e8['query'])[_0x014a('0x7c')]()[_0x014a('0x40')](function(_0x5f391d){return _[_0x014a('0x7d')](_0x11c0d5,[_0x014a('0x38'),_0x5f391d])?_0x5f391d:undefined;})['compact']()['value']();if(!_[_0x014a('0x7e')](_0x55bca3)){_0x55bca3[_0x014a('0x45')](function(_0x1ee130){if(_0x1ee130===_0x014a('0x7f')){_0x3fc9ab[_0x014a('0x80')](_0x014a('0x81'),[]['concat'](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]));}else if(_0x1ee130==='createdAt'){var _0x5a8351=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])['$gte'];var _0x27e363=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])[_0x014a('0x83')];_0x3fc9ab[_0x014a('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a8351,_0x27e363);}else{if(_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]===_0x014a('0x84')){_0x3fc9ab[_0x014a('0x80')]('i.'+_0x1ee130+_0x014a('0x85'));}else{_0x3fc9ab['where']('i.'+_0x1ee130+_0x014a('0x86'),_0x5ab5e8['query'][_0x1ee130]);}}});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]==0x1){_0x3fc9ab[_0x014a('0x6e')](_0x014a('0x88'));}else{_0x3fc9ab['having'](_0x014a('0x89'));}}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]){_0x24d433=_[_0x014a('0x8b')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')])?_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]:new Array(_0x5ab5e8['query'][_0x014a('0x8a')]);_0x24d433[_0x014a('0x45')](function(_0x3c2a39){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2a39+',%');});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')]){var _0x1cdfa5=_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')][_0x014a('0x8d')]('\x5c','\x5c\x5c')[_0x014a('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cdfa5)){_0x47074f['or']('i.id\x20LIKE\x20?',_0x1cdfa5+'%');}else{_0x47074f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1cdfa5))['or'](_0x014a('0x8e'),_0x1cdfa5+'%');}}}_0x3fc9ab[_0x014a('0x80')](_0x47074f);_0x3fc9ab[_0x014a('0x8f')](_0x014a('0x90'));var _0xe1b5ed={'type':db[_0x014a('0x91')][_0x014a('0x92')]['SELECT'],'raw':!![]};var _0x24ffb0=_0x3fc9ab[_0x014a('0x93')]();_0x24ffb0[_0x014a('0x57')](_0x014a('0x90'));_0x24ffb0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x014a('0x6c'));if(_0x29c9ca[_0x014a('0x52')]){_0x29c9ca['order']['forEach'](function(_0x9aa04b){var _0x5bcaf9=_0x9aa04b[0x0]==='contactName'?_0x9aa04b[0x0]:'i.'+_0x9aa04b[0x0];_0x3fc9ab[_0x014a('0x52')](_0x5bcaf9,_0x9aa04b[0x1]===_0x014a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x24d433)){_0x3fc9ab[_0x014a('0x6e')](_0xd0334a);_0x24ffb0[_0x014a('0x80')](_0x014a('0x95'),_0x24d433);}BPromise[_0x014a('0x96')]()[_0x014a('0x1e')](function(){if(!_0x4e9260){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x7f')])return;_0x24ffb0[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc9ab['where'](_0x014a('0x97'));return;}if(_0x5ab5e8['user']['role']!=='agent')return;return _0x5ab5e8[_0x014a('0x98')][_0x014a('0x99')]({'attributes':['id'],'raw':!![]})[_0x014a('0x1e')](function(_0x55408f){if(_[_0x014a('0x7e')](_0x55408f)){_0x24ffb0[_0x014a('0x80')](_0x014a('0x9a'));_0x3fc9ab[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24ffb0[_0x014a('0x80')](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));_0x3fc9ab['where'](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));}});})['then'](function(){if(_0x5ab5e8[_0x014a('0x98')][_0x014a('0x9b')]===_0x014a('0x3c')&&!_0x4e9260&&!_0x5ab5e8['query'][_0x014a('0x7f')])return[];return db[_0x014a('0x9c')]['query'](_0x24ffb0[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x317df3){_0x1557ad[_0x014a('0x2e')]=_0x317df3[_0x014a('0x6f')];if(_0x1557ad[_0x014a('0x2e')]===0x0)return[];return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x479dc0['toString'](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x1806d0){_0x40e02b=_['keyBy'](_0x1806d0,'id');_0xe1b5ed=_['merge'](_0xe1b5ed,{'model':db[_0x014a('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ab5e8[_0x014a('0x4c')]['fields']){_0x29c9ca[_0x014a('0x4e')][_0x014a('0x45')](function(_0x216b27){_0x3fc9ab['field']('i.'+_0x216b27);});}else{_0x3fc9ab[_0x014a('0x57')](_0x014a('0x9e'),'unreadMessages');_0x3fc9ab['field'](_0x014a('0x9f'),'Account.key');_0x3fc9ab[_0x014a('0x57')]('a.mandatoryDisposition',_0x014a('0xa0'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa1'),_0x014a('0xa2'));_0x3fc9ab[_0x014a('0x57')]('i.*');_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa3'),_0x014a('0xa4'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa5'),_0x014a('0xa6'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa7'),'Contact.email');_0x3fc9ab[_0x014a('0x57')]('c.phone',_0x014a('0xa8'));_0x3fc9ab['field']('c.mobile','Contact.mobile');_0x3fc9ab['field'](_0x014a('0xa9'),_0x014a('0xaa'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xab'),_0x014a('0xac'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xad'),_0x014a('0xae'));_0x3fc9ab['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x014a('0x43'));}if(_0x29c9ca[_0x014a('0x2d')])_0x3fc9ab[_0x014a('0x2d')](_0x29c9ca[_0x014a('0x2d')]);if(_0x29c9ca[_0x014a('0x2b')])_0x3fc9ab[_0x014a('0x2b')](_0x29c9ca[_0x014a('0x2b')]);return db[_0x014a('0x9c')]['query'](_0x3fc9ab[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x3a2752){if(_0x3a2752[_0x014a('0x6f')]>0x0)_0x5b5318[_0x014a('0x80')]('ui.ChatInteractionId\x20IN\x20?',_[_0x014a('0x40')](_0x3a2752,'id'));return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x5b5318[_0x014a('0x9d')](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x567357){var _0x3036e4=_['groupBy'](_0x567357,_0x014a('0xaf'));var _0x5a83ab=[];_0x3a2752['forEach'](function(_0x1667c8){_0x5a83ab[_0x014a('0x46')](updateChatInteraction(_0x1667c8,_0x40e02b,_0x3036e4));});return BPromise['all'](_0x5a83ab);});});})[_0x014a('0x1e')](function(_0x3199b9){_0x1557ad[_0x014a('0xb0')]=_0x3199b9;return _0x1557ad;})['then'](respondWithFilteredResult(_0x67b30f,_0x29c9ca))[_0x014a('0x28')](handleError(_0x67b30f,null));};exports[_0x014a('0xb1')]=function(_0x2feb8a,_0x336bcf){var _0x2f7969={'raw':![],'where':{'id':_0x2feb8a[_0x014a('0xb2')]['id']}},_0x263212={};_0x263212[_0x014a('0x4b')]=_[_0x014a('0x7c')](db['ChatInteraction']['rawAttributes']);_0x263212[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x2feb8a[_0x014a('0x4c')]);_0x263212['filters']=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],_0x263212[_0x014a('0x4c')]);_0x2f7969[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],qs['fields'](_0x2feb8a[_0x014a('0x4c')][_0x014a('0x4f')]));_0x2f7969[_0x014a('0x4e')]=_0x2f7969[_0x014a('0x4e')]['length']?_0x2f7969[_0x014a('0x4e')]:_0x263212[_0x014a('0x4b')];if(_0x2feb8a[_0x014a('0x4c')][_0x014a('0xb4')]){_0x2f7969[_0x014a('0xb5')]=[{'all':!![]}];}_0x2f7969=_['merge']({},_0x2f7969,_0x2feb8a[_0x014a('0xb6')]);return db['ChatInteraction']['find'](_0x2f7969)[_0x014a('0x1e')](handleEntityNotFound(_0x336bcf,null))[_0x014a('0x1e')](respondWithResult(_0x336bcf,null))[_0x014a('0x28')](handleError(_0x336bcf,null));};exports[_0x014a('0xb7')]=function(_0x3646b8,_0x243fd9){return db[_0x014a('0x47')][_0x014a('0xb7')](_0x3646b8[_0x014a('0x7b')],{})[_0x014a('0x1e')](respondWithResult(_0x243fd9,0xc9))[_0x014a('0x28')](handleError(_0x243fd9,null));};exports[_0x014a('0x34')]=function(_0x383bd8,_0x175c12){if(_0x383bd8[_0x014a('0x7b')]['id']){delete _0x383bd8[_0x014a('0x7b')]['id'];}return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x383bd8[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x175c12,null))['then'](saveUpdates(_0x383bd8[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x175c12,null))[_0x014a('0x28')](handleError(_0x175c12,null));};exports[_0x014a('0x35')]=function(_0x116631,_0xbfd7f8){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x116631[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0xbfd7f8,null))[_0x014a('0x1e')](removeEntity(_0xbfd7f8,null))[_0x014a('0x28')](handleError(_0xbfd7f8,null));};exports[_0x014a('0xb8')]=function(_0x11aab3,_0x4f91f1){return db[_0x014a('0x47')]['describe']()['then'](respondWithResult(_0x4f91f1,null))[_0x014a('0x28')](handleError(_0x4f91f1,null));};exports['createVidaooSession']=function(_0x2de457,_0x2ca658){var _0x4ee77b=_0x2de457[_0x014a('0xb2')]['id'];var _0x4e75e4;var _0x172210;var _0x8cc35d;return db['ChatInteraction'][_0x014a('0xb9')]({'where':{'id':_0x4ee77b}})[_0x014a('0x1e')](function(_0x50a129){_0x4e75e4=_0x50a129;return db[_0x014a('0xba')][_0x014a('0xb9')]({'where':{'id':_0x50a129[_0x014a('0x7f')]},'attributes':['id',_0x014a('0xbb'),_0x014a('0xbc'),_0x014a('0xbd'),_0x014a('0xbe'),_0x014a('0xbf')],'raw':!![]});})[_0x014a('0x1e')](function(_0x38df6c){if(_0x38df6c&&_0x38df6c[_0x014a('0xbb')]&&_0x38df6c[_0x014a('0xbc')]){_0x172210=_0x38df6c;var _0x4e0c1a={'interaction':{'id':_0x4ee77b},'agent':{'id':_0x2de457[_0x014a('0x98')]['id'],'name':_0x2de457[_0x014a('0x98')][_0x014a('0x38')],'fullname':_0x2de457[_0x014a('0x98')][_0x014a('0x41')],'email':_0x2de457[_0x014a('0x98')][_0x014a('0xc0')]},'contact':_0x2de457[_0x014a('0x7b')]['contact'],'account':_0x2de457[_0x014a('0x7b')][_0x014a('0x3e')]};var _0x2b3dc0={'rejectUnauthorized':![],'method':_0x014a('0xc1'),'url':_0x014a('0xc2'),'headers':{'X-APIKEY':_0x38df6c[_0x014a('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2de457['user'][_0x014a('0xc0')]],'buttons':null,'topic':_0x172210[_0x014a('0xbd')],'note':_[_0x014a('0xc3')](_0x172210['vidaooNote'])?null:getMustacheRender(_0x172210['vidaooNote'],_0x4e0c1a),'metadata':null},'redirect':_0x014a('0xc4'),'json':!![]};try{if(!_[_0x014a('0xc3')](_0x172210[_0x014a('0xbf')])){var _0x31e65e=getMustacheRender(_0x172210[_0x014a('0xbf')],_0x4e0c1a);var _0x537353=JSON[_0x014a('0x82')](_0x31e65e);_0x2b3dc0[_0x014a('0x7b')][_0x014a('0xc5')]=_0x537353;}}catch(_0x5dd7a5){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2b3dc0);}else{throw new db[(_0x014a('0x91'))]['ValidationError'](_0x014a('0xc7'));}})['then'](function(_0x57d852){_0x8cc35d=_0x57d852;if(_0x8cc35d['id']){var _0x581c3a={'body':_0x8cc35d[_0x014a('0xc8')],'ChatWebsiteId':_0x172210['id'],'ChatInteractionId':_0x4e75e4['id'],'direction':'out','UserId':_0x2de457[_0x014a('0x98')]['id']};return db['ChatMessage'][_0x014a('0xb7')](_0x581c3a,{});}else{throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x014a('0x1e')](function(){return _0x4e75e4['updateAttributes']({'vidaooSessionId':_0x8cc35d['id']});})[_0x014a('0x1e')](respondWithResult(_0x2ca658,null))[_0x014a('0x28')](handleError(_0x2ca658,null));};exports[_0x014a('0xc9')]=function(_0x533371,_0x57b53b){if(_0x533371[_0x014a('0x7b')]['id']){delete _0x533371[_0x014a('0x7b')]['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x533371[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xca')],'as':_0x014a('0xcb')}]})[_0x014a('0x1e')](handleEntityNotFound(_0x57b53b,null))[_0x014a('0x1e')](saveUpdates(_0x533371[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x57b53b,null))[_0x014a('0x28')](handleError(_0x57b53b,null));};exports[_0x014a('0xcc')]=function(_0x4adbd2,_0x55a4bb,_0x38807c){if(_0x4adbd2[_0x014a('0x7b')]['id']){delete _0x4adbd2['body']['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x4adbd2['params']['id']}})['then'](function(_0xf01aa6){if(!_0xf01aa6){logger[_0x014a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x014a('0xcc'),0x194,'entity\x20not\x20found');_0x55a4bb[_0x014a('0x36')](0x194);}else{if(_0xf01aa6[_0x014a('0x7a')]){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Interaction\x20already\x20assigned');}}return _0xf01aa6;})['then'](function(_0x5db9d1){if(_0x5db9d1){return _0x5db9d1['update']({'closed':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xcd')],'disposition':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xce')]})[_0x014a('0x1e')](function(_0x3e19c0){return _0x3e19c0;});}})[_0x014a('0x1e')](function(_0x3546e7){return respondWithRpcPromise(_0x014a('0xcf'),_0x014a('0xcc'),_0x4adbd2[_0x014a('0x7b')],client9004);})['then'](respondWithResult(_0x55a4bb,null))['catch'](handleError(_0x55a4bb,null));};exports['attachmentUpload']=function(_0x190839,_0x28f011,_0x4da4a1){_0x190839[_0x014a('0x7b')][_0x014a('0x38')]=_0x190839[_0x014a('0xd0')][_0x014a('0xd1')];_0x190839['body'][_0x014a('0xd2')]=_0x190839[_0x014a('0xd0')]['filename'];_0x190839[_0x014a('0x7b')][_0x014a('0x49')]=_0x190839['file'][_0x014a('0xd3')];return db[_0x014a('0xd4')][_0x014a('0xb7')](_0x190839[_0x014a('0x7b')])[_0x014a('0x1e')](respondWithResult(_0x28f011,0xc9))[_0x014a('0x28')](handleError(_0x28f011,null));};exports[_0x014a('0xd5')]=function(_0xd50ab0,_0x4cee0b,_0x129deb){return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0xb2')]['id']},'raw':!![]})[_0x014a('0x1e')](handleEntityNotFound(_0x4cee0b,null))[_0x014a('0x1e')](function(_0x2573bd){if(_0x2573bd){if(_0x2573bd[_0x014a('0xcd')]){return _0x4cee0b[_0x014a('0x29')](0x193)['json']({'status':0x193,'message':_0x014a('0xd6')});}return db['Attachment'][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0x4c')][_0x014a('0xd7')]},'raw':!![]})['then'](handleEntityNotFound(_0x4cee0b,null));}})['then'](function(_0x293ee3){if(_0x293ee3){var _0x4ce807=_0x293ee3['ChatOfflineMessageId']!==null;var _0x5c002b=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xda'));if(_0x4ce807){_0x5c002b=path['join'](_0x5c002b,_0x014a('0xdb'));}var _0x19a2ed=path['join'](_0x5c002b,_0x293ee3[_0x014a('0xd2')]);return _0x4cee0b[_0x014a('0xdc')](_0x19a2ed);}})[_0x014a('0x28')](handleError(_0x4cee0b,null));};exports['close']=function(_0x5b82f2,_0x2b622f){var _0x24e9d7=null;var _0x344adb=null;var _0x1441ed=null;var _0x34b528=null;if(_0x5b82f2[_0x014a('0x7b')]['id']){delete _0x5b82f2['body']['id'];}if(_0x5b82f2['body']['mailTranscript']){_0x34b528=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xdd'),util['format'](_0x014a('0xde'),Date[_0x014a('0xdf')]()));_0x5b82f2[_0x014a('0x7b')]['pathTranscript']=_0x34b528;}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x5b82f2[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xe0')],'as':'Messages','include':[{'model':db[_0x014a('0x76')],'as':'User'}]}]})[_0x014a('0x1e')](handleEntityNotFound(_0x2b622f,null))[_0x014a('0x1e')](saveUpdates(_0x5b82f2[_0x014a('0x7b')],null))['then'](function(_0xdd63f){if(_0xdd63f){_0x24e9d7=_0xdd63f;return db[_0x014a('0xba')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x7f')]}});}})[_0x014a('0x1e')](function(_0x49a1eb){if(_0x49a1eb){_0x1441ed=_0x49a1eb;return db[_0x014a('0xca')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x71')]}});}})[_0x014a('0x1e')](function(_0x2432ac){if(_0x2432ac){_0x344adb=_0x2432ac;if(_0x34b528){var _0xb91589=null;for(var _0x53260c=0x1;_0x53260c<_0x24e9d7[_0x014a('0xe1')][_0x014a('0x6f')];++_0x53260c){_0xb91589=_0x24e9d7['Messages'][_0x53260c];var _0x1b5b25=_0xb91589['UserId']?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');var _0x10b3c5=_0x5b82f2[_0x014a('0x7b')][_0x014a('0xe5')]||util[_0x014a('0xe2')]('%s%d','Visitor',_0xb91589[_0x014a('0x71')]);switch(_0x1441ed[_0x014a('0xe6')]){case'website_alias':_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')](_0x014a('0xe7'),_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):'System';break;case _0x014a('0xe8'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0xe9')]||_0xb91589['User'][_0x014a('0x41')]:'System';break;case _0x014a('0xea'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4');break;default:_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');}var _0x343b5e=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0xb91589[_0x014a('0xeb')])[_0x014a('0xe2')]('MM/DD/YYYY\x20HH:mm:ss'),_0xb91589[_0x014a('0xec')]==='in'?_0x10b3c5:_0x1b5b25,_0xb91589[_0x014a('0x7b')]);if(!_0xb91589[_0x014a('0xed')]){fs[_0x014a('0xee')](_0x34b528,_0x343b5e);}}return db[_0x014a('0xef')][_0x014a('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x014a('0xf0')],'as':_0x014a('0xf1'),'raw':!![]}]});}}})[_0x014a('0x1e')](function(_0x4ad0c6){if(_0x4ad0c6&&_0x4ad0c6[_0x014a('0xf1')]&&_0x5b82f2['body']){var _0x5f8d5b={'tls':{'rejectUnauthorized':![]}};if(_0x4ad0c6[_0x014a('0xf1')]['service']){_0x5f8d5b[_0x014a('0xf2')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf2')];}else{_0x5f8d5b[_0x014a('0xf3')]=_0x4ad0c6[_0x014a('0xf1')]['host'];_0x5f8d5b[_0x014a('0xf4')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf4')];_0x5f8d5b[_0x014a('0xf5')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf5')];}if(_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf6')]){_0x5f8d5b['auth']={'user':_0x4ad0c6[_0x014a('0xf1')]['user'],'pass':_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf7')]};}return respondWithRpcPromise(_0x014a('0xf8'),_0x014a('0xf9'),{'account':_0x5f8d5b,'message':{'from':util[_0x014a('0xe2')](_0x014a('0xfa'),_0x4ad0c6['name'],_0x4ad0c6[_0x014a('0xc0')]||_0x4ad0c6['Smtp'][_0x014a('0x98')]),'to':_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')],'subject':_0x014a('0xfc'),'text':util[_0x014a('0xe2')](_0x014a('0xfd'),_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')]),'attachments':[{'path':_0x34b528}]}})['then'](function(){return _0x24e9d7;})['catch'](function(_0xac886c){console[_0x014a('0x24')](_0xac886c);});}else{return _0x24e9d7;}})[_0x014a('0x1e')](respondWithStatusCode(_0x2b622f,0xc8))[_0x014a('0x28')](handleError(_0x2b622f,null));};exports[_0x014a('0xfe')]=function(_0x30aa7b,_0x451579,_0x3858a1){return db[_0x014a('0xe0')][_0x014a('0x6b')]({'where':{'id':_0x30aa7b[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x451579,null))[_0x014a('0x1e')](function(_0x57bd30){if(_0x57bd30){return _0x57bd30[_0x014a('0xfe')](_0x30aa7b[_0x014a('0x7b')][_0x014a('0xff')],_['omit'](_0x30aa7b[_0x014a('0x7b')],[_0x014a('0xff'),'id'])||{});}})[_0x014a('0x1e')](respondWithResult(_0x451579,null))[_0x014a('0x28')](handleError(_0x451579,null));};exports[_0x014a('0x100')]=function(_0x36c94d,_0x44cb05,_0x30a903){var _0x3bb1f={'raw':![],'where':{}};var _0x4775a4={};var _0x13ec10={'count':0x0,'rows':[]};return db[_0x014a('0x47')]['findOne']({'where':{'id':_0x36c94d['params']['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x44cb05,null))[_0x014a('0x1e')](function(_0x4a361b){if(_0x4a361b){_0x4775a4[_0x014a('0x4b')]=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x4775a4[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x36c94d[_0x014a('0x4c')]);_0x4775a4[_0x014a('0x4d')]=_['intersection'](_0x4775a4[_0x014a('0x4b')],_0x4775a4[_0x014a('0x4c')]);_0x3bb1f[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x4775a4['model'],qs[_0x014a('0x4f')](_0x36c94d[_0x014a('0x4c')][_0x014a('0x4f')]));_0x3bb1f['attributes']=_0x3bb1f[_0x014a('0x4e')][_0x014a('0x6f')]?_0x3bb1f['attributes']:_0x4775a4[_0x014a('0x4b')];if(!_0x36c94d[_0x014a('0x4c')][_0x014a('0x50')]('nolimit')){_0x3bb1f[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x36c94d[_0x014a('0x4c')]['limit']);_0x3bb1f[_0x014a('0x2b')]=qs['offset'](_0x36c94d[_0x014a('0x4c')]['offset']);}_0x3bb1f[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x36c94d['query'][_0x014a('0x53')]);_0x3bb1f['where']=qs[_0x014a('0x4d')](_[_0x014a('0x101')](_0x36c94d[_0x014a('0x4c')],_0x4775a4[_0x014a('0x4d')]));_0x3bb1f[_0x014a('0x80')]['ChatInteractionId']=_0x4a361b['id'];if(_0x36c94d[_0x014a('0x4c')][_0x014a('0x8c')]){_0x3bb1f[_0x014a('0x80')]=_['merge'](_0x3bb1f[_0x014a('0x80')],{'$or':_[_0x014a('0x40')](_0x3bb1f['attributes'],function(_0x565da5){var _0x309858={};_0x309858[_0x565da5]={'$like':'%'+_0x36c94d[_0x014a('0x4c')]['filter']+'%'};return _0x309858;})});}if(_0x36c94d[_0x014a('0x4c')]['$gte']){var _0x56bfaf=_0x36c94d[_0x014a('0x4c')][_0x014a('0x102')]['split'](',');var _0x5f14e4={};_0x5f14e4[_0x56bfaf[0x0]]={'$gte':moment(_0x56bfaf[0x1])['format'](_0x014a('0x103'))};_0x3bb1f[_0x014a('0x80')]=_[_0x014a('0x3a')](_0x3bb1f['where'],_0x5f14e4);}_0x3bb1f=_['merge']({},_0x3bb1f,_0x36c94d[_0x014a('0xb6')]);return db['ChatMessage'][_0x014a('0x2e')]({'where':_0x3bb1f[_0x014a('0x80')]})['then'](function(_0x4acfe9){_0x13ec10[_0x014a('0x2e')]=_0x4acfe9;if(_0x36c94d[_0x014a('0x4c')]['includeAll']){_0x3bb1f[_0x014a('0xb5')]=[{'all':!![]}];}return db['ChatMessage'][_0x014a('0x104')](_0x3bb1f);})['then'](function(_0x8c21a7){_0x13ec10[_0x014a('0xb0')]=_0x8c21a7;return _0x13ec10;});}})[_0x014a('0x1e')](respondWithFilteredResult(_0x44cb05,_0x3bb1f))[_0x014a('0x28')](handleError(_0x44cb05,null));};exports[_0x014a('0x105')]=function(_0x260f79,_0x68de07,_0x4126a3){var _0x4f1f23={'where':{}},_0x1ef9b0={},_0x11d0e9={'count':0x0,'rows':[]};return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0x260f79[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x68de07,null))[_0x014a('0x1e')](function(_0x4f7960){if(_0x4f7960){_0x1ef9b0['model']=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x1ef9b0[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x260f79[_0x014a('0x4c')]);_0x1ef9b0[_0x014a('0x4d')]=_[_0x014a('0xb3')](_0x1ef9b0[_0x014a('0x4b')],_0x1ef9b0[_0x014a('0x4c')]);_0x4f1f23[_0x014a('0x4e')]=_['intersection'](_0x1ef9b0[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x260f79[_0x014a('0x4c')][_0x014a('0x4f')]));_0x4f1f23[_0x014a('0x4e')]=_0x4f1f23[_0x014a('0x4e')][_0x014a('0x6f')]?_0x4f1f23['attributes']:_0x1ef9b0['model'];if(!_0x260f79[_0x014a('0x4c')][_0x014a('0x50')](_0x014a('0x51'))){_0x4f1f23[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x260f79['query'][_0x014a('0x2d')]);_0x4f1f23[_0x014a('0x2b')]=qs['offset'](_0x260f79[_0x014a('0x4c')][_0x014a('0x2b')]);}_0x4f1f23[_0x014a('0x52')]=qs['sort'](_0x260f79[_0x014a('0x4c')][_0x014a('0x53')]);_0x4f1f23[_0x014a('0x80')]=qs['filters'](_[_0x014a('0x101')](_0x260f79[_0x014a('0x4c')],_0x1ef9b0['filters']));_0x4f1f23[_0x014a('0x80')][_0x014a('0xaf')]=_0x4f7960['id'];if(_0x260f79[_0x014a('0x4c')]['filter']){_0x4f1f23[_0x014a('0x80')]=_['merge'](_0x4f1f23['where'],{'$or':_['map'](_0x4f1f23['attributes'],function(_0xf3e4fb){var _0x126084={};_0x126084[_0xf3e4fb]={'$like':'%'+_0x260f79[_0x014a('0x4c')][_0x014a('0x8c')]+'%'};return _0x126084;})});}_0x4f1f23[_0x014a('0x80')][_0x014a('0xed')]=![];if(_0x260f79[_0x014a('0x4c')]['id']){_0x4f1f23['where']['id']={'$gt':_0x260f79[_0x014a('0x4c')]['id']};}_0x4f1f23=_['merge']({},_0x4f1f23,_0x260f79[_0x014a('0xb6')]);return db[_0x014a('0xe0')][_0x014a('0x2e')]({'where':_0x4f1f23['where']})[_0x014a('0x1e')](function(_0x58421d){_0x11d0e9['count']=_0x58421d;_0x4f1f23[_0x014a('0xb5')]=[];if(_0x260f79[_0x014a('0x4c')][_0x014a('0x106')]){_0x4f1f23['include']['push']({'model':db[_0x014a('0x76')],'as':_0x014a('0x76'),'attributes':['id',_0x014a('0x41'),_0x014a('0xe9')]});}if(_0x260f79[_0x014a('0x4c')][_0x014a('0xb4')]){_0x4f1f23['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4f1f23);})[_0x014a('0x1e')](function(_0x40a47f){_0x11d0e9[_0x014a('0xb0')]=_0x40a47f;return _0x11d0e9;});}})['then'](respondWithFilteredResult(_0x68de07,_0x4f1f23))[_0x014a('0x28')](handleError(_0x68de07,null));};exports[_0x014a('0x107')]=function(_0x8a099,_0x81208d,_0x320be9){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x8a099[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x81208d,null))[_0x014a('0x1e')](function(_0x46a2c5){if(_0x46a2c5){return _0x46a2c5['setTags'](_0x8a099[_0x014a('0x7b')][_0x014a('0xff')],_[_0x014a('0x108')](_0x8a099['body'],[_0x014a('0xff'),'id'])||{})[_0x014a('0x109')](function(){return db['Tag'][_0x014a('0x104')]({'attributes':['id','name',_0x014a('0x55')],'where':{'id':_0x8a099[_0x014a('0x7b')][_0x014a('0xff')]}});})[_0x014a('0x1e')](function(_0x4f56a9){socket['emit'](_0x014a('0x10a'),{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]});return{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]};});}})[_0x014a('0x1e')](respondWithResult(_0x81208d,null))[_0x014a('0x28')](handleError(_0x81208d,null));};exports[_0x014a('0x10b')]=function(_0x32ba5d,_0x120047,_0x570898){return db['ChatInteraction']['find']({'where':{'id':_0x32ba5d[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x120047,null))[_0x014a('0x1e')](function(_0x47cd44){if(_0x47cd44){return _0x47cd44[_0x014a('0x10b')](_0x32ba5d[_0x014a('0x4c')][_0x014a('0xff')]);}})['then'](respondWithStatusCode(_0x120047,null))[_0x014a('0x28')](handleError(_0x120047,null));};exports['download']=function(_0x546af7,_0x4c492f){var _0x331ba9=moment()['unix']()[_0x014a('0x9d')]();var _0x3e7923=path['join'](config[_0x014a('0xd9')],'server',_0x014a('0x10c'),'tmp');var _0x387e49=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0x10d'),_0x014a('0x10c'),_0x014a('0x10e'));var _0x1c5606=path['join'](_0x3e7923,_0x331ba9);var _0x4b4336=util[_0x014a('0xe2')]('transcript-%d-%s.zip',_0x546af7[_0x014a('0xb2')]['id'],_0x331ba9);var _0x1b3f4d=path[_0x014a('0xd8')](_0x3e7923,_0x4b4336);var _0x5f58bd=[];_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0x76')],'as':'User','attributes':['id',_0x014a('0x41')],'raw':!![]});_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xca')],'as':_0x014a('0xcb'),'attributes':['id',_0x014a('0x10f'),_0x014a('0x110')],'raw':!![]});if(_0x546af7[_0x014a('0x4c')]['attachments']){_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xd4')],'as':'Attachment','raw':!![]});}var _0x5104b1=[{'model':db[_0x014a('0xe0')],'as':_0x014a('0xe1'),'attributes':['id',_0x014a('0x7b'),_0x014a('0xeb'),'direction',_0x014a('0xed'),_0x014a('0x87')],'include':_0x5f58bd}];_0x5104b1[_0x014a('0x46')]({'model':db[_0x014a('0xba')],'as':_0x014a('0x111'),'attributes':['id',_0x014a('0x38')]});_0x5104b1['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x014a('0x41')]});return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x546af7[_0x014a('0xb2')]['id']},'include':_0x5104b1})[_0x014a('0x1e')](handleEntityNotFound(_0x4c492f,null))['then'](function(_0x501d05){if(_0x501d05){var _0x48c669=_0x501d05[_0x014a('0x112')]({'plain':!![]});fs['mkdirSync'](_0x1c5606);var _0x5d4bae={'channel':_0x014a('0x113'),'account':_0x48c669[_0x014a('0x111')][_0x014a('0x38')],'agent':_0x48c669[_0x014a('0x114')]?_0x48c669[_0x014a('0x114')][_0x014a('0x41')]:_0x014a('0x115'),'createdAt':moment(_0x48c669[_0x014a('0xeb')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x48c669['closed']?moment(_0x48c669[_0x014a('0x116')])[_0x014a('0xe2')](_0x014a('0x103'))[_0x014a('0x9d')]():'','disposition':_0x48c669[_0x014a('0xce')],'chatInfo':{'browser':_0x48c669['browserName'],'os':_0x48c669[_0x014a('0x117')],'referer':_0x48c669[_0x014a('0x118')],'customerIp':_0x48c669['customerIp'],'customerPort':_0x48c669[_0x014a('0x119')]?_0x48c669[_0x014a('0x119')]:_0x014a('0x115')},'messages':_(_0x48c669[_0x014a('0xe1')])['tail']()[_0x014a('0x8c')]({'secret':![]})[_0x014a('0x40')](function(_0x5afb91){if(_0x5afb91[_0x014a('0xd4')]){var _0x172440=path[_0x014a('0xd8')](_0x387e49,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]);if(fs[_0x014a('0x11a')](_0x172440)){fs[_0x014a('0x11b')](_0x172440)[_0x014a('0x11c')](fs['createWriteStream'](path[_0x014a('0xd8')](_0x1c5606,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')])));}}return{'date':moment(_0x5afb91['createdAt'])['format'](_0x014a('0x103'))[_0x014a('0x9d')](),'sender':_0x5afb91[_0x014a('0xec')]==='out'?_0x5afb91[_0x014a('0x76')]?_0x5afb91[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4'):_0x5afb91[_0x014a('0xcb')][_0x014a('0x10f')]+(_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]?'\x20'+_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]:''),'body':_0x5afb91[_0x014a('0xd4')]?_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]:_0x5afb91[_0x014a('0x7b')],'direction':_0x5afb91[_0x014a('0xec')]===_0x014a('0x11d')?'A':'C','secret':_0x5afb91[_0x014a('0xed')],'read':_0x5afb91['read'],'attachment':_0x5afb91[_0x014a('0xd4')]};})[_0x014a('0x6d')]()};return ejs['renderFile'](path['join'](config['root'],_0x014a('0x10d'),_0x014a('0x11e'),'downloadInteraction.ejs'),{'interaction':_0x5d4bae})['then'](function(_0x374e3d){var _0x2d9178=path['join'](_0x1c5606,_0x014a('0x11f')+_0x48c669['id']+'-'+_0x331ba9+'.pdf');var _0x30c604={'path':_0x2d9178,'channel':'Chat','interactionId':_0x48c669['id']};return pdf['createPdfFromHTML'](_0x374e3d,_0x30c604);})[_0x014a('0x1e')](function(){return new BPromise(function(_0x321a17,_0x2f20e7){zipdir(_0x1c5606,{'saveTo':_0x1b3f4d},function(_0x18edd1,_0xcad1af){if(_0x18edd1)return _0x2f20e7(_0x18edd1);return _0x321a17(_0xcad1af);});})['then'](function(){return new BPromise(function(_0x42cd23,_0x82d77b){rimraf(_0x1c5606,function(_0x48bcec){if(_0x48bcec)_0x82d77b(_0x48bcec);return _0x42cd23();});});})[_0x014a('0x1e')](function(){return _0x4c492f[_0x014a('0xdc')](_0x1b3f4d,_0x4b4336,function(_0x1d8179){if(_0x1d8179){console[_0x014a('0x120')](_0x014a('0x121'),_0x1d8179);}else{fs[_0x014a('0x122')](_0x1b3f4d);}});});});}else{return _0x4c492f[_0x014a('0x36')](0xc8);}})['catch'](handleError(_0x4c492f,null));};
\ No newline at end of file
index 9b8b570..7a7bad7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9afd=['emit','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','length'];(function(_0x22f1cd,_0x118289){var _0x3765a7=function(_0x3afb8c){while(--_0x3afb8c){_0x22f1cd['push'](_0x22f1cd['shift']());}};_0x3765a7(++_0x118289);}(_0x9afd,0xbe));var _0xd9af=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0x9afd[_0x35485a];return _0x5148e6;};'use strict';var EventEmitter=require(_0xd9af('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xd9af('0x1')];var ChatMessage=require(_0xd9af('0x2'))['db'][_0xd9af('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xd9af('0x4')](0x0);var events={'afterCreate':_0xd9af('0x5'),'afterUpdate':_0xd9af('0x6'),'afterDestroy':'remove'};function emitEvent(_0x8f0ae3){return function(_0x3b5ec2,_0x362e57,_0x4ed1ac){_0x3b5ec2[_0xd9af('0x7')]({'attributes':['id'],'raw':!![]})[_0xd9af('0x8')](function(_0x3598fb){_0x3b5ec2[_0xd9af('0x9')](_0xd9af('0xa'),_0x3598fb[_0xd9af('0xb')](function(_0x1442e6){return{'id':_0x1442e6['id']};}));return ChatMessage[_0xd9af('0xc')]({'where':{'ChatInteractionId':_0x3b5ec2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x125070){_0x3b5ec2['setDataValue']('unreadMessages',_0x125070[_0xd9af('0xd')]);ChatInteractionEvents[_0xd9af('0xe')](_0x8f0ae3+':'+_0x3b5ec2['id'],_0x3b5ec2);ChatInteractionEvents[_0xd9af('0xe')](_0x8f0ae3,_0x3b5ec2);_0x4ed1ac(null);})['catch'](_0x4ed1ac(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xd9af('0xf')](e,emitEvent(event));}}module[_0xd9af('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xf0e9=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','then','Users','map','findAll','setDataValue'];(function(_0x17f022,_0x4c98bb){var _0x4a37d2=function(_0x3a354e){while(--_0x3a354e){_0x17f022['push'](_0x17f022['shift']());}};_0x4a37d2(++_0x4c98bb);}(_0xf0e9,0x96));var _0x9f0e=function(_0x22ae5b,_0xb48e39){_0x22ae5b=_0x22ae5b-0x0;var _0x33900f=_0xf0e9[_0x22ae5b];return _0x33900f;};'use strict';var EventEmitter=require(_0x9f0e('0x0'));var ChatInteraction=require(_0x9f0e('0x1'))['db'][_0x9f0e('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x9f0e('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9f0e('0x4'),'afterUpdate':_0x9f0e('0x5'),'afterDestroy':_0x9f0e('0x6')};function emitEvent(_0x56c504){return function(_0x30e060,_0x1fd3fc,_0x106a8e){_0x30e060['getUsers']({'attributes':['id'],'raw':!![]})[_0x9f0e('0x7')](function(_0x3a2b52){_0x30e060['setDataValue'](_0x9f0e('0x8'),_0x3a2b52[_0x9f0e('0x9')](function(_0x334727){return{'id':_0x334727['id']};}));return ChatMessage[_0x9f0e('0xa')]({'where':{'ChatInteractionId':_0x30e060['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ad0a2){_0x30e060[_0x9f0e('0xb')](_0x9f0e('0xc'),_0x4ad0a2[_0x9f0e('0xd')]);ChatInteractionEvents[_0x9f0e('0xe')](_0x56c504+':'+_0x30e060['id'],_0x30e060);ChatInteractionEvents[_0x9f0e('0xe')](_0x56c504,_0x30e060);_0x106a8e(null);})[_0x9f0e('0xf')](_0x106a8e(null));};}for(var e in events){if(events[_0x9f0e('0x10')](e)){var event=events[e];ChatInteraction[_0x9f0e('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
index b8ab547..e6b6561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a2e=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x253ba8,_0x498a09){var _0x22e9b0=function(_0xd562ce){while(--_0xd562ce){_0x253ba8['push'](_0x253ba8['shift']());}};_0x22e9b0(++_0x498a09);}(_0x7a2e,0xf4));var _0xe7a2=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x7a2e[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xe7a2('0x0'));var util=require(_0xe7a2('0x1'));var logger=require(_0xe7a2('0x2'))(_0xe7a2('0x3'));var moment=require(_0xe7a2('0x4'));var BPromise=require(_0xe7a2('0x5'));var rp=require(_0xe7a2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe7a2('0x7'));var attributes=require(_0xe7a2('0x8'));module[_0xe7a2('0x9')]=function(_0x53a7ff,_0x3cf5a2){return _0x53a7ff[_0xe7a2('0xa')](_0xe7a2('0xb'),attributes,{'tableName':_0xe7a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x292cd1,_0x3e242d,_0x1042f6){if(_0x292cd1[_0xe7a2('0xd')]('closed')){_0x292cd1[_0xe7a2('0xe')]=moment()[_0xe7a2('0xf')](_0xe7a2('0x10'));}_0x1042f6(null,_0x292cd1);}},'charset':'utf8mb4','collate':_0xe7a2('0x11')});};
\ No newline at end of file
+var _0x2ef7=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api','request-promise'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0x2ef7,0x1e6));var _0x72ef=function(_0x1e17e9,_0xd02714){_0x1e17e9=_0x1e17e9-0x0;var _0xd972eb=_0x2ef7[_0x1e17e9];return _0xd972eb;};'use strict';var _=require('lodash');var util=require(_0x72ef('0x0'));var logger=require(_0x72ef('0x1'))(_0x72ef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x72ef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72ef('0x4'));var config=require(_0x72ef('0x5'));var attributes=require(_0x72ef('0x6'));module[_0x72ef('0x7')]=function(_0x45e295,_0xc4be74){return _0x45e295[_0x72ef('0x8')]('ChatInteraction',attributes,{'tableName':_0x72ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17542c,_0x58e69a,_0x4d2522){if(_0x17542c[_0x72ef('0xa')]('closed')){_0x17542c[_0x72ef('0xb')]=moment()['format'](_0x72ef('0xc'));}_0x4d2522(null,_0x17542c);}},'charset':_0x72ef('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index f94565f..e0e3f01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5061=['redis','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','UpdateChatInteraction','update','options','raw','where','attributes','AddTagsToChatInteraction','ChatInteraction','body','omit','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults'];(function(_0x48dee2,_0x105849){var _0x18794d=function(_0x698d8){while(--_0x698d8){_0x48dee2['push'](_0x48dee2['shift']());}};_0x18794d(++_0x105849);}(_0x5061,0x1ad));var _0x1506=function(_0x4cdcdc,_0x34eac7){_0x4cdcdc=_0x4cdcdc-0x0;var _0x4704ce=_0x5061[_0x4cdcdc];return _0x4704ce;};'use strict';var _=require(_0x1506('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1506('0x1'));var rs=require(_0x1506('0x2'));var fs=require('fs');var Redis=require(_0x1506('0x3'));var db=require(_0x1506('0x4'))['db'];var utils=require(_0x1506('0x5'));var logger=require('../../config/logger')(_0x1506('0x6'));var config=require(_0x1506('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1506('0x8')][_0x1506('0x9')]({'port':0x232a});config['redis']=_[_0x1506('0xa')](config[_0x1506('0xb')],{'host':_0x1506('0xc'),'port':0x18eb});var socket=require(_0x1506('0xd'))(new Redis(config[_0x1506('0xb')]));require('./chatInteraction.socket')[_0x1506('0xe')](socket);function respondWithRpcPromise(_0x490637,_0x55cf0a,_0x34ef8c){return new BPromise(function(_0x53178e,_0x1773ef){return client[_0x1506('0xf')](_0x490637,_0x34ef8c)[_0x1506('0x10')](function(_0x193395){logger[_0x1506('0x11')](_0x1506('0x12'),_0x55cf0a,'request\x20sent');logger[_0x1506('0x13')](_0x1506('0x14'),_0x55cf0a,_0x1506('0x15'),JSON[_0x1506('0x16')](_0x193395));if(_0x193395['error']){if(_0x193395['error'][_0x1506('0x17')]===0x1f4){logger[_0x1506('0x18')](_0x1506('0x12'),_0x55cf0a,_0x193395[_0x1506('0x18')][_0x1506('0x19')]);return _0x1773ef(_0x193395['error'][_0x1506('0x19')]);}logger[_0x1506('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x55cf0a,_0x193395[_0x1506('0x18')][_0x1506('0x19')]);return _0x53178e(_0x193395['error'][_0x1506('0x19')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x55cf0a,_0x1506('0x15'));_0x53178e(_0x193395['result'][_0x1506('0x19')]);}})[_0x1506('0x1a')](function(_0x263ca8){logger[_0x1506('0x18')](_0x1506('0x12'),_0x55cf0a,_0x263ca8);_0x1773ef(_0x263ca8);});});}exports[_0x1506('0x1b')]=function(_0x59d52b){var _0x705eea=this;return new Promise(function(_0x581403,_0x3bcece){return db['ChatInteraction'][_0x1506('0x1c')](_0x59d52b['body'],{'raw':_0x59d52b[_0x1506('0x1d')]?_0x59d52b[_0x1506('0x1d')][_0x1506('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d52b[_0x1506('0x1d')]?_0x59d52b[_0x1506('0x1d')][_0x1506('0x1f')]||null:null,'attributes':_0x59d52b[_0x1506('0x1d')]?_0x59d52b[_0x1506('0x1d')][_0x1506('0x20')]||null:null,'limit':_0x59d52b[_0x1506('0x1d')]?_0x59d52b[_0x1506('0x1d')]['limit']||null:null})[_0x1506('0x10')](function(_0x33ffbc){logger[_0x1506('0x11')](_0x1506('0x1b'),_0x59d52b);logger[_0x1506('0x13')](_0x1506('0x1b'),_0x59d52b,JSON[_0x1506('0x16')](_0x33ffbc));_0x581403(_0x33ffbc);})['catch'](function(_0x4fc008){logger['error'](_0x1506('0x1b'),_0x4fc008['message'],_0x59d52b);_0x3bcece(_0x705eea[_0x1506('0x18')](0x1f4,_0x4fc008[_0x1506('0x19')]));});});};exports[_0x1506('0x21')]=function(_0x4f5e40){return new Promise(function(_0x51dfe9,_0x4d31ff){return db[_0x1506('0x22')]['find']({'where':_0x4f5e40[_0x1506('0x1d')]?_0x4f5e40[_0x1506('0x1d')][_0x1506('0x1f')]||null:null})[_0x1506('0x10')](function(_0x3783cb){if(_0x3783cb){return _0x3783cb['addTags'](_0x4f5e40[_0x1506('0x23')]['ids'],_[_0x1506('0x24')](_0x4f5e40['body'],[_0x1506('0x25'),'id'])||{});}})[_0x1506('0x26')](function(_0x445c2b){logger['info']('AddTags',_0x4f5e40);logger[_0x1506('0x13')](_0x1506('0x27'),_0x4f5e40,JSON[_0x1506('0x16')](_0x445c2b));_0x51dfe9(_0x445c2b);})[_0x1506('0x1a')](function(_0x11983f){logger[_0x1506('0x18')](_0x1506('0x27'),_0x11983f[_0x1506('0x19')],_0x4f5e40);_0x4d31ff(_this['error'](0x1f4,_0x11983f[_0x1506('0x19')]));});});};
\ No newline at end of file
+var _0xa2dc=['AddTagsToChatInteraction','ChatInteraction','find','addTags','body','ids','omit','spread','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','./chatInteraction.socket','register','then','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','info','stringify'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa2dc,0x182));var _0xca2d=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0xa2dc[_0x13ac10];return _0x28eda2;};'use strict';var _=require(_0xca2d('0x0'));var util=require('util');var moment=require(_0xca2d('0x1'));var BPromise=require(_0xca2d('0x2'));var rs=require(_0xca2d('0x3'));var fs=require('fs');var Redis=require(_0xca2d('0x4'));var db=require(_0xca2d('0x5'))['db'];var utils=require(_0xca2d('0x6'));var logger=require('../../config/logger')(_0xca2d('0x7'));var config=require('../../config/environment');var jayson=require(_0xca2d('0x8'));var client=jayson[_0xca2d('0x9')][_0xca2d('0xa')]({'port':0x232a});config['redis']=_[_0xca2d('0xb')](config[_0xca2d('0xc')],{'host':_0xca2d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca2d('0xc')]));require(_0xca2d('0xe'))[_0xca2d('0xf')](socket);function respondWithRpcPromise(_0x1a6051,_0x42947f,_0x1f9b12){return new BPromise(function(_0x7db430,_0x368321){return client['request'](_0x1a6051,_0x1f9b12)[_0xca2d('0x10')](function(_0x4e1d6e){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x42947f,_0xca2d('0x11'));logger[_0xca2d('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x42947f,_0xca2d('0x11'),JSON['stringify'](_0x4e1d6e));if(_0x4e1d6e[_0xca2d('0x13')]){if(_0x4e1d6e[_0xca2d('0x13')][_0xca2d('0x14')]===0x1f4){logger[_0xca2d('0x13')](_0xca2d('0x15'),_0x42947f,_0x4e1d6e[_0xca2d('0x13')][_0xca2d('0x16')]);return _0x368321(_0x4e1d6e['error'][_0xca2d('0x16')]);}logger[_0xca2d('0x13')](_0xca2d('0x15'),_0x42947f,_0x4e1d6e[_0xca2d('0x13')][_0xca2d('0x16')]);return _0x7db430(_0x4e1d6e['error'][_0xca2d('0x16')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x42947f,_0xca2d('0x11'));_0x7db430(_0x4e1d6e[_0xca2d('0x17')][_0xca2d('0x16')]);}})[_0xca2d('0x18')](function(_0x52e841){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x42947f,_0x52e841);_0x368321(_0x52e841);});});}exports[_0xca2d('0x19')]=function(_0x386da4){var _0x1abd62=this;return new Promise(function(_0x503138,_0x186282){return db['ChatInteraction'][_0xca2d('0x1a')](_0x386da4['body'],{'raw':_0x386da4[_0xca2d('0x1b')]?_0x386da4['options'][_0xca2d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x386da4[_0xca2d('0x1b')]?_0x386da4[_0xca2d('0x1b')][_0xca2d('0x1d')]||null:null,'attributes':_0x386da4['options']?_0x386da4[_0xca2d('0x1b')][_0xca2d('0x1e')]||null:null,'limit':_0x386da4[_0xca2d('0x1b')]?_0x386da4[_0xca2d('0x1b')][_0xca2d('0x1f')]||null:null})[_0xca2d('0x10')](function(_0x201445){logger[_0xca2d('0x20')]('UpdateChatInteraction',_0x386da4);logger['debug'](_0xca2d('0x19'),_0x386da4,JSON[_0xca2d('0x21')](_0x201445));_0x503138(_0x201445);})[_0xca2d('0x18')](function(_0x63dd4b){logger[_0xca2d('0x13')]('UpdateChatInteraction',_0x63dd4b[_0xca2d('0x16')],_0x386da4);_0x186282(_0x1abd62['error'](0x1f4,_0x63dd4b[_0xca2d('0x16')]));});});};exports[_0xca2d('0x22')]=function(_0x5a8b1d){return new Promise(function(_0x1b76a3,_0x2bf5c6){return db[_0xca2d('0x23')][_0xca2d('0x24')]({'where':_0x5a8b1d['options']?_0x5a8b1d['options'][_0xca2d('0x1d')]||null:null})[_0xca2d('0x10')](function(_0x33cdb0){if(_0x33cdb0){return _0x33cdb0[_0xca2d('0x25')](_0x5a8b1d[_0xca2d('0x26')][_0xca2d('0x27')],_[_0xca2d('0x28')](_0x5a8b1d[_0xca2d('0x26')],['ids','id'])||{});}})[_0xca2d('0x29')](function(_0x2db8e8){logger[_0xca2d('0x20')]('AddTags',_0x5a8b1d);logger['debug']('AddTags',_0x5a8b1d,JSON[_0xca2d('0x21')](_0x2db8e8));_0x1b76a3(_0x2db8e8);})['catch'](function(_0x4754c1){logger[_0xca2d('0x13')]('AddTags',_0x4754c1[_0xca2d('0x16')],_0x5a8b1d);_0x2bf5c6(_this[_0xca2d('0x13')](0x1f4,_0x4754c1[_0xca2d('0x16')]));});});};
\ No newline at end of file
index 709c51a..350671c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x016e=['length','chatInteraction:','./chatInteraction.events','save','emit','removeListener','register'];(function(_0x26e06f,_0x3631b2){var _0x5bfe0d=function(_0x49e910){while(--_0x49e910){_0x26e06f['push'](_0x26e06f['shift']());}};_0x5bfe0d(++_0x3631b2);}(_0x016e,0x1ad));var _0xe016=function(_0x396651,_0x415904){_0x396651=_0x396651-0x0;var _0x30481c=_0x016e[_0x396651];return _0x30481c;};'use strict';var ChatInteractionEvents=require(_0xe016('0x0'));var events=[_0xe016('0x1'),'remove','update'];function createListener(_0x496e7a,_0x21414f){return function(_0x22e491){_0x21414f[_0xe016('0x2')](_0x496e7a,_0x22e491);};}function removeListener(_0x1f1d37,_0x226b84){return function(){ChatInteractionEvents[_0xe016('0x3')](_0x1f1d37,_0x226b84);};}exports[_0xe016('0x4')]=function(_0x56dc57){for(var _0x2f9165=0x0,_0x4228b9=events[_0xe016('0x5')];_0x2f9165<_0x4228b9;_0x2f9165++){var _0x505a02=events[_0x2f9165];var _0x3199b0=createListener(_0xe016('0x6')+_0x505a02,_0x56dc57);ChatInteractionEvents['on'](_0x505a02,_0x3199b0);}};
\ No newline at end of file
+var _0x0cf7=['save','update','emit','register','./chatInteraction.events'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0x0cf7,0x1c1));var _0x70cf=function(_0x1bb700,_0x5bb9f1){_0x1bb700=_0x1bb700-0x0;var _0x46e905=_0x0cf7[_0x1bb700];return _0x46e905;};'use strict';var ChatInteractionEvents=require(_0x70cf('0x0'));var events=[_0x70cf('0x1'),'remove',_0x70cf('0x2')];function createListener(_0x39443a,_0x566d0c){return function(_0x814960){_0x566d0c[_0x70cf('0x3')](_0x39443a,_0x814960);};}function removeListener(_0x5cf3cc,_0xcdf659){return function(){ChatInteractionEvents['removeListener'](_0x5cf3cc,_0xcdf659);};}exports[_0x70cf('0x4')]=function(_0x3a276c){for(var _0x38b752=0x0,_0x320cc1=events['length'];_0x38b752<_0x320cc1;_0x38b752++){var _0x100bb1=events[_0x38b752];var _0x5f3777=createListener('chatInteraction:'+_0x100bb1,_0x3a276c);ChatInteractionEvents['on'](_0x100bb1,_0x5f3777);}};
\ No newline at end of file
index 2345d54..050dbac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d6e=['show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','now','/:id/attachment_upload','addMessage','/:id/tags','addTags','put','/:id','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chat','chatinteraction:destroy','destroy','removeTags','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x203c8c,_0x2728e5){var _0x1e5322=function(_0x4f2814){while(--_0x4f2814){_0x203c8c['push'](_0x203c8c['shift']());}};_0x1e5322(++_0x2728e5);}(_0x3d6e,0xbd));var _0xe3d6=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x3d6e[_0x2aec52];return _0x3b8835;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe3d6('0x0'));var express=require('express');var router=express[_0xe3d6('0x1')]();var fs_extra=require(_0xe3d6('0x2'));var auth=require(_0xe3d6('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe3d6('0x4'));var controller=require(_0xe3d6('0x5'));router[_0xe3d6('0x6')]('/',auth[_0xe3d6('0x7')](),controller[_0xe3d6('0x8')]);router[_0xe3d6('0x6')](_0xe3d6('0x9'),auth[_0xe3d6('0x7')](),controller[_0xe3d6('0xa')]);router[_0xe3d6('0x6')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0xe3d6('0xb')]);router[_0xe3d6('0x6')](_0xe3d6('0xc'),auth[_0xe3d6('0xd')](),controller[_0xe3d6('0xe')]);router['get'](_0xe3d6('0xf'),auth[_0xe3d6('0x7')](),controller[_0xe3d6('0x10')]);router[_0xe3d6('0x6')](_0xe3d6('0x11'),auth[_0xe3d6('0xd')](),controller[_0xe3d6('0x12')]);router['get'](_0xe3d6('0x13'),auth[_0xe3d6('0x7')](),controller[_0xe3d6('0x14')]);router[_0xe3d6('0x15')]('/',auth[_0xe3d6('0x7')](),controller[_0xe3d6('0x16')]);router[_0xe3d6('0x15')](_0xe3d6('0x17'),auth[_0xe3d6('0x7')](),controller[_0xe3d6('0x18')]);var upload=multer({'storage':multer[_0xe3d6('0x19')]({'destination':function(_0x3e8c8a,_0x4e7b85,_0x3f66d3){_0x3f66d3(null,path[_0xe3d6('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x5061df,_0xdaaba,_0x18dfb9){_0x18dfb9(null,util[_0xe3d6('0x1b')](_0xe3d6('0x1c'),Date[_0xe3d6('0x1d')](),_0xdaaba['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe3d6('0x15')](_0xe3d6('0x1e'),upload['single']('file'),controller['attachmentUpload']);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xe3d6('0x1f')]);router[_0xe3d6('0x15')](_0xe3d6('0x20'),auth[_0xe3d6('0x7')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0xe3d6('0x21')]);router[_0xe3d6('0x22')](_0xe3d6('0x23'),auth[_0xe3d6('0x7')](),interaction[_0xe3d6('0x24')]('chat',_0xe3d6('0x25')),controller[_0xe3d6('0x26')]);router[_0xe3d6('0x22')](_0xe3d6('0x27'),controller[_0xe3d6('0x28')]);router[_0xe3d6('0x22')]('/:id/abandon',auth[_0xe3d6('0xd')](),controller[_0xe3d6('0x29')]);router[_0xe3d6('0x22')](_0xe3d6('0x2a'),controller[_0xe3d6('0x2b')]);router[_0xe3d6('0x2c')](_0xe3d6('0x23'),auth['isAuthenticated'](),interaction[_0xe3d6('0x24')](_0xe3d6('0x2d'),_0xe3d6('0x2e')),controller[_0xe3d6('0x2f')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0xe3d6('0x30')]);module[_0xe3d6('0x31')]=router;
\ No newline at end of file
+var _0x5204=['create','/:id/vidaoo','diskStorage','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post'];(function(_0x25f8bc,_0x1f9a64){var _0x218d62=function(_0x56b34c){while(--_0x56b34c){_0x25f8bc['push'](_0x25f8bc['shift']());}};_0x218d62(++_0x1f9a64);}(_0x5204,0xe2));var _0x4520=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x5204[_0x1a89a1];return _0x3d5b46;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4520('0x0'));var timeout=require(_0x4520('0x1'));var express=require(_0x4520('0x2'));var router=express[_0x4520('0x3')]();var fs_extra=require(_0x4520('0x4'));var auth=require(_0x4520('0x5'));var interaction=require(_0x4520('0x6'));var config=require(_0x4520('0x7'));var controller=require(_0x4520('0x8'));router['get']('/',auth[_0x4520('0x9')](),controller[_0x4520('0xa')]);router['get'](_0x4520('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4520('0xc')](_0x4520('0xd'),auth[_0x4520('0xe')](),controller[_0x4520('0xf')]);router['get'](_0x4520('0x10'),auth[_0x4520('0xe')](),controller[_0x4520('0x11')]);router[_0x4520('0xc')](_0x4520('0x12'),auth[_0x4520('0x9')](),controller[_0x4520('0x13')]);router[_0x4520('0xc')](_0x4520('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x4520('0x15')]);router[_0x4520('0xc')]('/:id/download',auth[_0x4520('0x9')](),controller[_0x4520('0x16')]);router[_0x4520('0x17')]('/',auth[_0x4520('0x9')](),controller[_0x4520('0x18')]);router[_0x4520('0x17')](_0x4520('0x19'),auth[_0x4520('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4520('0x1a')]({'destination':function(_0x52af68,_0x4ce671,_0x22dfa5){_0x22dfa5(null,path['join'](config['root'],_0x4520('0x1b')));},'filename':function(_0x329fb9,_0x4e9f6d,_0x3981ea){_0x3981ea(null,util[_0x4520('0x1c')]('%s-%s',Date[_0x4520('0x1d')](),_0x4e9f6d[_0x4520('0x1e')][_0x4520('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4520('0x17')](_0x4520('0x20'),upload['single'](_0x4520('0x21')),controller[_0x4520('0x22')]);router[_0x4520('0x17')](_0x4520('0x12'),auth[_0x4520('0xe')](),controller[_0x4520('0x23')]);router[_0x4520('0x17')](_0x4520('0x24'),auth[_0x4520('0x9')](),interaction[_0x4520('0x25')](_0x4520('0x26'),'chatinteraction:addtags'),controller[_0x4520('0x27')]);router['put'](_0x4520('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x4520('0x26'),'chatinteraction:update'),controller[_0x4520('0x28')]);router[_0x4520('0x29')](_0x4520('0x2a'),controller[_0x4520('0x2b')]);router['put'](_0x4520('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x4520('0x2d')]);router[_0x4520('0x29')]('/:id/close',controller['close']);router[_0x4520('0x2e')](_0x4520('0xd'),auth[_0x4520('0x9')](),interaction[_0x4520('0x25')]('chat',_0x4520('0x2f')),controller[_0x4520('0x30')]);router[_0x4520('0x2e')]('/:id/tags',auth[_0x4520('0x9')](),controller['removeTags']);module[_0x4520('0x31')]=router;
\ No newline at end of file
index d82c38f..72143bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39f3=['TEXT','medium','BOOLEAN','sequelize','exports'];(function(_0x550ee1,_0x3197ff){var _0x1d5c69=function(_0x2fa30b){while(--_0x2fa30b){_0x550ee1['push'](_0x550ee1['shift']());}};_0x1d5c69(++_0x3197ff);}(_0x39f3,0xe4));var _0x339f=function(_0x4797b1,_0x59acd3){_0x4797b1=_0x4797b1-0x0;var _0xf03172=_0x39f3[_0x4797b1];return _0xf03172;};'use strict';var Sequelize=require(_0x339f('0x0'));module[_0x339f('0x1')]={'body':{'type':Sequelize[_0x339f('0x2')](_0x339f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x339f('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7cc6=['TEXT','medium','BOOLEAN','INTEGER'];(function(_0xb5cb42,_0x2d6784){var _0x10511d=function(_0x22ea02){while(--_0x22ea02){_0xb5cb42['push'](_0xb5cb42['shift']());}};_0x10511d(++_0x2d6784);}(_0x7cc6,0xcc));var _0x67cc=function(_0x54eafa,_0x3f0cf1){_0x54eafa=_0x54eafa-0x0;var _0x1ab927=_0x7cc6[_0x54eafa];return _0x1ab927;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x67cc('0x0')](_0x67cc('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x67cc('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x67cc('0x3')]}};
\ No newline at end of file
index e91a983..d18e56e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b6e=['nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','getUsers','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x23b439,_0x22c149){var _0x77fa4d=function(_0x3ace4a){while(--_0x3ace4a){_0x23b439['push'](_0x23b439['shift']());}};_0x77fa4d(++_0x22c149);}(_0x9b6e,0xa4));var _0xe9b6=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9b6e[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0xe9b6('0x0'));var rimraf=require(_0xe9b6('0x1'));var zipdir=require(_0xe9b6('0x2'));var jsonpatch=require(_0xe9b6('0x3'));var rp=require(_0xe9b6('0x4'));var moment=require(_0xe9b6('0x5'));var BPromise=require(_0xe9b6('0x6'));var Mustache=require('mustache');var util=require(_0xe9b6('0x7'));var path=require(_0xe9b6('0x8'));var sox=require(_0xe9b6('0x9'));var csv=require(_0xe9b6('0xa'));var ejs=require(_0xe9b6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9b6('0xc'));var squel=require(_0xe9b6('0xd'));var crypto=require(_0xe9b6('0xe'));var jsforce=require(_0xe9b6('0xf'));var deskjs=require(_0xe9b6('0x10'));var toCsv=require(_0xe9b6('0xa'));var querystring=require(_0xe9b6('0x11'));var Papa=require('papaparse');var Redis=require(_0xe9b6('0x12'));var authService=require(_0xe9b6('0x13'));var qs=require(_0xe9b6('0x14'));var as=require(_0xe9b6('0x15'));var hardwareService=require(_0xe9b6('0x16'));var logger=require('../../config/logger')(_0xe9b6('0x17'));var utils=require(_0xe9b6('0x18'));var config=require(_0xe9b6('0x19'));var licenseUtil=require(_0xe9b6('0x1a'));var db=require(_0xe9b6('0x1b'))['db'];config[_0xe9b6('0x1c')]=_['defaults'](config['redis'],{'host':_0xe9b6('0x1d'),'port':0x18eb});var socket=require(_0xe9b6('0x1e'))(new Redis(config[_0xe9b6('0x1c')]));require(_0xe9b6('0x1f'))[_0xe9b6('0x20')](socket);function respondWithStatusCode(_0x154f22,_0x217652){_0x217652=_0x217652||0xcc;return function(_0x13e37a){if(_0x13e37a){return _0x154f22['sendStatus'](_0x217652);}return _0x154f22[_0xe9b6('0x21')](_0x217652)['end']();};}function respondWithResult(_0xc9291,_0x25fea4){_0x25fea4=_0x25fea4||0xc8;return function(_0x1114fd){if(_0x1114fd){return _0xc9291['status'](_0x25fea4)[_0xe9b6('0x22')](_0x1114fd);}};}function respondWithFilteredResult(_0x371297,_0x5a50c0){return function(_0x40ce47){if(_0x40ce47){var _0x485d6a=typeof _0x5a50c0[_0xe9b6('0x23')]===_0xe9b6('0x24')&&typeof _0x5a50c0[_0xe9b6('0x25')]===_0xe9b6('0x24');var _0x50b19f=_0x40ce47[_0xe9b6('0x26')];var _0x3cf822=_0x485d6a?0x0:_0x5a50c0[_0xe9b6('0x23')];var _0x453ffe=_0x485d6a?_0x40ce47['count']:_0x5a50c0[_0xe9b6('0x23')]+_0x5a50c0[_0xe9b6('0x25')];var _0x5b7239;if(_0x453ffe>=_0x50b19f){_0x453ffe=_0x50b19f;_0x5b7239=0xc8;}else{_0x5b7239=0xce;}_0x371297[_0xe9b6('0x21')](_0x5b7239);return _0x371297[_0xe9b6('0x27')](_0xe9b6('0x28'),_0x3cf822+'-'+_0x453ffe+'/'+_0x50b19f)[_0xe9b6('0x22')](_0x40ce47);}return null;};}function patchUpdates(_0x2a9860){return function(_0x1aee35){try{jsonpatch[_0xe9b6('0x29')](_0x1aee35,_0x2a9860,!![]);}catch(_0x5d7e06){return BPromise[_0xe9b6('0x2a')](_0x5d7e06);}return _0x1aee35['save']();};}function saveUpdates(_0x26f69c,_0x28f0e2){return function(_0x134906){if(_0x134906){return _0x134906[_0xe9b6('0x2b')](_0x26f69c)[_0xe9b6('0x2c')](function(_0x206828){return _0x206828;});}return null;};}function removeEntity(_0x596fba,_0x4f5f85){return function(_0x4b68cb){if(_0x4b68cb){return _0x4b68cb['destroy']()[_0xe9b6('0x2c')](function(){_0x596fba[_0xe9b6('0x21')](0xcc)[_0xe9b6('0x2d')]();});}};}function handleEntityNotFound(_0x77d2a,_0x1545f6){return function(_0x1eeb57){if(!_0x1eeb57){_0x77d2a['sendStatus'](0x194);}return _0x1eeb57;};}function handleError(_0x339ea2,_0x557e22){_0x557e22=_0x557e22||0x1f4;return function(_0x3d350f){logger[_0xe9b6('0x2e')](_0x3d350f[_0xe9b6('0x2f')]);if(_0x3d350f[_0xe9b6('0x30')]){delete _0x3d350f[_0xe9b6('0x30')];}_0x339ea2['status'](_0x557e22)[_0xe9b6('0x31')](_0x3d350f);};}exports[_0xe9b6('0x32')]=function(_0x3d1bce,_0x250607){var _0x887356={},_0x2bbbc4={},_0x159d3e={'count':0x0,'rows':[]};var _0x3ea210=_[_0xe9b6('0x33')](db[_0xe9b6('0x34')][_0xe9b6('0x35')],function(_0x2b821f){return{'name':_0x2b821f[_0xe9b6('0x36')],'type':_0x2b821f[_0xe9b6('0x37')][_0xe9b6('0x38')]};});_0x2bbbc4[_0xe9b6('0x39')]=_[_0xe9b6('0x33')](_0x3ea210,'name');_0x2bbbc4[_0xe9b6('0x3a')]=_[_0xe9b6('0x3b')](_0x3d1bce[_0xe9b6('0x3a')]);_0x2bbbc4[_0xe9b6('0x3c')]=_[_0xe9b6('0x3d')](_0x2bbbc4['model'],_0x2bbbc4['query']);_0x887356[_0xe9b6('0x3e')]=_['intersection'](_0x2bbbc4[_0xe9b6('0x39')],qs[_0xe9b6('0x3f')](_0x3d1bce[_0xe9b6('0x3a')][_0xe9b6('0x3f')]));_0x887356[_0xe9b6('0x3e')]=_0x887356['attributes'][_0xe9b6('0x40')]?_0x887356[_0xe9b6('0x3e')]:_0x2bbbc4[_0xe9b6('0x39')];if(!_0x3d1bce['query'][_0xe9b6('0x41')](_0xe9b6('0x42'))){_0x887356['limit']=qs['limit'](_0x3d1bce[_0xe9b6('0x3a')][_0xe9b6('0x25')]);_0x887356[_0xe9b6('0x23')]=qs['offset'](_0x3d1bce[_0xe9b6('0x3a')][_0xe9b6('0x23')]);}_0x887356['order']=qs[_0xe9b6('0x43')](_0x3d1bce[_0xe9b6('0x3a')][_0xe9b6('0x43')]);_0x887356[_0xe9b6('0x44')]=qs[_0xe9b6('0x3c')](_[_0xe9b6('0x45')](_0x3d1bce['query'],_0x2bbbc4[_0xe9b6('0x3c')]),_0x3ea210);if(_0x3d1bce[_0xe9b6('0x3a')]['filter']){_0x887356[_0xe9b6('0x44')]=_[_0xe9b6('0x46')](_0x887356[_0xe9b6('0x44')],{'$or':_[_0xe9b6('0x33')](_0x3ea210,function(_0x240f77){if(_0x240f77[_0xe9b6('0x37')]!==_0xe9b6('0x47')){var _0x305032={};_0x305032[_0x240f77[_0xe9b6('0x30')]]={'$like':'%'+_0x3d1bce[_0xe9b6('0x3a')][_0xe9b6('0x48')]+'%'};return _0x305032;}})});}_0x887356=_[_0xe9b6('0x46')]({},_0x887356,_0x3d1bce[_0xe9b6('0x49')]);var _0x10c9c5={'where':_0x887356[_0xe9b6('0x44')]};return db['ChatInternalMessage']['count'](_0x10c9c5)['then'](function(_0x413efd){_0x159d3e['count']=_0x413efd;if(_0x3d1bce[_0xe9b6('0x3a')][_0xe9b6('0x4a')]){_0x887356[_0xe9b6('0x4b')]=[{'all':!![]}];}return db[_0xe9b6('0x34')][_0xe9b6('0x4c')](_0x887356);})[_0xe9b6('0x2c')](function(_0x36c718){_0x159d3e[_0xe9b6('0x4d')]=_0x36c718;return _0x159d3e;})[_0xe9b6('0x2c')](respondWithFilteredResult(_0x250607,_0x887356))['catch'](handleError(_0x250607,null));};exports['show']=function(_0x2ac7fa,_0x4e52ec){var _0x403cb2={'raw':!![],'where':{'id':_0x2ac7fa[_0xe9b6('0x4e')]['id']}},_0x340501={};_0x340501['model']=_[_0xe9b6('0x3b')](db[_0xe9b6('0x34')][_0xe9b6('0x35')]);_0x340501[_0xe9b6('0x3a')]=_[_0xe9b6('0x3b')](_0x2ac7fa[_0xe9b6('0x3a')]);_0x340501[_0xe9b6('0x3c')]=_[_0xe9b6('0x3d')](_0x340501[_0xe9b6('0x39')],_0x340501['query']);_0x403cb2[_0xe9b6('0x3e')]=_['intersection'](_0x340501[_0xe9b6('0x39')],qs['fields'](_0x2ac7fa[_0xe9b6('0x3a')][_0xe9b6('0x3f')]));_0x403cb2[_0xe9b6('0x3e')]=_0x403cb2[_0xe9b6('0x3e')][_0xe9b6('0x40')]?_0x403cb2[_0xe9b6('0x3e')]:_0x340501[_0xe9b6('0x39')];if(_0x2ac7fa[_0xe9b6('0x3a')][_0xe9b6('0x4a')]){_0x403cb2[_0xe9b6('0x4b')]=[{'all':!![]}];}_0x403cb2=_[_0xe9b6('0x46')]({},_0x403cb2,_0x2ac7fa[_0xe9b6('0x49')]);return db[_0xe9b6('0x34')][_0xe9b6('0x4f')](_0x403cb2)['then'](handleEntityNotFound(_0x4e52ec,null))[_0xe9b6('0x2c')](respondWithResult(_0x4e52ec,null))[_0xe9b6('0x50')](handleError(_0x4e52ec,null));};exports[_0xe9b6('0x51')]=function(_0x5c6ae0,_0xc4c542){return db[_0xe9b6('0x34')][_0xe9b6('0x51')](_0x5c6ae0[_0xe9b6('0x52')],{})[_0xe9b6('0x2c')](respondWithResult(_0xc4c542,0xc9))[_0xe9b6('0x50')](handleError(_0xc4c542,null));};exports[_0xe9b6('0x2b')]=function(_0x40a1de,_0x1b2bb8){if(_0x40a1de[_0xe9b6('0x52')]['id']){delete _0x40a1de['body']['id'];}return db[_0xe9b6('0x34')][_0xe9b6('0x4f')]({'where':{'id':_0x40a1de[_0xe9b6('0x4e')]['id']}})[_0xe9b6('0x2c')](handleEntityNotFound(_0x1b2bb8,null))[_0xe9b6('0x2c')](saveUpdates(_0x40a1de[_0xe9b6('0x52')],null))['then'](respondWithResult(_0x1b2bb8,null))[_0xe9b6('0x50')](handleError(_0x1b2bb8,null));};exports[_0xe9b6('0x53')]=function(_0x41f632,_0x592a04){return db[_0xe9b6('0x34')][_0xe9b6('0x4f')]({'where':{'id':_0x41f632['params']['id']}})['then'](handleEntityNotFound(_0x592a04,null))[_0xe9b6('0x2c')](removeEntity(_0x592a04,null))[_0xe9b6('0x50')](handleError(_0x592a04,null));};exports[_0xe9b6('0x54')]=function(_0x316e4b,_0x2e2ff8){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x2e2ff8,null))[_0xe9b6('0x50')](handleError(_0x2e2ff8,null));};function wrapUser(_0x13b6a7){return function(_0x5a7b13){var _0x486194=_0x13b6a7[_0xe9b6('0x55')]({'plain':!![]});_0x486194[_0xe9b6('0x56')]=[];if(_0x5a7b13){_0x486194[_0xe9b6('0x57')]=_0x5a7b13[_0xe9b6('0x58')];_0x486194[_0xe9b6('0x59')]=_0x5a7b13;}else{_0x486194[_0xe9b6('0x57')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x486194[_0xe9b6('0x59')]={};}return _0x486194;};}exports[_0xe9b6('0x5a')]=function(_0x1ef9b6,_0x5e4c51,_0x54eeff){var _0x119a54=[];return db['User'][_0xe9b6('0x4c')]({'where':{'role':[_0xe9b6('0x5b'),_0xe9b6('0x5c'),_0xe9b6('0x5d')]},'attributes':['id',_0xe9b6('0x5e'),_0xe9b6('0x30'),_0xe9b6('0x5f'),_0xe9b6('0x60'),_0xe9b6('0x61'),_0xe9b6('0x62'),_0xe9b6('0x63'),_0xe9b6('0x64'),_0xe9b6('0x65')],'order':qs[_0xe9b6('0x43')](_0xe9b6('0x66')),'include':[{'model':db[_0xe9b6('0x67')],'as':_0xe9b6('0x68'),'attributes':['id',_0xe9b6('0x30'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x297815){if(_0x297815){var _0x59fbd6=_0x1ef9b6[_0xe9b6('0x5d')]['get']({'plain':!![]});if(!_0x59fbd6)throw new Error(_0xe9b6('0x69'));if(_0x59fbd6[_0xe9b6('0x5f')]==='user'){return db[_0xe9b6('0x6a')][_0xe9b6('0x4f')]({'where':{'name':_0xe9b6('0x6b'),'userProfileId':_0x59fbd6['userProfileId']},'raw':!![]})[_0xe9b6('0x2c')](function(_0x55dd1f){if(_0x55dd1f){if(_0x55dd1f[_0xe9b6('0x6c')]===0x0){return db['UserProfileResource'][_0xe9b6('0x4c')]({'where':{'sectionId':_0x55dd1f['id']},'raw':!![]})[_0xe9b6('0x2c')](function(_0x4d1d5d){var _0x5d74d5=[];if(_['isEmpty'](_0x4d1d5d)){_0x5d74d5=_['filter'](_0x297815,function(_0x2f4f29){if(_0x2f4f29['role']!==_0xe9b6('0x5b')){return _0x2f4f29;}});return _0x5d74d5;}else{for(var _0x4048ae=0x0;_0x4048ae<_0x297815[_0xe9b6('0x40')];_0x4048ae++){var _0x2fbb2f=_0x297815[_0x4048ae];if(_0x2fbb2f[_0xe9b6('0x5f')]===_0xe9b6('0x5b')){var _0xfcb008=_[_0xe9b6('0x4f')](_0x4d1d5d,function(_0xd3fd7b){return _0xd3fd7b[_0xe9b6('0x6d')]===_0x2fbb2f['id'];});if(_0xfcb008)_0x5d74d5['push'](_0x2fbb2f);}else{_0x5d74d5[_0xe9b6('0x6e')](_0x2fbb2f);}}return _0x5d74d5;}});}else{return _0x297815;}}else{var _0x2d6c73=_[_0xe9b6('0x48')](_0x297815,function(_0x134fe8){if(_0x134fe8['role']!=='agent'){return _0x134fe8;}});return _0x2d6c73;}});}else{return _0x297815;}}})[_0xe9b6('0x2c')](function(_0x30bc3a){var _0x25a850=[];if(_0x30bc3a){_0x119a54=_0x30bc3a;for(var _0x5a9794=0x0;_0x5a9794<_0x30bc3a['length'];_0x5a9794+=0x1){_0x119a54[_0x5a9794][_0xe9b6('0x56')]=[];_0x25a850[_0xe9b6('0x6e')](db['ChatInternalMessage'][_0xe9b6('0x4f')]({'where':{'FromId':[_0x1ef9b6[_0xe9b6('0x5d')]['id'],_0x30bc3a[_0x5a9794]['id']],'ToId':[_0x1ef9b6[_0xe9b6('0x5d')]['id'],_0x30bc3a[_0x5a9794]['id']],'ChatGroupId':null},'attributes':['id',_0xe9b6('0x58'),_0xe9b6('0x6f'),_0xe9b6('0x70'),_0xe9b6('0x71'),_0xe9b6('0x52')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe9b6('0x2c')](wrapUser(_0x30bc3a[_0x5a9794])));}return BPromise[_0xe9b6('0x72')](_0x25a850);}return[];})[_0xe9b6('0x2c')](function(_0x15fe41){return{'rows':_0x15fe41,'count':_0x15fe41[_0xe9b6('0x40')]};})[_0xe9b6('0x2c')](respondWithResult(_0x5e4c51,null))[_0xe9b6('0x50')](handleError(_0x5e4c51,null));};
\ No newline at end of file
+var _0xfaf4=['create','body','params','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','findAll','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','FromId','ToId','read','all','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','show','include','find'];(function(_0x18dc7e,_0x1d3a63){var _0x481936=function(_0x6264d0){while(--_0x6264d0){_0x18dc7e['push'](_0x18dc7e['shift']());}};_0x481936(++_0x1d3a63);}(_0xfaf4,0x100));var _0x4faf=function(_0x7e4c89,_0x251031){_0x7e4c89=_0x7e4c89-0x0;var _0xaa0be9=_0xfaf4[_0x7e4c89];return _0xaa0be9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4faf('0x0'));var zipdir=require(_0x4faf('0x1'));var jsonpatch=require(_0x4faf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4faf('0x3'));var util=require(_0x4faf('0x4'));var path=require(_0x4faf('0x5'));var sox=require(_0x4faf('0x6'));var csv=require(_0x4faf('0x7'));var ejs=require(_0x4faf('0x8'));var fs=require('fs');var fs_extra=require(_0x4faf('0x9'));var _=require('lodash');var squel=require(_0x4faf('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4faf('0x7'));var querystring=require(_0x4faf('0xb'));var Papa=require(_0x4faf('0xc'));var Redis=require(_0x4faf('0xd'));var authService=require(_0x4faf('0xe'));var qs=require(_0x4faf('0xf'));var as=require(_0x4faf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4faf('0x11'))(_0x4faf('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4faf('0x13'));var db=require(_0x4faf('0x14'))['db'];config['redis']=_[_0x4faf('0x15')](config[_0x4faf('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x4faf('0x17'))(new Redis(config[_0x4faf('0x16')]));require(_0x4faf('0x18'))['register'](socket);function respondWithStatusCode(_0x544a7c,_0x356eb5){_0x356eb5=_0x356eb5||0xcc;return function(_0x464049){if(_0x464049){return _0x544a7c[_0x4faf('0x19')](_0x356eb5);}return _0x544a7c[_0x4faf('0x1a')](_0x356eb5)[_0x4faf('0x1b')]();};}function respondWithResult(_0x2c108c,_0x15e868){_0x15e868=_0x15e868||0xc8;return function(_0xdb3c0b){if(_0xdb3c0b){return _0x2c108c[_0x4faf('0x1a')](_0x15e868)[_0x4faf('0x1c')](_0xdb3c0b);}};}function respondWithFilteredResult(_0xb07d81,_0x293cd2){return function(_0x562bc5){if(_0x562bc5){var _0x4a174a=typeof _0x293cd2[_0x4faf('0x1d')]===_0x4faf('0x1e')&&typeof _0x293cd2['limit']===_0x4faf('0x1e');var _0x312432=_0x562bc5['count'];var _0x193447=_0x4a174a?0x0:_0x293cd2[_0x4faf('0x1d')];var _0x5b13fd=_0x4a174a?_0x562bc5[_0x4faf('0x1f')]:_0x293cd2[_0x4faf('0x1d')]+_0x293cd2[_0x4faf('0x20')];var _0x19c4f7;if(_0x5b13fd>=_0x312432){_0x5b13fd=_0x312432;_0x19c4f7=0xc8;}else{_0x19c4f7=0xce;}_0xb07d81['status'](_0x19c4f7);return _0xb07d81[_0x4faf('0x21')](_0x4faf('0x22'),_0x193447+'-'+_0x5b13fd+'/'+_0x312432)[_0x4faf('0x1c')](_0x562bc5);}return null;};}function patchUpdates(_0x549074){return function(_0x520b80){try{jsonpatch[_0x4faf('0x23')](_0x520b80,_0x549074,!![]);}catch(_0x3c58e3){return BPromise[_0x4faf('0x24')](_0x3c58e3);}return _0x520b80[_0x4faf('0x25')]();};}function saveUpdates(_0x39b933,_0x4b02c7){return function(_0x5335b8){if(_0x5335b8){return _0x5335b8[_0x4faf('0x26')](_0x39b933)[_0x4faf('0x27')](function(_0xa23bd4){return _0xa23bd4;});}return null;};}function removeEntity(_0x4e4ce2,_0x4aea49){return function(_0x248ef9){if(_0x248ef9){return _0x248ef9['destroy']()[_0x4faf('0x27')](function(){_0x4e4ce2[_0x4faf('0x1a')](0xcc)[_0x4faf('0x1b')]();});}};}function handleEntityNotFound(_0x5c5d55,_0x1bdb20){return function(_0x2ee669){if(!_0x2ee669){_0x5c5d55['sendStatus'](0x194);}return _0x2ee669;};}function handleError(_0x9f6b34,_0x46611f){_0x46611f=_0x46611f||0x1f4;return function(_0x4a8cd9){logger[_0x4faf('0x28')](_0x4a8cd9[_0x4faf('0x29')]);if(_0x4a8cd9[_0x4faf('0x2a')]){delete _0x4a8cd9[_0x4faf('0x2a')];}_0x9f6b34[_0x4faf('0x1a')](_0x46611f)[_0x4faf('0x2b')](_0x4a8cd9);};}exports['index']=function(_0xc4ec9d,_0x539759){var _0x36b762={},_0x585683={},_0x16a65d={'count':0x0,'rows':[]};var _0x1f95e2=_[_0x4faf('0x2c')](db[_0x4faf('0x2d')][_0x4faf('0x2e')],function(_0x48cce1){return{'name':_0x48cce1[_0x4faf('0x2f')],'type':_0x48cce1[_0x4faf('0x30')]['key']};});_0x585683[_0x4faf('0x31')]=_['map'](_0x1f95e2,_0x4faf('0x2a'));_0x585683[_0x4faf('0x32')]=_[_0x4faf('0x33')](_0xc4ec9d[_0x4faf('0x32')]);_0x585683[_0x4faf('0x34')]=_[_0x4faf('0x35')](_0x585683[_0x4faf('0x31')],_0x585683[_0x4faf('0x32')]);_0x36b762['attributes']=_[_0x4faf('0x35')](_0x585683[_0x4faf('0x31')],qs[_0x4faf('0x36')](_0xc4ec9d[_0x4faf('0x32')][_0x4faf('0x36')]));_0x36b762[_0x4faf('0x37')]=_0x36b762['attributes'][_0x4faf('0x38')]?_0x36b762['attributes']:_0x585683[_0x4faf('0x31')];if(!_0xc4ec9d[_0x4faf('0x32')][_0x4faf('0x39')](_0x4faf('0x3a'))){_0x36b762[_0x4faf('0x20')]=qs['limit'](_0xc4ec9d[_0x4faf('0x32')]['limit']);_0x36b762[_0x4faf('0x1d')]=qs[_0x4faf('0x1d')](_0xc4ec9d['query'][_0x4faf('0x1d')]);}_0x36b762[_0x4faf('0x3b')]=qs[_0x4faf('0x3c')](_0xc4ec9d['query'][_0x4faf('0x3c')]);_0x36b762[_0x4faf('0x3d')]=qs[_0x4faf('0x34')](_['pick'](_0xc4ec9d[_0x4faf('0x32')],_0x585683['filters']),_0x1f95e2);if(_0xc4ec9d[_0x4faf('0x32')]['filter']){_0x36b762[_0x4faf('0x3d')]=_[_0x4faf('0x3e')](_0x36b762[_0x4faf('0x3d')],{'$or':_['map'](_0x1f95e2,function(_0x843157){if(_0x843157[_0x4faf('0x30')]!==_0x4faf('0x3f')){var _0x3f08e4={};_0x3f08e4[_0x843157[_0x4faf('0x2a')]]={'$like':'%'+_0xc4ec9d[_0x4faf('0x32')][_0x4faf('0x40')]+'%'};return _0x3f08e4;}})});}_0x36b762=_[_0x4faf('0x3e')]({},_0x36b762,_0xc4ec9d['options']);var _0x34d501={'where':_0x36b762[_0x4faf('0x3d')]};return db[_0x4faf('0x2d')][_0x4faf('0x1f')](_0x34d501)['then'](function(_0x168b4f){_0x16a65d[_0x4faf('0x1f')]=_0x168b4f;if(_0xc4ec9d[_0x4faf('0x32')][_0x4faf('0x41')]){_0x36b762['include']=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x36b762);})['then'](function(_0x344207){_0x16a65d[_0x4faf('0x42')]=_0x344207;return _0x16a65d;})[_0x4faf('0x27')](respondWithFilteredResult(_0x539759,_0x36b762))[_0x4faf('0x43')](handleError(_0x539759,null));};exports[_0x4faf('0x44')]=function(_0x1b9cd7,_0x3c5872){var _0x28a53e={'raw':!![],'where':{'id':_0x1b9cd7['params']['id']}},_0x310162={};_0x310162[_0x4faf('0x31')]=_['keys'](db[_0x4faf('0x2d')][_0x4faf('0x2e')]);_0x310162[_0x4faf('0x32')]=_[_0x4faf('0x33')](_0x1b9cd7[_0x4faf('0x32')]);_0x310162['filters']=_[_0x4faf('0x35')](_0x310162[_0x4faf('0x31')],_0x310162[_0x4faf('0x32')]);_0x28a53e[_0x4faf('0x37')]=_['intersection'](_0x310162[_0x4faf('0x31')],qs['fields'](_0x1b9cd7['query'][_0x4faf('0x36')]));_0x28a53e[_0x4faf('0x37')]=_0x28a53e[_0x4faf('0x37')][_0x4faf('0x38')]?_0x28a53e['attributes']:_0x310162['model'];if(_0x1b9cd7[_0x4faf('0x32')][_0x4faf('0x41')]){_0x28a53e[_0x4faf('0x45')]=[{'all':!![]}];}_0x28a53e=_[_0x4faf('0x3e')]({},_0x28a53e,_0x1b9cd7['options']);return db['ChatInternalMessage'][_0x4faf('0x46')](_0x28a53e)[_0x4faf('0x27')](handleEntityNotFound(_0x3c5872,null))[_0x4faf('0x27')](respondWithResult(_0x3c5872,null))[_0x4faf('0x43')](handleError(_0x3c5872,null));};exports[_0x4faf('0x47')]=function(_0xd8d071,_0x4d2576){return db['ChatInternalMessage'][_0x4faf('0x47')](_0xd8d071[_0x4faf('0x48')],{})['then'](respondWithResult(_0x4d2576,0xc9))[_0x4faf('0x43')](handleError(_0x4d2576,null));};exports[_0x4faf('0x26')]=function(_0x3bfc99,_0x5480c0){if(_0x3bfc99[_0x4faf('0x48')]['id']){delete _0x3bfc99['body']['id'];}return db['ChatInternalMessage'][_0x4faf('0x46')]({'where':{'id':_0x3bfc99[_0x4faf('0x49')]['id']}})[_0x4faf('0x27')](handleEntityNotFound(_0x5480c0,null))[_0x4faf('0x27')](saveUpdates(_0x3bfc99[_0x4faf('0x48')],null))[_0x4faf('0x27')](respondWithResult(_0x5480c0,null))[_0x4faf('0x43')](handleError(_0x5480c0,null));};exports[_0x4faf('0x4a')]=function(_0x428025,_0x5e5e8c){return db[_0x4faf('0x2d')]['find']({'where':{'id':_0x428025[_0x4faf('0x49')]['id']}})[_0x4faf('0x27')](handleEntityNotFound(_0x5e5e8c,null))['then'](removeEntity(_0x5e5e8c,null))[_0x4faf('0x43')](handleError(_0x5e5e8c,null));};exports[_0x4faf('0x4b')]=function(_0x32df4b,_0x5f2b38){return db[_0x4faf('0x2d')][_0x4faf('0x4b')]()['then'](respondWithResult(_0x5f2b38,null))['catch'](handleError(_0x5f2b38,null));};function wrapUser(_0x2b1b0d){return function(_0x4f62eb){var _0x4b9554=_0x2b1b0d[_0x4faf('0x4c')]({'plain':!![]});_0x4b9554[_0x4faf('0x4d')]=[];if(_0x4f62eb){_0x4b9554[_0x4faf('0x4e')]=_0x4f62eb[_0x4faf('0x4f')];_0x4b9554[_0x4faf('0x50')]=_0x4f62eb;}else{_0x4b9554[_0x4faf('0x4e')]=moment(0x0)[_0x4faf('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b9554[_0x4faf('0x50')]={};}return _0x4b9554;};}exports['getUsers']=function(_0x378696,_0x2fe724,_0x4b9e1b){var _0x5a9b2f=[];return db[_0x4faf('0x52')][_0x4faf('0x53')]({'where':{'role':['agent','admin',_0x4faf('0x54')]},'attributes':['id',_0x4faf('0x55'),'name','role',_0x4faf('0x56'),_0x4faf('0x57'),_0x4faf('0x58'),_0x4faf('0x59'),_0x4faf('0x5a'),_0x4faf('0x5b')],'order':qs[_0x4faf('0x3c')](_0x4faf('0x5c')),'include':[{'model':db[_0x4faf('0x5d')],'as':_0x4faf('0x5e'),'attributes':['id',_0x4faf('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x4faf('0x27')](function(_0x1bc82c){if(_0x1bc82c){var _0x2ff9c4=_0x378696['user'][_0x4faf('0x4c')]({'plain':!![]});if(!_0x2ff9c4)throw new Error(_0x4faf('0x5f'));if(_0x2ff9c4[_0x4faf('0x60')]===_0x4faf('0x54')){return db[_0x4faf('0x61')]['find']({'where':{'name':_0x4faf('0x62'),'userProfileId':_0x2ff9c4[_0x4faf('0x63')]},'raw':!![]})[_0x4faf('0x27')](function(_0x1d56c6){if(_0x1d56c6){if(_0x1d56c6[_0x4faf('0x64')]===0x0){return db[_0x4faf('0x65')][_0x4faf('0x53')]({'where':{'sectionId':_0x1d56c6['id']},'raw':!![]})[_0x4faf('0x27')](function(_0xc188ce){var _0x321e0c=[];if(_['isEmpty'](_0xc188ce)){_0x321e0c=_['filter'](_0x1bc82c,function(_0x5bbcd6){if(_0x5bbcd6[_0x4faf('0x60')]!==_0x4faf('0x66')){return _0x5bbcd6;}});return _0x321e0c;}else{for(var _0x46cdb3=0x0;_0x46cdb3<_0x1bc82c['length'];_0x46cdb3++){var _0x3b46f3=_0x1bc82c[_0x46cdb3];if(_0x3b46f3[_0x4faf('0x60')]===_0x4faf('0x66')){var _0x234d94=_[_0x4faf('0x46')](_0xc188ce,function(_0x214ded){return _0x214ded[_0x4faf('0x67')]===_0x3b46f3['id'];});if(_0x234d94)_0x321e0c[_0x4faf('0x68')](_0x3b46f3);}else{_0x321e0c[_0x4faf('0x68')](_0x3b46f3);}}return _0x321e0c;}});}else{return _0x1bc82c;}}else{var _0x51ee13=_['filter'](_0x1bc82c,function(_0x546781){if(_0x546781['role']!==_0x4faf('0x66')){return _0x546781;}});return _0x51ee13;}});}else{return _0x1bc82c;}}})[_0x4faf('0x27')](function(_0x8796f6){var _0x29bde9=[];if(_0x8796f6){_0x5a9b2f=_0x8796f6;for(var _0x357f81=0x0;_0x357f81<_0x8796f6[_0x4faf('0x38')];_0x357f81+=0x1){_0x5a9b2f[_0x357f81]['messages']=[];_0x29bde9[_0x4faf('0x68')](db[_0x4faf('0x2d')][_0x4faf('0x46')]({'where':{'FromId':[_0x378696[_0x4faf('0x54')]['id'],_0x8796f6[_0x357f81]['id']],'ToId':[_0x378696[_0x4faf('0x54')]['id'],_0x8796f6[_0x357f81]['id']],'ChatGroupId':null},'attributes':['id',_0x4faf('0x4f'),_0x4faf('0x69'),_0x4faf('0x6a'),_0x4faf('0x6b'),_0x4faf('0x48')],'order':qs[_0x4faf('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4faf('0x27')](wrapUser(_0x8796f6[_0x357f81])));}return BPromise[_0x4faf('0x6c')](_0x29bde9);}return[];})[_0x4faf('0x27')](function(_0x15a2d1){return{'rows':_0x15a2d1,'count':_0x15a2d1['length']};})[_0x4faf('0x27')](respondWithResult(_0x2fe724,null))['catch'](handleError(_0x2fe724,null));};
\ No newline at end of file
index 3c3a61a..2751de5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x705d=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x705d,0x98));var _0xd705=function(_0x3a6726,_0x2e4643){_0x3a6726=_0x3a6726-0x0;var _0x32be97=_0x705d[_0x3a6726];return _0x32be97;};'use strict';var EventEmitter=require(_0xd705('0x0'));var ChatInternalMessage=require(_0xd705('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd705('0x2'),'afterUpdate':_0xd705('0x3'),'afterDestroy':_0xd705('0x4')};function emitEvent(_0x42b8e5){return function(_0x34a8b6,_0x51c308,_0x213576){ChatInternalMessageEvents[_0xd705('0x5')](_0x42b8e5+':'+_0x34a8b6['id'],_0x34a8b6);ChatInternalMessageEvents['emit'](_0x42b8e5,_0x34a8b6);_0x213576(null);};}for(var e in events){if(events[_0xd705('0x6')](e)){var event=events[e];ChatInternalMessage[_0xd705('0x7')](e,emitEvent(event));}}module[_0xd705('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe4aa=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xe4aa,0x114));var _0xae4a=function(_0x40bb0c,_0x21afb0){_0x40bb0c=_0x40bb0c-0x0;var _0x2c65e0=_0xe4aa[_0x40bb0c];return _0x2c65e0;};'use strict';var EventEmitter=require(_0xae4a('0x0'));var ChatInternalMessage=require(_0xae4a('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xae4a('0x2')](0x0);var events={'afterCreate':_0xae4a('0x3'),'afterUpdate':_0xae4a('0x4'),'afterDestroy':_0xae4a('0x5')};function emitEvent(_0x14ea67){return function(_0x52682a,_0x4f43c6,_0x478a21){ChatInternalMessageEvents[_0xae4a('0x6')](_0x14ea67+':'+_0x52682a['id'],_0x52682a);ChatInternalMessageEvents['emit'](_0x14ea67,_0x52682a);_0x478a21(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xae4a('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
index 437f006..efc907b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa491=['moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa491,0x65));var _0x1a49=function(_0x232fce,_0x486da3){_0x232fce=_0x232fce-0x0;var _0x2733ad=_0xa491[_0x232fce];return _0x2733ad;};'use strict';var _=require(_0x1a49('0x0'));var util=require(_0x1a49('0x1'));var logger=require('../../config/logger')(_0x1a49('0x2'));var moment=require(_0x1a49('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a49('0x4'));var fs=require('fs');var path=require(_0x1a49('0x5'));var rimraf=require(_0x1a49('0x6'));var config=require(_0x1a49('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x1a49('0x8')]=function(_0xf4fbec,_0x456f1b){return _0xf4fbec[_0x1a49('0x9')](_0x1a49('0xa'),attributes,{'tableName':_0x1a49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1a49('0xc')});};
\ No newline at end of file
+var _0xdb29=['rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','api','moment','bluebird','path'];(function(_0xac3ebb,_0x3ae939){var _0x40ac9f=function(_0x4612df){while(--_0x4612df){_0xac3ebb['push'](_0xac3ebb['shift']());}};_0x40ac9f(++_0x3ae939);}(_0xdb29,0x10f));var _0x9db2=function(_0x240e91,_0x124240){_0x240e91=_0x240e91-0x0;var _0x5aeb50=_0xdb29[_0x240e91];return _0x5aeb50;};'use strict';var _=require(_0x9db2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9db2('0x1'));var moment=require(_0x9db2('0x2'));var BPromise=require(_0x9db2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9db2('0x4'));var rimraf=require(_0x9db2('0x5'));var config=require(_0x9db2('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x9db2('0x7')]=function(_0x4b0470,_0x39d37e){return _0x4b0470[_0x9db2('0x8')](_0x9db2('0x9'),attributes,{'tableName':_0x9db2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9db2('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index c87b7db..e5fab69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc911=['moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x497391,_0x471b68){var _0x1f88dc=function(_0xf0cf64){while(--_0xf0cf64){_0x497391['push'](_0x497391['shift']());}};_0x1f88dc(++_0x471b68);}(_0xc911,0x9a));var _0x1c91=function(_0x2cb9c8,_0x39b0b2){_0x2cb9c8=_0x2cb9c8-0x0;var _0x1b6f12=_0xc911[_0x2cb9c8];return _0x1b6f12;};'use strict';var _=require(_0x1c91('0x0'));var util=require(_0x1c91('0x1'));var moment=require(_0x1c91('0x2'));var BPromise=require(_0x1c91('0x3'));var rs=require(_0x1c91('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1c91('0x5'));var logger=require(_0x1c91('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1c91('0x7'));var client=jayson[_0x1c91('0x8')]['http']({'port':0x232a});config[_0x1c91('0x9')]=_[_0x1c91('0xa')](config[_0x1c91('0x9')],{'host':_0x1c91('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c91('0x9')]));require(_0x1c91('0xc'))[_0x1c91('0xd')](socket);function respondWithRpcPromise(_0x125041,_0x29076d,_0x4219b4){return new BPromise(function(_0x4de1c0,_0xe121e2){return client[_0x1c91('0xe')](_0x125041,_0x4219b4)[_0x1c91('0xf')](function(_0x365128){logger[_0x1c91('0x10')](_0x1c91('0x11'),_0x29076d,_0x1c91('0x12'));logger[_0x1c91('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x29076d,_0x1c91('0x12'),JSON[_0x1c91('0x14')](_0x365128));if(_0x365128['error']){if(_0x365128[_0x1c91('0x15')][_0x1c91('0x16')]===0x1f4){logger[_0x1c91('0x15')](_0x1c91('0x11'),_0x29076d,_0x365128[_0x1c91('0x15')][_0x1c91('0x17')]);return _0xe121e2(_0x365128[_0x1c91('0x15')][_0x1c91('0x17')]);}logger[_0x1c91('0x15')](_0x1c91('0x11'),_0x29076d,_0x365128[_0x1c91('0x15')]['message']);return _0x4de1c0(_0x365128[_0x1c91('0x15')][_0x1c91('0x17')]);}else{logger['info'](_0x1c91('0x11'),_0x29076d,_0x1c91('0x12'));_0x4de1c0(_0x365128[_0x1c91('0x18')]['message']);}})[_0x1c91('0x19')](function(_0x3f2eef){logger[_0x1c91('0x15')](_0x1c91('0x11'),_0x29076d,_0x3f2eef);_0xe121e2(_0x3f2eef);});});}
\ No newline at end of file
+var _0x8f0b=['request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x599b07,_0x22cd9f){var _0x490cc6=function(_0x4854f6){while(--_0x4854f6){_0x599b07['push'](_0x599b07['shift']());}};_0x490cc6(++_0x22cd9f);}(_0x8f0b,0x1a2));var _0xb8f0=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x8f0b[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0xb8f0('0x0'));var util=require(_0xb8f0('0x1'));var moment=require(_0xb8f0('0x2'));var BPromise=require(_0xb8f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8f0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8f0('0x5'));var logger=require(_0xb8f0('0x6'))(_0xb8f0('0x7'));var config=require(_0xb8f0('0x8'));var jayson=require(_0xb8f0('0x9'));var client=jayson[_0xb8f0('0xa')][_0xb8f0('0xb')]({'port':0x232a});config[_0xb8f0('0xc')]=_[_0xb8f0('0xd')](config['redis'],{'host':_0xb8f0('0xe'),'port':0x18eb});var socket=require(_0xb8f0('0xf'))(new Redis(config[_0xb8f0('0xc')]));require(_0xb8f0('0x10'))['register'](socket);function respondWithRpcPromise(_0xff4d7f,_0x65cc25,_0x5e7d21){return new BPromise(function(_0x276f5a,_0x475606){return client[_0xb8f0('0x11')](_0xff4d7f,_0x5e7d21)[_0xb8f0('0x12')](function(_0x53231a){logger['info'](_0xb8f0('0x13'),_0x65cc25,_0xb8f0('0x14'));logger[_0xb8f0('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x65cc25,'request\x20sent',JSON[_0xb8f0('0x16')](_0x53231a));if(_0x53231a[_0xb8f0('0x17')]){if(_0x53231a['error'][_0xb8f0('0x18')]===0x1f4){logger['error'](_0xb8f0('0x13'),_0x65cc25,_0x53231a['error'][_0xb8f0('0x19')]);return _0x475606(_0x53231a[_0xb8f0('0x17')]['message']);}logger[_0xb8f0('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x65cc25,_0x53231a[_0xb8f0('0x17')][_0xb8f0('0x19')]);return _0x276f5a(_0x53231a[_0xb8f0('0x17')][_0xb8f0('0x19')]);}else{logger[_0xb8f0('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x65cc25,'request\x20sent');_0x276f5a(_0x53231a[_0xb8f0('0x1b')][_0xb8f0('0x19')]);}})[_0xb8f0('0x1c')](function(_0x12d952){logger[_0xb8f0('0x17')](_0xb8f0('0x13'),_0x65cc25,_0x12d952);_0x475606(_0x12d952);});});}
\ No newline at end of file
index 8b22e3f..910aaeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d88=['update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x481ee8,_0x5aa574){var _0x5ad55f=function(_0x81c176){while(--_0x81c176){_0x481ee8['push'](_0x481ee8['shift']());}};_0x5ad55f(++_0x5aa574);}(_0x3d88,0x136));var _0x83d8=function(_0xb0945e,_0x1a3af7){_0xb0945e=_0xb0945e-0x0;var _0x46063f=_0x3d88[_0xb0945e];return _0x46063f;};'use strict';var ChatInternalMessageEvents=require(_0x83d8('0x0'));var events=[_0x83d8('0x1'),'remove',_0x83d8('0x2')];function createListener(_0x1627b7,_0x3a9b8e){return function(_0x58d040){_0x3a9b8e[_0x83d8('0x3')](_0x1627b7,_0x58d040);};}function removeListener(_0x1337d7,_0x43ebba){return function(){ChatInternalMessageEvents[_0x83d8('0x4')](_0x1337d7,_0x43ebba);};}exports[_0x83d8('0x5')]=function(_0x1d8c7f){for(var _0x42421e=0x0,_0x58cd22=events[_0x83d8('0x6')];_0x42421e<_0x58cd22;_0x42421e++){var _0x26bd57=events[_0x42421e];var _0xc04c21=createListener(_0x83d8('0x7')+_0x26bd57,_0x1d8c7f);ChatInternalMessageEvents['on'](_0x26bd57,_0xc04c21);}};
\ No newline at end of file
+var _0xf9d1=['length','chatInternalMessage:','./chatInternalMessage.events','remove','update','removeListener','register'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0xf9d1,0x198));var _0x1f9d=function(_0x4f46f1,_0x2a39b9){_0x4f46f1=_0x4f46f1-0x0;var _0x5e146b=_0xf9d1[_0x4f46f1];return _0x5e146b;};'use strict';var ChatInternalMessageEvents=require(_0x1f9d('0x0'));var events=['save',_0x1f9d('0x1'),_0x1f9d('0x2')];function createListener(_0x2c2319,_0x3983b1){return function(_0x526382){_0x3983b1['emit'](_0x2c2319,_0x526382);};}function removeListener(_0x50f773,_0x18786a){return function(){ChatInternalMessageEvents[_0x1f9d('0x3')](_0x50f773,_0x18786a);};}exports[_0x1f9d('0x4')]=function(_0xcadff8){for(var _0x14b71c=0x0,_0x5efdfc=events[_0x1f9d('0x5')];_0x14b71c<_0x5efdfc;_0x14b71c++){var _0x5952f1=events[_0x14b71c];var _0xcf018a=createListener(_0x1f9d('0x6')+_0x5952f1,_0xcadff8);ChatInternalMessageEvents['on'](_0x5952f1,_0xcf018a);}};
\ No newline at end of file
index 3f9ab70..6901cf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf754=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','getUsers','/:id','show','post','delete','destroy'];(function(_0x3e12be,_0x1d57f3){var _0x4f831a=function(_0x7d7e45){while(--_0x7d7e45){_0x3e12be['push'](_0x3e12be['shift']());}};_0x4f831a(++_0x1d57f3);}(_0xf754,0xe8));var _0x4f75=function(_0x54d43a,_0x5af274){_0x54d43a=_0x54d43a-0x0;var _0x168a1d=_0xf754[_0x54d43a];return _0x168a1d;};'use strict';var multer=require(_0x4f75('0x0'));var util=require('util');var path=require(_0x4f75('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f75('0x2'));var router=express[_0x4f75('0x3')]();var fs_extra=require(_0x4f75('0x4'));var auth=require(_0x4f75('0x5'));var interaction=require(_0x4f75('0x6'));var config=require(_0x4f75('0x7'));var controller=require(_0x4f75('0x8'));router[_0x4f75('0x9')]('/',auth['isAuthenticated'](),controller[_0x4f75('0xa')]);router['get'](_0x4f75('0xb'),auth[_0x4f75('0xc')](),controller[_0x4f75('0xd')]);router[_0x4f75('0x9')]('/users',auth[_0x4f75('0xc')](),controller[_0x4f75('0xe')]);router['get'](_0x4f75('0xf'),auth[_0x4f75('0xc')](),controller[_0x4f75('0x10')]);router[_0x4f75('0x11')]('/',auth[_0x4f75('0xc')](),controller['create']);router['put'](_0x4f75('0xf'),controller['update']);router[_0x4f75('0x12')](_0x4f75('0xf'),auth[_0x4f75('0xc')](),controller[_0x4f75('0x13')]);module[_0x4f75('0x14')]=router;
\ No newline at end of file
+var _0x1209=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','show','post','create','delete','exports','util','path','Router'];(function(_0x4a2673,_0x1290a1){var _0x20f7ff=function(_0x48b1b3){while(--_0x48b1b3){_0x4a2673['push'](_0x4a2673['shift']());}};_0x20f7ff(++_0x1290a1);}(_0x1209,0x69));var _0x9120=function(_0xa86433,_0x36e3cf){_0xa86433=_0xa86433-0x0;var _0x669482=_0x1209[_0xa86433];return _0x669482;};'use strict';var multer=require('multer');var util=require(_0x9120('0x0'));var path=require(_0x9120('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9120('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9120('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9120('0x4'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x9120('0x5')](),controller[_0x9120('0x6')]);router[_0x9120('0x7')](_0x9120('0x8'),auth['isAuthenticated'](),controller[_0x9120('0x9')]);router[_0x9120('0x7')](_0x9120('0xa'),auth['isAuthenticated'](),controller[_0x9120('0xb')]);router[_0x9120('0x7')](_0x9120('0xc'),auth[_0x9120('0x5')](),controller[_0x9120('0xd')]);router[_0x9120('0xe')]('/',auth[_0x9120('0x5')](),controller[_0x9120('0xf')]);router['put'](_0x9120('0xc'),controller['update']);router[_0x9120('0x10')]('/:id',auth[_0x9120('0x5')](),controller['destroy']);module[_0x9120('0x11')]=router;
\ No newline at end of file
index 32e47a7..a8140a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bc6=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x1bc6,0x94));var _0x61bc=function(_0x303934,_0x59174f){_0x303934=_0x303934-0x0;var _0x52c297=_0x1bc6[_0x303934];return _0x52c297;};'use strict';var Sequelize=require(_0x61bc('0x0'));module[_0x61bc('0x1')]={'body':{'type':Sequelize[_0x61bc('0x2')](_0x61bc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x61bc('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x61bc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x61bc('0x5')]('in','out'),'defaultValue':_0x61bc('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x61bc('0x7')]},'providerName':{'type':Sequelize[_0x61bc('0x8')]},'providerResponse':{'type':Sequelize[_0x61bc('0x2')]}};
\ No newline at end of file
+var _0x1d21=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x1d21,0x158));var _0x11d2=function(_0x42cc1f,_0xe9eb20){_0x42cc1f=_0x42cc1f-0x0;var _0x175df5=_0x1d21[_0x42cc1f];return _0x175df5;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'body':{'type':Sequelize[_0x11d2('0x2')](_0x11d2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d2('0x5')]('in',_0x11d2('0x6')),'defaultValue':_0x11d2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x11d2('0x7')]},'providerResponse':{'type':Sequelize[_0x11d2('0x2')]}};
\ No newline at end of file
index 9fae45a..a290bdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x052b=['contact','fullname','email','motionChannel','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','ChatMessage','include','rows','catch','show','includeAll','options','find','create','body','update','params','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize'];(function(_0x365930,_0x38a486){var _0x4e4a5f=function(_0x799836){while(--_0x799836){_0x365930['push'](_0x365930['shift']());}};_0x4e4a5f(++_0x38a486);}(_0x052b,0x8a));var _0xb052=function(_0x6ea869,_0x1cae12){_0x6ea869=_0x6ea869-0x0;var _0x5de3df=_0x052b[_0x6ea869];return _0x5de3df;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb052('0x0'));var jsonpatch=require(_0xb052('0x1'));var rp=require(_0xb052('0x2'));var moment=require(_0xb052('0x3'));var BPromise=require(_0xb052('0x4'));var Mustache=require(_0xb052('0x5'));var util=require(_0xb052('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb052('0x7'));var ejs=require(_0xb052('0x8'));var fs=require('fs');var fs_extra=require(_0xb052('0x9'));var _=require('lodash');var squel=require(_0xb052('0xa'));var crypto=require('crypto');var jsforce=require(_0xb052('0xb'));var deskjs=require(_0xb052('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb052('0xd'));var Papa=require(_0xb052('0xe'));var Redis=require(_0xb052('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb052('0x10'));var as=require(_0xb052('0x11'));var hardwareService=require(_0xb052('0x12'));var logger=require(_0xb052('0x13'))('api');var utils=require(_0xb052('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb052('0x15'));var db=require(_0xb052('0x16'))['db'];config[_0xb052('0x17')]=_[_0xb052('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb052('0x19'))(new Redis(config[_0xb052('0x17')]));require(_0xb052('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb052('0x1b')][_0xb052('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26ed4b,_0x553cfc,_0x1a2039,_0x1245c3){return new BPromise(function(_0x22a6e2,_0x40a249){var _0xdaf440=_0x1245c3||client;return _0xdaf440[_0xb052('0x1d')](_0x26ed4b,_0x1a2039)[_0xb052('0x1e')](function(_0x508358){logger[_0xb052('0x1f')](_0xb052('0x20'),_0x553cfc,_0xb052('0x21'));logger['debug'](_0xb052('0x22'),_0x553cfc,_0xb052('0x21'),JSON[_0xb052('0x23')](_0x508358));if(_0x508358[_0xb052('0x24')]){if(_0x508358[_0xb052('0x24')][_0xb052('0x25')]===0x1f4){logger[_0xb052('0x24')](_0xb052('0x20'),_0x553cfc,_0x508358[_0xb052('0x24')][_0xb052('0x26')]);return _0x40a249(_0x508358[_0xb052('0x24')]['message']);}logger[_0xb052('0x24')](_0xb052('0x20'),_0x553cfc,_0x508358[_0xb052('0x24')]['message']);return _0x22a6e2(_0x508358[_0xb052('0x24')]['message']);}else{logger['info'](_0xb052('0x20'),_0x553cfc,_0xb052('0x21'));_0x22a6e2(_0x508358[_0xb052('0x27')][_0xb052('0x26')]);}})['catch'](function(_0x12e45e){logger[_0xb052('0x24')](_0xb052('0x20'),_0x553cfc,_0x12e45e);_0x40a249(_0x12e45e);});});}function respondWithStatusCode(_0x5eef7c,_0x141b10){_0x141b10=_0x141b10||0xcc;return function(_0x1dccf0){if(_0x1dccf0){return _0x5eef7c[_0xb052('0x28')](_0x141b10);}return _0x5eef7c['status'](_0x141b10)[_0xb052('0x29')]();};}function respondWithResult(_0x5c2132,_0x62c2a4){_0x62c2a4=_0x62c2a4||0xc8;return function(_0x191b67){if(_0x191b67){return _0x5c2132[_0xb052('0x2a')](_0x62c2a4)[_0xb052('0x2b')](_0x191b67);}};}function respondWithFilteredResult(_0x4f1c3d,_0x8df419){return function(_0x1eab05){if(_0x1eab05){var _0x23aecc=typeof _0x8df419[_0xb052('0x2c')]==='undefined'&&typeof _0x8df419['limit']===_0xb052('0x2d');var _0x42f199=_0x1eab05['count'];var _0x1bcd6=_0x23aecc?0x0:_0x8df419['offset'];var _0x139f64=_0x23aecc?_0x1eab05[_0xb052('0x2e')]:_0x8df419[_0xb052('0x2c')]+_0x8df419[_0xb052('0x2f')];var _0x521dff;if(_0x139f64>=_0x42f199){_0x139f64=_0x42f199;_0x521dff=0xc8;}else{_0x521dff=0xce;}_0x4f1c3d[_0xb052('0x2a')](_0x521dff);return _0x4f1c3d[_0xb052('0x30')]('Content-Range',_0x1bcd6+'-'+_0x139f64+'/'+_0x42f199)['json'](_0x1eab05);}return null;};}function patchUpdates(_0x473631){return function(_0x31ea34){try{jsonpatch[_0xb052('0x31')](_0x31ea34,_0x473631,!![]);}catch(_0x1427da){return BPromise[_0xb052('0x32')](_0x1427da);}return _0x31ea34[_0xb052('0x33')]();};}function saveUpdates(_0x318edf,_0x4d82ce){return function(_0x453e8a){if(_0x453e8a){return _0x453e8a['update'](_0x318edf)['then'](function(_0x47628d){return _0x47628d;});}return null;};}function removeEntity(_0x20183e,_0x178a76){return function(_0x5351db){if(_0x5351db){return _0x5351db[_0xb052('0x34')]()['then'](function(){_0x20183e[_0xb052('0x2a')](0xcc)[_0xb052('0x29')]();});}};}function handleEntityNotFound(_0x596008,_0x1fd6b2){return function(_0x5852e0){if(!_0x5852e0){_0x596008[_0xb052('0x28')](0x194);}return _0x5852e0;};}function handleError(_0x56405d,_0x57e18f){_0x57e18f=_0x57e18f||0x1f4;return function(_0x4dfc5c){logger[_0xb052('0x24')](_0x4dfc5c[_0xb052('0x35')]);if(_0x4dfc5c[_0xb052('0x36')]){delete _0x4dfc5c[_0xb052('0x36')];}_0x56405d[_0xb052('0x2a')](_0x57e18f)['send'](_0x4dfc5c);};}exports[_0xb052('0x37')]=function(_0x1e4888,_0x10e098){var _0x2fdd5c={},_0x3528c7={},_0xa7ff3b={'count':0x0,'rows':[]};var _0xd1b6ab=_[_0xb052('0x38')](db['ChatMessage'][_0xb052('0x39')],function(_0xde5e00){return{'name':_0xde5e00[_0xb052('0x3a')],'type':_0xde5e00['type'][_0xb052('0x3b')]};});_0x3528c7[_0xb052('0x3c')]=_[_0xb052('0x38')](_0xd1b6ab,'name');_0x3528c7['query']=_[_0xb052('0x3d')](_0x1e4888[_0xb052('0x3e')]);_0x3528c7[_0xb052('0x3f')]=_[_0xb052('0x40')](_0x3528c7['model'],_0x3528c7[_0xb052('0x3e')]);_0x2fdd5c[_0xb052('0x41')]=_[_0xb052('0x40')](_0x3528c7[_0xb052('0x3c')],qs['fields'](_0x1e4888[_0xb052('0x3e')][_0xb052('0x42')]));_0x2fdd5c[_0xb052('0x41')]=_0x2fdd5c[_0xb052('0x41')][_0xb052('0x43')]?_0x2fdd5c['attributes']:_0x3528c7['model'];if(!_0x1e4888[_0xb052('0x3e')][_0xb052('0x44')]('nolimit')){_0x2fdd5c[_0xb052('0x2f')]=qs[_0xb052('0x2f')](_0x1e4888[_0xb052('0x3e')][_0xb052('0x2f')]);_0x2fdd5c[_0xb052('0x2c')]=qs[_0xb052('0x2c')](_0x1e4888['query'][_0xb052('0x2c')]);}_0x2fdd5c[_0xb052('0x45')]=qs[_0xb052('0x46')](_0x1e4888['query'][_0xb052('0x46')]);_0x2fdd5c['where']=qs[_0xb052('0x3f')](_[_0xb052('0x47')](_0x1e4888[_0xb052('0x3e')],_0x3528c7[_0xb052('0x3f')]),_0xd1b6ab);if(_0x1e4888[_0xb052('0x3e')][_0xb052('0x48')]){_0x2fdd5c['where']=_[_0xb052('0x49')](_0x2fdd5c[_0xb052('0x4a')],{'$or':_['map'](_0xd1b6ab,function(_0x3cfd97){if(_0x3cfd97[_0xb052('0x4b')]!==_0xb052('0x4c')){var _0x2fc252={};_0x2fc252[_0x3cfd97[_0xb052('0x36')]]={'$like':'%'+_0x1e4888[_0xb052('0x3e')][_0xb052('0x48')]+'%'};return _0x2fc252;}})});}_0x2fdd5c=_[_0xb052('0x49')]({},_0x2fdd5c,_0x1e4888['options']);var _0x2eee5a={'where':_0x2fdd5c[_0xb052('0x4a')]};return db[_0xb052('0x4d')][_0xb052('0x2e')](_0x2eee5a)[_0xb052('0x1e')](function(_0x459bcc){_0xa7ff3b[_0xb052('0x2e')]=_0x459bcc;if(_0x1e4888['query']['includeAll']){_0x2fdd5c[_0xb052('0x4e')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2fdd5c);})[_0xb052('0x1e')](function(_0x595c33){_0xa7ff3b[_0xb052('0x4f')]=_0x595c33;return _0xa7ff3b;})[_0xb052('0x1e')](respondWithFilteredResult(_0x10e098,_0x2fdd5c))[_0xb052('0x50')](handleError(_0x10e098,null));};exports[_0xb052('0x51')]=function(_0x285189,_0x15960e){var _0xa49d8b={'raw':!![],'where':{'id':_0x285189['params']['id']}},_0x3c1027={};_0x3c1027['model']=_[_0xb052('0x3d')](db[_0xb052('0x4d')]['rawAttributes']);_0x3c1027[_0xb052('0x3e')]=_[_0xb052('0x3d')](_0x285189[_0xb052('0x3e')]);_0x3c1027['filters']=_[_0xb052('0x40')](_0x3c1027[_0xb052('0x3c')],_0x3c1027[_0xb052('0x3e')]);_0xa49d8b[_0xb052('0x41')]=_[_0xb052('0x40')](_0x3c1027[_0xb052('0x3c')],qs[_0xb052('0x42')](_0x285189[_0xb052('0x3e')]['fields']));_0xa49d8b['attributes']=_0xa49d8b[_0xb052('0x41')][_0xb052('0x43')]?_0xa49d8b['attributes']:_0x3c1027[_0xb052('0x3c')];if(_0x285189[_0xb052('0x3e')][_0xb052('0x52')]){_0xa49d8b[_0xb052('0x4e')]=[{'all':!![]}];}_0xa49d8b=_['merge']({},_0xa49d8b,_0x285189[_0xb052('0x53')]);return db['ChatMessage'][_0xb052('0x54')](_0xa49d8b)[_0xb052('0x1e')](handleEntityNotFound(_0x15960e,null))[_0xb052('0x1e')](respondWithResult(_0x15960e,null))[_0xb052('0x50')](handleError(_0x15960e,null));};exports['create']=function(_0x3c350a,_0x5871c8){return db['ChatMessage'][_0xb052('0x55')](_0x3c350a[_0xb052('0x56')],{})['then'](respondWithResult(_0x5871c8,0xc9))[_0xb052('0x50')](handleError(_0x5871c8,null));};exports[_0xb052('0x57')]=function(_0x34b579,_0x445c19){if(_0x34b579[_0xb052('0x56')]['id']){delete _0x34b579[_0xb052('0x56')]['id'];}return db[_0xb052('0x4d')][_0xb052('0x54')]({'where':{'id':_0x34b579[_0xb052('0x58')]['id']}})[_0xb052('0x1e')](handleEntityNotFound(_0x445c19,null))[_0xb052('0x1e')](saveUpdates(_0x34b579['body'],null))['then'](respondWithResult(_0x445c19,null))[_0xb052('0x50')](handleError(_0x445c19,null));};exports[_0xb052('0x34')]=function(_0x1a2c4f,_0x34da96){return db[_0xb052('0x4d')][_0xb052('0x54')]({'where':{'id':_0x1a2c4f[_0xb052('0x58')]['id']}})['then'](handleEntityNotFound(_0x34da96,null))[_0xb052('0x1e')](removeEntity(_0x34da96,null))[_0xb052('0x50')](handleError(_0x34da96,null));};exports['describe']=function(_0x584f20,_0x3dc18e){return db[_0xb052('0x4d')]['describe']()[_0xb052('0x1e')](respondWithResult(_0x3dc18e,null))[_0xb052('0x50')](handleError(_0x3dc18e,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xb052('0x59')]=function(_0x5e3788,_0x3df70d,_0x26399e){var _0x492b9c={'agent':{},'channel':'chat'};if(_0x5e3788[_0xb052('0x56')]['id']){delete _0x5e3788[_0xb052('0x56')]['id'];}_0x5e3788[_0xb052('0x56')][_0xb052('0x5a')]=!![];_0x5e3788[_0xb052('0x56')]['readAt']=moment()[_0xb052('0x5b')](_0xb052('0x5c'));_0x5e3788[_0xb052('0x56')][_0xb052('0x5d')]=_0x5e3788['body'][_0xb052('0x5d')]||_0x5e3788[_0xb052('0x5e')]['id'];_0x492b9c[_0xb052('0x5f')]['id']=_0x5e3788['body'][_0xb052('0x5d')];return db[_0xb052('0x4d')]['find']({'where':{'id':_0x5e3788[_0xb052('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3df70d,null))[_0xb052('0x1e')](saveUpdates(_0x5e3788[_0xb052('0x56')],null))['then'](function(_0xf06625){if(_0xf06625){_0x492b9c[_0xb052('0x26')]=_0xf06625[_0xb052('0x60')]({'plain':!![]});return db[_0xb052('0x61')][_0xb052('0x54')]({'where':{'id':_0xf06625[_0xb052('0x62')]}});}return null;})[_0xb052('0x1e')](handleEntityNotFound(_0x3df70d,null))[_0xb052('0x1e')](function(_0xd16fb6){if(_0xd16fb6){return _0xd16fb6[_0xb052('0x57')]({'UserId':_0x5e3788[_0xb052('0x56')][_0xb052('0x5d')],'read1stAt':_[_0xb052('0x63')](_0xd16fb6[_0xb052('0x64')])?moment()[_0xb052('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb052('0x1e')](function(_0x5ef624){if(_0x5ef624){_0x492b9c[_0xb052('0x65')]=_0x5ef624['get']({'plain':!![]});interaction_log[_0xb052('0x1f')](_0xb052('0x66'),_0x5e3788[_0xb052('0x5e')]['id'],_0x5e3788[_0xb052('0x5e')][_0xb052('0x36')],_0x5e3788[_0xb052('0x5e')][_0xb052('0x67')],_0x492b9c[_0xb052('0x65')]['id'],_0x5e3788[_0xb052('0x56')]?JSON[_0xb052('0x23')](_0x5e3788[_0xb052('0x56')]):_0xb052('0x68'));return respondWithRpcPromise(_0xb052('0x69'),_0xb052('0x6a'),_0x492b9c);}return null;})[_0xb052('0x1e')](function(_0x758d38){var _0x4dce6b=_0xb052('0x6b')+_0x758d38[_0xb052('0x26')]['ContactId'];return db[_0xb052('0x6c')][_0xb052('0x3e')](_0x4dce6b,{'type':db['Sequelize'][_0xb052('0x6d')][_0xb052('0x6e')],'raw':!![]})[_0xb052('0x1e')](function(_0x43b56a){return _0x43b56a;});})[_0xb052('0x1e')](function(_0x23eea8){if(_0x23eea8){_0x492b9c[_0xb052('0x26')]['contact']=_0x23eea8[0x0];if(!_0x5e3788[_0xb052('0x56')][_0xb052('0x5d')])return;return db[_0xb052('0x6f')][_0xb052('0x54')]({'where':{'id':_0x5e3788[_0xb052('0x56')][_0xb052('0x5d')],'role':_0xb052('0x5f')},'attributes':['id',_0xb052('0x36'),'fullname','email',_0xb052('0x70')],'raw':!![]});}return null;})[_0xb052('0x1e')](function(_0x3f9c0c){if(!_0x3f9c0c)return null;_0x492b9c['message'][_0xb052('0x5f')]=_0x3f9c0c;return _0x492b9c;})['then'](function(_0x167f8e){if(_0x167f8e){if(_0x5e3788['body'][_0xb052('0x71')]){_0x492b9c['message'][_0xb052('0x72')]=util[_0xb052('0x5b')](_0xb052('0x73'),_0x5e3788[_0xb052('0x5e')][_0xb052('0x36')]);_0x492b9c[_0xb052('0x26')][_0xb052('0x74')]=_0x492b9c[_0xb052('0x74')];_0x492b9c[_0xb052('0x26')]['motionChannel']=_0x492b9c[_0xb052('0x74')];_0x492b9c[_0xb052('0x26')][_0xb052('0x75')]=_0xb052('0x59');return respondWithRpcPromise(_0xb052('0x76'),_0xb052('0x76'),{'event':_0xb052('0x77'),'message':_[_0xb052('0x49')](_0x492b9c['message'],JSON[_0xb052('0x78')](_0x492b9c[_0xb052('0x65')][_0xb052('0x79')]))},client9002)[_0xb052('0x1e')](function(){return _0x492b9c;});}return _0x492b9c;}return null;})[_0xb052('0x1e')](respondWithResult(_0x3df70d,null))[_0xb052('0x50')](handleError(_0x3df70d,null));};var interaction_log=require('../../config/logger')(_0xb052('0x7a'));exports[_0xb052('0x32')]=function(_0x43d542,_0x4ad614,_0x35c52f){var _0x586f29={'agent':{},'channel':_0xb052('0x7b')};if(_0x43d542['body']['id']){delete _0x43d542[_0xb052('0x56')]['id'];}_0x43d542['body'][_0xb052('0x5d')]=_0x43d542[_0xb052('0x56')]['UserId']||_0x43d542[_0xb052('0x5e')]['id'];_0x586f29[_0xb052('0x5f')]['id']=_0x43d542[_0xb052('0x56')][_0xb052('0x5d')];return db[_0xb052('0x4d')]['find']({'where':{'id':_0x43d542[_0xb052('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4ad614,null))[_0xb052('0x1e')](function(_0x14b028){if(_0x14b028){_0x586f29['message']=_0x14b028[_0xb052('0x60')]({'plain':!![]});return db['ChatInteraction'][_0xb052('0x54')]({'where':{'id':_0x14b028[_0xb052('0x62')]}});}return null;})[_0xb052('0x1e')](handleEntityNotFound(_0x4ad614,null))['then'](function(_0x327752){if(_0x327752){_0x586f29['interaction']=_0x327752[_0xb052('0x60')]({'plain':!![]});interaction_log[_0xb052('0x1f')](_0xb052('0x7c'),_0x43d542[_0xb052('0x5e')]['id'],_0x43d542[_0xb052('0x5e')][_0xb052('0x36')],_0x43d542['user']['role'],_0x586f29[_0xb052('0x65')]['id'],_0x43d542[_0xb052('0x56')]?JSON[_0xb052('0x23')](_0x43d542['body']):'null');return respondWithRpcPromise(_0xb052('0x7d'),_0xb052('0x7e'),_0x586f29);}return null;})[_0xb052('0x1e')](function(_0x490767){var _0x1f4096=_0xb052('0x6b')+_0x490767[_0xb052('0x26')]['ContactId'];return db['sequelize'][_0xb052('0x3e')](_0x1f4096,{'type':db[_0xb052('0x7f')][_0xb052('0x6d')][_0xb052('0x6e')],'raw':!![]})['then'](function(_0x1f680f){return _0x1f680f;});})['then'](function(_0x3700a4){if(_0x3700a4){_0x586f29[_0xb052('0x26')][_0xb052('0x80')]=_0x3700a4[0x0];if(!_0x43d542[_0xb052('0x56')][_0xb052('0x5d')])return;return db[_0xb052('0x6f')][_0xb052('0x54')]({'where':{'id':_0x43d542['body'][_0xb052('0x5d')],'role':_0xb052('0x5f')},'attributes':['id',_0xb052('0x36'),_0xb052('0x81'),_0xb052('0x82'),_0xb052('0x70')],'raw':!![]});}return null;})[_0xb052('0x1e')](function(_0x20d7ad){if(!_0x20d7ad)return null;_0x586f29[_0xb052('0x26')][_0xb052('0x5f')]=_0x20d7ad;return _0x586f29;})[_0xb052('0x1e')](function(_0x3e0c64){if(_0x3e0c64){_0x3e0c64[_0xb052('0x26')][_0xb052('0x72')]=util[_0xb052('0x5b')](_0xb052('0x73'),_0x43d542[_0xb052('0x5e')][_0xb052('0x36')]);_0x3e0c64[_0xb052('0x26')]['channel']=_0x586f29[_0xb052('0x74')];_0x3e0c64[_0xb052('0x26')][_0xb052('0x83')]=_0x586f29['channel'];_0x3e0c64['message'][_0xb052('0x75')]=_0xb052('0x32');respondWithRpcPromise('EventManager',_0xb052('0x76'),{'event':_0xb052('0x84'),'message':_[_0xb052('0x49')](_0x586f29[_0xb052('0x26')],JSON[_0xb052('0x78')](_0x586f29[_0xb052('0x65')][_0xb052('0x79')]))},client9002);return _0x586f29;}return null;})[_0xb052('0x1e')](respondWithResult(_0x4ad614,null))[_0xb052('0x50')](handleError(_0x4ad614,null));};
\ No newline at end of file
+var _0x8084=['limit','undefined','count','json','reject','update','sendStatus','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','find','create','body','destroy','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','chat','ChatInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','motionChannel','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8084,0x1d9));var _0x4808=function(_0x5f5d98,_0x8b21df){_0x5f5d98=_0x5f5d98-0x0;var _0x1a9dea=_0x8084[_0x5f5d98];return _0x1a9dea;};'use strict';var emlformat=require(_0x4808('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4808('0x1'));var jsonpatch=require(_0x4808('0x2'));var rp=require(_0x4808('0x3'));var moment=require(_0x4808('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4808('0x5'));var util=require(_0x4808('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4808('0x7'));var ejs=require(_0x4808('0x8'));var fs=require('fs');var fs_extra=require(_0x4808('0x9'));var _=require(_0x4808('0xa'));var squel=require('squel');var crypto=require(_0x4808('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4808('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4808('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4808('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4808('0xe'));var logger=require(_0x4808('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x4808('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x4808('0x11'))['db'];config[_0x4808('0x12')]=_[_0x4808('0x13')](config[_0x4808('0x12')],{'host':_0x4808('0x14'),'port':0x18eb});var socket=require(_0x4808('0x15'))(new Redis(config[_0x4808('0x12')]));require(_0x4808('0x16'))[_0x4808('0x17')](socket);var jayson=require(_0x4808('0x18'));var client=jayson[_0x4808('0x19')][_0x4808('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x4808('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x80ab62,_0x1c339b,_0x1b213a,_0x299e57){return new BPromise(function(_0x28510b,_0x3255b0){var _0x1d229a=_0x299e57||client;return _0x1d229a[_0x4808('0x1b')](_0x80ab62,_0x1b213a)[_0x4808('0x1c')](function(_0x10cd20){logger[_0x4808('0x1d')](_0x4808('0x1e'),_0x1c339b,_0x4808('0x1f'));logger[_0x4808('0x20')](_0x4808('0x21'),_0x1c339b,'request\x20sent',JSON[_0x4808('0x22')](_0x10cd20));if(_0x10cd20[_0x4808('0x23')]){if(_0x10cd20[_0x4808('0x23')][_0x4808('0x24')]===0x1f4){logger[_0x4808('0x23')](_0x4808('0x1e'),_0x1c339b,_0x10cd20[_0x4808('0x23')][_0x4808('0x25')]);return _0x3255b0(_0x10cd20[_0x4808('0x23')][_0x4808('0x25')]);}logger[_0x4808('0x23')]('ChatMessage,\x20%s,\x20%s',_0x1c339b,_0x10cd20[_0x4808('0x23')][_0x4808('0x25')]);return _0x28510b(_0x10cd20[_0x4808('0x23')][_0x4808('0x25')]);}else{logger[_0x4808('0x1d')](_0x4808('0x1e'),_0x1c339b,'request\x20sent');_0x28510b(_0x10cd20[_0x4808('0x26')][_0x4808('0x25')]);}})[_0x4808('0x27')](function(_0x2ee15f){logger[_0x4808('0x23')](_0x4808('0x1e'),_0x1c339b,_0x2ee15f);_0x3255b0(_0x2ee15f);});});}function respondWithStatusCode(_0x36647d,_0x21e404){_0x21e404=_0x21e404||0xcc;return function(_0x2891f9){if(_0x2891f9){return _0x36647d['sendStatus'](_0x21e404);}return _0x36647d[_0x4808('0x28')](_0x21e404)[_0x4808('0x29')]();};}function respondWithResult(_0x1808bf,_0x2280e0){_0x2280e0=_0x2280e0||0xc8;return function(_0x5b7194){if(_0x5b7194){return _0x1808bf[_0x4808('0x28')](_0x2280e0)['json'](_0x5b7194);}};}function respondWithFilteredResult(_0x1041a1,_0x5eb747){return function(_0x214626){if(_0x214626){var _0x5af70f=typeof _0x5eb747[_0x4808('0x2a')]==='undefined'&&typeof _0x5eb747[_0x4808('0x2b')]===_0x4808('0x2c');var _0x3b1699=_0x214626[_0x4808('0x2d')];var _0x518148=_0x5af70f?0x0:_0x5eb747['offset'];var _0x3c0c5b=_0x5af70f?_0x214626[_0x4808('0x2d')]:_0x5eb747[_0x4808('0x2a')]+_0x5eb747[_0x4808('0x2b')];var _0x3f5484;if(_0x3c0c5b>=_0x3b1699){_0x3c0c5b=_0x3b1699;_0x3f5484=0xc8;}else{_0x3f5484=0xce;}_0x1041a1[_0x4808('0x28')](_0x3f5484);return _0x1041a1['set']('Content-Range',_0x518148+'-'+_0x3c0c5b+'/'+_0x3b1699)[_0x4808('0x2e')](_0x214626);}return null;};}function patchUpdates(_0x315584){return function(_0x56b1dd){try{jsonpatch['apply'](_0x56b1dd,_0x315584,!![]);}catch(_0x26312a){return BPromise[_0x4808('0x2f')](_0x26312a);}return _0x56b1dd['save']();};}function saveUpdates(_0xe6617a,_0x46104f){return function(_0x1eb4f3){if(_0x1eb4f3){return _0x1eb4f3[_0x4808('0x30')](_0xe6617a)[_0x4808('0x1c')](function(_0x1fbb27){return _0x1fbb27;});}return null;};}function removeEntity(_0x287dd8,_0xaf0b7c){return function(_0x3d5bc9){if(_0x3d5bc9){return _0x3d5bc9['destroy']()[_0x4808('0x1c')](function(){_0x287dd8['status'](0xcc)[_0x4808('0x29')]();});}};}function handleEntityNotFound(_0x2527e6,_0x36219f){return function(_0xedb3ef){if(!_0xedb3ef){_0x2527e6[_0x4808('0x31')](0x194);}return _0xedb3ef;};}function handleError(_0x3aeda8,_0xf859c7){_0xf859c7=_0xf859c7||0x1f4;return function(_0x44e8eb){logger[_0x4808('0x23')](_0x44e8eb[_0x4808('0x32')]);if(_0x44e8eb['name']){delete _0x44e8eb[_0x4808('0x33')];}_0x3aeda8[_0x4808('0x28')](_0xf859c7)[_0x4808('0x34')](_0x44e8eb);};}exports[_0x4808('0x35')]=function(_0x30c44,_0x3cf1ce){var _0x373916={},_0x55645a={},_0x571787={'count':0x0,'rows':[]};var _0x5363cc=_['map'](db[_0x4808('0x36')][_0x4808('0x37')],function(_0x5ab08c){return{'name':_0x5ab08c[_0x4808('0x38')],'type':_0x5ab08c[_0x4808('0x39')]['key']};});_0x55645a[_0x4808('0x3a')]=_[_0x4808('0x3b')](_0x5363cc,_0x4808('0x33'));_0x55645a[_0x4808('0x3c')]=_['keys'](_0x30c44['query']);_0x55645a[_0x4808('0x3d')]=_[_0x4808('0x3e')](_0x55645a[_0x4808('0x3a')],_0x55645a[_0x4808('0x3c')]);_0x373916['attributes']=_[_0x4808('0x3e')](_0x55645a[_0x4808('0x3a')],qs[_0x4808('0x3f')](_0x30c44[_0x4808('0x3c')][_0x4808('0x3f')]));_0x373916[_0x4808('0x40')]=_0x373916[_0x4808('0x40')][_0x4808('0x41')]?_0x373916['attributes']:_0x55645a[_0x4808('0x3a')];if(!_0x30c44[_0x4808('0x3c')][_0x4808('0x42')](_0x4808('0x43'))){_0x373916['limit']=qs[_0x4808('0x2b')](_0x30c44[_0x4808('0x3c')][_0x4808('0x2b')]);_0x373916[_0x4808('0x2a')]=qs[_0x4808('0x2a')](_0x30c44[_0x4808('0x3c')][_0x4808('0x2a')]);}_0x373916[_0x4808('0x44')]=qs[_0x4808('0x45')](_0x30c44[_0x4808('0x3c')][_0x4808('0x45')]);_0x373916[_0x4808('0x46')]=qs[_0x4808('0x3d')](_[_0x4808('0x47')](_0x30c44[_0x4808('0x3c')],_0x55645a[_0x4808('0x3d')]),_0x5363cc);if(_0x30c44[_0x4808('0x3c')][_0x4808('0x48')]){_0x373916['where']=_[_0x4808('0x49')](_0x373916[_0x4808('0x46')],{'$or':_[_0x4808('0x3b')](_0x5363cc,function(_0x12d60c){if(_0x12d60c[_0x4808('0x39')]!==_0x4808('0x4a')){var _0x17214f={};_0x17214f[_0x12d60c['name']]={'$like':'%'+_0x30c44[_0x4808('0x3c')][_0x4808('0x48')]+'%'};return _0x17214f;}})});}_0x373916=_[_0x4808('0x49')]({},_0x373916,_0x30c44['options']);var _0x303710={'where':_0x373916[_0x4808('0x46')]};return db[_0x4808('0x36')][_0x4808('0x2d')](_0x303710)[_0x4808('0x1c')](function(_0x5cce37){_0x571787[_0x4808('0x2d')]=_0x5cce37;if(_0x30c44[_0x4808('0x3c')][_0x4808('0x4b')]){_0x373916[_0x4808('0x4c')]=[{'all':!![]}];}return db[_0x4808('0x36')]['findAll'](_0x373916);})['then'](function(_0x442042){_0x571787[_0x4808('0x4d')]=_0x442042;return _0x571787;})[_0x4808('0x1c')](respondWithFilteredResult(_0x3cf1ce,_0x373916))['catch'](handleError(_0x3cf1ce,null));};exports[_0x4808('0x4e')]=function(_0x37aa29,_0x580279){var _0x5a2e23={'raw':!![],'where':{'id':_0x37aa29[_0x4808('0x4f')]['id']}},_0x4dec63={};_0x4dec63[_0x4808('0x3a')]=_[_0x4808('0x50')](db[_0x4808('0x36')]['rawAttributes']);_0x4dec63['query']=_[_0x4808('0x50')](_0x37aa29[_0x4808('0x3c')]);_0x4dec63['filters']=_['intersection'](_0x4dec63[_0x4808('0x3a')],_0x4dec63['query']);_0x5a2e23[_0x4808('0x40')]=_[_0x4808('0x3e')](_0x4dec63[_0x4808('0x3a')],qs[_0x4808('0x3f')](_0x37aa29['query'][_0x4808('0x3f')]));_0x5a2e23[_0x4808('0x40')]=_0x5a2e23[_0x4808('0x40')]['length']?_0x5a2e23['attributes']:_0x4dec63[_0x4808('0x3a')];if(_0x37aa29[_0x4808('0x3c')][_0x4808('0x4b')]){_0x5a2e23['include']=[{'all':!![]}];}_0x5a2e23=_['merge']({},_0x5a2e23,_0x37aa29['options']);return db[_0x4808('0x36')][_0x4808('0x51')](_0x5a2e23)[_0x4808('0x1c')](handleEntityNotFound(_0x580279,null))[_0x4808('0x1c')](respondWithResult(_0x580279,null))['catch'](handleError(_0x580279,null));};exports[_0x4808('0x52')]=function(_0x5a4ae5,_0x4870be){return db[_0x4808('0x36')][_0x4808('0x52')](_0x5a4ae5[_0x4808('0x53')],{})[_0x4808('0x1c')](respondWithResult(_0x4870be,0xc9))[_0x4808('0x27')](handleError(_0x4870be,null));};exports[_0x4808('0x30')]=function(_0x25815a,_0x3c6300){if(_0x25815a[_0x4808('0x53')]['id']){delete _0x25815a[_0x4808('0x53')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x25815a[_0x4808('0x4f')]['id']}})[_0x4808('0x1c')](handleEntityNotFound(_0x3c6300,null))[_0x4808('0x1c')](saveUpdates(_0x25815a[_0x4808('0x53')],null))[_0x4808('0x1c')](respondWithResult(_0x3c6300,null))[_0x4808('0x27')](handleError(_0x3c6300,null));};exports[_0x4808('0x54')]=function(_0x395a6f,_0x29c8d4){return db[_0x4808('0x36')][_0x4808('0x51')]({'where':{'id':_0x395a6f[_0x4808('0x4f')]['id']}})[_0x4808('0x1c')](handleEntityNotFound(_0x29c8d4,null))[_0x4808('0x1c')](removeEntity(_0x29c8d4,null))[_0x4808('0x27')](handleError(_0x29c8d4,null));};exports[_0x4808('0x55')]=function(_0x57cd2e,_0x23a21a){return db[_0x4808('0x36')][_0x4808('0x55')]()[_0x4808('0x1c')](respondWithResult(_0x23a21a,null))['catch'](handleError(_0x23a21a,null));};var interaction_log=require(_0x4808('0xf'))(_0x4808('0x56'));exports[_0x4808('0x57')]=function(_0x16cae5,_0x17893e,_0x23221b){var _0x13f168={'agent':{},'channel':'chat'};if(_0x16cae5[_0x4808('0x53')]['id']){delete _0x16cae5[_0x4808('0x53')]['id'];}_0x16cae5['body'][_0x4808('0x58')]=!![];_0x16cae5[_0x4808('0x53')][_0x4808('0x59')]=moment()[_0x4808('0x5a')](_0x4808('0x5b'));_0x16cae5['body'][_0x4808('0x5c')]=_0x16cae5[_0x4808('0x53')][_0x4808('0x5c')]||_0x16cae5[_0x4808('0x5d')]['id'];_0x13f168['agent']['id']=_0x16cae5['body'][_0x4808('0x5c')];return db['ChatMessage'][_0x4808('0x51')]({'where':{'id':_0x16cae5[_0x4808('0x4f')]['id'],'UserId':null}})[_0x4808('0x1c')](handleEntityNotFound(_0x17893e,null))[_0x4808('0x1c')](saveUpdates(_0x16cae5[_0x4808('0x53')],null))[_0x4808('0x1c')](function(_0x33254d){if(_0x33254d){_0x13f168['message']=_0x33254d['get']({'plain':!![]});return db['ChatInteraction'][_0x4808('0x51')]({'where':{'id':_0x33254d[_0x4808('0x5e')]}});}return null;})[_0x4808('0x1c')](handleEntityNotFound(_0x17893e,null))[_0x4808('0x1c')](function(_0x2131c9){if(_0x2131c9){return _0x2131c9['update']({'UserId':_0x16cae5[_0x4808('0x53')][_0x4808('0x5c')],'read1stAt':_[_0x4808('0x5f')](_0x2131c9[_0x4808('0x60')])?moment()[_0x4808('0x5a')](_0x4808('0x5b')):undefined});}return null;})[_0x4808('0x1c')](function(_0x10475e){if(_0x10475e){_0x13f168[_0x4808('0x61')]=_0x10475e[_0x4808('0x62')]({'plain':!![]});interaction_log['info'](_0x4808('0x63'),_0x16cae5[_0x4808('0x5d')]['id'],_0x16cae5[_0x4808('0x5d')][_0x4808('0x33')],_0x16cae5[_0x4808('0x5d')][_0x4808('0x64')],_0x13f168[_0x4808('0x61')]['id'],_0x16cae5[_0x4808('0x53')]?JSON[_0x4808('0x22')](_0x16cae5[_0x4808('0x53')]):_0x4808('0x65'));return respondWithRpcPromise(_0x4808('0x66'),_0x4808('0x67'),_0x13f168);}return null;})[_0x4808('0x1c')](function(_0x5c2950){var _0x1deda5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c2950[_0x4808('0x25')][_0x4808('0x68')];return db[_0x4808('0x69')]['query'](_0x1deda5,{'type':db['Sequelize'][_0x4808('0x6a')][_0x4808('0x6b')],'raw':!![]})[_0x4808('0x1c')](function(_0x4233a0){return _0x4233a0;});})[_0x4808('0x1c')](function(_0x46005d){if(_0x46005d){_0x13f168['message'][_0x4808('0x6c')]=_0x46005d[0x0];if(!_0x16cae5['body'][_0x4808('0x5c')])return;return db['User'][_0x4808('0x51')]({'where':{'id':_0x16cae5[_0x4808('0x53')]['UserId'],'role':_0x4808('0x6d')},'attributes':['id','name','fullname',_0x4808('0x6e'),_0x4808('0x6f')],'raw':!![]});}return null;})[_0x4808('0x1c')](function(_0x542e43){if(!_0x542e43)return null;_0x13f168[_0x4808('0x25')][_0x4808('0x6d')]=_0x542e43;return _0x13f168;})[_0x4808('0x1c')](function(_0x4ae7f1){if(_0x4ae7f1){if(_0x16cae5[_0x4808('0x53')][_0x4808('0x70')]){_0x13f168[_0x4808('0x25')][_0x4808('0x71')]=util['format'](_0x4808('0x72'),_0x16cae5[_0x4808('0x5d')][_0x4808('0x33')]);_0x13f168[_0x4808('0x25')][_0x4808('0x73')]=_0x13f168[_0x4808('0x73')];_0x13f168['message']['motionChannel']=_0x13f168['channel'];_0x13f168[_0x4808('0x25')][_0x4808('0x74')]='accept';return respondWithRpcPromise('EventManager',_0x4808('0x75'),{'event':_0x4808('0x76'),'message':_[_0x4808('0x49')](_0x13f168[_0x4808('0x25')],JSON['parse'](_0x13f168[_0x4808('0x61')][_0x4808('0x77')]))},client9002)[_0x4808('0x1c')](function(){return _0x13f168;});}return _0x13f168;}return null;})[_0x4808('0x1c')](respondWithResult(_0x17893e,null))['catch'](handleError(_0x17893e,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x4808('0x2f')]=function(_0x5bb11a,_0x43849b,_0x3478d2){var _0x2edc22={'agent':{},'channel':_0x4808('0x78')};if(_0x5bb11a[_0x4808('0x53')]['id']){delete _0x5bb11a['body']['id'];}_0x5bb11a[_0x4808('0x53')][_0x4808('0x5c')]=_0x5bb11a[_0x4808('0x53')][_0x4808('0x5c')]||_0x5bb11a[_0x4808('0x5d')]['id'];_0x2edc22[_0x4808('0x6d')]['id']=_0x5bb11a[_0x4808('0x53')][_0x4808('0x5c')];return db[_0x4808('0x36')]['find']({'where':{'id':_0x5bb11a[_0x4808('0x4f')]['id'],'UserId':null}})[_0x4808('0x1c')](handleEntityNotFound(_0x43849b,null))[_0x4808('0x1c')](function(_0x3a3cb5){if(_0x3a3cb5){_0x2edc22['message']=_0x3a3cb5[_0x4808('0x62')]({'plain':!![]});return db[_0x4808('0x79')]['find']({'where':{'id':_0x3a3cb5[_0x4808('0x5e')]}});}return null;})[_0x4808('0x1c')](handleEntityNotFound(_0x43849b,null))[_0x4808('0x1c')](function(_0x30f6df){if(_0x30f6df){_0x2edc22['interaction']=_0x30f6df[_0x4808('0x62')]({'plain':!![]});interaction_log[_0x4808('0x1d')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bb11a[_0x4808('0x5d')]['id'],_0x5bb11a[_0x4808('0x5d')][_0x4808('0x33')],_0x5bb11a[_0x4808('0x5d')][_0x4808('0x64')],_0x2edc22[_0x4808('0x61')]['id'],_0x5bb11a[_0x4808('0x53')]?JSON[_0x4808('0x22')](_0x5bb11a[_0x4808('0x53')]):'null');return respondWithRpcPromise(_0x4808('0x7a'),_0x4808('0x7b'),_0x2edc22);}return null;})[_0x4808('0x1c')](function(_0x20cfd7){var _0x4ceca6=_0x4808('0x7c')+_0x20cfd7[_0x4808('0x25')]['ContactId'];return db[_0x4808('0x69')][_0x4808('0x3c')](_0x4ceca6,{'type':db['Sequelize'][_0x4808('0x6a')]['SELECT'],'raw':!![]})[_0x4808('0x1c')](function(_0xe37d31){return _0xe37d31;});})[_0x4808('0x1c')](function(_0x3e8536){if(_0x3e8536){_0x2edc22[_0x4808('0x25')]['contact']=_0x3e8536[0x0];if(!_0x5bb11a[_0x4808('0x53')]['UserId'])return;return db[_0x4808('0x7d')][_0x4808('0x51')]({'where':{'id':_0x5bb11a[_0x4808('0x53')][_0x4808('0x5c')],'role':_0x4808('0x6d')},'attributes':['id',_0x4808('0x33'),'fullname',_0x4808('0x6e'),_0x4808('0x6f')],'raw':!![]});}return null;})[_0x4808('0x1c')](function(_0x56976d){if(!_0x56976d)return null;_0x2edc22[_0x4808('0x25')]['agent']=_0x56976d;return _0x2edc22;})[_0x4808('0x1c')](function(_0x2a41c4){if(_0x2a41c4){_0x2a41c4['message'][_0x4808('0x71')]=util[_0x4808('0x5a')](_0x4808('0x72'),_0x5bb11a['user'][_0x4808('0x33')]);_0x2a41c4['message'][_0x4808('0x73')]=_0x2edc22[_0x4808('0x73')];_0x2a41c4[_0x4808('0x25')][_0x4808('0x7e')]=_0x2edc22['channel'];_0x2a41c4[_0x4808('0x25')][_0x4808('0x74')]=_0x4808('0x2f');respondWithRpcPromise(_0x4808('0x75'),_0x4808('0x75'),{'event':_0x4808('0x7f'),'message':_['merge'](_0x2edc22[_0x4808('0x25')],JSON[_0x4808('0x80')](_0x2edc22[_0x4808('0x61')]['formData']))},client9002);return _0x2edc22;}return null;})[_0x4808('0x1c')](respondWithResult(_0x43849b,null))[_0x4808('0x27')](handleError(_0x43849b,null));};
\ No newline at end of file
index d362438..cf41dbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c86=['hasOwnProperty','hook','events','remove','emit'];(function(_0x3cca9e,_0x458f49){var _0x20c387=function(_0x179664){while(--_0x179664){_0x3cca9e['push'](_0x3cca9e['shift']());}};_0x20c387(++_0x458f49);}(_0x2c86,0x179));var _0x62c8=function(_0x11db85,_0x2838b3){_0x11db85=_0x11db85-0x0;var _0xfb8312=_0x2c86[_0x11db85];return _0xfb8312;};'use strict';var EventEmitter=require(_0x62c8('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x62c8('0x1')};function emitEvent(_0x42900){return function(_0xc5452,_0x570936,_0x270a18){ChatMessageEvents[_0x62c8('0x2')](_0x42900+':'+_0xc5452['id'],_0xc5452);ChatMessageEvents[_0x62c8('0x2')](_0x42900,_0xc5452);_0x270a18(null);};}for(var e in events){if(events[_0x62c8('0x3')](e)){var event=events[e];ChatMessage[_0x62c8('0x4')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x5d66=['update','emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d66,0x12c));var _0x65d6=function(_0xabf09f,_0x56293f){_0xabf09f=_0xabf09f-0x0;var _0x1cdfce=_0x5d66[_0xabf09f];return _0x1cdfce;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x65d6('0x0'))['db'][_0x65d6('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x65d6('0x2')](0x0);var events={'afterCreate':_0x65d6('0x3'),'afterUpdate':_0x65d6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e1e10){return function(_0x3805da,_0x5d7682,_0x521ae6){ChatMessageEvents[_0x65d6('0x5')](_0x2e1e10+':'+_0x3805da['id'],_0x3805da);ChatMessageEvents[_0x65d6('0x5')](_0x2e1e10,_0x3805da);_0x521ae6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x65d6('0x6')](e,emitEvent(event));}}module[_0x65d6('0x7')]=ChatMessageEvents;
\ No newline at end of file
index 99f9eb8..3e2bebe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff84=['ChatInteraction','findOne','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','isNil'];(function(_0x3020be,_0x25023c){var _0x1beed5=function(_0x41b0d6){while(--_0x41b0d6){_0x3020be['push'](_0x3020be['shift']());}};_0x1beed5(++_0x25023c);}(_0xff84,0x18d));var _0x4ff8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xff84[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x4ff8('0x0'));var util=require(_0x4ff8('0x1'));var logger=require(_0x4ff8('0x2'))(_0x4ff8('0x3'));var moment=require(_0x4ff8('0x4'));var BPromise=require(_0x4ff8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ff8('0x6'));var rimraf=require('rimraf');var config=require(_0x4ff8('0x7'));var attributes=require(_0x4ff8('0x8'));module[_0x4ff8('0x9')]=function(_0x107fa4,_0x5cd049){return _0x107fa4[_0x4ff8('0xa')](_0x4ff8('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x4ff8('0xc'),'fields':['body'],'type':_0x4ff8('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x592e3b,_0x25cc72,_0x7d97b0){var _0x1ce1e6=_0x107fa4[_0x4ff8('0xe')];var _0x1239b4=_0x592e3b['get']({'plain':!![]});if(_0x1239b4[_0x4ff8('0xf')][_0x4ff8('0x10')]()==='in'||_0x1239b4['direction'][_0x4ff8('0x10')]()===_0x4ff8('0x11')&&!_0x1239b4['secret']&&!_[_0x4ff8('0x12')](_0x1239b4['UserId'])){_0x1ce1e6[_0x4ff8('0x13')][_0x4ff8('0x14')]({'where':{'id':_0x1239b4['ChatInteractionId']}})['then'](function(_0x312a5b){if(_0x312a5b){_0x312a5b[_0x4ff8('0x15')]({'lastMsgAt':_0x1239b4[_0x4ff8('0x16')],'lastMsgDirection':_0x1239b4[_0x4ff8('0xf')][_0x4ff8('0x10')]()});}})['catch'](function(_0x4937c8){console[_0x4ff8('0x17')](_0x4937c8);});}_0x7d97b0();}},'charset':_0x4ff8('0x18'),'collate':_0x4ff8('0x19')});};
\ No newline at end of file
+var _0xcb3c=['direction','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','toLowerCase'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcb3c,0x150));var _0xccb3=function(_0x5b20ef,_0x15f3aa){_0x5b20ef=_0x5b20ef-0x0;var _0xd04a72=_0xcb3c[_0x5b20ef];return _0xd04a72;};'use strict';var _=require(_0xccb3('0x0'));var util=require(_0xccb3('0x1'));var logger=require(_0xccb3('0x2'))(_0xccb3('0x3'));var moment=require('moment');var BPromise=require(_0xccb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xccb3('0x5'));var rimraf=require('rimraf');var config=require(_0xccb3('0x6'));var attributes=require(_0xccb3('0x7'));module[_0xccb3('0x8')]=function(_0x3c02f3,_0x56eec1){return _0x3c02f3[_0xccb3('0x9')](_0xccb3('0xa'),attributes,{'tableName':_0xccb3('0xb'),'paranoid':![],'indexes':[{'name':_0xccb3('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ccda4,_0x3eedd4,_0x49298f){var _0x451c06=_0x3c02f3[_0xccb3('0xd')];var _0x3c4eb2=_0x4ccda4['get']({'plain':!![]});if(_0x3c4eb2['direction'][_0xccb3('0xe')]()==='in'||_0x3c4eb2[_0xccb3('0xf')][_0xccb3('0xe')]()===_0xccb3('0x10')&&!_0x3c4eb2[_0xccb3('0x11')]&&!_[_0xccb3('0x12')](_0x3c4eb2['UserId'])){_0x451c06[_0xccb3('0x13')][_0xccb3('0x14')]({'where':{'id':_0x3c4eb2[_0xccb3('0x15')]}})[_0xccb3('0x16')](function(_0x1744a4){if(_0x1744a4){_0x1744a4[_0xccb3('0x17')]({'lastMsgAt':_0x3c4eb2[_0xccb3('0x18')],'lastMsgDirection':_0x3c4eb2['direction'][_0xccb3('0xe')]()});}})[_0xccb3('0x19')](function(_0x59c508){console[_0xccb3('0x1a')](_0x59c508);});}_0x49298f();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 228055e..55a95a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa23e=['result','catch','ChatMessage,\x20%s,\x20%s','CreateChatMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xc7663e,_0x38c05e){var _0x284c00=function(_0x2e6520){while(--_0x2e6520){_0xc7663e['push'](_0xc7663e['shift']());}};_0x284c00(++_0x38c05e);}(_0xa23e,0x69));var _0xea23=function(_0x386d44,_0x3aa1d5){_0x386d44=_0x386d44-0x0;var _0x401b0a=_0xa23e[_0x386d44];return _0x401b0a;};'use strict';var _=require(_0xea23('0x0'));var util=require(_0xea23('0x1'));var moment=require(_0xea23('0x2'));var BPromise=require(_0xea23('0x3'));var rs=require(_0xea23('0x4'));var fs=require('fs');var Redis=require(_0xea23('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xea23('0x6'));var logger=require(_0xea23('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xea23('0x8'));var client=jayson[_0xea23('0x9')]['http']({'port':0x232a});config[_0xea23('0xa')]=_[_0xea23('0xb')](config[_0xea23('0xa')],{'host':_0xea23('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea23('0xa')]));require('./chatMessage.socket')[_0xea23('0xd')](socket);function respondWithRpcPromise(_0xa00453,_0x442f5d,_0x264fe3){return new BPromise(function(_0x1ec4ed,_0x3b034b){return client[_0xea23('0xe')](_0xa00453,_0x264fe3)['then'](function(_0x1858be){logger[_0xea23('0xf')]('ChatMessage,\x20%s,\x20%s',_0x442f5d,_0xea23('0x10'));logger[_0xea23('0x11')](_0xea23('0x12'),_0x442f5d,_0xea23('0x10'),JSON[_0xea23('0x13')](_0x1858be));if(_0x1858be[_0xea23('0x14')]){if(_0x1858be[_0xea23('0x14')][_0xea23('0x15')]===0x1f4){logger[_0xea23('0x14')]('ChatMessage,\x20%s,\x20%s',_0x442f5d,_0x1858be['error'][_0xea23('0x16')]);return _0x3b034b(_0x1858be['error'][_0xea23('0x16')]);}logger[_0xea23('0x14')]('ChatMessage,\x20%s,\x20%s',_0x442f5d,_0x1858be[_0xea23('0x14')][_0xea23('0x16')]);return _0x1ec4ed(_0x1858be['error']['message']);}else{logger[_0xea23('0xf')]('ChatMessage,\x20%s,\x20%s',_0x442f5d,_0xea23('0x10'));_0x1ec4ed(_0x1858be[_0xea23('0x17')][_0xea23('0x16')]);}})[_0xea23('0x18')](function(_0x330043){logger[_0xea23('0x14')](_0xea23('0x19'),_0x442f5d,_0x330043);_0x3b034b(_0x330043);});});}exports[_0xea23('0x1a')]=function(_0x1baced){var _0x2589a5=this;return new Promise(function(_0x403245,_0x48de00){return db['ChatMessage'][_0xea23('0x1b')](_0x1baced[_0xea23('0x1c')],{'raw':_0x1baced['options']?_0x1baced[_0xea23('0x1d')][_0xea23('0x1e')]===undefined?!![]:![]:!![]})[_0xea23('0x1f')](function(_0x84be20){logger['info'](_0xea23('0x1a'),_0x1baced);logger[_0xea23('0x11')](_0xea23('0x1a'),_0x1baced,JSON[_0xea23('0x13')](_0x84be20));_0x403245(_0x84be20);})['catch'](function(_0x3ad8a5){logger[_0xea23('0x14')](_0xea23('0x1a'),_0x3ad8a5[_0xea23('0x16')],_0x1baced);_0x48de00(_0x2589a5[_0xea23('0x14')](0x1f4,_0x3ad8a5[_0xea23('0x16')]));});});};
\ No newline at end of file
+var _0x78b2=['code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','body','options','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x297e28,_0x3b1969){var _0xf97226=function(_0x3ca11f){while(--_0x3ca11f){_0x297e28['push'](_0x297e28['shift']());}};_0xf97226(++_0x3b1969);}(_0x78b2,0x7e));var _0x278b=function(_0x3ce7df,_0x764f4f){_0x3ce7df=_0x3ce7df-0x0;var _0x578a8a=_0x78b2[_0x3ce7df];return _0x578a8a;};'use strict';var _=require(_0x278b('0x0'));var util=require(_0x278b('0x1'));var moment=require(_0x278b('0x2'));var BPromise=require(_0x278b('0x3'));var rs=require(_0x278b('0x4'));var fs=require('fs');var Redis=require(_0x278b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x278b('0x6'));var logger=require(_0x278b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x278b('0x8')]=_['defaults'](config[_0x278b('0x8')],{'host':_0x278b('0x9'),'port':0x18eb});var socket=require(_0x278b('0xa'))(new Redis(config[_0x278b('0x8')]));require(_0x278b('0xb'))[_0x278b('0xc')](socket);function respondWithRpcPromise(_0x4f1bd0,_0x30eb0b,_0x2ffadd){return new BPromise(function(_0x3e5977,_0x3b126){return client[_0x278b('0xd')](_0x4f1bd0,_0x2ffadd)[_0x278b('0xe')](function(_0x1a55ec){logger['info']('ChatMessage,\x20%s,\x20%s',_0x30eb0b,'request\x20sent');logger[_0x278b('0xf')](_0x278b('0x10'),_0x30eb0b,_0x278b('0x11'),JSON['stringify'](_0x1a55ec));if(_0x1a55ec[_0x278b('0x12')]){if(_0x1a55ec[_0x278b('0x12')][_0x278b('0x13')]===0x1f4){logger[_0x278b('0x12')](_0x278b('0x14'),_0x30eb0b,_0x1a55ec[_0x278b('0x12')][_0x278b('0x15')]);return _0x3b126(_0x1a55ec[_0x278b('0x12')][_0x278b('0x15')]);}logger[_0x278b('0x12')](_0x278b('0x14'),_0x30eb0b,_0x1a55ec[_0x278b('0x12')][_0x278b('0x15')]);return _0x3e5977(_0x1a55ec[_0x278b('0x12')]['message']);}else{logger['info'](_0x278b('0x14'),_0x30eb0b,_0x278b('0x11'));_0x3e5977(_0x1a55ec['result']['message']);}})[_0x278b('0x16')](function(_0x201999){logger[_0x278b('0x12')](_0x278b('0x14'),_0x30eb0b,_0x201999);_0x3b126(_0x201999);});});}exports[_0x278b('0x17')]=function(_0x37f462){var _0x2499b7=this;return new Promise(function(_0x266997,_0x250563){return db[_0x278b('0x18')]['create'](_0x37f462[_0x278b('0x19')],{'raw':_0x37f462[_0x278b('0x1a')]?_0x37f462[_0x278b('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x278b('0xe')](function(_0xa2af8b){logger[_0x278b('0x1b')](_0x278b('0x17'),_0x37f462);logger[_0x278b('0xf')]('CreateChatMessage',_0x37f462,JSON[_0x278b('0x1c')](_0xa2af8b));_0x266997(_0xa2af8b);})[_0x278b('0x16')](function(_0x5c895c){logger[_0x278b('0x12')](_0x278b('0x17'),_0x5c895c[_0x278b('0x15')],_0x37f462);_0x250563(_0x2499b7[_0x278b('0x12')](0x1f4,_0x5c895c[_0x278b('0x15')]));});});};
\ No newline at end of file
index 5c2a525..7b97630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46fc=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x593f10,_0x1ce005){var _0x505d99=function(_0x15b56b){while(--_0x15b56b){_0x593f10['push'](_0x593f10['shift']());}};_0x505d99(++_0x1ce005);}(_0x46fc,0x103));var _0xc46f=function(_0x4ac266,_0x197dab){_0x4ac266=_0x4ac266-0x0;var _0x3c8fe3=_0x46fc[_0x4ac266];return _0x3c8fe3;};'use strict';var ChatMessageEvents=require(_0xc46f('0x0'));var events=[_0xc46f('0x1'),_0xc46f('0x2'),_0xc46f('0x3')];function createListener(_0x865c60,_0x9460ea){return function(_0x2bf9ee){_0x9460ea[_0xc46f('0x4')](_0x865c60,_0x2bf9ee);};}function removeListener(_0x3a56db,_0x5b0483){return function(){ChatMessageEvents['removeListener'](_0x3a56db,_0x5b0483);};}exports[_0xc46f('0x5')]=function(_0x176c6f){for(var _0x30ca8d=0x0,_0x15904c=events[_0xc46f('0x6')];_0x30ca8d<_0x15904c;_0x30ca8d++){var _0x312101=events[_0x30ca8d];var _0x155a10=createListener(_0xc46f('0x7')+_0x312101,_0x176c6f);ChatMessageEvents['on'](_0x312101,_0x155a10);}};
\ No newline at end of file
+var _0x3148=['save','update','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x3148,0x1d3));var _0x8314=function(_0x4f21cd,_0x30f06f){_0x4f21cd=_0x4f21cd-0x0;var _0x1af331=_0x3148[_0x4f21cd];return _0x1af331;};'use strict';var ChatMessageEvents=require(_0x8314('0x0'));var events=[_0x8314('0x1'),'remove',_0x8314('0x2')];function createListener(_0xf80bf9,_0x1b13ca){return function(_0x63760b){_0x1b13ca['emit'](_0xf80bf9,_0x63760b);};}function removeListener(_0x35ee55,_0x41e9fd){return function(){ChatMessageEvents[_0x8314('0x3')](_0x35ee55,_0x41e9fd);};}exports[_0x8314('0x4')]=function(_0x18a30b){for(var _0x9cb271=0x0,_0x1bd913=events['length'];_0x9cb271<_0x1bd913;_0x9cb271++){var _0x837c1f=events[_0x9cb271];var _0x4df2b0=createListener(_0x8314('0x5')+_0x837c1f,_0x18a30b);ChatMessageEvents['on'](_0x837c1f,_0x4df2b0);}};
\ No newline at end of file
index 380b21e..56518ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74ca=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','chat','put','/:id','/:id/accept','accept','delete','destroy','multer','connect-timeout'];(function(_0x49fc4c,_0x4f5ce7){var _0x1c3880=function(_0x282823){while(--_0x282823){_0x49fc4c['push'](_0x49fc4c['shift']());}};_0x1c3880(++_0x4f5ce7);}(_0x74ca,0x106));var _0xa74c=function(_0x96317f,_0x5572d9){_0x96317f=_0x96317f-0x0;var _0x5c93b0=_0x74ca[_0x96317f];return _0x5c93b0;};'use strict';var multer=require(_0xa74c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa74c('0x1'));var express=require(_0xa74c('0x2'));var router=express[_0xa74c('0x3')]();var fs_extra=require(_0xa74c('0x4'));var auth=require(_0xa74c('0x5'));var interaction=require(_0xa74c('0x6'));var config=require(_0xa74c('0x7'));var controller=require(_0xa74c('0x8'));router[_0xa74c('0x9')]('/',auth[_0xa74c('0xa')](),controller['index']);router['get'](_0xa74c('0xb'),auth[_0xa74c('0xa')](),controller[_0xa74c('0xc')]);router[_0xa74c('0x9')]('/:id',auth[_0xa74c('0xa')](),controller[_0xa74c('0xd')]);router[_0xa74c('0xe')]('/',auth[_0xa74c('0xa')](),interaction['tracked'](_0xa74c('0xf'),'chatmessage:create'),controller['create']);router[_0xa74c('0x10')](_0xa74c('0x11'),controller['update']);router['put'](_0xa74c('0x12'),auth[_0xa74c('0xa')](),controller[_0xa74c('0x13')]);router[_0xa74c('0x10')]('/:id/reject',auth[_0xa74c('0xa')](),controller['reject']);router[_0xa74c('0x14')](_0xa74c('0x11'),auth[_0xa74c('0xa')](),controller[_0xa74c('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x62e4=['put','update','/:id/accept','accept','reject','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','post','tracked','chat','chatmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62e4,0x6d));var _0x462e=function(_0x15548e,_0xbae56d){_0x15548e=_0x15548e-0x0;var _0x305a7f=_0x62e4[_0x15548e];return _0x305a7f;};'use strict';var multer=require(_0x462e('0x0'));var util=require(_0x462e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x462e('0x2'));var router=express[_0x462e('0x3')]();var fs_extra=require(_0x462e('0x4'));var auth=require(_0x462e('0x5'));var interaction=require(_0x462e('0x6'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x462e('0x7')]('/',auth[_0x462e('0x8')](),controller['index']);router[_0x462e('0x7')](_0x462e('0x9'),auth[_0x462e('0x8')](),controller[_0x462e('0xa')]);router[_0x462e('0x7')]('/:id',auth[_0x462e('0x8')](),controller['show']);router[_0x462e('0xb')]('/',auth['isAuthenticated'](),interaction[_0x462e('0xc')](_0x462e('0xd'),_0x462e('0xe')),controller[_0x462e('0xf')]);router[_0x462e('0x10')]('/:id',controller[_0x462e('0x11')]);router[_0x462e('0x10')](_0x462e('0x12'),auth[_0x462e('0x8')](),controller[_0x462e('0x13')]);router['put']('/:id/reject',auth[_0x462e('0x8')](),controller[_0x462e('0x14')]);router[_0x462e('0x15')](_0x462e('0x16'),auth[_0x462e('0x8')](),controller[_0x462e('0x17')]);module[_0x462e('0x18')]=router;
\ No newline at end of file
index 9560529..e45246f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3708=['TEXT','medium','sequelize','exports'];(function(_0x4a9d87,_0x2cc20f){var _0x1ad978=function(_0x37673c){while(--_0x37673c){_0x4a9d87['push'](_0x4a9d87['shift']());}};_0x1ad978(++_0x2cc20f);}(_0x3708,0x17a));var _0x8370=function(_0x4857ee,_0x5b99f8){_0x4857ee=_0x4857ee-0x0;var _0x45fed6=_0x3708[_0x4857ee];return _0x45fed6;};'use strict';var Sequelize=require(_0x8370('0x0'));module[_0x8370('0x1')]={'body':{'type':Sequelize[_0x8370('0x2')](_0x8370('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xb029=['sequelize','exports','TEXT','medium'];(function(_0x19f5f1,_0x5a9d31){var _0x44b0a7=function(_0xbd206d){while(--_0xbd206d){_0x19f5f1['push'](_0x19f5f1['shift']());}};_0x44b0a7(++_0x5a9d31);}(_0xb029,0x12c));var _0x9b02=function(_0xc03fac,_0x5e8753){_0xc03fac=_0xc03fac-0x0;var _0xa1af02=_0xb029[_0xc03fac];return _0xa1af02;};'use strict';var Sequelize=require(_0x9b02('0x0'));module[_0x9b02('0x1')]={'body':{'type':Sequelize[_0x9b02('0x2')](_0x9b02('0x3')),'allowNull':![]}};
\ No newline at end of file
index dca7afa..b4b9f9c 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(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x7a54,0x106));var _0x47a5=function(_0x55ab69,_0x51cdf3){_0x55ab69=_0x55ab69-0x0;var _0x3cac7d=_0x7a54[_0x55ab69];return _0x3cac7d;};'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(_0x3c2876,_0x303375){var _0x4851cd=function(_0x5d1050){while(--_0x5d1050){_0x3c2876['push'](_0x3c2876['shift']());}};_0x4851cd(++_0x303375);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
index e8447c8..bde67d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89b9=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_offline_messages'];(function(_0x10bcc4,_0x4400e2){var _0x2da988=function(_0x2ee849){while(--_0x2ee849){_0x10bcc4['push'](_0x10bcc4['shift']());}};_0x2da988(++_0x4400e2);}(_0x89b9,0xa6));var _0x989b=function(_0x138e10,_0x170058){_0x138e10=_0x138e10-0x0;var _0x1fbad4=_0x89b9[_0x138e10];return _0x1fbad4;};'use strict';var _=require(_0x989b('0x0'));var util=require(_0x989b('0x1'));var logger=require('../../config/logger')(_0x989b('0x2'));var moment=require('moment');var BPromise=require(_0x989b('0x3'));var rp=require(_0x989b('0x4'));var fs=require('fs');var path=require(_0x989b('0x5'));var rimraf=require(_0x989b('0x6'));var config=require(_0x989b('0x7'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x546051,_0x223dcd){return _0x546051[_0x989b('0x8')]('ChatOfflineMessage',attributes,{'tableName':_0x989b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x989b('0xa')});};
\ No newline at end of file
+var _0x7ed0=['lodash','util','api','moment','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x267390,_0x1733f2){var _0x19c5a9=function(_0x373f3a){while(--_0x373f3a){_0x267390['push'](_0x267390['shift']());}};_0x19c5a9(++_0x1733f2);}(_0x7ed0,0x12b));var _0x07ed=function(_0x541e3b,_0x209b1e){_0x541e3b=_0x541e3b-0x0;var _0xe45bd0=_0x7ed0[_0x541e3b];return _0xe45bd0;};'use strict';var _=require(_0x07ed('0x0'));var util=require(_0x07ed('0x1'));var logger=require('../../config/logger')(_0x07ed('0x2'));var moment=require(_0x07ed('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07ed('0x4'));var rimraf=require(_0x07ed('0x5'));var config=require(_0x07ed('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0x07ed('0x7')]=function(_0x1edf2a,_0x4f3334){return _0x1edf2a[_0x07ed('0x8')](_0x07ed('0x9'),attributes,{'tableName':_0x07ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x07ed('0xb'),'collate':_0x07ed('0xc')});};
\ No newline at end of file
index 77e1724..af55ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa3c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3f030e,_0x1e0647){var _0x411785=function(_0x291f53){while(--_0x291f53){_0x3f030e['push'](_0x3f030e['shift']());}};_0x411785(++_0x1e0647);}(_0xaa3c,0xb3));var _0xcaa3=function(_0x375676,_0x59d59f){_0x375676=_0x375676-0x0;var _0x31b3b7=_0xaa3c[_0x375676];return _0x31b3b7;};'use strict';var _=require(_0xcaa3('0x0'));var util=require(_0xcaa3('0x1'));var moment=require(_0xcaa3('0x2'));var BPromise=require(_0xcaa3('0x3'));var rs=require(_0xcaa3('0x4'));var fs=require('fs');var Redis=require(_0xcaa3('0x5'));var db=require(_0xcaa3('0x6'))['db'];var utils=require(_0xcaa3('0x7'));var logger=require(_0xcaa3('0x8'))(_0xcaa3('0x9'));var config=require(_0xcaa3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcaa3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c400c,_0x1690a7,_0xd2cb5a){return new BPromise(function(_0x5ca890,_0x3c3bd5){return client[_0xcaa3('0xc')](_0x1c400c,_0xd2cb5a)[_0xcaa3('0xd')](function(_0xb3d1f0){logger[_0xcaa3('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1690a7,_0xcaa3('0xf'));logger[_0xcaa3('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1690a7,_0xcaa3('0xf'),JSON[_0xcaa3('0x11')](_0xb3d1f0));if(_0xb3d1f0[_0xcaa3('0x12')]){if(_0xb3d1f0[_0xcaa3('0x12')][_0xcaa3('0x13')]===0x1f4){logger[_0xcaa3('0x12')](_0xcaa3('0x14'),_0x1690a7,_0xb3d1f0[_0xcaa3('0x12')][_0xcaa3('0x15')]);return _0x3c3bd5(_0xb3d1f0[_0xcaa3('0x12')][_0xcaa3('0x15')]);}logger[_0xcaa3('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1690a7,_0xb3d1f0[_0xcaa3('0x12')][_0xcaa3('0x15')]);return _0x5ca890(_0xb3d1f0[_0xcaa3('0x12')][_0xcaa3('0x15')]);}else{logger['info'](_0xcaa3('0x14'),_0x1690a7,_0xcaa3('0xf'));_0x5ca890(_0xb3d1f0[_0xcaa3('0x16')][_0xcaa3('0x15')]);}})['catch'](function(_0x1580d5){logger['error'](_0xcaa3('0x14'),_0x1690a7,_0x1580d5);_0x3c3bd5(_0x1580d5);});});}
\ No newline at end of file
+var _0x63b7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x63b7,0x1e2));var _0x763b=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x63b7[_0x4df6f9];return _0x4b1a73;};'use strict';var _=require('lodash');var util=require(_0x763b('0x0'));var moment=require('moment');var BPromise=require(_0x763b('0x1'));var rs=require(_0x763b('0x2'));var fs=require('fs');var Redis=require(_0x763b('0x3'));var db=require(_0x763b('0x4'))['db'];var utils=require(_0x763b('0x5'));var logger=require('../../config/logger')(_0x763b('0x6'));var config=require(_0x763b('0x7'));var jayson=require(_0x763b('0x8'));var client=jayson['client'][_0x763b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe9cf0,_0x464ab0,_0x218a1f){return new BPromise(function(_0xffb979,_0x476fc4){return client[_0x763b('0xa')](_0xbe9cf0,_0x218a1f)[_0x763b('0xb')](function(_0x2833b2){logger['info'](_0x763b('0xc'),_0x464ab0,_0x763b('0xd'));logger[_0x763b('0xe')](_0x763b('0xf'),_0x464ab0,_0x763b('0xd'),JSON[_0x763b('0x10')](_0x2833b2));if(_0x2833b2['error']){if(_0x2833b2[_0x763b('0x11')][_0x763b('0x12')]===0x1f4){logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0x476fc4(_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);}logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0xffb979(_0x2833b2['error'][_0x763b('0x13')]);}else{logger[_0x763b('0x14')](_0x763b('0xc'),_0x464ab0,'request\x20sent');_0xffb979(_0x2833b2[_0x763b('0x15')]['message']);}})[_0x763b('0x16')](function(_0x493346){logger[_0x763b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x464ab0,_0x493346);_0x476fc4(_0x493346);});});}
\ No newline at end of file
index b074bc4..1d50246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc50=['Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','describe','/:id','show','post','isAuthenticated','create','put','update','util','path','connect-timeout','express'];(function(_0x3884e3,_0x5f2516){var _0x651d6d=function(_0x81f2f1){while(--_0x81f2f1){_0x3884e3['push'](_0x3884e3['shift']());}};_0x651d6d(++_0x5f2516);}(_0xfc50,0x12c));var _0x0fc5=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xfc50[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require('multer');var util=require(_0x0fc5('0x0'));var path=require(_0x0fc5('0x1'));var timeout=require(_0x0fc5('0x2'));var express=require(_0x0fc5('0x3'));var router=express[_0x0fc5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0fc5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0fc5('0x6'));var controller=require(_0x0fc5('0x7'));router[_0x0fc5('0x8')]('/',auth['isAuthenticated'](),controller[_0x0fc5('0x9')]);router[_0x0fc5('0x8')](_0x0fc5('0xa'),auth['isAuthenticated'](),controller[_0x0fc5('0xb')]);router[_0x0fc5('0x8')](_0x0fc5('0xc'),auth['isAuthenticated'](),controller[_0x0fc5('0xd')]);router[_0x0fc5('0xe')]('/',auth[_0x0fc5('0xf')](),controller[_0x0fc5('0x10')]);router[_0x0fc5('0x11')](_0x0fc5('0xc'),auth['isAuthenticated'](),controller[_0x0fc5('0x12')]);router['delete'](_0x0fc5('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf1ad=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x244f1f,_0x26934c){var _0x1064f7=function(_0x280ea8){while(--_0x280ea8){_0x244f1f['push'](_0x244f1f['shift']());}};_0x1064f7(++_0x26934c);}(_0xf1ad,0x15a));var _0xdf1a=function(_0x3b6528,_0x2683e1){_0x3b6528=_0x3b6528-0x0;var _0x260874=_0xf1ad[_0x3b6528];return _0x260874;};'use strict';var multer=require(_0xdf1a('0x0'));var util=require(_0xdf1a('0x1'));var path=require(_0xdf1a('0x2'));var timeout=require(_0xdf1a('0x3'));var express=require(_0xdf1a('0x4'));var router=express[_0xdf1a('0x5')]();var fs_extra=require(_0xdf1a('0x6'));var auth=require(_0xdf1a('0x7'));var interaction=require(_0xdf1a('0x8'));var config=require(_0xdf1a('0x9'));var controller=require(_0xdf1a('0xa'));router[_0xdf1a('0xb')]('/',auth['isAuthenticated'](),controller[_0xdf1a('0xc')]);router[_0xdf1a('0xb')](_0xdf1a('0xd'),auth[_0xdf1a('0xe')](),controller['describe']);router[_0xdf1a('0xb')](_0xdf1a('0xf'),auth[_0xdf1a('0xe')](),controller[_0xdf1a('0x10')]);router[_0xdf1a('0x11')]('/',auth[_0xdf1a('0xe')](),controller[_0xdf1a('0x12')]);router['put'](_0xdf1a('0xf'),auth[_0xdf1a('0xe')](),controller[_0xdf1a('0x13')]);router[_0xdf1a('0x14')](_0xdf1a('0xf'),auth['isAuthenticated'](),controller[_0xdf1a('0x15')]);module[_0xdf1a('0x16')]=router;
\ No newline at end of file
index 595c932..e76686f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd368=['STRING','ENUM','mouseOver','timeout','INTEGER','exports'];(function(_0x42ab3f,_0x2fdccc){var _0x471b91=function(_0x30139d){while(--_0x30139d){_0x42ab3f['push'](_0x42ab3f['shift']());}};_0x471b91(++_0x2fdccc);}(_0xd368,0x1c1));var _0x8d36=function(_0x4f7f5a,_0x4e3f02){_0x4f7f5a=_0x4f7f5a-0x0;var _0xf8bd72=_0xd368[_0x4f7f5a];return _0xf8bd72;};'use strict';var Sequelize=require('sequelize');module[_0x8d36('0x0')]={'name':{'type':Sequelize[_0x8d36('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8d36('0x2')](_0x8d36('0x3'),_0x8d36('0x4')),'defaultValue':_0x8d36('0x3')},'selector':{'type':Sequelize[_0x8d36('0x1')]},'timeout':{'type':Sequelize[_0x8d36('0x5')]}};
\ No newline at end of file
+var _0x741a=['exports','STRING','INTEGER','sequelize'];(function(_0x27889f,_0x4809b9){var _0x201713=function(_0x5e5c1e){while(--_0x5e5c1e){_0x27889f['push'](_0x27889f['shift']());}};_0x201713(++_0x4809b9);}(_0x741a,0xab));var _0xa741=function(_0x686086,_0x2f84d0){_0x686086=_0x686086-0x0;var _0x2ce9b8=_0x741a[_0x686086];return _0x2ce9b8;};'use strict';var Sequelize=require(_0xa741('0x0'));module[_0xa741('0x1')]={'name':{'type':Sequelize[_0xa741('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xa741('0x2')]},'timeout':{'type':Sequelize[_0xa741('0x3')]}};
\ No newline at end of file
index 31ff00c..a16661c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcc7=['find','create','body','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','keys','ChatProactiveAction','filters','intersection','model','query','fields','attributes','length','includeAll','include','merge','options'];(function(_0x3853c3,_0x14f12f){var _0x364f40=function(_0x26fa44){while(--_0x26fa44){_0x3853c3['push'](_0x3853c3['shift']());}};_0x364f40(++_0x14f12f);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x4d443b,_0x14e8bf){_0x4d443b=_0x4d443b-0x0;var _0x137ac1=_0xbcc7[_0x4d443b];return _0x137ac1;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];function respondWithStatusCode(_0xae46e8,_0x51b0e8){_0x51b0e8=_0x51b0e8||0xcc;return function(_0x3e3580){if(_0x3e3580){return _0xae46e8[_0x7bcc('0x16')](_0x51b0e8);}return _0xae46e8[_0x7bcc('0x17')](_0x51b0e8)[_0x7bcc('0x18')]();};}function respondWithResult(_0x39f912,_0x217896){_0x217896=_0x217896||0xc8;return function(_0x4a2539){if(_0x4a2539){return _0x39f912[_0x7bcc('0x17')](_0x217896)[_0x7bcc('0x19')](_0x4a2539);}};}function respondWithFilteredResult(_0x148618,_0x461ff7){return function(_0x30caa2){if(_0x30caa2){var _0x134d55=typeof _0x461ff7[_0x7bcc('0x1a')]==='undefined'&&typeof _0x461ff7[_0x7bcc('0x1b')]==='undefined';var _0x3156f3=_0x30caa2[_0x7bcc('0x1c')];var _0x340bd6=_0x134d55?0x0:_0x461ff7[_0x7bcc('0x1a')];var _0x49168c=_0x134d55?_0x30caa2['count']:_0x461ff7[_0x7bcc('0x1a')]+_0x461ff7[_0x7bcc('0x1b')];var _0x1a1b7f;if(_0x49168c>=_0x3156f3){_0x49168c=_0x3156f3;_0x1a1b7f=0xc8;}else{_0x1a1b7f=0xce;}_0x148618[_0x7bcc('0x17')](_0x1a1b7f);return _0x148618[_0x7bcc('0x1d')](_0x7bcc('0x1e'),_0x340bd6+'-'+_0x49168c+'/'+_0x3156f3)[_0x7bcc('0x19')](_0x30caa2);}return null;};}function patchUpdates(_0x3d0719){return function(_0x15b2c3){try{jsonpatch['apply'](_0x15b2c3,_0x3d0719,!![]);}catch(_0x553865){return BPromise[_0x7bcc('0x1f')](_0x553865);}return _0x15b2c3[_0x7bcc('0x20')]();};}function saveUpdates(_0x34ee2a,_0x3050cf){return function(_0x201f40){if(_0x201f40){return _0x201f40[_0x7bcc('0x21')](_0x34ee2a)[_0x7bcc('0x22')](function(_0x345671){return _0x345671;});}return null;};}function removeEntity(_0x32b3ea,_0x54c611){return function(_0x2d25b8){if(_0x2d25b8){return _0x2d25b8[_0x7bcc('0x23')]()[_0x7bcc('0x22')](function(){_0x32b3ea[_0x7bcc('0x17')](0xcc)[_0x7bcc('0x18')]();});}};}function handleEntityNotFound(_0x1d085c,_0x4f8562){return function(_0x48b296){if(!_0x48b296){_0x1d085c[_0x7bcc('0x16')](0x194);}return _0x48b296;};}function handleError(_0x4a91d0,_0x4db3c0){_0x4db3c0=_0x4db3c0||0x1f4;return function(_0xd3ca3b){logger['error'](_0xd3ca3b[_0x7bcc('0x24')]);if(_0xd3ca3b[_0x7bcc('0x25')]){delete _0xd3ca3b[_0x7bcc('0x25')];}_0x4a91d0['status'](_0x4db3c0)[_0x7bcc('0x26')](_0xd3ca3b);};}exports[_0x7bcc('0x27')]=function(_0x2e92e1,_0x319943){var _0x20c458={'raw':!![],'where':{'id':_0x2e92e1[_0x7bcc('0x28')]['id']}},_0x1ecf95={};_0x1ecf95['model']=_[_0x7bcc('0x29')](db[_0x7bcc('0x2a')]['rawAttributes']);_0x1ecf95['query']=_[_0x7bcc('0x29')](_0x2e92e1['query']);_0x1ecf95[_0x7bcc('0x2b')]=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],_0x1ecf95[_0x7bcc('0x2e')]);_0x20c458['attributes']=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],qs[_0x7bcc('0x2f')](_0x2e92e1['query'][_0x7bcc('0x2f')]));_0x20c458[_0x7bcc('0x30')]=_0x20c458[_0x7bcc('0x30')][_0x7bcc('0x31')]?_0x20c458[_0x7bcc('0x30')]:_0x1ecf95[_0x7bcc('0x2d')];if(_0x2e92e1[_0x7bcc('0x2e')][_0x7bcc('0x32')]){_0x20c458[_0x7bcc('0x33')]=[{'all':!![]}];}_0x20c458=_[_0x7bcc('0x34')]({},_0x20c458,_0x2e92e1[_0x7bcc('0x35')]);return db['ChatProactiveAction'][_0x7bcc('0x36')](_0x20c458)[_0x7bcc('0x22')](handleEntityNotFound(_0x319943,null))[_0x7bcc('0x22')](respondWithResult(_0x319943,null))['catch'](handleError(_0x319943,null));};exports['create']=function(_0x409ff4,_0x1ef50b){return db[_0x7bcc('0x2a')][_0x7bcc('0x37')](_0x409ff4[_0x7bcc('0x38')],{})[_0x7bcc('0x22')](respondWithResult(_0x1ef50b,0xc9))[_0x7bcc('0x39')](handleError(_0x1ef50b,null));};exports['update']=function(_0x5bbb4b,_0x5584f6){if(_0x5bbb4b['body']['id']){delete _0x5bbb4b[_0x7bcc('0x38')]['id'];}return db[_0x7bcc('0x2a')][_0x7bcc('0x36')]({'where':{'id':_0x5bbb4b['params']['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x5584f6,null))[_0x7bcc('0x22')](saveUpdates(_0x5bbb4b[_0x7bcc('0x38')],null))['then'](respondWithResult(_0x5584f6,null))['catch'](handleError(_0x5584f6,null));};exports[_0x7bcc('0x23')]=function(_0xca6ce3,_0x1d9c06){return db['ChatProactiveAction']['find']({'where':{'id':_0xca6ce3[_0x7bcc('0x28')]['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x1d9c06,null))[_0x7bcc('0x22')](removeEntity(_0x1d9c06,null))['catch'](handleError(_0x1d9c06,null));};
\ No newline at end of file
+var _0x54da=['moment','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','name','show','params','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','include','options','catch','create','update','body','find','destroy','eml-format','zip-dir'];(function(_0x38e870,_0x3d2e6a){var _0x2dabbe=function(_0x3ddea3){while(--_0x3ddea3){_0x38e870['push'](_0x38e870['shift']());}};_0x2dabbe(++_0x3d2e6a);}(_0x54da,0x9d));var _0xa54d=function(_0x11a3c2,_0xb7f165){_0x11a3c2=_0x11a3c2-0x0;var _0x846cea=_0x54da[_0x11a3c2];return _0x846cea;};'use strict';var emlformat=require(_0xa54d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa54d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa54d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa54d('0x3'));var util=require(_0xa54d('0x4'));var path=require(_0xa54d('0x5'));var sox=require(_0xa54d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa54d('0x7'));var _=require(_0xa54d('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa54d('0x9'));var toCsv=require(_0xa54d('0xa'));var querystring=require(_0xa54d('0xb'));var Papa=require('papaparse');var Redis=require(_0xa54d('0xc'));var authService=require(_0xa54d('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa54d('0xe'));var logger=require('../../config/logger')(_0xa54d('0xf'));var utils=require(_0xa54d('0x10'));var config=require(_0xa54d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xa54d('0x12'))['db'];function respondWithStatusCode(_0x4aa983,_0x4f1d93){_0x4f1d93=_0x4f1d93||0xcc;return function(_0x5ea2b6){if(_0x5ea2b6){return _0x4aa983[_0xa54d('0x13')](_0x4f1d93);}return _0x4aa983[_0xa54d('0x14')](_0x4f1d93)[_0xa54d('0x15')]();};}function respondWithResult(_0x11d38f,_0xd5c470){_0xd5c470=_0xd5c470||0xc8;return function(_0x5f30f9){if(_0x5f30f9){return _0x11d38f[_0xa54d('0x14')](_0xd5c470)[_0xa54d('0x16')](_0x5f30f9);}};}function respondWithFilteredResult(_0x272e8d,_0xdf2d8){return function(_0x23cd06){if(_0x23cd06){var _0xfc1686=typeof _0xdf2d8[_0xa54d('0x17')]===_0xa54d('0x18')&&typeof _0xdf2d8[_0xa54d('0x19')]===_0xa54d('0x18');var _0x3227f7=_0x23cd06[_0xa54d('0x1a')];var _0x49e221=_0xfc1686?0x0:_0xdf2d8[_0xa54d('0x17')];var _0x1fd2bc=_0xfc1686?_0x23cd06[_0xa54d('0x1a')]:_0xdf2d8[_0xa54d('0x17')]+_0xdf2d8[_0xa54d('0x19')];var _0xa4a36b;if(_0x1fd2bc>=_0x3227f7){_0x1fd2bc=_0x3227f7;_0xa4a36b=0xc8;}else{_0xa4a36b=0xce;}_0x272e8d['status'](_0xa4a36b);return _0x272e8d['set'](_0xa54d('0x1b'),_0x49e221+'-'+_0x1fd2bc+'/'+_0x3227f7)[_0xa54d('0x16')](_0x23cd06);}return null;};}function patchUpdates(_0x44cc3d){return function(_0x23fc6d){try{jsonpatch[_0xa54d('0x1c')](_0x23fc6d,_0x44cc3d,!![]);}catch(_0x2d5893){return BPromise[_0xa54d('0x1d')](_0x2d5893);}return _0x23fc6d[_0xa54d('0x1e')]();};}function saveUpdates(_0x4e4250,_0x42a376){return function(_0x47b7ea){if(_0x47b7ea){return _0x47b7ea['update'](_0x4e4250)[_0xa54d('0x1f')](function(_0x99c1b3){return _0x99c1b3;});}return null;};}function removeEntity(_0x5b135f,_0x5695ad){return function(_0x1447d8){if(_0x1447d8){return _0x1447d8['destroy']()[_0xa54d('0x1f')](function(){_0x5b135f[_0xa54d('0x14')](0xcc)[_0xa54d('0x15')]();});}};}function handleEntityNotFound(_0x346086,_0x37dd6c){return function(_0x468d2e){if(!_0x468d2e){_0x346086[_0xa54d('0x13')](0x194);}return _0x468d2e;};}function handleError(_0x33eb45,_0x4497a0){_0x4497a0=_0x4497a0||0x1f4;return function(_0x15030a){logger[_0xa54d('0x20')](_0x15030a['stack']);if(_0x15030a[_0xa54d('0x21')]){delete _0x15030a[_0xa54d('0x21')];}_0x33eb45[_0xa54d('0x14')](_0x4497a0)['send'](_0x15030a);};}exports[_0xa54d('0x22')]=function(_0xb8661f,_0x13f701){var _0x58b625={'raw':!![],'where':{'id':_0xb8661f[_0xa54d('0x23')]['id']}},_0x2e10ff={};_0x2e10ff['model']=_[_0xa54d('0x24')](db[_0xa54d('0x25')]['rawAttributes']);_0x2e10ff[_0xa54d('0x26')]=_[_0xa54d('0x24')](_0xb8661f['query']);_0x2e10ff['filters']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],_0x2e10ff['query']);_0x58b625['attributes']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],qs[_0xa54d('0x29')](_0xb8661f['query']['fields']));_0x58b625['attributes']=_0x58b625[_0xa54d('0x2a')][_0xa54d('0x2b')]?_0x58b625['attributes']:_0x2e10ff[_0xa54d('0x28')];if(_0xb8661f[_0xa54d('0x26')][_0xa54d('0x2c')]){_0x58b625[_0xa54d('0x2d')]=[{'all':!![]}];}_0x58b625=_['merge']({},_0x58b625,_0xb8661f[_0xa54d('0x2e')]);return db[_0xa54d('0x25')]['find'](_0x58b625)[_0xa54d('0x1f')](handleEntityNotFound(_0x13f701,null))[_0xa54d('0x1f')](respondWithResult(_0x13f701,null))[_0xa54d('0x2f')](handleError(_0x13f701,null));};exports[_0xa54d('0x30')]=function(_0x2ecf81,_0x69b869){return db[_0xa54d('0x25')][_0xa54d('0x30')](_0x2ecf81['body'],{})['then'](respondWithResult(_0x69b869,0xc9))[_0xa54d('0x2f')](handleError(_0x69b869,null));};exports[_0xa54d('0x31')]=function(_0x59627b,_0x49d4b8){if(_0x59627b[_0xa54d('0x32')]['id']){delete _0x59627b[_0xa54d('0x32')]['id'];}return db['ChatProactiveAction'][_0xa54d('0x33')]({'where':{'id':_0x59627b[_0xa54d('0x23')]['id']}})['then'](handleEntityNotFound(_0x49d4b8,null))[_0xa54d('0x1f')](saveUpdates(_0x59627b['body'],null))[_0xa54d('0x1f')](respondWithResult(_0x49d4b8,null))[_0xa54d('0x2f')](handleError(_0x49d4b8,null));};exports[_0xa54d('0x34')]=function(_0x482af2,_0x4f9eab){return db[_0xa54d('0x25')][_0xa54d('0x33')]({'where':{'id':_0x482af2[_0xa54d('0x23')]['id']}})[_0xa54d('0x1f')](handleEntityNotFound(_0x4f9eab,null))[_0xa54d('0x1f')](removeEntity(_0x4f9eab,null))[_0xa54d('0x2f')](handleError(_0x4f9eab,null));};
\ No newline at end of file
index 2060046..8c313f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9663=['moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x9663,0x1c5));var _0x3966=function(_0x257a9f,_0x4e74dd){_0x257a9f=_0x257a9f-0x0;var _0x46e9c1=_0x9663[_0x257a9f];return _0x46e9c1;};'use strict';var _=require('lodash');var util=require(_0x3966('0x0'));var logger=require(_0x3966('0x1'))(_0x3966('0x2'));var moment=require(_0x3966('0x3'));var BPromise=require(_0x3966('0x4'));var rp=require(_0x3966('0x5'));var fs=require('fs');var path=require(_0x3966('0x6'));var rimraf=require('rimraf');var config=require(_0x3966('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x3966('0x8')]=function(_0x67ccae,_0x3e1145){return _0x67ccae[_0x3966('0x9')](_0x3966('0xa'),attributes,{'tableName':_0x3966('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe06e=['lodash','api','moment','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x5879a9,_0x5f4b52){var _0x565db7=function(_0x1e8590){while(--_0x1e8590){_0x5879a9['push'](_0x5879a9['shift']());}};_0x565db7(++_0x5f4b52);}(_0xe06e,0x9a));var _0xee06=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xe06e[_0x5b27da];return _0x3254f4;};'use strict';var _=require(_0xee06('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee06('0x1'));var moment=require(_0xee06('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee06('0x3'));var rimraf=require(_0xee06('0x4'));var config=require(_0xee06('0x5'));var attributes=require(_0xee06('0x6'));module[_0xee06('0x7')]=function(_0x15ec1f,_0x78622b){return _0x15ec1f[_0xee06('0x8')](_0xee06('0x9'),attributes,{'tableName':_0xee06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 52905a9..506baa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa763=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','code','ChatProactiveAction,\x20%s,\x20%s','message','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa763,0x8c));var _0x3a76=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xa763[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x3a76('0x0'));var util=require(_0x3a76('0x1'));var moment=require(_0x3a76('0x2'));var BPromise=require('bluebird');var rs=require(_0x3a76('0x3'));var fs=require('fs');var Redis=require(_0x3a76('0x4'));var db=require(_0x3a76('0x5'))['db'];var utils=require(_0x3a76('0x6'));var logger=require('../../config/logger')(_0x3a76('0x7'));var config=require('../../config/environment');var jayson=require(_0x3a76('0x8'));var client=jayson[_0x3a76('0x9')][_0x3a76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15fc8c,_0x1a535f,_0x5eadca){return new BPromise(function(_0x1a6d73,_0x3b6ab1){return client[_0x3a76('0xb')](_0x15fc8c,_0x5eadca)[_0x3a76('0xc')](function(_0x56b092){logger[_0x3a76('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x1a535f,_0x3a76('0xe'));logger[_0x3a76('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1a535f,'request\x20sent',JSON[_0x3a76('0x10')](_0x56b092));if(_0x56b092['error']){if(_0x56b092['error'][_0x3a76('0x11')]===0x1f4){logger['error'](_0x3a76('0x12'),_0x1a535f,_0x56b092['error'][_0x3a76('0x13')]);return _0x3b6ab1(_0x56b092[_0x3a76('0x14')][_0x3a76('0x13')]);}logger[_0x3a76('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x1a535f,_0x56b092[_0x3a76('0x14')]['message']);return _0x1a6d73(_0x56b092[_0x3a76('0x14')][_0x3a76('0x13')]);}else{logger[_0x3a76('0xd')](_0x3a76('0x12'),_0x1a535f,_0x3a76('0xe'));_0x1a6d73(_0x56b092[_0x3a76('0x15')][_0x3a76('0x13')]);}})[_0x3a76('0x16')](function(_0x10b6e2){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1a535f,_0x10b6e2);_0x3b6ab1(_0x10b6e2);});});}
\ No newline at end of file
+var _0xbebc=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x23b57c,_0xdc7f98){var _0x4c3b1d=function(_0x283147){while(--_0x283147){_0x23b57c['push'](_0x23b57c['shift']());}};_0x4c3b1d(++_0xdc7f98);}(_0xbebc,0x8f));var _0xcbeb=function(_0x2b33c6,_0xfeeabb){_0x2b33c6=_0x2b33c6-0x0;var _0x2b4d9d=_0xbebc[_0x2b33c6];return _0x2b4d9d;};'use strict';var _=require(_0xcbeb('0x0'));var util=require(_0xcbeb('0x1'));var moment=require(_0xcbeb('0x2'));var BPromise=require(_0xcbeb('0x3'));var rs=require(_0xcbeb('0x4'));var fs=require('fs');var Redis=require(_0xcbeb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbeb('0x6'));var logger=require('../../config/logger')(_0xcbeb('0x7'));var config=require(_0xcbeb('0x8'));var jayson=require(_0xcbeb('0x9'));var client=jayson[_0xcbeb('0xa')][_0xcbeb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2928f4,_0x397056,_0x277061){return new BPromise(function(_0x40945d,_0x36db70){return client[_0xcbeb('0xc')](_0x2928f4,_0x277061)['then'](function(_0x45bad2){logger[_0xcbeb('0xd')](_0xcbeb('0xe'),_0x397056,_0xcbeb('0xf'));logger[_0xcbeb('0x10')](_0xcbeb('0x11'),_0x397056,_0xcbeb('0xf'),JSON[_0xcbeb('0x12')](_0x45bad2));if(_0x45bad2['error']){if(_0x45bad2[_0xcbeb('0x13')]['code']===0x1f4){logger[_0xcbeb('0x13')](_0xcbeb('0xe'),_0x397056,_0x45bad2[_0xcbeb('0x13')][_0xcbeb('0x14')]);return _0x36db70(_0x45bad2['error'][_0xcbeb('0x14')]);}logger[_0xcbeb('0x13')](_0xcbeb('0xe'),_0x397056,_0x45bad2[_0xcbeb('0x13')][_0xcbeb('0x14')]);return _0x40945d(_0x45bad2[_0xcbeb('0x13')][_0xcbeb('0x14')]);}else{logger['info'](_0xcbeb('0xe'),_0x397056,_0xcbeb('0xf'));_0x40945d(_0x45bad2[_0xcbeb('0x15')]['message']);}})[_0xcbeb('0x16')](function(_0x230e88){logger[_0xcbeb('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x397056,_0x230e88);_0x36db70(_0x230e88);});});}
\ No newline at end of file
index ea6963f..e6187f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x2704be,_0x2555d4){var _0x21d7b5=function(_0x5f2a1b){while(--_0x5f2a1b){_0x2704be['push'](_0x2704be['shift']());}};_0x21d7b5(++_0x2555d4);}(_0x7c09,0x102));var _0x97c0=function(_0x31aa2f,_0x133a8d){_0x31aa2f=_0x31aa2f-0x0;var _0x900a05=_0x7c09[_0x31aa2f];return _0x900a05;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router;
\ No newline at end of file
+var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x39a508,_0x1c735e){_0x39a508=_0x39a508-0x0;var _0x24dcfa=_0xb4c7[_0x39a508];return _0x24dcfa;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
index e80c451..68047c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56c7=['STRING','name','INTEGER','ENUM','beepall','sequelize'];(function(_0x125a64,_0x353f98){var _0x370045=function(_0x490260){while(--_0x490260){_0x125a64['push'](_0x125a64['shift']());}};_0x370045(++_0x353f98);}(_0x56c7,0xc5));var _0x756c=function(_0xf7f60a,_0x15f736){_0xf7f60a=_0xf7f60a-0x0;var _0x2567ad=_0x56c7[_0xf7f60a];return _0x2567ad;};'use strict';var Sequelize=require(_0x756c('0x0'));module['exports']={'name':{'type':Sequelize[_0x756c('0x1')],'unique':_0x756c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x756c('0x1')]},'timeout':{'type':Sequelize[_0x756c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x756c('0x4')]('rrmemory',_0x756c('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x6bb7=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x415260,_0x135fcb){var _0x490f21=function(_0x28d91c){while(--_0x28d91c){_0x415260['push'](_0x415260['shift']());}};_0x490f21(++_0x135fcb);}(_0x6bb7,0x89));var _0x76bb=function(_0x10c577,_0x2bc20b){_0x10c577=_0x10c577-0x0;var _0x22173a=_0x6bb7[_0x10c577];return _0x22173a;};'use strict';var Sequelize=require(_0x76bb('0x0'));module[_0x76bb('0x1')]={'name':{'type':Sequelize[_0x76bb('0x2')],'unique':_0x76bb('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x76bb('0x2')]},'timeout':{'type':Sequelize[_0x76bb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x76bb('0x5')](_0x76bb('0x6'),_0x76bb('0x7'),'roundrobin')}};
\ No newline at end of file
index 2c17e45..2ffc28f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf75=['team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','value','isEmpty','forEach','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','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/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','result','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','stack','name','send','ChatQueue','fieldName','type','key','model','keys','intersection','query','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','attributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','ChatQueueId','filter','UserChatQueue','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','rows','SIP','Team','getTeams','addTeams','Agents','online','interface','sequelize','transaction','findOrCreate','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from'];(function(_0x3756a1,_0x5cc55e){var _0x41d4fd=function(_0x32d9cb){while(--_0x32d9cb){_0x3756a1['push'](_0x3756a1['shift']());}};_0x41d4fd(++_0x5cc55e);}(_0xdf75,0x14d));var _0x5df7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdf75[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x5df7('0x0'));var rimraf=require(_0x5df7('0x1'));var zipdir=require(_0x5df7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5df7('0x3'));var moment=require('moment');var BPromise=require(_0x5df7('0x4'));var Mustache=require('mustache');var util=require(_0x5df7('0x5'));var path=require(_0x5df7('0x6'));var sox=require(_0x5df7('0x7'));var csv=require(_0x5df7('0x8'));var ejs=require(_0x5df7('0x9'));var fs=require('fs');var fs_extra=require(_0x5df7('0xa'));var _=require('lodash');var squel=require(_0x5df7('0xb'));var crypto=require(_0x5df7('0xc'));var jsforce=require(_0x5df7('0xd'));var deskjs=require(_0x5df7('0xe'));var toCsv=require(_0x5df7('0x8'));var querystring=require('querystring');var Papa=require(_0x5df7('0xf'));var Redis=require(_0x5df7('0x10'));var authService=require(_0x5df7('0x11'));var qs=require(_0x5df7('0x12'));var as=require(_0x5df7('0x13'));var hardwareService=require(_0x5df7('0x14'));var logger=require(_0x5df7('0x15'))(_0x5df7('0x16'));var utils=require(_0x5df7('0x17'));var config=require(_0x5df7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5df7('0x19'))['db'];config[_0x5df7('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5df7('0x1b'))(new Redis(config[_0x5df7('0x1a')]));require(_0x5df7('0x1c'))[_0x5df7('0x1d')](socket);var jayson=require(_0x5df7('0x1e'));var client=jayson[_0x5df7('0x1f')][_0x5df7('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5f2625,_0x4fbee3,_0x507719,_0xfd29c3){return new BPromise(function(_0x32cd9a,_0x24788f){var _0x5589c8=_0xfd29c3||client;return _0x5589c8[_0x5df7('0x21')](_0x5f2625,_0x507719)['then'](function(_0x1de8fd){logger[_0x5df7('0x22')](_0x5df7('0x23'),_0x4fbee3,_0x5df7('0x24'));logger[_0x5df7('0x25')](_0x5df7('0x26'),_0x4fbee3,_0x5df7('0x24'),JSON[_0x5df7('0x27')](_0x1de8fd));if(_0x1de8fd[_0x5df7('0x28')]){if(_0x1de8fd[_0x5df7('0x28')]['code']===0x1f4){logger[_0x5df7('0x28')]('ChatQueue,\x20%s,\x20%s',_0x4fbee3,_0x1de8fd[_0x5df7('0x28')]['message']);return _0x24788f(_0x1de8fd[_0x5df7('0x28')]['message']);}logger[_0x5df7('0x28')](_0x5df7('0x23'),_0x4fbee3,_0x1de8fd['error']['message']);return _0x32cd9a(_0x1de8fd[_0x5df7('0x28')]['message']);}else{logger[_0x5df7('0x22')]('ChatQueue,\x20%s,\x20%s',_0x4fbee3,_0x5df7('0x24'));_0x32cd9a(_0x1de8fd[_0x5df7('0x29')][_0x5df7('0x2a')]);}})[_0x5df7('0x2b')](function(_0x220a92){logger[_0x5df7('0x28')](_0x5df7('0x23'),_0x4fbee3,_0x220a92);_0x24788f(_0x220a92);});});}function respondWithStatusCode(_0x301e47,_0x2c652b){_0x2c652b=_0x2c652b||0xcc;return function(_0x1ebcaf){if(_0x1ebcaf){return _0x301e47[_0x5df7('0x2c')](_0x2c652b);}return _0x301e47[_0x5df7('0x2d')](_0x2c652b)[_0x5df7('0x2e')]();};}function respondWithResult(_0x20fab5,_0x24e3a2){_0x24e3a2=_0x24e3a2||0xc8;return function(_0x498ddc){if(_0x498ddc){return _0x20fab5[_0x5df7('0x2d')](_0x24e3a2)[_0x5df7('0x2f')](_0x498ddc);}};}function respondWithFilteredResult(_0x548373,_0x2cffb4){return function(_0x437203){if(_0x437203){var _0x55dbcd=typeof _0x2cffb4['offset']==='undefined'&&typeof _0x2cffb4[_0x5df7('0x30')]===_0x5df7('0x31');var _0x459ff0=_0x437203['count'];var _0x3a7eb5=_0x55dbcd?0x0:_0x2cffb4['offset'];var _0x1dde8e=_0x55dbcd?_0x437203[_0x5df7('0x32')]:_0x2cffb4[_0x5df7('0x33')]+_0x2cffb4[_0x5df7('0x30')];var _0x39b333;if(_0x1dde8e>=_0x459ff0){_0x1dde8e=_0x459ff0;_0x39b333=0xc8;}else{_0x39b333=0xce;}_0x548373[_0x5df7('0x2d')](_0x39b333);return _0x548373[_0x5df7('0x34')]('Content-Range',_0x3a7eb5+'-'+_0x1dde8e+'/'+_0x459ff0)['json'](_0x437203);}return null;};}function patchUpdates(_0x521005){return function(_0x45a00a){try{jsonpatch[_0x5df7('0x35')](_0x45a00a,_0x521005,!![]);}catch(_0x85aa75){return BPromise[_0x5df7('0x36')](_0x85aa75);}return _0x45a00a[_0x5df7('0x37')]();};}function saveUpdates(_0x1bd3af,_0x2b1c45){return function(_0x2801c3){if(_0x2801c3){return _0x2801c3[_0x5df7('0x38')](_0x1bd3af)[_0x5df7('0x39')](function(_0xc809b6){return _0xc809b6;});}return null;};}function removeEntity(_0x593b27,_0x431dda){return function(_0xd96ff8){if(_0xd96ff8){return _0xd96ff8[_0x5df7('0x3a')]()[_0x5df7('0x39')](function(){var _0x48bb11=_0xd96ff8[_0x5df7('0x3b')]({'plain':!![]});var _0x6885a1='ChatQueues';return db['UserProfileResource'][_0x5df7('0x3a')]({'where':{'type':_0x6885a1,'resourceId':_0x48bb11['id']}})[_0x5df7('0x39')](function(){return _0xd96ff8;});})[_0x5df7('0x39')](function(){_0x593b27[_0x5df7('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32b475,_0x33473){return function(_0x3f7ddb){if(!_0x3f7ddb){_0x32b475[_0x5df7('0x2c')](0x194);}return _0x3f7ddb;};}function handleError(_0x411a90,_0x29bd46){_0x29bd46=_0x29bd46||0x1f4;return function(_0x5847c5){logger[_0x5df7('0x28')](_0x5847c5[_0x5df7('0x3c')]);if(_0x5847c5[_0x5df7('0x3d')]){delete _0x5847c5[_0x5df7('0x3d')];}_0x411a90[_0x5df7('0x2d')](_0x29bd46)[_0x5df7('0x3e')](_0x5847c5);};}exports['index']=function(_0x1791e5,_0x3a96ed){var _0x337cf3={},_0x1c2048={},_0x4f5766={'count':0x0,'rows':[]};var _0xd4ef3f=_['map'](db[_0x5df7('0x3f')]['rawAttributes'],function(_0x5b7a3f){return{'name':_0x5b7a3f[_0x5df7('0x40')],'type':_0x5b7a3f[_0x5df7('0x41')][_0x5df7('0x42')]};});_0x1c2048[_0x5df7('0x43')]=_['map'](_0xd4ef3f,_0x5df7('0x3d'));_0x1c2048['query']=_[_0x5df7('0x44')](_0x1791e5['query']);_0x1c2048['filters']=_[_0x5df7('0x45')](_0x1c2048[_0x5df7('0x43')],_0x1c2048[_0x5df7('0x46')]);_0x337cf3['attributes']=_[_0x5df7('0x45')](_0x1c2048['model'],qs[_0x5df7('0x47')](_0x1791e5[_0x5df7('0x46')][_0x5df7('0x47')]));_0x337cf3['attributes']=_0x337cf3['attributes'][_0x5df7('0x48')]?_0x337cf3['attributes']:_0x1c2048['model'];if(!_0x1791e5['query'][_0x5df7('0x49')](_0x5df7('0x4a'))){_0x337cf3[_0x5df7('0x30')]=qs[_0x5df7('0x30')](_0x1791e5['query'][_0x5df7('0x30')]);_0x337cf3[_0x5df7('0x33')]=qs[_0x5df7('0x33')](_0x1791e5['query'][_0x5df7('0x33')]);}_0x337cf3[_0x5df7('0x4b')]=qs[_0x5df7('0x4c')](_0x1791e5[_0x5df7('0x46')][_0x5df7('0x4c')]);_0x337cf3['where']=qs[_0x5df7('0x4d')](_[_0x5df7('0x4e')](_0x1791e5[_0x5df7('0x46')],_0x1c2048[_0x5df7('0x4d')]),_0xd4ef3f);if(_0x1791e5['query']['filter']){_0x337cf3[_0x5df7('0x4f')]=_[_0x5df7('0x50')](_0x337cf3[_0x5df7('0x4f')],{'$or':_[_0x5df7('0x51')](_0xd4ef3f,function(_0x8ca6b1){if(_0x8ca6b1['type']!==_0x5df7('0x52')){var _0x59c99e={};_0x59c99e[_0x8ca6b1[_0x5df7('0x3d')]]={'$like':'%'+_0x1791e5['query']['filter']+'%'};return _0x59c99e;}})});}_0x337cf3=_[_0x5df7('0x50')]({},_0x337cf3,_0x1791e5[_0x5df7('0x53')]);var _0x23ef66={'where':_0x337cf3[_0x5df7('0x4f')]};return db[_0x5df7('0x3f')]['count'](_0x23ef66)[_0x5df7('0x39')](function(_0x1a5d1d){_0x4f5766[_0x5df7('0x32')]=_0x1a5d1d;if(_0x1791e5['query'][_0x5df7('0x54')]){_0x337cf3[_0x5df7('0x55')]=[{'all':!![]}];}return db[_0x5df7('0x3f')][_0x5df7('0x56')](_0x337cf3);})['then'](function(_0x27ad34){_0x4f5766['rows']=_0x27ad34;return _0x4f5766;})[_0x5df7('0x39')](respondWithFilteredResult(_0x3a96ed,_0x337cf3))['catch'](handleError(_0x3a96ed,null));};exports[_0x5df7('0x57')]=function(_0x37d9f1,_0xf1bb7c){var _0x38cbbb={'raw':!![],'where':{'id':_0x37d9f1[_0x5df7('0x58')]['id']}},_0x40fa6d={};_0x40fa6d['model']=_[_0x5df7('0x44')](db['ChatQueue'][_0x5df7('0x59')]);_0x40fa6d[_0x5df7('0x46')]=_[_0x5df7('0x44')](_0x37d9f1['query']);_0x40fa6d[_0x5df7('0x4d')]=_[_0x5df7('0x45')](_0x40fa6d['model'],_0x40fa6d['query']);_0x38cbbb[_0x5df7('0x5a')]=_['intersection'](_0x40fa6d['model'],qs[_0x5df7('0x47')](_0x37d9f1['query']['fields']));_0x38cbbb[_0x5df7('0x5a')]=_0x38cbbb['attributes'][_0x5df7('0x48')]?_0x38cbbb[_0x5df7('0x5a')]:_0x40fa6d[_0x5df7('0x43')];if(_0x37d9f1[_0x5df7('0x46')][_0x5df7('0x54')]){_0x38cbbb['include']=[{'all':!![]}];}_0x38cbbb=_['merge']({},_0x38cbbb,_0x37d9f1['options']);return db[_0x5df7('0x3f')][_0x5df7('0x5b')](_0x38cbbb)['then'](handleEntityNotFound(_0xf1bb7c,null))[_0x5df7('0x39')](respondWithResult(_0xf1bb7c,null))[_0x5df7('0x2b')](handleError(_0xf1bb7c,null));};exports[_0x5df7('0x5c')]=function(_0x2d8109,_0xb6a37e){return db['ChatQueue'][_0x5df7('0x5c')](_0x2d8109[_0x5df7('0x5d')],{})['then'](function(_0x128738){var _0x342c51=_0x2d8109[_0x5df7('0x5e')][_0x5df7('0x3b')]({'plain':!![]});if(!_0x342c51)throw new Error(_0x5df7('0x5f'));if(_0x342c51['role']===_0x5df7('0x5e')){var _0x11130d=_0x128738[_0x5df7('0x3b')]({'plain':!![]});var _0x5ea9aa=_0x5df7('0x60');return db[_0x5df7('0x61')]['find']({'where':{'name':_0x5ea9aa,'userProfileId':_0x342c51[_0x5df7('0x62')]},'raw':!![]})[_0x5df7('0x39')](function(_0x540c5b){if(_0x540c5b&&_0x540c5b[_0x5df7('0x63')]===0x0){return db[_0x5df7('0x64')][_0x5df7('0x5c')]({'name':_0x11130d[_0x5df7('0x3d')],'resourceId':_0x11130d['id'],'type':_0x540c5b[_0x5df7('0x3d')],'sectionId':_0x540c5b['id']},{})[_0x5df7('0x39')](function(){return _0x128738;});}else{return _0x128738;}})['catch'](function(_0x128724){logger[_0x5df7('0x28')](_0x5df7('0x65'),_0x128724);throw _0x128724;});}return _0x128738;})[_0x5df7('0x39')](respondWithResult(_0xb6a37e,0xc9))[_0x5df7('0x2b')](handleError(_0xb6a37e,null));};exports[_0x5df7('0x38')]=function(_0x36f54d,_0x2b252d){if(_0x36f54d[_0x5df7('0x5d')]['id']){delete _0x36f54d[_0x5df7('0x5d')]['id'];}return db['ChatQueue'][_0x5df7('0x5b')]({'where':{'id':_0x36f54d[_0x5df7('0x58')]['id']}})[_0x5df7('0x39')](handleEntityNotFound(_0x2b252d,null))[_0x5df7('0x39')](saveUpdates(_0x36f54d[_0x5df7('0x5d')],null))[_0x5df7('0x39')](respondWithResult(_0x2b252d,null))[_0x5df7('0x2b')](handleError(_0x2b252d,null));};exports['destroy']=function(_0x378eed,_0x8324d3){return db['ChatQueue'][_0x5df7('0x5b')]({'where':{'id':_0x378eed[_0x5df7('0x58')]['id']}})[_0x5df7('0x39')](handleEntityNotFound(_0x8324d3,null))[_0x5df7('0x39')](removeEntity(_0x8324d3,null))[_0x5df7('0x2b')](handleError(_0x8324d3,null));};exports[_0x5df7('0x66')]=function(_0x4199e0,_0x12b4c6){return db[_0x5df7('0x3f')][_0x5df7('0x66')]()[_0x5df7('0x39')](respondWithResult(_0x12b4c6,null))[_0x5df7('0x2b')](handleError(_0x12b4c6,null));};exports[_0x5df7('0x67')]=function(_0x127c49,_0x347716,_0x365eda){var _0x315391={'raw':!![],'where':{}},_0xb19ed4={},_0x4fb139;return db['ChatQueue'][_0x5df7('0x68')]({'where':{'id':_0x127c49['params']['id']}})['then'](handleEntityNotFound(_0x347716,null))['then'](function(_0x34333d){if(_0x34333d){_0x4fb139=_0x34333d[_0x5df7('0x3b')]({'plain':!![]});_0xb19ed4[_0x5df7('0x43')]=_[_0x5df7('0x44')](db['UserChatQueue'][_0x5df7('0x59')]);_0xb19ed4[_0x5df7('0x46')]=_['keys'](_0x127c49[_0x5df7('0x46')]);_0xb19ed4[_0x5df7('0x4d')]=_[_0x5df7('0x45')](_0xb19ed4[_0x5df7('0x43')],_0xb19ed4['query']);_0x315391['attributes']=_[_0x5df7('0x45')](_0xb19ed4[_0x5df7('0x43')],qs[_0x5df7('0x47')](_0x127c49[_0x5df7('0x46')][_0x5df7('0x47')]));_0x315391[_0x5df7('0x5a')]=_0x315391[_0x5df7('0x5a')][_0x5df7('0x48')]?_0x315391[_0x5df7('0x5a')]:_0xb19ed4['model'];if(!_0x127c49[_0x5df7('0x46')][_0x5df7('0x49')]('nolimit')){_0x315391[_0x5df7('0x30')]=qs[_0x5df7('0x30')](_0x127c49[_0x5df7('0x46')]['limit']);_0x315391[_0x5df7('0x33')]=qs['offset'](_0x127c49['query'][_0x5df7('0x33')]);}_0x315391[_0x5df7('0x4b')]=qs['sort'](_0x127c49['query'][_0x5df7('0x4c')]);_0x315391[_0x5df7('0x4f')]=qs[_0x5df7('0x4d')](_[_0x5df7('0x4e')](_0x127c49[_0x5df7('0x46')],_0xb19ed4[_0x5df7('0x4d')]));_0x315391['where'][_0x5df7('0x69')]=_0x34333d['id'];if(_0x127c49[_0x5df7('0x46')][_0x5df7('0x6a')]){_0x315391[_0x5df7('0x4f')]=_['merge'](_0x315391['where'],{'$or':_[_0x5df7('0x51')](_0x315391[_0x5df7('0x5a')],function(_0x21aa5f){var _0x406151={};_0x406151[_0x21aa5f]={'$like':'%'+_0x127c49[_0x5df7('0x46')][_0x5df7('0x6a')]+'%'};return _0x406151;})});}_0x315391=_[_0x5df7('0x50')]({},_0x315391,_0x127c49[_0x5df7('0x53')]);return db[_0x5df7('0x6b')]['findAll'](_0x315391);}})[_0x5df7('0x39')](function(_0x680b36){if(_0x680b36){return db[_0x5df7('0x6c')][_0x5df7('0x6d')]({'where':{'id':_[_0x5df7('0x51')](_0x680b36,_0x5df7('0x6e')),'role':'agent'},'attributes':['id','name',_0x5df7('0x6f'),_0x5df7('0x70'),_0x5df7('0x71')]});}})[_0x5df7('0x39')](function(_0x400cf4){if(_0x400cf4){return{'count':_0x400cf4['count'],'rows':_[_0x5df7('0x51')](_0x400cf4[_0x5df7('0x72')],function(_0x24f063){return{'membername':_0x24f063[_0x5df7('0x3d')],'UserId':_0x24f063['id'],'queue_name':_0x4fb139[_0x5df7('0x3d')],'ChatQueueId':_0x4fb139['id'],'interface':util['format']('%s/%s',_0x5df7('0x73'),_0x24f063['name']),'penalty':0x0,'paused':_0x24f063[_0x5df7('0x6f')],'createdAt':_0x24f063[_0x5df7('0x71')],'updatedAt':_0x24f063['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x347716,_0x315391))[_0x5df7('0x2b')](handleError(_0x347716,null));};exports['getTeams']=function(_0x43e19f,_0x4292b4,_0x269193){var _0x59c1d9={};var _0x3712de={};var _0x4dc413;var _0x469e68;return db[_0x5df7('0x3f')]['findOne']({'where':{'id':_0x43e19f[_0x5df7('0x58')]['id']}})[_0x5df7('0x39')](handleEntityNotFound(_0x4292b4,null))['then'](function(_0xbfec10){if(_0xbfec10){_0x4dc413=_0xbfec10;_0x3712de[_0x5df7('0x43')]=_[_0x5df7('0x44')](db[_0x5df7('0x74')]['rawAttributes']);_0x3712de[_0x5df7('0x46')]=_['keys'](_0x43e19f[_0x5df7('0x46')]);_0x3712de['filters']=_[_0x5df7('0x45')](_0x3712de[_0x5df7('0x43')],_0x3712de[_0x5df7('0x46')]);_0x59c1d9[_0x5df7('0x5a')]=_['intersection'](_0x3712de['model'],qs['fields'](_0x43e19f['query'][_0x5df7('0x47')]));_0x59c1d9['attributes']=_0x59c1d9[_0x5df7('0x5a')][_0x5df7('0x48')]?_0x59c1d9[_0x5df7('0x5a')]:_0x3712de['model'];_0x59c1d9[_0x5df7('0x4b')]=qs[_0x5df7('0x4c')](_0x43e19f[_0x5df7('0x46')][_0x5df7('0x4c')]);_0x59c1d9['where']=qs[_0x5df7('0x4d')](_[_0x5df7('0x4e')](_0x43e19f[_0x5df7('0x46')],_0x3712de[_0x5df7('0x4d')]));if(_0x43e19f[_0x5df7('0x46')][_0x5df7('0x6a')]){_0x59c1d9[_0x5df7('0x4f')]=_[_0x5df7('0x50')](_0x59c1d9[_0x5df7('0x4f')],{'$or':_[_0x5df7('0x51')](_0x59c1d9['attributes'],function(_0x4c338e){var _0x1db07e={};_0x1db07e[_0x4c338e]={'$like':'%'+_0x43e19f[_0x5df7('0x46')][_0x5df7('0x6a')]+'%'};return _0x1db07e;})});}_0x59c1d9=_[_0x5df7('0x50')]({},_0x59c1d9,_0x43e19f[_0x5df7('0x53')]);return _0x4dc413[_0x5df7('0x75')](_0x59c1d9);}})[_0x5df7('0x39')](function(_0x35f1f5){if(_0x35f1f5){_0x469e68=_0x35f1f5[_0x5df7('0x48')];if(!_0x43e19f[_0x5df7('0x46')]['hasOwnProperty'](_0x5df7('0x4a'))){_0x59c1d9[_0x5df7('0x30')]=qs[_0x5df7('0x30')](_0x43e19f[_0x5df7('0x46')]['limit']);_0x59c1d9[_0x5df7('0x33')]=qs[_0x5df7('0x33')](_0x43e19f[_0x5df7('0x46')]['offset']);}return _0x4dc413['getTeams'](_0x59c1d9);}})['then'](function(_0x2e5df6){if(_0x2e5df6){return _0x2e5df6?{'count':_0x469e68,'rows':_0x2e5df6}:null;}})[_0x5df7('0x39')](respondWithResult(_0x4292b4,null))['catch'](handleError(_0x4292b4,null));};exports[_0x5df7('0x76')]=function(_0x3785dc,_0x3b1c86,_0x15f56e){var _0x330978=_0x3785dc['body']['ids'];return db[_0x5df7('0x74')][_0x5df7('0x56')]({'where':{'id':_0x330978},'attributes':['id'],'include':[{'model':db[_0x5df7('0x6c')],'as':_0x5df7('0x77'),'attributes':['id','name',_0x5df7('0x78'),'voicePause',_0x5df7('0x79')],'raw':!![]}]})[_0x5df7('0x39')](function(_0x1faf2b){if(_0x1faf2b){var _0x185a74=_['flatMap'](_0x1faf2b,function(_0x54dddb){var _0x92c46e=_0x54dddb['get']({'plain':!![]});return _0x92c46e[_0x5df7('0x77')];});return db[_0x5df7('0x3f')][_0x5df7('0x5b')]({'where':{'id':_0x3785dc['params']['id']}})['then'](function(_0x5c27ca){return db[_0x5df7('0x7a')][_0x5df7('0x7b')](function(_0x515395){return _0x5c27ca['addTeams'](_0x330978,{'transaction':_0x515395})[_0x5df7('0x39')](function(){return BPromise['each'](_0x185a74,function(_0x5b13b3){return db[_0x5df7('0x6b')][_0x5df7('0x7c')]({'where':{'UserId':_0x5b13b3['id'],'ChatQueueId':_0x3785dc[_0x5df7('0x58')]['id']},'transaction':_0x515395});});})[_0x5df7('0x39')](function(){_0x185a74['forEach'](function(_0x12852f){socket['emit'](_0x5df7('0x7d'),{'UserId':_0x12852f['id'],'ChatQueueId':_0x5c27ca['id']});});});});});}})[_0x5df7('0x39')](respondWithStatusCode(_0x3b1c86,null))[_0x5df7('0x2b')](handleError(_0x3b1c86,null));};exports[_0x5df7('0x7e')]=function(_0x136945,_0x589c7b,_0x2f831a){return db[_0x5df7('0x74')]['findAll']({'where':{'id':_0x136945[_0x5df7('0x46')][_0x5df7('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x5df7('0x6c')],'as':_0x5df7('0x77'),'attributes':['id'],'raw':!![]}]})[_0x5df7('0x39')](handleEntityNotFound(_0x589c7b,null))['then'](function(_0x11f5ab){var _0x29124a=_['map'](_0x11f5ab,'id');var _0x3307c9=[];var _0x21eff0=[];var _0xd2f86b=squel[_0x5df7('0x80')]();_0xd2f86b[_0x5df7('0x81')](_0x5df7('0x82'))[_0x5df7('0x83')](_0x5df7('0x84'),'tq')[_0x5df7('0x85')](_0x5df7('0x86'),'ut',_0x5df7('0x87'))['where'](_0x5df7('0x88'),_0x136945[_0x5df7('0x58')]['id']);for(var _0x29aa49=0x0;_0x29aa49<_0x11f5ab[_0x5df7('0x48')];_0x29aa49+=0x1){let _0x5bc486=_0x11f5ab[_0x29aa49];for(var _0xb90b75=0x0;_0xb90b75<_0x5bc486[_0x5df7('0x77')][_0x5df7('0x48')];_0xb90b75+=0x1){let _0x5e98b5=_0x5bc486['Agents'][_0xb90b75];var _0x336898=_0xd2f86b[_0x5df7('0x89')]();_0x336898['where'](_0x5df7('0x8a'),_0x5e98b5['id']);_0x21eff0[_0x5df7('0x8b')](db[_0x5df7('0x7a')]['query'](_0x336898['toString'](),{'type':db[_0x5df7('0x7a')]['QueryTypes'][_0x5df7('0x8c')]})['then'](function(_0xba8017){if(_0xba8017[_0x5df7('0x48')]===0x1){return _0x5e98b5['id'];}else{var _0x466094=_[_0x5df7('0x8d')](_[_0x5df7('0x51')](_0xba8017,_0x5df7('0x8e')),function(_0xdb1250){return _['includes'](_0x29124a,_0xdb1250);});if(_0x466094){return _0x5e98b5['id'];}}}));}}return BPromise[_0x5df7('0x8f')](_0x21eff0)[_0x5df7('0x39')](function(_0x49e58c){_0x3307c9=_(_0x3307c9)[_0x5df7('0x90')](_0x49e58c)['compact']()[_0x5df7('0x91')]();return db[_0x5df7('0x3f')][_0x5df7('0x5b')]({'where':{'id':_0x136945[_0x5df7('0x58')]['id']}})[_0x5df7('0x39')](function(_0x2b9b62){return db['sequelize'][_0x5df7('0x7b')](function(_0x13855c){return _0x2b9b62[_0x5df7('0x7e')](_0x136945['query'][_0x5df7('0x7f')],{'transaction':_0x13855c})[_0x5df7('0x39')](function(){if(!_[_0x5df7('0x92')](_0x3307c9)){return _0x2b9b62['removeAgents'](_0x3307c9,{'transaction':_0x13855c});}})[_0x5df7('0x39')](function(){_0x3307c9[_0x5df7('0x93')](function(_0x2fb6e9){socket[_0x5df7('0x94')](_0x5df7('0x95'),{'UserId':_0x2fb6e9,'ChatQueueId':_0x2b9b62['id']});});});});});});})[_0x5df7('0x39')](respondWithStatusCode(_0x589c7b,null))[_0x5df7('0x2b')](handleError(_0x589c7b,null));};exports[_0x5df7('0x96')]=function(_0x5df3cb,_0x12fa8d,_0x2aa303){return db['ChatQueue'][_0x5df7('0x5b')]({'where':{'id':_0x5df3cb[_0x5df7('0x58')]['id']}})[_0x5df7('0x39')](handleEntityNotFound(_0x12fa8d,null))[_0x5df7('0x39')](function(_0x3cffdb){if(_0x3cffdb){return _0x3cffdb[_0x5df7('0x96')](_0x5df3cb[_0x5df7('0x5d')][_0x5df7('0x7f')],_[_0x5df7('0x97')](_0x5df3cb[_0x5df7('0x5d')],[_0x5df7('0x7f'),'id'])||{})[_0x5df7('0x98')](function(_0x5311f2){for(var _0x5efaf0=0x0;_0x5efaf0<_0x5df3cb[_0x5df7('0x5d')]['ids']['length'];_0x5efaf0+=0x1){socket[_0x5df7('0x94')]('userChatQueue:save',{'UserId':Number(_0x5df3cb[_0x5df7('0x5d')][_0x5df7('0x7f')][_0x5efaf0]),'ChatQueueId':Number(_0x5df3cb[_0x5df7('0x58')]['id'])});}return _0x5311f2;});}})['then'](respondWithResult(_0x12fa8d,null))[_0x5df7('0x2b')](handleError(_0x12fa8d,null));};exports['removeAgents']=function(_0xc69c05,_0x19c6d4,_0x300141){return db['ChatQueue'][_0x5df7('0x5b')]({'where':{'id':_0xc69c05[_0x5df7('0x58')]['id']}})[_0x5df7('0x39')](handleEntityNotFound(_0x19c6d4,null))[_0x5df7('0x39')](function(_0x5648a6){if(_0x5648a6){return _0x5648a6[_0x5df7('0x99')](_0xc69c05[_0x5df7('0x46')][_0x5df7('0x7f')])[_0x5df7('0x39')](function(){if(_['isArray'](_0xc69c05[_0x5df7('0x46')][_0x5df7('0x7f')])){for(var _0x4bfff9=0x0;_0x4bfff9<_0xc69c05[_0x5df7('0x46')][_0x5df7('0x7f')][_0x5df7('0x48')];_0x4bfff9+=0x1){socket['emit'](_0x5df7('0x95'),{'UserId':Number(_0xc69c05['query']['ids'][_0x4bfff9]),'ChatQueueId':Number(_0xc69c05[_0x5df7('0x58')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0xc69c05['query'][_0x5df7('0x7f')]),'ChatQueueId':Number(_0xc69c05[_0x5df7('0x58')]['id'])});}});}})[_0x5df7('0x39')](respondWithStatusCode(_0x19c6d4,null))[_0x5df7('0x2b')](handleError(_0x19c6d4,null));};exports[_0x5df7('0x9a')]=function(_0x1ae10f,_0x31482f,_0x306996){var _0x15327f={};var _0x14f1c9={};var _0x1aa198;var _0xf476fb;return db['ChatQueue'][_0x5df7('0x68')]({'where':{'id':_0x1ae10f['params']['id']}})[_0x5df7('0x39')](handleEntityNotFound(_0x31482f,null))[_0x5df7('0x39')](function(_0x458113){if(_0x458113){_0x1aa198=_0x458113;_0x14f1c9['model']=_['keys'](db[_0x5df7('0x6c')][_0x5df7('0x59')]);_0x14f1c9[_0x5df7('0x46')]=_[_0x5df7('0x44')](_0x1ae10f[_0x5df7('0x46')]);_0x14f1c9[_0x5df7('0x4d')]=_[_0x5df7('0x45')](_0x14f1c9[_0x5df7('0x43')],_0x14f1c9[_0x5df7('0x46')]);_0x15327f['attributes']=_['intersection'](_0x14f1c9[_0x5df7('0x43')],qs[_0x5df7('0x47')](_0x1ae10f[_0x5df7('0x46')]['fields']));_0x15327f[_0x5df7('0x5a')]=_0x15327f[_0x5df7('0x5a')]['length']?_0x15327f[_0x5df7('0x5a')]:_0x14f1c9[_0x5df7('0x43')];_0x15327f[_0x5df7('0x4b')]=qs[_0x5df7('0x4c')](_0x1ae10f[_0x5df7('0x46')]['sort']);_0x15327f['where']=qs[_0x5df7('0x4d')](_[_0x5df7('0x4e')](_0x1ae10f[_0x5df7('0x46')],_0x14f1c9[_0x5df7('0x4d')]));if(_0x1ae10f[_0x5df7('0x46')][_0x5df7('0x6a')]){_0x15327f[_0x5df7('0x4f')]=_['merge'](_0x15327f[_0x5df7('0x4f')],{'$or':_['map'](_0x15327f[_0x5df7('0x5a')],function(_0x3aef8a){var _0x2f6dc5={};_0x2f6dc5[_0x3aef8a]={'$like':'%'+_0x1ae10f['query']['filter']+'%'};return _0x2f6dc5;})});}_0x15327f=_[_0x5df7('0x50')]({},_0x15327f,_0x1ae10f[_0x5df7('0x53')]);return _0x1aa198['getAgents'](_0x15327f);}})[_0x5df7('0x39')](function(_0x1c160b){if(_0x1c160b){_0xf476fb=_0x1c160b[_0x5df7('0x48')];if(!_0x1ae10f[_0x5df7('0x46')][_0x5df7('0x49')](_0x5df7('0x4a'))){_0x15327f[_0x5df7('0x30')]=qs[_0x5df7('0x30')](_0x1ae10f[_0x5df7('0x46')][_0x5df7('0x30')]);_0x15327f[_0x5df7('0x33')]=qs[_0x5df7('0x33')](_0x1ae10f['query']['offset']);}return _0x1aa198[_0x5df7('0x9a')](_0x15327f);}})[_0x5df7('0x39')](function(_0x10dd75){if(_0x10dd75){return _0x10dd75?{'count':_0xf476fb,'rows':_0x10dd75}:null;}})[_0x5df7('0x39')](respondWithResult(_0x31482f,null))[_0x5df7('0x2b')](handleError(_0x31482f,null));};
\ No newline at end of file
+var _0x53e2=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','request\x20sent','error','code','message','result','catch','ChatQueue,\x20%s,\x20%s','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1c57fd,_0x5eeeae){var _0x408d52=function(_0x4668bf){while(--_0x4668bf){_0x1c57fd['push'](_0x1c57fd['shift']());}};_0x408d52(++_0x5eeeae);}(_0x53e2,0xd1));var _0x253e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x53e2[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x253e('0x0'));var rimraf=require(_0x253e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x253e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x253e('0x3'));var Mustache=require(_0x253e('0x4'));var util=require(_0x253e('0x5'));var path=require(_0x253e('0x6'));var sox=require(_0x253e('0x7'));var csv=require('to-csv');var ejs=require(_0x253e('0x8'));var fs=require('fs');var fs_extra=require(_0x253e('0x9'));var _=require(_0x253e('0xa'));var squel=require(_0x253e('0xb'));var crypto=require('crypto');var jsforce=require(_0x253e('0xc'));var deskjs=require(_0x253e('0xd'));var toCsv=require(_0x253e('0xe'));var querystring=require(_0x253e('0xf'));var Papa=require(_0x253e('0x10'));var Redis=require(_0x253e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x253e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x253e('0x13'));var logger=require(_0x253e('0x14'))(_0x253e('0x15'));var utils=require('../../config/utils');var config=require(_0x253e('0x16'));var licenseUtil=require(_0x253e('0x17'));var db=require('../../mysqldb')['db'];config[_0x253e('0x18')]=_['defaults'](config['redis'],{'host':_0x253e('0x19'),'port':0x18eb});var socket=require(_0x253e('0x1a'))(new Redis(config[_0x253e('0x18')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x253e('0x1b'));var client=jayson[_0x253e('0x1c')][_0x253e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2bb80a,_0x10a1ef,_0x37819f,_0x203477){return new BPromise(function(_0x673119,_0x99904b){var _0x3068e6=_0x203477||client;return _0x3068e6[_0x253e('0x1e')](_0x2bb80a,_0x37819f)['then'](function(_0x252e2d){logger['info']('ChatQueue,\x20%s,\x20%s',_0x10a1ef,_0x253e('0x1f'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x10a1ef,_0x253e('0x1f'),JSON['stringify'](_0x252e2d));if(_0x252e2d[_0x253e('0x20')]){if(_0x252e2d[_0x253e('0x20')][_0x253e('0x21')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x10a1ef,_0x252e2d[_0x253e('0x20')][_0x253e('0x22')]);return _0x99904b(_0x252e2d[_0x253e('0x20')]['message']);}logger[_0x253e('0x20')]('ChatQueue,\x20%s,\x20%s',_0x10a1ef,_0x252e2d[_0x253e('0x20')][_0x253e('0x22')]);return _0x673119(_0x252e2d['error'][_0x253e('0x22')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x10a1ef,_0x253e('0x1f'));_0x673119(_0x252e2d[_0x253e('0x23')][_0x253e('0x22')]);}})[_0x253e('0x24')](function(_0x32cdc7){logger[_0x253e('0x20')](_0x253e('0x25'),_0x10a1ef,_0x32cdc7);_0x99904b(_0x32cdc7);});});}function respondWithStatusCode(_0xeacbd8,_0x556523){_0x556523=_0x556523||0xcc;return function(_0x5366ef){if(_0x5366ef){return _0xeacbd8[_0x253e('0x26')](_0x556523);}return _0xeacbd8[_0x253e('0x27')](_0x556523)[_0x253e('0x28')]();};}function respondWithResult(_0x3d4df1,_0x5630d7){_0x5630d7=_0x5630d7||0xc8;return function(_0x79a15d){if(_0x79a15d){return _0x3d4df1['status'](_0x5630d7)['json'](_0x79a15d);}};}function respondWithFilteredResult(_0x2d8588,_0x49187b){return function(_0x308e97){if(_0x308e97){var _0x259ef8=typeof _0x49187b[_0x253e('0x29')]===_0x253e('0x2a')&&typeof _0x49187b[_0x253e('0x2b')]===_0x253e('0x2a');var _0x1b0958=_0x308e97[_0x253e('0x2c')];var _0x4f22ad=_0x259ef8?0x0:_0x49187b['offset'];var _0x23a844=_0x259ef8?_0x308e97[_0x253e('0x2c')]:_0x49187b['offset']+_0x49187b['limit'];var _0x113fb1;if(_0x23a844>=_0x1b0958){_0x23a844=_0x1b0958;_0x113fb1=0xc8;}else{_0x113fb1=0xce;}_0x2d8588['status'](_0x113fb1);return _0x2d8588[_0x253e('0x2d')](_0x253e('0x2e'),_0x4f22ad+'-'+_0x23a844+'/'+_0x1b0958)['json'](_0x308e97);}return null;};}function patchUpdates(_0x2cc5c7){return function(_0x39690f){try{jsonpatch[_0x253e('0x2f')](_0x39690f,_0x2cc5c7,!![]);}catch(_0x45b46a){return BPromise[_0x253e('0x30')](_0x45b46a);}return _0x39690f[_0x253e('0x31')]();};}function saveUpdates(_0x5a9d30,_0xa9ccf9){return function(_0x38e1ae){if(_0x38e1ae){return _0x38e1ae['update'](_0x5a9d30)[_0x253e('0x32')](function(_0xc9301b){return _0xc9301b;});}return null;};}function removeEntity(_0x5da2b6,_0x557fcb){return function(_0x5ce71c){if(_0x5ce71c){return _0x5ce71c['destroy']()['then'](function(){var _0x148ea3=_0x5ce71c[_0x253e('0x33')]({'plain':!![]});var _0x342304=_0x253e('0x34');return db[_0x253e('0x35')][_0x253e('0x36')]({'where':{'type':_0x342304,'resourceId':_0x148ea3['id']}})[_0x253e('0x32')](function(){return _0x5ce71c;});})[_0x253e('0x32')](function(){_0x5da2b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a880,_0x8a8ca0){return function(_0x38fbbd){if(!_0x38fbbd){_0x49a880[_0x253e('0x26')](0x194);}return _0x38fbbd;};}function handleError(_0x556efd,_0x4f983d){_0x4f983d=_0x4f983d||0x1f4;return function(_0x2e2bbe){logger[_0x253e('0x20')](_0x2e2bbe[_0x253e('0x37')]);if(_0x2e2bbe['name']){delete _0x2e2bbe[_0x253e('0x38')];}_0x556efd['status'](_0x4f983d)[_0x253e('0x39')](_0x2e2bbe);};}exports[_0x253e('0x3a')]=function(_0x3fe415,_0x43439d){var _0x4d93f6={},_0x5ce3a2={},_0x3c7530={'count':0x0,'rows':[]};var _0x3284a6=_[_0x253e('0x3b')](db[_0x253e('0x3c')][_0x253e('0x3d')],function(_0x59a5a2){return{'name':_0x59a5a2[_0x253e('0x3e')],'type':_0x59a5a2['type']['key']};});_0x5ce3a2['model']=_[_0x253e('0x3b')](_0x3284a6,'name');_0x5ce3a2[_0x253e('0x3f')]=_['keys'](_0x3fe415[_0x253e('0x3f')]);_0x5ce3a2[_0x253e('0x40')]=_[_0x253e('0x41')](_0x5ce3a2[_0x253e('0x42')],_0x5ce3a2[_0x253e('0x3f')]);_0x4d93f6[_0x253e('0x43')]=_[_0x253e('0x41')](_0x5ce3a2['model'],qs[_0x253e('0x44')](_0x3fe415[_0x253e('0x3f')][_0x253e('0x44')]));_0x4d93f6[_0x253e('0x43')]=_0x4d93f6[_0x253e('0x43')]['length']?_0x4d93f6['attributes']:_0x5ce3a2['model'];if(!_0x3fe415['query'][_0x253e('0x45')](_0x253e('0x46'))){_0x4d93f6[_0x253e('0x2b')]=qs[_0x253e('0x2b')](_0x3fe415[_0x253e('0x3f')]['limit']);_0x4d93f6[_0x253e('0x29')]=qs[_0x253e('0x29')](_0x3fe415[_0x253e('0x3f')]['offset']);}_0x4d93f6[_0x253e('0x47')]=qs[_0x253e('0x48')](_0x3fe415[_0x253e('0x3f')]['sort']);_0x4d93f6['where']=qs[_0x253e('0x40')](_[_0x253e('0x49')](_0x3fe415[_0x253e('0x3f')],_0x5ce3a2[_0x253e('0x40')]),_0x3284a6);if(_0x3fe415[_0x253e('0x3f')][_0x253e('0x4a')]){_0x4d93f6[_0x253e('0x4b')]=_[_0x253e('0x4c')](_0x4d93f6[_0x253e('0x4b')],{'$or':_[_0x253e('0x3b')](_0x3284a6,function(_0x2d8bf9){if(_0x2d8bf9['type']!==_0x253e('0x4d')){var _0xd959d6={};_0xd959d6[_0x2d8bf9['name']]={'$like':'%'+_0x3fe415[_0x253e('0x3f')][_0x253e('0x4a')]+'%'};return _0xd959d6;}})});}_0x4d93f6=_[_0x253e('0x4c')]({},_0x4d93f6,_0x3fe415[_0x253e('0x4e')]);var _0x18af22={'where':_0x4d93f6[_0x253e('0x4b')]};return db[_0x253e('0x3c')][_0x253e('0x2c')](_0x18af22)[_0x253e('0x32')](function(_0xaa6b86){_0x3c7530[_0x253e('0x2c')]=_0xaa6b86;if(_0x3fe415['query'][_0x253e('0x4f')]){_0x4d93f6[_0x253e('0x50')]=[{'all':!![]}];}return db[_0x253e('0x3c')][_0x253e('0x51')](_0x4d93f6);})[_0x253e('0x32')](function(_0x37af50){_0x3c7530[_0x253e('0x52')]=_0x37af50;return _0x3c7530;})['then'](respondWithFilteredResult(_0x43439d,_0x4d93f6))[_0x253e('0x24')](handleError(_0x43439d,null));};exports[_0x253e('0x53')]=function(_0x9847bb,_0x4676be){var _0x226c26={'raw':!![],'where':{'id':_0x9847bb[_0x253e('0x54')]['id']}},_0x59f0c6={};_0x59f0c6[_0x253e('0x42')]=_['keys'](db['ChatQueue'][_0x253e('0x3d')]);_0x59f0c6[_0x253e('0x3f')]=_[_0x253e('0x55')](_0x9847bb[_0x253e('0x3f')]);_0x59f0c6[_0x253e('0x40')]=_['intersection'](_0x59f0c6[_0x253e('0x42')],_0x59f0c6[_0x253e('0x3f')]);_0x226c26[_0x253e('0x43')]=_['intersection'](_0x59f0c6[_0x253e('0x42')],qs[_0x253e('0x44')](_0x9847bb[_0x253e('0x3f')][_0x253e('0x44')]));_0x226c26[_0x253e('0x43')]=_0x226c26[_0x253e('0x43')][_0x253e('0x56')]?_0x226c26[_0x253e('0x43')]:_0x59f0c6[_0x253e('0x42')];if(_0x9847bb[_0x253e('0x3f')][_0x253e('0x4f')]){_0x226c26[_0x253e('0x50')]=[{'all':!![]}];}_0x226c26=_['merge']({},_0x226c26,_0x9847bb[_0x253e('0x4e')]);return db[_0x253e('0x3c')][_0x253e('0x57')](_0x226c26)[_0x253e('0x32')](handleEntityNotFound(_0x4676be,null))['then'](respondWithResult(_0x4676be,null))['catch'](handleError(_0x4676be,null));};exports[_0x253e('0x58')]=function(_0x192708,_0x1e3142){return db[_0x253e('0x3c')][_0x253e('0x58')](_0x192708[_0x253e('0x59')],{})[_0x253e('0x32')](function(_0x1c8230){var _0x48388e=_0x192708[_0x253e('0x5a')][_0x253e('0x33')]({'plain':!![]});if(!_0x48388e)throw new Error(_0x253e('0x5b'));if(_0x48388e[_0x253e('0x5c')]===_0x253e('0x5a')){var _0x232174=_0x1c8230[_0x253e('0x33')]({'plain':!![]});var _0x944707=_0x253e('0x34');return db[_0x253e('0x5d')]['find']({'where':{'name':_0x944707,'userProfileId':_0x48388e[_0x253e('0x5e')]},'raw':!![]})[_0x253e('0x32')](function(_0x4ce13f){if(_0x4ce13f&&_0x4ce13f[_0x253e('0x5f')]===0x0){return db[_0x253e('0x35')]['create']({'name':_0x232174[_0x253e('0x38')],'resourceId':_0x232174['id'],'type':_0x4ce13f[_0x253e('0x38')],'sectionId':_0x4ce13f['id']},{})['then'](function(){return _0x1c8230;});}else{return _0x1c8230;}})[_0x253e('0x24')](function(_0x1e67f8){logger[_0x253e('0x20')](_0x253e('0x60'),_0x1e67f8);throw _0x1e67f8;});}return _0x1c8230;})[_0x253e('0x32')](respondWithResult(_0x1e3142,0xc9))[_0x253e('0x24')](handleError(_0x1e3142,null));};exports[_0x253e('0x61')]=function(_0x192a7c,_0x5573af){if(_0x192a7c[_0x253e('0x59')]['id']){delete _0x192a7c[_0x253e('0x59')]['id'];}return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x192a7c['params']['id']}})[_0x253e('0x32')](handleEntityNotFound(_0x5573af,null))[_0x253e('0x32')](saveUpdates(_0x192a7c[_0x253e('0x59')],null))['then'](respondWithResult(_0x5573af,null))[_0x253e('0x24')](handleError(_0x5573af,null));};exports[_0x253e('0x36')]=function(_0x2d1fb0,_0x4630ad){return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x2d1fb0[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0x4630ad,null))[_0x253e('0x32')](removeEntity(_0x4630ad,null))[_0x253e('0x24')](handleError(_0x4630ad,null));};exports[_0x253e('0x62')]=function(_0x17aca9,_0x329f76){return db[_0x253e('0x3c')][_0x253e('0x62')]()['then'](respondWithResult(_0x329f76,null))[_0x253e('0x24')](handleError(_0x329f76,null));};exports['getMembers']=function(_0x1890ea,_0x22ba95,_0x282393){var _0x1291cc={'raw':!![],'where':{}},_0x4a4cab={},_0xf07f30;return db[_0x253e('0x3c')][_0x253e('0x63')]({'where':{'id':_0x1890ea[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0x22ba95,null))['then'](function(_0x11346f){if(_0x11346f){_0xf07f30=_0x11346f['get']({'plain':!![]});_0x4a4cab[_0x253e('0x42')]=_[_0x253e('0x55')](db[_0x253e('0x64')][_0x253e('0x3d')]);_0x4a4cab[_0x253e('0x3f')]=_[_0x253e('0x55')](_0x1890ea[_0x253e('0x3f')]);_0x4a4cab[_0x253e('0x40')]=_['intersection'](_0x4a4cab[_0x253e('0x42')],_0x4a4cab[_0x253e('0x3f')]);_0x1291cc[_0x253e('0x43')]=_[_0x253e('0x41')](_0x4a4cab[_0x253e('0x42')],qs[_0x253e('0x44')](_0x1890ea[_0x253e('0x3f')][_0x253e('0x44')]));_0x1291cc['attributes']=_0x1291cc[_0x253e('0x43')]['length']?_0x1291cc['attributes']:_0x4a4cab['model'];if(!_0x1890ea[_0x253e('0x3f')]['hasOwnProperty'](_0x253e('0x46'))){_0x1291cc[_0x253e('0x2b')]=qs[_0x253e('0x2b')](_0x1890ea[_0x253e('0x3f')]['limit']);_0x1291cc['offset']=qs[_0x253e('0x29')](_0x1890ea[_0x253e('0x3f')]['offset']);}_0x1291cc[_0x253e('0x47')]=qs[_0x253e('0x48')](_0x1890ea[_0x253e('0x3f')][_0x253e('0x48')]);_0x1291cc['where']=qs[_0x253e('0x40')](_['pick'](_0x1890ea[_0x253e('0x3f')],_0x4a4cab['filters']));_0x1291cc[_0x253e('0x4b')][_0x253e('0x65')]=_0x11346f['id'];if(_0x1890ea['query'][_0x253e('0x4a')]){_0x1291cc[_0x253e('0x4b')]=_['merge'](_0x1291cc[_0x253e('0x4b')],{'$or':_[_0x253e('0x3b')](_0x1291cc[_0x253e('0x43')],function(_0x4238a6){var _0x46b0f3={};_0x46b0f3[_0x4238a6]={'$like':'%'+_0x1890ea[_0x253e('0x3f')][_0x253e('0x4a')]+'%'};return _0x46b0f3;})});}_0x1291cc=_[_0x253e('0x4c')]({},_0x1291cc,_0x1890ea[_0x253e('0x4e')]);return db[_0x253e('0x64')][_0x253e('0x51')](_0x1291cc);}})[_0x253e('0x32')](function(_0x4c973d){if(_0x4c973d){return db['User'][_0x253e('0x66')]({'where':{'id':_['map'](_0x4c973d,_0x253e('0x67')),'role':_0x253e('0x68')},'attributes':['id',_0x253e('0x38'),_0x253e('0x69'),_0x253e('0x6a'),_0x253e('0x6b')]});}})[_0x253e('0x32')](function(_0x256ea0){if(_0x256ea0){return{'count':_0x256ea0[_0x253e('0x2c')],'rows':_[_0x253e('0x3b')](_0x256ea0['rows'],function(_0x30c2ba){return{'membername':_0x30c2ba[_0x253e('0x38')],'UserId':_0x30c2ba['id'],'queue_name':_0xf07f30[_0x253e('0x38')],'ChatQueueId':_0xf07f30['id'],'interface':util[_0x253e('0x6c')](_0x253e('0x6d'),_0x253e('0x6e'),_0x30c2ba[_0x253e('0x38')]),'penalty':0x0,'paused':_0x30c2ba[_0x253e('0x69')],'createdAt':_0x30c2ba[_0x253e('0x6b')],'updatedAt':_0x30c2ba[_0x253e('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x22ba95,_0x1291cc))[_0x253e('0x24')](handleError(_0x22ba95,null));};exports['getTeams']=function(_0x3710a9,_0x295c22,_0x27aa00){var _0x5b663f={};var _0x44b331={};var _0x12644b;var _0x406810;return db[_0x253e('0x3c')][_0x253e('0x63')]({'where':{'id':_0x3710a9[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0x295c22,null))['then'](function(_0x20f90b){if(_0x20f90b){_0x12644b=_0x20f90b;_0x44b331[_0x253e('0x42')]=_[_0x253e('0x55')](db[_0x253e('0x6f')][_0x253e('0x3d')]);_0x44b331['query']=_[_0x253e('0x55')](_0x3710a9[_0x253e('0x3f')]);_0x44b331[_0x253e('0x40')]=_[_0x253e('0x41')](_0x44b331[_0x253e('0x42')],_0x44b331[_0x253e('0x3f')]);_0x5b663f[_0x253e('0x43')]=_['intersection'](_0x44b331['model'],qs[_0x253e('0x44')](_0x3710a9[_0x253e('0x3f')][_0x253e('0x44')]));_0x5b663f[_0x253e('0x43')]=_0x5b663f[_0x253e('0x43')][_0x253e('0x56')]?_0x5b663f[_0x253e('0x43')]:_0x44b331[_0x253e('0x42')];_0x5b663f[_0x253e('0x47')]=qs['sort'](_0x3710a9[_0x253e('0x3f')][_0x253e('0x48')]);_0x5b663f[_0x253e('0x4b')]=qs[_0x253e('0x40')](_[_0x253e('0x49')](_0x3710a9[_0x253e('0x3f')],_0x44b331[_0x253e('0x40')]));if(_0x3710a9['query'][_0x253e('0x4a')]){_0x5b663f['where']=_['merge'](_0x5b663f[_0x253e('0x4b')],{'$or':_['map'](_0x5b663f[_0x253e('0x43')],function(_0x4d0d31){var _0x162fa6={};_0x162fa6[_0x4d0d31]={'$like':'%'+_0x3710a9[_0x253e('0x3f')]['filter']+'%'};return _0x162fa6;})});}_0x5b663f=_[_0x253e('0x4c')]({},_0x5b663f,_0x3710a9['options']);return _0x12644b[_0x253e('0x70')](_0x5b663f);}})[_0x253e('0x32')](function(_0x1455af){if(_0x1455af){_0x406810=_0x1455af[_0x253e('0x56')];if(!_0x3710a9[_0x253e('0x3f')]['hasOwnProperty'](_0x253e('0x46'))){_0x5b663f['limit']=qs['limit'](_0x3710a9[_0x253e('0x3f')][_0x253e('0x2b')]);_0x5b663f[_0x253e('0x29')]=qs[_0x253e('0x29')](_0x3710a9[_0x253e('0x3f')][_0x253e('0x29')]);}return _0x12644b[_0x253e('0x70')](_0x5b663f);}})[_0x253e('0x32')](function(_0x24e50d){if(_0x24e50d){return _0x24e50d?{'count':_0x406810,'rows':_0x24e50d}:null;}})[_0x253e('0x32')](respondWithResult(_0x295c22,null))[_0x253e('0x24')](handleError(_0x295c22,null));};exports[_0x253e('0x71')]=function(_0x5b7b91,_0x1b204c,_0x5e2cac){var _0x4ea8a6=_0x5b7b91[_0x253e('0x59')][_0x253e('0x72')];return db[_0x253e('0x6f')][_0x253e('0x51')]({'where':{'id':_0x4ea8a6},'attributes':['id'],'include':[{'model':db[_0x253e('0x73')],'as':_0x253e('0x74'),'attributes':['id',_0x253e('0x38'),_0x253e('0x75'),'voicePause',_0x253e('0x76')],'raw':!![]}]})[_0x253e('0x32')](function(_0x30444e){if(_0x30444e){var _0x222ef3=_[_0x253e('0x77')](_0x30444e,function(_0x445991){var _0x37268e=_0x445991[_0x253e('0x33')]({'plain':!![]});return _0x37268e[_0x253e('0x74')];});return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x5b7b91[_0x253e('0x54')]['id']}})[_0x253e('0x32')](function(_0x2d69c4){return db[_0x253e('0x78')][_0x253e('0x79')](function(_0xeeb266){return _0x2d69c4[_0x253e('0x71')](_0x4ea8a6,{'transaction':_0xeeb266})['then'](function(){return BPromise[_0x253e('0x7a')](_0x222ef3,function(_0x37dbd1){return db[_0x253e('0x64')][_0x253e('0x7b')]({'where':{'UserId':_0x37dbd1['id'],'ChatQueueId':_0x5b7b91[_0x253e('0x54')]['id']},'transaction':_0xeeb266});});})[_0x253e('0x32')](function(){_0x222ef3[_0x253e('0x7c')](function(_0x144537){socket[_0x253e('0x7d')]('userChatQueue:save',{'UserId':_0x144537['id'],'ChatQueueId':_0x2d69c4['id']});});});});});}})[_0x253e('0x32')](respondWithStatusCode(_0x1b204c,null))['catch'](handleError(_0x1b204c,null));};exports['removeTeams']=function(_0x114b5f,_0x5e953c,_0x3aaad5){return db[_0x253e('0x6f')][_0x253e('0x51')]({'where':{'id':_0x114b5f[_0x253e('0x3f')][_0x253e('0x72')]},'attributes':['id'],'include':[{'model':db[_0x253e('0x73')],'as':_0x253e('0x74'),'attributes':['id'],'raw':!![]}]})[_0x253e('0x32')](handleEntityNotFound(_0x5e953c,null))[_0x253e('0x32')](function(_0x2b1c0d){var _0x359cea=_[_0x253e('0x3b')](_0x2b1c0d,'id');var _0x25bbad=[];var _0x3a6bb6=[];var _0xb384b0=squel[_0x253e('0x7e')]();_0xb384b0[_0x253e('0x7f')](_0x253e('0x80'))[_0x253e('0x81')](_0x253e('0x82'),'tq')[_0x253e('0x83')]('user_has_teams','ut',_0x253e('0x84'))[_0x253e('0x4b')](_0x253e('0x85'),_0x114b5f[_0x253e('0x54')]['id']);for(var _0x322333=0x0;_0x322333<_0x2b1c0d['length'];_0x322333+=0x1){let _0x55f9f7=_0x2b1c0d[_0x322333];for(var _0x1977c9=0x0;_0x1977c9<_0x55f9f7['Agents']['length'];_0x1977c9+=0x1){let _0x437f94=_0x55f9f7[_0x253e('0x74')][_0x1977c9];var _0x2cb1eb=_0xb384b0[_0x253e('0x86')]();_0x2cb1eb[_0x253e('0x4b')](_0x253e('0x87'),_0x437f94['id']);_0x3a6bb6['push'](db[_0x253e('0x78')][_0x253e('0x3f')](_0x2cb1eb['toString'](),{'type':db[_0x253e('0x78')]['QueryTypes'][_0x253e('0x88')]})[_0x253e('0x32')](function(_0x17b87b){if(_0x17b87b['length']===0x1){return _0x437f94['id'];}else{var _0x138f82=_[_0x253e('0x89')](_['map'](_0x17b87b,_0x253e('0x8a')),function(_0x13cc87){return _[_0x253e('0x8b')](_0x359cea,_0x13cc87);});if(_0x138f82){return _0x437f94['id'];}}}));}}return BPromise[_0x253e('0x8c')](_0x3a6bb6)[_0x253e('0x32')](function(_0x4a4974){_0x25bbad=_(_0x25bbad)[_0x253e('0x8d')](_0x4a4974)[_0x253e('0x8e')]()[_0x253e('0x8f')]();return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x114b5f[_0x253e('0x54')]['id']}})[_0x253e('0x32')](function(_0x1626df){return db[_0x253e('0x78')][_0x253e('0x79')](function(_0x3f7f63){return _0x1626df[_0x253e('0x90')](_0x114b5f['query'][_0x253e('0x72')],{'transaction':_0x3f7f63})['then'](function(){if(!_['isEmpty'](_0x25bbad)){return _0x1626df[_0x253e('0x91')](_0x25bbad,{'transaction':_0x3f7f63});}})[_0x253e('0x32')](function(){_0x25bbad[_0x253e('0x7c')](function(_0x1140ed){socket[_0x253e('0x7d')]('userChatQueue:remove',{'UserId':_0x1140ed,'ChatQueueId':_0x1626df['id']});});});});});});})[_0x253e('0x32')](respondWithStatusCode(_0x5e953c,null))[_0x253e('0x24')](handleError(_0x5e953c,null));};exports['addAgents']=function(_0x4990c7,_0xb70d9d,_0x5a2970){return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x4990c7[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0xb70d9d,null))[_0x253e('0x32')](function(_0x59f1db){if(_0x59f1db){return _0x59f1db[_0x253e('0x92')](_0x4990c7['body']['ids'],_[_0x253e('0x93')](_0x4990c7[_0x253e('0x59')],[_0x253e('0x72'),'id'])||{})['spread'](function(_0x2716f8){for(var _0x58ecbc=0x0;_0x58ecbc<_0x4990c7[_0x253e('0x59')][_0x253e('0x72')][_0x253e('0x56')];_0x58ecbc+=0x1){socket[_0x253e('0x7d')]('userChatQueue:save',{'UserId':Number(_0x4990c7['body'][_0x253e('0x72')][_0x58ecbc]),'ChatQueueId':Number(_0x4990c7['params']['id'])});}return _0x2716f8;});}})[_0x253e('0x32')](respondWithResult(_0xb70d9d,null))[_0x253e('0x24')](handleError(_0xb70d9d,null));};exports['removeAgents']=function(_0x1be931,_0x27b666,_0x25a9d6){return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x1be931['params']['id']}})['then'](handleEntityNotFound(_0x27b666,null))[_0x253e('0x32')](function(_0x11e46d){if(_0x11e46d){return _0x11e46d[_0x253e('0x91')](_0x1be931[_0x253e('0x3f')][_0x253e('0x72')])[_0x253e('0x32')](function(){if(_[_0x253e('0x94')](_0x1be931['query'][_0x253e('0x72')])){for(var _0x239eb9=0x0;_0x239eb9<_0x1be931['query'][_0x253e('0x72')][_0x253e('0x56')];_0x239eb9+=0x1){socket[_0x253e('0x7d')](_0x253e('0x95'),{'UserId':Number(_0x1be931[_0x253e('0x3f')]['ids'][_0x239eb9]),'ChatQueueId':Number(_0x1be931[_0x253e('0x54')]['id'])});}}else{socket[_0x253e('0x7d')](_0x253e('0x95'),{'UserId':Number(_0x1be931[_0x253e('0x3f')][_0x253e('0x72')]),'ChatQueueId':Number(_0x1be931[_0x253e('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x27b666,null))['catch'](handleError(_0x27b666,null));};exports[_0x253e('0x96')]=function(_0x4e5b47,_0xdceffe,_0x1c76f5){var _0x18e5e3={};var _0x5b7e52={};var _0x39af81;var _0x180b4f;return db[_0x253e('0x3c')][_0x253e('0x63')]({'where':{'id':_0x4e5b47[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0xdceffe,null))['then'](function(_0x489c3e){if(_0x489c3e){_0x39af81=_0x489c3e;_0x5b7e52[_0x253e('0x42')]=_[_0x253e('0x55')](db[_0x253e('0x73')][_0x253e('0x3d')]);_0x5b7e52[_0x253e('0x3f')]=_[_0x253e('0x55')](_0x4e5b47['query']);_0x5b7e52['filters']=_[_0x253e('0x41')](_0x5b7e52[_0x253e('0x42')],_0x5b7e52[_0x253e('0x3f')]);_0x18e5e3[_0x253e('0x43')]=_['intersection'](_0x5b7e52[_0x253e('0x42')],qs[_0x253e('0x44')](_0x4e5b47[_0x253e('0x3f')][_0x253e('0x44')]));_0x18e5e3[_0x253e('0x43')]=_0x18e5e3['attributes'][_0x253e('0x56')]?_0x18e5e3[_0x253e('0x43')]:_0x5b7e52[_0x253e('0x42')];_0x18e5e3[_0x253e('0x47')]=qs[_0x253e('0x48')](_0x4e5b47['query']['sort']);_0x18e5e3[_0x253e('0x4b')]=qs[_0x253e('0x40')](_[_0x253e('0x49')](_0x4e5b47[_0x253e('0x3f')],_0x5b7e52['filters']));if(_0x4e5b47[_0x253e('0x3f')]['filter']){_0x18e5e3['where']=_[_0x253e('0x4c')](_0x18e5e3[_0x253e('0x4b')],{'$or':_['map'](_0x18e5e3['attributes'],function(_0x1205ff){var _0x2bda63={};_0x2bda63[_0x1205ff]={'$like':'%'+_0x4e5b47[_0x253e('0x3f')][_0x253e('0x4a')]+'%'};return _0x2bda63;})});}_0x18e5e3=_[_0x253e('0x4c')]({},_0x18e5e3,_0x4e5b47['options']);return _0x39af81[_0x253e('0x96')](_0x18e5e3);}})['then'](function(_0x161409){if(_0x161409){_0x180b4f=_0x161409['length'];if(!_0x4e5b47['query'][_0x253e('0x45')](_0x253e('0x46'))){_0x18e5e3[_0x253e('0x2b')]=qs[_0x253e('0x2b')](_0x4e5b47[_0x253e('0x3f')][_0x253e('0x2b')]);_0x18e5e3['offset']=qs[_0x253e('0x29')](_0x4e5b47[_0x253e('0x3f')][_0x253e('0x29')]);}return _0x39af81[_0x253e('0x96')](_0x18e5e3);}})[_0x253e('0x32')](function(_0x4a2607){if(_0x4a2607){return _0x4a2607?{'count':_0x180b4f,'rows':_0x4a2607}:null;}})[_0x253e('0x32')](respondWithResult(_0xdceffe,null))['catch'](handleError(_0xdceffe,null));};
\ No newline at end of file
index bf8a345..422df98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa265=['ChatQueue','setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xa265,0xe6));var _0x5a26=function(_0x1b4267,_0x2cc34c){_0x1b4267=_0x1b4267-0x0;var _0x571338=_0xa265[_0x1b4267];return _0x571338;};'use strict';var EventEmitter=require(_0x5a26('0x0'));var ChatQueue=require(_0x5a26('0x1'))['db'][_0x5a26('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5a26('0x3')](0x0);var events={'afterCreate':_0x5a26('0x4'),'afterUpdate':_0x5a26('0x5'),'afterDestroy':'remove'};function emitEvent(_0x590c6d){return function(_0x520135,_0x576f31,_0x24e554){ChatQueueEvents[_0x5a26('0x6')](_0x590c6d+':'+_0x520135['id'],_0x520135);ChatQueueEvents['emit'](_0x590c6d,_0x520135);_0x24e554(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x5a26('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x7707=['events','../../mysqldb','ChatQueue','setMaxListeners','save','emit','hasOwnProperty','exports'];(function(_0x29a171,_0x155cd2){var _0xd5c076=function(_0x195e11){while(--_0x195e11){_0x29a171['push'](_0x29a171['shift']());}};_0xd5c076(++_0x155cd2);}(_0x7707,0x158));var _0x7770=function(_0x232caf,_0x358822){_0x232caf=_0x232caf-0x0;var _0x4a5781=_0x7707[_0x232caf];return _0x4a5781;};'use strict';var EventEmitter=require(_0x7770('0x0'));var ChatQueue=require(_0x7770('0x1'))['db'][_0x7770('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7770('0x3')](0x0);var events={'afterCreate':_0x7770('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2dfe26){return function(_0x4f1e9e,_0x5c2a01,_0x50d79e){ChatQueueEvents[_0x7770('0x5')](_0x2dfe26+':'+_0x4f1e9e['id'],_0x4f1e9e);ChatQueueEvents[_0x7770('0x5')](_0x2dfe26,_0x4f1e9e);_0x50d79e(null);};}for(var e in events){if(events[_0x7770('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x7770('0x7')]=ChatQueueEvents;
\ No newline at end of file
index 3920a14..49db4a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78db=['./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x78db,0xac));var _0xb78d=function(_0x29c7ed,_0x389f4b){_0x29c7ed=_0x29c7ed-0x0;var _0x22b24d=_0x78db[_0x29c7ed];return _0x22b24d;};'use strict';var _=require(_0xb78d('0x0'));var util=require(_0xb78d('0x1'));var logger=require('../../config/logger')(_0xb78d('0x2'));var moment=require(_0xb78d('0x3'));var BPromise=require(_0xb78d('0x4'));var rp=require(_0xb78d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb78d('0x6'));var config=require(_0xb78d('0x7'));var attributes=require(_0xb78d('0x8'));module['exports']=function(_0x37fbfe,_0x2766b9){return _0x37fbfe[_0xb78d('0x9')](_0xb78d('0xa'),attributes,{'tableName':_0xb78d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d62=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x217850,_0x251846){var _0x3026c6=function(_0x5e6a36){while(--_0x5e6a36){_0x217850['push'](_0x217850['shift']());}};_0x3026c6(++_0x251846);}(_0x4d62,0x16e));var _0x24d6=function(_0x120a5b,_0x26a525){_0x120a5b=_0x120a5b-0x0;var _0x4f5ac9=_0x4d62[_0x120a5b];return _0x4f5ac9;};'use strict';var _=require(_0x24d6('0x0'));var util=require(_0x24d6('0x1'));var logger=require(_0x24d6('0x2'))(_0x24d6('0x3'));var moment=require(_0x24d6('0x4'));var BPromise=require(_0x24d6('0x5'));var rp=require(_0x24d6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24d6('0x7'));var config=require(_0x24d6('0x8'));var attributes=require(_0x24d6('0x9'));module[_0x24d6('0xa')]=function(_0xe7ec69,_0x5f0daf){return _0xe7ec69[_0x24d6('0xb')](_0x24d6('0xc'),attributes,{'tableName':_0x24d6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 60aa4bf..c7e0670 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0993=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetChatQueue','findAll','options','raw','attributes','limit','include','ShowChatQueue','find','where','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request'];(function(_0x9c9398,_0x4d0953){var _0x46ca59=function(_0x5af166){while(--_0x5af166){_0x9c9398['push'](_0x9c9398['shift']());}};_0x46ca59(++_0x4d0953);}(_0x0993,0x81));var _0x3099=function(_0x134e6f,_0x58c616){_0x134e6f=_0x134e6f-0x0;var _0x519a52=_0x0993[_0x134e6f];return _0x519a52;};'use strict';var _=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var moment=require(_0x3099('0x2'));var BPromise=require(_0x3099('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3099('0x4'));var db=require(_0x3099('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3099('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3099('0x7'));var client=jayson[_0x3099('0x8')][_0x3099('0x9')]({'port':0x232a});config[_0x3099('0xa')]=_[_0x3099('0xb')](config[_0x3099('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3099('0xc'))(new Redis(config[_0x3099('0xa')]));require(_0x3099('0xd'))['register'](socket);function respondWithRpcPromise(_0x42541f,_0x1851ac,_0x119a10){return new BPromise(function(_0x19e29f,_0x151257){return client[_0x3099('0xe')](_0x42541f,_0x119a10)[_0x3099('0xf')](function(_0xd89d1f){logger[_0x3099('0x10')](_0x3099('0x11'),_0x1851ac,_0x3099('0x12'));logger[_0x3099('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1851ac,_0x3099('0x12'),JSON[_0x3099('0x14')](_0xd89d1f));if(_0xd89d1f[_0x3099('0x15')]){if(_0xd89d1f[_0x3099('0x15')]['code']===0x1f4){logger[_0x3099('0x15')](_0x3099('0x11'),_0x1851ac,_0xd89d1f[_0x3099('0x15')][_0x3099('0x16')]);return _0x151257(_0xd89d1f[_0x3099('0x15')][_0x3099('0x16')]);}logger['error'](_0x3099('0x11'),_0x1851ac,_0xd89d1f['error'][_0x3099('0x16')]);return _0x19e29f(_0xd89d1f['error']['message']);}else{logger[_0x3099('0x10')]('ChatQueue,\x20%s,\x20%s',_0x1851ac,_0x3099('0x12'));_0x19e29f(_0xd89d1f['result'][_0x3099('0x16')]);}})[_0x3099('0x17')](function(_0xb44433){logger[_0x3099('0x15')](_0x3099('0x11'),_0x1851ac,_0xb44433);_0x151257(_0xb44433);});});}exports[_0x3099('0x18')]=function(_0x2632bd){var _0xeddbf=this;return new Promise(function(_0x5a2150,_0x2224a5){return db['ChatQueue'][_0x3099('0x19')]({'raw':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')][_0x3099('0x1b')]===undefined?!![]:![]:!![],'where':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')]['where']||null:null,'attributes':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')][_0x3099('0x1c')]||null:null,'limit':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')][_0x3099('0x1d')]||null:null,'include':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')][_0x3099('0x1e')]?_['map'](_0x2632bd['options']['include'],function(_0x1b5c53){return{'model':db[_0x1b5c53['model']],'as':_0x1b5c53['as'],'attributes':_0x1b5c53['attributes'],'include':_0x1b5c53[_0x3099('0x1e')]?_['map'](_0x1b5c53[_0x3099('0x1e')],function(_0x4154b8){return{'model':db[_0x4154b8['model']],'as':_0x4154b8['as'],'attributes':_0x4154b8[_0x3099('0x1c')],'include':_0x4154b8[_0x3099('0x1e')]?_['map'](_0x4154b8[_0x3099('0x1e')],function(_0x4f3678){return{'model':db[_0x4f3678['model']],'as':_0x4f3678['as'],'attributes':_0x4f3678[_0x3099('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3099('0xf')](function(_0x1d77ed){logger[_0x3099('0x10')]('GetChatQueue',_0x2632bd);logger[_0x3099('0x13')](_0x3099('0x18'),_0x2632bd,JSON[_0x3099('0x14')](_0x1d77ed));_0x5a2150(_0x1d77ed);})[_0x3099('0x17')](function(_0x5a8912){logger[_0x3099('0x15')]('GetChatQueue',_0x5a8912[_0x3099('0x16')],_0x2632bd);_0x2224a5(_0xeddbf[_0x3099('0x15')](0x1f4,_0x5a8912[_0x3099('0x16')]));});});};exports[_0x3099('0x1f')]=function(_0x4c98c5){var _0x2786ac=this;return new Promise(function(_0x4d6563,_0x44e36e){return db['ChatQueue'][_0x3099('0x20')]({'raw':_0x4c98c5[_0x3099('0x1a')]?_0x4c98c5[_0x3099('0x1a')][_0x3099('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c98c5['options']?_0x4c98c5[_0x3099('0x1a')][_0x3099('0x21')]||null:null,'attributes':_0x4c98c5[_0x3099('0x1a')]?_0x4c98c5[_0x3099('0x1a')][_0x3099('0x1c')]||null:null,'include':_0x4c98c5[_0x3099('0x1a')]?_0x4c98c5[_0x3099('0x1a')][_0x3099('0x1e')]?_[_0x3099('0x22')](_0x4c98c5[_0x3099('0x1a')][_0x3099('0x1e')],function(_0x522284){return{'model':db[_0x522284[_0x3099('0x23')]],'as':_0x522284['as'],'attributes':_0x522284['attributes'],'include':_0x522284[_0x3099('0x1e')]?_[_0x3099('0x22')](_0x522284[_0x3099('0x1e')],function(_0x1dd4f1){return{'model':db[_0x1dd4f1[_0x3099('0x23')]],'as':_0x1dd4f1['as'],'attributes':_0x1dd4f1[_0x3099('0x1c')],'include':_0x1dd4f1[_0x3099('0x1e')]?_[_0x3099('0x22')](_0x1dd4f1['include'],function(_0x29594d){return{'model':db[_0x29594d[_0x3099('0x23')]],'as':_0x29594d['as'],'attributes':_0x29594d[_0x3099('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33f270){logger[_0x3099('0x10')](_0x3099('0x1f'),_0x4c98c5);logger[_0x3099('0x13')](_0x3099('0x1f'),_0x4c98c5,JSON['stringify'](_0x33f270));_0x4d6563(_0x33f270);})['catch'](function(_0x3035be){logger[_0x3099('0x15')]('ShowChatQueue',_0x3035be['message'],_0x4c98c5);_0x44e36e(_0x2786ac[_0x3099('0x15')](0x1f4,_0x3035be['message']));});});};
\ No newline at end of file
+var _0x7334=['defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','ChatQueue','find','ShowChatQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4069c6,_0x4ee231){var _0xc37519=function(_0x1d3bc2){while(--_0x1d3bc2){_0x4069c6['push'](_0x4069c6['shift']());}};_0xc37519(++_0x4ee231);}(_0x7334,0x184));var _0x4733=function(_0x5135ad,_0x35e57c){_0x5135ad=_0x5135ad-0x0;var _0x17261e=_0x7334[_0x5135ad];return _0x17261e;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});config[_0x4733('0xb')]=_[_0x4733('0xc')](config[_0x4733('0xb')],{'host':_0x4733('0xd'),'port':0x18eb});var socket=require(_0x4733('0xe'))(new Redis(config[_0x4733('0xb')]));require(_0x4733('0xf'))[_0x4733('0x10')](socket);function respondWithRpcPromise(_0x1bc511,_0x2bafad,_0x49032d){return new BPromise(function(_0x42b97f,_0x1e6fcf){return client['request'](_0x1bc511,_0x49032d)[_0x4733('0x11')](function(_0x5240a4){logger[_0x4733('0x12')](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));logger[_0x4733('0x15')](_0x4733('0x16'),_0x2bafad,_0x4733('0x14'),JSON[_0x4733('0x17')](_0x5240a4));if(_0x5240a4['error']){if(_0x5240a4[_0x4733('0x18')]['code']===0x1f4){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);return _0x1e6fcf(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')]['message']);return _0x42b97f(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}else{logger['info'](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));_0x42b97f(_0x5240a4[_0x4733('0x1a')][_0x4733('0x19')]);}})['catch'](function(_0x517fbc){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x517fbc);_0x1e6fcf(_0x517fbc);});});}exports['GetChatQueue']=function(_0x32f166){var _0x1943bc=this;return new Promise(function(_0x15339c,_0x7a4e0){return db['ChatQueue'][_0x4733('0x1b')]({'raw':_0x32f166[_0x4733('0x1c')]?_0x32f166['options'][_0x4733('0x1d')]===undefined?!![]:![]:!![],'where':_0x32f166[_0x4733('0x1c')]?_0x32f166['options'][_0x4733('0x1e')]||null:null,'attributes':_0x32f166[_0x4733('0x1c')]?_0x32f166[_0x4733('0x1c')][_0x4733('0x1f')]||null:null,'limit':_0x32f166[_0x4733('0x1c')]?_0x32f166[_0x4733('0x1c')][_0x4733('0x20')]||null:null,'include':_0x32f166[_0x4733('0x1c')]?_0x32f166['options'][_0x4733('0x21')]?_[_0x4733('0x22')](_0x32f166[_0x4733('0x1c')][_0x4733('0x21')],function(_0x30ee9b){return{'model':db[_0x30ee9b[_0x4733('0x23')]],'as':_0x30ee9b['as'],'attributes':_0x30ee9b[_0x4733('0x1f')],'include':_0x30ee9b[_0x4733('0x21')]?_[_0x4733('0x22')](_0x30ee9b[_0x4733('0x21')],function(_0x521855){return{'model':db[_0x521855[_0x4733('0x23')]],'as':_0x521855['as'],'attributes':_0x521855['attributes'],'include':_0x521855['include']?_[_0x4733('0x22')](_0x521855['include'],function(_0xcde4f4){return{'model':db[_0xcde4f4['model']],'as':_0xcde4f4['as'],'attributes':_0xcde4f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2976b0){logger[_0x4733('0x12')](_0x4733('0x24'),_0x32f166);logger[_0x4733('0x15')]('GetChatQueue',_0x32f166,JSON['stringify'](_0x2976b0));_0x15339c(_0x2976b0);})['catch'](function(_0x2b2757){logger['error']('GetChatQueue',_0x2b2757[_0x4733('0x19')],_0x32f166);_0x7a4e0(_0x1943bc[_0x4733('0x18')](0x1f4,_0x2b2757[_0x4733('0x19')]));});});};exports['ShowChatQueue']=function(_0x523c61){var _0x4412f7=this;return new Promise(function(_0x3a4307,_0x22d38a){return db[_0x4733('0x25')][_0x4733('0x26')]({'raw':_0x523c61['options']?_0x523c61[_0x4733('0x1c')][_0x4733('0x1d')]===undefined?!![]:![]:!![],'where':_0x523c61[_0x4733('0x1c')]?_0x523c61[_0x4733('0x1c')][_0x4733('0x1e')]||null:null,'attributes':_0x523c61['options']?_0x523c61['options'][_0x4733('0x1f')]||null:null,'include':_0x523c61[_0x4733('0x1c')]?_0x523c61[_0x4733('0x1c')][_0x4733('0x21')]?_[_0x4733('0x22')](_0x523c61['options'][_0x4733('0x21')],function(_0x4855a8){return{'model':db[_0x4855a8[_0x4733('0x23')]],'as':_0x4855a8['as'],'attributes':_0x4855a8['attributes'],'include':_0x4855a8[_0x4733('0x21')]?_[_0x4733('0x22')](_0x4855a8[_0x4733('0x21')],function(_0x2ec052){return{'model':db[_0x2ec052[_0x4733('0x23')]],'as':_0x2ec052['as'],'attributes':_0x2ec052[_0x4733('0x1f')],'include':_0x2ec052[_0x4733('0x21')]?_[_0x4733('0x22')](_0x2ec052['include'],function(_0x174889){return{'model':db[_0x174889['model']],'as':_0x174889['as'],'attributes':_0x174889[_0x4733('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4733('0x11')](function(_0x381fa8){logger[_0x4733('0x12')](_0x4733('0x27'),_0x523c61);logger[_0x4733('0x15')](_0x4733('0x27'),_0x523c61,JSON[_0x4733('0x17')](_0x381fa8));_0x3a4307(_0x381fa8);})['catch'](function(_0x35a10b){logger[_0x4733('0x18')]('ShowChatQueue',_0x35a10b[_0x4733('0x19')],_0x523c61);_0x22d38a(_0x4412f7[_0x4733('0x18')](0x1f4,_0x35a10b['message']));});});};
\ No newline at end of file
index 5cce3d9..dc5864d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['remove','update','emit','register','length','./chatQueue.events'];(function(_0x44b2fb,_0x529ca7){var _0x424ed6=function(_0x5baddd){while(--_0x5baddd){_0x44b2fb['push'](_0x44b2fb['shift']());}};_0x424ed6(++_0x529ca7);}(_0xdace,0xc5));var _0xedac=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xdace[_0x487b0c];return _0x1adbdc;};'use strict';var ChatQueueEvents=require(_0xedac('0x0'));var events=['save',_0xedac('0x1'),_0xedac('0x2')];function createListener(_0x46eba0,_0x518516){return function(_0x413d77){_0x518516[_0xedac('0x3')](_0x46eba0,_0x413d77);};}function removeListener(_0x15d3bd,_0xefb142){return function(){ChatQueueEvents['removeListener'](_0x15d3bd,_0xefb142);};}exports[_0xedac('0x4')]=function(_0x1cba89){for(var _0x39328a=0x0,_0x5ecbd3=events[_0xedac('0x5')];_0x39328a<_0x5ecbd3;_0x39328a++){var _0x21440e=events[_0x39328a];var _0x162eea=createListener('chatQueue:'+_0x21440e,_0x1cba89);ChatQueueEvents['on'](_0x21440e,_0x162eea);}};
\ No newline at end of file
+var _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x20e485,_0x8b0481){var _0xebd551=function(_0x3225c4){while(--_0x3225c4){_0x20e485['push'](_0x20e485['shift']());}};_0xebd551(++_0x8b0481);}(_0xec56,0x1bd));var _0x6ec5=function(_0x2851b0,_0x26ad57){_0x2851b0=_0x2851b0-0x0;var _0x2123a2=_0xec56[_0x2851b0];return _0x2123a2;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}};
\ No newline at end of file
index 907f9f8..344d953 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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e74,0x175));var _0x43e7=function(_0x403fb9,_0x3d4a20){_0x403fb9=_0x403fb9-0x0;var _0x2e74ed=_0x3e74[_0x403fb9];return _0x2e74ed;};'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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x5fc3[_0x5c5c52];return _0x4229ff;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
index 702ab5e..640e3a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf15=['exports','STRING','DATE','moment','sequelize'];(function(_0x59ac27,_0x202e0e){var _0x4ed9b3=function(_0x48364d){while(--_0x48364d){_0x59ac27['push'](_0x59ac27['shift']());}};_0x4ed9b3(++_0x202e0e);}(_0xcf15,0xe4));var _0x5cf1=function(_0x152e29,_0x7d25c7){_0x152e29=_0x152e29-0x0;var _0x26a678=_0xcf15[_0x152e29];return _0x26a678;};'use strict';var moment=require(_0x5cf1('0x0'));var Sequelize=require(_0x5cf1('0x1'));module[_0x5cf1('0x2')]={'uniqueid':{'type':Sequelize[_0x5cf1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5cf1('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5cf1('0x4')]},'acceptAt':{'type':Sequelize[_0x5cf1('0x4')]},'exitAt':{'type':Sequelize[_0x5cf1('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x07b6=['DATE','moment','exports','STRING'];(function(_0x4e9a22,_0x65e645){var _0x364420=function(_0x4ecb09){while(--_0x4ecb09){_0x4e9a22['push'](_0x4e9a22['shift']());}};_0x364420(++_0x65e645);}(_0x07b6,0xb5));var _0x607b=function(_0x5cd395,_0x507285){_0x5cd395=_0x5cd395-0x0;var _0x141227=_0x07b6[_0x5cd395];return _0x141227;};'use strict';var moment=require(_0x607b('0x0'));var Sequelize=require('sequelize');module[_0x607b('0x1')]={'uniqueid':{'type':Sequelize[_0x607b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x607b('0x2')]},'joinAt':{'type':Sequelize[_0x607b('0x3')]},'leaveAt':{'type':Sequelize[_0x607b('0x3')]},'acceptAt':{'type':Sequelize[_0x607b('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x607b('0x2')]}};
\ No newline at end of file
index 7eaa968..1265ad3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bc1=['filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','keys','intersection','include','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query'];(function(_0xb76c9e,_0xc27ba8){var _0x21c151=function(_0x1c7f10){while(--_0x1c7f10){_0xb76c9e['push'](_0xb76c9e['shift']());}};_0x21c151(++_0xc27ba8);}(_0x5bc1,0xb5));var _0x15bc=function(_0x17b287,_0x4bed1c){_0x17b287=_0x17b287-0x0;var _0x177054=_0x5bc1[_0x17b287];return _0x177054;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15bc('0x0'));var zipdir=require(_0x15bc('0x1'));var jsonpatch=require(_0x15bc('0x2'));var rp=require(_0x15bc('0x3'));var moment=require(_0x15bc('0x4'));var BPromise=require(_0x15bc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x15bc('0x6'));var sox=require(_0x15bc('0x7'));var csv=require(_0x15bc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15bc('0x9'));var _=require('lodash');var squel=require(_0x15bc('0xa'));var crypto=require(_0x15bc('0xb'));var jsforce=require(_0x15bc('0xc'));var deskjs=require(_0x15bc('0xd'));var toCsv=require(_0x15bc('0x8'));var querystring=require(_0x15bc('0xe'));var Papa=require(_0x15bc('0xf'));var Redis=require(_0x15bc('0x10'));var authService=require(_0x15bc('0x11'));var qs=require(_0x15bc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15bc('0x13'));var logger=require(_0x15bc('0x14'))(_0x15bc('0x15'));var utils=require('../../config/utils');var config=require(_0x15bc('0x16'));var licenseUtil=require(_0x15bc('0x17'));var db=require(_0x15bc('0x18'))['db'];function respondWithStatusCode(_0xba239f,_0x561881){_0x561881=_0x561881||0xcc;return function(_0x287ee){if(_0x287ee){return _0xba239f[_0x15bc('0x19')](_0x561881);}return _0xba239f[_0x15bc('0x1a')](_0x561881)[_0x15bc('0x1b')]();};}function respondWithResult(_0x3cfbe6,_0x3f546b){_0x3f546b=_0x3f546b||0xc8;return function(_0x5383f1){if(_0x5383f1){return _0x3cfbe6[_0x15bc('0x1a')](_0x3f546b)[_0x15bc('0x1c')](_0x5383f1);}};}function respondWithFilteredResult(_0x39bfa5,_0x41484d){return function(_0x44b25f){if(_0x44b25f){var _0x947132=typeof _0x41484d[_0x15bc('0x1d')]==='undefined'&&typeof _0x41484d[_0x15bc('0x1e')]===_0x15bc('0x1f');var _0x427212=_0x44b25f[_0x15bc('0x20')];var _0x1deadc=_0x947132?0x0:_0x41484d[_0x15bc('0x1d')];var _0x395438=_0x947132?_0x44b25f[_0x15bc('0x20')]:_0x41484d[_0x15bc('0x1d')]+_0x41484d[_0x15bc('0x1e')];var _0x1b3741;if(_0x395438>=_0x427212){_0x395438=_0x427212;_0x1b3741=0xc8;}else{_0x1b3741=0xce;}_0x39bfa5['status'](_0x1b3741);return _0x39bfa5[_0x15bc('0x21')]('Content-Range',_0x1deadc+'-'+_0x395438+'/'+_0x427212)[_0x15bc('0x1c')](_0x44b25f);}return null;};}function patchUpdates(_0x5b2144){return function(_0x1b7b09){try{jsonpatch[_0x15bc('0x22')](_0x1b7b09,_0x5b2144,!![]);}catch(_0x26b16b){return BPromise['reject'](_0x26b16b);}return _0x1b7b09[_0x15bc('0x23')]();};}function saveUpdates(_0x57f384,_0x31ed06){return function(_0x2bebcc){if(_0x2bebcc){return _0x2bebcc[_0x15bc('0x24')](_0x57f384)[_0x15bc('0x25')](function(_0x2715d1){return _0x2715d1;});}return null;};}function removeEntity(_0x894d1f,_0x1a51e1){return function(_0x424020){if(_0x424020){return _0x424020['destroy']()[_0x15bc('0x25')](function(){_0x894d1f[_0x15bc('0x1a')](0xcc)[_0x15bc('0x1b')]();});}};}function handleEntityNotFound(_0xbacc26,_0x4b505b){return function(_0x3d1dc7){if(!_0x3d1dc7){_0xbacc26[_0x15bc('0x19')](0x194);}return _0x3d1dc7;};}function handleError(_0x1f82df,_0x1c91b7){_0x1c91b7=_0x1c91b7||0x1f4;return function(_0x4d0608){logger['error'](_0x4d0608[_0x15bc('0x26')]);if(_0x4d0608['name']){delete _0x4d0608[_0x15bc('0x27')];}_0x1f82df[_0x15bc('0x1a')](_0x1c91b7)[_0x15bc('0x28')](_0x4d0608);};}exports[_0x15bc('0x29')]=function(_0x21927c,_0x85fc9e){var _0x172529={},_0x1fcfa6={},_0x5895ca={'count':0x0,'rows':[]};var _0x4146ab=_[_0x15bc('0x2a')](db[_0x15bc('0x2b')][_0x15bc('0x2c')],function(_0x244d12){return{'name':_0x244d12[_0x15bc('0x2d')],'type':_0x244d12[_0x15bc('0x2e')][_0x15bc('0x2f')]};});_0x1fcfa6[_0x15bc('0x30')]=_[_0x15bc('0x2a')](_0x4146ab,'name');_0x1fcfa6[_0x15bc('0x31')]=_['keys'](_0x21927c[_0x15bc('0x31')]);_0x1fcfa6[_0x15bc('0x32')]=_['intersection'](_0x1fcfa6['model'],_0x1fcfa6[_0x15bc('0x31')]);_0x172529[_0x15bc('0x33')]=_['intersection'](_0x1fcfa6['model'],qs[_0x15bc('0x34')](_0x21927c[_0x15bc('0x31')][_0x15bc('0x34')]));_0x172529[_0x15bc('0x33')]=_0x172529['attributes'][_0x15bc('0x35')]?_0x172529[_0x15bc('0x33')]:_0x1fcfa6['model'];if(!_0x21927c[_0x15bc('0x31')][_0x15bc('0x36')](_0x15bc('0x37'))){_0x172529[_0x15bc('0x1e')]=qs[_0x15bc('0x1e')](_0x21927c[_0x15bc('0x31')][_0x15bc('0x1e')]);_0x172529[_0x15bc('0x1d')]=qs['offset'](_0x21927c[_0x15bc('0x31')][_0x15bc('0x1d')]);}_0x172529[_0x15bc('0x38')]=qs[_0x15bc('0x39')](_0x21927c['query']['sort']);_0x172529[_0x15bc('0x3a')]=qs['filters'](_[_0x15bc('0x3b')](_0x21927c[_0x15bc('0x31')],_0x1fcfa6[_0x15bc('0x32')]),_0x4146ab);if(_0x21927c[_0x15bc('0x31')]['filter']){_0x172529[_0x15bc('0x3a')]=_[_0x15bc('0x3c')](_0x172529[_0x15bc('0x3a')],{'$or':_[_0x15bc('0x2a')](_0x4146ab,function(_0x3f0028){if(_0x3f0028[_0x15bc('0x2e')]!==_0x15bc('0x3d')){var _0x5aa74d={};_0x5aa74d[_0x3f0028['name']]={'$like':'%'+_0x21927c['query'][_0x15bc('0x3e')]+'%'};return _0x5aa74d;}})});}_0x172529=_['merge']({},_0x172529,_0x21927c[_0x15bc('0x3f')]);var _0x51a458={'where':_0x172529[_0x15bc('0x3a')]};return db['ChatQueueReport'][_0x15bc('0x20')](_0x51a458)['then'](function(_0x2a87ea){_0x5895ca[_0x15bc('0x20')]=_0x2a87ea;if(_0x21927c[_0x15bc('0x31')][_0x15bc('0x40')]){_0x172529['include']=[{'all':!![]}];}return db[_0x15bc('0x2b')][_0x15bc('0x41')](_0x172529);})[_0x15bc('0x25')](function(_0x4b1dbc){_0x5895ca[_0x15bc('0x42')]=_0x4b1dbc;return _0x5895ca;})[_0x15bc('0x25')](respondWithFilteredResult(_0x85fc9e,_0x172529))[_0x15bc('0x43')](handleError(_0x85fc9e,null));};exports['show']=function(_0x166915,_0x28c30c){var _0xef3e17={'raw':!![],'where':{'id':_0x166915['params']['id']}},_0x4d5f90={};_0x4d5f90[_0x15bc('0x30')]=_[_0x15bc('0x44')](db[_0x15bc('0x2b')][_0x15bc('0x2c')]);_0x4d5f90['query']=_[_0x15bc('0x44')](_0x166915[_0x15bc('0x31')]);_0x4d5f90[_0x15bc('0x32')]=_[_0x15bc('0x45')](_0x4d5f90[_0x15bc('0x30')],_0x4d5f90[_0x15bc('0x31')]);_0xef3e17[_0x15bc('0x33')]=_[_0x15bc('0x45')](_0x4d5f90[_0x15bc('0x30')],qs[_0x15bc('0x34')](_0x166915[_0x15bc('0x31')]['fields']));_0xef3e17[_0x15bc('0x33')]=_0xef3e17[_0x15bc('0x33')][_0x15bc('0x35')]?_0xef3e17[_0x15bc('0x33')]:_0x4d5f90[_0x15bc('0x30')];if(_0x166915['query'][_0x15bc('0x40')]){_0xef3e17[_0x15bc('0x46')]=[{'all':!![]}];}_0xef3e17=_[_0x15bc('0x3c')]({},_0xef3e17,_0x166915['options']);return db[_0x15bc('0x2b')][_0x15bc('0x47')](_0xef3e17)['then'](handleEntityNotFound(_0x28c30c,null))['then'](respondWithResult(_0x28c30c,null))[_0x15bc('0x43')](handleError(_0x28c30c,null));};exports[_0x15bc('0x48')]=function(_0x245bb2,_0x25a16f){return db[_0x15bc('0x2b')][_0x15bc('0x48')](_0x245bb2[_0x15bc('0x49')],{})[_0x15bc('0x25')](respondWithResult(_0x25a16f,0xc9))[_0x15bc('0x43')](handleError(_0x25a16f,null));};exports[_0x15bc('0x24')]=function(_0x385162,_0xc84d23){if(_0x385162['body']['id']){delete _0x385162[_0x15bc('0x49')]['id'];}return db[_0x15bc('0x2b')][_0x15bc('0x47')]({'where':{'id':_0x385162[_0x15bc('0x4a')]['id']}})[_0x15bc('0x25')](handleEntityNotFound(_0xc84d23,null))[_0x15bc('0x25')](saveUpdates(_0x385162[_0x15bc('0x49')],null))['then'](respondWithResult(_0xc84d23,null))[_0x15bc('0x43')](handleError(_0xc84d23,null));};exports[_0x15bc('0x4b')]=function(_0x45c2f8,_0x20d1ac){return db[_0x15bc('0x2b')][_0x15bc('0x47')]({'where':{'id':_0x45c2f8[_0x15bc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20d1ac,null))[_0x15bc('0x25')](removeEntity(_0x20d1ac,null))['catch'](handleError(_0x20d1ac,null));};exports[_0x15bc('0x4c')]=function(_0x3b58fa,_0x20907c){return db[_0x15bc('0x2b')][_0x15bc('0x4c')]()[_0x15bc('0x25')](respondWithResult(_0x20907c,null))[_0x15bc('0x43')](handleError(_0x20907c,null));};
\ No newline at end of file
+var _0xc1dc=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x1b5178,_0x370995){var _0xf77410=function(_0x36c72e){while(--_0x36c72e){_0x1b5178['push'](_0x1b5178['shift']());}};_0xf77410(++_0x370995);}(_0xc1dc,0x84));var _0xcc1d=function(_0x1cbad7,_0x4e989e){_0x1cbad7=_0x1cbad7-0x0;var _0x3d83fb=_0xc1dc[_0x1cbad7];return _0x3d83fb;};'use strict';var emlformat=require(_0xcc1d('0x0'));var rimraf=require(_0xcc1d('0x1'));var zipdir=require(_0xcc1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc1d('0x3'));var moment=require('moment');var BPromise=require(_0xcc1d('0x4'));var Mustache=require(_0xcc1d('0x5'));var util=require('util');var path=require(_0xcc1d('0x6'));var sox=require(_0xcc1d('0x7'));var csv=require(_0xcc1d('0x8'));var ejs=require(_0xcc1d('0x9'));var fs=require('fs');var fs_extra=require(_0xcc1d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc1d('0xb'));var jsforce=require(_0xcc1d('0xc'));var deskjs=require(_0xcc1d('0xd'));var toCsv=require(_0xcc1d('0x8'));var querystring=require(_0xcc1d('0xe'));var Papa=require(_0xcc1d('0xf'));var Redis=require('ioredis');var authService=require(_0xcc1d('0x10'));var qs=require(_0xcc1d('0x11'));var as=require(_0xcc1d('0x12'));var hardwareService=require(_0xcc1d('0x13'));var logger=require(_0xcc1d('0x14'))(_0xcc1d('0x15'));var utils=require('../../config/utils');var config=require(_0xcc1d('0x16'));var licenseUtil=require(_0xcc1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11a34f,_0x3e2534){_0x3e2534=_0x3e2534||0xcc;return function(_0x1440f6){if(_0x1440f6){return _0x11a34f[_0xcc1d('0x18')](_0x3e2534);}return _0x11a34f[_0xcc1d('0x19')](_0x3e2534)[_0xcc1d('0x1a')]();};}function respondWithResult(_0x18b64a,_0x5345ab){_0x5345ab=_0x5345ab||0xc8;return function(_0x5e66ce){if(_0x5e66ce){return _0x18b64a[_0xcc1d('0x19')](_0x5345ab)['json'](_0x5e66ce);}};}function respondWithFilteredResult(_0x35e177,_0x452772){return function(_0x35f147){if(_0x35f147){var _0xc71166=typeof _0x452772[_0xcc1d('0x1b')]===_0xcc1d('0x1c')&&typeof _0x452772[_0xcc1d('0x1d')]===_0xcc1d('0x1c');var _0x2147ca=_0x35f147[_0xcc1d('0x1e')];var _0x483963=_0xc71166?0x0:_0x452772['offset'];var _0x2ee388=_0xc71166?_0x35f147['count']:_0x452772[_0xcc1d('0x1b')]+_0x452772[_0xcc1d('0x1d')];var _0xf44327;if(_0x2ee388>=_0x2147ca){_0x2ee388=_0x2147ca;_0xf44327=0xc8;}else{_0xf44327=0xce;}_0x35e177[_0xcc1d('0x19')](_0xf44327);return _0x35e177[_0xcc1d('0x1f')](_0xcc1d('0x20'),_0x483963+'-'+_0x2ee388+'/'+_0x2147ca)[_0xcc1d('0x21')](_0x35f147);}return null;};}function patchUpdates(_0x1b88f4){return function(_0x438288){try{jsonpatch['apply'](_0x438288,_0x1b88f4,!![]);}catch(_0x23189c){return BPromise['reject'](_0x23189c);}return _0x438288[_0xcc1d('0x22')]();};}function saveUpdates(_0x1bcf7b,_0x167b9f){return function(_0x5a2df6){if(_0x5a2df6){return _0x5a2df6[_0xcc1d('0x23')](_0x1bcf7b)[_0xcc1d('0x24')](function(_0x31a006){return _0x31a006;});}return null;};}function removeEntity(_0x451523,_0xac9e86){return function(_0x5e2f74){if(_0x5e2f74){return _0x5e2f74[_0xcc1d('0x25')]()['then'](function(){_0x451523[_0xcc1d('0x19')](0xcc)[_0xcc1d('0x1a')]();});}};}function handleEntityNotFound(_0x3f8b30,_0x40e31c){return function(_0xd2dba0){if(!_0xd2dba0){_0x3f8b30['sendStatus'](0x194);}return _0xd2dba0;};}function handleError(_0x8ae1a4,_0x17cdfe){_0x17cdfe=_0x17cdfe||0x1f4;return function(_0xec0667){logger['error'](_0xec0667[_0xcc1d('0x26')]);if(_0xec0667['name']){delete _0xec0667[_0xcc1d('0x27')];}_0x8ae1a4['status'](_0x17cdfe)[_0xcc1d('0x28')](_0xec0667);};}exports[_0xcc1d('0x29')]=function(_0x47710b,_0x50b769){var _0x2c5c51={},_0x10f5d3={},_0x11ba24={'count':0x0,'rows':[]};var _0x4a406f=_[_0xcc1d('0x2a')](db['ChatQueueReport'][_0xcc1d('0x2b')],function(_0x2a68ef){return{'name':_0x2a68ef[_0xcc1d('0x2c')],'type':_0x2a68ef[_0xcc1d('0x2d')][_0xcc1d('0x2e')]};});_0x10f5d3['model']=_[_0xcc1d('0x2a')](_0x4a406f,_0xcc1d('0x27'));_0x10f5d3['query']=_[_0xcc1d('0x2f')](_0x47710b['query']);_0x10f5d3[_0xcc1d('0x30')]=_['intersection'](_0x10f5d3['model'],_0x10f5d3[_0xcc1d('0x31')]);_0x2c5c51['attributes']=_[_0xcc1d('0x32')](_0x10f5d3[_0xcc1d('0x33')],qs[_0xcc1d('0x34')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x34')]));_0x2c5c51[_0xcc1d('0x35')]=_0x2c5c51['attributes'][_0xcc1d('0x36')]?_0x2c5c51['attributes']:_0x10f5d3[_0xcc1d('0x33')];if(!_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x37')](_0xcc1d('0x38'))){_0x2c5c51['limit']=qs[_0xcc1d('0x1d')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x1d')]);_0x2c5c51[_0xcc1d('0x1b')]=qs[_0xcc1d('0x1b')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x1b')]);}_0x2c5c51[_0xcc1d('0x39')]=qs[_0xcc1d('0x3a')](_0x47710b[_0xcc1d('0x31')]['sort']);_0x2c5c51['where']=qs[_0xcc1d('0x30')](_[_0xcc1d('0x3b')](_0x47710b['query'],_0x10f5d3['filters']),_0x4a406f);if(_0x47710b['query'][_0xcc1d('0x3c')]){_0x2c5c51[_0xcc1d('0x3d')]=_[_0xcc1d('0x3e')](_0x2c5c51[_0xcc1d('0x3d')],{'$or':_[_0xcc1d('0x2a')](_0x4a406f,function(_0xcc81fd){if(_0xcc81fd[_0xcc1d('0x2d')]!=='VIRTUAL'){var _0x3d35e9={};_0x3d35e9[_0xcc81fd['name']]={'$like':'%'+_0x47710b['query']['filter']+'%'};return _0x3d35e9;}})});}_0x2c5c51=_[_0xcc1d('0x3e')]({},_0x2c5c51,_0x47710b[_0xcc1d('0x3f')]);var _0x59d656={'where':_0x2c5c51['where']};return db[_0xcc1d('0x40')]['count'](_0x59d656)[_0xcc1d('0x24')](function(_0x91e50d){_0x11ba24[_0xcc1d('0x1e')]=_0x91e50d;if(_0x47710b['query'][_0xcc1d('0x41')]){_0x2c5c51[_0xcc1d('0x42')]=[{'all':!![]}];}return db[_0xcc1d('0x40')][_0xcc1d('0x43')](_0x2c5c51);})[_0xcc1d('0x24')](function(_0x350b9d){_0x11ba24[_0xcc1d('0x44')]=_0x350b9d;return _0x11ba24;})['then'](respondWithFilteredResult(_0x50b769,_0x2c5c51))[_0xcc1d('0x45')](handleError(_0x50b769,null));};exports['show']=function(_0x809c64,_0x2ac320){var _0x1d74b4={'raw':!![],'where':{'id':_0x809c64[_0xcc1d('0x46')]['id']}},_0x252361={};_0x252361[_0xcc1d('0x33')]=_[_0xcc1d('0x2f')](db[_0xcc1d('0x40')][_0xcc1d('0x2b')]);_0x252361[_0xcc1d('0x31')]=_[_0xcc1d('0x2f')](_0x809c64[_0xcc1d('0x31')]);_0x252361['filters']=_[_0xcc1d('0x32')](_0x252361[_0xcc1d('0x33')],_0x252361[_0xcc1d('0x31')]);_0x1d74b4[_0xcc1d('0x35')]=_[_0xcc1d('0x32')](_0x252361[_0xcc1d('0x33')],qs[_0xcc1d('0x34')](_0x809c64[_0xcc1d('0x31')][_0xcc1d('0x34')]));_0x1d74b4[_0xcc1d('0x35')]=_0x1d74b4[_0xcc1d('0x35')]['length']?_0x1d74b4[_0xcc1d('0x35')]:_0x252361[_0xcc1d('0x33')];if(_0x809c64[_0xcc1d('0x31')][_0xcc1d('0x41')]){_0x1d74b4[_0xcc1d('0x42')]=[{'all':!![]}];}_0x1d74b4=_[_0xcc1d('0x3e')]({},_0x1d74b4,_0x809c64[_0xcc1d('0x3f')]);return db[_0xcc1d('0x40')][_0xcc1d('0x47')](_0x1d74b4)[_0xcc1d('0x24')](handleEntityNotFound(_0x2ac320,null))[_0xcc1d('0x24')](respondWithResult(_0x2ac320,null))[_0xcc1d('0x45')](handleError(_0x2ac320,null));};exports[_0xcc1d('0x48')]=function(_0x1ba4fc,_0x3e9a69){return db[_0xcc1d('0x40')][_0xcc1d('0x48')](_0x1ba4fc[_0xcc1d('0x49')],{})[_0xcc1d('0x24')](respondWithResult(_0x3e9a69,0xc9))[_0xcc1d('0x45')](handleError(_0x3e9a69,null));};exports['update']=function(_0x46a883,_0x4f4359){if(_0x46a883[_0xcc1d('0x49')]['id']){delete _0x46a883[_0xcc1d('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x46a883[_0xcc1d('0x46')]['id']}})[_0xcc1d('0x24')](handleEntityNotFound(_0x4f4359,null))[_0xcc1d('0x24')](saveUpdates(_0x46a883[_0xcc1d('0x49')],null))[_0xcc1d('0x24')](respondWithResult(_0x4f4359,null))[_0xcc1d('0x45')](handleError(_0x4f4359,null));};exports['destroy']=function(_0x40b834,_0x98ee9a){return db['ChatQueueReport'][_0xcc1d('0x47')]({'where':{'id':_0x40b834[_0xcc1d('0x46')]['id']}})[_0xcc1d('0x24')](handleEntityNotFound(_0x98ee9a,null))['then'](removeEntity(_0x98ee9a,null))[_0xcc1d('0x45')](handleError(_0x98ee9a,null));};exports[_0xcc1d('0x4a')]=function(_0x3b232f,_0x50d994){return db[_0xcc1d('0x40')][_0xcc1d('0x4a')]()[_0xcc1d('0x24')](respondWithResult(_0x50d994,null))[_0xcc1d('0x45')](handleError(_0x50d994,null));};
\ No newline at end of file
index 13b1477..d2929eb 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(_0x28c4ea,_0x561717){var _0x53877e=function(_0x419f88){while(--_0x419f88){_0x28c4ea['push'](_0x28c4ea['shift']());}};_0x53877e(++_0x561717);}(_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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x12ddee,_0x23a83c){var _0x4af963=function(_0x5e73e5){while(--_0x5e73e5){_0x12ddee['push'](_0x12ddee['shift']());}};_0x4af963(++_0x23a83c);}(_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
index f3c0a8a..9f3e3fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46f0=['UpdateChatQueueReport','ChatQueueReport','update','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw'];(function(_0x239d83,_0x31740e){var _0x5a5399=function(_0x221dab){while(--_0x221dab){_0x239d83['push'](_0x239d83['shift']());}};_0x5a5399(++_0x31740e);}(_0x46f0,0x1a7));var _0x046f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46f0[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x046f('0x0'));var moment=require(_0x046f('0x1'));var BPromise=require(_0x046f('0x2'));var rs=require(_0x046f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x046f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x046f('0x5'))(_0x046f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x046f('0x7')][_0x046f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37edfd,_0x13d894,_0x57930f){return new BPromise(function(_0x335cff,_0x1ac5d8){return client[_0x046f('0x9')](_0x37edfd,_0x57930f)[_0x046f('0xa')](function(_0x1a5826){logger[_0x046f('0xb')](_0x046f('0xc'),_0x13d894,_0x046f('0xd'));logger[_0x046f('0xe')](_0x046f('0xf'),_0x13d894,_0x046f('0xd'),JSON[_0x046f('0x10')](_0x1a5826));if(_0x1a5826[_0x046f('0x11')]){if(_0x1a5826[_0x046f('0x11')][_0x046f('0x12')]===0x1f4){logger['error'](_0x046f('0xc'),_0x13d894,_0x1a5826[_0x046f('0x11')][_0x046f('0x13')]);return _0x1ac5d8(_0x1a5826[_0x046f('0x11')]['message']);}logger[_0x046f('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x13d894,_0x1a5826[_0x046f('0x11')]['message']);return _0x335cff(_0x1a5826['error'][_0x046f('0x13')]);}else{logger['info'](_0x046f('0xc'),_0x13d894,'request\x20sent');_0x335cff(_0x1a5826[_0x046f('0x14')][_0x046f('0x13')]);}})[_0x046f('0x15')](function(_0xd4dc71){logger[_0x046f('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x13d894,_0xd4dc71);_0x1ac5d8(_0xd4dc71);});});}exports[_0x046f('0x16')]=function(_0x22829d){var _0x17612a=this;return new Promise(function(_0xe25b59,_0x256805){return db['ChatQueueReport'][_0x046f('0x17')](_0x22829d[_0x046f('0x18')],{'raw':_0x22829d['options']?_0x22829d[_0x046f('0x19')][_0x046f('0x1a')]===undefined?!![]:![]:!![]})[_0x046f('0xa')](function(_0x471210){logger['info'](_0x046f('0x16'),_0x22829d);logger[_0x046f('0xe')](_0x046f('0x16'),_0x22829d,JSON[_0x046f('0x10')](_0x471210));_0xe25b59(_0x471210);})['catch'](function(_0x25794d){logger[_0x046f('0x11')]('CreateChatQueueReport',_0x25794d[_0x046f('0x13')],_0x22829d);_0x256805(_0x17612a[_0x046f('0x11')](0x1f4,_0x25794d[_0x046f('0x13')]));});});};exports[_0x046f('0x1b')]=function(_0x5a4314){var _0x396933=this;return new Promise(function(_0x488f15,_0x168074){return db[_0x046f('0x1c')][_0x046f('0x1d')](_0x5a4314[_0x046f('0x18')],{'raw':_0x5a4314[_0x046f('0x19')]?_0x5a4314[_0x046f('0x19')][_0x046f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a4314[_0x046f('0x19')]?_0x5a4314['options']['where']||null:null,'attributes':_0x5a4314[_0x046f('0x19')]?_0x5a4314[_0x046f('0x19')]['attributes']||null:null,'limit':_0x5a4314['options']?_0x5a4314[_0x046f('0x19')]['limit']||null:null})[_0x046f('0xa')](function(_0x5354de){logger[_0x046f('0xb')](_0x046f('0x1b'),_0x5a4314);logger[_0x046f('0xe')](_0x046f('0x1b'),_0x5a4314,JSON[_0x046f('0x10')](_0x5354de));_0x488f15(_0x5354de);})['catch'](function(_0x5b0d5d){logger[_0x046f('0x11')]('UpdateChatQueueReport',_0x5b0d5d[_0x046f('0x13')],_0x5a4314);_0x168074(_0x396933[_0x046f('0x11')](0x1f4,_0x5b0d5d[_0x046f('0x13')]));});});};
\ No newline at end of file
+var _0xa5cd=['limit','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','attributes'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0xa5cd,0xd3));var _0xda5c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xa5cd[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xda5c('0x0'));var BPromise=require(_0xda5c('0x1'));var rs=require(_0xda5c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda5c('0x3'))['db'];var utils=require(_0xda5c('0x4'));var logger=require(_0xda5c('0x5'))(_0xda5c('0x6'));var config=require(_0xda5c('0x7'));var jayson=require(_0xda5c('0x8'));var client=jayson[_0xda5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7006b3,_0x3c2094,_0x2df01d){return new BPromise(function(_0xa18ef3,_0x4ee173){return client['request'](_0x7006b3,_0x2df01d)[_0xda5c('0xa')](function(_0x35dbb7){logger[_0xda5c('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x3c2094,_0xda5c('0xc'));logger[_0xda5c('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3c2094,'request\x20sent',JSON[_0xda5c('0xe')](_0x35dbb7));if(_0x35dbb7[_0xda5c('0xf')]){if(_0x35dbb7[_0xda5c('0xf')]['code']===0x1f4){logger[_0xda5c('0xf')](_0xda5c('0x10'),_0x3c2094,_0x35dbb7['error'][_0xda5c('0x11')]);return _0x4ee173(_0x35dbb7[_0xda5c('0xf')][_0xda5c('0x11')]);}logger['error'](_0xda5c('0x10'),_0x3c2094,_0x35dbb7[_0xda5c('0xf')][_0xda5c('0x11')]);return _0xa18ef3(_0x35dbb7[_0xda5c('0xf')]['message']);}else{logger[_0xda5c('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x3c2094,_0xda5c('0xc'));_0xa18ef3(_0x35dbb7['result'][_0xda5c('0x11')]);}})['catch'](function(_0x277d61){logger['error'](_0xda5c('0x10'),_0x3c2094,_0x277d61);_0x4ee173(_0x277d61);});});}exports[_0xda5c('0x12')]=function(_0x504391){var _0x2dbdd7=this;return new Promise(function(_0x771326,_0x51a6a2){return db[_0xda5c('0x13')][_0xda5c('0x14')](_0x504391[_0xda5c('0x15')],{'raw':_0x504391[_0xda5c('0x16')]?_0x504391[_0xda5c('0x16')][_0xda5c('0x17')]===undefined?!![]:![]:!![]})[_0xda5c('0xa')](function(_0x44fe7f){logger[_0xda5c('0xb')](_0xda5c('0x12'),_0x504391);logger[_0xda5c('0xd')](_0xda5c('0x12'),_0x504391,JSON['stringify'](_0x44fe7f));_0x771326(_0x44fe7f);})[_0xda5c('0x18')](function(_0x547b51){logger['error']('CreateChatQueueReport',_0x547b51[_0xda5c('0x11')],_0x504391);_0x51a6a2(_0x2dbdd7[_0xda5c('0xf')](0x1f4,_0x547b51[_0xda5c('0x11')]));});});};exports[_0xda5c('0x19')]=function(_0x48aee6){var _0x172350=this;return new Promise(function(_0x9e32b3,_0x530aeb){return db['ChatQueueReport'][_0xda5c('0x1a')](_0x48aee6[_0xda5c('0x15')],{'raw':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48aee6['options']?_0x48aee6[_0xda5c('0x16')][_0xda5c('0x1b')]||null:null,'attributes':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options'][_0xda5c('0x1c')]||null:null,'limit':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options'][_0xda5c('0x1d')]||null:null})[_0xda5c('0xa')](function(_0x147af7){logger['info'](_0xda5c('0x19'),_0x48aee6);logger['debug'](_0xda5c('0x19'),_0x48aee6,JSON[_0xda5c('0xe')](_0x147af7));_0x9e32b3(_0x147af7);})[_0xda5c('0x18')](function(_0x1394b6){logger[_0xda5c('0xf')](_0xda5c('0x19'),_0x1394b6[_0xda5c('0x11')],_0x48aee6);_0x530aeb(_0x172350['error'](0x1f4,_0x1394b6[_0xda5c('0x11')]));});});};
\ No newline at end of file
index 4527518..2497d99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd04a=['get','show','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xd04a,0x16c));var _0xad04=function(_0x342df5,_0x2bbfe0){_0x342df5=_0x342df5-0x0;var _0x19fa88=_0xd04a[_0x342df5];return _0x19fa88;};'use strict';var multer=require('multer');var util=require(_0xad04('0x0'));var path=require(_0xad04('0x1'));var timeout=require(_0xad04('0x2'));var express=require(_0xad04('0x3'));var router=express[_0xad04('0x4')]();var fs_extra=require(_0xad04('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xad04('0x6'));var config=require(_0xad04('0x7'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xad04('0x8')](),controller[_0xad04('0x9')]);router[_0xad04('0xa')]('/describe',auth[_0xad04('0x8')](),controller['describe']);router['get']('/:id',auth[_0xad04('0x8')](),controller[_0xad04('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xad04('0xc')](_0xad04('0xd'),auth[_0xad04('0x8')](),controller[_0xad04('0xe')]);router['delete'](_0xad04('0xd'),auth[_0xad04('0x8')](),controller[_0xad04('0xf')]);module[_0xad04('0x10')]=router;
\ No newline at end of file
+var _0xceb6=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','put','update'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0xceb6,0x1e3));var _0x6ceb=function(_0x3e93a3,_0x1d38cf){_0x3e93a3=_0x3e93a3-0x0;var _0x5edc60=_0xceb6[_0x3e93a3];return _0x5edc60;};'use strict';var multer=require('multer');var util=require(_0x6ceb('0x0'));var path=require(_0x6ceb('0x1'));var timeout=require(_0x6ceb('0x2'));var express=require(_0x6ceb('0x3'));var router=express[_0x6ceb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ceb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ceb('0x6'));var controller=require('./chatQueueReport.controller');router[_0x6ceb('0x7')]('/',auth['isAuthenticated'](),controller[_0x6ceb('0x8')]);router[_0x6ceb('0x7')](_0x6ceb('0x9'),auth[_0x6ceb('0xa')](),controller[_0x6ceb('0xb')]);router['get']('/:id',auth[_0x6ceb('0xa')](),controller[_0x6ceb('0xc')]);router[_0x6ceb('0xd')]('/',auth[_0x6ceb('0xa')](),controller[_0x6ceb('0xe')]);router[_0x6ceb('0xf')]('/:id',auth[_0x6ceb('0xa')](),controller[_0x6ceb('0x10')]);router[_0x6ceb('0x11')]('/:id',auth[_0x6ceb('0xa')](),controller[_0x6ceb('0x12')]);module[_0x6ceb('0x13')]=router;
\ No newline at end of file
index ecf6a4f..c6cf0b3 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(_0x2cf452,_0x37957c){var _0x4c4610=function(_0x1db904){while(--_0x1db904){_0x2cf452['push'](_0x2cf452['shift']());}};_0x4c4610(++_0x37957c);}(_0xaa88,0x137));var _0x8aa8=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xaa88[_0x5ce8b9];return _0xe34be0;};'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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4475e0,_0xf51b40){var _0x575291=function(_0xcadfe7){while(--_0xcadfe7){_0x4475e0['push'](_0x4475e0['shift']());}};_0x575291(++_0xf51b40);}(_0x70e0,0x17b));var _0x070e=function(_0x183b57,_0xfc6974){_0x183b57=_0x183b57-0x0;var _0x2ddba5=_0x70e0[_0x183b57];return _0x2ddba5;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index d1f9f92..3916de8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb195=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','ChatTransferReport','includeAll','findAll','rows','show','params','fields','include','options','find','catch','create','body','destroy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb195,0x129));var _0x5b19=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb195[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x5b19('0x0'));var rimraf=require(_0x5b19('0x1'));var zipdir=require(_0x5b19('0x2'));var jsonpatch=require(_0x5b19('0x3'));var rp=require(_0x5b19('0x4'));var moment=require(_0x5b19('0x5'));var BPromise=require(_0x5b19('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5b19('0x7'));var sox=require(_0x5b19('0x8'));var csv=require(_0x5b19('0x9'));var ejs=require(_0x5b19('0xa'));var fs=require('fs');var fs_extra=require(_0x5b19('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5b19('0xc'));var jsforce=require(_0x5b19('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5b19('0xe'));var Redis=require(_0x5b19('0xf'));var authService=require(_0x5b19('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5b19('0x11'));var hardwareService=require(_0x5b19('0x12'));var logger=require(_0x5b19('0x13'))(_0x5b19('0x14'));var utils=require('../../config/utils');var config=require(_0x5b19('0x15'));var licenseUtil=require(_0x5b19('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x163dba,_0x5bc285){_0x5bc285=_0x5bc285||0xcc;return function(_0x22198f){if(_0x22198f){return _0x163dba['sendStatus'](_0x5bc285);}return _0x163dba[_0x5b19('0x17')](_0x5bc285)[_0x5b19('0x18')]();};}function respondWithResult(_0x11201b,_0x4d6bed){_0x4d6bed=_0x4d6bed||0xc8;return function(_0x2a7d9b){if(_0x2a7d9b){return _0x11201b[_0x5b19('0x17')](_0x4d6bed)[_0x5b19('0x19')](_0x2a7d9b);}};}function respondWithFilteredResult(_0x5c5bb9,_0x2b8d44){return function(_0x557f8a){if(_0x557f8a){var _0x2a16bf=typeof _0x2b8d44[_0x5b19('0x1a')]===_0x5b19('0x1b')&&typeof _0x2b8d44[_0x5b19('0x1c')]===_0x5b19('0x1b');var _0x4ae3a6=_0x557f8a[_0x5b19('0x1d')];var _0x54d9fe=_0x2a16bf?0x0:_0x2b8d44[_0x5b19('0x1a')];var _0x2e6396=_0x2a16bf?_0x557f8a[_0x5b19('0x1d')]:_0x2b8d44[_0x5b19('0x1a')]+_0x2b8d44['limit'];var _0x14771f;if(_0x2e6396>=_0x4ae3a6){_0x2e6396=_0x4ae3a6;_0x14771f=0xc8;}else{_0x14771f=0xce;}_0x5c5bb9[_0x5b19('0x17')](_0x14771f);return _0x5c5bb9[_0x5b19('0x1e')](_0x5b19('0x1f'),_0x54d9fe+'-'+_0x2e6396+'/'+_0x4ae3a6)['json'](_0x557f8a);}return null;};}function patchUpdates(_0x28aaa2){return function(_0x3126ad){try{jsonpatch[_0x5b19('0x20')](_0x3126ad,_0x28aaa2,!![]);}catch(_0x183cc5){return BPromise['reject'](_0x183cc5);}return _0x3126ad['save']();};}function saveUpdates(_0x48a563,_0x5e01d2){return function(_0x476b5e){if(_0x476b5e){return _0x476b5e[_0x5b19('0x21')](_0x48a563)[_0x5b19('0x22')](function(_0x98c16e){return _0x98c16e;});}return null;};}function removeEntity(_0x352bb6,_0x514182){return function(_0xee6d30){if(_0xee6d30){return _0xee6d30['destroy']()['then'](function(){_0x352bb6[_0x5b19('0x17')](0xcc)[_0x5b19('0x18')]();});}};}function handleEntityNotFound(_0x4e4d1e,_0x48fde7){return function(_0x532a78){if(!_0x532a78){_0x4e4d1e[_0x5b19('0x23')](0x194);}return _0x532a78;};}function handleError(_0x7b2d10,_0x40f7fb){_0x40f7fb=_0x40f7fb||0x1f4;return function(_0x5bc9a1){logger[_0x5b19('0x24')](_0x5bc9a1['stack']);if(_0x5bc9a1[_0x5b19('0x25')]){delete _0x5bc9a1[_0x5b19('0x25')];}_0x7b2d10[_0x5b19('0x17')](_0x40f7fb)[_0x5b19('0x26')](_0x5bc9a1);};}exports['index']=function(_0x48b90c,_0x5915d2){var _0x1e4258={},_0x366dd7={},_0x1e5817={'count':0x0,'rows':[]};var _0xe48288=_[_0x5b19('0x27')](db['ChatTransferReport'][_0x5b19('0x28')],function(_0x341dc1){return{'name':_0x341dc1[_0x5b19('0x29')],'type':_0x341dc1[_0x5b19('0x2a')][_0x5b19('0x2b')]};});_0x366dd7['model']=_[_0x5b19('0x27')](_0xe48288,_0x5b19('0x25'));_0x366dd7[_0x5b19('0x2c')]=_[_0x5b19('0x2d')](_0x48b90c[_0x5b19('0x2c')]);_0x366dd7[_0x5b19('0x2e')]=_[_0x5b19('0x2f')](_0x366dd7['model'],_0x366dd7['query']);_0x1e4258[_0x5b19('0x30')]=_[_0x5b19('0x2f')](_0x366dd7[_0x5b19('0x31')],qs['fields'](_0x48b90c[_0x5b19('0x2c')]['fields']));_0x1e4258['attributes']=_0x1e4258[_0x5b19('0x30')][_0x5b19('0x32')]?_0x1e4258[_0x5b19('0x30')]:_0x366dd7['model'];if(!_0x48b90c['query'][_0x5b19('0x33')](_0x5b19('0x34'))){_0x1e4258[_0x5b19('0x1c')]=qs[_0x5b19('0x1c')](_0x48b90c[_0x5b19('0x2c')]['limit']);_0x1e4258['offset']=qs[_0x5b19('0x1a')](_0x48b90c[_0x5b19('0x2c')][_0x5b19('0x1a')]);}_0x1e4258[_0x5b19('0x35')]=qs['sort'](_0x48b90c[_0x5b19('0x2c')][_0x5b19('0x36')]);_0x1e4258[_0x5b19('0x37')]=qs[_0x5b19('0x2e')](_['pick'](_0x48b90c[_0x5b19('0x2c')],_0x366dd7[_0x5b19('0x2e')]),_0xe48288);if(_0x48b90c[_0x5b19('0x2c')][_0x5b19('0x38')]){_0x1e4258['where']=_['merge'](_0x1e4258[_0x5b19('0x37')],{'$or':_[_0x5b19('0x27')](_0xe48288,function(_0x524729){if(_0x524729[_0x5b19('0x2a')]!==_0x5b19('0x39')){var _0x3dddbb={};_0x3dddbb[_0x524729[_0x5b19('0x25')]]={'$like':'%'+_0x48b90c[_0x5b19('0x2c')][_0x5b19('0x38')]+'%'};return _0x3dddbb;}})});}_0x1e4258=_[_0x5b19('0x3a')]({},_0x1e4258,_0x48b90c['options']);var _0x1ce590={'where':_0x1e4258['where']};return db[_0x5b19('0x3b')][_0x5b19('0x1d')](_0x1ce590)['then'](function(_0x5e6ad9){_0x1e5817[_0x5b19('0x1d')]=_0x5e6ad9;if(_0x48b90c[_0x5b19('0x2c')][_0x5b19('0x3c')]){_0x1e4258['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x5b19('0x3d')](_0x1e4258);})['then'](function(_0x528029){_0x1e5817[_0x5b19('0x3e')]=_0x528029;return _0x1e5817;})[_0x5b19('0x22')](respondWithFilteredResult(_0x5915d2,_0x1e4258))['catch'](handleError(_0x5915d2,null));};exports[_0x5b19('0x3f')]=function(_0x49256f,_0x207eed){var _0x5905b6={'raw':!![],'where':{'id':_0x49256f[_0x5b19('0x40')]['id']}},_0x5b9a95={};_0x5b9a95[_0x5b19('0x31')]=_[_0x5b19('0x2d')](db[_0x5b19('0x3b')]['rawAttributes']);_0x5b9a95[_0x5b19('0x2c')]=_[_0x5b19('0x2d')](_0x49256f[_0x5b19('0x2c')]);_0x5b9a95[_0x5b19('0x2e')]=_['intersection'](_0x5b9a95['model'],_0x5b9a95[_0x5b19('0x2c')]);_0x5905b6['attributes']=_[_0x5b19('0x2f')](_0x5b9a95[_0x5b19('0x31')],qs[_0x5b19('0x41')](_0x49256f[_0x5b19('0x2c')]['fields']));_0x5905b6[_0x5b19('0x30')]=_0x5905b6[_0x5b19('0x30')][_0x5b19('0x32')]?_0x5905b6['attributes']:_0x5b9a95['model'];if(_0x49256f[_0x5b19('0x2c')][_0x5b19('0x3c')]){_0x5905b6[_0x5b19('0x42')]=[{'all':!![]}];}_0x5905b6=_[_0x5b19('0x3a')]({},_0x5905b6,_0x49256f[_0x5b19('0x43')]);return db[_0x5b19('0x3b')][_0x5b19('0x44')](_0x5905b6)[_0x5b19('0x22')](handleEntityNotFound(_0x207eed,null))[_0x5b19('0x22')](respondWithResult(_0x207eed,null))[_0x5b19('0x45')](handleError(_0x207eed,null));};exports['create']=function(_0x4ded1e,_0x1d7437){return db[_0x5b19('0x3b')][_0x5b19('0x46')](_0x4ded1e[_0x5b19('0x47')],{})[_0x5b19('0x22')](respondWithResult(_0x1d7437,0xc9))[_0x5b19('0x45')](handleError(_0x1d7437,null));};exports[_0x5b19('0x21')]=function(_0x1e9c73,_0x2ced2a){if(_0x1e9c73[_0x5b19('0x47')]['id']){delete _0x1e9c73['body']['id'];}return db[_0x5b19('0x3b')][_0x5b19('0x44')]({'where':{'id':_0x1e9c73[_0x5b19('0x40')]['id']}})[_0x5b19('0x22')](handleEntityNotFound(_0x2ced2a,null))['then'](saveUpdates(_0x1e9c73[_0x5b19('0x47')],null))['then'](respondWithResult(_0x2ced2a,null))[_0x5b19('0x45')](handleError(_0x2ced2a,null));};exports[_0x5b19('0x48')]=function(_0x3c1b7d,_0x244b1e){return db[_0x5b19('0x3b')][_0x5b19('0x44')]({'where':{'id':_0x3c1b7d[_0x5b19('0x40')]['id']}})[_0x5b19('0x22')](handleEntityNotFound(_0x244b1e,null))[_0x5b19('0x22')](removeEntity(_0x244b1e,null))[_0x5b19('0x45')](handleError(_0x244b1e,null));};exports[_0x5b19('0x49')]=function(_0x450af1,_0x9d237d){return db[_0x5b19('0x3b')][_0x5b19('0x49')]()['then'](respondWithResult(_0x9d237d,null))['catch'](handleError(_0x9d237d,null));};
\ No newline at end of file
+var _0xbcc9=['limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','map','ChatTransferReport','rawAttributes','fieldName','model','query','intersection','fields','attributes','order','sort','where','filters','pick','type','VIRTUAL','options','include','findAll','rows','show','keys','includeAll','find','catch','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x1de8d8,_0xca0c0c){var _0x5ad51f=function(_0xc3533a){while(--_0xc3533a){_0x1de8d8['push'](_0x1de8d8['shift']());}};_0x5ad51f(++_0xca0c0c);}(_0xbcc9,0x149));var _0x9bcc=function(_0x41fdcc,_0x586927){_0x41fdcc=_0x41fdcc-0x0;var _0x3de759=_0xbcc9[_0x41fdcc];return _0x3de759;};'use strict';var emlformat=require(_0x9bcc('0x0'));var rimraf=require(_0x9bcc('0x1'));var zipdir=require(_0x9bcc('0x2'));var jsonpatch=require(_0x9bcc('0x3'));var rp=require('request-promise');var moment=require(_0x9bcc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9bcc('0x5'));var path=require(_0x9bcc('0x6'));var sox=require('sox');var csv=require(_0x9bcc('0x7'));var ejs=require(_0x9bcc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bcc('0x9'));var squel=require(_0x9bcc('0xa'));var crypto=require(_0x9bcc('0xb'));var jsforce=require(_0x9bcc('0xc'));var deskjs=require(_0x9bcc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9bcc('0xe'));var Papa=require(_0x9bcc('0xf'));var Redis=require(_0x9bcc('0x10'));var authService=require(_0x9bcc('0x11'));var qs=require(_0x9bcc('0x12'));var as=require(_0x9bcc('0x13'));var hardwareService=require(_0x9bcc('0x14'));var logger=require(_0x9bcc('0x15'))(_0x9bcc('0x16'));var utils=require('../../config/utils');var config=require(_0x9bcc('0x17'));var licenseUtil=require(_0x9bcc('0x18'));var db=require(_0x9bcc('0x19'))['db'];function respondWithStatusCode(_0xc2e345,_0xb384dd){_0xb384dd=_0xb384dd||0xcc;return function(_0x549f0b){if(_0x549f0b){return _0xc2e345[_0x9bcc('0x1a')](_0xb384dd);}return _0xc2e345[_0x9bcc('0x1b')](_0xb384dd)['end']();};}function respondWithResult(_0x2f04e5,_0x4be1e4){_0x4be1e4=_0x4be1e4||0xc8;return function(_0x27e1c5){if(_0x27e1c5){return _0x2f04e5[_0x9bcc('0x1b')](_0x4be1e4)[_0x9bcc('0x1c')](_0x27e1c5);}};}function respondWithFilteredResult(_0x4f5101,_0x572541){return function(_0x4f93dc){if(_0x4f93dc){var _0x5b18ca=typeof _0x572541[_0x9bcc('0x1d')]===_0x9bcc('0x1e')&&typeof _0x572541[_0x9bcc('0x1f')]==='undefined';var _0x4a58ad=_0x4f93dc[_0x9bcc('0x20')];var _0x43591b=_0x5b18ca?0x0:_0x572541[_0x9bcc('0x1d')];var _0xc75f6=_0x5b18ca?_0x4f93dc[_0x9bcc('0x20')]:_0x572541['offset']+_0x572541['limit'];var _0x3bedde;if(_0xc75f6>=_0x4a58ad){_0xc75f6=_0x4a58ad;_0x3bedde=0xc8;}else{_0x3bedde=0xce;}_0x4f5101['status'](_0x3bedde);return _0x4f5101[_0x9bcc('0x21')](_0x9bcc('0x22'),_0x43591b+'-'+_0xc75f6+'/'+_0x4a58ad)['json'](_0x4f93dc);}return null;};}function patchUpdates(_0x337704){return function(_0x5cdae1){try{jsonpatch['apply'](_0x5cdae1,_0x337704,!![]);}catch(_0x6fa342){return BPromise[_0x9bcc('0x23')](_0x6fa342);}return _0x5cdae1[_0x9bcc('0x24')]();};}function saveUpdates(_0x521358,_0x45379d){return function(_0x4be5be){if(_0x4be5be){return _0x4be5be[_0x9bcc('0x25')](_0x521358)['then'](function(_0x3ba2ef){return _0x3ba2ef;});}return null;};}function removeEntity(_0x1f79b9,_0x26f53f){return function(_0x2f4388){if(_0x2f4388){return _0x2f4388['destroy']()[_0x9bcc('0x26')](function(){_0x1f79b9[_0x9bcc('0x1b')](0xcc)[_0x9bcc('0x27')]();});}};}function handleEntityNotFound(_0xcdcc94,_0x5ea989){return function(_0x3c6acb){if(!_0x3c6acb){_0xcdcc94['sendStatus'](0x194);}return _0x3c6acb;};}function handleError(_0x53ff0f,_0x468548){_0x468548=_0x468548||0x1f4;return function(_0x1f3891){logger[_0x9bcc('0x28')](_0x1f3891[_0x9bcc('0x29')]);if(_0x1f3891[_0x9bcc('0x2a')]){delete _0x1f3891[_0x9bcc('0x2a')];}_0x53ff0f[_0x9bcc('0x1b')](_0x468548)['send'](_0x1f3891);};}exports['index']=function(_0xf83dd4,_0x179829){var _0x256793={},_0x3696e5={},_0x3ca71c={'count':0x0,'rows':[]};var _0x219e30=_[_0x9bcc('0x2b')](db[_0x9bcc('0x2c')][_0x9bcc('0x2d')],function(_0x4f1787){return{'name':_0x4f1787[_0x9bcc('0x2e')],'type':_0x4f1787['type']['key']};});_0x3696e5[_0x9bcc('0x2f')]=_[_0x9bcc('0x2b')](_0x219e30,'name');_0x3696e5[_0x9bcc('0x30')]=_['keys'](_0xf83dd4[_0x9bcc('0x30')]);_0x3696e5['filters']=_[_0x9bcc('0x31')](_0x3696e5[_0x9bcc('0x2f')],_0x3696e5['query']);_0x256793['attributes']=_['intersection'](_0x3696e5[_0x9bcc('0x2f')],qs['fields'](_0xf83dd4['query'][_0x9bcc('0x32')]));_0x256793[_0x9bcc('0x33')]=_0x256793[_0x9bcc('0x33')]['length']?_0x256793[_0x9bcc('0x33')]:_0x3696e5['model'];if(!_0xf83dd4[_0x9bcc('0x30')]['hasOwnProperty']('nolimit')){_0x256793[_0x9bcc('0x1f')]=qs['limit'](_0xf83dd4[_0x9bcc('0x30')][_0x9bcc('0x1f')]);_0x256793[_0x9bcc('0x1d')]=qs[_0x9bcc('0x1d')](_0xf83dd4[_0x9bcc('0x30')][_0x9bcc('0x1d')]);}_0x256793[_0x9bcc('0x34')]=qs[_0x9bcc('0x35')](_0xf83dd4['query'][_0x9bcc('0x35')]);_0x256793[_0x9bcc('0x36')]=qs[_0x9bcc('0x37')](_[_0x9bcc('0x38')](_0xf83dd4['query'],_0x3696e5[_0x9bcc('0x37')]),_0x219e30);if(_0xf83dd4['query']['filter']){_0x256793[_0x9bcc('0x36')]=_['merge'](_0x256793[_0x9bcc('0x36')],{'$or':_[_0x9bcc('0x2b')](_0x219e30,function(_0x411584){if(_0x411584[_0x9bcc('0x39')]!==_0x9bcc('0x3a')){var _0x156c34={};_0x156c34[_0x411584[_0x9bcc('0x2a')]]={'$like':'%'+_0xf83dd4[_0x9bcc('0x30')]['filter']+'%'};return _0x156c34;}})});}_0x256793=_['merge']({},_0x256793,_0xf83dd4[_0x9bcc('0x3b')]);var _0x2f34ca={'where':_0x256793['where']};return db['ChatTransferReport'][_0x9bcc('0x20')](_0x2f34ca)['then'](function(_0x1c3084){_0x3ca71c[_0x9bcc('0x20')]=_0x1c3084;if(_0xf83dd4['query']['includeAll']){_0x256793[_0x9bcc('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9bcc('0x3d')](_0x256793);})[_0x9bcc('0x26')](function(_0x482aa1){_0x3ca71c[_0x9bcc('0x3e')]=_0x482aa1;return _0x3ca71c;})[_0x9bcc('0x26')](respondWithFilteredResult(_0x179829,_0x256793))['catch'](handleError(_0x179829,null));};exports[_0x9bcc('0x3f')]=function(_0x1a987d,_0x1b17ea){var _0xbddce3={'raw':!![],'where':{'id':_0x1a987d['params']['id']}},_0x44d6da={};_0x44d6da[_0x9bcc('0x2f')]=_[_0x9bcc('0x40')](db[_0x9bcc('0x2c')][_0x9bcc('0x2d')]);_0x44d6da['query']=_[_0x9bcc('0x40')](_0x1a987d[_0x9bcc('0x30')]);_0x44d6da[_0x9bcc('0x37')]=_[_0x9bcc('0x31')](_0x44d6da[_0x9bcc('0x2f')],_0x44d6da[_0x9bcc('0x30')]);_0xbddce3[_0x9bcc('0x33')]=_['intersection'](_0x44d6da[_0x9bcc('0x2f')],qs['fields'](_0x1a987d['query'][_0x9bcc('0x32')]));_0xbddce3[_0x9bcc('0x33')]=_0xbddce3[_0x9bcc('0x33')]['length']?_0xbddce3[_0x9bcc('0x33')]:_0x44d6da[_0x9bcc('0x2f')];if(_0x1a987d[_0x9bcc('0x30')][_0x9bcc('0x41')]){_0xbddce3[_0x9bcc('0x3c')]=[{'all':!![]}];}_0xbddce3=_['merge']({},_0xbddce3,_0x1a987d[_0x9bcc('0x3b')]);return db['ChatTransferReport'][_0x9bcc('0x42')](_0xbddce3)[_0x9bcc('0x26')](handleEntityNotFound(_0x1b17ea,null))[_0x9bcc('0x26')](respondWithResult(_0x1b17ea,null))[_0x9bcc('0x43')](handleError(_0x1b17ea,null));};exports['create']=function(_0x3c63c8,_0x119ef1){return db[_0x9bcc('0x2c')]['create'](_0x3c63c8[_0x9bcc('0x44')],{})[_0x9bcc('0x26')](respondWithResult(_0x119ef1,0xc9))['catch'](handleError(_0x119ef1,null));};exports['update']=function(_0x526fba,_0x42d901){if(_0x526fba[_0x9bcc('0x44')]['id']){delete _0x526fba[_0x9bcc('0x44')]['id'];}return db['ChatTransferReport'][_0x9bcc('0x42')]({'where':{'id':_0x526fba['params']['id']}})[_0x9bcc('0x26')](handleEntityNotFound(_0x42d901,null))['then'](saveUpdates(_0x526fba['body'],null))['then'](respondWithResult(_0x42d901,null))[_0x9bcc('0x43')](handleError(_0x42d901,null));};exports[_0x9bcc('0x45')]=function(_0x424600,_0x965cce){return db[_0x9bcc('0x2c')][_0x9bcc('0x42')]({'where':{'id':_0x424600[_0x9bcc('0x46')]['id']}})[_0x9bcc('0x26')](handleEntityNotFound(_0x965cce,null))[_0x9bcc('0x26')](removeEntity(_0x965cce,null))[_0x9bcc('0x43')](handleError(_0x965cce,null));};exports[_0x9bcc('0x47')]=function(_0x56e269,_0x485822){return db[_0x9bcc('0x2c')][_0x9bcc('0x47')]()[_0x9bcc('0x26')](respondWithResult(_0x485822,null))[_0x9bcc('0x43')](handleError(_0x485822,null));};
\ No newline at end of file
index 9636c89..d422464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bea=['report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatTransferReport'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x4bea,0xb8));var _0xa4be=function(_0x216240,_0xb67e29){_0x216240=_0x216240-0x0;var _0x488ab8=_0x4bea[_0x216240];return _0x488ab8;};'use strict';var _=require(_0xa4be('0x0'));var util=require(_0xa4be('0x1'));var logger=require('../../config/logger')(_0xa4be('0x2'));var moment=require(_0xa4be('0x3'));var BPromise=require(_0xa4be('0x4'));var rp=require(_0xa4be('0x5'));var fs=require('fs');var path=require(_0xa4be('0x6'));var rimraf=require(_0xa4be('0x7'));var config=require(_0xa4be('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3050a8,_0x4ea26d){return _0x3050a8[_0xa4be('0x9')](_0xa4be('0xa'),attributes,{'tableName':_0xa4be('0xb'),'paranoid':![],'indexes':[{'name':_0xa4be('0xc'),'fields':[_0xa4be('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x61bc=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x30eb2f,_0x44b55b){var _0x33ce44=function(_0x3e1a62){while(--_0x3e1a62){_0x30eb2f['push'](_0x30eb2f['shift']());}};_0x33ce44(++_0x44b55b);}(_0x61bc,0x9b));var _0xc61b=function(_0x531b8f,_0x367e3b){_0x531b8f=_0x531b8f-0x0;var _0x1917af=_0x61bc[_0x531b8f];return _0x1917af;};'use strict';var _=require(_0xc61b('0x0'));var util=require(_0xc61b('0x1'));var logger=require(_0xc61b('0x2'))(_0xc61b('0x3'));var moment=require('moment');var BPromise=require(_0xc61b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc61b('0x5'));var rimraf=require(_0xc61b('0x6'));var config=require(_0xc61b('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xc61b('0x8')]=function(_0x2dc6af,_0x22d2a7){return _0x2dc6af[_0xc61b('0x9')](_0xc61b('0xa'),attributes,{'tableName':_0xc61b('0xb'),'paranoid':![],'indexes':[{'name':_0xc61b('0xc'),'fields':[_0xc61b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index b905616..1e5a1a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71bf=['../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfce1f6,_0x4d9969){var _0x5d5367=function(_0x5d5b8f){while(--_0x5d5b8f){_0xfce1f6['push'](_0xfce1f6['shift']());}};_0x5d5367(++_0x4d9969);}(_0x71bf,0xd8));var _0xf71b=function(_0x1e2072,_0xe3cc90){_0x1e2072=_0x1e2072-0x0;var _0x22956b=_0x71bf[_0x1e2072];return _0x22956b;};'use strict';var _=require(_0xf71b('0x0'));var util=require(_0xf71b('0x1'));var moment=require(_0xf71b('0x2'));var BPromise=require(_0xf71b('0x3'));var rs=require(_0xf71b('0x4'));var fs=require('fs');var Redis=require(_0xf71b('0x5'));var db=require(_0xf71b('0x6'))['db'];var utils=require(_0xf71b('0x7'));var logger=require(_0xf71b('0x8'))('rpc');var config=require(_0xf71b('0x9'));var jayson=require(_0xf71b('0xa'));var client=jayson[_0xf71b('0xb')][_0xf71b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a2093,_0x11c094,_0x192311){return new BPromise(function(_0x261ec8,_0x18a9c0){return client[_0xf71b('0xd')](_0x5a2093,_0x192311)[_0xf71b('0xe')](function(_0xd2b02e){logger[_0xf71b('0xf')](_0xf71b('0x10'),_0x11c094,_0xf71b('0x11'));logger[_0xf71b('0x12')](_0xf71b('0x13'),_0x11c094,_0xf71b('0x11'),JSON['stringify'](_0xd2b02e));if(_0xd2b02e[_0xf71b('0x14')]){if(_0xd2b02e['error'][_0xf71b('0x15')]===0x1f4){logger[_0xf71b('0x14')](_0xf71b('0x10'),_0x11c094,_0xd2b02e[_0xf71b('0x14')][_0xf71b('0x16')]);return _0x18a9c0(_0xd2b02e[_0xf71b('0x14')][_0xf71b('0x16')]);}logger[_0xf71b('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x11c094,_0xd2b02e[_0xf71b('0x14')][_0xf71b('0x16')]);return _0x261ec8(_0xd2b02e[_0xf71b('0x14')][_0xf71b('0x16')]);}else{logger[_0xf71b('0xf')](_0xf71b('0x10'),_0x11c094,_0xf71b('0x11'));_0x261ec8(_0xd2b02e[_0xf71b('0x17')][_0xf71b('0x16')]);}})[_0xf71b('0x18')](function(_0x2bae66){logger[_0xf71b('0x14')](_0xf71b('0x10'),_0x11c094,_0x2bae66);_0x18a9c0(_0x2bae66);});});}
\ No newline at end of file
+var _0xeb09=['stringify','error','message','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x10ffa8,_0x440d73){var _0x42c4d4=function(_0x37d9a9){while(--_0x37d9a9){_0x10ffa8['push'](_0x10ffa8['shift']());}};_0x42c4d4(++_0x440d73);}(_0xeb09,0x1bd));var _0x9eb0=function(_0x19c204,_0x47782f){_0x19c204=_0x19c204-0x0;var _0x32c1c0=_0xeb09[_0x19c204];return _0x32c1c0;};'use strict';var _=require(_0x9eb0('0x0'));var util=require(_0x9eb0('0x1'));var moment=require(_0x9eb0('0x2'));var BPromise=require('bluebird');var rs=require(_0x9eb0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9eb0('0x4'));var logger=require(_0x9eb0('0x5'))(_0x9eb0('0x6'));var config=require(_0x9eb0('0x7'));var jayson=require(_0x9eb0('0x8'));var client=jayson[_0x9eb0('0x9')][_0x9eb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dbccb,_0x1adb3a,_0x51deba){return new BPromise(function(_0x55fe66,_0x1b981c){return client[_0x9eb0('0xb')](_0x2dbccb,_0x51deba)[_0x9eb0('0xc')](function(_0x1c13ac){logger[_0x9eb0('0xd')](_0x9eb0('0xe'),_0x1adb3a,_0x9eb0('0xf'));logger['debug'](_0x9eb0('0x10'),_0x1adb3a,_0x9eb0('0xf'),JSON[_0x9eb0('0x11')](_0x1c13ac));if(_0x1c13ac[_0x9eb0('0x12')]){if(_0x1c13ac[_0x9eb0('0x12')]['code']===0x1f4){logger['error'](_0x9eb0('0xe'),_0x1adb3a,_0x1c13ac[_0x9eb0('0x12')]['message']);return _0x1b981c(_0x1c13ac[_0x9eb0('0x12')]['message']);}logger['error'](_0x9eb0('0xe'),_0x1adb3a,_0x1c13ac[_0x9eb0('0x12')]['message']);return _0x55fe66(_0x1c13ac[_0x9eb0('0x12')]['message']);}else{logger[_0x9eb0('0xd')](_0x9eb0('0xe'),_0x1adb3a,_0x9eb0('0xf'));_0x55fe66(_0x1c13ac['result'][_0x9eb0('0x13')]);}})[_0x9eb0('0x14')](function(_0x24bc20){logger['error'](_0x9eb0('0xe'),_0x1adb3a,_0x24bc20);_0x1b981c(_0x24bc20);});});}
\ No newline at end of file
index 7589595..6ced668 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c68=['./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1f280b,_0x1072fb){var _0x4cfa7e=function(_0x14761f){while(--_0x14761f){_0x1f280b['push'](_0x1f280b['shift']());}};_0x4cfa7e(++_0x1072fb);}(_0x9c68,0x76));var _0x89c6=function(_0x57f95a,_0x30abd9){_0x57f95a=_0x57f95a-0x0;var _0x28efde=_0x9c68[_0x57f95a];return _0x28efde;};'use strict';var multer=require(_0x89c6('0x0'));var util=require(_0x89c6('0x1'));var path=require(_0x89c6('0x2'));var timeout=require(_0x89c6('0x3'));var express=require(_0x89c6('0x4'));var router=express[_0x89c6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x89c6('0x6'));var interaction=require(_0x89c6('0x7'));var config=require('../../config/environment');var controller=require(_0x89c6('0x8'));router[_0x89c6('0x9')]('/',auth[_0x89c6('0xa')](),controller['index']);router['get'](_0x89c6('0xb'),auth[_0x89c6('0xa')](),controller[_0x89c6('0xc')]);router[_0x89c6('0x9')](_0x89c6('0xd'),auth[_0x89c6('0xa')](),controller[_0x89c6('0xe')]);router[_0x89c6('0xf')]('/',auth['isAuthenticated'](),controller[_0x89c6('0x10')]);router['put'](_0x89c6('0xd'),auth['isAuthenticated'](),controller[_0x89c6('0x11')]);router[_0x89c6('0x12')](_0x89c6('0xd'),auth[_0x89c6('0xa')](),controller[_0x89c6('0x13')]);module[_0x89c6('0x14')]=router;
\ No newline at end of file
+var _0x3546=['/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0x3546,0x119));var _0x6354=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0x3546[_0x1d1963];return _0x3f58bb;};'use strict';var multer=require('multer');var util=require(_0x6354('0x0'));var path=require('path');var timeout=require(_0x6354('0x1'));var express=require(_0x6354('0x2'));var router=express['Router']();var fs_extra=require(_0x6354('0x3'));var auth=require(_0x6354('0x4'));var interaction=require(_0x6354('0x5'));var config=require(_0x6354('0x6'));var controller=require(_0x6354('0x7'));router[_0x6354('0x8')]('/',auth[_0x6354('0x9')](),controller[_0x6354('0xa')]);router['get'](_0x6354('0xb'),auth['isAuthenticated'](),controller[_0x6354('0xc')]);router[_0x6354('0x8')](_0x6354('0xd'),auth[_0x6354('0x9')](),controller[_0x6354('0xe')]);router[_0x6354('0xf')]('/',auth[_0x6354('0x9')](),controller[_0x6354('0x10')]);router[_0x6354('0x11')](_0x6354('0xd'),auth[_0x6354('0x9')](),controller[_0x6354('0x12')]);router['delete']('/:id',auth[_0x6354('0x9')](),controller[_0x6354('0x13')]);module[_0x6354('0x14')]=router;
\ No newline at end of file
index e58969d..7d8e969 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1666=['Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','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.','website_alias','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip'];(function(_0x4d96be,_0x24cc0f){var _0x5c2a43=function(_0x17d40e){while(--_0x17d40e){_0x4d96be['push'](_0x4d96be['shift']());}};_0x5c2a43(++_0x24cc0f);}(_0x1666,0x188));var _0x6166=function(_0x376303,_0x4875ef){_0x376303=_0x376303-0x0;var _0x3fd1ad=_0x1666[_0x376303];return _0x3fd1ad;};'use strict';var Sequelize=require(_0x6166('0x0'));var rs=require(_0x6166('0x1'));module[_0x6166('0x2')]={'name':{'type':Sequelize[_0x6166('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6166('0x4')},'description':{'type':Sequelize[_0x6166('0x3')]},'mapKey':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x5')},'key':{'type':Sequelize[_0x6166('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x6')},'customerAlias':{'type':Sequelize[_0x6166('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6166('0x3')],'allowNull':![],'defaultValue':_0x6166('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6166('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6166('0x3')],'allowNull':![],'defaultValue':_0x6166('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6166('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x6166('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6166('0xb')](_0x6166('0xc'),_0x6166('0xd')),'defaultValue':_0x6166('0xc')},'header_online':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0xe')},'start_chat_button':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0xf')},'offline_chat_button':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x10')},'header_offline':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x11')},'download_transcript':{'type':Sequelize[_0x6166('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6166('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6166('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6166('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x6166('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6166('0x15')},'noteTitle':{'type':Sequelize[_0x6166('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6166('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x10')},'skipMessageButton':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x18')},'ratingType':{'type':Sequelize[_0x6166('0xb')](_0x6166('0x19'),_0x6166('0x1a')),'defaultValue':_0x6166('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x6166('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6166('0x12')],'defaultValue':function(){return JSON[_0x6166('0x1b')]({'items':[{'type':_0x6166('0x1c'),'variable':null,'config':{'placeholder':_0x6166('0x1d'),'type':_0x6166('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6166('0x5'),'type':_0x6166('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6166('0x1f')](_0x6166('0x20'))?JSON[_0x6166('0x21')](this[_0x6166('0x1f')](_0x6166('0x20'))):{};},'set':function(_0x8720b8){return this['setDataValue']('onlineForm',JSON[_0x6166('0x1b')](_0x8720b8));}},'offlineForm':{'type':Sequelize[_0x6166('0x12')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x6166('0x1c'),'props':{'title':_0x6166('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6166('0x5'),'type':_0x6166('0x5')},'variable':null},{'type':_0x6166('0x22'),'config':{'placeholder':_0x6166('0x23')},'props':{'title':_0x6166('0x23'),'helpText':_0x6166('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6166('0x25'))?JSON[_0x6166('0x21')](this['getDataValue'](_0x6166('0x25'))):{};},'set':function(_0x44e057){return this[_0x6166('0x26')](_0x6166('0x25'),JSON[_0x6166('0x1b')](_0x44e057));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6166('0x27')]();}},'autoclose':{'type':Sequelize[_0x6166('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6166('0x3')]},'forwardOffline':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6166('0x3')]},'waitingTitle':{'type':Sequelize[_0x6166('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x29')},'offlineMessageBody':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x2a')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x2b')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6166('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x10')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6166('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6166('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6166('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6166('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6166('0x3')],'defaultValue':_0x6166('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6166('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6166('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x6166('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6166('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6166('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6166('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6166('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6166('0x2e')},'systemAvatar':{'type':Sequelize[_0x6166('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6166('0x9')],'comment':_0x6166('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x129524){if(!_0x129524)this['setDataValue'](_0x6166('0x30'),null);this[_0x6166('0x26')](_0x6166('0x31'),_0x129524);}},'vidaooEscalation':{'type':Sequelize[_0x6166('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x6166('0x3')],'allowNull':![],'defaultValue':_0x6166('0x32')},'vidaooNote':{'type':Sequelize[_0x6166('0x3')],'defaultValue':function(){return _0x6166('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x6166('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6166('0x12')]}};
\ No newline at end of file
+var _0x10f2=['exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','star','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','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.','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','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10f2,0x137));var _0x210f=function(_0x102df7,_0x313ea0){_0x102df7=_0x102df7-0x0;var _0xbe68ca=_0x10f2[_0x102df7];return _0xbe68ca;};'use strict';var Sequelize=require(_0x210f('0x0'));var rs=require('randomstring');module[_0x210f('0x1')]={'name':{'type':Sequelize[_0x210f('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'unique':_0x210f('0x3')},'description':{'type':Sequelize[_0x210f('0x2')]},'mapKey':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x5')},'customerAlias':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'defaultValue':_0x210f('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'defaultValue':_0x210f('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x210f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x210f('0x2')]},'animation':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x210f('0xa')](_0x210f('0xb'),_0x210f('0xc')),'defaultValue':_0x210f('0xb')},'header_online':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0xe')},'offline_chat_button':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0xf')},'download_transcript':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x210f('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x12')},'noteTitle':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x13')},'placeholderMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x14')},'closingMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x15')},'skipMessageButton':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x16')},'conditionAgreement':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x210f('0xa')]('star','thumb'),'defaultValue':_0x210f('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x210f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x210f('0x11')],'defaultValue':function(){return JSON[_0x210f('0x18')]({'items':[{'type':_0x210f('0x19'),'variable':null,'config':{'placeholder':_0x210f('0x1a'),'type':_0x210f('0x1b'),'required':!![]},'props':{'title':_0x210f('0x1a'),'helpText':''}},{'type':_0x210f('0x19'),'props':{'title':_0x210f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x210f('0x4'),'type':_0x210f('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x210f('0x1c')](_0x210f('0x1d'))?JSON['parse'](this[_0x210f('0x1c')](_0x210f('0x1d'))):{};},'set':function(_0x2f72e4){return this[_0x210f('0x1e')]('onlineForm',JSON[_0x210f('0x18')](_0x2f72e4));}},'offlineForm':{'type':Sequelize[_0x210f('0x11')],'defaultValue':function(){return JSON[_0x210f('0x18')]({'items':[{'type':_0x210f('0x19'),'props':{'title':_0x210f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x210f('0x4'),'type':_0x210f('0x4')},'variable':null},{'type':_0x210f('0x1f'),'config':{'placeholder':_0x210f('0x20')},'props':{'title':_0x210f('0x20'),'helpText':_0x210f('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x210f('0x1c')](_0x210f('0x22'))?JSON[_0x210f('0x23')](this[_0x210f('0x1c')](_0x210f('0x22'))):{};},'set':function(_0x8d618e){return this[_0x210f('0x1e')](_0x210f('0x22'),JSON['stringify'](_0x8d618e));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x210f('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x24')},'waitingMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x26')},'offlineMessageBody':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x16')},'sendUnmanaged':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x210f('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x210f('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x210f('0x29');}},'notificationSound':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x210f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x2b')},'verticalAlignment':{'type':Sequelize[_0x210f('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x2c')},'defaultTitle':{'type':Sequelize[_0x210f('0x2')]},'customerAvatar':{'type':Sequelize[_0x210f('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x210f('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x210f('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x210f('0x8')],'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[_0x210f('0x2')],'defaultValue':_0x210f('0x2e')},'systemAvatar':{'type':Sequelize[_0x210f('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x210f('0x8')],'comment':_0x210f('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![],'comment':_0x210f('0x30'),'set':function(_0x432b50){if(!_0x432b50)this[_0x210f('0x1e')](_0x210f('0x31'),null);this[_0x210f('0x1e')]('mandatoryDisposition',_0x432b50);}},'vidaooEscalation':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x210f('0x2')]},'vidaooTopic':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'defaultValue':_0x210f('0x32')},'vidaooNote':{'type':Sequelize[_0x210f('0x2')],'defaultValue':function(){return _0x210f('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x210f('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x210f('0x11')]}};
\ No newline at end of file
index 3610af7..995e8be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad01=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','join','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','list','applications','orderBy','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','files','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','textColor','color_button','backgroundColor','addApplications','ChatApplication','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./chatWebsite.socket','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','status','offset','undefined','count','limit','set','json','apply','reject','update','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','fields','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','find'];(function(_0x4f9a8c,_0x1a7296){var _0x1d7aca=function(_0x227494){while(--_0x227494){_0x4f9a8c['push'](_0x4f9a8c['shift']());}};_0x1d7aca(++_0x1a7296);}(_0xad01,0xd3));var _0x1ad0=function(_0x322f57,_0x2edc00){_0x322f57=_0x322f57-0x0;var _0x30a911=_0xad01[_0x322f57];return _0x30a911;};'use strict';var emlformat=require(_0x1ad0('0x0'));var rimraf=require(_0x1ad0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ad0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1ad0('0x3'));var Mustache=require(_0x1ad0('0x4'));var util=require(_0x1ad0('0x5'));var path=require('path');var sox=require(_0x1ad0('0x6'));var csv=require(_0x1ad0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ad0('0x8'));var _=require(_0x1ad0('0x9'));var squel=require('squel');var crypto=require(_0x1ad0('0xa'));var jsforce=require(_0x1ad0('0xb'));var deskjs=require(_0x1ad0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1ad0('0xd'));var Papa=require(_0x1ad0('0xe'));var Redis=require('ioredis');var authService=require(_0x1ad0('0xf'));var qs=require(_0x1ad0('0x10'));var as=require(_0x1ad0('0x11'));var hardwareService=require(_0x1ad0('0x12'));var logger=require(_0x1ad0('0x13'))(_0x1ad0('0x14'));var utils=require(_0x1ad0('0x15'));var config=require(_0x1ad0('0x16'));var licenseUtil=require(_0x1ad0('0x17'));var db=require(_0x1ad0('0x18'))['db'];config['redis']=_[_0x1ad0('0x19')](config['redis'],{'host':_0x1ad0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ad0('0x1b')]));require(_0x1ad0('0x1c'))['register'](socket);var jayson=require(_0x1ad0('0x1d'));var client=jayson[_0x1ad0('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x1ad0('0x1e')][_0x1ad0('0x1f')]({'port':0x232a});var client9003=jayson[_0x1ad0('0x1e')][_0x1ad0('0x1f')]({'port':0x232b});var client9001=jayson[_0x1ad0('0x1e')][_0x1ad0('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x117533,_0x102465,_0x5dd739,_0x1ca6c1){return new BPromise(function(_0x2af7d0,_0x4f6085){var _0x275523=_0x1ca6c1||client;return _0x275523[_0x1ad0('0x20')](_0x117533,_0x5dd739)[_0x1ad0('0x21')](function(_0x565471){logger['info'](_0x1ad0('0x22'),_0x102465,'request\x20sent');logger[_0x1ad0('0x23')](_0x1ad0('0x24'),_0x102465,'request\x20sent',JSON[_0x1ad0('0x25')](_0x565471));if(_0x565471[_0x1ad0('0x26')]){if(_0x565471[_0x1ad0('0x26')][_0x1ad0('0x27')]===0x1f4){logger[_0x1ad0('0x26')](_0x1ad0('0x22'),_0x102465,_0x565471[_0x1ad0('0x26')]['message']);return _0x4f6085(_0x565471[_0x1ad0('0x26')][_0x1ad0('0x28')]);}logger[_0x1ad0('0x26')](_0x1ad0('0x22'),_0x102465,_0x565471[_0x1ad0('0x26')][_0x1ad0('0x28')]);return _0x2af7d0(_0x565471[_0x1ad0('0x26')][_0x1ad0('0x28')]);}else{logger[_0x1ad0('0x29')](_0x1ad0('0x22'),_0x102465,_0x1ad0('0x2a'));_0x2af7d0(_0x565471['result'][_0x1ad0('0x28')]);}})['catch'](function(_0x431765){logger[_0x1ad0('0x26')](_0x1ad0('0x22'),_0x102465,_0x431765);_0x4f6085(_0x431765);});});}function respondWithStatusCode(_0x2d656d,_0x1c6646){_0x1c6646=_0x1c6646||0xcc;return function(_0x23f2d4){if(_0x23f2d4){return _0x2d656d['sendStatus'](_0x1c6646);}return _0x2d656d[_0x1ad0('0x2b')](_0x1c6646)['end']();};}function respondWithResult(_0x855e2c,_0x6df643){_0x6df643=_0x6df643||0xc8;return function(_0x4f9d09){if(_0x4f9d09){return _0x855e2c['status'](_0x6df643)['json'](_0x4f9d09);}};}function respondWithFilteredResult(_0x199bc7,_0x1a3c1e){return function(_0x468ad7){if(_0x468ad7){var _0x15cfa7=typeof _0x1a3c1e[_0x1ad0('0x2c')]===_0x1ad0('0x2d')&&typeof _0x1a3c1e['limit']==='undefined';var _0x442ce8=_0x468ad7[_0x1ad0('0x2e')];var _0x340aec=_0x15cfa7?0x0:_0x1a3c1e[_0x1ad0('0x2c')];var _0x5893d4=_0x15cfa7?_0x468ad7[_0x1ad0('0x2e')]:_0x1a3c1e[_0x1ad0('0x2c')]+_0x1a3c1e[_0x1ad0('0x2f')];var _0x5e43af;if(_0x5893d4>=_0x442ce8){_0x5893d4=_0x442ce8;_0x5e43af=0xc8;}else{_0x5e43af=0xce;}_0x199bc7[_0x1ad0('0x2b')](_0x5e43af);return _0x199bc7[_0x1ad0('0x30')]('Content-Range',_0x340aec+'-'+_0x5893d4+'/'+_0x442ce8)[_0x1ad0('0x31')](_0x468ad7);}return null;};}function patchUpdates(_0x5efc55){return function(_0x59b645){try{jsonpatch[_0x1ad0('0x32')](_0x59b645,_0x5efc55,!![]);}catch(_0x1fd98e){return BPromise[_0x1ad0('0x33')](_0x1fd98e);}return _0x59b645['save']();};}function saveUpdates(_0x584b45,_0xce6e1c){return function(_0x2f1c5c){if(_0x2f1c5c){return _0x2f1c5c[_0x1ad0('0x34')](_0x584b45)[_0x1ad0('0x21')](function(_0x35585a){return _0x35585a;});}return null;};}function removeEntity(_0x5d9224,_0x1196ab){return function(_0x2cccc0){if(_0x2cccc0){return _0x2cccc0['destroy']()['then'](function(){var _0x290fc5=_0x2cccc0[_0x1ad0('0x35')]({'plain':!![]});var _0x33ea82='ChatWebsites';return db[_0x1ad0('0x36')]['destroy']({'where':{'type':_0x33ea82,'resourceId':_0x290fc5['id']}})[_0x1ad0('0x21')](function(){return _0x2cccc0;});})[_0x1ad0('0x21')](function(){_0x5d9224[_0x1ad0('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x294140,_0xd4e997){return function(_0x1ffa1c){if(!_0x1ffa1c){_0x294140[_0x1ad0('0x37')](0x194);}return _0x1ffa1c;};}function handleError(_0x4fbc08,_0x26496b){_0x26496b=_0x26496b||0x1f4;return function(_0x41a9cb){logger[_0x1ad0('0x26')](_0x41a9cb[_0x1ad0('0x38')]);if(_0x41a9cb['name']){delete _0x41a9cb[_0x1ad0('0x39')];}_0x4fbc08[_0x1ad0('0x2b')](_0x26496b)[_0x1ad0('0x3a')](_0x41a9cb);};}exports[_0x1ad0('0x3b')]=function(_0x4e883e,_0x4e4d4d){var _0x288d85={'include':[{'model':db[_0x1ad0('0x3c')],'as':_0x1ad0('0x3d')}]},_0x1bb7af={},_0x6bf1e1={'count':0x0,'rows':[]};var _0x58f71d=_[_0x1ad0('0x3e')](db[_0x1ad0('0x3f')]['rawAttributes'],function(_0x2a76e7){return{'name':_0x2a76e7[_0x1ad0('0x40')],'type':_0x2a76e7[_0x1ad0('0x41')][_0x1ad0('0x42')]};});_0x1bb7af[_0x1ad0('0x43')]=_['map'](_0x58f71d,_0x1ad0('0x39'));_0x1bb7af[_0x1ad0('0x44')]=_['keys'](_0x4e883e[_0x1ad0('0x44')]);_0x1bb7af[_0x1ad0('0x45')]=_[_0x1ad0('0x46')](_0x1bb7af['model'],_0x1bb7af[_0x1ad0('0x44')]);_0x288d85[_0x1ad0('0x47')]=_[_0x1ad0('0x46')](_0x1bb7af[_0x1ad0('0x43')],qs['fields'](_0x4e883e[_0x1ad0('0x44')]['fields']));_0x288d85['attributes']=_0x288d85[_0x1ad0('0x47')]['length']?_0x288d85[_0x1ad0('0x47')]:_0x1bb7af[_0x1ad0('0x43')];if(!_0x4e883e[_0x1ad0('0x44')][_0x1ad0('0x48')](_0x1ad0('0x49'))){_0x288d85['limit']=qs[_0x1ad0('0x2f')](_0x4e883e['query'][_0x1ad0('0x2f')]);_0x288d85[_0x1ad0('0x2c')]=qs[_0x1ad0('0x2c')](_0x4e883e[_0x1ad0('0x44')]['offset']);}_0x288d85[_0x1ad0('0x4a')]=qs['sort'](_0x4e883e['query'][_0x1ad0('0x4b')]);_0x288d85['where']=qs[_0x1ad0('0x45')](_[_0x1ad0('0x4c')](_0x4e883e[_0x1ad0('0x44')],_0x1bb7af[_0x1ad0('0x45')]),_0x58f71d);if(_0x4e883e[_0x1ad0('0x44')][_0x1ad0('0x4d')]){_0x288d85['where']=_[_0x1ad0('0x4e')](_0x288d85['where'],{'$or':_['map'](_0x58f71d,function(_0x360f32){if(_0x360f32[_0x1ad0('0x41')]!==_0x1ad0('0x4f')){var _0x453a1f={};_0x453a1f[_0x360f32['name']]={'$like':'%'+_0x4e883e[_0x1ad0('0x44')][_0x1ad0('0x4d')]+'%'};return _0x453a1f;}})});}_0x288d85=_[_0x1ad0('0x4e')]({},_0x288d85,_0x4e883e['options']);var _0x4c0ff4={'where':_0x288d85[_0x1ad0('0x50')]};return db[_0x1ad0('0x3f')][_0x1ad0('0x2e')](_0x4c0ff4)[_0x1ad0('0x21')](function(_0x3ea744){_0x6bf1e1['count']=_0x3ea744;if(_0x4e883e['query'][_0x1ad0('0x51')]){_0x288d85[_0x1ad0('0x52')]=[{'all':!![]}];}return db[_0x1ad0('0x3f')][_0x1ad0('0x53')](_0x288d85);})['then'](function(_0x281429){_0x6bf1e1[_0x1ad0('0x54')]=_0x281429;return _0x6bf1e1;})[_0x1ad0('0x21')](respondWithFilteredResult(_0x4e4d4d,_0x288d85))[_0x1ad0('0x55')](handleError(_0x4e4d4d,null));};exports['show']=function(_0x392218,_0x4d19a3){var _0x4373c1={'raw':![],'where':{'id':_0x392218[_0x1ad0('0x56')]['id']},'include':[{'model':db[_0x1ad0('0x3c')],'as':_0x1ad0('0x3d')}]},_0xe50f05={};_0xe50f05['model']=_[_0x1ad0('0x57')](db['ChatWebsite'][_0x1ad0('0x58')]);_0xe50f05['query']=_[_0x1ad0('0x57')](_0x392218[_0x1ad0('0x44')]);_0xe50f05[_0x1ad0('0x45')]=_['intersection'](_0xe50f05[_0x1ad0('0x43')],_0xe50f05[_0x1ad0('0x44')]);_0x4373c1[_0x1ad0('0x47')]=_[_0x1ad0('0x46')](_0xe50f05[_0x1ad0('0x43')],qs[_0x1ad0('0x59')](_0x392218[_0x1ad0('0x44')][_0x1ad0('0x59')]));_0x4373c1[_0x1ad0('0x47')]=_0x4373c1[_0x1ad0('0x47')][_0x1ad0('0x5a')]?_0x4373c1['attributes']:_0xe50f05[_0x1ad0('0x43')];if(_0x392218[_0x1ad0('0x44')][_0x1ad0('0x51')]){_0x4373c1['include']=[{'all':!![]}];}_0x4373c1=_[_0x1ad0('0x4e')]({},_0x4373c1,_0x392218[_0x1ad0('0x5b')]);return db['ChatWebsite']['find'](_0x4373c1)[_0x1ad0('0x21')](handleEntityNotFound(_0x4d19a3,null))[_0x1ad0('0x21')](respondWithResult(_0x4d19a3,null))[_0x1ad0('0x55')](handleError(_0x4d19a3,null));};exports[_0x1ad0('0x5c')]=function(_0x4ffc2c,_0x1e0e14){return db[_0x1ad0('0x3f')]['create'](_0x4ffc2c[_0x1ad0('0x5d')],{})['then'](function(_0x4be9c1){var _0x3b9903=_0x4ffc2c[_0x1ad0('0x5e')][_0x1ad0('0x35')]({'plain':!![]});if(!_0x3b9903)throw new Error(_0x1ad0('0x5f'));if(_0x3b9903['role']===_0x1ad0('0x5e')){var _0x48e1c5=_0x4be9c1[_0x1ad0('0x35')]({'plain':!![]});var _0x309cc6=_0x1ad0('0x60');return db[_0x1ad0('0x61')][_0x1ad0('0x62')]({'where':{'name':_0x309cc6,'userProfileId':_0x3b9903[_0x1ad0('0x63')]},'raw':!![]})[_0x1ad0('0x21')](function(_0xac7492){if(_0xac7492&&_0xac7492[_0x1ad0('0x64')]===0x0){return db[_0x1ad0('0x36')]['create']({'name':_0x48e1c5['name'],'resourceId':_0x48e1c5['id'],'type':_0xac7492[_0x1ad0('0x39')],'sectionId':_0xac7492['id']},{})[_0x1ad0('0x21')](function(){return _0x4be9c1;});}else{return _0x4be9c1;}})['catch'](function(_0x15ddc8){logger[_0x1ad0('0x26')](_0x1ad0('0x65'),_0x15ddc8);throw _0x15ddc8;});}return _0x4be9c1;})[_0x1ad0('0x21')](respondWithResult(_0x1e0e14,0xc9))[_0x1ad0('0x55')](handleError(_0x1e0e14,null));};exports[_0x1ad0('0x34')]=function(_0x37d747,_0x57adc8){if(_0x37d747[_0x1ad0('0x5d')]['id']){delete _0x37d747[_0x1ad0('0x5d')]['id'];}return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'where':{'id':_0x37d747[_0x1ad0('0x56')]['id']},'include':[{'model':db[_0x1ad0('0x3c')],'as':_0x1ad0('0x3d')}]})['then'](handleEntityNotFound(_0x57adc8,null))[_0x1ad0('0x21')](saveUpdates(_0x37d747[_0x1ad0('0x5d')],null))['then'](respondWithResult(_0x57adc8,null))[_0x1ad0('0x55')](handleError(_0x57adc8,null));};exports[_0x1ad0('0x66')]=function(_0xbbf8cc,_0x390e6f){return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'where':{'id':_0xbbf8cc['params']['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x390e6f,null))[_0x1ad0('0x21')](removeEntity(_0x390e6f,null))[_0x1ad0('0x55')](handleError(_0x390e6f,null));};exports[_0x1ad0('0x67')]=function(_0x29ba8e,_0x5af6ff){return db['ChatWebsite'][_0x1ad0('0x67')]()[_0x1ad0('0x21')](respondWithResult(_0x5af6ff,null))[_0x1ad0('0x55')](handleError(_0x5af6ff,null));};exports[_0x1ad0('0x68')]=function(_0x5808b5,_0x2de376,_0x9be3e7){if(_0x5808b5[_0x1ad0('0x5d')]['id']){delete _0x5808b5[_0x1ad0('0x5d')]['id'];}return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'where':{'id':_0x5808b5[_0x1ad0('0x56')]['id']}})['then'](handleEntityNotFound(_0x2de376,null))[_0x1ad0('0x21')](function(_0xa050d){if(_0xa050d){_0x5808b5[_0x1ad0('0x5d')][_0x1ad0('0x69')]=_0xa050d['id'];return db[_0x1ad0('0x6a')][_0x1ad0('0x5c')](_0x5808b5[_0x1ad0('0x5d')]);}})['then'](respondWithResult(_0x2de376,null))[_0x1ad0('0x55')](handleError(_0x2de376,null));};exports[_0x1ad0('0x6b')]=function(_0x6b0b12,_0x2905f3,_0xbe6f62){var _0x2b6063={'raw':![],'where':{}};var _0x4279bb={};var _0x433cbc={'count':0x0,'rows':[]};return db[_0x1ad0('0x3f')]['findOne']({'where':{'id':_0x6b0b12[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x2905f3,null))[_0x1ad0('0x21')](function(_0x329610){if(_0x329610){_0x4279bb[_0x1ad0('0x43')]=_['keys'](db['Disposition'][_0x1ad0('0x58')]);_0x4279bb['query']=_[_0x1ad0('0x57')](_0x6b0b12[_0x1ad0('0x44')]);_0x4279bb['filters']=_[_0x1ad0('0x46')](_0x4279bb['model'],_0x4279bb['query']);_0x2b6063[_0x1ad0('0x47')]=_[_0x1ad0('0x46')](_0x4279bb[_0x1ad0('0x43')],qs[_0x1ad0('0x59')](_0x6b0b12[_0x1ad0('0x44')][_0x1ad0('0x59')]));_0x2b6063[_0x1ad0('0x47')]=_0x2b6063['attributes'][_0x1ad0('0x5a')]?_0x2b6063[_0x1ad0('0x47')]:_0x4279bb[_0x1ad0('0x43')];if(!_0x6b0b12[_0x1ad0('0x44')][_0x1ad0('0x48')](_0x1ad0('0x49'))){_0x2b6063['limit']=qs[_0x1ad0('0x2f')](_0x6b0b12['query']['limit']);_0x2b6063[_0x1ad0('0x2c')]=qs['offset'](_0x6b0b12[_0x1ad0('0x44')][_0x1ad0('0x2c')]);}_0x2b6063[_0x1ad0('0x4a')]=qs['sort'](_0x6b0b12[_0x1ad0('0x44')]['sort']);_0x2b6063[_0x1ad0('0x50')]=qs[_0x1ad0('0x45')](_[_0x1ad0('0x4c')](_0x6b0b12[_0x1ad0('0x44')],_0x4279bb['filters']));_0x2b6063[_0x1ad0('0x50')][_0x1ad0('0x69')]=_0x329610['id'];if(_0x6b0b12[_0x1ad0('0x44')][_0x1ad0('0x4d')]){_0x2b6063['where']=_['merge'](_0x2b6063['where'],{'$or':_[_0x1ad0('0x3e')](_0x2b6063['attributes'],function(_0x2e587d){var _0x4e6bdd={};_0x4e6bdd[_0x2e587d]={'$like':'%'+_0x6b0b12[_0x1ad0('0x44')][_0x1ad0('0x4d')]+'%'};return _0x4e6bdd;})});}_0x2b6063=_[_0x1ad0('0x4e')]({},_0x2b6063,_0x6b0b12[_0x1ad0('0x5b')]);return db[_0x1ad0('0x6a')][_0x1ad0('0x2e')]({'where':_0x2b6063[_0x1ad0('0x50')]})[_0x1ad0('0x21')](function(_0x21c9ac){_0x433cbc[_0x1ad0('0x2e')]=_0x21c9ac;if(_0x6b0b12[_0x1ad0('0x44')][_0x1ad0('0x51')]){_0x2b6063[_0x1ad0('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x1ad0('0x53')](_0x2b6063);})[_0x1ad0('0x21')](function(_0x4477ad){_0x433cbc[_0x1ad0('0x54')]=_0x4477ad;return _0x433cbc;});}})[_0x1ad0('0x21')](respondWithFilteredResult(_0x2905f3,_0x2b6063))['catch'](handleError(_0x2905f3,null));};exports[_0x1ad0('0x6c')]=function(_0x38f3d3,_0x13c6fd,_0x110d6e){return db['ChatWebsite'][_0x1ad0('0x62')]({'where':{'id':_0x38f3d3[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x13c6fd,null))[_0x1ad0('0x21')](function(_0x582da1){if(_0x582da1){return _0x582da1[_0x1ad0('0x6c')](_0x38f3d3['query'][_0x1ad0('0x6d')]);}})[_0x1ad0('0x21')](respondWithStatusCode(_0x13c6fd,null))[_0x1ad0('0x55')](handleError(_0x13c6fd,null));};exports[_0x1ad0('0x6e')]=function(_0x2a8a31,_0x2449a2,_0x106199){if(_0x2a8a31[_0x1ad0('0x5d')]['id']){delete _0x2a8a31[_0x1ad0('0x5d')]['id'];}return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'where':{'id':_0x2a8a31[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x2449a2,null))[_0x1ad0('0x21')](function(_0x5b4720){if(_0x5b4720){_0x2a8a31[_0x1ad0('0x5d')][_0x1ad0('0x69')]=_0x5b4720['id'];return db[_0x1ad0('0x6f')][_0x1ad0('0x5c')](_0x2a8a31[_0x1ad0('0x5d')]);}})[_0x1ad0('0x21')](respondWithResult(_0x2449a2,null))[_0x1ad0('0x55')](handleError(_0x2449a2,null));};exports[_0x1ad0('0x70')]=function(_0x262aa2,_0x4ef416,_0xd4c2f3){var _0x1805ae={'raw':![],'where':{}};var _0x5200eb={};var _0x367226={'count':0x0,'rows':[]};return db[_0x1ad0('0x3f')]['findOne']({'where':{'id':_0x262aa2['params']['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x4ef416,null))[_0x1ad0('0x21')](function(_0x1d8f07){if(_0x1d8f07){_0x5200eb[_0x1ad0('0x43')]=_[_0x1ad0('0x57')](db[_0x1ad0('0x6f')][_0x1ad0('0x58')]);_0x5200eb[_0x1ad0('0x44')]=_[_0x1ad0('0x57')](_0x262aa2[_0x1ad0('0x44')]);_0x5200eb[_0x1ad0('0x45')]=_[_0x1ad0('0x46')](_0x5200eb['model'],_0x5200eb['query']);_0x1805ae[_0x1ad0('0x47')]=_['intersection'](_0x5200eb[_0x1ad0('0x43')],qs[_0x1ad0('0x59')](_0x262aa2[_0x1ad0('0x44')][_0x1ad0('0x59')]));_0x1805ae[_0x1ad0('0x47')]=_0x1805ae[_0x1ad0('0x47')][_0x1ad0('0x5a')]?_0x1805ae[_0x1ad0('0x47')]:_0x5200eb[_0x1ad0('0x43')];if(!_0x262aa2[_0x1ad0('0x44')][_0x1ad0('0x48')]('nolimit')){_0x1805ae[_0x1ad0('0x2f')]=qs[_0x1ad0('0x2f')](_0x262aa2[_0x1ad0('0x44')][_0x1ad0('0x2f')]);_0x1805ae[_0x1ad0('0x2c')]=qs['offset'](_0x262aa2[_0x1ad0('0x44')]['offset']);}_0x1805ae[_0x1ad0('0x4a')]=qs[_0x1ad0('0x4b')](_0x262aa2[_0x1ad0('0x44')][_0x1ad0('0x4b')]);_0x1805ae[_0x1ad0('0x50')]=qs[_0x1ad0('0x45')](_[_0x1ad0('0x4c')](_0x262aa2[_0x1ad0('0x44')],_0x5200eb[_0x1ad0('0x45')]));_0x1805ae[_0x1ad0('0x50')][_0x1ad0('0x69')]=_0x1d8f07['id'];if(_0x262aa2[_0x1ad0('0x44')][_0x1ad0('0x4d')]){_0x1805ae[_0x1ad0('0x50')]=_[_0x1ad0('0x4e')](_0x1805ae['where'],{'$or':_[_0x1ad0('0x3e')](_0x1805ae['attributes'],function(_0x503f49){var _0x3b76ea={};_0x3b76ea[_0x503f49]={'$like':'%'+_0x262aa2[_0x1ad0('0x44')][_0x1ad0('0x4d')]+'%'};return _0x3b76ea;})});}_0x1805ae=_[_0x1ad0('0x4e')]({},_0x1805ae,_0x262aa2[_0x1ad0('0x5b')]);return db[_0x1ad0('0x6f')]['count']({'where':_0x1805ae[_0x1ad0('0x50')]})[_0x1ad0('0x21')](function(_0x12b1f9){_0x367226[_0x1ad0('0x2e')]=_0x12b1f9;if(_0x262aa2[_0x1ad0('0x44')]['includeAll']){_0x1805ae[_0x1ad0('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1ad0('0x53')](_0x1805ae);})[_0x1ad0('0x21')](function(_0x16bf5f){_0x367226[_0x1ad0('0x54')]=_0x16bf5f;return _0x367226;});}})['then'](respondWithFilteredResult(_0x4ef416,_0x1805ae))[_0x1ad0('0x55')](handleError(_0x4ef416,null));};exports[_0x1ad0('0x71')]=function(_0x3561af,_0x214e2a,_0xc3c893){return db[_0x1ad0('0x3f')]['find']({'where':{'id':_0x3561af[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x214e2a,null))['then'](function(_0x27f09e){if(_0x27f09e){return _0x27f09e[_0x1ad0('0x71')](_0x3561af[_0x1ad0('0x44')]['ids']);}})[_0x1ad0('0x21')](respondWithStatusCode(_0x214e2a,null))['catch'](handleError(_0x214e2a,null));};exports[_0x1ad0('0x72')]=function(_0x17aa2e,_0x58a4c9,_0x599606){_0x17aa2e[_0x1ad0('0x5d')][_0x1ad0('0x73')]=_0x17aa2e[_0x1ad0('0x74')][_0x1ad0('0x75')];return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'where':{'id':_0x17aa2e[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x58a4c9,null))[_0x1ad0('0x21')](saveUpdates(_0x17aa2e[_0x1ad0('0x5d')],null))['then'](respondWithResult(_0x58a4c9,null))[_0x1ad0('0x55')](handleError(_0x58a4c9,null));};exports[_0x1ad0('0x76')]=function(_0x565c5a,_0xd226ba,_0xfca0e8){_0x565c5a[_0x1ad0('0x5d')][_0x1ad0('0x77')]=_0x565c5a[_0x1ad0('0x74')][_0x1ad0('0x75')];return db[_0x1ad0('0x3f')]['find']({'where':{'id':_0x565c5a[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0xd226ba,null))[_0x1ad0('0x21')](saveUpdates(_0x565c5a['body'],null))['then'](respondWithResult(_0xd226ba,null))[_0x1ad0('0x55')](handleError(_0xd226ba,null));};exports[_0x1ad0('0x78')]=function(_0x4b0b11,_0x28a914,_0x588886){_0x4b0b11[_0x1ad0('0x5d')][_0x1ad0('0x79')]=_0x4b0b11[_0x1ad0('0x74')][_0x1ad0('0x75')];return db[_0x1ad0('0x3f')]['find']({'where':{'id':_0x4b0b11['params']['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x28a914,null))['then'](saveUpdates(_0x4b0b11[_0x1ad0('0x5d')],null))['then'](respondWithResult(_0x28a914,null))['catch'](handleError(_0x28a914,null));};exports[_0x1ad0('0x7a')]=function(_0x738380,_0x53f7ea,_0x3dbeaa){_0x738380[_0x1ad0('0x5d')]['systemAvatar']=_0x738380[_0x1ad0('0x74')][_0x1ad0('0x75')];return db['ChatWebsite'][_0x1ad0('0x62')]({'where':{'id':_0x738380['params']['id']}})['then'](handleEntityNotFound(_0x53f7ea,null))[_0x1ad0('0x21')](saveUpdates(_0x738380[_0x1ad0('0x5d')],null))[_0x1ad0('0x21')](respondWithResult(_0x53f7ea,null))['catch'](handleError(_0x53f7ea,null));};exports['getLogo']=function(_0x26bdd3,_0x3e7c0c,_0x1a6f38){var _0x4ffcf6=path[_0x1ad0('0x7b')](config['root'],_0x1ad0('0x7c'));var _0x1f5936={'where':{'id':_0x26bdd3[_0x1ad0('0x56')]['id']},'attributes':['id',_0x1ad0('0x73')],'raw':!![]};var _0x2fd547=![];return require(_0x1ad0('0x17'))[_0x1ad0('0x7d')]()[_0x1ad0('0x21')](function(_0x30125a){if(_0x30125a){_0x2fd547=_0x30125a[_0x1ad0('0x7e')];}})[_0x1ad0('0x21')](function(){return db[_0x1ad0('0x3f')][_0x1ad0('0x62')](_0x1f5936);})['then'](handleEntityNotFound(_0x3e7c0c,null))[_0x1ad0('0x21')](function(_0x34788c){if(_0x34788c){if(!_[_0x1ad0('0x7f')](_0x34788c[_0x1ad0('0x73')])){if(fs[_0x1ad0('0x80')](path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0x82'),_0x34788c[_0x1ad0('0x73')]))&&_0x2fd547){_0x4ffcf6=path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0x82'),_0x34788c[_0x1ad0('0x73')]);}}return _0x3e7c0c[_0x1ad0('0x83')](_0x4ffcf6);}})[_0x1ad0('0x55')](handleError(_0x3e7c0c,null));};exports[_0x1ad0('0x84')]=function(_0x15732c,_0x358f22,_0x21eeed){var _0x52a51b=path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],'server/files/images/avatars/default_avatar.png');var _0x81dfe8={'where':{'id':_0x15732c[_0x1ad0('0x56')]['id']},'attributes':['id',_0x1ad0('0x77')],'raw':!![]};return db[_0x1ad0('0x3f')][_0x1ad0('0x62')](_0x81dfe8)[_0x1ad0('0x21')](handleEntityNotFound(_0x358f22,null))[_0x1ad0('0x21')](function(_0x5e9e4a){if(_0x5e9e4a){if(!_[_0x1ad0('0x7f')](_0x5e9e4a[_0x1ad0('0x77')])){if(fs[_0x1ad0('0x80')](path['join'](config[_0x1ad0('0x81')],_0x1ad0('0x85'),_0x5e9e4a[_0x1ad0('0x77')]))){_0x52a51b=path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0x85'),_0x5e9e4a[_0x1ad0('0x77')]);}}return _0x358f22[_0x1ad0('0x83')](_0x52a51b);}})[_0x1ad0('0x55')](handleError(_0x358f22,null));};exports[_0x1ad0('0x86')]=function(_0x3cc4ac,_0x3875f8,_0x2adcb1){var _0x372814=path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0x87'));var _0x378e58={'where':{'id':_0x3cc4ac[_0x1ad0('0x56')]['id']},'attributes':['id',_0x1ad0('0x79'),_0x1ad0('0x88')],'raw':!![]};return db[_0x1ad0('0x3f')][_0x1ad0('0x62')](_0x378e58)[_0x1ad0('0x21')](handleEntityNotFound(_0x3875f8,null))[_0x1ad0('0x21')](function(_0x41d242){if(_0x41d242){if(!_[_0x1ad0('0x7f')](_0x41d242[_0x1ad0('0x79')])){if(fs[_0x1ad0('0x80')](path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0x85'),_0x41d242[_0x1ad0('0x79')]))&&_0x41d242['showCustomerAvatar']){_0x372814=path['join'](config[_0x1ad0('0x81')],'server/files/images/avatars/',_0x41d242[_0x1ad0('0x79')]);}}return _0x3875f8[_0x1ad0('0x83')](_0x372814);}})[_0x1ad0('0x55')](handleError(_0x3875f8,null));};exports[_0x1ad0('0x89')]=function(_0x34f7df,_0x40649f,_0x251fb6){var _0x1dcfd2=path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0x8a'));var _0x585bb1={'where':{'id':_0x34f7df['params']['id']},'attributes':['id',_0x1ad0('0x8b')],'raw':!![]};return db[_0x1ad0('0x3f')][_0x1ad0('0x62')](_0x585bb1)[_0x1ad0('0x21')](handleEntityNotFound(_0x40649f,null))[_0x1ad0('0x21')](function(_0x1215c3){if(_0x1215c3){if(!_[_0x1ad0('0x7f')](_0x1215c3[_0x1ad0('0x8b')])){if(fs[_0x1ad0('0x80')](path[_0x1ad0('0x7b')](config['root'],_0x1ad0('0x85'),_0x1215c3['systemAvatar']))){_0x1dcfd2=path['join'](config[_0x1ad0('0x81')],'server/files/images/avatars/',_0x1215c3[_0x1ad0('0x8b')]);}}return _0x40649f[_0x1ad0('0x83')](_0x1dcfd2);}})['catch'](handleError(_0x40649f,null));};exports[_0x1ad0('0x8c')]=function(_0x5de6b3,_0x373b1f,_0xb04ae7){var _0x5b23b1=require(_0x1ad0('0x8d'));var _0x5db839=new _0x5b23b1();var _0x43a999=_0x5db839[_0x1ad0('0x8e')](_0x5de6b3[_0x1ad0('0x8f')][_0x1ad0('0x90')])[_0x1ad0('0x91')]();var _0x35b1c4={'body':_0x5de6b3[_0x1ad0('0x5d')],'channel':_0x1ad0('0x92')};var _0x38c71c=[];var _0x4d1ebd=[];var _0x1ac176={};var _0x2703bf=![];return db[_0x1ad0('0x93')][_0x1ad0('0x67')]()[_0x1ad0('0x21')](function(_0x40c800){if(!_0x40c800){throw new db[(_0x1ad0('0x94'))][(_0x1ad0('0x95'))]('no\x20available\x20attributes');}_0x38c71c=_[_0x1ad0('0x96')](_[_0x1ad0('0x57')](_0x40c800),[_0x1ad0('0x97'),_0x1ad0('0x98')]);_0x4d1ebd=_[_0x1ad0('0x96')](_['keys'](_0x40c800),[_0x1ad0('0x97'),'updatedAt','CompanyId',_0x1ad0('0x99')]);if(_0x5de6b3[_0x1ad0('0x5d')]['id']){delete _0x5de6b3[_0x1ad0('0x5d')]['id'];}if(_[_0x1ad0('0x7f')](_0x5de6b3['body'][_0x1ad0('0x9a')])){throw new db['Sequelize'][(_0x1ad0('0x95'))](_0x1ad0('0x9b'));}if(_[_0x1ad0('0x7f')](_0x5de6b3['body'][_0x1ad0('0x5d')])||_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0x5d')]===''){throw new db[(_0x1ad0('0x94'))][(_0x1ad0('0x95'))](_0x1ad0('0x9c'));}if(_[_0x1ad0('0x7f')](_0x5de6b3[_0x1ad0('0x5d')]['mapKey'])){throw new db[(_0x1ad0('0x94'))][(_0x1ad0('0x95'))](_0x1ad0('0x9d')+_0x4d1ebd);}if(!_[_0x1ad0('0x9e')](_0x4d1ebd,_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0x9f')])){throw new db[(_0x1ad0('0x94'))][(_0x1ad0('0x95'))](_0x1ad0('0xa0')+_0x4d1ebd);}_0x1ac176[_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0x9f')]]=_0x5de6b3['body'][_0x1ad0('0x9a')];})['then'](function(){return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'where':{'id':_0x5de6b3[_0x1ad0('0x56')]['id']},'include':[{'model':db[_0x1ad0('0xa1')],'as':_0x1ad0('0xa2'),'include':[{'model':db[_0x1ad0('0x93')],'as':_0x1ad0('0xa3'),'where':_0x1ac176,'limit':0x1,'order':[[_0x1ad0('0x98'),_0x1ad0('0xa4')]]}]},{'model':db['ChatApplication'],'as':_0x1ad0('0xa5')}]});})['then'](handleEntityNotFound(_0x373b1f,null))['then'](function(_0x5436e7){if(_0x5436e7&&_0x5436e7[_0x1ad0('0xa2')]){_0x35b1c4[_0x1ad0('0xa6')]=_0x5436e7;_0x35b1c4['applications']=_0x5436e7[_0x1ad0('0xa5')];_0x35b1c4[_0x1ad0('0xa7')]=_0x5436e7[_0x1ad0('0xa2')];_0x35b1c4[_0x1ad0('0xa8')]=_[_0x1ad0('0xa9')](_0x35b1c4[_0x1ad0('0xa8')],['priority'],[_0x1ad0('0xaa')]);if(_0x35b1c4[_0x1ad0('0xa6')][_0x1ad0('0xa5')]){delete _0x35b1c4['account'][_0x1ad0('0xa5')];}if(_0x35b1c4[_0x1ad0('0xa6')][_0x1ad0('0xa2')]&&_0x35b1c4[_0x1ad0('0xa6')][_0x1ad0('0xa2')][_0x1ad0('0xa3')]['length']){return _0x35b1c4[_0x1ad0('0xa6')]['List']['Contacts'][0x0];}var _0x2936e2=_[_0x1ad0('0x19')](_0x5de6b3[_0x1ad0('0x5d')],{'firstName':_0x5de6b3['body'][_0x1ad0('0x9a')],'ListId':_0x5436e7[_0x1ad0('0x99')]});_0x2936e2[_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0x9f')]]=_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0x9a')];return db['CmContact'][_0x1ad0('0x5c')](_0x2936e2,{'fields':_0x38c71c,'raw':!![]});}})[_0x1ad0('0x21')](handleEntityNotFound(_0x373b1f,null))[_0x1ad0('0x21')](function(_0x3c9dc7){_0x35b1c4[_0x1ad0('0xab')]=_0x3c9dc7;var _0x41e302=_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0xac')];if(_0x5de6b3['headers'][_0x1ad0('0xad')]){_0x41e302=_0x5de6b3[_0x1ad0('0x8f')][_0x1ad0('0xad')];}else if(_0x5de6b3[_0x1ad0('0x8f')]['x-forwarded-for']){_0x41e302=_[_0x1ad0('0xae')](_0x5de6b3[_0x1ad0('0x8f')][_0x1ad0('0xaf')]['split'](','));}if(_0x3c9dc7){var _0x529760={'ContactId':_0x3c9dc7['id'],'ChatWebsiteId':_0x5de6b3[_0x1ad0('0x56')]['id'],'from':(_0x3c9dc7[_0x1ad0('0xb0')]||'')+'\x20'+(_0x3c9dc7[_0x1ad0('0xb1')]||''),'customerIp':_0x41e302,'customerPort':_0x5de6b3[_0x1ad0('0x8f')][_0x1ad0('0xb2')]?_0x5de6b3[_0x1ad0('0x8f')]['x-real-port']:null,'referer':_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0xb3')],'browserName':_0x43a999[_0x1ad0('0xb4')][_0x1ad0('0x39')]&&_0x43a999[_0x1ad0('0xb4')][_0x1ad0('0xb5')]?util[_0x1ad0('0xb6')](_0x1ad0('0xb7'),_0x43a999['browser'][_0x1ad0('0x39')],_0x43a999[_0x1ad0('0xb4')][_0x1ad0('0xb5')]):_0x1ad0('0xb8'),'browserVersion':_0x43a999[_0x1ad0('0xb4')]['version']||_0x1ad0('0xb8'),'osName':util['format']('%s\x20%s',_0x43a999['os']['name'],_0x43a999['os']['version']),'osVersion':_0x43a999['os']['version'],'deviceModel':_0x43a999[_0x1ad0('0xb9')][_0x1ad0('0x43')]&&_0x43a999[_0x1ad0('0xb9')][_0x1ad0('0xba')]?util['format'](_0x1ad0('0xbb'),_0x43a999[_0x1ad0('0xb9')]['model'],_0x43a999[_0x1ad0('0xb9')][_0x1ad0('0xba')],_0x43a999['device'][_0x1ad0('0x41')]):null,'deviceVendor':_0x43a999[_0x1ad0('0xb9')][_0x1ad0('0xba')],'deviceType':_0x43a999['device']['type'],'formData':JSON[_0x1ad0('0x25')](_0x5de6b3['body'])};var _0x338974={'ChatWebsiteId':_0x5de6b3[_0x1ad0('0x56')]['id'],'closed':![]};if(_0x5de6b3[_0x1ad0('0x5d')]['threadId']){_0x338974['threadId']=_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0xbc')];return db[_0x1ad0('0xbd')][_0x1ad0('0x62')]({'where':_0x338974})[_0x1ad0('0x21')](function(_0x52e811){if(_0x52e811){return[_0x52e811,![]];}_0x529760[_0x1ad0('0xbc')]=_0x5de6b3['body'][_0x1ad0('0xbc')];_0x529760[_0x1ad0('0xbe')]=_0x5de6b3['body']['externalUrl'];return db[_0x1ad0('0xbd')][_0x1ad0('0x5c')](_0x529760)[_0x1ad0('0x21')](function(_0x41c688){return[_0x41c688,!![]];});});}_0x338974['ContactId']=_0x3c9dc7['id'];if(_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0xbf')]&&_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0xbf')]['id']){_0x338974['id']=_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0xbf')]['id'];return db[_0x1ad0('0xbd')][_0x1ad0('0x62')]({'where':_0x338974})[_0x1ad0('0x21')](function(_0x55bd1a){if(_0x55bd1a){return[_0x55bd1a,![]];}return db['ChatInteraction']['create'](_0x529760)[_0x1ad0('0x21')](function(_0x17a331){return[_0x17a331,!![]];});});}return db[_0x1ad0('0xbd')][_0x1ad0('0x5c')](_0x529760)[_0x1ad0('0x21')](function(_0x3aab06){return[_0x3aab06,!![]];});}})[_0x1ad0('0xc0')](function(_0x2c4798,_0x276029){if(_0x2c4798){_0x2703bf=_0x276029;if(!_0x276029){var _0x5c70e7={'from':(_0x35b1c4[_0x1ad0('0xab')][_0x1ad0('0xb0')]||'')+'\x20'+(_0x35b1c4[_0x1ad0('0xab')][_0x1ad0('0xb1')]||'')};if(_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0xbc')]&&_0x5de6b3[_0x1ad0('0x5d')][_0x1ad0('0xc1')]&&_0x5de6b3[_0x1ad0('0x5d')]['threadId']!=_0x5de6b3[_0x1ad0('0x5d')]['messageId']){_0x5c70e7[_0x1ad0('0xbc')]=_0x5de6b3[_0x1ad0('0x5d')]['messageId'];}return _0x2c4798['update'](_0x5c70e7);}else{return _0x2c4798;}}})['then'](function(_0x422de4){_0x35b1c4[_0x1ad0('0xbf')]=_0x422de4[_0x1ad0('0x35')]({'plain':!![]});_0x35b1c4[_0x1ad0('0xbf')][_0x1ad0('0xc2')]=_0x2703bf;if(_0x35b1c4[_0x1ad0('0xbf')][_0x1ad0('0xc2')]){if(_0x35b1c4[_0x1ad0('0xa6')][_0x1ad0('0xc3')]){_0x35b1c4[_0x1ad0('0xa8')]['push']({'id':0x0,'priority':_0x35b1c4[_0x1ad0('0xa8')][_0x1ad0('0x5a')]+0x1,'app':'close','appdata':_0x1ad0('0xc4'),'interval':_0x1ad0('0xc5')});}}return db[_0x1ad0('0xc6')]['create']({'body':_0x5de6b3['body'][_0x1ad0('0x5d')],'ChatWebsiteId':_0x5de6b3[_0x1ad0('0x56')]['id'],'ChatInteractionId':_0x422de4['id'],'direction':'in','ContactId':_0x35b1c4[_0x1ad0('0xab')]['id'],'AttachmentId':_0x5de6b3['body'][_0x1ad0('0xc7')]});})['then'](function(_0x3b4176){_0x35b1c4['message']=_0x3b4176;if(_0x35b1c4[_0x1ad0('0xbf')][_0x1ad0('0xc8')]){return db[_0x1ad0('0xc9')][_0x1ad0('0x62')]({'attributes':['id','name'],'where':{'id':_0x35b1c4[_0x1ad0('0xbf')][_0x1ad0('0xc8')]}})['then'](function(_0x997202){if(_0x997202){_0x35b1c4[_0x1ad0('0xa8')][_0x1ad0('0xca')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x997202[_0x1ad0('0x39')]+','+(_0x35b1c4[_0x1ad0('0xa6')][_0x1ad0('0xcb')]||0xa),'interval':_0x1ad0('0xc5')});_0x35b1c4['forcedOwnership']=!![];}return respondWithRpcPromise(_0x1ad0('0xcc'),'startRouting',_0x35b1c4);});}return respondWithRpcPromise('Start',_0x1ad0('0xcd'),_0x35b1c4);})[_0x1ad0('0x21')](function(_0x24f00f){respondWithRpcPromise(_0x1ad0('0xce'),_0x1ad0('0xce'),{'event':_0x1ad0('0x8c'),'message':_0x24f00f},client9002);return _0x24f00f;})['then'](respondWithResult(_0x373b1f,null))[_0x1ad0('0x55')](handleError(_0x373b1f,null));};exports['offline']=function(_0x76c9cd,_0x492339,_0xf9647){var _0x2fbe51,_0x135615,_0x12129c;var _0x5e7b4f=[];var _0x5ad271=[];var _0x1a72d4={};var _0x282fc0=_0x76c9cd[_0x1ad0('0xcf')]||[];var _0x2f73a5=[];var _0x6b3e80;return db[_0x1ad0('0x93')][_0x1ad0('0x67')]()[_0x1ad0('0x21')](function(_0x53836b){if(!_0x53836b){throw new db[(_0x1ad0('0x94'))][(_0x1ad0('0x95'))](_0x1ad0('0xd0'));}_0x5ad271=_[_0x1ad0('0x96')](_['keys'](_0x53836b),[_0x1ad0('0x97'),'updatedAt']);_0x5e7b4f=_[_0x1ad0('0x96')](_[_0x1ad0('0x57')](_0x53836b),['createdAt','updatedAt','CompanyId',_0x1ad0('0x99')]);if(_0x76c9cd[_0x1ad0('0x5d')]['id']){delete _0x76c9cd['body']['id'];}if(_[_0x1ad0('0x7f')](_0x76c9cd[_0x1ad0('0x5d')][_0x1ad0('0x9a')])){throw _0x492339['status'](0x1f4)['send'](new db[(_0x1ad0('0x94'))]['ValidationError'](_0x1ad0('0x9b')));}if(_[_0x1ad0('0x7f')](_0x76c9cd[_0x1ad0('0x5d')][_0x1ad0('0x5d')])||_0x76c9cd[_0x1ad0('0x5d')][_0x1ad0('0x5d')]===''){throw _0x492339[_0x1ad0('0x2b')](0x1f4)[_0x1ad0('0x3a')](new db[(_0x1ad0('0x94'))][(_0x1ad0('0x95'))](_0x1ad0('0x9c')));}if(_[_0x1ad0('0x7f')](_0x76c9cd[_0x1ad0('0x5d')]['mapKeyOffline'])){throw _0x492339[_0x1ad0('0x2b')](0x1f4)[_0x1ad0('0x3a')](new db[(_0x1ad0('0x94'))]['ValidationError'](_0x1ad0('0xd1')+_0x5e7b4f));}if(!_[_0x1ad0('0x9e')](_0x5e7b4f,_0x76c9cd[_0x1ad0('0x5d')][_0x1ad0('0xd2')])){throw _0x492339[_0x1ad0('0x2b')](0x1f4)[_0x1ad0('0x3a')](new db[(_0x1ad0('0x94'))][(_0x1ad0('0x95'))](_0x1ad0('0xd3')+_0x5e7b4f));}_0x1a72d4[_0x76c9cd['body'][_0x1ad0('0xd2')]]=_0x76c9cd[_0x1ad0('0x5d')][_0x1ad0('0x9a')];})[_0x1ad0('0x21')](function(){return db[_0x1ad0('0x3f')]['find']({'where':{'id':_0x76c9cd['params']['id']},'include':[{'model':db['CmList'],'as':_0x1ad0('0xa2')},{'model':db[_0x1ad0('0xd4')],'as':_0x1ad0('0xd4')}]});})[_0x1ad0('0x21')](handleEntityNotFound(_0x492339,null))[_0x1ad0('0x21')](function(_0x1bbd92){if(_0x1bbd92&&_0x1bbd92[_0x1ad0('0xa2')]){_0x135615=_0x1bbd92;var _0x4fe8eb=_[_0x1ad0('0x19')](_0x76c9cd[_0x1ad0('0x5d')],{'firstName':_0x76c9cd[_0x1ad0('0x5d')][_0x1ad0('0x9a')],'phone':_0x76c9cd[_0x1ad0('0x5d')][_0x1ad0('0x9a')],'ListId':_0x1bbd92['ListId']});_0x4fe8eb[_0x76c9cd['body'][_0x1ad0('0xd2')]]=_0x76c9cd[_0x1ad0('0x5d')][_0x1ad0('0x9a')];return db[_0x1ad0('0x93')][_0x1ad0('0xd5')]({'where':_0x1a72d4,'defaults':_0x4fe8eb});}})[_0x1ad0('0xc0')](function(_0x967c11){if(_0x967c11){_0x12129c=_0x967c11;var _0x4faead=fs[_0x1ad0('0xd6')](path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0xd7')),_0x1ad0('0xd8'));var _0x34cbad=ejs[_0x1ad0('0xd9')](_0x4faead,{'body':_['toPairs'](_0x76c9cd['body']['body']),'bodyTitle':_0x135615['offlineMessageBody']});return db['ChatOfflineMessage'][_0x1ad0('0x5c')]({'body':_0x34cbad,'ContactId':_0x967c11['id'],'ChatWebsiteId':_0x135615['id']});}})[_0x1ad0('0x21')](function(_0x30c343){_0x6b3e80=_0x30c343;if(_0x282fc0[_0x1ad0('0x5a')]){var _0x2e869a=_0x282fc0[_0x1ad0('0x3e')](function(_0x15b8ea){return{'name':_0x15b8ea[_0x1ad0('0xda')],'basename':_0x15b8ea[_0x1ad0('0x75')],'type':_0x15b8ea[_0x1ad0('0xdb')],'ChatOfflineMessageId':_0x30c343['id']};});_0x2f73a5=_0x2e869a[_0x1ad0('0x3e')](_0x49246f=>{var _0x309b1c={'filename':_0x49246f['name'],'path':path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0xdc'),'files',_0x1ad0('0xdd'),_0x1ad0('0xde'),_0x49246f[_0x1ad0('0xdf')])};return _0x309b1c;});if(!_0x135615[_0x1ad0('0xe0')]){return db[_0x1ad0('0xe1')][_0x1ad0('0xe2')](function(_0xc476ce){return db[_0x1ad0('0xe3')][_0x1ad0('0xe4')](_0x2e869a,{'transaction':_0xc476ce});});}}})[_0x1ad0('0x21')](function(){if(_0x6b3e80){_0x2fbe51=_0x6b3e80;return db[_0x1ad0('0xd4')][_0x1ad0('0xe5')]({'where':{'active':!![]},'include':[{'model':db[_0x1ad0('0xe6')],'as':_0x1ad0('0xe7'),'raw':!![]}]});}})['then'](function(_0x593fa2){if(_0x593fa2&&_0x593fa2[_0x1ad0('0xe7')]&&_0x135615[_0x1ad0('0xe8')]&&_0x135615[_0x1ad0('0xe9')]){var _0xb45fae={'tls':{'rejectUnauthorized':![]}};if(_0x593fa2[_0x1ad0('0xe7')][_0x1ad0('0xea')]){_0xb45fae['service']=_0x593fa2['Smtp'][_0x1ad0('0xea')];}else{_0xb45fae[_0x1ad0('0xeb')]=_0x593fa2[_0x1ad0('0xe7')]['host'];_0xb45fae[_0x1ad0('0xec')]=_0x593fa2[_0x1ad0('0xe7')][_0x1ad0('0xec')];_0xb45fae[_0x1ad0('0xed')]=_0x593fa2[_0x1ad0('0xe7')]['secure'];}if(_0x593fa2[_0x1ad0('0xe7')][_0x1ad0('0xee')]){_0xb45fae['auth']={'user':_0x593fa2[_0x1ad0('0xe7')][_0x1ad0('0x5e')],'pass':_0x593fa2['Smtp']['pass']};}return respondWithRpcPromise('SendMail',_0x1ad0('0xef'),{'account':_0xb45fae,'message':{'from':util[_0x1ad0('0xb6')]('\x22%s\x22\x20<%s>',_0x593fa2[_0x1ad0('0x39')],_0x593fa2[_0x1ad0('0xf0')]||_0x593fa2[_0x1ad0('0xe7')][_0x1ad0('0x5e')]),'to':_0x135615['forwardOfflineAddress'],'subject':_0x135615[_0x1ad0('0xf1')],'html':_0x2fbe51['body'],'attachments':_0x2f73a5}},client9003)[_0x1ad0('0x21')](function(){return _0x2fbe51;})[_0x1ad0('0x55')](function(_0x51d6eb){console[_0x1ad0('0x26')](_0x51d6eb);});}})[_0x1ad0('0x21')](function(){if(_0x135615&&_0x135615[_0x1ad0('0xe0')]&&_0x135615[_0x1ad0('0xf2')]){var _0xe6dc2=[];if(_0x282fc0[_0x1ad0('0x5a')]){_0xe6dc2=_0x282fc0[_0x1ad0('0x3e')](function(_0x3e72b3){return{'name':_0x3e72b3[_0x1ad0('0xda')],'basename':_0x3e72b3[_0x1ad0('0x75')],'type':_0x3e72b3[_0x1ad0('0xdb')],'ChatOfflineMessageId':_0x6b3e80['id']};});}var _0x337ffc;if(!_['isNil'](_0x135615[_0x1ad0('0xf3')])){var _0x37fbb8=_[_0x1ad0('0x3e')](_0x76c9cd[_0x1ad0('0x5d')],function(_0x1a0a00){return _0x1a0a00;});var _0x28b310=_[_0x1ad0('0xf4')](_0x37fbb8)[0x0];var _0x3521cf=_[_0x1ad0('0xf5')](_0x28b310,function(_0x342322){return _0x342322;});_0x337ffc=_0x3521cf[0x1][_0x135615['subjectOffline']];}var _0x34caff={'from':_0x12129c[_0x1ad0('0xf0')],'firstName':_0x12129c[_0x1ad0('0xb0')],'lastName':_0x12129c[_0x1ad0('0xb1')],'mapKey':_0x1ad0('0xf0'),'message':{'from':_0x12129c[_0x1ad0('0xf0')],'to':_0x135615[_0x1ad0('0xd4')][_0x1ad0('0xf0')],'cc':'','subject':_[_0x1ad0('0x7f')](_0x337ffc)?_0x135615[_0x1ad0('0xf1')]:_0x337ffc,'messageId':'','sentAt':new Date(),'attach':_0xe6dc2[_0x1ad0('0x5a')],'attachments':_0xe6dc2,'originChannel':'Chat','ChatWebsiteId':_0x135615['id'],'ChatOfflineMessageId':_0x2fbe51['id'],'originTo':_0x135615['MailAccount'][_0x1ad0('0xf0')]},'body':_0x2fbe51[_0x1ad0('0x5d')]};var _0x3774f0={'account':{'id':_0x135615[_0x1ad0('0xf2')]},'body':_0x34caff,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x1ad0('0xf6'),_0x1ad0('0xf7'),_0x3774f0,client9001)[_0x1ad0('0x21')](function(){return _0x2fbe51;})[_0x1ad0('0x55')](function(_0x145fd4){console[_0x1ad0('0x26')](_0x145fd4);});}return;})[_0x1ad0('0x21')](function(){if(_0x2fbe51){return _0x2fbe51;}})['then'](respondWithResult(_0x492339,null))['catch'](function(_0x18ac6c){console['error'](_0x1ad0('0x55'),_0x18ac6c);for(var _0x7b6f58 of _0x282fc0){var _0x207a44=path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0xdc'),_0x1ad0('0xcf'),_0x1ad0('0xdd'),'offline-chat',_0x7b6f58['filename']);fs_extra[_0x1ad0('0xf8')](_0x207a44)['catch'](function(_0x2c3ee4){console[_0x1ad0('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x207a44,_0x2c3ee4);});}});};exports[_0x1ad0('0xf9')]=function(_0x3a9a44,_0x3a20c3,_0x4ebbc3){return db[_0x1ad0('0xbd')]['find']({'where':{'id':_0x3a9a44[_0x1ad0('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a20c3,null))['then'](function(_0x378602){if(_0x378602){return _0x378602[_0x1ad0('0xf9')](_0x3a9a44[_0x1ad0('0x5d')]['ids'],_[_0x1ad0('0xfa')](_0x3a9a44[_0x1ad0('0x5d')],[_0x1ad0('0x6d'),'id'])||{});}})[_0x1ad0('0x21')](respondWithResult(_0x3a20c3,null))['catch'](handleError(_0x3a20c3,null));};exports[_0x1ad0('0xfb')]=function(_0x173292,_0x2ca4e6,_0x456cde){var _0x52f4af={'raw':![],'where':{}};var _0x4e3b23={};var _0x2efe2e={'count':0x0,'rows':[]};return db[_0x1ad0('0x3f')][_0x1ad0('0xe5')]({'where':{'id':_0x173292[_0x1ad0('0x56')]['id']}})['then'](handleEntityNotFound(_0x2ca4e6,null))[_0x1ad0('0x21')](function(_0x1b11d3){if(_0x1b11d3){_0x4e3b23[_0x1ad0('0x43')]=_[_0x1ad0('0x57')](db['ChatInteraction'][_0x1ad0('0x58')]);_0x4e3b23[_0x1ad0('0x44')]=_[_0x1ad0('0x57')](_0x173292[_0x1ad0('0x44')]);_0x4e3b23['filters']=_['intersection'](_0x4e3b23[_0x1ad0('0x43')],_0x4e3b23[_0x1ad0('0x44')]);_0x52f4af['attributes']=_[_0x1ad0('0x46')](_0x4e3b23[_0x1ad0('0x43')],qs['fields'](_0x173292[_0x1ad0('0x44')]['fields']));_0x52f4af[_0x1ad0('0x47')]=_0x52f4af['attributes'][_0x1ad0('0x5a')]?_0x52f4af[_0x1ad0('0x47')]:_0x4e3b23['model'];if(!_0x173292[_0x1ad0('0x44')][_0x1ad0('0x48')](_0x1ad0('0x49'))){_0x52f4af[_0x1ad0('0x2f')]=qs[_0x1ad0('0x2f')](_0x173292['query'][_0x1ad0('0x2f')]);_0x52f4af[_0x1ad0('0x2c')]=qs[_0x1ad0('0x2c')](_0x173292[_0x1ad0('0x44')]['offset']);}_0x52f4af[_0x1ad0('0x4a')]=qs['sort'](_0x173292['query'][_0x1ad0('0x4b')]);_0x52f4af[_0x1ad0('0x50')]=qs[_0x1ad0('0x45')](_['pick'](_0x173292[_0x1ad0('0x44')],_0x4e3b23[_0x1ad0('0x45')]));_0x52f4af['where']['ChatWebsiteId']=_0x1b11d3['id'];if(_0x173292['query'][_0x1ad0('0x4d')]){_0x52f4af[_0x1ad0('0x50')]=_['merge'](_0x52f4af[_0x1ad0('0x50')],{'$or':_['map'](_0x52f4af[_0x1ad0('0x47')],function(_0x831678){var _0x1d443b={};_0x1d443b[_0x831678]={'$like':'%'+_0x173292[_0x1ad0('0x44')][_0x1ad0('0x4d')]+'%'};return _0x1d443b;})});}_0x52f4af=_[_0x1ad0('0x4e')]({},_0x52f4af,_0x173292[_0x1ad0('0x5b')]);return db[_0x1ad0('0xbd')][_0x1ad0('0x2e')]({'where':_0x52f4af[_0x1ad0('0x50')]})[_0x1ad0('0x21')](function(_0x5d372c){_0x2efe2e['count']=_0x5d372c;if(_0x173292[_0x1ad0('0x44')][_0x1ad0('0x51')]){_0x52f4af[_0x1ad0('0x52')]=[{'model':db['CmContact'],'as':_0x1ad0('0xfc'),'required':![]},{'model':db['User'],'as':_0x1ad0('0xfd'),'attributes':[_0x1ad0('0x39'),_0x1ad0('0xfe'),_0x1ad0('0xff')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x1ad0('0x39'),_0x1ad0('0x100')],'where':_0x173292['query'][_0x1ad0('0x101')]?{'id':_0x173292['query'][_0x1ad0('0x101')]}:undefined,'required':_0x173292[_0x1ad0('0x44')]['tag']?!![]:![]}];}return db[_0x1ad0('0xbd')][_0x1ad0('0x53')](_0x52f4af);})[_0x1ad0('0x21')](function(_0x3e129b){_0x2efe2e[_0x1ad0('0x54')]=_0x3e129b;return _0x2efe2e;});}})[_0x1ad0('0x21')](respondWithFilteredResult(_0x2ca4e6,_0x52f4af))[_0x1ad0('0x55')](handleError(_0x2ca4e6,null));};function iftimePromise(_0x4110d8,_0x158503){return respondWithRpcPromise(_0x1ad0('0x102'),_0x1ad0('0x103'),{'command':_0x158503[_0x1ad0('0x104')]?util['format'](_0x1ad0('0x105'),_0x4110d8[_0x1ad0('0x106')],_0x158503[_0x1ad0('0x104')]):util[_0x1ad0('0xb6')](_0x1ad0('0x107'),_0x4110d8[_0x1ad0('0x106')])},client9002)[_0x1ad0('0x21')](function(_0x4f0b4d){var _0x7019c2=_0x4f0b4d&&_0x4f0b4d[_0x1ad0('0x108')](_0x1ad0('0x109'))>=0x0?!![]:![];logger[_0x1ad0('0x29')](_0x1ad0('0x10a'),_0x158503['id'],_0x4110d8['id'],_0x4110d8[_0x1ad0('0x106')],_0x7019c2?'ONLINE':_0x1ad0('0x10b'),_0x158503[_0x1ad0('0x104')]?_0x158503[_0x1ad0('0x104')]:_0x1ad0('0x10c'));return _0x7019c2;})[_0x1ad0('0x55')](function(_0x3b484a){logger['error'](_0x1ad0('0x10a'),_0x158503['id'],_0x4110d8['id'],_0x4110d8[_0x1ad0('0x106')],util[_0x1ad0('0x10d')](_0x3b484a,{'showHidden':![],'depth':null}),_0x158503[_0x1ad0('0x104')]?_0x158503[_0x1ad0('0x104')]:_0x1ad0('0x10c'));return![];});}exports[_0x1ad0('0x103')]=function(_0x5c49ae,_0x1a886f,_0x1600d7){var _0x18b544=0x0;var _0x49bbae=0x0;var _0x3c61c5=![];var _0x43cf1e;var _0x1ae927;return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'where':{'id':_0x5c49ae[_0x1ad0('0x56')]['id']},'include':[{'model':db[_0x1ad0('0x10e')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x1ad0('0x106')],'raw':!![]}]}]})[_0x1ad0('0x21')](handleEntityNotFound(_0x1a886f,null))[_0x1ad0('0x21')](function(_0x1f0ffa){if(_0x1f0ffa){_0x43cf1e=_0x1f0ffa;return _0x1f0ffa[_0x1ad0('0x10f')]({'raw':!![]});}})['then'](function(_0x41535f){if(_0x43cf1e){if(_0x41535f){_0x1ae927=_0x41535f;}}return require('../../config/license/util')[_0x1ad0('0x7d')]();})['then'](function(_0x4276a4){if(_0x4276a4){_0x49bbae=_0x4276a4[_0x1ad0('0x110')];_0x3c61c5=_0x4276a4[_0x1ad0('0x7e')];}})[_0x1ad0('0x21')](function(){return db[_0x1ad0('0xbd')][_0x1ad0('0x2e')]({'where':{'closed':![]}});})['then'](function(_0xe1a1c3){_0x18b544=_0xe1a1c3;if(_0x49bbae&&_0xe1a1c3>_0x49bbae){return db['License'][_0x1ad0('0xe5')]({'where':{'id':0x1}})[_0x1ad0('0x21')](function(_0x4ee1c7){if(_0x4ee1c7){_0x4ee1c7[_0x1ad0('0x111')](_0x1ad0('0x112'));}});}})['then'](function(){if(_0x43cf1e[_0x1ad0('0x10e')]&&_0x43cf1e['Interval'][_0x1ad0('0x113')]){var _0x5c1489=[];for(var _0x3b0108=0x0;_0x3b0108<_0x43cf1e[_0x1ad0('0x10e')][_0x1ad0('0x113')][_0x1ad0('0x5a')];_0x3b0108++){var _0x1b0bc7=_0x43cf1e[_0x1ad0('0x10e')][_0x1ad0('0x113')][_0x3b0108][_0x1ad0('0x35')]({'plain':!![]});_0x5c1489['push'](iftimePromise(_0x1b0bc7,_0x43cf1e));}return BPromise[_0x1ad0('0x114')](_0x5c1489)['then'](function(_0xd6cfed){return _[_0x1ad0('0x115')](_0xd6cfed);});}else{return!![];}})[_0x1ad0('0x21')](function(_0x48f53e){var _0x2ac9ac=fs[_0x1ad0('0xd6')](path[_0x1ad0('0x7b')](config[_0x1ad0('0x81')],_0x1ad0('0x116')),_0x1ad0('0xd8'));var _0x626801={'remote':_0x43cf1e[_0x1ad0('0x117')],'query':querystring[_0x1ad0('0x25')](_[_0x1ad0('0x4e')](_0x43cf1e[_0x1ad0('0x35')]({'plain':!![]}),{'customerIp':_0x5c49ae[_0x1ad0('0x8f')][_0x1ad0('0xaf')]||_0x5c49ae[_0x1ad0('0x8f')][_0x1ad0('0x118')]||_0x5c49ae[_0x1ad0('0x119')][_0x1ad0('0x11a')]||_0x5c49ae['ip'],'referer':_0x5c49ae[_0x1ad0('0x8f')][_0x1ad0('0xb3')],'openedInteractions':_0x18b544,'maxInteractions':_0x49bbae,'virtual':_0x3c61c5[_0x1ad0('0x110')],'online':_0x48f53e,'custom':_0x3c61c5}))[_0x1ad0('0x11b')](/'/g,'\x5c\x27')};_0x1a886f[_0x1ad0('0x3a')](ejs[_0x1ad0('0xd9')](Mustache[_0x1ad0('0xd9')](_0x2ac9ac,_0x626801),{'proactiveActions':_0x1ae927,'alignment':_0x43cf1e['alignment'],'verticalAlignment':_0x43cf1e[_0x1ad0('0x11c')],'div_color':_0x43cf1e[_0x1ad0('0x100')],'text_color':_0x43cf1e[_0x1ad0('0x11d')],'button_color':_0x43cf1e[_0x1ad0('0x11e')],'background_color':_0x43cf1e[_0x1ad0('0x11f')]}));})[_0x1ad0('0x55')](handleError(_0x1a886f,null));};exports[_0x1ad0('0x120')]=function(_0xbf4a83,_0x2d9860,_0xeeeebd){return db[_0x1ad0('0x3f')]['findOne']({'where':{'id':_0xbf4a83[_0x1ad0('0x56')]['id']}})['then'](handleEntityNotFound(_0x2d9860,null))[_0x1ad0('0x21')](function(_0xbb3312){if(_0xbb3312){return db[_0x1ad0('0xe1')][_0x1ad0('0xe2')](function(_0x197021){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0xbf4a83[_0x1ad0('0x56')]['id']},'transaction':_0x197021})[_0x1ad0('0x21')](function(_0x478d72){var _0x589b02=_[_0x1ad0('0x3e')](_0xbf4a83[_0x1ad0('0x5d')],function(_0x742e42){_0x742e42['ChatWebsiteId']=_0xbf4a83['params']['id'];return _0x742e42;});return db['ChatApplication'][_0x1ad0('0xe4')](_0x589b02,{'transaction':_0x197021});});})['then'](function(){return db[_0x1ad0('0x121')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xbf4a83['params']['id']},'order':_0x1ad0('0x122')});});}})['then'](respondWithResult(_0x2d9860,null))[_0x1ad0('0x55')](handleError(_0x2d9860,null));};exports[_0x1ad0('0x123')]=function(_0x3975bc,_0x2508d1,_0x406103){var _0x39610c={};var _0xd42984={};var _0x280e59;var _0x333ea1;return db[_0x1ad0('0x3f')][_0x1ad0('0xe5')]({'where':{'id':_0x3975bc['params']['id']}})['then'](handleEntityNotFound(_0x2508d1,null))['then'](function(_0x38a80f){if(_0x38a80f){_0x280e59=_0x38a80f;_0xd42984[_0x1ad0('0x43')]=_[_0x1ad0('0x57')](db['ChatApplication'][_0x1ad0('0x58')]);_0xd42984['query']=_['keys'](_0x3975bc[_0x1ad0('0x44')]);_0xd42984[_0x1ad0('0x45')]=_['intersection'](_0xd42984[_0x1ad0('0x43')],_0xd42984[_0x1ad0('0x44')]);_0x39610c[_0x1ad0('0x47')]=_[_0x1ad0('0x46')](_0xd42984[_0x1ad0('0x43')],qs[_0x1ad0('0x59')](_0x3975bc['query'][_0x1ad0('0x59')]));_0x39610c[_0x1ad0('0x47')]=_0x39610c[_0x1ad0('0x47')][_0x1ad0('0x5a')]?_0x39610c[_0x1ad0('0x47')]:_0xd42984[_0x1ad0('0x43')];_0x39610c[_0x1ad0('0x4a')]=qs[_0x1ad0('0x4b')](_0x3975bc[_0x1ad0('0x44')][_0x1ad0('0x4b')]);_0x39610c[_0x1ad0('0x50')]=qs['filters'](_['pick'](_0x3975bc[_0x1ad0('0x44')],_0xd42984[_0x1ad0('0x45')]));if(_0x3975bc[_0x1ad0('0x44')][_0x1ad0('0x4d')]){_0x39610c['where']=_['merge'](_0x39610c[_0x1ad0('0x50')],{'$or':_[_0x1ad0('0x3e')](_0x39610c[_0x1ad0('0x47')],function(_0x418ba3){var _0x105cce={};_0x105cce[_0x418ba3]={'$like':'%'+_0x3975bc['query'][_0x1ad0('0x4d')]+'%'};return _0x105cce;})});}_0x39610c=_['merge']({},_0x39610c,_0x3975bc[_0x1ad0('0x5b')]);return _0x280e59[_0x1ad0('0x123')](_0x39610c);}})[_0x1ad0('0x21')](function(_0x42f821){if(_0x42f821){_0x333ea1=_0x42f821[_0x1ad0('0x5a')];if(!_0x3975bc['query']['hasOwnProperty'](_0x1ad0('0x49'))){_0x39610c['limit']=qs['limit'](_0x3975bc[_0x1ad0('0x44')][_0x1ad0('0x2f')]);_0x39610c[_0x1ad0('0x2c')]=qs[_0x1ad0('0x2c')](_0x3975bc[_0x1ad0('0x44')][_0x1ad0('0x2c')]);}return _0x280e59[_0x1ad0('0x123')](_0x39610c);}})[_0x1ad0('0x21')](function(_0x4f394a){if(_0x4f394a){return _0x4f394a?{'count':_0x333ea1,'rows':_0x4f394a}:null;}})['then'](respondWithResult(_0x2508d1,null))['catch'](handleError(_0x2508d1,null));};exports[_0x1ad0('0x124')]=function(_0x5491ea,_0x1c8e0e,_0x3b9fb2){return db[_0x1ad0('0x125')][_0x1ad0('0x62')]({'where':{'id':_0x5491ea[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x1c8e0e,null))[_0x1ad0('0x21')](function(_0x28aaca){if(_0x28aaca){return _0x28aaca[_0x1ad0('0x124')](_0x5491ea[_0x1ad0('0x5d')][_0x1ad0('0x6d')],_['omit'](_0x5491ea[_0x1ad0('0x5d')],[_0x1ad0('0x6d'),'id'])||{});}})[_0x1ad0('0x21')](respondWithResult(_0x1c8e0e,null))[_0x1ad0('0x55')](handleError(_0x1c8e0e,null));};exports[_0x1ad0('0x10f')]=function(_0x37e275,_0x1314aa,_0x3853c6){var _0xf85bc5={};var _0x51bf36={};var _0x19477d;var _0x3d1879;return db['ChatWebsite'][_0x1ad0('0xe5')]({'where':{'id':_0x37e275[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x1314aa,null))[_0x1ad0('0x21')](function(_0x5cb5a7){if(_0x5cb5a7){_0x19477d=_0x5cb5a7;_0x51bf36[_0x1ad0('0x43')]=_[_0x1ad0('0x57')](db[_0x1ad0('0x126')]['rawAttributes']);_0x51bf36['query']=_['keys'](_0x37e275[_0x1ad0('0x44')]);_0x51bf36['filters']=_['intersection'](_0x51bf36['model'],_0x51bf36[_0x1ad0('0x44')]);_0xf85bc5[_0x1ad0('0x47')]=_[_0x1ad0('0x46')](_0x51bf36['model'],qs[_0x1ad0('0x59')](_0x37e275[_0x1ad0('0x44')]['fields']));_0xf85bc5['attributes']=_0xf85bc5[_0x1ad0('0x47')]['length']?_0xf85bc5[_0x1ad0('0x47')]:_0x51bf36[_0x1ad0('0x43')];_0xf85bc5[_0x1ad0('0x4a')]=qs[_0x1ad0('0x4b')](_0x37e275['query']['sort']);_0xf85bc5[_0x1ad0('0x50')]=qs[_0x1ad0('0x45')](_[_0x1ad0('0x4c')](_0x37e275['query'],_0x51bf36[_0x1ad0('0x45')]));if(_0x37e275[_0x1ad0('0x44')][_0x1ad0('0x4d')]){_0xf85bc5[_0x1ad0('0x50')]=_[_0x1ad0('0x4e')](_0xf85bc5[_0x1ad0('0x50')],{'$or':_['map'](_0xf85bc5[_0x1ad0('0x47')],function(_0xb3043e){var _0x4d5d8f={};_0x4d5d8f[_0xb3043e]={'$like':'%'+_0x37e275[_0x1ad0('0x44')][_0x1ad0('0x4d')]+'%'};return _0x4d5d8f;})});}_0xf85bc5=_['merge']({},_0xf85bc5,_0x37e275[_0x1ad0('0x5b')]);return _0x19477d[_0x1ad0('0x10f')](_0xf85bc5);}})[_0x1ad0('0x21')](function(_0x372e86){if(_0x372e86){_0x3d1879=_0x372e86[_0x1ad0('0x5a')];if(!_0x37e275[_0x1ad0('0x44')]['hasOwnProperty'](_0x1ad0('0x49'))){_0xf85bc5[_0x1ad0('0x2f')]=qs[_0x1ad0('0x2f')](_0x37e275['query'][_0x1ad0('0x2f')]);_0xf85bc5[_0x1ad0('0x2c')]=qs['offset'](_0x37e275[_0x1ad0('0x44')][_0x1ad0('0x2c')]);}return _0x19477d['getProactiveActions'](_0xf85bc5);}})[_0x1ad0('0x21')](function(_0x3d68c4){if(_0x3d68c4){return _0x3d68c4?{'count':_0x3d1879,'rows':_0x3d68c4}:null;}})[_0x1ad0('0x21')](respondWithResult(_0x1314aa,null))[_0x1ad0('0x55')](handleError(_0x1314aa,null));};exports['getFields']=function(_0x1291bd,_0x39c64c,_0x5a6aed){var _0x1f6d55=_0x1291bd['query']['online']===_0x1ad0('0x127')?_0x1ad0('0x128'):_0x1ad0('0x129');return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'attributes':['id',_0x1f6d55],'where':{'id':_0x1291bd[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x39c64c,null))['then'](function(_0x5600ab){if(_0x5600ab){var _0x48afad=_0x5600ab[_0x1f6d55];var _0x406fe9=_0x48afad&&_0x48afad['items']?_0x48afad[_0x1ad0('0x12a')]:[];_0x39c64c[_0x1ad0('0x3a')]({'fromKey':_[_0x1ad0('0x7f')](_0x48afad[_0x1ad0('0x12b')])?undefined:_0x48afad[_0x1ad0('0x12b')],'count':_0x406fe9['length'],'rows':_0x406fe9});}})[_0x1ad0('0x55')](handleError(_0x39c64c,null));};exports[_0x1ad0('0x12c')]=function(_0x52ee14,_0x5cfce6,_0xed8021){var _0x20d2b9={'raw':![],'where':{}};var _0x37bad0={};var _0x5f3dc1={'count':0x0,'rows':[]};return db[_0x1ad0('0x3f')][_0x1ad0('0xe5')]({'where':{'id':_0x52ee14[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x5cfce6,null))[_0x1ad0('0x21')](function(_0x96897f){if(_0x96897f){_0x37bad0[_0x1ad0('0x43')]=_[_0x1ad0('0x57')](db[_0x1ad0('0x12d')][_0x1ad0('0x58')]);_0x37bad0['query']=_[_0x1ad0('0x57')](_0x52ee14[_0x1ad0('0x44')]);_0x37bad0['filters']=_['intersection'](_0x37bad0[_0x1ad0('0x43')],_0x37bad0['query']);_0x20d2b9[_0x1ad0('0x47')]=_[_0x1ad0('0x46')](_0x37bad0['model'],qs['fields'](_0x52ee14['query'][_0x1ad0('0x59')]));_0x20d2b9[_0x1ad0('0x47')]=_0x20d2b9[_0x1ad0('0x47')][_0x1ad0('0x5a')]?_0x20d2b9[_0x1ad0('0x47')]:_0x37bad0[_0x1ad0('0x43')];if(!_0x52ee14[_0x1ad0('0x44')]['hasOwnProperty']('nolimit')){_0x20d2b9[_0x1ad0('0x2f')]=qs[_0x1ad0('0x2f')](_0x52ee14[_0x1ad0('0x44')]['limit']);_0x20d2b9[_0x1ad0('0x2c')]=qs['offset'](_0x52ee14[_0x1ad0('0x44')][_0x1ad0('0x2c')]);}_0x20d2b9['order']=qs['sort'](_0x52ee14[_0x1ad0('0x44')]['sort']);_0x20d2b9[_0x1ad0('0x50')]=qs[_0x1ad0('0x45')](_[_0x1ad0('0x4c')](_0x52ee14[_0x1ad0('0x44')],_0x37bad0[_0x1ad0('0x45')]));_0x20d2b9[_0x1ad0('0x50')]['ChatWebsiteId']=_0x96897f['id'];if(_0x52ee14['query'][_0x1ad0('0x4d')]){_0x20d2b9[_0x1ad0('0x50')]=_[_0x1ad0('0x4e')](_0x20d2b9[_0x1ad0('0x50')],{'$or':_[_0x1ad0('0x3e')](_0x20d2b9['attributes'],function(_0x117174){var _0x207e3a={};_0x207e3a[_0x117174]={'$like':'%'+_0x52ee14[_0x1ad0('0x44')][_0x1ad0('0x4d')]+'%'};return _0x207e3a;})});}_0x20d2b9=_['merge']({},_0x20d2b9,_0x52ee14['options']);return db[_0x1ad0('0x12d')][_0x1ad0('0x2e')]({'where':_0x20d2b9['where']})['then'](function(_0x582285){_0x5f3dc1['count']=_0x582285;if(_0x52ee14[_0x1ad0('0x44')][_0x1ad0('0x51')]){_0x20d2b9['include']=[{'all':!![]}];}else{_0x20d2b9[_0x1ad0('0x52')]=[{'model':db[_0x1ad0('0x93')],'as':_0x1ad0('0xfc'),'required':![]},{'model':db[_0x1ad0('0xe3')],'as':_0x1ad0('0x12e'),'required':![]}];}return db['ChatOfflineMessage'][_0x1ad0('0x53')](_0x20d2b9);})['then'](function(_0x3a4b68){_0x5f3dc1[_0x1ad0('0x54')]=_0x3a4b68;return _0x5f3dc1;});}})['then'](respondWithFilteredResult(_0x5cfce6,_0x20d2b9))[_0x1ad0('0x55')](handleError(_0x5cfce6,null));};exports[_0x1ad0('0x12f')]=function(_0x4c20cb,_0x4256a2,_0x255db8){return db[_0x1ad0('0x3f')][_0x1ad0('0x62')]({'where':{'id':_0x4c20cb['params']['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x4256a2,null))[_0x1ad0('0x21')](function(_0x1ac283){if(_0x1ac283){return _0x1ac283['addAgents'](_0x4c20cb['body']['ids'],_[_0x1ad0('0xfa')](_0x4c20cb['body'],[_0x1ad0('0x6d'),'id'])||{})[_0x1ad0('0xc0')](function(_0x11dab1){for(var _0x866b2f=0x0;_0x866b2f<_0x4c20cb[_0x1ad0('0x5d')][_0x1ad0('0x6d')]['length'];_0x866b2f+=0x1){socket[_0x1ad0('0x130')](_0x1ad0('0x131'),{'UserId':Number(_0x4c20cb[_0x1ad0('0x5d')][_0x1ad0('0x6d')][_0x866b2f]),'ChatWebsiteId':Number(_0x4c20cb[_0x1ad0('0x56')]['id'])});}return _0x11dab1;});}})[_0x1ad0('0x21')](respondWithResult(_0x4256a2,null))[_0x1ad0('0x55')](handleError(_0x4256a2,null));};exports[_0x1ad0('0x132')]=function(_0x23003d,_0x515a7f,_0x3fcd92){return db['ChatWebsite']['find']({'where':{'id':_0x23003d[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x515a7f,null))[_0x1ad0('0x21')](function(_0x461bce){if(_0x461bce){return _0x461bce[_0x1ad0('0x132')](_0x23003d[_0x1ad0('0x44')]['ids'])[_0x1ad0('0x21')](function(){if(_[_0x1ad0('0x133')](_0x23003d[_0x1ad0('0x44')][_0x1ad0('0x6d')])){for(var _0x19edae=0x0;_0x19edae<_0x23003d['query'][_0x1ad0('0x6d')][_0x1ad0('0x5a')];_0x19edae+=0x1){socket['emit'](_0x1ad0('0x134'),{'UserId':Number(_0x23003d['query'][_0x1ad0('0x6d')][_0x19edae]),'ChatWebsiteId':Number(_0x23003d[_0x1ad0('0x56')]['id'])});}}else{socket[_0x1ad0('0x130')](_0x1ad0('0x134'),{'UserId':Number(_0x23003d['query'][_0x1ad0('0x6d')]),'ChatWebsiteId':Number(_0x23003d[_0x1ad0('0x56')]['id'])});}});}})[_0x1ad0('0x21')](respondWithStatusCode(_0x515a7f,null))['catch'](handleError(_0x515a7f,null));};exports[_0x1ad0('0x135')]=function(_0x8458cb,_0x1e3042,_0x54955b){var _0x347b7e={};var _0x43c795={};var _0x1f8b78;var _0xcb2568;return db[_0x1ad0('0x3f')][_0x1ad0('0xe5')]({'where':{'id':_0x8458cb[_0x1ad0('0x56')]['id']}})[_0x1ad0('0x21')](handleEntityNotFound(_0x1e3042,null))[_0x1ad0('0x21')](function(_0x4f5459){if(_0x4f5459){_0x1f8b78=_0x4f5459;_0x43c795[_0x1ad0('0x43')]=_[_0x1ad0('0x57')](db[_0x1ad0('0xc9')]['rawAttributes']);_0x43c795[_0x1ad0('0x44')]=_[_0x1ad0('0x57')](_0x8458cb[_0x1ad0('0x44')]);_0x43c795[_0x1ad0('0x45')]=_['intersection'](_0x43c795[_0x1ad0('0x43')],_0x43c795[_0x1ad0('0x44')]);_0x347b7e['attributes']=_[_0x1ad0('0x46')](_0x43c795[_0x1ad0('0x43')],qs[_0x1ad0('0x59')](_0x8458cb[_0x1ad0('0x44')]['fields']));_0x347b7e['attributes']=_0x347b7e[_0x1ad0('0x47')][_0x1ad0('0x5a')]?_0x347b7e['attributes']:_0x43c795[_0x1ad0('0x43')];_0x347b7e[_0x1ad0('0x4a')]=qs[_0x1ad0('0x4b')](_0x8458cb[_0x1ad0('0x44')]['sort']);_0x347b7e['where']=qs[_0x1ad0('0x45')](_['pick'](_0x8458cb['query'],_0x43c795[_0x1ad0('0x45')]));if(_0x8458cb['query']['filter']){_0x347b7e[_0x1ad0('0x50')]=_[_0x1ad0('0x4e')](_0x347b7e[_0x1ad0('0x50')],{'$or':_[_0x1ad0('0x3e')](_0x347b7e[_0x1ad0('0x47')],function(_0x3e3cbd){var _0x214527={};_0x214527[_0x3e3cbd]={'$like':'%'+_0x8458cb[_0x1ad0('0x44')][_0x1ad0('0x4d')]+'%'};return _0x214527;})});}_0x347b7e=_[_0x1ad0('0x4e')]({},_0x347b7e,_0x8458cb[_0x1ad0('0x5b')]);return _0x1f8b78[_0x1ad0('0x135')](_0x347b7e);}})['then'](function(_0x4014d8){if(_0x4014d8){_0xcb2568=_0x4014d8[_0x1ad0('0x5a')];if(!_0x8458cb[_0x1ad0('0x44')]['hasOwnProperty']('nolimit')){_0x347b7e[_0x1ad0('0x2f')]=qs[_0x1ad0('0x2f')](_0x8458cb[_0x1ad0('0x44')]['limit']);_0x347b7e[_0x1ad0('0x2c')]=qs[_0x1ad0('0x2c')](_0x8458cb[_0x1ad0('0x44')]['offset']);}return _0x1f8b78[_0x1ad0('0x135')](_0x347b7e);}})['then'](function(_0x148947){if(_0x148947){return _0x148947?{'count':_0xcb2568,'rows':_0x148947}:null;}})[_0x1ad0('0x21')](respondWithResult(_0x1e3042,null))['catch'](handleError(_0x1e3042,null));};
\ No newline at end of file
+var _0x41a4=['SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','x-real-ip','color_button','backgroundColor','addApplications','getApplications','addProactiveActions','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','get','ChatWebsites','UserProfileResource','name','send','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','pick','ChatWebsiteId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','../../config/license/util','getLicense','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','headers','user-agent','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','priority','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','Start','startRouting','EventManager','offline','files','ValidationError','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x41a4,0x16c));var _0x441a=function(_0x20dc1c,_0x21d9e8){_0x20dc1c=_0x20dc1c-0x0;var _0x108360=_0x41a4[_0x20dc1c];return _0x108360;};'use strict';var emlformat=require(_0x441a('0x0'));var rimraf=require(_0x441a('0x1'));var zipdir=require(_0x441a('0x2'));var jsonpatch=require(_0x441a('0x3'));var rp=require(_0x441a('0x4'));var moment=require('moment');var BPromise=require(_0x441a('0x5'));var Mustache=require(_0x441a('0x6'));var util=require(_0x441a('0x7'));var path=require('path');var sox=require(_0x441a('0x8'));var csv=require(_0x441a('0x9'));var ejs=require(_0x441a('0xa'));var fs=require('fs');var fs_extra=require(_0x441a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x441a('0xc'));var jsforce=require(_0x441a('0xd'));var deskjs=require(_0x441a('0xe'));var toCsv=require(_0x441a('0x9'));var querystring=require('querystring');var Papa=require(_0x441a('0xf'));var Redis=require(_0x441a('0x10'));var authService=require(_0x441a('0x11'));var qs=require(_0x441a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x441a('0x13'));var logger=require('../../config/logger')(_0x441a('0x14'));var utils=require(_0x441a('0x15'));var config=require(_0x441a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x441a('0x17'))['db'];config[_0x441a('0x18')]=_[_0x441a('0x19')](config[_0x441a('0x18')],{'host':_0x441a('0x1a'),'port':0x18eb});var socket=require(_0x441a('0x1b'))(new Redis(config[_0x441a('0x18')]));require(_0x441a('0x1c'))['register'](socket);var jayson=require(_0x441a('0x1d'));var client=jayson[_0x441a('0x1e')][_0x441a('0x1f')]({'port':0x232c});var client9002=jayson[_0x441a('0x1e')][_0x441a('0x1f')]({'port':0x232a});var client9003=jayson[_0x441a('0x1e')][_0x441a('0x1f')]({'port':0x232b});var client9001=jayson['client'][_0x441a('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x5a42b5,_0x2be644,_0x248d82,_0x1ab3b3){return new BPromise(function(_0xcaecba,_0x3b26cf){var _0x3a47a5=_0x1ab3b3||client;return _0x3a47a5[_0x441a('0x20')](_0x5a42b5,_0x248d82)[_0x441a('0x21')](function(_0x66cc87){logger[_0x441a('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x2be644,_0x441a('0x23'));logger[_0x441a('0x24')](_0x441a('0x25'),_0x2be644,_0x441a('0x23'),JSON[_0x441a('0x26')](_0x66cc87));if(_0x66cc87['error']){if(_0x66cc87['error']['code']===0x1f4){logger[_0x441a('0x27')](_0x441a('0x28'),_0x2be644,_0x66cc87[_0x441a('0x27')][_0x441a('0x29')]);return _0x3b26cf(_0x66cc87[_0x441a('0x27')][_0x441a('0x29')]);}logger[_0x441a('0x27')](_0x441a('0x28'),_0x2be644,_0x66cc87[_0x441a('0x27')][_0x441a('0x29')]);return _0xcaecba(_0x66cc87[_0x441a('0x27')]['message']);}else{logger[_0x441a('0x22')](_0x441a('0x28'),_0x2be644,_0x441a('0x23'));_0xcaecba(_0x66cc87[_0x441a('0x2a')][_0x441a('0x29')]);}})[_0x441a('0x2b')](function(_0x5150b1){logger[_0x441a('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x2be644,_0x5150b1);_0x3b26cf(_0x5150b1);});});}function respondWithStatusCode(_0x49716d,_0x1a385b){_0x1a385b=_0x1a385b||0xcc;return function(_0x25deb7){if(_0x25deb7){return _0x49716d[_0x441a('0x2c')](_0x1a385b);}return _0x49716d['status'](_0x1a385b)[_0x441a('0x2d')]();};}function respondWithResult(_0x467a3c,_0x1b899e){_0x1b899e=_0x1b899e||0xc8;return function(_0x27886e){if(_0x27886e){return _0x467a3c[_0x441a('0x2e')](_0x1b899e)[_0x441a('0x2f')](_0x27886e);}};}function respondWithFilteredResult(_0x3a4508,_0x3ef617){return function(_0x260fd6){if(_0x260fd6){var _0x8b4023=typeof _0x3ef617[_0x441a('0x30')]==='undefined'&&typeof _0x3ef617[_0x441a('0x31')]===_0x441a('0x32');var _0x12808f=_0x260fd6['count'];var _0xffece2=_0x8b4023?0x0:_0x3ef617['offset'];var _0x59a000=_0x8b4023?_0x260fd6[_0x441a('0x33')]:_0x3ef617[_0x441a('0x30')]+_0x3ef617[_0x441a('0x31')];var _0x577228;if(_0x59a000>=_0x12808f){_0x59a000=_0x12808f;_0x577228=0xc8;}else{_0x577228=0xce;}_0x3a4508[_0x441a('0x2e')](_0x577228);return _0x3a4508[_0x441a('0x34')](_0x441a('0x35'),_0xffece2+'-'+_0x59a000+'/'+_0x12808f)[_0x441a('0x2f')](_0x260fd6);}return null;};}function patchUpdates(_0x308e6b){return function(_0x43eec1){try{jsonpatch['apply'](_0x43eec1,_0x308e6b,!![]);}catch(_0x324196){return BPromise['reject'](_0x324196);}return _0x43eec1[_0x441a('0x36')]();};}function saveUpdates(_0xae68c9,_0xf1913c){return function(_0x5dbf7e){if(_0x5dbf7e){return _0x5dbf7e[_0x441a('0x37')](_0xae68c9)['then'](function(_0x556f6a){return _0x556f6a;});}return null;};}function removeEntity(_0xdfdcf9,_0x590eaa){return function(_0x14e6b9){if(_0x14e6b9){return _0x14e6b9[_0x441a('0x38')]()[_0x441a('0x21')](function(){var _0x982fec=_0x14e6b9[_0x441a('0x39')]({'plain':!![]});var _0x40a137=_0x441a('0x3a');return db[_0x441a('0x3b')][_0x441a('0x38')]({'where':{'type':_0x40a137,'resourceId':_0x982fec['id']}})[_0x441a('0x21')](function(){return _0x14e6b9;});})['then'](function(){_0xdfdcf9[_0x441a('0x2e')](0xcc)[_0x441a('0x2d')]();});}};}function handleEntityNotFound(_0x523f86,_0x28c5ed){return function(_0x349126){if(!_0x349126){_0x523f86[_0x441a('0x2c')](0x194);}return _0x349126;};}function handleError(_0x210d93,_0x113253){_0x113253=_0x113253||0x1f4;return function(_0x1f681e){logger[_0x441a('0x27')](_0x1f681e['stack']);if(_0x1f681e[_0x441a('0x3c')]){delete _0x1f681e[_0x441a('0x3c')];}_0x210d93[_0x441a('0x2e')](_0x113253)[_0x441a('0x3d')](_0x1f681e);};}exports['index']=function(_0x20607c,_0x4135a9){var _0x16b36d={'include':[{'model':db['Pause'],'as':_0x441a('0x3e')}]},_0xb8263={},_0x3f8627={'count':0x0,'rows':[]};var _0x510ea1=_[_0x441a('0x3f')](db[_0x441a('0x40')][_0x441a('0x41')],function(_0x1f98d6){return{'name':_0x1f98d6[_0x441a('0x42')],'type':_0x1f98d6[_0x441a('0x43')][_0x441a('0x44')]};});_0xb8263[_0x441a('0x45')]=_[_0x441a('0x3f')](_0x510ea1,_0x441a('0x3c'));_0xb8263[_0x441a('0x46')]=_[_0x441a('0x47')](_0x20607c[_0x441a('0x46')]);_0xb8263['filters']=_[_0x441a('0x48')](_0xb8263[_0x441a('0x45')],_0xb8263['query']);_0x16b36d[_0x441a('0x49')]=_[_0x441a('0x48')](_0xb8263['model'],qs[_0x441a('0x4a')](_0x20607c['query'][_0x441a('0x4a')]));_0x16b36d[_0x441a('0x49')]=_0x16b36d[_0x441a('0x49')][_0x441a('0x4b')]?_0x16b36d[_0x441a('0x49')]:_0xb8263[_0x441a('0x45')];if(!_0x20607c[_0x441a('0x46')][_0x441a('0x4c')](_0x441a('0x4d'))){_0x16b36d[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x20607c[_0x441a('0x46')][_0x441a('0x31')]);_0x16b36d[_0x441a('0x30')]=qs['offset'](_0x20607c[_0x441a('0x46')]['offset']);}_0x16b36d[_0x441a('0x4e')]=qs[_0x441a('0x4f')](_0x20607c[_0x441a('0x46')][_0x441a('0x4f')]);_0x16b36d[_0x441a('0x50')]=qs[_0x441a('0x51')](_['pick'](_0x20607c[_0x441a('0x46')],_0xb8263[_0x441a('0x51')]),_0x510ea1);if(_0x20607c['query'][_0x441a('0x52')]){_0x16b36d[_0x441a('0x50')]=_[_0x441a('0x53')](_0x16b36d[_0x441a('0x50')],{'$or':_['map'](_0x510ea1,function(_0x336cef){if(_0x336cef[_0x441a('0x43')]!==_0x441a('0x54')){var _0x14fe91={};_0x14fe91[_0x336cef[_0x441a('0x3c')]]={'$like':'%'+_0x20607c[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x14fe91;}})});}_0x16b36d=_[_0x441a('0x53')]({},_0x16b36d,_0x20607c[_0x441a('0x55')]);var _0x5a94fd={'where':_0x16b36d[_0x441a('0x50')]};return db[_0x441a('0x40')][_0x441a('0x33')](_0x5a94fd)['then'](function(_0x3e5421){_0x3f8627[_0x441a('0x33')]=_0x3e5421;if(_0x20607c[_0x441a('0x46')][_0x441a('0x56')]){_0x16b36d[_0x441a('0x57')]=[{'all':!![]}];}return db[_0x441a('0x40')][_0x441a('0x58')](_0x16b36d);})['then'](function(_0x3b5f98){_0x3f8627[_0x441a('0x59')]=_0x3b5f98;return _0x3f8627;})[_0x441a('0x21')](respondWithFilteredResult(_0x4135a9,_0x16b36d))['catch'](handleError(_0x4135a9,null));};exports[_0x441a('0x5a')]=function(_0x266955,_0x5f2b7a){var _0xda4cf7={'raw':![],'where':{'id':_0x266955['params']['id']},'include':[{'model':db[_0x441a('0x5b')],'as':'mandatoryDispositionPause'}]},_0x579648={};_0x579648['model']=_['keys'](db[_0x441a('0x40')]['rawAttributes']);_0x579648[_0x441a('0x46')]=_[_0x441a('0x47')](_0x266955[_0x441a('0x46')]);_0x579648['filters']=_[_0x441a('0x48')](_0x579648[_0x441a('0x45')],_0x579648[_0x441a('0x46')]);_0xda4cf7[_0x441a('0x49')]=_[_0x441a('0x48')](_0x579648[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x266955[_0x441a('0x46')][_0x441a('0x4a')]));_0xda4cf7[_0x441a('0x49')]=_0xda4cf7[_0x441a('0x49')][_0x441a('0x4b')]?_0xda4cf7[_0x441a('0x49')]:_0x579648[_0x441a('0x45')];if(_0x266955['query'][_0x441a('0x56')]){_0xda4cf7[_0x441a('0x57')]=[{'all':!![]}];}_0xda4cf7=_[_0x441a('0x53')]({},_0xda4cf7,_0x266955[_0x441a('0x55')]);return db['ChatWebsite'][_0x441a('0x5c')](_0xda4cf7)['then'](handleEntityNotFound(_0x5f2b7a,null))[_0x441a('0x21')](respondWithResult(_0x5f2b7a,null))['catch'](handleError(_0x5f2b7a,null));};exports['create']=function(_0x357a63,_0x51a812){return db[_0x441a('0x40')]['create'](_0x357a63[_0x441a('0x5d')],{})[_0x441a('0x21')](function(_0xf26830){var _0x3eee54=_0x357a63[_0x441a('0x5e')][_0x441a('0x39')]({'plain':!![]});if(!_0x3eee54)throw new Error(_0x441a('0x5f'));if(_0x3eee54[_0x441a('0x60')]===_0x441a('0x5e')){var _0x307eeb=_0xf26830[_0x441a('0x39')]({'plain':!![]});var _0xc940d0=_0x441a('0x3a');return db[_0x441a('0x61')][_0x441a('0x5c')]({'where':{'name':_0xc940d0,'userProfileId':_0x3eee54[_0x441a('0x62')]},'raw':!![]})[_0x441a('0x21')](function(_0x1130a0){if(_0x1130a0&&_0x1130a0[_0x441a('0x63')]===0x0){return db[_0x441a('0x3b')][_0x441a('0x64')]({'name':_0x307eeb[_0x441a('0x3c')],'resourceId':_0x307eeb['id'],'type':_0x1130a0['name'],'sectionId':_0x1130a0['id']},{})[_0x441a('0x21')](function(){return _0xf26830;});}else{return _0xf26830;}})[_0x441a('0x2b')](function(_0x5cf760){logger[_0x441a('0x27')](_0x441a('0x65'),_0x5cf760);throw _0x5cf760;});}return _0xf26830;})[_0x441a('0x21')](respondWithResult(_0x51a812,0xc9))[_0x441a('0x2b')](handleError(_0x51a812,null));};exports[_0x441a('0x37')]=function(_0x129123,_0x449e5a){if(_0x129123[_0x441a('0x5d')]['id']){delete _0x129123[_0x441a('0x5d')]['id'];}return db[_0x441a('0x40')]['find']({'where':{'id':_0x129123[_0x441a('0x66')]['id']},'include':[{'model':db[_0x441a('0x5b')],'as':'mandatoryDispositionPause'}]})[_0x441a('0x21')](handleEntityNotFound(_0x449e5a,null))[_0x441a('0x21')](saveUpdates(_0x129123['body'],null))[_0x441a('0x21')](respondWithResult(_0x449e5a,null))[_0x441a('0x2b')](handleError(_0x449e5a,null));};exports[_0x441a('0x38')]=function(_0x258006,_0x5a3453){return db[_0x441a('0x40')]['find']({'where':{'id':_0x258006[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x5a3453,null))[_0x441a('0x21')](removeEntity(_0x5a3453,null))[_0x441a('0x2b')](handleError(_0x5a3453,null));};exports['describe']=function(_0x11ee7f,_0x127e42){return db[_0x441a('0x40')][_0x441a('0x67')]()['then'](respondWithResult(_0x127e42,null))['catch'](handleError(_0x127e42,null));};exports[_0x441a('0x68')]=function(_0x915d9c,_0x2cec2e,_0x6320dc){if(_0x915d9c['body']['id']){delete _0x915d9c['body']['id'];}return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x915d9c[_0x441a('0x66')]['id']}})['then'](handleEntityNotFound(_0x2cec2e,null))[_0x441a('0x21')](function(_0x32a0bd){if(_0x32a0bd){_0x915d9c['body']['ChatWebsiteId']=_0x32a0bd['id'];return db[_0x441a('0x69')]['create'](_0x915d9c[_0x441a('0x5d')]);}})['then'](respondWithResult(_0x2cec2e,null))['catch'](handleError(_0x2cec2e,null));};exports[_0x441a('0x6a')]=function(_0x61086b,_0x18a99c,_0xf7f45f){var _0x2b149f={'raw':![],'where':{}};var _0x477f24={};var _0x48bb86={'count':0x0,'rows':[]};return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x61086b['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x18a99c,null))['then'](function(_0x442a63){if(_0x442a63){_0x477f24[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0x69')][_0x441a('0x41')]);_0x477f24['query']=_[_0x441a('0x47')](_0x61086b[_0x441a('0x46')]);_0x477f24[_0x441a('0x51')]=_[_0x441a('0x48')](_0x477f24[_0x441a('0x45')],_0x477f24[_0x441a('0x46')]);_0x2b149f[_0x441a('0x49')]=_['intersection'](_0x477f24[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x61086b[_0x441a('0x46')][_0x441a('0x4a')]));_0x2b149f[_0x441a('0x49')]=_0x2b149f['attributes'][_0x441a('0x4b')]?_0x2b149f[_0x441a('0x49')]:_0x477f24[_0x441a('0x45')];if(!_0x61086b['query'][_0x441a('0x4c')](_0x441a('0x4d'))){_0x2b149f[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x61086b[_0x441a('0x46')]['limit']);_0x2b149f[_0x441a('0x30')]=qs['offset'](_0x61086b[_0x441a('0x46')]['offset']);}_0x2b149f[_0x441a('0x4e')]=qs[_0x441a('0x4f')](_0x61086b['query'][_0x441a('0x4f')]);_0x2b149f[_0x441a('0x50')]=qs['filters'](_[_0x441a('0x6c')](_0x61086b['query'],_0x477f24[_0x441a('0x51')]));_0x2b149f[_0x441a('0x50')][_0x441a('0x6d')]=_0x442a63['id'];if(_0x61086b['query'][_0x441a('0x52')]){_0x2b149f[_0x441a('0x50')]=_['merge'](_0x2b149f['where'],{'$or':_[_0x441a('0x3f')](_0x2b149f['attributes'],function(_0x2c4608){var _0x474875={};_0x474875[_0x2c4608]={'$like':'%'+_0x61086b[_0x441a('0x46')]['filter']+'%'};return _0x474875;})});}_0x2b149f=_['merge']({},_0x2b149f,_0x61086b[_0x441a('0x55')]);return db[_0x441a('0x69')][_0x441a('0x33')]({'where':_0x2b149f[_0x441a('0x50')]})['then'](function(_0x24c083){_0x48bb86[_0x441a('0x33')]=_0x24c083;if(_0x61086b[_0x441a('0x46')][_0x441a('0x56')]){_0x2b149f[_0x441a('0x57')]=[{'all':!![]}];}return db[_0x441a('0x69')][_0x441a('0x58')](_0x2b149f);})[_0x441a('0x21')](function(_0x2c952f){_0x48bb86['rows']=_0x2c952f;return _0x48bb86;});}})[_0x441a('0x21')](respondWithFilteredResult(_0x18a99c,_0x2b149f))[_0x441a('0x2b')](handleError(_0x18a99c,null));};exports[_0x441a('0x6e')]=function(_0x2273e5,_0x12f908,_0x2cbbeb){return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x2273e5[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x12f908,null))[_0x441a('0x21')](function(_0x227de3){if(_0x227de3){return _0x227de3[_0x441a('0x6e')](_0x2273e5['query']['ids']);}})[_0x441a('0x21')](respondWithStatusCode(_0x12f908,null))[_0x441a('0x2b')](handleError(_0x12f908,null));};exports[_0x441a('0x6f')]=function(_0x6441b,_0x13cc2a,_0x69e727){if(_0x6441b[_0x441a('0x5d')]['id']){delete _0x6441b[_0x441a('0x5d')]['id'];}return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x6441b[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x13cc2a,null))[_0x441a('0x21')](function(_0x19b862){if(_0x19b862){_0x6441b[_0x441a('0x5d')][_0x441a('0x6d')]=_0x19b862['id'];return db[_0x441a('0x70')][_0x441a('0x64')](_0x6441b[_0x441a('0x5d')]);}})[_0x441a('0x21')](respondWithResult(_0x13cc2a,null))[_0x441a('0x2b')](handleError(_0x13cc2a,null));};exports['getAnswers']=function(_0x57d2de,_0x3053c0,_0x567361){var _0x449299={'raw':![],'where':{}};var _0x53c939={};var _0x12f85a={'count':0x0,'rows':[]};return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x57d2de['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x3053c0,null))[_0x441a('0x21')](function(_0x102320){if(_0x102320){_0x53c939['model']=_['keys'](db[_0x441a('0x70')][_0x441a('0x41')]);_0x53c939[_0x441a('0x46')]=_[_0x441a('0x47')](_0x57d2de['query']);_0x53c939[_0x441a('0x51')]=_[_0x441a('0x48')](_0x53c939[_0x441a('0x45')],_0x53c939['query']);_0x449299['attributes']=_[_0x441a('0x48')](_0x53c939[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x57d2de[_0x441a('0x46')]['fields']));_0x449299[_0x441a('0x49')]=_0x449299[_0x441a('0x49')][_0x441a('0x4b')]?_0x449299[_0x441a('0x49')]:_0x53c939[_0x441a('0x45')];if(!_0x57d2de['query'][_0x441a('0x4c')](_0x441a('0x4d'))){_0x449299['limit']=qs['limit'](_0x57d2de[_0x441a('0x46')]['limit']);_0x449299[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x57d2de['query']['offset']);}_0x449299[_0x441a('0x4e')]=qs['sort'](_0x57d2de[_0x441a('0x46')][_0x441a('0x4f')]);_0x449299[_0x441a('0x50')]=qs[_0x441a('0x51')](_[_0x441a('0x6c')](_0x57d2de[_0x441a('0x46')],_0x53c939[_0x441a('0x51')]));_0x449299[_0x441a('0x50')]['ChatWebsiteId']=_0x102320['id'];if(_0x57d2de['query'][_0x441a('0x52')]){_0x449299[_0x441a('0x50')]=_['merge'](_0x449299[_0x441a('0x50')],{'$or':_[_0x441a('0x3f')](_0x449299['attributes'],function(_0x54ed5b){var _0x36b602={};_0x36b602[_0x54ed5b]={'$like':'%'+_0x57d2de[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x36b602;})});}_0x449299=_['merge']({},_0x449299,_0x57d2de['options']);return db[_0x441a('0x70')][_0x441a('0x33')]({'where':_0x449299['where']})['then'](function(_0x5ecb7a){_0x12f85a[_0x441a('0x33')]=_0x5ecb7a;if(_0x57d2de[_0x441a('0x46')]['includeAll']){_0x449299['include']=[{'all':!![]}];}return db[_0x441a('0x70')][_0x441a('0x58')](_0x449299);})[_0x441a('0x21')](function(_0x1c91c9){_0x12f85a[_0x441a('0x59')]=_0x1c91c9;return _0x12f85a;});}})['then'](respondWithFilteredResult(_0x3053c0,_0x449299))[_0x441a('0x2b')](handleError(_0x3053c0,null));};exports[_0x441a('0x71')]=function(_0x21d46b,_0x4516a0,_0x25c91b){return db[_0x441a('0x40')]['find']({'where':{'id':_0x21d46b[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x4516a0,null))[_0x441a('0x21')](function(_0x5ae275){if(_0x5ae275){return _0x5ae275[_0x441a('0x71')](_0x21d46b[_0x441a('0x46')][_0x441a('0x72')]);}})['then'](respondWithStatusCode(_0x4516a0,null))[_0x441a('0x2b')](handleError(_0x4516a0,null));};exports[_0x441a('0x73')]=function(_0x2a99a7,_0xa6728f,_0x4d7b2b){_0x2a99a7[_0x441a('0x5d')][_0x441a('0x74')]=_0x2a99a7[_0x441a('0x75')][_0x441a('0x76')];return db['ChatWebsite'][_0x441a('0x5c')]({'where':{'id':_0x2a99a7['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0xa6728f,null))['then'](saveUpdates(_0x2a99a7[_0x441a('0x5d')],null))['then'](respondWithResult(_0xa6728f,null))['catch'](handleError(_0xa6728f,null));};exports[_0x441a('0x77')]=function(_0x55abcb,_0x2fb56d,_0x3155de){_0x55abcb[_0x441a('0x5d')][_0x441a('0x78')]=_0x55abcb[_0x441a('0x75')][_0x441a('0x76')];return db['ChatWebsite'][_0x441a('0x5c')]({'where':{'id':_0x55abcb['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x2fb56d,null))[_0x441a('0x21')](saveUpdates(_0x55abcb[_0x441a('0x5d')],null))['then'](respondWithResult(_0x2fb56d,null))[_0x441a('0x2b')](handleError(_0x2fb56d,null));};exports['addCustomerAvatar']=function(_0x5c23f6,_0x54ee47,_0x157b05){_0x5c23f6[_0x441a('0x5d')][_0x441a('0x79')]=_0x5c23f6['file'][_0x441a('0x76')];return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x5c23f6[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x54ee47,null))['then'](saveUpdates(_0x5c23f6[_0x441a('0x5d')],null))['then'](respondWithResult(_0x54ee47,null))['catch'](handleError(_0x54ee47,null));};exports[_0x441a('0x7a')]=function(_0x149ff7,_0x5101e3,_0xdb9fb0){_0x149ff7[_0x441a('0x5d')][_0x441a('0x7b')]=_0x149ff7[_0x441a('0x75')]['filename'];return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x149ff7[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x5101e3,null))[_0x441a('0x21')](saveUpdates(_0x149ff7[_0x441a('0x5d')],null))[_0x441a('0x21')](respondWithResult(_0x5101e3,null))[_0x441a('0x2b')](handleError(_0x5101e3,null));};exports['getLogo']=function(_0x5a2497,_0x47bedf,_0x1de094){var _0x539255=path[_0x441a('0x7c')](config[_0x441a('0x7d')],'server/files/images/logos/default_logo.svg');var _0x3bf79d={'where':{'id':_0x5a2497[_0x441a('0x66')]['id']},'attributes':['id',_0x441a('0x74')],'raw':!![]};var _0x45d06e=![];return require(_0x441a('0x7e'))[_0x441a('0x7f')]()[_0x441a('0x21')](function(_0x357d9e){if(_0x357d9e){_0x45d06e=_0x357d9e['custom'];}})[_0x441a('0x21')](function(){return db[_0x441a('0x40')][_0x441a('0x5c')](_0x3bf79d);})[_0x441a('0x21')](handleEntityNotFound(_0x47bedf,null))['then'](function(_0x3c0bd1){if(_0x3c0bd1){if(!_['isNil'](_0x3c0bd1[_0x441a('0x74')])){if(fs[_0x441a('0x80')](path[_0x441a('0x7c')](config['root'],_0x441a('0x81'),_0x3c0bd1[_0x441a('0x74')]))&&_0x45d06e){_0x539255=path[_0x441a('0x7c')](config['root'],'server/files/images/logos/',_0x3c0bd1['sitepic']);}}return _0x47bedf[_0x441a('0x82')](_0x539255);}})[_0x441a('0x2b')](handleError(_0x47bedf,null));};exports['getAvatar']=function(_0x3a2ec9,_0x3dce81,_0xc98990){var _0x57589e=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x83'));var _0x3933af={'where':{'id':_0x3a2ec9['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x441a('0x40')][_0x441a('0x5c')](_0x3933af)[_0x441a('0x21')](handleEntityNotFound(_0x3dce81,null))[_0x441a('0x21')](function(_0x5caca6){if(_0x5caca6){if(!_[_0x441a('0x84')](_0x5caca6[_0x441a('0x78')])){if(fs[_0x441a('0x80')](path[_0x441a('0x7c')](config[_0x441a('0x7d')],'server/files/images/avatars/',_0x5caca6[_0x441a('0x78')]))){_0x57589e=path[_0x441a('0x7c')](config[_0x441a('0x7d')],'server/files/images/avatars/',_0x5caca6['agentAvatar']);}}return _0x3dce81[_0x441a('0x82')](_0x57589e);}})[_0x441a('0x2b')](handleError(_0x3dce81,null));};exports[_0x441a('0x85')]=function(_0x575382,_0x50ecc1,_0x2652d0){var _0x2d3dd5=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x86'));var _0x599339={'where':{'id':_0x575382[_0x441a('0x66')]['id']},'attributes':['id',_0x441a('0x79'),_0x441a('0x87')],'raw':!![]};return db[_0x441a('0x40')][_0x441a('0x5c')](_0x599339)[_0x441a('0x21')](handleEntityNotFound(_0x50ecc1,null))[_0x441a('0x21')](function(_0x2243b3){if(_0x2243b3){if(!_[_0x441a('0x84')](_0x2243b3[_0x441a('0x79')])){if(fs[_0x441a('0x80')](path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x88'),_0x2243b3[_0x441a('0x79')]))&&_0x2243b3['showCustomerAvatar']){_0x2d3dd5=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x88'),_0x2243b3[_0x441a('0x79')]);}}return _0x50ecc1[_0x441a('0x82')](_0x2d3dd5);}})[_0x441a('0x2b')](handleError(_0x50ecc1,null));};exports[_0x441a('0x89')]=function(_0x44535d,_0x5d4912,_0x2c766f){var _0x123ea0=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x8a'));var _0x15a86e={'where':{'id':_0x44535d[_0x441a('0x66')]['id']},'attributes':['id',_0x441a('0x7b')],'raw':!![]};return db[_0x441a('0x40')][_0x441a('0x5c')](_0x15a86e)[_0x441a('0x21')](handleEntityNotFound(_0x5d4912,null))[_0x441a('0x21')](function(_0x156b8a){if(_0x156b8a){if(!_['isNil'](_0x156b8a['systemAvatar'])){if(fs[_0x441a('0x80')](path[_0x441a('0x7c')](config[_0x441a('0x7d')],'server/files/images/avatars/',_0x156b8a[_0x441a('0x7b')]))){_0x123ea0=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x88'),_0x156b8a[_0x441a('0x7b')]);}}return _0x5d4912[_0x441a('0x82')](_0x123ea0);}})[_0x441a('0x2b')](handleError(_0x5d4912,null));};exports['notify']=function(_0x13c2ad,_0x17066d,_0x3506a9){var _0x5855a6=require('user-agent-parser');var _0xfc9e41=new _0x5855a6();var _0x4296fb=_0xfc9e41['setUA'](_0x13c2ad[_0x441a('0x8b')][_0x441a('0x8c')])['getResult']();var _0x1df5bb={'body':_0x13c2ad['body'],'channel':_0x441a('0x8d')};var _0x1f9826=[];var _0x4f1045=[];var _0x2ceead={};var _0x5e781f=![];return db[_0x441a('0x8e')]['describe']()[_0x441a('0x21')](function(_0x348e27){if(!_0x348e27){throw new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0x90'));}_0x1f9826=_[_0x441a('0x91')](_[_0x441a('0x47')](_0x348e27),[_0x441a('0x92'),_0x441a('0x93')]);_0x4f1045=_[_0x441a('0x91')](_[_0x441a('0x47')](_0x348e27),[_0x441a('0x92'),'updatedAt',_0x441a('0x94'),_0x441a('0x95')]);if(_0x13c2ad[_0x441a('0x5d')]['id']){delete _0x13c2ad['body']['id'];}if(_[_0x441a('0x84')](_0x13c2ad[_0x441a('0x5d')][_0x441a('0x96')])){throw new db['Sequelize']['ValidationError'](_0x441a('0x97'));}if(_[_0x441a('0x84')](_0x13c2ad[_0x441a('0x5d')][_0x441a('0x5d')])||_0x13c2ad[_0x441a('0x5d')]['body']===''){throw new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0x98'));}if(_['isNil'](_0x13c2ad['body']['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x441a('0x99')+_0x4f1045);}if(!_[_0x441a('0x9a')](_0x4f1045,_0x13c2ad['body'][_0x441a('0x9b')])){throw new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0x9c')+_0x4f1045);}_0x2ceead[_0x13c2ad['body'][_0x441a('0x9b')]]=_0x13c2ad[_0x441a('0x5d')][_0x441a('0x96')];})[_0x441a('0x21')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x13c2ad['params']['id']},'include':[{'model':db[_0x441a('0x9d')],'as':_0x441a('0x9e'),'include':[{'model':db['CmContact'],'as':_0x441a('0x9f'),'where':_0x2ceead,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x441a('0xa0')],'as':_0x441a('0xa1')}]});})[_0x441a('0x21')](handleEntityNotFound(_0x17066d,null))[_0x441a('0x21')](function(_0xd69ed0){if(_0xd69ed0&&_0xd69ed0[_0x441a('0x9e')]){_0x1df5bb[_0x441a('0xa2')]=_0xd69ed0;_0x1df5bb[_0x441a('0xa3')]=_0xd69ed0['Applications'];_0x1df5bb[_0x441a('0xa4')]=_0xd69ed0[_0x441a('0x9e')];_0x1df5bb['applications']=_['orderBy'](_0x1df5bb[_0x441a('0xa3')],[_0x441a('0xa5')],['asc']);if(_0x1df5bb[_0x441a('0xa2')]['Applications']){delete _0x1df5bb[_0x441a('0xa2')]['Applications'];}if(_0x1df5bb['account'][_0x441a('0x9e')]&&_0x1df5bb['account'][_0x441a('0x9e')][_0x441a('0x9f')][_0x441a('0x4b')]){return _0x1df5bb[_0x441a('0xa2')][_0x441a('0x9e')][_0x441a('0x9f')][0x0];}var _0x1aad3e=_[_0x441a('0x19')](_0x13c2ad[_0x441a('0x5d')],{'firstName':_0x13c2ad[_0x441a('0x5d')][_0x441a('0x96')],'ListId':_0xd69ed0['ListId']});_0x1aad3e[_0x13c2ad['body'][_0x441a('0x9b')]]=_0x13c2ad[_0x441a('0x5d')][_0x441a('0x96')];return db['CmContact']['create'](_0x1aad3e,{'fields':_0x1f9826,'raw':!![]});}})[_0x441a('0x21')](handleEntityNotFound(_0x17066d,null))[_0x441a('0x21')](function(_0x423145){_0x1df5bb[_0x441a('0xa6')]=_0x423145;var _0x815654=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xa7')];if(_0x13c2ad[_0x441a('0x8b')]['cf-connecting-ip']){_0x815654=_0x13c2ad[_0x441a('0x8b')][_0x441a('0xa8')];}else if(_0x13c2ad[_0x441a('0x8b')][_0x441a('0xa9')]){_0x815654=_[_0x441a('0xaa')](_0x13c2ad['headers']['x-forwarded-for'][_0x441a('0xab')](','));}if(_0x423145){var _0x5e3b29={'ContactId':_0x423145['id'],'ChatWebsiteId':_0x13c2ad[_0x441a('0x66')]['id'],'from':(_0x423145[_0x441a('0xac')]||'')+'\x20'+(_0x423145['lastName']||''),'customerIp':_0x815654,'customerPort':_0x13c2ad[_0x441a('0x8b')][_0x441a('0xad')]?_0x13c2ad[_0x441a('0x8b')][_0x441a('0xad')]:null,'referer':_0x13c2ad[_0x441a('0x5d')][_0x441a('0xae')],'browserName':_0x4296fb[_0x441a('0xaf')][_0x441a('0x3c')]&&_0x4296fb['browser'][_0x441a('0xb0')]?util[_0x441a('0xb1')](_0x441a('0xb2'),_0x4296fb[_0x441a('0xaf')][_0x441a('0x3c')],_0x4296fb[_0x441a('0xaf')][_0x441a('0xb0')]):_0x441a('0xb3'),'browserVersion':_0x4296fb[_0x441a('0xaf')]['version']||_0x441a('0xb3'),'osName':util[_0x441a('0xb1')]('%s\x20%s',_0x4296fb['os'][_0x441a('0x3c')],_0x4296fb['os'][_0x441a('0xb0')]),'osVersion':_0x4296fb['os'][_0x441a('0xb0')],'deviceModel':_0x4296fb[_0x441a('0xb4')]['model']&&_0x4296fb[_0x441a('0xb4')][_0x441a('0xb5')]?util[_0x441a('0xb1')](_0x441a('0xb6'),_0x4296fb[_0x441a('0xb4')][_0x441a('0x45')],_0x4296fb[_0x441a('0xb4')][_0x441a('0xb5')],_0x4296fb[_0x441a('0xb4')][_0x441a('0x43')]):null,'deviceVendor':_0x4296fb[_0x441a('0xb4')][_0x441a('0xb5')],'deviceType':_0x4296fb[_0x441a('0xb4')]['type'],'formData':JSON[_0x441a('0x26')](_0x13c2ad[_0x441a('0x5d')])};var _0x6e09ce={'ChatWebsiteId':_0x13c2ad['params']['id'],'closed':![]};if(_0x13c2ad['body'][_0x441a('0xb7')]){_0x6e09ce[_0x441a('0xb7')]=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xb7')];return db[_0x441a('0xb8')][_0x441a('0x5c')]({'where':_0x6e09ce})[_0x441a('0x21')](function(_0x247460){if(_0x247460){return[_0x247460,![]];}_0x5e3b29[_0x441a('0xb7')]=_0x13c2ad['body'][_0x441a('0xb7')];_0x5e3b29[_0x441a('0xb9')]=_0x13c2ad[_0x441a('0x5d')]['externalUrl'];return db[_0x441a('0xb8')][_0x441a('0x64')](_0x5e3b29)['then'](function(_0x3ca7e4){return[_0x3ca7e4,!![]];});});}_0x6e09ce[_0x441a('0xba')]=_0x423145['id'];if(_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbb')]&&_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbb')]['id']){_0x6e09ce['id']=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbb')]['id'];return db[_0x441a('0xb8')][_0x441a('0x5c')]({'where':_0x6e09ce})[_0x441a('0x21')](function(_0x139c8c){if(_0x139c8c){return[_0x139c8c,![]];}return db[_0x441a('0xb8')]['create'](_0x5e3b29)[_0x441a('0x21')](function(_0x4d4db3){return[_0x4d4db3,!![]];});});}return db['ChatInteraction'][_0x441a('0x64')](_0x5e3b29)[_0x441a('0x21')](function(_0x4d43d1){return[_0x4d43d1,!![]];});}})[_0x441a('0xbc')](function(_0x7eb98d,_0x2e5da6){if(_0x7eb98d){_0x5e781f=_0x2e5da6;if(!_0x2e5da6){var _0x5514b7={'from':(_0x1df5bb['contact'][_0x441a('0xac')]||'')+'\x20'+(_0x1df5bb[_0x441a('0xa6')][_0x441a('0xbd')]||'')};if(_0x13c2ad[_0x441a('0x5d')]['threadId']&&_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbe')]&&_0x13c2ad['body']['threadId']!=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbe')]){_0x5514b7[_0x441a('0xb7')]=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbe')];}return _0x7eb98d[_0x441a('0x37')](_0x5514b7);}else{return _0x7eb98d;}}})['then'](function(_0x271548){_0x1df5bb[_0x441a('0xbb')]=_0x271548['get']({'plain':!![]});_0x1df5bb[_0x441a('0xbb')]['created']=_0x5e781f;if(_0x1df5bb[_0x441a('0xbb')]['created']){if(_0x1df5bb['account'][_0x441a('0xbf')]){_0x1df5bb[_0x441a('0xa3')][_0x441a('0xc0')]({'id':0x0,'priority':_0x1df5bb[_0x441a('0xa3')][_0x441a('0x4b')]+0x1,'app':'close','appdata':_0x441a('0xc1'),'interval':_0x441a('0xc2')});}}return db[_0x441a('0xc3')][_0x441a('0x64')]({'body':_0x13c2ad[_0x441a('0x5d')][_0x441a('0x5d')],'ChatWebsiteId':_0x13c2ad[_0x441a('0x66')]['id'],'ChatInteractionId':_0x271548['id'],'direction':'in','ContactId':_0x1df5bb[_0x441a('0xa6')]['id'],'AttachmentId':_0x13c2ad[_0x441a('0x5d')][_0x441a('0xc4')]});})[_0x441a('0x21')](function(_0x34a6ee){_0x1df5bb[_0x441a('0x29')]=_0x34a6ee;if(_0x1df5bb['interaction'][_0x441a('0xc5')]){return db[_0x441a('0xc6')][_0x441a('0x5c')]({'attributes':['id','name'],'where':{'id':_0x1df5bb[_0x441a('0xbb')][_0x441a('0xc5')]}})[_0x441a('0x21')](function(_0x3b9009){if(_0x3b9009){_0x1df5bb[_0x441a('0xa3')][_0x441a('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3b9009[_0x441a('0x3c')]+','+(_0x1df5bb['account']['waitForTheAssignedAgent']||0xa),'interval':_0x441a('0xc2')});_0x1df5bb['forcedOwnership']=!![];}return respondWithRpcPromise('Start','startRouting',_0x1df5bb);});}return respondWithRpcPromise(_0x441a('0xc8'),_0x441a('0xc9'),_0x1df5bb);})[_0x441a('0x21')](function(_0x2d10ca){respondWithRpcPromise('EventManager',_0x441a('0xca'),{'event':'notify','message':_0x2d10ca},client9002);return _0x2d10ca;})[_0x441a('0x21')](respondWithResult(_0x17066d,null))[_0x441a('0x2b')](handleError(_0x17066d,null));};exports[_0x441a('0xcb')]=function(_0x26278b,_0x1097ca,_0x25b403){var _0x597fe7,_0x48b891,_0x156468;var _0x1ea928=[];var _0x1aa097=[];var _0x3a79f0={};var _0x57f529=_0x26278b[_0x441a('0xcc')]||[];var _0xfb627c=[];var _0xb461dc;return db[_0x441a('0x8e')][_0x441a('0x67')]()[_0x441a('0x21')](function(_0x365dc0){if(!_0x365dc0){throw new db['Sequelize'][(_0x441a('0xcd'))](_0x441a('0x90'));}_0x1aa097=_[_0x441a('0x91')](_[_0x441a('0x47')](_0x365dc0),[_0x441a('0x92'),_0x441a('0x93')]);_0x1ea928=_[_0x441a('0x91')](_[_0x441a('0x47')](_0x365dc0),[_0x441a('0x92'),_0x441a('0x93'),'CompanyId',_0x441a('0x95')]);if(_0x26278b[_0x441a('0x5d')]['id']){delete _0x26278b[_0x441a('0x5d')]['id'];}if(_[_0x441a('0x84')](_0x26278b[_0x441a('0x5d')][_0x441a('0x96')])){throw _0x1097ca[_0x441a('0x2e')](0x1f4)[_0x441a('0x3d')](new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0x97')));}if(_[_0x441a('0x84')](_0x26278b['body'][_0x441a('0x5d')])||_0x26278b['body']['body']===''){throw _0x1097ca[_0x441a('0x2e')](0x1f4)[_0x441a('0x3d')](new db[(_0x441a('0x8f'))][(_0x441a('0xcd'))](_0x441a('0x98')));}if(_['isNil'](_0x26278b[_0x441a('0x5d')][_0x441a('0xce')])){throw _0x1097ca[_0x441a('0x2e')](0x1f4)[_0x441a('0x3d')](new db[(_0x441a('0x8f'))][(_0x441a('0xcd'))](_0x441a('0xcf')+_0x1ea928));}if(!_[_0x441a('0x9a')](_0x1ea928,_0x26278b[_0x441a('0x5d')][_0x441a('0xce')])){throw _0x1097ca['status'](0x1f4)['send'](new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0xd0')+_0x1ea928));}_0x3a79f0[_0x26278b[_0x441a('0x5d')][_0x441a('0xce')]]=_0x26278b[_0x441a('0x5d')][_0x441a('0x96')];})[_0x441a('0x21')](function(){return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x26278b['params']['id']},'include':[{'model':db[_0x441a('0x9d')],'as':_0x441a('0x9e')},{'model':db[_0x441a('0xd1')],'as':'MailAccount'}]});})[_0x441a('0x21')](handleEntityNotFound(_0x1097ca,null))['then'](function(_0x4e5c46){if(_0x4e5c46&&_0x4e5c46[_0x441a('0x9e')]){_0x48b891=_0x4e5c46;var _0x239907=_[_0x441a('0x19')](_0x26278b[_0x441a('0x5d')],{'firstName':_0x26278b['body'][_0x441a('0x96')],'phone':_0x26278b[_0x441a('0x5d')][_0x441a('0x96')],'ListId':_0x4e5c46[_0x441a('0x95')]});_0x239907[_0x26278b[_0x441a('0x5d')][_0x441a('0xce')]]=_0x26278b[_0x441a('0x5d')][_0x441a('0x96')];return db[_0x441a('0x8e')][_0x441a('0xd2')]({'where':_0x3a79f0,'defaults':_0x239907});}})['spread'](function(_0x47af5a){if(_0x47af5a){_0x156468=_0x47af5a;var _0x45faa4=fs['readFileSync'](path[_0x441a('0x7c')](config['root'],_0x441a('0xd3')),_0x441a('0xd4'));var _0x2d4121=ejs[_0x441a('0xd5')](_0x45faa4,{'body':_[_0x441a('0xd6')](_0x26278b[_0x441a('0x5d')][_0x441a('0x5d')]),'bodyTitle':_0x48b891[_0x441a('0xd7')]});return db['ChatOfflineMessage'][_0x441a('0x64')]({'body':_0x2d4121,'ContactId':_0x47af5a['id'],'ChatWebsiteId':_0x48b891['id']});}})[_0x441a('0x21')](function(_0x1bd505){_0xb461dc=_0x1bd505;if(_0x57f529[_0x441a('0x4b')]){var _0x4d058e=_0x57f529[_0x441a('0x3f')](function(_0x3e2bdb){return{'name':_0x3e2bdb[_0x441a('0xd8')],'basename':_0x3e2bdb['filename'],'type':_0x3e2bdb[_0x441a('0xd9')],'ChatOfflineMessageId':_0x1bd505['id']};});_0xfb627c=_0x4d058e[_0x441a('0x3f')](_0x8231ae=>{var _0x45293c={'filename':_0x8231ae[_0x441a('0x3c')],'path':path['join'](config[_0x441a('0x7d')],_0x441a('0xda'),_0x441a('0xcc'),_0x441a('0xdb'),_0x441a('0xdc'),_0x8231ae[_0x441a('0xdd')])};return _0x45293c;});if(!_0x48b891[_0x441a('0xde')]){return db[_0x441a('0xdf')][_0x441a('0xe0')](function(_0x3aea97){return db[_0x441a('0xe1')][_0x441a('0xe2')](_0x4d058e,{'transaction':_0x3aea97});});}}})[_0x441a('0x21')](function(){if(_0xb461dc){_0x597fe7=_0xb461dc;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x441a('0xe3')],'as':_0x441a('0xe4'),'raw':!![]}]});}})[_0x441a('0x21')](function(_0x1d9f8f){if(_0x1d9f8f&&_0x1d9f8f[_0x441a('0xe4')]&&_0x48b891[_0x441a('0xe5')]&&_0x48b891[_0x441a('0xe6')]){var _0x45fa2c={'tls':{'rejectUnauthorized':![]}};if(_0x1d9f8f[_0x441a('0xe4')][_0x441a('0xe7')]){_0x45fa2c[_0x441a('0xe7')]=_0x1d9f8f[_0x441a('0xe4')][_0x441a('0xe7')];}else{_0x45fa2c[_0x441a('0xe8')]=_0x1d9f8f[_0x441a('0xe4')]['host'];_0x45fa2c['port']=_0x1d9f8f['Smtp'][_0x441a('0xe9')];_0x45fa2c[_0x441a('0xea')]=_0x1d9f8f[_0x441a('0xe4')]['secure'];}if(_0x1d9f8f[_0x441a('0xe4')]['authentication']){_0x45fa2c[_0x441a('0xeb')]={'user':_0x1d9f8f['Smtp'][_0x441a('0x5e')],'pass':_0x1d9f8f[_0x441a('0xe4')]['pass']};}return respondWithRpcPromise(_0x441a('0xec'),_0x441a('0xed'),{'account':_0x45fa2c,'message':{'from':util[_0x441a('0xb1')](_0x441a('0xee'),_0x1d9f8f[_0x441a('0x3c')],_0x1d9f8f['email']||_0x1d9f8f[_0x441a('0xe4')][_0x441a('0x5e')]),'to':_0x48b891['forwardOfflineAddress'],'subject':_0x48b891[_0x441a('0xef')],'html':_0x597fe7[_0x441a('0x5d')],'attachments':_0xfb627c}},client9003)[_0x441a('0x21')](function(){return _0x597fe7;})[_0x441a('0x2b')](function(_0x3b2953){console[_0x441a('0x27')](_0x3b2953);});}})[_0x441a('0x21')](function(){if(_0x48b891&&_0x48b891[_0x441a('0xde')]&&_0x48b891[_0x441a('0xf0')]){var _0x5c278b=[];if(_0x57f529[_0x441a('0x4b')]){_0x5c278b=_0x57f529[_0x441a('0x3f')](function(_0x3c2d61){return{'name':_0x3c2d61['originalname'],'basename':_0x3c2d61[_0x441a('0x76')],'type':_0x3c2d61['mimetype'],'ChatOfflineMessageId':_0xb461dc['id']};});}var _0x29c4ce;if(!_['isNil'](_0x48b891['subjectOffline'])){var _0x5b65b8=_[_0x441a('0x3f')](_0x26278b['body'],function(_0x5c1f7e){return _0x5c1f7e;});var _0x1c204f=_['toPairsIn'](_0x5b65b8)[0x0];var _0x2f3717=_[_0x441a('0xf1')](_0x1c204f,function(_0x4ec31c){return _0x4ec31c;});_0x29c4ce=_0x2f3717[0x1][_0x48b891[_0x441a('0xf2')]];}var _0x205ed0={'from':_0x156468[_0x441a('0xf3')],'firstName':_0x156468[_0x441a('0xac')],'lastName':_0x156468['lastName'],'mapKey':_0x441a('0xf3'),'message':{'from':_0x156468[_0x441a('0xf3')],'to':_0x48b891[_0x441a('0xd1')][_0x441a('0xf3')],'cc':'','subject':_[_0x441a('0x84')](_0x29c4ce)?_0x48b891['offlineMessageSubject']:_0x29c4ce,'messageId':'','sentAt':new Date(),'attach':_0x5c278b['length'],'attachments':_0x5c278b,'originChannel':'Chat','ChatWebsiteId':_0x48b891['id'],'ChatOfflineMessageId':_0x597fe7['id'],'originTo':_0x48b891[_0x441a('0xd1')][_0x441a('0xf3')]},'body':_0x597fe7[_0x441a('0x5d')]};var _0x19e98d={'account':{'id':_0x48b891[_0x441a('0xf0')]},'body':_0x205ed0,'log':_0x441a('0xf4')};return respondWithRpcPromise(_0x441a('0xf4'),_0x441a('0xf5'),_0x19e98d,client9001)['then'](function(){return _0x597fe7;})[_0x441a('0x2b')](function(_0x23dc82){console[_0x441a('0x27')](_0x23dc82);});}return;})[_0x441a('0x21')](function(){if(_0x597fe7){return _0x597fe7;}})['then'](respondWithResult(_0x1097ca,null))[_0x441a('0x2b')](function(_0x59f3ed){console['error'](_0x441a('0x2b'),_0x59f3ed);for(var _0x1a6f3c of _0x57f529){var _0x11e92f=path[_0x441a('0x7c')](config['root'],_0x441a('0xda'),_0x441a('0xcc'),_0x441a('0xdb'),'offline-chat',_0x1a6f3c[_0x441a('0x76')]);fs_extra[_0x441a('0xf6')](_0x11e92f)[_0x441a('0x2b')](function(_0x3db9cf){console[_0x441a('0x27')](_0x441a('0xf7'),_0x11e92f,_0x3db9cf);});}});};exports[_0x441a('0xf8')]=function(_0x2a9d29,_0x5660fc,_0x2bda4a){return db[_0x441a('0xb8')][_0x441a('0x5c')]({'where':{'id':_0x2a9d29['params']['id']}})['then'](handleEntityNotFound(_0x5660fc,null))[_0x441a('0x21')](function(_0x4949ff){if(_0x4949ff){return _0x4949ff[_0x441a('0xf8')](_0x2a9d29[_0x441a('0x5d')][_0x441a('0x72')],_[_0x441a('0xf9')](_0x2a9d29[_0x441a('0x5d')],['ids','id'])||{});}})[_0x441a('0x21')](respondWithResult(_0x5660fc,null))['catch'](handleError(_0x5660fc,null));};exports[_0x441a('0xfa')]=function(_0x2da97f,_0xb8d2c4,_0x4a2401){var _0x50adc1={'raw':![],'where':{}};var _0x3770c3={};var _0x260bd5={'count':0x0,'rows':[]};return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x2da97f[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0xb8d2c4,null))[_0x441a('0x21')](function(_0x432623){if(_0x432623){_0x3770c3[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0xb8')][_0x441a('0x41')]);_0x3770c3[_0x441a('0x46')]=_['keys'](_0x2da97f['query']);_0x3770c3[_0x441a('0x51')]=_[_0x441a('0x48')](_0x3770c3[_0x441a('0x45')],_0x3770c3['query']);_0x50adc1[_0x441a('0x49')]=_[_0x441a('0x48')](_0x3770c3['model'],qs['fields'](_0x2da97f[_0x441a('0x46')]['fields']));_0x50adc1[_0x441a('0x49')]=_0x50adc1[_0x441a('0x49')][_0x441a('0x4b')]?_0x50adc1[_0x441a('0x49')]:_0x3770c3[_0x441a('0x45')];if(!_0x2da97f['query'][_0x441a('0x4c')]('nolimit')){_0x50adc1[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x2da97f[_0x441a('0x46')][_0x441a('0x31')]);_0x50adc1[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x2da97f['query'][_0x441a('0x30')]);}_0x50adc1[_0x441a('0x4e')]=qs[_0x441a('0x4f')](_0x2da97f['query']['sort']);_0x50adc1[_0x441a('0x50')]=qs['filters'](_[_0x441a('0x6c')](_0x2da97f[_0x441a('0x46')],_0x3770c3[_0x441a('0x51')]));_0x50adc1[_0x441a('0x50')][_0x441a('0x6d')]=_0x432623['id'];if(_0x2da97f[_0x441a('0x46')]['filter']){_0x50adc1[_0x441a('0x50')]=_[_0x441a('0x53')](_0x50adc1['where'],{'$or':_[_0x441a('0x3f')](_0x50adc1['attributes'],function(_0x11c147){var _0x3eff51={};_0x3eff51[_0x11c147]={'$like':'%'+_0x2da97f[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x3eff51;})});}_0x50adc1=_[_0x441a('0x53')]({},_0x50adc1,_0x2da97f[_0x441a('0x55')]);return db[_0x441a('0xb8')][_0x441a('0x33')]({'where':_0x50adc1[_0x441a('0x50')]})['then'](function(_0x61f30e){_0x260bd5[_0x441a('0x33')]=_0x61f30e;if(_0x2da97f[_0x441a('0x46')][_0x441a('0x56')]){_0x50adc1[_0x441a('0x57')]=[{'model':db[_0x441a('0x8e')],'as':_0x441a('0xfb'),'required':![]},{'model':db['User'],'as':_0x441a('0xfc'),'attributes':[_0x441a('0x3c'),_0x441a('0xfd'),_0x441a('0xfe')],'required':![]},{'model':db['Tag'],'as':_0x441a('0xff'),'attributes':['id','name',_0x441a('0x100')],'where':_0x2da97f[_0x441a('0x46')]['tag']?{'id':_0x2da97f[_0x441a('0x46')][_0x441a('0x101')]}:undefined,'required':_0x2da97f[_0x441a('0x46')][_0x441a('0x101')]?!![]:![]}];}return db['ChatInteraction'][_0x441a('0x58')](_0x50adc1);})[_0x441a('0x21')](function(_0x468084){_0x260bd5[_0x441a('0x59')]=_0x468084;return _0x260bd5;});}})['then'](respondWithFilteredResult(_0xb8d2c4,_0x50adc1))[_0x441a('0x2b')](handleError(_0xb8d2c4,null));};function iftimePromise(_0xa16706,_0x1186b8){return respondWithRpcPromise(_0x441a('0x102'),_0x441a('0x103'),{'command':_0x1186b8[_0x441a('0x104')]?util[_0x441a('0xb1')]('iftime\x20%s,%s',_0xa16706['interval'],_0x1186b8['timezone']):util['format']('iftime\x20%s',_0xa16706['interval'])},client9002)[_0x441a('0x21')](function(_0x421493){var _0x190853=_0x421493&&_0x421493[_0x441a('0x105')](_0x441a('0x106'))>=0x0?!![]:![];logger[_0x441a('0x22')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1186b8['id'],_0xa16706['id'],_0xa16706['interval'],_0x190853?_0x441a('0x107'):_0x441a('0x108'),_0x1186b8[_0x441a('0x104')]?_0x1186b8[_0x441a('0x104')]:_0x441a('0x109'));return _0x190853;})['catch'](function(_0x5389c0){logger[_0x441a('0x27')](_0x441a('0x10a'),_0x1186b8['id'],_0xa16706['id'],_0xa16706[_0x441a('0x10b')],util[_0x441a('0x10c')](_0x5389c0,{'showHidden':![],'depth':null}),_0x1186b8[_0x441a('0x104')]?_0x1186b8[_0x441a('0x104')]:_0x441a('0x109'));return![];});}exports[_0x441a('0x103')]=function(_0x34e516,_0x3ee391,_0x17dd66){var _0x277926=0x0;var _0x4639a4=0x0;var _0x14e930=![];var _0x5b3a04;var _0x4d8e11;return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x34e516[_0x441a('0x66')]['id']},'include':[{'model':db[_0x441a('0x10d')],'as':_0x441a('0x10d'),'include':[{'model':db[_0x441a('0x10d')],'as':_0x441a('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3ee391,null))[_0x441a('0x21')](function(_0x4b4c12){if(_0x4b4c12){_0x5b3a04=_0x4b4c12;return _0x4b4c12[_0x441a('0x10f')]({'raw':!![]});}})[_0x441a('0x21')](function(_0x1ea5df){if(_0x5b3a04){if(_0x1ea5df){_0x4d8e11=_0x1ea5df;}}return require(_0x441a('0x7e'))[_0x441a('0x7f')]();})[_0x441a('0x21')](function(_0x2348ed){if(_0x2348ed){_0x4639a4=_0x2348ed[_0x441a('0x110')];_0x14e930=_0x2348ed[_0x441a('0x111')];}})[_0x441a('0x21')](function(){return db[_0x441a('0xb8')][_0x441a('0x33')]({'where':{'closed':![]}});})[_0x441a('0x21')](function(_0x2308da){_0x277926=_0x2308da;if(_0x4639a4&&_0x2308da>_0x4639a4){return db[_0x441a('0x112')][_0x441a('0x6b')]({'where':{'id':0x1}})[_0x441a('0x21')](function(_0x345c05){if(_0x345c05){_0x345c05[_0x441a('0x113')](_0x441a('0x114'));}});}})[_0x441a('0x21')](function(){if(_0x5b3a04[_0x441a('0x10d')]&&_0x5b3a04[_0x441a('0x10d')][_0x441a('0x10e')]){var _0x130cde=[];for(var _0x32bf8e=0x0;_0x32bf8e<_0x5b3a04[_0x441a('0x10d')][_0x441a('0x10e')][_0x441a('0x4b')];_0x32bf8e++){var _0x3a2cec=_0x5b3a04[_0x441a('0x10d')][_0x441a('0x10e')][_0x32bf8e][_0x441a('0x39')]({'plain':!![]});_0x130cde[_0x441a('0xc0')](iftimePromise(_0x3a2cec,_0x5b3a04));}return BPromise[_0x441a('0x115')](_0x130cde)[_0x441a('0x21')](function(_0x334c7b){return _[_0x441a('0x116')](_0x334c7b);});}else{return!![];}})[_0x441a('0x21')](function(_0x575bac){var _0x50ea4d=fs[_0x441a('0x117')](path['join'](config[_0x441a('0x7d')],_0x441a('0x118')),_0x441a('0xd4'));var _0x52064b={'remote':_0x5b3a04['remote'],'query':querystring[_0x441a('0x26')](_['merge'](_0x5b3a04['get']({'plain':!![]}),{'customerIp':_0x34e516[_0x441a('0x8b')][_0x441a('0xa9')]||_0x34e516[_0x441a('0x8b')][_0x441a('0x119')]||_0x34e516['connection']['remoteAddress']||_0x34e516['ip'],'referer':_0x34e516[_0x441a('0x8b')][_0x441a('0xae')],'openedInteractions':_0x277926,'maxInteractions':_0x4639a4,'virtual':_0x14e930[_0x441a('0x110')],'online':_0x575bac,'custom':_0x14e930}))['replace'](/'/g,'\x5c\x27')};_0x3ee391[_0x441a('0x3d')](ejs[_0x441a('0xd5')](Mustache['render'](_0x50ea4d,_0x52064b),{'proactiveActions':_0x4d8e11,'alignment':_0x5b3a04['alignment'],'verticalAlignment':_0x5b3a04['verticalAlignment'],'div_color':_0x5b3a04['color'],'text_color':_0x5b3a04['textColor'],'button_color':_0x5b3a04[_0x441a('0x11a')],'background_color':_0x5b3a04[_0x441a('0x11b')]}));})['catch'](handleError(_0x3ee391,null));};exports[_0x441a('0x11c')]=function(_0x886eec,_0x553331,_0x43d5a7){return db[_0x441a('0x40')]['findOne']({'where':{'id':_0x886eec['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x553331,null))[_0x441a('0x21')](function(_0x4635ca){if(_0x4635ca){return db['sequelize']['transaction'](function(_0xee63b4){return db['ChatApplication'][_0x441a('0x38')]({'where':{'ChatWebsiteId':_0x886eec[_0x441a('0x66')]['id']},'transaction':_0xee63b4})[_0x441a('0x21')](function(_0x55776a){var _0x2486eb=_[_0x441a('0x3f')](_0x886eec['body'],function(_0x425cfc){_0x425cfc[_0x441a('0x6d')]=_0x886eec[_0x441a('0x66')]['id'];return _0x425cfc;});return db[_0x441a('0xa0')][_0x441a('0xe2')](_0x2486eb,{'transaction':_0xee63b4});});})[_0x441a('0x21')](function(){return db[_0x441a('0xa0')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x886eec['params']['id']},'order':_0x441a('0xa5')});});}})[_0x441a('0x21')](respondWithResult(_0x553331,null))[_0x441a('0x2b')](handleError(_0x553331,null));};exports[_0x441a('0x11d')]=function(_0x30a33b,_0x185ac0,_0x4b1fdf){var _0x419828={};var _0x20bf40={};var _0x4ee58d;var _0x1cf685;return db[_0x441a('0x40')]['findOne']({'where':{'id':_0x30a33b[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x185ac0,null))[_0x441a('0x21')](function(_0x4b6316){if(_0x4b6316){_0x4ee58d=_0x4b6316;_0x20bf40[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0xa0')][_0x441a('0x41')]);_0x20bf40[_0x441a('0x46')]=_[_0x441a('0x47')](_0x30a33b['query']);_0x20bf40['filters']=_[_0x441a('0x48')](_0x20bf40['model'],_0x20bf40[_0x441a('0x46')]);_0x419828[_0x441a('0x49')]=_[_0x441a('0x48')](_0x20bf40[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x30a33b[_0x441a('0x46')][_0x441a('0x4a')]));_0x419828['attributes']=_0x419828[_0x441a('0x49')][_0x441a('0x4b')]?_0x419828[_0x441a('0x49')]:_0x20bf40[_0x441a('0x45')];_0x419828['order']=qs['sort'](_0x30a33b[_0x441a('0x46')][_0x441a('0x4f')]);_0x419828[_0x441a('0x50')]=qs[_0x441a('0x51')](_[_0x441a('0x6c')](_0x30a33b[_0x441a('0x46')],_0x20bf40['filters']));if(_0x30a33b[_0x441a('0x46')][_0x441a('0x52')]){_0x419828[_0x441a('0x50')]=_[_0x441a('0x53')](_0x419828['where'],{'$or':_[_0x441a('0x3f')](_0x419828[_0x441a('0x49')],function(_0x31310e){var _0x15d54e={};_0x15d54e[_0x31310e]={'$like':'%'+_0x30a33b[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x15d54e;})});}_0x419828=_[_0x441a('0x53')]({},_0x419828,_0x30a33b[_0x441a('0x55')]);return _0x4ee58d[_0x441a('0x11d')](_0x419828);}})[_0x441a('0x21')](function(_0x3cd4e5){if(_0x3cd4e5){_0x1cf685=_0x3cd4e5[_0x441a('0x4b')];if(!_0x30a33b[_0x441a('0x46')][_0x441a('0x4c')](_0x441a('0x4d'))){_0x419828[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x30a33b[_0x441a('0x46')]['limit']);_0x419828[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x30a33b[_0x441a('0x46')][_0x441a('0x30')]);}return _0x4ee58d[_0x441a('0x11d')](_0x419828);}})['then'](function(_0x3598a1){if(_0x3598a1){return _0x3598a1?{'count':_0x1cf685,'rows':_0x3598a1}:null;}})[_0x441a('0x21')](respondWithResult(_0x185ac0,null))[_0x441a('0x2b')](handleError(_0x185ac0,null));};exports[_0x441a('0x11e')]=function(_0x268548,_0x54a732,_0x424eba){return db['chatProactiveAction'][_0x441a('0x5c')]({'where':{'id':_0x268548[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x54a732,null))[_0x441a('0x21')](function(_0x451308){if(_0x451308){return _0x451308[_0x441a('0x11e')](_0x268548['body'][_0x441a('0x72')],_[_0x441a('0xf9')](_0x268548[_0x441a('0x5d')],[_0x441a('0x72'),'id'])||{});}})[_0x441a('0x21')](respondWithResult(_0x54a732,null))[_0x441a('0x2b')](handleError(_0x54a732,null));};exports['getProactiveActions']=function(_0x58fed5,_0x514ce4,_0x4a8a00){var _0x5eb301={};var _0xf8fad8={};var _0x32df86;var _0x30903d;return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x58fed5[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x514ce4,null))[_0x441a('0x21')](function(_0x52bcdc){if(_0x52bcdc){_0x32df86=_0x52bcdc;_0xf8fad8[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0x11f')][_0x441a('0x41')]);_0xf8fad8['query']=_[_0x441a('0x47')](_0x58fed5[_0x441a('0x46')]);_0xf8fad8[_0x441a('0x51')]=_[_0x441a('0x48')](_0xf8fad8['model'],_0xf8fad8['query']);_0x5eb301['attributes']=_[_0x441a('0x48')](_0xf8fad8[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x58fed5[_0x441a('0x46')]['fields']));_0x5eb301['attributes']=_0x5eb301['attributes'][_0x441a('0x4b')]?_0x5eb301['attributes']:_0xf8fad8[_0x441a('0x45')];_0x5eb301['order']=qs['sort'](_0x58fed5[_0x441a('0x46')]['sort']);_0x5eb301[_0x441a('0x50')]=qs[_0x441a('0x51')](_[_0x441a('0x6c')](_0x58fed5[_0x441a('0x46')],_0xf8fad8['filters']));if(_0x58fed5[_0x441a('0x46')]['filter']){_0x5eb301['where']=_['merge'](_0x5eb301['where'],{'$or':_[_0x441a('0x3f')](_0x5eb301[_0x441a('0x49')],function(_0x476e67){var _0x5ad3a9={};_0x5ad3a9[_0x476e67]={'$like':'%'+_0x58fed5[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x5ad3a9;})});}_0x5eb301=_[_0x441a('0x53')]({},_0x5eb301,_0x58fed5[_0x441a('0x55')]);return _0x32df86[_0x441a('0x10f')](_0x5eb301);}})[_0x441a('0x21')](function(_0x5bd0a4){if(_0x5bd0a4){_0x30903d=_0x5bd0a4[_0x441a('0x4b')];if(!_0x58fed5[_0x441a('0x46')][_0x441a('0x4c')]('nolimit')){_0x5eb301[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x58fed5[_0x441a('0x46')][_0x441a('0x31')]);_0x5eb301[_0x441a('0x30')]=qs['offset'](_0x58fed5[_0x441a('0x46')][_0x441a('0x30')]);}return _0x32df86['getProactiveActions'](_0x5eb301);}})[_0x441a('0x21')](function(_0x4b887a){if(_0x4b887a){return _0x4b887a?{'count':_0x30903d,'rows':_0x4b887a}:null;}})['then'](respondWithResult(_0x514ce4,null))[_0x441a('0x2b')](handleError(_0x514ce4,null));};exports['getFields']=function(_0x396dbd,_0x2e872e,_0x433efa){var _0x3bc578=_0x396dbd['query'][_0x441a('0x120')]==='false'?_0x441a('0x121'):_0x441a('0x122');return db['ChatWebsite']['find']({'attributes':['id',_0x3bc578],'where':{'id':_0x396dbd['params']['id']}})['then'](handleEntityNotFound(_0x2e872e,null))['then'](function(_0x48b51b){if(_0x48b51b){var _0xa67ede=_0x48b51b[_0x3bc578];var _0xd65774=_0xa67ede&&_0xa67ede[_0x441a('0x123')]?_0xa67ede[_0x441a('0x123')]:[];_0x2e872e['send']({'fromKey':_[_0x441a('0x84')](_0xa67ede[_0x441a('0x124')])?undefined:_0xa67ede['fromKey'],'count':_0xd65774[_0x441a('0x4b')],'rows':_0xd65774});}})['catch'](handleError(_0x2e872e,null));};exports[_0x441a('0x125')]=function(_0x5779a3,_0x2ad0df,_0x228690){var _0x3da6b6={'raw':![],'where':{}};var _0x5cc0d2={};var _0x2e9181={'count':0x0,'rows':[]};return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x5779a3[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x2ad0df,null))['then'](function(_0x240b36){if(_0x240b36){_0x5cc0d2[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0x126')]['rawAttributes']);_0x5cc0d2[_0x441a('0x46')]=_[_0x441a('0x47')](_0x5779a3[_0x441a('0x46')]);_0x5cc0d2[_0x441a('0x51')]=_[_0x441a('0x48')](_0x5cc0d2['model'],_0x5cc0d2['query']);_0x3da6b6[_0x441a('0x49')]=_[_0x441a('0x48')](_0x5cc0d2[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x5779a3[_0x441a('0x46')][_0x441a('0x4a')]));_0x3da6b6['attributes']=_0x3da6b6['attributes'][_0x441a('0x4b')]?_0x3da6b6[_0x441a('0x49')]:_0x5cc0d2[_0x441a('0x45')];if(!_0x5779a3['query'][_0x441a('0x4c')](_0x441a('0x4d'))){_0x3da6b6['limit']=qs[_0x441a('0x31')](_0x5779a3[_0x441a('0x46')][_0x441a('0x31')]);_0x3da6b6[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x5779a3[_0x441a('0x46')][_0x441a('0x30')]);}_0x3da6b6[_0x441a('0x4e')]=qs['sort'](_0x5779a3[_0x441a('0x46')][_0x441a('0x4f')]);_0x3da6b6[_0x441a('0x50')]=qs['filters'](_[_0x441a('0x6c')](_0x5779a3[_0x441a('0x46')],_0x5cc0d2['filters']));_0x3da6b6[_0x441a('0x50')][_0x441a('0x6d')]=_0x240b36['id'];if(_0x5779a3[_0x441a('0x46')]['filter']){_0x3da6b6[_0x441a('0x50')]=_[_0x441a('0x53')](_0x3da6b6['where'],{'$or':_[_0x441a('0x3f')](_0x3da6b6[_0x441a('0x49')],function(_0x82035f){var _0x331e42={};_0x331e42[_0x82035f]={'$like':'%'+_0x5779a3['query']['filter']+'%'};return _0x331e42;})});}_0x3da6b6=_['merge']({},_0x3da6b6,_0x5779a3[_0x441a('0x55')]);return db[_0x441a('0x126')][_0x441a('0x33')]({'where':_0x3da6b6[_0x441a('0x50')]})[_0x441a('0x21')](function(_0x2e5d2d){_0x2e9181['count']=_0x2e5d2d;if(_0x5779a3[_0x441a('0x46')][_0x441a('0x56')]){_0x3da6b6[_0x441a('0x57')]=[{'all':!![]}];}else{_0x3da6b6['include']=[{'model':db[_0x441a('0x8e')],'as':'Contact','required':![]},{'model':db[_0x441a('0xe1')],'as':_0x441a('0x127'),'required':![]}];}return db[_0x441a('0x126')][_0x441a('0x58')](_0x3da6b6);})[_0x441a('0x21')](function(_0x11e927){_0x2e9181[_0x441a('0x59')]=_0x11e927;return _0x2e9181;});}})['then'](respondWithFilteredResult(_0x2ad0df,_0x3da6b6))['catch'](handleError(_0x2ad0df,null));};exports['addAgents']=function(_0xe73e23,_0x9579ab,_0x23afa9){return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0xe73e23[_0x441a('0x66')]['id']}})['then'](handleEntityNotFound(_0x9579ab,null))[_0x441a('0x21')](function(_0x5eb0ee){if(_0x5eb0ee){return _0x5eb0ee['addAgents'](_0xe73e23[_0x441a('0x5d')][_0x441a('0x72')],_[_0x441a('0xf9')](_0xe73e23[_0x441a('0x5d')],[_0x441a('0x72'),'id'])||{})[_0x441a('0xbc')](function(_0x5ca471){for(var _0x42e48c=0x0;_0x42e48c<_0xe73e23[_0x441a('0x5d')][_0x441a('0x72')]['length'];_0x42e48c+=0x1){socket[_0x441a('0x128')]('userChatWebsite:save',{'UserId':Number(_0xe73e23[_0x441a('0x5d')][_0x441a('0x72')][_0x42e48c]),'ChatWebsiteId':Number(_0xe73e23[_0x441a('0x66')]['id'])});}return _0x5ca471;});}})['then'](respondWithResult(_0x9579ab,null))['catch'](handleError(_0x9579ab,null));};exports['removeAgents']=function(_0x10c26c,_0x5a6352,_0x2be95e){return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x10c26c[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x5a6352,null))[_0x441a('0x21')](function(_0x21268a){if(_0x21268a){return _0x21268a[_0x441a('0x129')](_0x10c26c[_0x441a('0x46')][_0x441a('0x72')])[_0x441a('0x21')](function(){if(_['isArray'](_0x10c26c[_0x441a('0x46')][_0x441a('0x72')])){for(var _0x57d489=0x0;_0x57d489<_0x10c26c[_0x441a('0x46')][_0x441a('0x72')][_0x441a('0x4b')];_0x57d489+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x10c26c['query'][_0x441a('0x72')][_0x57d489]),'ChatWebsiteId':Number(_0x10c26c['params']['id'])});}}else{socket['emit'](_0x441a('0x12a'),{'UserId':Number(_0x10c26c[_0x441a('0x46')][_0x441a('0x72')]),'ChatWebsiteId':Number(_0x10c26c['params']['id'])});}});}})[_0x441a('0x21')](respondWithStatusCode(_0x5a6352,null))[_0x441a('0x2b')](handleError(_0x5a6352,null));};exports[_0x441a('0x12b')]=function(_0x24c33d,_0x7518c9,_0x3bfaa5){var _0x4ade91={};var _0x5e561d={};var _0x2f1ff9;var _0x3ec193;return db[_0x441a('0x40')]['findOne']({'where':{'id':_0x24c33d[_0x441a('0x66')]['id']}})['then'](handleEntityNotFound(_0x7518c9,null))[_0x441a('0x21')](function(_0x3798f6){if(_0x3798f6){_0x2f1ff9=_0x3798f6;_0x5e561d[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0xc6')][_0x441a('0x41')]);_0x5e561d[_0x441a('0x46')]=_['keys'](_0x24c33d[_0x441a('0x46')]);_0x5e561d[_0x441a('0x51')]=_['intersection'](_0x5e561d[_0x441a('0x45')],_0x5e561d[_0x441a('0x46')]);_0x4ade91['attributes']=_[_0x441a('0x48')](_0x5e561d['model'],qs[_0x441a('0x4a')](_0x24c33d['query'][_0x441a('0x4a')]));_0x4ade91[_0x441a('0x49')]=_0x4ade91[_0x441a('0x49')]['length']?_0x4ade91[_0x441a('0x49')]:_0x5e561d[_0x441a('0x45')];_0x4ade91[_0x441a('0x4e')]=qs[_0x441a('0x4f')](_0x24c33d['query'][_0x441a('0x4f')]);_0x4ade91[_0x441a('0x50')]=qs[_0x441a('0x51')](_[_0x441a('0x6c')](_0x24c33d[_0x441a('0x46')],_0x5e561d[_0x441a('0x51')]));if(_0x24c33d[_0x441a('0x46')][_0x441a('0x52')]){_0x4ade91['where']=_[_0x441a('0x53')](_0x4ade91[_0x441a('0x50')],{'$or':_['map'](_0x4ade91[_0x441a('0x49')],function(_0x44c072){var _0x4f1b4d={};_0x4f1b4d[_0x44c072]={'$like':'%'+_0x24c33d[_0x441a('0x46')]['filter']+'%'};return _0x4f1b4d;})});}_0x4ade91=_[_0x441a('0x53')]({},_0x4ade91,_0x24c33d[_0x441a('0x55')]);return _0x2f1ff9[_0x441a('0x12b')](_0x4ade91);}})['then'](function(_0x341f49){if(_0x341f49){_0x3ec193=_0x341f49[_0x441a('0x4b')];if(!_0x24c33d[_0x441a('0x46')][_0x441a('0x4c')]('nolimit')){_0x4ade91['limit']=qs[_0x441a('0x31')](_0x24c33d['query']['limit']);_0x4ade91['offset']=qs[_0x441a('0x30')](_0x24c33d[_0x441a('0x46')][_0x441a('0x30')]);}return _0x2f1ff9[_0x441a('0x12b')](_0x4ade91);}})[_0x441a('0x21')](function(_0x37084b){if(_0x37084b){return _0x37084b?{'count':_0x3ec193,'rows':_0x37084b}:null;}})['then'](respondWithResult(_0x7518c9,null))[_0x441a('0x2b')](handleError(_0x7518c9,null));};
\ No newline at end of file
index fe24dea..71a12f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd737=['save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite'];(function(_0xe53fe3,_0x28ab98){var _0x22c250=function(_0x49d661){while(--_0x49d661){_0xe53fe3['push'](_0xe53fe3['shift']());}};_0x22c250(++_0x28ab98);}(_0xd737,0x85));var _0x7d73=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xd737[_0x3e6d5d];return _0x238923;};'use strict';var EventEmitter=require(_0x7d73('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7d73('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d73('0x2'),'afterUpdate':_0x7d73('0x3'),'afterDestroy':_0x7d73('0x4')};function emitEvent(_0x5cfa01){return function(_0x5369be,_0x3e19ad,_0x493f54){ChatWebsiteEvents['emit'](_0x5cfa01+':'+_0x5369be['id'],_0x5369be);ChatWebsiteEvents[_0x7d73('0x5')](_0x5cfa01,_0x5369be);_0x493f54(null);};}for(var e in events){if(events[_0x7d73('0x6')](e)){var event=events[e];ChatWebsite[_0x7d73('0x7')](e,emitEvent(event));}}module[_0x7d73('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x14ee=['update','remove','hook','exports','events','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14ee,0x115));var _0xe14e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14ee[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe14e('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe14e('0x1')](0x0);var events={'afterCreate':_0xe14e('0x2'),'afterUpdate':_0xe14e('0x3'),'afterDestroy':_0xe14e('0x4')};function emitEvent(_0x244b80){return function(_0x5db128,_0x1c8074,_0xb8bb83){ChatWebsiteEvents['emit'](_0x244b80+':'+_0x5db128['id'],_0x5db128);ChatWebsiteEvents['emit'](_0x244b80,_0x5db128);_0xb8bb83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xe14e('0x5')](e,emitEvent(event));}}module[_0xe14e('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
index 35c9663..0f29a84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd901=['define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','request-promise','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x410612,_0x551c48){var _0xbfa860=function(_0x4fb412){while(--_0x4fb412){_0x410612['push'](_0x410612['shift']());}};_0xbfa860(++_0x551c48);}(_0xd901,0x116));var _0x1d90=function(_0x310173,_0x1e3c4b){_0x310173=_0x310173-0x0;var _0x625b1b=_0xd901[_0x310173];return _0x625b1b;};'use strict';var _=require('lodash');var util=require(_0x1d90('0x0'));var logger=require(_0x1d90('0x1'))(_0x1d90('0x2'));var moment=require(_0x1d90('0x3'));var BPromise=require('bluebird');var rp=require(_0x1d90('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1d90('0x5'));var attributes=require(_0x1d90('0x6'));module[_0x1d90('0x7')]=function(_0x5e920a,_0x4917cc){return _0x5e920a[_0x1d90('0x8')](_0x1d90('0x9'),attributes,{'tableName':_0x1d90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdccb=['ChatWebsite','chat_websites','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x46759d,_0x13e994){var _0x3e7fe0=function(_0x2f427d){while(--_0x2f427d){_0x46759d['push'](_0x46759d['shift']());}};_0x3e7fe0(++_0x13e994);}(_0xdccb,0x16a));var _0xbdcc=function(_0xdfc87d,_0x28e1a5){_0xdfc87d=_0xdfc87d-0x0;var _0x4e2a5e=_0xdccb[_0xdfc87d];return _0x4e2a5e;};'use strict';var _=require(_0xbdcc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdcc('0x1'));var moment=require(_0xbdcc('0x2'));var BPromise=require(_0xbdcc('0x3'));var rp=require(_0xbdcc('0x4'));var fs=require('fs');var path=require(_0xbdcc('0x5'));var rimraf=require(_0xbdcc('0x6'));var config=require(_0xbdcc('0x7'));var attributes=require(_0xbdcc('0x8'));module[_0xbdcc('0x9')]=function(_0x598516,_0x2dfd56){return _0x598516['define'](_0xbdcc('0xa'),attributes,{'tableName':_0xbdcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 95fc046..9f77417 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc88f=['request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x545dee,_0x2cbff4){var _0x3a25a6=function(_0x213d43){while(--_0x213d43){_0x545dee['push'](_0x545dee['shift']());}};_0x3a25a6(++_0x2cbff4);}(_0xc88f,0xdd));var _0xfc88=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc88f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfc88('0x0'));var util=require(_0xfc88('0x1'));var moment=require(_0xfc88('0x2'));var BPromise=require(_0xfc88('0x3'));var rs=require(_0xfc88('0x4'));var fs=require('fs');var Redis=require(_0xfc88('0x5'));var db=require(_0xfc88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc88('0x7'))(_0xfc88('0x8'));var config=require(_0xfc88('0x9'));var jayson=require(_0xfc88('0xa'));var client=jayson[_0xfc88('0xb')][_0xfc88('0xc')]({'port':0x232a});config[_0xfc88('0xd')]=_[_0xfc88('0xe')](config[_0xfc88('0xd')],{'host':_0xfc88('0xf'),'port':0x18eb});var socket=require(_0xfc88('0x10'))(new Redis(config['redis']));require(_0xfc88('0x11'))[_0xfc88('0x12')](socket);function respondWithRpcPromise(_0x39c133,_0x3b96a8,_0x300632){return new BPromise(function(_0x581cfe,_0x2d2c12){return client[_0xfc88('0x13')](_0x39c133,_0x300632)['then'](function(_0x27c936){logger[_0xfc88('0x14')](_0xfc88('0x15'),_0x3b96a8,_0xfc88('0x16'));logger[_0xfc88('0x17')](_0xfc88('0x18'),_0x3b96a8,_0xfc88('0x16'),JSON[_0xfc88('0x19')](_0x27c936));if(_0x27c936[_0xfc88('0x1a')]){if(_0x27c936[_0xfc88('0x1a')][_0xfc88('0x1b')]===0x1f4){logger[_0xfc88('0x1a')](_0xfc88('0x15'),_0x3b96a8,_0x27c936[_0xfc88('0x1a')][_0xfc88('0x1c')]);return _0x2d2c12(_0x27c936[_0xfc88('0x1a')][_0xfc88('0x1c')]);}logger[_0xfc88('0x1a')](_0xfc88('0x15'),_0x3b96a8,_0x27c936[_0xfc88('0x1a')][_0xfc88('0x1c')]);return _0x581cfe(_0x27c936['error']['message']);}else{logger[_0xfc88('0x14')](_0xfc88('0x15'),_0x3b96a8,_0xfc88('0x16'));_0x581cfe(_0x27c936[_0xfc88('0x1d')]['message']);}})['catch'](function(_0x39b2e8){logger[_0xfc88('0x1a')](_0xfc88('0x15'),_0x3b96a8,_0x39b2e8);_0x2d2c12(_0x39b2e8);});});}
\ No newline at end of file
+var _0xb9bf=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x2a215e,_0x5d121d){var _0x2f4ca8=function(_0x34519f){while(--_0x34519f){_0x2a215e['push'](_0x2a215e['shift']());}};_0x2f4ca8(++_0x5d121d);}(_0xb9bf,0x1af));var _0xfb9b=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb9bf[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require(_0xfb9b('0x0'));var moment=require(_0xfb9b('0x1'));var BPromise=require('bluebird');var rs=require(_0xfb9b('0x2'));var fs=require('fs');var Redis=require(_0xfb9b('0x3'));var db=require(_0xfb9b('0x4'))['db'];var utils=require(_0xfb9b('0x5'));var logger=require(_0xfb9b('0x6'))(_0xfb9b('0x7'));var config=require(_0xfb9b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfb9b('0x9')]({'port':0x232a});config[_0xfb9b('0xa')]=_[_0xfb9b('0xb')](config[_0xfb9b('0xa')],{'host':_0xfb9b('0xc'),'port':0x18eb});var socket=require(_0xfb9b('0xd'))(new Redis(config[_0xfb9b('0xa')]));require(_0xfb9b('0xe'))[_0xfb9b('0xf')](socket);function respondWithRpcPromise(_0x164d6a,_0x24c434,_0x207bab){return new BPromise(function(_0x5dc46d,_0x518a26){return client[_0xfb9b('0x10')](_0x164d6a,_0x207bab)[_0xfb9b('0x11')](function(_0x542621){logger[_0xfb9b('0x12')](_0xfb9b('0x13'),_0x24c434,_0xfb9b('0x14'));logger[_0xfb9b('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x24c434,_0xfb9b('0x14'),JSON[_0xfb9b('0x16')](_0x542621));if(_0x542621[_0xfb9b('0x17')]){if(_0x542621[_0xfb9b('0x17')]['code']===0x1f4){logger[_0xfb9b('0x17')](_0xfb9b('0x13'),_0x24c434,_0x542621[_0xfb9b('0x17')][_0xfb9b('0x18')]);return _0x518a26(_0x542621['error'][_0xfb9b('0x18')]);}logger[_0xfb9b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x24c434,_0x542621[_0xfb9b('0x17')][_0xfb9b('0x18')]);return _0x5dc46d(_0x542621[_0xfb9b('0x17')][_0xfb9b('0x18')]);}else{logger[_0xfb9b('0x12')](_0xfb9b('0x13'),_0x24c434,_0xfb9b('0x14'));_0x5dc46d(_0x542621[_0xfb9b('0x19')][_0xfb9b('0x18')]);}})['catch'](function(_0x4a3720){logger['error'](_0xfb9b('0x13'),_0x24c434,_0x4a3720);_0x518a26(_0x4a3720);});});}
\ No newline at end of file
index e2569e3..256eed3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd770=['chatWebsite:','./chatWebsite.events','save','remove','update','length'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0xd770,0xd3));var _0x0d77=function(_0x129852,_0x2c1621){_0x129852=_0x129852-0x0;var _0x1fa6aa=_0xd770[_0x129852];return _0x1fa6aa;};'use strict';var ChatWebsiteEvents=require(_0x0d77('0x0'));var events=[_0x0d77('0x1'),_0x0d77('0x2'),_0x0d77('0x3')];function createListener(_0x369d32,_0x13b631){return function(_0x24b41b){_0x13b631['emit'](_0x369d32,_0x24b41b);};}function removeListener(_0x3a22e5,_0x2107ae){return function(){ChatWebsiteEvents['removeListener'](_0x3a22e5,_0x2107ae);};}exports['register']=function(_0x58b892){for(var _0x782cb7=0x0,_0x25d505=events[_0x0d77('0x4')];_0x782cb7<_0x25d505;_0x782cb7++){var _0x60010c=events[_0x782cb7];var _0x53c624=createListener(_0x0d77('0x5')+_0x60010c,_0x58b892);ChatWebsiteEvents['on'](_0x60010c,_0x53c624);}};
\ No newline at end of file
+var _0xc906=['length','./chatWebsite.events','save','update','removeListener','register'];(function(_0x235ada,_0x96d7af){var _0x25e3ff=function(_0x178b49){while(--_0x178b49){_0x235ada['push'](_0x235ada['shift']());}};_0x25e3ff(++_0x96d7af);}(_0xc906,0x109));var _0x6c90=function(_0x37dd34,_0x424244){_0x37dd34=_0x37dd34-0x0;var _0x34c993=_0xc906[_0x37dd34];return _0x34c993;};'use strict';var ChatWebsiteEvents=require(_0x6c90('0x0'));var events=[_0x6c90('0x1'),'remove',_0x6c90('0x2')];function createListener(_0x41cabe,_0x1e8dcc){return function(_0x138bd0){_0x1e8dcc['emit'](_0x41cabe,_0x138bd0);};}function removeListener(_0x3e4aca,_0xd66b09){return function(){ChatWebsiteEvents[_0x6c90('0x3')](_0x3e4aca,_0xd66b09);};}exports[_0x6c90('0x4')]=function(_0x3293e8){for(var _0x4669c5=0x0,_0xb397a7=events[_0x6c90('0x5')];_0x4669c5<_0xb397a7;_0x4669c5++){var _0x13f947=events[_0x4669c5];var _0x147a14=createListener('chatWebsite:'+_0x13f947,_0x3293e8);ChatWebsiteEvents['on'](_0x13f947,_0x147a14);}};
\ No newline at end of file
index fe8f0a3..ec436c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b9b=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','get','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','root','server/files/images/avatars/','originalname','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','/:id/users','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5450cd,_0x1d7545){var _0x1c84ce=function(_0x1a5a40){while(--_0x1a5a40){_0x5450cd['push'](_0x5450cd['shift']());}};_0x1c84ce(++_0x1d7545);}(_0x1b9b,0x89));var _0xb1b9=function(_0x250c18,_0x12e8bf){_0x250c18=_0x250c18-0x0;var _0x5b1b45=_0x1b9b[_0x250c18];return _0x5b1b45;};'use strict';var multer=require(_0xb1b9('0x0'));var util=require('util');var path=require(_0xb1b9('0x1'));var timeout=require(_0xb1b9('0x2'));var express=require(_0xb1b9('0x3'));var router=express[_0xb1b9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb1b9('0x5'));var interaction=require(_0xb1b9('0x6'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x8')]);router['get'](_0xb1b9('0x9'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0xa')]);router['get'](_0xb1b9('0xb'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0xc')]);router['get'](_0xb1b9('0xd'),auth['isAuthenticated'](),controller[_0xb1b9('0xe')]);router['get'](_0xb1b9('0xf'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x10')]);router[_0xb1b9('0x11')](_0xb1b9('0x12'),controller[_0xb1b9('0x13')]);router[_0xb1b9('0x11')](_0xb1b9('0x14'),controller['getAvatar']);router[_0xb1b9('0x11')](_0xb1b9('0x15'),controller[_0xb1b9('0x16')]);router['get'](_0xb1b9('0x17'),controller[_0xb1b9('0x18')]);router[_0xb1b9('0x11')](_0xb1b9('0x19'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x1a')]);router['get'](_0xb1b9('0x1b'),controller['getSnippet']);router[_0xb1b9('0x11')](_0xb1b9('0x1c'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x1d')]);router['get'](_0xb1b9('0x1e'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x1f')]);router['get'](_0xb1b9('0x20'),controller[_0xb1b9('0x21')]);router[_0xb1b9('0x11')](_0xb1b9('0x22'),auth[_0xb1b9('0x7')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x23')]);router[_0xb1b9('0x24')]('/',auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x25')]);router[_0xb1b9('0x24')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xb1b9('0x26')]);router[_0xb1b9('0x24')](_0xb1b9('0xf'),auth['isAuthenticated'](),controller[_0xb1b9('0x27')]);var upload=multer({'storage':multer[_0xb1b9('0x28')]({'destination':function(_0x50c2a7,_0x1556e5,_0x4a14aa){_0x4a14aa(null,path[_0xb1b9('0x29')](config['root'],_0xb1b9('0x2a')));},'filename':function(_0x578116,_0x326e8f,_0x37e4ea){_0x37e4ea(null,util[_0xb1b9('0x2b')](_0xb1b9('0x2c'),Date[_0xb1b9('0x2d')](),_0x326e8f['originalname']));}})});router[_0xb1b9('0x24')](_0xb1b9('0x12'),upload[_0xb1b9('0x2e')](_0xb1b9('0x2f')),controller[_0xb1b9('0x30')]);var upload=multer({'storage':multer[_0xb1b9('0x28')]({'destination':function(_0xcdf0cd,_0x4c2187,_0x493871){_0x493871(null,path['join'](config[_0xb1b9('0x31')],_0xb1b9('0x32')));},'filename':function(_0x2918c5,_0x42b558,_0x452e38){_0x452e38(null,util[_0xb1b9('0x2b')](_0xb1b9('0x2c'),Date[_0xb1b9('0x2d')](),_0x42b558[_0xb1b9('0x33')]));}})});router[_0xb1b9('0x24')](_0xb1b9('0x14'),upload[_0xb1b9('0x2e')]('file'),controller[_0xb1b9('0x34')]);var upload=multer({'storage':multer[_0xb1b9('0x28')]({'destination':function(_0x703713,_0x23ecd7,_0x598cae){_0x598cae(null,path[_0xb1b9('0x29')](config[_0xb1b9('0x31')],_0xb1b9('0x32')));},'filename':function(_0x156013,_0x435c24,_0x337846){_0x337846(null,util[_0xb1b9('0x2b')]('%s-%s',Date[_0xb1b9('0x2d')](),_0x435c24[_0xb1b9('0x33')]));}})});router[_0xb1b9('0x24')]('/:id/customer_avatar',upload[_0xb1b9('0x2e')](_0xb1b9('0x2f')),controller[_0xb1b9('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c6ab0,_0x276b6e,_0x28d0c8){_0x28d0c8(null,path[_0xb1b9('0x29')](config[_0xb1b9('0x31')],'server/files/images/avatars/'));},'filename':function(_0x4427df,_0x3f5b2d,_0x19ea1a){_0x19ea1a(null,util[_0xb1b9('0x2b')](_0xb1b9('0x2c'),Date[_0xb1b9('0x2d')](),_0x3f5b2d['originalname']));}})});router['post'](_0xb1b9('0x17'),upload[_0xb1b9('0x2e')](_0xb1b9('0x2f')),controller[_0xb1b9('0x36')]);router[_0xb1b9('0x24')](_0xb1b9('0x37'),controller[_0xb1b9('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0xb1b9('0x28')]({'destination':function(_0x385c2c,_0x3f8d83,_0x1e09cd){const _0x1f2518=path[_0xb1b9('0x29')](config[_0xb1b9('0x31')],'server/files','attachments',_0xb1b9('0x39'));fs_extra[_0xb1b9('0x3a')](_0x1f2518,function(){_0x1e09cd(null,_0x1f2518);});},'filename':function(_0x21b0b3,_0x12adae,_0x44baa1){const _0x28add4=_0x12adae[_0xb1b9('0x33')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x270f07=path[_0xb1b9('0x3b')](_0x28add4);const _0x30b6ad=Date[_0xb1b9('0x2d')]()+'-'+_0x28add4['replace'](_0x270f07,'')+_0x270f07;_0x44baa1(null,_0x30b6ad);}})});router[_0xb1b9('0x24')](_0xb1b9('0x3c'),offlineUploadMulter['any'](),controller[_0xb1b9('0x3d')]);router[_0xb1b9('0x24')]('/:id/interactions',auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x3e')]);router[_0xb1b9('0x24')]('/:id/applications',auth['isAuthenticated'](),controller[_0xb1b9('0x3f')]);router[_0xb1b9('0x24')](_0xb1b9('0x1e'),auth['isAuthenticated'](),controller[_0xb1b9('0x40')]);router[_0xb1b9('0x24')](_0xb1b9('0x41'),auth['isAuthenticated'](),controller['addAgents']);router[_0xb1b9('0x42')](_0xb1b9('0xb'),auth[_0xb1b9('0x7')](),controller['update']);router['delete']('/:id',auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x43')]);router[_0xb1b9('0x44')](_0xb1b9('0xd'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x45')]);router[_0xb1b9('0x44')](_0xb1b9('0xf'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x46')]);router[_0xb1b9('0x44')](_0xb1b9('0x41'),auth[_0xb1b9('0x7')](),controller[_0xb1b9('0x47')]);module['exports']=router;
\ No newline at end of file
+var _0x37c3=['diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','file','server/files/images/avatars/','addCustomerAvatar','join','/:id/notify','notify','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','addApplications','addProactiveActions','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAgents','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','describe','get','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','/:id/dispositions','addDisposition'];(function(_0x126158,_0x1b9785){var _0x5a2978=function(_0x140322){while(--_0x140322){_0x126158['push'](_0x126158['shift']());}};_0x5a2978(++_0x1b9785);}(_0x37c3,0x122));var _0x337c=function(_0x27b20e,_0x302f69){_0x27b20e=_0x27b20e-0x0;var _0x58950b=_0x37c3[_0x27b20e];return _0x58950b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x337c('0x0'));var timeout=require('connect-timeout');var express=require(_0x337c('0x1'));var router=express[_0x337c('0x2')]();var fs_extra=require(_0x337c('0x3'));var auth=require(_0x337c('0x4'));var interaction=require(_0x337c('0x5'));var config=require('../../config/environment');var controller=require(_0x337c('0x6'));router['get']('/',auth[_0x337c('0x7')](),controller['index']);router['get']('/describe',auth[_0x337c('0x7')](),controller[_0x337c('0x8')]);router[_0x337c('0x9')](_0x337c('0xa'),auth[_0x337c('0x7')](),controller[_0x337c('0xb')]);router[_0x337c('0x9')]('/:id/dispositions',auth[_0x337c('0x7')](),controller[_0x337c('0xc')]);router[_0x337c('0x9')](_0x337c('0xd'),auth[_0x337c('0x7')](),controller[_0x337c('0xe')]);router[_0x337c('0x9')](_0x337c('0xf'),controller[_0x337c('0x10')]);router[_0x337c('0x9')](_0x337c('0x11'),controller['getAvatar']);router['get'](_0x337c('0x12'),controller[_0x337c('0x13')]);router['get']('/:id/system_avatar',controller[_0x337c('0x14')]);router['get'](_0x337c('0x15'),auth[_0x337c('0x7')](),controller[_0x337c('0x16')]);router[_0x337c('0x9')](_0x337c('0x17'),controller[_0x337c('0x18')]);router[_0x337c('0x9')](_0x337c('0x19'),auth['isAuthenticated'](),controller['getApplications']);router[_0x337c('0x9')](_0x337c('0x1a'),auth[_0x337c('0x7')](),controller[_0x337c('0x1b')]);router[_0x337c('0x9')](_0x337c('0x1c'),controller[_0x337c('0x1d')]);router[_0x337c('0x9')](_0x337c('0x1e'),auth[_0x337c('0x7')](),controller[_0x337c('0x1f')]);router[_0x337c('0x9')]('/:id/users',auth[_0x337c('0x7')](),controller['getAgents']);router[_0x337c('0x20')]('/',auth['isAuthenticated'](),controller['create']);router[_0x337c('0x20')](_0x337c('0x21'),auth[_0x337c('0x7')](),controller[_0x337c('0x22')]);router[_0x337c('0x20')](_0x337c('0xd'),auth[_0x337c('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x337c('0x23')]({'destination':function(_0x4f5e26,_0x263fdb,_0x50e312){_0x50e312(null,path['join'](config[_0x337c('0x24')],_0x337c('0x25')));},'filename':function(_0x2f744a,_0x689142,_0x413071){_0x413071(null,util[_0x337c('0x26')](_0x337c('0x27'),Date[_0x337c('0x28')](),_0x689142[_0x337c('0x29')]));}})});router['post'](_0x337c('0xf'),upload[_0x337c('0x2a')]('file'),controller[_0x337c('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d8767,_0x4b2fe2,_0x2c85e9){_0x2c85e9(null,path['join'](config[_0x337c('0x24')],'server/files/images/avatars/'));},'filename':function(_0x167ea4,_0xb22fe5,_0x557ded){_0x557ded(null,util[_0x337c('0x26')](_0x337c('0x27'),Date['now'](),_0xb22fe5[_0x337c('0x29')]));}})});router[_0x337c('0x20')](_0x337c('0x11'),upload[_0x337c('0x2a')](_0x337c('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0x337c('0x23')]({'destination':function(_0x27de90,_0x18e0bc,_0x43175f){_0x43175f(null,path['join'](config['root'],_0x337c('0x2d')));},'filename':function(_0x5c3776,_0x5431b0,_0x1b59ca){_0x1b59ca(null,util[_0x337c('0x26')](_0x337c('0x27'),Date[_0x337c('0x28')](),_0x5431b0['originalname']));}})});router[_0x337c('0x20')]('/:id/customer_avatar',upload[_0x337c('0x2a')](_0x337c('0x2c')),controller[_0x337c('0x2e')]);var upload=multer({'storage':multer[_0x337c('0x23')]({'destination':function(_0x579b30,_0x39308c,_0x48b5d6){_0x48b5d6(null,path[_0x337c('0x2f')](config[_0x337c('0x24')],_0x337c('0x2d')));},'filename':function(_0x31c06f,_0x56e486,_0x32a710){_0x32a710(null,util[_0x337c('0x26')]('%s-%s',Date[_0x337c('0x28')](),_0x56e486[_0x337c('0x29')]));}})});router[_0x337c('0x20')]('/:id/system_avatar',upload[_0x337c('0x2a')](_0x337c('0x2c')),controller['addSystemAvatar']);router[_0x337c('0x20')](_0x337c('0x30'),controller[_0x337c('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x41a18f,_0x4d42fd,_0x313690){const _0x1f55ed=path[_0x337c('0x2f')](config['root'],'server/files',_0x337c('0x32'),_0x337c('0x33'));fs_extra[_0x337c('0x34')](_0x1f55ed,function(){_0x313690(null,_0x1f55ed);});},'filename':function(_0x42a742,_0x23db88,_0x53ed82){const _0x4ea0d0=_0x23db88[_0x337c('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x234b92=path[_0x337c('0x35')](_0x4ea0d0);const _0x74ded1=Date['now']()+'-'+_0x4ea0d0[_0x337c('0x36')](_0x234b92,'')+_0x234b92;_0x53ed82(null,_0x74ded1);}})});router['post'](_0x337c('0x37'),offlineUploadMulter['any'](),controller['offline']);router['post']('/:id/interactions',auth[_0x337c('0x7')](),controller['addInteraction']);router['post']('/:id/applications',auth[_0x337c('0x7')](),controller[_0x337c('0x38')]);router[_0x337c('0x20')](_0x337c('0x1a'),auth[_0x337c('0x7')](),controller[_0x337c('0x39')]);router['post'](_0x337c('0x3a'),auth[_0x337c('0x7')](),controller[_0x337c('0x3b')]);router[_0x337c('0x3c')](_0x337c('0xa'),auth[_0x337c('0x7')](),controller['update']);router[_0x337c('0x3d')]('/:id',auth[_0x337c('0x7')](),controller[_0x337c('0x3e')]);router[_0x337c('0x3d')](_0x337c('0x21'),auth[_0x337c('0x7')](),controller[_0x337c('0x3f')]);router['delete'](_0x337c('0xd'),auth[_0x337c('0x7')](),controller['removeAnswers']);router[_0x337c('0x3d')](_0x337c('0x3a'),auth[_0x337c('0x7')](),controller[_0x337c('0x40')]);module['exports']=router;
\ No newline at end of file
index ee8bbcb..d624fc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96aa=['STRING','sequelize','exports','ENUM','AmazonAWS','Google'];(function(_0x3a113e,_0x423985){var _0x1827c2=function(_0x4e24c2){while(--_0x4e24c2){_0x3a113e['push'](_0x3a113e['shift']());}};_0x1827c2(++_0x423985);}(_0x96aa,0x67));var _0xa96a=function(_0x5c9e07,_0x479be2){_0x5c9e07=_0x5c9e07-0x0;var _0x402654=_0x96aa[_0x5c9e07];return _0x402654;};'use strict';var Sequelize=require(_0xa96a('0x0'));module[_0xa96a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa96a('0x2')](_0xa96a('0x3'),_0xa96a('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xa96a('0x5')]},'data2':{'type':Sequelize[_0xa96a('0x5')]}};
\ No newline at end of file
+var _0x2dc3=['exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x1233d2,_0x5416f4){var _0x22759e=function(_0xb516aa){while(--_0xb516aa){_0x1233d2['push'](_0x1233d2['shift']());}};_0x22759e(++_0x5416f4);}(_0x2dc3,0x127));var _0x32dc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2dc3[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x32dc('0x0')]={'name':{'type':Sequelize[_0x32dc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x32dc('0x2')](_0x32dc('0x3'),_0x32dc('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x32dc('0x1')]},'data2':{'type':Sequelize[_0x32dc('0x1')]}};
\ No newline at end of file
index a37aa55..c1ecedf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x29eb7b,_0x403ab6){var _0x2c2157=function(_0xa5d708){while(--_0xa5d708){_0x29eb7b['push'](_0x29eb7b['shift']());}};_0x2c2157(++_0x403ab6);}(_0x2ef3,0xba));var _0x32ef=function(_0x1dd413,_0x1ef12a){_0x1dd413=_0x1dd413-0x0;var _0x41b26a=_0x2ef3[_0x1dd413];return _0x41b26a;};'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
+var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x2c5b59,_0x4901d7){var _0x5f2dc6=function(_0x43a6e0){while(--_0x43a6e0){_0x2c5b59['push'](_0x2c5b59['shift']());}};_0x5f2dc6(++_0x4901d7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0b0e[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};
\ No newline at end of file
index 3fa0edd..24c2f33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad5c=['cloud_providers','../../config/logger','moment','bluebird','path','../../config/environment','define','CloudProvider'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0xad5c,0x151));var _0xcad5=function(_0x58d1a6,_0x3086e5){_0x58d1a6=_0x58d1a6-0x0;var _0x3d1637=_0xad5c[_0x58d1a6];return _0x3d1637;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcad5('0x0'))('api');var moment=require(_0xcad5('0x1'));var BPromise=require(_0xcad5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcad5('0x3'));var rimraf=require('rimraf');var config=require(_0xcad5('0x4'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x248e7d,_0xd9ee40){return _0x248e7d[_0xcad5('0x5')](_0xcad5('0x6'),attributes,{'tableName':_0xcad5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7670=['define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x7670,0x7b));var _0x0767=function(_0xa56e2a,_0x3aac89){_0xa56e2a=_0xa56e2a-0x0;var _0x5d4674=_0x7670[_0xa56e2a];return _0x5d4674;};'use strict';var _=require(_0x0767('0x0'));var util=require('util');var logger=require(_0x0767('0x1'))(_0x0767('0x2'));var moment=require(_0x0767('0x3'));var BPromise=require('bluebird');var rp=require(_0x0767('0x4'));var fs=require('fs');var path=require(_0x0767('0x5'));var rimraf=require(_0x0767('0x6'));var config=require(_0x0767('0x7'));var attributes=require(_0x0767('0x8'));module['exports']=function(_0x3b8735,_0x1077ee){return _0x3b8735[_0x0767('0x9')](_0x0767('0xa'),attributes,{'tableName':_0x0767('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c073f9c..d36c476 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeba2=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0xeba2,0x70));var _0x2eba=function(_0x46b1c9,_0x169f87){_0x46b1c9=_0x46b1c9-0x0;var _0x17569c=_0xeba2[_0x46b1c9];return _0x17569c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2eba('0x0'));var BPromise=require(_0x2eba('0x1'));var rs=require(_0x2eba('0x2'));var fs=require('fs');var Redis=require(_0x2eba('0x3'));var db=require(_0x2eba('0x4'))['db'];var utils=require(_0x2eba('0x5'));var logger=require(_0x2eba('0x6'))(_0x2eba('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2eba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b4d9a,_0x14c40a,_0x4e7a50){return new BPromise(function(_0x279806,_0x1fed79){return client[_0x2eba('0x9')](_0x1b4d9a,_0x4e7a50)[_0x2eba('0xa')](function(_0x1cc4e){logger[_0x2eba('0xb')](_0x2eba('0xc'),_0x14c40a,_0x2eba('0xd'));logger[_0x2eba('0xe')](_0x2eba('0xf'),_0x14c40a,'request\x20sent',JSON[_0x2eba('0x10')](_0x1cc4e));if(_0x1cc4e[_0x2eba('0x11')]){if(_0x1cc4e['error'][_0x2eba('0x12')]===0x1f4){logger[_0x2eba('0x11')](_0x2eba('0xc'),_0x14c40a,_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);return _0x1fed79(_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x14c40a,_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);return _0x279806(_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);}else{logger[_0x2eba('0xb')]('CloudProvider,\x20%s,\x20%s',_0x14c40a,_0x2eba('0xd'));_0x279806(_0x1cc4e[_0x2eba('0x14')][_0x2eba('0x13')]);}})[_0x2eba('0x15')](function(_0x2de66e){logger['error'](_0x2eba('0xc'),_0x14c40a,_0x2de66e);_0x1fed79(_0x2de66e);});});}
\ No newline at end of file
+var _0xb4f4=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x48cb6e,_0x494099){var _0x161dea=function(_0x3e42b7){while(--_0x3e42b7){_0x48cb6e['push'](_0x48cb6e['shift']());}};_0x161dea(++_0x494099);}(_0xb4f4,0xda));var _0x4b4f=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xb4f4[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var moment=require('moment');var BPromise=require(_0x4b4f('0x2'));var rs=require(_0x4b4f('0x3'));var fs=require('fs');var Redis=require(_0x4b4f('0x4'));var db=require(_0x4b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b4f('0x6'))(_0x4b4f('0x7'));var config=require(_0x4b4f('0x8'));var jayson=require(_0x4b4f('0x9'));var client=jayson[_0x4b4f('0xa')][_0x4b4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x405321,_0x58c1e5,_0x5ba9b0){return new BPromise(function(_0x108b4e,_0x2c647f){return client[_0x4b4f('0xc')](_0x405321,_0x5ba9b0)[_0x4b4f('0xd')](function(_0x25e0c9){logger['info'](_0x4b4f('0xe'),_0x58c1e5,_0x4b4f('0xf'));logger[_0x4b4f('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58c1e5,_0x4b4f('0xf'),JSON[_0x4b4f('0x11')](_0x25e0c9));if(_0x25e0c9['error']){if(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x13')]===0x1f4){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x2c647f(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x108b4e(_0x25e0c9['error'][_0x4b4f('0x14')]);}else{logger[_0x4b4f('0x15')](_0x4b4f('0xe'),_0x58c1e5,'request\x20sent');_0x108b4e(_0x25e0c9[_0x4b4f('0x16')][_0x4b4f('0x14')]);}})[_0x4b4f('0x17')](function(_0x57d09a){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x57d09a);_0x2c647f(_0x57d09a);});});}
\ No newline at end of file
index 54be579..8cc67f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb37=['isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeb37,0x1ad));var _0x7eb3=function(_0x46cf30,_0x3fed82){_0x46cf30=_0x46cf30-0x0;var _0x44d1cc=_0xeb37[_0x46cf30];return _0x44d1cc;};'use strict';var multer=require(_0x7eb3('0x0'));var util=require(_0x7eb3('0x1'));var path=require(_0x7eb3('0x2'));var timeout=require(_0x7eb3('0x3'));var express=require(_0x7eb3('0x4'));var router=express[_0x7eb3('0x5')]();var fs_extra=require(_0x7eb3('0x6'));var auth=require(_0x7eb3('0x7'));var interaction=require(_0x7eb3('0x8'));var config=require(_0x7eb3('0x9'));var controller=require(_0x7eb3('0xa'));router[_0x7eb3('0xb')]('/',auth[_0x7eb3('0xc')](),controller['index']);router['get'](_0x7eb3('0xd'),auth[_0x7eb3('0xc')](),controller[_0x7eb3('0xe')]);router[_0x7eb3('0xf')]('/',auth[_0x7eb3('0xc')](),controller['create']);router[_0x7eb3('0x10')](_0x7eb3('0xd'),auth[_0x7eb3('0xc')](),controller[_0x7eb3('0x11')]);router[_0x7eb3('0x12')](_0x7eb3('0xd'),auth[_0x7eb3('0xc')](),controller[_0x7eb3('0x13')]);module[_0x7eb3('0x14')]=router;
\ No newline at end of file
+var _0xc891=['create','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','/:id','show','post'];(function(_0x2f2959,_0x147c7f){var _0x2fd01b=function(_0x41f3f9){while(--_0x41f3f9){_0x2f2959['push'](_0x2f2959['shift']());}};_0x2fd01b(++_0x147c7f);}(_0xc891,0x152));var _0x1c89=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xc891[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x1c89('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1c89('0x1'));var express=require('express');var router=express[_0x1c89('0x2')]();var fs_extra=require(_0x1c89('0x3'));var auth=require(_0x1c89('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1c89('0x5'));var controller=require(_0x1c89('0x6'));router[_0x1c89('0x7')]('/',auth[_0x1c89('0x8')](),controller['index']);router[_0x1c89('0x7')](_0x1c89('0x9'),auth['isAuthenticated'](),controller[_0x1c89('0xa')]);router[_0x1c89('0xb')]('/',auth['isAuthenticated'](),controller[_0x1c89('0xc')]);router['put'](_0x1c89('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x1c89('0x8')](),controller['destroy']);module[_0x1c89('0xd')]=router;
\ No newline at end of file
index 31de6ef..071be3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7733=['sequelize','exports','STRING'];(function(_0x3fb7a6,_0x1e57b3){var _0x46c13b=function(_0x1631fc){while(--_0x1631fc){_0x3fb7a6['push'](_0x3fb7a6['shift']());}};_0x46c13b(++_0x1e57b3);}(_0x7733,0x132));var _0x3773=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x7733[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x3773('0x0'));module[_0x3773('0x1')]={'name':{'type':Sequelize[_0x3773('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3773('0x2')]},'companyId':{'type':Sequelize[_0x3773('0x2')]},'website':{'type':Sequelize[_0x3773('0x2')]},'phone':{'type':Sequelize[_0x3773('0x2')]},'fax':{'type':Sequelize[_0x3773('0x2')]},'type':{'type':Sequelize[_0x3773('0x2')]},'street':{'type':Sequelize[_0x3773('0x2')]},'postalCode':{'type':Sequelize[_0x3773('0x2')]},'city':{'type':Sequelize[_0x3773('0x2')]},'country':{'type':Sequelize[_0x3773('0x2')]},'email':{'type':Sequelize[_0x3773('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3773('0x2')]},'sStreet':{'type':Sequelize[_0x3773('0x2')]},'sPostalCode':{'type':Sequelize[_0x3773('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x3773('0x2')]},'description':{'type':Sequelize[_0x3773('0x2')]}};
\ No newline at end of file
+var _0x7858=['exports','STRING'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7858,0x10e));var _0x8785=function(_0x2bebc0,_0x55f6d2){_0x2bebc0=_0x2bebc0-0x0;var _0x56997c=_0x7858[_0x2bebc0];return _0x56997c;};'use strict';var Sequelize=require('sequelize');module[_0x8785('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8785('0x1')]},'companyId':{'type':Sequelize[_0x8785('0x1')]},'website':{'type':Sequelize[_0x8785('0x1')]},'phone':{'type':Sequelize[_0x8785('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8785('0x1')]},'street':{'type':Sequelize[_0x8785('0x1')]},'postalCode':{'type':Sequelize[_0x8785('0x1')]},'city':{'type':Sequelize[_0x8785('0x1')]},'country':{'type':Sequelize[_0x8785('0x1')]},'email':{'type':Sequelize[_0x8785('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x8785('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x8785('0x1')]},'description':{'type':Sequelize[_0x8785('0x1')]}};
\ No newline at end of file
index 4769f53..847c008 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4285=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','name','send','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','map','options','where','findAll','catch','show','params','rawAttributes','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x4285,0xfd));var _0x5428=function(_0x4a22c5,_0x5ac44b){_0x4a22c5=_0x4a22c5-0x0;var _0x5ba569=_0x4285[_0x4a22c5];return _0x5ba569;};'use strict';var emlformat=require(_0x5428('0x0'));var rimraf=require(_0x5428('0x1'));var zipdir=require(_0x5428('0x2'));var jsonpatch=require(_0x5428('0x3'));var rp=require(_0x5428('0x4'));var moment=require(_0x5428('0x5'));var BPromise=require(_0x5428('0x6'));var Mustache=require(_0x5428('0x7'));var util=require('util');var path=require(_0x5428('0x8'));var sox=require(_0x5428('0x9'));var csv=require(_0x5428('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5428('0xb'));var _=require(_0x5428('0xc'));var squel=require(_0x5428('0xd'));var crypto=require(_0x5428('0xe'));var jsforce=require(_0x5428('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5428('0x10'));var Papa=require('papaparse');var Redis=require(_0x5428('0x11'));var authService=require(_0x5428('0x12'));var qs=require(_0x5428('0x13'));var as=require(_0x5428('0x14'));var hardwareService=require(_0x5428('0x15'));var logger=require(_0x5428('0x16'))(_0x5428('0x17'));var utils=require('../../config/utils');var config=require(_0x5428('0x18'));var licenseUtil=require(_0x5428('0x19'));var db=require(_0x5428('0x1a'))['db'];function respondWithStatusCode(_0x2f0b98,_0x3c36ae){_0x3c36ae=_0x3c36ae||0xcc;return function(_0x360637){if(_0x360637){return _0x2f0b98['sendStatus'](_0x3c36ae);}return _0x2f0b98[_0x5428('0x1b')](_0x3c36ae)[_0x5428('0x1c')]();};}function respondWithResult(_0x4b1e0e,_0x3d1e94){_0x3d1e94=_0x3d1e94||0xc8;return function(_0x1be5c8){if(_0x1be5c8){return _0x4b1e0e[_0x5428('0x1b')](_0x3d1e94)[_0x5428('0x1d')](_0x1be5c8);}};}function respondWithFilteredResult(_0x249169,_0x5d04cf){return function(_0x26b2e0){if(_0x26b2e0){var _0x3d712e=typeof _0x5d04cf['offset']===_0x5428('0x1e')&&typeof _0x5d04cf['limit']===_0x5428('0x1e');var _0x378ade=_0x26b2e0[_0x5428('0x1f')];var _0x154cf0=_0x3d712e?0x0:_0x5d04cf[_0x5428('0x20')];var _0x120df0=_0x3d712e?_0x26b2e0['count']:_0x5d04cf[_0x5428('0x20')]+_0x5d04cf[_0x5428('0x21')];var _0x23ac13;if(_0x120df0>=_0x378ade){_0x120df0=_0x378ade;_0x23ac13=0xc8;}else{_0x23ac13=0xce;}_0x249169['status'](_0x23ac13);return _0x249169[_0x5428('0x22')](_0x5428('0x23'),_0x154cf0+'-'+_0x120df0+'/'+_0x378ade)[_0x5428('0x1d')](_0x26b2e0);}return null;};}function patchUpdates(_0x4a2306){return function(_0x3f5cb0){try{jsonpatch[_0x5428('0x24')](_0x3f5cb0,_0x4a2306,!![]);}catch(_0x4e4112){return BPromise[_0x5428('0x25')](_0x4e4112);}return _0x3f5cb0[_0x5428('0x26')]();};}function saveUpdates(_0x340f26,_0x3a1cfd){return function(_0x13ab98){if(_0x13ab98){return _0x13ab98[_0x5428('0x27')](_0x340f26)[_0x5428('0x28')](function(_0x569b24){return _0x569b24;});}return null;};}function removeEntity(_0x11703f,_0x168764){return function(_0x496516){if(_0x496516){return _0x496516[_0x5428('0x29')]()['then'](function(){var _0x34e9a5=_0x496516[_0x5428('0x2a')]({'plain':!![]});var _0x92c65d=_0x5428('0x2b');return db[_0x5428('0x2c')][_0x5428('0x29')]({'where':{'type':_0x92c65d,'resourceId':_0x34e9a5['id']}})['then'](function(){return _0x496516;});})[_0x5428('0x28')](function(){_0x11703f[_0x5428('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f465e,_0x3efa4f){return function(_0x431dd9){if(!_0x431dd9){_0x5f465e[_0x5428('0x2d')](0x194);}return _0x431dd9;};}function handleError(_0x6161e5,_0x279654){_0x279654=_0x279654||0x1f4;return function(_0x37ee98){logger['error'](_0x37ee98['stack']);if(_0x37ee98[_0x5428('0x2e')]){delete _0x37ee98[_0x5428('0x2e')];}_0x6161e5[_0x5428('0x1b')](_0x279654)[_0x5428('0x2f')](_0x37ee98);};}exports['index']=function(_0x1c30fe,_0x1ca073){var _0x369f64={},_0x547f40={},_0x3d6106={'count':0x0,'rows':[]};return db[_0x5428('0x30')][_0x5428('0x31')]()[_0x5428('0x28')](function(_0x5bd447){_0x547f40['model']=_[_0x5428('0x32')](_0x5bd447);_0x547f40[_0x5428('0x33')]=_['keys'](_0x1c30fe[_0x5428('0x33')]);_0x547f40['filters']=_[_0x5428('0x34')](_0x547f40[_0x5428('0x35')],_0x547f40['query']);_0x369f64[_0x5428('0x36')]=_['intersection'](_0x547f40[_0x5428('0x35')],qs[_0x5428('0x37')](_0x1c30fe[_0x5428('0x33')][_0x5428('0x37')]));_0x369f64[_0x5428('0x36')]=_0x369f64[_0x5428('0x36')][_0x5428('0x38')]?_0x369f64[_0x5428('0x36')]:_0x547f40[_0x5428('0x35')];if(!_0x1c30fe[_0x5428('0x33')][_0x5428('0x39')](_0x5428('0x3a'))){_0x369f64[_0x5428('0x21')]=qs[_0x5428('0x21')](_0x1c30fe[_0x5428('0x33')]['limit']);_0x369f64[_0x5428('0x20')]=qs[_0x5428('0x20')](_0x1c30fe['query'][_0x5428('0x20')]);}_0x369f64[_0x5428('0x3b')]=qs['sort'](_0x1c30fe[_0x5428('0x33')][_0x5428('0x3c')]);_0x369f64['where']=qs[_0x5428('0x3d')](_[_0x5428('0x3e')](_0x1c30fe[_0x5428('0x33')],_0x547f40['filters']),_0x5bd447);if(_0x1c30fe[_0x5428('0x33')][_0x5428('0x3f')]){_0x369f64['where']=_[_0x5428('0x40')](_0x369f64['where'],{'$or':_[_0x5428('0x41')](_0x369f64['attributes'],function(_0x39bcf3){var _0x20feab={};_0x20feab[_0x39bcf3]={'$like':'%'+_0x1c30fe[_0x5428('0x33')]['filter']+'%'};return _0x20feab;})});}_0x369f64=_[_0x5428('0x40')]({},_0x369f64,_0x1c30fe[_0x5428('0x42')]);var _0x95748={'where':_0x369f64[_0x5428('0x43')]};return db[_0x5428('0x30')]['count'](_0x95748)['then'](function(_0x5efdbb){_0x3d6106[_0x5428('0x1f')]=_0x5efdbb;if(_0x1c30fe[_0x5428('0x33')]['includeAll']){_0x369f64['include']=[{'all':!![]}];}return db[_0x5428('0x30')][_0x5428('0x44')](_0x369f64);})['then'](function(_0x222309){_0x3d6106['rows']=_0x222309;return _0x3d6106;})['then'](respondWithFilteredResult(_0x1ca073,_0x369f64))[_0x5428('0x45')](handleError(_0x1ca073,null));})[_0x5428('0x45')](handleError(_0x1ca073,null));};exports[_0x5428('0x46')]=function(_0x93450d,_0x359b3a){var _0x1c6c4b={'raw':![],'where':{'id':_0x93450d[_0x5428('0x47')]['id']}},_0x4dae96={};_0x4dae96['model']=_['keys'](db[_0x5428('0x30')][_0x5428('0x48')]);_0x4dae96[_0x5428('0x33')]=_['keys'](_0x93450d[_0x5428('0x33')]);_0x4dae96[_0x5428('0x3d')]=_['intersection'](_0x4dae96['model'],_0x4dae96[_0x5428('0x33')]);_0x1c6c4b[_0x5428('0x36')]=_['intersection'](_0x4dae96[_0x5428('0x35')],qs[_0x5428('0x37')](_0x93450d[_0x5428('0x33')]['fields']));_0x1c6c4b['attributes']=_0x1c6c4b['attributes'][_0x5428('0x38')]?_0x1c6c4b[_0x5428('0x36')]:_0x4dae96['model'];if(_0x93450d[_0x5428('0x33')][_0x5428('0x49')]){_0x1c6c4b[_0x5428('0x4a')]=[{'all':!![]}];}_0x1c6c4b=_[_0x5428('0x40')]({},_0x1c6c4b,_0x93450d['options']);return db[_0x5428('0x30')]['find'](_0x1c6c4b)['then'](handleEntityNotFound(_0x359b3a,null))[_0x5428('0x28')](respondWithResult(_0x359b3a,null))[_0x5428('0x45')](handleError(_0x359b3a,null));};exports[_0x5428('0x4b')]=function(_0x39f737,_0x155f17){return db[_0x5428('0x30')]['create'](_0x39f737[_0x5428('0x4c')],{})[_0x5428('0x28')](function(_0x5987f0){var _0x3a52e4=_0x39f737[_0x5428('0x4d')][_0x5428('0x2a')]({'plain':!![]});if(!_0x3a52e4)throw new Error(_0x5428('0x4e'));if(_0x3a52e4[_0x5428('0x4f')]===_0x5428('0x4d')){var _0x506da3=_0x5987f0[_0x5428('0x2a')]({'plain':!![]});var _0x5c24ac=_0x5428('0x2b');return db[_0x5428('0x50')][_0x5428('0x51')]({'where':{'name':_0x5c24ac,'userProfileId':_0x3a52e4['userProfileId']},'raw':!![]})[_0x5428('0x28')](function(_0x285b72){if(_0x285b72&&_0x285b72[_0x5428('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x506da3['name'],'resourceId':_0x506da3['id'],'type':_0x285b72[_0x5428('0x2e')],'sectionId':_0x285b72['id']},{})[_0x5428('0x28')](function(){return _0x5987f0;});}else{return _0x5987f0;}})['catch'](function(_0x58d980){logger[_0x5428('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58d980);throw _0x58d980;});}return _0x5987f0;})[_0x5428('0x28')](respondWithResult(_0x155f17,0xc9))[_0x5428('0x45')](handleError(_0x155f17,null));};exports[_0x5428('0x27')]=function(_0x1d68e7,_0x265863){if(_0x1d68e7['body']['id']){delete _0x1d68e7[_0x5428('0x4c')]['id'];}return db[_0x5428('0x30')][_0x5428('0x51')]({'where':{'id':_0x1d68e7['params']['id']}})[_0x5428('0x28')](handleEntityNotFound(_0x265863,null))[_0x5428('0x28')](saveUpdates(_0x1d68e7[_0x5428('0x4c')],null))[_0x5428('0x28')](respondWithResult(_0x265863,null))[_0x5428('0x45')](handleError(_0x265863,null));};exports[_0x5428('0x29')]=function(_0x33e120,_0xb341a9){return db[_0x5428('0x30')]['find']({'where':{'id':_0x33e120['params']['id']}})[_0x5428('0x28')](handleEntityNotFound(_0xb341a9,null))[_0x5428('0x28')](removeEntity(_0xb341a9,null))['catch'](handleError(_0xb341a9,null));};exports[_0x5428('0x31')]=function(_0x1daba2,_0x4ae2db){return db[_0x5428('0x30')][_0x5428('0x31')]()[_0x5428('0x28')](respondWithResult(_0x4ae2db,null))[_0x5428('0x45')](handleError(_0x4ae2db,null));};exports[_0x5428('0x54')]=function(_0x783fa1,_0x29f084,_0x51adc2){return db[_0x5428('0x55')][_0x5428('0x51')]({'where':{'id':_0x783fa1[_0x5428('0x47')]['id']}})[_0x5428('0x28')](handleEntityNotFound(_0x29f084,null))[_0x5428('0x28')](function(_0x52502c){if(_0x52502c){return _0x52502c['addContacts'](_0x783fa1[_0x5428('0x4c')][_0x5428('0x56')],_[_0x5428('0x57')](_0x783fa1[_0x5428('0x4c')],[_0x5428('0x56'),'id'])||{});}})['then'](respondWithResult(_0x29f084,null))[_0x5428('0x45')](handleError(_0x29f084,null));};exports[_0x5428('0x58')]=function(_0x1470b7,_0x3344cb,_0x558b8b){var _0x5bc777={};var _0x5aa15b={};var _0x56c767;var _0x23cb21;return db[_0x5428('0x30')][_0x5428('0x59')]({'where':{'id':_0x1470b7['params']['id']}})[_0x5428('0x28')](handleEntityNotFound(_0x3344cb,null))[_0x5428('0x28')](function(_0x319a3b){if(_0x319a3b){_0x56c767=_0x319a3b;_0x5aa15b[_0x5428('0x35')]=_[_0x5428('0x32')](db[_0x5428('0x55')]['rawAttributes']);_0x5aa15b[_0x5428('0x33')]=_[_0x5428('0x32')](_0x1470b7['query']);_0x5aa15b[_0x5428('0x3d')]=_[_0x5428('0x34')](_0x5aa15b[_0x5428('0x35')],_0x5aa15b['query']);_0x5bc777[_0x5428('0x36')]=_[_0x5428('0x34')](_0x5aa15b[_0x5428('0x35')],qs[_0x5428('0x37')](_0x1470b7[_0x5428('0x33')][_0x5428('0x37')]));_0x5bc777['attributes']=_0x5bc777[_0x5428('0x36')][_0x5428('0x38')]?_0x5bc777[_0x5428('0x36')]:_0x5aa15b[_0x5428('0x35')];_0x5bc777[_0x5428('0x3b')]=qs[_0x5428('0x3c')](_0x1470b7[_0x5428('0x33')]['sort']);_0x5bc777['where']=qs[_0x5428('0x3d')](_[_0x5428('0x3e')](_0x1470b7['query'],_0x5aa15b['filters']));if(_0x1470b7[_0x5428('0x33')]['filter']){_0x5bc777[_0x5428('0x43')]=_[_0x5428('0x40')](_0x5bc777['where'],{'$or':_[_0x5428('0x41')](_0x5bc777[_0x5428('0x36')],function(_0x343891){var _0x1d1d03={};_0x1d1d03[_0x343891]={'$like':'%'+_0x1470b7['query'][_0x5428('0x3f')]+'%'};return _0x1d1d03;})});}_0x5bc777=_[_0x5428('0x40')]({},_0x5bc777,_0x1470b7[_0x5428('0x42')]);return _0x56c767[_0x5428('0x58')](_0x5bc777);}})['then'](function(_0x341928){if(_0x341928){_0x23cb21=_0x341928[_0x5428('0x38')];if(!_0x1470b7[_0x5428('0x33')]['hasOwnProperty']('nolimit')){_0x5bc777[_0x5428('0x21')]=qs['limit'](_0x1470b7[_0x5428('0x33')]['limit']);_0x5bc777[_0x5428('0x20')]=qs[_0x5428('0x20')](_0x1470b7['query'][_0x5428('0x20')]);}return _0x56c767['getContacts'](_0x5bc777);}})[_0x5428('0x28')](function(_0xce8b98){if(_0xce8b98){return _0xce8b98?{'count':_0x23cb21,'rows':_0xce8b98}:null;}})[_0x5428('0x28')](respondWithResult(_0x3344cb,null))[_0x5428('0x45')](handleError(_0x3344cb,null));};
\ No newline at end of file
+var _0x3e9a=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','Companies','UserProfileResource','error','name','send','index','CmCompany','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','pick','merge','where','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x58ef0f,_0x31c945){var _0x57e69c=function(_0x46ccdf){while(--_0x46ccdf){_0x58ef0f['push'](_0x58ef0f['shift']());}};_0x57e69c(++_0x31c945);}(_0x3e9a,0x14f));var _0xa3e9=function(_0x50ab95,_0x480438){_0x50ab95=_0x50ab95-0x0;var _0x2c62cd=_0x3e9a[_0x50ab95];return _0x2c62cd;};'use strict';var emlformat=require(_0xa3e9('0x0'));var rimraf=require(_0xa3e9('0x1'));var zipdir=require(_0xa3e9('0x2'));var jsonpatch=require(_0xa3e9('0x3'));var rp=require('request-promise');var moment=require(_0xa3e9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa3e9('0x5'));var util=require(_0xa3e9('0x6'));var path=require(_0xa3e9('0x7'));var sox=require(_0xa3e9('0x8'));var csv=require(_0xa3e9('0x9'));var ejs=require(_0xa3e9('0xa'));var fs=require('fs');var fs_extra=require(_0xa3e9('0xb'));var _=require(_0xa3e9('0xc'));var squel=require(_0xa3e9('0xd'));var crypto=require(_0xa3e9('0xe'));var jsforce=require(_0xa3e9('0xf'));var deskjs=require(_0xa3e9('0x10'));var toCsv=require(_0xa3e9('0x9'));var querystring=require('querystring');var Papa=require(_0xa3e9('0x11'));var Redis=require(_0xa3e9('0x12'));var authService=require(_0xa3e9('0x13'));var qs=require(_0xa3e9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3e9('0x15'));var logger=require(_0xa3e9('0x16'))(_0xa3e9('0x17'));var utils=require('../../config/utils');var config=require(_0xa3e9('0x18'));var licenseUtil=require(_0xa3e9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38ae98,_0x597eeb){_0x597eeb=_0x597eeb||0xcc;return function(_0x3d46de){if(_0x3d46de){return _0x38ae98['sendStatus'](_0x597eeb);}return _0x38ae98[_0xa3e9('0x1a')](_0x597eeb)[_0xa3e9('0x1b')]();};}function respondWithResult(_0x1ba47c,_0x530b3c){_0x530b3c=_0x530b3c||0xc8;return function(_0x4f5383){if(_0x4f5383){return _0x1ba47c[_0xa3e9('0x1a')](_0x530b3c)[_0xa3e9('0x1c')](_0x4f5383);}};}function respondWithFilteredResult(_0xef6fc,_0x7868a){return function(_0x20414f){if(_0x20414f){var _0x59af68=typeof _0x7868a['offset']===_0xa3e9('0x1d')&&typeof _0x7868a[_0xa3e9('0x1e')]===_0xa3e9('0x1d');var _0x46e5bc=_0x20414f[_0xa3e9('0x1f')];var _0x1f8929=_0x59af68?0x0:_0x7868a[_0xa3e9('0x20')];var _0x430f3e=_0x59af68?_0x20414f['count']:_0x7868a[_0xa3e9('0x20')]+_0x7868a['limit'];var _0x1d1579;if(_0x430f3e>=_0x46e5bc){_0x430f3e=_0x46e5bc;_0x1d1579=0xc8;}else{_0x1d1579=0xce;}_0xef6fc[_0xa3e9('0x1a')](_0x1d1579);return _0xef6fc[_0xa3e9('0x21')](_0xa3e9('0x22'),_0x1f8929+'-'+_0x430f3e+'/'+_0x46e5bc)['json'](_0x20414f);}return null;};}function patchUpdates(_0x52a629){return function(_0x553cef){try{jsonpatch[_0xa3e9('0x23')](_0x553cef,_0x52a629,!![]);}catch(_0xeb2bbd){return BPromise['reject'](_0xeb2bbd);}return _0x553cef['save']();};}function saveUpdates(_0xa0a31a,_0x41de29){return function(_0xac96fc){if(_0xac96fc){return _0xac96fc[_0xa3e9('0x24')](_0xa0a31a)[_0xa3e9('0x25')](function(_0x318824){return _0x318824;});}return null;};}function removeEntity(_0x5a0c56,_0x4b3452){return function(_0x2efedd){if(_0x2efedd){return _0x2efedd[_0xa3e9('0x26')]()[_0xa3e9('0x25')](function(){var _0x2bd1ed=_0x2efedd[_0xa3e9('0x27')]({'plain':!![]});var _0x29afab=_0xa3e9('0x28');return db[_0xa3e9('0x29')]['destroy']({'where':{'type':_0x29afab,'resourceId':_0x2bd1ed['id']}})[_0xa3e9('0x25')](function(){return _0x2efedd;});})[_0xa3e9('0x25')](function(){_0x5a0c56[_0xa3e9('0x1a')](0xcc)[_0xa3e9('0x1b')]();});}};}function handleEntityNotFound(_0x56ec02,_0x1f555e){return function(_0x3c303d){if(!_0x3c303d){_0x56ec02['sendStatus'](0x194);}return _0x3c303d;};}function handleError(_0x4c1b75,_0x23bca1){_0x23bca1=_0x23bca1||0x1f4;return function(_0x5277a6){logger[_0xa3e9('0x2a')](_0x5277a6['stack']);if(_0x5277a6['name']){delete _0x5277a6[_0xa3e9('0x2b')];}_0x4c1b75[_0xa3e9('0x1a')](_0x23bca1)[_0xa3e9('0x2c')](_0x5277a6);};}exports[_0xa3e9('0x2d')]=function(_0xff1945,_0x594034){var _0x41aaa4={},_0x35d117={},_0x388438={'count':0x0,'rows':[]};return db[_0xa3e9('0x2e')]['describe']()[_0xa3e9('0x25')](function(_0x297d66){_0x35d117[_0xa3e9('0x2f')]=_[_0xa3e9('0x30')](_0x297d66);_0x35d117['query']=_[_0xa3e9('0x30')](_0xff1945['query']);_0x35d117[_0xa3e9('0x31')]=_[_0xa3e9('0x32')](_0x35d117['model'],_0x35d117[_0xa3e9('0x33')]);_0x41aaa4['attributes']=_[_0xa3e9('0x32')](_0x35d117[_0xa3e9('0x2f')],qs[_0xa3e9('0x34')](_0xff1945[_0xa3e9('0x33')]['fields']));_0x41aaa4[_0xa3e9('0x35')]=_0x41aaa4[_0xa3e9('0x35')][_0xa3e9('0x36')]?_0x41aaa4[_0xa3e9('0x35')]:_0x35d117[_0xa3e9('0x2f')];if(!_0xff1945[_0xa3e9('0x33')][_0xa3e9('0x37')]('nolimit')){_0x41aaa4[_0xa3e9('0x1e')]=qs[_0xa3e9('0x1e')](_0xff1945[_0xa3e9('0x33')]['limit']);_0x41aaa4[_0xa3e9('0x20')]=qs['offset'](_0xff1945[_0xa3e9('0x33')]['offset']);}_0x41aaa4[_0xa3e9('0x38')]=qs[_0xa3e9('0x39')](_0xff1945['query']['sort']);_0x41aaa4['where']=qs[_0xa3e9('0x31')](_[_0xa3e9('0x3a')](_0xff1945[_0xa3e9('0x33')],_0x35d117[_0xa3e9('0x31')]),_0x297d66);if(_0xff1945[_0xa3e9('0x33')]['filter']){_0x41aaa4['where']=_[_0xa3e9('0x3b')](_0x41aaa4[_0xa3e9('0x3c')],{'$or':_['map'](_0x41aaa4[_0xa3e9('0x35')],function(_0x2f506a){var _0xa053d3={};_0xa053d3[_0x2f506a]={'$like':'%'+_0xff1945[_0xa3e9('0x33')][_0xa3e9('0x3d')]+'%'};return _0xa053d3;})});}_0x41aaa4=_[_0xa3e9('0x3b')]({},_0x41aaa4,_0xff1945[_0xa3e9('0x3e')]);var _0x262882={'where':_0x41aaa4[_0xa3e9('0x3c')]};return db['CmCompany'][_0xa3e9('0x1f')](_0x262882)[_0xa3e9('0x25')](function(_0x2625ca){_0x388438[_0xa3e9('0x1f')]=_0x2625ca;if(_0xff1945[_0xa3e9('0x33')][_0xa3e9('0x3f')]){_0x41aaa4[_0xa3e9('0x40')]=[{'all':!![]}];}return db[_0xa3e9('0x2e')]['findAll'](_0x41aaa4);})[_0xa3e9('0x25')](function(_0x3d1252){_0x388438[_0xa3e9('0x41')]=_0x3d1252;return _0x388438;})[_0xa3e9('0x25')](respondWithFilteredResult(_0x594034,_0x41aaa4))[_0xa3e9('0x42')](handleError(_0x594034,null));})[_0xa3e9('0x42')](handleError(_0x594034,null));};exports[_0xa3e9('0x43')]=function(_0x7f1bb8,_0x3c9fe1){var _0x2ff190={'raw':![],'where':{'id':_0x7f1bb8[_0xa3e9('0x44')]['id']}},_0x48769d={};_0x48769d[_0xa3e9('0x2f')]=_['keys'](db['CmCompany'][_0xa3e9('0x45')]);_0x48769d[_0xa3e9('0x33')]=_[_0xa3e9('0x30')](_0x7f1bb8[_0xa3e9('0x33')]);_0x48769d['filters']=_['intersection'](_0x48769d[_0xa3e9('0x2f')],_0x48769d[_0xa3e9('0x33')]);_0x2ff190[_0xa3e9('0x35')]=_[_0xa3e9('0x32')](_0x48769d[_0xa3e9('0x2f')],qs[_0xa3e9('0x34')](_0x7f1bb8[_0xa3e9('0x33')][_0xa3e9('0x34')]));_0x2ff190[_0xa3e9('0x35')]=_0x2ff190[_0xa3e9('0x35')][_0xa3e9('0x36')]?_0x2ff190[_0xa3e9('0x35')]:_0x48769d[_0xa3e9('0x2f')];if(_0x7f1bb8[_0xa3e9('0x33')]['includeAll']){_0x2ff190[_0xa3e9('0x40')]=[{'all':!![]}];}_0x2ff190=_[_0xa3e9('0x3b')]({},_0x2ff190,_0x7f1bb8[_0xa3e9('0x3e')]);return db[_0xa3e9('0x2e')][_0xa3e9('0x46')](_0x2ff190)[_0xa3e9('0x25')](handleEntityNotFound(_0x3c9fe1,null))['then'](respondWithResult(_0x3c9fe1,null))[_0xa3e9('0x42')](handleError(_0x3c9fe1,null));};exports[_0xa3e9('0x47')]=function(_0x330b8b,_0x12b39d){return db[_0xa3e9('0x2e')][_0xa3e9('0x47')](_0x330b8b[_0xa3e9('0x48')],{})[_0xa3e9('0x25')](function(_0x58a46a){var _0x386fa6=_0x330b8b[_0xa3e9('0x49')][_0xa3e9('0x27')]({'plain':!![]});if(!_0x386fa6)throw new Error(_0xa3e9('0x4a'));if(_0x386fa6[_0xa3e9('0x4b')]===_0xa3e9('0x49')){var _0x1de608=_0x58a46a[_0xa3e9('0x27')]({'plain':!![]});var _0x1e3d5c='Companies';return db[_0xa3e9('0x4c')]['find']({'where':{'name':_0x1e3d5c,'userProfileId':_0x386fa6[_0xa3e9('0x4d')]},'raw':!![]})[_0xa3e9('0x25')](function(_0x1d33a6){if(_0x1d33a6&&_0x1d33a6['autoAssociation']===0x0){return db[_0xa3e9('0x29')][_0xa3e9('0x47')]({'name':_0x1de608['name'],'resourceId':_0x1de608['id'],'type':_0x1d33a6[_0xa3e9('0x2b')],'sectionId':_0x1d33a6['id']},{})[_0xa3e9('0x25')](function(){return _0x58a46a;});}else{return _0x58a46a;}})[_0xa3e9('0x42')](function(_0x27f52a){logger[_0xa3e9('0x2a')](_0xa3e9('0x4e'),_0x27f52a);throw _0x27f52a;});}return _0x58a46a;})[_0xa3e9('0x25')](respondWithResult(_0x12b39d,0xc9))[_0xa3e9('0x42')](handleError(_0x12b39d,null));};exports[_0xa3e9('0x24')]=function(_0x46c4fb,_0x2c9edc){if(_0x46c4fb[_0xa3e9('0x48')]['id']){delete _0x46c4fb[_0xa3e9('0x48')]['id'];}return db[_0xa3e9('0x2e')][_0xa3e9('0x46')]({'where':{'id':_0x46c4fb[_0xa3e9('0x44')]['id']}})[_0xa3e9('0x25')](handleEntityNotFound(_0x2c9edc,null))[_0xa3e9('0x25')](saveUpdates(_0x46c4fb['body'],null))[_0xa3e9('0x25')](respondWithResult(_0x2c9edc,null))[_0xa3e9('0x42')](handleError(_0x2c9edc,null));};exports[_0xa3e9('0x26')]=function(_0x496c19,_0x57ea4c){return db['CmCompany'][_0xa3e9('0x46')]({'where':{'id':_0x496c19['params']['id']}})[_0xa3e9('0x25')](handleEntityNotFound(_0x57ea4c,null))[_0xa3e9('0x25')](removeEntity(_0x57ea4c,null))[_0xa3e9('0x42')](handleError(_0x57ea4c,null));};exports['describe']=function(_0x154245,_0x3c91e3){return db[_0xa3e9('0x2e')]['describe']()[_0xa3e9('0x25')](respondWithResult(_0x3c91e3,null))[_0xa3e9('0x42')](handleError(_0x3c91e3,null));};exports[_0xa3e9('0x4f')]=function(_0x202185,_0x30f153,_0x1e4590){return db[_0xa3e9('0x50')]['find']({'where':{'id':_0x202185[_0xa3e9('0x44')]['id']}})['then'](handleEntityNotFound(_0x30f153,null))[_0xa3e9('0x25')](function(_0x70b7ad){if(_0x70b7ad){return _0x70b7ad[_0xa3e9('0x4f')](_0x202185['body'][_0xa3e9('0x51')],_['omit'](_0x202185['body'],[_0xa3e9('0x51'),'id'])||{});}})[_0xa3e9('0x25')](respondWithResult(_0x30f153,null))[_0xa3e9('0x42')](handleError(_0x30f153,null));};exports[_0xa3e9('0x52')]=function(_0x12f4e4,_0x5cd8d6,_0x16fadb){var _0x44cb11={};var _0x10d6cc={};var _0x5862b6;var _0x6d6d59;return db['CmCompany']['findOne']({'where':{'id':_0x12f4e4[_0xa3e9('0x44')]['id']}})[_0xa3e9('0x25')](handleEntityNotFound(_0x5cd8d6,null))['then'](function(_0x16b93d){if(_0x16b93d){_0x5862b6=_0x16b93d;_0x10d6cc['model']=_[_0xa3e9('0x30')](db[_0xa3e9('0x50')]['rawAttributes']);_0x10d6cc[_0xa3e9('0x33')]=_[_0xa3e9('0x30')](_0x12f4e4[_0xa3e9('0x33')]);_0x10d6cc[_0xa3e9('0x31')]=_['intersection'](_0x10d6cc['model'],_0x10d6cc[_0xa3e9('0x33')]);_0x44cb11['attributes']=_[_0xa3e9('0x32')](_0x10d6cc[_0xa3e9('0x2f')],qs['fields'](_0x12f4e4['query']['fields']));_0x44cb11[_0xa3e9('0x35')]=_0x44cb11[_0xa3e9('0x35')][_0xa3e9('0x36')]?_0x44cb11[_0xa3e9('0x35')]:_0x10d6cc[_0xa3e9('0x2f')];_0x44cb11[_0xa3e9('0x38')]=qs[_0xa3e9('0x39')](_0x12f4e4[_0xa3e9('0x33')][_0xa3e9('0x39')]);_0x44cb11[_0xa3e9('0x3c')]=qs[_0xa3e9('0x31')](_[_0xa3e9('0x3a')](_0x12f4e4[_0xa3e9('0x33')],_0x10d6cc[_0xa3e9('0x31')]));if(_0x12f4e4[_0xa3e9('0x33')][_0xa3e9('0x3d')]){_0x44cb11[_0xa3e9('0x3c')]=_['merge'](_0x44cb11[_0xa3e9('0x3c')],{'$or':_[_0xa3e9('0x53')](_0x44cb11['attributes'],function(_0x343699){var _0x3ad79f={};_0x3ad79f[_0x343699]={'$like':'%'+_0x12f4e4['query'][_0xa3e9('0x3d')]+'%'};return _0x3ad79f;})});}_0x44cb11=_[_0xa3e9('0x3b')]({},_0x44cb11,_0x12f4e4[_0xa3e9('0x3e')]);return _0x5862b6[_0xa3e9('0x52')](_0x44cb11);}})[_0xa3e9('0x25')](function(_0x270189){if(_0x270189){_0x6d6d59=_0x270189[_0xa3e9('0x36')];if(!_0x12f4e4[_0xa3e9('0x33')][_0xa3e9('0x37')](_0xa3e9('0x54'))){_0x44cb11[_0xa3e9('0x1e')]=qs[_0xa3e9('0x1e')](_0x12f4e4['query']['limit']);_0x44cb11[_0xa3e9('0x20')]=qs[_0xa3e9('0x20')](_0x12f4e4['query'][_0xa3e9('0x20')]);}return _0x5862b6['getContacts'](_0x44cb11);}})[_0xa3e9('0x25')](function(_0x28f5cb){if(_0x28f5cb){return _0x28f5cb?{'count':_0x6d6d59,'rows':_0x28f5cb}:null;}})[_0xa3e9('0x25')](respondWithResult(_0x5cd8d6,null))[_0xa3e9('0x42')](handleError(_0x5cd8d6,null));};
\ No newline at end of file
index 2177a6b..523498c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x827b=['rimraf','./cmCompany.attributes','exports','define','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x827b,0x89));var _0xb827=function(_0x244d91,_0x4e580e){_0x244d91=_0x244d91-0x0;var _0x59cce8=_0x827b[_0x244d91];return _0x59cce8;};'use strict';var _=require(_0xb827('0x0'));var util=require('util');var logger=require(_0xb827('0x1'))(_0xb827('0x2'));var moment=require(_0xb827('0x3'));var BPromise=require(_0xb827('0x4'));var rp=require(_0xb827('0x5'));var fs=require('fs');var path=require(_0xb827('0x6'));var rimraf=require(_0xb827('0x7'));var config=require('../../config/environment');var attributes=require(_0xb827('0x8'));module[_0xb827('0x9')]=function(_0x5bd5b0,_0x2bfcbc){return _0x5bd5b0[_0xb827('0xa')]('CmCompany',attributes,{'tableName':_0xb827('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4eb5=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4eb5,0xd0));var _0x54eb=function(_0x4f9938,_0x766949){_0x4f9938=_0x4f9938-0x0;var _0x4450fa=_0x4eb5[_0x4f9938];return _0x4450fa;};'use strict';var _=require(_0x54eb('0x0'));var util=require(_0x54eb('0x1'));var logger=require(_0x54eb('0x2'))(_0x54eb('0x3'));var moment=require(_0x54eb('0x4'));var BPromise=require('bluebird');var rp=require(_0x54eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54eb('0x6'));var config=require(_0x54eb('0x7'));var attributes=require(_0x54eb('0x8'));module[_0x54eb('0x9')]=function(_0x198c60,_0x4a6fac){return _0x198c60[_0x54eb('0xa')](_0x54eb('0xb'),attributes,{'tableName':_0x54eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4a198c4..6a6588f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bb7=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x8bb7,0x1d3));var _0x78bb=function(_0x100464,_0x5baf1a){_0x100464=_0x100464-0x0;var _0x3da0fc=_0x8bb7[_0x100464];return _0x3da0fc;};'use strict';var _=require(_0x78bb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x78bb('0x1'));var rs=require(_0x78bb('0x2'));var fs=require('fs');var Redis=require(_0x78bb('0x3'));var db=require(_0x78bb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x78bb('0x5'))(_0x78bb('0x6'));var config=require(_0x78bb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x78bb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xae5471,_0x2f69be,_0x3a4686){return new BPromise(function(_0x3d2dc7,_0xfae600){return client[_0x78bb('0x9')](_0xae5471,_0x3a4686)[_0x78bb('0xa')](function(_0x37b636){logger[_0x78bb('0xb')](_0x78bb('0xc'),_0x2f69be,'request\x20sent');logger[_0x78bb('0xd')](_0x78bb('0xe'),_0x2f69be,_0x78bb('0xf'),JSON[_0x78bb('0x10')](_0x37b636));if(_0x37b636[_0x78bb('0x11')]){if(_0x37b636[_0x78bb('0x11')][_0x78bb('0x12')]===0x1f4){logger['error'](_0x78bb('0xc'),_0x2f69be,_0x37b636[_0x78bb('0x11')][_0x78bb('0x13')]);return _0xfae600(_0x37b636[_0x78bb('0x11')][_0x78bb('0x13')]);}logger['error'](_0x78bb('0xc'),_0x2f69be,_0x37b636[_0x78bb('0x11')][_0x78bb('0x13')]);return _0x3d2dc7(_0x37b636[_0x78bb('0x11')][_0x78bb('0x13')]);}else{logger[_0x78bb('0xb')](_0x78bb('0xc'),_0x2f69be,'request\x20sent');_0x3d2dc7(_0x37b636[_0x78bb('0x14')][_0x78bb('0x13')]);}})[_0x78bb('0x15')](function(_0xac5fa1){logger[_0x78bb('0x11')](_0x78bb('0xc'),_0x2f69be,_0xac5fa1);_0xfae600(_0xac5fa1);});});}
\ No newline at end of file
+var _0x6fdf=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x487620,_0x39ef12){var _0xd21f02=function(_0x29c122){while(--_0x29c122){_0x487620['push'](_0x487620['shift']());}};_0xd21f02(++_0x39ef12);}(_0x6fdf,0x86));var _0xf6fd=function(_0x1b7074,_0x57a607){_0x1b7074=_0x1b7074-0x0;var _0x5ace20=_0x6fdf[_0x1b7074];return _0x5ace20;};'use strict';var _=require(_0xf6fd('0x0'));var util=require(_0xf6fd('0x1'));var moment=require(_0xf6fd('0x2'));var BPromise=require(_0xf6fd('0x3'));var rs=require(_0xf6fd('0x4'));var fs=require('fs');var Redis=require(_0xf6fd('0x5'));var db=require(_0xf6fd('0x6'))['db'];var utils=require(_0xf6fd('0x7'));var logger=require(_0xf6fd('0x8'))(_0xf6fd('0x9'));var config=require(_0xf6fd('0xa'));var jayson=require(_0xf6fd('0xb'));var client=jayson[_0xf6fd('0xc')][_0xf6fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1f27a4,_0x1b79ec,_0x37f260){return new BPromise(function(_0x42f291,_0x42be27){return client[_0xf6fd('0xe')](_0x1f27a4,_0x37f260)['then'](function(_0xe3f19b){logger[_0xf6fd('0xf')]('CmCompany,\x20%s,\x20%s',_0x1b79ec,_0xf6fd('0x10'));logger['debug'](_0xf6fd('0x11'),_0x1b79ec,_0xf6fd('0x10'),JSON['stringify'](_0xe3f19b));if(_0xe3f19b[_0xf6fd('0x12')]){if(_0xe3f19b[_0xf6fd('0x12')][_0xf6fd('0x13')]===0x1f4){logger[_0xf6fd('0x12')](_0xf6fd('0x14'),_0x1b79ec,_0xe3f19b[_0xf6fd('0x12')][_0xf6fd('0x15')]);return _0x42be27(_0xe3f19b['error'][_0xf6fd('0x15')]);}logger[_0xf6fd('0x12')]('CmCompany,\x20%s,\x20%s',_0x1b79ec,_0xe3f19b[_0xf6fd('0x12')][_0xf6fd('0x15')]);return _0x42f291(_0xe3f19b['error'][_0xf6fd('0x15')]);}else{logger[_0xf6fd('0xf')](_0xf6fd('0x14'),_0x1b79ec,_0xf6fd('0x10'));_0x42f291(_0xe3f19b[_0xf6fd('0x16')][_0xf6fd('0x15')]);}})[_0xf6fd('0x17')](function(_0x5968d0){logger['error']('CmCompany,\x20%s,\x20%s',_0x1b79ec,_0x5968d0);_0x42be27(_0x5968d0);});});}
\ No newline at end of file
index c9b719e..38c9ac8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae9b=['create','addContacts','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','post'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xae9b,0x17b));var _0xbae9=function(_0x174c38,_0xffd410){_0x174c38=_0x174c38-0x0;var _0x4df785=_0xae9b[_0x174c38];return _0x4df785;};'use strict';var multer=require(_0xbae9('0x0'));var util=require(_0xbae9('0x1'));var path=require('path');var timeout=require(_0xbae9('0x2'));var express=require('express');var router=express[_0xbae9('0x3')]();var fs_extra=require(_0xbae9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbae9('0x5'));var config=require(_0xbae9('0x6'));var controller=require(_0xbae9('0x7'));router[_0xbae9('0x8')]('/',auth['isAuthenticated'](),controller[_0xbae9('0x9')]);router['get'](_0xbae9('0xa'),auth[_0xbae9('0xb')](),controller[_0xbae9('0xc')]);router[_0xbae9('0x8')](_0xbae9('0xd'),auth[_0xbae9('0xb')](),controller[_0xbae9('0xe')]);router[_0xbae9('0x8')](_0xbae9('0xf'),auth[_0xbae9('0xb')](),controller['getContacts']);router[_0xbae9('0x10')]('/',auth[_0xbae9('0xb')](),controller[_0xbae9('0x11')]);router[_0xbae9('0x10')](_0xbae9('0xf'),auth[_0xbae9('0xb')](),controller[_0xbae9('0x12')]);router['put'](_0xbae9('0xd'),auth[_0xbae9('0xb')](),controller[_0xbae9('0x13')]);router['delete'](_0xbae9('0xd'),auth[_0xbae9('0xb')](),controller[_0xbae9('0x14')]);module[_0xbae9('0x15')]=router;
\ No newline at end of file
+var _0xa164=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put'];(function(_0x5b36eb,_0x1162b0){var _0x467355=function(_0x343c86){while(--_0x343c86){_0x5b36eb['push'](_0x5b36eb['shift']());}};_0x467355(++_0x1162b0);}(_0xa164,0xaa));var _0x4a16=function(_0xbc519a,_0x31ced6){_0xbc519a=_0xbc519a-0x0;var _0x2b0566=_0xa164[_0xbc519a];return _0x2b0566;};'use strict';var multer=require(_0x4a16('0x0'));var util=require(_0x4a16('0x1'));var path=require(_0x4a16('0x2'));var timeout=require(_0x4a16('0x3'));var express=require(_0x4a16('0x4'));var router=express[_0x4a16('0x5')]();var fs_extra=require(_0x4a16('0x6'));var auth=require(_0x4a16('0x7'));var interaction=require(_0x4a16('0x8'));var config=require(_0x4a16('0x9'));var controller=require('./cmCompany.controller');router[_0x4a16('0xa')]('/',auth[_0x4a16('0xb')](),controller[_0x4a16('0xc')]);router['get'](_0x4a16('0xd'),auth[_0x4a16('0xb')](),controller[_0x4a16('0xe')]);router[_0x4a16('0xa')](_0x4a16('0xf'),auth['isAuthenticated'](),controller[_0x4a16('0x10')]);router[_0x4a16('0xa')](_0x4a16('0x11'),auth[_0x4a16('0xb')](),controller[_0x4a16('0x12')]);router[_0x4a16('0x13')]('/',auth[_0x4a16('0xb')](),controller['create']);router[_0x4a16('0x13')]('/:id/contacts',auth[_0x4a16('0xb')](),controller[_0x4a16('0x14')]);router[_0x4a16('0x15')](_0x4a16('0xf'),auth[_0x4a16('0xb')](),controller['update']);router[_0x4a16('0x16')](_0x4a16('0xf'),auth[_0x4a16('0xb')](),controller[_0x4a16('0x17')]);module['exports']=router;
\ No newline at end of file
index a40da08..478db05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe180=['STRING','TEXT','INTEGER'];(function(_0x418b88,_0x398b6c){var _0x1761a6=function(_0x19eb50){while(--_0x19eb50){_0x418b88['push'](_0x418b88['shift']());}};_0x1761a6(++_0x398b6c);}(_0xe180,0x111));var _0x0e18=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xe180[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x0e18('0x0')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0e18('0x0')]},'postalCode':{'type':Sequelize[_0x0e18('0x0')]},'city':{'type':Sequelize[_0x0e18('0x0')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x0e18('0x0')]},'description':{'type':Sequelize[_0x0e18('0x1')]},'phone':{'type':Sequelize[_0x0e18('0x0')]},'mobile':{'type':Sequelize[_0x0e18('0x0')]},'fax':{'type':Sequelize[_0x0e18('0x0')]},'email':{'type':Sequelize[_0x0e18('0x0')]},'url':{'type':Sequelize[_0x0e18('0x0')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0e18('0x0')]},'skype':{'type':Sequelize[_0x0e18('0x0')]},'teams':{'type':Sequelize[_0x0e18('0x0')]},'viber':{'type':Sequelize[_0x0e18('0x0')]},'line':{'type':Sequelize[_0x0e18('0x0')]},'wechat':{'type':Sequelize[_0x0e18('0x0')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x0e18('0x2')]},'priority':{'type':Sequelize[_0x0e18('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xb190=['exports','STRING','TEXT','INTEGER','DATE','NOW','sequelize'];(function(_0x27188e,_0x2cb7b7){var _0x466456=function(_0x2b9758){while(--_0x2b9758){_0x27188e['push'](_0x27188e['shift']());}};_0x466456(++_0x2cb7b7);}(_0xb190,0x84));var _0x0b19=function(_0x318890,_0x524b86){_0x318890=_0x318890-0x0;var _0x4e3df0=_0xb190[_0x318890];return _0x4e3df0;};'use strict';var _=require('lodash');var Sequelize=require(_0x0b19('0x0'));module[_0x0b19('0x1')]={'firstName':{'type':Sequelize[_0x0b19('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0b19('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0b19('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0b19('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0b19('0x2')]},'description':{'type':Sequelize[_0x0b19('0x3')]},'phone':{'type':Sequelize[_0x0b19('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0b19('0x2')]},'url':{'type':Sequelize[_0x0b19('0x2')]},'facebook':{'type':Sequelize[_0x0b19('0x2')]},'fb_data':{'type':Sequelize[_0x0b19('0x2')]},'twitter':{'type':Sequelize[_0x0b19('0x2')]},'skype':{'type':Sequelize[_0x0b19('0x2')]},'teams':{'type':Sequelize[_0x0b19('0x2')]},'viber':{'type':Sequelize[_0x0b19('0x2')]},'line':{'type':Sequelize[_0x0b19('0x2')]},'wechat':{'type':Sequelize[_0x0b19('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x0b19('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':Sequelize[_0x0b19('0x6')]}};
\ No newline at end of file
index 7f50d60..3286b29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04bc=['isEmpty','forEach','ListId','c.ListId\x20IN\x20?','\x20=\x20?','tag','isArray','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','conditions','getLists','c.ListId\x20IS\x20NULL','toString','sequelize','keyBy','merge','c.firstName','c.phone','c.mobile','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','tags','startsWith','columnName','displayName','analytics','findAll','custom','values','body','get','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','join','duplicates','$or','findOrCreate','show','omit','format','cf_%d','$and','table','setFields','id\x20=\x20?','toParam','phone','CmHopper','getTags','findOne','options','ids','getHoppers','rawAttributes','ContactId','includeAll','getHopperHistories','getJscriptySessions','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','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','pid','upload','createReadStream','meta','binding','fork','../../components/import/cm/csv2','stringify','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','alias','findAndCountAll','startCase','chat','Website','Account','secondDisposition','key','Owner','browserName','customerPort','osName','ratingMessage','ratingType','ratingValue','substatus','Interaction','flatten','sortBy','reverse','slice','bluebird','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','./cmContact.socket','register','status','json','limit','undefined','count','offset','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','cf_','push','CmCustomField','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact'];(function(_0x37a45b,_0x1056ef){var _0x35f3bb=function(_0x5d73cd){while(--_0x5d73cd){_0x37a45b['push'](_0x37a45b['shift']());}};_0x35f3bb(++_0x1056ef);}(_0x04bc,0x1ba));var _0xc04b=function(_0xe54549,_0x9c645c){_0xe54549=_0xe54549-0x0;var _0x3d3aae=_0x04bc[_0xe54549];return _0x3d3aae;};'use strict';var moment=require('moment');var BPromise=require(_0xc04b('0x0'));var util=require('util');var path=require(_0xc04b('0x1'));var fs=require('fs');var _=require(_0xc04b('0x2'));var squel=require(_0xc04b('0x3'));var Papa=require(_0xc04b('0x4'));var Redis=require(_0xc04b('0x5'));var qs=require(_0xc04b('0x6'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xc04b('0x7'))('api');var config=require(_0xc04b('0x8'));var db=require(_0xc04b('0x9'))['db'];config['redis']=_['defaults'](config[_0xc04b('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc04b('0xb'))[_0xc04b('0xc')](socket);function respondWithResult(_0x2c2b56,_0x31434a){_0x31434a=_0x31434a||0xc8;return function(_0x43f71f){if(_0x43f71f){return _0x2c2b56[_0xc04b('0xd')](_0x31434a)[_0xc04b('0xe')](_0x43f71f);}};}function respondWithFilteredResult(_0x42084b,_0x290785){return function(_0x32dea3){if(_0x32dea3){var _0x3809c9=typeof _0x290785['offset']==='undefined'&&typeof _0x290785[_0xc04b('0xf')]===_0xc04b('0x10');var _0x48266e=_0x32dea3[_0xc04b('0x11')];var _0x67126b=_0x3809c9?0x0:_0x290785[_0xc04b('0x12')];var _0x181f30=_0x3809c9?_0x32dea3['count']:_0x290785['offset']+_0x290785['limit'];var _0x2101e2;if(_0x181f30>=_0x48266e){_0x181f30=_0x48266e;_0x2101e2=0xc8;}else{_0x2101e2=0xce;}_0x42084b[_0xc04b('0xd')](_0x2101e2);return _0x42084b['set'](_0xc04b('0x13'),_0x67126b+'-'+_0x181f30+'/'+_0x48266e)[_0xc04b('0xe')](_0x32dea3);}return null;};}function saveUpdates(_0x58c787){return function(_0x1d3af5){if(_0x1d3af5){return _0x1d3af5[_0xc04b('0x14')](_0x58c787)[_0xc04b('0x15')](function(_0x5de8ec){return _0x5de8ec;});}return null;};}function removeEntity(_0x252a4c){return function(_0xefe88e){if(_0xefe88e){return _0xefe88e[_0xc04b('0x16')]()['then'](function(){_0x252a4c['status'](0xcc)[_0xc04b('0x17')]();});}};}function handleEntityNotFound(_0x40a76c){return function(_0x54b2cd){if(!_0x54b2cd){_0x40a76c[_0xc04b('0x18')](0x194);}return _0x54b2cd;};}function handleError(_0x37d081,_0x40ff53){_0x40ff53=_0x40ff53||0x1f4;return function(_0x21d058){logger[_0xc04b('0x19')](_0x21d058[_0xc04b('0x1a')]);if(_0x21d058[_0xc04b('0x1b')]){delete _0x21d058[_0xc04b('0x1b')];}_0x37d081[_0xc04b('0xd')](_0x40ff53)[_0xc04b('0x1c')](_0x21d058);};}exports[_0xc04b('0x1d')]=function(_0x4a3e02,_0x1cf75c){var _0x1d8728={},_0x4dafa2={},_0x2b8a03={'count':0x0,'rows':[]};return db[_0xc04b('0x1e')][_0xc04b('0x1f')]()[_0xc04b('0x15')](function(_0x412594){var _0x57cb27=[];for(var _0x4d1029=0x0;_0x4d1029<Object[_0xc04b('0x20')](_0x412594)[_0xc04b('0x21')];_0x4d1029++){var _0x1022a1=Object[_0xc04b('0x20')](_0x412594)[_0x4d1029];if(_['startsWith'](_0x1022a1,_0xc04b('0x22'))){_0x57cb27[_0xc04b('0x23')](db[_0xc04b('0x24')]['findOne']({'where':{'id':_[_0xc04b('0x25')](_0x1022a1,_0xc04b('0x22'))},'raw':!![]}));}}return BPromise[_0xc04b('0x26')](_0x57cb27)[_0xc04b('0x15')](function(_0x2c3077){for(var _0x59baf6=0x0;_0x59baf6<_0x2c3077[_0xc04b('0x21')];_0x59baf6++){if(_0x2c3077[_0x59baf6]){var _0x14154b='cf_'+_0x2c3077[_0x59baf6]['id'];var _0x291634=_0x412594[_0x14154b];_0x291634[_0xc04b('0x27')]=_0x2c3077[_0x59baf6][_0xc04b('0x28')];}}return _0x412594;});})['then'](function(_0x386ba7){_0x4dafa2[_0xc04b('0x29')]=_[_0xc04b('0x20')](_0x386ba7);_0x4dafa2[_0xc04b('0x2a')]=_[_0xc04b('0x20')](_0x4a3e02[_0xc04b('0x2a')]);_0x4dafa2[_0xc04b('0x2b')]=_[_0xc04b('0x2c')](_0x4dafa2[_0xc04b('0x29')],_0x4dafa2[_0xc04b('0x2a')]);_0x1d8728[_0xc04b('0x2d')]=_[_0xc04b('0x2c')](_0x4dafa2[_0xc04b('0x29')],qs[_0xc04b('0x2e')](_0x4a3e02[_0xc04b('0x2a')]['fields']));_0x1d8728[_0xc04b('0x2d')]=_0x1d8728[_0xc04b('0x2d')][_0xc04b('0x21')]?_0x1d8728[_0xc04b('0x2d')]:_0x4dafa2['model'];if(!_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0x2f')](_0xc04b('0x30'))){_0x1d8728[_0xc04b('0xf')]=qs[_0xc04b('0xf')](_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0xf')]);_0x1d8728[_0xc04b('0x12')]=qs[_0xc04b('0x12')](_0x4a3e02['query']['offset']);}_0x1d8728[_0xc04b('0x31')]=qs[_0xc04b('0x32')](_0x4a3e02['query'][_0xc04b('0x32')]);_0x1d8728[_0xc04b('0x33')]=qs['filters'](_[_0xc04b('0x34')](_0x4a3e02[_0xc04b('0x2a')],_0x4dafa2[_0xc04b('0x2b')]),_0x386ba7);var _0x110205=[];var _0x4714cd=squel[_0xc04b('0x35')]()[_0xc04b('0x36')]('id')[_0xc04b('0x36')](_0xc04b('0x1b'))[_0xc04b('0x36')](_0xc04b('0x37'))[_0xc04b('0x38')]('tools_tags');var _0x4e377b=squel['select']()[_0xc04b('0x38')](_0xc04b('0x39'),'c')[_0xc04b('0x3a')](_0xc04b('0x3b'),'uc','uc.CmContactId\x20=\x20c.id')['left_join'](_0xc04b('0x3c'),'ct',_0xc04b('0x3d'))['left_join'](_0xc04b('0x3e'),'t',_0xc04b('0x3f'))[_0xc04b('0x33')](_0xc04b('0x40'));var _0x555e8a=squel['expr']();var _0x443574=[];var _0x39ee25=squel[_0xc04b('0x41')]();var _0x3b788a;if(_0x4a3e02[_0xc04b('0x2a')]['search']){_0x3b788a=as[_0xc04b('0x42')](_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0x43')]);var _0x4c1fd8=_0x3b788a[_0xc04b('0x44')];for(var _0x179b18=0x0;_0x179b18<_0x3b788a['conditions']['length'];_0x179b18++){var _0x404e17=_0x3b788a['conditions'][_0x179b18];var _0x4efaeb='c';var _0x2afa15=_(_0x386ba7)['keys']()[_0xc04b('0x45')](function(_0x16390d){return _0x16390d===_0x404e17[_0xc04b('0x36')];});if(_0x2afa15)_0x2afa15=_0x386ba7[_0x404e17['field']];if(!_0x2afa15){if(_0x404e17[_0xc04b('0x36')]===_0xc04b('0x46')){var _0xa95e26=_0x404e17[_0xc04b('0x47')][_0xc04b('0x48')](',')[_0xc04b('0x49')](function(_0x4e4864){return Number(_0x4e4864);});_0xa95e26['forEach'](function(_0x589556){_0x39ee25['or'](_0xc04b('0x4a'),'%,'+_0x589556+',%');});_0x443574=_['union'](_0x443574,_0xa95e26);}else if(_0x404e17[_0xc04b('0x36')]===_0xc04b('0x4b')){_0x555e8a[_0xc04b('0x4c')](_0xc04b('0x4d'),_0x404e17[_0xc04b('0x47')]);}}else{if(_0x404e17['field']===_0xc04b('0x4e')||_0x2afa15['fieldType']===_0xc04b('0x4f'))_0x404e17[_0xc04b('0x50')]=_0xc04b('0x51');var _0x16d401=as[_0xc04b('0x52')](_0x4efaeb,_0x2afa15[_0xc04b('0x28')],_0x404e17);_0x555e8a[_0x4c1fd8](_0x16d401[_0xc04b('0x53')],_0x16d401['value'][_0xc04b('0x54')],_0x16d401[_0xc04b('0x47')][_0xc04b('0x17')]);}}}else{var _0x70e78b=_(Object[_0xc04b('0x20')](_0x4a3e02[_0xc04b('0x2a')]))[_0xc04b('0x49')](function(_0x3fad42){return _0x386ba7[_0xc04b('0x2f')](_0x3fad42)?_0x3fad42:undefined;})[_0xc04b('0x55')](function(_0x59073f){return!_[_0xc04b('0x56')](_0x59073f);})[_0xc04b('0x47')]();if(_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0x57')])_0x70e78b[_0xc04b('0x23')](_0xc04b('0x57'));if(!_[_0xc04b('0x58')](_0x70e78b)){_0x70e78b[_0xc04b('0x59')](function(_0x285d9e){if(_0x285d9e===_0xc04b('0x5a')){_0x4e377b[_0xc04b('0x33')](_0xc04b('0x5b'),[]['concat'](_0x4a3e02[_0xc04b('0x2a')][_0x285d9e]));}else if(_0x285d9e===_0xc04b('0x57')){var _0x1ac03d='%'+_0x4a3e02['query'][_0x285d9e]+'%';_0x4e377b[_0xc04b('0x33')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x1ac03d);}else{_0x4e377b[_0xc04b('0x33')]('c.'+_0x285d9e+_0xc04b('0x5c'),_0x4a3e02[_0xc04b('0x2a')][_0x285d9e]);}});}if(_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0x5d')]){_0x443574=_[_0xc04b('0x5e')](_0x4a3e02['query']['tag'])?_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0x5d')]:new Array(_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0x5d')]);_0x443574['forEach'](function(_0x48835c){_0x39ee25['or'](_0xc04b('0x4a'),'%,'+_0x48835c+',%');});}if(_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0x55')]){var _0x5f54a6=_0x4a3e02['query'][_0xc04b('0x55')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x5f54a6[_0xc04b('0x48')]('\x20')[_0xc04b('0x21')]>0x1){_0x555e8a['or'](_0xc04b('0x5f'),qs[_0xc04b('0x60')](_0x5f54a6),null);}else{if(qs[_0xc04b('0x61')](_0x5f54a6)){_0x555e8a['or']('c.id\x20LIKE\x20?',_0x5f54a6+'%');_0x555e8a['or']('c.phone\x20LIKE\x20?',_0x5f54a6+'%');_0x555e8a['or'](_0xc04b('0x62'),_0x5f54a6+'%');_0x555e8a['or']('c.fax\x20LIKE\x20?',_0x5f54a6+'%');}else if(qs['isEmail'](_0x5f54a6)){_0x555e8a['or'](_0xc04b('0x63'),_0x5f54a6+'%');}else{_0x555e8a['or']('c.firstName\x20LIKE\x20?','%'+_0x5f54a6+'%');_0x555e8a['or'](_0xc04b('0x64'),'%'+_0x5f54a6+'%');_0x555e8a['or'](_0xc04b('0x63'),'%'+_0x5f54a6+'%');}}}}_0x4e377b[_0xc04b('0x33')](_0x555e8a);_0x4e377b[_0xc04b('0x65')](_0xc04b('0x66'));var _0x2e39f8={'type':db[_0xc04b('0x67')]['QueryTypes'][_0xc04b('0x68')],'raw':!![]};var _0x51cd02=_0x4e377b[_0xc04b('0x69')]()['field'](_0xc04b('0x66'));if(_0x1d8728[_0xc04b('0x31')]){_0x1d8728[_0xc04b('0x31')]['forEach'](function(_0x737d02){_0x4e377b[_0xc04b('0x31')]('c.'+_0x737d02[0x0],_0x737d02[0x1]===_0xc04b('0x6a')?![]:!![]);});}if(!_['isEmpty'](_0x443574)){_0x4e377b[_0xc04b('0x6b')](_0x39ee25);_0x51cd02['where'](_0xc04b('0x6c'),_0x443574);}BPromise[_0xc04b('0x6d')]()[_0xc04b('0x15')](function(){if(!_0x3b788a)return;if(_0x4a3e02[_0xc04b('0x6e')][_0xc04b('0x6f')]!==_0xc04b('0x70'))return;if(!_['some'](_0x3b788a[_0xc04b('0x71')],[_0xc04b('0x36'),_0xc04b('0x4b')])){return _0x4a3e02['user'][_0xc04b('0x72')]({'attributes':['id'],'raw':!![]})[_0xc04b('0x15')](function(_0x1b3a08){if(_[_0xc04b('0x58')](_0x1b3a08)){_0x51cd02[_0xc04b('0x33')](_0xc04b('0x73'));_0x4e377b[_0xc04b('0x33')](_0xc04b('0x73'));}else{_0x51cd02[_0xc04b('0x33')](_0xc04b('0x5b'),_[_0xc04b('0x49')](_0x1b3a08,'id'));_0x4e377b[_0xc04b('0x33')](_0xc04b('0x5b'),_[_0xc04b('0x49')](_0x1b3a08,'id'));}});}})[_0xc04b('0x15')](function(){if(_0x4a3e02[_0xc04b('0x6e')][_0xc04b('0x6f')]===_0xc04b('0x70')&&!_0x3b788a&&!_0x4a3e02[_0xc04b('0x2a')]['ListId'])return[];return db['sequelize'][_0xc04b('0x2a')](_0x51cd02[_0xc04b('0x74')](),_0x2e39f8);})[_0xc04b('0x15')](function(_0xebc2c7){_0x2b8a03['count']=_0xebc2c7[_0xc04b('0x21')];if(_0x2b8a03[_0xc04b('0x11')]===0x0)return[];return db[_0xc04b('0x75')]['query'](_0x4714cd[_0xc04b('0x74')](),_0x2e39f8)[_0xc04b('0x15')](function(_0x1c3e75){_0x110205=_[_0xc04b('0x76')](_0x1c3e75,'id');_0x2e39f8=_[_0xc04b('0x77')](_0x2e39f8,{'model':db[_0xc04b('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a3e02[_0xc04b('0x2a')][_0xc04b('0x2e')]){_0x1d8728['attributes'][_0xc04b('0x59')](function(_0x45ec1e){_0x4e377b[_0xc04b('0x36')]('c.'+_0x45ec1e);});}else{_0x4e377b['field'](_0xc04b('0x66'));_0x4e377b[_0xc04b('0x36')](_0xc04b('0x78'));_0x4e377b[_0xc04b('0x36')]('c.lastName');_0x4e377b[_0xc04b('0x36')](_0xc04b('0x79'));_0x4e377b['field'](_0xc04b('0x7a'));_0x4e377b[_0xc04b('0x36')]('c.fax');_0x4e377b['field']('c.email');_0x4e377b[_0xc04b('0x36')](_0xc04b('0x7b'));_0x4e377b[_0xc04b('0x36')](_0xc04b('0x7c'));_0x4e377b[_0xc04b('0x36')]('c.deletedAt');_0x4e377b[_0xc04b('0x36')]('c.CompanyId');_0x4e377b['field'](_0xc04b('0x7d'),_0xc04b('0x7e'));}if(_0x1d8728[_0xc04b('0xf')])_0x4e377b[_0xc04b('0xf')](_0x1d8728[_0xc04b('0xf')]);if(_0x1d8728['offset'])_0x4e377b['offset'](_0x1d8728['offset']);return db[_0xc04b('0x75')][_0xc04b('0x2a')](_0x4e377b[_0xc04b('0x74')](),_0x2e39f8);});})['then'](function(_0x9a0b7a){_0x9a0b7a[_0xc04b('0x59')](function(_0x4b3979){if(_0x4b3979[_0xc04b('0x7e')]){_0x4b3979[_0xc04b('0x7f')]=[];_0x4b3979[_0xc04b('0x7e')][_0xc04b('0x48')](',')[_0xc04b('0x59')](function(_0x40b5e6){_0x4b3979[_0xc04b('0x7f')]['push'](_0x110205[_0x40b5e6]);});}delete _0x4b3979[_0xc04b('0x7e')];});_0x2b8a03[_0xc04b('0x80')]=_0x9a0b7a;return _0x2b8a03;})[_0xc04b('0x15')](respondWithFilteredResult(_0x1cf75c,_0x1d8728));})['catch'](handleError(_0x1cf75c,null));};exports[_0xc04b('0x16')]=function(_0x79a126,_0x2eeeea){return db[_0xc04b('0x1e')][_0xc04b('0x45')]({'where':{'id':_0x79a126[_0xc04b('0x81')]['id']}})['then'](handleEntityNotFound(_0x2eeeea,null))[_0xc04b('0x15')](removeEntity(_0x2eeeea,null))[_0xc04b('0x82')](handleError(_0x2eeeea,null));};exports[_0xc04b('0x1f')]=function(_0x1ebbfe,_0x5821fa){return db[_0xc04b('0x1e')]['describe']()[_0xc04b('0x15')](function(_0x200e73){delete _0x200e73[_0xc04b('0x83')];for(var _0x4e60a8=0x0;_0x4e60a8<Object[_0xc04b('0x20')](_0x200e73)[_0xc04b('0x21')];_0x4e60a8++){var _0x57554f=Object[_0xc04b('0x20')](_0x200e73)[_0x4e60a8];if(!_[_0xc04b('0x84')](_0x57554f,'cf_')){_0x200e73[_0x57554f][_0xc04b('0x85')]=_0x57554f;_0x200e73[_0x57554f][_0xc04b('0x86')]=_0x57554f;}}return _0x200e73;})[_0xc04b('0x15')](function(_0x5e6e9d){var _0x6387c7={'where':Boolean(_0x1ebbfe[_0xc04b('0x2a')][_0xc04b('0x87')])===!![]?undefined:{'$or':[{'ListId':_0x1ebbfe[_0xc04b('0x2a')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xc04b('0x24')][_0xc04b('0x88')](_0x6387c7)[_0xc04b('0x15')](function(_0x37e5d1){for(var _0x2da286=0x0;_0x2da286<_0x37e5d1[_0xc04b('0x21')];_0x2da286++){var _0x17f22e=_0xc04b('0x22')+_0x37e5d1[_0x2da286]['id'];_0x5e6e9d[_0x17f22e]['columnName']=_0x17f22e;_0x5e6e9d[_0x17f22e][_0xc04b('0x86')]=_0x37e5d1[_0x2da286]['alias'];_0x5e6e9d[_0x17f22e][_0xc04b('0x89')]={'type':_0x37e5d1[_0x2da286][_0xc04b('0x28')],'values':_0x37e5d1[_0x2da286][_0xc04b('0x8a')]};}Object['keys'](_0x5e6e9d)[_0xc04b('0x59')](function(_0x35234e){if(!_0x5e6e9d[_0x35234e][_0xc04b('0x2f')](_0xc04b('0x85'))){delete _0x5e6e9d[_0x35234e];}});return _0x5e6e9d;});})[_0xc04b('0x15')](respondWithResult(_0x5821fa,null))[_0xc04b('0x82')](handleError(_0x5821fa,null));};exports[_0xc04b('0x77')]=function(_0x26c6fa,_0x388bfd){var _0x586cf6;var _0x2d316a;var _0x351652;if(_0x26c6fa[_0xc04b('0x8b')]['id']){delete _0x26c6fa[_0xc04b('0x8b')]['id'];}return db[_0xc04b('0x1e')][_0xc04b('0x88')]({'where':{'id':[_0x26c6fa['body']['to'],_0x26c6fa[_0xc04b('0x8b')][_0xc04b('0x38')]]}})[_0xc04b('0x15')](function(_0x5d4f0b){if(_0x5d4f0b){if(_0x5d4f0b[_0xc04b('0x21')]!==0x2){return null;}_0x5d4f0b[0x0]=_0x5d4f0b[0x0][_0xc04b('0x8c')]({'plain':!![]});_0x5d4f0b[0x1]=_0x5d4f0b[0x1]['get']({'plain':!![]});delete _0x5d4f0b[0x0]['id'];delete _0x5d4f0b[0x1]['id'];return _['mergeWith'](_0x5d4f0b[0x0],_0x5d4f0b[0x1],function(_0x3a4526,_0xba0f){if(Array[_0xc04b('0x5e')](_0xba0f)&&!_0xba0f[_0xc04b('0x21')]){return _0x3a4526;}else if(!_0xba0f){return _0x3a4526;}});}})[_0xc04b('0x15')](handleEntityNotFound(_0x388bfd,null))[_0xc04b('0x15')](function(_0x507d0f){if(_0x507d0f){if(_0x507d0f[_0xc04b('0x83')]&&_[_0xc04b('0x5e')](_0x507d0f['tags'])){_0x507d0f['tags']=_0x507d0f['tags']['join']();}logger[_0xc04b('0x8d')](_0xc04b('0x8e'),_0x26c6fa[_0xc04b('0x8b')]['to'],_0x26c6fa[_0xc04b('0x8b')]['from']);return db['CmHopper'][_0xc04b('0x16')]({'where':{'ContactId':[_0x26c6fa['body']['to'],_0x26c6fa[_0xc04b('0x8b')][_0xc04b('0x38')]]}})['then'](function(_0x569dc6){logger[_0xc04b('0x8d')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x569dc6);return db['CmHopperBlack'][_0xc04b('0x16')]({'where':{'ContactId':[_0x26c6fa[_0xc04b('0x8b')]['to'],_0x26c6fa[_0xc04b('0x8b')][_0xc04b('0x38')]]}})['then'](function(_0x55ef8){logger['info']('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x55ef8);return db[_0xc04b('0x1e')][_0xc04b('0x8f')](_0x507d0f);});});}})['then'](function(_0x5642d5){if(_0x5642d5){_0x586cf6=_0x5642d5;_0x2d316a={'ContactId':_0x586cf6['id']};_0x351652={'where':{'ContactId':[_0x26c6fa[_0xc04b('0x8b')]['to'],_0x26c6fa[_0xc04b('0x8b')][_0xc04b('0x38')]]}};return db[_0xc04b('0x90')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x91')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x92')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db['MailInteraction'][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db['MailMessage'][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x93')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db['MailMessage']['update'](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x94')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})['then'](function(){if(_0x586cf6){return db['SmsMessage'][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x95')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})['then'](function(){if(_0x586cf6){return db[_0xc04b('0x96')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x97')]['update'](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db['OpenchannelMessage'][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x98')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x99')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x9a')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x9b')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})['then'](function(){if(_0x586cf6){return db[_0xc04b('0x9c')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db['FaxQueueReport'][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x9d')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db['OpenchannelQueueReport']['update'](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x9e')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0x9f')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0xa0')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db['WhatsappMessage']['update'](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db[_0xc04b('0xa1')][_0xc04b('0x14')](_0x2d316a,_0x351652);}})[_0xc04b('0x15')](function(){if(_0x586cf6){return db['CmContact']['destroy']({'where':{'id':[_0x26c6fa[_0xc04b('0x8b')]['to'],_0x26c6fa[_0xc04b('0x8b')]['from']]}});}})[_0xc04b('0x15')](function(){if(_0x586cf6){return _0x586cf6;}})['then'](respondWithResult(_0x388bfd,null))[_0xc04b('0x82')](handleError(_0x388bfd,null));};exports[_0xc04b('0x8f')]=function(_0x48b3cf,_0x495e32){return db[_0xc04b('0x1e')]['describe']()['then'](function(_0x4992fd){if(_0x48b3cf[_0xc04b('0x8b')][_0xc04b('0x83')]&&_[_0xc04b('0x5e')](_0x48b3cf[_0xc04b('0x8b')]['tags'])){if(_0x48b3cf[_0xc04b('0x8b')][_0xc04b('0x83')][_0xc04b('0x21')]){_0x48b3cf['body'][_0xc04b('0x83')]=_0x48b3cf[_0xc04b('0x8b')]['tags'][_0xc04b('0xa2')](';')+';';}else{_0x48b3cf[_0xc04b('0x8b')][_0xc04b('0x83')]=null;}}else{_0x48b3cf[_0xc04b('0x8b')][_0xc04b('0x83')]=null;}return db[_0xc04b('0x1e')][_0xc04b('0x8f')](_0x48b3cf[_0xc04b('0x8b')],{'fields':_[_0xc04b('0x20')](_0x4992fd),'raw':!![]});})[_0xc04b('0x15')](respondWithResult(_0x495e32,0xc9))[_0xc04b('0x82')](handleError(_0x495e32,null));};exports['bulkCreate']=function(_0x55711d,_0x3a091c){var _0x43b465=0x0;var _0x174e4b=0x0;var _0x3b19f9=0x0;return db['CmContact']['describe']()[_0xc04b('0x15')](function(_0xb84965){return BPromise['each'](_0x55711d[_0xc04b('0x8b')],function(_0x3a55c4){var _0x6a6469={'where':{'$or':[]},'defaults':_0x3a55c4,'fields':_[_0xc04b('0x20')](_0xb84965),'raw':!![]};if(_0x3a55c4[_0xc04b('0xa3')]){for(var _0xd9f290=0x0;_0xd9f290<_0x3a55c4[_0xc04b('0xa3')][_0xc04b('0x21')];_0xd9f290++){var _0x3cd5a1={};_0x3cd5a1[_0x3a55c4[_0xc04b('0xa3')][_0xd9f290]]=_0x3a55c4[_0x3a55c4['duplicates'][_0xd9f290]];_0x6a6469[_0xc04b('0x33')][_0xc04b('0xa4')][_0xc04b('0x23')](_0x3cd5a1);}_0x6a6469[_0xc04b('0x33')][_0xc04b('0x5a')]=_0x3a55c4[_0xc04b('0x5a')];}return db[_0xc04b('0x1e')][_0xc04b('0xa5')](_0x6a6469)['spread'](function(_0x92be10,_0x5038d5){if(_0x5038d5){_0x43b465++;}else{_0x3b19f9++;}})[_0xc04b('0x82')](function(){_0x174e4b++;});});})[_0xc04b('0x15')](function(_0x3ff8cc){if(_0x3ff8cc){return{'success':_0x43b465,'failure':_0x174e4b,'duplicates':_0x3b19f9};}})['then'](respondWithResult(_0x3a091c,0xc9))[_0xc04b('0x82')](handleError(_0x3a091c,null));};exports[_0xc04b('0xa6')]=function(_0x4080b1,_0x54ad26){var _0xda620f;return db[_0xc04b('0x1e')][_0xc04b('0x1f')]()['then'](function(_0x514dc6){return db[_0xc04b('0x1e')][_0xc04b('0x45')]({'where':{'id':_0x4080b1[_0xc04b('0x81')]['id']},'include':[{'model':db[_0xc04b('0x46')],'as':_0xc04b('0x7f'),'attributes':['id',_0xc04b('0x1b'),'color'],'required':_0x4080b1[_0xc04b('0x2a')][_0xc04b('0x5d')]?!![]:![]}],'attributes':_[_0xc04b('0x20')](_0x514dc6)});})['then'](function(_0x2979d5){if(!_['isNil'](_0x2979d5)){_0xda620f=_0x2979d5[_0xc04b('0x8c')]({'plain':!![]});var _0x521c1d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2979d5&&_0x2979d5[_0xc04b('0x5a')]){if(_0x2979d5['ListId']){_0x521c1d[_0xc04b('0x33')]['$and'][_0xc04b('0x23')]({'ListId':{'$ne':_0x2979d5[_0xc04b('0x5a')]}});}}return db[_0xc04b('0x24')]['findAll'](_0x521c1d);}})['then'](function(_0x5973bf){if(!_[_0xc04b('0x56')](_0x5973bf)){return _[_0xc04b('0xa7')](_0xda620f,_[_0xc04b('0x49')](_0x5973bf,function(_0x955808){return util[_0xc04b('0xa8')](_0xc04b('0xa9'),_0x955808['id']);}));}})['then'](handleEntityNotFound(_0x54ad26,null))[_0xc04b('0x15')](respondWithResult(_0x54ad26,null))['catch'](handleError(_0x54ad26,null));};exports[_0xc04b('0x14')]=function(_0x3b8593,_0x3d5a65){var _0x4d4ed9;if(_0x3b8593['body']['id']){delete _0x3b8593[_0xc04b('0x8b')]['id'];}return db[_0xc04b('0x1e')][_0xc04b('0x45')]({'where':{'id':_0x3b8593[_0xc04b('0x81')]['id']}})[_0xc04b('0x15')](handleEntityNotFound(_0x3d5a65,null))[_0xc04b('0x15')](saveUpdates(_0x3b8593[_0xc04b('0x8b')],null))['then'](function(_0x5b3c16){_0x4d4ed9=_0x5b3c16;var _0x14dd8c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5b3c16&&_0x5b3c16['ListId']){if(_0x5b3c16[_0xc04b('0x5a')]){_0x14dd8c[_0xc04b('0x33')][_0xc04b('0xaa')][_0xc04b('0x23')]({'ListId':{'$ne':_0x5b3c16[_0xc04b('0x5a')]}});}}return db[_0xc04b('0x24')]['findAll'](_0x14dd8c);})['then'](function(_0x1afd80){if(_0x1afd80){return _['omit'](_['pickBy'](_0x3b8593['body'],function(_0x5a4dac,_0x1db494){return _[_0xc04b('0x84')](_0x1db494,_0xc04b('0x22'));}),_[_0xc04b('0x49')](_0x1afd80,function(_0x5316d6){return util[_0xc04b('0xa8')](_0xc04b('0xa9'),_0x5316d6['id']);}));}})[_0xc04b('0x15')](function(_0x195bca){if(_0x195bca&&!_[_0xc04b('0x58')](_0x195bca)){var _0x100386=squel[_0xc04b('0x14')]()[_0xc04b('0xab')](_0xc04b('0x39'))[_0xc04b('0xac')](_0x195bca)['where'](_0xc04b('0xad'),_0x3b8593[_0xc04b('0x81')]['id'])[_0xc04b('0xae')]();return db[_0xc04b('0x75')]['query'](_0x100386['text'],{'replacements':_0x100386['values']});}})[_0xc04b('0x15')](function(){if(_0x3b8593[_0xc04b('0x8b')][_0xc04b('0xaf')]&&_0x4d4ed9){return db[_0xc04b('0xb0')]['update']({'phone':_0x3b8593[_0xc04b('0x8b')][_0xc04b('0xaf')]},{'where':{'ContactId':_0x4d4ed9['id']}});}})[_0xc04b('0x15')](function(){return _0x4d4ed9;})[_0xc04b('0x15')](respondWithResult(_0x3d5a65,null))[_0xc04b('0x82')](handleError(_0x3d5a65,null));};exports[_0xc04b('0xb1')]=function(_0x16d393,_0x60651c){var _0x181ca={};var _0x1d8a4b={};var _0x1d1bae;var _0x2b2bdd;return db[_0xc04b('0x1e')][_0xc04b('0xb2')]({'where':{'id':_0x16d393[_0xc04b('0x81')]['id']}})['then'](handleEntityNotFound(_0x60651c,null))[_0xc04b('0x15')](function(_0x1eab80){if(_0x1eab80){_0x1d1bae=_0x1eab80;_0x1d8a4b['model']=_[_0xc04b('0x20')](db[_0xc04b('0x46')]['rawAttributes']);_0x1d8a4b[_0xc04b('0x2a')]=_[_0xc04b('0x20')](_0x16d393[_0xc04b('0x2a')]);_0x1d8a4b[_0xc04b('0x2b')]=_[_0xc04b('0x2c')](_0x1d8a4b[_0xc04b('0x29')],_0x1d8a4b['query']);_0x181ca['attributes']=_['intersection'](_0x1d8a4b[_0xc04b('0x29')],qs[_0xc04b('0x2e')](_0x16d393[_0xc04b('0x2a')][_0xc04b('0x2e')]));_0x181ca[_0xc04b('0x2d')]=_0x181ca[_0xc04b('0x2d')]['length']?_0x181ca[_0xc04b('0x2d')]:_0x1d8a4b[_0xc04b('0x29')];_0x181ca[_0xc04b('0x31')]=qs[_0xc04b('0x32')](_0x16d393[_0xc04b('0x2a')][_0xc04b('0x32')]);_0x181ca[_0xc04b('0x33')]=qs[_0xc04b('0x2b')](_['pick'](_0x16d393[_0xc04b('0x2a')],_0x1d8a4b[_0xc04b('0x2b')]));if(_0x16d393[_0xc04b('0x2a')][_0xc04b('0x55')]){_0x181ca[_0xc04b('0x33')]=_[_0xc04b('0x77')](_0x181ca[_0xc04b('0x33')],{'$or':_[_0xc04b('0x49')](_0x181ca[_0xc04b('0x2d')],function(_0xb22105){var _0x441258={};_0x441258[_0xb22105]={'$like':'%'+_0x16d393[_0xc04b('0x2a')][_0xc04b('0x55')]+'%'};return _0x441258;})});}_0x181ca=_['merge']({},_0x181ca,_0x16d393[_0xc04b('0xb3')]);return _0x1d1bae[_0xc04b('0xb1')](_0x181ca);}})['then'](function(_0x1c5865){if(_0x1c5865){_0x2b2bdd=_0x1c5865['length'];if(!_0x16d393['query'][_0xc04b('0x2f')](_0xc04b('0x30'))){_0x181ca[_0xc04b('0xf')]=qs[_0xc04b('0xf')](_0x16d393['query'][_0xc04b('0xf')]);_0x181ca[_0xc04b('0x12')]=qs[_0xc04b('0x12')](_0x16d393['query'][_0xc04b('0x12')]);}return _0x1d1bae[_0xc04b('0xb1')](_0x181ca);}})[_0xc04b('0x15')](function(_0x36d930){if(_0x36d930){return _0x36d930?{'count':_0x2b2bdd,'rows':_0x36d930}:null;}})['then'](respondWithResult(_0x60651c,null))[_0xc04b('0x82')](handleError(_0x60651c,null));};exports['setTags']=function(_0x41a42f,_0xfdc15b){if(_0x41a42f[_0xc04b('0x8b')]['id']){delete _0x41a42f[_0xc04b('0x8b')]['id'];}return db[_0xc04b('0x1e')][_0xc04b('0xb2')]({'where':{'id':_0x41a42f[_0xc04b('0x81')]['id']}})['then'](handleEntityNotFound(_0xfdc15b,null))[_0xc04b('0x15')](function(_0x2ded0f){if(_0x2ded0f){return _0x2ded0f['setTags'](_0x41a42f[_0xc04b('0x8b')][_0xc04b('0xb4')]||[]);}return null;})[_0xc04b('0x15')](respondWithResult(_0xfdc15b,null))['catch'](handleError(_0xfdc15b,null));};exports[_0xc04b('0xb5')]=function(_0x405ced,_0x4a118c){var _0x31fe9b={'raw':![],'where':{}};var _0x4d0552={};var _0x52ff54={'count':0x0,'rows':[]};return db[_0xc04b('0x1e')][_0xc04b('0xb2')]({'where':{'id':_0x405ced[_0xc04b('0x81')]['id']}})['then'](handleEntityNotFound(_0x4a118c,null))[_0xc04b('0x15')](function(_0x1070b1){if(_0x1070b1){_0x4d0552[_0xc04b('0x29')]=_[_0xc04b('0x20')](db['CmHopper'][_0xc04b('0xb6')]);_0x4d0552[_0xc04b('0x2a')]=_[_0xc04b('0x20')](_0x405ced[_0xc04b('0x2a')]);_0x4d0552[_0xc04b('0x2b')]=_[_0xc04b('0x2c')](_0x4d0552[_0xc04b('0x29')],_0x4d0552[_0xc04b('0x2a')]);_0x31fe9b[_0xc04b('0x2d')]=_['intersection'](_0x4d0552[_0xc04b('0x29')],qs[_0xc04b('0x2e')](_0x405ced[_0xc04b('0x2a')][_0xc04b('0x2e')]));_0x31fe9b[_0xc04b('0x2d')]=_0x31fe9b[_0xc04b('0x2d')][_0xc04b('0x21')]?_0x31fe9b['attributes']:_0x4d0552[_0xc04b('0x29')];if(!_0x405ced[_0xc04b('0x2a')][_0xc04b('0x2f')]('nolimit')){_0x31fe9b['limit']=qs[_0xc04b('0xf')](_0x405ced[_0xc04b('0x2a')][_0xc04b('0xf')]);_0x31fe9b[_0xc04b('0x12')]=qs[_0xc04b('0x12')](_0x405ced[_0xc04b('0x2a')]['offset']);}_0x31fe9b['order']=qs[_0xc04b('0x32')](_0x405ced[_0xc04b('0x2a')][_0xc04b('0x32')]);_0x31fe9b[_0xc04b('0x33')]=qs[_0xc04b('0x2b')](_['pick'](_0x405ced[_0xc04b('0x2a')],_0x4d0552[_0xc04b('0x2b')]));_0x31fe9b['where'][_0xc04b('0xb7')]=_0x1070b1['id'];if(_0x405ced[_0xc04b('0x2a')][_0xc04b('0x55')]){_0x31fe9b[_0xc04b('0x33')]=_[_0xc04b('0x77')](_0x31fe9b[_0xc04b('0x33')],{'$or':_[_0xc04b('0x49')](_0x31fe9b[_0xc04b('0x2d')],function(_0x5fb8b3){var _0x36dcb1={};_0x36dcb1[_0x5fb8b3]={'$like':'%'+_0x405ced['query'][_0xc04b('0x55')]+'%'};return _0x36dcb1;})});}_0x31fe9b=_[_0xc04b('0x77')]({},_0x31fe9b,_0x405ced['options']);return db[_0xc04b('0xb0')][_0xc04b('0x11')]({'where':_0x31fe9b['where']})[_0xc04b('0x15')](function(_0x5b4fb1){_0x52ff54['count']=_0x5b4fb1;if(_0x405ced[_0xc04b('0x2a')][_0xc04b('0xb8')]){_0x31fe9b['include']=[{'all':!![]}];}return db['CmHopper'][_0xc04b('0x88')](_0x31fe9b);})[_0xc04b('0x15')](function(_0xb12b84){_0x52ff54[_0xc04b('0x80')]=_0xb12b84;return _0x52ff54;});}})[_0xc04b('0x15')](respondWithFilteredResult(_0x4a118c,_0x31fe9b))['catch'](handleError(_0x4a118c,null));};exports[_0xc04b('0xb9')]=function(_0x5f28e6,_0x578c92){var _0x143fb3={'raw':!![],'where':{}};var _0x54139d={};var _0x571a65={'count':0x0,'rows':[]};return db[_0xc04b('0x1e')][_0xc04b('0xb2')]({'where':{'id':_0x5f28e6[_0xc04b('0x81')]['id']}})[_0xc04b('0x15')](handleEntityNotFound(_0x578c92,null))['then'](function(_0x27f866){if(_0x27f866){_0x54139d[_0xc04b('0x29')]=_[_0xc04b('0x20')](db[_0xc04b('0x99')][_0xc04b('0xb6')]);_0x54139d[_0xc04b('0x2a')]=_[_0xc04b('0x20')](_0x5f28e6['query']);_0x54139d[_0xc04b('0x2b')]=_['intersection'](_0x54139d['model'],_0x54139d[_0xc04b('0x2a')]);_0x143fb3[_0xc04b('0x2d')]=_[_0xc04b('0x2c')](_0x54139d[_0xc04b('0x29')],qs['fields'](_0x5f28e6[_0xc04b('0x2a')][_0xc04b('0x2e')]));_0x143fb3[_0xc04b('0x2d')]=_0x143fb3[_0xc04b('0x2d')][_0xc04b('0x21')]?_0x143fb3[_0xc04b('0x2d')]:_0x54139d[_0xc04b('0x29')];if(!_0x5f28e6[_0xc04b('0x2a')]['hasOwnProperty'](_0xc04b('0x30'))){_0x143fb3['limit']=qs[_0xc04b('0xf')](_0x5f28e6[_0xc04b('0x2a')][_0xc04b('0xf')]);_0x143fb3[_0xc04b('0x12')]=qs['offset'](_0x5f28e6['query'][_0xc04b('0x12')]);}_0x143fb3[_0xc04b('0x31')]=qs[_0xc04b('0x32')](_0x5f28e6[_0xc04b('0x2a')][_0xc04b('0x32')]);_0x143fb3[_0xc04b('0x33')]=qs[_0xc04b('0x2b')](_[_0xc04b('0x34')](_0x5f28e6['query'],_0x54139d[_0xc04b('0x2b')]));_0x143fb3[_0xc04b('0x33')][_0xc04b('0xb7')]=_0x27f866['id'];if(_0x5f28e6[_0xc04b('0x2a')][_0xc04b('0x55')]){_0x143fb3[_0xc04b('0x33')]=_[_0xc04b('0x77')](_0x143fb3[_0xc04b('0x33')],{'$or':_[_0xc04b('0x49')](_0x143fb3[_0xc04b('0x2d')],function(_0x4227a4){var _0x465409={};_0x465409[_0x4227a4]={'$like':'%'+_0x5f28e6['query'][_0xc04b('0x55')]+'%'};return _0x465409;})});}_0x143fb3=_[_0xc04b('0x77')]({},_0x143fb3,_0x5f28e6[_0xc04b('0xb3')]);return db[_0xc04b('0x99')][_0xc04b('0x11')]({'where':_0x143fb3[_0xc04b('0x33')]})[_0xc04b('0x15')](function(_0x578045){_0x571a65[_0xc04b('0x11')]=_0x578045;if(_0x5f28e6[_0xc04b('0x2a')][_0xc04b('0xb8')]){_0x143fb3['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xc04b('0x88')](_0x143fb3);})[_0xc04b('0x15')](function(_0x1e9b76){_0x571a65[_0xc04b('0x80')]=_0x1e9b76;return _0x571a65;});}})[_0xc04b('0x15')](respondWithFilteredResult(_0x578c92,_0x143fb3))[_0xc04b('0x82')](handleError(_0x578c92,null));};exports['getHopperFinals']=function(_0x16f1b7,_0x18e450){var _0x3e3cc6={'raw':!![],'where':{}};var _0x41c521={};var _0x1f4143={'count':0x0,'rows':[]};return db[_0xc04b('0x1e')]['findOne']({'where':{'id':_0x16f1b7[_0xc04b('0x81')]['id']}})[_0xc04b('0x15')](handleEntityNotFound(_0x18e450,null))[_0xc04b('0x15')](function(_0x9c9212){if(_0x9c9212){_0x41c521[_0xc04b('0x29')]=_[_0xc04b('0x20')](db['CmHopperFinal'][_0xc04b('0xb6')]);_0x41c521['query']=_[_0xc04b('0x20')](_0x16f1b7[_0xc04b('0x2a')]);_0x41c521[_0xc04b('0x2b')]=_[_0xc04b('0x2c')](_0x41c521[_0xc04b('0x29')],_0x41c521[_0xc04b('0x2a')]);_0x3e3cc6[_0xc04b('0x2d')]=_[_0xc04b('0x2c')](_0x41c521[_0xc04b('0x29')],qs['fields'](_0x16f1b7[_0xc04b('0x2a')][_0xc04b('0x2e')]));_0x3e3cc6[_0xc04b('0x2d')]=_0x3e3cc6[_0xc04b('0x2d')]['length']?_0x3e3cc6['attributes']:_0x41c521[_0xc04b('0x29')];if(!_0x16f1b7['query'][_0xc04b('0x2f')]('nolimit')){_0x3e3cc6[_0xc04b('0xf')]=qs[_0xc04b('0xf')](_0x16f1b7[_0xc04b('0x2a')][_0xc04b('0xf')]);_0x3e3cc6[_0xc04b('0x12')]=qs[_0xc04b('0x12')](_0x16f1b7['query'][_0xc04b('0x12')]);}_0x3e3cc6[_0xc04b('0x31')]=qs[_0xc04b('0x32')](_0x16f1b7[_0xc04b('0x2a')][_0xc04b('0x32')]);_0x3e3cc6[_0xc04b('0x33')]=qs[_0xc04b('0x2b')](_[_0xc04b('0x34')](_0x16f1b7[_0xc04b('0x2a')],_0x41c521['filters']));_0x3e3cc6[_0xc04b('0x33')][_0xc04b('0xb7')]=_0x9c9212['id'];if(_0x16f1b7[_0xc04b('0x2a')][_0xc04b('0x55')]){_0x3e3cc6['where']=_[_0xc04b('0x77')](_0x3e3cc6['where'],{'$or':_['map'](_0x3e3cc6[_0xc04b('0x2d')],function(_0x45281b){var _0x3624ea={};_0x3624ea[_0x45281b]={'$like':'%'+_0x16f1b7[_0xc04b('0x2a')][_0xc04b('0x55')]+'%'};return _0x3624ea;})});}_0x3e3cc6=_[_0xc04b('0x77')]({},_0x3e3cc6,_0x16f1b7['options']);return db[_0xc04b('0x98')][_0xc04b('0x11')]({'where':_0x3e3cc6[_0xc04b('0x33')]})[_0xc04b('0x15')](function(_0x117b02){_0x1f4143[_0xc04b('0x11')]=_0x117b02;if(_0x16f1b7[_0xc04b('0x2a')][_0xc04b('0xb8')]){_0x3e3cc6['include']=[{'all':!![]}];}return db[_0xc04b('0x98')][_0xc04b('0x88')](_0x3e3cc6);})[_0xc04b('0x15')](function(_0x2ba08e){_0x1f4143['rows']=_0x2ba08e;return _0x1f4143;});}})[_0xc04b('0x15')](respondWithFilteredResult(_0x18e450,_0x3e3cc6))['catch'](handleError(_0x18e450,null));};exports[_0xc04b('0xba')]=function(_0x28d7db,_0x59be8a){var _0x4cff91={'raw':!![],'where':{}};var _0x215b17={};var _0x1f6214={'count':0x0,'rows':[]};return db[_0xc04b('0x1e')]['findOne']({'where':{'id':_0x28d7db[_0xc04b('0x81')]['id']}})[_0xc04b('0x15')](handleEntityNotFound(_0x59be8a,null))['then'](function(_0x18d818){if(_0x18d818){_0x215b17[_0xc04b('0x29')]=_[_0xc04b('0x20')](db[_0xc04b('0x9f')][_0xc04b('0xb6')]);_0x215b17[_0xc04b('0x2a')]=_[_0xc04b('0x20')](_0x28d7db[_0xc04b('0x2a')]);_0x215b17[_0xc04b('0x2b')]=_[_0xc04b('0x2c')](_0x215b17[_0xc04b('0x29')],_0x215b17['query']);_0x4cff91[_0xc04b('0x2d')]=_[_0xc04b('0x2c')](_0x215b17['model'],qs[_0xc04b('0x2e')](_0x28d7db[_0xc04b('0x2a')][_0xc04b('0x2e')]));_0x4cff91[_0xc04b('0x2d')]=_0x4cff91[_0xc04b('0x2d')][_0xc04b('0x21')]?_0x4cff91[_0xc04b('0x2d')]:_0x215b17['model'];if(!_0x28d7db[_0xc04b('0x2a')][_0xc04b('0x2f')](_0xc04b('0x30'))){_0x4cff91[_0xc04b('0xf')]=qs[_0xc04b('0xf')](_0x28d7db[_0xc04b('0x2a')][_0xc04b('0xf')]);_0x4cff91[_0xc04b('0x12')]=qs[_0xc04b('0x12')](_0x28d7db[_0xc04b('0x2a')]['offset']);}_0x4cff91[_0xc04b('0x31')]=qs[_0xc04b('0x32')](_0x28d7db[_0xc04b('0x2a')][_0xc04b('0x32')]);_0x4cff91[_0xc04b('0x33')]=qs['filters'](_[_0xc04b('0x34')](_0x28d7db['query'],_0x215b17[_0xc04b('0x2b')]));_0x4cff91[_0xc04b('0x33')][_0xc04b('0xb7')]=_0x18d818['id'];if(_0x28d7db[_0xc04b('0x2a')]['filter']){_0x4cff91[_0xc04b('0x33')]=_[_0xc04b('0x77')](_0x4cff91[_0xc04b('0x33')],{'$or':_[_0xc04b('0x49')](_0x4cff91['attributes'],function(_0x4b8295){var _0x510ab9={};_0x510ab9[_0x4b8295]={'$like':'%'+_0x28d7db[_0xc04b('0x2a')][_0xc04b('0x55')]+'%'};return _0x510ab9;})});}_0x4cff91=_[_0xc04b('0x77')]({},_0x4cff91,_0x28d7db[_0xc04b('0xb3')]);return db[_0xc04b('0x9f')][_0xc04b('0x11')]({'where':_0x4cff91['where']})[_0xc04b('0x15')](function(_0x3bc339){_0x1f6214[_0xc04b('0x11')]=_0x3bc339;if(_0x28d7db[_0xc04b('0x2a')][_0xc04b('0xb8')]){_0x4cff91['include']=[{'all':!![]}];}return db[_0xc04b('0x9f')][_0xc04b('0x88')](_0x4cff91);})[_0xc04b('0x15')](function(_0x363a66){_0x1f6214['rows']=_0x363a66;return _0x1f6214;});}})['then'](respondWithFilteredResult(_0x59be8a,_0x4cff91))['catch'](handleError(_0x59be8a,null));};exports[_0xc04b('0xbb')]=function(_0x35c8d2,_0x30e7d9){try{if(!_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0x5a')]){throw new Error(_0xc04b('0xbc'));}if(!_0x35c8d2['body'][_0xc04b('0xbd')]){throw new Error(_0xc04b('0xbe'));}if(!_0x35c8d2['body'][_0xc04b('0xbf')]){throw new Error(_0xc04b('0xc0'));}if(!_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0xc1')]){throw new Error(_0xc04b('0xc2'));}var _0x29f73a=_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0xbd')][_0xc04b('0x48')](',');var _0x557350=_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0xbf')][_0xc04b('0x48')](',');if(!_0x29f73a[_0xc04b('0x21')]||!_0x557350[_0xc04b('0x21')]||_0x29f73a['length']!==_0x557350['length']){throw new Error(_0xc04b('0xc3'));}_0x35c8d2['body'][_0xc04b('0x2e')]=_[_0xc04b('0xc4')](_0x29f73a,_0x557350);if(!_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0x2e')][_0xc04b('0xaf')]){throw new Error(_0xc04b('0xc5'));}if(!_0x35c8d2['body']['fields'][_0xc04b('0xc6')]){throw new Error(_0xc04b('0xc7'));}var _0xd4e5f7=path[_0xc04b('0xa2')](config[_0xc04b('0xc8')],'server/files/tmp',_0x35c8d2[_0xc04b('0xc9')][_0xc04b('0xca')]);fs[_0xc04b('0xcb')](_0xd4e5f7,parseInt(_0xc04b('0xcc'),0x8));var _0x3a2532=require(_0xc04b('0xcd'))['fork'](path[_0xc04b('0xa2')](__dirname,_0xc04b('0xce')),[_0xd4e5f7,_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0xbd')],_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0xbf')],_0x35c8d2[_0xc04b('0x8b')]['ListId'],_0x35c8d2['body']['CompanyId'],_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0xa3')],_0x35c8d2[_0xc04b('0x8b')][_0xc04b('0xc1')]]);return _0x30e7d9[_0xc04b('0xd')](0xc8)[_0xc04b('0xe')]({'message':'File\x20uploaded\x20correctly!','pid':_0x3a2532[_0xc04b('0xcf')]});}catch(_0x1e891a){return _0x30e7d9['status'](0x1f4)[_0xc04b('0x1c')](_0x1e891a);}};exports[_0xc04b('0xd0')]=function(_0x2e1f48,_0x2dff75){var _0x3e92b2=fs[_0xc04b('0xd1')](_0x2e1f48[_0xc04b('0xc9')][_0xc04b('0x1')]);Papa['parse'](_0x3e92b2,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x297077){return _0x2dff75[_0xc04b('0xd')](0xc8)[_0xc04b('0xe')]({'file':_0x2e1f48[_0xc04b('0xc9')],'fields':_0x297077[_0xc04b('0xd2')][_0xc04b('0x2e')]});}});};exports['import']=function(_0x59923a,_0x4f79c8){return db[_0xc04b('0x4b')][_0xc04b('0x88')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc04b('0x70')}})['then'](function(_0x28eebe){var _0x39f433=![];if(!_0x59923a[_0xc04b('0x8b')][_0xc04b('0x5a')]){throw new Error(_0xc04b('0xbc'));}if(!_0x59923a[_0xc04b('0x8b')][_0xc04b('0xd3')][_0xc04b('0xaf')]){throw new Error(_0xc04b('0xc5'));}if(!_0x59923a[_0xc04b('0x8b')][_0xc04b('0xd3')][_0xc04b('0xc6')]){throw new Error(_0xc04b('0xc7'));}if(!_0x59923a[_0xc04b('0x8b')][_0xc04b('0xc1')]){throw new Error(_0xc04b('0xc2'));}var _0x3c5ae3=require(_0xc04b('0xcd'))[_0xc04b('0xd4')](path[_0xc04b('0xa2')](__dirname,_0xc04b('0xd5')),[_0x59923a['params']['id'],JSON[_0xc04b('0xd6')](_0x59923a[_0xc04b('0x8b')]),JSON[_0xc04b('0xd6')](_0x28eebe)]);_0x3c5ae3['on']('message',function(){_0x39f433=!![];return _0x4f79c8[_0xc04b('0xd')](0xc8)[_0xc04b('0xe')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x3c5ae3[_0xc04b('0xcf')]});});_0x3c5ae3['on']('exit',function(_0x51f5a6){if(_0x51f5a6&&!_0x39f433){return _0x4f79c8[_0xc04b('0xd')](0x1f4)[_0xc04b('0xe')]({'message':_0xc04b('0xd7'),'pid':_0x3c5ae3[_0xc04b('0xcf')]});}});})[_0xc04b('0x82')](handleError(_0x4f79c8,null));};exports[_0xc04b('0xd8')]=function(_0xc7c22,_0x583409){var _0x1a82bf=[_0xc04b('0xd9'),'chat',_0xc04b('0xda'),_0xc04b('0xdb'),_0xc04b('0xdc'),_0xc04b('0xdd'),'voice'];var _0x13c645={'offset':0x0,'order':qs[_0xc04b('0x32')](_0xc04b('0xde'))},_0x38f6e3={'count':0x0,'rows':[]};Promise[_0xc04b('0x6d')]()[_0xc04b('0x15')](function(){if(_0xc7c22[_0xc04b('0x2a')][_0xc04b('0xdf')]){if(!_[_0xc04b('0xe0')](_0x1a82bf,_0xc7c22['query'][_0xc04b('0xdf')][_0xc04b('0xe1')]())){throw new Error(_0xc04b('0xe2'));}_0x1a82bf=[_0xc7c22[_0xc04b('0x2a')][_0xc04b('0xdf')][_0xc04b('0xe1')]()];}if(_0xc7c22['query']['range']){try{var _0x2679a5=JSON[_0xc04b('0xe3')](_0xc7c22[_0xc04b('0x2a')]['range']);if(!moment(_0x2679a5[_0xc04b('0x38')])[_0xc04b('0xe4')]()){throw new Error(_0xc04b('0xe5'));}if(!moment(_0x2679a5['to'])[_0xc04b('0xe4')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x392f4d){throw new Error(_0xc04b('0xe6'));}}if(!_0xc7c22[_0xc04b('0x2a')][_0xc04b('0x2f')](_0xc04b('0x30'))){_0x13c645['limit']=qs[_0xc04b('0xf')](_0xc7c22[_0xc04b('0x2a')][_0xc04b('0xf')]||0xa);_0x13c645[_0xc04b('0x12')]=qs[_0xc04b('0x12')](_0xc7c22[_0xc04b('0x2a')][_0xc04b('0x12')]);}var _0x27aed0=_0x1a82bf[_0xc04b('0x49')](function(_0x4e0acb){if(_0x4e0acb===_0xc04b('0xe7')){var _0x35735d={'attributes':['id',_0xc04b('0xe8'),'type',_0xc04b('0xe9'),_0xc04b('0xea'),_0xc04b('0xeb'),_0xc04b('0xec'),_0xc04b('0xed'),'duration',_0xc04b('0xee'),_0xc04b('0xef'),_0xc04b('0xf0'),_0xc04b('0xf1'),'userThirdDisposition',_0xc04b('0xf2')],'where':{'ContactId':_0xc7c22[_0xc04b('0x81')]['id']},'include':[{'model':db[_0xc04b('0x4b')],'as':_0xc04b('0x4b'),'attributes':['id',_0xc04b('0x1b'),_0xc04b('0xf3'),_0xc04b('0xf4')]}],'order':[[_0xc04b('0xef'),_0xc04b('0x6a')]]};if(_0xc7c22[_0xc04b('0x2a')]['range']){_0x35735d[_0xc04b('0x33')]['createdAt']={'$gte':_0x2679a5[_0xc04b('0x38')],'$lte':_0x2679a5['to']};}return db['VoiceCallReport'][_0xc04b('0xf5')](_0x35735d)[_0xc04b('0x15')](function(_0x3289ef){_0x38f6e3[_0xc04b('0x11')]+=_0x3289ef[_0xc04b('0x11')];return _[_0xc04b('0x49')](_0x3289ef['rows'],function(_0x1dcb1d){var _0x2e9ff0=_0x1dcb1d['get']({'plain':!![]});_0x2e9ff0[_0xc04b('0xdf')]=_0x4e0acb;if(_0x2e9ff0[_0xc04b('0x4b')]){_0x2e9ff0[_0xc04b('0x4b')]={'id':_0x2e9ff0[_0xc04b('0x4b')]['id'],'name':_0x2e9ff0['User']['name'],'fullname':_0x2e9ff0[_0xc04b('0x4b')][_0xc04b('0xf3')],'alias':_0x2e9ff0[_0xc04b('0x4b')]['alias']};}return _0x2e9ff0;});});}else{var _0x501dfc=_[_0xc04b('0xf6')](_0x4e0acb)+(_0x4e0acb===_0xc04b('0xf7')?_0xc04b('0xf8'):_0xc04b('0xf9'));var _0x43db19={'attributes':['id','closed','closedAt','createdAt',_0xc04b('0xee'),'disposition',_0xc04b('0xfa'),'thirdDisposition','UserId',_0x501dfc+'Id'],'where':{'ContactId':_0xc7c22[_0xc04b('0x81')]['id']},'include':[{'model':db[_0x501dfc],'as':_0xc04b('0xf9'),'attributes':['id',_0xc04b('0x1b'),_0xc04b('0xfb')]},{'model':db[_0xc04b('0x4b')],'as':_0xc04b('0xfc'),'attributes':['id','name',_0xc04b('0xf3')]},{'model':db[_0xc04b('0x46')],'as':'Tags','attributes':['id','name',_0xc04b('0x37')],'through':{'attributes':[]}}],'order':[[_0xc04b('0xef'),'DESC']]};if(_0xc7c22[_0xc04b('0x2a')]['range']){_0x43db19['where'][_0xc04b('0xef')]={'$gte':_0x2679a5[_0xc04b('0x38')],'$lte':_0x2679a5['to']};}switch(_0x4e0acb){case _0xc04b('0xf7'):_0x43db19['attributes'][_0xc04b('0x23')](_0xc04b('0xfd'),'customerIp',_0xc04b('0xfe'),'deviceModel',_0xc04b('0xff'),_0xc04b('0x100'),_0xc04b('0x101'),_0xc04b('0x102'),'referer');break;case'mail':_0x43db19[_0xc04b('0x2d')][_0xc04b('0x23')]('subject',_0xc04b('0x103'));break;case _0xc04b('0xdb'):_0x43db19[_0xc04b('0x2d')]['push']('externalUrl','threadId');break;}return db[_[_0xc04b('0xf6')](_0x4e0acb)+_0xc04b('0x104')][_0xc04b('0xf5')](_0x43db19)[_0xc04b('0x15')](function(_0x39058d){_0x38f6e3['count']+=_0x39058d['count'];return _['map'](_0x39058d['rows'],function(_0x6545dd){var _0x219b6c=_0x6545dd[_0xc04b('0x8c')]({'plain':!![]});_0x219b6c[_0xc04b('0xdf')]=_0x4e0acb;if(_0x219b6c[_0xc04b('0xfc')]){_0x219b6c[_0xc04b('0xfc')]={'id':_0x219b6c[_0xc04b('0xfc')]['id'],'name':_0x219b6c[_0xc04b('0xfc')][_0xc04b('0x1b')],'fullname':_0x219b6c['Owner'][_0xc04b('0xf3')]};}return _0x219b6c;});});}});return Promise['all'](_0x27aed0);})[_0xc04b('0x15')](function(_0x300e49){return _(_0x300e49)[_0xc04b('0x105')]()[_0xc04b('0x106')](_0xc04b('0xef'))[_0xc04b('0x107')]()['value']();})[_0xc04b('0x15')](function(_0x5d128f){_0x38f6e3[_0xc04b('0x80')]=_0x13c645['limit']?_0x5d128f[_0xc04b('0x108')](_0x13c645[_0xc04b('0x12')],_0x13c645[_0xc04b('0x12')]+_0x13c645[_0xc04b('0xf')]):_0x5d128f;return _0x38f6e3;})['then'](respondWithFilteredResult(_0x583409,_0x13c645))[_0xc04b('0x82')](handleError(_0x583409,null));};
\ No newline at end of file
+var _0x5525=['conditions','find','Tag','value','forEach','union','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','type','text','start','end','map','hasOwnProperty','filter','isNil','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','c.id','QueryTypes','SELECT','clone','having','resolve','user','role','agent','User','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','rows','destroy','params','catch','tags','startsWith','displayName','columnName','custom','values','merge','body','findAll','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','findOrCreate','show','Tags','$and','omit','format','cf_%d','pickBy','cm_contacts','setFields','id\x20=\x20?','toParam','phone','rawAttributes','pick','getTags','setTags','ids','getHoppers','ContactId','options','include','getHopperHistories','includeAll','getHopperFinals','getJscriptySessions','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','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','userThirdDisposition','UserId','fullname','alias','DESC','createdAt','findAndCountAll','startCase','Website','Account','closed','disposition','secondDisposition','thirdDisposition','browserName','customerIp','deviceModel','osName','ratingValue','subject','substatus','threadId','Interaction','Owner','all','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','json','offset','undefined','count','set','Content-Range','update','then','status','error','stack','name','send','index','CmContact','describe','keys','length','cf_','push','CmCustomField','findOne','trimStart','fieldType','model','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','select','field','color','from','uc.CmContactId\x20=\x20c.id','left_join','tools_tags','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x5525,0xda));var _0x5552=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5525[_0x40a045];return _0x1a687c;};'use strict';var moment=require(_0x5552('0x0'));var BPromise=require(_0x5552('0x1'));var util=require(_0x5552('0x2'));var path=require(_0x5552('0x3'));var fs=require('fs');var _=require(_0x5552('0x4'));var squel=require(_0x5552('0x5'));var Papa=require(_0x5552('0x6'));var Redis=require(_0x5552('0x7'));var qs=require(_0x5552('0x8'));var as=require(_0x5552('0x9'));var logger=require(_0x5552('0xa'))(_0x5552('0xb'));var config=require(_0x5552('0xc'));var db=require(_0x5552('0xd'))['db'];config[_0x5552('0xe')]=_['defaults'](config[_0x5552('0xe')],{'host':_0x5552('0xf'),'port':0x18eb});var socket=require(_0x5552('0x10'))(new Redis(config[_0x5552('0xe')]));require(_0x5552('0x11'))['register'](socket);function respondWithResult(_0x4705a4,_0x299709){_0x299709=_0x299709||0xc8;return function(_0x428fd6){if(_0x428fd6){return _0x4705a4['status'](_0x299709)[_0x5552('0x12')](_0x428fd6);}};}function respondWithFilteredResult(_0x1fba5d,_0x354685){return function(_0x3e7b10){if(_0x3e7b10){var _0x507d0d=typeof _0x354685[_0x5552('0x13')]===_0x5552('0x14')&&typeof _0x354685['limit']==='undefined';var _0x3a784a=_0x3e7b10[_0x5552('0x15')];var _0x3e94f2=_0x507d0d?0x0:_0x354685[_0x5552('0x13')];var _0x527a65=_0x507d0d?_0x3e7b10[_0x5552('0x15')]:_0x354685['offset']+_0x354685['limit'];var _0x382dbb;if(_0x527a65>=_0x3a784a){_0x527a65=_0x3a784a;_0x382dbb=0xc8;}else{_0x382dbb=0xce;}_0x1fba5d['status'](_0x382dbb);return _0x1fba5d[_0x5552('0x16')](_0x5552('0x17'),_0x3e94f2+'-'+_0x527a65+'/'+_0x3a784a)['json'](_0x3e7b10);}return null;};}function saveUpdates(_0x1c31f8){return function(_0x125aeb){if(_0x125aeb){return _0x125aeb[_0x5552('0x18')](_0x1c31f8)[_0x5552('0x19')](function(_0x6fc53d){return _0x6fc53d;});}return null;};}function removeEntity(_0x3794fc){return function(_0x30d463){if(_0x30d463){return _0x30d463['destroy']()[_0x5552('0x19')](function(){_0x3794fc[_0x5552('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e1ef){return function(_0x4ea8ab){if(!_0x4ea8ab){_0x48e1ef['sendStatus'](0x194);}return _0x4ea8ab;};}function handleError(_0x32b52b,_0x58ae2a){_0x58ae2a=_0x58ae2a||0x1f4;return function(_0x33d719){logger[_0x5552('0x1b')](_0x33d719[_0x5552('0x1c')]);if(_0x33d719[_0x5552('0x1d')]){delete _0x33d719['name'];}_0x32b52b[_0x5552('0x1a')](_0x58ae2a)[_0x5552('0x1e')](_0x33d719);};}exports[_0x5552('0x1f')]=function(_0x236b92,_0x125ffc){var _0x631cd2={},_0x45a43f={},_0x103158={'count':0x0,'rows':[]};return db[_0x5552('0x20')][_0x5552('0x21')]()[_0x5552('0x19')](function(_0xa28a52){var _0x2d8a91=[];for(var _0x515034=0x0;_0x515034<Object[_0x5552('0x22')](_0xa28a52)[_0x5552('0x23')];_0x515034++){var _0x2e152c=Object['keys'](_0xa28a52)[_0x515034];if(_['startsWith'](_0x2e152c,_0x5552('0x24'))){_0x2d8a91[_0x5552('0x25')](db[_0x5552('0x26')][_0x5552('0x27')]({'where':{'id':_[_0x5552('0x28')](_0x2e152c,'cf_')},'raw':!![]}));}}return BPromise['all'](_0x2d8a91)[_0x5552('0x19')](function(_0x1a5afb){for(var _0x561aef=0x0;_0x561aef<_0x1a5afb['length'];_0x561aef++){if(_0x1a5afb[_0x561aef]){var _0x5b69de='cf_'+_0x1a5afb[_0x561aef]['id'];var _0x5b3032=_0xa28a52[_0x5b69de];_0x5b3032[_0x5552('0x29')]=_0x1a5afb[_0x561aef]['type'];}}return _0xa28a52;});})['then'](function(_0x1c7ccf){_0x45a43f[_0x5552('0x2a')]=_[_0x5552('0x22')](_0x1c7ccf);_0x45a43f['query']=_[_0x5552('0x22')](_0x236b92[_0x5552('0x2b')]);_0x45a43f[_0x5552('0x2c')]=_[_0x5552('0x2d')](_0x45a43f[_0x5552('0x2a')],_0x45a43f[_0x5552('0x2b')]);_0x631cd2['attributes']=_[_0x5552('0x2d')](_0x45a43f['model'],qs[_0x5552('0x2e')](_0x236b92[_0x5552('0x2b')][_0x5552('0x2e')]));_0x631cd2['attributes']=_0x631cd2[_0x5552('0x2f')]['length']?_0x631cd2[_0x5552('0x2f')]:_0x45a43f[_0x5552('0x2a')];if(!_0x236b92[_0x5552('0x2b')]['hasOwnProperty'](_0x5552('0x30'))){_0x631cd2[_0x5552('0x31')]=qs[_0x5552('0x31')](_0x236b92[_0x5552('0x2b')][_0x5552('0x31')]);_0x631cd2['offset']=qs[_0x5552('0x13')](_0x236b92[_0x5552('0x2b')][_0x5552('0x13')]);}_0x631cd2[_0x5552('0x32')]=qs['sort'](_0x236b92[_0x5552('0x2b')][_0x5552('0x33')]);_0x631cd2[_0x5552('0x34')]=qs['filters'](_['pick'](_0x236b92[_0x5552('0x2b')],_0x45a43f['filters']),_0x1c7ccf);var _0x237b80=[];var _0x12be16=squel[_0x5552('0x35')]()[_0x5552('0x36')]('id')[_0x5552('0x36')](_0x5552('0x1d'))['field'](_0x5552('0x37'))[_0x5552('0x38')]('tools_tags');var _0x45c30e=squel[_0x5552('0x35')]()[_0x5552('0x38')]('cm_contacts','c')['left_join']('cm_user_has_contacts','uc',_0x5552('0x39'))[_0x5552('0x3a')]('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20c.id')['left_join'](_0x5552('0x3b'),'t','t.id\x20=\x20ct.TagId')[_0x5552('0x34')](_0x5552('0x3c'));var _0xadd424=squel[_0x5552('0x3d')]();var _0x476a44=[];var _0x169e1d=squel[_0x5552('0x3d')]();var _0x121a70;if(_0x236b92[_0x5552('0x2b')][_0x5552('0x3e')]){_0x121a70=as[_0x5552('0x3f')](_0x236b92[_0x5552('0x2b')]['search']);var _0x22dd9c=_0x121a70[_0x5552('0x40')];for(var _0x2e1e7e=0x0;_0x2e1e7e<_0x121a70[_0x5552('0x41')][_0x5552('0x23')];_0x2e1e7e++){var _0x1adc18=_0x121a70[_0x5552('0x41')][_0x2e1e7e];var _0x31b0d7='c';var _0x1bf6c0=_(_0x1c7ccf)[_0x5552('0x22')]()[_0x5552('0x42')](function(_0x3ca88b){return _0x3ca88b===_0x1adc18[_0x5552('0x36')];});if(_0x1bf6c0)_0x1bf6c0=_0x1c7ccf[_0x1adc18[_0x5552('0x36')]];if(!_0x1bf6c0){if(_0x1adc18[_0x5552('0x36')]===_0x5552('0x43')){var _0x32cda1=_0x1adc18[_0x5552('0x44')]['split'](',')['map'](function(_0x43b2b3){return Number(_0x43b2b3);});_0x32cda1[_0x5552('0x45')](function(_0xb019e4){_0x169e1d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xb019e4+',%');});_0x476a44=_[_0x5552('0x46')](_0x476a44,_0x32cda1);}else if(_0x1adc18['field']==='User'){_0xadd424[_0x5552('0x47')](_0x5552('0x48'),_0x1adc18[_0x5552('0x44')]);}}else{if(_0x1adc18['field']===_0x5552('0x49')||_0x1bf6c0['fieldType']===_0x5552('0x4a'))_0x1adc18[_0x5552('0x4b')]=_0x5552('0x4c');var _0x58eaea=as['buildExpression'](_0x31b0d7,_0x1bf6c0[_0x5552('0x4d')],_0x1adc18);_0xadd424[_0x22dd9c](_0x58eaea[_0x5552('0x4e')],_0x58eaea[_0x5552('0x44')][_0x5552('0x4f')],_0x58eaea[_0x5552('0x44')][_0x5552('0x50')]);}}}else{var _0x230e39=_(Object[_0x5552('0x22')](_0x236b92[_0x5552('0x2b')]))[_0x5552('0x51')](function(_0x2e06d3){return _0x1c7ccf[_0x5552('0x52')](_0x2e06d3)?_0x2e06d3:undefined;})[_0x5552('0x53')](function(_0x5232be){return!_[_0x5552('0x54')](_0x5232be);})[_0x5552('0x44')]();if(_0x236b92[_0x5552('0x2b')][_0x5552('0x55')])_0x230e39['push'](_0x5552('0x55'));if(!_[_0x5552('0x56')](_0x230e39)){_0x230e39[_0x5552('0x45')](function(_0x134275){if(_0x134275===_0x5552('0x57')){_0x45c30e['where']('c.ListId\x20IN\x20?',[][_0x5552('0x58')](_0x236b92[_0x5552('0x2b')][_0x134275]));}else if(_0x134275===_0x5552('0x55')){var _0x37cad0='%'+_0x236b92[_0x5552('0x2b')][_0x134275]+'%';_0x45c30e[_0x5552('0x34')](_0x5552('0x59'),_0x37cad0);}else{_0x45c30e['where']('c.'+_0x134275+_0x5552('0x5a'),_0x236b92[_0x5552('0x2b')][_0x134275]);}});}if(_0x236b92[_0x5552('0x2b')][_0x5552('0x5b')]){_0x476a44=_[_0x5552('0x5c')](_0x236b92[_0x5552('0x2b')][_0x5552('0x5b')])?_0x236b92[_0x5552('0x2b')][_0x5552('0x5b')]:new Array(_0x236b92['query'][_0x5552('0x5b')]);_0x476a44[_0x5552('0x45')](function(_0x3412fa){_0x169e1d['or'](_0x5552('0x5d'),'%,'+_0x3412fa+',%');});}if(_0x236b92['query']['filter']){var _0x3932ca=_0x236b92[_0x5552('0x2b')][_0x5552('0x53')][_0x5552('0x5e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x3932ca[_0x5552('0x5f')]('\x20')[_0x5552('0x23')]>0x1){_0xadd424['or'](_0x5552('0x60'),qs[_0x5552('0x61')](_0x3932ca),null);}else{if(qs[_0x5552('0x62')](_0x3932ca)){_0xadd424['or'](_0x5552('0x63'),_0x3932ca+'%');_0xadd424['or']('c.phone\x20LIKE\x20?',_0x3932ca+'%');_0xadd424['or'](_0x5552('0x64'),_0x3932ca+'%');_0xadd424['or'](_0x5552('0x65'),_0x3932ca+'%');}else if(qs['isEmail'](_0x3932ca)){_0xadd424['or']('c.email\x20LIKE\x20?',_0x3932ca+'%');}else{_0xadd424['or']('c.firstName\x20LIKE\x20?','%'+_0x3932ca+'%');_0xadd424['or'](_0x5552('0x66'),'%'+_0x3932ca+'%');_0xadd424['or'](_0x5552('0x67'),'%'+_0x3932ca+'%');}}}}_0x45c30e[_0x5552('0x34')](_0xadd424);_0x45c30e['group'](_0x5552('0x68'));var _0x45e413={'type':db['Sequelize'][_0x5552('0x69')][_0x5552('0x6a')],'raw':!![]};var _0x360c78=_0x45c30e[_0x5552('0x6b')]()['field'](_0x5552('0x68'));if(_0x631cd2['order']){_0x631cd2[_0x5552('0x32')][_0x5552('0x45')](function(_0x4f2d3c){_0x45c30e[_0x5552('0x32')]('c.'+_0x4f2d3c[0x0],_0x4f2d3c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5552('0x56')](_0x476a44)){_0x45c30e[_0x5552('0x6c')](_0x169e1d);_0x360c78['where']('t.id\x20IN\x20?',_0x476a44);}BPromise[_0x5552('0x6d')]()[_0x5552('0x19')](function(){if(!_0x121a70)return;if(_0x236b92[_0x5552('0x6e')][_0x5552('0x6f')]!==_0x5552('0x70'))return;if(!_['some'](_0x121a70[_0x5552('0x41')],[_0x5552('0x36'),_0x5552('0x71')])){return _0x236b92['user'][_0x5552('0x72')]({'attributes':['id'],'raw':!![]})[_0x5552('0x19')](function(_0x244975){if(_[_0x5552('0x56')](_0x244975)){_0x360c78[_0x5552('0x34')](_0x5552('0x73'));_0x45c30e[_0x5552('0x34')](_0x5552('0x73'));}else{_0x360c78[_0x5552('0x34')](_0x5552('0x74'),_['map'](_0x244975,'id'));_0x45c30e['where'](_0x5552('0x74'),_['map'](_0x244975,'id'));}});}})[_0x5552('0x19')](function(){if(_0x236b92[_0x5552('0x6e')]['role']==='agent'&&!_0x121a70&&!_0x236b92[_0x5552('0x2b')][_0x5552('0x57')])return[];return db[_0x5552('0x75')]['query'](_0x360c78[_0x5552('0x76')](),_0x45e413);})[_0x5552('0x19')](function(_0x4a1584){_0x103158['count']=_0x4a1584[_0x5552('0x23')];if(_0x103158['count']===0x0)return[];return db['sequelize'][_0x5552('0x2b')](_0x12be16[_0x5552('0x76')](),_0x45e413)['then'](function(_0x58ee9f){_0x237b80=_[_0x5552('0x77')](_0x58ee9f,'id');_0x45e413=_['merge'](_0x45e413,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x236b92[_0x5552('0x2b')][_0x5552('0x2e')]){_0x631cd2['attributes'][_0x5552('0x45')](function(_0x5739fa){_0x45c30e[_0x5552('0x36')]('c.'+_0x5739fa);});}else{_0x45c30e[_0x5552('0x36')]('c.id');_0x45c30e[_0x5552('0x36')](_0x5552('0x78'));_0x45c30e[_0x5552('0x36')](_0x5552('0x79'));_0x45c30e['field'](_0x5552('0x7a'));_0x45c30e[_0x5552('0x36')]('c.mobile');_0x45c30e[_0x5552('0x36')](_0x5552('0x7b'));_0x45c30e[_0x5552('0x36')](_0x5552('0x7c'));_0x45c30e[_0x5552('0x36')](_0x5552('0x7d'));_0x45c30e['field'](_0x5552('0x7e'));_0x45c30e['field']('c.deletedAt');_0x45c30e['field']('c.CompanyId');_0x45c30e[_0x5552('0x36')](_0x5552('0x7f'),_0x5552('0x80'));}if(_0x631cd2['limit'])_0x45c30e['limit'](_0x631cd2['limit']);if(_0x631cd2['offset'])_0x45c30e['offset'](_0x631cd2[_0x5552('0x13')]);return db[_0x5552('0x75')][_0x5552('0x2b')](_0x45c30e[_0x5552('0x76')](),_0x45e413);});})['then'](function(_0x31a022){_0x31a022[_0x5552('0x45')](function(_0x27bc16){if(_0x27bc16[_0x5552('0x80')]){_0x27bc16['Tags']=[];_0x27bc16[_0x5552('0x80')][_0x5552('0x5f')](',')['forEach'](function(_0x41445a){_0x27bc16['Tags']['push'](_0x237b80[_0x41445a]);});}delete _0x27bc16[_0x5552('0x80')];});_0x103158[_0x5552('0x81')]=_0x31a022;return _0x103158;})[_0x5552('0x19')](respondWithFilteredResult(_0x125ffc,_0x631cd2));})['catch'](handleError(_0x125ffc,null));};exports[_0x5552('0x82')]=function(_0x39e9f3,_0x5e0eec){return db[_0x5552('0x20')]['find']({'where':{'id':_0x39e9f3[_0x5552('0x83')]['id']}})[_0x5552('0x19')](handleEntityNotFound(_0x5e0eec,null))[_0x5552('0x19')](removeEntity(_0x5e0eec,null))[_0x5552('0x84')](handleError(_0x5e0eec,null));};exports[_0x5552('0x21')]=function(_0x2d47b4,_0x312bb7){return db['CmContact'][_0x5552('0x21')]()[_0x5552('0x19')](function(_0x39c542){delete _0x39c542[_0x5552('0x85')];for(var _0x522dce=0x0;_0x522dce<Object['keys'](_0x39c542)[_0x5552('0x23')];_0x522dce++){var _0x526605=Object[_0x5552('0x22')](_0x39c542)[_0x522dce];if(!_[_0x5552('0x86')](_0x526605,_0x5552('0x24'))){_0x39c542[_0x526605]['columnName']=_0x526605;_0x39c542[_0x526605][_0x5552('0x87')]=_0x526605;}}return _0x39c542;})[_0x5552('0x19')](function(_0x4d4149){var _0x124f40={'where':Boolean(_0x2d47b4[_0x5552('0x2b')]['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x2d47b4[_0x5552('0x2b')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x5552('0x26')]['findAll'](_0x124f40)[_0x5552('0x19')](function(_0x107724){for(var _0x41233b=0x0;_0x41233b<_0x107724[_0x5552('0x23')];_0x41233b++){var _0x58fd43=_0x5552('0x24')+_0x107724[_0x41233b]['id'];_0x4d4149[_0x58fd43][_0x5552('0x88')]=_0x58fd43;_0x4d4149[_0x58fd43]['displayName']=_0x107724[_0x41233b]['alias'];_0x4d4149[_0x58fd43][_0x5552('0x89')]={'type':_0x107724[_0x41233b]['type'],'values':_0x107724[_0x41233b][_0x5552('0x8a')]};}Object[_0x5552('0x22')](_0x4d4149)[_0x5552('0x45')](function(_0x24139d){if(!_0x4d4149[_0x24139d]['hasOwnProperty'](_0x5552('0x88'))){delete _0x4d4149[_0x24139d];}});return _0x4d4149;});})[_0x5552('0x19')](respondWithResult(_0x312bb7,null))['catch'](handleError(_0x312bb7,null));};exports[_0x5552('0x8b')]=function(_0x3b1356,_0x40e476){var _0x5a6c63;var _0x712f40;var _0x13f6d0;if(_0x3b1356[_0x5552('0x8c')]['id']){delete _0x3b1356[_0x5552('0x8c')]['id'];}return db['CmContact'][_0x5552('0x8d')]({'where':{'id':[_0x3b1356['body']['to'],_0x3b1356[_0x5552('0x8c')][_0x5552('0x38')]]}})[_0x5552('0x19')](function(_0x9b1f27){if(_0x9b1f27){if(_0x9b1f27[_0x5552('0x23')]!==0x2){return null;}_0x9b1f27[0x0]=_0x9b1f27[0x0][_0x5552('0x8e')]({'plain':!![]});_0x9b1f27[0x1]=_0x9b1f27[0x1][_0x5552('0x8e')]({'plain':!![]});delete _0x9b1f27[0x0]['id'];delete _0x9b1f27[0x1]['id'];return _[_0x5552('0x8f')](_0x9b1f27[0x0],_0x9b1f27[0x1],function(_0x65dc10,_0x1a98a2){if(Array[_0x5552('0x5c')](_0x1a98a2)&&!_0x1a98a2[_0x5552('0x23')]){return _0x65dc10;}else if(!_0x1a98a2){return _0x65dc10;}});}})[_0x5552('0x19')](handleEntityNotFound(_0x40e476,null))[_0x5552('0x19')](function(_0x4d5be0){if(_0x4d5be0){if(_0x4d5be0[_0x5552('0x85')]&&_[_0x5552('0x5c')](_0x4d5be0[_0x5552('0x85')])){_0x4d5be0['tags']=_0x4d5be0[_0x5552('0x85')][_0x5552('0x90')]();}logger[_0x5552('0x91')](_0x5552('0x92'),_0x3b1356['body']['to'],_0x3b1356[_0x5552('0x8c')][_0x5552('0x38')]);return db[_0x5552('0x93')]['destroy']({'where':{'ContactId':[_0x3b1356[_0x5552('0x8c')]['to'],_0x3b1356[_0x5552('0x8c')][_0x5552('0x38')]]}})['then'](function(_0x4f76d5){logger[_0x5552('0x91')](_0x5552('0x94'),_0x4f76d5);return db[_0x5552('0x95')][_0x5552('0x82')]({'where':{'ContactId':[_0x3b1356[_0x5552('0x8c')]['to'],_0x3b1356[_0x5552('0x8c')][_0x5552('0x38')]]}})[_0x5552('0x19')](function(_0x52a6fb){logger['info']('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x52a6fb);return db['CmContact']['create'](_0x4d5be0);});});}})['then'](function(_0x5bc6c8){if(_0x5bc6c8){_0x5a6c63=_0x5bc6c8;_0x712f40={'ContactId':_0x5a6c63['id']};_0x13f6d0={'where':{'ContactId':[_0x3b1356[_0x5552('0x8c')]['to'],_0x3b1356[_0x5552('0x8c')][_0x5552('0x38')]]}};return db[_0x5552('0x96')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})['then'](function(){if(_0x5a6c63){return db['ChatMessage'][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})['then'](function(){if(_0x5a6c63){return db[_0x5552('0x97')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x98')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x99')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})['then'](function(){if(_0x5a6c63){return db[_0x5552('0x98')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x99')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x9a')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x9b')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x9c')]['update'](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x9d')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x9e')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db['OpenchannelMessage'][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})['then'](function(){if(_0x5a6c63){return db[_0x5552('0x9f')]['update'](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0xa0')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0xa1')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0xa2')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db['ChatQueueReport'][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})['then'](function(){if(_0x5a6c63){return db['FaxQueueReport'][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0xa3')]['update'](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db['OpenchannelQueueReport']['update'](_0x712f40,_0x13f6d0);}})['then'](function(){if(_0x5a6c63){return db['SmsQueueReport'][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0xa4')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})['then'](function(){if(_0x5a6c63){return db['WhatsappInteraction']['update'](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0xa5')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})['then'](function(){if(_0x5a6c63){return db[_0x5552('0xa6')][_0x5552('0x18')](_0x712f40,_0x13f6d0);}})[_0x5552('0x19')](function(){if(_0x5a6c63){return db[_0x5552('0x20')][_0x5552('0x82')]({'where':{'id':[_0x3b1356['body']['to'],_0x3b1356[_0x5552('0x8c')]['from']]}});}})['then'](function(){if(_0x5a6c63){return _0x5a6c63;}})['then'](respondWithResult(_0x40e476,null))[_0x5552('0x84')](handleError(_0x40e476,null));};exports[_0x5552('0xa7')]=function(_0x590188,_0x60a155){return db[_0x5552('0x20')][_0x5552('0x21')]()[_0x5552('0x19')](function(_0x26aaa1){if(_0x590188[_0x5552('0x8c')][_0x5552('0x85')]&&_[_0x5552('0x5c')](_0x590188['body'][_0x5552('0x85')])){if(_0x590188[_0x5552('0x8c')]['tags'][_0x5552('0x23')]){_0x590188['body']['tags']=_0x590188[_0x5552('0x8c')][_0x5552('0x85')][_0x5552('0x90')](';')+';';}else{_0x590188[_0x5552('0x8c')]['tags']=null;}}else{_0x590188[_0x5552('0x8c')]['tags']=null;}return db[_0x5552('0x20')][_0x5552('0xa7')](_0x590188[_0x5552('0x8c')],{'fields':_[_0x5552('0x22')](_0x26aaa1),'raw':!![]});})['then'](respondWithResult(_0x60a155,0xc9))[_0x5552('0x84')](handleError(_0x60a155,null));};exports[_0x5552('0xa8')]=function(_0x2087cf,_0x50d678){var _0x3890de=0x0;var _0x56202e=0x0;var _0x4af83f=0x0;return db[_0x5552('0x20')]['describe']()[_0x5552('0x19')](function(_0x365bad){return BPromise[_0x5552('0xa9')](_0x2087cf['body'],function(_0x30a531){var _0x1dafbf={'where':{'$or':[]},'defaults':_0x30a531,'fields':_['keys'](_0x365bad),'raw':!![]};if(_0x30a531[_0x5552('0xaa')]){for(var _0x52fb3a=0x0;_0x52fb3a<_0x30a531[_0x5552('0xaa')][_0x5552('0x23')];_0x52fb3a++){var _0x400aa5={};_0x400aa5[_0x30a531[_0x5552('0xaa')][_0x52fb3a]]=_0x30a531[_0x30a531['duplicates'][_0x52fb3a]];_0x1dafbf[_0x5552('0x34')][_0x5552('0xab')][_0x5552('0x25')](_0x400aa5);}_0x1dafbf[_0x5552('0x34')][_0x5552('0x57')]=_0x30a531['ListId'];}return db[_0x5552('0x20')][_0x5552('0xac')](_0x1dafbf)['spread'](function(_0x130f6f,_0x3b1dbe){if(_0x3b1dbe){_0x3890de++;}else{_0x4af83f++;}})[_0x5552('0x84')](function(){_0x56202e++;});});})[_0x5552('0x19')](function(_0x425c71){if(_0x425c71){return{'success':_0x3890de,'failure':_0x56202e,'duplicates':_0x4af83f};}})[_0x5552('0x19')](respondWithResult(_0x50d678,0xc9))[_0x5552('0x84')](handleError(_0x50d678,null));};exports[_0x5552('0xad')]=function(_0x43ca1b,_0x186e72){var _0x2876ea;return db['CmContact'][_0x5552('0x21')]()[_0x5552('0x19')](function(_0x21be70){return db['CmContact']['find']({'where':{'id':_0x43ca1b[_0x5552('0x83')]['id']},'include':[{'model':db['Tag'],'as':_0x5552('0xae'),'attributes':['id','name',_0x5552('0x37')],'required':_0x43ca1b[_0x5552('0x2b')][_0x5552('0x5b')]?!![]:![]}],'attributes':_['keys'](_0x21be70)});})[_0x5552('0x19')](function(_0x374333){if(!_[_0x5552('0x54')](_0x374333)){_0x2876ea=_0x374333[_0x5552('0x8e')]({'plain':!![]});var _0x2b0f3a={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x374333&&_0x374333['ListId']){if(_0x374333[_0x5552('0x57')]){_0x2b0f3a[_0x5552('0x34')][_0x5552('0xaf')][_0x5552('0x25')]({'ListId':{'$ne':_0x374333['ListId']}});}}return db[_0x5552('0x26')]['findAll'](_0x2b0f3a);}})[_0x5552('0x19')](function(_0x5e7a07){if(!_[_0x5552('0x54')](_0x5e7a07)){return _[_0x5552('0xb0')](_0x2876ea,_['map'](_0x5e7a07,function(_0x2ab97c){return util[_0x5552('0xb1')](_0x5552('0xb2'),_0x2ab97c['id']);}));}})['then'](handleEntityNotFound(_0x186e72,null))[_0x5552('0x19')](respondWithResult(_0x186e72,null))[_0x5552('0x84')](handleError(_0x186e72,null));};exports['update']=function(_0x39638f,_0x2335f6){var _0x434d00;if(_0x39638f[_0x5552('0x8c')]['id']){delete _0x39638f[_0x5552('0x8c')]['id'];}return db[_0x5552('0x20')][_0x5552('0x42')]({'where':{'id':_0x39638f['params']['id']}})[_0x5552('0x19')](handleEntityNotFound(_0x2335f6,null))[_0x5552('0x19')](saveUpdates(_0x39638f['body'],null))[_0x5552('0x19')](function(_0xd43f63){_0x434d00=_0xd43f63;var _0x255445={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xd43f63&&_0xd43f63['ListId']){if(_0xd43f63[_0x5552('0x57')]){_0x255445['where'][_0x5552('0xaf')][_0x5552('0x25')]({'ListId':{'$ne':_0xd43f63['ListId']}});}}return db[_0x5552('0x26')][_0x5552('0x8d')](_0x255445);})['then'](function(_0x3841a8){if(_0x3841a8){return _[_0x5552('0xb0')](_[_0x5552('0xb3')](_0x39638f[_0x5552('0x8c')],function(_0xeb83a4,_0x7c3cdd){return _[_0x5552('0x86')](_0x7c3cdd,_0x5552('0x24'));}),_[_0x5552('0x51')](_0x3841a8,function(_0x5be148){return util[_0x5552('0xb1')](_0x5552('0xb2'),_0x5be148['id']);}));}})[_0x5552('0x19')](function(_0x16817a){if(_0x16817a&&!_[_0x5552('0x56')](_0x16817a)){var _0x59e99a=squel[_0x5552('0x18')]()['table'](_0x5552('0xb4'))[_0x5552('0xb5')](_0x16817a)[_0x5552('0x34')](_0x5552('0xb6'),_0x39638f[_0x5552('0x83')]['id'])[_0x5552('0xb7')]();return db[_0x5552('0x75')][_0x5552('0x2b')](_0x59e99a[_0x5552('0x4e')],{'replacements':_0x59e99a[_0x5552('0x8a')]});}})['then'](function(){if(_0x39638f[_0x5552('0x8c')]['phone']&&_0x434d00){return db[_0x5552('0x93')][_0x5552('0x18')]({'phone':_0x39638f[_0x5552('0x8c')][_0x5552('0xb8')]},{'where':{'ContactId':_0x434d00['id']}});}})[_0x5552('0x19')](function(){return _0x434d00;})['then'](respondWithResult(_0x2335f6,null))[_0x5552('0x84')](handleError(_0x2335f6,null));};exports['getTags']=function(_0x193d9f,_0xd50dd6){var _0x405455={};var _0x366465={};var _0x8ad2cd;var _0x355b41;return db[_0x5552('0x20')][_0x5552('0x27')]({'where':{'id':_0x193d9f[_0x5552('0x83')]['id']}})[_0x5552('0x19')](handleEntityNotFound(_0xd50dd6,null))[_0x5552('0x19')](function(_0x439c69){if(_0x439c69){_0x8ad2cd=_0x439c69;_0x366465[_0x5552('0x2a')]=_[_0x5552('0x22')](db[_0x5552('0x43')][_0x5552('0xb9')]);_0x366465[_0x5552('0x2b')]=_['keys'](_0x193d9f[_0x5552('0x2b')]);_0x366465[_0x5552('0x2c')]=_[_0x5552('0x2d')](_0x366465[_0x5552('0x2a')],_0x366465[_0x5552('0x2b')]);_0x405455['attributes']=_[_0x5552('0x2d')](_0x366465[_0x5552('0x2a')],qs[_0x5552('0x2e')](_0x193d9f['query'][_0x5552('0x2e')]));_0x405455['attributes']=_0x405455['attributes'][_0x5552('0x23')]?_0x405455[_0x5552('0x2f')]:_0x366465[_0x5552('0x2a')];_0x405455[_0x5552('0x32')]=qs[_0x5552('0x33')](_0x193d9f[_0x5552('0x2b')][_0x5552('0x33')]);_0x405455['where']=qs[_0x5552('0x2c')](_[_0x5552('0xba')](_0x193d9f[_0x5552('0x2b')],_0x366465[_0x5552('0x2c')]));if(_0x193d9f[_0x5552('0x2b')][_0x5552('0x53')]){_0x405455['where']=_[_0x5552('0x8b')](_0x405455[_0x5552('0x34')],{'$or':_[_0x5552('0x51')](_0x405455[_0x5552('0x2f')],function(_0x352b54){var _0x7b8183={};_0x7b8183[_0x352b54]={'$like':'%'+_0x193d9f[_0x5552('0x2b')]['filter']+'%'};return _0x7b8183;})});}_0x405455=_['merge']({},_0x405455,_0x193d9f['options']);return _0x8ad2cd[_0x5552('0xbb')](_0x405455);}})[_0x5552('0x19')](function(_0x37c466){if(_0x37c466){_0x355b41=_0x37c466[_0x5552('0x23')];if(!_0x193d9f[_0x5552('0x2b')]['hasOwnProperty']('nolimit')){_0x405455[_0x5552('0x31')]=qs[_0x5552('0x31')](_0x193d9f[_0x5552('0x2b')][_0x5552('0x31')]);_0x405455['offset']=qs[_0x5552('0x13')](_0x193d9f[_0x5552('0x2b')][_0x5552('0x13')]);}return _0x8ad2cd[_0x5552('0xbb')](_0x405455);}})[_0x5552('0x19')](function(_0x131b96){if(_0x131b96){return _0x131b96?{'count':_0x355b41,'rows':_0x131b96}:null;}})[_0x5552('0x19')](respondWithResult(_0xd50dd6,null))['catch'](handleError(_0xd50dd6,null));};exports[_0x5552('0xbc')]=function(_0x19d9ff,_0x10ff8a){if(_0x19d9ff['body']['id']){delete _0x19d9ff[_0x5552('0x8c')]['id'];}return db['CmContact'][_0x5552('0x27')]({'where':{'id':_0x19d9ff[_0x5552('0x83')]['id']}})[_0x5552('0x19')](handleEntityNotFound(_0x10ff8a,null))['then'](function(_0x20bee8){if(_0x20bee8){return _0x20bee8[_0x5552('0xbc')](_0x19d9ff[_0x5552('0x8c')][_0x5552('0xbd')]||[]);}return null;})[_0x5552('0x19')](respondWithResult(_0x10ff8a,null))[_0x5552('0x84')](handleError(_0x10ff8a,null));};exports[_0x5552('0xbe')]=function(_0x4c7edc,_0x296237){var _0x2bf2c5={'raw':![],'where':{}};var _0x399261={};var _0x8c6905={'count':0x0,'rows':[]};return db[_0x5552('0x20')][_0x5552('0x27')]({'where':{'id':_0x4c7edc['params']['id']}})[_0x5552('0x19')](handleEntityNotFound(_0x296237,null))[_0x5552('0x19')](function(_0x1bc702){if(_0x1bc702){_0x399261[_0x5552('0x2a')]=_[_0x5552('0x22')](db[_0x5552('0x93')][_0x5552('0xb9')]);_0x399261[_0x5552('0x2b')]=_['keys'](_0x4c7edc[_0x5552('0x2b')]);_0x399261[_0x5552('0x2c')]=_['intersection'](_0x399261[_0x5552('0x2a')],_0x399261['query']);_0x2bf2c5[_0x5552('0x2f')]=_[_0x5552('0x2d')](_0x399261['model'],qs[_0x5552('0x2e')](_0x4c7edc['query']['fields']));_0x2bf2c5[_0x5552('0x2f')]=_0x2bf2c5[_0x5552('0x2f')]['length']?_0x2bf2c5[_0x5552('0x2f')]:_0x399261[_0x5552('0x2a')];if(!_0x4c7edc[_0x5552('0x2b')][_0x5552('0x52')](_0x5552('0x30'))){_0x2bf2c5[_0x5552('0x31')]=qs[_0x5552('0x31')](_0x4c7edc[_0x5552('0x2b')][_0x5552('0x31')]);_0x2bf2c5[_0x5552('0x13')]=qs[_0x5552('0x13')](_0x4c7edc[_0x5552('0x2b')][_0x5552('0x13')]);}_0x2bf2c5[_0x5552('0x32')]=qs[_0x5552('0x33')](_0x4c7edc[_0x5552('0x2b')][_0x5552('0x33')]);_0x2bf2c5[_0x5552('0x34')]=qs['filters'](_[_0x5552('0xba')](_0x4c7edc[_0x5552('0x2b')],_0x399261[_0x5552('0x2c')]));_0x2bf2c5[_0x5552('0x34')][_0x5552('0xbf')]=_0x1bc702['id'];if(_0x4c7edc[_0x5552('0x2b')][_0x5552('0x53')]){_0x2bf2c5[_0x5552('0x34')]=_['merge'](_0x2bf2c5[_0x5552('0x34')],{'$or':_[_0x5552('0x51')](_0x2bf2c5[_0x5552('0x2f')],function(_0x3100cd){var _0x18a114={};_0x18a114[_0x3100cd]={'$like':'%'+_0x4c7edc[_0x5552('0x2b')]['filter']+'%'};return _0x18a114;})});}_0x2bf2c5=_['merge']({},_0x2bf2c5,_0x4c7edc[_0x5552('0xc0')]);return db[_0x5552('0x93')][_0x5552('0x15')]({'where':_0x2bf2c5['where']})['then'](function(_0x2a2981){_0x8c6905['count']=_0x2a2981;if(_0x4c7edc[_0x5552('0x2b')]['includeAll']){_0x2bf2c5[_0x5552('0xc1')]=[{'all':!![]}];}return db[_0x5552('0x93')]['findAll'](_0x2bf2c5);})[_0x5552('0x19')](function(_0x52c83b){_0x8c6905[_0x5552('0x81')]=_0x52c83b;return _0x8c6905;});}})['then'](respondWithFilteredResult(_0x296237,_0x2bf2c5))[_0x5552('0x84')](handleError(_0x296237,null));};exports[_0x5552('0xc2')]=function(_0x55fcfd,_0x401ad2){var _0x356251={'raw':!![],'where':{}};var _0xafa571={};var _0x1599aa={'count':0x0,'rows':[]};return db[_0x5552('0x20')][_0x5552('0x27')]({'where':{'id':_0x55fcfd[_0x5552('0x83')]['id']}})[_0x5552('0x19')](handleEntityNotFound(_0x401ad2,null))[_0x5552('0x19')](function(_0x49ef1a){if(_0x49ef1a){_0xafa571['model']=_['keys'](db[_0x5552('0xa0')]['rawAttributes']);_0xafa571[_0x5552('0x2b')]=_[_0x5552('0x22')](_0x55fcfd[_0x5552('0x2b')]);_0xafa571[_0x5552('0x2c')]=_[_0x5552('0x2d')](_0xafa571[_0x5552('0x2a')],_0xafa571[_0x5552('0x2b')]);_0x356251[_0x5552('0x2f')]=_['intersection'](_0xafa571[_0x5552('0x2a')],qs[_0x5552('0x2e')](_0x55fcfd[_0x5552('0x2b')][_0x5552('0x2e')]));_0x356251[_0x5552('0x2f')]=_0x356251[_0x5552('0x2f')][_0x5552('0x23')]?_0x356251[_0x5552('0x2f')]:_0xafa571[_0x5552('0x2a')];if(!_0x55fcfd[_0x5552('0x2b')][_0x5552('0x52')](_0x5552('0x30'))){_0x356251['limit']=qs[_0x5552('0x31')](_0x55fcfd[_0x5552('0x2b')][_0x5552('0x31')]);_0x356251['offset']=qs['offset'](_0x55fcfd[_0x5552('0x2b')][_0x5552('0x13')]);}_0x356251[_0x5552('0x32')]=qs[_0x5552('0x33')](_0x55fcfd['query'][_0x5552('0x33')]);_0x356251[_0x5552('0x34')]=qs['filters'](_[_0x5552('0xba')](_0x55fcfd[_0x5552('0x2b')],_0xafa571[_0x5552('0x2c')]));_0x356251[_0x5552('0x34')][_0x5552('0xbf')]=_0x49ef1a['id'];if(_0x55fcfd[_0x5552('0x2b')][_0x5552('0x53')]){_0x356251[_0x5552('0x34')]=_[_0x5552('0x8b')](_0x356251[_0x5552('0x34')],{'$or':_[_0x5552('0x51')](_0x356251['attributes'],function(_0x162b23){var _0x3924b6={};_0x3924b6[_0x162b23]={'$like':'%'+_0x55fcfd[_0x5552('0x2b')][_0x5552('0x53')]+'%'};return _0x3924b6;})});}_0x356251=_[_0x5552('0x8b')]({},_0x356251,_0x55fcfd[_0x5552('0xc0')]);return db['CmHopperHistory'][_0x5552('0x15')]({'where':_0x356251['where']})[_0x5552('0x19')](function(_0x32b52d){_0x1599aa[_0x5552('0x15')]=_0x32b52d;if(_0x55fcfd[_0x5552('0x2b')][_0x5552('0xc3')]){_0x356251[_0x5552('0xc1')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5552('0x8d')](_0x356251);})[_0x5552('0x19')](function(_0xf2e292){_0x1599aa['rows']=_0xf2e292;return _0x1599aa;});}})[_0x5552('0x19')](respondWithFilteredResult(_0x401ad2,_0x356251))[_0x5552('0x84')](handleError(_0x401ad2,null));};exports[_0x5552('0xc4')]=function(_0x59e0ed,_0x988232){var _0x334fd8={'raw':!![],'where':{}};var _0x359d9c={};var _0x2a22fe={'count':0x0,'rows':[]};return db['CmContact'][_0x5552('0x27')]({'where':{'id':_0x59e0ed['params']['id']}})[_0x5552('0x19')](handleEntityNotFound(_0x988232,null))[_0x5552('0x19')](function(_0x547919){if(_0x547919){_0x359d9c[_0x5552('0x2a')]=_['keys'](db[_0x5552('0x9f')]['rawAttributes']);_0x359d9c[_0x5552('0x2b')]=_[_0x5552('0x22')](_0x59e0ed[_0x5552('0x2b')]);_0x359d9c[_0x5552('0x2c')]=_[_0x5552('0x2d')](_0x359d9c['model'],_0x359d9c[_0x5552('0x2b')]);_0x334fd8[_0x5552('0x2f')]=_[_0x5552('0x2d')](_0x359d9c[_0x5552('0x2a')],qs['fields'](_0x59e0ed[_0x5552('0x2b')]['fields']));_0x334fd8['attributes']=_0x334fd8['attributes'][_0x5552('0x23')]?_0x334fd8[_0x5552('0x2f')]:_0x359d9c['model'];if(!_0x59e0ed[_0x5552('0x2b')]['hasOwnProperty'](_0x5552('0x30'))){_0x334fd8[_0x5552('0x31')]=qs['limit'](_0x59e0ed['query']['limit']);_0x334fd8[_0x5552('0x13')]=qs[_0x5552('0x13')](_0x59e0ed[_0x5552('0x2b')][_0x5552('0x13')]);}_0x334fd8[_0x5552('0x32')]=qs[_0x5552('0x33')](_0x59e0ed[_0x5552('0x2b')][_0x5552('0x33')]);_0x334fd8['where']=qs['filters'](_[_0x5552('0xba')](_0x59e0ed[_0x5552('0x2b')],_0x359d9c[_0x5552('0x2c')]));_0x334fd8[_0x5552('0x34')]['ContactId']=_0x547919['id'];if(_0x59e0ed[_0x5552('0x2b')]['filter']){_0x334fd8[_0x5552('0x34')]=_[_0x5552('0x8b')](_0x334fd8[_0x5552('0x34')],{'$or':_[_0x5552('0x51')](_0x334fd8[_0x5552('0x2f')],function(_0x5661d4){var _0x2d2b91={};_0x2d2b91[_0x5661d4]={'$like':'%'+_0x59e0ed['query'][_0x5552('0x53')]+'%'};return _0x2d2b91;})});}_0x334fd8=_[_0x5552('0x8b')]({},_0x334fd8,_0x59e0ed['options']);return db[_0x5552('0x9f')]['count']({'where':_0x334fd8['where']})[_0x5552('0x19')](function(_0x1d975f){_0x2a22fe[_0x5552('0x15')]=_0x1d975f;if(_0x59e0ed[_0x5552('0x2b')][_0x5552('0xc3')]){_0x334fd8['include']=[{'all':!![]}];}return db[_0x5552('0x9f')]['findAll'](_0x334fd8);})[_0x5552('0x19')](function(_0x58660c){_0x2a22fe[_0x5552('0x81')]=_0x58660c;return _0x2a22fe;});}})[_0x5552('0x19')](respondWithFilteredResult(_0x988232,_0x334fd8))['catch'](handleError(_0x988232,null));};exports[_0x5552('0xc5')]=function(_0x3b875d,_0x49ec41){var _0x2ba4ba={'raw':!![],'where':{}};var _0x3897f8={};var _0x44bcf2={'count':0x0,'rows':[]};return db[_0x5552('0x20')][_0x5552('0x27')]({'where':{'id':_0x3b875d[_0x5552('0x83')]['id']}})['then'](handleEntityNotFound(_0x49ec41,null))[_0x5552('0x19')](function(_0x32dd86){if(_0x32dd86){_0x3897f8[_0x5552('0x2a')]=_['keys'](db[_0x5552('0xa4')][_0x5552('0xb9')]);_0x3897f8[_0x5552('0x2b')]=_['keys'](_0x3b875d[_0x5552('0x2b')]);_0x3897f8[_0x5552('0x2c')]=_[_0x5552('0x2d')](_0x3897f8[_0x5552('0x2a')],_0x3897f8[_0x5552('0x2b')]);_0x2ba4ba[_0x5552('0x2f')]=_[_0x5552('0x2d')](_0x3897f8[_0x5552('0x2a')],qs[_0x5552('0x2e')](_0x3b875d[_0x5552('0x2b')][_0x5552('0x2e')]));_0x2ba4ba[_0x5552('0x2f')]=_0x2ba4ba[_0x5552('0x2f')][_0x5552('0x23')]?_0x2ba4ba[_0x5552('0x2f')]:_0x3897f8['model'];if(!_0x3b875d['query'][_0x5552('0x52')](_0x5552('0x30'))){_0x2ba4ba[_0x5552('0x31')]=qs[_0x5552('0x31')](_0x3b875d[_0x5552('0x2b')][_0x5552('0x31')]);_0x2ba4ba[_0x5552('0x13')]=qs[_0x5552('0x13')](_0x3b875d['query'][_0x5552('0x13')]);}_0x2ba4ba['order']=qs[_0x5552('0x33')](_0x3b875d['query']['sort']);_0x2ba4ba[_0x5552('0x34')]=qs[_0x5552('0x2c')](_['pick'](_0x3b875d[_0x5552('0x2b')],_0x3897f8[_0x5552('0x2c')]));_0x2ba4ba[_0x5552('0x34')][_0x5552('0xbf')]=_0x32dd86['id'];if(_0x3b875d[_0x5552('0x2b')][_0x5552('0x53')]){_0x2ba4ba[_0x5552('0x34')]=_[_0x5552('0x8b')](_0x2ba4ba[_0x5552('0x34')],{'$or':_[_0x5552('0x51')](_0x2ba4ba[_0x5552('0x2f')],function(_0x973558){var _0x3dda86={};_0x3dda86[_0x973558]={'$like':'%'+_0x3b875d[_0x5552('0x2b')][_0x5552('0x53')]+'%'};return _0x3dda86;})});}_0x2ba4ba=_[_0x5552('0x8b')]({},_0x2ba4ba,_0x3b875d[_0x5552('0xc0')]);return db[_0x5552('0xa4')][_0x5552('0x15')]({'where':_0x2ba4ba[_0x5552('0x34')]})[_0x5552('0x19')](function(_0x599799){_0x44bcf2[_0x5552('0x15')]=_0x599799;if(_0x3b875d['query']['includeAll']){_0x2ba4ba[_0x5552('0xc1')]=[{'all':!![]}];}return db[_0x5552('0xa4')][_0x5552('0x8d')](_0x2ba4ba);})[_0x5552('0x19')](function(_0x541d4c){_0x44bcf2[_0x5552('0x81')]=_0x541d4c;return _0x44bcf2;});}})[_0x5552('0x19')](respondWithFilteredResult(_0x49ec41,_0x2ba4ba))['catch'](handleError(_0x49ec41,null));};exports[_0x5552('0xc6')]=function(_0x651a93,_0xe12e08){try{if(!_0x651a93[_0x5552('0x8c')][_0x5552('0x57')]){throw new Error(_0x5552('0xc7'));}if(!_0x651a93[_0x5552('0x8c')][_0x5552('0xc8')]){throw new Error(_0x5552('0xc9'));}if(!_0x651a93[_0x5552('0x8c')][_0x5552('0xca')]){throw new Error(_0x5552('0xcb'));}if(!_0x651a93[_0x5552('0x8c')][_0x5552('0xcc')]){throw new Error(_0x5552('0xcd'));}var _0x468eef=_0x651a93[_0x5552('0x8c')][_0x5552('0xc8')]['split'](',');var _0x463831=_0x651a93['body']['binding_values'][_0x5552('0x5f')](',');if(!_0x468eef['length']||!_0x463831[_0x5552('0x23')]||_0x468eef[_0x5552('0x23')]!==_0x463831['length']){throw new Error(_0x5552('0xce'));}_0x651a93[_0x5552('0x8c')][_0x5552('0x2e')]=_[_0x5552('0xcf')](_0x468eef,_0x463831);if(!_0x651a93[_0x5552('0x8c')][_0x5552('0x2e')][_0x5552('0xb8')]){throw new Error(_0x5552('0xd0'));}if(!_0x651a93[_0x5552('0x8c')]['fields'][_0x5552('0xd1')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0xa427e9=path[_0x5552('0x90')](config[_0x5552('0xd2')],_0x5552('0xd3'),_0x651a93['file'][_0x5552('0xd4')]);fs[_0x5552('0xd5')](_0xa427e9,parseInt(_0x5552('0xd6'),0x8));var _0x114448=require(_0x5552('0xd7'))[_0x5552('0xd8')](path[_0x5552('0x90')](__dirname,_0x5552('0xd9')),[_0xa427e9,_0x651a93[_0x5552('0x8c')][_0x5552('0xc8')],_0x651a93[_0x5552('0x8c')][_0x5552('0xca')],_0x651a93[_0x5552('0x8c')]['ListId'],_0x651a93[_0x5552('0x8c')][_0x5552('0xda')],_0x651a93[_0x5552('0x8c')][_0x5552('0xaa')],_0x651a93['body']['socket_timestamp']]);return _0xe12e08['status'](0xc8)[_0x5552('0x12')]({'message':_0x5552('0xdb'),'pid':_0x114448[_0x5552('0xdc')]});}catch(_0x2c9985){return _0xe12e08[_0x5552('0x1a')](0x1f4)[_0x5552('0x1e')](_0x2c9985);}};exports[_0x5552('0xdd')]=function(_0x5dff9f,_0x1fa415){var _0x271f53=fs[_0x5552('0xde')](_0x5dff9f[_0x5552('0xdf')][_0x5552('0x3')]);Papa[_0x5552('0xe0')](_0x271f53,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0xae9ed7){return _0x1fa415['status'](0xc8)['json']({'file':_0x5dff9f[_0x5552('0xdf')],'fields':_0xae9ed7[_0x5552('0xe1')]['fields']});}});};exports['import']=function(_0x423d6f,_0x4020d2){return db[_0x5552('0x71')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x5552('0x70')}})[_0x5552('0x19')](function(_0x5b91cb){var _0x115e05=![];if(!_0x423d6f[_0x5552('0x8c')]['ListId']){throw new Error(_0x5552('0xc7'));}if(!_0x423d6f[_0x5552('0x8c')]['binding'][_0x5552('0xb8')]){throw new Error(_0x5552('0xd0'));}if(!_0x423d6f['body']['binding']['firstName']){throw new Error(_0x5552('0xe2'));}if(!_0x423d6f[_0x5552('0x8c')][_0x5552('0xcc')]){throw new Error(_0x5552('0xcd'));}var _0x3670fd=require('child_process')['fork'](path[_0x5552('0x90')](__dirname,_0x5552('0xe3')),[_0x423d6f['params']['id'],JSON[_0x5552('0xe4')](_0x423d6f[_0x5552('0x8c')]),JSON['stringify'](_0x5b91cb)]);_0x3670fd['on'](_0x5552('0xe5'),function(){_0x115e05=!![];return _0x4020d2[_0x5552('0x1a')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x3670fd[_0x5552('0xdc')]});});_0x3670fd['on'](_0x5552('0xe6'),function(_0x453b04){if(_0x453b04&&!_0x115e05){return _0x4020d2['status'](0x1f4)[_0x5552('0x12')]({'message':_0x5552('0xe7'),'pid':_0x3670fd[_0x5552('0xdc')]});}});})[_0x5552('0x84')](handleError(_0x4020d2,null));};exports[_0x5552('0xe8')]=function(_0x3712ee,_0x5a4853){var _0x35fe8d=[_0x5552('0xe9'),_0x5552('0xea'),_0x5552('0xeb'),'openchannel',_0x5552('0xec'),_0x5552('0xed'),_0x5552('0xee')];var _0x514d8c={'offset':0x0,'order':qs[_0x5552('0x33')](_0x5552('0xef'))},_0x2f1835={'count':0x0,'rows':[]};Promise[_0x5552('0x6d')]()['then'](function(){if(_0x3712ee[_0x5552('0x2b')][_0x5552('0xf0')]){if(!_[_0x5552('0xf1')](_0x35fe8d,_0x3712ee['query'][_0x5552('0xf0')][_0x5552('0xf2')]())){throw new Error(_0x5552('0xf3'));}_0x35fe8d=[_0x3712ee[_0x5552('0x2b')][_0x5552('0xf0')]['toLowerCase']()];}if(_0x3712ee[_0x5552('0x2b')]['range']){try{var _0x30654d=JSON['parse'](_0x3712ee['query'][_0x5552('0xf4')]);if(!moment(_0x30654d['from'])[_0x5552('0xf5')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x30654d['to'])[_0x5552('0xf5')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x548fc6){throw new Error(_0x5552('0xf6'));}}if(!_0x3712ee[_0x5552('0x2b')][_0x5552('0x52')](_0x5552('0x30'))){_0x514d8c[_0x5552('0x31')]=qs[_0x5552('0x31')](_0x3712ee[_0x5552('0x2b')][_0x5552('0x31')]||0xa);_0x514d8c['offset']=qs[_0x5552('0x13')](_0x3712ee[_0x5552('0x2b')][_0x5552('0x13')]);}var _0x49d8d0=_0x35fe8d['map'](function(_0x4576f8){if(_0x4576f8===_0x5552('0xee')){var _0x519e0c={'attributes':['id',_0x5552('0xf7'),_0x5552('0x4d'),_0x5552('0xf8'),_0x5552('0xf9'),_0x5552('0xfa'),_0x5552('0xfb'),'endtime',_0x5552('0xfc'),_0x5552('0xfd'),'createdAt','userDisposition','userSecondDisposition',_0x5552('0xfe'),_0x5552('0xff')],'where':{'ContactId':_0x3712ee[_0x5552('0x83')]['id']},'include':[{'model':db[_0x5552('0x71')],'as':_0x5552('0x71'),'attributes':['id',_0x5552('0x1d'),_0x5552('0x100'),_0x5552('0x101')]}],'order':[['createdAt',_0x5552('0x102')]]};if(_0x3712ee[_0x5552('0x2b')][_0x5552('0xf4')]){_0x519e0c[_0x5552('0x34')][_0x5552('0x103')]={'$gte':_0x30654d[_0x5552('0x38')],'$lte':_0x30654d['to']};}return db['VoiceCallReport'][_0x5552('0x104')](_0x519e0c)['then'](function(_0x5261f2){_0x2f1835['count']+=_0x5261f2['count'];return _[_0x5552('0x51')](_0x5261f2['rows'],function(_0x25c32f){var _0x39154f=_0x25c32f[_0x5552('0x8e')]({'plain':!![]});_0x39154f[_0x5552('0xf0')]=_0x4576f8;if(_0x39154f['User']){_0x39154f['User']={'id':_0x39154f[_0x5552('0x71')]['id'],'name':_0x39154f['User'][_0x5552('0x1d')],'fullname':_0x39154f[_0x5552('0x71')][_0x5552('0x100')],'alias':_0x39154f[_0x5552('0x71')][_0x5552('0x101')]};}return _0x39154f;});});}else{var _0x3fa324=_[_0x5552('0x105')](_0x4576f8)+(_0x4576f8===_0x5552('0xea')?_0x5552('0x106'):_0x5552('0x107'));var _0xe17966={'attributes':['id',_0x5552('0x108'),'closedAt',_0x5552('0x103'),_0x5552('0xfd'),_0x5552('0x109'),_0x5552('0x10a'),_0x5552('0x10b'),_0x5552('0xff'),_0x3fa324+'Id'],'where':{'ContactId':_0x3712ee[_0x5552('0x83')]['id']},'include':[{'model':db[_0x3fa324],'as':_0x5552('0x107'),'attributes':['id',_0x5552('0x1d'),'key']},{'model':db[_0x5552('0x71')],'as':'Owner','attributes':['id',_0x5552('0x1d'),'fullname']},{'model':db[_0x5552('0x43')],'as':'Tags','attributes':['id',_0x5552('0x1d'),'color'],'through':{'attributes':[]}}],'order':[[_0x5552('0x103'),_0x5552('0x102')]]};if(_0x3712ee[_0x5552('0x2b')][_0x5552('0xf4')]){_0xe17966[_0x5552('0x34')][_0x5552('0x103')]={'$gte':_0x30654d[_0x5552('0x38')],'$lte':_0x30654d['to']};}switch(_0x4576f8){case _0x5552('0xea'):_0xe17966[_0x5552('0x2f')][_0x5552('0x25')](_0x5552('0x10c'),_0x5552('0x10d'),'customerPort',_0x5552('0x10e'),_0x5552('0x10f'),'ratingMessage','ratingType',_0x5552('0x110'),'referer');break;case'mail':_0xe17966[_0x5552('0x2f')][_0x5552('0x25')](_0x5552('0x111'),_0x5552('0x112'));break;case'openchannel':_0xe17966[_0x5552('0x2f')]['push']('externalUrl',_0x5552('0x113'));break;}return db[_['startCase'](_0x4576f8)+_0x5552('0x114')][_0x5552('0x104')](_0xe17966)[_0x5552('0x19')](function(_0x5e4f6e){_0x2f1835[_0x5552('0x15')]+=_0x5e4f6e[_0x5552('0x15')];return _[_0x5552('0x51')](_0x5e4f6e['rows'],function(_0x2823a4){var _0x502019=_0x2823a4['get']({'plain':!![]});_0x502019[_0x5552('0xf0')]=_0x4576f8;if(_0x502019[_0x5552('0x115')]){_0x502019[_0x5552('0x115')]={'id':_0x502019[_0x5552('0x115')]['id'],'name':_0x502019[_0x5552('0x115')]['name'],'fullname':_0x502019[_0x5552('0x115')]['fullname']};}return _0x502019;});});}});return Promise[_0x5552('0x116')](_0x49d8d0);})[_0x5552('0x19')](function(_0x3ba629){return _(_0x3ba629)[_0x5552('0x117')]()[_0x5552('0x118')](_0x5552('0x103'))[_0x5552('0x119')]()[_0x5552('0x44')]();})[_0x5552('0x19')](function(_0x3b340e){_0x2f1835[_0x5552('0x81')]=_0x514d8c[_0x5552('0x31')]?_0x3b340e[_0x5552('0x11a')](_0x514d8c[_0x5552('0x13')],_0x514d8c['offset']+_0x514d8c[_0x5552('0x31')]):_0x3b340e;return _0x2f1835;})[_0x5552('0x19')](respondWithFilteredResult(_0x5a4853,_0x514d8c))[_0x5552('0x84')](handleError(_0x5a4853,null));};
\ No newline at end of file
index 009ce40..8c8a7a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9be9=['events','../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3228d0,_0x421565){var _0x118401=function(_0x18007c){while(--_0x18007c){_0x3228d0['push'](_0x3228d0['shift']());}};_0x118401(++_0x421565);}(_0x9be9,0xc6));var _0x99be=function(_0x492ac8,_0x1386c4){_0x492ac8=_0x492ac8-0x0;var _0x4e8a27=_0x9be9[_0x492ac8];return _0x4e8a27;};'use strict';var EventEmitter=require(_0x99be('0x0'));var CmContact=require(_0x99be('0x1'))['db'][_0x99be('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x99be('0x3')](0x0);var events={'afterCreate':_0x99be('0x4'),'afterUpdate':_0x99be('0x5'),'afterDestroy':_0x99be('0x6')};function emitEvent(_0x2eca60){return function(_0x5cfd05,_0x4c6f2b,_0x4e6e2e){CmContactEvents[_0x99be('0x7')](_0x2eca60+':'+_0x5cfd05['id'],_0x5cfd05);CmContactEvents[_0x99be('0x7')](_0x2eca60,_0x5cfd05);_0x4e6e2e(null);};}for(var e in events){if(events[_0x99be('0x8')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0xd3f8=['setMaxListeners','save','update','remove','emit','hook','exports','events','CmContact'];(function(_0x57f7aa,_0x1a054e){var _0x5d1919=function(_0x1e7147){while(--_0x1e7147){_0x57f7aa['push'](_0x57f7aa['shift']());}};_0x5d1919(++_0x1a054e);}(_0xd3f8,0x154));var _0x8d3f=function(_0xa3a31f,_0x19333d){_0xa3a31f=_0xa3a31f-0x0;var _0x103d0f=_0xd3f8[_0xa3a31f];return _0x103d0f;};'use strict';var EventEmitter=require(_0x8d3f('0x0'));var CmContact=require('../../mysqldb')['db'][_0x8d3f('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8d3f('0x2')](0x0);var events={'afterCreate':_0x8d3f('0x3'),'afterUpdate':_0x8d3f('0x4'),'afterDestroy':_0x8d3f('0x5')};function emitEvent(_0x26ad0f){return function(_0x29dc2b,_0x32f018,_0x4e51c7){CmContactEvents[_0x8d3f('0x6')](_0x26ad0f+':'+_0x29dc2b['id'],_0x29dc2b);CmContactEvents[_0x8d3f('0x6')](_0x26ad0f,_0x29dc2b);_0x4e51c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x8d3f('0x7')](e,emitEvent(event));}}module[_0x8d3f('0x8')]=CmContactEvents;
\ No newline at end of file
index 6e03813..d91999e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2deb=['isNil','cmContact,\x20afterCreate\x20','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','afterCreate','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','create','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','length','always','VoiceQueue','CmHopperBlack','error','cmContact,\x20%s,\x20%s','message','Campaign','onlyIfOpen','BlackLists','List\x20not\x20found','isEmpty','ContactId','CampaignId','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','models','get','cmContact','inspect','CmHopper','findOne','then'];(function(_0x59f1aa,_0x29863f){var _0x2fd4eb=function(_0x252d37){while(--_0x252d37){_0x59f1aa['push'](_0x59f1aa['shift']());}};_0x2fd4eb(++_0x29863f);}(_0x2deb,0xdb));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var logger=require(_0xb2de('0x2'))(_0xb2de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb2de('0x4'));var fs=require('fs');var path=require(_0xb2de('0x5'));var rimraf=require(_0xb2de('0x6'));var config=require(_0xb2de('0x7'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x201fcc,_0x2ed8ec){return _0x201fcc[_0xb2de('0x8')]('CmContact',attributes,{'tableName':_0xb2de('0x9'),'paranoid':!![],'indexes':[{'name':_0xb2de('0xa'),'fields':['phone']},{'name':_0xb2de('0xb'),'fields':[_0xb2de('0xc'),_0xb2de('0xd'),'phone',_0xb2de('0xe'),_0xb2de('0xf'),_0xb2de('0x10')],'type':_0xb2de('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0xe416e4,_0x261765,_0x39c08e){var _0x4c8d35=_0x201fcc[_0xb2de('0x12')];var _0x343024=_0xe416e4[_0xb2de('0x13')]({'plain':!![]});function _0x516e41(){return function(_0x1ebae3){logger['error'](_0xb2de('0x14'),'afterCreate',util[_0xb2de('0x15')](_0x1ebae3,{'showHidden':![],'depth':null}));};}var _0x839c22=function(_0x3f9541){return new BPromise(function(_0x5a1f02,_0x209429){_0x4c8d35[_0xb2de('0x16')][_0xb2de('0x17')]({'where':{'phone':_0x343024[_0xb2de('0xa')],'VoiceQueueId':_0x3f9541['id']}})[_0xb2de('0x18')](function(_0x2dc15c){if(!_[_0xb2de('0x19')](_0x2dc15c)){throw new Error(_0xb2de('0x1a')+_0x343024[_0xb2de('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x3f9541['id']);}return _0x4c8d35[_0xb2de('0x16')]['create']({'phone':_0x343024[_0xb2de('0xa')],'ContactId':_0x343024['id'],'ListId':_0x343024[_0xb2de('0x1b')],'priority':_0x343024['priority']?_0x343024[_0xb2de('0x1c')]:0x2,'scheduledat':_0x343024[_0xb2de('0x1d')]?_0x343024['scheduledat']:moment()[_0xb2de('0x1e')](_0xb2de('0x1f')),'callback':_0x343024[_0xb2de('0x20')]?!![]:![],'callbackuniqueid':_0x343024[_0xb2de('0x20')]?_0x343024[_0xb2de('0x20')]:undefined,'callbackat':_0x343024[_0xb2de('0x20')]?moment()[_0xb2de('0x1e')](_0xb2de('0x1f')):undefined,'VoiceQueueId':_0x3f9541['id']});})[_0xb2de('0x21')](function(_0x506a50){_0x209429(_0x506a50);});});};var _0x280644=function(_0x2ebdde){return new BPromise(function(_0x1f38c9,_0xa97fb4){_0x4c8d35['CmHopper']['findOne']({'where':{'phone':_0x343024[_0xb2de('0xa')],'VoiceQueueId':_0x2ebdde['id']}})[_0xb2de('0x18')](function(_0x3d9ece){if(!_['isNil'](_0x3d9ece)){throw new Error(_0xb2de('0x1a')+_0x343024[_0xb2de('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x2ebdde['id']);}return _0x4c8d35[_0xb2de('0x22')]['findOne']({'where':{'calleridnum':_0x343024[_0xb2de('0xa')],'VoiceQueueId':_0x2ebdde['id']}});})[_0xb2de('0x18')](function(_0x1c8eaf){if(!_[_0xb2de('0x19')](_0x1c8eaf)){throw new Error(_0xb2de('0x23')+_0x343024[_0xb2de('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x2ebdde['id']);}return _0x4c8d35[_0xb2de('0x16')]['create']({'phone':_0x343024[_0xb2de('0xa')],'ContactId':_0x343024['id'],'ListId':_0x343024['ListId'],'priority':_0x343024['priority']?_0x343024[_0xb2de('0x1c')]:0x2,'scheduledat':_0x343024[_0xb2de('0x1d')]?_0x343024[_0xb2de('0x1d')]:moment()[_0xb2de('0x1e')](_0xb2de('0x1f')),'callback':_0x343024[_0xb2de('0x20')]?!![]:![],'callbackuniqueid':_0x343024[_0xb2de('0x20')]?_0x343024[_0xb2de('0x20')]:undefined,'callbackat':_0x343024[_0xb2de('0x20')]?moment()[_0xb2de('0x1e')](_0xb2de('0x1f')):undefined,'VoiceQueueId':_0x2ebdde['id']});})[_0xb2de('0x21')](function(_0x4c4b3c){_0xa97fb4(_0x4c4b3c);});});};function _0x8b8ba2(){return function(_0x15864f){logger['error'](_0xb2de('0x14'),_0xb2de('0x24'),util['inspect'](_0x15864f,{'showHidden':![],'depth':null}));};}var _0x3b9444=function(_0x4725c4){return new BPromise(function(_0x288177,_0x492b6a){_0x4c8d35[_0xb2de('0x16')][_0xb2de('0x17')]({'where':{'phone':_0x343024[_0xb2de('0xa')],'CampaignId':_0x4725c4['id']}})[_0xb2de('0x18')](function(_0x24afd8){if(!_[_0xb2de('0x19')](_0x24afd8)){throw new Error(_0xb2de('0x1a')+_0x343024[_0xb2de('0xa')]+_0xb2de('0x25')+_0x4725c4['id']);}return _0x4c8d35[_0xb2de('0x16')][_0xb2de('0x26')]({'phone':_0x343024['phone'],'ContactId':_0x343024['id'],'ListId':_0x343024[_0xb2de('0x1b')],'priority':_0x343024[_0xb2de('0x1c')]?_0x343024[_0xb2de('0x1c')]:0x2,'scheduledat':_0x343024[_0xb2de('0x1d')]?_0x343024[_0xb2de('0x1d')]:moment()[_0xb2de('0x1e')](_0xb2de('0x1f')),'callback':_0x343024[_0xb2de('0x20')]?!![]:![],'callbackuniqueid':_0x343024[_0xb2de('0x20')]?_0x343024[_0xb2de('0x20')]:undefined,'callbackat':_0x343024[_0xb2de('0x20')]?moment()[_0xb2de('0x1e')](_0xb2de('0x1f')):undefined,'CampaignId':_0x4725c4['id']});})[_0xb2de('0x21')](function(_0x104f3c){_0x492b6a(_0x104f3c);});});};var _0x5320d9=function(_0x1e26a7){return new BPromise(function(_0x48ca28,_0x450fd1){_0x4c8d35[_0xb2de('0x16')][_0xb2de('0x17')]({'where':{'phone':_0x343024[_0xb2de('0xa')],'CampaignId':_0x1e26a7['id']}})[_0xb2de('0x18')](function(_0x2cc362){if(!_[_0xb2de('0x19')](_0x2cc362)){throw new Error(_0xb2de('0x1a')+_0x343024[_0xb2de('0xa')]+_0xb2de('0x27')+_0x1e26a7['id']);}return _0x4c8d35[_0xb2de('0x22')][_0xb2de('0x17')]({'where':{'calleridnum':_0x343024[_0xb2de('0xa')],'CampaignId':_0x1e26a7['id']}});})[_0xb2de('0x18')](function(_0x3dc4c0){if(!_['isNil'](_0x3dc4c0)){throw new Error(_0xb2de('0x23')+_0x343024[_0xb2de('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x1e26a7['id']);}return _0x4c8d35[_0xb2de('0x16')][_0xb2de('0x26')]({'phone':_0x343024[_0xb2de('0xa')],'ContactId':_0x343024['id'],'ListId':_0x343024[_0xb2de('0x1b')],'priority':_0x343024['priority']?_0x343024[_0xb2de('0x1c')]:0x2,'scheduledat':_0x343024[_0xb2de('0x1d')]?_0x343024['scheduledat']:moment()[_0xb2de('0x1e')](_0xb2de('0x1f')),'callback':_0x343024['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x343024[_0xb2de('0x20')]?_0x343024['callbackUniqueid']:undefined,'callbackat':_0x343024['callbackUniqueid']?moment()[_0xb2de('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1e26a7['id']});})['catch'](function(_0x440f15){_0x450fd1(_0x440f15);});});};if(_0x343024[_0xb2de('0x1b')]){_0x4c8d35['VoiceQueue'][_0xb2de('0x28')]({'where':{'type':_0xb2de('0x29')},'attributes':['id',_0xb2de('0x2a')],'include':[{'model':_0x4c8d35[_0xb2de('0x2b')],'as':'Lists','where':{'id':_0x343024[_0xb2de('0x1b')]}}]})[_0xb2de('0x18')](function(_0x354a49){if(_0x354a49){var _0x14c0fc=[];for(var _0xf23d94=0x0,_0x9e1e4a;_0xf23d94<_0x354a49[_0xb2de('0x2c')];_0xf23d94+=0x1){_0x9e1e4a=_0x354a49[_0xf23d94]['get']({'plain':!![]});switch(_0x9e1e4a[_0xb2de('0x2a')]){case _0xb2de('0x2d'):_0x280644(_0x9e1e4a)[_0xb2de('0x21')](_0x516e41());break;case'onlyIfOpen':_0x839c22(_0x9e1e4a)[_0xb2de('0x21')](_0x516e41());break;default:_0x4c8d35['CmHopper'][_0xb2de('0x26')]({'phone':_0x343024[_0xb2de('0xa')],'ContactId':_0x343024['id'],'ListId':_0x343024[_0xb2de('0x1b')],'scheduledat':_0x343024[_0xb2de('0x1d')]?_0x343024['scheduledat']:moment()[_0xb2de('0x1e')](_0xb2de('0x1f')),'priority':_0x343024['priority']?_0x343024['priority']:0x2,'callback':_0x343024[_0xb2de('0x20')]?!![]:![],'callbackuniqueid':_0x343024[_0xb2de('0x20')]?_0x343024[_0xb2de('0x20')]:undefined,'callbackat':_0x343024[_0xb2de('0x20')]?moment()[_0xb2de('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x9e1e4a['id']})[_0xb2de('0x21')](_0x516e41());}}}})['then'](function(){return _0x4c8d35[_0xb2de('0x2e')]['findAll']({'where':{'type':_0xb2de('0x29')},'attributes':['id'],'include':[{'model':_0x4c8d35[_0xb2de('0x2b')],'as':'BlackLists','where':{'id':_0x343024[_0xb2de('0x1b')]}}]})['then'](function(_0x411e18){if(_0x411e18){var _0x4688e5=[];for(var _0x369ee9=0x0,_0x39a9aa;_0x369ee9<_0x411e18['length'];_0x369ee9+=0x1){_0x39a9aa=_0x411e18[_0x369ee9][_0xb2de('0x13')]({'plain':!![]});_0x4c8d35[_0xb2de('0x2f')][_0xb2de('0x26')]({'phone':_0x343024[_0xb2de('0xa')],'ContactId':_0x343024['id'],'ListId':_0x343024[_0xb2de('0x1b')],'VoiceQueueId':_0x39a9aa['id']})['catch'](function(_0x36ab6a){logger[_0xb2de('0x30')](_0xb2de('0x31'),_0xb2de('0x24'),_0x36ab6a[_0xb2de('0x32')]);});}}});})['then'](function(){return _0x4c8d35[_0xb2de('0x33')][_0xb2de('0x28')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0x4c8d35[_0xb2de('0x2b')],'as':'Lists','where':{'id':_0x343024[_0xb2de('0x1b')]}}]})[_0xb2de('0x18')](function(_0x232cfb){if(_0x232cfb){var _0x42956a=[];for(var _0x566fbc=0x0,_0x1d682d;_0x566fbc<_0x232cfb[_0xb2de('0x2c')];_0x566fbc+=0x1){_0x1d682d=_0x232cfb[_0x566fbc]['get']({'plain':!![]});switch(_0x1d682d['dialCheckDuplicateType']){case _0xb2de('0x2d'):_0x5320d9(_0x1d682d)[_0xb2de('0x21')](_0x8b8ba2());break;case _0xb2de('0x34'):_0x3b9444(_0x1d682d)[_0xb2de('0x21')](_0x8b8ba2());break;default:_0x4c8d35[_0xb2de('0x16')][_0xb2de('0x26')]({'phone':_0x343024[_0xb2de('0xa')],'ContactId':_0x343024['id'],'ListId':_0x343024[_0xb2de('0x1b')],'scheduledat':_0x343024[_0xb2de('0x1d')]?_0x343024[_0xb2de('0x1d')]:moment()[_0xb2de('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x343024['priority']?_0x343024[_0xb2de('0x1c')]:0x2,'callback':_0x343024[_0xb2de('0x20')]?!![]:![],'callbackuniqueid':_0x343024[_0xb2de('0x20')]?_0x343024[_0xb2de('0x20')]:undefined,'callbackat':_0x343024[_0xb2de('0x20')]?moment()[_0xb2de('0x1e')](_0xb2de('0x1f')):undefined,'CampaignId':_0x1d682d['id']})['catch'](_0x8b8ba2());}}}});})['then'](function(){return _0x4c8d35[_0xb2de('0x33')][_0xb2de('0x28')]({'attributes':['id'],'include':[{'model':_0x4c8d35[_0xb2de('0x2b')],'as':_0xb2de('0x35'),'where':{'id':_0x343024['ListId']}}]})['then'](function(_0x179d14){if(_0x179d14){var _0x2e9b7c=[];for(var _0x1637cc=0x0,_0x4d4af5;_0x1637cc<_0x179d14[_0xb2de('0x2c')];_0x1637cc+=0x1){_0x4d4af5=_0x179d14[_0x1637cc][_0xb2de('0x13')]({'plain':!![]});_0x4c8d35[_0xb2de('0x2f')][_0xb2de('0x26')]({'phone':_0x343024[_0xb2de('0xa')],'ContactId':_0x343024['id'],'ListId':_0x343024[_0xb2de('0x1b')],'CampaignId':_0x4d4af5['id']})['catch'](function(_0x20e61a){logger[_0xb2de('0x30')](_0xb2de('0x31'),_0xb2de('0x24'),_0x20e61a[_0xb2de('0x32')]);});}}});})[_0xb2de('0x18')](function(){_0x39c08e();})['catch'](function(_0x33b99c){logger['error'](_0xb2de('0x31'),_0xb2de('0x24'),_0x33b99c['message']);_0x39c08e(_0x33b99c);});}else{_0x39c08e(new Error(_0xb2de('0x36')));}},'afterDestroy':function(_0x4adb89,_0x594e8a,_0x49349d){var _0x1a7fc3=_0x201fcc['models'];var _0x5a1025=_0x4adb89['get']({'plain':!![]});return _0x1a7fc3[_0xb2de('0x16')][_0xb2de('0x28')]({'raw':!![],'where':{'ListId':_0x5a1025[_0xb2de('0x1b')],'ContactId':_0x5a1025['id']}})[_0xb2de('0x18')](function(_0x1f9ab0){if(!_[_0xb2de('0x37')](_0x1f9ab0)){var _0x1d6d14=[];for(var _0x36b86b=0x0;_0x36b86b<_0x1f9ab0['length'];_0x36b86b+=0x1){var _0x4f88d7=_0x1a7fc3[_0xb2de('0x16')]['destroy']({'where':{'ListId':_0x1f9ab0[_0x36b86b]['ListId'],'ContactId':_0x1f9ab0[_0x36b86b][_0xb2de('0x38')],'VoiceQueueId':_0x1f9ab0[_0x36b86b]['VoiceQueueId'],'CampaignId':_0x1f9ab0[_0x36b86b][_0xb2de('0x39')]}});_0x1d6d14['push'](_0x4f88d7);}return BPromise['all'](_0x1d6d14);}})[_0xb2de('0x18')](function(_0x4ed3ca){logger[_0xb2de('0x3a')](_0xb2de('0x3b'),util[_0xb2de('0x15')](_0x4ed3ca,{'showHidden':![],'depth':null}));_0x49349d();})[_0xb2de('0x21')](function(_0x14cd30){logger[_0xb2de('0x30')](_0xb2de('0x3c'),util[_0xb2de('0x15')](_0x14cd30,{'showHidden':![],'depth':null}));_0x49349d(_0x14cd30);});}}});};
\ No newline at end of file
+var _0x06d9=['callbackUniqueid','catch','findOne','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','dialCheckDuplicateType','CmList','Lists','get','always','onlyIfOpen','findAll','outbound','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','isEmpty','destroy','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1058ea,_0x34c18a){var _0x4a60f8=function(_0x27a688){while(--_0x27a688){_0x1058ea['push'](_0x1058ea['shift']());}};_0x4a60f8(++_0x34c18a);}(_0x06d9,0xab));var _0x906d=function(_0x7027e2,_0x41637f){_0x7027e2=_0x7027e2-0x0;var _0x1cbf5c=_0x06d9[_0x7027e2];return _0x1cbf5c;};'use strict';var _=require(_0x906d('0x0'));var util=require(_0x906d('0x1'));var logger=require(_0x906d('0x2'))('api');var moment=require(_0x906d('0x3'));var BPromise=require(_0x906d('0x4'));var rp=require(_0x906d('0x5'));var fs=require('fs');var path=require(_0x906d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x906d('0x7'));module[_0x906d('0x8')]=function(_0x2e0a10,_0x3f4b9c){return _0x2e0a10[_0x906d('0x9')](_0x906d('0xa'),attributes,{'tableName':_0x906d('0xb'),'paranoid':!![],'indexes':[{'name':_0x906d('0xc'),'fields':[_0x906d('0xc')]},{'name':_0x906d('0xd'),'fields':[_0x906d('0xe'),_0x906d('0xf'),_0x906d('0xc'),_0x906d('0x10'),_0x906d('0x11'),_0x906d('0x12')],'type':_0x906d('0x13')}],'timestamps':!![],'charset':_0x906d('0x14'),'collate':_0x906d('0x15'),'hooks':{'afterCreate':function(_0x5d4db7,_0x333292,_0x130c8c){var _0x2ae2d4=_0x2e0a10[_0x906d('0x16')];var _0x167462=_0x5d4db7['get']({'plain':!![]});function _0x1253f8(){return function(_0x219458){logger[_0x906d('0x17')](_0x906d('0x18'),_0x906d('0x19'),util[_0x906d('0x1a')](_0x219458,{'showHidden':![],'depth':null}));};}var _0x39ad47=function(_0x2685f7){return new BPromise(function(_0x4c6b26,_0x2a76d1){_0x2ae2d4['CmHopper']['findOne']({'where':{'phone':_0x167462[_0x906d('0xc')],'VoiceQueueId':_0x2685f7['id']}})[_0x906d('0x1b')](function(_0x56ea2b){if(!_['isNil'](_0x56ea2b)){throw new Error('cmContact,\x20afterCreate\x20'+_0x167462[_0x906d('0xc')]+_0x906d('0x1c')+_0x2685f7['id']);}return _0x2ae2d4[_0x906d('0x1d')][_0x906d('0x1e')]({'phone':_0x167462[_0x906d('0xc')],'ContactId':_0x167462['id'],'ListId':_0x167462[_0x906d('0x1f')],'priority':_0x167462[_0x906d('0x20')]?_0x167462['priority']:0x2,'scheduledat':_0x167462[_0x906d('0x21')]?_0x167462[_0x906d('0x21')]:moment()[_0x906d('0x22')](_0x906d('0x23')),'callback':_0x167462['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x167462[_0x906d('0x24')]?_0x167462[_0x906d('0x24')]:undefined,'callbackat':_0x167462[_0x906d('0x24')]?moment()['format'](_0x906d('0x23')):undefined,'VoiceQueueId':_0x2685f7['id']});})[_0x906d('0x25')](function(_0x2a902d){_0x2a76d1(_0x2a902d);});});};var _0x18649b=function(_0x346fb1){return new BPromise(function(_0x250b68,_0x263f04){_0x2ae2d4[_0x906d('0x1d')][_0x906d('0x26')]({'where':{'phone':_0x167462[_0x906d('0xc')],'VoiceQueueId':_0x346fb1['id']}})[_0x906d('0x1b')](function(_0x2e31a0){if(!_[_0x906d('0x27')](_0x2e31a0)){throw new Error(_0x906d('0x28')+_0x167462[_0x906d('0xc')]+_0x906d('0x29')+_0x346fb1['id']);}return _0x2ae2d4['CmHopperFinal'][_0x906d('0x26')]({'where':{'calleridnum':_0x167462[_0x906d('0xc')],'VoiceQueueId':_0x346fb1['id']}});})['then'](function(_0x2183f1){if(!_['isNil'](_0x2183f1)){throw new Error(_0x906d('0x2a')+_0x167462[_0x906d('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x346fb1['id']);}return _0x2ae2d4[_0x906d('0x1d')][_0x906d('0x1e')]({'phone':_0x167462['phone'],'ContactId':_0x167462['id'],'ListId':_0x167462[_0x906d('0x1f')],'priority':_0x167462[_0x906d('0x20')]?_0x167462[_0x906d('0x20')]:0x2,'scheduledat':_0x167462[_0x906d('0x21')]?_0x167462[_0x906d('0x21')]:moment()[_0x906d('0x22')](_0x906d('0x23')),'callback':_0x167462[_0x906d('0x24')]?!![]:![],'callbackuniqueid':_0x167462[_0x906d('0x24')]?_0x167462[_0x906d('0x24')]:undefined,'callbackat':_0x167462[_0x906d('0x24')]?moment()['format'](_0x906d('0x23')):undefined,'VoiceQueueId':_0x346fb1['id']});})[_0x906d('0x25')](function(_0x1c19ab){_0x263f04(_0x1c19ab);});});};function _0x3e24e3(){return function(_0x1866aa){logger[_0x906d('0x17')](_0x906d('0x18'),_0x906d('0x19'),util[_0x906d('0x1a')](_0x1866aa,{'showHidden':![],'depth':null}));};}var _0xa8a283=function(_0x16d38a){return new BPromise(function(_0x40ad8f,_0xdf36a5){_0x2ae2d4[_0x906d('0x1d')]['findOne']({'where':{'phone':_0x167462['phone'],'CampaignId':_0x16d38a['id']}})['then'](function(_0x429d7){if(!_[_0x906d('0x27')](_0x429d7)){throw new Error(_0x906d('0x28')+_0x167462['phone']+_0x906d('0x2b')+_0x16d38a['id']);}return _0x2ae2d4['CmHopper'][_0x906d('0x1e')]({'phone':_0x167462['phone'],'ContactId':_0x167462['id'],'ListId':_0x167462[_0x906d('0x1f')],'priority':_0x167462['priority']?_0x167462[_0x906d('0x20')]:0x2,'scheduledat':_0x167462[_0x906d('0x21')]?_0x167462[_0x906d('0x21')]:moment()[_0x906d('0x22')](_0x906d('0x23')),'callback':_0x167462['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x167462[_0x906d('0x24')]?_0x167462['callbackUniqueid']:undefined,'callbackat':_0x167462[_0x906d('0x24')]?moment()[_0x906d('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x16d38a['id']});})['catch'](function(_0x2dd206){_0xdf36a5(_0x2dd206);});});};var _0x13a5c3=function(_0x22962a){return new BPromise(function(_0x4b7a83,_0x422b15){_0x2ae2d4[_0x906d('0x1d')][_0x906d('0x26')]({'where':{'phone':_0x167462[_0x906d('0xc')],'CampaignId':_0x22962a['id']}})[_0x906d('0x1b')](function(_0x1737cd){if(!_[_0x906d('0x27')](_0x1737cd)){throw new Error(_0x906d('0x28')+_0x167462['phone']+_0x906d('0x2c')+_0x22962a['id']);}return _0x2ae2d4[_0x906d('0x2d')][_0x906d('0x26')]({'where':{'calleridnum':_0x167462[_0x906d('0xc')],'CampaignId':_0x22962a['id']}});})['then'](function(_0x59a27a){if(!_['isNil'](_0x59a27a)){throw new Error(_0x906d('0x2a')+_0x167462[_0x906d('0xc')]+_0x906d('0x2e')+_0x22962a['id']);}return _0x2ae2d4[_0x906d('0x1d')][_0x906d('0x1e')]({'phone':_0x167462[_0x906d('0xc')],'ContactId':_0x167462['id'],'ListId':_0x167462[_0x906d('0x1f')],'priority':_0x167462[_0x906d('0x20')]?_0x167462[_0x906d('0x20')]:0x2,'scheduledat':_0x167462['scheduledat']?_0x167462[_0x906d('0x21')]:moment()[_0x906d('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x167462['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x167462[_0x906d('0x24')]?_0x167462[_0x906d('0x24')]:undefined,'callbackat':_0x167462[_0x906d('0x24')]?moment()[_0x906d('0x22')](_0x906d('0x23')):undefined,'CampaignId':_0x22962a['id']});})[_0x906d('0x25')](function(_0x1549d0){_0x422b15(_0x1549d0);});});};if(_0x167462[_0x906d('0x1f')]){_0x2ae2d4[_0x906d('0x2f')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x906d('0x30')],'include':[{'model':_0x2ae2d4[_0x906d('0x31')],'as':_0x906d('0x32'),'where':{'id':_0x167462[_0x906d('0x1f')]}}]})['then'](function(_0x4f253e){if(_0x4f253e){var _0x2aaa42=[];for(var _0x286676=0x0,_0x25c115;_0x286676<_0x4f253e['length'];_0x286676+=0x1){_0x25c115=_0x4f253e[_0x286676][_0x906d('0x33')]({'plain':!![]});switch(_0x25c115['dialCheckDuplicateType']){case _0x906d('0x34'):_0x18649b(_0x25c115)[_0x906d('0x25')](_0x1253f8());break;case _0x906d('0x35'):_0x39ad47(_0x25c115)[_0x906d('0x25')](_0x1253f8());break;default:_0x2ae2d4[_0x906d('0x1d')][_0x906d('0x1e')]({'phone':_0x167462[_0x906d('0xc')],'ContactId':_0x167462['id'],'ListId':_0x167462[_0x906d('0x1f')],'scheduledat':_0x167462['scheduledat']?_0x167462[_0x906d('0x21')]:moment()['format'](_0x906d('0x23')),'priority':_0x167462[_0x906d('0x20')]?_0x167462[_0x906d('0x20')]:0x2,'callback':_0x167462['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x167462[_0x906d('0x24')]?_0x167462[_0x906d('0x24')]:undefined,'callbackat':_0x167462[_0x906d('0x24')]?moment()[_0x906d('0x22')](_0x906d('0x23')):undefined,'VoiceQueueId':_0x25c115['id']})[_0x906d('0x25')](_0x1253f8());}}}})['then'](function(){return _0x2ae2d4[_0x906d('0x2f')][_0x906d('0x36')]({'where':{'type':_0x906d('0x37')},'attributes':['id'],'include':[{'model':_0x2ae2d4[_0x906d('0x31')],'as':_0x906d('0x38'),'where':{'id':_0x167462[_0x906d('0x1f')]}}]})[_0x906d('0x1b')](function(_0x1e7494){if(_0x1e7494){var _0x5f97f4=[];for(var _0x45fa8d=0x0,_0x232bfe;_0x45fa8d<_0x1e7494[_0x906d('0x39')];_0x45fa8d+=0x1){_0x232bfe=_0x1e7494[_0x45fa8d][_0x906d('0x33')]({'plain':!![]});_0x2ae2d4[_0x906d('0x3a')][_0x906d('0x1e')]({'phone':_0x167462['phone'],'ContactId':_0x167462['id'],'ListId':_0x167462[_0x906d('0x1f')],'VoiceQueueId':_0x232bfe['id']})[_0x906d('0x25')](function(_0x43a4af){logger['error'](_0x906d('0x3b'),_0x906d('0x19'),_0x43a4af[_0x906d('0x3c')]);});}}});})[_0x906d('0x1b')](function(){return _0x2ae2d4[_0x906d('0x3d')][_0x906d('0x36')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0x2ae2d4[_0x906d('0x31')],'as':'Lists','where':{'id':_0x167462['ListId']}}]})['then'](function(_0x304cf6){if(_0x304cf6){var _0x27b3f5=[];for(var _0x31ea76=0x0,_0x178271;_0x31ea76<_0x304cf6[_0x906d('0x39')];_0x31ea76+=0x1){_0x178271=_0x304cf6[_0x31ea76][_0x906d('0x33')]({'plain':!![]});switch(_0x178271['dialCheckDuplicateType']){case _0x906d('0x34'):_0x13a5c3(_0x178271)[_0x906d('0x25')](_0x3e24e3());break;case _0x906d('0x35'):_0xa8a283(_0x178271)[_0x906d('0x25')](_0x3e24e3());break;default:_0x2ae2d4[_0x906d('0x1d')][_0x906d('0x1e')]({'phone':_0x167462['phone'],'ContactId':_0x167462['id'],'ListId':_0x167462[_0x906d('0x1f')],'scheduledat':_0x167462[_0x906d('0x21')]?_0x167462[_0x906d('0x21')]:moment()[_0x906d('0x22')](_0x906d('0x23')),'priority':_0x167462['priority']?_0x167462['priority']:0x2,'callback':_0x167462[_0x906d('0x24')]?!![]:![],'callbackuniqueid':_0x167462['callbackUniqueid']?_0x167462[_0x906d('0x24')]:undefined,'callbackat':_0x167462[_0x906d('0x24')]?moment()['format'](_0x906d('0x23')):undefined,'CampaignId':_0x178271['id']})[_0x906d('0x25')](_0x3e24e3());}}}});})[_0x906d('0x1b')](function(){return _0x2ae2d4[_0x906d('0x3d')]['findAll']({'attributes':['id'],'include':[{'model':_0x2ae2d4['CmList'],'as':'BlackLists','where':{'id':_0x167462['ListId']}}]})[_0x906d('0x1b')](function(_0x4fdc98){if(_0x4fdc98){var _0xb6f3d2=[];for(var _0xd80eef=0x0,_0x5e421e;_0xd80eef<_0x4fdc98['length'];_0xd80eef+=0x1){_0x5e421e=_0x4fdc98[_0xd80eef][_0x906d('0x33')]({'plain':!![]});_0x2ae2d4[_0x906d('0x3a')][_0x906d('0x1e')]({'phone':_0x167462[_0x906d('0xc')],'ContactId':_0x167462['id'],'ListId':_0x167462[_0x906d('0x1f')],'CampaignId':_0x5e421e['id']})[_0x906d('0x25')](function(_0x5ad47c){logger['error'](_0x906d('0x3b'),_0x906d('0x19'),_0x5ad47c[_0x906d('0x3c')]);});}}});})['then'](function(){_0x130c8c();})[_0x906d('0x25')](function(_0x5d0bd9){logger['error'](_0x906d('0x3b'),'afterCreate',_0x5d0bd9['message']);_0x130c8c(_0x5d0bd9);});}else{_0x130c8c(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x24717a,_0x27e444,_0x1eadfb){var _0x3242fd=_0x2e0a10[_0x906d('0x16')];var _0x3b105e=_0x24717a[_0x906d('0x33')]({'plain':!![]});return _0x3242fd[_0x906d('0x1d')]['findAll']({'raw':!![],'where':{'ListId':_0x3b105e[_0x906d('0x1f')],'ContactId':_0x3b105e['id']}})[_0x906d('0x1b')](function(_0x322e9a){if(!_[_0x906d('0x3e')](_0x322e9a)){var _0x53e863=[];for(var _0x568aa0=0x0;_0x568aa0<_0x322e9a['length'];_0x568aa0+=0x1){var _0x4b8562=_0x3242fd[_0x906d('0x1d')][_0x906d('0x3f')]({'where':{'ListId':_0x322e9a[_0x568aa0]['ListId'],'ContactId':_0x322e9a[_0x568aa0]['ContactId'],'VoiceQueueId':_0x322e9a[_0x568aa0]['VoiceQueueId'],'CampaignId':_0x322e9a[_0x568aa0][_0x906d('0x40')]}});_0x53e863['push'](_0x4b8562);}return BPromise[_0x906d('0x41')](_0x53e863);}})[_0x906d('0x1b')](function(_0x3d9ffb){logger[_0x906d('0x42')](_0x906d('0x43'),util[_0x906d('0x1a')](_0x3d9ffb,{'showHidden':![],'depth':null}));_0x1eadfb();})[_0x906d('0x25')](function(_0x53697e){logger[_0x906d('0x17')](_0x906d('0x44'),util[_0x906d('0x1a')](_0x53697e,{'showHidden':![],'depth':null}));_0x1eadfb(_0x53697e);});}}});};
\ No newline at end of file
index 7d17771..f408c13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a9f=['http','redis','defaults','localhost','./cmContact.socket','CmContact,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CmContact','findAll','options','raw','where','attributes','include','map','then','GetCmContact','CreateCmContact','create','body','length','keys','startsWith','cf_','update','table','set','id\x20=\x20?','toString','sequelize','stringify','lodash','moment','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ea909,_0x334ac1){var _0x56e642=function(_0x59f60e){while(--_0x59f60e){_0x4ea909['push'](_0x4ea909['shift']());}};_0x56e642(++_0x334ac1);}(_0x4a9f,0x8a));var _0xf4a9=function(_0x43ee63,_0x369640){_0x43ee63=_0x43ee63-0x0;var _0x5bbb1e=_0x4a9f[_0x43ee63];return _0x5bbb1e;};'use strict';var _=require(_0xf4a9('0x0'));var util=require('util');var moment=require(_0xf4a9('0x1'));var BPromise=require(_0xf4a9('0x2'));var rs=require(_0xf4a9('0x3'));var fs=require('fs');var Redis=require(_0xf4a9('0x4'));var squel=require(_0xf4a9('0x5'));var db=require(_0xf4a9('0x6'))['db'];var utils=require(_0xf4a9('0x7'));var logger=require('../../config/logger')(_0xf4a9('0x8'));var config=require(_0xf4a9('0x9'));var jayson=require(_0xf4a9('0xa'));var client=jayson[_0xf4a9('0xb')][_0xf4a9('0xc')]({'port':0x232a});config[_0xf4a9('0xd')]=_[_0xf4a9('0xe')](config[_0xf4a9('0xd')],{'host':_0xf4a9('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf4a9('0xd')]));require(_0xf4a9('0x10'))['register'](socket);function respondWithRpcPromise(_0x431ba3,_0x5039c0,_0x41dc72){return new BPromise(function(_0x3a194b,_0x16b392){return client['request'](_0x431ba3,_0x41dc72)['then'](function(_0xeb2c06){logger['info'](_0xf4a9('0x11'),_0x5039c0,_0xf4a9('0x12'));logger[_0xf4a9('0x13')]('CmContact,\x20%s,\x20%s,\x20%s',_0x5039c0,_0xf4a9('0x12'),JSON['stringify'](_0xeb2c06));if(_0xeb2c06['error']){if(_0xeb2c06[_0xf4a9('0x14')][_0xf4a9('0x15')]===0x1f4){logger[_0xf4a9('0x14')](_0xf4a9('0x11'),_0x5039c0,_0xeb2c06[_0xf4a9('0x14')][_0xf4a9('0x16')]);return _0x16b392(_0xeb2c06[_0xf4a9('0x14')][_0xf4a9('0x16')]);}logger[_0xf4a9('0x14')](_0xf4a9('0x11'),_0x5039c0,_0xeb2c06[_0xf4a9('0x14')][_0xf4a9('0x16')]);return _0x3a194b(_0xeb2c06[_0xf4a9('0x14')][_0xf4a9('0x16')]);}else{logger[_0xf4a9('0x17')](_0xf4a9('0x11'),_0x5039c0,_0xf4a9('0x12'));_0x3a194b(_0xeb2c06[_0xf4a9('0x18')][_0xf4a9('0x16')]);}})[_0xf4a9('0x19')](function(_0x20157c){logger['error'](_0xf4a9('0x11'),_0x5039c0,_0x20157c);_0x16b392(_0x20157c);});});}exports['GetCmContact']=function(_0x1f67e){var _0x4ff1ee=this;return new Promise(function(_0x8b9cc5,_0x4e623b){return db[_0xf4a9('0x1a')][_0xf4a9('0x1b')]({'raw':_0x1f67e[_0xf4a9('0x1c')]?_0x1f67e[_0xf4a9('0x1c')][_0xf4a9('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f67e['options']?_0x1f67e[_0xf4a9('0x1c')][_0xf4a9('0x1e')]||null:null,'attributes':_0x1f67e[_0xf4a9('0x1c')]?_0x1f67e['options'][_0xf4a9('0x1f')]||null:null,'limit':_0x1f67e[_0xf4a9('0x1c')]?_0x1f67e[_0xf4a9('0x1c')]['limit']||null:null,'include':_0x1f67e[_0xf4a9('0x1c')]?_0x1f67e['options'][_0xf4a9('0x20')]?_['map'](_0x1f67e[_0xf4a9('0x1c')][_0xf4a9('0x20')],function(_0x24b2f9){return{'model':db[_0x24b2f9['model']],'as':_0x24b2f9['as'],'attributes':_0x24b2f9[_0xf4a9('0x1f')],'include':_0x24b2f9[_0xf4a9('0x20')]?_['map'](_0x24b2f9[_0xf4a9('0x20')],function(_0x1eaceb){return{'model':db[_0x1eaceb['model']],'as':_0x1eaceb['as'],'attributes':_0x1eaceb[_0xf4a9('0x1f')],'include':_0x1eaceb[_0xf4a9('0x20')]?_[_0xf4a9('0x21')](_0x1eaceb[_0xf4a9('0x20')],function(_0x12c2b6){return{'model':db[_0x12c2b6['model']],'as':_0x12c2b6['as'],'attributes':_0x12c2b6[_0xf4a9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf4a9('0x22')](function(_0x2fd34d){logger[_0xf4a9('0x17')]('GetCmContact',_0x1f67e);logger[_0xf4a9('0x13')](_0xf4a9('0x23'),_0x1f67e,JSON['stringify'](_0x2fd34d));_0x8b9cc5(_0x2fd34d);})[_0xf4a9('0x19')](function(_0x2b9353){logger[_0xf4a9('0x14')](_0xf4a9('0x23'),_0x2b9353[_0xf4a9('0x16')],_0x1f67e);_0x4e623b(_0x4ff1ee[_0xf4a9('0x14')](0x1f4,_0x2b9353[_0xf4a9('0x16')]));});});};exports[_0xf4a9('0x24')]=function(_0x36b224){var _0x37f285=this;return new Promise(function(_0x175477,_0x1ee970){return db[_0xf4a9('0x1a')][_0xf4a9('0x25')](_0x36b224[_0xf4a9('0x26')],{'raw':_0x36b224[_0xf4a9('0x1c')]?_0x36b224[_0xf4a9('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf4a9('0x22')](function(_0xd1a2ce){var _0x28f7a3;for(var _0x1369ac=0x0;_0x1369ac<Object['keys'](_0x36b224[_0xf4a9('0x26')])[_0xf4a9('0x27')];_0x1369ac++){var _0x4812e4=Object[_0xf4a9('0x28')](_0x36b224[_0xf4a9('0x26')])[_0x1369ac];if(_0x4812e4[_0xf4a9('0x29')](_0xf4a9('0x2a'))){_0x28f7a3=squel[_0xf4a9('0x2b')]()[_0xf4a9('0x2c')]('cm_contacts')[_0xf4a9('0x2d')](_0x4812e4,_0x36b224[_0xf4a9('0x26')][_0x4812e4])[_0xf4a9('0x1e')](_0xf4a9('0x2e'),_0xd1a2ce['id'])[_0xf4a9('0x2f')]();break;}}if(!_0x28f7a3)return _0xd1a2ce;return db[_0xf4a9('0x30')]['query'](_0x28f7a3)[_0xf4a9('0x22')](function(){return _0xd1a2ce;});})[_0xf4a9('0x22')](function(_0x4371d8){logger['info'](_0xf4a9('0x24'),_0x36b224);logger[_0xf4a9('0x13')](_0xf4a9('0x24'),_0x36b224,JSON[_0xf4a9('0x31')](_0x4371d8));_0x175477(_0x4371d8);})['catch'](function(_0x2b61c7){logger[_0xf4a9('0x14')]('CreateCmContact',_0x2b61c7[_0xf4a9('0x16')],_0x36b224);_0x1ee970(_0x37f285[_0xf4a9('0x14')](0x1f4,_0x2b61c7['message']));});});};
\ No newline at end of file
+var _0x0163=['./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','debug','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CmContact','findAll','options','raw','where','attributes','limit','include','map','model','GetCmContact','catch','CreateCmContact','create','keys','length','cf_','update','table','cm_contacts','body','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','ioredis','squel','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x37c060,_0x4c7a56){var _0x4ec028=function(_0x47c786){while(--_0x47c786){_0x37c060['push'](_0x37c060['shift']());}};_0x4ec028(++_0x4c7a56);}(_0x0163,0xfb));var _0x3016=function(_0x597ca8,_0x27a8e1){_0x597ca8=_0x597ca8-0x0;var _0x48379f=_0x0163[_0x597ca8];return _0x48379f;};'use strict';var _=require(_0x3016('0x0'));var util=require(_0x3016('0x1'));var moment=require(_0x3016('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3016('0x3'));var squel=require(_0x3016('0x4'));var db=require(_0x3016('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3016('0x6'))(_0x3016('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3016('0x8')][_0x3016('0x9')]({'port':0x232a});config['redis']=_[_0x3016('0xa')](config[_0x3016('0xb')],{'host':_0x3016('0xc'),'port':0x18eb});var socket=require(_0x3016('0xd'))(new Redis(config[_0x3016('0xb')]));require(_0x3016('0xe'))[_0x3016('0xf')](socket);function respondWithRpcPromise(_0x26ce29,_0x186cfe,_0x17476b){return new BPromise(function(_0x3d8966,_0x324771){return client[_0x3016('0x10')](_0x26ce29,_0x17476b)[_0x3016('0x11')](function(_0x3d78ff){logger[_0x3016('0x12')](_0x3016('0x13'),_0x186cfe,'request\x20sent');logger[_0x3016('0x14')](_0x3016('0x15'),_0x186cfe,_0x3016('0x16'),JSON[_0x3016('0x17')](_0x3d78ff));if(_0x3d78ff[_0x3016('0x18')]){if(_0x3d78ff[_0x3016('0x18')][_0x3016('0x19')]===0x1f4){logger['error']('CmContact,\x20%s,\x20%s',_0x186cfe,_0x3d78ff[_0x3016('0x18')][_0x3016('0x1a')]);return _0x324771(_0x3d78ff['error'][_0x3016('0x1a')]);}logger[_0x3016('0x18')]('CmContact,\x20%s,\x20%s',_0x186cfe,_0x3d78ff['error'][_0x3016('0x1a')]);return _0x3d8966(_0x3d78ff[_0x3016('0x18')]['message']);}else{logger[_0x3016('0x12')]('CmContact,\x20%s,\x20%s',_0x186cfe,_0x3016('0x16'));_0x3d8966(_0x3d78ff[_0x3016('0x1b')][_0x3016('0x1a')]);}})['catch'](function(_0x3160df){logger[_0x3016('0x18')](_0x3016('0x13'),_0x186cfe,_0x3160df);_0x324771(_0x3160df);});});}exports['GetCmContact']=function(_0x21411c){var _0xb43c32=this;return new Promise(function(_0xf03da2,_0x1ef040){return db[_0x3016('0x1c')][_0x3016('0x1d')]({'raw':_0x21411c[_0x3016('0x1e')]?_0x21411c[_0x3016('0x1e')][_0x3016('0x1f')]===undefined?!![]:![]:!![],'where':_0x21411c[_0x3016('0x1e')]?_0x21411c[_0x3016('0x1e')][_0x3016('0x20')]||null:null,'attributes':_0x21411c[_0x3016('0x1e')]?_0x21411c[_0x3016('0x1e')][_0x3016('0x21')]||null:null,'limit':_0x21411c['options']?_0x21411c['options'][_0x3016('0x22')]||null:null,'include':_0x21411c['options']?_0x21411c[_0x3016('0x1e')][_0x3016('0x23')]?_[_0x3016('0x24')](_0x21411c[_0x3016('0x1e')]['include'],function(_0x30aade){return{'model':db[_0x30aade[_0x3016('0x25')]],'as':_0x30aade['as'],'attributes':_0x30aade['attributes'],'include':_0x30aade['include']?_['map'](_0x30aade['include'],function(_0x2deaf0){return{'model':db[_0x2deaf0[_0x3016('0x25')]],'as':_0x2deaf0['as'],'attributes':_0x2deaf0[_0x3016('0x21')],'include':_0x2deaf0[_0x3016('0x23')]?_[_0x3016('0x24')](_0x2deaf0['include'],function(_0x4e3e88){return{'model':db[_0x4e3e88[_0x3016('0x25')]],'as':_0x4e3e88['as'],'attributes':_0x4e3e88[_0x3016('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1852ec){logger[_0x3016('0x12')]('GetCmContact',_0x21411c);logger['debug'](_0x3016('0x26'),_0x21411c,JSON[_0x3016('0x17')](_0x1852ec));_0xf03da2(_0x1852ec);})[_0x3016('0x27')](function(_0x23f648){logger['error']('GetCmContact',_0x23f648[_0x3016('0x1a')],_0x21411c);_0x1ef040(_0xb43c32['error'](0x1f4,_0x23f648[_0x3016('0x1a')]));});});};exports[_0x3016('0x28')]=function(_0x167cc7){var _0x1e321f=this;return new Promise(function(_0x2cae64,_0x5cc97c){return db[_0x3016('0x1c')][_0x3016('0x29')](_0x167cc7['body'],{'raw':_0x167cc7[_0x3016('0x1e')]?_0x167cc7[_0x3016('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5892dc){var _0x209c24;for(var _0x187890=0x0;_0x187890<Object[_0x3016('0x2a')](_0x167cc7['body'])[_0x3016('0x2b')];_0x187890++){var _0x3f8dfb=Object['keys'](_0x167cc7['body'])[_0x187890];if(_0x3f8dfb['startsWith'](_0x3016('0x2c'))){_0x209c24=squel[_0x3016('0x2d')]()[_0x3016('0x2e')](_0x3016('0x2f'))['set'](_0x3f8dfb,_0x167cc7[_0x3016('0x30')][_0x3f8dfb])[_0x3016('0x20')](_0x3016('0x31'),_0x5892dc['id'])[_0x3016('0x32')]();break;}}if(!_0x209c24)return _0x5892dc;return db[_0x3016('0x33')][_0x3016('0x34')](_0x209c24)[_0x3016('0x11')](function(){return _0x5892dc;});})[_0x3016('0x11')](function(_0x53509d){logger[_0x3016('0x12')](_0x3016('0x28'),_0x167cc7);logger[_0x3016('0x14')](_0x3016('0x28'),_0x167cc7,JSON[_0x3016('0x17')](_0x53509d));_0x2cae64(_0x53509d);})[_0x3016('0x27')](function(_0x561921){logger[_0x3016('0x18')]('CreateCmContact',_0x561921['message'],_0x167cc7);_0x5cc97c(_0x1e321f[_0x3016('0x18')](0x1f4,_0x561921[_0x3016('0x1a')]));});});};
\ No newline at end of file
index 7371d25..6d8ffec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 d8c51f6..9a07217 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a39=['server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','file','uploadCsv','/upload','single','upload','/upload/:id','put','update','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','merge','create','post','/create_many','setTags','diskStorage','join','root'];(function(_0xecb645,_0x580922){var _0x150a23=function(_0x188f3b){while(--_0x188f3b){_0xecb645['push'](_0xecb645['shift']());}};_0x150a23(++_0x580922);}(_0x0a39,0xd3));var _0x90a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0a39[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x90a3('0x0'));var util=require(_0x90a3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x90a3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90a3('0x3'));var interaction=require(_0x90a3('0x4'));var config=require(_0x90a3('0x5'));var controller=require('./cmContact.controller');router['get']('/',auth[_0x90a3('0x6')](),controller[_0x90a3('0x7')]);router[_0x90a3('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x90a3('0x9')]);router[_0x90a3('0x8')](_0x90a3('0xa'),auth[_0x90a3('0x6')](),controller['show']);router[_0x90a3('0x8')](_0x90a3('0xb'),auth[_0x90a3('0x6')](),controller[_0x90a3('0xc')]);router[_0x90a3('0x8')](_0x90a3('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x90a3('0x8')](_0x90a3('0xe'),auth[_0x90a3('0x6')](),controller[_0x90a3('0xf')]);router['get'](_0x90a3('0x10'),auth[_0x90a3('0x6')](),controller[_0x90a3('0x11')]);router['get'](_0x90a3('0x12'),auth['isAuthenticated'](),controller[_0x90a3('0x13')]);router['get'](_0x90a3('0x14'),auth[_0x90a3('0x6')](),controller['getJourney']);router['post']('/merge',auth[_0x90a3('0x6')](),controller[_0x90a3('0x15')]);router['post']('/',auth[_0x90a3('0x6')](),controller[_0x90a3('0x16')]);router[_0x90a3('0x17')](_0x90a3('0x18'),auth[_0x90a3('0x6')](),controller['bulkCreate']);router[_0x90a3('0x17')]('/:id/tags',auth[_0x90a3('0x6')](),controller[_0x90a3('0x19')]);var upload=multer({'storage':multer[_0x90a3('0x1a')]({'destination':function(_0x44fc7c,_0x5f1fa2,_0x59942c){_0x59942c(null,path[_0x90a3('0x1b')](config[_0x90a3('0x1c')],_0x90a3('0x1d')));},'filename':function(_0x40967d,_0x4c3e53,_0x4471a5){_0x4c3e53[_0x90a3('0x1e')]=_0x4c3e53[_0x90a3('0x1e')][_0x90a3('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4471a5(null,util[_0x90a3('0x20')](_0x90a3('0x21'),path[_0x90a3('0x22')](_0x4c3e53[_0x90a3('0x1e')],path[_0x90a3('0x23')](_0x4c3e53[_0x90a3('0x1e')])),Date[_0x90a3('0x24')](),path['extname'](_0x4c3e53['originalname'])));}})});router[_0x90a3('0x17')](_0x90a3('0x25'),upload['single'](_0x90a3('0x26')),controller[_0x90a3('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x57e87a,_0x5049ce,_0x256436){_0x256436(null,path[_0x90a3('0x1b')](config[_0x90a3('0x1c')],_0x90a3('0x1d')));},'filename':function(_0xe2b3e6,_0x492bf7,_0x3e102e){_0x492bf7['originalname']=_0x492bf7[_0x90a3('0x1e')][_0x90a3('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3e102e(null,util[_0x90a3('0x20')](_0x90a3('0x21'),path['basename'](_0x492bf7[_0x90a3('0x1e')],path[_0x90a3('0x23')](_0x492bf7[_0x90a3('0x1e')])),Date[_0x90a3('0x24')](),path[_0x90a3('0x23')](_0x492bf7[_0x90a3('0x1e')])));}})});router[_0x90a3('0x17')](_0x90a3('0x28'),upload[_0x90a3('0x29')](_0x90a3('0x26')),controller[_0x90a3('0x2a')]);router[_0x90a3('0x17')](_0x90a3('0x2b'),auth[_0x90a3('0x6')](),controller['import']);router[_0x90a3('0x2c')]('/:id',auth['isAuthenticated'](),controller[_0x90a3('0x2d')]);router['delete'](_0x90a3('0xa'),auth['isAuthenticated'](),controller[_0x90a3('0x2e')]);module[_0x90a3('0x2f')]=router;
\ No newline at end of file
+var _0x806b=['now','/upload','upload','/upload/:id','import','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','/describe','isAuthenticated','describe','show','/:id/tags','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','bulkCreate','setTags','diskStorage','join','server/files/tmp','originalname','replace','%s-%s%s','extname','/csv','single','file','uploadCsv','root','format','basename'];(function(_0x2001d5,_0x586a7a){var _0x4c52d4=function(_0x5b7379){while(--_0x5b7379){_0x2001d5['push'](_0x2001d5['shift']());}};_0x4c52d4(++_0x586a7a);}(_0x806b,0x16f));var _0xb806=function(_0x3801a5,_0xc4d4b6){_0x3801a5=_0x3801a5-0x0;var _0x8e4b0c=_0x806b[_0x3801a5];return _0x8e4b0c;};'use strict';var multer=require(_0xb806('0x0'));var util=require(_0xb806('0x1'));var path=require(_0xb806('0x2'));var timeout=require(_0xb806('0x3'));var express=require('express');var router=express[_0xb806('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb806('0x5'));var interaction=require(_0xb806('0x6'));var config=require('../../config/environment');var controller=require(_0xb806('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb806('0x8')](_0xb806('0x9'),auth[_0xb806('0xa')](),controller[_0xb806('0xb')]);router['get']('/:id',auth[_0xb806('0xa')](),controller[_0xb806('0xc')]);router[_0xb806('0x8')](_0xb806('0xd'),auth[_0xb806('0xa')](),controller['getTags']);router[_0xb806('0x8')](_0xb806('0xe'),auth['isAuthenticated'](),controller[_0xb806('0xf')]);router['get']('/:id/hopper_histories',auth[_0xb806('0xa')](),controller[_0xb806('0x10')]);router[_0xb806('0x8')](_0xb806('0x11'),auth[_0xb806('0xa')](),controller[_0xb806('0x12')]);router['get']('/:id/jscripty_sessions',auth[_0xb806('0xa')](),controller[_0xb806('0x13')]);router[_0xb806('0x8')](_0xb806('0x14'),auth[_0xb806('0xa')](),controller[_0xb806('0x15')]);router[_0xb806('0x16')](_0xb806('0x17'),auth['isAuthenticated'](),controller[_0xb806('0x18')]);router[_0xb806('0x16')]('/',auth[_0xb806('0xa')](),controller['create']);router['post']('/create_many',auth[_0xb806('0xa')](),controller[_0xb806('0x19')]);router[_0xb806('0x16')]('/:id/tags',auth[_0xb806('0xa')](),controller[_0xb806('0x1a')]);var upload=multer({'storage':multer[_0xb806('0x1b')]({'destination':function(_0xf7d0f8,_0x4414e1,_0x2c423a){_0x2c423a(null,path[_0xb806('0x1c')](config['root'],_0xb806('0x1d')));},'filename':function(_0x3256f1,_0x559e45,_0x57037e){_0x559e45[_0xb806('0x1e')]=_0x559e45[_0xb806('0x1e')][_0xb806('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57037e(null,util['format'](_0xb806('0x20'),path['basename'](_0x559e45['originalname'],path['extname'](_0x559e45['originalname'])),Date['now'](),path[_0xb806('0x21')](_0x559e45[_0xb806('0x1e')])));}})});router[_0xb806('0x16')](_0xb806('0x22'),upload[_0xb806('0x23')](_0xb806('0x24')),controller[_0xb806('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc2d823,_0x1a07e1,_0x2a908f){_0x2a908f(null,path[_0xb806('0x1c')](config[_0xb806('0x26')],'server/files/tmp'));},'filename':function(_0x158508,_0x349f70,_0x3ffdab){_0x349f70[_0xb806('0x1e')]=_0x349f70[_0xb806('0x1e')][_0xb806('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ffdab(null,util[_0xb806('0x27')](_0xb806('0x20'),path[_0xb806('0x28')](_0x349f70[_0xb806('0x1e')],path[_0xb806('0x21')](_0x349f70[_0xb806('0x1e')])),Date[_0xb806('0x29')](),path[_0xb806('0x21')](_0x349f70['originalname'])));}})});router[_0xb806('0x16')](_0xb806('0x2a'),upload[_0xb806('0x23')]('file'),controller[_0xb806('0x2b')]);router[_0xb806('0x16')](_0xb806('0x2c'),auth[_0xb806('0xa')](),controller[_0xb806('0x2d')]);router['put'](_0xb806('0x2e'),auth[_0xb806('0xa')](),controller[_0xb806('0x2f')]);router[_0xb806('0x30')](_0xb806('0x2e'),auth[_0xb806('0xa')](),controller[_0xb806('0x31')]);module[_0xb806('0x32')]=router;
\ No newline at end of file
index 2d2b016..2eba4ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc82d=['alias','STRING','setDataValue','name','TEXT','type','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x3311ae,_0x362cee){var _0x107949=function(_0x2082a3){while(--_0x2082a3){_0x3311ae['push'](_0x3311ae['shift']());}};_0x107949(++_0x362cee);}(_0xc82d,0x6c));var _0xdc82=function(_0x3e5e03,_0x2fac27){_0x3e5e03=_0x3e5e03-0x0;var _0x45279e=_0xc82d[_0x3e5e03];return _0x45279e;};'use strict';var Sequelize=require(_0xdc82('0x0'));var _=require('lodash');module[_0xdc82('0x1')]={'name':{'type':Sequelize[_0xdc82('0x2')],'get':function(_0x194b33){return this[_0xdc82('0x3')](_0xdc82('0x4'));}},'alias':{'type':Sequelize[_0xdc82('0x5')],'allowNull':![],'set':function(_0x5351f4){this[_0xdc82('0x6')](_0xdc82('0x4'),_0x5351f4?_0x5351f4:this[_0xdc82('0x3')](_0xdc82('0x7')));}},'type':{'type':Sequelize[_0xdc82('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xdc82('0x8')]('long'),'get':function(){if(this[_0xdc82('0x3')](_0xdc82('0x9'))==='select'){return JSON['parse'](this[_0xdc82('0x3')]('values'));}else{return this[_0xdc82('0x3')](_0xdc82('0xa'));}},'set':function(_0x126ad6){if(Array[_0xdc82('0xb')](_0x126ad6)){this[_0xdc82('0x6')](_0xdc82('0xa'),JSON[_0xdc82('0xc')](_0x126ad6));}else{this[_0xdc82('0x6')](_0xdc82('0xa'),_0x126ad6);}}},'required':{'type':Sequelize[_0xdc82('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xdc82('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xdc82('0xe')](_0xdc82('0xf'))}};
\ No newline at end of file
+var _0xc65c=['VIRTUAL','getDataValue','alias','setDataValue','STRING','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','lodash','exports'];(function(_0x57ac3b,_0x32e884){var _0x4204c9=function(_0x54a70e){while(--_0x54a70e){_0x57ac3b['push'](_0x57ac3b['shift']());}};_0x4204c9(++_0x32e884);}(_0xc65c,0x19e));var _0xcc65=function(_0x110c20,_0x55f872){_0x110c20=_0x110c20-0x0;var _0x382800=_0xc65c[_0x110c20];return _0x382800;};'use strict';var Sequelize=require('sequelize');var _=require(_0xcc65('0x0'));module[_0xcc65('0x1')]={'name':{'type':Sequelize[_0xcc65('0x2')],'get':function(_0x3ab83f){return this[_0xcc65('0x3')](_0xcc65('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x10ddbb){this[_0xcc65('0x5')](_0xcc65('0x4'),_0x10ddbb?_0x10ddbb:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0xcc65('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xcc65('0x7')),'get':function(){if(this[_0xcc65('0x3')](_0xcc65('0x8'))===_0xcc65('0x9')){return JSON[_0xcc65('0xa')](this[_0xcc65('0x3')](_0xcc65('0xb')));}else{return this[_0xcc65('0x3')](_0xcc65('0xb'));}},'set':function(_0x571c8e){if(Array[_0xcc65('0xc')](_0x571c8e)){this[_0xcc65('0x5')]('values',JSON[_0xcc65('0xd')](_0x571c8e));}else{this['setDataValue'](_0xcc65('0xb'),_0x571c8e);}}},'required':{'type':Sequelize[_0xcc65('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xcc65('0xf')]('voice')}};
\ No newline at end of file
index 163a50c..45032ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c09=['fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','end','error','name','index','map','CmCustomField','rawAttributes','fieldName','type','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','body','transaction','create','Sequelize','TEXT','text','number','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x5eae30,_0x3ca43a){var _0x5ebd00=function(_0x2f4745){while(--_0x2f4745){_0x5eae30['push'](_0x5eae30['shift']());}};_0x5ebd00(++_0x3ca43a);}(_0x5c09,0x143));var _0x95c0=function(_0x8d52f5,_0xfc466e){_0x8d52f5=_0x8d52f5-0x0;var _0x1af4c1=_0x5c09[_0x8d52f5];return _0x1af4c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95c0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95c0('0x1'));var rp=require(_0x95c0('0x2'));var moment=require('moment');var BPromise=require(_0x95c0('0x3'));var Mustache=require(_0x95c0('0x4'));var util=require(_0x95c0('0x5'));var path=require(_0x95c0('0x6'));var sox=require('sox');var csv=require(_0x95c0('0x7'));var ejs=require(_0x95c0('0x8'));var fs=require('fs');var fs_extra=require(_0x95c0('0x9'));var _=require(_0x95c0('0xa'));var squel=require(_0x95c0('0xb'));var crypto=require('crypto');var jsforce=require(_0x95c0('0xc'));var deskjs=require(_0x95c0('0xd'));var toCsv=require(_0x95c0('0x7'));var querystring=require(_0x95c0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x95c0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95c0('0x10'));var logger=require(_0x95c0('0x11'))(_0x95c0('0x12'));var utils=require(_0x95c0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x95c0('0x14'));var db=require(_0x95c0('0x15'))['db'];function respondWithStatusCode(_0x46582a,_0x1c2e91){_0x1c2e91=_0x1c2e91||0xcc;return function(_0x1e693d){if(_0x1e693d){return _0x46582a[_0x95c0('0x16')](_0x1c2e91);}return _0x46582a[_0x95c0('0x17')](_0x1c2e91)['end']();};}function respondWithResult(_0x297991,_0x25b13f){_0x25b13f=_0x25b13f||0xc8;return function(_0x194569){if(_0x194569){return _0x297991[_0x95c0('0x17')](_0x25b13f)[_0x95c0('0x18')](_0x194569);}};}function respondWithFilteredResult(_0x58396e,_0x1f33b9){return function(_0x2ff165){if(_0x2ff165){var _0x293a40=typeof _0x1f33b9[_0x95c0('0x19')]===_0x95c0('0x1a')&&typeof _0x1f33b9[_0x95c0('0x1b')]===_0x95c0('0x1a');var _0x50e950=_0x2ff165[_0x95c0('0x1c')];var _0x4490e6=_0x293a40?0x0:_0x1f33b9['offset'];var _0x5a430f=_0x293a40?_0x2ff165[_0x95c0('0x1c')]:_0x1f33b9['offset']+_0x1f33b9[_0x95c0('0x1b')];var _0x409130;if(_0x5a430f>=_0x50e950){_0x5a430f=_0x50e950;_0x409130=0xc8;}else{_0x409130=0xce;}_0x58396e[_0x95c0('0x17')](_0x409130);return _0x58396e['set'](_0x95c0('0x1d'),_0x4490e6+'-'+_0x5a430f+'/'+_0x50e950)[_0x95c0('0x18')](_0x2ff165);}return null;};}function patchUpdates(_0x15fb33){return function(_0x3dabe5){try{jsonpatch[_0x95c0('0x1e')](_0x3dabe5,_0x15fb33,!![]);}catch(_0x23fca7){return BPromise[_0x95c0('0x1f')](_0x23fca7);}return _0x3dabe5['save']();};}function saveUpdates(_0x32538a,_0x204aff){return function(_0x8fccfc){if(_0x8fccfc){return _0x8fccfc[_0x95c0('0x20')](_0x32538a)['then'](function(_0x51971e){return _0x51971e;});}return null;};}function removeEntity(_0x36c98d,_0x26b156){return function(_0x51a3ad){if(_0x51a3ad){return _0x51a3ad[_0x95c0('0x21')]()[_0x95c0('0x22')](function(){_0x36c98d[_0x95c0('0x17')](0xcc)[_0x95c0('0x23')]();});}};}function handleEntityNotFound(_0x466c0a,_0x558156){return function(_0x57c52a){if(!_0x57c52a){_0x466c0a[_0x95c0('0x16')](0x194);}return _0x57c52a;};}function handleError(_0x414706,_0x14f0df){_0x14f0df=_0x14f0df||0x1f4;return function(_0x41c2d4){logger[_0x95c0('0x24')](_0x41c2d4['stack']);if(_0x41c2d4[_0x95c0('0x25')]){delete _0x41c2d4[_0x95c0('0x25')];}_0x414706[_0x95c0('0x17')](_0x14f0df)['send'](_0x41c2d4);};}exports[_0x95c0('0x26')]=function(_0x1f7ebf,_0xeb5799){var _0x46dfe5={},_0x20cbd3={},_0x1cef50={'count':0x0,'rows':[]};var _0x4cb8dd=_[_0x95c0('0x27')](db[_0x95c0('0x28')][_0x95c0('0x29')],function(_0x47f6df){return{'name':_0x47f6df[_0x95c0('0x2a')],'type':_0x47f6df[_0x95c0('0x2b')]['key']};});_0x20cbd3[_0x95c0('0x2c')]=_[_0x95c0('0x2d')](_[_0x95c0('0x27')](_0x4cb8dd,_0x95c0('0x25')),[_0x95c0('0x25')]);_0x20cbd3['query']=_[_0x95c0('0x2e')](_0x1f7ebf[_0x95c0('0x2f')]);_0x20cbd3[_0x95c0('0x30')]=_[_0x95c0('0x31')](_0x20cbd3[_0x95c0('0x2c')],_0x20cbd3[_0x95c0('0x2f')]);_0x46dfe5[_0x95c0('0x32')]=_[_0x95c0('0x31')](_0x20cbd3['model'],qs[_0x95c0('0x33')](_0x1f7ebf[_0x95c0('0x2f')][_0x95c0('0x33')]));_0x46dfe5['attributes']=_0x46dfe5['attributes'][_0x95c0('0x34')]?_0x46dfe5[_0x95c0('0x32')]:_0x20cbd3[_0x95c0('0x2c')];if(!_0x1f7ebf[_0x95c0('0x2f')][_0x95c0('0x35')](_0x95c0('0x36'))){_0x46dfe5[_0x95c0('0x1b')]=qs[_0x95c0('0x1b')](_0x1f7ebf[_0x95c0('0x2f')][_0x95c0('0x1b')]);_0x46dfe5[_0x95c0('0x19')]=qs['offset'](_0x1f7ebf[_0x95c0('0x2f')]['offset']);}_0x46dfe5[_0x95c0('0x37')]=qs[_0x95c0('0x38')](_0x1f7ebf[_0x95c0('0x2f')][_0x95c0('0x38')]);_0x46dfe5[_0x95c0('0x39')]=qs[_0x95c0('0x30')](_['pick'](_0x1f7ebf[_0x95c0('0x2f')],_0x20cbd3[_0x95c0('0x30')]),_0x4cb8dd);if(_0x1f7ebf[_0x95c0('0x2f')][_0x95c0('0x3a')]){_0x46dfe5[_0x95c0('0x39')]=_[_0x95c0('0x3b')](_0x46dfe5[_0x95c0('0x39')],{'$or':_[_0x95c0('0x27')](_0x4cb8dd,function(_0x36a93e){if(_0x36a93e[_0x95c0('0x2b')]!==_0x95c0('0x3c')){var _0xc66ac4={};_0xc66ac4[_0x36a93e['name']]={'$like':'%'+_0x1f7ebf['query'][_0x95c0('0x3a')]+'%'};return _0xc66ac4;}})});}_0x46dfe5=_[_0x95c0('0x3b')]({},_0x46dfe5,_0x1f7ebf['options']);var _0x5d8e8f={'where':_0x46dfe5[_0x95c0('0x39')]};return db[_0x95c0('0x28')][_0x95c0('0x1c')](_0x5d8e8f)[_0x95c0('0x22')](function(_0x2e84c3){_0x1cef50[_0x95c0('0x1c')]=_0x2e84c3;if(_0x1f7ebf[_0x95c0('0x2f')][_0x95c0('0x3d')]){_0x46dfe5[_0x95c0('0x3e')]=[{'all':!![]}];}return db[_0x95c0('0x28')][_0x95c0('0x3f')](_0x46dfe5);})[_0x95c0('0x22')](function(_0x16d5ed){_0x1cef50[_0x95c0('0x40')]=_0x16d5ed;return _0x1cef50;})[_0x95c0('0x22')](respondWithFilteredResult(_0xeb5799,_0x46dfe5))[_0x95c0('0x41')](handleError(_0xeb5799,null));};exports['show']=function(_0x497721,_0xc9ab18){var _0x3f4ae7={'raw':!![],'where':{'id':_0x497721[_0x95c0('0x42')]['id']}},_0x160357={};_0x160357[_0x95c0('0x2c')]=_[_0x95c0('0x2e')](db[_0x95c0('0x28')]['rawAttributes']);_0x160357[_0x95c0('0x2f')]=_[_0x95c0('0x2e')](_0x497721[_0x95c0('0x2f')]);_0x160357[_0x95c0('0x30')]=_[_0x95c0('0x31')](_0x160357[_0x95c0('0x2c')],_0x160357['query']);_0x3f4ae7[_0x95c0('0x32')]=_['intersection'](_0x160357['model'],qs[_0x95c0('0x33')](_0x497721[_0x95c0('0x2f')][_0x95c0('0x33')]));_0x3f4ae7['attributes']=_0x3f4ae7[_0x95c0('0x32')]['length']?_0x3f4ae7[_0x95c0('0x32')]:_0x160357[_0x95c0('0x2c')];if(_0x497721[_0x95c0('0x2f')]['includeAll']){_0x3f4ae7[_0x95c0('0x3e')]=[{'all':!![]}];}_0x3f4ae7=_[_0x95c0('0x3b')]({},_0x3f4ae7,_0x497721[_0x95c0('0x43')]);return db['CmCustomField'][_0x95c0('0x44')](_0x3f4ae7)[_0x95c0('0x22')](handleEntityNotFound(_0xc9ab18,null))[_0x95c0('0x22')](respondWithResult(_0xc9ab18,null))[_0x95c0('0x41')](handleError(_0xc9ab18,null));};exports['update']=function(_0x3e7ef7,_0x5e408b){if(_0x3e7ef7[_0x95c0('0x45')]['id']){delete _0x3e7ef7[_0x95c0('0x45')]['id'];}return db[_0x95c0('0x28')][_0x95c0('0x44')]({'where':{'id':_0x3e7ef7[_0x95c0('0x42')]['id']}})[_0x95c0('0x22')](handleEntityNotFound(_0x5e408b,null))[_0x95c0('0x22')](saveUpdates(_0x3e7ef7[_0x95c0('0x45')],null))[_0x95c0('0x22')](respondWithResult(_0x5e408b,null))['catch'](handleError(_0x5e408b,null));};exports[_0x95c0('0x21')]=function(_0x58777b,_0x2ce294){return db[_0x95c0('0x28')][_0x95c0('0x44')]({'where':{'id':_0x58777b[_0x95c0('0x42')]['id']}})[_0x95c0('0x22')](handleEntityNotFound(_0x2ce294,null))['then'](removeEntity(_0x2ce294,null))[_0x95c0('0x41')](handleError(_0x2ce294,null));};exports['create']=function(_0x25a752,_0xce4c97){var _0x1baab4;return db['sequelize'][_0x95c0('0x46')](function(_0x5e24e7){return db[_0x95c0('0x28')][_0x95c0('0x47')](_0x25a752['body'],{'transaction':_0x5e24e7})[_0x95c0('0x22')](function(_0x3acbe6){_0x1baab4=_0x3acbe6;var _0x5b974f={'type':db[_0x95c0('0x48')][_0x95c0('0x49')],'transaction':_0x5e24e7};switch(_0x25a752[_0x95c0('0x45')][_0x95c0('0x2b')]){case _0x95c0('0x4a'):_0x5b974f[_0x95c0('0x2b')]=db[_0x95c0('0x48')][_0x95c0('0x49')];break;case _0x95c0('0x4b'):_0x5b974f[_0x95c0('0x2b')]=db[_0x95c0('0x48')]['INTEGER'];break;case'switch':_0x5b974f[_0x95c0('0x2b')]=db['Sequelize'][_0x95c0('0x4c')];_0x5b974f[_0x95c0('0x4d')]=![];break;default:}return db[_0x95c0('0x4e')][_0x95c0('0x4f')][_0x95c0('0x50')](_0x95c0('0x51'),util[_0x95c0('0x52')]('cf_%d',_0x1baab4['id']),_0x5b974f);})['then'](function(){return _0x1baab4;});})['then'](respondWithResult(_0xce4c97,0xc9))[_0x95c0('0x41')](handleError(_0xce4c97,null));};
\ No newline at end of file
+var _0x945e=['includeAll','include','findAll','params','fields','options','find','body','catch','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','keys','filters','intersection','attributes','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x4812e7,_0x19c190){var _0x46455a=function(_0x56b02f){while(--_0x56b02f){_0x4812e7['push'](_0x4812e7['shift']());}};_0x46455a(++_0x19c190);}(_0x945e,0xca));var _0xe945=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x945e[_0x53cf8e];return _0x459197;};'use strict';var emlformat=require(_0xe945('0x0'));var rimraf=require(_0xe945('0x1'));var zipdir=require(_0xe945('0x2'));var jsonpatch=require(_0xe945('0x3'));var rp=require(_0xe945('0x4'));var moment=require(_0xe945('0x5'));var BPromise=require(_0xe945('0x6'));var Mustache=require(_0xe945('0x7'));var util=require(_0xe945('0x8'));var path=require('path');var sox=require(_0xe945('0x9'));var csv=require(_0xe945('0xa'));var ejs=require(_0xe945('0xb'));var fs=require('fs');var fs_extra=require(_0xe945('0xc'));var _=require(_0xe945('0xd'));var squel=require(_0xe945('0xe'));var crypto=require(_0xe945('0xf'));var jsforce=require(_0xe945('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe945('0x11'));var Redis=require(_0xe945('0x12'));var authService=require(_0xe945('0x13'));var qs=require(_0xe945('0x14'));var as=require(_0xe945('0x15'));var hardwareService=require(_0xe945('0x16'));var logger=require(_0xe945('0x17'))(_0xe945('0x18'));var utils=require(_0xe945('0x19'));var config=require(_0xe945('0x1a'));var licenseUtil=require(_0xe945('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54266d,_0xb9b789){_0xb9b789=_0xb9b789||0xcc;return function(_0x5d9731){if(_0x5d9731){return _0x54266d[_0xe945('0x1c')](_0xb9b789);}return _0x54266d[_0xe945('0x1d')](_0xb9b789)[_0xe945('0x1e')]();};}function respondWithResult(_0x277a80,_0x123362){_0x123362=_0x123362||0xc8;return function(_0x477827){if(_0x477827){return _0x277a80['status'](_0x123362)[_0xe945('0x1f')](_0x477827);}};}function respondWithFilteredResult(_0x1b0130,_0x4fe162){return function(_0x11d1c3){if(_0x11d1c3){var _0x20042f=typeof _0x4fe162[_0xe945('0x20')]===_0xe945('0x21')&&typeof _0x4fe162[_0xe945('0x22')]===_0xe945('0x21');var _0x5c82f9=_0x11d1c3[_0xe945('0x23')];var _0xfbf1f5=_0x20042f?0x0:_0x4fe162[_0xe945('0x20')];var _0x5c438d=_0x20042f?_0x11d1c3[_0xe945('0x23')]:_0x4fe162[_0xe945('0x20')]+_0x4fe162[_0xe945('0x22')];var _0x23d833;if(_0x5c438d>=_0x5c82f9){_0x5c438d=_0x5c82f9;_0x23d833=0xc8;}else{_0x23d833=0xce;}_0x1b0130[_0xe945('0x1d')](_0x23d833);return _0x1b0130[_0xe945('0x24')]('Content-Range',_0xfbf1f5+'-'+_0x5c438d+'/'+_0x5c82f9)['json'](_0x11d1c3);}return null;};}function patchUpdates(_0x194a4a){return function(_0x4572ab){try{jsonpatch[_0xe945('0x25')](_0x4572ab,_0x194a4a,!![]);}catch(_0x4b3507){return BPromise['reject'](_0x4b3507);}return _0x4572ab[_0xe945('0x26')]();};}function saveUpdates(_0x5bd12e,_0x432d7e){return function(_0x3b1a2c){if(_0x3b1a2c){return _0x3b1a2c[_0xe945('0x27')](_0x5bd12e)['then'](function(_0x4d927c){return _0x4d927c;});}return null;};}function removeEntity(_0x10e890,_0x231673){return function(_0x71fc74){if(_0x71fc74){return _0x71fc74[_0xe945('0x28')]()[_0xe945('0x29')](function(){_0x10e890[_0xe945('0x1d')](0xcc)[_0xe945('0x1e')]();});}};}function handleEntityNotFound(_0x55efc5,_0x260fbc){return function(_0x1aee5b){if(!_0x1aee5b){_0x55efc5[_0xe945('0x1c')](0x194);}return _0x1aee5b;};}function handleError(_0x19307b,_0x246fc2){_0x246fc2=_0x246fc2||0x1f4;return function(_0xc58f1f){logger['error'](_0xc58f1f[_0xe945('0x2a')]);if(_0xc58f1f[_0xe945('0x2b')]){delete _0xc58f1f[_0xe945('0x2b')];}_0x19307b[_0xe945('0x1d')](_0x246fc2)['send'](_0xc58f1f);};}exports[_0xe945('0x2c')]=function(_0x5c0ec9,_0x108868){var _0x3ade55={},_0x5e76f3={},_0x5b002d={'count':0x0,'rows':[]};var _0x430e2f=_[_0xe945('0x2d')](db[_0xe945('0x2e')][_0xe945('0x2f')],function(_0x3d16f7){return{'name':_0x3d16f7[_0xe945('0x30')],'type':_0x3d16f7[_0xe945('0x31')][_0xe945('0x32')]};});_0x5e76f3[_0xe945('0x33')]=_[_0xe945('0x34')](_['map'](_0x430e2f,_0xe945('0x2b')),[_0xe945('0x2b')]);_0x5e76f3['query']=_[_0xe945('0x35')](_0x5c0ec9['query']);_0x5e76f3[_0xe945('0x36')]=_[_0xe945('0x37')](_0x5e76f3['model'],_0x5e76f3['query']);_0x3ade55['attributes']=_['intersection'](_0x5e76f3[_0xe945('0x33')],qs['fields'](_0x5c0ec9['query']['fields']));_0x3ade55[_0xe945('0x38')]=_0x3ade55[_0xe945('0x38')][_0xe945('0x39')]?_0x3ade55[_0xe945('0x38')]:_0x5e76f3['model'];if(!_0x5c0ec9[_0xe945('0x3a')][_0xe945('0x3b')](_0xe945('0x3c'))){_0x3ade55[_0xe945('0x22')]=qs['limit'](_0x5c0ec9['query'][_0xe945('0x22')]);_0x3ade55[_0xe945('0x20')]=qs[_0xe945('0x20')](_0x5c0ec9['query'][_0xe945('0x20')]);}_0x3ade55[_0xe945('0x3d')]=qs[_0xe945('0x3e')](_0x5c0ec9[_0xe945('0x3a')][_0xe945('0x3e')]);_0x3ade55[_0xe945('0x3f')]=qs[_0xe945('0x36')](_[_0xe945('0x40')](_0x5c0ec9[_0xe945('0x3a')],_0x5e76f3['filters']),_0x430e2f);if(_0x5c0ec9['query'][_0xe945('0x41')]){_0x3ade55[_0xe945('0x3f')]=_[_0xe945('0x42')](_0x3ade55[_0xe945('0x3f')],{'$or':_[_0xe945('0x2d')](_0x430e2f,function(_0xe4ea21){if(_0xe4ea21[_0xe945('0x31')]!==_0xe945('0x43')){var _0x21dd0b={};_0x21dd0b[_0xe4ea21['name']]={'$like':'%'+_0x5c0ec9['query']['filter']+'%'};return _0x21dd0b;}})});}_0x3ade55=_[_0xe945('0x42')]({},_0x3ade55,_0x5c0ec9['options']);var _0x2241f5={'where':_0x3ade55[_0xe945('0x3f')]};return db['CmCustomField'][_0xe945('0x23')](_0x2241f5)[_0xe945('0x29')](function(_0x2166a1){_0x5b002d[_0xe945('0x23')]=_0x2166a1;if(_0x5c0ec9[_0xe945('0x3a')][_0xe945('0x44')]){_0x3ade55[_0xe945('0x45')]=[{'all':!![]}];}return db[_0xe945('0x2e')][_0xe945('0x46')](_0x3ade55);})[_0xe945('0x29')](function(_0x4612dc){_0x5b002d['rows']=_0x4612dc;return _0x5b002d;})['then'](respondWithFilteredResult(_0x108868,_0x3ade55))['catch'](handleError(_0x108868,null));};exports['show']=function(_0x4ca906,_0x19f448){var _0x491f23={'raw':!![],'where':{'id':_0x4ca906[_0xe945('0x47')]['id']}},_0x2d21f2={};_0x2d21f2['model']=_[_0xe945('0x35')](db[_0xe945('0x2e')][_0xe945('0x2f')]);_0x2d21f2[_0xe945('0x3a')]=_['keys'](_0x4ca906['query']);_0x2d21f2['filters']=_['intersection'](_0x2d21f2[_0xe945('0x33')],_0x2d21f2[_0xe945('0x3a')]);_0x491f23[_0xe945('0x38')]=_[_0xe945('0x37')](_0x2d21f2[_0xe945('0x33')],qs[_0xe945('0x48')](_0x4ca906[_0xe945('0x3a')][_0xe945('0x48')]));_0x491f23[_0xe945('0x38')]=_0x491f23['attributes'][_0xe945('0x39')]?_0x491f23[_0xe945('0x38')]:_0x2d21f2[_0xe945('0x33')];if(_0x4ca906[_0xe945('0x3a')][_0xe945('0x44')]){_0x491f23['include']=[{'all':!![]}];}_0x491f23=_[_0xe945('0x42')]({},_0x491f23,_0x4ca906[_0xe945('0x49')]);return db[_0xe945('0x2e')][_0xe945('0x4a')](_0x491f23)['then'](handleEntityNotFound(_0x19f448,null))[_0xe945('0x29')](respondWithResult(_0x19f448,null))['catch'](handleError(_0x19f448,null));};exports[_0xe945('0x27')]=function(_0x5873e3,_0x3f3c51){if(_0x5873e3[_0xe945('0x4b')]['id']){delete _0x5873e3[_0xe945('0x4b')]['id'];}return db[_0xe945('0x2e')][_0xe945('0x4a')]({'where':{'id':_0x5873e3[_0xe945('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f3c51,null))[_0xe945('0x29')](saveUpdates(_0x5873e3[_0xe945('0x4b')],null))[_0xe945('0x29')](respondWithResult(_0x3f3c51,null))[_0xe945('0x4c')](handleError(_0x3f3c51,null));};exports[_0xe945('0x28')]=function(_0x189ed0,_0x58344e){return db[_0xe945('0x2e')][_0xe945('0x4a')]({'where':{'id':_0x189ed0[_0xe945('0x47')]['id']}})['then'](handleEntityNotFound(_0x58344e,null))['then'](removeEntity(_0x58344e,null))[_0xe945('0x4c')](handleError(_0x58344e,null));};exports[_0xe945('0x4d')]=function(_0x294a4b,_0x4026d4){var _0x2026a2;return db[_0xe945('0x4e')][_0xe945('0x4f')](function(_0x2fcc7e){return db[_0xe945('0x2e')][_0xe945('0x4d')](_0x294a4b[_0xe945('0x4b')],{'transaction':_0x2fcc7e})[_0xe945('0x29')](function(_0x43df15){_0x2026a2=_0x43df15;var _0x3c8882={'type':db['Sequelize'][_0xe945('0x50')],'transaction':_0x2fcc7e};switch(_0x294a4b[_0xe945('0x4b')][_0xe945('0x31')]){case _0xe945('0x51'):_0x3c8882[_0xe945('0x31')]=db[_0xe945('0x52')][_0xe945('0x50')];break;case _0xe945('0x53'):_0x3c8882[_0xe945('0x31')]=db[_0xe945('0x52')][_0xe945('0x54')];break;case'switch':_0x3c8882[_0xe945('0x31')]=db[_0xe945('0x52')][_0xe945('0x55')];_0x3c8882[_0xe945('0x56')]=![];break;default:}return db[_0xe945('0x4e')][_0xe945('0x57')][_0xe945('0x58')](_0xe945('0x59'),util['format']('cf_%d',_0x2026a2['id']),_0x3c8882);})[_0xe945('0x29')](function(){return _0x2026a2;});})[_0xe945('0x29')](respondWithResult(_0x4026d4,0xc9))[_0xe945('0x4c')](handleError(_0x4026d4,null));};
\ No newline at end of file
index 724a8a1..83e2ba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0582=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x564d04,_0x5d1895){var _0x4a2864=function(_0x1c74b6){while(--_0x1c74b6){_0x564d04['push'](_0x564d04['shift']());}};_0x4a2864(++_0x5d1895);}(_0x0582,0x88));var _0x2058=function(_0x3d07c6,_0x18e5cd){_0x3d07c6=_0x3d07c6-0x0;var _0x240f0e=_0x0582[_0x3d07c6];return _0x240f0e;};'use strict';var _=require(_0x2058('0x0'));var util=require(_0x2058('0x1'));var logger=require(_0x2058('0x2'))(_0x2058('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2058('0x4'));var fs=require('fs');var path=require(_0x2058('0x5'));var rimraf=require(_0x2058('0x6'));var config=require(_0x2058('0x7'));var attributes=require(_0x2058('0x8'));module[_0x2058('0x9')]=function(_0x1229be,_0x292d0c){return _0x1229be[_0x2058('0xa')](_0x2058('0xb'),attributes,{'tableName':_0x2058('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f03=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields'];(function(_0x1cac97,_0x14901b){var _0xc47a1=function(_0xd30b64){while(--_0xd30b64){_0x1cac97['push'](_0x1cac97['shift']());}};_0xc47a1(++_0x14901b);}(_0x7f03,0x8c));var _0x37f0=function(_0x2152f0,_0x726288){_0x2152f0=_0x2152f0-0x0;var _0x3a6558=_0x7f03[_0x2152f0];return _0x3a6558;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x37f0('0x0'));var moment=require(_0x37f0('0x1'));var BPromise=require(_0x37f0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37f0('0x3'));var rimraf=require(_0x37f0('0x4'));var config=require(_0x37f0('0x5'));var attributes=require('./cmCustomField.attributes');module[_0x37f0('0x6')]=function(_0x158ba5,_0x38f4cd){return _0x158ba5[_0x37f0('0x7')](_0x37f0('0x8'),attributes,{'tableName':_0x37f0('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 978c39e..f0766c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf14=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x44700d,_0x3f002d){var _0x52efad=function(_0x8d7db0){while(--_0x8d7db0){_0x44700d['push'](_0x44700d['shift']());}};_0x52efad(++_0x3f002d);}(_0xcf14,0xee));var _0x4cf1=function(_0x288fcd,_0x89483e){_0x288fcd=_0x288fcd-0x0;var _0x454bdf=_0xcf14[_0x288fcd];return _0x454bdf;};'use strict';var _=require(_0x4cf1('0x0'));var util=require('util');var moment=require(_0x4cf1('0x1'));var BPromise=require(_0x4cf1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cf1('0x3'));var db=require(_0x4cf1('0x4'))['db'];var utils=require(_0x4cf1('0x5'));var logger=require(_0x4cf1('0x6'))('rpc');var config=require(_0x4cf1('0x7'));var jayson=require(_0x4cf1('0x8'));var client=jayson[_0x4cf1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34fe59,_0x86650,_0x34d32f){return new BPromise(function(_0x5a1411,_0x3fe669){return client[_0x4cf1('0xa')](_0x34fe59,_0x34d32f)[_0x4cf1('0xb')](function(_0x252cbb){logger[_0x4cf1('0xc')](_0x4cf1('0xd'),_0x86650,_0x4cf1('0xe'));logger[_0x4cf1('0xf')](_0x4cf1('0x10'),_0x86650,'request\x20sent',JSON[_0x4cf1('0x11')](_0x252cbb));if(_0x252cbb[_0x4cf1('0x12')]){if(_0x252cbb[_0x4cf1('0x12')]['code']===0x1f4){logger[_0x4cf1('0x12')](_0x4cf1('0xd'),_0x86650,_0x252cbb[_0x4cf1('0x12')][_0x4cf1('0x13')]);return _0x3fe669(_0x252cbb['error'][_0x4cf1('0x13')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x86650,_0x252cbb['error'][_0x4cf1('0x13')]);return _0x5a1411(_0x252cbb['error'][_0x4cf1('0x13')]);}else{logger[_0x4cf1('0xc')](_0x4cf1('0xd'),_0x86650,'request\x20sent');_0x5a1411(_0x252cbb[_0x4cf1('0x14')][_0x4cf1('0x13')]);}})[_0x4cf1('0x15')](function(_0x328133){logger[_0x4cf1('0x12')](_0x4cf1('0xd'),_0x86650,_0x328133);_0x3fe669(_0x328133);});});}
\ No newline at end of file
+var _0xd963=['error','code','message','CmCustomField,\x20%s,\x20%s','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','stringify'];(function(_0x1c49ab,_0x2eec78){var _0x5b7c05=function(_0x311331){while(--_0x311331){_0x1c49ab['push'](_0x1c49ab['shift']());}};_0x5b7c05(++_0x2eec78);}(_0xd963,0x19c));var _0x3d96=function(_0x3fe440,_0x18d0cb){_0x3fe440=_0x3fe440-0x0;var _0x30cf95=_0xd963[_0x3fe440];return _0x30cf95;};'use strict';var _=require(_0x3d96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d96('0x1'));var rs=require(_0x3d96('0x2'));var fs=require('fs');var Redis=require(_0x3d96('0x3'));var db=require(_0x3d96('0x4'))['db'];var utils=require(_0x3d96('0x5'));var logger=require(_0x3d96('0x6'))('rpc');var config=require(_0x3d96('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3d96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25f3ab,_0x50f956,_0x92394b){return new BPromise(function(_0x562c20,_0x5584cc){return client[_0x3d96('0x9')](_0x25f3ab,_0x92394b)['then'](function(_0x14034e){logger[_0x3d96('0xa')]('CmCustomField,\x20%s,\x20%s',_0x50f956,_0x3d96('0xb'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x50f956,_0x3d96('0xb'),JSON[_0x3d96('0xc')](_0x14034e));if(_0x14034e[_0x3d96('0xd')]){if(_0x14034e[_0x3d96('0xd')][_0x3d96('0xe')]===0x1f4){logger[_0x3d96('0xd')]('CmCustomField,\x20%s,\x20%s',_0x50f956,_0x14034e['error'][_0x3d96('0xf')]);return _0x5584cc(_0x14034e[_0x3d96('0xd')][_0x3d96('0xf')]);}logger[_0x3d96('0xd')](_0x3d96('0x10'),_0x50f956,_0x14034e[_0x3d96('0xd')][_0x3d96('0xf')]);return _0x562c20(_0x14034e[_0x3d96('0xd')]['message']);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x50f956,_0x3d96('0xb'));_0x562c20(_0x14034e['result']['message']);}})['catch'](function(_0x4c8324){logger[_0x3d96('0xd')]('CmCustomField,\x20%s,\x20%s',_0x50f956,_0x4c8324);_0x5584cc(_0x4c8324);});});}
\ No newline at end of file
index 76db9ad..51df46c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb9e=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x533990,_0x21fe8d){var _0x5a5e2a=function(_0x2539c3){while(--_0x2539c3){_0x533990['push'](_0x533990['shift']());}};_0x5a5e2a(++_0x21fe8d);}(_0xeb9e,0x143));var _0xeeb9=function(_0x388060,_0x1559e9){_0x388060=_0x388060-0x0;var _0x1d3844=_0xeb9e[_0x388060];return _0x1d3844;};'use strict';var multer=require('multer');var util=require(_0xeeb9('0x0'));var path=require('path');var timeout=require(_0xeeb9('0x1'));var express=require(_0xeeb9('0x2'));var router=express[_0xeeb9('0x3')]();var fs_extra=require(_0xeeb9('0x4'));var auth=require(_0xeeb9('0x5'));var interaction=require(_0xeeb9('0x6'));var config=require(_0xeeb9('0x7'));var controller=require(_0xeeb9('0x8'));router[_0xeeb9('0x9')]('/',auth[_0xeeb9('0xa')](),controller['index']);router['get'](_0xeeb9('0xb'),auth[_0xeeb9('0xa')](),controller[_0xeeb9('0xc')]);router[_0xeeb9('0xd')]('/',auth[_0xeeb9('0xa')](),controller['create']);router[_0xeeb9('0xe')](_0xeeb9('0xb'),auth[_0xeeb9('0xa')](),controller[_0xeeb9('0xf')]);router[_0xeeb9('0x10')](_0xeeb9('0xb'),auth[_0xeeb9('0xa')](),controller[_0xeeb9('0x11')]);module[_0xeeb9('0x12')]=router;
\ No newline at end of file
+var _0x90b5=['/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x130369,_0x59b244){var _0x4ca8aa=function(_0xf057ee){while(--_0xf057ee){_0x130369['push'](_0x130369['shift']());}};_0x4ca8aa(++_0x59b244);}(_0x90b5,0x139));var _0x590b=function(_0x154980,_0x2710e5){_0x154980=_0x154980-0x0;var _0x55a463=_0x90b5[_0x154980];return _0x55a463;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./cmCustomField.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0xc')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0xe')](_0x590b('0xa'),auth[_0x590b('0x8')](),controller['update']);router[_0x590b('0xf')](_0x590b('0xa'),auth['isAuthenticated'](),controller[_0x590b('0x10')]);module['exports']=router;
\ No newline at end of file
index cabf30c..2c8958e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9cb=['UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','INTEGER'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0xf9cb,0x160));var _0xbf9c=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0xf9cb[_0x2002b3];return _0x2756f0;};'use strict';var moment=require(_0xbf9c('0x0'));var Sequelize=require(_0xbf9c('0x1'));module[_0xbf9c('0x2')]={'phone':{'type':Sequelize[_0xbf9c('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xbf9c('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbf9c('0x5')],'defaultValue':moment()[_0xbf9c('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xbf9c('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xbf9c('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbf9c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbf9c('0x5')]},'priority':{'type':Sequelize[_0xbf9c('0x7')](0x2)[_0xbf9c('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbf9c('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xbf9c('0x7')],'unique':_0xbf9c('0x9')},'ListId':{'type':Sequelize[_0xbf9c('0x7')],'unique':_0xbf9c('0x9')},'UserId':{'type':Sequelize[_0xbf9c('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xbf9c('0x7')],'unique':_0xbf9c('0x9')},'CampaignId':{'type':Sequelize[_0xbf9c('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbf9c('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbf9c('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbf9c('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbf9c('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2b75=['contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x2cdb37,_0x9862be){var _0x1ac131=function(_0x448065){while(--_0x448065){_0x2cdb37['push'](_0x2cdb37['shift']());}};_0x1ac131(++_0x9862be);}(_0x2b75,0xa3));var _0x52b7=function(_0x3cbc00,_0x563224){_0x3cbc00=_0x3cbc00-0x0;var _0x45dfd1=_0x2b75[_0x3cbc00];return _0x45dfd1;};'use strict';var moment=require(_0x52b7('0x0'));var Sequelize=require(_0x52b7('0x1'));module['exports']={'phone':{'type':Sequelize[_0x52b7('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x52b7('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x52b7('0x4')],'defaultValue':moment()[_0x52b7('0x5')](_0x52b7('0x6'))},'countbusyretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x52b7('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x52b7('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x52b7('0x4')]},'priority':{'type':Sequelize[_0x52b7('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x52b7('0x7')],'unique':_0x52b7('0x8')},'ListId':{'type':Sequelize[_0x52b7('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x52b7('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x52b7('0x8')},'CampaignId':{'type':Sequelize[_0x52b7('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0}};
\ No newline at end of file
index 9beb99b..fe8f913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x973f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','filters','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','VoiceQueueId','VoiceQueue','Campaign','CampaignId','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','describe','user','getVoiceQueues','outbound','preview','sequelize','transaction','direction','prev','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','CmCompany','Company','List','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x5b756c,_0x3621b6){var _0x2e0952=function(_0xca7707){while(--_0xca7707){_0x5b756c['push'](_0x5b756c['shift']());}};_0x2e0952(++_0x3621b6);}(_0x973f,0x114));var _0xf973=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x973f[_0x409353];return _0x4f4b59;};'use strict';var emlformat=require(_0xf973('0x0'));var rimraf=require(_0xf973('0x1'));var zipdir=require(_0xf973('0x2'));var jsonpatch=require(_0xf973('0x3'));var rp=require(_0xf973('0x4'));var moment=require(_0xf973('0x5'));var BPromise=require(_0xf973('0x6'));var Mustache=require('mustache');var util=require(_0xf973('0x7'));var path=require('path');var sox=require(_0xf973('0x8'));var csv=require(_0xf973('0x9'));var ejs=require(_0xf973('0xa'));var fs=require('fs');var fs_extra=require(_0xf973('0xb'));var _=require(_0xf973('0xc'));var squel=require(_0xf973('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf973('0x9'));var querystring=require(_0xf973('0xe'));var Papa=require(_0xf973('0xf'));var Redis=require(_0xf973('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf973('0x11'));var hardwareService=require(_0xf973('0x12'));var logger=require('../../config/logger')(_0xf973('0x13'));var utils=require(_0xf973('0x14'));var config=require(_0xf973('0x15'));var licenseUtil=require(_0xf973('0x16'));var db=require(_0xf973('0x17'))['db'];function respondWithStatusCode(_0x2f2e29,_0x5181a2){_0x5181a2=_0x5181a2||0xcc;return function(_0x16df8d){if(_0x16df8d){return _0x2f2e29[_0xf973('0x18')](_0x5181a2);}return _0x2f2e29[_0xf973('0x19')](_0x5181a2)[_0xf973('0x1a')]();};}function respondWithResult(_0x24791b,_0x460918){_0x460918=_0x460918||0xc8;return function(_0x213fc8){if(_0x213fc8){return _0x24791b[_0xf973('0x19')](_0x460918)[_0xf973('0x1b')](_0x213fc8);}};}function respondWithFilteredResult(_0x4043af,_0x28bb44){return function(_0x5c9681){if(_0x5c9681){var _0x295b82=typeof _0x28bb44[_0xf973('0x1c')]===_0xf973('0x1d')&&typeof _0x28bb44[_0xf973('0x1e')]===_0xf973('0x1d');var _0x50458a=_0x5c9681[_0xf973('0x1f')];var _0x3b5f47=_0x295b82?0x0:_0x28bb44['offset'];var _0x3a27a3=_0x295b82?_0x5c9681[_0xf973('0x1f')]:_0x28bb44[_0xf973('0x1c')]+_0x28bb44[_0xf973('0x1e')];var _0x113a3c;if(_0x3a27a3>=_0x50458a){_0x3a27a3=_0x50458a;_0x113a3c=0xc8;}else{_0x113a3c=0xce;}_0x4043af[_0xf973('0x19')](_0x113a3c);return _0x4043af[_0xf973('0x20')]('Content-Range',_0x3b5f47+'-'+_0x3a27a3+'/'+_0x50458a)[_0xf973('0x1b')](_0x5c9681);}return null;};}function patchUpdates(_0x5b2332){return function(_0xab6d32){try{jsonpatch[_0xf973('0x21')](_0xab6d32,_0x5b2332,!![]);}catch(_0x59023f){return BPromise['reject'](_0x59023f);}return _0xab6d32[_0xf973('0x22')]();};}function saveUpdates(_0x4671bc,_0x241987){return function(_0x11ebe1){if(_0x11ebe1){return _0x11ebe1[_0xf973('0x23')](_0x4671bc)[_0xf973('0x24')](function(_0x42869f){return _0x42869f;});}return null;};}function removeEntity(_0x33743e,_0x316e82){return function(_0x3e32e8){if(_0x3e32e8){return _0x3e32e8[_0xf973('0x25')]()['then'](function(){_0x33743e[_0xf973('0x19')](0xcc)[_0xf973('0x1a')]();});}};}function handleEntityNotFound(_0x32c17c,_0x57bfa0){return function(_0x29b80b){if(!_0x29b80b){_0x32c17c[_0xf973('0x18')](0x194);}return _0x29b80b;};}function handleError(_0x313156,_0x405739){_0x405739=_0x405739||0x1f4;return function(_0x42bae6){logger[_0xf973('0x26')](_0x42bae6[_0xf973('0x27')]);if(_0x42bae6[_0xf973('0x28')]){delete _0x42bae6[_0xf973('0x28')];}_0x313156[_0xf973('0x19')](_0x405739)['send'](_0x42bae6);};}exports[_0xf973('0x29')]=function(_0x1ffb14,_0x4d118c){var _0x120ec6={},_0x3c8a88={},_0x21a8a8={'count':0x0,'rows':[]};var _0x198ec7=_[_0xf973('0x2a')](db[_0xf973('0x2b')][_0xf973('0x2c')],function(_0x3fda5f){return{'name':_0x3fda5f[_0xf973('0x2d')],'type':_0x3fda5f[_0xf973('0x2e')][_0xf973('0x2f')]};});_0x3c8a88[_0xf973('0x30')]=_[_0xf973('0x2a')](_0x198ec7,_0xf973('0x28'));_0x3c8a88[_0xf973('0x31')]=_[_0xf973('0x32')](_0x1ffb14[_0xf973('0x31')]);_0x3c8a88['filters']=_[_0xf973('0x33')](_0x3c8a88[_0xf973('0x30')],_0x3c8a88['query']);_0x3c8a88[_0xf973('0x34')]=_[_0xf973('0x35')](_0x3c8a88[_0xf973('0x34')],[_0xf973('0x36'),'$or',_0xf973('0x37'),_0xf973('0x38'),_0xf973('0x39'),_0xf973('0x3a'),_0xf973('0x3b'),_0xf973('0x3c'),_0xf973('0x3d'),_0xf973('0x3e'),_0xf973('0x3f'),_0xf973('0x40'),'$notIn',_0xf973('0x41'),_0xf973('0x42'),'$iLike',_0xf973('0x43'),_0xf973('0x41'),_0xf973('0x44'),_0xf973('0x45'),_0xf973('0x46'),'$any']);_0x120ec6[_0xf973('0x47')]=_[_0xf973('0x33')](_0x3c8a88[_0xf973('0x30')],qs[_0xf973('0x48')](_0x1ffb14[_0xf973('0x31')][_0xf973('0x48')]));_0x120ec6['attributes']=_0x120ec6[_0xf973('0x47')][_0xf973('0x49')]?_0x120ec6[_0xf973('0x47')]:_0x3c8a88[_0xf973('0x30')];if(!_0x1ffb14['query'][_0xf973('0x4a')](_0xf973('0x4b'))){_0x120ec6[_0xf973('0x1e')]=qs[_0xf973('0x1e')](_0x1ffb14[_0xf973('0x31')][_0xf973('0x1e')]);_0x120ec6[_0xf973('0x1c')]=qs['offset'](_0x1ffb14[_0xf973('0x31')][_0xf973('0x1c')]);}_0x120ec6['order']=qs[_0xf973('0x4c')](_0x1ffb14[_0xf973('0x31')][_0xf973('0x4c')]);_0x120ec6['where']=qs[_0xf973('0x34')](_[_0xf973('0x4d')](_0x1ffb14[_0xf973('0x31')],_0x3c8a88[_0xf973('0x34')]),_0x198ec7);if(_0x1ffb14[_0xf973('0x31')][_0xf973('0x4e')]){_0x120ec6['where']=_[_0xf973('0x4f')](_0x120ec6[_0xf973('0x50')],{'$or':_['map'](_0x198ec7,function(_0x102408){if(_0x102408[_0xf973('0x2e')]!==_0xf973('0x51')){var _0x1c0844={};_0x1c0844[_0x102408[_0xf973('0x28')]]={'$like':'%'+_0x1ffb14[_0xf973('0x31')][_0xf973('0x4e')]+'%'};return _0x1c0844;}})});}_0x120ec6=_['merge']({},_0x120ec6,_0x1ffb14[_0xf973('0x52')]);var _0x12684e={'where':_0x120ec6[_0xf973('0x50')]};return db[_0xf973('0x2b')][_0xf973('0x1f')](_0x12684e)[_0xf973('0x24')](function(_0x2e8b13){_0x21a8a8[_0xf973('0x1f')]=_0x2e8b13;if(_0x1ffb14[_0xf973('0x31')][_0xf973('0x53')]){_0x120ec6['include']=[{'all':!![]}];}return db['CmHopper'][_0xf973('0x54')](_0x120ec6);})[_0xf973('0x24')](function(_0x4b1dd2){_0x21a8a8[_0xf973('0x55')]=_0x4b1dd2;return _0x21a8a8;})[_0xf973('0x24')](respondWithFilteredResult(_0x4d118c,_0x120ec6))[_0xf973('0x56')](handleError(_0x4d118c,null));};exports['show']=function(_0x55c31c,_0x343b76){var _0xf60284={'raw':!![],'where':{'id':_0x55c31c[_0xf973('0x57')]['id']}},_0x2697c9={};_0x2697c9[_0xf973('0x30')]=_[_0xf973('0x32')](db['CmHopper'][_0xf973('0x2c')]);_0x2697c9['query']=_[_0xf973('0x32')](_0x55c31c[_0xf973('0x31')]);_0x2697c9[_0xf973('0x34')]=_[_0xf973('0x33')](_0x2697c9[_0xf973('0x30')],_0x2697c9[_0xf973('0x31')]);_0xf60284[_0xf973('0x47')]=_['intersection'](_0x2697c9[_0xf973('0x30')],qs[_0xf973('0x48')](_0x55c31c[_0xf973('0x31')][_0xf973('0x48')]));_0xf60284['attributes']=_0xf60284['attributes'][_0xf973('0x49')]?_0xf60284[_0xf973('0x47')]:_0x2697c9[_0xf973('0x30')];if(_0x55c31c['query'][_0xf973('0x53')]){_0xf60284['include']=[{'all':!![]}];}_0xf60284=_[_0xf973('0x4f')]({},_0xf60284,_0x55c31c['options']);return db['CmHopper'][_0xf973('0x58')](_0xf60284)[_0xf973('0x24')](handleEntityNotFound(_0x343b76,null))[_0xf973('0x24')](respondWithResult(_0x343b76,null))[_0xf973('0x56')](handleError(_0x343b76,null));};exports[_0xf973('0x59')]=function(_0x591ff7,_0x28e2d1){return db[_0xf973('0x2b')]['create'](_0x591ff7[_0xf973('0x5a')],{})[_0xf973('0x24')](respondWithResult(_0x28e2d1,0xc9))[_0xf973('0x56')](handleError(_0x28e2d1,null));};exports[_0xf973('0x23')]=function(_0x5eb83b,_0x1421eb){if(_0x5eb83b[_0xf973('0x5a')]['id']){delete _0x5eb83b[_0xf973('0x5a')]['id'];}return db['CmHopper'][_0xf973('0x58')]({'where':{'id':_0x5eb83b[_0xf973('0x57')]['id']}})[_0xf973('0x24')](handleEntityNotFound(_0x1421eb,null))[_0xf973('0x24')](saveUpdates(_0x5eb83b[_0xf973('0x5a')],null))['then'](respondWithResult(_0x1421eb,null))['catch'](handleError(_0x1421eb,null));};exports['describe']=function(_0x595083,_0x2f2117){return db[_0xf973('0x2b')]['describe']()['then'](respondWithResult(_0x2f2117,null))['catch'](handleError(_0x2f2117,null));};exports[_0xf973('0x25')]=function(_0x39ac6a,_0x2353d9){var _0x1ad780;return db[_0xf973('0x2b')][_0xf973('0x58')]({'where':{'id':_0x39ac6a[_0xf973('0x57')]['id']}})['then'](handleEntityNotFound(_0x2353d9,null))[_0xf973('0x24')](function(_0x234cd2){if(_0x234cd2){return _0x234cd2[_0xf973('0x25')]()[_0xf973('0x24')](function(_0x253341){return _0x253341;});}})[_0xf973('0x24')](function(_0x37df96){_0x1ad780=_0x37df96;if(_0x37df96){if(_0x37df96[_0xf973('0x5b')]||_0x37df96['CampaignId']){return db[_0x37df96[_0xf973('0x5b')]?_0xf973('0x5c'):_0xf973('0x5d')]['find']({'where':{'id':_0x37df96[_0xf973('0x5b')]?_0x37df96[_0xf973('0x5b')]:_0x37df96[_0xf973('0x5e')]},'attributes':['id',_0xf973('0x28')],'raw':!![]});}}})[_0xf973('0x24')](function(_0x38a383){var _0x1a59ee={};if(_0x38a383){_[_0xf973('0x4f')](_0x1a59ee,_['omit'](_0x1ad780['dataValues'],[_0xf973('0x5f'),_0xf973('0x60'),'id']));_0x1a59ee[_0xf973('0x61')]=0x15;_0x1a59ee[_0xf973('0x62')]=_0xf973('0x63');_0x1a59ee[_0xf973('0x64')]=_0x38a383[_0xf973('0x28')];_0x1a59ee[_0xf973('0x65')]=_0x39ac6a['user'][_0xf973('0x28')];_0x1a59ee[_0xf973('0x66')]=_0x39ac6a['user']['id'];_0x1a59ee[_0xf973('0x63')]=!![];_0x1a59ee[_0xf973('0x67')]=moment()[_0xf973('0x68')](_0xf973('0x69'));_0x1a59ee[_0xf973('0x6a')]=_0x1ad780['phone'];_0x1a59ee[_0xf973('0x6b')]=_0x1ad780[_0xf973('0x5b')]?_0xf973('0x6c'):_0xf973('0x6d');return db[_0xf973('0x6e')][_0xf973('0x58')]({'where':{'id':_0x1a59ee[_0xf973('0x6f')]},'attributes':[_0xf973('0x70'),_0xf973('0x71')]})[_0xf973('0x24')](function(_0x775a2e){if(!_[_0xf973('0x72')](_0x2353d9)&&!_[_0xf973('0x72')](_0x775a2e[_0xf973('0x70')])){_0x1a59ee[_0xf973('0x73')]=_0x775a2e['firstName'];if(!_[_0xf973('0x72')](_0x775a2e['lastName'])){_0x1a59ee[_0xf973('0x73')]+='\x20'+_0x775a2e[_0xf973('0x71')];}}})['finally'](function(){return db[_0xf973('0x74')][_0xf973('0x59')](_0x1a59ee);});}})[_0xf973('0x24')](function(){return _0x2353d9[_0xf973('0x19')](0xcc)[_0xf973('0x1a')]();})[_0xf973('0x56')](handleError(_0x2353d9,null));};exports['getPreview']=function(_0x43d1c2,_0x234b89,_0x1544fd){var _0x35cc78=[];return db[_0xf973('0x6e')][_0xf973('0x75')]()['then'](function(_0x15218d){_0x35cc78=_[_0xf973('0x32')](_0x15218d);return _0x43d1c2[_0xf973('0x76')][_0xf973('0x77')]({'where':{'type':_0xf973('0x78'),'dialActive':!![],'dialMethod':_0xf973('0x79')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0xf973('0x24')](function(_0x18728a){if(_0x18728a&&_0x18728a[_0xf973('0x49')]){return db[_0xf973('0x7a')][_0xf973('0x7b')](function(_0x2e343f){var _0x1a357c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xf973('0x69'))},'VoiceQueueId':{'$in':_[_0xf973('0x2a')](_0x18728a,'id')},'$or':[{'UserId':null},{'UserId':_0x43d1c2[_0xf973('0x76')]['id']}]};var _0x31be56=[];if(_0x43d1c2['body']['direction']&&_0x43d1c2[_0xf973('0x5a')][_0xf973('0x7c')]===_0xf973('0x7d')){if(!_['isEmpty'](_0x43d1c2[_0xf973('0x5a')][_0xf973('0x7e')])){_0x1a357c['id']={'$in':_0x43d1c2['body'][_0xf973('0x7e')]};}_0x31be56=[[_0xf973('0x7f'),_0xf973('0x80')],[_0xf973('0x81'),_0x18728a[0x0][_0xf973('0x82')]===_0xf973('0x80')?'DESC':_0xf973('0x80')],db[_0xf973('0x7a')][_0xf973('0x83')](_0xf973('0x84')),['id',_0xf973('0x85')]];}else{if(!_[_0xf973('0x86')](_0x43d1c2[_0xf973('0x5a')]['hopperIds'])){_0x1a357c['id']={'$notIn':_0x43d1c2['body'][_0xf973('0x7e')]};}_0x31be56=[['priority','DESC'],['scheduledAt',_0x18728a[0x0][_0xf973('0x82')]],db[_0xf973('0x7a')][_0xf973('0x83')](_0xf973('0x87')),['id',_0xf973('0x80')]];}return db[_0xf973('0x2b')][_0xf973('0x88')]({'attributes':['id',_0xf973('0x89')],'where':_0x1a357c,'order':_0x31be56,'transaction':_0x2e343f,'lock':_0x2e343f[_0xf973('0x8a')]['UPDATE'],'include':[{'model':db[_0xf973('0x6e')],'as':'Contact','attributes':_0x35cc78,'include':[{'model':db[_0xf973('0x8b')],'as':_0xf973('0x8c'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0xf973('0x8d'),'attributes':['id',_0xf973('0x28')]},{'model':db['VoiceQueue'],'as':_0xf973('0x8e'),'attributes':['id',_0xf973('0x28'),_0xf973('0x8f')]}]})['then'](function(_0x10f316){if(_0x10f316){return _0x10f316[_0xf973('0x23')]({'UserId':_0x43d1c2['user']['id']},{'transaction':_0x2e343f});}});});}})[_0xf973('0x24')](handleEntityNotFound(_0x234b89,null))[_0xf973('0x24')](respondWithResult(_0x234b89,null))[_0xf973('0x56')](handleError(_0x234b89,null));};exports[_0xf973('0x90')]=function(_0x5b654e,_0x1a576c,_0x5e3e5e){return _0x5b654e['user'][_0xf973('0x77')]({'where':{'type':_0xf973('0x78'),'dialActive':!![],'dialMethod':_0xf973('0x79')},'attributes':['id'],'raw':!![]})['then'](function(_0x5f3dcb){if(_0x5f3dcb&&_0x5f3dcb['length']){return db[_0xf973('0x2b')][_0xf973('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf973('0x68')](_0xf973('0x69'))},'VoiceQueueId':{'$in':_['map'](_0x5f3dcb,'id')},'$or':[{'UserId':null},{'UserId':_0x5b654e[_0xf973('0x76')]['id']}]}});}return 0x0;})[_0xf973('0x24')](function(_0x22e88a){if(!_[_0xf973('0x72')](_0x22e88a)&&_[_0xf973('0x91')](_0x22e88a)){return _0x1a576c['status'](0xc8)['json']({'contacts':_0x22e88a});}else{logger['error'](_0xf973('0x92'),'getOpenContacts',0x194,_0xf973('0x93'));_0x1a576c[_0xf973('0x18')](0x194);}})['catch'](handleError(_0x1a576c,null));};
\ No newline at end of file
+var _0x2fbb=['reject','save','update','then','destroy','error','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$contains','$contained','$any','attributes','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','include','findAll','rows','catch','params','keys','includeAll','options','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','state','statedesc','deleted','campaign','membername','UserId','user','format','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json'];(function(_0x1e731e,_0x25acd5){var _0x37ba4c=function(_0x59294d){while(--_0x59294d){_0x1e731e['push'](_0x1e731e['shift']());}};_0x37ba4c(++_0x25acd5);}(_0x2fbb,0x199));var _0xb2fb=function(_0x272766,_0x4b0f6e){_0x272766=_0x272766-0x0;var _0xfb961d=_0x2fbb[_0x272766];return _0xfb961d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2fb('0x0'));var zipdir=require(_0xb2fb('0x1'));var jsonpatch=require(_0xb2fb('0x2'));var rp=require(_0xb2fb('0x3'));var moment=require('moment');var BPromise=require(_0xb2fb('0x4'));var Mustache=require('mustache');var util=require(_0xb2fb('0x5'));var path=require(_0xb2fb('0x6'));var sox=require(_0xb2fb('0x7'));var csv=require('to-csv');var ejs=require(_0xb2fb('0x8'));var fs=require('fs');var fs_extra=require(_0xb2fb('0x9'));var _=require(_0xb2fb('0xa'));var squel=require('squel');var crypto=require(_0xb2fb('0xb'));var jsforce=require(_0xb2fb('0xc'));var deskjs=require(_0xb2fb('0xd'));var toCsv=require(_0xb2fb('0xe'));var querystring=require(_0xb2fb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb2fb('0x10'));var qs=require(_0xb2fb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb2fb('0x12'));var logger=require(_0xb2fb('0x13'))(_0xb2fb('0x14'));var utils=require(_0xb2fb('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb2fb('0x16'))['db'];function respondWithStatusCode(_0x686f4c,_0x4d71e8){_0x4d71e8=_0x4d71e8||0xcc;return function(_0x265290){if(_0x265290){return _0x686f4c[_0xb2fb('0x17')](_0x4d71e8);}return _0x686f4c['status'](_0x4d71e8)[_0xb2fb('0x18')]();};}function respondWithResult(_0x4a0b86,_0x2901a1){_0x2901a1=_0x2901a1||0xc8;return function(_0x336b4f){if(_0x336b4f){return _0x4a0b86[_0xb2fb('0x19')](_0x2901a1)['json'](_0x336b4f);}};}function respondWithFilteredResult(_0x217184,_0x448d19){return function(_0xafa79){if(_0xafa79){var _0x5d5f60=typeof _0x448d19[_0xb2fb('0x1a')]===_0xb2fb('0x1b')&&typeof _0x448d19[_0xb2fb('0x1c')]===_0xb2fb('0x1b');var _0x15dda1=_0xafa79[_0xb2fb('0x1d')];var _0x3523c9=_0x5d5f60?0x0:_0x448d19[_0xb2fb('0x1a')];var _0x3b4b98=_0x5d5f60?_0xafa79['count']:_0x448d19[_0xb2fb('0x1a')]+_0x448d19[_0xb2fb('0x1c')];var _0x36f0df;if(_0x3b4b98>=_0x15dda1){_0x3b4b98=_0x15dda1;_0x36f0df=0xc8;}else{_0x36f0df=0xce;}_0x217184['status'](_0x36f0df);return _0x217184[_0xb2fb('0x1e')]('Content-Range',_0x3523c9+'-'+_0x3b4b98+'/'+_0x15dda1)[_0xb2fb('0x1f')](_0xafa79);}return null;};}function patchUpdates(_0x16e5a9){return function(_0x332c21){try{jsonpatch['apply'](_0x332c21,_0x16e5a9,!![]);}catch(_0x48d0cd){return BPromise[_0xb2fb('0x20')](_0x48d0cd);}return _0x332c21[_0xb2fb('0x21')]();};}function saveUpdates(_0x294771,_0x13454b){return function(_0x4c828b){if(_0x4c828b){return _0x4c828b[_0xb2fb('0x22')](_0x294771)[_0xb2fb('0x23')](function(_0x24348c){return _0x24348c;});}return null;};}function removeEntity(_0xe157d6,_0x25207a){return function(_0x201180){if(_0x201180){return _0x201180[_0xb2fb('0x24')]()[_0xb2fb('0x23')](function(){_0xe157d6[_0xb2fb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320285,_0xdec57b){return function(_0x44e096){if(!_0x44e096){_0x320285[_0xb2fb('0x17')](0x194);}return _0x44e096;};}function handleError(_0x111c34,_0x1293df){_0x1293df=_0x1293df||0x1f4;return function(_0x47c8e0){logger[_0xb2fb('0x25')](_0x47c8e0['stack']);if(_0x47c8e0[_0xb2fb('0x26')]){delete _0x47c8e0[_0xb2fb('0x26')];}_0x111c34[_0xb2fb('0x19')](_0x1293df)[_0xb2fb('0x27')](_0x47c8e0);};}exports[_0xb2fb('0x28')]=function(_0x4105fb,_0x45c233){var _0x19e1d7={},_0x294bf4={},_0x5a2bb2={'count':0x0,'rows':[]};var _0x1a93b5=_[_0xb2fb('0x29')](db[_0xb2fb('0x2a')][_0xb2fb('0x2b')],function(_0x903881){return{'name':_0x903881[_0xb2fb('0x2c')],'type':_0x903881['type'][_0xb2fb('0x2d')]};});_0x294bf4[_0xb2fb('0x2e')]=_[_0xb2fb('0x29')](_0x1a93b5,_0xb2fb('0x26'));_0x294bf4[_0xb2fb('0x2f')]=_['keys'](_0x4105fb['query']);_0x294bf4[_0xb2fb('0x30')]=_[_0xb2fb('0x31')](_0x294bf4[_0xb2fb('0x2e')],_0x294bf4[_0xb2fb('0x2f')]);_0x294bf4[_0xb2fb('0x30')]=_['concat'](_0x294bf4[_0xb2fb('0x30')],[_0xb2fb('0x32'),_0xb2fb('0x33'),_0xb2fb('0x34'),_0xb2fb('0x35'),_0xb2fb('0x36'),_0xb2fb('0x37'),_0xb2fb('0x38'),_0xb2fb('0x39'),_0xb2fb('0x3a'),_0xb2fb('0x3b'),_0xb2fb('0x3c'),_0xb2fb('0x3d'),'$notIn',_0xb2fb('0x3e'),'$notLike',_0xb2fb('0x3f'),'$notILike',_0xb2fb('0x3e'),'$overlap',_0xb2fb('0x40'),_0xb2fb('0x41'),_0xb2fb('0x42')]);_0x19e1d7[_0xb2fb('0x43')]=_[_0xb2fb('0x31')](_0x294bf4[_0xb2fb('0x2e')],qs[_0xb2fb('0x44')](_0x4105fb['query'][_0xb2fb('0x44')]));_0x19e1d7['attributes']=_0x19e1d7[_0xb2fb('0x43')][_0xb2fb('0x45')]?_0x19e1d7[_0xb2fb('0x43')]:_0x294bf4[_0xb2fb('0x2e')];if(!_0x4105fb[_0xb2fb('0x2f')]['hasOwnProperty'](_0xb2fb('0x46'))){_0x19e1d7[_0xb2fb('0x1c')]=qs[_0xb2fb('0x1c')](_0x4105fb[_0xb2fb('0x2f')][_0xb2fb('0x1c')]);_0x19e1d7[_0xb2fb('0x1a')]=qs[_0xb2fb('0x1a')](_0x4105fb['query'][_0xb2fb('0x1a')]);}_0x19e1d7[_0xb2fb('0x47')]=qs[_0xb2fb('0x48')](_0x4105fb[_0xb2fb('0x2f')][_0xb2fb('0x48')]);_0x19e1d7[_0xb2fb('0x49')]=qs[_0xb2fb('0x30')](_['pick'](_0x4105fb[_0xb2fb('0x2f')],_0x294bf4[_0xb2fb('0x30')]),_0x1a93b5);if(_0x4105fb['query']['filter']){_0x19e1d7['where']=_[_0xb2fb('0x4a')](_0x19e1d7[_0xb2fb('0x49')],{'$or':_[_0xb2fb('0x29')](_0x1a93b5,function(_0xb217a4){if(_0xb217a4[_0xb2fb('0x4b')]!==_0xb2fb('0x4c')){var _0x354154={};_0x354154[_0xb217a4[_0xb2fb('0x26')]]={'$like':'%'+_0x4105fb['query'][_0xb2fb('0x4d')]+'%'};return _0x354154;}})});}_0x19e1d7=_['merge']({},_0x19e1d7,_0x4105fb['options']);var _0x35befa={'where':_0x19e1d7[_0xb2fb('0x49')]};return db[_0xb2fb('0x2a')][_0xb2fb('0x1d')](_0x35befa)[_0xb2fb('0x23')](function(_0x3e764b){_0x5a2bb2[_0xb2fb('0x1d')]=_0x3e764b;if(_0x4105fb[_0xb2fb('0x2f')]['includeAll']){_0x19e1d7[_0xb2fb('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0xb2fb('0x4f')](_0x19e1d7);})[_0xb2fb('0x23')](function(_0x3e8acf){_0x5a2bb2[_0xb2fb('0x50')]=_0x3e8acf;return _0x5a2bb2;})[_0xb2fb('0x23')](respondWithFilteredResult(_0x45c233,_0x19e1d7))[_0xb2fb('0x51')](handleError(_0x45c233,null));};exports['show']=function(_0x1aea59,_0x2b6450){var _0x23c80f={'raw':!![],'where':{'id':_0x1aea59[_0xb2fb('0x52')]['id']}},_0x1edccc={};_0x1edccc[_0xb2fb('0x2e')]=_['keys'](db[_0xb2fb('0x2a')][_0xb2fb('0x2b')]);_0x1edccc['query']=_[_0xb2fb('0x53')](_0x1aea59[_0xb2fb('0x2f')]);_0x1edccc[_0xb2fb('0x30')]=_['intersection'](_0x1edccc[_0xb2fb('0x2e')],_0x1edccc['query']);_0x23c80f[_0xb2fb('0x43')]=_[_0xb2fb('0x31')](_0x1edccc['model'],qs['fields'](_0x1aea59[_0xb2fb('0x2f')][_0xb2fb('0x44')]));_0x23c80f[_0xb2fb('0x43')]=_0x23c80f[_0xb2fb('0x43')][_0xb2fb('0x45')]?_0x23c80f['attributes']:_0x1edccc[_0xb2fb('0x2e')];if(_0x1aea59[_0xb2fb('0x2f')][_0xb2fb('0x54')]){_0x23c80f[_0xb2fb('0x4e')]=[{'all':!![]}];}_0x23c80f=_['merge']({},_0x23c80f,_0x1aea59[_0xb2fb('0x55')]);return db['CmHopper'][_0xb2fb('0x56')](_0x23c80f)[_0xb2fb('0x23')](handleEntityNotFound(_0x2b6450,null))[_0xb2fb('0x23')](respondWithResult(_0x2b6450,null))[_0xb2fb('0x51')](handleError(_0x2b6450,null));};exports[_0xb2fb('0x57')]=function(_0x2db70b,_0x3842bb){return db[_0xb2fb('0x2a')]['create'](_0x2db70b[_0xb2fb('0x58')],{})['then'](respondWithResult(_0x3842bb,0xc9))[_0xb2fb('0x51')](handleError(_0x3842bb,null));};exports[_0xb2fb('0x22')]=function(_0x5d96b6,_0x41b60b){if(_0x5d96b6[_0xb2fb('0x58')]['id']){delete _0x5d96b6[_0xb2fb('0x58')]['id'];}return db[_0xb2fb('0x2a')][_0xb2fb('0x56')]({'where':{'id':_0x5d96b6['params']['id']}})['then'](handleEntityNotFound(_0x41b60b,null))[_0xb2fb('0x23')](saveUpdates(_0x5d96b6[_0xb2fb('0x58')],null))[_0xb2fb('0x23')](respondWithResult(_0x41b60b,null))[_0xb2fb('0x51')](handleError(_0x41b60b,null));};exports[_0xb2fb('0x59')]=function(_0x2d7037,_0x1373ec){return db['CmHopper'][_0xb2fb('0x59')]()[_0xb2fb('0x23')](respondWithResult(_0x1373ec,null))['catch'](handleError(_0x1373ec,null));};exports['destroy']=function(_0x4d953b,_0x4b06d3){var _0x4c281d;return db[_0xb2fb('0x2a')]['find']({'where':{'id':_0x4d953b[_0xb2fb('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b06d3,null))[_0xb2fb('0x23')](function(_0x5897b8){if(_0x5897b8){return _0x5897b8[_0xb2fb('0x24')]()[_0xb2fb('0x23')](function(_0x2d33c6){return _0x2d33c6;});}})[_0xb2fb('0x23')](function(_0x24397d){_0x4c281d=_0x24397d;if(_0x24397d){if(_0x24397d[_0xb2fb('0x5a')]||_0x24397d[_0xb2fb('0x5b')]){return db[_0x24397d[_0xb2fb('0x5a')]?_0xb2fb('0x5c'):_0xb2fb('0x5d')]['find']({'where':{'id':_0x24397d[_0xb2fb('0x5a')]?_0x24397d[_0xb2fb('0x5a')]:_0x24397d['CampaignId']},'attributes':['id',_0xb2fb('0x26')],'raw':!![]});}}})[_0xb2fb('0x23')](function(_0x1bb1c3){var _0x4a007a={};if(_0x1bb1c3){_['merge'](_0x4a007a,_[_0xb2fb('0x5e')](_0x4c281d[_0xb2fb('0x5f')],['createdAt','updatedAt','id']));_0x4a007a[_0xb2fb('0x60')]=0x15;_0x4a007a[_0xb2fb('0x61')]=_0xb2fb('0x62');_0x4a007a[_0xb2fb('0x63')]=_0x1bb1c3[_0xb2fb('0x26')];_0x4a007a[_0xb2fb('0x64')]=_0x4d953b['user']['name'];_0x4a007a[_0xb2fb('0x65')]=_0x4d953b[_0xb2fb('0x66')]['id'];_0x4a007a[_0xb2fb('0x62')]=!![];_0x4a007a['deletedat']=moment()[_0xb2fb('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a007a['calleridnum']=_0x4c281d[_0xb2fb('0x68')];_0x4a007a[_0xb2fb('0x69')]=_0x4c281d['VoiceQueueId']?_0xb2fb('0x6a'):_0xb2fb('0x6b');return db[_0xb2fb('0x6c')][_0xb2fb('0x56')]({'where':{'id':_0x4a007a[_0xb2fb('0x6d')]},'attributes':[_0xb2fb('0x6e'),_0xb2fb('0x6f')]})[_0xb2fb('0x23')](function(_0x3a0bbf){if(!_[_0xb2fb('0x70')](_0x4b06d3)&&!_['isNil'](_0x3a0bbf[_0xb2fb('0x6e')])){_0x4a007a[_0xb2fb('0x71')]=_0x3a0bbf[_0xb2fb('0x6e')];if(!_[_0xb2fb('0x70')](_0x3a0bbf[_0xb2fb('0x6f')])){_0x4a007a[_0xb2fb('0x71')]+='\x20'+_0x3a0bbf[_0xb2fb('0x6f')];}}})['finally'](function(){return db[_0xb2fb('0x72')][_0xb2fb('0x57')](_0x4a007a);});}})[_0xb2fb('0x23')](function(){return _0x4b06d3[_0xb2fb('0x19')](0xcc)[_0xb2fb('0x18')]();})[_0xb2fb('0x51')](handleError(_0x4b06d3,null));};exports['getPreview']=function(_0x5f19e0,_0x4ec5a5,_0x210911){var _0x15bb6e=[];return db[_0xb2fb('0x6c')][_0xb2fb('0x59')]()['then'](function(_0x1e28b4){_0x15bb6e=_[_0xb2fb('0x53')](_0x1e28b4);return _0x5f19e0[_0xb2fb('0x66')][_0xb2fb('0x73')]({'where':{'type':_0xb2fb('0x74'),'dialActive':!![],'dialMethod':_0xb2fb('0x75')},'attributes':['id',_0xb2fb('0x76')],'raw':!![]});})[_0xb2fb('0x23')](function(_0x2aa8c2){if(_0x2aa8c2&&_0x2aa8c2[_0xb2fb('0x45')]){return db[_0xb2fb('0x77')][_0xb2fb('0x78')](function(_0x17542b){var _0x36af51={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb2fb('0x67')](_0xb2fb('0x79'))},'VoiceQueueId':{'$in':_[_0xb2fb('0x29')](_0x2aa8c2,'id')},'$or':[{'UserId':null},{'UserId':_0x5f19e0[_0xb2fb('0x66')]['id']}]};var _0x222811=[];if(_0x5f19e0[_0xb2fb('0x58')][_0xb2fb('0x7a')]&&_0x5f19e0['body'][_0xb2fb('0x7a')]===_0xb2fb('0x7b')){if(!_[_0xb2fb('0x7c')](_0x5f19e0[_0xb2fb('0x58')]['hopperIds'])){_0x36af51['id']={'$in':_0x5f19e0['body'][_0xb2fb('0x7d')]};}_0x222811=[[_0xb2fb('0x7e'),_0xb2fb('0x7f')],['scheduledAt',_0x2aa8c2[0x0]['dialOrderByScheduledAt']===_0xb2fb('0x7f')?_0xb2fb('0x80'):_0xb2fb('0x7f')],db[_0xb2fb('0x77')]['literal'](_0xb2fb('0x81')),['id',_0xb2fb('0x80')]];}else{if(!_[_0xb2fb('0x7c')](_0x5f19e0[_0xb2fb('0x58')]['hopperIds'])){_0x36af51['id']={'$notIn':_0x5f19e0[_0xb2fb('0x58')][_0xb2fb('0x7d')]};}_0x222811=[['priority',_0xb2fb('0x80')],[_0xb2fb('0x82'),_0x2aa8c2[0x0][_0xb2fb('0x76')]],db[_0xb2fb('0x77')][_0xb2fb('0x83')](_0xb2fb('0x84')),['id','ASC']];}return db[_0xb2fb('0x2a')][_0xb2fb('0x85')]({'attributes':['id',_0xb2fb('0x86')],'where':_0x36af51,'order':_0x222811,'transaction':_0x17542b,'lock':_0x17542b[_0xb2fb('0x87')][_0xb2fb('0x88')],'include':[{'model':db[_0xb2fb('0x6c')],'as':_0xb2fb('0x89'),'attributes':_0x15bb6e,'include':[{'model':db['CmCompany'],'as':_0xb2fb('0x8a'),'attributes':['id','name']}]},{'model':db[_0xb2fb('0x8b')],'as':_0xb2fb('0x8c'),'attributes':['id',_0xb2fb('0x26')]},{'model':db[_0xb2fb('0x5c')],'as':_0xb2fb('0x8d'),'attributes':['id',_0xb2fb('0x26'),_0xb2fb('0x8e')]}]})['then'](function(_0x5c7599){if(_0x5c7599){return _0x5c7599[_0xb2fb('0x22')]({'UserId':_0x5f19e0['user']['id']},{'transaction':_0x17542b});}});});}})[_0xb2fb('0x23')](handleEntityNotFound(_0x4ec5a5,null))['then'](respondWithResult(_0x4ec5a5,null))[_0xb2fb('0x51')](handleError(_0x4ec5a5,null));};exports[_0xb2fb('0x8f')]=function(_0xec6a0f,_0x57c7ae,_0x3ab9e3){return _0xec6a0f[_0xb2fb('0x66')][_0xb2fb('0x73')]({'where':{'type':_0xb2fb('0x74'),'dialActive':!![],'dialMethod':_0xb2fb('0x75')},'attributes':['id'],'raw':!![]})[_0xb2fb('0x23')](function(_0xe542a){if(_0xe542a&&_0xe542a[_0xb2fb('0x45')]){return db['CmHopper'][_0xb2fb('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb2fb('0x67')](_0xb2fb('0x79'))},'VoiceQueueId':{'$in':_[_0xb2fb('0x29')](_0xe542a,'id')},'$or':[{'UserId':null},{'UserId':_0xec6a0f[_0xb2fb('0x66')]['id']}]}});}return 0x0;})[_0xb2fb('0x23')](function(_0xc70938){if(!_['isNil'](_0xc70938)&&_[_0xb2fb('0x90')](_0xc70938)){return _0x57c7ae['status'](0xc8)[_0xb2fb('0x1f')]({'contacts':_0xc70938});}else{logger[_0xb2fb('0x25')](_0xb2fb('0x91'),_0xb2fb('0x8f'),0x194,_0xb2fb('0x92'));_0x57c7ae[_0xb2fb('0x17')](0x194);}})[_0xb2fb('0x51')](handleError(_0x57c7ae,null));};
\ No newline at end of file
index 2236492..66d352d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone'];(function(_0x1cba7e,_0x1547db){var _0x2eb4ef=function(_0x326b81){while(--_0x326b81){_0x1cba7e['push'](_0x1cba7e['shift']());}};_0x2eb4ef(++_0x1547db);}(_0x31f0,0xb7));var _0x031f=function(_0x33ea86,_0x252e79){_0x33ea86=_0x33ea86-0x0;var _0xb48da5=_0x31f0[_0x33ea86];return _0xb48da5;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('CmHopper',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[{'name':_0x031f('0xa'),'fields':[_0x031f('0xa')]},{'name':_0x031f('0xb'),'fields':['phone']},{'name':_0x031f('0xc'),'fields':[_0x031f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0xe70618,_0x16cdac){var _0x4fe2b9=function(_0x4155a2){while(--_0x4155a2){_0xe70618['push'](_0xe70618['shift']());}};_0x4fe2b9(++_0x16cdac);}(_0xfcf0,0x138));var _0x0fcf=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xfcf0[_0x166d93];return _0xba708;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 609401c..5db2399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d39=['limit','include','model','map','then','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','sequelize','order','LOCK','UPDATE','CmContact','keys','User','Agent','name','length','UserId','push','includes','all','GetContactDialer','MoveContactManagedDialer','transaction','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','GetCmHopperPreview','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','request','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CmHopper','findAll','options','raw','where','attributes'];(function(_0x111494,_0x1d73da){var _0x1d0d8b=function(_0x344935){while(--_0x344935){_0x111494['push'](_0x111494['shift']());}};_0x1d0d8b(++_0x1d73da);}(_0x7d39,0x185));var _0x97d3=function(_0x1bf013,_0x1d01ec){_0x1bf013=_0x1bf013-0x0;var _0x1f32a2=_0x7d39[_0x1bf013];return _0x1f32a2;};'use strict';var _=require(_0x97d3('0x0'));var util=require(_0x97d3('0x1'));var moment=require('moment');var BPromise=require(_0x97d3('0x2'));var rs=require(_0x97d3('0x3'));var fs=require('fs');var Redis=require(_0x97d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97d3('0x5'));var logger=require(_0x97d3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x97d3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x484e42,_0x1f8fe7,_0x1fd6ce){return new BPromise(function(_0x43933a,_0xf4bdde){return client[_0x97d3('0x8')](_0x484e42,_0x1fd6ce)['then'](function(_0xb9c79d){logger[_0x97d3('0x9')](_0x97d3('0xa'),_0x1f8fe7,'request\x20sent');logger[_0x97d3('0xb')](_0x97d3('0xc'),_0x1f8fe7,_0x97d3('0xd'),JSON[_0x97d3('0xe')](_0xb9c79d));if(_0xb9c79d[_0x97d3('0xf')]){if(_0xb9c79d['error']['code']===0x1f4){logger[_0x97d3('0xf')](_0x97d3('0xa'),_0x1f8fe7,_0xb9c79d['error']['message']);return _0xf4bdde(_0xb9c79d[_0x97d3('0xf')]['message']);}logger[_0x97d3('0xf')](_0x97d3('0xa'),_0x1f8fe7,_0xb9c79d['error'][_0x97d3('0x10')]);return _0x43933a(_0xb9c79d[_0x97d3('0xf')][_0x97d3('0x10')]);}else{logger[_0x97d3('0x9')]('CmHopper,\x20%s,\x20%s',_0x1f8fe7,_0x97d3('0xd'));_0x43933a(_0xb9c79d[_0x97d3('0x11')][_0x97d3('0x10')]);}})[_0x97d3('0x12')](function(_0x116e77){logger[_0x97d3('0xf')]('CmHopper,\x20%s,\x20%s',_0x1f8fe7,_0x116e77);_0xf4bdde(_0x116e77);});});}exports['GetCmHopper']=function(_0xdaf62){var _0x4ff225=this;return new Promise(function(_0x1c9871,_0x2cf7d2){return db[_0x97d3('0x13')][_0x97d3('0x14')]({'raw':_0xdaf62[_0x97d3('0x15')]?_0xdaf62[_0x97d3('0x15')][_0x97d3('0x16')]===undefined?!![]:![]:!![],'where':_0xdaf62[_0x97d3('0x15')]?_0xdaf62[_0x97d3('0x15')][_0x97d3('0x17')]||null:null,'attributes':_0xdaf62['options']?_0xdaf62[_0x97d3('0x15')][_0x97d3('0x18')]||null:null,'limit':_0xdaf62[_0x97d3('0x15')]?_0xdaf62[_0x97d3('0x15')][_0x97d3('0x19')]||null:null,'include':_0xdaf62[_0x97d3('0x15')]?_0xdaf62[_0x97d3('0x15')][_0x97d3('0x1a')]?_['map'](_0xdaf62[_0x97d3('0x15')][_0x97d3('0x1a')],function(_0x208ae0){return{'model':db[_0x208ae0[_0x97d3('0x1b')]],'as':_0x208ae0['as'],'attributes':_0x208ae0['attributes'],'include':_0x208ae0[_0x97d3('0x1a')]?_[_0x97d3('0x1c')](_0x208ae0[_0x97d3('0x1a')],function(_0x57d608){return{'model':db[_0x57d608['model']],'as':_0x57d608['as'],'attributes':_0x57d608['attributes'],'include':_0x57d608[_0x97d3('0x1a')]?_['map'](_0x57d608[_0x97d3('0x1a')],function(_0x57f3df){return{'model':db[_0x57f3df['model']],'as':_0x57f3df['as'],'attributes':_0x57f3df['attributes']};}):[]};}):[]};}):[]:[]})[_0x97d3('0x1d')](function(_0x16bd21){logger[_0x97d3('0x9')]('GetCmHopper',_0xdaf62);logger[_0x97d3('0xb')](_0x97d3('0x1e'),_0xdaf62,JSON['stringify'](_0x16bd21));_0x1c9871(_0x16bd21);})[_0x97d3('0x12')](function(_0xa40e58){logger[_0x97d3('0xf')]('GetCmHopper',_0xa40e58[_0x97d3('0x10')],_0xdaf62);_0x2cf7d2(_0x4ff225[_0x97d3('0xf')](0x1f4,_0xa40e58['message']));});});};exports[_0x97d3('0x1f')]=function(_0x49632a){var _0x15f436=this;return new Promise(function(_0x461401,_0x497c5a){return db[_0x97d3('0x13')][_0x97d3('0x20')]({'raw':_0x49632a[_0x97d3('0x15')]?_0x49632a[_0x97d3('0x15')][_0x97d3('0x16')]===undefined?!![]:![]:!![],'where':_0x49632a[_0x97d3('0x15')]?_0x49632a['options']['where']||null:null,'attributes':_0x49632a['options']?_0x49632a[_0x97d3('0x15')][_0x97d3('0x18')]||null:null,'include':_0x49632a[_0x97d3('0x15')]?_0x49632a[_0x97d3('0x15')][_0x97d3('0x1a')]?_['map'](_0x49632a['options']['include'],function(_0x17ceea){return{'model':db[_0x17ceea[_0x97d3('0x1b')]],'as':_0x17ceea['as'],'attributes':_0x17ceea[_0x97d3('0x18')],'include':_0x17ceea[_0x97d3('0x1a')]?_['map'](_0x17ceea['include'],function(_0x149f68){return{'model':db[_0x149f68[_0x97d3('0x1b')]],'as':_0x149f68['as'],'attributes':_0x149f68['attributes'],'include':_0x149f68[_0x97d3('0x1a')]?_[_0x97d3('0x1c')](_0x149f68[_0x97d3('0x1a')],function(_0x498cd0){return{'model':db[_0x498cd0[_0x97d3('0x1b')]],'as':_0x498cd0['as'],'attributes':_0x498cd0[_0x97d3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x97d3('0x1d')](function(_0x4270d4){logger[_0x97d3('0x9')](_0x97d3('0x1f'),_0x49632a);logger['debug']('ShowCmHopper',_0x49632a,JSON['stringify'](_0x4270d4));_0x461401(_0x4270d4);})[_0x97d3('0x12')](function(_0x50cf42){logger[_0x97d3('0xf')]('ShowCmHopper',_0x50cf42[_0x97d3('0x10')],_0x49632a);_0x497c5a(_0x15f436[_0x97d3('0xf')](0x1f4,_0x50cf42['message']));});});};exports[_0x97d3('0x21')]=function(_0x21613e){var _0x52a6ce=this;return new Promise(function(_0x35b095,_0x2fa8f7){return db[_0x97d3('0x13')][_0x97d3('0x22')](_0x21613e[_0x97d3('0x23')],{'raw':_0x21613e['options']?_0x21613e['options'][_0x97d3('0x16')]===undefined?!![]:![]:!![]})[_0x97d3('0x1d')](function(_0x314cd8){logger['info'](_0x97d3('0x21'),_0x21613e);logger[_0x97d3('0xb')]('CreateCmHopper',_0x21613e,JSON['stringify'](_0x314cd8));_0x35b095(_0x314cd8);})[_0x97d3('0x12')](function(_0x3fff0f){logger[_0x97d3('0xf')](_0x97d3('0x21'),_0x3fff0f[_0x97d3('0x10')],_0x21613e);_0x2fa8f7(_0x52a6ce['error'](0x1f4,_0x3fff0f['message']));});});};exports[_0x97d3('0x24')]=function(_0x56d69a){var _0x4aa482=this;return new Promise(function(_0x38462d,_0x1451a6){return db[_0x97d3('0x13')][_0x97d3('0x25')](_0x56d69a[_0x97d3('0x23')],{'raw':_0x56d69a[_0x97d3('0x15')]?_0x56d69a[_0x97d3('0x15')][_0x97d3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56d69a[_0x97d3('0x15')]?_0x56d69a[_0x97d3('0x15')]['where']||null:null,'attributes':_0x56d69a[_0x97d3('0x15')]?_0x56d69a[_0x97d3('0x15')][_0x97d3('0x18')]||null:null,'limit':_0x56d69a[_0x97d3('0x15')]?_0x56d69a[_0x97d3('0x15')][_0x97d3('0x19')]||null:null})[_0x97d3('0x1d')](function(_0x3f06cd){logger[_0x97d3('0x9')](_0x97d3('0x24'),_0x56d69a);logger['debug']('UpdateCmHopper',_0x56d69a,JSON[_0x97d3('0xe')](_0x3f06cd));_0x38462d(_0x3f06cd);})[_0x97d3('0x12')](function(_0x4e756f){logger[_0x97d3('0xf')](_0x97d3('0x24'),_0x4e756f['message'],_0x56d69a);_0x1451a6(_0x4aa482[_0x97d3('0xf')](0x1f4,_0x4e756f[_0x97d3('0x10')]));});});};exports['DestroyCmHopper']=function(_0x3b9d26){var _0x350151=this;return new Promise(function(_0x5a3fbb,_0x1eb947){return db[_0x97d3('0x13')]['destroy']({'where':_0x3b9d26[_0x97d3('0x15')]?_0x3b9d26[_0x97d3('0x15')][_0x97d3('0x17')]||null:null})['then'](function(_0x274cf4){logger[_0x97d3('0x9')](_0x97d3('0x26'),_0x3b9d26);logger[_0x97d3('0xb')]('DestroyCmHopper',_0x3b9d26,JSON[_0x97d3('0xe')](_0x274cf4));_0x5a3fbb(_0x274cf4);})[_0x97d3('0x12')](function(_0x45e3f3){logger[_0x97d3('0xf')](_0x97d3('0x26'),_0x45e3f3['message'],_0x3b9d26);_0x1eb947(_0x350151[_0x97d3('0xf')](0x1f4,_0x45e3f3['message']));});});};exports['GetContactDialer']=function(_0xe04bf5){var _0x554aee=this;return new Promise(function(_0x4e769a,_0x57777b){return db['CmContact']['describe']()['then'](function(_0x5e02a5){return db[_0x97d3('0x27')]['transaction'](function(_0x254675){return db[_0x97d3('0x13')][_0x97d3('0x14')]({'where':_0xe04bf5[_0x97d3('0x15')]?_0xe04bf5[_0x97d3('0x15')][_0x97d3('0x17')]||null:null,'attributes':_0xe04bf5[_0x97d3('0x15')]?_0xe04bf5[_0x97d3('0x15')][_0x97d3('0x18')]||null:null,'limit':_0xe04bf5[_0x97d3('0x15')]?_0xe04bf5['options'][_0x97d3('0x19')]||null:null,'order':_0xe04bf5[_0x97d3('0x15')]?_0xe04bf5[_0x97d3('0x15')][_0x97d3('0x28')]||null:null,'transaction':_0x254675,'lock':_0x254675[_0x97d3('0x29')][_0x97d3('0x2a')],'include':[{'model':db[_0x97d3('0x2b')],'as':'Contact','attributes':_[_0x97d3('0x2c')](_0x5e02a5)},{'model':db[_0x97d3('0x2d')],'as':_0x97d3('0x2e'),'attributes':['id',_0x97d3('0x2f'),'voicePause']}]})['then'](function(_0x8f6605){var _0x433031=[];var _0x397ecd=[];for(var _0x2a8edc=0x0;_0x2a8edc<_0x8f6605[_0x97d3('0x30')];_0x2a8edc+=0x1){var _0xb38720=_0x8f6605[_0x2a8edc][_0x97d3('0x31')];if(_0xb38720===null){_0x433031[_0x97d3('0x32')](_0x8f6605[_0x2a8edc]['update'](_0xe04bf5[_0x97d3('0x23')],{'transaction':_0x254675}));}else if(!_0x397ecd[_0x97d3('0x33')](_0xb38720)){_0x397ecd[_0x97d3('0x32')](_0xb38720);_0x433031[_0x97d3('0x32')](_0x8f6605[_0x2a8edc][_0x97d3('0x25')](_0xe04bf5[_0x97d3('0x23')],{'transaction':_0x254675}));}}return BPromise[_0x97d3('0x34')](_0x433031);});})[_0x97d3('0x1d')](function(_0x3acd2a){logger[_0x97d3('0x9')](_0x97d3('0x35'),_0xe04bf5);logger[_0x97d3('0xb')](_0x97d3('0x35'),_0xe04bf5,JSON['stringify'](_0x3acd2a));_0x4e769a(_0x3acd2a);})[_0x97d3('0x12')](function(_0x515c72){logger[_0x97d3('0xf')]('GetContactDialer',_0x515c72[_0x97d3('0x10')],_0xe04bf5);_0x57777b(_0x554aee[_0x97d3('0xf')](0x1f4,_0x515c72[_0x97d3('0x10')]));});});});};exports[_0x97d3('0x36')]=function(_0x1fae51){var _0x48726e=this;return new Promise(function(_0x4ace77,_0x3949c0){return db[_0x97d3('0x27')][_0x97d3('0x37')](function(_0x57ad63){return db['CmHopperFinal'][_0x97d3('0x22')](_0x1fae51[_0x97d3('0x23')],{'raw':_0x1fae51[_0x97d3('0x15')]?_0x1fae51[_0x97d3('0x15')][_0x97d3('0x16')]===undefined?!![]:![]:!![],'transaction':_0x57ad63})[_0x97d3('0x1d')](function(){return db[_0x97d3('0x13')][_0x97d3('0x38')]({'where':_0x1fae51[_0x97d3('0x15')]?_0x1fae51[_0x97d3('0x15')][_0x97d3('0x17')]||null:null,'transaction':_0x57ad63});});})[_0x97d3('0x1d')](function(_0x3a3b62){logger[_0x97d3('0x9')](_0x97d3('0x36'),_0x1fae51);logger[_0x97d3('0xb')](_0x97d3('0x36'),_0x1fae51,JSON[_0x97d3('0xe')](_0x3a3b62));_0x4ace77(_0x3a3b62);})[_0x97d3('0x12')](function(_0x3c9ea9){logger[_0x97d3('0xf')](_0x97d3('0x36'),_0x3c9ea9[_0x97d3('0x10')],_0x1fae51);_0x3949c0(_0x48726e[_0x97d3('0xf')](0x1f4,_0x3c9ea9[_0x97d3('0x10')]));});});};exports[_0x97d3('0x39')]=function(_0x18f6f5){var _0x23d009=this;return new Promise(function(_0x1fd390,_0x52e922){return db['CmHopper'][_0x97d3('0x14')]({'raw':_0x18f6f5[_0x97d3('0x15')]?_0x18f6f5[_0x97d3('0x15')][_0x97d3('0x16')]===undefined?!![]:![]:!![],'where':_0x18f6f5[_0x97d3('0x15')]?_0x18f6f5[_0x97d3('0x15')][_0x97d3('0x17')]||null:null,'attributes':[[db[_0x97d3('0x27')]['fn'](_0x97d3('0x3a'),db[_0x97d3('0x27')]['fn']('IF',db[_0x97d3('0x27')][_0x97d3('0x3b')](_0x97d3('0x3c')+util['format'](_0x97d3('0x3d'),moment()[_0x97d3('0x3e')](_0x97d3('0x3f')))+_0x97d3('0x40')))),_0x97d3('0x41')]]})[_0x97d3('0x1d')](function(_0x543084){logger['info'](_0x97d3('0x39'),_0x18f6f5);logger[_0x97d3('0xb')]('CountReScheduled',_0x18f6f5,JSON[_0x97d3('0xe')](_0x543084));_0x1fd390(_0x543084);})['catch'](function(_0x1c90a9){logger[_0x97d3('0xf')](_0x97d3('0x39'),_0x1c90a9[_0x97d3('0x10')],_0x18f6f5);_0x52e922(_0x23d009[_0x97d3('0xf')](0x1f4,_0x1c90a9['message']));});});};exports[_0x97d3('0x42')]=function(_0x143067){var _0x257c22=this;return new Promise(function(_0x5020a1,_0x79ac0e){return db['CmContact'][_0x97d3('0x43')]()[_0x97d3('0x1d')](function(_0x52d812){return db[_0x97d3('0x27')][_0x97d3('0x37')](function(_0x1f3daa){return db['CmHopper'][_0x97d3('0x14')]({'where':_0x143067[_0x97d3('0x15')]?_0x143067[_0x97d3('0x15')][_0x97d3('0x17')]||null:null,'attributes':_0x143067['options']?_0x143067[_0x97d3('0x15')][_0x97d3('0x18')]||null:null,'limit':0x1,'order':_0x143067[_0x97d3('0x15')]?_0x143067[_0x97d3('0x15')][_0x97d3('0x28')]||null:null,'group':db[_0x97d3('0x13')]['UserId'],'transaction':_0x1f3daa,'lock':_0x1f3daa[_0x97d3('0x29')]['UPDATE'],'include':_0x143067[_0x97d3('0x15')]?_0x143067[_0x97d3('0x15')][_0x97d3('0x1a')]?_[_0x97d3('0x1c')](_0x143067['options'][_0x97d3('0x1a')],function(_0x12fb39){return{'model':db[_0x12fb39[_0x97d3('0x1b')]],'as':_0x12fb39['as'],'attributes':_0x12fb39[_0x97d3('0x18')],'include':_0x12fb39[_0x97d3('0x1a')]?_[_0x97d3('0x1c')](_0x12fb39[_0x97d3('0x1a')],function(_0x2de8ab){return{'model':db[_0x2de8ab[_0x97d3('0x1b')]],'as':_0x2de8ab['as'],'attributes':_0x2de8ab[_0x97d3('0x18')],'include':_0x2de8ab[_0x97d3('0x1a')]?_[_0x97d3('0x1c')](_0x2de8ab[_0x97d3('0x1a')],function(_0xc617f0){return{'model':db[_0xc617f0['model']],'as':_0xc617f0['as'],'attributes':_0xc617f0[_0x97d3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x97d3('0x1d')](function(_0x35a03b){var _0x3e2914=[];for(var _0x227ac4=0x0;_0x227ac4<_0x35a03b[_0x97d3('0x30')];_0x227ac4+=0x1){_0x3e2914[_0x97d3('0x32')](_0x35a03b[_0x227ac4][_0x97d3('0x25')](_0x143067['body'],{'transaction':_0x1f3daa}));}return BPromise[_0x97d3('0x34')](_0x3e2914);});})['then'](function(_0x443eb8){logger[_0x97d3('0x9')](_0x97d3('0x42'),_0x143067);logger['debug']('GetContactRecallMe',_0x143067,JSON['stringify'](_0x443eb8));_0x5020a1(_0x443eb8);})[_0x97d3('0x12')](function(_0x8b8101){logger[_0x97d3('0xf')]('GetContactRecallMe',_0x8b8101[_0x97d3('0x10')],_0x143067);_0x79ac0e(_0x257c22[_0x97d3('0xf')](0x1f4,_0x8b8101[_0x97d3('0x10')]));});});});};exports[_0x97d3('0x44')]=function(_0x272af8){var _0x45a58c=this;return new Promise(function(_0x32d944,_0x340b06){db[_0x97d3('0x2b')][_0x97d3('0x43')]()['then'](function(_0x3d36cb){return db[_0x97d3('0x13')]['findAll']({'raw':_0x272af8[_0x97d3('0x15')]?_0x272af8[_0x97d3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x272af8['options']?_0x272af8['options'][_0x97d3('0x17')]||null:null,'attributes':_0x272af8[_0x97d3('0x15')]?_0x272af8[_0x97d3('0x15')]['attributes']||null:null,'limit':_0x272af8[_0x97d3('0x15')]?_0x272af8[_0x97d3('0x15')][_0x97d3('0x19')]||null:null,'include':_0x272af8[_0x97d3('0x15')]?_0x272af8[_0x97d3('0x15')]['include']?_[_0x97d3('0x1c')](_0x272af8[_0x97d3('0x15')]['include'],function(_0x22fd1e){return{'model':db[_0x22fd1e[_0x97d3('0x1b')]],'as':_0x22fd1e['as'],'attributes':_0x22fd1e['as']==='Contact'?_[_0x97d3('0x2c')](_0x3d36cb):_0x22fd1e[_0x97d3('0x18')],'include':_0x22fd1e[_0x97d3('0x1a')]?_[_0x97d3('0x1c')](_0x22fd1e[_0x97d3('0x1a')],function(_0x573fa1){return{'model':db[_0x573fa1[_0x97d3('0x1b')]],'as':_0x573fa1['as'],'attributes':_0x573fa1[_0x97d3('0x18')],'include':_0x573fa1[_0x97d3('0x1a')]?_[_0x97d3('0x1c')](_0x573fa1[_0x97d3('0x1a')],function(_0x547ea5){return{'model':db[_0x547ea5['model']],'as':_0x547ea5['as'],'attributes':_0x547ea5['attributes']};}):[]};}):[]};}):[]:[]})[_0x97d3('0x1d')](function(_0x42fac9){logger['info'](_0x97d3('0x1e'),_0x272af8);logger[_0x97d3('0xb')](_0x97d3('0x1e'),_0x272af8,JSON['stringify'](_0x42fac9));_0x32d944(_0x42fac9);})['catch'](function(_0x17039c){logger[_0x97d3('0xf')](_0x97d3('0x1e'),_0x17039c['message'],_0x272af8);_0x340b06(_0x45a58c['error'](0x1f4,_0x17039c['message']));});});});};
\ No newline at end of file
+var _0xd9f9=['map','then','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','limit','destroy','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','describe','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','include','model','attributes'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0xd9f9,0x6c));var _0x9d9f=function(_0x3c3c47,_0x2ad7d5){_0x3c3c47=_0x3c3c47-0x0;var _0xc294c7=_0xd9f9[_0x3c3c47];return _0xc294c7;};'use strict';var _=require(_0x9d9f('0x0'));var util=require(_0x9d9f('0x1'));var moment=require(_0x9d9f('0x2'));var BPromise=require(_0x9d9f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d9f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d9f('0x5'))('rpc');var config=require(_0x9d9f('0x6'));var jayson=require(_0x9d9f('0x7'));var client=jayson['client'][_0x9d9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x304ccb,_0x126455,_0x28315c){return new BPromise(function(_0x41bdec,_0x27f9d7){return client[_0x9d9f('0x9')](_0x304ccb,_0x28315c)['then'](function(_0x25a7fb){logger[_0x9d9f('0xa')](_0x9d9f('0xb'),_0x126455,_0x9d9f('0xc'));logger[_0x9d9f('0xd')](_0x9d9f('0xe'),_0x126455,_0x9d9f('0xc'),JSON[_0x9d9f('0xf')](_0x25a7fb));if(_0x25a7fb[_0x9d9f('0x10')]){if(_0x25a7fb[_0x9d9f('0x10')][_0x9d9f('0x11')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x126455,_0x25a7fb[_0x9d9f('0x10')]['message']);return _0x27f9d7(_0x25a7fb['error'][_0x9d9f('0x12')]);}logger[_0x9d9f('0x10')]('CmHopper,\x20%s,\x20%s',_0x126455,_0x25a7fb['error'][_0x9d9f('0x12')]);return _0x41bdec(_0x25a7fb[_0x9d9f('0x10')]['message']);}else{logger[_0x9d9f('0xa')](_0x9d9f('0xb'),_0x126455,_0x9d9f('0xc'));_0x41bdec(_0x25a7fb[_0x9d9f('0x13')][_0x9d9f('0x12')]);}})[_0x9d9f('0x14')](function(_0x2bfcab){logger[_0x9d9f('0x10')](_0x9d9f('0xb'),_0x126455,_0x2bfcab);_0x27f9d7(_0x2bfcab);});});}exports[_0x9d9f('0x15')]=function(_0x2b6ee7){var _0x521121=this;return new Promise(function(_0x2c94c7,_0x10deca){return db[_0x9d9f('0x16')][_0x9d9f('0x17')]({'raw':_0x2b6ee7[_0x9d9f('0x18')]?_0x2b6ee7[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'where':_0x2b6ee7['options']?_0x2b6ee7['options'][_0x9d9f('0x1a')]||null:null,'attributes':_0x2b6ee7[_0x9d9f('0x18')]?_0x2b6ee7[_0x9d9f('0x18')]['attributes']||null:null,'limit':_0x2b6ee7[_0x9d9f('0x18')]?_0x2b6ee7[_0x9d9f('0x18')]['limit']||null:null,'include':_0x2b6ee7[_0x9d9f('0x18')]?_0x2b6ee7[_0x9d9f('0x18')][_0x9d9f('0x1b')]?_['map'](_0x2b6ee7[_0x9d9f('0x18')][_0x9d9f('0x1b')],function(_0x553c54){return{'model':db[_0x553c54[_0x9d9f('0x1c')]],'as':_0x553c54['as'],'attributes':_0x553c54[_0x9d9f('0x1d')],'include':_0x553c54[_0x9d9f('0x1b')]?_[_0x9d9f('0x1e')](_0x553c54[_0x9d9f('0x1b')],function(_0x142850){return{'model':db[_0x142850[_0x9d9f('0x1c')]],'as':_0x142850['as'],'attributes':_0x142850['attributes'],'include':_0x142850['include']?_[_0x9d9f('0x1e')](_0x142850[_0x9d9f('0x1b')],function(_0x34da15){return{'model':db[_0x34da15[_0x9d9f('0x1c')]],'as':_0x34da15['as'],'attributes':_0x34da15['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d9f('0x1f')](function(_0x25ed5b){logger['info'](_0x9d9f('0x15'),_0x2b6ee7);logger['debug'](_0x9d9f('0x15'),_0x2b6ee7,JSON[_0x9d9f('0xf')](_0x25ed5b));_0x2c94c7(_0x25ed5b);})[_0x9d9f('0x14')](function(_0x5d5684){logger['error'](_0x9d9f('0x15'),_0x5d5684[_0x9d9f('0x12')],_0x2b6ee7);_0x10deca(_0x521121[_0x9d9f('0x10')](0x1f4,_0x5d5684[_0x9d9f('0x12')]));});});};exports[_0x9d9f('0x20')]=function(_0x43cd8c){var _0x5d280c=this;return new Promise(function(_0x1e1049,_0x3847a2){return db[_0x9d9f('0x16')]['find']({'raw':_0x43cd8c[_0x9d9f('0x18')]?_0x43cd8c['options'][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'where':_0x43cd8c[_0x9d9f('0x18')]?_0x43cd8c['options']['where']||null:null,'attributes':_0x43cd8c[_0x9d9f('0x18')]?_0x43cd8c['options'][_0x9d9f('0x1d')]||null:null,'include':_0x43cd8c[_0x9d9f('0x18')]?_0x43cd8c['options'][_0x9d9f('0x1b')]?_[_0x9d9f('0x1e')](_0x43cd8c[_0x9d9f('0x18')]['include'],function(_0x315b7a){return{'model':db[_0x315b7a['model']],'as':_0x315b7a['as'],'attributes':_0x315b7a[_0x9d9f('0x1d')],'include':_0x315b7a['include']?_[_0x9d9f('0x1e')](_0x315b7a['include'],function(_0x92c676){return{'model':db[_0x92c676[_0x9d9f('0x1c')]],'as':_0x92c676['as'],'attributes':_0x92c676[_0x9d9f('0x1d')],'include':_0x92c676[_0x9d9f('0x1b')]?_['map'](_0x92c676['include'],function(_0x549994){return{'model':db[_0x549994['model']],'as':_0x549994['as'],'attributes':_0x549994['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d9f('0x1f')](function(_0x364a40){logger[_0x9d9f('0xa')](_0x9d9f('0x20'),_0x43cd8c);logger[_0x9d9f('0xd')]('ShowCmHopper',_0x43cd8c,JSON['stringify'](_0x364a40));_0x1e1049(_0x364a40);})[_0x9d9f('0x14')](function(_0xafbf7c){logger[_0x9d9f('0x10')](_0x9d9f('0x20'),_0xafbf7c['message'],_0x43cd8c);_0x3847a2(_0x5d280c[_0x9d9f('0x10')](0x1f4,_0xafbf7c['message']));});});};exports[_0x9d9f('0x21')]=function(_0x30302b){var _0x51f8a1=this;return new Promise(function(_0xd214ab,_0xb171a5){return db[_0x9d9f('0x16')][_0x9d9f('0x22')](_0x30302b[_0x9d9f('0x23')],{'raw':_0x30302b[_0x9d9f('0x18')]?_0x30302b[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![]})[_0x9d9f('0x1f')](function(_0x39f596){logger['info'](_0x9d9f('0x21'),_0x30302b);logger[_0x9d9f('0xd')](_0x9d9f('0x21'),_0x30302b,JSON[_0x9d9f('0xf')](_0x39f596));_0xd214ab(_0x39f596);})[_0x9d9f('0x14')](function(_0xe2f221){logger[_0x9d9f('0x10')]('CreateCmHopper',_0xe2f221['message'],_0x30302b);_0xb171a5(_0x51f8a1[_0x9d9f('0x10')](0x1f4,_0xe2f221['message']));});});};exports[_0x9d9f('0x24')]=function(_0xec9e6d){var _0x29e587=this;return new Promise(function(_0x3e9997,_0x16d55b){return db['CmHopper'][_0x9d9f('0x25')](_0xec9e6d[_0x9d9f('0x23')],{'raw':_0xec9e6d[_0x9d9f('0x18')]?_0xec9e6d[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xec9e6d[_0x9d9f('0x18')]?_0xec9e6d[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'attributes':_0xec9e6d[_0x9d9f('0x18')]?_0xec9e6d[_0x9d9f('0x18')]['attributes']||null:null,'limit':_0xec9e6d[_0x9d9f('0x18')]?_0xec9e6d[_0x9d9f('0x18')][_0x9d9f('0x26')]||null:null})[_0x9d9f('0x1f')](function(_0x4ddbb6){logger['info']('UpdateCmHopper',_0xec9e6d);logger[_0x9d9f('0xd')](_0x9d9f('0x24'),_0xec9e6d,JSON['stringify'](_0x4ddbb6));_0x3e9997(_0x4ddbb6);})[_0x9d9f('0x14')](function(_0x1a5fd4){logger[_0x9d9f('0x10')](_0x9d9f('0x24'),_0x1a5fd4[_0x9d9f('0x12')],_0xec9e6d);_0x16d55b(_0x29e587[_0x9d9f('0x10')](0x1f4,_0x1a5fd4[_0x9d9f('0x12')]));});});};exports['DestroyCmHopper']=function(_0x4f5c98){var _0x5bf1f2=this;return new Promise(function(_0x31fce1,_0xe938b){return db[_0x9d9f('0x16')][_0x9d9f('0x27')]({'where':_0x4f5c98[_0x9d9f('0x18')]?_0x4f5c98['options'][_0x9d9f('0x1a')]||null:null})['then'](function(_0x2aeb61){logger[_0x9d9f('0xa')]('DestroyCmHopper',_0x4f5c98);logger[_0x9d9f('0xd')]('DestroyCmHopper',_0x4f5c98,JSON[_0x9d9f('0xf')](_0x2aeb61));_0x31fce1(_0x2aeb61);})[_0x9d9f('0x14')](function(_0x42a6ed){logger[_0x9d9f('0x10')]('DestroyCmHopper',_0x42a6ed[_0x9d9f('0x12')],_0x4f5c98);_0xe938b(_0x5bf1f2[_0x9d9f('0x10')](0x1f4,_0x42a6ed['message']));});});};exports[_0x9d9f('0x28')]=function(_0x326150){var _0x303c8a=this;return new Promise(function(_0x3e3ec9,_0x11fe64){return db[_0x9d9f('0x29')]['describe']()['then'](function(_0x3bcc2f){return db[_0x9d9f('0x2a')][_0x9d9f('0x2b')](function(_0x350e1e){return db[_0x9d9f('0x16')][_0x9d9f('0x17')]({'where':_0x326150['options']?_0x326150[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'attributes':_0x326150[_0x9d9f('0x18')]?_0x326150[_0x9d9f('0x18')][_0x9d9f('0x1d')]||null:null,'limit':_0x326150['options']?_0x326150[_0x9d9f('0x18')]['limit']||null:null,'order':_0x326150['options']?_0x326150['options'][_0x9d9f('0x2c')]||null:null,'transaction':_0x350e1e,'lock':_0x350e1e[_0x9d9f('0x2d')][_0x9d9f('0x2e')],'include':[{'model':db[_0x9d9f('0x29')],'as':_0x9d9f('0x2f'),'attributes':_[_0x9d9f('0x30')](_0x3bcc2f)},{'model':db[_0x9d9f('0x31')],'as':_0x9d9f('0x32'),'attributes':['id',_0x9d9f('0x33'),_0x9d9f('0x34')]}]})[_0x9d9f('0x1f')](function(_0x26532a){var _0x22ade0=[];var _0x30c0c6=[];for(var _0x4bf395=0x0;_0x4bf395<_0x26532a[_0x9d9f('0x35')];_0x4bf395+=0x1){var _0x3b6fed=_0x26532a[_0x4bf395][_0x9d9f('0x36')];if(_0x3b6fed===null){_0x22ade0[_0x9d9f('0x37')](_0x26532a[_0x4bf395][_0x9d9f('0x25')](_0x326150[_0x9d9f('0x23')],{'transaction':_0x350e1e}));}else if(!_0x30c0c6[_0x9d9f('0x38')](_0x3b6fed)){_0x30c0c6[_0x9d9f('0x37')](_0x3b6fed);_0x22ade0[_0x9d9f('0x37')](_0x26532a[_0x4bf395][_0x9d9f('0x25')](_0x326150[_0x9d9f('0x23')],{'transaction':_0x350e1e}));}}return BPromise[_0x9d9f('0x39')](_0x22ade0);});})['then'](function(_0x54ef2b){logger['info'](_0x9d9f('0x28'),_0x326150);logger[_0x9d9f('0xd')]('GetContactDialer',_0x326150,JSON[_0x9d9f('0xf')](_0x54ef2b));_0x3e3ec9(_0x54ef2b);})[_0x9d9f('0x14')](function(_0x24e2b8){logger[_0x9d9f('0x10')](_0x9d9f('0x28'),_0x24e2b8['message'],_0x326150);_0x11fe64(_0x303c8a[_0x9d9f('0x10')](0x1f4,_0x24e2b8[_0x9d9f('0x12')]));});});});};exports[_0x9d9f('0x3a')]=function(_0x21ebba){var _0x2b014c=this;return new Promise(function(_0x23ae71,_0x12dae9){return db[_0x9d9f('0x2a')][_0x9d9f('0x2b')](function(_0x153b62){return db['CmHopperFinal']['create'](_0x21ebba[_0x9d9f('0x23')],{'raw':_0x21ebba['options']?_0x21ebba[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'transaction':_0x153b62})[_0x9d9f('0x1f')](function(){return db[_0x9d9f('0x16')][_0x9d9f('0x27')]({'where':_0x21ebba['options']?_0x21ebba[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'transaction':_0x153b62});});})[_0x9d9f('0x1f')](function(_0x260ae2){logger[_0x9d9f('0xa')](_0x9d9f('0x3a'),_0x21ebba);logger['debug'](_0x9d9f('0x3a'),_0x21ebba,JSON[_0x9d9f('0xf')](_0x260ae2));_0x23ae71(_0x260ae2);})[_0x9d9f('0x14')](function(_0xe9edf7){logger[_0x9d9f('0x10')]('MoveContactManagedDialer',_0xe9edf7['message'],_0x21ebba);_0x12dae9(_0x2b014c[_0x9d9f('0x10')](0x1f4,_0xe9edf7[_0x9d9f('0x12')]));});});};exports['CountReScheduled']=function(_0x1edf68){var _0x44f3e7=this;return new Promise(function(_0x1552ad,_0x113db5){return db[_0x9d9f('0x16')][_0x9d9f('0x17')]({'raw':_0x1edf68['options']?_0x1edf68[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'where':_0x1edf68[_0x9d9f('0x18')]?_0x1edf68[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'attributes':[[db[_0x9d9f('0x2a')]['fn'](_0x9d9f('0x3b'),db[_0x9d9f('0x2a')]['fn']('IF',db[_0x9d9f('0x2a')][_0x9d9f('0x3c')](_0x9d9f('0x3d')+util[_0x9d9f('0x3e')]('\x22%s\x22',moment()[_0x9d9f('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x9d9f('0x3f')))),_0x9d9f('0x40')]]})[_0x9d9f('0x1f')](function(_0x2ec436){logger[_0x9d9f('0xa')](_0x9d9f('0x41'),_0x1edf68);logger[_0x9d9f('0xd')](_0x9d9f('0x41'),_0x1edf68,JSON['stringify'](_0x2ec436));_0x1552ad(_0x2ec436);})['catch'](function(_0xa8d96a){logger[_0x9d9f('0x10')](_0x9d9f('0x41'),_0xa8d96a[_0x9d9f('0x12')],_0x1edf68);_0x113db5(_0x44f3e7['error'](0x1f4,_0xa8d96a[_0x9d9f('0x12')]));});});};exports[_0x9d9f('0x42')]=function(_0x1c1855){var _0x1655ca=this;return new Promise(function(_0x12fcef,_0x85b47e){return db[_0x9d9f('0x29')]['describe']()[_0x9d9f('0x1f')](function(_0x2439f9){return db[_0x9d9f('0x2a')][_0x9d9f('0x2b')](function(_0x31478e){return db['CmHopper'][_0x9d9f('0x17')]({'where':_0x1c1855[_0x9d9f('0x18')]?_0x1c1855['options'][_0x9d9f('0x1a')]||null:null,'attributes':_0x1c1855[_0x9d9f('0x18')]?_0x1c1855['options'][_0x9d9f('0x1d')]||null:null,'limit':0x1,'order':_0x1c1855[_0x9d9f('0x18')]?_0x1c1855[_0x9d9f('0x18')][_0x9d9f('0x2c')]||null:null,'group':db[_0x9d9f('0x16')][_0x9d9f('0x36')],'transaction':_0x31478e,'lock':_0x31478e[_0x9d9f('0x2d')]['UPDATE'],'include':_0x1c1855[_0x9d9f('0x18')]?_0x1c1855[_0x9d9f('0x18')]['include']?_[_0x9d9f('0x1e')](_0x1c1855[_0x9d9f('0x18')]['include'],function(_0x9dfd3d){return{'model':db[_0x9dfd3d[_0x9d9f('0x1c')]],'as':_0x9dfd3d['as'],'attributes':_0x9dfd3d[_0x9d9f('0x1d')],'include':_0x9dfd3d[_0x9d9f('0x1b')]?_[_0x9d9f('0x1e')](_0x9dfd3d[_0x9d9f('0x1b')],function(_0x4766f0){return{'model':db[_0x4766f0['model']],'as':_0x4766f0['as'],'attributes':_0x4766f0[_0x9d9f('0x1d')],'include':_0x4766f0['include']?_[_0x9d9f('0x1e')](_0x4766f0[_0x9d9f('0x1b')],function(_0x2951e8){return{'model':db[_0x2951e8[_0x9d9f('0x1c')]],'as':_0x2951e8['as'],'attributes':_0x2951e8[_0x9d9f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9d9f('0x1f')](function(_0x3f3905){var _0x14186b=[];for(var _0x492d5a=0x0;_0x492d5a<_0x3f3905[_0x9d9f('0x35')];_0x492d5a+=0x1){_0x14186b[_0x9d9f('0x37')](_0x3f3905[_0x492d5a][_0x9d9f('0x25')](_0x1c1855[_0x9d9f('0x23')],{'transaction':_0x31478e}));}return BPromise['all'](_0x14186b);});})[_0x9d9f('0x1f')](function(_0x49a7bd){logger['info'](_0x9d9f('0x42'),_0x1c1855);logger[_0x9d9f('0xd')](_0x9d9f('0x42'),_0x1c1855,JSON[_0x9d9f('0xf')](_0x49a7bd));_0x12fcef(_0x49a7bd);})[_0x9d9f('0x14')](function(_0x1086c5){logger[_0x9d9f('0x10')](_0x9d9f('0x42'),_0x1086c5['message'],_0x1c1855);_0x85b47e(_0x1655ca['error'](0x1f4,_0x1086c5[_0x9d9f('0x12')]));});});});};exports[_0x9d9f('0x43')]=function(_0x544137){var _0x38752a=this;return new Promise(function(_0x25d1ca,_0x276348){db[_0x9d9f('0x29')][_0x9d9f('0x44')]()[_0x9d9f('0x1f')](function(_0x54e49d){return db[_0x9d9f('0x16')][_0x9d9f('0x17')]({'raw':_0x544137[_0x9d9f('0x18')]?_0x544137[_0x9d9f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x544137[_0x9d9f('0x18')]?_0x544137[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'attributes':_0x544137['options']?_0x544137[_0x9d9f('0x18')][_0x9d9f('0x1d')]||null:null,'limit':_0x544137[_0x9d9f('0x18')]?_0x544137[_0x9d9f('0x18')][_0x9d9f('0x26')]||null:null,'include':_0x544137['options']?_0x544137[_0x9d9f('0x18')]['include']?_[_0x9d9f('0x1e')](_0x544137[_0x9d9f('0x18')][_0x9d9f('0x1b')],function(_0xa93aff){return{'model':db[_0xa93aff['model']],'as':_0xa93aff['as'],'attributes':_0xa93aff['as']===_0x9d9f('0x2f')?_[_0x9d9f('0x30')](_0x54e49d):_0xa93aff[_0x9d9f('0x1d')],'include':_0xa93aff[_0x9d9f('0x1b')]?_['map'](_0xa93aff[_0x9d9f('0x1b')],function(_0x393685){return{'model':db[_0x393685[_0x9d9f('0x1c')]],'as':_0x393685['as'],'attributes':_0x393685[_0x9d9f('0x1d')],'include':_0x393685[_0x9d9f('0x1b')]?_[_0x9d9f('0x1e')](_0x393685[_0x9d9f('0x1b')],function(_0x54cc7e){return{'model':db[_0x54cc7e[_0x9d9f('0x1c')]],'as':_0x54cc7e['as'],'attributes':_0x54cc7e[_0x9d9f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9d9f('0x1f')](function(_0x584d2c){logger[_0x9d9f('0xa')]('GetCmHopper',_0x544137);logger[_0x9d9f('0xd')](_0x9d9f('0x15'),_0x544137,JSON[_0x9d9f('0xf')](_0x584d2c));_0x25d1ca(_0x584d2c);})['catch'](function(_0x18f8a8){logger['error']('GetCmHopper',_0x18f8a8[_0x9d9f('0x12')],_0x544137);_0x276348(_0x38752a[_0x9d9f('0x10')](0x1f4,_0x18f8a8[_0x9d9f('0x12')]));});});});};
\ No newline at end of file
index 4bf3885..b359795 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x520b=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','/preview','getPreview','put','update','delete','destroy','exports','util','path'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x520b,0x76));var _0xb520=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0x520b[_0x3df9dd];return _0x4f11e4;};'use strict';var multer=require('multer');var util=require(_0xb520('0x0'));var path=require(_0xb520('0x1'));var timeout=require(_0xb520('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb520('0x3'));var auth=require(_0xb520('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb520('0x5'));var controller=require(_0xb520('0x6'));router['get']('/',auth[_0xb520('0x7')](),controller[_0xb520('0x8')]);router[_0xb520('0x9')](_0xb520('0xa'),auth[_0xb520('0x7')](),controller[_0xb520('0xb')]);router[_0xb520('0x9')](_0xb520('0xc'),auth[_0xb520('0x7')](),controller[_0xb520('0xd')]);router[_0xb520('0x9')](_0xb520('0xe'),auth['isAuthenticated'](),controller[_0xb520('0xf')]);router[_0xb520('0x10')]('/',auth[_0xb520('0x7')](),controller['create']);router[_0xb520('0x10')](_0xb520('0x11'),auth['isAuthenticated'](),controller[_0xb520('0x12')]);router[_0xb520('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb520('0x14')]);router[_0xb520('0x15')](_0xb520('0xe'),auth['isAuthenticated'](),controller[_0xb520('0x16')]);module[_0xb520('0x17')]=router;
\ No newline at end of file
+var _0x720e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/opencontacts','/:id','show','post','create','/preview','put','destroy','exports'];(function(_0x581454,_0x47b953){var _0x53d1e8=function(_0x36d6fc){while(--_0x36d6fc){_0x581454['push'](_0x581454['shift']());}};_0x53d1e8(++_0x47b953);}(_0x720e,0x18c));var _0xe720=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x720e[_0x211fef];return _0x5447bf;};'use strict';var multer=require(_0xe720('0x0'));var util=require(_0xe720('0x1'));var path=require(_0xe720('0x2'));var timeout=require(_0xe720('0x3'));var express=require(_0xe720('0x4'));var router=express[_0xe720('0x5')]();var fs_extra=require(_0xe720('0x6'));var auth=require(_0xe720('0x7'));var interaction=require(_0xe720('0x8'));var config=require(_0xe720('0x9'));var controller=require('./cmHopper.controller');router[_0xe720('0xa')]('/',auth[_0xe720('0xb')](),controller['index']);router[_0xe720('0xa')]('/describe',auth[_0xe720('0xb')](),controller[_0xe720('0xc')]);router[_0xe720('0xa')](_0xe720('0xd'),auth[_0xe720('0xb')](),controller['getOpenContacts']);router[_0xe720('0xa')](_0xe720('0xe'),auth[_0xe720('0xb')](),controller[_0xe720('0xf')]);router[_0xe720('0x10')]('/',auth['isAuthenticated'](),controller[_0xe720('0x11')]);router[_0xe720('0x10')](_0xe720('0x12'),auth[_0xe720('0xb')](),controller['getPreview']);router[_0xe720('0x13')](_0xe720('0xe'),auth[_0xe720('0xb')](),controller['update']);router['delete'](_0xe720('0xe'),auth[_0xe720('0xb')](),controller[_0xe720('0x14')]);module[_0xe720('0x15')]=router;
\ No newline at end of file
index 5ca8f6f..835cc1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x234f=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x1605de,_0x1fcc85){var _0x5bee06=function(_0x54554f){while(--_0x54554f){_0x1605de['push'](_0x1605de['shift']());}};_0x5bee06(++_0x1fcc85);}(_0x234f,0xb6));var _0xf234=function(_0x4a5ae3,_0xbc0b73){_0x4a5ae3=_0x4a5ae3-0x0;var _0x143d54=_0x234f[_0x4a5ae3];return _0x143d54;};'use strict';var moment=require(_0xf234('0x0'));var Sequelize=require(_0xf234('0x1'));module[_0xf234('0x2')]={'phone':{'type':Sequelize[_0xf234('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf234('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf234('0x5')}};
\ No newline at end of file
+var _0x21f2=['exports','STRING','INTEGER','contactListQueue','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x21f2,0x158));var _0x221f=function(_0x4fb64,_0x15df9f){_0x4fb64=_0x4fb64-0x0;var _0x2f9795=_0x21f2[_0x4fb64];return _0x2f9795;};'use strict';var moment=require('moment');var Sequelize=require(_0x221f('0x0'));module[_0x221f('0x1')]={'phone':{'type':Sequelize[_0x221f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x221f('0x3')],'unique':_0x221f('0x4')},'ListId':{'type':Sequelize[_0x221f('0x3')],'unique':_0x221f('0x4')},'VoiceQueueId':{'type':Sequelize[_0x221f('0x3')],'unique':_0x221f('0x4')}};
\ No newline at end of file
index 00d2de9..bc6cca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4d6=['mustache','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','catch','show','params','length','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xb4d6,0x1b6));var _0x6b4d=function(_0x3d2a8f,_0x4794f2){_0x3d2a8f=_0x3d2a8f-0x0;var _0x3f57be=_0xb4d6[_0x3d2a8f];return _0x3f57be;};'use strict';var emlformat=require(_0x6b4d('0x0'));var rimraf=require(_0x6b4d('0x1'));var zipdir=require(_0x6b4d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b4d('0x3'));var moment=require(_0x6b4d('0x4'));var BPromise=require(_0x6b4d('0x5'));var Mustache=require(_0x6b4d('0x6'));var util=require(_0x6b4d('0x7'));var path=require(_0x6b4d('0x8'));var sox=require('sox');var csv=require(_0x6b4d('0x9'));var ejs=require(_0x6b4d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6b4d('0xb'));var crypto=require(_0x6b4d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b4d('0x9'));var querystring=require(_0x6b4d('0xd'));var Papa=require(_0x6b4d('0xe'));var Redis=require(_0x6b4d('0xf'));var authService=require(_0x6b4d('0x10'));var qs=require(_0x6b4d('0x11'));var as=require(_0x6b4d('0x12'));var hardwareService=require(_0x6b4d('0x13'));var logger=require(_0x6b4d('0x14'))(_0x6b4d('0x15'));var utils=require(_0x6b4d('0x16'));var config=require(_0x6b4d('0x17'));var licenseUtil=require(_0x6b4d('0x18'));var db=require(_0x6b4d('0x19'))['db'];function respondWithStatusCode(_0x36f42e,_0x16fad3){_0x16fad3=_0x16fad3||0xcc;return function(_0x30a079){if(_0x30a079){return _0x36f42e[_0x6b4d('0x1a')](_0x16fad3);}return _0x36f42e[_0x6b4d('0x1b')](_0x16fad3)['end']();};}function respondWithResult(_0x476965,_0x5e909f){_0x5e909f=_0x5e909f||0xc8;return function(_0x590d52){if(_0x590d52){return _0x476965[_0x6b4d('0x1b')](_0x5e909f)[_0x6b4d('0x1c')](_0x590d52);}};}function respondWithFilteredResult(_0x4e48c4,_0xc3e24b){return function(_0x36f678){if(_0x36f678){var _0x409edb=typeof _0xc3e24b[_0x6b4d('0x1d')]===_0x6b4d('0x1e')&&typeof _0xc3e24b['limit']===_0x6b4d('0x1e');var _0x2eda80=_0x36f678[_0x6b4d('0x1f')];var _0x48676f=_0x409edb?0x0:_0xc3e24b[_0x6b4d('0x1d')];var _0x51e3ea=_0x409edb?_0x36f678[_0x6b4d('0x1f')]:_0xc3e24b['offset']+_0xc3e24b[_0x6b4d('0x20')];var _0x296a8b;if(_0x51e3ea>=_0x2eda80){_0x51e3ea=_0x2eda80;_0x296a8b=0xc8;}else{_0x296a8b=0xce;}_0x4e48c4[_0x6b4d('0x1b')](_0x296a8b);return _0x4e48c4[_0x6b4d('0x21')]('Content-Range',_0x48676f+'-'+_0x51e3ea+'/'+_0x2eda80)[_0x6b4d('0x1c')](_0x36f678);}return null;};}function patchUpdates(_0xc16f7b){return function(_0x5d1f58){try{jsonpatch[_0x6b4d('0x22')](_0x5d1f58,_0xc16f7b,!![]);}catch(_0x45942d){return BPromise[_0x6b4d('0x23')](_0x45942d);}return _0x5d1f58[_0x6b4d('0x24')]();};}function saveUpdates(_0x4ed617,_0x3a94f2){return function(_0x3c42fb){if(_0x3c42fb){return _0x3c42fb[_0x6b4d('0x25')](_0x4ed617)[_0x6b4d('0x26')](function(_0x4d96b6){return _0x4d96b6;});}return null;};}function removeEntity(_0x3198ec,_0xb1a3f5){return function(_0x1d49fb){if(_0x1d49fb){return _0x1d49fb[_0x6b4d('0x27')]()['then'](function(){_0x3198ec[_0x6b4d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3781d4,_0x5de190){return function(_0x39c2bf){if(!_0x39c2bf){_0x3781d4[_0x6b4d('0x1a')](0x194);}return _0x39c2bf;};}function handleError(_0x11054f,_0x298695){_0x298695=_0x298695||0x1f4;return function(_0xf13921){logger[_0x6b4d('0x28')](_0xf13921[_0x6b4d('0x29')]);if(_0xf13921[_0x6b4d('0x2a')]){delete _0xf13921[_0x6b4d('0x2a')];}_0x11054f['status'](_0x298695)[_0x6b4d('0x2b')](_0xf13921);};}exports[_0x6b4d('0x2c')]=function(_0x2c5065,_0x2132ea){var _0x186a59={},_0x49f69b={},_0x5d8353={'count':0x0,'rows':[]};var _0xcb1597=_[_0x6b4d('0x2d')](db[_0x6b4d('0x2e')]['rawAttributes'],function(_0x32a239){return{'name':_0x32a239[_0x6b4d('0x2f')],'type':_0x32a239[_0x6b4d('0x30')]['key']};});_0x49f69b[_0x6b4d('0x31')]=_[_0x6b4d('0x2d')](_0xcb1597,_0x6b4d('0x2a'));_0x49f69b[_0x6b4d('0x32')]=_[_0x6b4d('0x33')](_0x2c5065['query']);_0x49f69b[_0x6b4d('0x34')]=_['intersection'](_0x49f69b['model'],_0x49f69b[_0x6b4d('0x32')]);_0x186a59[_0x6b4d('0x35')]=_[_0x6b4d('0x36')](_0x49f69b['model'],qs[_0x6b4d('0x37')](_0x2c5065[_0x6b4d('0x32')][_0x6b4d('0x37')]));_0x186a59[_0x6b4d('0x35')]=_0x186a59['attributes']['length']?_0x186a59[_0x6b4d('0x35')]:_0x49f69b['model'];if(!_0x2c5065['query'][_0x6b4d('0x38')](_0x6b4d('0x39'))){_0x186a59[_0x6b4d('0x20')]=qs[_0x6b4d('0x20')](_0x2c5065[_0x6b4d('0x32')][_0x6b4d('0x20')]);_0x186a59[_0x6b4d('0x1d')]=qs[_0x6b4d('0x1d')](_0x2c5065[_0x6b4d('0x32')]['offset']);}_0x186a59[_0x6b4d('0x3a')]=qs[_0x6b4d('0x3b')](_0x2c5065[_0x6b4d('0x32')][_0x6b4d('0x3b')]);_0x186a59['where']=qs[_0x6b4d('0x34')](_[_0x6b4d('0x3c')](_0x2c5065[_0x6b4d('0x32')],_0x49f69b['filters']),_0xcb1597);if(_0x2c5065[_0x6b4d('0x32')]['filter']){_0x186a59[_0x6b4d('0x3d')]=_['merge'](_0x186a59[_0x6b4d('0x3d')],{'$or':_['map'](_0xcb1597,function(_0x54fba9){if(_0x54fba9['type']!==_0x6b4d('0x3e')){var _0x59ec01={};_0x59ec01[_0x54fba9[_0x6b4d('0x2a')]]={'$like':'%'+_0x2c5065[_0x6b4d('0x32')][_0x6b4d('0x3f')]+'%'};return _0x59ec01;}})});}_0x186a59=_[_0x6b4d('0x40')]({},_0x186a59,_0x2c5065['options']);var _0x58362d={'where':_0x186a59[_0x6b4d('0x3d')]};return db[_0x6b4d('0x2e')][_0x6b4d('0x1f')](_0x58362d)[_0x6b4d('0x26')](function(_0x286e71){_0x5d8353[_0x6b4d('0x1f')]=_0x286e71;if(_0x2c5065['query'][_0x6b4d('0x41')]){_0x186a59[_0x6b4d('0x42')]=[{'all':!![]}];}return db[_0x6b4d('0x2e')]['findAll'](_0x186a59);})[_0x6b4d('0x26')](function(_0x4b4dae){_0x5d8353['rows']=_0x4b4dae;return _0x5d8353;})[_0x6b4d('0x26')](respondWithFilteredResult(_0x2132ea,_0x186a59))[_0x6b4d('0x43')](handleError(_0x2132ea,null));};exports[_0x6b4d('0x44')]=function(_0x3c2d3e,_0x152709){var _0x5693c4={'raw':!![],'where':{'id':_0x3c2d3e[_0x6b4d('0x45')]['id']}},_0x18f1f8={};_0x18f1f8['model']=_[_0x6b4d('0x33')](db['CmHopperBlack']['rawAttributes']);_0x18f1f8[_0x6b4d('0x32')]=_[_0x6b4d('0x33')](_0x3c2d3e['query']);_0x18f1f8[_0x6b4d('0x34')]=_['intersection'](_0x18f1f8[_0x6b4d('0x31')],_0x18f1f8['query']);_0x5693c4['attributes']=_[_0x6b4d('0x36')](_0x18f1f8['model'],qs[_0x6b4d('0x37')](_0x3c2d3e[_0x6b4d('0x32')][_0x6b4d('0x37')]));_0x5693c4[_0x6b4d('0x35')]=_0x5693c4[_0x6b4d('0x35')][_0x6b4d('0x46')]?_0x5693c4['attributes']:_0x18f1f8[_0x6b4d('0x31')];if(_0x3c2d3e[_0x6b4d('0x32')]['includeAll']){_0x5693c4[_0x6b4d('0x42')]=[{'all':!![]}];}_0x5693c4=_[_0x6b4d('0x40')]({},_0x5693c4,_0x3c2d3e['options']);return db[_0x6b4d('0x2e')]['find'](_0x5693c4)[_0x6b4d('0x26')](handleEntityNotFound(_0x152709,null))['then'](respondWithResult(_0x152709,null))[_0x6b4d('0x43')](handleError(_0x152709,null));};exports['update']=function(_0xe5962d,_0x1580b1){if(_0xe5962d[_0x6b4d('0x47')]['id']){delete _0xe5962d[_0x6b4d('0x47')]['id'];}return db[_0x6b4d('0x2e')][_0x6b4d('0x48')]({'where':{'id':_0xe5962d['params']['id']}})[_0x6b4d('0x26')](handleEntityNotFound(_0x1580b1,null))['then'](saveUpdates(_0xe5962d[_0x6b4d('0x47')],null))[_0x6b4d('0x26')](respondWithResult(_0x1580b1,null))[_0x6b4d('0x43')](handleError(_0x1580b1,null));};exports[_0x6b4d('0x27')]=function(_0x459afb,_0x41cb29){return db[_0x6b4d('0x2e')][_0x6b4d('0x48')]({'where':{'id':_0x459afb['params']['id']}})[_0x6b4d('0x26')](handleEntityNotFound(_0x41cb29,null))[_0x6b4d('0x26')](removeEntity(_0x41cb29,null))[_0x6b4d('0x43')](handleError(_0x41cb29,null));};exports[_0x6b4d('0x49')]=function(_0x17d364,_0x15e6c2){return db['CmHopperBlack'][_0x6b4d('0x49')]()[_0x6b4d('0x26')](respondWithResult(_0x15e6c2,null))[_0x6b4d('0x43')](handleError(_0x15e6c2,null));};
\ No newline at end of file
+var _0x444e=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','CmHopperBlack','include','rows','catch','rawAttributes','includeAll','options','find','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0x444e,0xd4));var _0xe444=function(_0xa6e4a3,_0x2999cd){_0xa6e4a3=_0xa6e4a3-0x0;var _0x392dc7=_0x444e[_0xa6e4a3];return _0x392dc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe444('0x0'));var zipdir=require(_0xe444('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe444('0x2'));var moment=require(_0xe444('0x3'));var BPromise=require(_0xe444('0x4'));var Mustache=require(_0xe444('0x5'));var util=require(_0xe444('0x6'));var path=require(_0xe444('0x7'));var sox=require(_0xe444('0x8'));var csv=require(_0xe444('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe444('0xa'));var _=require(_0xe444('0xb'));var squel=require(_0xe444('0xc'));var crypto=require(_0xe444('0xd'));var jsforce=require(_0xe444('0xe'));var deskjs=require(_0xe444('0xf'));var toCsv=require(_0xe444('0x9'));var querystring=require('querystring');var Papa=require(_0xe444('0x10'));var Redis=require(_0xe444('0x11'));var authService=require(_0xe444('0x12'));var qs=require(_0xe444('0x13'));var as=require(_0xe444('0x14'));var hardwareService=require(_0xe444('0x15'));var logger=require('../../config/logger')(_0xe444('0x16'));var utils=require('../../config/utils');var config=require(_0xe444('0x17'));var licenseUtil=require(_0xe444('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d8a00,_0x544a39){_0x544a39=_0x544a39||0xcc;return function(_0xb5bd72){if(_0xb5bd72){return _0x4d8a00[_0xe444('0x19')](_0x544a39);}return _0x4d8a00[_0xe444('0x1a')](_0x544a39)[_0xe444('0x1b')]();};}function respondWithResult(_0x213a3a,_0x5a6e51){_0x5a6e51=_0x5a6e51||0xc8;return function(_0x47cbfb){if(_0x47cbfb){return _0x213a3a[_0xe444('0x1a')](_0x5a6e51)[_0xe444('0x1c')](_0x47cbfb);}};}function respondWithFilteredResult(_0x1242cc,_0xf790fb){return function(_0x4b0a8f){if(_0x4b0a8f){var _0xd65e1b=typeof _0xf790fb['offset']===_0xe444('0x1d')&&typeof _0xf790fb[_0xe444('0x1e')]===_0xe444('0x1d');var _0x124ea9=_0x4b0a8f[_0xe444('0x1f')];var _0x36b9a2=_0xd65e1b?0x0:_0xf790fb[_0xe444('0x20')];var _0x3b8c25=_0xd65e1b?_0x4b0a8f[_0xe444('0x1f')]:_0xf790fb[_0xe444('0x20')]+_0xf790fb[_0xe444('0x1e')];var _0x5b788d;if(_0x3b8c25>=_0x124ea9){_0x3b8c25=_0x124ea9;_0x5b788d=0xc8;}else{_0x5b788d=0xce;}_0x1242cc['status'](_0x5b788d);return _0x1242cc[_0xe444('0x21')](_0xe444('0x22'),_0x36b9a2+'-'+_0x3b8c25+'/'+_0x124ea9)['json'](_0x4b0a8f);}return null;};}function patchUpdates(_0x1022b6){return function(_0x49daeb){try{jsonpatch[_0xe444('0x23')](_0x49daeb,_0x1022b6,!![]);}catch(_0x308ac2){return BPromise['reject'](_0x308ac2);}return _0x49daeb[_0xe444('0x24')]();};}function saveUpdates(_0x3908d8,_0x4a86f8){return function(_0x24ad66){if(_0x24ad66){return _0x24ad66[_0xe444('0x25')](_0x3908d8)[_0xe444('0x26')](function(_0x4b920a){return _0x4b920a;});}return null;};}function removeEntity(_0xdf75bb,_0x4f152e){return function(_0xc4d0ac){if(_0xc4d0ac){return _0xc4d0ac['destroy']()[_0xe444('0x26')](function(){_0xdf75bb[_0xe444('0x1a')](0xcc)[_0xe444('0x1b')]();});}};}function handleEntityNotFound(_0x1df5f7,_0xdc84a8){return function(_0x4f2974){if(!_0x4f2974){_0x1df5f7['sendStatus'](0x194);}return _0x4f2974;};}function handleError(_0x2cf74b,_0x3c5359){_0x3c5359=_0x3c5359||0x1f4;return function(_0x514973){logger['error'](_0x514973[_0xe444('0x27')]);if(_0x514973[_0xe444('0x28')]){delete _0x514973[_0xe444('0x28')];}_0x2cf74b[_0xe444('0x1a')](_0x3c5359)[_0xe444('0x29')](_0x514973);};}exports[_0xe444('0x2a')]=function(_0x384933,_0x182849){var _0x3699fa={},_0x44a91a={},_0x2df4b6={'count':0x0,'rows':[]};var _0x79796f=_[_0xe444('0x2b')](db['CmHopperBlack']['rawAttributes'],function(_0x14aa5f){return{'name':_0x14aa5f[_0xe444('0x2c')],'type':_0x14aa5f[_0xe444('0x2d')][_0xe444('0x2e')]};});_0x44a91a[_0xe444('0x2f')]=_['map'](_0x79796f,'name');_0x44a91a[_0xe444('0x30')]=_[_0xe444('0x31')](_0x384933[_0xe444('0x30')]);_0x44a91a[_0xe444('0x32')]=_[_0xe444('0x33')](_0x44a91a[_0xe444('0x2f')],_0x44a91a[_0xe444('0x30')]);_0x3699fa[_0xe444('0x34')]=_[_0xe444('0x33')](_0x44a91a[_0xe444('0x2f')],qs['fields'](_0x384933[_0xe444('0x30')][_0xe444('0x35')]));_0x3699fa[_0xe444('0x34')]=_0x3699fa[_0xe444('0x34')][_0xe444('0x36')]?_0x3699fa['attributes']:_0x44a91a[_0xe444('0x2f')];if(!_0x384933['query'][_0xe444('0x37')](_0xe444('0x38'))){_0x3699fa[_0xe444('0x1e')]=qs[_0xe444('0x1e')](_0x384933['query'][_0xe444('0x1e')]);_0x3699fa[_0xe444('0x20')]=qs[_0xe444('0x20')](_0x384933[_0xe444('0x30')][_0xe444('0x20')]);}_0x3699fa[_0xe444('0x39')]=qs[_0xe444('0x3a')](_0x384933[_0xe444('0x30')][_0xe444('0x3a')]);_0x3699fa['where']=qs[_0xe444('0x32')](_['pick'](_0x384933['query'],_0x44a91a['filters']),_0x79796f);if(_0x384933['query'][_0xe444('0x3b')]){_0x3699fa[_0xe444('0x3c')]=_[_0xe444('0x3d')](_0x3699fa[_0xe444('0x3c')],{'$or':_['map'](_0x79796f,function(_0x4b1f29){if(_0x4b1f29[_0xe444('0x2d')]!=='VIRTUAL'){var _0x4c02d1={};_0x4c02d1[_0x4b1f29[_0xe444('0x28')]]={'$like':'%'+_0x384933[_0xe444('0x30')][_0xe444('0x3b')]+'%'};return _0x4c02d1;}})});}_0x3699fa=_[_0xe444('0x3d')]({},_0x3699fa,_0x384933['options']);var _0x419343={'where':_0x3699fa['where']};return db[_0xe444('0x3e')][_0xe444('0x1f')](_0x419343)[_0xe444('0x26')](function(_0x519f3e){_0x2df4b6[_0xe444('0x1f')]=_0x519f3e;if(_0x384933['query']['includeAll']){_0x3699fa[_0xe444('0x3f')]=[{'all':!![]}];}return db[_0xe444('0x3e')]['findAll'](_0x3699fa);})[_0xe444('0x26')](function(_0x315d73){_0x2df4b6[_0xe444('0x40')]=_0x315d73;return _0x2df4b6;})[_0xe444('0x26')](respondWithFilteredResult(_0x182849,_0x3699fa))[_0xe444('0x41')](handleError(_0x182849,null));};exports['show']=function(_0x5ae9fe,_0x569c41){var _0x2daa31={'raw':!![],'where':{'id':_0x5ae9fe['params']['id']}},_0x43bf11={};_0x43bf11[_0xe444('0x2f')]=_['keys'](db[_0xe444('0x3e')][_0xe444('0x42')]);_0x43bf11[_0xe444('0x30')]=_[_0xe444('0x31')](_0x5ae9fe['query']);_0x43bf11['filters']=_['intersection'](_0x43bf11[_0xe444('0x2f')],_0x43bf11['query']);_0x2daa31[_0xe444('0x34')]=_[_0xe444('0x33')](_0x43bf11[_0xe444('0x2f')],qs[_0xe444('0x35')](_0x5ae9fe[_0xe444('0x30')][_0xe444('0x35')]));_0x2daa31['attributes']=_0x2daa31[_0xe444('0x34')]['length']?_0x2daa31[_0xe444('0x34')]:_0x43bf11['model'];if(_0x5ae9fe[_0xe444('0x30')][_0xe444('0x43')]){_0x2daa31[_0xe444('0x3f')]=[{'all':!![]}];}_0x2daa31=_['merge']({},_0x2daa31,_0x5ae9fe[_0xe444('0x44')]);return db[_0xe444('0x3e')][_0xe444('0x45')](_0x2daa31)['then'](handleEntityNotFound(_0x569c41,null))[_0xe444('0x26')](respondWithResult(_0x569c41,null))[_0xe444('0x41')](handleError(_0x569c41,null));};exports['update']=function(_0x2790b7,_0x5de390){if(_0x2790b7[_0xe444('0x46')]['id']){delete _0x2790b7['body']['id'];}return db['CmHopperBlack'][_0xe444('0x45')]({'where':{'id':_0x2790b7['params']['id']}})[_0xe444('0x26')](handleEntityNotFound(_0x5de390,null))[_0xe444('0x26')](saveUpdates(_0x2790b7[_0xe444('0x46')],null))['then'](respondWithResult(_0x5de390,null))['catch'](handleError(_0x5de390,null));};exports[_0xe444('0x47')]=function(_0x1e9506,_0x542166){return db['CmHopperBlack'][_0xe444('0x45')]({'where':{'id':_0x1e9506['params']['id']}})[_0xe444('0x26')](handleEntityNotFound(_0x542166,null))[_0xe444('0x26')](removeEntity(_0x542166,null))['catch'](handleError(_0x542166,null));};exports[_0xe444('0x48')]=function(_0x3b3380,_0x2626cc){return db[_0xe444('0x3e')]['describe']()['then'](respondWithResult(_0x2626cc,null))[_0xe444('0x41')](handleError(_0x2626cc,null));};
\ No newline at end of file
index 6bc3ecf..3cf8179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf48f=['exports','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x206b07,_0x30ee32){var _0x55de27=function(_0x82ff93){while(--_0x82ff93){_0x206b07['push'](_0x206b07['shift']());}};_0x55de27(++_0x30ee32);}(_0xf48f,0x189));var _0xff48=function(_0x24541c,_0x3bcedf){_0x24541c=_0x24541c-0x0;var _0x546b98=_0xf48f[_0x24541c];return _0x546b98;};'use strict';var _=require(_0xff48('0x0'));var util=require('util');var logger=require(_0xff48('0x1'))('api');var moment=require('moment');var BPromise=require(_0xff48('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff48('0x3'));var rimraf=require(_0xff48('0x4'));var config=require(_0xff48('0x5'));var attributes=require(_0xff48('0x6'));module[_0xff48('0x7')]=function(_0x339014,_0x119074){return _0x339014['define'](_0xff48('0x8'),attributes,{'tableName':_0xff48('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb983=['rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5607e7,_0x24b29f){var _0xb9159c=function(_0x398e1a){while(--_0x398e1a){_0x5607e7['push'](_0x5607e7['shift']());}};_0xb9159c(++_0x24b29f);}(_0xb983,0xe3));var _0x3b98=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xb983[_0x421eeb];return _0x2c7371;};'use strict';var _=require('lodash');var util=require(_0x3b98('0x0'));var logger=require(_0x3b98('0x1'))(_0x3b98('0x2'));var moment=require(_0x3b98('0x3'));var BPromise=require(_0x3b98('0x4'));var rp=require(_0x3b98('0x5'));var fs=require('fs');var path=require(_0x3b98('0x6'));var rimraf=require(_0x3b98('0x7'));var config=require(_0x3b98('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0x3b98('0x9')]=function(_0x7e8b31,_0x478e3d){return _0x7e8b31[_0x3b98('0xa')](_0x3b98('0xb'),attributes,{'tableName':_0x3b98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 35bcb42..3436afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d66=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','map','include','model','attributes','stringify','UpdateCmHopperBlack','CmHopperBlack','update','limit','then','DestroyCmHopperBlack','destroy','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x226fab,_0x3c9943){var _0x93d81a=function(_0x5abb67){while(--_0x5abb67){_0x226fab['push'](_0x226fab['shift']());}};_0x93d81a(++_0x3c9943);}(_0x6d66,0x150));var _0x66d6=function(_0x4fc442,_0x1f948c){_0x4fc442=_0x4fc442-0x0;var _0x308799=_0x6d66[_0x4fc442];return _0x308799;};'use strict';var _=require(_0x66d6('0x0'));var util=require(_0x66d6('0x1'));var moment=require('moment');var BPromise=require(_0x66d6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66d6('0x3'));var db=require(_0x66d6('0x4'))['db'];var utils=require(_0x66d6('0x5'));var logger=require(_0x66d6('0x6'))(_0x66d6('0x7'));var config=require(_0x66d6('0x8'));var jayson=require(_0x66d6('0x9'));var client=jayson[_0x66d6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c3396,_0x3e0fe0,_0x5dc652){return new BPromise(function(_0x3afe06,_0x171a35){return client[_0x66d6('0xb')](_0x1c3396,_0x5dc652)['then'](function(_0x41df48){logger[_0x66d6('0xc')](_0x66d6('0xd'),_0x3e0fe0,_0x66d6('0xe'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3e0fe0,_0x66d6('0xe'),JSON['stringify'](_0x41df48));if(_0x41df48[_0x66d6('0xf')]){if(_0x41df48['error'][_0x66d6('0x10')]===0x1f4){logger[_0x66d6('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x3e0fe0,_0x41df48[_0x66d6('0xf')][_0x66d6('0x11')]);return _0x171a35(_0x41df48[_0x66d6('0xf')]['message']);}logger[_0x66d6('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x3e0fe0,_0x41df48[_0x66d6('0xf')][_0x66d6('0x11')]);return _0x3afe06(_0x41df48['error']['message']);}else{logger[_0x66d6('0xc')](_0x66d6('0xd'),_0x3e0fe0,_0x66d6('0xe'));_0x3afe06(_0x41df48[_0x66d6('0x12')][_0x66d6('0x11')]);}})[_0x66d6('0x13')](function(_0x5ece23){logger[_0x66d6('0xf')](_0x66d6('0xd'),_0x3e0fe0,_0x5ece23);_0x171a35(_0x5ece23);});});}exports[_0x66d6('0x14')]=function(_0x4e0ad5){var _0x3024fb=this;return new Promise(function(_0xda2bb,_0x142124){return db['CmHopperBlack'][_0x66d6('0x15')]({'raw':_0x4e0ad5[_0x66d6('0x16')]?_0x4e0ad5[_0x66d6('0x16')][_0x66d6('0x17')]===undefined?!![]:![]:!![],'where':_0x4e0ad5[_0x66d6('0x16')]?_0x4e0ad5[_0x66d6('0x16')][_0x66d6('0x18')]||null:null,'attributes':_0x4e0ad5[_0x66d6('0x16')]?_0x4e0ad5[_0x66d6('0x16')]['attributes']||null:null,'limit':_0x4e0ad5[_0x66d6('0x16')]?_0x4e0ad5[_0x66d6('0x16')]['limit']||null:null,'include':_0x4e0ad5[_0x66d6('0x16')]?_0x4e0ad5[_0x66d6('0x16')]['include']?_[_0x66d6('0x19')](_0x4e0ad5[_0x66d6('0x16')][_0x66d6('0x1a')],function(_0x53daaa){return{'model':db[_0x53daaa[_0x66d6('0x1b')]],'as':_0x53daaa['as'],'attributes':_0x53daaa[_0x66d6('0x1c')],'include':_0x53daaa[_0x66d6('0x1a')]?_[_0x66d6('0x19')](_0x53daaa[_0x66d6('0x1a')],function(_0x1b7b8f){return{'model':db[_0x1b7b8f[_0x66d6('0x1b')]],'as':_0x1b7b8f['as'],'attributes':_0x1b7b8f[_0x66d6('0x1c')],'include':_0x1b7b8f['include']?_[_0x66d6('0x19')](_0x1b7b8f['include'],function(_0x39f736){return{'model':db[_0x39f736[_0x66d6('0x1b')]],'as':_0x39f736['as'],'attributes':_0x39f736[_0x66d6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dd948){logger[_0x66d6('0xc')](_0x66d6('0x14'),_0x4e0ad5);logger['debug'](_0x66d6('0x14'),_0x4e0ad5,JSON[_0x66d6('0x1d')](_0x5dd948));_0xda2bb(_0x5dd948);})[_0x66d6('0x13')](function(_0x3e7224){logger['error'](_0x66d6('0x14'),_0x3e7224[_0x66d6('0x11')],_0x4e0ad5);_0x142124(_0x3024fb[_0x66d6('0xf')](0x1f4,_0x3e7224[_0x66d6('0x11')]));});});};exports[_0x66d6('0x1e')]=function(_0x3ab308){var _0x263026=this;return new Promise(function(_0x566ee0,_0x19004e){return db[_0x66d6('0x1f')][_0x66d6('0x20')](_0x3ab308['body'],{'raw':_0x3ab308[_0x66d6('0x16')]?_0x3ab308[_0x66d6('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ab308[_0x66d6('0x16')]?_0x3ab308[_0x66d6('0x16')][_0x66d6('0x18')]||null:null,'attributes':_0x3ab308[_0x66d6('0x16')]?_0x3ab308[_0x66d6('0x16')]['attributes']||null:null,'limit':_0x3ab308[_0x66d6('0x16')]?_0x3ab308['options'][_0x66d6('0x21')]||null:null})[_0x66d6('0x22')](function(_0x5e2be7){logger['info'](_0x66d6('0x1e'),_0x3ab308);logger['debug'](_0x66d6('0x1e'),_0x3ab308,JSON['stringify'](_0x5e2be7));_0x566ee0(_0x5e2be7);})['catch'](function(_0x47dc10){logger['error'](_0x66d6('0x1e'),_0x47dc10['message'],_0x3ab308);_0x19004e(_0x263026[_0x66d6('0xf')](0x1f4,_0x47dc10['message']));});});};exports[_0x66d6('0x23')]=function(_0x2ecb75){var _0x613704=this;return new Promise(function(_0x31eaa0,_0x12c9ef){return db[_0x66d6('0x1f')][_0x66d6('0x24')]({'where':_0x2ecb75[_0x66d6('0x16')]?_0x2ecb75[_0x66d6('0x16')][_0x66d6('0x18')]||null:null})[_0x66d6('0x22')](function(_0x5867cb){logger[_0x66d6('0xc')](_0x66d6('0x23'),_0x2ecb75);logger[_0x66d6('0x25')](_0x66d6('0x23'),_0x2ecb75,JSON[_0x66d6('0x1d')](_0x5867cb));_0x31eaa0(_0x5867cb);})[_0x66d6('0x13')](function(_0x57dc2e){logger[_0x66d6('0xf')](_0x66d6('0x23'),_0x57dc2e['message'],_0x2ecb75);_0x12c9ef(_0x613704[_0x66d6('0xf')](0x1f4,_0x57dc2e[_0x66d6('0x11')]));});});};
\ No newline at end of file
+var _0x0a0f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','bluebird'];(function(_0x46f0cb,_0x245576){var _0x2ca080=function(_0x800d06){while(--_0x800d06){_0x46f0cb['push'](_0x46f0cb['shift']());}};_0x2ca080(++_0x245576);}(_0x0a0f,0x1c5));var _0xf0a0=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x0a0f[_0x3e69ae];return _0x3d7f42;};'use strict';var _=require(_0xf0a0('0x0'));var util=require(_0xf0a0('0x1'));var moment=require('moment');var BPromise=require(_0xf0a0('0x2'));var rs=require(_0xf0a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0a0('0x4'))['db'];var utils=require(_0xf0a0('0x5'));var logger=require(_0xf0a0('0x6'))(_0xf0a0('0x7'));var config=require(_0xf0a0('0x8'));var jayson=require(_0xf0a0('0x9'));var client=jayson['client'][_0xf0a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ce96f,_0x45bd08,_0x30f3d8){return new BPromise(function(_0x8124c3,_0x3032ec){return client['request'](_0x5ce96f,_0x30f3d8)[_0xf0a0('0xb')](function(_0x1c4ee1){logger['info'](_0xf0a0('0xc'),_0x45bd08,'request\x20sent');logger[_0xf0a0('0xd')](_0xf0a0('0xe'),_0x45bd08,'request\x20sent',JSON[_0xf0a0('0xf')](_0x1c4ee1));if(_0x1c4ee1[_0xf0a0('0x10')]){if(_0x1c4ee1[_0xf0a0('0x10')][_0xf0a0('0x11')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x45bd08,_0x1c4ee1['error'][_0xf0a0('0x12')]);return _0x3032ec(_0x1c4ee1['error'][_0xf0a0('0x12')]);}logger['error'](_0xf0a0('0xc'),_0x45bd08,_0x1c4ee1[_0xf0a0('0x10')]['message']);return _0x8124c3(_0x1c4ee1[_0xf0a0('0x10')][_0xf0a0('0x12')]);}else{logger[_0xf0a0('0x13')](_0xf0a0('0xc'),_0x45bd08,'request\x20sent');_0x8124c3(_0x1c4ee1[_0xf0a0('0x14')]['message']);}})[_0xf0a0('0x15')](function(_0x1372ad){logger[_0xf0a0('0x10')](_0xf0a0('0xc'),_0x45bd08,_0x1372ad);_0x3032ec(_0x1372ad);});});}exports[_0xf0a0('0x16')]=function(_0x2eee71){var _0x143214=this;return new Promise(function(_0x59b8ff,_0xae62a0){return db[_0xf0a0('0x17')][_0xf0a0('0x18')]({'raw':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71[_0xf0a0('0x19')][_0xf0a0('0x1a')]===undefined?!![]:![]:!![],'where':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71[_0xf0a0('0x19')][_0xf0a0('0x1b')]||null:null,'attributes':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71['options'][_0xf0a0('0x1c')]||null:null,'limit':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71[_0xf0a0('0x19')][_0xf0a0('0x1d')]||null:null,'include':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71['options']['include']?_[_0xf0a0('0x1e')](_0x2eee71[_0xf0a0('0x19')][_0xf0a0('0x1f')],function(_0x486293){return{'model':db[_0x486293[_0xf0a0('0x20')]],'as':_0x486293['as'],'attributes':_0x486293[_0xf0a0('0x1c')],'include':_0x486293[_0xf0a0('0x1f')]?_[_0xf0a0('0x1e')](_0x486293[_0xf0a0('0x1f')],function(_0x868513){return{'model':db[_0x868513[_0xf0a0('0x20')]],'as':_0x868513['as'],'attributes':_0x868513['attributes'],'include':_0x868513[_0xf0a0('0x1f')]?_[_0xf0a0('0x1e')](_0x868513[_0xf0a0('0x1f')],function(_0x821a00){return{'model':db[_0x821a00[_0xf0a0('0x20')]],'as':_0x821a00['as'],'attributes':_0x821a00['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0a0('0xb')](function(_0x5623b2){logger[_0xf0a0('0x13')](_0xf0a0('0x16'),_0x2eee71);logger['debug']('GetCmHopperBlack',_0x2eee71,JSON[_0xf0a0('0xf')](_0x5623b2));_0x59b8ff(_0x5623b2);})[_0xf0a0('0x15')](function(_0x38d1e7){logger['error'](_0xf0a0('0x16'),_0x38d1e7[_0xf0a0('0x12')],_0x2eee71);_0xae62a0(_0x143214[_0xf0a0('0x10')](0x1f4,_0x38d1e7['message']));});});};exports[_0xf0a0('0x21')]=function(_0x4b4ef1){var _0x3bada6=this;return new Promise(function(_0x3a8f93,_0x5b8914){return db[_0xf0a0('0x17')][_0xf0a0('0x22')](_0x4b4ef1[_0xf0a0('0x23')],{'raw':_0x4b4ef1[_0xf0a0('0x19')]?_0x4b4ef1[_0xf0a0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b4ef1[_0xf0a0('0x19')]?_0x4b4ef1[_0xf0a0('0x19')][_0xf0a0('0x1b')]||null:null,'attributes':_0x4b4ef1['options']?_0x4b4ef1[_0xf0a0('0x19')]['attributes']||null:null,'limit':_0x4b4ef1['options']?_0x4b4ef1[_0xf0a0('0x19')]['limit']||null:null})[_0xf0a0('0xb')](function(_0x4db39b){logger[_0xf0a0('0x13')](_0xf0a0('0x21'),_0x4b4ef1);logger['debug']('UpdateCmHopperBlack',_0x4b4ef1,JSON[_0xf0a0('0xf')](_0x4db39b));_0x3a8f93(_0x4db39b);})[_0xf0a0('0x15')](function(_0x553bb0){logger[_0xf0a0('0x10')]('UpdateCmHopperBlack',_0x553bb0[_0xf0a0('0x12')],_0x4b4ef1);_0x5b8914(_0x3bada6['error'](0x1f4,_0x553bb0[_0xf0a0('0x12')]));});});};exports[_0xf0a0('0x24')]=function(_0x51270f){var _0x5c5c3b=this;return new Promise(function(_0x1d8dda,_0x552dd3){return db[_0xf0a0('0x17')][_0xf0a0('0x25')]({'where':_0x51270f[_0xf0a0('0x19')]?_0x51270f['options']['where']||null:null})['then'](function(_0x229e1a){logger[_0xf0a0('0x13')](_0xf0a0('0x24'),_0x51270f);logger[_0xf0a0('0xd')](_0xf0a0('0x24'),_0x51270f,JSON[_0xf0a0('0xf')](_0x229e1a));_0x1d8dda(_0x229e1a);})['catch'](function(_0x2a0fd9){logger[_0xf0a0('0x10')](_0xf0a0('0x24'),_0x2a0fd9[_0xf0a0('0x12')],_0x51270f);_0x552dd3(_0x5c5c3b[_0xf0a0('0x10')](0x1f4,_0x2a0fd9[_0xf0a0('0x12')]));});});};
\ No newline at end of file
index 20059ea..c80faf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda19=['isAuthenticated','index','/describe','describe','show','/:id','update','delete','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x332998,_0x2d99c7){var _0x460be7=function(_0x1a4d24){while(--_0x1a4d24){_0x332998['push'](_0x332998['shift']());}};_0x460be7(++_0x2d99c7);}(_0xda19,0xd5));var _0x9da1=function(_0xde7f6f,_0x29bc3d){_0xde7f6f=_0xde7f6f-0x0;var _0x5ca88a=_0xda19[_0xde7f6f];return _0x5ca88a;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')]('/',auth[_0x9da1('0x8')](),controller[_0x9da1('0x9')]);router[_0x9da1('0x7')](_0x9da1('0xa'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router['put'](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xe')]);router[_0x9da1('0xf')](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x741c=['get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cmHopperBlack.controller'];(function(_0x5cd6f3,_0x45ca37){var _0x503e72=function(_0x5bb5cf){while(--_0x5bb5cf){_0x5cd6f3['push'](_0x5cd6f3['shift']());}};_0x503e72(++_0x45ca37);}(_0x741c,0x196));var _0xc741=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x741c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express[_0xc741('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc741('0x6'));var config=require('../../config/environment');var controller=require(_0xc741('0x7'));router[_0xc741('0x8')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0xa')]);router[_0xc741('0x8')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller['describe']);router[_0xc741('0x8')](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0xd')]);router['put']('/:id',auth[_0xc741('0x9')](),controller[_0xc741('0xe')]);router[_0xc741('0xf')](_0xc741('0xc'),auth[_0xc741('0x9')](),controller[_0xc741('0x10')]);module[_0xc741('0x11')]=router;
\ No newline at end of file
index 9307cbd..b805d9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ab7=['sequelize','moment','exports','DATE','INTEGER','STRING','getDataValue','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN'];(function(_0x3cab1f,_0x2de461){var _0x2b2b3d=function(_0x18a112){while(--_0x18a112){_0x3cab1f['push'](_0x3cab1f['shift']());}};_0x2b2b3d(++_0x2de461);}(_0x8ab7,0xb6));var _0x78ab=function(_0x15c884,_0x305a04){_0x15c884=_0x15c884-0x0;var _0x80d245=_0x8ab7[_0x15c884];return _0x80d245;};'use strict';var Sequelize=require(_0x78ab('0x0'));var moment=require(_0x78ab('0x1'));module[_0x78ab('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x78ab('0x3')]},'countbusyretry':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x78ab('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x78ab('0x5')]},'originatecalleridname':{'type':Sequelize[_0x78ab('0x5')]},'calleridnum':{'type':Sequelize[_0x78ab('0x5')]},'calleridname':{'type':Sequelize[_0x78ab('0x5')]},'starttime':{'type':Sequelize[_0x78ab('0x3')]},'responsetime':{'type':Sequelize[_0x78ab('0x3')]},'answertime':{'type':Sequelize[_0x78ab('0x3')]},'droptime':{'type':Sequelize[_0x78ab('0x3')]},'endtime':{'type':Sequelize[_0x78ab('0x3')]},'ringtime':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x78ab('0x5')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x78ab('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x78ab('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x78ab('0x5')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0xe4cdd6){var _0x5f93e5=this[_0x78ab('0x6')](_0x78ab('0x7'));if(_0x5f93e5&&_0xe4cdd6){this[_0x78ab('0x8')](_0x78ab('0x9'),moment(_0xe4cdd6)[_0x78ab('0xa')](moment(_0x5f93e5),'seconds'));}return this[_0x78ab('0x8')](_0x78ab('0xb'),_0xe4cdd6);}},'amd':{'type':Sequelize[_0x78ab('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x78ab('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x78ab('0x3')]},'callback':{'type':Sequelize[_0x78ab('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x78ab('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x78ab('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x78ab('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x78ab('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x03b1=['exports','INTEGER','STRING','DATE','endtime','followuptime','diff','setDataValue','BOOLEAN'];(function(_0x56aa3d,_0x113592){var _0xbc1524=function(_0x326105){while(--_0x326105){_0x56aa3d['push'](_0x56aa3d['shift']());}};_0xbc1524(++_0x113592);}(_0x03b1,0xbd));var _0x103b=function(_0x193ef7,_0x48d6c4){_0x193ef7=_0x193ef7-0x0;var _0x39284e=_0x03b1[_0x193ef7];return _0x39284e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x103b('0x0')]={'state':{'type':Sequelize[_0x103b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x103b('0x2')]},'scheduledat':{'type':Sequelize[_0x103b('0x3')]},'countbusyretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x103b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x103b('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x103b('0x3')]},'responsetime':{'type':Sequelize[_0x103b('0x3')]},'answertime':{'type':Sequelize[_0x103b('0x3')]},'droptime':{'type':Sequelize[_0x103b('0x3')]},'endtime':{'type':Sequelize[_0x103b('0x3')]},'ringtime':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x103b('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x103b('0x2')]},'reason':{'type':Sequelize[_0x103b('0x2')]},'disposition':{'type':Sequelize[_0x103b('0x2')]},'secondDisposition':{'type':Sequelize[_0x103b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x103b('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4059c3){var _0x28e08d=this['getDataValue'](_0x103b('0x4'));if(_0x28e08d&&_0x4059c3){this['setDataValue'](_0x103b('0x5'),moment(_0x4059c3)[_0x103b('0x6')](moment(_0x28e08d),'seconds'));}return this[_0x103b('0x7')]('dispositionat',_0x4059c3);}},'amd':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x103b('0x3')]},'callback':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x103b('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x103b('0x3')]},'recallme':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 641af02..15b2167 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','describe','catch','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','cm_hopper','fromQuery','phone','scheduledAt','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','into','ListId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','CmHopperFinal','model','map','name','keys','query','intersection'];(function(_0x5993b3,_0x34da84){var _0x3108b5=function(_0x3d56ac){while(--_0x3d56ac){_0x5993b3['push'](_0x5993b3['shift']());}};_0x3108b5(++_0x34da84);}(_0x1261,0x144));var _0x1126=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x1261[_0x4c0622];return _0x1799d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['CmHopperFinal'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':!![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['CmHopperFinal']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')]()['then'](respondWithResult(_0x5111d3,null))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports[_0x1126('0x24')]=function(_0x518e0a,_0x3e4eeb){if(_0x518e0a[_0x1126('0x44')][_0x1126('0x45')]){delete _0x518e0a['body'][_0x1126('0x45')];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'uniqueid':_0x518e0a[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x3e4eeb,null))[_0x1126('0x25')](saveUpdates(_0x518e0a[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0x3e4eeb,null))['catch'](handleError(_0x3e4eeb,null));};exports[_0x1126('0x46')]=function(_0x5a2287,_0x40168e,_0x2ad118){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x5a2287[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4a')))),_0x1126('0x4b')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x4e')))),_0x1126('0x4f')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x1126('0x50')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1126('0x51')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),_0x1126('0x53')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x40168e,null))[_0x1126('0x25')](respondWithResult(_0x40168e,null))[_0x1126('0x43')](handleError(_0x40168e,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xcc1a95,_0x315386,_0x5e0ea1){return db[_0x1126('0x29')]['findAll']({'raw':![],'where':{'CampaignId':_0xcc1a95[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x1126('0x4b')],[db['sequelize']['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x56')))),_0x1126('0x57')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x4e')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x58')))),'dropContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x59')))),_0x1126('0x51')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x315386,null))[_0x1126('0x25')](respondWithResult(_0x315386,null))[_0x1126('0x43')](handleError(_0x315386,null));};exports[_0x1126('0x5a')]=function(_0x247f12,_0xd20fbe,_0x3d5e15){return db[_0x1126('0x5b')][_0x1126('0x41')]({'where':{'id':_0x247f12[_0x1126('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd20fbe,null))[_0x1126('0x25')](function(_0x274343){var _0x2b61ae;if(_0x274343){_0x2b61ae=squel['insert']()['into'](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),'ContactId','ListId','VoiceQueueId',_0x1126('0x60'),_0x1126('0x61')],squel[_0x1126('0x62')]()[_0x1126('0x63')]('ANY_VALUE(calleridnum)',_0x1126('0x5e'))['field'](_0x1126('0x64'),_0x1126('0x5f'))[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),'ListId')[_0x1126('0x63')]('ANY_VALUE(VoiceQueueId)',_0x1126('0x68'))[_0x1126('0x63')]('NOW()',_0x1126('0x60'))[_0x1126('0x63')]('NOW()',_0x1126('0x61'))[_0x1126('0x69')]('cm_hopper_final')['where'](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())['where']('state\x20=\x20?',_0x247f12['body'][_0x1126('0x6c')]['toString']())['where'](_0x1126('0x6d'))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()['field'](_0x1126('0x5e'))[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12['params']['id'][_0x1126('0x6b')]()))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')](_0x1126('0x71')))[_0x1126('0x72')](_0x1126('0x66')))[_0x1126('0x6b')]();return db[_0x1126('0x47')][_0x1126('0x2e')](_0x2b61ae);}return[];})['then'](respondWithResult(_0xd20fbe,null))[_0x1126('0x43')](handleError(_0xd20fbe,null));};exports[_0x1126('0x73')]=function(_0x33cccf,_0x1483f4,_0x3be5bf){return db['Campaign'][_0x1126('0x41')]({'where':{'id':_0x33cccf['params']['id']}})['then'](handleEntityNotFound(_0x1483f4,null))[_0x1126('0x25')](function(_0x2b1884){var _0x55f366;if(_0x2b1884){_0x55f366=squel['insert']()[_0x1126('0x74')](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),_0x1126('0x66'),_0x1126('0x75'),_0x1126('0x76'),_0x1126('0x60'),'updatedAt'],squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x77'),_0x1126('0x5e'))[_0x1126('0x63')](_0x1126('0x64'),'scheduledAt')[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),_0x1126('0x75'))[_0x1126('0x63')](_0x1126('0x78'),_0x1126('0x76'))[_0x1126('0x63')]('NOW()','createdAt')[_0x1126('0x63')]('NOW()',_0x1126('0x61'))['from'](_0x1126('0x70'))['where'](_0x1126('0x79'),_0x33cccf['params']['id']['toString']())['where'](_0x1126('0x7a'),_0x33cccf[_0x1126('0x44')]['state']['toString']())[_0x1126('0x37')](_0x1126('0x6d'))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x1126('0x63')]('phone')[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id']['toString']()))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')]('state\x20=\x204'))[_0x1126('0x72')]('ContactId'))[_0x1126('0x6b')]();return db['sequelize'][_0x1126('0x2e')](_0x55f366);}return[];})[_0x1126('0x25')](respondWithResult(_0x1483f4,null))[_0x1126('0x43')](handleError(_0x1483f4,null));};exports[_0x1126('0x7b')]=function(_0x59c04b,_0x429183,_0x834360){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x59c04b[_0x1126('0x44')][_0x1126('0x68')],'CampaignId':_0x59c04b[_0x1126('0x44')]['CampaignId'],'ContactId':_0x59c04b[_0x1126('0x44')]['ContactId']}})[_0x1126('0x25')](handleEntityNotFound(_0x429183,null))[_0x1126('0x25')](function(_0x4d6bb2){if(_0x4d6bb2){return _0x4d6bb2;}return null;})[_0x1126('0x25')](respondWithResult(_0x429183,null))[_0x1126('0x43')](handleError(_0x429183,null));};
\ No newline at end of file
+var _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5a8d43,_0x4cdd60){var _0x2e16fc=function(_0x55d036){while(--_0x55d036){_0x5a8d43['push'](_0x5a8d43['shift']());}};_0x2e16fc(++_0x4cdd60);}(_0x2a07,0x74));var _0x72a0=function(_0x4d399b,_0x3bd4a4){_0x4d399b=_0x4d399b-0x0;var _0x4435e5=_0x2a07[_0x4d399b];return _0x4435e5;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));};
\ No newline at end of file
index 0dac874..02f51e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4c7=['calleridnum','uniqueid','util','../../config/logger','api','bluebird','../../config/environment','exports','CmHopperFinal'];(function(_0x1c727d,_0x196fa9){var _0x39bf0e=function(_0x17f480){while(--_0x17f480){_0x1c727d['push'](_0x1c727d['shift']());}};_0x39bf0e(++_0x196fa9);}(_0xe4c7,0x134));var _0x7e4c=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0xe4c7[_0x6978c0];return _0x361377;};'use strict';var _=require('lodash');var util=require(_0x7e4c('0x0'));var logger=require(_0x7e4c('0x1'))(_0x7e4c('0x2'));var moment=require('moment');var BPromise=require(_0x7e4c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7e4c('0x4'));var attributes=require('./cmHopperFinal.attributes');module[_0x7e4c('0x5')]=function(_0x20c6ff,_0x26d6a5){return _0x20c6ff['define'](_0x7e4c('0x6'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x7e4c('0x7'),'fields':[_0x7e4c('0x7')]},{'name':'uniqueid','fields':[_0x7e4c('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d96=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x3e27cd,_0x5e647f){var _0x2f2f41=function(_0x1a2ec3){while(--_0x1a2ec3){_0x3e27cd['push'](_0x3e27cd['shift']());}};_0x2f2f41(++_0x5e647f);}(_0x7d96,0x147));var _0x67d9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7d96[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x67d9('0x0'));var util=require(_0x67d9('0x1'));var logger=require(_0x67d9('0x2'))('api');var moment=require(_0x67d9('0x3'));var BPromise=require(_0x67d9('0x4'));var rp=require(_0x67d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67d9('0x6'));var config=require(_0x67d9('0x7'));var attributes=require(_0x67d9('0x8'));module[_0x67d9('0x9')]=function(_0x2c07d2,_0x34b427){return _0x2c07d2[_0x67d9('0xa')](_0x67d9('0xb'),attributes,{'tableName':_0x67d9('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x67d9('0xd')]},{'name':_0x67d9('0xe'),'fields':[_0x67d9('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 65bbc67..9a219d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x57824a,_0x3f00c3){var _0x4fb7e7=function(_0x61234d){while(--_0x61234d){_0x57824a['push'](_0x57824a['shift']());}};_0x4fb7e7(++_0x3f00c3);}(_0xb10b,0x12a));var _0xbb10=function(_0x19865b,_0x279613){_0x19865b=_0x19865b-0x0;var _0x186b3a=_0xb10b[_0x19865b];return _0x186b3a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _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(_0x5135c3,_0x7b6e06){var _0x502650=function(_0x339f0a){while(--_0x339f0a){_0x5135c3['push'](_0x5135c3['shift']());}};_0x502650(++_0x7b6e06);}(_0x7a54,0x106));var _0x47a5=function(_0x2bb3c5,_0x37d7a4){_0x2bb3c5=_0x2bb3c5-0x0;var _0x182342=_0x7a54[_0x2bb3c5];return _0x182342;};'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 8f12550..d8a7f84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf54a=['/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal'];(function(_0x19d048,_0x1937ee){var _0x1b8912=function(_0x37dcea){while(--_0x37dcea){_0x19d048['push'](_0x19d048['shift']());}};_0x1b8912(++_0x1937ee);}(_0xf54a,0x13d));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xaf54('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaf54('0x1'));var express=require(_0xaf54('0x2'));var router=express[_0xaf54('0x3')]();var fs_extra=require(_0xaf54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaf54('0x5'));var config=require(_0xaf54('0x6'));var controller=require(_0xaf54('0x7'));router[_0xaf54('0x8')]('/',auth[_0xaf54('0x9')](),controller[_0xaf54('0xa')]);router[_0xaf54('0x8')](_0xaf54('0xb'),auth[_0xaf54('0x9')](),controller['describe']);router[_0xaf54('0x8')](_0xaf54('0xc'),auth[_0xaf54('0x9')](),controller[_0xaf54('0xd')]);router[_0xaf54('0x8')](_0xaf54('0xe'),auth[_0xaf54('0x9')](),controller[_0xaf54('0xf')]);router[_0xaf54('0x8')]('/campaign/countAttributes/:id',auth[_0xaf54('0x9')](),controller[_0xaf54('0x10')]);router[_0xaf54('0x11')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0xaf54('0x12')]);router['post'](_0xaf54('0x13'),auth[_0xaf54('0x9')](),controller[_0xaf54('0x14')]);router[_0xaf54('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xaf54('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaf54('0x16')]);module[_0xaf54('0x17')]=router;
\ No newline at end of file
+var _0xc8ee=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post'];(function(_0x551d65,_0x56c1de){var _0x8e8dc0=function(_0x4f46a3){while(--_0x4f46a3){_0x551d65['push'](_0x551d65['shift']());}};_0x8e8dc0(++_0x56c1de);}(_0xc8ee,0xcb));var _0xec8e=function(_0x1e3687,_0x2c4897){_0x1e3687=_0x1e3687-0x0;var _0x558934=_0xc8ee[_0x1e3687];return _0x558934;};'use strict';var multer=require(_0xec8e('0x0'));var util=require(_0xec8e('0x1'));var path=require(_0xec8e('0x2'));var timeout=require(_0xec8e('0x3'));var express=require(_0xec8e('0x4'));var router=express[_0xec8e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xec8e('0x6'));var interaction=require(_0xec8e('0x7'));var config=require(_0xec8e('0x8'));var controller=require(_0xec8e('0x9'));router['get']('/',auth[_0xec8e('0xa')](),controller[_0xec8e('0xb')]);router[_0xec8e('0xc')](_0xec8e('0xd'),auth[_0xec8e('0xa')](),controller[_0xec8e('0xe')]);router[_0xec8e('0xc')](_0xec8e('0xf'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x10')]);router['get'](_0xec8e('0x11'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x12')]);router[_0xec8e('0xc')](_0xec8e('0x13'),auth[_0xec8e('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xec8e('0x14')](_0xec8e('0x15'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x16')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0xec8e('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xec8e('0x14')](_0xec8e('0x17'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x18')]);router[_0xec8e('0x19')](_0xec8e('0xf'),auth['isAuthenticated'](),controller[_0xec8e('0x1a')]);module[_0xec8e('0x1b')]=router;
\ No newline at end of file
index bb7dc7e..dca0836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8eef=['sequelize','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x36b838,_0x1e60b1){var _0xc6c1fa=function(_0x1cb613){while(--_0x1cb613){_0x36b838['push'](_0x36b838['shift']());}};_0xc6c1fa(++_0x1e60b1);}(_0x8eef,0xdc));var _0xf8ee=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x8eef[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xf8ee('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf8ee('0x1')]},'scheduledat':{'type':Sequelize[_0xf8ee('0x2')]},'countbusyretry':{'type':Sequelize[_0xf8ee('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf8ee('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf8ee('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf8ee('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf8ee('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xf8ee('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf8ee('0x1')]},'calleridname':{'type':Sequelize[_0xf8ee('0x1')]},'starttime':{'type':Sequelize[_0xf8ee('0x2')]},'responsetime':{'type':Sequelize[_0xf8ee('0x2')]},'answertime':{'type':Sequelize[_0xf8ee('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf8ee('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf8ee('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf8ee('0x1')]},'campaign':{'type':Sequelize[_0xf8ee('0x1')]},'campaigntype':{'type':Sequelize[_0xf8ee('0x1')]},'membername':{'type':Sequelize[_0xf8ee('0x1')]},'reason':{'type':Sequelize[_0xf8ee('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xf8ee('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf8ee('0x2')]},'recallme':{'type':Sequelize[_0xf8ee('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xf8ee('0x2')]},'edited':{'type':Sequelize[_0xf8ee('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf8ee('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf8ee('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf8ee('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4d82=['STRING','BOOLEAN','exports','INTEGER','DATE'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x4d82,0x160));var _0x24d8=function(_0x366e75,_0x533d1d){_0x366e75=_0x366e75-0x0;var _0x3b167b=_0x4d82[_0x366e75];return _0x3b167b;};'use strict';var Sequelize=require('sequelize');module[_0x24d8('0x0')]={'state':{'type':Sequelize[_0x24d8('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x24d8('0x2')]},'countbusyretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x24d8('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x24d8('0x3')]},'calleridnum':{'type':Sequelize[_0x24d8('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x24d8('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x24d8('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x24d8('0x3')]},'campaigntype':{'type':Sequelize[_0x24d8('0x3')]},'membername':{'type':Sequelize[_0x24d8('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x24d8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x24d8('0x2')]},'recallme':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x24d8('0x2')]},'edited':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 8a7d020..163b73e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8459=['describe','update','uniqueid','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','json','apply','save','then','destroy','stack','name','send','index','map','CmHopperHistory','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','findAll','rows','show','includeAll','include','catch','create'];(function(_0x35fa92,_0x3cf8c6){var _0x4150cf=function(_0x377eae){while(--_0x377eae){_0x35fa92['push'](_0x35fa92['shift']());}};_0x4150cf(++_0x3cf8c6);}(_0x8459,0xf9));var _0x9845=function(_0x56a3e1,_0x1476bc){_0x56a3e1=_0x56a3e1-0x0;var _0x51cdda=_0x8459[_0x56a3e1];return _0x51cdda;};'use strict';var emlformat=require(_0x9845('0x0'));var rimraf=require(_0x9845('0x1'));var zipdir=require(_0x9845('0x2'));var jsonpatch=require(_0x9845('0x3'));var rp=require(_0x9845('0x4'));var moment=require(_0x9845('0x5'));var BPromise=require(_0x9845('0x6'));var Mustache=require(_0x9845('0x7'));var util=require(_0x9845('0x8'));var path=require(_0x9845('0x9'));var sox=require('sox');var csv=require(_0x9845('0xa'));var ejs=require(_0x9845('0xb'));var fs=require('fs');var fs_extra=require(_0x9845('0xc'));var _=require(_0x9845('0xd'));var squel=require(_0x9845('0xe'));var crypto=require(_0x9845('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9845('0x10'));var toCsv=require(_0x9845('0xa'));var querystring=require(_0x9845('0x11'));var Papa=require(_0x9845('0x12'));var Redis=require(_0x9845('0x13'));var authService=require(_0x9845('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9845('0x15'));var hardwareService=require(_0x9845('0x16'));var logger=require(_0x9845('0x17'))('api');var utils=require(_0x9845('0x18'));var config=require(_0x9845('0x19'));var licenseUtil=require(_0x9845('0x1a'));var db=require(_0x9845('0x1b'))['db'];function respondWithStatusCode(_0x425e71,_0x2e44e8){_0x2e44e8=_0x2e44e8||0xcc;return function(_0x22000f){if(_0x22000f){return _0x425e71[_0x9845('0x1c')](_0x2e44e8);}return _0x425e71[_0x9845('0x1d')](_0x2e44e8)[_0x9845('0x1e')]();};}function respondWithResult(_0x4befff,_0x33a10d){_0x33a10d=_0x33a10d||0xc8;return function(_0x5efb01){if(_0x5efb01){return _0x4befff['status'](_0x33a10d)['json'](_0x5efb01);}};}function respondWithFilteredResult(_0x301e12,_0x259494){return function(_0x10b752){if(_0x10b752){var _0x590125=typeof _0x259494[_0x9845('0x1f')]===_0x9845('0x20')&&typeof _0x259494[_0x9845('0x21')]===_0x9845('0x20');var _0x4307e3=_0x10b752[_0x9845('0x22')];var _0x4a80ca=_0x590125?0x0:_0x259494[_0x9845('0x1f')];var _0x4be796=_0x590125?_0x10b752['count']:_0x259494[_0x9845('0x1f')]+_0x259494[_0x9845('0x21')];var _0x4369c8;if(_0x4be796>=_0x4307e3){_0x4be796=_0x4307e3;_0x4369c8=0xc8;}else{_0x4369c8=0xce;}_0x301e12[_0x9845('0x1d')](_0x4369c8);return _0x301e12[_0x9845('0x23')](_0x9845('0x24'),_0x4a80ca+'-'+_0x4be796+'/'+_0x4307e3)[_0x9845('0x25')](_0x10b752);}return null;};}function patchUpdates(_0x8b26b7){return function(_0x590d66){try{jsonpatch[_0x9845('0x26')](_0x590d66,_0x8b26b7,!![]);}catch(_0x5b9f8f){return BPromise['reject'](_0x5b9f8f);}return _0x590d66[_0x9845('0x27')]();};}function saveUpdates(_0x218e83,_0x15d74a){return function(_0x24f3bc){if(_0x24f3bc){return _0x24f3bc['update'](_0x218e83)[_0x9845('0x28')](function(_0x56e637){return _0x56e637;});}return null;};}function removeEntity(_0x58ff12,_0x4c3afa){return function(_0x3474c4){if(_0x3474c4){return _0x3474c4[_0x9845('0x29')]()[_0x9845('0x28')](function(){_0x58ff12['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54b273,_0x3ab07d){return function(_0x5664d3){if(!_0x5664d3){_0x54b273['sendStatus'](0x194);}return _0x5664d3;};}function handleError(_0x181607,_0x2a6aba){_0x2a6aba=_0x2a6aba||0x1f4;return function(_0x5cf802){logger['error'](_0x5cf802[_0x9845('0x2a')]);if(_0x5cf802[_0x9845('0x2b')]){delete _0x5cf802[_0x9845('0x2b')];}_0x181607[_0x9845('0x1d')](_0x2a6aba)[_0x9845('0x2c')](_0x5cf802);};}exports[_0x9845('0x2d')]=function(_0x36051e,_0xa94571){var _0x17b551={},_0x28aa08={},_0x5776ac={'count':0x0,'rows':[]};var _0x1b3254=_[_0x9845('0x2e')](db[_0x9845('0x2f')]['rawAttributes'],function(_0x30cbf3){return{'name':_0x30cbf3['fieldName'],'type':_0x30cbf3['type'][_0x9845('0x30')]};});_0x28aa08[_0x9845('0x31')]=_[_0x9845('0x2e')](_0x1b3254,_0x9845('0x2b'));_0x28aa08['query']=_[_0x9845('0x32')](_0x36051e[_0x9845('0x33')]);_0x28aa08['filters']=_[_0x9845('0x34')](_0x28aa08['model'],_0x28aa08[_0x9845('0x33')]);_0x17b551[_0x9845('0x35')]=_[_0x9845('0x34')](_0x28aa08[_0x9845('0x31')],qs[_0x9845('0x36')](_0x36051e[_0x9845('0x33')][_0x9845('0x36')]));_0x17b551['attributes']=_0x17b551[_0x9845('0x35')][_0x9845('0x37')]?_0x17b551[_0x9845('0x35')]:_0x28aa08[_0x9845('0x31')];if(!_0x36051e[_0x9845('0x33')][_0x9845('0x38')](_0x9845('0x39'))){_0x17b551[_0x9845('0x21')]=qs[_0x9845('0x21')](_0x36051e[_0x9845('0x33')][_0x9845('0x21')]);_0x17b551['offset']=qs[_0x9845('0x1f')](_0x36051e['query'][_0x9845('0x1f')]);}_0x17b551[_0x9845('0x3a')]=qs[_0x9845('0x3b')](_0x36051e['query'][_0x9845('0x3b')]);_0x17b551[_0x9845('0x3c')]=qs['filters'](_[_0x9845('0x3d')](_0x36051e['query'],_0x28aa08[_0x9845('0x3e')]),_0x1b3254);if(_0x36051e[_0x9845('0x33')][_0x9845('0x3f')]){_0x17b551['where']=_[_0x9845('0x40')](_0x17b551['where'],{'$or':_[_0x9845('0x2e')](_0x1b3254,function(_0x46352c){if(_0x46352c[_0x9845('0x41')]!==_0x9845('0x42')){var _0x537c33={};_0x537c33[_0x46352c[_0x9845('0x2b')]]={'$like':'%'+_0x36051e[_0x9845('0x33')][_0x9845('0x3f')]+'%'};return _0x537c33;}})});}_0x17b551=_[_0x9845('0x40')]({},_0x17b551,_0x36051e[_0x9845('0x43')]);var _0x25a9be={'where':_0x17b551[_0x9845('0x3c')]};return db['CmHopperHistory'][_0x9845('0x22')](_0x25a9be)[_0x9845('0x28')](function(_0x53e507){_0x5776ac[_0x9845('0x22')]=_0x53e507;if(_0x36051e[_0x9845('0x33')]['includeAll']){_0x17b551['include']=[{'all':!![]}];}return db[_0x9845('0x2f')][_0x9845('0x44')](_0x17b551);})[_0x9845('0x28')](function(_0x261851){_0x5776ac[_0x9845('0x45')]=_0x261851;return _0x5776ac;})['then'](respondWithFilteredResult(_0xa94571,_0x17b551))['catch'](handleError(_0xa94571,null));};exports[_0x9845('0x46')]=function(_0x4c38a4,_0x2625bd){var _0x4ecb2f={'raw':!![],'where':{'id':_0x4c38a4['params']['id']}},_0xd9c9a8={};_0xd9c9a8[_0x9845('0x31')]=_[_0x9845('0x32')](db[_0x9845('0x2f')]['rawAttributes']);_0xd9c9a8['query']=_['keys'](_0x4c38a4[_0x9845('0x33')]);_0xd9c9a8[_0x9845('0x3e')]=_[_0x9845('0x34')](_0xd9c9a8['model'],_0xd9c9a8['query']);_0x4ecb2f[_0x9845('0x35')]=_['intersection'](_0xd9c9a8['model'],qs[_0x9845('0x36')](_0x4c38a4['query'][_0x9845('0x36')]));_0x4ecb2f[_0x9845('0x35')]=_0x4ecb2f['attributes'][_0x9845('0x37')]?_0x4ecb2f[_0x9845('0x35')]:_0xd9c9a8[_0x9845('0x31')];if(_0x4c38a4[_0x9845('0x33')][_0x9845('0x47')]){_0x4ecb2f[_0x9845('0x48')]=[{'all':!![]}];}_0x4ecb2f=_[_0x9845('0x40')]({},_0x4ecb2f,_0x4c38a4[_0x9845('0x43')]);return db[_0x9845('0x2f')]['find'](_0x4ecb2f)[_0x9845('0x28')](handleEntityNotFound(_0x2625bd,null))['then'](respondWithResult(_0x2625bd,null))[_0x9845('0x49')](handleError(_0x2625bd,null));};exports[_0x9845('0x4a')]=function(_0x53fed5,_0x2d5268){return db[_0x9845('0x2f')][_0x9845('0x4a')](_0x53fed5['body'],{})[_0x9845('0x28')](respondWithResult(_0x2d5268,0xc9))[_0x9845('0x49')](handleError(_0x2d5268,null));};exports[_0x9845('0x4b')]=function(_0x5bf307,_0x408a2f){return db[_0x9845('0x2f')][_0x9845('0x4b')]()[_0x9845('0x28')](respondWithResult(_0x408a2f,null))['catch'](handleError(_0x408a2f,null));};exports[_0x9845('0x4c')]=function(_0x1aa931,_0xb41d16){if(_0x1aa931['body'][_0x9845('0x4d')]){delete _0x1aa931[_0x9845('0x4e')][_0x9845('0x4d')];}return db[_0x9845('0x2f')][_0x9845('0x4f')]({'where':{'uniqueid':_0x1aa931[_0x9845('0x50')]['id']}})[_0x9845('0x28')](handleEntityNotFound(_0xb41d16,null))[_0x9845('0x28')](saveUpdates(_0x1aa931[_0x9845('0x4e')],null))[_0x9845('0x28')](respondWithResult(_0xb41d16,null))[_0x9845('0x49')](handleError(_0xb41d16,null));};
\ No newline at end of file
+var _0xcc91=['uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','CmHopperHistory','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','create','describe','update','body'];(function(_0x2a714a,_0x5bb137){var _0x246ff0=function(_0x10dadd){while(--_0x10dadd){_0x2a714a['push'](_0x2a714a['shift']());}};_0x246ff0(++_0x5bb137);}(_0xcc91,0xe8));var _0x1cc9=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xcc91[_0x132558];return _0x34f138;};'use strict';var emlformat=require(_0x1cc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1cc9('0x1'));var jsonpatch=require(_0x1cc9('0x2'));var rp=require(_0x1cc9('0x3'));var moment=require(_0x1cc9('0x4'));var BPromise=require(_0x1cc9('0x5'));var Mustache=require(_0x1cc9('0x6'));var util=require(_0x1cc9('0x7'));var path=require(_0x1cc9('0x8'));var sox=require(_0x1cc9('0x9'));var csv=require(_0x1cc9('0xa'));var ejs=require(_0x1cc9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1cc9('0xc'));var crypto=require('crypto');var jsforce=require(_0x1cc9('0xd'));var deskjs=require(_0x1cc9('0xe'));var toCsv=require(_0x1cc9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cc9('0xf'));var qs=require(_0x1cc9('0x10'));var as=require(_0x1cc9('0x11'));var hardwareService=require(_0x1cc9('0x12'));var logger=require(_0x1cc9('0x13'))(_0x1cc9('0x14'));var utils=require(_0x1cc9('0x15'));var config=require(_0x1cc9('0x16'));var licenseUtil=require(_0x1cc9('0x17'));var db=require(_0x1cc9('0x18'))['db'];function respondWithStatusCode(_0x11dae2,_0x5e96f0){_0x5e96f0=_0x5e96f0||0xcc;return function(_0x2353be){if(_0x2353be){return _0x11dae2['sendStatus'](_0x5e96f0);}return _0x11dae2['status'](_0x5e96f0)[_0x1cc9('0x19')]();};}function respondWithResult(_0x1c2302,_0x2353d7){_0x2353d7=_0x2353d7||0xc8;return function(_0x39dcfc){if(_0x39dcfc){return _0x1c2302[_0x1cc9('0x1a')](_0x2353d7)[_0x1cc9('0x1b')](_0x39dcfc);}};}function respondWithFilteredResult(_0x40e37c,_0x103d72){return function(_0x2084aa){if(_0x2084aa){var _0x5583cc=typeof _0x103d72[_0x1cc9('0x1c')]==='undefined'&&typeof _0x103d72[_0x1cc9('0x1d')]===_0x1cc9('0x1e');var _0x5bde42=_0x2084aa[_0x1cc9('0x1f')];var _0x56c245=_0x5583cc?0x0:_0x103d72[_0x1cc9('0x1c')];var _0x6199bc=_0x5583cc?_0x2084aa[_0x1cc9('0x1f')]:_0x103d72['offset']+_0x103d72[_0x1cc9('0x1d')];var _0x2aa8fb;if(_0x6199bc>=_0x5bde42){_0x6199bc=_0x5bde42;_0x2aa8fb=0xc8;}else{_0x2aa8fb=0xce;}_0x40e37c[_0x1cc9('0x1a')](_0x2aa8fb);return _0x40e37c[_0x1cc9('0x20')]('Content-Range',_0x56c245+'-'+_0x6199bc+'/'+_0x5bde42)['json'](_0x2084aa);}return null;};}function patchUpdates(_0x1b0069){return function(_0x9ffc13){try{jsonpatch[_0x1cc9('0x21')](_0x9ffc13,_0x1b0069,!![]);}catch(_0x59d53d){return BPromise[_0x1cc9('0x22')](_0x59d53d);}return _0x9ffc13[_0x1cc9('0x23')]();};}function saveUpdates(_0x5c6bdc,_0x171164){return function(_0xf3d3a0){if(_0xf3d3a0){return _0xf3d3a0['update'](_0x5c6bdc)[_0x1cc9('0x24')](function(_0x2d8583){return _0x2d8583;});}return null;};}function removeEntity(_0x2c3876,_0x2ad8c2){return function(_0x4742b6){if(_0x4742b6){return _0x4742b6[_0x1cc9('0x25')]()[_0x1cc9('0x24')](function(){_0x2c3876[_0x1cc9('0x1a')](0xcc)[_0x1cc9('0x19')]();});}};}function handleEntityNotFound(_0x2a8980,_0x46670c){return function(_0x236050){if(!_0x236050){_0x2a8980[_0x1cc9('0x26')](0x194);}return _0x236050;};}function handleError(_0x3c0ad7,_0x4ab04d){_0x4ab04d=_0x4ab04d||0x1f4;return function(_0x30f533){logger['error'](_0x30f533[_0x1cc9('0x27')]);if(_0x30f533[_0x1cc9('0x28')]){delete _0x30f533['name'];}_0x3c0ad7[_0x1cc9('0x1a')](_0x4ab04d)[_0x1cc9('0x29')](_0x30f533);};}exports[_0x1cc9('0x2a')]=function(_0x5cf7fd,_0x42f2f5){var _0x344f7b={},_0x309864={},_0x5d41ee={'count':0x0,'rows':[]};var _0x290280=_[_0x1cc9('0x2b')](db[_0x1cc9('0x2c')]['rawAttributes'],function(_0x2d8ce9){return{'name':_0x2d8ce9[_0x1cc9('0x2d')],'type':_0x2d8ce9[_0x1cc9('0x2e')]['key']};});_0x309864[_0x1cc9('0x2f')]=_['map'](_0x290280,_0x1cc9('0x28'));_0x309864[_0x1cc9('0x30')]=_['keys'](_0x5cf7fd[_0x1cc9('0x30')]);_0x309864[_0x1cc9('0x31')]=_['intersection'](_0x309864['model'],_0x309864['query']);_0x344f7b[_0x1cc9('0x32')]=_[_0x1cc9('0x33')](_0x309864[_0x1cc9('0x2f')],qs[_0x1cc9('0x34')](_0x5cf7fd['query'][_0x1cc9('0x34')]));_0x344f7b[_0x1cc9('0x32')]=_0x344f7b[_0x1cc9('0x32')][_0x1cc9('0x35')]?_0x344f7b[_0x1cc9('0x32')]:_0x309864[_0x1cc9('0x2f')];if(!_0x5cf7fd[_0x1cc9('0x30')][_0x1cc9('0x36')](_0x1cc9('0x37'))){_0x344f7b[_0x1cc9('0x1d')]=qs[_0x1cc9('0x1d')](_0x5cf7fd[_0x1cc9('0x30')][_0x1cc9('0x1d')]);_0x344f7b['offset']=qs[_0x1cc9('0x1c')](_0x5cf7fd[_0x1cc9('0x30')][_0x1cc9('0x1c')]);}_0x344f7b[_0x1cc9('0x38')]=qs[_0x1cc9('0x39')](_0x5cf7fd[_0x1cc9('0x30')][_0x1cc9('0x39')]);_0x344f7b[_0x1cc9('0x3a')]=qs[_0x1cc9('0x31')](_[_0x1cc9('0x3b')](_0x5cf7fd[_0x1cc9('0x30')],_0x309864[_0x1cc9('0x31')]),_0x290280);if(_0x5cf7fd[_0x1cc9('0x30')]['filter']){_0x344f7b[_0x1cc9('0x3a')]=_['merge'](_0x344f7b[_0x1cc9('0x3a')],{'$or':_['map'](_0x290280,function(_0x4fe558){if(_0x4fe558[_0x1cc9('0x2e')]!==_0x1cc9('0x3c')){var _0x423fed={};_0x423fed[_0x4fe558[_0x1cc9('0x28')]]={'$like':'%'+_0x5cf7fd['query'][_0x1cc9('0x3d')]+'%'};return _0x423fed;}})});}_0x344f7b=_[_0x1cc9('0x3e')]({},_0x344f7b,_0x5cf7fd['options']);var _0x1ec454={'where':_0x344f7b[_0x1cc9('0x3a')]};return db[_0x1cc9('0x2c')][_0x1cc9('0x1f')](_0x1ec454)[_0x1cc9('0x24')](function(_0x4e95b4){_0x5d41ee[_0x1cc9('0x1f')]=_0x4e95b4;if(_0x5cf7fd[_0x1cc9('0x30')]['includeAll']){_0x344f7b[_0x1cc9('0x3f')]=[{'all':!![]}];}return db[_0x1cc9('0x2c')][_0x1cc9('0x40')](_0x344f7b);})[_0x1cc9('0x24')](function(_0x16b749){_0x5d41ee[_0x1cc9('0x41')]=_0x16b749;return _0x5d41ee;})[_0x1cc9('0x24')](respondWithFilteredResult(_0x42f2f5,_0x344f7b))[_0x1cc9('0x42')](handleError(_0x42f2f5,null));};exports['show']=function(_0xca03a2,_0x2c5fd6){var _0xe86604={'raw':!![],'where':{'id':_0xca03a2[_0x1cc9('0x43')]['id']}},_0x3e8f71={};_0x3e8f71[_0x1cc9('0x2f')]=_['keys'](db['CmHopperHistory'][_0x1cc9('0x44')]);_0x3e8f71[_0x1cc9('0x30')]=_['keys'](_0xca03a2['query']);_0x3e8f71['filters']=_[_0x1cc9('0x33')](_0x3e8f71[_0x1cc9('0x2f')],_0x3e8f71[_0x1cc9('0x30')]);_0xe86604[_0x1cc9('0x32')]=_[_0x1cc9('0x33')](_0x3e8f71[_0x1cc9('0x2f')],qs['fields'](_0xca03a2[_0x1cc9('0x30')][_0x1cc9('0x34')]));_0xe86604['attributes']=_0xe86604[_0x1cc9('0x32')][_0x1cc9('0x35')]?_0xe86604[_0x1cc9('0x32')]:_0x3e8f71[_0x1cc9('0x2f')];if(_0xca03a2[_0x1cc9('0x30')][_0x1cc9('0x45')]){_0xe86604['include']=[{'all':!![]}];}_0xe86604=_[_0x1cc9('0x3e')]({},_0xe86604,_0xca03a2[_0x1cc9('0x46')]);return db[_0x1cc9('0x2c')][_0x1cc9('0x47')](_0xe86604)[_0x1cc9('0x24')](handleEntityNotFound(_0x2c5fd6,null))[_0x1cc9('0x24')](respondWithResult(_0x2c5fd6,null))[_0x1cc9('0x42')](handleError(_0x2c5fd6,null));};exports[_0x1cc9('0x48')]=function(_0xc645b7,_0x4fe54e){return db[_0x1cc9('0x2c')][_0x1cc9('0x48')](_0xc645b7['body'],{})['then'](respondWithResult(_0x4fe54e,0xc9))[_0x1cc9('0x42')](handleError(_0x4fe54e,null));};exports[_0x1cc9('0x49')]=function(_0x4b8bf9,_0x4bda9d){return db['CmHopperHistory'][_0x1cc9('0x49')]()[_0x1cc9('0x24')](respondWithResult(_0x4bda9d,null))[_0x1cc9('0x42')](handleError(_0x4bda9d,null));};exports[_0x1cc9('0x4a')]=function(_0x19c9f8,_0xcd53ee){if(_0x19c9f8[_0x1cc9('0x4b')][_0x1cc9('0x4c')]){delete _0x19c9f8['body']['uniqueid'];}return db[_0x1cc9('0x2c')][_0x1cc9('0x47')]({'where':{'uniqueid':_0x19c9f8[_0x1cc9('0x43')]['id']}})[_0x1cc9('0x24')](handleEntityNotFound(_0xcd53ee,null))[_0x1cc9('0x24')](saveUpdates(_0x19c9f8['body'],null))[_0x1cc9('0x24')](respondWithResult(_0xcd53ee,null))[_0x1cc9('0x42')](handleError(_0xcd53ee,null));};
\ No newline at end of file
index e9b88e0..c61d79d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x627e=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3c7014,_0xafb0fa){var _0x2ed4eb=function(_0x293284){while(--_0x293284){_0x3c7014['push'](_0x3c7014['shift']());}};_0x2ed4eb(++_0xafb0fa);}(_0x627e,0x14a));var _0xe627=function(_0x56cdf7,_0x7f917a){_0x56cdf7=_0x56cdf7-0x0;var _0x47df2d=_0x627e[_0x56cdf7];return _0x47df2d;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var logger=require(_0xe627('0x2'))(_0xe627('0x3'));var moment=require(_0xe627('0x4'));var BPromise=require('bluebird');var rp=require(_0xe627('0x5'));var fs=require('fs');var path=require(_0xe627('0x6'));var rimraf=require(_0xe627('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x1a1a3d,_0x3f2791){return _0x1a1a3d[_0xe627('0x8')](_0xe627('0x9'),attributes,{'tableName':_0xe627('0xa'),'paranoid':![],'indexes':[{'name':_0xe627('0xb'),'fields':['endtime']},{'name':_0xe627('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9eb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x137c51,_0x1b0ab4){var _0x77b4d3=function(_0x246695){while(--_0x246695){_0x137c51['push'](_0x137c51['shift']());}};_0x77b4d3(++_0x1b0ab4);}(_0xd9eb,0xca));var _0xbd9e=function(_0x28d31d,_0x57a4e6){_0x28d31d=_0x28d31d-0x0;var _0x2df7c1=_0xd9eb[_0x28d31d];return _0x2df7c1;};'use strict';var _=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var logger=require(_0xbd9e('0x2'))(_0xbd9e('0x3'));var moment=require(_0xbd9e('0x4'));var BPromise=require(_0xbd9e('0x5'));var rp=require(_0xbd9e('0x6'));var fs=require('fs');var path=require(_0xbd9e('0x7'));var rimraf=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var attributes=require(_0xbd9e('0xa'));module[_0xbd9e('0xb')]=function(_0x20c36a,_0x4ade3f){return _0x20c36a[_0xbd9e('0xc')](_0xbd9e('0xd'),attributes,{'tableName':_0xbd9e('0xe'),'paranoid':![],'indexes':[{'name':_0xbd9e('0xf'),'fields':[_0xbd9e('0xf')]},{'name':_0xbd9e('0x10'),'fields':[_0xbd9e('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
index b7a932a..9364a71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb941=['GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','stringify','code','error','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','debug','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','findAll','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory'];(function(_0x5a69e6,_0x87022c){var _0x231b81=function(_0x2208c8){while(--_0x2208c8){_0x5a69e6['push'](_0x5a69e6['shift']());}};_0x231b81(++_0x87022c);}(_0xb941,0x1ec));var _0x1b94=function(_0xad64c,_0x4538b0){_0xad64c=_0xad64c-0x0;var _0x339763=_0xb941[_0xad64c];return _0x339763;};'use strict';var _=require(_0x1b94('0x0'));var util=require(_0x1b94('0x1'));var moment=require('moment');var BPromise=require(_0x1b94('0x2'));var rs=require(_0x1b94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b94('0x4'))['db'];var utils=require(_0x1b94('0x5'));var logger=require(_0x1b94('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1b94('0x7')][_0x1b94('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x152ac8,_0x11e377,_0x47de06){return new BPromise(function(_0x33b924,_0x458bb7){return client[_0x1b94('0x9')](_0x152ac8,_0x47de06)[_0x1b94('0xa')](function(_0x2428d1){logger[_0x1b94('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x11e377,_0x1b94('0xc'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x11e377,_0x1b94('0xc'),JSON[_0x1b94('0xd')](_0x2428d1));if(_0x2428d1['error']){if(_0x2428d1['error'][_0x1b94('0xe')]===0x1f4){logger[_0x1b94('0xf')](_0x1b94('0x10'),_0x11e377,_0x2428d1[_0x1b94('0xf')][_0x1b94('0x11')]);return _0x458bb7(_0x2428d1[_0x1b94('0xf')][_0x1b94('0x11')]);}logger[_0x1b94('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x11e377,_0x2428d1['error'][_0x1b94('0x11')]);return _0x33b924(_0x2428d1['error'][_0x1b94('0x11')]);}else{logger['info'](_0x1b94('0x10'),_0x11e377,_0x1b94('0xc'));_0x33b924(_0x2428d1['result'][_0x1b94('0x11')]);}})[_0x1b94('0x12')](function(_0x36e4a0){logger[_0x1b94('0xf')](_0x1b94('0x10'),_0x11e377,_0x36e4a0);_0x458bb7(_0x36e4a0);});});}exports[_0x1b94('0x13')]=function(_0x24587f){var _0x2911e6=this;return new Promise(function(_0x5bbb8c,_0x57e535){return db[_0x1b94('0x14')][_0x1b94('0x15')](_0x24587f['body'],{'raw':_0x24587f[_0x1b94('0x16')]?_0x24587f[_0x1b94('0x16')][_0x1b94('0x17')]===undefined?!![]:![]:!![]})[_0x1b94('0xa')](function(_0x1b26fc){logger[_0x1b94('0xb')](_0x1b94('0x13'),_0x24587f);logger[_0x1b94('0x18')]('CreateCmHopperHistory',_0x24587f,JSON[_0x1b94('0xd')](_0x1b26fc));_0x5bbb8c(_0x1b26fc);})['catch'](function(_0x2f9f03){logger[_0x1b94('0xf')](_0x1b94('0x13'),_0x2f9f03[_0x1b94('0x11')],_0x24587f);_0x57e535(_0x2911e6[_0x1b94('0xf')](0x1f4,_0x2f9f03[_0x1b94('0x11')]));});});};exports[_0x1b94('0x19')]=function(_0x52f73d){var _0x4da4db=this;return new Promise(function(_0x27360b,_0x1b75c1){return db[_0x1b94('0x14')]['findAll']({'raw':_0x52f73d['options']?_0x52f73d[_0x1b94('0x16')][_0x1b94('0x17')]===undefined?!![]:![]:!![],'where':_0x52f73d['options']?_0x52f73d[_0x1b94('0x16')]['where']||null:null,'attributes':[[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')][_0x1b94('0x1c')]('id')),_0x1b94('0x1d')],[db[_0x1b94('0x1a')]['fn']('COUNT',db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x1f')))),_0x1b94('0x20')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db['sequelize']['fn']('IF',db[_0x1b94('0x1a')]['literal'](_0x1b94('0x21')))),_0x1b94('0x22')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')]['literal'](_0x1b94('0x23')))),_0x1b94('0x24')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x25'),db[_0x1b94('0x1a')]['fn']('IF',db['sequelize'][_0x1b94('0x1e')](_0x1b94('0x26')))),_0x1b94('0x27')],[db['sequelize']['fn'](_0x1b94('0x25'),db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')]['literal'](_0x1b94('0x28')))),_0x1b94('0x29')]]})[_0x1b94('0xa')](function(_0x292c38){logger[_0x1b94('0xb')](_0x1b94('0x19'),_0x52f73d);logger['debug'](_0x1b94('0x19'),_0x52f73d,JSON['stringify'](_0x292c38));_0x27360b(_0x292c38);})[_0x1b94('0x12')](function(_0x2c2468){logger[_0x1b94('0xf')](_0x1b94('0x19'),_0x2c2468[_0x1b94('0x11')],_0x52f73d);_0x1b75c1(_0x4da4db['error'](0x1f4,_0x2c2468[_0x1b94('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x3394cc){var _0x2626e7=this;return new Promise(function(_0x17f7ba,_0x5878e){return db[_0x1b94('0x14')][_0x1b94('0x2a')]({'raw':_0x3394cc[_0x1b94('0x16')]?_0x3394cc[_0x1b94('0x16')][_0x1b94('0x17')]===undefined?!![]:![]:!![],'where':_0x3394cc['options']?_0x3394cc[_0x1b94('0x16')][_0x1b94('0x2b')]||null:null,'attributes':[[_0x1b94('0x2c'),_0x1b94('0x2d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x2e')))),_0x1b94('0x2f')],[db[_0x1b94('0x1a')]['fn']('COUNT',db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x30')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x1b94('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0x1b94('0x1e')](_0x1b94('0x1f')))),_0x1b94('0x31')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x32')))),_0x1b94('0x33')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0x1b94('0x1e')]('`state`\x20=\x208,\x201,\x20null'))),_0x1b94('0x34')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x35')))),_0x1b94('0x36')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')]['literal'](_0x1b94('0x37')))),_0x1b94('0x38')],[db['sequelize']['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')]['fn']('IF',db['sequelize'][_0x1b94('0x1e')]('`state`\x20=\x2012,\x201,\x20null'))),_0x1b94('0x39')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')]['fn']('IF',db['sequelize'][_0x1b94('0x1e')](_0x1b94('0x3a')))),_0x1b94('0x3b')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db['sequelize']['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x3c')))),'outboundOriginateFailureCallsDay'],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x3d')))),_0x1b94('0x3e')],[db[_0x1b94('0x1a')]['fn']('COUNT',db[_0x1b94('0x1a')]['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x3f')))),'outboundAnswerAgiCallsDay'],[db[_0x1b94('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1b94('0x1a')][_0x1b94('0x1e')](_0x1b94('0x40')))),_0x1b94('0x3e')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')]['fn']('IF',db['sequelize'][_0x1b94('0x1e')](_0x1b94('0x41')))),_0x1b94('0x42')]],'group':['campaign']})['then'](function(_0x934825){logger[_0x1b94('0xb')](_0x1b94('0x43'),_0x3394cc);logger[_0x1b94('0x18')]('GetVoiceQueueHopperHistory',_0x3394cc,JSON[_0x1b94('0xd')](_0x934825));_0x17f7ba(_0x934825);})[_0x1b94('0x12')](function(_0x11c40a){logger['error'](_0x1b94('0x43'),_0x11c40a[_0x1b94('0x11')],_0x3394cc);_0x5878e(_0x2626e7[_0x1b94('0xf')](0x1f4,_0x11c40a['message']));});});};exports[_0x1b94('0x44')]=function(_0x56ca2c){var _0x480811=this;return new Promise(function(_0x5d6d86,_0x162a4f){return db[_0x1b94('0x14')]['findAll']({'raw':_0x56ca2c[_0x1b94('0x16')]?_0x56ca2c['options']['raw']===undefined?!![]:![]:!![],'where':_0x56ca2c[_0x1b94('0x16')]?_0x56ca2c[_0x1b94('0x16')][_0x1b94('0x2b')]||null:null,'attributes':[[_0x1b94('0x2c'),_0x1b94('0x2d')],[db[_0x1b94('0x1a')]['fn'](_0x1b94('0x1b'),db[_0x1b94('0x1a')][_0x1b94('0x1c')]('id')),'ivrTotalCallsDays'],[db[_0x1b94('0x1a')]['fn']('COUNT',db[_0x1b94('0x1a')]['fn']('IF',db['sequelize'][_0x1b94('0x1e')](_0x1b94('0x1f')))),_0x1b94('0x45')]],'group':[_0x1b94('0x2c')]})[_0x1b94('0xa')](function(_0x4255f4){logger['info'](_0x1b94('0x44'),_0x56ca2c);logger[_0x1b94('0x18')](_0x1b94('0x44'),_0x56ca2c,JSON[_0x1b94('0xd')](_0x4255f4));_0x5d6d86(_0x4255f4);})[_0x1b94('0x12')](function(_0x2e9063){logger[_0x1b94('0xf')](_0x1b94('0x44'),_0x2e9063[_0x1b94('0x11')],_0x56ca2c);_0x162a4f(_0x480811[_0x1b94('0xf')](0x1f4,_0x2e9063['message']));});});};
\ No newline at end of file
+var _0xd813=['catch','CreateCmHopperHistory','CmHopperHistory','body','options','stringify','AvgHandleTime','findAll','raw','where','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','CmHopperHistory,\x20%s,\x20%s','message'];(function(_0x42e3fb,_0x1c7dde){var _0x44f77f=function(_0x114642){while(--_0x114642){_0x42e3fb['push'](_0x42e3fb['shift']());}};_0x44f77f(++_0x1c7dde);}(_0xd813,0x19c));var _0x3d81=function(_0x708c33,_0x57e9f2){_0x708c33=_0x708c33-0x0;var _0xe5e059=_0xd813[_0x708c33];return _0xe5e059;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3d81('0x0'));var BPromise=require(_0x3d81('0x1'));var rs=require(_0x3d81('0x2'));var fs=require('fs');var Redis=require(_0x3d81('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d81('0x4'));var logger=require(_0x3d81('0x5'))(_0x3d81('0x6'));var config=require(_0x3d81('0x7'));var jayson=require(_0x3d81('0x8'));var client=jayson[_0x3d81('0x9')][_0x3d81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a94c6,_0x35f582,_0x36275e){return new BPromise(function(_0x528344,_0x14bbfd){return client[_0x3d81('0xb')](_0x2a94c6,_0x36275e)[_0x3d81('0xc')](function(_0x3780d7){logger[_0x3d81('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x35f582,_0x3d81('0xe'));logger[_0x3d81('0xf')](_0x3d81('0x10'),_0x35f582,_0x3d81('0xe'),JSON['stringify'](_0x3780d7));if(_0x3780d7[_0x3d81('0x11')]){if(_0x3780d7['error']['code']===0x1f4){logger['error'](_0x3d81('0x12'),_0x35f582,_0x3780d7[_0x3d81('0x11')][_0x3d81('0x13')]);return _0x14bbfd(_0x3780d7['error'][_0x3d81('0x13')]);}logger[_0x3d81('0x11')](_0x3d81('0x12'),_0x35f582,_0x3780d7['error'][_0x3d81('0x13')]);return _0x528344(_0x3780d7[_0x3d81('0x11')]['message']);}else{logger[_0x3d81('0xd')](_0x3d81('0x12'),_0x35f582,'request\x20sent');_0x528344(_0x3780d7['result'][_0x3d81('0x13')]);}})[_0x3d81('0x14')](function(_0x233e0e){logger[_0x3d81('0x11')](_0x3d81('0x12'),_0x35f582,_0x233e0e);_0x14bbfd(_0x233e0e);});});}exports[_0x3d81('0x15')]=function(_0x5ad83b){var _0x4285ec=this;return new Promise(function(_0x5e1770,_0x3a3281){return db[_0x3d81('0x16')]['create'](_0x5ad83b[_0x3d81('0x17')],{'raw':_0x5ad83b[_0x3d81('0x18')]?_0x5ad83b[_0x3d81('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x3d81('0xc')](function(_0x1794bf){logger[_0x3d81('0xd')]('CreateCmHopperHistory',_0x5ad83b);logger[_0x3d81('0xf')](_0x3d81('0x15'),_0x5ad83b,JSON[_0x3d81('0x19')](_0x1794bf));_0x5e1770(_0x1794bf);})[_0x3d81('0x14')](function(_0x2694f1){logger['error'](_0x3d81('0x15'),_0x2694f1['message'],_0x5ad83b);_0x3a3281(_0x4285ec['error'](0x1f4,_0x2694f1[_0x3d81('0x13')]));});});};exports[_0x3d81('0x1a')]=function(_0x130b95){var _0x2843f1=this;return new Promise(function(_0x11412d,_0x2c57ac){return db[_0x3d81('0x16')][_0x3d81('0x1b')]({'raw':_0x130b95[_0x3d81('0x18')]?_0x130b95[_0x3d81('0x18')][_0x3d81('0x1c')]===undefined?!![]:![]:!![],'where':_0x130b95[_0x3d81('0x18')]?_0x130b95[_0x3d81('0x18')][_0x3d81('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x3d81('0x1e'),db['sequelize'][_0x3d81('0x1f')]('id')),_0x3d81('0x20')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x23')))),_0x3d81('0x24')],[db['sequelize']['fn']('COUNT',db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x25')))),_0x3d81('0x26')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x3d81('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0x3d81('0x27')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x28'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x3d81('0x29')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x28'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')](_0x3d81('0x2a')))),_0x3d81('0x2b')]]})[_0x3d81('0xc')](function(_0x4970c4){logger[_0x3d81('0xd')](_0x3d81('0x1a'),_0x130b95);logger[_0x3d81('0xf')](_0x3d81('0x1a'),_0x130b95,JSON[_0x3d81('0x19')](_0x4970c4));_0x11412d(_0x4970c4);})[_0x3d81('0x14')](function(_0x5eccb4){logger[_0x3d81('0x11')](_0x3d81('0x1a'),_0x5eccb4[_0x3d81('0x13')],_0x130b95);_0x2c57ac(_0x2843f1[_0x3d81('0x11')](0x1f4,_0x5eccb4[_0x3d81('0x13')]));});});};exports[_0x3d81('0x2c')]=function(_0x2f818d){var _0x35c16f=this;return new Promise(function(_0xdc0b1e,_0x5c10a2){return db['CmHopperHistory']['findAll']({'raw':_0x2f818d['options']?_0x2f818d[_0x3d81('0x18')][_0x3d81('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f818d[_0x3d81('0x18')]?_0x2f818d[_0x3d81('0x18')][_0x3d81('0x1d')]||null:null,'attributes':[[_0x3d81('0x2d'),'name'],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3d81('0x2e')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x2f')))),_0x3d81('0x30')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')](_0x3d81('0x23')))),_0x3d81('0x31')],[db[_0x3d81('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3d81('0x32')))),_0x3d81('0x33')],[db['sequelize']['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')]['literal'](_0x3d81('0x34')))),_0x3d81('0x35')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db['sequelize']['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x36')))),_0x3d81('0x37')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db['sequelize']['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x38')))),_0x3d81('0x39')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x3a')))),_0x3d81('0x3b')],[db['sequelize']['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0x3d81('0x3c')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x3d')))),_0x3d81('0x3e')],[db[_0x3d81('0x21')]['fn']('COUNT',db[_0x3d81('0x21')]['fn']('IF',db['sequelize']['literal'](_0x3d81('0x3f')))),_0x3d81('0x40')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')](_0x3d81('0x41')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')](_0x3d81('0x42')))),_0x3d81('0x40')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x43')))),_0x3d81('0x44')]],'group':[_0x3d81('0x2d')]})[_0x3d81('0xc')](function(_0x34ea2a){logger[_0x3d81('0xd')](_0x3d81('0x2c'),_0x2f818d);logger[_0x3d81('0xf')](_0x3d81('0x2c'),_0x2f818d,JSON[_0x3d81('0x19')](_0x34ea2a));_0xdc0b1e(_0x34ea2a);})['catch'](function(_0x54d4d7){logger['error'](_0x3d81('0x2c'),_0x54d4d7[_0x3d81('0x13')],_0x2f818d);_0x5c10a2(_0x35c16f[_0x3d81('0x11')](0x1f4,_0x54d4d7[_0x3d81('0x13')]));});});};exports[_0x3d81('0x45')]=function(_0x189d18){var _0x378b11=this;return new Promise(function(_0x55bb8b,_0x3ac45e){return db[_0x3d81('0x16')][_0x3d81('0x1b')]({'raw':_0x189d18['options']?_0x189d18[_0x3d81('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x189d18['options']?_0x189d18[_0x3d81('0x18')][_0x3d81('0x1d')]||null:null,'attributes':[[_0x3d81('0x2d'),_0x3d81('0x46')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db['sequelize'][_0x3d81('0x1f')]('id')),_0x3d81('0x47')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':['campaign']})['then'](function(_0x5a88b1){logger[_0x3d81('0xd')](_0x3d81('0x45'),_0x189d18);logger[_0x3d81('0xf')](_0x3d81('0x45'),_0x189d18,JSON[_0x3d81('0x19')](_0x5a88b1));_0x55bb8b(_0x5a88b1);})[_0x3d81('0x14')](function(_0x26e84c){logger[_0x3d81('0x11')]('GetCampaignHopperHistory',_0x26e84c['message'],_0x189d18);_0x3ac45e(_0x378b11[_0x3d81('0x11')](0x1f4,_0x26e84c[_0x3d81('0x13')]));});});};
\ No newline at end of file
index 5d0445e..11ab5ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c8=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','post','create','put','/:id','update','exports','multer','util'];(function(_0x6c0e71,_0x30b942){var _0x5edcad=function(_0x2f5a68){while(--_0x2f5a68){_0x6c0e71['push'](_0x6c0e71['shift']());}};_0x5edcad(++_0x30b942);}(_0x81c8,0x152));var _0x881c=function(_0x4c5833,_0x480cb9){_0x4c5833=_0x4c5833-0x0;var _0x252984=_0x81c8[_0x4c5833];return _0x252984;};'use strict';var multer=require(_0x881c('0x0'));var util=require(_0x881c('0x1'));var path=require(_0x881c('0x2'));var timeout=require(_0x881c('0x3'));var express=require(_0x881c('0x4'));var router=express[_0x881c('0x5')]();var fs_extra=require(_0x881c('0x6'));var auth=require(_0x881c('0x7'));var interaction=require(_0x881c('0x8'));var config=require(_0x881c('0x9'));var controller=require('./cmHopperHistory.controller');router[_0x881c('0xa')]('/',auth[_0x881c('0xb')](),controller['index']);router['get'](_0x881c('0xc'),auth[_0x881c('0xb')](),controller[_0x881c('0xd')]);router[_0x881c('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x881c('0xe')]('/',auth[_0x881c('0xb')](),controller[_0x881c('0xf')]);router[_0x881c('0x10')](_0x881c('0x11'),auth[_0x881c('0xb')](),controller[_0x881c('0x12')]);module[_0x881c('0x13')]=router;
\ No newline at end of file
+var _0x4f3c=['./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x44a923,_0x127746){var _0x4a086e=function(_0x4519e1){while(--_0x4519e1){_0x44a923['push'](_0x44a923['shift']());}};_0x4a086e(++_0x127746);}(_0x4f3c,0xb4));var _0xc4f3=function(_0x294f3d,_0x1b0f82){_0x294f3d=_0x294f3d-0x0;var _0x2c8f6c=_0x4f3c[_0x294f3d];return _0x2c8f6c;};'use strict';var multer=require('multer');var util=require(_0xc4f3('0x0'));var path=require(_0xc4f3('0x1'));var timeout=require(_0xc4f3('0x2'));var express=require(_0xc4f3('0x3'));var router=express[_0xc4f3('0x4')]();var fs_extra=require(_0xc4f3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc4f3('0x6'));var controller=require(_0xc4f3('0x7'));router[_0xc4f3('0x8')]('/',auth[_0xc4f3('0x9')](),controller['index']);router[_0xc4f3('0x8')](_0xc4f3('0xa'),auth[_0xc4f3('0x9')](),controller[_0xc4f3('0xb')]);router[_0xc4f3('0x8')](_0xc4f3('0xc'),auth[_0xc4f3('0x9')](),controller[_0xc4f3('0xd')]);router[_0xc4f3('0xe')]('/',auth[_0xc4f3('0x9')](),controller['create']);router[_0xc4f3('0xf')](_0xc4f3('0xc'),auth['isAuthenticated'](),controller[_0xc4f3('0x10')]);module['exports']=router;
\ No newline at end of file
index 0728785..81f785d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb647=['exports','STRING','name','sequelize'];(function(_0x865b09,_0x5659c7){var _0x476861=function(_0x1e47e3){while(--_0x1e47e3){_0x865b09['push'](_0x865b09['shift']());}};_0x476861(++_0x5659c7);}(_0xb647,0xdb));var _0x7b64=function(_0x98e261,_0x139f53){_0x98e261=_0x98e261-0x0;var _0x3d1eae=_0xb647[_0x98e261];return _0x3d1eae;};'use strict';var Sequelize=require(_0x7b64('0x0'));module[_0x7b64('0x1')]={'name':{'type':Sequelize[_0x7b64('0x2')],'unique':_0x7b64('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7b64('0x2')]},'dialPrefix':{'type':Sequelize[_0x7b64('0x2')]}};
\ No newline at end of file
+var _0x165d=['STRING','name','sequelize','exports'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x165d,0x14a));var _0xd165=function(_0x3ca477,_0x2f4b41){_0x3ca477=_0x3ca477-0x0;var _0x2bfafa=_0x165d[_0x3ca477];return _0x2bfafa;};'use strict';var Sequelize=require(_0xd165('0x0'));module[_0xd165('0x1')]={'name':{'type':Sequelize[_0xd165('0x2')],'unique':_0xd165('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd165('0x2')]},'dialPrefix':{'type':Sequelize[_0xd165('0x2')]}};
\ No newline at end of file
index 08aab1a..021dfb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa97a=['getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','json','offset','limit','count','set','Content-Range','update','then','Lists','UserProfileResource','destroy','error','stack','name','status','send','index','map','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','CmList','includeAll','include','findAll','rows','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','ListId','Disposition','findOne','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomField','sequelize','Sequelize','text','TEXT','number','INTEGER','switch','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove'];(function(_0x28d420,_0x1a33d0){var _0x3fc209=function(_0x40029e){while(--_0x40029e){_0x28d420['push'](_0x28d420['shift']());}};_0x3fc209(++_0x1a33d0);}(_0xa97a,0x124));var _0xaa97=function(_0x438d50,_0x2ba078){_0x438d50=_0x438d50-0x0;var _0x352601=_0xa97a[_0x438d50];return _0x352601;};'use strict';var emlformat=require(_0xaa97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa97('0x1'));var jsonpatch=require(_0xaa97('0x2'));var rp=require(_0xaa97('0x3'));var moment=require(_0xaa97('0x4'));var BPromise=require(_0xaa97('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaa97('0x6'));var sox=require(_0xaa97('0x7'));var csv=require(_0xaa97('0x8'));var ejs=require(_0xaa97('0x9'));var fs=require('fs');var fs_extra=require(_0xaa97('0xa'));var _=require('lodash');var squel=require(_0xaa97('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa97('0xc'));var toCsv=require(_0xaa97('0x8'));var querystring=require(_0xaa97('0xd'));var Papa=require(_0xaa97('0xe'));var Redis=require('ioredis');var authService=require(_0xaa97('0xf'));var qs=require(_0xaa97('0x10'));var as=require(_0xaa97('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa97('0x12'))(_0xaa97('0x13'));var utils=require(_0xaa97('0x14'));var config=require(_0xaa97('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa97('0x16'))['db'];config[_0xaa97('0x17')]=_[_0xaa97('0x18')](config[_0xaa97('0x17')],{'host':_0xaa97('0x19'),'port':0x18eb});var socket=require(_0xaa97('0x1a'))(new Redis(config[_0xaa97('0x17')]));require(_0xaa97('0x1b'))[_0xaa97('0x1c')](socket);function respondWithStatusCode(_0xd510da,_0x10e96a){_0x10e96a=_0x10e96a||0xcc;return function(_0x548f22){if(_0x548f22){return _0xd510da[_0xaa97('0x1d')](_0x10e96a);}return _0xd510da['status'](_0x10e96a)[_0xaa97('0x1e')]();};}function respondWithResult(_0x63ac69,_0x160887){_0x160887=_0x160887||0xc8;return function(_0x1c31ac){if(_0x1c31ac){return _0x63ac69['status'](_0x160887)[_0xaa97('0x1f')](_0x1c31ac);}};}function respondWithFilteredResult(_0x5dbe5b,_0x213b74){return function(_0x1524ea){if(_0x1524ea){var _0x184f77=typeof _0x213b74[_0xaa97('0x20')]==='undefined'&&typeof _0x213b74[_0xaa97('0x21')]==='undefined';var _0x4abd44=_0x1524ea['count'];var _0xa4f57c=_0x184f77?0x0:_0x213b74[_0xaa97('0x20')];var _0x18f445=_0x184f77?_0x1524ea[_0xaa97('0x22')]:_0x213b74[_0xaa97('0x20')]+_0x213b74['limit'];var _0x301255;if(_0x18f445>=_0x4abd44){_0x18f445=_0x4abd44;_0x301255=0xc8;}else{_0x301255=0xce;}_0x5dbe5b['status'](_0x301255);return _0x5dbe5b[_0xaa97('0x23')](_0xaa97('0x24'),_0xa4f57c+'-'+_0x18f445+'/'+_0x4abd44)[_0xaa97('0x1f')](_0x1524ea);}return null;};}function patchUpdates(_0x2fd8f8){return function(_0x4c8a9f){try{jsonpatch['apply'](_0x4c8a9f,_0x2fd8f8,!![]);}catch(_0x5457cc){return BPromise['reject'](_0x5457cc);}return _0x4c8a9f['save']();};}function saveUpdates(_0x17bb24,_0x221fcb){return function(_0xe7040){if(_0xe7040){return _0xe7040[_0xaa97('0x25')](_0x17bb24)[_0xaa97('0x26')](function(_0x14ddde){return _0x14ddde;});}return null;};}function removeEntity(_0x2efe3b,_0x576245){return function(_0x24896b){if(_0x24896b){return _0x24896b['destroy']()['then'](function(){var _0x482cde=_0x24896b['get']({'plain':!![]});var _0x550931=_0xaa97('0x27');return db[_0xaa97('0x28')][_0xaa97('0x29')]({'where':{'type':_0x550931,'resourceId':_0x482cde['id']}})[_0xaa97('0x26')](function(){return _0x24896b;});})[_0xaa97('0x26')](function(){_0x2efe3b['status'](0xcc)[_0xaa97('0x1e')]();});}};}function handleEntityNotFound(_0x60dbd5,_0x33263e){return function(_0x3b2860){if(!_0x3b2860){_0x60dbd5[_0xaa97('0x1d')](0x194);}return _0x3b2860;};}function handleError(_0x1d7bcd,_0x3e7cb2){_0x3e7cb2=_0x3e7cb2||0x1f4;return function(_0x179769){logger[_0xaa97('0x2a')](_0x179769[_0xaa97('0x2b')]);if(_0x179769[_0xaa97('0x2c')]){delete _0x179769['name'];}_0x1d7bcd[_0xaa97('0x2d')](_0x3e7cb2)[_0xaa97('0x2e')](_0x179769);};}exports[_0xaa97('0x2f')]=function(_0x27c21a,_0x42d4a6){var _0x16704a={},_0x20ef45={},_0x9326d6={'count':0x0,'rows':[]};var _0x23daf7=_[_0xaa97('0x30')](db['CmList'][_0xaa97('0x31')],function(_0x2b2935){return{'name':_0x2b2935[_0xaa97('0x32')],'type':_0x2b2935['type']['key']};});_0x20ef45[_0xaa97('0x33')]=_[_0xaa97('0x30')](_0x23daf7,'name');_0x20ef45['query']=_[_0xaa97('0x34')](_0x27c21a[_0xaa97('0x35')]);_0x20ef45['filters']=_['intersection'](_0x20ef45[_0xaa97('0x33')],_0x20ef45[_0xaa97('0x35')]);_0x16704a[_0xaa97('0x36')]=_[_0xaa97('0x37')](_0x20ef45[_0xaa97('0x33')],qs[_0xaa97('0x38')](_0x27c21a[_0xaa97('0x35')][_0xaa97('0x38')]));_0x16704a[_0xaa97('0x36')]=_0x16704a[_0xaa97('0x36')][_0xaa97('0x39')]?_0x16704a[_0xaa97('0x36')]:_0x20ef45['model'];if(!_0x27c21a['query'][_0xaa97('0x3a')](_0xaa97('0x3b'))){_0x16704a[_0xaa97('0x21')]=qs['limit'](_0x27c21a[_0xaa97('0x35')][_0xaa97('0x21')]);_0x16704a[_0xaa97('0x20')]=qs['offset'](_0x27c21a[_0xaa97('0x35')][_0xaa97('0x20')]);}_0x16704a[_0xaa97('0x3c')]=qs['sort'](_0x27c21a[_0xaa97('0x35')][_0xaa97('0x3d')]);_0x16704a[_0xaa97('0x3e')]=qs['filters'](_[_0xaa97('0x3f')](_0x27c21a['query'],_0x20ef45[_0xaa97('0x40')]),_0x23daf7);if(_0x27c21a[_0xaa97('0x35')]['filter']){_0x16704a['where']=_[_0xaa97('0x41')](_0x16704a[_0xaa97('0x3e')],{'$or':_[_0xaa97('0x30')](_0x23daf7,function(_0x4b5e56){if(_0x4b5e56[_0xaa97('0x42')]!==_0xaa97('0x43')){var _0x19a474={};_0x19a474[_0x4b5e56[_0xaa97('0x2c')]]={'$like':'%'+_0x27c21a[_0xaa97('0x35')][_0xaa97('0x44')]+'%'};return _0x19a474;}})});}_0x16704a=_['merge']({},_0x16704a,_0x27c21a[_0xaa97('0x45')]);var _0x51a8b4={'where':_0x16704a[_0xaa97('0x3e')]};return db[_0xaa97('0x46')]['count'](_0x51a8b4)['then'](function(_0x7d6bde){_0x9326d6[_0xaa97('0x22')]=_0x7d6bde;if(_0x27c21a[_0xaa97('0x35')][_0xaa97('0x47')]){_0x16704a[_0xaa97('0x48')]=[{'all':!![]}];}return db[_0xaa97('0x46')][_0xaa97('0x49')](_0x16704a);})[_0xaa97('0x26')](function(_0x185332){_0x9326d6[_0xaa97('0x4a')]=_0x185332;return _0x9326d6;})[_0xaa97('0x26')](respondWithFilteredResult(_0x42d4a6,_0x16704a))['catch'](handleError(_0x42d4a6,null));};exports[_0xaa97('0x4b')]=function(_0x453f24,_0x55b548){var _0xac67a6={'raw':![],'where':{'id':_0x453f24['params']['id']}},_0x2426c4={};_0x2426c4[_0xaa97('0x33')]=_[_0xaa97('0x34')](db[_0xaa97('0x46')][_0xaa97('0x31')]);_0x2426c4[_0xaa97('0x35')]=_[_0xaa97('0x34')](_0x453f24[_0xaa97('0x35')]);_0x2426c4[_0xaa97('0x40')]=_['intersection'](_0x2426c4[_0xaa97('0x33')],_0x2426c4['query']);_0xac67a6[_0xaa97('0x36')]=_['intersection'](_0x2426c4[_0xaa97('0x33')],qs[_0xaa97('0x38')](_0x453f24[_0xaa97('0x35')][_0xaa97('0x38')]));_0xac67a6['attributes']=_0xac67a6[_0xaa97('0x36')][_0xaa97('0x39')]?_0xac67a6['attributes']:_0x2426c4[_0xaa97('0x33')];if(_0x453f24[_0xaa97('0x35')]['includeAll']){_0xac67a6[_0xaa97('0x48')]=[{'all':!![]}];}_0xac67a6=_[_0xaa97('0x41')]({},_0xac67a6,_0x453f24[_0xaa97('0x45')]);return db['CmList'][_0xaa97('0x4c')](_0xac67a6)[_0xaa97('0x26')](handleEntityNotFound(_0x55b548,null))[_0xaa97('0x26')](respondWithResult(_0x55b548,null))['catch'](handleError(_0x55b548,null));};exports['create']=function(_0x57e41f,_0x5cbd88){return db[_0xaa97('0x46')][_0xaa97('0x4d')](_0x57e41f['body'],{})[_0xaa97('0x26')](function(_0x3e5347){var _0x33872a=_0x57e41f[_0xaa97('0x4e')]['get']({'plain':!![]});if(!_0x33872a)throw new Error(_0xaa97('0x4f'));if(_0x33872a[_0xaa97('0x50')]===_0xaa97('0x4e')){var _0x2705db=_0x3e5347[_0xaa97('0x51')]({'plain':!![]});var _0x2541d3='Lists';return db[_0xaa97('0x52')][_0xaa97('0x4c')]({'where':{'name':_0x2541d3,'userProfileId':_0x33872a[_0xaa97('0x53')]},'raw':!![]})[_0xaa97('0x26')](function(_0x5f4eb0){if(_0x5f4eb0&&_0x5f4eb0[_0xaa97('0x54')]===0x0){return db[_0xaa97('0x28')][_0xaa97('0x4d')]({'name':_0x2705db[_0xaa97('0x2c')],'resourceId':_0x2705db['id'],'type':_0x5f4eb0[_0xaa97('0x2c')],'sectionId':_0x5f4eb0['id']},{})[_0xaa97('0x26')](function(){return _0x3e5347;});}else{return _0x3e5347;}})[_0xaa97('0x55')](function(_0x5d3d7c){logger['error'](_0xaa97('0x56'),_0x5d3d7c);throw _0x5d3d7c;});}return _0x3e5347;})['then'](respondWithResult(_0x5cbd88,0xc9))[_0xaa97('0x55')](handleError(_0x5cbd88,null));};exports[_0xaa97('0x25')]=function(_0x2a8096,_0x309136){if(_0x2a8096[_0xaa97('0x57')]['id']){delete _0x2a8096[_0xaa97('0x57')]['id'];}return db['CmList'][_0xaa97('0x4c')]({'where':{'id':_0x2a8096[_0xaa97('0x58')]['id']}})[_0xaa97('0x26')](handleEntityNotFound(_0x309136,null))[_0xaa97('0x26')](saveUpdates(_0x2a8096[_0xaa97('0x57')],null))[_0xaa97('0x26')](respondWithResult(_0x309136,null))[_0xaa97('0x55')](handleError(_0x309136,null));};exports[_0xaa97('0x29')]=function(_0x1e1730,_0x3ecbbb){return db[_0xaa97('0x46')][_0xaa97('0x4c')]({'where':{'id':_0x1e1730['params']['id']}})[_0xaa97('0x26')](handleEntityNotFound(_0x3ecbbb,null))[_0xaa97('0x26')](removeEntity(_0x3ecbbb,null))[_0xaa97('0x55')](handleError(_0x3ecbbb,null));};exports[_0xaa97('0x59')]=function(_0x3906cb,_0x54f7e0){return db[_0xaa97('0x46')][_0xaa97('0x59')]()[_0xaa97('0x26')](respondWithResult(_0x54f7e0,null))[_0xaa97('0x55')](handleError(_0x54f7e0,null));};exports['addDisposition']=function(_0x1f8079,_0x231fb6,_0xb68b5c){if(_0x1f8079[_0xaa97('0x57')]['id']){delete _0x1f8079['body']['id'];}return db[_0xaa97('0x46')][_0xaa97('0x4c')]({'where':{'id':_0x1f8079['params']['id']}})[_0xaa97('0x26')](handleEntityNotFound(_0x231fb6,null))[_0xaa97('0x26')](function(_0x1e7d48){if(_0x1e7d48){_0x1f8079[_0xaa97('0x57')][_0xaa97('0x5a')]=_0x1e7d48['id'];return db[_0xaa97('0x5b')]['create'](_0x1f8079[_0xaa97('0x57')]);}})[_0xaa97('0x26')](respondWithResult(_0x231fb6,null))[_0xaa97('0x55')](handleError(_0x231fb6,null));};exports['getDispositions']=function(_0x38961f,_0x3388c3,_0x3e4e8c){var _0xc784b5={'raw':![],'where':{}};var _0x7daa33={};var _0x3a52a7={'count':0x0,'rows':[]};return db[_0xaa97('0x46')][_0xaa97('0x5c')]({'where':{'id':_0x38961f[_0xaa97('0x58')]['id']}})[_0xaa97('0x26')](handleEntityNotFound(_0x3388c3,null))[_0xaa97('0x26')](function(_0x189974){if(_0x189974){_0x7daa33[_0xaa97('0x33')]=_['keys'](db[_0xaa97('0x5b')]['rawAttributes']);_0x7daa33['query']=_['keys'](_0x38961f[_0xaa97('0x35')]);_0x7daa33[_0xaa97('0x40')]=_[_0xaa97('0x37')](_0x7daa33[_0xaa97('0x33')],_0x7daa33['query']);_0xc784b5[_0xaa97('0x36')]=_['intersection'](_0x7daa33[_0xaa97('0x33')],qs[_0xaa97('0x38')](_0x38961f[_0xaa97('0x35')][_0xaa97('0x38')]));_0xc784b5[_0xaa97('0x36')]=_0xc784b5[_0xaa97('0x36')][_0xaa97('0x39')]?_0xc784b5[_0xaa97('0x36')]:_0x7daa33['model'];if(!_0x38961f['query'][_0xaa97('0x3a')](_0xaa97('0x3b'))){_0xc784b5[_0xaa97('0x21')]=qs['limit'](_0x38961f[_0xaa97('0x35')]['limit']);_0xc784b5[_0xaa97('0x20')]=qs['offset'](_0x38961f[_0xaa97('0x35')][_0xaa97('0x20')]);}_0xc784b5[_0xaa97('0x3c')]=qs['sort'](_0x38961f[_0xaa97('0x35')][_0xaa97('0x3d')]);_0xc784b5[_0xaa97('0x3e')]=qs['filters'](_[_0xaa97('0x3f')](_0x38961f[_0xaa97('0x35')],_0x7daa33[_0xaa97('0x40')]));_0xc784b5[_0xaa97('0x3e')][_0xaa97('0x5a')]=_0x189974['id'];if(_0x38961f[_0xaa97('0x35')][_0xaa97('0x44')]){_0xc784b5[_0xaa97('0x3e')]=_['merge'](_0xc784b5[_0xaa97('0x3e')],{'$or':_['map'](_0xc784b5[_0xaa97('0x36')],function(_0x24198a){var _0x3d1381={};_0x3d1381[_0x24198a]={'$like':'%'+_0x38961f[_0xaa97('0x35')][_0xaa97('0x44')]+'%'};return _0x3d1381;})});}_0xc784b5=_[_0xaa97('0x41')]({},_0xc784b5,_0x38961f[_0xaa97('0x45')]);return db[_0xaa97('0x5b')][_0xaa97('0x22')]({'where':_0xc784b5[_0xaa97('0x3e')]})['then'](function(_0x308ab6){_0x3a52a7[_0xaa97('0x22')]=_0x308ab6;if(_0x38961f['query'][_0xaa97('0x47')]){_0xc784b5[_0xaa97('0x48')]=[{'all':!![]}];}return db[_0xaa97('0x5b')][_0xaa97('0x49')](_0xc784b5);})[_0xaa97('0x26')](function(_0x376a2d){_0x3a52a7[_0xaa97('0x4a')]=_0x376a2d;return _0x3a52a7;});}})[_0xaa97('0x26')](respondWithFilteredResult(_0x3388c3,_0xc784b5))['catch'](handleError(_0x3388c3,null));};exports[_0xaa97('0x5d')]=function(_0x2259c9,_0x2ea048,_0x21d509){return db['CmList'][_0xaa97('0x4c')]({'where':{'id':_0x2259c9[_0xaa97('0x58')]['id']}})['then'](handleEntityNotFound(_0x2ea048,null))['then'](function(_0x192506){if(_0x192506){return _0x192506[_0xaa97('0x5d')](_0x2259c9[_0xaa97('0x35')][_0xaa97('0x5e')]);}})[_0xaa97('0x26')](respondWithStatusCode(_0x2ea048,null))[_0xaa97('0x55')](handleError(_0x2ea048,null));};exports[_0xaa97('0x5f')]=function(_0x2ec85f,_0x5491e4,_0x332733){return db[_0xaa97('0x46')][_0xaa97('0x4c')]({'where':{'id':_0x2ec85f[_0xaa97('0x58')]['id']}})['then'](handleEntityNotFound(_0x5491e4,null))['then'](function(_0x2ac2cf){if(_0x2ac2cf){var _0x44c2ec=[];var _0x13b2a4={'success':[],'errors':[]};return db[_0xaa97('0x60')][_0xaa97('0x59')]()['then'](function(_0x495434){if(_0x2ec85f['body'][_0xaa97('0x61')]&&_[_0xaa97('0x62')](_0x2ec85f[_0xaa97('0x57')][_0xaa97('0x61')])){if(_0x2ec85f['body'][_0xaa97('0x61')]['length']){_0x2ec85f[_0xaa97('0x57')]['tags']=_0x2ec85f[_0xaa97('0x57')]['tags'][_0xaa97('0x63')](';')+';';}else{_0x2ec85f[_0xaa97('0x57')][_0xaa97('0x61')]=null;}}else{_0x2ec85f['body'][_0xaa97('0x61')]=null;}if(_0x2ec85f['body']&&_['isArray'](_0x2ec85f['body'])){for(var _0x45b44d=0x0;_0x45b44d<_0x2ec85f[_0xaa97('0x57')][_0xaa97('0x39')];_0x45b44d+=0x1){_0x2ec85f[_0xaa97('0x57')][_0x45b44d][_0xaa97('0x5a')]=_0x2ec85f[_0xaa97('0x58')]['id'];_0x44c2ec[_0xaa97('0x64')](_0x2ec85f[_0xaa97('0x57')][_0x45b44d]);}return BPromise['each'](_0x44c2ec,function(_0xa2b87d){return db[_0xaa97('0x60')][_0xaa97('0x4d')](_[_0xaa97('0x65')](_0xa2b87d,[_0xaa97('0x5e'),'id'])||{},{'fields':_[_0xaa97('0x34')](_0x495434),'raw':!![]})[_0xaa97('0x26')](function(_0x5c4c2f){_0x13b2a4[_0xaa97('0x66')][_0xaa97('0x64')](_0x5c4c2f[_0xaa97('0x67')]);})[_0xaa97('0x55')](function(_0xed2afc){_0x13b2a4[_0xaa97('0x68')][_0xaa97('0x64')]({'data':_0xa2b87d,'error':_0xed2afc[_0xaa97('0x69')]});});})['then'](function(_0xfd31c6){return _0x13b2a4;})[_0xaa97('0x55')](function(_0x17b5dc){return _0x17b5dc;});}else{_0x5491e4[_0xaa97('0x2d')](0x190)[_0xaa97('0x1f')]({'message':_0xaa97('0x6a')});}});}})[_0xaa97('0x26')](respondWithResult(_0x5491e4,null))[_0xaa97('0x55')](handleError(_0x5491e4,null));};exports[_0xaa97('0x6b')]=function(_0x1977e9,_0x35fddb,_0x2c366a){var _0x27e6e9;return db[_0xaa97('0x46')]['find']({'where':{'id':_0x1977e9['params']['id']},'include':[{'model':db[_0xaa97('0x6c')],'as':_0xaa97('0x6d')}]})[_0xaa97('0x26')](handleEntityNotFound(_0x35fddb,null))[_0xaa97('0x26')](function(_0x879d0b){if(_0x879d0b){_0x27e6e9=_0x879d0b;return db['CmContact']['rawAttributes'];}})[_0xaa97('0x26')](function(_0x12bab6){if(_0x12bab6){var _0x59c301={};var _0x139bb3={};_0x139bb3[_0xaa97('0x33')]=_[_0xaa97('0x6e')](_[_0xaa97('0x34')](_0x12bab6),_[_0xaa97('0x30')](_0x27e6e9[_0xaa97('0x6d')],function(_0x176b5b){return util[_0xaa97('0x6f')](_0xaa97('0x70'),_0x176b5b['id']);}));_0x139bb3[_0xaa97('0x35')]=_[_0xaa97('0x34')](_0x1977e9[_0xaa97('0x35')]);_0x139bb3['filters']=_[_0xaa97('0x37')](_0x139bb3['model'],_0x139bb3[_0xaa97('0x35')]);_0x59c301[_0xaa97('0x36')]=_[_0xaa97('0x37')](_0x139bb3[_0xaa97('0x33')],qs['fields'](_0x1977e9[_0xaa97('0x35')]['fields']));_0x59c301[_0xaa97('0x36')]=_0x59c301[_0xaa97('0x36')][_0xaa97('0x39')]?_0x59c301['attributes']:_0x139bb3[_0xaa97('0x33')];if(!_0x1977e9[_0xaa97('0x35')][_0xaa97('0x3a')]('nolimit')){_0x59c301[_0xaa97('0x21')]=qs[_0xaa97('0x21')](_0x1977e9[_0xaa97('0x35')][_0xaa97('0x21')]);_0x59c301['offset']=qs[_0xaa97('0x20')](_0x1977e9['query']['offset']);}_0x59c301['order']=qs[_0xaa97('0x3d')](_0x1977e9[_0xaa97('0x35')]['sort']);_0x59c301[_0xaa97('0x3e')]=qs[_0xaa97('0x40')](_[_0xaa97('0x3f')](_0x1977e9[_0xaa97('0x35')],_0x139bb3[_0xaa97('0x40')]));_0x59c301[_0xaa97('0x71')]=!![];if(_0x1977e9[_0xaa97('0x35')][_0xaa97('0x44')]){_0x59c301[_0xaa97('0x3e')]=_[_0xaa97('0x41')](_0x59c301[_0xaa97('0x3e')],{'$or':_[_0xaa97('0x30')](_0x59c301[_0xaa97('0x36')],function(_0x2ded97){var _0x50dd7b={};_0x50dd7b[_0x2ded97]={'$like':'%'+_0x1977e9[_0xaa97('0x35')]['filter']+'%'};return _0x50dd7b;})});}_0x59c301=_[_0xaa97('0x41')]({},_0x59c301,_0x1977e9['options']);return _0x27e6e9[_0xaa97('0x6b')](_0x59c301);}})[_0xaa97('0x26')](respondWithResult(_0x35fddb,null))[_0xaa97('0x55')](handleError(_0x35fddb,null));};exports[_0xaa97('0x72')]=function(_0x94e86c,_0x16867f,_0x17b9ed){var _0x5eb625;return db[_0xaa97('0x46')][_0xaa97('0x4c')]({'where':{'id':_0x94e86c[_0xaa97('0x58')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xaa97('0x6d')}]})[_0xaa97('0x26')](handleEntityNotFound(_0x16867f,null))[_0xaa97('0x26')](function(_0x13fcba){if(_0x13fcba){_0x5eb625=_0x13fcba;return db[_0xaa97('0x60')][_0xaa97('0x31')];}})[_0xaa97('0x26')](function(_0x32dc27){if(_0x32dc27){var _0x1ff87b={};var _0x3ac32a={};_0x3ac32a['model']=_[_0xaa97('0x6e')](_['keys'](_0x32dc27),_[_0xaa97('0x30')](_0x5eb625['CustomFields'],function(_0x612ceb){return util[_0xaa97('0x6f')](_0xaa97('0x70'),_0x612ceb['id']);}));_0x3ac32a[_0xaa97('0x35')]=_[_0xaa97('0x34')](_0x94e86c[_0xaa97('0x35')]);_0x3ac32a['filters']=_[_0xaa97('0x37')](_0x3ac32a[_0xaa97('0x33')],_0x3ac32a['query']);_0x1ff87b[_0xaa97('0x36')]=_[_0xaa97('0x37')](_0x3ac32a[_0xaa97('0x33')],qs[_0xaa97('0x38')](_0x94e86c[_0xaa97('0x35')]['fields']));_0x1ff87b[_0xaa97('0x36')]=_0x1ff87b[_0xaa97('0x36')]['length']?_0x1ff87b[_0xaa97('0x36')]:_0x3ac32a[_0xaa97('0x33')];if(!_0x94e86c[_0xaa97('0x35')]['hasOwnProperty'](_0xaa97('0x3b'))){_0x1ff87b[_0xaa97('0x21')]=qs[_0xaa97('0x21')](_0x94e86c[_0xaa97('0x35')][_0xaa97('0x21')]);_0x1ff87b[_0xaa97('0x20')]=qs[_0xaa97('0x20')](_0x94e86c[_0xaa97('0x35')][_0xaa97('0x20')]);}_0x1ff87b[_0xaa97('0x3c')]=qs['sort'](_0x94e86c[_0xaa97('0x35')][_0xaa97('0x3d')]);_0x1ff87b[_0xaa97('0x3e')]=qs['filters'](_['pick'](_0x94e86c[_0xaa97('0x35')],_0x3ac32a[_0xaa97('0x40')]));_0x1ff87b['raw']=!![];if(_0x94e86c[_0xaa97('0x35')][_0xaa97('0x44')]){_0x1ff87b[_0xaa97('0x3e')]=_[_0xaa97('0x41')](_0x1ff87b[_0xaa97('0x3e')],{'$or':_[_0xaa97('0x30')](_0x1ff87b[_0xaa97('0x36')],function(_0x4406a8){var _0x17f0f7={};_0x17f0f7[_0x4406a8]={'$like':'%'+_0x94e86c['query'][_0xaa97('0x44')]+'%'};return _0x17f0f7;})});}_0x1ff87b=_[_0xaa97('0x41')]({},_0x1ff87b,_0x94e86c['options']);return _0x5eb625[_0xaa97('0x6b')](_0x1ff87b);}})[_0xaa97('0x26')](function(_0x51dac1){if(!_[_0xaa97('0x73')](_0x51dac1)){var _0x1256b0=toCsv(_0x51dac1);var _0x3ac476=Date[_0xaa97('0x74')]();fs[_0xaa97('0x75')](util[_0xaa97('0x6f')](_0xaa97('0x76'),_0x5eb625['id'],_0x3ac476),_0x1256b0);_0x16867f[_0xaa97('0x77')](_0xaa97('0x78'),_0xaa97('0x79')+util[_0xaa97('0x6f')](_0xaa97('0x7a'),_0x5eb625['id'],_0x3ac476));_0x16867f[_0xaa97('0x77')](_0xaa97('0x7b'),'text/csv');return _0x16867f['download'](util[_0xaa97('0x6f')](_0xaa97('0x76'),_0x5eb625['id'],_0x3ac476));}else{return _0x16867f[_0xaa97('0x1d')](0xcc);}})[_0xaa97('0x55')](handleError(_0x16867f,null));};exports[_0xaa97('0x7c')]=function(_0x690e3,_0x379c22,_0x5f6d39){var _0x280a94;delete _0x690e3['body']['id'];return db[_0xaa97('0x46')][_0xaa97('0x5c')]({'where':{'id':_0x690e3[_0xaa97('0x58')]['id']}})['then'](handleEntityNotFound(_0x379c22,null))[_0xaa97('0x26')](function(_0x4a060d){if(_0x4a060d){return db[_0xaa97('0x7d')]['transaction'](function(_0x44180e){return db[_0xaa97('0x6c')][_0xaa97('0x4d')](_0x690e3[_0xaa97('0x57')],{'transaction':_0x44180e})[_0xaa97('0x26')](function(_0xdd8cce){_0x280a94=_0xdd8cce;return _0x4a060d['addCustomFields'](_0xdd8cce,{'transaction':_0x44180e});})[_0xaa97('0x26')](function(){var _0x363860={'type':db[_0xaa97('0x7e')]['TEXT'],'transaction':_0x44180e};switch(_0x690e3[_0xaa97('0x57')][_0xaa97('0x42')]){case _0xaa97('0x7f'):_0x363860[_0xaa97('0x42')]=db[_0xaa97('0x7e')][_0xaa97('0x80')];break;case _0xaa97('0x81'):_0x363860[_0xaa97('0x42')]=db[_0xaa97('0x7e')][_0xaa97('0x82')];break;case _0xaa97('0x83'):_0x363860[_0xaa97('0x42')]=db[_0xaa97('0x7e')]['BOOLEAN'];_0x363860['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0xaa97('0x84')](_0xaa97('0x85'),util[_0xaa97('0x6f')](_0xaa97('0x86'),_0x280a94['id']),_0x363860);})[_0xaa97('0x26')](function(){return _0x280a94;});});}})[_0xaa97('0x26')](respondWithResult(_0x379c22,null))['catch'](handleError(_0x379c22,null));};exports[_0xaa97('0x87')]=function(_0x2930cb,_0x4efe85,_0x4df414){var _0x389a16={};var _0x403659={};var _0x3dfe9e;var _0x381ef4;return db[_0xaa97('0x46')]['findOne']({'where':{'id':_0x2930cb[_0xaa97('0x58')]['id']}})[_0xaa97('0x26')](handleEntityNotFound(_0x4efe85,null))[_0xaa97('0x26')](function(_0x529b50){if(_0x529b50){_0x3dfe9e=_0x529b50;_0x403659['model']=_[_0xaa97('0x34')](db[_0xaa97('0x6c')]['rawAttributes']);_0x403659[_0xaa97('0x35')]=_['keys'](_0x2930cb[_0xaa97('0x35')]);_0x403659[_0xaa97('0x40')]=_[_0xaa97('0x37')](_0x403659['model'],_0x403659[_0xaa97('0x35')]);_0x389a16[_0xaa97('0x36')]=_[_0xaa97('0x37')](_0x403659[_0xaa97('0x33')],qs['fields'](_0x2930cb[_0xaa97('0x35')][_0xaa97('0x38')]));_0x389a16[_0xaa97('0x36')]=_0x389a16[_0xaa97('0x36')][_0xaa97('0x39')]?_0x389a16['attributes']:_0x403659[_0xaa97('0x33')];_0x389a16[_0xaa97('0x3c')]=qs[_0xaa97('0x3d')](_0x2930cb['query'][_0xaa97('0x3d')]);_0x389a16[_0xaa97('0x3e')]=qs['filters'](_[_0xaa97('0x3f')](_0x2930cb[_0xaa97('0x35')],_0x403659[_0xaa97('0x40')]));_0x389a16[_0xaa97('0x3e')]=_[_0xaa97('0x41')](_0x389a16[_0xaa97('0x3e')],{'$or':[{'ListId':_0x529b50['id']},{'ListId':null}]});if(_0x2930cb[_0xaa97('0x35')]['filter']){_0x389a16[_0xaa97('0x3e')]=_[_0xaa97('0x41')](_0x389a16['where'],{'$or':_[_0xaa97('0x30')](_0x389a16[_0xaa97('0x36')],function(_0x485a38){var _0x52d4e1={};_0x52d4e1[_0x485a38]={'$like':'%'+_0x2930cb[_0xaa97('0x35')][_0xaa97('0x44')]+'%'};return _0x52d4e1;})});}_0x389a16=_['merge']({},_0x389a16,_0x2930cb[_0xaa97('0x45')]);return db[_0xaa97('0x6c')][_0xaa97('0x88')](_0x389a16);}})[_0xaa97('0x26')](respondWithResult(_0x4efe85,null))[_0xaa97('0x55')](handleError(_0x4efe85,null));};exports['addAgents']=function(_0x5bbc84,_0x5dc357,_0x5853cf){return db[_0xaa97('0x46')][_0xaa97('0x4c')]({'where':{'id':_0x5bbc84[_0xaa97('0x58')]['id']}})[_0xaa97('0x26')](handleEntityNotFound(_0x5dc357,null))[_0xaa97('0x26')](function(_0x46dac6){if(_0x46dac6){return _0x46dac6[_0xaa97('0x89')](_0x5bbc84[_0xaa97('0x57')][_0xaa97('0x5e')],_['omit'](_0x5bbc84[_0xaa97('0x57')],[_0xaa97('0x5e'),'id'])||{})[_0xaa97('0x8a')](function(_0x1091d6){for(var _0x4f5400=0x0;_0x4f5400<_0x5bbc84[_0xaa97('0x57')][_0xaa97('0x5e')]['length'];_0x4f5400+=0x1){socket[_0xaa97('0x8b')](_0xaa97('0x8c'),{'UserId':Number(_0x5bbc84[_0xaa97('0x57')][_0xaa97('0x5e')][_0x4f5400]),'CmListId':Number(_0x5bbc84['params']['id'])});}return _0x1091d6;});}})[_0xaa97('0x26')](respondWithResult(_0x5dc357,null))[_0xaa97('0x55')](handleError(_0x5dc357,null));};exports[_0xaa97('0x8d')]=function(_0x57e035,_0x9fb560,_0x44d748){return db[_0xaa97('0x46')][_0xaa97('0x4c')]({'where':{'id':_0x57e035[_0xaa97('0x58')]['id']}})[_0xaa97('0x26')](handleEntityNotFound(_0x9fb560,null))[_0xaa97('0x26')](function(_0x172d51){if(_0x172d51){return _0x172d51[_0xaa97('0x8d')](_0x57e035[_0xaa97('0x35')][_0xaa97('0x5e')])[_0xaa97('0x26')](function(){if(_[_0xaa97('0x62')](_0x57e035[_0xaa97('0x35')]['ids'])){for(var _0x21bef6=0x0;_0x21bef6<_0x57e035[_0xaa97('0x35')][_0xaa97('0x5e')]['length'];_0x21bef6+=0x1){socket[_0xaa97('0x8b')](_0xaa97('0x8e'),{'UserId':Number(_0x57e035[_0xaa97('0x35')][_0xaa97('0x5e')][_0x21bef6]),'CmListId':Number(_0x57e035['params']['id'])});}}else{socket['emit'](_0xaa97('0x8e'),{'UserId':Number(_0x57e035[_0xaa97('0x35')][_0xaa97('0x5e')]),'CmListId':Number(_0x57e035[_0xaa97('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x9fb560,null))[_0xaa97('0x55')](handleError(_0x9fb560,null));};exports[_0xaa97('0x8f')]=function(_0x4648df,_0x5d31fd,_0x152169){var _0x21d572={};var _0x2b7169={};var _0x5469db;var _0x425a6e;return db['CmList'][_0xaa97('0x5c')]({'where':{'id':_0x4648df[_0xaa97('0x58')]['id']}})[_0xaa97('0x26')](handleEntityNotFound(_0x5d31fd,null))[_0xaa97('0x26')](function(_0x370550){if(_0x370550){_0x5469db=_0x370550;_0x2b7169[_0xaa97('0x33')]=_[_0xaa97('0x34')](db[_0xaa97('0x90')][_0xaa97('0x31')]);_0x2b7169[_0xaa97('0x35')]=_[_0xaa97('0x34')](_0x4648df['query']);_0x2b7169[_0xaa97('0x40')]=_[_0xaa97('0x37')](_0x2b7169['model'],_0x2b7169[_0xaa97('0x35')]);_0x21d572[_0xaa97('0x36')]=_['intersection'](_0x2b7169['model'],qs['fields'](_0x4648df[_0xaa97('0x35')][_0xaa97('0x38')]));_0x21d572[_0xaa97('0x36')]=_0x21d572['attributes'][_0xaa97('0x39')]?_0x21d572[_0xaa97('0x36')]:_0x2b7169[_0xaa97('0x33')];_0x21d572[_0xaa97('0x3c')]=qs['sort'](_0x4648df[_0xaa97('0x35')]['sort']);_0x21d572['where']=qs['filters'](_['pick'](_0x4648df[_0xaa97('0x35')],_0x2b7169['filters']));if(_0x4648df[_0xaa97('0x35')][_0xaa97('0x44')]){_0x21d572[_0xaa97('0x3e')]=_[_0xaa97('0x41')](_0x21d572['where'],{'$or':_[_0xaa97('0x30')](_0x21d572['attributes'],function(_0x3c0e57){var _0x476853={};_0x476853[_0x3c0e57]={'$like':'%'+_0x4648df[_0xaa97('0x35')][_0xaa97('0x44')]+'%'};return _0x476853;})});}_0x21d572=_[_0xaa97('0x41')]({},_0x21d572,_0x4648df['options']);return _0x5469db['getAgents'](_0x21d572);}})[_0xaa97('0x26')](function(_0x16ed5b){if(_0x16ed5b){_0x425a6e=_0x16ed5b[_0xaa97('0x39')];if(!_0x4648df[_0xaa97('0x35')]['hasOwnProperty'](_0xaa97('0x3b'))){_0x21d572['limit']=qs[_0xaa97('0x21')](_0x4648df[_0xaa97('0x35')][_0xaa97('0x21')]);_0x21d572[_0xaa97('0x20')]=qs['offset'](_0x4648df['query'][_0xaa97('0x20')]);}return _0x5469db[_0xaa97('0x8f')](_0x21d572);}})[_0xaa97('0x26')](function(_0x31cc60){if(_0x31cc60){return _0x31cc60?{'count':_0x425a6e,'rows':_0x31cc60}:null;}})['then'](respondWithResult(_0x5d31fd,null))[_0xaa97('0x55')](handleError(_0x5d31fd,null));};
\ No newline at end of file
+var _0xfd77=['filter','ids','addContacts','tags','isArray','join','each','omit','success','push','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','CmContact','concat','cf_%d','raw','getContactsCsv','format','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','number','INTEGER','defaultValue','queryInterface','cm_contacts','cf_%s','findAndCountAll','addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','end','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','CmList','includeAll','findAll','rows','params','include','merge','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','catch','body','describe','addDisposition','ListId','getDispositions','findOne','Disposition','rawAttributes','hasOwnProperty','pick'];(function(_0x5e4b56,_0x177082){var _0x261196=function(_0x434894){while(--_0x434894){_0x5e4b56['push'](_0x5e4b56['shift']());}};_0x261196(++_0x177082);}(_0xfd77,0x157));var _0x7fd7=function(_0x31795d,_0x4860e2){_0x31795d=_0x31795d-0x0;var _0x63d93b=_0xfd77[_0x31795d];return _0x63d93b;};'use strict';var emlformat=require(_0x7fd7('0x0'));var rimraf=require(_0x7fd7('0x1'));var zipdir=require(_0x7fd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fd7('0x3'));var moment=require(_0x7fd7('0x4'));var BPromise=require(_0x7fd7('0x5'));var Mustache=require(_0x7fd7('0x6'));var util=require(_0x7fd7('0x7'));var path=require('path');var sox=require(_0x7fd7('0x8'));var csv=require(_0x7fd7('0x9'));var ejs=require(_0x7fd7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fd7('0xb'));var squel=require(_0x7fd7('0xc'));var crypto=require('crypto');var jsforce=require(_0x7fd7('0xd'));var deskjs=require(_0x7fd7('0xe'));var toCsv=require(_0x7fd7('0x9'));var querystring=require('querystring');var Papa=require(_0x7fd7('0xf'));var Redis=require(_0x7fd7('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7fd7('0x11'));var hardwareService=require(_0x7fd7('0x12'));var logger=require(_0x7fd7('0x13'))(_0x7fd7('0x14'));var utils=require(_0x7fd7('0x15'));var config=require(_0x7fd7('0x16'));var licenseUtil=require(_0x7fd7('0x17'));var db=require(_0x7fd7('0x18'))['db'];config[_0x7fd7('0x19')]=_[_0x7fd7('0x1a')](config[_0x7fd7('0x19')],{'host':_0x7fd7('0x1b'),'port':0x18eb});var socket=require(_0x7fd7('0x1c'))(new Redis(config['redis']));require(_0x7fd7('0x1d'))[_0x7fd7('0x1e')](socket);function respondWithStatusCode(_0x29fc42,_0x1b5d0c){_0x1b5d0c=_0x1b5d0c||0xcc;return function(_0x5a2417){if(_0x5a2417){return _0x29fc42[_0x7fd7('0x1f')](_0x1b5d0c);}return _0x29fc42[_0x7fd7('0x20')](_0x1b5d0c)['end']();};}function respondWithResult(_0x2454ea,_0x4aa2e7){_0x4aa2e7=_0x4aa2e7||0xc8;return function(_0x17ed90){if(_0x17ed90){return _0x2454ea[_0x7fd7('0x20')](_0x4aa2e7)[_0x7fd7('0x21')](_0x17ed90);}};}function respondWithFilteredResult(_0x2f0827,_0x376907){return function(_0x2df275){if(_0x2df275){var _0x33cbbe=typeof _0x376907[_0x7fd7('0x22')]===_0x7fd7('0x23')&&typeof _0x376907[_0x7fd7('0x24')]==='undefined';var _0xbcbb09=_0x2df275[_0x7fd7('0x25')];var _0x1978cc=_0x33cbbe?0x0:_0x376907[_0x7fd7('0x22')];var _0x2de16b=_0x33cbbe?_0x2df275[_0x7fd7('0x25')]:_0x376907[_0x7fd7('0x22')]+_0x376907['limit'];var _0x112f62;if(_0x2de16b>=_0xbcbb09){_0x2de16b=_0xbcbb09;_0x112f62=0xc8;}else{_0x112f62=0xce;}_0x2f0827[_0x7fd7('0x20')](_0x112f62);return _0x2f0827['set'](_0x7fd7('0x26'),_0x1978cc+'-'+_0x2de16b+'/'+_0xbcbb09)[_0x7fd7('0x21')](_0x2df275);}return null;};}function patchUpdates(_0x24068b){return function(_0x109d45){try{jsonpatch[_0x7fd7('0x27')](_0x109d45,_0x24068b,!![]);}catch(_0x3e0a7e){return BPromise[_0x7fd7('0x28')](_0x3e0a7e);}return _0x109d45[_0x7fd7('0x29')]();};}function saveUpdates(_0x3562f9,_0x1867f9){return function(_0x3b7913){if(_0x3b7913){return _0x3b7913[_0x7fd7('0x2a')](_0x3562f9)[_0x7fd7('0x2b')](function(_0x28f088){return _0x28f088;});}return null;};}function removeEntity(_0x18bdaf,_0x38caaa){return function(_0x1c1287){if(_0x1c1287){return _0x1c1287[_0x7fd7('0x2c')]()['then'](function(){var _0x51ce4e=_0x1c1287['get']({'plain':!![]});var _0x1fb804=_0x7fd7('0x2d');return db[_0x7fd7('0x2e')][_0x7fd7('0x2c')]({'where':{'type':_0x1fb804,'resourceId':_0x51ce4e['id']}})[_0x7fd7('0x2b')](function(){return _0x1c1287;});})[_0x7fd7('0x2b')](function(){_0x18bdaf[_0x7fd7('0x20')](0xcc)[_0x7fd7('0x2f')]();});}};}function handleEntityNotFound(_0x2df6b0,_0x21d95b){return function(_0x1df87c){if(!_0x1df87c){_0x2df6b0[_0x7fd7('0x1f')](0x194);}return _0x1df87c;};}function handleError(_0x561b42,_0x2564f0){_0x2564f0=_0x2564f0||0x1f4;return function(_0x4192b2){logger[_0x7fd7('0x30')](_0x4192b2[_0x7fd7('0x31')]);if(_0x4192b2['name']){delete _0x4192b2[_0x7fd7('0x32')];}_0x561b42[_0x7fd7('0x20')](_0x2564f0)[_0x7fd7('0x33')](_0x4192b2);};}exports[_0x7fd7('0x34')]=function(_0x43a045,_0x1e50a5){var _0x48ebc7={},_0x611ca={},_0x412195={'count':0x0,'rows':[]};var _0x28afb3=_[_0x7fd7('0x35')](db['CmList']['rawAttributes'],function(_0x34ec66){return{'name':_0x34ec66[_0x7fd7('0x36')],'type':_0x34ec66[_0x7fd7('0x37')][_0x7fd7('0x38')]};});_0x611ca['model']=_['map'](_0x28afb3,_0x7fd7('0x32'));_0x611ca[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x43a045[_0x7fd7('0x39')]);_0x611ca[_0x7fd7('0x3b')]=_['intersection'](_0x611ca[_0x7fd7('0x3c')],_0x611ca[_0x7fd7('0x39')]);_0x48ebc7['attributes']=_[_0x7fd7('0x3d')](_0x611ca[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x43a045[_0x7fd7('0x39')][_0x7fd7('0x3e')]));_0x48ebc7[_0x7fd7('0x3f')]=_0x48ebc7[_0x7fd7('0x3f')][_0x7fd7('0x40')]?_0x48ebc7[_0x7fd7('0x3f')]:_0x611ca[_0x7fd7('0x3c')];if(!_0x43a045[_0x7fd7('0x39')]['hasOwnProperty'](_0x7fd7('0x41'))){_0x48ebc7[_0x7fd7('0x24')]=qs[_0x7fd7('0x24')](_0x43a045[_0x7fd7('0x39')]['limit']);_0x48ebc7[_0x7fd7('0x22')]=qs['offset'](_0x43a045[_0x7fd7('0x39')][_0x7fd7('0x22')]);}_0x48ebc7[_0x7fd7('0x42')]=qs['sort'](_0x43a045[_0x7fd7('0x39')][_0x7fd7('0x43')]);_0x48ebc7[_0x7fd7('0x44')]=qs[_0x7fd7('0x3b')](_['pick'](_0x43a045[_0x7fd7('0x39')],_0x611ca['filters']),_0x28afb3);if(_0x43a045[_0x7fd7('0x39')]['filter']){_0x48ebc7[_0x7fd7('0x44')]=_['merge'](_0x48ebc7[_0x7fd7('0x44')],{'$or':_['map'](_0x28afb3,function(_0x58876d){if(_0x58876d[_0x7fd7('0x37')]!==_0x7fd7('0x45')){var _0x5cb812={};_0x5cb812[_0x58876d[_0x7fd7('0x32')]]={'$like':'%'+_0x43a045['query']['filter']+'%'};return _0x5cb812;}})});}_0x48ebc7=_['merge']({},_0x48ebc7,_0x43a045['options']);var _0x3e9a90={'where':_0x48ebc7[_0x7fd7('0x44')]};return db[_0x7fd7('0x46')][_0x7fd7('0x25')](_0x3e9a90)[_0x7fd7('0x2b')](function(_0x26c415){_0x412195[_0x7fd7('0x25')]=_0x26c415;if(_0x43a045[_0x7fd7('0x39')][_0x7fd7('0x47')]){_0x48ebc7['include']=[{'all':!![]}];}return db[_0x7fd7('0x46')][_0x7fd7('0x48')](_0x48ebc7);})[_0x7fd7('0x2b')](function(_0x1431b3){_0x412195[_0x7fd7('0x49')]=_0x1431b3;return _0x412195;})[_0x7fd7('0x2b')](respondWithFilteredResult(_0x1e50a5,_0x48ebc7))['catch'](handleError(_0x1e50a5,null));};exports['show']=function(_0x46b85a,_0x101325){var _0x48e3f0={'raw':![],'where':{'id':_0x46b85a[_0x7fd7('0x4a')]['id']}},_0x13dbc2={};_0x13dbc2['model']=_[_0x7fd7('0x3a')](db[_0x7fd7('0x46')]['rawAttributes']);_0x13dbc2[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x46b85a[_0x7fd7('0x39')]);_0x13dbc2[_0x7fd7('0x3b')]=_[_0x7fd7('0x3d')](_0x13dbc2[_0x7fd7('0x3c')],_0x13dbc2[_0x7fd7('0x39')]);_0x48e3f0['attributes']=_[_0x7fd7('0x3d')](_0x13dbc2[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x46b85a[_0x7fd7('0x39')][_0x7fd7('0x3e')]));_0x48e3f0[_0x7fd7('0x3f')]=_0x48e3f0['attributes'][_0x7fd7('0x40')]?_0x48e3f0[_0x7fd7('0x3f')]:_0x13dbc2[_0x7fd7('0x3c')];if(_0x46b85a[_0x7fd7('0x39')][_0x7fd7('0x47')]){_0x48e3f0[_0x7fd7('0x4b')]=[{'all':!![]}];}_0x48e3f0=_[_0x7fd7('0x4c')]({},_0x48e3f0,_0x46b85a[_0x7fd7('0x4d')]);return db[_0x7fd7('0x46')]['find'](_0x48e3f0)['then'](handleEntityNotFound(_0x101325,null))['then'](respondWithResult(_0x101325,null))['catch'](handleError(_0x101325,null));};exports['create']=function(_0x48bb1c,_0x4b60ac){return db['CmList'][_0x7fd7('0x4e')](_0x48bb1c['body'],{})['then'](function(_0x39a5bc){var _0x1882a8=_0x48bb1c[_0x7fd7('0x4f')]['get']({'plain':!![]});if(!_0x1882a8)throw new Error(_0x7fd7('0x50'));if(_0x1882a8['role']==='user'){var _0x5d6946=_0x39a5bc['get']({'plain':!![]});var _0x8944b1='Lists';return db[_0x7fd7('0x51')][_0x7fd7('0x52')]({'where':{'name':_0x8944b1,'userProfileId':_0x1882a8['userProfileId']},'raw':!![]})[_0x7fd7('0x2b')](function(_0x580943){if(_0x580943&&_0x580943[_0x7fd7('0x53')]===0x0){return db[_0x7fd7('0x2e')][_0x7fd7('0x4e')]({'name':_0x5d6946[_0x7fd7('0x32')],'resourceId':_0x5d6946['id'],'type':_0x580943[_0x7fd7('0x32')],'sectionId':_0x580943['id']},{})['then'](function(){return _0x39a5bc;});}else{return _0x39a5bc;}})[_0x7fd7('0x54')](function(_0x1ad8f2){logger[_0x7fd7('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ad8f2);throw _0x1ad8f2;});}return _0x39a5bc;})[_0x7fd7('0x2b')](respondWithResult(_0x4b60ac,0xc9))['catch'](handleError(_0x4b60ac,null));};exports['update']=function(_0x1cd59f,_0x5f3ac3){if(_0x1cd59f[_0x7fd7('0x55')]['id']){delete _0x1cd59f[_0x7fd7('0x55')]['id'];}return db['CmList']['find']({'where':{'id':_0x1cd59f[_0x7fd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f3ac3,null))['then'](saveUpdates(_0x1cd59f[_0x7fd7('0x55')],null))[_0x7fd7('0x2b')](respondWithResult(_0x5f3ac3,null))[_0x7fd7('0x54')](handleError(_0x5f3ac3,null));};exports[_0x7fd7('0x2c')]=function(_0x2ade3a,_0x2e4e83){return db[_0x7fd7('0x46')][_0x7fd7('0x52')]({'where':{'id':_0x2ade3a[_0x7fd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e4e83,null))['then'](removeEntity(_0x2e4e83,null))[_0x7fd7('0x54')](handleError(_0x2e4e83,null));};exports[_0x7fd7('0x56')]=function(_0xb82128,_0x3c625d){return db[_0x7fd7('0x46')][_0x7fd7('0x56')]()[_0x7fd7('0x2b')](respondWithResult(_0x3c625d,null))[_0x7fd7('0x54')](handleError(_0x3c625d,null));};exports[_0x7fd7('0x57')]=function(_0x4c4e91,_0x2a283f,_0x1fc5b3){if(_0x4c4e91[_0x7fd7('0x55')]['id']){delete _0x4c4e91[_0x7fd7('0x55')]['id'];}return db['CmList'][_0x7fd7('0x52')]({'where':{'id':_0x4c4e91[_0x7fd7('0x4a')]['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x2a283f,null))[_0x7fd7('0x2b')](function(_0x57bd62){if(_0x57bd62){_0x4c4e91[_0x7fd7('0x55')][_0x7fd7('0x58')]=_0x57bd62['id'];return db['Disposition'][_0x7fd7('0x4e')](_0x4c4e91['body']);}})[_0x7fd7('0x2b')](respondWithResult(_0x2a283f,null))['catch'](handleError(_0x2a283f,null));};exports[_0x7fd7('0x59')]=function(_0x38a7a2,_0xfac7bc,_0x110d3c){var _0x12225c={'raw':![],'where':{}};var _0x4ff43d={};var _0x5127b7={'count':0x0,'rows':[]};return db[_0x7fd7('0x46')][_0x7fd7('0x5a')]({'where':{'id':_0x38a7a2[_0x7fd7('0x4a')]['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0xfac7bc,null))[_0x7fd7('0x2b')](function(_0x1531c9){if(_0x1531c9){_0x4ff43d[_0x7fd7('0x3c')]=_[_0x7fd7('0x3a')](db[_0x7fd7('0x5b')][_0x7fd7('0x5c')]);_0x4ff43d[_0x7fd7('0x39')]=_['keys'](_0x38a7a2[_0x7fd7('0x39')]);_0x4ff43d['filters']=_['intersection'](_0x4ff43d[_0x7fd7('0x3c')],_0x4ff43d[_0x7fd7('0x39')]);_0x12225c[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x4ff43d[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x38a7a2['query'][_0x7fd7('0x3e')]));_0x12225c['attributes']=_0x12225c[_0x7fd7('0x3f')]['length']?_0x12225c['attributes']:_0x4ff43d[_0x7fd7('0x3c')];if(!_0x38a7a2['query'][_0x7fd7('0x5d')](_0x7fd7('0x41'))){_0x12225c[_0x7fd7('0x24')]=qs[_0x7fd7('0x24')](_0x38a7a2['query'][_0x7fd7('0x24')]);_0x12225c[_0x7fd7('0x22')]=qs[_0x7fd7('0x22')](_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x22')]);}_0x12225c[_0x7fd7('0x42')]=qs['sort'](_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x43')]);_0x12225c[_0x7fd7('0x44')]=qs['filters'](_[_0x7fd7('0x5e')](_0x38a7a2['query'],_0x4ff43d['filters']));_0x12225c[_0x7fd7('0x44')]['ListId']=_0x1531c9['id'];if(_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x5f')]){_0x12225c[_0x7fd7('0x44')]=_[_0x7fd7('0x4c')](_0x12225c[_0x7fd7('0x44')],{'$or':_[_0x7fd7('0x35')](_0x12225c[_0x7fd7('0x3f')],function(_0x21edc9){var _0x3ec2fd={};_0x3ec2fd[_0x21edc9]={'$like':'%'+_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x5f')]+'%'};return _0x3ec2fd;})});}_0x12225c=_[_0x7fd7('0x4c')]({},_0x12225c,_0x38a7a2[_0x7fd7('0x4d')]);return db[_0x7fd7('0x5b')][_0x7fd7('0x25')]({'where':_0x12225c[_0x7fd7('0x44')]})[_0x7fd7('0x2b')](function(_0x36f9f7){_0x5127b7['count']=_0x36f9f7;if(_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x47')]){_0x12225c[_0x7fd7('0x4b')]=[{'all':!![]}];}return db[_0x7fd7('0x5b')][_0x7fd7('0x48')](_0x12225c);})[_0x7fd7('0x2b')](function(_0x2781dd){_0x5127b7[_0x7fd7('0x49')]=_0x2781dd;return _0x5127b7;});}})[_0x7fd7('0x2b')](respondWithFilteredResult(_0xfac7bc,_0x12225c))['catch'](handleError(_0xfac7bc,null));};exports['removeDispositions']=function(_0x38c362,_0x21fa0f,_0x144710){return db[_0x7fd7('0x46')][_0x7fd7('0x52')]({'where':{'id':_0x38c362[_0x7fd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21fa0f,null))[_0x7fd7('0x2b')](function(_0x5a2dfe){if(_0x5a2dfe){return _0x5a2dfe['removeDispositions'](_0x38c362['query'][_0x7fd7('0x60')]);}})['then'](respondWithStatusCode(_0x21fa0f,null))[_0x7fd7('0x54')](handleError(_0x21fa0f,null));};exports[_0x7fd7('0x61')]=function(_0x247095,_0x5a5736,_0x5a5a3f){return db[_0x7fd7('0x46')]['find']({'where':{'id':_0x247095['params']['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x5a5736,null))[_0x7fd7('0x2b')](function(_0x2528bb){if(_0x2528bb){var _0x8bb4bd=[];var _0x5a9b4f={'success':[],'errors':[]};return db['CmContact']['describe']()[_0x7fd7('0x2b')](function(_0xcf27f4){if(_0x247095[_0x7fd7('0x55')][_0x7fd7('0x62')]&&_[_0x7fd7('0x63')](_0x247095[_0x7fd7('0x55')][_0x7fd7('0x62')])){if(_0x247095[_0x7fd7('0x55')][_0x7fd7('0x62')][_0x7fd7('0x40')]){_0x247095[_0x7fd7('0x55')][_0x7fd7('0x62')]=_0x247095[_0x7fd7('0x55')]['tags'][_0x7fd7('0x64')](';')+';';}else{_0x247095['body'][_0x7fd7('0x62')]=null;}}else{_0x247095[_0x7fd7('0x55')]['tags']=null;}if(_0x247095[_0x7fd7('0x55')]&&_['isArray'](_0x247095[_0x7fd7('0x55')])){for(var _0x2cbaed=0x0;_0x2cbaed<_0x247095[_0x7fd7('0x55')][_0x7fd7('0x40')];_0x2cbaed+=0x1){_0x247095[_0x7fd7('0x55')][_0x2cbaed][_0x7fd7('0x58')]=_0x247095[_0x7fd7('0x4a')]['id'];_0x8bb4bd['push'](_0x247095[_0x7fd7('0x55')][_0x2cbaed]);}return BPromise[_0x7fd7('0x65')](_0x8bb4bd,function(_0x5c498e){return db['CmContact'][_0x7fd7('0x4e')](_[_0x7fd7('0x66')](_0x5c498e,[_0x7fd7('0x60'),'id'])||{},{'fields':_[_0x7fd7('0x3a')](_0xcf27f4),'raw':!![]})[_0x7fd7('0x2b')](function(_0x43b0c0){_0x5a9b4f[_0x7fd7('0x67')][_0x7fd7('0x68')](_0x43b0c0[_0x7fd7('0x69')]);})['catch'](function(_0x4ddb6b){_0x5a9b4f[_0x7fd7('0x6a')][_0x7fd7('0x68')]({'data':_0x5c498e,'error':_0x4ddb6b['message']});});})['then'](function(_0xbc3591){return _0x5a9b4f;})[_0x7fd7('0x54')](function(_0x53dd90){return _0x53dd90;});}else{_0x5a5736[_0x7fd7('0x20')](0x190)[_0x7fd7('0x21')]({'message':_0x7fd7('0x6b')});}});}})[_0x7fd7('0x2b')](respondWithResult(_0x5a5736,null))[_0x7fd7('0x54')](handleError(_0x5a5736,null));};exports[_0x7fd7('0x6c')]=function(_0x4cdf74,_0x3e6fc9,_0x5d167d){var _0x8e1a07;return db['CmList'][_0x7fd7('0x52')]({'where':{'id':_0x4cdf74[_0x7fd7('0x4a')]['id']},'include':[{'model':db[_0x7fd7('0x6d')],'as':_0x7fd7('0x6e')}]})[_0x7fd7('0x2b')](handleEntityNotFound(_0x3e6fc9,null))[_0x7fd7('0x2b')](function(_0x2d64e5){if(_0x2d64e5){_0x8e1a07=_0x2d64e5;return db[_0x7fd7('0x6f')][_0x7fd7('0x5c')];}})[_0x7fd7('0x2b')](function(_0x2b7e5b){if(_0x2b7e5b){var _0x2b0ebe={};var _0x214ba0={};_0x214ba0['model']=_[_0x7fd7('0x70')](_[_0x7fd7('0x3a')](_0x2b7e5b),_[_0x7fd7('0x35')](_0x8e1a07[_0x7fd7('0x6e')],function(_0x5bb141){return util['format'](_0x7fd7('0x71'),_0x5bb141['id']);}));_0x214ba0[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x4cdf74['query']);_0x214ba0['filters']=_['intersection'](_0x214ba0['model'],_0x214ba0[_0x7fd7('0x39')]);_0x2b0ebe[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x214ba0[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x4cdf74['query']['fields']));_0x2b0ebe[_0x7fd7('0x3f')]=_0x2b0ebe[_0x7fd7('0x3f')]['length']?_0x2b0ebe[_0x7fd7('0x3f')]:_0x214ba0[_0x7fd7('0x3c')];if(!_0x4cdf74[_0x7fd7('0x39')]['hasOwnProperty'](_0x7fd7('0x41'))){_0x2b0ebe[_0x7fd7('0x24')]=qs[_0x7fd7('0x24')](_0x4cdf74[_0x7fd7('0x39')]['limit']);_0x2b0ebe[_0x7fd7('0x22')]=qs['offset'](_0x4cdf74[_0x7fd7('0x39')]['offset']);}_0x2b0ebe[_0x7fd7('0x42')]=qs[_0x7fd7('0x43')](_0x4cdf74[_0x7fd7('0x39')]['sort']);_0x2b0ebe[_0x7fd7('0x44')]=qs[_0x7fd7('0x3b')](_[_0x7fd7('0x5e')](_0x4cdf74['query'],_0x214ba0[_0x7fd7('0x3b')]));_0x2b0ebe[_0x7fd7('0x72')]=!![];if(_0x4cdf74[_0x7fd7('0x39')][_0x7fd7('0x5f')]){_0x2b0ebe['where']=_[_0x7fd7('0x4c')](_0x2b0ebe['where'],{'$or':_['map'](_0x2b0ebe[_0x7fd7('0x3f')],function(_0x5b607d){var _0x5efbee={};_0x5efbee[_0x5b607d]={'$like':'%'+_0x4cdf74['query'][_0x7fd7('0x5f')]+'%'};return _0x5efbee;})});}_0x2b0ebe=_[_0x7fd7('0x4c')]({},_0x2b0ebe,_0x4cdf74[_0x7fd7('0x4d')]);return _0x8e1a07[_0x7fd7('0x6c')](_0x2b0ebe);}})[_0x7fd7('0x2b')](respondWithResult(_0x3e6fc9,null))[_0x7fd7('0x54')](handleError(_0x3e6fc9,null));};exports[_0x7fd7('0x73')]=function(_0x4674d4,_0x20e97,_0x537616){var _0x39abcb;return db[_0x7fd7('0x46')][_0x7fd7('0x52')]({'where':{'id':_0x4674d4[_0x7fd7('0x4a')]['id']},'include':[{'model':db[_0x7fd7('0x6d')],'as':_0x7fd7('0x6e')}]})[_0x7fd7('0x2b')](handleEntityNotFound(_0x20e97,null))[_0x7fd7('0x2b')](function(_0x730dc6){if(_0x730dc6){_0x39abcb=_0x730dc6;return db['CmContact'][_0x7fd7('0x5c')];}})[_0x7fd7('0x2b')](function(_0x335819){if(_0x335819){var _0x2c7110={};var _0x1d0446={};_0x1d0446[_0x7fd7('0x3c')]=_[_0x7fd7('0x70')](_[_0x7fd7('0x3a')](_0x335819),_['map'](_0x39abcb[_0x7fd7('0x6e')],function(_0x31c931){return util[_0x7fd7('0x74')](_0x7fd7('0x71'),_0x31c931['id']);}));_0x1d0446['query']=_['keys'](_0x4674d4[_0x7fd7('0x39')]);_0x1d0446['filters']=_[_0x7fd7('0x3d')](_0x1d0446[_0x7fd7('0x3c')],_0x1d0446[_0x7fd7('0x39')]);_0x2c7110[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x1d0446['model'],qs['fields'](_0x4674d4[_0x7fd7('0x39')][_0x7fd7('0x3e')]));_0x2c7110[_0x7fd7('0x3f')]=_0x2c7110[_0x7fd7('0x3f')][_0x7fd7('0x40')]?_0x2c7110['attributes']:_0x1d0446['model'];if(!_0x4674d4['query'][_0x7fd7('0x5d')](_0x7fd7('0x41'))){_0x2c7110[_0x7fd7('0x24')]=qs['limit'](_0x4674d4[_0x7fd7('0x39')]['limit']);_0x2c7110[_0x7fd7('0x22')]=qs['offset'](_0x4674d4[_0x7fd7('0x39')][_0x7fd7('0x22')]);}_0x2c7110['order']=qs[_0x7fd7('0x43')](_0x4674d4['query'][_0x7fd7('0x43')]);_0x2c7110['where']=qs[_0x7fd7('0x3b')](_['pick'](_0x4674d4[_0x7fd7('0x39')],_0x1d0446[_0x7fd7('0x3b')]));_0x2c7110[_0x7fd7('0x72')]=!![];if(_0x4674d4[_0x7fd7('0x39')][_0x7fd7('0x5f')]){_0x2c7110['where']=_['merge'](_0x2c7110['where'],{'$or':_['map'](_0x2c7110[_0x7fd7('0x3f')],function(_0x5545c2){var _0xe77d7={};_0xe77d7[_0x5545c2]={'$like':'%'+_0x4674d4['query']['filter']+'%'};return _0xe77d7;})});}_0x2c7110=_[_0x7fd7('0x4c')]({},_0x2c7110,_0x4674d4[_0x7fd7('0x4d')]);return _0x39abcb[_0x7fd7('0x6c')](_0x2c7110);}})[_0x7fd7('0x2b')](function(_0x2c7b23){if(!_[_0x7fd7('0x75')](_0x2c7b23)){var _0x1d99cd=toCsv(_0x2c7b23);var _0x5a64f3=Date[_0x7fd7('0x76')]();fs[_0x7fd7('0x77')](util[_0x7fd7('0x74')]('/tmp/list_%d_%s.csv',_0x39abcb['id'],_0x5a64f3),_0x1d99cd);_0x20e97[_0x7fd7('0x78')](_0x7fd7('0x79'),_0x7fd7('0x7a')+util['format'](_0x7fd7('0x7b'),_0x39abcb['id'],_0x5a64f3));_0x20e97['setHeader'](_0x7fd7('0x7c'),_0x7fd7('0x7d'));return _0x20e97['download'](util[_0x7fd7('0x74')](_0x7fd7('0x7e'),_0x39abcb['id'],_0x5a64f3));}else{return _0x20e97[_0x7fd7('0x1f')](0xcc);}})['catch'](handleError(_0x20e97,null));};exports[_0x7fd7('0x7f')]=function(_0x17c5dc,_0x46bd74,_0x1ddfa1){var _0x2e2a3d;delete _0x17c5dc['body']['id'];return db[_0x7fd7('0x46')]['findOne']({'where':{'id':_0x17c5dc['params']['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x46bd74,null))[_0x7fd7('0x2b')](function(_0x193822){if(_0x193822){return db[_0x7fd7('0x80')][_0x7fd7('0x81')](function(_0x33a6bf){return db[_0x7fd7('0x6d')][_0x7fd7('0x4e')](_0x17c5dc['body'],{'transaction':_0x33a6bf})['then'](function(_0x4a0e83){_0x2e2a3d=_0x4a0e83;return _0x193822[_0x7fd7('0x82')](_0x4a0e83,{'transaction':_0x33a6bf});})[_0x7fd7('0x2b')](function(){var _0x46c9ea={'type':db[_0x7fd7('0x83')]['TEXT'],'transaction':_0x33a6bf};switch(_0x17c5dc['body'][_0x7fd7('0x37')]){case'text':_0x46c9ea[_0x7fd7('0x37')]=db[_0x7fd7('0x83')]['TEXT'];break;case _0x7fd7('0x84'):_0x46c9ea[_0x7fd7('0x37')]=db['Sequelize'][_0x7fd7('0x85')];break;case'switch':_0x46c9ea[_0x7fd7('0x37')]=db['Sequelize']['BOOLEAN'];_0x46c9ea[_0x7fd7('0x86')]=![];break;default:}return db[_0x7fd7('0x80')][_0x7fd7('0x87')]['addColumn'](_0x7fd7('0x88'),util[_0x7fd7('0x74')](_0x7fd7('0x89'),_0x2e2a3d['id']),_0x46c9ea);})[_0x7fd7('0x2b')](function(){return _0x2e2a3d;});});}})[_0x7fd7('0x2b')](respondWithResult(_0x46bd74,null))['catch'](handleError(_0x46bd74,null));};exports['getCustomFields']=function(_0x19309f,_0x67e8c3,_0x499aff){var _0x2a4d5b={};var _0x4a2e4c={};var _0x2effbe;var _0x11f409;return db[_0x7fd7('0x46')][_0x7fd7('0x5a')]({'where':{'id':_0x19309f['params']['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x67e8c3,null))[_0x7fd7('0x2b')](function(_0x3ec3c9){if(_0x3ec3c9){_0x2effbe=_0x3ec3c9;_0x4a2e4c['model']=_['keys'](db[_0x7fd7('0x6d')][_0x7fd7('0x5c')]);_0x4a2e4c[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x19309f[_0x7fd7('0x39')]);_0x4a2e4c[_0x7fd7('0x3b')]=_[_0x7fd7('0x3d')](_0x4a2e4c['model'],_0x4a2e4c[_0x7fd7('0x39')]);_0x2a4d5b[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x4a2e4c[_0x7fd7('0x3c')],qs['fields'](_0x19309f[_0x7fd7('0x39')][_0x7fd7('0x3e')]));_0x2a4d5b[_0x7fd7('0x3f')]=_0x2a4d5b['attributes'][_0x7fd7('0x40')]?_0x2a4d5b[_0x7fd7('0x3f')]:_0x4a2e4c[_0x7fd7('0x3c')];_0x2a4d5b[_0x7fd7('0x42')]=qs[_0x7fd7('0x43')](_0x19309f[_0x7fd7('0x39')][_0x7fd7('0x43')]);_0x2a4d5b[_0x7fd7('0x44')]=qs['filters'](_[_0x7fd7('0x5e')](_0x19309f[_0x7fd7('0x39')],_0x4a2e4c[_0x7fd7('0x3b')]));_0x2a4d5b[_0x7fd7('0x44')]=_[_0x7fd7('0x4c')](_0x2a4d5b[_0x7fd7('0x44')],{'$or':[{'ListId':_0x3ec3c9['id']},{'ListId':null}]});if(_0x19309f['query'][_0x7fd7('0x5f')]){_0x2a4d5b[_0x7fd7('0x44')]=_[_0x7fd7('0x4c')](_0x2a4d5b['where'],{'$or':_[_0x7fd7('0x35')](_0x2a4d5b['attributes'],function(_0xc6a862){var _0x600920={};_0x600920[_0xc6a862]={'$like':'%'+_0x19309f[_0x7fd7('0x39')][_0x7fd7('0x5f')]+'%'};return _0x600920;})});}_0x2a4d5b=_['merge']({},_0x2a4d5b,_0x19309f[_0x7fd7('0x4d')]);return db[_0x7fd7('0x6d')][_0x7fd7('0x8a')](_0x2a4d5b);}})['then'](respondWithResult(_0x67e8c3,null))[_0x7fd7('0x54')](handleError(_0x67e8c3,null));};exports[_0x7fd7('0x8b')]=function(_0x2fa2c7,_0x16d26b,_0x2812fd){return db[_0x7fd7('0x46')][_0x7fd7('0x52')]({'where':{'id':_0x2fa2c7[_0x7fd7('0x4a')]['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x16d26b,null))[_0x7fd7('0x2b')](function(_0x58739e){if(_0x58739e){return _0x58739e['addAgents'](_0x2fa2c7[_0x7fd7('0x55')][_0x7fd7('0x60')],_[_0x7fd7('0x66')](_0x2fa2c7[_0x7fd7('0x55')],[_0x7fd7('0x60'),'id'])||{})[_0x7fd7('0x8c')](function(_0x27a91d){for(var _0xcfa6c2=0x0;_0xcfa6c2<_0x2fa2c7['body']['ids'][_0x7fd7('0x40')];_0xcfa6c2+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x2fa2c7[_0x7fd7('0x55')][_0x7fd7('0x60')][_0xcfa6c2]),'CmListId':Number(_0x2fa2c7[_0x7fd7('0x4a')]['id'])});}return _0x27a91d;});}})['then'](respondWithResult(_0x16d26b,null))[_0x7fd7('0x54')](handleError(_0x16d26b,null));};exports[_0x7fd7('0x8d')]=function(_0x42fb2c,_0x341cb1,_0x4fbb6f){return db['CmList'][_0x7fd7('0x52')]({'where':{'id':_0x42fb2c[_0x7fd7('0x4a')]['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x341cb1,null))[_0x7fd7('0x2b')](function(_0x3e90fa){if(_0x3e90fa){return _0x3e90fa[_0x7fd7('0x8d')](_0x42fb2c[_0x7fd7('0x39')]['ids'])['then'](function(){if(_['isArray'](_0x42fb2c[_0x7fd7('0x39')][_0x7fd7('0x60')])){for(var _0x5f4b9e=0x0;_0x5f4b9e<_0x42fb2c['query'][_0x7fd7('0x60')]['length'];_0x5f4b9e+=0x1){socket[_0x7fd7('0x8e')](_0x7fd7('0x8f'),{'UserId':Number(_0x42fb2c[_0x7fd7('0x39')]['ids'][_0x5f4b9e]),'CmListId':Number(_0x42fb2c['params']['id'])});}}else{socket[_0x7fd7('0x8e')](_0x7fd7('0x8f'),{'UserId':Number(_0x42fb2c[_0x7fd7('0x39')][_0x7fd7('0x60')]),'CmListId':Number(_0x42fb2c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x341cb1,null))[_0x7fd7('0x54')](handleError(_0x341cb1,null));};exports[_0x7fd7('0x90')]=function(_0x4fa00b,_0x48edef,_0x3ce4a0){var _0x108896={};var _0x100cf5={};var _0x29a39f;var _0x591ae5;return db[_0x7fd7('0x46')][_0x7fd7('0x5a')]({'where':{'id':_0x4fa00b[_0x7fd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48edef,null))[_0x7fd7('0x2b')](function(_0x144d1e){if(_0x144d1e){_0x29a39f=_0x144d1e;_0x100cf5[_0x7fd7('0x3c')]=_['keys'](db[_0x7fd7('0x91')][_0x7fd7('0x5c')]);_0x100cf5[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x4fa00b[_0x7fd7('0x39')]);_0x100cf5['filters']=_[_0x7fd7('0x3d')](_0x100cf5[_0x7fd7('0x3c')],_0x100cf5['query']);_0x108896[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x100cf5[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x4fa00b[_0x7fd7('0x39')]['fields']));_0x108896['attributes']=_0x108896['attributes'][_0x7fd7('0x40')]?_0x108896['attributes']:_0x100cf5[_0x7fd7('0x3c')];_0x108896[_0x7fd7('0x42')]=qs[_0x7fd7('0x43')](_0x4fa00b[_0x7fd7('0x39')]['sort']);_0x108896[_0x7fd7('0x44')]=qs['filters'](_['pick'](_0x4fa00b[_0x7fd7('0x39')],_0x100cf5[_0x7fd7('0x3b')]));if(_0x4fa00b[_0x7fd7('0x39')][_0x7fd7('0x5f')]){_0x108896[_0x7fd7('0x44')]=_[_0x7fd7('0x4c')](_0x108896[_0x7fd7('0x44')],{'$or':_[_0x7fd7('0x35')](_0x108896[_0x7fd7('0x3f')],function(_0x1283ac){var _0x869809={};_0x869809[_0x1283ac]={'$like':'%'+_0x4fa00b[_0x7fd7('0x39')]['filter']+'%'};return _0x869809;})});}_0x108896=_[_0x7fd7('0x4c')]({},_0x108896,_0x4fa00b[_0x7fd7('0x4d')]);return _0x29a39f['getAgents'](_0x108896);}})[_0x7fd7('0x2b')](function(_0x3f6fd1){if(_0x3f6fd1){_0x591ae5=_0x3f6fd1[_0x7fd7('0x40')];if(!_0x4fa00b[_0x7fd7('0x39')][_0x7fd7('0x5d')](_0x7fd7('0x41'))){_0x108896['limit']=qs[_0x7fd7('0x24')](_0x4fa00b[_0x7fd7('0x39')][_0x7fd7('0x24')]);_0x108896[_0x7fd7('0x22')]=qs[_0x7fd7('0x22')](_0x4fa00b['query'][_0x7fd7('0x22')]);}return _0x29a39f['getAgents'](_0x108896);}})[_0x7fd7('0x2b')](function(_0xec61fe){if(_0xec61fe){return _0xec61fe?{'count':_0x591ae5,'rows':_0xec61fe}:null;}})[_0x7fd7('0x2b')](respondWithResult(_0x48edef,null))[_0x7fd7('0x54')](handleError(_0x48edef,null));};
\ No newline at end of file
index 3607303..6e4d954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x26fffd,_0x9b8e5f){_0x26fffd=_0x26fffd-0x0;var _0x20fc04=_0x3e74[_0x26fffd];return _0x20fc04;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents;
\ No newline at end of file
+var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x3014a4,_0x56b5aa){var _0x4ff3da=function(_0x17c093){while(--_0x17c093){_0x3014a4['push'](_0x3014a4['shift']());}};_0x4ff3da(++_0x56b5aa);}(_0x7217,0x19e));var _0x7721=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x7217[_0x4b7b62];return _0x2280df;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents;
\ No newline at end of file
index 9dd9ab2..9b3b627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4522=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api','moment','request-promise'];(function(_0x1a59e2,_0x1da594){var _0x57ec13=function(_0xc19fbd){while(--_0xc19fbd){_0x1a59e2['push'](_0x1a59e2['shift']());}};_0x57ec13(++_0x1da594);}(_0x4522,0x1a0));var _0x2452=function(_0x40b518,_0x430b64){_0x40b518=_0x40b518-0x0;var _0xf2943e=_0x4522[_0x40b518];return _0xf2943e;};'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
+var _0xd2ea=['cm_lists','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList'];(function(_0x4131da,_0x124783){var _0x583242=function(_0x4c899f){while(--_0x4c899f){_0x4131da['push'](_0x4131da['shift']());}};_0x583242(++_0x124783);}(_0xd2ea,0x15f));var _0xad2e=function(_0x274ee3,_0x21eb7b){_0x274ee3=_0x274ee3-0x0;var _0x22b253=_0xd2ea[_0x274ee3];return _0x22b253;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b2c10ab..8f1529a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf85=['request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','localhost','socket.io-emitter','redis','./cmList.socket','then','info'];(function(_0x30efa1,_0xd7dc10){var _0x47ad4c=function(_0x5fe998){while(--_0x5fe998){_0x30efa1['push'](_0x30efa1['shift']());}};_0x47ad4c(++_0xd7dc10);}(_0xdf85,0x176));var _0x5df8=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xdf85[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x5df8('0x0'));var moment=require('moment');var BPromise=require(_0x5df8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5df8('0x2'));var db=require(_0x5df8('0x3'))['db'];var utils=require(_0x5df8('0x4'));var logger=require(_0x5df8('0x5'))(_0x5df8('0x6'));var config=require('../../config/environment');var jayson=require(_0x5df8('0x7'));var client=jayson[_0x5df8('0x8')][_0x5df8('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x5df8('0xa'),'port':0x18eb});var socket=require(_0x5df8('0xb'))(new Redis(config[_0x5df8('0xc')]));require(_0x5df8('0xd'))['register'](socket);function respondWithRpcPromise(_0x22e50b,_0x427f09,_0x49b4a1){return new BPromise(function(_0x40ee18,_0x368dee){return client['request'](_0x22e50b,_0x49b4a1)[_0x5df8('0xe')](function(_0x2dfdf6){logger[_0x5df8('0xf')]('CmList,\x20%s,\x20%s',_0x427f09,_0x5df8('0x10'));logger[_0x5df8('0x11')](_0x5df8('0x12'),_0x427f09,_0x5df8('0x10'),JSON[_0x5df8('0x13')](_0x2dfdf6));if(_0x2dfdf6[_0x5df8('0x14')]){if(_0x2dfdf6[_0x5df8('0x14')][_0x5df8('0x15')]===0x1f4){logger[_0x5df8('0x14')](_0x5df8('0x16'),_0x427f09,_0x2dfdf6[_0x5df8('0x14')][_0x5df8('0x17')]);return _0x368dee(_0x2dfdf6[_0x5df8('0x14')][_0x5df8('0x17')]);}logger[_0x5df8('0x14')](_0x5df8('0x16'),_0x427f09,_0x2dfdf6['error']['message']);return _0x40ee18(_0x2dfdf6[_0x5df8('0x14')][_0x5df8('0x17')]);}else{logger['info'](_0x5df8('0x16'),_0x427f09,'request\x20sent');_0x40ee18(_0x2dfdf6[_0x5df8('0x18')][_0x5df8('0x17')]);}})[_0x5df8('0x19')](function(_0x4455ed){logger[_0x5df8('0x14')](_0x5df8('0x16'),_0x427f09,_0x4455ed);_0x368dee(_0x4455ed);});});}
\ No newline at end of file
+var _0x1ad6=['client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x38e591,_0x8ee45e){var _0x1c3a4e=function(_0x3f23be){while(--_0x3f23be){_0x38e591['push'](_0x38e591['shift']());}};_0x1c3a4e(++_0x8ee45e);}(_0x1ad6,0x147));var _0x61ad=function(_0xb65f5e,_0x63e53f){_0xb65f5e=_0xb65f5e-0x0;var _0xbe7630=_0x1ad6[_0xb65f5e];return _0xbe7630;};'use strict';var _=require(_0x61ad('0x0'));var util=require(_0x61ad('0x1'));var moment=require(_0x61ad('0x2'));var BPromise=require(_0x61ad('0x3'));var rs=require(_0x61ad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61ad('0x5'))['db'];var utils=require(_0x61ad('0x6'));var logger=require('../../config/logger')(_0x61ad('0x7'));var config=require(_0x61ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x61ad('0x9')][_0x61ad('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x61ad('0xb')],{'host':_0x61ad('0xc'),'port':0x18eb});var socket=require(_0x61ad('0xd'))(new Redis(config['redis']));require(_0x61ad('0xe'))[_0x61ad('0xf')](socket);function respondWithRpcPromise(_0x61362,_0x2cecac,_0x5dee04){return new BPromise(function(_0xbb2777,_0x30a02c){return client[_0x61ad('0x10')](_0x61362,_0x5dee04)[_0x61ad('0x11')](function(_0x4c5ca4){logger[_0x61ad('0x12')](_0x61ad('0x13'),_0x2cecac,_0x61ad('0x14'));logger[_0x61ad('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x2cecac,_0x61ad('0x14'),JSON['stringify'](_0x4c5ca4));if(_0x4c5ca4[_0x61ad('0x16')]){if(_0x4c5ca4['error']['code']===0x1f4){logger[_0x61ad('0x16')](_0x61ad('0x13'),_0x2cecac,_0x4c5ca4[_0x61ad('0x16')][_0x61ad('0x17')]);return _0x30a02c(_0x4c5ca4[_0x61ad('0x16')][_0x61ad('0x17')]);}logger[_0x61ad('0x16')]('CmList,\x20%s,\x20%s',_0x2cecac,_0x4c5ca4['error'][_0x61ad('0x17')]);return _0xbb2777(_0x4c5ca4['error']['message']);}else{logger['info'](_0x61ad('0x13'),_0x2cecac,'request\x20sent');_0xbb2777(_0x4c5ca4['result'][_0x61ad('0x17')]);}})['catch'](function(_0x12016c){logger[_0x61ad('0x16')](_0x61ad('0x13'),_0x2cecac,_0x12016c);_0x30a02c(_0x12016c);});});}
\ No newline at end of file
index 93d3d26..7c3e10f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5c3=['removeListener','length','cmList:','remove','emit'];(function(_0x4450bf,_0x37f6ec){var _0x136130=function(_0x353e0e){while(--_0x353e0e){_0x4450bf['push'](_0x4450bf['shift']());}};_0x136130(++_0x37f6ec);}(_0xe5c3,0x139));var _0x3e5c=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xe5c3[_0x4e9628];return _0x27bc8c;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x3e5c('0x0'),'update'];function createListener(_0x67bc1a,_0xc42176){return function(_0xa5ecb4){_0xc42176[_0x3e5c('0x1')](_0x67bc1a,_0xa5ecb4);};}function removeListener(_0x5d61f2,_0x5a8f3e){return function(){CmListEvents[_0x3e5c('0x2')](_0x5d61f2,_0x5a8f3e);};}exports['register']=function(_0x3c94e1){for(var _0xa52293=0x0,_0x2e9978=events[_0x3e5c('0x3')];_0xa52293<_0x2e9978;_0xa52293++){var _0xaa101=events[_0xa52293];var _0x27d944=createListener(_0x3e5c('0x4')+_0xaa101,_0x3c94e1);CmListEvents['on'](_0xaa101,_0x27d944);}};
\ No newline at end of file
+var _0xa031=['save','remove','update','removeListener','register','cmList:','./cmList.events'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0xa031,0x7d));var _0x1a03=function(_0x2a6983,_0x356502){_0x2a6983=_0x2a6983-0x0;var _0x15dc29=_0xa031[_0x2a6983];return _0x15dc29;};'use strict';var CmListEvents=require(_0x1a03('0x0'));var events=[_0x1a03('0x1'),_0x1a03('0x2'),_0x1a03('0x3')];function createListener(_0x10b89e,_0x28d046){return function(_0x4c9713){_0x28d046['emit'](_0x10b89e,_0x4c9713);};}function removeListener(_0x4818b6,_0x4b719d){return function(){CmListEvents[_0x1a03('0x4')](_0x4818b6,_0x4b719d);};}exports[_0x1a03('0x5')]=function(_0x29c1db){for(var _0x7b32cc=0x0,_0x1b2a65=events['length'];_0x7b32cc<_0x1b2a65;_0x7b32cc++){var _0x28351a=events[_0x7b32cc];var _0x5db09c=createListener(_0x1a03('0x6')+_0x28351a,_0x29c1db);CmListEvents['on'](_0x28351a,_0x5db09c);}};
\ No newline at end of file
index cd71c28..4756632 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d88=['getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x591896,_0x386bac){var _0x5eaa48=function(_0x10ca6a){while(--_0x10ca6a){_0x591896['push'](_0x591896['shift']());}};_0x5eaa48(++_0x386bac);}(_0x7d88,0x172));var _0x87d8=function(_0x19b8ef,_0x53b8d9){_0x19b8ef=_0x19b8ef-0x0;var _0x433ae4=_0x7d88[_0x19b8ef];return _0x433ae4;};'use strict';var multer=require(_0x87d8('0x0'));var util=require('util');var path=require(_0x87d8('0x1'));var timeout=require(_0x87d8('0x2'));var express=require(_0x87d8('0x3'));var router=express[_0x87d8('0x4')]();var fs_extra=require(_0x87d8('0x5'));var auth=require(_0x87d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x87d8('0x7'));var controller=require('./cmList.controller');router[_0x87d8('0x8')]('/',auth[_0x87d8('0x9')](),controller['index']);router[_0x87d8('0x8')](_0x87d8('0xa'),auth[_0x87d8('0x9')](),controller['describe']);router[_0x87d8('0x8')](_0x87d8('0xb'),auth[_0x87d8('0x9')](),controller[_0x87d8('0xc')]);router['get'](_0x87d8('0xd'),auth['isAuthenticated'](),controller[_0x87d8('0xe')]);router[_0x87d8('0x8')]('/:id/contacts',auth[_0x87d8('0x9')](),controller[_0x87d8('0xf')]);router[_0x87d8('0x8')](_0x87d8('0x10'),auth[_0x87d8('0x9')](),controller[_0x87d8('0x11')]);router[_0x87d8('0x8')](_0x87d8('0x12'),auth[_0x87d8('0x9')](),controller[_0x87d8('0x13')]);router[_0x87d8('0x8')](_0x87d8('0x14'),auth['isAuthenticated'](),controller[_0x87d8('0x15')]);router[_0x87d8('0x16')]('/',auth[_0x87d8('0x9')](),controller[_0x87d8('0x17')]);router[_0x87d8('0x16')]('/:id/dispositions',auth[_0x87d8('0x9')](),controller[_0x87d8('0x18')]);router[_0x87d8('0x16')](_0x87d8('0x19'),auth[_0x87d8('0x9')](),controller[_0x87d8('0x1a')]);router[_0x87d8('0x16')](_0x87d8('0x12'),auth[_0x87d8('0x9')](),controller[_0x87d8('0x1b')]);router[_0x87d8('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x87d8('0x1c')]);router[_0x87d8('0x1d')](_0x87d8('0xb'),auth[_0x87d8('0x9')](),controller['update']);router[_0x87d8('0x1e')]('/:id',auth[_0x87d8('0x9')](),controller[_0x87d8('0x1f')]);router[_0x87d8('0x1e')](_0x87d8('0xd'),auth[_0x87d8('0x9')](),controller[_0x87d8('0x20')]);router['delete']('/:id/users',auth[_0x87d8('0x9')](),controller[_0x87d8('0x21')]);module[_0x87d8('0x22')]=router;
\ No newline at end of file
+var _0x1c99=['get','isAuthenticated','/describe','/:id','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','post','create','/:id/dispositions','addContacts','addAgents','put','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x1c99,0x66));var _0x91c9=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x1c99[_0x125ff8];return _0x2d9ef;};'use strict';var multer=require(_0x91c9('0x0'));var util=require(_0x91c9('0x1'));var path=require(_0x91c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x91c9('0x3'));var router=express[_0x91c9('0x4')]();var fs_extra=require(_0x91c9('0x5'));var auth=require(_0x91c9('0x6'));var interaction=require(_0x91c9('0x7'));var config=require(_0x91c9('0x8'));var controller=require(_0x91c9('0x9'));router[_0x91c9('0xa')]('/',auth[_0x91c9('0xb')](),controller['index']);router[_0x91c9('0xa')](_0x91c9('0xc'),auth[_0x91c9('0xb')](),controller['describe']);router[_0x91c9('0xa')](_0x91c9('0xd'),auth[_0x91c9('0xb')](),controller['show']);router[_0x91c9('0xa')]('/:id/dispositions',auth[_0x91c9('0xb')](),controller[_0x91c9('0xe')]);router[_0x91c9('0xa')](_0x91c9('0xf'),auth['isAuthenticated'](),controller[_0x91c9('0x10')]);router[_0x91c9('0xa')](_0x91c9('0x11'),auth[_0x91c9('0xb')](),controller[_0x91c9('0x12')]);router[_0x91c9('0xa')]('/:id/fields',auth[_0x91c9('0xb')](),controller[_0x91c9('0x13')]);router[_0x91c9('0xa')](_0x91c9('0x14'),auth[_0x91c9('0xb')](),controller['getAgents']);router[_0x91c9('0x15')]('/',auth[_0x91c9('0xb')](),controller[_0x91c9('0x16')]);router[_0x91c9('0x15')](_0x91c9('0x17'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x91c9('0x15')](_0x91c9('0xf'),auth[_0x91c9('0xb')](),controller[_0x91c9('0x18')]);router[_0x91c9('0x15')]('/:id/fields',auth['isAuthenticated'](),controller['addCustomField']);router[_0x91c9('0x15')](_0x91c9('0x14'),auth[_0x91c9('0xb')](),controller[_0x91c9('0x19')]);router[_0x91c9('0x1a')](_0x91c9('0xd'),auth[_0x91c9('0xb')](),controller['update']);router[_0x91c9('0x1b')](_0x91c9('0xd'),auth[_0x91c9('0xb')](),controller['destroy']);router[_0x91c9('0x1b')](_0x91c9('0x17'),auth[_0x91c9('0xb')](),controller['removeDispositions']);router[_0x91c9('0x1b')](_0x91c9('0x14'),auth[_0x91c9('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index ed91d94..52f6ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21ea=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x55b1be,_0x38b59a){var _0x23d5e4=function(_0x3af94c){while(--_0x3af94c){_0x55b1be['push'](_0x55b1be['shift']());}};_0x23d5e4(++_0x38b59a);}(_0x21ea,0x132));var _0xa21e=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x21ea[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0xa21e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa21e('0x1')],'get':function(_0x188f2a){return this[_0xa21e('0x2')](_0xa21e('0x3'));}},'field':{'type':Sequelize[_0xa21e('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xa21e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xa21e('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0x0f93=['VIRTUAL','getDataValue','field','STRING','exports'];(function(_0xddee98,_0x50d312){var _0x108d97=function(_0x446dd8){while(--_0x446dd8){_0xddee98['push'](_0xddee98['shift']());}};_0x108d97(++_0x50d312);}(_0x0f93,0x176));var _0x30f9=function(_0x1ea324,_0x1926ee){_0x1ea324=_0x1ea324-0x0;var _0x2505d5=_0x0f93[_0x1ea324];return _0x2505d5;};'use strict';var Sequelize=require('sequelize');module[_0x30f9('0x0')]={'name':{'type':Sequelize[_0x30f9('0x1')],'get':function(_0x24f54c){return this[_0x30f9('0x2')](_0x30f9('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x30f9('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 81bdd9c..b2c2f08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4efbfe,_0x501e36){var _0x2a13c1=function(_0x2d91bf){while(--_0x2d91bf){_0x4efbfe['push'](_0x4efbfe['shift']());}};_0x2a13c1(++_0x501e36);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x33615d,_0x4ef7b6){var _0x577d36=function(_0x2c69b0){while(--_0x2c69b0){_0x33615d['push'](_0x33615d['shift']());}};_0x577d36(++_0x4ef7b6);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
index 4fa8bdc..8f46938 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2afe=['exports','define','Condition','tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x2afe,0x66));var _0xe2af=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2afe[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xe2af('0x0'));var util=require(_0xe2af('0x1'));var logger=require(_0xe2af('0x2'))('api');var moment=require(_0xe2af('0x3'));var BPromise=require(_0xe2af('0x4'));var rp=require(_0xe2af('0x5'));var fs=require('fs');var path=require(_0xe2af('0x6'));var rimraf=require(_0xe2af('0x7'));var config=require(_0xe2af('0x8'));var attributes=require(_0xe2af('0x9'));module[_0xe2af('0xa')]=function(_0x4ebb9e,_0x2aebbe){return _0x4ebb9e[_0xe2af('0xb')](_0xe2af('0xc'),attributes,{'tableName':_0xe2af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ae9=['bluebird','path','../../config/environment','./condition.attributes','exports','define','tools_conditions','lodash','../../config/logger','api','moment'];(function(_0x44e9b4,_0x47ce85){var _0x3381e2=function(_0x1b5e71){while(--_0x1b5e71){_0x44e9b4['push'](_0x44e9b4['shift']());}};_0x3381e2(++_0x47ce85);}(_0x2ae9,0xe3));var _0x92ae=function(_0x3666dc,_0x18701a){_0x3666dc=_0x3666dc-0x0;var _0x31c942=_0x2ae9[_0x3666dc];return _0x31c942;};'use strict';var _=require(_0x92ae('0x0'));var util=require('util');var logger=require(_0x92ae('0x1'))(_0x92ae('0x2'));var moment=require(_0x92ae('0x3'));var BPromise=require(_0x92ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x92ae('0x5'));var rimraf=require('rimraf');var config=require(_0x92ae('0x6'));var attributes=require(_0x92ae('0x7'));module[_0x92ae('0x8')]=function(_0x14bc14,_0x4313b4){return _0x14bc14[_0x92ae('0x9')]('Condition',attributes,{'tableName':_0x92ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 497bd25..81d9a4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x088d=['request','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x544072,_0xc41ee1){var _0x590bf6=function(_0x41107f){while(--_0x41107f){_0x544072['push'](_0x544072['shift']());}};_0x590bf6(++_0xc41ee1);}(_0x088d,0x113));var _0xd088=function(_0x28ab46,_0x236e8d){_0x28ab46=_0x28ab46-0x0;var _0x18c177=_0x088d[_0x28ab46];return _0x18c177;};'use strict';var _=require('lodash');var util=require(_0xd088('0x0'));var moment=require(_0xd088('0x1'));var BPromise=require('bluebird');var rs=require(_0xd088('0x2'));var fs=require('fs');var Redis=require(_0xd088('0x3'));var db=require(_0xd088('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd088('0x5'))('rpc');var config=require(_0xd088('0x6'));var jayson=require(_0xd088('0x7'));var client=jayson[_0xd088('0x8')][_0xd088('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x123729,_0x2c426f,_0x4fe1bb){return new BPromise(function(_0x613079,_0x91172c){return client[_0xd088('0xa')](_0x123729,_0x4fe1bb)['then'](function(_0x53c610){logger['info']('Condition,\x20%s,\x20%s',_0x2c426f,_0xd088('0xb'));logger['debug'](_0xd088('0xc'),_0x2c426f,_0xd088('0xb'),JSON[_0xd088('0xd')](_0x53c610));if(_0x53c610['error']){if(_0x53c610[_0xd088('0xe')][_0xd088('0xf')]===0x1f4){logger[_0xd088('0xe')](_0xd088('0x10'),_0x2c426f,_0x53c610[_0xd088('0xe')][_0xd088('0x11')]);return _0x91172c(_0x53c610[_0xd088('0xe')]['message']);}logger[_0xd088('0xe')](_0xd088('0x10'),_0x2c426f,_0x53c610['error']['message']);return _0x613079(_0x53c610[_0xd088('0xe')]['message']);}else{logger['info'](_0xd088('0x10'),_0x2c426f,_0xd088('0xb'));_0x613079(_0x53c610[_0xd088('0x12')][_0xd088('0x11')]);}})['catch'](function(_0x3d1360){logger[_0xd088('0xe')](_0xd088('0x10'),_0x2c426f,_0x3d1360);_0x91172c(_0x3d1360);});});}
\ No newline at end of file
+var _0xfb9a=['util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash'];(function(_0x222524,_0x7a5cd){var _0x1d8b5c=function(_0x4d4309){while(--_0x4d4309){_0x222524['push'](_0x222524['shift']());}};_0x1d8b5c(++_0x7a5cd);}(_0xfb9a,0x1b8));var _0xafb9=function(_0x1694c8,_0x3f04ae){_0x1694c8=_0x1694c8-0x0;var _0xebb521=_0xfb9a[_0x1694c8];return _0xebb521;};'use strict';var _=require(_0xafb9('0x0'));var util=require(_0xafb9('0x1'));var moment=require(_0xafb9('0x2'));var BPromise=require(_0xafb9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafb9('0x4'));var db=require(_0xafb9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xafb9('0x6'));var config=require(_0xafb9('0x7'));var jayson=require(_0xafb9('0x8'));var client=jayson[_0xafb9('0x9')][_0xafb9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e090,_0x2304df,_0x4e9f37){return new BPromise(function(_0x12f99a,_0x1e93da){return client[_0xafb9('0xb')](_0x45e090,_0x4e9f37)['then'](function(_0xa9b778){logger[_0xafb9('0xc')](_0xafb9('0xd'),_0x2304df,_0xafb9('0xe'));logger[_0xafb9('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x2304df,_0xafb9('0xe'),JSON[_0xafb9('0x10')](_0xa9b778));if(_0xa9b778[_0xafb9('0x11')]){if(_0xa9b778[_0xafb9('0x11')][_0xafb9('0x12')]===0x1f4){logger['error'](_0xafb9('0xd'),_0x2304df,_0xa9b778['error'][_0xafb9('0x13')]);return _0x1e93da(_0xa9b778[_0xafb9('0x11')][_0xafb9('0x13')]);}logger['error'](_0xafb9('0xd'),_0x2304df,_0xa9b778[_0xafb9('0x11')][_0xafb9('0x13')]);return _0x12f99a(_0xa9b778['error'][_0xafb9('0x13')]);}else{logger[_0xafb9('0xc')]('Condition,\x20%s,\x20%s',_0x2304df,_0xafb9('0xe'));_0x12f99a(_0xa9b778[_0xafb9('0x14')][_0xafb9('0x13')]);}})['catch'](function(_0x24de9f){logger[_0xafb9('0x11')](_0xafb9('0xd'),_0x2304df,_0x24de9f);_0x1e93da(_0x24de9f);});});}
\ No newline at end of file
index 603b670..93c630c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x693e=['update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id'];(function(_0x59e864,_0x5bcc07){var _0x15123e=function(_0x2becd6){while(--_0x2becd6){_0x59e864['push'](_0x59e864['shift']());}};_0x15123e(++_0x5bcc07);}(_0x693e,0xe6));var _0xe693=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x693e[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xe693('0x0'));var util=require(_0xe693('0x1'));var path=require(_0xe693('0x2'));var timeout=require(_0xe693('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe693('0x4'));var auth=require(_0xe693('0x5'));var interaction=require(_0xe693('0x6'));var config=require(_0xe693('0x7'));var controller=require(_0xe693('0x8'));router['put'](_0xe693('0x9'),auth['isAuthenticated'](),controller[_0xe693('0xa')]);router[_0xe693('0xb')](_0xe693('0x9'),auth[_0xe693('0xc')](),controller[_0xe693('0xd')]);module[_0xe693('0xe')]=router;
\ No newline at end of file
+var _0x761e=['put','/:id','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./condition.controller'];(function(_0x5dd23d,_0x21a586){var _0x2284cf=function(_0x148286){while(--_0x148286){_0x5dd23d['push'](_0x5dd23d['shift']());}};_0x2284cf(++_0x21a586);}(_0x761e,0xc9));var _0xe761=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x761e[_0x412e27];return _0x53da42;};'use strict';var multer=require(_0xe761('0x0'));var util=require(_0xe761('0x1'));var path=require(_0xe761('0x2'));var timeout=require(_0xe761('0x3'));var express=require(_0xe761('0x4'));var router=express[_0xe761('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe761('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe761('0x7'));var controller=require(_0xe761('0x8'));router[_0xe761('0x9')](_0xe761('0xa'),auth[_0xe761('0xb')](),controller[_0xe761('0xc')]);router[_0xe761('0xd')](_0xe761('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xe761('0xe')]=router;
\ No newline at end of file
index 399de36..90550af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x54a230,_0x352eea){var _0x237e76=function(_0x578aa5){while(--_0x578aa5){_0x54a230['push'](_0x54a230['shift']());}};_0x237e76(++_0x352eea);}(_0xb10b,0x12a));var _0xbb10=function(_0x35655f,_0x23dfc3){_0x35655f=_0x35655f-0x0;var _0x1f2ae8=_0xb10b[_0x35655f];return _0x1f2ae8;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x2540b7,_0x53e961){var _0x138e6e=function(_0x208f02){while(--_0x208f02){_0x2540b7['push'](_0x2540b7['shift']());}};_0x138e6e(++_0x53e961);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index afe4d6f..afb864f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36a7=['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','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','error','stack','send','map','Dashboard','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','userProfileId','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse'];(function(_0x426239,_0x46cbab){var _0x136cc8=function(_0xd53c21){while(--_0xd53c21){_0x426239['push'](_0x426239['shift']());}};_0x136cc8(++_0x46cbab);}(_0x36a7,0x1e9));var _0x736a=function(_0x188e45,_0x488cd5){_0x188e45=_0x188e45-0x0;var _0x147c8f=_0x36a7[_0x188e45];return _0x147c8f;};'use strict';var emlformat=require(_0x736a('0x0'));var rimraf=require(_0x736a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x736a('0x2'));var rp=require(_0x736a('0x3'));var moment=require('moment');var BPromise=require(_0x736a('0x4'));var Mustache=require(_0x736a('0x5'));var util=require(_0x736a('0x6'));var path=require(_0x736a('0x7'));var sox=require('sox');var csv=require(_0x736a('0x8'));var ejs=require(_0x736a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x736a('0xa'));var squel=require(_0x736a('0xb'));var crypto=require('crypto');var jsforce=require(_0x736a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x736a('0x8'));var querystring=require(_0x736a('0xd'));var Papa=require(_0x736a('0xe'));var Redis=require(_0x736a('0xf'));var authService=require(_0x736a('0x10'));var qs=require(_0x736a('0x11'));var as=require(_0x736a('0x12'));var hardwareService=require(_0x736a('0x13'));var logger=require(_0x736a('0x14'))(_0x736a('0x15'));var utils=require(_0x736a('0x16'));var config=require(_0x736a('0x17'));var licenseUtil=require(_0x736a('0x18'));var db=require(_0x736a('0x19'))['db'];config[_0x736a('0x1a')]=_[_0x736a('0x1b')](config['redis'],{'host':_0x736a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x736a('0x1a')]));require('./dashboard.socket')[_0x736a('0x1d')](socket);function respondWithStatusCode(_0x58527e,_0x4f20bb){_0x4f20bb=_0x4f20bb||0xcc;return function(_0x15790d){if(_0x15790d){return _0x58527e[_0x736a('0x1e')](_0x4f20bb);}return _0x58527e[_0x736a('0x1f')](_0x4f20bb)[_0x736a('0x20')]();};}function respondWithResult(_0x152e52,_0x31a663){_0x31a663=_0x31a663||0xc8;return function(_0x585fcf){if(_0x585fcf){return _0x152e52[_0x736a('0x1f')](_0x31a663)[_0x736a('0x21')](_0x585fcf);}};}function respondWithFilteredResult(_0xd9f55b,_0x211152){return function(_0x194554){if(_0x194554){var _0x135ddb=typeof _0x211152[_0x736a('0x22')]===_0x736a('0x23')&&typeof _0x211152[_0x736a('0x24')]==='undefined';var _0x20209d=_0x194554['count'];var _0x310ac1=_0x135ddb?0x0:_0x211152[_0x736a('0x22')];var _0x3e6ff2=_0x135ddb?_0x194554['count']:_0x211152[_0x736a('0x22')]+_0x211152['limit'];var _0x54cef8;if(_0x3e6ff2>=_0x20209d){_0x3e6ff2=_0x20209d;_0x54cef8=0xc8;}else{_0x54cef8=0xce;}_0xd9f55b[_0x736a('0x1f')](_0x54cef8);return _0xd9f55b[_0x736a('0x25')](_0x736a('0x26'),_0x310ac1+'-'+_0x3e6ff2+'/'+_0x20209d)[_0x736a('0x21')](_0x194554);}return null;};}function patchUpdates(_0x502fbe){return function(_0x9e3dc1){try{jsonpatch['apply'](_0x9e3dc1,_0x502fbe,!![]);}catch(_0x5951ab){return BPromise[_0x736a('0x27')](_0x5951ab);}return _0x9e3dc1[_0x736a('0x28')]();};}function saveUpdates(_0x6c59e4,_0x12b903){return function(_0x395b0a){if(_0x395b0a){return _0x395b0a[_0x736a('0x29')](_0x6c59e4)[_0x736a('0x2a')](function(_0x24dd41){return _0x24dd41;});}return null;};}function removeEntity(_0x1c7ab2,_0x4f8e65){return function(_0xef2122){if(_0xef2122){return _0xef2122[_0x736a('0x2b')]()['then'](function(){var _0x3559a8=_0xef2122['get']({'plain':!![]});var _0xb5786b=_0x736a('0x2c');return db[_0x736a('0x2d')]['destroy']({'where':{'type':_0xb5786b,'resourceId':_0x3559a8['id']}})['then'](function(){return _0xef2122;});})['then'](function(){_0x1c7ab2[_0x736a('0x1f')](0xcc)[_0x736a('0x20')]();});}};}function handleEntityNotFound(_0x18b780,_0x42378d){return function(_0x4a22b7){if(!_0x4a22b7){_0x18b780[_0x736a('0x1e')](0x194);}return _0x4a22b7;};}function handleError(_0x1b9f29,_0x10e4d8){_0x10e4d8=_0x10e4d8||0x1f4;return function(_0xea62d3){logger[_0x736a('0x2e')](_0xea62d3[_0x736a('0x2f')]);if(_0xea62d3['name']){delete _0xea62d3['name'];}_0x1b9f29[_0x736a('0x1f')](_0x10e4d8)[_0x736a('0x30')](_0xea62d3);};}exports['index']=function(_0x431c9f,_0x3636ca){var _0x833c7c={},_0x1f6ae1={},_0x209623={'count':0x0,'rows':[]};var _0x223ffe=_[_0x736a('0x31')](db[_0x736a('0x32')][_0x736a('0x33')],function(_0x17a193){return{'name':_0x17a193[_0x736a('0x34')],'type':_0x17a193[_0x736a('0x35')][_0x736a('0x36')]};});_0x1f6ae1['model']=_[_0x736a('0x31')](_0x223ffe,_0x736a('0x37'));_0x1f6ae1[_0x736a('0x38')]=_[_0x736a('0x39')](_0x431c9f[_0x736a('0x38')]);_0x1f6ae1[_0x736a('0x3a')]=_[_0x736a('0x3b')](_0x1f6ae1[_0x736a('0x3c')],_0x1f6ae1['query']);_0x833c7c['attributes']=_[_0x736a('0x3b')](_0x1f6ae1[_0x736a('0x3c')],qs[_0x736a('0x3d')](_0x431c9f[_0x736a('0x38')]['fields']));_0x833c7c[_0x736a('0x3e')]=_0x833c7c[_0x736a('0x3e')][_0x736a('0x3f')]?_0x833c7c['attributes']:_0x1f6ae1[_0x736a('0x3c')];if(!_0x431c9f['query'][_0x736a('0x40')](_0x736a('0x41'))){_0x833c7c['limit']=qs[_0x736a('0x24')](_0x431c9f['query']['limit']);_0x833c7c[_0x736a('0x22')]=qs['offset'](_0x431c9f[_0x736a('0x38')]['offset']);}_0x833c7c[_0x736a('0x42')]=qs[_0x736a('0x43')](_0x431c9f[_0x736a('0x38')][_0x736a('0x43')]);_0x833c7c[_0x736a('0x44')]=qs['filters'](_[_0x736a('0x45')](_0x431c9f[_0x736a('0x38')],_0x1f6ae1[_0x736a('0x3a')]),_0x223ffe);if(_0x431c9f[_0x736a('0x38')][_0x736a('0x46')]){_0x833c7c[_0x736a('0x44')]=_[_0x736a('0x47')](_0x833c7c[_0x736a('0x44')],{'$or':_[_0x736a('0x31')](_0x223ffe,function(_0x3b9762){if(_0x3b9762[_0x736a('0x35')]!==_0x736a('0x48')){var _0x2516dc={};_0x2516dc[_0x3b9762[_0x736a('0x37')]]={'$like':'%'+_0x431c9f[_0x736a('0x38')]['filter']+'%'};return _0x2516dc;}})});}_0x833c7c=_[_0x736a('0x47')]({},_0x833c7c,_0x431c9f[_0x736a('0x49')]);var _0x2212fc={'where':_0x833c7c['where']};return db['Dashboard'][_0x736a('0x4a')](_0x2212fc)[_0x736a('0x2a')](function(_0x334a34){_0x209623['count']=_0x334a34;if(_0x431c9f['query'][_0x736a('0x4b')]){_0x833c7c[_0x736a('0x4c')]=[{'all':!![]}];}return db[_0x736a('0x32')]['findAll'](_0x833c7c);})[_0x736a('0x2a')](function(_0x1c3495){_0x209623[_0x736a('0x4d')]=_0x1c3495;return _0x209623;})[_0x736a('0x2a')](respondWithFilteredResult(_0x3636ca,_0x833c7c))['catch'](handleError(_0x3636ca,null));};exports[_0x736a('0x4e')]=function(_0x156592,_0x596928){var _0x133b0e={'raw':![],'where':{'id':_0x156592[_0x736a('0x4f')]['id']}},_0x5851ca={};_0x5851ca[_0x736a('0x3c')]=_[_0x736a('0x39')](db['Dashboard']['rawAttributes']);_0x5851ca[_0x736a('0x38')]=_[_0x736a('0x39')](_0x156592[_0x736a('0x38')]);_0x5851ca['filters']=_['intersection'](_0x5851ca['model'],_0x5851ca[_0x736a('0x38')]);_0x133b0e['attributes']=_[_0x736a('0x3b')](_0x5851ca[_0x736a('0x3c')],qs[_0x736a('0x3d')](_0x156592[_0x736a('0x38')][_0x736a('0x3d')]));_0x133b0e[_0x736a('0x3e')]=_0x133b0e[_0x736a('0x3e')][_0x736a('0x3f')]?_0x133b0e[_0x736a('0x3e')]:_0x5851ca[_0x736a('0x3c')];if(_0x156592[_0x736a('0x38')]['includeAll']){_0x133b0e['include']=[{'all':!![]}];}_0x133b0e=_['merge']({},_0x133b0e,_0x156592[_0x736a('0x49')]);return db[_0x736a('0x32')][_0x736a('0x50')](_0x133b0e)['then'](handleEntityNotFound(_0x596928,null))[_0x736a('0x2a')](respondWithResult(_0x596928,null))[_0x736a('0x51')](handleError(_0x596928,null));};exports[_0x736a('0x52')]=function(_0x12cb27,_0x230e4c){return db[_0x736a('0x32')][_0x736a('0x52')](_0x12cb27[_0x736a('0x53')],{})[_0x736a('0x2a')](function(_0x24e1f9){var _0x5392e3=_0x12cb27[_0x736a('0x54')][_0x736a('0x55')]({'plain':!![]});if(!_0x5392e3)throw new Error(_0x736a('0x56'));if(_0x5392e3['role']==='user'){var _0xc392e9=_0x24e1f9[_0x736a('0x55')]({'plain':!![]});var _0x3eaa44=_0x736a('0x2c');return db[_0x736a('0x57')][_0x736a('0x50')]({'where':{'name':_0x3eaa44,'userProfileId':_0x5392e3['userProfileId']},'raw':!![]})['then'](function(_0x4c8688){if(_0x4c8688&&_0x4c8688[_0x736a('0x58')]===0x0){return db[_0x736a('0x2d')][_0x736a('0x52')]({'name':_0xc392e9[_0x736a('0x37')],'resourceId':_0xc392e9['id'],'type':_0x4c8688[_0x736a('0x37')],'sectionId':_0x4c8688['id']},{})['then'](function(){return _0x24e1f9;});}else{return _0x24e1f9;}})[_0x736a('0x51')](function(_0x1c50de){logger['error'](_0x736a('0x59'),_0x1c50de);throw _0x1c50de;});}return _0x24e1f9;})[_0x736a('0x2a')](respondWithResult(_0x230e4c,0xc9))['catch'](handleError(_0x230e4c,null));};exports[_0x736a('0x5a')]=function(_0x1a72bd,_0x563944){var _0x319f72={'where':{'id':_0x1a72bd[_0x736a('0x4f')]['id']}},_0x568091={};_0x568091[_0x736a('0x3c')]=_['keys'](db['Dashboard'][_0x736a('0x33')]);_0x319f72['attributes']=_[_0x736a('0x3b')](_0x568091[_0x736a('0x3c')],qs[_0x736a('0x3d')](_0x1a72bd['query'][_0x736a('0x3d')]));_0x319f72[_0x736a('0x3e')]=_0x319f72[_0x736a('0x3e')]['length']?_0x319f72[_0x736a('0x3e')]:_0x568091[_0x736a('0x3c')];if(_0x1a72bd['query'][_0x736a('0x4b')]){_0x319f72[_0x736a('0x4c')]=[{'all':!![]}];}_0x319f72=_[_0x736a('0x47')]({},_0x319f72,_0x1a72bd[_0x736a('0x49')]);return db[_0x736a('0x32')][_0x736a('0x50')](_0x319f72)[_0x736a('0x2a')](handleEntityNotFound(_0x563944,null))['then'](function(_0x41fb71){if(_0x41fb71){var _0x1e8345=_0x41fb71[_0x736a('0x55')]({'plain':!![]});_0x1e8345=qs[_0x736a('0x5b')](_0x1e8345,['id',_0x736a('0x5c'),_0x736a('0x5d')]);_0x1a72bd[_0x736a('0x53')]=_['omit'](_0x1a72bd[_0x736a('0x53')],['id',_0x736a('0x5c'),'updatedAt']);return db['Dashboard'][_0x736a('0x52')](_[_0x736a('0x47')](_0x1e8345,_0x1a72bd[_0x736a('0x53')]),{'include':_0x1a72bd[_0x736a('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0x736a('0x2a')](function(_0x177608){var _0x5696ea=_0x1a72bd[_0x736a('0x54')][_0x736a('0x55')]({'plain':!![]});if(!_0x5696ea)throw new Error(_0x736a('0x56'));if(_0x5696ea[_0x736a('0x5e')]===_0x736a('0x54')){var _0x213e23=_0x177608[_0x736a('0x55')]({'plain':!![]});var _0x34a4bb=_0x736a('0x2c');return db[_0x736a('0x57')][_0x736a('0x50')]({'where':{'name':_0x34a4bb,'userProfileId':_0x5696ea[_0x736a('0x5f')]},'raw':!![]})[_0x736a('0x2a')](function(_0x2ab8bc){if(_0x2ab8bc&&_0x2ab8bc[_0x736a('0x58')]===0x0){return db[_0x736a('0x2d')][_0x736a('0x52')]({'name':_0x213e23[_0x736a('0x37')],'resourceId':_0x213e23['id'],'type':_0x2ab8bc[_0x736a('0x37')],'sectionId':_0x2ab8bc['id']},{})[_0x736a('0x2a')](function(){return _0x177608;});}else{return _0x177608;}})['catch'](function(_0x236eb3){logger[_0x736a('0x2e')](_0x736a('0x59'),_0x236eb3);throw _0x236eb3;});}return _0x177608;});}})[_0x736a('0x2a')](respondWithResult(_0x563944,0xc9))[_0x736a('0x51')](handleError(_0x563944,null));};exports[_0x736a('0x29')]=function(_0x2c6dcd,_0x2e26a5){if(_0x2c6dcd[_0x736a('0x53')]['id']){delete _0x2c6dcd[_0x736a('0x53')]['id'];}return db[_0x736a('0x32')][_0x736a('0x50')]({'where':{'id':_0x2c6dcd[_0x736a('0x4f')]['id']}})[_0x736a('0x2a')](handleEntityNotFound(_0x2e26a5,null))[_0x736a('0x2a')](saveUpdates(_0x2c6dcd[_0x736a('0x53')],null))[_0x736a('0x2a')](respondWithResult(_0x2e26a5,null))['catch'](handleError(_0x2e26a5,null));};exports[_0x736a('0x2b')]=function(_0x339730,_0x5bb3e0){return db[_0x736a('0x32')][_0x736a('0x50')]({'where':{'id':_0x339730[_0x736a('0x4f')]['id']}})[_0x736a('0x2a')](handleEntityNotFound(_0x5bb3e0,null))[_0x736a('0x2a')](removeEntity(_0x5bb3e0,null))[_0x736a('0x51')](handleError(_0x5bb3e0,null));};function widgetAttributes(_0x53d591){try{switch(_0x53d591[_0x736a('0x35')]){case'iframe':return[{'name':_0x736a('0x60'),'value':_0x53d591[_0x736a('0x60')]||(_0x53d591[_0x736a('0x61')]&&_0x53d591['attrs'][0x0]?_0x53d591['attrs'][0x0][_0x736a('0x62')]:undefined)||_0x736a('0x63')}];case _0x736a('0x64'):return[{'name':_0x736a('0x65'),'value':_0x53d591[_0x736a('0x65')]||(_0x53d591[_0x736a('0x61')]&&_0x53d591['attrs'][0x0]?_0x53d591[_0x736a('0x61')][0x0][_0x736a('0x62')]:undefined)||''}];case _0x736a('0x66'):return[{'name':_0x736a('0x67'),'value':_0x53d591['attrHourFormat']||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x0]?_0x53d591['attrs'][0x0]['value']:undefined)||_0x736a('0x68')},{'name':'attrTimezone','value':_0x53d591[_0x736a('0x69')]||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x1]?_0x53d591[_0x736a('0x61')][0x1][_0x736a('0x62')]:undefined)||_0x736a('0x6a')},{'name':'attrFontSize','value':_0x53d591['attrFontSize']||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x2]?_0x53d591[_0x736a('0x61')][0x2][_0x736a('0x62')]:undefined)||0xc}];case _0x736a('0x6b'):return[{'name':_0x736a('0x6c'),'value':_0x53d591['attrMetric']||(_0x53d591[_0x736a('0x61')]&&_0x53d591['attrs'][0x0]?_0x53d591['attrs'][0x0][_0x736a('0x62')]:undefined)||_0x736a('0x6d')},{'name':_0x736a('0x6e'),'value':_0x53d591['attrVoiceQueues']||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x1]?_0x53d591[_0x736a('0x61')][0x1][_0x736a('0x62')]:undefined)||[]},{'name':_0x736a('0x6f'),'value':_0x53d591[_0x736a('0x6f')]||(_0x53d591['attrs']&&_0x53d591[_0x736a('0x61')][0x2]?_0x53d591[_0x736a('0x61')][0x2][_0x736a('0x62')]:undefined)||0x14}];case _0x736a('0x70'):case _0x736a('0x71'):return[{'name':'attrSerie1','value':_0x53d591['attrSerie1']||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x0]?_0x53d591[_0x736a('0x61')][0x0][_0x736a('0x62')]:undefined)||'total'},{'name':'attrSerie2','value':_0x53d591[_0x736a('0x72')]||(_0x53d591[_0x736a('0x61')]&&_0x53d591['attrs'][0x1]?_0x53d591[_0x736a('0x61')][0x1][_0x736a('0x62')]:undefined)||null},{'name':_0x736a('0x73'),'value':_0x53d591[_0x736a('0x73')]||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x2]?_0x53d591[_0x736a('0x61')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x53d591['attrVoiceQueues']||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x3]?_0x53d591[_0x736a('0x61')][0x3][_0x736a('0x62')]:undefined)||[]}];case _0x736a('0x74'):return[{'name':_0x736a('0x75'),'type':_0x53d591[_0x736a('0x76')]||(_0x53d591['attrs']&&_0x53d591['attrs'][0x0]?_0x53d591[_0x736a('0x61')][0x0][_0x736a('0x35')]:undefined)||null,'value':_0x53d591[_0x736a('0x75')]||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x0]?_0x53d591[_0x736a('0x61')][0x0][_0x736a('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0x53d591['attrRefresh']||(_0x53d591[_0x736a('0x61')]&&_0x53d591[_0x736a('0x61')][0x1]?_0x53d591[_0x736a('0x61')][0x1][_0x736a('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x4d3c97){logger['error'](_0x736a('0x77'),JSON[_0x736a('0x78')](_0x4d3c97));return[];}}exports[_0x736a('0x79')]=function(_0xa3390b,_0x2c3700,_0x141a32){if(_0xa3390b[_0x736a('0x53')]['id']){delete _0xa3390b[_0x736a('0x53')]['id'];}return db['Dashboard'][_0x736a('0x50')]({'where':{'id':_0xa3390b[_0x736a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2c3700,null))[_0x736a('0x2a')](function(_0x25a29d){if(_0x25a29d){_0xa3390b['body'][_0x736a('0x7a')]=_0x25a29d['id'];_0xa3390b[_0x736a('0x53')]['attrs']=widgetAttributes(_0xa3390b['body']);return db[_0x736a('0x7b')][_0x736a('0x52')](_0xa3390b['body']);}})[_0x736a('0x2a')](respondWithResult(_0x2c3700,null))[_0x736a('0x51')](handleError(_0x2c3700,null));};exports[_0x736a('0x7c')]=function(_0x2ed26c,_0x29ff1d,_0x327eda){var _0x5a3edc={};var _0x54f813={};var _0x5c3a8c;var _0x1afce9;return db['Dashboard'][_0x736a('0x7d')]({'where':{'id':_0x2ed26c[_0x736a('0x4f')]['id']}})[_0x736a('0x2a')](handleEntityNotFound(_0x29ff1d,null))[_0x736a('0x2a')](function(_0x57afbd){if(_0x57afbd){_0x5c3a8c=_0x57afbd;_0x54f813[_0x736a('0x3c')]=_[_0x736a('0x39')](db['DashboardItem'][_0x736a('0x33')]);_0x54f813[_0x736a('0x38')]=_['keys'](_0x2ed26c[_0x736a('0x38')]);_0x54f813[_0x736a('0x3a')]=_[_0x736a('0x3b')](_0x54f813['model'],_0x54f813['query']);_0x5a3edc['attributes']=_[_0x736a('0x3b')](_0x54f813[_0x736a('0x3c')],qs[_0x736a('0x3d')](_0x2ed26c[_0x736a('0x38')][_0x736a('0x3d')]));_0x5a3edc['attributes']=_0x5a3edc['attributes'][_0x736a('0x3f')]?_0x5a3edc[_0x736a('0x3e')]:_0x54f813[_0x736a('0x3c')];_0x5a3edc['order']=qs['sort'](_0x2ed26c[_0x736a('0x38')][_0x736a('0x43')]);_0x5a3edc[_0x736a('0x44')]=qs[_0x736a('0x3a')](_[_0x736a('0x45')](_0x2ed26c[_0x736a('0x38')],_0x54f813[_0x736a('0x3a')]));if(_0x2ed26c['query']['filter']){_0x5a3edc[_0x736a('0x44')]=_[_0x736a('0x47')](_0x5a3edc[_0x736a('0x44')],{'$or':_['map'](_0x5a3edc[_0x736a('0x3e')],function(_0x6c6303){var _0x177068={};_0x177068[_0x6c6303]={'$like':'%'+_0x2ed26c['query'][_0x736a('0x46')]+'%'};return _0x177068;})});}_0x5a3edc=_[_0x736a('0x47')]({},_0x5a3edc,_0x2ed26c[_0x736a('0x49')]);return _0x5c3a8c[_0x736a('0x7c')](_0x5a3edc);}})['then'](function(_0x3896a3){if(_0x3896a3){_0x1afce9=_0x3896a3[_0x736a('0x3f')];if(!_0x2ed26c[_0x736a('0x38')]['hasOwnProperty'](_0x736a('0x41'))){_0x5a3edc[_0x736a('0x24')]=qs[_0x736a('0x24')](_0x2ed26c[_0x736a('0x38')]['limit']);_0x5a3edc[_0x736a('0x22')]=qs[_0x736a('0x22')](_0x2ed26c[_0x736a('0x38')]['offset']);}return _0x5c3a8c[_0x736a('0x7c')](_0x5a3edc);}})[_0x736a('0x2a')](function(_0x3e05c8){if(_0x3e05c8){return _0x3e05c8?{'count':_0x1afce9,'rows':_0x3e05c8}:null;}})[_0x736a('0x2a')](respondWithResult(_0x29ff1d,null))[_0x736a('0x51')](handleError(_0x29ff1d,null));};
\ No newline at end of file
+var _0x994e=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','update','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','pick','getItems','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','end','error','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','attributes','find','create','body','user'];(function(_0x51af50,_0x3d5c0b){var _0x415302=function(_0x1501d8){while(--_0x1501d8){_0x51af50['push'](_0x51af50['shift']());}};_0x415302(++_0x3d5c0b);}(_0x994e,0x19e));var _0xe994=function(_0x2dc7eb,_0x330655){_0x2dc7eb=_0x2dc7eb-0x0;var _0x18f922=_0x994e[_0x2dc7eb];return _0x18f922;};'use strict';var emlformat=require(_0xe994('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe994('0x1'));var jsonpatch=require(_0xe994('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe994('0x3'));var Mustache=require(_0xe994('0x4'));var util=require(_0xe994('0x5'));var path=require(_0xe994('0x6'));var sox=require(_0xe994('0x7'));var csv=require(_0xe994('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe994('0x9'));var crypto=require(_0xe994('0xa'));var jsforce=require(_0xe994('0xb'));var deskjs=require(_0xe994('0xc'));var toCsv=require(_0xe994('0x8'));var querystring=require('querystring');var Papa=require(_0xe994('0xd'));var Redis=require('ioredis');var authService=require(_0xe994('0xe'));var qs=require(_0xe994('0xf'));var as=require(_0xe994('0x10'));var hardwareService=require(_0xe994('0x11'));var logger=require(_0xe994('0x12'))(_0xe994('0x13'));var utils=require(_0xe994('0x14'));var config=require(_0xe994('0x15'));var licenseUtil=require(_0xe994('0x16'));var db=require(_0xe994('0x17'))['db'];config[_0xe994('0x18')]=_[_0xe994('0x19')](config[_0xe994('0x18')],{'host':_0xe994('0x1a'),'port':0x18eb});var socket=require(_0xe994('0x1b'))(new Redis(config['redis']));require(_0xe994('0x1c'))[_0xe994('0x1d')](socket);function respondWithStatusCode(_0x505d05,_0x4bddee){_0x4bddee=_0x4bddee||0xcc;return function(_0x40b28a){if(_0x40b28a){return _0x505d05['sendStatus'](_0x4bddee);}return _0x505d05[_0xe994('0x1e')](_0x4bddee)['end']();};}function respondWithResult(_0x23b44b,_0x242f51){_0x242f51=_0x242f51||0xc8;return function(_0x1adac3){if(_0x1adac3){return _0x23b44b[_0xe994('0x1e')](_0x242f51)[_0xe994('0x1f')](_0x1adac3);}};}function respondWithFilteredResult(_0x35e2ae,_0x5ec920){return function(_0x519f1c){if(_0x519f1c){var _0x24a193=typeof _0x5ec920[_0xe994('0x20')]===_0xe994('0x21')&&typeof _0x5ec920[_0xe994('0x22')]===_0xe994('0x21');var _0x9a90e3=_0x519f1c[_0xe994('0x23')];var _0x1587dc=_0x24a193?0x0:_0x5ec920[_0xe994('0x20')];var _0x4a8f9d=_0x24a193?_0x519f1c[_0xe994('0x23')]:_0x5ec920[_0xe994('0x20')]+_0x5ec920[_0xe994('0x22')];var _0x3aac7f;if(_0x4a8f9d>=_0x9a90e3){_0x4a8f9d=_0x9a90e3;_0x3aac7f=0xc8;}else{_0x3aac7f=0xce;}_0x35e2ae['status'](_0x3aac7f);return _0x35e2ae[_0xe994('0x24')]('Content-Range',_0x1587dc+'-'+_0x4a8f9d+'/'+_0x9a90e3)[_0xe994('0x1f')](_0x519f1c);}return null;};}function patchUpdates(_0xe2ca16){return function(_0x2c05d6){try{jsonpatch[_0xe994('0x25')](_0x2c05d6,_0xe2ca16,!![]);}catch(_0x11eb1b){return BPromise[_0xe994('0x26')](_0x11eb1b);}return _0x2c05d6[_0xe994('0x27')]();};}function saveUpdates(_0x384cf1,_0x1202a0){return function(_0x52bd33){if(_0x52bd33){return _0x52bd33['update'](_0x384cf1)[_0xe994('0x28')](function(_0x5f1a4d){return _0x5f1a4d;});}return null;};}function removeEntity(_0x12907c,_0x3bd09a){return function(_0x112b41){if(_0x112b41){return _0x112b41[_0xe994('0x29')]()[_0xe994('0x28')](function(){var _0x5eb254=_0x112b41[_0xe994('0x2a')]({'plain':!![]});var _0x25c98c=_0xe994('0x2b');return db[_0xe994('0x2c')]['destroy']({'where':{'type':_0x25c98c,'resourceId':_0x5eb254['id']}})[_0xe994('0x28')](function(){return _0x112b41;});})[_0xe994('0x28')](function(){_0x12907c[_0xe994('0x1e')](0xcc)[_0xe994('0x2d')]();});}};}function handleEntityNotFound(_0x149f5f,_0x481c67){return function(_0x298db4){if(!_0x298db4){_0x149f5f['sendStatus'](0x194);}return _0x298db4;};}function handleError(_0x55eedf,_0x58f720){_0x58f720=_0x58f720||0x1f4;return function(_0x47705b){logger[_0xe994('0x2e')](_0x47705b['stack']);if(_0x47705b[_0xe994('0x2f')]){delete _0x47705b['name'];}_0x55eedf[_0xe994('0x1e')](_0x58f720)[_0xe994('0x30')](_0x47705b);};}exports[_0xe994('0x31')]=function(_0x521af2,_0x5ba8ed){var _0x454a8d={},_0x53dbdf={},_0x177b28={'count':0x0,'rows':[]};var _0x4199a1=_[_0xe994('0x32')](db[_0xe994('0x33')][_0xe994('0x34')],function(_0x5e1e64){return{'name':_0x5e1e64[_0xe994('0x35')],'type':_0x5e1e64['type'][_0xe994('0x36')]};});_0x53dbdf[_0xe994('0x37')]=_[_0xe994('0x32')](_0x4199a1,_0xe994('0x2f'));_0x53dbdf[_0xe994('0x38')]=_[_0xe994('0x39')](_0x521af2['query']);_0x53dbdf[_0xe994('0x3a')]=_['intersection'](_0x53dbdf[_0xe994('0x37')],_0x53dbdf[_0xe994('0x38')]);_0x454a8d['attributes']=_[_0xe994('0x3b')](_0x53dbdf['model'],qs[_0xe994('0x3c')](_0x521af2['query'][_0xe994('0x3c')]));_0x454a8d['attributes']=_0x454a8d['attributes'][_0xe994('0x3d')]?_0x454a8d['attributes']:_0x53dbdf[_0xe994('0x37')];if(!_0x521af2[_0xe994('0x38')][_0xe994('0x3e')](_0xe994('0x3f'))){_0x454a8d[_0xe994('0x22')]=qs[_0xe994('0x22')](_0x521af2[_0xe994('0x38')]['limit']);_0x454a8d[_0xe994('0x20')]=qs[_0xe994('0x20')](_0x521af2[_0xe994('0x38')][_0xe994('0x20')]);}_0x454a8d[_0xe994('0x40')]=qs[_0xe994('0x41')](_0x521af2[_0xe994('0x38')][_0xe994('0x41')]);_0x454a8d[_0xe994('0x42')]=qs[_0xe994('0x3a')](_['pick'](_0x521af2[_0xe994('0x38')],_0x53dbdf[_0xe994('0x3a')]),_0x4199a1);if(_0x521af2[_0xe994('0x38')][_0xe994('0x43')]){_0x454a8d[_0xe994('0x42')]=_[_0xe994('0x44')](_0x454a8d[_0xe994('0x42')],{'$or':_['map'](_0x4199a1,function(_0x58a1cd){if(_0x58a1cd[_0xe994('0x45')]!=='VIRTUAL'){var _0x41f708={};_0x41f708[_0x58a1cd[_0xe994('0x2f')]]={'$like':'%'+_0x521af2[_0xe994('0x38')][_0xe994('0x43')]+'%'};return _0x41f708;}})});}_0x454a8d=_[_0xe994('0x44')]({},_0x454a8d,_0x521af2[_0xe994('0x46')]);var _0x35942d={'where':_0x454a8d[_0xe994('0x42')]};return db['Dashboard']['count'](_0x35942d)[_0xe994('0x28')](function(_0x21230c){_0x177b28[_0xe994('0x23')]=_0x21230c;if(_0x521af2[_0xe994('0x38')][_0xe994('0x47')]){_0x454a8d[_0xe994('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0xe994('0x49')](_0x454a8d);})[_0xe994('0x28')](function(_0x376d42){_0x177b28['rows']=_0x376d42;return _0x177b28;})[_0xe994('0x28')](respondWithFilteredResult(_0x5ba8ed,_0x454a8d))[_0xe994('0x4a')](handleError(_0x5ba8ed,null));};exports[_0xe994('0x4b')]=function(_0x30e438,_0x43b2f9){var _0x27bfbf={'raw':![],'where':{'id':_0x30e438[_0xe994('0x4c')]['id']}},_0xb338c={};_0xb338c[_0xe994('0x37')]=_[_0xe994('0x39')](db[_0xe994('0x33')][_0xe994('0x34')]);_0xb338c['query']=_[_0xe994('0x39')](_0x30e438[_0xe994('0x38')]);_0xb338c[_0xe994('0x3a')]=_[_0xe994('0x3b')](_0xb338c[_0xe994('0x37')],_0xb338c[_0xe994('0x38')]);_0x27bfbf['attributes']=_['intersection'](_0xb338c[_0xe994('0x37')],qs['fields'](_0x30e438[_0xe994('0x38')][_0xe994('0x3c')]));_0x27bfbf[_0xe994('0x4d')]=_0x27bfbf[_0xe994('0x4d')][_0xe994('0x3d')]?_0x27bfbf[_0xe994('0x4d')]:_0xb338c['model'];if(_0x30e438[_0xe994('0x38')][_0xe994('0x47')]){_0x27bfbf[_0xe994('0x48')]=[{'all':!![]}];}_0x27bfbf=_[_0xe994('0x44')]({},_0x27bfbf,_0x30e438[_0xe994('0x46')]);return db['Dashboard'][_0xe994('0x4e')](_0x27bfbf)[_0xe994('0x28')](handleEntityNotFound(_0x43b2f9,null))[_0xe994('0x28')](respondWithResult(_0x43b2f9,null))[_0xe994('0x4a')](handleError(_0x43b2f9,null));};exports[_0xe994('0x4f')]=function(_0x1be429,_0x892300){return db['Dashboard'][_0xe994('0x4f')](_0x1be429[_0xe994('0x50')],{})[_0xe994('0x28')](function(_0x267a03){var _0x4dc8bf=_0x1be429[_0xe994('0x51')][_0xe994('0x2a')]({'plain':!![]});if(!_0x4dc8bf)throw new Error(_0xe994('0x52'));if(_0x4dc8bf[_0xe994('0x53')]===_0xe994('0x51')){var _0x34b5ea=_0x267a03[_0xe994('0x2a')]({'plain':!![]});var _0x260341=_0xe994('0x2b');return db[_0xe994('0x54')]['find']({'where':{'name':_0x260341,'userProfileId':_0x4dc8bf[_0xe994('0x55')]},'raw':!![]})[_0xe994('0x28')](function(_0xa2fa00){if(_0xa2fa00&&_0xa2fa00['autoAssociation']===0x0){return db[_0xe994('0x2c')][_0xe994('0x4f')]({'name':_0x34b5ea[_0xe994('0x2f')],'resourceId':_0x34b5ea['id'],'type':_0xa2fa00[_0xe994('0x2f')],'sectionId':_0xa2fa00['id']},{})['then'](function(){return _0x267a03;});}else{return _0x267a03;}})['catch'](function(_0x62a8f3){logger['error'](_0xe994('0x56'),_0x62a8f3);throw _0x62a8f3;});}return _0x267a03;})['then'](respondWithResult(_0x892300,0xc9))[_0xe994('0x4a')](handleError(_0x892300,null));};exports[_0xe994('0x57')]=function(_0x24a352,_0x38f27a){var _0x209d3d={'where':{'id':_0x24a352[_0xe994('0x4c')]['id']}},_0x4dd88a={};_0x4dd88a[_0xe994('0x37')]=_[_0xe994('0x39')](db['Dashboard'][_0xe994('0x34')]);_0x209d3d[_0xe994('0x4d')]=_[_0xe994('0x3b')](_0x4dd88a[_0xe994('0x37')],qs[_0xe994('0x3c')](_0x24a352['query'][_0xe994('0x3c')]));_0x209d3d['attributes']=_0x209d3d[_0xe994('0x4d')]['length']?_0x209d3d[_0xe994('0x4d')]:_0x4dd88a[_0xe994('0x37')];if(_0x24a352[_0xe994('0x38')][_0xe994('0x47')]){_0x209d3d[_0xe994('0x48')]=[{'all':!![]}];}_0x209d3d=_[_0xe994('0x44')]({},_0x209d3d,_0x24a352[_0xe994('0x46')]);return db[_0xe994('0x33')][_0xe994('0x4e')](_0x209d3d)[_0xe994('0x28')](handleEntityNotFound(_0x38f27a,null))[_0xe994('0x28')](function(_0x3b8a31){if(_0x3b8a31){var _0x16a689=_0x3b8a31[_0xe994('0x2a')]({'plain':!![]});_0x16a689=qs[_0xe994('0x58')](_0x16a689,['id',_0xe994('0x59'),_0xe994('0x5a')]);_0x24a352[_0xe994('0x50')]=_[_0xe994('0x58')](_0x24a352['body'],['id',_0xe994('0x59'),_0xe994('0x5a')]);return db[_0xe994('0x33')][_0xe994('0x4f')](_['merge'](_0x16a689,_0x24a352[_0xe994('0x50')]),{'include':_0x24a352[_0xe994('0x38')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4f4dac){var _0x5a77fe=_0x24a352[_0xe994('0x51')][_0xe994('0x2a')]({'plain':!![]});if(!_0x5a77fe)throw new Error(_0xe994('0x52'));if(_0x5a77fe[_0xe994('0x53')]==='user'){var _0x154bda=_0x4f4dac['get']({'plain':!![]});var _0x253667=_0xe994('0x2b');return db[_0xe994('0x54')][_0xe994('0x4e')]({'where':{'name':_0x253667,'userProfileId':_0x5a77fe[_0xe994('0x55')]},'raw':!![]})[_0xe994('0x28')](function(_0x1851ee){if(_0x1851ee&&_0x1851ee[_0xe994('0x5b')]===0x0){return db['UserProfileResource'][_0xe994('0x4f')]({'name':_0x154bda['name'],'resourceId':_0x154bda['id'],'type':_0x1851ee[_0xe994('0x2f')],'sectionId':_0x1851ee['id']},{})[_0xe994('0x28')](function(){return _0x4f4dac;});}else{return _0x4f4dac;}})['catch'](function(_0x41d8fd){logger['error'](_0xe994('0x56'),_0x41d8fd);throw _0x41d8fd;});}return _0x4f4dac;});}})[_0xe994('0x28')](respondWithResult(_0x38f27a,0xc9))[_0xe994('0x4a')](handleError(_0x38f27a,null));};exports[_0xe994('0x5c')]=function(_0x5532cf,_0x4a1ecd){if(_0x5532cf[_0xe994('0x50')]['id']){delete _0x5532cf[_0xe994('0x50')]['id'];}return db[_0xe994('0x33')]['find']({'where':{'id':_0x5532cf[_0xe994('0x4c')]['id']}})[_0xe994('0x28')](handleEntityNotFound(_0x4a1ecd,null))[_0xe994('0x28')](saveUpdates(_0x5532cf[_0xe994('0x50')],null))[_0xe994('0x28')](respondWithResult(_0x4a1ecd,null))[_0xe994('0x4a')](handleError(_0x4a1ecd,null));};exports['destroy']=function(_0x2e359c,_0x7e1c5d){return db[_0xe994('0x33')][_0xe994('0x4e')]({'where':{'id':_0x2e359c[_0xe994('0x4c')]['id']}})[_0xe994('0x28')](handleEntityNotFound(_0x7e1c5d,null))[_0xe994('0x28')](removeEntity(_0x7e1c5d,null))[_0xe994('0x4a')](handleError(_0x7e1c5d,null));};function widgetAttributes(_0x2f0908){try{switch(_0x2f0908[_0xe994('0x45')]){case _0xe994('0x5d'):return[{'name':_0xe994('0x5e'),'value':_0x2f0908[_0xe994('0x5e')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x60')]:undefined)||_0xe994('0x61')}];case'custom':return[{'name':_0xe994('0x62'),'value':_0x2f0908[_0xe994('0x62')]||(_0x2f0908['attrs']&&_0x2f0908['attrs'][0x0]?_0x2f0908[_0xe994('0x5f')][0x0]['value']:undefined)||''}];case _0xe994('0x63'):return[{'name':_0xe994('0x64'),'value':_0x2f0908[_0xe994('0x64')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908['attrs'][0x0]?_0x2f0908['attrs'][0x0]['value']:undefined)||_0xe994('0x65')},{'name':_0xe994('0x66'),'value':_0x2f0908[_0xe994('0x66')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x1]?_0x2f0908[_0xe994('0x5f')][0x1][_0xe994('0x60')]:undefined)||_0xe994('0x67')},{'name':_0xe994('0x68'),'value':_0x2f0908[_0xe994('0x68')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x2]?_0x2f0908[_0xe994('0x5f')][0x2][_0xe994('0x60')]:undefined)||0xc}];case _0xe994('0x69'):return[{'name':_0xe994('0x6a'),'value':_0x2f0908[_0xe994('0x6a')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908['attrs'][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x60')]:undefined)||_0xe994('0x6b')},{'name':_0xe994('0x6c'),'value':_0x2f0908[_0xe994('0x6c')]||(_0x2f0908['attrs']&&_0x2f0908[_0xe994('0x5f')][0x1]?_0x2f0908['attrs'][0x1][_0xe994('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x2f0908['attrFontSize']||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x2]?_0x2f0908[_0xe994('0x5f')][0x2][_0xe994('0x60')]:undefined)||0x14}];case _0xe994('0x6d'):case _0xe994('0x6e'):return[{'name':_0xe994('0x6f'),'value':_0x2f0908[_0xe994('0x6f')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x60')]:undefined)||_0xe994('0x6b')},{'name':_0xe994('0x70'),'value':_0x2f0908[_0xe994('0x70')]||(_0x2f0908['attrs']&&_0x2f0908['attrs'][0x1]?_0x2f0908[_0xe994('0x5f')][0x1][_0xe994('0x60')]:undefined)||null},{'name':'attrSerie3','value':_0x2f0908[_0xe994('0x71')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908['attrs'][0x2]?_0x2f0908[_0xe994('0x5f')][0x2]['value']:undefined)||null},{'name':_0xe994('0x6c'),'value':_0x2f0908[_0xe994('0x6c')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x3]?_0x2f0908[_0xe994('0x5f')][0x3][_0xe994('0x60')]:undefined)||[]}];case _0xe994('0x72'):return[{'name':_0xe994('0x73'),'type':_0x2f0908[_0xe994('0x74')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x45')]:undefined)||null,'value':_0x2f0908['attrReport']||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x60')]:undefined)||null},{'name':_0xe994('0x75'),'value':_0x2f0908[_0xe994('0x75')]||(_0x2f0908['attrs']&&_0x2f0908[_0xe994('0x5f')][0x1]?_0x2f0908[_0xe994('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x526971){logger[_0xe994('0x2e')]('widgetAttributes:\x20%s',JSON[_0xe994('0x76')](_0x526971));return[];}}exports[_0xe994('0x77')]=function(_0x4568a1,_0x935f18,_0x2c95e9){if(_0x4568a1[_0xe994('0x50')]['id']){delete _0x4568a1['body']['id'];}return db[_0xe994('0x33')][_0xe994('0x4e')]({'where':{'id':_0x4568a1[_0xe994('0x4c')]['id']}})[_0xe994('0x28')](handleEntityNotFound(_0x935f18,null))[_0xe994('0x28')](function(_0x33947b){if(_0x33947b){_0x4568a1[_0xe994('0x50')][_0xe994('0x78')]=_0x33947b['id'];_0x4568a1[_0xe994('0x50')][_0xe994('0x5f')]=widgetAttributes(_0x4568a1[_0xe994('0x50')]);return db['DashboardItem'][_0xe994('0x4f')](_0x4568a1[_0xe994('0x50')]);}})[_0xe994('0x28')](respondWithResult(_0x935f18,null))[_0xe994('0x4a')](handleError(_0x935f18,null));};exports['getItems']=function(_0x189480,_0x558892,_0x54b5b5){var _0x2c3468={};var _0x419089={};var _0x1c54db;var _0x5441b6;return db[_0xe994('0x33')]['findOne']({'where':{'id':_0x189480[_0xe994('0x4c')]['id']}})['then'](handleEntityNotFound(_0x558892,null))[_0xe994('0x28')](function(_0x47ca55){if(_0x47ca55){_0x1c54db=_0x47ca55;_0x419089[_0xe994('0x37')]=_[_0xe994('0x39')](db[_0xe994('0x79')]['rawAttributes']);_0x419089['query']=_[_0xe994('0x39')](_0x189480['query']);_0x419089[_0xe994('0x3a')]=_[_0xe994('0x3b')](_0x419089[_0xe994('0x37')],_0x419089[_0xe994('0x38')]);_0x2c3468[_0xe994('0x4d')]=_[_0xe994('0x3b')](_0x419089[_0xe994('0x37')],qs['fields'](_0x189480[_0xe994('0x38')][_0xe994('0x3c')]));_0x2c3468[_0xe994('0x4d')]=_0x2c3468[_0xe994('0x4d')][_0xe994('0x3d')]?_0x2c3468['attributes']:_0x419089[_0xe994('0x37')];_0x2c3468[_0xe994('0x40')]=qs[_0xe994('0x41')](_0x189480['query'][_0xe994('0x41')]);_0x2c3468[_0xe994('0x42')]=qs[_0xe994('0x3a')](_[_0xe994('0x7a')](_0x189480['query'],_0x419089[_0xe994('0x3a')]));if(_0x189480['query'][_0xe994('0x43')]){_0x2c3468[_0xe994('0x42')]=_[_0xe994('0x44')](_0x2c3468[_0xe994('0x42')],{'$or':_[_0xe994('0x32')](_0x2c3468[_0xe994('0x4d')],function(_0xce0245){var _0x4a636e={};_0x4a636e[_0xce0245]={'$like':'%'+_0x189480[_0xe994('0x38')][_0xe994('0x43')]+'%'};return _0x4a636e;})});}_0x2c3468=_[_0xe994('0x44')]({},_0x2c3468,_0x189480[_0xe994('0x46')]);return _0x1c54db['getItems'](_0x2c3468);}})['then'](function(_0x3067a6){if(_0x3067a6){_0x5441b6=_0x3067a6[_0xe994('0x3d')];if(!_0x189480[_0xe994('0x38')]['hasOwnProperty'](_0xe994('0x3f'))){_0x2c3468['limit']=qs[_0xe994('0x22')](_0x189480[_0xe994('0x38')][_0xe994('0x22')]);_0x2c3468['offset']=qs[_0xe994('0x20')](_0x189480[_0xe994('0x38')]['offset']);}return _0x1c54db[_0xe994('0x7b')](_0x2c3468);}})['then'](function(_0x4bb6e7){if(_0x4bb6e7){return _0x4bb6e7?{'count':_0x5441b6,'rows':_0x4bb6e7}:null;}})[_0xe994('0x28')](respondWithResult(_0x558892,null))[_0xe994('0x4a')](handleError(_0x558892,null));};
\ No newline at end of file
index dcccdfc..972b2c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17d8=['remove','emit','hook','exports','events','Dashboard','save'];(function(_0x20744f,_0x4120a7){var _0x178bf5=function(_0x129c91){while(--_0x129c91){_0x20744f['push'](_0x20744f['shift']());}};_0x178bf5(++_0x4120a7);}(_0x17d8,0xac));var _0x817d=function(_0x7fbacc,_0x3da0a6){_0x7fbacc=_0x7fbacc-0x0;var _0x31ca68=_0x17d8[_0x7fbacc];return _0x31ca68;};'use strict';var EventEmitter=require(_0x817d('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x817d('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x817d('0x2'),'afterUpdate':'update','afterDestroy':_0x817d('0x3')};function emitEvent(_0xb72c51){return function(_0x520be1,_0x463d68,_0x4bc86f){DashboardEvents[_0x817d('0x4')](_0xb72c51+':'+_0x520be1['id'],_0x520be1);DashboardEvents[_0x817d('0x4')](_0xb72c51,_0x520be1);_0x4bc86f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x817d('0x5')](e,emitEvent(event));}}module[_0x817d('0x6')]=DashboardEvents;
\ No newline at end of file
+var _0x5ebc=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x3ae7ba,_0x10b3ec){var _0x14a974=function(_0x477da0){while(--_0x477da0){_0x3ae7ba['push'](_0x3ae7ba['shift']());}};_0x14a974(++_0x10b3ec);}(_0x5ebc,0x103));var _0xc5eb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5ebc[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xc5eb('0x0'))['db'][_0xc5eb('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc5eb('0x2')](0x0);var events={'afterCreate':_0xc5eb('0x3'),'afterUpdate':_0xc5eb('0x4'),'afterDestroy':_0xc5eb('0x5')};function emitEvent(_0x51701b){return function(_0x1927cb,_0x31ca64,_0x5b8921){DashboardEvents[_0xc5eb('0x6')](_0x51701b+':'+_0x1927cb['id'],_0x1927cb);DashboardEvents[_0xc5eb('0x6')](_0x51701b,_0x1927cb);_0x5b8921(null);};}for(var e in events){if(events[_0xc5eb('0x7')](e)){var event=events[e];Dashboard[_0xc5eb('0x8')](e,emitEvent(event));}}module[_0xc5eb('0x9')]=DashboardEvents;
\ No newline at end of file
index 35c772e..043d5a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1834=['exports','define','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./dashboard.attributes'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x1834,0xf3));var _0x4183=function(_0x560b56,_0x2004b9){_0x560b56=_0x560b56-0x0;var _0x173c4e=_0x1834[_0x560b56];return _0x173c4e;};'use strict';var _=require(_0x4183('0x0'));var util=require(_0x4183('0x1'));var logger=require(_0x4183('0x2'))(_0x4183('0x3'));var moment=require(_0x4183('0x4'));var BPromise=require(_0x4183('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4183('0x6'));var rimraf=require(_0x4183('0x7'));var config=require('../../config/environment');var attributes=require(_0x4183('0x8'));module[_0x4183('0x9')]=function(_0x5104aa,_0x10dac6){return _0x5104aa[_0x4183('0xa')](_0x4183('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x59fe=['../../config/environment','./dashboard.attributes','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x59fe,0x146));var _0xe59f=function(_0x435cc5,_0x3f4545){_0x435cc5=_0x435cc5-0x0;var _0xfff27=_0x59fe[_0x435cc5];return _0xfff27;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe59f('0x0'))(_0xe59f('0x1'));var moment=require(_0xe59f('0x2'));var BPromise=require(_0xe59f('0x3'));var rp=require(_0xe59f('0x4'));var fs=require('fs');var path=require(_0xe59f('0x5'));var rimraf=require(_0xe59f('0x6'));var config=require(_0xe59f('0x7'));var attributes=require(_0xe59f('0x8'));module['exports']=function(_0x281442,_0x2484bb){return _0x281442['define']('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5e4ed52..15a0aec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5394=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','info','Dashboard,\x20%s,\x20%s'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x5394,0x134));var _0x4539=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0x5394[_0x5f6a8a];return _0x2cce4d;};'use strict';var _=require(_0x4539('0x0'));var util=require(_0x4539('0x1'));var moment=require('moment');var BPromise=require(_0x4539('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4539('0x3'));var db=require(_0x4539('0x4'))['db'];var utils=require(_0x4539('0x5'));var logger=require('../../config/logger')(_0x4539('0x6'));var config=require(_0x4539('0x7'));var jayson=require(_0x4539('0x8'));var client=jayson['client'][_0x4539('0x9')]({'port':0x232a});config[_0x4539('0xa')]=_['defaults'](config['redis'],{'host':_0x4539('0xb'),'port':0x18eb});var socket=require(_0x4539('0xc'))(new Redis(config[_0x4539('0xa')]));require(_0x4539('0xd'))[_0x4539('0xe')](socket);function respondWithRpcPromise(_0x1ccb92,_0x361e81,_0x36624d){return new BPromise(function(_0x588540,_0x51a947){return client['request'](_0x1ccb92,_0x36624d)['then'](function(_0x19c47a){logger[_0x4539('0xf')](_0x4539('0x10'),_0x361e81,_0x4539('0x11'));logger[_0x4539('0x12')](_0x4539('0x13'),_0x361e81,_0x4539('0x11'),JSON['stringify'](_0x19c47a));if(_0x19c47a[_0x4539('0x14')]){if(_0x19c47a[_0x4539('0x14')][_0x4539('0x15')]===0x1f4){logger[_0x4539('0x14')](_0x4539('0x10'),_0x361e81,_0x19c47a[_0x4539('0x14')]['message']);return _0x51a947(_0x19c47a[_0x4539('0x14')][_0x4539('0x16')]);}logger[_0x4539('0x14')](_0x4539('0x10'),_0x361e81,_0x19c47a[_0x4539('0x14')][_0x4539('0x16')]);return _0x588540(_0x19c47a[_0x4539('0x14')][_0x4539('0x16')]);}else{logger[_0x4539('0xf')](_0x4539('0x10'),_0x361e81,_0x4539('0x11'));_0x588540(_0x19c47a[_0x4539('0x17')][_0x4539('0x16')]);}})[_0x4539('0x18')](function(_0x1f4d30){logger[_0x4539('0x14')](_0x4539('0x10'),_0x361e81,_0x1f4d30);_0x51a947(_0x1f4d30);});});}
\ No newline at end of file
+var _0x2225=['register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket'];(function(_0x37d959,_0xf56089){var _0x5c5d77=function(_0x2e5083){while(--_0x2e5083){_0x37d959['push'](_0x37d959['shift']());}};_0x5c5d77(++_0xf56089);}(_0x2225,0x150));var _0x5222=function(_0x4dfbb7,_0x1b608d){_0x4dfbb7=_0x4dfbb7-0x0;var _0x23e02e=_0x2225[_0x4dfbb7];return _0x23e02e;};'use strict';var _=require('lodash');var util=require(_0x5222('0x0'));var moment=require(_0x5222('0x1'));var BPromise=require(_0x5222('0x2'));var rs=require(_0x5222('0x3'));var fs=require('fs');var Redis=require(_0x5222('0x4'));var db=require(_0x5222('0x5'))['db'];var utils=require(_0x5222('0x6'));var logger=require(_0x5222('0x7'))(_0x5222('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5222('0x9')]['http']({'port':0x232a});config[_0x5222('0xa')]=_[_0x5222('0xb')](config[_0x5222('0xa')],{'host':_0x5222('0xc'),'port':0x18eb});var socket=require(_0x5222('0xd'))(new Redis(config[_0x5222('0xa')]));require(_0x5222('0xe'))[_0x5222('0xf')](socket);function respondWithRpcPromise(_0x59130f,_0x5bc598,_0x1cf282){return new BPromise(function(_0x4e36da,_0x2b19da){return client[_0x5222('0x10')](_0x59130f,_0x1cf282)[_0x5222('0x11')](function(_0x2eb3a0){logger['info'](_0x5222('0x12'),_0x5bc598,_0x5222('0x13'));logger['debug'](_0x5222('0x14'),_0x5bc598,'request\x20sent',JSON[_0x5222('0x15')](_0x2eb3a0));if(_0x2eb3a0[_0x5222('0x16')]){if(_0x2eb3a0['error'][_0x5222('0x17')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x5bc598,_0x2eb3a0[_0x5222('0x16')]['message']);return _0x2b19da(_0x2eb3a0['error']['message']);}logger[_0x5222('0x16')](_0x5222('0x12'),_0x5bc598,_0x2eb3a0[_0x5222('0x16')][_0x5222('0x18')]);return _0x4e36da(_0x2eb3a0[_0x5222('0x16')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x5bc598,_0x5222('0x13'));_0x4e36da(_0x2eb3a0[_0x5222('0x19')][_0x5222('0x18')]);}})[_0x5222('0x1a')](function(_0x581ea5){logger[_0x5222('0x16')](_0x5222('0x12'),_0x5bc598,_0x581ea5);_0x2b19da(_0x581ea5);});});}
\ No newline at end of file
index e54d714..e9cf5b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x000e=['emit','removeListener','length','./dashboard.events','remove','update'];(function(_0x3a290f,_0x2bb3f0){var _0x50c8f8=function(_0x153b59){while(--_0x153b59){_0x3a290f['push'](_0x3a290f['shift']());}};_0x50c8f8(++_0x2bb3f0);}(_0x000e,0xb1));var _0xe000=function(_0x4b14a5,_0x1800d7){_0x4b14a5=_0x4b14a5-0x0;var _0x48d745=_0x000e[_0x4b14a5];return _0x48d745;};'use strict';var DashboardEvents=require(_0xe000('0x0'));var events=['save',_0xe000('0x1'),_0xe000('0x2')];function createListener(_0x5a7074,_0x200945){return function(_0x271e1d){_0x200945[_0xe000('0x3')](_0x5a7074,_0x271e1d);};}function removeListener(_0x3f8a76,_0x6ac0ce){return function(){DashboardEvents[_0xe000('0x4')](_0x3f8a76,_0x6ac0ce);};}exports['register']=function(_0x1ed071){for(var _0x1099f2=0x0,_0x467176=events[_0xe000('0x5')];_0x1099f2<_0x467176;_0x1099f2++){var _0x594a6e=events[_0x1099f2];var _0x194e38=createListener('dashboard:'+_0x594a6e,_0x1ed071);DashboardEvents['on'](_0x594a6e,_0x194e38);}};
\ No newline at end of file
+var _0x8594=['update','emit','register','dashboard:','save'];(function(_0x15f77a,_0x461593){var _0x12dffc=function(_0x15c64f){while(--_0x15c64f){_0x15f77a['push'](_0x15f77a['shift']());}};_0x12dffc(++_0x461593);}(_0x8594,0x121));var _0x4859=function(_0x38b813,_0x555fb4){_0x38b813=_0x38b813-0x0;var _0x48ee04=_0x8594[_0x38b813];return _0x48ee04;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x4859('0x0'),'remove',_0x4859('0x1')];function createListener(_0x45d11b,_0x53854f){return function(_0x471b30){_0x53854f[_0x4859('0x2')](_0x45d11b,_0x471b30);};}function removeListener(_0x55dcaa,_0x476bdc){return function(){DashboardEvents['removeListener'](_0x55dcaa,_0x476bdc);};}exports[_0x4859('0x3')]=function(_0x45c5fa){for(var _0x1e347f=0x0,_0x4bc585=events['length'];_0x1e347f<_0x4bc585;_0x1e347f++){var _0xf79d25=events[_0x1e347f];var _0x1cd01a=createListener(_0x4859('0x4')+_0xf79d25,_0x45c5fa);DashboardEvents['on'](_0xf79d25,_0x1cd01a);}};
\ No newline at end of file
index 4a4664e..b9c9408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5aa=['./dashboard.controller','index','get','/:id','isAuthenticated','show','/:id/items','getItems','post','/:id/clone','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x590381,_0x5c3948){var _0xe300df=function(_0x148e67){while(--_0x148e67){_0x590381['push'](_0x590381['shift']());}};_0xe300df(++_0x5c3948);}(_0xe5aa,0x1dc));var _0xae5a=function(_0x5770b2,_0x5cea41){_0x5770b2=_0x5770b2-0x0;var _0x455ed2=_0xe5aa[_0x5770b2];return _0x455ed2;};'use strict';var multer=require(_0xae5a('0x0'));var util=require(_0xae5a('0x1'));var path=require(_0xae5a('0x2'));var timeout=require(_0xae5a('0x3'));var express=require(_0xae5a('0x4'));var router=express[_0xae5a('0x5')]();var fs_extra=require(_0xae5a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xae5a('0x7'));var controller=require(_0xae5a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xae5a('0x9')]);router[_0xae5a('0xa')](_0xae5a('0xb'),auth[_0xae5a('0xc')](),controller[_0xae5a('0xd')]);router[_0xae5a('0xa')](_0xae5a('0xe'),auth[_0xae5a('0xc')](),controller[_0xae5a('0xf')]);router[_0xae5a('0x10')]('/',auth[_0xae5a('0xc')](),controller['create']);router[_0xae5a('0x10')](_0xae5a('0x11'),auth['isAuthenticated'](),controller['clone']);router['post'](_0xae5a('0xe'),auth[_0xae5a('0xc')](),controller['addItem']);router['put'](_0xae5a('0xb'),auth[_0xae5a('0xc')](),controller[_0xae5a('0x12')]);router[_0xae5a('0x13')](_0xae5a('0xb'),auth[_0xae5a('0xc')](),controller[_0xae5a('0x14')]);module[_0xae5a('0x15')]=router;
\ No newline at end of file
+var _0xa7cb=['/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','index'];(function(_0x8d3262,_0x439e73){var _0x45561c=function(_0x36581f){while(--_0x36581f){_0x8d3262['push'](_0x8d3262['shift']());}};_0x45561c(++_0x439e73);}(_0xa7cb,0x1ae));var _0xba7c=function(_0xb68772,_0x5253ac){_0xb68772=_0xb68772-0x0;var _0x4189bb=_0xa7cb[_0xb68772];return _0x4189bb;};'use strict';var multer=require(_0xba7c('0x0'));var util=require(_0xba7c('0x1'));var path=require(_0xba7c('0x2'));var timeout=require(_0xba7c('0x3'));var express=require(_0xba7c('0x4'));var router=express[_0xba7c('0x5')]();var fs_extra=require(_0xba7c('0x6'));var auth=require(_0xba7c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xba7c('0x8'));var controller=require(_0xba7c('0x9'));router[_0xba7c('0xa')]('/',auth['isAuthenticated'](),controller[_0xba7c('0xb')]);router[_0xba7c('0xa')](_0xba7c('0xc'),auth[_0xba7c('0xd')](),controller[_0xba7c('0xe')]);router['get'](_0xba7c('0xf'),auth[_0xba7c('0xd')](),controller[_0xba7c('0x10')]);router[_0xba7c('0x11')]('/',auth[_0xba7c('0xd')](),controller[_0xba7c('0x12')]);router[_0xba7c('0x11')](_0xba7c('0x13'),auth[_0xba7c('0xd')](),controller[_0xba7c('0x14')]);router[_0xba7c('0x11')](_0xba7c('0xf'),auth[_0xba7c('0xd')](),controller[_0xba7c('0x15')]);router[_0xba7c('0x16')](_0xba7c('0xc'),auth[_0xba7c('0xd')](),controller[_0xba7c('0x17')]);router[_0xba7c('0x18')](_0xba7c('0xc'),auth[_0xba7c('0xd')](),controller['destroy']);module[_0xba7c('0x19')]=router;
\ No newline at end of file
index 9a23747..305d4b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x3e2725,_0x29b27a){var _0x4f7b51=function(_0x3ab204){while(--_0x3ab204){_0x3e2725['push'](_0x3e2725['shift']());}};_0x4f7b51(++_0x29b27a);}(_0x4975,0x86));var _0x5497=function(_0x58b9be,_0x18a673){_0x58b9be=_0x58b9be-0x0;var _0x26bd2c=_0x4975[_0x58b9be];return _0x26bd2c;};'use strict';var Sequelize=require(_0x5497('0x0'));var squel=require('squel');var _=require(_0x5497('0x1'));module[_0x5497('0x2')]={'title':{'type':Sequelize[_0x5497('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5497('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5497('0x4')](_0x5497('0x5')),'get':function(){try{return JSON[_0x5497('0x6')](this[_0x5497('0x7')](_0x5497('0x8')));}catch(_0x5d5272){return[];}},'set':function(_0x539a27){try{this[_0x5497('0x9')]('attrs',JSON[_0x5497('0xa')](_0x539a27));}catch(_0x674a2a){this[_0x5497('0x9')]('attrs',JSON[_0x5497('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5497('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5497('0xb')]},'col':{'type':Sequelize[_0x5497('0xb')]},'background':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5497('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x1809a3,_0x157c89){var _0x344547=function(_0x51e6eb){while(--_0x51e6eb){_0x1809a3['push'](_0x1809a3['shift']());}};_0x344547(++_0x157c89);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2e686b,_0x1cc985){_0x2e686b=_0x2e686b-0x0;var _0x156e75=_0xc1c6[_0x2e686b];return _0x156e75;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}};
\ No newline at end of file
index c4819df..b54d1ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeda=['end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','DashboardItem','catch','find','type','iframe','attrUrl','attrs','https://','custom','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status'];(function(_0xf1685c,_0x20adca){var _0x286af2=function(_0x3b6dde){while(--_0x3b6dde){_0xf1685c['push'](_0xf1685c['shift']());}};_0x286af2(++_0x20adca);}(_0xaeda,0x1b4));var _0xaaed=function(_0x4eafdd,_0x82a429){_0x4eafdd=_0x4eafdd-0x0;var _0x20bc43=_0xaeda[_0x4eafdd];return _0x20bc43;};'use strict';var emlformat=require(_0xaaed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaaed('0x1'));var rp=require(_0xaaed('0x2'));var moment=require(_0xaaed('0x3'));var BPromise=require(_0xaaed('0x4'));var Mustache=require(_0xaaed('0x5'));var util=require('util');var path=require(_0xaaed('0x6'));var sox=require(_0xaaed('0x7'));var csv=require(_0xaaed('0x8'));var ejs=require(_0xaaed('0x9'));var fs=require('fs');var fs_extra=require(_0xaaed('0xa'));var _=require(_0xaaed('0xb'));var squel=require(_0xaaed('0xc'));var crypto=require(_0xaaed('0xd'));var jsforce=require(_0xaaed('0xe'));var deskjs=require(_0xaaed('0xf'));var toCsv=require(_0xaaed('0x8'));var querystring=require('querystring');var Papa=require(_0xaaed('0x10'));var Redis=require(_0xaaed('0x11'));var authService=require(_0xaaed('0x12'));var qs=require(_0xaaed('0x13'));var as=require(_0xaaed('0x14'));var hardwareService=require(_0xaaed('0x15'));var logger=require('../../config/logger')(_0xaaed('0x16'));var utils=require(_0xaaed('0x17'));var config=require(_0xaaed('0x18'));var licenseUtil=require(_0xaaed('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xaaed('0x1a')](config[_0xaaed('0x1b')],{'host':_0xaaed('0x1c'),'port':0x18eb});var socket=require(_0xaaed('0x1d'))(new Redis(config[_0xaaed('0x1b')]));require(_0xaaed('0x1e'))[_0xaaed('0x1f')](socket);function respondWithStatusCode(_0x108fd8,_0x22703e){_0x22703e=_0x22703e||0xcc;return function(_0x4c9550){if(_0x4c9550){return _0x108fd8[_0xaaed('0x20')](_0x22703e);}return _0x108fd8[_0xaaed('0x21')](_0x22703e)[_0xaaed('0x22')]();};}function respondWithResult(_0x5ef559,_0x448d82){_0x448d82=_0x448d82||0xc8;return function(_0x243eed){if(_0x243eed){return _0x5ef559[_0xaaed('0x21')](_0x448d82)['json'](_0x243eed);}};}function respondWithFilteredResult(_0x10efa9,_0x292fb1){return function(_0x525c53){if(_0x525c53){var _0x4bdb29=typeof _0x292fb1[_0xaaed('0x23')]===_0xaaed('0x24')&&typeof _0x292fb1[_0xaaed('0x25')]===_0xaaed('0x24');var _0x8b2db6=_0x525c53[_0xaaed('0x26')];var _0x266916=_0x4bdb29?0x0:_0x292fb1[_0xaaed('0x23')];var _0x1f6683=_0x4bdb29?_0x525c53['count']:_0x292fb1[_0xaaed('0x23')]+_0x292fb1[_0xaaed('0x25')];var _0x59c4e0;if(_0x1f6683>=_0x8b2db6){_0x1f6683=_0x8b2db6;_0x59c4e0=0xc8;}else{_0x59c4e0=0xce;}_0x10efa9[_0xaaed('0x21')](_0x59c4e0);return _0x10efa9[_0xaaed('0x27')]('Content-Range',_0x266916+'-'+_0x1f6683+'/'+_0x8b2db6)[_0xaaed('0x28')](_0x525c53);}return null;};}function patchUpdates(_0x4790e8){return function(_0x112593){try{jsonpatch[_0xaaed('0x29')](_0x112593,_0x4790e8,!![]);}catch(_0x10ac9a){return BPromise[_0xaaed('0x2a')](_0x10ac9a);}return _0x112593[_0xaaed('0x2b')]();};}function saveUpdates(_0x5dd522,_0x1756a0){return function(_0x55d623){if(_0x55d623){return _0x55d623[_0xaaed('0x2c')](_0x5dd522)[_0xaaed('0x2d')](function(_0x5c1dc7){return _0x5c1dc7;});}return null;};}function removeEntity(_0x482046,_0x5efe28){return function(_0x274146){if(_0x274146){return _0x274146[_0xaaed('0x2e')]()[_0xaaed('0x2d')](function(){_0x482046['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b8dbc,_0x45511c){return function(_0x3113ad){if(!_0x3113ad){_0x4b8dbc[_0xaaed('0x20')](0x194);}return _0x3113ad;};}function handleError(_0x5d6ee2,_0x2ab2dc){_0x2ab2dc=_0x2ab2dc||0x1f4;return function(_0x2b8146){logger[_0xaaed('0x2f')](_0x2b8146[_0xaaed('0x30')]);if(_0x2b8146['name']){delete _0x2b8146['name'];}_0x5d6ee2[_0xaaed('0x21')](_0x2ab2dc)[_0xaaed('0x31')](_0x2b8146);};}exports[_0xaaed('0x32')]=function(_0x3beeb3,_0x1e159d){var _0xfb6006={'raw':![],'where':{'id':_0x3beeb3[_0xaaed('0x33')]['id']}},_0x32d3c9={};_0x32d3c9[_0xaaed('0x34')]=_[_0xaaed('0x35')](db['DashboardItem'][_0xaaed('0x36')]);_0x32d3c9[_0xaaed('0x37')]=_[_0xaaed('0x35')](_0x3beeb3[_0xaaed('0x37')]);_0x32d3c9[_0xaaed('0x38')]=_[_0xaaed('0x39')](_0x32d3c9[_0xaaed('0x34')],_0x32d3c9[_0xaaed('0x37')]);_0xfb6006[_0xaaed('0x3a')]=_[_0xaaed('0x39')](_0x32d3c9[_0xaaed('0x34')],qs[_0xaaed('0x3b')](_0x3beeb3[_0xaaed('0x37')]['fields']));_0xfb6006[_0xaaed('0x3a')]=_0xfb6006[_0xaaed('0x3a')][_0xaaed('0x3c')]?_0xfb6006[_0xaaed('0x3a')]:_0x32d3c9['model'];if(_0x3beeb3[_0xaaed('0x37')][_0xaaed('0x3d')]){_0xfb6006[_0xaaed('0x3e')]=[{'all':!![]}];}_0xfb6006=_[_0xaaed('0x3f')]({},_0xfb6006,_0x3beeb3['options']);return db[_0xaaed('0x40')]['find'](_0xfb6006)['then'](handleEntityNotFound(_0x1e159d,null))[_0xaaed('0x2d')](respondWithResult(_0x1e159d,null))[_0xaaed('0x41')](handleError(_0x1e159d,null));};exports[_0xaaed('0x2e')]=function(_0x3f4095,_0x31a9ed){return db[_0xaaed('0x40')][_0xaaed('0x42')]({'where':{'id':_0x3f4095[_0xaaed('0x33')]['id']}})[_0xaaed('0x2d')](handleEntityNotFound(_0x31a9ed,null))[_0xaaed('0x2d')](removeEntity(_0x31a9ed,null))['catch'](handleError(_0x31a9ed,null));};function widgetAttributes(_0x2f71fa){try{switch(_0x2f71fa[_0xaaed('0x43')]){case _0xaaed('0x44'):return[{'name':_0xaaed('0x45'),'value':_0x2f71fa[_0xaaed('0x45')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa['attrs'][0x0]?_0x2f71fa[_0xaaed('0x46')][0x0]['value']:undefined)||_0xaaed('0x47')}];case _0xaaed('0x48'):return[{'name':'attrPath','value':_0x2f71fa['attrPath']||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa[_0xaaed('0x46')][0x0]?_0x2f71fa[_0xaaed('0x46')][0x0][_0xaaed('0x49')]:undefined)||''}];case _0xaaed('0x4a'):return[{'name':_0xaaed('0x4b'),'value':_0x2f71fa[_0xaaed('0x4b')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa[_0xaaed('0x46')][0x0]?_0x2f71fa[_0xaaed('0x46')][0x0][_0xaaed('0x49')]:undefined)||_0xaaed('0x4c')},{'name':_0xaaed('0x4d'),'value':_0x2f71fa[_0xaaed('0x4d')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa[_0xaaed('0x46')][0x1]?_0x2f71fa[_0xaaed('0x46')][0x1][_0xaaed('0x49')]:undefined)||_0xaaed('0x4e')},{'name':_0xaaed('0x4f'),'value':_0x2f71fa[_0xaaed('0x4f')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa['attrs'][0x2]?_0x2f71fa[_0xaaed('0x46')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x2f71fa['attrMetric']||(_0x2f71fa['attrs']&&_0x2f71fa[_0xaaed('0x46')][0x0]?_0x2f71fa['attrs'][0x0]['value']:undefined)||_0xaaed('0x50')},{'name':_0xaaed('0x51'),'value':_0x2f71fa[_0xaaed('0x51')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa['attrs'][0x1]?_0x2f71fa[_0xaaed('0x46')][0x1][_0xaaed('0x49')]:undefined)||[]},{'name':_0xaaed('0x4f'),'value':_0x2f71fa[_0xaaed('0x4f')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa['attrs'][0x2]?_0x2f71fa[_0xaaed('0x46')][0x2][_0xaaed('0x49')]:undefined)||0x14}];case _0xaaed('0x52'):case _0xaaed('0x53'):return[{'name':'attrSerie1','value':_0x2f71fa[_0xaaed('0x54')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa[_0xaaed('0x46')][0x0]?_0x2f71fa[_0xaaed('0x46')][0x0][_0xaaed('0x49')]:undefined)||'total'},{'name':_0xaaed('0x55'),'value':_0x2f71fa[_0xaaed('0x55')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa[_0xaaed('0x46')][0x1]?_0x2f71fa['attrs'][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x2f71fa[_0xaaed('0x56')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa[_0xaaed('0x46')][0x2]?_0x2f71fa['attrs'][0x2][_0xaaed('0x49')]:undefined)||null},{'name':_0xaaed('0x51'),'value':_0x2f71fa[_0xaaed('0x51')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa[_0xaaed('0x46')][0x3]?_0x2f71fa[_0xaaed('0x46')][0x3]['value']:undefined)||[]}];case _0xaaed('0x57'):return[{'name':_0xaaed('0x58'),'type':_0x2f71fa['reportType']||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa[_0xaaed('0x46')][0x0]?_0x2f71fa[_0xaaed('0x46')][0x0]['type']:undefined)||null,'value':_0x2f71fa[_0xaaed('0x58')]||(_0x2f71fa['attrs']&&_0x2f71fa[_0xaaed('0x46')][0x0]?_0x2f71fa[_0xaaed('0x46')][0x0][_0xaaed('0x49')]:undefined)||null},{'name':_0xaaed('0x59'),'value':_0x2f71fa[_0xaaed('0x59')]||(_0x2f71fa[_0xaaed('0x46')]&&_0x2f71fa['attrs'][0x1]?_0x2f71fa[_0xaaed('0x46')][0x1][_0xaaed('0x49')]:undefined)||0x0}];default:return[];}}catch(_0x15170c){logger[_0xaaed('0x2f')](_0xaaed('0x5a'),JSON[_0xaaed('0x5b')](_0x15170c));return[];}}exports['create']=function(_0x3a84c8,_0x2fb3e0){if(_0x3a84c8['body']){_0x3a84c8[_0xaaed('0x5c')][_0xaaed('0x46')]=widgetAttributes(_0x3a84c8[_0xaaed('0x5c')]);}return db['DashboardItem'][_0xaaed('0x5d')](_0x3a84c8[_0xaaed('0x5c')],{})[_0xaaed('0x2d')](respondWithResult(_0x2fb3e0,0xc9))[_0xaaed('0x41')](handleError(_0x2fb3e0,null));};exports[_0xaaed('0x2c')]=function(_0x216ef0,_0x963302){if(_0x216ef0[_0xaaed('0x5c')]['id']){delete _0x216ef0[_0xaaed('0x5c')]['id'];}_0x216ef0['body']['attrs']=widgetAttributes(_0x216ef0[_0xaaed('0x5c')]);return db[_0xaaed('0x40')]['find']({'where':{'id':_0x216ef0[_0xaaed('0x33')]['id']}})[_0xaaed('0x2d')](handleEntityNotFound(_0x963302,null))[_0xaaed('0x2d')](saveUpdates(_0x216ef0[_0xaaed('0x5c')],null))[_0xaaed('0x2d')](respondWithResult(_0x963302,null))[_0xaaed('0x41')](handleError(_0x963302,null));};
\ No newline at end of file
+var _0xd3b4=['attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','model','keys','DashboardItem','rawAttributes','filters','query','attributes','intersection','fields','includeAll','include','merge','options','find','catch','params','iframe','attrUrl','attrs','value','custom'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0x308108,_0x490636){_0x308108=_0x308108-0x0;var _0x33e77c=_0xd3b4[_0x308108];return _0x33e77c;};'use strict';var emlformat=require(_0x4d3b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4d3b('0x1'));var rp=require(_0x4d3b('0x2'));var moment=require(_0x4d3b('0x3'));var BPromise=require(_0x4d3b('0x4'));var Mustache=require('mustache');var util=require(_0x4d3b('0x5'));var path=require('path');var sox=require(_0x4d3b('0x6'));var csv=require(_0x4d3b('0x7'));var ejs=require(_0x4d3b('0x8'));var fs=require('fs');var fs_extra=require(_0x4d3b('0x9'));var _=require(_0x4d3b('0xa'));var squel=require(_0x4d3b('0xb'));var crypto=require(_0x4d3b('0xc'));var jsforce=require(_0x4d3b('0xd'));var deskjs=require(_0x4d3b('0xe'));var toCsv=require(_0x4d3b('0x7'));var querystring=require('querystring');var Papa=require(_0x4d3b('0xf'));var Redis=require('ioredis');var authService=require(_0x4d3b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4d3b('0x11'));var hardwareService=require(_0x4d3b('0x12'));var logger=require(_0x4d3b('0x13'))(_0x4d3b('0x14'));var utils=require(_0x4d3b('0x15'));var config=require(_0x4d3b('0x16'));var licenseUtil=require(_0x4d3b('0x17'));var db=require(_0x4d3b('0x18'))['db'];config[_0x4d3b('0x19')]=_[_0x4d3b('0x1a')](config[_0x4d3b('0x19')],{'host':_0x4d3b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d3b('0x19')]));require(_0x4d3b('0x1c'))[_0x4d3b('0x1d')](socket);function respondWithStatusCode(_0x156e79,_0x38fba9){_0x38fba9=_0x38fba9||0xcc;return function(_0x16d34b){if(_0x16d34b){return _0x156e79[_0x4d3b('0x1e')](_0x38fba9);}return _0x156e79[_0x4d3b('0x1f')](_0x38fba9)[_0x4d3b('0x20')]();};}function respondWithResult(_0x43a9a2,_0x531d57){_0x531d57=_0x531d57||0xc8;return function(_0xfbb52a){if(_0xfbb52a){return _0x43a9a2['status'](_0x531d57)[_0x4d3b('0x21')](_0xfbb52a);}};}function respondWithFilteredResult(_0x37c854,_0x15cc17){return function(_0x408b9b){if(_0x408b9b){var _0x4f5ac6=typeof _0x15cc17[_0x4d3b('0x22')]===_0x4d3b('0x23')&&typeof _0x15cc17[_0x4d3b('0x24')]===_0x4d3b('0x23');var _0x1fe7f5=_0x408b9b[_0x4d3b('0x25')];var _0x3a409c=_0x4f5ac6?0x0:_0x15cc17[_0x4d3b('0x22')];var _0x4f0e27=_0x4f5ac6?_0x408b9b[_0x4d3b('0x25')]:_0x15cc17[_0x4d3b('0x22')]+_0x15cc17[_0x4d3b('0x24')];var _0x50ef5a;if(_0x4f0e27>=_0x1fe7f5){_0x4f0e27=_0x1fe7f5;_0x50ef5a=0xc8;}else{_0x50ef5a=0xce;}_0x37c854[_0x4d3b('0x1f')](_0x50ef5a);return _0x37c854['set'](_0x4d3b('0x26'),_0x3a409c+'-'+_0x4f0e27+'/'+_0x1fe7f5)[_0x4d3b('0x21')](_0x408b9b);}return null;};}function patchUpdates(_0x335bd8){return function(_0x557811){try{jsonpatch[_0x4d3b('0x27')](_0x557811,_0x335bd8,!![]);}catch(_0x508335){return BPromise[_0x4d3b('0x28')](_0x508335);}return _0x557811[_0x4d3b('0x29')]();};}function saveUpdates(_0xc3fe1d,_0x5b94fc){return function(_0x26c9ca){if(_0x26c9ca){return _0x26c9ca[_0x4d3b('0x2a')](_0xc3fe1d)[_0x4d3b('0x2b')](function(_0x24ada0){return _0x24ada0;});}return null;};}function removeEntity(_0x51856d,_0x260cd3){return function(_0x7ac21c){if(_0x7ac21c){return _0x7ac21c[_0x4d3b('0x2c')]()[_0x4d3b('0x2b')](function(){_0x51856d[_0x4d3b('0x1f')](0xcc)[_0x4d3b('0x20')]();});}};}function handleEntityNotFound(_0x1223c7,_0x37fc9d){return function(_0x1b7c1b){if(!_0x1b7c1b){_0x1223c7['sendStatus'](0x194);}return _0x1b7c1b;};}function handleError(_0x3b62a7,_0x48adb6){_0x48adb6=_0x48adb6||0x1f4;return function(_0x26209a){logger[_0x4d3b('0x2d')](_0x26209a[_0x4d3b('0x2e')]);if(_0x26209a[_0x4d3b('0x2f')]){delete _0x26209a[_0x4d3b('0x2f')];}_0x3b62a7[_0x4d3b('0x1f')](_0x48adb6)['send'](_0x26209a);};}exports['show']=function(_0x3817bd,_0x599e10){var _0x5dc8a9={'raw':![],'where':{'id':_0x3817bd['params']['id']}},_0x18d048={};_0x18d048[_0x4d3b('0x30')]=_[_0x4d3b('0x31')](db[_0x4d3b('0x32')][_0x4d3b('0x33')]);_0x18d048['query']=_['keys'](_0x3817bd['query']);_0x18d048[_0x4d3b('0x34')]=_['intersection'](_0x18d048[_0x4d3b('0x30')],_0x18d048[_0x4d3b('0x35')]);_0x5dc8a9[_0x4d3b('0x36')]=_[_0x4d3b('0x37')](_0x18d048[_0x4d3b('0x30')],qs[_0x4d3b('0x38')](_0x3817bd[_0x4d3b('0x35')][_0x4d3b('0x38')]));_0x5dc8a9[_0x4d3b('0x36')]=_0x5dc8a9[_0x4d3b('0x36')]['length']?_0x5dc8a9[_0x4d3b('0x36')]:_0x18d048['model'];if(_0x3817bd['query'][_0x4d3b('0x39')]){_0x5dc8a9[_0x4d3b('0x3a')]=[{'all':!![]}];}_0x5dc8a9=_[_0x4d3b('0x3b')]({},_0x5dc8a9,_0x3817bd[_0x4d3b('0x3c')]);return db[_0x4d3b('0x32')][_0x4d3b('0x3d')](_0x5dc8a9)[_0x4d3b('0x2b')](handleEntityNotFound(_0x599e10,null))[_0x4d3b('0x2b')](respondWithResult(_0x599e10,null))[_0x4d3b('0x3e')](handleError(_0x599e10,null));};exports[_0x4d3b('0x2c')]=function(_0x497f8f,_0x35a046){return db['DashboardItem']['find']({'where':{'id':_0x497f8f[_0x4d3b('0x3f')]['id']}})[_0x4d3b('0x2b')](handleEntityNotFound(_0x35a046,null))[_0x4d3b('0x2b')](removeEntity(_0x35a046,null))[_0x4d3b('0x3e')](handleError(_0x35a046,null));};function widgetAttributes(_0x5e5a0c){try{switch(_0x5e5a0c['type']){case _0x4d3b('0x40'):return[{'name':_0x4d3b('0x41'),'value':_0x5e5a0c[_0x4d3b('0x41')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x43')]:undefined)||'https://'}];case _0x4d3b('0x44'):return[{'name':_0x4d3b('0x45'),'value':_0x5e5a0c[_0x4d3b('0x45')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x43')]:undefined)||''}];case _0x4d3b('0x46'):return[{'name':_0x4d3b('0x47'),'value':_0x5e5a0c[_0x4d3b('0x47')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0]['value']:undefined)||_0x4d3b('0x48')},{'name':_0x4d3b('0x49'),'value':_0x5e5a0c['attrTimezone']||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x1]?_0x5e5a0c[_0x4d3b('0x42')][0x1][_0x4d3b('0x43')]:undefined)||_0x4d3b('0x4a')},{'name':_0x4d3b('0x4b'),'value':_0x5e5a0c[_0x4d3b('0x4b')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c[_0x4d3b('0x42')][0x2]?_0x5e5a0c[_0x4d3b('0x42')][0x2][_0x4d3b('0x43')]:undefined)||0xc}];case _0x4d3b('0x4c'):return[{'name':'attrMetric','value':_0x5e5a0c[_0x4d3b('0x4d')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x43')]:undefined)||'total'},{'name':_0x4d3b('0x4e'),'value':_0x5e5a0c[_0x4d3b('0x4e')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x1]?_0x5e5a0c['attrs'][0x1][_0x4d3b('0x43')]:undefined)||[]},{'name':_0x4d3b('0x4b'),'value':_0x5e5a0c[_0x4d3b('0x4b')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x2]?_0x5e5a0c[_0x4d3b('0x42')][0x2][_0x4d3b('0x43')]:undefined)||0x14}];case'multibar-chart':case _0x4d3b('0x4f'):return[{'name':_0x4d3b('0x50'),'value':_0x5e5a0c['attrSerie1']||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x43')]:undefined)||_0x4d3b('0x51')},{'name':_0x4d3b('0x52'),'value':_0x5e5a0c[_0x4d3b('0x52')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x1]?_0x5e5a0c[_0x4d3b('0x42')][0x1][_0x4d3b('0x43')]:undefined)||null},{'name':_0x4d3b('0x53'),'value':_0x5e5a0c[_0x4d3b('0x53')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x2]?_0x5e5a0c[_0x4d3b('0x42')][0x2][_0x4d3b('0x43')]:undefined)||null},{'name':_0x4d3b('0x4e'),'value':_0x5e5a0c[_0x4d3b('0x4e')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c[_0x4d3b('0x42')][0x3]?_0x5e5a0c[_0x4d3b('0x42')][0x3][_0x4d3b('0x43')]:undefined)||[]}];case _0x4d3b('0x54'):return[{'name':_0x4d3b('0x55'),'type':_0x5e5a0c[_0x4d3b('0x56')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x57')]:undefined)||null,'value':_0x5e5a0c[_0x4d3b('0x55')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c['attrs'][0x0][_0x4d3b('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x5e5a0c[_0x4d3b('0x58')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x1]?_0x5e5a0c['attrs'][0x1][_0x4d3b('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x2f7791){logger[_0x4d3b('0x2d')](_0x4d3b('0x59'),JSON[_0x4d3b('0x5a')](_0x2f7791));return[];}}exports[_0x4d3b('0x5b')]=function(_0x171499,_0xa4899b){if(_0x171499[_0x4d3b('0x5c')]){_0x171499[_0x4d3b('0x5c')][_0x4d3b('0x42')]=widgetAttributes(_0x171499[_0x4d3b('0x5c')]);}return db['DashboardItem'][_0x4d3b('0x5b')](_0x171499[_0x4d3b('0x5c')],{})[_0x4d3b('0x2b')](respondWithResult(_0xa4899b,0xc9))[_0x4d3b('0x3e')](handleError(_0xa4899b,null));};exports['update']=function(_0x2ed4a5,_0x5c1f51){if(_0x2ed4a5[_0x4d3b('0x5c')]['id']){delete _0x2ed4a5[_0x4d3b('0x5c')]['id'];}_0x2ed4a5[_0x4d3b('0x5c')]['attrs']=widgetAttributes(_0x2ed4a5[_0x4d3b('0x5c')]);return db[_0x4d3b('0x32')][_0x4d3b('0x3d')]({'where':{'id':_0x2ed4a5[_0x4d3b('0x3f')]['id']}})[_0x4d3b('0x2b')](handleEntityNotFound(_0x5c1f51,null))['then'](saveUpdates(_0x2ed4a5[_0x4d3b('0x5c')],null))[_0x4d3b('0x2b')](respondWithResult(_0x5c1f51,null))[_0x4d3b('0x3e')](handleError(_0x5c1f51,null));};
\ No newline at end of file
index 9bedf6e..56a8a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fcd=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem','save'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9fcd,0x15b));var _0xd9fc=function(_0x30b3fe,_0x10d30e){_0x30b3fe=_0x30b3fe-0x0;var _0x46727=_0x9fcd[_0x30b3fe];return _0x46727;};'use strict';var EventEmitter=require(_0xd9fc('0x0'));var DashboardItem=require(_0xd9fc('0x1'))['db'][_0xd9fc('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9fc('0x3'),'afterUpdate':_0xd9fc('0x4'),'afterDestroy':_0xd9fc('0x5')};function emitEvent(_0x2f3590){return function(_0x1ea078,_0x3dbe5d,_0x3df69e){DashboardItemEvents[_0xd9fc('0x6')](_0x2f3590+':'+_0x1ea078['id'],_0x1ea078);DashboardItemEvents['emit'](_0x2f3590,_0x1ea078);_0x3df69e(null);};}for(var e in events){if(events[_0xd9fc('0x7')](e)){var event=events[e];DashboardItem[_0xd9fc('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0xf23b=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit'];(function(_0x57041f,_0x967686){var _0x5145ca=function(_0x550db5){while(--_0x550db5){_0x57041f['push'](_0x57041f['shift']());}};_0x5145ca(++_0x967686);}(_0xf23b,0xd4));var _0xbf23=function(_0x4dcac4,_0x10e48a){_0x4dcac4=_0x4dcac4-0x0;var _0x2a238d=_0xf23b[_0x4dcac4];return _0x2a238d;};'use strict';var EventEmitter=require(_0xbf23('0x0'));var DashboardItem=require(_0xbf23('0x1'))['db'][_0xbf23('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xbf23('0x3')](0x0);var events={'afterCreate':_0xbf23('0x4'),'afterUpdate':_0xbf23('0x5'),'afterDestroy':_0xbf23('0x6')};function emitEvent(_0x462fbf){return function(_0x29bfae,_0x493a25,_0x591f1c){DashboardItemEvents['emit'](_0x462fbf+':'+_0x29bfae['id'],_0x29bfae);DashboardItemEvents[_0xbf23('0x7')](_0x462fbf,_0x29bfae);_0x591f1c(null);};}for(var e in events){if(events[_0xbf23('0x8')](e)){var event=events[e];DashboardItem[_0xbf23('0x9')](e,emitEvent(event));}}module[_0xbf23('0xa')]=DashboardItemEvents;
\ No newline at end of file
index 96785ee..947292a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf66=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','DashboardItem','lodash','../../config/logger','api'];(function(_0x268559,_0x4504d4){var _0x4b519c=function(_0x411720){while(--_0x411720){_0x268559['push'](_0x268559['shift']());}};_0x4b519c(++_0x4504d4);}(_0xcf66,0x110));var _0x6cf6=function(_0x5a81cd,_0x38b52){_0x5a81cd=_0x5a81cd-0x0;var _0x21a071=_0xcf66[_0x5a81cd];return _0x21a071;};'use strict';var _=require(_0x6cf6('0x0'));var util=require('util');var logger=require(_0x6cf6('0x1'))(_0x6cf6('0x2'));var moment=require(_0x6cf6('0x3'));var BPromise=require(_0x6cf6('0x4'));var rp=require(_0x6cf6('0x5'));var fs=require('fs');var path=require(_0x6cf6('0x6'));var rimraf=require(_0x6cf6('0x7'));var config=require(_0x6cf6('0x8'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x33d550,_0x1f92f4){return _0x33d550[_0x6cf6('0x9')](_0x6cf6('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x60ce=['request-promise','path','exports','define','DashboardItem','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x181b4b,_0x216ed9){var _0xd9c915=function(_0x527eb9){while(--_0x527eb9){_0x181b4b['push'](_0x181b4b['shift']());}};_0xd9c915(++_0x216ed9);}(_0x60ce,0x118));var _0xe60c=function(_0x59f2eb,_0x4a40f5){_0x59f2eb=_0x59f2eb-0x0;var _0x3bc71e=_0x60ce[_0x59f2eb];return _0x3bc71e;};'use strict';var _=require(_0xe60c('0x0'));var util=require(_0xe60c('0x1'));var logger=require(_0xe60c('0x2'))(_0xe60c('0x3'));var moment=require(_0xe60c('0x4'));var BPromise=require(_0xe60c('0x5'));var rp=require(_0xe60c('0x6'));var fs=require('fs');var path=require(_0xe60c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xe60c('0x8')]=function(_0x4c1f04,_0x5c81dc){return _0x4c1f04[_0xe60c('0x9')](_0xe60c('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5eec3f4..9e755fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0661=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','debug','request\x20sent','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x37b961,_0xa4ef8a){var _0x2c47c1=function(_0x485a0c){while(--_0x485a0c){_0x37b961['push'](_0x37b961['shift']());}};_0x2c47c1(++_0xa4ef8a);}(_0x0661,0x1c1));var _0x1066=function(_0x488e3d,_0x4f7e2a){_0x488e3d=_0x488e3d-0x0;var _0x3ee2b2=_0x0661[_0x488e3d];return _0x3ee2b2;};'use strict';var _=require(_0x1066('0x0'));var util=require(_0x1066('0x1'));var moment=require('moment');var BPromise=require(_0x1066('0x2'));var rs=require(_0x1066('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1066('0x4'))['db'];var utils=require(_0x1066('0x5'));var logger=require('../../config/logger')(_0x1066('0x6'));var config=require('../../config/environment');var jayson=require(_0x1066('0x7'));var client=jayson['client'][_0x1066('0x8')]({'port':0x232a});config[_0x1066('0x9')]=_[_0x1066('0xa')](config[_0x1066('0x9')],{'host':_0x1066('0xb'),'port':0x18eb});var socket=require(_0x1066('0xc'))(new Redis(config[_0x1066('0x9')]));require(_0x1066('0xd'))[_0x1066('0xe')](socket);function respondWithRpcPromise(_0x1f6005,_0x52fb3f,_0xbdb45d){return new BPromise(function(_0x5ca948,_0x239789){return client[_0x1066('0xf')](_0x1f6005,_0xbdb45d)[_0x1066('0x10')](function(_0x14490d){logger['info']('DashboardItem,\x20%s,\x20%s',_0x52fb3f,'request\x20sent');logger[_0x1066('0x11')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x52fb3f,_0x1066('0x12'),JSON['stringify'](_0x14490d));if(_0x14490d[_0x1066('0x13')]){if(_0x14490d[_0x1066('0x13')][_0x1066('0x14')]===0x1f4){logger[_0x1066('0x13')](_0x1066('0x15'),_0x52fb3f,_0x14490d['error'][_0x1066('0x16')]);return _0x239789(_0x14490d[_0x1066('0x13')][_0x1066('0x16')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x52fb3f,_0x14490d[_0x1066('0x13')]['message']);return _0x5ca948(_0x14490d[_0x1066('0x13')][_0x1066('0x16')]);}else{logger['info'](_0x1066('0x15'),_0x52fb3f,'request\x20sent');_0x5ca948(_0x14490d[_0x1066('0x17')]['message']);}})[_0x1066('0x18')](function(_0x230328){logger['error']('DashboardItem,\x20%s,\x20%s',_0x52fb3f,_0x230328);_0x239789(_0x230328);});});}
\ No newline at end of file
+var _0x4901=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x4d95e8,_0x8c6139){var _0x508106=function(_0x28df){while(--_0x28df){_0x4d95e8['push'](_0x4d95e8['shift']());}};_0x508106(++_0x8c6139);}(_0x4901,0x107));var _0x1490=function(_0x7782ff,_0x487117){_0x7782ff=_0x7782ff-0x0;var _0x152919=_0x4901[_0x7782ff];return _0x152919;};'use strict';var _=require(_0x1490('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1490('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1490('0x2'))['db'];var utils=require(_0x1490('0x3'));var logger=require(_0x1490('0x4'))(_0x1490('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1490('0x6')]['http']({'port':0x232a});config[_0x1490('0x7')]=_[_0x1490('0x8')](config[_0x1490('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x1490('0x9'))(new Redis(config[_0x1490('0x7')]));require(_0x1490('0xa'))[_0x1490('0xb')](socket);function respondWithRpcPromise(_0x56b296,_0x4bf8a8,_0x23e46d){return new BPromise(function(_0x3c739f,_0x1636eb){return client[_0x1490('0xc')](_0x56b296,_0x23e46d)[_0x1490('0xd')](function(_0x5b45ca){logger[_0x1490('0xe')](_0x1490('0xf'),_0x4bf8a8,'request\x20sent');logger[_0x1490('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4bf8a8,_0x1490('0x11'),JSON[_0x1490('0x12')](_0x5b45ca));if(_0x5b45ca[_0x1490('0x13')]){if(_0x5b45ca[_0x1490('0x13')][_0x1490('0x14')]===0x1f4){logger[_0x1490('0x13')](_0x1490('0xf'),_0x4bf8a8,_0x5b45ca[_0x1490('0x13')][_0x1490('0x15')]);return _0x1636eb(_0x5b45ca['error'][_0x1490('0x15')]);}logger['error'](_0x1490('0xf'),_0x4bf8a8,_0x5b45ca[_0x1490('0x13')][_0x1490('0x15')]);return _0x3c739f(_0x5b45ca[_0x1490('0x13')]['message']);}else{logger[_0x1490('0xe')](_0x1490('0xf'),_0x4bf8a8,_0x1490('0x11'));_0x3c739f(_0x5b45ca[_0x1490('0x16')]['message']);}})[_0x1490('0x17')](function(_0x5b176b){logger['error'](_0x1490('0xf'),_0x4bf8a8,_0x5b176b);_0x1636eb(_0x5b176b);});});}
\ No newline at end of file
index dfac599..a66c8a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8640=['update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0x8640,0x1e6));var _0x0864=function(_0x2f423f,_0xb289e7){_0x2f423f=_0x2f423f-0x0;var _0x9ea904=_0x8640[_0x2f423f];return _0x9ea904;};'use strict';var DashboardItemEvents=require(_0x0864('0x0'));var events=[_0x0864('0x1'),'remove',_0x0864('0x2')];function createListener(_0x1e8bc8,_0x1db0a7){return function(_0x2f1db2){_0x1db0a7[_0x0864('0x3')](_0x1e8bc8,_0x2f1db2);};}function removeListener(_0x2ec621,_0x20dc52){return function(){DashboardItemEvents[_0x0864('0x4')](_0x2ec621,_0x20dc52);};}exports[_0x0864('0x5')]=function(_0x25ea7b){for(var _0x2d0c01=0x0,_0x5c8c01=events[_0x0864('0x6')];_0x2d0c01<_0x5c8c01;_0x2d0c01++){var _0x3d4491=events[_0x2d0c01];var _0x5c8449=createListener(_0x0864('0x7')+_0x3d4491,_0x25ea7b);DashboardItemEvents['on'](_0x3d4491,_0x5c8449);}};
\ No newline at end of file
+var _0x5e31=['remove','update','register','length'];(function(_0x22ab7e,_0x3d6fa7){var _0x2198f9=function(_0x2210d5){while(--_0x2210d5){_0x22ab7e['push'](_0x22ab7e['shift']());}};_0x2198f9(++_0x3d6fa7);}(_0x5e31,0x1c4));var _0x15e3=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0x5e31[_0x242a4f];return _0x122117;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x15e3('0x0'),_0x15e3('0x1')];function createListener(_0x101f3e,_0x222e65){return function(_0x28f1e7){_0x222e65['emit'](_0x101f3e,_0x28f1e7);};}function removeListener(_0x5acb33,_0x21d9d2){return function(){DashboardItemEvents['removeListener'](_0x5acb33,_0x21d9d2);};}exports[_0x15e3('0x2')]=function(_0x499cd1){for(var _0x55c7e4=0x0,_0x565e4f=events[_0x15e3('0x3')];_0x55c7e4<_0x565e4f;_0x55c7e4++){var _0x2a6a4f=events[_0x55c7e4];var _0x3ef21e=createListener('dashboardItem:'+_0x2a6a4f,_0x499cd1);DashboardItemEvents['on'](_0x2a6a4f,_0x3ef21e);}};
\ No newline at end of file
index b0ec44b..c6a40f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99c8=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0x99c8,0x1b6));var _0x899c=function(_0x3ace2c,_0x2b0036){_0x3ace2c=_0x3ace2c-0x0;var _0x44e605=_0x99c8[_0x3ace2c];return _0x44e605;};'use strict';var multer=require(_0x899c('0x0'));var util=require(_0x899c('0x1'));var path=require(_0x899c('0x2'));var timeout=require(_0x899c('0x3'));var express=require('express');var router=express[_0x899c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x899c('0x5'));var interaction=require(_0x899c('0x6'));var config=require(_0x899c('0x7'));var controller=require(_0x899c('0x8'));router[_0x899c('0x9')]('/:id',auth[_0x899c('0xa')](),controller[_0x899c('0xb')]);router[_0x899c('0xc')]('/',auth[_0x899c('0xa')](),controller[_0x899c('0xd')]);router[_0x899c('0xe')](_0x899c('0xf'),auth[_0x899c('0xa')](),controller[_0x899c('0x10')]);router[_0x899c('0x11')](_0x899c('0xf'),auth[_0x899c('0xa')](),controller[_0x899c('0x12')]);module[_0x899c('0x13')]=router;
\ No newline at end of file
+var _0x06b2=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','update'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x06b2,0x14b));var _0x206b=function(_0x2059b1,_0x24a617){_0x2059b1=_0x2059b1-0x0;var _0x2fe10b=_0x06b2[_0x2059b1];return _0x2fe10b;};'use strict';var multer=require(_0x206b('0x0'));var util=require(_0x206b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x206b('0x2'));var router=express[_0x206b('0x3')]();var fs_extra=require(_0x206b('0x4'));var auth=require(_0x206b('0x5'));var interaction=require(_0x206b('0x6'));var config=require('../../config/environment');var controller=require(_0x206b('0x7'));router[_0x206b('0x8')](_0x206b('0x9'),auth[_0x206b('0xa')](),controller[_0x206b('0xb')]);router['post']('/',auth[_0x206b('0xa')](),controller[_0x206b('0xc')]);router['put'](_0x206b('0x9'),auth[_0x206b('0xa')](),controller[_0x206b('0xd')]);router['delete'](_0x206b('0x9'),auth[_0x206b('0xa')](),controller['destroy']);module[_0x206b('0xe')]=router;
\ No newline at end of file
index d2ad738..376cd2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ad9=['exports','second','third','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0ad9,0xb4));var _0x90ad=function(_0x5bf72e,_0x30c6e4){_0x5bf72e=_0x5bf72e-0x0;var _0x348e30=_0x0ad9[_0x5bf72e];return _0x348e30;};'use strict';var Sequelize=require('sequelize');module[_0x90ad('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x90ad('0x1'),_0x90ad('0x2')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x90ad('0x3')]}};
\ No newline at end of file
+var _0x07ba=['STRING','ENUM','first','second','third','sequelize','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x07ba,0x1d3));var _0xa07b=function(_0x1dc99c,_0x2f5f00){_0x1dc99c=_0x1dc99c-0x0;var _0x51a05d=_0x07ba[_0x1dc99c];return _0x51a05d;};'use strict';var Sequelize=require(_0xa07b('0x0'));module[_0xa07b('0x1')]={'name':{'type':Sequelize[_0xa07b('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xa07b('0x3')](_0xa07b('0x4'),_0xa07b('0x5'),_0xa07b('0x6')),'allowNull':![],'defaultValue':_0xa07b('0x4')},'description':{'type':Sequelize[_0xa07b('0x2')]}};
\ No newline at end of file
index 80eacf8..54e6c4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb15=['update','destroy','then','get','UserProfileResource','stack','send','index','map','Disposition','rawAttributes','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','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','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save'];(function(_0x3d4a2b,_0xca71a8){var _0x5c55c6=function(_0x46c01a){while(--_0x46c01a){_0x3d4a2b['push'](_0x3d4a2b['shift']());}};_0x5c55c6(++_0xca71a8);}(_0xfb15,0x12f));var _0x5fb1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xfb15[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x5fb1('0x0'));var rimraf=require(_0x5fb1('0x1'));var zipdir=require(_0x5fb1('0x2'));var jsonpatch=require(_0x5fb1('0x3'));var rp=require(_0x5fb1('0x4'));var moment=require(_0x5fb1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fb1('0x6'));var util=require(_0x5fb1('0x7'));var path=require(_0x5fb1('0x8'));var sox=require(_0x5fb1('0x9'));var csv=require(_0x5fb1('0xa'));var ejs=require(_0x5fb1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fb1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5fb1('0xd'));var deskjs=require(_0x5fb1('0xe'));var toCsv=require(_0x5fb1('0xa'));var querystring=require(_0x5fb1('0xf'));var Papa=require(_0x5fb1('0x10'));var Redis=require(_0x5fb1('0x11'));var authService=require(_0x5fb1('0x12'));var qs=require(_0x5fb1('0x13'));var as=require(_0x5fb1('0x14'));var hardwareService=require(_0x5fb1('0x15'));var logger=require(_0x5fb1('0x16'))(_0x5fb1('0x17'));var utils=require(_0x5fb1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5fb1('0x19'));var db=require(_0x5fb1('0x1a'))['db'];function respondWithStatusCode(_0x57593c,_0x173046){_0x173046=_0x173046||0xcc;return function(_0xf8539f){if(_0xf8539f){return _0x57593c['sendStatus'](_0x173046);}return _0x57593c[_0x5fb1('0x1b')](_0x173046)[_0x5fb1('0x1c')]();};}function respondWithResult(_0x348c9f,_0x3256d1){_0x3256d1=_0x3256d1||0xc8;return function(_0xb06b49){if(_0xb06b49){return _0x348c9f[_0x5fb1('0x1b')](_0x3256d1)[_0x5fb1('0x1d')](_0xb06b49);}};}function respondWithFilteredResult(_0x36b516,_0x588543){return function(_0x5332f5){if(_0x5332f5){var _0x55be50=typeof _0x588543[_0x5fb1('0x1e')]===_0x5fb1('0x1f')&&typeof _0x588543[_0x5fb1('0x20')]===_0x5fb1('0x1f');var _0x3e40e2=_0x5332f5[_0x5fb1('0x21')];var _0x547a28=_0x55be50?0x0:_0x588543[_0x5fb1('0x1e')];var _0x38a297=_0x55be50?_0x5332f5[_0x5fb1('0x21')]:_0x588543[_0x5fb1('0x1e')]+_0x588543[_0x5fb1('0x20')];var _0x229700;if(_0x38a297>=_0x3e40e2){_0x38a297=_0x3e40e2;_0x229700=0xc8;}else{_0x229700=0xce;}_0x36b516['status'](_0x229700);return _0x36b516['set']('Content-Range',_0x547a28+'-'+_0x38a297+'/'+_0x3e40e2)[_0x5fb1('0x1d')](_0x5332f5);}return null;};}function patchUpdates(_0x1fa373){return function(_0x592399){try{jsonpatch[_0x5fb1('0x22')](_0x592399,_0x1fa373,!![]);}catch(_0x305ea9){return BPromise[_0x5fb1('0x23')](_0x305ea9);}return _0x592399[_0x5fb1('0x24')]();};}function saveUpdates(_0x3b0303,_0x41e89a){return function(_0x549b56){if(_0x549b56){return _0x549b56[_0x5fb1('0x25')](_0x3b0303)['then'](function(_0x53c791){return _0x53c791;});}return null;};}function removeEntity(_0x1c359e,_0x29638a){return function(_0x3555b5){if(_0x3555b5){return _0x3555b5[_0x5fb1('0x26')]()[_0x5fb1('0x27')](function(){var _0x5db04e=_0x3555b5[_0x5fb1('0x28')]({'plain':!![]});var _0x252e43='Dispositions';return db[_0x5fb1('0x29')][_0x5fb1('0x26')]({'where':{'type':_0x252e43,'resourceId':_0x5db04e['id']}})[_0x5fb1('0x27')](function(){return _0x3555b5;});})[_0x5fb1('0x27')](function(){_0x1c359e['status'](0xcc)[_0x5fb1('0x1c')]();});}};}function handleEntityNotFound(_0x52aeb8,_0x105cec){return function(_0x1b3224){if(!_0x1b3224){_0x52aeb8['sendStatus'](0x194);}return _0x1b3224;};}function handleError(_0x3cac18,_0x18a84e){_0x18a84e=_0x18a84e||0x1f4;return function(_0x31de2f){logger['error'](_0x31de2f[_0x5fb1('0x2a')]);if(_0x31de2f['name']){delete _0x31de2f['name'];}_0x3cac18[_0x5fb1('0x1b')](_0x18a84e)[_0x5fb1('0x2b')](_0x31de2f);};}exports[_0x5fb1('0x2c')]=function(_0x507b35,_0x2448f3){var _0x50614c={},_0x5ee949={},_0x27ebae={'count':0x0,'rows':[]};var _0x4f5a80=_[_0x5fb1('0x2d')](db[_0x5fb1('0x2e')][_0x5fb1('0x2f')],function(_0x566088){return{'name':_0x566088['fieldName'],'type':_0x566088[_0x5fb1('0x30')][_0x5fb1('0x31')]};});_0x5ee949['model']=_[_0x5fb1('0x2d')](_0x4f5a80,_0x5fb1('0x32'));_0x5ee949[_0x5fb1('0x33')]=_[_0x5fb1('0x34')](_0x507b35[_0x5fb1('0x33')]);_0x5ee949[_0x5fb1('0x35')]=_[_0x5fb1('0x36')](_0x5ee949[_0x5fb1('0x37')],_0x5ee949[_0x5fb1('0x33')]);_0x50614c['attributes']=_[_0x5fb1('0x36')](_0x5ee949[_0x5fb1('0x37')],qs[_0x5fb1('0x38')](_0x507b35[_0x5fb1('0x33')][_0x5fb1('0x38')]));_0x50614c['attributes']=_0x50614c[_0x5fb1('0x39')][_0x5fb1('0x3a')]?_0x50614c[_0x5fb1('0x39')]:_0x5ee949['model'];if(!_0x507b35['query']['hasOwnProperty'](_0x5fb1('0x3b'))){_0x50614c[_0x5fb1('0x20')]=qs[_0x5fb1('0x20')](_0x507b35['query'][_0x5fb1('0x20')]);_0x50614c[_0x5fb1('0x1e')]=qs[_0x5fb1('0x1e')](_0x507b35[_0x5fb1('0x33')][_0x5fb1('0x1e')]);}_0x50614c[_0x5fb1('0x3c')]=qs['sort'](_0x507b35[_0x5fb1('0x33')][_0x5fb1('0x3d')]);_0x50614c[_0x5fb1('0x3e')]=qs[_0x5fb1('0x35')](_[_0x5fb1('0x3f')](_0x507b35[_0x5fb1('0x33')],_0x5ee949[_0x5fb1('0x35')]),_0x4f5a80);if(_0x507b35[_0x5fb1('0x33')][_0x5fb1('0x40')]){_0x50614c[_0x5fb1('0x3e')]=_[_0x5fb1('0x41')](_0x50614c[_0x5fb1('0x3e')],{'$or':_['map'](_0x4f5a80,function(_0x5f0c96){if(_0x5f0c96[_0x5fb1('0x30')]!==_0x5fb1('0x42')){var _0x878a10={};_0x878a10[_0x5f0c96[_0x5fb1('0x32')]]={'$like':'%'+_0x507b35[_0x5fb1('0x33')]['filter']+'%'};return _0x878a10;}})});}_0x50614c=_[_0x5fb1('0x41')]({},_0x50614c,_0x507b35[_0x5fb1('0x43')]);var _0x26ccf0={'where':_0x50614c[_0x5fb1('0x3e')]};return db[_0x5fb1('0x2e')]['count'](_0x26ccf0)[_0x5fb1('0x27')](function(_0x2cfedc){_0x27ebae[_0x5fb1('0x21')]=_0x2cfedc;if(_0x507b35[_0x5fb1('0x33')][_0x5fb1('0x44')]){_0x50614c[_0x5fb1('0x45')]=[{'all':!![]}];}return db[_0x5fb1('0x2e')][_0x5fb1('0x46')](_0x50614c);})[_0x5fb1('0x27')](function(_0x589ef3){_0x27ebae[_0x5fb1('0x47')]=_0x589ef3;return _0x27ebae;})[_0x5fb1('0x27')](respondWithFilteredResult(_0x2448f3,_0x50614c))[_0x5fb1('0x48')](handleError(_0x2448f3,null));};exports['show']=function(_0x8e0012,_0x58920f){var _0x3cdc43={'raw':!![],'where':{'id':_0x8e0012['params']['id']}},_0x4007ce={};_0x4007ce['model']=_[_0x5fb1('0x34')](db[_0x5fb1('0x2e')][_0x5fb1('0x2f')]);_0x4007ce[_0x5fb1('0x33')]=_['keys'](_0x8e0012['query']);_0x4007ce['filters']=_['intersection'](_0x4007ce[_0x5fb1('0x37')],_0x4007ce[_0x5fb1('0x33')]);_0x3cdc43[_0x5fb1('0x39')]=_[_0x5fb1('0x36')](_0x4007ce['model'],qs['fields'](_0x8e0012['query'][_0x5fb1('0x38')]));_0x3cdc43['attributes']=_0x3cdc43['attributes'][_0x5fb1('0x3a')]?_0x3cdc43[_0x5fb1('0x39')]:_0x4007ce['model'];if(_0x8e0012[_0x5fb1('0x33')][_0x5fb1('0x44')]){_0x3cdc43[_0x5fb1('0x45')]=[{'all':!![]}];}_0x3cdc43=_[_0x5fb1('0x41')]({},_0x3cdc43,_0x8e0012[_0x5fb1('0x43')]);return db[_0x5fb1('0x2e')][_0x5fb1('0x49')](_0x3cdc43)[_0x5fb1('0x27')](handleEntityNotFound(_0x58920f,null))[_0x5fb1('0x27')](respondWithResult(_0x58920f,null))[_0x5fb1('0x48')](handleError(_0x58920f,null));};exports[_0x5fb1('0x4a')]=function(_0xcb16fc,_0x401d2a){return db[_0x5fb1('0x2e')][_0x5fb1('0x4a')](_0xcb16fc[_0x5fb1('0x4b')],{})[_0x5fb1('0x27')](function(_0x266e19){var _0x51526d=_0xcb16fc[_0x5fb1('0x4c')][_0x5fb1('0x28')]({'plain':!![]});if(!_0x51526d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51526d[_0x5fb1('0x4d')]===_0x5fb1('0x4c')){var _0x74be=_0x266e19[_0x5fb1('0x28')]({'plain':!![]});var _0x3071b4=_0x5fb1('0x4e');return db[_0x5fb1('0x4f')][_0x5fb1('0x49')]({'where':{'name':_0x3071b4,'userProfileId':_0x51526d[_0x5fb1('0x50')]},'raw':!![]})[_0x5fb1('0x27')](function(_0xb09f05){if(_0xb09f05&&_0xb09f05[_0x5fb1('0x51')]===0x0){return db[_0x5fb1('0x29')][_0x5fb1('0x4a')]({'name':_0x74be[_0x5fb1('0x32')],'resourceId':_0x74be['id'],'type':_0xb09f05[_0x5fb1('0x32')],'sectionId':_0xb09f05['id']},{})['then'](function(){return _0x266e19;});}else{return _0x266e19;}})[_0x5fb1('0x48')](function(_0x5cb64c){logger[_0x5fb1('0x52')](_0x5fb1('0x53'),_0x5cb64c);throw _0x5cb64c;});}return _0x266e19;})[_0x5fb1('0x27')](respondWithResult(_0x401d2a,0xc9))['catch'](handleError(_0x401d2a,null));};exports['update']=function(_0x448e46,_0x39c95e){if(_0x448e46['body']['id']){delete _0x448e46[_0x5fb1('0x4b')]['id'];}return db[_0x5fb1('0x2e')]['find']({'where':{'id':_0x448e46[_0x5fb1('0x54')]['id']}})[_0x5fb1('0x27')](handleEntityNotFound(_0x39c95e,null))[_0x5fb1('0x27')](saveUpdates(_0x448e46[_0x5fb1('0x4b')],null))[_0x5fb1('0x27')](respondWithResult(_0x39c95e,null))[_0x5fb1('0x48')](handleError(_0x39c95e,null));};exports['destroy']=function(_0x235340,_0x305571){return db[_0x5fb1('0x2e')]['find']({'where':{'id':_0x235340[_0x5fb1('0x54')]['id']}})['then'](handleEntityNotFound(_0x305571,null))[_0x5fb1('0x27')](removeEntity(_0x305571,null))['catch'](handleError(_0x305571,null));};
\ No newline at end of file
+var _0x82c4=['pick','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','end','error','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x82c4,0x1ca));var _0x482c=function(_0x1d408d,_0x2fef27){_0x1d408d=_0x1d408d-0x0;var _0x112a98=_0x82c4[_0x1d408d];return _0x112a98;};'use strict';var emlformat=require(_0x482c('0x0'));var rimraf=require(_0x482c('0x1'));var zipdir=require(_0x482c('0x2'));var jsonpatch=require(_0x482c('0x3'));var rp=require(_0x482c('0x4'));var moment=require(_0x482c('0x5'));var BPromise=require(_0x482c('0x6'));var Mustache=require('mustache');var util=require(_0x482c('0x7'));var path=require('path');var sox=require(_0x482c('0x8'));var csv=require('to-csv');var ejs=require(_0x482c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x482c('0xa'));var squel=require(_0x482c('0xb'));var crypto=require(_0x482c('0xc'));var jsforce=require(_0x482c('0xd'));var deskjs=require(_0x482c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x482c('0xf'));var Papa=require(_0x482c('0x10'));var Redis=require(_0x482c('0x11'));var authService=require(_0x482c('0x12'));var qs=require(_0x482c('0x13'));var as=require(_0x482c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x482c('0x15'))(_0x482c('0x16'));var utils=require(_0x482c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x482c('0x18'));var db=require(_0x482c('0x19'))['db'];function respondWithStatusCode(_0x3fabb3,_0x56aafd){_0x56aafd=_0x56aafd||0xcc;return function(_0x4bfb3a){if(_0x4bfb3a){return _0x3fabb3[_0x482c('0x1a')](_0x56aafd);}return _0x3fabb3[_0x482c('0x1b')](_0x56aafd)['end']();};}function respondWithResult(_0x56ee17,_0x14452b){_0x14452b=_0x14452b||0xc8;return function(_0xe3f853){if(_0xe3f853){return _0x56ee17[_0x482c('0x1b')](_0x14452b)[_0x482c('0x1c')](_0xe3f853);}};}function respondWithFilteredResult(_0x37a4f0,_0x119635){return function(_0x3beedb){if(_0x3beedb){var _0xf65563=typeof _0x119635[_0x482c('0x1d')]===_0x482c('0x1e')&&typeof _0x119635[_0x482c('0x1f')]===_0x482c('0x1e');var _0x4bdf15=_0x3beedb[_0x482c('0x20')];var _0x5b6f7e=_0xf65563?0x0:_0x119635[_0x482c('0x1d')];var _0x258148=_0xf65563?_0x3beedb['count']:_0x119635['offset']+_0x119635[_0x482c('0x1f')];var _0x584656;if(_0x258148>=_0x4bdf15){_0x258148=_0x4bdf15;_0x584656=0xc8;}else{_0x584656=0xce;}_0x37a4f0[_0x482c('0x1b')](_0x584656);return _0x37a4f0[_0x482c('0x21')](_0x482c('0x22'),_0x5b6f7e+'-'+_0x258148+'/'+_0x4bdf15)[_0x482c('0x1c')](_0x3beedb);}return null;};}function patchUpdates(_0x5c927b){return function(_0x1c9a7b){try{jsonpatch[_0x482c('0x23')](_0x1c9a7b,_0x5c927b,!![]);}catch(_0x38a956){return BPromise[_0x482c('0x24')](_0x38a956);}return _0x1c9a7b[_0x482c('0x25')]();};}function saveUpdates(_0x58ed18,_0x4afcd9){return function(_0x238503){if(_0x238503){return _0x238503[_0x482c('0x26')](_0x58ed18)[_0x482c('0x27')](function(_0x5c4e9c){return _0x5c4e9c;});}return null;};}function removeEntity(_0x3d5490,_0x579d2f){return function(_0x2f3f96){if(_0x2f3f96){return _0x2f3f96[_0x482c('0x28')]()['then'](function(){var _0x466583=_0x2f3f96['get']({'plain':!![]});var _0x589bc6=_0x482c('0x29');return db[_0x482c('0x2a')][_0x482c('0x28')]({'where':{'type':_0x589bc6,'resourceId':_0x466583['id']}})[_0x482c('0x27')](function(){return _0x2f3f96;});})[_0x482c('0x27')](function(){_0x3d5490[_0x482c('0x1b')](0xcc)[_0x482c('0x2b')]();});}};}function handleEntityNotFound(_0x5ad788,_0xb65836){return function(_0x255417){if(!_0x255417){_0x5ad788['sendStatus'](0x194);}return _0x255417;};}function handleError(_0xb01bc3,_0x52b6fc){_0x52b6fc=_0x52b6fc||0x1f4;return function(_0x54782d){logger[_0x482c('0x2c')](_0x54782d['stack']);if(_0x54782d[_0x482c('0x2d')]){delete _0x54782d[_0x482c('0x2d')];}_0xb01bc3[_0x482c('0x1b')](_0x52b6fc)[_0x482c('0x2e')](_0x54782d);};}exports[_0x482c('0x2f')]=function(_0x11950f,_0x36b00d){var _0x3e9b22={},_0x24b4df={},_0x2d3800={'count':0x0,'rows':[]};var _0x3135a7=_[_0x482c('0x30')](db[_0x482c('0x31')][_0x482c('0x32')],function(_0x1eac87){return{'name':_0x1eac87[_0x482c('0x33')],'type':_0x1eac87[_0x482c('0x34')][_0x482c('0x35')]};});_0x24b4df['model']=_['map'](_0x3135a7,'name');_0x24b4df[_0x482c('0x36')]=_[_0x482c('0x37')](_0x11950f[_0x482c('0x36')]);_0x24b4df[_0x482c('0x38')]=_['intersection'](_0x24b4df[_0x482c('0x39')],_0x24b4df['query']);_0x3e9b22[_0x482c('0x3a')]=_[_0x482c('0x3b')](_0x24b4df[_0x482c('0x39')],qs[_0x482c('0x3c')](_0x11950f[_0x482c('0x36')][_0x482c('0x3c')]));_0x3e9b22[_0x482c('0x3a')]=_0x3e9b22[_0x482c('0x3a')]['length']?_0x3e9b22['attributes']:_0x24b4df[_0x482c('0x39')];if(!_0x11950f['query'][_0x482c('0x3d')](_0x482c('0x3e'))){_0x3e9b22[_0x482c('0x1f')]=qs['limit'](_0x11950f[_0x482c('0x36')][_0x482c('0x1f')]);_0x3e9b22[_0x482c('0x1d')]=qs[_0x482c('0x1d')](_0x11950f['query'][_0x482c('0x1d')]);}_0x3e9b22['order']=qs[_0x482c('0x3f')](_0x11950f['query'][_0x482c('0x3f')]);_0x3e9b22['where']=qs[_0x482c('0x38')](_[_0x482c('0x40')](_0x11950f['query'],_0x24b4df[_0x482c('0x38')]),_0x3135a7);if(_0x11950f['query']['filter']){_0x3e9b22[_0x482c('0x41')]=_['merge'](_0x3e9b22['where'],{'$or':_['map'](_0x3135a7,function(_0x581757){if(_0x581757[_0x482c('0x34')]!==_0x482c('0x42')){var _0x39b121={};_0x39b121[_0x581757[_0x482c('0x2d')]]={'$like':'%'+_0x11950f[_0x482c('0x36')]['filter']+'%'};return _0x39b121;}})});}_0x3e9b22=_[_0x482c('0x43')]({},_0x3e9b22,_0x11950f[_0x482c('0x44')]);var _0x45c8c2={'where':_0x3e9b22[_0x482c('0x41')]};return db['Disposition']['count'](_0x45c8c2)[_0x482c('0x27')](function(_0x44bedf){_0x2d3800[_0x482c('0x20')]=_0x44bedf;if(_0x11950f[_0x482c('0x36')][_0x482c('0x45')]){_0x3e9b22[_0x482c('0x46')]=[{'all':!![]}];}return db[_0x482c('0x31')][_0x482c('0x47')](_0x3e9b22);})[_0x482c('0x27')](function(_0x15fc22){_0x2d3800[_0x482c('0x48')]=_0x15fc22;return _0x2d3800;})['then'](respondWithFilteredResult(_0x36b00d,_0x3e9b22))[_0x482c('0x49')](handleError(_0x36b00d,null));};exports[_0x482c('0x4a')]=function(_0x393ca2,_0xdd4d9d){var _0xcbe404={'raw':!![],'where':{'id':_0x393ca2[_0x482c('0x4b')]['id']}},_0x3dd8a2={};_0x3dd8a2['model']=_['keys'](db[_0x482c('0x31')][_0x482c('0x32')]);_0x3dd8a2[_0x482c('0x36')]=_['keys'](_0x393ca2[_0x482c('0x36')]);_0x3dd8a2['filters']=_[_0x482c('0x3b')](_0x3dd8a2[_0x482c('0x39')],_0x3dd8a2[_0x482c('0x36')]);_0xcbe404[_0x482c('0x3a')]=_['intersection'](_0x3dd8a2[_0x482c('0x39')],qs[_0x482c('0x3c')](_0x393ca2[_0x482c('0x36')]['fields']));_0xcbe404[_0x482c('0x3a')]=_0xcbe404[_0x482c('0x3a')][_0x482c('0x4c')]?_0xcbe404['attributes']:_0x3dd8a2['model'];if(_0x393ca2['query']['includeAll']){_0xcbe404['include']=[{'all':!![]}];}_0xcbe404=_['merge']({},_0xcbe404,_0x393ca2[_0x482c('0x44')]);return db['Disposition'][_0x482c('0x4d')](_0xcbe404)[_0x482c('0x27')](handleEntityNotFound(_0xdd4d9d,null))[_0x482c('0x27')](respondWithResult(_0xdd4d9d,null))[_0x482c('0x49')](handleError(_0xdd4d9d,null));};exports[_0x482c('0x4e')]=function(_0x351eb4,_0x37be4f){return db[_0x482c('0x31')][_0x482c('0x4e')](_0x351eb4[_0x482c('0x4f')],{})[_0x482c('0x27')](function(_0x3f7ff7){var _0x1126b7=_0x351eb4[_0x482c('0x50')][_0x482c('0x51')]({'plain':!![]});if(!_0x1126b7)throw new Error(_0x482c('0x52'));if(_0x1126b7[_0x482c('0x53')]===_0x482c('0x50')){var _0x26e50b=_0x3f7ff7['get']({'plain':!![]});var _0x107b1b=_0x482c('0x29');return db['UserProfileSection'][_0x482c('0x4d')]({'where':{'name':_0x107b1b,'userProfileId':_0x1126b7[_0x482c('0x54')]},'raw':!![]})[_0x482c('0x27')](function(_0x170310){if(_0x170310&&_0x170310[_0x482c('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x26e50b[_0x482c('0x2d')],'resourceId':_0x26e50b['id'],'type':_0x170310[_0x482c('0x2d')],'sectionId':_0x170310['id']},{})[_0x482c('0x27')](function(){return _0x3f7ff7;});}else{return _0x3f7ff7;}})[_0x482c('0x49')](function(_0x257ece){logger[_0x482c('0x2c')](_0x482c('0x56'),_0x257ece);throw _0x257ece;});}return _0x3f7ff7;})['then'](respondWithResult(_0x37be4f,0xc9))['catch'](handleError(_0x37be4f,null));};exports['update']=function(_0x461947,_0x37549d){if(_0x461947[_0x482c('0x4f')]['id']){delete _0x461947[_0x482c('0x4f')]['id'];}return db[_0x482c('0x31')][_0x482c('0x4d')]({'where':{'id':_0x461947[_0x482c('0x4b')]['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x37549d,null))[_0x482c('0x27')](saveUpdates(_0x461947[_0x482c('0x4f')],null))[_0x482c('0x27')](respondWithResult(_0x37549d,null))['catch'](handleError(_0x37549d,null));};exports[_0x482c('0x28')]=function(_0x3e7c52,_0x1fe26e){return db[_0x482c('0x31')][_0x482c('0x4d')]({'where':{'id':_0x3e7c52[_0x482c('0x4b')]['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x1fe26e,null))[_0x482c('0x27')](removeEntity(_0x1fe26e,null))[_0x482c('0x49')](handleError(_0x1fe26e,null));};
\ No newline at end of file
index 54700d2..f786952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd416=['path','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment'];(function(_0x1468e6,_0xd02460){var _0x5a0161=function(_0x57a8e1){while(--_0x57a8e1){_0x1468e6['push'](_0x1468e6['shift']());}};_0x5a0161(++_0xd02460);}(_0xd416,0x13d));var _0x6d41=function(_0x20216e,_0x71e2d9){_0x20216e=_0x20216e-0x0;var _0x19cde9=_0xd416[_0x20216e];return _0x19cde9;};'use strict';var _=require(_0x6d41('0x0'));var util=require(_0x6d41('0x1'));var logger=require(_0x6d41('0x2'))(_0x6d41('0x3'));var moment=require(_0x6d41('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d41('0x5'));var rimraf=require('rimraf');var config=require(_0x6d41('0x6'));var attributes=require(_0x6d41('0x7'));module[_0x6d41('0x8')]=function(_0x46fc8b,_0x577235){return _0x46fc8b[_0x6d41('0x9')]('Disposition',attributes,{'tableName':_0x6d41('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6d41('0xb'),'fields':[_0x6d41('0xc'),_0x6d41('0xd')]},{'unique':!![],'name':_0x6d41('0xe'),'fields':[_0x6d41('0xc'),'ChatWebsiteId']},{'unique':!![],'name':_0x6d41('0xf'),'fields':[_0x6d41('0xc'),_0x6d41('0x10')]},{'unique':!![],'name':_0x6d41('0x11'),'fields':[_0x6d41('0xc'),_0x6d41('0x12')]},{'unique':!![],'name':_0x6d41('0x13'),'fields':[_0x6d41('0xc'),'FaxAccountId']},{'unique':!![],'name':_0x6d41('0x14'),'fields':['name',_0x6d41('0x15')]},{'unique':!![],'name':_0x6d41('0x16'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8857=['tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','Disposition'];(function(_0x5463b1,_0x238edb){var _0x1bf00f=function(_0x33110e){while(--_0x33110e){_0x5463b1['push'](_0x5463b1['shift']());}};_0x1bf00f(++_0x238edb);}(_0x8857,0x74));var _0x7885=function(_0x485d53,_0x15b471){_0x485d53=_0x485d53-0x0;var _0x208411=_0x8857[_0x485d53];return _0x208411;};'use strict';var _=require(_0x7885('0x0'));var util=require(_0x7885('0x1'));var logger=require(_0x7885('0x2'))(_0x7885('0x3'));var moment=require(_0x7885('0x4'));var BPromise=require('bluebird');var rp=require(_0x7885('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7885('0x6'));var config=require(_0x7885('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0x2651b6,_0x1d8e8c){return _0x2651b6[_0x7885('0x8')](_0x7885('0x9'),attributes,{'tableName':_0x7885('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x7885('0xb')]},{'unique':!![],'name':_0x7885('0xc'),'fields':[_0x7885('0xd'),_0x7885('0xe')]},{'unique':!![],'name':_0x7885('0xf'),'fields':[_0x7885('0xd'),_0x7885('0x10')]},{'unique':!![],'name':'name_sms','fields':[_0x7885('0xd'),_0x7885('0x11')]},{'unique':!![],'name':_0x7885('0x12'),'fields':[_0x7885('0xd'),_0x7885('0x13')]},{'unique':!![],'name':'name_openchannel','fields':[_0x7885('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x7885('0x14'),'fields':[_0x7885('0xd'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
index cd55fe6..e02b776 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(_0xa473de,_0x31dcf6){var _0x471dd5=function(_0x4dd081){while(--_0x4dd081){_0xa473de['push'](_0xa473de['shift']());}};_0x471dd5(++_0x31dcf6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x3c8c6f,_0x445ad1){var _0x2f0436=function(_0x524e22){while(--_0x524e22){_0x3c8c6f['push'](_0x3c8c6f['shift']());}};_0x2f0436(++_0x445ad1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 3dfc23d..af90376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb4c=['update','destroy','util','express','fs-extra','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xcb4c,0xdf));var _0xccb4=function(_0x19fbdc,_0x2e1d6a){_0x19fbdc=_0x19fbdc-0x0;var _0x176533=_0xcb4c[_0x19fbdc];return _0x176533;};'use strict';var multer=require('multer');var util=require(_0xccb4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xccb4('0x1'));var router=express['Router']();var fs_extra=require(_0xccb4('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xccb4('0x3'));var config=require('../../config/environment');var controller=require(_0xccb4('0x4'));router[_0xccb4('0x5')]('/',auth[_0xccb4('0x6')](),controller[_0xccb4('0x7')]);router['get'](_0xccb4('0x8'),auth['isAuthenticated'](),controller[_0xccb4('0x9')]);router[_0xccb4('0xa')]('/',auth[_0xccb4('0x6')](),controller['create']);router['put'](_0xccb4('0x8'),auth[_0xccb4('0x6')](),controller[_0xccb4('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xccb4('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x4be7=['update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x54c327,_0x321118){var _0x1e380c=function(_0x6304f){while(--_0x6304f){_0x54c327['push'](_0x54c327['shift']());}};_0x1e380c(++_0x321118);}(_0x4be7,0x93));var _0x74be=function(_0x1b33bc,_0x282af6){_0x1b33bc=_0x1b33bc-0x0;var _0x23b81c=_0x4be7[_0x1b33bc];return _0x23b81c;};'use strict';var multer=require('multer');var util=require(_0x74be('0x0'));var path=require('path');var timeout=require(_0x74be('0x1'));var express=require('express');var router=express[_0x74be('0x2')]();var fs_extra=require(_0x74be('0x3'));var auth=require(_0x74be('0x4'));var interaction=require(_0x74be('0x5'));var config=require(_0x74be('0x6'));var controller=require(_0x74be('0x7'));router[_0x74be('0x8')]('/',auth[_0x74be('0x9')](),controller[_0x74be('0xa')]);router[_0x74be('0x8')](_0x74be('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x74be('0xc')]('/',auth[_0x74be('0x9')](),controller[_0x74be('0xd')]);router[_0x74be('0xe')](_0x74be('0xb'),auth[_0x74be('0x9')](),controller[_0x74be('0xf')]);router[_0x74be('0x10')](_0x74be('0xb'),auth[_0x74be('0x9')](),controller[_0x74be('0x11')]);module['exports']=router;
\ No newline at end of file
index 184f91d..696f8a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2551=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','9600','12000','14400','7200','INTEGER','SIP','DADHI','KHOMP','TEXT'];(function(_0x1a678f,_0x2ca317){var _0x280953=function(_0x5dc221){while(--_0x5dc221){_0x1a678f['push'](_0x1a678f['shift']());}};_0x280953(++_0x2ca317);}(_0x2551,0x9d));var _0x1255=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0x2551[_0x186d17];return _0x5d4b89;};'use strict';var Sequelize=require(_0x1255('0x0'));module[_0x1255('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1255('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x1255('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x1255('0x2')],'defaultValue':_0x1255('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x1255('0x5')},'minrate':{'type':Sequelize[_0x1255('0x6')](_0x1255('0x7'),_0x1255('0x8'),'7200',_0x1255('0x9'),_0x1255('0xa'),_0x1255('0xb')),'defaultValue':_0x1255('0x8')},'maxrate':{'type':Sequelize[_0x1255('0x6')](_0x1255('0x7'),_0x1255('0x8'),_0x1255('0xc'),_0x1255('0x9'),'12000','14400'),'defaultValue':_0x1255('0xb')},'modem':{'type':Sequelize[_0x1255('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x1255('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1255('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1255('0x6')](_0x1255('0xe'),'IAX',_0x1255('0xf'),_0x1255('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x1255('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1255('0x11')],'defaultValue':function(){return _0x1255('0x12');}},'notificationSound':{'type':Sequelize[_0x1255('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1255('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1255('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1255('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1255('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1255('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1255('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x1255('0x13')],'defaultValue':![],'comment':_0x1255('0x15'),'set':function(_0x192f75){if(!_0x192f75)this[_0x1255('0x16')](_0x1255('0x17'),null);this[_0x1255('0x16')](_0x1255('0x18'),_0x192f75);}}};
\ No newline at end of file
+var _0x8411=['9600','12000','ENUM','14400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes','localstationid','4800','7200'];(function(_0x53c861,_0x140c9c){var _0x417b7b=function(_0x495754){while(--_0x495754){_0x53c861['push'](_0x53c861['shift']());}};_0x417b7b(++_0x140c9c);}(_0x8411,0x9a));var _0x1841=function(_0x484c11,_0x40c1db){_0x484c11=_0x484c11-0x0;var _0x31b64a=_0x8411[_0x484c11];return _0x31b64a;};'use strict';var Sequelize=require('sequelize');module[_0x1841('0x0')]={'name':{'type':Sequelize[_0x1841('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x1841('0x2')},'headerinfo':{'type':Sequelize[_0x1841('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x1841('0x1')],'unique':_0x1841('0x3')},'minrate':{'type':Sequelize['ENUM']('2400',_0x1841('0x4'),_0x1841('0x5'),_0x1841('0x6'),_0x1841('0x7'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x1841('0x8')]('2400',_0x1841('0x4'),'7200',_0x1841('0x6'),_0x1841('0x7'),_0x1841('0x9')),'defaultValue':_0x1841('0x9')},'modem':{'type':Sequelize[_0x1841('0x1')],'defaultValue':_0x1841('0xa')},'gateway':{'type':Sequelize[_0x1841('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1841('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1841('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x1841('0xc'),'IAX',_0x1841('0xd'),_0x1841('0xe')),'defaultValue':_0x1841('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1841('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1841('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1841('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1841('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1841('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1841('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4185ae){if(!_0x4185ae)this[_0x1841('0x11')](_0x1841('0x12'),null);this[_0x1841('0x11')](_0x1841('0x13'),_0x4185ae);}}};
\ No newline at end of file
index b53eb0f..c592112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8f2=['Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','getApplications','from-voip-provider','exten','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','bulkCreate','updateAccountApplications','VoiceExtension','ListId','getMessages','FaxMessage','$gte','split','format','CmList','List','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','info','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','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','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','FaxAccount','includeAll','include','findAll','rows','show','params','keys','create','body','user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','omit','getInteractions','CmContact','User'];(function(_0x31422b,_0x3d6b39){var _0x13b2af=function(_0xef60d1){while(--_0xef60d1){_0x31422b['push'](_0x31422b['shift']());}};_0x13b2af(++_0x3d6b39);}(_0xe8f2,0x102));var _0x2e8f=function(_0x258a1b,_0x36dffe){_0x258a1b=_0x258a1b-0x0;var _0x3deb08=_0xe8f2[_0x258a1b];return _0x3deb08;};'use strict';var emlformat=require(_0x2e8f('0x0'));var rimraf=require(_0x2e8f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2e8f('0x2'));var moment=require(_0x2e8f('0x3'));var BPromise=require(_0x2e8f('0x4'));var Mustache=require(_0x2e8f('0x5'));var util=require(_0x2e8f('0x6'));var path=require('path');var sox=require(_0x2e8f('0x7'));var csv=require(_0x2e8f('0x8'));var ejs=require(_0x2e8f('0x9'));var fs=require('fs');var fs_extra=require(_0x2e8f('0xa'));var _=require('lodash');var squel=require(_0x2e8f('0xb'));var crypto=require(_0x2e8f('0xc'));var jsforce=require(_0x2e8f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2e8f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2e8f('0xe'));var authService=require(_0x2e8f('0xf'));var qs=require(_0x2e8f('0x10'));var as=require(_0x2e8f('0x11'));var hardwareService=require(_0x2e8f('0x12'));var logger=require(_0x2e8f('0x13'))(_0x2e8f('0x14'));var utils=require(_0x2e8f('0x15'));var config=require(_0x2e8f('0x16'));var licenseUtil=require(_0x2e8f('0x17'));var db=require(_0x2e8f('0x18'))['db'];config[_0x2e8f('0x19')]=_[_0x2e8f('0x1a')](config[_0x2e8f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e8f('0x1b'))(new Redis(config[_0x2e8f('0x19')]));require('./faxAccount.socket')[_0x2e8f('0x1c')](socket);var jayson=require(_0x2e8f('0x1d'));var client=jayson['client'][_0x2e8f('0x1e')]({'port':0x232c});var client9002=jayson[_0x2e8f('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e7918,_0x69aa69,_0x159fa1,_0x93b4c5){return new BPromise(function(_0xc43651,_0xddf1ab){var _0x1e374c=_0x93b4c5||client;return _0x1e374c['request'](_0x5e7918,_0x159fa1)[_0x2e8f('0x20')](function(_0x9e2ab6){logger['info'](_0x2e8f('0x21'),_0x69aa69,_0x2e8f('0x22'));logger[_0x2e8f('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x69aa69,_0x2e8f('0x22'),JSON[_0x2e8f('0x24')](_0x9e2ab6));if(_0x9e2ab6[_0x2e8f('0x25')]){if(_0x9e2ab6[_0x2e8f('0x25')][_0x2e8f('0x26')]===0x1f4){logger['error'](_0x2e8f('0x21'),_0x69aa69,_0x9e2ab6['error']['message']);return _0xddf1ab(_0x9e2ab6[_0x2e8f('0x25')][_0x2e8f('0x27')]);}logger[_0x2e8f('0x25')](_0x2e8f('0x21'),_0x69aa69,_0x9e2ab6['error']['message']);return _0xc43651(_0x9e2ab6[_0x2e8f('0x25')][_0x2e8f('0x27')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x69aa69,_0x2e8f('0x22'));_0xc43651(_0x9e2ab6[_0x2e8f('0x28')]['message']);}})[_0x2e8f('0x29')](function(_0x1c34a7){logger[_0x2e8f('0x25')](_0x2e8f('0x21'),_0x69aa69,_0x1c34a7);_0xddf1ab(_0x1c34a7);});});}function respondWithStatusCode(_0xb0144b,_0x221789){_0x221789=_0x221789||0xcc;return function(_0x372b7b){if(_0x372b7b){return _0xb0144b[_0x2e8f('0x2a')](_0x221789);}return _0xb0144b['status'](_0x221789)[_0x2e8f('0x2b')]();};}function respondWithResult(_0x2f39c4,_0x57a63d){_0x57a63d=_0x57a63d||0xc8;return function(_0x31eb7d){if(_0x31eb7d){return _0x2f39c4[_0x2e8f('0x2c')](_0x57a63d)[_0x2e8f('0x2d')](_0x31eb7d);}};}function respondWithFilteredResult(_0x1ebc6d,_0x54897a){return function(_0x4a43f9){if(_0x4a43f9){var _0x1f4fa1=typeof _0x54897a['offset']==='undefined'&&typeof _0x54897a[_0x2e8f('0x2e')]===_0x2e8f('0x2f');var _0x4080d2=_0x4a43f9[_0x2e8f('0x30')];var _0x36d70a=_0x1f4fa1?0x0:_0x54897a[_0x2e8f('0x31')];var _0x4c1fe=_0x1f4fa1?_0x4a43f9[_0x2e8f('0x30')]:_0x54897a[_0x2e8f('0x31')]+_0x54897a[_0x2e8f('0x2e')];var _0x41caca;if(_0x4c1fe>=_0x4080d2){_0x4c1fe=_0x4080d2;_0x41caca=0xc8;}else{_0x41caca=0xce;}_0x1ebc6d['status'](_0x41caca);return _0x1ebc6d[_0x2e8f('0x32')](_0x2e8f('0x33'),_0x36d70a+'-'+_0x4c1fe+'/'+_0x4080d2)[_0x2e8f('0x2d')](_0x4a43f9);}return null;};}function patchUpdates(_0xf7b410){return function(_0x3543e4){try{jsonpatch['apply'](_0x3543e4,_0xf7b410,!![]);}catch(_0x4f5872){return BPromise['reject'](_0x4f5872);}return _0x3543e4['save']();};}function saveUpdates(_0x40f087,_0x19e433){return function(_0x4079ac){if(_0x4079ac){return _0x4079ac[_0x2e8f('0x34')](_0x40f087)['then'](function(_0x3e0f5d){return _0x3e0f5d;});}return null;};}function removeEntity(_0x112e3a,_0x38a605){return function(_0x2c0949){if(_0x2c0949){return _0x2c0949[_0x2e8f('0x35')]()[_0x2e8f('0x20')](function(){var _0x1e6cec=_0x2c0949[_0x2e8f('0x36')]({'plain':!![]});var _0x60e382=_0x2e8f('0x37');return db[_0x2e8f('0x38')]['destroy']({'where':{'type':_0x60e382,'resourceId':_0x1e6cec['id']}})[_0x2e8f('0x20')](function(){return _0x2c0949;});})[_0x2e8f('0x20')](function(){_0x112e3a[_0x2e8f('0x2c')](0xcc)[_0x2e8f('0x2b')]();});}};}function handleEntityNotFound(_0x1e5804,_0x841c91){return function(_0x4fbee2){if(!_0x4fbee2){_0x1e5804['sendStatus'](0x194);}return _0x4fbee2;};}function handleError(_0x282816,_0x1832bd){_0x1832bd=_0x1832bd||0x1f4;return function(_0x18464e){logger[_0x2e8f('0x25')](_0x18464e[_0x2e8f('0x39')]);if(_0x18464e[_0x2e8f('0x3a')]){delete _0x18464e['name'];}_0x282816[_0x2e8f('0x2c')](_0x1832bd)[_0x2e8f('0x3b')](_0x18464e);};}exports[_0x2e8f('0x3c')]=function(_0x481c8d,_0x43a89e){var _0x1a8f3c={'include':[{'model':db[_0x2e8f('0x3d')],'as':_0x2e8f('0x3e')}]},_0x5686a0={},_0x22c83c={'count':0x0,'rows':[]};var _0x3f138f=_['map'](db['FaxAccount'][_0x2e8f('0x3f')],function(_0x323e39){return{'name':_0x323e39[_0x2e8f('0x40')],'type':_0x323e39[_0x2e8f('0x41')][_0x2e8f('0x42')]};});_0x5686a0['model']=_[_0x2e8f('0x43')](_0x3f138f,'name');_0x5686a0[_0x2e8f('0x44')]=_['keys'](_0x481c8d['query']);_0x5686a0[_0x2e8f('0x45')]=_['intersection'](_0x5686a0[_0x2e8f('0x46')],_0x5686a0['query']);_0x1a8f3c[_0x2e8f('0x47')]=_[_0x2e8f('0x48')](_0x5686a0[_0x2e8f('0x46')],qs['fields'](_0x481c8d[_0x2e8f('0x44')][_0x2e8f('0x49')]));_0x1a8f3c['attributes']=_0x1a8f3c[_0x2e8f('0x47')][_0x2e8f('0x4a')]?_0x1a8f3c[_0x2e8f('0x47')]:_0x5686a0[_0x2e8f('0x46')];if(!_0x481c8d[_0x2e8f('0x44')][_0x2e8f('0x4b')](_0x2e8f('0x4c'))){_0x1a8f3c['limit']=qs[_0x2e8f('0x2e')](_0x481c8d['query'][_0x2e8f('0x2e')]);_0x1a8f3c[_0x2e8f('0x31')]=qs[_0x2e8f('0x31')](_0x481c8d[_0x2e8f('0x44')][_0x2e8f('0x31')]);}_0x1a8f3c['order']=qs[_0x2e8f('0x4d')](_0x481c8d[_0x2e8f('0x44')][_0x2e8f('0x4d')]);_0x1a8f3c['where']=qs[_0x2e8f('0x45')](_[_0x2e8f('0x4e')](_0x481c8d['query'],_0x5686a0[_0x2e8f('0x45')]),_0x3f138f);if(_0x481c8d[_0x2e8f('0x44')][_0x2e8f('0x4f')]){_0x1a8f3c[_0x2e8f('0x50')]=_[_0x2e8f('0x51')](_0x1a8f3c[_0x2e8f('0x50')],{'$or':_['map'](_0x3f138f,function(_0x238c80){if(_0x238c80['type']!=='VIRTUAL'){var _0x277329={};_0x277329[_0x238c80[_0x2e8f('0x3a')]]={'$like':'%'+_0x481c8d['query']['filter']+'%'};return _0x277329;}})});}_0x1a8f3c=_['merge']({},_0x1a8f3c,_0x481c8d[_0x2e8f('0x52')]);var _0xcc2647={'where':_0x1a8f3c[_0x2e8f('0x50')]};return db[_0x2e8f('0x53')][_0x2e8f('0x30')](_0xcc2647)[_0x2e8f('0x20')](function(_0x7c8a5c){_0x22c83c[_0x2e8f('0x30')]=_0x7c8a5c;if(_0x481c8d[_0x2e8f('0x44')][_0x2e8f('0x54')]){_0x1a8f3c[_0x2e8f('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0x2e8f('0x56')](_0x1a8f3c);})[_0x2e8f('0x20')](function(_0xba749c){_0x22c83c[_0x2e8f('0x57')]=_0xba749c;return _0x22c83c;})[_0x2e8f('0x20')](respondWithFilteredResult(_0x43a89e,_0x1a8f3c))[_0x2e8f('0x29')](handleError(_0x43a89e,null));};exports[_0x2e8f('0x58')]=function(_0xea18c2,_0x4c1728){var _0x170176={'raw':![],'where':{'id':_0xea18c2[_0x2e8f('0x59')]['id']},'include':[{'model':db[_0x2e8f('0x3d')],'as':_0x2e8f('0x3e')}]},_0x599f50={};_0x599f50[_0x2e8f('0x46')]=_[_0x2e8f('0x5a')](db[_0x2e8f('0x53')]['rawAttributes']);_0x599f50[_0x2e8f('0x44')]=_['keys'](_0xea18c2[_0x2e8f('0x44')]);_0x599f50[_0x2e8f('0x45')]=_[_0x2e8f('0x48')](_0x599f50[_0x2e8f('0x46')],_0x599f50[_0x2e8f('0x44')]);_0x170176['attributes']=_[_0x2e8f('0x48')](_0x599f50[_0x2e8f('0x46')],qs[_0x2e8f('0x49')](_0xea18c2['query'][_0x2e8f('0x49')]));_0x170176['attributes']=_0x170176['attributes'][_0x2e8f('0x4a')]?_0x170176[_0x2e8f('0x47')]:_0x599f50[_0x2e8f('0x46')];if(_0xea18c2[_0x2e8f('0x44')]['includeAll']){_0x170176[_0x2e8f('0x55')]=[{'all':!![]}];}_0x170176=_[_0x2e8f('0x51')]({},_0x170176,_0xea18c2[_0x2e8f('0x52')]);return db[_0x2e8f('0x53')]['find'](_0x170176)[_0x2e8f('0x20')](handleEntityNotFound(_0x4c1728,null))[_0x2e8f('0x20')](respondWithResult(_0x4c1728,null))[_0x2e8f('0x29')](handleError(_0x4c1728,null));};exports[_0x2e8f('0x5b')]=function(_0x11ac54,_0x1c2b49){return db['FaxAccount']['create'](_0x11ac54[_0x2e8f('0x5c')],{})[_0x2e8f('0x20')](function(_0x345725){var _0x491caa=_0x11ac54[_0x2e8f('0x5d')][_0x2e8f('0x36')]({'plain':!![]});if(!_0x491caa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x491caa['role']===_0x2e8f('0x5d')){var _0x282a52=_0x345725['get']({'plain':!![]});var _0xf5e2a8=_0x2e8f('0x37');return db['UserProfileSection'][_0x2e8f('0x5e')]({'where':{'name':_0xf5e2a8,'userProfileId':_0x491caa[_0x2e8f('0x5f')]},'raw':!![]})[_0x2e8f('0x20')](function(_0x1bc278){if(_0x1bc278&&_0x1bc278['autoAssociation']===0x0){return db[_0x2e8f('0x38')][_0x2e8f('0x5b')]({'name':_0x282a52[_0x2e8f('0x3a')],'resourceId':_0x282a52['id'],'type':_0x1bc278[_0x2e8f('0x3a')],'sectionId':_0x1bc278['id']},{})[_0x2e8f('0x20')](function(){return _0x345725;});}else{return _0x345725;}})[_0x2e8f('0x29')](function(_0x34e667){logger[_0x2e8f('0x25')](_0x2e8f('0x60'),_0x34e667);throw _0x34e667;});}return _0x345725;})[_0x2e8f('0x20')](respondWithResult(_0x1c2b49,0xc9))[_0x2e8f('0x29')](handleError(_0x1c2b49,null));};exports[_0x2e8f('0x34')]=function(_0x1bb542,_0x5355d6){if(_0x1bb542[_0x2e8f('0x5c')]['id']){delete _0x1bb542[_0x2e8f('0x5c')]['id'];}return db[_0x2e8f('0x53')][_0x2e8f('0x5e')]({'where':{'id':_0x1bb542[_0x2e8f('0x59')]['id']},'include':[{'model':db[_0x2e8f('0x3d')],'as':_0x2e8f('0x3e')}]})['then'](handleEntityNotFound(_0x5355d6,null))['then'](saveUpdates(_0x1bb542['body'],null))[_0x2e8f('0x20')](respondWithResult(_0x5355d6,null))['catch'](handleError(_0x5355d6,null));};exports[_0x2e8f('0x35')]=function(_0x161df8,_0x4e934c){return db['FaxAccount'][_0x2e8f('0x5e')]({'where':{'id':_0x161df8[_0x2e8f('0x59')]['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x4e934c,null))[_0x2e8f('0x20')](removeEntity(_0x4e934c,null))[_0x2e8f('0x29')](handleError(_0x4e934c,null));};exports[_0x2e8f('0x61')]=function(_0x268cb0,_0x31593e){return db[_0x2e8f('0x53')][_0x2e8f('0x61')]()[_0x2e8f('0x20')](respondWithResult(_0x31593e,null))[_0x2e8f('0x29')](handleError(_0x31593e,null));};exports['addDisposition']=function(_0x9e7ed4,_0x1a319d,_0x2bccff){if(_0x9e7ed4[_0x2e8f('0x5c')]['id']){delete _0x9e7ed4[_0x2e8f('0x5c')]['id'];}return db[_0x2e8f('0x53')]['find']({'where':{'id':_0x9e7ed4['params']['id']}})['then'](handleEntityNotFound(_0x1a319d,null))[_0x2e8f('0x20')](function(_0x42d84f){if(_0x42d84f){_0x9e7ed4['body'][_0x2e8f('0x62')]=_0x42d84f['id'];return db[_0x2e8f('0x63')][_0x2e8f('0x5b')](_0x9e7ed4['body']);}})[_0x2e8f('0x20')](respondWithResult(_0x1a319d,null))[_0x2e8f('0x29')](handleError(_0x1a319d,null));};exports[_0x2e8f('0x64')]=function(_0x1a260d,_0x3bec66,_0x1874f9){var _0x188a08={'raw':![],'where':{}};var _0x41047d={};var _0x51d7e6={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2e8f('0x65')]({'where':{'id':_0x1a260d['params']['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x3bec66,null))[_0x2e8f('0x20')](function(_0x3ff430){if(_0x3ff430){_0x41047d[_0x2e8f('0x46')]=_['keys'](db[_0x2e8f('0x63')][_0x2e8f('0x3f')]);_0x41047d[_0x2e8f('0x44')]=_['keys'](_0x1a260d[_0x2e8f('0x44')]);_0x41047d[_0x2e8f('0x45')]=_['intersection'](_0x41047d[_0x2e8f('0x46')],_0x41047d['query']);_0x188a08[_0x2e8f('0x47')]=_[_0x2e8f('0x48')](_0x41047d[_0x2e8f('0x46')],qs[_0x2e8f('0x49')](_0x1a260d[_0x2e8f('0x44')][_0x2e8f('0x49')]));_0x188a08['attributes']=_0x188a08[_0x2e8f('0x47')][_0x2e8f('0x4a')]?_0x188a08[_0x2e8f('0x47')]:_0x41047d['model'];if(!_0x1a260d['query']['hasOwnProperty'](_0x2e8f('0x4c'))){_0x188a08[_0x2e8f('0x2e')]=qs[_0x2e8f('0x2e')](_0x1a260d['query'][_0x2e8f('0x2e')]);_0x188a08[_0x2e8f('0x31')]=qs[_0x2e8f('0x31')](_0x1a260d[_0x2e8f('0x44')]['offset']);}_0x188a08[_0x2e8f('0x66')]=qs[_0x2e8f('0x4d')](_0x1a260d[_0x2e8f('0x44')][_0x2e8f('0x4d')]);_0x188a08[_0x2e8f('0x50')]=qs['filters'](_['pick'](_0x1a260d[_0x2e8f('0x44')],_0x41047d['filters']));_0x188a08['where'][_0x2e8f('0x62')]=_0x3ff430['id'];if(_0x1a260d[_0x2e8f('0x44')][_0x2e8f('0x4f')]){_0x188a08[_0x2e8f('0x50')]=_[_0x2e8f('0x51')](_0x188a08[_0x2e8f('0x50')],{'$or':_[_0x2e8f('0x43')](_0x188a08[_0x2e8f('0x47')],function(_0x44b707){var _0x1da5da={};_0x1da5da[_0x44b707]={'$like':'%'+_0x1a260d[_0x2e8f('0x44')][_0x2e8f('0x4f')]+'%'};return _0x1da5da;})});}_0x188a08=_['merge']({},_0x188a08,_0x1a260d[_0x2e8f('0x52')]);return db[_0x2e8f('0x63')][_0x2e8f('0x30')]({'where':_0x188a08[_0x2e8f('0x50')]})[_0x2e8f('0x20')](function(_0xb21ad7){_0x51d7e6[_0x2e8f('0x30')]=_0xb21ad7;if(_0x1a260d[_0x2e8f('0x44')][_0x2e8f('0x54')]){_0x188a08[_0x2e8f('0x55')]=[{'all':!![]}];}return db[_0x2e8f('0x63')][_0x2e8f('0x56')](_0x188a08);})['then'](function(_0x2c5e6a){_0x51d7e6[_0x2e8f('0x57')]=_0x2c5e6a;return _0x51d7e6;});}})['then'](respondWithFilteredResult(_0x3bec66,_0x188a08))['catch'](handleError(_0x3bec66,null));};exports['removeDispositions']=function(_0x5072c4,_0x3b0ea8,_0x1343a6){return db[_0x2e8f('0x53')]['find']({'where':{'id':_0x5072c4[_0x2e8f('0x59')]['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x3b0ea8,null))[_0x2e8f('0x20')](function(_0x3bff7c){if(_0x3bff7c){return _0x3bff7c[_0x2e8f('0x67')](_0x5072c4[_0x2e8f('0x44')][_0x2e8f('0x68')]);}})['then'](respondWithStatusCode(_0x3b0ea8,null))[_0x2e8f('0x29')](handleError(_0x3b0ea8,null));};exports[_0x2e8f('0x69')]=function(_0x156dab,_0x52a8a1,_0x746fe9){if(_0x156dab[_0x2e8f('0x5c')]['id']){delete _0x156dab['body']['id'];}return db[_0x2e8f('0x53')][_0x2e8f('0x5e')]({'where':{'id':_0x156dab[_0x2e8f('0x59')]['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x52a8a1,null))[_0x2e8f('0x20')](function(_0x2c8aa5){if(_0x2c8aa5){_0x156dab[_0x2e8f('0x5c')][_0x2e8f('0x62')]=_0x2c8aa5['id'];return db[_0x2e8f('0x6a')][_0x2e8f('0x5b')](_0x156dab[_0x2e8f('0x5c')]);}})[_0x2e8f('0x20')](respondWithResult(_0x52a8a1,null))[_0x2e8f('0x29')](handleError(_0x52a8a1,null));};exports[_0x2e8f('0x6b')]=function(_0xf3b122,_0x21e053,_0x1ff99a){var _0x2176f2={'raw':![],'where':{}};var _0x1d2cfb={};var _0x3046e6={'count':0x0,'rows':[]};return db[_0x2e8f('0x53')][_0x2e8f('0x65')]({'where':{'id':_0xf3b122[_0x2e8f('0x59')]['id']}})['then'](handleEntityNotFound(_0x21e053,null))[_0x2e8f('0x20')](function(_0x4f71ab){if(_0x4f71ab){_0x1d2cfb[_0x2e8f('0x46')]=_[_0x2e8f('0x5a')](db['CannedAnswer'][_0x2e8f('0x3f')]);_0x1d2cfb[_0x2e8f('0x44')]=_['keys'](_0xf3b122['query']);_0x1d2cfb[_0x2e8f('0x45')]=_[_0x2e8f('0x48')](_0x1d2cfb['model'],_0x1d2cfb['query']);_0x2176f2[_0x2e8f('0x47')]=_['intersection'](_0x1d2cfb[_0x2e8f('0x46')],qs[_0x2e8f('0x49')](_0xf3b122['query'][_0x2e8f('0x49')]));_0x2176f2[_0x2e8f('0x47')]=_0x2176f2['attributes']['length']?_0x2176f2['attributes']:_0x1d2cfb[_0x2e8f('0x46')];if(!_0xf3b122[_0x2e8f('0x44')]['hasOwnProperty'](_0x2e8f('0x4c'))){_0x2176f2['limit']=qs[_0x2e8f('0x2e')](_0xf3b122['query']['limit']);_0x2176f2['offset']=qs['offset'](_0xf3b122[_0x2e8f('0x44')][_0x2e8f('0x31')]);}_0x2176f2[_0x2e8f('0x66')]=qs[_0x2e8f('0x4d')](_0xf3b122[_0x2e8f('0x44')][_0x2e8f('0x4d')]);_0x2176f2[_0x2e8f('0x50')]=qs[_0x2e8f('0x45')](_[_0x2e8f('0x4e')](_0xf3b122[_0x2e8f('0x44')],_0x1d2cfb[_0x2e8f('0x45')]));_0x2176f2[_0x2e8f('0x50')][_0x2e8f('0x62')]=_0x4f71ab['id'];if(_0xf3b122[_0x2e8f('0x44')][_0x2e8f('0x4f')]){_0x2176f2['where']=_[_0x2e8f('0x51')](_0x2176f2[_0x2e8f('0x50')],{'$or':_[_0x2e8f('0x43')](_0x2176f2[_0x2e8f('0x47')],function(_0x3a831a){var _0x11a77e={};_0x11a77e[_0x3a831a]={'$like':'%'+_0xf3b122[_0x2e8f('0x44')][_0x2e8f('0x4f')]+'%'};return _0x11a77e;})});}_0x2176f2=_[_0x2e8f('0x51')]({},_0x2176f2,_0xf3b122[_0x2e8f('0x52')]);return db[_0x2e8f('0x6a')][_0x2e8f('0x30')]({'where':_0x2176f2[_0x2e8f('0x50')]})['then'](function(_0x565ffc){_0x3046e6['count']=_0x565ffc;if(_0xf3b122[_0x2e8f('0x44')][_0x2e8f('0x54')]){_0x2176f2[_0x2e8f('0x55')]=[{'all':!![]}];}return db[_0x2e8f('0x6a')][_0x2e8f('0x56')](_0x2176f2);})[_0x2e8f('0x20')](function(_0x21f7f3){_0x3046e6[_0x2e8f('0x57')]=_0x21f7f3;return _0x3046e6;});}})[_0x2e8f('0x20')](respondWithFilteredResult(_0x21e053,_0x2176f2))[_0x2e8f('0x29')](handleError(_0x21e053,null));};exports['removeAnswers']=function(_0x545c5f,_0x18c593,_0x19cdd3){return db[_0x2e8f('0x53')][_0x2e8f('0x5e')]({'where':{'id':_0x545c5f[_0x2e8f('0x59')]['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x18c593,null))['then'](function(_0x47d817){if(_0x47d817){return _0x47d817[_0x2e8f('0x6c')](_0x545c5f['query'][_0x2e8f('0x68')]);}})['then'](respondWithStatusCode(_0x18c593,null))['catch'](handleError(_0x18c593,null));};exports['addInteraction']=function(_0x1becda,_0x39c793,_0x557e2e){return db[_0x2e8f('0x6d')]['find']({'where':{'id':_0x1becda['params']['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x39c793,null))[_0x2e8f('0x20')](function(_0x2a06f){if(_0x2a06f){return _0x2a06f['addInteraction'](_0x1becda[_0x2e8f('0x5c')][_0x2e8f('0x68')],_[_0x2e8f('0x6e')](_0x1becda[_0x2e8f('0x5c')],[_0x2e8f('0x68'),'id'])||{});}})[_0x2e8f('0x20')](respondWithResult(_0x39c793,null))[_0x2e8f('0x29')](handleError(_0x39c793,null));};exports[_0x2e8f('0x6f')]=function(_0x524128,_0x3d8a81,_0x13742c){var _0x2c3c52={'raw':![],'where':{}};var _0x50bcdb={};var _0x4bf2a1={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2e8f('0x65')]({'where':{'id':_0x524128['params']['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x3d8a81,null))[_0x2e8f('0x20')](function(_0x3ba89a){if(_0x3ba89a){_0x50bcdb[_0x2e8f('0x46')]=_[_0x2e8f('0x5a')](db[_0x2e8f('0x6d')]['rawAttributes']);_0x50bcdb[_0x2e8f('0x44')]=_[_0x2e8f('0x5a')](_0x524128[_0x2e8f('0x44')]);_0x50bcdb[_0x2e8f('0x45')]=_[_0x2e8f('0x48')](_0x50bcdb[_0x2e8f('0x46')],_0x50bcdb[_0x2e8f('0x44')]);_0x2c3c52[_0x2e8f('0x47')]=_[_0x2e8f('0x48')](_0x50bcdb['model'],qs[_0x2e8f('0x49')](_0x524128[_0x2e8f('0x44')][_0x2e8f('0x49')]));_0x2c3c52['attributes']=_0x2c3c52[_0x2e8f('0x47')][_0x2e8f('0x4a')]?_0x2c3c52[_0x2e8f('0x47')]:_0x50bcdb[_0x2e8f('0x46')];if(!_0x524128[_0x2e8f('0x44')][_0x2e8f('0x4b')]('nolimit')){_0x2c3c52['limit']=qs[_0x2e8f('0x2e')](_0x524128[_0x2e8f('0x44')][_0x2e8f('0x2e')]);_0x2c3c52[_0x2e8f('0x31')]=qs[_0x2e8f('0x31')](_0x524128['query'][_0x2e8f('0x31')]);}_0x2c3c52[_0x2e8f('0x66')]=qs[_0x2e8f('0x4d')](_0x524128['query'][_0x2e8f('0x4d')]);_0x2c3c52[_0x2e8f('0x50')]=qs[_0x2e8f('0x45')](_[_0x2e8f('0x4e')](_0x524128[_0x2e8f('0x44')],_0x50bcdb['filters']));_0x2c3c52[_0x2e8f('0x50')]['FaxAccountId']=_0x3ba89a['id'];if(_0x524128[_0x2e8f('0x44')][_0x2e8f('0x4f')]){_0x2c3c52[_0x2e8f('0x50')]=_[_0x2e8f('0x51')](_0x2c3c52[_0x2e8f('0x50')],{'$or':_[_0x2e8f('0x43')](_0x2c3c52[_0x2e8f('0x47')],function(_0x266e77){var _0x20011a={};_0x20011a[_0x266e77]={'$like':'%'+_0x524128[_0x2e8f('0x44')]['filter']+'%'};return _0x20011a;})});}_0x2c3c52=_[_0x2e8f('0x51')]({},_0x2c3c52,_0x524128[_0x2e8f('0x52')]);return db[_0x2e8f('0x6d')][_0x2e8f('0x30')]({'where':_0x2c3c52[_0x2e8f('0x50')]})[_0x2e8f('0x20')](function(_0xb88bd8){_0x4bf2a1[_0x2e8f('0x30')]=_0xb88bd8;if(_0x524128[_0x2e8f('0x44')][_0x2e8f('0x54')]){_0x2c3c52[_0x2e8f('0x55')]=[{'model':db[_0x2e8f('0x70')],'as':'Contact','required':![]},{'model':db[_0x2e8f('0x71')],'as':_0x2e8f('0x72'),'attributes':['name','fullname',_0x2e8f('0x73')],'required':![]},{'model':db[_0x2e8f('0x74')],'as':_0x2e8f('0x75'),'attributes':['id',_0x2e8f('0x3a'),_0x2e8f('0x76')],'where':_0x524128[_0x2e8f('0x44')][_0x2e8f('0x77')]?{'id':_0x524128[_0x2e8f('0x44')][_0x2e8f('0x77')]}:undefined,'required':_0x524128['query'][_0x2e8f('0x77')]?!![]:![]}];}return db['FaxInteraction'][_0x2e8f('0x56')](_0x2c3c52);})[_0x2e8f('0x20')](function(_0x216fbb){_0x4bf2a1[_0x2e8f('0x57')]=_0x216fbb;return _0x4bf2a1;});}})[_0x2e8f('0x20')](respondWithFilteredResult(_0x3d8a81,_0x2c3c52))['catch'](handleError(_0x3d8a81,null));};exports[_0x2e8f('0x78')]=function(_0x31b5e2,_0x568828,_0x2ff3c0){return db[_0x2e8f('0x53')][_0x2e8f('0x65')]({'where':{'id':_0x31b5e2[_0x2e8f('0x59')]['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x568828,null))[_0x2e8f('0x20')](function(_0x658847){if(_0x658847){return db[_0x2e8f('0x79')][_0x2e8f('0x7a')](function(_0x48b662){return db[_0x2e8f('0x7b')][_0x2e8f('0x35')]({'where':{'FaxAccountId':_0x31b5e2['params']['id']},'transaction':_0x48b662})[_0x2e8f('0x20')](function(_0x1c8001){var _0x1ae8b0=_[_0x2e8f('0x43')](_0x31b5e2['body'],function(_0x30652f){_0x30652f[_0x2e8f('0x62')]=_0x31b5e2[_0x2e8f('0x59')]['id'];return _0x30652f;});return db[_0x2e8f('0x7b')]['bulkCreate'](_0x1ae8b0,{'transaction':_0x48b662});});})[_0x2e8f('0x20')](function(){return db[_0x2e8f('0x7b')]['findAndCountAll']({'where':{'FaxAccountId':_0x31b5e2[_0x2e8f('0x59')]['id']},'order':'priority'});});}})[_0x2e8f('0x20')](respondWithResult(_0x568828,null))['catch'](handleError(_0x568828,null));};exports['getApplications']=function(_0x478adb,_0x2e1462,_0x593452){var _0xf8a1df={};var _0x497ad2={};var _0x3b4d75;var _0x3fe872;return db[_0x2e8f('0x53')][_0x2e8f('0x65')]({'where':{'id':_0x478adb['params']['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x2e1462,null))[_0x2e8f('0x20')](function(_0x40928a){if(_0x40928a){_0x3b4d75=_0x40928a;_0x497ad2['model']=_[_0x2e8f('0x5a')](db[_0x2e8f('0x7b')]['rawAttributes']);_0x497ad2[_0x2e8f('0x44')]=_[_0x2e8f('0x5a')](_0x478adb['query']);_0x497ad2[_0x2e8f('0x45')]=_['intersection'](_0x497ad2['model'],_0x497ad2[_0x2e8f('0x44')]);_0xf8a1df['attributes']=_[_0x2e8f('0x48')](_0x497ad2[_0x2e8f('0x46')],qs[_0x2e8f('0x49')](_0x478adb['query'][_0x2e8f('0x49')]));_0xf8a1df[_0x2e8f('0x47')]=_0xf8a1df[_0x2e8f('0x47')][_0x2e8f('0x4a')]?_0xf8a1df[_0x2e8f('0x47')]:_0x497ad2[_0x2e8f('0x46')];_0xf8a1df[_0x2e8f('0x66')]=qs['sort'](_0x478adb['query'][_0x2e8f('0x4d')]);_0xf8a1df['where']=qs['filters'](_[_0x2e8f('0x4e')](_0x478adb['query'],_0x497ad2[_0x2e8f('0x45')]));if(_0x478adb[_0x2e8f('0x44')][_0x2e8f('0x4f')]){_0xf8a1df[_0x2e8f('0x50')]=_['merge'](_0xf8a1df['where'],{'$or':_[_0x2e8f('0x43')](_0xf8a1df[_0x2e8f('0x47')],function(_0x3395f2){var _0x96ff1d={};_0x96ff1d[_0x3395f2]={'$like':'%'+_0x478adb[_0x2e8f('0x44')]['filter']+'%'};return _0x96ff1d;})});}_0xf8a1df=_[_0x2e8f('0x51')]({},_0xf8a1df,_0x478adb['options']);return _0x3b4d75[_0x2e8f('0x7c')](_0xf8a1df);}})['then'](function(_0x4363ab){if(_0x4363ab){_0x3fe872=_0x4363ab[_0x2e8f('0x4a')];if(!_0x478adb[_0x2e8f('0x44')][_0x2e8f('0x4b')]('nolimit')){_0xf8a1df['limit']=qs[_0x2e8f('0x2e')](_0x478adb[_0x2e8f('0x44')][_0x2e8f('0x2e')]);_0xf8a1df[_0x2e8f('0x31')]=qs['offset'](_0x478adb[_0x2e8f('0x44')][_0x2e8f('0x31')]);}return _0x3b4d75[_0x2e8f('0x7c')](_0xf8a1df);}})[_0x2e8f('0x20')](function(_0x2b10bb){if(_0x2b10bb){return _0x2b10bb?{'count':_0x3fe872,'rows':_0x2b10bb}:null;}})[_0x2e8f('0x20')](respondWithResult(_0x2e1462,null))[_0x2e8f('0x29')](handleError(_0x2e1462,null));};function Extension(_0x3798b8,_0x125d9b,_0x4d0865,_0x520a45){this['context']=_0x2e8f('0x7d');this[_0x2e8f('0x7e')]=_0x3798b8['localstationid'];this[_0x2e8f('0x7f')]=_0x520a45;this[_0x2e8f('0x41')]=_0x2e8f('0x80');this[_0x2e8f('0x81')]=_0x2e8f('0x82');this['FaxAccountId']=_0x3798b8['id'];this[_0x2e8f('0x83')]=_0x125d9b;this[_0x2e8f('0x84')]=_0x4d0865;}function createExtensionsReciveFax(_0x32e546){var _0x1ce56b=0x1;var _0x22e014=[];_0x22e014[_0x2e8f('0x85')](new Extension(_0x32e546,_0x1ce56b,'',_0x2e8f('0x86')));_0x1ce56b+=0x1;_0x22e014['push'](new Extension(_0x32e546,_0x1ce56b,_0x2e8f('0x87'),_0x2e8f('0x88')));_0x1ce56b+=0x1;for(var _0x414ef9 in _0x32e546){if(_0x32e546[_0x2e8f('0x4b')](_0x414ef9)&&(_0x414ef9===_0x2e8f('0x89')||_0x414ef9===_0x2e8f('0x8a')||_0x414ef9===_0x2e8f('0x8b')||_0x414ef9==='faxdetect'||_0x414ef9===_0x2e8f('0x8c')||_0x414ef9===_0x2e8f('0x8d')||_0x414ef9===_0x2e8f('0x8e')||_0x414ef9===_0x2e8f('0x8f')||_0x414ef9===_0x2e8f('0x90'))){_0x22e014[_0x2e8f('0x85')](new Extension(_0x32e546,_0x1ce56b,_0x2e8f('0x91')+_0x414ef9+')='+_0x32e546[_0x414ef9],_0x2e8f('0x88')));_0x1ce56b+=0x1;}}_0x22e014[_0x2e8f('0x85')](new Extension(_0x32e546,_0x1ce56b,'6','Wait'));_0x1ce56b+=0x1;_0x22e014[_0x2e8f('0x85')](new Extension(_0x32e546,_0x1ce56b,_0x2e8f('0x92'),_0x2e8f('0x93')));_0x1ce56b=0x0;return _0x22e014;}exports['addAccountApplications']=function(_0x4881e2,_0x1f9d50,_0x45768b){var _0x458474;return db[_0x2e8f('0x79')][_0x2e8f('0x7a')](function(_0x54354f){return db[_0x2e8f('0x53')][_0x2e8f('0x5b')](_0x4881e2[_0x2e8f('0x5c')],{'transaction':_0x54354f})[_0x2e8f('0x20')](function(_0x5a9b41){_0x458474=_0x5a9b41[_0x2e8f('0x36')]({'plain':!![]});return db['VoiceExtension'][_0x2e8f('0x94')](createExtensionsReciveFax(_0x458474),{'transaction':_0x54354f});});})['then'](function(){return _0x458474;})[_0x2e8f('0x20')](respondWithResult(_0x1f9d50,null))[_0x2e8f('0x29')](handleError(_0x1f9d50,null));};exports[_0x2e8f('0x95')]=function(_0x132016,_0x46b67b,_0xcf4122){var _0x219080;return db['sequelize']['transaction'](function(_0x31f436){return db[_0x2e8f('0x53')][_0x2e8f('0x34')](_0x132016[_0x2e8f('0x5c')],{'where':{'id':_0x132016[_0x2e8f('0x5c')]['id']},'transaction':_0x31f436})[_0x2e8f('0x20')](function(_0xde696f){return db[_0x2e8f('0x96')][_0x2e8f('0x35')]({'where':{'FaxAccountId':_0x132016[_0x2e8f('0x5c')]['id']},'transaction':_0x31f436})['then'](function(_0x7c4215){return db[_0x2e8f('0x96')][_0x2e8f('0x94')](createExtensionsReciveFax(_['omit'](_0x132016['body'],['tech','key','createdAt','updatedAt','TrunkId',_0x2e8f('0x97')])),{'transaction':_0x31f436});});});})[_0x2e8f('0x20')](function(){return db['FaxAccount']['findById'](_0x132016[_0x2e8f('0x5c')]['id']);})[_0x2e8f('0x20')](respondWithResult(_0x46b67b,null))['catch'](handleError(_0x46b67b,null));};exports[_0x2e8f('0x98')]=function(_0x178196,_0x204a86,_0x2fa7ef){var _0x515543={'raw':!![],'where':{}};var _0x2e37c6={};var _0x281500={'count':0x0,'rows':[]};return db[_0x2e8f('0x53')][_0x2e8f('0x65')]({'where':{'id':_0x178196[_0x2e8f('0x59')]['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x204a86,null))[_0x2e8f('0x20')](function(_0x3d39ba){if(_0x3d39ba){_0x2e37c6[_0x2e8f('0x46')]=_[_0x2e8f('0x5a')](db[_0x2e8f('0x99')][_0x2e8f('0x3f')]);_0x2e37c6['query']=_[_0x2e8f('0x5a')](_0x178196[_0x2e8f('0x44')]);_0x2e37c6['filters']=_[_0x2e8f('0x48')](_0x2e37c6[_0x2e8f('0x46')],_0x2e37c6['query']);_0x515543[_0x2e8f('0x47')]=_[_0x2e8f('0x48')](_0x2e37c6[_0x2e8f('0x46')],qs[_0x2e8f('0x49')](_0x178196[_0x2e8f('0x44')][_0x2e8f('0x49')]));_0x515543['attributes']=_0x515543[_0x2e8f('0x47')][_0x2e8f('0x4a')]?_0x515543[_0x2e8f('0x47')]:_0x2e37c6[_0x2e8f('0x46')];if(!_0x178196['query'][_0x2e8f('0x4b')](_0x2e8f('0x4c'))){_0x515543[_0x2e8f('0x2e')]=qs['limit'](_0x178196[_0x2e8f('0x44')][_0x2e8f('0x2e')]);_0x515543[_0x2e8f('0x31')]=qs['offset'](_0x178196[_0x2e8f('0x44')]['offset']);}_0x515543['order']=qs[_0x2e8f('0x4d')](_0x178196[_0x2e8f('0x44')][_0x2e8f('0x4d')]);_0x515543['where']=qs['filters'](_['pick'](_0x178196[_0x2e8f('0x44')],_0x2e37c6['filters']));_0x515543[_0x2e8f('0x50')][_0x2e8f('0x62')]=_0x3d39ba['id'];if(_0x178196[_0x2e8f('0x44')][_0x2e8f('0x4f')]){_0x515543[_0x2e8f('0x50')]=_['merge'](_0x515543[_0x2e8f('0x50')],{'$or':_['map'](_0x515543[_0x2e8f('0x47')],function(_0xa6f08e){var _0x5acb0b={};_0x5acb0b[_0xa6f08e]={'$like':'%'+_0x178196[_0x2e8f('0x44')][_0x2e8f('0x4f')]+'%'};return _0x5acb0b;})});}if(_0x178196[_0x2e8f('0x44')][_0x2e8f('0x9a')]){var _0x4b2210=_0x178196[_0x2e8f('0x44')][_0x2e8f('0x9a')][_0x2e8f('0x9b')](',');var _0xe08e96={};_0xe08e96[_0x4b2210[0x0]]={'$gte':moment(_0x4b2210[0x1])[_0x2e8f('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x515543[_0x2e8f('0x50')]=_[_0x2e8f('0x51')](_0x515543[_0x2e8f('0x50')],_0xe08e96);}_0x515543=_[_0x2e8f('0x51')]({},_0x515543,_0x178196[_0x2e8f('0x52')]);return db[_0x2e8f('0x99')][_0x2e8f('0x30')]({'where':_0x515543['where']})[_0x2e8f('0x20')](function(_0x311ec8){_0x281500[_0x2e8f('0x30')]=_0x311ec8;if(_0x178196[_0x2e8f('0x44')][_0x2e8f('0x54')]){_0x515543[_0x2e8f('0x55')]=[{'all':!![]}];}return db[_0x2e8f('0x99')][_0x2e8f('0x56')](_0x515543);})[_0x2e8f('0x20')](function(_0x2cbbfa){_0x281500[_0x2e8f('0x57')]=_0x2cbbfa;return _0x281500;});}})[_0x2e8f('0x20')](respondWithFilteredResult(_0x204a86,_0x515543))['catch'](handleError(_0x204a86,null));};exports['send']=function(_0x50ed5e,_0x12a737,_0x42e8e4){var _0x1af316,_0x190b75={},_0x294ea2;if(_0x50ed5e[_0x2e8f('0x5c')]['to']){_0x294ea2=_0x50ed5e['body']['to'][0x0];}return db[_0x2e8f('0x53')][_0x2e8f('0x5e')]({'where':{'id':_0x50ed5e[_0x2e8f('0x59')]['id']},'include':[{'model':db[_0x2e8f('0x9d')],'as':_0x2e8f('0x9e'),'include':[{'model':db[_0x2e8f('0x70')],'as':_0x2e8f('0x9f'),'where':{'fax':_0x294ea2},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x2e8f('0x20')](handleEntityNotFound(_0x12a737,null))[_0x2e8f('0x20')](function(_0x48c22f){_0x1af316=_0x48c22f;if(_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')]&&_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')]['length']){for(var _0x541ba4=0x0;_0x541ba4<_0x50ed5e[_0x2e8f('0x5c')]['attachments']['length'];_0x541ba4+=0x1){_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][_0x541ba4]={'filename':_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][_0x541ba4][_0x2e8f('0x3a')],'id':_0x50ed5e[_0x2e8f('0x5c')]['attachments'][_0x541ba4]['id'],'path':path[_0x2e8f('0xa1')](config['root'],_0x2e8f('0xa2'),_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][_0x541ba4][_0x2e8f('0xa3')])};}}return respondWithRpcPromise(_0x2e8f('0xa4'),'CheckAfterSend',{'FaxAccountId':_[_0x2e8f('0xa5')](_0x50ed5e['params']['id'])?undefined:_0x50ed5e[_0x2e8f('0x59')]['id'],'path':_[_0x2e8f('0xa5')](_0x50ed5e[_0x2e8f('0x5c')]['attachments'][0x0]['path'])?undefined:_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][0x0][_0x2e8f('0xa6')],'fax':_[_0x2e8f('0xa5')](_0x50ed5e[_0x2e8f('0x5c')]['to'][0x0])?undefined:_0x50ed5e[_0x2e8f('0x5c')]['to'][0x0]},client9002);})[_0x2e8f('0x20')](function(){if(_0x1af316){if(_[_0x2e8f('0xa5')](_0x50ed5e[_0x2e8f('0x5c')]['from'])){_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa7')]=util[_0x2e8f('0x9c')]('\x22%s\x22\x20<%s>',_0x1af316[_0x2e8f('0x3a')],_0x1af316['fax']);}if(_0x1af316[_0x2e8f('0x9e')]){if(_0x1af316[_0x2e8f('0x9e')]['Contacts'][_0x2e8f('0x4a')]){return _0x1af316[_0x2e8f('0x9e')][_0x2e8f('0x9f')][0x0];}else{return db['CmContact'][_0x2e8f('0x5b')](_['defaults'](_0x50ed5e[_0x2e8f('0x5c')],{'firstName':_0x50ed5e['body']['to'][0x0],'phone':_0x50ed5e[_0x2e8f('0x5c')]['to'][0x0],'fax':_0x50ed5e[_0x2e8f('0x5c')]['to'][0x0],'ListId':_0x1af316[_0x2e8f('0x97')]}));}}else{throw new Error(_0x2e8f('0xa8'));}}else{throw new Error(_0x2e8f('0xa9'));}})[_0x2e8f('0x20')](function(_0x1d732d){if(_0x1d732d){return db[_0x2e8f('0x6d')][_0x2e8f('0x5e')]({'where':{'ContactId':_0x1d732d['id'],'closed':![],'FaxAccountId':_0x1af316['id']}})[_0x2e8f('0x20')](function(_0x50d56b){if(_0x50d56b){return[_0x50d56b,![]];}return db[_0x2e8f('0x6d')]['create']({'UserId':_0x50ed5e['user']['id'],'ContactId':_0x1d732d['id'],'FaxAccountId':_0x1af316['id'],'fax':_0x50ed5e[_0x2e8f('0x5c')]['to'][0x0],'firstMsgDirection':_0x2e8f('0xaa'),'Messages':[_[_0x2e8f('0x51')](_0x50ed5e['body'],{'read':![],'body':_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][0x0][_0x2e8f('0xab')],'FaxAccountId':_0x1af316['id'],'UserId':_0x50ed5e[_0x2e8f('0x5d')]['id'],'ContactId':_0x1d732d['id'],'AttachmentId':_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x2e8f('0x20')](function(_0x25cd5e){return[_0x25cd5e,!![]];});});}else{throw new Error(_0x2e8f('0xac'));}})[_0x2e8f('0xad')](function(_0x498bdb,_0x468fd7){if(_0x468fd7){return _0x498bdb;}return db['FaxMessage']['create']({'direction':_0x2e8f('0xaa'),'read':![],'body':_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][0x0][_0x2e8f('0xab')],'FaxAccountId':_0x1af316['id'],'FaxInteractionId':_0x498bdb['id'],'UserId':_0x50ed5e[_0x2e8f('0x5d')]['id'],'ContactId':_0x498bdb[_0x2e8f('0xae')],'AttachmentId':_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][0x0]['id']})[_0x2e8f('0x20')](function(_0x2c8d59){_0x498bdb[_0x2e8f('0xaf')][_0x2e8f('0xb0')]=[];_0x498bdb[_0x2e8f('0xaf')]['Messages'][_0x2e8f('0x85')](_0x2c8d59[_0x2e8f('0xaf')]);return _0x498bdb;});})[_0x2e8f('0x20')](function(_0x6bc88){respondWithRpcPromise(_0x2e8f('0xb1'),'SendFax',{'FaxAccountId':_[_0x2e8f('0xa5')](_0x50ed5e[_0x2e8f('0x59')]['id'])?undefined:_0x50ed5e[_0x2e8f('0x59')]['id'],'path':_[_0x2e8f('0xa5')](_0x50ed5e[_0x2e8f('0x5c')][_0x2e8f('0xa0')][0x0][_0x2e8f('0xa6')])?undefined:_0x50ed5e[_0x2e8f('0x5c')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x50ed5e['body']['to'][0x0])?undefined:_0x50ed5e[_0x2e8f('0x5c')]['to'][0x0],'AttachmentId':_0x50ed5e[_0x2e8f('0x5c')]['attachments'][0x0]['id']},client9002)[_0x2e8f('0x20')](function(_0xa70c9e){logger[_0x2e8f('0xb2')]('SendFaxRpc,\x20%s',_0xa70c9e);})[_0x2e8f('0x29')](function(_0x1557da){logger[_0x2e8f('0xb2')](_0x2e8f('0xb3'),_0x1557da);});return _0x6bc88;})[_0x2e8f('0x20')](respondWithResult(_0x12a737,null))[_0x2e8f('0x29')](handleError(_0x12a737,null));};exports['addAgents']=function(_0x28427f,_0x4ef03a,_0x250c15){return db[_0x2e8f('0x53')][_0x2e8f('0x5e')]({'where':{'id':_0x28427f[_0x2e8f('0x59')]['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x4ef03a,null))['then'](function(_0x61aa1c){if(_0x61aa1c){return _0x61aa1c[_0x2e8f('0xb4')](_0x28427f[_0x2e8f('0x5c')][_0x2e8f('0x68')],_['omit'](_0x28427f[_0x2e8f('0x5c')],[_0x2e8f('0x68'),'id'])||{})[_0x2e8f('0xad')](function(_0x30638f){for(var _0xc17a9d=0x0;_0xc17a9d<_0x28427f[_0x2e8f('0x5c')][_0x2e8f('0x68')][_0x2e8f('0x4a')];_0xc17a9d+=0x1){socket[_0x2e8f('0xb5')](_0x2e8f('0xb6'),{'UserId':Number(_0x28427f[_0x2e8f('0x5c')][_0x2e8f('0x68')][_0xc17a9d]),'FaxAccountId':Number(_0x28427f[_0x2e8f('0x59')]['id'])});}return _0x30638f;});}})[_0x2e8f('0x20')](respondWithResult(_0x4ef03a,null))[_0x2e8f('0x29')](handleError(_0x4ef03a,null));};exports[_0x2e8f('0xb7')]=function(_0x409468,_0x53964c,_0x50d269){return db['FaxAccount'][_0x2e8f('0x5e')]({'where':{'id':_0x409468[_0x2e8f('0x59')]['id']}})[_0x2e8f('0x20')](handleEntityNotFound(_0x53964c,null))[_0x2e8f('0x20')](function(_0x3a555d){if(_0x3a555d){return _0x3a555d[_0x2e8f('0xb7')](_0x409468[_0x2e8f('0x44')]['ids'])[_0x2e8f('0x20')](function(){if(_['isArray'](_0x409468['query']['ids'])){for(var _0x4bf2ae=0x0;_0x4bf2ae<_0x409468[_0x2e8f('0x44')]['ids'][_0x2e8f('0x4a')];_0x4bf2ae+=0x1){socket[_0x2e8f('0xb5')]('userFaxAccount:remove',{'UserId':Number(_0x409468[_0x2e8f('0x44')][_0x2e8f('0x68')][_0x4bf2ae]),'FaxAccountId':Number(_0x409468['params']['id'])});}}else{socket['emit'](_0x2e8f('0xb8'),{'UserId':Number(_0x409468['query'][_0x2e8f('0x68')]),'FaxAccountId':Number(_0x409468[_0x2e8f('0x59')]['id'])});}});}})[_0x2e8f('0x20')](respondWithStatusCode(_0x53964c,null))[_0x2e8f('0x29')](handleError(_0x53964c,null));};exports[_0x2e8f('0xb9')]=function(_0x2131d8,_0x3ec23a,_0x529b63){var _0x309f8d={};var _0x448666={};var _0x2b1ebf;var _0x419431;return db[_0x2e8f('0x53')][_0x2e8f('0x65')]({'where':{'id':_0x2131d8[_0x2e8f('0x59')]['id']}})['then'](handleEntityNotFound(_0x3ec23a,null))[_0x2e8f('0x20')](function(_0x203dc7){if(_0x203dc7){_0x2b1ebf=_0x203dc7;_0x448666['model']=_[_0x2e8f('0x5a')](db[_0x2e8f('0x71')][_0x2e8f('0x3f')]);_0x448666[_0x2e8f('0x44')]=_[_0x2e8f('0x5a')](_0x2131d8[_0x2e8f('0x44')]);_0x448666[_0x2e8f('0x45')]=_['intersection'](_0x448666['model'],_0x448666['query']);_0x309f8d[_0x2e8f('0x47')]=_['intersection'](_0x448666['model'],qs[_0x2e8f('0x49')](_0x2131d8['query'][_0x2e8f('0x49')]));_0x309f8d['attributes']=_0x309f8d[_0x2e8f('0x47')]['length']?_0x309f8d[_0x2e8f('0x47')]:_0x448666[_0x2e8f('0x46')];_0x309f8d[_0x2e8f('0x66')]=qs[_0x2e8f('0x4d')](_0x2131d8[_0x2e8f('0x44')][_0x2e8f('0x4d')]);_0x309f8d[_0x2e8f('0x50')]=qs[_0x2e8f('0x45')](_[_0x2e8f('0x4e')](_0x2131d8[_0x2e8f('0x44')],_0x448666[_0x2e8f('0x45')]));if(_0x2131d8[_0x2e8f('0x44')][_0x2e8f('0x4f')]){_0x309f8d['where']=_['merge'](_0x309f8d['where'],{'$or':_[_0x2e8f('0x43')](_0x309f8d[_0x2e8f('0x47')],function(_0x55ef9){var _0x20d7f6={};_0x20d7f6[_0x55ef9]={'$like':'%'+_0x2131d8[_0x2e8f('0x44')][_0x2e8f('0x4f')]+'%'};return _0x20d7f6;})});}_0x309f8d=_[_0x2e8f('0x51')]({},_0x309f8d,_0x2131d8['options']);return _0x2b1ebf[_0x2e8f('0xb9')](_0x309f8d);}})['then'](function(_0x2124c8){if(_0x2124c8){_0x419431=_0x2124c8['length'];if(!_0x2131d8[_0x2e8f('0x44')][_0x2e8f('0x4b')]('nolimit')){_0x309f8d[_0x2e8f('0x2e')]=qs['limit'](_0x2131d8['query']['limit']);_0x309f8d[_0x2e8f('0x31')]=qs[_0x2e8f('0x31')](_0x2131d8[_0x2e8f('0x44')]['offset']);}return _0x2b1ebf[_0x2e8f('0xb9')](_0x309f8d);}})[_0x2e8f('0x20')](function(_0x56e853){if(_0x56e853){return _0x56e853?{'count':_0x419431,'rows':_0x56e853}:null;}})[_0x2e8f('0x20')](respondWithResult(_0x3ec23a,null))[_0x2e8f('0x29')](handleError(_0x3ec23a,null));};
\ No newline at end of file
+var _0xdcfd=['pick','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','app','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','headerinfo','maxrate','minrate','modem','FAXOPT(','ReceiveFax','addAccountApplications','sequelize','bulkCreate','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','user','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','FaxAccounts','end','sendStatus','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','FaxAccount','includeAll','include','show','params','mandatoryDispositionPause','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','describe','FaxAccountId','getDispositions','findOne','Disposition'];(function(_0x111155,_0x47d1f2){var _0x4989bb=function(_0xe9b4f5){while(--_0xe9b4f5){_0x111155['push'](_0x111155['shift']());}};_0x4989bb(++_0x47d1f2);}(_0xdcfd,0x11c));var _0xddcf=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0xdcfd[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0xddcf('0x0'));var rimraf=require(_0xddcf('0x1'));var zipdir=require(_0xddcf('0x2'));var jsonpatch=require(_0xddcf('0x3'));var rp=require(_0xddcf('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xddcf('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xddcf('0x6'));var fs=require('fs');var fs_extra=require(_0xddcf('0x7'));var _=require(_0xddcf('0x8'));var squel=require(_0xddcf('0x9'));var crypto=require(_0xddcf('0xa'));var jsforce=require(_0xddcf('0xb'));var deskjs=require(_0xddcf('0xc'));var toCsv=require('to-csv');var querystring=require(_0xddcf('0xd'));var Papa=require(_0xddcf('0xe'));var Redis=require(_0xddcf('0xf'));var authService=require(_0xddcf('0x10'));var qs=require(_0xddcf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xddcf('0x12'))(_0xddcf('0x13'));var utils=require(_0xddcf('0x14'));var config=require(_0xddcf('0x15'));var licenseUtil=require(_0xddcf('0x16'));var db=require('../../mysqldb')['db'];config[_0xddcf('0x17')]=_[_0xddcf('0x18')](config[_0xddcf('0x17')],{'host':_0xddcf('0x19'),'port':0x18eb});var socket=require(_0xddcf('0x1a'))(new Redis(config[_0xddcf('0x17')]));require(_0xddcf('0x1b'))[_0xddcf('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xddcf('0x1d')][_0xddcf('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xddcf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1b807a,_0x1a400e,_0x1bcde0,_0x4cf835){return new BPromise(function(_0x3eabf7,_0x1c4aa9){var _0x4caa68=_0x4cf835||client;return _0x4caa68['request'](_0x1b807a,_0x1bcde0)[_0xddcf('0x1f')](function(_0x2aee08){logger['info'](_0xddcf('0x20'),_0x1a400e,'request\x20sent');logger[_0xddcf('0x21')](_0xddcf('0x22'),_0x1a400e,_0xddcf('0x23'),JSON[_0xddcf('0x24')](_0x2aee08));if(_0x2aee08[_0xddcf('0x25')]){if(_0x2aee08[_0xddcf('0x25')][_0xddcf('0x26')]===0x1f4){logger[_0xddcf('0x25')](_0xddcf('0x20'),_0x1a400e,_0x2aee08[_0xddcf('0x25')][_0xddcf('0x27')]);return _0x1c4aa9(_0x2aee08[_0xddcf('0x25')][_0xddcf('0x27')]);}logger[_0xddcf('0x25')]('FaxAccount,\x20%s,\x20%s',_0x1a400e,_0x2aee08[_0xddcf('0x25')][_0xddcf('0x27')]);return _0x3eabf7(_0x2aee08['error'][_0xddcf('0x27')]);}else{logger[_0xddcf('0x28')](_0xddcf('0x20'),_0x1a400e,_0xddcf('0x23'));_0x3eabf7(_0x2aee08[_0xddcf('0x29')][_0xddcf('0x27')]);}})[_0xddcf('0x2a')](function(_0x2ac241){logger[_0xddcf('0x25')](_0xddcf('0x20'),_0x1a400e,_0x2ac241);_0x1c4aa9(_0x2ac241);});});}function respondWithStatusCode(_0x1609f4,_0x1b74ea){_0x1b74ea=_0x1b74ea||0xcc;return function(_0x3f7319){if(_0x3f7319){return _0x1609f4['sendStatus'](_0x1b74ea);}return _0x1609f4['status'](_0x1b74ea)['end']();};}function respondWithResult(_0x4525e9,_0x4644cf){_0x4644cf=_0x4644cf||0xc8;return function(_0x880ec7){if(_0x880ec7){return _0x4525e9[_0xddcf('0x2b')](_0x4644cf)[_0xddcf('0x2c')](_0x880ec7);}};}function respondWithFilteredResult(_0x500c0f,_0x1ecab1){return function(_0x46602d){if(_0x46602d){var _0x5a3464=typeof _0x1ecab1[_0xddcf('0x2d')]===_0xddcf('0x2e')&&typeof _0x1ecab1[_0xddcf('0x2f')]==='undefined';var _0x1a5ab0=_0x46602d['count'];var _0x494d34=_0x5a3464?0x0:_0x1ecab1[_0xddcf('0x2d')];var _0x537a83=_0x5a3464?_0x46602d[_0xddcf('0x30')]:_0x1ecab1[_0xddcf('0x2d')]+_0x1ecab1[_0xddcf('0x2f')];var _0x3ea360;if(_0x537a83>=_0x1a5ab0){_0x537a83=_0x1a5ab0;_0x3ea360=0xc8;}else{_0x3ea360=0xce;}_0x500c0f['status'](_0x3ea360);return _0x500c0f[_0xddcf('0x31')]('Content-Range',_0x494d34+'-'+_0x537a83+'/'+_0x1a5ab0)[_0xddcf('0x2c')](_0x46602d);}return null;};}function patchUpdates(_0x35266c){return function(_0x14781a){try{jsonpatch[_0xddcf('0x32')](_0x14781a,_0x35266c,!![]);}catch(_0x4e77d9){return BPromise[_0xddcf('0x33')](_0x4e77d9);}return _0x14781a[_0xddcf('0x34')]();};}function saveUpdates(_0xd5478b,_0x4042ab){return function(_0x416f50){if(_0x416f50){return _0x416f50[_0xddcf('0x35')](_0xd5478b)['then'](function(_0x1d1f25){return _0x1d1f25;});}return null;};}function removeEntity(_0x400e93,_0x13c246){return function(_0x4c3bc8){if(_0x4c3bc8){return _0x4c3bc8[_0xddcf('0x36')]()[_0xddcf('0x1f')](function(){var _0x448949=_0x4c3bc8[_0xddcf('0x37')]({'plain':!![]});var _0x3b4203=_0xddcf('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b4203,'resourceId':_0x448949['id']}})['then'](function(){return _0x4c3bc8;});})['then'](function(){_0x400e93[_0xddcf('0x2b')](0xcc)[_0xddcf('0x39')]();});}};}function handleEntityNotFound(_0x364275,_0x5b11ff){return function(_0xc3b300){if(!_0xc3b300){_0x364275[_0xddcf('0x3a')](0x194);}return _0xc3b300;};}function handleError(_0x2b047a,_0x390eb2){_0x390eb2=_0x390eb2||0x1f4;return function(_0x1b01ea){logger[_0xddcf('0x25')](_0x1b01ea[_0xddcf('0x3b')]);if(_0x1b01ea[_0xddcf('0x3c')]){delete _0x1b01ea['name'];}_0x2b047a[_0xddcf('0x2b')](_0x390eb2)[_0xddcf('0x3d')](_0x1b01ea);};}exports[_0xddcf('0x3e')]=function(_0x319857,_0x3e5153){var _0x339118={'include':[{'model':db[_0xddcf('0x3f')],'as':'mandatoryDispositionPause'}]},_0x45a558={},_0x416da7={'count':0x0,'rows':[]};var _0x1ef909=_[_0xddcf('0x40')](db['FaxAccount'][_0xddcf('0x41')],function(_0x25ac0f){return{'name':_0x25ac0f[_0xddcf('0x42')],'type':_0x25ac0f[_0xddcf('0x43')][_0xddcf('0x44')]};});_0x45a558[_0xddcf('0x45')]=_[_0xddcf('0x40')](_0x1ef909,_0xddcf('0x3c'));_0x45a558[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x319857[_0xddcf('0x46')]);_0x45a558[_0xddcf('0x48')]=_['intersection'](_0x45a558[_0xddcf('0x45')],_0x45a558[_0xddcf('0x46')]);_0x339118['attributes']=_[_0xddcf('0x49')](_0x45a558[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x319857['query']['fields']));_0x339118[_0xddcf('0x4b')]=_0x339118[_0xddcf('0x4b')][_0xddcf('0x4c')]?_0x339118['attributes']:_0x45a558[_0xddcf('0x45')];if(!_0x319857[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x339118[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x319857[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x339118['offset']=qs[_0xddcf('0x2d')](_0x319857[_0xddcf('0x46')][_0xddcf('0x2d')]);}_0x339118[_0xddcf('0x4f')]=qs[_0xddcf('0x50')](_0x319857['query'][_0xddcf('0x50')]);_0x339118[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_['pick'](_0x319857['query'],_0x45a558[_0xddcf('0x48')]),_0x1ef909);if(_0x319857[_0xddcf('0x46')][_0xddcf('0x52')]){_0x339118[_0xddcf('0x51')]=_['merge'](_0x339118[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x1ef909,function(_0x28340f){if(_0x28340f[_0xddcf('0x43')]!==_0xddcf('0x53')){var _0x84914f={};_0x84914f[_0x28340f[_0xddcf('0x3c')]]={'$like':'%'+_0x319857[_0xddcf('0x46')][_0xddcf('0x52')]+'%'};return _0x84914f;}})});}_0x339118=_['merge']({},_0x339118,_0x319857['options']);var _0x5f3fe2={'where':_0x339118[_0xddcf('0x51')]};return db[_0xddcf('0x54')]['count'](_0x5f3fe2)[_0xddcf('0x1f')](function(_0x2bd9b6){_0x416da7['count']=_0x2bd9b6;if(_0x319857[_0xddcf('0x46')][_0xddcf('0x55')]){_0x339118[_0xddcf('0x56')]=[{'all':!![]}];}return db[_0xddcf('0x54')]['findAll'](_0x339118);})['then'](function(_0x3134a9){_0x416da7['rows']=_0x3134a9;return _0x416da7;})[_0xddcf('0x1f')](respondWithFilteredResult(_0x3e5153,_0x339118))[_0xddcf('0x2a')](handleError(_0x3e5153,null));};exports[_0xddcf('0x57')]=function(_0xb0cfa9,_0x677076){var _0x1e7b20={'raw':![],'where':{'id':_0xb0cfa9[_0xddcf('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xddcf('0x59')}]},_0x413e84={};_0x413e84[_0xddcf('0x45')]=_[_0xddcf('0x47')](db[_0xddcf('0x54')]['rawAttributes']);_0x413e84[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0xb0cfa9[_0xddcf('0x46')]);_0x413e84[_0xddcf('0x48')]=_[_0xddcf('0x49')](_0x413e84[_0xddcf('0x45')],_0x413e84[_0xddcf('0x46')]);_0x1e7b20[_0xddcf('0x4b')]=_[_0xddcf('0x49')](_0x413e84[_0xddcf('0x45')],qs['fields'](_0xb0cfa9[_0xddcf('0x46')]['fields']));_0x1e7b20[_0xddcf('0x4b')]=_0x1e7b20['attributes']['length']?_0x1e7b20['attributes']:_0x413e84[_0xddcf('0x45')];if(_0xb0cfa9[_0xddcf('0x46')][_0xddcf('0x55')]){_0x1e7b20[_0xddcf('0x56')]=[{'all':!![]}];}_0x1e7b20=_[_0xddcf('0x5a')]({},_0x1e7b20,_0xb0cfa9[_0xddcf('0x5b')]);return db['FaxAccount'][_0xddcf('0x5c')](_0x1e7b20)[_0xddcf('0x1f')](handleEntityNotFound(_0x677076,null))['then'](respondWithResult(_0x677076,null))['catch'](handleError(_0x677076,null));};exports[_0xddcf('0x5d')]=function(_0x596efe,_0x116889){return db[_0xddcf('0x54')][_0xddcf('0x5d')](_0x596efe[_0xddcf('0x5e')],{})[_0xddcf('0x1f')](function(_0x44fcb7){var _0x5d56b5=_0x596efe['user']['get']({'plain':!![]});if(!_0x5d56b5)throw new Error(_0xddcf('0x5f'));if(_0x5d56b5['role']==='user'){var _0x39312d=_0x44fcb7['get']({'plain':!![]});var _0x265bc2='FaxAccounts';return db[_0xddcf('0x60')][_0xddcf('0x5c')]({'where':{'name':_0x265bc2,'userProfileId':_0x5d56b5['userProfileId']},'raw':!![]})['then'](function(_0x89bb8c){if(_0x89bb8c&&_0x89bb8c[_0xddcf('0x61')]===0x0){return db[_0xddcf('0x62')][_0xddcf('0x5d')]({'name':_0x39312d[_0xddcf('0x3c')],'resourceId':_0x39312d['id'],'type':_0x89bb8c[_0xddcf('0x3c')],'sectionId':_0x89bb8c['id']},{})['then'](function(){return _0x44fcb7;});}else{return _0x44fcb7;}})[_0xddcf('0x2a')](function(_0x559577){logger[_0xddcf('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x559577);throw _0x559577;});}return _0x44fcb7;})[_0xddcf('0x1f')](respondWithResult(_0x116889,0xc9))[_0xddcf('0x2a')](handleError(_0x116889,null));};exports[_0xddcf('0x35')]=function(_0x1fff5a,_0x1fa5c3){if(_0x1fff5a['body']['id']){delete _0x1fff5a[_0xddcf('0x5e')]['id'];}return db['FaxAccount'][_0xddcf('0x5c')]({'where':{'id':_0x1fff5a[_0xddcf('0x58')]['id']},'include':[{'model':db[_0xddcf('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xddcf('0x1f')](handleEntityNotFound(_0x1fa5c3,null))[_0xddcf('0x1f')](saveUpdates(_0x1fff5a[_0xddcf('0x5e')],null))[_0xddcf('0x1f')](respondWithResult(_0x1fa5c3,null))[_0xddcf('0x2a')](handleError(_0x1fa5c3,null));};exports[_0xddcf('0x36')]=function(_0x2b5a98,_0x3bb975){return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0x2b5a98[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x3bb975,null))[_0xddcf('0x1f')](removeEntity(_0x3bb975,null))[_0xddcf('0x2a')](handleError(_0x3bb975,null));};exports[_0xddcf('0x63')]=function(_0x2befb9,_0x4c7e72){return db[_0xddcf('0x54')][_0xddcf('0x63')]()[_0xddcf('0x1f')](respondWithResult(_0x4c7e72,null))[_0xddcf('0x2a')](handleError(_0x4c7e72,null));};exports['addDisposition']=function(_0x2445ad,_0x23de68,_0x2a08aa){if(_0x2445ad['body']['id']){delete _0x2445ad['body']['id'];}return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0x2445ad[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x23de68,null))[_0xddcf('0x1f')](function(_0x2ca152){if(_0x2ca152){_0x2445ad[_0xddcf('0x5e')][_0xddcf('0x64')]=_0x2ca152['id'];return db['Disposition'][_0xddcf('0x5d')](_0x2445ad[_0xddcf('0x5e')]);}})['then'](respondWithResult(_0x23de68,null))[_0xddcf('0x2a')](handleError(_0x23de68,null));};exports[_0xddcf('0x65')]=function(_0x55c618,_0x2a3c2f,_0x2a7787){var _0x3eda3d={'raw':![],'where':{}};var _0x18cba5={};var _0x48703b={'count':0x0,'rows':[]};return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x55c618[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x2a3c2f,null))[_0xddcf('0x1f')](function(_0x846aa2){if(_0x846aa2){_0x18cba5[_0xddcf('0x45')]=_['keys'](db[_0xddcf('0x67')]['rawAttributes']);_0x18cba5['query']=_['keys'](_0x55c618[_0xddcf('0x46')]);_0x18cba5[_0xddcf('0x48')]=_[_0xddcf('0x49')](_0x18cba5[_0xddcf('0x45')],_0x18cba5[_0xddcf('0x46')]);_0x3eda3d[_0xddcf('0x4b')]=_['intersection'](_0x18cba5['model'],qs[_0xddcf('0x4a')](_0x55c618[_0xddcf('0x46')][_0xddcf('0x4a')]));_0x3eda3d[_0xddcf('0x4b')]=_0x3eda3d[_0xddcf('0x4b')][_0xddcf('0x4c')]?_0x3eda3d[_0xddcf('0x4b')]:_0x18cba5[_0xddcf('0x45')];if(!_0x55c618[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x3eda3d[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x55c618[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x3eda3d['offset']=qs['offset'](_0x55c618[_0xddcf('0x46')][_0xddcf('0x2d')]);}_0x3eda3d['order']=qs['sort'](_0x55c618[_0xddcf('0x46')]['sort']);_0x3eda3d[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_[_0xddcf('0x68')](_0x55c618['query'],_0x18cba5[_0xddcf('0x48')]));_0x3eda3d['where'][_0xddcf('0x64')]=_0x846aa2['id'];if(_0x55c618['query'][_0xddcf('0x52')]){_0x3eda3d[_0xddcf('0x51')]=_['merge'](_0x3eda3d[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x3eda3d[_0xddcf('0x4b')],function(_0x5c4fa6){var _0x64506={};_0x64506[_0x5c4fa6]={'$like':'%'+_0x55c618['query'][_0xddcf('0x52')]+'%'};return _0x64506;})});}_0x3eda3d=_[_0xddcf('0x5a')]({},_0x3eda3d,_0x55c618[_0xddcf('0x5b')]);return db[_0xddcf('0x67')][_0xddcf('0x30')]({'where':_0x3eda3d[_0xddcf('0x51')]})['then'](function(_0x3c9596){_0x48703b[_0xddcf('0x30')]=_0x3c9596;if(_0x55c618[_0xddcf('0x46')][_0xddcf('0x55')]){_0x3eda3d[_0xddcf('0x56')]=[{'all':!![]}];}return db[_0xddcf('0x67')][_0xddcf('0x69')](_0x3eda3d);})[_0xddcf('0x1f')](function(_0x6268ce){_0x48703b['rows']=_0x6268ce;return _0x48703b;});}})[_0xddcf('0x1f')](respondWithFilteredResult(_0x2a3c2f,_0x3eda3d))[_0xddcf('0x2a')](handleError(_0x2a3c2f,null));};exports[_0xddcf('0x6a')]=function(_0x23a97b,_0x370c84,_0x2a152c){return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0x23a97b[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x370c84,null))['then'](function(_0x4096bc){if(_0x4096bc){return _0x4096bc[_0xddcf('0x6a')](_0x23a97b[_0xddcf('0x46')]['ids']);}})[_0xddcf('0x1f')](respondWithStatusCode(_0x370c84,null))[_0xddcf('0x2a')](handleError(_0x370c84,null));};exports[_0xddcf('0x6b')]=function(_0x1d154a,_0x897262,_0x247125){if(_0x1d154a[_0xddcf('0x5e')]['id']){delete _0x1d154a[_0xddcf('0x5e')]['id'];}return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0x1d154a[_0xddcf('0x58')]['id']}})['then'](handleEntityNotFound(_0x897262,null))[_0xddcf('0x1f')](function(_0x48b251){if(_0x48b251){_0x1d154a[_0xddcf('0x5e')][_0xddcf('0x64')]=_0x48b251['id'];return db[_0xddcf('0x6c')][_0xddcf('0x5d')](_0x1d154a[_0xddcf('0x5e')]);}})[_0xddcf('0x1f')](respondWithResult(_0x897262,null))[_0xddcf('0x2a')](handleError(_0x897262,null));};exports[_0xddcf('0x6d')]=function(_0x3c3856,_0xb6781c,_0x5a700d){var _0x3eb5da={'raw':![],'where':{}};var _0x54b719={};var _0x969810={'count':0x0,'rows':[]};return db['FaxAccount'][_0xddcf('0x66')]({'where':{'id':_0x3c3856[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0xb6781c,null))[_0xddcf('0x1f')](function(_0x469946){if(_0x469946){_0x54b719[_0xddcf('0x45')]=_['keys'](db[_0xddcf('0x6c')]['rawAttributes']);_0x54b719[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x3c3856['query']);_0x54b719[_0xddcf('0x48')]=_[_0xddcf('0x49')](_0x54b719[_0xddcf('0x45')],_0x54b719['query']);_0x3eb5da['attributes']=_[_0xddcf('0x49')](_0x54b719[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x3c3856[_0xddcf('0x46')][_0xddcf('0x4a')]));_0x3eb5da['attributes']=_0x3eb5da[_0xddcf('0x4b')][_0xddcf('0x4c')]?_0x3eb5da[_0xddcf('0x4b')]:_0x54b719[_0xddcf('0x45')];if(!_0x3c3856[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x3eb5da[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x3c3856[_0xddcf('0x46')]['limit']);_0x3eb5da[_0xddcf('0x2d')]=qs[_0xddcf('0x2d')](_0x3c3856['query'][_0xddcf('0x2d')]);}_0x3eb5da[_0xddcf('0x4f')]=qs[_0xddcf('0x50')](_0x3c3856['query']['sort']);_0x3eb5da[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_[_0xddcf('0x68')](_0x3c3856['query'],_0x54b719[_0xddcf('0x48')]));_0x3eb5da[_0xddcf('0x51')][_0xddcf('0x64')]=_0x469946['id'];if(_0x3c3856[_0xddcf('0x46')]['filter']){_0x3eb5da[_0xddcf('0x51')]=_['merge'](_0x3eb5da[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x3eb5da[_0xddcf('0x4b')],function(_0x40a9ca){var _0x139bc2={};_0x139bc2[_0x40a9ca]={'$like':'%'+_0x3c3856[_0xddcf('0x46')]['filter']+'%'};return _0x139bc2;})});}_0x3eb5da=_[_0xddcf('0x5a')]({},_0x3eb5da,_0x3c3856[_0xddcf('0x5b')]);return db[_0xddcf('0x6c')][_0xddcf('0x30')]({'where':_0x3eb5da['where']})[_0xddcf('0x1f')](function(_0x52a6be){_0x969810[_0xddcf('0x30')]=_0x52a6be;if(_0x3c3856[_0xddcf('0x46')]['includeAll']){_0x3eb5da[_0xddcf('0x56')]=[{'all':!![]}];}return db[_0xddcf('0x6c')]['findAll'](_0x3eb5da);})['then'](function(_0x3f0878){_0x969810[_0xddcf('0x6e')]=_0x3f0878;return _0x969810;});}})[_0xddcf('0x1f')](respondWithFilteredResult(_0xb6781c,_0x3eb5da))[_0xddcf('0x2a')](handleError(_0xb6781c,null));};exports[_0xddcf('0x6f')]=function(_0x137d39,_0x404ef9,_0x2d1525){return db['FaxAccount'][_0xddcf('0x5c')]({'where':{'id':_0x137d39[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x404ef9,null))[_0xddcf('0x1f')](function(_0x23f990){if(_0x23f990){return _0x23f990[_0xddcf('0x6f')](_0x137d39[_0xddcf('0x46')][_0xddcf('0x70')]);}})[_0xddcf('0x1f')](respondWithStatusCode(_0x404ef9,null))[_0xddcf('0x2a')](handleError(_0x404ef9,null));};exports[_0xddcf('0x71')]=function(_0x19357b,_0x19b07e,_0x271ba3){return db['FaxInteraction']['find']({'where':{'id':_0x19357b[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x19b07e,null))[_0xddcf('0x1f')](function(_0x78e623){if(_0x78e623){return _0x78e623[_0xddcf('0x71')](_0x19357b[_0xddcf('0x5e')][_0xddcf('0x70')],_[_0xddcf('0x72')](_0x19357b['body'],[_0xddcf('0x70'),'id'])||{});}})['then'](respondWithResult(_0x19b07e,null))[_0xddcf('0x2a')](handleError(_0x19b07e,null));};exports[_0xddcf('0x73')]=function(_0x57b98d,_0x495d39,_0x2fca98){var _0x37c9f8={'raw':![],'where':{}};var _0x5151b2={};var _0x48913b={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x57b98d[_0xddcf('0x58')]['id']}})['then'](handleEntityNotFound(_0x495d39,null))[_0xddcf('0x1f')](function(_0x22e5e9){if(_0x22e5e9){_0x5151b2[_0xddcf('0x45')]=_[_0xddcf('0x47')](db[_0xddcf('0x74')]['rawAttributes']);_0x5151b2[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x57b98d['query']);_0x5151b2['filters']=_['intersection'](_0x5151b2['model'],_0x5151b2['query']);_0x37c9f8[_0xddcf('0x4b')]=_['intersection'](_0x5151b2[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x57b98d['query'][_0xddcf('0x4a')]));_0x37c9f8[_0xddcf('0x4b')]=_0x37c9f8['attributes'][_0xddcf('0x4c')]?_0x37c9f8[_0xddcf('0x4b')]:_0x5151b2[_0xddcf('0x45')];if(!_0x57b98d[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x37c9f8[_0xddcf('0x2f')]=qs['limit'](_0x57b98d[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x37c9f8['offset']=qs[_0xddcf('0x2d')](_0x57b98d[_0xddcf('0x46')][_0xddcf('0x2d')]);}_0x37c9f8[_0xddcf('0x4f')]=qs[_0xddcf('0x50')](_0x57b98d[_0xddcf('0x46')][_0xddcf('0x50')]);_0x37c9f8['where']=qs[_0xddcf('0x48')](_['pick'](_0x57b98d[_0xddcf('0x46')],_0x5151b2[_0xddcf('0x48')]));_0x37c9f8[_0xddcf('0x51')]['FaxAccountId']=_0x22e5e9['id'];if(_0x57b98d['query']['filter']){_0x37c9f8[_0xddcf('0x51')]=_[_0xddcf('0x5a')](_0x37c9f8[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x37c9f8[_0xddcf('0x4b')],function(_0x49d217){var _0x4b5752={};_0x4b5752[_0x49d217]={'$like':'%'+_0x57b98d[_0xddcf('0x46')]['filter']+'%'};return _0x4b5752;})});}_0x37c9f8=_[_0xddcf('0x5a')]({},_0x37c9f8,_0x57b98d[_0xddcf('0x5b')]);return db[_0xddcf('0x74')][_0xddcf('0x30')]({'where':_0x37c9f8['where']})[_0xddcf('0x1f')](function(_0x131973){_0x48913b['count']=_0x131973;if(_0x57b98d[_0xddcf('0x46')][_0xddcf('0x55')]){_0x37c9f8[_0xddcf('0x56')]=[{'model':db[_0xddcf('0x75')],'as':_0xddcf('0x76'),'required':![]},{'model':db[_0xddcf('0x77')],'as':_0xddcf('0x78'),'attributes':[_0xddcf('0x3c'),_0xddcf('0x79'),_0xddcf('0x7a')],'required':![]},{'model':db[_0xddcf('0x7b')],'as':_0xddcf('0x7c'),'attributes':['id',_0xddcf('0x3c'),_0xddcf('0x7d')],'where':_0x57b98d[_0xddcf('0x46')][_0xddcf('0x7e')]?{'id':_0x57b98d[_0xddcf('0x46')][_0xddcf('0x7e')]}:undefined,'required':_0x57b98d[_0xddcf('0x46')]['tag']?!![]:![]}];}return db[_0xddcf('0x74')]['findAll'](_0x37c9f8);})[_0xddcf('0x1f')](function(_0x298902){_0x48913b[_0xddcf('0x6e')]=_0x298902;return _0x48913b;});}})[_0xddcf('0x1f')](respondWithFilteredResult(_0x495d39,_0x37c9f8))[_0xddcf('0x2a')](handleError(_0x495d39,null));};exports['addApplications']=function(_0x594931,_0x5f0a2e,_0x1bf719){return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x594931['params']['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x5f0a2e,null))[_0xddcf('0x1f')](function(_0x119190){if(_0x119190){return db['sequelize'][_0xddcf('0x7f')](function(_0x30f9af){return db[_0xddcf('0x80')]['destroy']({'where':{'FaxAccountId':_0x594931[_0xddcf('0x58')]['id']},'transaction':_0x30f9af})[_0xddcf('0x1f')](function(_0x1f9ba9){var _0x3f29ab=_[_0xddcf('0x40')](_0x594931['body'],function(_0x11b375){_0x11b375[_0xddcf('0x64')]=_0x594931[_0xddcf('0x58')]['id'];return _0x11b375;});return db['FaxApplication']['bulkCreate'](_0x3f29ab,{'transaction':_0x30f9af});});})[_0xddcf('0x1f')](function(){return db[_0xddcf('0x80')]['findAndCountAll']({'where':{'FaxAccountId':_0x594931['params']['id']},'order':_0xddcf('0x81')});});}})[_0xddcf('0x1f')](respondWithResult(_0x5f0a2e,null))[_0xddcf('0x2a')](handleError(_0x5f0a2e,null));};exports[_0xddcf('0x82')]=function(_0x494677,_0x30804e,_0x369f2b){var _0x2941a6={};var _0x3d6042={};var _0x3e7b03;var _0x404458;return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x494677[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x30804e,null))[_0xddcf('0x1f')](function(_0x3592c8){if(_0x3592c8){_0x3e7b03=_0x3592c8;_0x3d6042['model']=_[_0xddcf('0x47')](db['FaxApplication'][_0xddcf('0x41')]);_0x3d6042[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x494677[_0xddcf('0x46')]);_0x3d6042[_0xddcf('0x48')]=_['intersection'](_0x3d6042[_0xddcf('0x45')],_0x3d6042[_0xddcf('0x46')]);_0x2941a6[_0xddcf('0x4b')]=_['intersection'](_0x3d6042[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x494677[_0xddcf('0x46')][_0xddcf('0x4a')]));_0x2941a6[_0xddcf('0x4b')]=_0x2941a6[_0xddcf('0x4b')][_0xddcf('0x4c')]?_0x2941a6['attributes']:_0x3d6042[_0xddcf('0x45')];_0x2941a6[_0xddcf('0x4f')]=qs[_0xddcf('0x50')](_0x494677['query'][_0xddcf('0x50')]);_0x2941a6[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_[_0xddcf('0x68')](_0x494677[_0xddcf('0x46')],_0x3d6042[_0xddcf('0x48')]));if(_0x494677[_0xddcf('0x46')][_0xddcf('0x52')]){_0x2941a6[_0xddcf('0x51')]=_[_0xddcf('0x5a')](_0x2941a6[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x2941a6[_0xddcf('0x4b')],function(_0x36e42d){var _0x4ef528={};_0x4ef528[_0x36e42d]={'$like':'%'+_0x494677[_0xddcf('0x46')]['filter']+'%'};return _0x4ef528;})});}_0x2941a6=_['merge']({},_0x2941a6,_0x494677[_0xddcf('0x5b')]);return _0x3e7b03[_0xddcf('0x82')](_0x2941a6);}})[_0xddcf('0x1f')](function(_0x507e27){if(_0x507e27){_0x404458=_0x507e27[_0xddcf('0x4c')];if(!_0x494677[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x2941a6[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x494677['query']['limit']);_0x2941a6[_0xddcf('0x2d')]=qs[_0xddcf('0x2d')](_0x494677[_0xddcf('0x46')]['offset']);}return _0x3e7b03[_0xddcf('0x82')](_0x2941a6);}})['then'](function(_0x2801be){if(_0x2801be){return _0x2801be?{'count':_0x404458,'rows':_0x2801be}:null;}})[_0xddcf('0x1f')](respondWithResult(_0x30804e,null))['catch'](handleError(_0x30804e,null));};function Extension(_0x21d52b,_0x479945,_0x34149,_0x5e4e66){this[_0xddcf('0x83')]=_0xddcf('0x84');this['exten']=_0x21d52b['localstationid'];this[_0xddcf('0x85')]=_0x5e4e66;this[_0xddcf('0x43')]='system';this['description']=_0xddcf('0x86');this[_0xddcf('0x64')]=_0x21d52b['id'];this[_0xddcf('0x81')]=_0x479945;this[_0xddcf('0x87')]=_0x34149;}function createExtensionsReciveFax(_0x2828c7){var _0xe74ecb=0x1;var _0x3f0491=[];_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,'',_0xddcf('0x89')));_0xe74ecb+=0x1;_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,_0xddcf('0x8a'),_0xddcf('0x8b')));_0xe74ecb+=0x1;for(var _0x545097 in _0x2828c7){if(_0x2828c7['hasOwnProperty'](_0x545097)&&(_0x545097===_0xddcf('0x8c')||_0x545097===_0xddcf('0x8d')||_0x545097===_0xddcf('0x8e')||_0x545097==='faxdetect'||_0x545097===_0xddcf('0x8f')||_0x545097===_0xddcf('0x90')||_0x545097===_0xddcf('0x91')||_0x545097===_0xddcf('0x92')||_0x545097==='t38timeout')){_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,_0xddcf('0x93')+_0x545097+')='+_0x2828c7[_0x545097],_0xddcf('0x8b')));_0xe74ecb+=0x1;}}_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,'6','Wait'));_0xe74ecb+=0x1;_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,'/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',_0xddcf('0x94')));_0xe74ecb=0x0;return _0x3f0491;}exports[_0xddcf('0x95')]=function(_0x37b6f8,_0x4116be,_0x29e04e){var _0x1ef10d;return db[_0xddcf('0x96')][_0xddcf('0x7f')](function(_0xf6bcda){return db[_0xddcf('0x54')][_0xddcf('0x5d')](_0x37b6f8[_0xddcf('0x5e')],{'transaction':_0xf6bcda})[_0xddcf('0x1f')](function(_0x56fd5c){_0x1ef10d=_0x56fd5c[_0xddcf('0x37')]({'plain':!![]});return db['VoiceExtension'][_0xddcf('0x97')](createExtensionsReciveFax(_0x1ef10d),{'transaction':_0xf6bcda});});})[_0xddcf('0x1f')](function(){return _0x1ef10d;})[_0xddcf('0x1f')](respondWithResult(_0x4116be,null))[_0xddcf('0x2a')](handleError(_0x4116be,null));};exports['updateAccountApplications']=function(_0x11ad50,_0x5ab4ce,_0x207782){var _0x433dd6;return db[_0xddcf('0x96')][_0xddcf('0x7f')](function(_0x40a703){return db[_0xddcf('0x54')][_0xddcf('0x35')](_0x11ad50['body'],{'where':{'id':_0x11ad50[_0xddcf('0x5e')]['id']},'transaction':_0x40a703})['then'](function(_0x54f206){return db['VoiceExtension'][_0xddcf('0x36')]({'where':{'FaxAccountId':_0x11ad50[_0xddcf('0x5e')]['id']},'transaction':_0x40a703})['then'](function(_0x1dc20a){return db[_0xddcf('0x98')][_0xddcf('0x97')](createExtensionsReciveFax(_['omit'](_0x11ad50[_0xddcf('0x5e')],[_0xddcf('0x99'),_0xddcf('0x44'),_0xddcf('0x9a'),_0xddcf('0x9b'),_0xddcf('0x9c'),_0xddcf('0x9d')])),{'transaction':_0x40a703});});});})[_0xddcf('0x1f')](function(){return db[_0xddcf('0x54')][_0xddcf('0x9e')](_0x11ad50['body']['id']);})[_0xddcf('0x1f')](respondWithResult(_0x5ab4ce,null))['catch'](handleError(_0x5ab4ce,null));};exports[_0xddcf('0x9f')]=function(_0x17885c,_0x1f5f10,_0x118372){var _0x230b0c={'raw':!![],'where':{}};var _0x73bef1={};var _0x27bf6e={'count':0x0,'rows':[]};return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x17885c[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x1f5f10,null))[_0xddcf('0x1f')](function(_0x440e96){if(_0x440e96){_0x73bef1['model']=_[_0xddcf('0x47')](db[_0xddcf('0xa0')]['rawAttributes']);_0x73bef1[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x17885c[_0xddcf('0x46')]);_0x73bef1[_0xddcf('0x48')]=_['intersection'](_0x73bef1['model'],_0x73bef1['query']);_0x230b0c['attributes']=_[_0xddcf('0x49')](_0x73bef1[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x17885c[_0xddcf('0x46')][_0xddcf('0x4a')]));_0x230b0c[_0xddcf('0x4b')]=_0x230b0c[_0xddcf('0x4b')]['length']?_0x230b0c[_0xddcf('0x4b')]:_0x73bef1[_0xddcf('0x45')];if(!_0x17885c[_0xddcf('0x46')]['hasOwnProperty']('nolimit')){_0x230b0c[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x17885c[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x230b0c[_0xddcf('0x2d')]=qs[_0xddcf('0x2d')](_0x17885c[_0xddcf('0x46')]['offset']);}_0x230b0c[_0xddcf('0x4f')]=qs['sort'](_0x17885c[_0xddcf('0x46')]['sort']);_0x230b0c[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_[_0xddcf('0x68')](_0x17885c[_0xddcf('0x46')],_0x73bef1['filters']));_0x230b0c[_0xddcf('0x51')][_0xddcf('0x64')]=_0x440e96['id'];if(_0x17885c[_0xddcf('0x46')][_0xddcf('0x52')]){_0x230b0c[_0xddcf('0x51')]=_[_0xddcf('0x5a')](_0x230b0c[_0xddcf('0x51')],{'$or':_['map'](_0x230b0c[_0xddcf('0x4b')],function(_0x444e03){var _0x32afc7={};_0x32afc7[_0x444e03]={'$like':'%'+_0x17885c['query'][_0xddcf('0x52')]+'%'};return _0x32afc7;})});}if(_0x17885c[_0xddcf('0x46')]['$gte']){var _0x57d1a0=_0x17885c[_0xddcf('0x46')]['$gte'][_0xddcf('0xa1')](',');var _0x282869={};_0x282869[_0x57d1a0[0x0]]={'$gte':moment(_0x57d1a0[0x1])['format'](_0xddcf('0xa2'))};_0x230b0c['where']=_[_0xddcf('0x5a')](_0x230b0c[_0xddcf('0x51')],_0x282869);}_0x230b0c=_[_0xddcf('0x5a')]({},_0x230b0c,_0x17885c['options']);return db['FaxMessage'][_0xddcf('0x30')]({'where':_0x230b0c[_0xddcf('0x51')]})[_0xddcf('0x1f')](function(_0x15e41b){_0x27bf6e['count']=_0x15e41b;if(_0x17885c[_0xddcf('0x46')][_0xddcf('0x55')]){_0x230b0c[_0xddcf('0x56')]=[{'all':!![]}];}return db[_0xddcf('0xa0')]['findAll'](_0x230b0c);})['then'](function(_0x4ec4c7){_0x27bf6e[_0xddcf('0x6e')]=_0x4ec4c7;return _0x27bf6e;});}})[_0xddcf('0x1f')](respondWithFilteredResult(_0x1f5f10,_0x230b0c))['catch'](handleError(_0x1f5f10,null));};exports['send']=function(_0xba9da1,_0x48d20a,_0x188a40){var _0x56bfad,_0x270147={},_0x5779fc;if(_0xba9da1['body']['to']){_0x5779fc=_0xba9da1[_0xddcf('0x5e')]['to'][0x0];}return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0xba9da1[_0xddcf('0x58')]['id']},'include':[{'model':db[_0xddcf('0xa3')],'as':_0xddcf('0xa4'),'include':[{'model':db[_0xddcf('0x75')],'as':_0xddcf('0xa5'),'where':{'fax':_0x5779fc},'limit':0x1,'order':[[_0xddcf('0x9b'),_0xddcf('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x48d20a,null))['then'](function(_0x26ad2e){_0x56bfad=_0x26ad2e;if(_0xba9da1[_0xddcf('0x5e')]['attachments']&&_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][_0xddcf('0x4c')]){for(var _0x5d4905=0x0;_0x5d4905<_0xba9da1['body'][_0xddcf('0xa7')][_0xddcf('0x4c')];_0x5d4905+=0x1){_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][_0x5d4905]={'filename':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][_0x5d4905]['name'],'id':_0xba9da1['body'][_0xddcf('0xa7')][_0x5d4905]['id'],'path':path[_0xddcf('0xa8')](config[_0xddcf('0xa9')],'server/files/attachments',_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][_0x5d4905]['basename'])};}}return respondWithRpcPromise(_0xddcf('0xaa'),_0xddcf('0xaa'),{'FaxAccountId':_['isNil'](_0xba9da1['params']['id'])?undefined:_0xba9da1['params']['id'],'path':_[_0xddcf('0xab')](_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['path'])?undefined:_0xba9da1[_0xddcf('0x5e')]['attachments'][0x0][_0xddcf('0xac')],'fax':_['isNil'](_0xba9da1[_0xddcf('0x5e')]['to'][0x0])?undefined:_0xba9da1[_0xddcf('0x5e')]['to'][0x0]},client9002);})[_0xddcf('0x1f')](function(){if(_0x56bfad){if(_[_0xddcf('0xab')](_0xba9da1['body'][_0xddcf('0xad')])){_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xad')]=util[_0xddcf('0xae')](_0xddcf('0xaf'),_0x56bfad['name'],_0x56bfad[_0xddcf('0xb0')]);}if(_0x56bfad[_0xddcf('0xa4')]){if(_0x56bfad[_0xddcf('0xa4')]['Contacts']['length']){return _0x56bfad[_0xddcf('0xa4')]['Contacts'][0x0];}else{return db[_0xddcf('0x75')][_0xddcf('0x5d')](_[_0xddcf('0x18')](_0xba9da1['body'],{'firstName':_0xba9da1['body']['to'][0x0],'phone':_0xba9da1[_0xddcf('0x5e')]['to'][0x0],'fax':_0xba9da1[_0xddcf('0x5e')]['to'][0x0],'ListId':_0x56bfad[_0xddcf('0x9d')]}));}}else{throw new Error(_0xddcf('0xb1'));}}else{throw new Error(_0xddcf('0xb2'));}})[_0xddcf('0x1f')](function(_0x256b7b){if(_0x256b7b){return db[_0xddcf('0x74')][_0xddcf('0x5c')]({'where':{'ContactId':_0x256b7b['id'],'closed':![],'FaxAccountId':_0x56bfad['id']}})['then'](function(_0x338237){if(_0x338237){return[_0x338237,![]];}return db[_0xddcf('0x74')][_0xddcf('0x5d')]({'UserId':_0xba9da1['user']['id'],'ContactId':_0x256b7b['id'],'FaxAccountId':_0x56bfad['id'],'fax':_0xba9da1['body']['to'][0x0],'firstMsgDirection':_0xddcf('0xb3'),'Messages':[_[_0xddcf('0x5a')](_0xba9da1[_0xddcf('0x5e')],{'read':![],'body':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0][_0xddcf('0xb4')],'FaxAccountId':_0x56bfad['id'],'UserId':_0xba9da1['user']['id'],'ContactId':_0x256b7b['id'],'AttachmentId':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xddcf('0xa0')],'as':'Messages'}]})[_0xddcf('0x1f')](function(_0x3bda6d){return[_0x3bda6d,!![]];});});}else{throw new Error(_0xddcf('0xb5'));}})[_0xddcf('0xb6')](function(_0xfe0bbd,_0x4cfc54){if(_0x4cfc54){return _0xfe0bbd;}return db[_0xddcf('0xa0')][_0xddcf('0x5d')]({'direction':_0xddcf('0xb3'),'read':![],'body':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['filename'],'FaxAccountId':_0x56bfad['id'],'FaxInteractionId':_0xfe0bbd['id'],'UserId':_0xba9da1[_0xddcf('0xb7')]['id'],'ContactId':_0xfe0bbd['ContactId'],'AttachmentId':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['id']})[_0xddcf('0x1f')](function(_0x52ac48){_0xfe0bbd[_0xddcf('0xb8')][_0xddcf('0xb9')]=[];_0xfe0bbd[_0xddcf('0xb8')][_0xddcf('0xb9')][_0xddcf('0x88')](_0x52ac48[_0xddcf('0xb8')]);return _0xfe0bbd;});})['then'](function(_0x5e59a0){respondWithRpcPromise(_0xddcf('0xba'),_0xddcf('0xba'),{'FaxAccountId':_['isNil'](_0xba9da1[_0xddcf('0x58')]['id'])?undefined:_0xba9da1[_0xddcf('0x58')]['id'],'path':_[_0xddcf('0xab')](_0xba9da1[_0xddcf('0x5e')]['attachments'][0x0][_0xddcf('0xac')])?undefined:_0xba9da1['body'][_0xddcf('0xa7')][0x0][_0xddcf('0xac')],'fax':_['isNil'](_0xba9da1['body']['to'][0x0])?undefined:_0xba9da1[_0xddcf('0x5e')]['to'][0x0],'AttachmentId':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['id']},client9002)[_0xddcf('0x1f')](function(_0x13c241){logger[_0xddcf('0x28')]('SendFaxRpc,\x20%s',_0x13c241);})[_0xddcf('0x2a')](function(_0x12b15c){logger[_0xddcf('0x28')](_0xddcf('0xbb'),_0x12b15c);});return _0x5e59a0;})[_0xddcf('0x1f')](respondWithResult(_0x48d20a,null))[_0xddcf('0x2a')](handleError(_0x48d20a,null));};exports['addAgents']=function(_0x490dd0,_0x53bf5d,_0x21c525){return db['FaxAccount'][_0xddcf('0x5c')]({'where':{'id':_0x490dd0[_0xddcf('0x58')]['id']}})['then'](handleEntityNotFound(_0x53bf5d,null))[_0xddcf('0x1f')](function(_0xa86c7b){if(_0xa86c7b){return _0xa86c7b['addAgents'](_0x490dd0[_0xddcf('0x5e')]['ids'],_[_0xddcf('0x72')](_0x490dd0['body'],[_0xddcf('0x70'),'id'])||{})[_0xddcf('0xb6')](function(_0x23a0b7){for(var _0x237746=0x0;_0x237746<_0x490dd0[_0xddcf('0x5e')][_0xddcf('0x70')][_0xddcf('0x4c')];_0x237746+=0x1){socket[_0xddcf('0xbc')](_0xddcf('0xbd'),{'UserId':Number(_0x490dd0[_0xddcf('0x5e')][_0xddcf('0x70')][_0x237746]),'FaxAccountId':Number(_0x490dd0[_0xddcf('0x58')]['id'])});}return _0x23a0b7;});}})['then'](respondWithResult(_0x53bf5d,null))[_0xddcf('0x2a')](handleError(_0x53bf5d,null));};exports[_0xddcf('0xbe')]=function(_0x476ed2,_0x475058,_0x324350){return db['FaxAccount']['find']({'where':{'id':_0x476ed2[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x475058,null))[_0xddcf('0x1f')](function(_0x4db3cd){if(_0x4db3cd){return _0x4db3cd[_0xddcf('0xbe')](_0x476ed2[_0xddcf('0x46')][_0xddcf('0x70')])[_0xddcf('0x1f')](function(){if(_[_0xddcf('0xbf')](_0x476ed2[_0xddcf('0x46')][_0xddcf('0x70')])){for(var _0x50d650=0x0;_0x50d650<_0x476ed2[_0xddcf('0x46')]['ids'][_0xddcf('0x4c')];_0x50d650+=0x1){socket['emit'](_0xddcf('0xc0'),{'UserId':Number(_0x476ed2['query']['ids'][_0x50d650]),'FaxAccountId':Number(_0x476ed2['params']['id'])});}}else{socket[_0xddcf('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x476ed2[_0xddcf('0x46')][_0xddcf('0x70')]),'FaxAccountId':Number(_0x476ed2['params']['id'])});}});}})[_0xddcf('0x1f')](respondWithStatusCode(_0x475058,null))[_0xddcf('0x2a')](handleError(_0x475058,null));};exports[_0xddcf('0xc1')]=function(_0x12c222,_0x1e6c68,_0x18e490){var _0x4545d4={};var _0x27e8e1={};var _0x44423a;var _0x35a45f;return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x12c222[_0xddcf('0x58')]['id']}})['then'](handleEntityNotFound(_0x1e6c68,null))['then'](function(_0x34c299){if(_0x34c299){_0x44423a=_0x34c299;_0x27e8e1['model']=_[_0xddcf('0x47')](db['User'][_0xddcf('0x41')]);_0x27e8e1[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x12c222[_0xddcf('0x46')]);_0x27e8e1[_0xddcf('0x48')]=_['intersection'](_0x27e8e1[_0xddcf('0x45')],_0x27e8e1[_0xddcf('0x46')]);_0x4545d4['attributes']=_[_0xddcf('0x49')](_0x27e8e1[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x12c222['query'][_0xddcf('0x4a')]));_0x4545d4[_0xddcf('0x4b')]=_0x4545d4['attributes'][_0xddcf('0x4c')]?_0x4545d4['attributes']:_0x27e8e1['model'];_0x4545d4[_0xddcf('0x4f')]=qs['sort'](_0x12c222[_0xddcf('0x46')]['sort']);_0x4545d4['where']=qs['filters'](_[_0xddcf('0x68')](_0x12c222['query'],_0x27e8e1[_0xddcf('0x48')]));if(_0x12c222[_0xddcf('0x46')][_0xddcf('0x52')]){_0x4545d4[_0xddcf('0x51')]=_['merge'](_0x4545d4[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x4545d4[_0xddcf('0x4b')],function(_0x4d1deb){var _0x2207f4={};_0x2207f4[_0x4d1deb]={'$like':'%'+_0x12c222[_0xddcf('0x46')][_0xddcf('0x52')]+'%'};return _0x2207f4;})});}_0x4545d4=_[_0xddcf('0x5a')]({},_0x4545d4,_0x12c222['options']);return _0x44423a['getAgents'](_0x4545d4);}})['then'](function(_0x272767){if(_0x272767){_0x35a45f=_0x272767['length'];if(!_0x12c222[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x4545d4[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x12c222[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x4545d4[_0xddcf('0x2d')]=qs[_0xddcf('0x2d')](_0x12c222['query'][_0xddcf('0x2d')]);}return _0x44423a[_0xddcf('0xc1')](_0x4545d4);}})[_0xddcf('0x1f')](function(_0x5500d8){if(_0x5500d8){return _0x5500d8?{'count':_0x35a45f,'rows':_0x5500d8}:null;}})[_0xddcf('0x1f')](respondWithResult(_0x1e6c68,null))['catch'](handleError(_0x1e6c68,null));};
\ No newline at end of file
index 1974fbe..4d864f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dd3=['../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0x2dd3,0x99));var _0x32dd=function(_0x2ebf33,_0x2d96cf){_0x2ebf33=_0x2ebf33-0x0;var _0x54bcb4=_0x2dd3[_0x2ebf33];return _0x54bcb4;};'use strict';var EventEmitter=require(_0x32dd('0x0'));var FaxAccount=require(_0x32dd('0x1'))['db'][_0x32dd('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x32dd('0x3')](0x0);var events={'afterCreate':_0x32dd('0x4'),'afterUpdate':_0x32dd('0x5'),'afterDestroy':_0x32dd('0x6')};function emitEvent(_0x3f584c){return function(_0x23730f,_0x3706ef,_0x2bc1d4){FaxAccountEvents[_0x32dd('0x7')](_0x3f584c+':'+_0x23730f['id'],_0x23730f);FaxAccountEvents['emit'](_0x3f584c,_0x23730f);_0x2bc1d4(null);};}for(var e in events){if(events[_0x32dd('0x8')](e)){var event=events[e];FaxAccount[_0x32dd('0x9')](e,emitEvent(event));}}module[_0x32dd('0xa')]=FaxAccountEvents;
\ No newline at end of file
+var _0x6acf=['../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x6acf,0x1d5));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf6ac('0x0'));var FaxAccount=require(_0xf6ac('0x1'))['db'][_0xf6ac('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf6ac('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6ac('0x4'),'afterDestroy':_0xf6ac('0x5')};function emitEvent(_0x525438){return function(_0x3be76d,_0x4f3f17,_0x4d0c89){FaxAccountEvents['emit'](_0x525438+':'+_0x3be76d['id'],_0x3be76d);FaxAccountEvents[_0xf6ac('0x6')](_0x525438,_0x3be76d);_0x4d0c89(null);};}for(var e in events){if(events[_0xf6ac('0x7')](e)){var event=events[e];FaxAccount[_0xf6ac('0x8')](e,emitEvent(event));}}module[_0xf6ac('0x9')]=FaxAccountEvents;
\ No newline at end of file
index 066de23..e1a8818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa322=['define','FaxAccount','fax_accounts','lodash','api','moment','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x4401e9,_0x3dd899){var _0x10edf7=function(_0x20d003){while(--_0x20d003){_0x4401e9['push'](_0x4401e9['shift']());}};_0x10edf7(++_0x3dd899);}(_0xa322,0x9c));var _0x2a32=function(_0x1c84a4,_0x93477a){_0x1c84a4=_0x1c84a4-0x0;var _0x7fa736=_0xa322[_0x1c84a4];return _0x7fa736;};'use strict';var _=require(_0x2a32('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2a32('0x1'));var moment=require(_0x2a32('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2a32('0x3'));var config=require(_0x2a32('0x4'));var attributes=require(_0x2a32('0x5'));module['exports']=function(_0x470f8f,_0x1a35ff){return _0x470f8f[_0x2a32('0x6')](_0x2a32('0x7'),attributes,{'tableName':_0x2a32('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3cb4=['fax_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount'];(function(_0x13892e,_0x23ad62){var _0x39527a=function(_0x10551b){while(--_0x10551b){_0x13892e['push'](_0x13892e['shift']());}};_0x39527a(++_0x23ad62);}(_0x3cb4,0xd1));var _0x43cb=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3cb4[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x43cb('0x0'));var util=require(_0x43cb('0x1'));var logger=require('../../config/logger')(_0x43cb('0x2'));var moment=require(_0x43cb('0x3'));var BPromise=require(_0x43cb('0x4'));var rp=require(_0x43cb('0x5'));var fs=require('fs');var path=require(_0x43cb('0x6'));var rimraf=require(_0x43cb('0x7'));var config=require(_0x43cb('0x8'));var attributes=require(_0x43cb('0x9'));module[_0x43cb('0xa')]=function(_0x331000,_0x4937c2){return _0x331000['define'](_0x43cb('0xb'),attributes,{'tableName':_0x43cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b14e363..606481a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54e5=['include','model','then','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','FaxApplication','Applications','applications','list','priority','asc','List','length','from','contact','FaxInteraction','create','Contact\x20not\x20found','spread','get','autoclose','push','unmanaged','created','interaction','ContactId','AttachmentId','User','name','UserId','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./faxAccount.socket','register','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','map'];(function(_0x196fb1,_0x3bcecc){var _0x5d0854=function(_0x26c566){while(--_0x26c566){_0x196fb1['push'](_0x196fb1['shift']());}};_0x5d0854(++_0x3bcecc);}(_0x54e5,0x1e5));var _0x554e=function(_0x21fc0a,_0x1c3a72){_0x21fc0a=_0x21fc0a-0x0;var _0x485574=_0x54e5[_0x21fc0a];return _0x485574;};'use strict';var _=require(_0x554e('0x0'));var util=require('util');var moment=require(_0x554e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x554e('0x2'))['db'];var utils=require(_0x554e('0x3'));var logger=require('../../config/logger')(_0x554e('0x4'));var config=require(_0x554e('0x5'));var jayson=require(_0x554e('0x6'));var client=jayson[_0x554e('0x7')]['http']({'port':0x232c});config[_0x554e('0x8')]=_[_0x554e('0x9')](config[_0x554e('0x8')],{'host':_0x554e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x554e('0x8')]));require(_0x554e('0xb'))[_0x554e('0xc')](socket);function respondWithRpcPromise(_0x22743b,_0x55b319,_0x366b39){return new BPromise(function(_0xe05612,_0x18a44f){return client[_0x554e('0xd')](_0x22743b,_0x366b39)['then'](function(_0x50d7aa){logger[_0x554e('0xe')]('FaxAccount,\x20%s,\x20%s',_0x55b319,_0x554e('0xf'));logger[_0x554e('0x10')](_0x554e('0x11'),_0x55b319,_0x554e('0xf'),JSON[_0x554e('0x12')](_0x50d7aa));if(_0x50d7aa[_0x554e('0x13')]){if(_0x50d7aa[_0x554e('0x13')][_0x554e('0x14')]===0x1f4){logger['error'](_0x554e('0x15'),_0x55b319,_0x50d7aa[_0x554e('0x13')]['message']);return _0x18a44f(_0x50d7aa[_0x554e('0x13')][_0x554e('0x16')]);}logger[_0x554e('0x13')](_0x554e('0x15'),_0x55b319,_0x50d7aa[_0x554e('0x13')][_0x554e('0x16')]);return _0xe05612(_0x50d7aa[_0x554e('0x13')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x55b319,_0x554e('0xf'));_0xe05612(_0x50d7aa['result']['message']);}})[_0x554e('0x17')](function(_0x2fd29c){logger[_0x554e('0x13')](_0x554e('0x15'),_0x55b319,_0x2fd29c);_0x18a44f(_0x2fd29c);});});}exports[_0x554e('0x18')]=function(_0x597358){var _0x3e55f6=this;return new Promise(function(_0x490658,_0x2e4d1f){return db[_0x554e('0x19')]['findAll']({'raw':_0x597358['options']?_0x597358[_0x554e('0x1a')][_0x554e('0x1b')]===undefined?!![]:![]:!![],'where':_0x597358['options']?_0x597358[_0x554e('0x1a')][_0x554e('0x1c')]||null:null,'attributes':_0x597358[_0x554e('0x1a')]?_0x597358[_0x554e('0x1a')][_0x554e('0x1d')]||null:null,'limit':_0x597358[_0x554e('0x1a')]?_0x597358[_0x554e('0x1a')]['limit']||null:null,'include':_0x597358[_0x554e('0x1a')]?_0x597358[_0x554e('0x1a')]['include']?_[_0x554e('0x1e')](_0x597358[_0x554e('0x1a')][_0x554e('0x1f')],function(_0x1804f1){return{'model':db[_0x1804f1[_0x554e('0x20')]],'as':_0x1804f1['as'],'attributes':_0x1804f1[_0x554e('0x1d')],'include':_0x1804f1[_0x554e('0x1f')]?_['map'](_0x1804f1['include'],function(_0x1a9604){return{'model':db[_0x1a9604[_0x554e('0x20')]],'as':_0x1a9604['as'],'attributes':_0x1a9604[_0x554e('0x1d')],'include':_0x1a9604[_0x554e('0x1f')]?_['map'](_0x1a9604['include'],function(_0x10ba74){return{'model':db[_0x10ba74['model']],'as':_0x10ba74['as'],'attributes':_0x10ba74[_0x554e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x554e('0x21')](function(_0x3cab16){logger[_0x554e('0xe')](_0x554e('0x18'),_0x597358);logger['debug'](_0x554e('0x18'),_0x597358,JSON[_0x554e('0x12')](_0x3cab16));_0x490658(_0x3cab16);})[_0x554e('0x17')](function(_0x307cad){logger[_0x554e('0x13')](_0x554e('0x18'),_0x307cad['message'],_0x597358);_0x2e4d1f(_0x3e55f6[_0x554e('0x13')](0x1f4,_0x307cad[_0x554e('0x16')]));});});};exports[_0x554e('0x22')]=function(_0x27bf55,_0x589093,_0x562230){var _0x3e4d0e=this;return new Promise(function(_0x2bd141,_0x117ad7){var _0x272cc4={'body':_0x27bf55[_0x554e('0x23')],'channel':'fax'};var _0x38f584=[];var _0x597115=[];var _0x42606b={};return db[_0x554e('0x24')][_0x554e('0x25')]()[_0x554e('0x21')](function(_0x2f413f){if(!_0x2f413f){throw new db[(_0x554e('0x26'))][(_0x554e('0x27'))](_0x554e('0x28'));}_0x38f584=_[_0x554e('0x29')](_['keys'](_0x2f413f),[_0x554e('0x2a'),_0x554e('0x2b')]);_0x597115=_[_0x554e('0x29')](_['keys'](_0x2f413f),['createdAt',_0x554e('0x2b'),_0x554e('0x2c'),_0x554e('0x2d')]);if(_0x27bf55['body']['id']){delete _0x27bf55[_0x554e('0x23')]['id'];}if(_[_0x554e('0x2e')](_0x27bf55[_0x554e('0x23')]['from'])){throw new db[(_0x554e('0x26'))]['ValidationError'](_0x554e('0x2f'));}if(_[_0x554e('0x2e')](_0x27bf55[_0x554e('0x23')][_0x554e('0x23')])||_0x27bf55[_0x554e('0x23')]['body']===''){throw new db[(_0x554e('0x26'))]['ValidationError'](_0x554e('0x30'));}if(_[_0x554e('0x2e')](_0x27bf55[_0x554e('0x23')][_0x554e('0x31')])){throw new db[(_0x554e('0x26'))][(_0x554e('0x27'))](_0x554e('0x32')+_0x597115);}if(!_[_0x554e('0x33')](_0x597115,_0x27bf55['body']['mapKey'])){throw new db[(_0x554e('0x26'))][(_0x554e('0x27'))](_0x554e('0x34')+_0x597115);}_0x42606b[_0x27bf55['body'][_0x554e('0x31')]]=_0x27bf55[_0x554e('0x23')]['from'];})[_0x554e('0x21')](function(){return db[_0x554e('0x19')][_0x554e('0x35')]({'where':{'id':_0x27bf55[_0x554e('0x36')]['id']},'include':[{'model':db[_0x554e('0x37')],'as':'List','include':[{'model':db[_0x554e('0x24')],'as':_0x554e('0x38'),'where':_0x42606b,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x554e('0x39')],'as':_0x554e('0x3a')}]});})[_0x554e('0x21')](function(_0x22127e){if(_0x22127e&&_0x22127e['List']){var _0x2f1dea=_0x22127e['get']({'plain':!![]});_0x272cc4[_0x554e('0x36')]=_0x2f1dea;_0x272cc4[_0x554e('0x3b')]=_0x2f1dea[_0x554e('0x3a')];_0x272cc4[_0x554e('0x3c')]=_0x2f1dea['List'];_0x272cc4[_0x554e('0x3b')]=_['orderBy'](_0x272cc4[_0x554e('0x3b')],[_0x554e('0x3d')],[_0x554e('0x3e')]);if(_0x272cc4['account'][_0x554e('0x3a')]){delete _0x272cc4[_0x554e('0x36')][_0x554e('0x3a')];}if(_0x272cc4[_0x554e('0x36')][_0x554e('0x3f')]&&_0x272cc4[_0x554e('0x36')][_0x554e('0x3f')]['Contacts'][_0x554e('0x40')]){return _0x272cc4[_0x554e('0x36')][_0x554e('0x3f')]['Contacts'][0x0];}var _0x399637=_[_0x554e('0x9')](_0x27bf55[_0x554e('0x23')],{'firstName':_0x27bf55[_0x554e('0x23')][_0x554e('0x41')],'ListId':_0x2f1dea['ListId']});_0x399637[_0x27bf55[_0x554e('0x23')][_0x554e('0x31')]]=_0x27bf55[_0x554e('0x23')][_0x554e('0x41')];return db[_0x554e('0x24')]['create'](_0x399637,{'fields':_0x38f584,'raw':!![]});}})[_0x554e('0x21')](function(_0x2f8c39){_0x272cc4[_0x554e('0x42')]=_0x2f8c39;if(_0x2f8c39){var _0x46400f={'ContactId':_0x2f8c39['id'],'FaxAccountId':_0x27bf55[_0x554e('0x36')]['id'],'fax':_0x2f8c39['fax']};return db[_0x554e('0x43')][_0x554e('0x35')]({'where':{'ContactId':_0x2f8c39['id'],'closed':![],'FaxAccountId':_0x27bf55[_0x554e('0x36')]['id']}})[_0x554e('0x21')](function(_0x1cbe5a){if(_0x1cbe5a){return[_0x1cbe5a,![]];}return db['FaxInteraction'][_0x554e('0x44')](_0x46400f)['then'](function(_0x1990c0){return[_0x1990c0,!![]];});});}else{throw new Error(_0x554e('0x45'));}})[_0x554e('0x46')](function(_0x359997,_0x3eb502){var _0x51d983=_0x359997[_0x554e('0x47')]({'plain':!![]});if(_0x3eb502){if(_0x272cc4[_0x554e('0x36')][_0x554e('0x48')]){_0x272cc4[_0x554e('0x3b')][_0x554e('0x49')]({'id':0x0,'priority':_0x272cc4['applications'][_0x554e('0x40')]+0x1,'app':'close','appdata':_0x554e('0x4a'),'interval':'*,*,*,*'});}_0x51d983[_0x554e('0x4b')]=!![];}else{_0x51d983['created']=![];}_0x272cc4[_0x554e('0x4c')]=_0x51d983;return db['FaxMessage']['create']({'body':_0x27bf55[_0x554e('0x23')][_0x554e('0x23')],'FaxAccountId':_0x27bf55['account']['id'],'FaxInteractionId':_0x359997['id'],'direction':'in','ContactId':_0x359997[_0x554e('0x4d')],'AttachmentId':_0x27bf55[_0x554e('0x23')][_0x554e('0x4e')]});})[_0x554e('0x21')](function(_0x2367b5){_0x272cc4['message']=_0x2367b5;if(_0x272cc4[_0x554e('0x4c')]['UserId']){return db[_0x554e('0x4f')][_0x554e('0x35')]({'attributes':['id',_0x554e('0x50')],'where':{'id':_0x272cc4[_0x554e('0x4c')][_0x554e('0x51')]}})['then'](function(_0x160b17){if(_0x160b17){_0x272cc4[_0x554e('0x3b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x554e('0x52'),'appdata':_0x160b17[_0x554e('0x50')]+','+(_0x272cc4[_0x554e('0x36')][_0x554e('0x53')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x554e('0x54'),_0x554e('0x55'),_0x272cc4);});}return respondWithRpcPromise('Start',_0x554e('0x55'),_0x272cc4);})[_0x554e('0x21')](function(_0x2134fd){_0x2bd141(_0x2134fd);})[_0x554e('0x17')](function(_0x2412df){_0x117ad7(_0x3e4d0e[_0x554e('0x13')](0x1f4,_0x2412df[_0x554e('0x16')]));});});};
\ No newline at end of file
+var _0xf695=['ContactId','AttachmentId','UserId','name','interaction','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','FaxAccount,\x20%s,\x20%s','FaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetFaxAccount','stringify','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','CmList','List','Contacts','FaxApplication','get','account','applications','Applications','length','create','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','created','FaxMessage'];(function(_0x3aa8d7,_0x14bacf){var _0x41711e=function(_0x3d1301){while(--_0x3d1301){_0x3aa8d7['push'](_0x3aa8d7['shift']());}};_0x41711e(++_0x14bacf);}(_0xf695,0x1b8));var _0x5f69=function(_0x19f9a5,_0xa6924a){_0x19f9a5=_0x19f9a5-0x0;var _0x2eada1=_0xf695[_0x19f9a5];return _0x2eada1;};'use strict';var _=require('lodash');var util=require(_0x5f69('0x0'));var moment=require(_0x5f69('0x1'));var BPromise=require(_0x5f69('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f69('0x3'));var db=require(_0x5f69('0x4'))['db'];var utils=require(_0x5f69('0x5'));var logger=require(_0x5f69('0x6'))(_0x5f69('0x7'));var config=require(_0x5f69('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f69('0x9')][_0x5f69('0xa')]({'port':0x232c});config['redis']=_[_0x5f69('0xb')](config[_0x5f69('0xc')],{'host':_0x5f69('0xd'),'port':0x18eb});var socket=require(_0x5f69('0xe'))(new Redis(config[_0x5f69('0xc')]));require('./faxAccount.socket')[_0x5f69('0xf')](socket);function respondWithRpcPromise(_0x3cbf83,_0x4a40ee,_0xbe2901){return new BPromise(function(_0x432a13,_0x24c136){return client[_0x5f69('0x10')](_0x3cbf83,_0xbe2901)[_0x5f69('0x11')](function(_0x4e388f){logger[_0x5f69('0x12')]('FaxAccount,\x20%s,\x20%s',_0x4a40ee,_0x5f69('0x13'));logger[_0x5f69('0x14')](_0x5f69('0x15'),_0x4a40ee,_0x5f69('0x13'),JSON['stringify'](_0x4e388f));if(_0x4e388f[_0x5f69('0x16')]){if(_0x4e388f['error']['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4a40ee,_0x4e388f[_0x5f69('0x16')][_0x5f69('0x17')]);return _0x24c136(_0x4e388f[_0x5f69('0x16')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x4a40ee,_0x4e388f[_0x5f69('0x16')][_0x5f69('0x17')]);return _0x432a13(_0x4e388f[_0x5f69('0x16')][_0x5f69('0x17')]);}else{logger[_0x5f69('0x12')](_0x5f69('0x18'),_0x4a40ee,'request\x20sent');_0x432a13(_0x4e388f['result']['message']);}})['catch'](function(_0x315039){logger['error'](_0x5f69('0x18'),_0x4a40ee,_0x315039);_0x24c136(_0x315039);});});}exports['GetFaxAccount']=function(_0x4f0db2){var _0x1b901d=this;return new Promise(function(_0x251bc1,_0x4d873d){return db[_0x5f69('0x19')][_0x5f69('0x1a')]({'raw':_0x4f0db2['options']?_0x4f0db2[_0x5f69('0x1b')][_0x5f69('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f0db2['options']?_0x4f0db2[_0x5f69('0x1b')][_0x5f69('0x1d')]||null:null,'attributes':_0x4f0db2[_0x5f69('0x1b')]?_0x4f0db2[_0x5f69('0x1b')]['attributes']||null:null,'limit':_0x4f0db2[_0x5f69('0x1b')]?_0x4f0db2['options'][_0x5f69('0x1e')]||null:null,'include':_0x4f0db2[_0x5f69('0x1b')]?_0x4f0db2[_0x5f69('0x1b')][_0x5f69('0x1f')]?_[_0x5f69('0x20')](_0x4f0db2['options'][_0x5f69('0x1f')],function(_0x4dcaf0){return{'model':db[_0x4dcaf0[_0x5f69('0x21')]],'as':_0x4dcaf0['as'],'attributes':_0x4dcaf0[_0x5f69('0x22')],'include':_0x4dcaf0['include']?_[_0x5f69('0x20')](_0x4dcaf0[_0x5f69('0x1f')],function(_0x51190f){return{'model':db[_0x51190f[_0x5f69('0x21')]],'as':_0x51190f['as'],'attributes':_0x51190f[_0x5f69('0x22')],'include':_0x51190f[_0x5f69('0x1f')]?_[_0x5f69('0x20')](_0x51190f[_0x5f69('0x1f')],function(_0x1915e3){return{'model':db[_0x1915e3[_0x5f69('0x21')]],'as':_0x1915e3['as'],'attributes':_0x1915e3[_0x5f69('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26f025){logger[_0x5f69('0x12')](_0x5f69('0x23'),_0x4f0db2);logger[_0x5f69('0x14')]('GetFaxAccount',_0x4f0db2,JSON[_0x5f69('0x24')](_0x26f025));_0x251bc1(_0x26f025);})[_0x5f69('0x25')](function(_0x4906f3){logger[_0x5f69('0x16')](_0x5f69('0x23'),_0x4906f3[_0x5f69('0x17')],_0x4f0db2);_0x4d873d(_0x1b901d[_0x5f69('0x16')](0x1f4,_0x4906f3[_0x5f69('0x17')]));});});};exports[_0x5f69('0x26')]=function(_0x19ef94,_0x2a9d11,_0xbc1d40){var _0x30f3c4=this;return new Promise(function(_0x172959,_0x311c6f){var _0x50fea0={'body':_0x19ef94[_0x5f69('0x27')],'channel':_0x5f69('0x28')};var _0x4770fb=[];var _0x14538a=[];var _0x304779={};return db[_0x5f69('0x29')][_0x5f69('0x2a')]()[_0x5f69('0x11')](function(_0x1d4512){if(!_0x1d4512){throw new db[(_0x5f69('0x2b'))][(_0x5f69('0x2c'))](_0x5f69('0x2d'));}_0x4770fb=_['difference'](_[_0x5f69('0x2e')](_0x1d4512),[_0x5f69('0x2f'),_0x5f69('0x30')]);_0x14538a=_[_0x5f69('0x31')](_[_0x5f69('0x2e')](_0x1d4512),[_0x5f69('0x2f'),_0x5f69('0x30'),'CompanyId',_0x5f69('0x32')]);if(_0x19ef94[_0x5f69('0x27')]['id']){delete _0x19ef94[_0x5f69('0x27')]['id'];}if(_['isNil'](_0x19ef94[_0x5f69('0x27')]['from'])){throw new db[(_0x5f69('0x2b'))]['ValidationError'](_0x5f69('0x33'));}if(_[_0x5f69('0x34')](_0x19ef94[_0x5f69('0x27')][_0x5f69('0x27')])||_0x19ef94[_0x5f69('0x27')][_0x5f69('0x27')]===''){throw new db[(_0x5f69('0x2b'))][(_0x5f69('0x2c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x19ef94[_0x5f69('0x27')]['mapKey'])){throw new db[(_0x5f69('0x2b'))][(_0x5f69('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14538a);}if(!_['includes'](_0x14538a,_0x19ef94[_0x5f69('0x27')][_0x5f69('0x35')])){throw new db['Sequelize'][(_0x5f69('0x2c'))](_0x5f69('0x36')+_0x14538a);}_0x304779[_0x19ef94[_0x5f69('0x27')][_0x5f69('0x35')]]=_0x19ef94['body'][_0x5f69('0x37')];})['then'](function(){return db[_0x5f69('0x19')][_0x5f69('0x38')]({'where':{'id':_0x19ef94['account']['id']},'include':[{'model':db[_0x5f69('0x39')],'as':_0x5f69('0x3a'),'include':[{'model':db[_0x5f69('0x29')],'as':_0x5f69('0x3b'),'where':_0x304779,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x5f69('0x3c')],'as':'Applications'}]});})['then'](function(_0x380ef5){if(_0x380ef5&&_0x380ef5[_0x5f69('0x3a')]){var _0x158fa6=_0x380ef5[_0x5f69('0x3d')]({'plain':!![]});_0x50fea0[_0x5f69('0x3e')]=_0x158fa6;_0x50fea0[_0x5f69('0x3f')]=_0x158fa6[_0x5f69('0x40')];_0x50fea0['list']=_0x158fa6[_0x5f69('0x3a')];_0x50fea0[_0x5f69('0x3f')]=_['orderBy'](_0x50fea0[_0x5f69('0x3f')],['priority'],['asc']);if(_0x50fea0[_0x5f69('0x3e')][_0x5f69('0x40')]){delete _0x50fea0[_0x5f69('0x3e')][_0x5f69('0x40')];}if(_0x50fea0[_0x5f69('0x3e')][_0x5f69('0x3a')]&&_0x50fea0[_0x5f69('0x3e')]['List'][_0x5f69('0x3b')][_0x5f69('0x41')]){return _0x50fea0[_0x5f69('0x3e')][_0x5f69('0x3a')][_0x5f69('0x3b')][0x0];}var _0x561f1d=_['defaults'](_0x19ef94[_0x5f69('0x27')],{'firstName':_0x19ef94[_0x5f69('0x27')][_0x5f69('0x37')],'ListId':_0x158fa6['ListId']});_0x561f1d[_0x19ef94[_0x5f69('0x27')][_0x5f69('0x35')]]=_0x19ef94[_0x5f69('0x27')][_0x5f69('0x37')];return db[_0x5f69('0x29')][_0x5f69('0x42')](_0x561f1d,{'fields':_0x4770fb,'raw':!![]});}})[_0x5f69('0x11')](function(_0x52e8d1){_0x50fea0[_0x5f69('0x43')]=_0x52e8d1;if(_0x52e8d1){var _0x2c3fd7={'ContactId':_0x52e8d1['id'],'FaxAccountId':_0x19ef94['account']['id'],'fax':_0x52e8d1[_0x5f69('0x28')]};return db[_0x5f69('0x44')]['find']({'where':{'ContactId':_0x52e8d1['id'],'closed':![],'FaxAccountId':_0x19ef94[_0x5f69('0x3e')]['id']}})[_0x5f69('0x11')](function(_0x22b0db){if(_0x22b0db){return[_0x22b0db,![]];}return db[_0x5f69('0x44')][_0x5f69('0x42')](_0x2c3fd7)[_0x5f69('0x11')](function(_0x22cac2){return[_0x22cac2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x5f69('0x45')](function(_0x138ade,_0x23ec72){var _0x4f6266=_0x138ade[_0x5f69('0x3d')]({'plain':!![]});if(_0x23ec72){if(_0x50fea0['account'][_0x5f69('0x46')]){_0x50fea0[_0x5f69('0x3f')][_0x5f69('0x47')]({'id':0x0,'priority':_0x50fea0[_0x5f69('0x3f')][_0x5f69('0x41')]+0x1,'app':_0x5f69('0x48'),'appdata':_0x5f69('0x49'),'interval':'*,*,*,*'});}_0x4f6266[_0x5f69('0x4a')]=!![];}else{_0x4f6266[_0x5f69('0x4a')]=![];}_0x50fea0['interaction']=_0x4f6266;return db[_0x5f69('0x4b')]['create']({'body':_0x19ef94[_0x5f69('0x27')][_0x5f69('0x27')],'FaxAccountId':_0x19ef94[_0x5f69('0x3e')]['id'],'FaxInteractionId':_0x138ade['id'],'direction':'in','ContactId':_0x138ade[_0x5f69('0x4c')],'AttachmentId':_0x19ef94[_0x5f69('0x27')][_0x5f69('0x4d')]});})[_0x5f69('0x11')](function(_0x5cb7fa){_0x50fea0[_0x5f69('0x17')]=_0x5cb7fa;if(_0x50fea0['interaction'][_0x5f69('0x4e')]){return db['User']['find']({'attributes':['id',_0x5f69('0x4f')],'where':{'id':_0x50fea0[_0x5f69('0x50')]['UserId']}})[_0x5f69('0x11')](function(_0x2e8bee){if(_0x2e8bee){_0x50fea0['applications'][_0x5f69('0x51')]({'id':0x0,'priority':0x0,'app':_0x5f69('0x52'),'appdata':_0x2e8bee['name']+','+(_0x50fea0[_0x5f69('0x3e')][_0x5f69('0x53')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5f69('0x54'),_0x5f69('0x55'),_0x50fea0);});}return respondWithRpcPromise(_0x5f69('0x54'),_0x5f69('0x55'),_0x50fea0);})['then'](function(_0x4e772d){_0x172959(_0x4e772d);})['catch'](function(_0x5b6f52){_0x311c6f(_0x30f3c4[_0x5f69('0x16')](0x1f4,_0x5b6f52[_0x5f69('0x17')]));});});};
\ No newline at end of file
index 8a1c80b..c269e23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x617b=['emit','removeListener','register','length','save','remove'];(function(_0x55e27a,_0x411f87){var _0x210093=function(_0x2f5c27){while(--_0x2f5c27){_0x55e27a['push'](_0x55e27a['shift']());}};_0x210093(++_0x411f87);}(_0x617b,0x88));var _0xb617=function(_0x4dde9a,_0x330085){_0x4dde9a=_0x4dde9a-0x0;var _0x562f39=_0x617b[_0x4dde9a];return _0x562f39;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xb617('0x0'),_0xb617('0x1'),'update'];function createListener(_0xec349a,_0x397677){return function(_0x4a5aea){_0x397677[_0xb617('0x2')](_0xec349a,_0x4a5aea);};}function removeListener(_0x2dc30f,_0x78494b){return function(){FaxAccountEvents[_0xb617('0x3')](_0x2dc30f,_0x78494b);};}exports[_0xb617('0x4')]=function(_0x11165a){for(var _0x12830e=0x0,_0x2a04dc=events[_0xb617('0x5')];_0x12830e<_0x2a04dc;_0x12830e++){var _0x19f936=events[_0x12830e];var _0x164830=createListener('faxAccount:'+_0x19f936,_0x11165a);FaxAccountEvents['on'](_0x19f936,_0x164830);}};
\ No newline at end of file
+var _0xe7fd=['./faxAccount.events','save','remove','emit','removeListener','length','faxAccount:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe7fd,0x8c));var _0xde7f=function(_0x41b7c4,_0x177675){_0x41b7c4=_0x41b7c4-0x0;var _0x138973=_0xe7fd[_0x41b7c4];return _0x138973;};'use strict';var FaxAccountEvents=require(_0xde7f('0x0'));var events=[_0xde7f('0x1'),_0xde7f('0x2'),'update'];function createListener(_0x57b50b,_0x4897e4){return function(_0x4f2eaa){_0x4897e4[_0xde7f('0x3')](_0x57b50b,_0x4f2eaa);};}function removeListener(_0x56c9aa,_0x1e2afb){return function(){FaxAccountEvents[_0xde7f('0x4')](_0x56c9aa,_0x1e2afb);};}exports['register']=function(_0x3b6ae8){for(var _0x577fe3=0x0,_0x7119a0=events[_0xde7f('0x5')];_0x577fe3<_0x7119a0;_0x577fe3++){var _0x5d5075=events[_0x577fe3];var _0x1b613d=createListener(_0xde7f('0x6')+_0x5d5075,_0x3b6ae8);FaxAccountEvents['on'](_0x5d5075,_0x1b613d);}};
\ No newline at end of file
index 288e96a..6064dc1 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(_0x3d3093,_0x1e6521){var _0x1eeaa2=function(_0x5bbcbb){while(--_0x5bbcbb){_0x3d3093['push'](_0x3d3093['shift']());}};_0x1eeaa2(++_0x1e6521);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x2a829f,_0x1b0c15){var _0x5737c3=function(_0x2376f9){while(--_0x2376f9){_0x2a829f['push'](_0x2a829f['shift']());}};_0x5737c3(++_0x1b0c15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 90198b4..af297a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43a8=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x486044,_0x4744b8){var _0xa84573=function(_0x1973fa){while(--_0x1973fa){_0x486044['push'](_0x486044['shift']());}};_0xa84573(++_0x4744b8);}(_0x43a8,0x75));var _0x843a=function(_0x4d0e0b,_0x441669){_0x4d0e0b=_0x4d0e0b-0x0;var _0x487a9c=_0x43a8[_0x4d0e0b];return _0x487a9c;};'use strict';var Sequelize=require(_0x843a('0x0'));module[_0x843a('0x1')]={'priority':{'type':Sequelize[_0x843a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x843a('0x3')],'allowNull':![],'defaultValue':_0x843a('0x4')},'appdata':{'type':Sequelize[_0x843a('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x843a('0x3')],'defaultValue':_0x843a('0x6')}};
\ No newline at end of file
+var _0x43b0=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x43b0,0x1bc));var _0x043b=function(_0x5f4b31,_0x4dc6bc){_0x5f4b31=_0x5f4b31-0x0;var _0x71f868=_0x43b0[_0x5f4b31];return _0x71f868;};'use strict';var Sequelize=require(_0x043b('0x0'));module[_0x043b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x043b('0x2')],'allowNull':![],'defaultValue':_0x043b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x043b('0x2')]},'interval':{'type':Sequelize[_0x043b('0x2')],'defaultValue':_0x043b('0x4')}};
\ No newline at end of file
index 1f93813..120c60f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64df=['merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x2235b3,_0x3ac319){var _0x5ae6fd=function(_0x27b458){while(--_0x27b458){_0x2235b3['push'](_0x2235b3['shift']());}};_0x5ae6fd(++_0x3ac319);}(_0x64df,0x135));var _0xf64d=function(_0x236ce3,_0xb8d03f){_0x236ce3=_0x236ce3-0x0;var _0x4a3f88=_0x64df[_0x236ce3];return _0x4a3f88;};'use strict';var emlformat=require(_0xf64d('0x0'));var rimraf=require(_0xf64d('0x1'));var zipdir=require(_0xf64d('0x2'));var jsonpatch=require(_0xf64d('0x3'));var rp=require(_0xf64d('0x4'));var moment=require(_0xf64d('0x5'));var BPromise=require(_0xf64d('0x6'));var Mustache=require(_0xf64d('0x7'));var util=require(_0xf64d('0x8'));var path=require(_0xf64d('0x9'));var sox=require('sox');var csv=require(_0xf64d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf64d('0xb'));var crypto=require(_0xf64d('0xc'));var jsforce=require(_0xf64d('0xd'));var deskjs=require(_0xf64d('0xe'));var toCsv=require(_0xf64d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf64d('0xf'));var authService=require(_0xf64d('0x10'));var qs=require(_0xf64d('0x11'));var as=require(_0xf64d('0x12'));var hardwareService=require(_0xf64d('0x13'));var logger=require('../../config/logger')(_0xf64d('0x14'));var utils=require(_0xf64d('0x15'));var config=require(_0xf64d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf64d('0x17'))['db'];function respondWithStatusCode(_0x37f156,_0x2db671){_0x2db671=_0x2db671||0xcc;return function(_0x34ad97){if(_0x34ad97){return _0x37f156['sendStatus'](_0x2db671);}return _0x37f156[_0xf64d('0x18')](_0x2db671)[_0xf64d('0x19')]();};}function respondWithResult(_0x2bdca7,_0x37058f){_0x37058f=_0x37058f||0xc8;return function(_0x409aea){if(_0x409aea){return _0x2bdca7[_0xf64d('0x18')](_0x37058f)[_0xf64d('0x1a')](_0x409aea);}};}function respondWithFilteredResult(_0x5e6ddd,_0x87a3c3){return function(_0x56ed2f){if(_0x56ed2f){var _0x1550b0=typeof _0x87a3c3[_0xf64d('0x1b')]==='undefined'&&typeof _0x87a3c3[_0xf64d('0x1c')]===_0xf64d('0x1d');var _0xab433=_0x56ed2f[_0xf64d('0x1e')];var _0x142b09=_0x1550b0?0x0:_0x87a3c3[_0xf64d('0x1b')];var _0x14aa35=_0x1550b0?_0x56ed2f['count']:_0x87a3c3[_0xf64d('0x1b')]+_0x87a3c3['limit'];var _0x23ca2a;if(_0x14aa35>=_0xab433){_0x14aa35=_0xab433;_0x23ca2a=0xc8;}else{_0x23ca2a=0xce;}_0x5e6ddd[_0xf64d('0x18')](_0x23ca2a);return _0x5e6ddd['set'](_0xf64d('0x1f'),_0x142b09+'-'+_0x14aa35+'/'+_0xab433)['json'](_0x56ed2f);}return null;};}function patchUpdates(_0x41f710){return function(_0x3bc63b){try{jsonpatch[_0xf64d('0x20')](_0x3bc63b,_0x41f710,!![]);}catch(_0x1eda9b){return BPromise['reject'](_0x1eda9b);}return _0x3bc63b[_0xf64d('0x21')]();};}function saveUpdates(_0x686412,_0x31437d){return function(_0x55094b){if(_0x55094b){return _0x55094b[_0xf64d('0x22')](_0x686412)[_0xf64d('0x23')](function(_0x4c2eac){return _0x4c2eac;});}return null;};}function removeEntity(_0x403b70,_0x2dd5c8){return function(_0xc0565c){if(_0xc0565c){return _0xc0565c[_0xf64d('0x24')]()[_0xf64d('0x23')](function(){_0x403b70[_0xf64d('0x18')](0xcc)[_0xf64d('0x19')]();});}};}function handleEntityNotFound(_0x35b514,_0x175481){return function(_0x281d69){if(!_0x281d69){_0x35b514['sendStatus'](0x194);}return _0x281d69;};}function handleError(_0x34d293,_0x2a4a96){_0x2a4a96=_0x2a4a96||0x1f4;return function(_0x3a649a){logger[_0xf64d('0x25')](_0x3a649a[_0xf64d('0x26')]);if(_0x3a649a['name']){delete _0x3a649a[_0xf64d('0x27')];}_0x34d293['status'](_0x2a4a96)[_0xf64d('0x28')](_0x3a649a);};}exports[_0xf64d('0x29')]=function(_0x179fd0,_0x889bc3){var _0x5a6aa8={},_0x51926e={},_0x11387a={'count':0x0,'rows':[]};var _0x4f820f=_[_0xf64d('0x2a')](db[_0xf64d('0x2b')][_0xf64d('0x2c')],function(_0x8bdde2){return{'name':_0x8bdde2[_0xf64d('0x2d')],'type':_0x8bdde2[_0xf64d('0x2e')][_0xf64d('0x2f')]};});_0x51926e[_0xf64d('0x30')]=_[_0xf64d('0x2a')](_0x4f820f,_0xf64d('0x27'));_0x51926e[_0xf64d('0x31')]=_['keys'](_0x179fd0['query']);_0x51926e[_0xf64d('0x32')]=_[_0xf64d('0x33')](_0x51926e['model'],_0x51926e[_0xf64d('0x31')]);_0x5a6aa8[_0xf64d('0x34')]=_[_0xf64d('0x33')](_0x51926e[_0xf64d('0x30')],qs[_0xf64d('0x35')](_0x179fd0[_0xf64d('0x31')][_0xf64d('0x35')]));_0x5a6aa8['attributes']=_0x5a6aa8['attributes'][_0xf64d('0x36')]?_0x5a6aa8[_0xf64d('0x34')]:_0x51926e[_0xf64d('0x30')];if(!_0x179fd0[_0xf64d('0x31')][_0xf64d('0x37')]('nolimit')){_0x5a6aa8[_0xf64d('0x1c')]=qs[_0xf64d('0x1c')](_0x179fd0[_0xf64d('0x31')][_0xf64d('0x1c')]);_0x5a6aa8[_0xf64d('0x1b')]=qs['offset'](_0x179fd0[_0xf64d('0x31')]['offset']);}_0x5a6aa8[_0xf64d('0x38')]=qs[_0xf64d('0x39')](_0x179fd0[_0xf64d('0x31')][_0xf64d('0x39')]);_0x5a6aa8[_0xf64d('0x3a')]=qs[_0xf64d('0x32')](_[_0xf64d('0x3b')](_0x179fd0['query'],_0x51926e[_0xf64d('0x32')]),_0x4f820f);if(_0x179fd0[_0xf64d('0x31')][_0xf64d('0x3c')]){_0x5a6aa8[_0xf64d('0x3a')]=_[_0xf64d('0x3d')](_0x5a6aa8[_0xf64d('0x3a')],{'$or':_[_0xf64d('0x2a')](_0x4f820f,function(_0x18ce2f){if(_0x18ce2f[_0xf64d('0x2e')]!=='VIRTUAL'){var _0x28ad0d={};_0x28ad0d[_0x18ce2f[_0xf64d('0x27')]]={'$like':'%'+_0x179fd0['query'][_0xf64d('0x3c')]+'%'};return _0x28ad0d;}})});}_0x5a6aa8=_['merge']({},_0x5a6aa8,_0x179fd0[_0xf64d('0x3e')]);var _0x3b0b51={'where':_0x5a6aa8[_0xf64d('0x3a')]};return db[_0xf64d('0x2b')]['count'](_0x3b0b51)[_0xf64d('0x23')](function(_0x394226){_0x11387a[_0xf64d('0x1e')]=_0x394226;if(_0x179fd0[_0xf64d('0x31')][_0xf64d('0x3f')]){_0x5a6aa8[_0xf64d('0x40')]=[{'all':!![]}];}return db[_0xf64d('0x2b')][_0xf64d('0x41')](_0x5a6aa8);})['then'](function(_0x5da35f){_0x11387a[_0xf64d('0x42')]=_0x5da35f;return _0x11387a;})[_0xf64d('0x23')](respondWithFilteredResult(_0x889bc3,_0x5a6aa8))['catch'](handleError(_0x889bc3,null));};exports[_0xf64d('0x43')]=function(_0x2a0b42,_0xed6ae1){var _0x18ce52={'raw':!![],'where':{'id':_0x2a0b42[_0xf64d('0x44')]['id']}},_0xb70e75={};_0xb70e75[_0xf64d('0x30')]=_[_0xf64d('0x45')](db['FaxApplication']['rawAttributes']);_0xb70e75['query']=_[_0xf64d('0x45')](_0x2a0b42[_0xf64d('0x31')]);_0xb70e75[_0xf64d('0x32')]=_[_0xf64d('0x33')](_0xb70e75[_0xf64d('0x30')],_0xb70e75[_0xf64d('0x31')]);_0x18ce52['attributes']=_['intersection'](_0xb70e75[_0xf64d('0x30')],qs[_0xf64d('0x35')](_0x2a0b42['query'][_0xf64d('0x35')]));_0x18ce52[_0xf64d('0x34')]=_0x18ce52[_0xf64d('0x34')]['length']?_0x18ce52['attributes']:_0xb70e75[_0xf64d('0x30')];if(_0x2a0b42[_0xf64d('0x31')][_0xf64d('0x3f')]){_0x18ce52[_0xf64d('0x40')]=[{'all':!![]}];}_0x18ce52=_[_0xf64d('0x3d')]({},_0x18ce52,_0x2a0b42[_0xf64d('0x3e')]);return db['FaxApplication'][_0xf64d('0x46')](_0x18ce52)['then'](handleEntityNotFound(_0xed6ae1,null))[_0xf64d('0x23')](respondWithResult(_0xed6ae1,null))['catch'](handleError(_0xed6ae1,null));};exports['create']=function(_0x43f727,_0x4e0eda){return db[_0xf64d('0x2b')][_0xf64d('0x47')](_0x43f727[_0xf64d('0x48')],{})['then'](respondWithResult(_0x4e0eda,0xc9))[_0xf64d('0x49')](handleError(_0x4e0eda,null));};exports['update']=function(_0x52601a,_0x453476){if(_0x52601a[_0xf64d('0x48')]['id']){delete _0x52601a[_0xf64d('0x48')]['id'];}return db[_0xf64d('0x2b')][_0xf64d('0x46')]({'where':{'id':_0x52601a[_0xf64d('0x44')]['id']}})[_0xf64d('0x23')](handleEntityNotFound(_0x453476,null))[_0xf64d('0x23')](saveUpdates(_0x52601a['body'],null))['then'](respondWithResult(_0x453476,null))[_0xf64d('0x49')](handleError(_0x453476,null));};exports[_0xf64d('0x24')]=function(_0x31fe7c,_0x1664a4){return db[_0xf64d('0x2b')][_0xf64d('0x46')]({'where':{'id':_0x31fe7c[_0xf64d('0x44')]['id']}})[_0xf64d('0x23')](handleEntityNotFound(_0x1664a4,null))[_0xf64d('0x23')](removeEntity(_0x1664a4,null))[_0xf64d('0x49')](handleError(_0x1664a4,null));};
\ No newline at end of file
+var _0x29b1=['lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FaxApplication','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','find','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x5aa089,_0x2d8caf){var _0xd86642=function(_0x14d084){while(--_0x14d084){_0x5aa089['push'](_0x5aa089['shift']());}};_0xd86642(++_0x2d8caf);}(_0x29b1,0x15d));var _0x129b=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x29b1[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x129b('0x0'));var rimraf=require(_0x129b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x129b('0x2'));var moment=require(_0x129b('0x3'));var BPromise=require(_0x129b('0x4'));var Mustache=require(_0x129b('0x5'));var util=require(_0x129b('0x6'));var path=require('path');var sox=require(_0x129b('0x7'));var csv=require(_0x129b('0x8'));var ejs=require(_0x129b('0x9'));var fs=require('fs');var fs_extra=require(_0x129b('0xa'));var _=require(_0x129b('0xb'));var squel=require('squel');var crypto=require(_0x129b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x129b('0xd'));var toCsv=require(_0x129b('0x8'));var querystring=require(_0x129b('0xe'));var Papa=require(_0x129b('0xf'));var Redis=require('ioredis');var authService=require(_0x129b('0x10'));var qs=require(_0x129b('0x11'));var as=require(_0x129b('0x12'));var hardwareService=require(_0x129b('0x13'));var logger=require(_0x129b('0x14'))(_0x129b('0x15'));var utils=require('../../config/utils');var config=require(_0x129b('0x16'));var licenseUtil=require(_0x129b('0x17'));var db=require(_0x129b('0x18'))['db'];function respondWithStatusCode(_0x16b948,_0x496da9){_0x496da9=_0x496da9||0xcc;return function(_0x3b9b63){if(_0x3b9b63){return _0x16b948[_0x129b('0x19')](_0x496da9);}return _0x16b948[_0x129b('0x1a')](_0x496da9)[_0x129b('0x1b')]();};}function respondWithResult(_0x44c759,_0x4da6b0){_0x4da6b0=_0x4da6b0||0xc8;return function(_0x2ba5c6){if(_0x2ba5c6){return _0x44c759[_0x129b('0x1a')](_0x4da6b0)['json'](_0x2ba5c6);}};}function respondWithFilteredResult(_0x409e34,_0xfe5c6e){return function(_0x258b14){if(_0x258b14){var _0x384740=typeof _0xfe5c6e['offset']===_0x129b('0x1c')&&typeof _0xfe5c6e[_0x129b('0x1d')]===_0x129b('0x1c');var _0x4c601b=_0x258b14['count'];var _0x43631d=_0x384740?0x0:_0xfe5c6e['offset'];var _0x1e8a32=_0x384740?_0x258b14['count']:_0xfe5c6e[_0x129b('0x1e')]+_0xfe5c6e[_0x129b('0x1d')];var _0x5ac554;if(_0x1e8a32>=_0x4c601b){_0x1e8a32=_0x4c601b;_0x5ac554=0xc8;}else{_0x5ac554=0xce;}_0x409e34[_0x129b('0x1a')](_0x5ac554);return _0x409e34[_0x129b('0x1f')](_0x129b('0x20'),_0x43631d+'-'+_0x1e8a32+'/'+_0x4c601b)['json'](_0x258b14);}return null;};}function patchUpdates(_0x4abc20){return function(_0x126d58){try{jsonpatch[_0x129b('0x21')](_0x126d58,_0x4abc20,!![]);}catch(_0x2c9253){return BPromise[_0x129b('0x22')](_0x2c9253);}return _0x126d58[_0x129b('0x23')]();};}function saveUpdates(_0x919525,_0x21d15b){return function(_0xe0187d){if(_0xe0187d){return _0xe0187d[_0x129b('0x24')](_0x919525)[_0x129b('0x25')](function(_0x6a9a99){return _0x6a9a99;});}return null;};}function removeEntity(_0x17fd11,_0xe772c6){return function(_0x107c2c){if(_0x107c2c){return _0x107c2c[_0x129b('0x26')]()[_0x129b('0x25')](function(){_0x17fd11[_0x129b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a7d6b,_0xf64554){return function(_0x303ab7){if(!_0x303ab7){_0x2a7d6b[_0x129b('0x19')](0x194);}return _0x303ab7;};}function handleError(_0x13623d,_0x3a20fb){_0x3a20fb=_0x3a20fb||0x1f4;return function(_0x430852){logger[_0x129b('0x27')](_0x430852[_0x129b('0x28')]);if(_0x430852[_0x129b('0x29')]){delete _0x430852[_0x129b('0x29')];}_0x13623d[_0x129b('0x1a')](_0x3a20fb)['send'](_0x430852);};}exports[_0x129b('0x2a')]=function(_0x4d23ee,_0x2a847d){var _0x184da5={},_0x251dc9={},_0x22847e={'count':0x0,'rows':[]};var _0x37d472=_[_0x129b('0x2b')](db[_0x129b('0x2c')][_0x129b('0x2d')],function(_0x3058e9){return{'name':_0x3058e9['fieldName'],'type':_0x3058e9[_0x129b('0x2e')][_0x129b('0x2f')]};});_0x251dc9[_0x129b('0x30')]=_[_0x129b('0x2b')](_0x37d472,_0x129b('0x29'));_0x251dc9[_0x129b('0x31')]=_['keys'](_0x4d23ee[_0x129b('0x31')]);_0x251dc9[_0x129b('0x32')]=_['intersection'](_0x251dc9[_0x129b('0x30')],_0x251dc9[_0x129b('0x31')]);_0x184da5['attributes']=_[_0x129b('0x33')](_0x251dc9[_0x129b('0x30')],qs[_0x129b('0x34')](_0x4d23ee[_0x129b('0x31')][_0x129b('0x34')]));_0x184da5['attributes']=_0x184da5[_0x129b('0x35')][_0x129b('0x36')]?_0x184da5[_0x129b('0x35')]:_0x251dc9['model'];if(!_0x4d23ee[_0x129b('0x31')][_0x129b('0x37')]('nolimit')){_0x184da5[_0x129b('0x1d')]=qs[_0x129b('0x1d')](_0x4d23ee[_0x129b('0x31')][_0x129b('0x1d')]);_0x184da5['offset']=qs[_0x129b('0x1e')](_0x4d23ee['query'][_0x129b('0x1e')]);}_0x184da5[_0x129b('0x38')]=qs[_0x129b('0x39')](_0x4d23ee[_0x129b('0x31')][_0x129b('0x39')]);_0x184da5[_0x129b('0x3a')]=qs['filters'](_[_0x129b('0x3b')](_0x4d23ee['query'],_0x251dc9[_0x129b('0x32')]),_0x37d472);if(_0x4d23ee[_0x129b('0x31')][_0x129b('0x3c')]){_0x184da5['where']=_[_0x129b('0x3d')](_0x184da5[_0x129b('0x3a')],{'$or':_['map'](_0x37d472,function(_0x321e28){if(_0x321e28[_0x129b('0x2e')]!=='VIRTUAL'){var _0x2f6b49={};_0x2f6b49[_0x321e28[_0x129b('0x29')]]={'$like':'%'+_0x4d23ee[_0x129b('0x31')][_0x129b('0x3c')]+'%'};return _0x2f6b49;}})});}_0x184da5=_[_0x129b('0x3d')]({},_0x184da5,_0x4d23ee['options']);var _0x386267={'where':_0x184da5[_0x129b('0x3a')]};return db['FaxApplication'][_0x129b('0x3e')](_0x386267)[_0x129b('0x25')](function(_0xd93ca4){_0x22847e['count']=_0xd93ca4;if(_0x4d23ee['query'][_0x129b('0x3f')]){_0x184da5[_0x129b('0x40')]=[{'all':!![]}];}return db[_0x129b('0x2c')][_0x129b('0x41')](_0x184da5);})[_0x129b('0x25')](function(_0x46fe3c){_0x22847e[_0x129b('0x42')]=_0x46fe3c;return _0x22847e;})[_0x129b('0x25')](respondWithFilteredResult(_0x2a847d,_0x184da5))[_0x129b('0x43')](handleError(_0x2a847d,null));};exports[_0x129b('0x44')]=function(_0x58be86,_0x429038){var _0x3c530={'raw':!![],'where':{'id':_0x58be86[_0x129b('0x45')]['id']}},_0x219b78={};_0x219b78[_0x129b('0x30')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x219b78['query']=_['keys'](_0x58be86[_0x129b('0x31')]);_0x219b78[_0x129b('0x32')]=_[_0x129b('0x33')](_0x219b78['model'],_0x219b78[_0x129b('0x31')]);_0x3c530[_0x129b('0x35')]=_[_0x129b('0x33')](_0x219b78[_0x129b('0x30')],qs[_0x129b('0x34')](_0x58be86['query'][_0x129b('0x34')]));_0x3c530['attributes']=_0x3c530[_0x129b('0x35')][_0x129b('0x36')]?_0x3c530[_0x129b('0x35')]:_0x219b78['model'];if(_0x58be86[_0x129b('0x31')][_0x129b('0x3f')]){_0x3c530[_0x129b('0x40')]=[{'all':!![]}];}_0x3c530=_[_0x129b('0x3d')]({},_0x3c530,_0x58be86['options']);return db[_0x129b('0x2c')][_0x129b('0x46')](_0x3c530)[_0x129b('0x25')](handleEntityNotFound(_0x429038,null))[_0x129b('0x25')](respondWithResult(_0x429038,null))[_0x129b('0x43')](handleError(_0x429038,null));};exports['create']=function(_0x57853d,_0x2cc231){return db[_0x129b('0x2c')]['create'](_0x57853d[_0x129b('0x47')],{})[_0x129b('0x25')](respondWithResult(_0x2cc231,0xc9))[_0x129b('0x43')](handleError(_0x2cc231,null));};exports['update']=function(_0x5d0189,_0x624d73){if(_0x5d0189[_0x129b('0x47')]['id']){delete _0x5d0189[_0x129b('0x47')]['id'];}return db[_0x129b('0x2c')][_0x129b('0x46')]({'where':{'id':_0x5d0189[_0x129b('0x45')]['id']}})[_0x129b('0x25')](handleEntityNotFound(_0x624d73,null))[_0x129b('0x25')](saveUpdates(_0x5d0189[_0x129b('0x47')],null))[_0x129b('0x25')](respondWithResult(_0x624d73,null))['catch'](handleError(_0x624d73,null));};exports['destroy']=function(_0x2e4a23,_0xfce5e3){return db[_0x129b('0x2c')][_0x129b('0x46')]({'where':{'id':_0x2e4a23[_0x129b('0x45')]['id']}})[_0x129b('0x25')](handleEntityNotFound(_0xfce5e3,null))[_0x129b('0x25')](removeEntity(_0xfce5e3,null))[_0x129b('0x43')](handleError(_0xfce5e3,null));};
\ No newline at end of file
index 8e9c56f..553d777 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe489=['fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','FaxApplication'];(function(_0x331f1f,_0x215c15){var _0x38f0e0=function(_0x3cffc0){while(--_0x3cffc0){_0x331f1f['push'](_0x331f1f['shift']());}};_0x38f0e0(++_0x215c15);}(_0xe489,0xbe));var _0x9e48=function(_0x5ec81c,_0x470750){_0x5ec81c=_0x5ec81c-0x0;var _0x1c5b56=_0xe489[_0x5ec81c];return _0x1c5b56;};'use strict';var _=require(_0x9e48('0x0'));var util=require(_0x9e48('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9e48('0x2'));var rp=require(_0x9e48('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e48('0x4'));var config=require(_0x9e48('0x5'));var attributes=require(_0x9e48('0x6'));module['exports']=function(_0x374f93,_0x3e2983){return _0x374f93['define'](_0x9e48('0x7'),attributes,{'tableName':_0x9e48('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9e48('0x9'),'collate':_0x9e48('0xa')});};
\ No newline at end of file
+var _0x5dfc=['request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x5643f7,_0x2fded8){var _0x1af993=function(_0x118908){while(--_0x118908){_0x5643f7['push'](_0x5643f7['shift']());}};_0x1af993(++_0x2fded8);}(_0x5dfc,0x13d));var _0xc5df=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x5dfc[_0x65c903];return _0x23e1d7;};'use strict';var _=require(_0xc5df('0x0'));var util=require(_0xc5df('0x1'));var logger=require('../../config/logger')(_0xc5df('0x2'));var moment=require(_0xc5df('0x3'));var BPromise=require(_0xc5df('0x4'));var rp=require(_0xc5df('0x5'));var fs=require('fs');var path=require(_0xc5df('0x6'));var rimraf=require('rimraf');var config=require(_0xc5df('0x7'));var attributes=require(_0xc5df('0x8'));module['exports']=function(_0x10240d,_0x811b18){return _0x10240d[_0xc5df('0x9')](_0xc5df('0xa'),attributes,{'tableName':_0xc5df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc5df('0xc'),'collate':_0xc5df('0xd')});};
\ No newline at end of file
index 7a5c882..2253653 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90f0=['update','body','options','raw','attributes','limit','UpdateFaxApplication','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x12ba59,_0x139b9d){var _0x147a9c=function(_0xf1804a){while(--_0xf1804a){_0x12ba59['push'](_0x12ba59['shift']());}};_0x147a9c(++_0x139b9d);}(_0x90f0,0x1e7));var _0x090f=function(_0x48a836,_0xa1d010){_0x48a836=_0x48a836-0x0;var _0x249dc8=_0x90f0[_0x48a836];return _0x249dc8;};'use strict';var _=require(_0x090f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x090f('0x1'));var rs=require(_0x090f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x090f('0x3'))['db'];var utils=require(_0x090f('0x4'));var logger=require(_0x090f('0x5'))(_0x090f('0x6'));var config=require(_0x090f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x090f('0x8')][_0x090f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16e247,_0x3014ab,_0x1a239f){return new BPromise(function(_0x1d9edc,_0x10f842){return client[_0x090f('0xa')](_0x16e247,_0x1a239f)[_0x090f('0xb')](function(_0x36d945){logger[_0x090f('0xc')](_0x090f('0xd'),_0x3014ab,_0x090f('0xe'));logger[_0x090f('0xf')](_0x090f('0x10'),_0x3014ab,_0x090f('0xe'),JSON[_0x090f('0x11')](_0x36d945));if(_0x36d945[_0x090f('0x12')]){if(_0x36d945[_0x090f('0x12')][_0x090f('0x13')]===0x1f4){logger[_0x090f('0x12')]('FaxApplication,\x20%s,\x20%s',_0x3014ab,_0x36d945['error']['message']);return _0x10f842(_0x36d945['error'][_0x090f('0x14')]);}logger[_0x090f('0x12')](_0x090f('0xd'),_0x3014ab,_0x36d945[_0x090f('0x12')]['message']);return _0x1d9edc(_0x36d945[_0x090f('0x12')][_0x090f('0x14')]);}else{logger[_0x090f('0xc')]('FaxApplication,\x20%s,\x20%s',_0x3014ab,_0x090f('0xe'));_0x1d9edc(_0x36d945[_0x090f('0x15')][_0x090f('0x14')]);}})[_0x090f('0x16')](function(_0xa11fd6){logger[_0x090f('0x12')](_0x090f('0xd'),_0x3014ab,_0xa11fd6);_0x10f842(_0xa11fd6);});});}exports['UpdateFaxApplication']=function(_0x387013){var _0x46645d=this;return new Promise(function(_0x473a80,_0x5363f8){return db['FaxApplication'][_0x090f('0x17')](_0x387013[_0x090f('0x18')],{'raw':_0x387013[_0x090f('0x19')]?_0x387013[_0x090f('0x19')][_0x090f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x387013[_0x090f('0x19')]?_0x387013[_0x090f('0x19')]['where']||null:null,'attributes':_0x387013['options']?_0x387013[_0x090f('0x19')][_0x090f('0x1b')]||null:null,'limit':_0x387013['options']?_0x387013[_0x090f('0x19')][_0x090f('0x1c')]||null:null})[_0x090f('0xb')](function(_0x6f2747){logger['info'](_0x090f('0x1d'),_0x387013);logger[_0x090f('0xf')](_0x090f('0x1d'),_0x387013,JSON[_0x090f('0x11')](_0x6f2747));_0x473a80(_0x6f2747);})['catch'](function(_0x484fea){logger[_0x090f('0x12')](_0x090f('0x1d'),_0x484fea[_0x090f('0x14')],_0x387013);_0x5363f8(_0x46645d[_0x090f('0x12')](0x1f4,_0x484fea[_0x090f('0x14')]));});});};
\ No newline at end of file
+var _0x6170=['FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','options','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug'];(function(_0xc94c2b,_0x1eb9c0){var _0x274cf0=function(_0x388dec){while(--_0x388dec){_0xc94c2b['push'](_0xc94c2b['shift']());}};_0x274cf0(++_0x1eb9c0);}(_0x6170,0x18f));var _0x0617=function(_0x4103c3,_0x47afa4){_0x4103c3=_0x4103c3-0x0;var _0x47a347=_0x6170[_0x4103c3];return _0x47a347;};'use strict';var _=require(_0x0617('0x0'));var util=require(_0x0617('0x1'));var moment=require(_0x0617('0x2'));var BPromise=require(_0x0617('0x3'));var rs=require(_0x0617('0x4'));var fs=require('fs');var Redis=require(_0x0617('0x5'));var db=require(_0x0617('0x6'))['db'];var utils=require(_0x0617('0x7'));var logger=require('../../config/logger')(_0x0617('0x8'));var config=require(_0x0617('0x9'));var jayson=require(_0x0617('0xa'));var client=jayson['client'][_0x0617('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d0e1d,_0x25f09e,_0x16241b){return new BPromise(function(_0x3dff44,_0xcd24b2){return client[_0x0617('0xc')](_0x1d0e1d,_0x16241b)[_0x0617('0xd')](function(_0x1bce38){logger[_0x0617('0xe')](_0x0617('0xf'),_0x25f09e,'request\x20sent');logger[_0x0617('0x10')](_0x0617('0x11'),_0x25f09e,_0x0617('0x12'),JSON['stringify'](_0x1bce38));if(_0x1bce38[_0x0617('0x13')]){if(_0x1bce38[_0x0617('0x13')][_0x0617('0x14')]===0x1f4){logger[_0x0617('0x13')](_0x0617('0xf'),_0x25f09e,_0x1bce38['error'][_0x0617('0x15')]);return _0xcd24b2(_0x1bce38[_0x0617('0x13')][_0x0617('0x15')]);}logger[_0x0617('0x13')](_0x0617('0xf'),_0x25f09e,_0x1bce38[_0x0617('0x13')]['message']);return _0x3dff44(_0x1bce38[_0x0617('0x13')][_0x0617('0x15')]);}else{logger[_0x0617('0xe')](_0x0617('0xf'),_0x25f09e,'request\x20sent');_0x3dff44(_0x1bce38[_0x0617('0x16')][_0x0617('0x15')]);}})[_0x0617('0x17')](function(_0x17354f){logger['error'](_0x0617('0xf'),_0x25f09e,_0x17354f);_0xcd24b2(_0x17354f);});});}exports[_0x0617('0x18')]=function(_0xdeee0){var _0x532bea=this;return new Promise(function(_0x31020a,_0x348058){return db[_0x0617('0x19')][_0x0617('0x1a')](_0xdeee0['body'],{'raw':_0xdeee0['options']?_0xdeee0[_0x0617('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdeee0[_0x0617('0x1b')]?_0xdeee0[_0x0617('0x1b')][_0x0617('0x1c')]||null:null,'attributes':_0xdeee0['options']?_0xdeee0['options'][_0x0617('0x1d')]||null:null,'limit':_0xdeee0[_0x0617('0x1b')]?_0xdeee0[_0x0617('0x1b')][_0x0617('0x1e')]||null:null})[_0x0617('0xd')](function(_0x2e5ce9){logger[_0x0617('0xe')](_0x0617('0x18'),_0xdeee0);logger[_0x0617('0x10')](_0x0617('0x18'),_0xdeee0,JSON[_0x0617('0x1f')](_0x2e5ce9));_0x31020a(_0x2e5ce9);})[_0x0617('0x17')](function(_0x1ca978){logger[_0x0617('0x13')](_0x0617('0x18'),_0x1ca978[_0x0617('0x15')],_0xdeee0);_0x348058(_0x532bea[_0x0617('0x13')](0x1f4,_0x1ca978[_0x0617('0x15')]));});});};
\ No newline at end of file
index 51063c8..609679d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x375206,_0xc7f415){var _0x42e235=function(_0x4d6498){while(--_0x4d6498){_0x375206['push'](_0x375206['shift']());}};_0x42e235(++_0xc7f415);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xb7e7[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
+var _0x4024=['express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','update','destroy','exports','multer','util','connect-timeout'];(function(_0x25a9b8,_0x21be82){var _0x5a6df4=function(_0x497e31){while(--_0x497e31){_0x25a9b8['push'](_0x25a9b8['shift']());}};_0x5a6df4(++_0x21be82);}(_0x4024,0x89));var _0x4402=function(_0x3f975c,_0x545c92){_0x3f975c=_0x3f975c-0x0;var _0x1e9a3f=_0x4024[_0x3f975c];return _0x1e9a3f;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['post']('/',auth[_0x4402('0x7')](),controller['create']);router['put'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xb')]);router['delete'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xc')]);module[_0x4402('0xd')]=router;
\ No newline at end of file
index c24b4f8..a6b5eca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9f5=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x75c194,_0x12b561){var _0x1c8761=function(_0xf8bdfe){while(--_0xf8bdfe){_0x75c194['push'](_0x75c194['shift']());}};_0x1c8761(++_0x12b561);}(_0xc9f5,0x7d));var _0x5c9f=function(_0x11a962,_0x3cc338){_0x11a962=_0x11a962-0x0;var _0x55d423=_0xc9f5[_0x11a962];return _0x55d423;};'use strict';var Sequelize=require(_0x5c9f('0x0'));module[_0x5c9f('0x1')]={'closed':{'type':Sequelize[_0x5c9f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5c9f('0x3')]},'disposition':{'type':Sequelize[_0x5c9f('0x4')]},'secondDisposition':{'type':Sequelize[_0x5c9f('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5c9f('0x4')]},'note':{'type':Sequelize[_0x5c9f('0x4')]},'read1stAt':{'type':Sequelize[_0x5c9f('0x3')]},'fax':{'type':Sequelize[_0x5c9f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5c9f('0x5')]('in',_0x5c9f('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5c9f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5c9f('0x5')]('in',_0x5c9f('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x9d9c=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x1c6dcf,_0x2018b2){var _0x4990ae=function(_0x510c6e){while(--_0x510c6e){_0x1c6dcf['push'](_0x1c6dcf['shift']());}};_0x4990ae(++_0x2018b2);}(_0x9d9c,0x90));var _0xc9d9=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x9d9c[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0xc9d9('0x0'));module[_0xc9d9('0x1')]={'closed':{'type':Sequelize[_0xc9d9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc9d9('0x3')]},'note':{'type':Sequelize[_0xc9d9('0x3')]},'read1stAt':{'type':Sequelize[_0xc9d9('0x4')]},'fax':{'type':Sequelize[_0xc9d9('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc9d9('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc9d9('0x5')]('in',_0xc9d9('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 2d7e5a9..89befb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x741b=['ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','find','UserId','body','text','compact','isEmpty','forEach','i.FaxAccountId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','show','params','keys','includeAll','include','catch','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','$gte','format','findAll','rows','addTags','spread','color','faxInteractionTags:save','removeTags','download','unix','root','tmp','join','files','attachments','Attachment','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','Users','map','fullname','TagIds','Tags','split','FaxInteraction','rawAttributes','type','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','length','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?'];(function(_0x32569d,_0x58f9de){var _0x52dabf=function(_0x441a10){while(--_0x441a10){_0x32569d['push'](_0x32569d['shift']());}};_0x52dabf(++_0x58f9de);}(_0x741b,0x137));var _0xb741=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x741b[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xb741('0x0'));var rimraf=require(_0xb741('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb741('0x2'));var rp=require(_0xb741('0x3'));var moment=require(_0xb741('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb741('0x5'));var util=require(_0xb741('0x6'));var path=require(_0xb741('0x7'));var sox=require('sox');var csv=require(_0xb741('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb741('0x9'));var squel=require(_0xb741('0xa'));var crypto=require(_0xb741('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb741('0xc'));var toCsv=require(_0xb741('0x8'));var querystring=require(_0xb741('0xd'));var Papa=require(_0xb741('0xe'));var Redis=require('ioredis');var authService=require(_0xb741('0xf'));var qs=require(_0xb741('0x10'));var as=require(_0xb741('0x11'));var hardwareService=require(_0xb741('0x12'));var logger=require(_0xb741('0x13'))('api');var utils=require(_0xb741('0x14'));var config=require(_0xb741('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb741('0x16'))['db'];config[_0xb741('0x17')]=_[_0xb741('0x18')](config[_0xb741('0x17')],{'host':_0xb741('0x19'),'port':0x18eb});var socket=require(_0xb741('0x1a'))(new Redis(config[_0xb741('0x17')]));require(_0xb741('0x1b'))[_0xb741('0x1c')](socket);function respondWithStatusCode(_0x598f83,_0x28e9c9){_0x28e9c9=_0x28e9c9||0xcc;return function(_0x4df639){if(_0x4df639){return _0x598f83[_0xb741('0x1d')](_0x28e9c9);}return _0x598f83[_0xb741('0x1e')](_0x28e9c9)[_0xb741('0x1f')]();};}function respondWithResult(_0x591fa7,_0x5d95f0){_0x5d95f0=_0x5d95f0||0xc8;return function(_0x4c512d){if(_0x4c512d){return _0x591fa7['status'](_0x5d95f0)[_0xb741('0x20')](_0x4c512d);}};}function respondWithFilteredResult(_0x376ba3,_0x4fe3a3){return function(_0x182ea0){if(_0x182ea0){var _0x593182=typeof _0x4fe3a3[_0xb741('0x21')]===_0xb741('0x22')&&typeof _0x4fe3a3[_0xb741('0x23')]===_0xb741('0x22');var _0xb34b11=_0x182ea0[_0xb741('0x24')];var _0x436bc5=_0x593182?0x0:_0x4fe3a3['offset'];var _0x3cf474=_0x593182?_0x182ea0[_0xb741('0x24')]:_0x4fe3a3['offset']+_0x4fe3a3[_0xb741('0x23')];var _0x44471c;if(_0x3cf474>=_0xb34b11){_0x3cf474=_0xb34b11;_0x44471c=0xc8;}else{_0x44471c=0xce;}_0x376ba3['status'](_0x44471c);return _0x376ba3[_0xb741('0x25')](_0xb741('0x26'),_0x436bc5+'-'+_0x3cf474+'/'+_0xb34b11)[_0xb741('0x20')](_0x182ea0);}return null;};}function patchUpdates(_0xdcf17c){return function(_0x3a685a){try{jsonpatch[_0xb741('0x27')](_0x3a685a,_0xdcf17c,!![]);}catch(_0x53aba6){return BPromise[_0xb741('0x28')](_0x53aba6);}return _0x3a685a['save']();};}function saveUpdates(_0x1704e3,_0x3e4533){return function(_0x4bf80c){if(_0x4bf80c){return _0x4bf80c[_0xb741('0x29')](_0x1704e3)['then'](function(_0xcaa757){return _0xcaa757;});}return null;};}function removeEntity(_0x3f4ada,_0x313bfa){return function(_0x1ce6e7){if(_0x1ce6e7){return _0x1ce6e7[_0xb741('0x2a')]()[_0xb741('0x2b')](function(){_0x3f4ada['status'](0xcc)[_0xb741('0x1f')]();});}};}function handleEntityNotFound(_0x794dcb,_0x29524d){return function(_0x5618cf){if(!_0x5618cf){_0x794dcb[_0xb741('0x1d')](0x194);}return _0x5618cf;};}function handleError(_0x154b4c,_0x21cae8){_0x21cae8=_0x21cae8||0x1f4;return function(_0x5bab19){logger[_0xb741('0x2c')](_0x5bab19['stack']);if(_0x5bab19['name']){delete _0x5bab19[_0xb741('0x2d')];}_0x154b4c[_0xb741('0x1e')](_0x21cae8)[_0xb741('0x2e')](_0x5bab19);};}function getInteractionUsers(_0x34eb44,_0x3ad072){return new BPromise(function(_0x2a8269,_0x568251){try{if(_0x3ad072[_0x34eb44['id']]){_0x34eb44[_0xb741('0x2f')]=_[_0xb741('0x30')](_0x3ad072[_0x34eb44['id']],function(_0x30af7b){return{'id':_0x30af7b['id'],'fullname':_0x30af7b[_0xb741('0x31')]};});}}catch(_0x1d3724){_0x568251(_0x1d3724);}_0x2a8269(_0x34eb44);});}function getInteractionTags(_0x5b3837,_0x206bcc){return new BPromise(function(_0x347eb1,_0x58f593){try{if(_0x5b3837[_0xb741('0x32')]){_0x5b3837[_0xb741('0x33')]=[];_0x5b3837[_0xb741('0x32')][_0xb741('0x34')](',')['forEach'](function(_0x50279b){_0x5b3837[_0xb741('0x33')]['push'](_0x206bcc[_0x50279b]);});}delete _0x5b3837['TagIds'];}catch(_0x578cd5){_0x58f593(_0x578cd5);}_0x347eb1(_0x5b3837);});}function updateFaxInteraction(_0x5c023b,_0x203f64,_0x30241a){return new BPromise(function(_0x41b073,_0x504c2b){return getInteractionUsers(_0x5c023b,_0x30241a)[_0xb741('0x2b')](function(_0x2df1dd){return getInteractionTags(_0x2df1dd,_0x203f64);})[_0xb741('0x2b')](function(_0x3ac2a6){_0x41b073(_0x3ac2a6);})['catch'](function(_0x2f9756){_0x504c2b(_0x2f9756);});});}exports['index']=function(_0x4693c5,_0x2b66d4){var _0x59067c={},_0x6cf57={},_0x9a2286={'count':0x0,'rows':[]};var _0x594ee5=_[_0xb741('0x30')](db[_0xb741('0x35')][_0xb741('0x36')],function(_0x5d6968){return{'name':_0x5d6968['fieldName'],'type':_0x5d6968[_0xb741('0x37')]['key']};});_0x6cf57[_0xb741('0x38')]=_[_0xb741('0x30')](_0x594ee5,'name');_0x6cf57[_0xb741('0x39')]=_['keys'](_0x4693c5['query']);_0x6cf57['filters']=_[_0xb741('0x3a')](_0x6cf57[_0xb741('0x38')],_0x6cf57['query']);_0x59067c[_0xb741('0x3b')]=_[_0xb741('0x3a')](_0x6cf57[_0xb741('0x38')],qs['fields'](_0x4693c5[_0xb741('0x39')][_0xb741('0x3c')]));_0x59067c[_0xb741('0x3b')]=_0x59067c[_0xb741('0x3b')]['length']?_0x59067c[_0xb741('0x3b')]:_0x6cf57['model'];if(!_0x4693c5[_0xb741('0x39')][_0xb741('0x3d')]('nolimit')){_0x59067c[_0xb741('0x23')]=qs['limit'](_0x4693c5[_0xb741('0x39')][_0xb741('0x23')]);_0x59067c['offset']=qs[_0xb741('0x21')](_0x4693c5[_0xb741('0x39')][_0xb741('0x21')]);}_0x59067c[_0xb741('0x3e')]=qs['sort'](_0x4693c5[_0xb741('0x39')][_0xb741('0x3f')]);_0x59067c[_0xb741('0x40')]=qs[_0xb741('0x41')](_[_0xb741('0x42')](_0x4693c5[_0xb741('0x39')],_0x6cf57[_0xb741('0x41')]),_0x594ee5);var _0x9ad160=[];var _0x224b3d=squel[_0xb741('0x43')]()[_0xb741('0x44')]('id')[_0xb741('0x44')](_0xb741('0x2d'))['field']('color')[_0xb741('0x45')](_0xb741('0x46'));var _0x591a1c=squel['select']()[_0xb741('0x44')](_0xb741('0x47'))[_0xb741('0x44')](_0xb741('0x48'))[_0xb741('0x44')](_0xb741('0x49'))['from'](_0xb741('0x4a'),'ui')[_0xb741('0x4b')](_0xb741('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x2846af=squel[_0xb741('0x43')]()[_0xb741('0x45')]('fax_interactions','i')[_0xb741('0x4b')](_0xb741('0x4d'),'c',_0xb741('0x4e'))['left_join']('users','o',_0xb741('0x4f'))[_0xb741('0x4b')](_0xb741('0x50'),'a',_0xb741('0x51'))[_0xb741('0x4b')](_0xb741('0x52'),'me',_0xb741('0x53'))[_0xb741('0x4b')](_0xb741('0x54'),'it',_0xb741('0x55'))[_0xb741('0x4b')](_0xb741('0x46'),'t',_0xb741('0x56'));var _0x1ced6d=squel[_0xb741('0x57')]();var _0x2b7d78=[];var _0x2a6a7e=squel[_0xb741('0x57')]();var _0x470e4e;if(_0x4693c5[_0xb741('0x39')]['search']){_0x470e4e=as[_0xb741('0x58')](_0x4693c5[_0xb741('0x39')][_0xb741('0x59')]);var _0x143d72=_0x470e4e['sqlOperator'];for(var _0xebd0be=0x0;_0xebd0be<_0x470e4e[_0xb741('0x5a')][_0xb741('0x5b')];_0xebd0be++){var _0x2874a8=_0x470e4e[_0xb741('0x5a')][_0xebd0be];var _0x206944='i';var _0x3564e1=_['find'](_0x594ee5,[_0xb741('0x2d'),_0x2874a8[_0xb741('0x44')]]);if(!_0x3564e1){switch(_0x2874a8['field']){case _0xb741('0x5c'):if(_0x2874a8[_0xb741('0x5d')]==0x1){_0x2846af['having']('`'+_0x2874a8[_0xb741('0x44')]+_0xb741('0x5e'));}else{_0x2846af[_0xb741('0x5f')]('`'+_0x2874a8['field']+_0xb741('0x60'));}break;case _0xb741('0x61'):if(_0x2874a8[_0xb741('0x62')]===_0xb741('0x63')){if(_0x2874a8[_0xb741('0x5d')]['split']('\x20')['length']>0x1){_0x1ced6d[_0x143d72](_0xb741('0x64'),qs[_0xb741('0x65')](_0x2874a8[_0xb741('0x5d')]),null);}else{var _0x1f4d89='%'+_0x2874a8['value']+'%';_0x1ced6d[_0x143d72](_0xb741('0x66'),_0x1f4d89,_0x1f4d89,_0x1f4d89);}}else{_0x3564e1=_['find'](_0x594ee5,[_0xb741('0x2d'),_0xb741('0x67')]);_0x2874a8[_0xb741('0x44')]=_0xb741('0x67');_0x3e9a0a=as[_0xb741('0x68')](_0x206944,_0x3564e1[_0xb741('0x37')],_0x2874a8);_0x1ced6d[_0x143d72](_0x3e9a0a['text'],_0x3e9a0a['value'][_0xb741('0x69')],_0x3e9a0a[_0xb741('0x5d')][_0xb741('0x1f')]);}break;case _0xb741('0x6a'):var _0x584117=_0x2874a8[_0xb741('0x5d')][_0xb741('0x34')](',')[_0xb741('0x30')](function(_0x1b24b0){return Number(_0x1b24b0);});_0x584117['forEach'](function(_0xaa65ec){_0x2a6a7e['or'](_0xb741('0x6b'),'%,'+_0xaa65ec+',%');});_0x2b7d78=_[_0xb741('0x6c')](_0x2b7d78,_0x584117);break;case _0xb741('0x6d'):if(_0x2874a8[_0xb741('0x62')]===_0xb741('0x63')){_0x1ced6d[_0x143d72]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2874a8[_0xb741('0x5d')]+'%',null);}else{_0x3564e1=_[_0xb741('0x6e')](_0x594ee5,[_0xb741('0x2d'),_0xb741('0x6f')]);_0x2874a8['field']=_0xb741('0x6f');_0x3e9a0a=as[_0xb741('0x68')](_0x206944,_0x3564e1[_0xb741('0x37')],_0x2874a8);_0x1ced6d[_0x143d72](_0x3e9a0a['text'],_0x3e9a0a['value'][_0xb741('0x69')],_0x3e9a0a[_0xb741('0x5d')][_0xb741('0x1f')]);}break;case _0xb741('0x70'):_0x3e9a0a=as['buildExpression']('me',null,_0x2874a8);_0x1ced6d[_0x143d72](_0x3e9a0a[_0xb741('0x71')],_0x3e9a0a[_0xb741('0x5d')]['start'],_0x3e9a0a[_0xb741('0x5d')]['end']);break;}}else{var _0x3e9a0a=as[_0xb741('0x68')](_0x206944,_0x3564e1[_0xb741('0x37')],_0x2874a8);_0x1ced6d[_0x143d72](_0x3e9a0a[_0xb741('0x71')],_0x3e9a0a[_0xb741('0x5d')][_0xb741('0x69')],_0x3e9a0a['value'][_0xb741('0x1f')]);}}}else{var _0x4972e3=_(_0x4693c5['query'])['keys']()[_0xb741('0x30')](function(_0x574497){return _['some'](_0x594ee5,[_0xb741('0x2d'),_0x574497])?_0x574497:undefined;})[_0xb741('0x72')]()[_0xb741('0x5d')]();if(!_[_0xb741('0x73')](_0x4972e3)){_0x4972e3[_0xb741('0x74')](function(_0xdc4e9f){if(_0xdc4e9f==='FaxAccountId'){_0x2846af[_0xb741('0x40')](_0xb741('0x75'),[][_0xb741('0x76')](_0x4693c5[_0xb741('0x39')][_0xdc4e9f]));}else if(_0xdc4e9f==='createdAt'){var _0x42589f=JSON[_0xb741('0x77')](_0x4693c5[_0xb741('0x39')][_0xdc4e9f])['$gte'];var _0x2b822b=JSON[_0xb741('0x77')](_0x4693c5[_0xb741('0x39')][_0xdc4e9f])['$lte'];_0x2846af[_0xb741('0x40')](_0xb741('0x78'),_0x42589f,_0x2b822b);}else{if(_0x4693c5[_0xb741('0x39')][_0xdc4e9f]===_0xb741('0x79')){_0x2846af['where']('i.'+_0xdc4e9f+'\x20IS\x20NULL');}else{_0x2846af[_0xb741('0x40')]('i.'+_0xdc4e9f+_0xb741('0x7a'),_0x4693c5[_0xb741('0x39')][_0xdc4e9f]);}}});}if(_0x4693c5[_0xb741('0x39')][_0xb741('0x7b')]){if(_0x4693c5[_0xb741('0x39')][_0xb741('0x7b')]==0x1){_0x2846af[_0xb741('0x5f')](_0xb741('0x7c'));}else{_0x2846af[_0xb741('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x4693c5[_0xb741('0x39')][_0xb741('0x7d')]){_0x2b7d78=_['isArray'](_0x4693c5[_0xb741('0x39')][_0xb741('0x7d')])?_0x4693c5[_0xb741('0x39')]['tag']:new Array(_0x4693c5[_0xb741('0x39')][_0xb741('0x7d')]);_0x2b7d78[_0xb741('0x74')](function(_0x599de4){_0x2a6a7e['or'](_0xb741('0x6b'),'%,'+_0x599de4+',%');});}if(_0x4693c5[_0xb741('0x39')][_0xb741('0x7e')]){var _0x14073d=_0x4693c5['query'][_0xb741('0x7e')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x14073d)){_0x1ced6d['or'](_0xb741('0x7f'),_0x14073d+'%')['or']('i.fax\x20LIKE\x20?',_0x14073d+'%');}_0x1ced6d['or'](_0xb741('0x80'),_0x14073d+'%');}}_0x2846af[_0xb741('0x40')](_0x1ced6d);_0x2846af['group'](_0xb741('0x81'));var _0x5ebde8={'type':db['Sequelize'][_0xb741('0x82')]['SELECT'],'raw':!![]};var _0x4bc3a9=_0x2846af[_0xb741('0x83')]();_0x4bc3a9[_0xb741('0x44')]('i.id');_0x4bc3a9['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb741('0x5c'));if(_0x59067c['order']){_0x59067c[_0xb741('0x3e')][_0xb741('0x74')](function(_0x397881){var _0x20aa3e=_0x397881[0x0]==='contactName'?_0x397881[0x0]:'i.'+_0x397881[0x0];_0x2846af[_0xb741('0x3e')](_0x20aa3e,_0x397881[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb741('0x73')](_0x2b7d78)){_0x2846af['having'](_0x2a6a7e);_0x4bc3a9[_0xb741('0x40')](_0xb741('0x84'),_0x2b7d78);}BPromise[_0xb741('0x85')]()[_0xb741('0x2b')](function(){if(!_0x470e4e){if(_0x4693c5[_0xb741('0x39')][_0xb741('0x86')])return;_0x4bc3a9[_0xb741('0x40')](_0xb741('0x87'));_0x2846af[_0xb741('0x40')](_0xb741('0x87'));return;}if(_0x4693c5[_0xb741('0x88')]['role']!=='agent')return;return _0x4693c5[_0xb741('0x88')][_0xb741('0x89')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2500b7){if(_['isEmpty'](_0x2500b7)){_0x4bc3a9[_0xb741('0x40')](_0xb741('0x8a'));_0x2846af['where'](_0xb741('0x8a'));}else{_0x4bc3a9[_0xb741('0x40')](_0xb741('0x75'),_['map'](_0x2500b7,'id'));_0x2846af[_0xb741('0x40')](_0xb741('0x75'),_[_0xb741('0x30')](_0x2500b7,'id'));}});})['then'](function(){if(_0x4693c5[_0xb741('0x88')][_0xb741('0x8b')]==='agent'&&!_0x470e4e&&!_0x4693c5[_0xb741('0x39')]['FaxAccountId'])return[];return db['sequelize'][_0xb741('0x39')](_0x4bc3a9['toString'](),_0x5ebde8);})[_0xb741('0x2b')](function(_0x7a448d){_0x9a2286['count']=_0x7a448d['length'];if(_0x9a2286[_0xb741('0x24')]===0x0)return[];return db[_0xb741('0x8c')]['query'](_0x224b3d[_0xb741('0x8d')](),_0x5ebde8)[_0xb741('0x2b')](function(_0x19d916){_0x9ad160=_['keyBy'](_0x19d916,'id');_0x5ebde8=_[_0xb741('0x8e')](_0x5ebde8,{'model':db[_0xb741('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4693c5[_0xb741('0x39')]['fields']){_0x59067c[_0xb741('0x3b')][_0xb741('0x74')](function(_0x334a65){_0x2846af[_0xb741('0x44')]('i.'+_0x334a65);});}else{_0x2846af['field'](_0xb741('0x8f'),'unreadMessages');_0x2846af[_0xb741('0x44')](_0xb741('0x90'),_0xb741('0x91'));_0x2846af['field'](_0xb741('0x92'),_0xb741('0x93'));_0x2846af[_0xb741('0x44')](_0xb741('0x94'),'contactName');_0x2846af[_0xb741('0x44')](_0xb741('0x95'));_0x2846af[_0xb741('0x44')](_0xb741('0x96'),'Contact.firstName');_0x2846af[_0xb741('0x44')](_0xb741('0x97'),_0xb741('0x98'));_0x2846af['field'](_0xb741('0x99'),_0xb741('0x9a'));_0x2846af['field'](_0xb741('0x9b'),_0xb741('0x9c'));_0x2846af['field'](_0xb741('0x9d'),_0xb741('0x9e'));_0x2846af[_0xb741('0x44')](_0xb741('0x9f'),_0xb741('0xa0'));_0x2846af[_0xb741('0x44')](_0xb741('0xa1'),'Owner.fullname');_0x2846af[_0xb741('0x44')]('o.internal','Owner.internal');_0x2846af[_0xb741('0x44')](_0xb741('0xa2'),_0xb741('0x32'));}if(_0x59067c['limit'])_0x2846af[_0xb741('0x23')](_0x59067c[_0xb741('0x23')]);if(_0x59067c[_0xb741('0x21')])_0x2846af[_0xb741('0x21')](_0x59067c[_0xb741('0x21')]);return db['sequelize'][_0xb741('0x39')](_0x2846af['toString'](),_0x5ebde8);})['then'](function(_0x58e6ab){if(_0x58e6ab[_0xb741('0x5b')]>0x0)_0x591a1c[_0xb741('0x40')](_0xb741('0xa3'),_['map'](_0x58e6ab,'id'));return db[_0xb741('0x8c')][_0xb741('0x39')](_0x591a1c[_0xb741('0x8d')](),_0x5ebde8)['then'](function(_0x5b110f){var _0x13aef7=_[_0xb741('0xa4')](_0x5b110f,_0xb741('0xa5'));var _0x14e1d5=[];_0x58e6ab[_0xb741('0x74')](function(_0x56ae2b){_0x14e1d5[_0xb741('0xa6')](updateFaxInteraction(_0x56ae2b,_0x9ad160,_0x13aef7));});return BPromise['all'](_0x14e1d5);});});})['then'](function(_0x437c47){_0x9a2286['rows']=_0x437c47;return _0x9a2286;})['then'](respondWithFilteredResult(_0x2b66d4,_0x59067c))['catch'](handleError(_0x2b66d4,null));};exports[_0xb741('0xa7')]=function(_0x7a0686,_0x5d575f){var _0x462cbd={'raw':![],'where':{'id':_0x7a0686[_0xb741('0xa8')]['id']}},_0x1fce2f={};_0x1fce2f[_0xb741('0x38')]=_[_0xb741('0xa9')](db['FaxInteraction'][_0xb741('0x36')]);_0x1fce2f[_0xb741('0x39')]=_['keys'](_0x7a0686['query']);_0x1fce2f[_0xb741('0x41')]=_['intersection'](_0x1fce2f[_0xb741('0x38')],_0x1fce2f[_0xb741('0x39')]);_0x462cbd[_0xb741('0x3b')]=_[_0xb741('0x3a')](_0x1fce2f[_0xb741('0x38')],qs[_0xb741('0x3c')](_0x7a0686[_0xb741('0x39')][_0xb741('0x3c')]));_0x462cbd[_0xb741('0x3b')]=_0x462cbd[_0xb741('0x3b')][_0xb741('0x5b')]?_0x462cbd['attributes']:_0x1fce2f[_0xb741('0x38')];if(_0x7a0686[_0xb741('0x39')][_0xb741('0xaa')]){_0x462cbd[_0xb741('0xab')]=[{'all':!![]}];}_0x462cbd=_[_0xb741('0x8e')]({},_0x462cbd,_0x7a0686['options']);return db[_0xb741('0x35')][_0xb741('0x6e')](_0x462cbd)['then'](handleEntityNotFound(_0x5d575f,null))[_0xb741('0x2b')](respondWithResult(_0x5d575f,null))[_0xb741('0xac')](handleError(_0x5d575f,null));};exports[_0xb741('0xad')]=function(_0x553ccf,_0x31d112){return db['FaxInteraction']['create'](_0x553ccf['body'],{})['then'](respondWithResult(_0x31d112,0xc9))[_0xb741('0xac')](handleError(_0x31d112,null));};exports[_0xb741('0x29')]=function(_0x4fd8d8,_0x196491){if(_0x4fd8d8[_0xb741('0x70')]['id']){delete _0x4fd8d8[_0xb741('0x70')]['id'];}return db[_0xb741('0x35')][_0xb741('0x6e')]({'where':{'id':_0x4fd8d8[_0xb741('0xa8')]['id']}})['then'](handleEntityNotFound(_0x196491,null))[_0xb741('0x2b')](saveUpdates(_0x4fd8d8[_0xb741('0x70')],null))[_0xb741('0x2b')](respondWithResult(_0x196491,null))[_0xb741('0xac')](handleError(_0x196491,null));};exports['destroy']=function(_0x235605,_0x12fd46){return db[_0xb741('0x35')][_0xb741('0x6e')]({'where':{'id':_0x235605[_0xb741('0xa8')]['id']}})[_0xb741('0x2b')](handleEntityNotFound(_0x12fd46,null))['then'](removeEntity(_0x12fd46,null))[_0xb741('0xac')](handleError(_0x12fd46,null));};exports[_0xb741('0xae')]=function(_0x178454,_0x4eeac){return db[_0xb741('0x35')]['describe']()[_0xb741('0x2b')](respondWithResult(_0x4eeac,null))['catch'](handleError(_0x4eeac,null));};exports[_0xb741('0xaf')]=function(_0x5646c3,_0xdecc8c,_0x1f7fdd){return db[_0xb741('0xb0')]['find']({'where':{'id':_0x5646c3[_0xb741('0xa8')]['id']}})[_0xb741('0x2b')](handleEntityNotFound(_0xdecc8c,null))[_0xb741('0x2b')](function(_0x6ac001){if(_0x6ac001){return _0x6ac001[_0xb741('0xaf')](_0x5646c3[_0xb741('0x70')][_0xb741('0xb1')],_[_0xb741('0xb2')](_0x5646c3[_0xb741('0x70')],[_0xb741('0xb1'),'id'])||{});}})[_0xb741('0x2b')](respondWithResult(_0xdecc8c,null))[_0xb741('0xac')](handleError(_0xdecc8c,null));};exports[_0xb741('0xb3')]=function(_0x1f1d39,_0x1c09fe,_0x3c7e24){var _0x3294bc={'raw':![],'where':{}};var _0x22fdad={};var _0x394682={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xb741('0xb4')]({'where':{'id':_0x1f1d39[_0xb741('0xa8')]['id']}})['then'](handleEntityNotFound(_0x1c09fe,null))[_0xb741('0x2b')](function(_0x32f5e6){if(_0x32f5e6){_0x22fdad[_0xb741('0x38')]=_[_0xb741('0xa9')](db['FaxMessage'][_0xb741('0x36')]);_0x22fdad['query']=_[_0xb741('0xa9')](_0x1f1d39[_0xb741('0x39')]);_0x22fdad[_0xb741('0x41')]=_[_0xb741('0x3a')](_0x22fdad[_0xb741('0x38')],_0x22fdad['query']);_0x3294bc[_0xb741('0x3b')]=_[_0xb741('0x3a')](_0x22fdad[_0xb741('0x38')],qs['fields'](_0x1f1d39[_0xb741('0x39')]['fields']));_0x3294bc[_0xb741('0x3b')]=_0x3294bc[_0xb741('0x3b')][_0xb741('0x5b')]?_0x3294bc['attributes']:_0x22fdad[_0xb741('0x38')];if(!_0x1f1d39[_0xb741('0x39')]['hasOwnProperty']('nolimit')){_0x3294bc[_0xb741('0x23')]=qs[_0xb741('0x23')](_0x1f1d39[_0xb741('0x39')][_0xb741('0x23')]);_0x3294bc[_0xb741('0x21')]=qs[_0xb741('0x21')](_0x1f1d39[_0xb741('0x39')][_0xb741('0x21')]);}_0x3294bc[_0xb741('0x3e')]=qs[_0xb741('0x3f')](_0x1f1d39[_0xb741('0x39')][_0xb741('0x3f')]);_0x3294bc[_0xb741('0x40')]=qs[_0xb741('0x41')](_[_0xb741('0x42')](_0x1f1d39[_0xb741('0x39')],_0x22fdad[_0xb741('0x41')]));_0x3294bc[_0xb741('0x40')][_0xb741('0xa5')]=_0x32f5e6['id'];if(_0x1f1d39[_0xb741('0x39')][_0xb741('0x7e')]){_0x3294bc[_0xb741('0x40')]=_[_0xb741('0x8e')](_0x3294bc[_0xb741('0x40')],{'$or':_[_0xb741('0x30')](_0x3294bc[_0xb741('0x3b')],function(_0x363d8c){var _0x57998b={};_0x57998b[_0x363d8c]={'$like':'%'+_0x1f1d39[_0xb741('0x39')][_0xb741('0x7e')]+'%'};return _0x57998b;})});}if(_0x1f1d39[_0xb741('0x39')][_0xb741('0xb5')]){var _0x184b5f=_0x1f1d39[_0xb741('0x39')]['$gte'][_0xb741('0x34')](',');var _0x48234e={};_0x48234e[_0x184b5f[0x0]]={'$gte':moment(_0x184b5f[0x1])[_0xb741('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3294bc['where']=_[_0xb741('0x8e')](_0x3294bc[_0xb741('0x40')],_0x48234e);}_0x3294bc=_[_0xb741('0x8e')]({},_0x3294bc,_0x1f1d39['options']);return db['FaxMessage']['count']({'where':_0x3294bc[_0xb741('0x40')]})[_0xb741('0x2b')](function(_0x1fb6ae){_0x394682[_0xb741('0x24')]=_0x1fb6ae;if(_0x1f1d39[_0xb741('0x39')][_0xb741('0xaa')]){_0x3294bc[_0xb741('0xab')]=[{'all':!![]}];}return db['FaxMessage'][_0xb741('0xb7')](_0x3294bc);})['then'](function(_0x4617e3){_0x394682[_0xb741('0xb8')]=_0x4617e3;return _0x394682;});}})[_0xb741('0x2b')](respondWithFilteredResult(_0x1c09fe,_0x3294bc))[_0xb741('0xac')](handleError(_0x1c09fe,null));};exports[_0xb741('0xb9')]=function(_0xe883e6,_0x133e7a,_0x596c0a){return db[_0xb741('0x35')][_0xb741('0x6e')]({'where':{'id':_0xe883e6[_0xb741('0xa8')]['id']}})[_0xb741('0x2b')](handleEntityNotFound(_0x133e7a,null))['then'](function(_0x2f38e0){if(_0x2f38e0){return _0x2f38e0['setTags'](_0xe883e6[_0xb741('0x70')][_0xb741('0xb1')],_[_0xb741('0xb2')](_0xe883e6[_0xb741('0x70')],[_0xb741('0xb1'),'id'])||{})[_0xb741('0xba')](function(){return db[_0xb741('0x6a')]['findAll']({'attributes':['id',_0xb741('0x2d'),_0xb741('0xbb')],'where':{'id':_0xe883e6['body']['ids']}});})[_0xb741('0x2b')](function(_0x193e5f){socket['emit'](_0xb741('0xbc'),{'id':Number(_0xe883e6[_0xb741('0xa8')]['id']),'tags':_0x193e5f||[]});return{'id':Number(_0xe883e6[_0xb741('0xa8')]['id']),'tags':_0x193e5f||[]};});}})[_0xb741('0x2b')](respondWithResult(_0x133e7a,null))[_0xb741('0xac')](handleError(_0x133e7a,null));};exports[_0xb741('0xbd')]=function(_0x41b029,_0x38b3a5,_0x40bd39){return db['FaxInteraction'][_0xb741('0x6e')]({'where':{'id':_0x41b029['params']['id']}})[_0xb741('0x2b')](handleEntityNotFound(_0x38b3a5,null))['then'](function(_0x284a7a){if(_0x284a7a){return _0x284a7a[_0xb741('0xbd')](_0x41b029[_0xb741('0x39')][_0xb741('0xb1')]);}})[_0xb741('0x2b')](respondWithStatusCode(_0x38b3a5,null))[_0xb741('0xac')](handleError(_0x38b3a5,null));};exports[_0xb741('0xbe')]=function(_0x52ca96,_0x3c972e){var _0x2bd810=moment()[_0xb741('0xbf')]()[_0xb741('0x8d')]();var _0x29a179=path['join'](config[_0xb741('0xc0')],'server','files',_0xb741('0xc1'));var _0x335c9b=path[_0xb741('0xc2')](config[_0xb741('0xc0')],'server',_0xb741('0xc3'),_0xb741('0xc4'));var _0x166468=path[_0xb741('0xc2')](_0x29a179,_0x2bd810);var _0x5050c1=util[_0xb741('0xb6')]('transcript-%d-%s.zip',_0x52ca96[_0xb741('0xa8')]['id'],_0x2bd810);var _0x36c014=path[_0xb741('0xc2')](_0x29a179,_0x5050c1);var _0x11f2fb=[];_0x11f2fb['push']({'model':db[_0xb741('0xc5')],'as':'Attachment','raw':!![]});var _0x451e70=[{'model':db[_0xb741('0xb0')],'as':_0xb741('0xc6'),'attributes':['id',_0xb741('0x70'),'createdAt'],'include':_0x11f2fb}];return db[_0xb741('0x35')][_0xb741('0x6e')]({'where':{'id':_0x52ca96[_0xb741('0xa8')]['id']},'include':_0x451e70})['then'](handleEntityNotFound(_0x3c972e,null))[_0xb741('0x2b')](function(_0x5b8b04){if(_0x5b8b04&&_0x5b8b04[_0xb741('0xc6')]){var _0x2754f7=_0x5b8b04['get']({'plain':!![]});fs['mkdirSync'](_0x166468);for(var _0x213205=0x0;_0x213205<_0x2754f7[_0xb741('0xc6')]['length'];_0x213205++){var _0x42794d=_0x2754f7[_0xb741('0xc6')][_0x213205][_0xb741('0xc5')];if(_0x42794d){var _0x1f66d8=path['join'](_0x335c9b,_0x42794d[_0xb741('0xc7')]);if(fs[_0xb741('0xc8')](_0x1f66d8)){fs[_0xb741('0xc9')](_0x1f66d8)[_0xb741('0xca')](fs[_0xb741('0xcb')](path[_0xb741('0xc2')](_0x166468,_0x42794d['basename'])));}}}return BPromise[_0xb741('0x85')]()[_0xb741('0x2b')](function(){return new BPromise(function(_0x5af3e4,_0x4c61e8){zipdir(_0x166468,{'saveTo':_0x36c014},function(_0x53496c,_0x25643c){if(_0x53496c)return _0x4c61e8(_0x53496c);return _0x5af3e4(_0x25643c);});})[_0xb741('0x2b')](function(){return new BPromise(function(_0x1bb873,_0x41a1f3){rimraf(_0x166468,function(_0x36d82d){if(_0x36d82d)_0x41a1f3(_0x36d82d);return _0x1bb873();});});})['then'](function(){return _0x3c972e[_0xb741('0xbe')](_0x36c014,_0x5050c1,function(_0x18ec69){if(_0x18ec69){console[_0xb741('0xcc')](_0xb741('0xcd'),_0x18ec69);}else{fs[_0xb741('0xce')](_0x36c014);}});});});}else{return _0x3c972e[_0xb741('0x1d')](0xc8);}})[_0xb741('0xac')](handleError(_0x3c972e,null));};
\ No newline at end of file
+var _0x99d2=['files','tmp','join','attachments','transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','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','ContactId','buildExpression','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','text','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','Contact.mobile','Contact.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','rawAttributes','include','merge','create','body','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','pick','format','options','includeAll','findAll','rows','setTags','omit','color','emit','faxInteractionTags:save','removeTags','download','unix','root','server'];(function(_0x2862b1,_0x51a367){var _0x817ee6=function(_0x59cc5b){while(--_0x59cc5b){_0x2862b1['push'](_0x2862b1['shift']());}};_0x817ee6(++_0x51a367);}(_0x99d2,0xe4));var _0x299d=function(_0x7e5dd7,_0x38a320){_0x7e5dd7=_0x7e5dd7-0x0;var _0x5499a7=_0x99d2[_0x7e5dd7];return _0x5499a7;};'use strict';var emlformat=require(_0x299d('0x0'));var rimraf=require(_0x299d('0x1'));var zipdir=require(_0x299d('0x2'));var jsonpatch=require(_0x299d('0x3'));var rp=require(_0x299d('0x4'));var moment=require(_0x299d('0x5'));var BPromise=require(_0x299d('0x6'));var Mustache=require(_0x299d('0x7'));var util=require('util');var path=require(_0x299d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x299d('0x9'));var fs=require('fs');var fs_extra=require(_0x299d('0xa'));var _=require(_0x299d('0xb'));var squel=require(_0x299d('0xc'));var crypto=require(_0x299d('0xd'));var jsforce=require(_0x299d('0xe'));var deskjs=require(_0x299d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x299d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x299d('0x11'));var hardwareService=require(_0x299d('0x12'));var logger=require(_0x299d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x299d('0x14'));var licenseUtil=require(_0x299d('0x15'));var db=require(_0x299d('0x16'))['db'];config['redis']=_['defaults'](config[_0x299d('0x17')],{'host':_0x299d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x299d('0x17')]));require(_0x299d('0x19'))[_0x299d('0x1a')](socket);function respondWithStatusCode(_0x160a44,_0x12217a){_0x12217a=_0x12217a||0xcc;return function(_0x2ade4b){if(_0x2ade4b){return _0x160a44[_0x299d('0x1b')](_0x12217a);}return _0x160a44[_0x299d('0x1c')](_0x12217a)[_0x299d('0x1d')]();};}function respondWithResult(_0x283d73,_0x2fba2a){_0x2fba2a=_0x2fba2a||0xc8;return function(_0xe00605){if(_0xe00605){return _0x283d73[_0x299d('0x1c')](_0x2fba2a)[_0x299d('0x1e')](_0xe00605);}};}function respondWithFilteredResult(_0x546849,_0x336088){return function(_0x5840b3){if(_0x5840b3){var _0x3917be=typeof _0x336088[_0x299d('0x1f')]===_0x299d('0x20')&&typeof _0x336088[_0x299d('0x21')]==='undefined';var _0x3b0949=_0x5840b3[_0x299d('0x22')];var _0x7cb23a=_0x3917be?0x0:_0x336088[_0x299d('0x1f')];var _0x38db81=_0x3917be?_0x5840b3[_0x299d('0x22')]:_0x336088[_0x299d('0x1f')]+_0x336088['limit'];var _0xb56d91;if(_0x38db81>=_0x3b0949){_0x38db81=_0x3b0949;_0xb56d91=0xc8;}else{_0xb56d91=0xce;}_0x546849[_0x299d('0x1c')](_0xb56d91);return _0x546849['set'](_0x299d('0x23'),_0x7cb23a+'-'+_0x38db81+'/'+_0x3b0949)[_0x299d('0x1e')](_0x5840b3);}return null;};}function patchUpdates(_0x2ebdfa){return function(_0xa895f3){try{jsonpatch[_0x299d('0x24')](_0xa895f3,_0x2ebdfa,!![]);}catch(_0x54caf5){return BPromise[_0x299d('0x25')](_0x54caf5);}return _0xa895f3[_0x299d('0x26')]();};}function saveUpdates(_0x1a2420,_0xdba49b){return function(_0x15320c){if(_0x15320c){return _0x15320c[_0x299d('0x27')](_0x1a2420)[_0x299d('0x28')](function(_0x3bb589){return _0x3bb589;});}return null;};}function removeEntity(_0x1a91c1,_0x437f14){return function(_0x47a874){if(_0x47a874){return _0x47a874[_0x299d('0x29')]()[_0x299d('0x28')](function(){_0x1a91c1[_0x299d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c429f,_0x210fba){return function(_0x513c73){if(!_0x513c73){_0x1c429f[_0x299d('0x1b')](0x194);}return _0x513c73;};}function handleError(_0x1ccd69,_0x30bd94){_0x30bd94=_0x30bd94||0x1f4;return function(_0x1df42d){logger['error'](_0x1df42d['stack']);if(_0x1df42d[_0x299d('0x2a')]){delete _0x1df42d['name'];}_0x1ccd69[_0x299d('0x1c')](_0x30bd94)[_0x299d('0x2b')](_0x1df42d);};}function getInteractionUsers(_0x992d0f,_0x20d626){return new BPromise(function(_0x3b4082,_0x2b0663){try{if(_0x20d626[_0x992d0f['id']]){_0x992d0f[_0x299d('0x2c')]=_[_0x299d('0x2d')](_0x20d626[_0x992d0f['id']],function(_0x203084){return{'id':_0x203084['id'],'fullname':_0x203084[_0x299d('0x2e')]};});}}catch(_0x3dcb77){_0x2b0663(_0x3dcb77);}_0x3b4082(_0x992d0f);});}function getInteractionTags(_0x35472b,_0x299d86){return new BPromise(function(_0xb5935f,_0x4bc8a7){try{if(_0x35472b[_0x299d('0x2f')]){_0x35472b[_0x299d('0x30')]=[];_0x35472b[_0x299d('0x2f')][_0x299d('0x31')](',')[_0x299d('0x32')](function(_0x2ba1ff){_0x35472b['Tags'][_0x299d('0x33')](_0x299d86[_0x2ba1ff]);});}delete _0x35472b['TagIds'];}catch(_0x22d332){_0x4bc8a7(_0x22d332);}_0xb5935f(_0x35472b);});}function updateFaxInteraction(_0x5785ee,_0x23b3b0,_0x5895b4){return new BPromise(function(_0x33f760,_0x222707){return getInteractionUsers(_0x5785ee,_0x5895b4)['then'](function(_0x5557a8){return getInteractionTags(_0x5557a8,_0x23b3b0);})[_0x299d('0x28')](function(_0x57e912){_0x33f760(_0x57e912);})[_0x299d('0x34')](function(_0x492956){_0x222707(_0x492956);});});}exports[_0x299d('0x35')]=function(_0x1b6266,_0x4f8fb1){var _0x9683c={},_0x4d91ee={},_0x19f5da={'count':0x0,'rows':[]};var _0x45471b=_[_0x299d('0x2d')](db[_0x299d('0x36')]['rawAttributes'],function(_0x2947ed){return{'name':_0x2947ed[_0x299d('0x37')],'type':_0x2947ed[_0x299d('0x38')][_0x299d('0x39')]};});_0x4d91ee[_0x299d('0x3a')]=_[_0x299d('0x2d')](_0x45471b,_0x299d('0x2a'));_0x4d91ee[_0x299d('0x3b')]=_[_0x299d('0x3c')](_0x1b6266[_0x299d('0x3b')]);_0x4d91ee[_0x299d('0x3d')]=_['intersection'](_0x4d91ee[_0x299d('0x3a')],_0x4d91ee[_0x299d('0x3b')]);_0x9683c['attributes']=_[_0x299d('0x3e')](_0x4d91ee[_0x299d('0x3a')],qs[_0x299d('0x3f')](_0x1b6266[_0x299d('0x3b')][_0x299d('0x3f')]));_0x9683c['attributes']=_0x9683c[_0x299d('0x40')][_0x299d('0x41')]?_0x9683c['attributes']:_0x4d91ee[_0x299d('0x3a')];if(!_0x1b6266[_0x299d('0x3b')][_0x299d('0x42')](_0x299d('0x43'))){_0x9683c[_0x299d('0x21')]=qs[_0x299d('0x21')](_0x1b6266[_0x299d('0x3b')][_0x299d('0x21')]);_0x9683c[_0x299d('0x1f')]=qs['offset'](_0x1b6266[_0x299d('0x3b')][_0x299d('0x1f')]);}_0x9683c[_0x299d('0x44')]=qs[_0x299d('0x45')](_0x1b6266[_0x299d('0x3b')][_0x299d('0x45')]);_0x9683c[_0x299d('0x46')]=qs[_0x299d('0x3d')](_['pick'](_0x1b6266[_0x299d('0x3b')],_0x4d91ee[_0x299d('0x3d')]),_0x45471b);var _0x59fc35=[];var _0x28e141=squel['select']()['field']('id')[_0x299d('0x47')](_0x299d('0x2a'))[_0x299d('0x47')]('color')[_0x299d('0x48')](_0x299d('0x49'));var _0x5bf8ac=squel['select']()[_0x299d('0x47')]('u.id')[_0x299d('0x47')](_0x299d('0x4a'))['field'](_0x299d('0x4b'))[_0x299d('0x48')](_0x299d('0x4c'),'ui')['left_join'](_0x299d('0x4d'),'u',_0x299d('0x4e'));var _0x58595a=squel['select']()[_0x299d('0x48')]('fax_interactions','i')[_0x299d('0x4f')](_0x299d('0x50'),'c',_0x299d('0x51'))[_0x299d('0x4f')](_0x299d('0x4d'),'o','o.id\x20=\x20i.UserId')[_0x299d('0x4f')](_0x299d('0x52'),'a','a.id\x20=\x20i.FaxAccountId')['left_join']('fax_messages','me',_0x299d('0x53'))[_0x299d('0x4f')]('fax_interaction_has_tags','it',_0x299d('0x54'))[_0x299d('0x4f')](_0x299d('0x49'),'t',_0x299d('0x55'));var _0x39be8e=squel['expr']();var _0x1257cb=[];var _0x4135e0=squel[_0x299d('0x56')]();var _0x4379f9;if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x57')]){_0x4379f9=as[_0x299d('0x58')](_0x1b6266[_0x299d('0x3b')][_0x299d('0x57')]);var _0x23ba7c=_0x4379f9[_0x299d('0x59')];for(var _0x37c615=0x0;_0x37c615<_0x4379f9[_0x299d('0x5a')]['length'];_0x37c615++){var _0x5457cb=_0x4379f9[_0x299d('0x5a')][_0x37c615];var _0x3cc96c='i';var _0x1116c9=_[_0x299d('0x5b')](_0x45471b,[_0x299d('0x2a'),_0x5457cb['field']]);if(!_0x1116c9){switch(_0x5457cb[_0x299d('0x47')]){case _0x299d('0x5c'):if(_0x5457cb[_0x299d('0x5d')]==0x1){_0x58595a[_0x299d('0x5e')]('`'+_0x5457cb['field']+_0x299d('0x5f'));}else{_0x58595a[_0x299d('0x5e')]('`'+_0x5457cb['field']+_0x299d('0x60'));}break;case _0x299d('0x61'):if(_0x5457cb[_0x299d('0x62')]==='$substring'){if(_0x5457cb[_0x299d('0x5d')][_0x299d('0x31')]('\x20')[_0x299d('0x41')]>0x1){_0x39be8e[_0x23ba7c](_0x299d('0x63'),qs[_0x299d('0x64')](_0x5457cb[_0x299d('0x5d')]),null);}else{var _0x4b3bb8='%'+_0x5457cb[_0x299d('0x5d')]+'%';_0x39be8e[_0x23ba7c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4b3bb8,_0x4b3bb8,_0x4b3bb8);}}else{_0x1116c9=_[_0x299d('0x5b')](_0x45471b,[_0x299d('0x2a'),_0x299d('0x65')]);_0x5457cb[_0x299d('0x47')]=_0x299d('0x65');_0x32c67b=as[_0x299d('0x66')](_0x3cc96c,_0x1116c9[_0x299d('0x38')],_0x5457cb);_0x39be8e[_0x23ba7c](_0x32c67b['text'],_0x32c67b['value'][_0x299d('0x67')],_0x32c67b[_0x299d('0x5d')][_0x299d('0x1d')]);}break;case _0x299d('0x68'):var _0x57b89e=_0x5457cb['value'][_0x299d('0x31')](',')[_0x299d('0x2d')](function(_0x5a1c8b){return Number(_0x5a1c8b);});_0x57b89e[_0x299d('0x32')](function(_0xa7f42a){_0x4135e0['or'](_0x299d('0x69'),'%,'+_0xa7f42a+',%');});_0x1257cb=_[_0x299d('0x6a')](_0x1257cb,_0x57b89e);break;case _0x299d('0x6b'):if(_0x5457cb[_0x299d('0x62')]===_0x299d('0x6c')){_0x39be8e[_0x23ba7c](_0x299d('0x6d'),'%'+_0x5457cb[_0x299d('0x5d')]+'%',null);}else{_0x1116c9=_['find'](_0x45471b,[_0x299d('0x2a'),_0x299d('0x6e')]);_0x5457cb[_0x299d('0x47')]=_0x299d('0x6e');_0x32c67b=as['buildExpression'](_0x3cc96c,_0x1116c9[_0x299d('0x38')],_0x5457cb);_0x39be8e[_0x23ba7c](_0x32c67b[_0x299d('0x6f')],_0x32c67b[_0x299d('0x5d')][_0x299d('0x67')],_0x32c67b[_0x299d('0x5d')][_0x299d('0x1d')]);}break;case'body':_0x32c67b=as['buildExpression']('me',null,_0x5457cb);_0x39be8e[_0x23ba7c](_0x32c67b[_0x299d('0x6f')],_0x32c67b[_0x299d('0x5d')]['start'],_0x32c67b[_0x299d('0x5d')][_0x299d('0x1d')]);break;}}else{var _0x32c67b=as[_0x299d('0x66')](_0x3cc96c,_0x1116c9[_0x299d('0x38')],_0x5457cb);_0x39be8e[_0x23ba7c](_0x32c67b['text'],_0x32c67b[_0x299d('0x5d')][_0x299d('0x67')],_0x32c67b[_0x299d('0x5d')]['end']);}}}else{var _0x1364cc=_(_0x1b6266[_0x299d('0x3b')])[_0x299d('0x3c')]()[_0x299d('0x2d')](function(_0x3dfee0){return _['some'](_0x45471b,[_0x299d('0x2a'),_0x3dfee0])?_0x3dfee0:undefined;})[_0x299d('0x70')]()[_0x299d('0x5d')]();if(!_[_0x299d('0x71')](_0x1364cc)){_0x1364cc[_0x299d('0x32')](function(_0x1fe599){if(_0x1fe599===_0x299d('0x72')){_0x58595a[_0x299d('0x46')](_0x299d('0x73'),[][_0x299d('0x74')](_0x1b6266[_0x299d('0x3b')][_0x1fe599]));}else if(_0x1fe599===_0x299d('0x75')){var _0x25873e=JSON[_0x299d('0x76')](_0x1b6266[_0x299d('0x3b')][_0x1fe599])[_0x299d('0x77')];var _0x2916de=JSON[_0x299d('0x76')](_0x1b6266['query'][_0x1fe599])[_0x299d('0x78')];_0x58595a[_0x299d('0x46')](_0x299d('0x79'),_0x25873e,_0x2916de);}else{if(_0x1b6266['query'][_0x1fe599]===_0x299d('0x7a')){_0x58595a[_0x299d('0x46')]('i.'+_0x1fe599+_0x299d('0x7b'));}else{_0x58595a['where']('i.'+_0x1fe599+_0x299d('0x7c'),_0x1b6266[_0x299d('0x3b')][_0x1fe599]);}}});}if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x7d')]){if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x7d')]==0x1){_0x58595a[_0x299d('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x58595a[_0x299d('0x5e')](_0x299d('0x7e'));}}if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x7f')]){_0x1257cb=_[_0x299d('0x80')](_0x1b6266[_0x299d('0x3b')]['tag'])?_0x1b6266[_0x299d('0x3b')][_0x299d('0x7f')]:new Array(_0x1b6266[_0x299d('0x3b')][_0x299d('0x7f')]);_0x1257cb[_0x299d('0x32')](function(_0x52d6cd){_0x4135e0['or'](_0x299d('0x69'),'%,'+_0x52d6cd+',%');});}if(_0x1b6266[_0x299d('0x3b')]['filter']){var _0x5e995e=_0x1b6266[_0x299d('0x3b')][_0x299d('0x81')]['replace']('\x5c','\x5c\x5c')[_0x299d('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5e995e)){_0x39be8e['or'](_0x299d('0x83'),_0x5e995e+'%')['or'](_0x299d('0x84'),_0x5e995e+'%');}_0x39be8e['or'](_0x299d('0x85'),_0x5e995e+'%');}}_0x58595a[_0x299d('0x46')](_0x39be8e);_0x58595a['group'](_0x299d('0x86'));var _0xa5e797={'type':db[_0x299d('0x87')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5cadd5=_0x58595a[_0x299d('0x88')]();_0x5cadd5[_0x299d('0x47')](_0x299d('0x86'));_0x5cadd5[_0x299d('0x47')](_0x299d('0x89'),_0x299d('0x5c'));if(_0x9683c['order']){_0x9683c[_0x299d('0x44')][_0x299d('0x32')](function(_0x1d102d){var _0x55c838=_0x1d102d[0x0]===_0x299d('0x8a')?_0x1d102d[0x0]:'i.'+_0x1d102d[0x0];_0x58595a[_0x299d('0x44')](_0x55c838,_0x1d102d[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1257cb)){_0x58595a[_0x299d('0x5e')](_0x4135e0);_0x5cadd5[_0x299d('0x46')](_0x299d('0x8b'),_0x1257cb);}BPromise['resolve']()[_0x299d('0x28')](function(){if(!_0x4379f9){if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x72')])return;_0x5cadd5[_0x299d('0x46')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x58595a[_0x299d('0x46')](_0x299d('0x8c'));return;}if(_0x1b6266[_0x299d('0x8d')]['role']!==_0x299d('0x8e'))return;return _0x1b6266[_0x299d('0x8d')][_0x299d('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x47c033){if(_[_0x299d('0x71')](_0x47c033)){_0x5cadd5[_0x299d('0x46')](_0x299d('0x90'));_0x58595a['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x5cadd5[_0x299d('0x46')](_0x299d('0x73'),_[_0x299d('0x2d')](_0x47c033,'id'));_0x58595a[_0x299d('0x46')](_0x299d('0x73'),_[_0x299d('0x2d')](_0x47c033,'id'));}});})[_0x299d('0x28')](function(){if(_0x1b6266[_0x299d('0x8d')][_0x299d('0x91')]===_0x299d('0x8e')&&!_0x4379f9&&!_0x1b6266['query'][_0x299d('0x72')])return[];return db['sequelize']['query'](_0x5cadd5[_0x299d('0x92')](),_0xa5e797);})['then'](function(_0x63da94){_0x19f5da[_0x299d('0x22')]=_0x63da94['length'];if(_0x19f5da['count']===0x0)return[];return db[_0x299d('0x93')]['query'](_0x28e141['toString'](),_0xa5e797)[_0x299d('0x28')](function(_0x2398f9){_0x59fc35=_[_0x299d('0x94')](_0x2398f9,'id');_0xa5e797=_['merge'](_0xa5e797,{'model':db[_0x299d('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1b6266['query'][_0x299d('0x3f')]){_0x9683c[_0x299d('0x40')][_0x299d('0x32')](function(_0x44007b){_0x58595a[_0x299d('0x47')]('i.'+_0x44007b);});}else{_0x58595a[_0x299d('0x47')](_0x299d('0x89'),'unreadMessages');_0x58595a[_0x299d('0x47')](_0x299d('0x95'),_0x299d('0x96'));_0x58595a[_0x299d('0x47')]('a.mandatoryDisposition',_0x299d('0x97'));_0x58595a['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x299d('0x8a'));_0x58595a[_0x299d('0x47')]('i.*');_0x58595a['field'](_0x299d('0x98'),_0x299d('0x99'));_0x58595a[_0x299d('0x47')](_0x299d('0x9a'),'Contact.lastName');_0x58595a[_0x299d('0x47')]('c.email','Contact.email');_0x58595a[_0x299d('0x47')](_0x299d('0x9b'),_0x299d('0x9c'));_0x58595a[_0x299d('0x47')]('c.mobile',_0x299d('0x9d'));_0x58595a[_0x299d('0x47')]('c.fax',_0x299d('0x9e'));_0x58595a['field']('o.fullname','Owner.fullname');_0x58595a[_0x299d('0x47')]('o.internal',_0x299d('0x9f'));_0x58595a[_0x299d('0x47')](_0x299d('0xa0'),_0x299d('0x2f'));}if(_0x9683c['limit'])_0x58595a[_0x299d('0x21')](_0x9683c[_0x299d('0x21')]);if(_0x9683c[_0x299d('0x1f')])_0x58595a[_0x299d('0x1f')](_0x9683c[_0x299d('0x1f')]);return db[_0x299d('0x93')][_0x299d('0x3b')](_0x58595a[_0x299d('0x92')](),_0xa5e797);})[_0x299d('0x28')](function(_0x6183fa){if(_0x6183fa[_0x299d('0x41')]>0x0)_0x5bf8ac[_0x299d('0x46')](_0x299d('0xa1'),_['map'](_0x6183fa,'id'));return db['sequelize'][_0x299d('0x3b')](_0x5bf8ac[_0x299d('0x92')](),_0xa5e797)[_0x299d('0x28')](function(_0xefe8d0){var _0x345e83=_[_0x299d('0xa2')](_0xefe8d0,_0x299d('0xa3'));var _0x2a59a8=[];_0x6183fa[_0x299d('0x32')](function(_0x1fd7f0){_0x2a59a8[_0x299d('0x33')](updateFaxInteraction(_0x1fd7f0,_0x59fc35,_0x345e83));});return BPromise[_0x299d('0xa4')](_0x2a59a8);});});})[_0x299d('0x28')](function(_0x3ab654){_0x19f5da['rows']=_0x3ab654;return _0x19f5da;})[_0x299d('0x28')](respondWithFilteredResult(_0x4f8fb1,_0x9683c))[_0x299d('0x34')](handleError(_0x4f8fb1,null));};exports[_0x299d('0xa5')]=function(_0x1d99e6,_0x44570){var _0x360315={'raw':![],'where':{'id':_0x1d99e6['params']['id']}},_0x5c38fd={};_0x5c38fd[_0x299d('0x3a')]=_[_0x299d('0x3c')](db['FaxInteraction'][_0x299d('0xa6')]);_0x5c38fd['query']=_[_0x299d('0x3c')](_0x1d99e6[_0x299d('0x3b')]);_0x5c38fd['filters']=_[_0x299d('0x3e')](_0x5c38fd[_0x299d('0x3a')],_0x5c38fd[_0x299d('0x3b')]);_0x360315[_0x299d('0x40')]=_['intersection'](_0x5c38fd[_0x299d('0x3a')],qs['fields'](_0x1d99e6['query'][_0x299d('0x3f')]));_0x360315[_0x299d('0x40')]=_0x360315['attributes'][_0x299d('0x41')]?_0x360315['attributes']:_0x5c38fd[_0x299d('0x3a')];if(_0x1d99e6['query']['includeAll']){_0x360315[_0x299d('0xa7')]=[{'all':!![]}];}_0x360315=_[_0x299d('0xa8')]({},_0x360315,_0x1d99e6['options']);return db[_0x299d('0x36')]['find'](_0x360315)[_0x299d('0x28')](handleEntityNotFound(_0x44570,null))['then'](respondWithResult(_0x44570,null))['catch'](handleError(_0x44570,null));};exports['create']=function(_0x1dd2ef,_0x3d5d80){return db['FaxInteraction'][_0x299d('0xa9')](_0x1dd2ef[_0x299d('0xaa')],{})[_0x299d('0x28')](respondWithResult(_0x3d5d80,0xc9))[_0x299d('0x34')](handleError(_0x3d5d80,null));};exports[_0x299d('0x27')]=function(_0x1e6a33,_0x576b08){if(_0x1e6a33[_0x299d('0xaa')]['id']){delete _0x1e6a33[_0x299d('0xaa')]['id'];}return db['FaxInteraction'][_0x299d('0x5b')]({'where':{'id':_0x1e6a33[_0x299d('0xab')]['id']}})[_0x299d('0x28')](handleEntityNotFound(_0x576b08,null))[_0x299d('0x28')](saveUpdates(_0x1e6a33['body'],null))[_0x299d('0x28')](respondWithResult(_0x576b08,null))['catch'](handleError(_0x576b08,null));};exports[_0x299d('0x29')]=function(_0x138e1a,_0x3b49b6){return db[_0x299d('0x36')][_0x299d('0x5b')]({'where':{'id':_0x138e1a[_0x299d('0xab')]['id']}})['then'](handleEntityNotFound(_0x3b49b6,null))['then'](removeEntity(_0x3b49b6,null))[_0x299d('0x34')](handleError(_0x3b49b6,null));};exports[_0x299d('0xac')]=function(_0x2320d5,_0x4e010a){return db[_0x299d('0x36')][_0x299d('0xac')]()[_0x299d('0x28')](respondWithResult(_0x4e010a,null))[_0x299d('0x34')](handleError(_0x4e010a,null));};exports[_0x299d('0xad')]=function(_0x1735a2,_0x3d5b61,_0x2ada97){return db[_0x299d('0xae')][_0x299d('0x5b')]({'where':{'id':_0x1735a2[_0x299d('0xab')]['id']}})[_0x299d('0x28')](handleEntityNotFound(_0x3d5b61,null))[_0x299d('0x28')](function(_0x93fdcd){if(_0x93fdcd){return _0x93fdcd[_0x299d('0xad')](_0x1735a2['body'][_0x299d('0xaf')],_['omit'](_0x1735a2[_0x299d('0xaa')],['ids','id'])||{});}})[_0x299d('0x28')](respondWithResult(_0x3d5b61,null))[_0x299d('0x34')](handleError(_0x3d5b61,null));};exports[_0x299d('0xb0')]=function(_0x4e2a21,_0x104824,_0x380feb){var _0x20e315={'raw':![],'where':{}};var _0x59528c={};var _0x3aa0df={'count':0x0,'rows':[]};return db[_0x299d('0x36')][_0x299d('0xb1')]({'where':{'id':_0x4e2a21[_0x299d('0xab')]['id']}})[_0x299d('0x28')](handleEntityNotFound(_0x104824,null))['then'](function(_0x5a52f1){if(_0x5a52f1){_0x59528c[_0x299d('0x3a')]=_[_0x299d('0x3c')](db['FaxMessage']['rawAttributes']);_0x59528c[_0x299d('0x3b')]=_[_0x299d('0x3c')](_0x4e2a21['query']);_0x59528c[_0x299d('0x3d')]=_[_0x299d('0x3e')](_0x59528c[_0x299d('0x3a')],_0x59528c['query']);_0x20e315[_0x299d('0x40')]=_[_0x299d('0x3e')](_0x59528c[_0x299d('0x3a')],qs[_0x299d('0x3f')](_0x4e2a21[_0x299d('0x3b')][_0x299d('0x3f')]));_0x20e315['attributes']=_0x20e315['attributes'][_0x299d('0x41')]?_0x20e315[_0x299d('0x40')]:_0x59528c[_0x299d('0x3a')];if(!_0x4e2a21[_0x299d('0x3b')]['hasOwnProperty'](_0x299d('0x43'))){_0x20e315[_0x299d('0x21')]=qs[_0x299d('0x21')](_0x4e2a21[_0x299d('0x3b')][_0x299d('0x21')]);_0x20e315['offset']=qs[_0x299d('0x1f')](_0x4e2a21[_0x299d('0x3b')][_0x299d('0x1f')]);}_0x20e315[_0x299d('0x44')]=qs[_0x299d('0x45')](_0x4e2a21[_0x299d('0x3b')]['sort']);_0x20e315[_0x299d('0x46')]=qs[_0x299d('0x3d')](_[_0x299d('0xb2')](_0x4e2a21[_0x299d('0x3b')],_0x59528c[_0x299d('0x3d')]));_0x20e315[_0x299d('0x46')][_0x299d('0xa3')]=_0x5a52f1['id'];if(_0x4e2a21['query']['filter']){_0x20e315[_0x299d('0x46')]=_[_0x299d('0xa8')](_0x20e315['where'],{'$or':_[_0x299d('0x2d')](_0x20e315[_0x299d('0x40')],function(_0x1506d6){var _0x518c2b={};_0x518c2b[_0x1506d6]={'$like':'%'+_0x4e2a21[_0x299d('0x3b')][_0x299d('0x81')]+'%'};return _0x518c2b;})});}if(_0x4e2a21[_0x299d('0x3b')][_0x299d('0x77')]){var _0x1566ff=_0x4e2a21[_0x299d('0x3b')][_0x299d('0x77')][_0x299d('0x31')](',');var _0x802708={};_0x802708[_0x1566ff[0x0]]={'$gte':moment(_0x1566ff[0x1])[_0x299d('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x20e315['where']=_[_0x299d('0xa8')](_0x20e315[_0x299d('0x46')],_0x802708);}_0x20e315=_[_0x299d('0xa8')]({},_0x20e315,_0x4e2a21[_0x299d('0xb4')]);return db[_0x299d('0xae')][_0x299d('0x22')]({'where':_0x20e315[_0x299d('0x46')]})[_0x299d('0x28')](function(_0x48bb6b){_0x3aa0df[_0x299d('0x22')]=_0x48bb6b;if(_0x4e2a21[_0x299d('0x3b')][_0x299d('0xb5')]){_0x20e315[_0x299d('0xa7')]=[{'all':!![]}];}return db['FaxMessage'][_0x299d('0xb6')](_0x20e315);})['then'](function(_0x27b978){_0x3aa0df[_0x299d('0xb7')]=_0x27b978;return _0x3aa0df;});}})[_0x299d('0x28')](respondWithFilteredResult(_0x104824,_0x20e315))[_0x299d('0x34')](handleError(_0x104824,null));};exports['addTags']=function(_0x41800a,_0x28ebe1,_0x263d5b){return db[_0x299d('0x36')][_0x299d('0x5b')]({'where':{'id':_0x41800a[_0x299d('0xab')]['id']}})[_0x299d('0x28')](handleEntityNotFound(_0x28ebe1,null))['then'](function(_0x3437ba){if(_0x3437ba){return _0x3437ba[_0x299d('0xb8')](_0x41800a[_0x299d('0xaa')]['ids'],_[_0x299d('0xb9')](_0x41800a[_0x299d('0xaa')],[_0x299d('0xaf'),'id'])||{})['spread'](function(){return db[_0x299d('0x68')][_0x299d('0xb6')]({'attributes':['id',_0x299d('0x2a'),_0x299d('0xba')],'where':{'id':_0x41800a['body'][_0x299d('0xaf')]}});})['then'](function(_0x5780ff){socket[_0x299d('0xbb')](_0x299d('0xbc'),{'id':Number(_0x41800a[_0x299d('0xab')]['id']),'tags':_0x5780ff||[]});return{'id':Number(_0x41800a[_0x299d('0xab')]['id']),'tags':_0x5780ff||[]};});}})['then'](respondWithResult(_0x28ebe1,null))[_0x299d('0x34')](handleError(_0x28ebe1,null));};exports[_0x299d('0xbd')]=function(_0x11aaad,_0x1f4553,_0x1b4433){return db[_0x299d('0x36')][_0x299d('0x5b')]({'where':{'id':_0x11aaad['params']['id']}})['then'](handleEntityNotFound(_0x1f4553,null))['then'](function(_0x415314){if(_0x415314){return _0x415314['removeTags'](_0x11aaad[_0x299d('0x3b')][_0x299d('0xaf')]);}})[_0x299d('0x28')](respondWithStatusCode(_0x1f4553,null))['catch'](handleError(_0x1f4553,null));};exports[_0x299d('0xbe')]=function(_0x2db18f,_0x1f268c){var _0x493eff=moment()[_0x299d('0xbf')]()['toString']();var _0x24e32d=path['join'](config[_0x299d('0xc0')],_0x299d('0xc1'),_0x299d('0xc2'),_0x299d('0xc3'));var _0x321d74=path[_0x299d('0xc4')](config[_0x299d('0xc0')],_0x299d('0xc1'),_0x299d('0xc2'),_0x299d('0xc5'));var _0x374524=path[_0x299d('0xc4')](_0x24e32d,_0x493eff);var _0x2dd853=util[_0x299d('0xb3')](_0x299d('0xc6'),_0x2db18f[_0x299d('0xab')]['id'],_0x493eff);var _0x50b296=path['join'](_0x24e32d,_0x2dd853);var _0x5a7bd6=[];_0x5a7bd6[_0x299d('0x33')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x5f30c2=[{'model':db[_0x299d('0xae')],'as':_0x299d('0xc7'),'attributes':['id','body','createdAt'],'include':_0x5a7bd6}];return db[_0x299d('0x36')][_0x299d('0x5b')]({'where':{'id':_0x2db18f['params']['id']},'include':_0x5f30c2})[_0x299d('0x28')](handleEntityNotFound(_0x1f268c,null))[_0x299d('0x28')](function(_0x34a624){if(_0x34a624&&_0x34a624[_0x299d('0xc7')]){var _0x2464ae=_0x34a624[_0x299d('0xc8')]({'plain':!![]});fs[_0x299d('0xc9')](_0x374524);for(var _0x42e336=0x0;_0x42e336<_0x2464ae[_0x299d('0xc7')][_0x299d('0x41')];_0x42e336++){var _0x595d64=_0x2464ae['Messages'][_0x42e336][_0x299d('0xca')];if(_0x595d64){var _0xc918c3=path[_0x299d('0xc4')](_0x321d74,_0x595d64[_0x299d('0xcb')]);if(fs[_0x299d('0xcc')](_0xc918c3)){fs[_0x299d('0xcd')](_0xc918c3)[_0x299d('0xce')](fs[_0x299d('0xcf')](path[_0x299d('0xc4')](_0x374524,_0x595d64[_0x299d('0xcb')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x363eac,_0x56b4f7){zipdir(_0x374524,{'saveTo':_0x50b296},function(_0x1613e7,_0x19b043){if(_0x1613e7)return _0x56b4f7(_0x1613e7);return _0x363eac(_0x19b043);});})[_0x299d('0x28')](function(){return new BPromise(function(_0x453e18,_0x3939eb){rimraf(_0x374524,function(_0x2e9b75){if(_0x2e9b75)_0x3939eb(_0x2e9b75);return _0x453e18();});});})[_0x299d('0x28')](function(){return _0x1f268c[_0x299d('0xbe')](_0x50b296,_0x2dd853,function(_0x2d06cb){if(_0x2d06cb){console[_0x299d('0xd0')](_0x299d('0xd1'),_0x2d06cb);}else{fs[_0x299d('0xd2')](_0x50b296);}});});});}else{return _0x1f268c[_0x299d('0x1b')](0xc8);}})[_0x299d('0x34')](handleError(_0x1f268c,null));};
\ No newline at end of file
index a0bc1e3..7e45b53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ea4=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','emit','hasOwnProperty','hook'];(function(_0x2e1e92,_0x16e465){var _0x193531=function(_0x2bad55){while(--_0x2bad55){_0x2e1e92['push'](_0x2e1e92['shift']());}};_0x193531(++_0x16e465);}(_0x7ea4,0x100));var _0x47ea=function(_0x1b7ea6,_0x195a62){_0x1b7ea6=_0x1b7ea6-0x0;var _0x4fcea6=_0x7ea4[_0x1b7ea6];return _0x4fcea6;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x47ea('0x0'))['db'][_0x47ea('0x1')];var FaxMessage=require(_0x47ea('0x0'))['db'][_0x47ea('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x47ea('0x3')](0x0);var events={'afterCreate':_0x47ea('0x4'),'afterUpdate':_0x47ea('0x5'),'afterDestroy':_0x47ea('0x6')};function emitEvent(_0x277561){return function(_0x59f81b,_0x1e78b9,_0x46df73){_0x59f81b['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x585e3c){_0x59f81b[_0x47ea('0x7')](_0x47ea('0x8'),_0x585e3c[_0x47ea('0x9')](function(_0x2cdacd){return{'id':_0x2cdacd['id']};}));return FaxMessage[_0x47ea('0xa')]({'where':{'FaxInteractionId':_0x59f81b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x47ea('0xb')](function(_0x2d2e35){_0x59f81b[_0x47ea('0x7')](_0x47ea('0xc'),_0x2d2e35['length']);FaxInteractionEvents[_0x47ea('0xd')](_0x277561+':'+_0x59f81b['id'],_0x59f81b);FaxInteractionEvents['emit'](_0x277561,_0x59f81b);_0x46df73(null);})['catch'](_0x46df73(null));};}for(var e in events){if(events[_0x47ea('0xe')](e)){var event=events[e];FaxInteraction[_0x47ea('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0x46cf=['setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x3932dc,_0x1be802){var _0x1149de=function(_0x35f5ce){while(--_0x35f5ce){_0x3932dc['push'](_0x3932dc['shift']());}};_0x1149de(++_0x1be802);}(_0x46cf,0xda));var _0xf46c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46cf[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xf46c('0x0'));var FaxInteraction=require(_0xf46c('0x1'))['db'][_0xf46c('0x2')];var FaxMessage=require(_0xf46c('0x1'))['db'][_0xf46c('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf46c('0x4')](0x0);var events={'afterCreate':_0xf46c('0x5'),'afterUpdate':_0xf46c('0x6'),'afterDestroy':_0xf46c('0x7')};function emitEvent(_0x53f07f){return function(_0x44535a,_0x2e919e,_0x2e873a){_0x44535a[_0xf46c('0x8')]({'attributes':['id'],'raw':!![]})[_0xf46c('0x9')](function(_0x3282e3){_0x44535a[_0xf46c('0xa')](_0xf46c('0xb'),_0x3282e3[_0xf46c('0xc')](function(_0x4fd916){return{'id':_0x4fd916['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x44535a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x48cd4b){_0x44535a[_0xf46c('0xa')](_0xf46c('0xd'),_0x48cd4b[_0xf46c('0xe')]);FaxInteractionEvents[_0xf46c('0xf')](_0x53f07f+':'+_0x44535a['id'],_0x44535a);FaxInteractionEvents['emit'](_0x53f07f,_0x44535a);_0x2e873a(null);})[_0xf46c('0x10')](_0x2e873a(null));};}for(var e in events){if(events[_0xf46c('0x11')](e)){var event=events[e];FaxInteraction[_0xf46c('0x12')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
index 0ac5de3..f852755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe742=['changed','closed','closedAt','../../config/logger','api','bluebird','path','./faxInteraction.attributes','exports','define','FaxInteraction'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0xe742,0x14d));var _0x2e74=function(_0x287107,_0x353356){_0x287107=_0x287107-0x0;var _0x55ef9e=_0xe742[_0x287107];return _0x55ef9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e74('0x0'))(_0x2e74('0x1'));var moment=require('moment');var BPromise=require(_0x2e74('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e74('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e74('0x4'));module[_0x2e74('0x5')]=function(_0x2ef1b3,_0x31236e){return _0x2ef1b3[_0x2e74('0x6')](_0x2e74('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d20ea,_0x5f31ed,_0x1d348d){if(_0x2d20ea[_0x2e74('0x8')](_0x2e74('0x9'))){_0x2d20ea[_0x2e74('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1d348d(null,_0x2d20ea);}}});};
\ No newline at end of file
+var _0xd16c=['exports','FaxInteraction','closed','format','lodash','../../config/logger','api','bluebird','request-promise','./faxInteraction.attributes'];(function(_0x579428,_0x43af4c){var _0x18be75=function(_0x578d6f){while(--_0x578d6f){_0x579428['push'](_0x579428['shift']());}};_0x18be75(++_0x43af4c);}(_0xd16c,0xd6));var _0xcd16=function(_0x460a9c,_0xf0b2ec){_0x460a9c=_0x460a9c-0x0;var _0x2e247a=_0xd16c[_0x460a9c];return _0x2e247a;};'use strict';var _=require(_0xcd16('0x0'));var util=require('util');var logger=require(_0xcd16('0x1'))(_0xcd16('0x2'));var moment=require('moment');var BPromise=require(_0xcd16('0x3'));var rp=require(_0xcd16('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd16('0x5'));module[_0xcd16('0x6')]=function(_0x5eb2ae,_0x5cd58a){return _0x5eb2ae['define'](_0xcd16('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b3134,_0x44c415,_0x5f0751){if(_0x4b3134['changed'](_0xcd16('0x8'))){_0x4b3134['closedAt']=moment()[_0xcd16('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5f0751(null,_0x4b3134);}}});};
\ No newline at end of file
index 00b6554..dc3b702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c2c=['../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','FaxInteraction','update','body','options','raw','where','limit','then','UpdateFaxInteraction','AddTagsToFaxInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x233aa1,_0x37af6d){var _0x4e670d=function(_0x2fca54){while(--_0x2fca54){_0x233aa1['push'](_0x233aa1['shift']());}};_0x4e670d(++_0x37af6d);}(_0x4c2c,0x1a7));var _0xc4c2=function(_0x190ceb,_0x2345b2){_0x190ceb=_0x190ceb-0x0;var _0x5ce806=_0x4c2c[_0x190ceb];return _0x5ce806;};'use strict';var _=require(_0xc4c2('0x0'));var util=require(_0xc4c2('0x1'));var moment=require(_0xc4c2('0x2'));var BPromise=require(_0xc4c2('0x3'));var rs=require(_0xc4c2('0x4'));var fs=require('fs');var Redis=require(_0xc4c2('0x5'));var db=require(_0xc4c2('0x6'))['db'];var utils=require(_0xc4c2('0x7'));var logger=require(_0xc4c2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc4c2('0x9'));var client=jayson[_0xc4c2('0xa')]['http']({'port':0x232a});config[_0xc4c2('0xb')]=_[_0xc4c2('0xc')](config['redis'],{'host':_0xc4c2('0xd'),'port':0x18eb});var socket=require(_0xc4c2('0xe'))(new Redis(config[_0xc4c2('0xb')]));require(_0xc4c2('0xf'))[_0xc4c2('0x10')](socket);function respondWithRpcPromise(_0x15dc7a,_0x18a1e7,_0x18815f){return new BPromise(function(_0x4b65fc,_0x21167e){return client[_0xc4c2('0x11')](_0x15dc7a,_0x18815f)['then'](function(_0x4a6f86){logger[_0xc4c2('0x12')](_0xc4c2('0x13'),_0x18a1e7,_0xc4c2('0x14'));logger[_0xc4c2('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x18a1e7,'request\x20sent',JSON[_0xc4c2('0x16')](_0x4a6f86));if(_0x4a6f86[_0xc4c2('0x17')]){if(_0x4a6f86['error'][_0xc4c2('0x18')]===0x1f4){logger[_0xc4c2('0x17')](_0xc4c2('0x13'),_0x18a1e7,_0x4a6f86['error']['message']);return _0x21167e(_0x4a6f86[_0xc4c2('0x17')]['message']);}logger[_0xc4c2('0x17')](_0xc4c2('0x13'),_0x18a1e7,_0x4a6f86[_0xc4c2('0x17')]['message']);return _0x4b65fc(_0x4a6f86[_0xc4c2('0x17')][_0xc4c2('0x19')]);}else{logger['info'](_0xc4c2('0x13'),_0x18a1e7,_0xc4c2('0x14'));_0x4b65fc(_0x4a6f86['result'][_0xc4c2('0x19')]);}})[_0xc4c2('0x1a')](function(_0x1f8be4){logger['error'](_0xc4c2('0x13'),_0x18a1e7,_0x1f8be4);_0x21167e(_0x1f8be4);});});}exports['UpdateFaxInteraction']=function(_0x551777){var _0x327908=this;return new Promise(function(_0x5bf0fd,_0xf34709){return db[_0xc4c2('0x1b')][_0xc4c2('0x1c')](_0x551777[_0xc4c2('0x1d')],{'raw':_0x551777[_0xc4c2('0x1e')]?_0x551777[_0xc4c2('0x1e')][_0xc4c2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551777[_0xc4c2('0x1e')]?_0x551777[_0xc4c2('0x1e')][_0xc4c2('0x20')]||null:null,'attributes':_0x551777[_0xc4c2('0x1e')]?_0x551777['options']['attributes']||null:null,'limit':_0x551777[_0xc4c2('0x1e')]?_0x551777[_0xc4c2('0x1e')][_0xc4c2('0x21')]||null:null})[_0xc4c2('0x22')](function(_0x5301da){logger[_0xc4c2('0x12')](_0xc4c2('0x23'),_0x551777);logger[_0xc4c2('0x15')](_0xc4c2('0x23'),_0x551777,JSON[_0xc4c2('0x16')](_0x5301da));_0x5bf0fd(_0x5301da);})[_0xc4c2('0x1a')](function(_0x165c67){logger[_0xc4c2('0x17')]('UpdateFaxInteraction',_0x165c67['message'],_0x551777);_0xf34709(_0x327908[_0xc4c2('0x17')](0x1f4,_0x165c67[_0xc4c2('0x19')]));});});};exports[_0xc4c2('0x24')]=function(_0x9b4082){return new Promise(function(_0x1e05e7,_0x1208d9){return db[_0xc4c2('0x1b')][_0xc4c2('0x25')]({'where':_0x9b4082[_0xc4c2('0x1e')]?_0x9b4082[_0xc4c2('0x1e')]['where']||null:null})[_0xc4c2('0x22')](function(_0x10d1a6){if(_0x10d1a6){return _0x10d1a6[_0xc4c2('0x26')](_0x9b4082[_0xc4c2('0x1d')]['ids'],_[_0xc4c2('0x27')](_0x9b4082[_0xc4c2('0x1d')],[_0xc4c2('0x28'),'id'])||{});}})[_0xc4c2('0x29')](function(_0x229694){logger['info']('AddTags',_0x9b4082);logger[_0xc4c2('0x15')](_0xc4c2('0x2a'),_0x9b4082,JSON['stringify'](_0x229694));_0x1e05e7(_0x229694);})[_0xc4c2('0x1a')](function(_0x44a592){logger[_0xc4c2('0x17')](_0xc4c2('0x2a'),_0x44a592[_0xc4c2('0x19')],_0x9b4082);_0x1208d9(_this[_0xc4c2('0x17')](0x1f4,_0x44a592['message']));});});};
\ No newline at end of file
+var _0xa34b=['error','code','message','result','catch','body','options','raw','where','limit','then','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ee2fa,_0x118e5a){var _0x718957=function(_0x57f4a8){while(--_0x57f4a8){_0x1ee2fa['push'](_0x1ee2fa['shift']());}};_0x718957(++_0x118e5a);}(_0xa34b,0xbc));var _0xba34=function(_0x2dfb25,_0x358b90){_0x2dfb25=_0x2dfb25-0x0;var _0x5947a6=_0xa34b[_0x2dfb25];return _0x5947a6;};'use strict';var _=require(_0xba34('0x0'));var util=require('util');var moment=require(_0xba34('0x1'));var BPromise=require('bluebird');var rs=require(_0xba34('0x2'));var fs=require('fs');var Redis=require(_0xba34('0x3'));var db=require(_0xba34('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba34('0x5'))(_0xba34('0x6'));var config=require(_0xba34('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba34('0x8')]['http']({'port':0x232a});config[_0xba34('0x9')]=_[_0xba34('0xa')](config[_0xba34('0x9')],{'host':_0xba34('0xb'),'port':0x18eb});var socket=require(_0xba34('0xc'))(new Redis(config[_0xba34('0x9')]));require(_0xba34('0xd'))[_0xba34('0xe')](socket);function respondWithRpcPromise(_0x74e5d9,_0x468094,_0x5a9dd5){return new BPromise(function(_0x192cfc,_0x1d72bc){return client[_0xba34('0xf')](_0x74e5d9,_0x5a9dd5)['then'](function(_0x26a463){logger[_0xba34('0x10')](_0xba34('0x11'),_0x468094,_0xba34('0x12'));logger[_0xba34('0x13')](_0xba34('0x14'),_0x468094,_0xba34('0x12'),JSON[_0xba34('0x15')](_0x26a463));if(_0x26a463[_0xba34('0x16')]){if(_0x26a463[_0xba34('0x16')][_0xba34('0x17')]===0x1f4){logger[_0xba34('0x16')](_0xba34('0x11'),_0x468094,_0x26a463[_0xba34('0x16')][_0xba34('0x18')]);return _0x1d72bc(_0x26a463[_0xba34('0x16')][_0xba34('0x18')]);}logger['error'](_0xba34('0x11'),_0x468094,_0x26a463[_0xba34('0x16')][_0xba34('0x18')]);return _0x192cfc(_0x26a463['error'][_0xba34('0x18')]);}else{logger[_0xba34('0x10')](_0xba34('0x11'),_0x468094,'request\x20sent');_0x192cfc(_0x26a463[_0xba34('0x19')]['message']);}})[_0xba34('0x1a')](function(_0x81f29e){logger[_0xba34('0x16')](_0xba34('0x11'),_0x468094,_0x81f29e);_0x1d72bc(_0x81f29e);});});}exports['UpdateFaxInteraction']=function(_0xf49b5c){var _0x446054=this;return new Promise(function(_0x130a75,_0x21e35c){return db['FaxInteraction']['update'](_0xf49b5c[_0xba34('0x1b')],{'raw':_0xf49b5c['options']?_0xf49b5c[_0xba34('0x1c')][_0xba34('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf49b5c[_0xba34('0x1c')]?_0xf49b5c[_0xba34('0x1c')][_0xba34('0x1e')]||null:null,'attributes':_0xf49b5c['options']?_0xf49b5c[_0xba34('0x1c')]['attributes']||null:null,'limit':_0xf49b5c[_0xba34('0x1c')]?_0xf49b5c['options'][_0xba34('0x1f')]||null:null})[_0xba34('0x20')](function(_0x3bc456){logger['info'](_0xba34('0x21'),_0xf49b5c);logger[_0xba34('0x13')]('UpdateFaxInteraction',_0xf49b5c,JSON[_0xba34('0x15')](_0x3bc456));_0x130a75(_0x3bc456);})[_0xba34('0x1a')](function(_0x14ec3f){logger[_0xba34('0x16')](_0xba34('0x21'),_0x14ec3f[_0xba34('0x18')],_0xf49b5c);_0x21e35c(_0x446054['error'](0x1f4,_0x14ec3f[_0xba34('0x18')]));});});};exports[_0xba34('0x22')]=function(_0x4fc048){return new Promise(function(_0x4384a6,_0x11e6ee){return db[_0xba34('0x23')][_0xba34('0x24')]({'where':_0x4fc048[_0xba34('0x1c')]?_0x4fc048[_0xba34('0x1c')][_0xba34('0x1e')]||null:null})['then'](function(_0x52737e){if(_0x52737e){return _0x52737e[_0xba34('0x25')](_0x4fc048[_0xba34('0x1b')][_0xba34('0x26')],_[_0xba34('0x27')](_0x4fc048['body'],['ids','id'])||{});}})[_0xba34('0x28')](function(_0x3b6eff){logger['info'](_0xba34('0x29'),_0x4fc048);logger[_0xba34('0x13')]('AddTags',_0x4fc048,JSON[_0xba34('0x15')](_0x3b6eff));_0x4384a6(_0x3b6eff);})['catch'](function(_0x2439d5){logger['error'](_0xba34('0x29'),_0x2439d5[_0xba34('0x18')],_0x4fc048);_0x11e6ee(_this[_0xba34('0x16')](0x1f4,_0x2439d5['message']));});});};
\ No newline at end of file
index 9254ccc..8c028c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1df1=['./faxInteraction.events','save','remove','update','removeListener','register','length'];(function(_0x1c6cf1,_0x2e7069){var _0x6fee02=function(_0x45f19c){while(--_0x45f19c){_0x1c6cf1['push'](_0x1c6cf1['shift']());}};_0x6fee02(++_0x2e7069);}(_0x1df1,0x103));var _0x11df=function(_0x5b25fd,_0x50a2b6){_0x5b25fd=_0x5b25fd-0x0;var _0x5ea37d=_0x1df1[_0x5b25fd];return _0x5ea37d;};'use strict';var FaxInteractionEvents=require(_0x11df('0x0'));var events=[_0x11df('0x1'),_0x11df('0x2'),_0x11df('0x3')];function createListener(_0x3d07c8,_0x540542){return function(_0xc09973){_0x540542['emit'](_0x3d07c8,_0xc09973);};}function removeListener(_0x2c3bd3,_0x3637b2){return function(){FaxInteractionEvents[_0x11df('0x4')](_0x2c3bd3,_0x3637b2);};}exports[_0x11df('0x5')]=function(_0x21dee2){for(var _0x7a97ab=0x0,_0x54b9bf=events[_0x11df('0x6')];_0x7a97ab<_0x54b9bf;_0x7a97ab++){var _0xa63a28=events[_0x7a97ab];var _0x5ec094=createListener('faxInteraction:'+_0xa63a28,_0x21dee2);FaxInteractionEvents['on'](_0xa63a28,_0x5ec094);}};
\ No newline at end of file
+var _0xe8a3=['register','faxInteraction:','./faxInteraction.events','save','remove','removeListener'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0xe8a3,0x110));var _0x3e8a=function(_0x3bbde7,_0x344127){_0x3bbde7=_0x3bbde7-0x0;var _0x117992=_0xe8a3[_0x3bbde7];return _0x117992;};'use strict';var FaxInteractionEvents=require(_0x3e8a('0x0'));var events=[_0x3e8a('0x1'),_0x3e8a('0x2'),'update'];function createListener(_0x6e80e1,_0x41c174){return function(_0x3c9be3){_0x41c174['emit'](_0x6e80e1,_0x3c9be3);};}function removeListener(_0x29741d,_0xd3ad61){return function(){FaxInteractionEvents[_0x3e8a('0x3')](_0x29741d,_0xd3ad61);};}exports[_0x3e8a('0x4')]=function(_0x24dd89){for(var _0x3c82b5=0x0,_0x8941d3=events['length'];_0x3c82b5<_0x8941d3;_0x3c82b5++){var _0x442586=events[_0x3c82b5];var _0x1a5326=createListener(_0x3e8a('0x5')+_0x442586,_0x24dd89);FaxInteractionEvents['on'](_0x442586,_0x1a5326);}};
\ No newline at end of file
index 39b942a..a20d639 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x567f=['tracked','fax','faxinteraction:update','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','isAuthenticated','describe','/:id','show','/:id/messages','post','/:id/tags','faxinteraction:addtags','addTags','put'];(function(_0x3ea14b,_0x30dbe1){var _0x3de45a=function(_0x494c90){while(--_0x494c90){_0x3ea14b['push'](_0x3ea14b['shift']());}};_0x3de45a(++_0x30dbe1);}(_0x567f,0x123));var _0xf567=function(_0x3c1b2d,_0x23b1b9){_0x3c1b2d=_0x3c1b2d-0x0;var _0x412475=_0x567f[_0x3c1b2d];return _0x412475;};'use strict';var multer=require(_0xf567('0x0'));var util=require(_0xf567('0x1'));var path=require(_0xf567('0x2'));var timeout=require('connect-timeout');var express=require(_0xf567('0x3'));var router=express[_0xf567('0x4')]();var fs_extra=require(_0xf567('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf567('0x6'));var config=require(_0xf567('0x7'));var controller=require(_0xf567('0x8'));router[_0xf567('0x9')]('/',auth['isAuthenticated'](),controller[_0xf567('0xa')]);router['get']('/describe',auth[_0xf567('0xb')](),controller[_0xf567('0xc')]);router[_0xf567('0x9')](_0xf567('0xd'),auth[_0xf567('0xb')](),controller[_0xf567('0xe')]);router[_0xf567('0x9')](_0xf567('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0xf567('0xb')](),controller['download']);router[_0xf567('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf567('0x10')](_0xf567('0xf'),auth[_0xf567('0xb')](),controller['addMessage']);router['post'](_0xf567('0x11'),auth[_0xf567('0xb')](),interaction['tracked']('fax',_0xf567('0x12')),controller[_0xf567('0x13')]);router[_0xf567('0x14')]('/:id',auth[_0xf567('0xb')](),interaction[_0xf567('0x15')](_0xf567('0x16'),_0xf567('0x17')),controller[_0xf567('0x18')]);router[_0xf567('0x19')](_0xf567('0xd'),auth['isAuthenticated'](),interaction[_0xf567('0x15')](_0xf567('0x16'),'faxinteraction:destroy'),controller['destroy']);router[_0xf567('0x19')](_0xf567('0x11'),auth[_0xf567('0xb')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x680e=['get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','tracked','fax','faxinteraction:update','update','destroy','delete','removeTags','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller'];(function(_0x5546fb,_0x574452){var _0x26a624=function(_0x303d86){while(--_0x303d86){_0x5546fb['push'](_0x5546fb['shift']());}};_0x26a624(++_0x574452);}(_0x680e,0x170));var _0xe680=function(_0x393d5b,_0x38ebb8){_0x393d5b=_0x393d5b-0x0;var _0x37fb8b=_0x680e[_0x393d5b];return _0x37fb8b;};'use strict';var multer=require(_0xe680('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe680('0x1'));var express=require(_0xe680('0x2'));var router=express[_0xe680('0x3')]();var fs_extra=require(_0xe680('0x4'));var auth=require(_0xe680('0x5'));var interaction=require(_0xe680('0x6'));var config=require(_0xe680('0x7'));var controller=require(_0xe680('0x8'));router[_0xe680('0x9')]('/',auth[_0xe680('0xa')](),controller[_0xe680('0xb')]);router[_0xe680('0x9')](_0xe680('0xc'),auth[_0xe680('0xa')](),controller[_0xe680('0xd')]);router[_0xe680('0x9')](_0xe680('0xe'),auth[_0xe680('0xa')](),controller['show']);router[_0xe680('0x9')](_0xe680('0xf'),auth['isAuthenticated'](),controller[_0xe680('0x10')]);router[_0xe680('0x9')](_0xe680('0x11'),auth[_0xe680('0xa')](),controller['download']);router[_0xe680('0x12')]('/',auth[_0xe680('0xa')](),controller[_0xe680('0x13')]);router[_0xe680('0x12')]('/:id/messages',auth[_0xe680('0xa')](),controller['addMessage']);router['post'](_0xe680('0x14'),auth['isAuthenticated'](),interaction[_0xe680('0x15')]('fax','faxinteraction:addtags'),controller['addTags']);router['put']('/:id',auth[_0xe680('0xa')](),interaction[_0xe680('0x15')](_0xe680('0x16'),_0xe680('0x17')),controller[_0xe680('0x18')]);router['delete'](_0xe680('0xe'),auth[_0xe680('0xa')](),interaction[_0xe680('0x15')](_0xe680('0x16'),'faxinteraction:destroy'),controller[_0xe680('0x19')]);router[_0xe680('0x1a')](_0xe680('0x14'),auth['isAuthenticated'](),controller[_0xe680('0x1b')]);module[_0xe680('0x1c')]=router;
\ No newline at end of file
index 146851c..2d70a56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffe1=['TEXT','DATE','sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xffe1,0x175));var _0x1ffe=function(_0x22e88b,_0x50b17f){_0x22e88b=_0x22e88b-0x0;var _0x472bb7=_0xffe1[_0x22e88b];return _0x472bb7;};'use strict';var Sequelize=require(_0x1ffe('0x0'));module[_0x1ffe('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1ffe('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1ffe('0x3')]('in',_0x1ffe('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x1ffe('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1ffe('0x6')]}};
\ No newline at end of file
+var _0x9224=['out','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4b4479,_0x412664){var _0x2f90b0=function(_0x416d19){while(--_0x416d19){_0x4b4479['push'](_0x4b4479['shift']());}};_0x2f90b0(++_0x412664);}(_0x9224,0xa3));var _0x4922=function(_0x3350fb,_0x5cded5){_0x3350fb=_0x3350fb-0x0;var _0x4f399b=_0x9224[_0x3350fb];return _0x4f399b;};'use strict';var Sequelize=require('sequelize');module[_0x4922('0x0')]={'body':{'type':Sequelize[_0x4922('0x1')](_0x4922('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4922('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4922('0x4')]('in',_0x4922('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index a89293a..c21ce87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3214=['stringify','error','message','result','catch','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','FaxMessage','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','body','describe','fax-interactions','accept','fax','read','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','email','manual','interface','SIP/%s','channel','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','format','motionChannel','event','rejectmessage','create','CmContact','findOne','Attachment','SendFax','FaxAccountId','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','client','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3214,0xef));var _0x4321=function(_0x129d04,_0x5c0644){_0x129d04=_0x129d04-0x0;var _0x3cb2ff=_0x3214[_0x129d04];return _0x3cb2ff;};'use strict';var emlformat=require(_0x4321('0x0'));var rimraf=require(_0x4321('0x1'));var zipdir=require(_0x4321('0x2'));var jsonpatch=require(_0x4321('0x3'));var rp=require(_0x4321('0x4'));var moment=require('moment');var BPromise=require(_0x4321('0x5'));var Mustache=require(_0x4321('0x6'));var util=require(_0x4321('0x7'));var path=require(_0x4321('0x8'));var sox=require('sox');var csv=require(_0x4321('0x9'));var ejs=require(_0x4321('0xa'));var fs=require('fs');var fs_extra=require(_0x4321('0xb'));var _=require(_0x4321('0xc'));var squel=require('squel');var crypto=require(_0x4321('0xd'));var jsforce=require(_0x4321('0xe'));var deskjs=require(_0x4321('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4321('0x10'));var authService=require(_0x4321('0x11'));var qs=require(_0x4321('0x12'));var as=require(_0x4321('0x13'));var hardwareService=require(_0x4321('0x14'));var logger=require(_0x4321('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4321('0x16'));var licenseUtil=require(_0x4321('0x17'));var db=require('../../mysqldb')['db'];config[_0x4321('0x18')]=_[_0x4321('0x19')](config[_0x4321('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x4321('0x1a'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x4321('0x1b')](socket);var jayson=require(_0x4321('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4321('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e92be,_0x208a1e,_0x329655,_0x3ce2f3){return new BPromise(function(_0x16bdd6,_0x5aeb51){var _0x1476ff=_0x3ce2f3||client;return _0x1476ff[_0x4321('0x1e')](_0x5e92be,_0x329655)['then'](function(_0x2a72f5){logger[_0x4321('0x1f')](_0x4321('0x20'),_0x208a1e,_0x4321('0x21'));logger[_0x4321('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x208a1e,_0x4321('0x21'),JSON[_0x4321('0x23')](_0x2a72f5));if(_0x2a72f5[_0x4321('0x24')]){if(_0x2a72f5['error']['code']===0x1f4){logger[_0x4321('0x24')](_0x4321('0x20'),_0x208a1e,_0x2a72f5['error'][_0x4321('0x25')]);return _0x5aeb51(_0x2a72f5['error'][_0x4321('0x25')]);}logger[_0x4321('0x24')](_0x4321('0x20'),_0x208a1e,_0x2a72f5[_0x4321('0x24')][_0x4321('0x25')]);return _0x16bdd6(_0x2a72f5['error'][_0x4321('0x25')]);}else{logger[_0x4321('0x1f')](_0x4321('0x20'),_0x208a1e,_0x4321('0x21'));_0x16bdd6(_0x2a72f5[_0x4321('0x26')][_0x4321('0x25')]);}})[_0x4321('0x27')](function(_0x3fae7b){logger['error'](_0x4321('0x20'),_0x208a1e,_0x3fae7b);_0x5aeb51(_0x3fae7b);});});}function respondWithStatusCode(_0x55e400,_0x3e9a87){_0x3e9a87=_0x3e9a87||0xcc;return function(_0x10dbae){if(_0x10dbae){return _0x55e400[_0x4321('0x28')](_0x3e9a87);}return _0x55e400[_0x4321('0x29')](_0x3e9a87)['end']();};}function respondWithResult(_0x475770,_0x24b1e6){_0x24b1e6=_0x24b1e6||0xc8;return function(_0x3351b8){if(_0x3351b8){return _0x475770[_0x4321('0x29')](_0x24b1e6)['json'](_0x3351b8);}};}function respondWithFilteredResult(_0x57b8c6,_0x40c37e){return function(_0x1c2137){if(_0x1c2137){var _0x583cbb=typeof _0x40c37e[_0x4321('0x2a')]==='undefined'&&typeof _0x40c37e[_0x4321('0x2b')]==='undefined';var _0x43b82b=_0x1c2137[_0x4321('0x2c')];var _0x3fe3db=_0x583cbb?0x0:_0x40c37e[_0x4321('0x2a')];var _0x55f30a=_0x583cbb?_0x1c2137[_0x4321('0x2c')]:_0x40c37e[_0x4321('0x2a')]+_0x40c37e[_0x4321('0x2b')];var _0x8d8638;if(_0x55f30a>=_0x43b82b){_0x55f30a=_0x43b82b;_0x8d8638=0xc8;}else{_0x8d8638=0xce;}_0x57b8c6[_0x4321('0x29')](_0x8d8638);return _0x57b8c6[_0x4321('0x2d')](_0x4321('0x2e'),_0x3fe3db+'-'+_0x55f30a+'/'+_0x43b82b)[_0x4321('0x2f')](_0x1c2137);}return null;};}function patchUpdates(_0x4ffcc3){return function(_0x301d1c){try{jsonpatch['apply'](_0x301d1c,_0x4ffcc3,!![]);}catch(_0x1efccb){return BPromise[_0x4321('0x30')](_0x1efccb);}return _0x301d1c[_0x4321('0x31')]();};}function saveUpdates(_0x2b9195,_0x17d9cf){return function(_0x32b3d0){if(_0x32b3d0){return _0x32b3d0[_0x4321('0x32')](_0x2b9195)[_0x4321('0x33')](function(_0x296cd4){return _0x296cd4;});}return null;};}function removeEntity(_0x5eb0b6,_0x5ab1ef){return function(_0x724bd9){if(_0x724bd9){return _0x724bd9[_0x4321('0x34')]()['then'](function(){_0x5eb0b6[_0x4321('0x29')](0xcc)[_0x4321('0x35')]();});}};}function handleEntityNotFound(_0x3d5d78,_0x5971b4){return function(_0x4ac56b){if(!_0x4ac56b){_0x3d5d78[_0x4321('0x28')](0x194);}return _0x4ac56b;};}function handleError(_0x23dd49,_0x5bf258){_0x5bf258=_0x5bf258||0x1f4;return function(_0x1331bf){logger[_0x4321('0x24')](_0x1331bf['stack']);if(_0x1331bf[_0x4321('0x36')]){delete _0x1331bf['name'];}_0x23dd49[_0x4321('0x29')](_0x5bf258)[_0x4321('0x37')](_0x1331bf);};}exports[_0x4321('0x38')]=function(_0x5487c5,_0x338c0b){var _0x24b86c={},_0x185a55={},_0x1970c5={'count':0x0,'rows':[]};var _0x3893f7=_[_0x4321('0x39')](db[_0x4321('0x3a')]['rawAttributes'],function(_0x50f8ed){return{'name':_0x50f8ed[_0x4321('0x3b')],'type':_0x50f8ed['type'][_0x4321('0x3c')]};});_0x185a55[_0x4321('0x3d')]=_[_0x4321('0x39')](_0x3893f7,_0x4321('0x36'));_0x185a55[_0x4321('0x3e')]=_[_0x4321('0x3f')](_0x5487c5[_0x4321('0x3e')]);_0x185a55[_0x4321('0x40')]=_[_0x4321('0x41')](_0x185a55[_0x4321('0x3d')],_0x185a55[_0x4321('0x3e')]);_0x24b86c['attributes']=_[_0x4321('0x41')](_0x185a55[_0x4321('0x3d')],qs['fields'](_0x5487c5[_0x4321('0x3e')][_0x4321('0x42')]));_0x24b86c['attributes']=_0x24b86c[_0x4321('0x43')][_0x4321('0x44')]?_0x24b86c[_0x4321('0x43')]:_0x185a55['model'];if(!_0x5487c5[_0x4321('0x3e')][_0x4321('0x45')](_0x4321('0x46'))){_0x24b86c[_0x4321('0x2b')]=qs[_0x4321('0x2b')](_0x5487c5['query'][_0x4321('0x2b')]);_0x24b86c[_0x4321('0x2a')]=qs[_0x4321('0x2a')](_0x5487c5[_0x4321('0x3e')]['offset']);}_0x24b86c['order']=qs[_0x4321('0x47')](_0x5487c5[_0x4321('0x3e')][_0x4321('0x47')]);_0x24b86c[_0x4321('0x48')]=qs[_0x4321('0x40')](_[_0x4321('0x49')](_0x5487c5[_0x4321('0x3e')],_0x185a55[_0x4321('0x40')]),_0x3893f7);if(_0x5487c5[_0x4321('0x3e')][_0x4321('0x4a')]){_0x24b86c[_0x4321('0x48')]=_[_0x4321('0x4b')](_0x24b86c['where'],{'$or':_['map'](_0x3893f7,function(_0x376a64){if(_0x376a64[_0x4321('0x4c')]!==_0x4321('0x4d')){var _0x4b6de4={};_0x4b6de4[_0x376a64[_0x4321('0x36')]]={'$like':'%'+_0x5487c5[_0x4321('0x3e')][_0x4321('0x4a')]+'%'};return _0x4b6de4;}})});}_0x24b86c=_['merge']({},_0x24b86c,_0x5487c5[_0x4321('0x4e')]);var _0xd61184={'where':_0x24b86c[_0x4321('0x48')]};return db['FaxMessage']['count'](_0xd61184)[_0x4321('0x33')](function(_0x35ca63){_0x1970c5[_0x4321('0x2c')]=_0x35ca63;if(_0x5487c5['query'][_0x4321('0x4f')]){_0x24b86c[_0x4321('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x4321('0x51')](_0x24b86c);})['then'](function(_0x156994){_0x1970c5['rows']=_0x156994;return _0x1970c5;})['then'](respondWithFilteredResult(_0x338c0b,_0x24b86c))[_0x4321('0x27')](handleError(_0x338c0b,null));};exports[_0x4321('0x52')]=function(_0x2a7baf,_0x32146b){var _0x12985e={'raw':!![],'where':{'id':_0x2a7baf[_0x4321('0x53')]['id']}},_0x414f56={};_0x414f56[_0x4321('0x3d')]=_['keys'](db['FaxMessage'][_0x4321('0x54')]);_0x414f56[_0x4321('0x3e')]=_[_0x4321('0x3f')](_0x2a7baf[_0x4321('0x3e')]);_0x414f56[_0x4321('0x40')]=_[_0x4321('0x41')](_0x414f56['model'],_0x414f56['query']);_0x12985e[_0x4321('0x43')]=_[_0x4321('0x41')](_0x414f56[_0x4321('0x3d')],qs[_0x4321('0x42')](_0x2a7baf['query'][_0x4321('0x42')]));_0x12985e[_0x4321('0x43')]=_0x12985e['attributes'][_0x4321('0x44')]?_0x12985e[_0x4321('0x43')]:_0x414f56[_0x4321('0x3d')];if(_0x2a7baf[_0x4321('0x3e')]['includeAll']){_0x12985e[_0x4321('0x50')]=[{'all':!![]}];}_0x12985e=_[_0x4321('0x4b')]({},_0x12985e,_0x2a7baf[_0x4321('0x4e')]);return db[_0x4321('0x3a')][_0x4321('0x55')](_0x12985e)[_0x4321('0x33')](handleEntityNotFound(_0x32146b,null))['then'](respondWithResult(_0x32146b,null))[_0x4321('0x27')](handleError(_0x32146b,null));};exports[_0x4321('0x32')]=function(_0x5468dd,_0x1fc499){if(_0x5468dd[_0x4321('0x56')]['id']){delete _0x5468dd[_0x4321('0x56')]['id'];}return db[_0x4321('0x3a')][_0x4321('0x55')]({'where':{'id':_0x5468dd[_0x4321('0x53')]['id']}})[_0x4321('0x33')](handleEntityNotFound(_0x1fc499,null))['then'](saveUpdates(_0x5468dd['body'],null))['then'](respondWithResult(_0x1fc499,null))[_0x4321('0x27')](handleError(_0x1fc499,null));};exports['destroy']=function(_0x34df1c,_0x231132){return db['FaxMessage'][_0x4321('0x55')]({'where':{'id':_0x34df1c[_0x4321('0x53')]['id']}})['then'](handleEntityNotFound(_0x231132,null))['then'](removeEntity(_0x231132,null))[_0x4321('0x27')](handleError(_0x231132,null));};exports[_0x4321('0x57')]=function(_0x138e35,_0x50ceeb){return db[_0x4321('0x3a')][_0x4321('0x57')]()['then'](respondWithResult(_0x50ceeb,null))[_0x4321('0x27')](handleError(_0x50ceeb,null));};var interaction_log=require(_0x4321('0x15'))(_0x4321('0x58'));exports[_0x4321('0x59')]=function(_0x161792,_0x10945d,_0x3ec0e2){var _0x138acf={'agent':{},'channel':_0x4321('0x5a')};if(_0x161792[_0x4321('0x56')]['id']){delete _0x161792['body']['id'];}_0x161792[_0x4321('0x56')][_0x4321('0x5b')]=!![];_0x161792[_0x4321('0x56')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x161792['body'][_0x4321('0x5c')]=_0x161792[_0x4321('0x56')][_0x4321('0x5c')]||_0x161792[_0x4321('0x5d')]['id'];_0x138acf[_0x4321('0x5e')]['id']=_0x161792[_0x4321('0x56')]['UserId'];return db[_0x4321('0x3a')][_0x4321('0x55')]({'where':{'id':_0x161792[_0x4321('0x53')]['id'],'UserId':null}})[_0x4321('0x33')](handleEntityNotFound(_0x10945d,null))['then'](saveUpdates(_0x161792['body'],null))['then'](function(_0x1684df){if(_0x1684df){_0x138acf[_0x4321('0x25')]=_0x1684df[_0x4321('0x5f')]({'plain':!![]});return db[_0x4321('0x60')][_0x4321('0x55')]({'where':{'id':_0x1684df[_0x4321('0x61')]}});}return null;})[_0x4321('0x33')](handleEntityNotFound(_0x10945d,null))['then'](function(_0x149a4f){if(_0x149a4f){return _0x149a4f[_0x4321('0x32')]({'UserId':_0x161792[_0x4321('0x56')][_0x4321('0x5c')],'read1stAt':_[_0x4321('0x62')](_0x149a4f['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4321('0x33')](function(_0x286495){if(_0x286495){_0x138acf[_0x4321('0x63')]=_0x286495[_0x4321('0x5f')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x161792['user']['id'],_0x161792[_0x4321('0x5d')][_0x4321('0x36')],_0x161792[_0x4321('0x5d')][_0x4321('0x64')],_0x138acf['interaction']['id'],_0x161792['body']?JSON['stringify'](_0x161792['body']):_0x4321('0x65'));return respondWithRpcPromise(_0x4321('0x66'),_0x4321('0x67'),_0x138acf);}return null;})['then'](function(_0x7f4005){var _0x18fd1a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x7f4005[_0x4321('0x25')][_0x4321('0x68')];return db[_0x4321('0x69')]['query'](_0x18fd1a,{'type':db[_0x4321('0x6a')]['QueryTypes'][_0x4321('0x6b')],'raw':!![]})['then'](function(_0x16cadb){return _0x16cadb;});})[_0x4321('0x33')](function(_0x30ff6a){if(_0x30ff6a){_0x138acf[_0x4321('0x25')][_0x4321('0x6c')]=_0x30ff6a[0x0];if(!_0x161792[_0x4321('0x56')][_0x4321('0x5c')])return;return db[_0x4321('0x6d')][_0x4321('0x55')]({'where':{'id':_0x161792[_0x4321('0x56')][_0x4321('0x5c')],'role':_0x4321('0x5e')},'attributes':['id',_0x4321('0x36'),'fullname',_0x4321('0x6e'),'internal'],'raw':!![]});}return null;})[_0x4321('0x33')](function(_0x2aa171){if(!_0x2aa171)return null;_0x138acf[_0x4321('0x25')][_0x4321('0x5e')]=_0x2aa171;return _0x138acf;})[_0x4321('0x33')](function(_0x46c5d4){if(_0x46c5d4){if(_0x161792[_0x4321('0x56')][_0x4321('0x6f')]){_0x138acf['message'][_0x4321('0x70')]=util['format'](_0x4321('0x71'),_0x161792[_0x4321('0x5d')]['name']);_0x138acf[_0x4321('0x25')]['channel']=_0x138acf[_0x4321('0x72')];_0x138acf[_0x4321('0x25')]['motionChannel']=_0x138acf['channel'];_0x138acf[_0x4321('0x25')]['event']='accept';return respondWithRpcPromise(_0x4321('0x73'),_0x4321('0x73'),{'event':'acceptmessage','message':_0x138acf[_0x4321('0x25')]},client9002)[_0x4321('0x33')](function(){return _0x138acf;});}return _0x138acf;}return null;})[_0x4321('0x33')](respondWithResult(_0x10945d,null))[_0x4321('0x27')](handleError(_0x10945d,null));};var interaction_log=require(_0x4321('0x15'))(_0x4321('0x58'));exports[_0x4321('0x30')]=function(_0x50ec9d,_0x433f3a,_0x522715){var _0x3cda5a={'agent':{},'channel':_0x4321('0x5a')};if(_0x50ec9d[_0x4321('0x56')]['id']){delete _0x50ec9d[_0x4321('0x56')]['id'];}_0x50ec9d[_0x4321('0x56')][_0x4321('0x5c')]=_0x50ec9d[_0x4321('0x56')][_0x4321('0x5c')]||_0x50ec9d[_0x4321('0x5d')]['id'];_0x3cda5a[_0x4321('0x5e')]['id']=_0x50ec9d[_0x4321('0x56')][_0x4321('0x5c')];return db[_0x4321('0x3a')]['find']({'where':{'id':_0x50ec9d[_0x4321('0x53')]['id'],'UserId':null}})[_0x4321('0x33')](handleEntityNotFound(_0x433f3a,null))[_0x4321('0x33')](function(_0x34f378){if(_0x34f378){_0x3cda5a[_0x4321('0x25')]=_0x34f378['get']({'plain':!![]});return db[_0x4321('0x60')][_0x4321('0x55')]({'where':{'id':_0x34f378[_0x4321('0x61')]}});}return null;})[_0x4321('0x33')](handleEntityNotFound(_0x433f3a,null))[_0x4321('0x33')](function(_0x4ef12c){if(_0x4ef12c){_0x3cda5a[_0x4321('0x63')]=_0x4ef12c[_0x4321('0x5f')]({'plain':!![]});interaction_log[_0x4321('0x1f')](_0x4321('0x74'),_0x50ec9d['user']['id'],_0x50ec9d[_0x4321('0x5d')][_0x4321('0x36')],_0x50ec9d[_0x4321('0x5d')]['role'],_0x3cda5a['interaction']['id'],_0x50ec9d[_0x4321('0x56')]?JSON['stringify'](_0x50ec9d['body']):'null');return respondWithRpcPromise(_0x4321('0x75'),_0x4321('0x76'),_0x3cda5a);}return null;})['then'](function(_0x99087e){var _0x20a390='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x99087e[_0x4321('0x25')][_0x4321('0x68')];return db['sequelize'][_0x4321('0x3e')](_0x20a390,{'type':db['Sequelize']['QueryTypes'][_0x4321('0x6b')],'raw':!![]})['then'](function(_0x4f4b6a){return _0x4f4b6a;});})[_0x4321('0x33')](function(_0x489f83){if(_0x489f83){_0x3cda5a[_0x4321('0x25')][_0x4321('0x6c')]=_0x489f83[0x0];if(!_0x50ec9d['body'][_0x4321('0x5c')])return;return db[_0x4321('0x6d')][_0x4321('0x55')]({'where':{'id':_0x50ec9d[_0x4321('0x56')][_0x4321('0x5c')],'role':'agent'},'attributes':['id',_0x4321('0x36'),_0x4321('0x77'),_0x4321('0x6e'),'internal'],'raw':!![]});}return null;})[_0x4321('0x33')](function(_0x3ff463){if(!_0x3ff463)return null;_0x3cda5a[_0x4321('0x25')][_0x4321('0x5e')]=_0x3ff463;return _0x3cda5a;})['then'](function(_0x553890){if(_0x553890){_0x553890[_0x4321('0x25')][_0x4321('0x70')]=util[_0x4321('0x78')](_0x4321('0x71'),_0x50ec9d[_0x4321('0x5d')][_0x4321('0x36')]);_0x553890[_0x4321('0x25')][_0x4321('0x72')]=_0x3cda5a[_0x4321('0x72')];_0x553890[_0x4321('0x25')][_0x4321('0x79')]=_0x3cda5a[_0x4321('0x72')];_0x553890['message'][_0x4321('0x7a')]='reject';respondWithRpcPromise(_0x4321('0x73'),_0x4321('0x73'),{'event':_0x4321('0x7b'),'message':_0x553890[_0x4321('0x25')]},client9002);return _0x3cda5a;}return null;})[_0x4321('0x33')](respondWithResult(_0x433f3a,null))['catch'](handleError(_0x433f3a,null));};exports[_0x4321('0x7c')]=function(_0x16955e,_0x56ed29){var _0x53079c;return db[_0x4321('0x3a')][_0x4321('0x7c')](_0x16955e[_0x4321('0x56')],{})['then'](function(_0x49cda7){_0x53079c=_0x49cda7;return db[_0x4321('0x7d')][_0x4321('0x7e')]({'where':{'id':_0x53079c['ContactId']}});})[_0x4321('0x33')](function(_0x1d42af){if(_['isNil'](_0x1d42af)){return;}else{_0x53079c['fax']=_0x1d42af['fax'];return db[_0x4321('0x7f')][_0x4321('0x7e')]({'where':{'id':_0x53079c['AttachmentId']}});}})[_0x4321('0x33')](function(_0x254948){return respondWithRpcPromise(_0x4321('0x80'),'SendFax',{'FaxAccountId':_[_0x4321('0x62')](_0x16955e['body'])?undefined:_0x16955e['body'][_0x4321('0x81')],'path':_[_0x4321('0x62')](_0x254948)?undefined:util[_0x4321('0x78')]('/var/opt/motion2/server/files/attachments/%s',_0x254948[_0x4321('0x82')]),'fax':_['isNil'](_0x53079c[_0x4321('0x5a')])?undefined:_0x53079c[_0x4321('0x5a')],'AttachmentId':_0x53079c['AttachmentId']},client9002);})[_0x4321('0x33')](respondWithResult(_0x56ed29,0xc9))[_0x4321('0x27')](handleError(_0x56ed29,null));};exports[_0x4321('0x83')]=function(_0x5d4498,_0x38bbcd){var _0x131e4c=path[_0x4321('0x84')](config[_0x4321('0x85')],_0x4321('0x86'),_0x4321('0x87'),_0x4321('0x88'));return db[_0x4321('0x3a')][_0x4321('0x55')]({'where':{'id':_0x5d4498['params']['id']},'include':[{'model':db[_0x4321('0x7f')],'as':_0x4321('0x7f')}]})[_0x4321('0x33')](handleEntityNotFound(_0x38bbcd,null))[_0x4321('0x33')](function(_0x9c8f6a){if(_0x9c8f6a){return _0x38bbcd[_0x4321('0x83')](path['join'](_0x131e4c,_0x9c8f6a[_0x4321('0x7f')][_0x4321('0x82')]));}})[_0x4321('0x27')](handleError(_0x38bbcd,null));};
\ No newline at end of file
+var _0x1821=['fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','rejectmessage','create','CmContact','findOne','isNil','Attachment','SendFax','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','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/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','body','find','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','message','FaxInteraction','FaxInteractionId','format','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User'];(function(_0x429cfc,_0x38de1a){var _0xfa4273=function(_0x29ab73){while(--_0x29ab73){_0x429cfc['push'](_0x429cfc['shift']());}};_0xfa4273(++_0x38de1a);}(_0x1821,0xb0));var _0x1182=function(_0x8179a3,_0x27e1d2){_0x8179a3=_0x8179a3-0x0;var _0x14ed5a=_0x1821[_0x8179a3];return _0x14ed5a;};'use strict';var emlformat=require(_0x1182('0x0'));var rimraf=require(_0x1182('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1182('0x2'));var Mustache=require(_0x1182('0x3'));var util=require(_0x1182('0x4'));var path=require(_0x1182('0x5'));var sox=require(_0x1182('0x6'));var csv=require(_0x1182('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1182('0x8'));var _=require(_0x1182('0x9'));var squel=require(_0x1182('0xa'));var crypto=require(_0x1182('0xb'));var jsforce=require(_0x1182('0xc'));var deskjs=require(_0x1182('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1182('0xe'));var Redis=require(_0x1182('0xf'));var authService=require(_0x1182('0x10'));var qs=require(_0x1182('0x11'));var as=require(_0x1182('0x12'));var hardwareService=require(_0x1182('0x13'));var logger=require('../../config/logger')(_0x1182('0x14'));var utils=require(_0x1182('0x15'));var config=require(_0x1182('0x16'));var licenseUtil=require(_0x1182('0x17'));var db=require(_0x1182('0x18'))['db'];config['redis']=_['defaults'](config[_0x1182('0x19')],{'host':_0x1182('0x1a'),'port':0x18eb});var socket=require(_0x1182('0x1b'))(new Redis(config[_0x1182('0x19')]));require(_0x1182('0x1c'))[_0x1182('0x1d')](socket);var jayson=require(_0x1182('0x1e'));var client=jayson[_0x1182('0x1f')][_0x1182('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x1182('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4a8e1f,_0x36e86a,_0x1dc907,_0x4affcf){return new BPromise(function(_0xb5f526,_0xba2377){var _0x7e2980=_0x4affcf||client;return _0x7e2980[_0x1182('0x21')](_0x4a8e1f,_0x1dc907)[_0x1182('0x22')](function(_0x1e238a){logger[_0x1182('0x23')]('FaxMessage,\x20%s,\x20%s',_0x36e86a,_0x1182('0x24'));logger[_0x1182('0x25')](_0x1182('0x26'),_0x36e86a,_0x1182('0x24'),JSON[_0x1182('0x27')](_0x1e238a));if(_0x1e238a['error']){if(_0x1e238a[_0x1182('0x28')][_0x1182('0x29')]===0x1f4){logger[_0x1182('0x28')]('FaxMessage,\x20%s,\x20%s',_0x36e86a,_0x1e238a[_0x1182('0x28')]['message']);return _0xba2377(_0x1e238a['error']['message']);}logger[_0x1182('0x28')](_0x1182('0x2a'),_0x36e86a,_0x1e238a['error']['message']);return _0xb5f526(_0x1e238a[_0x1182('0x28')]['message']);}else{logger[_0x1182('0x23')]('FaxMessage,\x20%s,\x20%s',_0x36e86a,'request\x20sent');_0xb5f526(_0x1e238a[_0x1182('0x2b')]['message']);}})[_0x1182('0x2c')](function(_0x640cb8){logger[_0x1182('0x28')](_0x1182('0x2a'),_0x36e86a,_0x640cb8);_0xba2377(_0x640cb8);});});}function respondWithStatusCode(_0x3f7cda,_0x47d8c2){_0x47d8c2=_0x47d8c2||0xcc;return function(_0x35afb1){if(_0x35afb1){return _0x3f7cda[_0x1182('0x2d')](_0x47d8c2);}return _0x3f7cda[_0x1182('0x2e')](_0x47d8c2)[_0x1182('0x2f')]();};}function respondWithResult(_0x4f9bc5,_0x1d46ca){_0x1d46ca=_0x1d46ca||0xc8;return function(_0x2c2cbf){if(_0x2c2cbf){return _0x4f9bc5['status'](_0x1d46ca)['json'](_0x2c2cbf);}};}function respondWithFilteredResult(_0x1d0a22,_0x3cfd9b){return function(_0x2f5376){if(_0x2f5376){var _0x2ffe13=typeof _0x3cfd9b[_0x1182('0x30')]==='undefined'&&typeof _0x3cfd9b[_0x1182('0x31')]===_0x1182('0x32');var _0x5534af=_0x2f5376[_0x1182('0x33')];var _0x4b6ca3=_0x2ffe13?0x0:_0x3cfd9b[_0x1182('0x30')];var _0x18c5a0=_0x2ffe13?_0x2f5376['count']:_0x3cfd9b[_0x1182('0x30')]+_0x3cfd9b[_0x1182('0x31')];var _0x3a5a4f;if(_0x18c5a0>=_0x5534af){_0x18c5a0=_0x5534af;_0x3a5a4f=0xc8;}else{_0x3a5a4f=0xce;}_0x1d0a22[_0x1182('0x2e')](_0x3a5a4f);return _0x1d0a22[_0x1182('0x34')]('Content-Range',_0x4b6ca3+'-'+_0x18c5a0+'/'+_0x5534af)['json'](_0x2f5376);}return null;};}function patchUpdates(_0x2fb254){return function(_0x263e65){try{jsonpatch[_0x1182('0x35')](_0x263e65,_0x2fb254,!![]);}catch(_0x56000a){return BPromise[_0x1182('0x36')](_0x56000a);}return _0x263e65[_0x1182('0x37')]();};}function saveUpdates(_0x4b3219,_0x584f61){return function(_0x26a083){if(_0x26a083){return _0x26a083[_0x1182('0x38')](_0x4b3219)[_0x1182('0x22')](function(_0x2081ba){return _0x2081ba;});}return null;};}function removeEntity(_0x24f58e,_0x4bc49f){return function(_0xa44db0){if(_0xa44db0){return _0xa44db0[_0x1182('0x39')]()['then'](function(){_0x24f58e[_0x1182('0x2e')](0xcc)[_0x1182('0x2f')]();});}};}function handleEntityNotFound(_0x1b3230,_0x415c58){return function(_0x4c64db){if(!_0x4c64db){_0x1b3230['sendStatus'](0x194);}return _0x4c64db;};}function handleError(_0x2ec9c2,_0x2c779d){_0x2c779d=_0x2c779d||0x1f4;return function(_0x5f292c){logger[_0x1182('0x28')](_0x5f292c[_0x1182('0x3a')]);if(_0x5f292c['name']){delete _0x5f292c[_0x1182('0x3b')];}_0x2ec9c2[_0x1182('0x2e')](_0x2c779d)[_0x1182('0x3c')](_0x5f292c);};}exports[_0x1182('0x3d')]=function(_0x280b1b,_0x2edee0){var _0x2edcfd={},_0x5a0a0b={},_0x25f200={'count':0x0,'rows':[]};var _0x214031=_[_0x1182('0x3e')](db[_0x1182('0x3f')][_0x1182('0x40')],function(_0x4cef0e){return{'name':_0x4cef0e['fieldName'],'type':_0x4cef0e['type']['key']};});_0x5a0a0b[_0x1182('0x41')]=_[_0x1182('0x3e')](_0x214031,_0x1182('0x3b'));_0x5a0a0b['query']=_[_0x1182('0x42')](_0x280b1b[_0x1182('0x43')]);_0x5a0a0b[_0x1182('0x44')]=_[_0x1182('0x45')](_0x5a0a0b[_0x1182('0x41')],_0x5a0a0b['query']);_0x2edcfd[_0x1182('0x46')]=_['intersection'](_0x5a0a0b[_0x1182('0x41')],qs['fields'](_0x280b1b[_0x1182('0x43')]['fields']));_0x2edcfd[_0x1182('0x46')]=_0x2edcfd[_0x1182('0x46')][_0x1182('0x47')]?_0x2edcfd[_0x1182('0x46')]:_0x5a0a0b[_0x1182('0x41')];if(!_0x280b1b[_0x1182('0x43')][_0x1182('0x48')](_0x1182('0x49'))){_0x2edcfd[_0x1182('0x31')]=qs[_0x1182('0x31')](_0x280b1b[_0x1182('0x43')][_0x1182('0x31')]);_0x2edcfd['offset']=qs[_0x1182('0x30')](_0x280b1b['query'][_0x1182('0x30')]);}_0x2edcfd['order']=qs['sort'](_0x280b1b[_0x1182('0x43')][_0x1182('0x4a')]);_0x2edcfd[_0x1182('0x4b')]=qs['filters'](_['pick'](_0x280b1b[_0x1182('0x43')],_0x5a0a0b[_0x1182('0x44')]),_0x214031);if(_0x280b1b[_0x1182('0x43')][_0x1182('0x4c')]){_0x2edcfd[_0x1182('0x4b')]=_[_0x1182('0x4d')](_0x2edcfd['where'],{'$or':_[_0x1182('0x3e')](_0x214031,function(_0x16ed55){if(_0x16ed55['type']!==_0x1182('0x4e')){var _0x3d098a={};_0x3d098a[_0x16ed55[_0x1182('0x3b')]]={'$like':'%'+_0x280b1b[_0x1182('0x43')][_0x1182('0x4c')]+'%'};return _0x3d098a;}})});}_0x2edcfd=_[_0x1182('0x4d')]({},_0x2edcfd,_0x280b1b[_0x1182('0x4f')]);var _0x170d2f={'where':_0x2edcfd[_0x1182('0x4b')]};return db[_0x1182('0x3f')]['count'](_0x170d2f)['then'](function(_0xd354a8){_0x25f200['count']=_0xd354a8;if(_0x280b1b[_0x1182('0x43')][_0x1182('0x50')]){_0x2edcfd[_0x1182('0x51')]=[{'all':!![]}];}return db['FaxMessage'][_0x1182('0x52')](_0x2edcfd);})[_0x1182('0x22')](function(_0x23e7ed){_0x25f200[_0x1182('0x53')]=_0x23e7ed;return _0x25f200;})[_0x1182('0x22')](respondWithFilteredResult(_0x2edee0,_0x2edcfd))['catch'](handleError(_0x2edee0,null));};exports[_0x1182('0x54')]=function(_0x1c257e,_0x1d7658){var _0x38a5bf={'raw':!![],'where':{'id':_0x1c257e[_0x1182('0x55')]['id']}},_0x41634c={};_0x41634c[_0x1182('0x41')]=_['keys'](db[_0x1182('0x3f')][_0x1182('0x40')]);_0x41634c['query']=_['keys'](_0x1c257e['query']);_0x41634c[_0x1182('0x44')]=_[_0x1182('0x45')](_0x41634c['model'],_0x41634c[_0x1182('0x43')]);_0x38a5bf[_0x1182('0x46')]=_[_0x1182('0x45')](_0x41634c[_0x1182('0x41')],qs['fields'](_0x1c257e['query'][_0x1182('0x56')]));_0x38a5bf['attributes']=_0x38a5bf['attributes']['length']?_0x38a5bf['attributes']:_0x41634c[_0x1182('0x41')];if(_0x1c257e[_0x1182('0x43')][_0x1182('0x50')]){_0x38a5bf[_0x1182('0x51')]=[{'all':!![]}];}_0x38a5bf=_[_0x1182('0x4d')]({},_0x38a5bf,_0x1c257e[_0x1182('0x4f')]);return db[_0x1182('0x3f')]['find'](_0x38a5bf)['then'](handleEntityNotFound(_0x1d7658,null))[_0x1182('0x22')](respondWithResult(_0x1d7658,null))[_0x1182('0x2c')](handleError(_0x1d7658,null));};exports[_0x1182('0x38')]=function(_0x47b5ee,_0x39cbed){if(_0x47b5ee['body']['id']){delete _0x47b5ee[_0x1182('0x57')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x47b5ee[_0x1182('0x55')]['id']}})[_0x1182('0x22')](handleEntityNotFound(_0x39cbed,null))[_0x1182('0x22')](saveUpdates(_0x47b5ee[_0x1182('0x57')],null))['then'](respondWithResult(_0x39cbed,null))[_0x1182('0x2c')](handleError(_0x39cbed,null));};exports[_0x1182('0x39')]=function(_0x5b7394,_0x2755e5){return db[_0x1182('0x3f')][_0x1182('0x58')]({'where':{'id':_0x5b7394[_0x1182('0x55')]['id']}})[_0x1182('0x22')](handleEntityNotFound(_0x2755e5,null))[_0x1182('0x22')](removeEntity(_0x2755e5,null))[_0x1182('0x2c')](handleError(_0x2755e5,null));};exports[_0x1182('0x59')]=function(_0x714004,_0x32b48c){return db[_0x1182('0x3f')][_0x1182('0x59')]()[_0x1182('0x22')](respondWithResult(_0x32b48c,null))[_0x1182('0x2c')](handleError(_0x32b48c,null));};var interaction_log=require(_0x1182('0x5a'))(_0x1182('0x5b'));exports[_0x1182('0x5c')]=function(_0x4e41f7,_0x41ed84,_0x58c016){var _0x4c8ebc={'agent':{},'channel':_0x1182('0x5d')};if(_0x4e41f7[_0x1182('0x57')]['id']){delete _0x4e41f7[_0x1182('0x57')]['id'];}_0x4e41f7[_0x1182('0x57')][_0x1182('0x5e')]=!![];_0x4e41f7[_0x1182('0x57')][_0x1182('0x5f')]=moment()['format'](_0x1182('0x60'));_0x4e41f7[_0x1182('0x57')]['UserId']=_0x4e41f7['body'][_0x1182('0x61')]||_0x4e41f7[_0x1182('0x62')]['id'];_0x4c8ebc[_0x1182('0x63')]['id']=_0x4e41f7[_0x1182('0x57')][_0x1182('0x61')];return db['FaxMessage']['find']({'where':{'id':_0x4e41f7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x41ed84,null))[_0x1182('0x22')](saveUpdates(_0x4e41f7[_0x1182('0x57')],null))[_0x1182('0x22')](function(_0x2612c9){if(_0x2612c9){_0x4c8ebc[_0x1182('0x64')]=_0x2612c9['get']({'plain':!![]});return db[_0x1182('0x65')][_0x1182('0x58')]({'where':{'id':_0x2612c9[_0x1182('0x66')]}});}return null;})[_0x1182('0x22')](handleEntityNotFound(_0x41ed84,null))['then'](function(_0x14fd06){if(_0x14fd06){return _0x14fd06[_0x1182('0x38')]({'UserId':_0x4e41f7[_0x1182('0x57')][_0x1182('0x61')],'read1stAt':_['isNil'](_0x14fd06['read1stAt'])?moment()[_0x1182('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1182('0x22')](function(_0x13bf4b){if(_0x13bf4b){_0x4c8ebc[_0x1182('0x68')]=_0x13bf4b[_0x1182('0x69')]({'plain':!![]});interaction_log[_0x1182('0x23')](_0x1182('0x6a'),_0x4e41f7['user']['id'],_0x4e41f7[_0x1182('0x62')][_0x1182('0x3b')],_0x4e41f7[_0x1182('0x62')]['role'],_0x4c8ebc['interaction']['id'],_0x4e41f7[_0x1182('0x57')]?JSON[_0x1182('0x27')](_0x4e41f7[_0x1182('0x57')]):_0x1182('0x6b'));return respondWithRpcPromise(_0x1182('0x6c'),_0x1182('0x6d'),_0x4c8ebc);}return null;})['then'](function(_0x4e011e){var _0x49a2c9=_0x1182('0x6e')+_0x4e011e[_0x1182('0x64')][_0x1182('0x6f')];return db['sequelize'][_0x1182('0x43')](_0x49a2c9,{'type':db[_0x1182('0x70')][_0x1182('0x71')][_0x1182('0x72')],'raw':!![]})[_0x1182('0x22')](function(_0x5ddbd8){return _0x5ddbd8;});})['then'](function(_0x4071b0){if(_0x4071b0){_0x4c8ebc[_0x1182('0x64')]['contact']=_0x4071b0[0x0];if(!_0x4e41f7[_0x1182('0x57')]['UserId'])return;return db[_0x1182('0x73')][_0x1182('0x58')]({'where':{'id':_0x4e41f7['body'][_0x1182('0x61')],'role':_0x1182('0x63')},'attributes':['id','name',_0x1182('0x74'),_0x1182('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x313fe1){if(!_0x313fe1)return null;_0x4c8ebc[_0x1182('0x64')]['agent']=_0x313fe1;return _0x4c8ebc;})[_0x1182('0x22')](function(_0x58ecea){if(_0x58ecea){if(_0x4e41f7['body'][_0x1182('0x76')]){_0x4c8ebc[_0x1182('0x64')][_0x1182('0x77')]=util[_0x1182('0x67')](_0x1182('0x78'),_0x4e41f7['user'][_0x1182('0x3b')]);_0x4c8ebc[_0x1182('0x64')][_0x1182('0x79')]=_0x4c8ebc[_0x1182('0x79')];_0x4c8ebc[_0x1182('0x64')][_0x1182('0x7a')]=_0x4c8ebc[_0x1182('0x79')];_0x4c8ebc[_0x1182('0x64')][_0x1182('0x7b')]=_0x1182('0x5c');return respondWithRpcPromise(_0x1182('0x7c'),_0x1182('0x7c'),{'event':_0x1182('0x7d'),'message':_0x4c8ebc[_0x1182('0x64')]},client9002)[_0x1182('0x22')](function(){return _0x4c8ebc;});}return _0x4c8ebc;}return null;})['then'](respondWithResult(_0x41ed84,null))[_0x1182('0x2c')](handleError(_0x41ed84,null));};var interaction_log=require('../../config/logger')(_0x1182('0x5b'));exports[_0x1182('0x36')]=function(_0x242225,_0x37e636,_0x201a7e){var _0x276d79={'agent':{},'channel':_0x1182('0x5d')};if(_0x242225[_0x1182('0x57')]['id']){delete _0x242225[_0x1182('0x57')]['id'];}_0x242225[_0x1182('0x57')][_0x1182('0x61')]=_0x242225[_0x1182('0x57')][_0x1182('0x61')]||_0x242225[_0x1182('0x62')]['id'];_0x276d79[_0x1182('0x63')]['id']=_0x242225[_0x1182('0x57')][_0x1182('0x61')];return db[_0x1182('0x3f')][_0x1182('0x58')]({'where':{'id':_0x242225['params']['id'],'UserId':null}})[_0x1182('0x22')](handleEntityNotFound(_0x37e636,null))['then'](function(_0x13d2f7){if(_0x13d2f7){_0x276d79[_0x1182('0x64')]=_0x13d2f7[_0x1182('0x69')]({'plain':!![]});return db[_0x1182('0x65')][_0x1182('0x58')]({'where':{'id':_0x13d2f7['FaxInteractionId']}});}return null;})[_0x1182('0x22')](handleEntityNotFound(_0x37e636,null))['then'](function(_0x75b244){if(_0x75b244){_0x276d79[_0x1182('0x68')]=_0x75b244[_0x1182('0x69')]({'plain':!![]});interaction_log['info'](_0x1182('0x7e'),_0x242225[_0x1182('0x62')]['id'],_0x242225[_0x1182('0x62')][_0x1182('0x3b')],_0x242225[_0x1182('0x62')][_0x1182('0x7f')],_0x276d79[_0x1182('0x68')]['id'],_0x242225['body']?JSON['stringify'](_0x242225[_0x1182('0x57')]):_0x1182('0x6b'));return respondWithRpcPromise(_0x1182('0x80'),_0x1182('0x81'),_0x276d79);}return null;})[_0x1182('0x22')](function(_0x4603ee){var _0x19652d=_0x1182('0x6e')+_0x4603ee[_0x1182('0x64')]['ContactId'];return db[_0x1182('0x82')][_0x1182('0x43')](_0x19652d,{'type':db[_0x1182('0x70')][_0x1182('0x71')][_0x1182('0x72')],'raw':!![]})['then'](function(_0x4580ea){return _0x4580ea;});})[_0x1182('0x22')](function(_0x22bf8b){if(_0x22bf8b){_0x276d79[_0x1182('0x64')]['contact']=_0x22bf8b[0x0];if(!_0x242225['body'][_0x1182('0x61')])return;return db[_0x1182('0x73')]['find']({'where':{'id':_0x242225[_0x1182('0x57')][_0x1182('0x61')],'role':_0x1182('0x63')},'attributes':['id',_0x1182('0x3b'),_0x1182('0x74'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x45ff4c){if(!_0x45ff4c)return null;_0x276d79[_0x1182('0x64')]['agent']=_0x45ff4c;return _0x276d79;})[_0x1182('0x22')](function(_0x1f30c4){if(_0x1f30c4){_0x1f30c4[_0x1182('0x64')][_0x1182('0x77')]=util[_0x1182('0x67')](_0x1182('0x78'),_0x242225[_0x1182('0x62')][_0x1182('0x3b')]);_0x1f30c4['message']['channel']=_0x276d79[_0x1182('0x79')];_0x1f30c4[_0x1182('0x64')][_0x1182('0x7a')]=_0x276d79[_0x1182('0x79')];_0x1f30c4[_0x1182('0x64')][_0x1182('0x7b')]=_0x1182('0x36');respondWithRpcPromise(_0x1182('0x7c'),_0x1182('0x7c'),{'event':_0x1182('0x83'),'message':_0x1f30c4[_0x1182('0x64')]},client9002);return _0x276d79;}return null;})['then'](respondWithResult(_0x37e636,null))[_0x1182('0x2c')](handleError(_0x37e636,null));};exports['create']=function(_0x36cf32,_0x58f998){var _0x340fb5;return db[_0x1182('0x3f')][_0x1182('0x84')](_0x36cf32[_0x1182('0x57')],{})['then'](function(_0x6380c1){_0x340fb5=_0x6380c1;return db[_0x1182('0x85')][_0x1182('0x86')]({'where':{'id':_0x340fb5[_0x1182('0x6f')]}});})['then'](function(_0x37c354){if(_[_0x1182('0x87')](_0x37c354)){return;}else{_0x340fb5[_0x1182('0x5d')]=_0x37c354[_0x1182('0x5d')];return db[_0x1182('0x88')][_0x1182('0x86')]({'where':{'id':_0x340fb5['AttachmentId']}});}})[_0x1182('0x22')](function(_0x3a3d80){return respondWithRpcPromise(_0x1182('0x89'),_0x1182('0x89'),{'FaxAccountId':_[_0x1182('0x87')](_0x36cf32[_0x1182('0x57')])?undefined:_0x36cf32[_0x1182('0x57')]['FaxAccountId'],'path':_['isNil'](_0x3a3d80)?undefined:util[_0x1182('0x67')]('/var/opt/motion2/server/files/attachments/%s',_0x3a3d80[_0x1182('0x8a')]),'fax':_[_0x1182('0x87')](_0x340fb5[_0x1182('0x5d')])?undefined:_0x340fb5['fax'],'AttachmentId':_0x340fb5[_0x1182('0x8b')]},client9002);})[_0x1182('0x22')](respondWithResult(_0x58f998,0xc9))['catch'](handleError(_0x58f998,null));};exports[_0x1182('0x8c')]=function(_0x22c1eb,_0x568c60){var _0x477b89=path[_0x1182('0x8d')](config[_0x1182('0x8e')],_0x1182('0x8f'),_0x1182('0x90'),_0x1182('0x91'));return db['FaxMessage'][_0x1182('0x58')]({'where':{'id':_0x22c1eb['params']['id']},'include':[{'model':db['Attachment'],'as':_0x1182('0x88')}]})[_0x1182('0x22')](handleEntityNotFound(_0x568c60,null))[_0x1182('0x22')](function(_0x788eb8){if(_0x788eb8){return _0x568c60[_0x1182('0x8c')](path[_0x1182('0x8d')](_0x477b89,_0x788eb8['Attachment'][_0x1182('0x8a')]));}})[_0x1182('0x2c')](handleError(_0x568c60,null));};
\ No newline at end of file
index 2437997..818c630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab1=['events','setMaxListeners','emit','hook','exports'];(function(_0xfaaad,_0x4c46e6){var _0x59136e=function(_0x96abfb){while(--_0x96abfb){_0xfaaad['push'](_0xfaaad['shift']());}};_0x59136e(++_0x4c46e6);}(_0x1ab1,0x12c));var _0x11ab=function(_0x317359,_0x37da6e){_0x317359=_0x317359-0x0;var _0x4c875f=_0x1ab1[_0x317359];return _0x4c875f;};'use strict';var EventEmitter=require(_0x11ab('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x11ab('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x28a19c){return function(_0x4a6492,_0x1fc2bd,_0x363103){FaxMessageEvents[_0x11ab('0x2')](_0x28a19c+':'+_0x4a6492['id'],_0x4a6492);FaxMessageEvents[_0x11ab('0x2')](_0x28a19c,_0x4a6492);_0x363103(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x11ab('0x3')](e,emitEvent(event));}}module[_0x11ab('0x4')]=FaxMessageEvents;
\ No newline at end of file
+var _0x5d95=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x3e06c3,_0x5959f4){var _0x395953=function(_0x57eb8c){while(--_0x57eb8c){_0x3e06c3['push'](_0x3e06c3['shift']());}};_0x395953(++_0x5959f4);}(_0x5d95,0x77));var _0x55d9=function(_0xdcd71f,_0x5c66f9){_0xdcd71f=_0xdcd71f-0x0;var _0x4a490c=_0x5d95[_0xdcd71f];return _0x4a490c;};'use strict';var EventEmitter=require(_0x55d9('0x0'));var FaxMessage=require(_0x55d9('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x55d9('0x2')](0x0);var events={'afterCreate':_0x55d9('0x3'),'afterUpdate':_0x55d9('0x4'),'afterDestroy':_0x55d9('0x5')};function emitEvent(_0x135c30){return function(_0x536e6d,_0xabfc0e,_0x5b0772){FaxMessageEvents['emit'](_0x135c30+':'+_0x536e6d['id'],_0x536e6d);FaxMessageEvents[_0x55d9('0x6')](_0x135c30,_0x536e6d);_0x5b0772(null);};}for(var e in events){if(events[_0x55d9('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
index 7ad6633..330aea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4799=['exports','define','FaxMessage','fax_messages','body','FULLTEXT','get','direction','secret','isNil','FaxInteraction','FaxInteractionId','then','update','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes'];(function(_0x2686c2,_0x489c09){var _0x37bde5=function(_0x4bb6f2){while(--_0x4bb6f2){_0x2686c2['push'](_0x2686c2['shift']());}};_0x37bde5(++_0x489c09);}(_0x4799,0x83));var _0x9479=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4799[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x9479('0x0'));var util=require(_0x9479('0x1'));var logger=require('../../config/logger')(_0x9479('0x2'));var moment=require('moment');var BPromise=require(_0x9479('0x3'));var rp=require(_0x9479('0x4'));var fs=require('fs');var path=require(_0x9479('0x5'));var rimraf=require(_0x9479('0x6'));var config=require(_0x9479('0x7'));var attributes=require(_0x9479('0x8'));module[_0x9479('0x9')]=function(_0x5db1d7,_0x3bc6f6){return _0x5db1d7[_0x9479('0xa')](_0x9479('0xb'),attributes,{'tableName':_0x9479('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x9479('0xd')],'type':_0x9479('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x200705,_0x471ce8,_0xe9fae5){var _0x327f14=_0x5db1d7['models'];var _0x4ea6a6=_0x200705[_0x9479('0xf')]({'plain':!![]});if(_0x4ea6a6['direction']['toLowerCase']()==='in'||_0x4ea6a6[_0x9479('0x10')]['toLowerCase']()==='out'&&!_0x4ea6a6[_0x9479('0x11')]&&!_[_0x9479('0x12')](_0x4ea6a6['UserId'])){_0x327f14[_0x9479('0x13')]['findOne']({'where':{'id':_0x4ea6a6[_0x9479('0x14')]}})[_0x9479('0x15')](function(_0x22131c){if(_0x22131c){_0x22131c[_0x9479('0x16')]({'lastMsgAt':_0x4ea6a6['createdAt'],'lastMsgDirection':_0x4ea6a6[_0x9479('0x10')][_0x9479('0x17')]()});}})[_0x9479('0x18')](function(_0x2447d5){console[_0x9479('0x19')](_0x2447d5);});}_0xe9fae5();}},'charset':_0x9479('0x1a'),'collate':_0x9479('0x1b')});};
\ No newline at end of file
+var _0x00ee=['error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch'];(function(_0x4685a4,_0x567250){var _0x51af19=function(_0xc8ebdf){while(--_0xc8ebdf){_0x4685a4['push'](_0x4685a4['shift']());}};_0x51af19(++_0x567250);}(_0x00ee,0x162));var _0xe00e=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x00ee[_0x1fb1c1];return _0x1622df;};'use strict';var _=require(_0xe00e('0x0'));var util=require('util');var logger=require(_0xe00e('0x1'))('api');var moment=require(_0xe00e('0x2'));var BPromise=require(_0xe00e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe00e('0x4'));var attributes=require(_0xe00e('0x5'));module[_0xe00e('0x6')]=function(_0x47f903,_0x419a9c){return _0x47f903[_0xe00e('0x7')](_0xe00e('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xe00e('0x9')],'type':_0xe00e('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38901a,_0x33a3fe,_0x227b2f){var _0x5b5c57=_0x47f903[_0xe00e('0xb')];var _0x4c89e8=_0x38901a['get']({'plain':!![]});if(_0x4c89e8[_0xe00e('0xc')][_0xe00e('0xd')]()==='in'||_0x4c89e8[_0xe00e('0xc')]['toLowerCase']()===_0xe00e('0xe')&&!_0x4c89e8[_0xe00e('0xf')]&&!_[_0xe00e('0x10')](_0x4c89e8[_0xe00e('0x11')])){_0x5b5c57[_0xe00e('0x12')][_0xe00e('0x13')]({'where':{'id':_0x4c89e8[_0xe00e('0x14')]}})[_0xe00e('0x15')](function(_0x3eb77d){if(_0x3eb77d){_0x3eb77d[_0xe00e('0x16')]({'lastMsgAt':_0x4c89e8['createdAt'],'lastMsgDirection':_0x4c89e8[_0xe00e('0xc')]['toLowerCase']()});}})[_0xe00e('0x17')](function(_0x497bb5){console[_0xe00e('0x18')](_0x497bb5);});}_0x227b2f();}},'charset':_0xe00e('0x19'),'collate':_0xe00e('0x1a')});};
\ No newline at end of file
index 838436c..e1286cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xed1f,0x6a));var _0xfed1=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xed1f[_0x38537f];return _0x141e23;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});};
\ No newline at end of file
+var _0xa8a8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa8a8,0xec));var _0x8a8a=function(_0x236f47,_0x5d11e1){_0x236f47=_0x236f47-0x0;var _0x228853=_0xa8a8[_0x236f47];return _0x228853;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});config[_0x8a8a('0xd')]=_[_0x8a8a('0xe')](config[_0x8a8a('0xd')],{'host':_0x8a8a('0xf'),'port':0x18eb});var socket=require(_0x8a8a('0x10'))(new Redis(config[_0x8a8a('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3c01cd,_0x497b8a,_0x11788d){return new BPromise(function(_0x3d3a00,_0x532621){return client[_0x8a8a('0x11')](_0x3c01cd,_0x11788d)[_0x8a8a('0x12')](function(_0xb13fca){logger['info'](_0x8a8a('0x13'),_0x497b8a,_0x8a8a('0x14'));logger[_0x8a8a('0x15')](_0x8a8a('0x16'),_0x497b8a,'request\x20sent',JSON[_0x8a8a('0x17')](_0xb13fca));if(_0xb13fca['error']){if(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x19')]===0x1f4){logger[_0x8a8a('0x18')](_0x8a8a('0x13'),_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x532621(_0xb13fca[_0x8a8a('0x18')]['message']);}logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x3d3a00(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);}else{logger[_0x8a8a('0x1b')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x8a8a('0x14'));_0x3d3a00(_0xb13fca[_0x8a8a('0x1c')][_0x8a8a('0x1a')]);}})[_0x8a8a('0x1d')](function(_0x299827){logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x299827);_0x532621(_0x299827);});});}exports['CreateFaxMessage']=function(_0x5181b2){var _0x4e3d0a=this;return new Promise(function(_0x4a6601,_0x3a9b2f){return db[_0x8a8a('0x1e')][_0x8a8a('0x1f')](_0x5181b2[_0x8a8a('0x20')],{'raw':_0x5181b2[_0x8a8a('0x21')]?_0x5181b2[_0x8a8a('0x21')][_0x8a8a('0x22')]===undefined?!![]:![]:!![]})[_0x8a8a('0x12')](function(_0x25d5d4){logger[_0x8a8a('0x1b')](_0x8a8a('0x23'),_0x5181b2);logger[_0x8a8a('0x15')](_0x8a8a('0x23'),_0x5181b2,JSON[_0x8a8a('0x17')](_0x25d5d4));_0x4a6601(_0x25d5d4);})[_0x8a8a('0x1d')](function(_0x545a38){logger[_0x8a8a('0x18')](_0x8a8a('0x23'),_0x545a38[_0x8a8a('0x1a')],_0x5181b2);_0x3a9b2f(_0x4e3d0a[_0x8a8a('0x18')](0x1f4,_0x545a38[_0x8a8a('0x1a')]));});});};exports[_0x8a8a('0x24')]=function(_0x3aa46d){var _0x5f4dcc=this;return new Promise(function(_0x31d21a,_0x38c1e0){return db[_0x8a8a('0x1e')]['update'](_0x3aa46d['body'],{'raw':_0x3aa46d[_0x8a8a('0x21')]?_0x3aa46d[_0x8a8a('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aa46d['options']?_0x3aa46d['options'][_0x8a8a('0x25')]||null:null,'attributes':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x26')]||null:null,'limit':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x27')]||null:null})[_0x8a8a('0x12')](function(_0x8df0cb){logger[_0x8a8a('0x1b')](_0x8a8a('0x24'),_0x3aa46d);logger[_0x8a8a('0x15')](_0x8a8a('0x24'),_0x3aa46d,JSON['stringify'](_0x8df0cb));_0x31d21a(_0x8df0cb);})['catch'](function(_0x56e79e){logger[_0x8a8a('0x18')](_0x8a8a('0x24'),_0x56e79e['message'],_0x3aa46d);_0x38c1e0(_0x5f4dcc[_0x8a8a('0x18')](0x1f4,_0x56e79e[_0x8a8a('0x1a')]));});});};
\ No newline at end of file
index 7855870..483d16a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd887=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0xd887,0x1cf));var _0x7d88=function(_0x5c9f2d,_0xeee094){_0x5c9f2d=_0x5c9f2d-0x0;var _0x4007f0=_0xd887[_0x5c9f2d];return _0x4007f0;};'use strict';var FaxMessageEvents=require(_0x7d88('0x0'));var events=[_0x7d88('0x1'),_0x7d88('0x2'),_0x7d88('0x3')];function createListener(_0x581597,_0x2338da){return function(_0x1af402){_0x2338da[_0x7d88('0x4')](_0x581597,_0x1af402);};}function removeListener(_0x4270fe,_0x56da62){return function(){FaxMessageEvents[_0x7d88('0x5')](_0x4270fe,_0x56da62);};}exports[_0x7d88('0x6')]=function(_0x3a76e1){for(var _0x22582b=0x0,_0x28de42=events[_0x7d88('0x7')];_0x22582b<_0x28de42;_0x22582b++){var _0x3d10cc=events[_0x22582b];var _0x403655=createListener(_0x7d88('0x8')+_0x3d10cc,_0x3a76e1);FaxMessageEvents['on'](_0x3d10cc,_0x403655);}};
\ No newline at end of file
+var _0x37a5=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x2f2601,_0x10b8be){var _0x3c6e6=function(_0x12a171){while(--_0x12a171){_0x2f2601['push'](_0x2f2601['shift']());}};_0x3c6e6(++_0x10b8be);}(_0x37a5,0x1b4));var _0x537a=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x37a5[_0x4fde08];return _0x12e725;};'use strict';var FaxMessageEvents=require(_0x537a('0x0'));var events=[_0x537a('0x1'),_0x537a('0x2'),_0x537a('0x3')];function createListener(_0x18f494,_0x31999c){return function(_0x163c3f){_0x31999c[_0x537a('0x4')](_0x18f494,_0x163c3f);};}function removeListener(_0x11fccf,_0x5c0a2d){return function(){FaxMessageEvents[_0x537a('0x5')](_0x11fccf,_0x5c0a2d);};}exports[_0x537a('0x6')]=function(_0x199610){for(var _0x18c281=0x0,_0x5c0084=events[_0x537a('0x7')];_0x18c281<_0x5c0084;_0x18c281++){var _0x42ad58=events[_0x18c281];var _0x4517ed=createListener(_0x537a('0x8')+_0x42ad58,_0x199610);FaxMessageEvents['on'](_0x42ad58,_0x4517ed);}};
\ No newline at end of file
index c5b5ef6..6ea32da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5fa=['accept','/:id/reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','tracked','faxmessage:create','create','put'];(function(_0x13930a,_0x4b0a15){var _0x16de79=function(_0x19a478){while(--_0x19a478){_0x13930a['push'](_0x13930a['shift']());}};_0x16de79(++_0x4b0a15);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x7a2a2f,_0x26057a){_0x7a2a2f=_0x7a2a2f-0x0;var _0x4fbb2a=_0xa5fa[_0x7a2a2f];return _0x4fbb2a;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xaa5f('0x10')]('fax',_0xaa5f('0x11')),controller[_0xaa5f('0x12')]);router[_0xaa5f('0x13')](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller['update']);router[_0xaa5f('0x13')]('/:id/accept',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);router[_0xaa5f('0x13')](_0xaa5f('0x15'),auth[_0xaa5f('0x9')](),controller['reject']);router['delete'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x16')]);module[_0xaa5f('0x17')]=router;
\ No newline at end of file
+var _0x2f68=['/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept'];(function(_0x5cef48,_0x4f4b95){var _0x2486c6=function(_0x4acbe3){while(--_0x4acbe3){_0x5cef48['push'](_0x5cef48['shift']());}};_0x2486c6(++_0x4f4b95);}(_0x2f68,0x9a));var _0x82f6=function(_0x13c667,_0x2ccf54){_0x13c667=_0x13c667-0x0;var _0x1ddc4d=_0x2f68[_0x13c667];return _0x1ddc4d;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./faxMessage.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),interaction[_0x82f6('0xe')](_0x82f6('0xf'),_0x82f6('0x10')),controller['create']);router[_0x82f6('0x11')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x12')]);router[_0x82f6('0x11')](_0x82f6('0x13'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x14')]);router[_0x82f6('0x11')](_0x82f6('0x15'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x16')]);router['delete'](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x17')]);module[_0x82f6('0x18')]=router;
\ No newline at end of file
index b0848ad..90293f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f77=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','STRING'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x8f77,0x98));var _0x78f7=function(_0xe3b4af,_0x5a6dbd){_0xe3b4af=_0xe3b4af-0x0;var _0x11aab6=_0x8f77[_0xe3b4af];return _0x11aab6;};'use strict';var Sequelize=require(_0x78f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x78f7('0x1')],'unique':_0x78f7('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x78f7('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78f7('0x4')](_0x78f7('0x5'),_0x78f7('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6659=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1e51b3,_0x1a0a26){var _0x25ef21=function(_0x27f423){while(--_0x27f423){_0x1e51b3['push'](_0x1e51b3['shift']());}};_0x25ef21(++_0x1a0a26);}(_0x6659,0x169));var _0x9665=function(_0x196ebe,_0x46cfeb){_0x196ebe=_0x196ebe-0x0;var _0x2f3f26=_0x6659[_0x196ebe];return _0x2f3f26;};'use strict';var Sequelize=require(_0x9665('0x0'));module[_0x9665('0x1')]={'name':{'type':Sequelize[_0x9665('0x2')],'unique':_0x9665('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9665('0x2')]},'timeout':{'type':Sequelize[_0x9665('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9665('0x5')](_0x9665('0x6'),'beepall',_0x9665('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9665('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 190b2f0..9ca180f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e68=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','faxPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','includes','all','union','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','save','then','destroy','get','FaxQueues','UserProfileResource','name','send','index','FaxQueue','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0x7e68,0x1ed));var _0x87e6=function(_0x5798cb,_0x323596){_0x5798cb=_0x5798cb-0x0;var _0x163780=_0x7e68[_0x5798cb];return _0x163780;};'use strict';var emlformat=require(_0x87e6('0x0'));var rimraf=require(_0x87e6('0x1'));var zipdir=require(_0x87e6('0x2'));var jsonpatch=require(_0x87e6('0x3'));var rp=require(_0x87e6('0x4'));var moment=require(_0x87e6('0x5'));var BPromise=require(_0x87e6('0x6'));var Mustache=require('mustache');var util=require(_0x87e6('0x7'));var path=require(_0x87e6('0x8'));var sox=require(_0x87e6('0x9'));var csv=require(_0x87e6('0xa'));var ejs=require(_0x87e6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87e6('0xc'));var squel=require(_0x87e6('0xd'));var crypto=require(_0x87e6('0xe'));var jsforce=require(_0x87e6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x87e6('0xa'));var querystring=require(_0x87e6('0x10'));var Papa=require('papaparse');var Redis=require(_0x87e6('0x11'));var authService=require(_0x87e6('0x12'));var qs=require(_0x87e6('0x13'));var as=require(_0x87e6('0x14'));var hardwareService=require(_0x87e6('0x15'));var logger=require(_0x87e6('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x87e6('0x17'));var db=require(_0x87e6('0x18'))['db'];config[_0x87e6('0x19')]=_[_0x87e6('0x1a')](config[_0x87e6('0x19')],{'host':_0x87e6('0x1b'),'port':0x18eb});var socket=require(_0x87e6('0x1c'))(new Redis(config[_0x87e6('0x19')]));require(_0x87e6('0x1d'))[_0x87e6('0x1e')](socket);function respondWithStatusCode(_0x55857d,_0x5c1db7){_0x5c1db7=_0x5c1db7||0xcc;return function(_0x3c3567){if(_0x3c3567){return _0x55857d[_0x87e6('0x1f')](_0x5c1db7);}return _0x55857d[_0x87e6('0x20')](_0x5c1db7)[_0x87e6('0x21')]();};}function respondWithResult(_0x10c770,_0x456b2f){_0x456b2f=_0x456b2f||0xc8;return function(_0x42765d){if(_0x42765d){return _0x10c770[_0x87e6('0x20')](_0x456b2f)['json'](_0x42765d);}};}function respondWithFilteredResult(_0x3d9b76,_0x3521f3){return function(_0x448e93){if(_0x448e93){var _0x412d43=typeof _0x3521f3['offset']==='undefined'&&typeof _0x3521f3[_0x87e6('0x22')]===_0x87e6('0x23');var _0x4f8789=_0x448e93[_0x87e6('0x24')];var _0x3d55b8=_0x412d43?0x0:_0x3521f3['offset'];var _0x4ff2d8=_0x412d43?_0x448e93['count']:_0x3521f3[_0x87e6('0x25')]+_0x3521f3[_0x87e6('0x22')];var _0x11576e;if(_0x4ff2d8>=_0x4f8789){_0x4ff2d8=_0x4f8789;_0x11576e=0xc8;}else{_0x11576e=0xce;}_0x3d9b76[_0x87e6('0x20')](_0x11576e);return _0x3d9b76[_0x87e6('0x26')]('Content-Range',_0x3d55b8+'-'+_0x4ff2d8+'/'+_0x4f8789)[_0x87e6('0x27')](_0x448e93);}return null;};}function patchUpdates(_0x119632){return function(_0x24949f){try{jsonpatch[_0x87e6('0x28')](_0x24949f,_0x119632,!![]);}catch(_0x2dbf5d){return BPromise['reject'](_0x2dbf5d);}return _0x24949f[_0x87e6('0x29')]();};}function saveUpdates(_0x54dcdd,_0x3bdc06){return function(_0x22c0f3){if(_0x22c0f3){return _0x22c0f3['update'](_0x54dcdd)[_0x87e6('0x2a')](function(_0x4f5e9e){return _0x4f5e9e;});}return null;};}function removeEntity(_0xede651,_0x47c0a1){return function(_0x1098dd){if(_0x1098dd){return _0x1098dd[_0x87e6('0x2b')]()[_0x87e6('0x2a')](function(){var _0xe40e1e=_0x1098dd[_0x87e6('0x2c')]({'plain':!![]});var _0x446dbe=_0x87e6('0x2d');return db[_0x87e6('0x2e')][_0x87e6('0x2b')]({'where':{'type':_0x446dbe,'resourceId':_0xe40e1e['id']}})[_0x87e6('0x2a')](function(){return _0x1098dd;});})[_0x87e6('0x2a')](function(){_0xede651[_0x87e6('0x20')](0xcc)[_0x87e6('0x21')]();});}};}function handleEntityNotFound(_0x20032a,_0x38a142){return function(_0x345b8b){if(!_0x345b8b){_0x20032a[_0x87e6('0x1f')](0x194);}return _0x345b8b;};}function handleError(_0x1e8a4e,_0xc1f231){_0xc1f231=_0xc1f231||0x1f4;return function(_0x47b402){logger['error'](_0x47b402['stack']);if(_0x47b402['name']){delete _0x47b402[_0x87e6('0x2f')];}_0x1e8a4e[_0x87e6('0x20')](_0xc1f231)[_0x87e6('0x30')](_0x47b402);};}exports[_0x87e6('0x31')]=function(_0x3a0540,_0x2a93d7){var _0x365aac={},_0x3cd359={},_0x4fde32={'count':0x0,'rows':[]};var _0x482809=_['map'](db[_0x87e6('0x32')][_0x87e6('0x33')],function(_0xcd1529){return{'name':_0xcd1529[_0x87e6('0x34')],'type':_0xcd1529[_0x87e6('0x35')]['key']};});_0x3cd359['model']=_[_0x87e6('0x36')](_0x482809,'name');_0x3cd359[_0x87e6('0x37')]=_[_0x87e6('0x38')](_0x3a0540[_0x87e6('0x37')]);_0x3cd359[_0x87e6('0x39')]=_[_0x87e6('0x3a')](_0x3cd359[_0x87e6('0x3b')],_0x3cd359[_0x87e6('0x37')]);_0x365aac[_0x87e6('0x3c')]=_['intersection'](_0x3cd359[_0x87e6('0x3b')],qs['fields'](_0x3a0540[_0x87e6('0x37')][_0x87e6('0x3d')]));_0x365aac[_0x87e6('0x3c')]=_0x365aac[_0x87e6('0x3c')][_0x87e6('0x3e')]?_0x365aac['attributes']:_0x3cd359['model'];if(!_0x3a0540[_0x87e6('0x37')][_0x87e6('0x3f')](_0x87e6('0x40'))){_0x365aac['limit']=qs['limit'](_0x3a0540[_0x87e6('0x37')]['limit']);_0x365aac['offset']=qs[_0x87e6('0x25')](_0x3a0540[_0x87e6('0x37')][_0x87e6('0x25')]);}_0x365aac[_0x87e6('0x41')]=qs[_0x87e6('0x42')](_0x3a0540[_0x87e6('0x37')][_0x87e6('0x42')]);_0x365aac[_0x87e6('0x43')]=qs[_0x87e6('0x39')](_[_0x87e6('0x44')](_0x3a0540[_0x87e6('0x37')],_0x3cd359[_0x87e6('0x39')]),_0x482809);if(_0x3a0540['query'][_0x87e6('0x45')]){_0x365aac[_0x87e6('0x43')]=_['merge'](_0x365aac['where'],{'$or':_['map'](_0x482809,function(_0x1930a2){if(_0x1930a2['type']!==_0x87e6('0x46')){var _0x390e02={};_0x390e02[_0x1930a2[_0x87e6('0x2f')]]={'$like':'%'+_0x3a0540[_0x87e6('0x37')]['filter']+'%'};return _0x390e02;}})});}_0x365aac=_[_0x87e6('0x47')]({},_0x365aac,_0x3a0540[_0x87e6('0x48')]);var _0x27dde3={'where':_0x365aac[_0x87e6('0x43')]};return db[_0x87e6('0x32')][_0x87e6('0x24')](_0x27dde3)['then'](function(_0x15a91d){_0x4fde32[_0x87e6('0x24')]=_0x15a91d;if(_0x3a0540['query']['includeAll']){_0x365aac[_0x87e6('0x49')]=[{'all':!![]}];}return db[_0x87e6('0x32')][_0x87e6('0x4a')](_0x365aac);})[_0x87e6('0x2a')](function(_0x146096){_0x4fde32[_0x87e6('0x4b')]=_0x146096;return _0x4fde32;})[_0x87e6('0x2a')](respondWithFilteredResult(_0x2a93d7,_0x365aac))[_0x87e6('0x4c')](handleError(_0x2a93d7,null));};exports[_0x87e6('0x4d')]=function(_0x1f6a61,_0x50c8b4){var _0x1d9671={'raw':!![],'where':{'id':_0x1f6a61['params']['id']}},_0x37a7ab={};_0x37a7ab[_0x87e6('0x3b')]=_[_0x87e6('0x38')](db[_0x87e6('0x32')]['rawAttributes']);_0x37a7ab['query']=_['keys'](_0x1f6a61[_0x87e6('0x37')]);_0x37a7ab['filters']=_['intersection'](_0x37a7ab[_0x87e6('0x3b')],_0x37a7ab['query']);_0x1d9671[_0x87e6('0x3c')]=_[_0x87e6('0x3a')](_0x37a7ab[_0x87e6('0x3b')],qs[_0x87e6('0x3d')](_0x1f6a61['query'][_0x87e6('0x3d')]));_0x1d9671[_0x87e6('0x3c')]=_0x1d9671[_0x87e6('0x3c')][_0x87e6('0x3e')]?_0x1d9671['attributes']:_0x37a7ab[_0x87e6('0x3b')];if(_0x1f6a61[_0x87e6('0x37')][_0x87e6('0x4e')]){_0x1d9671[_0x87e6('0x49')]=[{'all':!![]}];}_0x1d9671=_['merge']({},_0x1d9671,_0x1f6a61[_0x87e6('0x48')]);return db[_0x87e6('0x32')][_0x87e6('0x4f')](_0x1d9671)[_0x87e6('0x2a')](handleEntityNotFound(_0x50c8b4,null))[_0x87e6('0x2a')](respondWithResult(_0x50c8b4,null))['catch'](handleError(_0x50c8b4,null));};exports[_0x87e6('0x50')]=function(_0x76c420,_0x114ecf){return db[_0x87e6('0x32')][_0x87e6('0x50')](_0x76c420[_0x87e6('0x51')],{})[_0x87e6('0x2a')](function(_0x140558){var _0x20fdb8=_0x76c420[_0x87e6('0x52')][_0x87e6('0x2c')]({'plain':!![]});if(!_0x20fdb8)throw new Error(_0x87e6('0x53'));if(_0x20fdb8[_0x87e6('0x54')]===_0x87e6('0x52')){var _0x4cbfc4=_0x140558[_0x87e6('0x2c')]({'plain':!![]});var _0x33b7a3=_0x87e6('0x2d');return db[_0x87e6('0x55')]['find']({'where':{'name':_0x33b7a3,'userProfileId':_0x20fdb8[_0x87e6('0x56')]},'raw':!![]})[_0x87e6('0x2a')](function(_0x3c5cf5){if(_0x3c5cf5&&_0x3c5cf5[_0x87e6('0x57')]===0x0){return db[_0x87e6('0x2e')][_0x87e6('0x50')]({'name':_0x4cbfc4[_0x87e6('0x2f')],'resourceId':_0x4cbfc4['id'],'type':_0x3c5cf5[_0x87e6('0x2f')],'sectionId':_0x3c5cf5['id']},{})[_0x87e6('0x2a')](function(){return _0x140558;});}else{return _0x140558;}})[_0x87e6('0x4c')](function(_0x6a049a){logger[_0x87e6('0x58')](_0x87e6('0x59'),_0x6a049a);throw _0x6a049a;});}return _0x140558;})[_0x87e6('0x2a')](respondWithResult(_0x114ecf,0xc9))[_0x87e6('0x4c')](handleError(_0x114ecf,null));};exports[_0x87e6('0x5a')]=function(_0x162866,_0x294075){if(_0x162866['body']['id']){delete _0x162866[_0x87e6('0x51')]['id'];}return db[_0x87e6('0x32')]['find']({'where':{'id':_0x162866[_0x87e6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x294075,null))[_0x87e6('0x2a')](saveUpdates(_0x162866[_0x87e6('0x51')],null))[_0x87e6('0x2a')](respondWithResult(_0x294075,null))[_0x87e6('0x4c')](handleError(_0x294075,null));};exports[_0x87e6('0x2b')]=function(_0x42057f,_0x371b51){return db[_0x87e6('0x32')]['find']({'where':{'id':_0x42057f[_0x87e6('0x5b')]['id']}})[_0x87e6('0x2a')](handleEntityNotFound(_0x371b51,null))['then'](removeEntity(_0x371b51,null))[_0x87e6('0x4c')](handleError(_0x371b51,null));};exports[_0x87e6('0x5c')]=function(_0xa9d4d7,_0x163ee7){return db[_0x87e6('0x32')][_0x87e6('0x5c')]()[_0x87e6('0x2a')](respondWithResult(_0x163ee7,null))[_0x87e6('0x4c')](handleError(_0x163ee7,null));};exports[_0x87e6('0x5d')]=function(_0x445460,_0x15418b,_0x2ca26f){var _0xbced9a={'raw':!![],'where':{}},_0x4ced98={},_0x3ed415;return db['FaxQueue'][_0x87e6('0x5e')]({'where':{'id':_0x445460[_0x87e6('0x5b')]['id']}})[_0x87e6('0x2a')](handleEntityNotFound(_0x15418b,null))[_0x87e6('0x2a')](function(_0x616088){if(_0x616088){_0x3ed415=_0x616088[_0x87e6('0x2c')]({'plain':!![]});_0x4ced98['model']=_['keys'](db[_0x87e6('0x5f')][_0x87e6('0x33')]);_0x4ced98[_0x87e6('0x37')]=_[_0x87e6('0x38')](_0x445460[_0x87e6('0x37')]);_0x4ced98[_0x87e6('0x39')]=_[_0x87e6('0x3a')](_0x4ced98[_0x87e6('0x3b')],_0x4ced98[_0x87e6('0x37')]);_0xbced9a[_0x87e6('0x3c')]=_[_0x87e6('0x3a')](_0x4ced98[_0x87e6('0x3b')],qs['fields'](_0x445460['query'][_0x87e6('0x3d')]));_0xbced9a[_0x87e6('0x3c')]=_0xbced9a[_0x87e6('0x3c')][_0x87e6('0x3e')]?_0xbced9a[_0x87e6('0x3c')]:_0x4ced98[_0x87e6('0x3b')];if(!_0x445460['query'][_0x87e6('0x3f')]('nolimit')){_0xbced9a[_0x87e6('0x22')]=qs[_0x87e6('0x22')](_0x445460[_0x87e6('0x37')][_0x87e6('0x22')]);_0xbced9a[_0x87e6('0x25')]=qs[_0x87e6('0x25')](_0x445460[_0x87e6('0x37')][_0x87e6('0x25')]);}_0xbced9a['order']=qs[_0x87e6('0x42')](_0x445460[_0x87e6('0x37')]['sort']);_0xbced9a['where']=qs[_0x87e6('0x39')](_['pick'](_0x445460['query'],_0x4ced98[_0x87e6('0x39')]));_0xbced9a[_0x87e6('0x43')][_0x87e6('0x60')]=_0x616088['id'];if(_0x445460[_0x87e6('0x37')][_0x87e6('0x45')]){_0xbced9a['where']=_['merge'](_0xbced9a['where'],{'$or':_[_0x87e6('0x36')](_0xbced9a['attributes'],function(_0xc3c4f5){var _0x20661f={};_0x20661f[_0xc3c4f5]={'$like':'%'+_0x445460[_0x87e6('0x37')][_0x87e6('0x45')]+'%'};return _0x20661f;})});}_0xbced9a=_[_0x87e6('0x47')]({},_0xbced9a,_0x445460[_0x87e6('0x48')]);return db[_0x87e6('0x5f')][_0x87e6('0x4a')](_0xbced9a);}})['then'](function(_0x42d0a8){if(_0x42d0a8){return db[_0x87e6('0x61')][_0x87e6('0x62')]({'where':{'id':_[_0x87e6('0x36')](_0x42d0a8,_0x87e6('0x63')),'role':_0x87e6('0x64')},'attributes':['id',_0x87e6('0x2f'),'faxPause',_0x87e6('0x65'),_0x87e6('0x66')]});}})['then'](function(_0x19bb10){if(_0x19bb10){return{'count':_0x19bb10[_0x87e6('0x24')],'rows':_[_0x87e6('0x36')](_0x19bb10[_0x87e6('0x4b')],function(_0x89e3da){return{'membername':_0x89e3da[_0x87e6('0x2f')],'UserId':_0x89e3da['id'],'queue_name':_0x3ed415[_0x87e6('0x2f')],'FaxQueueId':_0x3ed415['id'],'interface':util[_0x87e6('0x67')]('%s/%s',_0x87e6('0x68'),_0x89e3da['name']),'penalty':0x0,'paused':_0x89e3da[_0x87e6('0x69')],'createdAt':_0x89e3da[_0x87e6('0x66')],'updatedAt':_0x89e3da['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x87e6('0x2a')](respondWithFilteredResult(_0x15418b,_0xbced9a))['catch'](handleError(_0x15418b,null));};exports[_0x87e6('0x6a')]=function(_0x2ca735,_0x5ac700,_0x4c46bb){var _0x4393f7={};var _0x2245fd={};var _0x5d860e;var _0x463617;return db[_0x87e6('0x32')]['findOne']({'where':{'id':_0x2ca735['params']['id']}})[_0x87e6('0x2a')](handleEntityNotFound(_0x5ac700,null))[_0x87e6('0x2a')](function(_0x5c65ea){if(_0x5c65ea){_0x5d860e=_0x5c65ea;_0x2245fd[_0x87e6('0x3b')]=_['keys'](db[_0x87e6('0x6b')][_0x87e6('0x33')]);_0x2245fd[_0x87e6('0x37')]=_[_0x87e6('0x38')](_0x2ca735[_0x87e6('0x37')]);_0x2245fd[_0x87e6('0x39')]=_[_0x87e6('0x3a')](_0x2245fd[_0x87e6('0x3b')],_0x2245fd[_0x87e6('0x37')]);_0x4393f7[_0x87e6('0x3c')]=_[_0x87e6('0x3a')](_0x2245fd['model'],qs[_0x87e6('0x3d')](_0x2ca735['query'][_0x87e6('0x3d')]));_0x4393f7['attributes']=_0x4393f7[_0x87e6('0x3c')][_0x87e6('0x3e')]?_0x4393f7[_0x87e6('0x3c')]:_0x2245fd['model'];_0x4393f7[_0x87e6('0x41')]=qs[_0x87e6('0x42')](_0x2ca735[_0x87e6('0x37')]['sort']);_0x4393f7[_0x87e6('0x43')]=qs[_0x87e6('0x39')](_[_0x87e6('0x44')](_0x2ca735[_0x87e6('0x37')],_0x2245fd['filters']));if(_0x2ca735['query'][_0x87e6('0x45')]){_0x4393f7[_0x87e6('0x43')]=_['merge'](_0x4393f7[_0x87e6('0x43')],{'$or':_['map'](_0x4393f7[_0x87e6('0x3c')],function(_0x37f218){var _0x46ace3={};_0x46ace3[_0x37f218]={'$like':'%'+_0x2ca735[_0x87e6('0x37')][_0x87e6('0x45')]+'%'};return _0x46ace3;})});}_0x4393f7=_[_0x87e6('0x47')]({},_0x4393f7,_0x2ca735[_0x87e6('0x48')]);return _0x5d860e[_0x87e6('0x6a')](_0x4393f7);}})['then'](function(_0xf94aed){if(_0xf94aed){_0x463617=_0xf94aed[_0x87e6('0x3e')];if(!_0x2ca735[_0x87e6('0x37')]['hasOwnProperty'](_0x87e6('0x40'))){_0x4393f7[_0x87e6('0x22')]=qs[_0x87e6('0x22')](_0x2ca735[_0x87e6('0x37')]['limit']);_0x4393f7['offset']=qs[_0x87e6('0x25')](_0x2ca735['query'][_0x87e6('0x25')]);}return _0x5d860e[_0x87e6('0x6a')](_0x4393f7);}})[_0x87e6('0x2a')](function(_0x11d0a5){if(_0x11d0a5){return _0x11d0a5?{'count':_0x463617,'rows':_0x11d0a5}:null;}})['then'](respondWithResult(_0x5ac700,null))[_0x87e6('0x4c')](handleError(_0x5ac700,null));};exports[_0x87e6('0x6c')]=function(_0x520869,_0x132671,_0x44cfe5){var _0x3e5d70=_0x520869[_0x87e6('0x51')][_0x87e6('0x6d')];return db[_0x87e6('0x6b')][_0x87e6('0x4a')]({'where':{'id':_0x3e5d70},'attributes':['id'],'include':[{'model':db[_0x87e6('0x61')],'as':_0x87e6('0x6e'),'attributes':['id',_0x87e6('0x2f'),_0x87e6('0x6f'),_0x87e6('0x70'),_0x87e6('0x71')],'raw':!![]}]})['then'](function(_0xbe4ba0){if(_0xbe4ba0){var _0x3fcc7e=_[_0x87e6('0x72')](_0xbe4ba0,function(_0x30c64b){var _0x6b2784=_0x30c64b[_0x87e6('0x2c')]({'plain':!![]});return _0x6b2784[_0x87e6('0x6e')];});return db[_0x87e6('0x32')]['find']({'where':{'id':_0x520869['params']['id']}})[_0x87e6('0x2a')](function(_0x5584dc){return db[_0x87e6('0x73')][_0x87e6('0x74')](function(_0x2dcf1c){return _0x5584dc[_0x87e6('0x6c')](_0x3e5d70,{'transaction':_0x2dcf1c})['then'](function(){return BPromise['each'](_0x3fcc7e,function(_0xec5d7d){return db['UserFaxQueue'][_0x87e6('0x75')]({'where':{'UserId':_0xec5d7d['id'],'FaxQueueId':_0x520869['params']['id']},'transaction':_0x2dcf1c});});})[_0x87e6('0x2a')](function(){_0x3fcc7e['forEach'](function(_0x292508){socket[_0x87e6('0x76')](_0x87e6('0x77'),{'UserId':_0x292508['id'],'FaxQueueId':_0x5584dc['id']});});});});});}})[_0x87e6('0x2a')](respondWithStatusCode(_0x132671,null))[_0x87e6('0x4c')](handleError(_0x132671,null));};exports[_0x87e6('0x78')]=function(_0x2621cc,_0x42c152,_0x1a5d41){return db[_0x87e6('0x6b')][_0x87e6('0x4a')]({'where':{'id':_0x2621cc[_0x87e6('0x37')][_0x87e6('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x87e6('0x61')],'as':_0x87e6('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x87e6('0x2a')](handleEntityNotFound(_0x42c152,null))[_0x87e6('0x2a')](function(_0x1c6d3f){var _0x2c44a1=_[_0x87e6('0x36')](_0x1c6d3f,'id');var _0x4dedfb=[];var _0x5b268=[];var _0x5b36f4=squel[_0x87e6('0x79')]();_0x5b36f4[_0x87e6('0x7a')](_0x87e6('0x7b'))[_0x87e6('0x7c')]('team_has_fax_queues','tq')[_0x87e6('0x7d')](_0x87e6('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x87e6('0x43')](_0x87e6('0x7f'),_0x2621cc[_0x87e6('0x5b')]['id']);for(var _0x34bd08=0x0;_0x34bd08<_0x1c6d3f[_0x87e6('0x3e')];_0x34bd08+=0x1){let _0x5a51f7=_0x1c6d3f[_0x34bd08];for(var _0xcd76ed=0x0;_0xcd76ed<_0x5a51f7[_0x87e6('0x6e')]['length'];_0xcd76ed+=0x1){let _0x55a2b5=_0x5a51f7['Agents'][_0xcd76ed];var _0xf219d5=_0x5b36f4['clone']();_0xf219d5[_0x87e6('0x43')](_0x87e6('0x80'),_0x55a2b5['id']);_0x5b268[_0x87e6('0x81')](db[_0x87e6('0x73')]['query'](_0xf219d5[_0x87e6('0x82')](),{'type':db[_0x87e6('0x73')]['QueryTypes']['SELECT']})[_0x87e6('0x2a')](function(_0x1ea388){if(_0x1ea388[_0x87e6('0x3e')]===0x1){return _0x55a2b5['id'];}else{var _0x99cabd=_[_0x87e6('0x83')](_[_0x87e6('0x36')](_0x1ea388,'TeamId'),function(_0xb79976){return _[_0x87e6('0x84')](_0x2c44a1,_0xb79976);});if(_0x99cabd){return _0x55a2b5['id'];}}}));}}return BPromise[_0x87e6('0x85')](_0x5b268)[_0x87e6('0x2a')](function(_0x3c1257){_0x4dedfb=_(_0x4dedfb)[_0x87e6('0x86')](_0x3c1257)[_0x87e6('0x87')]()[_0x87e6('0x88')]();return db['FaxQueue']['find']({'where':{'id':_0x2621cc['params']['id']}})[_0x87e6('0x2a')](function(_0x352693){return db[_0x87e6('0x73')][_0x87e6('0x74')](function(_0x50f641){return _0x352693['removeTeams'](_0x2621cc[_0x87e6('0x37')]['ids'],{'transaction':_0x50f641})[_0x87e6('0x2a')](function(){if(!_[_0x87e6('0x89')](_0x4dedfb)){return _0x352693['removeAgents'](_0x4dedfb,{'transaction':_0x50f641});}})[_0x87e6('0x2a')](function(){_0x4dedfb['forEach'](function(_0x2c1792){socket[_0x87e6('0x76')](_0x87e6('0x8a'),{'UserId':_0x2c1792,'FaxQueueId':_0x352693['id']});});});});});});})[_0x87e6('0x2a')](respondWithStatusCode(_0x42c152,null))[_0x87e6('0x4c')](handleError(_0x42c152,null));};exports[_0x87e6('0x8b')]=function(_0xb32e6a,_0x4db80a,_0x1e9d4c){return db['FaxQueue'][_0x87e6('0x4f')]({'where':{'id':_0xb32e6a['params']['id']}})[_0x87e6('0x2a')](handleEntityNotFound(_0x4db80a,null))[_0x87e6('0x2a')](function(_0x3a56c7){if(_0x3a56c7){return _0x3a56c7['addAgents'](_0xb32e6a[_0x87e6('0x51')][_0x87e6('0x6d')],_[_0x87e6('0x8c')](_0xb32e6a[_0x87e6('0x51')],[_0x87e6('0x6d'),'id'])||{})[_0x87e6('0x8d')](function(_0x53394e){for(var _0x28c0d6=0x0;_0x28c0d6<_0xb32e6a['body'][_0x87e6('0x6d')][_0x87e6('0x3e')];_0x28c0d6+=0x1){socket['emit'](_0x87e6('0x77'),{'UserId':Number(_0xb32e6a[_0x87e6('0x51')]['ids'][_0x28c0d6]),'FaxQueueId':Number(_0xb32e6a[_0x87e6('0x5b')]['id'])});}return _0x53394e;});}})[_0x87e6('0x2a')](respondWithResult(_0x4db80a,null))[_0x87e6('0x4c')](handleError(_0x4db80a,null));};exports['removeAgents']=function(_0x10153d,_0x3e825f,_0x5eca1a){return db[_0x87e6('0x32')][_0x87e6('0x4f')]({'where':{'id':_0x10153d['params']['id']}})[_0x87e6('0x2a')](handleEntityNotFound(_0x3e825f,null))['then'](function(_0x59bb11){if(_0x59bb11){return _0x59bb11[_0x87e6('0x8e')](_0x10153d['query'][_0x87e6('0x6d')])[_0x87e6('0x2a')](function(){if(_[_0x87e6('0x8f')](_0x10153d[_0x87e6('0x37')][_0x87e6('0x6d')])){for(var _0x552a8f=0x0;_0x552a8f<_0x10153d[_0x87e6('0x37')][_0x87e6('0x6d')][_0x87e6('0x3e')];_0x552a8f+=0x1){socket[_0x87e6('0x76')]('userFaxQueue:remove',{'UserId':Number(_0x10153d[_0x87e6('0x37')]['ids'][_0x552a8f]),'FaxQueueId':Number(_0x10153d[_0x87e6('0x5b')]['id'])});}}else{socket[_0x87e6('0x76')]('userFaxQueue:remove',{'UserId':Number(_0x10153d[_0x87e6('0x37')][_0x87e6('0x6d')]),'FaxQueueId':Number(_0x10153d[_0x87e6('0x5b')]['id'])});}});}})[_0x87e6('0x2a')](respondWithStatusCode(_0x3e825f,null))['catch'](handleError(_0x3e825f,null));};exports[_0x87e6('0x90')]=function(_0x43b989,_0x5f42fb,_0x5c8e4f){var _0x2500dd={};var _0x175b22={};var _0x2326f8;var _0x348554;return db['FaxQueue'][_0x87e6('0x5e')]({'where':{'id':_0x43b989[_0x87e6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5f42fb,null))[_0x87e6('0x2a')](function(_0x1dd092){if(_0x1dd092){_0x2326f8=_0x1dd092;_0x175b22['model']=_[_0x87e6('0x38')](db[_0x87e6('0x61')][_0x87e6('0x33')]);_0x175b22['query']=_[_0x87e6('0x38')](_0x43b989[_0x87e6('0x37')]);_0x175b22[_0x87e6('0x39')]=_[_0x87e6('0x3a')](_0x175b22[_0x87e6('0x3b')],_0x175b22['query']);_0x2500dd[_0x87e6('0x3c')]=_['intersection'](_0x175b22[_0x87e6('0x3b')],qs[_0x87e6('0x3d')](_0x43b989[_0x87e6('0x37')][_0x87e6('0x3d')]));_0x2500dd['attributes']=_0x2500dd[_0x87e6('0x3c')][_0x87e6('0x3e')]?_0x2500dd[_0x87e6('0x3c')]:_0x175b22[_0x87e6('0x3b')];_0x2500dd[_0x87e6('0x41')]=qs[_0x87e6('0x42')](_0x43b989['query']['sort']);_0x2500dd['where']=qs[_0x87e6('0x39')](_['pick'](_0x43b989[_0x87e6('0x37')],_0x175b22[_0x87e6('0x39')]));if(_0x43b989['query'][_0x87e6('0x45')]){_0x2500dd['where']=_[_0x87e6('0x47')](_0x2500dd[_0x87e6('0x43')],{'$or':_[_0x87e6('0x36')](_0x2500dd[_0x87e6('0x3c')],function(_0x2a7857){var _0x3d377d={};_0x3d377d[_0x2a7857]={'$like':'%'+_0x43b989[_0x87e6('0x37')]['filter']+'%'};return _0x3d377d;})});}_0x2500dd=_[_0x87e6('0x47')]({},_0x2500dd,_0x43b989['options']);return _0x2326f8[_0x87e6('0x90')](_0x2500dd);}})[_0x87e6('0x2a')](function(_0x4e5636){if(_0x4e5636){_0x348554=_0x4e5636[_0x87e6('0x3e')];if(!_0x43b989[_0x87e6('0x37')][_0x87e6('0x3f')](_0x87e6('0x40'))){_0x2500dd[_0x87e6('0x22')]=qs['limit'](_0x43b989[_0x87e6('0x37')][_0x87e6('0x22')]);_0x2500dd['offset']=qs['offset'](_0x43b989['query'][_0x87e6('0x25')]);}return _0x2326f8['getAgents'](_0x2500dd);}})[_0x87e6('0x2a')](function(_0x1d22c4){if(_0x1d22c4){return _0x1d22c4?{'count':_0x348554,'rows':_0x1d22c4}:null;}})[_0x87e6('0x2a')](respondWithResult(_0x5f42fb,null))[_0x87e6('0x4c')](handleError(_0x5f42fb,null));};
\ No newline at end of file
+var _0xa3d0=['fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','merge','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserFaxQueue','User','findAndCountAll','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','removeAgents','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','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','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','FaxQueues','UserProfileResource','then','error','name','send','index','map','FaxQueue'];(function(_0x5939c0,_0x5623b8){var _0xd71a19=function(_0x17711f){while(--_0x17711f){_0x5939c0['push'](_0x5939c0['shift']());}};_0xd71a19(++_0x5623b8);}(_0xa3d0,0xee));var _0x0a3d=function(_0x5c0fd1,_0x5ed3aa){_0x5c0fd1=_0x5c0fd1-0x0;var _0x21b83d=_0xa3d0[_0x5c0fd1];return _0x21b83d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a3d('0x0'));var zipdir=require(_0x0a3d('0x1'));var jsonpatch=require(_0x0a3d('0x2'));var rp=require(_0x0a3d('0x3'));var moment=require('moment');var BPromise=require(_0x0a3d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0a3d('0x5'));var sox=require('sox');var csv=require(_0x0a3d('0x6'));var ejs=require(_0x0a3d('0x7'));var fs=require('fs');var fs_extra=require(_0x0a3d('0x8'));var _=require('lodash');var squel=require(_0x0a3d('0x9'));var crypto=require('crypto');var jsforce=require(_0x0a3d('0xa'));var deskjs=require(_0x0a3d('0xb'));var toCsv=require(_0x0a3d('0x6'));var querystring=require(_0x0a3d('0xc'));var Papa=require(_0x0a3d('0xd'));var Redis=require(_0x0a3d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0a3d('0xf'));var as=require(_0x0a3d('0x10'));var hardwareService=require(_0x0a3d('0x11'));var logger=require(_0x0a3d('0x12'))(_0x0a3d('0x13'));var utils=require(_0x0a3d('0x14'));var config=require(_0x0a3d('0x15'));var licenseUtil=require(_0x0a3d('0x16'));var db=require(_0x0a3d('0x17'))['db'];config['redis']=_[_0x0a3d('0x18')](config[_0x0a3d('0x19')],{'host':_0x0a3d('0x1a'),'port':0x18eb});var socket=require(_0x0a3d('0x1b'))(new Redis(config[_0x0a3d('0x19')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x34b664,_0xdb1696){_0xdb1696=_0xdb1696||0xcc;return function(_0x1fa485){if(_0x1fa485){return _0x34b664[_0x0a3d('0x1c')](_0xdb1696);}return _0x34b664['status'](_0xdb1696)[_0x0a3d('0x1d')]();};}function respondWithResult(_0x16977e,_0x50fd88){_0x50fd88=_0x50fd88||0xc8;return function(_0x5b1d5c){if(_0x5b1d5c){return _0x16977e[_0x0a3d('0x1e')](_0x50fd88)[_0x0a3d('0x1f')](_0x5b1d5c);}};}function respondWithFilteredResult(_0x396864,_0x3ece78){return function(_0x2eae82){if(_0x2eae82){var _0x37b45d=typeof _0x3ece78[_0x0a3d('0x20')]==='undefined'&&typeof _0x3ece78[_0x0a3d('0x21')]===_0x0a3d('0x22');var _0x4d074e=_0x2eae82[_0x0a3d('0x23')];var _0x2bfd24=_0x37b45d?0x0:_0x3ece78[_0x0a3d('0x20')];var _0x542976=_0x37b45d?_0x2eae82[_0x0a3d('0x23')]:_0x3ece78['offset']+_0x3ece78[_0x0a3d('0x21')];var _0x355fdb;if(_0x542976>=_0x4d074e){_0x542976=_0x4d074e;_0x355fdb=0xc8;}else{_0x355fdb=0xce;}_0x396864[_0x0a3d('0x1e')](_0x355fdb);return _0x396864['set'](_0x0a3d('0x24'),_0x2bfd24+'-'+_0x542976+'/'+_0x4d074e)[_0x0a3d('0x1f')](_0x2eae82);}return null;};}function patchUpdates(_0x527c8f){return function(_0xf8dba){try{jsonpatch[_0x0a3d('0x25')](_0xf8dba,_0x527c8f,!![]);}catch(_0xb4fc29){return BPromise[_0x0a3d('0x26')](_0xb4fc29);}return _0xf8dba[_0x0a3d('0x27')]();};}function saveUpdates(_0x331e8f,_0x486334){return function(_0x1aa555){if(_0x1aa555){return _0x1aa555['update'](_0x331e8f)['then'](function(_0x56080c){return _0x56080c;});}return null;};}function removeEntity(_0x3ce603,_0x4995dc){return function(_0x4772dd){if(_0x4772dd){return _0x4772dd[_0x0a3d('0x28')]()['then'](function(){var _0x15f210=_0x4772dd['get']({'plain':!![]});var _0x115564=_0x0a3d('0x29');return db[_0x0a3d('0x2a')]['destroy']({'where':{'type':_0x115564,'resourceId':_0x15f210['id']}})[_0x0a3d('0x2b')](function(){return _0x4772dd;});})['then'](function(){_0x3ce603[_0x0a3d('0x1e')](0xcc)[_0x0a3d('0x1d')]();});}};}function handleEntityNotFound(_0x56e415,_0x120832){return function(_0x36aae1){if(!_0x36aae1){_0x56e415[_0x0a3d('0x1c')](0x194);}return _0x36aae1;};}function handleError(_0x4a7dde,_0x1173ab){_0x1173ab=_0x1173ab||0x1f4;return function(_0x5cf66d){logger[_0x0a3d('0x2c')](_0x5cf66d['stack']);if(_0x5cf66d[_0x0a3d('0x2d')]){delete _0x5cf66d[_0x0a3d('0x2d')];}_0x4a7dde[_0x0a3d('0x1e')](_0x1173ab)[_0x0a3d('0x2e')](_0x5cf66d);};}exports[_0x0a3d('0x2f')]=function(_0x1ffaf9,_0x288d1f){var _0x3de3c9={},_0x14e3e6={},_0x4fc53a={'count':0x0,'rows':[]};var _0x5e329a=_[_0x0a3d('0x30')](db[_0x0a3d('0x31')]['rawAttributes'],function(_0x42b6e0){return{'name':_0x42b6e0[_0x0a3d('0x32')],'type':_0x42b6e0['type'][_0x0a3d('0x33')]};});_0x14e3e6[_0x0a3d('0x34')]=_['map'](_0x5e329a,_0x0a3d('0x2d'));_0x14e3e6[_0x0a3d('0x35')]=_[_0x0a3d('0x36')](_0x1ffaf9[_0x0a3d('0x35')]);_0x14e3e6['filters']=_[_0x0a3d('0x37')](_0x14e3e6[_0x0a3d('0x34')],_0x14e3e6['query']);_0x3de3c9[_0x0a3d('0x38')]=_[_0x0a3d('0x37')](_0x14e3e6[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x39')]));_0x3de3c9[_0x0a3d('0x38')]=_0x3de3c9[_0x0a3d('0x38')][_0x0a3d('0x3a')]?_0x3de3c9[_0x0a3d('0x38')]:_0x14e3e6['model'];if(!_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x3b')](_0x0a3d('0x3c'))){_0x3de3c9[_0x0a3d('0x21')]=qs[_0x0a3d('0x21')](_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x21')]);_0x3de3c9[_0x0a3d('0x20')]=qs['offset'](_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x20')]);}_0x3de3c9[_0x0a3d('0x3d')]=qs[_0x0a3d('0x3e')](_0x1ffaf9['query'][_0x0a3d('0x3e')]);_0x3de3c9[_0x0a3d('0x3f')]=qs['filters'](_[_0x0a3d('0x40')](_0x1ffaf9[_0x0a3d('0x35')],_0x14e3e6[_0x0a3d('0x41')]),_0x5e329a);if(_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x42')]){_0x3de3c9[_0x0a3d('0x3f')]=_['merge'](_0x3de3c9[_0x0a3d('0x3f')],{'$or':_[_0x0a3d('0x30')](_0x5e329a,function(_0x13fb3e){if(_0x13fb3e[_0x0a3d('0x43')]!==_0x0a3d('0x44')){var _0x24505b={};_0x24505b[_0x13fb3e[_0x0a3d('0x2d')]]={'$like':'%'+_0x1ffaf9[_0x0a3d('0x35')]['filter']+'%'};return _0x24505b;}})});}_0x3de3c9=_['merge']({},_0x3de3c9,_0x1ffaf9[_0x0a3d('0x45')]);var _0x10a97e={'where':_0x3de3c9[_0x0a3d('0x3f')]};return db[_0x0a3d('0x31')][_0x0a3d('0x23')](_0x10a97e)['then'](function(_0x4b610b){_0x4fc53a['count']=_0x4b610b;if(_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x46')]){_0x3de3c9[_0x0a3d('0x47')]=[{'all':!![]}];}return db['FaxQueue'][_0x0a3d('0x48')](_0x3de3c9);})['then'](function(_0x57dcbd){_0x4fc53a[_0x0a3d('0x49')]=_0x57dcbd;return _0x4fc53a;})[_0x0a3d('0x2b')](respondWithFilteredResult(_0x288d1f,_0x3de3c9))[_0x0a3d('0x4a')](handleError(_0x288d1f,null));};exports[_0x0a3d('0x4b')]=function(_0x38e45f,_0x51102d){var _0x2a9d57={'raw':!![],'where':{'id':_0x38e45f['params']['id']}},_0x3ceb09={};_0x3ceb09[_0x0a3d('0x34')]=_[_0x0a3d('0x36')](db[_0x0a3d('0x31')][_0x0a3d('0x4c')]);_0x3ceb09['query']=_['keys'](_0x38e45f[_0x0a3d('0x35')]);_0x3ceb09[_0x0a3d('0x41')]=_[_0x0a3d('0x37')](_0x3ceb09[_0x0a3d('0x34')],_0x3ceb09[_0x0a3d('0x35')]);_0x2a9d57[_0x0a3d('0x38')]=_['intersection'](_0x3ceb09[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x38e45f[_0x0a3d('0x35')][_0x0a3d('0x39')]));_0x2a9d57[_0x0a3d('0x38')]=_0x2a9d57[_0x0a3d('0x38')][_0x0a3d('0x3a')]?_0x2a9d57['attributes']:_0x3ceb09[_0x0a3d('0x34')];if(_0x38e45f[_0x0a3d('0x35')][_0x0a3d('0x46')]){_0x2a9d57[_0x0a3d('0x47')]=[{'all':!![]}];}_0x2a9d57=_[_0x0a3d('0x4d')]({},_0x2a9d57,_0x38e45f[_0x0a3d('0x45')]);return db[_0x0a3d('0x31')][_0x0a3d('0x4e')](_0x2a9d57)[_0x0a3d('0x2b')](handleEntityNotFound(_0x51102d,null))[_0x0a3d('0x2b')](respondWithResult(_0x51102d,null))['catch'](handleError(_0x51102d,null));};exports[_0x0a3d('0x4f')]=function(_0x37da59,_0x51e51e){return db[_0x0a3d('0x31')][_0x0a3d('0x4f')](_0x37da59[_0x0a3d('0x50')],{})[_0x0a3d('0x2b')](function(_0xc65d59){var _0x25dbb2=_0x37da59['user'][_0x0a3d('0x51')]({'plain':!![]});if(!_0x25dbb2)throw new Error(_0x0a3d('0x52'));if(_0x25dbb2[_0x0a3d('0x53')]===_0x0a3d('0x54')){var _0x2d61c6=_0xc65d59[_0x0a3d('0x51')]({'plain':!![]});var _0x550cc0=_0x0a3d('0x29');return db[_0x0a3d('0x55')]['find']({'where':{'name':_0x550cc0,'userProfileId':_0x25dbb2[_0x0a3d('0x56')]},'raw':!![]})[_0x0a3d('0x2b')](function(_0x11a4e1){if(_0x11a4e1&&_0x11a4e1[_0x0a3d('0x57')]===0x0){return db[_0x0a3d('0x2a')][_0x0a3d('0x4f')]({'name':_0x2d61c6[_0x0a3d('0x2d')],'resourceId':_0x2d61c6['id'],'type':_0x11a4e1[_0x0a3d('0x2d')],'sectionId':_0x11a4e1['id']},{})[_0x0a3d('0x2b')](function(){return _0xc65d59;});}else{return _0xc65d59;}})['catch'](function(_0x52a055){logger[_0x0a3d('0x2c')](_0x0a3d('0x58'),_0x52a055);throw _0x52a055;});}return _0xc65d59;})[_0x0a3d('0x2b')](respondWithResult(_0x51e51e,0xc9))[_0x0a3d('0x4a')](handleError(_0x51e51e,null));};exports[_0x0a3d('0x59')]=function(_0x836704,_0x43fea4){if(_0x836704[_0x0a3d('0x50')]['id']){delete _0x836704[_0x0a3d('0x50')]['id'];}return db[_0x0a3d('0x31')][_0x0a3d('0x4e')]({'where':{'id':_0x836704[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x43fea4,null))[_0x0a3d('0x2b')](saveUpdates(_0x836704[_0x0a3d('0x50')],null))[_0x0a3d('0x2b')](respondWithResult(_0x43fea4,null))[_0x0a3d('0x4a')](handleError(_0x43fea4,null));};exports['destroy']=function(_0x46de70,_0x74e8fc){return db[_0x0a3d('0x31')][_0x0a3d('0x4e')]({'where':{'id':_0x46de70[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x74e8fc,null))['then'](removeEntity(_0x74e8fc,null))[_0x0a3d('0x4a')](handleError(_0x74e8fc,null));};exports[_0x0a3d('0x5b')]=function(_0x6894a3,_0xfb7494){return db['FaxQueue'][_0x0a3d('0x5b')]()['then'](respondWithResult(_0xfb7494,null))[_0x0a3d('0x4a')](handleError(_0xfb7494,null));};exports['getMembers']=function(_0x3b2340,_0x370cd1,_0x2707b9){var _0x5778c2={'raw':!![],'where':{}},_0x1ff5ac={},_0x47adf6;return db[_0x0a3d('0x31')][_0x0a3d('0x5c')]({'where':{'id':_0x3b2340[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x370cd1,null))[_0x0a3d('0x2b')](function(_0x30024b){if(_0x30024b){_0x47adf6=_0x30024b[_0x0a3d('0x51')]({'plain':!![]});_0x1ff5ac[_0x0a3d('0x34')]=_[_0x0a3d('0x36')](db[_0x0a3d('0x5d')][_0x0a3d('0x4c')]);_0x1ff5ac[_0x0a3d('0x35')]=_[_0x0a3d('0x36')](_0x3b2340['query']);_0x1ff5ac[_0x0a3d('0x41')]=_['intersection'](_0x1ff5ac[_0x0a3d('0x34')],_0x1ff5ac[_0x0a3d('0x35')]);_0x5778c2[_0x0a3d('0x38')]=_[_0x0a3d('0x37')](_0x1ff5ac[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x3b2340['query'][_0x0a3d('0x39')]));_0x5778c2[_0x0a3d('0x38')]=_0x5778c2[_0x0a3d('0x38')][_0x0a3d('0x3a')]?_0x5778c2['attributes']:_0x1ff5ac['model'];if(!_0x3b2340['query']['hasOwnProperty'](_0x0a3d('0x3c'))){_0x5778c2[_0x0a3d('0x21')]=qs[_0x0a3d('0x21')](_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x21')]);_0x5778c2['offset']=qs[_0x0a3d('0x20')](_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x20')]);}_0x5778c2[_0x0a3d('0x3d')]=qs[_0x0a3d('0x3e')](_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x3e')]);_0x5778c2['where']=qs[_0x0a3d('0x41')](_[_0x0a3d('0x40')](_0x3b2340['query'],_0x1ff5ac['filters']));_0x5778c2[_0x0a3d('0x3f')]['FaxQueueId']=_0x30024b['id'];if(_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x42')]){_0x5778c2[_0x0a3d('0x3f')]=_[_0x0a3d('0x4d')](_0x5778c2[_0x0a3d('0x3f')],{'$or':_[_0x0a3d('0x30')](_0x5778c2[_0x0a3d('0x38')],function(_0x3ac44a){var _0x27b629={};_0x27b629[_0x3ac44a]={'$like':'%'+_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x42')]+'%'};return _0x27b629;})});}_0x5778c2=_[_0x0a3d('0x4d')]({},_0x5778c2,_0x3b2340['options']);return db['UserFaxQueue'][_0x0a3d('0x48')](_0x5778c2);}})[_0x0a3d('0x2b')](function(_0x1c5568){if(_0x1c5568){return db[_0x0a3d('0x5e')][_0x0a3d('0x5f')]({'where':{'id':_['map'](_0x1c5568,'UserId'),'role':_0x0a3d('0x60')},'attributes':['id',_0x0a3d('0x2d'),_0x0a3d('0x61'),'updatedAt',_0x0a3d('0x62')]});}})[_0x0a3d('0x2b')](function(_0x235659){if(_0x235659){return{'count':_0x235659[_0x0a3d('0x23')],'rows':_[_0x0a3d('0x30')](_0x235659[_0x0a3d('0x49')],function(_0xacc1ef){return{'membername':_0xacc1ef['name'],'UserId':_0xacc1ef['id'],'queue_name':_0x47adf6[_0x0a3d('0x2d')],'FaxQueueId':_0x47adf6['id'],'interface':util[_0x0a3d('0x63')](_0x0a3d('0x64'),_0x0a3d('0x65'),_0xacc1ef[_0x0a3d('0x2d')]),'penalty':0x0,'paused':_0xacc1ef[_0x0a3d('0x61')],'createdAt':_0xacc1ef[_0x0a3d('0x62')],'updatedAt':_0xacc1ef[_0x0a3d('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0a3d('0x2b')](respondWithFilteredResult(_0x370cd1,_0x5778c2))['catch'](handleError(_0x370cd1,null));};exports[_0x0a3d('0x67')]=function(_0x332d72,_0x36ab0f,_0x2f01b6){var _0x42314f={};var _0x399382={};var _0x3b95bb;var _0x2e3902;return db[_0x0a3d('0x31')][_0x0a3d('0x5c')]({'where':{'id':_0x332d72[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x36ab0f,null))[_0x0a3d('0x2b')](function(_0x511c2a){if(_0x511c2a){_0x3b95bb=_0x511c2a;_0x399382[_0x0a3d('0x34')]=_[_0x0a3d('0x36')](db['Team'][_0x0a3d('0x4c')]);_0x399382['query']=_[_0x0a3d('0x36')](_0x332d72['query']);_0x399382[_0x0a3d('0x41')]=_[_0x0a3d('0x37')](_0x399382[_0x0a3d('0x34')],_0x399382[_0x0a3d('0x35')]);_0x42314f[_0x0a3d('0x38')]=_[_0x0a3d('0x37')](_0x399382[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x39')]));_0x42314f[_0x0a3d('0x38')]=_0x42314f[_0x0a3d('0x38')]['length']?_0x42314f['attributes']:_0x399382[_0x0a3d('0x34')];_0x42314f['order']=qs[_0x0a3d('0x3e')](_0x332d72[_0x0a3d('0x35')]['sort']);_0x42314f[_0x0a3d('0x3f')]=qs[_0x0a3d('0x41')](_[_0x0a3d('0x40')](_0x332d72[_0x0a3d('0x35')],_0x399382[_0x0a3d('0x41')]));if(_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x42')]){_0x42314f[_0x0a3d('0x3f')]=_[_0x0a3d('0x4d')](_0x42314f[_0x0a3d('0x3f')],{'$or':_[_0x0a3d('0x30')](_0x42314f[_0x0a3d('0x38')],function(_0x344eb7){var _0xdee8ad={};_0xdee8ad[_0x344eb7]={'$like':'%'+_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x42')]+'%'};return _0xdee8ad;})});}_0x42314f=_[_0x0a3d('0x4d')]({},_0x42314f,_0x332d72[_0x0a3d('0x45')]);return _0x3b95bb[_0x0a3d('0x67')](_0x42314f);}})['then'](function(_0x87a3bb){if(_0x87a3bb){_0x2e3902=_0x87a3bb[_0x0a3d('0x3a')];if(!_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x3b')](_0x0a3d('0x3c'))){_0x42314f['limit']=qs[_0x0a3d('0x21')](_0x332d72['query'][_0x0a3d('0x21')]);_0x42314f[_0x0a3d('0x20')]=qs[_0x0a3d('0x20')](_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x20')]);}return _0x3b95bb[_0x0a3d('0x67')](_0x42314f);}})[_0x0a3d('0x2b')](function(_0x4a7049){if(_0x4a7049){return _0x4a7049?{'count':_0x2e3902,'rows':_0x4a7049}:null;}})[_0x0a3d('0x2b')](respondWithResult(_0x36ab0f,null))[_0x0a3d('0x4a')](handleError(_0x36ab0f,null));};exports[_0x0a3d('0x68')]=function(_0xa1b276,_0x4b4305,_0x46834d){var _0x23bb88=_0xa1b276[_0x0a3d('0x50')][_0x0a3d('0x69')];return db[_0x0a3d('0x6a')][_0x0a3d('0x48')]({'where':{'id':_0x23bb88},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a3d('0x6b'),'attributes':['id',_0x0a3d('0x2d'),_0x0a3d('0x6c'),'voicePause',_0x0a3d('0x6d')],'raw':!![]}]})['then'](function(_0x44e7f2){if(_0x44e7f2){var _0x3aaec0=_[_0x0a3d('0x6e')](_0x44e7f2,function(_0x1769a6){var _0x4d4d44=_0x1769a6[_0x0a3d('0x51')]({'plain':!![]});return _0x4d4d44[_0x0a3d('0x6b')];});return db['FaxQueue'][_0x0a3d('0x4e')]({'where':{'id':_0xa1b276[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](function(_0x25e5c9){return db[_0x0a3d('0x6f')][_0x0a3d('0x70')](function(_0x4c40a2){return _0x25e5c9[_0x0a3d('0x68')](_0x23bb88,{'transaction':_0x4c40a2})['then'](function(){return BPromise[_0x0a3d('0x71')](_0x3aaec0,function(_0x144392){return db[_0x0a3d('0x5d')][_0x0a3d('0x72')]({'where':{'UserId':_0x144392['id'],'FaxQueueId':_0xa1b276[_0x0a3d('0x5a')]['id']},'transaction':_0x4c40a2});});})[_0x0a3d('0x2b')](function(){_0x3aaec0[_0x0a3d('0x73')](function(_0x34ae88){socket[_0x0a3d('0x74')]('userFaxQueue:save',{'UserId':_0x34ae88['id'],'FaxQueueId':_0x25e5c9['id']});});});});});}})['then'](respondWithStatusCode(_0x4b4305,null))['catch'](handleError(_0x4b4305,null));};exports['removeTeams']=function(_0x4d958b,_0x8438a9,_0x2bfb00){return db['Team']['findAll']({'where':{'id':_0x4d958b[_0x0a3d('0x35')][_0x0a3d('0x69')]},'attributes':['id'],'include':[{'model':db[_0x0a3d('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0a3d('0x2b')](handleEntityNotFound(_0x8438a9,null))[_0x0a3d('0x2b')](function(_0x2fc1a5){var _0x603ee1=_[_0x0a3d('0x30')](_0x2fc1a5,'id');var _0x196366=[];var _0x5794c4=[];var _0x52ab19=squel[_0x0a3d('0x75')]();_0x52ab19[_0x0a3d('0x76')]('tq.TeamId')[_0x0a3d('0x77')](_0x0a3d('0x78'),'tq')[_0x0a3d('0x79')](_0x0a3d('0x7a'),'ut',_0x0a3d('0x7b'))[_0x0a3d('0x3f')](_0x0a3d('0x7c'),_0x4d958b['params']['id']);for(var _0x35977a=0x0;_0x35977a<_0x2fc1a5[_0x0a3d('0x3a')];_0x35977a+=0x1){let _0x1608ec=_0x2fc1a5[_0x35977a];for(var _0x3b9089=0x0;_0x3b9089<_0x1608ec['Agents'][_0x0a3d('0x3a')];_0x3b9089+=0x1){let _0x2e2863=_0x1608ec[_0x0a3d('0x6b')][_0x3b9089];var _0x14263d=_0x52ab19[_0x0a3d('0x7d')]();_0x14263d[_0x0a3d('0x3f')]('ut.UserId\x20=\x20?',_0x2e2863['id']);_0x5794c4[_0x0a3d('0x7e')](db['sequelize']['query'](_0x14263d[_0x0a3d('0x7f')](),{'type':db[_0x0a3d('0x6f')][_0x0a3d('0x80')][_0x0a3d('0x81')]})['then'](function(_0x5a619a){if(_0x5a619a[_0x0a3d('0x3a')]===0x1){return _0x2e2863['id'];}else{var _0x321703=_[_0x0a3d('0x82')](_[_0x0a3d('0x30')](_0x5a619a,_0x0a3d('0x83')),function(_0x170f77){return _[_0x0a3d('0x84')](_0x603ee1,_0x170f77);});if(_0x321703){return _0x2e2863['id'];}}}));}}return BPromise['all'](_0x5794c4)[_0x0a3d('0x2b')](function(_0x4f36ed){_0x196366=_(_0x196366)[_0x0a3d('0x85')](_0x4f36ed)[_0x0a3d('0x86')]()[_0x0a3d('0x87')]();return db['FaxQueue']['find']({'where':{'id':_0x4d958b[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](function(_0x3488a1){return db[_0x0a3d('0x6f')][_0x0a3d('0x70')](function(_0x49fc02){return _0x3488a1[_0x0a3d('0x88')](_0x4d958b[_0x0a3d('0x35')][_0x0a3d('0x69')],{'transaction':_0x49fc02})[_0x0a3d('0x2b')](function(){if(!_['isEmpty'](_0x196366)){return _0x3488a1[_0x0a3d('0x89')](_0x196366,{'transaction':_0x49fc02});}})[_0x0a3d('0x2b')](function(){_0x196366[_0x0a3d('0x73')](function(_0x2201e){socket[_0x0a3d('0x74')](_0x0a3d('0x8a'),{'UserId':_0x2201e,'FaxQueueId':_0x3488a1['id']});});});});});});})['then'](respondWithStatusCode(_0x8438a9,null))[_0x0a3d('0x4a')](handleError(_0x8438a9,null));};exports[_0x0a3d('0x8b')]=function(_0x30629d,_0x257fed,_0x3205d0){return db[_0x0a3d('0x31')][_0x0a3d('0x4e')]({'where':{'id':_0x30629d[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x257fed,null))[_0x0a3d('0x2b')](function(_0x19c2fa){if(_0x19c2fa){return _0x19c2fa[_0x0a3d('0x8b')](_0x30629d[_0x0a3d('0x50')][_0x0a3d('0x69')],_['omit'](_0x30629d[_0x0a3d('0x50')],[_0x0a3d('0x69'),'id'])||{})[_0x0a3d('0x8c')](function(_0x49e611){for(var _0x56b8f8=0x0;_0x56b8f8<_0x30629d[_0x0a3d('0x50')]['ids'][_0x0a3d('0x3a')];_0x56b8f8+=0x1){socket[_0x0a3d('0x74')](_0x0a3d('0x8d'),{'UserId':Number(_0x30629d['body'][_0x0a3d('0x69')][_0x56b8f8]),'FaxQueueId':Number(_0x30629d[_0x0a3d('0x5a')]['id'])});}return _0x49e611;});}})[_0x0a3d('0x2b')](respondWithResult(_0x257fed,null))[_0x0a3d('0x4a')](handleError(_0x257fed,null));};exports[_0x0a3d('0x89')]=function(_0x579a88,_0x4343fa,_0xf8df00){return db['FaxQueue'][_0x0a3d('0x4e')]({'where':{'id':_0x579a88[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x4343fa,null))['then'](function(_0x35f15c){if(_0x35f15c){return _0x35f15c['removeAgents'](_0x579a88[_0x0a3d('0x35')][_0x0a3d('0x69')])[_0x0a3d('0x2b')](function(){if(_[_0x0a3d('0x8e')](_0x579a88[_0x0a3d('0x35')][_0x0a3d('0x69')])){for(var _0x214678=0x0;_0x214678<_0x579a88['query'][_0x0a3d('0x69')]['length'];_0x214678+=0x1){socket[_0x0a3d('0x74')](_0x0a3d('0x8a'),{'UserId':Number(_0x579a88['query'][_0x0a3d('0x69')][_0x214678]),'FaxQueueId':Number(_0x579a88[_0x0a3d('0x5a')]['id'])});}}else{socket[_0x0a3d('0x74')](_0x0a3d('0x8a'),{'UserId':Number(_0x579a88[_0x0a3d('0x35')][_0x0a3d('0x69')]),'FaxQueueId':Number(_0x579a88[_0x0a3d('0x5a')]['id'])});}});}})[_0x0a3d('0x2b')](respondWithStatusCode(_0x4343fa,null))[_0x0a3d('0x4a')](handleError(_0x4343fa,null));};exports[_0x0a3d('0x8f')]=function(_0x33eb70,_0x4ef90c,_0x34e7c7){var _0x5506dc={};var _0x277cfb={};var _0x1c5d2f;var _0x86b58e;return db[_0x0a3d('0x31')][_0x0a3d('0x5c')]({'where':{'id':_0x33eb70[_0x0a3d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ef90c,null))[_0x0a3d('0x2b')](function(_0x30151f){if(_0x30151f){_0x1c5d2f=_0x30151f;_0x277cfb[_0x0a3d('0x34')]=_[_0x0a3d('0x36')](db[_0x0a3d('0x5e')][_0x0a3d('0x4c')]);_0x277cfb[_0x0a3d('0x35')]=_['keys'](_0x33eb70[_0x0a3d('0x35')]);_0x277cfb[_0x0a3d('0x41')]=_[_0x0a3d('0x37')](_0x277cfb[_0x0a3d('0x34')],_0x277cfb[_0x0a3d('0x35')]);_0x5506dc['attributes']=_[_0x0a3d('0x37')](_0x277cfb[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x33eb70[_0x0a3d('0x35')][_0x0a3d('0x39')]));_0x5506dc[_0x0a3d('0x38')]=_0x5506dc[_0x0a3d('0x38')]['length']?_0x5506dc['attributes']:_0x277cfb[_0x0a3d('0x34')];_0x5506dc['order']=qs[_0x0a3d('0x3e')](_0x33eb70['query'][_0x0a3d('0x3e')]);_0x5506dc[_0x0a3d('0x3f')]=qs[_0x0a3d('0x41')](_['pick'](_0x33eb70['query'],_0x277cfb[_0x0a3d('0x41')]));if(_0x33eb70[_0x0a3d('0x35')][_0x0a3d('0x42')]){_0x5506dc['where']=_[_0x0a3d('0x4d')](_0x5506dc[_0x0a3d('0x3f')],{'$or':_['map'](_0x5506dc[_0x0a3d('0x38')],function(_0x3dc2de){var _0x4f5fca={};_0x4f5fca[_0x3dc2de]={'$like':'%'+_0x33eb70[_0x0a3d('0x35')][_0x0a3d('0x42')]+'%'};return _0x4f5fca;})});}_0x5506dc=_[_0x0a3d('0x4d')]({},_0x5506dc,_0x33eb70['options']);return _0x1c5d2f['getAgents'](_0x5506dc);}})['then'](function(_0xc91463){if(_0xc91463){_0x86b58e=_0xc91463[_0x0a3d('0x3a')];if(!_0x33eb70[_0x0a3d('0x35')]['hasOwnProperty'](_0x0a3d('0x3c'))){_0x5506dc[_0x0a3d('0x21')]=qs[_0x0a3d('0x21')](_0x33eb70[_0x0a3d('0x35')]['limit']);_0x5506dc[_0x0a3d('0x20')]=qs['offset'](_0x33eb70[_0x0a3d('0x35')][_0x0a3d('0x20')]);}return _0x1c5d2f[_0x0a3d('0x8f')](_0x5506dc);}})[_0x0a3d('0x2b')](function(_0x3c3dc2){if(_0x3c3dc2){return _0x3c3dc2?{'count':_0x86b58e,'rows':_0x3c3dc2}:null;}})[_0x0a3d('0x2b')](respondWithResult(_0x4ef90c,null))['catch'](handleError(_0x4ef90c,null));};
\ No newline at end of file
index db0d72c..7d600d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbe7=['exports','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4f121c,_0x221a2c){var _0x230bf6=function(_0x3cd9a6){while(--_0x3cd9a6){_0x4f121c['push'](_0x4f121c['shift']());}};_0x230bf6(++_0x221a2c);}(_0xdbe7,0x123));var _0x7dbe=function(_0x2d46fb,_0x455344){_0x2d46fb=_0x2d46fb-0x0;var _0x44cf24=_0xdbe7[_0x2d46fb];return _0x44cf24;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x7dbe('0x0'))['db'][_0x7dbe('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7dbe('0x2')](0x0);var events={'afterCreate':_0x7dbe('0x3'),'afterUpdate':_0x7dbe('0x4'),'afterDestroy':_0x7dbe('0x5')};function emitEvent(_0x1c606a){return function(_0x228178,_0x5cb553,_0xe3ab32){FaxQueueEvents[_0x7dbe('0x6')](_0x1c606a+':'+_0x228178['id'],_0x228178);FaxQueueEvents[_0x7dbe('0x6')](_0x1c606a,_0x228178);_0xe3ab32(null);};}for(var e in events){if(events[_0x7dbe('0x7')](e)){var event=events[e];FaxQueue[_0x7dbe('0x8')](e,emitEvent(event));}}module[_0x7dbe('0x9')]=FaxQueueEvents;
\ No newline at end of file
+var _0x2ef7=['remove','emit','events','../../mysqldb','FaxQueue'];(function(_0x2af1f4,_0xec83fc){var _0x46f2fd=function(_0x28a9dd){while(--_0x28a9dd){_0x2af1f4['push'](_0x2af1f4['shift']());}};_0x46f2fd(++_0xec83fc);}(_0x2ef7,0xe3));var _0x72ef=function(_0x21400a,_0x5c767a){_0x21400a=_0x21400a-0x0;var _0x5cdc02=_0x2ef7[_0x21400a];return _0x5cdc02;};'use strict';var EventEmitter=require(_0x72ef('0x0'));var FaxQueue=require(_0x72ef('0x1'))['db'][_0x72ef('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x72ef('0x3')};function emitEvent(_0x7480d6){return function(_0x2edd22,_0x5168ea,_0x115d55){FaxQueueEvents[_0x72ef('0x4')](_0x7480d6+':'+_0x2edd22['id'],_0x2edd22);FaxQueueEvents[_0x72ef('0x4')](_0x7480d6,_0x2edd22);_0x115d55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index 731d6cb..8478e65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec3c=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x487890,_0x3d313e){var _0x2a0d63=function(_0x3174c9){while(--_0x3174c9){_0x487890['push'](_0x487890['shift']());}};_0x2a0d63(++_0x3d313e);}(_0xec3c,0x1af));var _0xcec3=function(_0x34828a,_0x83f9b2){_0x34828a=_0x34828a-0x0;var _0x899b52=_0xec3c[_0x34828a];return _0x899b52;};'use strict';var _=require(_0xcec3('0x0'));var util=require(_0xcec3('0x1'));var logger=require(_0xcec3('0x2'))(_0xcec3('0x3'));var moment=require(_0xcec3('0x4'));var BPromise=require(_0xcec3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcec3('0x6'));var rimraf=require(_0xcec3('0x7'));var config=require(_0xcec3('0x8'));var attributes=require('./faxQueue.attributes');module[_0xcec3('0x9')]=function(_0x141a33,_0x196c16){return _0x141a33[_0xcec3('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16f3=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x16f3,0xb4));var _0x316f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16f3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x316f('0x0'));var logger=require(_0x316f('0x1'))('api');var moment=require(_0x316f('0x2'));var BPromise=require(_0x316f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x316f('0x4'));var rimraf=require(_0x316f('0x5'));var config=require(_0x316f('0x6'));var attributes=require(_0x316f('0x7'));module[_0x316f('0x8')]=function(_0x48ab64,_0x112486){return _0x48ab64[_0x316f('0x9')](_0x316f('0xa'),attributes,{'tableName':_0x316f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 71d9764..436734f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa639=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowFaxQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xa639,0xa6));var _0x9a63=function(_0x2ac13b,_0x1d5124){_0x2ac13b=_0x2ac13b-0x0;var _0x5e2712=_0xa639[_0x2ac13b];return _0x5e2712;};'use strict';var _=require(_0x9a63('0x0'));var util=require(_0x9a63('0x1'));var moment=require('moment');var BPromise=require(_0x9a63('0x2'));var rs=require(_0x9a63('0x3'));var fs=require('fs');var Redis=require(_0x9a63('0x4'));var db=require(_0x9a63('0x5'))['db'];var utils=require(_0x9a63('0x6'));var logger=require(_0x9a63('0x7'))(_0x9a63('0x8'));var config=require(_0x9a63('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9a63('0xa')][_0x9a63('0xb')]({'port':0x232a});config[_0x9a63('0xc')]=_[_0x9a63('0xd')](config[_0x9a63('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a63('0xe'))(new Redis(config[_0x9a63('0xc')]));require(_0x9a63('0xf'))[_0x9a63('0x10')](socket);function respondWithRpcPromise(_0x32fea1,_0x57aac3,_0xd6a633){return new BPromise(function(_0x40fe68,_0x2282e4){return client[_0x9a63('0x11')](_0x32fea1,_0xd6a633)[_0x9a63('0x12')](function(_0x1da841){logger['info'](_0x9a63('0x13'),_0x57aac3,_0x9a63('0x14'));logger[_0x9a63('0x15')](_0x9a63('0x16'),_0x57aac3,'request\x20sent',JSON[_0x9a63('0x17')](_0x1da841));if(_0x1da841[_0x9a63('0x18')]){if(_0x1da841[_0x9a63('0x18')][_0x9a63('0x19')]===0x1f4){logger[_0x9a63('0x18')](_0x9a63('0x13'),_0x57aac3,_0x1da841[_0x9a63('0x18')]['message']);return _0x2282e4(_0x1da841[_0x9a63('0x18')]['message']);}logger[_0x9a63('0x18')](_0x9a63('0x13'),_0x57aac3,_0x1da841[_0x9a63('0x18')][_0x9a63('0x1a')]);return _0x40fe68(_0x1da841['error'][_0x9a63('0x1a')]);}else{logger[_0x9a63('0x1b')](_0x9a63('0x13'),_0x57aac3,_0x9a63('0x14'));_0x40fe68(_0x1da841[_0x9a63('0x1c')][_0x9a63('0x1a')]);}})[_0x9a63('0x1d')](function(_0x51c090){logger[_0x9a63('0x18')](_0x9a63('0x13'),_0x57aac3,_0x51c090);_0x2282e4(_0x51c090);});});}exports[_0x9a63('0x1e')]=function(_0x2440ea){var _0x318eb2=this;return new Promise(function(_0x310855,_0x49f989){return db[_0x9a63('0x1f')][_0x9a63('0x20')]({'raw':_0x2440ea[_0x9a63('0x21')]?_0x2440ea['options'][_0x9a63('0x22')]===undefined?!![]:![]:!![],'where':_0x2440ea[_0x9a63('0x21')]?_0x2440ea[_0x9a63('0x21')][_0x9a63('0x23')]||null:null,'attributes':_0x2440ea[_0x9a63('0x21')]?_0x2440ea[_0x9a63('0x21')][_0x9a63('0x24')]||null:null,'limit':_0x2440ea[_0x9a63('0x21')]?_0x2440ea[_0x9a63('0x21')][_0x9a63('0x25')]||null:null,'include':_0x2440ea[_0x9a63('0x21')]?_0x2440ea['options']['include']?_[_0x9a63('0x26')](_0x2440ea['options'][_0x9a63('0x27')],function(_0x4c0795){return{'model':db[_0x4c0795[_0x9a63('0x28')]],'as':_0x4c0795['as'],'attributes':_0x4c0795[_0x9a63('0x24')],'include':_0x4c0795[_0x9a63('0x27')]?_[_0x9a63('0x26')](_0x4c0795[_0x9a63('0x27')],function(_0x5d979e){return{'model':db[_0x5d979e['model']],'as':_0x5d979e['as'],'attributes':_0x5d979e[_0x9a63('0x24')],'include':_0x5d979e['include']?_[_0x9a63('0x26')](_0x5d979e['include'],function(_0x54c469){return{'model':db[_0x54c469[_0x9a63('0x28')]],'as':_0x54c469['as'],'attributes':_0x54c469[_0x9a63('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c0f7b){logger[_0x9a63('0x1b')]('GetFaxQueue',_0x2440ea);logger[_0x9a63('0x15')](_0x9a63('0x1e'),_0x2440ea,JSON[_0x9a63('0x17')](_0x2c0f7b));_0x310855(_0x2c0f7b);})[_0x9a63('0x1d')](function(_0xd8e232){logger[_0x9a63('0x18')](_0x9a63('0x1e'),_0xd8e232[_0x9a63('0x1a')],_0x2440ea);_0x49f989(_0x318eb2[_0x9a63('0x18')](0x1f4,_0xd8e232[_0x9a63('0x1a')]));});});};exports[_0x9a63('0x29')]=function(_0x397712){var _0x3a16da=this;return new Promise(function(_0x1ae5d8,_0x54a520){return db['FaxQueue'][_0x9a63('0x2a')]({'raw':_0x397712['options']?_0x397712[_0x9a63('0x21')][_0x9a63('0x22')]===undefined?!![]:![]:!![],'where':_0x397712['options']?_0x397712[_0x9a63('0x21')]['where']||null:null,'attributes':_0x397712[_0x9a63('0x21')]?_0x397712[_0x9a63('0x21')][_0x9a63('0x24')]||null:null,'include':_0x397712[_0x9a63('0x21')]?_0x397712[_0x9a63('0x21')]['include']?_['map'](_0x397712[_0x9a63('0x21')][_0x9a63('0x27')],function(_0x1b859c){return{'model':db[_0x1b859c[_0x9a63('0x28')]],'as':_0x1b859c['as'],'attributes':_0x1b859c[_0x9a63('0x24')],'include':_0x1b859c[_0x9a63('0x27')]?_[_0x9a63('0x26')](_0x1b859c[_0x9a63('0x27')],function(_0xbb795d){return{'model':db[_0xbb795d[_0x9a63('0x28')]],'as':_0xbb795d['as'],'attributes':_0xbb795d['attributes'],'include':_0xbb795d[_0x9a63('0x27')]?_[_0x9a63('0x26')](_0xbb795d[_0x9a63('0x27')],function(_0x575c54){return{'model':db[_0x575c54[_0x9a63('0x28')]],'as':_0x575c54['as'],'attributes':_0x575c54['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a63('0x12')](function(_0x1bdb19){logger[_0x9a63('0x1b')]('ShowFaxQueue',_0x397712);logger['debug'](_0x9a63('0x29'),_0x397712,JSON[_0x9a63('0x17')](_0x1bdb19));_0x1ae5d8(_0x1bdb19);})['catch'](function(_0x231c17){logger[_0x9a63('0x18')](_0x9a63('0x29'),_0x231c17[_0x9a63('0x1a')],_0x397712);_0x54a520(_0x3a16da['error'](0x1f4,_0x231c17['message']));});});};
\ No newline at end of file
+var _0x1f2b=['code','message','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','GetFaxQueue','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4990f6,_0xeed40c){var _0x16ce29=function(_0x12b458){while(--_0x12b458){_0x4990f6['push'](_0x4990f6['shift']());}};_0x16ce29(++_0xeed40c);}(_0x1f2b,0x137));var _0xb1f2=function(_0xa74cca,_0x5d4ee1){_0xa74cca=_0xa74cca-0x0;var _0x46bc82=_0x1f2b[_0xa74cca];return _0x46bc82;};'use strict';var _=require(_0xb1f2('0x0'));var util=require(_0xb1f2('0x1'));var moment=require(_0xb1f2('0x2'));var BPromise=require(_0xb1f2('0x3'));var rs=require(_0xb1f2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1f2('0x5'))['db'];var utils=require(_0xb1f2('0x6'));var logger=require(_0xb1f2('0x7'))(_0xb1f2('0x8'));var config=require(_0xb1f2('0x9'));var jayson=require(_0xb1f2('0xa'));var client=jayson[_0xb1f2('0xb')][_0xb1f2('0xc')]({'port':0x232a});config[_0xb1f2('0xd')]=_[_0xb1f2('0xe')](config[_0xb1f2('0xd')],{'host':_0xb1f2('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb1f2('0x10'))[_0xb1f2('0x11')](socket);function respondWithRpcPromise(_0x5da319,_0x24be81,_0x85dcb0){return new BPromise(function(_0x4471f4,_0x309785){return client['request'](_0x5da319,_0x85dcb0)[_0xb1f2('0x12')](function(_0x9ee061){logger[_0xb1f2('0x13')](_0xb1f2('0x14'),_0x24be81,'request\x20sent');logger['debug'](_0xb1f2('0x15'),_0x24be81,_0xb1f2('0x16'),JSON[_0xb1f2('0x17')](_0x9ee061));if(_0x9ee061[_0xb1f2('0x18')]){if(_0x9ee061['error'][_0xb1f2('0x19')]===0x1f4){logger['error'](_0xb1f2('0x14'),_0x24be81,_0x9ee061['error'][_0xb1f2('0x1a')]);return _0x309785(_0x9ee061[_0xb1f2('0x18')][_0xb1f2('0x1a')]);}logger[_0xb1f2('0x18')]('FaxQueue,\x20%s,\x20%s',_0x24be81,_0x9ee061[_0xb1f2('0x18')][_0xb1f2('0x1a')]);return _0x4471f4(_0x9ee061['error']['message']);}else{logger['info'](_0xb1f2('0x14'),_0x24be81,_0xb1f2('0x16'));_0x4471f4(_0x9ee061['result'][_0xb1f2('0x1a')]);}})[_0xb1f2('0x1b')](function(_0x5ef674){logger[_0xb1f2('0x18')](_0xb1f2('0x14'),_0x24be81,_0x5ef674);_0x309785(_0x5ef674);});});}exports['GetFaxQueue']=function(_0x231a99){var _0x30f4b8=this;return new Promise(function(_0x4e7ade,_0x3fdf2f){return db[_0xb1f2('0x1c')][_0xb1f2('0x1d')]({'raw':_0x231a99['options']?_0x231a99[_0xb1f2('0x1e')][_0xb1f2('0x1f')]===undefined?!![]:![]:!![],'where':_0x231a99[_0xb1f2('0x1e')]?_0x231a99[_0xb1f2('0x1e')][_0xb1f2('0x20')]||null:null,'attributes':_0x231a99[_0xb1f2('0x1e')]?_0x231a99['options'][_0xb1f2('0x21')]||null:null,'limit':_0x231a99[_0xb1f2('0x1e')]?_0x231a99['options'][_0xb1f2('0x22')]||null:null,'include':_0x231a99[_0xb1f2('0x1e')]?_0x231a99[_0xb1f2('0x1e')][_0xb1f2('0x23')]?_['map'](_0x231a99['options'][_0xb1f2('0x23')],function(_0x134f75){return{'model':db[_0x134f75[_0xb1f2('0x24')]],'as':_0x134f75['as'],'attributes':_0x134f75[_0xb1f2('0x21')],'include':_0x134f75[_0xb1f2('0x23')]?_[_0xb1f2('0x25')](_0x134f75['include'],function(_0xd318f8){return{'model':db[_0xd318f8[_0xb1f2('0x24')]],'as':_0xd318f8['as'],'attributes':_0xd318f8[_0xb1f2('0x21')],'include':_0xd318f8[_0xb1f2('0x23')]?_[_0xb1f2('0x25')](_0xd318f8['include'],function(_0x512761){return{'model':db[_0x512761[_0xb1f2('0x24')]],'as':_0x512761['as'],'attributes':_0x512761[_0xb1f2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb1f2('0x12')](function(_0x10622d){logger[_0xb1f2('0x13')]('GetFaxQueue',_0x231a99);logger[_0xb1f2('0x26')](_0xb1f2('0x27'),_0x231a99,JSON[_0xb1f2('0x17')](_0x10622d));_0x4e7ade(_0x10622d);})[_0xb1f2('0x1b')](function(_0x11bf3b){logger[_0xb1f2('0x18')](_0xb1f2('0x27'),_0x11bf3b[_0xb1f2('0x1a')],_0x231a99);_0x3fdf2f(_0x30f4b8['error'](0x1f4,_0x11bf3b['message']));});});};exports[_0xb1f2('0x28')]=function(_0x432e19){var _0x1208fb=this;return new Promise(function(_0x5d10fe,_0x5854d8){return db[_0xb1f2('0x1c')][_0xb1f2('0x29')]({'raw':_0x432e19[_0xb1f2('0x1e')]?_0x432e19[_0xb1f2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x432e19[_0xb1f2('0x1e')]?_0x432e19['options'][_0xb1f2('0x20')]||null:null,'attributes':_0x432e19['options']?_0x432e19[_0xb1f2('0x1e')][_0xb1f2('0x21')]||null:null,'include':_0x432e19[_0xb1f2('0x1e')]?_0x432e19[_0xb1f2('0x1e')][_0xb1f2('0x23')]?_['map'](_0x432e19[_0xb1f2('0x1e')][_0xb1f2('0x23')],function(_0x4b3e7a){return{'model':db[_0x4b3e7a[_0xb1f2('0x24')]],'as':_0x4b3e7a['as'],'attributes':_0x4b3e7a[_0xb1f2('0x21')],'include':_0x4b3e7a['include']?_[_0xb1f2('0x25')](_0x4b3e7a[_0xb1f2('0x23')],function(_0x5f23b3){return{'model':db[_0x5f23b3[_0xb1f2('0x24')]],'as':_0x5f23b3['as'],'attributes':_0x5f23b3['attributes'],'include':_0x5f23b3[_0xb1f2('0x23')]?_[_0xb1f2('0x25')](_0x5f23b3[_0xb1f2('0x23')],function(_0x2ff510){return{'model':db[_0x2ff510[_0xb1f2('0x24')]],'as':_0x2ff510['as'],'attributes':_0x2ff510['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ae320){logger[_0xb1f2('0x13')]('ShowFaxQueue',_0x432e19);logger[_0xb1f2('0x26')](_0xb1f2('0x28'),_0x432e19,JSON['stringify'](_0x5ae320));_0x5d10fe(_0x5ae320);})[_0xb1f2('0x1b')](function(_0x393cb3){logger[_0xb1f2('0x18')](_0xb1f2('0x28'),_0x393cb3['message'],_0x432e19);_0x5854d8(_0x1208fb[_0xb1f2('0x18')](0x1f4,_0x393cb3['message']));});});};
\ No newline at end of file
index 54626fe..50e5f7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b97=['update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','remove'];(function(_0x5c0db8,_0x55103e){var _0x1e27bb=function(_0x51cc62){while(--_0x51cc62){_0x5c0db8['push'](_0x5c0db8['shift']());}};_0x1e27bb(++_0x55103e);}(_0x9b97,0x11e));var _0x79b9=function(_0xd4b04f,_0x456085){_0xd4b04f=_0xd4b04f-0x0;var _0x16bd3f=_0x9b97[_0xd4b04f];return _0x16bd3f;};'use strict';var FaxQueueEvents=require(_0x79b9('0x0'));var events=['save',_0x79b9('0x1'),_0x79b9('0x2')];function createListener(_0x20beff,_0x3079b4){return function(_0x512f1e){_0x3079b4[_0x79b9('0x3')](_0x20beff,_0x512f1e);};}function removeListener(_0x4edfcf,_0x5194ab){return function(){FaxQueueEvents[_0x79b9('0x4')](_0x4edfcf,_0x5194ab);};}exports[_0x79b9('0x5')]=function(_0x71521c){for(var _0x53ad97=0x0,_0x2312c8=events[_0x79b9('0x6')];_0x53ad97<_0x2312c8;_0x53ad97++){var _0x581e1d=events[_0x53ad97];var _0x35c2c9=createListener(_0x79b9('0x7')+_0x581e1d,_0x71521c);FaxQueueEvents['on'](_0x581e1d,_0x35c2c9);}};
\ No newline at end of file
+var _0xbb85=['register','length','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x364b9e,_0x1ec0a8){var _0x16fac1=function(_0x33ec07){while(--_0x33ec07){_0x364b9e['push'](_0x364b9e['shift']());}};_0x16fac1(++_0x1ec0a8);}(_0xbb85,0x92));var _0x5bb8=function(_0x501d13,_0x1f320c){_0x501d13=_0x501d13-0x0;var _0x279573=_0xbb85[_0x501d13];return _0x279573;};'use strict';var FaxQueueEvents=require(_0x5bb8('0x0'));var events=[_0x5bb8('0x1'),_0x5bb8('0x2'),_0x5bb8('0x3')];function createListener(_0x4e3e6c,_0x17ab5f){return function(_0x3a5f66){_0x17ab5f[_0x5bb8('0x4')](_0x4e3e6c,_0x3a5f66);};}function removeListener(_0x453f19,_0x31ceda){return function(){FaxQueueEvents[_0x5bb8('0x5')](_0x453f19,_0x31ceda);};}exports[_0x5bb8('0x6')]=function(_0x48ad61){for(var _0x4d208a=0x0,_0x59a54e=events[_0x5bb8('0x7')];_0x4d208a<_0x59a54e;_0x4d208a++){var _0x2b9940=events[_0x4d208a];var _0x5669ce=createListener('faxQueue:'+_0x2b9940,_0x48ad61);FaxQueueEvents['on'](_0x2b9940,_0x5669ce);}};
\ No newline at end of file
index 0716032..3673da9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1c=['/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams'];(function(_0x12a438,_0x1ba982){var _0x3ab338=function(_0x563647){while(--_0x563647){_0x12a438['push'](_0x12a438['shift']());}};_0x3ab338(++_0x1ba982);}(_0xed1c,0xe4));var _0xced1=function(_0x455417,_0x33c9be){_0x455417=_0x455417-0x0;var _0x105ebe=_0xed1c[_0x455417];return _0x105ebe;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0x6')]('/:id/members',auth[_0xced1('0x7')](),controller['getMembers']);router[_0xced1('0x6')](_0xced1('0xd'),auth[_0xced1('0x7')](),controller[_0xced1('0xe')]);router[_0xced1('0x6')](_0xced1('0xf'),auth[_0xced1('0x7')](),controller['getAgents']);router[_0xced1('0x10')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x11')]);router[_0xced1('0x10')]('/:id/teams',auth[_0xced1('0x7')](),controller[_0xced1('0x12')]);router['post'](_0xced1('0xf'),auth[_0xced1('0x7')](),controller[_0xced1('0x13')]);router[_0xced1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xced1('0x15')]);router[_0xced1('0x16')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0x17')]);router[_0xced1('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0xced1('0x18')]);router[_0xced1('0x16')](_0xced1('0xf'),auth['isAuthenticated'](),controller[_0xced1('0x19')]);module[_0xced1('0x1a')]=router;
\ No newline at end of file
+var _0xe5af=['util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents'];(function(_0xaac24,_0x57ce3b){var _0x1fa972=function(_0x133694){while(--_0x133694){_0xaac24['push'](_0xaac24['shift']());}};_0x1fa972(++_0x57ce3b);}(_0xe5af,0x9c));var _0xfe5a=function(_0x40ce9b,_0x5b6f36){_0x40ce9b=_0x40ce9b-0x0;var _0x1a8b8b=_0xe5af[_0x40ce9b];return _0x1a8b8b;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe5a('0x2'));var router=express[_0xfe5a('0x3')]();var fs_extra=require(_0xfe5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe5a('0x5'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xfe5a('0x6')]('/',auth[_0xfe5a('0x7')](),controller['index']);router['get'](_0xfe5a('0x8'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x9')]);router[_0xfe5a('0x6')]('/:id',auth[_0xfe5a('0x7')](),controller['show']);router['get'](_0xfe5a('0xa'),auth[_0xfe5a('0x7')](),controller['getMembers']);router[_0xfe5a('0x6')](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xc')]);router[_0xfe5a('0x6')]('/:id/users',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xd')]);router[_0xfe5a('0xe')]('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xf')]);router['post'](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x10')]);router[_0xfe5a('0xe')](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x12')]);router[_0xfe5a('0x13')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x15')]);router[_0xfe5a('0x16')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x17')]);router[_0xfe5a('0x16')]('/:id/teams',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x18')]);router['delete'](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x19')]);module['exports']=router;
\ No newline at end of file
index 625315d..a0ffaac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c5c=['exports','DATE','sequelize'];(function(_0x3bf285,_0x362b0e){var _0x2c7214=function(_0x4f8bb0){while(--_0x4f8bb0){_0x3bf285['push'](_0x3bf285['shift']());}};_0x2c7214(++_0x362b0e);}(_0x2c5c,0xd4));var _0xc2c5=function(_0x2d9e1e,_0x55fee9){_0x2d9e1e=_0x2d9e1e-0x0;var _0x297222=_0x2c5c[_0x2d9e1e];return _0x297222;};'use strict';var moment=require('moment');var Sequelize=require(_0xc2c5('0x0'));module[_0xc2c5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc2c5('0x2')]},'leaveAt':{'type':Sequelize[_0xc2c5('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf408=['STRING','DATE','moment','sequelize','exports'];(function(_0x101f93,_0x28c3b2){var _0x4f2f3a=function(_0xdead01){while(--_0xdead01){_0x101f93['push'](_0x101f93['shift']());}};_0x4f2f3a(++_0x28c3b2);}(_0xf408,0x1ce));var _0x8f40=function(_0x124298,_0x542004){_0x124298=_0x124298-0x0;var _0x35ac24=_0xf408[_0x124298];return _0x35ac24;};'use strict';var moment=require(_0x8f40('0x0'));var Sequelize=require(_0x8f40('0x1'));module[_0x8f40('0x2')]={'uniqueid':{'type':Sequelize[_0x8f40('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8f40('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8f40('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8f40('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 74b73e7..38aae73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd404=['update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0xa335f8,_0x3b7294){var _0x196866=function(_0x3ff37e){while(--_0x3ff37e){_0xa335f8['push'](_0xa335f8['shift']());}};_0x196866(++_0x3b7294);}(_0xd404,0x15b));var _0x4d40=function(_0x572108,_0x1df002){_0x572108=_0x572108-0x0;var _0x9bc7fb=_0xd404[_0x572108];return _0x9bc7fb;};'use strict';var emlformat=require(_0x4d40('0x0'));var rimraf=require(_0x4d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d40('0x2'));var rp=require(_0x4d40('0x3'));var moment=require('moment');var BPromise=require(_0x4d40('0x4'));var Mustache=require(_0x4d40('0x5'));var util=require(_0x4d40('0x6'));var path=require(_0x4d40('0x7'));var sox=require(_0x4d40('0x8'));var csv=require(_0x4d40('0x9'));var ejs=require(_0x4d40('0xa'));var fs=require('fs');var fs_extra=require(_0x4d40('0xb'));var _=require(_0x4d40('0xc'));var squel=require('squel');var crypto=require(_0x4d40('0xd'));var jsforce=require(_0x4d40('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d40('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d40('0xf'));var authService=require(_0x4d40('0x10'));var qs=require(_0x4d40('0x11'));var as=require(_0x4d40('0x12'));var hardwareService=require(_0x4d40('0x13'));var logger=require(_0x4d40('0x14'))(_0x4d40('0x15'));var utils=require(_0x4d40('0x16'));var config=require(_0x4d40('0x17'));var licenseUtil=require(_0x4d40('0x18'));var db=require(_0x4d40('0x19'))['db'];function respondWithStatusCode(_0x3c3b7e,_0x28e5bf){_0x28e5bf=_0x28e5bf||0xcc;return function(_0x42a621){if(_0x42a621){return _0x3c3b7e['sendStatus'](_0x28e5bf);}return _0x3c3b7e[_0x4d40('0x1a')](_0x28e5bf)[_0x4d40('0x1b')]();};}function respondWithResult(_0x3b071b,_0x2083bd){_0x2083bd=_0x2083bd||0xc8;return function(_0x477a91){if(_0x477a91){return _0x3b071b['status'](_0x2083bd)[_0x4d40('0x1c')](_0x477a91);}};}function respondWithFilteredResult(_0x4077ce,_0x20bc1b){return function(_0xcee25a){if(_0xcee25a){var _0x453857=typeof _0x20bc1b[_0x4d40('0x1d')]===_0x4d40('0x1e')&&typeof _0x20bc1b[_0x4d40('0x1f')]===_0x4d40('0x1e');var _0x4b5d23=_0xcee25a['count'];var _0x1ae5c7=_0x453857?0x0:_0x20bc1b[_0x4d40('0x1d')];var _0x4e505f=_0x453857?_0xcee25a[_0x4d40('0x20')]:_0x20bc1b[_0x4d40('0x1d')]+_0x20bc1b['limit'];var _0x36d031;if(_0x4e505f>=_0x4b5d23){_0x4e505f=_0x4b5d23;_0x36d031=0xc8;}else{_0x36d031=0xce;}_0x4077ce['status'](_0x36d031);return _0x4077ce[_0x4d40('0x21')](_0x4d40('0x22'),_0x1ae5c7+'-'+_0x4e505f+'/'+_0x4b5d23)['json'](_0xcee25a);}return null;};}function patchUpdates(_0x57c997){return function(_0x375ce0){try{jsonpatch[_0x4d40('0x23')](_0x375ce0,_0x57c997,!![]);}catch(_0x4d52ce){return BPromise[_0x4d40('0x24')](_0x4d52ce);}return _0x375ce0[_0x4d40('0x25')]();};}function saveUpdates(_0x30f058,_0x5d4c24){return function(_0x356fd6){if(_0x356fd6){return _0x356fd6[_0x4d40('0x26')](_0x30f058)[_0x4d40('0x27')](function(_0x5ca0a0){return _0x5ca0a0;});}return null;};}function removeEntity(_0x4eebc3,_0x2df33a){return function(_0x90b652){if(_0x90b652){return _0x90b652[_0x4d40('0x28')]()[_0x4d40('0x27')](function(){_0x4eebc3[_0x4d40('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbcd540,_0x1f5e5b){return function(_0x560df8){if(!_0x560df8){_0xbcd540['sendStatus'](0x194);}return _0x560df8;};}function handleError(_0x274d44,_0x2a0c82){_0x2a0c82=_0x2a0c82||0x1f4;return function(_0x3fa83e){logger[_0x4d40('0x29')](_0x3fa83e[_0x4d40('0x2a')]);if(_0x3fa83e[_0x4d40('0x2b')]){delete _0x3fa83e[_0x4d40('0x2b')];}_0x274d44[_0x4d40('0x1a')](_0x2a0c82)[_0x4d40('0x2c')](_0x3fa83e);};}exports[_0x4d40('0x2d')]=function(_0x1c0fcf,_0x4ca431){var _0x4e4e61={},_0x52f706={},_0x158a86={'count':0x0,'rows':[]};var _0x350488=_[_0x4d40('0x2e')](db[_0x4d40('0x2f')]['rawAttributes'],function(_0x18e601){return{'name':_0x18e601[_0x4d40('0x30')],'type':_0x18e601[_0x4d40('0x31')]['key']};});_0x52f706[_0x4d40('0x32')]=_[_0x4d40('0x2e')](_0x350488,_0x4d40('0x2b'));_0x52f706[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x1c0fcf['query']);_0x52f706[_0x4d40('0x35')]=_['intersection'](_0x52f706[_0x4d40('0x32')],_0x52f706[_0x4d40('0x33')]);_0x4e4e61[_0x4d40('0x36')]=_[_0x4d40('0x37')](_0x52f706['model'],qs['fields'](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x38')]));_0x4e4e61[_0x4d40('0x36')]=_0x4e4e61[_0x4d40('0x36')]['length']?_0x4e4e61[_0x4d40('0x36')]:_0x52f706['model'];if(!_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x39')](_0x4d40('0x3a'))){_0x4e4e61[_0x4d40('0x1f')]=qs[_0x4d40('0x1f')](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x1f')]);_0x4e4e61[_0x4d40('0x1d')]=qs[_0x4d40('0x1d')](_0x1c0fcf[_0x4d40('0x33')]['offset']);}_0x4e4e61[_0x4d40('0x3b')]=qs[_0x4d40('0x3c')](_0x1c0fcf['query']['sort']);_0x4e4e61['where']=qs[_0x4d40('0x35')](_[_0x4d40('0x3d')](_0x1c0fcf['query'],_0x52f706[_0x4d40('0x35')]),_0x350488);if(_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x3e')]){_0x4e4e61[_0x4d40('0x3f')]=_[_0x4d40('0x40')](_0x4e4e61['where'],{'$or':_[_0x4d40('0x2e')](_0x350488,function(_0x21a4ec){if(_0x21a4ec['type']!=='VIRTUAL'){var _0x3a4924={};_0x3a4924[_0x21a4ec[_0x4d40('0x2b')]]={'$like':'%'+_0x1c0fcf['query'][_0x4d40('0x3e')]+'%'};return _0x3a4924;}})});}_0x4e4e61=_[_0x4d40('0x40')]({},_0x4e4e61,_0x1c0fcf['options']);var _0x1e8427={'where':_0x4e4e61[_0x4d40('0x3f')]};return db['FaxQueueReport'][_0x4d40('0x20')](_0x1e8427)[_0x4d40('0x27')](function(_0x4841ac){_0x158a86[_0x4d40('0x20')]=_0x4841ac;if(_0x1c0fcf['query'][_0x4d40('0x41')]){_0x4e4e61[_0x4d40('0x42')]=[{'all':!![]}];}return db[_0x4d40('0x2f')][_0x4d40('0x43')](_0x4e4e61);})[_0x4d40('0x27')](function(_0x2ef0ca){_0x158a86[_0x4d40('0x44')]=_0x2ef0ca;return _0x158a86;})[_0x4d40('0x27')](respondWithFilteredResult(_0x4ca431,_0x4e4e61))[_0x4d40('0x45')](handleError(_0x4ca431,null));};exports['show']=function(_0x250847,_0x3718a8){var _0x1c2fa8={'raw':!![],'where':{'id':_0x250847[_0x4d40('0x46')]['id']}},_0xcdde22={};_0xcdde22['model']=_[_0x4d40('0x34')](db['FaxQueueReport'][_0x4d40('0x47')]);_0xcdde22[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x250847[_0x4d40('0x33')]);_0xcdde22['filters']=_[_0x4d40('0x37')](_0xcdde22[_0x4d40('0x32')],_0xcdde22['query']);_0x1c2fa8[_0x4d40('0x36')]=_['intersection'](_0xcdde22[_0x4d40('0x32')],qs[_0x4d40('0x38')](_0x250847[_0x4d40('0x33')][_0x4d40('0x38')]));_0x1c2fa8['attributes']=_0x1c2fa8[_0x4d40('0x36')]['length']?_0x1c2fa8[_0x4d40('0x36')]:_0xcdde22[_0x4d40('0x32')];if(_0x250847[_0x4d40('0x33')][_0x4d40('0x41')]){_0x1c2fa8['include']=[{'all':!![]}];}_0x1c2fa8=_[_0x4d40('0x40')]({},_0x1c2fa8,_0x250847[_0x4d40('0x48')]);return db[_0x4d40('0x2f')][_0x4d40('0x49')](_0x1c2fa8)['then'](handleEntityNotFound(_0x3718a8,null))[_0x4d40('0x27')](respondWithResult(_0x3718a8,null))[_0x4d40('0x45')](handleError(_0x3718a8,null));};exports['create']=function(_0x200d29,_0x493d8e){return db[_0x4d40('0x2f')][_0x4d40('0x4a')](_0x200d29[_0x4d40('0x4b')],{})[_0x4d40('0x27')](respondWithResult(_0x493d8e,0xc9))[_0x4d40('0x45')](handleError(_0x493d8e,null));};exports[_0x4d40('0x26')]=function(_0x30be7b,_0x37b6bf){if(_0x30be7b[_0x4d40('0x4b')]['id']){delete _0x30be7b['body']['id'];}return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0x30be7b[_0x4d40('0x46')]['id']}})[_0x4d40('0x27')](handleEntityNotFound(_0x37b6bf,null))[_0x4d40('0x27')](saveUpdates(_0x30be7b['body'],null))[_0x4d40('0x27')](respondWithResult(_0x37b6bf,null))[_0x4d40('0x45')](handleError(_0x37b6bf,null));};exports['destroy']=function(_0xdf0235,_0x48ffd7){return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0xdf0235[_0x4d40('0x46')]['id']}})['then'](handleEntityNotFound(_0x48ffd7,null))[_0x4d40('0x27')](removeEntity(_0x48ffd7,null))[_0x4d40('0x45')](handleError(_0x48ffd7,null));};exports[_0x4d40('0x4c')]=function(_0x55df43,_0xd3e7cd){return db['FaxQueueReport'][_0x4d40('0x4c')]()[_0x4d40('0x27')](respondWithResult(_0xd3e7cd,null))['catch'](handleError(_0xd3e7cd,null));};
\ No newline at end of file
+var _0x559a=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','FaxQueueReport','then','includeAll','include','findAll','catch','show','params','keys','length','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','destroy','end','error','stack','name','index','map'];(function(_0x3edd38,_0x3d9b6b){var _0x23bc04=function(_0x584efa){while(--_0x584efa){_0x3edd38['push'](_0x3edd38['shift']());}};_0x23bc04(++_0x3d9b6b);}(_0x559a,0xb3));var _0xa559=function(_0x528b11,_0x2e7447){_0x528b11=_0x528b11-0x0;var _0x5913ed=_0x559a[_0x528b11];return _0x5913ed;};'use strict';var emlformat=require(_0xa559('0x0'));var rimraf=require(_0xa559('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa559('0x2'));var rp=require(_0xa559('0x3'));var moment=require(_0xa559('0x4'));var BPromise=require(_0xa559('0x5'));var Mustache=require(_0xa559('0x6'));var util=require(_0xa559('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa559('0x8'));var ejs=require(_0xa559('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa559('0xa'));var squel=require(_0xa559('0xb'));var crypto=require('crypto');var jsforce=require(_0xa559('0xc'));var deskjs=require(_0xa559('0xd'));var toCsv=require(_0xa559('0x8'));var querystring=require(_0xa559('0xe'));var Papa=require('papaparse');var Redis=require(_0xa559('0xf'));var authService=require(_0xa559('0x10'));var qs=require(_0xa559('0x11'));var as=require(_0xa559('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa559('0x13'));var utils=require(_0xa559('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa559('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442e26,_0x5f0463){_0x5f0463=_0x5f0463||0xcc;return function(_0x2a646e){if(_0x2a646e){return _0x442e26[_0xa559('0x16')](_0x5f0463);}return _0x442e26[_0xa559('0x17')](_0x5f0463)['end']();};}function respondWithResult(_0xe93c61,_0x3853fd){_0x3853fd=_0x3853fd||0xc8;return function(_0x5ed915){if(_0x5ed915){return _0xe93c61[_0xa559('0x17')](_0x3853fd)[_0xa559('0x18')](_0x5ed915);}};}function respondWithFilteredResult(_0x369d26,_0x1e48b3){return function(_0x539a4b){if(_0x539a4b){var _0x309c27=typeof _0x1e48b3['offset']===_0xa559('0x19')&&typeof _0x1e48b3[_0xa559('0x1a')]==='undefined';var _0x2c6993=_0x539a4b[_0xa559('0x1b')];var _0x163405=_0x309c27?0x0:_0x1e48b3[_0xa559('0x1c')];var _0x1a4c42=_0x309c27?_0x539a4b[_0xa559('0x1b')]:_0x1e48b3[_0xa559('0x1c')]+_0x1e48b3[_0xa559('0x1a')];var _0x329d59;if(_0x1a4c42>=_0x2c6993){_0x1a4c42=_0x2c6993;_0x329d59=0xc8;}else{_0x329d59=0xce;}_0x369d26[_0xa559('0x17')](_0x329d59);return _0x369d26['set']('Content-Range',_0x163405+'-'+_0x1a4c42+'/'+_0x2c6993)[_0xa559('0x18')](_0x539a4b);}return null;};}function patchUpdates(_0x3aa532){return function(_0x47cb65){try{jsonpatch[_0xa559('0x1d')](_0x47cb65,_0x3aa532,!![]);}catch(_0x190a9e){return BPromise[_0xa559('0x1e')](_0x190a9e);}return _0x47cb65[_0xa559('0x1f')]();};}function saveUpdates(_0x1812ef,_0x2dd8cf){return function(_0x572046){if(_0x572046){return _0x572046[_0xa559('0x20')](_0x1812ef)['then'](function(_0x1d4370){return _0x1d4370;});}return null;};}function removeEntity(_0x396fe9,_0x314fef){return function(_0x487a60){if(_0x487a60){return _0x487a60[_0xa559('0x21')]()['then'](function(){_0x396fe9[_0xa559('0x17')](0xcc)[_0xa559('0x22')]();});}};}function handleEntityNotFound(_0x5834c6,_0x2a5181){return function(_0x552c2c){if(!_0x552c2c){_0x5834c6['sendStatus'](0x194);}return _0x552c2c;};}function handleError(_0x1581b9,_0x1914e7){_0x1914e7=_0x1914e7||0x1f4;return function(_0x3fcf7f){logger[_0xa559('0x23')](_0x3fcf7f[_0xa559('0x24')]);if(_0x3fcf7f[_0xa559('0x25')]){delete _0x3fcf7f[_0xa559('0x25')];}_0x1581b9[_0xa559('0x17')](_0x1914e7)['send'](_0x3fcf7f);};}exports[_0xa559('0x26')]=function(_0x30a781,_0x21c8a0){var _0x1c92b9={},_0x5f3fbb={},_0x1fb70f={'count':0x0,'rows':[]};var _0x32db9d=_[_0xa559('0x27')](db['FaxQueueReport'][_0xa559('0x28')],function(_0x224a3a){return{'name':_0x224a3a[_0xa559('0x29')],'type':_0x224a3a[_0xa559('0x2a')][_0xa559('0x2b')]};});_0x5f3fbb[_0xa559('0x2c')]=_[_0xa559('0x27')](_0x32db9d,_0xa559('0x25'));_0x5f3fbb[_0xa559('0x2d')]=_['keys'](_0x30a781[_0xa559('0x2d')]);_0x5f3fbb[_0xa559('0x2e')]=_[_0xa559('0x2f')](_0x5f3fbb[_0xa559('0x2c')],_0x5f3fbb['query']);_0x1c92b9[_0xa559('0x30')]=_['intersection'](_0x5f3fbb[_0xa559('0x2c')],qs[_0xa559('0x31')](_0x30a781[_0xa559('0x2d')][_0xa559('0x31')]));_0x1c92b9[_0xa559('0x30')]=_0x1c92b9[_0xa559('0x30')]['length']?_0x1c92b9[_0xa559('0x30')]:_0x5f3fbb[_0xa559('0x2c')];if(!_0x30a781[_0xa559('0x2d')][_0xa559('0x32')](_0xa559('0x33'))){_0x1c92b9[_0xa559('0x1a')]=qs[_0xa559('0x1a')](_0x30a781[_0xa559('0x2d')]['limit']);_0x1c92b9[_0xa559('0x1c')]=qs[_0xa559('0x1c')](_0x30a781[_0xa559('0x2d')][_0xa559('0x1c')]);}_0x1c92b9[_0xa559('0x34')]=qs[_0xa559('0x35')](_0x30a781[_0xa559('0x2d')]['sort']);_0x1c92b9[_0xa559('0x36')]=qs[_0xa559('0x2e')](_[_0xa559('0x37')](_0x30a781[_0xa559('0x2d')],_0x5f3fbb[_0xa559('0x2e')]),_0x32db9d);if(_0x30a781[_0xa559('0x2d')][_0xa559('0x38')]){_0x1c92b9[_0xa559('0x36')]=_[_0xa559('0x39')](_0x1c92b9[_0xa559('0x36')],{'$or':_[_0xa559('0x27')](_0x32db9d,function(_0x2e9351){if(_0x2e9351[_0xa559('0x2a')]!=='VIRTUAL'){var _0x3e58e3={};_0x3e58e3[_0x2e9351['name']]={'$like':'%'+_0x30a781[_0xa559('0x2d')]['filter']+'%'};return _0x3e58e3;}})});}_0x1c92b9=_[_0xa559('0x39')]({},_0x1c92b9,_0x30a781['options']);var _0x3873c9={'where':_0x1c92b9[_0xa559('0x36')]};return db[_0xa559('0x3a')][_0xa559('0x1b')](_0x3873c9)[_0xa559('0x3b')](function(_0x2efc09){_0x1fb70f[_0xa559('0x1b')]=_0x2efc09;if(_0x30a781['query'][_0xa559('0x3c')]){_0x1c92b9[_0xa559('0x3d')]=[{'all':!![]}];}return db[_0xa559('0x3a')][_0xa559('0x3e')](_0x1c92b9);})[_0xa559('0x3b')](function(_0x278f31){_0x1fb70f['rows']=_0x278f31;return _0x1fb70f;})[_0xa559('0x3b')](respondWithFilteredResult(_0x21c8a0,_0x1c92b9))[_0xa559('0x3f')](handleError(_0x21c8a0,null));};exports[_0xa559('0x40')]=function(_0x429249,_0x5d6325){var _0x6340d3={'raw':!![],'where':{'id':_0x429249[_0xa559('0x41')]['id']}},_0x2af622={};_0x2af622[_0xa559('0x2c')]=_[_0xa559('0x42')](db['FaxQueueReport'][_0xa559('0x28')]);_0x2af622[_0xa559('0x2d')]=_[_0xa559('0x42')](_0x429249[_0xa559('0x2d')]);_0x2af622[_0xa559('0x2e')]=_[_0xa559('0x2f')](_0x2af622[_0xa559('0x2c')],_0x2af622['query']);_0x6340d3[_0xa559('0x30')]=_[_0xa559('0x2f')](_0x2af622[_0xa559('0x2c')],qs[_0xa559('0x31')](_0x429249[_0xa559('0x2d')][_0xa559('0x31')]));_0x6340d3[_0xa559('0x30')]=_0x6340d3[_0xa559('0x30')][_0xa559('0x43')]?_0x6340d3['attributes']:_0x2af622[_0xa559('0x2c')];if(_0x429249[_0xa559('0x2d')][_0xa559('0x3c')]){_0x6340d3[_0xa559('0x3d')]=[{'all':!![]}];}_0x6340d3=_[_0xa559('0x39')]({},_0x6340d3,_0x429249[_0xa559('0x44')]);return db[_0xa559('0x3a')]['find'](_0x6340d3)[_0xa559('0x3b')](handleEntityNotFound(_0x5d6325,null))[_0xa559('0x3b')](respondWithResult(_0x5d6325,null))[_0xa559('0x3f')](handleError(_0x5d6325,null));};exports[_0xa559('0x45')]=function(_0x425dda,_0x482e46){return db[_0xa559('0x3a')][_0xa559('0x45')](_0x425dda['body'],{})[_0xa559('0x3b')](respondWithResult(_0x482e46,0xc9))[_0xa559('0x3f')](handleError(_0x482e46,null));};exports['update']=function(_0x56a722,_0x140490){if(_0x56a722[_0xa559('0x46')]['id']){delete _0x56a722[_0xa559('0x46')]['id'];}return db[_0xa559('0x3a')][_0xa559('0x47')]({'where':{'id':_0x56a722[_0xa559('0x41')]['id']}})['then'](handleEntityNotFound(_0x140490,null))[_0xa559('0x3b')](saveUpdates(_0x56a722['body'],null))['then'](respondWithResult(_0x140490,null))['catch'](handleError(_0x140490,null));};exports[_0xa559('0x21')]=function(_0x2c200e,_0x17453f){return db[_0xa559('0x3a')][_0xa559('0x47')]({'where':{'id':_0x2c200e[_0xa559('0x41')]['id']}})[_0xa559('0x3b')](handleEntityNotFound(_0x17453f,null))[_0xa559('0x3b')](removeEntity(_0x17453f,null))[_0xa559('0x3f')](handleError(_0x17453f,null));};exports[_0xa559('0x48')]=function(_0x3be912,_0x4abc17){return db[_0xa559('0x3a')][_0xa559('0x48')]()[_0xa559('0x3b')](respondWithResult(_0x4abc17,null))[_0xa559('0x3f')](handleError(_0x4abc17,null));};
\ No newline at end of file
index a022f8f..44d882e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x5893db,_0x1836f5){var _0x14218d=function(_0x4bf67d){while(--_0x4bf67d){_0x5893db['push'](_0x5893db['shift']());}};_0x14218d(++_0x1836f5);}(_0x1261,0x144));var _0x1126=function(_0x9e76d,_0x44e7a0){_0x9e76d=_0x9e76d-0x0;var _0x320985=_0x1261[_0x9e76d];return _0x320985;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x35ce78,_0xaaa4ca){var _0x2ce457=function(_0x5a1f34){while(--_0x5a1f34){_0x35ce78['push'](_0x35ce78['shift']());}};_0x2ce457(++_0xaaa4ca);}(_0x326f,0xd1));var _0xf326=function(_0x52f59b,_0x1b5ec9){_0x52f59b=_0x52f59b-0x0;var _0x28632a=_0x326f[_0x52f59b];return _0x28632a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 3d7ae8f..a1411c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7280=['FaxQueueReport','body','options','raw','CreateFaxQueueReport','attributes','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x52c6b7,_0x1b31aa){var _0x3c3ac9=function(_0xc06755){while(--_0xc06755){_0x52c6b7['push'](_0x52c6b7['shift']());}};_0x3c3ac9(++_0x1b31aa);}(_0x7280,0xce));var _0x0728=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x7280[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x0728('0x0'));var util=require(_0x0728('0x1'));var moment=require('moment');var BPromise=require(_0x0728('0x2'));var rs=require(_0x0728('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0728('0x4'))['db'];var utils=require(_0x0728('0x5'));var logger=require(_0x0728('0x6'))(_0x0728('0x7'));var config=require(_0x0728('0x8'));var jayson=require(_0x0728('0x9'));var client=jayson[_0x0728('0xa')][_0x0728('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15e088,_0x59987a,_0x3286b3){return new BPromise(function(_0x26b710,_0x25a13b){return client[_0x0728('0xc')](_0x15e088,_0x3286b3)[_0x0728('0xd')](function(_0x34a189){logger[_0x0728('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x59987a,'request\x20sent');logger[_0x0728('0xf')](_0x0728('0x10'),_0x59987a,_0x0728('0x11'),JSON[_0x0728('0x12')](_0x34a189));if(_0x34a189[_0x0728('0x13')]){if(_0x34a189['error'][_0x0728('0x14')]===0x1f4){logger[_0x0728('0x13')](_0x0728('0x15'),_0x59987a,_0x34a189[_0x0728('0x13')]['message']);return _0x25a13b(_0x34a189[_0x0728('0x13')]['message']);}logger[_0x0728('0x13')](_0x0728('0x15'),_0x59987a,_0x34a189[_0x0728('0x13')][_0x0728('0x16')]);return _0x26b710(_0x34a189[_0x0728('0x13')][_0x0728('0x16')]);}else{logger[_0x0728('0xe')](_0x0728('0x15'),_0x59987a,_0x0728('0x11'));_0x26b710(_0x34a189[_0x0728('0x17')][_0x0728('0x16')]);}})[_0x0728('0x18')](function(_0x44e7a4){logger[_0x0728('0x13')](_0x0728('0x15'),_0x59987a,_0x44e7a4);_0x25a13b(_0x44e7a4);});});}exports['CreateFaxQueueReport']=function(_0xce1280){var _0x590e8c=this;return new Promise(function(_0x462e84,_0x2b5213){return db[_0x0728('0x19')]['create'](_0xce1280[_0x0728('0x1a')],{'raw':_0xce1280['options']?_0xce1280[_0x0728('0x1b')][_0x0728('0x1c')]===undefined?!![]:![]:!![]})[_0x0728('0xd')](function(_0x367a81){logger[_0x0728('0xe')](_0x0728('0x1d'),_0xce1280);logger[_0x0728('0xf')]('CreateFaxQueueReport',_0xce1280,JSON[_0x0728('0x12')](_0x367a81));_0x462e84(_0x367a81);})[_0x0728('0x18')](function(_0x25fad4){logger['error'](_0x0728('0x1d'),_0x25fad4[_0x0728('0x16')],_0xce1280);_0x2b5213(_0x590e8c['error'](0x1f4,_0x25fad4[_0x0728('0x16')]));});});};exports['UpdateFaxQueueReport']=function(_0x115be9){var _0x3b649a=this;return new Promise(function(_0x4dbd89,_0x501ab5){return db[_0x0728('0x19')]['update'](_0x115be9[_0x0728('0x1a')],{'raw':_0x115be9[_0x0728('0x1b')]?_0x115be9[_0x0728('0x1b')][_0x0728('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x115be9[_0x0728('0x1b')]?_0x115be9[_0x0728('0x1b')]['where']||null:null,'attributes':_0x115be9[_0x0728('0x1b')]?_0x115be9['options'][_0x0728('0x1e')]||null:null,'limit':_0x115be9[_0x0728('0x1b')]?_0x115be9[_0x0728('0x1b')][_0x0728('0x1f')]||null:null})[_0x0728('0xd')](function(_0x123cfa){logger[_0x0728('0xe')]('UpdateFaxQueueReport',_0x115be9);logger[_0x0728('0xf')](_0x0728('0x20'),_0x115be9,JSON[_0x0728('0x12')](_0x123cfa));_0x4dbd89(_0x123cfa);})[_0x0728('0x18')](function(_0x44476d){logger['error'](_0x0728('0x20'),_0x44476d[_0x0728('0x16')],_0x115be9);_0x501ab5(_0x3b649a[_0x0728('0x13')](0x1f4,_0x44476d[_0x0728('0x16')]));});});};
\ No newline at end of file
+var _0x1735=['where','attributes','limit','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','FaxQueueReport','body','options','raw','CreateFaxQueueReport','stringify','UpdateFaxQueueReport','update'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x1735,0x1e3));var _0x5173=function(_0x355753,_0x32c6fc){_0x355753=_0x355753-0x0;var _0x35cf36=_0x1735[_0x355753];return _0x35cf36;};'use strict';var _=require(_0x5173('0x0'));var util=require(_0x5173('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5173('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5173('0x3'));var logger=require(_0x5173('0x4'))(_0x5173('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5173('0x6')][_0x5173('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x492549,_0x1a2145,_0xc9f0a0){return new BPromise(function(_0x35de17,_0x35ec61){return client[_0x5173('0x8')](_0x492549,_0xc9f0a0)[_0x5173('0x9')](function(_0x240b3c){logger[_0x5173('0xa')](_0x5173('0xb'),_0x1a2145,_0x5173('0xc'));logger[_0x5173('0xd')](_0x5173('0xe'),_0x1a2145,_0x5173('0xc'),JSON['stringify'](_0x240b3c));if(_0x240b3c[_0x5173('0xf')]){if(_0x240b3c[_0x5173('0xf')][_0x5173('0x10')]===0x1f4){logger[_0x5173('0xf')](_0x5173('0xb'),_0x1a2145,_0x240b3c['error'][_0x5173('0x11')]);return _0x35ec61(_0x240b3c[_0x5173('0xf')]['message']);}logger[_0x5173('0xf')](_0x5173('0xb'),_0x1a2145,_0x240b3c[_0x5173('0xf')]['message']);return _0x35de17(_0x240b3c[_0x5173('0xf')][_0x5173('0x11')]);}else{logger[_0x5173('0xa')](_0x5173('0xb'),_0x1a2145,_0x5173('0xc'));_0x35de17(_0x240b3c['result'][_0x5173('0x11')]);}})[_0x5173('0x12')](function(_0x624b56){logger[_0x5173('0xf')](_0x5173('0xb'),_0x1a2145,_0x624b56);_0x35ec61(_0x624b56);});});}exports['CreateFaxQueueReport']=function(_0x692f6a){var _0x532ed4=this;return new Promise(function(_0x14f7dd,_0x2eb29b){return db[_0x5173('0x13')]['create'](_0x692f6a[_0x5173('0x14')],{'raw':_0x692f6a[_0x5173('0x15')]?_0x692f6a[_0x5173('0x15')][_0x5173('0x16')]===undefined?!![]:![]:!![]})[_0x5173('0x9')](function(_0x1b1996){logger[_0x5173('0xa')]('CreateFaxQueueReport',_0x692f6a);logger['debug'](_0x5173('0x17'),_0x692f6a,JSON[_0x5173('0x18')](_0x1b1996));_0x14f7dd(_0x1b1996);})[_0x5173('0x12')](function(_0x2b50de){logger[_0x5173('0xf')]('CreateFaxQueueReport',_0x2b50de[_0x5173('0x11')],_0x692f6a);_0x2eb29b(_0x532ed4[_0x5173('0xf')](0x1f4,_0x2b50de[_0x5173('0x11')]));});});};exports[_0x5173('0x19')]=function(_0x2d1634){var _0xe254ca=this;return new Promise(function(_0x614493,_0x159f87){return db[_0x5173('0x13')][_0x5173('0x1a')](_0x2d1634[_0x5173('0x14')],{'raw':_0x2d1634['options']?_0x2d1634[_0x5173('0x15')][_0x5173('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d1634['options']?_0x2d1634[_0x5173('0x15')][_0x5173('0x1b')]||null:null,'attributes':_0x2d1634[_0x5173('0x15')]?_0x2d1634['options'][_0x5173('0x1c')]||null:null,'limit':_0x2d1634['options']?_0x2d1634[_0x5173('0x15')][_0x5173('0x1d')]||null:null})[_0x5173('0x9')](function(_0x46a5e4){logger[_0x5173('0xa')](_0x5173('0x19'),_0x2d1634);logger[_0x5173('0xd')](_0x5173('0x19'),_0x2d1634,JSON[_0x5173('0x18')](_0x46a5e4));_0x614493(_0x46a5e4);})['catch'](function(_0x36352b){logger['error'](_0x5173('0x19'),_0x36352b[_0x5173('0x11')],_0x2d1634);_0x159f87(_0xe254ca[_0x5173('0xf')](0x1f4,_0x36352b[_0x5173('0x11')]));});});};
\ No newline at end of file
index 7c8a091..c7c6d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19a7=['destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','post','create','put','/:id','update','delete'];(function(_0xc94dac,_0x2d9909){var _0x1ab205=function(_0x4c64a9){while(--_0x4c64a9){_0xc94dac['push'](_0xc94dac['shift']());}};_0x1ab205(++_0x2d9909);}(_0x19a7,0x1ef));var _0x719a=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x19a7[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x719a('0x0'));var util=require(_0x719a('0x1'));var path=require(_0x719a('0x2'));var timeout=require(_0x719a('0x3'));var express=require('express');var router=express[_0x719a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x719a('0x5'));var config=require(_0x719a('0x6'));var controller=require(_0x719a('0x7'));router[_0x719a('0x8')]('/',auth[_0x719a('0x9')](),controller['index']);router[_0x719a('0x8')](_0x719a('0xa'),auth[_0x719a('0x9')](),controller[_0x719a('0xb')]);router[_0x719a('0x8')]('/:id',auth[_0x719a('0x9')](),controller['show']);router[_0x719a('0xc')]('/',auth[_0x719a('0x9')](),controller[_0x719a('0xd')]);router[_0x719a('0xe')](_0x719a('0xf'),auth[_0x719a('0x9')](),controller[_0x719a('0x10')]);router[_0x719a('0x11')](_0x719a('0xf'),auth[_0x719a('0x9')](),controller[_0x719a('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x9f8d=['update','delete','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put'];(function(_0x43ade9,_0xd1b6fa){var _0x56d85a=function(_0x51ece1){while(--_0x51ece1){_0x43ade9['push'](_0x43ade9['shift']());}};_0x56d85a(++_0xd1b6fa);}(_0x9f8d,0x1c5));var _0xd9f8=function(_0x2e952c,_0x273152){_0x2e952c=_0x2e952c-0x0;var _0x3e9a62=_0x9f8d[_0x2e952c];return _0x3e9a62;};'use strict';var multer=require('multer');var util=require(_0xd9f8('0x0'));var path=require(_0xd9f8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd9f8('0x2'));var auth=require(_0xd9f8('0x3'));var interaction=require(_0xd9f8('0x4'));var config=require(_0xd9f8('0x5'));var controller=require(_0xd9f8('0x6'));router[_0xd9f8('0x7')]('/',auth[_0xd9f8('0x8')](),controller['index']);router[_0xd9f8('0x7')](_0xd9f8('0x9'),auth[_0xd9f8('0x8')](),controller['describe']);router[_0xd9f8('0x7')](_0xd9f8('0xa'),auth['isAuthenticated'](),controller[_0xd9f8('0xb')]);router[_0xd9f8('0xc')]('/',auth['isAuthenticated'](),controller[_0xd9f8('0xd')]);router[_0xd9f8('0xe')]('/:id',auth[_0xd9f8('0x8')](),controller[_0xd9f8('0xf')]);router[_0xd9f8('0x10')]('/:id',auth[_0xd9f8('0x8')](),controller['destroy']);module[_0xd9f8('0x11')]=router;
\ No newline at end of file
index 1f7dde7..2634cb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3d6f5f,_0x1551d8){var _0x30efb0=function(_0x310942){while(--_0x310942){_0x3d6f5f['push'](_0x3d6f5f['shift']());}};_0x30efb0(++_0x1551d8);}(_0x008c,0x188));var _0xc008=function(_0x1b2b6a,_0x1ca7c7){_0x1b2b6a=_0x1b2b6a-0x0;var _0x122ea7=_0x008c[_0x1b2b6a];return _0x122ea7;};'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
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2e5fcf,_0x596581){var _0x5f493b=function(_0x3aad45){while(--_0x3aad45){_0x2e5fcf['push'](_0x2e5fcf['shift']());}};_0x5f493b(++_0x596581);}(_0xaa88,0x137));var _0x8aa8=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0xaa88[_0xe719ec];return _0x4842a1;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
index 6a0a294..5ab1a2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d2=['reject','save','update','then','destroy','end','name','index','map','FaxTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply'];(function(_0x41901b,_0x586421){var _0x31dcef=function(_0x4bf9d2){while(--_0x4bf9d2){_0x41901b['push'](_0x41901b['shift']());}};_0x31dcef(++_0x586421);}(_0x77d2,0x70));var _0x277d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x77d2[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x277d('0x0'));var rimraf=require(_0x277d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x277d('0x2'));var rp=require(_0x277d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x277d('0x4'));var util=require(_0x277d('0x5'));var path=require('path');var sox=require(_0x277d('0x6'));var csv=require(_0x277d('0x7'));var ejs=require(_0x277d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x277d('0x9'));var squel=require('squel');var crypto=require(_0x277d('0xa'));var jsforce=require(_0x277d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x277d('0x7'));var querystring=require('querystring');var Papa=require(_0x277d('0xc'));var Redis=require('ioredis');var authService=require(_0x277d('0xd'));var qs=require(_0x277d('0xe'));var as=require(_0x277d('0xf'));var hardwareService=require(_0x277d('0x10'));var logger=require(_0x277d('0x11'))(_0x277d('0x12'));var utils=require(_0x277d('0x13'));var config=require(_0x277d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x277d('0x15'))['db'];function respondWithStatusCode(_0x2c361a,_0x1cd13a){_0x1cd13a=_0x1cd13a||0xcc;return function(_0x17a32b){if(_0x17a32b){return _0x2c361a[_0x277d('0x16')](_0x1cd13a);}return _0x2c361a['status'](_0x1cd13a)['end']();};}function respondWithResult(_0x155ee6,_0x401524){_0x401524=_0x401524||0xc8;return function(_0x303cb0){if(_0x303cb0){return _0x155ee6['status'](_0x401524)['json'](_0x303cb0);}};}function respondWithFilteredResult(_0x1480f1,_0x59365d){return function(_0x15d5f9){if(_0x15d5f9){var _0x48e5a5=typeof _0x59365d[_0x277d('0x17')]===_0x277d('0x18')&&typeof _0x59365d[_0x277d('0x19')]===_0x277d('0x18');var _0x128aff=_0x15d5f9[_0x277d('0x1a')];var _0x5925a9=_0x48e5a5?0x0:_0x59365d['offset'];var _0x1423e4=_0x48e5a5?_0x15d5f9[_0x277d('0x1a')]:_0x59365d['offset']+_0x59365d[_0x277d('0x19')];var _0x1ca18a;if(_0x1423e4>=_0x128aff){_0x1423e4=_0x128aff;_0x1ca18a=0xc8;}else{_0x1ca18a=0xce;}_0x1480f1[_0x277d('0x1b')](_0x1ca18a);return _0x1480f1[_0x277d('0x1c')](_0x277d('0x1d'),_0x5925a9+'-'+_0x1423e4+'/'+_0x128aff)[_0x277d('0x1e')](_0x15d5f9);}return null;};}function patchUpdates(_0x15709e){return function(_0x21fbe2){try{jsonpatch[_0x277d('0x1f')](_0x21fbe2,_0x15709e,!![]);}catch(_0x176b93){return BPromise[_0x277d('0x20')](_0x176b93);}return _0x21fbe2[_0x277d('0x21')]();};}function saveUpdates(_0x2c51df,_0xed1f8b){return function(_0x14819e){if(_0x14819e){return _0x14819e[_0x277d('0x22')](_0x2c51df)[_0x277d('0x23')](function(_0x4caa9e){return _0x4caa9e;});}return null;};}function removeEntity(_0xed5f18,_0x5dbb06){return function(_0x1670fa){if(_0x1670fa){return _0x1670fa[_0x277d('0x24')]()['then'](function(){_0xed5f18[_0x277d('0x1b')](0xcc)[_0x277d('0x25')]();});}};}function handleEntityNotFound(_0x571eb5,_0xf6cf48){return function(_0x510661){if(!_0x510661){_0x571eb5[_0x277d('0x16')](0x194);}return _0x510661;};}function handleError(_0x28ea53,_0xb29c1e){_0xb29c1e=_0xb29c1e||0x1f4;return function(_0x2860e3){logger['error'](_0x2860e3['stack']);if(_0x2860e3['name']){delete _0x2860e3[_0x277d('0x26')];}_0x28ea53[_0x277d('0x1b')](_0xb29c1e)['send'](_0x2860e3);};}exports[_0x277d('0x27')]=function(_0x5d5e83,_0x50b897){var _0xbb0599={},_0x48cf98={},_0x53e4f1={'count':0x0,'rows':[]};var _0x475137=_[_0x277d('0x28')](db[_0x277d('0x29')][_0x277d('0x2a')],function(_0x2b0a4d){return{'name':_0x2b0a4d['fieldName'],'type':_0x2b0a4d['type'][_0x277d('0x2b')]};});_0x48cf98[_0x277d('0x2c')]=_[_0x277d('0x28')](_0x475137,_0x277d('0x26'));_0x48cf98[_0x277d('0x2d')]=_[_0x277d('0x2e')](_0x5d5e83[_0x277d('0x2d')]);_0x48cf98[_0x277d('0x2f')]=_[_0x277d('0x30')](_0x48cf98[_0x277d('0x2c')],_0x48cf98[_0x277d('0x2d')]);_0xbb0599[_0x277d('0x31')]=_[_0x277d('0x30')](_0x48cf98[_0x277d('0x2c')],qs[_0x277d('0x32')](_0x5d5e83['query'][_0x277d('0x32')]));_0xbb0599[_0x277d('0x31')]=_0xbb0599[_0x277d('0x31')][_0x277d('0x33')]?_0xbb0599[_0x277d('0x31')]:_0x48cf98[_0x277d('0x2c')];if(!_0x5d5e83[_0x277d('0x2d')]['hasOwnProperty'](_0x277d('0x34'))){_0xbb0599[_0x277d('0x19')]=qs[_0x277d('0x19')](_0x5d5e83[_0x277d('0x2d')][_0x277d('0x19')]);_0xbb0599['offset']=qs[_0x277d('0x17')](_0x5d5e83['query'][_0x277d('0x17')]);}_0xbb0599[_0x277d('0x35')]=qs['sort'](_0x5d5e83['query'][_0x277d('0x36')]);_0xbb0599[_0x277d('0x37')]=qs[_0x277d('0x2f')](_[_0x277d('0x38')](_0x5d5e83[_0x277d('0x2d')],_0x48cf98[_0x277d('0x2f')]),_0x475137);if(_0x5d5e83['query'][_0x277d('0x39')]){_0xbb0599[_0x277d('0x37')]=_[_0x277d('0x3a')](_0xbb0599[_0x277d('0x37')],{'$or':_[_0x277d('0x28')](_0x475137,function(_0x290b80){if(_0x290b80[_0x277d('0x3b')]!==_0x277d('0x3c')){var _0x5a4c36={};_0x5a4c36[_0x290b80['name']]={'$like':'%'+_0x5d5e83['query'][_0x277d('0x39')]+'%'};return _0x5a4c36;}})});}_0xbb0599=_[_0x277d('0x3a')]({},_0xbb0599,_0x5d5e83[_0x277d('0x3d')]);var _0x45bf7b={'where':_0xbb0599['where']};return db[_0x277d('0x29')][_0x277d('0x1a')](_0x45bf7b)['then'](function(_0x5a9387){_0x53e4f1[_0x277d('0x1a')]=_0x5a9387;if(_0x5d5e83[_0x277d('0x2d')][_0x277d('0x3e')]){_0xbb0599[_0x277d('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x277d('0x40')](_0xbb0599);})[_0x277d('0x23')](function(_0x514aba){_0x53e4f1['rows']=_0x514aba;return _0x53e4f1;})['then'](respondWithFilteredResult(_0x50b897,_0xbb0599))[_0x277d('0x41')](handleError(_0x50b897,null));};exports[_0x277d('0x42')]=function(_0x23e50d,_0x4d8243){var _0x9f2eb={'raw':!![],'where':{'id':_0x23e50d[_0x277d('0x43')]['id']}},_0x42f7c5={};_0x42f7c5[_0x277d('0x2c')]=_[_0x277d('0x2e')](db[_0x277d('0x29')]['rawAttributes']);_0x42f7c5[_0x277d('0x2d')]=_[_0x277d('0x2e')](_0x23e50d[_0x277d('0x2d')]);_0x42f7c5[_0x277d('0x2f')]=_['intersection'](_0x42f7c5[_0x277d('0x2c')],_0x42f7c5[_0x277d('0x2d')]);_0x9f2eb[_0x277d('0x31')]=_[_0x277d('0x30')](_0x42f7c5[_0x277d('0x2c')],qs[_0x277d('0x32')](_0x23e50d[_0x277d('0x2d')]['fields']));_0x9f2eb[_0x277d('0x31')]=_0x9f2eb['attributes']['length']?_0x9f2eb[_0x277d('0x31')]:_0x42f7c5[_0x277d('0x2c')];if(_0x23e50d['query'][_0x277d('0x3e')]){_0x9f2eb['include']=[{'all':!![]}];}_0x9f2eb=_[_0x277d('0x3a')]({},_0x9f2eb,_0x23e50d[_0x277d('0x3d')]);return db['FaxTransferReport'][_0x277d('0x44')](_0x9f2eb)[_0x277d('0x23')](handleEntityNotFound(_0x4d8243,null))[_0x277d('0x23')](respondWithResult(_0x4d8243,null))['catch'](handleError(_0x4d8243,null));};exports[_0x277d('0x45')]=function(_0x222efe,_0x1f2ca4){return db[_0x277d('0x29')][_0x277d('0x45')](_0x222efe[_0x277d('0x46')],{})['then'](respondWithResult(_0x1f2ca4,0xc9))[_0x277d('0x41')](handleError(_0x1f2ca4,null));};exports[_0x277d('0x22')]=function(_0x491b39,_0x45934d){if(_0x491b39[_0x277d('0x46')]['id']){delete _0x491b39[_0x277d('0x46')]['id'];}return db[_0x277d('0x29')]['find']({'where':{'id':_0x491b39[_0x277d('0x43')]['id']}})[_0x277d('0x23')](handleEntityNotFound(_0x45934d,null))['then'](saveUpdates(_0x491b39[_0x277d('0x46')],null))[_0x277d('0x23')](respondWithResult(_0x45934d,null))[_0x277d('0x41')](handleError(_0x45934d,null));};exports[_0x277d('0x24')]=function(_0x4715a0,_0xa147de){return db[_0x277d('0x29')][_0x277d('0x44')]({'where':{'id':_0x4715a0[_0x277d('0x43')]['id']}})[_0x277d('0x23')](handleEntityNotFound(_0xa147de,null))['then'](removeEntity(_0xa147de,null))[_0x277d('0x41')](handleError(_0xa147de,null));};exports['describe']=function(_0x2a2c69,_0x579425){return db[_0x277d('0x29')][_0x277d('0x47')]()[_0x277d('0x23')](respondWithResult(_0x579425,null))[_0x277d('0x41')](handleError(_0x579425,null));};
\ No newline at end of file
+var _0x5413=['body','describe','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','save','update','destroy','error','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','then','includeAll','include','rows','catch','show','params','length','find','create'];(function(_0x2c976f,_0x4bd2c4){var _0x1a1227=function(_0x24597e){while(--_0x24597e){_0x2c976f['push'](_0x2c976f['shift']());}};_0x1a1227(++_0x4bd2c4);}(_0x5413,0x126));var _0x3541=function(_0x446fdd,_0x55790a){_0x446fdd=_0x446fdd-0x0;var _0x203b19=_0x5413[_0x446fdd];return _0x203b19;};'use strict';var emlformat=require(_0x3541('0x0'));var rimraf=require(_0x3541('0x1'));var zipdir=require(_0x3541('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3541('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3541('0x4'));var path=require(_0x3541('0x5'));var sox=require(_0x3541('0x6'));var csv=require(_0x3541('0x7'));var ejs=require(_0x3541('0x8'));var fs=require('fs');var fs_extra=require(_0x3541('0x9'));var _=require(_0x3541('0xa'));var squel=require(_0x3541('0xb'));var crypto=require(_0x3541('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3541('0xd'));var toCsv=require(_0x3541('0x7'));var querystring=require(_0x3541('0xe'));var Papa=require(_0x3541('0xf'));var Redis=require(_0x3541('0x10'));var authService=require(_0x3541('0x11'));var qs=require(_0x3541('0x12'));var as=require(_0x3541('0x13'));var hardwareService=require(_0x3541('0x14'));var logger=require(_0x3541('0x15'))(_0x3541('0x16'));var utils=require(_0x3541('0x17'));var config=require(_0x3541('0x18'));var licenseUtil=require(_0x3541('0x19'));var db=require(_0x3541('0x1a'))['db'];function respondWithStatusCode(_0x2b1aa6,_0x3d6485){_0x3d6485=_0x3d6485||0xcc;return function(_0x3016e5){if(_0x3016e5){return _0x2b1aa6[_0x3541('0x1b')](_0x3d6485);}return _0x2b1aa6['status'](_0x3d6485)['end']();};}function respondWithResult(_0x7fc1ff,_0x27a5d4){_0x27a5d4=_0x27a5d4||0xc8;return function(_0x4742d7){if(_0x4742d7){return _0x7fc1ff[_0x3541('0x1c')](_0x27a5d4)['json'](_0x4742d7);}};}function respondWithFilteredResult(_0x111976,_0xdaa067){return function(_0x4b404c){if(_0x4b404c){var _0x2914bd=typeof _0xdaa067[_0x3541('0x1d')]==='undefined'&&typeof _0xdaa067['limit']===_0x3541('0x1e');var _0x292278=_0x4b404c[_0x3541('0x1f')];var _0x3b720e=_0x2914bd?0x0:_0xdaa067[_0x3541('0x1d')];var _0xd36933=_0x2914bd?_0x4b404c[_0x3541('0x1f')]:_0xdaa067['offset']+_0xdaa067['limit'];var _0x543d00;if(_0xd36933>=_0x292278){_0xd36933=_0x292278;_0x543d00=0xc8;}else{_0x543d00=0xce;}_0x111976[_0x3541('0x1c')](_0x543d00);return _0x111976['set'](_0x3541('0x20'),_0x3b720e+'-'+_0xd36933+'/'+_0x292278)[_0x3541('0x21')](_0x4b404c);}return null;};}function patchUpdates(_0x9c950a){return function(_0x110cbd){try{jsonpatch[_0x3541('0x22')](_0x110cbd,_0x9c950a,!![]);}catch(_0x57f205){return BPromise[_0x3541('0x23')](_0x57f205);}return _0x110cbd[_0x3541('0x24')]();};}function saveUpdates(_0x43afd9,_0x28bbc2){return function(_0xaedc5b){if(_0xaedc5b){return _0xaedc5b[_0x3541('0x25')](_0x43afd9)['then'](function(_0x5d1a9b){return _0x5d1a9b;});}return null;};}function removeEntity(_0x474a04,_0x12c801){return function(_0x4ac881){if(_0x4ac881){return _0x4ac881[_0x3541('0x26')]()['then'](function(){_0x474a04[_0x3541('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x305de5,_0x29810e){return function(_0x2986f9){if(!_0x2986f9){_0x305de5[_0x3541('0x1b')](0x194);}return _0x2986f9;};}function handleError(_0x271f3c,_0x38966e){_0x38966e=_0x38966e||0x1f4;return function(_0x5dbe5b){logger[_0x3541('0x27')](_0x5dbe5b['stack']);if(_0x5dbe5b[_0x3541('0x28')]){delete _0x5dbe5b['name'];}_0x271f3c['status'](_0x38966e)['send'](_0x5dbe5b);};}exports[_0x3541('0x29')]=function(_0x16bd04,_0x599432){var _0x51d67d={},_0x57d96b={},_0x207e63={'count':0x0,'rows':[]};var _0x3d11cc=_[_0x3541('0x2a')](db[_0x3541('0x2b')][_0x3541('0x2c')],function(_0x18ac80){return{'name':_0x18ac80[_0x3541('0x2d')],'type':_0x18ac80[_0x3541('0x2e')]['key']};});_0x57d96b['model']=_['map'](_0x3d11cc,_0x3541('0x28'));_0x57d96b[_0x3541('0x2f')]=_[_0x3541('0x30')](_0x16bd04[_0x3541('0x2f')]);_0x57d96b[_0x3541('0x31')]=_[_0x3541('0x32')](_0x57d96b[_0x3541('0x33')],_0x57d96b[_0x3541('0x2f')]);_0x51d67d[_0x3541('0x34')]=_[_0x3541('0x32')](_0x57d96b['model'],qs[_0x3541('0x35')](_0x16bd04[_0x3541('0x2f')][_0x3541('0x35')]));_0x51d67d[_0x3541('0x34')]=_0x51d67d[_0x3541('0x34')]['length']?_0x51d67d[_0x3541('0x34')]:_0x57d96b[_0x3541('0x33')];if(!_0x16bd04[_0x3541('0x2f')][_0x3541('0x36')]('nolimit')){_0x51d67d['limit']=qs['limit'](_0x16bd04[_0x3541('0x2f')]['limit']);_0x51d67d[_0x3541('0x1d')]=qs['offset'](_0x16bd04[_0x3541('0x2f')]['offset']);}_0x51d67d[_0x3541('0x37')]=qs[_0x3541('0x38')](_0x16bd04['query']['sort']);_0x51d67d[_0x3541('0x39')]=qs[_0x3541('0x31')](_['pick'](_0x16bd04[_0x3541('0x2f')],_0x57d96b[_0x3541('0x31')]),_0x3d11cc);if(_0x16bd04[_0x3541('0x2f')]['filter']){_0x51d67d['where']=_[_0x3541('0x3a')](_0x51d67d['where'],{'$or':_[_0x3541('0x2a')](_0x3d11cc,function(_0x5a2dc2){if(_0x5a2dc2[_0x3541('0x2e')]!==_0x3541('0x3b')){var _0x5335bc={};_0x5335bc[_0x5a2dc2['name']]={'$like':'%'+_0x16bd04[_0x3541('0x2f')][_0x3541('0x3c')]+'%'};return _0x5335bc;}})});}_0x51d67d=_['merge']({},_0x51d67d,_0x16bd04['options']);var _0x46434e={'where':_0x51d67d['where']};return db[_0x3541('0x2b')][_0x3541('0x1f')](_0x46434e)[_0x3541('0x3d')](function(_0xb759f9){_0x207e63['count']=_0xb759f9;if(_0x16bd04[_0x3541('0x2f')][_0x3541('0x3e')]){_0x51d67d[_0x3541('0x3f')]=[{'all':!![]}];}return db[_0x3541('0x2b')]['findAll'](_0x51d67d);})[_0x3541('0x3d')](function(_0x3ac364){_0x207e63[_0x3541('0x40')]=_0x3ac364;return _0x207e63;})['then'](respondWithFilteredResult(_0x599432,_0x51d67d))[_0x3541('0x41')](handleError(_0x599432,null));};exports[_0x3541('0x42')]=function(_0x1e2638,_0x97122){var _0x4655ed={'raw':!![],'where':{'id':_0x1e2638[_0x3541('0x43')]['id']}},_0xd2dc9={};_0xd2dc9[_0x3541('0x33')]=_[_0x3541('0x30')](db[_0x3541('0x2b')]['rawAttributes']);_0xd2dc9['query']=_[_0x3541('0x30')](_0x1e2638[_0x3541('0x2f')]);_0xd2dc9[_0x3541('0x31')]=_[_0x3541('0x32')](_0xd2dc9[_0x3541('0x33')],_0xd2dc9[_0x3541('0x2f')]);_0x4655ed[_0x3541('0x34')]=_[_0x3541('0x32')](_0xd2dc9[_0x3541('0x33')],qs[_0x3541('0x35')](_0x1e2638[_0x3541('0x2f')]['fields']));_0x4655ed['attributes']=_0x4655ed[_0x3541('0x34')][_0x3541('0x44')]?_0x4655ed[_0x3541('0x34')]:_0xd2dc9['model'];if(_0x1e2638[_0x3541('0x2f')]['includeAll']){_0x4655ed[_0x3541('0x3f')]=[{'all':!![]}];}_0x4655ed=_[_0x3541('0x3a')]({},_0x4655ed,_0x1e2638['options']);return db[_0x3541('0x2b')][_0x3541('0x45')](_0x4655ed)[_0x3541('0x3d')](handleEntityNotFound(_0x97122,null))['then'](respondWithResult(_0x97122,null))[_0x3541('0x41')](handleError(_0x97122,null));};exports[_0x3541('0x46')]=function(_0x3315e9,_0x489223){return db[_0x3541('0x2b')][_0x3541('0x46')](_0x3315e9[_0x3541('0x47')],{})[_0x3541('0x3d')](respondWithResult(_0x489223,0xc9))[_0x3541('0x41')](handleError(_0x489223,null));};exports[_0x3541('0x25')]=function(_0x2fcb61,_0x3aa4b0){if(_0x2fcb61[_0x3541('0x47')]['id']){delete _0x2fcb61[_0x3541('0x47')]['id'];}return db[_0x3541('0x2b')]['find']({'where':{'id':_0x2fcb61[_0x3541('0x43')]['id']}})[_0x3541('0x3d')](handleEntityNotFound(_0x3aa4b0,null))[_0x3541('0x3d')](saveUpdates(_0x2fcb61[_0x3541('0x47')],null))[_0x3541('0x3d')](respondWithResult(_0x3aa4b0,null))[_0x3541('0x41')](handleError(_0x3aa4b0,null));};exports[_0x3541('0x26')]=function(_0x42bd32,_0x511437){return db[_0x3541('0x2b')][_0x3541('0x45')]({'where':{'id':_0x42bd32['params']['id']}})['then'](handleEntityNotFound(_0x511437,null))['then'](removeEntity(_0x511437,null))[_0x3541('0x41')](handleError(_0x511437,null));};exports[_0x3541('0x48')]=function(_0x717d72,_0x2ddaf4){return db[_0x3541('0x2b')]['describe']()[_0x3541('0x3d')](respondWithResult(_0x2ddaf4,null))[_0x3541('0x41')](handleError(_0x2ddaf4,null));};
\ No newline at end of file
index b74fb8c..ddf3200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbe8=['exports','define','report_fax_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0x22b6e5,_0x2819c8){var _0x1c21e5=function(_0x18a52c){while(--_0x18a52c){_0x22b6e5['push'](_0x22b6e5['shift']());}};_0x1c21e5(++_0x2819c8);}(_0xcbe8,0x1e4));var _0x8cbe=function(_0x3097be,_0x1bc9ab){_0x3097be=_0x3097be-0x0;var _0x37bfa=_0xcbe8[_0x3097be];return _0x37bfa;};'use strict';var _=require('lodash');var util=require(_0x8cbe('0x0'));var logger=require(_0x8cbe('0x1'))(_0x8cbe('0x2'));var moment=require(_0x8cbe('0x3'));var BPromise=require(_0x8cbe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8cbe('0x5'));var config=require(_0x8cbe('0x6'));var attributes=require(_0x8cbe('0x7'));module[_0x8cbe('0x8')]=function(_0x1e173d,_0xa663f){return _0x1e173d[_0x8cbe('0x9')]('FaxTransferReport',attributes,{'tableName':_0x8cbe('0xa'),'paranoid':![],'indexes':[{'name':_0x8cbe('0xb'),'fields':[_0x8cbe('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x600f=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x4a8f10,_0x5941bd){var _0x25cc12=function(_0x5b2d09){while(--_0x5b2d09){_0x4a8f10['push'](_0x4a8f10['shift']());}};_0x25cc12(++_0x5941bd);}(_0x600f,0x6c));var _0xf600=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x600f[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xf600('0x0'));var util=require(_0xf600('0x1'));var logger=require(_0xf600('0x2'))(_0xf600('0x3'));var moment=require(_0xf600('0x4'));var BPromise=require(_0xf600('0x5'));var rp=require(_0xf600('0x6'));var fs=require('fs');var path=require(_0xf600('0x7'));var rimraf=require(_0xf600('0x8'));var config=require(_0xf600('0x9'));var attributes=require(_0xf600('0xa'));module[_0xf600('0xb')]=function(_0x1ab1a5,_0x422f36){return _0x1ab1a5['define'](_0xf600('0xc'),attributes,{'tableName':_0xf600('0xd'),'paranoid':![],'indexes':[{'name':_0xf600('0xe'),'fields':[_0xf600('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index a75b203..ad0da4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1859=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x146214,_0x13482f){var _0x2c2acb=function(_0xb0ad23){while(--_0xb0ad23){_0x146214['push'](_0x146214['shift']());}};_0x2c2acb(++_0x13482f);}(_0x1859,0xc0));var _0x9185=function(_0x269cc7,_0x15d47f){_0x269cc7=_0x269cc7-0x0;var _0x260407=_0x1859[_0x269cc7];return _0x260407;};'use strict';var _=require(_0x9185('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9185('0x1'));var rs=require(_0x9185('0x2'));var fs=require('fs');var Redis=require(_0x9185('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9185('0x4'));var logger=require(_0x9185('0x5'))(_0x9185('0x6'));var config=require(_0x9185('0x7'));var jayson=require(_0x9185('0x8'));var client=jayson[_0x9185('0x9')][_0x9185('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11ddf3,_0x33457a,_0xc27d53){return new BPromise(function(_0x5b1ad1,_0x438333){return client[_0x9185('0xb')](_0x11ddf3,_0xc27d53)[_0x9185('0xc')](function(_0x4ae964){logger[_0x9185('0xd')](_0x9185('0xe'),_0x33457a,_0x9185('0xf'));logger[_0x9185('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x33457a,_0x9185('0xf'),JSON[_0x9185('0x11')](_0x4ae964));if(_0x4ae964[_0x9185('0x12')]){if(_0x4ae964[_0x9185('0x12')][_0x9185('0x13')]===0x1f4){logger[_0x9185('0x12')](_0x9185('0xe'),_0x33457a,_0x4ae964[_0x9185('0x12')][_0x9185('0x14')]);return _0x438333(_0x4ae964[_0x9185('0x12')][_0x9185('0x14')]);}logger['error'](_0x9185('0xe'),_0x33457a,_0x4ae964['error'][_0x9185('0x14')]);return _0x5b1ad1(_0x4ae964[_0x9185('0x12')][_0x9185('0x14')]);}else{logger[_0x9185('0xd')](_0x9185('0xe'),_0x33457a,_0x9185('0xf'));_0x5b1ad1(_0x4ae964['result'][_0x9185('0x14')]);}})[_0x9185('0x15')](function(_0x28507e){logger[_0x9185('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x33457a,_0x28507e);_0x438333(_0x28507e);});});}
\ No newline at end of file
+var _0x82b4=['catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x82b4,0x1d5));var _0x482b=function(_0x28a670,_0x92437b){_0x28a670=_0x28a670-0x0;var _0x861fde=_0x82b4[_0x28a670];return _0x861fde;};'use strict';var _=require('lodash');var util=require(_0x482b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x482b('0x1'));var fs=require('fs');var Redis=require(_0x482b('0x2'));var db=require(_0x482b('0x3'))['db'];var utils=require(_0x482b('0x4'));var logger=require(_0x482b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x482b('0x6'));var client=jayson[_0x482b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef8e0,_0x20eae2,_0x1f2b7f){return new BPromise(function(_0x281b01,_0x18e27b){return client['request'](_0x4ef8e0,_0x1f2b7f)[_0x482b('0x8')](function(_0x457d97){logger[_0x482b('0x9')](_0x482b('0xa'),_0x20eae2,_0x482b('0xb'));logger['debug'](_0x482b('0xc'),_0x20eae2,_0x482b('0xb'),JSON[_0x482b('0xd')](_0x457d97));if(_0x457d97[_0x482b('0xe')]){if(_0x457d97[_0x482b('0xe')][_0x482b('0xf')]===0x1f4){logger[_0x482b('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x20eae2,_0x457d97['error'][_0x482b('0x10')]);return _0x18e27b(_0x457d97[_0x482b('0xe')][_0x482b('0x10')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x20eae2,_0x457d97[_0x482b('0xe')][_0x482b('0x10')]);return _0x281b01(_0x457d97['error']['message']);}else{logger[_0x482b('0x9')]('FaxTransferReport,\x20%s,\x20%s',_0x20eae2,_0x482b('0xb'));_0x281b01(_0x457d97['result']['message']);}})[_0x482b('0x11')](function(_0x3f27e1){logger[_0x482b('0xe')](_0x482b('0xa'),_0x20eae2,_0x3f27e1);_0x18e27b(_0x3f27e1);});});}
\ No newline at end of file
index 7f8c8bb..a75b4b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x618f=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','describe','show','post','put'];(function(_0x22d54c,_0x35f108){var _0x478bec=function(_0x4a1302){while(--_0x4a1302){_0x22d54c['push'](_0x22d54c['shift']());}};_0x478bec(++_0x35f108);}(_0x618f,0x1e8));var _0xf618=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x618f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf618('0x0'));var util=require(_0xf618('0x1'));var path=require(_0xf618('0x2'));var timeout=require(_0xf618('0x3'));var express=require(_0xf618('0x4'));var router=express[_0xf618('0x5')]();var fs_extra=require(_0xf618('0x6'));var auth=require(_0xf618('0x7'));var interaction=require(_0xf618('0x8'));var config=require('../../config/environment');var controller=require(_0xf618('0x9'));router[_0xf618('0xa')]('/',auth[_0xf618('0xb')](),controller['index']);router[_0xf618('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xf618('0xc')]);router[_0xf618('0xa')]('/:id',auth[_0xf618('0xb')](),controller[_0xf618('0xd')]);router[_0xf618('0xe')]('/',auth[_0xf618('0xb')](),controller['create']);router[_0xf618('0xf')](_0xf618('0x10'),auth[_0xf618('0xb')](),controller[_0xf618('0x11')]);router[_0xf618('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf618('0x13')]);module[_0xf618('0x14')]=router;
\ No newline at end of file
+var _0x6185=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6185,0xbc));var _0x5618=function(_0x17f2e7,_0x15fb71){_0x17f2e7=_0x17f2e7-0x0;var _0x49f939=_0x6185[_0x17f2e7];return _0x49f939;};'use strict';var multer=require('multer');var util=require(_0x5618('0x0'));var path=require('path');var timeout=require(_0x5618('0x1'));var express=require(_0x5618('0x2'));var router=express[_0x5618('0x3')]();var fs_extra=require(_0x5618('0x4'));var auth=require(_0x5618('0x5'));var interaction=require(_0x5618('0x6'));var config=require(_0x5618('0x7'));var controller=require(_0x5618('0x8'));router[_0x5618('0x9')]('/',auth[_0x5618('0xa')](),controller[_0x5618('0xb')]);router[_0x5618('0x9')](_0x5618('0xc'),auth[_0x5618('0xa')](),controller[_0x5618('0xd')]);router[_0x5618('0x9')](_0x5618('0xe'),auth[_0x5618('0xa')](),controller[_0x5618('0xf')]);router[_0x5618('0x10')]('/',auth[_0x5618('0xa')](),controller[_0x5618('0x11')]);router[_0x5618('0x12')](_0x5618('0xe'),auth['isAuthenticated'](),controller[_0x5618('0x13')]);router[_0x5618('0x14')]('/:id',auth[_0x5618('0xa')](),controller[_0x5618('0x15')]);module[_0x5618('0x16')]=router;
\ No newline at end of file
index f9c7c8f..02d0644 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c1c=['/:id','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','post','addConfiguration','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get'];(function(_0x39d208,_0x1dd4d1){var _0x4e4810=function(_0xc31ebb){while(--_0xc31ebb){_0x39d208['push'](_0x39d208['shift']());}};_0x4e4810(++_0x1dd4d1);}(_0x9c1c,0x105));var _0xc9c1=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x9c1c[_0x12ddb2];return _0x10b6dd;};'use strict';var multer=require(_0xc9c1('0x0'));var util=require(_0xc9c1('0x1'));var path=require(_0xc9c1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9c1('0x3'));var router=express[_0xc9c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc9c1('0x5'));var interaction=require(_0xc9c1('0x6'));var config=require('../../config/environment');var controller=require(_0xc9c1('0x7'));router[_0xc9c1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc9c1('0x8')](_0xc9c1('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xc9c1('0x8')](_0xc9c1('0xa'),auth['isAuthenticated'](),controller[_0xc9c1('0xb')]);router['get'](_0xc9c1('0xc'),auth[_0xc9c1('0xd')](),controller['getFields']);router['post']('/',auth[_0xc9c1('0xd')](),controller['create']);router[_0xc9c1('0xe')](_0xc9c1('0xa'),auth[_0xc9c1('0xd')](),controller[_0xc9c1('0xf')]);router['put']('/:id',auth[_0xc9c1('0xd')](),controller[_0xc9c1('0x10')]);router['delete'](_0xc9c1('0x9'),auth[_0xc9c1('0xd')](),controller[_0xc9c1('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x56f8=['post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x59cd25,_0x55b586){var _0x1efadf=function(_0x4b66dc){while(--_0x4b66dc){_0x59cd25['push'](_0x59cd25['shift']());}};_0x1efadf(++_0x55b586);}(_0x56f8,0x1a0));var _0x856f=function(_0x4d0156,_0x2ff6dc){_0x4d0156=_0x4d0156-0x0;var _0x4f88cd=_0x56f8[_0x4d0156];return _0x4f88cd;};'use strict';var multer=require(_0x856f('0x0'));var util=require(_0x856f('0x1'));var path=require(_0x856f('0x2'));var timeout=require(_0x856f('0x3'));var express=require(_0x856f('0x4'));var router=express['Router']();var fs_extra=require(_0x856f('0x5'));var auth=require(_0x856f('0x6'));var interaction=require(_0x856f('0x7'));var config=require(_0x856f('0x8'));var controller=require(_0x856f('0x9'));router[_0x856f('0xa')]('/',auth[_0x856f('0xb')](),controller[_0x856f('0xc')]);router[_0x856f('0xa')](_0x856f('0xd'),auth['isAuthenticated'](),controller[_0x856f('0xe')]);router[_0x856f('0xa')]('/:id/configurations',auth[_0x856f('0xb')](),controller['getConfigurations']);router[_0x856f('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x856f('0xf')]);router[_0x856f('0x10')]('/',auth['isAuthenticated'](),controller[_0x856f('0x11')]);router[_0x856f('0x10')](_0x856f('0x12'),auth[_0x856f('0xb')](),controller[_0x856f('0x13')]);router[_0x856f('0x14')]('/:id',auth[_0x856f('0xb')](),controller[_0x856f('0x15')]);router[_0x856f('0x16')](_0x856f('0xd'),auth[_0x856f('0xb')](),controller[_0x856f('0x17')]);module['exports']=router;
\ No newline at end of file
index 94e53ce..4802eac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d5c=['ENUM','basic','integrationTab','newTab','STRING'];(function(_0x315f57,_0x20895e){var _0x35598e=function(_0x2bc83b){while(--_0x2bc83b){_0x315f57['push'](_0x315f57['shift']());}};_0x35598e(++_0x20895e);}(_0x0d5c,0x81));var _0xc0d5=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x0d5c[_0x112fe3];return _0x1ec903;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc0d5('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xc0d5('0x1')](_0xc0d5('0x2')),'defaultValue':_0xc0d5('0x2')},'password':{'type':Sequelize[_0xc0d5('0x0')]},'consumerKey':{'type':Sequelize[_0xc0d5('0x0')]},'consumerSecret':{'type':Sequelize[_0xc0d5('0x0')]},'token':{'type':Sequelize[_0xc0d5('0x0')]},'tokenSecret':{'type':Sequelize[_0xc0d5('0x0')]},'serverUrl':{'type':Sequelize[_0xc0d5('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xc0d5('0x1')](_0xc0d5('0x3'),_0xc0d5('0x4')),'defaultValue':_0xc0d5('0x3')}};
\ No newline at end of file
+var _0x7cb8=['newTab','exports','STRING','basic','ENUM','integrationTab'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x7cb8,0x19f));var _0x87cb=function(_0x49c1cd,_0x1eb682){_0x49c1cd=_0x49c1cd-0x0;var _0x4708b6=_0x7cb8[_0x49c1cd];return _0x4708b6;};'use strict';var Sequelize=require('sequelize');module[_0x87cb('0x0')]={'name':{'type':Sequelize[_0x87cb('0x1')]},'description':{'type':Sequelize[_0x87cb('0x1')]},'username':{'type':Sequelize[_0x87cb('0x1')]},'remoteUri':{'type':Sequelize[_0x87cb('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x87cb('0x2')),'defaultValue':_0x87cb('0x2')},'password':{'type':Sequelize[_0x87cb('0x1')]},'consumerKey':{'type':Sequelize[_0x87cb('0x1')]},'consumerSecret':{'type':Sequelize[_0x87cb('0x1')]},'token':{'type':Sequelize[_0x87cb('0x1')]},'tokenSecret':{'type':Sequelize[_0x87cb('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x87cb('0x3')](_0x87cb('0x4'),_0x87cb('0x5')),'defaultValue':_0x87cb('0x4')}};
\ No newline at end of file
index 37ab6d3..81700b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca42=['entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','request-promise','mustache','util','path','to-csv','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/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','limit','undefined','offset','Content-Range','apply','save','then','error','name','send','index','map','DeskAccount','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','getConfigurations','findOne','DeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','lastIndexOf','format','%s/custom_fields','basic','Basic\x20%s','%s:%s','base64','_embedded'];(function(_0x4fad01,_0x380605){var _0xd4a986=function(_0x474a54){while(--_0x474a54){_0x4fad01['push'](_0x4fad01['shift']());}};_0xd4a986(++_0x380605);}(_0xca42,0x71));var _0x2ca4=function(_0x2b02dc,_0x3fc7da){_0x2b02dc=_0x2b02dc-0x0;var _0x6d53e4=_0xca42[_0x2b02dc];return _0x6d53e4;};'use strict';var emlformat=require(_0x2ca4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2ca4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2ca4('0x2'));var util=require(_0x2ca4('0x3'));var path=require(_0x2ca4('0x4'));var sox=require('sox');var csv=require(_0x2ca4('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ca4('0x6'));var _=require(_0x2ca4('0x7'));var squel=require(_0x2ca4('0x8'));var crypto=require(_0x2ca4('0x9'));var jsforce=require(_0x2ca4('0xa'));var deskjs=require(_0x2ca4('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2ca4('0xc'));var Papa=require(_0x2ca4('0xd'));var Redis=require(_0x2ca4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2ca4('0xf'));var as=require(_0x2ca4('0x10'));var hardwareService=require(_0x2ca4('0x11'));var logger=require(_0x2ca4('0x12'))(_0x2ca4('0x13'));var utils=require(_0x2ca4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2ca4('0x15'));var db=require(_0x2ca4('0x16'))['db'];var integrations=require(_0x2ca4('0x17'));function respondWithStatusCode(_0x14e0e6,_0x3b00c5){_0x3b00c5=_0x3b00c5||0xcc;return function(_0x51171f){if(_0x51171f){return _0x14e0e6[_0x2ca4('0x18')](_0x3b00c5);}return _0x14e0e6[_0x2ca4('0x19')](_0x3b00c5)[_0x2ca4('0x1a')]();};}function respondWithResult(_0x5be3a6,_0x1915e6){_0x1915e6=_0x1915e6||0xc8;return function(_0x4e4c54){if(_0x4e4c54){return _0x5be3a6[_0x2ca4('0x19')](_0x1915e6)['json'](_0x4e4c54);}};}function respondWithFilteredResult(_0x2f0669,_0xb90834){return function(_0x5de40e){if(_0x5de40e){var _0x455179=typeof _0xb90834['offset']==='undefined'&&typeof _0xb90834[_0x2ca4('0x1b')]===_0x2ca4('0x1c');var _0xabb281=_0x5de40e['count'];var _0x5c4065=_0x455179?0x0:_0xb90834[_0x2ca4('0x1d')];var _0x499fa2=_0x455179?_0x5de40e['count']:_0xb90834[_0x2ca4('0x1d')]+_0xb90834['limit'];var _0x59f30f;if(_0x499fa2>=_0xabb281){_0x499fa2=_0xabb281;_0x59f30f=0xc8;}else{_0x59f30f=0xce;}_0x2f0669[_0x2ca4('0x19')](_0x59f30f);return _0x2f0669['set'](_0x2ca4('0x1e'),_0x5c4065+'-'+_0x499fa2+'/'+_0xabb281)['json'](_0x5de40e);}return null;};}function patchUpdates(_0x5214ed){return function(_0xb1e92d){try{jsonpatch[_0x2ca4('0x1f')](_0xb1e92d,_0x5214ed,!![]);}catch(_0x554c26){return BPromise['reject'](_0x554c26);}return _0xb1e92d[_0x2ca4('0x20')]();};}function saveUpdates(_0x348d68,_0x42d072){return function(_0x424b7c){if(_0x424b7c){return _0x424b7c['update'](_0x348d68)[_0x2ca4('0x21')](function(_0x4d7c2f){return _0x4d7c2f;});}return null;};}function removeEntity(_0x62137c,_0x1804cf){return function(_0x588776){if(_0x588776){return _0x588776['destroy']()[_0x2ca4('0x21')](function(){_0x62137c[_0x2ca4('0x19')](0xcc)[_0x2ca4('0x1a')]();});}};}function handleEntityNotFound(_0x1af78c,_0xab1ed0){return function(_0x4210a2){if(!_0x4210a2){_0x1af78c[_0x2ca4('0x18')](0x194);}return _0x4210a2;};}function handleError(_0x4a06d1,_0x4538bf){_0x4538bf=_0x4538bf||0x1f4;return function(_0x1c21ce){logger[_0x2ca4('0x22')](_0x1c21ce['stack']);if(_0x1c21ce[_0x2ca4('0x23')]){delete _0x1c21ce[_0x2ca4('0x23')];}_0x4a06d1[_0x2ca4('0x19')](_0x4538bf)[_0x2ca4('0x24')](_0x1c21ce);};}exports[_0x2ca4('0x25')]=function(_0x935ef9,_0x58b0c4){var _0x2e6927={},_0x605f3={},_0x4a6750={'count':0x0,'rows':[]};var _0x13529f=_[_0x2ca4('0x26')](db[_0x2ca4('0x27')]['rawAttributes'],function(_0x2b4435){return{'name':_0x2b4435['fieldName'],'type':_0x2b4435[_0x2ca4('0x28')][_0x2ca4('0x29')]};});_0x605f3['model']=_[_0x2ca4('0x26')](_0x13529f,_0x2ca4('0x23'));_0x605f3[_0x2ca4('0x2a')]=_[_0x2ca4('0x2b')](_0x935ef9['query']);_0x605f3[_0x2ca4('0x2c')]=_[_0x2ca4('0x2d')](_0x605f3[_0x2ca4('0x2e')],_0x605f3[_0x2ca4('0x2a')]);_0x2e6927[_0x2ca4('0x2f')]=_[_0x2ca4('0x2d')](_0x605f3[_0x2ca4('0x2e')],qs[_0x2ca4('0x30')](_0x935ef9['query'][_0x2ca4('0x30')]));_0x2e6927['attributes']=_0x2e6927[_0x2ca4('0x2f')][_0x2ca4('0x31')]?_0x2e6927['attributes']:_0x605f3[_0x2ca4('0x2e')];if(!_0x935ef9[_0x2ca4('0x2a')][_0x2ca4('0x32')](_0x2ca4('0x33'))){_0x2e6927[_0x2ca4('0x1b')]=qs[_0x2ca4('0x1b')](_0x935ef9[_0x2ca4('0x2a')][_0x2ca4('0x1b')]);_0x2e6927[_0x2ca4('0x1d')]=qs[_0x2ca4('0x1d')](_0x935ef9['query']['offset']);}_0x2e6927[_0x2ca4('0x34')]=qs['sort'](_0x935ef9[_0x2ca4('0x2a')][_0x2ca4('0x35')]);_0x2e6927[_0x2ca4('0x36')]=qs[_0x2ca4('0x2c')](_[_0x2ca4('0x37')](_0x935ef9['query'],_0x605f3[_0x2ca4('0x2c')]),_0x13529f);if(_0x935ef9[_0x2ca4('0x2a')][_0x2ca4('0x38')]){_0x2e6927[_0x2ca4('0x36')]=_[_0x2ca4('0x39')](_0x2e6927[_0x2ca4('0x36')],{'$or':_[_0x2ca4('0x26')](_0x13529f,function(_0x204d65){if(_0x204d65['type']!==_0x2ca4('0x3a')){var _0x490376={};_0x490376[_0x204d65[_0x2ca4('0x23')]]={'$like':'%'+_0x935ef9[_0x2ca4('0x2a')][_0x2ca4('0x38')]+'%'};return _0x490376;}})});}_0x2e6927=_[_0x2ca4('0x39')]({},_0x2e6927,_0x935ef9[_0x2ca4('0x3b')]);var _0x10c511={'where':_0x2e6927[_0x2ca4('0x36')]};return db[_0x2ca4('0x27')]['count'](_0x10c511)[_0x2ca4('0x21')](function(_0x153f9d){_0x4a6750[_0x2ca4('0x3c')]=_0x153f9d;if(_0x935ef9[_0x2ca4('0x2a')]['includeAll']){_0x2e6927[_0x2ca4('0x3d')]=[{'all':!![]}];}return db[_0x2ca4('0x27')][_0x2ca4('0x3e')](_0x2e6927);})['then'](function(_0x208542){_0x4a6750[_0x2ca4('0x3f')]=_0x208542;return _0x4a6750;})['then'](respondWithFilteredResult(_0x58b0c4,_0x2e6927))[_0x2ca4('0x40')](handleError(_0x58b0c4,null));};exports[_0x2ca4('0x41')]=function(_0x2ed25e,_0x32efaf){var _0x16d2e2={'raw':![],'where':{'id':_0x2ed25e[_0x2ca4('0x42')]['id']}},_0x24f815={};_0x24f815[_0x2ca4('0x2e')]=_[_0x2ca4('0x2b')](db[_0x2ca4('0x27')][_0x2ca4('0x43')]);_0x24f815[_0x2ca4('0x2a')]=_[_0x2ca4('0x2b')](_0x2ed25e['query']);_0x24f815['filters']=_[_0x2ca4('0x2d')](_0x24f815['model'],_0x24f815[_0x2ca4('0x2a')]);_0x16d2e2[_0x2ca4('0x2f')]=_[_0x2ca4('0x2d')](_0x24f815[_0x2ca4('0x2e')],qs['fields'](_0x2ed25e[_0x2ca4('0x2a')]['fields']));_0x16d2e2['attributes']=_0x16d2e2[_0x2ca4('0x2f')][_0x2ca4('0x31')]?_0x16d2e2[_0x2ca4('0x2f')]:_0x24f815['model'];if(_0x2ed25e[_0x2ca4('0x2a')]['includeAll']){_0x16d2e2[_0x2ca4('0x3d')]=[{'all':!![]}];}_0x16d2e2=_[_0x2ca4('0x39')]({},_0x16d2e2,_0x2ed25e[_0x2ca4('0x3b')]);return db[_0x2ca4('0x27')][_0x2ca4('0x44')](_0x16d2e2)[_0x2ca4('0x21')](handleEntityNotFound(_0x32efaf,null))[_0x2ca4('0x21')](respondWithResult(_0x32efaf,null))[_0x2ca4('0x40')](handleError(_0x32efaf,null));};exports[_0x2ca4('0x45')]=function(_0x96cfb2,_0x14337e){return db[_0x2ca4('0x27')][_0x2ca4('0x45')](_0x96cfb2[_0x2ca4('0x46')],{})[_0x2ca4('0x21')](respondWithResult(_0x14337e,0xc9))['catch'](handleError(_0x14337e,null));};exports[_0x2ca4('0x47')]=function(_0xc6cdf1,_0xad4359){if(_0xc6cdf1[_0x2ca4('0x46')]['id']){delete _0xc6cdf1[_0x2ca4('0x46')]['id'];}return db[_0x2ca4('0x27')]['find']({'where':{'id':_0xc6cdf1[_0x2ca4('0x42')]['id']}})['then'](handleEntityNotFound(_0xad4359,null))[_0x2ca4('0x21')](saveUpdates(_0xc6cdf1[_0x2ca4('0x46')],null))[_0x2ca4('0x21')](respondWithResult(_0xad4359,null))[_0x2ca4('0x40')](handleError(_0xad4359,null));};exports[_0x2ca4('0x48')]=function(_0x39413c,_0x56fc12){return db['DeskAccount']['find']({'where':{'id':_0x39413c['params']['id']}})['then'](handleEntityNotFound(_0x56fc12,null))[_0x2ca4('0x21')](removeEntity(_0x56fc12,null))['catch'](handleError(_0x56fc12,null));};exports[_0x2ca4('0x49')]=function(_0x39a267,_0x1760d7,_0x4e6ae8){var _0x198d7e={};var _0x5b15a2={};var _0x179568;var _0x36a53e;return db[_0x2ca4('0x27')][_0x2ca4('0x4a')]({'where':{'id':_0x39a267[_0x2ca4('0x42')]['id']}})[_0x2ca4('0x21')](handleEntityNotFound(_0x1760d7,null))[_0x2ca4('0x21')](function(_0x18b47f){if(_0x18b47f){_0x179568=_0x18b47f;_0x5b15a2[_0x2ca4('0x2e')]=_[_0x2ca4('0x2b')](db[_0x2ca4('0x4b')]['rawAttributes']);_0x5b15a2['query']=_['keys'](_0x39a267[_0x2ca4('0x2a')]);_0x5b15a2[_0x2ca4('0x2c')]=_[_0x2ca4('0x2d')](_0x5b15a2[_0x2ca4('0x2e')],_0x5b15a2[_0x2ca4('0x2a')]);_0x198d7e[_0x2ca4('0x2f')]=_[_0x2ca4('0x2d')](_0x5b15a2['model'],qs[_0x2ca4('0x30')](_0x39a267[_0x2ca4('0x2a')][_0x2ca4('0x30')]));_0x198d7e[_0x2ca4('0x2f')]=_0x198d7e['attributes'][_0x2ca4('0x31')]?_0x198d7e[_0x2ca4('0x2f')]:_0x5b15a2['model'];_0x198d7e[_0x2ca4('0x34')]=qs[_0x2ca4('0x35')](_0x39a267[_0x2ca4('0x2a')][_0x2ca4('0x35')]);_0x198d7e['where']=qs[_0x2ca4('0x2c')](_['pick'](_0x39a267['query'],_0x5b15a2[_0x2ca4('0x2c')]));if(_0x39a267[_0x2ca4('0x2a')][_0x2ca4('0x38')]){_0x198d7e[_0x2ca4('0x36')]=_['merge'](_0x198d7e['where'],{'$or':_[_0x2ca4('0x26')](_0x198d7e[_0x2ca4('0x2f')],function(_0x45a92e){var _0x3525c6={};_0x3525c6[_0x45a92e]={'$like':'%'+_0x39a267[_0x2ca4('0x2a')]['filter']+'%'};return _0x3525c6;})});}_0x198d7e=_[_0x2ca4('0x39')]({},_0x198d7e,_0x39a267[_0x2ca4('0x3b')]);return _0x179568['getConfigurations'](_0x198d7e);}})['then'](function(_0xef26d8){if(_0xef26d8){_0x36a53e=_0xef26d8[_0x2ca4('0x31')];if(!_0x39a267['query'][_0x2ca4('0x32')](_0x2ca4('0x33'))){_0x198d7e['limit']=qs[_0x2ca4('0x1b')](_0x39a267['query'][_0x2ca4('0x1b')]);_0x198d7e[_0x2ca4('0x1d')]=qs['offset'](_0x39a267[_0x2ca4('0x2a')][_0x2ca4('0x1d')]);}return _0x179568['getConfigurations'](_0x198d7e);}})[_0x2ca4('0x21')](function(_0x2e9ff2){if(_0x2e9ff2){return _0x2e9ff2?{'count':_0x36a53e,'rows':_0x2e9ff2}:null;}})[_0x2ca4('0x21')](respondWithResult(_0x1760d7,null))[_0x2ca4('0x40')](handleError(_0x1760d7,null));};exports['addConfiguration']=function(_0x3e5b93,_0xf09d19,_0x390d51){if(_0x3e5b93[_0x2ca4('0x46')]['id']){delete _0x3e5b93[_0x2ca4('0x46')]['id'];}return db['DeskAccount'][_0x2ca4('0x4a')]({'where':{'id':_0x3e5b93[_0x2ca4('0x42')]['id']}})['then'](handleEntityNotFound(_0xf09d19,null))[_0x2ca4('0x21')](function(_0x5f0d08){if(_0x5f0d08){_0x3e5b93['body'][_0x2ca4('0x4c')]=_0x5f0d08['id'];_0x3e5b93['body'][_0x2ca4('0x4d')]=integrations[_0x2ca4('0x4e')](_0x3e5b93[_0x2ca4('0x46')][_0x2ca4('0x4f')],_0x3e5b93['body'][_0x2ca4('0x28')]);_0x3e5b93[_0x2ca4('0x46')][_0x2ca4('0x50')]=integrations['getDescriptions'](_0x3e5b93[_0x2ca4('0x46')][_0x2ca4('0x4f')],_0x3e5b93['body'][_0x2ca4('0x28')]);return db[_0x2ca4('0x4b')][_0x2ca4('0x45')](_0x3e5b93['body'],{'include':[{'model':db['DeskField'],'as':_0x2ca4('0x4d')},{'model':db[_0x2ca4('0x51')],'as':_0x2ca4('0x50')}]});}return null;})[_0x2ca4('0x21')](respondWithResult(_0xf09d19,null))[_0x2ca4('0x40')](handleError(_0xf09d19,null));};exports[_0x2ca4('0x52')]=function(_0x32405c,_0xa950f8,_0x78fd65){var _0x3f9e5d=[{'name':_0x2ca4('0x53'),'label':_0x2ca4('0x53'),'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 _0x2eb545='';return db[_0x2ca4('0x27')][_0x2ca4('0x4a')]({'where':{'id':_0x32405c[_0x2ca4('0x42')]['id']},'attributes':['id',_0x2ca4('0x54'),'authType',_0x2ca4('0x55'),_0x2ca4('0x56'),_0x2ca4('0x57'),_0x2ca4('0x58'),_0x2ca4('0x59'),_0x2ca4('0x5a')]})[_0x2ca4('0x21')](handleEntityNotFound(_0xa950f8,null))[_0x2ca4('0x21')](function(_0x59aec9){if(_0x59aec9){_0x2eb545=_0x59aec9['remoteUri'];var _0x128764=_0x2eb545['slice'](-0x1);if(_0x128764==='/'){_0x2eb545=_0x2eb545['substring'](0x0,_0x2eb545[_0x2ca4('0x5b')](_0x128764));}var _0x24fd3d={'method':'GET','uri':util[_0x2ca4('0x5c')](_0x2ca4('0x5d'),_0x2eb545),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x59aec9['authType']===_0x2ca4('0x5e')){_0x24fd3d['headers']['Authorization']=util[_0x2ca4('0x5c')](_0x2ca4('0x5f'),new Buffer(util[_0x2ca4('0x5c')](_0x2ca4('0x60'),_0x59aec9[_0x2ca4('0x55')],_0x59aec9[_0x2ca4('0x56')]))['toString'](_0x2ca4('0x61')));}return rp(_0x24fd3d)['then'](function(_0x3acc7c){return _0x3f9e5d['concat'](_['map'](_0x3acc7c[_0x2ca4('0x62')][_0x2ca4('0x63')],function(_0x4a1fc6){return{'id':_0x4a1fc6[_0x2ca4('0x23')],'name':_0x4a1fc6[_0x2ca4('0x23')],'type':_0x4a1fc6[_0x2ca4('0x28')],'active':_0x4a1fc6[_0x2ca4('0x64')],'label':_0x4a1fc6['label'],'custom':!![]};}));});}})['then'](function(_0x504043){return{'count':_0x504043[_0x2ca4('0x31')],'rows':_0x504043};})['then'](respondWithResult(_0xa950f8,null))[_0x2ca4('0x40')](function(_0x165402){var _0x29b2c2=_0x32405c[_0x2ca4('0x2a')][_0x2ca4('0x65')]?0x1f4:_0x165402[_0x2ca4('0x66')]||0x1f4;logger[_0x2ca4('0x22')](_0x2ca4('0x67'),_0x2ca4('0x52'),_0x29b2c2,JSON[_0x2ca4('0x68')](_0x165402));delete _0x165402[_0x2ca4('0x23')];if(_0x29b2c2===0x191){_0x29b2c2=0x190;}_0xa950f8['status'](_0x29b2c2)[_0x2ca4('0x24')](_0x32405c[_0x2ca4('0x2a')]['test']?{'message':_0x2ca4('0x69'),'statusCode':_0x165402[_0x2ca4('0x66')]}:_0x165402);});};
\ No newline at end of file
+var _0x187f=['DeskAccount','rawAttributes','key','model','keys','filters','intersection','query','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','getConfigurations','DeskConfiguration','length','hasOwnProperty','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','crypto','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','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','destroy','error','stack','name','index','map'];(function(_0x19ad9a,_0x4def83){var _0x3c00d8=function(_0x37c176){while(--_0x37c176){_0x19ad9a['push'](_0x19ad9a['shift']());}};_0x3c00d8(++_0x4def83);}(_0x187f,0x134));var _0xf187=function(_0x20afca,_0x4bbec6){_0x20afca=_0x20afca-0x0;var _0x4cfbf0=_0x187f[_0x20afca];return _0x4cfbf0;};'use strict';var emlformat=require(_0xf187('0x0'));var rimraf=require(_0xf187('0x1'));var zipdir=require(_0xf187('0x2'));var jsonpatch=require(_0xf187('0x3'));var rp=require(_0xf187('0x4'));var moment=require(_0xf187('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf187('0x6'));var util=require('util');var path=require(_0xf187('0x7'));var sox=require(_0xf187('0x8'));var csv=require('to-csv');var ejs=require(_0xf187('0x9'));var fs=require('fs');var fs_extra=require(_0xf187('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf187('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf187('0xc'));var toCsv=require(_0xf187('0xd'));var querystring=require(_0xf187('0xe'));var Papa=require(_0xf187('0xf'));var Redis=require(_0xf187('0x10'));var authService=require(_0xf187('0x11'));var qs=require(_0xf187('0x12'));var as=require(_0xf187('0x13'));var hardwareService=require(_0xf187('0x14'));var logger=require(_0xf187('0x15'))(_0xf187('0x16'));var utils=require('../../config/utils');var config=require(_0xf187('0x17'));var licenseUtil=require(_0xf187('0x18'));var db=require(_0xf187('0x19'))['db'];var integrations=require(_0xf187('0x1a'));function respondWithStatusCode(_0x26c008,_0x1af2dd){_0x1af2dd=_0x1af2dd||0xcc;return function(_0x137de2){if(_0x137de2){return _0x26c008[_0xf187('0x1b')](_0x1af2dd);}return _0x26c008[_0xf187('0x1c')](_0x1af2dd)[_0xf187('0x1d')]();};}function respondWithResult(_0x40e143,_0x4d95a9){_0x4d95a9=_0x4d95a9||0xc8;return function(_0x598f3f){if(_0x598f3f){return _0x40e143[_0xf187('0x1c')](_0x4d95a9)['json'](_0x598f3f);}};}function respondWithFilteredResult(_0x204201,_0x5b262e){return function(_0x33352c){if(_0x33352c){var _0xc82fca=typeof _0x5b262e[_0xf187('0x1e')]===_0xf187('0x1f')&&typeof _0x5b262e['limit']===_0xf187('0x1f');var _0x2be928=_0x33352c[_0xf187('0x20')];var _0x4eac35=_0xc82fca?0x0:_0x5b262e[_0xf187('0x1e')];var _0x5e64b0=_0xc82fca?_0x33352c[_0xf187('0x20')]:_0x5b262e['offset']+_0x5b262e[_0xf187('0x21')];var _0x4d3fba;if(_0x5e64b0>=_0x2be928){_0x5e64b0=_0x2be928;_0x4d3fba=0xc8;}else{_0x4d3fba=0xce;}_0x204201['status'](_0x4d3fba);return _0x204201[_0xf187('0x22')](_0xf187('0x23'),_0x4eac35+'-'+_0x5e64b0+'/'+_0x2be928)[_0xf187('0x24')](_0x33352c);}return null;};}function patchUpdates(_0x1bfb6a){return function(_0x4abd57){try{jsonpatch[_0xf187('0x25')](_0x4abd57,_0x1bfb6a,!![]);}catch(_0x52814a){return BPromise['reject'](_0x52814a);}return _0x4abd57['save']();};}function saveUpdates(_0x52868e,_0x4a6799){return function(_0x3af8b8){if(_0x3af8b8){return _0x3af8b8[_0xf187('0x26')](_0x52868e)[_0xf187('0x27')](function(_0x5dc143){return _0x5dc143;});}return null;};}function removeEntity(_0x302c26,_0x5e7261){return function(_0x174101){if(_0x174101){return _0x174101[_0xf187('0x28')]()[_0xf187('0x27')](function(){_0x302c26[_0xf187('0x1c')](0xcc)[_0xf187('0x1d')]();});}};}function handleEntityNotFound(_0x399172,_0x206abe){return function(_0x48b57a){if(!_0x48b57a){_0x399172['sendStatus'](0x194);}return _0x48b57a;};}function handleError(_0x26f954,_0x52e404){_0x52e404=_0x52e404||0x1f4;return function(_0x54b226){logger[_0xf187('0x29')](_0x54b226[_0xf187('0x2a')]);if(_0x54b226[_0xf187('0x2b')]){delete _0x54b226[_0xf187('0x2b')];}_0x26f954[_0xf187('0x1c')](_0x52e404)['send'](_0x54b226);};}exports[_0xf187('0x2c')]=function(_0x6f8079,_0x40fc44){var _0x11317d={},_0x1a7b96={},_0x135950={'count':0x0,'rows':[]};var _0x464968=_[_0xf187('0x2d')](db[_0xf187('0x2e')][_0xf187('0x2f')],function(_0x22a0fa){return{'name':_0x22a0fa['fieldName'],'type':_0x22a0fa['type'][_0xf187('0x30')]};});_0x1a7b96[_0xf187('0x31')]=_[_0xf187('0x2d')](_0x464968,'name');_0x1a7b96['query']=_[_0xf187('0x32')](_0x6f8079['query']);_0x1a7b96[_0xf187('0x33')]=_[_0xf187('0x34')](_0x1a7b96[_0xf187('0x31')],_0x1a7b96[_0xf187('0x35')]);_0x11317d['attributes']=_[_0xf187('0x34')](_0x1a7b96['model'],qs[_0xf187('0x36')](_0x6f8079[_0xf187('0x35')][_0xf187('0x36')]));_0x11317d[_0xf187('0x37')]=_0x11317d['attributes']['length']?_0x11317d[_0xf187('0x37')]:_0x1a7b96[_0xf187('0x31')];if(!_0x6f8079[_0xf187('0x35')]['hasOwnProperty'](_0xf187('0x38'))){_0x11317d[_0xf187('0x21')]=qs[_0xf187('0x21')](_0x6f8079['query'][_0xf187('0x21')]);_0x11317d[_0xf187('0x1e')]=qs['offset'](_0x6f8079[_0xf187('0x35')][_0xf187('0x1e')]);}_0x11317d[_0xf187('0x39')]=qs['sort'](_0x6f8079[_0xf187('0x35')][_0xf187('0x3a')]);_0x11317d[_0xf187('0x3b')]=qs[_0xf187('0x33')](_[_0xf187('0x3c')](_0x6f8079[_0xf187('0x35')],_0x1a7b96[_0xf187('0x33')]),_0x464968);if(_0x6f8079[_0xf187('0x35')][_0xf187('0x3d')]){_0x11317d[_0xf187('0x3b')]=_[_0xf187('0x3e')](_0x11317d[_0xf187('0x3b')],{'$or':_[_0xf187('0x2d')](_0x464968,function(_0x393cc7){if(_0x393cc7[_0xf187('0x3f')]!==_0xf187('0x40')){var _0x1fe52c={};_0x1fe52c[_0x393cc7['name']]={'$like':'%'+_0x6f8079['query']['filter']+'%'};return _0x1fe52c;}})});}_0x11317d=_[_0xf187('0x3e')]({},_0x11317d,_0x6f8079[_0xf187('0x41')]);var _0x221f12={'where':_0x11317d[_0xf187('0x3b')]};return db[_0xf187('0x2e')]['count'](_0x221f12)[_0xf187('0x27')](function(_0x11458a){_0x135950['count']=_0x11458a;if(_0x6f8079[_0xf187('0x35')]['includeAll']){_0x11317d['include']=[{'all':!![]}];}return db['DeskAccount'][_0xf187('0x42')](_0x11317d);})['then'](function(_0x1f63e1){_0x135950[_0xf187('0x43')]=_0x1f63e1;return _0x135950;})[_0xf187('0x27')](respondWithFilteredResult(_0x40fc44,_0x11317d))[_0xf187('0x44')](handleError(_0x40fc44,null));};exports[_0xf187('0x45')]=function(_0x478c84,_0x3af1ff){var _0x2f3857={'raw':![],'where':{'id':_0x478c84[_0xf187('0x46')]['id']}},_0x551e7d={};_0x551e7d[_0xf187('0x31')]=_['keys'](db[_0xf187('0x2e')][_0xf187('0x2f')]);_0x551e7d[_0xf187('0x35')]=_[_0xf187('0x32')](_0x478c84[_0xf187('0x35')]);_0x551e7d[_0xf187('0x33')]=_[_0xf187('0x34')](_0x551e7d['model'],_0x551e7d['query']);_0x2f3857[_0xf187('0x37')]=_[_0xf187('0x34')](_0x551e7d[_0xf187('0x31')],qs[_0xf187('0x36')](_0x478c84['query']['fields']));_0x2f3857[_0xf187('0x37')]=_0x2f3857['attributes']['length']?_0x2f3857[_0xf187('0x37')]:_0x551e7d[_0xf187('0x31')];if(_0x478c84[_0xf187('0x35')][_0xf187('0x47')]){_0x2f3857[_0xf187('0x48')]=[{'all':!![]}];}_0x2f3857=_[_0xf187('0x3e')]({},_0x2f3857,_0x478c84[_0xf187('0x41')]);return db[_0xf187('0x2e')][_0xf187('0x49')](_0x2f3857)[_0xf187('0x27')](handleEntityNotFound(_0x3af1ff,null))['then'](respondWithResult(_0x3af1ff,null))['catch'](handleError(_0x3af1ff,null));};exports[_0xf187('0x4a')]=function(_0x71c4f9,_0x3c9ab3){return db['DeskAccount'][_0xf187('0x4a')](_0x71c4f9[_0xf187('0x4b')],{})[_0xf187('0x27')](respondWithResult(_0x3c9ab3,0xc9))[_0xf187('0x44')](handleError(_0x3c9ab3,null));};exports[_0xf187('0x26')]=function(_0x4bfd7f,_0x1f7026){if(_0x4bfd7f[_0xf187('0x4b')]['id']){delete _0x4bfd7f[_0xf187('0x4b')]['id'];}return db['DeskAccount'][_0xf187('0x49')]({'where':{'id':_0x4bfd7f[_0xf187('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f7026,null))[_0xf187('0x27')](saveUpdates(_0x4bfd7f[_0xf187('0x4b')],null))[_0xf187('0x27')](respondWithResult(_0x1f7026,null))[_0xf187('0x44')](handleError(_0x1f7026,null));};exports[_0xf187('0x28')]=function(_0x252276,_0x4ff88e){return db[_0xf187('0x2e')][_0xf187('0x49')]({'where':{'id':_0x252276[_0xf187('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ff88e,null))[_0xf187('0x27')](removeEntity(_0x4ff88e,null))['catch'](handleError(_0x4ff88e,null));};exports[_0xf187('0x4c')]=function(_0x287813,_0x53e0d8,_0x1aa5a5){var _0x1d9671={};var _0x36edca={};var _0xfb4152;var _0x48a595;return db[_0xf187('0x2e')]['findOne']({'where':{'id':_0x287813['params']['id']}})['then'](handleEntityNotFound(_0x53e0d8,null))[_0xf187('0x27')](function(_0x306ff7){if(_0x306ff7){_0xfb4152=_0x306ff7;_0x36edca[_0xf187('0x31')]=_[_0xf187('0x32')](db[_0xf187('0x4d')][_0xf187('0x2f')]);_0x36edca[_0xf187('0x35')]=_['keys'](_0x287813[_0xf187('0x35')]);_0x36edca[_0xf187('0x33')]=_['intersection'](_0x36edca['model'],_0x36edca[_0xf187('0x35')]);_0x1d9671[_0xf187('0x37')]=_[_0xf187('0x34')](_0x36edca[_0xf187('0x31')],qs['fields'](_0x287813[_0xf187('0x35')][_0xf187('0x36')]));_0x1d9671[_0xf187('0x37')]=_0x1d9671['attributes']['length']?_0x1d9671['attributes']:_0x36edca[_0xf187('0x31')];_0x1d9671[_0xf187('0x39')]=qs['sort'](_0x287813[_0xf187('0x35')]['sort']);_0x1d9671[_0xf187('0x3b')]=qs[_0xf187('0x33')](_['pick'](_0x287813[_0xf187('0x35')],_0x36edca[_0xf187('0x33')]));if(_0x287813[_0xf187('0x35')]['filter']){_0x1d9671[_0xf187('0x3b')]=_[_0xf187('0x3e')](_0x1d9671[_0xf187('0x3b')],{'$or':_[_0xf187('0x2d')](_0x1d9671[_0xf187('0x37')],function(_0x3f1f2f){var _0x1ba0e8={};_0x1ba0e8[_0x3f1f2f]={'$like':'%'+_0x287813['query']['filter']+'%'};return _0x1ba0e8;})});}_0x1d9671=_[_0xf187('0x3e')]({},_0x1d9671,_0x287813[_0xf187('0x41')]);return _0xfb4152[_0xf187('0x4c')](_0x1d9671);}})[_0xf187('0x27')](function(_0x5722ac){if(_0x5722ac){_0x48a595=_0x5722ac[_0xf187('0x4e')];if(!_0x287813[_0xf187('0x35')][_0xf187('0x4f')]('nolimit')){_0x1d9671[_0xf187('0x21')]=qs['limit'](_0x287813[_0xf187('0x35')][_0xf187('0x21')]);_0x1d9671[_0xf187('0x1e')]=qs[_0xf187('0x1e')](_0x287813['query']['offset']);}return _0xfb4152[_0xf187('0x4c')](_0x1d9671);}})['then'](function(_0x212380){if(_0x212380){return _0x212380?{'count':_0x48a595,'rows':_0x212380}:null;}})['then'](respondWithResult(_0x53e0d8,null))['catch'](handleError(_0x53e0d8,null));};exports[_0xf187('0x50')]=function(_0x25aded,_0x494bc4,_0x2feeed){if(_0x25aded[_0xf187('0x4b')]['id']){delete _0x25aded[_0xf187('0x4b')]['id'];}return db['DeskAccount'][_0xf187('0x51')]({'where':{'id':_0x25aded[_0xf187('0x46')]['id']}})[_0xf187('0x27')](handleEntityNotFound(_0x494bc4,null))[_0xf187('0x27')](function(_0x2d3171){if(_0x2d3171){_0x25aded['body']['AccountId']=_0x2d3171['id'];_0x25aded[_0xf187('0x4b')][_0xf187('0x52')]=integrations[_0xf187('0x53')](_0x25aded[_0xf187('0x4b')]['channel'],_0x25aded[_0xf187('0x4b')][_0xf187('0x3f')]);_0x25aded[_0xf187('0x4b')][_0xf187('0x54')]=integrations[_0xf187('0x55')](_0x25aded['body']['channel'],_0x25aded['body']['type']);return db[_0xf187('0x4d')]['create'](_0x25aded[_0xf187('0x4b')],{'include':[{'model':db[_0xf187('0x56')],'as':_0xf187('0x52')},{'model':db[_0xf187('0x56')],'as':_0xf187('0x54')}]});}return null;})[_0xf187('0x27')](respondWithResult(_0x494bc4,null))['catch'](handleError(_0x494bc4,null));};exports[_0xf187('0x57')]=function(_0x1b2704,_0x1e71da,_0x528aee){var _0x542b31=[{'name':_0xf187('0x58'),'label':_0xf187('0x58'),'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 _0x347d31='';return db[_0xf187('0x2e')]['findOne']({'where':{'id':_0x1b2704[_0xf187('0x46')]['id']},'attributes':['id',_0xf187('0x59'),_0xf187('0x5a'),_0xf187('0x5b'),_0xf187('0x5c'),_0xf187('0x5d'),_0xf187('0x5e'),_0xf187('0x5f'),_0xf187('0x60')]})[_0xf187('0x27')](handleEntityNotFound(_0x1e71da,null))[_0xf187('0x27')](function(_0x34d07e){if(_0x34d07e){_0x347d31=_0x34d07e['remoteUri'];var _0x28ff09=_0x347d31[_0xf187('0x61')](-0x1);if(_0x28ff09==='/'){_0x347d31=_0x347d31[_0xf187('0x62')](0x0,_0x347d31['lastIndexOf'](_0x28ff09));}var _0x13a56f={'method':'GET','uri':util[_0xf187('0x63')](_0xf187('0x64'),_0x347d31),'headers':{'Content-Type':_0xf187('0x65'),'Accept':_0xf187('0x65')},'json':!![]};if(_0x34d07e['authType']===_0xf187('0x66')){_0x13a56f[_0xf187('0x67')][_0xf187('0x68')]=util[_0xf187('0x63')](_0xf187('0x69'),new Buffer(util[_0xf187('0x63')](_0xf187('0x6a'),_0x34d07e[_0xf187('0x5b')],_0x34d07e[_0xf187('0x5c')]))[_0xf187('0x6b')]('base64'));}return rp(_0x13a56f)[_0xf187('0x27')](function(_0x365de5){return _0x542b31[_0xf187('0x6c')](_['map'](_0x365de5[_0xf187('0x6d')][_0xf187('0x6e')],function(_0x2105b4){return{'id':_0x2105b4['name'],'name':_0x2105b4[_0xf187('0x2b')],'type':_0x2105b4[_0xf187('0x3f')],'active':_0x2105b4['active'],'label':_0x2105b4[_0xf187('0x6f')],'custom':!![]};}));});}})[_0xf187('0x27')](function(_0x552c08){return{'count':_0x552c08[_0xf187('0x4e')],'rows':_0x552c08};})[_0xf187('0x27')](respondWithResult(_0x1e71da,null))[_0xf187('0x44')](function(_0x14a4de){var _0x3ae013=_0x1b2704[_0xf187('0x35')][_0xf187('0x70')]?0x1f4:_0x14a4de[_0xf187('0x71')]||0x1f4;logger[_0xf187('0x29')](_0xf187('0x72'),_0xf187('0x57'),_0x3ae013,JSON[_0xf187('0x73')](_0x14a4de));delete _0x14a4de[_0xf187('0x2b')];if(_0x3ae013===0x191){_0x3ae013=0x190;}_0x1e71da[_0xf187('0x1c')](_0x3ae013)[_0xf187('0x74')](_0x1b2704[_0xf187('0x35')]['test']?{'message':_0xf187('0x75'),'statusCode':_0x14a4de['statusCode']}:_0x14a4de);});};
\ No newline at end of file
index 03794a6..119358b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad6e=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x131a40,_0x373398){var _0x4ba48b=function(_0x6e3b85){while(--_0x6e3b85){_0x131a40['push'](_0x131a40['shift']());}};_0x4ba48b(++_0x373398);}(_0xad6e,0xac));var _0xead6=function(_0x453b96,_0x41a8c7){_0x453b96=_0x453b96-0x0;var _0x153d05=_0xad6e[_0x453b96];return _0x153d05;};'use strict';var _=require(_0xead6('0x0'));var util=require(_0xead6('0x1'));var logger=require(_0xead6('0x2'))(_0xead6('0x3'));var moment=require('moment');var BPromise=require(_0xead6('0x4'));var rp=require(_0xead6('0x5'));var fs=require('fs');var path=require(_0xead6('0x6'));var rimraf=require('rimraf');var config=require(_0xead6('0x7'));var attributes=require(_0xead6('0x8'));var integrations=require(_0xead6('0x9'));module['exports']=function(_0x22f1d1,_0xef3f35){return _0x22f1d1[_0xead6('0xa')](_0xead6('0xb'),attributes,{'tableName':_0xead6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5172=['exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x48df73,_0xc25672){var _0x351681=function(_0x3b17a2){while(--_0x3b17a2){_0x48df73['push'](_0x48df73['shift']());}};_0x351681(++_0xc25672);}(_0x5172,0x121));var _0x2517=function(_0xdc94a4,_0x1be57a){_0xdc94a4=_0xdc94a4-0x0;var _0x306cde=_0x5172[_0xdc94a4];return _0x306cde;};'use strict';var _=require(_0x2517('0x0'));var util=require(_0x2517('0x1'));var logger=require(_0x2517('0x2'))(_0x2517('0x3'));var moment=require(_0x2517('0x4'));var BPromise=require('bluebird');var rp=require(_0x2517('0x5'));var fs=require('fs');var path=require(_0x2517('0x6'));var rimraf=require(_0x2517('0x7'));var config=require(_0x2517('0x8'));var attributes=require(_0x2517('0x9'));var integrations=require(_0x2517('0xa'));module[_0x2517('0xb')]=function(_0x3d5ae0,_0x16eb82){return _0x3d5ae0[_0x2517('0xc')](_0x2517('0xd'),attributes,{'tableName':_0x2517('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0fe09af..fb4f263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0457=['result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit','map','include','model','ShowDeskAccount','find','where','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x54edd8,_0x56daea){var _0x556b71=function(_0x568000){while(--_0x568000){_0x54edd8['push'](_0x54edd8['shift']());}};_0x556b71(++_0x56daea);}(_0x0457,0xd4));var _0x7045=function(_0x2e3a19,_0x2ddfa9){_0x2e3a19=_0x2e3a19-0x0;var _0x4d979e=_0x0457[_0x2e3a19];return _0x4d979e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7045('0x0'));var BPromise=require(_0x7045('0x1'));var rs=require(_0x7045('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7045('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7045('0x4'))(_0x7045('0x5'));var config=require(_0x7045('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7045('0x7')][_0x7045('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bd82e,_0x54e92f,_0x395e5a){return new BPromise(function(_0x45b005,_0x2f78cd){return client[_0x7045('0x9')](_0x3bd82e,_0x395e5a)[_0x7045('0xa')](function(_0x535c6f){logger[_0x7045('0xb')](_0x7045('0xc'),_0x54e92f,_0x7045('0xd'));logger[_0x7045('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x54e92f,'request\x20sent',JSON[_0x7045('0xf')](_0x535c6f));if(_0x535c6f['error']){if(_0x535c6f['error'][_0x7045('0x10')]===0x1f4){logger[_0x7045('0x11')](_0x7045('0xc'),_0x54e92f,_0x535c6f[_0x7045('0x11')][_0x7045('0x12')]);return _0x2f78cd(_0x535c6f[_0x7045('0x11')][_0x7045('0x12')]);}logger[_0x7045('0x11')](_0x7045('0xc'),_0x54e92f,_0x535c6f[_0x7045('0x11')][_0x7045('0x12')]);return _0x45b005(_0x535c6f[_0x7045('0x11')][_0x7045('0x12')]);}else{logger[_0x7045('0xb')]('DeskAccount,\x20%s,\x20%s',_0x54e92f,'request\x20sent');_0x45b005(_0x535c6f[_0x7045('0x13')]['message']);}})[_0x7045('0x14')](function(_0x62237f){logger[_0x7045('0x11')]('DeskAccount,\x20%s,\x20%s',_0x54e92f,_0x62237f);_0x2f78cd(_0x62237f);});});}exports[_0x7045('0x15')]=function(_0x4467d9){var _0x3cabc0=this;return new Promise(function(_0x27d0d7,_0x557d05){return db[_0x7045('0x16')]['findAll']({'raw':_0x4467d9[_0x7045('0x17')]?_0x4467d9['options'][_0x7045('0x18')]===undefined?!![]:![]:!![],'where':_0x4467d9[_0x7045('0x17')]?_0x4467d9['options']['where']||null:null,'attributes':_0x4467d9[_0x7045('0x17')]?_0x4467d9[_0x7045('0x17')][_0x7045('0x19')]||null:null,'limit':_0x4467d9[_0x7045('0x17')]?_0x4467d9['options'][_0x7045('0x1a')]||null:null,'include':_0x4467d9[_0x7045('0x17')]?_0x4467d9['options']['include']?_[_0x7045('0x1b')](_0x4467d9[_0x7045('0x17')][_0x7045('0x1c')],function(_0x12882b){return{'model':db[_0x12882b['model']],'as':_0x12882b['as'],'attributes':_0x12882b['attributes'],'include':_0x12882b[_0x7045('0x1c')]?_[_0x7045('0x1b')](_0x12882b['include'],function(_0x26c58c){return{'model':db[_0x26c58c['model']],'as':_0x26c58c['as'],'attributes':_0x26c58c['attributes'],'include':_0x26c58c['include']?_[_0x7045('0x1b')](_0x26c58c[_0x7045('0x1c')],function(_0x54bbe7){return{'model':db[_0x54bbe7[_0x7045('0x1d')]],'as':_0x54bbe7['as'],'attributes':_0x54bbe7[_0x7045('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7045('0xa')](function(_0x111aea){logger['info']('GetDeskAccount',_0x4467d9);logger[_0x7045('0xe')](_0x7045('0x15'),_0x4467d9,JSON[_0x7045('0xf')](_0x111aea));_0x27d0d7(_0x111aea);})[_0x7045('0x14')](function(_0x2678d0){logger[_0x7045('0x11')](_0x7045('0x15'),_0x2678d0['message'],_0x4467d9);_0x557d05(_0x3cabc0[_0x7045('0x11')](0x1f4,_0x2678d0[_0x7045('0x12')]));});});};exports[_0x7045('0x1e')]=function(_0x13e179){var _0x6bad91=this;return new Promise(function(_0x2e56a7,_0x70ecb4){return db[_0x7045('0x16')][_0x7045('0x1f')]({'raw':_0x13e179[_0x7045('0x17')]?_0x13e179[_0x7045('0x17')][_0x7045('0x18')]===undefined?!![]:![]:!![],'where':_0x13e179[_0x7045('0x17')]?_0x13e179['options'][_0x7045('0x20')]||null:null,'attributes':_0x13e179['options']?_0x13e179[_0x7045('0x17')]['attributes']||null:null,'include':_0x13e179[_0x7045('0x17')]?_0x13e179[_0x7045('0x17')][_0x7045('0x1c')]?_[_0x7045('0x1b')](_0x13e179['options'][_0x7045('0x1c')],function(_0x568f85){return{'model':db[_0x568f85[_0x7045('0x1d')]],'as':_0x568f85['as'],'attributes':_0x568f85[_0x7045('0x19')],'include':_0x568f85[_0x7045('0x1c')]?_[_0x7045('0x1b')](_0x568f85['include'],function(_0x37af64){return{'model':db[_0x37af64[_0x7045('0x1d')]],'as':_0x37af64['as'],'attributes':_0x37af64[_0x7045('0x19')],'include':_0x37af64[_0x7045('0x1c')]?_[_0x7045('0x1b')](_0x37af64['include'],function(_0x29c062){return{'model':db[_0x29c062['model']],'as':_0x29c062['as'],'attributes':_0x29c062[_0x7045('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7045('0xa')](function(_0x4ae624){logger[_0x7045('0xb')](_0x7045('0x1e'),_0x13e179);logger['debug'](_0x7045('0x1e'),_0x13e179,JSON[_0x7045('0xf')](_0x4ae624));_0x2e56a7(_0x4ae624);})[_0x7045('0x14')](function(_0x3d3f2b){logger[_0x7045('0x11')](_0x7045('0x1e'),_0x3d3f2b['message'],_0x13e179);_0x70ecb4(_0x6bad91[_0x7045('0x11')](0x1f4,_0x3d3f2b[_0x7045('0x12')]));});});};
\ No newline at end of file
+var _0x0cbd=['message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x24712a,_0x8da508){var _0x1eccf8=function(_0x2a83f6){while(--_0x2a83f6){_0x24712a['push'](_0x24712a['shift']());}};_0x1eccf8(++_0x8da508);}(_0x0cbd,0x138));var _0xd0cb=function(_0x352e52,_0x34a693){_0x352e52=_0x352e52-0x0;var _0x5b5f2a=_0x0cbd[_0x352e52];return _0x5b5f2a;};'use strict';var _=require(_0xd0cb('0x0'));var util=require(_0xd0cb('0x1'));var moment=require(_0xd0cb('0x2'));var BPromise=require(_0xd0cb('0x3'));var rs=require(_0xd0cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0cb('0x5'))['db'];var utils=require(_0xd0cb('0x6'));var logger=require(_0xd0cb('0x7'))(_0xd0cb('0x8'));var config=require(_0xd0cb('0x9'));var jayson=require(_0xd0cb('0xa'));var client=jayson['client'][_0xd0cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e3e5f,_0x4a24dc,_0x3cdf29){return new BPromise(function(_0x2ed558,_0x2abeef){return client['request'](_0x3e3e5f,_0x3cdf29)[_0xd0cb('0xc')](function(_0x2fbf55){logger[_0xd0cb('0xd')](_0xd0cb('0xe'),_0x4a24dc,_0xd0cb('0xf'));logger[_0xd0cb('0x10')](_0xd0cb('0x11'),_0x4a24dc,'request\x20sent',JSON[_0xd0cb('0x12')](_0x2fbf55));if(_0x2fbf55[_0xd0cb('0x13')]){if(_0x2fbf55[_0xd0cb('0x13')][_0xd0cb('0x14')]===0x1f4){logger[_0xd0cb('0x13')](_0xd0cb('0xe'),_0x4a24dc,_0x2fbf55[_0xd0cb('0x13')]['message']);return _0x2abeef(_0x2fbf55['error'][_0xd0cb('0x15')]);}logger[_0xd0cb('0x13')](_0xd0cb('0xe'),_0x4a24dc,_0x2fbf55[_0xd0cb('0x13')][_0xd0cb('0x15')]);return _0x2ed558(_0x2fbf55[_0xd0cb('0x13')][_0xd0cb('0x15')]);}else{logger[_0xd0cb('0xd')]('DeskAccount,\x20%s,\x20%s',_0x4a24dc,_0xd0cb('0xf'));_0x2ed558(_0x2fbf55[_0xd0cb('0x16')][_0xd0cb('0x15')]);}})['catch'](function(_0x23f53e){logger[_0xd0cb('0x13')](_0xd0cb('0xe'),_0x4a24dc,_0x23f53e);_0x2abeef(_0x23f53e);});});}exports[_0xd0cb('0x17')]=function(_0x571706){var _0x5d3249=this;return new Promise(function(_0x54d777,_0x4c61d7){return db[_0xd0cb('0x18')][_0xd0cb('0x19')]({'raw':_0x571706[_0xd0cb('0x1a')]?_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x571706[_0xd0cb('0x1a')]?_0x571706['options'][_0xd0cb('0x1c')]||null:null,'attributes':_0x571706[_0xd0cb('0x1a')]?_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1d')]||null:null,'limit':_0x571706[_0xd0cb('0x1a')]?_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1e')]||null:null,'include':_0x571706[_0xd0cb('0x1a')]?_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1f')],function(_0x3ef6b0){return{'model':db[_0x3ef6b0[_0xd0cb('0x21')]],'as':_0x3ef6b0['as'],'attributes':_0x3ef6b0[_0xd0cb('0x1d')],'include':_0x3ef6b0[_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x3ef6b0[_0xd0cb('0x1f')],function(_0x520690){return{'model':db[_0x520690[_0xd0cb('0x21')]],'as':_0x520690['as'],'attributes':_0x520690['attributes'],'include':_0x520690[_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x520690['include'],function(_0x2ead8e){return{'model':db[_0x2ead8e['model']],'as':_0x2ead8e['as'],'attributes':_0x2ead8e[_0xd0cb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd0cb('0xc')](function(_0x3e420b){logger[_0xd0cb('0xd')](_0xd0cb('0x17'),_0x571706);logger['debug'](_0xd0cb('0x17'),_0x571706,JSON[_0xd0cb('0x12')](_0x3e420b));_0x54d777(_0x3e420b);})[_0xd0cb('0x22')](function(_0x7f47ba){logger[_0xd0cb('0x13')](_0xd0cb('0x17'),_0x7f47ba['message'],_0x571706);_0x4c61d7(_0x5d3249[_0xd0cb('0x13')](0x1f4,_0x7f47ba[_0xd0cb('0x15')]));});});};exports[_0xd0cb('0x23')]=function(_0x2b3eb4){var _0x286983=this;return new Promise(function(_0x31036b,_0x1399aa){return db[_0xd0cb('0x18')][_0xd0cb('0x24')]({'raw':_0x2b3eb4[_0xd0cb('0x1a')]?_0x2b3eb4[_0xd0cb('0x1a')][_0xd0cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b3eb4[_0xd0cb('0x1a')]?_0x2b3eb4['options'][_0xd0cb('0x1c')]||null:null,'attributes':_0x2b3eb4[_0xd0cb('0x1a')]?_0x2b3eb4[_0xd0cb('0x1a')][_0xd0cb('0x1d')]||null:null,'include':_0x2b3eb4[_0xd0cb('0x1a')]?_0x2b3eb4[_0xd0cb('0x1a')]['include']?_[_0xd0cb('0x20')](_0x2b3eb4[_0xd0cb('0x1a')][_0xd0cb('0x1f')],function(_0x36c2c8){return{'model':db[_0x36c2c8[_0xd0cb('0x21')]],'as':_0x36c2c8['as'],'attributes':_0x36c2c8[_0xd0cb('0x1d')],'include':_0x36c2c8[_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x36c2c8['include'],function(_0x301a4f){return{'model':db[_0x301a4f[_0xd0cb('0x21')]],'as':_0x301a4f['as'],'attributes':_0x301a4f[_0xd0cb('0x1d')],'include':_0x301a4f[_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x301a4f[_0xd0cb('0x1f')],function(_0x3c3fd9){return{'model':db[_0x3c3fd9[_0xd0cb('0x21')]],'as':_0x3c3fd9['as'],'attributes':_0x3c3fd9[_0xd0cb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd0cb('0xc')](function(_0x553a1c){logger[_0xd0cb('0xd')](_0xd0cb('0x23'),_0x2b3eb4);logger[_0xd0cb('0x10')](_0xd0cb('0x23'),_0x2b3eb4,JSON[_0xd0cb('0x12')](_0x553a1c));_0x31036b(_0x553a1c);})[_0xd0cb('0x22')](function(_0x2283ae){logger[_0xd0cb('0x13')](_0xd0cb('0x23'),_0x2283ae[_0xd0cb('0x15')],_0x2b3eb4);_0x1399aa(_0x286983[_0xd0cb('0x13')](0x1f4,_0x2283ae[_0xd0cb('0x15')]));});});};
\ No newline at end of file
index 3ec3623..55b08a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x55ca,0x126));var _0xa55c=function(_0x3ab46c,_0x4d26cc){_0x3ab46c=_0x3ab46c-0x0;var _0x2c7e90=_0x55ca[_0x3ab46c];return _0x2c7e90;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router;
\ No newline at end of file
+var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x40ca9e,_0x4e610f){var _0x3aae9f=function(_0x944212){while(--_0x944212){_0x40ca9e['push'](_0x40ca9e['shift']());}};_0x3aae9f(++_0x4e610f);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e878b,_0x4732ad){_0x4e878b=_0x4e878b-0x0;var _0x4126aa=_0xedd9[_0x4e878b];return _0x4126aa;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router;
\ No newline at end of file
index 132f8fc..aeb21e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f5d=['exports','STRING','sequelize'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0x2f5d,0xe6));var _0xd2f5=function(_0x1d94f1,_0x1ff1b5){_0x1d94f1=_0x1d94f1-0x0;var _0x44a9f0=_0x2f5d[_0x1d94f1];return _0x44a9f0;};'use strict';var Sequelize=require(_0xd2f5('0x0'));module[_0xd2f5('0x1')]={'name':{'type':Sequelize[_0xd2f5('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x48ea=['STRING','sequelize','exports'];(function(_0x1a450a,_0x4dcb72){var _0x4f8ef4=function(_0x44c6ba){while(--_0x44c6ba){_0x1a450a['push'](_0x1a450a['shift']());}};_0x4f8ef4(++_0x4dcb72);}(_0x48ea,0x19c));var _0xa48e=function(_0x281f54,_0x3ac707){_0x281f54=_0x281f54-0x0;var _0x104d42=_0x48ea[_0x281f54];return _0x104d42;};'use strict';var Sequelize=require(_0xa48e('0x0'));module[_0xa48e('0x1')]={'name':{'type':Sequelize[_0xa48e('0x2')]},'description':{'type':Sequelize[_0xa48e('0x2')]}};
\ No newline at end of file
index 925cab0..1e5ce43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ce8=['fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','show','params','merge','options','create','body','catch','find','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x3fa174,_0x1f990c){var _0x44b3fd=function(_0x1f96b0){while(--_0x1f96b0){_0x3fa174['push'](_0x3fa174['shift']());}};_0x44b3fd(++_0x1f990c);}(_0x3ce8,0x192));var _0x83ce=function(_0x8a95ee,_0x52b1ed){_0x8a95ee=_0x8a95ee-0x0;var _0x34039c=_0x3ce8[_0x8a95ee];return _0x34039c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83ce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x83ce('0x1'));var moment=require(_0x83ce('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x83ce('0x3'));var util=require(_0x83ce('0x4'));var path=require(_0x83ce('0x5'));var sox=require(_0x83ce('0x6'));var csv=require(_0x83ce('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83ce('0x8'));var _=require('lodash');var squel=require(_0x83ce('0x9'));var crypto=require(_0x83ce('0xa'));var jsforce=require(_0x83ce('0xb'));var deskjs=require(_0x83ce('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x83ce('0xd'));var authService=require(_0x83ce('0xe'));var qs=require(_0x83ce('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x83ce('0x10'))(_0x83ce('0x11'));var utils=require('../../config/utils');var config=require(_0x83ce('0x12'));var licenseUtil=require(_0x83ce('0x13'));var db=require(_0x83ce('0x14'))['db'];function respondWithStatusCode(_0xacfa0f,_0x23cec9){_0x23cec9=_0x23cec9||0xcc;return function(_0x1a41f4){if(_0x1a41f4){return _0xacfa0f[_0x83ce('0x15')](_0x23cec9);}return _0xacfa0f[_0x83ce('0x16')](_0x23cec9)[_0x83ce('0x17')]();};}function respondWithResult(_0x246087,_0x28a0a2){_0x28a0a2=_0x28a0a2||0xc8;return function(_0x2882d2){if(_0x2882d2){return _0x246087[_0x83ce('0x16')](_0x28a0a2)[_0x83ce('0x18')](_0x2882d2);}};}function respondWithFilteredResult(_0x13804f,_0x268cd4){return function(_0x7bc390){if(_0x7bc390){var _0x45824a=typeof _0x268cd4['offset']===_0x83ce('0x19')&&typeof _0x268cd4[_0x83ce('0x1a')]===_0x83ce('0x19');var _0x49cf73=_0x7bc390[_0x83ce('0x1b')];var _0x22cc1f=_0x45824a?0x0:_0x268cd4[_0x83ce('0x1c')];var _0x198ff1=_0x45824a?_0x7bc390[_0x83ce('0x1b')]:_0x268cd4[_0x83ce('0x1c')]+_0x268cd4[_0x83ce('0x1a')];var _0x2fbf2a;if(_0x198ff1>=_0x49cf73){_0x198ff1=_0x49cf73;_0x2fbf2a=0xc8;}else{_0x2fbf2a=0xce;}_0x13804f[_0x83ce('0x16')](_0x2fbf2a);return _0x13804f['set']('Content-Range',_0x22cc1f+'-'+_0x198ff1+'/'+_0x49cf73)[_0x83ce('0x18')](_0x7bc390);}return null;};}function patchUpdates(_0x3b626a){return function(_0x2f8b58){try{jsonpatch[_0x83ce('0x1d')](_0x2f8b58,_0x3b626a,!![]);}catch(_0x255179){return BPromise[_0x83ce('0x1e')](_0x255179);}return _0x2f8b58[_0x83ce('0x1f')]();};}function saveUpdates(_0x5247bd,_0x2dd7f1){return function(_0x214736){if(_0x214736){return _0x214736[_0x83ce('0x20')](_0x5247bd)[_0x83ce('0x21')](function(_0x37651d){return _0x37651d;});}return null;};}function removeEntity(_0x207d82,_0x311dd9){return function(_0x157d8c){if(_0x157d8c){return _0x157d8c[_0x83ce('0x22')]()[_0x83ce('0x21')](function(){_0x207d82[_0x83ce('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x337e19,_0x144b99){return function(_0x2a6843){if(!_0x2a6843){_0x337e19['sendStatus'](0x194);}return _0x2a6843;};}function handleError(_0x31d852,_0x5e86be){_0x5e86be=_0x5e86be||0x1f4;return function(_0x203e66){logger[_0x83ce('0x23')](_0x203e66[_0x83ce('0x24')]);if(_0x203e66[_0x83ce('0x25')]){delete _0x203e66['name'];}_0x31d852[_0x83ce('0x16')](_0x5e86be)[_0x83ce('0x26')](_0x203e66);};}exports[_0x83ce('0x27')]=function(_0xaa4101,_0x4c51e4){var _0x1e29be={},_0x4af7b0={},_0x2d7378={'count':0x0,'rows':[]};var _0x53ab4b=_[_0x83ce('0x28')](db[_0x83ce('0x29')][_0x83ce('0x2a')],function(_0xd8eb8f){return{'name':_0xd8eb8f[_0x83ce('0x2b')],'type':_0xd8eb8f[_0x83ce('0x2c')][_0x83ce('0x2d')]};});_0x4af7b0['model']=_[_0x83ce('0x28')](_0x53ab4b,'name');_0x4af7b0['query']=_[_0x83ce('0x2e')](_0xaa4101[_0x83ce('0x2f')]);_0x4af7b0[_0x83ce('0x30')]=_[_0x83ce('0x31')](_0x4af7b0[_0x83ce('0x32')],_0x4af7b0[_0x83ce('0x2f')]);_0x1e29be[_0x83ce('0x33')]=_['intersection'](_0x4af7b0[_0x83ce('0x32')],qs[_0x83ce('0x34')](_0xaa4101[_0x83ce('0x2f')][_0x83ce('0x34')]));_0x1e29be[_0x83ce('0x33')]=_0x1e29be[_0x83ce('0x33')][_0x83ce('0x35')]?_0x1e29be[_0x83ce('0x33')]:_0x4af7b0[_0x83ce('0x32')];if(!_0xaa4101[_0x83ce('0x2f')][_0x83ce('0x36')](_0x83ce('0x37'))){_0x1e29be[_0x83ce('0x1a')]=qs[_0x83ce('0x1a')](_0xaa4101[_0x83ce('0x2f')][_0x83ce('0x1a')]);_0x1e29be['offset']=qs[_0x83ce('0x1c')](_0xaa4101[_0x83ce('0x2f')][_0x83ce('0x1c')]);}_0x1e29be[_0x83ce('0x38')]=qs[_0x83ce('0x39')](_0xaa4101[_0x83ce('0x2f')]['sort']);_0x1e29be[_0x83ce('0x3a')]=qs[_0x83ce('0x30')](_[_0x83ce('0x3b')](_0xaa4101['query'],_0x4af7b0[_0x83ce('0x30')]),_0x53ab4b);if(_0xaa4101[_0x83ce('0x2f')][_0x83ce('0x3c')]){_0x1e29be[_0x83ce('0x3a')]=_['merge'](_0x1e29be[_0x83ce('0x3a')],{'$or':_[_0x83ce('0x28')](_0x53ab4b,function(_0x3c5e66){if(_0x3c5e66[_0x83ce('0x2c')]!=='VIRTUAL'){var _0x5a9014={};_0x5a9014[_0x3c5e66[_0x83ce('0x25')]]={'$like':'%'+_0xaa4101[_0x83ce('0x2f')][_0x83ce('0x3c')]+'%'};return _0x5a9014;}})});}_0x1e29be=_['merge']({},_0x1e29be,_0xaa4101['options']);var _0x36a31f={'where':_0x1e29be[_0x83ce('0x3a')]};return db[_0x83ce('0x29')][_0x83ce('0x1b')](_0x36a31f)['then'](function(_0x29e5c2){_0x2d7378['count']=_0x29e5c2;if(_0xaa4101[_0x83ce('0x2f')][_0x83ce('0x3d')]){_0x1e29be[_0x83ce('0x3e')]=[{'all':!![]}];}return db[_0x83ce('0x29')][_0x83ce('0x3f')](_0x1e29be);})[_0x83ce('0x21')](function(_0x2323f5){_0x2d7378[_0x83ce('0x40')]=_0x2323f5;return _0x2d7378;})[_0x83ce('0x21')](respondWithFilteredResult(_0x4c51e4,_0x1e29be))['catch'](handleError(_0x4c51e4,null));};exports[_0x83ce('0x41')]=function(_0x42b68e,_0x3143ea){var _0x1bbac3={'raw':![],'where':{'id':_0x42b68e[_0x83ce('0x42')]['id']}},_0x5c0d2f={};_0x5c0d2f[_0x83ce('0x32')]=_[_0x83ce('0x2e')](db[_0x83ce('0x29')][_0x83ce('0x2a')]);_0x5c0d2f['query']=_['keys'](_0x42b68e['query']);_0x5c0d2f[_0x83ce('0x30')]=_['intersection'](_0x5c0d2f['model'],_0x5c0d2f[_0x83ce('0x2f')]);_0x1bbac3[_0x83ce('0x33')]=_[_0x83ce('0x31')](_0x5c0d2f[_0x83ce('0x32')],qs[_0x83ce('0x34')](_0x42b68e[_0x83ce('0x2f')]['fields']));_0x1bbac3[_0x83ce('0x33')]=_0x1bbac3['attributes'][_0x83ce('0x35')]?_0x1bbac3[_0x83ce('0x33')]:_0x5c0d2f[_0x83ce('0x32')];if(_0x42b68e[_0x83ce('0x2f')][_0x83ce('0x3d')]){_0x1bbac3[_0x83ce('0x3e')]=[{'all':!![]}];}_0x1bbac3=_[_0x83ce('0x43')]({},_0x1bbac3,_0x42b68e[_0x83ce('0x44')]);return db[_0x83ce('0x29')]['find'](_0x1bbac3)[_0x83ce('0x21')](handleEntityNotFound(_0x3143ea,null))[_0x83ce('0x21')](respondWithResult(_0x3143ea,null))['catch'](handleError(_0x3143ea,null));};exports[_0x83ce('0x45')]=function(_0x2797f9,_0x96a53){return db[_0x83ce('0x29')][_0x83ce('0x45')](_0x2797f9[_0x83ce('0x46')],{})['then'](respondWithResult(_0x96a53,0xc9))['catch'](handleError(_0x96a53,null));};exports[_0x83ce('0x20')]=function(_0x4d5ef7,_0x26fcb3){if(_0x4d5ef7['body']['id']){delete _0x4d5ef7[_0x83ce('0x46')]['id'];}return db[_0x83ce('0x29')]['find']({'where':{'id':_0x4d5ef7['params']['id']}})[_0x83ce('0x21')](handleEntityNotFound(_0x26fcb3,null))[_0x83ce('0x21')](saveUpdates(_0x4d5ef7['body'],null))[_0x83ce('0x21')](respondWithResult(_0x26fcb3,null))[_0x83ce('0x47')](handleError(_0x26fcb3,null));};exports[_0x83ce('0x22')]=function(_0x5065b2,_0x55b453){return db[_0x83ce('0x29')][_0x83ce('0x48')]({'where':{'id':_0x5065b2[_0x83ce('0x42')]['id']}})['then'](handleEntityNotFound(_0x55b453,null))[_0x83ce('0x21')](removeEntity(_0x55b453,null))[_0x83ce('0x47')](handleError(_0x55b453,null));};exports[_0x83ce('0x49')]=function(_0xad89d9,_0x223646,_0x2c1d6b){var _0x16a842={};var _0x4969cd={};var _0x4fb901;var _0x479e37;return db['DeskConfiguration'][_0x83ce('0x4a')]({'where':{'id':_0xad89d9[_0x83ce('0x42')]['id']}})[_0x83ce('0x21')](handleEntityNotFound(_0x223646,null))[_0x83ce('0x21')](function(_0x3b03b5){if(_0x3b03b5){_0x4fb901=_0x3b03b5;_0x4969cd[_0x83ce('0x32')]=_['keys'](db[_0x83ce('0x4b')]['rawAttributes']);_0x4969cd[_0x83ce('0x2f')]=_[_0x83ce('0x2e')](_0xad89d9[_0x83ce('0x2f')]);_0x4969cd['filters']=_[_0x83ce('0x31')](_0x4969cd[_0x83ce('0x32')],_0x4969cd[_0x83ce('0x2f')]);_0x16a842[_0x83ce('0x33')]=_[_0x83ce('0x31')](_0x4969cd['model'],qs[_0x83ce('0x34')](_0xad89d9['query'][_0x83ce('0x34')]));_0x16a842[_0x83ce('0x33')]=_0x16a842['attributes'][_0x83ce('0x35')]?_0x16a842[_0x83ce('0x33')]:_0x4969cd[_0x83ce('0x32')];_0x16a842[_0x83ce('0x38')]=qs[_0x83ce('0x39')](_0xad89d9[_0x83ce('0x2f')]['sort']);_0x16a842[_0x83ce('0x3a')]=qs['filters'](_[_0x83ce('0x3b')](_0xad89d9[_0x83ce('0x2f')],_0x4969cd[_0x83ce('0x30')]));if(_0xad89d9[_0x83ce('0x2f')][_0x83ce('0x3c')]){_0x16a842[_0x83ce('0x3a')]=_[_0x83ce('0x43')](_0x16a842[_0x83ce('0x3a')],{'$or':_[_0x83ce('0x28')](_0x16a842['attributes'],function(_0x3a13ee){var _0x46fcc0={};_0x46fcc0[_0x3a13ee]={'$like':'%'+_0xad89d9[_0x83ce('0x2f')][_0x83ce('0x3c')]+'%'};return _0x46fcc0;})});}_0x16a842=_[_0x83ce('0x43')]({},_0x16a842,_0xad89d9[_0x83ce('0x44')]);return _0x4fb901[_0x83ce('0x49')](_0x16a842);}})[_0x83ce('0x21')](function(_0x1ce7f9){if(_0x1ce7f9){_0x479e37=_0x1ce7f9[_0x83ce('0x35')];if(!_0xad89d9[_0x83ce('0x2f')]['hasOwnProperty'](_0x83ce('0x37'))){_0x16a842[_0x83ce('0x1a')]=qs['limit'](_0xad89d9[_0x83ce('0x2f')]['limit']);_0x16a842[_0x83ce('0x1c')]=qs[_0x83ce('0x1c')](_0xad89d9['query']['offset']);}return _0x4fb901[_0x83ce('0x49')](_0x16a842);}})[_0x83ce('0x21')](function(_0x451c12){if(_0x451c12){return _0x451c12?{'count':_0x479e37,'rows':_0x451c12}:null;}})[_0x83ce('0x21')](respondWithResult(_0x223646,null))['catch'](handleError(_0x223646,null));};exports[_0x83ce('0x4c')]=function(_0x5304c8,_0x1e5203,_0x57201f){var _0x4f5f58={};var _0x62b20d={};var _0x1a7dc1;var _0x41026b;return db[_0x83ce('0x29')][_0x83ce('0x4a')]({'where':{'id':_0x5304c8[_0x83ce('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e5203,null))[_0x83ce('0x21')](function(_0x24b260){if(_0x24b260){_0x1a7dc1=_0x24b260;_0x62b20d[_0x83ce('0x32')]=_[_0x83ce('0x2e')](db[_0x83ce('0x4b')][_0x83ce('0x2a')]);_0x62b20d[_0x83ce('0x2f')]=_[_0x83ce('0x2e')](_0x5304c8[_0x83ce('0x2f')]);_0x62b20d[_0x83ce('0x30')]=_[_0x83ce('0x31')](_0x62b20d[_0x83ce('0x32')],_0x62b20d[_0x83ce('0x2f')]);_0x4f5f58[_0x83ce('0x33')]=_[_0x83ce('0x31')](_0x62b20d[_0x83ce('0x32')],qs[_0x83ce('0x34')](_0x5304c8[_0x83ce('0x2f')][_0x83ce('0x34')]));_0x4f5f58[_0x83ce('0x33')]=_0x4f5f58[_0x83ce('0x33')][_0x83ce('0x35')]?_0x4f5f58[_0x83ce('0x33')]:_0x62b20d['model'];_0x4f5f58['order']=qs['sort'](_0x5304c8[_0x83ce('0x2f')][_0x83ce('0x39')]);_0x4f5f58[_0x83ce('0x3a')]=qs['filters'](_[_0x83ce('0x3b')](_0x5304c8[_0x83ce('0x2f')],_0x62b20d['filters']));if(_0x5304c8[_0x83ce('0x2f')][_0x83ce('0x3c')]){_0x4f5f58[_0x83ce('0x3a')]=_[_0x83ce('0x43')](_0x4f5f58[_0x83ce('0x3a')],{'$or':_[_0x83ce('0x28')](_0x4f5f58['attributes'],function(_0x5946f3){var _0x3f30e0={};_0x3f30e0[_0x5946f3]={'$like':'%'+_0x5304c8[_0x83ce('0x2f')][_0x83ce('0x3c')]+'%'};return _0x3f30e0;})});}_0x4f5f58=_['merge']({},_0x4f5f58,_0x5304c8['options']);return _0x1a7dc1[_0x83ce('0x4c')](_0x4f5f58);}})[_0x83ce('0x21')](function(_0x348f64){if(_0x348f64){_0x41026b=_0x348f64[_0x83ce('0x35')];if(!_0x5304c8[_0x83ce('0x2f')][_0x83ce('0x36')](_0x83ce('0x37'))){_0x4f5f58[_0x83ce('0x1a')]=qs['limit'](_0x5304c8['query']['limit']);_0x4f5f58['offset']=qs[_0x83ce('0x1c')](_0x5304c8[_0x83ce('0x2f')][_0x83ce('0x1c')]);}return _0x1a7dc1[_0x83ce('0x4c')](_0x4f5f58);}})[_0x83ce('0x21')](function(_0x5544bf){if(_0x5544bf){return _0x5544bf?{'count':_0x41026b,'rows':_0x5544bf}:null;}})[_0x83ce('0x21')](respondWithResult(_0x1e5203,null))[_0x83ce('0x47')](handleError(_0x1e5203,null));};exports['getDescriptions']=function(_0x358116,_0x3ea0a2,_0x4d78b0){var _0x108335={};var _0x4bd2a5={};var _0x2a154d;var _0xd85149;return db[_0x83ce('0x29')][_0x83ce('0x4a')]({'where':{'id':_0x358116[_0x83ce('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ea0a2,null))['then'](function(_0x485248){if(_0x485248){_0x2a154d=_0x485248;_0x4bd2a5['model']=_[_0x83ce('0x2e')](db[_0x83ce('0x4b')][_0x83ce('0x2a')]);_0x4bd2a5['query']=_[_0x83ce('0x2e')](_0x358116[_0x83ce('0x2f')]);_0x4bd2a5[_0x83ce('0x30')]=_['intersection'](_0x4bd2a5[_0x83ce('0x32')],_0x4bd2a5['query']);_0x108335[_0x83ce('0x33')]=_[_0x83ce('0x31')](_0x4bd2a5['model'],qs[_0x83ce('0x34')](_0x358116['query'][_0x83ce('0x34')]));_0x108335[_0x83ce('0x33')]=_0x108335[_0x83ce('0x33')]['length']?_0x108335[_0x83ce('0x33')]:_0x4bd2a5[_0x83ce('0x32')];_0x108335[_0x83ce('0x38')]=qs[_0x83ce('0x39')](_0x358116[_0x83ce('0x2f')][_0x83ce('0x39')]);_0x108335[_0x83ce('0x3a')]=qs[_0x83ce('0x30')](_[_0x83ce('0x3b')](_0x358116[_0x83ce('0x2f')],_0x4bd2a5[_0x83ce('0x30')]));if(_0x358116[_0x83ce('0x2f')][_0x83ce('0x3c')]){_0x108335[_0x83ce('0x3a')]=_['merge'](_0x108335[_0x83ce('0x3a')],{'$or':_[_0x83ce('0x28')](_0x108335[_0x83ce('0x33')],function(_0xe115b){var _0x47bb4f={};_0x47bb4f[_0xe115b]={'$like':'%'+_0x358116['query'][_0x83ce('0x3c')]+'%'};return _0x47bb4f;})});}_0x108335=_[_0x83ce('0x43')]({},_0x108335,_0x358116[_0x83ce('0x44')]);return _0x2a154d['getDescriptions'](_0x108335);}})['then'](function(_0xc1ed5){if(_0xc1ed5){_0xd85149=_0xc1ed5[_0x83ce('0x35')];if(!_0x358116['query'][_0x83ce('0x36')](_0x83ce('0x37'))){_0x108335[_0x83ce('0x1a')]=qs[_0x83ce('0x1a')](_0x358116['query'][_0x83ce('0x1a')]);_0x108335['offset']=qs['offset'](_0x358116[_0x83ce('0x2f')][_0x83ce('0x1c')]);}return _0x2a154d[_0x83ce('0x4d')](_0x108335);}})[_0x83ce('0x21')](function(_0x37b73c){if(_0x37b73c){return _0x37b73c?{'count':_0xd85149,'rows':_0x37b73c}:null;}})['then'](respondWithResult(_0x3ea0a2,null))[_0x83ce('0x47')](handleError(_0x3ea0a2,null));};exports[_0x83ce('0x4e')]=function(_0x1e82ac,_0x298e2e,_0x4d16a2){var _0x44a0b0={};var _0x54c066={};var _0x4887a1;var _0x347514;return db[_0x83ce('0x29')][_0x83ce('0x4a')]({'where':{'id':_0x1e82ac[_0x83ce('0x42')]['id']}})[_0x83ce('0x21')](handleEntityNotFound(_0x298e2e,null))[_0x83ce('0x21')](function(_0x483873){if(_0x483873){_0x4887a1=_0x483873;_0x54c066['model']=_[_0x83ce('0x2e')](db[_0x83ce('0x4f')]['rawAttributes']);_0x54c066[_0x83ce('0x2f')]=_['keys'](_0x1e82ac[_0x83ce('0x2f')]);_0x54c066[_0x83ce('0x30')]=_[_0x83ce('0x31')](_0x54c066[_0x83ce('0x32')],_0x54c066[_0x83ce('0x2f')]);_0x44a0b0['attributes']=_[_0x83ce('0x31')](_0x54c066[_0x83ce('0x32')],qs['fields'](_0x1e82ac[_0x83ce('0x2f')][_0x83ce('0x34')]));_0x44a0b0['attributes']=_0x44a0b0[_0x83ce('0x33')][_0x83ce('0x35')]?_0x44a0b0['attributes']:_0x54c066[_0x83ce('0x32')];_0x44a0b0['order']=qs['sort'](_0x1e82ac[_0x83ce('0x2f')][_0x83ce('0x39')]);_0x44a0b0[_0x83ce('0x3a')]=qs['filters'](_[_0x83ce('0x3b')](_0x1e82ac[_0x83ce('0x2f')],_0x54c066[_0x83ce('0x30')]));if(_0x1e82ac['query']['filter']){_0x44a0b0[_0x83ce('0x3a')]=_[_0x83ce('0x43')](_0x44a0b0['where'],{'$or':_[_0x83ce('0x28')](_0x44a0b0[_0x83ce('0x33')],function(_0x109f98){var _0x556783={};_0x556783[_0x109f98]={'$like':'%'+_0x1e82ac[_0x83ce('0x2f')]['filter']+'%'};return _0x556783;})});}_0x44a0b0=_['merge']({},_0x44a0b0,_0x1e82ac[_0x83ce('0x44')]);return _0x4887a1['getTags'](_0x44a0b0);}})['then'](function(_0x456ca1){if(_0x456ca1){_0x347514=_0x456ca1[_0x83ce('0x35')];if(!_0x1e82ac['query'][_0x83ce('0x36')]('nolimit')){_0x44a0b0[_0x83ce('0x1a')]=qs[_0x83ce('0x1a')](_0x1e82ac['query'][_0x83ce('0x1a')]);_0x44a0b0['offset']=qs[_0x83ce('0x1c')](_0x1e82ac['query'][_0x83ce('0x1c')]);}return _0x4887a1['getTags'](_0x44a0b0);}})[_0x83ce('0x21')](function(_0xf23fc6){if(_0xf23fc6){return _0xf23fc6?{'count':_0x347514,'rows':_0xf23fc6}:null;}})[_0x83ce('0x21')](respondWithResult(_0x298e2e,null))[_0x83ce('0x47')](handleError(_0x298e2e,null));};exports[_0x83ce('0x50')]=function(_0x55f5e4,_0x360cb7,_0x5bb452){if(_0x55f5e4['body']['id']){delete _0x55f5e4[_0x83ce('0x46')]['id'];}return db['DeskConfiguration'][_0x83ce('0x4a')]({'where':{'id':_0x55f5e4[_0x83ce('0x42')]['id']}})[_0x83ce('0x21')](handleEntityNotFound(_0x360cb7,null))[_0x83ce('0x21')](function(_0x5609c4){if(_0x5609c4){return _0x5609c4['setTags'](_0x55f5e4[_0x83ce('0x46')][_0x83ce('0x51')]||[]);}return null;})[_0x83ce('0x21')](respondWithResult(_0x360cb7,null))['catch'](handleError(_0x360cb7,null));};
\ No newline at end of file
+var _0x471e=['count','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','DeskField','getSubjects','pick','getDescriptions','Tag','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','name','index','map','DeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0x42e6e7,_0x4ee4f6){var _0x32909b=function(_0xfeb4fa){while(--_0xfeb4fa){_0x42e6e7['push'](_0x42e6e7['shift']());}};_0x32909b(++_0x4ee4f6);}(_0x471e,0x199));var _0xe471=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x471e[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xe471('0x0'));var rimraf=require(_0xe471('0x1'));var zipdir=require(_0xe471('0x2'));var jsonpatch=require(_0xe471('0x3'));var rp=require(_0xe471('0x4'));var moment=require(_0xe471('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe471('0x6'));var util=require(_0xe471('0x7'));var path=require(_0xe471('0x8'));var sox=require(_0xe471('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe471('0xa'));var squel=require(_0xe471('0xb'));var crypto=require(_0xe471('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe471('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe471('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe471('0xf'));var as=require(_0xe471('0x10'));var hardwareService=require(_0xe471('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe471('0x12'));var licenseUtil=require(_0xe471('0x13'));var db=require(_0xe471('0x14'))['db'];function respondWithStatusCode(_0x310b97,_0x729be6){_0x729be6=_0x729be6||0xcc;return function(_0x302251){if(_0x302251){return _0x310b97[_0xe471('0x15')](_0x729be6);}return _0x310b97[_0xe471('0x16')](_0x729be6)['end']();};}function respondWithResult(_0x49cf27,_0x420168){_0x420168=_0x420168||0xc8;return function(_0x278f63){if(_0x278f63){return _0x49cf27['status'](_0x420168)[_0xe471('0x17')](_0x278f63);}};}function respondWithFilteredResult(_0x5c5463,_0x51ffdb){return function(_0xe5d058){if(_0xe5d058){var _0x5d6399=typeof _0x51ffdb[_0xe471('0x18')]==='undefined'&&typeof _0x51ffdb[_0xe471('0x19')]==='undefined';var _0x3546b2=_0xe5d058['count'];var _0xb6f13d=_0x5d6399?0x0:_0x51ffdb[_0xe471('0x18')];var _0x582642=_0x5d6399?_0xe5d058['count']:_0x51ffdb[_0xe471('0x18')]+_0x51ffdb[_0xe471('0x19')];var _0x21c9ab;if(_0x582642>=_0x3546b2){_0x582642=_0x3546b2;_0x21c9ab=0xc8;}else{_0x21c9ab=0xce;}_0x5c5463[_0xe471('0x16')](_0x21c9ab);return _0x5c5463[_0xe471('0x1a')](_0xe471('0x1b'),_0xb6f13d+'-'+_0x582642+'/'+_0x3546b2)[_0xe471('0x17')](_0xe5d058);}return null;};}function patchUpdates(_0x24a0aa){return function(_0x25465d){try{jsonpatch['apply'](_0x25465d,_0x24a0aa,!![]);}catch(_0x43a8a5){return BPromise[_0xe471('0x1c')](_0x43a8a5);}return _0x25465d['save']();};}function saveUpdates(_0x232db1,_0x483ae7){return function(_0x404d1f){if(_0x404d1f){return _0x404d1f[_0xe471('0x1d')](_0x232db1)[_0xe471('0x1e')](function(_0xefbbf){return _0xefbbf;});}return null;};}function removeEntity(_0x21e863,_0x4783cd){return function(_0x1588e7){if(_0x1588e7){return _0x1588e7[_0xe471('0x1f')]()['then'](function(){_0x21e863[_0xe471('0x16')](0xcc)[_0xe471('0x20')]();});}};}function handleEntityNotFound(_0x4a036d,_0x451ed8){return function(_0x55c6ef){if(!_0x55c6ef){_0x4a036d[_0xe471('0x15')](0x194);}return _0x55c6ef;};}function handleError(_0x382f75,_0xadc23a){_0xadc23a=_0xadc23a||0x1f4;return function(_0x1d1dcf){logger[_0xe471('0x21')](_0x1d1dcf['stack']);if(_0x1d1dcf[_0xe471('0x22')]){delete _0x1d1dcf[_0xe471('0x22')];}_0x382f75[_0xe471('0x16')](_0xadc23a)['send'](_0x1d1dcf);};}exports[_0xe471('0x23')]=function(_0x168778,_0x18f3a7){var _0x2cf1ef={},_0x4ae59c={},_0xc6f9b0={'count':0x0,'rows':[]};var _0x3879ec=_[_0xe471('0x24')](db[_0xe471('0x25')][_0xe471('0x26')],function(_0x2b1bbe){return{'name':_0x2b1bbe[_0xe471('0x27')],'type':_0x2b1bbe['type'][_0xe471('0x28')]};});_0x4ae59c[_0xe471('0x29')]=_['map'](_0x3879ec,_0xe471('0x22'));_0x4ae59c[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x168778[_0xe471('0x2a')]);_0x4ae59c[_0xe471('0x2c')]=_[_0xe471('0x2d')](_0x4ae59c[_0xe471('0x29')],_0x4ae59c[_0xe471('0x2a')]);_0x2cf1ef['attributes']=_[_0xe471('0x2d')](_0x4ae59c[_0xe471('0x29')],qs['fields'](_0x168778[_0xe471('0x2a')][_0xe471('0x2e')]));_0x2cf1ef[_0xe471('0x2f')]=_0x2cf1ef[_0xe471('0x2f')][_0xe471('0x30')]?_0x2cf1ef['attributes']:_0x4ae59c['model'];if(!_0x168778[_0xe471('0x2a')][_0xe471('0x31')](_0xe471('0x32'))){_0x2cf1ef['limit']=qs['limit'](_0x168778['query'][_0xe471('0x19')]);_0x2cf1ef[_0xe471('0x18')]=qs[_0xe471('0x18')](_0x168778['query'][_0xe471('0x18')]);}_0x2cf1ef[_0xe471('0x33')]=qs[_0xe471('0x34')](_0x168778['query'][_0xe471('0x34')]);_0x2cf1ef[_0xe471('0x35')]=qs[_0xe471('0x2c')](_['pick'](_0x168778[_0xe471('0x2a')],_0x4ae59c[_0xe471('0x2c')]),_0x3879ec);if(_0x168778['query'][_0xe471('0x36')]){_0x2cf1ef[_0xe471('0x35')]=_[_0xe471('0x37')](_0x2cf1ef['where'],{'$or':_['map'](_0x3879ec,function(_0x5ceb7f){if(_0x5ceb7f[_0xe471('0x38')]!==_0xe471('0x39')){var _0xad9c8d={};_0xad9c8d[_0x5ceb7f[_0xe471('0x22')]]={'$like':'%'+_0x168778[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0xad9c8d;}})});}_0x2cf1ef=_[_0xe471('0x37')]({},_0x2cf1ef,_0x168778[_0xe471('0x3a')]);var _0x39c4a8={'where':_0x2cf1ef[_0xe471('0x35')]};return db['DeskConfiguration'][_0xe471('0x3b')](_0x39c4a8)[_0xe471('0x1e')](function(_0x37ab5e){_0xc6f9b0[_0xe471('0x3b')]=_0x37ab5e;if(_0x168778[_0xe471('0x2a')][_0xe471('0x3c')]){_0x2cf1ef[_0xe471('0x3d')]=[{'all':!![]}];}return db[_0xe471('0x25')][_0xe471('0x3e')](_0x2cf1ef);})[_0xe471('0x1e')](function(_0x14b4bf){_0xc6f9b0[_0xe471('0x3f')]=_0x14b4bf;return _0xc6f9b0;})[_0xe471('0x1e')](respondWithFilteredResult(_0x18f3a7,_0x2cf1ef))[_0xe471('0x40')](handleError(_0x18f3a7,null));};exports['show']=function(_0x5618df,_0x410988){var _0x3edb31={'raw':![],'where':{'id':_0x5618df[_0xe471('0x41')]['id']}},_0x3d8949={};_0x3d8949[_0xe471('0x29')]=_[_0xe471('0x2b')](db[_0xe471('0x25')][_0xe471('0x26')]);_0x3d8949[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x5618df[_0xe471('0x2a')]);_0x3d8949['filters']=_[_0xe471('0x2d')](_0x3d8949[_0xe471('0x29')],_0x3d8949[_0xe471('0x2a')]);_0x3edb31[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x3d8949[_0xe471('0x29')],qs['fields'](_0x5618df[_0xe471('0x2a')]['fields']));_0x3edb31['attributes']=_0x3edb31[_0xe471('0x2f')][_0xe471('0x30')]?_0x3edb31[_0xe471('0x2f')]:_0x3d8949[_0xe471('0x29')];if(_0x5618df[_0xe471('0x2a')][_0xe471('0x3c')]){_0x3edb31['include']=[{'all':!![]}];}_0x3edb31=_['merge']({},_0x3edb31,_0x5618df['options']);return db['DeskConfiguration'][_0xe471('0x42')](_0x3edb31)[_0xe471('0x1e')](handleEntityNotFound(_0x410988,null))[_0xe471('0x1e')](respondWithResult(_0x410988,null))[_0xe471('0x40')](handleError(_0x410988,null));};exports[_0xe471('0x43')]=function(_0x1e7e52,_0x297621){return db[_0xe471('0x25')][_0xe471('0x43')](_0x1e7e52[_0xe471('0x44')],{})[_0xe471('0x1e')](respondWithResult(_0x297621,0xc9))[_0xe471('0x40')](handleError(_0x297621,null));};exports[_0xe471('0x1d')]=function(_0x147e79,_0x526e95){if(_0x147e79['body']['id']){delete _0x147e79[_0xe471('0x44')]['id'];}return db[_0xe471('0x25')][_0xe471('0x42')]({'where':{'id':_0x147e79['params']['id']}})[_0xe471('0x1e')](handleEntityNotFound(_0x526e95,null))['then'](saveUpdates(_0x147e79[_0xe471('0x44')],null))[_0xe471('0x1e')](respondWithResult(_0x526e95,null))[_0xe471('0x40')](handleError(_0x526e95,null));};exports[_0xe471('0x1f')]=function(_0x54da48,_0x1e45e3){return db['DeskConfiguration'][_0xe471('0x42')]({'where':{'id':_0x54da48[_0xe471('0x41')]['id']}})['then'](handleEntityNotFound(_0x1e45e3,null))[_0xe471('0x1e')](removeEntity(_0x1e45e3,null))[_0xe471('0x40')](handleError(_0x1e45e3,null));};exports[_0xe471('0x45')]=function(_0x251d49,_0x89457d,_0x3b0528){var _0x46d1d2={};var _0x1c4310={};var _0x3592bf;var _0xad2e5f;return db['DeskConfiguration'][_0xe471('0x46')]({'where':{'id':_0x251d49['params']['id']}})[_0xe471('0x1e')](handleEntityNotFound(_0x89457d,null))['then'](function(_0x22b334){if(_0x22b334){_0x3592bf=_0x22b334;_0x1c4310[_0xe471('0x29')]=_[_0xe471('0x2b')](db[_0xe471('0x47')]['rawAttributes']);_0x1c4310[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x251d49['query']);_0x1c4310[_0xe471('0x2c')]=_['intersection'](_0x1c4310[_0xe471('0x29')],_0x1c4310[_0xe471('0x2a')]);_0x46d1d2[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x1c4310['model'],qs['fields'](_0x251d49['query'][_0xe471('0x2e')]));_0x46d1d2[_0xe471('0x2f')]=_0x46d1d2[_0xe471('0x2f')][_0xe471('0x30')]?_0x46d1d2['attributes']:_0x1c4310[_0xe471('0x29')];_0x46d1d2[_0xe471('0x33')]=qs[_0xe471('0x34')](_0x251d49['query'][_0xe471('0x34')]);_0x46d1d2[_0xe471('0x35')]=qs['filters'](_['pick'](_0x251d49[_0xe471('0x2a')],_0x1c4310[_0xe471('0x2c')]));if(_0x251d49['query'][_0xe471('0x36')]){_0x46d1d2[_0xe471('0x35')]=_[_0xe471('0x37')](_0x46d1d2[_0xe471('0x35')],{'$or':_[_0xe471('0x24')](_0x46d1d2[_0xe471('0x2f')],function(_0x3a6775){var _0x13b54d={};_0x13b54d[_0x3a6775]={'$like':'%'+_0x251d49[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0x13b54d;})});}_0x46d1d2=_['merge']({},_0x46d1d2,_0x251d49[_0xe471('0x3a')]);return _0x3592bf[_0xe471('0x45')](_0x46d1d2);}})['then'](function(_0xe66ff){if(_0xe66ff){_0xad2e5f=_0xe66ff[_0xe471('0x30')];if(!_0x251d49[_0xe471('0x2a')][_0xe471('0x31')](_0xe471('0x32'))){_0x46d1d2[_0xe471('0x19')]=qs[_0xe471('0x19')](_0x251d49[_0xe471('0x2a')][_0xe471('0x19')]);_0x46d1d2[_0xe471('0x18')]=qs['offset'](_0x251d49[_0xe471('0x2a')][_0xe471('0x18')]);}return _0x3592bf[_0xe471('0x45')](_0x46d1d2);}})[_0xe471('0x1e')](function(_0x4a2b74){if(_0x4a2b74){return _0x4a2b74?{'count':_0xad2e5f,'rows':_0x4a2b74}:null;}})[_0xe471('0x1e')](respondWithResult(_0x89457d,null))[_0xe471('0x40')](handleError(_0x89457d,null));};exports[_0xe471('0x48')]=function(_0x23e241,_0x135eb4,_0x5d5272){var _0x23f701={};var _0x38c038={};var _0xd99924;var _0x2f8750;return db[_0xe471('0x25')][_0xe471('0x46')]({'where':{'id':_0x23e241[_0xe471('0x41')]['id']}})['then'](handleEntityNotFound(_0x135eb4,null))[_0xe471('0x1e')](function(_0x37e59b){if(_0x37e59b){_0xd99924=_0x37e59b;_0x38c038[_0xe471('0x29')]=_['keys'](db[_0xe471('0x47')][_0xe471('0x26')]);_0x38c038[_0xe471('0x2a')]=_['keys'](_0x23e241['query']);_0x38c038['filters']=_[_0xe471('0x2d')](_0x38c038['model'],_0x38c038[_0xe471('0x2a')]);_0x23f701[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x38c038[_0xe471('0x29')],qs[_0xe471('0x2e')](_0x23e241[_0xe471('0x2a')][_0xe471('0x2e')]));_0x23f701[_0xe471('0x2f')]=_0x23f701[_0xe471('0x2f')][_0xe471('0x30')]?_0x23f701[_0xe471('0x2f')]:_0x38c038[_0xe471('0x29')];_0x23f701[_0xe471('0x33')]=qs[_0xe471('0x34')](_0x23e241[_0xe471('0x2a')][_0xe471('0x34')]);_0x23f701[_0xe471('0x35')]=qs[_0xe471('0x2c')](_[_0xe471('0x49')](_0x23e241['query'],_0x38c038[_0xe471('0x2c')]));if(_0x23e241[_0xe471('0x2a')][_0xe471('0x36')]){_0x23f701[_0xe471('0x35')]=_[_0xe471('0x37')](_0x23f701[_0xe471('0x35')],{'$or':_[_0xe471('0x24')](_0x23f701[_0xe471('0x2f')],function(_0x3508a9){var _0x910967={};_0x910967[_0x3508a9]={'$like':'%'+_0x23e241[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0x910967;})});}_0x23f701=_[_0xe471('0x37')]({},_0x23f701,_0x23e241['options']);return _0xd99924[_0xe471('0x48')](_0x23f701);}})['then'](function(_0x121ae2){if(_0x121ae2){_0x2f8750=_0x121ae2[_0xe471('0x30')];if(!_0x23e241[_0xe471('0x2a')][_0xe471('0x31')](_0xe471('0x32'))){_0x23f701[_0xe471('0x19')]=qs[_0xe471('0x19')](_0x23e241[_0xe471('0x2a')][_0xe471('0x19')]);_0x23f701[_0xe471('0x18')]=qs[_0xe471('0x18')](_0x23e241['query'][_0xe471('0x18')]);}return _0xd99924[_0xe471('0x48')](_0x23f701);}})['then'](function(_0x2c744a){if(_0x2c744a){return _0x2c744a?{'count':_0x2f8750,'rows':_0x2c744a}:null;}})[_0xe471('0x1e')](respondWithResult(_0x135eb4,null))[_0xe471('0x40')](handleError(_0x135eb4,null));};exports[_0xe471('0x4a')]=function(_0x1663d3,_0x2fa017,_0x4a2298){var _0x31e364={};var _0x45fa3e={};var _0x2941b4;var _0x73c250;return db[_0xe471('0x25')]['findOne']({'where':{'id':_0x1663d3['params']['id']}})['then'](handleEntityNotFound(_0x2fa017,null))[_0xe471('0x1e')](function(_0x52d24e){if(_0x52d24e){_0x2941b4=_0x52d24e;_0x45fa3e[_0xe471('0x29')]=_[_0xe471('0x2b')](db[_0xe471('0x47')][_0xe471('0x26')]);_0x45fa3e['query']=_['keys'](_0x1663d3[_0xe471('0x2a')]);_0x45fa3e['filters']=_['intersection'](_0x45fa3e[_0xe471('0x29')],_0x45fa3e[_0xe471('0x2a')]);_0x31e364[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x45fa3e[_0xe471('0x29')],qs[_0xe471('0x2e')](_0x1663d3[_0xe471('0x2a')]['fields']));_0x31e364[_0xe471('0x2f')]=_0x31e364[_0xe471('0x2f')]['length']?_0x31e364[_0xe471('0x2f')]:_0x45fa3e['model'];_0x31e364[_0xe471('0x33')]=qs['sort'](_0x1663d3[_0xe471('0x2a')][_0xe471('0x34')]);_0x31e364[_0xe471('0x35')]=qs[_0xe471('0x2c')](_['pick'](_0x1663d3[_0xe471('0x2a')],_0x45fa3e[_0xe471('0x2c')]));if(_0x1663d3['query'][_0xe471('0x36')]){_0x31e364[_0xe471('0x35')]=_['merge'](_0x31e364['where'],{'$or':_[_0xe471('0x24')](_0x31e364[_0xe471('0x2f')],function(_0x5964c7){var _0x19ab47={};_0x19ab47[_0x5964c7]={'$like':'%'+_0x1663d3[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0x19ab47;})});}_0x31e364=_[_0xe471('0x37')]({},_0x31e364,_0x1663d3[_0xe471('0x3a')]);return _0x2941b4['getDescriptions'](_0x31e364);}})[_0xe471('0x1e')](function(_0x26c196){if(_0x26c196){_0x73c250=_0x26c196[_0xe471('0x30')];if(!_0x1663d3[_0xe471('0x2a')]['hasOwnProperty'](_0xe471('0x32'))){_0x31e364[_0xe471('0x19')]=qs[_0xe471('0x19')](_0x1663d3[_0xe471('0x2a')][_0xe471('0x19')]);_0x31e364[_0xe471('0x18')]=qs['offset'](_0x1663d3[_0xe471('0x2a')][_0xe471('0x18')]);}return _0x2941b4[_0xe471('0x4a')](_0x31e364);}})[_0xe471('0x1e')](function(_0xc2392){if(_0xc2392){return _0xc2392?{'count':_0x73c250,'rows':_0xc2392}:null;}})[_0xe471('0x1e')](respondWithResult(_0x2fa017,null))[_0xe471('0x40')](handleError(_0x2fa017,null));};exports['getTags']=function(_0x2786d3,_0xb43976,_0x40a4a8){var _0x5b5e05={};var _0x503daf={};var _0x44abae;var _0x107ba3;return db[_0xe471('0x25')][_0xe471('0x46')]({'where':{'id':_0x2786d3[_0xe471('0x41')]['id']}})[_0xe471('0x1e')](handleEntityNotFound(_0xb43976,null))[_0xe471('0x1e')](function(_0x538327){if(_0x538327){_0x44abae=_0x538327;_0x503daf[_0xe471('0x29')]=_[_0xe471('0x2b')](db[_0xe471('0x4b')]['rawAttributes']);_0x503daf[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x2786d3[_0xe471('0x2a')]);_0x503daf['filters']=_[_0xe471('0x2d')](_0x503daf['model'],_0x503daf[_0xe471('0x2a')]);_0x5b5e05[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x503daf[_0xe471('0x29')],qs['fields'](_0x2786d3[_0xe471('0x2a')]['fields']));_0x5b5e05[_0xe471('0x2f')]=_0x5b5e05['attributes'][_0xe471('0x30')]?_0x5b5e05[_0xe471('0x2f')]:_0x503daf['model'];_0x5b5e05[_0xe471('0x33')]=qs[_0xe471('0x34')](_0x2786d3[_0xe471('0x2a')][_0xe471('0x34')]);_0x5b5e05['where']=qs[_0xe471('0x2c')](_[_0xe471('0x49')](_0x2786d3[_0xe471('0x2a')],_0x503daf[_0xe471('0x2c')]));if(_0x2786d3[_0xe471('0x2a')][_0xe471('0x36')]){_0x5b5e05[_0xe471('0x35')]=_[_0xe471('0x37')](_0x5b5e05['where'],{'$or':_['map'](_0x5b5e05[_0xe471('0x2f')],function(_0x403d56){var _0x3083ad={};_0x3083ad[_0x403d56]={'$like':'%'+_0x2786d3[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0x3083ad;})});}_0x5b5e05=_['merge']({},_0x5b5e05,_0x2786d3[_0xe471('0x3a')]);return _0x44abae[_0xe471('0x4c')](_0x5b5e05);}})['then'](function(_0x182100){if(_0x182100){_0x107ba3=_0x182100[_0xe471('0x30')];if(!_0x2786d3[_0xe471('0x2a')][_0xe471('0x31')]('nolimit')){_0x5b5e05[_0xe471('0x19')]=qs[_0xe471('0x19')](_0x2786d3[_0xe471('0x2a')][_0xe471('0x19')]);_0x5b5e05[_0xe471('0x18')]=qs[_0xe471('0x18')](_0x2786d3[_0xe471('0x2a')]['offset']);}return _0x44abae[_0xe471('0x4c')](_0x5b5e05);}})['then'](function(_0x4a0ebc){if(_0x4a0ebc){return _0x4a0ebc?{'count':_0x107ba3,'rows':_0x4a0ebc}:null;}})[_0xe471('0x1e')](respondWithResult(_0xb43976,null))[_0xe471('0x40')](handleError(_0xb43976,null));};exports['setTags']=function(_0x36ab30,_0x912bb7,_0x5d3a9a){if(_0x36ab30[_0xe471('0x44')]['id']){delete _0x36ab30[_0xe471('0x44')]['id'];}return db['DeskConfiguration'][_0xe471('0x46')]({'where':{'id':_0x36ab30[_0xe471('0x41')]['id']}})[_0xe471('0x1e')](handleEntityNotFound(_0x912bb7,null))[_0xe471('0x1e')](function(_0x186eea){if(_0x186eea){return _0x186eea['setTags'](_0x36ab30[_0xe471('0x44')][_0xe471('0x4d')]||[]);}return null;})['then'](respondWithResult(_0x912bb7,null))[_0xe471('0x40')](handleError(_0x912bb7,null));};
\ No newline at end of file
index 1a9e69f..806603d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x237f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','lodash','util','../../config/logger','api'];(function(_0x332bcc,_0x3ae30b){var _0x26b977=function(_0x1276ad){while(--_0x1276ad){_0x332bcc['push'](_0x332bcc['shift']());}};_0x26b977(++_0x3ae30b);}(_0x237f,0x104));var _0xf237=function(_0x9c6e38,_0x1fc24e){_0x9c6e38=_0x9c6e38-0x0;var _0x148e08=_0x237f[_0x9c6e38];return _0x148e08;};'use strict';var _=require(_0xf237('0x0'));var util=require(_0xf237('0x1'));var logger=require(_0xf237('0x2'))(_0xf237('0x3'));var moment=require(_0xf237('0x4'));var BPromise=require(_0xf237('0x5'));var rp=require(_0xf237('0x6'));var fs=require('fs');var path=require(_0xf237('0x7'));var rimraf=require(_0xf237('0x8'));var config=require(_0xf237('0x9'));var attributes=require(_0xf237('0xa'));module['exports']=function(_0xc59512,_0x1a2917){return _0xc59512['define']('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd56e=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd56e,0x1e8));var _0xed56=function(_0x3592a9,_0x3e7743){_0x3592a9=_0x3592a9-0x0;var _0x1f6f52=_0xd56e[_0x3592a9];return _0x1f6f52;};'use strict';var _=require(_0xed56('0x0'));var util=require(_0xed56('0x1'));var logger=require(_0xed56('0x2'))(_0xed56('0x3'));var moment=require(_0xed56('0x4'));var BPromise=require('bluebird');var rp=require(_0xed56('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed56('0x6'));var config=require(_0xed56('0x7'));var attributes=require(_0xed56('0x8'));module[_0xed56('0x9')]=function(_0x1dee95,_0x5839e3){return _0x1dee95[_0xed56('0xa')](_0xed56('0xb'),attributes,{'tableName':_0xed56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 52d4323..595a548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64e6=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x2cfb29,_0x436046){var _0x713552=function(_0x502f1f){while(--_0x502f1f){_0x2cfb29['push'](_0x2cfb29['shift']());}};_0x713552(++_0x436046);}(_0x64e6,0x1b2));var _0x664e=function(_0x38e7b2,_0x145f71){_0x38e7b2=_0x38e7b2-0x0;var _0x44791d=_0x64e6[_0x38e7b2];return _0x44791d;};'use strict';var _=require(_0x664e('0x0'));var util=require('util');var moment=require(_0x664e('0x1'));var BPromise=require(_0x664e('0x2'));var rs=require(_0x664e('0x3'));var fs=require('fs');var Redis=require(_0x664e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x664e('0x5'))('rpc');var config=require(_0x664e('0x6'));var jayson=require(_0x664e('0x7'));var client=jayson['client'][_0x664e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1498b1,_0x15f2b0,_0x5cc204){return new BPromise(function(_0x1d5962,_0x24ac10){return client[_0x664e('0x9')](_0x1498b1,_0x5cc204)[_0x664e('0xa')](function(_0x2dc92b){logger[_0x664e('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x15f2b0,_0x664e('0xc'));logger[_0x664e('0xd')](_0x664e('0xe'),_0x15f2b0,_0x664e('0xc'),JSON[_0x664e('0xf')](_0x2dc92b));if(_0x2dc92b['error']){if(_0x2dc92b[_0x664e('0x10')][_0x664e('0x11')]===0x1f4){logger['error'](_0x664e('0x12'),_0x15f2b0,_0x2dc92b['error'][_0x664e('0x13')]);return _0x24ac10(_0x2dc92b[_0x664e('0x10')]['message']);}logger['error'](_0x664e('0x12'),_0x15f2b0,_0x2dc92b[_0x664e('0x10')]['message']);return _0x1d5962(_0x2dc92b[_0x664e('0x10')][_0x664e('0x13')]);}else{logger[_0x664e('0xb')](_0x664e('0x12'),_0x15f2b0,_0x664e('0xc'));_0x1d5962(_0x2dc92b['result'][_0x664e('0x13')]);}})['catch'](function(_0x3b5bef){logger['error'](_0x664e('0x12'),_0x15f2b0,_0x3b5bef);_0x24ac10(_0x3b5bef);});});}
\ No newline at end of file
+var _0x38f2=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1c699a,_0x167ed9){var _0x407285=function(_0x29ce36){while(--_0x29ce36){_0x1c699a['push'](_0x1c699a['shift']());}};_0x407285(++_0x167ed9);}(_0x38f2,0xbe));var _0x238f=function(_0x59077b,_0x5c5999){_0x59077b=_0x59077b-0x0;var _0x4f0b95=_0x38f2[_0x59077b];return _0x4f0b95;};'use strict';var _=require(_0x238f('0x0'));var util=require(_0x238f('0x1'));var moment=require(_0x238f('0x2'));var BPromise=require('bluebird');var rs=require(_0x238f('0x3'));var fs=require('fs');var Redis=require(_0x238f('0x4'));var db=require(_0x238f('0x5'))['db'];var utils=require(_0x238f('0x6'));var logger=require(_0x238f('0x7'))(_0x238f('0x8'));var config=require(_0x238f('0x9'));var jayson=require(_0x238f('0xa'));var client=jayson['client'][_0x238f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54db80,_0x3d7a28,_0x22ceaf){return new BPromise(function(_0x9a2864,_0x41e921){return client[_0x238f('0xc')](_0x54db80,_0x22ceaf)[_0x238f('0xd')](function(_0x1fa5c8){logger[_0x238f('0xe')](_0x238f('0xf'),_0x3d7a28,_0x238f('0x10'));logger['debug'](_0x238f('0x11'),_0x3d7a28,_0x238f('0x10'),JSON[_0x238f('0x12')](_0x1fa5c8));if(_0x1fa5c8[_0x238f('0x13')]){if(_0x1fa5c8['error'][_0x238f('0x14')]===0x1f4){logger[_0x238f('0x13')](_0x238f('0xf'),_0x3d7a28,_0x1fa5c8[_0x238f('0x13')]['message']);return _0x41e921(_0x1fa5c8[_0x238f('0x13')][_0x238f('0x15')]);}logger['error'](_0x238f('0xf'),_0x3d7a28,_0x1fa5c8[_0x238f('0x13')][_0x238f('0x15')]);return _0x9a2864(_0x1fa5c8[_0x238f('0x13')][_0x238f('0x15')]);}else{logger[_0x238f('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x3d7a28,_0x238f('0x10'));_0x9a2864(_0x1fa5c8[_0x238f('0x16')][_0x238f('0x15')]);}})['catch'](function(_0x559f11){logger[_0x238f('0x13')](_0x238f('0xf'),_0x3d7a28,_0x559f11);_0x41e921(_0x559f11);});});}
\ No newline at end of file
index 96fdf92..de995e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9c6=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x461640,_0x11078b){var _0x3c14a1=function(_0xb07afb){while(--_0xb07afb){_0x461640['push'](_0x461640['shift']());}};_0x3c14a1(++_0x11078b);}(_0xb9c6,0x1c5));var _0x6b9c=function(_0xbd236a,_0x274557){_0xbd236a=_0xbd236a-0x0;var _0x19154b=_0xb9c6[_0xbd236a];return _0x19154b;};'use strict';var multer=require('multer');var util=require(_0x6b9c('0x0'));var path=require('path');var timeout=require(_0x6b9c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6b9c('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x6b9c('0x3'));var config=require(_0x6b9c('0x4'));var controller=require(_0x6b9c('0x5'));router['get']('/',auth[_0x6b9c('0x6')](),controller[_0x6b9c('0x7')]);router[_0x6b9c('0x8')](_0x6b9c('0x9'),auth[_0x6b9c('0x6')](),controller[_0x6b9c('0xa')]);router[_0x6b9c('0xb')]('/',auth[_0x6b9c('0x6')](),controller[_0x6b9c('0xc')]);router[_0x6b9c('0xd')]('/:id',auth[_0x6b9c('0x6')](),controller[_0x6b9c('0xe')]);router[_0x6b9c('0xf')](_0x6b9c('0x9'),auth[_0x6b9c('0x6')](),controller['destroy']);module[_0x6b9c('0x10')]=router;
\ No newline at end of file
+var _0x9181=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskField.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete','exports','util','path'];(function(_0x44d385,_0x1a313a){var _0x5c2cc5=function(_0x5d1d76){while(--_0x5d1d76){_0x44d385['push'](_0x44d385['shift']());}};_0x5c2cc5(++_0x1a313a);}(_0x9181,0x166));var _0x1918=function(_0x5d540b,_0x13d07d){_0x5d540b=_0x5d540b-0x0;var _0x3196e3=_0x9181[_0x5d540b];return _0x3196e3;};'use strict';var multer=require('multer');var util=require(_0x1918('0x0'));var path=require(_0x1918('0x1'));var timeout=require(_0x1918('0x2'));var express=require(_0x1918('0x3'));var router=express[_0x1918('0x4')]();var fs_extra=require(_0x1918('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1918('0x6'));var config=require('../../config/environment');var controller=require(_0x1918('0x7'));router[_0x1918('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1918('0x8')](_0x1918('0x9'),auth['isAuthenticated'](),controller[_0x1918('0xa')]);router[_0x1918('0xb')]('/',auth[_0x1918('0xc')](),controller[_0x1918('0xd')]);router[_0x1918('0xe')]('/:id',auth[_0x1918('0xc')](),controller[_0x1918('0xf')]);router[_0x1918('0x10')](_0x1918('0x9'),auth[_0x1918('0xc')](),controller['destroy']);module[_0x1918('0x11')]=router;
\ No newline at end of file
index f2e8c3e..29fbce5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcf8=['string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x41e137,_0x34f2bb){var _0x41e9be=function(_0x2addd9){while(--_0x2addd9){_0x41e137['push'](_0x41e137['shift']());}};_0x41e9be(++_0x34f2bb);}(_0xdcf8,0x86));var _0x8dcf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdcf8[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x8dcf('0x0'));module[_0x8dcf('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8dcf('0x2'),_0x8dcf('0x3'),'customVariable',_0x8dcf('0x4'),'picklist'),'defaultValue':_0x8dcf('0x2')},'content':{'type':Sequelize[_0x8dcf('0x5')]},'key':{'type':Sequelize[_0x8dcf('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x8dcf('0x2'),_0x8dcf('0x3'),_0x8dcf('0x6'))},'keyContent':{'type':Sequelize[_0x8dcf('0x5')]},'idField':{'type':Sequelize[_0x8dcf('0x5')]},'nameField':{'type':Sequelize[_0x8dcf('0x5')]},'customField':{'type':Sequelize[_0x8dcf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8dcf('0x5')]}};
\ No newline at end of file
+var _0x3e4e=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2a05bf,_0x55e3a4){var _0x38a62e=function(_0x28d868){while(--_0x28d868){_0x2a05bf['push'](_0x2a05bf['shift']());}};_0x38a62e(++_0x55e3a4);}(_0x3e4e,0x1c5));var _0xe3e4=function(_0x4f2edd,_0x9955df){_0x4f2edd=_0x4f2edd-0x0;var _0x196b9f=_0x3e4e[_0x4f2edd];return _0x196b9f;};'use strict';var Sequelize=require(_0xe3e4('0x0'));module[_0xe3e4('0x1')]={'type':{'type':Sequelize[_0xe3e4('0x2')](_0xe3e4('0x3'),_0xe3e4('0x4'),_0xe3e4('0x5'),'keyValue',_0xe3e4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe3e4('0x7')]},'key':{'type':Sequelize[_0xe3e4('0x7')]},'keyType':{'type':Sequelize[_0xe3e4('0x2')](_0xe3e4('0x3'),'variable',_0xe3e4('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe3e4('0x7')]},'nameField':{'type':Sequelize[_0xe3e4('0x7')]},'customField':{'type':Sequelize[_0xe3e4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index af13021..8640fa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5aa=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','DeskField','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x32770f,_0x33ca8b){var _0x1033c5=function(_0x26b6f8){while(--_0x26b6f8){_0x32770f['push'](_0x32770f['shift']());}};_0x1033c5(++_0x33ca8b);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x1e6daa,_0x90a1c0){_0x1e6daa=_0x1e6daa-0x0;var _0x4b351b=_0xa5aa[_0x1e6daa];return _0x4b351b;};'use strict';var emlformat=require(_0xaa5a('0x0'));var rimraf=require(_0xaa5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa5a('0x2'));var rp=require(_0xaa5a('0x3'));var moment=require(_0xaa5a('0x4'));var BPromise=require(_0xaa5a('0x5'));var Mustache=require(_0xaa5a('0x6'));var util=require(_0xaa5a('0x7'));var path=require('path');var sox=require(_0xaa5a('0x8'));var csv=require(_0xaa5a('0x9'));var ejs=require(_0xaa5a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaa5a('0xb'));var crypto=require(_0xaa5a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaa5a('0xd'));var toCsv=require(_0xaa5a('0x9'));var querystring=require(_0xaa5a('0xe'));var Papa=require('papaparse');var Redis=require(_0xaa5a('0xf'));var authService=require(_0xaa5a('0x10'));var qs=require(_0xaa5a('0x11'));var as=require(_0xaa5a('0x12'));var hardwareService=require(_0xaa5a('0x13'));var logger=require(_0xaa5a('0x14'))('api');var utils=require(_0xaa5a('0x15'));var config=require(_0xaa5a('0x16'));var licenseUtil=require(_0xaa5a('0x17'));var db=require(_0xaa5a('0x18'))['db'];function respondWithStatusCode(_0x3edbba,_0x3b50ef){_0x3b50ef=_0x3b50ef||0xcc;return function(_0x477ead){if(_0x477ead){return _0x3edbba[_0xaa5a('0x19')](_0x3b50ef);}return _0x3edbba[_0xaa5a('0x1a')](_0x3b50ef)[_0xaa5a('0x1b')]();};}function respondWithResult(_0x1eb04d,_0x2dcea2){_0x2dcea2=_0x2dcea2||0xc8;return function(_0x5eaa9c){if(_0x5eaa9c){return _0x1eb04d[_0xaa5a('0x1a')](_0x2dcea2)[_0xaa5a('0x1c')](_0x5eaa9c);}};}function respondWithFilteredResult(_0x10919d,_0x5ee610){return function(_0x29ce43){if(_0x29ce43){var _0x10ba31=typeof _0x5ee610[_0xaa5a('0x1d')]===_0xaa5a('0x1e')&&typeof _0x5ee610[_0xaa5a('0x1f')]===_0xaa5a('0x1e');var _0x1b3eba=_0x29ce43[_0xaa5a('0x20')];var _0xef5dd3=_0x10ba31?0x0:_0x5ee610[_0xaa5a('0x1d')];var _0x8799a4=_0x10ba31?_0x29ce43[_0xaa5a('0x20')]:_0x5ee610[_0xaa5a('0x1d')]+_0x5ee610[_0xaa5a('0x1f')];var _0x44279b;if(_0x8799a4>=_0x1b3eba){_0x8799a4=_0x1b3eba;_0x44279b=0xc8;}else{_0x44279b=0xce;}_0x10919d[_0xaa5a('0x1a')](_0x44279b);return _0x10919d[_0xaa5a('0x21')]('Content-Range',_0xef5dd3+'-'+_0x8799a4+'/'+_0x1b3eba)[_0xaa5a('0x1c')](_0x29ce43);}return null;};}function patchUpdates(_0xb9156c){return function(_0x375de5){try{jsonpatch[_0xaa5a('0x22')](_0x375de5,_0xb9156c,!![]);}catch(_0x5af50f){return BPromise[_0xaa5a('0x23')](_0x5af50f);}return _0x375de5[_0xaa5a('0x24')]();};}function saveUpdates(_0x399b12,_0x3f9dda){return function(_0xf50dd0){if(_0xf50dd0){return _0xf50dd0[_0xaa5a('0x25')](_0x399b12)[_0xaa5a('0x26')](function(_0x1d3fbc){return _0x1d3fbc;});}return null;};}function removeEntity(_0x2a3dd7,_0x5a9993){return function(_0x1e4e12){if(_0x1e4e12){return _0x1e4e12['destroy']()[_0xaa5a('0x26')](function(){_0x2a3dd7[_0xaa5a('0x1a')](0xcc)[_0xaa5a('0x1b')]();});}};}function handleEntityNotFound(_0x3e6ac1,_0x1d0c9b){return function(_0x47cdcf){if(!_0x47cdcf){_0x3e6ac1[_0xaa5a('0x19')](0x194);}return _0x47cdcf;};}function handleError(_0x319ba9,_0x4e2311){_0x4e2311=_0x4e2311||0x1f4;return function(_0x46e035){logger['error'](_0x46e035[_0xaa5a('0x27')]);if(_0x46e035[_0xaa5a('0x28')]){delete _0x46e035[_0xaa5a('0x28')];}_0x319ba9[_0xaa5a('0x1a')](_0x4e2311)[_0xaa5a('0x29')](_0x46e035);};}exports[_0xaa5a('0x2a')]=function(_0x57cd56,_0x1176b7){var _0x3ecf03={},_0x50996f={},_0x462485={'count':0x0,'rows':[]};var _0x223339=_['map'](db[_0xaa5a('0x2b')][_0xaa5a('0x2c')],function(_0x186413){return{'name':_0x186413[_0xaa5a('0x2d')],'type':_0x186413[_0xaa5a('0x2e')][_0xaa5a('0x2f')]};});_0x50996f['model']=_[_0xaa5a('0x30')](_0x223339,_0xaa5a('0x28'));_0x50996f[_0xaa5a('0x31')]=_[_0xaa5a('0x32')](_0x57cd56['query']);_0x50996f['filters']=_[_0xaa5a('0x33')](_0x50996f[_0xaa5a('0x34')],_0x50996f['query']);_0x3ecf03[_0xaa5a('0x35')]=_['intersection'](_0x50996f['model'],qs[_0xaa5a('0x36')](_0x57cd56[_0xaa5a('0x31')][_0xaa5a('0x36')]));_0x3ecf03[_0xaa5a('0x35')]=_0x3ecf03[_0xaa5a('0x35')][_0xaa5a('0x37')]?_0x3ecf03[_0xaa5a('0x35')]:_0x50996f['model'];if(!_0x57cd56[_0xaa5a('0x31')][_0xaa5a('0x38')](_0xaa5a('0x39'))){_0x3ecf03['limit']=qs[_0xaa5a('0x1f')](_0x57cd56['query'][_0xaa5a('0x1f')]);_0x3ecf03['offset']=qs['offset'](_0x57cd56[_0xaa5a('0x31')][_0xaa5a('0x1d')]);}_0x3ecf03[_0xaa5a('0x3a')]=qs[_0xaa5a('0x3b')](_0x57cd56[_0xaa5a('0x31')][_0xaa5a('0x3b')]);_0x3ecf03[_0xaa5a('0x3c')]=qs[_0xaa5a('0x3d')](_['pick'](_0x57cd56['query'],_0x50996f['filters']),_0x223339);if(_0x57cd56[_0xaa5a('0x31')][_0xaa5a('0x3e')]){_0x3ecf03[_0xaa5a('0x3c')]=_[_0xaa5a('0x3f')](_0x3ecf03[_0xaa5a('0x3c')],{'$or':_[_0xaa5a('0x30')](_0x223339,function(_0x518a22){if(_0x518a22['type']!=='VIRTUAL'){var _0x3ae970={};_0x3ae970[_0x518a22['name']]={'$like':'%'+_0x57cd56['query']['filter']+'%'};return _0x3ae970;}})});}_0x3ecf03=_[_0xaa5a('0x3f')]({},_0x3ecf03,_0x57cd56[_0xaa5a('0x40')]);var _0x264a35={'where':_0x3ecf03['where']};return db[_0xaa5a('0x2b')][_0xaa5a('0x20')](_0x264a35)[_0xaa5a('0x26')](function(_0xe2234b){_0x462485[_0xaa5a('0x20')]=_0xe2234b;if(_0x57cd56['query'][_0xaa5a('0x41')]){_0x3ecf03[_0xaa5a('0x42')]=[{'all':!![]}];}return db[_0xaa5a('0x2b')][_0xaa5a('0x43')](_0x3ecf03);})[_0xaa5a('0x26')](function(_0x3f0760){_0x462485[_0xaa5a('0x44')]=_0x3f0760;return _0x462485;})[_0xaa5a('0x26')](respondWithFilteredResult(_0x1176b7,_0x3ecf03))[_0xaa5a('0x45')](handleError(_0x1176b7,null));};exports['show']=function(_0x4d01d9,_0x4df02f){var _0x4d9d16={'raw':!![],'where':{'id':_0x4d01d9[_0xaa5a('0x46')]['id']}},_0x232a29={};_0x232a29[_0xaa5a('0x34')]=_[_0xaa5a('0x32')](db[_0xaa5a('0x2b')][_0xaa5a('0x2c')]);_0x232a29[_0xaa5a('0x31')]=_[_0xaa5a('0x32')](_0x4d01d9[_0xaa5a('0x31')]);_0x232a29[_0xaa5a('0x3d')]=_['intersection'](_0x232a29[_0xaa5a('0x34')],_0x232a29[_0xaa5a('0x31')]);_0x4d9d16[_0xaa5a('0x35')]=_[_0xaa5a('0x33')](_0x232a29[_0xaa5a('0x34')],qs[_0xaa5a('0x36')](_0x4d01d9[_0xaa5a('0x31')]['fields']));_0x4d9d16[_0xaa5a('0x35')]=_0x4d9d16[_0xaa5a('0x35')][_0xaa5a('0x37')]?_0x4d9d16[_0xaa5a('0x35')]:_0x232a29[_0xaa5a('0x34')];if(_0x4d01d9[_0xaa5a('0x31')][_0xaa5a('0x41')]){_0x4d9d16[_0xaa5a('0x42')]=[{'all':!![]}];}_0x4d9d16=_[_0xaa5a('0x3f')]({},_0x4d9d16,_0x4d01d9['options']);return db['DeskField'][_0xaa5a('0x47')](_0x4d9d16)[_0xaa5a('0x26')](handleEntityNotFound(_0x4df02f,null))[_0xaa5a('0x26')](respondWithResult(_0x4df02f,null))[_0xaa5a('0x45')](handleError(_0x4df02f,null));};exports[_0xaa5a('0x48')]=function(_0x2990d8,_0x3bb555){return db['DeskField'][_0xaa5a('0x48')](_0x2990d8[_0xaa5a('0x49')],{})[_0xaa5a('0x26')](respondWithResult(_0x3bb555,0xc9))[_0xaa5a('0x45')](handleError(_0x3bb555,null));};exports[_0xaa5a('0x25')]=function(_0x52d126,_0x4eeceb){if(_0x52d126['body']['id']){delete _0x52d126['body']['id'];}return db[_0xaa5a('0x2b')][_0xaa5a('0x47')]({'where':{'id':_0x52d126[_0xaa5a('0x46')]['id']}})[_0xaa5a('0x26')](handleEntityNotFound(_0x4eeceb,null))[_0xaa5a('0x26')](saveUpdates(_0x52d126[_0xaa5a('0x49')],null))[_0xaa5a('0x26')](respondWithResult(_0x4eeceb,null))[_0xaa5a('0x45')](handleError(_0x4eeceb,null));};exports[_0xaa5a('0x4a')]=function(_0x5249ce,_0x328f9b){return db[_0xaa5a('0x2b')][_0xaa5a('0x47')]({'where':{'id':_0x5249ce[_0xaa5a('0x46')]['id']}})[_0xaa5a('0x26')](handleEntityNotFound(_0x328f9b,null))['then'](removeEntity(_0x328f9b,null))['catch'](handleError(_0x328f9b,null));};
\ No newline at end of file
+var _0xc9c3=['options','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','index','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','filter','where','merge'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc9c3,0x96));var _0x3c9c=function(_0x27edb3,_0x1a7a27){_0x27edb3=_0x27edb3-0x0;var _0x4d3118=_0xc9c3[_0x27edb3];return _0x4d3118;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c9c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c9c('0x1'));var moment=require(_0x3c9c('0x2'));var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require(_0x3c9c('0x5'));var path=require(_0x3c9c('0x6'));var sox=require(_0x3c9c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c9c('0x8'));var squel=require(_0x3c9c('0x9'));var crypto=require(_0x3c9c('0xa'));var jsforce=require(_0x3c9c('0xb'));var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0xd'));var querystring=require(_0x3c9c('0xe'));var Papa=require(_0x3c9c('0xf'));var Redis=require(_0x3c9c('0x10'));var authService=require(_0x3c9c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9c('0x12'));var hardwareService=require(_0x3c9c('0x13'));var logger=require('../../config/logger')(_0x3c9c('0x14'));var utils=require('../../config/utils');var config=require(_0x3c9c('0x15'));var licenseUtil=require(_0x3c9c('0x16'));var db=require(_0x3c9c('0x17'))['db'];function respondWithStatusCode(_0x3f464d,_0x4a17ed){_0x4a17ed=_0x4a17ed||0xcc;return function(_0x50cf96){if(_0x50cf96){return _0x3f464d['sendStatus'](_0x4a17ed);}return _0x3f464d[_0x3c9c('0x18')](_0x4a17ed)['end']();};}function respondWithResult(_0x5e8c0e,_0x53b3ca){_0x53b3ca=_0x53b3ca||0xc8;return function(_0x22c495){if(_0x22c495){return _0x5e8c0e['status'](_0x53b3ca)[_0x3c9c('0x19')](_0x22c495);}};}function respondWithFilteredResult(_0xf16337,_0x1f725b){return function(_0x824e63){if(_0x824e63){var _0x4a43d2=typeof _0x1f725b[_0x3c9c('0x1a')]==='undefined'&&typeof _0x1f725b['limit']==='undefined';var _0x3200a3=_0x824e63[_0x3c9c('0x1b')];var _0x216fd8=_0x4a43d2?0x0:_0x1f725b[_0x3c9c('0x1a')];var _0x3e63e0=_0x4a43d2?_0x824e63[_0x3c9c('0x1b')]:_0x1f725b[_0x3c9c('0x1a')]+_0x1f725b['limit'];var _0x15a90a;if(_0x3e63e0>=_0x3200a3){_0x3e63e0=_0x3200a3;_0x15a90a=0xc8;}else{_0x15a90a=0xce;}_0xf16337['status'](_0x15a90a);return _0xf16337[_0x3c9c('0x1c')]('Content-Range',_0x216fd8+'-'+_0x3e63e0+'/'+_0x3200a3)[_0x3c9c('0x19')](_0x824e63);}return null;};}function patchUpdates(_0x1152d5){return function(_0x5f51fb){try{jsonpatch[_0x3c9c('0x1d')](_0x5f51fb,_0x1152d5,!![]);}catch(_0x29e4ac){return BPromise[_0x3c9c('0x1e')](_0x29e4ac);}return _0x5f51fb['save']();};}function saveUpdates(_0x3faad1,_0x249747){return function(_0x2d5ffc){if(_0x2d5ffc){return _0x2d5ffc[_0x3c9c('0x1f')](_0x3faad1)[_0x3c9c('0x20')](function(_0x3bc5c4){return _0x3bc5c4;});}return null;};}function removeEntity(_0x338c2d,_0x32e4c2){return function(_0x509bf7){if(_0x509bf7){return _0x509bf7[_0x3c9c('0x21')]()['then'](function(){_0x338c2d[_0x3c9c('0x18')](0xcc)[_0x3c9c('0x22')]();});}};}function handleEntityNotFound(_0x4ca078,_0x527bb9){return function(_0x379880){if(!_0x379880){_0x4ca078[_0x3c9c('0x23')](0x194);}return _0x379880;};}function handleError(_0x1b57ec,_0x43d1f0){_0x43d1f0=_0x43d1f0||0x1f4;return function(_0x4c283d){logger[_0x3c9c('0x24')](_0x4c283d[_0x3c9c('0x25')]);if(_0x4c283d['name']){delete _0x4c283d[_0x3c9c('0x26')];}_0x1b57ec['status'](_0x43d1f0)['send'](_0x4c283d);};}exports[_0x3c9c('0x27')]=function(_0x39ea8d,_0x333f2b){var _0x248de1={},_0x7bdf33={},_0x5da4e9={'count':0x0,'rows':[]};var _0x18eebd=_['map'](db[_0x3c9c('0x28')][_0x3c9c('0x29')],function(_0x4a0644){return{'name':_0x4a0644[_0x3c9c('0x2a')],'type':_0x4a0644['type'][_0x3c9c('0x2b')]};});_0x7bdf33[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x18eebd,_0x3c9c('0x26'));_0x7bdf33[_0x3c9c('0x2e')]=_[_0x3c9c('0x2f')](_0x39ea8d[_0x3c9c('0x2e')]);_0x7bdf33[_0x3c9c('0x30')]=_['intersection'](_0x7bdf33[_0x3c9c('0x2c')],_0x7bdf33[_0x3c9c('0x2e')]);_0x248de1[_0x3c9c('0x31')]=_[_0x3c9c('0x32')](_0x7bdf33[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x248de1[_0x3c9c('0x31')]=_0x248de1[_0x3c9c('0x31')][_0x3c9c('0x34')]?_0x248de1[_0x3c9c('0x31')]:_0x7bdf33[_0x3c9c('0x2c')];if(!_0x39ea8d[_0x3c9c('0x2e')]['hasOwnProperty'](_0x3c9c('0x35'))){_0x248de1[_0x3c9c('0x36')]=qs[_0x3c9c('0x36')](_0x39ea8d['query'][_0x3c9c('0x36')]);_0x248de1[_0x3c9c('0x1a')]=qs[_0x3c9c('0x1a')](_0x39ea8d[_0x3c9c('0x2e')]['offset']);}_0x248de1['order']=qs[_0x3c9c('0x37')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x37')]);_0x248de1['where']=qs['filters'](_[_0x3c9c('0x38')](_0x39ea8d['query'],_0x7bdf33['filters']),_0x18eebd);if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]){_0x248de1[_0x3c9c('0x3a')]=_['merge'](_0x248de1[_0x3c9c('0x3a')],{'$or':_[_0x3c9c('0x2d')](_0x18eebd,function(_0x4024aa){if(_0x4024aa['type']!=='VIRTUAL'){var _0x4826d3={};_0x4826d3[_0x4024aa[_0x3c9c('0x26')]]={'$like':'%'+_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]+'%'};return _0x4826d3;}})});}_0x248de1=_[_0x3c9c('0x3b')]({},_0x248de1,_0x39ea8d[_0x3c9c('0x3c')]);var _0x1125ff={'where':_0x248de1['where']};return db['DeskField'][_0x3c9c('0x1b')](_0x1125ff)[_0x3c9c('0x20')](function(_0xe23844){_0x5da4e9['count']=_0xe23844;if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x248de1[_0x3c9c('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x248de1);})[_0x3c9c('0x20')](function(_0xdbac2a){_0x5da4e9[_0x3c9c('0x3f')]=_0xdbac2a;return _0x5da4e9;})['then'](respondWithFilteredResult(_0x333f2b,_0x248de1))[_0x3c9c('0x40')](handleError(_0x333f2b,null));};exports[_0x3c9c('0x41')]=function(_0xd81ea4,_0x3dbfc7){var _0x5be9a3={'raw':!![],'where':{'id':_0xd81ea4[_0x3c9c('0x42')]['id']}},_0x412a21={};_0x412a21['model']=_['keys'](db[_0x3c9c('0x28')][_0x3c9c('0x29')]);_0x412a21['query']=_[_0x3c9c('0x2f')](_0xd81ea4[_0x3c9c('0x2e')]);_0x412a21[_0x3c9c('0x30')]=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],_0x412a21[_0x3c9c('0x2e')]);_0x5be9a3['attributes']=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x5be9a3['attributes']=_0x5be9a3['attributes'][_0x3c9c('0x34')]?_0x5be9a3[_0x3c9c('0x31')]:_0x412a21[_0x3c9c('0x2c')];if(_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x5be9a3['include']=[{'all':!![]}];}_0x5be9a3=_[_0x3c9c('0x3b')]({},_0x5be9a3,_0xd81ea4[_0x3c9c('0x3c')]);return db[_0x3c9c('0x28')][_0x3c9c('0x43')](_0x5be9a3)[_0x3c9c('0x20')](handleEntityNotFound(_0x3dbfc7,null))['then'](respondWithResult(_0x3dbfc7,null))[_0x3c9c('0x40')](handleError(_0x3dbfc7,null));};exports[_0x3c9c('0x44')]=function(_0x1804e3,_0x24b1f0){return db[_0x3c9c('0x28')][_0x3c9c('0x44')](_0x1804e3[_0x3c9c('0x45')],{})['then'](respondWithResult(_0x24b1f0,0xc9))[_0x3c9c('0x40')](handleError(_0x24b1f0,null));};exports[_0x3c9c('0x1f')]=function(_0xbcf5fb,_0x278f77){if(_0xbcf5fb[_0x3c9c('0x45')]['id']){delete _0xbcf5fb[_0x3c9c('0x45')]['id'];}return db['DeskField'][_0x3c9c('0x43')]({'where':{'id':_0xbcf5fb[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x278f77,null))[_0x3c9c('0x20')](saveUpdates(_0xbcf5fb[_0x3c9c('0x45')],null))[_0x3c9c('0x20')](respondWithResult(_0x278f77,null))[_0x3c9c('0x40')](handleError(_0x278f77,null));};exports[_0x3c9c('0x21')]=function(_0xb62338,_0x31e63d){return db[_0x3c9c('0x28')][_0x3c9c('0x43')]({'where':{'id':_0xb62338[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x31e63d,null))[_0x3c9c('0x20')](removeEntity(_0x31e63d,null))[_0x3c9c('0x40')](handleError(_0x31e63d,null));};
\ No newline at end of file
index 7543a09..f028224 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8ba=['bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xe8ba,0x145));var _0xae8b=function(_0x2d7371,_0x1f7683){_0x2d7371=_0x2d7371-0x0;var _0x11f52b=_0xe8ba[_0x2d7371];return _0x11f52b;};'use strict';var _=require(_0xae8b('0x0'));var util=require(_0xae8b('0x1'));var logger=require(_0xae8b('0x2'))(_0xae8b('0x3'));var moment=require(_0xae8b('0x4'));var BPromise=require(_0xae8b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae8b('0x6'));var rimraf=require(_0xae8b('0x7'));var config=require(_0xae8b('0x8'));var attributes=require(_0xae8b('0x9'));module[_0xae8b('0xa')]=function(_0x56f282,_0x5bc3f0){return _0x56f282[_0xae8b('0xb')]('DeskField',attributes,{'tableName':_0xae8b('0xc'),'paranoid':![],'indexes':[{'name':_0xae8b('0xd'),'fields':['idField',_0xae8b('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d6f=['../../config/environment','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e3ce8,_0x4fcfd6){var _0x867cfd=function(_0x481d5b){while(--_0x481d5b){_0x5e3ce8['push'](_0x5e3ce8['shift']());}};_0x867cfd(++_0x4fcfd6);}(_0x0d6f,0x127));var _0xf0d6=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0d6f[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xf0d6('0x0'));var util=require(_0xf0d6('0x1'));var logger=require(_0xf0d6('0x2'))(_0xf0d6('0x3'));var moment=require(_0xf0d6('0x4'));var BPromise=require(_0xf0d6('0x5'));var rp=require(_0xf0d6('0x6'));var fs=require('fs');var path=require(_0xf0d6('0x7'));var rimraf=require(_0xf0d6('0x8'));var config=require(_0xf0d6('0x9'));var attributes=require('./intDeskField.attributes');module[_0xf0d6('0xa')]=function(_0x384403,_0x127a7d){return _0x384403[_0xf0d6('0xb')]('DeskField',attributes,{'tableName':_0xf0d6('0xc'),'paranoid':![],'indexes':[{'name':_0xf0d6('0xd'),'fields':[_0xf0d6('0xe'),_0xf0d6('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index b9ed9f5..5605739 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2536=['../../config/logger','rpc','jayson/promise','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5a8120,_0x5e861e){var _0x3f983c=function(_0x37c655){while(--_0x37c655){_0x5a8120['push'](_0x5a8120['shift']());}};_0x3f983c(++_0x5e861e);}(_0x2536,0x163));var _0x6253=function(_0x3e44bb,_0x4f32af){_0x3e44bb=_0x3e44bb-0x0;var _0x6bd5a7=_0x2536[_0x3e44bb];return _0x6bd5a7;};'use strict';var _=require('lodash');var util=require(_0x6253('0x0'));var moment=require(_0x6253('0x1'));var BPromise=require(_0x6253('0x2'));var rs=require(_0x6253('0x3'));var fs=require('fs');var Redis=require(_0x6253('0x4'));var db=require(_0x6253('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6253('0x6'))(_0x6253('0x7'));var config=require('../../config/environment');var jayson=require(_0x6253('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5980f7,_0x3762ad,_0x310457){return new BPromise(function(_0x3abdef,_0x38676c){return client[_0x6253('0x9')](_0x5980f7,_0x310457)[_0x6253('0xa')](function(_0x5be997){logger[_0x6253('0xb')](_0x6253('0xc'),_0x3762ad,_0x6253('0xd'));logger['debug'](_0x6253('0xe'),_0x3762ad,'request\x20sent',JSON[_0x6253('0xf')](_0x5be997));if(_0x5be997[_0x6253('0x10')]){if(_0x5be997[_0x6253('0x10')]['code']===0x1f4){logger['error'](_0x6253('0xc'),_0x3762ad,_0x5be997[_0x6253('0x10')]['message']);return _0x38676c(_0x5be997[_0x6253('0x10')][_0x6253('0x11')]);}logger[_0x6253('0x10')](_0x6253('0xc'),_0x3762ad,_0x5be997[_0x6253('0x10')][_0x6253('0x11')]);return _0x3abdef(_0x5be997['error']['message']);}else{logger[_0x6253('0xb')](_0x6253('0xc'),_0x3762ad,_0x6253('0xd'));_0x3abdef(_0x5be997[_0x6253('0x12')][_0x6253('0x11')]);}})['catch'](function(_0x157a70){logger[_0x6253('0x10')](_0x6253('0xc'),_0x3762ad,_0x157a70);_0x38676c(_0x157a70);});});}
\ No newline at end of file
+var _0x2e2f=['request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','DeskField,\x20%s,\x20%s','debug'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x2e2f,0x77));var _0xf2e2=function(_0xd746ed,_0x81920c){_0xd746ed=_0xd746ed-0x0;var _0x5ef2a6=_0x2e2f[_0xd746ed];return _0x5ef2a6;};'use strict';var _=require(_0xf2e2('0x0'));var util=require(_0xf2e2('0x1'));var moment=require(_0xf2e2('0x2'));var BPromise=require(_0xf2e2('0x3'));var rs=require(_0xf2e2('0x4'));var fs=require('fs');var Redis=require(_0xf2e2('0x5'));var db=require(_0xf2e2('0x6'))['db'];var utils=require(_0xf2e2('0x7'));var logger=require(_0xf2e2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf2e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5107dd,_0x35ba45,_0x6e9705){return new BPromise(function(_0x4291f7,_0xc3dc90){return client[_0xf2e2('0xa')](_0x5107dd,_0x6e9705)['then'](function(_0x4caa96){logger[_0xf2e2('0xb')](_0xf2e2('0xc'),_0x35ba45,'request\x20sent');logger[_0xf2e2('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x35ba45,_0xf2e2('0xe'),JSON['stringify'](_0x4caa96));if(_0x4caa96[_0xf2e2('0xf')]){if(_0x4caa96[_0xf2e2('0xf')][_0xf2e2('0x10')]===0x1f4){logger[_0xf2e2('0xf')](_0xf2e2('0xc'),_0x35ba45,_0x4caa96['error'][_0xf2e2('0x11')]);return _0xc3dc90(_0x4caa96[_0xf2e2('0xf')][_0xf2e2('0x11')]);}logger[_0xf2e2('0xf')](_0xf2e2('0xc'),_0x35ba45,_0x4caa96[_0xf2e2('0xf')][_0xf2e2('0x11')]);return _0x4291f7(_0x4caa96['error']['message']);}else{logger[_0xf2e2('0xb')](_0xf2e2('0xc'),_0x35ba45,_0xf2e2('0xe'));_0x4291f7(_0x4caa96['result'][_0xf2e2('0x11')]);}})[_0xf2e2('0x12')](function(_0x38104f){logger[_0xf2e2('0xf')](_0xf2e2('0xc'),_0x35ba45,_0x38104f);_0xc3dc90(_0x38104f);});});}
\ No newline at end of file
index 3684ad7..485fe13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce40=['/:id/configurations','addConfiguration','put','/:id','update','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','show','isAuthenticated','/:id/fields','getFields','post','create'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xce40,0x1d5));var _0x0ce4=function(_0x481af3,_0x483fac){_0x481af3=_0x481af3-0x0;var _0x3354ea=_0xce40[_0x481af3];return _0x3354ea;};'use strict';var multer=require('multer');var util=require(_0x0ce4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0ce4('0x1')]();var fs_extra=require(_0x0ce4('0x2'));var auth=require(_0x0ce4('0x3'));var interaction=require(_0x0ce4('0x4'));var config=require(_0x0ce4('0x5'));var controller=require(_0x0ce4('0x6'));router[_0x0ce4('0x7')]('/',auth['isAuthenticated'](),controller[_0x0ce4('0x8')]);router[_0x0ce4('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0ce4('0x9')]);router['get']('/:id/configurations',auth[_0x0ce4('0xa')](),controller['getConfigurations']);router['get'](_0x0ce4('0xb'),auth['isAuthenticated'](),controller[_0x0ce4('0xc')]);router[_0x0ce4('0xd')]('/',auth[_0x0ce4('0xa')](),controller[_0x0ce4('0xe')]);router[_0x0ce4('0xd')](_0x0ce4('0xf'),auth['isAuthenticated'](),controller[_0x0ce4('0x10')]);router[_0x0ce4('0x11')](_0x0ce4('0x12'),auth[_0x0ce4('0xa')](),controller[_0x0ce4('0x13')]);router['delete']('/:id',auth[_0x0ce4('0xa')](),controller[_0x0ce4('0x14')]);module[_0x0ce4('0x15')]=router;
\ No newline at end of file
+var _0x2318=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','/:id','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','put','update','destroy','exports','multer'];(function(_0x163d5f,_0x15ef60){var _0x2cbcf3=function(_0x3a16f0){while(--_0x3a16f0){_0x163d5f['push'](_0x163d5f['shift']());}};_0x2cbcf3(++_0x15ef60);}(_0x2318,0xa0));var _0x8231=function(_0x333aa2,_0x3f2d95){_0x333aa2=_0x333aa2-0x0;var _0x338bc4=_0x2318[_0x333aa2];return _0x338bc4;};'use strict';var multer=require(_0x8231('0x0'));var util=require(_0x8231('0x1'));var path=require(_0x8231('0x2'));var timeout=require(_0x8231('0x3'));var express=require(_0x8231('0x4'));var router=express[_0x8231('0x5')]();var fs_extra=require(_0x8231('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8231('0x7'));var config=require('../../config/environment');var controller=require(_0x8231('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8231('0x9')](_0x8231('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8231('0x9')](_0x8231('0xb'),auth['isAuthenticated'](),controller[_0x8231('0xc')]);router[_0x8231('0x9')](_0x8231('0xd'),auth[_0x8231('0xe')](),controller[_0x8231('0xf')]);router[_0x8231('0x10')]('/',auth[_0x8231('0xe')](),controller[_0x8231('0x11')]);router[_0x8231('0x10')]('/:id/configurations',auth[_0x8231('0xe')](),controller[_0x8231('0x12')]);router[_0x8231('0x13')]('/:id',auth[_0x8231('0xe')](),controller[_0x8231('0x14')]);router['delete'](_0x8231('0xa'),auth[_0x8231('0xe')](),controller[_0x8231('0x15')]);module[_0x8231('0x16')]=router;
\ No newline at end of file
index 3a5d3e2..adbea54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7ea=['exports','STRING'];(function(_0x3d2d19,_0x446b61){var _0x2b469c=function(_0x5154e8){while(--_0x5154e8){_0x3d2d19['push'](_0x3d2d19['shift']());}};_0x2b469c(++_0x446b61);}(_0xb7ea,0x6a));var _0xab7e=function(_0xca04ff,_0xcb449f){_0xca04ff=_0xca04ff-0x0;var _0x6b547=_0xb7ea[_0xca04ff];return _0x6b547;};'use strict';var Sequelize=require('sequelize');module[_0xab7e('0x0')]={'name':{'type':Sequelize[_0xab7e('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xab7e('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xab7e('0x1')]},'serverUrl':{'type':Sequelize[_0xab7e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xab7e('0x1')]}};
\ No newline at end of file
+var _0xdaab=['STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdaab,0xa2));var _0xbdaa=function(_0x1c184b,_0x4d61b4){_0x1c184b=_0x1c184b-0x0;var _0x22bcf0=_0xdaab[_0x1c184b];return _0x22bcf0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbdaa('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbdaa('0x0')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbdaa('0x0')]},'clientSecret':{'type':Sequelize[_0xbdaa('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xbdaa('0x0')]}};
\ No newline at end of file
index a19de63..04682e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b2d=['statusCode','Wrong\x20credentials','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','4.0','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','Descriptions','ticketType','incident','PhoneCall','title','customerid','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','forEach','@odata.type','push','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x4dbeaa,_0x3fb85d){_0x4dbeaa=_0x4dbeaa-0x0;var _0x889e79=_0x8b2d[_0x4dbeaa];return _0x889e79;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd8b2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8b2('0x1'));var moment=require(_0xd8b2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd8b2('0x3'));var util=require(_0xd8b2('0x4'));var path=require('path');var sox=require(_0xd8b2('0x5'));var csv=require(_0xd8b2('0x6'));var ejs=require(_0xd8b2('0x7'));var fs=require('fs');var fs_extra=require(_0xd8b2('0x8'));var _=require(_0xd8b2('0x9'));var squel=require(_0xd8b2('0xa'));var crypto=require(_0xd8b2('0xb'));var jsforce=require(_0xd8b2('0xc'));var deskjs=require(_0xd8b2('0xd'));var toCsv=require(_0xd8b2('0x6'));var querystring=require('querystring');var Papa=require(_0xd8b2('0xe'));var Redis=require('ioredis');var authService=require(_0xd8b2('0xf'));var qs=require(_0xd8b2('0x10'));var as=require(_0xd8b2('0x11'));var hardwareService=require(_0xd8b2('0x12'));var logger=require(_0xd8b2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd8b2('0x14'));var db=require(_0xd8b2('0x15'))['db'];var integrations=require(_0xd8b2('0x16'));function respondWithStatusCode(_0x5cdee6,_0x420f45){_0x420f45=_0x420f45||0xcc;return function(_0x91b775){if(_0x91b775){return _0x5cdee6[_0xd8b2('0x17')](_0x420f45);}return _0x5cdee6[_0xd8b2('0x18')](_0x420f45)['end']();};}function respondWithResult(_0x3ecff2,_0x4c4d97){_0x4c4d97=_0x4c4d97||0xc8;return function(_0x48c80f){if(_0x48c80f){return _0x3ecff2[_0xd8b2('0x18')](_0x4c4d97)[_0xd8b2('0x19')](_0x48c80f);}};}function respondWithFilteredResult(_0x227f86,_0x2a0b6){return function(_0x35cbed){if(_0x35cbed){var _0x6347f1=typeof _0x2a0b6[_0xd8b2('0x1a')]==='undefined'&&typeof _0x2a0b6['limit']===_0xd8b2('0x1b');var _0x5b63a1=_0x35cbed[_0xd8b2('0x1c')];var _0x44185b=_0x6347f1?0x0:_0x2a0b6[_0xd8b2('0x1a')];var _0x3d5deb=_0x6347f1?_0x35cbed[_0xd8b2('0x1c')]:_0x2a0b6['offset']+_0x2a0b6[_0xd8b2('0x1d')];var _0x4a910a;if(_0x3d5deb>=_0x5b63a1){_0x3d5deb=_0x5b63a1;_0x4a910a=0xc8;}else{_0x4a910a=0xce;}_0x227f86[_0xd8b2('0x18')](_0x4a910a);return _0x227f86[_0xd8b2('0x1e')]('Content-Range',_0x44185b+'-'+_0x3d5deb+'/'+_0x5b63a1)[_0xd8b2('0x19')](_0x35cbed);}return null;};}function patchUpdates(_0x4d355c){return function(_0x4810a3){try{jsonpatch[_0xd8b2('0x1f')](_0x4810a3,_0x4d355c,!![]);}catch(_0x5ba53a){return BPromise['reject'](_0x5ba53a);}return _0x4810a3[_0xd8b2('0x20')]();};}function saveUpdates(_0x42ae8f,_0x4b2992){return function(_0x15f727){if(_0x15f727){return _0x15f727[_0xd8b2('0x21')](_0x42ae8f)[_0xd8b2('0x22')](function(_0x563c96){return _0x563c96;});}return null;};}function removeEntity(_0x16d996,_0x4a92d5){return function(_0x21d59b){if(_0x21d59b){return _0x21d59b[_0xd8b2('0x23')]()['then'](function(){_0x16d996[_0xd8b2('0x18')](0xcc)[_0xd8b2('0x24')]();});}};}function handleEntityNotFound(_0x520143,_0x101e23){return function(_0x26805c){if(!_0x26805c){_0x520143['sendStatus'](0x194);}return _0x26805c;};}function handleError(_0x4f6fd5,_0x2f1f15){_0x2f1f15=_0x2f1f15||0x1f4;return function(_0x2ee1ee){logger[_0xd8b2('0x25')](_0x2ee1ee[_0xd8b2('0x26')]);if(_0x2ee1ee[_0xd8b2('0x27')]){delete _0x2ee1ee['name'];}_0x4f6fd5['status'](_0x2f1f15)[_0xd8b2('0x28')](_0x2ee1ee);};}exports[_0xd8b2('0x29')]=function(_0x249565,_0x22c3cf){var _0x39ef2f={},_0x2ef26c={},_0x51a745={'count':0x0,'rows':[]};var _0x22b687=_[_0xd8b2('0x2a')](db[_0xd8b2('0x2b')][_0xd8b2('0x2c')],function(_0x6c2219){return{'name':_0x6c2219[_0xd8b2('0x2d')],'type':_0x6c2219[_0xd8b2('0x2e')][_0xd8b2('0x2f')]};});_0x2ef26c[_0xd8b2('0x30')]=_[_0xd8b2('0x2a')](_0x22b687,_0xd8b2('0x27'));_0x2ef26c['query']=_[_0xd8b2('0x31')](_0x249565['query']);_0x2ef26c[_0xd8b2('0x32')]=_[_0xd8b2('0x33')](_0x2ef26c[_0xd8b2('0x30')],_0x2ef26c[_0xd8b2('0x34')]);_0x39ef2f[_0xd8b2('0x35')]=_[_0xd8b2('0x33')](_0x2ef26c[_0xd8b2('0x30')],qs[_0xd8b2('0x36')](_0x249565['query'][_0xd8b2('0x36')]));_0x39ef2f[_0xd8b2('0x35')]=_0x39ef2f[_0xd8b2('0x35')][_0xd8b2('0x37')]?_0x39ef2f[_0xd8b2('0x35')]:_0x2ef26c[_0xd8b2('0x30')];if(!_0x249565[_0xd8b2('0x34')][_0xd8b2('0x38')](_0xd8b2('0x39'))){_0x39ef2f[_0xd8b2('0x1d')]=qs['limit'](_0x249565[_0xd8b2('0x34')][_0xd8b2('0x1d')]);_0x39ef2f['offset']=qs['offset'](_0x249565[_0xd8b2('0x34')]['offset']);}_0x39ef2f[_0xd8b2('0x3a')]=qs['sort'](_0x249565[_0xd8b2('0x34')][_0xd8b2('0x3b')]);_0x39ef2f[_0xd8b2('0x3c')]=qs[_0xd8b2('0x32')](_[_0xd8b2('0x3d')](_0x249565[_0xd8b2('0x34')],_0x2ef26c[_0xd8b2('0x32')]),_0x22b687);if(_0x249565[_0xd8b2('0x34')][_0xd8b2('0x3e')]){_0x39ef2f[_0xd8b2('0x3c')]=_[_0xd8b2('0x3f')](_0x39ef2f[_0xd8b2('0x3c')],{'$or':_[_0xd8b2('0x2a')](_0x22b687,function(_0x39ec1f){if(_0x39ec1f[_0xd8b2('0x2e')]!==_0xd8b2('0x40')){var _0x141f11={};_0x141f11[_0x39ec1f[_0xd8b2('0x27')]]={'$like':'%'+_0x249565[_0xd8b2('0x34')][_0xd8b2('0x3e')]+'%'};return _0x141f11;}})});}_0x39ef2f=_[_0xd8b2('0x3f')]({},_0x39ef2f,_0x249565[_0xd8b2('0x41')]);var _0x4c9f5f={'where':_0x39ef2f[_0xd8b2('0x3c')]};return db['Dynamics365Account'][_0xd8b2('0x1c')](_0x4c9f5f)[_0xd8b2('0x22')](function(_0x3d7997){_0x51a745['count']=_0x3d7997;if(_0x249565['query']['includeAll']){_0x39ef2f['include']=[{'all':!![]}];}return db[_0xd8b2('0x2b')][_0xd8b2('0x42')](_0x39ef2f);})[_0xd8b2('0x22')](function(_0x4e342a){_0x51a745[_0xd8b2('0x43')]=_0x4e342a;return _0x51a745;})[_0xd8b2('0x22')](respondWithFilteredResult(_0x22c3cf,_0x39ef2f))['catch'](handleError(_0x22c3cf,null));};exports[_0xd8b2('0x44')]=function(_0x4884b3,_0x5e727b){var _0x368b43={'raw':![],'where':{'id':_0x4884b3[_0xd8b2('0x45')]['id']}},_0x2d29df={};_0x2d29df['model']=_['keys'](db[_0xd8b2('0x2b')][_0xd8b2('0x2c')]);_0x2d29df['query']=_[_0xd8b2('0x31')](_0x4884b3[_0xd8b2('0x34')]);_0x2d29df[_0xd8b2('0x32')]=_['intersection'](_0x2d29df[_0xd8b2('0x30')],_0x2d29df['query']);_0x368b43[_0xd8b2('0x35')]=_[_0xd8b2('0x33')](_0x2d29df[_0xd8b2('0x30')],qs[_0xd8b2('0x36')](_0x4884b3[_0xd8b2('0x34')]['fields']));_0x368b43[_0xd8b2('0x35')]=_0x368b43[_0xd8b2('0x35')][_0xd8b2('0x37')]?_0x368b43[_0xd8b2('0x35')]:_0x2d29df[_0xd8b2('0x30')];if(_0x4884b3[_0xd8b2('0x34')][_0xd8b2('0x46')]){_0x368b43[_0xd8b2('0x47')]=[{'all':!![]}];}_0x368b43=_[_0xd8b2('0x3f')]({},_0x368b43,_0x4884b3[_0xd8b2('0x41')]);return db['Dynamics365Account'][_0xd8b2('0x48')](_0x368b43)['then'](handleEntityNotFound(_0x5e727b,null))[_0xd8b2('0x22')](respondWithResult(_0x5e727b,null))[_0xd8b2('0x49')](handleError(_0x5e727b,null));};exports[_0xd8b2('0x4a')]=function(_0x6e2516,_0x296d28){return db[_0xd8b2('0x2b')][_0xd8b2('0x4a')](_0x6e2516[_0xd8b2('0x4b')],{})[_0xd8b2('0x22')](respondWithResult(_0x296d28,0xc9))[_0xd8b2('0x49')](handleError(_0x296d28,null));};exports['update']=function(_0x5462cc,_0x2af130){if(_0x5462cc[_0xd8b2('0x4b')]['id']){delete _0x5462cc['body']['id'];}return db[_0xd8b2('0x2b')][_0xd8b2('0x48')]({'where':{'id':_0x5462cc[_0xd8b2('0x45')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x2af130,null))[_0xd8b2('0x22')](saveUpdates(_0x5462cc[_0xd8b2('0x4b')],null))[_0xd8b2('0x22')](respondWithResult(_0x2af130,null))[_0xd8b2('0x49')](handleError(_0x2af130,null));};exports[_0xd8b2('0x23')]=function(_0x5cccf4,_0x534c27){return db[_0xd8b2('0x2b')][_0xd8b2('0x48')]({'where':{'id':_0x5cccf4[_0xd8b2('0x45')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x534c27,null))['then'](removeEntity(_0x534c27,null))[_0xd8b2('0x49')](handleError(_0x534c27,null));};exports[_0xd8b2('0x4c')]=function(_0x1a6a09,_0x4b5e82,_0x3133e1){var _0x30edab={};var _0x4a0308={};var _0x424fb9;var _0x3d3ba2;return db[_0xd8b2('0x2b')][_0xd8b2('0x4d')]({'where':{'id':_0x1a6a09['params']['id']}})['then'](handleEntityNotFound(_0x4b5e82,null))[_0xd8b2('0x22')](function(_0x269306){if(_0x269306){_0x424fb9=_0x269306;_0x4a0308[_0xd8b2('0x30')]=_[_0xd8b2('0x31')](db['Dynamics365Configuration'][_0xd8b2('0x2c')]);_0x4a0308['query']=_[_0xd8b2('0x31')](_0x1a6a09[_0xd8b2('0x34')]);_0x4a0308['filters']=_[_0xd8b2('0x33')](_0x4a0308[_0xd8b2('0x30')],_0x4a0308[_0xd8b2('0x34')]);_0x30edab['attributes']=_[_0xd8b2('0x33')](_0x4a0308[_0xd8b2('0x30')],qs[_0xd8b2('0x36')](_0x1a6a09[_0xd8b2('0x34')][_0xd8b2('0x36')]));_0x30edab['attributes']=_0x30edab[_0xd8b2('0x35')][_0xd8b2('0x37')]?_0x30edab['attributes']:_0x4a0308[_0xd8b2('0x30')];_0x30edab[_0xd8b2('0x3a')]=qs['sort'](_0x1a6a09[_0xd8b2('0x34')][_0xd8b2('0x3b')]);_0x30edab[_0xd8b2('0x3c')]=qs[_0xd8b2('0x32')](_[_0xd8b2('0x3d')](_0x1a6a09[_0xd8b2('0x34')],_0x4a0308[_0xd8b2('0x32')]));if(_0x1a6a09['query'][_0xd8b2('0x3e')]){_0x30edab[_0xd8b2('0x3c')]=_[_0xd8b2('0x3f')](_0x30edab[_0xd8b2('0x3c')],{'$or':_[_0xd8b2('0x2a')](_0x30edab[_0xd8b2('0x35')],function(_0x318cbb){var _0x5efff8={};_0x5efff8[_0x318cbb]={'$like':'%'+_0x1a6a09[_0xd8b2('0x34')][_0xd8b2('0x3e')]+'%'};return _0x5efff8;})});}_0x30edab=_['merge']({},_0x30edab,_0x1a6a09['options']);return _0x424fb9[_0xd8b2('0x4c')](_0x30edab);}})[_0xd8b2('0x22')](function(_0x57be60){if(_0x57be60){_0x3d3ba2=_0x57be60['length'];if(!_0x1a6a09[_0xd8b2('0x34')][_0xd8b2('0x38')](_0xd8b2('0x39'))){_0x30edab['limit']=qs[_0xd8b2('0x1d')](_0x1a6a09['query'][_0xd8b2('0x1d')]);_0x30edab['offset']=qs['offset'](_0x1a6a09[_0xd8b2('0x34')][_0xd8b2('0x1a')]);}return _0x424fb9[_0xd8b2('0x4c')](_0x30edab);}})['then'](function(_0x3c9df8){if(_0x3c9df8){return _0x3c9df8?{'count':_0x3d3ba2,'rows':_0x3c9df8}:null;}})[_0xd8b2('0x22')](respondWithResult(_0x4b5e82,null))['catch'](handleError(_0x4b5e82,null));};exports['addConfiguration']=function(_0x50f8db,_0x163269,_0x140998){if(_0x50f8db[_0xd8b2('0x4b')]['id']){delete _0x50f8db['body']['id'];}return db[_0xd8b2('0x2b')][_0xd8b2('0x4d')]({'where':{'id':_0x50f8db[_0xd8b2('0x45')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x163269,null))[_0xd8b2('0x22')](function(_0xdc837f){if(_0xdc837f){_0x50f8db[_0xd8b2('0x4b')][_0xd8b2('0x4e')]=_0xdc837f['id'];_0x50f8db['body'][_0xd8b2('0x4f')]=integrations[_0xd8b2('0x50')](_0x50f8db[_0xd8b2('0x4b')][_0xd8b2('0x51')],_0x50f8db[_0xd8b2('0x4b')][_0xd8b2('0x2e')]);_0x50f8db[_0xd8b2('0x4b')]['Descriptions']=integrations[_0xd8b2('0x52')](_0x50f8db['body']['channel'],_0x50f8db[_0xd8b2('0x4b')]['type']);return db[_0xd8b2('0x53')][_0xd8b2('0x4a')](_0x50f8db[_0xd8b2('0x4b')],{'include':[{'model':db[_0xd8b2('0x54')],'as':'Subjects'},{'model':db[_0xd8b2('0x54')],'as':_0xd8b2('0x55')}]});}return null;})[_0xd8b2('0x22')](respondWithResult(_0x163269,null))['catch'](handleError(_0x163269,null));};exports['getFields']=function(_0x31769a,_0x5d7709,_0x1b016a){var _0x51bcc4=_0x31769a[_0xd8b2('0x34')][_0xd8b2('0x56')];var _0xbc8d43=_0x51bcc4===_0xd8b2('0x57')?'Incident':_0xd8b2('0x58');var _0x41abdd='';var _0x2b675d='';var _0x393461='';var _0x19952d='';var _0x165cf7='';var _0x23c5eb='';var _0x1cafab='';var _0x200f32='';var _0x45f5c3=[_0xd8b2('0x59'),'description',_0xd8b2('0x5a'),'ownerid','caseorigincode',_0xd8b2('0x5b'),_0xd8b2('0x5c'),'regardingobjectid',_0xd8b2('0x5d'),_0xd8b2('0x5e')];var _0x410d52=['accountidname',_0xd8b2('0x5f'),_0xd8b2('0x60'),_0xd8b2('0x61'),_0xd8b2('0x62'),_0xd8b2('0x63'),_0xd8b2('0x64'),_0xd8b2('0x65'),_0xd8b2('0x66'),_0xd8b2('0x67'),'createdbyname',_0xd8b2('0x68'),_0xd8b2('0x69'),_0xd8b2('0x6a'),_0xd8b2('0x6b'),_0xd8b2('0x6c'),_0xd8b2('0x6d'),'customeridyominame',_0xd8b2('0x6e'),_0xd8b2('0x6f'),_0xd8b2('0x70'),_0xd8b2('0x71'),_0xd8b2('0x72'),_0xd8b2('0x73'),_0xd8b2('0x74'),_0xd8b2('0x75'),_0xd8b2('0x76'),'influencescore',_0xd8b2('0x77'),_0xd8b2('0x78'),_0xd8b2('0x79'),_0xd8b2('0x7a'),'modifiedbyexternalpartyyominame',_0xd8b2('0x7b'),_0xd8b2('0x7c'),_0xd8b2('0x7d'),_0xd8b2('0x7e'),_0xd8b2('0x7f'),_0xd8b2('0x80'),_0xd8b2('0x81'),_0xd8b2('0x82'),_0xd8b2('0x83'),'overriddencreatedon',_0xd8b2('0x84'),_0xd8b2('0x85'),'owneridyominame','parentcaseidname','primarycontactidname',_0xd8b2('0x86'),_0xd8b2('0x87'),_0xd8b2('0x88'),_0xd8b2('0x89'),_0xd8b2('0x8a'),_0xd8b2('0x8b'),_0xd8b2('0x8c'),_0xd8b2('0x8d'),_0xd8b2('0x8e'),_0xd8b2('0x8f'),_0xd8b2('0x90'),_0xd8b2('0x91'),'socialprofileidname',_0xd8b2('0x92'),_0xd8b2('0x93'),_0xd8b2('0x94'),_0xd8b2('0x95'),_0xd8b2('0x96'),'transactioncurrencyidname',_0xd8b2('0x97'),_0xd8b2('0x98'),'versionnumber'];var _0x273459=_0x45f5c3[_0xd8b2('0x99')](_0x410d52);return db['Dynamics365Account'][_0xd8b2('0x4d')]({'where':{'id':_0x31769a[_0xd8b2('0x45')]['id']},'attributes':['id',_0xd8b2('0x9a'),_0xd8b2('0x9b'),_0xd8b2('0x9c'),'tenantId',_0xd8b2('0x9d'),_0xd8b2('0x9e')]})[_0xd8b2('0x22')](handleEntityNotFound(_0x5d7709,null))[_0xd8b2('0x22')](function(_0x2ed8f3){if(_0x2ed8f3){_0x200f32=_0x2ed8f3[_0xd8b2('0x9c')];var _0x1a6e71=_0x200f32[_0xd8b2('0x9f')](-0x1);if(_0x1a6e71==='/'){_0x200f32=_0x200f32[_0xd8b2('0xa0')](0x0,_0x200f32[_0xd8b2('0xa1')](_0x1a6e71));}_0x1cafab=util[_0xd8b2('0xa2')](_0xd8b2('0xa3'),_0x200f32);var _0x40deb1={'method':_0xd8b2('0xa4'),'uri':_0xd8b2('0xa5')+_0x2ed8f3['tenantId']+_0xd8b2('0xa6'),'form':{'client_id':_0x2ed8f3[_0xd8b2('0x9d')],'resource':_0x200f32,'username':_0x2ed8f3['username'],'password':_0x2ed8f3[_0xd8b2('0x9b')],'grant_type':_0xd8b2('0x9b'),'client_secret':_0x2ed8f3['clientSecret']},'json':!![]};return rp(_0x40deb1);}})[_0xd8b2('0x22')](function(_0x4f2131){_0x23c5eb=_0x4f2131['access_token'];var _0x3bed9d={'method':_0xd8b2('0xa7'),'uri':encodeURI(_0x1cafab+_0xd8b2('0xa8')+_0xbc8d43+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x23c5eb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3bed9d);})[_0xd8b2('0x22')](function(_0x3f9688){var _0x110107=_0x3f9688['value'][0x0];var _0x5ebab4=_0x110107[_0xd8b2('0xa9')];var _0x66aec0={'method':_0xd8b2('0xa7'),'uri':_0x1cafab+'EntityDefinitions('+_0x5ebab4+_0xd8b2('0xaa'),'headers':{'Authorization':_0xd8b2('0xab')+_0x23c5eb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x66aec0);})[_0xd8b2('0x22')](function(_0x2aa007){_0x41abdd=_0x2aa007;_0x2b675d=_0x41abdd[_0xd8b2('0xac')];_0x2b675d=_[_0xd8b2('0xad')](_0x2b675d,function(_0x3b0610){return!_0x273459['includes'](_0x3b0610['LogicalName']);});var _0xab32d=[];var _0x3514d2=[];_0x2b675d[_0xd8b2('0xae')](function(_0xe4785a){if(_0xe4785a[_0xd8b2('0xaf')]){var _0x22b309=_0xe4785a['@odata.type'][_0xd8b2('0xa0')](_0xe4785a['@odata.type'][_0xd8b2('0xa1')]('.')+0x1);if(_0x22b309==='PicklistAttributeMetadata'){_0xab32d[_0xd8b2('0xb0')](getSelectList(_0x1cafab,_0x51bcc4,_0x3514d2,_0x41abdd[_0xd8b2('0xa9')],_0xe4785a['MetadataId'],_0x23c5eb));}}});return Promise['all'](_0xab32d);})[_0xd8b2('0x22')](function(_0x1eddb9){_0x393461=_0x1eddb9[0x0];var _0x179edd=[];var _0x3a44f6=[];_0x2b675d[_0xd8b2('0xae')](function(_0x371f7f){if(!_[_0xd8b2('0xb1')](_0x371f7f[_0xd8b2('0xaf')])){var _0x47c982=_0x371f7f['@odata.type'][_0xd8b2('0xa0')](_0x371f7f[_0xd8b2('0xaf')]['lastIndexOf']('.')+0x1);if(_0x47c982===_0xd8b2('0xb2')){_0x179edd['push'](getBooleanList(_0x1cafab,_0x51bcc4,_0x3a44f6,_0x41abdd[_0xd8b2('0xa9')],_0x371f7f[_0xd8b2('0xa9')],_0x23c5eb));}}});return Promise['all'](_0x179edd);})[_0xd8b2('0x22')](function(_0x25721e){_0x19952d=_0x25721e[0x0];var _0x1d3191=[];var _0x447666=[];_0x2b675d['forEach'](function(_0x4a41c9){if(_0x4a41c9[_0xd8b2('0xaf')]){var _0x2edcdb=_0x4a41c9[_0xd8b2('0xaf')][_0xd8b2('0xa0')](_0x4a41c9[_0xd8b2('0xaf')][_0xd8b2('0xa1')]('.')+0x1);if(_0x2edcdb===_0xd8b2('0xb3')||_0x2edcdb===_0xd8b2('0xb4')||_0x2edcdb===_0xd8b2('0xb5')||_0x2edcdb===_0xd8b2('0xb6')||_0x2edcdb===_0xd8b2('0xb7')||_0x2edcdb===_0xd8b2('0xb8')||_0x2edcdb===_0xd8b2('0xb9')||_0x2edcdb===_0xd8b2('0xba')||_0x2edcdb===_0xd8b2('0xbb')||_0x2edcdb===_0xd8b2('0xbc')){_0x1d3191[_0xd8b2('0xb0')](getInputList(_0x1cafab,_0x51bcc4,_0x2edcdb,_0x447666,_0x41abdd[_0xd8b2('0xa9')],_0x4a41c9[_0xd8b2('0xa9')],_0x23c5eb));}}});return Promise[_0xd8b2('0xbd')](_0x1d3191);})[_0xd8b2('0x22')](function(_0x1a58a5){_0x165cf7=_0x1a58a5[0x0];var _0x1d04f2=_0x393461['concat'](_0x19952d)[_0xd8b2('0x99')](_0x165cf7);var _0x21db88={'count':_0x1d04f2[_0xd8b2('0x37')],'rows':_0x1d04f2};return _0x21db88;})[_0xd8b2('0x22')](respondWithResult(_0x5d7709,null))[_0xd8b2('0x49')](function(_0x189bce){var _0x92f4fb=_0x31769a['query'][_0xd8b2('0xbe')]?0x1f4:_0x189bce[_0xd8b2('0xbf')]||0x1f4;logger[_0xd8b2('0x25')](_0x189bce[_0xd8b2('0x26')]);delete _0x189bce['name'];if(_0x92f4fb===0x191){_0x92f4fb=0x190;}_0x5d7709[_0xd8b2('0x18')](_0x92f4fb)[_0xd8b2('0x28')](_0x31769a[_0xd8b2('0x34')][_0xd8b2('0xbe')]?{'message':_0xd8b2('0xc0'),'statusCode':_0x189bce[_0xd8b2('0xbf')]}:_0x189bce);});};function getSelectList(_0xb2fff,_0x208a5e,_0x358798,_0x2cceff,_0x41d781,_0x412d34){var _0x19325d={'method':_0xd8b2('0xa7'),'uri':_0xb2fff+_0xd8b2('0xc1')+_0x2cceff+')/Attributes('+_0x41d781+_0xd8b2('0xc2')+_0xd8b2('0xc3'),'headers':{'Authorization':_0xd8b2('0xab')+_0x412d34,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x19325d)['then'](function(_0x3c0129){var _0x56df98=[];var _0x1e2a4a=_0x3c0129[_0xd8b2('0xc4')][_0xd8b2('0xc5')];_0x1e2a4a['forEach'](function(_0x292686){_0x56df98['push']({'name':_0x292686[_0xd8b2('0xc6')]['UserLocalizedLabel'][_0xd8b2('0xc6')],'value':String(_0x292686[_0xd8b2('0xc7')])});});var _0x45a3d0={'id':_0x208a5e+'_'+_0x3c0129['LogicalName'],'name':_0x3c0129['DisplayName'][_0xd8b2('0xc8')][_0xd8b2('0xc6')],'custom':![],'options':_0x56df98};_0x358798[_0xd8b2('0xb0')](_0x45a3d0);return _0x358798;});}function getBooleanList(_0x32ed4f,_0x165efb,_0x5df1fb,_0xbfa903,_0x1350f1,_0x1a0fd3){var _0x306520={'method':'GET','uri':_0x32ed4f+_0xd8b2('0xc1')+_0xbfa903+')/Attributes('+_0x1350f1+_0xd8b2('0xc9'),'headers':{'Authorization':_0xd8b2('0xab')+_0x1a0fd3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x306520)[_0xd8b2('0x22')](function(_0x38e27e){var _0x23cceb=[];_0x23cceb[_0xd8b2('0xb0')]({'name':_0x38e27e[_0xd8b2('0xc4')][_0xd8b2('0xca')][_0xd8b2('0xc6')][_0xd8b2('0xc8')]['Label'],'value':_0xd8b2('0xcb')},{'name':_0x38e27e['OptionSet']['FalseOption']['Label'][_0xd8b2('0xc8')]['Label'],'value':_0xd8b2('0xcc')});var _0x2944e1={'id':_0x165efb+'_'+_0x38e27e[_0xd8b2('0xcd')],'name':_0x38e27e[_0xd8b2('0xce')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x23cceb};_0x5df1fb['push'](_0x2944e1);return _0x5df1fb;});}function getInputList(_0x4bd439,_0x4e90b0,_0x3b78e5,_0x3b72a2,_0x1a6829,_0x486ced,_0x22b105){var _0xa70700={'method':_0xd8b2('0xa7'),'uri':_0x4bd439+'EntityDefinitions('+_0x1a6829+')/Attributes('+_0x486ced+_0xd8b2('0xcf')+_0x3b78e5+_0xd8b2('0xd0'),'headers':{'Authorization':_0xd8b2('0xab')+_0x22b105,'If-None-Match':null,'OData-Version':_0xd8b2('0xd1')},'json':!![]};return rp(_0xa70700)['then'](function(_0x700dab){var _0x40d115={'id':_0x4e90b0+'_'+_0x700dab['LogicalName'],'name':_0x700dab[_0xd8b2('0xce')][_0xd8b2('0xc8')]?_0x700dab[_0xd8b2('0xce')][_0xd8b2('0xc8')][_0xd8b2('0xc6')]:_0x700dab[_0xd8b2('0xcd')],'custom':![],'options':[]};_0x3b72a2['push'](_0x40d115);return _0x3b72a2;});}
\ No newline at end of file
+var _0xf9bb=['include','find','create','body','update','catch','getConfigurations','findOne','Dynamics365Configuration','order','pick','nolimit','addConfiguration','AccountId','Subjects','channel','Dynamics365Field','getFields','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridtype','owneridyominame','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','format','%s/api/data/v9.0/','POST','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','LogicalName','forEach','@odata.type','substring','lastIndexOf','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','FalseOption','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','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','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','Dynamics365Account','findAll','rows','show','params'];(function(_0x2e4426,_0x488dc1){var _0x7f6b47=function(_0x1e4967){while(--_0x1e4967){_0x2e4426['push'](_0x2e4426['shift']());}};_0x7f6b47(++_0x488dc1);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x433d65,_0x5d119b){_0x433d65=_0x433d65-0x0;var _0x24799c=_0xf9bb[_0x433d65];return _0x24799c;};'use strict';var emlformat=require(_0xbf9b('0x0'));var rimraf=require(_0xbf9b('0x1'));var zipdir=require(_0xbf9b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf9b('0x3'));var moment=require(_0xbf9b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf9b('0x5'));var path=require(_0xbf9b('0x6'));var sox=require(_0xbf9b('0x7'));var csv=require(_0xbf9b('0x8'));var ejs=require(_0xbf9b('0x9'));var fs=require('fs');var fs_extra=require(_0xbf9b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbf9b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbf9b('0xc'));var toCsv=require(_0xbf9b('0x8'));var querystring=require(_0xbf9b('0xd'));var Papa=require(_0xbf9b('0xe'));var Redis=require(_0xbf9b('0xf'));var authService=require(_0xbf9b('0x10'));var qs=require(_0xbf9b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf9b('0x12'));var logger=require(_0xbf9b('0x13'))(_0xbf9b('0x14'));var utils=require(_0xbf9b('0x15'));var config=require(_0xbf9b('0x16'));var licenseUtil=require(_0xbf9b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbf9b('0x18'));function respondWithStatusCode(_0x23143d,_0x4b03c5){_0x4b03c5=_0x4b03c5||0xcc;return function(_0x201e31){if(_0x201e31){return _0x23143d[_0xbf9b('0x19')](_0x4b03c5);}return _0x23143d[_0xbf9b('0x1a')](_0x4b03c5)[_0xbf9b('0x1b')]();};}function respondWithResult(_0x5d842d,_0x5d2631){_0x5d2631=_0x5d2631||0xc8;return function(_0x24e667){if(_0x24e667){return _0x5d842d[_0xbf9b('0x1a')](_0x5d2631)[_0xbf9b('0x1c')](_0x24e667);}};}function respondWithFilteredResult(_0x3bdb66,_0x43b4ba){return function(_0x332b36){if(_0x332b36){var _0x1ec0e=typeof _0x43b4ba['offset']===_0xbf9b('0x1d')&&typeof _0x43b4ba[_0xbf9b('0x1e')]==='undefined';var _0x15e1af=_0x332b36[_0xbf9b('0x1f')];var _0x16a2fc=_0x1ec0e?0x0:_0x43b4ba[_0xbf9b('0x20')];var _0x258365=_0x1ec0e?_0x332b36['count']:_0x43b4ba[_0xbf9b('0x20')]+_0x43b4ba[_0xbf9b('0x1e')];var _0x35d207;if(_0x258365>=_0x15e1af){_0x258365=_0x15e1af;_0x35d207=0xc8;}else{_0x35d207=0xce;}_0x3bdb66[_0xbf9b('0x1a')](_0x35d207);return _0x3bdb66[_0xbf9b('0x21')](_0xbf9b('0x22'),_0x16a2fc+'-'+_0x258365+'/'+_0x15e1af)[_0xbf9b('0x1c')](_0x332b36);}return null;};}function patchUpdates(_0x8ad239){return function(_0x35ead1){try{jsonpatch[_0xbf9b('0x23')](_0x35ead1,_0x8ad239,!![]);}catch(_0x4d9731){return BPromise[_0xbf9b('0x24')](_0x4d9731);}return _0x35ead1['save']();};}function saveUpdates(_0x4c098a,_0x38439b){return function(_0x1f5ff8){if(_0x1f5ff8){return _0x1f5ff8['update'](_0x4c098a)['then'](function(_0x483ca1){return _0x483ca1;});}return null;};}function removeEntity(_0x5331a6,_0x54d34f){return function(_0x24336c){if(_0x24336c){return _0x24336c[_0xbf9b('0x25')]()[_0xbf9b('0x26')](function(){_0x5331a6['status'](0xcc)[_0xbf9b('0x1b')]();});}};}function handleEntityNotFound(_0x1d1f04,_0xac801c){return function(_0x29504e){if(!_0x29504e){_0x1d1f04[_0xbf9b('0x19')](0x194);}return _0x29504e;};}function handleError(_0x2816a8,_0x2814e8){_0x2814e8=_0x2814e8||0x1f4;return function(_0x6eff4a){logger[_0xbf9b('0x27')](_0x6eff4a['stack']);if(_0x6eff4a[_0xbf9b('0x28')]){delete _0x6eff4a[_0xbf9b('0x28')];}_0x2816a8['status'](_0x2814e8)['send'](_0x6eff4a);};}exports[_0xbf9b('0x29')]=function(_0x3591de,_0x2b1ceb){var _0x3dc852={},_0xd833b0={},_0xb60470={'count':0x0,'rows':[]};var _0x4b3b69=_['map'](db['Dynamics365Account'][_0xbf9b('0x2a')],function(_0x231c7a){return{'name':_0x231c7a[_0xbf9b('0x2b')],'type':_0x231c7a[_0xbf9b('0x2c')][_0xbf9b('0x2d')]};});_0xd833b0[_0xbf9b('0x2e')]=_[_0xbf9b('0x2f')](_0x4b3b69,_0xbf9b('0x28'));_0xd833b0[_0xbf9b('0x30')]=_[_0xbf9b('0x31')](_0x3591de[_0xbf9b('0x30')]);_0xd833b0[_0xbf9b('0x32')]=_['intersection'](_0xd833b0[_0xbf9b('0x2e')],_0xd833b0[_0xbf9b('0x30')]);_0x3dc852[_0xbf9b('0x33')]=_[_0xbf9b('0x34')](_0xd833b0['model'],qs[_0xbf9b('0x35')](_0x3591de['query'][_0xbf9b('0x35')]));_0x3dc852['attributes']=_0x3dc852['attributes'][_0xbf9b('0x36')]?_0x3dc852[_0xbf9b('0x33')]:_0xd833b0[_0xbf9b('0x2e')];if(!_0x3591de[_0xbf9b('0x30')][_0xbf9b('0x37')]('nolimit')){_0x3dc852[_0xbf9b('0x1e')]=qs[_0xbf9b('0x1e')](_0x3591de['query'][_0xbf9b('0x1e')]);_0x3dc852['offset']=qs[_0xbf9b('0x20')](_0x3591de[_0xbf9b('0x30')][_0xbf9b('0x20')]);}_0x3dc852['order']=qs[_0xbf9b('0x38')](_0x3591de['query'][_0xbf9b('0x38')]);_0x3dc852[_0xbf9b('0x39')]=qs[_0xbf9b('0x32')](_['pick'](_0x3591de[_0xbf9b('0x30')],_0xd833b0[_0xbf9b('0x32')]),_0x4b3b69);if(_0x3591de[_0xbf9b('0x30')][_0xbf9b('0x3a')]){_0x3dc852[_0xbf9b('0x39')]=_[_0xbf9b('0x3b')](_0x3dc852[_0xbf9b('0x39')],{'$or':_[_0xbf9b('0x2f')](_0x4b3b69,function(_0x4ad928){if(_0x4ad928[_0xbf9b('0x2c')]!==_0xbf9b('0x3c')){var _0x90d3d5={};_0x90d3d5[_0x4ad928['name']]={'$like':'%'+_0x3591de[_0xbf9b('0x30')][_0xbf9b('0x3a')]+'%'};return _0x90d3d5;}})});}_0x3dc852=_[_0xbf9b('0x3b')]({},_0x3dc852,_0x3591de[_0xbf9b('0x3d')]);var _0x1646cc={'where':_0x3dc852[_0xbf9b('0x39')]};return db[_0xbf9b('0x3e')]['count'](_0x1646cc)[_0xbf9b('0x26')](function(_0x3c8cf4){_0xb60470[_0xbf9b('0x1f')]=_0x3c8cf4;if(_0x3591de[_0xbf9b('0x30')]['includeAll']){_0x3dc852['include']=[{'all':!![]}];}return db[_0xbf9b('0x3e')][_0xbf9b('0x3f')](_0x3dc852);})[_0xbf9b('0x26')](function(_0x26a976){_0xb60470[_0xbf9b('0x40')]=_0x26a976;return _0xb60470;})[_0xbf9b('0x26')](respondWithFilteredResult(_0x2b1ceb,_0x3dc852))['catch'](handleError(_0x2b1ceb,null));};exports[_0xbf9b('0x41')]=function(_0x541d43,_0x272d39){var _0x2c88be={'raw':![],'where':{'id':_0x541d43[_0xbf9b('0x42')]['id']}},_0x5e6855={};_0x5e6855[_0xbf9b('0x2e')]=_[_0xbf9b('0x31')](db[_0xbf9b('0x3e')]['rawAttributes']);_0x5e6855[_0xbf9b('0x30')]=_[_0xbf9b('0x31')](_0x541d43[_0xbf9b('0x30')]);_0x5e6855[_0xbf9b('0x32')]=_[_0xbf9b('0x34')](_0x5e6855[_0xbf9b('0x2e')],_0x5e6855[_0xbf9b('0x30')]);_0x2c88be[_0xbf9b('0x33')]=_[_0xbf9b('0x34')](_0x5e6855[_0xbf9b('0x2e')],qs['fields'](_0x541d43[_0xbf9b('0x30')]['fields']));_0x2c88be['attributes']=_0x2c88be[_0xbf9b('0x33')][_0xbf9b('0x36')]?_0x2c88be['attributes']:_0x5e6855[_0xbf9b('0x2e')];if(_0x541d43[_0xbf9b('0x30')]['includeAll']){_0x2c88be[_0xbf9b('0x43')]=[{'all':!![]}];}_0x2c88be=_[_0xbf9b('0x3b')]({},_0x2c88be,_0x541d43[_0xbf9b('0x3d')]);return db[_0xbf9b('0x3e')][_0xbf9b('0x44')](_0x2c88be)[_0xbf9b('0x26')](handleEntityNotFound(_0x272d39,null))[_0xbf9b('0x26')](respondWithResult(_0x272d39,null))['catch'](handleError(_0x272d39,null));};exports[_0xbf9b('0x45')]=function(_0x4234f5,_0x55b89d){return db[_0xbf9b('0x3e')]['create'](_0x4234f5[_0xbf9b('0x46')],{})[_0xbf9b('0x26')](respondWithResult(_0x55b89d,0xc9))['catch'](handleError(_0x55b89d,null));};exports[_0xbf9b('0x47')]=function(_0x1dc312,_0x44b9e8){if(_0x1dc312[_0xbf9b('0x46')]['id']){delete _0x1dc312[_0xbf9b('0x46')]['id'];}return db[_0xbf9b('0x3e')][_0xbf9b('0x44')]({'where':{'id':_0x1dc312[_0xbf9b('0x42')]['id']}})[_0xbf9b('0x26')](handleEntityNotFound(_0x44b9e8,null))[_0xbf9b('0x26')](saveUpdates(_0x1dc312[_0xbf9b('0x46')],null))[_0xbf9b('0x26')](respondWithResult(_0x44b9e8,null))[_0xbf9b('0x48')](handleError(_0x44b9e8,null));};exports[_0xbf9b('0x25')]=function(_0x4b48c1,_0x1cc5c4){return db[_0xbf9b('0x3e')]['find']({'where':{'id':_0x4b48c1['params']['id']}})['then'](handleEntityNotFound(_0x1cc5c4,null))[_0xbf9b('0x26')](removeEntity(_0x1cc5c4,null))[_0xbf9b('0x48')](handleError(_0x1cc5c4,null));};exports[_0xbf9b('0x49')]=function(_0x189048,_0x773687,_0x1a077b){var _0x3c193d={};var _0x1341ca={};var _0x535d8b;var _0x44a2c1;return db['Dynamics365Account'][_0xbf9b('0x4a')]({'where':{'id':_0x189048['params']['id']}})[_0xbf9b('0x26')](handleEntityNotFound(_0x773687,null))['then'](function(_0x4674d6){if(_0x4674d6){_0x535d8b=_0x4674d6;_0x1341ca[_0xbf9b('0x2e')]=_[_0xbf9b('0x31')](db[_0xbf9b('0x4b')][_0xbf9b('0x2a')]);_0x1341ca[_0xbf9b('0x30')]=_[_0xbf9b('0x31')](_0x189048[_0xbf9b('0x30')]);_0x1341ca[_0xbf9b('0x32')]=_[_0xbf9b('0x34')](_0x1341ca[_0xbf9b('0x2e')],_0x1341ca[_0xbf9b('0x30')]);_0x3c193d[_0xbf9b('0x33')]=_[_0xbf9b('0x34')](_0x1341ca['model'],qs[_0xbf9b('0x35')](_0x189048['query'][_0xbf9b('0x35')]));_0x3c193d[_0xbf9b('0x33')]=_0x3c193d[_0xbf9b('0x33')][_0xbf9b('0x36')]?_0x3c193d[_0xbf9b('0x33')]:_0x1341ca[_0xbf9b('0x2e')];_0x3c193d[_0xbf9b('0x4c')]=qs[_0xbf9b('0x38')](_0x189048[_0xbf9b('0x30')][_0xbf9b('0x38')]);_0x3c193d['where']=qs['filters'](_[_0xbf9b('0x4d')](_0x189048['query'],_0x1341ca[_0xbf9b('0x32')]));if(_0x189048[_0xbf9b('0x30')][_0xbf9b('0x3a')]){_0x3c193d[_0xbf9b('0x39')]=_[_0xbf9b('0x3b')](_0x3c193d[_0xbf9b('0x39')],{'$or':_[_0xbf9b('0x2f')](_0x3c193d[_0xbf9b('0x33')],function(_0x3fda31){var _0x580c5b={};_0x580c5b[_0x3fda31]={'$like':'%'+_0x189048[_0xbf9b('0x30')][_0xbf9b('0x3a')]+'%'};return _0x580c5b;})});}_0x3c193d=_[_0xbf9b('0x3b')]({},_0x3c193d,_0x189048[_0xbf9b('0x3d')]);return _0x535d8b[_0xbf9b('0x49')](_0x3c193d);}})[_0xbf9b('0x26')](function(_0x5a07fb){if(_0x5a07fb){_0x44a2c1=_0x5a07fb[_0xbf9b('0x36')];if(!_0x189048[_0xbf9b('0x30')][_0xbf9b('0x37')](_0xbf9b('0x4e'))){_0x3c193d[_0xbf9b('0x1e')]=qs['limit'](_0x189048['query'][_0xbf9b('0x1e')]);_0x3c193d['offset']=qs[_0xbf9b('0x20')](_0x189048[_0xbf9b('0x30')][_0xbf9b('0x20')]);}return _0x535d8b['getConfigurations'](_0x3c193d);}})['then'](function(_0x120335){if(_0x120335){return _0x120335?{'count':_0x44a2c1,'rows':_0x120335}:null;}})[_0xbf9b('0x26')](respondWithResult(_0x773687,null))[_0xbf9b('0x48')](handleError(_0x773687,null));};exports[_0xbf9b('0x4f')]=function(_0x5a40f9,_0x48fc0d,_0x1492b2){if(_0x5a40f9[_0xbf9b('0x46')]['id']){delete _0x5a40f9[_0xbf9b('0x46')]['id'];}return db[_0xbf9b('0x3e')][_0xbf9b('0x4a')]({'where':{'id':_0x5a40f9[_0xbf9b('0x42')]['id']}})[_0xbf9b('0x26')](handleEntityNotFound(_0x48fc0d,null))[_0xbf9b('0x26')](function(_0x3815e0){if(_0x3815e0){_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x50')]=_0x3815e0['id'];_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x51')]=integrations['getSubjects'](_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x52')],_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x2c')]);_0x5a40f9[_0xbf9b('0x46')]['Descriptions']=integrations['getDescriptions'](_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x52')],_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x2c')]);return db[_0xbf9b('0x4b')]['create'](_0x5a40f9[_0xbf9b('0x46')],{'include':[{'model':db[_0xbf9b('0x53')],'as':_0xbf9b('0x51')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xbf9b('0x26')](respondWithResult(_0x48fc0d,null))['catch'](handleError(_0x48fc0d,null));};exports[_0xbf9b('0x54')]=function(_0x692fa4,_0x9ac30b,_0x4364ee){var _0xb1d5e4=_0x692fa4[_0xbf9b('0x30')]['ticketType'];var _0x4d6544=_0xb1d5e4===_0xbf9b('0x55')?_0xbf9b('0x56'):_0xbf9b('0x57');var _0x950f56='';var _0x3b8fc9='';var _0x5f1ff5='';var _0x332e4e='';var _0x220e54='';var _0x2d5c13='';var _0x4318b4='';var _0x413b35='';var _0x11a9e6=['title',_0xbf9b('0x58'),_0xbf9b('0x59'),_0xbf9b('0x5a'),_0xbf9b('0x5b'),_0xbf9b('0x5c'),_0xbf9b('0x5d'),'regardingobjectid',_0xbf9b('0x5e'),_0xbf9b('0x5f')];var _0x49470d=['accountidname',_0xbf9b('0x60'),_0xbf9b('0x61'),'billedserviceunits','contactidname',_0xbf9b('0x62'),'contractdetailidname',_0xbf9b('0x63'),_0xbf9b('0x64'),_0xbf9b('0x65'),_0xbf9b('0x66'),_0xbf9b('0x67'),_0xbf9b('0x68'),'createdonbehalfbyname','createdonbehalfbyyominame',_0xbf9b('0x69'),_0xbf9b('0x6a'),_0xbf9b('0x6b'),_0xbf9b('0x6c'),_0xbf9b('0x6d'),_0xbf9b('0x6e'),_0xbf9b('0x6f'),_0xbf9b('0x70'),_0xbf9b('0x71'),_0xbf9b('0x72'),'followupby',_0xbf9b('0x73'),'influencescore',_0xbf9b('0x74'),_0xbf9b('0x75'),_0xbf9b('0x76'),_0xbf9b('0x77'),'modifiedbyexternalpartyyominame',_0xbf9b('0x78'),_0xbf9b('0x79'),_0xbf9b('0x7a'),_0xbf9b('0x7b'),_0xbf9b('0x7c'),_0xbf9b('0x7d'),_0xbf9b('0x7e'),_0xbf9b('0x7f'),_0xbf9b('0x80'),'overriddencreatedon','owneridname',_0xbf9b('0x81'),_0xbf9b('0x82'),'parentcaseidname',_0xbf9b('0x83'),'primarycontactidyominame',_0xbf9b('0x84'),_0xbf9b('0x85'),_0xbf9b('0x86'),_0xbf9b('0x87'),'resolvebykpiidname',_0xbf9b('0x88'),_0xbf9b('0x89'),_0xbf9b('0x8a'),_0xbf9b('0x8b'),'slainvokedidname',_0xbf9b('0x8c'),'socialprofileidname',_0xbf9b('0x8d'),'statuscode',_0xbf9b('0x8e'),_0xbf9b('0x8f'),'timezoneruleversionnumber',_0xbf9b('0x90'),_0xbf9b('0x91'),'utcconversiontimezonecode',_0xbf9b('0x92')];var _0x14be1f=_0x11a9e6[_0xbf9b('0x93')](_0x49470d);return db[_0xbf9b('0x3e')]['findOne']({'where':{'id':_0x692fa4[_0xbf9b('0x42')]['id']},'attributes':['id','username',_0xbf9b('0x94'),_0xbf9b('0x95'),_0xbf9b('0x96'),_0xbf9b('0x97'),_0xbf9b('0x98')]})[_0xbf9b('0x26')](handleEntityNotFound(_0x9ac30b,null))[_0xbf9b('0x26')](function(_0x4a8314){if(_0x4a8314){_0x413b35=_0x4a8314['remoteUri'];var _0xbd521=_0x413b35[_0xbf9b('0x99')](-0x1);if(_0xbd521==='/'){_0x413b35=_0x413b35['substring'](0x0,_0x413b35['lastIndexOf'](_0xbd521));}_0x4318b4=util[_0xbf9b('0x9a')](_0xbf9b('0x9b'),_0x413b35);var _0x13ae45={'method':_0xbf9b('0x9c'),'uri':'https://login.microsoftonline.com/'+_0x4a8314[_0xbf9b('0x96')]+_0xbf9b('0x9d'),'form':{'client_id':_0x4a8314[_0xbf9b('0x97')],'resource':_0x413b35,'username':_0x4a8314['username'],'password':_0x4a8314[_0xbf9b('0x94')],'grant_type':'password','client_secret':_0x4a8314[_0xbf9b('0x98')]},'json':!![]};return rp(_0x13ae45);}})[_0xbf9b('0x26')](function(_0xc5c6fb){_0x2d5c13=_0xc5c6fb[_0xbf9b('0x9e')];var _0x7b67e1={'method':'GET','uri':encodeURI(_0x4318b4+_0xbf9b('0x9f')+_0x4d6544+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x2d5c13,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0x7b67e1);})[_0xbf9b('0x26')](function(_0x5c0fdc){var _0x20836a=_0x5c0fdc[_0xbf9b('0xa1')][0x0];var _0x423f9d=_0x20836a[_0xbf9b('0xa2')];var _0xc51fe={'method':_0xbf9b('0xa3'),'uri':_0x4318b4+'EntityDefinitions('+_0x423f9d+_0xbf9b('0xa4'),'headers':{'Authorization':_0xbf9b('0xa5')+_0x2d5c13,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0xc51fe);})[_0xbf9b('0x26')](function(_0x268173){_0x950f56=_0x268173;_0x3b8fc9=_0x950f56[_0xbf9b('0xa6')];_0x3b8fc9=_[_0xbf9b('0xa7')](_0x3b8fc9,function(_0x174629){return!_0x14be1f['includes'](_0x174629[_0xbf9b('0xa8')]);});var _0x3b51bd=[];var _0x1d9414=[];_0x3b8fc9[_0xbf9b('0xa9')](function(_0x1ad2b7){if(_0x1ad2b7[_0xbf9b('0xaa')]){var _0x5da61d=_0x1ad2b7['@odata.type'][_0xbf9b('0xab')](_0x1ad2b7[_0xbf9b('0xaa')][_0xbf9b('0xac')]('.')+0x1);if(_0x5da61d==='PicklistAttributeMetadata'){_0x3b51bd[_0xbf9b('0xad')](getSelectList(_0x4318b4,_0xb1d5e4,_0x1d9414,_0x950f56[_0xbf9b('0xa2')],_0x1ad2b7[_0xbf9b('0xa2')],_0x2d5c13));}}});return Promise[_0xbf9b('0xae')](_0x3b51bd);})[_0xbf9b('0x26')](function(_0x48f7e6){_0x5f1ff5=_0x48f7e6[0x0];var _0x535088=[];var _0x2ea636=[];_0x3b8fc9['forEach'](function(_0xc8e137){if(!_[_0xbf9b('0xaf')](_0xc8e137[_0xbf9b('0xaa')])){var _0x30ca98=_0xc8e137['@odata.type'][_0xbf9b('0xab')](_0xc8e137['@odata.type']['lastIndexOf']('.')+0x1);if(_0x30ca98===_0xbf9b('0xb0')){_0x535088[_0xbf9b('0xad')](getBooleanList(_0x4318b4,_0xb1d5e4,_0x2ea636,_0x950f56[_0xbf9b('0xa2')],_0xc8e137['MetadataId'],_0x2d5c13));}}});return Promise[_0xbf9b('0xae')](_0x535088);})['then'](function(_0x3a7b8c){_0x332e4e=_0x3a7b8c[0x0];var _0x4de5e8=[];var _0x1ae901=[];_0x3b8fc9[_0xbf9b('0xa9')](function(_0x4637d2){if(_0x4637d2['@odata.type']){var _0x1f490e=_0x4637d2[_0xbf9b('0xaa')][_0xbf9b('0xab')](_0x4637d2[_0xbf9b('0xaa')][_0xbf9b('0xac')]('.')+0x1);if(_0x1f490e===_0xbf9b('0xb1')||_0x1f490e===_0xbf9b('0xb2')||_0x1f490e==='BigIntAttributeMetadata'||_0x1f490e==='IntegerAttributeMetadata'||_0x1f490e===_0xbf9b('0xb3')||_0x1f490e==='DateTimeAttributeMetadata'||_0x1f490e===_0xbf9b('0xb4')||_0x1f490e===_0xbf9b('0xb5')||_0x1f490e===_0xbf9b('0xb6')||_0x1f490e===_0xbf9b('0xb7')){_0x4de5e8['push'](getInputList(_0x4318b4,_0xb1d5e4,_0x1f490e,_0x1ae901,_0x950f56[_0xbf9b('0xa2')],_0x4637d2[_0xbf9b('0xa2')],_0x2d5c13));}}});return Promise['all'](_0x4de5e8);})[_0xbf9b('0x26')](function(_0x591096){_0x220e54=_0x591096[0x0];var _0x27e01f=_0x5f1ff5[_0xbf9b('0x93')](_0x332e4e)[_0xbf9b('0x93')](_0x220e54);var _0x46925f={'count':_0x27e01f[_0xbf9b('0x36')],'rows':_0x27e01f};return _0x46925f;})['then'](respondWithResult(_0x9ac30b,null))[_0xbf9b('0x48')](function(_0xd34010){var _0xce7104=_0x692fa4[_0xbf9b('0x30')][_0xbf9b('0xb8')]?0x1f4:_0xd34010[_0xbf9b('0xb9')]||0x1f4;logger[_0xbf9b('0x27')](_0xd34010[_0xbf9b('0xba')]);delete _0xd34010['name'];if(_0xce7104===0x191){_0xce7104=0x190;}_0x9ac30b[_0xbf9b('0x1a')](_0xce7104)[_0xbf9b('0xbb')](_0x692fa4[_0xbf9b('0x30')][_0xbf9b('0xb8')]?{'message':_0xbf9b('0xbc'),'statusCode':_0xd34010[_0xbf9b('0xb9')]}:_0xd34010);});};function getSelectList(_0x45626c,_0x19be46,_0x24ae9f,_0x42f240,_0x3dc46d,_0x1de63c){var _0xcdfd05={'method':_0xbf9b('0xa3'),'uri':_0x45626c+'EntityDefinitions('+_0x42f240+_0xbf9b('0xbd')+_0x3dc46d+_0xbf9b('0xbe')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x1de63c,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0xcdfd05)[_0xbf9b('0x26')](function(_0x8a1b63){var _0x3cce4d=[];var _0x40718e=_0x8a1b63['OptionSet'][_0xbf9b('0xbf')];_0x40718e['forEach'](function(_0x4ac287){_0x3cce4d[_0xbf9b('0xad')]({'name':_0x4ac287[_0xbf9b('0xc0')][_0xbf9b('0xc1')][_0xbf9b('0xc0')],'value':String(_0x4ac287[_0xbf9b('0xc2')])});});var _0x1d46a2={'id':_0x19be46+'_'+_0x8a1b63[_0xbf9b('0xa8')],'name':_0x8a1b63[_0xbf9b('0xc3')]['UserLocalizedLabel'][_0xbf9b('0xc0')],'custom':![],'options':_0x3cce4d};_0x24ae9f[_0xbf9b('0xad')](_0x1d46a2);return _0x24ae9f;});}function getBooleanList(_0x3b8cb3,_0x499989,_0x8d139c,_0x5d7b9b,_0x5ac6dd,_0x102ff8){var _0x260956={'method':_0xbf9b('0xa3'),'uri':_0x3b8cb3+_0xbf9b('0xc4')+_0x5d7b9b+_0xbf9b('0xbd')+_0x5ac6dd+_0xbf9b('0xc5'),'headers':{'Authorization':_0xbf9b('0xa5')+_0x102ff8,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0x260956)['then'](function(_0x3e7026){var _0x75f582=[];_0x75f582[_0xbf9b('0xad')]({'name':_0x3e7026[_0xbf9b('0xc6')]['TrueOption'][_0xbf9b('0xc0')][_0xbf9b('0xc1')]['Label'],'value':'true'},{'name':_0x3e7026['OptionSet'][_0xbf9b('0xc7')]['Label'][_0xbf9b('0xc1')][_0xbf9b('0xc0')],'value':'false'});var _0x5919c6={'id':_0x499989+'_'+_0x3e7026[_0xbf9b('0xa8')],'name':_0x3e7026[_0xbf9b('0xc3')][_0xbf9b('0xc1')][_0xbf9b('0xc0')],'custom':![],'options':_0x75f582};_0x8d139c[_0xbf9b('0xad')](_0x5919c6);return _0x8d139c;});}function getInputList(_0x496a85,_0x5eceac,_0x429a17,_0x9615ea,_0x3212e8,_0x3f3bcd,_0x390449){var _0x5a5bbe={'method':_0xbf9b('0xa3'),'uri':_0x496a85+_0xbf9b('0xc4')+_0x3212e8+_0xbf9b('0xbd')+_0x3f3bcd+')/Microsoft.Dynamics.CRM.'+_0x429a17+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xbf9b('0xa5')+_0x390449,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0x5a5bbe)[_0xbf9b('0x26')](function(_0x214eab){var _0x50ff77={'id':_0x5eceac+'_'+_0x214eab['LogicalName'],'name':_0x214eab['DisplayName'][_0xbf9b('0xc1')]?_0x214eab[_0xbf9b('0xc3')][_0xbf9b('0xc1')][_0xbf9b('0xc0')]:_0x214eab[_0xbf9b('0xa8')],'custom':![],'options':[]};_0x9615ea[_0xbf9b('0xad')](_0x50ff77);return _0x9615ea;});}
\ No newline at end of file
index 16f1b9f..0bcb9cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x12b72b,_0x5a6718){var _0x35b7cf=function(_0x482fe0){while(--_0x482fe0){_0x12b72b['push'](_0x12b72b['shift']());}};_0x35b7cf(++_0x5a6718);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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 4d3d1b2..afa2d14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf395=['raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','attributes','limit','include','map','model','ShowDynamics365Account','find'];(function(_0x563ca1,_0x32308a){var _0x50ad4e=function(_0x2caa92){while(--_0x2caa92){_0x563ca1['push'](_0x563ca1['shift']());}};_0x50ad4e(++_0x32308a);}(_0xf395,0x104));var _0x5f39=function(_0x1f5d42,_0x1c5ece){_0x1f5d42=_0x1f5d42-0x0;var _0x1f9ebb=_0xf395[_0x1f5d42];return _0x1f9ebb;};'use strict';var _=require(_0x5f39('0x0'));var util=require(_0x5f39('0x1'));var moment=require(_0x5f39('0x2'));var BPromise=require(_0x5f39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f39('0x4'));var db=require(_0x5f39('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f39('0x6'))(_0x5f39('0x7'));var config=require(_0x5f39('0x8'));var jayson=require(_0x5f39('0x9'));var client=jayson[_0x5f39('0xa')][_0x5f39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37a67c,_0x44d5d2,_0x5564f8){return new BPromise(function(_0x2f0c54,_0x458488){return client[_0x5f39('0xc')](_0x37a67c,_0x5564f8)[_0x5f39('0xd')](function(_0x1cedf0){logger[_0x5f39('0xe')](_0x5f39('0xf'),_0x44d5d2,'request\x20sent');logger[_0x5f39('0x10')](_0x5f39('0x11'),_0x44d5d2,_0x5f39('0x12'),JSON[_0x5f39('0x13')](_0x1cedf0));if(_0x1cedf0[_0x5f39('0x14')]){if(_0x1cedf0[_0x5f39('0x14')][_0x5f39('0x15')]===0x1f4){logger[_0x5f39('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x44d5d2,_0x1cedf0[_0x5f39('0x14')][_0x5f39('0x16')]);return _0x458488(_0x1cedf0[_0x5f39('0x14')][_0x5f39('0x16')]);}logger[_0x5f39('0x14')](_0x5f39('0xf'),_0x44d5d2,_0x1cedf0[_0x5f39('0x14')]['message']);return _0x2f0c54(_0x1cedf0[_0x5f39('0x14')][_0x5f39('0x16')]);}else{logger[_0x5f39('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x44d5d2,_0x5f39('0x12'));_0x2f0c54(_0x1cedf0[_0x5f39('0x17')][_0x5f39('0x16')]);}})[_0x5f39('0x18')](function(_0x5dcaaa){logger[_0x5f39('0x14')](_0x5f39('0xf'),_0x44d5d2,_0x5dcaaa);_0x458488(_0x5dcaaa);});});}exports[_0x5f39('0x19')]=function(_0x3fa5b7){var _0x4ad6f9=this;return new Promise(function(_0x4fe5e0,_0x40c93e){return db[_0x5f39('0x1a')][_0x5f39('0x1b')]({'raw':_0x3fa5b7[_0x5f39('0x1c')]?_0x3fa5b7['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fa5b7[_0x5f39('0x1c')]?_0x3fa5b7['options']['where']||null:null,'attributes':_0x3fa5b7[_0x5f39('0x1c')]?_0x3fa5b7[_0x5f39('0x1c')][_0x5f39('0x1d')]||null:null,'limit':_0x3fa5b7[_0x5f39('0x1c')]?_0x3fa5b7[_0x5f39('0x1c')][_0x5f39('0x1e')]||null:null,'include':_0x3fa5b7[_0x5f39('0x1c')]?_0x3fa5b7['options'][_0x5f39('0x1f')]?_[_0x5f39('0x20')](_0x3fa5b7[_0x5f39('0x1c')][_0x5f39('0x1f')],function(_0x59a809){return{'model':db[_0x59a809[_0x5f39('0x21')]],'as':_0x59a809['as'],'attributes':_0x59a809[_0x5f39('0x1d')],'include':_0x59a809[_0x5f39('0x1f')]?_['map'](_0x59a809[_0x5f39('0x1f')],function(_0x2ebdda){return{'model':db[_0x2ebdda[_0x5f39('0x21')]],'as':_0x2ebdda['as'],'attributes':_0x2ebdda[_0x5f39('0x1d')],'include':_0x2ebdda[_0x5f39('0x1f')]?_[_0x5f39('0x20')](_0x2ebdda['include'],function(_0x2b012a){return{'model':db[_0x2b012a[_0x5f39('0x21')]],'as':_0x2b012a['as'],'attributes':_0x2b012a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x9fc0a3){logger[_0x5f39('0xe')](_0x5f39('0x19'),_0x3fa5b7);logger['debug'](_0x5f39('0x19'),_0x3fa5b7,JSON[_0x5f39('0x13')](_0x9fc0a3));_0x4fe5e0(_0x9fc0a3);})[_0x5f39('0x18')](function(_0x22aa5e){logger['error'](_0x5f39('0x19'),_0x22aa5e[_0x5f39('0x16')],_0x3fa5b7);_0x40c93e(_0x4ad6f9[_0x5f39('0x14')](0x1f4,_0x22aa5e[_0x5f39('0x16')]));});});};exports[_0x5f39('0x22')]=function(_0x3d4e7c){var _0x1ff188=this;return new Promise(function(_0x20f0bd,_0x1def92){return db[_0x5f39('0x1a')][_0x5f39('0x23')]({'raw':_0x3d4e7c[_0x5f39('0x1c')]?_0x3d4e7c[_0x5f39('0x1c')][_0x5f39('0x24')]===undefined?!![]:![]:!![],'where':_0x3d4e7c[_0x5f39('0x1c')]?_0x3d4e7c[_0x5f39('0x1c')]['where']||null:null,'attributes':_0x3d4e7c['options']?_0x3d4e7c[_0x5f39('0x1c')][_0x5f39('0x1d')]||null:null,'include':_0x3d4e7c[_0x5f39('0x1c')]?_0x3d4e7c[_0x5f39('0x1c')]['include']?_[_0x5f39('0x20')](_0x3d4e7c[_0x5f39('0x1c')]['include'],function(_0x3a03f4){return{'model':db[_0x3a03f4['model']],'as':_0x3a03f4['as'],'attributes':_0x3a03f4[_0x5f39('0x1d')],'include':_0x3a03f4[_0x5f39('0x1f')]?_[_0x5f39('0x20')](_0x3a03f4['include'],function(_0x13e6a7){return{'model':db[_0x13e6a7[_0x5f39('0x21')]],'as':_0x13e6a7['as'],'attributes':_0x13e6a7[_0x5f39('0x1d')],'include':_0x13e6a7[_0x5f39('0x1f')]?_[_0x5f39('0x20')](_0x13e6a7['include'],function(_0x4cdeb2){return{'model':db[_0x4cdeb2[_0x5f39('0x21')]],'as':_0x4cdeb2['as'],'attributes':_0x4cdeb2[_0x5f39('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5f39('0xd')](function(_0x4bd231){logger[_0x5f39('0xe')](_0x5f39('0x22'),_0x3d4e7c);logger['debug'](_0x5f39('0x22'),_0x3d4e7c,JSON[_0x5f39('0x13')](_0x4bd231));_0x20f0bd(_0x4bd231);})[_0x5f39('0x18')](function(_0x417eb9){logger[_0x5f39('0x14')](_0x5f39('0x22'),_0x417eb9['message'],_0x3d4e7c);_0x1def92(_0x1ff188[_0x5f39('0x14')](0x1f4,_0x417eb9[_0x5f39('0x16')]));});});};
\ No newline at end of file
+var _0xc8a5=['request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','attributes','limit','include','map','model','ShowDynamics365Account','Dynamics365Account','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4966ce,_0x2c5c80){var _0x4426aa=function(_0x48560a){while(--_0x48560a){_0x4966ce['push'](_0x4966ce['shift']());}};_0x4426aa(++_0x2c5c80);}(_0xc8a5,0x1f3));var _0x5c8a=function(_0x251acf,_0x3aa907){_0x251acf=_0x251acf-0x0;var _0x2d9fcd=_0xc8a5[_0x251acf];return _0x2d9fcd;};'use strict';var _=require('lodash');var util=require(_0x5c8a('0x0'));var moment=require(_0x5c8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x5c8a('0x2'));var fs=require('fs');var Redis=require(_0x5c8a('0x3'));var db=require(_0x5c8a('0x4'))['db'];var utils=require(_0x5c8a('0x5'));var logger=require(_0x5c8a('0x6'))('rpc');var config=require(_0x5c8a('0x7'));var jayson=require(_0x5c8a('0x8'));var client=jayson[_0x5c8a('0x9')][_0x5c8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d5b68,_0x50c706,_0x487792){return new BPromise(function(_0xc143db,_0x2a3939){return client[_0x5c8a('0xb')](_0x1d5b68,_0x487792)[_0x5c8a('0xc')](function(_0x10d293){logger[_0x5c8a('0xd')](_0x5c8a('0xe'),_0x50c706,_0x5c8a('0xf'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x50c706,_0x5c8a('0xf'),JSON[_0x5c8a('0x10')](_0x10d293));if(_0x10d293[_0x5c8a('0x11')]){if(_0x10d293[_0x5c8a('0x11')][_0x5c8a('0x12')]===0x1f4){logger[_0x5c8a('0x11')](_0x5c8a('0xe'),_0x50c706,_0x10d293['error'][_0x5c8a('0x13')]);return _0x2a3939(_0x10d293[_0x5c8a('0x11')]['message']);}logger[_0x5c8a('0x11')](_0x5c8a('0xe'),_0x50c706,_0x10d293[_0x5c8a('0x11')][_0x5c8a('0x13')]);return _0xc143db(_0x10d293[_0x5c8a('0x11')]['message']);}else{logger['info'](_0x5c8a('0xe'),_0x50c706,_0x5c8a('0xf'));_0xc143db(_0x10d293[_0x5c8a('0x14')][_0x5c8a('0x13')]);}})[_0x5c8a('0x15')](function(_0x5e45da){logger[_0x5c8a('0x11')](_0x5c8a('0xe'),_0x50c706,_0x5e45da);_0x2a3939(_0x5e45da);});});}exports[_0x5c8a('0x16')]=function(_0x20990b){var _0x504cdb=this;return new Promise(function(_0x48bde1,_0x1d553e){return db['Dynamics365Account'][_0x5c8a('0x17')]({'raw':_0x20990b[_0x5c8a('0x18')]?_0x20990b['options'][_0x5c8a('0x19')]===undefined?!![]:![]:!![],'where':_0x20990b[_0x5c8a('0x18')]?_0x20990b['options']['where']||null:null,'attributes':_0x20990b[_0x5c8a('0x18')]?_0x20990b[_0x5c8a('0x18')][_0x5c8a('0x1a')]||null:null,'limit':_0x20990b[_0x5c8a('0x18')]?_0x20990b[_0x5c8a('0x18')][_0x5c8a('0x1b')]||null:null,'include':_0x20990b[_0x5c8a('0x18')]?_0x20990b['options'][_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x20990b['options'][_0x5c8a('0x1c')],function(_0x3a3b87){return{'model':db[_0x3a3b87[_0x5c8a('0x1e')]],'as':_0x3a3b87['as'],'attributes':_0x3a3b87['attributes'],'include':_0x3a3b87[_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x3a3b87[_0x5c8a('0x1c')],function(_0x353d91){return{'model':db[_0x353d91[_0x5c8a('0x1e')]],'as':_0x353d91['as'],'attributes':_0x353d91[_0x5c8a('0x1a')],'include':_0x353d91['include']?_[_0x5c8a('0x1d')](_0x353d91['include'],function(_0x223f7d){return{'model':db[_0x223f7d['model']],'as':_0x223f7d['as'],'attributes':_0x223f7d[_0x5c8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5c8a('0xc')](function(_0x511c65){logger['info'](_0x5c8a('0x16'),_0x20990b);logger['debug']('GetDynamics365Account',_0x20990b,JSON[_0x5c8a('0x10')](_0x511c65));_0x48bde1(_0x511c65);})['catch'](function(_0x243be3){logger['error'](_0x5c8a('0x16'),_0x243be3['message'],_0x20990b);_0x1d553e(_0x504cdb[_0x5c8a('0x11')](0x1f4,_0x243be3[_0x5c8a('0x13')]));});});};exports[_0x5c8a('0x1f')]=function(_0x153406){var _0x2ada8b=this;return new Promise(function(_0x58c21f,_0x2a2fcd){return db[_0x5c8a('0x20')][_0x5c8a('0x21')]({'raw':_0x153406[_0x5c8a('0x18')]?_0x153406['options'][_0x5c8a('0x19')]===undefined?!![]:![]:!![],'where':_0x153406['options']?_0x153406[_0x5c8a('0x18')]['where']||null:null,'attributes':_0x153406[_0x5c8a('0x18')]?_0x153406['options']['attributes']||null:null,'include':_0x153406[_0x5c8a('0x18')]?_0x153406[_0x5c8a('0x18')][_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x153406[_0x5c8a('0x18')]['include'],function(_0x362502){return{'model':db[_0x362502[_0x5c8a('0x1e')]],'as':_0x362502['as'],'attributes':_0x362502[_0x5c8a('0x1a')],'include':_0x362502[_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x362502[_0x5c8a('0x1c')],function(_0x1f9a97){return{'model':db[_0x1f9a97[_0x5c8a('0x1e')]],'as':_0x1f9a97['as'],'attributes':_0x1f9a97[_0x5c8a('0x1a')],'include':_0x1f9a97[_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x1f9a97[_0x5c8a('0x1c')],function(_0x84674){return{'model':db[_0x84674[_0x5c8a('0x1e')]],'as':_0x84674['as'],'attributes':_0x84674['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x181200){logger[_0x5c8a('0xd')]('ShowDynamics365Account',_0x153406);logger['debug'](_0x5c8a('0x1f'),_0x153406,JSON['stringify'](_0x181200));_0x58c21f(_0x181200);})['catch'](function(_0x10d08a){logger[_0x5c8a('0x11')]('ShowDynamics365Account',_0x10d08a[_0x5c8a('0x13')],_0x153406);_0x2a2fcd(_0x2ada8b[_0x5c8a('0x11')](0x1f4,_0x10d08a[_0x5c8a('0x13')]));});});};
\ No newline at end of file
index b133d86..3f4ba11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9782=['create','/:id','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0xe464ba,_0xabcafa){var _0x5968d6=function(_0x504b7f){while(--_0x504b7f){_0xe464ba['push'](_0xe464ba['shift']());}};_0x5968d6(++_0xabcafa);}(_0x9782,0xf6));var _0x2978=function(_0x3fe280,_0x1d8260){_0x3fe280=_0x3fe280-0x0;var _0x2e833f=_0x9782[_0x3fe280];return _0x2e833f;};'use strict';var multer=require(_0x2978('0x0'));var util=require(_0x2978('0x1'));var path=require('path');var timeout=require(_0x2978('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2978('0x3'));var auth=require(_0x2978('0x4'));var interaction=require(_0x2978('0x5'));var config=require(_0x2978('0x6'));var controller=require(_0x2978('0x7'));router[_0x2978('0x8')]('/',auth[_0x2978('0x9')](),controller['index']);router[_0x2978('0x8')]('/:id',auth[_0x2978('0x9')](),controller[_0x2978('0xa')]);router[_0x2978('0x8')](_0x2978('0xb'),auth[_0x2978('0x9')](),controller[_0x2978('0xc')]);router[_0x2978('0x8')](_0x2978('0xd'),auth['isAuthenticated'](),controller[_0x2978('0xe')]);router[_0x2978('0x8')](_0x2978('0xf'),auth[_0x2978('0x9')](),controller[_0x2978('0x10')]);router[_0x2978('0x11')]('/',auth[_0x2978('0x9')](),controller[_0x2978('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2978('0x13'),auth[_0x2978('0x9')](),controller[_0x2978('0x14')]);module[_0x2978('0x15')]=router;
\ No newline at end of file
+var _0x6447=['exports','util','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','post','put','update','delete','destroy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6447,0xb5));var _0x7644=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x6447[_0x5e4563];return _0x8d1bf5;};'use strict';var multer=require('multer');var util=require(_0x7644('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7644('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7644('0x2'));var interaction=require(_0x7644('0x3'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x7644('0x4')]('/',auth[_0x7644('0x5')](),controller[_0x7644('0x6')]);router[_0x7644('0x4')](_0x7644('0x7'),auth[_0x7644('0x5')](),controller[_0x7644('0x8')]);router['get'](_0x7644('0x9'),auth[_0x7644('0x5')](),controller['getFields']);router['get'](_0x7644('0xa'),auth[_0x7644('0x5')](),controller[_0x7644('0xb')]);router[_0x7644('0x4')]('/:id/descriptions',auth[_0x7644('0x5')](),controller['getDescriptions']);router[_0x7644('0xc')]('/',auth[_0x7644('0x5')](),controller['create']);router[_0x7644('0xd')](_0x7644('0x7'),auth[_0x7644('0x5')](),controller[_0x7644('0xe')]);router[_0x7644('0xf')](_0x7644('0x7'),auth[_0x7644('0x5')](),controller[_0x7644('0x10')]);module[_0x7644('0x11')]=router;
\ No newline at end of file
index e1d67a5..4fd6d3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71b0=['phonecall','sequelize','exports','ENUM','incident'];(function(_0x2ec344,_0x133bcc){var _0x3ddebf=function(_0x5c1a9e){while(--_0x5c1a9e){_0x2ec344['push'](_0x2ec344['shift']());}};_0x3ddebf(++_0x133bcc);}(_0x71b0,0x1af));var _0x071b=function(_0x151a17,_0x564ef3){_0x151a17=_0x151a17-0x0;var _0x4fee68=_0x71b0[_0x151a17];return _0x4fee68;};'use strict';var Sequelize=require(_0x071b('0x0'));module[_0x071b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x071b('0x2')](_0x071b('0x3'),_0x071b('0x4')),'defaultValue':'incident'}};
\ No newline at end of file
+var _0xd9d7=['phonecall','incident','sequelize','exports','STRING','ENUM'];(function(_0x2d1c98,_0x3a2c95){var _0x4063ae=function(_0x2e16b5){while(--_0x2e16b5){_0x2d1c98['push'](_0x2d1c98['shift']());}};_0x4063ae(++_0x3a2c95);}(_0xd9d7,0x68));var _0x7d9d=function(_0x49f8c2,_0x5166b7){_0x49f8c2=_0x49f8c2-0x0;var _0x3e63ec=_0xd9d7[_0x49f8c2];return _0x3e63ec;};'use strict';var Sequelize=require(_0x7d9d('0x0'));module[_0x7d9d('0x1')]={'name':{'type':Sequelize[_0x7d9d('0x2')]},'description':{'type':Sequelize[_0x7d9d('0x2')]},'ticketType':{'type':Sequelize[_0x7d9d('0x3')]('incident',_0x7d9d('0x4')),'defaultValue':_0x7d9d('0x5')}};
\ No newline at end of file
index 510e4bd..3b95f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1100=['update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','Dynamics365Configuration','then','includeAll','findAll','rows','catch','show','params','include','merge','options','create','body','find','findOne','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x56c817,_0x4c6bf2){var _0x18223f=function(_0x197fb5){while(--_0x197fb5){_0x56c817['push'](_0x56c817['shift']());}};_0x18223f(++_0x4c6bf2);}(_0x1100,0xc9));var _0x0110=function(_0x1a7d28,_0x17f1d5){_0x1a7d28=_0x1a7d28-0x0;var _0x31034b=_0x1100[_0x1a7d28];return _0x31034b;};'use strict';var emlformat=require(_0x0110('0x0'));var rimraf=require(_0x0110('0x1'));var zipdir=require(_0x0110('0x2'));var jsonpatch=require(_0x0110('0x3'));var rp=require('request-promise');var moment=require(_0x0110('0x4'));var BPromise=require(_0x0110('0x5'));var Mustache=require(_0x0110('0x6'));var util=require('util');var path=require(_0x0110('0x7'));var sox=require(_0x0110('0x8'));var csv=require('to-csv');var ejs=require(_0x0110('0x9'));var fs=require('fs');var fs_extra=require(_0x0110('0xa'));var _=require('lodash');var squel=require(_0x0110('0xb'));var crypto=require(_0x0110('0xc'));var jsforce=require(_0x0110('0xd'));var deskjs=require(_0x0110('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0110('0xf'));var Papa=require('papaparse');var Redis=require(_0x0110('0x10'));var authService=require(_0x0110('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0110('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0110('0x13'));var utils=require(_0x0110('0x14'));var config=require(_0x0110('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0110('0x16'))['db'];function respondWithStatusCode(_0x43c778,_0x1638e){_0x1638e=_0x1638e||0xcc;return function(_0x389b0e){if(_0x389b0e){return _0x43c778[_0x0110('0x17')](_0x1638e);}return _0x43c778['status'](_0x1638e)[_0x0110('0x18')]();};}function respondWithResult(_0x5164b9,_0x477b76){_0x477b76=_0x477b76||0xc8;return function(_0x382bfb){if(_0x382bfb){return _0x5164b9[_0x0110('0x19')](_0x477b76)[_0x0110('0x1a')](_0x382bfb);}};}function respondWithFilteredResult(_0x27f3c8,_0x137da2){return function(_0x884a52){if(_0x884a52){var _0x16820b=typeof _0x137da2['offset']===_0x0110('0x1b')&&typeof _0x137da2[_0x0110('0x1c')]===_0x0110('0x1b');var _0x52b014=_0x884a52[_0x0110('0x1d')];var _0xf2c9d7=_0x16820b?0x0:_0x137da2[_0x0110('0x1e')];var _0x2edc6f=_0x16820b?_0x884a52['count']:_0x137da2[_0x0110('0x1e')]+_0x137da2[_0x0110('0x1c')];var _0x3501b5;if(_0x2edc6f>=_0x52b014){_0x2edc6f=_0x52b014;_0x3501b5=0xc8;}else{_0x3501b5=0xce;}_0x27f3c8['status'](_0x3501b5);return _0x27f3c8['set'](_0x0110('0x1f'),_0xf2c9d7+'-'+_0x2edc6f+'/'+_0x52b014)[_0x0110('0x1a')](_0x884a52);}return null;};}function patchUpdates(_0x448356){return function(_0x212b44){try{jsonpatch[_0x0110('0x20')](_0x212b44,_0x448356,!![]);}catch(_0x3341ea){return BPromise['reject'](_0x3341ea);}return _0x212b44['save']();};}function saveUpdates(_0x4ca893,_0x44ba47){return function(_0x1cd0a7){if(_0x1cd0a7){return _0x1cd0a7[_0x0110('0x21')](_0x4ca893)['then'](function(_0x2625f6){return _0x2625f6;});}return null;};}function removeEntity(_0x4c3192,_0x193eee){return function(_0x19606f){if(_0x19606f){return _0x19606f[_0x0110('0x22')]()['then'](function(){_0x4c3192['status'](0xcc)[_0x0110('0x18')]();});}};}function handleEntityNotFound(_0x44e322,_0x178fa7){return function(_0x2af48c){if(!_0x2af48c){_0x44e322['sendStatus'](0x194);}return _0x2af48c;};}function handleError(_0x194b0e,_0x48af03){_0x48af03=_0x48af03||0x1f4;return function(_0x6fca4d){logger[_0x0110('0x23')](_0x6fca4d[_0x0110('0x24')]);if(_0x6fca4d[_0x0110('0x25')]){delete _0x6fca4d[_0x0110('0x25')];}_0x194b0e['status'](_0x48af03)[_0x0110('0x26')](_0x6fca4d);};}exports[_0x0110('0x27')]=function(_0x4824b5,_0x3b812c){var _0x2da8d6={},_0x460ea={},_0x4f3c3d={'count':0x0,'rows':[]};var _0x8d0b36=_[_0x0110('0x28')](db['Dynamics365Configuration'][_0x0110('0x29')],function(_0x34da47){return{'name':_0x34da47[_0x0110('0x2a')],'type':_0x34da47[_0x0110('0x2b')]['key']};});_0x460ea[_0x0110('0x2c')]=_[_0x0110('0x28')](_0x8d0b36,'name');_0x460ea[_0x0110('0x2d')]=_[_0x0110('0x2e')](_0x4824b5[_0x0110('0x2d')]);_0x460ea[_0x0110('0x2f')]=_[_0x0110('0x30')](_0x460ea['model'],_0x460ea['query']);_0x2da8d6['attributes']=_[_0x0110('0x30')](_0x460ea[_0x0110('0x2c')],qs[_0x0110('0x31')](_0x4824b5[_0x0110('0x2d')][_0x0110('0x31')]));_0x2da8d6[_0x0110('0x32')]=_0x2da8d6[_0x0110('0x32')][_0x0110('0x33')]?_0x2da8d6[_0x0110('0x32')]:_0x460ea[_0x0110('0x2c')];if(!_0x4824b5['query'][_0x0110('0x34')]('nolimit')){_0x2da8d6['limit']=qs[_0x0110('0x1c')](_0x4824b5[_0x0110('0x2d')][_0x0110('0x1c')]);_0x2da8d6['offset']=qs[_0x0110('0x1e')](_0x4824b5[_0x0110('0x2d')]['offset']);}_0x2da8d6[_0x0110('0x35')]=qs[_0x0110('0x36')](_0x4824b5[_0x0110('0x2d')]['sort']);_0x2da8d6[_0x0110('0x37')]=qs[_0x0110('0x2f')](_[_0x0110('0x38')](_0x4824b5['query'],_0x460ea[_0x0110('0x2f')]),_0x8d0b36);if(_0x4824b5[_0x0110('0x2d')][_0x0110('0x39')]){_0x2da8d6[_0x0110('0x37')]=_['merge'](_0x2da8d6[_0x0110('0x37')],{'$or':_[_0x0110('0x28')](_0x8d0b36,function(_0x38b64c){if(_0x38b64c['type']!==_0x0110('0x3a')){var _0x977f51={};_0x977f51[_0x38b64c['name']]={'$like':'%'+_0x4824b5[_0x0110('0x2d')][_0x0110('0x39')]+'%'};return _0x977f51;}})});}_0x2da8d6=_['merge']({},_0x2da8d6,_0x4824b5['options']);var _0x5432ed={'where':_0x2da8d6[_0x0110('0x37')]};return db[_0x0110('0x3b')]['count'](_0x5432ed)[_0x0110('0x3c')](function(_0x327831){_0x4f3c3d[_0x0110('0x1d')]=_0x327831;if(_0x4824b5['query'][_0x0110('0x3d')]){_0x2da8d6['include']=[{'all':!![]}];}return db[_0x0110('0x3b')][_0x0110('0x3e')](_0x2da8d6);})[_0x0110('0x3c')](function(_0xaf68bb){_0x4f3c3d[_0x0110('0x3f')]=_0xaf68bb;return _0x4f3c3d;})[_0x0110('0x3c')](respondWithFilteredResult(_0x3b812c,_0x2da8d6))[_0x0110('0x40')](handleError(_0x3b812c,null));};exports[_0x0110('0x41')]=function(_0x1af108,_0x5cde11){var _0x4dc75c={'raw':![],'where':{'id':_0x1af108[_0x0110('0x42')]['id']}},_0x3e9873={};_0x3e9873[_0x0110('0x2c')]=_[_0x0110('0x2e')](db[_0x0110('0x3b')]['rawAttributes']);_0x3e9873[_0x0110('0x2d')]=_['keys'](_0x1af108['query']);_0x3e9873[_0x0110('0x2f')]=_[_0x0110('0x30')](_0x3e9873[_0x0110('0x2c')],_0x3e9873[_0x0110('0x2d')]);_0x4dc75c[_0x0110('0x32')]=_[_0x0110('0x30')](_0x3e9873[_0x0110('0x2c')],qs[_0x0110('0x31')](_0x1af108[_0x0110('0x2d')][_0x0110('0x31')]));_0x4dc75c[_0x0110('0x32')]=_0x4dc75c[_0x0110('0x32')][_0x0110('0x33')]?_0x4dc75c[_0x0110('0x32')]:_0x3e9873['model'];if(_0x1af108[_0x0110('0x2d')]['includeAll']){_0x4dc75c[_0x0110('0x43')]=[{'all':!![]}];}_0x4dc75c=_[_0x0110('0x44')]({},_0x4dc75c,_0x1af108[_0x0110('0x45')]);return db[_0x0110('0x3b')]['find'](_0x4dc75c)[_0x0110('0x3c')](handleEntityNotFound(_0x5cde11,null))[_0x0110('0x3c')](respondWithResult(_0x5cde11,null))[_0x0110('0x40')](handleError(_0x5cde11,null));};exports[_0x0110('0x46')]=function(_0x389ef5,_0x26dd14){return db[_0x0110('0x3b')][_0x0110('0x46')](_0x389ef5['body'],{})[_0x0110('0x3c')](respondWithResult(_0x26dd14,0xc9))['catch'](handleError(_0x26dd14,null));};exports[_0x0110('0x21')]=function(_0x3eddd6,_0x2970ed){if(_0x3eddd6[_0x0110('0x47')]['id']){delete _0x3eddd6['body']['id'];}return db[_0x0110('0x3b')][_0x0110('0x48')]({'where':{'id':_0x3eddd6[_0x0110('0x42')]['id']}})[_0x0110('0x3c')](handleEntityNotFound(_0x2970ed,null))['then'](saveUpdates(_0x3eddd6[_0x0110('0x47')],null))[_0x0110('0x3c')](respondWithResult(_0x2970ed,null))[_0x0110('0x40')](handleError(_0x2970ed,null));};exports[_0x0110('0x22')]=function(_0x493c72,_0x35bdf0){return db['Dynamics365Configuration'][_0x0110('0x48')]({'where':{'id':_0x493c72['params']['id']}})['then'](handleEntityNotFound(_0x35bdf0,null))[_0x0110('0x3c')](removeEntity(_0x35bdf0,null))[_0x0110('0x40')](handleError(_0x35bdf0,null));};exports['getFields']=function(_0x41a65a,_0x207598,_0x41d1df){var _0x41bf2c={};var _0x38a299={};var _0xc0867;var _0x1c5e86;return db[_0x0110('0x3b')][_0x0110('0x49')]({'where':{'id':_0x41a65a['params']['id']}})[_0x0110('0x3c')](handleEntityNotFound(_0x207598,null))[_0x0110('0x3c')](function(_0x36ac51){if(_0x36ac51){_0xc0867=_0x36ac51;_0x38a299['model']=_[_0x0110('0x2e')](db['Dynamics365Field']['rawAttributes']);_0x38a299[_0x0110('0x2d')]=_[_0x0110('0x2e')](_0x41a65a['query']);_0x38a299[_0x0110('0x2f')]=_[_0x0110('0x30')](_0x38a299[_0x0110('0x2c')],_0x38a299[_0x0110('0x2d')]);_0x41bf2c[_0x0110('0x32')]=_[_0x0110('0x30')](_0x38a299[_0x0110('0x2c')],qs['fields'](_0x41a65a[_0x0110('0x2d')][_0x0110('0x31')]));_0x41bf2c['attributes']=_0x41bf2c[_0x0110('0x32')]['length']?_0x41bf2c[_0x0110('0x32')]:_0x38a299[_0x0110('0x2c')];_0x41bf2c['order']=qs[_0x0110('0x36')](_0x41a65a[_0x0110('0x2d')][_0x0110('0x36')]);_0x41bf2c[_0x0110('0x37')]=qs[_0x0110('0x2f')](_['pick'](_0x41a65a[_0x0110('0x2d')],_0x38a299[_0x0110('0x2f')]));if(_0x41a65a[_0x0110('0x2d')]['filter']){_0x41bf2c[_0x0110('0x37')]=_[_0x0110('0x44')](_0x41bf2c[_0x0110('0x37')],{'$or':_[_0x0110('0x28')](_0x41bf2c[_0x0110('0x32')],function(_0x4b70cb){var _0xc0853d={};_0xc0853d[_0x4b70cb]={'$like':'%'+_0x41a65a[_0x0110('0x2d')]['filter']+'%'};return _0xc0853d;})});}_0x41bf2c=_[_0x0110('0x44')]({},_0x41bf2c,_0x41a65a[_0x0110('0x45')]);return _0xc0867[_0x0110('0x4a')](_0x41bf2c);}})[_0x0110('0x3c')](function(_0x3b6285){if(_0x3b6285){_0x1c5e86=_0x3b6285[_0x0110('0x33')];if(!_0x41a65a[_0x0110('0x2d')][_0x0110('0x34')](_0x0110('0x4b'))){_0x41bf2c[_0x0110('0x1c')]=qs[_0x0110('0x1c')](_0x41a65a[_0x0110('0x2d')][_0x0110('0x1c')]);_0x41bf2c[_0x0110('0x1e')]=qs[_0x0110('0x1e')](_0x41a65a['query']['offset']);}return _0xc0867[_0x0110('0x4a')](_0x41bf2c);}})[_0x0110('0x3c')](function(_0x1ff046){if(_0x1ff046){return _0x1ff046?{'count':_0x1c5e86,'rows':_0x1ff046}:null;}})['then'](respondWithResult(_0x207598,null))['catch'](handleError(_0x207598,null));};exports[_0x0110('0x4c')]=function(_0xc2f103,_0x937219,_0x17316f){var _0x159862={};var _0x577ac1={};var _0x540d94;var _0x31a9dc;return db['Dynamics365Configuration'][_0x0110('0x49')]({'where':{'id':_0xc2f103['params']['id']}})['then'](handleEntityNotFound(_0x937219,null))[_0x0110('0x3c')](function(_0xa65943){if(_0xa65943){_0x540d94=_0xa65943;_0x577ac1[_0x0110('0x2c')]=_['keys'](db['Dynamics365Field'][_0x0110('0x29')]);_0x577ac1['query']=_[_0x0110('0x2e')](_0xc2f103[_0x0110('0x2d')]);_0x577ac1[_0x0110('0x2f')]=_[_0x0110('0x30')](_0x577ac1[_0x0110('0x2c')],_0x577ac1[_0x0110('0x2d')]);_0x159862[_0x0110('0x32')]=_[_0x0110('0x30')](_0x577ac1[_0x0110('0x2c')],qs['fields'](_0xc2f103[_0x0110('0x2d')][_0x0110('0x31')]));_0x159862[_0x0110('0x32')]=_0x159862['attributes'][_0x0110('0x33')]?_0x159862[_0x0110('0x32')]:_0x577ac1[_0x0110('0x2c')];_0x159862[_0x0110('0x35')]=qs[_0x0110('0x36')](_0xc2f103[_0x0110('0x2d')][_0x0110('0x36')]);_0x159862['where']=qs['filters'](_[_0x0110('0x38')](_0xc2f103[_0x0110('0x2d')],_0x577ac1['filters']));if(_0xc2f103[_0x0110('0x2d')][_0x0110('0x39')]){_0x159862[_0x0110('0x37')]=_[_0x0110('0x44')](_0x159862[_0x0110('0x37')],{'$or':_['map'](_0x159862[_0x0110('0x32')],function(_0x36be7c){var _0x3f167e={};_0x3f167e[_0x36be7c]={'$like':'%'+_0xc2f103[_0x0110('0x2d')]['filter']+'%'};return _0x3f167e;})});}_0x159862=_[_0x0110('0x44')]({},_0x159862,_0xc2f103[_0x0110('0x45')]);return _0x540d94[_0x0110('0x4c')](_0x159862);}})[_0x0110('0x3c')](function(_0x2873a7){if(_0x2873a7){_0x31a9dc=_0x2873a7['length'];if(!_0xc2f103[_0x0110('0x2d')]['hasOwnProperty'](_0x0110('0x4b'))){_0x159862[_0x0110('0x1c')]=qs[_0x0110('0x1c')](_0xc2f103['query'][_0x0110('0x1c')]);_0x159862[_0x0110('0x1e')]=qs[_0x0110('0x1e')](_0xc2f103[_0x0110('0x2d')]['offset']);}return _0x540d94[_0x0110('0x4c')](_0x159862);}})['then'](function(_0x42360d){if(_0x42360d){return _0x42360d?{'count':_0x31a9dc,'rows':_0x42360d}:null;}})[_0x0110('0x3c')](respondWithResult(_0x937219,null))['catch'](handleError(_0x937219,null));};exports['getDescriptions']=function(_0x511da8,_0x25f256,_0x134b66){var _0x4cd523={};var _0x34c83c={};var _0x33b7e1;var _0x56ab1e;return db[_0x0110('0x3b')][_0x0110('0x49')]({'where':{'id':_0x511da8['params']['id']}})[_0x0110('0x3c')](handleEntityNotFound(_0x25f256,null))[_0x0110('0x3c')](function(_0xe73489){if(_0xe73489){_0x33b7e1=_0xe73489;_0x34c83c[_0x0110('0x2c')]=_['keys'](db['Dynamics365Field'][_0x0110('0x29')]);_0x34c83c[_0x0110('0x2d')]=_[_0x0110('0x2e')](_0x511da8[_0x0110('0x2d')]);_0x34c83c[_0x0110('0x2f')]=_[_0x0110('0x30')](_0x34c83c[_0x0110('0x2c')],_0x34c83c['query']);_0x4cd523[_0x0110('0x32')]=_[_0x0110('0x30')](_0x34c83c[_0x0110('0x2c')],qs[_0x0110('0x31')](_0x511da8['query'][_0x0110('0x31')]));_0x4cd523[_0x0110('0x32')]=_0x4cd523[_0x0110('0x32')][_0x0110('0x33')]?_0x4cd523['attributes']:_0x34c83c[_0x0110('0x2c')];_0x4cd523[_0x0110('0x35')]=qs[_0x0110('0x36')](_0x511da8[_0x0110('0x2d')][_0x0110('0x36')]);_0x4cd523[_0x0110('0x37')]=qs[_0x0110('0x2f')](_[_0x0110('0x38')](_0x511da8['query'],_0x34c83c[_0x0110('0x2f')]));if(_0x511da8[_0x0110('0x2d')][_0x0110('0x39')]){_0x4cd523[_0x0110('0x37')]=_['merge'](_0x4cd523['where'],{'$or':_[_0x0110('0x28')](_0x4cd523[_0x0110('0x32')],function(_0x10bb4d){var _0x52ab8f={};_0x52ab8f[_0x10bb4d]={'$like':'%'+_0x511da8[_0x0110('0x2d')][_0x0110('0x39')]+'%'};return _0x52ab8f;})});}_0x4cd523=_['merge']({},_0x4cd523,_0x511da8[_0x0110('0x45')]);return _0x33b7e1[_0x0110('0x4d')](_0x4cd523);}})[_0x0110('0x3c')](function(_0x50b68e){if(_0x50b68e){_0x56ab1e=_0x50b68e[_0x0110('0x33')];if(!_0x511da8[_0x0110('0x2d')][_0x0110('0x34')](_0x0110('0x4b'))){_0x4cd523[_0x0110('0x1c')]=qs[_0x0110('0x1c')](_0x511da8[_0x0110('0x2d')]['limit']);_0x4cd523[_0x0110('0x1e')]=qs[_0x0110('0x1e')](_0x511da8[_0x0110('0x2d')][_0x0110('0x1e')]);}return _0x33b7e1[_0x0110('0x4d')](_0x4cd523);}})[_0x0110('0x3c')](function(_0x554daa){if(_0x554daa){return _0x554daa?{'count':_0x56ab1e,'rows':_0x554daa}:null;}})['then'](respondWithResult(_0x25f256,null))['catch'](handleError(_0x25f256,null));};
\ No newline at end of file
+var _0xe699=['stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','rows','catch','params','intersection','find','create','body','update','getFields','findOne','Dynamics365Field','order','options','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','save','then','destroy','error'];(function(_0x54190a,_0x240d6f){var _0x47e961=function(_0x3d631b){while(--_0x3d631b){_0x54190a['push'](_0x54190a['shift']());}};_0x47e961(++_0x240d6f);}(_0xe699,0x118));var _0x9e69=function(_0x3c04d0,_0x557b15){_0x3c04d0=_0x3c04d0-0x0;var _0x41d35b=_0xe699[_0x3c04d0];return _0x41d35b;};'use strict';var emlformat=require(_0x9e69('0x0'));var rimraf=require(_0x9e69('0x1'));var zipdir=require(_0x9e69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e69('0x3'));var Mustache=require(_0x9e69('0x4'));var util=require(_0x9e69('0x5'));var path=require(_0x9e69('0x6'));var sox=require(_0x9e69('0x7'));var csv=require(_0x9e69('0x8'));var ejs=require(_0x9e69('0x9'));var fs=require('fs');var fs_extra=require(_0x9e69('0xa'));var _=require(_0x9e69('0xb'));var squel=require(_0x9e69('0xc'));var crypto=require(_0x9e69('0xd'));var jsforce=require(_0x9e69('0xe'));var deskjs=require(_0x9e69('0xf'));var toCsv=require(_0x9e69('0x8'));var querystring=require(_0x9e69('0x10'));var Papa=require(_0x9e69('0x11'));var Redis=require(_0x9e69('0x12'));var authService=require(_0x9e69('0x13'));var qs=require(_0x9e69('0x14'));var as=require(_0x9e69('0x15'));var hardwareService=require(_0x9e69('0x16'));var logger=require('../../config/logger')(_0x9e69('0x17'));var utils=require(_0x9e69('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9e69('0x19'));var db=require(_0x9e69('0x1a'))['db'];function respondWithStatusCode(_0x3788f6,_0x152df8){_0x152df8=_0x152df8||0xcc;return function(_0x2cad08){if(_0x2cad08){return _0x3788f6[_0x9e69('0x1b')](_0x152df8);}return _0x3788f6[_0x9e69('0x1c')](_0x152df8)[_0x9e69('0x1d')]();};}function respondWithResult(_0x1b1e5f,_0x136a5e){_0x136a5e=_0x136a5e||0xc8;return function(_0x13347f){if(_0x13347f){return _0x1b1e5f[_0x9e69('0x1c')](_0x136a5e)['json'](_0x13347f);}};}function respondWithFilteredResult(_0x433a68,_0x1fc0ba){return function(_0x431e90){if(_0x431e90){var _0x2afd30=typeof _0x1fc0ba[_0x9e69('0x1e')]===_0x9e69('0x1f')&&typeof _0x1fc0ba[_0x9e69('0x20')]===_0x9e69('0x1f');var _0x4415c4=_0x431e90['count'];var _0x33833=_0x2afd30?0x0:_0x1fc0ba[_0x9e69('0x1e')];var _0x240b8d=_0x2afd30?_0x431e90[_0x9e69('0x21')]:_0x1fc0ba[_0x9e69('0x1e')]+_0x1fc0ba[_0x9e69('0x20')];var _0x337077;if(_0x240b8d>=_0x4415c4){_0x240b8d=_0x4415c4;_0x337077=0xc8;}else{_0x337077=0xce;}_0x433a68[_0x9e69('0x1c')](_0x337077);return _0x433a68[_0x9e69('0x22')]('Content-Range',_0x33833+'-'+_0x240b8d+'/'+_0x4415c4)[_0x9e69('0x23')](_0x431e90);}return null;};}function patchUpdates(_0x39efd2){return function(_0x5c466f){try{jsonpatch['apply'](_0x5c466f,_0x39efd2,!![]);}catch(_0x180003){return BPromise['reject'](_0x180003);}return _0x5c466f[_0x9e69('0x24')]();};}function saveUpdates(_0x5e2daa,_0x4c83dd){return function(_0x533349){if(_0x533349){return _0x533349['update'](_0x5e2daa)[_0x9e69('0x25')](function(_0x2291d4){return _0x2291d4;});}return null;};}function removeEntity(_0x4c80c5,_0x31ce3a){return function(_0x1fe9e5){if(_0x1fe9e5){return _0x1fe9e5[_0x9e69('0x26')]()['then'](function(){_0x4c80c5[_0x9e69('0x1c')](0xcc)[_0x9e69('0x1d')]();});}};}function handleEntityNotFound(_0x2d30d0,_0x1fe317){return function(_0x3c3e75){if(!_0x3c3e75){_0x2d30d0[_0x9e69('0x1b')](0x194);}return _0x3c3e75;};}function handleError(_0x476c30,_0x52ddb3){_0x52ddb3=_0x52ddb3||0x1f4;return function(_0x38a68a){logger[_0x9e69('0x27')](_0x38a68a[_0x9e69('0x28')]);if(_0x38a68a[_0x9e69('0x29')]){delete _0x38a68a[_0x9e69('0x29')];}_0x476c30[_0x9e69('0x1c')](_0x52ddb3)[_0x9e69('0x2a')](_0x38a68a);};}exports['index']=function(_0x5eb7bc,_0x829ce1){var _0x4d2b88={},_0x5565fc={},_0x142b70={'count':0x0,'rows':[]};var _0x40a005=_[_0x9e69('0x2b')](db[_0x9e69('0x2c')][_0x9e69('0x2d')],function(_0x4de698){return{'name':_0x4de698[_0x9e69('0x2e')],'type':_0x4de698['type'][_0x9e69('0x2f')]};});_0x5565fc['model']=_[_0x9e69('0x2b')](_0x40a005,'name');_0x5565fc[_0x9e69('0x30')]=_[_0x9e69('0x31')](_0x5eb7bc[_0x9e69('0x30')]);_0x5565fc[_0x9e69('0x32')]=_['intersection'](_0x5565fc[_0x9e69('0x33')],_0x5565fc[_0x9e69('0x30')]);_0x4d2b88['attributes']=_['intersection'](_0x5565fc[_0x9e69('0x33')],qs[_0x9e69('0x34')](_0x5eb7bc['query']['fields']));_0x4d2b88[_0x9e69('0x35')]=_0x4d2b88[_0x9e69('0x35')][_0x9e69('0x36')]?_0x4d2b88[_0x9e69('0x35')]:_0x5565fc[_0x9e69('0x33')];if(!_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x37')](_0x9e69('0x38'))){_0x4d2b88['limit']=qs['limit'](_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x20')]);_0x4d2b88[_0x9e69('0x1e')]=qs[_0x9e69('0x1e')](_0x5eb7bc[_0x9e69('0x30')]['offset']);}_0x4d2b88['order']=qs['sort'](_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x39')]);_0x4d2b88[_0x9e69('0x3a')]=qs['filters'](_[_0x9e69('0x3b')](_0x5eb7bc['query'],_0x5565fc[_0x9e69('0x32')]),_0x40a005);if(_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x3c')]){_0x4d2b88[_0x9e69('0x3a')]=_['merge'](_0x4d2b88['where'],{'$or':_[_0x9e69('0x2b')](_0x40a005,function(_0x88928a){if(_0x88928a[_0x9e69('0x3d')]!==_0x9e69('0x3e')){var _0x3de4c9={};_0x3de4c9[_0x88928a['name']]={'$like':'%'+_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x3c')]+'%'};return _0x3de4c9;}})});}_0x4d2b88=_[_0x9e69('0x3f')]({},_0x4d2b88,_0x5eb7bc['options']);var _0x58f5f0={'where':_0x4d2b88['where']};return db[_0x9e69('0x2c')][_0x9e69('0x21')](_0x58f5f0)['then'](function(_0x5ca49d){_0x142b70[_0x9e69('0x21')]=_0x5ca49d;if(_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x40')]){_0x4d2b88['include']=[{'all':!![]}];}return db[_0x9e69('0x2c')]['findAll'](_0x4d2b88);})[_0x9e69('0x25')](function(_0x4da7d5){_0x142b70[_0x9e69('0x41')]=_0x4da7d5;return _0x142b70;})[_0x9e69('0x25')](respondWithFilteredResult(_0x829ce1,_0x4d2b88))[_0x9e69('0x42')](handleError(_0x829ce1,null));};exports['show']=function(_0x973cbf,_0x2a9611){var _0x39490f={'raw':![],'where':{'id':_0x973cbf[_0x9e69('0x43')]['id']}},_0x5ad6c0={};_0x5ad6c0[_0x9e69('0x33')]=_['keys'](db[_0x9e69('0x2c')][_0x9e69('0x2d')]);_0x5ad6c0['query']=_['keys'](_0x973cbf['query']);_0x5ad6c0['filters']=_['intersection'](_0x5ad6c0[_0x9e69('0x33')],_0x5ad6c0['query']);_0x39490f[_0x9e69('0x35')]=_[_0x9e69('0x44')](_0x5ad6c0['model'],qs[_0x9e69('0x34')](_0x973cbf[_0x9e69('0x30')][_0x9e69('0x34')]));_0x39490f['attributes']=_0x39490f[_0x9e69('0x35')][_0x9e69('0x36')]?_0x39490f[_0x9e69('0x35')]:_0x5ad6c0[_0x9e69('0x33')];if(_0x973cbf['query'][_0x9e69('0x40')]){_0x39490f['include']=[{'all':!![]}];}_0x39490f=_[_0x9e69('0x3f')]({},_0x39490f,_0x973cbf['options']);return db[_0x9e69('0x2c')][_0x9e69('0x45')](_0x39490f)[_0x9e69('0x25')](handleEntityNotFound(_0x2a9611,null))['then'](respondWithResult(_0x2a9611,null))['catch'](handleError(_0x2a9611,null));};exports[_0x9e69('0x46')]=function(_0x112445,_0x4137d2){return db['Dynamics365Configuration'][_0x9e69('0x46')](_0x112445[_0x9e69('0x47')],{})[_0x9e69('0x25')](respondWithResult(_0x4137d2,0xc9))['catch'](handleError(_0x4137d2,null));};exports[_0x9e69('0x48')]=function(_0x54e81f,_0x3e4f92){if(_0x54e81f[_0x9e69('0x47')]['id']){delete _0x54e81f[_0x9e69('0x47')]['id'];}return db[_0x9e69('0x2c')][_0x9e69('0x45')]({'where':{'id':_0x54e81f[_0x9e69('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e4f92,null))[_0x9e69('0x25')](saveUpdates(_0x54e81f[_0x9e69('0x47')],null))[_0x9e69('0x25')](respondWithResult(_0x3e4f92,null))[_0x9e69('0x42')](handleError(_0x3e4f92,null));};exports[_0x9e69('0x26')]=function(_0x5c40e6,_0xf93fe2){return db[_0x9e69('0x2c')]['find']({'where':{'id':_0x5c40e6[_0x9e69('0x43')]['id']}})[_0x9e69('0x25')](handleEntityNotFound(_0xf93fe2,null))[_0x9e69('0x25')](removeEntity(_0xf93fe2,null))[_0x9e69('0x42')](handleError(_0xf93fe2,null));};exports[_0x9e69('0x49')]=function(_0x59eac2,_0x30a0fa,_0x42622a){var _0x326f50={};var _0x42e86e={};var _0x4b8a0d;var _0x4de80f;return db[_0x9e69('0x2c')][_0x9e69('0x4a')]({'where':{'id':_0x59eac2[_0x9e69('0x43')]['id']}})[_0x9e69('0x25')](handleEntityNotFound(_0x30a0fa,null))['then'](function(_0x1415d9){if(_0x1415d9){_0x4b8a0d=_0x1415d9;_0x42e86e['model']=_[_0x9e69('0x31')](db[_0x9e69('0x4b')][_0x9e69('0x2d')]);_0x42e86e[_0x9e69('0x30')]=_[_0x9e69('0x31')](_0x59eac2[_0x9e69('0x30')]);_0x42e86e['filters']=_['intersection'](_0x42e86e['model'],_0x42e86e['query']);_0x326f50[_0x9e69('0x35')]=_[_0x9e69('0x44')](_0x42e86e[_0x9e69('0x33')],qs[_0x9e69('0x34')](_0x59eac2[_0x9e69('0x30')]['fields']));_0x326f50[_0x9e69('0x35')]=_0x326f50[_0x9e69('0x35')]['length']?_0x326f50[_0x9e69('0x35')]:_0x42e86e[_0x9e69('0x33')];_0x326f50[_0x9e69('0x4c')]=qs['sort'](_0x59eac2[_0x9e69('0x30')]['sort']);_0x326f50[_0x9e69('0x3a')]=qs[_0x9e69('0x32')](_[_0x9e69('0x3b')](_0x59eac2[_0x9e69('0x30')],_0x42e86e[_0x9e69('0x32')]));if(_0x59eac2[_0x9e69('0x30')]['filter']){_0x326f50[_0x9e69('0x3a')]=_['merge'](_0x326f50['where'],{'$or':_[_0x9e69('0x2b')](_0x326f50['attributes'],function(_0x540ac6){var _0x3dcb7d={};_0x3dcb7d[_0x540ac6]={'$like':'%'+_0x59eac2[_0x9e69('0x30')][_0x9e69('0x3c')]+'%'};return _0x3dcb7d;})});}_0x326f50=_[_0x9e69('0x3f')]({},_0x326f50,_0x59eac2[_0x9e69('0x4d')]);return _0x4b8a0d[_0x9e69('0x49')](_0x326f50);}})[_0x9e69('0x25')](function(_0x886e78){if(_0x886e78){_0x4de80f=_0x886e78[_0x9e69('0x36')];if(!_0x59eac2['query'][_0x9e69('0x37')](_0x9e69('0x38'))){_0x326f50[_0x9e69('0x20')]=qs['limit'](_0x59eac2[_0x9e69('0x30')]['limit']);_0x326f50[_0x9e69('0x1e')]=qs[_0x9e69('0x1e')](_0x59eac2[_0x9e69('0x30')][_0x9e69('0x1e')]);}return _0x4b8a0d[_0x9e69('0x49')](_0x326f50);}})['then'](function(_0x4f34f8){if(_0x4f34f8){return _0x4f34f8?{'count':_0x4de80f,'rows':_0x4f34f8}:null;}})[_0x9e69('0x25')](respondWithResult(_0x30a0fa,null))[_0x9e69('0x42')](handleError(_0x30a0fa,null));};exports[_0x9e69('0x4e')]=function(_0x479bb9,_0x56eb20,_0x2243db){var _0xdb5cdf={};var _0x30589f={};var _0x546cef;var _0x2046c1;return db['Dynamics365Configuration'][_0x9e69('0x4a')]({'where':{'id':_0x479bb9[_0x9e69('0x43')]['id']}})[_0x9e69('0x25')](handleEntityNotFound(_0x56eb20,null))['then'](function(_0xadb439){if(_0xadb439){_0x546cef=_0xadb439;_0x30589f[_0x9e69('0x33')]=_[_0x9e69('0x31')](db['Dynamics365Field'][_0x9e69('0x2d')]);_0x30589f[_0x9e69('0x30')]=_[_0x9e69('0x31')](_0x479bb9[_0x9e69('0x30')]);_0x30589f[_0x9e69('0x32')]=_[_0x9e69('0x44')](_0x30589f[_0x9e69('0x33')],_0x30589f[_0x9e69('0x30')]);_0xdb5cdf['attributes']=_[_0x9e69('0x44')](_0x30589f[_0x9e69('0x33')],qs['fields'](_0x479bb9['query'][_0x9e69('0x34')]));_0xdb5cdf[_0x9e69('0x35')]=_0xdb5cdf['attributes'][_0x9e69('0x36')]?_0xdb5cdf[_0x9e69('0x35')]:_0x30589f[_0x9e69('0x33')];_0xdb5cdf[_0x9e69('0x4c')]=qs[_0x9e69('0x39')](_0x479bb9[_0x9e69('0x30')][_0x9e69('0x39')]);_0xdb5cdf[_0x9e69('0x3a')]=qs['filters'](_['pick'](_0x479bb9[_0x9e69('0x30')],_0x30589f['filters']));if(_0x479bb9['query'][_0x9e69('0x3c')]){_0xdb5cdf['where']=_[_0x9e69('0x3f')](_0xdb5cdf[_0x9e69('0x3a')],{'$or':_[_0x9e69('0x2b')](_0xdb5cdf[_0x9e69('0x35')],function(_0x32b2fd){var _0x2be472={};_0x2be472[_0x32b2fd]={'$like':'%'+_0x479bb9[_0x9e69('0x30')][_0x9e69('0x3c')]+'%'};return _0x2be472;})});}_0xdb5cdf=_[_0x9e69('0x3f')]({},_0xdb5cdf,_0x479bb9[_0x9e69('0x4d')]);return _0x546cef['getSubjects'](_0xdb5cdf);}})['then'](function(_0x1fcf35){if(_0x1fcf35){_0x2046c1=_0x1fcf35[_0x9e69('0x36')];if(!_0x479bb9[_0x9e69('0x30')][_0x9e69('0x37')]('nolimit')){_0xdb5cdf[_0x9e69('0x20')]=qs['limit'](_0x479bb9['query']['limit']);_0xdb5cdf['offset']=qs[_0x9e69('0x1e')](_0x479bb9[_0x9e69('0x30')][_0x9e69('0x1e')]);}return _0x546cef[_0x9e69('0x4e')](_0xdb5cdf);}})[_0x9e69('0x25')](function(_0x360017){if(_0x360017){return _0x360017?{'count':_0x2046c1,'rows':_0x360017}:null;}})['then'](respondWithResult(_0x56eb20,null))['catch'](handleError(_0x56eb20,null));};exports[_0x9e69('0x4f')]=function(_0x55ede9,_0x1a8192,_0x815aaa){var _0x1e7aee={};var _0x386ffc={};var _0x5a8a8e;var _0x11faf9;return db[_0x9e69('0x2c')][_0x9e69('0x4a')]({'where':{'id':_0x55ede9['params']['id']}})['then'](handleEntityNotFound(_0x1a8192,null))['then'](function(_0x1a5ebb){if(_0x1a5ebb){_0x5a8a8e=_0x1a5ebb;_0x386ffc['model']=_[_0x9e69('0x31')](db[_0x9e69('0x4b')][_0x9e69('0x2d')]);_0x386ffc[_0x9e69('0x30')]=_['keys'](_0x55ede9[_0x9e69('0x30')]);_0x386ffc[_0x9e69('0x32')]=_['intersection'](_0x386ffc['model'],_0x386ffc[_0x9e69('0x30')]);_0x1e7aee['attributes']=_[_0x9e69('0x44')](_0x386ffc['model'],qs[_0x9e69('0x34')](_0x55ede9[_0x9e69('0x30')][_0x9e69('0x34')]));_0x1e7aee[_0x9e69('0x35')]=_0x1e7aee[_0x9e69('0x35')][_0x9e69('0x36')]?_0x1e7aee[_0x9e69('0x35')]:_0x386ffc[_0x9e69('0x33')];_0x1e7aee[_0x9e69('0x4c')]=qs[_0x9e69('0x39')](_0x55ede9[_0x9e69('0x30')][_0x9e69('0x39')]);_0x1e7aee[_0x9e69('0x3a')]=qs[_0x9e69('0x32')](_['pick'](_0x55ede9[_0x9e69('0x30')],_0x386ffc[_0x9e69('0x32')]));if(_0x55ede9['query'][_0x9e69('0x3c')]){_0x1e7aee['where']=_[_0x9e69('0x3f')](_0x1e7aee[_0x9e69('0x3a')],{'$or':_[_0x9e69('0x2b')](_0x1e7aee[_0x9e69('0x35')],function(_0x421a84){var _0x47ceb3={};_0x47ceb3[_0x421a84]={'$like':'%'+_0x55ede9[_0x9e69('0x30')]['filter']+'%'};return _0x47ceb3;})});}_0x1e7aee=_[_0x9e69('0x3f')]({},_0x1e7aee,_0x55ede9[_0x9e69('0x4d')]);return _0x5a8a8e[_0x9e69('0x4f')](_0x1e7aee);}})[_0x9e69('0x25')](function(_0x2217b1){if(_0x2217b1){_0x11faf9=_0x2217b1[_0x9e69('0x36')];if(!_0x55ede9[_0x9e69('0x30')][_0x9e69('0x37')](_0x9e69('0x38'))){_0x1e7aee[_0x9e69('0x20')]=qs[_0x9e69('0x20')](_0x55ede9[_0x9e69('0x30')][_0x9e69('0x20')]);_0x1e7aee[_0x9e69('0x1e')]=qs[_0x9e69('0x1e')](_0x55ede9['query'][_0x9e69('0x1e')]);}return _0x5a8a8e[_0x9e69('0x4f')](_0x1e7aee);}})[_0x9e69('0x25')](function(_0x4c738d){if(_0x4c738d){return _0x4c738d?{'count':_0x11faf9,'rows':_0x4c738d}:null;}})[_0x9e69('0x25')](respondWithResult(_0x1a8192,null))[_0x9e69('0x42')](handleError(_0x1a8192,null));};
\ No newline at end of file
index db8fad4..43b8937 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x3aac69,_0x81d09f){var _0x38d35b=function(_0x58ef90){while(--_0x58ef90){_0x3aac69['push'](_0x3aac69['shift']());}};_0x38d35b(++_0x81d09f);}(_0x008c,0x188));var _0xc008=function(_0x2d4132,_0x16e982){_0x2d4132=_0x2d4132-0x0;var _0x4a0a1b=_0x008c[_0x2d4132];return _0x4a0a1b;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x3544a4,_0x2b801c){var _0x3ad501=function(_0x387d32){while(--_0x387d32){_0x3544a4['push'](_0x3544a4['shift']());}};_0x3ad501(++_0x2b801c);}(_0x3e74,0x175));var _0x43e7=function(_0x1aa086,_0x1eb0e9){_0x1aa086=_0x1aa086-0x0;var _0xfdffb5=_0x3e74[_0x1aa086];return _0xfdffb5;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1ac235f..ab36f23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa893=['client','http','then','debug','request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x45423e,_0x4cc862){var _0x3157c1=function(_0x5ddce4){while(--_0x5ddce4){_0x45423e['push'](_0x45423e['shift']());}};_0x3157c1(++_0x4cc862);}(_0xa893,0x97));var _0x3a89=function(_0x3e2ee3,_0x3c08d8){_0x3e2ee3=_0x3e2ee3-0x0;var _0xc79caa=_0xa893[_0x3e2ee3];return _0xc79caa;};'use strict';var _=require(_0x3a89('0x0'));var util=require(_0x3a89('0x1'));var moment=require(_0x3a89('0x2'));var BPromise=require('bluebird');var rs=require(_0x3a89('0x3'));var fs=require('fs');var Redis=require(_0x3a89('0x4'));var db=require(_0x3a89('0x5'))['db'];var utils=require(_0x3a89('0x6'));var logger=require(_0x3a89('0x7'))(_0x3a89('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3a89('0x9')][_0x3a89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18046f,_0x39dd0d,_0x403858){return new BPromise(function(_0x4bc82f,_0x20cf50){return client['request'](_0x18046f,_0x403858)[_0x3a89('0xb')](function(_0x41e72b){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x39dd0d,'request\x20sent');logger[_0x3a89('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x39dd0d,_0x3a89('0xd'),JSON[_0x3a89('0xe')](_0x41e72b));if(_0x41e72b[_0x3a89('0xf')]){if(_0x41e72b[_0x3a89('0xf')][_0x3a89('0x10')]===0x1f4){logger[_0x3a89('0xf')](_0x3a89('0x11'),_0x39dd0d,_0x41e72b[_0x3a89('0xf')][_0x3a89('0x12')]);return _0x20cf50(_0x41e72b[_0x3a89('0xf')][_0x3a89('0x12')]);}logger['error'](_0x3a89('0x11'),_0x39dd0d,_0x41e72b[_0x3a89('0xf')][_0x3a89('0x12')]);return _0x4bc82f(_0x41e72b['error'][_0x3a89('0x12')]);}else{logger['info'](_0x3a89('0x11'),_0x39dd0d,'request\x20sent');_0x4bc82f(_0x41e72b['result'][_0x3a89('0x12')]);}})[_0x3a89('0x13')](function(_0x462822){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x39dd0d,_0x462822);_0x20cf50(_0x462822);});});}
\ No newline at end of file
+var _0x92b3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0x356439,_0x578979){var _0x359eb6=function(_0x34b60e){while(--_0x34b60e){_0x356439['push'](_0x356439['shift']());}};_0x359eb6(++_0x578979);}(_0x92b3,0x83));var _0x392b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x92b3[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x392b('0x0'));var util=require('util');var moment=require(_0x392b('0x1'));var BPromise=require(_0x392b('0x2'));var rs=require(_0x392b('0x3'));var fs=require('fs');var Redis=require(_0x392b('0x4'));var db=require(_0x392b('0x5'))['db'];var utils=require(_0x392b('0x6'));var logger=require(_0x392b('0x7'))(_0x392b('0x8'));var config=require('../../config/environment');var jayson=require(_0x392b('0x9'));var client=jayson[_0x392b('0xa')][_0x392b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f0913,_0x1c0c66,_0x287b64){return new BPromise(function(_0xa98897,_0x2e13db){return client[_0x392b('0xc')](_0x2f0913,_0x287b64)['then'](function(_0xa145dd){logger['info'](_0x392b('0xd'),_0x1c0c66,'request\x20sent');logger[_0x392b('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1c0c66,_0x392b('0xf'),JSON[_0x392b('0x10')](_0xa145dd));if(_0xa145dd['error']){if(_0xa145dd['error']['code']===0x1f4){logger[_0x392b('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1c0c66,_0xa145dd[_0x392b('0x11')][_0x392b('0x12')]);return _0x2e13db(_0xa145dd[_0x392b('0x11')][_0x392b('0x12')]);}logger['error'](_0x392b('0xd'),_0x1c0c66,_0xa145dd['error'][_0x392b('0x12')]);return _0xa98897(_0xa145dd[_0x392b('0x11')][_0x392b('0x12')]);}else{logger[_0x392b('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1c0c66,'request\x20sent');_0xa98897(_0xa145dd[_0x392b('0x14')][_0x392b('0x12')]);}})[_0x392b('0x15')](function(_0x165613){logger['error'](_0x392b('0xd'),_0x1c0c66,_0x165613);_0x2e13db(_0x165613);});});}
\ No newline at end of file
index 9e2e6e5..93813b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf4c=['isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0xaf4c,0x1a9));var _0xcaf4=function(_0x388507,_0x2aa0f7){_0x388507=_0x388507-0x0;var _0x16d7cc=_0xaf4c[_0x388507];return _0x16d7cc;};'use strict';var multer=require(_0xcaf4('0x0'));var util=require(_0xcaf4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcaf4('0x2'));var router=express['Router']();var fs_extra=require(_0xcaf4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcaf4('0x4'));var config=require(_0xcaf4('0x5'));var controller=require('./intDynamics365Field.controller');router[_0xcaf4('0x6')]('/',auth[_0xcaf4('0x7')](),controller[_0xcaf4('0x8')]);router['get'](_0xcaf4('0x9'),auth[_0xcaf4('0x7')](),controller[_0xcaf4('0xa')]);router['post']('/',auth[_0xcaf4('0x7')](),controller[_0xcaf4('0xb')]);router['put'](_0xcaf4('0x9'),auth[_0xcaf4('0x7')](),controller[_0xcaf4('0xc')]);router[_0xcaf4('0xd')]('/:id',auth[_0xcaf4('0x7')](),controller[_0xcaf4('0xe')]);module[_0xcaf4('0xf')]=router;
\ No newline at end of file
+var _0xd33e=['isAuthenticated','index','/:id','put','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0xd33e,0x19c));var _0xed33=function(_0xab9630,_0xe19d9c){_0xab9630=_0xab9630-0x0;var _0x1567a3=_0xd33e[_0xab9630];return _0x1567a3;};'use strict';var multer=require(_0xed33('0x0'));var util=require('util');var path=require(_0xed33('0x1'));var timeout=require(_0xed33('0x2'));var express=require('express');var router=express[_0xed33('0x3')]();var fs_extra=require(_0xed33('0x4'));var auth=require(_0xed33('0x5'));var interaction=require(_0xed33('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xed33('0x7')]('/',auth[_0xed33('0x8')](),controller[_0xed33('0x9')]);router['get'](_0xed33('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xed33('0xb')](_0xed33('0xa'),auth[_0xed33('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 12ba71c..7dfdbaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe122=['STRING','sequelize','ENUM','variable','customVariable','picklist','string'];(function(_0x1814c3,_0x24e08e){var _0x8e2928=function(_0x302bfa){while(--_0x302bfa){_0x1814c3['push'](_0x1814c3['shift']());}};_0x8e2928(++_0x24e08e);}(_0xe122,0x190));var _0x2e12=function(_0x552dff,_0x6ec49e){_0x552dff=_0x552dff-0x0;var _0x327100=_0xe122[_0x552dff];return _0x327100;};'use strict';var Sequelize=require(_0x2e12('0x0'));module['exports']={'type':{'type':Sequelize[_0x2e12('0x1')]('string',_0x2e12('0x2'),_0x2e12('0x3'),'keyValue',_0x2e12('0x4')),'defaultValue':_0x2e12('0x5')},'content':{'type':Sequelize[_0x2e12('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2e12('0x1')](_0x2e12('0x5'),_0x2e12('0x2'),_0x2e12('0x3'))},'keyContent':{'type':Sequelize[_0x2e12('0x6')]},'idField':{'type':Sequelize[_0x2e12('0x6')]},'nameField':{'type':Sequelize[_0x2e12('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc850=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x747632,_0xfa6bf2){var _0x3c4499=function(_0x4b63ff){while(--_0x4b63ff){_0x747632['push'](_0x747632['shift']());}};_0x3c4499(++_0xfa6bf2);}(_0xc850,0x1cd));var _0x0c85=function(_0x5991f5,_0x654cfc){_0x5991f5=_0x5991f5-0x0;var _0x5a3913=_0xc850[_0x5991f5];return _0x5a3913;};'use strict';var Sequelize=require(_0x0c85('0x0'));module[_0x0c85('0x1')]={'type':{'type':Sequelize[_0x0c85('0x2')](_0x0c85('0x3'),_0x0c85('0x4'),_0x0c85('0x5'),_0x0c85('0x6'),_0x0c85('0x7')),'defaultValue':_0x0c85('0x3')},'content':{'type':Sequelize[_0x0c85('0x8')]},'key':{'type':Sequelize[_0x0c85('0x8')]},'keyType':{'type':Sequelize[_0x0c85('0x2')]('string',_0x0c85('0x4'),_0x0c85('0x5'))},'keyContent':{'type':Sequelize[_0x0c85('0x8')]},'idField':{'type':Sequelize[_0x0c85('0x8')]},'nameField':{'type':Sequelize[_0x0c85('0x8')]},'customField':{'type':Sequelize[_0x0c85('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0c85('0x8')]}};
\ No newline at end of file
index 0addc72..d3dfdcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d8=['set','Content-Range','apply','reject','save','update','then','end','stack','name','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','findAll','catch','show','params','include','options','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','offset','undefined','limit'];(function(_0xd45112,_0x68c8b4){var _0x2cddb8=function(_0x399d25){while(--_0x399d25){_0xd45112['push'](_0xd45112['shift']());}};_0x2cddb8(++_0x68c8b4);}(_0xd3d8,0x1a3));var _0x8d3d=function(_0x2e0586,_0x33c577){_0x2e0586=_0x2e0586-0x0;var _0x4e5089=_0xd3d8[_0x2e0586];return _0x4e5089;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d3d('0x0'));var zipdir=require(_0x8d3d('0x1'));var jsonpatch=require(_0x8d3d('0x2'));var rp=require(_0x8d3d('0x3'));var moment=require(_0x8d3d('0x4'));var BPromise=require(_0x8d3d('0x5'));var Mustache=require(_0x8d3d('0x6'));var util=require(_0x8d3d('0x7'));var path=require(_0x8d3d('0x8'));var sox=require(_0x8d3d('0x9'));var csv=require('to-csv');var ejs=require(_0x8d3d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d3d('0xb'));var squel=require(_0x8d3d('0xc'));var crypto=require('crypto');var jsforce=require(_0x8d3d('0xd'));var deskjs=require(_0x8d3d('0xe'));var toCsv=require(_0x8d3d('0xf'));var querystring=require(_0x8d3d('0x10'));var Papa=require(_0x8d3d('0x11'));var Redis=require(_0x8d3d('0x12'));var authService=require(_0x8d3d('0x13'));var qs=require(_0x8d3d('0x14'));var as=require(_0x8d3d('0x15'));var hardwareService=require(_0x8d3d('0x16'));var logger=require(_0x8d3d('0x17'))(_0x8d3d('0x18'));var utils=require(_0x8d3d('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x441e23,_0x4a357c){_0x4a357c=_0x4a357c||0xcc;return function(_0x4c2309){if(_0x4c2309){return _0x441e23[_0x8d3d('0x1a')](_0x4a357c);}return _0x441e23[_0x8d3d('0x1b')](_0x4a357c)['end']();};}function respondWithResult(_0x2aabd7,_0x101c7e){_0x101c7e=_0x101c7e||0xc8;return function(_0xf46e9d){if(_0xf46e9d){return _0x2aabd7[_0x8d3d('0x1b')](_0x101c7e)['json'](_0xf46e9d);}};}function respondWithFilteredResult(_0x485886,_0x23180f){return function(_0xa96633){if(_0xa96633){var _0x39724f=typeof _0x23180f[_0x8d3d('0x1c')]===_0x8d3d('0x1d')&&typeof _0x23180f[_0x8d3d('0x1e')]==='undefined';var _0x10b092=_0xa96633['count'];var _0x21b96c=_0x39724f?0x0:_0x23180f[_0x8d3d('0x1c')];var _0x508615=_0x39724f?_0xa96633['count']:_0x23180f[_0x8d3d('0x1c')]+_0x23180f[_0x8d3d('0x1e')];var _0x2f90b3;if(_0x508615>=_0x10b092){_0x508615=_0x10b092;_0x2f90b3=0xc8;}else{_0x2f90b3=0xce;}_0x485886[_0x8d3d('0x1b')](_0x2f90b3);return _0x485886[_0x8d3d('0x1f')](_0x8d3d('0x20'),_0x21b96c+'-'+_0x508615+'/'+_0x10b092)['json'](_0xa96633);}return null;};}function patchUpdates(_0x348e7c){return function(_0x4af1ae){try{jsonpatch[_0x8d3d('0x21')](_0x4af1ae,_0x348e7c,!![]);}catch(_0x56a1c7){return BPromise[_0x8d3d('0x22')](_0x56a1c7);}return _0x4af1ae[_0x8d3d('0x23')]();};}function saveUpdates(_0x2a15fd,_0x2391aa){return function(_0x1472b9){if(_0x1472b9){return _0x1472b9[_0x8d3d('0x24')](_0x2a15fd)[_0x8d3d('0x25')](function(_0x533db7){return _0x533db7;});}return null;};}function removeEntity(_0x2ef16e,_0x1e707){return function(_0x5b2c62){if(_0x5b2c62){return _0x5b2c62['destroy']()['then'](function(){_0x2ef16e[_0x8d3d('0x1b')](0xcc)[_0x8d3d('0x26')]();});}};}function handleEntityNotFound(_0x8df84,_0x11d66a){return function(_0x13f38d){if(!_0x13f38d){_0x8df84[_0x8d3d('0x1a')](0x194);}return _0x13f38d;};}function handleError(_0x5b072f,_0x16007a){_0x16007a=_0x16007a||0x1f4;return function(_0x409c57){logger['error'](_0x409c57[_0x8d3d('0x27')]);if(_0x409c57[_0x8d3d('0x28')]){delete _0x409c57[_0x8d3d('0x28')];}_0x5b072f[_0x8d3d('0x1b')](_0x16007a)['send'](_0x409c57);};}exports[_0x8d3d('0x29')]=function(_0x151019,_0x1aff9b){var _0x43d01d={},_0x1781be={},_0x4b0b4b={'count':0x0,'rows':[]};var _0x202e29=_['map'](db[_0x8d3d('0x2a')][_0x8d3d('0x2b')],function(_0x15700c){return{'name':_0x15700c[_0x8d3d('0x2c')],'type':_0x15700c[_0x8d3d('0x2d')][_0x8d3d('0x2e')]};});_0x1781be[_0x8d3d('0x2f')]=_['map'](_0x202e29,_0x8d3d('0x28'));_0x1781be[_0x8d3d('0x30')]=_[_0x8d3d('0x31')](_0x151019[_0x8d3d('0x30')]);_0x1781be[_0x8d3d('0x32')]=_['intersection'](_0x1781be[_0x8d3d('0x2f')],_0x1781be['query']);_0x43d01d['attributes']=_[_0x8d3d('0x33')](_0x1781be[_0x8d3d('0x2f')],qs[_0x8d3d('0x34')](_0x151019['query'][_0x8d3d('0x34')]));_0x43d01d[_0x8d3d('0x35')]=_0x43d01d[_0x8d3d('0x35')][_0x8d3d('0x36')]?_0x43d01d['attributes']:_0x1781be[_0x8d3d('0x2f')];if(!_0x151019[_0x8d3d('0x30')][_0x8d3d('0x37')](_0x8d3d('0x38'))){_0x43d01d['limit']=qs[_0x8d3d('0x1e')](_0x151019['query'][_0x8d3d('0x1e')]);_0x43d01d[_0x8d3d('0x1c')]=qs['offset'](_0x151019[_0x8d3d('0x30')]['offset']);}_0x43d01d[_0x8d3d('0x39')]=qs[_0x8d3d('0x3a')](_0x151019[_0x8d3d('0x30')][_0x8d3d('0x3a')]);_0x43d01d['where']=qs[_0x8d3d('0x32')](_[_0x8d3d('0x3b')](_0x151019[_0x8d3d('0x30')],_0x1781be['filters']),_0x202e29);if(_0x151019[_0x8d3d('0x30')][_0x8d3d('0x3c')]){_0x43d01d[_0x8d3d('0x3d')]=_[_0x8d3d('0x3e')](_0x43d01d['where'],{'$or':_['map'](_0x202e29,function(_0xc55f34){if(_0xc55f34[_0x8d3d('0x2d')]!==_0x8d3d('0x3f')){var _0x5a1da3={};_0x5a1da3[_0xc55f34[_0x8d3d('0x28')]]={'$like':'%'+_0x151019[_0x8d3d('0x30')][_0x8d3d('0x3c')]+'%'};return _0x5a1da3;}})});}_0x43d01d=_[_0x8d3d('0x3e')]({},_0x43d01d,_0x151019['options']);var _0x3a2509={'where':_0x43d01d['where']};return db[_0x8d3d('0x2a')]['count'](_0x3a2509)[_0x8d3d('0x25')](function(_0x2e973c){_0x4b0b4b[_0x8d3d('0x40')]=_0x2e973c;if(_0x151019[_0x8d3d('0x30')][_0x8d3d('0x41')]){_0x43d01d['include']=[{'all':!![]}];}return db[_0x8d3d('0x2a')][_0x8d3d('0x42')](_0x43d01d);})[_0x8d3d('0x25')](function(_0x972aab){_0x4b0b4b['rows']=_0x972aab;return _0x4b0b4b;})[_0x8d3d('0x25')](respondWithFilteredResult(_0x1aff9b,_0x43d01d))[_0x8d3d('0x43')](handleError(_0x1aff9b,null));};exports[_0x8d3d('0x44')]=function(_0x30dbba,_0x443ab6){var _0x4e718a={'raw':!![],'where':{'id':_0x30dbba[_0x8d3d('0x45')]['id']}},_0xf1cbbe={};_0xf1cbbe[_0x8d3d('0x2f')]=_['keys'](db[_0x8d3d('0x2a')][_0x8d3d('0x2b')]);_0xf1cbbe['query']=_['keys'](_0x30dbba['query']);_0xf1cbbe[_0x8d3d('0x32')]=_[_0x8d3d('0x33')](_0xf1cbbe[_0x8d3d('0x2f')],_0xf1cbbe[_0x8d3d('0x30')]);_0x4e718a[_0x8d3d('0x35')]=_[_0x8d3d('0x33')](_0xf1cbbe[_0x8d3d('0x2f')],qs['fields'](_0x30dbba['query'][_0x8d3d('0x34')]));_0x4e718a['attributes']=_0x4e718a['attributes'][_0x8d3d('0x36')]?_0x4e718a['attributes']:_0xf1cbbe[_0x8d3d('0x2f')];if(_0x30dbba[_0x8d3d('0x30')]['includeAll']){_0x4e718a[_0x8d3d('0x46')]=[{'all':!![]}];}_0x4e718a=_[_0x8d3d('0x3e')]({},_0x4e718a,_0x30dbba[_0x8d3d('0x47')]);return db[_0x8d3d('0x2a')]['find'](_0x4e718a)[_0x8d3d('0x25')](handleEntityNotFound(_0x443ab6,null))[_0x8d3d('0x25')](respondWithResult(_0x443ab6,null))[_0x8d3d('0x43')](handleError(_0x443ab6,null));};exports[_0x8d3d('0x48')]=function(_0x215020,_0x12bc16){return db['Dynamics365Field'][_0x8d3d('0x48')](_0x215020[_0x8d3d('0x49')],{})[_0x8d3d('0x25')](respondWithResult(_0x12bc16,0xc9))['catch'](handleError(_0x12bc16,null));};exports[_0x8d3d('0x24')]=function(_0xea84a2,_0x17e0ff){if(_0xea84a2[_0x8d3d('0x49')]['id']){delete _0xea84a2[_0x8d3d('0x49')]['id'];}return db[_0x8d3d('0x2a')][_0x8d3d('0x4a')]({'where':{'id':_0xea84a2[_0x8d3d('0x45')]['id']}})[_0x8d3d('0x25')](handleEntityNotFound(_0x17e0ff,null))[_0x8d3d('0x25')](saveUpdates(_0xea84a2[_0x8d3d('0x49')],null))[_0x8d3d('0x25')](respondWithResult(_0x17e0ff,null))[_0x8d3d('0x43')](handleError(_0x17e0ff,null));};exports['destroy']=function(_0x434924,_0x5a5dc2){return db[_0x8d3d('0x2a')][_0x8d3d('0x4a')]({'where':{'id':_0x434924[_0x8d3d('0x45')]['id']}})[_0x8d3d('0x25')](handleEntityNotFound(_0x5a5dc2,null))[_0x8d3d('0x25')](removeEntity(_0x5a5dc2,null))[_0x8d3d('0x43')](handleError(_0x5a5dc2,null));};
\ No newline at end of file
+var _0x635e=['findAll','rows','show','find','catch','create','body','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0x635e,0x1a6));var _0xe635=function(_0x4bd917,_0x34599c){_0x4bd917=_0x4bd917-0x0;var _0x3eb345=_0x635e[_0x4bd917];return _0x3eb345;};'use strict';var emlformat=require(_0xe635('0x0'));var rimraf=require(_0xe635('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe635('0x2'));var moment=require(_0xe635('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe635('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe635('0x5'));var csv=require(_0xe635('0x6'));var ejs=require(_0xe635('0x7'));var fs=require('fs');var fs_extra=require(_0xe635('0x8'));var _=require(_0xe635('0x9'));var squel=require(_0xe635('0xa'));var crypto=require(_0xe635('0xb'));var jsforce=require(_0xe635('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe635('0x6'));var querystring=require(_0xe635('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe635('0xe'));var qs=require(_0xe635('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe635('0x10'))(_0xe635('0x11'));var utils=require(_0xe635('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xe635('0x13'));var db=require(_0xe635('0x14'))['db'];function respondWithStatusCode(_0x2062ec,_0x10f5a4){_0x10f5a4=_0x10f5a4||0xcc;return function(_0x18d728){if(_0x18d728){return _0x2062ec['sendStatus'](_0x10f5a4);}return _0x2062ec['status'](_0x10f5a4)[_0xe635('0x15')]();};}function respondWithResult(_0x4c2619,_0x2a2dae){_0x2a2dae=_0x2a2dae||0xc8;return function(_0x216c53){if(_0x216c53){return _0x4c2619[_0xe635('0x16')](_0x2a2dae)[_0xe635('0x17')](_0x216c53);}};}function respondWithFilteredResult(_0x1e04ea,_0x2aa5ac){return function(_0x575ad9){if(_0x575ad9){var _0x252275=typeof _0x2aa5ac['offset']===_0xe635('0x18')&&typeof _0x2aa5ac[_0xe635('0x19')]===_0xe635('0x18');var _0xc5d7d9=_0x575ad9[_0xe635('0x1a')];var _0x127463=_0x252275?0x0:_0x2aa5ac[_0xe635('0x1b')];var _0x500456=_0x252275?_0x575ad9[_0xe635('0x1a')]:_0x2aa5ac[_0xe635('0x1b')]+_0x2aa5ac[_0xe635('0x19')];var _0x392fb1;if(_0x500456>=_0xc5d7d9){_0x500456=_0xc5d7d9;_0x392fb1=0xc8;}else{_0x392fb1=0xce;}_0x1e04ea[_0xe635('0x16')](_0x392fb1);return _0x1e04ea['set'](_0xe635('0x1c'),_0x127463+'-'+_0x500456+'/'+_0xc5d7d9)[_0xe635('0x17')](_0x575ad9);}return null;};}function patchUpdates(_0x305d02){return function(_0x496c45){try{jsonpatch['apply'](_0x496c45,_0x305d02,!![]);}catch(_0x919180){return BPromise['reject'](_0x919180);}return _0x496c45[_0xe635('0x1d')]();};}function saveUpdates(_0x438c4,_0x176886){return function(_0x158aeb){if(_0x158aeb){return _0x158aeb[_0xe635('0x1e')](_0x438c4)[_0xe635('0x1f')](function(_0xdadd63){return _0xdadd63;});}return null;};}function removeEntity(_0x16a0b1,_0x1cfeaa){return function(_0x3808ed){if(_0x3808ed){return _0x3808ed[_0xe635('0x20')]()['then'](function(){_0x16a0b1[_0xe635('0x16')](0xcc)[_0xe635('0x15')]();});}};}function handleEntityNotFound(_0xc3c2f2,_0x147c1f){return function(_0x4c925a){if(!_0x4c925a){_0xc3c2f2[_0xe635('0x21')](0x194);}return _0x4c925a;};}function handleError(_0x2fd40d,_0x42a083){_0x42a083=_0x42a083||0x1f4;return function(_0x2ec9be){logger[_0xe635('0x22')](_0x2ec9be[_0xe635('0x23')]);if(_0x2ec9be[_0xe635('0x24')]){delete _0x2ec9be[_0xe635('0x24')];}_0x2fd40d[_0xe635('0x16')](_0x42a083)[_0xe635('0x25')](_0x2ec9be);};}exports[_0xe635('0x26')]=function(_0x3951ce,_0x151664){var _0x17613d={},_0x4564e1={},_0x2334bb={'count':0x0,'rows':[]};var _0x3a0480=_['map'](db[_0xe635('0x27')][_0xe635('0x28')],function(_0x139824){return{'name':_0x139824[_0xe635('0x29')],'type':_0x139824['type'][_0xe635('0x2a')]};});_0x4564e1[_0xe635('0x2b')]=_[_0xe635('0x2c')](_0x3a0480,_0xe635('0x24'));_0x4564e1[_0xe635('0x2d')]=_[_0xe635('0x2e')](_0x3951ce[_0xe635('0x2d')]);_0x4564e1[_0xe635('0x2f')]=_[_0xe635('0x30')](_0x4564e1[_0xe635('0x2b')],_0x4564e1[_0xe635('0x2d')]);_0x17613d[_0xe635('0x31')]=_[_0xe635('0x30')](_0x4564e1[_0xe635('0x2b')],qs['fields'](_0x3951ce[_0xe635('0x2d')][_0xe635('0x32')]));_0x17613d['attributes']=_0x17613d[_0xe635('0x31')][_0xe635('0x33')]?_0x17613d[_0xe635('0x31')]:_0x4564e1['model'];if(!_0x3951ce['query'][_0xe635('0x34')](_0xe635('0x35'))){_0x17613d[_0xe635('0x19')]=qs['limit'](_0x3951ce['query'][_0xe635('0x19')]);_0x17613d[_0xe635('0x1b')]=qs[_0xe635('0x1b')](_0x3951ce[_0xe635('0x2d')][_0xe635('0x1b')]);}_0x17613d['order']=qs[_0xe635('0x36')](_0x3951ce[_0xe635('0x2d')][_0xe635('0x36')]);_0x17613d['where']=qs[_0xe635('0x2f')](_['pick'](_0x3951ce[_0xe635('0x2d')],_0x4564e1[_0xe635('0x2f')]),_0x3a0480);if(_0x3951ce[_0xe635('0x2d')][_0xe635('0x37')]){_0x17613d['where']=_[_0xe635('0x38')](_0x17613d[_0xe635('0x39')],{'$or':_['map'](_0x3a0480,function(_0x4800f0){if(_0x4800f0['type']!==_0xe635('0x3a')){var _0x2f0570={};_0x2f0570[_0x4800f0[_0xe635('0x24')]]={'$like':'%'+_0x3951ce[_0xe635('0x2d')]['filter']+'%'};return _0x2f0570;}})});}_0x17613d=_[_0xe635('0x38')]({},_0x17613d,_0x3951ce[_0xe635('0x3b')]);var _0x297c9d={'where':_0x17613d['where']};return db[_0xe635('0x27')][_0xe635('0x1a')](_0x297c9d)[_0xe635('0x1f')](function(_0x2392ca){_0x2334bb[_0xe635('0x1a')]=_0x2392ca;if(_0x3951ce[_0xe635('0x2d')][_0xe635('0x3c')]){_0x17613d['include']=[{'all':!![]}];}return db[_0xe635('0x27')][_0xe635('0x3d')](_0x17613d);})['then'](function(_0x576328){_0x2334bb[_0xe635('0x3e')]=_0x576328;return _0x2334bb;})[_0xe635('0x1f')](respondWithFilteredResult(_0x151664,_0x17613d))['catch'](handleError(_0x151664,null));};exports[_0xe635('0x3f')]=function(_0x2f83b5,_0x553cbf){var _0x1f2263={'raw':!![],'where':{'id':_0x2f83b5['params']['id']}},_0x24d42a={};_0x24d42a[_0xe635('0x2b')]=_[_0xe635('0x2e')](db[_0xe635('0x27')][_0xe635('0x28')]);_0x24d42a[_0xe635('0x2d')]=_['keys'](_0x2f83b5['query']);_0x24d42a[_0xe635('0x2f')]=_[_0xe635('0x30')](_0x24d42a[_0xe635('0x2b')],_0x24d42a[_0xe635('0x2d')]);_0x1f2263[_0xe635('0x31')]=_['intersection'](_0x24d42a[_0xe635('0x2b')],qs['fields'](_0x2f83b5[_0xe635('0x2d')][_0xe635('0x32')]));_0x1f2263[_0xe635('0x31')]=_0x1f2263[_0xe635('0x31')][_0xe635('0x33')]?_0x1f2263[_0xe635('0x31')]:_0x24d42a[_0xe635('0x2b')];if(_0x2f83b5[_0xe635('0x2d')][_0xe635('0x3c')]){_0x1f2263['include']=[{'all':!![]}];}_0x1f2263=_['merge']({},_0x1f2263,_0x2f83b5['options']);return db[_0xe635('0x27')][_0xe635('0x40')](_0x1f2263)[_0xe635('0x1f')](handleEntityNotFound(_0x553cbf,null))[_0xe635('0x1f')](respondWithResult(_0x553cbf,null))[_0xe635('0x41')](handleError(_0x553cbf,null));};exports['create']=function(_0x10bb28,_0x4dd721){return db[_0xe635('0x27')][_0xe635('0x42')](_0x10bb28[_0xe635('0x43')],{})[_0xe635('0x1f')](respondWithResult(_0x4dd721,0xc9))[_0xe635('0x41')](handleError(_0x4dd721,null));};exports[_0xe635('0x1e')]=function(_0x11ee1d,_0x5914a7){if(_0x11ee1d[_0xe635('0x43')]['id']){delete _0x11ee1d['body']['id'];}return db[_0xe635('0x27')][_0xe635('0x40')]({'where':{'id':_0x11ee1d[_0xe635('0x44')]['id']}})['then'](handleEntityNotFound(_0x5914a7,null))[_0xe635('0x1f')](saveUpdates(_0x11ee1d[_0xe635('0x43')],null))[_0xe635('0x1f')](respondWithResult(_0x5914a7,null))[_0xe635('0x41')](handleError(_0x5914a7,null));};exports['destroy']=function(_0x14dfd6,_0x337a4d){return db[_0xe635('0x27')][_0xe635('0x40')]({'where':{'id':_0x14dfd6[_0xe635('0x44')]['id']}})[_0xe635('0x1f')](handleEntityNotFound(_0x337a4d,null))[_0xe635('0x1f')](removeEntity(_0x337a4d,null))[_0xe635('0x41')](handleError(_0x337a4d,null));};
\ No newline at end of file
index c8e74d3..2690e22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54c1=['../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x43c569,_0x5363e0){var _0x38e1a=function(_0xc99398){while(--_0xc99398){_0x43c569['push'](_0x43c569['shift']());}};_0x38e1a(++_0x5363e0);}(_0x54c1,0x133));var _0x154c=function(_0x2e3aae,_0xb761a9){_0x2e3aae=_0x2e3aae-0x0;var _0x37dff1=_0x54c1[_0x2e3aae];return _0x37dff1;};'use strict';var _=require(_0x154c('0x0'));var util=require('util');var logger=require(_0x154c('0x1'))(_0x154c('0x2'));var moment=require(_0x154c('0x3'));var BPromise=require(_0x154c('0x4'));var rp=require(_0x154c('0x5'));var fs=require('fs');var path=require(_0x154c('0x6'));var rimraf=require(_0x154c('0x7'));var config=require(_0x154c('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x154c('0x9')]=function(_0x363735,_0x5c2f6b){return _0x363735[_0x154c('0xa')](_0x154c('0xb'),attributes,{'tableName':_0x154c('0xc'),'paranoid':![],'indexes':[{'name':_0x154c('0xd'),'fields':[_0x154c('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f65=['FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','int_dynamics365_fields','idField'];(function(_0x1a3a64,_0x5ab041){var _0x52afa1=function(_0x45b161){while(--_0x45b161){_0x1a3a64['push'](_0x1a3a64['shift']());}};_0x52afa1(++_0x5ab041);}(_0x9f65,0x11f));var _0x59f6=function(_0x514757,_0x3e9c1b){_0x514757=_0x514757-0x0;var _0x1f4e84=_0x9f65[_0x514757];return _0x1f4e84;};'use strict';var _=require('lodash');var util=require(_0x59f6('0x0'));var logger=require(_0x59f6('0x1'))(_0x59f6('0x2'));var moment=require(_0x59f6('0x3'));var BPromise=require(_0x59f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59f6('0x5'));var rimraf=require(_0x59f6('0x6'));var config=require(_0x59f6('0x7'));var attributes=require(_0x59f6('0x8'));module[_0x59f6('0x9')]=function(_0x44b139,_0x333944){return _0x44b139['define']('Dynamics365Field',attributes,{'tableName':_0x59f6('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x59f6('0xb'),_0x59f6('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d47a19a..d3ec80e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x959e=['http','request','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x11141a,_0x669621){var _0x1c08c5=function(_0xc19bad){while(--_0xc19bad){_0x11141a['push'](_0x11141a['shift']());}};_0x1c08c5(++_0x669621);}(_0x959e,0x1a9));var _0xe959=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0x959e[_0x1d8119];return _0x3e30f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe959('0x0'));var BPromise=require(_0xe959('0x1'));var rs=require(_0xe959('0x2'));var fs=require('fs');var Redis=require(_0xe959('0x3'));var db=require(_0xe959('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe959('0x5'));var config=require('../../config/environment');var jayson=require(_0xe959('0x6'));var client=jayson['client'][_0xe959('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55d0fb,_0x5c9022,_0x19d686){return new BPromise(function(_0x312dd7,_0x44709d){return client[_0xe959('0x8')](_0x55d0fb,_0x19d686)['then'](function(_0x516c9a){logger[_0xe959('0x9')](_0xe959('0xa'),_0x5c9022,'request\x20sent');logger['debug'](_0xe959('0xb'),_0x5c9022,_0xe959('0xc'),JSON['stringify'](_0x516c9a));if(_0x516c9a[_0xe959('0xd')]){if(_0x516c9a['error']['code']===0x1f4){logger[_0xe959('0xd')](_0xe959('0xa'),_0x5c9022,_0x516c9a[_0xe959('0xd')][_0xe959('0xe')]);return _0x44709d(_0x516c9a[_0xe959('0xd')]['message']);}logger[_0xe959('0xd')](_0xe959('0xa'),_0x5c9022,_0x516c9a[_0xe959('0xd')][_0xe959('0xe')]);return _0x312dd7(_0x516c9a[_0xe959('0xd')][_0xe959('0xe')]);}else{logger[_0xe959('0x9')]('Dynamics365Field,\x20%s,\x20%s',_0x5c9022,'request\x20sent');_0x312dd7(_0x516c9a['result'][_0xe959('0xe')]);}})[_0xe959('0xf')](function(_0x165c6c){logger[_0xe959('0xd')](_0xe959('0xa'),_0x5c9022,_0x165c6c);_0x44709d(_0x165c6c);});});}
\ No newline at end of file
+var _0x0e7d=['info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0e7d,0x1ec));var _0xd0e7=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x0e7d[_0x352e09];return _0x1b7094;};'use strict';var _=require('lodash');var util=require(_0xd0e7('0x0'));var moment=require(_0xd0e7('0x1'));var BPromise=require(_0xd0e7('0x2'));var rs=require(_0xd0e7('0x3'));var fs=require('fs');var Redis=require(_0xd0e7('0x4'));var db=require(_0xd0e7('0x5'))['db'];var utils=require(_0xd0e7('0x6'));var logger=require(_0xd0e7('0x7'))(_0xd0e7('0x8'));var config=require('../../config/environment');var jayson=require(_0xd0e7('0x9'));var client=jayson[_0xd0e7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7939af,_0xb1c9a7,_0x54c6f6){return new BPromise(function(_0x4e4022,_0x231272){return client['request'](_0x7939af,_0x54c6f6)[_0xd0e7('0xb')](function(_0x54043b){logger[_0xd0e7('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0xb1c9a7,_0xd0e7('0xd'));logger[_0xd0e7('0xe')](_0xd0e7('0xf'),_0xb1c9a7,_0xd0e7('0xd'),JSON[_0xd0e7('0x10')](_0x54043b));if(_0x54043b[_0xd0e7('0x11')]){if(_0x54043b['error'][_0xd0e7('0x12')]===0x1f4){logger[_0xd0e7('0x11')](_0xd0e7('0x13'),_0xb1c9a7,_0x54043b['error'][_0xd0e7('0x14')]);return _0x231272(_0x54043b[_0xd0e7('0x11')][_0xd0e7('0x14')]);}logger[_0xd0e7('0x11')](_0xd0e7('0x13'),_0xb1c9a7,_0x54043b['error'][_0xd0e7('0x14')]);return _0x4e4022(_0x54043b['error'][_0xd0e7('0x14')]);}else{logger[_0xd0e7('0xc')](_0xd0e7('0x13'),_0xb1c9a7,'request\x20sent');_0x4e4022(_0x54043b['result'][_0xd0e7('0x14')]);}})['catch'](function(_0x2b5822){logger[_0xd0e7('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xb1c9a7,_0x2b5822);_0x231272(_0x2b5822);});});}
\ No newline at end of file
index 48e676f..8da8e0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33e5=['put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','post','create','/:id/configurations'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x33e5,0x1bd));var _0x533e=function(_0x562ba3,_0x44f87f){_0x562ba3=_0x562ba3-0x0;var _0x17fc41=_0x33e5[_0x562ba3];return _0x17fc41;};'use strict';var multer=require(_0x533e('0x0'));var util=require('util');var path=require(_0x533e('0x1'));var timeout=require('connect-timeout');var express=require(_0x533e('0x2'));var router=express[_0x533e('0x3')]();var fs_extra=require(_0x533e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x533e('0x5'));var config=require(_0x533e('0x6'));var controller=require(_0x533e('0x7'));router[_0x533e('0x8')]('/',auth[_0x533e('0x9')](),controller[_0x533e('0xa')]);router[_0x533e('0x8')](_0x533e('0xb'),auth[_0x533e('0x9')](),controller['show']);router[_0x533e('0x8')]('/:id/configurations',auth[_0x533e('0x9')](),controller[_0x533e('0xc')]);router[_0x533e('0x8')](_0x533e('0xd'),auth[_0x533e('0x9')](),controller['getFields']);router[_0x533e('0xe')]('/',auth['isAuthenticated'](),controller[_0x533e('0xf')]);router['post'](_0x533e('0x10'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x533e('0x11')](_0x533e('0xb'),auth[_0x533e('0x9')](),controller[_0x533e('0x12')]);router[_0x533e('0x13')](_0x533e('0xb'),auth[_0x533e('0x9')](),controller[_0x533e('0x14')]);module[_0x533e('0x15')]=router;
\ No newline at end of file
+var _0x1605=['create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x189d45,_0x13e25b){var _0x4c34ef=function(_0x2f052b){while(--_0x2f052b){_0x189d45['push'](_0x189d45['shift']());}};_0x4c34ef(++_0x13e25b);}(_0x1605,0x8b));var _0x5160=function(_0x51f9d8,_0x55b18f){_0x51f9d8=_0x51f9d8-0x0;var _0x2c0749=_0x1605[_0x51f9d8];return _0x2c0749;};'use strict';var multer=require(_0x5160('0x0'));var util=require('util');var path=require(_0x5160('0x1'));var timeout=require(_0x5160('0x2'));var express=require(_0x5160('0x3'));var router=express[_0x5160('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5160('0x5'));var config=require(_0x5160('0x6'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x5160('0x7')](),controller[_0x5160('0x8')]);router[_0x5160('0x9')]('/:id',auth[_0x5160('0x7')](),controller[_0x5160('0xa')]);router[_0x5160('0x9')](_0x5160('0xb'),auth['isAuthenticated'](),controller[_0x5160('0xc')]);router['get'](_0x5160('0xd'),auth[_0x5160('0x7')](),controller['getFields']);router[_0x5160('0xe')]('/',auth['isAuthenticated'](),controller[_0x5160('0xf')]);router[_0x5160('0xe')](_0x5160('0xb'),auth[_0x5160('0x7')](),controller['addConfiguration']);router[_0x5160('0x10')](_0x5160('0x11'),auth['isAuthenticated'](),controller[_0x5160('0x12')]);router[_0x5160('0x13')]('/:id',auth[_0x5160('0x7')](),controller[_0x5160('0x14')]);module[_0x5160('0x15')]=router;
\ No newline at end of file
index 3526f62..920c0cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6343=['STRING','remoteUri'];(function(_0xc67f42,_0x3ad295){var _0x794f50=function(_0x4f9c1e){while(--_0x4f9c1e){_0xc67f42['push'](_0xc67f42['shift']());}};_0x794f50(++_0x3ad295);}(_0x6343,0x168));var _0x3634=function(_0x5bccee,_0xe4f39e){_0x5bccee=_0x5bccee-0x0;var _0x5011aa=_0x6343[_0x5bccee];return _0x5011aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3634('0x0')]},'description':{'type':Sequelize[_0x3634('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3634('0x1')},'serverUrl':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x47c5=['username','remoteUri','sequelize','exports','STRING'];(function(_0x412342,_0x180734){var _0x3e62cb=function(_0x501fc6){while(--_0x501fc6){_0x412342['push'](_0x412342['shift']());}};_0x3e62cb(++_0x180734);}(_0x47c5,0x165));var _0x547c=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0x47c5[_0xf10840];return _0x1fdf7e;};'use strict';var Sequelize=require(_0x547c('0x0'));module[_0x547c('0x1')]={'name':{'type':Sequelize[_0x547c('0x2')]},'description':{'type':Sequelize[_0x547c('0x2')]},'username':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 81bad45..058d28d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0490=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','slice','lastIndexOf','GET','api/v2/ticket_fields','format','Basic\x20%s','%s:X','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0490,0x147));var _0x0049=function(_0x37cb6f,_0x2dba54){_0x37cb6f=_0x37cb6f-0x0;var _0x12b6d=_0x0490[_0x37cb6f];return _0x12b6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0049('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0049('0x1'));var Mustache=require(_0x0049('0x2'));var util=require(_0x0049('0x3'));var path=require(_0x0049('0x4'));var sox=require(_0x0049('0x5'));var csv=require(_0x0049('0x6'));var ejs=require(_0x0049('0x7'));var fs=require('fs');var fs_extra=require(_0x0049('0x8'));var _=require(_0x0049('0x9'));var squel=require('squel');var crypto=require(_0x0049('0xa'));var jsforce=require(_0x0049('0xb'));var deskjs=require(_0x0049('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0049('0xd'));var Papa=require(_0x0049('0xe'));var Redis=require(_0x0049('0xf'));var authService=require(_0x0049('0x10'));var qs=require(_0x0049('0x11'));var as=require(_0x0049('0x12'));var hardwareService=require(_0x0049('0x13'));var logger=require(_0x0049('0x14'))(_0x0049('0x15'));var utils=require('../../config/utils');var config=require(_0x0049('0x16'));var licenseUtil=require(_0x0049('0x17'));var db=require(_0x0049('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x547be9,_0x3cf392){_0x3cf392=_0x3cf392||0xcc;return function(_0x3fbc4e){if(_0x3fbc4e){return _0x547be9[_0x0049('0x19')](_0x3cf392);}return _0x547be9[_0x0049('0x1a')](_0x3cf392)[_0x0049('0x1b')]();};}function respondWithResult(_0x5934fc,_0x3aabfb){_0x3aabfb=_0x3aabfb||0xc8;return function(_0x210df0){if(_0x210df0){return _0x5934fc['status'](_0x3aabfb)[_0x0049('0x1c')](_0x210df0);}};}function respondWithFilteredResult(_0x2aace1,_0x2d6b06){return function(_0x1a62aa){if(_0x1a62aa){var _0x5adcf2=typeof _0x2d6b06['offset']===_0x0049('0x1d')&&typeof _0x2d6b06[_0x0049('0x1e')]===_0x0049('0x1d');var _0x426251=_0x1a62aa[_0x0049('0x1f')];var _0x4592ad=_0x5adcf2?0x0:_0x2d6b06[_0x0049('0x20')];var _0x21691=_0x5adcf2?_0x1a62aa[_0x0049('0x1f')]:_0x2d6b06[_0x0049('0x20')]+_0x2d6b06['limit'];var _0x57dd61;if(_0x21691>=_0x426251){_0x21691=_0x426251;_0x57dd61=0xc8;}else{_0x57dd61=0xce;}_0x2aace1[_0x0049('0x1a')](_0x57dd61);return _0x2aace1['set'](_0x0049('0x21'),_0x4592ad+'-'+_0x21691+'/'+_0x426251)[_0x0049('0x1c')](_0x1a62aa);}return null;};}function patchUpdates(_0x2a5ec3){return function(_0x996fa5){try{jsonpatch[_0x0049('0x22')](_0x996fa5,_0x2a5ec3,!![]);}catch(_0x4c1507){return BPromise[_0x0049('0x23')](_0x4c1507);}return _0x996fa5[_0x0049('0x24')]();};}function saveUpdates(_0x49c00b,_0x2170d2){return function(_0x1935d1){if(_0x1935d1){return _0x1935d1[_0x0049('0x25')](_0x49c00b)[_0x0049('0x26')](function(_0x91d727){return _0x91d727;});}return null;};}function removeEntity(_0x2e9f44,_0x223c9c){return function(_0x457bb3){if(_0x457bb3){return _0x457bb3[_0x0049('0x27')]()[_0x0049('0x26')](function(){_0x2e9f44[_0x0049('0x1a')](0xcc)[_0x0049('0x1b')]();});}};}function handleEntityNotFound(_0x47b0c4,_0x217a12){return function(_0x2813d2){if(!_0x2813d2){_0x47b0c4[_0x0049('0x19')](0x194);}return _0x2813d2;};}function handleError(_0x118bc0,_0x435789){_0x435789=_0x435789||0x1f4;return function(_0x48b588){logger[_0x0049('0x28')](_0x48b588['stack']);if(_0x48b588[_0x0049('0x29')]){delete _0x48b588[_0x0049('0x29')];}_0x118bc0[_0x0049('0x1a')](_0x435789)[_0x0049('0x2a')](_0x48b588);};}exports['index']=function(_0x305623,_0x402774){var _0x2407d8={},_0x2b8715={},_0x414029={'count':0x0,'rows':[]};var _0x5e59be=_[_0x0049('0x2b')](db[_0x0049('0x2c')][_0x0049('0x2d')],function(_0x4bd71c){return{'name':_0x4bd71c[_0x0049('0x2e')],'type':_0x4bd71c[_0x0049('0x2f')][_0x0049('0x30')]};});_0x2b8715[_0x0049('0x31')]=_['map'](_0x5e59be,_0x0049('0x29'));_0x2b8715[_0x0049('0x32')]=_['keys'](_0x305623[_0x0049('0x32')]);_0x2b8715[_0x0049('0x33')]=_['intersection'](_0x2b8715[_0x0049('0x31')],_0x2b8715[_0x0049('0x32')]);_0x2407d8[_0x0049('0x34')]=_[_0x0049('0x35')](_0x2b8715[_0x0049('0x31')],qs['fields'](_0x305623[_0x0049('0x32')][_0x0049('0x36')]));_0x2407d8[_0x0049('0x34')]=_0x2407d8[_0x0049('0x34')][_0x0049('0x37')]?_0x2407d8['attributes']:_0x2b8715[_0x0049('0x31')];if(!_0x305623['query'][_0x0049('0x38')](_0x0049('0x39'))){_0x2407d8[_0x0049('0x1e')]=qs['limit'](_0x305623[_0x0049('0x32')]['limit']);_0x2407d8[_0x0049('0x20')]=qs[_0x0049('0x20')](_0x305623[_0x0049('0x32')]['offset']);}_0x2407d8[_0x0049('0x3a')]=qs[_0x0049('0x3b')](_0x305623[_0x0049('0x32')][_0x0049('0x3b')]);_0x2407d8[_0x0049('0x3c')]=qs[_0x0049('0x33')](_['pick'](_0x305623[_0x0049('0x32')],_0x2b8715[_0x0049('0x33')]),_0x5e59be);if(_0x305623['query']['filter']){_0x2407d8[_0x0049('0x3c')]=_[_0x0049('0x3d')](_0x2407d8[_0x0049('0x3c')],{'$or':_[_0x0049('0x2b')](_0x5e59be,function(_0x1f35e7){if(_0x1f35e7[_0x0049('0x2f')]!==_0x0049('0x3e')){var _0x267d8a={};_0x267d8a[_0x1f35e7['name']]={'$like':'%'+_0x305623[_0x0049('0x32')][_0x0049('0x3f')]+'%'};return _0x267d8a;}})});}_0x2407d8=_[_0x0049('0x3d')]({},_0x2407d8,_0x305623[_0x0049('0x40')]);var _0xe8a86f={'where':_0x2407d8[_0x0049('0x3c')]};return db[_0x0049('0x2c')][_0x0049('0x1f')](_0xe8a86f)['then'](function(_0x2397aa){_0x414029[_0x0049('0x1f')]=_0x2397aa;if(_0x305623[_0x0049('0x32')][_0x0049('0x41')]){_0x2407d8[_0x0049('0x42')]=[{'all':!![]}];}return db[_0x0049('0x2c')][_0x0049('0x43')](_0x2407d8);})[_0x0049('0x26')](function(_0x469bb1){_0x414029[_0x0049('0x44')]=_0x469bb1;return _0x414029;})[_0x0049('0x26')](respondWithFilteredResult(_0x402774,_0x2407d8))[_0x0049('0x45')](handleError(_0x402774,null));};exports[_0x0049('0x46')]=function(_0x4ebc42,_0x22e083){var _0x2818dd={'raw':![],'where':{'id':_0x4ebc42['params']['id']}},_0x36a2fc={};_0x36a2fc['model']=_[_0x0049('0x47')](db['FreshdeskAccount'][_0x0049('0x2d')]);_0x36a2fc[_0x0049('0x32')]=_[_0x0049('0x47')](_0x4ebc42[_0x0049('0x32')]);_0x36a2fc[_0x0049('0x33')]=_[_0x0049('0x35')](_0x36a2fc[_0x0049('0x31')],_0x36a2fc[_0x0049('0x32')]);_0x2818dd['attributes']=_['intersection'](_0x36a2fc['model'],qs[_0x0049('0x36')](_0x4ebc42[_0x0049('0x32')][_0x0049('0x36')]));_0x2818dd['attributes']=_0x2818dd[_0x0049('0x34')][_0x0049('0x37')]?_0x2818dd[_0x0049('0x34')]:_0x36a2fc['model'];if(_0x4ebc42['query']['includeAll']){_0x2818dd[_0x0049('0x42')]=[{'all':!![]}];}_0x2818dd=_['merge']({},_0x2818dd,_0x4ebc42['options']);return db[_0x0049('0x2c')][_0x0049('0x48')](_0x2818dd)[_0x0049('0x26')](handleEntityNotFound(_0x22e083,null))[_0x0049('0x26')](respondWithResult(_0x22e083,null))[_0x0049('0x45')](handleError(_0x22e083,null));};exports['create']=function(_0xa60a2b,_0x2862bf){return db[_0x0049('0x2c')][_0x0049('0x49')](_0xa60a2b[_0x0049('0x4a')],{})[_0x0049('0x26')](respondWithResult(_0x2862bf,0xc9))['catch'](handleError(_0x2862bf,null));};exports[_0x0049('0x25')]=function(_0x5e9087,_0x36cc55){if(_0x5e9087['body']['id']){delete _0x5e9087[_0x0049('0x4a')]['id'];}return db[_0x0049('0x2c')][_0x0049('0x48')]({'where':{'id':_0x5e9087[_0x0049('0x4b')]['id']}})[_0x0049('0x26')](handleEntityNotFound(_0x36cc55,null))['then'](saveUpdates(_0x5e9087[_0x0049('0x4a')],null))[_0x0049('0x26')](respondWithResult(_0x36cc55,null))[_0x0049('0x45')](handleError(_0x36cc55,null));};exports[_0x0049('0x27')]=function(_0x1cd1dc,_0x152574){return db['FreshdeskAccount'][_0x0049('0x48')]({'where':{'id':_0x1cd1dc['params']['id']}})[_0x0049('0x26')](handleEntityNotFound(_0x152574,null))[_0x0049('0x26')](removeEntity(_0x152574,null))['catch'](handleError(_0x152574,null));};exports[_0x0049('0x4c')]=function(_0x277d37,_0x7f60ed,_0x396ce8){var _0x31bce1={};var _0x15e568={};var _0x23a6fb;var _0x528824;return db['FreshdeskAccount'][_0x0049('0x4d')]({'where':{'id':_0x277d37[_0x0049('0x4b')]['id']}})[_0x0049('0x26')](handleEntityNotFound(_0x7f60ed,null))[_0x0049('0x26')](function(_0x4e4128){if(_0x4e4128){_0x23a6fb=_0x4e4128;_0x15e568[_0x0049('0x31')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x15e568['query']=_[_0x0049('0x47')](_0x277d37[_0x0049('0x32')]);_0x15e568[_0x0049('0x33')]=_[_0x0049('0x35')](_0x15e568[_0x0049('0x31')],_0x15e568['query']);_0x31bce1['attributes']=_[_0x0049('0x35')](_0x15e568[_0x0049('0x31')],qs[_0x0049('0x36')](_0x277d37[_0x0049('0x32')]['fields']));_0x31bce1[_0x0049('0x34')]=_0x31bce1[_0x0049('0x34')][_0x0049('0x37')]?_0x31bce1[_0x0049('0x34')]:_0x15e568[_0x0049('0x31')];_0x31bce1[_0x0049('0x3a')]=qs['sort'](_0x277d37[_0x0049('0x32')][_0x0049('0x3b')]);_0x31bce1['where']=qs[_0x0049('0x33')](_[_0x0049('0x4e')](_0x277d37['query'],_0x15e568['filters']));if(_0x277d37[_0x0049('0x32')][_0x0049('0x3f')]){_0x31bce1[_0x0049('0x3c')]=_[_0x0049('0x3d')](_0x31bce1['where'],{'$or':_['map'](_0x31bce1[_0x0049('0x34')],function(_0x27e9dd){var _0x3bc915={};_0x3bc915[_0x27e9dd]={'$like':'%'+_0x277d37[_0x0049('0x32')][_0x0049('0x3f')]+'%'};return _0x3bc915;})});}_0x31bce1=_[_0x0049('0x3d')]({},_0x31bce1,_0x277d37[_0x0049('0x40')]);return _0x23a6fb[_0x0049('0x4c')](_0x31bce1);}})[_0x0049('0x26')](function(_0x5b72b6){if(_0x5b72b6){_0x528824=_0x5b72b6[_0x0049('0x37')];if(!_0x277d37['query']['hasOwnProperty'](_0x0049('0x39'))){_0x31bce1[_0x0049('0x1e')]=qs[_0x0049('0x1e')](_0x277d37[_0x0049('0x32')]['limit']);_0x31bce1[_0x0049('0x20')]=qs[_0x0049('0x20')](_0x277d37[_0x0049('0x32')][_0x0049('0x20')]);}return _0x23a6fb['getConfigurations'](_0x31bce1);}})[_0x0049('0x26')](function(_0x137c28){if(_0x137c28){return _0x137c28?{'count':_0x528824,'rows':_0x137c28}:null;}})['then'](respondWithResult(_0x7f60ed,null))[_0x0049('0x45')](handleError(_0x7f60ed,null));};exports[_0x0049('0x4f')]=function(_0x38bb14,_0x119482,_0x4ce21f){if(_0x38bb14[_0x0049('0x4a')]['id']){delete _0x38bb14['body']['id'];}return db[_0x0049('0x2c')]['findOne']({'where':{'id':_0x38bb14['params']['id']}})['then'](handleEntityNotFound(_0x119482,null))[_0x0049('0x26')](function(_0x342e02){if(_0x342e02){_0x38bb14[_0x0049('0x4a')][_0x0049('0x50')]=_0x342e02['id'];_0x38bb14[_0x0049('0x4a')][_0x0049('0x51')]=integrations[_0x0049('0x52')](_0x38bb14[_0x0049('0x4a')][_0x0049('0x53')],_0x38bb14[_0x0049('0x4a')][_0x0049('0x2f')]);_0x38bb14[_0x0049('0x4a')][_0x0049('0x54')]=integrations[_0x0049('0x55')](_0x38bb14[_0x0049('0x4a')][_0x0049('0x53')],_0x38bb14[_0x0049('0x4a')][_0x0049('0x2f')]);return db['FreshdeskConfiguration'][_0x0049('0x49')](_0x38bb14[_0x0049('0x4a')],{'include':[{'model':db['FreshdeskField'],'as':_0x0049('0x51')},{'model':db[_0x0049('0x56')],'as':'Descriptions'}]});}return null;})[_0x0049('0x26')](respondWithResult(_0x119482,null))[_0x0049('0x45')](handleError(_0x119482,null));};exports['getFields']=function(_0x523833,_0x500816,_0x14db4a){var _0x539493='';return db[_0x0049('0x2c')][_0x0049('0x4d')]({'where':{'id':_0x523833[_0x0049('0x4b')]['id']},'attributes':['id',_0x0049('0x57'),'apiKey']})['then'](handleEntityNotFound(_0x500816,null))[_0x0049('0x26')](function(_0x3e45c6){if(_0x3e45c6){_0x539493=_0x3e45c6[_0x0049('0x57')];var _0x5035dd=_0x539493[_0x0049('0x58')](-0x1);if(_0x5035dd==='/'){_0x539493=_0x539493['substring'](0x0,_0x539493[_0x0049('0x59')](_0x5035dd));}return rp({'method':_0x0049('0x5a'),'uri':util['format']('%s/%s',_0x539493,_0x0049('0x5b')),'headers':{'Authorization':util[_0x0049('0x5c')](_0x0049('0x5d'),new Buffer(util[_0x0049('0x5c')](_0x0049('0x5e'),_0x3e45c6['apiKey']))['toString']('base64'))},'json':!![]});}})['then'](function(_0x58da32){if(_0x58da32){var _0x1d66c0=[_0x0049('0x5f'),_0x0049('0x60'),_0x0049('0x61'),_0x0049('0x62'),_0x0049('0x1a'),_0x0049('0x63'),_0x0049('0x64'),_0x0049('0x65'),_0x0049('0x66'),_0x0049('0x64'),_0x0049('0x67')];_[_0x0049('0x68')](_0x58da32,function(_0x5bc1af){return _0x1d66c0[_0x0049('0x69')](_0x5bc1af[_0x0049('0x29')])||!_0x5bc1af['default']&&_0x5bc1af['type']!=='custom_text'&&_0x5bc1af[_0x0049('0x2f')]!=='custom_dropdown';});return{'count':_0x58da32[_0x0049('0x37')],'rows':_[_0x0049('0x2b')](_0x58da32,function(_0x56b1c6){return{'id':_0x56b1c6[_0x0049('0x29')],'name':_0x56b1c6[_0x0049('0x6a')],'custom':!_0x56b1c6[_0x0049('0x6b')],'options':_0x56b1c6[_0x0049('0x6c')]?_[_0x0049('0x2b')](_0x56b1c6[_0x0049('0x6c')],function(_0x952a73){return{'name':_[_0x0049('0x6d')](_0x952a73),'value':_0x952a73};}):[]};})};}})['then'](respondWithResult(_0x500816,null))['catch'](function(_0x2ded0c){var _0x442bb0=_0x523833[_0x0049('0x32')][_0x0049('0x6e')]?0x1f4:_0x2ded0c[_0x0049('0x6f')]||0x1f4;logger[_0x0049('0x28')](_0x0049('0x70'),_0x0049('0x71'),_0x442bb0,JSON[_0x0049('0x72')](_0x2ded0c));delete _0x2ded0c[_0x0049('0x29')];if(_0x442bb0===0x191){_0x442bb0=0x190;}_0x500816['status'](_0x442bb0)['send'](_0x523833['query'][_0x0049('0x6e')]?{'message':_0x0049('0x73'),'statusCode':_0x2ded0c[_0x0049('0x6f')]}:_0x2ded0c);});};
\ No newline at end of file
+var _0x3d7f=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','findOne','order','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','name','send','map','FreshdeskAccount','rawAttributes','fieldName','type','key'];(function(_0x5e69af,_0x29c591){var _0x5df5c2=function(_0x4abae9){while(--_0x4abae9){_0x5e69af['push'](_0x5e69af['shift']());}};_0x5df5c2(++_0x29c591);}(_0x3d7f,0x1a1));var _0xf3d7=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x3d7f[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0xf3d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3d7('0x2'));var moment=require(_0xf3d7('0x3'));var BPromise=require(_0xf3d7('0x4'));var Mustache=require(_0xf3d7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf3d7('0x6'));var csv=require(_0xf3d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3d7('0x8'));var squel=require(_0xf3d7('0x9'));var crypto=require(_0xf3d7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf3d7('0xb'));var toCsv=require(_0xf3d7('0x7'));var querystring=require(_0xf3d7('0xc'));var Papa=require(_0xf3d7('0xd'));var Redis=require(_0xf3d7('0xe'));var authService=require(_0xf3d7('0xf'));var qs=require(_0xf3d7('0x10'));var as=require(_0xf3d7('0x11'));var hardwareService=require(_0xf3d7('0x12'));var logger=require(_0xf3d7('0x13'))(_0xf3d7('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3d7('0x15'));var db=require(_0xf3d7('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x161613,_0xecd54c){_0xecd54c=_0xecd54c||0xcc;return function(_0x42f319){if(_0x42f319){return _0x161613['sendStatus'](_0xecd54c);}return _0x161613[_0xf3d7('0x17')](_0xecd54c)[_0xf3d7('0x18')]();};}function respondWithResult(_0x1a895a,_0x14b5d3){_0x14b5d3=_0x14b5d3||0xc8;return function(_0x1cdb40){if(_0x1cdb40){return _0x1a895a[_0xf3d7('0x17')](_0x14b5d3)['json'](_0x1cdb40);}};}function respondWithFilteredResult(_0x415a3f,_0x24e584){return function(_0x305b5c){if(_0x305b5c){var _0x18e8a2=typeof _0x24e584[_0xf3d7('0x19')]===_0xf3d7('0x1a')&&typeof _0x24e584[_0xf3d7('0x1b')]==='undefined';var _0xcf7523=_0x305b5c[_0xf3d7('0x1c')];var _0x2b4d32=_0x18e8a2?0x0:_0x24e584[_0xf3d7('0x19')];var _0xd3c306=_0x18e8a2?_0x305b5c[_0xf3d7('0x1c')]:_0x24e584['offset']+_0x24e584[_0xf3d7('0x1b')];var _0x3f387c;if(_0xd3c306>=_0xcf7523){_0xd3c306=_0xcf7523;_0x3f387c=0xc8;}else{_0x3f387c=0xce;}_0x415a3f[_0xf3d7('0x17')](_0x3f387c);return _0x415a3f[_0xf3d7('0x1d')](_0xf3d7('0x1e'),_0x2b4d32+'-'+_0xd3c306+'/'+_0xcf7523)[_0xf3d7('0x1f')](_0x305b5c);}return null;};}function patchUpdates(_0x4b4fda){return function(_0x41f70d){try{jsonpatch[_0xf3d7('0x20')](_0x41f70d,_0x4b4fda,!![]);}catch(_0x11ac3d){return BPromise[_0xf3d7('0x21')](_0x11ac3d);}return _0x41f70d['save']();};}function saveUpdates(_0x325ca5,_0x1c2a31){return function(_0x24f50e){if(_0x24f50e){return _0x24f50e[_0xf3d7('0x22')](_0x325ca5)[_0xf3d7('0x23')](function(_0x67ad16){return _0x67ad16;});}return null;};}function removeEntity(_0x573d5e,_0x3943f7){return function(_0x6043a4){if(_0x6043a4){return _0x6043a4[_0xf3d7('0x24')]()[_0xf3d7('0x23')](function(){_0x573d5e[_0xf3d7('0x17')](0xcc)[_0xf3d7('0x18')]();});}};}function handleEntityNotFound(_0x1f3812,_0x4b5b39){return function(_0x3ca4d9){if(!_0x3ca4d9){_0x1f3812[_0xf3d7('0x25')](0x194);}return _0x3ca4d9;};}function handleError(_0x968040,_0x4db9d4){_0x4db9d4=_0x4db9d4||0x1f4;return function(_0x4c107e){logger[_0xf3d7('0x26')](_0x4c107e['stack']);if(_0x4c107e[_0xf3d7('0x27')]){delete _0x4c107e['name'];}_0x968040[_0xf3d7('0x17')](_0x4db9d4)[_0xf3d7('0x28')](_0x4c107e);};}exports['index']=function(_0x1ee67e,_0x255951){var _0x82b242={},_0x42364a={},_0x46613e={'count':0x0,'rows':[]};var _0x35f1d8=_[_0xf3d7('0x29')](db[_0xf3d7('0x2a')][_0xf3d7('0x2b')],function(_0xc05c1){return{'name':_0xc05c1[_0xf3d7('0x2c')],'type':_0xc05c1[_0xf3d7('0x2d')][_0xf3d7('0x2e')]};});_0x42364a[_0xf3d7('0x2f')]=_[_0xf3d7('0x29')](_0x35f1d8,_0xf3d7('0x27'));_0x42364a[_0xf3d7('0x30')]=_[_0xf3d7('0x31')](_0x1ee67e[_0xf3d7('0x30')]);_0x42364a[_0xf3d7('0x32')]=_['intersection'](_0x42364a[_0xf3d7('0x2f')],_0x42364a[_0xf3d7('0x30')]);_0x82b242[_0xf3d7('0x33')]=_[_0xf3d7('0x34')](_0x42364a[_0xf3d7('0x2f')],qs[_0xf3d7('0x35')](_0x1ee67e['query'][_0xf3d7('0x35')]));_0x82b242[_0xf3d7('0x33')]=_0x82b242[_0xf3d7('0x33')][_0xf3d7('0x36')]?_0x82b242['attributes']:_0x42364a[_0xf3d7('0x2f')];if(!_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x37')](_0xf3d7('0x38'))){_0x82b242['limit']=qs[_0xf3d7('0x1b')](_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x1b')]);_0x82b242[_0xf3d7('0x19')]=qs[_0xf3d7('0x19')](_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x19')]);}_0x82b242['order']=qs[_0xf3d7('0x39')](_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x39')]);_0x82b242[_0xf3d7('0x3a')]=qs[_0xf3d7('0x32')](_[_0xf3d7('0x3b')](_0x1ee67e['query'],_0x42364a['filters']),_0x35f1d8);if(_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x3c')]){_0x82b242[_0xf3d7('0x3a')]=_[_0xf3d7('0x3d')](_0x82b242[_0xf3d7('0x3a')],{'$or':_[_0xf3d7('0x29')](_0x35f1d8,function(_0x420839){if(_0x420839['type']!==_0xf3d7('0x3e')){var _0x2d83d8={};_0x2d83d8[_0x420839[_0xf3d7('0x27')]]={'$like':'%'+_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x3c')]+'%'};return _0x2d83d8;}})});}_0x82b242=_['merge']({},_0x82b242,_0x1ee67e[_0xf3d7('0x3f')]);var _0x380a44={'where':_0x82b242[_0xf3d7('0x3a')]};return db['FreshdeskAccount'][_0xf3d7('0x1c')](_0x380a44)[_0xf3d7('0x23')](function(_0x34df7f){_0x46613e['count']=_0x34df7f;if(_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x40')]){_0x82b242[_0xf3d7('0x41')]=[{'all':!![]}];}return db[_0xf3d7('0x2a')][_0xf3d7('0x42')](_0x82b242);})[_0xf3d7('0x23')](function(_0x1de9b0){_0x46613e['rows']=_0x1de9b0;return _0x46613e;})['then'](respondWithFilteredResult(_0x255951,_0x82b242))[_0xf3d7('0x43')](handleError(_0x255951,null));};exports[_0xf3d7('0x44')]=function(_0x2763c1,_0x1dc8e8){var _0x5c3b3c={'raw':![],'where':{'id':_0x2763c1[_0xf3d7('0x45')]['id']}},_0x49ef6b={};_0x49ef6b[_0xf3d7('0x2f')]=_[_0xf3d7('0x31')](db[_0xf3d7('0x2a')][_0xf3d7('0x2b')]);_0x49ef6b[_0xf3d7('0x30')]=_[_0xf3d7('0x31')](_0x2763c1[_0xf3d7('0x30')]);_0x49ef6b[_0xf3d7('0x32')]=_[_0xf3d7('0x34')](_0x49ef6b[_0xf3d7('0x2f')],_0x49ef6b[_0xf3d7('0x30')]);_0x5c3b3c[_0xf3d7('0x33')]=_[_0xf3d7('0x34')](_0x49ef6b['model'],qs[_0xf3d7('0x35')](_0x2763c1[_0xf3d7('0x30')][_0xf3d7('0x35')]));_0x5c3b3c[_0xf3d7('0x33')]=_0x5c3b3c[_0xf3d7('0x33')][_0xf3d7('0x36')]?_0x5c3b3c['attributes']:_0x49ef6b[_0xf3d7('0x2f')];if(_0x2763c1[_0xf3d7('0x30')]['includeAll']){_0x5c3b3c[_0xf3d7('0x41')]=[{'all':!![]}];}_0x5c3b3c=_['merge']({},_0x5c3b3c,_0x2763c1[_0xf3d7('0x3f')]);return db[_0xf3d7('0x2a')][_0xf3d7('0x46')](_0x5c3b3c)[_0xf3d7('0x23')](handleEntityNotFound(_0x1dc8e8,null))[_0xf3d7('0x23')](respondWithResult(_0x1dc8e8,null))['catch'](handleError(_0x1dc8e8,null));};exports[_0xf3d7('0x47')]=function(_0x483cc0,_0xf6a443){return db[_0xf3d7('0x2a')][_0xf3d7('0x47')](_0x483cc0[_0xf3d7('0x48')],{})['then'](respondWithResult(_0xf6a443,0xc9))[_0xf3d7('0x43')](handleError(_0xf6a443,null));};exports[_0xf3d7('0x22')]=function(_0x40eae9,_0x1daa8f){if(_0x40eae9[_0xf3d7('0x48')]['id']){delete _0x40eae9[_0xf3d7('0x48')]['id'];}return db[_0xf3d7('0x2a')][_0xf3d7('0x46')]({'where':{'id':_0x40eae9[_0xf3d7('0x45')]['id']}})['then'](handleEntityNotFound(_0x1daa8f,null))[_0xf3d7('0x23')](saveUpdates(_0x40eae9[_0xf3d7('0x48')],null))[_0xf3d7('0x23')](respondWithResult(_0x1daa8f,null))[_0xf3d7('0x43')](handleError(_0x1daa8f,null));};exports[_0xf3d7('0x24')]=function(_0x5ae536,_0x32c7e8){return db['FreshdeskAccount'][_0xf3d7('0x46')]({'where':{'id':_0x5ae536[_0xf3d7('0x45')]['id']}})[_0xf3d7('0x23')](handleEntityNotFound(_0x32c7e8,null))[_0xf3d7('0x23')](removeEntity(_0x32c7e8,null))[_0xf3d7('0x43')](handleError(_0x32c7e8,null));};exports['getConfigurations']=function(_0x3e0deb,_0x3f3835,_0x156f25){var _0x2c0667={};var _0x342de7={};var _0x5a0938;var _0xd564c1;return db[_0xf3d7('0x2a')][_0xf3d7('0x49')]({'where':{'id':_0x3e0deb[_0xf3d7('0x45')]['id']}})[_0xf3d7('0x23')](handleEntityNotFound(_0x3f3835,null))[_0xf3d7('0x23')](function(_0x1c70dc){if(_0x1c70dc){_0x5a0938=_0x1c70dc;_0x342de7[_0xf3d7('0x2f')]=_[_0xf3d7('0x31')](db['FreshdeskConfiguration'][_0xf3d7('0x2b')]);_0x342de7[_0xf3d7('0x30')]=_[_0xf3d7('0x31')](_0x3e0deb['query']);_0x342de7[_0xf3d7('0x32')]=_[_0xf3d7('0x34')](_0x342de7[_0xf3d7('0x2f')],_0x342de7[_0xf3d7('0x30')]);_0x2c0667[_0xf3d7('0x33')]=_[_0xf3d7('0x34')](_0x342de7[_0xf3d7('0x2f')],qs['fields'](_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x35')]));_0x2c0667[_0xf3d7('0x33')]=_0x2c0667[_0xf3d7('0x33')][_0xf3d7('0x36')]?_0x2c0667['attributes']:_0x342de7[_0xf3d7('0x2f')];_0x2c0667[_0xf3d7('0x4a')]=qs[_0xf3d7('0x39')](_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x39')]);_0x2c0667[_0xf3d7('0x3a')]=qs[_0xf3d7('0x32')](_[_0xf3d7('0x3b')](_0x3e0deb[_0xf3d7('0x30')],_0x342de7[_0xf3d7('0x32')]));if(_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x3c')]){_0x2c0667[_0xf3d7('0x3a')]=_['merge'](_0x2c0667[_0xf3d7('0x3a')],{'$or':_[_0xf3d7('0x29')](_0x2c0667[_0xf3d7('0x33')],function(_0x76d0b1){var _0x1404e7={};_0x1404e7[_0x76d0b1]={'$like':'%'+_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x3c')]+'%'};return _0x1404e7;})});}_0x2c0667=_[_0xf3d7('0x3d')]({},_0x2c0667,_0x3e0deb[_0xf3d7('0x3f')]);return _0x5a0938[_0xf3d7('0x4b')](_0x2c0667);}})[_0xf3d7('0x23')](function(_0x4312f9){if(_0x4312f9){_0xd564c1=_0x4312f9['length'];if(!_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x37')]('nolimit')){_0x2c0667[_0xf3d7('0x1b')]=qs[_0xf3d7('0x1b')](_0x3e0deb[_0xf3d7('0x30')]['limit']);_0x2c0667['offset']=qs[_0xf3d7('0x19')](_0x3e0deb[_0xf3d7('0x30')]['offset']);}return _0x5a0938[_0xf3d7('0x4b')](_0x2c0667);}})[_0xf3d7('0x23')](function(_0x4843eb){if(_0x4843eb){return _0x4843eb?{'count':_0xd564c1,'rows':_0x4843eb}:null;}})[_0xf3d7('0x23')](respondWithResult(_0x3f3835,null))[_0xf3d7('0x43')](handleError(_0x3f3835,null));};exports['addConfiguration']=function(_0x21cc99,_0x25d8fc,_0x22202b){if(_0x21cc99[_0xf3d7('0x48')]['id']){delete _0x21cc99['body']['id'];}return db[_0xf3d7('0x2a')][_0xf3d7('0x49')]({'where':{'id':_0x21cc99[_0xf3d7('0x45')]['id']}})[_0xf3d7('0x23')](handleEntityNotFound(_0x25d8fc,null))['then'](function(_0x4d87a8){if(_0x4d87a8){_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x4c')]=_0x4d87a8['id'];_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x4d')]=integrations[_0xf3d7('0x4e')](_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x4f')],_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x2d')]);_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x50')]=integrations[_0xf3d7('0x51')](_0x21cc99['body'][_0xf3d7('0x4f')],_0x21cc99[_0xf3d7('0x48')]['type']);return db[_0xf3d7('0x52')][_0xf3d7('0x47')](_0x21cc99[_0xf3d7('0x48')],{'include':[{'model':db[_0xf3d7('0x53')],'as':_0xf3d7('0x4d')},{'model':db[_0xf3d7('0x53')],'as':_0xf3d7('0x50')}]});}return null;})[_0xf3d7('0x23')](respondWithResult(_0x25d8fc,null))[_0xf3d7('0x43')](handleError(_0x25d8fc,null));};exports[_0xf3d7('0x54')]=function(_0x39bdba,_0x485d8f,_0x21d1aa){var _0x572c18='';return db['FreshdeskAccount'][_0xf3d7('0x49')]({'where':{'id':_0x39bdba[_0xf3d7('0x45')]['id']},'attributes':['id',_0xf3d7('0x55'),_0xf3d7('0x56')]})[_0xf3d7('0x23')](handleEntityNotFound(_0x485d8f,null))[_0xf3d7('0x23')](function(_0x472ba1){if(_0x472ba1){_0x572c18=_0x472ba1[_0xf3d7('0x55')];var _0x496540=_0x572c18[_0xf3d7('0x57')](-0x1);if(_0x496540==='/'){_0x572c18=_0x572c18['substring'](0x0,_0x572c18[_0xf3d7('0x58')](_0x496540));}return rp({'method':_0xf3d7('0x59'),'uri':util[_0xf3d7('0x5a')]('%s/%s',_0x572c18,_0xf3d7('0x5b')),'headers':{'Authorization':util[_0xf3d7('0x5a')](_0xf3d7('0x5c'),new Buffer(util[_0xf3d7('0x5a')](_0xf3d7('0x5d'),_0x472ba1[_0xf3d7('0x56')]))[_0xf3d7('0x5e')](_0xf3d7('0x5f')))},'json':!![]});}})[_0xf3d7('0x23')](function(_0x1132b9){if(_0x1132b9){var _0x1bd1b0=[_0xf3d7('0x60'),_0xf3d7('0x61'),_0xf3d7('0x62'),_0xf3d7('0x63'),_0xf3d7('0x17'),_0xf3d7('0x64'),_0xf3d7('0x65'),_0xf3d7('0x66'),_0xf3d7('0x67'),_0xf3d7('0x65'),'company'];_[_0xf3d7('0x68')](_0x1132b9,function(_0x45284b){return _0x1bd1b0[_0xf3d7('0x69')](_0x45284b[_0xf3d7('0x27')])||!_0x45284b[_0xf3d7('0x6a')]&&_0x45284b[_0xf3d7('0x2d')]!==_0xf3d7('0x6b')&&_0x45284b[_0xf3d7('0x2d')]!=='custom_dropdown';});return{'count':_0x1132b9[_0xf3d7('0x36')],'rows':_['map'](_0x1132b9,function(_0x2be41a){return{'id':_0x2be41a['name'],'name':_0x2be41a[_0xf3d7('0x6c')],'custom':!_0x2be41a[_0xf3d7('0x6a')],'options':_0x2be41a[_0xf3d7('0x6d')]?_[_0xf3d7('0x29')](_0x2be41a[_0xf3d7('0x6d')],function(_0x1ac5a7){return{'name':_[_0xf3d7('0x6e')](_0x1ac5a7),'value':_0x1ac5a7};}):[]};})};}})[_0xf3d7('0x23')](respondWithResult(_0x485d8f,null))[_0xf3d7('0x43')](function(_0x348ed6){var _0x3849f0=_0x39bdba['query'][_0xf3d7('0x6f')]?0x1f4:_0x348ed6[_0xf3d7('0x70')]||0x1f4;logger[_0xf3d7('0x26')](_0xf3d7('0x71'),_0xf3d7('0x54'),_0x3849f0,JSON[_0xf3d7('0x72')](_0x348ed6));delete _0x348ed6['name'];if(_0x3849f0===0x191){_0x3849f0=0x190;}_0x485d8f[_0xf3d7('0x17')](_0x3849f0)['send'](_0x39bdba['query'][_0xf3d7('0x6f')]?{'message':_0xf3d7('0x73'),'statusCode':_0x348ed6['statusCode']}:_0x348ed6);});};
\ No newline at end of file
index 6c936ca..1d6a317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf073=['rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','api','moment','bluebird','path'];(function(_0x4b23b0,_0xf3d9b4){var _0x1440d7=function(_0xcbf17b){while(--_0xcbf17b){_0x4b23b0['push'](_0x4b23b0['shift']());}};_0x1440d7(++_0xf3d9b4);}(_0xf073,0x188));var _0x3f07=function(_0x16a5bf,_0x368173){_0x16a5bf=_0x16a5bf-0x0;var _0x25c090=_0xf073[_0x16a5bf];return _0x25c090;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3f07('0x0'));var moment=require(_0x3f07('0x1'));var BPromise=require(_0x3f07('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f07('0x3'));var rimraf=require(_0x3f07('0x4'));var config=require('../../config/environment');var attributes=require(_0x3f07('0x5'));var integrations=require(_0x3f07('0x6'));module['exports']=function(_0x3368ff,_0x3ffed3){return _0x3368ff['define'](_0x3f07('0x7'),attributes,{'tableName':_0x3f07('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4fc=['exports','define','int_freshdesk_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration'];(function(_0x2a9197,_0x5225eb){var _0x588c8a=function(_0x4698ee){while(--_0x4698ee){_0x2a9197['push'](_0x2a9197['shift']());}};_0x588c8a(++_0x5225eb);}(_0xf4fc,0xd3));var _0xcf4f=function(_0x2253bb,_0xd4bd43){_0x2253bb=_0x2253bb-0x0;var _0x4fa96f=_0xf4fc[_0x2253bb];return _0x4fa96f;};'use strict';var _=require('lodash');var util=require(_0xcf4f('0x0'));var logger=require('../../config/logger')(_0xcf4f('0x1'));var moment=require(_0xcf4f('0x2'));var BPromise=require(_0xcf4f('0x3'));var rp=require(_0xcf4f('0x4'));var fs=require('fs');var path=require(_0xcf4f('0x5'));var rimraf=require(_0xcf4f('0x6'));var config=require(_0xcf4f('0x7'));var attributes=require(_0xcf4f('0x8'));var integrations=require(_0xcf4f('0x9'));module[_0xcf4f('0xa')]=function(_0x3143d1,_0xf4e0b){return _0x3143d1[_0xcf4f('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xcf4f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 026d0ea..5cdccb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95b7=['moment','bluebird','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','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','map','model','include','attributes','ShowFreshdeskAccount','find'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0x95b7,0x69));var _0x795b=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x95b7[_0x234ae1];return _0x227ba0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x795b('0x0'));var BPromise=require(_0x795b('0x1'));var rs=require(_0x795b('0x2'));var fs=require('fs');var Redis=require(_0x795b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x795b('0x4'));var logger=require(_0x795b('0x5'))(_0x795b('0x6'));var config=require(_0x795b('0x7'));var jayson=require(_0x795b('0x8'));var client=jayson[_0x795b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c1564,_0x13007a,_0x1e9432){return new BPromise(function(_0x2f1610,_0x21cdba){return client[_0x795b('0xa')](_0x5c1564,_0x1e9432)[_0x795b('0xb')](function(_0x23e4a8){logger[_0x795b('0xc')](_0x795b('0xd'),_0x13007a,_0x795b('0xe'));logger[_0x795b('0xf')](_0x795b('0x10'),_0x13007a,'request\x20sent',JSON[_0x795b('0x11')](_0x23e4a8));if(_0x23e4a8[_0x795b('0x12')]){if(_0x23e4a8[_0x795b('0x12')][_0x795b('0x13')]===0x1f4){logger['error'](_0x795b('0xd'),_0x13007a,_0x23e4a8['error']['message']);return _0x21cdba(_0x23e4a8['error'][_0x795b('0x14')]);}logger[_0x795b('0x12')](_0x795b('0xd'),_0x13007a,_0x23e4a8[_0x795b('0x12')]['message']);return _0x2f1610(_0x23e4a8['error'][_0x795b('0x14')]);}else{logger[_0x795b('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x13007a,_0x795b('0xe'));_0x2f1610(_0x23e4a8[_0x795b('0x15')]['message']);}})[_0x795b('0x16')](function(_0x1d1e92){logger[_0x795b('0x12')](_0x795b('0xd'),_0x13007a,_0x1d1e92);_0x21cdba(_0x1d1e92);});});}exports[_0x795b('0x17')]=function(_0xe49893){var _0x5102b7=this;return new Promise(function(_0x37e9e6,_0x33d4b8){return db[_0x795b('0x18')]['findAll']({'raw':_0xe49893[_0x795b('0x19')]?_0xe49893['options'][_0x795b('0x1a')]===undefined?!![]:![]:!![],'where':_0xe49893[_0x795b('0x19')]?_0xe49893[_0x795b('0x19')][_0x795b('0x1b')]||null:null,'attributes':_0xe49893['options']?_0xe49893[_0x795b('0x19')]['attributes']||null:null,'limit':_0xe49893['options']?_0xe49893[_0x795b('0x19')][_0x795b('0x1c')]||null:null,'include':_0xe49893[_0x795b('0x19')]?_0xe49893['options']['include']?_[_0x795b('0x1d')](_0xe49893[_0x795b('0x19')]['include'],function(_0x47090c){return{'model':db[_0x47090c[_0x795b('0x1e')]],'as':_0x47090c['as'],'attributes':_0x47090c['attributes'],'include':_0x47090c[_0x795b('0x1f')]?_[_0x795b('0x1d')](_0x47090c[_0x795b('0x1f')],function(_0x2e2e62){return{'model':db[_0x2e2e62[_0x795b('0x1e')]],'as':_0x2e2e62['as'],'attributes':_0x2e2e62['attributes'],'include':_0x2e2e62['include']?_[_0x795b('0x1d')](_0x2e2e62[_0x795b('0x1f')],function(_0x2ab3a2){return{'model':db[_0x2ab3a2[_0x795b('0x1e')]],'as':_0x2ab3a2['as'],'attributes':_0x2ab3a2[_0x795b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x795b('0xb')](function(_0x2adeb2){logger[_0x795b('0xc')](_0x795b('0x17'),_0xe49893);logger['debug']('GetFreshdeskAccount',_0xe49893,JSON['stringify'](_0x2adeb2));_0x37e9e6(_0x2adeb2);})[_0x795b('0x16')](function(_0x5c436e){logger[_0x795b('0x12')]('GetFreshdeskAccount',_0x5c436e[_0x795b('0x14')],_0xe49893);_0x33d4b8(_0x5102b7[_0x795b('0x12')](0x1f4,_0x5c436e[_0x795b('0x14')]));});});};exports[_0x795b('0x21')]=function(_0x4259c3){var _0x9df92a=this;return new Promise(function(_0x574b94,_0x508c63){return db['FreshdeskAccount'][_0x795b('0x22')]({'raw':_0x4259c3[_0x795b('0x19')]?_0x4259c3['options']['raw']===undefined?!![]:![]:!![],'where':_0x4259c3[_0x795b('0x19')]?_0x4259c3[_0x795b('0x19')][_0x795b('0x1b')]||null:null,'attributes':_0x4259c3[_0x795b('0x19')]?_0x4259c3[_0x795b('0x19')][_0x795b('0x20')]||null:null,'include':_0x4259c3[_0x795b('0x19')]?_0x4259c3[_0x795b('0x19')][_0x795b('0x1f')]?_[_0x795b('0x1d')](_0x4259c3[_0x795b('0x19')][_0x795b('0x1f')],function(_0x360f5b){return{'model':db[_0x360f5b[_0x795b('0x1e')]],'as':_0x360f5b['as'],'attributes':_0x360f5b[_0x795b('0x20')],'include':_0x360f5b['include']?_[_0x795b('0x1d')](_0x360f5b[_0x795b('0x1f')],function(_0x19d463){return{'model':db[_0x19d463[_0x795b('0x1e')]],'as':_0x19d463['as'],'attributes':_0x19d463['attributes'],'include':_0x19d463['include']?_[_0x795b('0x1d')](_0x19d463[_0x795b('0x1f')],function(_0x10d27e){return{'model':db[_0x10d27e['model']],'as':_0x10d27e['as'],'attributes':_0x10d27e[_0x795b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x280c99){logger['info'](_0x795b('0x21'),_0x4259c3);logger[_0x795b('0xf')](_0x795b('0x21'),_0x4259c3,JSON[_0x795b('0x11')](_0x280c99));_0x574b94(_0x280c99);})['catch'](function(_0x59db9f){logger[_0x795b('0x12')]('ShowFreshdeskAccount',_0x59db9f[_0x795b('0x14')],_0x4259c3);_0x508c63(_0x9df92a[_0x795b('0x12')](0x1f4,_0x59db9f[_0x795b('0x14')]));});});};
\ No newline at end of file
+var _0xfa6f=['GetFreshdeskAccount','stringify','find','ShowFreshdeskAccount','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','FreshdeskAccount','findAll','options','raw','limit','include','map','model','attributes'];(function(_0x2d9ecf,_0x2482cb){var _0x1f311f=function(_0x491d8e){while(--_0x491d8e){_0x2d9ecf['push'](_0x2d9ecf['shift']());}};_0x1f311f(++_0x2482cb);}(_0xfa6f,0xa9));var _0xffa6=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xfa6f[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0xffa6('0x0'));var util=require(_0xffa6('0x1'));var moment=require(_0xffa6('0x2'));var BPromise=require('bluebird');var rs=require(_0xffa6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xffa6('0x4'));var logger=require(_0xffa6('0x5'))(_0xffa6('0x6'));var config=require(_0xffa6('0x7'));var jayson=require(_0xffa6('0x8'));var client=jayson['client'][_0xffa6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdff266,_0x27990d,_0x2f3dce){return new BPromise(function(_0x44025e,_0x581a40){return client['request'](_0xdff266,_0x2f3dce)[_0xffa6('0xa')](function(_0x5840f7){logger['info'](_0xffa6('0xb'),_0x27990d,_0xffa6('0xc'));logger[_0xffa6('0xd')](_0xffa6('0xe'),_0x27990d,'request\x20sent',JSON['stringify'](_0x5840f7));if(_0x5840f7[_0xffa6('0xf')]){if(_0x5840f7[_0xffa6('0xf')][_0xffa6('0x10')]===0x1f4){logger[_0xffa6('0xf')](_0xffa6('0xb'),_0x27990d,_0x5840f7[_0xffa6('0xf')][_0xffa6('0x11')]);return _0x581a40(_0x5840f7[_0xffa6('0xf')][_0xffa6('0x11')]);}logger[_0xffa6('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x27990d,_0x5840f7[_0xffa6('0xf')]['message']);return _0x44025e(_0x5840f7['error']['message']);}else{logger[_0xffa6('0x12')](_0xffa6('0xb'),_0x27990d,_0xffa6('0xc'));_0x44025e(_0x5840f7['result'][_0xffa6('0x11')]);}})[_0xffa6('0x13')](function(_0x192203){logger[_0xffa6('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x27990d,_0x192203);_0x581a40(_0x192203);});});}exports['GetFreshdeskAccount']=function(_0x4a9036){var _0x482411=this;return new Promise(function(_0x95aab3,_0x1d7d4b){return db[_0xffa6('0x14')][_0xffa6('0x15')]({'raw':_0x4a9036[_0xffa6('0x16')]?_0x4a9036['options'][_0xffa6('0x17')]===undefined?!![]:![]:!![],'where':_0x4a9036[_0xffa6('0x16')]?_0x4a9036[_0xffa6('0x16')]['where']||null:null,'attributes':_0x4a9036['options']?_0x4a9036['options']['attributes']||null:null,'limit':_0x4a9036[_0xffa6('0x16')]?_0x4a9036['options'][_0xffa6('0x18')]||null:null,'include':_0x4a9036['options']?_0x4a9036[_0xffa6('0x16')][_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x4a9036[_0xffa6('0x16')][_0xffa6('0x19')],function(_0x4d7191){return{'model':db[_0x4d7191[_0xffa6('0x1b')]],'as':_0x4d7191['as'],'attributes':_0x4d7191[_0xffa6('0x1c')],'include':_0x4d7191[_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x4d7191[_0xffa6('0x19')],function(_0x2b120f){return{'model':db[_0x2b120f[_0xffa6('0x1b')]],'as':_0x2b120f['as'],'attributes':_0x2b120f[_0xffa6('0x1c')],'include':_0x2b120f[_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x2b120f['include'],function(_0x8648a9){return{'model':db[_0x8648a9[_0xffa6('0x1b')]],'as':_0x8648a9['as'],'attributes':_0x8648a9['attributes']};}):[]};}):[]};}):[]:[]})[_0xffa6('0xa')](function(_0x3bbe62){logger['info'](_0xffa6('0x1d'),_0x4a9036);logger['debug'](_0xffa6('0x1d'),_0x4a9036,JSON[_0xffa6('0x1e')](_0x3bbe62));_0x95aab3(_0x3bbe62);})[_0xffa6('0x13')](function(_0x36e2f0){logger[_0xffa6('0xf')]('GetFreshdeskAccount',_0x36e2f0[_0xffa6('0x11')],_0x4a9036);_0x1d7d4b(_0x482411['error'](0x1f4,_0x36e2f0[_0xffa6('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x4858c4){var _0xb1098e=this;return new Promise(function(_0x384ca9,_0x23639e){return db[_0xffa6('0x14')][_0xffa6('0x1f')]({'raw':_0x4858c4[_0xffa6('0x16')]?_0x4858c4[_0xffa6('0x16')][_0xffa6('0x17')]===undefined?!![]:![]:!![],'where':_0x4858c4[_0xffa6('0x16')]?_0x4858c4['options']['where']||null:null,'attributes':_0x4858c4['options']?_0x4858c4[_0xffa6('0x16')][_0xffa6('0x1c')]||null:null,'include':_0x4858c4[_0xffa6('0x16')]?_0x4858c4[_0xffa6('0x16')][_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x4858c4[_0xffa6('0x16')]['include'],function(_0x32d832){return{'model':db[_0x32d832[_0xffa6('0x1b')]],'as':_0x32d832['as'],'attributes':_0x32d832['attributes'],'include':_0x32d832['include']?_['map'](_0x32d832[_0xffa6('0x19')],function(_0x5bdafc){return{'model':db[_0x5bdafc[_0xffa6('0x1b')]],'as':_0x5bdafc['as'],'attributes':_0x5bdafc['attributes'],'include':_0x5bdafc[_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x5bdafc[_0xffa6('0x19')],function(_0x29634c){return{'model':db[_0x29634c['model']],'as':_0x29634c['as'],'attributes':_0x29634c[_0xffa6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47e88a){logger[_0xffa6('0x12')](_0xffa6('0x20'),_0x4858c4);logger[_0xffa6('0xd')](_0xffa6('0x20'),_0x4858c4,JSON[_0xffa6('0x1e')](_0x47e88a));_0x384ca9(_0x47e88a);})['catch'](function(_0x952fe0){logger[_0xffa6('0xf')](_0xffa6('0x20'),_0x952fe0['message'],_0x4858c4);_0x23639e(_0xb1098e[_0xffa6('0xf')](0x1f4,_0x952fe0[_0xffa6('0x11')]));});});};
\ No newline at end of file
index 41c0166..7fb1628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bee=['get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x0bee,0xfb));var _0xe0be=function(_0x37bbd7,_0x3a183f){_0x37bbd7=_0x37bbd7-0x0;var _0x58bbfe=_0x0bee[_0x37bbd7];return _0x58bbfe;};'use strict';var multer=require(_0xe0be('0x0'));var util=require(_0xe0be('0x1'));var path=require(_0xe0be('0x2'));var timeout=require(_0xe0be('0x3'));var express=require(_0xe0be('0x4'));var router=express[_0xe0be('0x5')]();var fs_extra=require(_0xe0be('0x6'));var auth=require(_0xe0be('0x7'));var interaction=require(_0xe0be('0x8'));var config=require(_0xe0be('0x9'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xe0be('0xa')]('/',auth[_0xe0be('0xb')](),controller[_0xe0be('0xc')]);router[_0xe0be('0xa')]('/:id',auth[_0xe0be('0xb')](),controller[_0xe0be('0xd')]);router[_0xe0be('0xa')](_0xe0be('0xe'),auth['isAuthenticated'](),controller[_0xe0be('0xf')]);router[_0xe0be('0xa')](_0xe0be('0x10'),auth[_0xe0be('0xb')](),controller['getSubjects']);router['get'](_0xe0be('0x11'),auth[_0xe0be('0xb')](),controller[_0xe0be('0x12')]);router[_0xe0be('0xa')](_0xe0be('0x13'),auth[_0xe0be('0xb')](),controller[_0xe0be('0x14')]);router[_0xe0be('0x15')]('/',auth['isAuthenticated'](),controller[_0xe0be('0x16')]);router['post'](_0xe0be('0x13'),auth[_0xe0be('0xb')](),controller[_0xe0be('0x17')]);router[_0xe0be('0x18')](_0xe0be('0x19'),auth[_0xe0be('0xb')](),controller['update']);router[_0xe0be('0x1a')](_0xe0be('0x19'),auth[_0xe0be('0xb')](),controller[_0xe0be('0x1b')]);module[_0xe0be('0x1c')]=router;
\ No newline at end of file
+var _0xab50=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x31826c,_0x1995c5){var _0x20bbd7=function(_0x2a98ab){while(--_0x2a98ab){_0x31826c['push'](_0x31826c['shift']());}};_0x20bbd7(++_0x1995c5);}(_0xab50,0x1d7));var _0x0ab5=function(_0x15dcfc,_0x43731d){_0x15dcfc=_0x15dcfc-0x0;var _0x332d0f=_0xab50[_0x15dcfc];return _0x332d0f;};'use strict';var multer=require(_0x0ab5('0x0'));var util=require(_0x0ab5('0x1'));var path=require(_0x0ab5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ab5('0x3'));var router=express[_0x0ab5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0ab5('0x5'));var interaction=require(_0x0ab5('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x8')]);router[_0x0ab5('0x9')](_0x0ab5('0xa'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0xb')]);router[_0x0ab5('0x9')](_0x0ab5('0xc'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0xd')]);router[_0x0ab5('0x9')](_0x0ab5('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x0ab5('0x9')](_0x0ab5('0xf'),auth[_0x0ab5('0x7')](),controller['getDescriptions']);router[_0x0ab5('0x9')](_0x0ab5('0x10'),auth[_0x0ab5('0x7')](),controller['getTags']);router[_0x0ab5('0x11')]('/',auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x12')]);router['post'](_0x0ab5('0x10'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x13')]);router[_0x0ab5('0x14')](_0x0ab5('0xa'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x15')]);router[_0x0ab5('0x16')](_0x0ab5('0xa'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x17')]);module[_0x0ab5('0x18')]=router;
\ No newline at end of file
index e94ddd6..1f7f893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1ba=['STRING','exports'];(function(_0x3c7b39,_0x39a416){var _0x369bd7=function(_0x3883b6){while(--_0x3883b6){_0x3c7b39['push'](_0x3c7b39['shift']());}};_0x369bd7(++_0x39a416);}(_0xe1ba,0x19f));var _0xae1b=function(_0x273033,_0x24f181){_0x273033=_0x273033-0x0;var _0x1e6b54=_0xe1ba[_0x273033];return _0x1e6b54;};'use strict';var Sequelize=require('sequelize');module[_0xae1b('0x0')]={'name':{'type':Sequelize[_0xae1b('0x1')]},'description':{'type':Sequelize[_0xae1b('0x1')]}};
\ No newline at end of file
+var _0x02f8=['sequelize'];(function(_0x21c84f,_0x4614cf){var _0x5bd4aa=function(_0x289017){while(--_0x289017){_0x21c84f['push'](_0x21c84f['shift']());}};_0x5bd4aa(++_0x4614cf);}(_0x02f8,0x1e4));var _0x802f=function(_0xfb6cef,_0x206adf){_0xfb6cef=_0xfb6cef-0x0;var _0x40eb07=_0x02f8[_0xfb6cef];return _0x40eb07;};'use strict';var Sequelize=require(_0x802f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 370f5cf..6332735 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee9b=['model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','FreshdeskField','order','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','fast-json-patch','moment','bluebird','mustache','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','key'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0xee9b,0xc6));var _0xbee9=function(_0x2cba31,_0x4aabb7){_0x2cba31=_0x2cba31-0x0;var _0x53875d=_0xee9b[_0x2cba31];return _0x53875d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbee9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbee9('0x1'));var rp=require('request-promise');var moment=require(_0xbee9('0x2'));var BPromise=require(_0xbee9('0x3'));var Mustache=require(_0xbee9('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbee9('0x5'));var ejs=require(_0xbee9('0x6'));var fs=require('fs');var fs_extra=require(_0xbee9('0x7'));var _=require(_0xbee9('0x8'));var squel=require(_0xbee9('0x9'));var crypto=require('crypto');var jsforce=require(_0xbee9('0xa'));var deskjs=require(_0xbee9('0xb'));var toCsv=require(_0xbee9('0x5'));var querystring=require(_0xbee9('0xc'));var Papa=require(_0xbee9('0xd'));var Redis=require(_0xbee9('0xe'));var authService=require(_0xbee9('0xf'));var qs=require(_0xbee9('0x10'));var as=require(_0xbee9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbee9('0x12'))('api');var utils=require(_0xbee9('0x13'));var config=require(_0xbee9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbee9('0x15'))['db'];function respondWithStatusCode(_0x31da7d,_0x10d7bb){_0x10d7bb=_0x10d7bb||0xcc;return function(_0x32cb46){if(_0x32cb46){return _0x31da7d[_0xbee9('0x16')](_0x10d7bb);}return _0x31da7d[_0xbee9('0x17')](_0x10d7bb)[_0xbee9('0x18')]();};}function respondWithResult(_0x4b5375,_0x1b090c){_0x1b090c=_0x1b090c||0xc8;return function(_0x13509a){if(_0x13509a){return _0x4b5375[_0xbee9('0x17')](_0x1b090c)[_0xbee9('0x19')](_0x13509a);}};}function respondWithFilteredResult(_0x24ad15,_0x5717db){return function(_0x5680ba){if(_0x5680ba){var _0x3f83ea=typeof _0x5717db[_0xbee9('0x1a')]===_0xbee9('0x1b')&&typeof _0x5717db['limit']===_0xbee9('0x1b');var _0x4eb4e9=_0x5680ba[_0xbee9('0x1c')];var _0x83e063=_0x3f83ea?0x0:_0x5717db['offset'];var _0x2a76ec=_0x3f83ea?_0x5680ba[_0xbee9('0x1c')]:_0x5717db[_0xbee9('0x1a')]+_0x5717db[_0xbee9('0x1d')];var _0x268983;if(_0x2a76ec>=_0x4eb4e9){_0x2a76ec=_0x4eb4e9;_0x268983=0xc8;}else{_0x268983=0xce;}_0x24ad15[_0xbee9('0x17')](_0x268983);return _0x24ad15[_0xbee9('0x1e')](_0xbee9('0x1f'),_0x83e063+'-'+_0x2a76ec+'/'+_0x4eb4e9)[_0xbee9('0x19')](_0x5680ba);}return null;};}function patchUpdates(_0x59a2b9){return function(_0x2c812e){try{jsonpatch[_0xbee9('0x20')](_0x2c812e,_0x59a2b9,!![]);}catch(_0x95cf94){return BPromise[_0xbee9('0x21')](_0x95cf94);}return _0x2c812e['save']();};}function saveUpdates(_0x2a9b9e,_0x473242){return function(_0x5791fd){if(_0x5791fd){return _0x5791fd[_0xbee9('0x22')](_0x2a9b9e)['then'](function(_0x2ecd81){return _0x2ecd81;});}return null;};}function removeEntity(_0x12848b,_0x5f3b93){return function(_0x3b2800){if(_0x3b2800){return _0x3b2800[_0xbee9('0x23')]()[_0xbee9('0x24')](function(){_0x12848b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3780df,_0x39f9b4){return function(_0x26d28a){if(!_0x26d28a){_0x3780df[_0xbee9('0x16')](0x194);}return _0x26d28a;};}function handleError(_0x3f7415,_0x3108b5){_0x3108b5=_0x3108b5||0x1f4;return function(_0x1cf9bd){logger[_0xbee9('0x25')](_0x1cf9bd[_0xbee9('0x26')]);if(_0x1cf9bd[_0xbee9('0x27')]){delete _0x1cf9bd[_0xbee9('0x27')];}_0x3f7415[_0xbee9('0x17')](_0x3108b5)['send'](_0x1cf9bd);};}exports[_0xbee9('0x28')]=function(_0x438f3c,_0x378405){var _0x2e0821={},_0x477e75={},_0x423230={'count':0x0,'rows':[]};var _0x23c46b=_[_0xbee9('0x29')](db[_0xbee9('0x2a')][_0xbee9('0x2b')],function(_0x5672e2){return{'name':_0x5672e2['fieldName'],'type':_0x5672e2['type'][_0xbee9('0x2c')]};});_0x477e75[_0xbee9('0x2d')]=_[_0xbee9('0x29')](_0x23c46b,_0xbee9('0x27'));_0x477e75['query']=_[_0xbee9('0x2e')](_0x438f3c[_0xbee9('0x2f')]);_0x477e75[_0xbee9('0x30')]=_[_0xbee9('0x31')](_0x477e75[_0xbee9('0x2d')],_0x477e75['query']);_0x2e0821[_0xbee9('0x32')]=_['intersection'](_0x477e75[_0xbee9('0x2d')],qs[_0xbee9('0x33')](_0x438f3c[_0xbee9('0x2f')][_0xbee9('0x33')]));_0x2e0821['attributes']=_0x2e0821['attributes'][_0xbee9('0x34')]?_0x2e0821[_0xbee9('0x32')]:_0x477e75[_0xbee9('0x2d')];if(!_0x438f3c['query']['hasOwnProperty'](_0xbee9('0x35'))){_0x2e0821[_0xbee9('0x1d')]=qs[_0xbee9('0x1d')](_0x438f3c[_0xbee9('0x2f')][_0xbee9('0x1d')]);_0x2e0821['offset']=qs[_0xbee9('0x1a')](_0x438f3c['query'][_0xbee9('0x1a')]);}_0x2e0821['order']=qs[_0xbee9('0x36')](_0x438f3c[_0xbee9('0x2f')][_0xbee9('0x36')]);_0x2e0821[_0xbee9('0x37')]=qs[_0xbee9('0x30')](_[_0xbee9('0x38')](_0x438f3c[_0xbee9('0x2f')],_0x477e75['filters']),_0x23c46b);if(_0x438f3c[_0xbee9('0x2f')][_0xbee9('0x39')]){_0x2e0821[_0xbee9('0x37')]=_[_0xbee9('0x3a')](_0x2e0821[_0xbee9('0x37')],{'$or':_[_0xbee9('0x29')](_0x23c46b,function(_0x56d573){if(_0x56d573[_0xbee9('0x3b')]!==_0xbee9('0x3c')){var _0x135e79={};_0x135e79[_0x56d573[_0xbee9('0x27')]]={'$like':'%'+_0x438f3c[_0xbee9('0x2f')][_0xbee9('0x39')]+'%'};return _0x135e79;}})});}_0x2e0821=_[_0xbee9('0x3a')]({},_0x2e0821,_0x438f3c[_0xbee9('0x3d')]);var _0x47a4ef={'where':_0x2e0821[_0xbee9('0x37')]};return db[_0xbee9('0x2a')][_0xbee9('0x1c')](_0x47a4ef)[_0xbee9('0x24')](function(_0x8805fc){_0x423230[_0xbee9('0x1c')]=_0x8805fc;if(_0x438f3c['query']['includeAll']){_0x2e0821[_0xbee9('0x3e')]=[{'all':!![]}];}return db[_0xbee9('0x2a')][_0xbee9('0x3f')](_0x2e0821);})[_0xbee9('0x24')](function(_0x7572df){_0x423230[_0xbee9('0x40')]=_0x7572df;return _0x423230;})['then'](respondWithFilteredResult(_0x378405,_0x2e0821))[_0xbee9('0x41')](handleError(_0x378405,null));};exports[_0xbee9('0x42')]=function(_0x1f7b18,_0x2d3074){var _0x1804cc={'raw':![],'where':{'id':_0x1f7b18[_0xbee9('0x43')]['id']}},_0x419b4c={};_0x419b4c[_0xbee9('0x2d')]=_[_0xbee9('0x2e')](db['FreshdeskConfiguration'][_0xbee9('0x2b')]);_0x419b4c[_0xbee9('0x2f')]=_['keys'](_0x1f7b18['query']);_0x419b4c[_0xbee9('0x30')]=_[_0xbee9('0x31')](_0x419b4c[_0xbee9('0x2d')],_0x419b4c[_0xbee9('0x2f')]);_0x1804cc[_0xbee9('0x32')]=_[_0xbee9('0x31')](_0x419b4c[_0xbee9('0x2d')],qs['fields'](_0x1f7b18[_0xbee9('0x2f')][_0xbee9('0x33')]));_0x1804cc[_0xbee9('0x32')]=_0x1804cc[_0xbee9('0x32')]['length']?_0x1804cc[_0xbee9('0x32')]:_0x419b4c[_0xbee9('0x2d')];if(_0x1f7b18[_0xbee9('0x2f')]['includeAll']){_0x1804cc[_0xbee9('0x3e')]=[{'all':!![]}];}_0x1804cc=_[_0xbee9('0x3a')]({},_0x1804cc,_0x1f7b18[_0xbee9('0x3d')]);return db[_0xbee9('0x2a')][_0xbee9('0x44')](_0x1804cc)['then'](handleEntityNotFound(_0x2d3074,null))[_0xbee9('0x24')](respondWithResult(_0x2d3074,null))[_0xbee9('0x41')](handleError(_0x2d3074,null));};exports['create']=function(_0x1bef49,_0x14ddc2){return db['FreshdeskConfiguration'][_0xbee9('0x45')](_0x1bef49[_0xbee9('0x46')],{})['then'](respondWithResult(_0x14ddc2,0xc9))['catch'](handleError(_0x14ddc2,null));};exports['update']=function(_0x530b5d,_0x268a09){if(_0x530b5d[_0xbee9('0x46')]['id']){delete _0x530b5d[_0xbee9('0x46')]['id'];}return db[_0xbee9('0x2a')]['find']({'where':{'id':_0x530b5d[_0xbee9('0x43')]['id']}})[_0xbee9('0x24')](handleEntityNotFound(_0x268a09,null))[_0xbee9('0x24')](saveUpdates(_0x530b5d[_0xbee9('0x46')],null))[_0xbee9('0x24')](respondWithResult(_0x268a09,null))[_0xbee9('0x41')](handleError(_0x268a09,null));};exports[_0xbee9('0x23')]=function(_0x1ac45e,_0x261cf3){return db[_0xbee9('0x2a')][_0xbee9('0x44')]({'where':{'id':_0x1ac45e['params']['id']}})[_0xbee9('0x24')](handleEntityNotFound(_0x261cf3,null))[_0xbee9('0x24')](removeEntity(_0x261cf3,null))[_0xbee9('0x41')](handleError(_0x261cf3,null));};exports[_0xbee9('0x47')]=function(_0x1b4591,_0x5686c6,_0x4ef92c){var _0x58a521={};var _0xcce6e3={};var _0x33f5f8;var _0x2ff61b;return db[_0xbee9('0x2a')][_0xbee9('0x48')]({'where':{'id':_0x1b4591[_0xbee9('0x43')]['id']}})[_0xbee9('0x24')](handleEntityNotFound(_0x5686c6,null))['then'](function(_0xa7a0b1){if(_0xa7a0b1){_0x33f5f8=_0xa7a0b1;_0xcce6e3[_0xbee9('0x2d')]=_[_0xbee9('0x2e')](db[_0xbee9('0x49')][_0xbee9('0x2b')]);_0xcce6e3['query']=_[_0xbee9('0x2e')](_0x1b4591['query']);_0xcce6e3['filters']=_[_0xbee9('0x31')](_0xcce6e3[_0xbee9('0x2d')],_0xcce6e3[_0xbee9('0x2f')]);_0x58a521[_0xbee9('0x32')]=_['intersection'](_0xcce6e3['model'],qs[_0xbee9('0x33')](_0x1b4591['query']['fields']));_0x58a521[_0xbee9('0x32')]=_0x58a521[_0xbee9('0x32')]['length']?_0x58a521[_0xbee9('0x32')]:_0xcce6e3[_0xbee9('0x2d')];_0x58a521[_0xbee9('0x4a')]=qs[_0xbee9('0x36')](_0x1b4591[_0xbee9('0x2f')][_0xbee9('0x36')]);_0x58a521['where']=qs[_0xbee9('0x30')](_['pick'](_0x1b4591[_0xbee9('0x2f')],_0xcce6e3[_0xbee9('0x30')]));if(_0x1b4591[_0xbee9('0x2f')][_0xbee9('0x39')]){_0x58a521[_0xbee9('0x37')]=_[_0xbee9('0x3a')](_0x58a521['where'],{'$or':_[_0xbee9('0x29')](_0x58a521[_0xbee9('0x32')],function(_0x57522e){var _0xf4e8b8={};_0xf4e8b8[_0x57522e]={'$like':'%'+_0x1b4591[_0xbee9('0x2f')]['filter']+'%'};return _0xf4e8b8;})});}_0x58a521=_['merge']({},_0x58a521,_0x1b4591[_0xbee9('0x3d')]);return _0x33f5f8['getFields'](_0x58a521);}})[_0xbee9('0x24')](function(_0x27ed29){if(_0x27ed29){_0x2ff61b=_0x27ed29[_0xbee9('0x34')];if(!_0x1b4591[_0xbee9('0x2f')][_0xbee9('0x4b')](_0xbee9('0x35'))){_0x58a521[_0xbee9('0x1d')]=qs[_0xbee9('0x1d')](_0x1b4591[_0xbee9('0x2f')][_0xbee9('0x1d')]);_0x58a521[_0xbee9('0x1a')]=qs['offset'](_0x1b4591['query'][_0xbee9('0x1a')]);}return _0x33f5f8[_0xbee9('0x47')](_0x58a521);}})[_0xbee9('0x24')](function(_0x45cb88){if(_0x45cb88){return _0x45cb88?{'count':_0x2ff61b,'rows':_0x45cb88}:null;}})[_0xbee9('0x24')](respondWithResult(_0x5686c6,null))[_0xbee9('0x41')](handleError(_0x5686c6,null));};exports['getSubjects']=function(_0x1d0a50,_0x7d9cdd,_0x584b3b){var _0x40f3d1={};var _0x393a69={};var _0x151f1d;var _0x3c34be;return db[_0xbee9('0x2a')][_0xbee9('0x48')]({'where':{'id':_0x1d0a50[_0xbee9('0x43')]['id']}})[_0xbee9('0x24')](handleEntityNotFound(_0x7d9cdd,null))[_0xbee9('0x24')](function(_0x4b0c5f){if(_0x4b0c5f){_0x151f1d=_0x4b0c5f;_0x393a69[_0xbee9('0x2d')]=_[_0xbee9('0x2e')](db[_0xbee9('0x49')]['rawAttributes']);_0x393a69[_0xbee9('0x2f')]=_[_0xbee9('0x2e')](_0x1d0a50[_0xbee9('0x2f')]);_0x393a69[_0xbee9('0x30')]=_[_0xbee9('0x31')](_0x393a69[_0xbee9('0x2d')],_0x393a69[_0xbee9('0x2f')]);_0x40f3d1[_0xbee9('0x32')]=_[_0xbee9('0x31')](_0x393a69[_0xbee9('0x2d')],qs['fields'](_0x1d0a50[_0xbee9('0x2f')]['fields']));_0x40f3d1['attributes']=_0x40f3d1[_0xbee9('0x32')][_0xbee9('0x34')]?_0x40f3d1['attributes']:_0x393a69['model'];_0x40f3d1[_0xbee9('0x4a')]=qs[_0xbee9('0x36')](_0x1d0a50['query']['sort']);_0x40f3d1['where']=qs['filters'](_[_0xbee9('0x38')](_0x1d0a50[_0xbee9('0x2f')],_0x393a69[_0xbee9('0x30')]));if(_0x1d0a50[_0xbee9('0x2f')]['filter']){_0x40f3d1['where']=_[_0xbee9('0x3a')](_0x40f3d1[_0xbee9('0x37')],{'$or':_['map'](_0x40f3d1[_0xbee9('0x32')],function(_0xb97c3){var _0x53bf56={};_0x53bf56[_0xb97c3]={'$like':'%'+_0x1d0a50[_0xbee9('0x2f')][_0xbee9('0x39')]+'%'};return _0x53bf56;})});}_0x40f3d1=_[_0xbee9('0x3a')]({},_0x40f3d1,_0x1d0a50['options']);return _0x151f1d['getSubjects'](_0x40f3d1);}})[_0xbee9('0x24')](function(_0x2098ad){if(_0x2098ad){_0x3c34be=_0x2098ad[_0xbee9('0x34')];if(!_0x1d0a50[_0xbee9('0x2f')]['hasOwnProperty'](_0xbee9('0x35'))){_0x40f3d1['limit']=qs[_0xbee9('0x1d')](_0x1d0a50['query']['limit']);_0x40f3d1['offset']=qs['offset'](_0x1d0a50['query'][_0xbee9('0x1a')]);}return _0x151f1d[_0xbee9('0x4c')](_0x40f3d1);}})[_0xbee9('0x24')](function(_0x4c4ff2){if(_0x4c4ff2){return _0x4c4ff2?{'count':_0x3c34be,'rows':_0x4c4ff2}:null;}})['then'](respondWithResult(_0x7d9cdd,null))[_0xbee9('0x41')](handleError(_0x7d9cdd,null));};exports[_0xbee9('0x4d')]=function(_0x5488da,_0x41763e,_0x4b812a){var _0x2ad619={};var _0x120d35={};var _0x3cd4db;var _0x4061a7;return db[_0xbee9('0x2a')]['findOne']({'where':{'id':_0x5488da[_0xbee9('0x43')]['id']}})[_0xbee9('0x24')](handleEntityNotFound(_0x41763e,null))['then'](function(_0x89aa96){if(_0x89aa96){_0x3cd4db=_0x89aa96;_0x120d35[_0xbee9('0x2d')]=_[_0xbee9('0x2e')](db[_0xbee9('0x49')][_0xbee9('0x2b')]);_0x120d35[_0xbee9('0x2f')]=_[_0xbee9('0x2e')](_0x5488da[_0xbee9('0x2f')]);_0x120d35['filters']=_['intersection'](_0x120d35[_0xbee9('0x2d')],_0x120d35[_0xbee9('0x2f')]);_0x2ad619[_0xbee9('0x32')]=_[_0xbee9('0x31')](_0x120d35['model'],qs[_0xbee9('0x33')](_0x5488da[_0xbee9('0x2f')][_0xbee9('0x33')]));_0x2ad619[_0xbee9('0x32')]=_0x2ad619[_0xbee9('0x32')][_0xbee9('0x34')]?_0x2ad619[_0xbee9('0x32')]:_0x120d35[_0xbee9('0x2d')];_0x2ad619[_0xbee9('0x4a')]=qs[_0xbee9('0x36')](_0x5488da['query']['sort']);_0x2ad619[_0xbee9('0x37')]=qs[_0xbee9('0x30')](_['pick'](_0x5488da[_0xbee9('0x2f')],_0x120d35[_0xbee9('0x30')]));if(_0x5488da[_0xbee9('0x2f')][_0xbee9('0x39')]){_0x2ad619[_0xbee9('0x37')]=_[_0xbee9('0x3a')](_0x2ad619[_0xbee9('0x37')],{'$or':_[_0xbee9('0x29')](_0x2ad619[_0xbee9('0x32')],function(_0x386f0b){var _0xdc83e2={};_0xdc83e2[_0x386f0b]={'$like':'%'+_0x5488da[_0xbee9('0x2f')][_0xbee9('0x39')]+'%'};return _0xdc83e2;})});}_0x2ad619=_[_0xbee9('0x3a')]({},_0x2ad619,_0x5488da[_0xbee9('0x3d')]);return _0x3cd4db[_0xbee9('0x4d')](_0x2ad619);}})[_0xbee9('0x24')](function(_0x6b89a4){if(_0x6b89a4){_0x4061a7=_0x6b89a4[_0xbee9('0x34')];if(!_0x5488da['query'][_0xbee9('0x4b')](_0xbee9('0x35'))){_0x2ad619['limit']=qs['limit'](_0x5488da[_0xbee9('0x2f')][_0xbee9('0x1d')]);_0x2ad619['offset']=qs['offset'](_0x5488da['query'][_0xbee9('0x1a')]);}return _0x3cd4db['getDescriptions'](_0x2ad619);}})[_0xbee9('0x24')](function(_0x30dd24){if(_0x30dd24){return _0x30dd24?{'count':_0x4061a7,'rows':_0x30dd24}:null;}})['then'](respondWithResult(_0x41763e,null))['catch'](handleError(_0x41763e,null));};exports[_0xbee9('0x4e')]=function(_0x5c89e7,_0x2154e4,_0x3a7a35){var _0x3b7d52={};var _0x4bddb7={};var _0x2b46de;var _0x1f250c;return db[_0xbee9('0x2a')][_0xbee9('0x48')]({'where':{'id':_0x5c89e7[_0xbee9('0x43')]['id']}})[_0xbee9('0x24')](handleEntityNotFound(_0x2154e4,null))[_0xbee9('0x24')](function(_0x2c41f8){if(_0x2c41f8){_0x2b46de=_0x2c41f8;_0x4bddb7[_0xbee9('0x2d')]=_[_0xbee9('0x2e')](db[_0xbee9('0x4f')][_0xbee9('0x2b')]);_0x4bddb7[_0xbee9('0x2f')]=_[_0xbee9('0x2e')](_0x5c89e7['query']);_0x4bddb7['filters']=_[_0xbee9('0x31')](_0x4bddb7['model'],_0x4bddb7[_0xbee9('0x2f')]);_0x3b7d52['attributes']=_[_0xbee9('0x31')](_0x4bddb7[_0xbee9('0x2d')],qs[_0xbee9('0x33')](_0x5c89e7[_0xbee9('0x2f')][_0xbee9('0x33')]));_0x3b7d52[_0xbee9('0x32')]=_0x3b7d52[_0xbee9('0x32')][_0xbee9('0x34')]?_0x3b7d52[_0xbee9('0x32')]:_0x4bddb7['model'];_0x3b7d52['order']=qs['sort'](_0x5c89e7['query'][_0xbee9('0x36')]);_0x3b7d52[_0xbee9('0x37')]=qs[_0xbee9('0x30')](_['pick'](_0x5c89e7[_0xbee9('0x2f')],_0x4bddb7[_0xbee9('0x30')]));if(_0x5c89e7['query'][_0xbee9('0x39')]){_0x3b7d52[_0xbee9('0x37')]=_[_0xbee9('0x3a')](_0x3b7d52['where'],{'$or':_[_0xbee9('0x29')](_0x3b7d52['attributes'],function(_0x33cfc9){var _0x2f78e1={};_0x2f78e1[_0x33cfc9]={'$like':'%'+_0x5c89e7[_0xbee9('0x2f')]['filter']+'%'};return _0x2f78e1;})});}_0x3b7d52=_[_0xbee9('0x3a')]({},_0x3b7d52,_0x5c89e7['options']);return _0x2b46de['getTags'](_0x3b7d52);}})['then'](function(_0x1f4240){if(_0x1f4240){_0x1f250c=_0x1f4240[_0xbee9('0x34')];if(!_0x5c89e7[_0xbee9('0x2f')][_0xbee9('0x4b')](_0xbee9('0x35'))){_0x3b7d52[_0xbee9('0x1d')]=qs[_0xbee9('0x1d')](_0x5c89e7[_0xbee9('0x2f')][_0xbee9('0x1d')]);_0x3b7d52['offset']=qs['offset'](_0x5c89e7[_0xbee9('0x2f')][_0xbee9('0x1a')]);}return _0x2b46de['getTags'](_0x3b7d52);}})[_0xbee9('0x24')](function(_0x1f14d3){if(_0x1f14d3){return _0x1f14d3?{'count':_0x1f250c,'rows':_0x1f14d3}:null;}})[_0xbee9('0x24')](respondWithResult(_0x2154e4,null))['catch'](handleError(_0x2154e4,null));};exports[_0xbee9('0x50')]=function(_0x58e5f8,_0x44c572,_0x4df141){if(_0x58e5f8[_0xbee9('0x46')]['id']){delete _0x58e5f8[_0xbee9('0x46')]['id'];}return db[_0xbee9('0x2a')][_0xbee9('0x48')]({'where':{'id':_0x58e5f8['params']['id']}})[_0xbee9('0x24')](handleEntityNotFound(_0x44c572,null))['then'](function(_0x54650f){if(_0x54650f){return _0x54650f[_0xbee9('0x50')](_0x58e5f8['body']['ids']||[]);}return null;})[_0xbee9('0x24')](respondWithResult(_0x44c572,null))[_0xbee9('0x41')](handleError(_0x44c572,null));};
\ No newline at end of file
+var _0x1718=['hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','create','update','body','find','getFields','findOne','FreshdeskField','filter','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields'];(function(_0x4629e1,_0x15ec63){var _0x521c5b=function(_0x2cf921){while(--_0x2cf921){_0x4629e1['push'](_0x4629e1['shift']());}};_0x521c5b(++_0x15ec63);}(_0x1718,0x117));var _0x8171=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1718[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8171('0x0'));var zipdir=require(_0x8171('0x1'));var jsonpatch=require(_0x8171('0x2'));var rp=require('request-promise');var moment=require(_0x8171('0x3'));var BPromise=require(_0x8171('0x4'));var Mustache=require('mustache');var util=require(_0x8171('0x5'));var path=require(_0x8171('0x6'));var sox=require(_0x8171('0x7'));var csv=require(_0x8171('0x8'));var ejs=require(_0x8171('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8171('0xa'));var squel=require(_0x8171('0xb'));var crypto=require(_0x8171('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8171('0xd'));var toCsv=require(_0x8171('0x8'));var querystring=require(_0x8171('0xe'));var Papa=require(_0x8171('0xf'));var Redis=require(_0x8171('0x10'));var authService=require(_0x8171('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8171('0x12'));var hardwareService=require(_0x8171('0x13'));var logger=require(_0x8171('0x14'))('api');var utils=require(_0x8171('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8171('0x16'))['db'];function respondWithStatusCode(_0x514e25,_0x13bd66){_0x13bd66=_0x13bd66||0xcc;return function(_0x2fe569){if(_0x2fe569){return _0x514e25[_0x8171('0x17')](_0x13bd66);}return _0x514e25[_0x8171('0x18')](_0x13bd66)[_0x8171('0x19')]();};}function respondWithResult(_0x285260,_0x32bc03){_0x32bc03=_0x32bc03||0xc8;return function(_0x1bce7f){if(_0x1bce7f){return _0x285260[_0x8171('0x18')](_0x32bc03)[_0x8171('0x1a')](_0x1bce7f);}};}function respondWithFilteredResult(_0x5c9871,_0x3adbf9){return function(_0x34daac){if(_0x34daac){var _0x4f6d63=typeof _0x3adbf9[_0x8171('0x1b')]===_0x8171('0x1c')&&typeof _0x3adbf9[_0x8171('0x1d')]===_0x8171('0x1c');var _0x4b008f=_0x34daac[_0x8171('0x1e')];var _0x35dd65=_0x4f6d63?0x0:_0x3adbf9[_0x8171('0x1b')];var _0x19dd29=_0x4f6d63?_0x34daac[_0x8171('0x1e')]:_0x3adbf9[_0x8171('0x1b')]+_0x3adbf9[_0x8171('0x1d')];var _0x16e250;if(_0x19dd29>=_0x4b008f){_0x19dd29=_0x4b008f;_0x16e250=0xc8;}else{_0x16e250=0xce;}_0x5c9871['status'](_0x16e250);return _0x5c9871[_0x8171('0x1f')](_0x8171('0x20'),_0x35dd65+'-'+_0x19dd29+'/'+_0x4b008f)[_0x8171('0x1a')](_0x34daac);}return null;};}function patchUpdates(_0x12a6ad){return function(_0x476785){try{jsonpatch[_0x8171('0x21')](_0x476785,_0x12a6ad,!![]);}catch(_0x4505e4){return BPromise[_0x8171('0x22')](_0x4505e4);}return _0x476785['save']();};}function saveUpdates(_0x140755,_0x1a37ba){return function(_0x3b0db9){if(_0x3b0db9){return _0x3b0db9['update'](_0x140755)[_0x8171('0x23')](function(_0x26e5fc){return _0x26e5fc;});}return null;};}function removeEntity(_0x5d3ef5,_0x22851d){return function(_0x83ad6c){if(_0x83ad6c){return _0x83ad6c[_0x8171('0x24')]()[_0x8171('0x23')](function(){_0x5d3ef5['status'](0xcc)[_0x8171('0x19')]();});}};}function handleEntityNotFound(_0x103a5b,_0xee1fb){return function(_0x32649d){if(!_0x32649d){_0x103a5b['sendStatus'](0x194);}return _0x32649d;};}function handleError(_0x5da59f,_0x1d7fe3){_0x1d7fe3=_0x1d7fe3||0x1f4;return function(_0x20631f){logger[_0x8171('0x25')](_0x20631f[_0x8171('0x26')]);if(_0x20631f['name']){delete _0x20631f[_0x8171('0x27')];}_0x5da59f[_0x8171('0x18')](_0x1d7fe3)[_0x8171('0x28')](_0x20631f);};}exports['index']=function(_0x575e66,_0x384900){var _0x35b4fb={},_0x4bfab4={},_0x4987d6={'count':0x0,'rows':[]};var _0x281582=_['map'](db[_0x8171('0x29')][_0x8171('0x2a')],function(_0x524874){return{'name':_0x524874[_0x8171('0x2b')],'type':_0x524874[_0x8171('0x2c')][_0x8171('0x2d')]};});_0x4bfab4[_0x8171('0x2e')]=_[_0x8171('0x2f')](_0x281582,_0x8171('0x27'));_0x4bfab4['query']=_[_0x8171('0x30')](_0x575e66[_0x8171('0x31')]);_0x4bfab4['filters']=_[_0x8171('0x32')](_0x4bfab4[_0x8171('0x2e')],_0x4bfab4[_0x8171('0x31')]);_0x35b4fb[_0x8171('0x33')]=_['intersection'](_0x4bfab4[_0x8171('0x2e')],qs[_0x8171('0x34')](_0x575e66[_0x8171('0x31')][_0x8171('0x34')]));_0x35b4fb[_0x8171('0x33')]=_0x35b4fb[_0x8171('0x33')]['length']?_0x35b4fb[_0x8171('0x33')]:_0x4bfab4[_0x8171('0x2e')];if(!_0x575e66[_0x8171('0x31')][_0x8171('0x35')](_0x8171('0x36'))){_0x35b4fb[_0x8171('0x1d')]=qs['limit'](_0x575e66['query'][_0x8171('0x1d')]);_0x35b4fb[_0x8171('0x1b')]=qs[_0x8171('0x1b')](_0x575e66[_0x8171('0x31')][_0x8171('0x1b')]);}_0x35b4fb[_0x8171('0x37')]=qs['sort'](_0x575e66[_0x8171('0x31')][_0x8171('0x38')]);_0x35b4fb['where']=qs['filters'](_[_0x8171('0x39')](_0x575e66[_0x8171('0x31')],_0x4bfab4[_0x8171('0x3a')]),_0x281582);if(_0x575e66[_0x8171('0x31')]['filter']){_0x35b4fb[_0x8171('0x3b')]=_[_0x8171('0x3c')](_0x35b4fb[_0x8171('0x3b')],{'$or':_[_0x8171('0x2f')](_0x281582,function(_0xf985cb){if(_0xf985cb['type']!=='VIRTUAL'){var _0x283a09={};_0x283a09[_0xf985cb[_0x8171('0x27')]]={'$like':'%'+_0x575e66[_0x8171('0x31')]['filter']+'%'};return _0x283a09;}})});}_0x35b4fb=_[_0x8171('0x3c')]({},_0x35b4fb,_0x575e66['options']);var _0x5583dc={'where':_0x35b4fb[_0x8171('0x3b')]};return db[_0x8171('0x29')][_0x8171('0x1e')](_0x5583dc)['then'](function(_0x2b55fe){_0x4987d6[_0x8171('0x1e')]=_0x2b55fe;if(_0x575e66[_0x8171('0x31')][_0x8171('0x3d')]){_0x35b4fb[_0x8171('0x3e')]=[{'all':!![]}];}return db[_0x8171('0x29')][_0x8171('0x3f')](_0x35b4fb);})[_0x8171('0x23')](function(_0x140264){_0x4987d6[_0x8171('0x40')]=_0x140264;return _0x4987d6;})[_0x8171('0x23')](respondWithFilteredResult(_0x384900,_0x35b4fb))[_0x8171('0x41')](handleError(_0x384900,null));};exports[_0x8171('0x42')]=function(_0x48c646,_0x5e5438){var _0x8e9dd2={'raw':![],'where':{'id':_0x48c646[_0x8171('0x43')]['id']}},_0x4208ca={};_0x4208ca['model']=_[_0x8171('0x30')](db[_0x8171('0x29')][_0x8171('0x2a')]);_0x4208ca[_0x8171('0x31')]=_['keys'](_0x48c646[_0x8171('0x31')]);_0x4208ca[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x4208ca[_0x8171('0x2e')],_0x4208ca[_0x8171('0x31')]);_0x8e9dd2[_0x8171('0x33')]=_[_0x8171('0x32')](_0x4208ca[_0x8171('0x2e')],qs[_0x8171('0x34')](_0x48c646[_0x8171('0x31')][_0x8171('0x34')]));_0x8e9dd2[_0x8171('0x33')]=_0x8e9dd2['attributes'][_0x8171('0x44')]?_0x8e9dd2[_0x8171('0x33')]:_0x4208ca[_0x8171('0x2e')];if(_0x48c646[_0x8171('0x31')]['includeAll']){_0x8e9dd2[_0x8171('0x3e')]=[{'all':!![]}];}_0x8e9dd2=_[_0x8171('0x3c')]({},_0x8e9dd2,_0x48c646[_0x8171('0x45')]);return db['FreshdeskConfiguration']['find'](_0x8e9dd2)[_0x8171('0x23')](handleEntityNotFound(_0x5e5438,null))[_0x8171('0x23')](respondWithResult(_0x5e5438,null))[_0x8171('0x41')](handleError(_0x5e5438,null));};exports[_0x8171('0x46')]=function(_0x55e137,_0x559b1c){return db['FreshdeskConfiguration'][_0x8171('0x46')](_0x55e137['body'],{})['then'](respondWithResult(_0x559b1c,0xc9))['catch'](handleError(_0x559b1c,null));};exports[_0x8171('0x47')]=function(_0x428507,_0x511b26){if(_0x428507[_0x8171('0x48')]['id']){delete _0x428507['body']['id'];}return db[_0x8171('0x29')]['find']({'where':{'id':_0x428507[_0x8171('0x43')]['id']}})['then'](handleEntityNotFound(_0x511b26,null))[_0x8171('0x23')](saveUpdates(_0x428507[_0x8171('0x48')],null))[_0x8171('0x23')](respondWithResult(_0x511b26,null))[_0x8171('0x41')](handleError(_0x511b26,null));};exports[_0x8171('0x24')]=function(_0x390c64,_0x48403f){return db['FreshdeskConfiguration'][_0x8171('0x49')]({'where':{'id':_0x390c64[_0x8171('0x43')]['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x48403f,null))[_0x8171('0x23')](removeEntity(_0x48403f,null))[_0x8171('0x41')](handleError(_0x48403f,null));};exports[_0x8171('0x4a')]=function(_0x341be8,_0x5eab18,_0x47fb80){var _0x5f2dd4={};var _0x3494ec={};var _0x271ee6;var _0xbab36b;return db[_0x8171('0x29')][_0x8171('0x4b')]({'where':{'id':_0x341be8['params']['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x5eab18,null))['then'](function(_0x542e3d){if(_0x542e3d){_0x271ee6=_0x542e3d;_0x3494ec['model']=_[_0x8171('0x30')](db[_0x8171('0x4c')]['rawAttributes']);_0x3494ec[_0x8171('0x31')]=_[_0x8171('0x30')](_0x341be8[_0x8171('0x31')]);_0x3494ec[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x3494ec[_0x8171('0x2e')],_0x3494ec[_0x8171('0x31')]);_0x5f2dd4[_0x8171('0x33')]=_[_0x8171('0x32')](_0x3494ec[_0x8171('0x2e')],qs[_0x8171('0x34')](_0x341be8[_0x8171('0x31')][_0x8171('0x34')]));_0x5f2dd4['attributes']=_0x5f2dd4[_0x8171('0x33')][_0x8171('0x44')]?_0x5f2dd4[_0x8171('0x33')]:_0x3494ec['model'];_0x5f2dd4[_0x8171('0x37')]=qs[_0x8171('0x38')](_0x341be8[_0x8171('0x31')][_0x8171('0x38')]);_0x5f2dd4['where']=qs['filters'](_[_0x8171('0x39')](_0x341be8[_0x8171('0x31')],_0x3494ec[_0x8171('0x3a')]));if(_0x341be8[_0x8171('0x31')][_0x8171('0x4d')]){_0x5f2dd4[_0x8171('0x3b')]=_[_0x8171('0x3c')](_0x5f2dd4[_0x8171('0x3b')],{'$or':_[_0x8171('0x2f')](_0x5f2dd4['attributes'],function(_0xc23587){var _0x2b89f6={};_0x2b89f6[_0xc23587]={'$like':'%'+_0x341be8[_0x8171('0x31')]['filter']+'%'};return _0x2b89f6;})});}_0x5f2dd4=_[_0x8171('0x3c')]({},_0x5f2dd4,_0x341be8[_0x8171('0x45')]);return _0x271ee6['getFields'](_0x5f2dd4);}})[_0x8171('0x23')](function(_0x5ae507){if(_0x5ae507){_0xbab36b=_0x5ae507[_0x8171('0x44')];if(!_0x341be8[_0x8171('0x31')]['hasOwnProperty']('nolimit')){_0x5f2dd4[_0x8171('0x1d')]=qs[_0x8171('0x1d')](_0x341be8[_0x8171('0x31')]['limit']);_0x5f2dd4[_0x8171('0x1b')]=qs[_0x8171('0x1b')](_0x341be8[_0x8171('0x31')][_0x8171('0x1b')]);}return _0x271ee6[_0x8171('0x4a')](_0x5f2dd4);}})[_0x8171('0x23')](function(_0x454767){if(_0x454767){return _0x454767?{'count':_0xbab36b,'rows':_0x454767}:null;}})[_0x8171('0x23')](respondWithResult(_0x5eab18,null))[_0x8171('0x41')](handleError(_0x5eab18,null));};exports[_0x8171('0x4e')]=function(_0x671077,_0x2abf75,_0x42f62f){var _0x29abee={};var _0x2dd32d={};var _0x1e7e08;var _0x512797;return db['FreshdeskConfiguration'][_0x8171('0x4b')]({'where':{'id':_0x671077[_0x8171('0x43')]['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x2abf75,null))[_0x8171('0x23')](function(_0x21a28d){if(_0x21a28d){_0x1e7e08=_0x21a28d;_0x2dd32d[_0x8171('0x2e')]=_[_0x8171('0x30')](db[_0x8171('0x4c')][_0x8171('0x2a')]);_0x2dd32d[_0x8171('0x31')]=_['keys'](_0x671077[_0x8171('0x31')]);_0x2dd32d[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x2dd32d['model'],_0x2dd32d[_0x8171('0x31')]);_0x29abee[_0x8171('0x33')]=_[_0x8171('0x32')](_0x2dd32d['model'],qs[_0x8171('0x34')](_0x671077['query'][_0x8171('0x34')]));_0x29abee['attributes']=_0x29abee['attributes']['length']?_0x29abee[_0x8171('0x33')]:_0x2dd32d['model'];_0x29abee[_0x8171('0x37')]=qs[_0x8171('0x38')](_0x671077[_0x8171('0x31')][_0x8171('0x38')]);_0x29abee[_0x8171('0x3b')]=qs[_0x8171('0x3a')](_['pick'](_0x671077[_0x8171('0x31')],_0x2dd32d[_0x8171('0x3a')]));if(_0x671077[_0x8171('0x31')][_0x8171('0x4d')]){_0x29abee[_0x8171('0x3b')]=_[_0x8171('0x3c')](_0x29abee[_0x8171('0x3b')],{'$or':_['map'](_0x29abee[_0x8171('0x33')],function(_0x273324){var _0x56f4f0={};_0x56f4f0[_0x273324]={'$like':'%'+_0x671077[_0x8171('0x31')]['filter']+'%'};return _0x56f4f0;})});}_0x29abee=_[_0x8171('0x3c')]({},_0x29abee,_0x671077[_0x8171('0x45')]);return _0x1e7e08['getSubjects'](_0x29abee);}})['then'](function(_0x3a735c){if(_0x3a735c){_0x512797=_0x3a735c['length'];if(!_0x671077['query'][_0x8171('0x35')](_0x8171('0x36'))){_0x29abee[_0x8171('0x1d')]=qs[_0x8171('0x1d')](_0x671077[_0x8171('0x31')][_0x8171('0x1d')]);_0x29abee[_0x8171('0x1b')]=qs[_0x8171('0x1b')](_0x671077[_0x8171('0x31')]['offset']);}return _0x1e7e08[_0x8171('0x4e')](_0x29abee);}})['then'](function(_0x22a256){if(_0x22a256){return _0x22a256?{'count':_0x512797,'rows':_0x22a256}:null;}})[_0x8171('0x23')](respondWithResult(_0x2abf75,null))['catch'](handleError(_0x2abf75,null));};exports['getDescriptions']=function(_0x17bd1a,_0x5a61d4,_0x3fc545){var _0x1562bd={};var _0x52e9cd={};var _0x426a49;var _0x51265a;return db['FreshdeskConfiguration'][_0x8171('0x4b')]({'where':{'id':_0x17bd1a['params']['id']}})['then'](handleEntityNotFound(_0x5a61d4,null))[_0x8171('0x23')](function(_0x433632){if(_0x433632){_0x426a49=_0x433632;_0x52e9cd['model']=_[_0x8171('0x30')](db['FreshdeskField'][_0x8171('0x2a')]);_0x52e9cd[_0x8171('0x31')]=_[_0x8171('0x30')](_0x17bd1a[_0x8171('0x31')]);_0x52e9cd[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x52e9cd[_0x8171('0x2e')],_0x52e9cd[_0x8171('0x31')]);_0x1562bd['attributes']=_['intersection'](_0x52e9cd[_0x8171('0x2e')],qs['fields'](_0x17bd1a['query']['fields']));_0x1562bd['attributes']=_0x1562bd['attributes'][_0x8171('0x44')]?_0x1562bd[_0x8171('0x33')]:_0x52e9cd[_0x8171('0x2e')];_0x1562bd[_0x8171('0x37')]=qs[_0x8171('0x38')](_0x17bd1a[_0x8171('0x31')]['sort']);_0x1562bd[_0x8171('0x3b')]=qs['filters'](_['pick'](_0x17bd1a['query'],_0x52e9cd[_0x8171('0x3a')]));if(_0x17bd1a[_0x8171('0x31')][_0x8171('0x4d')]){_0x1562bd['where']=_['merge'](_0x1562bd[_0x8171('0x3b')],{'$or':_[_0x8171('0x2f')](_0x1562bd[_0x8171('0x33')],function(_0x38647f){var _0x4f2760={};_0x4f2760[_0x38647f]={'$like':'%'+_0x17bd1a[_0x8171('0x31')][_0x8171('0x4d')]+'%'};return _0x4f2760;})});}_0x1562bd=_[_0x8171('0x3c')]({},_0x1562bd,_0x17bd1a[_0x8171('0x45')]);return _0x426a49[_0x8171('0x4f')](_0x1562bd);}})[_0x8171('0x23')](function(_0x325306){if(_0x325306){_0x51265a=_0x325306['length'];if(!_0x17bd1a[_0x8171('0x31')][_0x8171('0x35')](_0x8171('0x36'))){_0x1562bd[_0x8171('0x1d')]=qs['limit'](_0x17bd1a['query'][_0x8171('0x1d')]);_0x1562bd[_0x8171('0x1b')]=qs[_0x8171('0x1b')](_0x17bd1a[_0x8171('0x31')][_0x8171('0x1b')]);}return _0x426a49[_0x8171('0x4f')](_0x1562bd);}})[_0x8171('0x23')](function(_0x10fe49){if(_0x10fe49){return _0x10fe49?{'count':_0x51265a,'rows':_0x10fe49}:null;}})['then'](respondWithResult(_0x5a61d4,null))[_0x8171('0x41')](handleError(_0x5a61d4,null));};exports[_0x8171('0x50')]=function(_0x294167,_0x4b3159,_0x2c8226){var _0x54fc80={};var _0x5d5af0={};var _0x51bb50;var _0xd7a5dd;return db[_0x8171('0x29')][_0x8171('0x4b')]({'where':{'id':_0x294167['params']['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x4b3159,null))[_0x8171('0x23')](function(_0x135589){if(_0x135589){_0x51bb50=_0x135589;_0x5d5af0[_0x8171('0x2e')]=_[_0x8171('0x30')](db['Tag'][_0x8171('0x2a')]);_0x5d5af0[_0x8171('0x31')]=_[_0x8171('0x30')](_0x294167[_0x8171('0x31')]);_0x5d5af0[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x5d5af0[_0x8171('0x2e')],_0x5d5af0[_0x8171('0x31')]);_0x54fc80[_0x8171('0x33')]=_[_0x8171('0x32')](_0x5d5af0[_0x8171('0x2e')],qs['fields'](_0x294167[_0x8171('0x31')][_0x8171('0x34')]));_0x54fc80[_0x8171('0x33')]=_0x54fc80['attributes'][_0x8171('0x44')]?_0x54fc80[_0x8171('0x33')]:_0x5d5af0[_0x8171('0x2e')];_0x54fc80['order']=qs[_0x8171('0x38')](_0x294167[_0x8171('0x31')][_0x8171('0x38')]);_0x54fc80[_0x8171('0x3b')]=qs[_0x8171('0x3a')](_[_0x8171('0x39')](_0x294167['query'],_0x5d5af0['filters']));if(_0x294167[_0x8171('0x31')][_0x8171('0x4d')]){_0x54fc80[_0x8171('0x3b')]=_['merge'](_0x54fc80[_0x8171('0x3b')],{'$or':_[_0x8171('0x2f')](_0x54fc80[_0x8171('0x33')],function(_0x4cff6f){var _0x4fdc88={};_0x4fdc88[_0x4cff6f]={'$like':'%'+_0x294167[_0x8171('0x31')][_0x8171('0x4d')]+'%'};return _0x4fdc88;})});}_0x54fc80=_[_0x8171('0x3c')]({},_0x54fc80,_0x294167['options']);return _0x51bb50[_0x8171('0x50')](_0x54fc80);}})[_0x8171('0x23')](function(_0x14b616){if(_0x14b616){_0xd7a5dd=_0x14b616[_0x8171('0x44')];if(!_0x294167[_0x8171('0x31')][_0x8171('0x35')](_0x8171('0x36'))){_0x54fc80['limit']=qs['limit'](_0x294167[_0x8171('0x31')][_0x8171('0x1d')]);_0x54fc80['offset']=qs['offset'](_0x294167['query']['offset']);}return _0x51bb50[_0x8171('0x50')](_0x54fc80);}})[_0x8171('0x23')](function(_0x1354a4){if(_0x1354a4){return _0x1354a4?{'count':_0xd7a5dd,'rows':_0x1354a4}:null;}})['then'](respondWithResult(_0x4b3159,null))[_0x8171('0x41')](handleError(_0x4b3159,null));};exports[_0x8171('0x51')]=function(_0x5e11fd,_0x1444c5,_0x2279ec){if(_0x5e11fd[_0x8171('0x48')]['id']){delete _0x5e11fd[_0x8171('0x48')]['id'];}return db[_0x8171('0x29')][_0x8171('0x4b')]({'where':{'id':_0x5e11fd['params']['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x1444c5,null))[_0x8171('0x23')](function(_0x141878){if(_0x141878){return _0x141878[_0x8171('0x51')](_0x5e11fd[_0x8171('0x48')][_0x8171('0x52')]||[]);}return null;})[_0x8171('0x23')](respondWithResult(_0x1444c5,null))[_0x8171('0x41')](handleError(_0x1444c5,null));};
\ No newline at end of file
index f8bc2f3..8875945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb66c=['../../config/logger','api','moment','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x19dfcd,_0x5cf48d){var _0x4a3fc1=function(_0x2b1deb){while(--_0x2b1deb){_0x19dfcd['push'](_0x19dfcd['shift']());}};_0x4a3fc1(++_0x5cf48d);}(_0xb66c,0x149));var _0xcb66=function(_0x3f2234,_0x3f1a8e){_0x3f2234=_0x3f2234-0x0;var _0x1133fb=_0xb66c[_0x3f2234];return _0x1133fb;};'use strict';var _=require('lodash');var util=require(_0xcb66('0x0'));var logger=require(_0xcb66('0x1'))(_0xcb66('0x2'));var moment=require(_0xcb66('0x3'));var BPromise=require('bluebird');var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require(_0xcb66('0x5'));var rimraf=require(_0xcb66('0x6'));var config=require('../../config/environment');var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x43beb4,_0x34d282){return _0x43beb4['define'](_0xcb66('0x9'),attributes,{'tableName':_0xcb66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd63f=['api','moment','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations','util'];(function(_0x6412f4,_0xf690c){var _0x5db899=function(_0xa0051b){while(--_0xa0051b){_0x6412f4['push'](_0x6412f4['shift']());}};_0x5db899(++_0xf690c);}(_0xd63f,0x1e5));var _0xfd63=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd63f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xfd63('0x0'));var logger=require('../../config/logger')(_0xfd63('0x1'));var moment=require(_0xfd63('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd63('0x3'));var rimraf=require(_0xfd63('0x4'));var config=require(_0xfd63('0x5'));var attributes=require(_0xfd63('0x6'));module['exports']=function(_0x495629,_0x284b77){return _0x495629[_0xfd63('0x7')]('FreshdeskConfiguration',attributes,{'tableName':_0xfd63('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5676658..96a208b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9691=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x214648,_0x16265d){var _0x520e6f=function(_0x3af627){while(--_0x3af627){_0x214648['push'](_0x214648['shift']());}};_0x520e6f(++_0x16265d);}(_0x9691,0x1a1));var _0x1969=function(_0x1e3c6c,_0x5bf8ae){_0x1e3c6c=_0x1e3c6c-0x0;var _0x40254d=_0x9691[_0x1e3c6c];return _0x40254d;};'use strict';var _=require(_0x1969('0x0'));var util=require(_0x1969('0x1'));var moment=require(_0x1969('0x2'));var BPromise=require(_0x1969('0x3'));var rs=require(_0x1969('0x4'));var fs=require('fs');var Redis=require(_0x1969('0x5'));var db=require(_0x1969('0x6'))['db'];var utils=require(_0x1969('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1969('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1969('0x9')][_0x1969('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd89cc1,_0x44875d,_0x1880e8){return new BPromise(function(_0x1af26d,_0x3c871e){return client[_0x1969('0xb')](_0xd89cc1,_0x1880e8)['then'](function(_0xd4da00){logger['info'](_0x1969('0xc'),_0x44875d,_0x1969('0xd'));logger[_0x1969('0xe')](_0x1969('0xf'),_0x44875d,_0x1969('0xd'),JSON[_0x1969('0x10')](_0xd4da00));if(_0xd4da00[_0x1969('0x11')]){if(_0xd4da00[_0x1969('0x11')][_0x1969('0x12')]===0x1f4){logger['error'](_0x1969('0xc'),_0x44875d,_0xd4da00['error']['message']);return _0x3c871e(_0xd4da00[_0x1969('0x11')][_0x1969('0x13')]);}logger[_0x1969('0x11')](_0x1969('0xc'),_0x44875d,_0xd4da00['error'][_0x1969('0x13')]);return _0x1af26d(_0xd4da00[_0x1969('0x11')]['message']);}else{logger[_0x1969('0x14')](_0x1969('0xc'),_0x44875d,_0x1969('0xd'));_0x1af26d(_0xd4da00[_0x1969('0x15')]['message']);}})[_0x1969('0x16')](function(_0x954cbe){logger[_0x1969('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x44875d,_0x954cbe);_0x3c871e(_0x954cbe);});});}
\ No newline at end of file
+var _0x5c12=['info','debug','request\x20sent','error','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x35128d,_0x97dfc3){var _0x20adf7=function(_0x30010e){while(--_0x30010e){_0x35128d['push'](_0x35128d['shift']());}};_0x20adf7(++_0x97dfc3);}(_0x5c12,0xf7));var _0x25c1=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x5c12[_0x440917];return _0x5e906b;};'use strict';var _=require(_0x25c1('0x0'));var util=require('util');var moment=require(_0x25c1('0x1'));var BPromise=require(_0x25c1('0x2'));var rs=require(_0x25c1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x25c1('0x4'))(_0x25c1('0x5'));var config=require('../../config/environment');var jayson=require(_0x25c1('0x6'));var client=jayson['client'][_0x25c1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x25f82f,_0x356d94,_0x25a507){return new BPromise(function(_0x2e0c74,_0x6e05b3){return client[_0x25c1('0x8')](_0x25f82f,_0x25a507)['then'](function(_0x1b9f15){logger[_0x25c1('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x356d94,'request\x20sent');logger[_0x25c1('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x356d94,_0x25c1('0xb'),JSON['stringify'](_0x1b9f15));if(_0x1b9f15['error']){if(_0x1b9f15['error']['code']===0x1f4){logger[_0x25c1('0xc')](_0x25c1('0xd'),_0x356d94,_0x1b9f15[_0x25c1('0xc')]['message']);return _0x6e05b3(_0x1b9f15[_0x25c1('0xc')][_0x25c1('0xe')]);}logger[_0x25c1('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x356d94,_0x1b9f15[_0x25c1('0xc')][_0x25c1('0xe')]);return _0x2e0c74(_0x1b9f15['error'][_0x25c1('0xe')]);}else{logger[_0x25c1('0x9')](_0x25c1('0xd'),_0x356d94,_0x25c1('0xb'));_0x2e0c74(_0x1b9f15['result'][_0x25c1('0xe')]);}})[_0x25c1('0xf')](function(_0x8e6df7){logger['error'](_0x25c1('0xd'),_0x356d94,_0x8e6df7);_0x6e05b3(_0x8e6df7);});});}
\ No newline at end of file
index 8d50400..fe7d397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e49=['put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x13c265,_0x524cc5){var _0x1bf813=function(_0x397d09){while(--_0x397d09){_0x13c265['push'](_0x13c265['shift']());}};_0x1bf813(++_0x524cc5);}(_0x5e49,0x1c6));var _0x95e4=function(_0x540c49,_0x3e88d9){_0x540c49=_0x540c49-0x0;var _0x390f69=_0x5e49[_0x540c49];return _0x390f69;};'use strict';var multer=require(_0x95e4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x95e4('0x1'));var express=require(_0x95e4('0x2'));var router=express[_0x95e4('0x3')]();var fs_extra=require(_0x95e4('0x4'));var auth=require(_0x95e4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x95e4('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x95e4('0x7')]('/',auth['isAuthenticated'](),controller[_0x95e4('0x8')]);router[_0x95e4('0x7')](_0x95e4('0x9'),auth[_0x95e4('0xa')](),controller[_0x95e4('0xb')]);router[_0x95e4('0xc')]('/',auth[_0x95e4('0xa')](),controller[_0x95e4('0xd')]);router[_0x95e4('0xe')](_0x95e4('0x9'),auth['isAuthenticated'](),controller[_0x95e4('0xf')]);router[_0x95e4('0x10')](_0x95e4('0x9'),auth[_0x95e4('0xa')](),controller[_0x95e4('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x324c=['put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','index','/:id','isAuthenticated','show','post','create'];(function(_0x594bfa,_0x5bfdca){var _0x429ab1=function(_0x3f94a6){while(--_0x3f94a6){_0x594bfa['push'](_0x594bfa['shift']());}};_0x429ab1(++_0x5bfdca);}(_0x324c,0x190));var _0xc324=function(_0x1dc458,_0xaa5925){_0x1dc458=_0x1dc458-0x0;var _0x2e2fa2=_0x324c[_0x1dc458];return _0x2e2fa2;};'use strict';var multer=require('multer');var util=require(_0xc324('0x0'));var path=require(_0xc324('0x1'));var timeout=require(_0xc324('0x2'));var express=require('express');var router=express[_0xc324('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc324('0x4'));var interaction=require(_0xc324('0x5'));var config=require(_0xc324('0x6'));var controller=require(_0xc324('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc324('0x8')]);router['get'](_0xc324('0x9'),auth[_0xc324('0xa')](),controller[_0xc324('0xb')]);router[_0xc324('0xc')]('/',auth[_0xc324('0xa')](),controller[_0xc324('0xd')]);router[_0xc324('0xe')](_0xc324('0x9'),auth[_0xc324('0xa')](),controller[_0xc324('0xf')]);router['delete'](_0xc324('0x9'),auth[_0xc324('0xa')](),controller[_0xc324('0x10')]);module[_0xc324('0x11')]=router;
\ No newline at end of file
index 981e9ae..2ab8a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12a4=['string','variable','customVariable','picklist','STRING','ENUM','sequelize'];(function(_0x1e22d6,_0x25605f){var _0x397cc4=function(_0x4339fa){while(--_0x4339fa){_0x1e22d6['push'](_0x1e22d6['shift']());}};_0x397cc4(++_0x25605f);}(_0x12a4,0x1db));var _0x412a=function(_0xd67723,_0x1e576f){_0xd67723=_0xd67723-0x0;var _0x53b62b=_0x12a4[_0xd67723];return _0x53b62b;};'use strict';var Sequelize=require(_0x412a('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x412a('0x1'),_0x412a('0x2'),_0x412a('0x3'),'keyValue',_0x412a('0x4')),'defaultValue':_0x412a('0x1')},'content':{'type':Sequelize[_0x412a('0x5')]},'key':{'type':Sequelize[_0x412a('0x5')]},'keyType':{'type':Sequelize[_0x412a('0x6')](_0x412a('0x1'),_0x412a('0x2'),_0x412a('0x3'))},'keyContent':{'type':Sequelize[_0x412a('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x412a('0x5')]}};
\ No newline at end of file
+var _0x0d0f=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x30c119,_0xfdf9b5){var _0x1babfa=function(_0x33e672){while(--_0x33e672){_0x30c119['push'](_0x30c119['shift']());}};_0x1babfa(++_0xfdf9b5);}(_0x0d0f,0x160));var _0xf0d0=function(_0x2134fa,_0x42a1dd){_0x2134fa=_0x2134fa-0x0;var _0x4a7d4f=_0x0d0f[_0x2134fa];return _0x4a7d4f;};'use strict';var Sequelize=require(_0xf0d0('0x0'));module[_0xf0d0('0x1')]={'type':{'type':Sequelize[_0xf0d0('0x2')](_0xf0d0('0x3'),_0xf0d0('0x4'),_0xf0d0('0x5'),_0xf0d0('0x6'),_0xf0d0('0x7')),'defaultValue':_0xf0d0('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf0d0('0x8')]},'keyType':{'type':Sequelize[_0xf0d0('0x2')]('string',_0xf0d0('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xf0d0('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf0d0('0x8')]},'customField':{'type':Sequelize[_0xf0d0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf0d0('0x8')]}};
\ No newline at end of file
index 09d50a5..381002b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98e5=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','name','index','FreshdeskField','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','filters','find','create','body','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel'];(function(_0x31678f,_0x4bd077){var _0x49d438=function(_0x5139d4){while(--_0x5139d4){_0x31678f['push'](_0x31678f['shift']());}};_0x49d438(++_0x4bd077);}(_0x98e5,0x8a));var _0x598e=function(_0x315a31,_0x36077f){_0x315a31=_0x315a31-0x0;var _0x39b3d0=_0x98e5[_0x315a31];return _0x39b3d0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x598e('0x0'));var rp=require(_0x598e('0x1'));var moment=require('moment');var BPromise=require(_0x598e('0x2'));var Mustache=require(_0x598e('0x3'));var util=require('util');var path=require(_0x598e('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x598e('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x598e('0x6'));var squel=require(_0x598e('0x7'));var crypto=require(_0x598e('0x8'));var jsforce=require(_0x598e('0x9'));var deskjs=require(_0x598e('0xa'));var toCsv=require(_0x598e('0xb'));var querystring=require(_0x598e('0xc'));var Papa=require(_0x598e('0xd'));var Redis=require(_0x598e('0xe'));var authService=require(_0x598e('0xf'));var qs=require(_0x598e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x598e('0x11'));var logger=require(_0x598e('0x12'))('api');var utils=require(_0x598e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x598e('0x14'));var db=require(_0x598e('0x15'))['db'];function respondWithStatusCode(_0x2e3614,_0xd29d12){_0xd29d12=_0xd29d12||0xcc;return function(_0x3811b2){if(_0x3811b2){return _0x2e3614['sendStatus'](_0xd29d12);}return _0x2e3614[_0x598e('0x16')](_0xd29d12)['end']();};}function respondWithResult(_0x1c3f37,_0x51d7f0){_0x51d7f0=_0x51d7f0||0xc8;return function(_0x4e253a){if(_0x4e253a){return _0x1c3f37[_0x598e('0x16')](_0x51d7f0)[_0x598e('0x17')](_0x4e253a);}};}function respondWithFilteredResult(_0x3d6571,_0x38868b){return function(_0x34c672){if(_0x34c672){var _0x93ba6c=typeof _0x38868b[_0x598e('0x18')]==='undefined'&&typeof _0x38868b[_0x598e('0x19')]===_0x598e('0x1a');var _0x3521bc=_0x34c672[_0x598e('0x1b')];var _0x50ffbb=_0x93ba6c?0x0:_0x38868b[_0x598e('0x18')];var _0x2ecb1e=_0x93ba6c?_0x34c672[_0x598e('0x1b')]:_0x38868b[_0x598e('0x18')]+_0x38868b[_0x598e('0x19')];var _0x1c1085;if(_0x2ecb1e>=_0x3521bc){_0x2ecb1e=_0x3521bc;_0x1c1085=0xc8;}else{_0x1c1085=0xce;}_0x3d6571[_0x598e('0x16')](_0x1c1085);return _0x3d6571[_0x598e('0x1c')](_0x598e('0x1d'),_0x50ffbb+'-'+_0x2ecb1e+'/'+_0x3521bc)[_0x598e('0x17')](_0x34c672);}return null;};}function patchUpdates(_0x17e5f1){return function(_0x2a1a65){try{jsonpatch[_0x598e('0x1e')](_0x2a1a65,_0x17e5f1,!![]);}catch(_0x20c1bb){return BPromise[_0x598e('0x1f')](_0x20c1bb);}return _0x2a1a65[_0x598e('0x20')]();};}function saveUpdates(_0x233f16,_0x5b9c3){return function(_0x4a483b){if(_0x4a483b){return _0x4a483b[_0x598e('0x21')](_0x233f16)['then'](function(_0xdec363){return _0xdec363;});}return null;};}function removeEntity(_0x3cea88,_0x5df3ba){return function(_0x45e7ee){if(_0x45e7ee){return _0x45e7ee[_0x598e('0x22')]()[_0x598e('0x23')](function(){_0x3cea88[_0x598e('0x16')](0xcc)[_0x598e('0x24')]();});}};}function handleEntityNotFound(_0x3e434e,_0x2cb735){return function(_0x2a8fbc){if(!_0x2a8fbc){_0x3e434e[_0x598e('0x25')](0x194);}return _0x2a8fbc;};}function handleError(_0x19d4f8,_0x1a8d85){_0x1a8d85=_0x1a8d85||0x1f4;return function(_0x5d63ce){logger[_0x598e('0x26')](_0x5d63ce['stack']);if(_0x5d63ce[_0x598e('0x27')]){delete _0x5d63ce[_0x598e('0x27')];}_0x19d4f8[_0x598e('0x16')](_0x1a8d85)['send'](_0x5d63ce);};}exports[_0x598e('0x28')]=function(_0xc81d68,_0x158681){var _0x884e0f={},_0x43ddf0={},_0x5ecac3={'count':0x0,'rows':[]};var _0x4fad2d=_['map'](db[_0x598e('0x29')][_0x598e('0x2a')],function(_0x2ee4a5){return{'name':_0x2ee4a5[_0x598e('0x2b')],'type':_0x2ee4a5[_0x598e('0x2c')][_0x598e('0x2d')]};});_0x43ddf0['model']=_[_0x598e('0x2e')](_0x4fad2d,_0x598e('0x27'));_0x43ddf0[_0x598e('0x2f')]=_[_0x598e('0x30')](_0xc81d68[_0x598e('0x2f')]);_0x43ddf0['filters']=_[_0x598e('0x31')](_0x43ddf0[_0x598e('0x32')],_0x43ddf0[_0x598e('0x2f')]);_0x884e0f['attributes']=_[_0x598e('0x31')](_0x43ddf0[_0x598e('0x32')],qs['fields'](_0xc81d68[_0x598e('0x2f')][_0x598e('0x33')]));_0x884e0f[_0x598e('0x34')]=_0x884e0f[_0x598e('0x34')][_0x598e('0x35')]?_0x884e0f[_0x598e('0x34')]:_0x43ddf0['model'];if(!_0xc81d68[_0x598e('0x2f')][_0x598e('0x36')](_0x598e('0x37'))){_0x884e0f['limit']=qs['limit'](_0xc81d68[_0x598e('0x2f')]['limit']);_0x884e0f[_0x598e('0x18')]=qs[_0x598e('0x18')](_0xc81d68['query']['offset']);}_0x884e0f[_0x598e('0x38')]=qs['sort'](_0xc81d68[_0x598e('0x2f')][_0x598e('0x39')]);_0x884e0f[_0x598e('0x3a')]=qs['filters'](_[_0x598e('0x3b')](_0xc81d68['query'],_0x43ddf0['filters']),_0x4fad2d);if(_0xc81d68[_0x598e('0x2f')][_0x598e('0x3c')]){_0x884e0f['where']=_['merge'](_0x884e0f[_0x598e('0x3a')],{'$or':_[_0x598e('0x2e')](_0x4fad2d,function(_0x5254e5){if(_0x5254e5[_0x598e('0x2c')]!==_0x598e('0x3d')){var _0x38142c={};_0x38142c[_0x5254e5[_0x598e('0x27')]]={'$like':'%'+_0xc81d68[_0x598e('0x2f')][_0x598e('0x3c')]+'%'};return _0x38142c;}})});}_0x884e0f=_[_0x598e('0x3e')]({},_0x884e0f,_0xc81d68['options']);var _0x3ee264={'where':_0x884e0f[_0x598e('0x3a')]};return db[_0x598e('0x29')][_0x598e('0x1b')](_0x3ee264)[_0x598e('0x23')](function(_0x25af45){_0x5ecac3[_0x598e('0x1b')]=_0x25af45;if(_0xc81d68[_0x598e('0x2f')][_0x598e('0x3f')]){_0x884e0f[_0x598e('0x40')]=[{'all':!![]}];}return db[_0x598e('0x29')][_0x598e('0x41')](_0x884e0f);})[_0x598e('0x23')](function(_0x5633c9){_0x5ecac3['rows']=_0x5633c9;return _0x5ecac3;})[_0x598e('0x23')](respondWithFilteredResult(_0x158681,_0x884e0f))[_0x598e('0x42')](handleError(_0x158681,null));};exports[_0x598e('0x43')]=function(_0x3c7828,_0x4d3273){var _0x3799c7={'raw':!![],'where':{'id':_0x3c7828[_0x598e('0x44')]['id']}},_0x22f24b={};_0x22f24b['model']=_[_0x598e('0x30')](db[_0x598e('0x29')][_0x598e('0x2a')]);_0x22f24b[_0x598e('0x2f')]=_[_0x598e('0x30')](_0x3c7828[_0x598e('0x2f')]);_0x22f24b[_0x598e('0x45')]=_[_0x598e('0x31')](_0x22f24b[_0x598e('0x32')],_0x22f24b[_0x598e('0x2f')]);_0x3799c7[_0x598e('0x34')]=_['intersection'](_0x22f24b['model'],qs['fields'](_0x3c7828[_0x598e('0x2f')][_0x598e('0x33')]));_0x3799c7[_0x598e('0x34')]=_0x3799c7['attributes'][_0x598e('0x35')]?_0x3799c7[_0x598e('0x34')]:_0x22f24b[_0x598e('0x32')];if(_0x3c7828['query'][_0x598e('0x3f')]){_0x3799c7[_0x598e('0x40')]=[{'all':!![]}];}_0x3799c7=_[_0x598e('0x3e')]({},_0x3799c7,_0x3c7828['options']);return db[_0x598e('0x29')][_0x598e('0x46')](_0x3799c7)[_0x598e('0x23')](handleEntityNotFound(_0x4d3273,null))[_0x598e('0x23')](respondWithResult(_0x4d3273,null))[_0x598e('0x42')](handleError(_0x4d3273,null));};exports[_0x598e('0x47')]=function(_0x5ec8d8,_0x2c7c8f){return db[_0x598e('0x29')]['create'](_0x5ec8d8[_0x598e('0x48')],{})[_0x598e('0x23')](respondWithResult(_0x2c7c8f,0xc9))[_0x598e('0x42')](handleError(_0x2c7c8f,null));};exports['update']=function(_0x59e67b,_0x57b11a){if(_0x59e67b[_0x598e('0x48')]['id']){delete _0x59e67b[_0x598e('0x48')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x59e67b[_0x598e('0x44')]['id']}})[_0x598e('0x23')](handleEntityNotFound(_0x57b11a,null))['then'](saveUpdates(_0x59e67b['body'],null))[_0x598e('0x23')](respondWithResult(_0x57b11a,null))[_0x598e('0x42')](handleError(_0x57b11a,null));};exports[_0x598e('0x22')]=function(_0x34a43d,_0x5cbe61){return db['FreshdeskField'][_0x598e('0x46')]({'where':{'id':_0x34a43d['params']['id']}})[_0x598e('0x23')](handleEntityNotFound(_0x5cbe61,null))['then'](removeEntity(_0x5cbe61,null))[_0x598e('0x42')](handleError(_0x5cbe61,null));};
\ No newline at end of file
+var _0xd3d1=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x30f931,_0x5d57ac){var _0x2bbf19=function(_0x19f862){while(--_0x19f862){_0x30f931['push'](_0x30f931['shift']());}};_0x2bbf19(++_0x5d57ac);}(_0xd3d1,0x172));var _0x1d3d=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xd3d1[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x1d3d('0x0'));var rimraf=require(_0x1d3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1d3d('0x2'));var moment=require(_0x1d3d('0x3'));var BPromise=require(_0x1d3d('0x4'));var Mustache=require(_0x1d3d('0x5'));var util=require(_0x1d3d('0x6'));var path=require(_0x1d3d('0x7'));var sox=require(_0x1d3d('0x8'));var csv=require(_0x1d3d('0x9'));var ejs=require(_0x1d3d('0xa'));var fs=require('fs');var fs_extra=require(_0x1d3d('0xb'));var _=require(_0x1d3d('0xc'));var squel=require(_0x1d3d('0xd'));var crypto=require(_0x1d3d('0xe'));var jsforce=require(_0x1d3d('0xf'));var deskjs=require(_0x1d3d('0x10'));var toCsv=require(_0x1d3d('0x9'));var querystring=require(_0x1d3d('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d3d('0x12'));var authService=require(_0x1d3d('0x13'));var qs=require(_0x1d3d('0x14'));var as=require(_0x1d3d('0x15'));var hardwareService=require(_0x1d3d('0x16'));var logger=require(_0x1d3d('0x17'))(_0x1d3d('0x18'));var utils=require(_0x1d3d('0x19'));var config=require(_0x1d3d('0x1a'));var licenseUtil=require(_0x1d3d('0x1b'));var db=require(_0x1d3d('0x1c'))['db'];function respondWithStatusCode(_0x479216,_0xb587d){_0xb587d=_0xb587d||0xcc;return function(_0x2e375f){if(_0x2e375f){return _0x479216['sendStatus'](_0xb587d);}return _0x479216['status'](_0xb587d)[_0x1d3d('0x1d')]();};}function respondWithResult(_0x2f5b7f,_0x1a8035){_0x1a8035=_0x1a8035||0xc8;return function(_0x59b907){if(_0x59b907){return _0x2f5b7f[_0x1d3d('0x1e')](_0x1a8035)['json'](_0x59b907);}};}function respondWithFilteredResult(_0x1d54f3,_0x33e7d9){return function(_0x3491e4){if(_0x3491e4){var _0x24bb8c=typeof _0x33e7d9[_0x1d3d('0x1f')]===_0x1d3d('0x20')&&typeof _0x33e7d9[_0x1d3d('0x21')]==='undefined';var _0x5d3ac9=_0x3491e4[_0x1d3d('0x22')];var _0xe0a583=_0x24bb8c?0x0:_0x33e7d9['offset'];var _0x3b9174=_0x24bb8c?_0x3491e4['count']:_0x33e7d9[_0x1d3d('0x1f')]+_0x33e7d9[_0x1d3d('0x21')];var _0x2cd430;if(_0x3b9174>=_0x5d3ac9){_0x3b9174=_0x5d3ac9;_0x2cd430=0xc8;}else{_0x2cd430=0xce;}_0x1d54f3[_0x1d3d('0x1e')](_0x2cd430);return _0x1d54f3['set'](_0x1d3d('0x23'),_0xe0a583+'-'+_0x3b9174+'/'+_0x5d3ac9)['json'](_0x3491e4);}return null;};}function patchUpdates(_0x56c424){return function(_0x108005){try{jsonpatch[_0x1d3d('0x24')](_0x108005,_0x56c424,!![]);}catch(_0x43b14b){return BPromise[_0x1d3d('0x25')](_0x43b14b);}return _0x108005[_0x1d3d('0x26')]();};}function saveUpdates(_0xe4afa2,_0x471df5){return function(_0xa55c43){if(_0xa55c43){return _0xa55c43[_0x1d3d('0x27')](_0xe4afa2)[_0x1d3d('0x28')](function(_0x1610a6){return _0x1610a6;});}return null;};}function removeEntity(_0x502921,_0xfc3606){return function(_0x72868d){if(_0x72868d){return _0x72868d['destroy']()[_0x1d3d('0x28')](function(){_0x502921['status'](0xcc)[_0x1d3d('0x1d')]();});}};}function handleEntityNotFound(_0x20ae6d,_0x2bd023){return function(_0x4235fd){if(!_0x4235fd){_0x20ae6d[_0x1d3d('0x29')](0x194);}return _0x4235fd;};}function handleError(_0x16d032,_0x2b8074){_0x2b8074=_0x2b8074||0x1f4;return function(_0x298fd3){logger[_0x1d3d('0x2a')](_0x298fd3[_0x1d3d('0x2b')]);if(_0x298fd3[_0x1d3d('0x2c')]){delete _0x298fd3['name'];}_0x16d032[_0x1d3d('0x1e')](_0x2b8074)['send'](_0x298fd3);};}exports[_0x1d3d('0x2d')]=function(_0x2bcc2,_0x55c935){var _0x185913={},_0x16b7b3={},_0x3cb011={'count':0x0,'rows':[]};var _0x2a3812=_['map'](db[_0x1d3d('0x2e')][_0x1d3d('0x2f')],function(_0x5d1b6c){return{'name':_0x5d1b6c[_0x1d3d('0x30')],'type':_0x5d1b6c['type'][_0x1d3d('0x31')]};});_0x16b7b3[_0x1d3d('0x32')]=_['map'](_0x2a3812,_0x1d3d('0x2c'));_0x16b7b3[_0x1d3d('0x33')]=_[_0x1d3d('0x34')](_0x2bcc2[_0x1d3d('0x33')]);_0x16b7b3[_0x1d3d('0x35')]=_[_0x1d3d('0x36')](_0x16b7b3[_0x1d3d('0x32')],_0x16b7b3[_0x1d3d('0x33')]);_0x185913[_0x1d3d('0x37')]=_['intersection'](_0x16b7b3[_0x1d3d('0x32')],qs[_0x1d3d('0x38')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x38')]));_0x185913['attributes']=_0x185913['attributes'][_0x1d3d('0x39')]?_0x185913[_0x1d3d('0x37')]:_0x16b7b3['model'];if(!_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x3a')](_0x1d3d('0x3b'))){_0x185913[_0x1d3d('0x21')]=qs['limit'](_0x2bcc2['query'][_0x1d3d('0x21')]);_0x185913['offset']=qs[_0x1d3d('0x1f')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x1f')]);}_0x185913[_0x1d3d('0x3c')]=qs[_0x1d3d('0x3d')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x3d')]);_0x185913[_0x1d3d('0x3e')]=qs['filters'](_[_0x1d3d('0x3f')](_0x2bcc2['query'],_0x16b7b3[_0x1d3d('0x35')]),_0x2a3812);if(_0x2bcc2[_0x1d3d('0x33')]['filter']){_0x185913[_0x1d3d('0x3e')]=_[_0x1d3d('0x40')](_0x185913[_0x1d3d('0x3e')],{'$or':_[_0x1d3d('0x41')](_0x2a3812,function(_0x5c53c3){if(_0x5c53c3['type']!==_0x1d3d('0x42')){var _0x59502c={};_0x59502c[_0x5c53c3[_0x1d3d('0x2c')]]={'$like':'%'+_0x2bcc2[_0x1d3d('0x33')]['filter']+'%'};return _0x59502c;}})});}_0x185913=_[_0x1d3d('0x40')]({},_0x185913,_0x2bcc2[_0x1d3d('0x43')]);var _0x51be79={'where':_0x185913[_0x1d3d('0x3e')]};return db[_0x1d3d('0x2e')][_0x1d3d('0x22')](_0x51be79)[_0x1d3d('0x28')](function(_0x1fec46){_0x3cb011[_0x1d3d('0x22')]=_0x1fec46;if(_0x2bcc2['query'][_0x1d3d('0x44')]){_0x185913[_0x1d3d('0x45')]=[{'all':!![]}];}return db[_0x1d3d('0x2e')][_0x1d3d('0x46')](_0x185913);})[_0x1d3d('0x28')](function(_0x5f007e){_0x3cb011[_0x1d3d('0x47')]=_0x5f007e;return _0x3cb011;})[_0x1d3d('0x28')](respondWithFilteredResult(_0x55c935,_0x185913))[_0x1d3d('0x48')](handleError(_0x55c935,null));};exports[_0x1d3d('0x49')]=function(_0x5d0ab0,_0x3d1c0c){var _0x977ea8={'raw':!![],'where':{'id':_0x5d0ab0[_0x1d3d('0x4a')]['id']}},_0x1597fa={};_0x1597fa[_0x1d3d('0x32')]=_['keys'](db['FreshdeskField'][_0x1d3d('0x2f')]);_0x1597fa[_0x1d3d('0x33')]=_[_0x1d3d('0x34')](_0x5d0ab0[_0x1d3d('0x33')]);_0x1597fa[_0x1d3d('0x35')]=_['intersection'](_0x1597fa[_0x1d3d('0x32')],_0x1597fa['query']);_0x977ea8[_0x1d3d('0x37')]=_[_0x1d3d('0x36')](_0x1597fa[_0x1d3d('0x32')],qs[_0x1d3d('0x38')](_0x5d0ab0['query'][_0x1d3d('0x38')]));_0x977ea8[_0x1d3d('0x37')]=_0x977ea8[_0x1d3d('0x37')][_0x1d3d('0x39')]?_0x977ea8[_0x1d3d('0x37')]:_0x1597fa[_0x1d3d('0x32')];if(_0x5d0ab0[_0x1d3d('0x33')]['includeAll']){_0x977ea8[_0x1d3d('0x45')]=[{'all':!![]}];}_0x977ea8=_['merge']({},_0x977ea8,_0x5d0ab0[_0x1d3d('0x43')]);return db[_0x1d3d('0x2e')]['find'](_0x977ea8)[_0x1d3d('0x28')](handleEntityNotFound(_0x3d1c0c,null))['then'](respondWithResult(_0x3d1c0c,null))[_0x1d3d('0x48')](handleError(_0x3d1c0c,null));};exports['create']=function(_0x17eded,_0xebd1f4){return db[_0x1d3d('0x2e')][_0x1d3d('0x4b')](_0x17eded[_0x1d3d('0x4c')],{})[_0x1d3d('0x28')](respondWithResult(_0xebd1f4,0xc9))[_0x1d3d('0x48')](handleError(_0xebd1f4,null));};exports[_0x1d3d('0x27')]=function(_0x59e88a,_0x5899cc){if(_0x59e88a['body']['id']){delete _0x59e88a[_0x1d3d('0x4c')]['id'];}return db[_0x1d3d('0x2e')][_0x1d3d('0x4d')]({'where':{'id':_0x59e88a[_0x1d3d('0x4a')]['id']}})[_0x1d3d('0x28')](handleEntityNotFound(_0x5899cc,null))[_0x1d3d('0x28')](saveUpdates(_0x59e88a['body'],null))['then'](respondWithResult(_0x5899cc,null))['catch'](handleError(_0x5899cc,null));};exports['destroy']=function(_0x3dc5ca,_0x21620d){return db[_0x1d3d('0x2e')][_0x1d3d('0x4d')]({'where':{'id':_0x3dc5ca[_0x1d3d('0x4a')]['id']}})[_0x1d3d('0x28')](handleEntityNotFound(_0x21620d,null))[_0x1d3d('0x28')](removeEntity(_0x21620d,null))[_0x1d3d('0x48')](handleError(_0x21620d,null));};
\ No newline at end of file
index 477e2df..9d689d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6719=['moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','api'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x6719,0xcf));var _0x9671=function(_0x93bdde,_0x26ca52){_0x93bdde=_0x93bdde-0x0;var _0x19fb76=_0x6719[_0x93bdde];return _0x19fb76;};'use strict';var _=require(_0x9671('0x0'));var util=require(_0x9671('0x1'));var logger=require('../../config/logger')(_0x9671('0x2'));var moment=require(_0x9671('0x3'));var BPromise=require(_0x9671('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9671('0x5'));var rimraf=require(_0x9671('0x6'));var config=require(_0x9671('0x7'));var attributes=require(_0x9671('0x8'));module[_0x9671('0x9')]=function(_0x1df022,_0x502ac5){return _0x1df022['define'](_0x9671('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x9671('0xb'),'fields':[_0x9671('0xc'),_0x9671('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaae2=['FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xaae2,0x1a8));var _0x2aae=function(_0x48d467,_0x442bd8){_0x48d467=_0x48d467-0x0;var _0x227c4d=_0xaae2[_0x48d467];return _0x227c4d;};'use strict';var _=require(_0x2aae('0x0'));var util=require(_0x2aae('0x1'));var logger=require(_0x2aae('0x2'))('api');var moment=require(_0x2aae('0x3'));var BPromise=require(_0x2aae('0x4'));var rp=require(_0x2aae('0x5'));var fs=require('fs');var path=require(_0x2aae('0x6'));var rimraf=require('rimraf');var config=require(_0x2aae('0x7'));var attributes=require(_0x2aae('0x8'));module[_0x2aae('0x9')]=function(_0x112157,_0x5d11cd){return _0x112157['define'](_0x2aae('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x2aae('0xb'),'fields':[_0x2aae('0xc'),_0x2aae('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7070afe..17d4b1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89b9=['jayson/promise','client','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x89b9,0x174));var _0x989b=function(_0x432c4b,_0x20422c){_0x432c4b=_0x432c4b-0x0;var _0x54047c=_0x89b9[_0x432c4b];return _0x54047c;};'use strict';var _=require('lodash');var util=require(_0x989b('0x0'));var moment=require(_0x989b('0x1'));var BPromise=require('bluebird');var rs=require(_0x989b('0x2'));var fs=require('fs');var Redis=require(_0x989b('0x3'));var db=require(_0x989b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x989b('0x5'))(_0x989b('0x6'));var config=require(_0x989b('0x7'));var jayson=require(_0x989b('0x8'));var client=jayson[_0x989b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1258a8,_0x30a885,_0x4c28a8){return new BPromise(function(_0xfa62,_0x15243b){return client['request'](_0x1258a8,_0x4c28a8)['then'](function(_0x31aaa0){logger[_0x989b('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x30a885,_0x989b('0xb'));logger['debug'](_0x989b('0xc'),_0x30a885,_0x989b('0xb'),JSON['stringify'](_0x31aaa0));if(_0x31aaa0[_0x989b('0xd')]){if(_0x31aaa0[_0x989b('0xd')][_0x989b('0xe')]===0x1f4){logger['error'](_0x989b('0xf'),_0x30a885,_0x31aaa0[_0x989b('0xd')][_0x989b('0x10')]);return _0x15243b(_0x31aaa0[_0x989b('0xd')][_0x989b('0x10')]);}logger['error'](_0x989b('0xf'),_0x30a885,_0x31aaa0['error'][_0x989b('0x10')]);return _0xfa62(_0x31aaa0[_0x989b('0xd')][_0x989b('0x10')]);}else{logger[_0x989b('0xa')](_0x989b('0xf'),_0x30a885,_0x989b('0xb'));_0xfa62(_0x31aaa0[_0x989b('0x11')]['message']);}})[_0x989b('0x12')](function(_0x2c65ba){logger[_0x989b('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x30a885,_0x2c65ba);_0x15243b(_0x2c65ba);});});}
\ No newline at end of file
+var _0x38a8=['http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3fcb63,_0x3a6d84){var _0x181d5f=function(_0x6d5fbd){while(--_0x6d5fbd){_0x3fcb63['push'](_0x3fcb63['shift']());}};_0x181d5f(++_0x3a6d84);}(_0x38a8,0x1a4));var _0x838a=function(_0x5480e5,_0x52e354){_0x5480e5=_0x5480e5-0x0;var _0x20b7cc=_0x38a8[_0x5480e5];return _0x20b7cc;};'use strict';var _=require(_0x838a('0x0'));var util=require(_0x838a('0x1'));var moment=require(_0x838a('0x2'));var BPromise=require(_0x838a('0x3'));var rs=require(_0x838a('0x4'));var fs=require('fs');var Redis=require(_0x838a('0x5'));var db=require(_0x838a('0x6'))['db'];var utils=require(_0x838a('0x7'));var logger=require(_0x838a('0x8'))(_0x838a('0x9'));var config=require(_0x838a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x838a('0xb')][_0x838a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48fbb1,_0x916ffb,_0x45bc27){return new BPromise(function(_0x137559,_0x4ee42e){return client['request'](_0x48fbb1,_0x45bc27)[_0x838a('0xd')](function(_0x35dbd3){logger[_0x838a('0xe')](_0x838a('0xf'),_0x916ffb,_0x838a('0x10'));logger[_0x838a('0x11')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x916ffb,_0x838a('0x10'),JSON[_0x838a('0x12')](_0x35dbd3));if(_0x35dbd3[_0x838a('0x13')]){if(_0x35dbd3[_0x838a('0x13')][_0x838a('0x14')]===0x1f4){logger[_0x838a('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x916ffb,_0x35dbd3[_0x838a('0x13')][_0x838a('0x15')]);return _0x4ee42e(_0x35dbd3['error'][_0x838a('0x15')]);}logger[_0x838a('0x13')](_0x838a('0xf'),_0x916ffb,_0x35dbd3['error']['message']);return _0x137559(_0x35dbd3['error'][_0x838a('0x15')]);}else{logger[_0x838a('0xe')](_0x838a('0xf'),_0x916ffb,_0x838a('0x10'));_0x137559(_0x35dbd3[_0x838a('0x16')][_0x838a('0x15')]);}})[_0x838a('0x17')](function(_0x242ddc){logger[_0x838a('0x13')](_0x838a('0xf'),_0x916ffb,_0x242ddc);_0x4ee42e(_0x242ddc);});});}
\ No newline at end of file
index 8797737..c55418b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfcc=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update'];(function(_0x1f122c,_0x4080aa){var _0xe9a80a=function(_0x307d13){while(--_0x307d13){_0x1f122c['push'](_0x1f122c['shift']());}};_0xe9a80a(++_0x4080aa);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xbfcc[_0x247fa1];return _0x244f35;};'use strict';var multer=require(_0xcbfc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcbfc('0x1'));var express=require(_0xcbfc('0x2'));var router=express[_0xcbfc('0x3')]();var fs_extra=require(_0xcbfc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xcbfc('0x5')]('/',auth[_0xcbfc('0x6')](),controller['index']);router[_0xcbfc('0x5')]('/:id',auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x7')]);router[_0xcbfc('0x5')](_0xcbfc('0x8'),auth['isAuthenticated'](),controller[_0xcbfc('0x9')]);router[_0xcbfc('0x5')](_0xcbfc('0xa'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0xb')]);router[_0xcbfc('0xc')]('/',auth['isAuthenticated'](),controller[_0xcbfc('0xd')]);router[_0xcbfc('0xc')](_0xcbfc('0x8'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0xe')]);router['put'](_0xcbfc('0xf'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x10')]);router['delete'](_0xcbfc('0xf'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x11')]);module[_0xcbfc('0x12')]=router;
\ No newline at end of file
+var _0xf7b4=['destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf7b4,0x152));var _0x4f7b=function(_0x65ab97,_0x1f2ace){_0x65ab97=_0x65ab97-0x0;var _0x38a80d=_0xf7b4[_0x65ab97];return _0x38a80d;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/fields',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);router['post'](_0x4f7b('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x4f7b('0x11')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['delete'](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x13')]);module[_0x4f7b('0x14')]=router;
\ No newline at end of file
index 4ddea74..c3ab396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f2=['exports','STRING','remoteUri','sequelize'];(function(_0x120b93,_0x532248){var _0x49401b=function(_0x524588){while(--_0x524588){_0x120b93['push'](_0x120b93['shift']());}};_0x49401b(++_0x532248);}(_0x28f2,0x193));var _0x228f=function(_0x495821,_0x25421a){_0x495821=_0x495821-0x0;var _0x2dac19=_0x28f2[_0x495821];return _0x2dac19;};'use strict';var Sequelize=require(_0x228f('0x0'));module[_0x228f('0x1')]={'name':{'type':Sequelize[_0x228f('0x2')]},'description':{'type':Sequelize[_0x228f('0x2')]},'username':{'type':Sequelize[_0x228f('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x228f('0x2')]},'remoteUri':{'type':Sequelize[_0x228f('0x2')],'unique':_0x228f('0x3')},'serverUrl':{'type':Sequelize[_0x228f('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xb03e=['STRING','username','remoteUri','exports'];(function(_0x14c785,_0x1ef88e){var _0x165dd5=function(_0x253263){while(--_0x253263){_0x14c785['push'](_0x14c785['shift']());}};_0x165dd5(++_0x1ef88e);}(_0xb03e,0x1eb));var _0xeb03=function(_0x5eb035,_0x12a55c){_0x5eb035=_0x5eb035-0x0;var _0x1f2f83=_0xb03e[_0x5eb035];return _0x1f2f83;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'name':{'type':Sequelize[_0xeb03('0x1')]},'description':{'type':Sequelize[_0xeb03('0x1')]},'username':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x2')},'apiKey':{'type':Sequelize[_0xeb03('0x1')]},'remoteUri':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x3')},'serverUrl':{'type':Sequelize[_0xeb03('0x1')],'allowNull':![]}};
\ No newline at end of file
index 7fdc572..dd1eaa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43d7=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','end','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshsalesField','Subjects','Descriptions','username','remoteUri','slice','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','fast-json-patch','moment','mustache','util','path'];(function(_0x5e2d47,_0x5969cb){var _0x43129b=function(_0x405988){while(--_0x405988){_0x5e2d47['push'](_0x5e2d47['shift']());}};_0x43129b(++_0x5969cb);}(_0x43d7,0x187));var _0x743d=function(_0x1f9e12,_0x5dfe09){_0x1f9e12=_0x1f9e12-0x0;var _0x52603a=_0x43d7[_0x1f9e12];return _0x52603a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x743d('0x0'));var rp=require('request-promise');var moment=require(_0x743d('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x743d('0x2'));var util=require(_0x743d('0x3'));var path=require(_0x743d('0x4'));var sox=require(_0x743d('0x5'));var csv=require(_0x743d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x743d('0x7'));var _=require(_0x743d('0x8'));var squel=require(_0x743d('0x9'));var crypto=require(_0x743d('0xa'));var jsforce=require(_0x743d('0xb'));var deskjs=require(_0x743d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x743d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x743d('0xe'));var qs=require(_0x743d('0xf'));var as=require(_0x743d('0x10'));var hardwareService=require(_0x743d('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x743d('0x12'));var db=require(_0x743d('0x13'))['db'];var integrations=require(_0x743d('0x14'));function respondWithStatusCode(_0x2851f0,_0x2fa2c8){_0x2fa2c8=_0x2fa2c8||0xcc;return function(_0x4e0c86){if(_0x4e0c86){return _0x2851f0['sendStatus'](_0x2fa2c8);}return _0x2851f0[_0x743d('0x15')](_0x2fa2c8)['end']();};}function respondWithResult(_0x5a2b11,_0xd99b1d){_0xd99b1d=_0xd99b1d||0xc8;return function(_0x254398){if(_0x254398){return _0x5a2b11[_0x743d('0x15')](_0xd99b1d)[_0x743d('0x16')](_0x254398);}};}function respondWithFilteredResult(_0xaec669,_0x56283d){return function(_0x3db0dc){if(_0x3db0dc){var _0xa15c76=typeof _0x56283d[_0x743d('0x17')]===_0x743d('0x18')&&typeof _0x56283d['limit']===_0x743d('0x18');var _0x32ef8b=_0x3db0dc[_0x743d('0x19')];var _0x56b42a=_0xa15c76?0x0:_0x56283d[_0x743d('0x17')];var _0x2f8c90=_0xa15c76?_0x3db0dc[_0x743d('0x19')]:_0x56283d['offset']+_0x56283d[_0x743d('0x1a')];var _0x1ef416;if(_0x2f8c90>=_0x32ef8b){_0x2f8c90=_0x32ef8b;_0x1ef416=0xc8;}else{_0x1ef416=0xce;}_0xaec669[_0x743d('0x15')](_0x1ef416);return _0xaec669['set'](_0x743d('0x1b'),_0x56b42a+'-'+_0x2f8c90+'/'+_0x32ef8b)['json'](_0x3db0dc);}return null;};}function patchUpdates(_0x4f2a97){return function(_0x9e04a2){try{jsonpatch['apply'](_0x9e04a2,_0x4f2a97,!![]);}catch(_0xe70ba3){return BPromise[_0x743d('0x1c')](_0xe70ba3);}return _0x9e04a2['save']();};}function saveUpdates(_0x3ff1f7,_0x37ab8f){return function(_0x46d46c){if(_0x46d46c){return _0x46d46c[_0x743d('0x1d')](_0x3ff1f7)[_0x743d('0x1e')](function(_0x551cc0){return _0x551cc0;});}return null;};}function removeEntity(_0x2ea42e,_0x291387){return function(_0x21b0dc){if(_0x21b0dc){return _0x21b0dc[_0x743d('0x1f')]()[_0x743d('0x1e')](function(){_0x2ea42e[_0x743d('0x15')](0xcc)[_0x743d('0x20')]();});}};}function handleEntityNotFound(_0x41933e,_0x495126){return function(_0x7d4ec2){if(!_0x7d4ec2){_0x41933e['sendStatus'](0x194);}return _0x7d4ec2;};}function handleError(_0x303299,_0x27b7fd){_0x27b7fd=_0x27b7fd||0x1f4;return function(_0x236a99){logger[_0x743d('0x21')](_0x236a99[_0x743d('0x22')]);if(_0x236a99[_0x743d('0x23')]){delete _0x236a99[_0x743d('0x23')];}_0x303299[_0x743d('0x15')](_0x27b7fd)['send'](_0x236a99);};}exports[_0x743d('0x24')]=function(_0x149da4,_0xcb2cd){var _0x45737e={},_0x2d2ba6={},_0x47702d={'count':0x0,'rows':[]};var _0x38965d=_[_0x743d('0x25')](db[_0x743d('0x26')][_0x743d('0x27')],function(_0x2425e7){return{'name':_0x2425e7[_0x743d('0x28')],'type':_0x2425e7[_0x743d('0x29')][_0x743d('0x2a')]};});_0x2d2ba6[_0x743d('0x2b')]=_[_0x743d('0x25')](_0x38965d,'name');_0x2d2ba6[_0x743d('0x2c')]=_[_0x743d('0x2d')](_0x149da4[_0x743d('0x2c')]);_0x2d2ba6[_0x743d('0x2e')]=_[_0x743d('0x2f')](_0x2d2ba6['model'],_0x2d2ba6[_0x743d('0x2c')]);_0x45737e[_0x743d('0x30')]=_[_0x743d('0x2f')](_0x2d2ba6[_0x743d('0x2b')],qs['fields'](_0x149da4[_0x743d('0x2c')]['fields']));_0x45737e[_0x743d('0x30')]=_0x45737e[_0x743d('0x30')][_0x743d('0x31')]?_0x45737e[_0x743d('0x30')]:_0x2d2ba6[_0x743d('0x2b')];if(!_0x149da4['query'][_0x743d('0x32')](_0x743d('0x33'))){_0x45737e['limit']=qs[_0x743d('0x1a')](_0x149da4[_0x743d('0x2c')][_0x743d('0x1a')]);_0x45737e[_0x743d('0x17')]=qs[_0x743d('0x17')](_0x149da4[_0x743d('0x2c')]['offset']);}_0x45737e[_0x743d('0x34')]=qs[_0x743d('0x35')](_0x149da4[_0x743d('0x2c')]['sort']);_0x45737e['where']=qs[_0x743d('0x2e')](_[_0x743d('0x36')](_0x149da4[_0x743d('0x2c')],_0x2d2ba6[_0x743d('0x2e')]),_0x38965d);if(_0x149da4[_0x743d('0x2c')][_0x743d('0x37')]){_0x45737e[_0x743d('0x38')]=_[_0x743d('0x39')](_0x45737e[_0x743d('0x38')],{'$or':_[_0x743d('0x25')](_0x38965d,function(_0x42f148){if(_0x42f148[_0x743d('0x29')]!==_0x743d('0x3a')){var _0x432829={};_0x432829[_0x42f148[_0x743d('0x23')]]={'$like':'%'+_0x149da4[_0x743d('0x2c')][_0x743d('0x37')]+'%'};return _0x432829;}})});}_0x45737e=_['merge']({},_0x45737e,_0x149da4[_0x743d('0x3b')]);var _0x3b642b={'where':_0x45737e[_0x743d('0x38')]};return db[_0x743d('0x26')]['count'](_0x3b642b)['then'](function(_0x3828ea){_0x47702d[_0x743d('0x19')]=_0x3828ea;if(_0x149da4[_0x743d('0x2c')][_0x743d('0x3c')]){_0x45737e[_0x743d('0x3d')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x743d('0x3e')](_0x45737e);})[_0x743d('0x1e')](function(_0xe25e80){_0x47702d[_0x743d('0x3f')]=_0xe25e80;return _0x47702d;})[_0x743d('0x1e')](respondWithFilteredResult(_0xcb2cd,_0x45737e))[_0x743d('0x40')](handleError(_0xcb2cd,null));};exports[_0x743d('0x41')]=function(_0x5332c1,_0x575e07){var _0x54a7a8={'raw':![],'where':{'id':_0x5332c1[_0x743d('0x42')]['id']}},_0x143832={};_0x143832[_0x743d('0x2b')]=_['keys'](db[_0x743d('0x26')]['rawAttributes']);_0x143832['query']=_[_0x743d('0x2d')](_0x5332c1[_0x743d('0x2c')]);_0x143832[_0x743d('0x2e')]=_[_0x743d('0x2f')](_0x143832[_0x743d('0x2b')],_0x143832['query']);_0x54a7a8[_0x743d('0x30')]=_['intersection'](_0x143832[_0x743d('0x2b')],qs[_0x743d('0x43')](_0x5332c1[_0x743d('0x2c')][_0x743d('0x43')]));_0x54a7a8[_0x743d('0x30')]=_0x54a7a8[_0x743d('0x30')][_0x743d('0x31')]?_0x54a7a8['attributes']:_0x143832[_0x743d('0x2b')];if(_0x5332c1[_0x743d('0x2c')][_0x743d('0x3c')]){_0x54a7a8[_0x743d('0x3d')]=[{'all':!![]}];}_0x54a7a8=_[_0x743d('0x39')]({},_0x54a7a8,_0x5332c1[_0x743d('0x3b')]);return db['FreshsalesAccount']['find'](_0x54a7a8)[_0x743d('0x1e')](handleEntityNotFound(_0x575e07,null))[_0x743d('0x1e')](respondWithResult(_0x575e07,null))[_0x743d('0x40')](handleError(_0x575e07,null));};exports[_0x743d('0x44')]=function(_0x230083,_0x3a48f4){return db[_0x743d('0x26')][_0x743d('0x44')](_0x230083[_0x743d('0x45')],{})[_0x743d('0x1e')](respondWithResult(_0x3a48f4,0xc9))[_0x743d('0x40')](handleError(_0x3a48f4,null));};exports[_0x743d('0x1d')]=function(_0x7f682d,_0x63b1b9){if(_0x7f682d[_0x743d('0x45')]['id']){delete _0x7f682d[_0x743d('0x45')]['id'];}return db[_0x743d('0x26')]['find']({'where':{'id':_0x7f682d[_0x743d('0x42')]['id']}})[_0x743d('0x1e')](handleEntityNotFound(_0x63b1b9,null))[_0x743d('0x1e')](saveUpdates(_0x7f682d[_0x743d('0x45')],null))[_0x743d('0x1e')](respondWithResult(_0x63b1b9,null))[_0x743d('0x40')](handleError(_0x63b1b9,null));};exports[_0x743d('0x1f')]=function(_0x5cc236,_0x4aa4cc){return db['FreshsalesAccount'][_0x743d('0x46')]({'where':{'id':_0x5cc236[_0x743d('0x42')]['id']}})[_0x743d('0x1e')](handleEntityNotFound(_0x4aa4cc,null))[_0x743d('0x1e')](removeEntity(_0x4aa4cc,null))['catch'](handleError(_0x4aa4cc,null));};exports[_0x743d('0x47')]=function(_0x13aebf,_0x81ff05,_0x94e252){var _0x181d16={};var _0x33c8ac={};var _0x34a4db;var _0xc5eedf;return db[_0x743d('0x26')][_0x743d('0x48')]({'where':{'id':_0x13aebf['params']['id']}})[_0x743d('0x1e')](handleEntityNotFound(_0x81ff05,null))[_0x743d('0x1e')](function(_0x43e838){if(_0x43e838){_0x34a4db=_0x43e838;_0x33c8ac['model']=_[_0x743d('0x2d')](db[_0x743d('0x49')][_0x743d('0x27')]);_0x33c8ac[_0x743d('0x2c')]=_[_0x743d('0x2d')](_0x13aebf[_0x743d('0x2c')]);_0x33c8ac[_0x743d('0x2e')]=_[_0x743d('0x2f')](_0x33c8ac[_0x743d('0x2b')],_0x33c8ac[_0x743d('0x2c')]);_0x181d16[_0x743d('0x30')]=_[_0x743d('0x2f')](_0x33c8ac[_0x743d('0x2b')],qs[_0x743d('0x43')](_0x13aebf[_0x743d('0x2c')][_0x743d('0x43')]));_0x181d16[_0x743d('0x30')]=_0x181d16[_0x743d('0x30')][_0x743d('0x31')]?_0x181d16[_0x743d('0x30')]:_0x33c8ac[_0x743d('0x2b')];_0x181d16[_0x743d('0x34')]=qs[_0x743d('0x35')](_0x13aebf[_0x743d('0x2c')][_0x743d('0x35')]);_0x181d16[_0x743d('0x38')]=qs[_0x743d('0x2e')](_['pick'](_0x13aebf[_0x743d('0x2c')],_0x33c8ac[_0x743d('0x2e')]));if(_0x13aebf[_0x743d('0x2c')][_0x743d('0x37')]){_0x181d16[_0x743d('0x38')]=_[_0x743d('0x39')](_0x181d16['where'],{'$or':_[_0x743d('0x25')](_0x181d16['attributes'],function(_0x252972){var _0x567518={};_0x567518[_0x252972]={'$like':'%'+_0x13aebf[_0x743d('0x2c')]['filter']+'%'};return _0x567518;})});}_0x181d16=_[_0x743d('0x39')]({},_0x181d16,_0x13aebf['options']);return _0x34a4db[_0x743d('0x47')](_0x181d16);}})[_0x743d('0x1e')](function(_0x4cdce8){if(_0x4cdce8){_0xc5eedf=_0x4cdce8[_0x743d('0x31')];if(!_0x13aebf[_0x743d('0x2c')]['hasOwnProperty']('nolimit')){_0x181d16[_0x743d('0x1a')]=qs[_0x743d('0x1a')](_0x13aebf['query'][_0x743d('0x1a')]);_0x181d16[_0x743d('0x17')]=qs['offset'](_0x13aebf[_0x743d('0x2c')]['offset']);}return _0x34a4db['getConfigurations'](_0x181d16);}})[_0x743d('0x1e')](function(_0x4edb3c){if(_0x4edb3c){return _0x4edb3c?{'count':_0xc5eedf,'rows':_0x4edb3c}:null;}})[_0x743d('0x1e')](respondWithResult(_0x81ff05,null))[_0x743d('0x40')](handleError(_0x81ff05,null));};exports[_0x743d('0x4a')]=function(_0x5c16b2,_0x156488,_0x1586b8){if(_0x5c16b2[_0x743d('0x45')]['id']){delete _0x5c16b2['body']['id'];}return db[_0x743d('0x26')]['findOne']({'where':{'id':_0x5c16b2[_0x743d('0x42')]['id']}})[_0x743d('0x1e')](handleEntityNotFound(_0x156488,null))[_0x743d('0x1e')](function(_0x127667){if(_0x127667){_0x5c16b2[_0x743d('0x45')][_0x743d('0x4b')]=_0x127667['id'];_0x5c16b2[_0x743d('0x45')]['Subjects']=integrations[_0x743d('0x4c')](_0x5c16b2[_0x743d('0x45')][_0x743d('0x4d')],_0x5c16b2[_0x743d('0x45')]['type']);_0x5c16b2[_0x743d('0x45')]['Descriptions']=integrations[_0x743d('0x4e')](_0x5c16b2[_0x743d('0x45')]['channel'],_0x5c16b2[_0x743d('0x45')][_0x743d('0x29')]);return db[_0x743d('0x49')][_0x743d('0x44')](_0x5c16b2['body'],{'include':[{'model':db[_0x743d('0x4f')],'as':_0x743d('0x50')},{'model':db[_0x743d('0x4f')],'as':_0x743d('0x51')}]});}return null;})[_0x743d('0x1e')](respondWithResult(_0x156488,null))[_0x743d('0x40')](handleError(_0x156488,null));};exports['getFields']=function(_0x431bc3,_0xb35f3f,_0x334768){var _0x2c7fd6='';var _0x1ee5e7='';return db[_0x743d('0x26')][_0x743d('0x48')]({'where':{'id':_0x431bc3['params']['id']},'attributes':['id',_0x743d('0x52'),'remoteUri','apiKey']})['then'](handleEntityNotFound(_0xb35f3f,null))[_0x743d('0x1e')](function(_0x2d802b){if(_0x2d802b){_0x1ee5e7=_0x2d802b[_0x743d('0x52')];_0x2c7fd6=_0x2d802b[_0x743d('0x53')];var _0x105c55=_0x2d802b[_0x743d('0x53')][_0x743d('0x54')](-0x1);if(_0x105c55==='/'){_0x2c7fd6=_0x2c7fd6['substring'](0x0,_0x2c7fd6[_0x743d('0x55')](_0x105c55));}return rp({'method':'GET','uri':util[_0x743d('0x56')](_0x743d('0x57'),_0x2c7fd6,_0x743d('0x58')),'headers':{'Authorization':_0x743d('0x59')+_0x2d802b[_0x743d('0x5a')]},'json':!![]});}})[_0x743d('0x1e')](function(_0x592ee7){if(_0x592ee7){var _0x352754=_0x592ee7['users'];var _0x4df11f=![];var _0x1d9ebb=null;for(_0x1d9ebb=0x0;_0x1d9ebb<_0x352754[_0x743d('0x31')];_0x1d9ebb++){if(_0x352754[_0x1d9ebb][_0x743d('0x5b')]===_0x1ee5e7){_0x4df11f=!![];}}if(_0x4df11f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x743d('0x5c')});}}})[_0x743d('0x1e')](respondWithResult(_0xb35f3f,null))[_0x743d('0x40')](function(_0x1c0853){var _0x5b6506=_0x431bc3[_0x743d('0x2c')][_0x743d('0x5d')]?0x1f4:_0x1c0853[_0x743d('0x5e')]||0x1f4;logger[_0x743d('0x21')](_0x743d('0x5f'),_0x743d('0x60'),_0x5b6506,JSON[_0x743d('0x61')](_0x1c0853));delete _0x1c0853['name'];if(_0x5b6506===0x191){_0x5b6506=0x190;}_0xb35f3f['status'](_0x5b6506)[_0x743d('0x62')](_0x431bc3[_0x743d('0x2c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1c0853[_0x743d('0x5e')]}:_0x1c0853);});};
\ No newline at end of file
+var _0x887f=['GET','format','%s%s','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','FreshsalesAccount','keys','length','includeAll','find','create','body','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x887f,0x1a2));var _0xf887=function(_0x29395b,_0x568a0f){_0x29395b=_0x29395b-0x0;var _0x102ae0=_0x887f[_0x29395b];return _0x102ae0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf887('0x0'));var jsonpatch=require(_0xf887('0x1'));var rp=require(_0xf887('0x2'));var moment=require(_0xf887('0x3'));var BPromise=require(_0xf887('0x4'));var Mustache=require(_0xf887('0x5'));var util=require(_0xf887('0x6'));var path=require(_0xf887('0x7'));var sox=require(_0xf887('0x8'));var csv=require('to-csv');var ejs=require(_0xf887('0x9'));var fs=require('fs');var fs_extra=require(_0xf887('0xa'));var _=require(_0xf887('0xb'));var squel=require(_0xf887('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf887('0xd'));var toCsv=require(_0xf887('0xe'));var querystring=require(_0xf887('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf887('0x10'));var as=require(_0xf887('0x11'));var hardwareService=require(_0xf887('0x12'));var logger=require(_0xf887('0x13'))(_0xf887('0x14'));var utils=require(_0xf887('0x15'));var config=require(_0xf887('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x6ff0fb,_0x4ca461){_0x4ca461=_0x4ca461||0xcc;return function(_0x20e536){if(_0x20e536){return _0x6ff0fb[_0xf887('0x17')](_0x4ca461);}return _0x6ff0fb[_0xf887('0x18')](_0x4ca461)[_0xf887('0x19')]();};}function respondWithResult(_0x5d4f62,_0x43339f){_0x43339f=_0x43339f||0xc8;return function(_0x381734){if(_0x381734){return _0x5d4f62['status'](_0x43339f)[_0xf887('0x1a')](_0x381734);}};}function respondWithFilteredResult(_0x315dd6,_0x5da008){return function(_0x37a5bb){if(_0x37a5bb){var _0x447841=typeof _0x5da008['offset']===_0xf887('0x1b')&&typeof _0x5da008['limit']===_0xf887('0x1b');var _0x36414a=_0x37a5bb[_0xf887('0x1c')];var _0x4adb14=_0x447841?0x0:_0x5da008[_0xf887('0x1d')];var _0x3bc359=_0x447841?_0x37a5bb['count']:_0x5da008[_0xf887('0x1d')]+_0x5da008[_0xf887('0x1e')];var _0x172fac;if(_0x3bc359>=_0x36414a){_0x3bc359=_0x36414a;_0x172fac=0xc8;}else{_0x172fac=0xce;}_0x315dd6['status'](_0x172fac);return _0x315dd6['set']('Content-Range',_0x4adb14+'-'+_0x3bc359+'/'+_0x36414a)[_0xf887('0x1a')](_0x37a5bb);}return null;};}function patchUpdates(_0x354efc){return function(_0x424d0d){try{jsonpatch['apply'](_0x424d0d,_0x354efc,!![]);}catch(_0x1ce8a4){return BPromise[_0xf887('0x1f')](_0x1ce8a4);}return _0x424d0d[_0xf887('0x20')]();};}function saveUpdates(_0x351a08,_0x1bcd4b){return function(_0x1eaccd){if(_0x1eaccd){return _0x1eaccd[_0xf887('0x21')](_0x351a08)[_0xf887('0x22')](function(_0x1bb234){return _0x1bb234;});}return null;};}function removeEntity(_0x40030b,_0x2406e6){return function(_0x5aae72){if(_0x5aae72){return _0x5aae72[_0xf887('0x23')]()[_0xf887('0x22')](function(){_0x40030b[_0xf887('0x18')](0xcc)[_0xf887('0x19')]();});}};}function handleEntityNotFound(_0x393060,_0x4a2817){return function(_0x4abc83){if(!_0x4abc83){_0x393060[_0xf887('0x17')](0x194);}return _0x4abc83;};}function handleError(_0x247c47,_0x218914){_0x218914=_0x218914||0x1f4;return function(_0xa4f490){logger[_0xf887('0x24')](_0xa4f490[_0xf887('0x25')]);if(_0xa4f490[_0xf887('0x26')]){delete _0xa4f490[_0xf887('0x26')];}_0x247c47[_0xf887('0x18')](_0x218914)[_0xf887('0x27')](_0xa4f490);};}exports[_0xf887('0x28')]=function(_0x1d5a72,_0x5deba0){var _0x9f587d={},_0x4bcbef={},_0x133137={'count':0x0,'rows':[]};var _0x2f329b=_[_0xf887('0x29')](db['FreshsalesAccount'][_0xf887('0x2a')],function(_0xf3745f){return{'name':_0xf3745f[_0xf887('0x2b')],'type':_0xf3745f[_0xf887('0x2c')][_0xf887('0x2d')]};});_0x4bcbef[_0xf887('0x2e')]=_[_0xf887('0x29')](_0x2f329b,_0xf887('0x26'));_0x4bcbef[_0xf887('0x2f')]=_['keys'](_0x1d5a72[_0xf887('0x2f')]);_0x4bcbef[_0xf887('0x30')]=_[_0xf887('0x31')](_0x4bcbef[_0xf887('0x2e')],_0x4bcbef['query']);_0x9f587d[_0xf887('0x32')]=_[_0xf887('0x31')](_0x4bcbef[_0xf887('0x2e')],qs[_0xf887('0x33')](_0x1d5a72[_0xf887('0x2f')][_0xf887('0x33')]));_0x9f587d[_0xf887('0x32')]=_0x9f587d[_0xf887('0x32')]['length']?_0x9f587d['attributes']:_0x4bcbef[_0xf887('0x2e')];if(!_0x1d5a72[_0xf887('0x2f')][_0xf887('0x34')](_0xf887('0x35'))){_0x9f587d['limit']=qs[_0xf887('0x1e')](_0x1d5a72[_0xf887('0x2f')][_0xf887('0x1e')]);_0x9f587d[_0xf887('0x1d')]=qs[_0xf887('0x1d')](_0x1d5a72[_0xf887('0x2f')][_0xf887('0x1d')]);}_0x9f587d[_0xf887('0x36')]=qs[_0xf887('0x37')](_0x1d5a72[_0xf887('0x2f')][_0xf887('0x37')]);_0x9f587d[_0xf887('0x38')]=qs[_0xf887('0x30')](_[_0xf887('0x39')](_0x1d5a72['query'],_0x4bcbef[_0xf887('0x30')]),_0x2f329b);if(_0x1d5a72[_0xf887('0x2f')][_0xf887('0x3a')]){_0x9f587d[_0xf887('0x38')]=_[_0xf887('0x3b')](_0x9f587d['where'],{'$or':_['map'](_0x2f329b,function(_0x3da587){if(_0x3da587[_0xf887('0x2c')]!==_0xf887('0x3c')){var _0xb9f643={};_0xb9f643[_0x3da587[_0xf887('0x26')]]={'$like':'%'+_0x1d5a72['query']['filter']+'%'};return _0xb9f643;}})});}_0x9f587d=_['merge']({},_0x9f587d,_0x1d5a72[_0xf887('0x3d')]);var _0x18fdba={'where':_0x9f587d['where']};return db['FreshsalesAccount']['count'](_0x18fdba)[_0xf887('0x22')](function(_0x5bbd14){_0x133137[_0xf887('0x1c')]=_0x5bbd14;if(_0x1d5a72['query']['includeAll']){_0x9f587d[_0xf887('0x3e')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xf887('0x3f')](_0x9f587d);})[_0xf887('0x22')](function(_0x1d7a67){_0x133137[_0xf887('0x40')]=_0x1d7a67;return _0x133137;})[_0xf887('0x22')](respondWithFilteredResult(_0x5deba0,_0x9f587d))[_0xf887('0x41')](handleError(_0x5deba0,null));};exports[_0xf887('0x42')]=function(_0x4022c4,_0x4e4f7d){var _0xfea86e={'raw':![],'where':{'id':_0x4022c4[_0xf887('0x43')]['id']}},_0x378796={};_0x378796[_0xf887('0x2e')]=_['keys'](db[_0xf887('0x44')]['rawAttributes']);_0x378796[_0xf887('0x2f')]=_[_0xf887('0x45')](_0x4022c4[_0xf887('0x2f')]);_0x378796[_0xf887('0x30')]=_[_0xf887('0x31')](_0x378796[_0xf887('0x2e')],_0x378796['query']);_0xfea86e['attributes']=_['intersection'](_0x378796['model'],qs[_0xf887('0x33')](_0x4022c4[_0xf887('0x2f')]['fields']));_0xfea86e[_0xf887('0x32')]=_0xfea86e[_0xf887('0x32')][_0xf887('0x46')]?_0xfea86e[_0xf887('0x32')]:_0x378796['model'];if(_0x4022c4[_0xf887('0x2f')][_0xf887('0x47')]){_0xfea86e[_0xf887('0x3e')]=[{'all':!![]}];}_0xfea86e=_['merge']({},_0xfea86e,_0x4022c4[_0xf887('0x3d')]);return db[_0xf887('0x44')][_0xf887('0x48')](_0xfea86e)[_0xf887('0x22')](handleEntityNotFound(_0x4e4f7d,null))[_0xf887('0x22')](respondWithResult(_0x4e4f7d,null))['catch'](handleError(_0x4e4f7d,null));};exports[_0xf887('0x49')]=function(_0x22d088,_0x427e6c){return db[_0xf887('0x44')][_0xf887('0x49')](_0x22d088['body'],{})[_0xf887('0x22')](respondWithResult(_0x427e6c,0xc9))[_0xf887('0x41')](handleError(_0x427e6c,null));};exports[_0xf887('0x21')]=function(_0x1ce664,_0xbb8867){if(_0x1ce664['body']['id']){delete _0x1ce664[_0xf887('0x4a')]['id'];}return db['FreshsalesAccount'][_0xf887('0x48')]({'where':{'id':_0x1ce664[_0xf887('0x43')]['id']}})['then'](handleEntityNotFound(_0xbb8867,null))[_0xf887('0x22')](saveUpdates(_0x1ce664[_0xf887('0x4a')],null))[_0xf887('0x22')](respondWithResult(_0xbb8867,null))['catch'](handleError(_0xbb8867,null));};exports[_0xf887('0x23')]=function(_0x42fe8e,_0x482186){return db['FreshsalesAccount'][_0xf887('0x48')]({'where':{'id':_0x42fe8e[_0xf887('0x43')]['id']}})[_0xf887('0x22')](handleEntityNotFound(_0x482186,null))['then'](removeEntity(_0x482186,null))['catch'](handleError(_0x482186,null));};exports['getConfigurations']=function(_0x542f62,_0x5c6c40,_0x4a2a39){var _0x1f54c5={};var _0x3a0ec7={};var _0x195c52;var _0xc7b54a;return db[_0xf887('0x44')][_0xf887('0x4b')]({'where':{'id':_0x542f62[_0xf887('0x43')]['id']}})[_0xf887('0x22')](handleEntityNotFound(_0x5c6c40,null))[_0xf887('0x22')](function(_0x4487fb){if(_0x4487fb){_0x195c52=_0x4487fb;_0x3a0ec7['model']=_[_0xf887('0x45')](db[_0xf887('0x4c')][_0xf887('0x2a')]);_0x3a0ec7[_0xf887('0x2f')]=_['keys'](_0x542f62[_0xf887('0x2f')]);_0x3a0ec7['filters']=_[_0xf887('0x31')](_0x3a0ec7[_0xf887('0x2e')],_0x3a0ec7[_0xf887('0x2f')]);_0x1f54c5[_0xf887('0x32')]=_[_0xf887('0x31')](_0x3a0ec7[_0xf887('0x2e')],qs[_0xf887('0x33')](_0x542f62[_0xf887('0x2f')][_0xf887('0x33')]));_0x1f54c5[_0xf887('0x32')]=_0x1f54c5['attributes'][_0xf887('0x46')]?_0x1f54c5[_0xf887('0x32')]:_0x3a0ec7['model'];_0x1f54c5[_0xf887('0x36')]=qs[_0xf887('0x37')](_0x542f62['query'][_0xf887('0x37')]);_0x1f54c5[_0xf887('0x38')]=qs[_0xf887('0x30')](_[_0xf887('0x39')](_0x542f62[_0xf887('0x2f')],_0x3a0ec7[_0xf887('0x30')]));if(_0x542f62[_0xf887('0x2f')]['filter']){_0x1f54c5[_0xf887('0x38')]=_[_0xf887('0x3b')](_0x1f54c5['where'],{'$or':_[_0xf887('0x29')](_0x1f54c5['attributes'],function(_0xda0ab3){var _0x4456c8={};_0x4456c8[_0xda0ab3]={'$like':'%'+_0x542f62['query'][_0xf887('0x3a')]+'%'};return _0x4456c8;})});}_0x1f54c5=_[_0xf887('0x3b')]({},_0x1f54c5,_0x542f62[_0xf887('0x3d')]);return _0x195c52['getConfigurations'](_0x1f54c5);}})[_0xf887('0x22')](function(_0x10a6fa){if(_0x10a6fa){_0xc7b54a=_0x10a6fa[_0xf887('0x46')];if(!_0x542f62[_0xf887('0x2f')]['hasOwnProperty'](_0xf887('0x35'))){_0x1f54c5['limit']=qs[_0xf887('0x1e')](_0x542f62['query'][_0xf887('0x1e')]);_0x1f54c5[_0xf887('0x1d')]=qs['offset'](_0x542f62[_0xf887('0x2f')][_0xf887('0x1d')]);}return _0x195c52[_0xf887('0x4d')](_0x1f54c5);}})[_0xf887('0x22')](function(_0x5e1a15){if(_0x5e1a15){return _0x5e1a15?{'count':_0xc7b54a,'rows':_0x5e1a15}:null;}})[_0xf887('0x22')](respondWithResult(_0x5c6c40,null))[_0xf887('0x41')](handleError(_0x5c6c40,null));};exports[_0xf887('0x4e')]=function(_0x216e2c,_0x4179f8,_0x30746){if(_0x216e2c[_0xf887('0x4a')]['id']){delete _0x216e2c[_0xf887('0x4a')]['id'];}return db[_0xf887('0x44')][_0xf887('0x4b')]({'where':{'id':_0x216e2c[_0xf887('0x43')]['id']}})[_0xf887('0x22')](handleEntityNotFound(_0x4179f8,null))[_0xf887('0x22')](function(_0x90de43){if(_0x90de43){_0x216e2c[_0xf887('0x4a')]['AccountId']=_0x90de43['id'];_0x216e2c[_0xf887('0x4a')][_0xf887('0x4f')]=integrations[_0xf887('0x50')](_0x216e2c[_0xf887('0x4a')][_0xf887('0x51')],_0x216e2c[_0xf887('0x4a')][_0xf887('0x2c')]);_0x216e2c[_0xf887('0x4a')]['Descriptions']=integrations[_0xf887('0x52')](_0x216e2c[_0xf887('0x4a')][_0xf887('0x51')],_0x216e2c[_0xf887('0x4a')][_0xf887('0x2c')]);return db['FreshsalesConfiguration']['create'](_0x216e2c[_0xf887('0x4a')],{'include':[{'model':db[_0xf887('0x53')],'as':_0xf887('0x4f')},{'model':db[_0xf887('0x53')],'as':_0xf887('0x54')}]});}return null;})['then'](respondWithResult(_0x4179f8,null))[_0xf887('0x41')](handleError(_0x4179f8,null));};exports[_0xf887('0x55')]=function(_0x511943,_0x3a477a,_0x23332a){var _0x36926a='';var _0x2c9d6a='';return db[_0xf887('0x44')][_0xf887('0x4b')]({'where':{'id':_0x511943[_0xf887('0x43')]['id']},'attributes':['id',_0xf887('0x56'),_0xf887('0x57'),_0xf887('0x58')]})[_0xf887('0x22')](handleEntityNotFound(_0x3a477a,null))[_0xf887('0x22')](function(_0x27f477){if(_0x27f477){_0x2c9d6a=_0x27f477[_0xf887('0x56')];_0x36926a=_0x27f477['remoteUri'];var _0x13241a=_0x27f477['remoteUri'][_0xf887('0x59')](-0x1);if(_0x13241a==='/'){_0x36926a=_0x36926a[_0xf887('0x5a')](0x0,_0x36926a[_0xf887('0x5b')](_0x13241a));}return rp({'method':_0xf887('0x5c'),'uri':util[_0xf887('0x5d')](_0xf887('0x5e'),_0x36926a,'/api/selector/owners'),'headers':{'Authorization':_0xf887('0x5f')+_0x27f477[_0xf887('0x58')]},'json':!![]});}})[_0xf887('0x22')](function(_0x312447){if(_0x312447){var _0x3f49ee=_0x312447[_0xf887('0x60')];var _0x150d56=![];var _0xa1a1ff=null;for(_0xa1a1ff=0x0;_0xa1a1ff<_0x3f49ee[_0xf887('0x46')];_0xa1a1ff++){if(_0x3f49ee[_0xa1a1ff][_0xf887('0x61')]===_0x2c9d6a){_0x150d56=!![];}}if(_0x150d56){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xf887('0x22')](respondWithResult(_0x3a477a,null))[_0xf887('0x41')](function(_0x3a50d6){var _0x9cf756=_0x511943[_0xf887('0x2f')][_0xf887('0x62')]?0x1f4:_0x3a50d6[_0xf887('0x63')]||0x1f4;logger['error'](_0xf887('0x64'),_0xf887('0x55'),_0x9cf756,JSON['stringify'](_0x3a50d6));delete _0x3a50d6['name'];if(_0x9cf756===0x191){_0x9cf756=0x190;}_0x3a477a[_0xf887('0x18')](_0x9cf756)[_0xf887('0x27')](_0x511943[_0xf887('0x2f')][_0xf887('0x62')]?{'message':_0xf887('0x65'),'statusCode':_0x3a50d6[_0xf887('0x63')]}:_0x3a50d6);});};
\ No newline at end of file
index 070c5f2..5a90185 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f4=['define','FreshsalesAccount','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4f714f,_0x1c8c71){var _0x4ea9ec=function(_0xdf1b3e){while(--_0xdf1b3e){_0x4f714f['push'](_0x4f714f['shift']());}};_0x4ea9ec(++_0x1c8c71);}(_0x32f4,0x154));var _0x432f=function(_0x46ccd0,_0x2798b3){_0x46ccd0=_0x46ccd0-0x0;var _0x15f510=_0x32f4[_0x46ccd0];return _0x15f510;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var logger=require(_0x432f('0x2'))(_0x432f('0x3'));var moment=require('moment');var BPromise=require(_0x432f('0x4'));var rp=require(_0x432f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var attributes=require(_0x432f('0x8'));var integrations=require(_0x432f('0x9'));module[_0x432f('0xa')]=function(_0x5d8cc0,_0x5b5f08){return _0x5d8cc0[_0x432f('0xb')](_0x432f('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb11=['lodash','../../config/logger','api','bluebird','path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x4957af,_0x10c9f0){var _0x2fb38c=function(_0x35c256){while(--_0x35c256){_0x4957af['push'](_0x4957af['shift']());}};_0x2fb38c(++_0x10c9f0);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xfb11[_0x32d457];return _0x338386;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x1fb1('0x7')]=function(_0x133727,_0x4c098d){return _0x133727[_0x1fb1('0x8')](_0x1fb1('0x9'),attributes,{'tableName':_0x1fb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 947f371..afdb036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1883=['GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','then','info','find','where','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x384764,_0x249064){var _0x5ac7b5=function(_0x1efdd1){while(--_0x1efdd1){_0x384764['push'](_0x384764['shift']());}};_0x5ac7b5(++_0x249064);}(_0x1883,0xab));var _0x3188=function(_0x6309c9,_0x36e553){_0x6309c9=_0x6309c9-0x0;var _0x12bf70=_0x1883[_0x6309c9];return _0x12bf70;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});}exports[_0x3188('0x18')]=function(_0x3f5b35){var _0x37e646=this;return new Promise(function(_0x18a71a,_0x4f27b0){return db[_0x3188('0x19')][_0x3188('0x1a')]({'raw':_0x3f5b35['options']?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f5b35['options']?_0x3f5b35['options']['where']||null:null,'attributes':_0x3f5b35[_0x3188('0x1b')]?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1d')]||null:null,'limit':_0x3f5b35['options']?_0x3f5b35['options'][_0x3188('0x1e')]||null:null,'include':_0x3f5b35[_0x3188('0x1b')]?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1f')]?_[_0x3188('0x20')](_0x3f5b35['options'][_0x3188('0x1f')],function(_0x33f882){return{'model':db[_0x33f882['model']],'as':_0x33f882['as'],'attributes':_0x33f882[_0x3188('0x1d')],'include':_0x33f882['include']?_['map'](_0x33f882[_0x3188('0x1f')],function(_0x129bd7){return{'model':db[_0x129bd7[_0x3188('0x21')]],'as':_0x129bd7['as'],'attributes':_0x129bd7[_0x3188('0x1d')],'include':_0x129bd7[_0x3188('0x1f')]?_[_0x3188('0x20')](_0x129bd7[_0x3188('0x1f')],function(_0x11021c){return{'model':db[_0x11021c['model']],'as':_0x11021c['as'],'attributes':_0x11021c[_0x3188('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3188('0x22')](function(_0x52bb13){logger[_0x3188('0x23')](_0x3188('0x18'),_0x3f5b35);logger[_0x3188('0x11')](_0x3188('0x18'),_0x3f5b35,JSON[_0x3188('0x13')](_0x52bb13));_0x18a71a(_0x52bb13);})[_0x3188('0x17')](function(_0x8f810f){logger[_0x3188('0x14')]('GetFreshsalesAccount',_0x8f810f[_0x3188('0x15')],_0x3f5b35);_0x4f27b0(_0x37e646['error'](0x1f4,_0x8f810f[_0x3188('0x15')]));});});};exports['ShowFreshsalesAccount']=function(_0x3f82ce){var _0x80f9a8=this;return new Promise(function(_0x3be4f7,_0xacdad7){return db[_0x3188('0x19')][_0x3188('0x24')]({'raw':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x25')]||null:null,'attributes':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1d')]||null:null,'include':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1f')]?_['map'](_0x3f82ce[_0x3188('0x1b')]['include'],function(_0x1c945e){return{'model':db[_0x1c945e[_0x3188('0x21')]],'as':_0x1c945e['as'],'attributes':_0x1c945e['attributes'],'include':_0x1c945e[_0x3188('0x1f')]?_[_0x3188('0x20')](_0x1c945e[_0x3188('0x1f')],function(_0x6d503d){return{'model':db[_0x6d503d[_0x3188('0x21')]],'as':_0x6d503d['as'],'attributes':_0x6d503d[_0x3188('0x1d')],'include':_0x6d503d[_0x3188('0x1f')]?_['map'](_0x6d503d['include'],function(_0xa876c8){return{'model':db[_0xa876c8[_0x3188('0x21')]],'as':_0xa876c8['as'],'attributes':_0xa876c8[_0x3188('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3188('0x22')](function(_0x4a64a4){logger[_0x3188('0x23')](_0x3188('0x26'),_0x3f82ce);logger[_0x3188('0x11')](_0x3188('0x26'),_0x3f82ce,JSON['stringify'](_0x4a64a4));_0x3be4f7(_0x4a64a4);})[_0x3188('0x17')](function(_0x4a290f){logger[_0x3188('0x14')]('ShowFreshsalesAccount',_0x4a290f[_0x3188('0x15')],_0x3f82ce);_0xacdad7(_0x80f9a8[_0x3188('0x14')](0x1f4,_0x4a290f[_0x3188('0x15')]));});});};
\ No newline at end of file
+var _0x0120=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','FreshsalesAccount','find','ShowFreshsalesAccount','lodash','util','moment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0120,0x6f));var _0x0012=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0120[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['FreshsalesAccount'][_0x0012('0x17')]({'raw':_0x1d0423[_0x0012('0x18')]?_0x1d0423['options'][_0x0012('0x19')]===undefined?!![]:![]:!![],'where':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x1d0423['options']?_0x1d0423['options'][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1c')]||null:null,'include':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x1d0423['options'][_0x0012('0x1d')],function(_0x24a280){return{'model':db[_0x24a280['model']],'as':_0x24a280['as'],'attributes':_0x24a280[_0x0012('0x1b')],'include':_0x24a280[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x24a280[_0x0012('0x1d')],function(_0x42bcd7){return{'model':db[_0x42bcd7['model']],'as':_0x42bcd7['as'],'attributes':_0x42bcd7[_0x0012('0x1b')],'include':_0x42bcd7[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x42bcd7[_0x0012('0x1d')],function(_0x173cb3){return{'model':db[_0x173cb3[_0x0012('0x1f')]],'as':_0x173cb3['as'],'attributes':_0x173cb3[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0012('0x20')](function(_0x300e13){logger[_0x0012('0xd')](_0x0012('0x16'),_0x1d0423);logger[_0x0012('0x21')](_0x0012('0x16'),_0x1d0423,JSON[_0x0012('0x11')](_0x300e13));_0x1e78ee(_0x300e13);})[_0x0012('0x22')](function(_0x276389){logger[_0x0012('0x12')](_0x0012('0x16'),_0x276389[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1[_0x0012('0x12')](0x1f4,_0x276389[_0x0012('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x283134){var _0x1bb49b=this;return new Promise(function(_0x4c2601,_0x2fa6a2){return db[_0x0012('0x23')][_0x0012('0x24')]({'raw':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x283134['options']?_0x283134[_0x0012('0x18')][_0x0012('0x1b')]||null:null,'include':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x283134['options'][_0x0012('0x1d')],function(_0x30dfd8){return{'model':db[_0x30dfd8[_0x0012('0x1f')]],'as':_0x30dfd8['as'],'attributes':_0x30dfd8[_0x0012('0x1b')],'include':_0x30dfd8['include']?_['map'](_0x30dfd8[_0x0012('0x1d')],function(_0x30f8a2){return{'model':db[_0x30f8a2[_0x0012('0x1f')]],'as':_0x30f8a2['as'],'attributes':_0x30f8a2[_0x0012('0x1b')],'include':_0x30f8a2[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x30f8a2[_0x0012('0x1d')],function(_0x4f13b9){return{'model':db[_0x4f13b9[_0x0012('0x1f')]],'as':_0x4f13b9['as'],'attributes':_0x4f13b9[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x196222){logger[_0x0012('0xd')](_0x0012('0x25'),_0x283134);logger[_0x0012('0x21')](_0x0012('0x25'),_0x283134,JSON[_0x0012('0x11')](_0x196222));_0x4c2601(_0x196222);})[_0x0012('0x22')](function(_0x4a4af8){logger[_0x0012('0x12')]('ShowFreshsalesAccount',_0x4a4af8[_0x0012('0x14')],_0x283134);_0x2fa6a2(_0x1bb49b['error'](0x1f4,_0x4a4af8['message']));});});};
\ No newline at end of file
index 716feef..638a2af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd3=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','getSubjects','getDescriptions','/:id/fields','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x115115,_0x1742e7){var _0x40c1a4=function(_0x2ec7f2){while(--_0x2ec7f2){_0x115115['push'](_0x115115['shift']());}};_0x40c1a4(++_0x1742e7);}(_0x0bd3,0xee));var _0x30bd=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x0bd3[_0x1daaa9];return _0x1dd221;};'use strict';var multer=require(_0x30bd('0x0'));var util=require(_0x30bd('0x1'));var path=require(_0x30bd('0x2'));var timeout=require(_0x30bd('0x3'));var express=require(_0x30bd('0x4'));var router=express[_0x30bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x30bd('0x6'));var interaction=require(_0x30bd('0x7'));var config=require(_0x30bd('0x8'));var controller=require(_0x30bd('0x9'));router[_0x30bd('0xa')]('/',auth[_0x30bd('0xb')](),controller['index']);router[_0x30bd('0xa')](_0x30bd('0xc'),auth[_0x30bd('0xb')](),controller[_0x30bd('0xd')]);router[_0x30bd('0xa')]('/:id/subjects',auth[_0x30bd('0xb')](),controller[_0x30bd('0xe')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x30bd('0xf')]);router[_0x30bd('0xa')](_0x30bd('0x10'),auth[_0x30bd('0xb')](),controller['getFields']);router['post']('/',auth[_0x30bd('0xb')](),controller[_0x30bd('0x11')]);router[_0x30bd('0x12')](_0x30bd('0xc'),auth[_0x30bd('0xb')](),controller['update']);router[_0x30bd('0x13')](_0x30bd('0xc'),auth[_0x30bd('0xb')](),controller[_0x30bd('0x14')]);module[_0x30bd('0x15')]=router;
\ No newline at end of file
+var _0x2964=['isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x21306b,_0x30158b){var _0x2c193f=function(_0x259706){while(--_0x259706){_0x21306b['push'](_0x21306b['shift']());}};_0x2c193f(++_0x30158b);}(_0x2964,0x142));var _0x4296=function(_0x4c7fa3,_0x152dba){_0x4c7fa3=_0x4c7fa3-0x0;var _0x396e36=_0x2964[_0x4c7fa3];return _0x396e36;};'use strict';var multer=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4296('0x2'));var router=express[_0x4296('0x3')]();var fs_extra=require(_0x4296('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4296('0x5'));var config=require(_0x4296('0x6'));var controller=require(_0x4296('0x7'));router['get']('/',auth[_0x4296('0x8')](),controller[_0x4296('0x9')]);router[_0x4296('0xa')](_0x4296('0xb'),auth[_0x4296('0x8')](),controller[_0x4296('0xc')]);router['get'](_0x4296('0xd'),auth[_0x4296('0x8')](),controller[_0x4296('0xe')]);router[_0x4296('0xa')](_0x4296('0xf'),auth[_0x4296('0x8')](),controller[_0x4296('0x10')]);router[_0x4296('0xa')]('/:id/fields',auth[_0x4296('0x8')](),controller['getFields']);router[_0x4296('0x11')]('/',auth[_0x4296('0x8')](),controller[_0x4296('0x12')]);router['put'](_0x4296('0xb'),auth[_0x4296('0x8')](),controller[_0x4296('0x13')]);router[_0x4296('0x14')]('/:id',auth[_0x4296('0x8')](),controller['destroy']);module[_0x4296('0x15')]=router;
\ No newline at end of file
index 6051d40..7348b41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87aa=['exports','STRING','sequelize'];(function(_0x504a92,_0x1dcdb){var _0x5aa5d6=function(_0x34b3ad){while(--_0x34b3ad){_0x504a92['push'](_0x504a92['shift']());}};_0x5aa5d6(++_0x1dcdb);}(_0x87aa,0x1f4));var _0xa87a=function(_0xae7883,_0xabf9c8){_0xae7883=_0xae7883-0x0;var _0xd55326=_0x87aa[_0xae7883];return _0xd55326;};'use strict';var Sequelize=require(_0xa87a('0x0'));module[_0xa87a('0x1')]={'name':{'type':Sequelize[_0xa87a('0x2')]},'description':{'type':Sequelize[_0xa87a('0x2')]}};
\ No newline at end of file
+var _0x7f84=['sequelize','STRING'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x7f84,0x1c2));var _0x47f8=function(_0x1fda58,_0x1a691d){_0x1fda58=_0x1fda58-0x0;var _0x3dce0e=_0x7f84[_0x1fda58];return _0x3dce0e;};'use strict';var Sequelize=require(_0x47f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x47f8('0x1')]},'description':{'type':Sequelize[_0x47f8('0x1')]}};
\ No newline at end of file
index 2285c7a..5b8377c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0253=['attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','then','rows','show','params','include','find','catch','create','body','getSubjects','findOne','FreshsalesField','nolimit','getDescriptions','options','getFields','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x2f1a77,_0x433aaf){var _0x2350d0=function(_0x107a2b){while(--_0x107a2b){_0x2f1a77['push'](_0x2f1a77['shift']());}};_0x2350d0(++_0x433aaf);}(_0x0253,0x11d));var _0x3025=function(_0x5b90a7,_0x548412){_0x5b90a7=_0x5b90a7-0x0;var _0x165ee4=_0x0253[_0x5b90a7];return _0x165ee4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3025('0x0'));var zipdir=require(_0x3025('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3025('0x2'));var BPromise=require(_0x3025('0x3'));var Mustache=require(_0x3025('0x4'));var util=require(_0x3025('0x5'));var path=require(_0x3025('0x6'));var sox=require(_0x3025('0x7'));var csv=require(_0x3025('0x8'));var ejs=require(_0x3025('0x9'));var fs=require('fs');var fs_extra=require(_0x3025('0xa'));var _=require(_0x3025('0xb'));var squel=require('squel');var crypto=require(_0x3025('0xc'));var jsforce=require(_0x3025('0xd'));var deskjs=require(_0x3025('0xe'));var toCsv=require(_0x3025('0x8'));var querystring=require(_0x3025('0xf'));var Papa=require(_0x3025('0x10'));var Redis=require(_0x3025('0x11'));var authService=require(_0x3025('0x12'));var qs=require(_0x3025('0x13'));var as=require(_0x3025('0x14'));var hardwareService=require(_0x3025('0x15'));var logger=require(_0x3025('0x16'))(_0x3025('0x17'));var utils=require(_0x3025('0x18'));var config=require(_0x3025('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3025('0x1a'))['db'];function respondWithStatusCode(_0xe11496,_0x25962b){_0x25962b=_0x25962b||0xcc;return function(_0x26a780){if(_0x26a780){return _0xe11496[_0x3025('0x1b')](_0x25962b);}return _0xe11496['status'](_0x25962b)[_0x3025('0x1c')]();};}function respondWithResult(_0x17663f,_0x5a44a1){_0x5a44a1=_0x5a44a1||0xc8;return function(_0x3d8750){if(_0x3d8750){return _0x17663f[_0x3025('0x1d')](_0x5a44a1)['json'](_0x3d8750);}};}function respondWithFilteredResult(_0x30f5ed,_0x3fd9a1){return function(_0x406317){if(_0x406317){var _0x78a559=typeof _0x3fd9a1[_0x3025('0x1e')]===_0x3025('0x1f')&&typeof _0x3fd9a1['limit']===_0x3025('0x1f');var _0x4c9bd3=_0x406317['count'];var _0x313f98=_0x78a559?0x0:_0x3fd9a1[_0x3025('0x1e')];var _0x5cf383=_0x78a559?_0x406317[_0x3025('0x20')]:_0x3fd9a1[_0x3025('0x1e')]+_0x3fd9a1[_0x3025('0x21')];var _0x1fa439;if(_0x5cf383>=_0x4c9bd3){_0x5cf383=_0x4c9bd3;_0x1fa439=0xc8;}else{_0x1fa439=0xce;}_0x30f5ed[_0x3025('0x1d')](_0x1fa439);return _0x30f5ed[_0x3025('0x22')](_0x3025('0x23'),_0x313f98+'-'+_0x5cf383+'/'+_0x4c9bd3)[_0x3025('0x24')](_0x406317);}return null;};}function patchUpdates(_0x47b663){return function(_0x43e1fa){try{jsonpatch['apply'](_0x43e1fa,_0x47b663,!![]);}catch(_0x36bb2d){return BPromise[_0x3025('0x25')](_0x36bb2d);}return _0x43e1fa[_0x3025('0x26')]();};}function saveUpdates(_0x270647,_0x33586c){return function(_0x3156b7){if(_0x3156b7){return _0x3156b7[_0x3025('0x27')](_0x270647)['then'](function(_0x35cde0){return _0x35cde0;});}return null;};}function removeEntity(_0x5a822a,_0x3fac03){return function(_0x5cf70a){if(_0x5cf70a){return _0x5cf70a[_0x3025('0x28')]()['then'](function(){_0x5a822a[_0x3025('0x1d')](0xcc)[_0x3025('0x1c')]();});}};}function handleEntityNotFound(_0x158ca8,_0x46f773){return function(_0x4d3d26){if(!_0x4d3d26){_0x158ca8[_0x3025('0x1b')](0x194);}return _0x4d3d26;};}function handleError(_0x11a372,_0x131e68){_0x131e68=_0x131e68||0x1f4;return function(_0x3e3223){logger[_0x3025('0x29')](_0x3e3223[_0x3025('0x2a')]);if(_0x3e3223[_0x3025('0x2b')]){delete _0x3e3223['name'];}_0x11a372['status'](_0x131e68)[_0x3025('0x2c')](_0x3e3223);};}exports['index']=function(_0x54e9c0,_0xddd6c5){var _0x43c372={},_0x516c06={},_0x1eb363={'count':0x0,'rows':[]};var _0x223c69=_[_0x3025('0x2d')](db[_0x3025('0x2e')][_0x3025('0x2f')],function(_0x1e2b35){return{'name':_0x1e2b35[_0x3025('0x30')],'type':_0x1e2b35[_0x3025('0x31')][_0x3025('0x32')]};});_0x516c06[_0x3025('0x33')]=_['map'](_0x223c69,'name');_0x516c06[_0x3025('0x34')]=_[_0x3025('0x35')](_0x54e9c0['query']);_0x516c06[_0x3025('0x36')]=_['intersection'](_0x516c06[_0x3025('0x33')],_0x516c06['query']);_0x43c372[_0x3025('0x37')]=_[_0x3025('0x38')](_0x516c06[_0x3025('0x33')],qs[_0x3025('0x39')](_0x54e9c0[_0x3025('0x34')][_0x3025('0x39')]));_0x43c372['attributes']=_0x43c372[_0x3025('0x37')][_0x3025('0x3a')]?_0x43c372[_0x3025('0x37')]:_0x516c06[_0x3025('0x33')];if(!_0x54e9c0[_0x3025('0x34')][_0x3025('0x3b')]('nolimit')){_0x43c372[_0x3025('0x21')]=qs[_0x3025('0x21')](_0x54e9c0[_0x3025('0x34')][_0x3025('0x21')]);_0x43c372['offset']=qs[_0x3025('0x1e')](_0x54e9c0[_0x3025('0x34')][_0x3025('0x1e')]);}_0x43c372[_0x3025('0x3c')]=qs[_0x3025('0x3d')](_0x54e9c0[_0x3025('0x34')][_0x3025('0x3d')]);_0x43c372['where']=qs[_0x3025('0x36')](_[_0x3025('0x3e')](_0x54e9c0['query'],_0x516c06[_0x3025('0x36')]),_0x223c69);if(_0x54e9c0[_0x3025('0x34')][_0x3025('0x3f')]){_0x43c372[_0x3025('0x40')]=_[_0x3025('0x41')](_0x43c372[_0x3025('0x40')],{'$or':_[_0x3025('0x2d')](_0x223c69,function(_0x220e00){if(_0x220e00[_0x3025('0x31')]!==_0x3025('0x42')){var _0x1189b5={};_0x1189b5[_0x220e00[_0x3025('0x2b')]]={'$like':'%'+_0x54e9c0['query'][_0x3025('0x3f')]+'%'};return _0x1189b5;}})});}_0x43c372=_[_0x3025('0x41')]({},_0x43c372,_0x54e9c0['options']);var _0x1cd068={'where':_0x43c372[_0x3025('0x40')]};return db[_0x3025('0x2e')][_0x3025('0x20')](_0x1cd068)['then'](function(_0x541d57){_0x1eb363[_0x3025('0x20')]=_0x541d57;if(_0x54e9c0[_0x3025('0x34')][_0x3025('0x43')]){_0x43c372['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x3025('0x44')](_0x43c372);})[_0x3025('0x45')](function(_0x2ec879){_0x1eb363[_0x3025('0x46')]=_0x2ec879;return _0x1eb363;})[_0x3025('0x45')](respondWithFilteredResult(_0xddd6c5,_0x43c372))['catch'](handleError(_0xddd6c5,null));};exports[_0x3025('0x47')]=function(_0x593911,_0x3e5da8){var _0x477849={'raw':![],'where':{'id':_0x593911[_0x3025('0x48')]['id']}},_0x44db42={};_0x44db42[_0x3025('0x33')]=_[_0x3025('0x35')](db[_0x3025('0x2e')][_0x3025('0x2f')]);_0x44db42['query']=_[_0x3025('0x35')](_0x593911[_0x3025('0x34')]);_0x44db42[_0x3025('0x36')]=_[_0x3025('0x38')](_0x44db42[_0x3025('0x33')],_0x44db42['query']);_0x477849[_0x3025('0x37')]=_['intersection'](_0x44db42['model'],qs[_0x3025('0x39')](_0x593911[_0x3025('0x34')][_0x3025('0x39')]));_0x477849[_0x3025('0x37')]=_0x477849[_0x3025('0x37')][_0x3025('0x3a')]?_0x477849[_0x3025('0x37')]:_0x44db42[_0x3025('0x33')];if(_0x593911[_0x3025('0x34')][_0x3025('0x43')]){_0x477849[_0x3025('0x49')]=[{'all':!![]}];}_0x477849=_[_0x3025('0x41')]({},_0x477849,_0x593911['options']);return db['FreshsalesConfiguration'][_0x3025('0x4a')](_0x477849)[_0x3025('0x45')](handleEntityNotFound(_0x3e5da8,null))[_0x3025('0x45')](respondWithResult(_0x3e5da8,null))[_0x3025('0x4b')](handleError(_0x3e5da8,null));};exports[_0x3025('0x4c')]=function(_0x43d05f,_0x40f3db){return db[_0x3025('0x2e')]['create'](_0x43d05f[_0x3025('0x4d')],{})[_0x3025('0x45')](respondWithResult(_0x40f3db,0xc9))[_0x3025('0x4b')](handleError(_0x40f3db,null));};exports[_0x3025('0x27')]=function(_0x4b37ef,_0x6a1381){if(_0x4b37ef['body']['id']){delete _0x4b37ef['body']['id'];}return db[_0x3025('0x2e')][_0x3025('0x4a')]({'where':{'id':_0x4b37ef[_0x3025('0x48')]['id']}})['then'](handleEntityNotFound(_0x6a1381,null))[_0x3025('0x45')](saveUpdates(_0x4b37ef[_0x3025('0x4d')],null))[_0x3025('0x45')](respondWithResult(_0x6a1381,null))['catch'](handleError(_0x6a1381,null));};exports['destroy']=function(_0xbf87dc,_0x41b55d){return db[_0x3025('0x2e')][_0x3025('0x4a')]({'where':{'id':_0xbf87dc[_0x3025('0x48')]['id']}})[_0x3025('0x45')](handleEntityNotFound(_0x41b55d,null))['then'](removeEntity(_0x41b55d,null))[_0x3025('0x4b')](handleError(_0x41b55d,null));};exports[_0x3025('0x4e')]=function(_0x5c1169,_0x2afef2,_0x22fa2f){var _0x294c0b={};var _0x467f1b={};var _0x482dec;var _0x4c9318;return db[_0x3025('0x2e')][_0x3025('0x4f')]({'where':{'id':_0x5c1169[_0x3025('0x48')]['id']}})[_0x3025('0x45')](handleEntityNotFound(_0x2afef2,null))[_0x3025('0x45')](function(_0x53ee14){if(_0x53ee14){_0x482dec=_0x53ee14;_0x467f1b[_0x3025('0x33')]=_[_0x3025('0x35')](db[_0x3025('0x50')][_0x3025('0x2f')]);_0x467f1b[_0x3025('0x34')]=_['keys'](_0x5c1169['query']);_0x467f1b[_0x3025('0x36')]=_[_0x3025('0x38')](_0x467f1b[_0x3025('0x33')],_0x467f1b['query']);_0x294c0b[_0x3025('0x37')]=_[_0x3025('0x38')](_0x467f1b['model'],qs['fields'](_0x5c1169[_0x3025('0x34')][_0x3025('0x39')]));_0x294c0b[_0x3025('0x37')]=_0x294c0b[_0x3025('0x37')][_0x3025('0x3a')]?_0x294c0b[_0x3025('0x37')]:_0x467f1b[_0x3025('0x33')];_0x294c0b['order']=qs[_0x3025('0x3d')](_0x5c1169[_0x3025('0x34')][_0x3025('0x3d')]);_0x294c0b[_0x3025('0x40')]=qs[_0x3025('0x36')](_['pick'](_0x5c1169[_0x3025('0x34')],_0x467f1b[_0x3025('0x36')]));if(_0x5c1169[_0x3025('0x34')]['filter']){_0x294c0b[_0x3025('0x40')]=_[_0x3025('0x41')](_0x294c0b[_0x3025('0x40')],{'$or':_[_0x3025('0x2d')](_0x294c0b[_0x3025('0x37')],function(_0x3d2c37){var _0x2acfdb={};_0x2acfdb[_0x3d2c37]={'$like':'%'+_0x5c1169[_0x3025('0x34')][_0x3025('0x3f')]+'%'};return _0x2acfdb;})});}_0x294c0b=_['merge']({},_0x294c0b,_0x5c1169['options']);return _0x482dec[_0x3025('0x4e')](_0x294c0b);}})['then'](function(_0x3f077b){if(_0x3f077b){_0x4c9318=_0x3f077b[_0x3025('0x3a')];if(!_0x5c1169[_0x3025('0x34')][_0x3025('0x3b')](_0x3025('0x51'))){_0x294c0b[_0x3025('0x21')]=qs[_0x3025('0x21')](_0x5c1169[_0x3025('0x34')][_0x3025('0x21')]);_0x294c0b['offset']=qs[_0x3025('0x1e')](_0x5c1169[_0x3025('0x34')]['offset']);}return _0x482dec[_0x3025('0x4e')](_0x294c0b);}})[_0x3025('0x45')](function(_0x1c9181){if(_0x1c9181){return _0x1c9181?{'count':_0x4c9318,'rows':_0x1c9181}:null;}})[_0x3025('0x45')](respondWithResult(_0x2afef2,null))[_0x3025('0x4b')](handleError(_0x2afef2,null));};exports[_0x3025('0x52')]=function(_0x58769f,_0x1a4162,_0xb9c84a){var _0x4b710c={};var _0x199b5c={};var _0x47c511;var _0x1e6214;return db[_0x3025('0x2e')][_0x3025('0x4f')]({'where':{'id':_0x58769f['params']['id']}})[_0x3025('0x45')](handleEntityNotFound(_0x1a4162,null))[_0x3025('0x45')](function(_0x5bddf7){if(_0x5bddf7){_0x47c511=_0x5bddf7;_0x199b5c[_0x3025('0x33')]=_[_0x3025('0x35')](db[_0x3025('0x50')]['rawAttributes']);_0x199b5c[_0x3025('0x34')]=_['keys'](_0x58769f['query']);_0x199b5c['filters']=_['intersection'](_0x199b5c['model'],_0x199b5c[_0x3025('0x34')]);_0x4b710c['attributes']=_[_0x3025('0x38')](_0x199b5c[_0x3025('0x33')],qs['fields'](_0x58769f['query']['fields']));_0x4b710c['attributes']=_0x4b710c[_0x3025('0x37')]['length']?_0x4b710c[_0x3025('0x37')]:_0x199b5c[_0x3025('0x33')];_0x4b710c[_0x3025('0x3c')]=qs[_0x3025('0x3d')](_0x58769f[_0x3025('0x34')][_0x3025('0x3d')]);_0x4b710c[_0x3025('0x40')]=qs[_0x3025('0x36')](_[_0x3025('0x3e')](_0x58769f[_0x3025('0x34')],_0x199b5c[_0x3025('0x36')]));if(_0x58769f['query'][_0x3025('0x3f')]){_0x4b710c[_0x3025('0x40')]=_[_0x3025('0x41')](_0x4b710c[_0x3025('0x40')],{'$or':_[_0x3025('0x2d')](_0x4b710c[_0x3025('0x37')],function(_0x1ddf03){var _0x56685c={};_0x56685c[_0x1ddf03]={'$like':'%'+_0x58769f[_0x3025('0x34')]['filter']+'%'};return _0x56685c;})});}_0x4b710c=_[_0x3025('0x41')]({},_0x4b710c,_0x58769f[_0x3025('0x53')]);return _0x47c511[_0x3025('0x52')](_0x4b710c);}})['then'](function(_0x644827){if(_0x644827){_0x1e6214=_0x644827[_0x3025('0x3a')];if(!_0x58769f['query'][_0x3025('0x3b')](_0x3025('0x51'))){_0x4b710c['limit']=qs[_0x3025('0x21')](_0x58769f[_0x3025('0x34')]['limit']);_0x4b710c[_0x3025('0x1e')]=qs[_0x3025('0x1e')](_0x58769f['query'][_0x3025('0x1e')]);}return _0x47c511[_0x3025('0x52')](_0x4b710c);}})['then'](function(_0x599831){if(_0x599831){return _0x599831?{'count':_0x1e6214,'rows':_0x599831}:null;}})['then'](respondWithResult(_0x1a4162,null))[_0x3025('0x4b')](handleError(_0x1a4162,null));};exports[_0x3025('0x54')]=function(_0x496087,_0x4ad8de,_0x11da49){var _0x1e2af8={};var _0x3bf4b1={};var _0x1bd4ad;var _0x441c78;return db[_0x3025('0x2e')][_0x3025('0x4f')]({'where':{'id':_0x496087[_0x3025('0x48')]['id']}})[_0x3025('0x45')](handleEntityNotFound(_0x4ad8de,null))[_0x3025('0x45')](function(_0x5d98c2){if(_0x5d98c2){_0x1bd4ad=_0x5d98c2;_0x3bf4b1['model']=_['keys'](db[_0x3025('0x50')][_0x3025('0x2f')]);_0x3bf4b1[_0x3025('0x34')]=_[_0x3025('0x35')](_0x496087[_0x3025('0x34')]);_0x3bf4b1[_0x3025('0x36')]=_[_0x3025('0x38')](_0x3bf4b1['model'],_0x3bf4b1['query']);_0x1e2af8[_0x3025('0x37')]=_[_0x3025('0x38')](_0x3bf4b1[_0x3025('0x33')],qs['fields'](_0x496087['query'][_0x3025('0x39')]));_0x1e2af8[_0x3025('0x37')]=_0x1e2af8[_0x3025('0x37')]['length']?_0x1e2af8[_0x3025('0x37')]:_0x3bf4b1[_0x3025('0x33')];_0x1e2af8[_0x3025('0x3c')]=qs[_0x3025('0x3d')](_0x496087['query'][_0x3025('0x3d')]);_0x1e2af8['where']=qs[_0x3025('0x36')](_[_0x3025('0x3e')](_0x496087[_0x3025('0x34')],_0x3bf4b1[_0x3025('0x36')]));if(_0x496087[_0x3025('0x34')][_0x3025('0x3f')]){_0x1e2af8[_0x3025('0x40')]=_['merge'](_0x1e2af8[_0x3025('0x40')],{'$or':_[_0x3025('0x2d')](_0x1e2af8['attributes'],function(_0x362429){var _0x32e99d={};_0x32e99d[_0x362429]={'$like':'%'+_0x496087['query']['filter']+'%'};return _0x32e99d;})});}_0x1e2af8=_['merge']({},_0x1e2af8,_0x496087['options']);return _0x1bd4ad[_0x3025('0x54')](_0x1e2af8);}})[_0x3025('0x45')](function(_0x5dccee){if(_0x5dccee){_0x441c78=_0x5dccee[_0x3025('0x3a')];if(!_0x496087[_0x3025('0x34')][_0x3025('0x3b')](_0x3025('0x51'))){_0x1e2af8[_0x3025('0x21')]=qs[_0x3025('0x21')](_0x496087[_0x3025('0x34')]['limit']);_0x1e2af8['offset']=qs[_0x3025('0x1e')](_0x496087[_0x3025('0x34')][_0x3025('0x1e')]);}return _0x1bd4ad['getFields'](_0x1e2af8);}})[_0x3025('0x45')](function(_0x54f8a0){if(_0x54f8a0){return _0x54f8a0?{'count':_0x441c78,'rows':_0x54f8a0}:null;}})[_0x3025('0x45')](respondWithResult(_0x4ad8de,null))[_0x3025('0x4b')](handleError(_0x4ad8de,null));};
\ No newline at end of file
+var _0x301a=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','pick','filter','where','map','type','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','create','body','find','getSubjects','FreshsalesField','sort','nolimit','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x88fd2f,_0x24d564){var _0x12818e=function(_0x16c4ee){while(--_0x16c4ee){_0x88fd2f['push'](_0x88fd2f['shift']());}};_0x12818e(++_0x24d564);}(_0x301a,0x17b));var _0xa301=function(_0x3df67e,_0x3e7e09){_0x3df67e=_0x3df67e-0x0;var _0x20a87e=_0x301a[_0x3df67e];return _0x20a87e;};'use strict';var emlformat=require(_0xa301('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa301('0x1'));var jsonpatch=require(_0xa301('0x2'));var rp=require('request-promise');var moment=require(_0xa301('0x3'));var BPromise=require(_0xa301('0x4'));var Mustache=require(_0xa301('0x5'));var util=require('util');var path=require(_0xa301('0x6'));var sox=require(_0xa301('0x7'));var csv=require('to-csv');var ejs=require(_0xa301('0x8'));var fs=require('fs');var fs_extra=require(_0xa301('0x9'));var _=require(_0xa301('0xa'));var squel=require(_0xa301('0xb'));var crypto=require('crypto');var jsforce=require(_0xa301('0xc'));var deskjs=require(_0xa301('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa301('0xe'));var Papa=require(_0xa301('0xf'));var Redis=require(_0xa301('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa301('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa301('0x12'));var logger=require('../../config/logger')(_0xa301('0x13'));var utils=require(_0xa301('0x14'));var config=require(_0xa301('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x398f29,_0x5071d0){_0x5071d0=_0x5071d0||0xcc;return function(_0x149736){if(_0x149736){return _0x398f29[_0xa301('0x16')](_0x5071d0);}return _0x398f29[_0xa301('0x17')](_0x5071d0)[_0xa301('0x18')]();};}function respondWithResult(_0x4ba19c,_0x86ce9c){_0x86ce9c=_0x86ce9c||0xc8;return function(_0x1c4ec3){if(_0x1c4ec3){return _0x4ba19c['status'](_0x86ce9c)[_0xa301('0x19')](_0x1c4ec3);}};}function respondWithFilteredResult(_0x59d4e7,_0x263cad){return function(_0x8c7d4c){if(_0x8c7d4c){var _0x32454e=typeof _0x263cad[_0xa301('0x1a')]===_0xa301('0x1b')&&typeof _0x263cad[_0xa301('0x1c')]===_0xa301('0x1b');var _0x158842=_0x8c7d4c[_0xa301('0x1d')];var _0x5a0f34=_0x32454e?0x0:_0x263cad[_0xa301('0x1a')];var _0x198988=_0x32454e?_0x8c7d4c['count']:_0x263cad[_0xa301('0x1a')]+_0x263cad[_0xa301('0x1c')];var _0x47c921;if(_0x198988>=_0x158842){_0x198988=_0x158842;_0x47c921=0xc8;}else{_0x47c921=0xce;}_0x59d4e7[_0xa301('0x17')](_0x47c921);return _0x59d4e7[_0xa301('0x1e')](_0xa301('0x1f'),_0x5a0f34+'-'+_0x198988+'/'+_0x158842)[_0xa301('0x19')](_0x8c7d4c);}return null;};}function patchUpdates(_0x39c4a3){return function(_0x3b4c4e){try{jsonpatch[_0xa301('0x20')](_0x3b4c4e,_0x39c4a3,!![]);}catch(_0x308b02){return BPromise[_0xa301('0x21')](_0x308b02);}return _0x3b4c4e['save']();};}function saveUpdates(_0x27d4b0,_0x3a4fb9){return function(_0x2af36a){if(_0x2af36a){return _0x2af36a['update'](_0x27d4b0)[_0xa301('0x22')](function(_0x18786e){return _0x18786e;});}return null;};}function removeEntity(_0x5a9869,_0x22c97a){return function(_0x20fb56){if(_0x20fb56){return _0x20fb56[_0xa301('0x23')]()[_0xa301('0x22')](function(){_0x5a9869[_0xa301('0x17')](0xcc)[_0xa301('0x18')]();});}};}function handleEntityNotFound(_0x488cb1,_0xc8fa95){return function(_0x1cc67d){if(!_0x1cc67d){_0x488cb1[_0xa301('0x16')](0x194);}return _0x1cc67d;};}function handleError(_0x8a7de7,_0x691333){_0x691333=_0x691333||0x1f4;return function(_0x227a33){logger[_0xa301('0x24')](_0x227a33[_0xa301('0x25')]);if(_0x227a33[_0xa301('0x26')]){delete _0x227a33[_0xa301('0x26')];}_0x8a7de7[_0xa301('0x17')](_0x691333)[_0xa301('0x27')](_0x227a33);};}exports['index']=function(_0xb32c11,_0x101002){var _0x1d3a08={},_0x2694f6={},_0x1cd0cf={'count':0x0,'rows':[]};var _0x58d813=_['map'](db['FreshsalesConfiguration'][_0xa301('0x28')],function(_0xac5b00){return{'name':_0xac5b00[_0xa301('0x29')],'type':_0xac5b00['type'][_0xa301('0x2a')]};});_0x2694f6['model']=_['map'](_0x58d813,_0xa301('0x26'));_0x2694f6['query']=_[_0xa301('0x2b')](_0xb32c11[_0xa301('0x2c')]);_0x2694f6[_0xa301('0x2d')]=_[_0xa301('0x2e')](_0x2694f6[_0xa301('0x2f')],_0x2694f6[_0xa301('0x2c')]);_0x1d3a08['attributes']=_[_0xa301('0x2e')](_0x2694f6[_0xa301('0x2f')],qs[_0xa301('0x30')](_0xb32c11['query'][_0xa301('0x30')]));_0x1d3a08[_0xa301('0x31')]=_0x1d3a08[_0xa301('0x31')][_0xa301('0x32')]?_0x1d3a08[_0xa301('0x31')]:_0x2694f6['model'];if(!_0xb32c11[_0xa301('0x2c')][_0xa301('0x33')]('nolimit')){_0x1d3a08[_0xa301('0x1c')]=qs[_0xa301('0x1c')](_0xb32c11[_0xa301('0x2c')][_0xa301('0x1c')]);_0x1d3a08['offset']=qs[_0xa301('0x1a')](_0xb32c11[_0xa301('0x2c')]['offset']);}_0x1d3a08[_0xa301('0x34')]=qs['sort'](_0xb32c11[_0xa301('0x2c')]['sort']);_0x1d3a08['where']=qs[_0xa301('0x2d')](_[_0xa301('0x35')](_0xb32c11[_0xa301('0x2c')],_0x2694f6[_0xa301('0x2d')]),_0x58d813);if(_0xb32c11[_0xa301('0x2c')][_0xa301('0x36')]){_0x1d3a08['where']=_['merge'](_0x1d3a08[_0xa301('0x37')],{'$or':_[_0xa301('0x38')](_0x58d813,function(_0x30469d){if(_0x30469d[_0xa301('0x39')]!==_0xa301('0x3a')){var _0x2bc955={};_0x2bc955[_0x30469d[_0xa301('0x26')]]={'$like':'%'+_0xb32c11[_0xa301('0x2c')]['filter']+'%'};return _0x2bc955;}})});}_0x1d3a08=_[_0xa301('0x3b')]({},_0x1d3a08,_0xb32c11[_0xa301('0x3c')]);var _0x4287ca={'where':_0x1d3a08[_0xa301('0x37')]};return db[_0xa301('0x3d')][_0xa301('0x1d')](_0x4287ca)[_0xa301('0x22')](function(_0x3c008d){_0x1cd0cf[_0xa301('0x1d')]=_0x3c008d;if(_0xb32c11[_0xa301('0x2c')][_0xa301('0x3e')]){_0x1d3a08[_0xa301('0x3f')]=[{'all':!![]}];}return db[_0xa301('0x3d')][_0xa301('0x40')](_0x1d3a08);})['then'](function(_0x2ef341){_0x1cd0cf[_0xa301('0x41')]=_0x2ef341;return _0x1cd0cf;})[_0xa301('0x22')](respondWithFilteredResult(_0x101002,_0x1d3a08))[_0xa301('0x42')](handleError(_0x101002,null));};exports[_0xa301('0x43')]=function(_0x58f4e3,_0x150144){var _0x4adf98={'raw':![],'where':{'id':_0x58f4e3[_0xa301('0x44')]['id']}},_0x3bd9e5={};_0x3bd9e5[_0xa301('0x2f')]=_[_0xa301('0x2b')](db[_0xa301('0x3d')][_0xa301('0x28')]);_0x3bd9e5['query']=_['keys'](_0x58f4e3['query']);_0x3bd9e5['filters']=_[_0xa301('0x2e')](_0x3bd9e5[_0xa301('0x2f')],_0x3bd9e5[_0xa301('0x2c')]);_0x4adf98[_0xa301('0x31')]=_[_0xa301('0x2e')](_0x3bd9e5[_0xa301('0x2f')],qs[_0xa301('0x30')](_0x58f4e3[_0xa301('0x2c')][_0xa301('0x30')]));_0x4adf98[_0xa301('0x31')]=_0x4adf98['attributes'][_0xa301('0x32')]?_0x4adf98['attributes']:_0x3bd9e5[_0xa301('0x2f')];if(_0x58f4e3[_0xa301('0x2c')][_0xa301('0x3e')]){_0x4adf98[_0xa301('0x3f')]=[{'all':!![]}];}_0x4adf98=_[_0xa301('0x3b')]({},_0x4adf98,_0x58f4e3[_0xa301('0x3c')]);return db[_0xa301('0x3d')]['find'](_0x4adf98)[_0xa301('0x22')](handleEntityNotFound(_0x150144,null))[_0xa301('0x22')](respondWithResult(_0x150144,null))[_0xa301('0x42')](handleError(_0x150144,null));};exports[_0xa301('0x45')]=function(_0xd32f28,_0x41529b){return db['FreshsalesConfiguration'][_0xa301('0x45')](_0xd32f28[_0xa301('0x46')],{})['then'](respondWithResult(_0x41529b,0xc9))[_0xa301('0x42')](handleError(_0x41529b,null));};exports['update']=function(_0x119286,_0xcfd15a){if(_0x119286[_0xa301('0x46')]['id']){delete _0x119286[_0xa301('0x46')]['id'];}return db[_0xa301('0x3d')]['find']({'where':{'id':_0x119286['params']['id']}})['then'](handleEntityNotFound(_0xcfd15a,null))['then'](saveUpdates(_0x119286[_0xa301('0x46')],null))[_0xa301('0x22')](respondWithResult(_0xcfd15a,null))[_0xa301('0x42')](handleError(_0xcfd15a,null));};exports[_0xa301('0x23')]=function(_0x46f44c,_0x4f226e){return db[_0xa301('0x3d')][_0xa301('0x47')]({'where':{'id':_0x46f44c[_0xa301('0x44')]['id']}})[_0xa301('0x22')](handleEntityNotFound(_0x4f226e,null))[_0xa301('0x22')](removeEntity(_0x4f226e,null))[_0xa301('0x42')](handleError(_0x4f226e,null));};exports[_0xa301('0x48')]=function(_0x2fa881,_0x2f3610,_0x8b07c4){var _0x497fdd={};var _0x272397={};var _0x2cb92b;var _0x31d609;return db[_0xa301('0x3d')]['findOne']({'where':{'id':_0x2fa881[_0xa301('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f3610,null))[_0xa301('0x22')](function(_0x5dcdab){if(_0x5dcdab){_0x2cb92b=_0x5dcdab;_0x272397['model']=_[_0xa301('0x2b')](db[_0xa301('0x49')][_0xa301('0x28')]);_0x272397['query']=_[_0xa301('0x2b')](_0x2fa881[_0xa301('0x2c')]);_0x272397[_0xa301('0x2d')]=_[_0xa301('0x2e')](_0x272397[_0xa301('0x2f')],_0x272397[_0xa301('0x2c')]);_0x497fdd['attributes']=_[_0xa301('0x2e')](_0x272397[_0xa301('0x2f')],qs[_0xa301('0x30')](_0x2fa881[_0xa301('0x2c')][_0xa301('0x30')]));_0x497fdd[_0xa301('0x31')]=_0x497fdd[_0xa301('0x31')][_0xa301('0x32')]?_0x497fdd[_0xa301('0x31')]:_0x272397[_0xa301('0x2f')];_0x497fdd[_0xa301('0x34')]=qs[_0xa301('0x4a')](_0x2fa881[_0xa301('0x2c')][_0xa301('0x4a')]);_0x497fdd[_0xa301('0x37')]=qs['filters'](_['pick'](_0x2fa881[_0xa301('0x2c')],_0x272397[_0xa301('0x2d')]));if(_0x2fa881[_0xa301('0x2c')][_0xa301('0x36')]){_0x497fdd[_0xa301('0x37')]=_[_0xa301('0x3b')](_0x497fdd[_0xa301('0x37')],{'$or':_['map'](_0x497fdd[_0xa301('0x31')],function(_0x4039a5){var _0x3d7160={};_0x3d7160[_0x4039a5]={'$like':'%'+_0x2fa881[_0xa301('0x2c')][_0xa301('0x36')]+'%'};return _0x3d7160;})});}_0x497fdd=_[_0xa301('0x3b')]({},_0x497fdd,_0x2fa881['options']);return _0x2cb92b['getSubjects'](_0x497fdd);}})[_0xa301('0x22')](function(_0x2dc2b8){if(_0x2dc2b8){_0x31d609=_0x2dc2b8[_0xa301('0x32')];if(!_0x2fa881[_0xa301('0x2c')][_0xa301('0x33')](_0xa301('0x4b'))){_0x497fdd[_0xa301('0x1c')]=qs[_0xa301('0x1c')](_0x2fa881[_0xa301('0x2c')][_0xa301('0x1c')]);_0x497fdd[_0xa301('0x1a')]=qs['offset'](_0x2fa881['query']['offset']);}return _0x2cb92b['getSubjects'](_0x497fdd);}})[_0xa301('0x22')](function(_0x18768a){if(_0x18768a){return _0x18768a?{'count':_0x31d609,'rows':_0x18768a}:null;}})[_0xa301('0x22')](respondWithResult(_0x2f3610,null))[_0xa301('0x42')](handleError(_0x2f3610,null));};exports[_0xa301('0x4c')]=function(_0x4fabac,_0x5e400f,_0x4848c0){var _0x37a520={};var _0x12af29={};var _0x453aff;var _0x324f57;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x4fabac[_0xa301('0x44')]['id']}})[_0xa301('0x22')](handleEntityNotFound(_0x5e400f,null))[_0xa301('0x22')](function(_0x501b29){if(_0x501b29){_0x453aff=_0x501b29;_0x12af29[_0xa301('0x2f')]=_[_0xa301('0x2b')](db[_0xa301('0x49')][_0xa301('0x28')]);_0x12af29[_0xa301('0x2c')]=_['keys'](_0x4fabac[_0xa301('0x2c')]);_0x12af29[_0xa301('0x2d')]=_[_0xa301('0x2e')](_0x12af29[_0xa301('0x2f')],_0x12af29[_0xa301('0x2c')]);_0x37a520[_0xa301('0x31')]=_[_0xa301('0x2e')](_0x12af29[_0xa301('0x2f')],qs[_0xa301('0x30')](_0x4fabac[_0xa301('0x2c')][_0xa301('0x30')]));_0x37a520[_0xa301('0x31')]=_0x37a520['attributes']['length']?_0x37a520[_0xa301('0x31')]:_0x12af29[_0xa301('0x2f')];_0x37a520[_0xa301('0x34')]=qs[_0xa301('0x4a')](_0x4fabac[_0xa301('0x2c')][_0xa301('0x4a')]);_0x37a520[_0xa301('0x37')]=qs[_0xa301('0x2d')](_[_0xa301('0x35')](_0x4fabac[_0xa301('0x2c')],_0x12af29[_0xa301('0x2d')]));if(_0x4fabac[_0xa301('0x2c')]['filter']){_0x37a520['where']=_[_0xa301('0x3b')](_0x37a520['where'],{'$or':_[_0xa301('0x38')](_0x37a520[_0xa301('0x31')],function(_0x1fdb11){var _0x409135={};_0x409135[_0x1fdb11]={'$like':'%'+_0x4fabac[_0xa301('0x2c')][_0xa301('0x36')]+'%'};return _0x409135;})});}_0x37a520=_[_0xa301('0x3b')]({},_0x37a520,_0x4fabac[_0xa301('0x3c')]);return _0x453aff[_0xa301('0x4c')](_0x37a520);}})[_0xa301('0x22')](function(_0x27261b){if(_0x27261b){_0x324f57=_0x27261b[_0xa301('0x32')];if(!_0x4fabac[_0xa301('0x2c')][_0xa301('0x33')](_0xa301('0x4b'))){_0x37a520[_0xa301('0x1c')]=qs[_0xa301('0x1c')](_0x4fabac['query'][_0xa301('0x1c')]);_0x37a520[_0xa301('0x1a')]=qs[_0xa301('0x1a')](_0x4fabac[_0xa301('0x2c')]['offset']);}return _0x453aff[_0xa301('0x4c')](_0x37a520);}})[_0xa301('0x22')](function(_0x8903aa){if(_0x8903aa){return _0x8903aa?{'count':_0x324f57,'rows':_0x8903aa}:null;}})[_0xa301('0x22')](respondWithResult(_0x5e400f,null))[_0xa301('0x42')](handleError(_0x5e400f,null));};exports['getFields']=function(_0x268e2f,_0x3a039c,_0x590dc8){var _0x2c33cc={};var _0x1dfffc={};var _0x590519;var _0x467a94;return db[_0xa301('0x3d')]['findOne']({'where':{'id':_0x268e2f[_0xa301('0x44')]['id']}})[_0xa301('0x22')](handleEntityNotFound(_0x3a039c,null))[_0xa301('0x22')](function(_0x420be2){if(_0x420be2){_0x590519=_0x420be2;_0x1dfffc[_0xa301('0x2f')]=_[_0xa301('0x2b')](db[_0xa301('0x49')][_0xa301('0x28')]);_0x1dfffc['query']=_[_0xa301('0x2b')](_0x268e2f['query']);_0x1dfffc['filters']=_['intersection'](_0x1dfffc['model'],_0x1dfffc[_0xa301('0x2c')]);_0x2c33cc[_0xa301('0x31')]=_[_0xa301('0x2e')](_0x1dfffc[_0xa301('0x2f')],qs[_0xa301('0x30')](_0x268e2f[_0xa301('0x2c')][_0xa301('0x30')]));_0x2c33cc[_0xa301('0x31')]=_0x2c33cc['attributes'][_0xa301('0x32')]?_0x2c33cc[_0xa301('0x31')]:_0x1dfffc[_0xa301('0x2f')];_0x2c33cc[_0xa301('0x34')]=qs[_0xa301('0x4a')](_0x268e2f[_0xa301('0x2c')][_0xa301('0x4a')]);_0x2c33cc[_0xa301('0x37')]=qs['filters'](_[_0xa301('0x35')](_0x268e2f[_0xa301('0x2c')],_0x1dfffc['filters']));if(_0x268e2f[_0xa301('0x2c')][_0xa301('0x36')]){_0x2c33cc[_0xa301('0x37')]=_[_0xa301('0x3b')](_0x2c33cc[_0xa301('0x37')],{'$or':_[_0xa301('0x38')](_0x2c33cc[_0xa301('0x31')],function(_0x288403){var _0x4ee4e6={};_0x4ee4e6[_0x288403]={'$like':'%'+_0x268e2f[_0xa301('0x2c')][_0xa301('0x36')]+'%'};return _0x4ee4e6;})});}_0x2c33cc=_['merge']({},_0x2c33cc,_0x268e2f[_0xa301('0x3c')]);return _0x590519[_0xa301('0x4d')](_0x2c33cc);}})['then'](function(_0x904b3f){if(_0x904b3f){_0x467a94=_0x904b3f[_0xa301('0x32')];if(!_0x268e2f['query']['hasOwnProperty'](_0xa301('0x4b'))){_0x2c33cc['limit']=qs['limit'](_0x268e2f[_0xa301('0x2c')][_0xa301('0x1c')]);_0x2c33cc[_0xa301('0x1a')]=qs[_0xa301('0x1a')](_0x268e2f[_0xa301('0x2c')][_0xa301('0x1a')]);}return _0x590519[_0xa301('0x4d')](_0x2c33cc);}})[_0xa301('0x22')](function(_0x44dfba){if(_0x44dfba){return _0x44dfba?{'count':_0x467a94,'rows':_0x44dfba}:null;}})[_0xa301('0x22')](respondWithResult(_0x3a039c,null))[_0xa301('0x42')](handleError(_0x3a039c,null));};
\ No newline at end of file
index 1f567cf..e8c5c6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbd4=['exports','define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesConfiguration.attributes'];(function(_0x5015f3,_0x3e56fc){var _0x55641a=function(_0x1360e3){while(--_0x1360e3){_0x5015f3['push'](_0x5015f3['shift']());}};_0x55641a(++_0x3e56fc);}(_0xcbd4,0xb7));var _0x4cbd=function(_0x52e1c5,_0x1ff68a){_0x52e1c5=_0x52e1c5-0x0;var _0xd3785e=_0xcbd4[_0x52e1c5];return _0xd3785e;};'use strict';var _=require(_0x4cbd('0x0'));var util=require(_0x4cbd('0x1'));var logger=require(_0x4cbd('0x2'))(_0x4cbd('0x3'));var moment=require(_0x4cbd('0x4'));var BPromise=require(_0x4cbd('0x5'));var rp=require(_0x4cbd('0x6'));var fs=require('fs');var path=require(_0x4cbd('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4cbd('0x8'));module[_0x4cbd('0x9')]=function(_0x11910a,_0xd58d1){return _0x11910a[_0x4cbd('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0x4cbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc6f=['request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc6f,0xc5));var _0xffc6=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xfc6f[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0xffc6('0x0'));var util=require('util');var logger=require(_0xffc6('0x1'))(_0xffc6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xffc6('0x3'));var fs=require('fs');var path=require(_0xffc6('0x4'));var rimraf=require('rimraf');var config=require(_0xffc6('0x5'));var attributes=require(_0xffc6('0x6'));module[_0xffc6('0x7')]=function(_0x4f04bc,_0x5b2c47){return _0x4f04bc[_0xffc6('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0xffc6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8c7cb18..5e60166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5d1=['request\x20sent','debug','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x4fbd62,_0x283fb0){var _0x1dc8d2=function(_0x25fef5){while(--_0x25fef5){_0x4fbd62['push'](_0x4fbd62['shift']());}};_0x1dc8d2(++_0x283fb0);}(_0xd5d1,0x1d7));var _0x1d5d=function(_0x5743b6,_0x363480){_0x5743b6=_0x5743b6-0x0;var _0x2420fb=_0xd5d1[_0x5743b6];return _0x2420fb;};'use strict';var _=require(_0x1d5d('0x0'));var util=require('util');var moment=require(_0x1d5d('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d5d('0x2'));var fs=require('fs');var Redis=require(_0x1d5d('0x3'));var db=require(_0x1d5d('0x4'))['db'];var utils=require(_0x1d5d('0x5'));var logger=require('../../config/logger')(_0x1d5d('0x6'));var config=require(_0x1d5d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1d5d('0x8')][_0x1d5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c37bd,_0x4e5f66,_0xb54777){return new BPromise(function(_0x412a8f,_0x40b2e9){return client[_0x1d5d('0xa')](_0x4c37bd,_0xb54777)[_0x1d5d('0xb')](function(_0x25d724){logger[_0x1d5d('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4e5f66,_0x1d5d('0xd'));logger[_0x1d5d('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x4e5f66,_0x1d5d('0xd'),JSON[_0x1d5d('0xf')](_0x25d724));if(_0x25d724['error']){if(_0x25d724[_0x1d5d('0x10')][_0x1d5d('0x11')]===0x1f4){logger[_0x1d5d('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4e5f66,_0x25d724[_0x1d5d('0x10')][_0x1d5d('0x12')]);return _0x40b2e9(_0x25d724['error'][_0x1d5d('0x12')]);}logger['error'](_0x1d5d('0x13'),_0x4e5f66,_0x25d724['error'][_0x1d5d('0x12')]);return _0x412a8f(_0x25d724[_0x1d5d('0x10')][_0x1d5d('0x12')]);}else{logger[_0x1d5d('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4e5f66,_0x1d5d('0xd'));_0x412a8f(_0x25d724[_0x1d5d('0x14')]['message']);}})[_0x1d5d('0x15')](function(_0x262d38){logger[_0x1d5d('0x10')](_0x1d5d('0x13'),_0x4e5f66,_0x262d38);_0x40b2e9(_0x262d38);});});}
\ No newline at end of file
+var _0xebff=['info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xebff,0xc2));var _0xfebf=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xebff[_0x411017];return _0x2adeea;};'use strict';var _=require(_0xfebf('0x0'));var util=require(_0xfebf('0x1'));var moment=require(_0xfebf('0x2'));var BPromise=require(_0xfebf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfebf('0x4'));var db=require(_0xfebf('0x5'))['db'];var utils=require(_0xfebf('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfebf('0x7'));var jayson=require(_0xfebf('0x8'));var client=jayson[_0xfebf('0x9')][_0xfebf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c91e6,_0x418709,_0x2c525b){return new BPromise(function(_0x2616ca,_0x542b90){return client[_0xfebf('0xb')](_0x2c91e6,_0x2c525b)[_0xfebf('0xc')](function(_0x181624){logger[_0xfebf('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x418709,_0xfebf('0xe'));logger[_0xfebf('0xf')](_0xfebf('0x10'),_0x418709,_0xfebf('0xe'),JSON[_0xfebf('0x11')](_0x181624));if(_0x181624[_0xfebf('0x12')]){if(_0x181624[_0xfebf('0x12')][_0xfebf('0x13')]===0x1f4){logger['error'](_0xfebf('0x14'),_0x418709,_0x181624['error'][_0xfebf('0x15')]);return _0x542b90(_0x181624[_0xfebf('0x12')][_0xfebf('0x15')]);}logger[_0xfebf('0x12')](_0xfebf('0x14'),_0x418709,_0x181624[_0xfebf('0x12')][_0xfebf('0x15')]);return _0x2616ca(_0x181624['error']['message']);}else{logger[_0xfebf('0xd')](_0xfebf('0x14'),_0x418709,_0xfebf('0xe'));_0x2616ca(_0x181624[_0xfebf('0x16')][_0xfebf('0x15')]);}})['catch'](function(_0x27bfb1){logger['error'](_0xfebf('0x14'),_0x418709,_0x27bfb1);_0x542b90(_0x27bfb1);});});}
\ No newline at end of file
index f2c7a4a..6717bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2333=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','express'];(function(_0x4525c8,_0x3b2ab0){var _0x493a5a=function(_0x30b1d4){while(--_0x30b1d4){_0x4525c8['push'](_0x4525c8['shift']());}};_0x493a5a(++_0x3b2ab0);}(_0x2333,0x11a));var _0x3233=function(_0x1fb4e1,_0x1d941c){_0x1fb4e1=_0x1fb4e1-0x0;var _0x57cbdb=_0x2333[_0x1fb4e1];return _0x57cbdb;};'use strict';var multer=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3233('0x2'));var router=express[_0x3233('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3233('0x4'));var interaction=require(_0x3233('0x5'));var config=require(_0x3233('0x6'));var controller=require(_0x3233('0x7'));router[_0x3233('0x8')]('/',auth[_0x3233('0x9')](),controller[_0x3233('0xa')]);router[_0x3233('0x8')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller[_0x3233('0xc')]);router[_0x3233('0xd')]('/',auth[_0x3233('0x9')](),controller[_0x3233('0xe')]);router[_0x3233('0xf')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller[_0x3233('0x10')]);router[_0x3233('0x11')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller['destroy']);module[_0x3233('0x12')]=router;
\ No newline at end of file
+var _0x524a=['create','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','show'];(function(_0x52ea78,_0x4f7aad){var _0x1c855d=function(_0xf29a63){while(--_0xf29a63){_0x52ea78['push'](_0x52ea78['shift']());}};_0x1c855d(++_0x4f7aad);}(_0x524a,0xf5));var _0xa524=function(_0x2c3c52,_0x32e30a){_0x2c3c52=_0x2c3c52-0x0;var _0x8c445d=_0x524a[_0x2c3c52];return _0x8c445d;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xa')]);router['post']('/',auth[_0xa524('0x9')](),controller[_0xa524('0xb')]);router[_0xa524('0xc')](_0xa524('0xd'),auth[_0xa524('0x9')](),controller['update']);router[_0xa524('0xe')](_0xa524('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xa524('0xf')]=router;
\ No newline at end of file
index 3d8c6f6..98240eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd04=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x2a0752,_0x59859e){var _0x1985c8=function(_0x41775f){while(--_0x41775f){_0x2a0752['push'](_0x2a0752['shift']());}};_0x1985c8(++_0x59859e);}(_0xcd04,0x169));var _0x4cd0=function(_0x47267a,_0x3e8474){_0x47267a=_0x47267a-0x0;var _0x52d044=_0xcd04[_0x47267a];return _0x52d044;};'use strict';var Sequelize=require(_0x4cd0('0x0'));module[_0x4cd0('0x1')]={'type':{'type':Sequelize[_0x4cd0('0x2')](_0x4cd0('0x3'),_0x4cd0('0x4'),_0x4cd0('0x5'),'keyValue',_0x4cd0('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4cd0('0x7')]},'key':{'type':Sequelize[_0x4cd0('0x7')]},'keyType':{'type':Sequelize[_0x4cd0('0x2')](_0x4cd0('0x3'),_0x4cd0('0x4'),_0x4cd0('0x5'))},'keyContent':{'type':Sequelize[_0x4cd0('0x7')]},'idField':{'type':Sequelize[_0x4cd0('0x7')]},'nameField':{'type':Sequelize[_0x4cd0('0x7')]},'customField':{'type':Sequelize[_0x4cd0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4cd0('0x7')]}};
\ No newline at end of file
+var _0x622f=['variable','customVariable','keyValue','picklist','STRING','sequelize','ENUM','string'];(function(_0x224ad9,_0x5d97a7){var _0x532997=function(_0x323951){while(--_0x323951){_0x224ad9['push'](_0x224ad9['shift']());}};_0x532997(++_0x5d97a7);}(_0x622f,0x195));var _0xf622=function(_0x4c2055,_0x29fbeb){_0x4c2055=_0x4c2055-0x0;var _0x3b76e6=_0x622f[_0x4c2055];return _0x3b76e6;};'use strict';var Sequelize=require(_0xf622('0x0'));module['exports']={'type':{'type':Sequelize[_0xf622('0x1')](_0xf622('0x2'),_0xf622('0x3'),_0xf622('0x4'),_0xf622('0x5'),_0xf622('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf622('0x7')]},'key':{'type':Sequelize[_0xf622('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xf622('0x2'),_0xf622('0x3'),_0xf622('0x4'))},'keyContent':{'type':Sequelize[_0xf622('0x7')]},'idField':{'type':Sequelize[_0xf622('0x7')]},'nameField':{'type':Sequelize[_0xf622('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cd09398..8bdbd40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b4d=['filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','json','save','update','then','destroy','error','name','send','map','FreshsalesField','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4ffd66,_0x48f006){var _0x2f1e7a=function(_0x3f2357){while(--_0x3f2357){_0x4ffd66['push'](_0x4ffd66['shift']());}};_0x2f1e7a(++_0x48f006);}(_0x4b4d,0x12e));var _0xd4b4=function(_0x2b5b86,_0x8352f4){_0x2b5b86=_0x2b5b86-0x0;var _0x291e8e=_0x4b4d[_0x2b5b86];return _0x291e8e;};'use strict';var emlformat=require(_0xd4b4('0x0'));var rimraf=require(_0xd4b4('0x1'));var zipdir=require(_0xd4b4('0x2'));var jsonpatch=require(_0xd4b4('0x3'));var rp=require(_0xd4b4('0x4'));var moment=require(_0xd4b4('0x5'));var BPromise=require(_0xd4b4('0x6'));var Mustache=require(_0xd4b4('0x7'));var util=require(_0xd4b4('0x8'));var path=require(_0xd4b4('0x9'));var sox=require(_0xd4b4('0xa'));var csv=require('to-csv');var ejs=require(_0xd4b4('0xb'));var fs=require('fs');var fs_extra=require(_0xd4b4('0xc'));var _=require('lodash');var squel=require(_0xd4b4('0xd'));var crypto=require(_0xd4b4('0xe'));var jsforce=require(_0xd4b4('0xf'));var deskjs=require(_0xd4b4('0x10'));var toCsv=require(_0xd4b4('0x11'));var querystring=require('querystring');var Papa=require(_0xd4b4('0x12'));var Redis=require(_0xd4b4('0x13'));var authService=require(_0xd4b4('0x14'));var qs=require(_0xd4b4('0x15'));var as=require(_0xd4b4('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd4b4('0x17'));var utils=require(_0xd4b4('0x18'));var config=require(_0xd4b4('0x19'));var licenseUtil=require(_0xd4b4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ebfed,_0xc78b1d){_0xc78b1d=_0xc78b1d||0xcc;return function(_0x4d88e1){if(_0x4d88e1){return _0x2ebfed[_0xd4b4('0x1b')](_0xc78b1d);}return _0x2ebfed[_0xd4b4('0x1c')](_0xc78b1d)[_0xd4b4('0x1d')]();};}function respondWithResult(_0x5b44c2,_0x2a7fdb){_0x2a7fdb=_0x2a7fdb||0xc8;return function(_0x1baba9){if(_0x1baba9){return _0x5b44c2['status'](_0x2a7fdb)['json'](_0x1baba9);}};}function respondWithFilteredResult(_0x11b97f,_0x4d3f72){return function(_0x566ec7){if(_0x566ec7){var _0x26572c=typeof _0x4d3f72[_0xd4b4('0x1e')]===_0xd4b4('0x1f')&&typeof _0x4d3f72[_0xd4b4('0x20')]===_0xd4b4('0x1f');var _0x32b1b2=_0x566ec7[_0xd4b4('0x21')];var _0x38a72a=_0x26572c?0x0:_0x4d3f72[_0xd4b4('0x1e')];var _0x22b275=_0x26572c?_0x566ec7[_0xd4b4('0x21')]:_0x4d3f72[_0xd4b4('0x1e')]+_0x4d3f72['limit'];var _0x3d56eb;if(_0x22b275>=_0x32b1b2){_0x22b275=_0x32b1b2;_0x3d56eb=0xc8;}else{_0x3d56eb=0xce;}_0x11b97f[_0xd4b4('0x1c')](_0x3d56eb);return _0x11b97f['set']('Content-Range',_0x38a72a+'-'+_0x22b275+'/'+_0x32b1b2)[_0xd4b4('0x22')](_0x566ec7);}return null;};}function patchUpdates(_0x85c57e){return function(_0x4a183a){try{jsonpatch['apply'](_0x4a183a,_0x85c57e,!![]);}catch(_0x17a367){return BPromise['reject'](_0x17a367);}return _0x4a183a[_0xd4b4('0x23')]();};}function saveUpdates(_0x3c9fc7,_0x39a081){return function(_0x2608aa){if(_0x2608aa){return _0x2608aa[_0xd4b4('0x24')](_0x3c9fc7)[_0xd4b4('0x25')](function(_0x2aeb5d){return _0x2aeb5d;});}return null;};}function removeEntity(_0xf53d77,_0x2a761f){return function(_0x330bd1){if(_0x330bd1){return _0x330bd1[_0xd4b4('0x26')]()[_0xd4b4('0x25')](function(){_0xf53d77[_0xd4b4('0x1c')](0xcc)[_0xd4b4('0x1d')]();});}};}function handleEntityNotFound(_0x2867b2,_0x23094a){return function(_0x53532a){if(!_0x53532a){_0x2867b2[_0xd4b4('0x1b')](0x194);}return _0x53532a;};}function handleError(_0x56f352,_0xfff50f){_0xfff50f=_0xfff50f||0x1f4;return function(_0x29e6fb){logger[_0xd4b4('0x27')](_0x29e6fb['stack']);if(_0x29e6fb[_0xd4b4('0x28')]){delete _0x29e6fb[_0xd4b4('0x28')];}_0x56f352['status'](_0xfff50f)[_0xd4b4('0x29')](_0x29e6fb);};}exports['index']=function(_0x5e13c1,_0xe694d0){var _0x36cd52={},_0x875a75={},_0x14b33f={'count':0x0,'rows':[]};var _0x522bd9=_[_0xd4b4('0x2a')](db[_0xd4b4('0x2b')][_0xd4b4('0x2c')],function(_0x120839){return{'name':_0x120839['fieldName'],'type':_0x120839[_0xd4b4('0x2d')][_0xd4b4('0x2e')]};});_0x875a75[_0xd4b4('0x2f')]=_['map'](_0x522bd9,'name');_0x875a75[_0xd4b4('0x30')]=_['keys'](_0x5e13c1[_0xd4b4('0x30')]);_0x875a75[_0xd4b4('0x31')]=_['intersection'](_0x875a75[_0xd4b4('0x2f')],_0x875a75['query']);_0x36cd52[_0xd4b4('0x32')]=_['intersection'](_0x875a75[_0xd4b4('0x2f')],qs[_0xd4b4('0x33')](_0x5e13c1['query'][_0xd4b4('0x33')]));_0x36cd52[_0xd4b4('0x32')]=_0x36cd52[_0xd4b4('0x32')][_0xd4b4('0x34')]?_0x36cd52[_0xd4b4('0x32')]:_0x875a75[_0xd4b4('0x2f')];if(!_0x5e13c1[_0xd4b4('0x30')][_0xd4b4('0x35')](_0xd4b4('0x36'))){_0x36cd52[_0xd4b4('0x20')]=qs['limit'](_0x5e13c1[_0xd4b4('0x30')][_0xd4b4('0x20')]);_0x36cd52[_0xd4b4('0x1e')]=qs[_0xd4b4('0x1e')](_0x5e13c1[_0xd4b4('0x30')][_0xd4b4('0x1e')]);}_0x36cd52['order']=qs[_0xd4b4('0x37')](_0x5e13c1['query'][_0xd4b4('0x37')]);_0x36cd52[_0xd4b4('0x38')]=qs[_0xd4b4('0x31')](_[_0xd4b4('0x39')](_0x5e13c1[_0xd4b4('0x30')],_0x875a75[_0xd4b4('0x31')]),_0x522bd9);if(_0x5e13c1[_0xd4b4('0x30')][_0xd4b4('0x3a')]){_0x36cd52[_0xd4b4('0x38')]=_[_0xd4b4('0x3b')](_0x36cd52[_0xd4b4('0x38')],{'$or':_[_0xd4b4('0x2a')](_0x522bd9,function(_0x110fd1){if(_0x110fd1[_0xd4b4('0x2d')]!==_0xd4b4('0x3c')){var _0x5c0172={};_0x5c0172[_0x110fd1[_0xd4b4('0x28')]]={'$like':'%'+_0x5e13c1['query'][_0xd4b4('0x3a')]+'%'};return _0x5c0172;}})});}_0x36cd52=_[_0xd4b4('0x3b')]({},_0x36cd52,_0x5e13c1[_0xd4b4('0x3d')]);var _0x174bed={'where':_0x36cd52[_0xd4b4('0x38')]};return db[_0xd4b4('0x2b')]['count'](_0x174bed)[_0xd4b4('0x25')](function(_0x1d8435){_0x14b33f[_0xd4b4('0x21')]=_0x1d8435;if(_0x5e13c1[_0xd4b4('0x30')][_0xd4b4('0x3e')]){_0x36cd52['include']=[{'all':!![]}];}return db[_0xd4b4('0x2b')][_0xd4b4('0x3f')](_0x36cd52);})['then'](function(_0x47ae46){_0x14b33f[_0xd4b4('0x40')]=_0x47ae46;return _0x14b33f;})[_0xd4b4('0x25')](respondWithFilteredResult(_0xe694d0,_0x36cd52))['catch'](handleError(_0xe694d0,null));};exports[_0xd4b4('0x41')]=function(_0x3390bc,_0x48c5eb){var _0x1e893a={'raw':!![],'where':{'id':_0x3390bc[_0xd4b4('0x42')]['id']}},_0xe13d11={};_0xe13d11['model']=_['keys'](db[_0xd4b4('0x2b')]['rawAttributes']);_0xe13d11[_0xd4b4('0x30')]=_['keys'](_0x3390bc[_0xd4b4('0x30')]);_0xe13d11['filters']=_[_0xd4b4('0x43')](_0xe13d11[_0xd4b4('0x2f')],_0xe13d11[_0xd4b4('0x30')]);_0x1e893a[_0xd4b4('0x32')]=_[_0xd4b4('0x43')](_0xe13d11[_0xd4b4('0x2f')],qs[_0xd4b4('0x33')](_0x3390bc['query'][_0xd4b4('0x33')]));_0x1e893a[_0xd4b4('0x32')]=_0x1e893a['attributes']['length']?_0x1e893a[_0xd4b4('0x32')]:_0xe13d11[_0xd4b4('0x2f')];if(_0x3390bc['query']['includeAll']){_0x1e893a['include']=[{'all':!![]}];}_0x1e893a=_[_0xd4b4('0x3b')]({},_0x1e893a,_0x3390bc['options']);return db[_0xd4b4('0x2b')][_0xd4b4('0x44')](_0x1e893a)[_0xd4b4('0x25')](handleEntityNotFound(_0x48c5eb,null))[_0xd4b4('0x25')](respondWithResult(_0x48c5eb,null))[_0xd4b4('0x45')](handleError(_0x48c5eb,null));};exports[_0xd4b4('0x46')]=function(_0x2704ea,_0x1427ab){return db[_0xd4b4('0x2b')]['create'](_0x2704ea[_0xd4b4('0x47')],{})[_0xd4b4('0x25')](respondWithResult(_0x1427ab,0xc9))[_0xd4b4('0x45')](handleError(_0x1427ab,null));};exports[_0xd4b4('0x24')]=function(_0x9294ea,_0x3c2897){if(_0x9294ea[_0xd4b4('0x47')]['id']){delete _0x9294ea[_0xd4b4('0x47')]['id'];}return db[_0xd4b4('0x2b')]['find']({'where':{'id':_0x9294ea[_0xd4b4('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c2897,null))[_0xd4b4('0x25')](saveUpdates(_0x9294ea[_0xd4b4('0x47')],null))[_0xd4b4('0x25')](respondWithResult(_0x3c2897,null))[_0xd4b4('0x45')](handleError(_0x3c2897,null));};exports['destroy']=function(_0x165b66,_0x29ef9d){return db[_0xd4b4('0x2b')][_0xd4b4('0x44')]({'where':{'id':_0x165b66[_0xd4b4('0x42')]['id']}})[_0xd4b4('0x25')](handleEntityNotFound(_0x29ef9d,null))[_0xd4b4('0x25')](removeEntity(_0x29ef9d,null))[_0xd4b4('0x45')](handleError(_0x29ef9d,null));};
\ No newline at end of file
+var _0xae2d=['reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply'];(function(_0x1b5d3f,_0x3d2c38){var _0x22b95b=function(_0x1d4ab0){while(--_0x1d4ab0){_0x1b5d3f['push'](_0x1b5d3f['shift']());}};_0x22b95b(++_0x3d2c38);}(_0xae2d,0x7a));var _0xdae2=function(_0x4d05a0,_0x53aa7e){_0x4d05a0=_0x4d05a0-0x0;var _0x4c999c=_0xae2d[_0x4d05a0];return _0x4c999c;};'use strict';var emlformat=require(_0xdae2('0x0'));var rimraf=require(_0xdae2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdae2('0x2'));var rp=require('request-promise');var moment=require(_0xdae2('0x3'));var BPromise=require(_0xdae2('0x4'));var Mustache=require(_0xdae2('0x5'));var util=require(_0xdae2('0x6'));var path=require(_0xdae2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdae2('0x8'));var fs=require('fs');var fs_extra=require(_0xdae2('0x9'));var _=require(_0xdae2('0xa'));var squel=require(_0xdae2('0xb'));var crypto=require(_0xdae2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdae2('0xd'));var toCsv=require(_0xdae2('0xe'));var querystring=require(_0xdae2('0xf'));var Papa=require(_0xdae2('0x10'));var Redis=require('ioredis');var authService=require(_0xdae2('0x11'));var qs=require(_0xdae2('0x12'));var as=require(_0xdae2('0x13'));var hardwareService=require(_0xdae2('0x14'));var logger=require(_0xdae2('0x15'))(_0xdae2('0x16'));var utils=require(_0xdae2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdae2('0x18'));var db=require(_0xdae2('0x19'))['db'];function respondWithStatusCode(_0x4f3a2c,_0x2fa950){_0x2fa950=_0x2fa950||0xcc;return function(_0x585209){if(_0x585209){return _0x4f3a2c[_0xdae2('0x1a')](_0x2fa950);}return _0x4f3a2c['status'](_0x2fa950)[_0xdae2('0x1b')]();};}function respondWithResult(_0x255bff,_0xe9dcbb){_0xe9dcbb=_0xe9dcbb||0xc8;return function(_0x3ec442){if(_0x3ec442){return _0x255bff[_0xdae2('0x1c')](_0xe9dcbb)[_0xdae2('0x1d')](_0x3ec442);}};}function respondWithFilteredResult(_0x4d8f85,_0x271c50){return function(_0x4d070e){if(_0x4d070e){var _0x4cc025=typeof _0x271c50[_0xdae2('0x1e')]===_0xdae2('0x1f')&&typeof _0x271c50['limit']===_0xdae2('0x1f');var _0x3c1d20=_0x4d070e['count'];var _0x27c256=_0x4cc025?0x0:_0x271c50[_0xdae2('0x1e')];var _0x4b7744=_0x4cc025?_0x4d070e['count']:_0x271c50[_0xdae2('0x1e')]+_0x271c50[_0xdae2('0x20')];var _0x2a6ccf;if(_0x4b7744>=_0x3c1d20){_0x4b7744=_0x3c1d20;_0x2a6ccf=0xc8;}else{_0x2a6ccf=0xce;}_0x4d8f85['status'](_0x2a6ccf);return _0x4d8f85[_0xdae2('0x21')](_0xdae2('0x22'),_0x27c256+'-'+_0x4b7744+'/'+_0x3c1d20)['json'](_0x4d070e);}return null;};}function patchUpdates(_0x3061dc){return function(_0x4fdfd6){try{jsonpatch[_0xdae2('0x23')](_0x4fdfd6,_0x3061dc,!![]);}catch(_0xc8f9db){return BPromise[_0xdae2('0x24')](_0xc8f9db);}return _0x4fdfd6[_0xdae2('0x25')]();};}function saveUpdates(_0x902f88,_0x54adbf){return function(_0x2bac28){if(_0x2bac28){return _0x2bac28[_0xdae2('0x26')](_0x902f88)[_0xdae2('0x27')](function(_0x35dbac){return _0x35dbac;});}return null;};}function removeEntity(_0x3ac525,_0x4fc1f1){return function(_0x8149b9){if(_0x8149b9){return _0x8149b9[_0xdae2('0x28')]()[_0xdae2('0x27')](function(){_0x3ac525[_0xdae2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa648,_0x43c3df){return function(_0x44116a){if(!_0x44116a){_0x1fa648[_0xdae2('0x1a')](0x194);}return _0x44116a;};}function handleError(_0x518fb0,_0x1e1560){_0x1e1560=_0x1e1560||0x1f4;return function(_0x5b3527){logger['error'](_0x5b3527[_0xdae2('0x29')]);if(_0x5b3527[_0xdae2('0x2a')]){delete _0x5b3527[_0xdae2('0x2a')];}_0x518fb0[_0xdae2('0x1c')](_0x1e1560)[_0xdae2('0x2b')](_0x5b3527);};}exports[_0xdae2('0x2c')]=function(_0x3f3d96,_0x1ac5bd){var _0x826235={},_0x191e4d={},_0x5043d2={'count':0x0,'rows':[]};var _0x592cae=_[_0xdae2('0x2d')](db[_0xdae2('0x2e')][_0xdae2('0x2f')],function(_0x2fa191){return{'name':_0x2fa191[_0xdae2('0x30')],'type':_0x2fa191[_0xdae2('0x31')][_0xdae2('0x32')]};});_0x191e4d[_0xdae2('0x33')]=_[_0xdae2('0x2d')](_0x592cae,_0xdae2('0x2a'));_0x191e4d[_0xdae2('0x34')]=_[_0xdae2('0x35')](_0x3f3d96[_0xdae2('0x34')]);_0x191e4d[_0xdae2('0x36')]=_[_0xdae2('0x37')](_0x191e4d['model'],_0x191e4d[_0xdae2('0x34')]);_0x826235[_0xdae2('0x38')]=_[_0xdae2('0x37')](_0x191e4d[_0xdae2('0x33')],qs[_0xdae2('0x39')](_0x3f3d96[_0xdae2('0x34')][_0xdae2('0x39')]));_0x826235[_0xdae2('0x38')]=_0x826235[_0xdae2('0x38')][_0xdae2('0x3a')]?_0x826235[_0xdae2('0x38')]:_0x191e4d[_0xdae2('0x33')];if(!_0x3f3d96[_0xdae2('0x34')][_0xdae2('0x3b')](_0xdae2('0x3c'))){_0x826235[_0xdae2('0x20')]=qs['limit'](_0x3f3d96[_0xdae2('0x34')]['limit']);_0x826235[_0xdae2('0x1e')]=qs[_0xdae2('0x1e')](_0x3f3d96[_0xdae2('0x34')]['offset']);}_0x826235['order']=qs[_0xdae2('0x3d')](_0x3f3d96[_0xdae2('0x34')]['sort']);_0x826235[_0xdae2('0x3e')]=qs['filters'](_[_0xdae2('0x3f')](_0x3f3d96[_0xdae2('0x34')],_0x191e4d[_0xdae2('0x36')]),_0x592cae);if(_0x3f3d96[_0xdae2('0x34')]['filter']){_0x826235[_0xdae2('0x3e')]=_[_0xdae2('0x40')](_0x826235[_0xdae2('0x3e')],{'$or':_[_0xdae2('0x2d')](_0x592cae,function(_0x21f8fd){if(_0x21f8fd['type']!==_0xdae2('0x41')){var _0x332e72={};_0x332e72[_0x21f8fd[_0xdae2('0x2a')]]={'$like':'%'+_0x3f3d96[_0xdae2('0x34')][_0xdae2('0x42')]+'%'};return _0x332e72;}})});}_0x826235=_[_0xdae2('0x40')]({},_0x826235,_0x3f3d96['options']);var _0x4bdd20={'where':_0x826235[_0xdae2('0x3e')]};return db['FreshsalesField'][_0xdae2('0x43')](_0x4bdd20)[_0xdae2('0x27')](function(_0x1feb43){_0x5043d2[_0xdae2('0x43')]=_0x1feb43;if(_0x3f3d96[_0xdae2('0x34')][_0xdae2('0x44')]){_0x826235[_0xdae2('0x45')]=[{'all':!![]}];}return db[_0xdae2('0x2e')][_0xdae2('0x46')](_0x826235);})[_0xdae2('0x27')](function(_0x4dbd0d){_0x5043d2[_0xdae2('0x47')]=_0x4dbd0d;return _0x5043d2;})[_0xdae2('0x27')](respondWithFilteredResult(_0x1ac5bd,_0x826235))['catch'](handleError(_0x1ac5bd,null));};exports[_0xdae2('0x48')]=function(_0x2e122e,_0x4b7d15){var _0x4be18b={'raw':!![],'where':{'id':_0x2e122e[_0xdae2('0x49')]['id']}},_0x1a3fda={};_0x1a3fda['model']=_['keys'](db[_0xdae2('0x2e')][_0xdae2('0x2f')]);_0x1a3fda[_0xdae2('0x34')]=_[_0xdae2('0x35')](_0x2e122e[_0xdae2('0x34')]);_0x1a3fda[_0xdae2('0x36')]=_[_0xdae2('0x37')](_0x1a3fda[_0xdae2('0x33')],_0x1a3fda[_0xdae2('0x34')]);_0x4be18b[_0xdae2('0x38')]=_[_0xdae2('0x37')](_0x1a3fda['model'],qs[_0xdae2('0x39')](_0x2e122e['query'][_0xdae2('0x39')]));_0x4be18b[_0xdae2('0x38')]=_0x4be18b['attributes'][_0xdae2('0x3a')]?_0x4be18b[_0xdae2('0x38')]:_0x1a3fda[_0xdae2('0x33')];if(_0x2e122e[_0xdae2('0x34')][_0xdae2('0x44')]){_0x4be18b['include']=[{'all':!![]}];}_0x4be18b=_['merge']({},_0x4be18b,_0x2e122e[_0xdae2('0x4a')]);return db[_0xdae2('0x2e')]['find'](_0x4be18b)['then'](handleEntityNotFound(_0x4b7d15,null))['then'](respondWithResult(_0x4b7d15,null))[_0xdae2('0x4b')](handleError(_0x4b7d15,null));};exports[_0xdae2('0x4c')]=function(_0x36c8bd,_0x131765){return db['FreshsalesField'][_0xdae2('0x4c')](_0x36c8bd[_0xdae2('0x4d')],{})[_0xdae2('0x27')](respondWithResult(_0x131765,0xc9))[_0xdae2('0x4b')](handleError(_0x131765,null));};exports[_0xdae2('0x26')]=function(_0x1ae51b,_0x2d4651){if(_0x1ae51b[_0xdae2('0x4d')]['id']){delete _0x1ae51b['body']['id'];}return db[_0xdae2('0x2e')][_0xdae2('0x4e')]({'where':{'id':_0x1ae51b[_0xdae2('0x49')]['id']}})[_0xdae2('0x27')](handleEntityNotFound(_0x2d4651,null))[_0xdae2('0x27')](saveUpdates(_0x1ae51b[_0xdae2('0x4d')],null))[_0xdae2('0x27')](respondWithResult(_0x2d4651,null))[_0xdae2('0x4b')](handleError(_0x2d4651,null));};exports[_0xdae2('0x28')]=function(_0x4d2b94,_0x2ddc3d){return db['FreshsalesField']['find']({'where':{'id':_0x4d2b94[_0xdae2('0x49')]['id']}})[_0xdae2('0x27')](handleEntityNotFound(_0x2ddc3d,null))[_0xdae2('0x27')](removeEntity(_0x2ddc3d,null))['catch'](handleError(_0x2ddc3d,null));};
\ No newline at end of file
index d7c5238..e0ea251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8a0=['exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','../../config/logger','api','bluebird','./intFreshsalesField.attributes'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x491b21,_0x54d4fc){_0x491b21=_0x491b21-0x0;var _0x4d1d81=_0xb8a0[_0x491b21];return _0x4d1d81;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b8a('0x0'))(_0x0b8a('0x1'));var moment=require('moment');var BPromise=require(_0x0b8a('0x2'));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(_0x0b8a('0x3'));module[_0x0b8a('0x4')]=function(_0x381b17,_0x165710){return _0x381b17[_0x0b8a('0x5')](_0x0b8a('0x6'),attributes,{'tableName':_0x0b8a('0x7'),'paranoid':![],'indexes':[{'name':_0x0b8a('0x8'),'fields':[_0x0b8a('0x9'),_0x0b8a('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4dc=['freshsales_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields'];(function(_0x55894,_0x261874){var _0x4c52c6=function(_0x2cc10f){while(--_0x2cc10f){_0x55894['push'](_0x55894['shift']());}};_0x4c52c6(++_0x261874);}(_0xd4dc,0xff));var _0xcd4d=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xd4dc[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xcd4d('0x0'));var util=require('util');var logger=require(_0xcd4d('0x1'))(_0xcd4d('0x2'));var moment=require(_0xcd4d('0x3'));var BPromise=require(_0xcd4d('0x4'));var rp=require(_0xcd4d('0x5'));var fs=require('fs');var path=require(_0xcd4d('0x6'));var rimraf=require(_0xcd4d('0x7'));var config=require('../../config/environment');var attributes=require(_0xcd4d('0x8'));module['exports']=function(_0x5d70fb,_0x3c5bbd){return _0x5d70fb['define'](_0xcd4d('0x9'),attributes,{'tableName':_0xcd4d('0xa'),'paranoid':![],'indexes':[{'name':_0xcd4d('0xb'),'fields':[_0xcd4d('0xc'),_0xcd4d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 671fbfa..5fcf5f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x44c768,_0x552a5e){var _0x55daf5=function(_0x4958e8){while(--_0x4958e8){_0x44c768['push'](_0x44c768['shift']());}};_0x55daf5(++_0x552a5e);}(_0xf494,0x1c6));var _0x4f49=function(_0x3ae111,_0x207ef5){_0x3ae111=_0x3ae111-0x0;var _0x2beccd=_0xf494[_0x3ae111];return _0x2beccd;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0x2a07=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x24fcf0,_0x4f970d){var _0x1894e0=function(_0x48c656){while(--_0x48c656){_0x24fcf0['push'](_0x24fcf0['shift']());}};_0x1894e0(++_0x4f970d);}(_0x2a07,0x74));var _0x72a0=function(_0x56039b,_0x3de8d8){_0x56039b=_0x56039b-0x0;var _0xc90792=_0x2a07[_0x56039b];return _0xc90792;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});}
\ No newline at end of file
index 78c8fc6..24974ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x94f2e6,_0x4e83fc){var _0x39d1d9=function(_0x4e9717){while(--_0x4e9717){_0x94f2e6['push'](_0x94f2e6['shift']());}};_0x39d1d9(++_0x4e83fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xcd9042,_0x1cf707){var _0x144abb=function(_0x10fe00){while(--_0x10fe00){_0xcd9042['push'](_0xcd9042['shift']());}};_0x144abb(++_0x1cf707);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 6efcaaf..e661c4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe35d=['username','ENUM','integrationTab','sequelize','exports','STRING'];(function(_0xa7d48d,_0x31fd32){var _0x13e03c=function(_0x37521){while(--_0x37521){_0xa7d48d['push'](_0xa7d48d['shift']());}};_0x13e03c(++_0x31fd32);}(_0xe35d,0xd5));var _0xde35=function(_0x2c1c62,_0x15d6b4){_0x2c1c62=_0x2c1c62-0x0;var _0x23dea8=_0xe35d[_0x2c1c62];return _0x23dea8;};'use strict';var Sequelize=require(_0xde35('0x0'));module[_0xde35('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xde35('0x2')],'unique':_0xde35('0x3')},'remoteUri':{'type':Sequelize[_0xde35('0x2')]},'password':{'type':Sequelize[_0xde35('0x2')]},'clientId':{'type':Sequelize[_0xde35('0x2')]},'clientSecret':{'type':Sequelize[_0xde35('0x2')]},'securityToken':{'type':Sequelize[_0xde35('0x2')]},'serverUrl':{'type':Sequelize[_0xde35('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xde35('0x4')](_0xde35('0x5'),'newTab'),'defaultValue':_0xde35('0x5')}};
\ No newline at end of file
+var _0xce14=['ENUM','integrationTab','newTab','exports','STRING'];(function(_0x1ea338,_0x3d1e80){var _0x414a11=function(_0x55257c){while(--_0x55257c){_0x1ea338['push'](_0x1ea338['shift']());}};_0x414a11(++_0x3d1e80);}(_0xce14,0x17f));var _0x4ce1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xce14[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x4ce1('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4ce1('0x1')]},'username':{'type':Sequelize[_0x4ce1('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4ce1('0x1')]},'password':{'type':Sequelize[_0x4ce1('0x1')]},'clientId':{'type':Sequelize[_0x4ce1('0x1')]},'clientSecret':{'type':Sequelize[_0x4ce1('0x1')]},'securityToken':{'type':Sequelize[_0x4ce1('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4ce1('0x2')](_0x4ce1('0x3'),_0x4ce1('0x4')),'defaultValue':_0x4ce1('0x3')}};
\ No newline at end of file
index e548893..a80cc79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0d6=['sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SalesforceAccount','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','options','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','concat','isNil','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','remove','includes','label','custom','picklistValues','value','True','true','False','statusCode','stringify','send','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x2b6701,_0x20939e){var _0x245159=function(_0x5c6717){while(--_0x5c6717){_0x2b6701['push'](_0x2b6701['shift']());}};_0x245159(++_0x20939e);}(_0xf0d6,0xdc));var _0x6f0d=function(_0x314338,_0x170a4e){_0x314338=_0x314338-0x0;var _0x420bec=_0xf0d6[_0x314338];return _0x420bec;};'use strict';var emlformat=require(_0x6f0d('0x0'));var rimraf=require(_0x6f0d('0x1'));var zipdir=require(_0x6f0d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f0d('0x3'));var moment=require(_0x6f0d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6f0d('0x5'));var util=require(_0x6f0d('0x6'));var path=require(_0x6f0d('0x7'));var sox=require(_0x6f0d('0x8'));var csv=require(_0x6f0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f0d('0xa'));var _=require('lodash');var squel=require(_0x6f0d('0xb'));var crypto=require(_0x6f0d('0xc'));var jsforce=require(_0x6f0d('0xd'));var deskjs=require(_0x6f0d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6f0d('0xf'));var Papa=require(_0x6f0d('0x10'));var Redis=require(_0x6f0d('0x11'));var authService=require(_0x6f0d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6f0d('0x13'));var hardwareService=require(_0x6f0d('0x14'));var logger=require('../../config/logger')(_0x6f0d('0x15'));var utils=require(_0x6f0d('0x16'));var config=require(_0x6f0d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xe1b06e,_0x214cc8){_0x214cc8=_0x214cc8||0xcc;return function(_0xefd2fe){if(_0xefd2fe){return _0xe1b06e[_0x6f0d('0x18')](_0x214cc8);}return _0xe1b06e['status'](_0x214cc8)[_0x6f0d('0x19')]();};}function respondWithResult(_0xa6aa84,_0x2d90e2){_0x2d90e2=_0x2d90e2||0xc8;return function(_0x3afe07){if(_0x3afe07){return _0xa6aa84[_0x6f0d('0x1a')](_0x2d90e2)[_0x6f0d('0x1b')](_0x3afe07);}};}function respondWithFilteredResult(_0x5155ef,_0x4abc96){return function(_0x17591f){if(_0x17591f){var _0xf62806=typeof _0x4abc96[_0x6f0d('0x1c')]===_0x6f0d('0x1d')&&typeof _0x4abc96[_0x6f0d('0x1e')]===_0x6f0d('0x1d');var _0x144076=_0x17591f[_0x6f0d('0x1f')];var _0x1e2410=_0xf62806?0x0:_0x4abc96[_0x6f0d('0x1c')];var _0x130c43=_0xf62806?_0x17591f[_0x6f0d('0x1f')]:_0x4abc96[_0x6f0d('0x1c')]+_0x4abc96['limit'];var _0x36fac7;if(_0x130c43>=_0x144076){_0x130c43=_0x144076;_0x36fac7=0xc8;}else{_0x36fac7=0xce;}_0x5155ef[_0x6f0d('0x1a')](_0x36fac7);return _0x5155ef[_0x6f0d('0x20')]('Content-Range',_0x1e2410+'-'+_0x130c43+'/'+_0x144076)[_0x6f0d('0x1b')](_0x17591f);}return null;};}function patchUpdates(_0x1adb6b){return function(_0x3ca7cb){try{jsonpatch[_0x6f0d('0x21')](_0x3ca7cb,_0x1adb6b,!![]);}catch(_0x14ff5f){return BPromise[_0x6f0d('0x22')](_0x14ff5f);}return _0x3ca7cb[_0x6f0d('0x23')]();};}function saveUpdates(_0x5491e9,_0x246c36){return function(_0x363f9b){if(_0x363f9b){return _0x363f9b[_0x6f0d('0x24')](_0x5491e9)['then'](function(_0x498be3){return _0x498be3;});}return null;};}function removeEntity(_0xff5588,_0x5dbf82){return function(_0xaaad68){if(_0xaaad68){return _0xaaad68['destroy']()['then'](function(){_0xff5588[_0x6f0d('0x1a')](0xcc)[_0x6f0d('0x19')]();});}};}function handleEntityNotFound(_0x3497f1,_0x408343){return function(_0x3b4bea){if(!_0x3b4bea){_0x3497f1[_0x6f0d('0x18')](0x194);}return _0x3b4bea;};}function handleError(_0x155a0e,_0x391b46){_0x391b46=_0x391b46||0x1f4;return function(_0x4c6fdc){logger[_0x6f0d('0x25')](_0x4c6fdc[_0x6f0d('0x26')]);if(_0x4c6fdc[_0x6f0d('0x27')]){delete _0x4c6fdc['name'];}_0x155a0e[_0x6f0d('0x1a')](_0x391b46)['send'](_0x4c6fdc);};}exports[_0x6f0d('0x28')]=function(_0x4f1ca2,_0x19ccb9){var _0x25c97a={},_0x54c86a={},_0x2c214c={'count':0x0,'rows':[]};var _0x2fe349=_[_0x6f0d('0x29')](db['SalesforceAccount'][_0x6f0d('0x2a')],function(_0x58e063){return{'name':_0x58e063[_0x6f0d('0x2b')],'type':_0x58e063[_0x6f0d('0x2c')][_0x6f0d('0x2d')]};});_0x54c86a[_0x6f0d('0x2e')]=_[_0x6f0d('0x29')](_0x2fe349,_0x6f0d('0x27'));_0x54c86a[_0x6f0d('0x2f')]=_[_0x6f0d('0x30')](_0x4f1ca2[_0x6f0d('0x2f')]);_0x54c86a[_0x6f0d('0x31')]=_[_0x6f0d('0x32')](_0x54c86a['model'],_0x54c86a[_0x6f0d('0x2f')]);_0x25c97a[_0x6f0d('0x33')]=_[_0x6f0d('0x32')](_0x54c86a[_0x6f0d('0x2e')],qs['fields'](_0x4f1ca2[_0x6f0d('0x2f')][_0x6f0d('0x34')]));_0x25c97a[_0x6f0d('0x33')]=_0x25c97a[_0x6f0d('0x33')][_0x6f0d('0x35')]?_0x25c97a[_0x6f0d('0x33')]:_0x54c86a[_0x6f0d('0x2e')];if(!_0x4f1ca2[_0x6f0d('0x2f')][_0x6f0d('0x36')](_0x6f0d('0x37'))){_0x25c97a[_0x6f0d('0x1e')]=qs[_0x6f0d('0x1e')](_0x4f1ca2[_0x6f0d('0x2f')][_0x6f0d('0x1e')]);_0x25c97a['offset']=qs[_0x6f0d('0x1c')](_0x4f1ca2[_0x6f0d('0x2f')][_0x6f0d('0x1c')]);}_0x25c97a[_0x6f0d('0x38')]=qs[_0x6f0d('0x39')](_0x4f1ca2[_0x6f0d('0x2f')]['sort']);_0x25c97a[_0x6f0d('0x3a')]=qs[_0x6f0d('0x31')](_[_0x6f0d('0x3b')](_0x4f1ca2['query'],_0x54c86a[_0x6f0d('0x31')]),_0x2fe349);if(_0x4f1ca2[_0x6f0d('0x2f')][_0x6f0d('0x3c')]){_0x25c97a[_0x6f0d('0x3a')]=_[_0x6f0d('0x3d')](_0x25c97a['where'],{'$or':_[_0x6f0d('0x29')](_0x2fe349,function(_0xa3b468){if(_0xa3b468['type']!==_0x6f0d('0x3e')){var _0x3948fa={};_0x3948fa[_0xa3b468[_0x6f0d('0x27')]]={'$like':'%'+_0x4f1ca2[_0x6f0d('0x2f')][_0x6f0d('0x3c')]+'%'};return _0x3948fa;}})});}_0x25c97a=_[_0x6f0d('0x3d')]({},_0x25c97a,_0x4f1ca2['options']);var _0x28b14e={'where':_0x25c97a[_0x6f0d('0x3a')]};return db[_0x6f0d('0x3f')]['count'](_0x28b14e)[_0x6f0d('0x40')](function(_0x1a646e){_0x2c214c[_0x6f0d('0x1f')]=_0x1a646e;if(_0x4f1ca2['query'][_0x6f0d('0x41')]){_0x25c97a[_0x6f0d('0x42')]=[{'all':!![]}];}return db[_0x6f0d('0x3f')][_0x6f0d('0x43')](_0x25c97a);})[_0x6f0d('0x40')](function(_0x505ae6){_0x2c214c[_0x6f0d('0x44')]=_0x505ae6;return _0x2c214c;})[_0x6f0d('0x40')](respondWithFilteredResult(_0x19ccb9,_0x25c97a))[_0x6f0d('0x45')](handleError(_0x19ccb9,null));};exports[_0x6f0d('0x46')]=function(_0x3c154f,_0x365917){var _0xd64642={'raw':![],'where':{'id':_0x3c154f[_0x6f0d('0x47')]['id']}},_0x124118={};_0x124118[_0x6f0d('0x2e')]=_[_0x6f0d('0x30')](db[_0x6f0d('0x3f')][_0x6f0d('0x2a')]);_0x124118[_0x6f0d('0x2f')]=_[_0x6f0d('0x30')](_0x3c154f['query']);_0x124118[_0x6f0d('0x31')]=_['intersection'](_0x124118[_0x6f0d('0x2e')],_0x124118[_0x6f0d('0x2f')]);_0xd64642[_0x6f0d('0x33')]=_['intersection'](_0x124118[_0x6f0d('0x2e')],qs[_0x6f0d('0x34')](_0x3c154f['query']['fields']));_0xd64642[_0x6f0d('0x33')]=_0xd64642['attributes'][_0x6f0d('0x35')]?_0xd64642[_0x6f0d('0x33')]:_0x124118[_0x6f0d('0x2e')];if(_0x3c154f[_0x6f0d('0x2f')][_0x6f0d('0x41')]){_0xd64642[_0x6f0d('0x42')]=[{'all':!![]}];}_0xd64642=_[_0x6f0d('0x3d')]({},_0xd64642,_0x3c154f['options']);return db[_0x6f0d('0x3f')][_0x6f0d('0x48')](_0xd64642)[_0x6f0d('0x40')](handleEntityNotFound(_0x365917,null))[_0x6f0d('0x40')](respondWithResult(_0x365917,null))[_0x6f0d('0x45')](handleError(_0x365917,null));};exports[_0x6f0d('0x49')]=function(_0x1f7cf6,_0x42838a){return db['SalesforceAccount'][_0x6f0d('0x49')](_0x1f7cf6['body'],{})[_0x6f0d('0x40')](respondWithResult(_0x42838a,0xc9))['catch'](handleError(_0x42838a,null));};exports[_0x6f0d('0x24')]=function(_0x4e3f14,_0x48f2a9){if(_0x4e3f14[_0x6f0d('0x4a')]['id']){delete _0x4e3f14[_0x6f0d('0x4a')]['id'];}return db[_0x6f0d('0x3f')][_0x6f0d('0x48')]({'where':{'id':_0x4e3f14[_0x6f0d('0x47')]['id']}})[_0x6f0d('0x40')](handleEntityNotFound(_0x48f2a9,null))['then'](saveUpdates(_0x4e3f14['body'],null))[_0x6f0d('0x40')](respondWithResult(_0x48f2a9,null))[_0x6f0d('0x45')](handleError(_0x48f2a9,null));};exports['destroy']=function(_0x4ef8f0,_0x41e904){return db[_0x6f0d('0x3f')][_0x6f0d('0x48')]({'where':{'id':_0x4ef8f0[_0x6f0d('0x47')]['id']}})[_0x6f0d('0x40')](handleEntityNotFound(_0x41e904,null))[_0x6f0d('0x40')](removeEntity(_0x41e904,null))[_0x6f0d('0x45')](handleError(_0x41e904,null));};exports[_0x6f0d('0x4b')]=function(_0x2875ea,_0x5a5a8d,_0x458af7){var _0x18b70a={};var _0xe8e568={};var _0x45effa;var _0x3a58b5;return db[_0x6f0d('0x3f')][_0x6f0d('0x4c')]({'where':{'id':_0x2875ea[_0x6f0d('0x47')]['id']}})[_0x6f0d('0x40')](handleEntityNotFound(_0x5a5a8d,null))['then'](function(_0xbb951a){if(_0xbb951a){_0x45effa=_0xbb951a;_0xe8e568[_0x6f0d('0x2e')]=_['keys'](db[_0x6f0d('0x4d')][_0x6f0d('0x2a')]);_0xe8e568[_0x6f0d('0x2f')]=_['keys'](_0x2875ea[_0x6f0d('0x2f')]);_0xe8e568[_0x6f0d('0x31')]=_['intersection'](_0xe8e568[_0x6f0d('0x2e')],_0xe8e568[_0x6f0d('0x2f')]);_0x18b70a[_0x6f0d('0x33')]=_[_0x6f0d('0x32')](_0xe8e568['model'],qs[_0x6f0d('0x34')](_0x2875ea[_0x6f0d('0x2f')]['fields']));_0x18b70a['attributes']=_0x18b70a[_0x6f0d('0x33')][_0x6f0d('0x35')]?_0x18b70a[_0x6f0d('0x33')]:_0xe8e568[_0x6f0d('0x2e')];_0x18b70a[_0x6f0d('0x38')]=qs['sort'](_0x2875ea[_0x6f0d('0x2f')][_0x6f0d('0x39')]);_0x18b70a['where']=qs[_0x6f0d('0x31')](_[_0x6f0d('0x3b')](_0x2875ea[_0x6f0d('0x2f')],_0xe8e568[_0x6f0d('0x31')]));if(_0x2875ea['query']['filter']){_0x18b70a[_0x6f0d('0x3a')]=_[_0x6f0d('0x3d')](_0x18b70a[_0x6f0d('0x3a')],{'$or':_[_0x6f0d('0x29')](_0x18b70a[_0x6f0d('0x33')],function(_0x69b691){var _0x298ef9={};_0x298ef9[_0x69b691]={'$like':'%'+_0x2875ea['query'][_0x6f0d('0x3c')]+'%'};return _0x298ef9;})});}_0x18b70a=_[_0x6f0d('0x3d')]({},_0x18b70a,_0x2875ea[_0x6f0d('0x4e')]);return _0x45effa[_0x6f0d('0x4b')](_0x18b70a);}})[_0x6f0d('0x40')](function(_0x3b82f3){if(_0x3b82f3){_0x3a58b5=_0x3b82f3['length'];if(!_0x2875ea['query']['hasOwnProperty'](_0x6f0d('0x37'))){_0x18b70a[_0x6f0d('0x1e')]=qs[_0x6f0d('0x1e')](_0x2875ea[_0x6f0d('0x2f')][_0x6f0d('0x1e')]);_0x18b70a['offset']=qs[_0x6f0d('0x1c')](_0x2875ea['query'][_0x6f0d('0x1c')]);}return _0x45effa[_0x6f0d('0x4b')](_0x18b70a);}})[_0x6f0d('0x40')](function(_0x14df30){if(_0x14df30){return _0x14df30?{'count':_0x3a58b5,'rows':_0x14df30}:null;}})[_0x6f0d('0x40')](respondWithResult(_0x5a5a8d,null))[_0x6f0d('0x45')](handleError(_0x5a5a8d,null));};exports['addConfiguration']=function(_0x3322cb,_0x35fdfe,_0x37c61a){if(_0x3322cb[_0x6f0d('0x4a')]['id']){delete _0x3322cb[_0x6f0d('0x4a')]['id'];}return db[_0x6f0d('0x3f')][_0x6f0d('0x4c')]({'where':{'id':_0x3322cb['params']['id']}})['then'](handleEntityNotFound(_0x35fdfe,null))[_0x6f0d('0x40')](function(_0x3bf575){if(_0x3bf575){_0x3322cb[_0x6f0d('0x4a')][_0x6f0d('0x4f')]=_0x3bf575['id'];_0x3322cb[_0x6f0d('0x4a')][_0x6f0d('0x50')]=integrations[_0x6f0d('0x51')](_0x3322cb[_0x6f0d('0x4a')][_0x6f0d('0x52')],_0x3322cb[_0x6f0d('0x4a')][_0x6f0d('0x2c')]);_0x3322cb[_0x6f0d('0x4a')][_0x6f0d('0x53')]=integrations['getDescriptions'](_0x3322cb[_0x6f0d('0x4a')][_0x6f0d('0x52')],_0x3322cb[_0x6f0d('0x4a')][_0x6f0d('0x2c')]);return db[_0x6f0d('0x4d')]['create'](_0x3322cb[_0x6f0d('0x4a')],{'include':[{'model':db[_0x6f0d('0x54')],'as':'Subjects'},{'model':db[_0x6f0d('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x35fdfe,null))[_0x6f0d('0x45')](handleError(_0x35fdfe,null));};exports[_0x6f0d('0x55')]=function(_0x3a9df8,_0x167d3d,_0x3612bd){var _0x67b5bb;var _0x214687='';var _0x19b3be='Task';return db['SalesforceAccount']['findOne']({'where':{'id':_0x3a9df8[_0x6f0d('0x47')]['id']},'attributes':['id',_0x6f0d('0x56'),_0x6f0d('0x57'),_0x6f0d('0x58'),_0x6f0d('0x59'),_0x6f0d('0x5a'),_0x6f0d('0x5b')]})['then'](handleEntityNotFound(_0x167d3d,null))[_0x6f0d('0x40')](function(_0x16cf85){if(_0x16cf85){_0x214687=_0x16cf85[_0x6f0d('0x56')];var _0x170fb7=_0x214687['slice'](-0x1);if(_0x170fb7==='/'){_0x214687=_0x214687[_0x6f0d('0x5c')](0x0,_0x214687[_0x6f0d('0x5d')](_0x170fb7));}_0x67b5bb=new jsforce[(_0x6f0d('0x5e'))]({'oauth2':{'loginUrl':_0x214687,'clientId':_0x16cf85[_0x6f0d('0x57')],'clientSecret':_0x16cf85[_0x6f0d('0x58')]}});return _0x67b5bb[_0x6f0d('0x5f')](_0x16cf85[_0x6f0d('0x59')],_0x16cf85[_0x6f0d('0x5a')][_0x6f0d('0x60')](_0x16cf85[_0x6f0d('0x5b')]));}})[_0x6f0d('0x40')](function(_0x572148){if(_0x572148){if(!_[_0x6f0d('0x61')](_0x3a9df8[_0x6f0d('0x2f')]['ticketType'])){_0x19b3be=_0x3a9df8[_0x6f0d('0x2f')]['ticketType'];}return _0x67b5bb[_0x6f0d('0x62')](_0x19b3be)[_0x6f0d('0x63')]();}})[_0x6f0d('0x40')](function(_0x21cd6d){var _0x48fa83=['OwnerId',_0x6f0d('0x64'),_0x6f0d('0x65'),_0x6f0d('0x66'),_0x6f0d('0x67'),'Description'];var _0x41c574=[_0x6f0d('0x68'),_0x6f0d('0x69'),_0x6f0d('0x6a'),_0x6f0d('0x6b'),_0x6f0d('0x6c'),_0x6f0d('0x6d'),'phone'];if(_0x21cd6d){_[_0x6f0d('0x6e')](_0x21cd6d['fields'],function(_0x58f912){return _0x48fa83[_0x6f0d('0x6f')](_0x58f912[_0x6f0d('0x27')])||!_0x41c574['includes'](_0x58f912[_0x6f0d('0x2c')]);});return{'count':_0x21cd6d[_0x6f0d('0x34')][_0x6f0d('0x35')],'rows':_[_0x6f0d('0x29')](_0x21cd6d[_0x6f0d('0x34')],function(_0x14b348){return{'id':_0x14b348[_0x6f0d('0x27')],'name':_0x14b348[_0x6f0d('0x70')],'custom':_0x14b348[_0x6f0d('0x71')],'options':_0x14b348[_0x6f0d('0x72')][_0x6f0d('0x35')]>0x0?_[_0x6f0d('0x29')](_0x14b348[_0x6f0d('0x72')],function(_0x45f2d4){return{'name':_0x45f2d4[_0x6f0d('0x70')],'value':_0x45f2d4[_0x6f0d('0x73')]};}):_0x14b348[_0x6f0d('0x2c')]==_0x6f0d('0x6b')?[{'name':_0x6f0d('0x74'),'value':_0x6f0d('0x75')},{'name':_0x6f0d('0x76'),'value':'false'}]:[]};})};}})[_0x6f0d('0x40')](respondWithResult(_0x167d3d,null))['catch'](function(_0x3163d7){var _0x48dd4c=_0x3a9df8[_0x6f0d('0x2f')]['test']?0x1f4:_0x3163d7[_0x6f0d('0x77')]||0x1f4;logger[_0x6f0d('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x6f0d('0x55'),_0x48dd4c,JSON[_0x6f0d('0x78')](_0x3163d7));delete _0x3163d7[_0x6f0d('0x27')];if(_0x48dd4c===0x191){_0x48dd4c=0x190;}_0x167d3d['status'](_0x48dd4c)[_0x6f0d('0x79')](_0x3a9df8['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3163d7[_0x6f0d('0x77')]}:_0x3163d7);});};
\ No newline at end of file
+var _0xd81c=['destroy','error','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','Task','findOne','remoteUri','clientId','clientSecret','password','slice','substring','lastIndexOf','Connection','login','username','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','picklistValues','value','True','False','false','test','statusCode','getFields','stringify','eml-format','rimraf','fast-json-patch','moment','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/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then'];(function(_0x313097,_0x2f6730){var _0x3b431a=function(_0x43ab2a){while(--_0x43ab2a){_0x313097['push'](_0x313097['shift']());}};_0x3b431a(++_0x2f6730);}(_0xd81c,0xdc));var _0xcd81=function(_0x54bc76,_0x4d0664){_0x54bc76=_0x54bc76-0x0;var _0x58a457=_0xd81c[_0x54bc76];return _0x58a457;};'use strict';var emlformat=require(_0xcd81('0x0'));var rimraf=require(_0xcd81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd81('0x2'));var rp=require('request-promise');var moment=require(_0xcd81('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcd81('0x4'));var path=require(_0xcd81('0x5'));var sox=require(_0xcd81('0x6'));var csv=require(_0xcd81('0x7'));var ejs=require(_0xcd81('0x8'));var fs=require('fs');var fs_extra=require(_0xcd81('0x9'));var _=require(_0xcd81('0xa'));var squel=require(_0xcd81('0xb'));var crypto=require(_0xcd81('0xc'));var jsforce=require(_0xcd81('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcd81('0xe'));var Papa=require(_0xcd81('0xf'));var Redis=require(_0xcd81('0x10'));var authService=require(_0xcd81('0x11'));var qs=require(_0xcd81('0x12'));var as=require(_0xcd81('0x13'));var hardwareService=require(_0xcd81('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcd81('0x15'));var db=require(_0xcd81('0x16'))['db'];var integrations=require(_0xcd81('0x17'));function respondWithStatusCode(_0x22f864,_0x162a4f){_0x162a4f=_0x162a4f||0xcc;return function(_0x3bb82d){if(_0x3bb82d){return _0x22f864[_0xcd81('0x18')](_0x162a4f);}return _0x22f864[_0xcd81('0x19')](_0x162a4f)[_0xcd81('0x1a')]();};}function respondWithResult(_0x25e2a1,_0x5b2656){_0x5b2656=_0x5b2656||0xc8;return function(_0x24461e){if(_0x24461e){return _0x25e2a1['status'](_0x5b2656)['json'](_0x24461e);}};}function respondWithFilteredResult(_0x9d3074,_0x5f2226){return function(_0x55713c){if(_0x55713c){var _0x4fc54b=typeof _0x5f2226[_0xcd81('0x1b')]===_0xcd81('0x1c')&&typeof _0x5f2226[_0xcd81('0x1d')]==='undefined';var _0x261455=_0x55713c['count'];var _0x25295e=_0x4fc54b?0x0:_0x5f2226[_0xcd81('0x1b')];var _0x2e80df=_0x4fc54b?_0x55713c[_0xcd81('0x1e')]:_0x5f2226[_0xcd81('0x1b')]+_0x5f2226[_0xcd81('0x1d')];var _0x3049af;if(_0x2e80df>=_0x261455){_0x2e80df=_0x261455;_0x3049af=0xc8;}else{_0x3049af=0xce;}_0x9d3074[_0xcd81('0x19')](_0x3049af);return _0x9d3074[_0xcd81('0x1f')](_0xcd81('0x20'),_0x25295e+'-'+_0x2e80df+'/'+_0x261455)[_0xcd81('0x21')](_0x55713c);}return null;};}function patchUpdates(_0x548d56){return function(_0x2889ef){try{jsonpatch[_0xcd81('0x22')](_0x2889ef,_0x548d56,!![]);}catch(_0x4b7807){return BPromise[_0xcd81('0x23')](_0x4b7807);}return _0x2889ef[_0xcd81('0x24')]();};}function saveUpdates(_0xbda687,_0x41c14d){return function(_0x109b01){if(_0x109b01){return _0x109b01['update'](_0xbda687)[_0xcd81('0x25')](function(_0x39c54c){return _0x39c54c;});}return null;};}function removeEntity(_0x77fb8a,_0x228db4){return function(_0x17714c){if(_0x17714c){return _0x17714c[_0xcd81('0x26')]()[_0xcd81('0x25')](function(){_0x77fb8a[_0xcd81('0x19')](0xcc)[_0xcd81('0x1a')]();});}};}function handleEntityNotFound(_0xd6c21a,_0x31b416){return function(_0x1664de){if(!_0x1664de){_0xd6c21a[_0xcd81('0x18')](0x194);}return _0x1664de;};}function handleError(_0x59f3c9,_0x16619e){_0x16619e=_0x16619e||0x1f4;return function(_0x46e697){logger[_0xcd81('0x27')](_0x46e697['stack']);if(_0x46e697[_0xcd81('0x28')]){delete _0x46e697['name'];}_0x59f3c9[_0xcd81('0x19')](_0x16619e)[_0xcd81('0x29')](_0x46e697);};}exports[_0xcd81('0x2a')]=function(_0x187b11,_0x34d4d1){var _0x1a1ce8={},_0x4c02ac={},_0x2df92f={'count':0x0,'rows':[]};var _0x3945aa=_[_0xcd81('0x2b')](db[_0xcd81('0x2c')][_0xcd81('0x2d')],function(_0x47bb39){return{'name':_0x47bb39[_0xcd81('0x2e')],'type':_0x47bb39[_0xcd81('0x2f')][_0xcd81('0x30')]};});_0x4c02ac[_0xcd81('0x31')]=_[_0xcd81('0x2b')](_0x3945aa,_0xcd81('0x28'));_0x4c02ac[_0xcd81('0x32')]=_[_0xcd81('0x33')](_0x187b11[_0xcd81('0x32')]);_0x4c02ac['filters']=_[_0xcd81('0x34')](_0x4c02ac['model'],_0x4c02ac[_0xcd81('0x32')]);_0x1a1ce8[_0xcd81('0x35')]=_[_0xcd81('0x34')](_0x4c02ac['model'],qs[_0xcd81('0x36')](_0x187b11[_0xcd81('0x32')]['fields']));_0x1a1ce8[_0xcd81('0x35')]=_0x1a1ce8[_0xcd81('0x35')]['length']?_0x1a1ce8[_0xcd81('0x35')]:_0x4c02ac[_0xcd81('0x31')];if(!_0x187b11[_0xcd81('0x32')]['hasOwnProperty'](_0xcd81('0x37'))){_0x1a1ce8[_0xcd81('0x1d')]=qs[_0xcd81('0x1d')](_0x187b11[_0xcd81('0x32')][_0xcd81('0x1d')]);_0x1a1ce8[_0xcd81('0x1b')]=qs[_0xcd81('0x1b')](_0x187b11['query'][_0xcd81('0x1b')]);}_0x1a1ce8[_0xcd81('0x38')]=qs['sort'](_0x187b11['query'][_0xcd81('0x39')]);_0x1a1ce8[_0xcd81('0x3a')]=qs[_0xcd81('0x3b')](_[_0xcd81('0x3c')](_0x187b11[_0xcd81('0x32')],_0x4c02ac[_0xcd81('0x3b')]),_0x3945aa);if(_0x187b11[_0xcd81('0x32')][_0xcd81('0x3d')]){_0x1a1ce8[_0xcd81('0x3a')]=_['merge'](_0x1a1ce8[_0xcd81('0x3a')],{'$or':_[_0xcd81('0x2b')](_0x3945aa,function(_0x21528e){if(_0x21528e['type']!==_0xcd81('0x3e')){var _0x3e1934={};_0x3e1934[_0x21528e[_0xcd81('0x28')]]={'$like':'%'+_0x187b11['query']['filter']+'%'};return _0x3e1934;}})});}_0x1a1ce8=_[_0xcd81('0x3f')]({},_0x1a1ce8,_0x187b11[_0xcd81('0x40')]);var _0x2825ab={'where':_0x1a1ce8[_0xcd81('0x3a')]};return db[_0xcd81('0x2c')][_0xcd81('0x1e')](_0x2825ab)[_0xcd81('0x25')](function(_0x3a2754){_0x2df92f[_0xcd81('0x1e')]=_0x3a2754;if(_0x187b11[_0xcd81('0x32')][_0xcd81('0x41')]){_0x1a1ce8[_0xcd81('0x42')]=[{'all':!![]}];}return db[_0xcd81('0x2c')][_0xcd81('0x43')](_0x1a1ce8);})[_0xcd81('0x25')](function(_0x4f3634){_0x2df92f[_0xcd81('0x44')]=_0x4f3634;return _0x2df92f;})[_0xcd81('0x25')](respondWithFilteredResult(_0x34d4d1,_0x1a1ce8))[_0xcd81('0x45')](handleError(_0x34d4d1,null));};exports[_0xcd81('0x46')]=function(_0x18459c,_0x1dadf5){var _0x135567={'raw':![],'where':{'id':_0x18459c[_0xcd81('0x47')]['id']}},_0x478138={};_0x478138['model']=_[_0xcd81('0x33')](db['SalesforceAccount'][_0xcd81('0x2d')]);_0x478138['query']=_[_0xcd81('0x33')](_0x18459c[_0xcd81('0x32')]);_0x478138['filters']=_[_0xcd81('0x34')](_0x478138[_0xcd81('0x31')],_0x478138['query']);_0x135567[_0xcd81('0x35')]=_[_0xcd81('0x34')](_0x478138['model'],qs[_0xcd81('0x36')](_0x18459c[_0xcd81('0x32')]['fields']));_0x135567['attributes']=_0x135567[_0xcd81('0x35')][_0xcd81('0x48')]?_0x135567[_0xcd81('0x35')]:_0x478138[_0xcd81('0x31')];if(_0x18459c[_0xcd81('0x32')][_0xcd81('0x41')]){_0x135567[_0xcd81('0x42')]=[{'all':!![]}];}_0x135567=_['merge']({},_0x135567,_0x18459c[_0xcd81('0x40')]);return db[_0xcd81('0x2c')][_0xcd81('0x49')](_0x135567)[_0xcd81('0x25')](handleEntityNotFound(_0x1dadf5,null))[_0xcd81('0x25')](respondWithResult(_0x1dadf5,null))[_0xcd81('0x45')](handleError(_0x1dadf5,null));};exports[_0xcd81('0x4a')]=function(_0x3b15ce,_0x18cd23){return db[_0xcd81('0x2c')][_0xcd81('0x4a')](_0x3b15ce[_0xcd81('0x4b')],{})['then'](respondWithResult(_0x18cd23,0xc9))[_0xcd81('0x45')](handleError(_0x18cd23,null));};exports[_0xcd81('0x4c')]=function(_0xe33c08,_0x1762b2){if(_0xe33c08[_0xcd81('0x4b')]['id']){delete _0xe33c08[_0xcd81('0x4b')]['id'];}return db[_0xcd81('0x2c')][_0xcd81('0x49')]({'where':{'id':_0xe33c08[_0xcd81('0x47')]['id']}})[_0xcd81('0x25')](handleEntityNotFound(_0x1762b2,null))[_0xcd81('0x25')](saveUpdates(_0xe33c08[_0xcd81('0x4b')],null))[_0xcd81('0x25')](respondWithResult(_0x1762b2,null))['catch'](handleError(_0x1762b2,null));};exports[_0xcd81('0x26')]=function(_0x4f287f,_0x3e6a9f){return db[_0xcd81('0x2c')][_0xcd81('0x49')]({'where':{'id':_0x4f287f[_0xcd81('0x47')]['id']}})[_0xcd81('0x25')](handleEntityNotFound(_0x3e6a9f,null))[_0xcd81('0x25')](removeEntity(_0x3e6a9f,null))[_0xcd81('0x45')](handleError(_0x3e6a9f,null));};exports[_0xcd81('0x4d')]=function(_0x4169a4,_0x547926,_0x2bbc49){var _0x30d77b={};var _0x46563c={};var _0x259223;var _0x37442e;return db[_0xcd81('0x2c')]['findOne']({'where':{'id':_0x4169a4[_0xcd81('0x47')]['id']}})[_0xcd81('0x25')](handleEntityNotFound(_0x547926,null))[_0xcd81('0x25')](function(_0x56615a){if(_0x56615a){_0x259223=_0x56615a;_0x46563c[_0xcd81('0x31')]=_[_0xcd81('0x33')](db['SalesforceConfiguration']['rawAttributes']);_0x46563c[_0xcd81('0x32')]=_[_0xcd81('0x33')](_0x4169a4[_0xcd81('0x32')]);_0x46563c[_0xcd81('0x3b')]=_['intersection'](_0x46563c[_0xcd81('0x31')],_0x46563c[_0xcd81('0x32')]);_0x30d77b['attributes']=_['intersection'](_0x46563c['model'],qs[_0xcd81('0x36')](_0x4169a4[_0xcd81('0x32')][_0xcd81('0x36')]));_0x30d77b[_0xcd81('0x35')]=_0x30d77b[_0xcd81('0x35')][_0xcd81('0x48')]?_0x30d77b[_0xcd81('0x35')]:_0x46563c[_0xcd81('0x31')];_0x30d77b['order']=qs[_0xcd81('0x39')](_0x4169a4[_0xcd81('0x32')]['sort']);_0x30d77b[_0xcd81('0x3a')]=qs[_0xcd81('0x3b')](_['pick'](_0x4169a4[_0xcd81('0x32')],_0x46563c[_0xcd81('0x3b')]));if(_0x4169a4[_0xcd81('0x32')][_0xcd81('0x3d')]){_0x30d77b[_0xcd81('0x3a')]=_[_0xcd81('0x3f')](_0x30d77b['where'],{'$or':_['map'](_0x30d77b['attributes'],function(_0x2502be){var _0x2ca801={};_0x2ca801[_0x2502be]={'$like':'%'+_0x4169a4[_0xcd81('0x32')]['filter']+'%'};return _0x2ca801;})});}_0x30d77b=_['merge']({},_0x30d77b,_0x4169a4[_0xcd81('0x40')]);return _0x259223['getConfigurations'](_0x30d77b);}})[_0xcd81('0x25')](function(_0x59db11){if(_0x59db11){_0x37442e=_0x59db11[_0xcd81('0x48')];if(!_0x4169a4[_0xcd81('0x32')][_0xcd81('0x4e')]('nolimit')){_0x30d77b[_0xcd81('0x1d')]=qs[_0xcd81('0x1d')](_0x4169a4[_0xcd81('0x32')][_0xcd81('0x1d')]);_0x30d77b[_0xcd81('0x1b')]=qs[_0xcd81('0x1b')](_0x4169a4[_0xcd81('0x32')][_0xcd81('0x1b')]);}return _0x259223[_0xcd81('0x4d')](_0x30d77b);}})[_0xcd81('0x25')](function(_0x4e806a){if(_0x4e806a){return _0x4e806a?{'count':_0x37442e,'rows':_0x4e806a}:null;}})[_0xcd81('0x25')](respondWithResult(_0x547926,null))[_0xcd81('0x45')](handleError(_0x547926,null));};exports[_0xcd81('0x4f')]=function(_0xdf9e30,_0x4cf169,_0x2f8445){if(_0xdf9e30[_0xcd81('0x4b')]['id']){delete _0xdf9e30[_0xcd81('0x4b')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0xdf9e30[_0xcd81('0x47')]['id']}})[_0xcd81('0x25')](handleEntityNotFound(_0x4cf169,null))[_0xcd81('0x25')](function(_0x530647){if(_0x530647){_0xdf9e30[_0xcd81('0x4b')][_0xcd81('0x50')]=_0x530647['id'];_0xdf9e30['body'][_0xcd81('0x51')]=integrations[_0xcd81('0x52')](_0xdf9e30[_0xcd81('0x4b')][_0xcd81('0x53')],_0xdf9e30['body'][_0xcd81('0x2f')]);_0xdf9e30[_0xcd81('0x4b')]['Descriptions']=integrations[_0xcd81('0x54')](_0xdf9e30[_0xcd81('0x4b')][_0xcd81('0x53')],_0xdf9e30[_0xcd81('0x4b')][_0xcd81('0x2f')]);return db[_0xcd81('0x55')][_0xcd81('0x4a')](_0xdf9e30[_0xcd81('0x4b')],{'include':[{'model':db[_0xcd81('0x56')],'as':_0xcd81('0x51')},{'model':db[_0xcd81('0x56')],'as':_0xcd81('0x57')}]});}return null;})[_0xcd81('0x25')](respondWithResult(_0x4cf169,null))[_0xcd81('0x45')](handleError(_0x4cf169,null));};exports['getFields']=function(_0x222f18,_0x2b4d9a,_0x2c07e0){var _0x1d3e89;var _0x238c22='';var _0x2a642e=_0xcd81('0x58');return db['SalesforceAccount'][_0xcd81('0x59')]({'where':{'id':_0x222f18['params']['id']},'attributes':['id',_0xcd81('0x5a'),_0xcd81('0x5b'),_0xcd81('0x5c'),'username',_0xcd81('0x5d'),'securityToken']})[_0xcd81('0x25')](handleEntityNotFound(_0x2b4d9a,null))['then'](function(_0x5bb490){if(_0x5bb490){_0x238c22=_0x5bb490[_0xcd81('0x5a')];var _0xd7b3cc=_0x238c22[_0xcd81('0x5e')](-0x1);if(_0xd7b3cc==='/'){_0x238c22=_0x238c22[_0xcd81('0x5f')](0x0,_0x238c22[_0xcd81('0x60')](_0xd7b3cc));}_0x1d3e89=new jsforce[(_0xcd81('0x61'))]({'oauth2':{'loginUrl':_0x238c22,'clientId':_0x5bb490[_0xcd81('0x5b')],'clientSecret':_0x5bb490[_0xcd81('0x5c')]}});return _0x1d3e89[_0xcd81('0x62')](_0x5bb490[_0xcd81('0x63')],_0x5bb490['password'][_0xcd81('0x64')](_0x5bb490[_0xcd81('0x65')]));}})[_0xcd81('0x25')](function(_0x49ce68){if(_0x49ce68){if(!_[_0xcd81('0x66')](_0x222f18[_0xcd81('0x32')][_0xcd81('0x67')])){_0x2a642e=_0x222f18[_0xcd81('0x32')][_0xcd81('0x67')];}return _0x1d3e89[_0xcd81('0x68')](_0x2a642e)[_0xcd81('0x69')]();}})[_0xcd81('0x25')](function(_0x21ac27){var _0x17913d=[_0xcd81('0x6a'),_0xcd81('0x6b'),_0xcd81('0x6c'),'IsRecurrence',_0xcd81('0x6d'),'Description'];var _0x27fd41=[_0xcd81('0x6e'),_0xcd81('0x6f'),_0xcd81('0x70'),_0xcd81('0x71'),_0xcd81('0x72'),_0xcd81('0x73'),_0xcd81('0x74')];if(_0x21ac27){_[_0xcd81('0x75')](_0x21ac27[_0xcd81('0x36')],function(_0x4167a8){return _0x17913d[_0xcd81('0x76')](_0x4167a8['name'])||!_0x27fd41[_0xcd81('0x76')](_0x4167a8[_0xcd81('0x2f')]);});return{'count':_0x21ac27[_0xcd81('0x36')]['length'],'rows':_['map'](_0x21ac27['fields'],function(_0x169751){return{'id':_0x169751[_0xcd81('0x28')],'name':_0x169751[_0xcd81('0x77')],'custom':_0x169751['custom'],'options':_0x169751[_0xcd81('0x78')][_0xcd81('0x48')]>0x0?_[_0xcd81('0x2b')](_0x169751[_0xcd81('0x78')],function(_0xc4ed25){return{'name':_0xc4ed25[_0xcd81('0x77')],'value':_0xc4ed25[_0xcd81('0x79')]};}):_0x169751[_0xcd81('0x2f')]=='boolean'?[{'name':_0xcd81('0x7a'),'value':'true'},{'name':_0xcd81('0x7b'),'value':_0xcd81('0x7c')}]:[]};})};}})[_0xcd81('0x25')](respondWithResult(_0x2b4d9a,null))[_0xcd81('0x45')](function(_0x150e32){var _0x127b1f=_0x222f18[_0xcd81('0x32')][_0xcd81('0x7d')]?0x1f4:_0x150e32[_0xcd81('0x7e')]||0x1f4;logger[_0xcd81('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xcd81('0x7f'),_0x127b1f,JSON[_0xcd81('0x80')](_0x150e32));delete _0x150e32[_0xcd81('0x28')];if(_0x127b1f===0x191){_0x127b1f=0x190;}_0x2b4d9a[_0xcd81('0x19')](_0x127b1f)[_0xcd81('0x29')](_0x222f18[_0xcd81('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x150e32[_0xcd81('0x7e')]}:_0x150e32);});};
\ No newline at end of file
index 55517bb..30c927d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa639=['int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','path','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x20a034,_0x34b87c){var _0x1658c1=function(_0x2cc0ef){while(--_0x2cc0ef){_0x20a034['push'](_0x20a034['shift']());}};_0x1658c1(++_0x34b87c);}(_0xa639,0x140));var _0x9a63=function(_0x3b7f82,_0x476ae2){_0x3b7f82=_0x3b7f82-0x0;var _0x359a2f=_0xa639[_0x3b7f82];return _0x359a2f;};'use strict';var _=require('lodash');var util=require(_0x9a63('0x0'));var logger=require(_0x9a63('0x1'))(_0x9a63('0x2'));var moment=require(_0x9a63('0x3'));var BPromise=require(_0x9a63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a63('0x5'));var rimraf=require('rimraf');var config=require(_0x9a63('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x9a63('0x7'));module[_0x9a63('0x8')]=function(_0x4b9c08,_0x274868){return _0x4b9c08[_0x9a63('0x9')]('SalesforceAccount',attributes,{'tableName':_0x9a63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa916=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0xa916,0x1ec));var _0x6a91=function(_0x460f6f,_0x31347a){_0x460f6f=_0x460f6f-0x0;var _0x318d14=_0xa916[_0x460f6f];return _0x318d14;};'use strict';var _=require(_0x6a91('0x0'));var util=require(_0x6a91('0x1'));var logger=require('../../config/logger')(_0x6a91('0x2'));var moment=require(_0x6a91('0x3'));var BPromise=require(_0x6a91('0x4'));var rp=require(_0x6a91('0x5'));var fs=require('fs');var path=require(_0x6a91('0x6'));var rimraf=require(_0x6a91('0x7'));var config=require(_0x6a91('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x6a91('0x9'));module['exports']=function(_0x2f970e,_0x56057f){return _0x2f970e['define'](_0x6a91('0xa'),attributes,{'tableName':_0x6a91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2d11ee0..ccf122f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1c1=['message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetSalesforceAccount','debug','ShowSalesforceAccount','SalesforceAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s'];(function(_0x8467f9,_0x13c6af){var _0x53337e=function(_0x2a7131){while(--_0x2a7131){_0x8467f9['push'](_0x8467f9['shift']());}};_0x53337e(++_0x13c6af);}(_0xe1c1,0x14b));var _0x1e1c=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0xe1c1[_0x5eaa0b];return _0x28b295;};'use strict';var _=require(_0x1e1c('0x0'));var util=require(_0x1e1c('0x1'));var moment=require(_0x1e1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e1c('0x4'))['db'];var utils=require(_0x1e1c('0x5'));var logger=require(_0x1e1c('0x6'))(_0x1e1c('0x7'));var config=require(_0x1e1c('0x8'));var jayson=require(_0x1e1c('0x9'));var client=jayson['client'][_0x1e1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46c4c8,_0x583339,_0x39034f){return new BPromise(function(_0x314e0a,_0x4b2b48){return client['request'](_0x46c4c8,_0x39034f)[_0x1e1c('0xb')](function(_0x430977){logger[_0x1e1c('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x583339,_0x1e1c('0xd'));logger['debug'](_0x1e1c('0xe'),_0x583339,_0x1e1c('0xd'),JSON[_0x1e1c('0xf')](_0x430977));if(_0x430977[_0x1e1c('0x10')]){if(_0x430977[_0x1e1c('0x10')][_0x1e1c('0x11')]===0x1f4){logger[_0x1e1c('0x10')](_0x1e1c('0x12'),_0x583339,_0x430977[_0x1e1c('0x10')][_0x1e1c('0x13')]);return _0x4b2b48(_0x430977[_0x1e1c('0x10')][_0x1e1c('0x13')]);}logger[_0x1e1c('0x10')](_0x1e1c('0x12'),_0x583339,_0x430977[_0x1e1c('0x10')][_0x1e1c('0x13')]);return _0x314e0a(_0x430977['error'][_0x1e1c('0x13')]);}else{logger[_0x1e1c('0xc')](_0x1e1c('0x12'),_0x583339,_0x1e1c('0xd'));_0x314e0a(_0x430977[_0x1e1c('0x14')]['message']);}})[_0x1e1c('0x15')](function(_0x3f8df2){logger[_0x1e1c('0x10')](_0x1e1c('0x12'),_0x583339,_0x3f8df2);_0x4b2b48(_0x3f8df2);});});}exports['GetSalesforceAccount']=function(_0x4aab26){var _0x514812=this;return new Promise(function(_0x21cfb5,_0x87a8e8){return db['SalesforceAccount'][_0x1e1c('0x16')]({'raw':_0x4aab26['options']?_0x4aab26[_0x1e1c('0x17')][_0x1e1c('0x18')]===undefined?!![]:![]:!![],'where':_0x4aab26[_0x1e1c('0x17')]?_0x4aab26['options'][_0x1e1c('0x19')]||null:null,'attributes':_0x4aab26[_0x1e1c('0x17')]?_0x4aab26[_0x1e1c('0x17')][_0x1e1c('0x1a')]||null:null,'limit':_0x4aab26[_0x1e1c('0x17')]?_0x4aab26[_0x1e1c('0x17')][_0x1e1c('0x1b')]||null:null,'include':_0x4aab26[_0x1e1c('0x17')]?_0x4aab26[_0x1e1c('0x17')][_0x1e1c('0x1c')]?_[_0x1e1c('0x1d')](_0x4aab26['options'][_0x1e1c('0x1c')],function(_0x1a1229){return{'model':db[_0x1a1229[_0x1e1c('0x1e')]],'as':_0x1a1229['as'],'attributes':_0x1a1229['attributes'],'include':_0x1a1229['include']?_['map'](_0x1a1229[_0x1e1c('0x1c')],function(_0x515c96){return{'model':db[_0x515c96[_0x1e1c('0x1e')]],'as':_0x515c96['as'],'attributes':_0x515c96[_0x1e1c('0x1a')],'include':_0x515c96['include']?_['map'](_0x515c96[_0x1e1c('0x1c')],function(_0x56d167){return{'model':db[_0x56d167[_0x1e1c('0x1e')]],'as':_0x56d167['as'],'attributes':_0x56d167[_0x1e1c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x578017){logger['info'](_0x1e1c('0x1f'),_0x4aab26);logger[_0x1e1c('0x20')](_0x1e1c('0x1f'),_0x4aab26,JSON[_0x1e1c('0xf')](_0x578017));_0x21cfb5(_0x578017);})[_0x1e1c('0x15')](function(_0x5d6c3e){logger[_0x1e1c('0x10')](_0x1e1c('0x1f'),_0x5d6c3e['message'],_0x4aab26);_0x87a8e8(_0x514812[_0x1e1c('0x10')](0x1f4,_0x5d6c3e['message']));});});};exports[_0x1e1c('0x21')]=function(_0xbf4019){var _0x15ec17=this;return new Promise(function(_0x4ee0ba,_0x6b1057){return db[_0x1e1c('0x22')]['find']({'raw':_0xbf4019[_0x1e1c('0x17')]?_0xbf4019[_0x1e1c('0x17')][_0x1e1c('0x18')]===undefined?!![]:![]:!![],'where':_0xbf4019['options']?_0xbf4019['options'][_0x1e1c('0x19')]||null:null,'attributes':_0xbf4019['options']?_0xbf4019[_0x1e1c('0x17')][_0x1e1c('0x1a')]||null:null,'include':_0xbf4019[_0x1e1c('0x17')]?_0xbf4019[_0x1e1c('0x17')][_0x1e1c('0x1c')]?_[_0x1e1c('0x1d')](_0xbf4019[_0x1e1c('0x17')][_0x1e1c('0x1c')],function(_0x385023){return{'model':db[_0x385023[_0x1e1c('0x1e')]],'as':_0x385023['as'],'attributes':_0x385023[_0x1e1c('0x1a')],'include':_0x385023[_0x1e1c('0x1c')]?_[_0x1e1c('0x1d')](_0x385023[_0x1e1c('0x1c')],function(_0x5f4113){return{'model':db[_0x5f4113['model']],'as':_0x5f4113['as'],'attributes':_0x5f4113[_0x1e1c('0x1a')],'include':_0x5f4113['include']?_[_0x1e1c('0x1d')](_0x5f4113['include'],function(_0x53f722){return{'model':db[_0x53f722['model']],'as':_0x53f722['as'],'attributes':_0x53f722[_0x1e1c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1e1c('0xb')](function(_0x33188e){logger[_0x1e1c('0xc')](_0x1e1c('0x21'),_0xbf4019);logger[_0x1e1c('0x20')](_0x1e1c('0x21'),_0xbf4019,JSON[_0x1e1c('0xf')](_0x33188e));_0x4ee0ba(_0x33188e);})[_0x1e1c('0x15')](function(_0x54bbc8){logger[_0x1e1c('0x10')](_0x1e1c('0x21'),_0x54bbc8[_0x1e1c('0x13')],_0xbf4019);_0x6b1057(_0x15ec17['error'](0x1f4,_0x54bbc8[_0x1e1c('0x13')]));});});};
\ No newline at end of file
+var _0x0127=['find','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','include','map','model','stringify','ShowSalesforceAccount'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0x0127,0x1c1));var _0x7012=function(_0x48aeff,_0x18d7c5){_0x48aeff=_0x48aeff-0x0;var _0x131d32=_0x0127[_0x48aeff];return _0x131d32;};'use strict';var _=require(_0x7012('0x0'));var util=require(_0x7012('0x1'));var moment=require('moment');var BPromise=require(_0x7012('0x2'));var rs=require(_0x7012('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7012('0x4'));var logger=require('../../config/logger')(_0x7012('0x5'));var config=require(_0x7012('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7012('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52a6bb,_0x519a09,_0x3cb735){return new BPromise(function(_0x5ceb2c,_0x31608f){return client['request'](_0x52a6bb,_0x3cb735)[_0x7012('0x8')](function(_0x132029){logger[_0x7012('0x9')](_0x7012('0xa'),_0x519a09,_0x7012('0xb'));logger[_0x7012('0xc')](_0x7012('0xd'),_0x519a09,'request\x20sent',JSON['stringify'](_0x132029));if(_0x132029['error']){if(_0x132029[_0x7012('0xe')][_0x7012('0xf')]===0x1f4){logger[_0x7012('0xe')](_0x7012('0xa'),_0x519a09,_0x132029[_0x7012('0xe')]['message']);return _0x31608f(_0x132029['error'][_0x7012('0x10')]);}logger[_0x7012('0xe')](_0x7012('0xa'),_0x519a09,_0x132029[_0x7012('0xe')][_0x7012('0x10')]);return _0x5ceb2c(_0x132029[_0x7012('0xe')]['message']);}else{logger[_0x7012('0x9')](_0x7012('0xa'),_0x519a09,_0x7012('0xb'));_0x5ceb2c(_0x132029[_0x7012('0x11')][_0x7012('0x10')]);}})[_0x7012('0x12')](function(_0x8aee4c){logger[_0x7012('0xe')](_0x7012('0xa'),_0x519a09,_0x8aee4c);_0x31608f(_0x8aee4c);});});}exports[_0x7012('0x13')]=function(_0x182502){var _0x3723aa=this;return new Promise(function(_0x527212,_0x491931){return db[_0x7012('0x14')][_0x7012('0x15')]({'raw':_0x182502[_0x7012('0x16')]?_0x182502[_0x7012('0x16')][_0x7012('0x17')]===undefined?!![]:![]:!![],'where':_0x182502[_0x7012('0x16')]?_0x182502[_0x7012('0x16')][_0x7012('0x18')]||null:null,'attributes':_0x182502[_0x7012('0x16')]?_0x182502[_0x7012('0x16')][_0x7012('0x19')]||null:null,'limit':_0x182502['options']?_0x182502[_0x7012('0x16')]['limit']||null:null,'include':_0x182502[_0x7012('0x16')]?_0x182502[_0x7012('0x16')][_0x7012('0x1a')]?_[_0x7012('0x1b')](_0x182502['options'][_0x7012('0x1a')],function(_0xfc76f1){return{'model':db[_0xfc76f1[_0x7012('0x1c')]],'as':_0xfc76f1['as'],'attributes':_0xfc76f1['attributes'],'include':_0xfc76f1[_0x7012('0x1a')]?_[_0x7012('0x1b')](_0xfc76f1['include'],function(_0x125915){return{'model':db[_0x125915[_0x7012('0x1c')]],'as':_0x125915['as'],'attributes':_0x125915[_0x7012('0x19')],'include':_0x125915[_0x7012('0x1a')]?_['map'](_0x125915[_0x7012('0x1a')],function(_0x481a3e){return{'model':db[_0x481a3e['model']],'as':_0x481a3e['as'],'attributes':_0x481a3e['attributes']};}):[]};}):[]};}):[]:[]})[_0x7012('0x8')](function(_0x1b5814){logger[_0x7012('0x9')](_0x7012('0x13'),_0x182502);logger[_0x7012('0xc')](_0x7012('0x13'),_0x182502,JSON[_0x7012('0x1d')](_0x1b5814));_0x527212(_0x1b5814);})['catch'](function(_0x50667f){logger['error'](_0x7012('0x13'),_0x50667f[_0x7012('0x10')],_0x182502);_0x491931(_0x3723aa[_0x7012('0xe')](0x1f4,_0x50667f[_0x7012('0x10')]));});});};exports[_0x7012('0x1e')]=function(_0x22ccc0){var _0x1743fa=this;return new Promise(function(_0x5b30e9,_0x5c8aed){return db[_0x7012('0x14')][_0x7012('0x1f')]({'raw':_0x22ccc0['options']?_0x22ccc0[_0x7012('0x16')][_0x7012('0x17')]===undefined?!![]:![]:!![],'where':_0x22ccc0['options']?_0x22ccc0[_0x7012('0x16')][_0x7012('0x18')]||null:null,'attributes':_0x22ccc0[_0x7012('0x16')]?_0x22ccc0['options'][_0x7012('0x19')]||null:null,'include':_0x22ccc0[_0x7012('0x16')]?_0x22ccc0[_0x7012('0x16')][_0x7012('0x1a')]?_[_0x7012('0x1b')](_0x22ccc0['options'][_0x7012('0x1a')],function(_0x584918){return{'model':db[_0x584918[_0x7012('0x1c')]],'as':_0x584918['as'],'attributes':_0x584918[_0x7012('0x19')],'include':_0x584918[_0x7012('0x1a')]?_[_0x7012('0x1b')](_0x584918['include'],function(_0x5f2651){return{'model':db[_0x5f2651[_0x7012('0x1c')]],'as':_0x5f2651['as'],'attributes':_0x5f2651[_0x7012('0x19')],'include':_0x5f2651['include']?_[_0x7012('0x1b')](_0x5f2651[_0x7012('0x1a')],function(_0x3d6bd5){return{'model':db[_0x3d6bd5[_0x7012('0x1c')]],'as':_0x3d6bd5['as'],'attributes':_0x3d6bd5[_0x7012('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7012('0x8')](function(_0x10f655){logger[_0x7012('0x9')](_0x7012('0x1e'),_0x22ccc0);logger[_0x7012('0xc')](_0x7012('0x1e'),_0x22ccc0,JSON[_0x7012('0x1d')](_0x10f655));_0x5b30e9(_0x10f655);})['catch'](function(_0x424e9e){logger[_0x7012('0xe')]('ShowSalesforceAccount',_0x424e9e[_0x7012('0x10')],_0x22ccc0);_0x5c8aed(_0x1743fa[_0x7012('0xe')](0x1f4,_0x424e9e['message']));});});};
\ No newline at end of file
index 4667de7..994e9a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x190663,_0x5e37cb){var _0x51ba81=function(_0x148bb9){while(--_0x148bb9){_0x190663['push'](_0x190663['shift']());}};_0x51ba81(++_0x5e37cb);}(_0xadb5,0xad));var _0x5adb=function(_0x5d4226,_0x46f5ec){_0x5d4226=_0x5d4226-0x0;var _0x537687=_0xadb5[_0x5d4226];return _0x537687;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router;
\ No newline at end of file
+var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0xc4a640,_0x4adac8){var _0x181964=function(_0x170219){while(--_0x170219){_0xc4a640['push'](_0xc4a640['shift']());}};_0x181964(++_0x4adac8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router;
\ No newline at end of file
index 91a0aa0..590d9c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x054f=['sequelize','exports','ENUM','Task','Case','contact','lead','account_contact_lead','account','contact_lead','STRING'];(function(_0x4cee4b,_0x1dfff3){var _0x4d891d=function(_0x3722ba){while(--_0x3722ba){_0x4cee4b['push'](_0x4cee4b['shift']());}};_0x4d891d(++_0x1dfff3);}(_0x054f,0x181));var _0xf054=function(_0x457200,_0x35b699){_0x457200=_0x457200-0x0;var _0x1072da=_0x054f[_0x457200];return _0x1072da;};'use strict';var Sequelize=require(_0xf054('0x0'));module[_0xf054('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xf054('0x2')](_0xf054('0x3'),_0xf054('0x4')),'defaultValue':_0xf054('0x3')},'moduleSearch':{'type':Sequelize[_0xf054('0x2')]('contact_lead',_0xf054('0x5'),_0xf054('0x6'),_0xf054('0x7'),_0xf054('0x8')),'defaultValue':_0xf054('0x9')},'moduleCreate':{'type':Sequelize[_0xf054('0x2')]('nothing',_0xf054('0x5'),_0xf054('0x6'),_0xf054('0x8')),'defaultValue':_0xf054('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xf054('0xa')]},'additionalSearchContact':{'type':Sequelize[_0xf054('0xa')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x235a=['account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact','lead'];(function(_0x46cff2,_0x3deb25){var _0x52f643=function(_0x4c486c){while(--_0x4c486c){_0x46cff2['push'](_0x46cff2['shift']());}};_0x52f643(++_0x3deb25);}(_0x235a,0x1ef));var _0xa235=function(_0x22283c,_0x20eca5){_0x22283c=_0x22283c-0x0;var _0x19d6e0=_0x235a[_0x22283c];return _0x19d6e0;};'use strict';var Sequelize=require(_0xa235('0x0'));module[_0xa235('0x1')]={'name':{'type':Sequelize[_0xa235('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa235('0x3')]('Task',_0xa235('0x4')),'defaultValue':_0xa235('0x5')},'moduleSearch':{'type':Sequelize[_0xa235('0x3')](_0xa235('0x6'),_0xa235('0x7'),_0xa235('0x8'),_0xa235('0x9'),_0xa235('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xa235('0x3')](_0xa235('0xb'),_0xa235('0x7'),_0xa235('0x8'),'account'),'defaultValue':_0xa235('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xa235('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 04f61d2..58cd601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4379=['where','pick','filter','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','include','findAll','show','params','filters','catch','create','body','find','destroy','getFields','hasOwnProperty','getSubjects','findOne','SalesforceField','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','save','update','then','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x4379,0x1e6));var _0x9437=function(_0x4265af,_0x19ab94){_0x4265af=_0x4265af-0x0;var _0x499671=_0x4379[_0x4265af];return _0x499671;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9437('0x0'));var jsonpatch=require(_0x9437('0x1'));var rp=require(_0x9437('0x2'));var moment=require(_0x9437('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9437('0x4'));var util=require(_0x9437('0x5'));var path=require(_0x9437('0x6'));var sox=require(_0x9437('0x7'));var csv=require(_0x9437('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9437('0x9'));var _=require('lodash');var squel=require(_0x9437('0xa'));var crypto=require(_0x9437('0xb'));var jsforce=require(_0x9437('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9437('0x8'));var querystring=require(_0x9437('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9437('0xe'));var qs=require(_0x9437('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9437('0x10'));var logger=require(_0x9437('0x11'))(_0x9437('0x12'));var utils=require('../../config/utils');var config=require(_0x9437('0x13'));var licenseUtil=require(_0x9437('0x14'));var db=require(_0x9437('0x15'))['db'];function respondWithStatusCode(_0x16de8f,_0x58276e){_0x58276e=_0x58276e||0xcc;return function(_0x29c60b){if(_0x29c60b){return _0x16de8f['sendStatus'](_0x58276e);}return _0x16de8f['status'](_0x58276e)['end']();};}function respondWithResult(_0x17a73a,_0x126772){_0x126772=_0x126772||0xc8;return function(_0x3ba574){if(_0x3ba574){return _0x17a73a[_0x9437('0x16')](_0x126772)[_0x9437('0x17')](_0x3ba574);}};}function respondWithFilteredResult(_0x4bdc58,_0xf00dcc){return function(_0x5868c4){if(_0x5868c4){var _0x472980=typeof _0xf00dcc['offset']===_0x9437('0x18')&&typeof _0xf00dcc['limit']===_0x9437('0x18');var _0x16aa97=_0x5868c4[_0x9437('0x19')];var _0x31b6b7=_0x472980?0x0:_0xf00dcc[_0x9437('0x1a')];var _0x139b7b=_0x472980?_0x5868c4['count']:_0xf00dcc[_0x9437('0x1a')]+_0xf00dcc[_0x9437('0x1b')];var _0x4dda92;if(_0x139b7b>=_0x16aa97){_0x139b7b=_0x16aa97;_0x4dda92=0xc8;}else{_0x4dda92=0xce;}_0x4bdc58[_0x9437('0x16')](_0x4dda92);return _0x4bdc58['set'](_0x9437('0x1c'),_0x31b6b7+'-'+_0x139b7b+'/'+_0x16aa97)[_0x9437('0x17')](_0x5868c4);}return null;};}function patchUpdates(_0x217197){return function(_0x538c83){try{jsonpatch[_0x9437('0x1d')](_0x538c83,_0x217197,!![]);}catch(_0x5bcb26){return BPromise['reject'](_0x5bcb26);}return _0x538c83[_0x9437('0x1e')]();};}function saveUpdates(_0x387de3,_0xd55408){return function(_0x3044aa){if(_0x3044aa){return _0x3044aa[_0x9437('0x1f')](_0x387de3)[_0x9437('0x20')](function(_0x2de1cc){return _0x2de1cc;});}return null;};}function removeEntity(_0x315516,_0x526bde){return function(_0x4be545){if(_0x4be545){return _0x4be545['destroy']()[_0x9437('0x20')](function(){_0x315516[_0x9437('0x16')](0xcc)[_0x9437('0x21')]();});}};}function handleEntityNotFound(_0x4bff85,_0xcf9c7a){return function(_0x5e0b85){if(!_0x5e0b85){_0x4bff85[_0x9437('0x22')](0x194);}return _0x5e0b85;};}function handleError(_0x50b269,_0x41fa3b){_0x41fa3b=_0x41fa3b||0x1f4;return function(_0x3de742){logger[_0x9437('0x23')](_0x3de742['stack']);if(_0x3de742[_0x9437('0x24')]){delete _0x3de742[_0x9437('0x24')];}_0x50b269[_0x9437('0x16')](_0x41fa3b)[_0x9437('0x25')](_0x3de742);};}exports[_0x9437('0x26')]=function(_0x53e348,_0x256725){var _0xc5c226={},_0x58ffd4={},_0x151013={'count':0x0,'rows':[]};var _0x40ef83=_[_0x9437('0x27')](db['SalesforceConfiguration'][_0x9437('0x28')],function(_0x4351d5){return{'name':_0x4351d5[_0x9437('0x29')],'type':_0x4351d5[_0x9437('0x2a')]['key']};});_0x58ffd4[_0x9437('0x2b')]=_[_0x9437('0x27')](_0x40ef83,_0x9437('0x24'));_0x58ffd4[_0x9437('0x2c')]=_[_0x9437('0x2d')](_0x53e348[_0x9437('0x2c')]);_0x58ffd4['filters']=_['intersection'](_0x58ffd4[_0x9437('0x2b')],_0x58ffd4['query']);_0xc5c226[_0x9437('0x2e')]=_[_0x9437('0x2f')](_0x58ffd4['model'],qs[_0x9437('0x30')](_0x53e348['query'][_0x9437('0x30')]));_0xc5c226[_0x9437('0x2e')]=_0xc5c226[_0x9437('0x2e')][_0x9437('0x31')]?_0xc5c226['attributes']:_0x58ffd4[_0x9437('0x2b')];if(!_0x53e348[_0x9437('0x2c')]['hasOwnProperty'](_0x9437('0x32'))){_0xc5c226[_0x9437('0x1b')]=qs[_0x9437('0x1b')](_0x53e348[_0x9437('0x2c')][_0x9437('0x1b')]);_0xc5c226[_0x9437('0x1a')]=qs['offset'](_0x53e348[_0x9437('0x2c')][_0x9437('0x1a')]);}_0xc5c226[_0x9437('0x33')]=qs['sort'](_0x53e348[_0x9437('0x2c')][_0x9437('0x34')]);_0xc5c226[_0x9437('0x35')]=qs['filters'](_[_0x9437('0x36')](_0x53e348[_0x9437('0x2c')],_0x58ffd4['filters']),_0x40ef83);if(_0x53e348['query'][_0x9437('0x37')]){_0xc5c226[_0x9437('0x35')]=_['merge'](_0xc5c226['where'],{'$or':_[_0x9437('0x27')](_0x40ef83,function(_0x4213bb){if(_0x4213bb[_0x9437('0x2a')]!==_0x9437('0x38')){var _0x519deb={};_0x519deb[_0x4213bb[_0x9437('0x24')]]={'$like':'%'+_0x53e348[_0x9437('0x2c')][_0x9437('0x37')]+'%'};return _0x519deb;}})});}_0xc5c226=_[_0x9437('0x39')]({},_0xc5c226,_0x53e348[_0x9437('0x3a')]);var _0x152211={'where':_0xc5c226[_0x9437('0x35')]};return db[_0x9437('0x3b')]['count'](_0x152211)[_0x9437('0x20')](function(_0x137fa5){_0x151013[_0x9437('0x19')]=_0x137fa5;if(_0x53e348[_0x9437('0x2c')][_0x9437('0x3c')]){_0xc5c226[_0x9437('0x3d')]=[{'all':!![]}];}return db[_0x9437('0x3b')][_0x9437('0x3e')](_0xc5c226);})[_0x9437('0x20')](function(_0xb2e396){_0x151013['rows']=_0xb2e396;return _0x151013;})[_0x9437('0x20')](respondWithFilteredResult(_0x256725,_0xc5c226))['catch'](handleError(_0x256725,null));};exports[_0x9437('0x3f')]=function(_0x1fdeff,_0x42520b){var _0xe41095={'raw':![],'where':{'id':_0x1fdeff[_0x9437('0x40')]['id']}},_0x2f07c4={};_0x2f07c4['model']=_[_0x9437('0x2d')](db[_0x9437('0x3b')][_0x9437('0x28')]);_0x2f07c4[_0x9437('0x2c')]=_[_0x9437('0x2d')](_0x1fdeff[_0x9437('0x2c')]);_0x2f07c4[_0x9437('0x41')]=_[_0x9437('0x2f')](_0x2f07c4['model'],_0x2f07c4['query']);_0xe41095[_0x9437('0x2e')]=_[_0x9437('0x2f')](_0x2f07c4[_0x9437('0x2b')],qs['fields'](_0x1fdeff[_0x9437('0x2c')][_0x9437('0x30')]));_0xe41095[_0x9437('0x2e')]=_0xe41095[_0x9437('0x2e')][_0x9437('0x31')]?_0xe41095['attributes']:_0x2f07c4[_0x9437('0x2b')];if(_0x1fdeff[_0x9437('0x2c')]['includeAll']){_0xe41095[_0x9437('0x3d')]=[{'all':!![]}];}_0xe41095=_[_0x9437('0x39')]({},_0xe41095,_0x1fdeff[_0x9437('0x3a')]);return db['SalesforceConfiguration']['find'](_0xe41095)[_0x9437('0x20')](handleEntityNotFound(_0x42520b,null))[_0x9437('0x20')](respondWithResult(_0x42520b,null))[_0x9437('0x42')](handleError(_0x42520b,null));};exports['create']=function(_0x3a426e,_0x2148f4){return db['SalesforceConfiguration'][_0x9437('0x43')](_0x3a426e[_0x9437('0x44')],{})[_0x9437('0x20')](respondWithResult(_0x2148f4,0xc9))[_0x9437('0x42')](handleError(_0x2148f4,null));};exports[_0x9437('0x1f')]=function(_0x4b37ed,_0x2289be){if(_0x4b37ed[_0x9437('0x44')]['id']){delete _0x4b37ed['body']['id'];}return db['SalesforceConfiguration'][_0x9437('0x45')]({'where':{'id':_0x4b37ed[_0x9437('0x40')]['id']}})['then'](handleEntityNotFound(_0x2289be,null))[_0x9437('0x20')](saveUpdates(_0x4b37ed[_0x9437('0x44')],null))[_0x9437('0x20')](respondWithResult(_0x2289be,null))[_0x9437('0x42')](handleError(_0x2289be,null));};exports[_0x9437('0x46')]=function(_0x45ea40,_0x14b9cc){return db[_0x9437('0x3b')]['find']({'where':{'id':_0x45ea40[_0x9437('0x40')]['id']}})[_0x9437('0x20')](handleEntityNotFound(_0x14b9cc,null))['then'](removeEntity(_0x14b9cc,null))[_0x9437('0x42')](handleError(_0x14b9cc,null));};exports['getFields']=function(_0x25eb54,_0x2ace6a,_0x26b501){var _0x7088d2={};var _0x475ceb={};var _0x401146;var _0x19f2f1;return db[_0x9437('0x3b')]['findOne']({'where':{'id':_0x25eb54['params']['id']}})['then'](handleEntityNotFound(_0x2ace6a,null))['then'](function(_0x4f60af){if(_0x4f60af){_0x401146=_0x4f60af;_0x475ceb[_0x9437('0x2b')]=_[_0x9437('0x2d')](db['SalesforceField']['rawAttributes']);_0x475ceb[_0x9437('0x2c')]=_[_0x9437('0x2d')](_0x25eb54[_0x9437('0x2c')]);_0x475ceb[_0x9437('0x41')]=_[_0x9437('0x2f')](_0x475ceb[_0x9437('0x2b')],_0x475ceb[_0x9437('0x2c')]);_0x7088d2[_0x9437('0x2e')]=_[_0x9437('0x2f')](_0x475ceb[_0x9437('0x2b')],qs[_0x9437('0x30')](_0x25eb54[_0x9437('0x2c')]['fields']));_0x7088d2['attributes']=_0x7088d2[_0x9437('0x2e')][_0x9437('0x31')]?_0x7088d2['attributes']:_0x475ceb[_0x9437('0x2b')];_0x7088d2[_0x9437('0x33')]=qs[_0x9437('0x34')](_0x25eb54['query'][_0x9437('0x34')]);_0x7088d2[_0x9437('0x35')]=qs[_0x9437('0x41')](_['pick'](_0x25eb54['query'],_0x475ceb[_0x9437('0x41')]));if(_0x25eb54[_0x9437('0x2c')]['filter']){_0x7088d2['where']=_[_0x9437('0x39')](_0x7088d2['where'],{'$or':_[_0x9437('0x27')](_0x7088d2['attributes'],function(_0x3d4607){var _0x57f058={};_0x57f058[_0x3d4607]={'$like':'%'+_0x25eb54[_0x9437('0x2c')][_0x9437('0x37')]+'%'};return _0x57f058;})});}_0x7088d2=_[_0x9437('0x39')]({},_0x7088d2,_0x25eb54[_0x9437('0x3a')]);return _0x401146[_0x9437('0x47')](_0x7088d2);}})[_0x9437('0x20')](function(_0x547a28){if(_0x547a28){_0x19f2f1=_0x547a28[_0x9437('0x31')];if(!_0x25eb54['query'][_0x9437('0x48')](_0x9437('0x32'))){_0x7088d2[_0x9437('0x1b')]=qs[_0x9437('0x1b')](_0x25eb54[_0x9437('0x2c')]['limit']);_0x7088d2['offset']=qs[_0x9437('0x1a')](_0x25eb54[_0x9437('0x2c')][_0x9437('0x1a')]);}return _0x401146['getFields'](_0x7088d2);}})[_0x9437('0x20')](function(_0x15ec92){if(_0x15ec92){return _0x15ec92?{'count':_0x19f2f1,'rows':_0x15ec92}:null;}})[_0x9437('0x20')](respondWithResult(_0x2ace6a,null))[_0x9437('0x42')](handleError(_0x2ace6a,null));};exports[_0x9437('0x49')]=function(_0x457c2c,_0x2564bd,_0x153ca6){var _0x1e5f97={};var _0x10a7a1={};var _0x291902;var _0x5731c2;return db['SalesforceConfiguration'][_0x9437('0x4a')]({'where':{'id':_0x457c2c['params']['id']}})[_0x9437('0x20')](handleEntityNotFound(_0x2564bd,null))[_0x9437('0x20')](function(_0x2dbeb4){if(_0x2dbeb4){_0x291902=_0x2dbeb4;_0x10a7a1[_0x9437('0x2b')]=_['keys'](db[_0x9437('0x4b')]['rawAttributes']);_0x10a7a1[_0x9437('0x2c')]=_[_0x9437('0x2d')](_0x457c2c[_0x9437('0x2c')]);_0x10a7a1[_0x9437('0x41')]=_[_0x9437('0x2f')](_0x10a7a1[_0x9437('0x2b')],_0x10a7a1[_0x9437('0x2c')]);_0x1e5f97[_0x9437('0x2e')]=_[_0x9437('0x2f')](_0x10a7a1[_0x9437('0x2b')],qs[_0x9437('0x30')](_0x457c2c['query'][_0x9437('0x30')]));_0x1e5f97[_0x9437('0x2e')]=_0x1e5f97[_0x9437('0x2e')][_0x9437('0x31')]?_0x1e5f97[_0x9437('0x2e')]:_0x10a7a1[_0x9437('0x2b')];_0x1e5f97[_0x9437('0x33')]=qs[_0x9437('0x34')](_0x457c2c[_0x9437('0x2c')][_0x9437('0x34')]);_0x1e5f97[_0x9437('0x35')]=qs[_0x9437('0x41')](_[_0x9437('0x36')](_0x457c2c[_0x9437('0x2c')],_0x10a7a1[_0x9437('0x41')]));if(_0x457c2c[_0x9437('0x2c')][_0x9437('0x37')]){_0x1e5f97[_0x9437('0x35')]=_['merge'](_0x1e5f97[_0x9437('0x35')],{'$or':_[_0x9437('0x27')](_0x1e5f97['attributes'],function(_0x5d72c7){var _0x109b79={};_0x109b79[_0x5d72c7]={'$like':'%'+_0x457c2c[_0x9437('0x2c')]['filter']+'%'};return _0x109b79;})});}_0x1e5f97=_[_0x9437('0x39')]({},_0x1e5f97,_0x457c2c['options']);return _0x291902[_0x9437('0x49')](_0x1e5f97);}})[_0x9437('0x20')](function(_0x5ca569){if(_0x5ca569){_0x5731c2=_0x5ca569[_0x9437('0x31')];if(!_0x457c2c['query'][_0x9437('0x48')](_0x9437('0x32'))){_0x1e5f97[_0x9437('0x1b')]=qs[_0x9437('0x1b')](_0x457c2c[_0x9437('0x2c')][_0x9437('0x1b')]);_0x1e5f97['offset']=qs[_0x9437('0x1a')](_0x457c2c[_0x9437('0x2c')][_0x9437('0x1a')]);}return _0x291902[_0x9437('0x49')](_0x1e5f97);}})['then'](function(_0x317df0){if(_0x317df0){return _0x317df0?{'count':_0x5731c2,'rows':_0x317df0}:null;}})['then'](respondWithResult(_0x2564bd,null))['catch'](handleError(_0x2564bd,null));};exports[_0x9437('0x4c')]=function(_0x5f057a,_0x23b0f1,_0x93ad1a){var _0x5d669f={};var _0x229c52={};var _0x3dcce3;var _0x2063a9;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x5f057a[_0x9437('0x40')]['id']}})[_0x9437('0x20')](handleEntityNotFound(_0x23b0f1,null))['then'](function(_0x33a983){if(_0x33a983){_0x3dcce3=_0x33a983;_0x229c52[_0x9437('0x2b')]=_[_0x9437('0x2d')](db[_0x9437('0x4b')]['rawAttributes']);_0x229c52[_0x9437('0x2c')]=_[_0x9437('0x2d')](_0x5f057a[_0x9437('0x2c')]);_0x229c52[_0x9437('0x41')]=_[_0x9437('0x2f')](_0x229c52[_0x9437('0x2b')],_0x229c52[_0x9437('0x2c')]);_0x5d669f[_0x9437('0x2e')]=_[_0x9437('0x2f')](_0x229c52['model'],qs['fields'](_0x5f057a[_0x9437('0x2c')][_0x9437('0x30')]));_0x5d669f[_0x9437('0x2e')]=_0x5d669f['attributes'][_0x9437('0x31')]?_0x5d669f['attributes']:_0x229c52[_0x9437('0x2b')];_0x5d669f['order']=qs[_0x9437('0x34')](_0x5f057a[_0x9437('0x2c')][_0x9437('0x34')]);_0x5d669f[_0x9437('0x35')]=qs[_0x9437('0x41')](_[_0x9437('0x36')](_0x5f057a[_0x9437('0x2c')],_0x229c52['filters']));if(_0x5f057a['query']['filter']){_0x5d669f['where']=_['merge'](_0x5d669f[_0x9437('0x35')],{'$or':_[_0x9437('0x27')](_0x5d669f[_0x9437('0x2e')],function(_0x4431cc){var _0x219b4a={};_0x219b4a[_0x4431cc]={'$like':'%'+_0x5f057a['query'][_0x9437('0x37')]+'%'};return _0x219b4a;})});}_0x5d669f=_['merge']({},_0x5d669f,_0x5f057a[_0x9437('0x3a')]);return _0x3dcce3['getDescriptions'](_0x5d669f);}})[_0x9437('0x20')](function(_0x52a232){if(_0x52a232){_0x2063a9=_0x52a232['length'];if(!_0x5f057a[_0x9437('0x2c')][_0x9437('0x48')]('nolimit')){_0x5d669f['limit']=qs[_0x9437('0x1b')](_0x5f057a['query'][_0x9437('0x1b')]);_0x5d669f['offset']=qs[_0x9437('0x1a')](_0x5f057a[_0x9437('0x2c')]['offset']);}return _0x3dcce3[_0x9437('0x4c')](_0x5d669f);}})[_0x9437('0x20')](function(_0x2ca47e){if(_0x2ca47e){return _0x2ca47e?{'count':_0x2063a9,'rows':_0x2ca47e}:null;}})['then'](respondWithResult(_0x23b0f1,null))[_0x9437('0x42')](handleError(_0x23b0f1,null));};
\ No newline at end of file
+var _0x7573=['query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','rawAttributes','keys','find','create','body','update','getFields','findOne','params','fields','filter','nolimit','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','SalesforceConfiguration','fieldName','type','model'];(function(_0x421d1f,_0x103891){var _0x4228bf=function(_0x4e30fc){while(--_0x4e30fc){_0x421d1f['push'](_0x421d1f['shift']());}};_0x4228bf(++_0x103891);}(_0x7573,0x72));var _0x3757=function(_0x35ca40,_0x271bc6){_0x35ca40=_0x35ca40-0x0;var _0x105ef7=_0x7573[_0x35ca40];return _0x105ef7;};'use strict';var emlformat=require(_0x3757('0x0'));var rimraf=require(_0x3757('0x1'));var zipdir=require(_0x3757('0x2'));var jsonpatch=require(_0x3757('0x3'));var rp=require(_0x3757('0x4'));var moment=require(_0x3757('0x5'));var BPromise=require(_0x3757('0x6'));var Mustache=require(_0x3757('0x7'));var util=require(_0x3757('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3757('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3757('0xa'));var _=require('lodash');var squel=require(_0x3757('0xb'));var crypto=require(_0x3757('0xc'));var jsforce=require(_0x3757('0xd'));var deskjs=require(_0x3757('0xe'));var toCsv=require(_0x3757('0x9'));var querystring=require(_0x3757('0xf'));var Papa=require(_0x3757('0x10'));var Redis=require(_0x3757('0x11'));var authService=require(_0x3757('0x12'));var qs=require(_0x3757('0x13'));var as=require(_0x3757('0x14'));var hardwareService=require(_0x3757('0x15'));var logger=require(_0x3757('0x16'))(_0x3757('0x17'));var utils=require(_0x3757('0x18'));var config=require(_0x3757('0x19'));var licenseUtil=require(_0x3757('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x92391d,_0x587826){_0x587826=_0x587826||0xcc;return function(_0x154021){if(_0x154021){return _0x92391d[_0x3757('0x1b')](_0x587826);}return _0x92391d[_0x3757('0x1c')](_0x587826)[_0x3757('0x1d')]();};}function respondWithResult(_0x1d9c26,_0x5a18b5){_0x5a18b5=_0x5a18b5||0xc8;return function(_0x487b5b){if(_0x487b5b){return _0x1d9c26[_0x3757('0x1c')](_0x5a18b5)[_0x3757('0x1e')](_0x487b5b);}};}function respondWithFilteredResult(_0x4e864f,_0x548c76){return function(_0x5499ef){if(_0x5499ef){var _0x213245=typeof _0x548c76['offset']===_0x3757('0x1f')&&typeof _0x548c76['limit']==='undefined';var _0x5b1014=_0x5499ef[_0x3757('0x20')];var _0x2fe934=_0x213245?0x0:_0x548c76['offset'];var _0x59d0d5=_0x213245?_0x5499ef[_0x3757('0x20')]:_0x548c76[_0x3757('0x21')]+_0x548c76[_0x3757('0x22')];var _0x1cab70;if(_0x59d0d5>=_0x5b1014){_0x59d0d5=_0x5b1014;_0x1cab70=0xc8;}else{_0x1cab70=0xce;}_0x4e864f[_0x3757('0x1c')](_0x1cab70);return _0x4e864f[_0x3757('0x23')](_0x3757('0x24'),_0x2fe934+'-'+_0x59d0d5+'/'+_0x5b1014)[_0x3757('0x1e')](_0x5499ef);}return null;};}function patchUpdates(_0x5ec0d1){return function(_0x2a3218){try{jsonpatch[_0x3757('0x25')](_0x2a3218,_0x5ec0d1,!![]);}catch(_0x4076e9){return BPromise[_0x3757('0x26')](_0x4076e9);}return _0x2a3218[_0x3757('0x27')]();};}function saveUpdates(_0x427f63,_0x2ea7dc){return function(_0x448121){if(_0x448121){return _0x448121['update'](_0x427f63)['then'](function(_0x8f4693){return _0x8f4693;});}return null;};}function removeEntity(_0x4ee245,_0x57550b){return function(_0xa61b5c){if(_0xa61b5c){return _0xa61b5c['destroy']()[_0x3757('0x28')](function(){_0x4ee245['status'](0xcc)[_0x3757('0x1d')]();});}};}function handleEntityNotFound(_0x4f1983,_0x28cc96){return function(_0x3cb7dc){if(!_0x3cb7dc){_0x4f1983[_0x3757('0x1b')](0x194);}return _0x3cb7dc;};}function handleError(_0x30c0db,_0x4fb277){_0x4fb277=_0x4fb277||0x1f4;return function(_0x2f9bbf){logger[_0x3757('0x29')](_0x2f9bbf[_0x3757('0x2a')]);if(_0x2f9bbf['name']){delete _0x2f9bbf[_0x3757('0x2b')];}_0x30c0db['status'](_0x4fb277)['send'](_0x2f9bbf);};}exports[_0x3757('0x2c')]=function(_0x40c657,_0x49fae0){var _0x3260e0={},_0x4baab2={},_0x262a58={'count':0x0,'rows':[]};var _0x3c8ef8=_[_0x3757('0x2d')](db[_0x3757('0x2e')]['rawAttributes'],function(_0x22d845){return{'name':_0x22d845[_0x3757('0x2f')],'type':_0x22d845[_0x3757('0x30')]['key']};});_0x4baab2[_0x3757('0x31')]=_[_0x3757('0x2d')](_0x3c8ef8,'name');_0x4baab2[_0x3757('0x32')]=_['keys'](_0x40c657[_0x3757('0x32')]);_0x4baab2[_0x3757('0x33')]=_[_0x3757('0x34')](_0x4baab2[_0x3757('0x31')],_0x4baab2['query']);_0x3260e0[_0x3757('0x35')]=_[_0x3757('0x34')](_0x4baab2[_0x3757('0x31')],qs['fields'](_0x40c657[_0x3757('0x32')]['fields']));_0x3260e0[_0x3757('0x35')]=_0x3260e0['attributes'][_0x3757('0x36')]?_0x3260e0['attributes']:_0x4baab2[_0x3757('0x31')];if(!_0x40c657['query'][_0x3757('0x37')]('nolimit')){_0x3260e0[_0x3757('0x22')]=qs[_0x3757('0x22')](_0x40c657['query']['limit']);_0x3260e0['offset']=qs['offset'](_0x40c657[_0x3757('0x32')][_0x3757('0x21')]);}_0x3260e0[_0x3757('0x38')]=qs[_0x3757('0x39')](_0x40c657[_0x3757('0x32')][_0x3757('0x39')]);_0x3260e0[_0x3757('0x3a')]=qs[_0x3757('0x33')](_[_0x3757('0x3b')](_0x40c657[_0x3757('0x32')],_0x4baab2[_0x3757('0x33')]),_0x3c8ef8);if(_0x40c657[_0x3757('0x32')]['filter']){_0x3260e0['where']=_[_0x3757('0x3c')](_0x3260e0['where'],{'$or':_[_0x3757('0x2d')](_0x3c8ef8,function(_0x47993c){if(_0x47993c[_0x3757('0x30')]!=='VIRTUAL'){var _0x1e6efd={};_0x1e6efd[_0x47993c[_0x3757('0x2b')]]={'$like':'%'+_0x40c657[_0x3757('0x32')]['filter']+'%'};return _0x1e6efd;}})});}_0x3260e0=_[_0x3757('0x3c')]({},_0x3260e0,_0x40c657[_0x3757('0x3d')]);var _0x45f050={'where':_0x3260e0[_0x3757('0x3a')]};return db['SalesforceConfiguration'][_0x3757('0x20')](_0x45f050)['then'](function(_0x446984){_0x262a58[_0x3757('0x20')]=_0x446984;if(_0x40c657['query'][_0x3757('0x3e')]){_0x3260e0[_0x3757('0x3f')]=[{'all':!![]}];}return db[_0x3757('0x2e')][_0x3757('0x40')](_0x3260e0);})['then'](function(_0x3fd3fd){_0x262a58['rows']=_0x3fd3fd;return _0x262a58;})[_0x3757('0x28')](respondWithFilteredResult(_0x49fae0,_0x3260e0))[_0x3757('0x41')](handleError(_0x49fae0,null));};exports[_0x3757('0x42')]=function(_0x1860a4,_0x4b15c6){var _0x5e0927={'raw':![],'where':{'id':_0x1860a4['params']['id']}},_0x163a65={};_0x163a65['model']=_['keys'](db[_0x3757('0x2e')][_0x3757('0x43')]);_0x163a65['query']=_[_0x3757('0x44')](_0x1860a4['query']);_0x163a65[_0x3757('0x33')]=_[_0x3757('0x34')](_0x163a65[_0x3757('0x31')],_0x163a65[_0x3757('0x32')]);_0x5e0927[_0x3757('0x35')]=_['intersection'](_0x163a65[_0x3757('0x31')],qs['fields'](_0x1860a4[_0x3757('0x32')]['fields']));_0x5e0927[_0x3757('0x35')]=_0x5e0927[_0x3757('0x35')][_0x3757('0x36')]?_0x5e0927[_0x3757('0x35')]:_0x163a65['model'];if(_0x1860a4[_0x3757('0x32')]['includeAll']){_0x5e0927[_0x3757('0x3f')]=[{'all':!![]}];}_0x5e0927=_[_0x3757('0x3c')]({},_0x5e0927,_0x1860a4['options']);return db[_0x3757('0x2e')][_0x3757('0x45')](_0x5e0927)[_0x3757('0x28')](handleEntityNotFound(_0x4b15c6,null))['then'](respondWithResult(_0x4b15c6,null))[_0x3757('0x41')](handleError(_0x4b15c6,null));};exports[_0x3757('0x46')]=function(_0x4e9d25,_0x23cfaf){return db[_0x3757('0x2e')][_0x3757('0x46')](_0x4e9d25[_0x3757('0x47')],{})[_0x3757('0x28')](respondWithResult(_0x23cfaf,0xc9))[_0x3757('0x41')](handleError(_0x23cfaf,null));};exports[_0x3757('0x48')]=function(_0x37bfc4,_0x1c76ba){if(_0x37bfc4[_0x3757('0x47')]['id']){delete _0x37bfc4[_0x3757('0x47')]['id'];}return db[_0x3757('0x2e')]['find']({'where':{'id':_0x37bfc4['params']['id']}})[_0x3757('0x28')](handleEntityNotFound(_0x1c76ba,null))[_0x3757('0x28')](saveUpdates(_0x37bfc4[_0x3757('0x47')],null))[_0x3757('0x28')](respondWithResult(_0x1c76ba,null))['catch'](handleError(_0x1c76ba,null));};exports['destroy']=function(_0x4c1fd0,_0xa7bc6b){return db['SalesforceConfiguration'][_0x3757('0x45')]({'where':{'id':_0x4c1fd0['params']['id']}})[_0x3757('0x28')](handleEntityNotFound(_0xa7bc6b,null))['then'](removeEntity(_0xa7bc6b,null))[_0x3757('0x41')](handleError(_0xa7bc6b,null));};exports[_0x3757('0x49')]=function(_0x13928a,_0x2d658d,_0x37fd51){var _0x43a072={};var _0x3c05e2={};var _0xfc8e4d;var _0x5e9d87;return db[_0x3757('0x2e')][_0x3757('0x4a')]({'where':{'id':_0x13928a[_0x3757('0x4b')]['id']}})[_0x3757('0x28')](handleEntityNotFound(_0x2d658d,null))[_0x3757('0x28')](function(_0x2cf13b){if(_0x2cf13b){_0xfc8e4d=_0x2cf13b;_0x3c05e2['model']=_['keys'](db['SalesforceField'][_0x3757('0x43')]);_0x3c05e2[_0x3757('0x32')]=_[_0x3757('0x44')](_0x13928a[_0x3757('0x32')]);_0x3c05e2['filters']=_[_0x3757('0x34')](_0x3c05e2[_0x3757('0x31')],_0x3c05e2[_0x3757('0x32')]);_0x43a072[_0x3757('0x35')]=_[_0x3757('0x34')](_0x3c05e2[_0x3757('0x31')],qs[_0x3757('0x4c')](_0x13928a[_0x3757('0x32')][_0x3757('0x4c')]));_0x43a072[_0x3757('0x35')]=_0x43a072[_0x3757('0x35')][_0x3757('0x36')]?_0x43a072[_0x3757('0x35')]:_0x3c05e2[_0x3757('0x31')];_0x43a072[_0x3757('0x38')]=qs[_0x3757('0x39')](_0x13928a[_0x3757('0x32')][_0x3757('0x39')]);_0x43a072[_0x3757('0x3a')]=qs[_0x3757('0x33')](_['pick'](_0x13928a['query'],_0x3c05e2[_0x3757('0x33')]));if(_0x13928a['query'][_0x3757('0x4d')]){_0x43a072[_0x3757('0x3a')]=_[_0x3757('0x3c')](_0x43a072[_0x3757('0x3a')],{'$or':_[_0x3757('0x2d')](_0x43a072[_0x3757('0x35')],function(_0x47512e){var _0x330595={};_0x330595[_0x47512e]={'$like':'%'+_0x13928a[_0x3757('0x32')][_0x3757('0x4d')]+'%'};return _0x330595;})});}_0x43a072=_[_0x3757('0x3c')]({},_0x43a072,_0x13928a[_0x3757('0x3d')]);return _0xfc8e4d[_0x3757('0x49')](_0x43a072);}})[_0x3757('0x28')](function(_0x546f6f){if(_0x546f6f){_0x5e9d87=_0x546f6f[_0x3757('0x36')];if(!_0x13928a[_0x3757('0x32')]['hasOwnProperty'](_0x3757('0x4e'))){_0x43a072[_0x3757('0x22')]=qs[_0x3757('0x22')](_0x13928a[_0x3757('0x32')]['limit']);_0x43a072[_0x3757('0x21')]=qs[_0x3757('0x21')](_0x13928a['query'][_0x3757('0x21')]);}return _0xfc8e4d['getFields'](_0x43a072);}})[_0x3757('0x28')](function(_0x141e18){if(_0x141e18){return _0x141e18?{'count':_0x5e9d87,'rows':_0x141e18}:null;}})[_0x3757('0x28')](respondWithResult(_0x2d658d,null))['catch'](handleError(_0x2d658d,null));};exports[_0x3757('0x4f')]=function(_0x477f8f,_0x44f633,_0x5b7dcc){var _0x160680={};var _0x27b9c7={};var _0x8b62de;var _0x26d04d;return db[_0x3757('0x2e')]['findOne']({'where':{'id':_0x477f8f[_0x3757('0x4b')]['id']}})[_0x3757('0x28')](handleEntityNotFound(_0x44f633,null))[_0x3757('0x28')](function(_0x24806f){if(_0x24806f){_0x8b62de=_0x24806f;_0x27b9c7[_0x3757('0x31')]=_[_0x3757('0x44')](db[_0x3757('0x50')][_0x3757('0x43')]);_0x27b9c7[_0x3757('0x32')]=_['keys'](_0x477f8f[_0x3757('0x32')]);_0x27b9c7[_0x3757('0x33')]=_[_0x3757('0x34')](_0x27b9c7['model'],_0x27b9c7['query']);_0x160680[_0x3757('0x35')]=_[_0x3757('0x34')](_0x27b9c7[_0x3757('0x31')],qs[_0x3757('0x4c')](_0x477f8f[_0x3757('0x32')][_0x3757('0x4c')]));_0x160680[_0x3757('0x35')]=_0x160680['attributes'][_0x3757('0x36')]?_0x160680[_0x3757('0x35')]:_0x27b9c7[_0x3757('0x31')];_0x160680[_0x3757('0x38')]=qs[_0x3757('0x39')](_0x477f8f[_0x3757('0x32')][_0x3757('0x39')]);_0x160680[_0x3757('0x3a')]=qs[_0x3757('0x33')](_['pick'](_0x477f8f['query'],_0x27b9c7[_0x3757('0x33')]));if(_0x477f8f[_0x3757('0x32')][_0x3757('0x4d')]){_0x160680['where']=_[_0x3757('0x3c')](_0x160680[_0x3757('0x3a')],{'$or':_[_0x3757('0x2d')](_0x160680[_0x3757('0x35')],function(_0x813911){var _0x5127db={};_0x5127db[_0x813911]={'$like':'%'+_0x477f8f[_0x3757('0x32')][_0x3757('0x4d')]+'%'};return _0x5127db;})});}_0x160680=_[_0x3757('0x3c')]({},_0x160680,_0x477f8f[_0x3757('0x3d')]);return _0x8b62de[_0x3757('0x4f')](_0x160680);}})[_0x3757('0x28')](function(_0x17884d){if(_0x17884d){_0x26d04d=_0x17884d[_0x3757('0x36')];if(!_0x477f8f[_0x3757('0x32')][_0x3757('0x37')](_0x3757('0x4e'))){_0x160680[_0x3757('0x22')]=qs[_0x3757('0x22')](_0x477f8f[_0x3757('0x32')][_0x3757('0x22')]);_0x160680[_0x3757('0x21')]=qs['offset'](_0x477f8f['query'][_0x3757('0x21')]);}return _0x8b62de['getSubjects'](_0x160680);}})[_0x3757('0x28')](function(_0x509b9a){if(_0x509b9a){return _0x509b9a?{'count':_0x26d04d,'rows':_0x509b9a}:null;}})['then'](respondWithResult(_0x44f633,null))[_0x3757('0x41')](handleError(_0x44f633,null));};exports[_0x3757('0x51')]=function(_0x30d3e1,_0x1b6854,_0x1b3178){var _0x54870e={};var _0x4cd329={};var _0x49396c;var _0x476fd0;return db[_0x3757('0x2e')][_0x3757('0x4a')]({'where':{'id':_0x30d3e1[_0x3757('0x4b')]['id']}})[_0x3757('0x28')](handleEntityNotFound(_0x1b6854,null))[_0x3757('0x28')](function(_0x57d504){if(_0x57d504){_0x49396c=_0x57d504;_0x4cd329['model']=_[_0x3757('0x44')](db[_0x3757('0x50')][_0x3757('0x43')]);_0x4cd329[_0x3757('0x32')]=_[_0x3757('0x44')](_0x30d3e1['query']);_0x4cd329[_0x3757('0x33')]=_[_0x3757('0x34')](_0x4cd329[_0x3757('0x31')],_0x4cd329[_0x3757('0x32')]);_0x54870e[_0x3757('0x35')]=_['intersection'](_0x4cd329[_0x3757('0x31')],qs['fields'](_0x30d3e1[_0x3757('0x32')][_0x3757('0x4c')]));_0x54870e[_0x3757('0x35')]=_0x54870e[_0x3757('0x35')]['length']?_0x54870e[_0x3757('0x35')]:_0x4cd329[_0x3757('0x31')];_0x54870e[_0x3757('0x38')]=qs[_0x3757('0x39')](_0x30d3e1[_0x3757('0x32')][_0x3757('0x39')]);_0x54870e[_0x3757('0x3a')]=qs['filters'](_[_0x3757('0x3b')](_0x30d3e1['query'],_0x4cd329[_0x3757('0x33')]));if(_0x30d3e1[_0x3757('0x32')]['filter']){_0x54870e[_0x3757('0x3a')]=_[_0x3757('0x3c')](_0x54870e[_0x3757('0x3a')],{'$or':_[_0x3757('0x2d')](_0x54870e[_0x3757('0x35')],function(_0x3ed876){var _0x1b0dae={};_0x1b0dae[_0x3ed876]={'$like':'%'+_0x30d3e1['query'][_0x3757('0x4d')]+'%'};return _0x1b0dae;})});}_0x54870e=_[_0x3757('0x3c')]({},_0x54870e,_0x30d3e1[_0x3757('0x3d')]);return _0x49396c[_0x3757('0x51')](_0x54870e);}})[_0x3757('0x28')](function(_0x2f3e74){if(_0x2f3e74){_0x476fd0=_0x2f3e74['length'];if(!_0x30d3e1[_0x3757('0x32')][_0x3757('0x37')](_0x3757('0x4e'))){_0x54870e[_0x3757('0x22')]=qs[_0x3757('0x22')](_0x30d3e1['query'][_0x3757('0x22')]);_0x54870e[_0x3757('0x21')]=qs[_0x3757('0x21')](_0x30d3e1[_0x3757('0x32')]['offset']);}return _0x49396c['getDescriptions'](_0x54870e);}})[_0x3757('0x28')](function(_0x34b87e){if(_0x34b87e){return _0x34b87e?{'count':_0x476fd0,'rows':_0x34b87e}:null;}})[_0x3757('0x28')](respondWithResult(_0x1b6854,null))[_0x3757('0x41')](handleError(_0x1b6854,null));};
\ No newline at end of file
index d89138c..c9c8a8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ad6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash'];(function(_0x84d88b,_0x5ee536){var _0x2d6d56=function(_0x5ac329){while(--_0x5ac329){_0x84d88b['push'](_0x84d88b['shift']());}};_0x2d6d56(++_0x5ee536);}(_0x1ad6,0x1d3));var _0x61ad=function(_0x3d6aba,_0x3a73d0){_0x3d6aba=_0x3d6aba-0x0;var _0x5d2947=_0x1ad6[_0x3d6aba];return _0x5d2947;};'use strict';var _=require(_0x61ad('0x0'));var util=require(_0x61ad('0x1'));var logger=require(_0x61ad('0x2'))(_0x61ad('0x3'));var moment=require(_0x61ad('0x4'));var BPromise=require(_0x61ad('0x5'));var rp=require(_0x61ad('0x6'));var fs=require('fs');var path=require(_0x61ad('0x7'));var rimraf=require(_0x61ad('0x8'));var config=require('../../config/environment');var attributes=require(_0x61ad('0x9'));module[_0x61ad('0xa')]=function(_0x5abb58,_0x5b1e31){return _0x5abb58[_0x61ad('0xb')](_0x61ad('0xc'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe76c=['api','moment','bluebird','path','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x2813e1,_0x5424a6){var _0x83af03=function(_0x1b3e41){while(--_0x1b3e41){_0x2813e1['push'](_0x2813e1['shift']());}};_0x83af03(++_0x5424a6);}(_0xe76c,0x76));var _0xce76=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xe76c[_0x47e549];return _0x251374;};'use strict';var _=require(_0xce76('0x0'));var util=require(_0xce76('0x1'));var logger=require(_0xce76('0x2'))(_0xce76('0x3'));var moment=require(_0xce76('0x4'));var BPromise=require(_0xce76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce76('0x6'));var rimraf=require('rimraf');var config=require(_0xce76('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x59f970,_0x255863){return _0x59f970[_0xce76('0x8')](_0xce76('0x9'),attributes,{'tableName':_0xce76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 007ba84..1b6876b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95ee=['then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x32296c,_0xd5e6ea){var _0x1ec90e=function(_0x1d27c0){while(--_0x1d27c0){_0x32296c['push'](_0x32296c['shift']());}};_0x1ec90e(++_0xd5e6ea);}(_0x95ee,0x6a));var _0xe95e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x95ee[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe95e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe95e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe95e('0x2'))['db'];var utils=require(_0xe95e('0x3'));var logger=require(_0xe95e('0x4'))(_0xe95e('0x5'));var config=require(_0xe95e('0x6'));var jayson=require(_0xe95e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49da28,_0x44de98,_0x17e0aa){return new BPromise(function(_0x5b3ca0,_0x5c064d){return client['request'](_0x49da28,_0x17e0aa)[_0xe95e('0x8')](function(_0x210afb){logger[_0xe95e('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0x44de98,_0xe95e('0xa'));logger[_0xe95e('0xb')](_0xe95e('0xc'),_0x44de98,_0xe95e('0xa'),JSON[_0xe95e('0xd')](_0x210afb));if(_0x210afb[_0xe95e('0xe')]){if(_0x210afb[_0xe95e('0xe')][_0xe95e('0xf')]===0x1f4){logger[_0xe95e('0xe')](_0xe95e('0x10'),_0x44de98,_0x210afb[_0xe95e('0xe')][_0xe95e('0x11')]);return _0x5c064d(_0x210afb[_0xe95e('0xe')]['message']);}logger[_0xe95e('0xe')](_0xe95e('0x10'),_0x44de98,_0x210afb['error'][_0xe95e('0x11')]);return _0x5b3ca0(_0x210afb[_0xe95e('0xe')][_0xe95e('0x11')]);}else{logger[_0xe95e('0x9')](_0xe95e('0x10'),_0x44de98,'request\x20sent');_0x5b3ca0(_0x210afb[_0xe95e('0x12')]['message']);}})['catch'](function(_0xb972cb){logger[_0xe95e('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x44de98,_0xb972cb);_0x5c064d(_0xb972cb);});});}
\ No newline at end of file
+var _0x337a=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x40f5e0,_0x53fa46){var _0x2de0f9=function(_0x436224){while(--_0x436224){_0x40f5e0['push'](_0x40f5e0['shift']());}};_0x2de0f9(++_0x53fa46);}(_0x337a,0x1be));var _0xa337=function(_0x5a3b99,_0x623a91){_0x5a3b99=_0x5a3b99-0x0;var _0x39f8c7=_0x337a[_0x5a3b99];return _0x39f8c7;};'use strict';var _=require(_0xa337('0x0'));var util=require(_0xa337('0x1'));var moment=require(_0xa337('0x2'));var BPromise=require('bluebird');var rs=require(_0xa337('0x3'));var fs=require('fs');var Redis=require(_0xa337('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa337('0x5'));var config=require('../../config/environment');var jayson=require(_0xa337('0x6'));var client=jayson[_0xa337('0x7')][_0xa337('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33f849,_0x5b1651,_0x1aff03){return new BPromise(function(_0x4ca238,_0x31eeb6){return client['request'](_0x33f849,_0x1aff03)[_0xa337('0x9')](function(_0x538ee0){logger[_0xa337('0xa')](_0xa337('0xb'),_0x5b1651,_0xa337('0xc'));logger[_0xa337('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x5b1651,_0xa337('0xc'),JSON[_0xa337('0xe')](_0x538ee0));if(_0x538ee0[_0xa337('0xf')]){if(_0x538ee0[_0xa337('0xf')][_0xa337('0x10')]===0x1f4){logger[_0xa337('0xf')](_0xa337('0xb'),_0x5b1651,_0x538ee0[_0xa337('0xf')]['message']);return _0x31eeb6(_0x538ee0['error'][_0xa337('0x11')]);}logger[_0xa337('0xf')](_0xa337('0xb'),_0x5b1651,_0x538ee0[_0xa337('0xf')][_0xa337('0x11')]);return _0x4ca238(_0x538ee0[_0xa337('0xf')][_0xa337('0x11')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x5b1651,_0xa337('0xc'));_0x4ca238(_0x538ee0[_0xa337('0x12')][_0xa337('0x11')]);}})[_0xa337('0x13')](function(_0x27469a){logger[_0xa337('0xf')](_0xa337('0xb'),_0x5b1651,_0x27469a);_0x31eeb6(_0x27469a);});});}
\ No newline at end of file
index 61d5917..d6f7212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x460e=['util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','index','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer'];(function(_0x172f3c,_0x38c45e){var _0x3783f2=function(_0x598ce2){while(--_0x598ce2){_0x172f3c['push'](_0x172f3c['shift']());}};_0x3783f2(++_0x38c45e);}(_0x460e,0xa9));var _0xe460=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x460e[_0x10df18];return _0x1f9a1d;};'use strict';var multer=require(_0xe460('0x0'));var util=require(_0xe460('0x1'));var path=require(_0xe460('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe460('0x3')]();var fs_extra=require(_0xe460('0x4'));var auth=require(_0xe460('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe460('0x6'));var controller=require(_0xe460('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe460('0x8')]);router[_0xe460('0x9')](_0xe460('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe460('0xb')](),controller['create']);router[_0xe460('0xc')](_0xe460('0xa'),auth[_0xe460('0xb')](),controller[_0xe460('0xd')]);router[_0xe460('0xe')]('/:id',auth[_0xe460('0xb')](),controller[_0xe460('0xf')]);module[_0xe460('0x10')]=router;
\ No newline at end of file
+var _0x635c=['isAuthenticated','index','show','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get'];(function(_0x3ed108,_0x572697){var _0x5ac7a2=function(_0x2f3ad1){while(--_0x2f3ad1){_0x3ed108['push'](_0x3ed108['shift']());}};_0x5ac7a2(++_0x572697);}(_0x635c,0x14d));var _0xc635=function(_0x1b9437,_0x3f6fb2){_0x1b9437=_0x1b9437-0x0;var _0x33621f=_0x635c[_0x1b9437];return _0x33621f;};'use strict';var multer=require('multer');var util=require(_0xc635('0x0'));var path=require(_0xc635('0x1'));var timeout=require(_0xc635('0x2'));var express=require(_0xc635('0x3'));var router=express[_0xc635('0x4')]();var fs_extra=require(_0xc635('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc635('0x6'));var config=require('../../config/environment');var controller=require(_0xc635('0x7'));router[_0xc635('0x8')]('/',auth[_0xc635('0x9')](),controller[_0xc635('0xa')]);router['get']('/:id',auth[_0xc635('0x9')](),controller[_0xc635('0xb')]);router['post']('/',auth[_0xc635('0x9')](),controller[_0xc635('0xc')]);router[_0xc635('0xd')](_0xc635('0xe'),auth['isAuthenticated'](),controller[_0xc635('0xf')]);router[_0xc635('0x10')]('/:id',auth[_0xc635('0x9')](),controller['destroy']);module[_0xc635('0x11')]=router;
\ No newline at end of file
index 22d556c..c4504f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cbe=['ENUM','string','customVariable','keyValue','STRING','variable','sequelize','exports'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x4cbe,0xb6));var _0xe4cb=function(_0x25ecaf,_0x3e9fc1){_0x25ecaf=_0x25ecaf-0x0;var _0x41ae78=_0x4cbe[_0x25ecaf];return _0x41ae78;};'use strict';var Sequelize=require(_0xe4cb('0x0'));module[_0xe4cb('0x1')]={'type':{'type':Sequelize[_0xe4cb('0x2')](_0xe4cb('0x3'),'variable',_0xe4cb('0x4'),_0xe4cb('0x5'),'picklist'),'defaultValue':_0xe4cb('0x3')},'content':{'type':Sequelize[_0xe4cb('0x6')]},'key':{'type':Sequelize[_0xe4cb('0x6')]},'keyType':{'type':Sequelize[_0xe4cb('0x2')]('string',_0xe4cb('0x7'),_0xe4cb('0x4'))},'keyContent':{'type':Sequelize[_0xe4cb('0x6')]},'idField':{'type':Sequelize[_0xe4cb('0x6')]},'variableName':{'type':Sequelize[_0xe4cb('0x6')]}};
\ No newline at end of file
+var _0x8d76=['string','STRING','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x8d76,0xa2));var _0x68d7=function(_0x181c8e,_0x2a0dc9){_0x181c8e=_0x181c8e-0x0;var _0x3ba7cf=_0x8d76[_0x181c8e];return _0x3ba7cf;};'use strict';var Sequelize=require(_0x68d7('0x0'));module[_0x68d7('0x1')]={'type':{'type':Sequelize[_0x68d7('0x2')]('string',_0x68d7('0x3'),_0x68d7('0x4'),_0x68d7('0x5'),'picklist'),'defaultValue':_0x68d7('0x6')},'content':{'type':Sequelize[_0x68d7('0x7')]},'key':{'type':Sequelize[_0x68d7('0x7')]},'keyType':{'type':Sequelize[_0x68d7('0x2')](_0x68d7('0x6'),_0x68d7('0x3'),_0x68d7('0x4'))},'keyContent':{'type':Sequelize[_0x68d7('0x7')]},'idField':{'type':Sequelize[_0x68d7('0x7')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 629c3e7..3e59490 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08b9=['eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','map','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','params','find'];(function(_0x4b6f09,_0x5083b6){var _0xf67056=function(_0x2367e3){while(--_0x2367e3){_0x4b6f09['push'](_0x4b6f09['shift']());}};_0xf67056(++_0x5083b6);}(_0x08b9,0x177));var _0x908b=function(_0x1049f6,_0x546990){_0x1049f6=_0x1049f6-0x0;var _0x21a403=_0x08b9[_0x1049f6];return _0x21a403;};'use strict';var emlformat=require(_0x908b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x908b('0x1'));var rp=require('request-promise');var moment=require(_0x908b('0x2'));var BPromise=require(_0x908b('0x3'));var Mustache=require(_0x908b('0x4'));var util=require(_0x908b('0x5'));var path=require(_0x908b('0x6'));var sox=require(_0x908b('0x7'));var csv=require(_0x908b('0x8'));var ejs=require(_0x908b('0x9'));var fs=require('fs');var fs_extra=require(_0x908b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x908b('0xb'));var deskjs=require(_0x908b('0xc'));var toCsv=require(_0x908b('0x8'));var querystring=require(_0x908b('0xd'));var Papa=require(_0x908b('0xe'));var Redis=require(_0x908b('0xf'));var authService=require(_0x908b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x908b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x908b('0x12'))(_0x908b('0x13'));var utils=require(_0x908b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x908b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c60ae,_0x4bd3d6){_0x4bd3d6=_0x4bd3d6||0xcc;return function(_0x38df04){if(_0x38df04){return _0x4c60ae[_0x908b('0x16')](_0x4bd3d6);}return _0x4c60ae[_0x908b('0x17')](_0x4bd3d6)[_0x908b('0x18')]();};}function respondWithResult(_0x43f752,_0x1c2735){_0x1c2735=_0x1c2735||0xc8;return function(_0x4934d2){if(_0x4934d2){return _0x43f752[_0x908b('0x17')](_0x1c2735)['json'](_0x4934d2);}};}function respondWithFilteredResult(_0x40db53,_0x659f82){return function(_0x51a049){if(_0x51a049){var _0x2d6249=typeof _0x659f82[_0x908b('0x19')]==='undefined'&&typeof _0x659f82['limit']===_0x908b('0x1a');var _0x4572fd=_0x51a049[_0x908b('0x1b')];var _0x1f5ee7=_0x2d6249?0x0:_0x659f82[_0x908b('0x19')];var _0x109abe=_0x2d6249?_0x51a049[_0x908b('0x1b')]:_0x659f82[_0x908b('0x19')]+_0x659f82[_0x908b('0x1c')];var _0x132348;if(_0x109abe>=_0x4572fd){_0x109abe=_0x4572fd;_0x132348=0xc8;}else{_0x132348=0xce;}_0x40db53[_0x908b('0x17')](_0x132348);return _0x40db53[_0x908b('0x1d')](_0x908b('0x1e'),_0x1f5ee7+'-'+_0x109abe+'/'+_0x4572fd)[_0x908b('0x1f')](_0x51a049);}return null;};}function patchUpdates(_0xafac26){return function(_0x5710eb){try{jsonpatch[_0x908b('0x20')](_0x5710eb,_0xafac26,!![]);}catch(_0x4b4c90){return BPromise[_0x908b('0x21')](_0x4b4c90);}return _0x5710eb[_0x908b('0x22')]();};}function saveUpdates(_0x5f3fd2,_0x3f0325){return function(_0x1f67a7){if(_0x1f67a7){return _0x1f67a7[_0x908b('0x23')](_0x5f3fd2)[_0x908b('0x24')](function(_0x259c27){return _0x259c27;});}return null;};}function removeEntity(_0x2168ff,_0x118647){return function(_0x13c00f){if(_0x13c00f){return _0x13c00f[_0x908b('0x25')]()[_0x908b('0x24')](function(){_0x2168ff[_0x908b('0x17')](0xcc)[_0x908b('0x18')]();});}};}function handleEntityNotFound(_0x183096,_0x1dd3c2){return function(_0x53ed8c){if(!_0x53ed8c){_0x183096['sendStatus'](0x194);}return _0x53ed8c;};}function handleError(_0x54e519,_0x4212be){_0x4212be=_0x4212be||0x1f4;return function(_0x1c3c59){logger[_0x908b('0x26')](_0x1c3c59[_0x908b('0x27')]);if(_0x1c3c59['name']){delete _0x1c3c59['name'];}_0x54e519[_0x908b('0x17')](_0x4212be)[_0x908b('0x28')](_0x1c3c59);};}exports[_0x908b('0x29')]=function(_0x28b3b7,_0x502069){var _0x550b0b={},_0x36ab52={},_0x362a54={'count':0x0,'rows':[]};var _0x98bffe=_['map'](db[_0x908b('0x2a')][_0x908b('0x2b')],function(_0x4d3342){return{'name':_0x4d3342[_0x908b('0x2c')],'type':_0x4d3342[_0x908b('0x2d')][_0x908b('0x2e')]};});_0x36ab52[_0x908b('0x2f')]=_[_0x908b('0x30')](_0x98bffe,_0x908b('0x31'));_0x36ab52[_0x908b('0x32')]=_['keys'](_0x28b3b7['query']);_0x36ab52[_0x908b('0x33')]=_['intersection'](_0x36ab52[_0x908b('0x2f')],_0x36ab52['query']);_0x550b0b[_0x908b('0x34')]=_[_0x908b('0x35')](_0x36ab52['model'],qs[_0x908b('0x36')](_0x28b3b7['query'][_0x908b('0x36')]));_0x550b0b[_0x908b('0x34')]=_0x550b0b[_0x908b('0x34')][_0x908b('0x37')]?_0x550b0b[_0x908b('0x34')]:_0x36ab52[_0x908b('0x2f')];if(!_0x28b3b7[_0x908b('0x32')][_0x908b('0x38')]('nolimit')){_0x550b0b[_0x908b('0x1c')]=qs[_0x908b('0x1c')](_0x28b3b7[_0x908b('0x32')][_0x908b('0x1c')]);_0x550b0b[_0x908b('0x19')]=qs[_0x908b('0x19')](_0x28b3b7['query'][_0x908b('0x19')]);}_0x550b0b[_0x908b('0x39')]=qs[_0x908b('0x3a')](_0x28b3b7[_0x908b('0x32')][_0x908b('0x3a')]);_0x550b0b[_0x908b('0x3b')]=qs[_0x908b('0x33')](_[_0x908b('0x3c')](_0x28b3b7[_0x908b('0x32')],_0x36ab52['filters']),_0x98bffe);if(_0x28b3b7['query'][_0x908b('0x3d')]){_0x550b0b[_0x908b('0x3b')]=_[_0x908b('0x3e')](_0x550b0b[_0x908b('0x3b')],{'$or':_['map'](_0x98bffe,function(_0x46c648){if(_0x46c648[_0x908b('0x2d')]!==_0x908b('0x3f')){var _0x4cdab2={};_0x4cdab2[_0x46c648[_0x908b('0x31')]]={'$like':'%'+_0x28b3b7[_0x908b('0x32')]['filter']+'%'};return _0x4cdab2;}})});}_0x550b0b=_[_0x908b('0x3e')]({},_0x550b0b,_0x28b3b7[_0x908b('0x40')]);var _0x36d425={'where':_0x550b0b[_0x908b('0x3b')]};return db[_0x908b('0x2a')][_0x908b('0x1b')](_0x36d425)[_0x908b('0x24')](function(_0x47ca78){_0x362a54['count']=_0x47ca78;if(_0x28b3b7['query'][_0x908b('0x41')]){_0x550b0b[_0x908b('0x42')]=[{'all':!![]}];}return db[_0x908b('0x2a')][_0x908b('0x43')](_0x550b0b);})[_0x908b('0x24')](function(_0x3c83b3){_0x362a54[_0x908b('0x44')]=_0x3c83b3;return _0x362a54;})[_0x908b('0x24')](respondWithFilteredResult(_0x502069,_0x550b0b))[_0x908b('0x45')](handleError(_0x502069,null));};exports[_0x908b('0x46')]=function(_0x4d5d09,_0x5b438f){var _0x30b09c={'raw':!![],'where':{'id':_0x4d5d09['params']['id']}},_0x59de32={};_0x59de32['model']=_['keys'](db[_0x908b('0x2a')][_0x908b('0x2b')]);_0x59de32[_0x908b('0x32')]=_['keys'](_0x4d5d09[_0x908b('0x32')]);_0x59de32['filters']=_[_0x908b('0x35')](_0x59de32[_0x908b('0x2f')],_0x59de32['query']);_0x30b09c[_0x908b('0x34')]=_[_0x908b('0x35')](_0x59de32[_0x908b('0x2f')],qs['fields'](_0x4d5d09[_0x908b('0x32')]['fields']));_0x30b09c[_0x908b('0x34')]=_0x30b09c[_0x908b('0x34')][_0x908b('0x37')]?_0x30b09c['attributes']:_0x59de32[_0x908b('0x2f')];if(_0x4d5d09[_0x908b('0x32')][_0x908b('0x41')]){_0x30b09c[_0x908b('0x42')]=[{'all':!![]}];}_0x30b09c=_[_0x908b('0x3e')]({},_0x30b09c,_0x4d5d09[_0x908b('0x40')]);return db[_0x908b('0x2a')]['find'](_0x30b09c)['then'](handleEntityNotFound(_0x5b438f,null))[_0x908b('0x24')](respondWithResult(_0x5b438f,null))[_0x908b('0x45')](handleError(_0x5b438f,null));};exports[_0x908b('0x47')]=function(_0x154dcc,_0x23384b){return db[_0x908b('0x2a')]['create'](_0x154dcc['body'],{})[_0x908b('0x24')](respondWithResult(_0x23384b,0xc9))[_0x908b('0x45')](handleError(_0x23384b,null));};exports['update']=function(_0x3dcbd3,_0x12c096){if(_0x3dcbd3['body']['id']){delete _0x3dcbd3[_0x908b('0x48')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x3dcbd3[_0x908b('0x49')]['id']}})[_0x908b('0x24')](handleEntityNotFound(_0x12c096,null))[_0x908b('0x24')](saveUpdates(_0x3dcbd3[_0x908b('0x48')],null))['then'](respondWithResult(_0x12c096,null))[_0x908b('0x45')](handleError(_0x12c096,null));};exports[_0x908b('0x25')]=function(_0x24b8c6,_0x239de0){return db['SalesforceField'][_0x908b('0x4a')]({'where':{'id':_0x24b8c6[_0x908b('0x49')]['id']}})[_0x908b('0x24')](handleEntityNotFound(_0x239de0,null))[_0x908b('0x24')](removeEntity(_0x239de0,null))[_0x908b('0x45')](handleError(_0x239de0,null));};
\ No newline at end of file
+var _0x4267=['../../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','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','SalesforceField','includeAll','findAll','rows','catch','show','params','filters','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x42af3a,_0x2aafb9){var _0x14d099=function(_0x14a06d){while(--_0x14a06d){_0x42af3a['push'](_0x42af3a['shift']());}};_0x14d099(++_0x2aafb9);}(_0x4267,0x170));var _0x7426=function(_0x38b4de,_0x3b2b10){_0x38b4de=_0x38b4de-0x0;var _0x54f3dc=_0x4267[_0x38b4de];return _0x54f3dc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7426('0x0'));var jsonpatch=require(_0x7426('0x1'));var rp=require(_0x7426('0x2'));var moment=require(_0x7426('0x3'));var BPromise=require(_0x7426('0x4'));var Mustache=require('mustache');var util=require(_0x7426('0x5'));var path=require('path');var sox=require(_0x7426('0x6'));var csv=require(_0x7426('0x7'));var ejs=require(_0x7426('0x8'));var fs=require('fs');var fs_extra=require(_0x7426('0x9'));var _=require(_0x7426('0xa'));var squel=require(_0x7426('0xb'));var crypto=require(_0x7426('0xc'));var jsforce=require(_0x7426('0xd'));var deskjs=require(_0x7426('0xe'));var toCsv=require(_0x7426('0x7'));var querystring=require(_0x7426('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7426('0x10'));var qs=require(_0x7426('0x11'));var as=require(_0x7426('0x12'));var hardwareService=require(_0x7426('0x13'));var logger=require(_0x7426('0x14'))(_0x7426('0x15'));var utils=require(_0x7426('0x16'));var config=require(_0x7426('0x17'));var licenseUtil=require(_0x7426('0x18'));var db=require(_0x7426('0x19'))['db'];function respondWithStatusCode(_0x1d09bb,_0x1b2f67){_0x1b2f67=_0x1b2f67||0xcc;return function(_0x2fdbcf){if(_0x2fdbcf){return _0x1d09bb[_0x7426('0x1a')](_0x1b2f67);}return _0x1d09bb[_0x7426('0x1b')](_0x1b2f67)[_0x7426('0x1c')]();};}function respondWithResult(_0x207d75,_0x1811a2){_0x1811a2=_0x1811a2||0xc8;return function(_0x1db212){if(_0x1db212){return _0x207d75[_0x7426('0x1b')](_0x1811a2)[_0x7426('0x1d')](_0x1db212);}};}function respondWithFilteredResult(_0x4f1e77,_0x124344){return function(_0x3c8848){if(_0x3c8848){var _0x3d4272=typeof _0x124344[_0x7426('0x1e')]===_0x7426('0x1f')&&typeof _0x124344[_0x7426('0x20')]===_0x7426('0x1f');var _0x51e0ee=_0x3c8848['count'];var _0x569f04=_0x3d4272?0x0:_0x124344['offset'];var _0x17a6b0=_0x3d4272?_0x3c8848[_0x7426('0x21')]:_0x124344['offset']+_0x124344['limit'];var _0xe0abdd;if(_0x17a6b0>=_0x51e0ee){_0x17a6b0=_0x51e0ee;_0xe0abdd=0xc8;}else{_0xe0abdd=0xce;}_0x4f1e77[_0x7426('0x1b')](_0xe0abdd);return _0x4f1e77[_0x7426('0x22')](_0x7426('0x23'),_0x569f04+'-'+_0x17a6b0+'/'+_0x51e0ee)[_0x7426('0x1d')](_0x3c8848);}return null;};}function patchUpdates(_0x3dce15){return function(_0x488e88){try{jsonpatch[_0x7426('0x24')](_0x488e88,_0x3dce15,!![]);}catch(_0x1977ea){return BPromise[_0x7426('0x25')](_0x1977ea);}return _0x488e88[_0x7426('0x26')]();};}function saveUpdates(_0x53dbe8,_0x3f95be){return function(_0x4134fd){if(_0x4134fd){return _0x4134fd[_0x7426('0x27')](_0x53dbe8)[_0x7426('0x28')](function(_0x34b9af){return _0x34b9af;});}return null;};}function removeEntity(_0x5fd63b,_0x2489d9){return function(_0x2d8a2f){if(_0x2d8a2f){return _0x2d8a2f['destroy']()[_0x7426('0x28')](function(){_0x5fd63b[_0x7426('0x1b')](0xcc)[_0x7426('0x1c')]();});}};}function handleEntityNotFound(_0x363c01,_0x328086){return function(_0xa335bd){if(!_0xa335bd){_0x363c01[_0x7426('0x1a')](0x194);}return _0xa335bd;};}function handleError(_0x3f1db3,_0xae481d){_0xae481d=_0xae481d||0x1f4;return function(_0xfcba0f){logger[_0x7426('0x29')](_0xfcba0f[_0x7426('0x2a')]);if(_0xfcba0f[_0x7426('0x2b')]){delete _0xfcba0f[_0x7426('0x2b')];}_0x3f1db3[_0x7426('0x1b')](_0xae481d)[_0x7426('0x2c')](_0xfcba0f);};}exports[_0x7426('0x2d')]=function(_0x142d9a,_0x5af2a4){var _0x53ba90={},_0x4275ec={},_0x57e7c8={'count':0x0,'rows':[]};var _0x400282=_[_0x7426('0x2e')](db['SalesforceField'][_0x7426('0x2f')],function(_0x43e420){return{'name':_0x43e420[_0x7426('0x30')],'type':_0x43e420[_0x7426('0x31')][_0x7426('0x32')]};});_0x4275ec['model']=_[_0x7426('0x2e')](_0x400282,_0x7426('0x2b'));_0x4275ec[_0x7426('0x33')]=_[_0x7426('0x34')](_0x142d9a[_0x7426('0x33')]);_0x4275ec['filters']=_[_0x7426('0x35')](_0x4275ec['model'],_0x4275ec[_0x7426('0x33')]);_0x53ba90['attributes']=_[_0x7426('0x35')](_0x4275ec[_0x7426('0x36')],qs[_0x7426('0x37')](_0x142d9a[_0x7426('0x33')]['fields']));_0x53ba90['attributes']=_0x53ba90[_0x7426('0x38')][_0x7426('0x39')]?_0x53ba90[_0x7426('0x38')]:_0x4275ec[_0x7426('0x36')];if(!_0x142d9a['query'][_0x7426('0x3a')]('nolimit')){_0x53ba90[_0x7426('0x20')]=qs[_0x7426('0x20')](_0x142d9a[_0x7426('0x33')][_0x7426('0x20')]);_0x53ba90[_0x7426('0x1e')]=qs['offset'](_0x142d9a[_0x7426('0x33')][_0x7426('0x1e')]);}_0x53ba90[_0x7426('0x3b')]=qs[_0x7426('0x3c')](_0x142d9a[_0x7426('0x33')][_0x7426('0x3c')]);_0x53ba90[_0x7426('0x3d')]=qs['filters'](_[_0x7426('0x3e')](_0x142d9a[_0x7426('0x33')],_0x4275ec['filters']),_0x400282);if(_0x142d9a[_0x7426('0x33')][_0x7426('0x3f')]){_0x53ba90[_0x7426('0x3d')]=_[_0x7426('0x40')](_0x53ba90[_0x7426('0x3d')],{'$or':_[_0x7426('0x2e')](_0x400282,function(_0x1a0d73){if(_0x1a0d73[_0x7426('0x31')]!=='VIRTUAL'){var _0x226e64={};_0x226e64[_0x1a0d73[_0x7426('0x2b')]]={'$like':'%'+_0x142d9a[_0x7426('0x33')][_0x7426('0x3f')]+'%'};return _0x226e64;}})});}_0x53ba90=_[_0x7426('0x40')]({},_0x53ba90,_0x142d9a[_0x7426('0x41')]);var _0x3b83df={'where':_0x53ba90[_0x7426('0x3d')]};return db[_0x7426('0x42')][_0x7426('0x21')](_0x3b83df)[_0x7426('0x28')](function(_0x57f3b8){_0x57e7c8['count']=_0x57f3b8;if(_0x142d9a[_0x7426('0x33')][_0x7426('0x43')]){_0x53ba90['include']=[{'all':!![]}];}return db['SalesforceField'][_0x7426('0x44')](_0x53ba90);})[_0x7426('0x28')](function(_0x36e223){_0x57e7c8[_0x7426('0x45')]=_0x36e223;return _0x57e7c8;})[_0x7426('0x28')](respondWithFilteredResult(_0x5af2a4,_0x53ba90))[_0x7426('0x46')](handleError(_0x5af2a4,null));};exports[_0x7426('0x47')]=function(_0x494c3e,_0x1f6bd8){var _0x1a0571={'raw':!![],'where':{'id':_0x494c3e[_0x7426('0x48')]['id']}},_0xec0f9f={};_0xec0f9f[_0x7426('0x36')]=_[_0x7426('0x34')](db[_0x7426('0x42')][_0x7426('0x2f')]);_0xec0f9f[_0x7426('0x33')]=_[_0x7426('0x34')](_0x494c3e[_0x7426('0x33')]);_0xec0f9f[_0x7426('0x49')]=_[_0x7426('0x35')](_0xec0f9f[_0x7426('0x36')],_0xec0f9f[_0x7426('0x33')]);_0x1a0571[_0x7426('0x38')]=_[_0x7426('0x35')](_0xec0f9f[_0x7426('0x36')],qs[_0x7426('0x37')](_0x494c3e[_0x7426('0x33')][_0x7426('0x37')]));_0x1a0571[_0x7426('0x38')]=_0x1a0571['attributes'][_0x7426('0x39')]?_0x1a0571[_0x7426('0x38')]:_0xec0f9f['model'];if(_0x494c3e[_0x7426('0x33')][_0x7426('0x43')]){_0x1a0571['include']=[{'all':!![]}];}_0x1a0571=_['merge']({},_0x1a0571,_0x494c3e[_0x7426('0x41')]);return db[_0x7426('0x42')]['find'](_0x1a0571)[_0x7426('0x28')](handleEntityNotFound(_0x1f6bd8,null))['then'](respondWithResult(_0x1f6bd8,null))['catch'](handleError(_0x1f6bd8,null));};exports[_0x7426('0x4a')]=function(_0xb5b964,_0x8da533){return db[_0x7426('0x42')][_0x7426('0x4a')](_0xb5b964[_0x7426('0x4b')],{})[_0x7426('0x28')](respondWithResult(_0x8da533,0xc9))[_0x7426('0x46')](handleError(_0x8da533,null));};exports['update']=function(_0x4b13f7,_0x23506d){if(_0x4b13f7[_0x7426('0x4b')]['id']){delete _0x4b13f7[_0x7426('0x4b')]['id'];}return db[_0x7426('0x42')]['find']({'where':{'id':_0x4b13f7['params']['id']}})[_0x7426('0x28')](handleEntityNotFound(_0x23506d,null))['then'](saveUpdates(_0x4b13f7[_0x7426('0x4b')],null))[_0x7426('0x28')](respondWithResult(_0x23506d,null))['catch'](handleError(_0x23506d,null));};exports[_0x7426('0x4c')]=function(_0x119d4e,_0x2d7a2d){return db[_0x7426('0x42')]['find']({'where':{'id':_0x119d4e[_0x7426('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d7a2d,null))['then'](removeEntity(_0x2d7a2d,null))[_0x7426('0x46')](handleError(_0x2d7a2d,null));};
\ No newline at end of file
index 8ca5c8c..0ffcfab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1917=['exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','api','bluebird','rimraf'];(function(_0x5f009a,_0xb950b9){var _0x399027=function(_0x2e126e){while(--_0x2e126e){_0x5f009a['push'](_0x5f009a['shift']());}};_0x399027(++_0xb950b9);}(_0x1917,0x187));var _0x7191=function(_0x5b7acb,_0x365217){_0x5b7acb=_0x5b7acb-0x0;var _0x5b8acd=_0x1917[_0x5b7acb];return _0x5b8acd;};'use strict';var _=require(_0x7191('0x0'));var util=require(_0x7191('0x1'));var logger=require('../../config/logger')(_0x7191('0x2'));var moment=require('moment');var BPromise=require(_0x7191('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7191('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x7191('0x5')]=function(_0x3e6b5c,_0x5a7a6f){return _0x3e6b5c[_0x7191('0x6')](_0x7191('0x7'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x7191('0x8'),'fields':[_0x7191('0x9'),_0x7191('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xba9b=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','salesforce_unique_index','idField','FieldId','lodash','util'];(function(_0x2390e5,_0x369025){var _0xa6038f=function(_0x2e74a3){while(--_0x2e74a3){_0x2390e5['push'](_0x2390e5['shift']());}};_0xa6038f(++_0x369025);}(_0xba9b,0xce));var _0xbba9=function(_0x50f6d7,_0x176709){_0x50f6d7=_0x50f6d7-0x0;var _0x5cc288=_0xba9b[_0x50f6d7];return _0x5cc288;};'use strict';var _=require(_0xbba9('0x0'));var util=require(_0xbba9('0x1'));var logger=require(_0xbba9('0x2'))(_0xbba9('0x3'));var moment=require(_0xbba9('0x4'));var BPromise=require(_0xbba9('0x5'));var rp=require(_0xbba9('0x6'));var fs=require('fs');var path=require(_0xbba9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0xbba9('0x8')]=function(_0x4f60bc,_0x15d0f5){return _0x4f60bc[_0xbba9('0x9')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xbba9('0xa'),'fields':[_0xbba9('0xb'),_0xbba9('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index bb30755..2c97bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1db=['result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3a31fe,_0x2a614e){var _0x17169d=function(_0x209832){while(--_0x209832){_0x3a31fe['push'](_0x3a31fe['shift']());}};_0x17169d(++_0x2a614e);}(_0xe1db,0x7a));var _0xbe1d=function(_0x13543f,_0x3fb604){_0x13543f=_0x13543f-0x0;var _0x31ec44=_0xe1db[_0x13543f];return _0x31ec44;};'use strict';var _=require('lodash');var util=require(_0xbe1d('0x0'));var moment=require(_0xbe1d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe1d('0x2'));var db=require(_0xbe1d('0x3'))['db'];var utils=require(_0xbe1d('0x4'));var logger=require('../../config/logger')(_0xbe1d('0x5'));var config=require(_0xbe1d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbe1d('0x7')][_0xbe1d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4adc7b,_0x3d5b33,_0xc24101){return new BPromise(function(_0x4da1c4,_0x3bce4a){return client[_0xbe1d('0x9')](_0x4adc7b,_0xc24101)[_0xbe1d('0xa')](function(_0x55b512){logger[_0xbe1d('0xb')](_0xbe1d('0xc'),_0x3d5b33,_0xbe1d('0xd'));logger['debug'](_0xbe1d('0xe'),_0x3d5b33,'request\x20sent',JSON['stringify'](_0x55b512));if(_0x55b512[_0xbe1d('0xf')]){if(_0x55b512[_0xbe1d('0xf')][_0xbe1d('0x10')]===0x1f4){logger[_0xbe1d('0xf')]('SalesforceField,\x20%s,\x20%s',_0x3d5b33,_0x55b512[_0xbe1d('0xf')][_0xbe1d('0x11')]);return _0x3bce4a(_0x55b512[_0xbe1d('0xf')][_0xbe1d('0x11')]);}logger[_0xbe1d('0xf')](_0xbe1d('0xc'),_0x3d5b33,_0x55b512['error'][_0xbe1d('0x11')]);return _0x4da1c4(_0x55b512[_0xbe1d('0xf')][_0xbe1d('0x11')]);}else{logger['info'](_0xbe1d('0xc'),_0x3d5b33,_0xbe1d('0xd'));_0x4da1c4(_0x55b512[_0xbe1d('0x12')][_0xbe1d('0x11')]);}})[_0xbe1d('0x13')](function(_0x55b3e1){logger[_0xbe1d('0xf')]('SalesforceField,\x20%s,\x20%s',_0x3d5b33,_0x55b3e1);_0x3bce4a(_0x55b3e1);});});}
\ No newline at end of file
+var _0xc144=['jayson/promise','client','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc144,0x160));var _0x4c14=function(_0x103ff2,_0x407afc){_0x103ff2=_0x103ff2-0x0;var _0xf66340=_0xc144[_0x103ff2];return _0xf66340;};'use strict';var _=require(_0x4c14('0x0'));var util=require(_0x4c14('0x1'));var moment=require(_0x4c14('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c14('0x3'))['db'];var utils=require(_0x4c14('0x4'));var logger=require(_0x4c14('0x5'))(_0x4c14('0x6'));var config=require(_0x4c14('0x7'));var jayson=require(_0x4c14('0x8'));var client=jayson[_0x4c14('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a750a,_0x4e5567,_0x4f0ad3){return new BPromise(function(_0x2f98f9,_0x289bad){return client[_0x4c14('0xa')](_0x5a750a,_0x4f0ad3)['then'](function(_0x5ee813){logger[_0x4c14('0xb')](_0x4c14('0xc'),_0x4e5567,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4e5567,_0x4c14('0xd'),JSON[_0x4c14('0xe')](_0x5ee813));if(_0x5ee813[_0x4c14('0xf')]){if(_0x5ee813['error'][_0x4c14('0x10')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x4e5567,_0x5ee813[_0x4c14('0xf')][_0x4c14('0x11')]);return _0x289bad(_0x5ee813[_0x4c14('0xf')][_0x4c14('0x11')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x4e5567,_0x5ee813[_0x4c14('0xf')][_0x4c14('0x11')]);return _0x2f98f9(_0x5ee813['error'][_0x4c14('0x11')]);}else{logger[_0x4c14('0xb')](_0x4c14('0xc'),_0x4e5567,_0x4c14('0xd'));_0x2f98f9(_0x5ee813[_0x4c14('0x12')][_0x4c14('0x11')]);}})[_0x4c14('0x13')](function(_0x5963a4){logger[_0x4c14('0xf')](_0x4c14('0xc'),_0x4e5567,_0x5963a4);_0x289bad(_0x5963a4);});});}
\ No newline at end of file
index cf80589..14c572a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffb6=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xffb6,0x81));var _0x6ffb=function(_0x2cfacf,_0x1b2fe7){_0x2cfacf=_0x2cfacf-0x0;var _0x4cf376=_0xffb6[_0x2cfacf];return _0x4cf376;};'use strict';var multer=require(_0x6ffb('0x0'));var util=require('util');var path=require(_0x6ffb('0x1'));var timeout=require(_0x6ffb('0x2'));var express=require(_0x6ffb('0x3'));var router=express['Router']();var fs_extra=require(_0x6ffb('0x4'));var auth=require(_0x6ffb('0x5'));var interaction=require(_0x6ffb('0x6'));var config=require(_0x6ffb('0x7'));var controller=require(_0x6ffb('0x8'));router[_0x6ffb('0x9')]('/',auth['isAuthenticated'](),controller[_0x6ffb('0xa')]);router[_0x6ffb('0x9')](_0x6ffb('0xb'),auth[_0x6ffb('0xc')](),controller[_0x6ffb('0xd')]);router[_0x6ffb('0x9')](_0x6ffb('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x6ffb('0xf'),auth[_0x6ffb('0xc')](),controller[_0x6ffb('0x10')]);router[_0x6ffb('0x11')]('/',auth[_0x6ffb('0xc')](),controller[_0x6ffb('0x12')]);router['post'](_0x6ffb('0xe'),auth[_0x6ffb('0xc')](),controller[_0x6ffb('0x13')]);router[_0x6ffb('0x14')](_0x6ffb('0xb'),auth['isAuthenticated'](),controller[_0x6ffb('0x15')]);router[_0x6ffb('0x16')](_0x6ffb('0xb'),auth[_0x6ffb('0xc')](),controller[_0x6ffb('0x17')]);module[_0x6ffb('0x18')]=router;
\ No newline at end of file
+var _0x1109=['/:id/configurations','getFields','post','create','/:id','delete','destroy','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index'];(function(_0x446186,_0x116e31){var _0x63b564=function(_0x590a14){while(--_0x590a14){_0x446186['push'](_0x446186['shift']());}};_0x63b564(++_0x116e31);}(_0x1109,0x17d));var _0x9110=function(_0x3046d8,_0x19af5e){_0x3046d8=_0x3046d8-0x0;var _0x56ecb6=_0x1109[_0x3046d8];return _0x56ecb6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9110('0x0'));var timeout=require('connect-timeout');var express=require(_0x9110('0x1'));var router=express['Router']();var fs_extra=require(_0x9110('0x2'));var auth=require(_0x9110('0x3'));var interaction=require(_0x9110('0x4'));var config=require(_0x9110('0x5'));var controller=require(_0x9110('0x6'));router[_0x9110('0x7')]('/',auth[_0x9110('0x8')](),controller[_0x9110('0x9')]);router[_0x9110('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9110('0x7')](_0x9110('0xa'),auth[_0x9110('0x8')](),controller['getConfigurations']);router[_0x9110('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x9110('0xb')]);router[_0x9110('0xc')]('/',auth[_0x9110('0x8')](),controller[_0x9110('0xd')]);router[_0x9110('0xc')](_0x9110('0xa'),auth[_0x9110('0x8')](),controller['addConfiguration']);router['put'](_0x9110('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x9110('0xf')](_0x9110('0xe'),auth['isAuthenticated'](),controller[_0x9110('0x10')]);module['exports']=router;
\ No newline at end of file
index 87461f1..c8b3f90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac14=['STRING','username','exports'];(function(_0x5a98c1,_0x5a4037){var _0x5f2912=function(_0x25bcfb){while(--_0x25bcfb){_0x5a98c1['push'](_0x5a98c1['shift']());}};_0x5f2912(++_0x5a4037);}(_0xac14,0x98));var _0x4ac1=function(_0x33e5c4,_0x142f3e){_0x33e5c4=_0x33e5c4-0x0;var _0x2b5ee5=_0xac14[_0x33e5c4];return _0x2b5ee5;};'use strict';var Sequelize=require('sequelize');module[_0x4ac1('0x0')]={'name':{'type':Sequelize[_0x4ac1('0x1')]},'description':{'type':Sequelize[_0x4ac1('0x1')]},'username':{'type':Sequelize[_0x4ac1('0x1')],'unique':_0x4ac1('0x2')},'password':{'type':Sequelize[_0x4ac1('0x1')]},'email':{'type':Sequelize[_0x4ac1('0x1')]},'remoteUri':{'type':Sequelize[_0x4ac1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4ac1('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x4132=['STRING','remoteUri','sequelize','exports'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x4132,0xd6));var _0x2413=function(_0x51d69c,_0x13fc9e){_0x51d69c=_0x51d69c-0x0;var _0x36aa80=_0x4132[_0x51d69c];return _0x36aa80;};'use strict';var Sequelize=require(_0x2413('0x0'));module[_0x2413('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2413('0x2')]},'username':{'type':Sequelize[_0x2413('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2413('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2413('0x3')},'serverUrl':{'type':Sequelize[_0x2413('0x2')],'allowNull':![]}};
\ No newline at end of file
index 5243141..1276d4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cf6=['sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','comments','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','forEach','internalType','push','TCL:\x20_object','remove','label','all','concat','ServiceNow\x20error:\x20','test','statusCode','stack','send','Wrong\x20credentials','boolean','False','false','sys_choice?sysparm_query=name=incident^element=','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','error','name','index','map','ServicenowAccount','rawAttributes','key','query','intersection','model','fields','attributes','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','keys','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ServicenowField','Descriptions','getFields','hold_reason','knowledge','close_code','notify','incident_state','severity','category','made_sla','caused_by','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input'];(function(_0x4a0bc4,_0x50f92c){var _0x378b7c=function(_0x488e0d){while(--_0x488e0d){_0x4a0bc4['push'](_0x4a0bc4['shift']());}};_0x378b7c(++_0x50f92c);}(_0x9cf6,0x1c1));var _0x69cf=function(_0x1f2248,_0x52a230){_0x1f2248=_0x1f2248-0x0;var _0x88a807=_0x9cf6[_0x1f2248];return _0x88a807;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69cf('0x0'));var zipdir=require(_0x69cf('0x1'));var jsonpatch=require(_0x69cf('0x2'));var rp=require(_0x69cf('0x3'));var moment=require(_0x69cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x69cf('0x5'));var util=require('util');var path=require(_0x69cf('0x6'));var sox=require('sox');var csv=require(_0x69cf('0x7'));var ejs=require(_0x69cf('0x8'));var fs=require('fs');var fs_extra=require(_0x69cf('0x9'));var _=require(_0x69cf('0xa'));var squel=require(_0x69cf('0xb'));var crypto=require(_0x69cf('0xc'));var jsforce=require(_0x69cf('0xd'));var deskjs=require(_0x69cf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x69cf('0xf'));var authService=require(_0x69cf('0x10'));var qs=require(_0x69cf('0x11'));var as=require(_0x69cf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69cf('0x13'))(_0x69cf('0x14'));var utils=require(_0x69cf('0x15'));var config=require(_0x69cf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x69cf('0x17'))['db'];var integrations=require(_0x69cf('0x18'));function respondWithStatusCode(_0x1c7718,_0x16d3dd){_0x16d3dd=_0x16d3dd||0xcc;return function(_0x3260aa){if(_0x3260aa){return _0x1c7718[_0x69cf('0x19')](_0x16d3dd);}return _0x1c7718['status'](_0x16d3dd)[_0x69cf('0x1a')]();};}function respondWithResult(_0x2da73a,_0x380d61){_0x380d61=_0x380d61||0xc8;return function(_0x5e77b7){if(_0x5e77b7){return _0x2da73a[_0x69cf('0x1b')](_0x380d61)[_0x69cf('0x1c')](_0x5e77b7);}};}function respondWithFilteredResult(_0x1faece,_0x352ecf){return function(_0x54aaad){if(_0x54aaad){var _0x4ffbed=typeof _0x352ecf[_0x69cf('0x1d')]==='undefined'&&typeof _0x352ecf[_0x69cf('0x1e')]==='undefined';var _0x9e1f79=_0x54aaad['count'];var _0x396c71=_0x4ffbed?0x0:_0x352ecf[_0x69cf('0x1d')];var _0x2dee03=_0x4ffbed?_0x54aaad[_0x69cf('0x1f')]:_0x352ecf[_0x69cf('0x1d')]+_0x352ecf[_0x69cf('0x1e')];var _0x5b6045;if(_0x2dee03>=_0x9e1f79){_0x2dee03=_0x9e1f79;_0x5b6045=0xc8;}else{_0x5b6045=0xce;}_0x1faece['status'](_0x5b6045);return _0x1faece['set'](_0x69cf('0x20'),_0x396c71+'-'+_0x2dee03+'/'+_0x9e1f79)[_0x69cf('0x1c')](_0x54aaad);}return null;};}function patchUpdates(_0x3a91e5){return function(_0x23969a){try{jsonpatch[_0x69cf('0x21')](_0x23969a,_0x3a91e5,!![]);}catch(_0x3ff9bf){return BPromise[_0x69cf('0x22')](_0x3ff9bf);}return _0x23969a[_0x69cf('0x23')]();};}function saveUpdates(_0x19cb87,_0x47f06d){return function(_0x3ed981){if(_0x3ed981){return _0x3ed981[_0x69cf('0x24')](_0x19cb87)[_0x69cf('0x25')](function(_0x23b637){return _0x23b637;});}return null;};}function removeEntity(_0x4c7d4e,_0x55f17e){return function(_0x1f94eb){if(_0x1f94eb){return _0x1f94eb['destroy']()[_0x69cf('0x25')](function(){_0x4c7d4e[_0x69cf('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27647a,_0x3cab93){return function(_0x186ded){if(!_0x186ded){_0x27647a[_0x69cf('0x19')](0x194);}return _0x186ded;};}function handleError(_0x1c2996,_0x59a905){_0x59a905=_0x59a905||0x1f4;return function(_0x45c7f8){logger[_0x69cf('0x26')](_0x45c7f8['stack']);if(_0x45c7f8[_0x69cf('0x27')]){delete _0x45c7f8['name'];}_0x1c2996[_0x69cf('0x1b')](_0x59a905)['send'](_0x45c7f8);};}exports[_0x69cf('0x28')]=function(_0x56391f,_0x3875b6){var _0x1c90c8={},_0x45bf98={},_0x546b10={'count':0x0,'rows':[]};var _0x50c3b4=_[_0x69cf('0x29')](db[_0x69cf('0x2a')][_0x69cf('0x2b')],function(_0x38b7d9){return{'name':_0x38b7d9['fieldName'],'type':_0x38b7d9['type'][_0x69cf('0x2c')]};});_0x45bf98['model']=_[_0x69cf('0x29')](_0x50c3b4,'name');_0x45bf98[_0x69cf('0x2d')]=_['keys'](_0x56391f[_0x69cf('0x2d')]);_0x45bf98['filters']=_[_0x69cf('0x2e')](_0x45bf98[_0x69cf('0x2f')],_0x45bf98[_0x69cf('0x2d')]);_0x1c90c8['attributes']=_[_0x69cf('0x2e')](_0x45bf98[_0x69cf('0x2f')],qs[_0x69cf('0x30')](_0x56391f[_0x69cf('0x2d')][_0x69cf('0x30')]));_0x1c90c8['attributes']=_0x1c90c8[_0x69cf('0x31')]['length']?_0x1c90c8[_0x69cf('0x31')]:_0x45bf98[_0x69cf('0x2f')];if(!_0x56391f[_0x69cf('0x2d')]['hasOwnProperty']('nolimit')){_0x1c90c8[_0x69cf('0x1e')]=qs[_0x69cf('0x1e')](_0x56391f[_0x69cf('0x2d')][_0x69cf('0x1e')]);_0x1c90c8[_0x69cf('0x1d')]=qs[_0x69cf('0x1d')](_0x56391f[_0x69cf('0x2d')][_0x69cf('0x1d')]);}_0x1c90c8[_0x69cf('0x32')]=qs[_0x69cf('0x33')](_0x56391f[_0x69cf('0x2d')][_0x69cf('0x33')]);_0x1c90c8[_0x69cf('0x34')]=qs['filters'](_[_0x69cf('0x35')](_0x56391f[_0x69cf('0x2d')],_0x45bf98[_0x69cf('0x36')]),_0x50c3b4);if(_0x56391f[_0x69cf('0x2d')][_0x69cf('0x37')]){_0x1c90c8['where']=_[_0x69cf('0x38')](_0x1c90c8[_0x69cf('0x34')],{'$or':_[_0x69cf('0x29')](_0x50c3b4,function(_0x23bf01){if(_0x23bf01[_0x69cf('0x39')]!==_0x69cf('0x3a')){var _0x1068ef={};_0x1068ef[_0x23bf01[_0x69cf('0x27')]]={'$like':'%'+_0x56391f[_0x69cf('0x2d')]['filter']+'%'};return _0x1068ef;}})});}_0x1c90c8=_[_0x69cf('0x38')]({},_0x1c90c8,_0x56391f[_0x69cf('0x3b')]);var _0x932179={'where':_0x1c90c8['where']};return db[_0x69cf('0x2a')][_0x69cf('0x1f')](_0x932179)[_0x69cf('0x25')](function(_0x412999){_0x546b10[_0x69cf('0x1f')]=_0x412999;if(_0x56391f['query']['includeAll']){_0x1c90c8[_0x69cf('0x3c')]=[{'all':!![]}];}return db[_0x69cf('0x2a')][_0x69cf('0x3d')](_0x1c90c8);})[_0x69cf('0x25')](function(_0x45eb43){_0x546b10[_0x69cf('0x3e')]=_0x45eb43;return _0x546b10;})[_0x69cf('0x25')](respondWithFilteredResult(_0x3875b6,_0x1c90c8))[_0x69cf('0x3f')](handleError(_0x3875b6,null));};exports[_0x69cf('0x40')]=function(_0x4cbf8e,_0xbb4a33){var _0x40e924={'raw':![],'where':{'id':_0x4cbf8e[_0x69cf('0x41')]['id']}},_0x5cdd9d={};_0x5cdd9d['model']=_['keys'](db[_0x69cf('0x2a')][_0x69cf('0x2b')]);_0x5cdd9d[_0x69cf('0x2d')]=_['keys'](_0x4cbf8e['query']);_0x5cdd9d[_0x69cf('0x36')]=_['intersection'](_0x5cdd9d[_0x69cf('0x2f')],_0x5cdd9d['query']);_0x40e924['attributes']=_['intersection'](_0x5cdd9d[_0x69cf('0x2f')],qs[_0x69cf('0x30')](_0x4cbf8e['query'][_0x69cf('0x30')]));_0x40e924[_0x69cf('0x31')]=_0x40e924[_0x69cf('0x31')][_0x69cf('0x42')]?_0x40e924[_0x69cf('0x31')]:_0x5cdd9d[_0x69cf('0x2f')];if(_0x4cbf8e[_0x69cf('0x2d')][_0x69cf('0x43')]){_0x40e924[_0x69cf('0x3c')]=[{'all':!![]}];}_0x40e924=_[_0x69cf('0x38')]({},_0x40e924,_0x4cbf8e[_0x69cf('0x3b')]);return db[_0x69cf('0x2a')][_0x69cf('0x44')](_0x40e924)[_0x69cf('0x25')](handleEntityNotFound(_0xbb4a33,null))[_0x69cf('0x25')](respondWithResult(_0xbb4a33,null))[_0x69cf('0x3f')](handleError(_0xbb4a33,null));};exports[_0x69cf('0x45')]=function(_0x29c4de,_0x43c257){return db[_0x69cf('0x2a')][_0x69cf('0x45')](_0x29c4de[_0x69cf('0x46')],{})[_0x69cf('0x25')](respondWithResult(_0x43c257,0xc9))[_0x69cf('0x3f')](handleError(_0x43c257,null));};exports[_0x69cf('0x24')]=function(_0x415696,_0x2a1e67){if(_0x415696[_0x69cf('0x46')]['id']){delete _0x415696['body']['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x415696[_0x69cf('0x41')]['id']}})[_0x69cf('0x25')](handleEntityNotFound(_0x2a1e67,null))[_0x69cf('0x25')](saveUpdates(_0x415696[_0x69cf('0x46')],null))['then'](respondWithResult(_0x2a1e67,null))[_0x69cf('0x3f')](handleError(_0x2a1e67,null));};exports[_0x69cf('0x47')]=function(_0xeeb20b,_0x4b531d){return db['ServicenowAccount'][_0x69cf('0x44')]({'where':{'id':_0xeeb20b['params']['id']}})[_0x69cf('0x25')](handleEntityNotFound(_0x4b531d,null))[_0x69cf('0x25')](removeEntity(_0x4b531d,null))[_0x69cf('0x3f')](handleError(_0x4b531d,null));};exports[_0x69cf('0x48')]=function(_0x5d3e06,_0x5c18bd,_0x32a526){var _0x5ed338={};var _0x3269c2={};var _0x29a31e;var _0x172825;return db[_0x69cf('0x2a')][_0x69cf('0x49')]({'where':{'id':_0x5d3e06[_0x69cf('0x41')]['id']}})[_0x69cf('0x25')](handleEntityNotFound(_0x5c18bd,null))[_0x69cf('0x25')](function(_0x94e696){if(_0x94e696){_0x29a31e=_0x94e696;_0x3269c2['model']=_['keys'](db[_0x69cf('0x4a')]['rawAttributes']);_0x3269c2[_0x69cf('0x2d')]=_[_0x69cf('0x4b')](_0x5d3e06['query']);_0x3269c2[_0x69cf('0x36')]=_[_0x69cf('0x2e')](_0x3269c2[_0x69cf('0x2f')],_0x3269c2['query']);_0x5ed338[_0x69cf('0x31')]=_[_0x69cf('0x2e')](_0x3269c2[_0x69cf('0x2f')],qs[_0x69cf('0x30')](_0x5d3e06[_0x69cf('0x2d')][_0x69cf('0x30')]));_0x5ed338['attributes']=_0x5ed338[_0x69cf('0x31')][_0x69cf('0x42')]?_0x5ed338['attributes']:_0x3269c2[_0x69cf('0x2f')];_0x5ed338[_0x69cf('0x32')]=qs[_0x69cf('0x33')](_0x5d3e06[_0x69cf('0x2d')][_0x69cf('0x33')]);_0x5ed338['where']=qs[_0x69cf('0x36')](_['pick'](_0x5d3e06[_0x69cf('0x2d')],_0x3269c2[_0x69cf('0x36')]));if(_0x5d3e06['query'][_0x69cf('0x37')]){_0x5ed338[_0x69cf('0x34')]=_[_0x69cf('0x38')](_0x5ed338[_0x69cf('0x34')],{'$or':_[_0x69cf('0x29')](_0x5ed338[_0x69cf('0x31')],function(_0x15e4d5){var _0x13f1d9={};_0x13f1d9[_0x15e4d5]={'$like':'%'+_0x5d3e06[_0x69cf('0x2d')][_0x69cf('0x37')]+'%'};return _0x13f1d9;})});}_0x5ed338=_[_0x69cf('0x38')]({},_0x5ed338,_0x5d3e06[_0x69cf('0x3b')]);return _0x29a31e[_0x69cf('0x48')](_0x5ed338);}})[_0x69cf('0x25')](function(_0x2597f1){if(_0x2597f1){_0x172825=_0x2597f1['length'];if(!_0x5d3e06[_0x69cf('0x2d')][_0x69cf('0x4c')](_0x69cf('0x4d'))){_0x5ed338[_0x69cf('0x1e')]=qs[_0x69cf('0x1e')](_0x5d3e06[_0x69cf('0x2d')][_0x69cf('0x1e')]);_0x5ed338[_0x69cf('0x1d')]=qs[_0x69cf('0x1d')](_0x5d3e06[_0x69cf('0x2d')]['offset']);}return _0x29a31e[_0x69cf('0x48')](_0x5ed338);}})[_0x69cf('0x25')](function(_0x429504){if(_0x429504){return _0x429504?{'count':_0x172825,'rows':_0x429504}:null;}})['then'](respondWithResult(_0x5c18bd,null))[_0x69cf('0x3f')](handleError(_0x5c18bd,null));};exports[_0x69cf('0x4e')]=function(_0x394b1b,_0x3136f3,_0x3ee87a){if(_0x394b1b['body']['id']){delete _0x394b1b[_0x69cf('0x46')]['id'];}return db[_0x69cf('0x2a')][_0x69cf('0x49')]({'where':{'id':_0x394b1b[_0x69cf('0x41')]['id']}})[_0x69cf('0x25')](handleEntityNotFound(_0x3136f3,null))[_0x69cf('0x25')](function(_0x5daaa7){if(_0x5daaa7){_0x394b1b[_0x69cf('0x46')][_0x69cf('0x4f')]=_0x5daaa7['id'];_0x394b1b[_0x69cf('0x46')][_0x69cf('0x50')]=integrations[_0x69cf('0x51')](_0x394b1b['body']['channel'],_0x394b1b[_0x69cf('0x46')][_0x69cf('0x39')]);_0x394b1b[_0x69cf('0x46')]['Descriptions']=integrations[_0x69cf('0x52')](_0x394b1b[_0x69cf('0x46')][_0x69cf('0x53')],_0x394b1b[_0x69cf('0x46')][_0x69cf('0x39')]);return db[_0x69cf('0x4a')][_0x69cf('0x45')](_0x394b1b[_0x69cf('0x46')],{'include':[{'model':db['ServicenowField'],'as':_0x69cf('0x50')},{'model':db[_0x69cf('0x54')],'as':_0x69cf('0x55')}]});}return null;})[_0x69cf('0x25')](respondWithResult(_0x3136f3,null))[_0x69cf('0x3f')](handleError(_0x3136f3,null));};exports[_0x69cf('0x56')]=function(_0x278e45,_0x40dca9,_0x5c527d){var _0x36345e=['made_sla',_0x69cf('0x57'),_0x69cf('0x58'),'subcategory',_0x69cf('0x59'),_0x69cf('0x5a'),_0x69cf('0x5b'),_0x69cf('0x5c'),_0x69cf('0x5d')];var _0x34ed1c=['parent',_0x69cf('0x5e'),_0x69cf('0x5f'),'watch_list','upon_reject',_0x69cf('0x60'),_0x69cf('0x61'),_0x69cf('0x57'),_0x69cf('0x62'),_0x69cf('0x63'),'resolved_by',_0x69cf('0x64'),_0x69cf('0x65'),_0x69cf('0x66'),_0x69cf('0x67'),_0x69cf('0x68'),_0x69cf('0x69'),_0x69cf('0x6a'),_0x69cf('0x58'),'order','calendar_stc',_0x69cf('0x6b'),_0x69cf('0x6c'),_0x69cf('0x6d'),'impact',_0x69cf('0x6e'),_0x69cf('0x6f'),_0x69cf('0x70'),'priority',_0x69cf('0x71'),_0x69cf('0x72'),'time_worked',_0x69cf('0x73'),_0x69cf('0x74'),_0x69cf('0x75'),_0x69cf('0x76'),'work_end',_0x69cf('0x77'),_0x69cf('0x78'),_0x69cf('0x79'),_0x69cf('0x7a'),'subcategory',_0x69cf('0x7b'),'short_description',_0x69cf('0x59'),_0x69cf('0x7c'),_0x69cf('0x7d'),'work_start','assignment_group','business_stc',_0x69cf('0x7e'),_0x69cf('0x7f'),_0x69cf('0x80'),_0x69cf('0x5a'),'sys_class_name',_0x69cf('0x81'),_0x69cf('0x82'),_0x69cf('0x83'),'parent_incident',_0x69cf('0x84'),_0x69cf('0x85'),_0x69cf('0x86'),_0x69cf('0x5b'),_0x69cf('0x87'),'problem_id',_0x69cf('0x88'),_0x69cf('0x89'),_0x69cf('0x8a'),'assigned_to',_0x69cf('0x5c'),_0x69cf('0x8b'),_0x69cf('0x8c'),'approval','comments_and_work_notes',_0x69cf('0x8d'),_0x69cf('0x8e'),_0x69cf('0x8f'),_0x69cf('0x90'),_0x69cf('0x91'),_0x69cf('0x92'),_0x69cf('0x93'),_0x69cf('0x94'),'category'];var _0x55040f='';var _0x4f425e='';var _0x50cfa2=[];var _0x5c3feb='';var _0x269806='';var _0x117d69=[];var _0x2b15fe='';var _0x1d3b03='';var _0x4bc66e={};var _0x2696b0='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x278e45[_0x69cf('0x41')]['id']},'attributes':['id',_0x69cf('0x95'),_0x69cf('0x96'),'email',_0x69cf('0x97'),_0x69cf('0x98')]})['then'](handleEntityNotFound(_0x40dca9,null))[_0x69cf('0x25')](function(_0x68966){if(_0x68966){_0x2696b0=_0x68966[_0x69cf('0x97')];var _0x317312=_0x2696b0[_0x69cf('0x99')](-0x1);if(_0x317312==='/'){_0x2696b0=_0x2696b0[_0x69cf('0x9a')](0x0,_0x2696b0[_0x69cf('0x9b')](_0x317312));}_0x1d3b03=util[_0x69cf('0x9c')](_0x69cf('0x9d'),_0x2696b0);_0x2b15fe=util[_0x69cf('0x9c')](_0x69cf('0x9e'),_0x2696b0);_0x4bc66e={'user':_0x68966['username'],'pass':_0x68966[_0x69cf('0x96')]};var _0x2e476e={'method':_0x69cf('0x9f'),'uri':_0x1d3b03+_0x69cf('0xa0'),'auth':_0x4bc66e,'json':!![]};return rp(_0x2e476e);}})[_0x69cf('0x25')](function(_0x5bd199){if(_0x5bd199[_0x69cf('0xa1')][_0x69cf('0x42')]>0x0){_0x55040f=_0x5bd199[_0x69cf('0xa1')];}console[_0x69cf('0xa2')](_0x69cf('0xa3'),_0x55040f);_0x117d69=[];_0x4f425e=Object[_0x69cf('0xa4')]([],_0x55040f);_['remove'](_0x4f425e,function(_0xeaa2db){return!_0x36345e['includes'](_0xeaa2db['name']);});_0x4f425e[_0x69cf('0xa5')](function(_0x1d5fba){var _0x2dda13=createFieldObject(_0x2b15fe,_0x4bc66e,_0x1d5fba[_0x69cf('0xa6')],_0x1d5fba['name'],_0x1d5fba['label'],![]);_0x117d69[_0x69cf('0xa7')](_0x2dda13);});return Promise['all'](_0x117d69);})[_0x69cf('0x25')](function(_0x425a9e){_0x50cfa2=_0x425a9e;_0x5c3feb=Object[_0x69cf('0xa4')]([],_0x55040f);console['log'](_0x69cf('0xa8'),_0x55040f);_[_0x69cf('0xa9')](_0x5c3feb,function(_0x238305){return _0x34ed1c['includes'](_0x238305['name']);});console[_0x69cf('0xa2')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x5c3feb);_0x117d69=[];_0x5c3feb[_0x69cf('0xa5')](function(_0x1423f4){var _0x54e3ec=createFieldObject(_0x2b15fe,_0x4bc66e,_0x1423f4[_0x69cf('0xa6')],_0x1423f4[_0x69cf('0x27')],_0x1423f4[_0x69cf('0xaa')],!![]);_0x117d69[_0x69cf('0xa7')](_0x54e3ec);});return Promise[_0x69cf('0xab')](_0x117d69);})[_0x69cf('0x25')](function(_0x2ba398){_0x269806=_0x2ba398;var _0x4b12f0=_0x50cfa2[_0x69cf('0xac')](_0x269806);return{'count':_0x4b12f0[_0x69cf('0x42')],'rows':_0x4b12f0};})[_0x69cf('0x25')](respondWithResult(_0x40dca9,null))['catch'](function(_0x3b12b5){console[_0x69cf('0xa2')](_0x69cf('0xad')+_0x3b12b5);var _0x5e3d26=_0x278e45['query'][_0x69cf('0xae')]?0x1f4:_0x3b12b5[_0x69cf('0xaf')]||0x1f4;logger[_0x69cf('0x26')](_0x3b12b5[_0x69cf('0xb0')]);delete _0x3b12b5[_0x69cf('0x27')];if(_0x5e3d26===0x191){_0x5e3d26=0x190;}_0x40dca9[_0x69cf('0x1b')](_0x5e3d26)[_0x69cf('0xb1')](_0x278e45['query'][_0x69cf('0xae')]?{'message':_0x69cf('0xb2'),'statusCode':_0x3b12b5[_0x69cf('0xaf')]}:_0x3b12b5);});};function createFieldObject(_0x265816,_0x150053,_0x439ddb,_0x1d4a0a,_0x563319,_0x5e3950){return new Promise(function(_0x23a7ec,_0x1b2262){var _0x29b994={'id':_0x1d4a0a,'name':_0x563319,'custom':_0x5e3950};if(_0x439ddb===_0x69cf('0xb3')){_0x29b994[_0x69cf('0x3b')]=[{'name':'True','value':'true'},{'name':_0x69cf('0xb4'),'value':_0x69cf('0xb5')}];_0x23a7ec(_0x29b994);}else{var _0x2fd27d={'method':_0x69cf('0x9f'),'uri':_0x265816+_0x69cf('0xb6')+_0x1d4a0a,'auth':_0x150053,'json':!![]};return rp(_0x2fd27d)[_0x69cf('0x25')](function(_0x55864a){var _0x34d570=[];if(_0x55864a[_0x69cf('0xa1')][_0x69cf('0x42')]>0x0){_0x55864a[_0x69cf('0xa1')]['forEach'](function(_0x4efd6e){if(_0x4efd6e['inactive']===_0x69cf('0xb5')){var _0x3e1e40={'name':_0x4efd6e['label'],'value':_0x4efd6e[_0x69cf('0xb7')]};_0x34d570[_0x69cf('0xa7')](_0x3e1e40);}});}_0x29b994[_0x69cf('0x3b')]=_0x34d570;if(_0x29b994[_0x69cf('0x3b')][_0x69cf('0x42')]>0x0){_0x23a7ec(_0x29b994);}else{if(_0x5e3950==![]){_0x23a7ec();}else{_0x23a7ec(_0x29b994);}}});}});}
\ No newline at end of file
+var _0x389c=['addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','made_sla','caused_by','upon_reject','child_incidents','number','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','approval_set','work_notes','correlation_display','additional_assignee_list','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_tags','upon_approval','correlation_id','username','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','forEach','internalType','push','all','assign','log','TCL:\x20_object','includes','label','ServiceNow\x20error:\x20','error','test','statusCode','boolean','True','GET','sys_choice?sysparm_query=name=incident^element=','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','stack','name','send','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','ServicenowAccount','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','destroy','getConfigurations','ServicenowConfiguration','nolimit'];(function(_0xdaf736,_0xd8c667){var _0x1090b3=function(_0x2eab2e){while(--_0x2eab2e){_0xdaf736['push'](_0xdaf736['shift']());}};_0x1090b3(++_0xd8c667);}(_0x389c,0x64));var _0xc389=function(_0x3bda60,_0x7a7022){_0x3bda60=_0x3bda60-0x0;var _0x34bae8=_0x389c[_0x3bda60];return _0x34bae8;};'use strict';var emlformat=require(_0xc389('0x0'));var rimraf=require(_0xc389('0x1'));var zipdir=require(_0xc389('0x2'));var jsonpatch=require(_0xc389('0x3'));var rp=require(_0xc389('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc389('0x5'));var util=require(_0xc389('0x6'));var path=require(_0xc389('0x7'));var sox=require(_0xc389('0x8'));var csv=require('to-csv');var ejs=require(_0xc389('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc389('0xa'));var squel=require(_0xc389('0xb'));var crypto=require(_0xc389('0xc'));var jsforce=require(_0xc389('0xd'));var deskjs=require(_0xc389('0xe'));var toCsv=require(_0xc389('0xf'));var querystring=require(_0xc389('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc389('0x11'));var qs=require(_0xc389('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc389('0x13'));var logger=require(_0xc389('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc389('0x15'));var licenseUtil=require(_0xc389('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc389('0x17'));function respondWithStatusCode(_0x366b48,_0x42bea6){_0x42bea6=_0x42bea6||0xcc;return function(_0x453ed0){if(_0x453ed0){return _0x366b48[_0xc389('0x18')](_0x42bea6);}return _0x366b48[_0xc389('0x19')](_0x42bea6)[_0xc389('0x1a')]();};}function respondWithResult(_0x28b572,_0x191a2e){_0x191a2e=_0x191a2e||0xc8;return function(_0x4fb920){if(_0x4fb920){return _0x28b572[_0xc389('0x19')](_0x191a2e)[_0xc389('0x1b')](_0x4fb920);}};}function respondWithFilteredResult(_0x4f602c,_0x2933c2){return function(_0x29fa5f){if(_0x29fa5f){var _0x1bd6b9=typeof _0x2933c2[_0xc389('0x1c')]===_0xc389('0x1d')&&typeof _0x2933c2['limit']===_0xc389('0x1d');var _0x1adbfd=_0x29fa5f[_0xc389('0x1e')];var _0x5a1197=_0x1bd6b9?0x0:_0x2933c2[_0xc389('0x1c')];var _0xcaed47=_0x1bd6b9?_0x29fa5f[_0xc389('0x1e')]:_0x2933c2[_0xc389('0x1c')]+_0x2933c2['limit'];var _0x4d5db4;if(_0xcaed47>=_0x1adbfd){_0xcaed47=_0x1adbfd;_0x4d5db4=0xc8;}else{_0x4d5db4=0xce;}_0x4f602c['status'](_0x4d5db4);return _0x4f602c[_0xc389('0x1f')]('Content-Range',_0x5a1197+'-'+_0xcaed47+'/'+_0x1adbfd)[_0xc389('0x1b')](_0x29fa5f);}return null;};}function patchUpdates(_0x523fba){return function(_0x4a5143){try{jsonpatch[_0xc389('0x20')](_0x4a5143,_0x523fba,!![]);}catch(_0x16b67b){return BPromise['reject'](_0x16b67b);}return _0x4a5143[_0xc389('0x21')]();};}function saveUpdates(_0x4ac73b,_0x2d58b4){return function(_0x5f4c5d){if(_0x5f4c5d){return _0x5f4c5d[_0xc389('0x22')](_0x4ac73b)[_0xc389('0x23')](function(_0x191eb2){return _0x191eb2;});}return null;};}function removeEntity(_0x93fa30,_0xfbe24){return function(_0x459275){if(_0x459275){return _0x459275['destroy']()[_0xc389('0x23')](function(){_0x93fa30[_0xc389('0x19')](0xcc)[_0xc389('0x1a')]();});}};}function handleEntityNotFound(_0x177147,_0x1e3f46){return function(_0x15d3ce){if(!_0x15d3ce){_0x177147[_0xc389('0x18')](0x194);}return _0x15d3ce;};}function handleError(_0x24458a,_0xd7aac1){_0xd7aac1=_0xd7aac1||0x1f4;return function(_0x2b2355){logger['error'](_0x2b2355[_0xc389('0x24')]);if(_0x2b2355[_0xc389('0x25')]){delete _0x2b2355[_0xc389('0x25')];}_0x24458a[_0xc389('0x19')](_0xd7aac1)[_0xc389('0x26')](_0x2b2355);};}exports['index']=function(_0x5509a0,_0x359eba){var _0x382a7e={},_0x53f3e6={},_0x400c4a={'count':0x0,'rows':[]};var _0x22bacf=_[_0xc389('0x27')](db['ServicenowAccount']['rawAttributes'],function(_0x3dc8a8){return{'name':_0x3dc8a8[_0xc389('0x28')],'type':_0x3dc8a8[_0xc389('0x29')]['key']};});_0x53f3e6[_0xc389('0x2a')]=_[_0xc389('0x27')](_0x22bacf,'name');_0x53f3e6[_0xc389('0x2b')]=_[_0xc389('0x2c')](_0x5509a0['query']);_0x53f3e6[_0xc389('0x2d')]=_[_0xc389('0x2e')](_0x53f3e6[_0xc389('0x2a')],_0x53f3e6[_0xc389('0x2b')]);_0x382a7e['attributes']=_[_0xc389('0x2e')](_0x53f3e6[_0xc389('0x2a')],qs[_0xc389('0x2f')](_0x5509a0['query'][_0xc389('0x2f')]));_0x382a7e['attributes']=_0x382a7e[_0xc389('0x30')][_0xc389('0x31')]?_0x382a7e[_0xc389('0x30')]:_0x53f3e6[_0xc389('0x2a')];if(!_0x5509a0['query'][_0xc389('0x32')]('nolimit')){_0x382a7e['limit']=qs[_0xc389('0x33')](_0x5509a0[_0xc389('0x2b')][_0xc389('0x33')]);_0x382a7e[_0xc389('0x1c')]=qs[_0xc389('0x1c')](_0x5509a0[_0xc389('0x2b')][_0xc389('0x1c')]);}_0x382a7e[_0xc389('0x34')]=qs[_0xc389('0x35')](_0x5509a0[_0xc389('0x2b')][_0xc389('0x35')]);_0x382a7e[_0xc389('0x36')]=qs[_0xc389('0x2d')](_[_0xc389('0x37')](_0x5509a0[_0xc389('0x2b')],_0x53f3e6['filters']),_0x22bacf);if(_0x5509a0[_0xc389('0x2b')][_0xc389('0x38')]){_0x382a7e[_0xc389('0x36')]=_['merge'](_0x382a7e['where'],{'$or':_[_0xc389('0x27')](_0x22bacf,function(_0x559ba9){if(_0x559ba9['type']!==_0xc389('0x39')){var _0x54b9da={};_0x54b9da[_0x559ba9[_0xc389('0x25')]]={'$like':'%'+_0x5509a0[_0xc389('0x2b')][_0xc389('0x38')]+'%'};return _0x54b9da;}})});}_0x382a7e=_[_0xc389('0x3a')]({},_0x382a7e,_0x5509a0[_0xc389('0x3b')]);var _0x105ea2={'where':_0x382a7e[_0xc389('0x36')]};return db[_0xc389('0x3c')][_0xc389('0x1e')](_0x105ea2)[_0xc389('0x23')](function(_0x33f642){_0x400c4a[_0xc389('0x1e')]=_0x33f642;if(_0x5509a0[_0xc389('0x2b')][_0xc389('0x3d')]){_0x382a7e[_0xc389('0x3e')]=[{'all':!![]}];}return db[_0xc389('0x3c')]['findAll'](_0x382a7e);})['then'](function(_0x544ec2){_0x400c4a[_0xc389('0x3f')]=_0x544ec2;return _0x400c4a;})['then'](respondWithFilteredResult(_0x359eba,_0x382a7e))[_0xc389('0x40')](handleError(_0x359eba,null));};exports[_0xc389('0x41')]=function(_0x327d23,_0x33a914){var _0x1a8056={'raw':![],'where':{'id':_0x327d23['params']['id']}},_0x326cc0={};_0x326cc0[_0xc389('0x2a')]=_[_0xc389('0x2c')](db[_0xc389('0x3c')][_0xc389('0x42')]);_0x326cc0['query']=_[_0xc389('0x2c')](_0x327d23[_0xc389('0x2b')]);_0x326cc0[_0xc389('0x2d')]=_[_0xc389('0x2e')](_0x326cc0[_0xc389('0x2a')],_0x326cc0[_0xc389('0x2b')]);_0x1a8056['attributes']=_[_0xc389('0x2e')](_0x326cc0[_0xc389('0x2a')],qs[_0xc389('0x2f')](_0x327d23['query'][_0xc389('0x2f')]));_0x1a8056['attributes']=_0x1a8056['attributes']['length']?_0x1a8056['attributes']:_0x326cc0[_0xc389('0x2a')];if(_0x327d23[_0xc389('0x2b')]['includeAll']){_0x1a8056[_0xc389('0x3e')]=[{'all':!![]}];}_0x1a8056=_[_0xc389('0x3a')]({},_0x1a8056,_0x327d23[_0xc389('0x3b')]);return db[_0xc389('0x3c')][_0xc389('0x43')](_0x1a8056)['then'](handleEntityNotFound(_0x33a914,null))[_0xc389('0x23')](respondWithResult(_0x33a914,null))[_0xc389('0x40')](handleError(_0x33a914,null));};exports['create']=function(_0x416235,_0x3c091f){return db[_0xc389('0x3c')][_0xc389('0x44')](_0x416235[_0xc389('0x45')],{})[_0xc389('0x23')](respondWithResult(_0x3c091f,0xc9))['catch'](handleError(_0x3c091f,null));};exports[_0xc389('0x22')]=function(_0x3d9dda,_0x5883ac){if(_0x3d9dda[_0xc389('0x45')]['id']){delete _0x3d9dda[_0xc389('0x45')]['id'];}return db[_0xc389('0x3c')][_0xc389('0x43')]({'where':{'id':_0x3d9dda[_0xc389('0x46')]['id']}})[_0xc389('0x23')](handleEntityNotFound(_0x5883ac,null))[_0xc389('0x23')](saveUpdates(_0x3d9dda[_0xc389('0x45')],null))[_0xc389('0x23')](respondWithResult(_0x5883ac,null))[_0xc389('0x40')](handleError(_0x5883ac,null));};exports[_0xc389('0x47')]=function(_0x4f17c8,_0x2684b4){return db[_0xc389('0x3c')][_0xc389('0x43')]({'where':{'id':_0x4f17c8[_0xc389('0x46')]['id']}})[_0xc389('0x23')](handleEntityNotFound(_0x2684b4,null))[_0xc389('0x23')](removeEntity(_0x2684b4,null))[_0xc389('0x40')](handleError(_0x2684b4,null));};exports[_0xc389('0x48')]=function(_0x243772,_0x257282,_0x237872){var _0x1c88a1={};var _0x6e4757={};var _0x2f654c;var _0x305c9d;return db[_0xc389('0x3c')]['findOne']({'where':{'id':_0x243772['params']['id']}})['then'](handleEntityNotFound(_0x257282,null))[_0xc389('0x23')](function(_0x6b7386){if(_0x6b7386){_0x2f654c=_0x6b7386;_0x6e4757[_0xc389('0x2a')]=_[_0xc389('0x2c')](db[_0xc389('0x49')]['rawAttributes']);_0x6e4757['query']=_[_0xc389('0x2c')](_0x243772[_0xc389('0x2b')]);_0x6e4757['filters']=_['intersection'](_0x6e4757[_0xc389('0x2a')],_0x6e4757[_0xc389('0x2b')]);_0x1c88a1[_0xc389('0x30')]=_[_0xc389('0x2e')](_0x6e4757[_0xc389('0x2a')],qs[_0xc389('0x2f')](_0x243772[_0xc389('0x2b')][_0xc389('0x2f')]));_0x1c88a1[_0xc389('0x30')]=_0x1c88a1[_0xc389('0x30')][_0xc389('0x31')]?_0x1c88a1['attributes']:_0x6e4757['model'];_0x1c88a1[_0xc389('0x34')]=qs[_0xc389('0x35')](_0x243772[_0xc389('0x2b')][_0xc389('0x35')]);_0x1c88a1[_0xc389('0x36')]=qs[_0xc389('0x2d')](_['pick'](_0x243772[_0xc389('0x2b')],_0x6e4757[_0xc389('0x2d')]));if(_0x243772[_0xc389('0x2b')][_0xc389('0x38')]){_0x1c88a1[_0xc389('0x36')]=_[_0xc389('0x3a')](_0x1c88a1['where'],{'$or':_[_0xc389('0x27')](_0x1c88a1[_0xc389('0x30')],function(_0x58d45a){var _0x22f82d={};_0x22f82d[_0x58d45a]={'$like':'%'+_0x243772[_0xc389('0x2b')]['filter']+'%'};return _0x22f82d;})});}_0x1c88a1=_[_0xc389('0x3a')]({},_0x1c88a1,_0x243772[_0xc389('0x3b')]);return _0x2f654c[_0xc389('0x48')](_0x1c88a1);}})[_0xc389('0x23')](function(_0x309a27){if(_0x309a27){_0x305c9d=_0x309a27['length'];if(!_0x243772[_0xc389('0x2b')]['hasOwnProperty'](_0xc389('0x4a'))){_0x1c88a1[_0xc389('0x33')]=qs[_0xc389('0x33')](_0x243772['query'][_0xc389('0x33')]);_0x1c88a1[_0xc389('0x1c')]=qs['offset'](_0x243772[_0xc389('0x2b')][_0xc389('0x1c')]);}return _0x2f654c[_0xc389('0x48')](_0x1c88a1);}})[_0xc389('0x23')](function(_0x412ecb){if(_0x412ecb){return _0x412ecb?{'count':_0x305c9d,'rows':_0x412ecb}:null;}})['then'](respondWithResult(_0x257282,null))[_0xc389('0x40')](handleError(_0x257282,null));};exports[_0xc389('0x4b')]=function(_0x257c5b,_0x5d13a1,_0xc67962){if(_0x257c5b[_0xc389('0x45')]['id']){delete _0x257c5b[_0xc389('0x45')]['id'];}return db[_0xc389('0x3c')][_0xc389('0x4c')]({'where':{'id':_0x257c5b[_0xc389('0x46')]['id']}})[_0xc389('0x23')](handleEntityNotFound(_0x5d13a1,null))['then'](function(_0x5dbe49){if(_0x5dbe49){_0x257c5b[_0xc389('0x45')][_0xc389('0x4d')]=_0x5dbe49['id'];_0x257c5b['body'][_0xc389('0x4e')]=integrations['getSubjects'](_0x257c5b[_0xc389('0x45')][_0xc389('0x4f')],_0x257c5b[_0xc389('0x45')][_0xc389('0x29')]);_0x257c5b[_0xc389('0x45')][_0xc389('0x50')]=integrations[_0xc389('0x51')](_0x257c5b[_0xc389('0x45')][_0xc389('0x4f')],_0x257c5b[_0xc389('0x45')][_0xc389('0x29')]);return db[_0xc389('0x49')][_0xc389('0x44')](_0x257c5b['body'],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xc389('0x50')}]});}return null;})[_0xc389('0x23')](respondWithResult(_0x5d13a1,null))[_0xc389('0x40')](handleError(_0x5d13a1,null));};exports[_0xc389('0x52')]=function(_0x3a0892,_0x33fcbd,_0x255bf9){var _0x45f30c=['made_sla',_0xc389('0x53'),_0xc389('0x54'),_0xc389('0x55'),_0xc389('0x56'),_0xc389('0x57'),_0xc389('0x58'),'severity',_0xc389('0x59')];var _0x23f1d8=[_0xc389('0x5a'),_0xc389('0x5b'),_0xc389('0x5c'),'watch_list',_0xc389('0x5d'),'sys_updated_on',_0xc389('0x5e'),_0xc389('0x53'),'approval_history',_0xc389('0x5f'),'resolved_by',_0xc389('0x60'),_0xc389('0x61'),_0xc389('0x62'),'sys_created_on',_0xc389('0x63'),'state',_0xc389('0x64'),_0xc389('0x54'),_0xc389('0x34'),_0xc389('0x65'),_0xc389('0x66'),_0xc389('0x67'),_0xc389('0x68'),'impact',_0xc389('0x69'),_0xc389('0x6a'),_0xc389('0x6b'),'priority',_0xc389('0x6c'),_0xc389('0x6d'),'time_worked',_0xc389('0x6e'),_0xc389('0x6f'),_0xc389('0x70'),_0xc389('0x71'),_0xc389('0x72'),_0xc389('0x73'),'resolved_at','caller_id',_0xc389('0x74'),_0xc389('0x55'),_0xc389('0x75'),'short_description',_0xc389('0x56'),_0xc389('0x76'),'delivery_task','work_start','assignment_group','business_stc',_0xc389('0x77'),'description',_0xc389('0x78'),'notify','sys_class_name',_0xc389('0x79'),_0xc389('0x7a'),_0xc389('0x7b'),_0xc389('0x7c'),_0xc389('0x7d'),'contact_type',_0xc389('0x7e'),_0xc389('0x58'),_0xc389('0x7f'),_0xc389('0x80'),_0xc389('0x81'),_0xc389('0x82'),'activity_due',_0xc389('0x83'),_0xc389('0x84'),_0xc389('0x85'),_0xc389('0x86'),_0xc389('0x87'),_0xc389('0x88'),_0xc389('0x89'),'sys_mod_count','reopen_count',_0xc389('0x8a'),'escalation',_0xc389('0x8b'),_0xc389('0x8c'),'location',_0xc389('0x59')];var _0x4b6d18='';var _0x1eaf99='';var _0x371ab3=[];var _0xd61082='';var _0x109fdc='';var _0x4d570f=[];var _0x33ec2c='';var _0x57f4f4='';var _0x211df9={};var _0x280466='';return db[_0xc389('0x3c')][_0xc389('0x4c')]({'where':{'id':_0x3a0892[_0xc389('0x46')]['id']},'attributes':['id',_0xc389('0x8d'),_0xc389('0x8e'),_0xc389('0x8f'),'remoteUri',_0xc389('0x90')]})[_0xc389('0x23')](handleEntityNotFound(_0x33fcbd,null))[_0xc389('0x23')](function(_0x21cddf){if(_0x21cddf){_0x280466=_0x21cddf[_0xc389('0x91')];var _0x160307=_0x280466[_0xc389('0x92')](-0x1);if(_0x160307==='/'){_0x280466=_0x280466[_0xc389('0x93')](0x0,_0x280466[_0xc389('0x94')](_0x160307));}_0x57f4f4=util[_0xc389('0x95')](_0xc389('0x96'),_0x280466);_0x33ec2c=util[_0xc389('0x95')](_0xc389('0x97'),_0x280466);_0x211df9={'user':_0x21cddf[_0xc389('0x8d')],'pass':_0x21cddf[_0xc389('0x8e')]};var _0xf2d5f3={'method':'GET','uri':_0x57f4f4+_0xc389('0x98'),'auth':_0x211df9,'json':!![]};return rp(_0xf2d5f3);}})[_0xc389('0x23')](function(_0x49f035){if(_0x49f035[_0xc389('0x99')][_0xc389('0x31')]>0x0){_0x4b6d18=_0x49f035[_0xc389('0x99')];}console['log'](_0xc389('0x9a'),_0x4b6d18);_0x4d570f=[];_0x1eaf99=Object['assign']([],_0x4b6d18);_[_0xc389('0x9b')](_0x1eaf99,function(_0x1060d3){return!_0x45f30c['includes'](_0x1060d3[_0xc389('0x25')]);});_0x1eaf99[_0xc389('0x9c')](function(_0x1d034c){var _0x636be2=createFieldObject(_0x33ec2c,_0x211df9,_0x1d034c[_0xc389('0x9d')],_0x1d034c[_0xc389('0x25')],_0x1d034c['label'],![]);_0x4d570f[_0xc389('0x9e')](_0x636be2);});return Promise[_0xc389('0x9f')](_0x4d570f);})['then'](function(_0x46a6ce){_0x371ab3=_0x46a6ce;_0xd61082=Object[_0xc389('0xa0')]([],_0x4b6d18);console[_0xc389('0xa1')](_0xc389('0xa2'),_0x4b6d18);_[_0xc389('0x9b')](_0xd61082,function(_0x4757be){return _0x23f1d8[_0xc389('0xa3')](_0x4757be[_0xc389('0x25')]);});console[_0xc389('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xd61082);_0x4d570f=[];_0xd61082['forEach'](function(_0x49f31f){var _0xa9458d=createFieldObject(_0x33ec2c,_0x211df9,_0x49f31f[_0xc389('0x9d')],_0x49f31f[_0xc389('0x25')],_0x49f31f[_0xc389('0xa4')],!![]);_0x4d570f['push'](_0xa9458d);});return Promise['all'](_0x4d570f);})[_0xc389('0x23')](function(_0x47d6ab){_0x109fdc=_0x47d6ab;var _0x47f5e3=_0x371ab3['concat'](_0x109fdc);return{'count':_0x47f5e3['length'],'rows':_0x47f5e3};})[_0xc389('0x23')](respondWithResult(_0x33fcbd,null))[_0xc389('0x40')](function(_0x231b17){console[_0xc389('0xa1')](_0xc389('0xa5')+_0x231b17);var _0x5312cf=_0x3a0892[_0xc389('0x2b')]['test']?0x1f4:_0x231b17['statusCode']||0x1f4;logger[_0xc389('0xa6')](_0x231b17[_0xc389('0x24')]);delete _0x231b17[_0xc389('0x25')];if(_0x5312cf===0x191){_0x5312cf=0x190;}_0x33fcbd[_0xc389('0x19')](_0x5312cf)['send'](_0x3a0892[_0xc389('0x2b')][_0xc389('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x231b17[_0xc389('0xa8')]}:_0x231b17);});};function createFieldObject(_0x44dd05,_0x44183d,_0x7563c4,_0x4c2c92,_0x3e8636,_0x566b1e){return new Promise(function(_0x1f2bac,_0x39f62d){var _0x5105c9={'id':_0x4c2c92,'name':_0x3e8636,'custom':_0x566b1e};if(_0x7563c4===_0xc389('0xa9')){_0x5105c9[_0xc389('0x3b')]=[{'name':_0xc389('0xaa'),'value':'true'},{'name':'False','value':'false'}];_0x1f2bac(_0x5105c9);}else{var _0x99da44={'method':_0xc389('0xab'),'uri':_0x44dd05+_0xc389('0xac')+_0x4c2c92,'auth':_0x44183d,'json':!![]};return rp(_0x99da44)[_0xc389('0x23')](function(_0x4b5b74){var _0x54113d=[];if(_0x4b5b74[_0xc389('0x99')][_0xc389('0x31')]>0x0){_0x4b5b74[_0xc389('0x99')][_0xc389('0x9c')](function(_0x1b8b89){if(_0x1b8b89['inactive']===_0xc389('0xad')){var _0x25703a={'name':_0x1b8b89[_0xc389('0xa4')],'value':_0x1b8b89[_0xc389('0xae')]};_0x54113d[_0xc389('0x9e')](_0x25703a);}});}_0x5105c9[_0xc389('0x3b')]=_0x54113d;if(_0x5105c9['options'][_0xc389('0x31')]>0x0){_0x1f2bac(_0x5105c9);}else{if(_0x566b1e==![]){_0x1f2bac();}else{_0x1f2bac(_0x5105c9);}}});}});}
\ No newline at end of file
index 26399f8..de5909d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['exports','define','ServicenowAccount','lodash','util','../../config/logger','api','bluebird','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x11de80,_0x4fd798){var _0x1d47b0=function(_0x1be91e){while(--_0x1be91e){_0x11de80['push'](_0x11de80['shift']());}};_0x1d47b0(++_0x4fd798);}(_0x4c60,0xc1));var _0x04c6=function(_0x588f30,_0x561dfc){_0x588f30=_0x588f30-0x0;var _0x338b61=_0x4c60[_0x588f30];return _0x338b61;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('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(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2dc7d5,_0x101a11){var _0x51549f=function(_0xc5f30d){while(--_0xc5f30d){_0x2dc7d5['push'](_0x2dc7d5['shift']());}};_0x51549f(++_0x101a11);}(_0x5075,0x73));var _0x5507=function(_0x49e6ca,_0x3fb558){_0x49e6ca=_0x49e6ca-0x0;var _0x362189=_0x5075[_0x49e6ca];return _0x362189;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2cd9ee,_0x773559){return _0x2cd9ee['define'](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f1caea..768ef54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7185=['../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','options','limit','include','map','model','attributes','ShowServicenowAccount','find','raw','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x15f3a8,_0x9bcdcc){var _0x26f727=function(_0x450de2){while(--_0x450de2){_0x15f3a8['push'](_0x15f3a8['shift']());}};_0x26f727(++_0x9bcdcc);}(_0x7185,0xca));var _0x5718=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7185[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x5718('0x0'));var util=require('util');var moment=require(_0x5718('0x1'));var BPromise=require('bluebird');var rs=require(_0x5718('0x2'));var fs=require('fs');var Redis=require(_0x5718('0x3'));var db=require(_0x5718('0x4'))['db'];var utils=require(_0x5718('0x5'));var logger=require(_0x5718('0x6'))(_0x5718('0x7'));var config=require(_0x5718('0x8'));var jayson=require(_0x5718('0x9'));var client=jayson[_0x5718('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca2e8,_0x271a94,_0xb7451f){return new BPromise(function(_0x3cd1fd,_0x37328f){return client[_0x5718('0xb')](_0x4ca2e8,_0xb7451f)[_0x5718('0xc')](function(_0x670469){logger[_0x5718('0xd')](_0x5718('0xe'),_0x271a94,_0x5718('0xf'));logger[_0x5718('0x10')](_0x5718('0x11'),_0x271a94,_0x5718('0xf'),JSON[_0x5718('0x12')](_0x670469));if(_0x670469[_0x5718('0x13')]){if(_0x670469[_0x5718('0x13')][_0x5718('0x14')]===0x1f4){logger[_0x5718('0x13')](_0x5718('0xe'),_0x271a94,_0x670469['error'][_0x5718('0x15')]);return _0x37328f(_0x670469[_0x5718('0x13')]['message']);}logger[_0x5718('0x13')](_0x5718('0xe'),_0x271a94,_0x670469[_0x5718('0x13')][_0x5718('0x15')]);return _0x3cd1fd(_0x670469[_0x5718('0x13')]['message']);}else{logger[_0x5718('0xd')](_0x5718('0xe'),_0x271a94,_0x5718('0xf'));_0x3cd1fd(_0x670469['result'][_0x5718('0x15')]);}})[_0x5718('0x16')](function(_0x2da649){logger['error'](_0x5718('0xe'),_0x271a94,_0x2da649);_0x37328f(_0x2da649);});});}exports[_0x5718('0x17')]=function(_0x63974d){var _0x2363d4=this;return new Promise(function(_0x548cfe,_0x162f34){return db[_0x5718('0x18')]['findAll']({'raw':_0x63974d[_0x5718('0x19')]?_0x63974d['options']['raw']===undefined?!![]:![]:!![],'where':_0x63974d[_0x5718('0x19')]?_0x63974d[_0x5718('0x19')]['where']||null:null,'attributes':_0x63974d[_0x5718('0x19')]?_0x63974d[_0x5718('0x19')]['attributes']||null:null,'limit':_0x63974d['options']?_0x63974d[_0x5718('0x19')][_0x5718('0x1a')]||null:null,'include':_0x63974d[_0x5718('0x19')]?_0x63974d[_0x5718('0x19')][_0x5718('0x1b')]?_[_0x5718('0x1c')](_0x63974d['options']['include'],function(_0x40bde9){return{'model':db[_0x40bde9[_0x5718('0x1d')]],'as':_0x40bde9['as'],'attributes':_0x40bde9[_0x5718('0x1e')],'include':_0x40bde9[_0x5718('0x1b')]?_[_0x5718('0x1c')](_0x40bde9[_0x5718('0x1b')],function(_0x542698){return{'model':db[_0x542698[_0x5718('0x1d')]],'as':_0x542698['as'],'attributes':_0x542698[_0x5718('0x1e')],'include':_0x542698[_0x5718('0x1b')]?_['map'](_0x542698[_0x5718('0x1b')],function(_0x7edaab){return{'model':db[_0x7edaab['model']],'as':_0x7edaab['as'],'attributes':_0x7edaab['attributes']};}):[]};}):[]};}):[]:[]})[_0x5718('0xc')](function(_0x1f10ef){logger[_0x5718('0xd')](_0x5718('0x17'),_0x63974d);logger[_0x5718('0x10')]('GetServicenowAccount',_0x63974d,JSON[_0x5718('0x12')](_0x1f10ef));_0x548cfe(_0x1f10ef);})['catch'](function(_0xf1afae){logger[_0x5718('0x13')](_0x5718('0x17'),_0xf1afae['message'],_0x63974d);_0x162f34(_0x2363d4[_0x5718('0x13')](0x1f4,_0xf1afae[_0x5718('0x15')]));});});};exports[_0x5718('0x1f')]=function(_0x2bd0d0){var _0x45d8cc=this;return new Promise(function(_0x2add52,_0x13920c){return db[_0x5718('0x18')][_0x5718('0x20')]({'raw':_0x2bd0d0[_0x5718('0x19')]?_0x2bd0d0[_0x5718('0x19')][_0x5718('0x21')]===undefined?!![]:![]:!![],'where':_0x2bd0d0[_0x5718('0x19')]?_0x2bd0d0[_0x5718('0x19')][_0x5718('0x22')]||null:null,'attributes':_0x2bd0d0[_0x5718('0x19')]?_0x2bd0d0['options'][_0x5718('0x1e')]||null:null,'include':_0x2bd0d0[_0x5718('0x19')]?_0x2bd0d0[_0x5718('0x19')][_0x5718('0x1b')]?_[_0x5718('0x1c')](_0x2bd0d0[_0x5718('0x19')][_0x5718('0x1b')],function(_0x1cf74f){return{'model':db[_0x1cf74f['model']],'as':_0x1cf74f['as'],'attributes':_0x1cf74f[_0x5718('0x1e')],'include':_0x1cf74f['include']?_[_0x5718('0x1c')](_0x1cf74f['include'],function(_0x4d1709){return{'model':db[_0x4d1709[_0x5718('0x1d')]],'as':_0x4d1709['as'],'attributes':_0x4d1709[_0x5718('0x1e')],'include':_0x4d1709[_0x5718('0x1b')]?_['map'](_0x4d1709[_0x5718('0x1b')],function(_0x44731f){return{'model':db[_0x44731f[_0x5718('0x1d')]],'as':_0x44731f['as'],'attributes':_0x44731f[_0x5718('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5718('0xc')](function(_0x6e144b){logger[_0x5718('0xd')](_0x5718('0x1f'),_0x2bd0d0);logger[_0x5718('0x10')](_0x5718('0x1f'),_0x2bd0d0,JSON[_0x5718('0x12')](_0x6e144b));_0x2add52(_0x6e144b);})[_0x5718('0x16')](function(_0x363f28){logger[_0x5718('0x13')](_0x5718('0x1f'),_0x363f28[_0x5718('0x15')],_0x2bd0d0);_0x13920c(_0x45d8cc[_0x5718('0x13')](0x1f4,_0x363f28[_0x5718('0x15')]));});});};
\ No newline at end of file
+var _0x7f3d=['ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0x7f3d,0x190));var _0xd7f3=function(_0x1ac77b,_0x10ee7a){_0x1ac77b=_0x1ac77b-0x0;var _0x161584=_0x7f3d[_0x1ac77b];return _0x161584;};'use strict';var _=require(_0xd7f3('0x0'));var util=require('util');var moment=require(_0xd7f3('0x1'));var BPromise=require(_0xd7f3('0x2'));var rs=require(_0xd7f3('0x3'));var fs=require('fs');var Redis=require(_0xd7f3('0x4'));var db=require(_0xd7f3('0x5'))['db'];var utils=require(_0xd7f3('0x6'));var logger=require(_0xd7f3('0x7'))(_0xd7f3('0x8'));var config=require(_0xd7f3('0x9'));var jayson=require(_0xd7f3('0xa'));var client=jayson[_0xd7f3('0xb')][_0xd7f3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11f133,_0x30d5ae,_0x571901){return new BPromise(function(_0x4aaa09,_0x1805e5){return client[_0xd7f3('0xd')](_0x11f133,_0x571901)[_0xd7f3('0xe')](function(_0x313a96){logger[_0xd7f3('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x30d5ae,_0xd7f3('0x10'));logger[_0xd7f3('0x11')](_0xd7f3('0x12'),_0x30d5ae,_0xd7f3('0x10'),JSON[_0xd7f3('0x13')](_0x313a96));if(_0x313a96[_0xd7f3('0x14')]){if(_0x313a96[_0xd7f3('0x14')][_0xd7f3('0x15')]===0x1f4){logger[_0xd7f3('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x30d5ae,_0x313a96[_0xd7f3('0x14')][_0xd7f3('0x16')]);return _0x1805e5(_0x313a96[_0xd7f3('0x14')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x30d5ae,_0x313a96[_0xd7f3('0x14')][_0xd7f3('0x16')]);return _0x4aaa09(_0x313a96[_0xd7f3('0x14')][_0xd7f3('0x16')]);}else{logger[_0xd7f3('0xf')](_0xd7f3('0x17'),_0x30d5ae,_0xd7f3('0x10'));_0x4aaa09(_0x313a96[_0xd7f3('0x18')][_0xd7f3('0x16')]);}})[_0xd7f3('0x19')](function(_0x2f7e82){logger['error'](_0xd7f3('0x17'),_0x30d5ae,_0x2f7e82);_0x1805e5(_0x2f7e82);});});}exports[_0xd7f3('0x1a')]=function(_0x2dccb9){var _0x24bb0b=this;return new Promise(function(_0x1d1f10,_0x462dcb){return db[_0xd7f3('0x1b')]['findAll']({'raw':_0x2dccb9[_0xd7f3('0x1c')]?_0x2dccb9[_0xd7f3('0x1c')][_0xd7f3('0x1d')]===undefined?!![]:![]:!![],'where':_0x2dccb9[_0xd7f3('0x1c')]?_0x2dccb9[_0xd7f3('0x1c')][_0xd7f3('0x1e')]||null:null,'attributes':_0x2dccb9[_0xd7f3('0x1c')]?_0x2dccb9['options'][_0xd7f3('0x1f')]||null:null,'limit':_0x2dccb9['options']?_0x2dccb9['options'][_0xd7f3('0x20')]||null:null,'include':_0x2dccb9['options']?_0x2dccb9[_0xd7f3('0x1c')]['include']?_['map'](_0x2dccb9[_0xd7f3('0x1c')][_0xd7f3('0x21')],function(_0x39e27b){return{'model':db[_0x39e27b['model']],'as':_0x39e27b['as'],'attributes':_0x39e27b[_0xd7f3('0x1f')],'include':_0x39e27b[_0xd7f3('0x21')]?_[_0xd7f3('0x22')](_0x39e27b[_0xd7f3('0x21')],function(_0xfc9ba3){return{'model':db[_0xfc9ba3[_0xd7f3('0x23')]],'as':_0xfc9ba3['as'],'attributes':_0xfc9ba3[_0xd7f3('0x1f')],'include':_0xfc9ba3[_0xd7f3('0x21')]?_[_0xd7f3('0x22')](_0xfc9ba3[_0xd7f3('0x21')],function(_0x15bec5){return{'model':db[_0x15bec5[_0xd7f3('0x23')]],'as':_0x15bec5['as'],'attributes':_0x15bec5[_0xd7f3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd7f3('0xe')](function(_0x50e7d0){logger[_0xd7f3('0xf')](_0xd7f3('0x1a'),_0x2dccb9);logger[_0xd7f3('0x11')](_0xd7f3('0x1a'),_0x2dccb9,JSON[_0xd7f3('0x13')](_0x50e7d0));_0x1d1f10(_0x50e7d0);})[_0xd7f3('0x19')](function(_0x143b95){logger[_0xd7f3('0x14')](_0xd7f3('0x1a'),_0x143b95[_0xd7f3('0x16')],_0x2dccb9);_0x462dcb(_0x24bb0b[_0xd7f3('0x14')](0x1f4,_0x143b95['message']));});});};exports[_0xd7f3('0x24')]=function(_0x139fa7){var _0x3985f1=this;return new Promise(function(_0x1e1949,_0x4a6b46){return db[_0xd7f3('0x1b')][_0xd7f3('0x25')]({'raw':_0x139fa7[_0xd7f3('0x1c')]?_0x139fa7['options'][_0xd7f3('0x1d')]===undefined?!![]:![]:!![],'where':_0x139fa7[_0xd7f3('0x1c')]?_0x139fa7['options'][_0xd7f3('0x1e')]||null:null,'attributes':_0x139fa7['options']?_0x139fa7['options'][_0xd7f3('0x1f')]||null:null,'include':_0x139fa7['options']?_0x139fa7[_0xd7f3('0x1c')][_0xd7f3('0x21')]?_['map'](_0x139fa7[_0xd7f3('0x1c')][_0xd7f3('0x21')],function(_0x3afbe3){return{'model':db[_0x3afbe3[_0xd7f3('0x23')]],'as':_0x3afbe3['as'],'attributes':_0x3afbe3[_0xd7f3('0x1f')],'include':_0x3afbe3[_0xd7f3('0x21')]?_[_0xd7f3('0x22')](_0x3afbe3[_0xd7f3('0x21')],function(_0x1a7020){return{'model':db[_0x1a7020[_0xd7f3('0x23')]],'as':_0x1a7020['as'],'attributes':_0x1a7020[_0xd7f3('0x1f')],'include':_0x1a7020[_0xd7f3('0x21')]?_[_0xd7f3('0x22')](_0x1a7020[_0xd7f3('0x21')],function(_0x481763){return{'model':db[_0x481763[_0xd7f3('0x23')]],'as':_0x481763['as'],'attributes':_0x481763[_0xd7f3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd7f3('0xe')](function(_0x60e5fa){logger['info'](_0xd7f3('0x24'),_0x139fa7);logger[_0xd7f3('0x11')](_0xd7f3('0x24'),_0x139fa7,JSON[_0xd7f3('0x13')](_0x60e5fa));_0x1e1949(_0x60e5fa);})[_0xd7f3('0x19')](function(_0x3c1554){logger[_0xd7f3('0x14')]('ShowServicenowAccount',_0x3c1554[_0xd7f3('0x16')],_0x139fa7);_0x4a6b46(_0x3985f1[_0xd7f3('0x14')](0x1f4,_0x3c1554['message']));});});};
\ No newline at end of file
index 8c2ac27..c81638c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffa6=['fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','util','path','connect-timeout'];(function(_0x421b14,_0xee05a0){var _0x4b7b57=function(_0x433da3){while(--_0x433da3){_0x421b14['push'](_0x421b14['shift']());}};_0x4b7b57(++_0xee05a0);}(_0xffa6,0x177));var _0x6ffa=function(_0x35a5ba,_0x4bc36e){_0x35a5ba=_0x35a5ba-0x0;var _0xaef209=_0xffa6[_0x35a5ba];return _0xaef209;};'use strict';var multer=require('multer');var util=require(_0x6ffa('0x0'));var path=require(_0x6ffa('0x1'));var timeout=require(_0x6ffa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ffa('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6ffa('0x4'));var controller=require(_0x6ffa('0x5'));router[_0x6ffa('0x6')]('/',auth['isAuthenticated'](),controller[_0x6ffa('0x7')]);router[_0x6ffa('0x6')](_0x6ffa('0x8'),auth['isAuthenticated'](),controller[_0x6ffa('0x9')]);router[_0x6ffa('0x6')]('/:id/fields',auth[_0x6ffa('0xa')](),controller[_0x6ffa('0xb')]);router[_0x6ffa('0x6')](_0x6ffa('0xc'),auth[_0x6ffa('0xa')](),controller[_0x6ffa('0xd')]);router[_0x6ffa('0x6')](_0x6ffa('0xe'),auth['isAuthenticated'](),controller[_0x6ffa('0xf')]);router[_0x6ffa('0x10')]('/',auth[_0x6ffa('0xa')](),controller[_0x6ffa('0x11')]);router[_0x6ffa('0x12')](_0x6ffa('0x8'),auth[_0x6ffa('0xa')](),controller['update']);router['delete'](_0x6ffa('0x8'),auth[_0x6ffa('0xa')](),controller[_0x6ffa('0x13')]);module[_0x6ffa('0x14')]=router;
\ No newline at end of file
+var _0x86b3=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','index','get','isAuthenticated'];(function(_0x2acc5b,_0x2616eb){var _0xcfb508=function(_0x12daa5){while(--_0x12daa5){_0x2acc5b['push'](_0x2acc5b['shift']());}};_0xcfb508(++_0x2616eb);}(_0x86b3,0x1bd));var _0x386b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86b3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x386b('0x0'));var util=require(_0x386b('0x1'));var path=require('path');var timeout=require(_0x386b('0x2'));var express=require(_0x386b('0x3'));var router=express[_0x386b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x386b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x386b('0x6'));var controller=require(_0x386b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x386b('0x8')]);router[_0x386b('0x9')]('/:id',auth[_0x386b('0xa')](),controller[_0x386b('0xb')]);router['get'](_0x386b('0xc'),auth[_0x386b('0xa')](),controller['getFields']);router['get'](_0x386b('0xd'),auth['isAuthenticated'](),controller[_0x386b('0xe')]);router[_0x386b('0x9')](_0x386b('0xf'),auth[_0x386b('0xa')](),controller['getDescriptions']);router[_0x386b('0x10')]('/',auth[_0x386b('0xa')](),controller[_0x386b('0x11')]);router[_0x386b('0x12')](_0x386b('0x13'),auth[_0x386b('0xa')](),controller[_0x386b('0x14')]);router[_0x386b('0x15')](_0x386b('0x13'),auth['isAuthenticated'](),controller[_0x386b('0x16')]);module[_0x386b('0x17')]=router;
\ No newline at end of file
index 978cf87..3420b8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdded=['STRING','sequelize'];(function(_0xe1d50d,_0x6c42da){var _0x477e7b=function(_0x2f23db){while(--_0x2f23db){_0xe1d50d['push'](_0xe1d50d['shift']());}};_0x477e7b(++_0x6c42da);}(_0xdded,0x18f));var _0xddde=function(_0x5a1f9e,_0x33b94f){_0x5a1f9e=_0x5a1f9e-0x0;var _0x2c263f=_0xdded[_0x5a1f9e];return _0x2c263f;};'use strict';var Sequelize=require(_0xddde('0x0'));module['exports']={'name':{'type':Sequelize[_0xddde('0x1')]},'description':{'type':Sequelize[_0xddde('0x1')]}};
\ No newline at end of file
+var _0x6b7f=['sequelize','exports','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x6b7f,0x90));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf6b7('0x0'));module[_0xf6b7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf6b7('0x2')]}};
\ No newline at end of file
index 18e4bf3..fce82f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6064=['bluebird','mustache','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','destroy','error','stack','name','send','ServicenowConfiguration','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','getFields','ServicenowField','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x2fd488,_0x1635b0){var _0x290924=function(_0x32d238){while(--_0x32d238){_0x2fd488['push'](_0x2fd488['shift']());}};_0x290924(++_0x1635b0);}(_0x6064,0x1ca));var _0x4606=function(_0x1ad6cd,_0x1ad286){_0x1ad6cd=_0x1ad6cd-0x0;var _0x58eccc=_0x6064[_0x1ad6cd];return _0x58eccc;};'use strict';var emlformat=require(_0x4606('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4606('0x1'));var jsonpatch=require(_0x4606('0x2'));var rp=require(_0x4606('0x3'));var moment=require('moment');var BPromise=require(_0x4606('0x4'));var Mustache=require(_0x4606('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4606('0x6'));var csv=require(_0x4606('0x7'));var ejs=require(_0x4606('0x8'));var fs=require('fs');var fs_extra=require(_0x4606('0x9'));var _=require(_0x4606('0xa'));var squel=require(_0x4606('0xb'));var crypto=require('crypto');var jsforce=require(_0x4606('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4606('0xd'));var Papa=require(_0x4606('0xe'));var Redis=require(_0x4606('0xf'));var authService=require(_0x4606('0x10'));var qs=require(_0x4606('0x11'));var as=require(_0x4606('0x12'));var hardwareService=require(_0x4606('0x13'));var logger=require(_0x4606('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4606('0x15'));var db=require(_0x4606('0x16'))['db'];function respondWithStatusCode(_0x3fa489,_0x3a18ee){_0x3a18ee=_0x3a18ee||0xcc;return function(_0x84894e){if(_0x84894e){return _0x3fa489[_0x4606('0x17')](_0x3a18ee);}return _0x3fa489[_0x4606('0x18')](_0x3a18ee)[_0x4606('0x19')]();};}function respondWithResult(_0x1a00ab,_0x50c23b){_0x50c23b=_0x50c23b||0xc8;return function(_0x6ecc77){if(_0x6ecc77){return _0x1a00ab[_0x4606('0x18')](_0x50c23b)['json'](_0x6ecc77);}};}function respondWithFilteredResult(_0x487cb5,_0xec9258){return function(_0x551dfc){if(_0x551dfc){var _0x1b2881=typeof _0xec9258[_0x4606('0x1a')]===_0x4606('0x1b')&&typeof _0xec9258[_0x4606('0x1c')]===_0x4606('0x1b');var _0x4070b2=_0x551dfc['count'];var _0x32d0eb=_0x1b2881?0x0:_0xec9258[_0x4606('0x1a')];var _0x2fe84e=_0x1b2881?_0x551dfc[_0x4606('0x1d')]:_0xec9258['offset']+_0xec9258[_0x4606('0x1c')];var _0x2a1c6b;if(_0x2fe84e>=_0x4070b2){_0x2fe84e=_0x4070b2;_0x2a1c6b=0xc8;}else{_0x2a1c6b=0xce;}_0x487cb5[_0x4606('0x18')](_0x2a1c6b);return _0x487cb5[_0x4606('0x1e')]('Content-Range',_0x32d0eb+'-'+_0x2fe84e+'/'+_0x4070b2)[_0x4606('0x1f')](_0x551dfc);}return null;};}function patchUpdates(_0x5ecfe3){return function(_0xc2e09a){try{jsonpatch['apply'](_0xc2e09a,_0x5ecfe3,!![]);}catch(_0x40d1b3){return BPromise[_0x4606('0x20')](_0x40d1b3);}return _0xc2e09a['save']();};}function saveUpdates(_0x7e05e6,_0x7e174c){return function(_0x1d00e9){if(_0x1d00e9){return _0x1d00e9[_0x4606('0x21')](_0x7e05e6)[_0x4606('0x22')](function(_0x2c40e3){return _0x2c40e3;});}return null;};}function removeEntity(_0x51731f,_0xd36639){return function(_0x550fdc){if(_0x550fdc){return _0x550fdc[_0x4606('0x23')]()['then'](function(){_0x51731f[_0x4606('0x18')](0xcc)[_0x4606('0x19')]();});}};}function handleEntityNotFound(_0x32ed03,_0x3dadc0){return function(_0x2c91f4){if(!_0x2c91f4){_0x32ed03[_0x4606('0x17')](0x194);}return _0x2c91f4;};}function handleError(_0x1b794d,_0x279420){_0x279420=_0x279420||0x1f4;return function(_0x544c13){logger[_0x4606('0x24')](_0x544c13[_0x4606('0x25')]);if(_0x544c13[_0x4606('0x26')]){delete _0x544c13[_0x4606('0x26')];}_0x1b794d[_0x4606('0x18')](_0x279420)[_0x4606('0x27')](_0x544c13);};}exports['index']=function(_0x377bdb,_0x282c43){var _0x1376e1={},_0x2518d8={},_0x3506ed={'count':0x0,'rows':[]};var _0x3e915c=_['map'](db[_0x4606('0x28')][_0x4606('0x29')],function(_0x2d06db){return{'name':_0x2d06db[_0x4606('0x2a')],'type':_0x2d06db[_0x4606('0x2b')]['key']};});_0x2518d8['model']=_[_0x4606('0x2c')](_0x3e915c,_0x4606('0x26'));_0x2518d8[_0x4606('0x2d')]=_[_0x4606('0x2e')](_0x377bdb[_0x4606('0x2d')]);_0x2518d8[_0x4606('0x2f')]=_['intersection'](_0x2518d8[_0x4606('0x30')],_0x2518d8['query']);_0x1376e1[_0x4606('0x31')]=_[_0x4606('0x32')](_0x2518d8['model'],qs['fields'](_0x377bdb['query'][_0x4606('0x33')]));_0x1376e1['attributes']=_0x1376e1[_0x4606('0x31')][_0x4606('0x34')]?_0x1376e1[_0x4606('0x31')]:_0x2518d8[_0x4606('0x30')];if(!_0x377bdb['query']['hasOwnProperty'](_0x4606('0x35'))){_0x1376e1[_0x4606('0x1c')]=qs[_0x4606('0x1c')](_0x377bdb[_0x4606('0x2d')][_0x4606('0x1c')]);_0x1376e1[_0x4606('0x1a')]=qs[_0x4606('0x1a')](_0x377bdb[_0x4606('0x2d')][_0x4606('0x1a')]);}_0x1376e1[_0x4606('0x36')]=qs[_0x4606('0x37')](_0x377bdb['query'][_0x4606('0x37')]);_0x1376e1['where']=qs[_0x4606('0x2f')](_[_0x4606('0x38')](_0x377bdb[_0x4606('0x2d')],_0x2518d8['filters']),_0x3e915c);if(_0x377bdb['query'][_0x4606('0x39')]){_0x1376e1[_0x4606('0x3a')]=_[_0x4606('0x3b')](_0x1376e1[_0x4606('0x3a')],{'$or':_[_0x4606('0x2c')](_0x3e915c,function(_0x3c186b){if(_0x3c186b[_0x4606('0x2b')]!==_0x4606('0x3c')){var _0x3e2898={};_0x3e2898[_0x3c186b[_0x4606('0x26')]]={'$like':'%'+_0x377bdb['query']['filter']+'%'};return _0x3e2898;}})});}_0x1376e1=_['merge']({},_0x1376e1,_0x377bdb[_0x4606('0x3d')]);var _0xe21c36={'where':_0x1376e1['where']};return db[_0x4606('0x28')][_0x4606('0x1d')](_0xe21c36)['then'](function(_0x4416b1){_0x3506ed[_0x4606('0x1d')]=_0x4416b1;if(_0x377bdb[_0x4606('0x2d')][_0x4606('0x3e')]){_0x1376e1[_0x4606('0x3f')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x4606('0x40')](_0x1376e1);})[_0x4606('0x22')](function(_0x1b15f7){_0x3506ed['rows']=_0x1b15f7;return _0x3506ed;})['then'](respondWithFilteredResult(_0x282c43,_0x1376e1))[_0x4606('0x41')](handleError(_0x282c43,null));};exports[_0x4606('0x42')]=function(_0xc54938,_0x30d568){var _0x1b7164={'raw':![],'where':{'id':_0xc54938['params']['id']}},_0x2731d1={};_0x2731d1[_0x4606('0x30')]=_[_0x4606('0x2e')](db['ServicenowConfiguration'][_0x4606('0x29')]);_0x2731d1[_0x4606('0x2d')]=_[_0x4606('0x2e')](_0xc54938[_0x4606('0x2d')]);_0x2731d1[_0x4606('0x2f')]=_[_0x4606('0x32')](_0x2731d1['model'],_0x2731d1['query']);_0x1b7164[_0x4606('0x31')]=_[_0x4606('0x32')](_0x2731d1[_0x4606('0x30')],qs[_0x4606('0x33')](_0xc54938[_0x4606('0x2d')]['fields']));_0x1b7164[_0x4606('0x31')]=_0x1b7164[_0x4606('0x31')][_0x4606('0x34')]?_0x1b7164[_0x4606('0x31')]:_0x2731d1['model'];if(_0xc54938[_0x4606('0x2d')][_0x4606('0x3e')]){_0x1b7164['include']=[{'all':!![]}];}_0x1b7164=_['merge']({},_0x1b7164,_0xc54938['options']);return db[_0x4606('0x28')][_0x4606('0x43')](_0x1b7164)[_0x4606('0x22')](handleEntityNotFound(_0x30d568,null))['then'](respondWithResult(_0x30d568,null))[_0x4606('0x41')](handleError(_0x30d568,null));};exports[_0x4606('0x44')]=function(_0x1f7047,_0x11c8ab){return db[_0x4606('0x28')]['create'](_0x1f7047[_0x4606('0x45')],{})[_0x4606('0x22')](respondWithResult(_0x11c8ab,0xc9))[_0x4606('0x41')](handleError(_0x11c8ab,null));};exports['update']=function(_0x2ae881,_0x355d15){if(_0x2ae881[_0x4606('0x45')]['id']){delete _0x2ae881[_0x4606('0x45')]['id'];}return db['ServicenowConfiguration'][_0x4606('0x43')]({'where':{'id':_0x2ae881[_0x4606('0x46')]['id']}})[_0x4606('0x22')](handleEntityNotFound(_0x355d15,null))['then'](saveUpdates(_0x2ae881[_0x4606('0x45')],null))[_0x4606('0x22')](respondWithResult(_0x355d15,null))['catch'](handleError(_0x355d15,null));};exports[_0x4606('0x23')]=function(_0x244a4e,_0x307c04){return db['ServicenowConfiguration'][_0x4606('0x43')]({'where':{'id':_0x244a4e[_0x4606('0x46')]['id']}})[_0x4606('0x22')](handleEntityNotFound(_0x307c04,null))[_0x4606('0x22')](removeEntity(_0x307c04,null))['catch'](handleError(_0x307c04,null));};exports[_0x4606('0x47')]=function(_0x1a2e21,_0x6b0b63,_0x2885f6){var _0x49b72d={};var _0x486581={};var _0x2eeb15;var _0x3d8b47;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x1a2e21[_0x4606('0x46')]['id']}})[_0x4606('0x22')](handleEntityNotFound(_0x6b0b63,null))['then'](function(_0x17cf1e){if(_0x17cf1e){_0x2eeb15=_0x17cf1e;_0x486581[_0x4606('0x30')]=_['keys'](db[_0x4606('0x48')]['rawAttributes']);_0x486581[_0x4606('0x2d')]=_[_0x4606('0x2e')](_0x1a2e21[_0x4606('0x2d')]);_0x486581[_0x4606('0x2f')]=_[_0x4606('0x32')](_0x486581[_0x4606('0x30')],_0x486581[_0x4606('0x2d')]);_0x49b72d[_0x4606('0x31')]=_['intersection'](_0x486581[_0x4606('0x30')],qs['fields'](_0x1a2e21[_0x4606('0x2d')][_0x4606('0x33')]));_0x49b72d[_0x4606('0x31')]=_0x49b72d[_0x4606('0x31')][_0x4606('0x34')]?_0x49b72d[_0x4606('0x31')]:_0x486581[_0x4606('0x30')];_0x49b72d[_0x4606('0x36')]=qs[_0x4606('0x37')](_0x1a2e21[_0x4606('0x2d')]['sort']);_0x49b72d[_0x4606('0x3a')]=qs[_0x4606('0x2f')](_[_0x4606('0x38')](_0x1a2e21[_0x4606('0x2d')],_0x486581[_0x4606('0x2f')]));if(_0x1a2e21[_0x4606('0x2d')][_0x4606('0x39')]){_0x49b72d[_0x4606('0x3a')]=_[_0x4606('0x3b')](_0x49b72d[_0x4606('0x3a')],{'$or':_[_0x4606('0x2c')](_0x49b72d['attributes'],function(_0x507a95){var _0x2debed={};_0x2debed[_0x507a95]={'$like':'%'+_0x1a2e21[_0x4606('0x2d')][_0x4606('0x39')]+'%'};return _0x2debed;})});}_0x49b72d=_[_0x4606('0x3b')]({},_0x49b72d,_0x1a2e21[_0x4606('0x3d')]);return _0x2eeb15[_0x4606('0x47')](_0x49b72d);}})[_0x4606('0x22')](function(_0x21a6ae){if(_0x21a6ae){_0x3d8b47=_0x21a6ae[_0x4606('0x34')];if(!_0x1a2e21[_0x4606('0x2d')][_0x4606('0x49')](_0x4606('0x35'))){_0x49b72d['limit']=qs[_0x4606('0x1c')](_0x1a2e21['query'][_0x4606('0x1c')]);_0x49b72d[_0x4606('0x1a')]=qs[_0x4606('0x1a')](_0x1a2e21[_0x4606('0x2d')][_0x4606('0x1a')]);}return _0x2eeb15[_0x4606('0x47')](_0x49b72d);}})[_0x4606('0x22')](function(_0x5c4e95){if(_0x5c4e95){return _0x5c4e95?{'count':_0x3d8b47,'rows':_0x5c4e95}:null;}})[_0x4606('0x22')](respondWithResult(_0x6b0b63,null))[_0x4606('0x41')](handleError(_0x6b0b63,null));};exports[_0x4606('0x4a')]=function(_0x375405,_0x216bf8,_0x2151dc){var _0x3b51f3={};var _0x214e93={};var _0x4df547;var _0x24df52;return db[_0x4606('0x28')][_0x4606('0x4b')]({'where':{'id':_0x375405[_0x4606('0x46')]['id']}})[_0x4606('0x22')](handleEntityNotFound(_0x216bf8,null))['then'](function(_0x1cf32c){if(_0x1cf32c){_0x4df547=_0x1cf32c;_0x214e93[_0x4606('0x30')]=_[_0x4606('0x2e')](db['ServicenowField']['rawAttributes']);_0x214e93[_0x4606('0x2d')]=_['keys'](_0x375405[_0x4606('0x2d')]);_0x214e93[_0x4606('0x2f')]=_[_0x4606('0x32')](_0x214e93[_0x4606('0x30')],_0x214e93[_0x4606('0x2d')]);_0x3b51f3[_0x4606('0x31')]=_[_0x4606('0x32')](_0x214e93[_0x4606('0x30')],qs[_0x4606('0x33')](_0x375405[_0x4606('0x2d')][_0x4606('0x33')]));_0x3b51f3['attributes']=_0x3b51f3[_0x4606('0x31')][_0x4606('0x34')]?_0x3b51f3[_0x4606('0x31')]:_0x214e93['model'];_0x3b51f3[_0x4606('0x36')]=qs[_0x4606('0x37')](_0x375405[_0x4606('0x2d')]['sort']);_0x3b51f3[_0x4606('0x3a')]=qs[_0x4606('0x2f')](_[_0x4606('0x38')](_0x375405[_0x4606('0x2d')],_0x214e93[_0x4606('0x2f')]));if(_0x375405['query']['filter']){_0x3b51f3['where']=_[_0x4606('0x3b')](_0x3b51f3[_0x4606('0x3a')],{'$or':_[_0x4606('0x2c')](_0x3b51f3[_0x4606('0x31')],function(_0x534d5b){var _0x7bfd17={};_0x7bfd17[_0x534d5b]={'$like':'%'+_0x375405[_0x4606('0x2d')][_0x4606('0x39')]+'%'};return _0x7bfd17;})});}_0x3b51f3=_[_0x4606('0x3b')]({},_0x3b51f3,_0x375405[_0x4606('0x3d')]);return _0x4df547[_0x4606('0x4a')](_0x3b51f3);}})[_0x4606('0x22')](function(_0x4f9866){if(_0x4f9866){_0x24df52=_0x4f9866['length'];if(!_0x375405[_0x4606('0x2d')][_0x4606('0x49')](_0x4606('0x35'))){_0x3b51f3['limit']=qs[_0x4606('0x1c')](_0x375405[_0x4606('0x2d')][_0x4606('0x1c')]);_0x3b51f3[_0x4606('0x1a')]=qs['offset'](_0x375405[_0x4606('0x2d')]['offset']);}return _0x4df547[_0x4606('0x4a')](_0x3b51f3);}})[_0x4606('0x22')](function(_0x4834bb){if(_0x4834bb){return _0x4834bb?{'count':_0x24df52,'rows':_0x4834bb}:null;}})[_0x4606('0x22')](respondWithResult(_0x216bf8,null))['catch'](handleError(_0x216bf8,null));};exports[_0x4606('0x4c')]=function(_0x1a0180,_0x2f3009,_0x56cbf4){var _0x2ff362={};var _0xa01ed4={};var _0x22de98;var _0x53db7d;return db[_0x4606('0x28')][_0x4606('0x4b')]({'where':{'id':_0x1a0180['params']['id']}})[_0x4606('0x22')](handleEntityNotFound(_0x2f3009,null))[_0x4606('0x22')](function(_0x58593c){if(_0x58593c){_0x22de98=_0x58593c;_0xa01ed4[_0x4606('0x30')]=_[_0x4606('0x2e')](db[_0x4606('0x48')][_0x4606('0x29')]);_0xa01ed4[_0x4606('0x2d')]=_[_0x4606('0x2e')](_0x1a0180[_0x4606('0x2d')]);_0xa01ed4['filters']=_[_0x4606('0x32')](_0xa01ed4[_0x4606('0x30')],_0xa01ed4[_0x4606('0x2d')]);_0x2ff362[_0x4606('0x31')]=_[_0x4606('0x32')](_0xa01ed4['model'],qs['fields'](_0x1a0180[_0x4606('0x2d')][_0x4606('0x33')]));_0x2ff362[_0x4606('0x31')]=_0x2ff362[_0x4606('0x31')]['length']?_0x2ff362['attributes']:_0xa01ed4[_0x4606('0x30')];_0x2ff362[_0x4606('0x36')]=qs['sort'](_0x1a0180[_0x4606('0x2d')]['sort']);_0x2ff362[_0x4606('0x3a')]=qs[_0x4606('0x2f')](_[_0x4606('0x38')](_0x1a0180['query'],_0xa01ed4['filters']));if(_0x1a0180[_0x4606('0x2d')][_0x4606('0x39')]){_0x2ff362[_0x4606('0x3a')]=_[_0x4606('0x3b')](_0x2ff362[_0x4606('0x3a')],{'$or':_[_0x4606('0x2c')](_0x2ff362[_0x4606('0x31')],function(_0x2626db){var _0x27aa98={};_0x27aa98[_0x2626db]={'$like':'%'+_0x1a0180[_0x4606('0x2d')][_0x4606('0x39')]+'%'};return _0x27aa98;})});}_0x2ff362=_[_0x4606('0x3b')]({},_0x2ff362,_0x1a0180[_0x4606('0x3d')]);return _0x22de98[_0x4606('0x4c')](_0x2ff362);}})[_0x4606('0x22')](function(_0x23229f){if(_0x23229f){_0x53db7d=_0x23229f['length'];if(!_0x1a0180[_0x4606('0x2d')][_0x4606('0x49')](_0x4606('0x35'))){_0x2ff362[_0x4606('0x1c')]=qs[_0x4606('0x1c')](_0x1a0180[_0x4606('0x2d')][_0x4606('0x1c')]);_0x2ff362[_0x4606('0x1a')]=qs['offset'](_0x1a0180[_0x4606('0x2d')][_0x4606('0x1a')]);}return _0x22de98[_0x4606('0x4c')](_0x2ff362);}})[_0x4606('0x22')](function(_0x1ce4e0){if(_0x1ce4e0){return _0x1ce4e0?{'count':_0x53db7d,'rows':_0x1ce4e0}:null;}})[_0x4606('0x22')](respondWithResult(_0x2f3009,null))[_0x4606('0x41')](handleError(_0x2f3009,null));};
\ No newline at end of file
+var _0xb544=['undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error','stack','name','map','ServicenowConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','create','body','getFields','findOne','ServicenowField','sort','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0xb544,0x1c8));var _0x4b54=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xb544[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x4b54('0x0'));var rimraf=require(_0x4b54('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4b54('0x2'));var BPromise=require(_0x4b54('0x3'));var Mustache=require(_0x4b54('0x4'));var util=require(_0x4b54('0x5'));var path=require(_0x4b54('0x6'));var sox=require(_0x4b54('0x7'));var csv=require(_0x4b54('0x8'));var ejs=require(_0x4b54('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b54('0xa'));var squel=require('squel');var crypto=require(_0x4b54('0xb'));var jsforce=require(_0x4b54('0xc'));var deskjs=require(_0x4b54('0xd'));var toCsv=require(_0x4b54('0x8'));var querystring=require(_0x4b54('0xe'));var Papa=require(_0x4b54('0xf'));var Redis=require('ioredis');var authService=require(_0x4b54('0x10'));var qs=require(_0x4b54('0x11'));var as=require(_0x4b54('0x12'));var hardwareService=require(_0x4b54('0x13'));var logger=require(_0x4b54('0x14'))(_0x4b54('0x15'));var utils=require(_0x4b54('0x16'));var config=require(_0x4b54('0x17'));var licenseUtil=require(_0x4b54('0x18'));var db=require(_0x4b54('0x19'))['db'];function respondWithStatusCode(_0x248a7d,_0x1004a7){_0x1004a7=_0x1004a7||0xcc;return function(_0x32b267){if(_0x32b267){return _0x248a7d[_0x4b54('0x1a')](_0x1004a7);}return _0x248a7d[_0x4b54('0x1b')](_0x1004a7)['end']();};}function respondWithResult(_0x3dc4f1,_0x2bef6d){_0x2bef6d=_0x2bef6d||0xc8;return function(_0x456851){if(_0x456851){return _0x3dc4f1[_0x4b54('0x1b')](_0x2bef6d)[_0x4b54('0x1c')](_0x456851);}};}function respondWithFilteredResult(_0x2f5e6c,_0x2c20d6){return function(_0xa76081){if(_0xa76081){var _0x9b9260=typeof _0x2c20d6[_0x4b54('0x1d')]===_0x4b54('0x1e')&&typeof _0x2c20d6[_0x4b54('0x1f')]===_0x4b54('0x1e');var _0x2adb66=_0xa76081[_0x4b54('0x20')];var _0x314c95=_0x9b9260?0x0:_0x2c20d6[_0x4b54('0x1d')];var _0x469776=_0x9b9260?_0xa76081[_0x4b54('0x20')]:_0x2c20d6[_0x4b54('0x1d')]+_0x2c20d6[_0x4b54('0x1f')];var _0x3ed850;if(_0x469776>=_0x2adb66){_0x469776=_0x2adb66;_0x3ed850=0xc8;}else{_0x3ed850=0xce;}_0x2f5e6c[_0x4b54('0x1b')](_0x3ed850);return _0x2f5e6c['set'](_0x4b54('0x21'),_0x314c95+'-'+_0x469776+'/'+_0x2adb66)['json'](_0xa76081);}return null;};}function patchUpdates(_0x456b56){return function(_0x482965){try{jsonpatch[_0x4b54('0x22')](_0x482965,_0x456b56,!![]);}catch(_0x515cb8){return BPromise['reject'](_0x515cb8);}return _0x482965[_0x4b54('0x23')]();};}function saveUpdates(_0x46619d,_0x5e72e6){return function(_0x4901c2){if(_0x4901c2){return _0x4901c2[_0x4b54('0x24')](_0x46619d)[_0x4b54('0x25')](function(_0x4f0f5f){return _0x4f0f5f;});}return null;};}function removeEntity(_0x2bea9f,_0x4bb5ac){return function(_0x19b204){if(_0x19b204){return _0x19b204[_0x4b54('0x26')]()[_0x4b54('0x25')](function(){_0x2bea9f[_0x4b54('0x1b')](0xcc)[_0x4b54('0x27')]();});}};}function handleEntityNotFound(_0x540ced,_0x24d0f0){return function(_0x1d6c03){if(!_0x1d6c03){_0x540ced[_0x4b54('0x1a')](0x194);}return _0x1d6c03;};}function handleError(_0x307a0b,_0x37d406){_0x37d406=_0x37d406||0x1f4;return function(_0x29c8cd){logger[_0x4b54('0x28')](_0x29c8cd[_0x4b54('0x29')]);if(_0x29c8cd[_0x4b54('0x2a')]){delete _0x29c8cd[_0x4b54('0x2a')];}_0x307a0b[_0x4b54('0x1b')](_0x37d406)['send'](_0x29c8cd);};}exports['index']=function(_0x34ab6a,_0x117010){var _0x4308ab={},_0xb92157={},_0x86b480={'count':0x0,'rows':[]};var _0x4e8126=_[_0x4b54('0x2b')](db[_0x4b54('0x2c')]['rawAttributes'],function(_0x148c9a){return{'name':_0x148c9a[_0x4b54('0x2d')],'type':_0x148c9a['type'][_0x4b54('0x2e')]};});_0xb92157[_0x4b54('0x2f')]=_['map'](_0x4e8126,_0x4b54('0x2a'));_0xb92157[_0x4b54('0x30')]=_[_0x4b54('0x31')](_0x34ab6a[_0x4b54('0x30')]);_0xb92157[_0x4b54('0x32')]=_[_0x4b54('0x33')](_0xb92157[_0x4b54('0x2f')],_0xb92157[_0x4b54('0x30')]);_0x4308ab[_0x4b54('0x34')]=_[_0x4b54('0x33')](_0xb92157[_0x4b54('0x2f')],qs[_0x4b54('0x35')](_0x34ab6a[_0x4b54('0x30')]['fields']));_0x4308ab['attributes']=_0x4308ab[_0x4b54('0x34')][_0x4b54('0x36')]?_0x4308ab[_0x4b54('0x34')]:_0xb92157['model'];if(!_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x37')](_0x4b54('0x38'))){_0x4308ab[_0x4b54('0x1f')]=qs['limit'](_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x1f')]);_0x4308ab['offset']=qs[_0x4b54('0x1d')](_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x1d')]);}_0x4308ab[_0x4b54('0x39')]=qs['sort'](_0x34ab6a['query']['sort']);_0x4308ab[_0x4b54('0x3a')]=qs[_0x4b54('0x32')](_[_0x4b54('0x3b')](_0x34ab6a[_0x4b54('0x30')],_0xb92157[_0x4b54('0x32')]),_0x4e8126);if(_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x3c')]){_0x4308ab['where']=_[_0x4b54('0x3d')](_0x4308ab['where'],{'$or':_[_0x4b54('0x2b')](_0x4e8126,function(_0x586a0d){if(_0x586a0d[_0x4b54('0x3e')]!==_0x4b54('0x3f')){var _0xb57b88={};_0xb57b88[_0x586a0d[_0x4b54('0x2a')]]={'$like':'%'+_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x3c')]+'%'};return _0xb57b88;}})});}_0x4308ab=_[_0x4b54('0x3d')]({},_0x4308ab,_0x34ab6a['options']);var _0x41a4d6={'where':_0x4308ab[_0x4b54('0x3a')]};return db[_0x4b54('0x2c')]['count'](_0x41a4d6)[_0x4b54('0x25')](function(_0x3cfd54){_0x86b480[_0x4b54('0x20')]=_0x3cfd54;if(_0x34ab6a['query'][_0x4b54('0x40')]){_0x4308ab['include']=[{'all':!![]}];}return db[_0x4b54('0x2c')][_0x4b54('0x41')](_0x4308ab);})[_0x4b54('0x25')](function(_0x207ec5){_0x86b480['rows']=_0x207ec5;return _0x86b480;})['then'](respondWithFilteredResult(_0x117010,_0x4308ab))[_0x4b54('0x42')](handleError(_0x117010,null));};exports[_0x4b54('0x43')]=function(_0x349799,_0x5a25b7){var _0x5ec581={'raw':![],'where':{'id':_0x349799[_0x4b54('0x44')]['id']}},_0x457c41={};_0x457c41['model']=_['keys'](db[_0x4b54('0x2c')][_0x4b54('0x45')]);_0x457c41[_0x4b54('0x30')]=_[_0x4b54('0x31')](_0x349799[_0x4b54('0x30')]);_0x457c41['filters']=_['intersection'](_0x457c41['model'],_0x457c41[_0x4b54('0x30')]);_0x5ec581[_0x4b54('0x34')]=_['intersection'](_0x457c41[_0x4b54('0x2f')],qs['fields'](_0x349799['query']['fields']));_0x5ec581['attributes']=_0x5ec581['attributes'][_0x4b54('0x36')]?_0x5ec581['attributes']:_0x457c41[_0x4b54('0x2f')];if(_0x349799[_0x4b54('0x30')][_0x4b54('0x40')]){_0x5ec581[_0x4b54('0x46')]=[{'all':!![]}];}_0x5ec581=_[_0x4b54('0x3d')]({},_0x5ec581,_0x349799[_0x4b54('0x47')]);return db[_0x4b54('0x2c')][_0x4b54('0x48')](_0x5ec581)['then'](handleEntityNotFound(_0x5a25b7,null))['then'](respondWithResult(_0x5a25b7,null))[_0x4b54('0x42')](handleError(_0x5a25b7,null));};exports[_0x4b54('0x49')]=function(_0x5b797b,_0x4c6bff){return db['ServicenowConfiguration'][_0x4b54('0x49')](_0x5b797b['body'],{})[_0x4b54('0x25')](respondWithResult(_0x4c6bff,0xc9))[_0x4b54('0x42')](handleError(_0x4c6bff,null));};exports[_0x4b54('0x24')]=function(_0x381ef2,_0x48c317){if(_0x381ef2['body']['id']){delete _0x381ef2[_0x4b54('0x4a')]['id'];}return db[_0x4b54('0x2c')][_0x4b54('0x48')]({'where':{'id':_0x381ef2[_0x4b54('0x44')]['id']}})[_0x4b54('0x25')](handleEntityNotFound(_0x48c317,null))[_0x4b54('0x25')](saveUpdates(_0x381ef2[_0x4b54('0x4a')],null))[_0x4b54('0x25')](respondWithResult(_0x48c317,null))[_0x4b54('0x42')](handleError(_0x48c317,null));};exports[_0x4b54('0x26')]=function(_0x4def89,_0xecf81d){return db[_0x4b54('0x2c')][_0x4b54('0x48')]({'where':{'id':_0x4def89[_0x4b54('0x44')]['id']}})[_0x4b54('0x25')](handleEntityNotFound(_0xecf81d,null))[_0x4b54('0x25')](removeEntity(_0xecf81d,null))[_0x4b54('0x42')](handleError(_0xecf81d,null));};exports[_0x4b54('0x4b')]=function(_0x492941,_0x4fe622,_0x5abb2c){var _0x14f96a={};var _0x11ea69={};var _0x4f0d58;var _0x4605c5;return db[_0x4b54('0x2c')][_0x4b54('0x4c')]({'where':{'id':_0x492941[_0x4b54('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fe622,null))[_0x4b54('0x25')](function(_0x20b52f){if(_0x20b52f){_0x4f0d58=_0x20b52f;_0x11ea69['model']=_[_0x4b54('0x31')](db[_0x4b54('0x4d')][_0x4b54('0x45')]);_0x11ea69[_0x4b54('0x30')]=_[_0x4b54('0x31')](_0x492941[_0x4b54('0x30')]);_0x11ea69[_0x4b54('0x32')]=_['intersection'](_0x11ea69['model'],_0x11ea69[_0x4b54('0x30')]);_0x14f96a[_0x4b54('0x34')]=_['intersection'](_0x11ea69[_0x4b54('0x2f')],qs[_0x4b54('0x35')](_0x492941['query'][_0x4b54('0x35')]));_0x14f96a[_0x4b54('0x34')]=_0x14f96a[_0x4b54('0x34')]['length']?_0x14f96a[_0x4b54('0x34')]:_0x11ea69['model'];_0x14f96a[_0x4b54('0x39')]=qs[_0x4b54('0x4e')](_0x492941[_0x4b54('0x30')][_0x4b54('0x4e')]);_0x14f96a[_0x4b54('0x3a')]=qs[_0x4b54('0x32')](_['pick'](_0x492941[_0x4b54('0x30')],_0x11ea69[_0x4b54('0x32')]));if(_0x492941[_0x4b54('0x30')][_0x4b54('0x3c')]){_0x14f96a[_0x4b54('0x3a')]=_[_0x4b54('0x3d')](_0x14f96a[_0x4b54('0x3a')],{'$or':_['map'](_0x14f96a['attributes'],function(_0xb3f93e){var _0x6ffac7={};_0x6ffac7[_0xb3f93e]={'$like':'%'+_0x492941[_0x4b54('0x30')]['filter']+'%'};return _0x6ffac7;})});}_0x14f96a=_[_0x4b54('0x3d')]({},_0x14f96a,_0x492941[_0x4b54('0x47')]);return _0x4f0d58[_0x4b54('0x4b')](_0x14f96a);}})[_0x4b54('0x25')](function(_0x52ad74){if(_0x52ad74){_0x4605c5=_0x52ad74[_0x4b54('0x36')];if(!_0x492941[_0x4b54('0x30')][_0x4b54('0x37')](_0x4b54('0x38'))){_0x14f96a[_0x4b54('0x1f')]=qs[_0x4b54('0x1f')](_0x492941[_0x4b54('0x30')][_0x4b54('0x1f')]);_0x14f96a[_0x4b54('0x1d')]=qs[_0x4b54('0x1d')](_0x492941[_0x4b54('0x30')][_0x4b54('0x1d')]);}return _0x4f0d58[_0x4b54('0x4b')](_0x14f96a);}})[_0x4b54('0x25')](function(_0x31f028){if(_0x31f028){return _0x31f028?{'count':_0x4605c5,'rows':_0x31f028}:null;}})[_0x4b54('0x25')](respondWithResult(_0x4fe622,null))['catch'](handleError(_0x4fe622,null));};exports[_0x4b54('0x4f')]=function(_0x4ccd14,_0x5c49e2,_0x2bb85f){var _0x4c9ad4={};var _0x39ca8d={};var _0xcc718b;var _0x56dabe;return db[_0x4b54('0x2c')][_0x4b54('0x4c')]({'where':{'id':_0x4ccd14[_0x4b54('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c49e2,null))[_0x4b54('0x25')](function(_0x252f11){if(_0x252f11){_0xcc718b=_0x252f11;_0x39ca8d[_0x4b54('0x2f')]=_[_0x4b54('0x31')](db[_0x4b54('0x4d')][_0x4b54('0x45')]);_0x39ca8d[_0x4b54('0x30')]=_[_0x4b54('0x31')](_0x4ccd14[_0x4b54('0x30')]);_0x39ca8d['filters']=_['intersection'](_0x39ca8d[_0x4b54('0x2f')],_0x39ca8d['query']);_0x4c9ad4[_0x4b54('0x34')]=_['intersection'](_0x39ca8d[_0x4b54('0x2f')],qs[_0x4b54('0x35')](_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x35')]));_0x4c9ad4[_0x4b54('0x34')]=_0x4c9ad4[_0x4b54('0x34')][_0x4b54('0x36')]?_0x4c9ad4[_0x4b54('0x34')]:_0x39ca8d['model'];_0x4c9ad4['order']=qs[_0x4b54('0x4e')](_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x4e')]);_0x4c9ad4[_0x4b54('0x3a')]=qs['filters'](_[_0x4b54('0x3b')](_0x4ccd14[_0x4b54('0x30')],_0x39ca8d[_0x4b54('0x32')]));if(_0x4ccd14[_0x4b54('0x30')]['filter']){_0x4c9ad4[_0x4b54('0x3a')]=_[_0x4b54('0x3d')](_0x4c9ad4[_0x4b54('0x3a')],{'$or':_['map'](_0x4c9ad4[_0x4b54('0x34')],function(_0x1d597f){var _0x506d36={};_0x506d36[_0x1d597f]={'$like':'%'+_0x4ccd14['query'][_0x4b54('0x3c')]+'%'};return _0x506d36;})});}_0x4c9ad4=_[_0x4b54('0x3d')]({},_0x4c9ad4,_0x4ccd14[_0x4b54('0x47')]);return _0xcc718b[_0x4b54('0x4f')](_0x4c9ad4);}})[_0x4b54('0x25')](function(_0x138778){if(_0x138778){_0x56dabe=_0x138778['length'];if(!_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x37')](_0x4b54('0x38'))){_0x4c9ad4[_0x4b54('0x1f')]=qs[_0x4b54('0x1f')](_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x1f')]);_0x4c9ad4['offset']=qs[_0x4b54('0x1d')](_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x1d')]);}return _0xcc718b[_0x4b54('0x4f')](_0x4c9ad4);}})[_0x4b54('0x25')](function(_0x101e3a){if(_0x101e3a){return _0x101e3a?{'count':_0x56dabe,'rows':_0x101e3a}:null;}})[_0x4b54('0x25')](respondWithResult(_0x5c49e2,null))[_0x4b54('0x42')](handleError(_0x5c49e2,null));};exports[_0x4b54('0x50')]=function(_0x561152,_0x30143e,_0x30247d){var _0x57c943={};var _0x542219={};var _0xb8f8e5;var _0x3baba6;return db[_0x4b54('0x2c')][_0x4b54('0x4c')]({'where':{'id':_0x561152[_0x4b54('0x44')]['id']}})[_0x4b54('0x25')](handleEntityNotFound(_0x30143e,null))[_0x4b54('0x25')](function(_0x53f613){if(_0x53f613){_0xb8f8e5=_0x53f613;_0x542219[_0x4b54('0x2f')]=_[_0x4b54('0x31')](db['ServicenowField'][_0x4b54('0x45')]);_0x542219['query']=_[_0x4b54('0x31')](_0x561152['query']);_0x542219['filters']=_[_0x4b54('0x33')](_0x542219['model'],_0x542219[_0x4b54('0x30')]);_0x57c943['attributes']=_[_0x4b54('0x33')](_0x542219['model'],qs[_0x4b54('0x35')](_0x561152[_0x4b54('0x30')][_0x4b54('0x35')]));_0x57c943[_0x4b54('0x34')]=_0x57c943[_0x4b54('0x34')][_0x4b54('0x36')]?_0x57c943[_0x4b54('0x34')]:_0x542219[_0x4b54('0x2f')];_0x57c943['order']=qs[_0x4b54('0x4e')](_0x561152['query']['sort']);_0x57c943[_0x4b54('0x3a')]=qs[_0x4b54('0x32')](_[_0x4b54('0x3b')](_0x561152[_0x4b54('0x30')],_0x542219[_0x4b54('0x32')]));if(_0x561152['query']['filter']){_0x57c943[_0x4b54('0x3a')]=_[_0x4b54('0x3d')](_0x57c943['where'],{'$or':_[_0x4b54('0x2b')](_0x57c943[_0x4b54('0x34')],function(_0xedb3b8){var _0x2f0beb={};_0x2f0beb[_0xedb3b8]={'$like':'%'+_0x561152[_0x4b54('0x30')][_0x4b54('0x3c')]+'%'};return _0x2f0beb;})});}_0x57c943=_[_0x4b54('0x3d')]({},_0x57c943,_0x561152['options']);return _0xb8f8e5[_0x4b54('0x50')](_0x57c943);}})[_0x4b54('0x25')](function(_0x1c6168){if(_0x1c6168){_0x3baba6=_0x1c6168[_0x4b54('0x36')];if(!_0x561152[_0x4b54('0x30')][_0x4b54('0x37')](_0x4b54('0x38'))){_0x57c943[_0x4b54('0x1f')]=qs[_0x4b54('0x1f')](_0x561152[_0x4b54('0x30')][_0x4b54('0x1f')]);_0x57c943['offset']=qs[_0x4b54('0x1d')](_0x561152[_0x4b54('0x30')]['offset']);}return _0xb8f8e5[_0x4b54('0x50')](_0x57c943);}})[_0x4b54('0x25')](function(_0xb89383){if(_0xb89383){return _0xb89383?{'count':_0x3baba6,'rows':_0xb89383}:null;}})[_0x4b54('0x25')](respondWithResult(_0x30143e,null))['catch'](handleError(_0x30143e,null));};
\ No newline at end of file
index 3be2b99..8df2559 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf846=['ServicenowConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xf846,0x85));var _0x6f84=function(_0x1294b4,_0x32c1bd){_0x1294b4=_0x1294b4-0x0;var _0x232147=_0xf846[_0x1294b4];return _0x232147;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var logger=require(_0x6f84('0x2'))(_0x6f84('0x3'));var moment=require('moment');var BPromise=require(_0x6f84('0x4'));var rp=require(_0x6f84('0x5'));var fs=require('fs');var path=require(_0x6f84('0x6'));var rimraf=require(_0x6f84('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f84('0x8'));module[_0x6f84('0x9')]=function(_0x2963cd,_0x25e3c2){return _0x2963cd[_0x6f84('0xa')](_0x6f84('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xefe3=['../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','moment','bluebird','request-promise','path'];(function(_0x18fe01,_0x3520a6){var _0xcf894e=function(_0x314de2){while(--_0x314de2){_0x18fe01['push'](_0x18fe01['shift']());}};_0xcf894e(++_0x3520a6);}(_0xefe3,0xf5));var _0x3efe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xefe3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3efe('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3efe('0x1'));var BPromise=require(_0x3efe('0x2'));var rp=require(_0x3efe('0x3'));var fs=require('fs');var path=require(_0x3efe('0x4'));var rimraf=require('rimraf');var config=require(_0x3efe('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x3efe('0x6')]=function(_0x4b5006,_0x3a1c0a){return _0x4b5006[_0x3efe('0x7')](_0x3efe('0x8'),attributes,{'tableName':_0x3efe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 99598a1..7963df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a41=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1190c2,_0x2c078b){var _0x6ec988=function(_0x333cdf){while(--_0x333cdf){_0x1190c2['push'](_0x1190c2['shift']());}};_0x6ec988(++_0x2c078b);}(_0x3a41,0x151));var _0x13a4=function(_0x39ec06,_0xa5e032){_0x39ec06=_0x39ec06-0x0;var _0x43c12f=_0x3a41[_0x39ec06];return _0x43c12f;};'use strict';var _=require(_0x13a4('0x0'));var util=require('util');var moment=require(_0x13a4('0x1'));var BPromise=require(_0x13a4('0x2'));var rs=require(_0x13a4('0x3'));var fs=require('fs');var Redis=require(_0x13a4('0x4'));var db=require(_0x13a4('0x5'))['db'];var utils=require(_0x13a4('0x6'));var logger=require(_0x13a4('0x7'))(_0x13a4('0x8'));var config=require(_0x13a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x13a4('0xa')][_0x13a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x536830,_0x4a852d,_0x434bc9){return new BPromise(function(_0x57018e,_0x470283){return client[_0x13a4('0xc')](_0x536830,_0x434bc9)[_0x13a4('0xd')](function(_0x419cd1){logger[_0x13a4('0xe')](_0x13a4('0xf'),_0x4a852d,_0x13a4('0x10'));logger['debug'](_0x13a4('0x11'),_0x4a852d,_0x13a4('0x10'),JSON[_0x13a4('0x12')](_0x419cd1));if(_0x419cd1[_0x13a4('0x13')]){if(_0x419cd1[_0x13a4('0x13')][_0x13a4('0x14')]===0x1f4){logger[_0x13a4('0x13')](_0x13a4('0xf'),_0x4a852d,_0x419cd1['error'][_0x13a4('0x15')]);return _0x470283(_0x419cd1['error'][_0x13a4('0x15')]);}logger[_0x13a4('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4a852d,_0x419cd1[_0x13a4('0x13')]['message']);return _0x57018e(_0x419cd1[_0x13a4('0x13')][_0x13a4('0x15')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x4a852d,_0x13a4('0x10'));_0x57018e(_0x419cd1[_0x13a4('0x16')]['message']);}})[_0x13a4('0x17')](function(_0x430c31){logger['error'](_0x13a4('0xf'),_0x4a852d,_0x430c31);_0x470283(_0x430c31);});});}
\ No newline at end of file
+var _0x9412=['message','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x2d9a9c,_0x41bc4f){var _0x545d62=function(_0x4ad081){while(--_0x4ad081){_0x2d9a9c['push'](_0x2d9a9c['shift']());}};_0x545d62(++_0x41bc4f);}(_0x9412,0x8e));var _0x2941=function(_0x4cf9ff,_0x4c228c){_0x4cf9ff=_0x4cf9ff-0x0;var _0x406153=_0x9412[_0x4cf9ff];return _0x406153;};'use strict';var _=require(_0x2941('0x0'));var util=require(_0x2941('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2941('0x2'));var fs=require('fs');var Redis=require(_0x2941('0x3'));var db=require(_0x2941('0x4'))['db'];var utils=require(_0x2941('0x5'));var logger=require(_0x2941('0x6'))(_0x2941('0x7'));var config=require(_0x2941('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2941('0x9')][_0x2941('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8b580e,_0x1562f6,_0xf5e5fa){return new BPromise(function(_0x39cf21,_0x5d7001){return client[_0x2941('0xb')](_0x8b580e,_0xf5e5fa)[_0x2941('0xc')](function(_0x17d7f5){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x1562f6,_0x2941('0xd'));logger['debug'](_0x2941('0xe'),_0x1562f6,_0x2941('0xd'),JSON['stringify'](_0x17d7f5));if(_0x17d7f5[_0x2941('0xf')]){if(_0x17d7f5[_0x2941('0xf')][_0x2941('0x10')]===0x1f4){logger[_0x2941('0xf')](_0x2941('0x11'),_0x1562f6,_0x17d7f5[_0x2941('0xf')][_0x2941('0x12')]);return _0x5d7001(_0x17d7f5[_0x2941('0xf')][_0x2941('0x12')]);}logger[_0x2941('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1562f6,_0x17d7f5['error']['message']);return _0x39cf21(_0x17d7f5['error'][_0x2941('0x12')]);}else{logger[_0x2941('0x13')](_0x2941('0x11'),_0x1562f6,_0x2941('0xd'));_0x39cf21(_0x17d7f5['result'][_0x2941('0x12')]);}})['catch'](function(_0xc22c48){logger[_0x2941('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1562f6,_0xc22c48);_0x5d7001(_0xc22c48);});});}
\ No newline at end of file
index 0661d4d..7da9915 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc015=['delete','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x48e54e,_0x309575){var _0x79f99a=function(_0x5e4e73){while(--_0x5e4e73){_0x48e54e['push'](_0x48e54e['shift']());}};_0x79f99a(++_0x309575);}(_0xc015,0x155));var _0x5c01=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0xc015[_0x4b1032];return _0x5a1d55;};'use strict';var multer=require('multer');var util=require(_0x5c01('0x0'));var path=require(_0x5c01('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5c01('0x2')]();var fs_extra=require(_0x5c01('0x3'));var auth=require(_0x5c01('0x4'));var interaction=require(_0x5c01('0x5'));var config=require(_0x5c01('0x6'));var controller=require('./intServicenowField.controller');router[_0x5c01('0x7')]('/',auth[_0x5c01('0x8')](),controller[_0x5c01('0x9')]);router[_0x5c01('0x7')](_0x5c01('0xa'),auth['isAuthenticated'](),controller[_0x5c01('0xb')]);router[_0x5c01('0xc')]('/',auth[_0x5c01('0x8')](),controller[_0x5c01('0xd')]);router[_0x5c01('0xe')](_0x5c01('0xa'),auth[_0x5c01('0x8')](),controller[_0x5c01('0xf')]);router[_0x5c01('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x928c=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x928c,0xa8));var _0xc928=function(_0x2bb24f,_0x23887a){_0x2bb24f=_0x2bb24f-0x0;var _0x56196a=_0x928c[_0x2bb24f];return _0x56196a;};'use strict';var multer=require(_0xc928('0x0'));var util=require(_0xc928('0x1'));var path=require(_0xc928('0x2'));var timeout=require(_0xc928('0x3'));var express=require(_0xc928('0x4'));var router=express[_0xc928('0x5')]();var fs_extra=require(_0xc928('0x6'));var auth=require(_0xc928('0x7'));var interaction=require(_0xc928('0x8'));var config=require(_0xc928('0x9'));var controller=require(_0xc928('0xa'));router[_0xc928('0xb')]('/',auth[_0xc928('0xc')](),controller[_0xc928('0xd')]);router[_0xc928('0xb')](_0xc928('0xe'),auth[_0xc928('0xc')](),controller[_0xc928('0xf')]);router[_0xc928('0x10')]('/',auth[_0xc928('0xc')](),controller[_0xc928('0x11')]);router[_0xc928('0x12')]('/:id',auth[_0xc928('0xc')](),controller[_0xc928('0x13')]);router[_0xc928('0x14')](_0xc928('0xe'),auth[_0xc928('0xc')](),controller[_0xc928('0x15')]);module[_0xc928('0x16')]=router;
\ No newline at end of file
index 699c857..a5beeef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe35c=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM'];(function(_0x149221,_0x4099ad){var _0xb08d4f=function(_0x4912d2){while(--_0x4912d2){_0x149221['push'](_0x149221['shift']());}};_0xb08d4f(++_0x4099ad);}(_0xe35c,0x1df));var _0xce35=function(_0x1b41f1,_0x1a8079){_0x1b41f1=_0x1b41f1-0x0;var _0x58eec4=_0xe35c[_0x1b41f1];return _0x58eec4;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xce35('0x0')](_0xce35('0x1'),_0xce35('0x2'),_0xce35('0x3'),_0xce35('0x4'),_0xce35('0x5')),'defaultValue':_0xce35('0x1')},'content':{'type':Sequelize[_0xce35('0x6')]},'key':{'type':Sequelize[_0xce35('0x6')]},'keyType':{'type':Sequelize[_0xce35('0x0')]('string',_0xce35('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xce35('0x6')]},'idField':{'type':Sequelize[_0xce35('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xce35('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xce35('0x6')]}};
\ No newline at end of file
+var _0x34af=['exports','ENUM','variable','customVariable','string','STRING','BOOLEAN','sequelize'];(function(_0x247d4f,_0x750292){var _0x521893=function(_0x40cdac){while(--_0x40cdac){_0x247d4f['push'](_0x247d4f['shift']());}};_0x521893(++_0x750292);}(_0x34af,0x18f));var _0xf34a=function(_0x46bc19,_0x84350c){_0x46bc19=_0x46bc19-0x0;var _0x54dbc8=_0x34af[_0x46bc19];return _0x54dbc8;};'use strict';var Sequelize=require(_0xf34a('0x0'));module[_0xf34a('0x1')]={'type':{'type':Sequelize[_0xf34a('0x2')]('string',_0xf34a('0x3'),_0xf34a('0x4'),'keyValue','picklist'),'defaultValue':_0xf34a('0x5')},'content':{'type':Sequelize[_0xf34a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf34a('0x5'),'variable',_0xf34a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf34a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf34a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf34a('0x6')]}};
\ No newline at end of file
index d5a7390..08c903c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd5a=['update','then','destroy','error','stack','name','send','index','map','ServicenowField','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','include','rows','catch','show','params','keys','rawAttributes','includeAll','options','create','body','find','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save'];(function(_0x4c0527,_0x213772){var _0x34a16a=function(_0x165e71){while(--_0x165e71){_0x4c0527['push'](_0x4c0527['shift']());}};_0x34a16a(++_0x213772);}(_0xdd5a,0x19e));var _0xadd5=function(_0x1721b0,_0x3ecd34){_0x1721b0=_0x1721b0-0x0;var _0x89a264=_0xdd5a[_0x1721b0];return _0x89a264;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xadd5('0x0'));var zipdir=require(_0xadd5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadd5('0x2'));var moment=require('moment');var BPromise=require(_0xadd5('0x3'));var Mustache=require('mustache');var util=require(_0xadd5('0x4'));var path=require(_0xadd5('0x5'));var sox=require(_0xadd5('0x6'));var csv=require(_0xadd5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xadd5('0x8'));var _=require(_0xadd5('0x9'));var squel=require(_0xadd5('0xa'));var crypto=require('crypto');var jsforce=require(_0xadd5('0xb'));var deskjs=require(_0xadd5('0xc'));var toCsv=require(_0xadd5('0x7'));var querystring=require(_0xadd5('0xd'));var Papa=require(_0xadd5('0xe'));var Redis=require(_0xadd5('0xf'));var authService=require(_0xadd5('0x10'));var qs=require(_0xadd5('0x11'));var as=require(_0xadd5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadd5('0x13'))('api');var utils=require(_0xadd5('0x14'));var config=require(_0xadd5('0x15'));var licenseUtil=require(_0xadd5('0x16'));var db=require(_0xadd5('0x17'))['db'];function respondWithStatusCode(_0x434cf7,_0x43820a){_0x43820a=_0x43820a||0xcc;return function(_0x4d9bbb){if(_0x4d9bbb){return _0x434cf7[_0xadd5('0x18')](_0x43820a);}return _0x434cf7[_0xadd5('0x19')](_0x43820a)[_0xadd5('0x1a')]();};}function respondWithResult(_0x3ce72f,_0x1ccee4){_0x1ccee4=_0x1ccee4||0xc8;return function(_0xb7ce7c){if(_0xb7ce7c){return _0x3ce72f[_0xadd5('0x19')](_0x1ccee4)[_0xadd5('0x1b')](_0xb7ce7c);}};}function respondWithFilteredResult(_0x8da0c5,_0x4a3af0){return function(_0x3cc14e){if(_0x3cc14e){var _0x82291a=typeof _0x4a3af0['offset']==='undefined'&&typeof _0x4a3af0[_0xadd5('0x1c')]===_0xadd5('0x1d');var _0x5164e0=_0x3cc14e[_0xadd5('0x1e')];var _0x46076f=_0x82291a?0x0:_0x4a3af0[_0xadd5('0x1f')];var _0x4a6bec=_0x82291a?_0x3cc14e[_0xadd5('0x1e')]:_0x4a3af0[_0xadd5('0x1f')]+_0x4a3af0[_0xadd5('0x1c')];var _0x3114ce;if(_0x4a6bec>=_0x5164e0){_0x4a6bec=_0x5164e0;_0x3114ce=0xc8;}else{_0x3114ce=0xce;}_0x8da0c5['status'](_0x3114ce);return _0x8da0c5[_0xadd5('0x20')]('Content-Range',_0x46076f+'-'+_0x4a6bec+'/'+_0x5164e0)['json'](_0x3cc14e);}return null;};}function patchUpdates(_0x3dddc7){return function(_0x344b31){try{jsonpatch[_0xadd5('0x21')](_0x344b31,_0x3dddc7,!![]);}catch(_0x5514de){return BPromise[_0xadd5('0x22')](_0x5514de);}return _0x344b31[_0xadd5('0x23')]();};}function saveUpdates(_0x592b86,_0x273291){return function(_0x103c72){if(_0x103c72){return _0x103c72[_0xadd5('0x24')](_0x592b86)[_0xadd5('0x25')](function(_0x2b0a0a){return _0x2b0a0a;});}return null;};}function removeEntity(_0x350fc5,_0x2af5c8){return function(_0x50d4de){if(_0x50d4de){return _0x50d4de[_0xadd5('0x26')]()[_0xadd5('0x25')](function(){_0x350fc5[_0xadd5('0x19')](0xcc)[_0xadd5('0x1a')]();});}};}function handleEntityNotFound(_0x42ee7d,_0x375c0f){return function(_0xdc5d55){if(!_0xdc5d55){_0x42ee7d[_0xadd5('0x18')](0x194);}return _0xdc5d55;};}function handleError(_0x2f5e86,_0x530163){_0x530163=_0x530163||0x1f4;return function(_0x2be9ba){logger[_0xadd5('0x27')](_0x2be9ba[_0xadd5('0x28')]);if(_0x2be9ba['name']){delete _0x2be9ba[_0xadd5('0x29')];}_0x2f5e86[_0xadd5('0x19')](_0x530163)[_0xadd5('0x2a')](_0x2be9ba);};}exports[_0xadd5('0x2b')]=function(_0x2e356f,_0x5d2c09){var _0x31acc6={},_0x92e7d9={},_0x36a619={'count':0x0,'rows':[]};var _0x27d543=_[_0xadd5('0x2c')](db[_0xadd5('0x2d')]['rawAttributes'],function(_0x44a1e9){return{'name':_0x44a1e9['fieldName'],'type':_0x44a1e9[_0xadd5('0x2e')][_0xadd5('0x2f')]};});_0x92e7d9['model']=_[_0xadd5('0x2c')](_0x27d543,_0xadd5('0x29'));_0x92e7d9[_0xadd5('0x30')]=_['keys'](_0x2e356f[_0xadd5('0x30')]);_0x92e7d9[_0xadd5('0x31')]=_[_0xadd5('0x32')](_0x92e7d9[_0xadd5('0x33')],_0x92e7d9[_0xadd5('0x30')]);_0x31acc6[_0xadd5('0x34')]=_['intersection'](_0x92e7d9[_0xadd5('0x33')],qs[_0xadd5('0x35')](_0x2e356f[_0xadd5('0x30')][_0xadd5('0x35')]));_0x31acc6[_0xadd5('0x34')]=_0x31acc6[_0xadd5('0x34')][_0xadd5('0x36')]?_0x31acc6[_0xadd5('0x34')]:_0x92e7d9[_0xadd5('0x33')];if(!_0x2e356f['query'][_0xadd5('0x37')](_0xadd5('0x38'))){_0x31acc6['limit']=qs['limit'](_0x2e356f['query'][_0xadd5('0x1c')]);_0x31acc6[_0xadd5('0x1f')]=qs[_0xadd5('0x1f')](_0x2e356f[_0xadd5('0x30')][_0xadd5('0x1f')]);}_0x31acc6['order']=qs[_0xadd5('0x39')](_0x2e356f[_0xadd5('0x30')][_0xadd5('0x39')]);_0x31acc6[_0xadd5('0x3a')]=qs[_0xadd5('0x31')](_[_0xadd5('0x3b')](_0x2e356f['query'],_0x92e7d9[_0xadd5('0x31')]),_0x27d543);if(_0x2e356f[_0xadd5('0x30')][_0xadd5('0x3c')]){_0x31acc6[_0xadd5('0x3a')]=_['merge'](_0x31acc6[_0xadd5('0x3a')],{'$or':_['map'](_0x27d543,function(_0x501ccb){if(_0x501ccb[_0xadd5('0x2e')]!==_0xadd5('0x3d')){var _0x1db873={};_0x1db873[_0x501ccb[_0xadd5('0x29')]]={'$like':'%'+_0x2e356f[_0xadd5('0x30')]['filter']+'%'};return _0x1db873;}})});}_0x31acc6=_[_0xadd5('0x3e')]({},_0x31acc6,_0x2e356f['options']);var _0x3b4cd0={'where':_0x31acc6[_0xadd5('0x3a')]};return db['ServicenowField'][_0xadd5('0x1e')](_0x3b4cd0)[_0xadd5('0x25')](function(_0x36b540){_0x36a619['count']=_0x36b540;if(_0x2e356f[_0xadd5('0x30')]['includeAll']){_0x31acc6[_0xadd5('0x3f')]=[{'all':!![]}];}return db[_0xadd5('0x2d')]['findAll'](_0x31acc6);})[_0xadd5('0x25')](function(_0x3cec23){_0x36a619[_0xadd5('0x40')]=_0x3cec23;return _0x36a619;})[_0xadd5('0x25')](respondWithFilteredResult(_0x5d2c09,_0x31acc6))[_0xadd5('0x41')](handleError(_0x5d2c09,null));};exports[_0xadd5('0x42')]=function(_0x35b825,_0x237646){var _0x23e11e={'raw':!![],'where':{'id':_0x35b825[_0xadd5('0x43')]['id']}},_0x5c3f74={};_0x5c3f74['model']=_[_0xadd5('0x44')](db[_0xadd5('0x2d')][_0xadd5('0x45')]);_0x5c3f74[_0xadd5('0x30')]=_[_0xadd5('0x44')](_0x35b825[_0xadd5('0x30')]);_0x5c3f74['filters']=_[_0xadd5('0x32')](_0x5c3f74[_0xadd5('0x33')],_0x5c3f74[_0xadd5('0x30')]);_0x23e11e['attributes']=_[_0xadd5('0x32')](_0x5c3f74[_0xadd5('0x33')],qs['fields'](_0x35b825['query'][_0xadd5('0x35')]));_0x23e11e[_0xadd5('0x34')]=_0x23e11e[_0xadd5('0x34')][_0xadd5('0x36')]?_0x23e11e[_0xadd5('0x34')]:_0x5c3f74[_0xadd5('0x33')];if(_0x35b825[_0xadd5('0x30')][_0xadd5('0x46')]){_0x23e11e[_0xadd5('0x3f')]=[{'all':!![]}];}_0x23e11e=_[_0xadd5('0x3e')]({},_0x23e11e,_0x35b825[_0xadd5('0x47')]);return db[_0xadd5('0x2d')]['find'](_0x23e11e)['then'](handleEntityNotFound(_0x237646,null))[_0xadd5('0x25')](respondWithResult(_0x237646,null))['catch'](handleError(_0x237646,null));};exports[_0xadd5('0x48')]=function(_0x4a0e1d,_0x1900b2){return db[_0xadd5('0x2d')][_0xadd5('0x48')](_0x4a0e1d[_0xadd5('0x49')],{})[_0xadd5('0x25')](respondWithResult(_0x1900b2,0xc9))[_0xadd5('0x41')](handleError(_0x1900b2,null));};exports[_0xadd5('0x24')]=function(_0x4c8222,_0x14449f){if(_0x4c8222[_0xadd5('0x49')]['id']){delete _0x4c8222['body']['id'];}return db['ServicenowField'][_0xadd5('0x4a')]({'where':{'id':_0x4c8222[_0xadd5('0x43')]['id']}})[_0xadd5('0x25')](handleEntityNotFound(_0x14449f,null))[_0xadd5('0x25')](saveUpdates(_0x4c8222[_0xadd5('0x49')],null))[_0xadd5('0x25')](respondWithResult(_0x14449f,null))[_0xadd5('0x41')](handleError(_0x14449f,null));};exports[_0xadd5('0x26')]=function(_0x39ad10,_0x526085){return db['ServicenowField']['find']({'where':{'id':_0x39ad10[_0xadd5('0x43')]['id']}})['then'](handleEntityNotFound(_0x526085,null))[_0xadd5('0x25')](removeEntity(_0x526085,null))[_0xadd5('0x41')](handleError(_0x526085,null));};
\ No newline at end of file
+var _0xbad2=['sendStatus','end','json','limit','count','offset','status','set','Content-Range','apply','reject','then','destroy','error','stack','name','map','ServicenowField','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','rawAttributes','options','create','body','catch','update','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xbad2,0x19e));var _0x2bad=function(_0x3a7f98,_0x1eec2a){_0x3a7f98=_0x3a7f98-0x0;var _0x34d3a2=_0xbad2[_0x3a7f98];return _0x34d3a2;};'use strict';var emlformat=require(_0x2bad('0x0'));var rimraf=require(_0x2bad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2bad('0x2'));var rp=require('request-promise');var moment=require(_0x2bad('0x3'));var BPromise=require(_0x2bad('0x4'));var Mustache=require(_0x2bad('0x5'));var util=require('util');var path=require(_0x2bad('0x6'));var sox=require(_0x2bad('0x7'));var csv=require(_0x2bad('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bad('0x9'));var _=require(_0x2bad('0xa'));var squel=require(_0x2bad('0xb'));var crypto=require('crypto');var jsforce=require(_0x2bad('0xc'));var deskjs=require(_0x2bad('0xd'));var toCsv=require(_0x2bad('0x8'));var querystring=require('querystring');var Papa=require(_0x2bad('0xe'));var Redis=require(_0x2bad('0xf'));var authService=require(_0x2bad('0x10'));var qs=require(_0x2bad('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2bad('0x12'));var logger=require('../../config/logger')(_0x2bad('0x13'));var utils=require(_0x2bad('0x14'));var config=require(_0x2bad('0x15'));var licenseUtil=require(_0x2bad('0x16'));var db=require(_0x2bad('0x17'))['db'];function respondWithStatusCode(_0x2af310,_0x32b9e3){_0x32b9e3=_0x32b9e3||0xcc;return function(_0x287bfe){if(_0x287bfe){return _0x2af310[_0x2bad('0x18')](_0x32b9e3);}return _0x2af310['status'](_0x32b9e3)[_0x2bad('0x19')]();};}function respondWithResult(_0x3cb645,_0x425d28){_0x425d28=_0x425d28||0xc8;return function(_0x579811){if(_0x579811){return _0x3cb645['status'](_0x425d28)[_0x2bad('0x1a')](_0x579811);}};}function respondWithFilteredResult(_0x220047,_0x12d04b){return function(_0x505d22){if(_0x505d22){var _0x2af4d1=typeof _0x12d04b['offset']==='undefined'&&typeof _0x12d04b[_0x2bad('0x1b')]==='undefined';var _0x20d0d1=_0x505d22[_0x2bad('0x1c')];var _0xf82190=_0x2af4d1?0x0:_0x12d04b[_0x2bad('0x1d')];var _0x3b8d9d=_0x2af4d1?_0x505d22[_0x2bad('0x1c')]:_0x12d04b[_0x2bad('0x1d')]+_0x12d04b[_0x2bad('0x1b')];var _0x479893;if(_0x3b8d9d>=_0x20d0d1){_0x3b8d9d=_0x20d0d1;_0x479893=0xc8;}else{_0x479893=0xce;}_0x220047[_0x2bad('0x1e')](_0x479893);return _0x220047[_0x2bad('0x1f')](_0x2bad('0x20'),_0xf82190+'-'+_0x3b8d9d+'/'+_0x20d0d1)[_0x2bad('0x1a')](_0x505d22);}return null;};}function patchUpdates(_0x347239){return function(_0x1625a9){try{jsonpatch[_0x2bad('0x21')](_0x1625a9,_0x347239,!![]);}catch(_0x3358f0){return BPromise[_0x2bad('0x22')](_0x3358f0);}return _0x1625a9['save']();};}function saveUpdates(_0x45b153,_0x54a2cf){return function(_0xa89c98){if(_0xa89c98){return _0xa89c98['update'](_0x45b153)[_0x2bad('0x23')](function(_0x3a396c){return _0x3a396c;});}return null;};}function removeEntity(_0x1695c0,_0x57b682){return function(_0x2684b4){if(_0x2684b4){return _0x2684b4[_0x2bad('0x24')]()[_0x2bad('0x23')](function(){_0x1695c0[_0x2bad('0x1e')](0xcc)[_0x2bad('0x19')]();});}};}function handleEntityNotFound(_0x39408e,_0x378299){return function(_0x91d38c){if(!_0x91d38c){_0x39408e['sendStatus'](0x194);}return _0x91d38c;};}function handleError(_0x26b2b2,_0x54959f){_0x54959f=_0x54959f||0x1f4;return function(_0x123cb4){logger[_0x2bad('0x25')](_0x123cb4[_0x2bad('0x26')]);if(_0x123cb4['name']){delete _0x123cb4[_0x2bad('0x27')];}_0x26b2b2['status'](_0x54959f)['send'](_0x123cb4);};}exports['index']=function(_0x96f263,_0x4cae57){var _0x2c19c3={},_0x10e872={},_0x146a91={'count':0x0,'rows':[]};var _0x261414=_[_0x2bad('0x28')](db[_0x2bad('0x29')]['rawAttributes'],function(_0x46cdce){return{'name':_0x46cdce[_0x2bad('0x2a')],'type':_0x46cdce['type'][_0x2bad('0x2b')]};});_0x10e872['model']=_[_0x2bad('0x28')](_0x261414,_0x2bad('0x27'));_0x10e872[_0x2bad('0x2c')]=_[_0x2bad('0x2d')](_0x96f263[_0x2bad('0x2c')]);_0x10e872[_0x2bad('0x2e')]=_[_0x2bad('0x2f')](_0x10e872[_0x2bad('0x30')],_0x10e872[_0x2bad('0x2c')]);_0x2c19c3[_0x2bad('0x31')]=_[_0x2bad('0x2f')](_0x10e872[_0x2bad('0x30')],qs[_0x2bad('0x32')](_0x96f263[_0x2bad('0x2c')][_0x2bad('0x32')]));_0x2c19c3['attributes']=_0x2c19c3[_0x2bad('0x31')][_0x2bad('0x33')]?_0x2c19c3['attributes']:_0x10e872['model'];if(!_0x96f263[_0x2bad('0x2c')][_0x2bad('0x34')]('nolimit')){_0x2c19c3['limit']=qs[_0x2bad('0x1b')](_0x96f263[_0x2bad('0x2c')][_0x2bad('0x1b')]);_0x2c19c3['offset']=qs['offset'](_0x96f263[_0x2bad('0x2c')]['offset']);}_0x2c19c3[_0x2bad('0x35')]=qs['sort'](_0x96f263[_0x2bad('0x2c')][_0x2bad('0x36')]);_0x2c19c3[_0x2bad('0x37')]=qs['filters'](_[_0x2bad('0x38')](_0x96f263['query'],_0x10e872[_0x2bad('0x2e')]),_0x261414);if(_0x96f263[_0x2bad('0x2c')][_0x2bad('0x39')]){_0x2c19c3[_0x2bad('0x37')]=_[_0x2bad('0x3a')](_0x2c19c3['where'],{'$or':_[_0x2bad('0x28')](_0x261414,function(_0x46c250){if(_0x46c250[_0x2bad('0x3b')]!=='VIRTUAL'){var _0x4343ca={};_0x4343ca[_0x46c250[_0x2bad('0x27')]]={'$like':'%'+_0x96f263[_0x2bad('0x2c')][_0x2bad('0x39')]+'%'};return _0x4343ca;}})});}_0x2c19c3=_[_0x2bad('0x3a')]({},_0x2c19c3,_0x96f263['options']);var _0x7e881e={'where':_0x2c19c3[_0x2bad('0x37')]};return db['ServicenowField'][_0x2bad('0x1c')](_0x7e881e)[_0x2bad('0x23')](function(_0x2cf122){_0x146a91['count']=_0x2cf122;if(_0x96f263[_0x2bad('0x2c')][_0x2bad('0x3c')]){_0x2c19c3[_0x2bad('0x3d')]=[{'all':!![]}];}return db[_0x2bad('0x29')][_0x2bad('0x3e')](_0x2c19c3);})[_0x2bad('0x23')](function(_0x39640d){_0x146a91[_0x2bad('0x3f')]=_0x39640d;return _0x146a91;})['then'](respondWithFilteredResult(_0x4cae57,_0x2c19c3))['catch'](handleError(_0x4cae57,null));};exports[_0x2bad('0x40')]=function(_0x2fe31c,_0x3020fd){var _0x5c48fb={'raw':!![],'where':{'id':_0x2fe31c[_0x2bad('0x41')]['id']}},_0x11beae={};_0x11beae['model']=_[_0x2bad('0x2d')](db['ServicenowField'][_0x2bad('0x42')]);_0x11beae['query']=_[_0x2bad('0x2d')](_0x2fe31c[_0x2bad('0x2c')]);_0x11beae[_0x2bad('0x2e')]=_[_0x2bad('0x2f')](_0x11beae[_0x2bad('0x30')],_0x11beae['query']);_0x5c48fb[_0x2bad('0x31')]=_[_0x2bad('0x2f')](_0x11beae[_0x2bad('0x30')],qs[_0x2bad('0x32')](_0x2fe31c[_0x2bad('0x2c')]['fields']));_0x5c48fb['attributes']=_0x5c48fb[_0x2bad('0x31')][_0x2bad('0x33')]?_0x5c48fb[_0x2bad('0x31')]:_0x11beae[_0x2bad('0x30')];if(_0x2fe31c[_0x2bad('0x2c')]['includeAll']){_0x5c48fb[_0x2bad('0x3d')]=[{'all':!![]}];}_0x5c48fb=_[_0x2bad('0x3a')]({},_0x5c48fb,_0x2fe31c[_0x2bad('0x43')]);return db[_0x2bad('0x29')]['find'](_0x5c48fb)[_0x2bad('0x23')](handleEntityNotFound(_0x3020fd,null))[_0x2bad('0x23')](respondWithResult(_0x3020fd,null))['catch'](handleError(_0x3020fd,null));};exports[_0x2bad('0x44')]=function(_0x393b68,_0x3e71fb){return db['ServicenowField']['create'](_0x393b68[_0x2bad('0x45')],{})[_0x2bad('0x23')](respondWithResult(_0x3e71fb,0xc9))[_0x2bad('0x46')](handleError(_0x3e71fb,null));};exports[_0x2bad('0x47')]=function(_0x50533c,_0x148c81){if(_0x50533c[_0x2bad('0x45')]['id']){delete _0x50533c['body']['id'];}return db[_0x2bad('0x29')][_0x2bad('0x48')]({'where':{'id':_0x50533c[_0x2bad('0x41')]['id']}})[_0x2bad('0x23')](handleEntityNotFound(_0x148c81,null))[_0x2bad('0x23')](saveUpdates(_0x50533c[_0x2bad('0x45')],null))[_0x2bad('0x23')](respondWithResult(_0x148c81,null))['catch'](handleError(_0x148c81,null));};exports['destroy']=function(_0x4f9315,_0x3cb0c4){return db[_0x2bad('0x29')]['find']({'where':{'id':_0x4f9315['params']['id']}})[_0x2bad('0x23')](handleEntityNotFound(_0x3cb0c4,null))['then'](removeEntity(_0x3cb0c4,null))[_0x2bad('0x46')](handleError(_0x3cb0c4,null));};
\ No newline at end of file
index 075b271..83ad913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a0=['path','rimraf','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1f6e9d,_0x23cc02){var _0x3dde04=function(_0xc8f04f){while(--_0xc8f04f){_0x1f6e9d['push'](_0x1f6e9d['shift']());}};_0x3dde04(++_0x23cc02);}(_0xa8a0,0x170));var _0x0a8a=function(_0x3d6277,_0x2b3181){_0x3d6277=_0x3d6277-0x0;var _0x3fa6a6=_0xa8a0[_0x3d6277];return _0x3fa6a6;};'use strict';var _=require(_0x0a8a('0x0'));var util=require(_0x0a8a('0x1'));var logger=require(_0x0a8a('0x2'))(_0x0a8a('0x3'));var moment=require(_0x0a8a('0x4'));var BPromise=require(_0x0a8a('0x5'));var rp=require(_0x0a8a('0x6'));var fs=require('fs');var path=require(_0x0a8a('0x7'));var rimraf=require(_0x0a8a('0x8'));var config=require('../../config/environment');var attributes=require(_0x0a8a('0x9'));module['exports']=function(_0x11319e,_0x7dd625){return _0x11319e[_0x0a8a('0xa')](_0x0a8a('0xb'),attributes,{'tableName':_0x0a8a('0xc'),'paranoid':![],'indexes':[{'name':_0x0a8a('0xd'),'fields':[_0x0a8a('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb583=['ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define'];(function(_0x3198f0,_0x482730){var _0x41efd9=function(_0x5acd6b){while(--_0x5acd6b){_0x3198f0['push'](_0x3198f0['shift']());}};_0x41efd9(++_0x482730);}(_0xb583,0xc8));var _0x3b58=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb583[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3b58('0x0'));var util=require(_0x3b58('0x1'));var logger=require('../../config/logger')(_0x3b58('0x2'));var moment=require(_0x3b58('0x3'));var BPromise=require(_0x3b58('0x4'));var rp=require(_0x3b58('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b58('0x6'));var config=require(_0x3b58('0x7'));var attributes=require(_0x3b58('0x8'));module['exports']=function(_0x314825,_0x198b78){return _0x314825[_0x3b58('0x9')](_0x3b58('0xa'),attributes,{'tableName':_0x3b58('0xb'),'paranoid':![],'indexes':[{'name':_0x3b58('0xc'),'fields':['idField',_0x3b58('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5d6366f..160726d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x126af7,_0x25fa06){_0x126af7=_0x126af7-0x0;var _0x25b500=_0xbdb7[_0x126af7];return _0x25b500;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
+var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x565f9b,_0x3697c0){var _0x1a27f9=function(_0x1ba5de){while(--_0x1ba5de){_0x565f9b['push'](_0x565f9b['shift']());}};_0x1a27f9(++_0x3697c0);}(_0xaa88,0x137));var _0x8aa8=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0xaa88[_0x4d0df6];return _0x4e2615;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}
\ No newline at end of file
index acf432e..79810da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x349bda,_0x242434){var _0x18c235=function(_0x253a0b){while(--_0x253a0b){_0x349bda['push'](_0x349bda['shift']());}};_0x18c235(++_0x242434);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x335f7c,_0x522e7d){var _0x220308=function(_0x34488f){while(--_0x34488f){_0x335f7c['push'](_0x335f7c['shift']());}};_0x220308(++_0x522e7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 e75db8f..b5c4777 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x28e0d8,_0x53eb5c){var _0x350db2=function(_0xf88fc9){while(--_0xf88fc9){_0x28e0d8['push'](_0x28e0d8['shift']());}};_0x350db2(++_0x53eb5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x11046a,_0x3a8881){var _0x19ac15=function(_0x176ec2){while(--_0x176ec2){_0x11046a['push'](_0x11046a['shift']());}};_0x19ac15(++_0x3a8881);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 27077ee..bbf9e00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b33=['sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','password','remoteUri','substring','lastIndexOf','POST','/service/v4_1/rest.php','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','%s%s','get_module_fields','Calls','module_fields','includes','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','squel','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x495234,_0x5f02a6){var _0x498c37=function(_0x54ac77){while(--_0x54ac77){_0x495234['push'](_0x495234['shift']());}};_0x498c37(++_0x5f02a6);}(_0x2b33,0xb9));var _0x32b3=function(_0x585748,_0x4a86fb){_0x585748=_0x585748-0x0;var _0x35816e=_0x2b33[_0x585748];return _0x35816e;};'use strict';var emlformat=require(_0x32b3('0x0'));var rimraf=require(_0x32b3('0x1'));var zipdir=require(_0x32b3('0x2'));var jsonpatch=require(_0x32b3('0x3'));var rp=require('request-promise');var moment=require(_0x32b3('0x4'));var BPromise=require(_0x32b3('0x5'));var Mustache=require(_0x32b3('0x6'));var util=require('util');var path=require('path');var sox=require(_0x32b3('0x7'));var csv=require(_0x32b3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32b3('0x9'));var squel=require(_0x32b3('0xa'));var crypto=require(_0x32b3('0xb'));var jsforce=require(_0x32b3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x32b3('0x8'));var querystring=require(_0x32b3('0xd'));var Papa=require(_0x32b3('0xe'));var Redis=require(_0x32b3('0xf'));var authService=require(_0x32b3('0x10'));var qs=require(_0x32b3('0x11'));var as=require(_0x32b3('0x12'));var hardwareService=require(_0x32b3('0x13'));var logger=require(_0x32b3('0x14'))('api');var utils=require(_0x32b3('0x15'));var config=require(_0x32b3('0x16'));var licenseUtil=require(_0x32b3('0x17'));var db=require(_0x32b3('0x18'))['db'];var integrations=require(_0x32b3('0x19'));function respondWithStatusCode(_0x568d53,_0xcb9174){_0xcb9174=_0xcb9174||0xcc;return function(_0x5150b7){if(_0x5150b7){return _0x568d53[_0x32b3('0x1a')](_0xcb9174);}return _0x568d53[_0x32b3('0x1b')](_0xcb9174)[_0x32b3('0x1c')]();};}function respondWithResult(_0x3c2256,_0x2a507c){_0x2a507c=_0x2a507c||0xc8;return function(_0x36def9){if(_0x36def9){return _0x3c2256['status'](_0x2a507c)[_0x32b3('0x1d')](_0x36def9);}};}function respondWithFilteredResult(_0x5ed014,_0x3deaab){return function(_0x59ef0d){if(_0x59ef0d){var _0x448638=typeof _0x3deaab[_0x32b3('0x1e')]===_0x32b3('0x1f')&&typeof _0x3deaab[_0x32b3('0x20')]===_0x32b3('0x1f');var _0xd85ebd=_0x59ef0d[_0x32b3('0x21')];var _0x10385e=_0x448638?0x0:_0x3deaab[_0x32b3('0x1e')];var _0x4966be=_0x448638?_0x59ef0d['count']:_0x3deaab['offset']+_0x3deaab[_0x32b3('0x20')];var _0x106292;if(_0x4966be>=_0xd85ebd){_0x4966be=_0xd85ebd;_0x106292=0xc8;}else{_0x106292=0xce;}_0x5ed014[_0x32b3('0x1b')](_0x106292);return _0x5ed014[_0x32b3('0x22')](_0x32b3('0x23'),_0x10385e+'-'+_0x4966be+'/'+_0xd85ebd)[_0x32b3('0x1d')](_0x59ef0d);}return null;};}function patchUpdates(_0x6a16b1){return function(_0x2a595d){try{jsonpatch['apply'](_0x2a595d,_0x6a16b1,!![]);}catch(_0x27d1e0){return BPromise[_0x32b3('0x24')](_0x27d1e0);}return _0x2a595d[_0x32b3('0x25')]();};}function saveUpdates(_0x178bd3,_0x445e4e){return function(_0x294163){if(_0x294163){return _0x294163[_0x32b3('0x26')](_0x178bd3)[_0x32b3('0x27')](function(_0x3ea296){return _0x3ea296;});}return null;};}function removeEntity(_0xcab628,_0x4aab18){return function(_0x38bd2a){if(_0x38bd2a){return _0x38bd2a['destroy']()[_0x32b3('0x27')](function(){_0xcab628[_0x32b3('0x1b')](0xcc)[_0x32b3('0x1c')]();});}};}function handleEntityNotFound(_0x367da1,_0x5e02aa){return function(_0x2c8819){if(!_0x2c8819){_0x367da1[_0x32b3('0x1a')](0x194);}return _0x2c8819;};}function handleError(_0x452ddd,_0x2fd27a){_0x2fd27a=_0x2fd27a||0x1f4;return function(_0xf80f91){logger[_0x32b3('0x28')](_0xf80f91['stack']);if(_0xf80f91['name']){delete _0xf80f91[_0x32b3('0x29')];}_0x452ddd[_0x32b3('0x1b')](_0x2fd27a)[_0x32b3('0x2a')](_0xf80f91);};}exports[_0x32b3('0x2b')]=function(_0x166c17,_0x3448b6){var _0x5c113f={},_0x1b189b={},_0x5a2572={'count':0x0,'rows':[]};var _0x4be95e=_[_0x32b3('0x2c')](db[_0x32b3('0x2d')][_0x32b3('0x2e')],function(_0x2dd3b5){return{'name':_0x2dd3b5[_0x32b3('0x2f')],'type':_0x2dd3b5['type'][_0x32b3('0x30')]};});_0x1b189b[_0x32b3('0x31')]=_[_0x32b3('0x2c')](_0x4be95e,_0x32b3('0x29'));_0x1b189b['query']=_['keys'](_0x166c17['query']);_0x1b189b[_0x32b3('0x32')]=_[_0x32b3('0x33')](_0x1b189b[_0x32b3('0x31')],_0x1b189b[_0x32b3('0x34')]);_0x5c113f[_0x32b3('0x35')]=_['intersection'](_0x1b189b[_0x32b3('0x31')],qs['fields'](_0x166c17[_0x32b3('0x34')][_0x32b3('0x36')]));_0x5c113f[_0x32b3('0x35')]=_0x5c113f[_0x32b3('0x35')][_0x32b3('0x37')]?_0x5c113f[_0x32b3('0x35')]:_0x1b189b[_0x32b3('0x31')];if(!_0x166c17['query'][_0x32b3('0x38')](_0x32b3('0x39'))){_0x5c113f['limit']=qs[_0x32b3('0x20')](_0x166c17['query']['limit']);_0x5c113f[_0x32b3('0x1e')]=qs[_0x32b3('0x1e')](_0x166c17['query'][_0x32b3('0x1e')]);}_0x5c113f[_0x32b3('0x3a')]=qs[_0x32b3('0x3b')](_0x166c17['query'][_0x32b3('0x3b')]);_0x5c113f['where']=qs['filters'](_[_0x32b3('0x3c')](_0x166c17[_0x32b3('0x34')],_0x1b189b['filters']),_0x4be95e);if(_0x166c17[_0x32b3('0x34')][_0x32b3('0x3d')]){_0x5c113f['where']=_[_0x32b3('0x3e')](_0x5c113f[_0x32b3('0x3f')],{'$or':_[_0x32b3('0x2c')](_0x4be95e,function(_0x40060e){if(_0x40060e[_0x32b3('0x40')]!==_0x32b3('0x41')){var _0x2a903e={};_0x2a903e[_0x40060e[_0x32b3('0x29')]]={'$like':'%'+_0x166c17[_0x32b3('0x34')][_0x32b3('0x3d')]+'%'};return _0x2a903e;}})});}_0x5c113f=_[_0x32b3('0x3e')]({},_0x5c113f,_0x166c17[_0x32b3('0x42')]);var _0x44d3c5={'where':_0x5c113f[_0x32b3('0x3f')]};return db[_0x32b3('0x2d')][_0x32b3('0x21')](_0x44d3c5)['then'](function(_0xa9c708){_0x5a2572[_0x32b3('0x21')]=_0xa9c708;if(_0x166c17[_0x32b3('0x34')][_0x32b3('0x43')]){_0x5c113f[_0x32b3('0x44')]=[{'all':!![]}];}return db[_0x32b3('0x2d')][_0x32b3('0x45')](_0x5c113f);})['then'](function(_0x3fc243){_0x5a2572[_0x32b3('0x46')]=_0x3fc243;return _0x5a2572;})[_0x32b3('0x27')](respondWithFilteredResult(_0x3448b6,_0x5c113f))[_0x32b3('0x47')](handleError(_0x3448b6,null));};exports['show']=function(_0x4fd868,_0x4d7569){var _0x45ae6f={'raw':![],'where':{'id':_0x4fd868['params']['id']}},_0x1976d5={};_0x1976d5[_0x32b3('0x31')]=_['keys'](db[_0x32b3('0x2d')][_0x32b3('0x2e')]);_0x1976d5[_0x32b3('0x34')]=_[_0x32b3('0x48')](_0x4fd868[_0x32b3('0x34')]);_0x1976d5[_0x32b3('0x32')]=_[_0x32b3('0x33')](_0x1976d5['model'],_0x1976d5['query']);_0x45ae6f[_0x32b3('0x35')]=_[_0x32b3('0x33')](_0x1976d5[_0x32b3('0x31')],qs[_0x32b3('0x36')](_0x4fd868[_0x32b3('0x34')][_0x32b3('0x36')]));_0x45ae6f[_0x32b3('0x35')]=_0x45ae6f[_0x32b3('0x35')][_0x32b3('0x37')]?_0x45ae6f[_0x32b3('0x35')]:_0x1976d5['model'];if(_0x4fd868[_0x32b3('0x34')][_0x32b3('0x43')]){_0x45ae6f['include']=[{'all':!![]}];}_0x45ae6f=_[_0x32b3('0x3e')]({},_0x45ae6f,_0x4fd868[_0x32b3('0x42')]);return db[_0x32b3('0x2d')][_0x32b3('0x49')](_0x45ae6f)['then'](handleEntityNotFound(_0x4d7569,null))[_0x32b3('0x27')](respondWithResult(_0x4d7569,null))[_0x32b3('0x47')](handleError(_0x4d7569,null));};exports['create']=function(_0x202c8c,_0x341b49){return db[_0x32b3('0x2d')][_0x32b3('0x4a')](_0x202c8c[_0x32b3('0x4b')],{})['then'](respondWithResult(_0x341b49,0xc9))[_0x32b3('0x47')](handleError(_0x341b49,null));};exports[_0x32b3('0x26')]=function(_0x1b1781,_0x3b9fd5){if(_0x1b1781[_0x32b3('0x4b')]['id']){delete _0x1b1781[_0x32b3('0x4b')]['id'];}return db['SugarcrmAccount'][_0x32b3('0x49')]({'where':{'id':_0x1b1781[_0x32b3('0x4c')]['id']}})[_0x32b3('0x27')](handleEntityNotFound(_0x3b9fd5,null))[_0x32b3('0x27')](saveUpdates(_0x1b1781['body'],null))[_0x32b3('0x27')](respondWithResult(_0x3b9fd5,null))[_0x32b3('0x47')](handleError(_0x3b9fd5,null));};exports[_0x32b3('0x4d')]=function(_0x56c9ca,_0x29990b){return db['SugarcrmAccount'][_0x32b3('0x49')]({'where':{'id':_0x56c9ca[_0x32b3('0x4c')]['id']}})[_0x32b3('0x27')](handleEntityNotFound(_0x29990b,null))[_0x32b3('0x27')](removeEntity(_0x29990b,null))['catch'](handleError(_0x29990b,null));};exports[_0x32b3('0x4e')]=function(_0x5a15f6,_0x1a0d29,_0x5c1b43){var _0x5756d6={};var _0x32469c={};var _0x2b2105;var _0x24cb06;return db[_0x32b3('0x2d')][_0x32b3('0x4f')]({'where':{'id':_0x5a15f6[_0x32b3('0x4c')]['id']}})[_0x32b3('0x27')](handleEntityNotFound(_0x1a0d29,null))[_0x32b3('0x27')](function(_0x317905){if(_0x317905){_0x2b2105=_0x317905;_0x32469c[_0x32b3('0x31')]=_[_0x32b3('0x48')](db[_0x32b3('0x50')][_0x32b3('0x2e')]);_0x32469c['query']=_[_0x32b3('0x48')](_0x5a15f6[_0x32b3('0x34')]);_0x32469c[_0x32b3('0x32')]=_['intersection'](_0x32469c[_0x32b3('0x31')],_0x32469c[_0x32b3('0x34')]);_0x5756d6[_0x32b3('0x35')]=_[_0x32b3('0x33')](_0x32469c['model'],qs[_0x32b3('0x36')](_0x5a15f6[_0x32b3('0x34')][_0x32b3('0x36')]));_0x5756d6[_0x32b3('0x35')]=_0x5756d6['attributes'][_0x32b3('0x37')]?_0x5756d6[_0x32b3('0x35')]:_0x32469c[_0x32b3('0x31')];_0x5756d6['order']=qs[_0x32b3('0x3b')](_0x5a15f6['query'][_0x32b3('0x3b')]);_0x5756d6[_0x32b3('0x3f')]=qs[_0x32b3('0x32')](_[_0x32b3('0x3c')](_0x5a15f6[_0x32b3('0x34')],_0x32469c[_0x32b3('0x32')]));if(_0x5a15f6[_0x32b3('0x34')]['filter']){_0x5756d6['where']=_[_0x32b3('0x3e')](_0x5756d6[_0x32b3('0x3f')],{'$or':_[_0x32b3('0x2c')](_0x5756d6[_0x32b3('0x35')],function(_0x5eefa1){var _0x1b75ba={};_0x1b75ba[_0x5eefa1]={'$like':'%'+_0x5a15f6[_0x32b3('0x34')][_0x32b3('0x3d')]+'%'};return _0x1b75ba;})});}_0x5756d6=_[_0x32b3('0x3e')]({},_0x5756d6,_0x5a15f6[_0x32b3('0x42')]);return _0x2b2105[_0x32b3('0x4e')](_0x5756d6);}})[_0x32b3('0x27')](function(_0x3f3ed4){if(_0x3f3ed4){_0x24cb06=_0x3f3ed4[_0x32b3('0x37')];if(!_0x5a15f6[_0x32b3('0x34')][_0x32b3('0x38')]('nolimit')){_0x5756d6[_0x32b3('0x20')]=qs['limit'](_0x5a15f6['query'][_0x32b3('0x20')]);_0x5756d6['offset']=qs['offset'](_0x5a15f6[_0x32b3('0x34')][_0x32b3('0x1e')]);}return _0x2b2105[_0x32b3('0x4e')](_0x5756d6);}})[_0x32b3('0x27')](function(_0x232859){if(_0x232859){return _0x232859?{'count':_0x24cb06,'rows':_0x232859}:null;}})[_0x32b3('0x27')](respondWithResult(_0x1a0d29,null))[_0x32b3('0x47')](handleError(_0x1a0d29,null));};exports[_0x32b3('0x51')]=function(_0x47aef4,_0x491373,_0x57fe64){if(_0x47aef4['body']['id']){delete _0x47aef4[_0x32b3('0x4b')]['id'];}return db[_0x32b3('0x2d')][_0x32b3('0x4f')]({'where':{'id':_0x47aef4[_0x32b3('0x4c')]['id']}})[_0x32b3('0x27')](handleEntityNotFound(_0x491373,null))[_0x32b3('0x27')](function(_0x1988c8){if(_0x1988c8){_0x47aef4[_0x32b3('0x4b')][_0x32b3('0x52')]=_0x1988c8['id'];_0x47aef4[_0x32b3('0x4b')][_0x32b3('0x53')]=integrations[_0x32b3('0x54')](_0x47aef4['body']['channel'],_0x47aef4[_0x32b3('0x4b')][_0x32b3('0x40')]);_0x47aef4[_0x32b3('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x47aef4[_0x32b3('0x4b')][_0x32b3('0x55')],_0x47aef4[_0x32b3('0x4b')]['type']);return db[_0x32b3('0x50')][_0x32b3('0x4a')](_0x47aef4[_0x32b3('0x4b')],{'include':[{'model':db[_0x32b3('0x56')],'as':_0x32b3('0x53')},{'model':db[_0x32b3('0x56')],'as':_0x32b3('0x57')}]});}return null;})[_0x32b3('0x27')](respondWithResult(_0x491373,null))['catch'](handleError(_0x491373,null));};exports[_0x32b3('0x58')]=function(_0x5489d9,_0x5e6f9e,_0x2b0517){var _0x59c7d4='';var _0x4772c7=['id',_0x32b3('0x29'),_0x32b3('0x59'),'created_by',_0x32b3('0x5a'),_0x32b3('0x5b'),_0x32b3('0x5c'),_0x32b3('0x5d'),_0x32b3('0x5e'),_0x32b3('0x5f'),'parent_name','direction'];return db[_0x32b3('0x2d')][_0x32b3('0x4f')]({'where':{'id':_0x5489d9[_0x32b3('0x4c')]['id']},'attributes':['id','username',_0x32b3('0x60'),_0x32b3('0x61')]})[_0x32b3('0x27')](handleEntityNotFound(_0x5e6f9e,null))[_0x32b3('0x27')](function(_0x2ad5ab){if(_0x2ad5ab){_0x59c7d4=_0x2ad5ab[_0x32b3('0x61')];var _0x5692a5=_0x59c7d4['slice'](-0x1);if(_0x5692a5==='/'){_0x59c7d4=_0x59c7d4[_0x32b3('0x62')](0x0,_0x59c7d4[_0x32b3('0x63')](_0x5692a5));}return rp({'method':_0x32b3('0x64'),'uri':util['format']('%s%s',_0x59c7d4,_0x32b3('0x65')),'json':!![],'form':{'method':'login','input_type':_0x32b3('0x66'),'response_type':_0x32b3('0x66'),'rest_data':JSON[_0x32b3('0x67')]({'user_auth':{'user_name':_0x2ad5ab[_0x32b3('0x68')],'password':_0x2ad5ab[_0x32b3('0x60')],'encryption':_0x32b3('0x69')},'application':_0x32b3('0x6a')})}});}})[_0x32b3('0x27')](function(_0x3c7aa6){if(_0x3c7aa6&&_0x3c7aa6[_0x32b3('0x29')]!==_0x32b3('0x6b')&&_0x3c7aa6['name']!==_0x32b3('0x6c')){return rp({'method':'POST','uri':util[_0x32b3('0x6d')](_0x32b3('0x6e'),_0x59c7d4,_0x32b3('0x65')),'json':!![],'form':{'method':_0x32b3('0x6f'),'input_type':_0x32b3('0x66'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3c7aa6['id'],'module_name':_0x32b3('0x70')})}})[_0x32b3('0x27')](function(_0x6625de){if(_0x6625de){var _0xb5dba6=_['values'](_0x6625de[_0x32b3('0x71')]);_['remove'](_0xb5dba6,function(_0x28a9a8){return _0x4772c7[_0x32b3('0x72')](_0x28a9a8[_0x32b3('0x29')]);});return{'count':_0xb5dba6[_0x32b3('0x37')],'rows':_[_0x32b3('0x2c')](_0xb5dba6,function(_0x3bd024){return{'id':_0x3bd024[_0x32b3('0x29')],'name':_0x3bd024['label'],'custom':_[_0x32b3('0x73')](_0x3bd024[_0x32b3('0x29')],'_c')?!![]:![],'options':_0x3bd024[_0x32b3('0x42')]?_[_0x32b3('0x2c')](_[_0x32b3('0x74')](_0x3bd024[_0x32b3('0x42')]),function(_0x2ef0a7){return{'name':_0x2ef0a7[_0x32b3('0x75')],'value':_0x2ef0a7[_0x32b3('0x29')]};}):[]};})};}})[_0x32b3('0x27')](respondWithResult(_0x5e6f9e,null))[_0x32b3('0x47')](function(_0x4afd6f){var _0x2957c9=_0x5489d9['query'][_0x32b3('0x76')]?0x1f4:_0x4afd6f[_0x32b3('0x77')]||0x1f4;logger[_0x32b3('0x28')](_0x32b3('0x78'),_0x32b3('0x58'),_0x2957c9,JSON['stringify'](_0x4afd6f));delete _0x4afd6f[_0x32b3('0x29')];if(_0x2957c9===0x191){_0x2957c9=0x190;}_0x5e6f9e['status'](_0x2957c9)['send'](_0x5489d9[_0x32b3('0x34')]['test']?{'message':_0x32b3('0x79'),'statusCode':_0x4afd6f[_0x32b3('0x77')]}:_0x4afd6f);});}else{var _0x1c66e0=0x1f4;_0x5e6f9e['status'](_0x1c66e0)[_0x32b3('0x2a')]({'message':_0x32b3('0x79'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x59e5=['params','getConfigurations','findOne','SugarcrmConfiguration','pick','filter','addConfiguration','Subjects','getSubjects','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','get_module_fields','Calls','module_fields','remove','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','findAll','catch','include','find','create','body'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x59e5,0x11b));var _0x559e=function(_0x3bde52,_0x146cff){_0x3bde52=_0x3bde52-0x0;var _0x3dd57a=_0x59e5[_0x3bde52];return _0x3dd57a;};'use strict';var emlformat=require(_0x559e('0x0'));var rimraf=require(_0x559e('0x1'));var zipdir=require(_0x559e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x559e('0x3'));var moment=require(_0x559e('0x4'));var BPromise=require(_0x559e('0x5'));var Mustache=require(_0x559e('0x6'));var util=require('util');var path=require(_0x559e('0x7'));var sox=require(_0x559e('0x8'));var csv=require(_0x559e('0x9'));var ejs=require(_0x559e('0xa'));var fs=require('fs');var fs_extra=require(_0x559e('0xb'));var _=require(_0x559e('0xc'));var squel=require(_0x559e('0xd'));var crypto=require(_0x559e('0xe'));var jsforce=require(_0x559e('0xf'));var deskjs=require(_0x559e('0x10'));var toCsv=require(_0x559e('0x9'));var querystring=require(_0x559e('0x11'));var Papa=require(_0x559e('0x12'));var Redis=require(_0x559e('0x13'));var authService=require(_0x559e('0x14'));var qs=require(_0x559e('0x15'));var as=require(_0x559e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x559e('0x17'))(_0x559e('0x18'));var utils=require(_0x559e('0x19'));var config=require(_0x559e('0x1a'));var licenseUtil=require(_0x559e('0x1b'));var db=require(_0x559e('0x1c'))['db'];var integrations=require(_0x559e('0x1d'));function respondWithStatusCode(_0x1b5924,_0xcd1c63){_0xcd1c63=_0xcd1c63||0xcc;return function(_0x5af8a4){if(_0x5af8a4){return _0x1b5924[_0x559e('0x1e')](_0xcd1c63);}return _0x1b5924[_0x559e('0x1f')](_0xcd1c63)[_0x559e('0x20')]();};}function respondWithResult(_0x20a6e8,_0x91d1a8){_0x91d1a8=_0x91d1a8||0xc8;return function(_0x6925cc){if(_0x6925cc){return _0x20a6e8['status'](_0x91d1a8)[_0x559e('0x21')](_0x6925cc);}};}function respondWithFilteredResult(_0x4eca77,_0x52f347){return function(_0x1c65e7){if(_0x1c65e7){var _0x1c6059=typeof _0x52f347['offset']===_0x559e('0x22')&&typeof _0x52f347['limit']===_0x559e('0x22');var _0x134b55=_0x1c65e7[_0x559e('0x23')];var _0x2c1111=_0x1c6059?0x0:_0x52f347['offset'];var _0x4ccda6=_0x1c6059?_0x1c65e7[_0x559e('0x23')]:_0x52f347[_0x559e('0x24')]+_0x52f347[_0x559e('0x25')];var _0x4b8019;if(_0x4ccda6>=_0x134b55){_0x4ccda6=_0x134b55;_0x4b8019=0xc8;}else{_0x4b8019=0xce;}_0x4eca77[_0x559e('0x1f')](_0x4b8019);return _0x4eca77[_0x559e('0x26')](_0x559e('0x27'),_0x2c1111+'-'+_0x4ccda6+'/'+_0x134b55)[_0x559e('0x21')](_0x1c65e7);}return null;};}function patchUpdates(_0x50cb88){return function(_0x3cfcab){try{jsonpatch['apply'](_0x3cfcab,_0x50cb88,!![]);}catch(_0x2503b2){return BPromise[_0x559e('0x28')](_0x2503b2);}return _0x3cfcab[_0x559e('0x29')]();};}function saveUpdates(_0x4365c5,_0x1d52d8){return function(_0x1816ce){if(_0x1816ce){return _0x1816ce[_0x559e('0x2a')](_0x4365c5)[_0x559e('0x2b')](function(_0x16113d){return _0x16113d;});}return null;};}function removeEntity(_0x1068bd,_0x3ae0dd){return function(_0xcafedd){if(_0xcafedd){return _0xcafedd[_0x559e('0x2c')]()[_0x559e('0x2b')](function(){_0x1068bd[_0x559e('0x1f')](0xcc)[_0x559e('0x20')]();});}};}function handleEntityNotFound(_0xfdd6da,_0x53f375){return function(_0x5a5f54){if(!_0x5a5f54){_0xfdd6da['sendStatus'](0x194);}return _0x5a5f54;};}function handleError(_0x1378ab,_0x477d3b){_0x477d3b=_0x477d3b||0x1f4;return function(_0x5191ca){logger[_0x559e('0x2d')](_0x5191ca[_0x559e('0x2e')]);if(_0x5191ca[_0x559e('0x2f')]){delete _0x5191ca['name'];}_0x1378ab['status'](_0x477d3b)[_0x559e('0x30')](_0x5191ca);};}exports[_0x559e('0x31')]=function(_0x4ad7b7,_0x192d9a){var _0x305a7f={},_0x5b93d8={},_0x233daa={'count':0x0,'rows':[]};var _0x1c6e63=_[_0x559e('0x32')](db[_0x559e('0x33')][_0x559e('0x34')],function(_0x3a03af){return{'name':_0x3a03af[_0x559e('0x35')],'type':_0x3a03af[_0x559e('0x36')]['key']};});_0x5b93d8[_0x559e('0x37')]=_[_0x559e('0x32')](_0x1c6e63,_0x559e('0x2f'));_0x5b93d8[_0x559e('0x38')]=_[_0x559e('0x39')](_0x4ad7b7[_0x559e('0x38')]);_0x5b93d8[_0x559e('0x3a')]=_[_0x559e('0x3b')](_0x5b93d8[_0x559e('0x37')],_0x5b93d8['query']);_0x305a7f[_0x559e('0x3c')]=_[_0x559e('0x3b')](_0x5b93d8[_0x559e('0x37')],qs[_0x559e('0x3d')](_0x4ad7b7['query'][_0x559e('0x3d')]));_0x305a7f[_0x559e('0x3c')]=_0x305a7f['attributes'][_0x559e('0x3e')]?_0x305a7f[_0x559e('0x3c')]:_0x5b93d8[_0x559e('0x37')];if(!_0x4ad7b7[_0x559e('0x38')][_0x559e('0x3f')](_0x559e('0x40'))){_0x305a7f[_0x559e('0x25')]=qs['limit'](_0x4ad7b7[_0x559e('0x38')]['limit']);_0x305a7f[_0x559e('0x24')]=qs[_0x559e('0x24')](_0x4ad7b7[_0x559e('0x38')][_0x559e('0x24')]);}_0x305a7f[_0x559e('0x41')]=qs[_0x559e('0x42')](_0x4ad7b7[_0x559e('0x38')][_0x559e('0x42')]);_0x305a7f[_0x559e('0x43')]=qs[_0x559e('0x3a')](_['pick'](_0x4ad7b7['query'],_0x5b93d8[_0x559e('0x3a')]),_0x1c6e63);if(_0x4ad7b7[_0x559e('0x38')]['filter']){_0x305a7f[_0x559e('0x43')]=_[_0x559e('0x44')](_0x305a7f[_0x559e('0x43')],{'$or':_['map'](_0x1c6e63,function(_0x2cb03f){if(_0x2cb03f[_0x559e('0x36')]!==_0x559e('0x45')){var _0x15f787={};_0x15f787[_0x2cb03f[_0x559e('0x2f')]]={'$like':'%'+_0x4ad7b7['query']['filter']+'%'};return _0x15f787;}})});}_0x305a7f=_['merge']({},_0x305a7f,_0x4ad7b7[_0x559e('0x46')]);var _0x2c0a45={'where':_0x305a7f[_0x559e('0x43')]};return db[_0x559e('0x33')][_0x559e('0x23')](_0x2c0a45)[_0x559e('0x2b')](function(_0x181748){_0x233daa[_0x559e('0x23')]=_0x181748;if(_0x4ad7b7[_0x559e('0x38')]['includeAll']){_0x305a7f['include']=[{'all':!![]}];}return db[_0x559e('0x33')][_0x559e('0x47')](_0x305a7f);})[_0x559e('0x2b')](function(_0x58068b){_0x233daa['rows']=_0x58068b;return _0x233daa;})[_0x559e('0x2b')](respondWithFilteredResult(_0x192d9a,_0x305a7f))[_0x559e('0x48')](handleError(_0x192d9a,null));};exports['show']=function(_0xb1ec83,_0x558e2c){var _0x2ef25f={'raw':![],'where':{'id':_0xb1ec83['params']['id']}},_0x4d69e6={};_0x4d69e6[_0x559e('0x37')]=_['keys'](db[_0x559e('0x33')][_0x559e('0x34')]);_0x4d69e6[_0x559e('0x38')]=_[_0x559e('0x39')](_0xb1ec83[_0x559e('0x38')]);_0x4d69e6[_0x559e('0x3a')]=_[_0x559e('0x3b')](_0x4d69e6[_0x559e('0x37')],_0x4d69e6[_0x559e('0x38')]);_0x2ef25f[_0x559e('0x3c')]=_['intersection'](_0x4d69e6[_0x559e('0x37')],qs['fields'](_0xb1ec83[_0x559e('0x38')][_0x559e('0x3d')]));_0x2ef25f[_0x559e('0x3c')]=_0x2ef25f[_0x559e('0x3c')]['length']?_0x2ef25f[_0x559e('0x3c')]:_0x4d69e6[_0x559e('0x37')];if(_0xb1ec83['query']['includeAll']){_0x2ef25f[_0x559e('0x49')]=[{'all':!![]}];}_0x2ef25f=_[_0x559e('0x44')]({},_0x2ef25f,_0xb1ec83[_0x559e('0x46')]);return db[_0x559e('0x33')][_0x559e('0x4a')](_0x2ef25f)[_0x559e('0x2b')](handleEntityNotFound(_0x558e2c,null))[_0x559e('0x2b')](respondWithResult(_0x558e2c,null))[_0x559e('0x48')](handleError(_0x558e2c,null));};exports[_0x559e('0x4b')]=function(_0x330e8d,_0x4c2c1b){return db['SugarcrmAccount'][_0x559e('0x4b')](_0x330e8d[_0x559e('0x4c')],{})[_0x559e('0x2b')](respondWithResult(_0x4c2c1b,0xc9))['catch'](handleError(_0x4c2c1b,null));};exports['update']=function(_0x1ca424,_0x4ba8a3){if(_0x1ca424['body']['id']){delete _0x1ca424[_0x559e('0x4c')]['id'];}return db[_0x559e('0x33')][_0x559e('0x4a')]({'where':{'id':_0x1ca424[_0x559e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ba8a3,null))[_0x559e('0x2b')](saveUpdates(_0x1ca424[_0x559e('0x4c')],null))[_0x559e('0x2b')](respondWithResult(_0x4ba8a3,null))[_0x559e('0x48')](handleError(_0x4ba8a3,null));};exports[_0x559e('0x2c')]=function(_0x303e6a,_0xf5c0ca){return db[_0x559e('0x33')][_0x559e('0x4a')]({'where':{'id':_0x303e6a['params']['id']}})[_0x559e('0x2b')](handleEntityNotFound(_0xf5c0ca,null))[_0x559e('0x2b')](removeEntity(_0xf5c0ca,null))[_0x559e('0x48')](handleError(_0xf5c0ca,null));};exports[_0x559e('0x4e')]=function(_0x406312,_0x3277d4,_0x533b16){var _0x30243a={};var _0x140464={};var _0x5b8768;var _0x329b0f;return db[_0x559e('0x33')][_0x559e('0x4f')]({'where':{'id':_0x406312[_0x559e('0x4d')]['id']}})[_0x559e('0x2b')](handleEntityNotFound(_0x3277d4,null))['then'](function(_0x3ce641){if(_0x3ce641){_0x5b8768=_0x3ce641;_0x140464[_0x559e('0x37')]=_[_0x559e('0x39')](db[_0x559e('0x50')][_0x559e('0x34')]);_0x140464[_0x559e('0x38')]=_['keys'](_0x406312[_0x559e('0x38')]);_0x140464[_0x559e('0x3a')]=_[_0x559e('0x3b')](_0x140464[_0x559e('0x37')],_0x140464['query']);_0x30243a[_0x559e('0x3c')]=_[_0x559e('0x3b')](_0x140464[_0x559e('0x37')],qs[_0x559e('0x3d')](_0x406312[_0x559e('0x38')]['fields']));_0x30243a[_0x559e('0x3c')]=_0x30243a[_0x559e('0x3c')][_0x559e('0x3e')]?_0x30243a[_0x559e('0x3c')]:_0x140464[_0x559e('0x37')];_0x30243a['order']=qs[_0x559e('0x42')](_0x406312[_0x559e('0x38')][_0x559e('0x42')]);_0x30243a[_0x559e('0x43')]=qs[_0x559e('0x3a')](_[_0x559e('0x51')](_0x406312[_0x559e('0x38')],_0x140464['filters']));if(_0x406312['query'][_0x559e('0x52')]){_0x30243a[_0x559e('0x43')]=_['merge'](_0x30243a[_0x559e('0x43')],{'$or':_[_0x559e('0x32')](_0x30243a[_0x559e('0x3c')],function(_0x4646d){var _0x3714de={};_0x3714de[_0x4646d]={'$like':'%'+_0x406312[_0x559e('0x38')][_0x559e('0x52')]+'%'};return _0x3714de;})});}_0x30243a=_['merge']({},_0x30243a,_0x406312[_0x559e('0x46')]);return _0x5b8768['getConfigurations'](_0x30243a);}})[_0x559e('0x2b')](function(_0x59a6f9){if(_0x59a6f9){_0x329b0f=_0x59a6f9[_0x559e('0x3e')];if(!_0x406312[_0x559e('0x38')][_0x559e('0x3f')](_0x559e('0x40'))){_0x30243a['limit']=qs[_0x559e('0x25')](_0x406312['query'][_0x559e('0x25')]);_0x30243a[_0x559e('0x24')]=qs[_0x559e('0x24')](_0x406312['query'][_0x559e('0x24')]);}return _0x5b8768['getConfigurations'](_0x30243a);}})[_0x559e('0x2b')](function(_0x7e151d){if(_0x7e151d){return _0x7e151d?{'count':_0x329b0f,'rows':_0x7e151d}:null;}})[_0x559e('0x2b')](respondWithResult(_0x3277d4,null))['catch'](handleError(_0x3277d4,null));};exports[_0x559e('0x53')]=function(_0xabd8d6,_0x5130b0,_0x56f58e){if(_0xabd8d6[_0x559e('0x4c')]['id']){delete _0xabd8d6[_0x559e('0x4c')]['id'];}return db[_0x559e('0x33')][_0x559e('0x4f')]({'where':{'id':_0xabd8d6[_0x559e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5130b0,null))['then'](function(_0x3b9637){if(_0x3b9637){_0xabd8d6[_0x559e('0x4c')]['AccountId']=_0x3b9637['id'];_0xabd8d6[_0x559e('0x4c')][_0x559e('0x54')]=integrations[_0x559e('0x55')](_0xabd8d6[_0x559e('0x4c')]['channel'],_0xabd8d6['body']['type']);_0xabd8d6[_0x559e('0x4c')][_0x559e('0x56')]=integrations['getDescriptions'](_0xabd8d6[_0x559e('0x4c')]['channel'],_0xabd8d6['body'][_0x559e('0x36')]);return db[_0x559e('0x50')][_0x559e('0x4b')](_0xabd8d6[_0x559e('0x4c')],{'include':[{'model':db[_0x559e('0x57')],'as':_0x559e('0x54')},{'model':db[_0x559e('0x57')],'as':_0x559e('0x56')}]});}return null;})[_0x559e('0x2b')](respondWithResult(_0x5130b0,null))[_0x559e('0x48')](handleError(_0x5130b0,null));};exports[_0x559e('0x58')]=function(_0xc25800,_0x4743fb,_0x4f0967){var _0x5dc487='';var _0x18b9aa=['id',_0x559e('0x2f'),_0x559e('0x59'),_0x559e('0x5a'),_0x559e('0x5b'),_0x559e('0x5c'),'duration_hours',_0x559e('0x5d'),_0x559e('0x5e'),'parent_type',_0x559e('0x5f'),'direction'];return db[_0x559e('0x33')][_0x559e('0x4f')]({'where':{'id':_0xc25800[_0x559e('0x4d')]['id']},'attributes':['id',_0x559e('0x60'),_0x559e('0x61'),'remoteUri']})['then'](handleEntityNotFound(_0x4743fb,null))[_0x559e('0x2b')](function(_0x10b350){if(_0x10b350){_0x5dc487=_0x10b350[_0x559e('0x62')];var _0x447a9c=_0x5dc487[_0x559e('0x63')](-0x1);if(_0x447a9c==='/'){_0x5dc487=_0x5dc487[_0x559e('0x64')](0x0,_0x5dc487[_0x559e('0x65')](_0x447a9c));}return rp({'method':_0x559e('0x66'),'uri':util[_0x559e('0x67')](_0x559e('0x68'),_0x5dc487,_0x559e('0x69')),'json':!![],'form':{'method':'login','input_type':_0x559e('0x6a'),'response_type':_0x559e('0x6a'),'rest_data':JSON[_0x559e('0x6b')]({'user_auth':{'user_name':_0x10b350['username'],'password':_0x10b350[_0x559e('0x61')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x1bd0fd){if(_0x1bd0fd&&_0x1bd0fd[_0x559e('0x2f')]!=='Invalid\x20Login'&&_0x1bd0fd[_0x559e('0x2f')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x559e('0x67')](_0x559e('0x68'),_0x5dc487,_0x559e('0x69')),'json':!![],'form':{'method':_0x559e('0x6c'),'input_type':_0x559e('0x6a'),'response_type':_0x559e('0x6a'),'rest_data':JSON[_0x559e('0x6b')]({'session':_0x1bd0fd['id'],'module_name':_0x559e('0x6d')})}})[_0x559e('0x2b')](function(_0x49709c){if(_0x49709c){var _0x22e94e=_['values'](_0x49709c[_0x559e('0x6e')]);_[_0x559e('0x6f')](_0x22e94e,function(_0x180a7d){return _0x18b9aa['includes'](_0x180a7d[_0x559e('0x2f')]);});return{'count':_0x22e94e['length'],'rows':_[_0x559e('0x32')](_0x22e94e,function(_0x3e523c){return{'id':_0x3e523c['name'],'name':_0x3e523c[_0x559e('0x70')],'custom':_[_0x559e('0x71')](_0x3e523c[_0x559e('0x2f')],'_c')?!![]:![],'options':_0x3e523c[_0x559e('0x46')]?_[_0x559e('0x32')](_[_0x559e('0x72')](_0x3e523c[_0x559e('0x46')]),function(_0x1df591){return{'name':_0x1df591[_0x559e('0x73')],'value':_0x1df591[_0x559e('0x2f')]};}):[]};})};}})[_0x559e('0x2b')](respondWithResult(_0x4743fb,null))[_0x559e('0x48')](function(_0x504051){var _0x58bf85=_0xc25800['query'][_0x559e('0x74')]?0x1f4:_0x504051[_0x559e('0x75')]||0x1f4;logger['error'](_0x559e('0x76'),_0x559e('0x58'),_0x58bf85,JSON[_0x559e('0x6b')](_0x504051));delete _0x504051[_0x559e('0x2f')];if(_0x58bf85===0x191){_0x58bf85=0x190;}_0x4743fb['status'](_0x58bf85)['send'](_0xc25800[_0x559e('0x38')][_0x559e('0x74')]?{'message':_0x559e('0x77'),'statusCode':_0x504051[_0x559e('0x75')]}:_0x504051);});}else{var _0x526ba1=0x1f4;_0x4743fb['status'](_0x526ba1)['send']({'message':_0x559e('0x77'),'statusCode':0x190});}});};
\ No newline at end of file
index 0c4d250..84820c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3249=['exports','define','SugarcrmAccount','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x3249,0xdf));var _0x9324=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x3249[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x9324('0x0'));var util=require(_0x9324('0x1'));var logger=require(_0x9324('0x2'))('api');var moment=require(_0x9324('0x3'));var BPromise=require('bluebird');var rp=require(_0x9324('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9324('0x5'));var config=require(_0x9324('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x9324('0x7'));module[_0x9324('0x8')]=function(_0x2fea77,_0xb353aa){return _0x2fea77[_0x9324('0x9')](_0x9324('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe76a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','lodash','util'];(function(_0x53a85b,_0x43dbc8){var _0x50b2fd=function(_0x190124){while(--_0x190124){_0x53a85b['push'](_0x53a85b['shift']());}};_0x50b2fd(++_0x43dbc8);}(_0xe76a,0x177));var _0xae76=function(_0x305903,_0x4f118c){_0x305903=_0x305903-0x0;var _0x4d63d5=_0xe76a[_0x305903];return _0x4d63d5;};'use strict';var _=require(_0xae76('0x0'));var util=require(_0xae76('0x1'));var logger=require('../../config/logger')(_0xae76('0x2'));var moment=require(_0xae76('0x3'));var BPromise=require(_0xae76('0x4'));var rp=require(_0xae76('0x5'));var fs=require('fs');var path=require(_0xae76('0x6'));var rimraf=require(_0xae76('0x7'));var config=require(_0xae76('0x8'));var attributes=require(_0xae76('0x9'));var integrations=require(_0xae76('0xa'));module[_0xae76('0xb')]=function(_0x45122b,_0x5a5e9d){return _0x45122b['define'](_0xae76('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6118190..6e01767 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5b6=['client','http','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','then','GetSugarcrmAccount','stringify','catch','ShowSugarcrmAccount','find','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xb5b6,0x72));var _0x6b5b=function(_0xa46308,_0x493efd){_0xa46308=_0xa46308-0x0;var _0x50465c=_0xb5b6[_0xa46308];return _0x50465c;};'use strict';var _=require('lodash');var util=require(_0x6b5b('0x0'));var moment=require(_0x6b5b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b5b('0x2'))['db'];var utils=require(_0x6b5b('0x3'));var logger=require(_0x6b5b('0x4'))('rpc');var config=require(_0x6b5b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6b5b('0x6')][_0x6b5b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d0bba,_0x2b0e15,_0x2a9d45){return new BPromise(function(_0x3e62d1,_0x17f3bc){return client['request'](_0x2d0bba,_0x2a9d45)['then'](function(_0x52f60a){logger[_0x6b5b('0x8')]('SugarcrmAccount,\x20%s,\x20%s',_0x2b0e15,_0x6b5b('0x9'));logger[_0x6b5b('0xa')](_0x6b5b('0xb'),_0x2b0e15,_0x6b5b('0x9'),JSON['stringify'](_0x52f60a));if(_0x52f60a[_0x6b5b('0xc')]){if(_0x52f60a[_0x6b5b('0xc')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2b0e15,_0x52f60a['error'][_0x6b5b('0xd')]);return _0x17f3bc(_0x52f60a[_0x6b5b('0xc')][_0x6b5b('0xd')]);}logger[_0x6b5b('0xc')](_0x6b5b('0xe'),_0x2b0e15,_0x52f60a[_0x6b5b('0xc')][_0x6b5b('0xd')]);return _0x3e62d1(_0x52f60a[_0x6b5b('0xc')][_0x6b5b('0xd')]);}else{logger[_0x6b5b('0x8')](_0x6b5b('0xe'),_0x2b0e15,_0x6b5b('0x9'));_0x3e62d1(_0x52f60a['result'][_0x6b5b('0xd')]);}})['catch'](function(_0x125c7d){logger[_0x6b5b('0xc')](_0x6b5b('0xe'),_0x2b0e15,_0x125c7d);_0x17f3bc(_0x125c7d);});});}exports['GetSugarcrmAccount']=function(_0x5ef70c){var _0x35daf1=this;return new Promise(function(_0x2903e0,_0x52cf67){return db[_0x6b5b('0xf')]['findAll']({'raw':_0x5ef70c['options']?_0x5ef70c[_0x6b5b('0x10')][_0x6b5b('0x11')]===undefined?!![]:![]:!![],'where':_0x5ef70c[_0x6b5b('0x10')]?_0x5ef70c[_0x6b5b('0x10')][_0x6b5b('0x12')]||null:null,'attributes':_0x5ef70c[_0x6b5b('0x10')]?_0x5ef70c[_0x6b5b('0x10')][_0x6b5b('0x13')]||null:null,'limit':_0x5ef70c[_0x6b5b('0x10')]?_0x5ef70c['options'][_0x6b5b('0x14')]||null:null,'include':_0x5ef70c[_0x6b5b('0x10')]?_0x5ef70c[_0x6b5b('0x10')][_0x6b5b('0x15')]?_[_0x6b5b('0x16')](_0x5ef70c[_0x6b5b('0x10')][_0x6b5b('0x15')],function(_0x5aed8e){return{'model':db[_0x5aed8e[_0x6b5b('0x17')]],'as':_0x5aed8e['as'],'attributes':_0x5aed8e[_0x6b5b('0x13')],'include':_0x5aed8e[_0x6b5b('0x15')]?_[_0x6b5b('0x16')](_0x5aed8e[_0x6b5b('0x15')],function(_0x44a01c){return{'model':db[_0x44a01c['model']],'as':_0x44a01c['as'],'attributes':_0x44a01c['attributes'],'include':_0x44a01c[_0x6b5b('0x15')]?_[_0x6b5b('0x16')](_0x44a01c[_0x6b5b('0x15')],function(_0x185e36){return{'model':db[_0x185e36[_0x6b5b('0x17')]],'as':_0x185e36['as'],'attributes':_0x185e36[_0x6b5b('0x13')]};}):[]};}):[]};}):[]:[]})[_0x6b5b('0x18')](function(_0x41f790){logger[_0x6b5b('0x8')](_0x6b5b('0x19'),_0x5ef70c);logger[_0x6b5b('0xa')](_0x6b5b('0x19'),_0x5ef70c,JSON[_0x6b5b('0x1a')](_0x41f790));_0x2903e0(_0x41f790);})[_0x6b5b('0x1b')](function(_0x1b1f6b){logger['error'](_0x6b5b('0x19'),_0x1b1f6b[_0x6b5b('0xd')],_0x5ef70c);_0x52cf67(_0x35daf1[_0x6b5b('0xc')](0x1f4,_0x1b1f6b[_0x6b5b('0xd')]));});});};exports[_0x6b5b('0x1c')]=function(_0x5f3e7a){var _0x5f1ed4=this;return new Promise(function(_0x1ed346,_0x209c40){return db['SugarcrmAccount'][_0x6b5b('0x1d')]({'raw':_0x5f3e7a[_0x6b5b('0x10')]?_0x5f3e7a['options'][_0x6b5b('0x11')]===undefined?!![]:![]:!![],'where':_0x5f3e7a[_0x6b5b('0x10')]?_0x5f3e7a[_0x6b5b('0x10')][_0x6b5b('0x12')]||null:null,'attributes':_0x5f3e7a[_0x6b5b('0x10')]?_0x5f3e7a[_0x6b5b('0x10')]['attributes']||null:null,'include':_0x5f3e7a[_0x6b5b('0x10')]?_0x5f3e7a['options'][_0x6b5b('0x15')]?_[_0x6b5b('0x16')](_0x5f3e7a[_0x6b5b('0x10')]['include'],function(_0x2d9e81){return{'model':db[_0x2d9e81[_0x6b5b('0x17')]],'as':_0x2d9e81['as'],'attributes':_0x2d9e81[_0x6b5b('0x13')],'include':_0x2d9e81[_0x6b5b('0x15')]?_['map'](_0x2d9e81[_0x6b5b('0x15')],function(_0x1d4297){return{'model':db[_0x1d4297[_0x6b5b('0x17')]],'as':_0x1d4297['as'],'attributes':_0x1d4297[_0x6b5b('0x13')],'include':_0x1d4297[_0x6b5b('0x15')]?_['map'](_0x1d4297[_0x6b5b('0x15')],function(_0x4c9595){return{'model':db[_0x4c9595[_0x6b5b('0x17')]],'as':_0x4c9595['as'],'attributes':_0x4c9595[_0x6b5b('0x13')]};}):[]};}):[]};}):[]:[]})[_0x6b5b('0x18')](function(_0x57bff8){logger[_0x6b5b('0x8')](_0x6b5b('0x1c'),_0x5f3e7a);logger[_0x6b5b('0xa')]('ShowSugarcrmAccount',_0x5f3e7a,JSON[_0x6b5b('0x1a')](_0x57bff8));_0x1ed346(_0x57bff8);})[_0x6b5b('0x1b')](function(_0x3a7962){logger[_0x6b5b('0xc')](_0x6b5b('0x1c'),_0x3a7962[_0x6b5b('0xd')],_0x5f3e7a);_0x209c40(_0x5f1ed4[_0x6b5b('0xc')](0x1f4,_0x3a7962[_0x6b5b('0xd')]));});});};
\ No newline at end of file
+var _0xec8f=['../../config/environment','jayson/promise','client','http','then','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x259fe5,_0x226094){var _0x2be24c=function(_0x307fec){while(--_0x307fec){_0x259fe5['push'](_0x259fe5['shift']());}};_0x2be24c(++_0x226094);}(_0xec8f,0x11e));var _0xfec8=function(_0x31490c,_0x3a51c6){_0x31490c=_0x31490c-0x0;var _0x4c7410=_0xec8f[_0x31490c];return _0x4c7410;};'use strict';var _=require(_0xfec8('0x0'));var util=require(_0xfec8('0x1'));var moment=require(_0xfec8('0x2'));var BPromise=require(_0xfec8('0x3'));var rs=require(_0xfec8('0x4'));var fs=require('fs');var Redis=require(_0xfec8('0x5'));var db=require(_0xfec8('0x6'))['db'];var utils=require(_0xfec8('0x7'));var logger=require(_0xfec8('0x8'))(_0xfec8('0x9'));var config=require(_0xfec8('0xa'));var jayson=require(_0xfec8('0xb'));var client=jayson[_0xfec8('0xc')][_0xfec8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4cff36,_0x9a1d54,_0x3c9ea2){return new BPromise(function(_0x51a03b,_0xfc4a62){return client['request'](_0x4cff36,_0x3c9ea2)[_0xfec8('0xe')](function(_0x18c998){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x9a1d54,'request\x20sent');logger[_0xfec8('0xf')](_0xfec8('0x10'),_0x9a1d54,_0xfec8('0x11'),JSON[_0xfec8('0x12')](_0x18c998));if(_0x18c998['error']){if(_0x18c998[_0xfec8('0x13')][_0xfec8('0x14')]===0x1f4){logger[_0xfec8('0x13')](_0xfec8('0x15'),_0x9a1d54,_0x18c998[_0xfec8('0x13')][_0xfec8('0x16')]);return _0xfc4a62(_0x18c998[_0xfec8('0x13')][_0xfec8('0x16')]);}logger[_0xfec8('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x9a1d54,_0x18c998[_0xfec8('0x13')][_0xfec8('0x16')]);return _0x51a03b(_0x18c998[_0xfec8('0x13')][_0xfec8('0x16')]);}else{logger[_0xfec8('0x17')]('SugarcrmAccount,\x20%s,\x20%s',_0x9a1d54,_0xfec8('0x11'));_0x51a03b(_0x18c998['result']['message']);}})[_0xfec8('0x18')](function(_0x5052ad){logger[_0xfec8('0x13')](_0xfec8('0x15'),_0x9a1d54,_0x5052ad);_0xfc4a62(_0x5052ad);});});}exports[_0xfec8('0x19')]=function(_0x885b03){var _0x45d169=this;return new Promise(function(_0x4922e9,_0x32cf9b){return db[_0xfec8('0x1a')][_0xfec8('0x1b')]({'raw':_0x885b03[_0xfec8('0x1c')]?_0x885b03['options'][_0xfec8('0x1d')]===undefined?!![]:![]:!![],'where':_0x885b03[_0xfec8('0x1c')]?_0x885b03[_0xfec8('0x1c')][_0xfec8('0x1e')]||null:null,'attributes':_0x885b03[_0xfec8('0x1c')]?_0x885b03['options'][_0xfec8('0x1f')]||null:null,'limit':_0x885b03[_0xfec8('0x1c')]?_0x885b03[_0xfec8('0x1c')]['limit']||null:null,'include':_0x885b03[_0xfec8('0x1c')]?_0x885b03['options'][_0xfec8('0x20')]?_[_0xfec8('0x21')](_0x885b03['options'][_0xfec8('0x20')],function(_0x10408f){return{'model':db[_0x10408f[_0xfec8('0x22')]],'as':_0x10408f['as'],'attributes':_0x10408f[_0xfec8('0x1f')],'include':_0x10408f[_0xfec8('0x20')]?_[_0xfec8('0x21')](_0x10408f[_0xfec8('0x20')],function(_0x3b4d65){return{'model':db[_0x3b4d65[_0xfec8('0x22')]],'as':_0x3b4d65['as'],'attributes':_0x3b4d65[_0xfec8('0x1f')],'include':_0x3b4d65[_0xfec8('0x20')]?_[_0xfec8('0x21')](_0x3b4d65[_0xfec8('0x20')],function(_0x1f232c){return{'model':db[_0x1f232c[_0xfec8('0x22')]],'as':_0x1f232c['as'],'attributes':_0x1f232c[_0xfec8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfec8('0xe')](function(_0x41ae48){logger[_0xfec8('0x17')](_0xfec8('0x19'),_0x885b03);logger[_0xfec8('0xf')]('GetSugarcrmAccount',_0x885b03,JSON[_0xfec8('0x12')](_0x41ae48));_0x4922e9(_0x41ae48);})['catch'](function(_0x5b4d56){logger[_0xfec8('0x13')](_0xfec8('0x19'),_0x5b4d56[_0xfec8('0x16')],_0x885b03);_0x32cf9b(_0x45d169['error'](0x1f4,_0x5b4d56[_0xfec8('0x16')]));});});};exports['ShowSugarcrmAccount']=function(_0x215673){var _0x199a74=this;return new Promise(function(_0x382c4d,_0x551163){return db[_0xfec8('0x1a')][_0xfec8('0x23')]({'raw':_0x215673['options']?_0x215673[_0xfec8('0x1c')][_0xfec8('0x1d')]===undefined?!![]:![]:!![],'where':_0x215673[_0xfec8('0x1c')]?_0x215673[_0xfec8('0x1c')][_0xfec8('0x1e')]||null:null,'attributes':_0x215673[_0xfec8('0x1c')]?_0x215673[_0xfec8('0x1c')][_0xfec8('0x1f')]||null:null,'include':_0x215673[_0xfec8('0x1c')]?_0x215673[_0xfec8('0x1c')][_0xfec8('0x20')]?_[_0xfec8('0x21')](_0x215673[_0xfec8('0x1c')][_0xfec8('0x20')],function(_0x37c842){return{'model':db[_0x37c842[_0xfec8('0x22')]],'as':_0x37c842['as'],'attributes':_0x37c842[_0xfec8('0x1f')],'include':_0x37c842['include']?_[_0xfec8('0x21')](_0x37c842['include'],function(_0x19f7ef){return{'model':db[_0x19f7ef['model']],'as':_0x19f7ef['as'],'attributes':_0x19f7ef[_0xfec8('0x1f')],'include':_0x19f7ef[_0xfec8('0x20')]?_['map'](_0x19f7ef[_0xfec8('0x20')],function(_0x605f91){return{'model':db[_0x605f91[_0xfec8('0x22')]],'as':_0x605f91['as'],'attributes':_0x605f91[_0xfec8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1af332){logger[_0xfec8('0x17')](_0xfec8('0x24'),_0x215673);logger[_0xfec8('0xf')](_0xfec8('0x24'),_0x215673,JSON[_0xfec8('0x12')](_0x1af332));_0x382c4d(_0x1af332);})[_0xfec8('0x18')](function(_0x4b6409){logger[_0xfec8('0x13')](_0xfec8('0x24'),_0x4b6409[_0xfec8('0x16')],_0x215673);_0x551163(_0x199a74[_0xfec8('0x13')](0x1f4,_0x4b6409[_0xfec8('0x16')]));});});};
\ No newline at end of file
index 621c167..40fd4bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d24=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','exports','multer','util','path','connect-timeout'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x9d24,0x155));var _0x49d2=function(_0x5006b8,_0x30a357){_0x5006b8=_0x5006b8-0x0;var _0x510222=_0x9d24[_0x5006b8];return _0x510222;};'use strict';var multer=require(_0x49d2('0x0'));var util=require(_0x49d2('0x1'));var path=require(_0x49d2('0x2'));var timeout=require(_0x49d2('0x3'));var express=require(_0x49d2('0x4'));var router=express[_0x49d2('0x5')]();var fs_extra=require(_0x49d2('0x6'));var auth=require(_0x49d2('0x7'));var interaction=require(_0x49d2('0x8'));var config=require('../../config/environment');var controller=require(_0x49d2('0x9'));router[_0x49d2('0xa')]('/',auth[_0x49d2('0xb')](),controller['index']);router['get'](_0x49d2('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x49d2('0xa')](_0x49d2('0xd'),auth[_0x49d2('0xb')](),controller[_0x49d2('0xe')]);router['get'](_0x49d2('0xf'),auth[_0x49d2('0xb')](),controller[_0x49d2('0x10')]);router[_0x49d2('0xa')](_0x49d2('0x11'),auth[_0x49d2('0xb')](),controller[_0x49d2('0x12')]);router[_0x49d2('0x13')]('/',auth[_0x49d2('0xb')](),controller[_0x49d2('0x14')]);router['put'](_0x49d2('0xc'),auth[_0x49d2('0xb')](),controller['update']);router[_0x49d2('0x15')](_0x49d2('0xc'),auth[_0x49d2('0xb')](),controller['destroy']);module[_0x49d2('0x16')]=router;
\ No newline at end of file
+var _0x9e55=['getFields','/:id/descriptions','getDescriptions','post','create','put','update','multer','path','express','Router','../../components/auth/service','isAuthenticated','get','/:id','/:id/fields'];(function(_0x6c1a0,_0xb68825){var _0x40f3ef=function(_0x77a676){while(--_0x77a676){_0x6c1a0['push'](_0x6c1a0['shift']());}};_0x40f3ef(++_0xb68825);}(_0x9e55,0xa7));var _0x59e5=function(_0x3346da,_0x4b3472){_0x3346da=_0x3346da-0x0;var _0xbca803=_0x9e55[_0x3346da];return _0xbca803;};'use strict';var multer=require(_0x59e5('0x0'));var util=require('util');var path=require(_0x59e5('0x1'));var timeout=require('connect-timeout');var express=require(_0x59e5('0x2'));var router=express[_0x59e5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x59e5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0x59e5('0x5')](),controller['index']);router[_0x59e5('0x6')](_0x59e5('0x7'),auth[_0x59e5('0x5')](),controller['show']);router[_0x59e5('0x6')](_0x59e5('0x8'),auth[_0x59e5('0x5')](),controller[_0x59e5('0x9')]);router[_0x59e5('0x6')]('/:id/subjects',auth[_0x59e5('0x5')](),controller['getSubjects']);router[_0x59e5('0x6')](_0x59e5('0xa'),auth[_0x59e5('0x5')](),controller[_0x59e5('0xb')]);router[_0x59e5('0xc')]('/',auth[_0x59e5('0x5')](),controller[_0x59e5('0xd')]);router[_0x59e5('0xe')](_0x59e5('0x7'),auth[_0x59e5('0x5')](),controller[_0x59e5('0xf')]);router['delete']('/:id',auth[_0x59e5('0x5')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index af1a832..2ff63bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf086=['exports','STRING'];(function(_0x356beb,_0x308032){var _0x4e2281=function(_0x25ee23){while(--_0x25ee23){_0x356beb['push'](_0x356beb['shift']());}};_0x4e2281(++_0x308032);}(_0xf086,0x10c));var _0x6f08=function(_0x29160f,_0x4b778b){_0x29160f=_0x29160f-0x0;var _0x10282d=_0xf086[_0x29160f];return _0x10282d;};'use strict';var Sequelize=require('sequelize');module[_0x6f08('0x0')]={'name':{'type':Sequelize[_0x6f08('0x1')]},'description':{'type':Sequelize[_0x6f08('0x1')]}};
\ No newline at end of file
+var _0x48ef=['STRING','sequelize','exports'];(function(_0x540697,_0x2b49b5){var _0x2600e5=function(_0x375872){while(--_0x375872){_0x540697['push'](_0x540697['shift']());}};_0x2600e5(++_0x2b49b5);}(_0x48ef,0x112));var _0xf48e=function(_0x5eee1c,_0x3817d8){_0x5eee1c=_0x5eee1c-0x0;var _0x5f2ea1=_0x48ef[_0x5eee1c];return _0x5f2ea1;};'use strict';var Sequelize=require(_0xf48e('0x0'));module[_0xf48e('0x1')]={'name':{'type':Sequelize[_0xf48e('0x2')]},'description':{'type':Sequelize[_0xf48e('0x2')]}};
\ No newline at end of file
index 0b09b68..c99bfff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabb5=['save','destroy','then','sendStatus','error','name','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','update','params','getFields','findOne','SugarcrmField','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x524715,_0x2c5173){var _0x495bfe=function(_0x37388d){while(--_0x37388d){_0x524715['push'](_0x524715['shift']());}};_0x495bfe(++_0x2c5173);}(_0xabb5,0xd9));var _0x5abb=function(_0x58864e,_0x1af71e){_0x58864e=_0x58864e-0x0;var _0x4dd5f8=_0xabb5[_0x58864e];return _0x4dd5f8;};'use strict';var emlformat=require(_0x5abb('0x0'));var rimraf=require(_0x5abb('0x1'));var zipdir=require(_0x5abb('0x2'));var jsonpatch=require(_0x5abb('0x3'));var rp=require(_0x5abb('0x4'));var moment=require(_0x5abb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5abb('0x6'));var util=require(_0x5abb('0x7'));var path=require(_0x5abb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5abb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5abb('0xa'));var squel=require('squel');var crypto=require(_0x5abb('0xb'));var jsforce=require(_0x5abb('0xc'));var deskjs=require(_0x5abb('0xd'));var toCsv=require(_0x5abb('0xe'));var querystring=require(_0x5abb('0xf'));var Papa=require(_0x5abb('0x10'));var Redis=require(_0x5abb('0x11'));var authService=require(_0x5abb('0x12'));var qs=require(_0x5abb('0x13'));var as=require(_0x5abb('0x14'));var hardwareService=require(_0x5abb('0x15'));var logger=require(_0x5abb('0x16'))(_0x5abb('0x17'));var utils=require(_0x5abb('0x18'));var config=require(_0x5abb('0x19'));var licenseUtil=require(_0x5abb('0x1a'));var db=require(_0x5abb('0x1b'))['db'];function respondWithStatusCode(_0x276d0f,_0x1ef7f9){_0x1ef7f9=_0x1ef7f9||0xcc;return function(_0x55eb2f){if(_0x55eb2f){return _0x276d0f['sendStatus'](_0x1ef7f9);}return _0x276d0f[_0x5abb('0x1c')](_0x1ef7f9)[_0x5abb('0x1d')]();};}function respondWithResult(_0x28e4f4,_0x331898){_0x331898=_0x331898||0xc8;return function(_0x4e7683){if(_0x4e7683){return _0x28e4f4[_0x5abb('0x1c')](_0x331898)[_0x5abb('0x1e')](_0x4e7683);}};}function respondWithFilteredResult(_0xa12254,_0xa4746f){return function(_0x546444){if(_0x546444){var _0x3ee517=typeof _0xa4746f[_0x5abb('0x1f')]==='undefined'&&typeof _0xa4746f['limit']===_0x5abb('0x20');var _0x414fd6=_0x546444[_0x5abb('0x21')];var _0x47188c=_0x3ee517?0x0:_0xa4746f[_0x5abb('0x1f')];var _0x49b4c0=_0x3ee517?_0x546444[_0x5abb('0x21')]:_0xa4746f['offset']+_0xa4746f[_0x5abb('0x22')];var _0x76569;if(_0x49b4c0>=_0x414fd6){_0x49b4c0=_0x414fd6;_0x76569=0xc8;}else{_0x76569=0xce;}_0xa12254[_0x5abb('0x1c')](_0x76569);return _0xa12254[_0x5abb('0x23')](_0x5abb('0x24'),_0x47188c+'-'+_0x49b4c0+'/'+_0x414fd6)['json'](_0x546444);}return null;};}function patchUpdates(_0x1d47c5){return function(_0x3fe10d){try{jsonpatch[_0x5abb('0x25')](_0x3fe10d,_0x1d47c5,!![]);}catch(_0x2e2097){return BPromise['reject'](_0x2e2097);}return _0x3fe10d[_0x5abb('0x26')]();};}function saveUpdates(_0xaeabf4,_0x31d542){return function(_0x258fc4){if(_0x258fc4){return _0x258fc4['update'](_0xaeabf4)['then'](function(_0x2881d5){return _0x2881d5;});}return null;};}function removeEntity(_0x5c3511,_0x3e3b1a){return function(_0xbda091){if(_0xbda091){return _0xbda091[_0x5abb('0x27')]()[_0x5abb('0x28')](function(){_0x5c3511[_0x5abb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221f9a,_0x113fae){return function(_0x16e858){if(!_0x16e858){_0x221f9a[_0x5abb('0x29')](0x194);}return _0x16e858;};}function handleError(_0x2b6ff0,_0x3e8fb1){_0x3e8fb1=_0x3e8fb1||0x1f4;return function(_0x4708b1){logger[_0x5abb('0x2a')](_0x4708b1['stack']);if(_0x4708b1[_0x5abb('0x2b')]){delete _0x4708b1[_0x5abb('0x2b')];}_0x2b6ff0[_0x5abb('0x1c')](_0x3e8fb1)['send'](_0x4708b1);};}exports[_0x5abb('0x2c')]=function(_0x26b9d4,_0x1d05a3){var _0x1875bd={},_0x243e32={},_0x201662={'count':0x0,'rows':[]};var _0x353eb9=_['map'](db[_0x5abb('0x2d')][_0x5abb('0x2e')],function(_0x2b6491){return{'name':_0x2b6491[_0x5abb('0x2f')],'type':_0x2b6491[_0x5abb('0x30')][_0x5abb('0x31')]};});_0x243e32[_0x5abb('0x32')]=_[_0x5abb('0x33')](_0x353eb9,_0x5abb('0x2b'));_0x243e32[_0x5abb('0x34')]=_[_0x5abb('0x35')](_0x26b9d4[_0x5abb('0x34')]);_0x243e32[_0x5abb('0x36')]=_['intersection'](_0x243e32[_0x5abb('0x32')],_0x243e32[_0x5abb('0x34')]);_0x1875bd[_0x5abb('0x37')]=_['intersection'](_0x243e32[_0x5abb('0x32')],qs[_0x5abb('0x38')](_0x26b9d4['query'][_0x5abb('0x38')]));_0x1875bd['attributes']=_0x1875bd[_0x5abb('0x37')][_0x5abb('0x39')]?_0x1875bd[_0x5abb('0x37')]:_0x243e32[_0x5abb('0x32')];if(!_0x26b9d4[_0x5abb('0x34')][_0x5abb('0x3a')](_0x5abb('0x3b'))){_0x1875bd[_0x5abb('0x22')]=qs[_0x5abb('0x22')](_0x26b9d4[_0x5abb('0x34')]['limit']);_0x1875bd[_0x5abb('0x1f')]=qs[_0x5abb('0x1f')](_0x26b9d4['query'][_0x5abb('0x1f')]);}_0x1875bd[_0x5abb('0x3c')]=qs[_0x5abb('0x3d')](_0x26b9d4['query'][_0x5abb('0x3d')]);_0x1875bd[_0x5abb('0x3e')]=qs[_0x5abb('0x36')](_[_0x5abb('0x3f')](_0x26b9d4[_0x5abb('0x34')],_0x243e32[_0x5abb('0x36')]),_0x353eb9);if(_0x26b9d4[_0x5abb('0x34')]['filter']){_0x1875bd[_0x5abb('0x3e')]=_[_0x5abb('0x40')](_0x1875bd['where'],{'$or':_[_0x5abb('0x33')](_0x353eb9,function(_0x19e310){if(_0x19e310['type']!==_0x5abb('0x41')){var _0x38c24f={};_0x38c24f[_0x19e310['name']]={'$like':'%'+_0x26b9d4[_0x5abb('0x34')]['filter']+'%'};return _0x38c24f;}})});}_0x1875bd=_[_0x5abb('0x40')]({},_0x1875bd,_0x26b9d4[_0x5abb('0x42')]);var _0x4aba6d={'where':_0x1875bd['where']};return db[_0x5abb('0x2d')][_0x5abb('0x21')](_0x4aba6d)[_0x5abb('0x28')](function(_0x30e0b8){_0x201662[_0x5abb('0x21')]=_0x30e0b8;if(_0x26b9d4[_0x5abb('0x34')][_0x5abb('0x43')]){_0x1875bd[_0x5abb('0x44')]=[{'all':!![]}];}return db[_0x5abb('0x2d')][_0x5abb('0x45')](_0x1875bd);})[_0x5abb('0x28')](function(_0x21951b){_0x201662[_0x5abb('0x46')]=_0x21951b;return _0x201662;})[_0x5abb('0x28')](respondWithFilteredResult(_0x1d05a3,_0x1875bd))[_0x5abb('0x47')](handleError(_0x1d05a3,null));};exports[_0x5abb('0x48')]=function(_0x431464,_0x3fd2c3){var _0x23bccc={'raw':![],'where':{'id':_0x431464['params']['id']}},_0x1b7a4a={};_0x1b7a4a[_0x5abb('0x32')]=_['keys'](db[_0x5abb('0x2d')]['rawAttributes']);_0x1b7a4a[_0x5abb('0x34')]=_[_0x5abb('0x35')](_0x431464[_0x5abb('0x34')]);_0x1b7a4a['filters']=_[_0x5abb('0x49')](_0x1b7a4a['model'],_0x1b7a4a[_0x5abb('0x34')]);_0x23bccc[_0x5abb('0x37')]=_[_0x5abb('0x49')](_0x1b7a4a[_0x5abb('0x32')],qs[_0x5abb('0x38')](_0x431464[_0x5abb('0x34')][_0x5abb('0x38')]));_0x23bccc[_0x5abb('0x37')]=_0x23bccc[_0x5abb('0x37')][_0x5abb('0x39')]?_0x23bccc[_0x5abb('0x37')]:_0x1b7a4a[_0x5abb('0x32')];if(_0x431464[_0x5abb('0x34')][_0x5abb('0x43')]){_0x23bccc[_0x5abb('0x44')]=[{'all':!![]}];}_0x23bccc=_[_0x5abb('0x40')]({},_0x23bccc,_0x431464[_0x5abb('0x42')]);return db[_0x5abb('0x2d')][_0x5abb('0x4a')](_0x23bccc)['then'](handleEntityNotFound(_0x3fd2c3,null))['then'](respondWithResult(_0x3fd2c3,null))[_0x5abb('0x47')](handleError(_0x3fd2c3,null));};exports[_0x5abb('0x4b')]=function(_0x41e67d,_0x5839dd){return db[_0x5abb('0x2d')]['create'](_0x41e67d[_0x5abb('0x4c')],{})[_0x5abb('0x28')](respondWithResult(_0x5839dd,0xc9))[_0x5abb('0x47')](handleError(_0x5839dd,null));};exports[_0x5abb('0x4d')]=function(_0x5e52f3,_0x5239cd){if(_0x5e52f3['body']['id']){delete _0x5e52f3[_0x5abb('0x4c')]['id'];}return db[_0x5abb('0x2d')][_0x5abb('0x4a')]({'where':{'id':_0x5e52f3[_0x5abb('0x4e')]['id']}})[_0x5abb('0x28')](handleEntityNotFound(_0x5239cd,null))[_0x5abb('0x28')](saveUpdates(_0x5e52f3[_0x5abb('0x4c')],null))[_0x5abb('0x28')](respondWithResult(_0x5239cd,null))[_0x5abb('0x47')](handleError(_0x5239cd,null));};exports[_0x5abb('0x27')]=function(_0x500d8a,_0x119142){return db['SugarcrmConfiguration'][_0x5abb('0x4a')]({'where':{'id':_0x500d8a[_0x5abb('0x4e')]['id']}})[_0x5abb('0x28')](handleEntityNotFound(_0x119142,null))['then'](removeEntity(_0x119142,null))[_0x5abb('0x47')](handleError(_0x119142,null));};exports[_0x5abb('0x4f')]=function(_0x5b61fb,_0x267a5e,_0x295439){var _0x596587={};var _0xffd558={};var _0x233c76;var _0xa53b77;return db['SugarcrmConfiguration'][_0x5abb('0x50')]({'where':{'id':_0x5b61fb[_0x5abb('0x4e')]['id']}})[_0x5abb('0x28')](handleEntityNotFound(_0x267a5e,null))[_0x5abb('0x28')](function(_0x3d1c82){if(_0x3d1c82){_0x233c76=_0x3d1c82;_0xffd558[_0x5abb('0x32')]=_[_0x5abb('0x35')](db[_0x5abb('0x51')]['rawAttributes']);_0xffd558[_0x5abb('0x34')]=_[_0x5abb('0x35')](_0x5b61fb[_0x5abb('0x34')]);_0xffd558[_0x5abb('0x36')]=_['intersection'](_0xffd558['model'],_0xffd558[_0x5abb('0x34')]);_0x596587[_0x5abb('0x37')]=_[_0x5abb('0x49')](_0xffd558[_0x5abb('0x32')],qs['fields'](_0x5b61fb[_0x5abb('0x34')][_0x5abb('0x38')]));_0x596587['attributes']=_0x596587[_0x5abb('0x37')][_0x5abb('0x39')]?_0x596587[_0x5abb('0x37')]:_0xffd558[_0x5abb('0x32')];_0x596587[_0x5abb('0x3c')]=qs['sort'](_0x5b61fb[_0x5abb('0x34')][_0x5abb('0x3d')]);_0x596587[_0x5abb('0x3e')]=qs[_0x5abb('0x36')](_['pick'](_0x5b61fb[_0x5abb('0x34')],_0xffd558[_0x5abb('0x36')]));if(_0x5b61fb['query'][_0x5abb('0x52')]){_0x596587['where']=_[_0x5abb('0x40')](_0x596587[_0x5abb('0x3e')],{'$or':_[_0x5abb('0x33')](_0x596587[_0x5abb('0x37')],function(_0x3d3064){var _0x4f7e45={};_0x4f7e45[_0x3d3064]={'$like':'%'+_0x5b61fb[_0x5abb('0x34')]['filter']+'%'};return _0x4f7e45;})});}_0x596587=_['merge']({},_0x596587,_0x5b61fb[_0x5abb('0x42')]);return _0x233c76[_0x5abb('0x4f')](_0x596587);}})['then'](function(_0x422406){if(_0x422406){_0xa53b77=_0x422406[_0x5abb('0x39')];if(!_0x5b61fb['query'][_0x5abb('0x3a')](_0x5abb('0x3b'))){_0x596587[_0x5abb('0x22')]=qs['limit'](_0x5b61fb['query']['limit']);_0x596587['offset']=qs[_0x5abb('0x1f')](_0x5b61fb[_0x5abb('0x34')][_0x5abb('0x1f')]);}return _0x233c76['getFields'](_0x596587);}})[_0x5abb('0x28')](function(_0x3a23cd){if(_0x3a23cd){return _0x3a23cd?{'count':_0xa53b77,'rows':_0x3a23cd}:null;}})[_0x5abb('0x28')](respondWithResult(_0x267a5e,null))[_0x5abb('0x47')](handleError(_0x267a5e,null));};exports[_0x5abb('0x53')]=function(_0x299ad6,_0x535418,_0xce4d64){var _0x110fe0={};var _0x3a023c={};var _0x1d508a;var _0x799f19;return db['SugarcrmConfiguration'][_0x5abb('0x50')]({'where':{'id':_0x299ad6['params']['id']}})[_0x5abb('0x28')](handleEntityNotFound(_0x535418,null))[_0x5abb('0x28')](function(_0x2ec990){if(_0x2ec990){_0x1d508a=_0x2ec990;_0x3a023c['model']=_[_0x5abb('0x35')](db[_0x5abb('0x51')][_0x5abb('0x2e')]);_0x3a023c[_0x5abb('0x34')]=_['keys'](_0x299ad6[_0x5abb('0x34')]);_0x3a023c[_0x5abb('0x36')]=_['intersection'](_0x3a023c[_0x5abb('0x32')],_0x3a023c[_0x5abb('0x34')]);_0x110fe0[_0x5abb('0x37')]=_['intersection'](_0x3a023c[_0x5abb('0x32')],qs[_0x5abb('0x38')](_0x299ad6[_0x5abb('0x34')][_0x5abb('0x38')]));_0x110fe0[_0x5abb('0x37')]=_0x110fe0['attributes'][_0x5abb('0x39')]?_0x110fe0['attributes']:_0x3a023c[_0x5abb('0x32')];_0x110fe0['order']=qs[_0x5abb('0x3d')](_0x299ad6[_0x5abb('0x34')][_0x5abb('0x3d')]);_0x110fe0[_0x5abb('0x3e')]=qs[_0x5abb('0x36')](_[_0x5abb('0x3f')](_0x299ad6[_0x5abb('0x34')],_0x3a023c[_0x5abb('0x36')]));if(_0x299ad6['query'][_0x5abb('0x52')]){_0x110fe0[_0x5abb('0x3e')]=_['merge'](_0x110fe0[_0x5abb('0x3e')],{'$or':_['map'](_0x110fe0['attributes'],function(_0x8ba08){var _0x28abf9={};_0x28abf9[_0x8ba08]={'$like':'%'+_0x299ad6[_0x5abb('0x34')][_0x5abb('0x52')]+'%'};return _0x28abf9;})});}_0x110fe0=_[_0x5abb('0x40')]({},_0x110fe0,_0x299ad6[_0x5abb('0x42')]);return _0x1d508a['getSubjects'](_0x110fe0);}})[_0x5abb('0x28')](function(_0x15dc20){if(_0x15dc20){_0x799f19=_0x15dc20[_0x5abb('0x39')];if(!_0x299ad6['query'][_0x5abb('0x3a')](_0x5abb('0x3b'))){_0x110fe0['limit']=qs[_0x5abb('0x22')](_0x299ad6['query'][_0x5abb('0x22')]);_0x110fe0['offset']=qs['offset'](_0x299ad6[_0x5abb('0x34')][_0x5abb('0x1f')]);}return _0x1d508a[_0x5abb('0x53')](_0x110fe0);}})[_0x5abb('0x28')](function(_0x37a9b3){if(_0x37a9b3){return _0x37a9b3?{'count':_0x799f19,'rows':_0x37a9b3}:null;}})['then'](respondWithResult(_0x535418,null))[_0x5abb('0x47')](handleError(_0x535418,null));};exports[_0x5abb('0x54')]=function(_0x236aaa,_0x1c873d,_0xdb732b){var _0x55eec2={};var _0x2b1880={};var _0x4ecd3d;var _0x4ae430;return db[_0x5abb('0x2d')][_0x5abb('0x50')]({'where':{'id':_0x236aaa[_0x5abb('0x4e')]['id']}})[_0x5abb('0x28')](handleEntityNotFound(_0x1c873d,null))[_0x5abb('0x28')](function(_0x2439b4){if(_0x2439b4){_0x4ecd3d=_0x2439b4;_0x2b1880[_0x5abb('0x32')]=_[_0x5abb('0x35')](db[_0x5abb('0x51')][_0x5abb('0x2e')]);_0x2b1880['query']=_[_0x5abb('0x35')](_0x236aaa[_0x5abb('0x34')]);_0x2b1880[_0x5abb('0x36')]=_['intersection'](_0x2b1880[_0x5abb('0x32')],_0x2b1880['query']);_0x55eec2[_0x5abb('0x37')]=_[_0x5abb('0x49')](_0x2b1880[_0x5abb('0x32')],qs['fields'](_0x236aaa[_0x5abb('0x34')]['fields']));_0x55eec2[_0x5abb('0x37')]=_0x55eec2[_0x5abb('0x37')][_0x5abb('0x39')]?_0x55eec2['attributes']:_0x2b1880['model'];_0x55eec2[_0x5abb('0x3c')]=qs[_0x5abb('0x3d')](_0x236aaa[_0x5abb('0x34')][_0x5abb('0x3d')]);_0x55eec2[_0x5abb('0x3e')]=qs[_0x5abb('0x36')](_[_0x5abb('0x3f')](_0x236aaa[_0x5abb('0x34')],_0x2b1880[_0x5abb('0x36')]));if(_0x236aaa['query'][_0x5abb('0x52')]){_0x55eec2[_0x5abb('0x3e')]=_[_0x5abb('0x40')](_0x55eec2[_0x5abb('0x3e')],{'$or':_[_0x5abb('0x33')](_0x55eec2[_0x5abb('0x37')],function(_0x513fdf){var _0x1ca2a4={};_0x1ca2a4[_0x513fdf]={'$like':'%'+_0x236aaa[_0x5abb('0x34')][_0x5abb('0x52')]+'%'};return _0x1ca2a4;})});}_0x55eec2=_[_0x5abb('0x40')]({},_0x55eec2,_0x236aaa[_0x5abb('0x42')]);return _0x4ecd3d['getDescriptions'](_0x55eec2);}})[_0x5abb('0x28')](function(_0x1d83b5){if(_0x1d83b5){_0x4ae430=_0x1d83b5[_0x5abb('0x39')];if(!_0x236aaa['query'][_0x5abb('0x3a')](_0x5abb('0x3b'))){_0x55eec2[_0x5abb('0x22')]=qs['limit'](_0x236aaa['query'][_0x5abb('0x22')]);_0x55eec2['offset']=qs[_0x5abb('0x1f')](_0x236aaa[_0x5abb('0x34')][_0x5abb('0x1f')]);}return _0x4ecd3d[_0x5abb('0x54')](_0x55eec2);}})[_0x5abb('0x28')](function(_0x1e41a7){if(_0x1e41a7){return _0x1e41a7?{'count':_0x4ae430,'rows':_0x1e41a7}:null;}})[_0x5abb('0x28')](respondWithResult(_0x1c873d,null))[_0x5abb('0x47')](handleError(_0x1c873d,null));};
\ No newline at end of file
+var _0x048c=['apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x5586d7,_0x592d9b){var _0x205052=function(_0x2329e2){while(--_0x2329e2){_0x5586d7['push'](_0x5586d7['shift']());}};_0x205052(++_0x592d9b);}(_0x048c,0x1ce));var _0xc048=function(_0x30efa2,_0x983b4b){_0x30efa2=_0x30efa2-0x0;var _0x45a4e2=_0x048c[_0x30efa2];return _0x45a4e2;};'use strict';var emlformat=require(_0xc048('0x0'));var rimraf=require(_0xc048('0x1'));var zipdir=require(_0xc048('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc048('0x3'));var moment=require(_0xc048('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc048('0x5'));var util=require(_0xc048('0x6'));var path=require('path');var sox=require(_0xc048('0x7'));var csv=require('to-csv');var ejs=require(_0xc048('0x8'));var fs=require('fs');var fs_extra=require(_0xc048('0x9'));var _=require(_0xc048('0xa'));var squel=require(_0xc048('0xb'));var crypto=require(_0xc048('0xc'));var jsforce=require(_0xc048('0xd'));var deskjs=require(_0xc048('0xe'));var toCsv=require(_0xc048('0xf'));var querystring=require(_0xc048('0x10'));var Papa=require(_0xc048('0x11'));var Redis=require(_0xc048('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc048('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc048('0x14'));var logger=require(_0xc048('0x15'))(_0xc048('0x16'));var utils=require(_0xc048('0x17'));var config=require(_0xc048('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc048('0x19'))['db'];function respondWithStatusCode(_0x53fa51,_0x13355b){_0x13355b=_0x13355b||0xcc;return function(_0x42c29c){if(_0x42c29c){return _0x53fa51[_0xc048('0x1a')](_0x13355b);}return _0x53fa51['status'](_0x13355b)[_0xc048('0x1b')]();};}function respondWithResult(_0x182340,_0x2c88ec){_0x2c88ec=_0x2c88ec||0xc8;return function(_0x3b3098){if(_0x3b3098){return _0x182340[_0xc048('0x1c')](_0x2c88ec)[_0xc048('0x1d')](_0x3b3098);}};}function respondWithFilteredResult(_0x136f7f,_0x20978f){return function(_0x1abd68){if(_0x1abd68){var _0x446c43=typeof _0x20978f['offset']===_0xc048('0x1e')&&typeof _0x20978f[_0xc048('0x1f')]==='undefined';var _0xdb0bbf=_0x1abd68[_0xc048('0x20')];var _0x523fbc=_0x446c43?0x0:_0x20978f[_0xc048('0x21')];var _0x2edc99=_0x446c43?_0x1abd68['count']:_0x20978f[_0xc048('0x21')]+_0x20978f[_0xc048('0x1f')];var _0x30eb47;if(_0x2edc99>=_0xdb0bbf){_0x2edc99=_0xdb0bbf;_0x30eb47=0xc8;}else{_0x30eb47=0xce;}_0x136f7f['status'](_0x30eb47);return _0x136f7f[_0xc048('0x22')](_0xc048('0x23'),_0x523fbc+'-'+_0x2edc99+'/'+_0xdb0bbf)[_0xc048('0x1d')](_0x1abd68);}return null;};}function patchUpdates(_0x287dc5){return function(_0x126485){try{jsonpatch[_0xc048('0x24')](_0x126485,_0x287dc5,!![]);}catch(_0x501c98){return BPromise['reject'](_0x501c98);}return _0x126485[_0xc048('0x25')]();};}function saveUpdates(_0x2f50dc,_0x5ad81a){return function(_0xae103d){if(_0xae103d){return _0xae103d[_0xc048('0x26')](_0x2f50dc)[_0xc048('0x27')](function(_0xed8f29){return _0xed8f29;});}return null;};}function removeEntity(_0x328edb,_0x335311){return function(_0x27017d){if(_0x27017d){return _0x27017d[_0xc048('0x28')]()['then'](function(){_0x328edb[_0xc048('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6e0e,_0x4d06f0){return function(_0x1b7049){if(!_0x1b7049){_0x2c6e0e[_0xc048('0x1a')](0x194);}return _0x1b7049;};}function handleError(_0x5bdccc,_0x84a5dc){_0x84a5dc=_0x84a5dc||0x1f4;return function(_0x3e12e0){logger[_0xc048('0x29')](_0x3e12e0[_0xc048('0x2a')]);if(_0x3e12e0[_0xc048('0x2b')]){delete _0x3e12e0[_0xc048('0x2b')];}_0x5bdccc['status'](_0x84a5dc)[_0xc048('0x2c')](_0x3e12e0);};}exports[_0xc048('0x2d')]=function(_0x2d7f0f,_0x2cabfa){var _0x48346b={},_0x340b5d={},_0x312bb3={'count':0x0,'rows':[]};var _0x515cf3=_[_0xc048('0x2e')](db['SugarcrmConfiguration'][_0xc048('0x2f')],function(_0x2f026){return{'name':_0x2f026['fieldName'],'type':_0x2f026[_0xc048('0x30')][_0xc048('0x31')]};});_0x340b5d[_0xc048('0x32')]=_[_0xc048('0x2e')](_0x515cf3,'name');_0x340b5d[_0xc048('0x33')]=_[_0xc048('0x34')](_0x2d7f0f[_0xc048('0x33')]);_0x340b5d[_0xc048('0x35')]=_['intersection'](_0x340b5d[_0xc048('0x32')],_0x340b5d[_0xc048('0x33')]);_0x48346b['attributes']=_[_0xc048('0x36')](_0x340b5d['model'],qs[_0xc048('0x37')](_0x2d7f0f['query']['fields']));_0x48346b[_0xc048('0x38')]=_0x48346b[_0xc048('0x38')][_0xc048('0x39')]?_0x48346b['attributes']:_0x340b5d[_0xc048('0x32')];if(!_0x2d7f0f['query'][_0xc048('0x3a')](_0xc048('0x3b'))){_0x48346b[_0xc048('0x1f')]=qs[_0xc048('0x1f')](_0x2d7f0f['query'][_0xc048('0x1f')]);_0x48346b['offset']=qs[_0xc048('0x21')](_0x2d7f0f[_0xc048('0x33')][_0xc048('0x21')]);}_0x48346b[_0xc048('0x3c')]=qs['sort'](_0x2d7f0f[_0xc048('0x33')][_0xc048('0x3d')]);_0x48346b[_0xc048('0x3e')]=qs[_0xc048('0x35')](_[_0xc048('0x3f')](_0x2d7f0f['query'],_0x340b5d[_0xc048('0x35')]),_0x515cf3);if(_0x2d7f0f[_0xc048('0x33')][_0xc048('0x40')]){_0x48346b['where']=_[_0xc048('0x41')](_0x48346b[_0xc048('0x3e')],{'$or':_[_0xc048('0x2e')](_0x515cf3,function(_0x376636){if(_0x376636['type']!==_0xc048('0x42')){var _0x12403d={};_0x12403d[_0x376636['name']]={'$like':'%'+_0x2d7f0f['query'][_0xc048('0x40')]+'%'};return _0x12403d;}})});}_0x48346b=_['merge']({},_0x48346b,_0x2d7f0f[_0xc048('0x43')]);var _0x38ef2e={'where':_0x48346b[_0xc048('0x3e')]};return db[_0xc048('0x44')][_0xc048('0x20')](_0x38ef2e)[_0xc048('0x27')](function(_0x22139f){_0x312bb3['count']=_0x22139f;if(_0x2d7f0f[_0xc048('0x33')][_0xc048('0x45')]){_0x48346b[_0xc048('0x46')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xc048('0x47')](_0x48346b);})[_0xc048('0x27')](function(_0x28fee9){_0x312bb3[_0xc048('0x48')]=_0x28fee9;return _0x312bb3;})['then'](respondWithFilteredResult(_0x2cabfa,_0x48346b))[_0xc048('0x49')](handleError(_0x2cabfa,null));};exports['show']=function(_0x5d486a,_0x30153f){var _0x464f96={'raw':![],'where':{'id':_0x5d486a[_0xc048('0x4a')]['id']}},_0x335247={};_0x335247[_0xc048('0x32')]=_[_0xc048('0x34')](db[_0xc048('0x44')][_0xc048('0x2f')]);_0x335247[_0xc048('0x33')]=_[_0xc048('0x34')](_0x5d486a['query']);_0x335247['filters']=_[_0xc048('0x36')](_0x335247[_0xc048('0x32')],_0x335247[_0xc048('0x33')]);_0x464f96['attributes']=_['intersection'](_0x335247['model'],qs[_0xc048('0x37')](_0x5d486a[_0xc048('0x33')][_0xc048('0x37')]));_0x464f96[_0xc048('0x38')]=_0x464f96[_0xc048('0x38')]['length']?_0x464f96[_0xc048('0x38')]:_0x335247[_0xc048('0x32')];if(_0x5d486a['query'][_0xc048('0x45')]){_0x464f96['include']=[{'all':!![]}];}_0x464f96=_[_0xc048('0x41')]({},_0x464f96,_0x5d486a[_0xc048('0x43')]);return db[_0xc048('0x44')][_0xc048('0x4b')](_0x464f96)[_0xc048('0x27')](handleEntityNotFound(_0x30153f,null))[_0xc048('0x27')](respondWithResult(_0x30153f,null))[_0xc048('0x49')](handleError(_0x30153f,null));};exports[_0xc048('0x4c')]=function(_0x53657d,_0x581c65){return db[_0xc048('0x44')][_0xc048('0x4c')](_0x53657d[_0xc048('0x4d')],{})[_0xc048('0x27')](respondWithResult(_0x581c65,0xc9))[_0xc048('0x49')](handleError(_0x581c65,null));};exports['update']=function(_0x4ab1c9,_0x569e85){if(_0x4ab1c9[_0xc048('0x4d')]['id']){delete _0x4ab1c9[_0xc048('0x4d')]['id'];}return db['SugarcrmConfiguration'][_0xc048('0x4b')]({'where':{'id':_0x4ab1c9[_0xc048('0x4a')]['id']}})[_0xc048('0x27')](handleEntityNotFound(_0x569e85,null))[_0xc048('0x27')](saveUpdates(_0x4ab1c9[_0xc048('0x4d')],null))[_0xc048('0x27')](respondWithResult(_0x569e85,null))[_0xc048('0x49')](handleError(_0x569e85,null));};exports['destroy']=function(_0x1d4cf9,_0x13236b){return db[_0xc048('0x44')]['find']({'where':{'id':_0x1d4cf9[_0xc048('0x4a')]['id']}})[_0xc048('0x27')](handleEntityNotFound(_0x13236b,null))[_0xc048('0x27')](removeEntity(_0x13236b,null))[_0xc048('0x49')](handleError(_0x13236b,null));};exports[_0xc048('0x4e')]=function(_0x515e1f,_0x56a1fb,_0x3a9cbf){var _0xa879d={};var _0x5a3155={};var _0x44ab72;var _0x5abe0e;return db['SugarcrmConfiguration'][_0xc048('0x4f')]({'where':{'id':_0x515e1f[_0xc048('0x4a')]['id']}})[_0xc048('0x27')](handleEntityNotFound(_0x56a1fb,null))[_0xc048('0x27')](function(_0x4d95a5){if(_0x4d95a5){_0x44ab72=_0x4d95a5;_0x5a3155['model']=_[_0xc048('0x34')](db['SugarcrmField'][_0xc048('0x2f')]);_0x5a3155[_0xc048('0x33')]=_['keys'](_0x515e1f[_0xc048('0x33')]);_0x5a3155['filters']=_[_0xc048('0x36')](_0x5a3155[_0xc048('0x32')],_0x5a3155[_0xc048('0x33')]);_0xa879d['attributes']=_['intersection'](_0x5a3155['model'],qs['fields'](_0x515e1f['query'][_0xc048('0x37')]));_0xa879d[_0xc048('0x38')]=_0xa879d[_0xc048('0x38')][_0xc048('0x39')]?_0xa879d[_0xc048('0x38')]:_0x5a3155[_0xc048('0x32')];_0xa879d[_0xc048('0x3c')]=qs[_0xc048('0x3d')](_0x515e1f[_0xc048('0x33')][_0xc048('0x3d')]);_0xa879d[_0xc048('0x3e')]=qs['filters'](_[_0xc048('0x3f')](_0x515e1f['query'],_0x5a3155[_0xc048('0x35')]));if(_0x515e1f[_0xc048('0x33')][_0xc048('0x40')]){_0xa879d[_0xc048('0x3e')]=_[_0xc048('0x41')](_0xa879d[_0xc048('0x3e')],{'$or':_['map'](_0xa879d['attributes'],function(_0x17c148){var _0x271503={};_0x271503[_0x17c148]={'$like':'%'+_0x515e1f[_0xc048('0x33')][_0xc048('0x40')]+'%'};return _0x271503;})});}_0xa879d=_[_0xc048('0x41')]({},_0xa879d,_0x515e1f[_0xc048('0x43')]);return _0x44ab72[_0xc048('0x4e')](_0xa879d);}})[_0xc048('0x27')](function(_0x2f8b0d){if(_0x2f8b0d){_0x5abe0e=_0x2f8b0d[_0xc048('0x39')];if(!_0x515e1f[_0xc048('0x33')][_0xc048('0x3a')](_0xc048('0x3b'))){_0xa879d[_0xc048('0x1f')]=qs['limit'](_0x515e1f[_0xc048('0x33')][_0xc048('0x1f')]);_0xa879d[_0xc048('0x21')]=qs['offset'](_0x515e1f[_0xc048('0x33')][_0xc048('0x21')]);}return _0x44ab72[_0xc048('0x4e')](_0xa879d);}})[_0xc048('0x27')](function(_0xc97fa6){if(_0xc97fa6){return _0xc97fa6?{'count':_0x5abe0e,'rows':_0xc97fa6}:null;}})[_0xc048('0x27')](respondWithResult(_0x56a1fb,null))[_0xc048('0x49')](handleError(_0x56a1fb,null));};exports['getSubjects']=function(_0x576c95,_0x446c4c,_0x44c2f2){var _0x5c10bf={};var _0x2e8765={};var _0x188e80;var _0x4825ec;return db[_0xc048('0x44')][_0xc048('0x4f')]({'where':{'id':_0x576c95['params']['id']}})['then'](handleEntityNotFound(_0x446c4c,null))[_0xc048('0x27')](function(_0x2fdfce){if(_0x2fdfce){_0x188e80=_0x2fdfce;_0x2e8765[_0xc048('0x32')]=_[_0xc048('0x34')](db[_0xc048('0x50')][_0xc048('0x2f')]);_0x2e8765[_0xc048('0x33')]=_[_0xc048('0x34')](_0x576c95['query']);_0x2e8765['filters']=_[_0xc048('0x36')](_0x2e8765[_0xc048('0x32')],_0x2e8765[_0xc048('0x33')]);_0x5c10bf[_0xc048('0x38')]=_[_0xc048('0x36')](_0x2e8765[_0xc048('0x32')],qs[_0xc048('0x37')](_0x576c95[_0xc048('0x33')][_0xc048('0x37')]));_0x5c10bf['attributes']=_0x5c10bf[_0xc048('0x38')][_0xc048('0x39')]?_0x5c10bf['attributes']:_0x2e8765[_0xc048('0x32')];_0x5c10bf[_0xc048('0x3c')]=qs[_0xc048('0x3d')](_0x576c95[_0xc048('0x33')][_0xc048('0x3d')]);_0x5c10bf[_0xc048('0x3e')]=qs[_0xc048('0x35')](_[_0xc048('0x3f')](_0x576c95['query'],_0x2e8765[_0xc048('0x35')]));if(_0x576c95[_0xc048('0x33')][_0xc048('0x40')]){_0x5c10bf[_0xc048('0x3e')]=_[_0xc048('0x41')](_0x5c10bf[_0xc048('0x3e')],{'$or':_[_0xc048('0x2e')](_0x5c10bf[_0xc048('0x38')],function(_0x13b53b){var _0x1111f3={};_0x1111f3[_0x13b53b]={'$like':'%'+_0x576c95[_0xc048('0x33')][_0xc048('0x40')]+'%'};return _0x1111f3;})});}_0x5c10bf=_[_0xc048('0x41')]({},_0x5c10bf,_0x576c95[_0xc048('0x43')]);return _0x188e80[_0xc048('0x51')](_0x5c10bf);}})[_0xc048('0x27')](function(_0x5efe1e){if(_0x5efe1e){_0x4825ec=_0x5efe1e[_0xc048('0x39')];if(!_0x576c95[_0xc048('0x33')][_0xc048('0x3a')](_0xc048('0x3b'))){_0x5c10bf[_0xc048('0x1f')]=qs['limit'](_0x576c95[_0xc048('0x33')][_0xc048('0x1f')]);_0x5c10bf[_0xc048('0x21')]=qs['offset'](_0x576c95[_0xc048('0x33')][_0xc048('0x21')]);}return _0x188e80[_0xc048('0x51')](_0x5c10bf);}})[_0xc048('0x27')](function(_0x4a24c8){if(_0x4a24c8){return _0x4a24c8?{'count':_0x4825ec,'rows':_0x4a24c8}:null;}})['then'](respondWithResult(_0x446c4c,null))[_0xc048('0x49')](handleError(_0x446c4c,null));};exports[_0xc048('0x52')]=function(_0x4d9a5f,_0x3303f4,_0x52ee58){var _0x1da1cf={};var _0x1d38b8={};var _0x509710;var _0x533e6e;return db[_0xc048('0x44')]['findOne']({'where':{'id':_0x4d9a5f[_0xc048('0x4a')]['id']}})[_0xc048('0x27')](handleEntityNotFound(_0x3303f4,null))[_0xc048('0x27')](function(_0x589913){if(_0x589913){_0x509710=_0x589913;_0x1d38b8[_0xc048('0x32')]=_[_0xc048('0x34')](db['SugarcrmField'][_0xc048('0x2f')]);_0x1d38b8[_0xc048('0x33')]=_[_0xc048('0x34')](_0x4d9a5f[_0xc048('0x33')]);_0x1d38b8[_0xc048('0x35')]=_[_0xc048('0x36')](_0x1d38b8[_0xc048('0x32')],_0x1d38b8[_0xc048('0x33')]);_0x1da1cf[_0xc048('0x38')]=_[_0xc048('0x36')](_0x1d38b8[_0xc048('0x32')],qs['fields'](_0x4d9a5f[_0xc048('0x33')]['fields']));_0x1da1cf[_0xc048('0x38')]=_0x1da1cf[_0xc048('0x38')][_0xc048('0x39')]?_0x1da1cf[_0xc048('0x38')]:_0x1d38b8[_0xc048('0x32')];_0x1da1cf[_0xc048('0x3c')]=qs[_0xc048('0x3d')](_0x4d9a5f['query'][_0xc048('0x3d')]);_0x1da1cf[_0xc048('0x3e')]=qs['filters'](_[_0xc048('0x3f')](_0x4d9a5f[_0xc048('0x33')],_0x1d38b8[_0xc048('0x35')]));if(_0x4d9a5f[_0xc048('0x33')][_0xc048('0x40')]){_0x1da1cf['where']=_['merge'](_0x1da1cf[_0xc048('0x3e')],{'$or':_['map'](_0x1da1cf['attributes'],function(_0x2eb93e){var _0x515ef1={};_0x515ef1[_0x2eb93e]={'$like':'%'+_0x4d9a5f['query']['filter']+'%'};return _0x515ef1;})});}_0x1da1cf=_[_0xc048('0x41')]({},_0x1da1cf,_0x4d9a5f[_0xc048('0x43')]);return _0x509710[_0xc048('0x52')](_0x1da1cf);}})['then'](function(_0x1a804c){if(_0x1a804c){_0x533e6e=_0x1a804c[_0xc048('0x39')];if(!_0x4d9a5f[_0xc048('0x33')][_0xc048('0x3a')](_0xc048('0x3b'))){_0x1da1cf[_0xc048('0x1f')]=qs[_0xc048('0x1f')](_0x4d9a5f[_0xc048('0x33')]['limit']);_0x1da1cf['offset']=qs[_0xc048('0x21')](_0x4d9a5f[_0xc048('0x33')][_0xc048('0x21')]);}return _0x509710[_0xc048('0x52')](_0x1da1cf);}})['then'](function(_0x3e2dfa){if(_0x3e2dfa){return _0x3e2dfa?{'count':_0x533e6e,'rows':_0x3e2dfa}:null;}})[_0xc048('0x27')](respondWithResult(_0x3303f4,null))[_0xc048('0x49')](handleError(_0x3303f4,null));};
\ No newline at end of file
index 30029ef..51d9b6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5f2=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xc5f2,0x1aa));var _0x2c5f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc5f2[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x2c5f('0x0'));var util=require('util');var logger=require(_0x2c5f('0x1'))(_0x2c5f('0x2'));var moment=require('moment');var BPromise=require(_0x2c5f('0x3'));var rp=require(_0x2c5f('0x4'));var fs=require('fs');var path=require(_0x2c5f('0x5'));var rimraf=require(_0x2c5f('0x6'));var config=require(_0x2c5f('0x7'));var attributes=require(_0x2c5f('0x8'));module[_0x2c5f('0x9')]=function(_0x4ef0a9,_0xd7ca7b){return _0x4ef0a9[_0x2c5f('0xa')](_0x2c5f('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9a3=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x3e94b1,_0x14218b){var _0x4b8663=function(_0x138ce0){while(--_0x138ce0){_0x3e94b1['push'](_0x3e94b1['shift']());}};_0x4b8663(++_0x14218b);}(_0xa9a3,0x13e));var _0x3a9a=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xa9a3[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x3a9a('0x0'));var util=require(_0x3a9a('0x1'));var logger=require(_0x3a9a('0x2'))('api');var moment=require(_0x3a9a('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a9a('0x4'));var fs=require('fs');var path=require(_0x3a9a('0x5'));var rimraf=require(_0x3a9a('0x6'));var config=require(_0x3a9a('0x7'));var attributes=require(_0x3a9a('0x8'));module[_0x3a9a('0x9')]=function(_0x59daf6,_0x4d3ad7){return _0x59daf6[_0x3a9a('0xa')](_0x3a9a('0xb'),attributes,{'tableName':_0x3a9a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d996bb6..c7ff07d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b92=['jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b92,0x93));var _0x29b9=function(_0x3455a1,_0x1c1eda){_0x3455a1=_0x3455a1-0x0;var _0x2b42f8=_0x9b92[_0x3455a1];return _0x2b42f8;};'use strict';var _=require('lodash');var util=require(_0x29b9('0x0'));var moment=require(_0x29b9('0x1'));var BPromise=require('bluebird');var rs=require(_0x29b9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29b9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x29b9('0x4'))(_0x29b9('0x5'));var config=require(_0x29b9('0x6'));var jayson=require(_0x29b9('0x7'));var client=jayson[_0x29b9('0x8')][_0x29b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2647d3,_0x5ed12a,_0xa33d5d){return new BPromise(function(_0x504244,_0x509e82){return client[_0x29b9('0xa')](_0x2647d3,_0xa33d5d)[_0x29b9('0xb')](function(_0x6527e){logger[_0x29b9('0xc')](_0x29b9('0xd'),_0x5ed12a,_0x29b9('0xe'));logger[_0x29b9('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x5ed12a,_0x29b9('0xe'),JSON[_0x29b9('0x10')](_0x6527e));if(_0x6527e[_0x29b9('0x11')]){if(_0x6527e[_0x29b9('0x11')][_0x29b9('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x5ed12a,_0x6527e[_0x29b9('0x11')][_0x29b9('0x13')]);return _0x509e82(_0x6527e[_0x29b9('0x11')][_0x29b9('0x13')]);}logger[_0x29b9('0x11')](_0x29b9('0xd'),_0x5ed12a,_0x6527e[_0x29b9('0x11')][_0x29b9('0x13')]);return _0x504244(_0x6527e[_0x29b9('0x11')][_0x29b9('0x13')]);}else{logger[_0x29b9('0xc')](_0x29b9('0xd'),_0x5ed12a,'request\x20sent');_0x504244(_0x6527e[_0x29b9('0x14')]['message']);}})[_0x29b9('0x15')](function(_0x3fade6){logger[_0x29b9('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5ed12a,_0x3fade6);_0x509e82(_0x3fade6);});});}
\ No newline at end of file
+var _0x18e6=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x18e6,0x17a));var _0x618e=function(_0x339cd3,_0x23be07){_0x339cd3=_0x339cd3-0x0;var _0x1d09ce=_0x18e6[_0x339cd3];return _0x1d09ce;};'use strict';var _=require(_0x618e('0x0'));var util=require(_0x618e('0x1'));var moment=require(_0x618e('0x2'));var BPromise=require(_0x618e('0x3'));var rs=require(_0x618e('0x4'));var fs=require('fs');var Redis=require(_0x618e('0x5'));var db=require(_0x618e('0x6'))['db'];var utils=require(_0x618e('0x7'));var logger=require('../../config/logger')(_0x618e('0x8'));var config=require(_0x618e('0x9'));var jayson=require(_0x618e('0xa'));var client=jayson[_0x618e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba484,_0x4d4e13,_0x29fa03){return new BPromise(function(_0x262bf7,_0x24543c){return client[_0x618e('0xc')](_0x4ba484,_0x29fa03)[_0x618e('0xd')](function(_0x29fa65){logger[_0x618e('0xe')](_0x618e('0xf'),_0x4d4e13,_0x618e('0x10'));logger['debug'](_0x618e('0x11'),_0x4d4e13,_0x618e('0x10'),JSON[_0x618e('0x12')](_0x29fa65));if(_0x29fa65['error']){if(_0x29fa65['error'][_0x618e('0x13')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d4e13,_0x29fa65[_0x618e('0x14')]['message']);return _0x24543c(_0x29fa65[_0x618e('0x14')][_0x618e('0x15')]);}logger[_0x618e('0x14')](_0x618e('0xf'),_0x4d4e13,_0x29fa65[_0x618e('0x14')]['message']);return _0x262bf7(_0x29fa65[_0x618e('0x14')][_0x618e('0x15')]);}else{logger[_0x618e('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d4e13,_0x618e('0x10'));_0x262bf7(_0x29fa65[_0x618e('0x16')][_0x618e('0x15')]);}})[_0x618e('0x17')](function(_0x186cb8){logger[_0x618e('0x14')](_0x618e('0xf'),_0x4d4e13,_0x186cb8);_0x24543c(_0x186cb8);});});}
\ No newline at end of file
index a7880b4..71de3b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb2c=['index','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0xcb2c,0x1ac));var _0xccb2=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xcb2c[_0x20c9b2];return _0x2c6030;};'use strict';var multer=require(_0xccb2('0x0'));var util=require(_0xccb2('0x1'));var path=require(_0xccb2('0x2'));var timeout=require(_0xccb2('0x3'));var express=require(_0xccb2('0x4'));var router=express[_0xccb2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xccb2('0x6'));var interaction=require(_0xccb2('0x7'));var config=require(_0xccb2('0x8'));var controller=require(_0xccb2('0x9'));router[_0xccb2('0xa')]('/',auth[_0xccb2('0xb')](),controller[_0xccb2('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xccb2('0xd')]);router[_0xccb2('0xe')]('/',auth[_0xccb2('0xb')](),controller[_0xccb2('0xf')]);router['put'](_0xccb2('0x10'),auth[_0xccb2('0xb')](),controller['update']);router[_0xccb2('0x11')]('/:id',auth[_0xccb2('0xb')](),controller[_0xccb2('0x12')]);module[_0xccb2('0x13')]=router;
\ No newline at end of file
+var _0x8f7d=['/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','./intSugarcrmField.controller','get','isAuthenticated','index'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x8f7d,0x19f));var _0xd8f7=function(_0x5a1d39,_0x5a9dbf){_0x5a1d39=_0x5a1d39-0x0;var _0x3a77f2=_0x8f7d[_0x5a1d39];return _0x3a77f2;};'use strict';var multer=require(_0xd8f7('0x0'));var util=require(_0xd8f7('0x1'));var path=require(_0xd8f7('0x2'));var timeout=require(_0xd8f7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd8f7('0x4'));var auth=require(_0xd8f7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8f7('0x6'));router[_0xd8f7('0x7')]('/',auth[_0xd8f7('0x8')](),controller[_0xd8f7('0x9')]);router[_0xd8f7('0x7')](_0xd8f7('0xa'),auth[_0xd8f7('0x8')](),controller[_0xd8f7('0xb')]);router['post']('/',auth[_0xd8f7('0x8')](),controller[_0xd8f7('0xc')]);router['put'](_0xd8f7('0xa'),auth[_0xd8f7('0x8')](),controller[_0xd8f7('0xd')]);router[_0xd8f7('0xe')]('/:id',auth[_0xd8f7('0x8')](),controller[_0xd8f7('0xf')]);module[_0xd8f7('0x10')]=router;
\ No newline at end of file
index b321959..d4c80ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b80=['picklist','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue'];(function(_0x912e23,_0x15f457){var _0x453f72=function(_0x46a210){while(--_0x46a210){_0x912e23['push'](_0x912e23['shift']());}};_0x453f72(++_0x15f457);}(_0x1b80,0x113));var _0x01b8=function(_0x1c6f9,_0x237831){_0x1c6f9=_0x1c6f9-0x0;var _0x4de438=_0x1b80[_0x1c6f9];return _0x4de438;};'use strict';var Sequelize=require('sequelize');module[_0x01b8('0x0')]={'type':{'type':Sequelize[_0x01b8('0x1')]('string',_0x01b8('0x2'),_0x01b8('0x3'),_0x01b8('0x4'),_0x01b8('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x01b8('0x6')]},'key':{'type':Sequelize[_0x01b8('0x6')]},'keyType':{'type':Sequelize[_0x01b8('0x1')]('string',_0x01b8('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x01b8('0x6')]},'idField':{'type':Sequelize[_0x01b8('0x6')]},'nameField':{'type':Sequelize[_0x01b8('0x6')]},'customField':{'type':Sequelize[_0x01b8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x01b8('0x6')]}};
\ No newline at end of file
+var _0x0124=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x0124,0x19a));var _0x4012=function(_0x4f8d4b,_0x1b739d){_0x4f8d4b=_0x4f8d4b-0x0;var _0x19c786=_0x0124[_0x4f8d4b];return _0x19c786;};'use strict';var Sequelize=require(_0x4012('0x0'));module[_0x4012('0x1')]={'type':{'type':Sequelize[_0x4012('0x2')](_0x4012('0x3'),_0x4012('0x4'),_0x4012('0x5'),_0x4012('0x6'),'picklist'),'defaultValue':_0x4012('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4012('0x2')](_0x4012('0x3'),_0x4012('0x4'),_0x4012('0x5'))},'keyContent':{'type':Sequelize[_0x4012('0x7')]},'idField':{'type':Sequelize[_0x4012('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4012('0x7')]}};
\ No newline at end of file
index 8f6ca2a..1dc7a6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8626=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty'];(function(_0x5995cd,_0x5a7247){var _0x2c16f9=function(_0x2d08c1){while(--_0x2d08c1){_0x5995cd['push'](_0x5995cd['shift']());}};_0x2c16f9(++_0x5a7247);}(_0x8626,0x104));var _0x6862=function(_0x2ca564,_0x750f0f){_0x2ca564=_0x2ca564-0x0;var _0x20cce5=_0x8626[_0x2ca564];return _0x20cce5;};'use strict';var emlformat=require(_0x6862('0x0'));var rimraf=require(_0x6862('0x1'));var zipdir=require(_0x6862('0x2'));var jsonpatch=require(_0x6862('0x3'));var rp=require(_0x6862('0x4'));var moment=require(_0x6862('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6862('0x6'));var util=require(_0x6862('0x7'));var path=require('path');var sox=require(_0x6862('0x8'));var csv=require('to-csv');var ejs=require(_0x6862('0x9'));var fs=require('fs');var fs_extra=require(_0x6862('0xa'));var _=require(_0x6862('0xb'));var squel=require(_0x6862('0xc'));var crypto=require(_0x6862('0xd'));var jsforce=require(_0x6862('0xe'));var deskjs=require(_0x6862('0xf'));var toCsv=require(_0x6862('0x10'));var querystring=require(_0x6862('0x11'));var Papa=require(_0x6862('0x12'));var Redis=require(_0x6862('0x13'));var authService=require(_0x6862('0x14'));var qs=require(_0x6862('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6862('0x16'));var logger=require(_0x6862('0x17'))(_0x6862('0x18'));var utils=require(_0x6862('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6862('0x1a'));var db=require(_0x6862('0x1b'))['db'];function respondWithStatusCode(_0x2223a5,_0x37cb82){_0x37cb82=_0x37cb82||0xcc;return function(_0x5b558f){if(_0x5b558f){return _0x2223a5['sendStatus'](_0x37cb82);}return _0x2223a5['status'](_0x37cb82)[_0x6862('0x1c')]();};}function respondWithResult(_0x19f081,_0x499d3d){_0x499d3d=_0x499d3d||0xc8;return function(_0x103d43){if(_0x103d43){return _0x19f081[_0x6862('0x1d')](_0x499d3d)[_0x6862('0x1e')](_0x103d43);}};}function respondWithFilteredResult(_0xac66e8,_0x3f1cfa){return function(_0x459964){if(_0x459964){var _0x433d35=typeof _0x3f1cfa['offset']===_0x6862('0x1f')&&typeof _0x3f1cfa[_0x6862('0x20')]===_0x6862('0x1f');var _0x17c061=_0x459964[_0x6862('0x21')];var _0x4cf953=_0x433d35?0x0:_0x3f1cfa[_0x6862('0x22')];var _0x2525ea=_0x433d35?_0x459964['count']:_0x3f1cfa[_0x6862('0x22')]+_0x3f1cfa[_0x6862('0x20')];var _0x2f5942;if(_0x2525ea>=_0x17c061){_0x2525ea=_0x17c061;_0x2f5942=0xc8;}else{_0x2f5942=0xce;}_0xac66e8['status'](_0x2f5942);return _0xac66e8['set'](_0x6862('0x23'),_0x4cf953+'-'+_0x2525ea+'/'+_0x17c061)[_0x6862('0x1e')](_0x459964);}return null;};}function patchUpdates(_0x34e2d9){return function(_0x2093a7){try{jsonpatch[_0x6862('0x24')](_0x2093a7,_0x34e2d9,!![]);}catch(_0x5ed0e9){return BPromise[_0x6862('0x25')](_0x5ed0e9);}return _0x2093a7[_0x6862('0x26')]();};}function saveUpdates(_0x2c1d64,_0x345454){return function(_0xb57d93){if(_0xb57d93){return _0xb57d93[_0x6862('0x27')](_0x2c1d64)[_0x6862('0x28')](function(_0x58502a){return _0x58502a;});}return null;};}function removeEntity(_0x476636,_0x149721){return function(_0x460883){if(_0x460883){return _0x460883[_0x6862('0x29')]()[_0x6862('0x28')](function(){_0x476636[_0x6862('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4ea5,_0x1207fc){return function(_0x1baa42){if(!_0x1baa42){_0x1a4ea5[_0x6862('0x2a')](0x194);}return _0x1baa42;};}function handleError(_0x5d0f5d,_0x1c0069){_0x1c0069=_0x1c0069||0x1f4;return function(_0x4ec86a){logger[_0x6862('0x2b')](_0x4ec86a[_0x6862('0x2c')]);if(_0x4ec86a[_0x6862('0x2d')]){delete _0x4ec86a[_0x6862('0x2d')];}_0x5d0f5d[_0x6862('0x1d')](_0x1c0069)[_0x6862('0x2e')](_0x4ec86a);};}exports['index']=function(_0x586859,_0x47d4f6){var _0xe0e266={},_0x232f9c={},_0x1ae15b={'count':0x0,'rows':[]};var _0x3feb94=_[_0x6862('0x2f')](db[_0x6862('0x30')][_0x6862('0x31')],function(_0x1af8f4){return{'name':_0x1af8f4[_0x6862('0x32')],'type':_0x1af8f4[_0x6862('0x33')]['key']};});_0x232f9c[_0x6862('0x34')]=_[_0x6862('0x2f')](_0x3feb94,_0x6862('0x2d'));_0x232f9c[_0x6862('0x35')]=_[_0x6862('0x36')](_0x586859['query']);_0x232f9c[_0x6862('0x37')]=_['intersection'](_0x232f9c[_0x6862('0x34')],_0x232f9c[_0x6862('0x35')]);_0xe0e266[_0x6862('0x38')]=_['intersection'](_0x232f9c[_0x6862('0x34')],qs[_0x6862('0x39')](_0x586859['query'][_0x6862('0x39')]));_0xe0e266['attributes']=_0xe0e266['attributes'][_0x6862('0x3a')]?_0xe0e266[_0x6862('0x38')]:_0x232f9c['model'];if(!_0x586859[_0x6862('0x35')][_0x6862('0x3b')](_0x6862('0x3c'))){_0xe0e266[_0x6862('0x20')]=qs['limit'](_0x586859['query'][_0x6862('0x20')]);_0xe0e266[_0x6862('0x22')]=qs['offset'](_0x586859['query'][_0x6862('0x22')]);}_0xe0e266[_0x6862('0x3d')]=qs['sort'](_0x586859[_0x6862('0x35')][_0x6862('0x3e')]);_0xe0e266[_0x6862('0x3f')]=qs[_0x6862('0x37')](_[_0x6862('0x40')](_0x586859['query'],_0x232f9c[_0x6862('0x37')]),_0x3feb94);if(_0x586859[_0x6862('0x35')][_0x6862('0x41')]){_0xe0e266[_0x6862('0x3f')]=_[_0x6862('0x42')](_0xe0e266['where'],{'$or':_[_0x6862('0x2f')](_0x3feb94,function(_0x42b673){if(_0x42b673[_0x6862('0x33')]!==_0x6862('0x43')){var _0x553aa1={};_0x553aa1[_0x42b673[_0x6862('0x2d')]]={'$like':'%'+_0x586859[_0x6862('0x35')]['filter']+'%'};return _0x553aa1;}})});}_0xe0e266=_[_0x6862('0x42')]({},_0xe0e266,_0x586859[_0x6862('0x44')]);var _0x13ec43={'where':_0xe0e266[_0x6862('0x3f')]};return db[_0x6862('0x30')][_0x6862('0x21')](_0x13ec43)['then'](function(_0x41380c){_0x1ae15b[_0x6862('0x21')]=_0x41380c;if(_0x586859[_0x6862('0x35')][_0x6862('0x45')]){_0xe0e266[_0x6862('0x46')]=[{'all':!![]}];}return db[_0x6862('0x30')][_0x6862('0x47')](_0xe0e266);})['then'](function(_0xc58c34){_0x1ae15b[_0x6862('0x48')]=_0xc58c34;return _0x1ae15b;})['then'](respondWithFilteredResult(_0x47d4f6,_0xe0e266))[_0x6862('0x49')](handleError(_0x47d4f6,null));};exports[_0x6862('0x4a')]=function(_0x16ece2,_0x6216d8){var _0x55319b={'raw':!![],'where':{'id':_0x16ece2['params']['id']}},_0x48f4fb={};_0x48f4fb[_0x6862('0x34')]=_[_0x6862('0x36')](db[_0x6862('0x30')]['rawAttributes']);_0x48f4fb[_0x6862('0x35')]=_[_0x6862('0x36')](_0x16ece2['query']);_0x48f4fb['filters']=_[_0x6862('0x4b')](_0x48f4fb[_0x6862('0x34')],_0x48f4fb[_0x6862('0x35')]);_0x55319b[_0x6862('0x38')]=_[_0x6862('0x4b')](_0x48f4fb[_0x6862('0x34')],qs['fields'](_0x16ece2['query']['fields']));_0x55319b[_0x6862('0x38')]=_0x55319b[_0x6862('0x38')][_0x6862('0x3a')]?_0x55319b[_0x6862('0x38')]:_0x48f4fb[_0x6862('0x34')];if(_0x16ece2[_0x6862('0x35')][_0x6862('0x45')]){_0x55319b[_0x6862('0x46')]=[{'all':!![]}];}_0x55319b=_[_0x6862('0x42')]({},_0x55319b,_0x16ece2['options']);return db[_0x6862('0x30')][_0x6862('0x4c')](_0x55319b)[_0x6862('0x28')](handleEntityNotFound(_0x6216d8,null))[_0x6862('0x28')](respondWithResult(_0x6216d8,null))['catch'](handleError(_0x6216d8,null));};exports[_0x6862('0x4d')]=function(_0x554950,_0x272fb0){return db[_0x6862('0x30')][_0x6862('0x4d')](_0x554950['body'],{})[_0x6862('0x28')](respondWithResult(_0x272fb0,0xc9))['catch'](handleError(_0x272fb0,null));};exports[_0x6862('0x27')]=function(_0x164507,_0x431af8){if(_0x164507[_0x6862('0x4e')]['id']){delete _0x164507[_0x6862('0x4e')]['id'];}return db[_0x6862('0x30')][_0x6862('0x4c')]({'where':{'id':_0x164507[_0x6862('0x4f')]['id']}})['then'](handleEntityNotFound(_0x431af8,null))[_0x6862('0x28')](saveUpdates(_0x164507['body'],null))[_0x6862('0x28')](respondWithResult(_0x431af8,null))[_0x6862('0x49')](handleError(_0x431af8,null));};exports[_0x6862('0x29')]=function(_0x23a918,_0x44e082){return db[_0x6862('0x30')][_0x6862('0x4c')]({'where':{'id':_0x23a918['params']['id']}})[_0x6862('0x28')](handleEntityNotFound(_0x44e082,null))[_0x6862('0x28')](removeEntity(_0x44e082,null))[_0x6862('0x49')](handleError(_0x44e082,null));};
\ No newline at end of file
+var _0x5011=['options','includeAll','include','findAll','rows','catch','show','params','find','SugarcrmField','create','body','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x47a935,_0x3aad48){var _0x2eb1d7=function(_0x38f80e){while(--_0x38f80e){_0x47a935['push'](_0x47a935['shift']());}};_0x2eb1d7(++_0x3aad48);}(_0x5011,0xf0));var _0x1501=function(_0x220d5b,_0x290a1f){_0x220d5b=_0x220d5b-0x0;var _0x54ce5f=_0x5011[_0x220d5b];return _0x54ce5f;};'use strict';var emlformat=require(_0x1501('0x0'));var rimraf=require(_0x1501('0x1'));var zipdir=require(_0x1501('0x2'));var jsonpatch=require(_0x1501('0x3'));var rp=require(_0x1501('0x4'));var moment=require(_0x1501('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1501('0x6'));var util=require(_0x1501('0x7'));var path=require(_0x1501('0x8'));var sox=require(_0x1501('0x9'));var csv=require(_0x1501('0xa'));var ejs=require(_0x1501('0xb'));var fs=require('fs');var fs_extra=require(_0x1501('0xc'));var _=require(_0x1501('0xd'));var squel=require(_0x1501('0xe'));var crypto=require(_0x1501('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x1501('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1501('0x11'));var Papa=require(_0x1501('0x12'));var Redis=require('ioredis');var authService=require(_0x1501('0x13'));var qs=require(_0x1501('0x14'));var as=require(_0x1501('0x15'));var hardwareService=require(_0x1501('0x16'));var logger=require(_0x1501('0x17'))('api');var utils=require(_0x1501('0x18'));var config=require(_0x1501('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1501('0x1a'))['db'];function respondWithStatusCode(_0x5074ac,_0x5274b9){_0x5274b9=_0x5274b9||0xcc;return function(_0x307d91){if(_0x307d91){return _0x5074ac['sendStatus'](_0x5274b9);}return _0x5074ac[_0x1501('0x1b')](_0x5274b9)[_0x1501('0x1c')]();};}function respondWithResult(_0x4e0ec6,_0x5e9c3f){_0x5e9c3f=_0x5e9c3f||0xc8;return function(_0x40c2e8){if(_0x40c2e8){return _0x4e0ec6['status'](_0x5e9c3f)[_0x1501('0x1d')](_0x40c2e8);}};}function respondWithFilteredResult(_0x1afe17,_0xe1dab0){return function(_0x4d837c){if(_0x4d837c){var _0x19646e=typeof _0xe1dab0[_0x1501('0x1e')]===_0x1501('0x1f')&&typeof _0xe1dab0[_0x1501('0x20')]===_0x1501('0x1f');var _0x5a931d=_0x4d837c[_0x1501('0x21')];var _0x10205f=_0x19646e?0x0:_0xe1dab0[_0x1501('0x1e')];var _0x17f633=_0x19646e?_0x4d837c[_0x1501('0x21')]:_0xe1dab0[_0x1501('0x1e')]+_0xe1dab0[_0x1501('0x20')];var _0x4bb983;if(_0x17f633>=_0x5a931d){_0x17f633=_0x5a931d;_0x4bb983=0xc8;}else{_0x4bb983=0xce;}_0x1afe17[_0x1501('0x1b')](_0x4bb983);return _0x1afe17[_0x1501('0x22')](_0x1501('0x23'),_0x10205f+'-'+_0x17f633+'/'+_0x5a931d)[_0x1501('0x1d')](_0x4d837c);}return null;};}function patchUpdates(_0x189ab6){return function(_0x1d3873){try{jsonpatch[_0x1501('0x24')](_0x1d3873,_0x189ab6,!![]);}catch(_0x352da1){return BPromise[_0x1501('0x25')](_0x352da1);}return _0x1d3873[_0x1501('0x26')]();};}function saveUpdates(_0x44bee2,_0xef465e){return function(_0x26a71c){if(_0x26a71c){return _0x26a71c[_0x1501('0x27')](_0x44bee2)[_0x1501('0x28')](function(_0x346a97){return _0x346a97;});}return null;};}function removeEntity(_0x3361e4,_0x20fe00){return function(_0x1b8435){if(_0x1b8435){return _0x1b8435[_0x1501('0x29')]()[_0x1501('0x28')](function(){_0x3361e4[_0x1501('0x1b')](0xcc)[_0x1501('0x1c')]();});}};}function handleEntityNotFound(_0x29cb74,_0xb512cf){return function(_0x14aa18){if(!_0x14aa18){_0x29cb74[_0x1501('0x2a')](0x194);}return _0x14aa18;};}function handleError(_0x3beb20,_0x25f79c){_0x25f79c=_0x25f79c||0x1f4;return function(_0x407125){logger[_0x1501('0x2b')](_0x407125[_0x1501('0x2c')]);if(_0x407125['name']){delete _0x407125[_0x1501('0x2d')];}_0x3beb20[_0x1501('0x1b')](_0x25f79c)[_0x1501('0x2e')](_0x407125);};}exports['index']=function(_0x115ea2,_0xfa7e0a){var _0x44afbc={},_0x3763c3={},_0x1156f5={'count':0x0,'rows':[]};var _0x39a729=_[_0x1501('0x2f')](db['SugarcrmField']['rawAttributes'],function(_0x57fc0f){return{'name':_0x57fc0f[_0x1501('0x30')],'type':_0x57fc0f[_0x1501('0x31')]['key']};});_0x3763c3[_0x1501('0x32')]=_['map'](_0x39a729,_0x1501('0x2d'));_0x3763c3[_0x1501('0x33')]=_['keys'](_0x115ea2[_0x1501('0x33')]);_0x3763c3[_0x1501('0x34')]=_[_0x1501('0x35')](_0x3763c3[_0x1501('0x32')],_0x3763c3[_0x1501('0x33')]);_0x44afbc[_0x1501('0x36')]=_[_0x1501('0x35')](_0x3763c3[_0x1501('0x32')],qs[_0x1501('0x37')](_0x115ea2[_0x1501('0x33')][_0x1501('0x37')]));_0x44afbc['attributes']=_0x44afbc[_0x1501('0x36')]['length']?_0x44afbc[_0x1501('0x36')]:_0x3763c3[_0x1501('0x32')];if(!_0x115ea2['query'][_0x1501('0x38')](_0x1501('0x39'))){_0x44afbc[_0x1501('0x20')]=qs[_0x1501('0x20')](_0x115ea2[_0x1501('0x33')]['limit']);_0x44afbc['offset']=qs[_0x1501('0x1e')](_0x115ea2['query'][_0x1501('0x1e')]);}_0x44afbc['order']=qs['sort'](_0x115ea2[_0x1501('0x33')][_0x1501('0x3a')]);_0x44afbc[_0x1501('0x3b')]=qs['filters'](_[_0x1501('0x3c')](_0x115ea2[_0x1501('0x33')],_0x3763c3['filters']),_0x39a729);if(_0x115ea2[_0x1501('0x33')][_0x1501('0x3d')]){_0x44afbc[_0x1501('0x3b')]=_[_0x1501('0x3e')](_0x44afbc[_0x1501('0x3b')],{'$or':_[_0x1501('0x2f')](_0x39a729,function(_0x38a3cb){if(_0x38a3cb[_0x1501('0x31')]!==_0x1501('0x3f')){var _0x383c63={};_0x383c63[_0x38a3cb[_0x1501('0x2d')]]={'$like':'%'+_0x115ea2[_0x1501('0x33')][_0x1501('0x3d')]+'%'};return _0x383c63;}})});}_0x44afbc=_[_0x1501('0x3e')]({},_0x44afbc,_0x115ea2[_0x1501('0x40')]);var _0x286d28={'where':_0x44afbc['where']};return db['SugarcrmField'][_0x1501('0x21')](_0x286d28)[_0x1501('0x28')](function(_0x1fdd37){_0x1156f5[_0x1501('0x21')]=_0x1fdd37;if(_0x115ea2[_0x1501('0x33')][_0x1501('0x41')]){_0x44afbc[_0x1501('0x42')]=[{'all':!![]}];}return db['SugarcrmField'][_0x1501('0x43')](_0x44afbc);})[_0x1501('0x28')](function(_0x26d9ae){_0x1156f5[_0x1501('0x44')]=_0x26d9ae;return _0x1156f5;})['then'](respondWithFilteredResult(_0xfa7e0a,_0x44afbc))[_0x1501('0x45')](handleError(_0xfa7e0a,null));};exports[_0x1501('0x46')]=function(_0x4c65f9,_0x520358){var _0x4d99c={'raw':!![],'where':{'id':_0x4c65f9[_0x1501('0x47')]['id']}},_0x4c4492={};_0x4c4492[_0x1501('0x32')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x4c4492['query']=_['keys'](_0x4c65f9['query']);_0x4c4492[_0x1501('0x34')]=_[_0x1501('0x35')](_0x4c4492['model'],_0x4c4492[_0x1501('0x33')]);_0x4d99c[_0x1501('0x36')]=_[_0x1501('0x35')](_0x4c4492['model'],qs['fields'](_0x4c65f9[_0x1501('0x33')][_0x1501('0x37')]));_0x4d99c[_0x1501('0x36')]=_0x4d99c[_0x1501('0x36')]['length']?_0x4d99c[_0x1501('0x36')]:_0x4c4492[_0x1501('0x32')];if(_0x4c65f9[_0x1501('0x33')][_0x1501('0x41')]){_0x4d99c[_0x1501('0x42')]=[{'all':!![]}];}_0x4d99c=_['merge']({},_0x4d99c,_0x4c65f9[_0x1501('0x40')]);return db['SugarcrmField'][_0x1501('0x48')](_0x4d99c)[_0x1501('0x28')](handleEntityNotFound(_0x520358,null))[_0x1501('0x28')](respondWithResult(_0x520358,null))[_0x1501('0x45')](handleError(_0x520358,null));};exports['create']=function(_0x507cdb,_0x8bd1d6){return db[_0x1501('0x49')][_0x1501('0x4a')](_0x507cdb[_0x1501('0x4b')],{})['then'](respondWithResult(_0x8bd1d6,0xc9))[_0x1501('0x45')](handleError(_0x8bd1d6,null));};exports[_0x1501('0x27')]=function(_0x27e138,_0x3e7fae){if(_0x27e138[_0x1501('0x4b')]['id']){delete _0x27e138[_0x1501('0x4b')]['id'];}return db[_0x1501('0x49')]['find']({'where':{'id':_0x27e138[_0x1501('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e7fae,null))['then'](saveUpdates(_0x27e138[_0x1501('0x4b')],null))[_0x1501('0x28')](respondWithResult(_0x3e7fae,null))[_0x1501('0x45')](handleError(_0x3e7fae,null));};exports['destroy']=function(_0x224cae,_0xdca80b){return db['SugarcrmField'][_0x1501('0x48')]({'where':{'id':_0x224cae[_0x1501('0x47')]['id']}})[_0x1501('0x28')](handleEntityNotFound(_0xdca80b,null))[_0x1501('0x28')](removeEntity(_0xdca80b,null))[_0x1501('0x45')](handleError(_0xdca80b,null));};
\ No newline at end of file
index ed0ad79..f64ffca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78b4=['int_sugarcrm_fields','sugarcrm_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField'];(function(_0x72e72d,_0x2ecc89){var _0x5bb87c=function(_0x43c437){while(--_0x43c437){_0x72e72d['push'](_0x72e72d['shift']());}};_0x5bb87c(++_0x2ecc89);}(_0x78b4,0x1df));var _0x478b=function(_0x49e211,_0x523dd0){_0x49e211=_0x49e211-0x0;var _0x5269a5=_0x78b4[_0x49e211];return _0x5269a5;};'use strict';var _=require('lodash');var util=require(_0x478b('0x0'));var logger=require(_0x478b('0x1'))(_0x478b('0x2'));var moment=require(_0x478b('0x3'));var BPromise=require(_0x478b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x478b('0x5'));var rimraf=require(_0x478b('0x6'));var config=require(_0x478b('0x7'));var attributes=require(_0x478b('0x8'));module[_0x478b('0x9')]=function(_0x122d44,_0x5f5d5a){return _0x122d44['define'](_0x478b('0xa'),attributes,{'tableName':_0x478b('0xb'),'paranoid':![],'indexes':[{'name':_0x478b('0xc'),'fields':['idField',_0x478b('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c7c=['FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','idField'];(function(_0x5e2c2c,_0x32d4b7){var _0x2c90ed=function(_0x387042){while(--_0x387042){_0x5e2c2c['push'](_0x5e2c2c['shift']());}};_0x2c90ed(++_0x32d4b7);}(_0x8c7c,0x151));var _0xc8c7=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0x8c7c[_0x287059];return _0x225c79;};'use strict';var _=require(_0xc8c7('0x0'));var util=require('util');var logger=require(_0xc8c7('0x1'))(_0xc8c7('0x2'));var moment=require(_0xc8c7('0x3'));var BPromise=require(_0xc8c7('0x4'));var rp=require(_0xc8c7('0x5'));var fs=require('fs');var path=require(_0xc8c7('0x6'));var rimraf=require('rimraf');var config=require(_0xc8c7('0x7'));var attributes=require(_0xc8c7('0x8'));module[_0xc8c7('0x9')]=function(_0x52c97f,_0x417a50){return _0x52c97f['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xc8c7('0xa'),_0xc8c7('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index aa9cd9c..db9327c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa874=['../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0xa874,0x1c6));var _0x4a87=function(_0x4543c2,_0x52d8b7){_0x4543c2=_0x4543c2-0x0;var _0x4a3c2e=_0xa874[_0x4543c2];return _0x4a3c2e;};'use strict';var _=require(_0x4a87('0x0'));var util=require(_0x4a87('0x1'));var moment=require(_0x4a87('0x2'));var BPromise=require(_0x4a87('0x3'));var rs=require(_0x4a87('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a87('0x5'))['db'];var utils=require(_0x4a87('0x6'));var logger=require(_0x4a87('0x7'))('rpc');var config=require(_0x4a87('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4a87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x257d6e,_0x2a7a5e,_0x21ef70){return new BPromise(function(_0x41abd,_0x3f598f){return client[_0x4a87('0xa')](_0x257d6e,_0x21ef70)['then'](function(_0x1d35d3){logger[_0x4a87('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x2a7a5e,_0x4a87('0xc'));logger[_0x4a87('0xd')](_0x4a87('0xe'),_0x2a7a5e,_0x4a87('0xc'),JSON[_0x4a87('0xf')](_0x1d35d3));if(_0x1d35d3['error']){if(_0x1d35d3[_0x4a87('0x10')]['code']===0x1f4){logger['error'](_0x4a87('0x11'),_0x2a7a5e,_0x1d35d3[_0x4a87('0x10')]['message']);return _0x3f598f(_0x1d35d3['error'][_0x4a87('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2a7a5e,_0x1d35d3['error'][_0x4a87('0x12')]);return _0x41abd(_0x1d35d3[_0x4a87('0x10')][_0x4a87('0x12')]);}else{logger[_0x4a87('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x2a7a5e,_0x4a87('0xc'));_0x41abd(_0x1d35d3[_0x4a87('0x13')][_0x4a87('0x12')]);}})['catch'](function(_0x5a493f){logger['error'](_0x4a87('0x11'),_0x2a7a5e,_0x5a493f);_0x3f598f(_0x5a493f);});});}
\ No newline at end of file
+var _0xdf0f=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xdf0f,0x120));var _0xfdf0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdf0f[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xfdf0('0x0'));var moment=require(_0xfdf0('0x1'));var BPromise=require(_0xfdf0('0x2'));var rs=require(_0xfdf0('0x3'));var fs=require('fs');var Redis=require(_0xfdf0('0x4'));var db=require(_0xfdf0('0x5'))['db'];var utils=require(_0xfdf0('0x6'));var logger=require('../../config/logger')(_0xfdf0('0x7'));var config=require('../../config/environment');var jayson=require(_0xfdf0('0x8'));var client=jayson[_0xfdf0('0x9')][_0xfdf0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x114978,_0x1dc879,_0xb18a56){return new BPromise(function(_0x3b92aa,_0x147ab1){return client[_0xfdf0('0xb')](_0x114978,_0xb18a56)[_0xfdf0('0xc')](function(_0x1a042a){logger[_0xfdf0('0xd')](_0xfdf0('0xe'),_0x1dc879,_0xfdf0('0xf'));logger['debug'](_0xfdf0('0x10'),_0x1dc879,_0xfdf0('0xf'),JSON[_0xfdf0('0x11')](_0x1a042a));if(_0x1a042a[_0xfdf0('0x12')]){if(_0x1a042a[_0xfdf0('0x12')][_0xfdf0('0x13')]===0x1f4){logger[_0xfdf0('0x12')](_0xfdf0('0xe'),_0x1dc879,_0x1a042a[_0xfdf0('0x12')][_0xfdf0('0x14')]);return _0x147ab1(_0x1a042a[_0xfdf0('0x12')][_0xfdf0('0x14')]);}logger[_0xfdf0('0x12')](_0xfdf0('0xe'),_0x1dc879,_0x1a042a['error'][_0xfdf0('0x14')]);return _0x3b92aa(_0x1a042a[_0xfdf0('0x12')][_0xfdf0('0x14')]);}else{logger[_0xfdf0('0xd')](_0xfdf0('0xe'),_0x1dc879,_0xfdf0('0xf'));_0x3b92aa(_0x1a042a[_0xfdf0('0x15')][_0xfdf0('0x14')]);}})[_0xfdf0('0x16')](function(_0x17a929){logger['error'](_0xfdf0('0xe'),_0x1dc879,_0x17a929);_0x147ab1(_0x17a929);});});}
\ No newline at end of file
index 1e3951a..0c4b710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e94=['../../components/auth/service','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x37c2c9,_0x7023c7){var _0x36e297=function(_0x5d8cfa){while(--_0x5d8cfa){_0x37c2c9['push'](_0x37c2c9['shift']());}};_0x36e297(++_0x7023c7);}(_0x8e94,0xf8));var _0x48e9=function(_0x5224ba,_0x3fb4e1){_0x5224ba=_0x5224ba-0x0;var _0x459bd2=_0x8e94[_0x5224ba];return _0x459bd2;};'use strict';var multer=require(_0x48e9('0x0'));var util=require(_0x48e9('0x1'));var path=require('path');var timeout=require(_0x48e9('0x2'));var express=require('express');var router=express[_0x48e9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x48e9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x48e9('0x5')]('/',auth[_0x48e9('0x6')](),controller['index']);router[_0x48e9('0x5')]('/:id',auth[_0x48e9('0x6')](),controller['show']);router[_0x48e9('0x5')](_0x48e9('0x7'),auth[_0x48e9('0x6')](),controller[_0x48e9('0x8')]);router['get'](_0x48e9('0x9'),auth[_0x48e9('0x6')](),controller['getFields']);router[_0x48e9('0xa')]('/',auth['isAuthenticated'](),controller[_0x48e9('0xb')]);router[_0x48e9('0xa')](_0x48e9('0x7'),auth[_0x48e9('0x6')](),controller[_0x48e9('0xc')]);router[_0x48e9('0xd')]('/:id',auth[_0x48e9('0x6')](),controller[_0x48e9('0xe')]);router[_0x48e9('0xf')]('/:id',auth[_0x48e9('0x6')](),controller[_0x48e9('0x10')]);module[_0x48e9('0x11')]=router;
\ No newline at end of file
+var _0x7884=['../../config/environment','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f95d8,_0x5e0e23){var _0x443e52=function(_0x5c1f1d){while(--_0x5c1f1d){_0x2f95d8['push'](_0x2f95d8['shift']());}};_0x443e52(++_0x5e0e23);}(_0x7884,0x10d));var _0x4788=function(_0x3fca21,_0x229278){_0x3fca21=_0x3fca21-0x0;var _0x229356=_0x7884[_0x3fca21];return _0x229356;};'use strict';var multer=require(_0x4788('0x0'));var util=require(_0x4788('0x1'));var path=require(_0x4788('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4788('0x3')]();var fs_extra=require(_0x4788('0x4'));var auth=require(_0x4788('0x5'));var interaction=require(_0x4788('0x6'));var config=require(_0x4788('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x4788('0x8')]('/',auth[_0x4788('0x9')](),controller[_0x4788('0xa')]);router[_0x4788('0x8')]('/:id',auth[_0x4788('0x9')](),controller['show']);router[_0x4788('0x8')](_0x4788('0xb'),auth['isAuthenticated'](),controller[_0x4788('0xc')]);router['get'](_0x4788('0xd'),auth['isAuthenticated'](),controller[_0x4788('0xe')]);router[_0x4788('0xf')]('/',auth['isAuthenticated'](),controller[_0x4788('0x10')]);router[_0x4788('0xf')](_0x4788('0xb'),auth[_0x4788('0x9')](),controller[_0x4788('0x11')]);router[_0x4788('0x12')](_0x4788('0x13'),auth[_0x4788('0x9')](),controller[_0x4788('0x14')]);router[_0x4788('0x15')](_0x4788('0x13'),auth[_0x4788('0x9')](),controller[_0x4788('0x16')]);module['exports']=router;
\ No newline at end of file
index e19b522..bddf976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e51=['exports','STRING','HelpDesk'];(function(_0x51a0a9,_0x569499){var _0x4bd20c=function(_0x26235a){while(--_0x26235a){_0x51a0a9['push'](_0x51a0a9['shift']());}};_0x4bd20c(++_0x569499);}(_0x8e51,0x177));var _0x18e5=function(_0x275332,_0x1bb62a){_0x275332=_0x275332-0x0;var _0x3bdbb7=_0x8e51[_0x275332];return _0x3bdbb7;};'use strict';var Sequelize=require('sequelize');module[_0x18e5('0x0')]={'name':{'type':Sequelize[_0x18e5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x18e5('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x18e5('0x1')],'allowNull':![],'defaultValue':_0x18e5('0x2')},'remoteUri':{'type':Sequelize[_0x18e5('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x18e5('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x18e5('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xede0=['sequelize','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xede0,0x86));var _0x0ede=function(_0x1cef54,_0xad4e01){_0x1cef54=_0x1cef54-0x0;var _0x59f1c9=_0xede0[_0x1cef54];return _0x59f1c9;};'use strict';var Sequelize=require(_0x0ede('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]}};
\ No newline at end of file
index a9579c5..8145209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3002=['lastIndexOf','format','getchallenge','POST','login','result','token','success','GET','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','update','then','end','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','include','VtigerAccount','findAll','rows','catch','show','params','includeAll','options','find','create','body','destroy','getConfigurations','VtigerConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri'];(function(_0x518e62,_0x116e1e){var _0x123481=function(_0xdae562){while(--_0xdae562){_0x518e62['push'](_0x518e62['shift']());}};_0x123481(++_0x116e1e);}(_0x3002,0x99));var _0x2300=function(_0x4e7590,_0x5b801a){_0x4e7590=_0x4e7590-0x0;var _0x32a0ad=_0x3002[_0x4e7590];return _0x32a0ad;};'use strict';var emlformat=require(_0x2300('0x0'));var rimraf=require(_0x2300('0x1'));var zipdir=require(_0x2300('0x2'));var jsonpatch=require(_0x2300('0x3'));var rp=require(_0x2300('0x4'));var moment=require(_0x2300('0x5'));var BPromise=require(_0x2300('0x6'));var Mustache=require(_0x2300('0x7'));var util=require(_0x2300('0x8'));var path=require(_0x2300('0x9'));var sox=require(_0x2300('0xa'));var csv=require('to-csv');var ejs=require(_0x2300('0xb'));var fs=require('fs');var fs_extra=require(_0x2300('0xc'));var _=require('lodash');var squel=require(_0x2300('0xd'));var crypto=require(_0x2300('0xe'));var jsforce=require(_0x2300('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2300('0x10'));var Redis=require(_0x2300('0x11'));var authService=require(_0x2300('0x12'));var qs=require(_0x2300('0x13'));var as=require(_0x2300('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2300('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2300('0x16'));var db=require(_0x2300('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x391c9c,_0x2ada49){_0x2ada49=_0x2ada49||0xcc;return function(_0x162653){if(_0x162653){return _0x391c9c[_0x2300('0x18')](_0x2ada49);}return _0x391c9c[_0x2300('0x19')](_0x2ada49)['end']();};}function respondWithResult(_0x55a87a,_0x1fe47c){_0x1fe47c=_0x1fe47c||0xc8;return function(_0x22db86){if(_0x22db86){return _0x55a87a[_0x2300('0x19')](_0x1fe47c)[_0x2300('0x1a')](_0x22db86);}};}function respondWithFilteredResult(_0x2cbf01,_0x155ef2){return function(_0x148192){if(_0x148192){var _0x41d2aa=typeof _0x155ef2['offset']===_0x2300('0x1b')&&typeof _0x155ef2[_0x2300('0x1c')]===_0x2300('0x1b');var _0x6423c0=_0x148192[_0x2300('0x1d')];var _0x29f674=_0x41d2aa?0x0:_0x155ef2[_0x2300('0x1e')];var _0x4e27cd=_0x41d2aa?_0x148192[_0x2300('0x1d')]:_0x155ef2[_0x2300('0x1e')]+_0x155ef2[_0x2300('0x1c')];var _0x152cd7;if(_0x4e27cd>=_0x6423c0){_0x4e27cd=_0x6423c0;_0x152cd7=0xc8;}else{_0x152cd7=0xce;}_0x2cbf01[_0x2300('0x19')](_0x152cd7);return _0x2cbf01['set']('Content-Range',_0x29f674+'-'+_0x4e27cd+'/'+_0x6423c0)['json'](_0x148192);}return null;};}function patchUpdates(_0x2ff730){return function(_0x4fc1d9){try{jsonpatch[_0x2300('0x1f')](_0x4fc1d9,_0x2ff730,!![]);}catch(_0x978179){return BPromise[_0x2300('0x20')](_0x978179);}return _0x4fc1d9['save']();};}function saveUpdates(_0x5d9877,_0x38ca81){return function(_0x56f14a){if(_0x56f14a){return _0x56f14a[_0x2300('0x21')](_0x5d9877)[_0x2300('0x22')](function(_0x21146d){return _0x21146d;});}return null;};}function removeEntity(_0x245147,_0x49f1ca){return function(_0x4a1500){if(_0x4a1500){return _0x4a1500['destroy']()['then'](function(){_0x245147[_0x2300('0x19')](0xcc)[_0x2300('0x23')]();});}};}function handleEntityNotFound(_0x21559a,_0x279904){return function(_0x170755){if(!_0x170755){_0x21559a[_0x2300('0x18')](0x194);}return _0x170755;};}function handleError(_0x36cdc6,_0x3a1370){_0x3a1370=_0x3a1370||0x1f4;return function(_0x4c37d5){logger[_0x2300('0x24')](_0x4c37d5[_0x2300('0x25')]);if(_0x4c37d5[_0x2300('0x26')]){delete _0x4c37d5[_0x2300('0x26')];}_0x36cdc6[_0x2300('0x19')](_0x3a1370)['send'](_0x4c37d5);};}exports[_0x2300('0x27')]=function(_0x1f6b56,_0x47d787){var _0x33e808={},_0xd494d6={},_0x4d5e13={'count':0x0,'rows':[]};var _0x902800=_[_0x2300('0x28')](db['VtigerAccount'][_0x2300('0x29')],function(_0x56e18d){return{'name':_0x56e18d[_0x2300('0x2a')],'type':_0x56e18d['type'][_0x2300('0x2b')]};});_0xd494d6[_0x2300('0x2c')]=_['map'](_0x902800,_0x2300('0x26'));_0xd494d6[_0x2300('0x2d')]=_[_0x2300('0x2e')](_0x1f6b56['query']);_0xd494d6['filters']=_[_0x2300('0x2f')](_0xd494d6[_0x2300('0x2c')],_0xd494d6[_0x2300('0x2d')]);_0x33e808[_0x2300('0x30')]=_[_0x2300('0x2f')](_0xd494d6[_0x2300('0x2c')],qs['fields'](_0x1f6b56[_0x2300('0x2d')][_0x2300('0x31')]));_0x33e808[_0x2300('0x30')]=_0x33e808[_0x2300('0x30')][_0x2300('0x32')]?_0x33e808[_0x2300('0x30')]:_0xd494d6[_0x2300('0x2c')];if(!_0x1f6b56['query']['hasOwnProperty'](_0x2300('0x33'))){_0x33e808[_0x2300('0x1c')]=qs[_0x2300('0x1c')](_0x1f6b56['query']['limit']);_0x33e808[_0x2300('0x1e')]=qs[_0x2300('0x1e')](_0x1f6b56['query'][_0x2300('0x1e')]);}_0x33e808[_0x2300('0x34')]=qs[_0x2300('0x35')](_0x1f6b56['query']['sort']);_0x33e808[_0x2300('0x36')]=qs[_0x2300('0x37')](_[_0x2300('0x38')](_0x1f6b56[_0x2300('0x2d')],_0xd494d6[_0x2300('0x37')]),_0x902800);if(_0x1f6b56[_0x2300('0x2d')][_0x2300('0x39')]){_0x33e808['where']=_['merge'](_0x33e808['where'],{'$or':_['map'](_0x902800,function(_0x22e85d){if(_0x22e85d[_0x2300('0x3a')]!==_0x2300('0x3b')){var _0x48c877={};_0x48c877[_0x22e85d['name']]={'$like':'%'+_0x1f6b56[_0x2300('0x2d')][_0x2300('0x39')]+'%'};return _0x48c877;}})});}_0x33e808=_[_0x2300('0x3c')]({},_0x33e808,_0x1f6b56['options']);var _0x48e81d={'where':_0x33e808['where']};return db['VtigerAccount']['count'](_0x48e81d)[_0x2300('0x22')](function(_0x286bef){_0x4d5e13[_0x2300('0x1d')]=_0x286bef;if(_0x1f6b56[_0x2300('0x2d')]['includeAll']){_0x33e808[_0x2300('0x3d')]=[{'all':!![]}];}return db[_0x2300('0x3e')][_0x2300('0x3f')](_0x33e808);})['then'](function(_0x3fe6cf){_0x4d5e13[_0x2300('0x40')]=_0x3fe6cf;return _0x4d5e13;})[_0x2300('0x22')](respondWithFilteredResult(_0x47d787,_0x33e808))[_0x2300('0x41')](handleError(_0x47d787,null));};exports[_0x2300('0x42')]=function(_0x231abe,_0x403ad5){var _0x47868e={'raw':![],'where':{'id':_0x231abe[_0x2300('0x43')]['id']}},_0x5a59b9={};_0x5a59b9[_0x2300('0x2c')]=_['keys'](db[_0x2300('0x3e')][_0x2300('0x29')]);_0x5a59b9['query']=_['keys'](_0x231abe[_0x2300('0x2d')]);_0x5a59b9[_0x2300('0x37')]=_['intersection'](_0x5a59b9[_0x2300('0x2c')],_0x5a59b9[_0x2300('0x2d')]);_0x47868e[_0x2300('0x30')]=_['intersection'](_0x5a59b9[_0x2300('0x2c')],qs[_0x2300('0x31')](_0x231abe[_0x2300('0x2d')][_0x2300('0x31')]));_0x47868e[_0x2300('0x30')]=_0x47868e[_0x2300('0x30')][_0x2300('0x32')]?_0x47868e[_0x2300('0x30')]:_0x5a59b9[_0x2300('0x2c')];if(_0x231abe[_0x2300('0x2d')][_0x2300('0x44')]){_0x47868e[_0x2300('0x3d')]=[{'all':!![]}];}_0x47868e=_[_0x2300('0x3c')]({},_0x47868e,_0x231abe[_0x2300('0x45')]);return db[_0x2300('0x3e')][_0x2300('0x46')](_0x47868e)[_0x2300('0x22')](handleEntityNotFound(_0x403ad5,null))[_0x2300('0x22')](respondWithResult(_0x403ad5,null))[_0x2300('0x41')](handleError(_0x403ad5,null));};exports[_0x2300('0x47')]=function(_0x221edc,_0x4ffabe){return db[_0x2300('0x3e')][_0x2300('0x47')](_0x221edc['body'],{})[_0x2300('0x22')](respondWithResult(_0x4ffabe,0xc9))[_0x2300('0x41')](handleError(_0x4ffabe,null));};exports[_0x2300('0x21')]=function(_0x337a04,_0x4f45f8){if(_0x337a04[_0x2300('0x48')]['id']){delete _0x337a04['body']['id'];}return db[_0x2300('0x3e')][_0x2300('0x46')]({'where':{'id':_0x337a04['params']['id']}})[_0x2300('0x22')](handleEntityNotFound(_0x4f45f8,null))[_0x2300('0x22')](saveUpdates(_0x337a04[_0x2300('0x48')],null))[_0x2300('0x22')](respondWithResult(_0x4f45f8,null))[_0x2300('0x41')](handleError(_0x4f45f8,null));};exports[_0x2300('0x49')]=function(_0x5a58af,_0x4443e4){return db[_0x2300('0x3e')][_0x2300('0x46')]({'where':{'id':_0x5a58af[_0x2300('0x43')]['id']}})[_0x2300('0x22')](handleEntityNotFound(_0x4443e4,null))['then'](removeEntity(_0x4443e4,null))[_0x2300('0x41')](handleError(_0x4443e4,null));};exports[_0x2300('0x4a')]=function(_0x1b994a,_0x54a340,_0x53c964){var _0x5904c4={};var _0x526f1d={};var _0xf8e16;var _0x2dfc33;return db['VtigerAccount']['findOne']({'where':{'id':_0x1b994a[_0x2300('0x43')]['id']}})[_0x2300('0x22')](handleEntityNotFound(_0x54a340,null))[_0x2300('0x22')](function(_0x315759){if(_0x315759){_0xf8e16=_0x315759;_0x526f1d[_0x2300('0x2c')]=_[_0x2300('0x2e')](db[_0x2300('0x4b')][_0x2300('0x29')]);_0x526f1d[_0x2300('0x2d')]=_['keys'](_0x1b994a['query']);_0x526f1d[_0x2300('0x37')]=_[_0x2300('0x2f')](_0x526f1d[_0x2300('0x2c')],_0x526f1d[_0x2300('0x2d')]);_0x5904c4[_0x2300('0x30')]=_[_0x2300('0x2f')](_0x526f1d['model'],qs[_0x2300('0x31')](_0x1b994a[_0x2300('0x2d')]['fields']));_0x5904c4[_0x2300('0x30')]=_0x5904c4['attributes'][_0x2300('0x32')]?_0x5904c4[_0x2300('0x30')]:_0x526f1d['model'];_0x5904c4[_0x2300('0x34')]=qs['sort'](_0x1b994a[_0x2300('0x2d')][_0x2300('0x35')]);_0x5904c4[_0x2300('0x36')]=qs[_0x2300('0x37')](_['pick'](_0x1b994a[_0x2300('0x2d')],_0x526f1d[_0x2300('0x37')]));if(_0x1b994a[_0x2300('0x2d')][_0x2300('0x39')]){_0x5904c4[_0x2300('0x36')]=_[_0x2300('0x3c')](_0x5904c4[_0x2300('0x36')],{'$or':_[_0x2300('0x28')](_0x5904c4[_0x2300('0x30')],function(_0x28f2e6){var _0x419a1e={};_0x419a1e[_0x28f2e6]={'$like':'%'+_0x1b994a['query'][_0x2300('0x39')]+'%'};return _0x419a1e;})});}_0x5904c4=_['merge']({},_0x5904c4,_0x1b994a[_0x2300('0x45')]);return _0xf8e16[_0x2300('0x4a')](_0x5904c4);}})[_0x2300('0x22')](function(_0x92b6b){if(_0x92b6b){_0x2dfc33=_0x92b6b[_0x2300('0x32')];if(!_0x1b994a[_0x2300('0x2d')][_0x2300('0x4c')](_0x2300('0x33'))){_0x5904c4[_0x2300('0x1c')]=qs[_0x2300('0x1c')](_0x1b994a['query']['limit']);_0x5904c4[_0x2300('0x1e')]=qs[_0x2300('0x1e')](_0x1b994a[_0x2300('0x2d')]['offset']);}return _0xf8e16[_0x2300('0x4a')](_0x5904c4);}})[_0x2300('0x22')](function(_0x5d6813){if(_0x5d6813){return _0x5d6813?{'count':_0x2dfc33,'rows':_0x5d6813}:null;}})['then'](respondWithResult(_0x54a340,null))[_0x2300('0x41')](handleError(_0x54a340,null));};exports[_0x2300('0x4d')]=function(_0x1f9c2f,_0x3e918e,_0x1fa0a8){if(_0x1f9c2f[_0x2300('0x48')]['id']){delete _0x1f9c2f['body']['id'];}return db[_0x2300('0x3e')][_0x2300('0x4e')]({'where':{'id':_0x1f9c2f[_0x2300('0x43')]['id']}})[_0x2300('0x22')](handleEntityNotFound(_0x3e918e,null))[_0x2300('0x22')](function(_0x1d44f5){if(_0x1d44f5){_0x1f9c2f[_0x2300('0x48')][_0x2300('0x4f')]=_0x1d44f5['id'];_0x1f9c2f[_0x2300('0x48')][_0x2300('0x50')]=integrations[_0x2300('0x51')](_0x1f9c2f[_0x2300('0x48')][_0x2300('0x52')],_0x1f9c2f['body']['type']);_0x1f9c2f['body'][_0x2300('0x53')]=integrations['getDescriptions'](_0x1f9c2f['body'][_0x2300('0x52')],_0x1f9c2f[_0x2300('0x48')][_0x2300('0x3a')]);return db[_0x2300('0x4b')][_0x2300('0x47')](_0x1f9c2f[_0x2300('0x48')],{'include':[{'model':db[_0x2300('0x54')],'as':_0x2300('0x50')},{'model':db[_0x2300('0x54')],'as':'Descriptions'}]});}return null;})[_0x2300('0x22')](respondWithResult(_0x3e918e,null))[_0x2300('0x41')](handleError(_0x3e918e,null));};var md5=require(_0x2300('0x55'));exports[_0x2300('0x56')]=function(_0x3132cf,_0x4ddc94,_0x347afc){var _0x49e4c2=null;var _0x30fabd=null;var _0x23bfe3=null;var _0x1319e2=null;var _0xe8d649='';return db[_0x2300('0x3e')][_0x2300('0x4e')]({'where':{'id':_0x3132cf[_0x2300('0x43')]['id']},'attributes':['id',_0x2300('0x26'),_0x2300('0x57'),_0x2300('0x58'),_0x2300('0x59'),'remoteUri',_0x2300('0x5a'),'accessKey']})[_0x2300('0x22')](handleEntityNotFound(_0x4ddc94,null))[_0x2300('0x22')](function(_0x48b139){if(_0x48b139){_0x49e4c2=_0x48b139[_0x2300('0x57')];_0x30fabd=_0x48b139[_0x2300('0x5b')];_0x23bfe3=_0x48b139['moduleName'];_0xe8d649=_0x48b139[_0x2300('0x5c')];var _0x19da24=_0xe8d649['slice'](-0x1);if(_0x19da24==='/'){_0xe8d649=_0xe8d649['substring'](0x0,_0xe8d649[_0x2300('0x5d')](_0x19da24));}_0x1319e2=util[_0x2300('0x5e')]('%s/webservice.php',_0xe8d649);var _0x2728db={'method':'GET','uri':_0x1319e2,'qs':{'operation':_0x2300('0x5f'),'username':_0x48b139[_0x2300('0x57')]},'json':!![]};return rp(_0x2728db);}})['then'](function(_0x415598){if(_0x415598['success']){var _0x2c7b51={'method':_0x2300('0x60'),'uri':_0x1319e2,'form':{'operation':_0x2300('0x61'),'username':_0x49e4c2,'accessKey':md5(_0x415598[_0x2300('0x62')][_0x2300('0x63')]+_0x30fabd)},'json':!![]};return rp(_0x2c7b51);}})[_0x2300('0x22')](function(_0x11ff8e){if(_0x11ff8e[_0x2300('0x64')]){var _0x27cd0d={'method':_0x2300('0x65'),'uri':_0x1319e2,'qs':{'operation':_0x2300('0x66'),'username':_0x49e4c2,'sessionName':_0x11ff8e['result'][_0x2300('0x67')],'elementType':_0x23bfe3},'json':!![]};return rp(_0x27cd0d);}})['then'](function(_0x59b7d6){if(_0x59b7d6[_0x2300('0x64')]){var _0x162fd9=[_0x2300('0x68'),_0x2300('0x69'),_0x2300('0x6a')];_[_0x2300('0x6b')](_0x59b7d6[_0x2300('0x62')]['fields'],function(_0x59911e){return _0x162fd9[_0x2300('0x6c')](_0x59911e['type'][_0x2300('0x26')]);});_[_0x2300('0x6b')](_0x59b7d6[_0x2300('0x62')]['fields'],function(_0x331db5){return _0x331db5[_0x2300('0x6d')]===_0x2300('0x6e');});return{'count':_0x59b7d6[_0x2300('0x62')][_0x2300('0x31')][_0x2300('0x32')],'rows':_['map'](_0x59b7d6[_0x2300('0x62')][_0x2300('0x31')],function(_0x16bdfe){return{'id':_0x16bdfe['name'],'name':_0x16bdfe[_0x2300('0x6f')],'custom':_[_0x2300('0x70')](_0x16bdfe[_0x2300('0x26')],_0x2300('0x71'))?!![]:![],'options':_0x16bdfe[_0x2300('0x3a')]['name']===_0x2300('0x72')&&_0x16bdfe[_0x2300('0x3a')][_0x2300('0x73')][_0x2300('0x32')]>0x0?_['map'](_0x16bdfe[_0x2300('0x3a')]['picklistValues'],function(_0x3b46d1){return{'name':_0x3b46d1[_0x2300('0x6f')],'value':_0x3b46d1[_0x2300('0x74')]};}):[]};})};}})['then'](respondWithResult(_0x4ddc94,null))[_0x2300('0x41')](function(_0x54934b){console[_0x2300('0x75')]('vTiger\x20error:\x20'+_0x54934b);var _0x569f4e=_0x3132cf[_0x2300('0x2d')][_0x2300('0x76')]?0x1f4:_0x54934b['statusCode']||0x1f4;logger['error'](_0x2300('0x77'),'getFields',_0x569f4e,JSON[_0x2300('0x78')](_0x54934b));delete _0x54934b[_0x2300('0x26')];if(_0x569f4e===0x191){_0x569f4e=0x190;}_0x4ddc94[_0x2300('0x19')](_0x569f4e)['send'](_0x3132cf['query'][_0x2300('0x76')]?{'message':_0x2300('0x79'),'statusCode':_0x54934b[_0x2300('0x7a')]}:_0x54934b);});};
\ No newline at end of file
+var _0x44c9=['includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','findOne','VtigerConfiguration','addConfiguration','AccountId','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','description','moduleName','remoteUri','accessKey','username','slice','substring','format','%s/webservice.php','GET','getchallenge','success','login','result','describe','sessionName','reference','owner','remove'];(function(_0x58d3cd,_0x469d03){var _0x42825c=function(_0x1b02d2){while(--_0x1b02d2){_0x58d3cd['push'](_0x58d3cd['shift']());}};_0x42825c(++_0x469d03);}(_0x44c9,0x8a));var _0x944c=function(_0x461a2c,_0x242360){_0x461a2c=_0x461a2c-0x0;var _0x483d71=_0x44c9[_0x461a2c];return _0x483d71;};'use strict';var emlformat=require(_0x944c('0x0'));var rimraf=require(_0x944c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x944c('0x2'));var rp=require(_0x944c('0x3'));var moment=require(_0x944c('0x4'));var BPromise=require(_0x944c('0x5'));var Mustache=require(_0x944c('0x6'));var util=require(_0x944c('0x7'));var path=require(_0x944c('0x8'));var sox=require(_0x944c('0x9'));var csv=require(_0x944c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x944c('0xb'));var squel=require(_0x944c('0xc'));var crypto=require(_0x944c('0xd'));var jsforce=require(_0x944c('0xe'));var deskjs=require(_0x944c('0xf'));var toCsv=require(_0x944c('0xa'));var querystring=require(_0x944c('0x10'));var Papa=require(_0x944c('0x11'));var Redis=require(_0x944c('0x12'));var authService=require(_0x944c('0x13'));var qs=require(_0x944c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x944c('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x944c('0x16'));var config=require(_0x944c('0x17'));var licenseUtil=require(_0x944c('0x18'));var db=require(_0x944c('0x19'))['db'];var integrations=require(_0x944c('0x1a'));function respondWithStatusCode(_0x22d8f5,_0x1ba743){_0x1ba743=_0x1ba743||0xcc;return function(_0x5b985a){if(_0x5b985a){return _0x22d8f5[_0x944c('0x1b')](_0x1ba743);}return _0x22d8f5[_0x944c('0x1c')](_0x1ba743)['end']();};}function respondWithResult(_0x1c1f5d,_0x613edc){_0x613edc=_0x613edc||0xc8;return function(_0x5ebd93){if(_0x5ebd93){return _0x1c1f5d['status'](_0x613edc)[_0x944c('0x1d')](_0x5ebd93);}};}function respondWithFilteredResult(_0x41f690,_0x449f8e){return function(_0x16c121){if(_0x16c121){var _0x6505a9=typeof _0x449f8e[_0x944c('0x1e')]==='undefined'&&typeof _0x449f8e['limit']===_0x944c('0x1f');var _0x1c289f=_0x16c121['count'];var _0xfcaf50=_0x6505a9?0x0:_0x449f8e[_0x944c('0x1e')];var _0x9002d8=_0x6505a9?_0x16c121[_0x944c('0x20')]:_0x449f8e['offset']+_0x449f8e[_0x944c('0x21')];var _0x2e76cb;if(_0x9002d8>=_0x1c289f){_0x9002d8=_0x1c289f;_0x2e76cb=0xc8;}else{_0x2e76cb=0xce;}_0x41f690[_0x944c('0x1c')](_0x2e76cb);return _0x41f690['set'](_0x944c('0x22'),_0xfcaf50+'-'+_0x9002d8+'/'+_0x1c289f)[_0x944c('0x1d')](_0x16c121);}return null;};}function patchUpdates(_0xe02daf){return function(_0x2291bc){try{jsonpatch[_0x944c('0x23')](_0x2291bc,_0xe02daf,!![]);}catch(_0x3d9dae){return BPromise[_0x944c('0x24')](_0x3d9dae);}return _0x2291bc[_0x944c('0x25')]();};}function saveUpdates(_0x51be4b,_0x5da785){return function(_0x29929b){if(_0x29929b){return _0x29929b[_0x944c('0x26')](_0x51be4b)[_0x944c('0x27')](function(_0x4edaf3){return _0x4edaf3;});}return null;};}function removeEntity(_0x394d22,_0x54933a){return function(_0x17b8cd){if(_0x17b8cd){return _0x17b8cd['destroy']()[_0x944c('0x27')](function(){_0x394d22[_0x944c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c1b59,_0x71cf96){return function(_0x226b7c){if(!_0x226b7c){_0x1c1b59[_0x944c('0x1b')](0x194);}return _0x226b7c;};}function handleError(_0x3bf728,_0x42402f){_0x42402f=_0x42402f||0x1f4;return function(_0x33cfe2){logger[_0x944c('0x28')](_0x33cfe2[_0x944c('0x29')]);if(_0x33cfe2[_0x944c('0x2a')]){delete _0x33cfe2[_0x944c('0x2a')];}_0x3bf728[_0x944c('0x1c')](_0x42402f)[_0x944c('0x2b')](_0x33cfe2);};}exports[_0x944c('0x2c')]=function(_0x3295db,_0x573c18){var _0x58c54b={},_0x2d32d5={},_0x51025b={'count':0x0,'rows':[]};var _0x4ef1c2=_['map'](db[_0x944c('0x2d')][_0x944c('0x2e')],function(_0xa666b7){return{'name':_0xa666b7[_0x944c('0x2f')],'type':_0xa666b7[_0x944c('0x30')][_0x944c('0x31')]};});_0x2d32d5[_0x944c('0x32')]=_[_0x944c('0x33')](_0x4ef1c2,_0x944c('0x2a'));_0x2d32d5['query']=_[_0x944c('0x34')](_0x3295db['query']);_0x2d32d5[_0x944c('0x35')]=_['intersection'](_0x2d32d5[_0x944c('0x32')],_0x2d32d5[_0x944c('0x36')]);_0x58c54b[_0x944c('0x37')]=_[_0x944c('0x38')](_0x2d32d5['model'],qs['fields'](_0x3295db['query'][_0x944c('0x39')]));_0x58c54b[_0x944c('0x37')]=_0x58c54b['attributes'][_0x944c('0x3a')]?_0x58c54b[_0x944c('0x37')]:_0x2d32d5[_0x944c('0x32')];if(!_0x3295db[_0x944c('0x36')][_0x944c('0x3b')](_0x944c('0x3c'))){_0x58c54b[_0x944c('0x21')]=qs[_0x944c('0x21')](_0x3295db[_0x944c('0x36')][_0x944c('0x21')]);_0x58c54b['offset']=qs[_0x944c('0x1e')](_0x3295db[_0x944c('0x36')]['offset']);}_0x58c54b[_0x944c('0x3d')]=qs[_0x944c('0x3e')](_0x3295db[_0x944c('0x36')][_0x944c('0x3e')]);_0x58c54b['where']=qs[_0x944c('0x35')](_[_0x944c('0x3f')](_0x3295db['query'],_0x2d32d5[_0x944c('0x35')]),_0x4ef1c2);if(_0x3295db[_0x944c('0x36')][_0x944c('0x40')]){_0x58c54b[_0x944c('0x41')]=_[_0x944c('0x42')](_0x58c54b[_0x944c('0x41')],{'$or':_['map'](_0x4ef1c2,function(_0x2df9c6){if(_0x2df9c6[_0x944c('0x30')]!==_0x944c('0x43')){var _0x101bb8={};_0x101bb8[_0x2df9c6[_0x944c('0x2a')]]={'$like':'%'+_0x3295db[_0x944c('0x36')][_0x944c('0x40')]+'%'};return _0x101bb8;}})});}_0x58c54b=_[_0x944c('0x42')]({},_0x58c54b,_0x3295db['options']);var _0x472090={'where':_0x58c54b['where']};return db[_0x944c('0x2d')][_0x944c('0x20')](_0x472090)[_0x944c('0x27')](function(_0x2a468d){_0x51025b['count']=_0x2a468d;if(_0x3295db[_0x944c('0x36')][_0x944c('0x44')]){_0x58c54b[_0x944c('0x45')]=[{'all':!![]}];}return db[_0x944c('0x2d')]['findAll'](_0x58c54b);})['then'](function(_0x845a72){_0x51025b[_0x944c('0x46')]=_0x845a72;return _0x51025b;})[_0x944c('0x27')](respondWithFilteredResult(_0x573c18,_0x58c54b))[_0x944c('0x47')](handleError(_0x573c18,null));};exports[_0x944c('0x48')]=function(_0x580472,_0x347721){var _0x66bd02={'raw':![],'where':{'id':_0x580472['params']['id']}},_0xc27100={};_0xc27100[_0x944c('0x32')]=_['keys'](db[_0x944c('0x2d')]['rawAttributes']);_0xc27100[_0x944c('0x36')]=_['keys'](_0x580472['query']);_0xc27100[_0x944c('0x35')]=_['intersection'](_0xc27100[_0x944c('0x32')],_0xc27100[_0x944c('0x36')]);_0x66bd02['attributes']=_[_0x944c('0x38')](_0xc27100[_0x944c('0x32')],qs[_0x944c('0x39')](_0x580472[_0x944c('0x36')]['fields']));_0x66bd02[_0x944c('0x37')]=_0x66bd02[_0x944c('0x37')][_0x944c('0x3a')]?_0x66bd02['attributes']:_0xc27100[_0x944c('0x32')];if(_0x580472[_0x944c('0x36')][_0x944c('0x44')]){_0x66bd02[_0x944c('0x45')]=[{'all':!![]}];}_0x66bd02=_[_0x944c('0x42')]({},_0x66bd02,_0x580472[_0x944c('0x49')]);return db['VtigerAccount'][_0x944c('0x4a')](_0x66bd02)[_0x944c('0x27')](handleEntityNotFound(_0x347721,null))['then'](respondWithResult(_0x347721,null))[_0x944c('0x47')](handleError(_0x347721,null));};exports[_0x944c('0x4b')]=function(_0x306deb,_0x231591){return db[_0x944c('0x2d')][_0x944c('0x4b')](_0x306deb[_0x944c('0x4c')],{})[_0x944c('0x27')](respondWithResult(_0x231591,0xc9))[_0x944c('0x47')](handleError(_0x231591,null));};exports[_0x944c('0x26')]=function(_0x293c9f,_0x3713df){if(_0x293c9f[_0x944c('0x4c')]['id']){delete _0x293c9f[_0x944c('0x4c')]['id'];}return db[_0x944c('0x2d')][_0x944c('0x4a')]({'where':{'id':_0x293c9f[_0x944c('0x4d')]['id']}})[_0x944c('0x27')](handleEntityNotFound(_0x3713df,null))[_0x944c('0x27')](saveUpdates(_0x293c9f[_0x944c('0x4c')],null))[_0x944c('0x27')](respondWithResult(_0x3713df,null))['catch'](handleError(_0x3713df,null));};exports['destroy']=function(_0x18c1e7,_0x47ce77){return db['VtigerAccount']['find']({'where':{'id':_0x18c1e7['params']['id']}})[_0x944c('0x27')](handleEntityNotFound(_0x47ce77,null))[_0x944c('0x27')](removeEntity(_0x47ce77,null))[_0x944c('0x47')](handleError(_0x47ce77,null));};exports['getConfigurations']=function(_0x24833e,_0x1e49cf,_0x3cad52){var _0x11b2e6={};var _0x2afd48={};var _0x23f2ea;var _0x4009b2;return db[_0x944c('0x2d')][_0x944c('0x4e')]({'where':{'id':_0x24833e['params']['id']}})[_0x944c('0x27')](handleEntityNotFound(_0x1e49cf,null))[_0x944c('0x27')](function(_0x2238b5){if(_0x2238b5){_0x23f2ea=_0x2238b5;_0x2afd48[_0x944c('0x32')]=_['keys'](db[_0x944c('0x4f')][_0x944c('0x2e')]);_0x2afd48[_0x944c('0x36')]=_['keys'](_0x24833e[_0x944c('0x36')]);_0x2afd48[_0x944c('0x35')]=_[_0x944c('0x38')](_0x2afd48[_0x944c('0x32')],_0x2afd48[_0x944c('0x36')]);_0x11b2e6[_0x944c('0x37')]=_[_0x944c('0x38')](_0x2afd48[_0x944c('0x32')],qs[_0x944c('0x39')](_0x24833e[_0x944c('0x36')][_0x944c('0x39')]));_0x11b2e6[_0x944c('0x37')]=_0x11b2e6[_0x944c('0x37')][_0x944c('0x3a')]?_0x11b2e6[_0x944c('0x37')]:_0x2afd48[_0x944c('0x32')];_0x11b2e6[_0x944c('0x3d')]=qs[_0x944c('0x3e')](_0x24833e[_0x944c('0x36')]['sort']);_0x11b2e6[_0x944c('0x41')]=qs[_0x944c('0x35')](_[_0x944c('0x3f')](_0x24833e[_0x944c('0x36')],_0x2afd48['filters']));if(_0x24833e['query'][_0x944c('0x40')]){_0x11b2e6[_0x944c('0x41')]=_['merge'](_0x11b2e6['where'],{'$or':_[_0x944c('0x33')](_0x11b2e6[_0x944c('0x37')],function(_0x13159b){var _0xbfcdd2={};_0xbfcdd2[_0x13159b]={'$like':'%'+_0x24833e[_0x944c('0x36')][_0x944c('0x40')]+'%'};return _0xbfcdd2;})});}_0x11b2e6=_['merge']({},_0x11b2e6,_0x24833e['options']);return _0x23f2ea['getConfigurations'](_0x11b2e6);}})['then'](function(_0x22db09){if(_0x22db09){_0x4009b2=_0x22db09[_0x944c('0x3a')];if(!_0x24833e[_0x944c('0x36')]['hasOwnProperty'](_0x944c('0x3c'))){_0x11b2e6[_0x944c('0x21')]=qs[_0x944c('0x21')](_0x24833e[_0x944c('0x36')]['limit']);_0x11b2e6[_0x944c('0x1e')]=qs[_0x944c('0x1e')](_0x24833e[_0x944c('0x36')][_0x944c('0x1e')]);}return _0x23f2ea['getConfigurations'](_0x11b2e6);}})[_0x944c('0x27')](function(_0x5eeed9){if(_0x5eeed9){return _0x5eeed9?{'count':_0x4009b2,'rows':_0x5eeed9}:null;}})[_0x944c('0x27')](respondWithResult(_0x1e49cf,null))[_0x944c('0x47')](handleError(_0x1e49cf,null));};exports[_0x944c('0x50')]=function(_0x2e51ae,_0x4955f0,_0x288ba7){if(_0x2e51ae['body']['id']){delete _0x2e51ae[_0x944c('0x4c')]['id'];}return db[_0x944c('0x2d')][_0x944c('0x4e')]({'where':{'id':_0x2e51ae['params']['id']}})[_0x944c('0x27')](handleEntityNotFound(_0x4955f0,null))[_0x944c('0x27')](function(_0x506030){if(_0x506030){_0x2e51ae[_0x944c('0x4c')][_0x944c('0x51')]=_0x506030['id'];_0x2e51ae[_0x944c('0x4c')]['Subjects']=integrations['getSubjects'](_0x2e51ae['body'][_0x944c('0x52')],_0x2e51ae[_0x944c('0x4c')][_0x944c('0x30')]);_0x2e51ae[_0x944c('0x4c')][_0x944c('0x53')]=integrations[_0x944c('0x54')](_0x2e51ae[_0x944c('0x4c')][_0x944c('0x52')],_0x2e51ae['body']['type']);return db[_0x944c('0x4f')][_0x944c('0x4b')](_0x2e51ae[_0x944c('0x4c')],{'include':[{'model':db[_0x944c('0x55')],'as':_0x944c('0x56')},{'model':db[_0x944c('0x55')],'as':_0x944c('0x53')}]});}return null;})[_0x944c('0x27')](respondWithResult(_0x4955f0,null))[_0x944c('0x47')](handleError(_0x4955f0,null));};var md5=require(_0x944c('0x57'));exports[_0x944c('0x58')]=function(_0x4cf18,_0x110683,_0x1b7b8e){var _0x49dfd6=null;var _0xd4ac4b=null;var _0x7225b2=null;var _0x2f3539=null;var _0x1fc34d='';return db['VtigerAccount'][_0x944c('0x4e')]({'where':{'id':_0x4cf18[_0x944c('0x4d')]['id']},'attributes':['id',_0x944c('0x2a'),'username',_0x944c('0x59'),_0x944c('0x5a'),_0x944c('0x5b'),'serverUrl',_0x944c('0x5c')]})['then'](handleEntityNotFound(_0x110683,null))[_0x944c('0x27')](function(_0xd14e59){if(_0xd14e59){_0x49dfd6=_0xd14e59[_0x944c('0x5d')];_0xd4ac4b=_0xd14e59[_0x944c('0x5c')];_0x7225b2=_0xd14e59[_0x944c('0x5a')];_0x1fc34d=_0xd14e59['remoteUri'];var _0x5ea939=_0x1fc34d[_0x944c('0x5e')](-0x1);if(_0x5ea939==='/'){_0x1fc34d=_0x1fc34d[_0x944c('0x5f')](0x0,_0x1fc34d['lastIndexOf'](_0x5ea939));}_0x2f3539=util[_0x944c('0x60')](_0x944c('0x61'),_0x1fc34d);var _0x89f761={'method':_0x944c('0x62'),'uri':_0x2f3539,'qs':{'operation':_0x944c('0x63'),'username':_0xd14e59[_0x944c('0x5d')]},'json':!![]};return rp(_0x89f761);}})[_0x944c('0x27')](function(_0x410fc8){if(_0x410fc8[_0x944c('0x64')]){var _0x390ea1={'method':'POST','uri':_0x2f3539,'form':{'operation':_0x944c('0x65'),'username':_0x49dfd6,'accessKey':md5(_0x410fc8[_0x944c('0x66')]['token']+_0xd4ac4b)},'json':!![]};return rp(_0x390ea1);}})['then'](function(_0x57be66){if(_0x57be66[_0x944c('0x64')]){var _0x5273fa={'method':'GET','uri':_0x2f3539,'qs':{'operation':_0x944c('0x67'),'username':_0x49dfd6,'sessionName':_0x57be66['result'][_0x944c('0x68')],'elementType':_0x7225b2},'json':!![]};return rp(_0x5273fa);}})[_0x944c('0x27')](function(_0x5077f4){if(_0x5077f4['success']){var _0x31091f=['autogenerated',_0x944c('0x69'),_0x944c('0x6a')];_[_0x944c('0x6b')](_0x5077f4[_0x944c('0x66')][_0x944c('0x39')],function(_0x23bcfa){return _0x31091f[_0x944c('0x6c')](_0x23bcfa[_0x944c('0x30')][_0x944c('0x2a')]);});_[_0x944c('0x6b')](_0x5077f4[_0x944c('0x66')][_0x944c('0x39')],function(_0x5950cd){return _0x5950cd[_0x944c('0x6d')]===_0x944c('0x6e');});return{'count':_0x5077f4[_0x944c('0x66')][_0x944c('0x39')]['length'],'rows':_[_0x944c('0x33')](_0x5077f4[_0x944c('0x66')]['fields'],function(_0x86f850){return{'id':_0x86f850[_0x944c('0x2a')],'name':_0x86f850[_0x944c('0x6f')],'custom':_[_0x944c('0x70')](_0x86f850[_0x944c('0x2a')],_0x944c('0x71'))?!![]:![],'options':_0x86f850[_0x944c('0x30')][_0x944c('0x2a')]===_0x944c('0x72')&&_0x86f850[_0x944c('0x30')][_0x944c('0x73')][_0x944c('0x3a')]>0x0?_[_0x944c('0x33')](_0x86f850[_0x944c('0x30')][_0x944c('0x73')],function(_0xb76732){return{'name':_0xb76732[_0x944c('0x6f')],'value':_0xb76732[_0x944c('0x74')]};}):[]};})};}})[_0x944c('0x27')](respondWithResult(_0x110683,null))[_0x944c('0x47')](function(_0x472095){console[_0x944c('0x75')](_0x944c('0x76')+_0x472095);var _0x351810=_0x4cf18[_0x944c('0x36')][_0x944c('0x77')]?0x1f4:_0x472095['statusCode']||0x1f4;logger['error'](_0x944c('0x78'),_0x944c('0x58'),_0x351810,JSON['stringify'](_0x472095));delete _0x472095[_0x944c('0x2a')];if(_0x351810===0x191){_0x351810=0x190;}_0x110683['status'](_0x351810)[_0x944c('0x2b')](_0x4cf18[_0x944c('0x36')][_0x944c('0x77')]?{'message':_0x944c('0x79'),'statusCode':_0x472095[_0x944c('0x7a')]}:_0x472095);});};
\ No newline at end of file
index 3799a45..b1b42ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed10=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','VtigerAccount','util','../../config/logger','api'];(function(_0x2357af,_0x57781d){var _0x340193=function(_0x44ad6b){while(--_0x44ad6b){_0x2357af['push'](_0x2357af['shift']());}};_0x340193(++_0x57781d);}(_0xed10,0x1dd));var _0x0ed1=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xed10[_0xcd5a3d];return _0xd43207;};'use strict';var _=require('lodash');var util=require(_0x0ed1('0x0'));var logger=require(_0x0ed1('0x1'))(_0x0ed1('0x2'));var moment=require(_0x0ed1('0x3'));var BPromise=require(_0x0ed1('0x4'));var rp=require(_0x0ed1('0x5'));var fs=require('fs');var path=require(_0x0ed1('0x6'));var rimraf=require(_0x0ed1('0x7'));var config=require(_0x0ed1('0x8'));var attributes=require(_0x0ed1('0x9'));var integrations=require(_0x0ed1('0xa'));module['exports']=function(_0x11b867,_0xf293c5){return _0x11b867['define'](_0x0ed1('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae16=['moment','bluebird','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','util','api'];(function(_0x5ed211,_0x207049){var _0x1beacb=function(_0x13b636){while(--_0x13b636){_0x5ed211['push'](_0x5ed211['shift']());}};_0x1beacb(++_0x207049);}(_0xae16,0x1ac));var _0x6ae1=function(_0x567e20,_0x1854db){_0x567e20=_0x567e20-0x0;var _0x55618f=_0xae16[_0x567e20];return _0x55618f;};'use strict';var _=require('lodash');var util=require(_0x6ae1('0x0'));var logger=require('../../config/logger')(_0x6ae1('0x1'));var moment=require(_0x6ae1('0x2'));var BPromise=require(_0x6ae1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6ae1('0x4'));var config=require(_0x6ae1('0x5'));var attributes=require(_0x6ae1('0x6'));var integrations=require(_0x6ae1('0x7'));module[_0x6ae1('0x8')]=function(_0x44b853,_0x1fd2d4){return _0x44b853['define'](_0x6ae1('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 89e933f..eaf2df5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb574=['where','attributes','include','map','model','ShowVtigerAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0xb574,0x106));var _0x4b57=function(_0xfb8407,_0x42aa3f){_0xfb8407=_0xfb8407-0x0;var _0x5ce179=_0xb574[_0xfb8407];return _0x5ce179;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a4a0f,_0x585d86,_0x4b2d65){return new BPromise(function(_0x548ee8,_0x291e54){return client[_0x4b57('0xa')](_0x4a4a0f,_0x4b2d65)[_0x4b57('0xb')](function(_0x3b112d){logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,_0x4b57('0xe'));logger[_0x4b57('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x585d86,_0x4b57('0xe'),JSON[_0x4b57('0x10')](_0x3b112d));if(_0x3b112d[_0x4b57('0x11')]){if(_0x3b112d['error']['code']===0x1f4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);return _0x291e54(_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);}logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')]['message']);return _0x548ee8(_0x3b112d['error'][_0x4b57('0x12')]);}else{logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,'request\x20sent');_0x548ee8(_0x3b112d[_0x4b57('0x13')]['message']);}})[_0x4b57('0x14')](function(_0x42aff4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x42aff4);_0x291e54(_0x42aff4);});});}exports[_0x4b57('0x15')]=function(_0xfb71cc){var _0x4ede42=this;return new Promise(function(_0x1b35ff,_0x1a0b72){return db[_0x4b57('0x16')][_0x4b57('0x17')]({'raw':_0xfb71cc['options']?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![],'where':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x1a')]||null:null,'attributes':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc['options'][_0x4b57('0x1b')]||null:null,'limit':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')]['limit']||null:null,'include':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0xfb71cc['options'][_0x4b57('0x1c')],function(_0x368c5f){return{'model':db[_0x368c5f['model']],'as':_0x368c5f['as'],'attributes':_0x368c5f[_0x4b57('0x1b')],'include':_0x368c5f[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x368c5f[_0x4b57('0x1c')],function(_0x540eff){return{'model':db[_0x540eff[_0x4b57('0x1e')]],'as':_0x540eff['as'],'attributes':_0x540eff['attributes'],'include':_0x540eff[_0x4b57('0x1c')]?_['map'](_0x540eff[_0x4b57('0x1c')],function(_0x2dc9d8){return{'model':db[_0x2dc9d8[_0x4b57('0x1e')]],'as':_0x2dc9d8['as'],'attributes':_0x2dc9d8[_0x4b57('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4b57('0xb')](function(_0x392e37){logger['info']('GetVtigerAccount',_0xfb71cc);logger[_0x4b57('0xf')]('GetVtigerAccount',_0xfb71cc,JSON[_0x4b57('0x10')](_0x392e37));_0x1b35ff(_0x392e37);})[_0x4b57('0x14')](function(_0x874cf7){logger[_0x4b57('0x11')](_0x4b57('0x15'),_0x874cf7[_0x4b57('0x12')],_0xfb71cc);_0x1a0b72(_0x4ede42['error'](0x1f4,_0x874cf7[_0x4b57('0x12')]));});});};exports[_0x4b57('0x1f')]=function(_0x68be27){var _0x3cd331=this;return new Promise(function(_0x4ccf89,_0xa91ba){return db[_0x4b57('0x16')]['find']({'raw':_0x68be27[_0x4b57('0x18')]?_0x68be27[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![],'where':_0x68be27[_0x4b57('0x18')]?_0x68be27['options']['where']||null:null,'attributes':_0x68be27['options']?_0x68be27[_0x4b57('0x18')][_0x4b57('0x1b')]||null:null,'include':_0x68be27[_0x4b57('0x18')]?_0x68be27[_0x4b57('0x18')][_0x4b57('0x1c')]?_['map'](_0x68be27[_0x4b57('0x18')][_0x4b57('0x1c')],function(_0x1fd3f7){return{'model':db[_0x1fd3f7['model']],'as':_0x1fd3f7['as'],'attributes':_0x1fd3f7[_0x4b57('0x1b')],'include':_0x1fd3f7[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x1fd3f7['include'],function(_0x28a0ee){return{'model':db[_0x28a0ee[_0x4b57('0x1e')]],'as':_0x28a0ee['as'],'attributes':_0x28a0ee['attributes'],'include':_0x28a0ee[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x28a0ee[_0x4b57('0x1c')],function(_0x91f32e){return{'model':db[_0x91f32e[_0x4b57('0x1e')]],'as':_0x91f32e['as'],'attributes':_0x91f32e[_0x4b57('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9f76){logger[_0x4b57('0xc')](_0x4b57('0x1f'),_0x68be27);logger[_0x4b57('0xf')](_0x4b57('0x1f'),_0x68be27,JSON[_0x4b57('0x10')](_0x1f9f76));_0x4ccf89(_0x1f9f76);})[_0x4b57('0x14')](function(_0x4c5b82){logger['error'](_0x4b57('0x1f'),_0x4c5b82[_0x4b57('0x12')],_0x68be27);_0xa91ba(_0x3cd331[_0x4b57('0x11')](0x1f4,_0x4c5b82['message']));});});};
\ No newline at end of file
+var _0xefda=['options','raw','attributes','include','map','model','ShowVtigerAccount','VtigerAccount','find','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','GetVtigerAccount','findAll'];(function(_0x5e69c7,_0x1fd53a){var _0x3cdd99=function(_0x1d0b0a){while(--_0x1d0b0a){_0x5e69c7['push'](_0x5e69c7['shift']());}};_0x3cdd99(++_0x1fd53a);}(_0xefda,0x96));var _0xaefd=function(_0x43db20,_0x5d204e){_0x43db20=_0x43db20-0x0;var _0x51ed6d=_0xefda[_0x43db20];return _0x51ed6d;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['VtigerAccount'][_0xaefd('0x18')]({'raw':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['where']||null:null,'attributes':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'limit':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['limit']||null:null,'include':_0x9748f4['options']?_0x9748f4['options'][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x9748f4[_0xaefd('0x19')]['include'],function(_0x23060f){return{'model':db[_0x23060f['model']],'as':_0x23060f['as'],'attributes':_0x23060f[_0xaefd('0x1b')],'include':_0x23060f[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x23060f['include'],function(_0x435413){return{'model':db[_0x435413[_0xaefd('0x1e')]],'as':_0x435413['as'],'attributes':_0x435413[_0xaefd('0x1b')],'include':_0x435413[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x435413['include'],function(_0x2fe27e){return{'model':db[_0x2fe27e['model']],'as':_0x2fe27e['as'],'attributes':_0x2fe27e[_0xaefd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x5470bd){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger['debug'](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5470bd));_0x2db61b(_0x5470bd);})[_0xaefd('0x16')](function(_0x4c0898){logger[_0xaefd('0x10')]('GetVtigerAccount',_0x4c0898[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1['error'](0x1f4,_0x4c0898['message']));});});};exports[_0xaefd('0x1f')]=function(_0x1b470c){var _0x4a032d=this;return new Promise(function(_0x578378,_0x4ee0c1){return db[_0xaefd('0x20')][_0xaefd('0x21')]({'raw':_0x1b470c['options']?_0x1b470c['options'][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x22')]||null:null,'attributes':_0x1b470c['options']?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'include':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')],function(_0x3e3fe2){return{'model':db[_0x3e3fe2[_0xaefd('0x1e')]],'as':_0x3e3fe2['as'],'attributes':_0x3e3fe2[_0xaefd('0x1b')],'include':_0x3e3fe2[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x3e3fe2[_0xaefd('0x1c')],function(_0x1ffec4){return{'model':db[_0x1ffec4[_0xaefd('0x1e')]],'as':_0x1ffec4['as'],'attributes':_0x1ffec4['attributes'],'include':_0x1ffec4[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1ffec4[_0xaefd('0x1c')],function(_0x59aec9){return{'model':db[_0x59aec9[_0xaefd('0x1e')]],'as':_0x59aec9['as'],'attributes':_0x59aec9['attributes']};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x3498d9){logger[_0xaefd('0x14')](_0xaefd('0x1f'),_0x1b470c);logger[_0xaefd('0xd')](_0xaefd('0x1f'),_0x1b470c,JSON[_0xaefd('0xf')](_0x3498d9));_0x578378(_0x3498d9);})[_0xaefd('0x16')](function(_0x407bea){logger[_0xaefd('0x10')](_0xaefd('0x1f'),_0x407bea[_0xaefd('0x13')],_0x1b470c);_0x4ee0c1(_0x4a032d[_0xaefd('0x10')](0x1f4,_0x407bea[_0xaefd('0x13')]));});});};
\ No newline at end of file
index 1803fbb..9aa0984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ff5=['/:id/fields','getFields','get','/:id/subjects','/:id/descriptions','getDescriptions','post','put','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','/:id','show'];(function(_0xa9f70c,_0x39075b){var _0x550515=function(_0x528785){while(--_0x528785){_0xa9f70c['push'](_0xa9f70c['shift']());}};_0x550515(++_0x39075b);}(_0x3ff5,0x184));var _0x53ff=function(_0x4a2caf,_0x45f11d){_0x4a2caf=_0x4a2caf-0x0;var _0x5e3847=_0x3ff5[_0x4a2caf];return _0x5e3847;};'use strict';var multer=require('multer');var util=require(_0x53ff('0x0'));var path=require(_0x53ff('0x1'));var timeout=require(_0x53ff('0x2'));var express=require('express');var router=express[_0x53ff('0x3')]();var fs_extra=require(_0x53ff('0x4'));var auth=require(_0x53ff('0x5'));var interaction=require(_0x53ff('0x6'));var config=require('../../config/environment');var controller=require(_0x53ff('0x7'));router['get']('/',auth[_0x53ff('0x8')](),controller['index']);router['get'](_0x53ff('0x9'),auth[_0x53ff('0x8')](),controller[_0x53ff('0xa')]);router['get'](_0x53ff('0xb'),auth['isAuthenticated'](),controller[_0x53ff('0xc')]);router[_0x53ff('0xd')](_0x53ff('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x53ff('0xd')](_0x53ff('0xf'),auth[_0x53ff('0x8')](),controller[_0x53ff('0x10')]);router[_0x53ff('0x11')]('/',auth[_0x53ff('0x8')](),controller['create']);router[_0x53ff('0x12')](_0x53ff('0x9'),auth[_0x53ff('0x8')](),controller['update']);router['delete'](_0x53ff('0x9'),auth[_0x53ff('0x8')](),controller[_0x53ff('0x13')]);module[_0x53ff('0x14')]=router;
\ No newline at end of file
+var _0x1168=['create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x24ee01,_0x37bd21){var _0x3df307=function(_0x243db7){while(--_0x243db7){_0x24ee01['push'](_0x24ee01['shift']());}};_0x3df307(++_0x37bd21);}(_0x1168,0x118));var _0x8116=function(_0x4a16aa,_0x46f661){_0x4a16aa=_0x4a16aa-0x0;var _0x4e9af4=_0x1168[_0x4a16aa];return _0x4e9af4;};'use strict';var multer=require(_0x8116('0x0'));var util=require(_0x8116('0x1'));var path=require(_0x8116('0x2'));var timeout=require('connect-timeout');var express=require(_0x8116('0x3'));var router=express[_0x8116('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8116('0x5'));var interaction=require(_0x8116('0x6'));var config=require(_0x8116('0x7'));var controller=require(_0x8116('0x8'));router[_0x8116('0x9')]('/',auth[_0x8116('0xa')](),controller[_0x8116('0xb')]);router[_0x8116('0x9')](_0x8116('0xc'),auth['isAuthenticated'](),controller[_0x8116('0xd')]);router[_0x8116('0x9')](_0x8116('0xe'),auth[_0x8116('0xa')](),controller[_0x8116('0xf')]);router[_0x8116('0x9')](_0x8116('0x10'),auth[_0x8116('0xa')](),controller[_0x8116('0x11')]);router[_0x8116('0x9')](_0x8116('0x12'),auth[_0x8116('0xa')](),controller['getDescriptions']);router[_0x8116('0x13')]('/',auth[_0x8116('0xa')](),controller[_0x8116('0x14')]);router[_0x8116('0x15')]('/:id',auth[_0x8116('0xa')](),controller[_0x8116('0x16')]);router[_0x8116('0x17')](_0x8116('0xc'),auth[_0x8116('0xa')](),controller[_0x8116('0x18')]);module['exports']=router;
\ No newline at end of file
index 17351ac..00fac30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7767=['STRING','sequelize','exports'];(function(_0x334770,_0x15523){var _0x4eeb58=function(_0x4c519c){while(--_0x4c519c){_0x334770['push'](_0x334770['shift']());}};_0x4eeb58(++_0x15523);}(_0x7767,0x11e));var _0x7776=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x7767[_0x47a349];return _0x18ab75;};'use strict';var Sequelize=require(_0x7776('0x0'));module[_0x7776('0x1')]={'name':{'type':Sequelize[_0x7776('0x2')]},'description':{'type':Sequelize[_0x7776('0x2')]}};
\ No newline at end of file
+var _0x31ce=['STRING','sequelize','exports'];(function(_0x2a76d3,_0x21c25b){var _0x486768=function(_0x18fd09){while(--_0x18fd09){_0x2a76d3['push'](_0x2a76d3['shift']());}};_0x486768(++_0x21c25b);}(_0x31ce,0x9a));var _0xe31c=function(_0x3dd92b,_0x4d1139){_0x3dd92b=_0x3dd92b-0x0;var _0x5e1d23=_0x31ce[_0x3dd92b];return _0x5e1d23;};'use strict';var Sequelize=require(_0xe31c('0x0'));module[_0xe31c('0x1')]={'name':{'type':Sequelize[_0xe31c('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2eab196..c783983 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd95b=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','reject','save','update','destroy','error','stack','name','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','sort','where','filters','pick','filter','VIRTUAL','merge','count','then','includeAll','VtigerConfiguration','rows','catch','show','params','length','include','options','find','create','body','findOne','VtigerField','rawAttributes','order','getFields','nolimit','getSubjects','hasOwnProperty','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring'];(function(_0x363dee,_0x30563f){var _0xa2f215=function(_0x316327){while(--_0x316327){_0x363dee['push'](_0x363dee['shift']());}};_0xa2f215(++_0x30563f);}(_0xd95b,0x126));var _0xbd95=function(_0x473418,_0x60f7e1){_0x473418=_0x473418-0x0;var _0xfd9c2e=_0xd95b[_0x473418];return _0xfd9c2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd95('0x0'));var zipdir=require(_0xbd95('0x1'));var jsonpatch=require(_0xbd95('0x2'));var rp=require(_0xbd95('0x3'));var moment=require('moment');var BPromise=require(_0xbd95('0x4'));var Mustache=require(_0xbd95('0x5'));var util=require(_0xbd95('0x6'));var path=require('path');var sox=require(_0xbd95('0x7'));var csv=require(_0xbd95('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd95('0x9'));var _=require(_0xbd95('0xa'));var squel=require(_0xbd95('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd95('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbd95('0x8'));var querystring=require(_0xbd95('0xd'));var Papa=require('papaparse');var Redis=require(_0xbd95('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbd95('0xf'));var as=require(_0xbd95('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd95('0x11'))('api');var utils=require(_0xbd95('0x12'));var config=require(_0xbd95('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd95('0x14'))['db'];function respondWithStatusCode(_0x10344b,_0x934603){_0x934603=_0x934603||0xcc;return function(_0x144f46){if(_0x144f46){return _0x10344b[_0xbd95('0x15')](_0x934603);}return _0x10344b[_0xbd95('0x16')](_0x934603)[_0xbd95('0x17')]();};}function respondWithResult(_0x597f8e,_0x2f535d){_0x2f535d=_0x2f535d||0xc8;return function(_0x5935fa){if(_0x5935fa){return _0x597f8e[_0xbd95('0x16')](_0x2f535d)[_0xbd95('0x18')](_0x5935fa);}};}function respondWithFilteredResult(_0xef879e,_0xde3651){return function(_0x33c4a9){if(_0x33c4a9){var _0x35cc45=typeof _0xde3651['offset']===_0xbd95('0x19')&&typeof _0xde3651['limit']===_0xbd95('0x19');var _0x21ada6=_0x33c4a9['count'];var _0x12a05d=_0x35cc45?0x0:_0xde3651[_0xbd95('0x1a')];var _0x216a1b=_0x35cc45?_0x33c4a9['count']:_0xde3651[_0xbd95('0x1a')]+_0xde3651[_0xbd95('0x1b')];var _0x3811e0;if(_0x216a1b>=_0x21ada6){_0x216a1b=_0x21ada6;_0x3811e0=0xc8;}else{_0x3811e0=0xce;}_0xef879e[_0xbd95('0x16')](_0x3811e0);return _0xef879e[_0xbd95('0x1c')](_0xbd95('0x1d'),_0x12a05d+'-'+_0x216a1b+'/'+_0x21ada6)[_0xbd95('0x18')](_0x33c4a9);}return null;};}function patchUpdates(_0xd64523){return function(_0x20c758){try{jsonpatch['apply'](_0x20c758,_0xd64523,!![]);}catch(_0x174852){return BPromise[_0xbd95('0x1e')](_0x174852);}return _0x20c758[_0xbd95('0x1f')]();};}function saveUpdates(_0x3e815b,_0x147331){return function(_0x12c80e){if(_0x12c80e){return _0x12c80e[_0xbd95('0x20')](_0x3e815b)['then'](function(_0x5df0a3){return _0x5df0a3;});}return null;};}function removeEntity(_0x55320c,_0x47a2f1){return function(_0x227a96){if(_0x227a96){return _0x227a96[_0xbd95('0x21')]()['then'](function(){_0x55320c[_0xbd95('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9060,_0x400643){return function(_0x5f37d2){if(!_0x5f37d2){_0x2b9060[_0xbd95('0x15')](0x194);}return _0x5f37d2;};}function handleError(_0x267249,_0x20e376){_0x20e376=_0x20e376||0x1f4;return function(_0x36956e){logger[_0xbd95('0x22')](_0x36956e[_0xbd95('0x23')]);if(_0x36956e[_0xbd95('0x24')]){delete _0x36956e['name'];}_0x267249[_0xbd95('0x16')](_0x20e376)['send'](_0x36956e);};}exports['index']=function(_0x35027e,_0x1d8d62){var _0x2b3f7f={},_0x41c3c6={},_0x235389={'count':0x0,'rows':[]};var _0x46e90c=_['map'](db['VtigerConfiguration']['rawAttributes'],function(_0x8860ea){return{'name':_0x8860ea[_0xbd95('0x25')],'type':_0x8860ea[_0xbd95('0x26')][_0xbd95('0x27')]};});_0x41c3c6[_0xbd95('0x28')]=_[_0xbd95('0x29')](_0x46e90c,'name');_0x41c3c6[_0xbd95('0x2a')]=_[_0xbd95('0x2b')](_0x35027e[_0xbd95('0x2a')]);_0x41c3c6['filters']=_[_0xbd95('0x2c')](_0x41c3c6[_0xbd95('0x28')],_0x41c3c6[_0xbd95('0x2a')]);_0x2b3f7f['attributes']=_['intersection'](_0x41c3c6['model'],qs[_0xbd95('0x2d')](_0x35027e[_0xbd95('0x2a')]['fields']));_0x2b3f7f[_0xbd95('0x2e')]=_0x2b3f7f[_0xbd95('0x2e')]['length']?_0x2b3f7f[_0xbd95('0x2e')]:_0x41c3c6['model'];if(!_0x35027e[_0xbd95('0x2a')]['hasOwnProperty']('nolimit')){_0x2b3f7f[_0xbd95('0x1b')]=qs[_0xbd95('0x1b')](_0x35027e[_0xbd95('0x2a')][_0xbd95('0x1b')]);_0x2b3f7f[_0xbd95('0x1a')]=qs[_0xbd95('0x1a')](_0x35027e[_0xbd95('0x2a')][_0xbd95('0x1a')]);}_0x2b3f7f['order']=qs[_0xbd95('0x2f')](_0x35027e[_0xbd95('0x2a')][_0xbd95('0x2f')]);_0x2b3f7f[_0xbd95('0x30')]=qs[_0xbd95('0x31')](_[_0xbd95('0x32')](_0x35027e['query'],_0x41c3c6[_0xbd95('0x31')]),_0x46e90c);if(_0x35027e[_0xbd95('0x2a')][_0xbd95('0x33')]){_0x2b3f7f[_0xbd95('0x30')]=_['merge'](_0x2b3f7f[_0xbd95('0x30')],{'$or':_['map'](_0x46e90c,function(_0x351241){if(_0x351241['type']!==_0xbd95('0x34')){var _0x522fcf={};_0x522fcf[_0x351241[_0xbd95('0x24')]]={'$like':'%'+_0x35027e[_0xbd95('0x2a')][_0xbd95('0x33')]+'%'};return _0x522fcf;}})});}_0x2b3f7f=_[_0xbd95('0x35')]({},_0x2b3f7f,_0x35027e['options']);var _0x41e21b={'where':_0x2b3f7f['where']};return db['VtigerConfiguration'][_0xbd95('0x36')](_0x41e21b)[_0xbd95('0x37')](function(_0x1baac1){_0x235389[_0xbd95('0x36')]=_0x1baac1;if(_0x35027e[_0xbd95('0x2a')][_0xbd95('0x38')]){_0x2b3f7f['include']=[{'all':!![]}];}return db[_0xbd95('0x39')]['findAll'](_0x2b3f7f);})[_0xbd95('0x37')](function(_0x3d9b0e){_0x235389[_0xbd95('0x3a')]=_0x3d9b0e;return _0x235389;})[_0xbd95('0x37')](respondWithFilteredResult(_0x1d8d62,_0x2b3f7f))[_0xbd95('0x3b')](handleError(_0x1d8d62,null));};exports[_0xbd95('0x3c')]=function(_0x42f1af,_0x26d040){var _0x20eada={'raw':![],'where':{'id':_0x42f1af[_0xbd95('0x3d')]['id']}},_0x249009={};_0x249009['model']=_[_0xbd95('0x2b')](db[_0xbd95('0x39')]['rawAttributes']);_0x249009[_0xbd95('0x2a')]=_['keys'](_0x42f1af[_0xbd95('0x2a')]);_0x249009[_0xbd95('0x31')]=_[_0xbd95('0x2c')](_0x249009[_0xbd95('0x28')],_0x249009[_0xbd95('0x2a')]);_0x20eada[_0xbd95('0x2e')]=_[_0xbd95('0x2c')](_0x249009[_0xbd95('0x28')],qs[_0xbd95('0x2d')](_0x42f1af[_0xbd95('0x2a')][_0xbd95('0x2d')]));_0x20eada[_0xbd95('0x2e')]=_0x20eada['attributes'][_0xbd95('0x3e')]?_0x20eada[_0xbd95('0x2e')]:_0x249009[_0xbd95('0x28')];if(_0x42f1af[_0xbd95('0x2a')][_0xbd95('0x38')]){_0x20eada[_0xbd95('0x3f')]=[{'all':!![]}];}_0x20eada=_[_0xbd95('0x35')]({},_0x20eada,_0x42f1af[_0xbd95('0x40')]);return db[_0xbd95('0x39')][_0xbd95('0x41')](_0x20eada)['then'](handleEntityNotFound(_0x26d040,null))['then'](respondWithResult(_0x26d040,null))['catch'](handleError(_0x26d040,null));};exports[_0xbd95('0x42')]=function(_0x24c5a6,_0x245416){return db[_0xbd95('0x39')]['create'](_0x24c5a6['body'],{})[_0xbd95('0x37')](respondWithResult(_0x245416,0xc9))[_0xbd95('0x3b')](handleError(_0x245416,null));};exports[_0xbd95('0x20')]=function(_0x1ba4ea,_0x2962b1){if(_0x1ba4ea[_0xbd95('0x43')]['id']){delete _0x1ba4ea[_0xbd95('0x43')]['id'];}return db[_0xbd95('0x39')][_0xbd95('0x41')]({'where':{'id':_0x1ba4ea[_0xbd95('0x3d')]['id']}})[_0xbd95('0x37')](handleEntityNotFound(_0x2962b1,null))[_0xbd95('0x37')](saveUpdates(_0x1ba4ea[_0xbd95('0x43')],null))['then'](respondWithResult(_0x2962b1,null))[_0xbd95('0x3b')](handleError(_0x2962b1,null));};exports[_0xbd95('0x21')]=function(_0x173bc7,_0xf921ab){return db[_0xbd95('0x39')]['find']({'where':{'id':_0x173bc7['params']['id']}})[_0xbd95('0x37')](handleEntityNotFound(_0xf921ab,null))[_0xbd95('0x37')](removeEntity(_0xf921ab,null))['catch'](handleError(_0xf921ab,null));};exports['getFields']=function(_0x109d5a,_0x199b54,_0x20f09f){var _0x2d47c9={};var _0x151f9e={};var _0xb34fa7;var _0x30332d;return db[_0xbd95('0x39')][_0xbd95('0x44')]({'where':{'id':_0x109d5a[_0xbd95('0x3d')]['id']}})[_0xbd95('0x37')](handleEntityNotFound(_0x199b54,null))[_0xbd95('0x37')](function(_0x4a9e34){if(_0x4a9e34){_0xb34fa7=_0x4a9e34;_0x151f9e[_0xbd95('0x28')]=_[_0xbd95('0x2b')](db[_0xbd95('0x45')][_0xbd95('0x46')]);_0x151f9e[_0xbd95('0x2a')]=_[_0xbd95('0x2b')](_0x109d5a[_0xbd95('0x2a')]);_0x151f9e[_0xbd95('0x31')]=_[_0xbd95('0x2c')](_0x151f9e[_0xbd95('0x28')],_0x151f9e[_0xbd95('0x2a')]);_0x2d47c9[_0xbd95('0x2e')]=_[_0xbd95('0x2c')](_0x151f9e[_0xbd95('0x28')],qs[_0xbd95('0x2d')](_0x109d5a[_0xbd95('0x2a')][_0xbd95('0x2d')]));_0x2d47c9['attributes']=_0x2d47c9[_0xbd95('0x2e')]['length']?_0x2d47c9[_0xbd95('0x2e')]:_0x151f9e[_0xbd95('0x28')];_0x2d47c9[_0xbd95('0x47')]=qs['sort'](_0x109d5a[_0xbd95('0x2a')][_0xbd95('0x2f')]);_0x2d47c9[_0xbd95('0x30')]=qs['filters'](_['pick'](_0x109d5a[_0xbd95('0x2a')],_0x151f9e['filters']));if(_0x109d5a['query'][_0xbd95('0x33')]){_0x2d47c9['where']=_[_0xbd95('0x35')](_0x2d47c9[_0xbd95('0x30')],{'$or':_[_0xbd95('0x29')](_0x2d47c9[_0xbd95('0x2e')],function(_0x416285){var _0x302caf={};_0x302caf[_0x416285]={'$like':'%'+_0x109d5a[_0xbd95('0x2a')][_0xbd95('0x33')]+'%'};return _0x302caf;})});}_0x2d47c9=_[_0xbd95('0x35')]({},_0x2d47c9,_0x109d5a['options']);return _0xb34fa7[_0xbd95('0x48')](_0x2d47c9);}})[_0xbd95('0x37')](function(_0x319790){if(_0x319790){_0x30332d=_0x319790[_0xbd95('0x3e')];if(!_0x109d5a['query']['hasOwnProperty'](_0xbd95('0x49'))){_0x2d47c9[_0xbd95('0x1b')]=qs[_0xbd95('0x1b')](_0x109d5a[_0xbd95('0x2a')]['limit']);_0x2d47c9[_0xbd95('0x1a')]=qs[_0xbd95('0x1a')](_0x109d5a[_0xbd95('0x2a')]['offset']);}return _0xb34fa7[_0xbd95('0x48')](_0x2d47c9);}})['then'](function(_0x17d8a5){if(_0x17d8a5){return _0x17d8a5?{'count':_0x30332d,'rows':_0x17d8a5}:null;}})[_0xbd95('0x37')](respondWithResult(_0x199b54,null))[_0xbd95('0x3b')](handleError(_0x199b54,null));};exports[_0xbd95('0x4a')]=function(_0x4f4172,_0x5c952b,_0x5ab0d1){var _0x462213={};var _0x5a24e6={};var _0x121202;var _0x2accdd;return db[_0xbd95('0x39')]['findOne']({'where':{'id':_0x4f4172[_0xbd95('0x3d')]['id']}})[_0xbd95('0x37')](handleEntityNotFound(_0x5c952b,null))[_0xbd95('0x37')](function(_0x537a79){if(_0x537a79){_0x121202=_0x537a79;_0x5a24e6[_0xbd95('0x28')]=_[_0xbd95('0x2b')](db[_0xbd95('0x45')][_0xbd95('0x46')]);_0x5a24e6[_0xbd95('0x2a')]=_[_0xbd95('0x2b')](_0x4f4172[_0xbd95('0x2a')]);_0x5a24e6[_0xbd95('0x31')]=_[_0xbd95('0x2c')](_0x5a24e6[_0xbd95('0x28')],_0x5a24e6[_0xbd95('0x2a')]);_0x462213['attributes']=_[_0xbd95('0x2c')](_0x5a24e6['model'],qs[_0xbd95('0x2d')](_0x4f4172[_0xbd95('0x2a')][_0xbd95('0x2d')]));_0x462213['attributes']=_0x462213[_0xbd95('0x2e')]['length']?_0x462213[_0xbd95('0x2e')]:_0x5a24e6[_0xbd95('0x28')];_0x462213[_0xbd95('0x47')]=qs['sort'](_0x4f4172[_0xbd95('0x2a')][_0xbd95('0x2f')]);_0x462213[_0xbd95('0x30')]=qs[_0xbd95('0x31')](_[_0xbd95('0x32')](_0x4f4172[_0xbd95('0x2a')],_0x5a24e6['filters']));if(_0x4f4172[_0xbd95('0x2a')][_0xbd95('0x33')]){_0x462213[_0xbd95('0x30')]=_[_0xbd95('0x35')](_0x462213[_0xbd95('0x30')],{'$or':_['map'](_0x462213[_0xbd95('0x2e')],function(_0x5004af){var _0x283bc8={};_0x283bc8[_0x5004af]={'$like':'%'+_0x4f4172['query'][_0xbd95('0x33')]+'%'};return _0x283bc8;})});}_0x462213=_[_0xbd95('0x35')]({},_0x462213,_0x4f4172['options']);return _0x121202['getSubjects'](_0x462213);}})[_0xbd95('0x37')](function(_0x46b942){if(_0x46b942){_0x2accdd=_0x46b942[_0xbd95('0x3e')];if(!_0x4f4172[_0xbd95('0x2a')][_0xbd95('0x4b')](_0xbd95('0x49'))){_0x462213[_0xbd95('0x1b')]=qs[_0xbd95('0x1b')](_0x4f4172[_0xbd95('0x2a')][_0xbd95('0x1b')]);_0x462213['offset']=qs[_0xbd95('0x1a')](_0x4f4172['query'][_0xbd95('0x1a')]);}return _0x121202[_0xbd95('0x4a')](_0x462213);}})['then'](function(_0x1537e5){if(_0x1537e5){return _0x1537e5?{'count':_0x2accdd,'rows':_0x1537e5}:null;}})[_0xbd95('0x37')](respondWithResult(_0x5c952b,null))[_0xbd95('0x3b')](handleError(_0x5c952b,null));};exports['getDescriptions']=function(_0x120c12,_0x5ef284,_0x569277){var _0x440ee1={};var _0x4a247f={};var _0x32f4d3;var _0x33b24e;return db['VtigerConfiguration'][_0xbd95('0x44')]({'where':{'id':_0x120c12['params']['id']}})[_0xbd95('0x37')](handleEntityNotFound(_0x5ef284,null))[_0xbd95('0x37')](function(_0x2d2a20){if(_0x2d2a20){_0x32f4d3=_0x2d2a20;_0x4a247f[_0xbd95('0x28')]=_['keys'](db[_0xbd95('0x45')][_0xbd95('0x46')]);_0x4a247f[_0xbd95('0x2a')]=_[_0xbd95('0x2b')](_0x120c12[_0xbd95('0x2a')]);_0x4a247f[_0xbd95('0x31')]=_['intersection'](_0x4a247f[_0xbd95('0x28')],_0x4a247f[_0xbd95('0x2a')]);_0x440ee1[_0xbd95('0x2e')]=_[_0xbd95('0x2c')](_0x4a247f[_0xbd95('0x28')],qs[_0xbd95('0x2d')](_0x120c12[_0xbd95('0x2a')]['fields']));_0x440ee1[_0xbd95('0x2e')]=_0x440ee1['attributes'][_0xbd95('0x3e')]?_0x440ee1[_0xbd95('0x2e')]:_0x4a247f[_0xbd95('0x28')];_0x440ee1['order']=qs[_0xbd95('0x2f')](_0x120c12[_0xbd95('0x2a')]['sort']);_0x440ee1[_0xbd95('0x30')]=qs[_0xbd95('0x31')](_[_0xbd95('0x32')](_0x120c12[_0xbd95('0x2a')],_0x4a247f['filters']));if(_0x120c12[_0xbd95('0x2a')][_0xbd95('0x33')]){_0x440ee1[_0xbd95('0x30')]=_[_0xbd95('0x35')](_0x440ee1[_0xbd95('0x30')],{'$or':_[_0xbd95('0x29')](_0x440ee1[_0xbd95('0x2e')],function(_0xbc57b6){var _0xe9b504={};_0xe9b504[_0xbc57b6]={'$like':'%'+_0x120c12['query'][_0xbd95('0x33')]+'%'};return _0xe9b504;})});}_0x440ee1=_['merge']({},_0x440ee1,_0x120c12[_0xbd95('0x40')]);return _0x32f4d3[_0xbd95('0x4c')](_0x440ee1);}})['then'](function(_0x5b76c4){if(_0x5b76c4){_0x33b24e=_0x5b76c4[_0xbd95('0x3e')];if(!_0x120c12[_0xbd95('0x2a')][_0xbd95('0x4b')](_0xbd95('0x49'))){_0x440ee1[_0xbd95('0x1b')]=qs[_0xbd95('0x1b')](_0x120c12[_0xbd95('0x2a')]['limit']);_0x440ee1[_0xbd95('0x1a')]=qs[_0xbd95('0x1a')](_0x120c12[_0xbd95('0x2a')]['offset']);}return _0x32f4d3['getDescriptions'](_0x440ee1);}})['then'](function(_0x5227ca){if(_0x5227ca){return _0x5227ca?{'count':_0x33b24e,'rows':_0x5227ca}:null;}})['then'](respondWithResult(_0x5ef284,null))['catch'](handleError(_0x5ef284,null));};
\ No newline at end of file
+var _0x931e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','VtigerConfiguration','findAll','catch','show','fields','find','create','body','params','destroy','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x22d9c8,_0x3a19d9){var _0x27bcac=function(_0x3981fd){while(--_0x3981fd){_0x22d9c8['push'](_0x22d9c8['shift']());}};_0x27bcac(++_0x3a19d9);}(_0x931e,0xdd));var _0xe931=function(_0x4c3390,_0x584d06){_0x4c3390=_0x4c3390-0x0;var _0x33214d=_0x931e[_0x4c3390];return _0x33214d;};'use strict';var emlformat=require(_0xe931('0x0'));var rimraf=require(_0xe931('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe931('0x2'));var moment=require(_0xe931('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe931('0x4'));var util=require(_0xe931('0x5'));var path=require(_0xe931('0x6'));var sox=require('sox');var csv=require(_0xe931('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe931('0x8'));var _=require(_0xe931('0x9'));var squel=require(_0xe931('0xa'));var crypto=require(_0xe931('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe931('0xc'));var toCsv=require(_0xe931('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe931('0xd'));var as=require(_0xe931('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe931('0xf'))(_0xe931('0x10'));var utils=require(_0xe931('0x11'));var config=require(_0xe931('0x12'));var licenseUtil=require(_0xe931('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a04f3,_0x2fba4d){_0x2fba4d=_0x2fba4d||0xcc;return function(_0x12afcf){if(_0x12afcf){return _0x4a04f3[_0xe931('0x14')](_0x2fba4d);}return _0x4a04f3['status'](_0x2fba4d)[_0xe931('0x15')]();};}function respondWithResult(_0x47d8b8,_0x581ef8){_0x581ef8=_0x581ef8||0xc8;return function(_0x4ffaf0){if(_0x4ffaf0){return _0x47d8b8[_0xe931('0x16')](_0x581ef8)['json'](_0x4ffaf0);}};}function respondWithFilteredResult(_0x1d5731,_0x456118){return function(_0x5e9fd8){if(_0x5e9fd8){var _0xfc5559=typeof _0x456118[_0xe931('0x17')]===_0xe931('0x18')&&typeof _0x456118[_0xe931('0x19')]===_0xe931('0x18');var _0x45f540=_0x5e9fd8[_0xe931('0x1a')];var _0x283b96=_0xfc5559?0x0:_0x456118[_0xe931('0x17')];var _0x3e9143=_0xfc5559?_0x5e9fd8[_0xe931('0x1a')]:_0x456118[_0xe931('0x17')]+_0x456118['limit'];var _0x36acd5;if(_0x3e9143>=_0x45f540){_0x3e9143=_0x45f540;_0x36acd5=0xc8;}else{_0x36acd5=0xce;}_0x1d5731[_0xe931('0x16')](_0x36acd5);return _0x1d5731[_0xe931('0x1b')](_0xe931('0x1c'),_0x283b96+'-'+_0x3e9143+'/'+_0x45f540)[_0xe931('0x1d')](_0x5e9fd8);}return null;};}function patchUpdates(_0x588e38){return function(_0xb0df4f){try{jsonpatch[_0xe931('0x1e')](_0xb0df4f,_0x588e38,!![]);}catch(_0x1dd1b4){return BPromise[_0xe931('0x1f')](_0x1dd1b4);}return _0xb0df4f[_0xe931('0x20')]();};}function saveUpdates(_0x56fd93,_0x4e1155){return function(_0x20e788){if(_0x20e788){return _0x20e788[_0xe931('0x21')](_0x56fd93)[_0xe931('0x22')](function(_0xca46f3){return _0xca46f3;});}return null;};}function removeEntity(_0xb49319,_0x52828f){return function(_0x1ca536){if(_0x1ca536){return _0x1ca536['destroy']()[_0xe931('0x22')](function(){_0xb49319[_0xe931('0x16')](0xcc)[_0xe931('0x15')]();});}};}function handleEntityNotFound(_0x31200e,_0x145f53){return function(_0x20dda1){if(!_0x20dda1){_0x31200e[_0xe931('0x14')](0x194);}return _0x20dda1;};}function handleError(_0xef002a,_0x382929){_0x382929=_0x382929||0x1f4;return function(_0x3b7b51){logger['error'](_0x3b7b51[_0xe931('0x23')]);if(_0x3b7b51[_0xe931('0x24')]){delete _0x3b7b51[_0xe931('0x24')];}_0xef002a[_0xe931('0x16')](_0x382929)[_0xe931('0x25')](_0x3b7b51);};}exports[_0xe931('0x26')]=function(_0xdde6cc,_0x583fdf){var _0x20696f={},_0x279575={},_0x2ac41e={'count':0x0,'rows':[]};var _0x337e31=_[_0xe931('0x27')](db['VtigerConfiguration'][_0xe931('0x28')],function(_0x309eaa){return{'name':_0x309eaa[_0xe931('0x29')],'type':_0x309eaa[_0xe931('0x2a')][_0xe931('0x2b')]};});_0x279575[_0xe931('0x2c')]=_[_0xe931('0x27')](_0x337e31,'name');_0x279575[_0xe931('0x2d')]=_[_0xe931('0x2e')](_0xdde6cc[_0xe931('0x2d')]);_0x279575[_0xe931('0x2f')]=_[_0xe931('0x30')](_0x279575[_0xe931('0x2c')],_0x279575[_0xe931('0x2d')]);_0x20696f[_0xe931('0x31')]=_[_0xe931('0x30')](_0x279575[_0xe931('0x2c')],qs['fields'](_0xdde6cc[_0xe931('0x2d')]['fields']));_0x20696f[_0xe931('0x31')]=_0x20696f[_0xe931('0x31')][_0xe931('0x32')]?_0x20696f[_0xe931('0x31')]:_0x279575[_0xe931('0x2c')];if(!_0xdde6cc[_0xe931('0x2d')][_0xe931('0x33')](_0xe931('0x34'))){_0x20696f['limit']=qs[_0xe931('0x19')](_0xdde6cc[_0xe931('0x2d')][_0xe931('0x19')]);_0x20696f['offset']=qs[_0xe931('0x17')](_0xdde6cc['query'][_0xe931('0x17')]);}_0x20696f[_0xe931('0x35')]=qs[_0xe931('0x36')](_0xdde6cc[_0xe931('0x2d')][_0xe931('0x36')]);_0x20696f[_0xe931('0x37')]=qs[_0xe931('0x2f')](_['pick'](_0xdde6cc['query'],_0x279575[_0xe931('0x2f')]),_0x337e31);if(_0xdde6cc[_0xe931('0x2d')][_0xe931('0x38')]){_0x20696f[_0xe931('0x37')]=_[_0xe931('0x39')](_0x20696f[_0xe931('0x37')],{'$or':_[_0xe931('0x27')](_0x337e31,function(_0x240131){if(_0x240131[_0xe931('0x2a')]!==_0xe931('0x3a')){var _0x5adb36={};_0x5adb36[_0x240131['name']]={'$like':'%'+_0xdde6cc[_0xe931('0x2d')][_0xe931('0x38')]+'%'};return _0x5adb36;}})});}_0x20696f=_['merge']({},_0x20696f,_0xdde6cc[_0xe931('0x3b')]);var _0x104de3={'where':_0x20696f[_0xe931('0x37')]};return db['VtigerConfiguration']['count'](_0x104de3)[_0xe931('0x22')](function(_0x12a27b){_0x2ac41e[_0xe931('0x1a')]=_0x12a27b;if(_0xdde6cc[_0xe931('0x2d')][_0xe931('0x3c')]){_0x20696f[_0xe931('0x3d')]=[{'all':!![]}];}return db[_0xe931('0x3e')][_0xe931('0x3f')](_0x20696f);})[_0xe931('0x22')](function(_0x563ba0){_0x2ac41e['rows']=_0x563ba0;return _0x2ac41e;})[_0xe931('0x22')](respondWithFilteredResult(_0x583fdf,_0x20696f))[_0xe931('0x40')](handleError(_0x583fdf,null));};exports[_0xe931('0x41')]=function(_0x435ad6,_0x115191){var _0x22ee72={'raw':![],'where':{'id':_0x435ad6['params']['id']}},_0x427755={};_0x427755['model']=_[_0xe931('0x2e')](db[_0xe931('0x3e')][_0xe931('0x28')]);_0x427755[_0xe931('0x2d')]=_[_0xe931('0x2e')](_0x435ad6[_0xe931('0x2d')]);_0x427755[_0xe931('0x2f')]=_['intersection'](_0x427755[_0xe931('0x2c')],_0x427755[_0xe931('0x2d')]);_0x22ee72['attributes']=_['intersection'](_0x427755['model'],qs['fields'](_0x435ad6[_0xe931('0x2d')][_0xe931('0x42')]));_0x22ee72[_0xe931('0x31')]=_0x22ee72[_0xe931('0x31')][_0xe931('0x32')]?_0x22ee72[_0xe931('0x31')]:_0x427755['model'];if(_0x435ad6[_0xe931('0x2d')][_0xe931('0x3c')]){_0x22ee72['include']=[{'all':!![]}];}_0x22ee72=_['merge']({},_0x22ee72,_0x435ad6[_0xe931('0x3b')]);return db[_0xe931('0x3e')][_0xe931('0x43')](_0x22ee72)[_0xe931('0x22')](handleEntityNotFound(_0x115191,null))[_0xe931('0x22')](respondWithResult(_0x115191,null))[_0xe931('0x40')](handleError(_0x115191,null));};exports[_0xe931('0x44')]=function(_0x3f3158,_0x433fcb){return db['VtigerConfiguration'][_0xe931('0x44')](_0x3f3158[_0xe931('0x45')],{})['then'](respondWithResult(_0x433fcb,0xc9))[_0xe931('0x40')](handleError(_0x433fcb,null));};exports[_0xe931('0x21')]=function(_0x51a6ba,_0x10304f){if(_0x51a6ba[_0xe931('0x45')]['id']){delete _0x51a6ba[_0xe931('0x45')]['id'];}return db[_0xe931('0x3e')][_0xe931('0x43')]({'where':{'id':_0x51a6ba[_0xe931('0x46')]['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x10304f,null))[_0xe931('0x22')](saveUpdates(_0x51a6ba[_0xe931('0x45')],null))[_0xe931('0x22')](respondWithResult(_0x10304f,null))[_0xe931('0x40')](handleError(_0x10304f,null));};exports[_0xe931('0x47')]=function(_0x558eea,_0x4e7ff4){return db[_0xe931('0x3e')]['find']({'where':{'id':_0x558eea[_0xe931('0x46')]['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x4e7ff4,null))[_0xe931('0x22')](removeEntity(_0x4e7ff4,null))[_0xe931('0x40')](handleError(_0x4e7ff4,null));};exports[_0xe931('0x48')]=function(_0x58044b,_0x4c9919,_0x2b6ac5){var _0x5bc0f7={};var _0x46a0cd={};var _0x1b45d6;var _0x38fae6;return db[_0xe931('0x3e')][_0xe931('0x49')]({'where':{'id':_0x58044b[_0xe931('0x46')]['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x4c9919,null))['then'](function(_0x1be2c7){if(_0x1be2c7){_0x1b45d6=_0x1be2c7;_0x46a0cd[_0xe931('0x2c')]=_[_0xe931('0x2e')](db[_0xe931('0x4a')]['rawAttributes']);_0x46a0cd[_0xe931('0x2d')]=_[_0xe931('0x2e')](_0x58044b[_0xe931('0x2d')]);_0x46a0cd[_0xe931('0x2f')]=_['intersection'](_0x46a0cd[_0xe931('0x2c')],_0x46a0cd['query']);_0x5bc0f7['attributes']=_['intersection'](_0x46a0cd[_0xe931('0x2c')],qs[_0xe931('0x42')](_0x58044b[_0xe931('0x2d')]['fields']));_0x5bc0f7['attributes']=_0x5bc0f7[_0xe931('0x31')][_0xe931('0x32')]?_0x5bc0f7[_0xe931('0x31')]:_0x46a0cd[_0xe931('0x2c')];_0x5bc0f7[_0xe931('0x35')]=qs[_0xe931('0x36')](_0x58044b[_0xe931('0x2d')][_0xe931('0x36')]);_0x5bc0f7['where']=qs[_0xe931('0x2f')](_[_0xe931('0x4b')](_0x58044b[_0xe931('0x2d')],_0x46a0cd[_0xe931('0x2f')]));if(_0x58044b[_0xe931('0x2d')][_0xe931('0x38')]){_0x5bc0f7[_0xe931('0x37')]=_['merge'](_0x5bc0f7[_0xe931('0x37')],{'$or':_['map'](_0x5bc0f7[_0xe931('0x31')],function(_0x1a09f2){var _0x5edc9d={};_0x5edc9d[_0x1a09f2]={'$like':'%'+_0x58044b['query']['filter']+'%'};return _0x5edc9d;})});}_0x5bc0f7=_[_0xe931('0x39')]({},_0x5bc0f7,_0x58044b[_0xe931('0x3b')]);return _0x1b45d6[_0xe931('0x48')](_0x5bc0f7);}})['then'](function(_0x6994ad){if(_0x6994ad){_0x38fae6=_0x6994ad[_0xe931('0x32')];if(!_0x58044b[_0xe931('0x2d')][_0xe931('0x33')](_0xe931('0x34'))){_0x5bc0f7[_0xe931('0x19')]=qs[_0xe931('0x19')](_0x58044b[_0xe931('0x2d')]['limit']);_0x5bc0f7['offset']=qs['offset'](_0x58044b[_0xe931('0x2d')][_0xe931('0x17')]);}return _0x1b45d6['getFields'](_0x5bc0f7);}})[_0xe931('0x22')](function(_0xc9b5fa){if(_0xc9b5fa){return _0xc9b5fa?{'count':_0x38fae6,'rows':_0xc9b5fa}:null;}})[_0xe931('0x22')](respondWithResult(_0x4c9919,null))[_0xe931('0x40')](handleError(_0x4c9919,null));};exports[_0xe931('0x4c')]=function(_0x4a8dfe,_0x1c12ec,_0x391db1){var _0x4d37ca={};var _0x326c36={};var _0x31cb93;var _0x29d93b;return db[_0xe931('0x3e')][_0xe931('0x49')]({'where':{'id':_0x4a8dfe['params']['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x1c12ec,null))[_0xe931('0x22')](function(_0x476f16){if(_0x476f16){_0x31cb93=_0x476f16;_0x326c36[_0xe931('0x2c')]=_[_0xe931('0x2e')](db['VtigerField']['rawAttributes']);_0x326c36[_0xe931('0x2d')]=_[_0xe931('0x2e')](_0x4a8dfe[_0xe931('0x2d')]);_0x326c36[_0xe931('0x2f')]=_[_0xe931('0x30')](_0x326c36[_0xe931('0x2c')],_0x326c36[_0xe931('0x2d')]);_0x4d37ca[_0xe931('0x31')]=_['intersection'](_0x326c36[_0xe931('0x2c')],qs[_0xe931('0x42')](_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x42')]));_0x4d37ca[_0xe931('0x31')]=_0x4d37ca[_0xe931('0x31')][_0xe931('0x32')]?_0x4d37ca['attributes']:_0x326c36['model'];_0x4d37ca[_0xe931('0x35')]=qs[_0xe931('0x36')](_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x36')]);_0x4d37ca[_0xe931('0x37')]=qs[_0xe931('0x2f')](_[_0xe931('0x4b')](_0x4a8dfe[_0xe931('0x2d')],_0x326c36[_0xe931('0x2f')]));if(_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x38')]){_0x4d37ca[_0xe931('0x37')]=_['merge'](_0x4d37ca[_0xe931('0x37')],{'$or':_[_0xe931('0x27')](_0x4d37ca[_0xe931('0x31')],function(_0x3e34cb){var _0x49b852={};_0x49b852[_0x3e34cb]={'$like':'%'+_0x4a8dfe['query']['filter']+'%'};return _0x49b852;})});}_0x4d37ca=_['merge']({},_0x4d37ca,_0x4a8dfe[_0xe931('0x3b')]);return _0x31cb93['getSubjects'](_0x4d37ca);}})['then'](function(_0x18fd8){if(_0x18fd8){_0x29d93b=_0x18fd8['length'];if(!_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x33')](_0xe931('0x34'))){_0x4d37ca[_0xe931('0x19')]=qs[_0xe931('0x19')](_0x4a8dfe[_0xe931('0x2d')]['limit']);_0x4d37ca['offset']=qs[_0xe931('0x17')](_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x17')]);}return _0x31cb93[_0xe931('0x4c')](_0x4d37ca);}})[_0xe931('0x22')](function(_0x14c1b0){if(_0x14c1b0){return _0x14c1b0?{'count':_0x29d93b,'rows':_0x14c1b0}:null;}})[_0xe931('0x22')](respondWithResult(_0x1c12ec,null))['catch'](handleError(_0x1c12ec,null));};exports['getDescriptions']=function(_0x11f588,_0x3c09c6,_0x1e85a6){var _0x3dbcd9={};var _0x150535={};var _0x714fd4;var _0x56fe10;return db['VtigerConfiguration'][_0xe931('0x49')]({'where':{'id':_0x11f588['params']['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x3c09c6,null))['then'](function(_0x3aacdc){if(_0x3aacdc){_0x714fd4=_0x3aacdc;_0x150535['model']=_[_0xe931('0x2e')](db[_0xe931('0x4a')][_0xe931('0x28')]);_0x150535['query']=_[_0xe931('0x2e')](_0x11f588[_0xe931('0x2d')]);_0x150535['filters']=_[_0xe931('0x30')](_0x150535[_0xe931('0x2c')],_0x150535['query']);_0x3dbcd9[_0xe931('0x31')]=_[_0xe931('0x30')](_0x150535[_0xe931('0x2c')],qs[_0xe931('0x42')](_0x11f588[_0xe931('0x2d')][_0xe931('0x42')]));_0x3dbcd9[_0xe931('0x31')]=_0x3dbcd9[_0xe931('0x31')]['length']?_0x3dbcd9[_0xe931('0x31')]:_0x150535[_0xe931('0x2c')];_0x3dbcd9['order']=qs[_0xe931('0x36')](_0x11f588[_0xe931('0x2d')][_0xe931('0x36')]);_0x3dbcd9['where']=qs[_0xe931('0x2f')](_[_0xe931('0x4b')](_0x11f588['query'],_0x150535[_0xe931('0x2f')]));if(_0x11f588[_0xe931('0x2d')][_0xe931('0x38')]){_0x3dbcd9[_0xe931('0x37')]=_[_0xe931('0x39')](_0x3dbcd9[_0xe931('0x37')],{'$or':_[_0xe931('0x27')](_0x3dbcd9[_0xe931('0x31')],function(_0x258684){var _0x781779={};_0x781779[_0x258684]={'$like':'%'+_0x11f588[_0xe931('0x2d')][_0xe931('0x38')]+'%'};return _0x781779;})});}_0x3dbcd9=_['merge']({},_0x3dbcd9,_0x11f588[_0xe931('0x3b')]);return _0x714fd4[_0xe931('0x4d')](_0x3dbcd9);}})['then'](function(_0x4e108a){if(_0x4e108a){_0x56fe10=_0x4e108a['length'];if(!_0x11f588['query'][_0xe931('0x33')](_0xe931('0x34'))){_0x3dbcd9[_0xe931('0x19')]=qs[_0xe931('0x19')](_0x11f588[_0xe931('0x2d')][_0xe931('0x19')]);_0x3dbcd9['offset']=qs[_0xe931('0x17')](_0x11f588[_0xe931('0x2d')][_0xe931('0x17')]);}return _0x714fd4[_0xe931('0x4d')](_0x3dbcd9);}})[_0xe931('0x22')](function(_0x58c48b){if(_0x58c48b){return _0x58c48b?{'count':_0x56fe10,'rows':_0x58c48b}:null;}})['then'](respondWithResult(_0x3c09c6,null))[_0xe931('0x40')](handleError(_0x3c09c6,null));};
\ No newline at end of file
index a3e2be5..0eeacc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207a=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x447558,_0x220aba){var _0x559c80=function(_0x5f3b7e){while(--_0x5f3b7e){_0x447558['push'](_0x447558['shift']());}};_0x559c80(++_0x220aba);}(_0x207a,0x1c3));var _0xa207=function(_0x531c31,_0x30804e){_0x531c31=_0x531c31-0x0;var _0x234a39=_0x207a[_0x531c31];return _0x234a39;};'use strict';var _=require(_0xa207('0x0'));var util=require('util');var logger=require(_0xa207('0x1'))(_0xa207('0x2'));var moment=require(_0xa207('0x3'));var BPromise=require(_0xa207('0x4'));var rp=require(_0xa207('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa207('0x6'));var attributes=require(_0xa207('0x7'));module['exports']=function(_0x39f1f2,_0x5aeb6c){return _0x39f1f2[_0xa207('0x8')](_0xa207('0x9'),attributes,{'tableName':_0xa207('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63a3=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash','util'];(function(_0x667c6a,_0x2155cd){var _0x36396a=function(_0x29d602){while(--_0x29d602){_0x667c6a['push'](_0x667c6a['shift']());}};_0x36396a(++_0x2155cd);}(_0x63a3,0x170));var _0x363a=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x63a3[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x363a('0x0'));var util=require(_0x363a('0x1'));var logger=require(_0x363a('0x2'))('api');var moment=require(_0x363a('0x3'));var BPromise=require(_0x363a('0x4'));var rp=require(_0x363a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x363a('0x6'));var attributes=require(_0x363a('0x7'));module[_0x363a('0x8')]=function(_0x3ab702,_0x582e12){return _0x3ab702['define'](_0x363a('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d28307e..53909d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb237=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb237,0xd7));var _0x7b23=function(_0x203077,_0x3e85d5){_0x203077=_0x203077-0x0;var _0x75ff1f=_0xb237[_0x203077];return _0x75ff1f;};'use strict';var _=require('lodash');var util=require(_0x7b23('0x0'));var moment=require(_0x7b23('0x1'));var BPromise=require(_0x7b23('0x2'));var rs=require(_0x7b23('0x3'));var fs=require('fs');var Redis=require(_0x7b23('0x4'));var db=require(_0x7b23('0x5'))['db'];var utils=require(_0x7b23('0x6'));var logger=require(_0x7b23('0x7'))(_0x7b23('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7b23('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9bfce2,_0x488280,_0x45d596){return new BPromise(function(_0x361eb2,_0xfdd22b){return client[_0x7b23('0xa')](_0x9bfce2,_0x45d596)[_0x7b23('0xb')](function(_0x255e69){logger['info'](_0x7b23('0xc'),_0x488280,_0x7b23('0xd'));logger[_0x7b23('0xe')](_0x7b23('0xf'),_0x488280,_0x7b23('0xd'),JSON[_0x7b23('0x10')](_0x255e69));if(_0x255e69[_0x7b23('0x11')]){if(_0x255e69[_0x7b23('0x11')][_0x7b23('0x12')]===0x1f4){logger[_0x7b23('0x11')](_0x7b23('0xc'),_0x488280,_0x255e69[_0x7b23('0x11')][_0x7b23('0x13')]);return _0xfdd22b(_0x255e69[_0x7b23('0x11')][_0x7b23('0x13')]);}logger[_0x7b23('0x11')](_0x7b23('0xc'),_0x488280,_0x255e69[_0x7b23('0x11')][_0x7b23('0x13')]);return _0x361eb2(_0x255e69[_0x7b23('0x11')][_0x7b23('0x13')]);}else{logger[_0x7b23('0x14')](_0x7b23('0xc'),_0x488280,_0x7b23('0xd'));_0x361eb2(_0x255e69[_0x7b23('0x15')][_0x7b23('0x13')]);}})['catch'](function(_0x5870eb){logger['error'](_0x7b23('0xc'),_0x488280,_0x5870eb);_0xfdd22b(_0x5870eb);});});}
\ No newline at end of file
+var _0x4665=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','lodash','util'];(function(_0x198373,_0x82a53a){var _0xa6d376=function(_0x24521b){while(--_0x24521b){_0x198373['push'](_0x198373['shift']());}};_0xa6d376(++_0x82a53a);}(_0x4665,0x1a2));var _0x5466=function(_0x3383ca,_0x30666d){_0x3383ca=_0x3383ca-0x0;var _0x1fd694=_0x4665[_0x3383ca];return _0x1fd694;};'use strict';var _=require(_0x5466('0x0'));var util=require(_0x5466('0x1'));var moment=require('moment');var BPromise=require(_0x5466('0x2'));var rs=require(_0x5466('0x3'));var fs=require('fs');var Redis=require(_0x5466('0x4'));var db=require(_0x5466('0x5'))['db'];var utils=require(_0x5466('0x6'));var logger=require(_0x5466('0x7'))(_0x5466('0x8'));var config=require(_0x5466('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5466('0xa')][_0x5466('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fb3cc,_0x1e2ea8,_0x79f00a){return new BPromise(function(_0x670e27,_0x5e3a06){return client[_0x5466('0xc')](_0x4fb3cc,_0x79f00a)[_0x5466('0xd')](function(_0x25a199){logger['info'](_0x5466('0xe'),_0x1e2ea8,'request\x20sent');logger['debug'](_0x5466('0xf'),_0x1e2ea8,_0x5466('0x10'),JSON['stringify'](_0x25a199));if(_0x25a199[_0x5466('0x11')]){if(_0x25a199['error']['code']===0x1f4){logger[_0x5466('0x11')](_0x5466('0xe'),_0x1e2ea8,_0x25a199['error'][_0x5466('0x12')]);return _0x5e3a06(_0x25a199[_0x5466('0x11')]['message']);}logger[_0x5466('0x11')](_0x5466('0xe'),_0x1e2ea8,_0x25a199['error'][_0x5466('0x12')]);return _0x670e27(_0x25a199[_0x5466('0x11')]['message']);}else{logger[_0x5466('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x1e2ea8,_0x5466('0x10'));_0x670e27(_0x25a199['result'][_0x5466('0x12')]);}})['catch'](function(_0x456ac2){logger[_0x5466('0x11')](_0x5466('0xe'),_0x1e2ea8,_0x456ac2);_0x5e3a06(_0x456ac2);});});}
\ No newline at end of file
index 17458a3..59b14f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c38=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','get','/:id','show','post','delete','destroy','util'];(function(_0x39d366,_0x5b816d){var _0x16633c=function(_0x4abdbd){while(--_0x4abdbd){_0x39d366['push'](_0x39d366['shift']());}};_0x16633c(++_0x5b816d);}(_0x9c38,0xb3));var _0x89c3=function(_0x39c633,_0x156571){_0x39c633=_0x39c633-0x0;var _0x581072=_0x9c38[_0x39c633];return _0x581072;};'use strict';var multer=require('multer');var util=require(_0x89c3('0x0'));var path=require(_0x89c3('0x1'));var timeout=require(_0x89c3('0x2'));var express=require(_0x89c3('0x3'));var router=express['Router']();var fs_extra=require(_0x89c3('0x4'));var auth=require(_0x89c3('0x5'));var interaction=require(_0x89c3('0x6'));var config=require('../../config/environment');var controller=require(_0x89c3('0x7'));router['get']('/',auth[_0x89c3('0x8')](),controller['index']);router[_0x89c3('0x9')](_0x89c3('0xa'),auth[_0x89c3('0x8')](),controller[_0x89c3('0xb')]);router[_0x89c3('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x89c3('0xa'),auth[_0x89c3('0x8')](),controller['update']);router[_0x89c3('0xd')](_0x89c3('0xa'),auth[_0x89c3('0x8')](),controller[_0x89c3('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xfc94=['multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','update','destroy'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0xfc94,0x12c));var _0x4fc9=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xfc94[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x4fc9('0x0'));var util=require('util');var path=require(_0x4fc9('0x1'));var timeout=require(_0x4fc9('0x2'));var express=require(_0x4fc9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4fc9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4fc9('0x5'));var controller=require(_0x4fc9('0x6'));router[_0x4fc9('0x7')]('/',auth[_0x4fc9('0x8')](),controller[_0x4fc9('0x9')]);router['get'](_0x4fc9('0xa'),auth[_0x4fc9('0x8')](),controller[_0x4fc9('0xb')]);router[_0x4fc9('0xc')]('/',auth[_0x4fc9('0x8')](),controller['create']);router['put']('/:id',auth[_0x4fc9('0x8')](),controller[_0x4fc9('0xd')]);router['delete'](_0x4fc9('0xa'),auth[_0x4fc9('0x8')](),controller[_0x4fc9('0xe')]);module['exports']=router;
\ No newline at end of file
index 9a3b139..36907b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4e7=['variable','keyValue','picklist','string','STRING','BOOLEAN','ENUM'];(function(_0x3e573a,_0x5c899f){var _0x114143=function(_0x415a42){while(--_0x415a42){_0x3e573a['push'](_0x3e573a['shift']());}};_0x114143(++_0x5c899f);}(_0xa4e7,0x6f));var _0x7a4e=function(_0x38706b,_0xdf778d){_0x38706b=_0x38706b-0x0;var _0x42f598=_0xa4e7[_0x38706b];return _0x42f598;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x7a4e('0x0')]('string',_0x7a4e('0x1'),'customVariable',_0x7a4e('0x2'),_0x7a4e('0x3')),'defaultValue':_0x7a4e('0x4')},'content':{'type':Sequelize[_0x7a4e('0x5')]},'key':{'type':Sequelize[_0x7a4e('0x5')]},'keyType':{'type':Sequelize[_0x7a4e('0x0')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7a4e('0x5')]},'customField':{'type':Sequelize[_0x7a4e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7a4e('0x5')]}};
\ No newline at end of file
+var _0xd6a4=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','string'];(function(_0x1ffc22,_0x288864){var _0x103432=function(_0x1070b4){while(--_0x1070b4){_0x1ffc22['push'](_0x1ffc22['shift']());}};_0x103432(++_0x288864);}(_0xd6a4,0x1ea));var _0x4d6a=function(_0xfebe2,_0x4b7532){_0xfebe2=_0xfebe2-0x0;var _0x19b4fa=_0xd6a4[_0xfebe2];return _0x19b4fa;};'use strict';var Sequelize=require(_0x4d6a('0x0'));module[_0x4d6a('0x1')]={'type':{'type':Sequelize[_0x4d6a('0x2')]('string',_0x4d6a('0x3'),_0x4d6a('0x4'),'keyValue','picklist'),'defaultValue':_0x4d6a('0x5')},'content':{'type':Sequelize[_0x4d6a('0x6')]},'key':{'type':Sequelize[_0x4d6a('0x6')]},'keyType':{'type':Sequelize[_0x4d6a('0x2')]('string',_0x4d6a('0x3'),_0x4d6a('0x4'))},'keyContent':{'type':Sequelize[_0x4d6a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4d6a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4d6a('0x6')]}};
\ No newline at end of file
index 970c679..8aa1039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ffd=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VtigerField','includeAll','include','findAll','rows','catch','show','params','options','find','create','body'];(function(_0x288371,_0x35f999){var _0x5a1ad1=function(_0xc35a07){while(--_0xc35a07){_0x288371['push'](_0x288371['shift']());}};_0x5a1ad1(++_0x35f999);}(_0x5ffd,0x11c));var _0xd5ff=function(_0x31fd23,_0x3cd111){_0x31fd23=_0x31fd23-0x0;var _0x5be36e=_0x5ffd[_0x31fd23];return _0x5be36e;};'use strict';var emlformat=require(_0xd5ff('0x0'));var rimraf=require(_0xd5ff('0x1'));var zipdir=require(_0xd5ff('0x2'));var jsonpatch=require(_0xd5ff('0x3'));var rp=require('request-promise');var moment=require(_0xd5ff('0x4'));var BPromise=require(_0xd5ff('0x5'));var Mustache=require(_0xd5ff('0x6'));var util=require('util');var path=require(_0xd5ff('0x7'));var sox=require(_0xd5ff('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd5ff('0x9'));var _=require('lodash');var squel=require(_0xd5ff('0xa'));var crypto=require(_0xd5ff('0xb'));var jsforce=require(_0xd5ff('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd5ff('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd5ff('0xe'));var qs=require(_0xd5ff('0xf'));var as=require(_0xd5ff('0x10'));var hardwareService=require(_0xd5ff('0x11'));var logger=require('../../config/logger')(_0xd5ff('0x12'));var utils=require('../../config/utils');var config=require(_0xd5ff('0x13'));var licenseUtil=require(_0xd5ff('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25c2cf,_0x4e3a2f){_0x4e3a2f=_0x4e3a2f||0xcc;return function(_0x420795){if(_0x420795){return _0x25c2cf[_0xd5ff('0x15')](_0x4e3a2f);}return _0x25c2cf[_0xd5ff('0x16')](_0x4e3a2f)['end']();};}function respondWithResult(_0x304347,_0x63a303){_0x63a303=_0x63a303||0xc8;return function(_0x255bf6){if(_0x255bf6){return _0x304347[_0xd5ff('0x16')](_0x63a303)[_0xd5ff('0x17')](_0x255bf6);}};}function respondWithFilteredResult(_0x21dafe,_0x2f691f){return function(_0x18d5c4){if(_0x18d5c4){var _0x46bb73=typeof _0x2f691f[_0xd5ff('0x18')]==='undefined'&&typeof _0x2f691f['limit']===_0xd5ff('0x19');var _0x159ef9=_0x18d5c4[_0xd5ff('0x1a')];var _0x238ff2=_0x46bb73?0x0:_0x2f691f['offset'];var _0x25ca7c=_0x46bb73?_0x18d5c4[_0xd5ff('0x1a')]:_0x2f691f[_0xd5ff('0x18')]+_0x2f691f[_0xd5ff('0x1b')];var _0x52fc70;if(_0x25ca7c>=_0x159ef9){_0x25ca7c=_0x159ef9;_0x52fc70=0xc8;}else{_0x52fc70=0xce;}_0x21dafe[_0xd5ff('0x16')](_0x52fc70);return _0x21dafe[_0xd5ff('0x1c')](_0xd5ff('0x1d'),_0x238ff2+'-'+_0x25ca7c+'/'+_0x159ef9)[_0xd5ff('0x17')](_0x18d5c4);}return null;};}function patchUpdates(_0x2d504f){return function(_0x17ac48){try{jsonpatch['apply'](_0x17ac48,_0x2d504f,!![]);}catch(_0x36bf54){return BPromise[_0xd5ff('0x1e')](_0x36bf54);}return _0x17ac48[_0xd5ff('0x1f')]();};}function saveUpdates(_0x3ab2c0,_0x475b22){return function(_0x286272){if(_0x286272){return _0x286272[_0xd5ff('0x20')](_0x3ab2c0)[_0xd5ff('0x21')](function(_0x91224f){return _0x91224f;});}return null;};}function removeEntity(_0x2394ae,_0x4e76da){return function(_0x1d9863){if(_0x1d9863){return _0x1d9863[_0xd5ff('0x22')]()[_0xd5ff('0x21')](function(){_0x2394ae[_0xd5ff('0x16')](0xcc)[_0xd5ff('0x23')]();});}};}function handleEntityNotFound(_0x4c6ba3,_0x4f0706){return function(_0x32a447){if(!_0x32a447){_0x4c6ba3[_0xd5ff('0x15')](0x194);}return _0x32a447;};}function handleError(_0x88ad67,_0x43c548){_0x43c548=_0x43c548||0x1f4;return function(_0x426eda){logger['error'](_0x426eda['stack']);if(_0x426eda['name']){delete _0x426eda[_0xd5ff('0x24')];}_0x88ad67[_0xd5ff('0x16')](_0x43c548)[_0xd5ff('0x25')](_0x426eda);};}exports[_0xd5ff('0x26')]=function(_0x5606db,_0x7209bb){var _0x5f42bb={},_0x17243c={},_0x23a9de={'count':0x0,'rows':[]};var _0x5d2301=_[_0xd5ff('0x27')](db['VtigerField'][_0xd5ff('0x28')],function(_0x15af0d){return{'name':_0x15af0d[_0xd5ff('0x29')],'type':_0x15af0d[_0xd5ff('0x2a')][_0xd5ff('0x2b')]};});_0x17243c[_0xd5ff('0x2c')]=_['map'](_0x5d2301,_0xd5ff('0x24'));_0x17243c[_0xd5ff('0x2d')]=_[_0xd5ff('0x2e')](_0x5606db[_0xd5ff('0x2d')]);_0x17243c['filters']=_[_0xd5ff('0x2f')](_0x17243c[_0xd5ff('0x2c')],_0x17243c[_0xd5ff('0x2d')]);_0x5f42bb[_0xd5ff('0x30')]=_[_0xd5ff('0x2f')](_0x17243c[_0xd5ff('0x2c')],qs[_0xd5ff('0x31')](_0x5606db['query']['fields']));_0x5f42bb[_0xd5ff('0x30')]=_0x5f42bb[_0xd5ff('0x30')][_0xd5ff('0x32')]?_0x5f42bb[_0xd5ff('0x30')]:_0x17243c['model'];if(!_0x5606db[_0xd5ff('0x2d')][_0xd5ff('0x33')](_0xd5ff('0x34'))){_0x5f42bb[_0xd5ff('0x1b')]=qs[_0xd5ff('0x1b')](_0x5606db[_0xd5ff('0x2d')][_0xd5ff('0x1b')]);_0x5f42bb[_0xd5ff('0x18')]=qs[_0xd5ff('0x18')](_0x5606db['query'][_0xd5ff('0x18')]);}_0x5f42bb[_0xd5ff('0x35')]=qs['sort'](_0x5606db['query'][_0xd5ff('0x36')]);_0x5f42bb[_0xd5ff('0x37')]=qs[_0xd5ff('0x38')](_['pick'](_0x5606db[_0xd5ff('0x2d')],_0x17243c['filters']),_0x5d2301);if(_0x5606db[_0xd5ff('0x2d')][_0xd5ff('0x39')]){_0x5f42bb[_0xd5ff('0x37')]=_[_0xd5ff('0x3a')](_0x5f42bb['where'],{'$or':_[_0xd5ff('0x27')](_0x5d2301,function(_0x452109){if(_0x452109['type']!=='VIRTUAL'){var _0x8db645={};_0x8db645[_0x452109['name']]={'$like':'%'+_0x5606db['query']['filter']+'%'};return _0x8db645;}})});}_0x5f42bb=_[_0xd5ff('0x3a')]({},_0x5f42bb,_0x5606db['options']);var _0x5d8bb2={'where':_0x5f42bb[_0xd5ff('0x37')]};return db[_0xd5ff('0x3b')][_0xd5ff('0x1a')](_0x5d8bb2)['then'](function(_0x1e855c){_0x23a9de['count']=_0x1e855c;if(_0x5606db['query'][_0xd5ff('0x3c')]){_0x5f42bb[_0xd5ff('0x3d')]=[{'all':!![]}];}return db[_0xd5ff('0x3b')][_0xd5ff('0x3e')](_0x5f42bb);})[_0xd5ff('0x21')](function(_0x1a1e55){_0x23a9de[_0xd5ff('0x3f')]=_0x1a1e55;return _0x23a9de;})[_0xd5ff('0x21')](respondWithFilteredResult(_0x7209bb,_0x5f42bb))[_0xd5ff('0x40')](handleError(_0x7209bb,null));};exports[_0xd5ff('0x41')]=function(_0x63728f,_0x3c26d5){var _0x3e1e94={'raw':!![],'where':{'id':_0x63728f[_0xd5ff('0x42')]['id']}},_0x5067fb={};_0x5067fb[_0xd5ff('0x2c')]=_[_0xd5ff('0x2e')](db['VtigerField']['rawAttributes']);_0x5067fb[_0xd5ff('0x2d')]=_[_0xd5ff('0x2e')](_0x63728f[_0xd5ff('0x2d')]);_0x5067fb[_0xd5ff('0x38')]=_[_0xd5ff('0x2f')](_0x5067fb[_0xd5ff('0x2c')],_0x5067fb[_0xd5ff('0x2d')]);_0x3e1e94['attributes']=_[_0xd5ff('0x2f')](_0x5067fb[_0xd5ff('0x2c')],qs[_0xd5ff('0x31')](_0x63728f[_0xd5ff('0x2d')][_0xd5ff('0x31')]));_0x3e1e94[_0xd5ff('0x30')]=_0x3e1e94[_0xd5ff('0x30')][_0xd5ff('0x32')]?_0x3e1e94[_0xd5ff('0x30')]:_0x5067fb[_0xd5ff('0x2c')];if(_0x63728f['query']['includeAll']){_0x3e1e94[_0xd5ff('0x3d')]=[{'all':!![]}];}_0x3e1e94=_[_0xd5ff('0x3a')]({},_0x3e1e94,_0x63728f[_0xd5ff('0x43')]);return db['VtigerField'][_0xd5ff('0x44')](_0x3e1e94)['then'](handleEntityNotFound(_0x3c26d5,null))['then'](respondWithResult(_0x3c26d5,null))[_0xd5ff('0x40')](handleError(_0x3c26d5,null));};exports[_0xd5ff('0x45')]=function(_0x408430,_0x4d879b){return db[_0xd5ff('0x3b')][_0xd5ff('0x45')](_0x408430[_0xd5ff('0x46')],{})[_0xd5ff('0x21')](respondWithResult(_0x4d879b,0xc9))['catch'](handleError(_0x4d879b,null));};exports[_0xd5ff('0x20')]=function(_0x1e3c07,_0x2e5300){if(_0x1e3c07[_0xd5ff('0x46')]['id']){delete _0x1e3c07[_0xd5ff('0x46')]['id'];}return db['VtigerField'][_0xd5ff('0x44')]({'where':{'id':_0x1e3c07[_0xd5ff('0x42')]['id']}})[_0xd5ff('0x21')](handleEntityNotFound(_0x2e5300,null))[_0xd5ff('0x21')](saveUpdates(_0x1e3c07['body'],null))[_0xd5ff('0x21')](respondWithResult(_0x2e5300,null))['catch'](handleError(_0x2e5300,null));};exports[_0xd5ff('0x22')]=function(_0x2811df,_0x374ca2){return db['VtigerField'][_0xd5ff('0x44')]({'where':{'id':_0x2811df['params']['id']}})[_0xd5ff('0x21')](handleEntityNotFound(_0x374ca2,null))[_0xd5ff('0x21')](removeEntity(_0x374ca2,null))[_0xd5ff('0x40')](handleError(_0x374ca2,null));};
\ No newline at end of file
+var _0x26f3=['moment','bluebird','util','path','ejs','fs-extra','lodash','squel','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','sendStatus','status','end','undefined','count','offset','limit','set','reject','update','then','error','stack','name','send','index','VtigerField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','destroy','fast-json-patch','request-promise'];(function(_0xdcb59d,_0x232425){var _0x4b9cae=function(_0x1510d2){while(--_0x1510d2){_0xdcb59d['push'](_0xdcb59d['shift']());}};_0x4b9cae(++_0x232425);}(_0x26f3,0x166));var _0x326f=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0x26f3[_0x264b61];return _0x8fff4f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x326f('0x0'));var rp=require(_0x326f('0x1'));var moment=require(_0x326f('0x2'));var BPromise=require(_0x326f('0x3'));var Mustache=require('mustache');var util=require(_0x326f('0x4'));var path=require(_0x326f('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x326f('0x6'));var fs=require('fs');var fs_extra=require(_0x326f('0x7'));var _=require(_0x326f('0x8'));var squel=require(_0x326f('0x9'));var crypto=require(_0x326f('0xa'));var jsforce=require(_0x326f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x326f('0xc'));var querystring=require('querystring');var Papa=require(_0x326f('0xd'));var Redis=require(_0x326f('0xe'));var authService=require(_0x326f('0xf'));var qs=require(_0x326f('0x10'));var as=require(_0x326f('0x11'));var hardwareService=require(_0x326f('0x12'));var logger=require(_0x326f('0x13'))(_0x326f('0x14'));var utils=require(_0x326f('0x15'));var config=require(_0x326f('0x16'));var licenseUtil=require(_0x326f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2864b0,_0x39443c){_0x39443c=_0x39443c||0xcc;return function(_0x55dd9c){if(_0x55dd9c){return _0x2864b0[_0x326f('0x18')](_0x39443c);}return _0x2864b0[_0x326f('0x19')](_0x39443c)[_0x326f('0x1a')]();};}function respondWithResult(_0x4f3f6e,_0x1eba4d){_0x1eba4d=_0x1eba4d||0xc8;return function(_0x5f1c38){if(_0x5f1c38){return _0x4f3f6e[_0x326f('0x19')](_0x1eba4d)['json'](_0x5f1c38);}};}function respondWithFilteredResult(_0x5d5e77,_0x5d595b){return function(_0xdf0129){if(_0xdf0129){var _0x213981=typeof _0x5d595b['offset']===_0x326f('0x1b')&&typeof _0x5d595b['limit']===_0x326f('0x1b');var _0x117f92=_0xdf0129[_0x326f('0x1c')];var _0x5df00e=_0x213981?0x0:_0x5d595b[_0x326f('0x1d')];var _0x4293f6=_0x213981?_0xdf0129['count']:_0x5d595b['offset']+_0x5d595b[_0x326f('0x1e')];var _0x1e4c8e;if(_0x4293f6>=_0x117f92){_0x4293f6=_0x117f92;_0x1e4c8e=0xc8;}else{_0x1e4c8e=0xce;}_0x5d5e77['status'](_0x1e4c8e);return _0x5d5e77[_0x326f('0x1f')]('Content-Range',_0x5df00e+'-'+_0x4293f6+'/'+_0x117f92)['json'](_0xdf0129);}return null;};}function patchUpdates(_0x238e33){return function(_0x547311){try{jsonpatch['apply'](_0x547311,_0x238e33,!![]);}catch(_0xde80dd){return BPromise[_0x326f('0x20')](_0xde80dd);}return _0x547311['save']();};}function saveUpdates(_0x53a8e0,_0x1ee89c){return function(_0x46b36e){if(_0x46b36e){return _0x46b36e[_0x326f('0x21')](_0x53a8e0)[_0x326f('0x22')](function(_0x5c773e){return _0x5c773e;});}return null;};}function removeEntity(_0x4a66a8,_0x49fd10){return function(_0x2b4bd1){if(_0x2b4bd1){return _0x2b4bd1['destroy']()[_0x326f('0x22')](function(){_0x4a66a8[_0x326f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a8bf,_0x1b7537){return function(_0x2e39d0){if(!_0x2e39d0){_0x55a8bf[_0x326f('0x18')](0x194);}return _0x2e39d0;};}function handleError(_0x2d2401,_0x527c74){_0x527c74=_0x527c74||0x1f4;return function(_0x4e9d0a){logger[_0x326f('0x23')](_0x4e9d0a[_0x326f('0x24')]);if(_0x4e9d0a[_0x326f('0x25')]){delete _0x4e9d0a[_0x326f('0x25')];}_0x2d2401[_0x326f('0x19')](_0x527c74)[_0x326f('0x26')](_0x4e9d0a);};}exports[_0x326f('0x27')]=function(_0x53f104,_0x2e15c1){var _0x2fcb19={},_0xa6eefa={},_0x5e601a={'count':0x0,'rows':[]};var _0x29df1c=_['map'](db[_0x326f('0x28')][_0x326f('0x29')],function(_0x5c152d){return{'name':_0x5c152d['fieldName'],'type':_0x5c152d[_0x326f('0x2a')][_0x326f('0x2b')]};});_0xa6eefa[_0x326f('0x2c')]=_[_0x326f('0x2d')](_0x29df1c,_0x326f('0x25'));_0xa6eefa[_0x326f('0x2e')]=_[_0x326f('0x2f')](_0x53f104[_0x326f('0x2e')]);_0xa6eefa[_0x326f('0x30')]=_[_0x326f('0x31')](_0xa6eefa['model'],_0xa6eefa[_0x326f('0x2e')]);_0x2fcb19[_0x326f('0x32')]=_[_0x326f('0x31')](_0xa6eefa[_0x326f('0x2c')],qs[_0x326f('0x33')](_0x53f104[_0x326f('0x2e')]['fields']));_0x2fcb19[_0x326f('0x32')]=_0x2fcb19[_0x326f('0x32')][_0x326f('0x34')]?_0x2fcb19[_0x326f('0x32')]:_0xa6eefa['model'];if(!_0x53f104[_0x326f('0x2e')][_0x326f('0x35')]('nolimit')){_0x2fcb19[_0x326f('0x1e')]=qs[_0x326f('0x1e')](_0x53f104[_0x326f('0x2e')][_0x326f('0x1e')]);_0x2fcb19[_0x326f('0x1d')]=qs[_0x326f('0x1d')](_0x53f104[_0x326f('0x2e')][_0x326f('0x1d')]);}_0x2fcb19[_0x326f('0x36')]=qs[_0x326f('0x37')](_0x53f104[_0x326f('0x2e')][_0x326f('0x37')]);_0x2fcb19[_0x326f('0x38')]=qs[_0x326f('0x30')](_[_0x326f('0x39')](_0x53f104[_0x326f('0x2e')],_0xa6eefa[_0x326f('0x30')]),_0x29df1c);if(_0x53f104[_0x326f('0x2e')]['filter']){_0x2fcb19['where']=_[_0x326f('0x3a')](_0x2fcb19[_0x326f('0x38')],{'$or':_[_0x326f('0x2d')](_0x29df1c,function(_0x27c1ed){if(_0x27c1ed[_0x326f('0x2a')]!==_0x326f('0x3b')){var _0x5b6a8b={};_0x5b6a8b[_0x27c1ed[_0x326f('0x25')]]={'$like':'%'+_0x53f104[_0x326f('0x2e')][_0x326f('0x3c')]+'%'};return _0x5b6a8b;}})});}_0x2fcb19=_[_0x326f('0x3a')]({},_0x2fcb19,_0x53f104['options']);var _0xa9aa81={'where':_0x2fcb19[_0x326f('0x38')]};return db[_0x326f('0x28')][_0x326f('0x1c')](_0xa9aa81)[_0x326f('0x22')](function(_0x5196b2){_0x5e601a[_0x326f('0x1c')]=_0x5196b2;if(_0x53f104[_0x326f('0x2e')][_0x326f('0x3d')]){_0x2fcb19[_0x326f('0x3e')]=[{'all':!![]}];}return db[_0x326f('0x28')][_0x326f('0x3f')](_0x2fcb19);})['then'](function(_0x1ad9ec){_0x5e601a[_0x326f('0x40')]=_0x1ad9ec;return _0x5e601a;})[_0x326f('0x22')](respondWithFilteredResult(_0x2e15c1,_0x2fcb19))[_0x326f('0x41')](handleError(_0x2e15c1,null));};exports[_0x326f('0x42')]=function(_0x3bf6f7,_0x4e45ad){var _0xe432ab={'raw':!![],'where':{'id':_0x3bf6f7['params']['id']}},_0x4e8b54={};_0x4e8b54[_0x326f('0x2c')]=_[_0x326f('0x2f')](db[_0x326f('0x28')][_0x326f('0x29')]);_0x4e8b54[_0x326f('0x2e')]=_[_0x326f('0x2f')](_0x3bf6f7[_0x326f('0x2e')]);_0x4e8b54[_0x326f('0x30')]=_[_0x326f('0x31')](_0x4e8b54[_0x326f('0x2c')],_0x4e8b54[_0x326f('0x2e')]);_0xe432ab[_0x326f('0x32')]=_[_0x326f('0x31')](_0x4e8b54[_0x326f('0x2c')],qs[_0x326f('0x33')](_0x3bf6f7[_0x326f('0x2e')][_0x326f('0x33')]));_0xe432ab[_0x326f('0x32')]=_0xe432ab[_0x326f('0x32')][_0x326f('0x34')]?_0xe432ab[_0x326f('0x32')]:_0x4e8b54['model'];if(_0x3bf6f7['query'][_0x326f('0x3d')]){_0xe432ab[_0x326f('0x3e')]=[{'all':!![]}];}_0xe432ab=_['merge']({},_0xe432ab,_0x3bf6f7[_0x326f('0x43')]);return db[_0x326f('0x28')][_0x326f('0x44')](_0xe432ab)['then'](handleEntityNotFound(_0x4e45ad,null))[_0x326f('0x22')](respondWithResult(_0x4e45ad,null))[_0x326f('0x41')](handleError(_0x4e45ad,null));};exports[_0x326f('0x45')]=function(_0x158a7a,_0x4b40f1){return db['VtigerField'][_0x326f('0x45')](_0x158a7a['body'],{})[_0x326f('0x22')](respondWithResult(_0x4b40f1,0xc9))[_0x326f('0x41')](handleError(_0x4b40f1,null));};exports[_0x326f('0x21')]=function(_0x2f529a,_0x54a94c){if(_0x2f529a[_0x326f('0x46')]['id']){delete _0x2f529a['body']['id'];}return db['VtigerField']['find']({'where':{'id':_0x2f529a['params']['id']}})[_0x326f('0x22')](handleEntityNotFound(_0x54a94c,null))[_0x326f('0x22')](saveUpdates(_0x2f529a[_0x326f('0x46')],null))['then'](respondWithResult(_0x54a94c,null))[_0x326f('0x41')](handleError(_0x54a94c,null));};exports[_0x326f('0x47')]=function(_0x4b6664,_0x342d9f){return db['VtigerField'][_0x326f('0x44')]({'where':{'id':_0x4b6664['params']['id']}})[_0x326f('0x22')](handleEntityNotFound(_0x342d9f,null))[_0x326f('0x22')](removeEntity(_0x342d9f,null))[_0x326f('0x41')](handleError(_0x342d9f,null));};
\ No newline at end of file
index 530ebda..7aea1ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf70=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intVtigerField.attributes'];(function(_0x3f17c4,_0x13da6a){var _0x260776=function(_0x48da58){while(--_0x48da58){_0x3f17c4['push'](_0x3f17c4['shift']());}};_0x260776(++_0x13da6a);}(_0xbf70,0x1e1));var _0x0bf7=function(_0x3d417d,_0x2138ad){_0x3d417d=_0x3d417d-0x0;var _0xe0eec0=_0xbf70[_0x3d417d];return _0xe0eec0;};'use strict';var _=require(_0x0bf7('0x0'));var util=require(_0x0bf7('0x1'));var logger=require(_0x0bf7('0x2'))(_0x0bf7('0x3'));var moment=require('moment');var BPromise=require(_0x0bf7('0x4'));var rp=require(_0x0bf7('0x5'));var fs=require('fs');var path=require(_0x0bf7('0x6'));var rimraf=require(_0x0bf7('0x7'));var config=require('../../config/environment');var attributes=require(_0x0bf7('0x8'));module['exports']=function(_0x28b74f,_0x85ab01){return _0x28b74f['define'](_0x0bf7('0x9'),attributes,{'tableName':_0x0bf7('0xa'),'paranoid':![],'indexes':[{'name':_0x0bf7('0xb'),'fields':[_0x0bf7('0xc'),_0x0bf7('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ab7=['int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0x7ab7,0x164));var _0x77ab=function(_0x2961d1,_0xcd92f2){_0x2961d1=_0x2961d1-0x0;var _0x47d653=_0x7ab7[_0x2961d1];return _0x47d653;};'use strict';var _=require('lodash');var util=require(_0x77ab('0x0'));var logger=require(_0x77ab('0x1'))(_0x77ab('0x2'));var moment=require(_0x77ab('0x3'));var BPromise=require(_0x77ab('0x4'));var rp=require(_0x77ab('0x5'));var fs=require('fs');var path=require(_0x77ab('0x6'));var rimraf=require(_0x77ab('0x7'));var config=require(_0x77ab('0x8'));var attributes=require(_0x77ab('0x9'));module[_0x77ab('0xa')]=function(_0x78404,_0x5c43d6){return _0x78404['define'](_0x77ab('0xb'),attributes,{'tableName':_0x77ab('0xc'),'paranoid':![],'indexes':[{'name':_0x77ab('0xd'),'fields':[_0x77ab('0xe'),_0x77ab('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0a0817c..312d104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd773=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','bluebird','randomstring'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xd773,0xfa));var _0x3d77=function(_0x175143,_0x25b694){_0x175143=_0x175143-0x0;var _0x2e759a=_0xd773[_0x175143];return _0x2e759a;};'use strict';var _=require(_0x3d77('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d77('0x1'));var rs=require(_0x3d77('0x2'));var fs=require('fs');var Redis=require(_0x3d77('0x3'));var db=require(_0x3d77('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d77('0x5'))(_0x3d77('0x6'));var config=require(_0x3d77('0x7'));var jayson=require(_0x3d77('0x8'));var client=jayson[_0x3d77('0x9')][_0x3d77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa42ca9,_0x32a21d,_0x3d163c){return new BPromise(function(_0x30ed7f,_0xf86c7e){return client[_0x3d77('0xb')](_0xa42ca9,_0x3d163c)[_0x3d77('0xc')](function(_0x12658c){logger[_0x3d77('0xd')](_0x3d77('0xe'),_0x32a21d,'request\x20sent');logger[_0x3d77('0xf')](_0x3d77('0x10'),_0x32a21d,'request\x20sent',JSON[_0x3d77('0x11')](_0x12658c));if(_0x12658c[_0x3d77('0x12')]){if(_0x12658c[_0x3d77('0x12')][_0x3d77('0x13')]===0x1f4){logger['error'](_0x3d77('0xe'),_0x32a21d,_0x12658c[_0x3d77('0x12')][_0x3d77('0x14')]);return _0xf86c7e(_0x12658c[_0x3d77('0x12')]['message']);}logger['error'](_0x3d77('0xe'),_0x32a21d,_0x12658c[_0x3d77('0x12')][_0x3d77('0x14')]);return _0x30ed7f(_0x12658c[_0x3d77('0x12')]['message']);}else{logger[_0x3d77('0xd')](_0x3d77('0xe'),_0x32a21d,_0x3d77('0x15'));_0x30ed7f(_0x12658c['result'][_0x3d77('0x14')]);}})[_0x3d77('0x16')](function(_0xde30a3){logger[_0x3d77('0x12')](_0x3d77('0xe'),_0x32a21d,_0xde30a3);_0xf86c7e(_0xde30a3);});});}
\ No newline at end of file
+var _0xe1a7=['rpc','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0xe1a7,0x151));var _0x7e1a=function(_0x2cd8a4,_0x3aa15c){_0x2cd8a4=_0x2cd8a4-0x0;var _0x37ff79=_0xe1a7[_0x2cd8a4];return _0x37ff79;};'use strict';var _=require(_0x7e1a('0x0'));var util=require(_0x7e1a('0x1'));var moment=require('moment');var BPromise=require(_0x7e1a('0x2'));var rs=require(_0x7e1a('0x3'));var fs=require('fs');var Redis=require(_0x7e1a('0x4'));var db=require(_0x7e1a('0x5'))['db'];var utils=require(_0x7e1a('0x6'));var logger=require(_0x7e1a('0x7'))(_0x7e1a('0x8'));var config=require('../../config/environment');var jayson=require(_0x7e1a('0x9'));var client=jayson[_0x7e1a('0xa')][_0x7e1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x436830,_0x3cfb60,_0x12edd8){return new BPromise(function(_0x2effed,_0x131a7b){return client[_0x7e1a('0xc')](_0x436830,_0x12edd8)[_0x7e1a('0xd')](function(_0x536a58){logger[_0x7e1a('0xe')](_0x7e1a('0xf'),_0x3cfb60,_0x7e1a('0x10'));logger[_0x7e1a('0x11')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3cfb60,_0x7e1a('0x10'),JSON[_0x7e1a('0x12')](_0x536a58));if(_0x536a58['error']){if(_0x536a58['error'][_0x7e1a('0x13')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x3cfb60,_0x536a58['error'][_0x7e1a('0x14')]);return _0x131a7b(_0x536a58['error']['message']);}logger[_0x7e1a('0x15')](_0x7e1a('0xf'),_0x3cfb60,_0x536a58[_0x7e1a('0x15')][_0x7e1a('0x14')]);return _0x2effed(_0x536a58[_0x7e1a('0x15')][_0x7e1a('0x14')]);}else{logger[_0x7e1a('0xe')]('VtigerField,\x20%s,\x20%s',_0x3cfb60,_0x7e1a('0x10'));_0x2effed(_0x536a58['result']['message']);}})[_0x7e1a('0x16')](function(_0x2371b8){logger['error'](_0x7e1a('0xf'),_0x3cfb60,_0x2371b8);_0x131a7b(_0x2371b8);});});}
\ No newline at end of file
index 0cc7eac..d2e4de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa24e=['post','create','addConfiguration','put','/:id','delete','destroy','exports','express','fs-extra','../../components/interaction/service','isAuthenticated','index','get','getConfigurations','/:id/fields','getFields'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa24e,0x14b));var _0xea24=function(_0x344545,_0x5c3da2){_0x344545=_0x344545-0x0;var _0x3c37ae=_0xa24e[_0x344545];return _0x3c37ae;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xea24('0x0'));var router=express['Router']();var fs_extra=require(_0xea24('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xea24('0x2'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0xea24('0x3')](),controller[_0xea24('0x4')]);router[_0xea24('0x5')]('/:id',auth[_0xea24('0x3')](),controller['show']);router['get']('/:id/configurations',auth[_0xea24('0x3')](),controller[_0xea24('0x6')]);router[_0xea24('0x5')](_0xea24('0x7'),auth['isAuthenticated'](),controller[_0xea24('0x8')]);router[_0xea24('0x9')]('/',auth[_0xea24('0x3')](),controller[_0xea24('0xa')]);router[_0xea24('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xea24('0xb')]);router[_0xea24('0xc')](_0xea24('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xea24('0xe')](_0xea24('0xd'),auth['isAuthenticated'](),controller[_0xea24('0xf')]);module[_0xea24('0x10')]=router;
\ No newline at end of file
+var _0xf072=['create','/:id/configurations','addConfiguration','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','post'];(function(_0x1fb7d1,_0x108781){var _0x2480d8=function(_0x9bc3d9){while(--_0x9bc3d9){_0x1fb7d1['push'](_0x1fb7d1['shift']());}};_0x2480d8(++_0x108781);}(_0xf072,0x131));var _0x2f07=function(_0x436c66,_0x22e375){_0x436c66=_0x436c66-0x0;var _0x4b2d50=_0xf072[_0x436c66];return _0x4b2d50;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require(_0x2f07('0x3'));var express=require('express');var router=express[_0x2f07('0x4')]();var fs_extra=require(_0x2f07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2f07('0x6'));var config=require(_0x2f07('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2f07('0xb')]);router[_0x2f07('0x8')]('/:id/configurations',auth[_0x2f07('0x9')](),controller['getConfigurations']);router[_0x2f07('0x8')](_0x2f07('0xc'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xd')]);router[_0x2f07('0xe')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xf')]);router['post'](_0x2f07('0x10'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);router['put'](_0x2f07('0x12'),auth[_0x2f07('0x9')](),controller['update']);router['delete']('/:id',auth[_0x2f07('0x9')](),controller['destroy']);module[_0x2f07('0x13')]=router;
\ No newline at end of file
index 4eb1690..2998074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf71=['username','remoteUri','ENUM','password','token','integrationTab','sequelize','exports','STRING'];(function(_0x1088b1,_0x578f07){var _0x2f8cd2=function(_0x491f95){while(--_0x491f95){_0x1088b1['push'](_0x1088b1['shift']());}};_0x2f8cd2(++_0x578f07);}(_0xcf71,0xba));var _0x1cf7=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0xcf71[_0x3f6e26];return _0x474345;};'use strict';var Sequelize=require(_0x1cf7('0x0'));module[_0x1cf7('0x1')]={'name':{'type':Sequelize[_0x1cf7('0x2')]},'description':{'type':Sequelize[_0x1cf7('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1cf7('0x3')},'password':{'type':Sequelize[_0x1cf7('0x2')]},'token':{'type':Sequelize[_0x1cf7('0x2')]},'remoteUri':{'type':Sequelize[_0x1cf7('0x2')],'unique':_0x1cf7('0x4')},'authType':{'type':Sequelize[_0x1cf7('0x5')](_0x1cf7('0x6'),_0x1cf7('0x7')),'defaultValue':_0x1cf7('0x6')},'serverUrl':{'type':Sequelize[_0x1cf7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1cf7('0x5')](_0x1cf7('0x8'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x398a=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0x5d8b52,_0x4337c7){var _0x53e4b9=function(_0x4c654){while(--_0x4c654){_0x5d8b52['push'](_0x5d8b52['shift']());}};_0x53e4b9(++_0x4337c7);}(_0x398a,0x11a));var _0xa398=function(_0x11075d,_0x4bcde0){_0x11075d=_0x11075d-0x0;var _0x89c58f=_0x398a[_0x11075d];return _0x89c58f;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'name':{'type':Sequelize[_0xa398('0x2')]},'description':{'type':Sequelize[_0xa398('0x2')]},'username':{'type':Sequelize[_0xa398('0x2')],'unique':_0xa398('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa398('0x4')},'authType':{'type':Sequelize[_0xa398('0x5')](_0xa398('0x6'),_0xa398('0x7')),'defaultValue':_0xa398('0x6')},'serverUrl':{'type':Sequelize[_0xa398('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa398('0x5')](_0xa398('0x8'),_0xa398('0x9')),'defaultValue':_0xa398('0x8')}};
\ No newline at end of file
index 76b2217..42a2d96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f59=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','params','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','filter','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','username','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','position','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5f55b5,_0x372ef9){var _0x489ba1=function(_0x362202){while(--_0x362202){_0x5f55b5['push'](_0x5f55b5['shift']());}};_0x489ba1(++_0x372ef9);}(_0x8f59,0x11d));var _0x98f5=function(_0x1669d4,_0x19ad62){_0x1669d4=_0x1669d4-0x0;var _0x50653e=_0x8f59[_0x1669d4];return _0x50653e;};'use strict';var emlformat=require(_0x98f5('0x0'));var rimraf=require(_0x98f5('0x1'));var zipdir=require(_0x98f5('0x2'));var jsonpatch=require(_0x98f5('0x3'));var rp=require(_0x98f5('0x4'));var moment=require(_0x98f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x98f5('0x6'));var util=require(_0x98f5('0x7'));var path=require(_0x98f5('0x8'));var sox=require(_0x98f5('0x9'));var csv=require('to-csv');var ejs=require(_0x98f5('0xa'));var fs=require('fs');var fs_extra=require(_0x98f5('0xb'));var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xf'));var querystring=require('querystring');var Papa=require(_0x98f5('0x10'));var Redis=require(_0x98f5('0x11'));var authService=require(_0x98f5('0x12'));var qs=require(_0x98f5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98f5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x98f5('0x15'));var config=require(_0x98f5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x98f5('0x17'))['db'];var integrations=require(_0x98f5('0x18'));function respondWithStatusCode(_0x1f00e8,_0x160626){_0x160626=_0x160626||0xcc;return function(_0x3286f7){if(_0x3286f7){return _0x1f00e8[_0x98f5('0x19')](_0x160626);}return _0x1f00e8['status'](_0x160626)[_0x98f5('0x1a')]();};}function respondWithResult(_0xbade31,_0x5b8bab){_0x5b8bab=_0x5b8bab||0xc8;return function(_0x9df84){if(_0x9df84){return _0xbade31[_0x98f5('0x1b')](_0x5b8bab)[_0x98f5('0x1c')](_0x9df84);}};}function respondWithFilteredResult(_0x4ae70d,_0x2437e7){return function(_0xc7a49b){if(_0xc7a49b){var _0x113545=typeof _0x2437e7['offset']===_0x98f5('0x1d')&&typeof _0x2437e7[_0x98f5('0x1e')]==='undefined';var _0x1df52d=_0xc7a49b['count'];var _0x10c57c=_0x113545?0x0:_0x2437e7[_0x98f5('0x1f')];var _0x2291d5=_0x113545?_0xc7a49b[_0x98f5('0x20')]:_0x2437e7[_0x98f5('0x1f')]+_0x2437e7[_0x98f5('0x1e')];var _0x484e1d;if(_0x2291d5>=_0x1df52d){_0x2291d5=_0x1df52d;_0x484e1d=0xc8;}else{_0x484e1d=0xce;}_0x4ae70d[_0x98f5('0x1b')](_0x484e1d);return _0x4ae70d['set'](_0x98f5('0x21'),_0x10c57c+'-'+_0x2291d5+'/'+_0x1df52d)[_0x98f5('0x1c')](_0xc7a49b);}return null;};}function patchUpdates(_0x5deca0){return function(_0x146db1){try{jsonpatch[_0x98f5('0x22')](_0x146db1,_0x5deca0,!![]);}catch(_0x331695){return BPromise[_0x98f5('0x23')](_0x331695);}return _0x146db1[_0x98f5('0x24')]();};}function saveUpdates(_0x3dc7c2,_0x38b46d){return function(_0x5ac2b7){if(_0x5ac2b7){return _0x5ac2b7[_0x98f5('0x25')](_0x3dc7c2)['then'](function(_0xcb10d6){return _0xcb10d6;});}return null;};}function removeEntity(_0x495889,_0x44bfbb){return function(_0x40c69b){if(_0x40c69b){return _0x40c69b[_0x98f5('0x26')]()[_0x98f5('0x27')](function(){_0x495889[_0x98f5('0x1b')](0xcc)[_0x98f5('0x1a')]();});}};}function handleEntityNotFound(_0x46dbd4,_0x58d506){return function(_0x27a533){if(!_0x27a533){_0x46dbd4[_0x98f5('0x19')](0x194);}return _0x27a533;};}function handleError(_0x5d7423,_0x1a1c55){_0x1a1c55=_0x1a1c55||0x1f4;return function(_0x18b0af){logger[_0x98f5('0x28')](_0x18b0af[_0x98f5('0x29')]);if(_0x18b0af[_0x98f5('0x2a')]){delete _0x18b0af[_0x98f5('0x2a')];}_0x5d7423[_0x98f5('0x1b')](_0x1a1c55)[_0x98f5('0x2b')](_0x18b0af);};}exports['index']=function(_0x4c10b8,_0x428c85){var _0x71661e={},_0x18bb29={},_0x209d15={'count':0x0,'rows':[]};var _0x15bf92=_[_0x98f5('0x2c')](db['ZendeskAccount'][_0x98f5('0x2d')],function(_0x6d7418){return{'name':_0x6d7418[_0x98f5('0x2e')],'type':_0x6d7418[_0x98f5('0x2f')][_0x98f5('0x30')]};});_0x18bb29[_0x98f5('0x31')]=_['map'](_0x15bf92,_0x98f5('0x2a'));_0x18bb29[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0x4c10b8[_0x98f5('0x32')]);_0x18bb29['filters']=_[_0x98f5('0x34')](_0x18bb29[_0x98f5('0x31')],_0x18bb29[_0x98f5('0x32')]);_0x71661e[_0x98f5('0x35')]=_[_0x98f5('0x34')](_0x18bb29[_0x98f5('0x31')],qs[_0x98f5('0x36')](_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x36')]));_0x71661e[_0x98f5('0x35')]=_0x71661e[_0x98f5('0x35')][_0x98f5('0x37')]?_0x71661e[_0x98f5('0x35')]:_0x18bb29[_0x98f5('0x31')];if(!_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x38')](_0x98f5('0x39'))){_0x71661e[_0x98f5('0x1e')]=qs[_0x98f5('0x1e')](_0x4c10b8[_0x98f5('0x32')]['limit']);_0x71661e[_0x98f5('0x1f')]=qs['offset'](_0x4c10b8['query'][_0x98f5('0x1f')]);}_0x71661e[_0x98f5('0x3a')]=qs[_0x98f5('0x3b')](_0x4c10b8[_0x98f5('0x32')]['sort']);_0x71661e[_0x98f5('0x3c')]=qs[_0x98f5('0x3d')](_[_0x98f5('0x3e')](_0x4c10b8['query'],_0x18bb29[_0x98f5('0x3d')]),_0x15bf92);if(_0x4c10b8[_0x98f5('0x32')]['filter']){_0x71661e[_0x98f5('0x3c')]=_[_0x98f5('0x3f')](_0x71661e[_0x98f5('0x3c')],{'$or':_['map'](_0x15bf92,function(_0x15d704){if(_0x15d704[_0x98f5('0x2f')]!==_0x98f5('0x40')){var _0x544fbf={};_0x544fbf[_0x15d704[_0x98f5('0x2a')]]={'$like':'%'+_0x4c10b8['query']['filter']+'%'};return _0x544fbf;}})});}_0x71661e=_[_0x98f5('0x3f')]({},_0x71661e,_0x4c10b8[_0x98f5('0x41')]);var _0x33e6e2={'where':_0x71661e[_0x98f5('0x3c')]};return db[_0x98f5('0x42')][_0x98f5('0x20')](_0x33e6e2)['then'](function(_0x4a4129){_0x209d15[_0x98f5('0x20')]=_0x4a4129;if(_0x4c10b8[_0x98f5('0x32')][_0x98f5('0x43')]){_0x71661e[_0x98f5('0x44')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x71661e);})[_0x98f5('0x27')](function(_0x469d2c){_0x209d15[_0x98f5('0x45')]=_0x469d2c;return _0x209d15;})[_0x98f5('0x27')](respondWithFilteredResult(_0x428c85,_0x71661e))['catch'](handleError(_0x428c85,null));};exports['show']=function(_0x3db067,_0x3a191f){var _0x372c33={'raw':![],'where':{'id':_0x3db067[_0x98f5('0x46')]['id']}},_0x4a9b53={};_0x4a9b53['model']=_[_0x98f5('0x33')](db['ZendeskAccount'][_0x98f5('0x2d')]);_0x4a9b53[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0x3db067['query']);_0x4a9b53[_0x98f5('0x3d')]=_[_0x98f5('0x34')](_0x4a9b53['model'],_0x4a9b53[_0x98f5('0x32')]);_0x372c33[_0x98f5('0x35')]=_['intersection'](_0x4a9b53[_0x98f5('0x31')],qs['fields'](_0x3db067[_0x98f5('0x32')][_0x98f5('0x36')]));_0x372c33['attributes']=_0x372c33['attributes']['length']?_0x372c33['attributes']:_0x4a9b53[_0x98f5('0x31')];if(_0x3db067['query'][_0x98f5('0x43')]){_0x372c33[_0x98f5('0x44')]=[{'all':!![]}];}_0x372c33=_[_0x98f5('0x3f')]({},_0x372c33,_0x3db067[_0x98f5('0x41')]);return db[_0x98f5('0x42')][_0x98f5('0x47')](_0x372c33)['then'](handleEntityNotFound(_0x3a191f,null))[_0x98f5('0x27')](respondWithResult(_0x3a191f,null))[_0x98f5('0x48')](handleError(_0x3a191f,null));};exports[_0x98f5('0x49')]=function(_0x2c3cef,_0x178867){return db[_0x98f5('0x42')]['create'](_0x2c3cef[_0x98f5('0x4a')],{})[_0x98f5('0x27')](respondWithResult(_0x178867,0xc9))[_0x98f5('0x48')](handleError(_0x178867,null));};exports[_0x98f5('0x25')]=function(_0x4a0cda,_0x2c5f96){if(_0x4a0cda[_0x98f5('0x4a')]['id']){delete _0x4a0cda[_0x98f5('0x4a')]['id'];}return db[_0x98f5('0x42')][_0x98f5('0x47')]({'where':{'id':_0x4a0cda['params']['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0x2c5f96,null))[_0x98f5('0x27')](saveUpdates(_0x4a0cda['body'],null))[_0x98f5('0x27')](respondWithResult(_0x2c5f96,null))['catch'](handleError(_0x2c5f96,null));};exports[_0x98f5('0x26')]=function(_0x4cb157,_0x1bd2b9){return db[_0x98f5('0x42')][_0x98f5('0x47')]({'where':{'id':_0x4cb157['params']['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0x1bd2b9,null))[_0x98f5('0x27')](removeEntity(_0x1bd2b9,null))[_0x98f5('0x48')](handleError(_0x1bd2b9,null));};exports[_0x98f5('0x4b')]=function(_0xde3d2d,_0xf39073,_0x37e620){var _0x1891ac={};var _0x2c3a23={};var _0x2e48a1;var _0x50343c;return db[_0x98f5('0x42')][_0x98f5('0x4c')]({'where':{'id':_0xde3d2d[_0x98f5('0x46')]['id']}})[_0x98f5('0x27')](handleEntityNotFound(_0xf39073,null))[_0x98f5('0x27')](function(_0x23e955){if(_0x23e955){_0x2e48a1=_0x23e955;_0x2c3a23['model']=_[_0x98f5('0x33')](db[_0x98f5('0x4d')][_0x98f5('0x2d')]);_0x2c3a23[_0x98f5('0x32')]=_[_0x98f5('0x33')](_0xde3d2d[_0x98f5('0x32')]);_0x2c3a23['filters']=_['intersection'](_0x2c3a23['model'],_0x2c3a23[_0x98f5('0x32')]);_0x1891ac[_0x98f5('0x35')]=_[_0x98f5('0x34')](_0x2c3a23[_0x98f5('0x31')],qs['fields'](_0xde3d2d[_0x98f5('0x32')]['fields']));_0x1891ac[_0x98f5('0x35')]=_0x1891ac['attributes']['length']?_0x1891ac[_0x98f5('0x35')]:_0x2c3a23[_0x98f5('0x31')];_0x1891ac[_0x98f5('0x3a')]=qs['sort'](_0xde3d2d['query'][_0x98f5('0x3b')]);_0x1891ac[_0x98f5('0x3c')]=qs['filters'](_[_0x98f5('0x3e')](_0xde3d2d[_0x98f5('0x32')],_0x2c3a23['filters']));if(_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x4e')]){_0x1891ac[_0x98f5('0x3c')]=_['merge'](_0x1891ac[_0x98f5('0x3c')],{'$or':_[_0x98f5('0x2c')](_0x1891ac[_0x98f5('0x35')],function(_0xabde69){var _0x459c64={};_0x459c64[_0xabde69]={'$like':'%'+_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x4e')]+'%'};return _0x459c64;})});}_0x1891ac=_['merge']({},_0x1891ac,_0xde3d2d[_0x98f5('0x41')]);return _0x2e48a1[_0x98f5('0x4b')](_0x1891ac);}})[_0x98f5('0x27')](function(_0x58041d){if(_0x58041d){_0x50343c=_0x58041d['length'];if(!_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x38')]('nolimit')){_0x1891ac['limit']=qs['limit'](_0xde3d2d['query'][_0x98f5('0x1e')]);_0x1891ac['offset']=qs[_0x98f5('0x1f')](_0xde3d2d[_0x98f5('0x32')][_0x98f5('0x1f')]);}return _0x2e48a1[_0x98f5('0x4b')](_0x1891ac);}})[_0x98f5('0x27')](function(_0x26cc86){if(_0x26cc86){return _0x26cc86?{'count':_0x50343c,'rows':_0x26cc86}:null;}})[_0x98f5('0x27')](respondWithResult(_0xf39073,null))[_0x98f5('0x48')](handleError(_0xf39073,null));};exports['addConfiguration']=function(_0x4d89b6,_0x3b8229,_0x505209){if(_0x4d89b6[_0x98f5('0x4a')]['id']){delete _0x4d89b6[_0x98f5('0x4a')]['id'];}return db[_0x98f5('0x42')]['findOne']({'where':{'id':_0x4d89b6[_0x98f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b8229,null))['then'](function(_0x595aee){if(_0x595aee){_0x4d89b6[_0x98f5('0x4a')]['AccountId']=_0x595aee['id'];_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x4f')]=integrations[_0x98f5('0x50')](_0x4d89b6['body']['channel'],_0x4d89b6['body'][_0x98f5('0x2f')]);_0x4d89b6[_0x98f5('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x51')],_0x4d89b6[_0x98f5('0x4a')][_0x98f5('0x2f')]);return db[_0x98f5('0x4d')][_0x98f5('0x49')](_0x4d89b6[_0x98f5('0x4a')],{'include':[{'model':db[_0x98f5('0x52')],'as':_0x98f5('0x4f')},{'model':db['ZendeskField'],'as':_0x98f5('0x53')}]});}return null;})[_0x98f5('0x27')](respondWithResult(_0x3b8229,null))[_0x98f5('0x48')](handleError(_0x3b8229,null));};exports[_0x98f5('0x54')]=function(_0x50911c,_0x3e00bf,_0x48b175){var _0x42c7a6='';return db['ZendeskAccount'][_0x98f5('0x4c')]({'where':{'id':_0x50911c[_0x98f5('0x46')]['id']},'attributes':['id','username',_0x98f5('0x55'),_0x98f5('0x56'),_0x98f5('0x57'),'remoteUri']})[_0x98f5('0x27')](handleEntityNotFound(_0x3e00bf,null))[_0x98f5('0x27')](function(_0x14c4f1){if(_0x14c4f1){_0x42c7a6=_0x14c4f1[_0x98f5('0x58')];var _0x154e19=_0x42c7a6[_0x98f5('0x59')](-0x1);if(_0x154e19==='/'){_0x42c7a6=_0x42c7a6[_0x98f5('0x5a')](0x0,_0x42c7a6[_0x98f5('0x5b')](_0x154e19));}var _0x368f76={'method':'GET','uri':util[_0x98f5('0x5c')]('%s/%s',_0x42c7a6,_0x98f5('0x5d')),'json':!![]};switch(_0x14c4f1[_0x98f5('0x57')]){case _0x98f5('0x55'):_0x368f76[_0x98f5('0x5e')]={'Authorization':util['format'](_0x98f5('0x5f'),new Buffer(util[_0x98f5('0x5c')]('%s:%s',_0x14c4f1[_0x98f5('0x60')],_0x14c4f1['password']))[_0x98f5('0x61')](_0x98f5('0x62')))};break;case _0x98f5('0x56'):_0x368f76[_0x98f5('0x5e')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x98f5('0x5c')](_0x98f5('0x63'),_0x14c4f1['username'],_0x14c4f1[_0x98f5('0x56')]))[_0x98f5('0x61')](_0x98f5('0x62')))};break;default:throw new db[(_0x98f5('0x64'))][(_0x98f5('0x65'))](_0x98f5('0x66'));}return rp(_0x368f76);}})[_0x98f5('0x27')](function(_0x1a3cb8){if(_0x1a3cb8){var _0x2e0484=[_0x98f5('0x67'),_0x98f5('0x68'),'group','assignee'];_[_0x98f5('0x69')](_0x1a3cb8[_0x98f5('0x5d')],function(_0x10cd2d){return _0x2e0484['includes'](_0x10cd2d[_0x98f5('0x2f')]);});return{'count':_0x1a3cb8[_0x98f5('0x5d')]['length'],'rows':_[_0x98f5('0x2c')](_0x1a3cb8[_0x98f5('0x5d')],function(_0x4c1dda){return{'id':_0x4c1dda['id'],'name':_0x4c1dda['position']>0x7?_0x4c1dda['title']:_0x4c1dda['type'],'custom':_0x4c1dda[_0x98f5('0x6a')]>0x7?!![]:![],'options':_0x4c1dda[_0x98f5('0x6b')]?_0x4c1dda['system_field_options']:_0x4c1dda[_0x98f5('0x6c')]?_0x4c1dda[_0x98f5('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3e00bf,null))[_0x98f5('0x48')](function(_0x4f582b){var _0x4814da=_0x50911c[_0x98f5('0x32')][_0x98f5('0x6d')]?0x1f4:_0x4f582b[_0x98f5('0x6e')]||0x1f4;logger[_0x98f5('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x98f5('0x54'),_0x4814da,JSON['stringify'](_0x4f582b));delete _0x4f582b['name'];if(_0x4814da===0x191){_0x4814da=0x190;}_0x3e00bf['status'](_0x4814da)[_0x98f5('0x2b')](_0x50911c[_0x98f5('0x32')][_0x98f5('0x6d')]?{'message':_0x98f5('0x6f'),'statusCode':_0x4f582b[_0x98f5('0x6e')]}:_0x4f582b);});};
\ No newline at end of file
+var _0x80ed=['rawAttributes','sort','pick','filter','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','authType','remoteUri','substring','lastIndexOf','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s:%s','toString','%s/token:%s','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','includes','position','system_field_options','custom_field_options','test','statusCode','error','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','sendStatus','stack','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','options','ZendeskAccount','findAll','rows','catch','show','params','includeAll','create','body','find','getConfigurations','findOne'];(function(_0xa805d7,_0x386ef8){var _0x169393=function(_0x507358){while(--_0x507358){_0xa805d7['push'](_0xa805d7['shift']());}};_0x169393(++_0x386ef8);}(_0x80ed,0x11c));var _0xd80e=function(_0x43911a,_0x53a433){_0x43911a=_0x43911a-0x0;var _0xba321=_0x80ed[_0x43911a];return _0xba321;};'use strict';var emlformat=require(_0xd80e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd80e('0x1'));var jsonpatch=require(_0xd80e('0x2'));var rp=require(_0xd80e('0x3'));var moment=require('moment');var BPromise=require(_0xd80e('0x4'));var Mustache=require(_0xd80e('0x5'));var util=require(_0xd80e('0x6'));var path=require(_0xd80e('0x7'));var sox=require('sox');var csv=require(_0xd80e('0x8'));var ejs=require(_0xd80e('0x9'));var fs=require('fs');var fs_extra=require(_0xd80e('0xa'));var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x8'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var licenseUtil=require(_0xd80e('0x19'));var db=require(_0xd80e('0x1a'))['db'];var integrations=require(_0xd80e('0x1b'));function respondWithStatusCode(_0x1d3fcf,_0x4fb01c){_0x4fb01c=_0x4fb01c||0xcc;return function(_0x5691a1){if(_0x5691a1){return _0x1d3fcf['sendStatus'](_0x4fb01c);}return _0x1d3fcf['status'](_0x4fb01c)[_0xd80e('0x1c')]();};}function respondWithResult(_0x3d233b,_0x3096ae){_0x3096ae=_0x3096ae||0xc8;return function(_0x1e8b63){if(_0x1e8b63){return _0x3d233b[_0xd80e('0x1d')](_0x3096ae)['json'](_0x1e8b63);}};}function respondWithFilteredResult(_0x595683,_0x2c8c61){return function(_0x3124e8){if(_0x3124e8){var _0x3b48ae=typeof _0x2c8c61[_0xd80e('0x1e')]===_0xd80e('0x1f')&&typeof _0x2c8c61[_0xd80e('0x20')]===_0xd80e('0x1f');var _0x49e3e5=_0x3124e8[_0xd80e('0x21')];var _0x1cc576=_0x3b48ae?0x0:_0x2c8c61[_0xd80e('0x1e')];var _0x34e239=_0x3b48ae?_0x3124e8['count']:_0x2c8c61[_0xd80e('0x1e')]+_0x2c8c61[_0xd80e('0x20')];var _0xecfe74;if(_0x34e239>=_0x49e3e5){_0x34e239=_0x49e3e5;_0xecfe74=0xc8;}else{_0xecfe74=0xce;}_0x595683['status'](_0xecfe74);return _0x595683[_0xd80e('0x22')](_0xd80e('0x23'),_0x1cc576+'-'+_0x34e239+'/'+_0x49e3e5)[_0xd80e('0x24')](_0x3124e8);}return null;};}function patchUpdates(_0x147134){return function(_0x46b6eb){try{jsonpatch['apply'](_0x46b6eb,_0x147134,!![]);}catch(_0x4b6b8a){return BPromise[_0xd80e('0x25')](_0x4b6b8a);}return _0x46b6eb[_0xd80e('0x26')]();};}function saveUpdates(_0x3b39bf,_0x2d46e7){return function(_0x3eb3ca){if(_0x3eb3ca){return _0x3eb3ca[_0xd80e('0x27')](_0x3b39bf)[_0xd80e('0x28')](function(_0x5430b6){return _0x5430b6;});}return null;};}function removeEntity(_0x1fbf8a,_0x57d70){return function(_0x170109){if(_0x170109){return _0x170109['destroy']()[_0xd80e('0x28')](function(){_0x1fbf8a[_0xd80e('0x1d')](0xcc)[_0xd80e('0x1c')]();});}};}function handleEntityNotFound(_0x482779,_0x521aa4){return function(_0x5420e7){if(!_0x5420e7){_0x482779[_0xd80e('0x29')](0x194);}return _0x5420e7;};}function handleError(_0x4b8291,_0x9f9287){_0x9f9287=_0x9f9287||0x1f4;return function(_0x1044cc){logger['error'](_0x1044cc[_0xd80e('0x2a')]);if(_0x1044cc[_0xd80e('0x2b')]){delete _0x1044cc[_0xd80e('0x2b')];}_0x4b8291[_0xd80e('0x1d')](_0x9f9287)['send'](_0x1044cc);};}exports[_0xd80e('0x2c')]=function(_0x1ad3bc,_0x845451){var _0x39088b={},_0x2b1aaf={},_0x361946={'count':0x0,'rows':[]};var _0x289685=_[_0xd80e('0x2d')](db['ZendeskAccount']['rawAttributes'],function(_0x30f9bd){return{'name':_0x30f9bd[_0xd80e('0x2e')],'type':_0x30f9bd[_0xd80e('0x2f')][_0xd80e('0x30')]};});_0x2b1aaf[_0xd80e('0x31')]=_[_0xd80e('0x2d')](_0x289685,'name');_0x2b1aaf['query']=_[_0xd80e('0x32')](_0x1ad3bc[_0xd80e('0x33')]);_0x2b1aaf[_0xd80e('0x34')]=_[_0xd80e('0x35')](_0x2b1aaf[_0xd80e('0x31')],_0x2b1aaf[_0xd80e('0x33')]);_0x39088b[_0xd80e('0x36')]=_[_0xd80e('0x35')](_0x2b1aaf['model'],qs['fields'](_0x1ad3bc[_0xd80e('0x33')][_0xd80e('0x37')]));_0x39088b[_0xd80e('0x36')]=_0x39088b[_0xd80e('0x36')][_0xd80e('0x38')]?_0x39088b[_0xd80e('0x36')]:_0x2b1aaf[_0xd80e('0x31')];if(!_0x1ad3bc[_0xd80e('0x33')][_0xd80e('0x39')](_0xd80e('0x3a'))){_0x39088b['limit']=qs[_0xd80e('0x20')](_0x1ad3bc['query'][_0xd80e('0x20')]);_0x39088b[_0xd80e('0x1e')]=qs[_0xd80e('0x1e')](_0x1ad3bc[_0xd80e('0x33')]['offset']);}_0x39088b[_0xd80e('0x3b')]=qs['sort'](_0x1ad3bc[_0xd80e('0x33')]['sort']);_0x39088b[_0xd80e('0x3c')]=qs[_0xd80e('0x34')](_['pick'](_0x1ad3bc[_0xd80e('0x33')],_0x2b1aaf[_0xd80e('0x34')]),_0x289685);if(_0x1ad3bc[_0xd80e('0x33')]['filter']){_0x39088b[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x39088b[_0xd80e('0x3c')],{'$or':_[_0xd80e('0x2d')](_0x289685,function(_0x3c6f5f){if(_0x3c6f5f[_0xd80e('0x2f')]!==_0xd80e('0x3e')){var _0x137552={};_0x137552[_0x3c6f5f[_0xd80e('0x2b')]]={'$like':'%'+_0x1ad3bc['query']['filter']+'%'};return _0x137552;}})});}_0x39088b=_['merge']({},_0x39088b,_0x1ad3bc[_0xd80e('0x3f')]);var _0x3ff4b4={'where':_0x39088b['where']};return db[_0xd80e('0x40')]['count'](_0x3ff4b4)[_0xd80e('0x28')](function(_0x5ade19){_0x361946[_0xd80e('0x21')]=_0x5ade19;if(_0x1ad3bc[_0xd80e('0x33')]['includeAll']){_0x39088b['include']=[{'all':!![]}];}return db[_0xd80e('0x40')][_0xd80e('0x41')](_0x39088b);})[_0xd80e('0x28')](function(_0x3e65a7){_0x361946[_0xd80e('0x42')]=_0x3e65a7;return _0x361946;})[_0xd80e('0x28')](respondWithFilteredResult(_0x845451,_0x39088b))[_0xd80e('0x43')](handleError(_0x845451,null));};exports[_0xd80e('0x44')]=function(_0x91c6ed,_0x2da5f5){var _0x1bbb36={'raw':![],'where':{'id':_0x91c6ed[_0xd80e('0x45')]['id']}},_0x2e257e={};_0x2e257e[_0xd80e('0x31')]=_[_0xd80e('0x32')](db[_0xd80e('0x40')]['rawAttributes']);_0x2e257e['query']=_['keys'](_0x91c6ed[_0xd80e('0x33')]);_0x2e257e['filters']=_[_0xd80e('0x35')](_0x2e257e[_0xd80e('0x31')],_0x2e257e[_0xd80e('0x33')]);_0x1bbb36[_0xd80e('0x36')]=_[_0xd80e('0x35')](_0x2e257e[_0xd80e('0x31')],qs['fields'](_0x91c6ed['query']['fields']));_0x1bbb36[_0xd80e('0x36')]=_0x1bbb36['attributes'][_0xd80e('0x38')]?_0x1bbb36[_0xd80e('0x36')]:_0x2e257e[_0xd80e('0x31')];if(_0x91c6ed[_0xd80e('0x33')][_0xd80e('0x46')]){_0x1bbb36['include']=[{'all':!![]}];}_0x1bbb36=_[_0xd80e('0x3d')]({},_0x1bbb36,_0x91c6ed[_0xd80e('0x3f')]);return db[_0xd80e('0x40')]['find'](_0x1bbb36)[_0xd80e('0x28')](handleEntityNotFound(_0x2da5f5,null))[_0xd80e('0x28')](respondWithResult(_0x2da5f5,null))[_0xd80e('0x43')](handleError(_0x2da5f5,null));};exports['create']=function(_0x8d5cb8,_0x29aaa0){return db[_0xd80e('0x40')][_0xd80e('0x47')](_0x8d5cb8[_0xd80e('0x48')],{})[_0xd80e('0x28')](respondWithResult(_0x29aaa0,0xc9))['catch'](handleError(_0x29aaa0,null));};exports['update']=function(_0x275985,_0x27134e){if(_0x275985[_0xd80e('0x48')]['id']){delete _0x275985['body']['id'];}return db['ZendeskAccount'][_0xd80e('0x49')]({'where':{'id':_0x275985[_0xd80e('0x45')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x27134e,null))[_0xd80e('0x28')](saveUpdates(_0x275985[_0xd80e('0x48')],null))['then'](respondWithResult(_0x27134e,null))[_0xd80e('0x43')](handleError(_0x27134e,null));};exports['destroy']=function(_0x46c781,_0x31107b){return db['ZendeskAccount'][_0xd80e('0x49')]({'where':{'id':_0x46c781[_0xd80e('0x45')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x31107b,null))[_0xd80e('0x28')](removeEntity(_0x31107b,null))[_0xd80e('0x43')](handleError(_0x31107b,null));};exports[_0xd80e('0x4a')]=function(_0x18dbb0,_0x50be26,_0x178c51){var _0x377e68={};var _0x419df7={};var _0x4a66ca;var _0x52ab04;return db[_0xd80e('0x40')][_0xd80e('0x4b')]({'where':{'id':_0x18dbb0[_0xd80e('0x45')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x50be26,null))[_0xd80e('0x28')](function(_0x8b7a70){if(_0x8b7a70){_0x4a66ca=_0x8b7a70;_0x419df7[_0xd80e('0x31')]=_[_0xd80e('0x32')](db['ZendeskConfiguration'][_0xd80e('0x4c')]);_0x419df7['query']=_[_0xd80e('0x32')](_0x18dbb0[_0xd80e('0x33')]);_0x419df7[_0xd80e('0x34')]=_[_0xd80e('0x35')](_0x419df7[_0xd80e('0x31')],_0x419df7[_0xd80e('0x33')]);_0x377e68['attributes']=_[_0xd80e('0x35')](_0x419df7['model'],qs[_0xd80e('0x37')](_0x18dbb0[_0xd80e('0x33')]['fields']));_0x377e68['attributes']=_0x377e68[_0xd80e('0x36')][_0xd80e('0x38')]?_0x377e68[_0xd80e('0x36')]:_0x419df7['model'];_0x377e68['order']=qs[_0xd80e('0x4d')](_0x18dbb0[_0xd80e('0x33')]['sort']);_0x377e68[_0xd80e('0x3c')]=qs[_0xd80e('0x34')](_[_0xd80e('0x4e')](_0x18dbb0['query'],_0x419df7[_0xd80e('0x34')]));if(_0x18dbb0['query'][_0xd80e('0x4f')]){_0x377e68[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x377e68[_0xd80e('0x3c')],{'$or':_['map'](_0x377e68[_0xd80e('0x36')],function(_0x564475){var _0x53b784={};_0x53b784[_0x564475]={'$like':'%'+_0x18dbb0['query'][_0xd80e('0x4f')]+'%'};return _0x53b784;})});}_0x377e68=_[_0xd80e('0x3d')]({},_0x377e68,_0x18dbb0[_0xd80e('0x3f')]);return _0x4a66ca[_0xd80e('0x4a')](_0x377e68);}})['then'](function(_0x1738ff){if(_0x1738ff){_0x52ab04=_0x1738ff[_0xd80e('0x38')];if(!_0x18dbb0['query'][_0xd80e('0x39')](_0xd80e('0x3a'))){_0x377e68[_0xd80e('0x20')]=qs[_0xd80e('0x20')](_0x18dbb0['query'][_0xd80e('0x20')]);_0x377e68[_0xd80e('0x1e')]=qs['offset'](_0x18dbb0[_0xd80e('0x33')][_0xd80e('0x1e')]);}return _0x4a66ca[_0xd80e('0x4a')](_0x377e68);}})['then'](function(_0x562ed7){if(_0x562ed7){return _0x562ed7?{'count':_0x52ab04,'rows':_0x562ed7}:null;}})['then'](respondWithResult(_0x50be26,null))['catch'](handleError(_0x50be26,null));};exports[_0xd80e('0x50')]=function(_0x4f283c,_0x3c8ad1,_0x1b0ad4){if(_0x4f283c[_0xd80e('0x48')]['id']){delete _0x4f283c['body']['id'];}return db[_0xd80e('0x40')][_0xd80e('0x4b')]({'where':{'id':_0x4f283c[_0xd80e('0x45')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x3c8ad1,null))[_0xd80e('0x28')](function(_0x2a34cd){if(_0x2a34cd){_0x4f283c[_0xd80e('0x48')][_0xd80e('0x51')]=_0x2a34cd['id'];_0x4f283c[_0xd80e('0x48')]['Subjects']=integrations['getSubjects'](_0x4f283c[_0xd80e('0x48')][_0xd80e('0x52')],_0x4f283c[_0xd80e('0x48')][_0xd80e('0x2f')]);_0x4f283c['body'][_0xd80e('0x53')]=integrations[_0xd80e('0x54')](_0x4f283c[_0xd80e('0x48')][_0xd80e('0x52')],_0x4f283c[_0xd80e('0x48')]['type']);return db[_0xd80e('0x55')][_0xd80e('0x47')](_0x4f283c[_0xd80e('0x48')],{'include':[{'model':db[_0xd80e('0x56')],'as':'Subjects'},{'model':db[_0xd80e('0x56')],'as':_0xd80e('0x53')}]});}return null;})[_0xd80e('0x28')](respondWithResult(_0x3c8ad1,null))[_0xd80e('0x43')](handleError(_0x3c8ad1,null));};exports[_0xd80e('0x57')]=function(_0x1edcf4,_0x5cb11c,_0x3e3176){var _0x393fb6='';return db['ZendeskAccount'][_0xd80e('0x4b')]({'where':{'id':_0x1edcf4[_0xd80e('0x45')]['id']},'attributes':['id',_0xd80e('0x58'),_0xd80e('0x59'),'token',_0xd80e('0x5a'),'remoteUri']})[_0xd80e('0x28')](handleEntityNotFound(_0x5cb11c,null))[_0xd80e('0x28')](function(_0x194743){if(_0x194743){_0x393fb6=_0x194743[_0xd80e('0x5b')];var _0x4186bd=_0x393fb6['slice'](-0x1);if(_0x4186bd==='/'){_0x393fb6=_0x393fb6[_0xd80e('0x5c')](0x0,_0x393fb6[_0xd80e('0x5d')](_0x4186bd));}var _0x25e86d={'method':_0xd80e('0x5e'),'uri':util['format'](_0xd80e('0x5f'),_0x393fb6,_0xd80e('0x60')),'json':!![]};switch(_0x194743['authType']){case _0xd80e('0x59'):_0x25e86d[_0xd80e('0x61')]={'Authorization':util[_0xd80e('0x62')](_0xd80e('0x63'),new Buffer(util[_0xd80e('0x62')](_0xd80e('0x64'),_0x194743['username'],_0x194743['password']))[_0xd80e('0x65')]('base64'))};break;case'token':_0x25e86d[_0xd80e('0x61')]={'Authorization':util[_0xd80e('0x62')](_0xd80e('0x63'),new Buffer(util[_0xd80e('0x62')](_0xd80e('0x66'),_0x194743[_0xd80e('0x58')],_0x194743[_0xd80e('0x67')]))[_0xd80e('0x65')]('base64'))};break;default:throw new db[(_0xd80e('0x68'))][(_0xd80e('0x69'))](_0xd80e('0x6a'));}return rp(_0x25e86d);}})[_0xd80e('0x28')](function(_0x575bf6){if(_0x575bf6){var _0x192178=[_0xd80e('0x6b'),'description',_0xd80e('0x6c'),_0xd80e('0x6d')];_['remove'](_0x575bf6[_0xd80e('0x60')],function(_0x160dc4){return _0x192178[_0xd80e('0x6e')](_0x160dc4[_0xd80e('0x2f')]);});return{'count':_0x575bf6[_0xd80e('0x60')][_0xd80e('0x38')],'rows':_[_0xd80e('0x2d')](_0x575bf6[_0xd80e('0x60')],function(_0x392a8b){return{'id':_0x392a8b['id'],'name':_0x392a8b[_0xd80e('0x6f')]>0x7?_0x392a8b['title']:_0x392a8b[_0xd80e('0x2f')],'custom':_0x392a8b[_0xd80e('0x6f')]>0x7?!![]:![],'options':_0x392a8b['system_field_options']?_0x392a8b[_0xd80e('0x70')]:_0x392a8b[_0xd80e('0x71')]?_0x392a8b[_0xd80e('0x71')]:[]};})};}})['then'](respondWithResult(_0x5cb11c,null))[_0xd80e('0x43')](function(_0x5277a2){var _0x30fc66=_0x1edcf4[_0xd80e('0x33')][_0xd80e('0x72')]?0x1f4:_0x5277a2[_0xd80e('0x73')]||0x1f4;logger[_0xd80e('0x74')]('getFields,\x20%s,\x20%s,\x20%s',_0xd80e('0x57'),_0x30fc66,JSON[_0xd80e('0x75')](_0x5277a2));delete _0x5277a2[_0xd80e('0x2b')];if(_0x30fc66===0x191){_0x30fc66=0x190;}_0x5cb11c[_0xd80e('0x1d')](_0x30fc66)[_0xd80e('0x76')](_0x1edcf4[_0xd80e('0x33')][_0xd80e('0x72')]?{'message':_0xd80e('0x77'),'statusCode':_0x5277a2[_0xd80e('0x73')]}:_0x5277a2);});};
\ No newline at end of file
index 8edc8dc..98ec8d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26be=['moment','bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api'];(function(_0x5f36d0,_0x3b2f4c){var _0xaea9a1=function(_0x1de08b){while(--_0x1de08b){_0x5f36d0['push'](_0x5f36d0['shift']());}};_0xaea9a1(++_0x3b2f4c);}(_0x26be,0x159));var _0xe26b=function(_0x6a4a57,_0x1f58de){_0x6a4a57=_0x6a4a57-0x0;var _0x560ccc=_0x26be[_0x6a4a57];return _0x560ccc;};'use strict';var _=require('lodash');var util=require(_0xe26b('0x0'));var logger=require(_0xe26b('0x1'))(_0xe26b('0x2'));var moment=require(_0xe26b('0x3'));var BPromise=require(_0xe26b('0x4'));var rp=require(_0xe26b('0x5'));var fs=require('fs');var path=require(_0xe26b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe26b('0x7'));var integrations=require(_0xe26b('0x8'));module['exports']=function(_0x58d0f5,_0x4fc94d){return _0x58d0f5[_0xe26b('0x9')](_0xe26b('0xa'),attributes,{'tableName':_0xe26b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e98=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util'];(function(_0x98def1,_0x2be5b9){var _0x58bb48=function(_0x54e5ef){while(--_0x54e5ef){_0x98def1['push'](_0x98def1['shift']());}};_0x58bb48(++_0x2be5b9);}(_0x1e98,0x73));var _0x81e9=function(_0x48c841,_0x27374a){_0x48c841=_0x48c841-0x0;var _0x22c86f=_0x1e98[_0x48c841];return _0x22c86f;};'use strict';var _=require(_0x81e9('0x0'));var util=require(_0x81e9('0x1'));var logger=require(_0x81e9('0x2'))(_0x81e9('0x3'));var moment=require('moment');var BPromise=require(_0x81e9('0x4'));var rp=require(_0x81e9('0x5'));var fs=require('fs');var path=require(_0x81e9('0x6'));var rimraf=require('rimraf');var config=require(_0x81e9('0x7'));var attributes=require(_0x81e9('0x8'));var integrations=require(_0x81e9('0x9'));module[_0x81e9('0xa')]=function(_0x5829e3,_0x172098){return _0x5829e3[_0x81e9('0xb')]('ZendeskAccount',attributes,{'tableName':_0x81e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d3ebbbe..dcb79d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5ee=['util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetZendeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowZendeskAccount','ZendeskAccount','find','raw','lodash'];(function(_0x4a4fb8,_0x1c8af){var _0x1d27c8=function(_0x56ae4f){while(--_0x56ae4f){_0x4a4fb8['push'](_0x4a4fb8['shift']());}};_0x1d27c8(++_0x1c8af);}(_0xe5ee,0x8f));var _0xee5e=function(_0x2bfb97,_0x17c1c3){_0x2bfb97=_0x2bfb97-0x0;var _0x5f0166=_0xe5ee[_0x2bfb97];return _0x5f0166;};'use strict';var _=require(_0xee5e('0x0'));var util=require(_0xee5e('0x1'));var moment=require(_0xee5e('0x2'));var BPromise=require('bluebird');var rs=require(_0xee5e('0x3'));var fs=require('fs');var Redis=require(_0xee5e('0x4'));var db=require(_0xee5e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee5e('0x6'));var config=require(_0xee5e('0x7'));var jayson=require(_0xee5e('0x8'));var client=jayson[_0xee5e('0x9')][_0xee5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a5e57,_0x413988,_0x4deade){return new BPromise(function(_0x4c2615,_0x2e0ef9){return client['request'](_0x3a5e57,_0x4deade)[_0xee5e('0xb')](function(_0x42d173){logger['info'](_0xee5e('0xc'),_0x413988,_0xee5e('0xd'));logger[_0xee5e('0xe')](_0xee5e('0xf'),_0x413988,_0xee5e('0xd'),JSON[_0xee5e('0x10')](_0x42d173));if(_0x42d173[_0xee5e('0x11')]){if(_0x42d173[_0xee5e('0x11')][_0xee5e('0x12')]===0x1f4){logger[_0xee5e('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x413988,_0x42d173['error']['message']);return _0x2e0ef9(_0x42d173['error'][_0xee5e('0x13')]);}logger[_0xee5e('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x413988,_0x42d173[_0xee5e('0x11')][_0xee5e('0x13')]);return _0x4c2615(_0x42d173[_0xee5e('0x11')][_0xee5e('0x13')]);}else{logger[_0xee5e('0x14')](_0xee5e('0xc'),_0x413988,_0xee5e('0xd'));_0x4c2615(_0x42d173[_0xee5e('0x15')][_0xee5e('0x13')]);}})[_0xee5e('0x16')](function(_0x2341f3){logger[_0xee5e('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x413988,_0x2341f3);_0x2e0ef9(_0x2341f3);});});}exports[_0xee5e('0x17')]=function(_0x36d4c3){var _0x17637b=this;return new Promise(function(_0x300f23,_0x107f11){return db['ZendeskAccount'][_0xee5e('0x18')]({'raw':_0x36d4c3['options']?_0x36d4c3[_0xee5e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x36d4c3[_0xee5e('0x19')]?_0x36d4c3[_0xee5e('0x19')][_0xee5e('0x1a')]||null:null,'attributes':_0x36d4c3[_0xee5e('0x19')]?_0x36d4c3['options'][_0xee5e('0x1b')]||null:null,'limit':_0x36d4c3[_0xee5e('0x19')]?_0x36d4c3[_0xee5e('0x19')][_0xee5e('0x1c')]||null:null,'include':_0x36d4c3[_0xee5e('0x19')]?_0x36d4c3['options'][_0xee5e('0x1d')]?_[_0xee5e('0x1e')](_0x36d4c3[_0xee5e('0x19')]['include'],function(_0x573d58){return{'model':db[_0x573d58[_0xee5e('0x1f')]],'as':_0x573d58['as'],'attributes':_0x573d58[_0xee5e('0x1b')],'include':_0x573d58[_0xee5e('0x1d')]?_['map'](_0x573d58[_0xee5e('0x1d')],function(_0x453b4f){return{'model':db[_0x453b4f[_0xee5e('0x1f')]],'as':_0x453b4f['as'],'attributes':_0x453b4f['attributes'],'include':_0x453b4f[_0xee5e('0x1d')]?_['map'](_0x453b4f['include'],function(_0x514f37){return{'model':db[_0x514f37[_0xee5e('0x1f')]],'as':_0x514f37['as'],'attributes':_0x514f37[_0xee5e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xee5e('0xb')](function(_0x5425e8){logger['info']('GetZendeskAccount',_0x36d4c3);logger[_0xee5e('0xe')](_0xee5e('0x17'),_0x36d4c3,JSON['stringify'](_0x5425e8));_0x300f23(_0x5425e8);})[_0xee5e('0x16')](function(_0x5bfb67){logger[_0xee5e('0x11')](_0xee5e('0x17'),_0x5bfb67[_0xee5e('0x13')],_0x36d4c3);_0x107f11(_0x17637b[_0xee5e('0x11')](0x1f4,_0x5bfb67[_0xee5e('0x13')]));});});};exports[_0xee5e('0x20')]=function(_0x5d8aa0){var _0x21526a=this;return new Promise(function(_0x46bb1d,_0x60246c){return db[_0xee5e('0x21')][_0xee5e('0x22')]({'raw':_0x5d8aa0['options']?_0x5d8aa0['options'][_0xee5e('0x23')]===undefined?!![]:![]:!![],'where':_0x5d8aa0['options']?_0x5d8aa0[_0xee5e('0x19')]['where']||null:null,'attributes':_0x5d8aa0['options']?_0x5d8aa0['options'][_0xee5e('0x1b')]||null:null,'include':_0x5d8aa0[_0xee5e('0x19')]?_0x5d8aa0[_0xee5e('0x19')]['include']?_['map'](_0x5d8aa0['options'][_0xee5e('0x1d')],function(_0x36ac4c){return{'model':db[_0x36ac4c[_0xee5e('0x1f')]],'as':_0x36ac4c['as'],'attributes':_0x36ac4c['attributes'],'include':_0x36ac4c[_0xee5e('0x1d')]?_[_0xee5e('0x1e')](_0x36ac4c[_0xee5e('0x1d')],function(_0xc478a5){return{'model':db[_0xc478a5[_0xee5e('0x1f')]],'as':_0xc478a5['as'],'attributes':_0xc478a5[_0xee5e('0x1b')],'include':_0xc478a5[_0xee5e('0x1d')]?_[_0xee5e('0x1e')](_0xc478a5[_0xee5e('0x1d')],function(_0x2382c0){return{'model':db[_0x2382c0[_0xee5e('0x1f')]],'as':_0x2382c0['as'],'attributes':_0x2382c0[_0xee5e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x139510){logger[_0xee5e('0x14')]('ShowZendeskAccount',_0x5d8aa0);logger[_0xee5e('0xe')](_0xee5e('0x20'),_0x5d8aa0,JSON['stringify'](_0x139510));_0x46bb1d(_0x139510);})[_0xee5e('0x16')](function(_0x30bd15){logger['error']('ShowZendeskAccount',_0x30bd15[_0xee5e('0x13')],_0x5d8aa0);_0x60246c(_0x21526a[_0xee5e('0x11')](0x1f4,_0x30bd15[_0xee5e('0x13')]));});});};
\ No newline at end of file
+var _0xcdcb=['code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','where','limit','include','map','model','attributes','stringify','catch','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x408ff7,_0xfdf133){var _0x4b4abd=function(_0x472322){while(--_0x472322){_0x408ff7['push'](_0x408ff7['shift']());}};_0x4b4abd(++_0xfdf133);}(_0xcdcb,0x75));var _0xbcdc=function(_0x16cbab,_0x154522){_0x16cbab=_0x16cbab-0x0;var _0xe32356=_0xcdcb[_0x16cbab];return _0xe32356;};'use strict';var _=require('lodash');var util=require(_0xbcdc('0x0'));var moment=require(_0xbcdc('0x1'));var BPromise=require(_0xbcdc('0x2'));var rs=require(_0xbcdc('0x3'));var fs=require('fs');var Redis=require(_0xbcdc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcdc('0x5'));var logger=require(_0xbcdc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbcdc('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x280311,_0x868720,_0x5cba04){return new BPromise(function(_0xd1ab55,_0x391750){return client[_0xbcdc('0x8')](_0x280311,_0x5cba04)[_0xbcdc('0x9')](function(_0x247937){logger[_0xbcdc('0xa')](_0xbcdc('0xb'),_0x868720,_0xbcdc('0xc'));logger[_0xbcdc('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x868720,_0xbcdc('0xc'),JSON['stringify'](_0x247937));if(_0x247937[_0xbcdc('0xe')]){if(_0x247937[_0xbcdc('0xe')][_0xbcdc('0xf')]===0x1f4){logger[_0xbcdc('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x868720,_0x247937[_0xbcdc('0xe')][_0xbcdc('0x10')]);return _0x391750(_0x247937[_0xbcdc('0xe')][_0xbcdc('0x10')]);}logger[_0xbcdc('0xe')](_0xbcdc('0xb'),_0x868720,_0x247937[_0xbcdc('0xe')]['message']);return _0xd1ab55(_0x247937[_0xbcdc('0xe')]['message']);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x868720,_0xbcdc('0xc'));_0xd1ab55(_0x247937[_0xbcdc('0x11')]['message']);}})['catch'](function(_0x152775){logger[_0xbcdc('0xe')](_0xbcdc('0xb'),_0x868720,_0x152775);_0x391750(_0x152775);});});}exports[_0xbcdc('0x12')]=function(_0x2b6150){var _0x543ce6=this;return new Promise(function(_0x271b39,_0x549abe){return db[_0xbcdc('0x13')][_0xbcdc('0x14')]({'raw':_0x2b6150['options']?_0x2b6150[_0xbcdc('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2b6150[_0xbcdc('0x15')]?_0x2b6150[_0xbcdc('0x15')][_0xbcdc('0x16')]||null:null,'attributes':_0x2b6150[_0xbcdc('0x15')]?_0x2b6150['options']['attributes']||null:null,'limit':_0x2b6150[_0xbcdc('0x15')]?_0x2b6150[_0xbcdc('0x15')][_0xbcdc('0x17')]||null:null,'include':_0x2b6150['options']?_0x2b6150[_0xbcdc('0x15')][_0xbcdc('0x18')]?_[_0xbcdc('0x19')](_0x2b6150[_0xbcdc('0x15')][_0xbcdc('0x18')],function(_0x1ddab5){return{'model':db[_0x1ddab5[_0xbcdc('0x1a')]],'as':_0x1ddab5['as'],'attributes':_0x1ddab5[_0xbcdc('0x1b')],'include':_0x1ddab5[_0xbcdc('0x18')]?_['map'](_0x1ddab5[_0xbcdc('0x18')],function(_0x597e1f){return{'model':db[_0x597e1f['model']],'as':_0x597e1f['as'],'attributes':_0x597e1f[_0xbcdc('0x1b')],'include':_0x597e1f[_0xbcdc('0x18')]?_['map'](_0x597e1f[_0xbcdc('0x18')],function(_0x154412){return{'model':db[_0x154412[_0xbcdc('0x1a')]],'as':_0x154412['as'],'attributes':_0x154412['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcdc('0x9')](function(_0x29bc40){logger[_0xbcdc('0xa')]('GetZendeskAccount',_0x2b6150);logger[_0xbcdc('0xd')](_0xbcdc('0x12'),_0x2b6150,JSON[_0xbcdc('0x1c')](_0x29bc40));_0x271b39(_0x29bc40);})[_0xbcdc('0x1d')](function(_0x33472e){logger[_0xbcdc('0xe')](_0xbcdc('0x12'),_0x33472e[_0xbcdc('0x10')],_0x2b6150);_0x549abe(_0x543ce6[_0xbcdc('0xe')](0x1f4,_0x33472e[_0xbcdc('0x10')]));});});};exports[_0xbcdc('0x1e')]=function(_0x219c89){var _0x5e594c=this;return new Promise(function(_0x28682d,_0x2e2e89){return db[_0xbcdc('0x13')][_0xbcdc('0x1f')]({'raw':_0x219c89[_0xbcdc('0x15')]?_0x219c89[_0xbcdc('0x15')][_0xbcdc('0x20')]===undefined?!![]:![]:!![],'where':_0x219c89[_0xbcdc('0x15')]?_0x219c89[_0xbcdc('0x15')]['where']||null:null,'attributes':_0x219c89[_0xbcdc('0x15')]?_0x219c89[_0xbcdc('0x15')][_0xbcdc('0x1b')]||null:null,'include':_0x219c89['options']?_0x219c89[_0xbcdc('0x15')][_0xbcdc('0x18')]?_[_0xbcdc('0x19')](_0x219c89['options'][_0xbcdc('0x18')],function(_0xd66c0b){return{'model':db[_0xd66c0b['model']],'as':_0xd66c0b['as'],'attributes':_0xd66c0b['attributes'],'include':_0xd66c0b[_0xbcdc('0x18')]?_[_0xbcdc('0x19')](_0xd66c0b[_0xbcdc('0x18')],function(_0x60be38){return{'model':db[_0x60be38[_0xbcdc('0x1a')]],'as':_0x60be38['as'],'attributes':_0x60be38[_0xbcdc('0x1b')],'include':_0x60be38[_0xbcdc('0x18')]?_[_0xbcdc('0x19')](_0x60be38['include'],function(_0x5898d7){return{'model':db[_0x5898d7[_0xbcdc('0x1a')]],'as':_0x5898d7['as'],'attributes':_0x5898d7[_0xbcdc('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x515ea4){logger['info']('ShowZendeskAccount',_0x219c89);logger['debug'](_0xbcdc('0x1e'),_0x219c89,JSON['stringify'](_0x515ea4));_0x28682d(_0x515ea4);})['catch'](function(_0x229b56){logger[_0xbcdc('0xe')](_0xbcdc('0x1e'),_0x229b56[_0xbcdc('0x10')],_0x219c89);_0x2e2e89(_0x5e594c[_0xbcdc('0xe')](0x1f4,_0x229b56[_0xbcdc('0x10')]));});});};
\ No newline at end of file
index 60ecce4..da13629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0x878f,0x173));var _0xf878=function(_0x13b6c9,_0x2d38f3){_0x13b6c9=_0x13b6c9-0x0;var _0x45296b=_0x878f[_0x13b6c9];return _0x45296b;};'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
+var _0x153f=['/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0xa69828,_0x152619){var _0x32eb63=function(_0x53f15){while(--_0x53f15){_0xa69828['push'](_0xa69828['shift']());}};_0x32eb63(++_0x152619);}(_0x153f,0x15b));var _0xf153=function(_0x4fa4fb,_0x5b8963){_0x4fa4fb=_0x4fa4fb-0x0;var _0x394418=_0x153f[_0x4fa4fb];return _0x394418;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['get'](_0xf153('0x11'),auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router['get'](_0xf153('0x13'),auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);router[_0xf153('0x15')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x15')](_0xf153('0x13'),auth[_0xf153('0xa')](),controller['setTags']);router[_0xf153('0x17')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x19')]);router[_0xf153('0x1a')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x1b')]);module['exports']=router;
\ No newline at end of file
index 4b53d55..57d7c08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf02=['STRING','exports'];(function(_0x26602b,_0x57fca6){var _0x397729=function(_0x9d8f11){while(--_0x9d8f11){_0x26602b['push'](_0x26602b['shift']());}};_0x397729(++_0x57fca6);}(_0xdf02,0x1af));var _0x2df0=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xdf02[_0x4b7895];return _0x264180;};'use strict';var Sequelize=require('sequelize');module[_0x2df0('0x0')]={'name':{'type':Sequelize[_0x2df0('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xff62=['exports','STRING','sequelize'];(function(_0x57f886,_0x12d918){var _0x561e1d=function(_0x1d82f9){while(--_0x1d82f9){_0x57f886['push'](_0x57f886['shift']());}};_0x561e1d(++_0x12d918);}(_0xff62,0x149));var _0x2ff6=function(_0x5873fc,_0x18c3b0){_0x5873fc=_0x5873fc-0x0;var _0x33987a=_0xff62[_0x5873fc];return _0x33987a;};'use strict';var Sequelize=require(_0x2ff6('0x0'));module[_0x2ff6('0x1')]={'name':{'type':Sequelize[_0x2ff6('0x2')]},'description':{'type':Sequelize[_0x2ff6('0x2')]}};
\ No newline at end of file
index 0e800b9..b435396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8ae=['fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','end','error','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','ZendeskField','order','filter','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xd8ae,0x9e));var _0xed8a=function(_0x3e2f2e,_0xac9c52){_0x3e2f2e=_0x3e2f2e-0x0;var _0x4d4d01=_0xd8ae[_0x3e2f2e];return _0x4d4d01;};'use strict';var emlformat=require(_0xed8a('0x0'));var rimraf=require(_0xed8a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed8a('0x2'));var rp=require(_0xed8a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xed8a('0x4'));var util=require('util');var path=require(_0xed8a('0x5'));var sox=require(_0xed8a('0x6'));var csv=require(_0xed8a('0x7'));var ejs=require(_0xed8a('0x8'));var fs=require('fs');var fs_extra=require(_0xed8a('0x9'));var _=require(_0xed8a('0xa'));var squel=require(_0xed8a('0xb'));var crypto=require(_0xed8a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xed8a('0x7'));var querystring=require('querystring');var Papa=require(_0xed8a('0xd'));var Redis=require(_0xed8a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xed8a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed8a('0x10'));var logger=require(_0xed8a('0x11'))(_0xed8a('0x12'));var utils=require('../../config/utils');var config=require(_0xed8a('0x13'));var licenseUtil=require(_0xed8a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x169ffe,_0x4f53cf){_0x4f53cf=_0x4f53cf||0xcc;return function(_0x243ae7){if(_0x243ae7){return _0x169ffe[_0xed8a('0x15')](_0x4f53cf);}return _0x169ffe['status'](_0x4f53cf)['end']();};}function respondWithResult(_0x16797e,_0x1a6426){_0x1a6426=_0x1a6426||0xc8;return function(_0x1864ff){if(_0x1864ff){return _0x16797e[_0xed8a('0x16')](_0x1a6426)[_0xed8a('0x17')](_0x1864ff);}};}function respondWithFilteredResult(_0x56d27d,_0x11bba0){return function(_0x2498e7){if(_0x2498e7){var _0x60ea2f=typeof _0x11bba0[_0xed8a('0x18')]===_0xed8a('0x19')&&typeof _0x11bba0[_0xed8a('0x1a')]===_0xed8a('0x19');var _0x358ef5=_0x2498e7[_0xed8a('0x1b')];var _0x3d2a1b=_0x60ea2f?0x0:_0x11bba0['offset'];var _0x59ebeb=_0x60ea2f?_0x2498e7[_0xed8a('0x1b')]:_0x11bba0['offset']+_0x11bba0[_0xed8a('0x1a')];var _0x5bc4af;if(_0x59ebeb>=_0x358ef5){_0x59ebeb=_0x358ef5;_0x5bc4af=0xc8;}else{_0x5bc4af=0xce;}_0x56d27d[_0xed8a('0x16')](_0x5bc4af);return _0x56d27d['set']('Content-Range',_0x3d2a1b+'-'+_0x59ebeb+'/'+_0x358ef5)[_0xed8a('0x17')](_0x2498e7);}return null;};}function patchUpdates(_0x5025a4){return function(_0x32648c){try{jsonpatch[_0xed8a('0x1c')](_0x32648c,_0x5025a4,!![]);}catch(_0x49d26f){return BPromise['reject'](_0x49d26f);}return _0x32648c[_0xed8a('0x1d')]();};}function saveUpdates(_0x5b9d6c,_0x20a281){return function(_0x254130){if(_0x254130){return _0x254130[_0xed8a('0x1e')](_0x5b9d6c)[_0xed8a('0x1f')](function(_0xcbee69){return _0xcbee69;});}return null;};}function removeEntity(_0x3dff3c,_0x25c8ab){return function(_0x175abc){if(_0x175abc){return _0x175abc[_0xed8a('0x20')]()[_0xed8a('0x1f')](function(){_0x3dff3c[_0xed8a('0x16')](0xcc)[_0xed8a('0x21')]();});}};}function handleEntityNotFound(_0x42d9d9,_0x5127b3){return function(_0x31a8f3){if(!_0x31a8f3){_0x42d9d9[_0xed8a('0x15')](0x194);}return _0x31a8f3;};}function handleError(_0x592ab3,_0xaf647f){_0xaf647f=_0xaf647f||0x1f4;return function(_0x58448d){logger[_0xed8a('0x22')](_0x58448d['stack']);if(_0x58448d[_0xed8a('0x23')]){delete _0x58448d[_0xed8a('0x23')];}_0x592ab3[_0xed8a('0x16')](_0xaf647f)[_0xed8a('0x24')](_0x58448d);};}exports[_0xed8a('0x25')]=function(_0x3aef91,_0x250c6d){var _0x5189f8={},_0x4d541b={},_0x55609a={'count':0x0,'rows':[]};var _0x28a527=_['map'](db[_0xed8a('0x26')][_0xed8a('0x27')],function(_0x5dcf0a){return{'name':_0x5dcf0a[_0xed8a('0x28')],'type':_0x5dcf0a[_0xed8a('0x29')][_0xed8a('0x2a')]};});_0x4d541b[_0xed8a('0x2b')]=_[_0xed8a('0x2c')](_0x28a527,'name');_0x4d541b[_0xed8a('0x2d')]=_['keys'](_0x3aef91[_0xed8a('0x2d')]);_0x4d541b[_0xed8a('0x2e')]=_[_0xed8a('0x2f')](_0x4d541b[_0xed8a('0x2b')],_0x4d541b[_0xed8a('0x2d')]);_0x5189f8[_0xed8a('0x30')]=_[_0xed8a('0x2f')](_0x4d541b[_0xed8a('0x2b')],qs[_0xed8a('0x31')](_0x3aef91[_0xed8a('0x2d')][_0xed8a('0x31')]));_0x5189f8[_0xed8a('0x30')]=_0x5189f8[_0xed8a('0x30')][_0xed8a('0x32')]?_0x5189f8[_0xed8a('0x30')]:_0x4d541b[_0xed8a('0x2b')];if(!_0x3aef91[_0xed8a('0x2d')][_0xed8a('0x33')](_0xed8a('0x34'))){_0x5189f8['limit']=qs[_0xed8a('0x1a')](_0x3aef91[_0xed8a('0x2d')][_0xed8a('0x1a')]);_0x5189f8['offset']=qs['offset'](_0x3aef91[_0xed8a('0x2d')]['offset']);}_0x5189f8['order']=qs[_0xed8a('0x35')](_0x3aef91[_0xed8a('0x2d')][_0xed8a('0x35')]);_0x5189f8['where']=qs[_0xed8a('0x2e')](_[_0xed8a('0x36')](_0x3aef91[_0xed8a('0x2d')],_0x4d541b[_0xed8a('0x2e')]),_0x28a527);if(_0x3aef91[_0xed8a('0x2d')]['filter']){_0x5189f8[_0xed8a('0x37')]=_[_0xed8a('0x38')](_0x5189f8[_0xed8a('0x37')],{'$or':_[_0xed8a('0x2c')](_0x28a527,function(_0x3e3cca){if(_0x3e3cca[_0xed8a('0x29')]!=='VIRTUAL'){var _0x208682={};_0x208682[_0x3e3cca[_0xed8a('0x23')]]={'$like':'%'+_0x3aef91['query']['filter']+'%'};return _0x208682;}})});}_0x5189f8=_['merge']({},_0x5189f8,_0x3aef91[_0xed8a('0x39')]);var _0x1fda83={'where':_0x5189f8[_0xed8a('0x37')]};return db[_0xed8a('0x26')][_0xed8a('0x1b')](_0x1fda83)[_0xed8a('0x1f')](function(_0x527a51){_0x55609a[_0xed8a('0x1b')]=_0x527a51;if(_0x3aef91[_0xed8a('0x2d')][_0xed8a('0x3a')]){_0x5189f8[_0xed8a('0x3b')]=[{'all':!![]}];}return db[_0xed8a('0x26')][_0xed8a('0x3c')](_0x5189f8);})[_0xed8a('0x1f')](function(_0xf6bb1f){_0x55609a[_0xed8a('0x3d')]=_0xf6bb1f;return _0x55609a;})['then'](respondWithFilteredResult(_0x250c6d,_0x5189f8))[_0xed8a('0x3e')](handleError(_0x250c6d,null));};exports[_0xed8a('0x3f')]=function(_0x52c493,_0x511f4f){var _0x38d488={'raw':![],'where':{'id':_0x52c493[_0xed8a('0x40')]['id']}},_0x101883={};_0x101883[_0xed8a('0x2b')]=_[_0xed8a('0x41')](db[_0xed8a('0x26')][_0xed8a('0x27')]);_0x101883[_0xed8a('0x2d')]=_[_0xed8a('0x41')](_0x52c493['query']);_0x101883[_0xed8a('0x2e')]=_['intersection'](_0x101883['model'],_0x101883[_0xed8a('0x2d')]);_0x38d488['attributes']=_[_0xed8a('0x2f')](_0x101883[_0xed8a('0x2b')],qs[_0xed8a('0x31')](_0x52c493[_0xed8a('0x2d')]['fields']));_0x38d488[_0xed8a('0x30')]=_0x38d488[_0xed8a('0x30')][_0xed8a('0x32')]?_0x38d488[_0xed8a('0x30')]:_0x101883[_0xed8a('0x2b')];if(_0x52c493[_0xed8a('0x2d')][_0xed8a('0x3a')]){_0x38d488[_0xed8a('0x3b')]=[{'all':!![]}];}_0x38d488=_[_0xed8a('0x38')]({},_0x38d488,_0x52c493['options']);return db[_0xed8a('0x26')][_0xed8a('0x42')](_0x38d488)[_0xed8a('0x1f')](handleEntityNotFound(_0x511f4f,null))[_0xed8a('0x1f')](respondWithResult(_0x511f4f,null))[_0xed8a('0x3e')](handleError(_0x511f4f,null));};exports[_0xed8a('0x43')]=function(_0x11b07a,_0x5c4a45){return db['ZendeskConfiguration'][_0xed8a('0x43')](_0x11b07a[_0xed8a('0x44')],{})[_0xed8a('0x1f')](respondWithResult(_0x5c4a45,0xc9))['catch'](handleError(_0x5c4a45,null));};exports['update']=function(_0x2f72dd,_0x488e91){if(_0x2f72dd['body']['id']){delete _0x2f72dd[_0xed8a('0x44')]['id'];}return db[_0xed8a('0x26')][_0xed8a('0x42')]({'where':{'id':_0x2f72dd['params']['id']}})[_0xed8a('0x1f')](handleEntityNotFound(_0x488e91,null))[_0xed8a('0x1f')](saveUpdates(_0x2f72dd[_0xed8a('0x44')],null))[_0xed8a('0x1f')](respondWithResult(_0x488e91,null))['catch'](handleError(_0x488e91,null));};exports[_0xed8a('0x20')]=function(_0x4d5dd2,_0x52f0d1){return db[_0xed8a('0x26')][_0xed8a('0x42')]({'where':{'id':_0x4d5dd2[_0xed8a('0x40')]['id']}})['then'](handleEntityNotFound(_0x52f0d1,null))[_0xed8a('0x1f')](removeEntity(_0x52f0d1,null))[_0xed8a('0x3e')](handleError(_0x52f0d1,null));};exports[_0xed8a('0x45')]=function(_0x108277,_0x1275ee,_0x2dbb7d){var _0x155673={};var _0x57e5c9={};var _0x2ad67e;var _0xcc7613;return db[_0xed8a('0x26')][_0xed8a('0x46')]({'where':{'id':_0x108277[_0xed8a('0x40')]['id']}})['then'](handleEntityNotFound(_0x1275ee,null))['then'](function(_0x3309bc){if(_0x3309bc){_0x2ad67e=_0x3309bc;_0x57e5c9[_0xed8a('0x2b')]=_[_0xed8a('0x41')](db[_0xed8a('0x47')]['rawAttributes']);_0x57e5c9[_0xed8a('0x2d')]=_[_0xed8a('0x41')](_0x108277[_0xed8a('0x2d')]);_0x57e5c9[_0xed8a('0x2e')]=_[_0xed8a('0x2f')](_0x57e5c9['model'],_0x57e5c9['query']);_0x155673[_0xed8a('0x30')]=_[_0xed8a('0x2f')](_0x57e5c9[_0xed8a('0x2b')],qs[_0xed8a('0x31')](_0x108277[_0xed8a('0x2d')][_0xed8a('0x31')]));_0x155673[_0xed8a('0x30')]=_0x155673[_0xed8a('0x30')][_0xed8a('0x32')]?_0x155673[_0xed8a('0x30')]:_0x57e5c9['model'];_0x155673[_0xed8a('0x48')]=qs[_0xed8a('0x35')](_0x108277['query'][_0xed8a('0x35')]);_0x155673[_0xed8a('0x37')]=qs[_0xed8a('0x2e')](_[_0xed8a('0x36')](_0x108277['query'],_0x57e5c9[_0xed8a('0x2e')]));if(_0x108277[_0xed8a('0x2d')][_0xed8a('0x49')]){_0x155673[_0xed8a('0x37')]=_[_0xed8a('0x38')](_0x155673['where'],{'$or':_[_0xed8a('0x2c')](_0x155673[_0xed8a('0x30')],function(_0x2bd182){var _0x202073={};_0x202073[_0x2bd182]={'$like':'%'+_0x108277[_0xed8a('0x2d')][_0xed8a('0x49')]+'%'};return _0x202073;})});}_0x155673=_[_0xed8a('0x38')]({},_0x155673,_0x108277['options']);return _0x2ad67e[_0xed8a('0x45')](_0x155673);}})[_0xed8a('0x1f')](function(_0x582597){if(_0x582597){_0xcc7613=_0x582597['length'];if(!_0x108277[_0xed8a('0x2d')][_0xed8a('0x33')](_0xed8a('0x34'))){_0x155673[_0xed8a('0x1a')]=qs[_0xed8a('0x1a')](_0x108277[_0xed8a('0x2d')][_0xed8a('0x1a')]);_0x155673[_0xed8a('0x18')]=qs[_0xed8a('0x18')](_0x108277[_0xed8a('0x2d')][_0xed8a('0x18')]);}return _0x2ad67e[_0xed8a('0x45')](_0x155673);}})[_0xed8a('0x1f')](function(_0x304220){if(_0x304220){return _0x304220?{'count':_0xcc7613,'rows':_0x304220}:null;}})[_0xed8a('0x1f')](respondWithResult(_0x1275ee,null))['catch'](handleError(_0x1275ee,null));};exports[_0xed8a('0x4a')]=function(_0x35d27f,_0x462f59,_0x1c88c3){var _0x122232={};var _0xbfb787={};var _0x1cf2eb;var _0x3ceef4;return db[_0xed8a('0x26')][_0xed8a('0x46')]({'where':{'id':_0x35d27f['params']['id']}})[_0xed8a('0x1f')](handleEntityNotFound(_0x462f59,null))['then'](function(_0xe44672){if(_0xe44672){_0x1cf2eb=_0xe44672;_0xbfb787['model']=_[_0xed8a('0x41')](db['ZendeskField'][_0xed8a('0x27')]);_0xbfb787['query']=_[_0xed8a('0x41')](_0x35d27f['query']);_0xbfb787['filters']=_[_0xed8a('0x2f')](_0xbfb787[_0xed8a('0x2b')],_0xbfb787['query']);_0x122232[_0xed8a('0x30')]=_['intersection'](_0xbfb787[_0xed8a('0x2b')],qs['fields'](_0x35d27f['query'][_0xed8a('0x31')]));_0x122232[_0xed8a('0x30')]=_0x122232[_0xed8a('0x30')][_0xed8a('0x32')]?_0x122232[_0xed8a('0x30')]:_0xbfb787[_0xed8a('0x2b')];_0x122232[_0xed8a('0x48')]=qs['sort'](_0x35d27f[_0xed8a('0x2d')][_0xed8a('0x35')]);_0x122232[_0xed8a('0x37')]=qs[_0xed8a('0x2e')](_[_0xed8a('0x36')](_0x35d27f[_0xed8a('0x2d')],_0xbfb787[_0xed8a('0x2e')]));if(_0x35d27f['query'][_0xed8a('0x49')]){_0x122232[_0xed8a('0x37')]=_[_0xed8a('0x38')](_0x122232[_0xed8a('0x37')],{'$or':_[_0xed8a('0x2c')](_0x122232[_0xed8a('0x30')],function(_0x4f28e6){var _0x229327={};_0x229327[_0x4f28e6]={'$like':'%'+_0x35d27f['query']['filter']+'%'};return _0x229327;})});}_0x122232=_[_0xed8a('0x38')]({},_0x122232,_0x35d27f[_0xed8a('0x39')]);return _0x1cf2eb['getSubjects'](_0x122232);}})[_0xed8a('0x1f')](function(_0x139731){if(_0x139731){_0x3ceef4=_0x139731[_0xed8a('0x32')];if(!_0x35d27f[_0xed8a('0x2d')][_0xed8a('0x33')]('nolimit')){_0x122232['limit']=qs[_0xed8a('0x1a')](_0x35d27f[_0xed8a('0x2d')]['limit']);_0x122232[_0xed8a('0x18')]=qs[_0xed8a('0x18')](_0x35d27f['query'][_0xed8a('0x18')]);}return _0x1cf2eb[_0xed8a('0x4a')](_0x122232);}})['then'](function(_0x483799){if(_0x483799){return _0x483799?{'count':_0x3ceef4,'rows':_0x483799}:null;}})[_0xed8a('0x1f')](respondWithResult(_0x462f59,null))[_0xed8a('0x3e')](handleError(_0x462f59,null));};exports[_0xed8a('0x4b')]=function(_0x450822,_0x21beb2,_0x100bb7){var _0x15e871={};var _0x55144b={};var _0x55f04c;var _0x561399;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x450822[_0xed8a('0x40')]['id']}})[_0xed8a('0x1f')](handleEntityNotFound(_0x21beb2,null))[_0xed8a('0x1f')](function(_0x231946){if(_0x231946){_0x55f04c=_0x231946;_0x55144b[_0xed8a('0x2b')]=_[_0xed8a('0x41')](db[_0xed8a('0x47')]['rawAttributes']);_0x55144b['query']=_[_0xed8a('0x41')](_0x450822[_0xed8a('0x2d')]);_0x55144b['filters']=_[_0xed8a('0x2f')](_0x55144b[_0xed8a('0x2b')],_0x55144b[_0xed8a('0x2d')]);_0x15e871[_0xed8a('0x30')]=_['intersection'](_0x55144b[_0xed8a('0x2b')],qs[_0xed8a('0x31')](_0x450822[_0xed8a('0x2d')]['fields']));_0x15e871[_0xed8a('0x30')]=_0x15e871[_0xed8a('0x30')][_0xed8a('0x32')]?_0x15e871['attributes']:_0x55144b[_0xed8a('0x2b')];_0x15e871[_0xed8a('0x48')]=qs[_0xed8a('0x35')](_0x450822[_0xed8a('0x2d')]['sort']);_0x15e871[_0xed8a('0x37')]=qs[_0xed8a('0x2e')](_['pick'](_0x450822[_0xed8a('0x2d')],_0x55144b['filters']));if(_0x450822[_0xed8a('0x2d')][_0xed8a('0x49')]){_0x15e871[_0xed8a('0x37')]=_[_0xed8a('0x38')](_0x15e871[_0xed8a('0x37')],{'$or':_[_0xed8a('0x2c')](_0x15e871['attributes'],function(_0x295b48){var _0x159436={};_0x159436[_0x295b48]={'$like':'%'+_0x450822['query'][_0xed8a('0x49')]+'%'};return _0x159436;})});}_0x15e871=_['merge']({},_0x15e871,_0x450822['options']);return _0x55f04c[_0xed8a('0x4b')](_0x15e871);}})[_0xed8a('0x1f')](function(_0x1e5a5d){if(_0x1e5a5d){_0x561399=_0x1e5a5d[_0xed8a('0x32')];if(!_0x450822['query'][_0xed8a('0x33')](_0xed8a('0x34'))){_0x15e871['limit']=qs['limit'](_0x450822[_0xed8a('0x2d')][_0xed8a('0x1a')]);_0x15e871[_0xed8a('0x18')]=qs['offset'](_0x450822[_0xed8a('0x2d')]['offset']);}return _0x55f04c['getDescriptions'](_0x15e871);}})['then'](function(_0x561f4b){if(_0x561f4b){return _0x561f4b?{'count':_0x561399,'rows':_0x561f4b}:null;}})[_0xed8a('0x1f')](respondWithResult(_0x21beb2,null))['catch'](handleError(_0x21beb2,null));};exports['getTags']=function(_0x50c59f,_0x249462,_0x1f86a2){var _0x43cb8d={};var _0x76caa7={};var _0x2956ee;var _0xa60244;return db[_0xed8a('0x26')][_0xed8a('0x46')]({'where':{'id':_0x50c59f[_0xed8a('0x40')]['id']}})[_0xed8a('0x1f')](handleEntityNotFound(_0x249462,null))[_0xed8a('0x1f')](function(_0x1ed530){if(_0x1ed530){_0x2956ee=_0x1ed530;_0x76caa7[_0xed8a('0x2b')]=_[_0xed8a('0x41')](db[_0xed8a('0x4c')][_0xed8a('0x27')]);_0x76caa7[_0xed8a('0x2d')]=_['keys'](_0x50c59f[_0xed8a('0x2d')]);_0x76caa7[_0xed8a('0x2e')]=_[_0xed8a('0x2f')](_0x76caa7[_0xed8a('0x2b')],_0x76caa7['query']);_0x43cb8d[_0xed8a('0x30')]=_[_0xed8a('0x2f')](_0x76caa7[_0xed8a('0x2b')],qs[_0xed8a('0x31')](_0x50c59f[_0xed8a('0x2d')]['fields']));_0x43cb8d[_0xed8a('0x30')]=_0x43cb8d[_0xed8a('0x30')][_0xed8a('0x32')]?_0x43cb8d[_0xed8a('0x30')]:_0x76caa7[_0xed8a('0x2b')];_0x43cb8d[_0xed8a('0x48')]=qs['sort'](_0x50c59f['query']['sort']);_0x43cb8d['where']=qs[_0xed8a('0x2e')](_[_0xed8a('0x36')](_0x50c59f[_0xed8a('0x2d')],_0x76caa7[_0xed8a('0x2e')]));if(_0x50c59f['query'][_0xed8a('0x49')]){_0x43cb8d[_0xed8a('0x37')]=_['merge'](_0x43cb8d['where'],{'$or':_[_0xed8a('0x2c')](_0x43cb8d['attributes'],function(_0x9f5ff8){var _0x9a97a5={};_0x9a97a5[_0x9f5ff8]={'$like':'%'+_0x50c59f[_0xed8a('0x2d')][_0xed8a('0x49')]+'%'};return _0x9a97a5;})});}_0x43cb8d=_[_0xed8a('0x38')]({},_0x43cb8d,_0x50c59f['options']);return _0x2956ee[_0xed8a('0x4d')](_0x43cb8d);}})[_0xed8a('0x1f')](function(_0x3b5561){if(_0x3b5561){_0xa60244=_0x3b5561[_0xed8a('0x32')];if(!_0x50c59f[_0xed8a('0x2d')][_0xed8a('0x33')]('nolimit')){_0x43cb8d[_0xed8a('0x1a')]=qs[_0xed8a('0x1a')](_0x50c59f[_0xed8a('0x2d')][_0xed8a('0x1a')]);_0x43cb8d[_0xed8a('0x18')]=qs[_0xed8a('0x18')](_0x50c59f[_0xed8a('0x2d')]['offset']);}return _0x2956ee[_0xed8a('0x4d')](_0x43cb8d);}})[_0xed8a('0x1f')](function(_0x1b8bf5){if(_0x1b8bf5){return _0x1b8bf5?{'count':_0xa60244,'rows':_0x1b8bf5}:null;}})[_0xed8a('0x1f')](respondWithResult(_0x249462,null))[_0xed8a('0x3e')](handleError(_0x249462,null));};exports['setTags']=function(_0x422e17,_0x3d2143,_0x445e3a){if(_0x422e17[_0xed8a('0x44')]['id']){delete _0x422e17[_0xed8a('0x44')]['id'];}return db['ZendeskConfiguration'][_0xed8a('0x46')]({'where':{'id':_0x422e17[_0xed8a('0x40')]['id']}})[_0xed8a('0x1f')](handleEntityNotFound(_0x3d2143,null))[_0xed8a('0x1f')](function(_0x29f9da){if(_0x29f9da){return _0x29f9da[_0xed8a('0x4e')](_0x422e17[_0xed8a('0x44')][_0xed8a('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x3d2143,null))[_0xed8a('0x3e')](handleError(_0x3d2143,null));};
\ No newline at end of file
+var _0x4b68=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','error','name','send','index','ZendeskConfiguration','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x4c25cb,_0xce5c6c){var _0x5a61f2=function(_0x5ad642){while(--_0x5ad642){_0x4c25cb['push'](_0x4c25cb['shift']());}};_0x5a61f2(++_0xce5c6c);}(_0x4b68,0xe9));var _0x84b6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4b68[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x84b6('0x0'));var rimraf=require(_0x84b6('0x1'));var zipdir=require(_0x84b6('0x2'));var jsonpatch=require(_0x84b6('0x3'));var rp=require(_0x84b6('0x4'));var moment=require(_0x84b6('0x5'));var BPromise=require(_0x84b6('0x6'));var Mustache=require(_0x84b6('0x7'));var util=require('util');var path=require(_0x84b6('0x8'));var sox=require(_0x84b6('0x9'));var csv=require('to-csv');var ejs=require(_0x84b6('0xa'));var fs=require('fs');var fs_extra=require(_0x84b6('0xb'));var _=require(_0x84b6('0xc'));var squel=require(_0x84b6('0xd'));var crypto=require('crypto');var jsforce=require(_0x84b6('0xe'));var deskjs=require(_0x84b6('0xf'));var toCsv=require(_0x84b6('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x84b6('0x11'));var authService=require(_0x84b6('0x12'));var qs=require(_0x84b6('0x13'));var as=require(_0x84b6('0x14'));var hardwareService=require(_0x84b6('0x15'));var logger=require(_0x84b6('0x16'))(_0x84b6('0x17'));var utils=require('../../config/utils');var config=require(_0x84b6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x84b6('0x19'))['db'];function respondWithStatusCode(_0x446558,_0x1243a2){_0x1243a2=_0x1243a2||0xcc;return function(_0x5d12ea){if(_0x5d12ea){return _0x446558['sendStatus'](_0x1243a2);}return _0x446558[_0x84b6('0x1a')](_0x1243a2)[_0x84b6('0x1b')]();};}function respondWithResult(_0x5eb04d,_0x37b00c){_0x37b00c=_0x37b00c||0xc8;return function(_0x2f0d68){if(_0x2f0d68){return _0x5eb04d[_0x84b6('0x1a')](_0x37b00c)[_0x84b6('0x1c')](_0x2f0d68);}};}function respondWithFilteredResult(_0xc57d6e,_0x1fd92a){return function(_0x11fe88){if(_0x11fe88){var _0x298f1b=typeof _0x1fd92a[_0x84b6('0x1d')]===_0x84b6('0x1e')&&typeof _0x1fd92a['limit']===_0x84b6('0x1e');var _0x309c06=_0x11fe88['count'];var _0x46e1f1=_0x298f1b?0x0:_0x1fd92a['offset'];var _0x339a25=_0x298f1b?_0x11fe88[_0x84b6('0x1f')]:_0x1fd92a[_0x84b6('0x1d')]+_0x1fd92a[_0x84b6('0x20')];var _0x43cd95;if(_0x339a25>=_0x309c06){_0x339a25=_0x309c06;_0x43cd95=0xc8;}else{_0x43cd95=0xce;}_0xc57d6e['status'](_0x43cd95);return _0xc57d6e[_0x84b6('0x21')]('Content-Range',_0x46e1f1+'-'+_0x339a25+'/'+_0x309c06)['json'](_0x11fe88);}return null;};}function patchUpdates(_0xf3028d){return function(_0x42f500){try{jsonpatch[_0x84b6('0x22')](_0x42f500,_0xf3028d,!![]);}catch(_0x57a138){return BPromise['reject'](_0x57a138);}return _0x42f500[_0x84b6('0x23')]();};}function saveUpdates(_0x5418ca,_0x3c0794){return function(_0x5355bd){if(_0x5355bd){return _0x5355bd[_0x84b6('0x24')](_0x5418ca)['then'](function(_0x20f559){return _0x20f559;});}return null;};}function removeEntity(_0x5a88ae,_0x1eca8f){return function(_0x17b26d){if(_0x17b26d){return _0x17b26d[_0x84b6('0x25')]()[_0x84b6('0x26')](function(){_0x5a88ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56a894,_0x5d904f){return function(_0xf78fc3){if(!_0xf78fc3){_0x56a894['sendStatus'](0x194);}return _0xf78fc3;};}function handleError(_0x21cc95,_0x314fbb){_0x314fbb=_0x314fbb||0x1f4;return function(_0x429e2e){logger[_0x84b6('0x27')](_0x429e2e['stack']);if(_0x429e2e[_0x84b6('0x28')]){delete _0x429e2e[_0x84b6('0x28')];}_0x21cc95['status'](_0x314fbb)[_0x84b6('0x29')](_0x429e2e);};}exports[_0x84b6('0x2a')]=function(_0x36a0c7,_0x4230ec){var _0x487490={},_0x354345={},_0x1bbb7a={'count':0x0,'rows':[]};var _0x3a81a0=_['map'](db[_0x84b6('0x2b')]['rawAttributes'],function(_0x339f02){return{'name':_0x339f02[_0x84b6('0x2c')],'type':_0x339f02[_0x84b6('0x2d')]['key']};});_0x354345[_0x84b6('0x2e')]=_[_0x84b6('0x2f')](_0x3a81a0,_0x84b6('0x28'));_0x354345[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0x36a0c7['query']);_0x354345[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x354345[_0x84b6('0x2e')],_0x354345[_0x84b6('0x30')]);_0x487490[_0x84b6('0x34')]=_[_0x84b6('0x33')](_0x354345[_0x84b6('0x2e')],qs[_0x84b6('0x35')](_0x36a0c7[_0x84b6('0x30')][_0x84b6('0x35')]));_0x487490['attributes']=_0x487490[_0x84b6('0x34')][_0x84b6('0x36')]?_0x487490[_0x84b6('0x34')]:_0x354345[_0x84b6('0x2e')];if(!_0x36a0c7[_0x84b6('0x30')][_0x84b6('0x37')](_0x84b6('0x38'))){_0x487490['limit']=qs[_0x84b6('0x20')](_0x36a0c7['query'][_0x84b6('0x20')]);_0x487490['offset']=qs['offset'](_0x36a0c7[_0x84b6('0x30')][_0x84b6('0x1d')]);}_0x487490[_0x84b6('0x39')]=qs['sort'](_0x36a0c7['query'][_0x84b6('0x3a')]);_0x487490[_0x84b6('0x3b')]=qs[_0x84b6('0x32')](_[_0x84b6('0x3c')](_0x36a0c7[_0x84b6('0x30')],_0x354345['filters']),_0x3a81a0);if(_0x36a0c7[_0x84b6('0x30')][_0x84b6('0x3d')]){_0x487490[_0x84b6('0x3b')]=_[_0x84b6('0x3e')](_0x487490[_0x84b6('0x3b')],{'$or':_['map'](_0x3a81a0,function(_0x320b47){if(_0x320b47[_0x84b6('0x2d')]!==_0x84b6('0x3f')){var _0x4c2c91={};_0x4c2c91[_0x320b47['name']]={'$like':'%'+_0x36a0c7['query'][_0x84b6('0x3d')]+'%'};return _0x4c2c91;}})});}_0x487490=_[_0x84b6('0x3e')]({},_0x487490,_0x36a0c7[_0x84b6('0x40')]);var _0x1e033d={'where':_0x487490['where']};return db[_0x84b6('0x2b')][_0x84b6('0x1f')](_0x1e033d)[_0x84b6('0x26')](function(_0x1b1df8){_0x1bbb7a[_0x84b6('0x1f')]=_0x1b1df8;if(_0x36a0c7['query']['includeAll']){_0x487490[_0x84b6('0x41')]=[{'all':!![]}];}return db[_0x84b6('0x2b')][_0x84b6('0x42')](_0x487490);})[_0x84b6('0x26')](function(_0x59659f){_0x1bbb7a[_0x84b6('0x43')]=_0x59659f;return _0x1bbb7a;})[_0x84b6('0x26')](respondWithFilteredResult(_0x4230ec,_0x487490))[_0x84b6('0x44')](handleError(_0x4230ec,null));};exports[_0x84b6('0x45')]=function(_0x47e5c0,_0x5a855b){var _0x3d1e73={'raw':![],'where':{'id':_0x47e5c0[_0x84b6('0x46')]['id']}},_0x47815e={};_0x47815e[_0x84b6('0x2e')]=_[_0x84b6('0x31')](db['ZendeskConfiguration'][_0x84b6('0x47')]);_0x47815e[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0x47e5c0['query']);_0x47815e[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x47815e[_0x84b6('0x2e')],_0x47815e[_0x84b6('0x30')]);_0x3d1e73['attributes']=_['intersection'](_0x47815e[_0x84b6('0x2e')],qs[_0x84b6('0x35')](_0x47e5c0[_0x84b6('0x30')][_0x84b6('0x35')]));_0x3d1e73['attributes']=_0x3d1e73['attributes'][_0x84b6('0x36')]?_0x3d1e73[_0x84b6('0x34')]:_0x47815e[_0x84b6('0x2e')];if(_0x47e5c0['query'][_0x84b6('0x48')]){_0x3d1e73[_0x84b6('0x41')]=[{'all':!![]}];}_0x3d1e73=_[_0x84b6('0x3e')]({},_0x3d1e73,_0x47e5c0[_0x84b6('0x40')]);return db[_0x84b6('0x2b')][_0x84b6('0x49')](_0x3d1e73)[_0x84b6('0x26')](handleEntityNotFound(_0x5a855b,null))[_0x84b6('0x26')](respondWithResult(_0x5a855b,null))[_0x84b6('0x44')](handleError(_0x5a855b,null));};exports[_0x84b6('0x4a')]=function(_0x53f983,_0xd08edd){return db[_0x84b6('0x2b')][_0x84b6('0x4a')](_0x53f983[_0x84b6('0x4b')],{})['then'](respondWithResult(_0xd08edd,0xc9))['catch'](handleError(_0xd08edd,null));};exports['update']=function(_0x391c1d,_0x2d33bd){if(_0x391c1d[_0x84b6('0x4b')]['id']){delete _0x391c1d[_0x84b6('0x4b')]['id'];}return db['ZendeskConfiguration'][_0x84b6('0x49')]({'where':{'id':_0x391c1d['params']['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0x2d33bd,null))[_0x84b6('0x26')](saveUpdates(_0x391c1d[_0x84b6('0x4b')],null))[_0x84b6('0x26')](respondWithResult(_0x2d33bd,null))['catch'](handleError(_0x2d33bd,null));};exports['destroy']=function(_0x37713e,_0x409c1c){return db[_0x84b6('0x2b')]['find']({'where':{'id':_0x37713e[_0x84b6('0x46')]['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0x409c1c,null))[_0x84b6('0x26')](removeEntity(_0x409c1c,null))[_0x84b6('0x44')](handleError(_0x409c1c,null));};exports[_0x84b6('0x4c')]=function(_0x2a9f50,_0x3587f7,_0x31028e){var _0x9548df={};var _0x4e4317={};var _0x157b49;var _0x186432;return db[_0x84b6('0x2b')][_0x84b6('0x4d')]({'where':{'id':_0x2a9f50[_0x84b6('0x46')]['id']}})['then'](handleEntityNotFound(_0x3587f7,null))['then'](function(_0xfb6f64){if(_0xfb6f64){_0x157b49=_0xfb6f64;_0x4e4317[_0x84b6('0x2e')]=_[_0x84b6('0x31')](db['ZendeskField']['rawAttributes']);_0x4e4317[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0x2a9f50[_0x84b6('0x30')]);_0x4e4317[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x4e4317[_0x84b6('0x2e')],_0x4e4317[_0x84b6('0x30')]);_0x9548df[_0x84b6('0x34')]=_[_0x84b6('0x33')](_0x4e4317['model'],qs[_0x84b6('0x35')](_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x35')]));_0x9548df[_0x84b6('0x34')]=_0x9548df[_0x84b6('0x34')][_0x84b6('0x36')]?_0x9548df[_0x84b6('0x34')]:_0x4e4317[_0x84b6('0x2e')];_0x9548df[_0x84b6('0x39')]=qs[_0x84b6('0x3a')](_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x3a')]);_0x9548df[_0x84b6('0x3b')]=qs[_0x84b6('0x32')](_[_0x84b6('0x3c')](_0x2a9f50['query'],_0x4e4317[_0x84b6('0x32')]));if(_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x3d')]){_0x9548df[_0x84b6('0x3b')]=_['merge'](_0x9548df[_0x84b6('0x3b')],{'$or':_[_0x84b6('0x2f')](_0x9548df[_0x84b6('0x34')],function(_0x5b5743){var _0x12dc9b={};_0x12dc9b[_0x5b5743]={'$like':'%'+_0x2a9f50['query'][_0x84b6('0x3d')]+'%'};return _0x12dc9b;})});}_0x9548df=_[_0x84b6('0x3e')]({},_0x9548df,_0x2a9f50[_0x84b6('0x40')]);return _0x157b49[_0x84b6('0x4c')](_0x9548df);}})['then'](function(_0x2bc298){if(_0x2bc298){_0x186432=_0x2bc298[_0x84b6('0x36')];if(!_0x2a9f50['query'][_0x84b6('0x37')](_0x84b6('0x38'))){_0x9548df[_0x84b6('0x20')]=qs[_0x84b6('0x20')](_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x20')]);_0x9548df[_0x84b6('0x1d')]=qs['offset'](_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x1d')]);}return _0x157b49[_0x84b6('0x4c')](_0x9548df);}})[_0x84b6('0x26')](function(_0x21de28){if(_0x21de28){return _0x21de28?{'count':_0x186432,'rows':_0x21de28}:null;}})[_0x84b6('0x26')](respondWithResult(_0x3587f7,null))[_0x84b6('0x44')](handleError(_0x3587f7,null));};exports['getSubjects']=function(_0xb2510c,_0x1fab74,_0x5e5706){var _0x50c995={};var _0x17f318={};var _0x28644b;var _0x39bd6b;return db[_0x84b6('0x2b')][_0x84b6('0x4d')]({'where':{'id':_0xb2510c[_0x84b6('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fab74,null))[_0x84b6('0x26')](function(_0x4ce9c3){if(_0x4ce9c3){_0x28644b=_0x4ce9c3;_0x17f318[_0x84b6('0x2e')]=_[_0x84b6('0x31')](db[_0x84b6('0x4e')][_0x84b6('0x47')]);_0x17f318[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0xb2510c['query']);_0x17f318[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x17f318[_0x84b6('0x2e')],_0x17f318['query']);_0x50c995['attributes']=_[_0x84b6('0x33')](_0x17f318[_0x84b6('0x2e')],qs['fields'](_0xb2510c[_0x84b6('0x30')][_0x84b6('0x35')]));_0x50c995[_0x84b6('0x34')]=_0x50c995['attributes']['length']?_0x50c995[_0x84b6('0x34')]:_0x17f318[_0x84b6('0x2e')];_0x50c995[_0x84b6('0x39')]=qs['sort'](_0xb2510c['query'][_0x84b6('0x3a')]);_0x50c995['where']=qs['filters'](_[_0x84b6('0x3c')](_0xb2510c['query'],_0x17f318[_0x84b6('0x32')]));if(_0xb2510c[_0x84b6('0x30')]['filter']){_0x50c995[_0x84b6('0x3b')]=_['merge'](_0x50c995['where'],{'$or':_[_0x84b6('0x2f')](_0x50c995[_0x84b6('0x34')],function(_0x186515){var _0x23bcc0={};_0x23bcc0[_0x186515]={'$like':'%'+_0xb2510c[_0x84b6('0x30')][_0x84b6('0x3d')]+'%'};return _0x23bcc0;})});}_0x50c995=_[_0x84b6('0x3e')]({},_0x50c995,_0xb2510c['options']);return _0x28644b[_0x84b6('0x4f')](_0x50c995);}})[_0x84b6('0x26')](function(_0x3e42d0){if(_0x3e42d0){_0x39bd6b=_0x3e42d0[_0x84b6('0x36')];if(!_0xb2510c['query'][_0x84b6('0x37')](_0x84b6('0x38'))){_0x50c995[_0x84b6('0x20')]=qs[_0x84b6('0x20')](_0xb2510c[_0x84b6('0x30')]['limit']);_0x50c995['offset']=qs[_0x84b6('0x1d')](_0xb2510c[_0x84b6('0x30')]['offset']);}return _0x28644b[_0x84b6('0x4f')](_0x50c995);}})[_0x84b6('0x26')](function(_0x57dd63){if(_0x57dd63){return _0x57dd63?{'count':_0x39bd6b,'rows':_0x57dd63}:null;}})[_0x84b6('0x26')](respondWithResult(_0x1fab74,null))[_0x84b6('0x44')](handleError(_0x1fab74,null));};exports[_0x84b6('0x50')]=function(_0x3a14d9,_0x563ecc,_0x4f94b0){var _0x250d2a={};var _0xcd0a88={};var _0x478f6d;var _0x1f95b0;return db['ZendeskConfiguration'][_0x84b6('0x4d')]({'where':{'id':_0x3a14d9[_0x84b6('0x46')]['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0x563ecc,null))[_0x84b6('0x26')](function(_0x111a65){if(_0x111a65){_0x478f6d=_0x111a65;_0xcd0a88[_0x84b6('0x2e')]=_[_0x84b6('0x31')](db[_0x84b6('0x4e')][_0x84b6('0x47')]);_0xcd0a88[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0x3a14d9['query']);_0xcd0a88[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0xcd0a88[_0x84b6('0x2e')],_0xcd0a88[_0x84b6('0x30')]);_0x250d2a[_0x84b6('0x34')]=_[_0x84b6('0x33')](_0xcd0a88[_0x84b6('0x2e')],qs[_0x84b6('0x35')](_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x35')]));_0x250d2a[_0x84b6('0x34')]=_0x250d2a[_0x84b6('0x34')][_0x84b6('0x36')]?_0x250d2a[_0x84b6('0x34')]:_0xcd0a88[_0x84b6('0x2e')];_0x250d2a['order']=qs[_0x84b6('0x3a')](_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x3a')]);_0x250d2a['where']=qs[_0x84b6('0x32')](_[_0x84b6('0x3c')](_0x3a14d9[_0x84b6('0x30')],_0xcd0a88['filters']));if(_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x3d')]){_0x250d2a[_0x84b6('0x3b')]=_['merge'](_0x250d2a[_0x84b6('0x3b')],{'$or':_[_0x84b6('0x2f')](_0x250d2a[_0x84b6('0x34')],function(_0x2a1c6a){var _0x3e20c4={};_0x3e20c4[_0x2a1c6a]={'$like':'%'+_0x3a14d9['query']['filter']+'%'};return _0x3e20c4;})});}_0x250d2a=_[_0x84b6('0x3e')]({},_0x250d2a,_0x3a14d9['options']);return _0x478f6d['getDescriptions'](_0x250d2a);}})[_0x84b6('0x26')](function(_0x4bf101){if(_0x4bf101){_0x1f95b0=_0x4bf101[_0x84b6('0x36')];if(!_0x3a14d9['query']['hasOwnProperty'](_0x84b6('0x38'))){_0x250d2a[_0x84b6('0x20')]=qs['limit'](_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x20')]);_0x250d2a[_0x84b6('0x1d')]=qs[_0x84b6('0x1d')](_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x1d')]);}return _0x478f6d[_0x84b6('0x50')](_0x250d2a);}})[_0x84b6('0x26')](function(_0x2cae15){if(_0x2cae15){return _0x2cae15?{'count':_0x1f95b0,'rows':_0x2cae15}:null;}})['then'](respondWithResult(_0x563ecc,null))[_0x84b6('0x44')](handleError(_0x563ecc,null));};exports[_0x84b6('0x51')]=function(_0xd171e3,_0xfcd7f9,_0xbfe426){var _0x24f874={};var _0x559e95={};var _0x13dd97;var _0x144cfb;return db[_0x84b6('0x2b')][_0x84b6('0x4d')]({'where':{'id':_0xd171e3[_0x84b6('0x46')]['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0xfcd7f9,null))[_0x84b6('0x26')](function(_0x1ae0b3){if(_0x1ae0b3){_0x13dd97=_0x1ae0b3;_0x559e95['model']=_[_0x84b6('0x31')](db['Tag'][_0x84b6('0x47')]);_0x559e95[_0x84b6('0x30')]=_['keys'](_0xd171e3[_0x84b6('0x30')]);_0x559e95[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x559e95[_0x84b6('0x2e')],_0x559e95[_0x84b6('0x30')]);_0x24f874[_0x84b6('0x34')]=_['intersection'](_0x559e95[_0x84b6('0x2e')],qs[_0x84b6('0x35')](_0xd171e3[_0x84b6('0x30')][_0x84b6('0x35')]));_0x24f874[_0x84b6('0x34')]=_0x24f874[_0x84b6('0x34')][_0x84b6('0x36')]?_0x24f874[_0x84b6('0x34')]:_0x559e95[_0x84b6('0x2e')];_0x24f874[_0x84b6('0x39')]=qs[_0x84b6('0x3a')](_0xd171e3[_0x84b6('0x30')][_0x84b6('0x3a')]);_0x24f874[_0x84b6('0x3b')]=qs['filters'](_['pick'](_0xd171e3[_0x84b6('0x30')],_0x559e95[_0x84b6('0x32')]));if(_0xd171e3[_0x84b6('0x30')][_0x84b6('0x3d')]){_0x24f874['where']=_['merge'](_0x24f874[_0x84b6('0x3b')],{'$or':_['map'](_0x24f874[_0x84b6('0x34')],function(_0x58f2cc){var _0xa07927={};_0xa07927[_0x58f2cc]={'$like':'%'+_0xd171e3[_0x84b6('0x30')]['filter']+'%'};return _0xa07927;})});}_0x24f874=_[_0x84b6('0x3e')]({},_0x24f874,_0xd171e3[_0x84b6('0x40')]);return _0x13dd97[_0x84b6('0x51')](_0x24f874);}})[_0x84b6('0x26')](function(_0xdbe6b7){if(_0xdbe6b7){_0x144cfb=_0xdbe6b7[_0x84b6('0x36')];if(!_0xd171e3[_0x84b6('0x30')]['hasOwnProperty']('nolimit')){_0x24f874[_0x84b6('0x20')]=qs['limit'](_0xd171e3[_0x84b6('0x30')][_0x84b6('0x20')]);_0x24f874[_0x84b6('0x1d')]=qs['offset'](_0xd171e3[_0x84b6('0x30')][_0x84b6('0x1d')]);}return _0x13dd97['getTags'](_0x24f874);}})['then'](function(_0x2cc2e8){if(_0x2cc2e8){return _0x2cc2e8?{'count':_0x144cfb,'rows':_0x2cc2e8}:null;}})[_0x84b6('0x26')](respondWithResult(_0xfcd7f9,null))[_0x84b6('0x44')](handleError(_0xfcd7f9,null));};exports[_0x84b6('0x52')]=function(_0x1bf2b7,_0x657806,_0x376695){if(_0x1bf2b7['body']['id']){delete _0x1bf2b7[_0x84b6('0x4b')]['id'];}return db[_0x84b6('0x2b')]['findOne']({'where':{'id':_0x1bf2b7['params']['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0x657806,null))[_0x84b6('0x26')](function(_0x59ee1a){if(_0x59ee1a){return _0x59ee1a['setTags'](_0x1bf2b7['body'][_0x84b6('0x53')]||[]);}return null;})[_0x84b6('0x26')](respondWithResult(_0x657806,null))[_0x84b6('0x44')](handleError(_0x657806,null));};
\ No newline at end of file
index e570692..cf9ac0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9be=['path','rimraf','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x31af82,_0x5cee04){var _0x3cfa96=function(_0x5ad9ea){while(--_0x5ad9ea){_0x31af82['push'](_0x31af82['shift']());}};_0x3cfa96(++_0x5cee04);}(_0xb9be,0xc5));var _0xeb9b=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xb9be[_0x36bf88];return _0x332914;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var logger=require(_0xeb9b('0x2'))(_0xeb9b('0x3'));var moment=require(_0xeb9b('0x4'));var BPromise=require(_0xeb9b('0x5'));var rp=require(_0xeb9b('0x6'));var fs=require('fs');var path=require(_0xeb9b('0x7'));var rimraf=require(_0xeb9b('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xeb9b('0x9')]=function(_0x181810,_0x2529cb){return _0x181810['define'](_0xeb9b('0xa'),attributes,{'tableName':_0xeb9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb9be=['path','rimraf','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x8207e,_0x374d8c){var _0x2bc725=function(_0x4f75a8){while(--_0x4f75a8){_0x8207e['push'](_0x8207e['shift']());}};_0x2bc725(++_0x374d8c);}(_0xb9be,0xc5));var _0xeb9b=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xb9be[_0x354164];return _0x5db9a8;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var logger=require(_0xeb9b('0x2'))(_0xeb9b('0x3'));var moment=require(_0xeb9b('0x4'));var BPromise=require(_0xeb9b('0x5'));var rp=require(_0xeb9b('0x6'));var fs=require('fs');var path=require(_0xeb9b('0x7'));var rimraf=require(_0xeb9b('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xeb9b('0x9')]=function(_0x181810,_0x2529cb){return _0x181810['define'](_0xeb9b('0xa'),attributes,{'tableName':_0xeb9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dc09728..af35aa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f59=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x80094a,_0x65ba44){var _0x6cf85e=function(_0x345018){while(--_0x345018){_0x80094a['push'](_0x80094a['shift']());}};_0x6cf85e(++_0x65ba44);}(_0x4f59,0xdf));var _0x94f5=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x4f59[_0x51a6d6];return _0x5ef1a8;};'use strict';var _=require(_0x94f5('0x0'));var util=require(_0x94f5('0x1'));var moment=require(_0x94f5('0x2'));var BPromise=require(_0x94f5('0x3'));var rs=require(_0x94f5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94f5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x94f5('0x6'));var config=require(_0x94f5('0x7'));var jayson=require(_0x94f5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d345e,_0xd633e1,_0x41a411){return new BPromise(function(_0x4a4d43,_0x423d1e){return client[_0x94f5('0x9')](_0x5d345e,_0x41a411)['then'](function(_0x388d87){logger[_0x94f5('0xa')](_0x94f5('0xb'),_0xd633e1,_0x94f5('0xc'));logger[_0x94f5('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xd633e1,_0x94f5('0xc'),JSON[_0x94f5('0xe')](_0x388d87));if(_0x388d87[_0x94f5('0xf')]){if(_0x388d87[_0x94f5('0xf')][_0x94f5('0x10')]===0x1f4){logger[_0x94f5('0xf')](_0x94f5('0xb'),_0xd633e1,_0x388d87['error'][_0x94f5('0x11')]);return _0x423d1e(_0x388d87[_0x94f5('0xf')][_0x94f5('0x11')]);}logger['error'](_0x94f5('0xb'),_0xd633e1,_0x388d87['error'][_0x94f5('0x11')]);return _0x4a4d43(_0x388d87[_0x94f5('0xf')][_0x94f5('0x11')]);}else{logger['info'](_0x94f5('0xb'),_0xd633e1,_0x94f5('0xc'));_0x4a4d43(_0x388d87[_0x94f5('0x12')]['message']);}})[_0x94f5('0x13')](function(_0x4b97d6){logger[_0x94f5('0xf')](_0x94f5('0xb'),_0xd633e1,_0x4b97d6);_0x423d1e(_0x4b97d6);});});}
\ No newline at end of file
+var _0xd360=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','debug','stringify','error','message','catch','lodash','util'];(function(_0x4f90af,_0x14b70c){var _0x5e62c0=function(_0x4aa5b6){while(--_0x4aa5b6){_0x4f90af['push'](_0x4f90af['shift']());}};_0x5e62c0(++_0x14b70c);}(_0xd360,0x1b3));var _0x0d36=function(_0x16217b,_0x2c4ce2){_0x16217b=_0x16217b-0x0;var _0x23bf38=_0xd360[_0x16217b];return _0x23bf38;};'use strict';var _=require(_0x0d36('0x0'));var util=require(_0x0d36('0x1'));var moment=require('moment');var BPromise=require(_0x0d36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d36('0x3'));var db=require(_0x0d36('0x4'))['db'];var utils=require(_0x0d36('0x5'));var logger=require(_0x0d36('0x6'))('rpc');var config=require(_0x0d36('0x7'));var jayson=require(_0x0d36('0x8'));var client=jayson[_0x0d36('0x9')][_0x0d36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52cb2,_0x8cf880,_0xe448b0){return new BPromise(function(_0x14c96f,_0x23fccf){return client[_0x0d36('0xb')](_0x52cb2,_0xe448b0)['then'](function(_0x1d8ccb){logger[_0x0d36('0xc')](_0x0d36('0xd'),_0x8cf880,'request\x20sent');logger[_0x0d36('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x8cf880,'request\x20sent',JSON[_0x0d36('0xf')](_0x1d8ccb));if(_0x1d8ccb['error']){if(_0x1d8ccb[_0x0d36('0x10')]['code']===0x1f4){logger['error'](_0x0d36('0xd'),_0x8cf880,_0x1d8ccb[_0x0d36('0x10')]['message']);return _0x23fccf(_0x1d8ccb[_0x0d36('0x10')][_0x0d36('0x11')]);}logger['error'](_0x0d36('0xd'),_0x8cf880,_0x1d8ccb[_0x0d36('0x10')][_0x0d36('0x11')]);return _0x14c96f(_0x1d8ccb[_0x0d36('0x10')][_0x0d36('0x11')]);}else{logger[_0x0d36('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x8cf880,'request\x20sent');_0x14c96f(_0x1d8ccb['result'][_0x0d36('0x11')]);}})[_0x0d36('0x12')](function(_0x2490a7){logger['error'](_0x0d36('0xd'),_0x8cf880,_0x2490a7);_0x23fccf(_0x2490a7);});});}
\ No newline at end of file
index a09c035..a230799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f4a=['./intZendeskField.controller','get','isAuthenticated','show','post','/:id','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3a28e4,_0x868b99){var _0x1ed545=function(_0x555705){while(--_0x555705){_0x3a28e4['push'](_0x3a28e4['shift']());}};_0x1ed545(++_0x868b99);}(_0x9f4a,0xea));var _0xa9f4=function(_0x56c985,_0x486a60){_0x56c985=_0x56c985-0x0;var _0x2fc89e=_0x9f4a[_0x56c985];return _0x2fc89e;};'use strict';var multer=require(_0xa9f4('0x0'));var util=require('util');var path=require(_0xa9f4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa9f4('0x2')]();var fs_extra=require(_0xa9f4('0x3'));var auth=require(_0xa9f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa9f4('0x5'));var controller=require(_0xa9f4('0x6'));router[_0xa9f4('0x7')]('/',auth[_0xa9f4('0x8')](),controller['index']);router[_0xa9f4('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa9f4('0x9')]);router[_0xa9f4('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa9f4('0xb'),auth['isAuthenticated'](),controller[_0xa9f4('0xc')]);router['delete'](_0xa9f4('0xb'),auth[_0xa9f4('0x8')](),controller[_0xa9f4('0xd')]);module[_0xa9f4('0xe')]=router;
\ No newline at end of file
+var _0x2db5=['isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x2db5,0x15f));var _0x52db=function(_0xe480f0,_0x4c0dc1){_0xe480f0=_0xe480f0-0x0;var _0x57b198=_0x2db5[_0xe480f0];return _0x57b198;};'use strict';var multer=require(_0x52db('0x0'));var util=require(_0x52db('0x1'));var path=require(_0x52db('0x2'));var timeout=require(_0x52db('0x3'));var express=require('express');var router=express[_0x52db('0x4')]();var fs_extra=require(_0x52db('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x52db('0x6'));var config=require(_0x52db('0x7'));var controller=require(_0x52db('0x8'));router[_0x52db('0x9')]('/',auth[_0x52db('0xa')](),controller[_0x52db('0xb')]);router[_0x52db('0x9')]('/:id',auth[_0x52db('0xa')](),controller[_0x52db('0xc')]);router['post']('/',auth[_0x52db('0xa')](),controller[_0x52db('0xd')]);router['put'](_0x52db('0xe'),auth[_0x52db('0xa')](),controller[_0x52db('0xf')]);router[_0x52db('0x10')](_0x52db('0xe'),auth['isAuthenticated'](),controller[_0x52db('0x11')]);module[_0x52db('0x12')]=router;
\ No newline at end of file
index 4b38b99..88c73bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bef=['keyValue','picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0xd0edb4,_0xe0728e){var _0x5690c3=function(_0x4c2512){while(--_0x4c2512){_0xd0edb4['push'](_0xd0edb4['shift']());}};_0x5690c3(++_0xe0728e);}(_0x6bef,0x15c));var _0xf6be=function(_0x3297ce,_0x595dbb){_0x3297ce=_0x3297ce-0x0;var _0x1edbfc=_0x6bef[_0x3297ce];return _0x1edbfc;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf6be('0x0')](_0xf6be('0x1'),_0xf6be('0x2'),_0xf6be('0x3'),_0xf6be('0x4'),_0xf6be('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf6be('0x6')]},'key':{'type':Sequelize[_0xf6be('0x6')]},'keyType':{'type':Sequelize[_0xf6be('0x0')](_0xf6be('0x1'),_0xf6be('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf6be('0x6')]},'nameField':{'type':Sequelize[_0xf6be('0x6')]},'customField':{'type':Sequelize[_0xf6be('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x475a=['string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x475a,0xfa));var _0xa475=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x475a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa475('0x0'));module[_0xa475('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa475('0x2'),_0xa475('0x3'),_0xa475('0x4'),'keyValue',_0xa475('0x5')),'defaultValue':_0xa475('0x2')},'content':{'type':Sequelize[_0xa475('0x6')]},'key':{'type':Sequelize[_0xa475('0x6')]},'keyType':{'type':Sequelize[_0xa475('0x7')](_0xa475('0x2'),_0xa475('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa475('0x6')]},'idField':{'type':Sequelize[_0xa475('0x6')]},'nameField':{'type':Sequelize[_0xa475('0x6')]},'customField':{'type':Sequelize[_0xa475('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa475('0x6')]}};
\ No newline at end of file
index b19445d..813eddf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bdd=['includeAll','include','findAll','show','params','keys','ZendeskField','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','key','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x1bdd,0x143));var _0xd1bd=function(_0x35f135,_0x4042dd){_0x35f135=_0x35f135-0x0;var _0x434f7c=_0x1bdd[_0x35f135];return _0x434f7c;};'use strict';var emlformat=require(_0xd1bd('0x0'));var rimraf=require(_0xd1bd('0x1'));var zipdir=require(_0xd1bd('0x2'));var jsonpatch=require(_0xd1bd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd1bd('0x4'));var Mustache=require(_0xd1bd('0x5'));var util=require(_0xd1bd('0x6'));var path=require(_0xd1bd('0x7'));var sox=require(_0xd1bd('0x8'));var csv=require('to-csv');var ejs=require(_0xd1bd('0x9'));var fs=require('fs');var fs_extra=require(_0xd1bd('0xa'));var _=require(_0xd1bd('0xb'));var squel=require(_0xd1bd('0xc'));var crypto=require(_0xd1bd('0xd'));var jsforce=require(_0xd1bd('0xe'));var deskjs=require(_0xd1bd('0xf'));var toCsv=require(_0xd1bd('0x10'));var querystring=require(_0xd1bd('0x11'));var Papa=require('papaparse');var Redis=require(_0xd1bd('0x12'));var authService=require(_0xd1bd('0x13'));var qs=require(_0xd1bd('0x14'));var as=require(_0xd1bd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1bd('0x16'))(_0xd1bd('0x17'));var utils=require(_0xd1bd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd1bd('0x19'));var db=require(_0xd1bd('0x1a'))['db'];function respondWithStatusCode(_0x53aeeb,_0x5016fc){_0x5016fc=_0x5016fc||0xcc;return function(_0x3edc11){if(_0x3edc11){return _0x53aeeb[_0xd1bd('0x1b')](_0x5016fc);}return _0x53aeeb[_0xd1bd('0x1c')](_0x5016fc)[_0xd1bd('0x1d')]();};}function respondWithResult(_0x43d6d9,_0x1d55bb){_0x1d55bb=_0x1d55bb||0xc8;return function(_0x15c615){if(_0x15c615){return _0x43d6d9[_0xd1bd('0x1c')](_0x1d55bb)[_0xd1bd('0x1e')](_0x15c615);}};}function respondWithFilteredResult(_0x21c517,_0x297c8e){return function(_0x5409c7){if(_0x5409c7){var _0x19fd17=typeof _0x297c8e['offset']===_0xd1bd('0x1f')&&typeof _0x297c8e[_0xd1bd('0x20')]===_0xd1bd('0x1f');var _0x4fbad0=_0x5409c7[_0xd1bd('0x21')];var _0x169554=_0x19fd17?0x0:_0x297c8e[_0xd1bd('0x22')];var _0x1d54ab=_0x19fd17?_0x5409c7[_0xd1bd('0x21')]:_0x297c8e['offset']+_0x297c8e[_0xd1bd('0x20')];var _0x253932;if(_0x1d54ab>=_0x4fbad0){_0x1d54ab=_0x4fbad0;_0x253932=0xc8;}else{_0x253932=0xce;}_0x21c517[_0xd1bd('0x1c')](_0x253932);return _0x21c517[_0xd1bd('0x23')](_0xd1bd('0x24'),_0x169554+'-'+_0x1d54ab+'/'+_0x4fbad0)[_0xd1bd('0x1e')](_0x5409c7);}return null;};}function patchUpdates(_0x526701){return function(_0x3ec599){try{jsonpatch[_0xd1bd('0x25')](_0x3ec599,_0x526701,!![]);}catch(_0x3a5e51){return BPromise[_0xd1bd('0x26')](_0x3a5e51);}return _0x3ec599[_0xd1bd('0x27')]();};}function saveUpdates(_0x541b54,_0x9b5384){return function(_0x5b6eab){if(_0x5b6eab){return _0x5b6eab[_0xd1bd('0x28')](_0x541b54)['then'](function(_0x452d96){return _0x452d96;});}return null;};}function removeEntity(_0x34291c,_0x491289){return function(_0x3107ab){if(_0x3107ab){return _0x3107ab[_0xd1bd('0x29')]()[_0xd1bd('0x2a')](function(){_0x34291c[_0xd1bd('0x1c')](0xcc)[_0xd1bd('0x1d')]();});}};}function handleEntityNotFound(_0x21cc93,_0xc14ba6){return function(_0x322089){if(!_0x322089){_0x21cc93[_0xd1bd('0x1b')](0x194);}return _0x322089;};}function handleError(_0x37cd13,_0x50666c){_0x50666c=_0x50666c||0x1f4;return function(_0x551ba4){logger[_0xd1bd('0x2b')](_0x551ba4[_0xd1bd('0x2c')]);if(_0x551ba4[_0xd1bd('0x2d')]){delete _0x551ba4['name'];}_0x37cd13[_0xd1bd('0x1c')](_0x50666c)[_0xd1bd('0x2e')](_0x551ba4);};}exports[_0xd1bd('0x2f')]=function(_0x12e2ae,_0x1f207c){var _0x91272a={},_0x230990={},_0x5e6219={'count':0x0,'rows':[]};var _0xd47911=_[_0xd1bd('0x30')](db['ZendeskField']['rawAttributes'],function(_0x3bfbd6){return{'name':_0x3bfbd6['fieldName'],'type':_0x3bfbd6['type'][_0xd1bd('0x31')]};});_0x230990['model']=_[_0xd1bd('0x30')](_0xd47911,_0xd1bd('0x2d'));_0x230990['query']=_['keys'](_0x12e2ae[_0xd1bd('0x32')]);_0x230990['filters']=_['intersection'](_0x230990['model'],_0x230990[_0xd1bd('0x32')]);_0x91272a['attributes']=_[_0xd1bd('0x33')](_0x230990[_0xd1bd('0x34')],qs[_0xd1bd('0x35')](_0x12e2ae[_0xd1bd('0x32')][_0xd1bd('0x35')]));_0x91272a['attributes']=_0x91272a[_0xd1bd('0x36')][_0xd1bd('0x37')]?_0x91272a[_0xd1bd('0x36')]:_0x230990['model'];if(!_0x12e2ae[_0xd1bd('0x32')][_0xd1bd('0x38')]('nolimit')){_0x91272a['limit']=qs[_0xd1bd('0x20')](_0x12e2ae[_0xd1bd('0x32')]['limit']);_0x91272a[_0xd1bd('0x22')]=qs[_0xd1bd('0x22')](_0x12e2ae[_0xd1bd('0x32')][_0xd1bd('0x22')]);}_0x91272a[_0xd1bd('0x39')]=qs[_0xd1bd('0x3a')](_0x12e2ae[_0xd1bd('0x32')][_0xd1bd('0x3a')]);_0x91272a[_0xd1bd('0x3b')]=qs[_0xd1bd('0x3c')](_[_0xd1bd('0x3d')](_0x12e2ae[_0xd1bd('0x32')],_0x230990['filters']),_0xd47911);if(_0x12e2ae[_0xd1bd('0x32')][_0xd1bd('0x3e')]){_0x91272a[_0xd1bd('0x3b')]=_[_0xd1bd('0x3f')](_0x91272a[_0xd1bd('0x3b')],{'$or':_[_0xd1bd('0x30')](_0xd47911,function(_0x56de6d){if(_0x56de6d[_0xd1bd('0x40')]!==_0xd1bd('0x41')){var _0x3253b8={};_0x3253b8[_0x56de6d['name']]={'$like':'%'+_0x12e2ae['query'][_0xd1bd('0x3e')]+'%'};return _0x3253b8;}})});}_0x91272a=_[_0xd1bd('0x3f')]({},_0x91272a,_0x12e2ae[_0xd1bd('0x42')]);var _0x3e5934={'where':_0x91272a[_0xd1bd('0x3b')]};return db['ZendeskField'][_0xd1bd('0x21')](_0x3e5934)[_0xd1bd('0x2a')](function(_0x9499ed){_0x5e6219[_0xd1bd('0x21')]=_0x9499ed;if(_0x12e2ae[_0xd1bd('0x32')][_0xd1bd('0x43')]){_0x91272a[_0xd1bd('0x44')]=[{'all':!![]}];}return db['ZendeskField'][_0xd1bd('0x45')](_0x91272a);})[_0xd1bd('0x2a')](function(_0x3abc08){_0x5e6219['rows']=_0x3abc08;return _0x5e6219;})['then'](respondWithFilteredResult(_0x1f207c,_0x91272a))['catch'](handleError(_0x1f207c,null));};exports[_0xd1bd('0x46')]=function(_0x2e6ba1,_0x243063){var _0x232702={'raw':!![],'where':{'id':_0x2e6ba1[_0xd1bd('0x47')]['id']}},_0x58bd1f={};_0x58bd1f['model']=_[_0xd1bd('0x48')](db[_0xd1bd('0x49')]['rawAttributes']);_0x58bd1f[_0xd1bd('0x32')]=_['keys'](_0x2e6ba1['query']);_0x58bd1f['filters']=_[_0xd1bd('0x33')](_0x58bd1f[_0xd1bd('0x34')],_0x58bd1f['query']);_0x232702[_0xd1bd('0x36')]=_[_0xd1bd('0x33')](_0x58bd1f['model'],qs[_0xd1bd('0x35')](_0x2e6ba1['query'][_0xd1bd('0x35')]));_0x232702['attributes']=_0x232702['attributes']['length']?_0x232702[_0xd1bd('0x36')]:_0x58bd1f[_0xd1bd('0x34')];if(_0x2e6ba1[_0xd1bd('0x32')]['includeAll']){_0x232702[_0xd1bd('0x44')]=[{'all':!![]}];}_0x232702=_[_0xd1bd('0x3f')]({},_0x232702,_0x2e6ba1[_0xd1bd('0x42')]);return db['ZendeskField'][_0xd1bd('0x4a')](_0x232702)[_0xd1bd('0x2a')](handleEntityNotFound(_0x243063,null))[_0xd1bd('0x2a')](respondWithResult(_0x243063,null))[_0xd1bd('0x4b')](handleError(_0x243063,null));};exports[_0xd1bd('0x4c')]=function(_0x5ea9f1,_0x4fbd66){return db['ZendeskField']['create'](_0x5ea9f1[_0xd1bd('0x4d')],{})[_0xd1bd('0x2a')](respondWithResult(_0x4fbd66,0xc9))['catch'](handleError(_0x4fbd66,null));};exports[_0xd1bd('0x28')]=function(_0x329195,_0x511e73){if(_0x329195['body']['id']){delete _0x329195['body']['id'];}return db[_0xd1bd('0x49')][_0xd1bd('0x4a')]({'where':{'id':_0x329195[_0xd1bd('0x47')]['id']}})[_0xd1bd('0x2a')](handleEntityNotFound(_0x511e73,null))['then'](saveUpdates(_0x329195[_0xd1bd('0x4d')],null))[_0xd1bd('0x2a')](respondWithResult(_0x511e73,null))['catch'](handleError(_0x511e73,null));};exports['destroy']=function(_0x48ec6b,_0x584179){return db[_0xd1bd('0x49')]['find']({'where':{'id':_0x48ec6b[_0xd1bd('0x47')]['id']}})['then'](handleEntityNotFound(_0x584179,null))[_0xd1bd('0x2a')](removeEntity(_0x584179,null))[_0xd1bd('0x4b')](handleError(_0x584179,null));};
\ No newline at end of file
+var _0xc5f5=['apply','reject','update','then','destroy','stack','name','ZendeskField','rawAttributes','fieldName','type','key','map','keys','filters','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','rows','catch','show','include','options','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range'];(function(_0x30e37f,_0x47866c){var _0x73585b=function(_0x35f4e9){while(--_0x35f4e9){_0x30e37f['push'](_0x30e37f['shift']());}};_0x73585b(++_0x47866c);}(_0xc5f5,0x1ca));var _0x5c5f=function(_0x2ceb47,_0x5c6f60){_0x2ceb47=_0x2ceb47-0x0;var _0x4a77b0=_0xc5f5[_0x2ceb47];return _0x4a77b0;};'use strict';var emlformat=require(_0x5c5f('0x0'));var rimraf=require(_0x5c5f('0x1'));var zipdir=require(_0x5c5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c5f('0x3'));var moment=require(_0x5c5f('0x4'));var BPromise=require(_0x5c5f('0x5'));var Mustache=require(_0x5c5f('0x6'));var util=require('util');var path=require(_0x5c5f('0x7'));var sox=require(_0x5c5f('0x8'));var csv=require(_0x5c5f('0x9'));var ejs=require(_0x5c5f('0xa'));var fs=require('fs');var fs_extra=require(_0x5c5f('0xb'));var _=require(_0x5c5f('0xc'));var squel=require(_0x5c5f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5c5f('0xe'));var Papa=require(_0x5c5f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c5f('0x10'));var as=require(_0x5c5f('0x11'));var hardwareService=require(_0x5c5f('0x12'));var logger=require(_0x5c5f('0x13'))(_0x5c5f('0x14'));var utils=require(_0x5c5f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5c5f('0x16'))['db'];function respondWithStatusCode(_0x5efc36,_0x268199){_0x268199=_0x268199||0xcc;return function(_0x525f97){if(_0x525f97){return _0x5efc36[_0x5c5f('0x17')](_0x268199);}return _0x5efc36[_0x5c5f('0x18')](_0x268199)[_0x5c5f('0x19')]();};}function respondWithResult(_0x4ad927,_0x289700){_0x289700=_0x289700||0xc8;return function(_0x38cf7f){if(_0x38cf7f){return _0x4ad927[_0x5c5f('0x18')](_0x289700)['json'](_0x38cf7f);}};}function respondWithFilteredResult(_0x120717,_0x1deb60){return function(_0x5bba74){if(_0x5bba74){var _0x930701=typeof _0x1deb60[_0x5c5f('0x1a')]===_0x5c5f('0x1b')&&typeof _0x1deb60['limit']===_0x5c5f('0x1b');var _0x25bf16=_0x5bba74['count'];var _0x208b81=_0x930701?0x0:_0x1deb60[_0x5c5f('0x1a')];var _0x47dde7=_0x930701?_0x5bba74[_0x5c5f('0x1c')]:_0x1deb60['offset']+_0x1deb60[_0x5c5f('0x1d')];var _0x30688a;if(_0x47dde7>=_0x25bf16){_0x47dde7=_0x25bf16;_0x30688a=0xc8;}else{_0x30688a=0xce;}_0x120717[_0x5c5f('0x18')](_0x30688a);return _0x120717[_0x5c5f('0x1e')](_0x5c5f('0x1f'),_0x208b81+'-'+_0x47dde7+'/'+_0x25bf16)['json'](_0x5bba74);}return null;};}function patchUpdates(_0x5a491b){return function(_0x2b515b){try{jsonpatch[_0x5c5f('0x20')](_0x2b515b,_0x5a491b,!![]);}catch(_0x340158){return BPromise[_0x5c5f('0x21')](_0x340158);}return _0x2b515b['save']();};}function saveUpdates(_0x1188c9,_0xe71dda){return function(_0xedfe75){if(_0xedfe75){return _0xedfe75[_0x5c5f('0x22')](_0x1188c9)[_0x5c5f('0x23')](function(_0x353447){return _0x353447;});}return null;};}function removeEntity(_0x148168,_0x4a161c){return function(_0x5e8601){if(_0x5e8601){return _0x5e8601[_0x5c5f('0x24')]()[_0x5c5f('0x23')](function(){_0x148168[_0x5c5f('0x18')](0xcc)[_0x5c5f('0x19')]();});}};}function handleEntityNotFound(_0x4284a0,_0x539747){return function(_0x44aa93){if(!_0x44aa93){_0x4284a0[_0x5c5f('0x17')](0x194);}return _0x44aa93;};}function handleError(_0x2355a8,_0x38f7c2){_0x38f7c2=_0x38f7c2||0x1f4;return function(_0x189cd9){logger['error'](_0x189cd9[_0x5c5f('0x25')]);if(_0x189cd9[_0x5c5f('0x26')]){delete _0x189cd9['name'];}_0x2355a8[_0x5c5f('0x18')](_0x38f7c2)['send'](_0x189cd9);};}exports['index']=function(_0x5acf7a,_0x3a9a0c){var _0x5deae8={},_0x8afa0c={},_0x4fd7dc={'count':0x0,'rows':[]};var _0x15dcca=_['map'](db[_0x5c5f('0x27')][_0x5c5f('0x28')],function(_0x54b6d8){return{'name':_0x54b6d8[_0x5c5f('0x29')],'type':_0x54b6d8[_0x5c5f('0x2a')][_0x5c5f('0x2b')]};});_0x8afa0c['model']=_[_0x5c5f('0x2c')](_0x15dcca,_0x5c5f('0x26'));_0x8afa0c['query']=_[_0x5c5f('0x2d')](_0x5acf7a['query']);_0x8afa0c[_0x5c5f('0x2e')]=_['intersection'](_0x8afa0c[_0x5c5f('0x2f')],_0x8afa0c[_0x5c5f('0x30')]);_0x5deae8[_0x5c5f('0x31')]=_[_0x5c5f('0x32')](_0x8afa0c[_0x5c5f('0x2f')],qs[_0x5c5f('0x33')](_0x5acf7a['query'][_0x5c5f('0x33')]));_0x5deae8[_0x5c5f('0x31')]=_0x5deae8['attributes'][_0x5c5f('0x34')]?_0x5deae8[_0x5c5f('0x31')]:_0x8afa0c[_0x5c5f('0x2f')];if(!_0x5acf7a[_0x5c5f('0x30')]['hasOwnProperty'](_0x5c5f('0x35'))){_0x5deae8[_0x5c5f('0x1d')]=qs[_0x5c5f('0x1d')](_0x5acf7a['query'][_0x5c5f('0x1d')]);_0x5deae8[_0x5c5f('0x1a')]=qs[_0x5c5f('0x1a')](_0x5acf7a[_0x5c5f('0x30')][_0x5c5f('0x1a')]);}_0x5deae8[_0x5c5f('0x36')]=qs[_0x5c5f('0x37')](_0x5acf7a[_0x5c5f('0x30')][_0x5c5f('0x37')]);_0x5deae8[_0x5c5f('0x38')]=qs[_0x5c5f('0x2e')](_['pick'](_0x5acf7a[_0x5c5f('0x30')],_0x8afa0c['filters']),_0x15dcca);if(_0x5acf7a[_0x5c5f('0x30')][_0x5c5f('0x39')]){_0x5deae8[_0x5c5f('0x38')]=_[_0x5c5f('0x3a')](_0x5deae8[_0x5c5f('0x38')],{'$or':_[_0x5c5f('0x2c')](_0x15dcca,function(_0x151e81){if(_0x151e81['type']!==_0x5c5f('0x3b')){var _0xd5137={};_0xd5137[_0x151e81['name']]={'$like':'%'+_0x5acf7a[_0x5c5f('0x30')][_0x5c5f('0x39')]+'%'};return _0xd5137;}})});}_0x5deae8=_[_0x5c5f('0x3a')]({},_0x5deae8,_0x5acf7a['options']);var _0x385ee3={'where':_0x5deae8['where']};return db[_0x5c5f('0x27')][_0x5c5f('0x1c')](_0x385ee3)['then'](function(_0x4a5bb2){_0x4fd7dc[_0x5c5f('0x1c')]=_0x4a5bb2;if(_0x5acf7a['query'][_0x5c5f('0x3c')]){_0x5deae8['include']=[{'all':!![]}];}return db[_0x5c5f('0x27')]['findAll'](_0x5deae8);})[_0x5c5f('0x23')](function(_0x46e84b){_0x4fd7dc[_0x5c5f('0x3d')]=_0x46e84b;return _0x4fd7dc;})[_0x5c5f('0x23')](respondWithFilteredResult(_0x3a9a0c,_0x5deae8))[_0x5c5f('0x3e')](handleError(_0x3a9a0c,null));};exports[_0x5c5f('0x3f')]=function(_0x1a8b4a,_0x47b005){var _0x2d4303={'raw':!![],'where':{'id':_0x1a8b4a['params']['id']}},_0x543a16={};_0x543a16[_0x5c5f('0x2f')]=_['keys'](db[_0x5c5f('0x27')][_0x5c5f('0x28')]);_0x543a16['query']=_['keys'](_0x1a8b4a[_0x5c5f('0x30')]);_0x543a16[_0x5c5f('0x2e')]=_[_0x5c5f('0x32')](_0x543a16['model'],_0x543a16[_0x5c5f('0x30')]);_0x2d4303['attributes']=_[_0x5c5f('0x32')](_0x543a16[_0x5c5f('0x2f')],qs[_0x5c5f('0x33')](_0x1a8b4a[_0x5c5f('0x30')][_0x5c5f('0x33')]));_0x2d4303[_0x5c5f('0x31')]=_0x2d4303[_0x5c5f('0x31')][_0x5c5f('0x34')]?_0x2d4303[_0x5c5f('0x31')]:_0x543a16[_0x5c5f('0x2f')];if(_0x1a8b4a['query']['includeAll']){_0x2d4303[_0x5c5f('0x40')]=[{'all':!![]}];}_0x2d4303=_[_0x5c5f('0x3a')]({},_0x2d4303,_0x1a8b4a[_0x5c5f('0x41')]);return db[_0x5c5f('0x27')]['find'](_0x2d4303)[_0x5c5f('0x23')](handleEntityNotFound(_0x47b005,null))[_0x5c5f('0x23')](respondWithResult(_0x47b005,null))['catch'](handleError(_0x47b005,null));};exports[_0x5c5f('0x42')]=function(_0x412d28,_0x54f900){return db['ZendeskField']['create'](_0x412d28[_0x5c5f('0x43')],{})['then'](respondWithResult(_0x54f900,0xc9))[_0x5c5f('0x3e')](handleError(_0x54f900,null));};exports[_0x5c5f('0x22')]=function(_0x16a282,_0x43a940){if(_0x16a282[_0x5c5f('0x43')]['id']){delete _0x16a282['body']['id'];}return db[_0x5c5f('0x27')][_0x5c5f('0x44')]({'where':{'id':_0x16a282[_0x5c5f('0x45')]['id']}})[_0x5c5f('0x23')](handleEntityNotFound(_0x43a940,null))[_0x5c5f('0x23')](saveUpdates(_0x16a282[_0x5c5f('0x43')],null))[_0x5c5f('0x23')](respondWithResult(_0x43a940,null))[_0x5c5f('0x3e')](handleError(_0x43a940,null));};exports[_0x5c5f('0x24')]=function(_0x45fcc7,_0x155fed){return db[_0x5c5f('0x27')][_0x5c5f('0x44')]({'where':{'id':_0x45fcc7['params']['id']}})[_0x5c5f('0x23')](handleEntityNotFound(_0x155fed,null))[_0x5c5f('0x23')](removeEntity(_0x155fed,null))[_0x5c5f('0x3e')](handleError(_0x155fed,null));};
\ No newline at end of file
index c0deff1..57867f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa06d=['idField','FieldId','util','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','zendesk_unique_index'];(function(_0x420c91,_0x132ebe){var _0x5a39ed=function(_0x100085){while(--_0x100085){_0x420c91['push'](_0x420c91['shift']());}};_0x5a39ed(++_0x132ebe);}(_0xa06d,0x17b));var _0xda06=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa06d[_0x4fc9e6];return _0x551d28;};'use strict';var _=require('lodash');var util=require(_0xda06('0x0'));var logger=require('../../config/logger')(_0xda06('0x1'));var moment=require(_0xda06('0x2'));var BPromise=require('bluebird');var rp=require(_0xda06('0x3'));var fs=require('fs');var path=require(_0xda06('0x4'));var rimraf=require(_0xda06('0x5'));var config=require(_0xda06('0x6'));var attributes=require(_0xda06('0x7'));module['exports']=function(_0x44cbbe,_0x49db97){return _0x44cbbe[_0xda06('0x8')](_0xda06('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xda06('0xa'),'fields':[_0xda06('0xb'),_0xda06('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6143=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6143,0xf7));var _0x3614=function(_0x83b8cf,_0x468d17){_0x83b8cf=_0x83b8cf-0x0;var _0x3d10bd=_0x6143[_0x83b8cf];return _0x3d10bd;};'use strict';var _=require('lodash');var util=require(_0x3614('0x0'));var logger=require(_0x3614('0x1'))(_0x3614('0x2'));var moment=require(_0x3614('0x3'));var BPromise=require(_0x3614('0x4'));var rp=require(_0x3614('0x5'));var fs=require('fs');var path=require(_0x3614('0x6'));var rimraf=require(_0x3614('0x7'));var config=require(_0x3614('0x8'));var attributes=require(_0x3614('0x9'));module[_0x3614('0xa')]=function(_0x5e4789,_0x381942){return _0x5e4789[_0x3614('0xb')](_0x3614('0xc'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x3614('0xd'),'fields':['idField',_0x3614('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ae6c61e..d91df3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a52=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xa39fb9,_0xbe45ab){var _0x1320ca=function(_0x35c70f){while(--_0x35c70f){_0xa39fb9['push'](_0xa39fb9['shift']());}};_0x1320ca(++_0xbe45ab);}(_0x2a52,0x1a0));var _0x22a5=function(_0x225a67,_0x1b4361){_0x225a67=_0x225a67-0x0;var _0x85ea2=_0x2a52[_0x225a67];return _0x85ea2;};'use strict';var _=require(_0x22a5('0x0'));var util=require('util');var moment=require(_0x22a5('0x1'));var BPromise=require(_0x22a5('0x2'));var rs=require(_0x22a5('0x3'));var fs=require('fs');var Redis=require(_0x22a5('0x4'));var db=require(_0x22a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22a5('0x6'))(_0x22a5('0x7'));var config=require(_0x22a5('0x8'));var jayson=require(_0x22a5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ca987,_0x4a9825,_0x4384ae){return new BPromise(function(_0x18ff93,_0xfd22f8){return client['request'](_0x3ca987,_0x4384ae)['then'](function(_0x2a2226){logger['info'](_0x22a5('0xa'),_0x4a9825,_0x22a5('0xb'));logger[_0x22a5('0xc')](_0x22a5('0xd'),_0x4a9825,_0x22a5('0xb'),JSON[_0x22a5('0xe')](_0x2a2226));if(_0x2a2226[_0x22a5('0xf')]){if(_0x2a2226[_0x22a5('0xf')][_0x22a5('0x10')]===0x1f4){logger[_0x22a5('0xf')]('ZendeskField,\x20%s,\x20%s',_0x4a9825,_0x2a2226[_0x22a5('0xf')][_0x22a5('0x11')]);return _0xfd22f8(_0x2a2226[_0x22a5('0xf')][_0x22a5('0x11')]);}logger[_0x22a5('0xf')](_0x22a5('0xa'),_0x4a9825,_0x2a2226[_0x22a5('0xf')][_0x22a5('0x11')]);return _0x18ff93(_0x2a2226[_0x22a5('0xf')]['message']);}else{logger[_0x22a5('0x12')](_0x22a5('0xa'),_0x4a9825,_0x22a5('0xb'));_0x18ff93(_0x2a2226[_0x22a5('0x13')]['message']);}})[_0x22a5('0x14')](function(_0x4db133){logger['error']('ZendeskField,\x20%s,\x20%s',_0x4a9825,_0x4db133);_0xfd22f8(_0x4db133);});});}
\ No newline at end of file
+var _0x12ce=['stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/logger','rpc','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x3f8d9d,_0x21361b){var _0x198e8e=function(_0x4e115b){while(--_0x4e115b){_0x3f8d9d['push'](_0x3f8d9d['shift']());}};_0x198e8e(++_0x21361b);}(_0x12ce,0x11e));var _0xe12c=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x12ce[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xe12c('0x0'));var util=require('util');var moment=require(_0xe12c('0x1'));var BPromise=require('bluebird');var rs=require(_0xe12c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe12c('0x3'))(_0xe12c('0x4'));var config=require('../../config/environment');var jayson=require(_0xe12c('0x5'));var client=jayson['client'][_0xe12c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4181a4,_0x9ad3ae,_0x2e8f7c){return new BPromise(function(_0x14087d,_0x1a3fda){return client[_0xe12c('0x7')](_0x4181a4,_0x2e8f7c)[_0xe12c('0x8')](function(_0x3b81cf){logger[_0xe12c('0x9')](_0xe12c('0xa'),_0x9ad3ae,_0xe12c('0xb'));logger[_0xe12c('0xc')](_0xe12c('0xd'),_0x9ad3ae,_0xe12c('0xb'),JSON[_0xe12c('0xe')](_0x3b81cf));if(_0x3b81cf[_0xe12c('0xf')]){if(_0x3b81cf[_0xe12c('0xf')][_0xe12c('0x10')]===0x1f4){logger[_0xe12c('0xf')](_0xe12c('0xa'),_0x9ad3ae,_0x3b81cf['error'][_0xe12c('0x11')]);return _0x1a3fda(_0x3b81cf[_0xe12c('0xf')][_0xe12c('0x11')]);}logger[_0xe12c('0xf')](_0xe12c('0xa'),_0x9ad3ae,_0x3b81cf[_0xe12c('0xf')]['message']);return _0x14087d(_0x3b81cf[_0xe12c('0xf')][_0xe12c('0x11')]);}else{logger[_0xe12c('0x9')]('ZendeskField,\x20%s,\x20%s',_0x9ad3ae,_0xe12c('0xb'));_0x14087d(_0x3b81cf[_0xe12c('0x12')][_0xe12c('0x11')]);}})[_0xe12c('0x13')](function(_0x553201){logger['error']('ZendeskField,\x20%s,\x20%s',_0x9ad3ae,_0x553201);_0x1a3fda(_0x553201);});});}
\ No newline at end of file
index 093911c..d9061c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x991b=['../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','connect-timeout','express','fs-extra'];(function(_0x47761d,_0x3f8494){var _0x3d1c05=function(_0x3571da){while(--_0x3571da){_0x47761d['push'](_0x47761d['shift']());}};_0x3d1c05(++_0x3f8494);}(_0x991b,0x6b));var _0xb991=function(_0x398d2f,_0x54b61c){_0x398d2f=_0x398d2f-0x0;var _0x2a5216=_0x991b[_0x398d2f];return _0x2a5216;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb991('0x0'));var express=require(_0xb991('0x1'));var router=express['Router']();var fs_extra=require(_0xb991('0x2'));var auth=require(_0xb991('0x3'));var interaction=require(_0xb991('0x4'));var config=require('../../config/environment');var controller=require(_0xb991('0x5'));router[_0xb991('0x6')]('/',auth[_0xb991('0x7')](),controller[_0xb991('0x8')]);router[_0xb991('0x6')](_0xb991('0x9'),auth['isAuthenticated'](),controller[_0xb991('0xa')]);router[_0xb991('0x6')](_0xb991('0xb'),auth[_0xb991('0x7')](),controller[_0xb991('0xc')]);router[_0xb991('0x6')](_0xb991('0xd'),auth['isAuthenticated'](),controller[_0xb991('0xe')]);router[_0xb991('0xf')]('/',auth['isAuthenticated'](),controller[_0xb991('0x10')]);router['post'](_0xb991('0xb'),auth[_0xb991('0x7')](),controller[_0xb991('0x11')]);router[_0xb991('0x12')](_0xb991('0x9'),auth[_0xb991('0x7')](),controller[_0xb991('0x13')]);router[_0xb991('0x14')](_0xb991('0x9'),auth[_0xb991('0x7')](),controller['destroy']);module[_0xb991('0x15')]=router;
\ No newline at end of file
+var _0x8d57=['put','delete','exports','multer','path','express','Router','fs-extra','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','addConfiguration'];(function(_0x2f023d,_0x29dfe5){var _0x4ef240=function(_0x49f1ec){while(--_0x49f1ec){_0x2f023d['push'](_0x2f023d['shift']());}};_0x4ef240(++_0x29dfe5);}(_0x8d57,0x1a1));var _0x78d5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8d57[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x78d5('0x0'));var util=require('util');var path=require(_0x78d5('0x1'));var timeout=require('connect-timeout');var express=require(_0x78d5('0x2'));var router=express[_0x78d5('0x3')]();var fs_extra=require(_0x78d5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x78d5('0x5'));router[_0x78d5('0x6')]('/',auth[_0x78d5('0x7')](),controller[_0x78d5('0x8')]);router['get'](_0x78d5('0x9'),auth[_0x78d5('0x7')](),controller[_0x78d5('0xa')]);router[_0x78d5('0x6')](_0x78d5('0xb'),auth[_0x78d5('0x7')](),controller['getConfigurations']);router[_0x78d5('0x6')]('/:id/fields',auth[_0x78d5('0x7')](),controller[_0x78d5('0xc')]);router[_0x78d5('0xd')]('/',auth[_0x78d5('0x7')](),controller['create']);router[_0x78d5('0xd')](_0x78d5('0xb'),auth[_0x78d5('0x7')](),controller[_0x78d5('0xe')]);router[_0x78d5('0xf')](_0x78d5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x78d5('0x10')](_0x78d5('0x9'),auth[_0x78d5('0x7')](),controller['destroy']);module[_0x78d5('0x11')]=router;
\ No newline at end of file
index 8ad4d7b..2038b3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ea=['sequelize','exports','STRING'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xd2ea,0x15f));var _0xad2e=function(_0x51df2a,_0x58d8c8){_0x51df2a=_0x51df2a-0x0;var _0x59794f=_0xd2ea[_0x51df2a];return _0x59794f;};'use strict';var Sequelize=require(_0xad2e('0x0'));module[_0xad2e('0x1')]={'name':{'type':Sequelize[_0xad2e('0x2')]},'description':{'type':Sequelize[_0xad2e('0x2')]},'host':{'type':Sequelize[_0xad2e('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xad2e('0x2')]},'clientSecret':{'type':Sequelize[_0xad2e('0x2')]},'serverUrl':{'type':Sequelize[_0xad2e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xad2e('0x2')]},'refreshToken':{'type':Sequelize[_0xad2e('0x2')]}};
\ No newline at end of file
+var _0xbec5=['STRING','sequelize','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbec5,0xe5));var _0x5bec=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0xbec5[_0x27d8bc];return _0x4b04cb;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bec('0x2')]},'host':{'type':Sequelize[_0x5bec('0x2')]},'zone':{'type':Sequelize[_0x5bec('0x2')]},'clientId':{'type':Sequelize[_0x5bec('0x2')]},'clientSecret':{'type':Sequelize[_0x5bec('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x5bec('0x2')]},'refreshToken':{'type':Sequelize[_0x5bec('0x2')]}};
\ No newline at end of file
index 695282a..f543f13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x472c=['stringify','send','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','sendStatus','error','name','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','code','host','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x472c,0x188));var _0xc472=function(_0x3f781c,_0x516ba3){_0x3f781c=_0x3f781c-0x0;var _0x26c03e=_0x472c[_0x3f781c];return _0x26c03e;};'use strict';var emlformat=require(_0xc472('0x0'));var rimraf=require(_0xc472('0x1'));var zipdir=require(_0xc472('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc472('0x3'));var BPromise=require(_0xc472('0x4'));var Mustache=require('mustache');var util=require(_0xc472('0x5'));var path=require(_0xc472('0x6'));var sox=require(_0xc472('0x7'));var csv=require(_0xc472('0x8'));var ejs=require(_0xc472('0x9'));var fs=require('fs');var fs_extra=require(_0xc472('0xa'));var _=require(_0xc472('0xb'));var squel=require(_0xc472('0xc'));var crypto=require(_0xc472('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc472('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc472('0xf'));var Papa=require(_0xc472('0x10'));var Redis=require('ioredis');var authService=require(_0xc472('0x11'));var qs=require(_0xc472('0x12'));var as=require(_0xc472('0x13'));var hardwareService=require(_0xc472('0x14'));var logger=require('../../config/logger')(_0xc472('0x15'));var utils=require(_0xc472('0x16'));var config=require(_0xc472('0x17'));var licenseUtil=require(_0xc472('0x18'));var db=require(_0xc472('0x19'))['db'];var integrations=require(_0xc472('0x1a'));function respondWithStatusCode(_0x2cec24,_0x2c74b9){_0x2c74b9=_0x2c74b9||0xcc;return function(_0x536a83){if(_0x536a83){return _0x2cec24['sendStatus'](_0x2c74b9);}return _0x2cec24[_0xc472('0x1b')](_0x2c74b9)[_0xc472('0x1c')]();};}function respondWithResult(_0x184644,_0x3d78a2){_0x3d78a2=_0x3d78a2||0xc8;return function(_0x2fbc6a){if(_0x2fbc6a){return _0x184644[_0xc472('0x1b')](_0x3d78a2)[_0xc472('0x1d')](_0x2fbc6a);}};}function respondWithFilteredResult(_0x434911,_0x32b474){return function(_0x5216f4){if(_0x5216f4){var _0x205218=typeof _0x32b474[_0xc472('0x1e')]==='undefined'&&typeof _0x32b474['limit']===_0xc472('0x1f');var _0xac31d5=_0x5216f4[_0xc472('0x20')];var _0x2a0869=_0x205218?0x0:_0x32b474[_0xc472('0x1e')];var _0x8f157b=_0x205218?_0x5216f4[_0xc472('0x20')]:_0x32b474['offset']+_0x32b474[_0xc472('0x21')];var _0x21dc31;if(_0x8f157b>=_0xac31d5){_0x8f157b=_0xac31d5;_0x21dc31=0xc8;}else{_0x21dc31=0xce;}_0x434911[_0xc472('0x1b')](_0x21dc31);return _0x434911[_0xc472('0x22')](_0xc472('0x23'),_0x2a0869+'-'+_0x8f157b+'/'+_0xac31d5)['json'](_0x5216f4);}return null;};}function patchUpdates(_0x4b6c52){return function(_0x52399e){try{jsonpatch['apply'](_0x52399e,_0x4b6c52,!![]);}catch(_0x73bf0f){return BPromise[_0xc472('0x24')](_0x73bf0f);}return _0x52399e['save']();};}function saveUpdates(_0x8ba10,_0x26e212){return function(_0x3b0352){if(_0x3b0352){return _0x3b0352[_0xc472('0x25')](_0x8ba10)[_0xc472('0x26')](function(_0x1880f5){return _0x1880f5;});}return null;};}function removeEntity(_0x36df14,_0x4c6d95){return function(_0x1eb54b){if(_0x1eb54b){return _0x1eb54b['destroy']()[_0xc472('0x26')](function(){_0x36df14[_0xc472('0x1b')](0xcc)[_0xc472('0x1c')]();});}};}function handleEntityNotFound(_0x3038fc,_0x5777e0){return function(_0x2b57b2){if(!_0x2b57b2){_0x3038fc[_0xc472('0x27')](0x194);}return _0x2b57b2;};}function handleError(_0x2f1934,_0x3b74a7){_0x3b74a7=_0x3b74a7||0x1f4;return function(_0x403bc9){logger[_0xc472('0x28')](_0x403bc9['stack']);if(_0x403bc9['name']){delete _0x403bc9[_0xc472('0x29')];}_0x2f1934[_0xc472('0x1b')](_0x3b74a7)['send'](_0x403bc9);};}exports[_0xc472('0x2a')]=function(_0x2577cf,_0x229a2d){var _0x7c7517={},_0x5a386c={},_0x20581a={'count':0x0,'rows':[]};var _0x15a1fd=_[_0xc472('0x2b')](db[_0xc472('0x2c')][_0xc472('0x2d')],function(_0x54ce0e){return{'name':_0x54ce0e[_0xc472('0x2e')],'type':_0x54ce0e[_0xc472('0x2f')]['key']};});_0x5a386c[_0xc472('0x30')]=_['map'](_0x15a1fd,_0xc472('0x29'));_0x5a386c[_0xc472('0x31')]=_['keys'](_0x2577cf['query']);_0x5a386c[_0xc472('0x32')]=_[_0xc472('0x33')](_0x5a386c[_0xc472('0x30')],_0x5a386c[_0xc472('0x31')]);_0x7c7517[_0xc472('0x34')]=_['intersection'](_0x5a386c[_0xc472('0x30')],qs[_0xc472('0x35')](_0x2577cf[_0xc472('0x31')][_0xc472('0x35')]));_0x7c7517[_0xc472('0x34')]=_0x7c7517[_0xc472('0x34')][_0xc472('0x36')]?_0x7c7517[_0xc472('0x34')]:_0x5a386c['model'];if(!_0x2577cf[_0xc472('0x31')][_0xc472('0x37')](_0xc472('0x38'))){_0x7c7517['limit']=qs['limit'](_0x2577cf[_0xc472('0x31')][_0xc472('0x21')]);_0x7c7517[_0xc472('0x1e')]=qs['offset'](_0x2577cf[_0xc472('0x31')][_0xc472('0x1e')]);}_0x7c7517[_0xc472('0x39')]=qs[_0xc472('0x3a')](_0x2577cf[_0xc472('0x31')]['sort']);_0x7c7517['where']=qs[_0xc472('0x32')](_[_0xc472('0x3b')](_0x2577cf[_0xc472('0x31')],_0x5a386c['filters']),_0x15a1fd);if(_0x2577cf[_0xc472('0x31')][_0xc472('0x3c')]){_0x7c7517[_0xc472('0x3d')]=_[_0xc472('0x3e')](_0x7c7517[_0xc472('0x3d')],{'$or':_[_0xc472('0x2b')](_0x15a1fd,function(_0x1481b6){if(_0x1481b6[_0xc472('0x2f')]!=='VIRTUAL'){var _0x1f8e9a={};_0x1f8e9a[_0x1481b6['name']]={'$like':'%'+_0x2577cf[_0xc472('0x31')][_0xc472('0x3c')]+'%'};return _0x1f8e9a;}})});}_0x7c7517=_['merge']({},_0x7c7517,_0x2577cf['options']);var _0x1cabd6={'where':_0x7c7517[_0xc472('0x3d')]};return db[_0xc472('0x2c')]['count'](_0x1cabd6)[_0xc472('0x26')](function(_0x3dc0fc){_0x20581a['count']=_0x3dc0fc;if(_0x2577cf[_0xc472('0x31')][_0xc472('0x3f')]){_0x7c7517[_0xc472('0x40')]=[{'all':!![]}];}return db[_0xc472('0x2c')][_0xc472('0x41')](_0x7c7517);})[_0xc472('0x26')](function(_0x4dd56a){_0x20581a[_0xc472('0x42')]=_0x4dd56a;return _0x20581a;})[_0xc472('0x26')](respondWithFilteredResult(_0x229a2d,_0x7c7517))[_0xc472('0x43')](handleError(_0x229a2d,null));};exports['show']=function(_0x511b7c,_0x486598){var _0x48f30e={'raw':![],'where':{'id':_0x511b7c[_0xc472('0x44')]['id']}},_0x247792={};_0x247792[_0xc472('0x30')]=_[_0xc472('0x45')](db[_0xc472('0x2c')][_0xc472('0x2d')]);_0x247792[_0xc472('0x31')]=_['keys'](_0x511b7c[_0xc472('0x31')]);_0x247792[_0xc472('0x32')]=_[_0xc472('0x33')](_0x247792[_0xc472('0x30')],_0x247792[_0xc472('0x31')]);_0x48f30e[_0xc472('0x34')]=_[_0xc472('0x33')](_0x247792['model'],qs[_0xc472('0x35')](_0x511b7c[_0xc472('0x31')][_0xc472('0x35')]));_0x48f30e['attributes']=_0x48f30e[_0xc472('0x34')][_0xc472('0x36')]?_0x48f30e[_0xc472('0x34')]:_0x247792[_0xc472('0x30')];if(_0x511b7c[_0xc472('0x31')][_0xc472('0x3f')]){_0x48f30e[_0xc472('0x40')]=[{'all':!![]}];}_0x48f30e=_[_0xc472('0x3e')]({},_0x48f30e,_0x511b7c[_0xc472('0x46')]);return db[_0xc472('0x2c')][_0xc472('0x47')](_0x48f30e)[_0xc472('0x26')](handleEntityNotFound(_0x486598,null))[_0xc472('0x26')](respondWithResult(_0x486598,null))[_0xc472('0x43')](handleError(_0x486598,null));};exports[_0xc472('0x48')]=function(_0x2f4c88,_0x53e1da){return db['ZohoAccount'][_0xc472('0x48')](_0x2f4c88[_0xc472('0x49')],{})[_0xc472('0x26')](respondWithResult(_0x53e1da,0xc9))[_0xc472('0x43')](handleError(_0x53e1da,null));};exports[_0xc472('0x25')]=function(_0x30fedb,_0x1c8e8c){if(_0x30fedb[_0xc472('0x49')]['id']){delete _0x30fedb[_0xc472('0x49')]['id'];}return db[_0xc472('0x2c')][_0xc472('0x47')]({'where':{'id':_0x30fedb[_0xc472('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c8e8c,null))[_0xc472('0x26')](saveUpdates(_0x30fedb['body'],null))[_0xc472('0x26')](respondWithResult(_0x1c8e8c,null))[_0xc472('0x43')](handleError(_0x1c8e8c,null));};exports[_0xc472('0x4a')]=function(_0x369135,_0x58b610){return db[_0xc472('0x2c')]['find']({'where':{'id':_0x369135[_0xc472('0x44')]['id']}})['then'](handleEntityNotFound(_0x58b610,null))[_0xc472('0x26')](removeEntity(_0x58b610,null))[_0xc472('0x43')](handleError(_0x58b610,null));};exports[_0xc472('0x4b')]=function(_0x1df8b5,_0x26c7e1,_0x3fe34e){var _0x1c736b={};var _0x1c7d85={};var _0x28c5bb;var _0x59d13c;return db[_0xc472('0x2c')][_0xc472('0x4c')]({'where':{'id':_0x1df8b5[_0xc472('0x44')]['id']}})[_0xc472('0x26')](handleEntityNotFound(_0x26c7e1,null))['then'](function(_0x2f9556){if(_0x2f9556){_0x28c5bb=_0x2f9556;_0x1c7d85[_0xc472('0x30')]=_['keys'](db[_0xc472('0x4d')][_0xc472('0x2d')]);_0x1c7d85['query']=_[_0xc472('0x45')](_0x1df8b5[_0xc472('0x31')]);_0x1c7d85[_0xc472('0x32')]=_[_0xc472('0x33')](_0x1c7d85[_0xc472('0x30')],_0x1c7d85['query']);_0x1c736b[_0xc472('0x34')]=_[_0xc472('0x33')](_0x1c7d85[_0xc472('0x30')],qs['fields'](_0x1df8b5['query'][_0xc472('0x35')]));_0x1c736b[_0xc472('0x34')]=_0x1c736b[_0xc472('0x34')][_0xc472('0x36')]?_0x1c736b[_0xc472('0x34')]:_0x1c7d85['model'];_0x1c736b[_0xc472('0x39')]=qs[_0xc472('0x3a')](_0x1df8b5[_0xc472('0x31')][_0xc472('0x3a')]);_0x1c736b[_0xc472('0x3d')]=qs[_0xc472('0x32')](_['pick'](_0x1df8b5['query'],_0x1c7d85['filters']));if(_0x1df8b5[_0xc472('0x31')]['filter']){_0x1c736b[_0xc472('0x3d')]=_[_0xc472('0x3e')](_0x1c736b[_0xc472('0x3d')],{'$or':_[_0xc472('0x2b')](_0x1c736b[_0xc472('0x34')],function(_0x297788){var _0x4f0953={};_0x4f0953[_0x297788]={'$like':'%'+_0x1df8b5[_0xc472('0x31')][_0xc472('0x3c')]+'%'};return _0x4f0953;})});}_0x1c736b=_[_0xc472('0x3e')]({},_0x1c736b,_0x1df8b5[_0xc472('0x46')]);return _0x28c5bb[_0xc472('0x4b')](_0x1c736b);}})['then'](function(_0x3d2f47){if(_0x3d2f47){_0x59d13c=_0x3d2f47[_0xc472('0x36')];if(!_0x1df8b5[_0xc472('0x31')]['hasOwnProperty'](_0xc472('0x38'))){_0x1c736b[_0xc472('0x21')]=qs[_0xc472('0x21')](_0x1df8b5[_0xc472('0x31')][_0xc472('0x21')]);_0x1c736b[_0xc472('0x1e')]=qs[_0xc472('0x1e')](_0x1df8b5[_0xc472('0x31')]['offset']);}return _0x28c5bb[_0xc472('0x4b')](_0x1c736b);}})['then'](function(_0x11d168){if(_0x11d168){return _0x11d168?{'count':_0x59d13c,'rows':_0x11d168}:null;}})[_0xc472('0x26')](respondWithResult(_0x26c7e1,null))[_0xc472('0x43')](handleError(_0x26c7e1,null));};exports[_0xc472('0x4e')]=function(_0x430a74,_0x3a4eb6,_0x4b5e77){if(_0x430a74['body']['id']){delete _0x430a74[_0xc472('0x49')]['id'];}return db[_0xc472('0x2c')]['findOne']({'where':{'id':_0x430a74[_0xc472('0x44')]['id']}})[_0xc472('0x26')](handleEntityNotFound(_0x3a4eb6,null))[_0xc472('0x26')](function(_0x2d63fe){if(_0x2d63fe){_0x430a74[_0xc472('0x49')][_0xc472('0x4f')]=_0x2d63fe['id'];_0x430a74[_0xc472('0x49')]['Subjects']=integrations[_0xc472('0x50')](_0x430a74[_0xc472('0x49')][_0xc472('0x51')],_0x430a74[_0xc472('0x49')][_0xc472('0x2f')]);_0x430a74['body'][_0xc472('0x52')]=integrations[_0xc472('0x53')](_0x430a74['body'][_0xc472('0x51')],_0x430a74['body']['type']);return db['ZohoConfiguration'][_0xc472('0x48')](_0x430a74[_0xc472('0x49')],{'include':[{'model':db[_0xc472('0x54')],'as':'Subjects'},{'model':db[_0xc472('0x54')],'as':_0xc472('0x52')}]});}return null;})[_0xc472('0x26')](respondWithResult(_0x3a4eb6,null))[_0xc472('0x43')](handleError(_0x3a4eb6,null));};function getAccessToken(_0x1ee283){return new Promise(function(_0x43f6b0,_0x1cbfc0){var _0x493b1d;switch(_0x1ee283['zone']){case'US':_0x493b1d=_0xc472('0x55');break;case'AU':_0x493b1d=_0xc472('0x56');break;case'EU':_0x493b1d=_0xc472('0x57');break;case'IN':_0x493b1d=_0xc472('0x58');break;case'CN':_0x493b1d='https://accounts.zoho.com.cn';break;default:_0x493b1d=_0xc472('0x57');break;}var _0x4264c1={'method':_0xc472('0x59'),'uri':_0x493b1d+'/oauth/v2/token','qs':{'refresh_token':_0x1ee283[_0xc472('0x5a')],'client_id':_0x1ee283[_0xc472('0x5b')],'client_secret':_0x1ee283[_0xc472('0x5c')],'grant_type':_0xc472('0x5d')},'json':!![]};return rp(_0x4264c1)[_0xc472('0x26')](function(_0xa12068){if(_0xa12068[_0xc472('0x5e')]){_0x43f6b0(_0xa12068[_0xc472('0x5e')]);}else{_0x1cbfc0(_0xc472('0x5f'));}})[_0xc472('0x43')](function(_0x41e2b9){_0x1cbfc0(_0x41e2b9);});});}exports[_0xc472('0x60')]=function(_0x4af563,_0x470d33,_0x26749d){var _0x13d29c,_0x307b70,_0x16b400,_0x111af2,_0x562596;return db[_0xc472('0x2c')][_0xc472('0x4c')]({'where':{'id':_0x4af563[_0xc472('0x44')]['id']},'attributes':['id','host',_0xc472('0x61'),_0xc472('0x5b'),_0xc472('0x5c'),_0xc472('0x62'),_0xc472('0x63'),_0xc472('0x5a')]})[_0xc472('0x26')](handleEntityNotFound(_0x470d33,null))[_0xc472('0x26')](function(_0x1bc667){_0x562596=_0x1bc667;_0x13d29c=_0x562596[_0xc472('0x64')];_0x307b70=_0x13d29c===_0xc472('0x65')?'eu':_0xc472('0x66');_0x16b400=_0x562596['serverUrl'];var _0x21f035=_0x16b400[_0xc472('0x67')](-0x1);if(_0x21f035==='/'||_0x21f035==='\x5c'||_0x21f035===':'){_0x16b400=_0x16b400[_0xc472('0x68')](0x0,_0x16b400[_0xc472('0x69')](_0x21f035));}if(!_0x562596[_0xc472('0x5a')]){throw new Error(_0xc472('0x6a'));}return getAccessToken(_0x562596);})[_0xc472('0x26')](function(_0x450dd8){if(_0x450dd8){return rp({'method':'GET','uri':util[_0xc472('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x307b70),'qs':{'module':'Calls'},'headers':{'Authorization':_0xc472('0x6c')+_0x450dd8},'json':!![]});}})[_0xc472('0x26')](function(_0x8b5551){if(_0x8b5551){if(_0x8b5551[_0xc472('0x6d')]&&_0x8b5551[_0xc472('0x6d')][_0xc472('0x28')]){throw new Error(_0x8b5551[_0xc472('0x6d')]['error'][_0xc472('0x6e')]);}var _0x4dd69b=[];var _0x1328bc=[];var _0x2502de=[_0xc472('0x6f'),_0xc472('0x70'),_0xc472('0x71'),_0xc472('0x72'),_0xc472('0x73'),'Call_Result',_0xc472('0x74'),_0xc472('0x75')];_0x1328bc=_[_0xc472('0x76')](_0x8b5551[_0xc472('0x35')],function(_0x5a4640){return _0x2502de[_0xc472('0x77')](_0x5a4640[_0xc472('0x78')]);});for(var _0x57965c=0x0;_0x57965c<_0x1328bc['length'];_0x57965c++){if(_0x1328bc[_0x57965c]['system_mandatory']===![]){_0x4dd69b[_0xc472('0x79')]({'id':_0x1328bc[_0x57965c]['id'],'name':_0x1328bc[_0x57965c][_0xc472('0x7a')],'custom':_0x1328bc[_0x57965c]['custom_field'],'options':_0x1328bc[_0x57965c][_0xc472('0x7b')]===_0xc472('0x7c')&&_0x1328bc[_0x57965c]['pick_list_values'][_0xc472('0x36')]>-0x1?_['map'](_0x1328bc[_0x57965c][_0xc472('0x7d')],function(_0x30c249){return{'name':_0x30c249,'value':_0x30c249};}):[]});}}return{'count':_0x4dd69b[_0xc472('0x36')],'rows':_0x4dd69b};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x470d33,null))[_0xc472('0x43')](function(_0x1a0935){var _0x184efe=_0x4af563['query']['test']?0x1f4:_0x1a0935[_0xc472('0x7e')]||0x1f4;logger[_0xc472('0x28')](_0xc472('0x7f'),_0xc472('0x60'),_0x184efe,JSON[_0xc472('0x80')](_0x1a0935));delete _0x1a0935[_0xc472('0x29')];if(_0x184efe===0x191){_0x184efe=0x190;}_0x470d33[_0xc472('0x1b')](_0x184efe)[_0xc472('0x81')](_0x4af563[_0xc472('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1a0935[_0xc472('0x7e')]}:_0x1a0935);});};
\ No newline at end of file
+var _0xb184=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','create','body','find','findOne','ZohoConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','ZohoField','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','com','slice','substring','lastIndexOf','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','send','index','map','ZohoAccount','rawAttributes','type','key','model','name','query','keys','filters','intersection'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0xb184,0x14e));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4b18('0x0'));var rimraf=require(_0x4b18('0x1'));var zipdir=require(_0x4b18('0x2'));var jsonpatch=require(_0x4b18('0x3'));var rp=require(_0x4b18('0x4'));var moment=require('moment');var BPromise=require(_0x4b18('0x5'));var Mustache=require(_0x4b18('0x6'));var util=require(_0x4b18('0x7'));var path=require(_0x4b18('0x8'));var sox=require(_0x4b18('0x9'));var csv=require(_0x4b18('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b18('0xb'));var squel=require(_0x4b18('0xc'));var crypto=require(_0x4b18('0xd'));var jsforce=require(_0x4b18('0xe'));var deskjs=require(_0x4b18('0xf'));var toCsv=require(_0x4b18('0xa'));var querystring=require(_0x4b18('0x10'));var Papa=require(_0x4b18('0x11'));var Redis=require(_0x4b18('0x12'));var authService=require(_0x4b18('0x13'));var qs=require(_0x4b18('0x14'));var as=require(_0x4b18('0x15'));var hardwareService=require(_0x4b18('0x16'));var logger=require(_0x4b18('0x17'))(_0x4b18('0x18'));var utils=require(_0x4b18('0x19'));var config=require(_0x4b18('0x1a'));var licenseUtil=require(_0x4b18('0x1b'));var db=require(_0x4b18('0x1c'))['db'];var integrations=require(_0x4b18('0x1d'));function respondWithStatusCode(_0x1cbd8f,_0x1dae47){_0x1dae47=_0x1dae47||0xcc;return function(_0x57e08a){if(_0x57e08a){return _0x1cbd8f[_0x4b18('0x1e')](_0x1dae47);}return _0x1cbd8f['status'](_0x1dae47)[_0x4b18('0x1f')]();};}function respondWithResult(_0x207ec5,_0x30bd75){_0x30bd75=_0x30bd75||0xc8;return function(_0x73fa5f){if(_0x73fa5f){return _0x207ec5[_0x4b18('0x20')](_0x30bd75)[_0x4b18('0x21')](_0x73fa5f);}};}function respondWithFilteredResult(_0x4f9dba,_0x16a2b5){return function(_0x3432e0){if(_0x3432e0){var _0x2cee09=typeof _0x16a2b5['offset']===_0x4b18('0x22')&&typeof _0x16a2b5[_0x4b18('0x23')]===_0x4b18('0x22');var _0xca9808=_0x3432e0[_0x4b18('0x24')];var _0x4d7dfd=_0x2cee09?0x0:_0x16a2b5[_0x4b18('0x25')];var _0x3b536e=_0x2cee09?_0x3432e0[_0x4b18('0x24')]:_0x16a2b5[_0x4b18('0x25')]+_0x16a2b5[_0x4b18('0x23')];var _0x3e231f;if(_0x3b536e>=_0xca9808){_0x3b536e=_0xca9808;_0x3e231f=0xc8;}else{_0x3e231f=0xce;}_0x4f9dba['status'](_0x3e231f);return _0x4f9dba[_0x4b18('0x26')](_0x4b18('0x27'),_0x4d7dfd+'-'+_0x3b536e+'/'+_0xca9808)[_0x4b18('0x21')](_0x3432e0);}return null;};}function patchUpdates(_0x476990){return function(_0x317115){try{jsonpatch[_0x4b18('0x28')](_0x317115,_0x476990,!![]);}catch(_0x413a1a){return BPromise['reject'](_0x413a1a);}return _0x317115['save']();};}function saveUpdates(_0x3d1d23,_0x65bf49){return function(_0x4c3f43){if(_0x4c3f43){return _0x4c3f43[_0x4b18('0x29')](_0x3d1d23)[_0x4b18('0x2a')](function(_0x1efee1){return _0x1efee1;});}return null;};}function removeEntity(_0x1b14d2,_0x1f33fd){return function(_0x5cccf0){if(_0x5cccf0){return _0x5cccf0[_0x4b18('0x2b')]()[_0x4b18('0x2a')](function(){_0x1b14d2[_0x4b18('0x20')](0xcc)[_0x4b18('0x1f')]();});}};}function handleEntityNotFound(_0x23e99d,_0x101349){return function(_0x564632){if(!_0x564632){_0x23e99d[_0x4b18('0x1e')](0x194);}return _0x564632;};}function handleError(_0x5b5c25,_0x4ef64a){_0x4ef64a=_0x4ef64a||0x1f4;return function(_0x446d05){logger[_0x4b18('0x2c')](_0x446d05[_0x4b18('0x2d')]);if(_0x446d05['name']){delete _0x446d05['name'];}_0x5b5c25['status'](_0x4ef64a)[_0x4b18('0x2e')](_0x446d05);};}exports[_0x4b18('0x2f')]=function(_0x26d53e,_0x3b0cda){var _0x2ff6e5={},_0x52aec2={},_0x5a2cec={'count':0x0,'rows':[]};var _0x23c366=_[_0x4b18('0x30')](db[_0x4b18('0x31')][_0x4b18('0x32')],function(_0x8d865){return{'name':_0x8d865['fieldName'],'type':_0x8d865[_0x4b18('0x33')][_0x4b18('0x34')]};});_0x52aec2[_0x4b18('0x35')]=_[_0x4b18('0x30')](_0x23c366,_0x4b18('0x36'));_0x52aec2[_0x4b18('0x37')]=_[_0x4b18('0x38')](_0x26d53e[_0x4b18('0x37')]);_0x52aec2[_0x4b18('0x39')]=_[_0x4b18('0x3a')](_0x52aec2['model'],_0x52aec2[_0x4b18('0x37')]);_0x2ff6e5[_0x4b18('0x3b')]=_['intersection'](_0x52aec2[_0x4b18('0x35')],qs[_0x4b18('0x3c')](_0x26d53e[_0x4b18('0x37')]['fields']));_0x2ff6e5[_0x4b18('0x3b')]=_0x2ff6e5[_0x4b18('0x3b')][_0x4b18('0x3d')]?_0x2ff6e5[_0x4b18('0x3b')]:_0x52aec2[_0x4b18('0x35')];if(!_0x26d53e['query'][_0x4b18('0x3e')]('nolimit')){_0x2ff6e5[_0x4b18('0x23')]=qs[_0x4b18('0x23')](_0x26d53e['query']['limit']);_0x2ff6e5['offset']=qs[_0x4b18('0x25')](_0x26d53e[_0x4b18('0x37')][_0x4b18('0x25')]);}_0x2ff6e5[_0x4b18('0x3f')]=qs[_0x4b18('0x40')](_0x26d53e[_0x4b18('0x37')][_0x4b18('0x40')]);_0x2ff6e5[_0x4b18('0x41')]=qs[_0x4b18('0x39')](_[_0x4b18('0x42')](_0x26d53e[_0x4b18('0x37')],_0x52aec2[_0x4b18('0x39')]),_0x23c366);if(_0x26d53e[_0x4b18('0x37')][_0x4b18('0x43')]){_0x2ff6e5['where']=_[_0x4b18('0x44')](_0x2ff6e5[_0x4b18('0x41')],{'$or':_[_0x4b18('0x30')](_0x23c366,function(_0x1edf7d){if(_0x1edf7d[_0x4b18('0x33')]!==_0x4b18('0x45')){var _0x59bc33={};_0x59bc33[_0x1edf7d[_0x4b18('0x36')]]={'$like':'%'+_0x26d53e['query'][_0x4b18('0x43')]+'%'};return _0x59bc33;}})});}_0x2ff6e5=_[_0x4b18('0x44')]({},_0x2ff6e5,_0x26d53e['options']);var _0x9d69d={'where':_0x2ff6e5[_0x4b18('0x41')]};return db[_0x4b18('0x31')][_0x4b18('0x24')](_0x9d69d)[_0x4b18('0x2a')](function(_0x5ca7fa){_0x5a2cec[_0x4b18('0x24')]=_0x5ca7fa;if(_0x26d53e[_0x4b18('0x37')][_0x4b18('0x46')]){_0x2ff6e5[_0x4b18('0x47')]=[{'all':!![]}];}return db[_0x4b18('0x31')]['findAll'](_0x2ff6e5);})['then'](function(_0x47c001){_0x5a2cec[_0x4b18('0x48')]=_0x47c001;return _0x5a2cec;})[_0x4b18('0x2a')](respondWithFilteredResult(_0x3b0cda,_0x2ff6e5))[_0x4b18('0x49')](handleError(_0x3b0cda,null));};exports['show']=function(_0x5d7d1b,_0x2c0d5a){var _0xcf73ca={'raw':![],'where':{'id':_0x5d7d1b[_0x4b18('0x4a')]['id']}},_0x30e003={};_0x30e003[_0x4b18('0x35')]=_['keys'](db[_0x4b18('0x31')][_0x4b18('0x32')]);_0x30e003[_0x4b18('0x37')]=_[_0x4b18('0x38')](_0x5d7d1b[_0x4b18('0x37')]);_0x30e003[_0x4b18('0x39')]=_['intersection'](_0x30e003['model'],_0x30e003['query']);_0xcf73ca[_0x4b18('0x3b')]=_[_0x4b18('0x3a')](_0x30e003[_0x4b18('0x35')],qs[_0x4b18('0x3c')](_0x5d7d1b['query'][_0x4b18('0x3c')]));_0xcf73ca[_0x4b18('0x3b')]=_0xcf73ca[_0x4b18('0x3b')][_0x4b18('0x3d')]?_0xcf73ca['attributes']:_0x30e003[_0x4b18('0x35')];if(_0x5d7d1b[_0x4b18('0x37')][_0x4b18('0x46')]){_0xcf73ca['include']=[{'all':!![]}];}_0xcf73ca=_[_0x4b18('0x44')]({},_0xcf73ca,_0x5d7d1b[_0x4b18('0x4b')]);return db['ZohoAccount']['find'](_0xcf73ca)['then'](handleEntityNotFound(_0x2c0d5a,null))['then'](respondWithResult(_0x2c0d5a,null))[_0x4b18('0x49')](handleError(_0x2c0d5a,null));};exports[_0x4b18('0x4c')]=function(_0x327518,_0x5b3ff0){return db[_0x4b18('0x31')][_0x4b18('0x4c')](_0x327518[_0x4b18('0x4d')],{})[_0x4b18('0x2a')](respondWithResult(_0x5b3ff0,0xc9))[_0x4b18('0x49')](handleError(_0x5b3ff0,null));};exports[_0x4b18('0x29')]=function(_0x5472af,_0xd901f0){if(_0x5472af[_0x4b18('0x4d')]['id']){delete _0x5472af[_0x4b18('0x4d')]['id'];}return db['ZohoAccount'][_0x4b18('0x4e')]({'where':{'id':_0x5472af[_0x4b18('0x4a')]['id']}})['then'](handleEntityNotFound(_0xd901f0,null))['then'](saveUpdates(_0x5472af['body'],null))[_0x4b18('0x2a')](respondWithResult(_0xd901f0,null))[_0x4b18('0x49')](handleError(_0xd901f0,null));};exports['destroy']=function(_0x3e5cc2,_0x38df95){return db['ZohoAccount'][_0x4b18('0x4e')]({'where':{'id':_0x3e5cc2['params']['id']}})[_0x4b18('0x2a')](handleEntityNotFound(_0x38df95,null))[_0x4b18('0x2a')](removeEntity(_0x38df95,null))[_0x4b18('0x49')](handleError(_0x38df95,null));};exports['getConfigurations']=function(_0x22ece7,_0xb7f530,_0x579633){var _0x2b648f={};var _0xe8010b={};var _0x225cbc;var _0x51f382;return db['ZohoAccount'][_0x4b18('0x4f')]({'where':{'id':_0x22ece7['params']['id']}})[_0x4b18('0x2a')](handleEntityNotFound(_0xb7f530,null))[_0x4b18('0x2a')](function(_0x227542){if(_0x227542){_0x225cbc=_0x227542;_0xe8010b[_0x4b18('0x35')]=_[_0x4b18('0x38')](db[_0x4b18('0x50')][_0x4b18('0x32')]);_0xe8010b[_0x4b18('0x37')]=_['keys'](_0x22ece7[_0x4b18('0x37')]);_0xe8010b[_0x4b18('0x39')]=_['intersection'](_0xe8010b[_0x4b18('0x35')],_0xe8010b[_0x4b18('0x37')]);_0x2b648f['attributes']=_[_0x4b18('0x3a')](_0xe8010b['model'],qs[_0x4b18('0x3c')](_0x22ece7[_0x4b18('0x37')]['fields']));_0x2b648f[_0x4b18('0x3b')]=_0x2b648f[_0x4b18('0x3b')]['length']?_0x2b648f[_0x4b18('0x3b')]:_0xe8010b[_0x4b18('0x35')];_0x2b648f[_0x4b18('0x3f')]=qs[_0x4b18('0x40')](_0x22ece7[_0x4b18('0x37')][_0x4b18('0x40')]);_0x2b648f[_0x4b18('0x41')]=qs['filters'](_[_0x4b18('0x42')](_0x22ece7['query'],_0xe8010b[_0x4b18('0x39')]));if(_0x22ece7[_0x4b18('0x37')]['filter']){_0x2b648f['where']=_[_0x4b18('0x44')](_0x2b648f['where'],{'$or':_[_0x4b18('0x30')](_0x2b648f[_0x4b18('0x3b')],function(_0x12a637){var _0x45976c={};_0x45976c[_0x12a637]={'$like':'%'+_0x22ece7[_0x4b18('0x37')][_0x4b18('0x43')]+'%'};return _0x45976c;})});}_0x2b648f=_[_0x4b18('0x44')]({},_0x2b648f,_0x22ece7[_0x4b18('0x4b')]);return _0x225cbc[_0x4b18('0x51')](_0x2b648f);}})['then'](function(_0x39a5bb){if(_0x39a5bb){_0x51f382=_0x39a5bb['length'];if(!_0x22ece7['query'][_0x4b18('0x3e')]('nolimit')){_0x2b648f[_0x4b18('0x23')]=qs[_0x4b18('0x23')](_0x22ece7[_0x4b18('0x37')]['limit']);_0x2b648f['offset']=qs[_0x4b18('0x25')](_0x22ece7[_0x4b18('0x37')][_0x4b18('0x25')]);}return _0x225cbc[_0x4b18('0x51')](_0x2b648f);}})['then'](function(_0x5a4194){if(_0x5a4194){return _0x5a4194?{'count':_0x51f382,'rows':_0x5a4194}:null;}})['then'](respondWithResult(_0xb7f530,null))[_0x4b18('0x49')](handleError(_0xb7f530,null));};exports[_0x4b18('0x52')]=function(_0x2e2b2b,_0x2946ad,_0x5e090f){if(_0x2e2b2b[_0x4b18('0x4d')]['id']){delete _0x2e2b2b['body']['id'];}return db[_0x4b18('0x31')]['findOne']({'where':{'id':_0x2e2b2b[_0x4b18('0x4a')]['id']}})[_0x4b18('0x2a')](handleEntityNotFound(_0x2946ad,null))[_0x4b18('0x2a')](function(_0x17f3dc){if(_0x17f3dc){_0x2e2b2b[_0x4b18('0x4d')]['AccountId']=_0x17f3dc['id'];_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x53')]=integrations[_0x4b18('0x54')](_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x55')],_0x2e2b2b['body'][_0x4b18('0x33')]);_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x56')]=integrations['getDescriptions'](_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x55')],_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x33')]);return db[_0x4b18('0x50')][_0x4b18('0x4c')](_0x2e2b2b['body'],{'include':[{'model':db[_0x4b18('0x57')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x4b18('0x56')}]});}return null;})[_0x4b18('0x2a')](respondWithResult(_0x2946ad,null))[_0x4b18('0x49')](handleError(_0x2946ad,null));};function getAccessToken(_0x4ccb50){return new Promise(function(_0x1d3a36,_0x5d6a2c){var _0x329e61;switch(_0x4ccb50['zone']){case'US':_0x329e61='https://accounts.zoho.com';break;case'AU':_0x329e61='https://accounts.zoho.com.au';break;case'EU':_0x329e61='https://accounts.zoho.eu';break;case'IN':_0x329e61=_0x4b18('0x58');break;case'CN':_0x329e61=_0x4b18('0x59');break;default:_0x329e61=_0x4b18('0x5a');break;}var _0x5f5300={'method':'POST','uri':_0x329e61+_0x4b18('0x5b'),'qs':{'refresh_token':_0x4ccb50[_0x4b18('0x5c')],'client_id':_0x4ccb50[_0x4b18('0x5d')],'client_secret':_0x4ccb50[_0x4b18('0x5e')],'grant_type':_0x4b18('0x5f')},'json':!![]};return rp(_0x5f5300)[_0x4b18('0x2a')](function(_0xdccd53){if(_0xdccd53[_0x4b18('0x60')]){_0x1d3a36(_0xdccd53[_0x4b18('0x60')]);}else{_0x5d6a2c(_0x4b18('0x61'));}})['catch'](function(_0x3d603a){_0x5d6a2c(_0x3d603a);});});}exports[_0x4b18('0x62')]=function(_0x332e1a,_0x32cbbd,_0x550f80){var _0x364794,_0x41e801,_0x5ad9a1,_0x2d130d,_0xaec120;return db[_0x4b18('0x31')][_0x4b18('0x4f')]({'where':{'id':_0x332e1a['params']['id']},'attributes':['id',_0x4b18('0x63'),_0x4b18('0x64'),_0x4b18('0x5d'),_0x4b18('0x5e'),_0x4b18('0x65'),_0x4b18('0x66'),_0x4b18('0x5c')]})['then'](handleEntityNotFound(_0x32cbbd,null))[_0x4b18('0x2a')](function(_0x13c396){_0xaec120=_0x13c396;_0x364794=_0xaec120[_0x4b18('0x63')];_0x41e801=_0x364794==='zoho.eu'?'eu':_0x4b18('0x67');_0x5ad9a1=_0xaec120[_0x4b18('0x65')];var _0x49bf01=_0x5ad9a1[_0x4b18('0x68')](-0x1);if(_0x49bf01==='/'||_0x49bf01==='\x5c'||_0x49bf01===':'){_0x5ad9a1=_0x5ad9a1[_0x4b18('0x69')](0x0,_0x5ad9a1[_0x4b18('0x6a')](_0x49bf01));}if(!_0xaec120['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xaec120);})[_0x4b18('0x2a')](function(_0x42e5fb){if(_0x42e5fb){return rp({'method':_0x4b18('0x6b'),'uri':util[_0x4b18('0x6c')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x41e801),'qs':{'module':_0x4b18('0x6d')},'headers':{'Authorization':_0x4b18('0x6e')+_0x42e5fb},'json':!![]});}})[_0x4b18('0x2a')](function(_0x597963){if(_0x597963){if(_0x597963[_0x4b18('0x6f')]&&_0x597963[_0x4b18('0x6f')]['error']){throw new Error(_0x597963[_0x4b18('0x6f')]['error'][_0x4b18('0x70')]);}var _0x1d6c1b=[];var _0x28a997=[];var _0x800e92=[_0x4b18('0x71'),'Subject','Description',_0x4b18('0x72'),_0x4b18('0x73'),_0x4b18('0x74'),_0x4b18('0x75'),_0x4b18('0x76')];_0x28a997=_[_0x4b18('0x77')](_0x597963[_0x4b18('0x3c')],function(_0x2a998b){return _0x800e92[_0x4b18('0x78')](_0x2a998b[_0x4b18('0x79')]);});for(var _0x42f002=0x0;_0x42f002<_0x28a997['length'];_0x42f002++){if(_0x28a997[_0x42f002][_0x4b18('0x7a')]===![]){_0x1d6c1b[_0x4b18('0x7b')]({'id':_0x28a997[_0x42f002]['id'],'name':_0x28a997[_0x42f002]['display_label'],'custom':_0x28a997[_0x42f002][_0x4b18('0x7c')],'options':_0x28a997[_0x42f002]['data_type']===_0x4b18('0x7d')&&_0x28a997[_0x42f002][_0x4b18('0x7e')][_0x4b18('0x3d')]>-0x1?_['map'](_0x28a997[_0x42f002][_0x4b18('0x7e')],function(_0x4b76ab){return{'name':_0x4b76ab,'value':_0x4b76ab};}):[]});}}return{'count':_0x1d6c1b[_0x4b18('0x3d')],'rows':_0x1d6c1b};}else{return{'count':0x0,'rows':[]};}})[_0x4b18('0x2a')](respondWithResult(_0x32cbbd,null))[_0x4b18('0x49')](function(_0x42fd11){var _0x125e4e=_0x332e1a[_0x4b18('0x37')]['test']?0x1f4:_0x42fd11[_0x4b18('0x7f')]||0x1f4;logger[_0x4b18('0x2c')](_0x4b18('0x80'),_0x4b18('0x62'),_0x125e4e,JSON['stringify'](_0x42fd11));delete _0x42fd11[_0x4b18('0x36')];if(_0x125e4e===0x191){_0x125e4e=0x190;}_0x32cbbd['status'](_0x125e4e)[_0x4b18('0x2e')](_0x332e1a[_0x4b18('0x37')][_0x4b18('0x81')]?{'message':_0x4b18('0x82'),'statusCode':_0x42fd11[_0x4b18('0x7f')]}:_0x42fd11);});};
\ No newline at end of file
index c5b5c77..ace436d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5cf=['https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lastIndexOf','POST','application/x-www-form-urlencoded','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','zone','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com'];(function(_0x24bcd9,_0xd2f1a8){var _0x5c4316=function(_0x543dc1){while(--_0x543dc1){_0x24bcd9['push'](_0x24bcd9['shift']());}};_0x5c4316(++_0xd2f1a8);}(_0xe5cf,0x6d));var _0xfe5c=function(_0x18b0e9,_0x494362){_0x18b0e9=_0x18b0e9-0x0;var _0x5d6546=_0xe5cf[_0x18b0e9];return _0x5d6546;};'use strict';var _=require(_0xfe5c('0x0'));var util=require(_0xfe5c('0x1'));var logger=require(_0xfe5c('0x2'))('api');var moment=require(_0xfe5c('0x3'));var BPromise=require(_0xfe5c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe5c('0x5'));var rimraf=require(_0xfe5c('0x6'));var config=require(_0xfe5c('0x7'));var attributes=require(_0xfe5c('0x8'));var integrations=require(_0xfe5c('0x9'));module[_0xfe5c('0xa')]=function(_0x179abe,_0x5774af){return _0x179abe[_0xfe5c('0xb')](_0xfe5c('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4f3218,_0x299dd4,_0x37013c){if(_0x4f3218['changed'](_0xfe5c('0xd'))||_0x4f3218[_0xfe5c('0xe')](_0xfe5c('0xf'))||_0x4f3218[_0xfe5c('0xe')](_0xfe5c('0x10'))||_0x4f3218[_0xfe5c('0xe')](_0xfe5c('0x11'))||_0x4f3218[_0xfe5c('0xe')](_0xfe5c('0x12'))||_0x4f3218[_0xfe5c('0xe')](_0xfe5c('0x13'))){var _0x1cec8d,_0x7bbde7;_0x1cec8d=_0x4f3218['serverUrl'];var _0x51aa5b=_0x1cec8d[_0xfe5c('0x14')](-0x1);if(_0x51aa5b==='/'||_0x51aa5b==='\x5c'||_0x51aa5b===':'){_0x1cec8d=_0x1cec8d[_0xfe5c('0x15')](0x0,_0x1cec8d['lastIndexOf'](_0x51aa5b));}switch(_0x4f3218['zone']){case'US':_0x7bbde7=_0xfe5c('0x16');break;case'AU':_0x7bbde7=_0xfe5c('0x17');break;case'IN':_0x7bbde7=_0xfe5c('0x18');break;case'CN':_0x7bbde7=_0xfe5c('0x19');break;default:_0x7bbde7=_0xfe5c('0x1a');break;}var _0x33efb4={'method':'POST','uri':_0x7bbde7+_0xfe5c('0x1b'),'form':{'grant_type':_0xfe5c('0x1c'),'client_id':_0x4f3218[_0xfe5c('0x10')],'client_secret':_0x4f3218['clientSecret'],'redirect_uri':_0x4f3218[_0xfe5c('0xf')],'code':_0x4f3218[_0xfe5c('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x33efb4)[_0xfe5c('0x1d')](function(_0x7cadfb){var _0x4a722e=JSON[_0xfe5c('0x1e')](_0x7cadfb);if(_0x4a722e[_0xfe5c('0x1f')]){_0x4f3218[_0xfe5c('0x20')]=_0x4a722e['refresh_token'];logger[_0xfe5c('0x21')](util['format'](_0xfe5c('0x22'),_0x4f3218[_0xfe5c('0x23')],_0x4f3218['id']));}else{logger[_0xfe5c('0x24')](util[_0xfe5c('0x25')](_0xfe5c('0x26'),_0x4f3218[_0xfe5c('0x23')],_0x4f3218['id']),util[_0xfe5c('0x27')](_0x4a722e,{'showHidden':![],'depth':null}));}return _0x37013c(null,_0x299dd4);})[_0xfe5c('0x28')](function(_0x39eeda){logger[_0xfe5c('0x24')](util['format'](_0xfe5c('0x26'),_0x4f3218[_0xfe5c('0x23')],_0x4f3218['id']),util[_0xfe5c('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x37013c(_0x39eeda);});}else{return _0x37013c(null,_0x299dd4);}},'beforeUpdate':function(_0x49e29d,_0x489c90,_0x21b053){if(_0x49e29d[_0xfe5c('0xe')](_0xfe5c('0xd'))||_0x49e29d[_0xfe5c('0xe')](_0xfe5c('0xf'))||_0x49e29d['changed'](_0xfe5c('0x10'))||_0x49e29d[_0xfe5c('0xe')](_0xfe5c('0x11'))||_0x49e29d[_0xfe5c('0xe')](_0xfe5c('0x12'))||_0x49e29d[_0xfe5c('0xe')]('host')){var _0x2c6e1a,_0x14e234;_0x2c6e1a=_0x49e29d[_0xfe5c('0xf')];var _0x3decd0=_0x2c6e1a[_0xfe5c('0x14')](-0x1);if(_0x3decd0==='/'||_0x3decd0==='\x5c'||_0x3decd0===':'){_0x2c6e1a=_0x2c6e1a[_0xfe5c('0x15')](0x0,_0x2c6e1a[_0xfe5c('0x29')](_0x3decd0));}switch(_0x49e29d[_0xfe5c('0xd')]){case'US':_0x14e234=_0xfe5c('0x16');break;case'AU':_0x14e234=_0xfe5c('0x17');break;case'IN':_0x14e234=_0xfe5c('0x18');break;case'CN':_0x14e234=_0xfe5c('0x19');break;default:_0x14e234=_0xfe5c('0x1a');break;}var _0x116a6b={'method':_0xfe5c('0x2a'),'uri':_0x14e234+_0xfe5c('0x1b'),'form':{'grant_type':_0xfe5c('0x1c'),'client_id':_0x49e29d[_0xfe5c('0x10')],'client_secret':_0x49e29d[_0xfe5c('0x11')],'redirect_uri':_0x49e29d[_0xfe5c('0xf')],'code':_0x49e29d['code']},'headers':{'Content-Type':_0xfe5c('0x2b')}};return rp(_0x116a6b)[_0xfe5c('0x1d')](function(_0x2298f1){var _0x223a44=JSON[_0xfe5c('0x1e')](_0x2298f1);if(_0x223a44['refresh_token']){_0x49e29d[_0xfe5c('0x20')]=_0x223a44['refresh_token'];logger['info'](util['format'](_0xfe5c('0x22'),_0x49e29d['name'],_0x49e29d['id']));}else{logger['error'](util[_0xfe5c('0x25')](_0xfe5c('0x26'),_0x49e29d['name'],_0x49e29d['id']),util[_0xfe5c('0x27')](_0x223a44,{'showHidden':![],'depth':null}));}return _0x21b053(null,_0x489c90);})['catch'](function(_0x5f1d2b){logger['error'](util[_0xfe5c('0x25')](_0xfe5c('0x26'),_0x49e29d['name'],_0x49e29d['id']),util[_0xfe5c('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x21b053(_0x5f1d2b);});}else{return _0x21b053(null,_0x489c90);}}}});};
\ No newline at end of file
+var _0xcbd6=['ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','authorization_code','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcbd6,0x123));var _0x6cbd=function(_0x5f4ec3,_0x1b02e6){_0x5f4ec3=_0x5f4ec3-0x0;var _0x1cf954=_0xcbd6[_0x5f4ec3];return _0x1cf954;};'use strict';var _=require(_0x6cbd('0x0'));var util=require('util');var logger=require(_0x6cbd('0x1'))(_0x6cbd('0x2'));var moment=require(_0x6cbd('0x3'));var BPromise=require(_0x6cbd('0x4'));var rp=require(_0x6cbd('0x5'));var fs=require('fs');var path=require(_0x6cbd('0x6'));var rimraf=require('rimraf');var config=require(_0x6cbd('0x7'));var attributes=require(_0x6cbd('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x6cbd('0x9')]=function(_0x3fd97f,_0x584881){return _0x3fd97f['define'](_0x6cbd('0xa'),attributes,{'tableName':_0x6cbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe3c89a,_0x42337a,_0x33dbfb){if(_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0xd'))||_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0xe'))||_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0xf'))||_0xe3c89a[_0x6cbd('0xc')]('clientSecret')||_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0x10'))||_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0x11'))){var _0x2a9034,_0xec80af;_0x2a9034=_0xe3c89a['serverUrl'];var _0x349528=_0x2a9034[_0x6cbd('0x12')](-0x1);if(_0x349528==='/'||_0x349528==='\x5c'||_0x349528===':'){_0x2a9034=_0x2a9034[_0x6cbd('0x13')](0x0,_0x2a9034['lastIndexOf'](_0x349528));}switch(_0xe3c89a[_0x6cbd('0xd')]){case'US':_0xec80af='https://accounts.zoho.com';break;case'AU':_0xec80af=_0x6cbd('0x14');break;case'IN':_0xec80af=_0x6cbd('0x15');break;case'CN':_0xec80af=_0x6cbd('0x16');break;default:_0xec80af=_0x6cbd('0x17');break;}var _0x48e2f3={'method':_0x6cbd('0x18'),'uri':_0xec80af+_0x6cbd('0x19'),'form':{'grant_type':'authorization_code','client_id':_0xe3c89a[_0x6cbd('0xf')],'client_secret':_0xe3c89a[_0x6cbd('0x1a')],'redirect_uri':_0xe3c89a[_0x6cbd('0xe')],'code':_0xe3c89a[_0x6cbd('0x10')]},'headers':{'Content-Type':_0x6cbd('0x1b')}};return rp(_0x48e2f3)[_0x6cbd('0x1c')](function(_0x6531d8){var _0x2db792=JSON[_0x6cbd('0x1d')](_0x6531d8);if(_0x2db792[_0x6cbd('0x1e')]){_0xe3c89a[_0x6cbd('0x1f')]=_0x2db792[_0x6cbd('0x1e')];logger[_0x6cbd('0x20')](util[_0x6cbd('0x21')](_0x6cbd('0x22'),_0xe3c89a[_0x6cbd('0x23')],_0xe3c89a['id']));}else{logger[_0x6cbd('0x24')](util['format'](_0x6cbd('0x25'),_0xe3c89a['name'],_0xe3c89a['id']),util['inspect'](_0x2db792,{'showHidden':![],'depth':null}));}return _0x33dbfb(null,_0x42337a);})[_0x6cbd('0x26')](function(_0x1905c0){logger[_0x6cbd('0x24')](util['format'](_0x6cbd('0x25'),_0xe3c89a['name'],_0xe3c89a['id']),util[_0x6cbd('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x33dbfb(_0x1905c0);});}else{return _0x33dbfb(null,_0x42337a);}},'beforeUpdate':function(_0x5a6637,_0x104d9b,_0x227e7d){if(_0x5a6637[_0x6cbd('0xc')](_0x6cbd('0xd'))||_0x5a6637[_0x6cbd('0xc')](_0x6cbd('0xe'))||_0x5a6637[_0x6cbd('0xc')](_0x6cbd('0xf'))||_0x5a6637['changed']('clientSecret')||_0x5a6637[_0x6cbd('0xc')](_0x6cbd('0x10'))||_0x5a6637['changed'](_0x6cbd('0x11'))){var _0x507851,_0x31c0f6;_0x507851=_0x5a6637[_0x6cbd('0xe')];var _0xf37d25=_0x507851[_0x6cbd('0x12')](-0x1);if(_0xf37d25==='/'||_0xf37d25==='\x5c'||_0xf37d25===':'){_0x507851=_0x507851[_0x6cbd('0x13')](0x0,_0x507851['lastIndexOf'](_0xf37d25));}switch(_0x5a6637[_0x6cbd('0xd')]){case'US':_0x31c0f6='https://accounts.zoho.com';break;case'AU':_0x31c0f6='https://accounts.zoho.com.au';break;case'IN':_0x31c0f6='https://accounts.zoho.in';break;case'CN':_0x31c0f6=_0x6cbd('0x16');break;default:_0x31c0f6=_0x6cbd('0x17');break;}var _0x303371={'method':_0x6cbd('0x18'),'uri':_0x31c0f6+_0x6cbd('0x19'),'form':{'grant_type':_0x6cbd('0x28'),'client_id':_0x5a6637['clientId'],'client_secret':_0x5a6637['clientSecret'],'redirect_uri':_0x5a6637['serverUrl'],'code':_0x5a6637['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x303371)[_0x6cbd('0x1c')](function(_0x5866f0){var _0x16b538=JSON[_0x6cbd('0x1d')](_0x5866f0);if(_0x16b538['refresh_token']){_0x5a6637[_0x6cbd('0x1f')]=_0x16b538[_0x6cbd('0x1e')];logger['info'](util['format'](_0x6cbd('0x22'),_0x5a6637[_0x6cbd('0x23')],_0x5a6637['id']));}else{logger[_0x6cbd('0x24')](util[_0x6cbd('0x21')](_0x6cbd('0x25'),_0x5a6637[_0x6cbd('0x23')],_0x5a6637['id']),util[_0x6cbd('0x27')](_0x16b538,{'showHidden':![],'depth':null}));}return _0x227e7d(null,_0x104d9b);})[_0x6cbd('0x26')](function(_0x50aed5){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5a6637[_0x6cbd('0x23')],_0x5a6637['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x227e7d(_0x50aed5);});}else{return _0x227e7d(null,_0x104d9b);}}}});};
\ No newline at end of file
index 679213e..72e404c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd26f=['GetZohoAccount','ZohoAccount','raw','options','limit','map','model','include','attributes','then','ShowZohoAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x5a028c,_0x5c1a96){var _0x16448c=function(_0x44a25c){while(--_0x44a25c){_0x5a028c['push'](_0x5a028c['shift']());}};_0x16448c(++_0x5c1a96);}(_0xd26f,0x113));var _0xfd26=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd26f[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd26('0x2'));var fs=require('fs');var Redis=require(_0xfd26('0x3'));var db=require(_0xfd26('0x4'))['db'];var utils=require(_0xfd26('0x5'));var logger=require(_0xfd26('0x6'))(_0xfd26('0x7'));var config=require(_0xfd26('0x8'));var jayson=require(_0xfd26('0x9'));var client=jayson[_0xfd26('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b353,_0x3c148d,_0x1905a2){return new BPromise(function(_0x3d405f,_0x3c9154){return client[_0xfd26('0xb')](_0x22b353,_0x1905a2)['then'](function(_0xcf2fdb){logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));logger[_0xfd26('0xf')](_0xfd26('0x10'),_0x3c148d,'request\x20sent',JSON[_0xfd26('0x11')](_0xcf2fdb));if(_0xcf2fdb['error']){if(_0xcf2fdb[_0xfd26('0x12')]['code']===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x3c148d,_0xcf2fdb['error']['message']);return _0x3c9154(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}logger[_0xfd26('0x12')](_0xfd26('0xd'),_0x3c148d,_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);return _0x3d405f(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}else{logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));_0x3d405f(_0xcf2fdb[_0xfd26('0x14')][_0xfd26('0x13')]);}})[_0xfd26('0x15')](function(_0x2f9b37){logger['error'](_0xfd26('0xd'),_0x3c148d,_0x2f9b37);_0x3c9154(_0x2f9b37);});});}exports[_0xfd26('0x16')]=function(_0xeb7aeb){var _0x210dd4=this;return new Promise(function(_0x36a275,_0x5b3e8b){return db[_0xfd26('0x17')]['findAll']({'raw':_0xeb7aeb['options']?_0xeb7aeb['options'][_0xfd26('0x18')]===undefined?!![]:![]:!![],'where':_0xeb7aeb[_0xfd26('0x19')]?_0xeb7aeb['options']['where']||null:null,'attributes':_0xeb7aeb[_0xfd26('0x19')]?_0xeb7aeb[_0xfd26('0x19')]['attributes']||null:null,'limit':_0xeb7aeb[_0xfd26('0x19')]?_0xeb7aeb['options'][_0xfd26('0x1a')]||null:null,'include':_0xeb7aeb['options']?_0xeb7aeb[_0xfd26('0x19')]['include']?_[_0xfd26('0x1b')](_0xeb7aeb[_0xfd26('0x19')]['include'],function(_0x5f5d51){return{'model':db[_0x5f5d51[_0xfd26('0x1c')]],'as':_0x5f5d51['as'],'attributes':_0x5f5d51['attributes'],'include':_0x5f5d51[_0xfd26('0x1d')]?_[_0xfd26('0x1b')](_0x5f5d51[_0xfd26('0x1d')],function(_0x20be94){return{'model':db[_0x20be94[_0xfd26('0x1c')]],'as':_0x20be94['as'],'attributes':_0x20be94['attributes'],'include':_0x20be94[_0xfd26('0x1d')]?_['map'](_0x20be94[_0xfd26('0x1d')],function(_0x217a38){return{'model':db[_0x217a38['model']],'as':_0x217a38['as'],'attributes':_0x217a38[_0xfd26('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfd26('0x1f')](function(_0x375c98){logger[_0xfd26('0xc')](_0xfd26('0x16'),_0xeb7aeb);logger[_0xfd26('0xf')](_0xfd26('0x16'),_0xeb7aeb,JSON[_0xfd26('0x11')](_0x375c98));_0x36a275(_0x375c98);})[_0xfd26('0x15')](function(_0x5b3be9){logger['error']('GetZohoAccount',_0x5b3be9['message'],_0xeb7aeb);_0x5b3e8b(_0x210dd4[_0xfd26('0x12')](0x1f4,_0x5b3be9['message']));});});};exports[_0xfd26('0x20')]=function(_0x944d20){var _0x481b18=this;return new Promise(function(_0x5d8dab,_0x2b166c){return db['ZohoAccount']['find']({'raw':_0x944d20[_0xfd26('0x19')]?_0x944d20[_0xfd26('0x19')][_0xfd26('0x18')]===undefined?!![]:![]:!![],'where':_0x944d20[_0xfd26('0x19')]?_0x944d20[_0xfd26('0x19')]['where']||null:null,'attributes':_0x944d20[_0xfd26('0x19')]?_0x944d20[_0xfd26('0x19')][_0xfd26('0x1e')]||null:null,'include':_0x944d20[_0xfd26('0x19')]?_0x944d20[_0xfd26('0x19')]['include']?_[_0xfd26('0x1b')](_0x944d20['options'][_0xfd26('0x1d')],function(_0x1f1e63){return{'model':db[_0x1f1e63[_0xfd26('0x1c')]],'as':_0x1f1e63['as'],'attributes':_0x1f1e63['attributes'],'include':_0x1f1e63[_0xfd26('0x1d')]?_[_0xfd26('0x1b')](_0x1f1e63[_0xfd26('0x1d')],function(_0xd76274){return{'model':db[_0xd76274['model']],'as':_0xd76274['as'],'attributes':_0xd76274['attributes'],'include':_0xd76274[_0xfd26('0x1d')]?_['map'](_0xd76274[_0xfd26('0x1d')],function(_0x57a5a4){return{'model':db[_0x57a5a4[_0xfd26('0x1c')]],'as':_0x57a5a4['as'],'attributes':_0x57a5a4[_0xfd26('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfd26('0x1f')](function(_0x5ed9de){logger[_0xfd26('0xc')](_0xfd26('0x20'),_0x944d20);logger[_0xfd26('0xf')](_0xfd26('0x20'),_0x944d20,JSON['stringify'](_0x5ed9de));_0x5d8dab(_0x5ed9de);})[_0xfd26('0x15')](function(_0x50cca5){logger[_0xfd26('0x12')]('ShowZohoAccount',_0x50cca5[_0xfd26('0x13')],_0x944d20);_0x2b166c(_0x481b18[_0xfd26('0x12')](0x1f4,_0x50cca5[_0xfd26('0x13')]));});});};
\ No newline at end of file
+var _0x10ad=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZohoAccount','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x22566a,_0xa0723f){var _0x1b8e3e=function(_0xdca8f4){while(--_0xdca8f4){_0x22566a['push'](_0x22566a['shift']());}};_0x1b8e3e(++_0xa0723f);}(_0x10ad,0xf4));var _0xd10a=function(_0xb1e6e0,_0x2a8ba9){_0xb1e6e0=_0xb1e6e0-0x0;var _0x342d16=_0x10ad[_0xb1e6e0];return _0x342d16;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd10a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd10a('0x1'));var db=require(_0xd10a('0x2'))['db'];var utils=require(_0xd10a('0x3'));var logger=require(_0xd10a('0x4'))('rpc');var config=require(_0xd10a('0x5'));var jayson=require(_0xd10a('0x6'));var client=jayson[_0xd10a('0x7')][_0xd10a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x429316,_0xdae354,_0x217329){return new BPromise(function(_0x194a4a,_0x5be3da){return client['request'](_0x429316,_0x217329)[_0xd10a('0x9')](function(_0x4d8613){logger[_0xd10a('0xa')](_0xd10a('0xb'),_0xdae354,_0xd10a('0xc'));logger[_0xd10a('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xdae354,_0xd10a('0xc'),JSON[_0xd10a('0xe')](_0x4d8613));if(_0x4d8613[_0xd10a('0xf')]){if(_0x4d8613['error'][_0xd10a('0x10')]===0x1f4){logger[_0xd10a('0xf')](_0xd10a('0xb'),_0xdae354,_0x4d8613[_0xd10a('0xf')][_0xd10a('0x11')]);return _0x5be3da(_0x4d8613[_0xd10a('0xf')]['message']);}logger['error'](_0xd10a('0xb'),_0xdae354,_0x4d8613[_0xd10a('0xf')][_0xd10a('0x11')]);return _0x194a4a(_0x4d8613[_0xd10a('0xf')]['message']);}else{logger['info'](_0xd10a('0xb'),_0xdae354,_0xd10a('0xc'));_0x194a4a(_0x4d8613[_0xd10a('0x12')][_0xd10a('0x11')]);}})[_0xd10a('0x13')](function(_0x33bb89){logger[_0xd10a('0xf')](_0xd10a('0xb'),_0xdae354,_0x33bb89);_0x5be3da(_0x33bb89);});});}exports[_0xd10a('0x14')]=function(_0x48a07b){var _0x589fb3=this;return new Promise(function(_0x40dd9f,_0x27d1a7){return db['ZohoAccount']['findAll']({'raw':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x16')]===undefined?!![]:![]:!![],'where':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x17')]||null:null,'attributes':_0x48a07b['options']?_0x48a07b['options'][_0xd10a('0x18')]||null:null,'limit':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x19')]||null:null,'include':_0x48a07b[_0xd10a('0x15')]?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x48a07b['options'][_0xd10a('0x1a')],function(_0x13eefe){return{'model':db[_0x13eefe[_0xd10a('0x1c')]],'as':_0x13eefe['as'],'attributes':_0x13eefe[_0xd10a('0x18')],'include':_0x13eefe[_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x13eefe[_0xd10a('0x1a')],function(_0x3715fe){return{'model':db[_0x3715fe['model']],'as':_0x3715fe['as'],'attributes':_0x3715fe['attributes'],'include':_0x3715fe['include']?_[_0xd10a('0x1b')](_0x3715fe[_0xd10a('0x1a')],function(_0x58f500){return{'model':db[_0x58f500[_0xd10a('0x1c')]],'as':_0x58f500['as'],'attributes':_0x58f500[_0xd10a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd10a('0x9')](function(_0x152bd5){logger[_0xd10a('0xa')]('GetZohoAccount',_0x48a07b);logger[_0xd10a('0xd')](_0xd10a('0x14'),_0x48a07b,JSON[_0xd10a('0xe')](_0x152bd5));_0x40dd9f(_0x152bd5);})[_0xd10a('0x13')](function(_0x41e582){logger[_0xd10a('0xf')](_0xd10a('0x14'),_0x41e582[_0xd10a('0x11')],_0x48a07b);_0x27d1a7(_0x589fb3[_0xd10a('0xf')](0x1f4,_0x41e582[_0xd10a('0x11')]));});});};exports[_0xd10a('0x1d')]=function(_0x45e9fd){var _0x12ab07=this;return new Promise(function(_0xd7741,_0x4ad3d4){return db['ZohoAccount'][_0xd10a('0x1e')]({'raw':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')][_0xd10a('0x16')]===undefined?!![]:![]:!![],'where':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')]['where']||null:null,'attributes':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')]['attributes']||null:null,'include':_0x45e9fd['options']?_0x45e9fd[_0xd10a('0x15')][_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x45e9fd[_0xd10a('0x15')]['include'],function(_0xa6aeeb){return{'model':db[_0xa6aeeb['model']],'as':_0xa6aeeb['as'],'attributes':_0xa6aeeb[_0xd10a('0x18')],'include':_0xa6aeeb['include']?_['map'](_0xa6aeeb[_0xd10a('0x1a')],function(_0x1bce2b){return{'model':db[_0x1bce2b[_0xd10a('0x1c')]],'as':_0x1bce2b['as'],'attributes':_0x1bce2b['attributes'],'include':_0x1bce2b[_0xd10a('0x1a')]?_['map'](_0x1bce2b[_0xd10a('0x1a')],function(_0x1ab0a2){return{'model':db[_0x1ab0a2[_0xd10a('0x1c')]],'as':_0x1ab0a2['as'],'attributes':_0x1ab0a2[_0xd10a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd10a('0x9')](function(_0x22ee6e){logger[_0xd10a('0xa')]('ShowZohoAccount',_0x45e9fd);logger[_0xd10a('0xd')](_0xd10a('0x1d'),_0x45e9fd,JSON[_0xd10a('0xe')](_0x22ee6e));_0xd7741(_0x22ee6e);})[_0xd10a('0x13')](function(_0x4997b0){logger[_0xd10a('0xf')](_0xd10a('0x1d'),_0x4997b0[_0xd10a('0x11')],_0x45e9fd);_0x4ad3d4(_0x12ab07['error'](0x1f4,_0x4997b0['message']));});});};
\ No newline at end of file
index f26cc20..7eadf22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aeb=['Router','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','getSubjects','getDescriptions','create','put','delete','destroy','path'];(function(_0xe75d24,_0x54f93b){var _0x4d2587=function(_0x1e5fc9){while(--_0x1e5fc9){_0xe75d24['push'](_0xe75d24['shift']());}};_0x4d2587(++_0x54f93b);}(_0x9aeb,0x131));var _0xb9ae=function(_0x2e4a53,_0x3cf24b){_0x2e4a53=_0x2e4a53-0x0;var _0x1623aa=_0x9aeb[_0x2e4a53];return _0x1623aa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb9ae('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb9ae('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xb9ae('0x2'));var interaction=require(_0xb9ae('0x3'));var config=require('../../config/environment');var controller=require(_0xb9ae('0x4'));router['get']('/',auth[_0xb9ae('0x5')](),controller[_0xb9ae('0x6')]);router[_0xb9ae('0x7')](_0xb9ae('0x8'),auth[_0xb9ae('0x5')](),controller[_0xb9ae('0x9')]);router[_0xb9ae('0x7')]('/:id/fields',auth[_0xb9ae('0x5')](),controller[_0xb9ae('0xa')]);router[_0xb9ae('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xb9ae('0xb')]);router[_0xb9ae('0x7')]('/:id/descriptions',auth[_0xb9ae('0x5')](),controller[_0xb9ae('0xc')]);router['post']('/',auth[_0xb9ae('0x5')](),controller[_0xb9ae('0xd')]);router[_0xb9ae('0xe')](_0xb9ae('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xb9ae('0xf')](_0xb9ae('0x8'),auth[_0xb9ae('0x5')](),controller[_0xb9ae('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x103f=['getFields','/:id/subjects','getDescriptions','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields'];(function(_0x25748b,_0x1b3f73){var _0x5068f1=function(_0x65ecc7){while(--_0x65ecc7){_0x25748b['push'](_0x25748b['shift']());}};_0x5068f1(++_0x1b3f73);}(_0x103f,0x17e));var _0xf103=function(_0x246df7,_0x2227f3){_0x246df7=_0x246df7-0x0;var _0x5d7ede=_0x103f[_0x246df7];return _0x5d7ede;};'use strict';var multer=require(_0xf103('0x0'));var util=require(_0xf103('0x1'));var path=require(_0xf103('0x2'));var timeout=require(_0xf103('0x3'));var express=require('express');var router=express[_0xf103('0x4')]();var fs_extra=require(_0xf103('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf103('0x6'));var config=require(_0xf103('0x7'));var controller=require(_0xf103('0x8'));router[_0xf103('0x9')]('/',auth[_0xf103('0xa')](),controller['index']);router[_0xf103('0x9')](_0xf103('0xb'),auth[_0xf103('0xa')](),controller[_0xf103('0xc')]);router[_0xf103('0x9')](_0xf103('0xd'),auth[_0xf103('0xa')](),controller[_0xf103('0xe')]);router[_0xf103('0x9')](_0xf103('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf103('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf103('0x10')]);router[_0xf103('0x11')]('/',auth[_0xf103('0xa')](),controller[_0xf103('0x12')]);router['put'](_0xf103('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf103('0x13')]('/:id',auth[_0xf103('0xa')](),controller[_0xf103('0x14')]);module[_0xf103('0x15')]=router;
\ No newline at end of file
index 862672a..eeff3cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0737=['contact_lead','sequelize','STRING','ENUM','lead','nothing'];(function(_0xced95b,_0x1b771b){var _0x101cbe=function(_0x32bc83){while(--_0x32bc83){_0xced95b['push'](_0xced95b['shift']());}};_0x101cbe(++_0x1b771b);}(_0x0737,0x18d));var _0x7073=function(_0x101485,_0x532d75){_0x101485=_0x101485-0x0;var _0x51885d=_0x0737[_0x101485];return _0x51885d;};'use strict';var Sequelize=require(_0x7073('0x0'));module['exports']={'name':{'type':Sequelize[_0x7073('0x1')]},'moduleCreate':{'type':Sequelize[_0x7073('0x2')](_0x7073('0x3'),'contact',_0x7073('0x4')),'defaultValue':_0x7073('0x3')},'moduleSearch':{'type':Sequelize[_0x7073('0x2')](_0x7073('0x5'),'contact',_0x7073('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x7073('0x1')]}};
\ No newline at end of file
+var _0xaced=['ENUM','lead','nothing','contact_lead','sequelize','exports','STRING'];(function(_0x4a726e,_0x2ed66e){var _0x3650e3=function(_0x21f2e3){while(--_0x21f2e3){_0x4a726e['push'](_0x4a726e['shift']());}};_0x3650e3(++_0x2ed66e);}(_0xaced,0x18c));var _0xdace=function(_0x5023e8,_0x7e0cbc){_0x5023e8=_0x5023e8-0x0;var _0x4b9e26=_0xaced[_0x5023e8];return _0x4b9e26;};'use strict';var Sequelize=require(_0xdace('0x0'));module[_0xdace('0x1')]={'name':{'type':Sequelize[_0xdace('0x2')]},'moduleCreate':{'type':Sequelize[_0xdace('0x3')](_0xdace('0x4'),'contact',_0xdace('0x5')),'defaultValue':_0xdace('0x4')},'moduleSearch':{'type':Sequelize[_0xdace('0x3')](_0xdace('0x6'),'contact',_0xdace('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6f8e528..09f97c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc594=['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','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ZohoConfiguration','fieldName','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','sort','filters','filter','merge','where','type','VIRTUAL','options','include','rows','catch','rawAttributes','includeAll','find','create','body','params','destroy','getFields','ZohoField','order','pick','getSubjects','findOne','nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0xc594,0x138));var _0x4c59=function(_0x20cd63,_0x42a03a){_0x20cd63=_0x20cd63-0x0;var _0x34e0d0=_0xc594[_0x20cd63];return _0x34e0d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c59('0x0'));var zipdir=require(_0x4c59('0x1'));var jsonpatch=require(_0x4c59('0x2'));var rp=require(_0x4c59('0x3'));var moment=require(_0x4c59('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c59('0x5'));var util=require(_0x4c59('0x6'));var path=require(_0x4c59('0x7'));var sox=require(_0x4c59('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c59('0x9'));var _=require(_0x4c59('0xa'));var squel=require(_0x4c59('0xb'));var crypto=require(_0x4c59('0xc'));var jsforce=require(_0x4c59('0xd'));var deskjs=require(_0x4c59('0xe'));var toCsv=require(_0x4c59('0xf'));var querystring=require('querystring');var Papa=require(_0x4c59('0x10'));var Redis=require(_0x4c59('0x11'));var authService=require(_0x4c59('0x12'));var qs=require(_0x4c59('0x13'));var as=require(_0x4c59('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c59('0x15'))(_0x4c59('0x16'));var utils=require(_0x4c59('0x17'));var config=require(_0x4c59('0x18'));var licenseUtil=require(_0x4c59('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d6f3e,_0x3994d1){_0x3994d1=_0x3994d1||0xcc;return function(_0x1339d2){if(_0x1339d2){return _0x5d6f3e[_0x4c59('0x1a')](_0x3994d1);}return _0x5d6f3e[_0x4c59('0x1b')](_0x3994d1)[_0x4c59('0x1c')]();};}function respondWithResult(_0x4b95,_0x318613){_0x318613=_0x318613||0xc8;return function(_0x57f6e9){if(_0x57f6e9){return _0x4b95[_0x4c59('0x1b')](_0x318613)['json'](_0x57f6e9);}};}function respondWithFilteredResult(_0x42265f,_0x54f78e){return function(_0x35a509){if(_0x35a509){var _0x3ccc20=typeof _0x54f78e[_0x4c59('0x1d')]===_0x4c59('0x1e')&&typeof _0x54f78e[_0x4c59('0x1f')]===_0x4c59('0x1e');var _0x25b9f9=_0x35a509[_0x4c59('0x20')];var _0x40462d=_0x3ccc20?0x0:_0x54f78e[_0x4c59('0x1d')];var _0x76b04c=_0x3ccc20?_0x35a509[_0x4c59('0x20')]:_0x54f78e[_0x4c59('0x1d')]+_0x54f78e[_0x4c59('0x1f')];var _0x2da984;if(_0x76b04c>=_0x25b9f9){_0x76b04c=_0x25b9f9;_0x2da984=0xc8;}else{_0x2da984=0xce;}_0x42265f[_0x4c59('0x1b')](_0x2da984);return _0x42265f[_0x4c59('0x21')](_0x4c59('0x22'),_0x40462d+'-'+_0x76b04c+'/'+_0x25b9f9)['json'](_0x35a509);}return null;};}function patchUpdates(_0x4dac40){return function(_0x44d097){try{jsonpatch[_0x4c59('0x23')](_0x44d097,_0x4dac40,!![]);}catch(_0x51eb38){return BPromise[_0x4c59('0x24')](_0x51eb38);}return _0x44d097[_0x4c59('0x25')]();};}function saveUpdates(_0x1cd3b3,_0x35ba1c){return function(_0x20d93a){if(_0x20d93a){return _0x20d93a[_0x4c59('0x26')](_0x1cd3b3)[_0x4c59('0x27')](function(_0x13b07b){return _0x13b07b;});}return null;};}function removeEntity(_0x19b266,_0x36d06c){return function(_0x173d8b){if(_0x173d8b){return _0x173d8b['destroy']()[_0x4c59('0x27')](function(){_0x19b266[_0x4c59('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a9459,_0x12759c){return function(_0x4a0355){if(!_0x4a0355){_0x3a9459[_0x4c59('0x1a')](0x194);}return _0x4a0355;};}function handleError(_0x24af02,_0x502b53){_0x502b53=_0x502b53||0x1f4;return function(_0x2fc150){logger[_0x4c59('0x28')](_0x2fc150[_0x4c59('0x29')]);if(_0x2fc150[_0x4c59('0x2a')]){delete _0x2fc150['name'];}_0x24af02[_0x4c59('0x1b')](_0x502b53)[_0x4c59('0x2b')](_0x2fc150);};}exports['index']=function(_0x559c16,_0x49316c){var _0x2dc3a9={},_0x52ed8c={},_0x29e540={'count':0x0,'rows':[]};var _0x720004=_[_0x4c59('0x2c')](db[_0x4c59('0x2d')]['rawAttributes'],function(_0x1f07f3){return{'name':_0x1f07f3[_0x4c59('0x2e')],'type':_0x1f07f3['type']['key']};});_0x52ed8c[_0x4c59('0x2f')]=_['map'](_0x720004,_0x4c59('0x2a'));_0x52ed8c['query']=_[_0x4c59('0x30')](_0x559c16['query']);_0x52ed8c['filters']=_[_0x4c59('0x31')](_0x52ed8c[_0x4c59('0x2f')],_0x52ed8c[_0x4c59('0x32')]);_0x2dc3a9[_0x4c59('0x33')]=_[_0x4c59('0x31')](_0x52ed8c['model'],qs[_0x4c59('0x34')](_0x559c16[_0x4c59('0x32')][_0x4c59('0x34')]));_0x2dc3a9['attributes']=_0x2dc3a9[_0x4c59('0x33')][_0x4c59('0x35')]?_0x2dc3a9['attributes']:_0x52ed8c[_0x4c59('0x2f')];if(!_0x559c16['query'][_0x4c59('0x36')]('nolimit')){_0x2dc3a9['limit']=qs[_0x4c59('0x1f')](_0x559c16[_0x4c59('0x32')][_0x4c59('0x1f')]);_0x2dc3a9['offset']=qs['offset'](_0x559c16[_0x4c59('0x32')][_0x4c59('0x1d')]);}_0x2dc3a9['order']=qs[_0x4c59('0x37')](_0x559c16[_0x4c59('0x32')][_0x4c59('0x37')]);_0x2dc3a9['where']=qs[_0x4c59('0x38')](_['pick'](_0x559c16[_0x4c59('0x32')],_0x52ed8c['filters']),_0x720004);if(_0x559c16[_0x4c59('0x32')][_0x4c59('0x39')]){_0x2dc3a9['where']=_[_0x4c59('0x3a')](_0x2dc3a9[_0x4c59('0x3b')],{'$or':_[_0x4c59('0x2c')](_0x720004,function(_0x42b3ab){if(_0x42b3ab[_0x4c59('0x3c')]!==_0x4c59('0x3d')){var _0x3caf62={};_0x3caf62[_0x42b3ab['name']]={'$like':'%'+_0x559c16['query']['filter']+'%'};return _0x3caf62;}})});}_0x2dc3a9=_[_0x4c59('0x3a')]({},_0x2dc3a9,_0x559c16[_0x4c59('0x3e')]);var _0x29f4aa={'where':_0x2dc3a9[_0x4c59('0x3b')]};return db[_0x4c59('0x2d')]['count'](_0x29f4aa)[_0x4c59('0x27')](function(_0x5e72cd){_0x29e540['count']=_0x5e72cd;if(_0x559c16[_0x4c59('0x32')]['includeAll']){_0x2dc3a9[_0x4c59('0x3f')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x2dc3a9);})[_0x4c59('0x27')](function(_0x477e5d){_0x29e540[_0x4c59('0x40')]=_0x477e5d;return _0x29e540;})[_0x4c59('0x27')](respondWithFilteredResult(_0x49316c,_0x2dc3a9))[_0x4c59('0x41')](handleError(_0x49316c,null));};exports['show']=function(_0x2e857,_0x387ec0){var _0x43a87b={'raw':![],'where':{'id':_0x2e857['params']['id']}},_0x49001f={};_0x49001f[_0x4c59('0x2f')]=_[_0x4c59('0x30')](db[_0x4c59('0x2d')][_0x4c59('0x42')]);_0x49001f[_0x4c59('0x32')]=_[_0x4c59('0x30')](_0x2e857[_0x4c59('0x32')]);_0x49001f[_0x4c59('0x38')]=_['intersection'](_0x49001f[_0x4c59('0x2f')],_0x49001f[_0x4c59('0x32')]);_0x43a87b[_0x4c59('0x33')]=_['intersection'](_0x49001f[_0x4c59('0x2f')],qs[_0x4c59('0x34')](_0x2e857[_0x4c59('0x32')][_0x4c59('0x34')]));_0x43a87b['attributes']=_0x43a87b[_0x4c59('0x33')]['length']?_0x43a87b[_0x4c59('0x33')]:_0x49001f[_0x4c59('0x2f')];if(_0x2e857[_0x4c59('0x32')][_0x4c59('0x43')]){_0x43a87b[_0x4c59('0x3f')]=[{'all':!![]}];}_0x43a87b=_['merge']({},_0x43a87b,_0x2e857['options']);return db[_0x4c59('0x2d')][_0x4c59('0x44')](_0x43a87b)['then'](handleEntityNotFound(_0x387ec0,null))[_0x4c59('0x27')](respondWithResult(_0x387ec0,null))['catch'](handleError(_0x387ec0,null));};exports[_0x4c59('0x45')]=function(_0x760eb7,_0x5474ef){return db[_0x4c59('0x2d')][_0x4c59('0x45')](_0x760eb7[_0x4c59('0x46')],{})[_0x4c59('0x27')](respondWithResult(_0x5474ef,0xc9))[_0x4c59('0x41')](handleError(_0x5474ef,null));};exports[_0x4c59('0x26')]=function(_0x27c012,_0x2fecb0){if(_0x27c012['body']['id']){delete _0x27c012['body']['id'];}return db[_0x4c59('0x2d')]['find']({'where':{'id':_0x27c012[_0x4c59('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fecb0,null))[_0x4c59('0x27')](saveUpdates(_0x27c012[_0x4c59('0x46')],null))[_0x4c59('0x27')](respondWithResult(_0x2fecb0,null))[_0x4c59('0x41')](handleError(_0x2fecb0,null));};exports[_0x4c59('0x48')]=function(_0x5e8f54,_0x555ebf){return db[_0x4c59('0x2d')][_0x4c59('0x44')]({'where':{'id':_0x5e8f54['params']['id']}})[_0x4c59('0x27')](handleEntityNotFound(_0x555ebf,null))[_0x4c59('0x27')](removeEntity(_0x555ebf,null))[_0x4c59('0x41')](handleError(_0x555ebf,null));};exports[_0x4c59('0x49')]=function(_0x4753e9,_0x5219ed,_0x91e4e7){var _0x36c784={};var _0xc7327d={};var _0x2a59d2;var _0x4f2980;return db[_0x4c59('0x2d')]['findOne']({'where':{'id':_0x4753e9[_0x4c59('0x47')]['id']}})[_0x4c59('0x27')](handleEntityNotFound(_0x5219ed,null))[_0x4c59('0x27')](function(_0x15e38c){if(_0x15e38c){_0x2a59d2=_0x15e38c;_0xc7327d[_0x4c59('0x2f')]=_[_0x4c59('0x30')](db[_0x4c59('0x4a')][_0x4c59('0x42')]);_0xc7327d[_0x4c59('0x32')]=_[_0x4c59('0x30')](_0x4753e9[_0x4c59('0x32')]);_0xc7327d[_0x4c59('0x38')]=_[_0x4c59('0x31')](_0xc7327d['model'],_0xc7327d[_0x4c59('0x32')]);_0x36c784[_0x4c59('0x33')]=_[_0x4c59('0x31')](_0xc7327d['model'],qs[_0x4c59('0x34')](_0x4753e9['query']['fields']));_0x36c784['attributes']=_0x36c784[_0x4c59('0x33')][_0x4c59('0x35')]?_0x36c784[_0x4c59('0x33')]:_0xc7327d[_0x4c59('0x2f')];_0x36c784[_0x4c59('0x4b')]=qs[_0x4c59('0x37')](_0x4753e9[_0x4c59('0x32')][_0x4c59('0x37')]);_0x36c784[_0x4c59('0x3b')]=qs[_0x4c59('0x38')](_[_0x4c59('0x4c')](_0x4753e9['query'],_0xc7327d[_0x4c59('0x38')]));if(_0x4753e9[_0x4c59('0x32')]['filter']){_0x36c784[_0x4c59('0x3b')]=_['merge'](_0x36c784[_0x4c59('0x3b')],{'$or':_[_0x4c59('0x2c')](_0x36c784[_0x4c59('0x33')],function(_0x391ea1){var _0x2dc2af={};_0x2dc2af[_0x391ea1]={'$like':'%'+_0x4753e9['query'][_0x4c59('0x39')]+'%'};return _0x2dc2af;})});}_0x36c784=_[_0x4c59('0x3a')]({},_0x36c784,_0x4753e9['options']);return _0x2a59d2[_0x4c59('0x49')](_0x36c784);}})[_0x4c59('0x27')](function(_0x1c6944){if(_0x1c6944){_0x4f2980=_0x1c6944[_0x4c59('0x35')];if(!_0x4753e9[_0x4c59('0x32')]['hasOwnProperty']('nolimit')){_0x36c784[_0x4c59('0x1f')]=qs['limit'](_0x4753e9[_0x4c59('0x32')]['limit']);_0x36c784[_0x4c59('0x1d')]=qs['offset'](_0x4753e9[_0x4c59('0x32')][_0x4c59('0x1d')]);}return _0x2a59d2[_0x4c59('0x49')](_0x36c784);}})[_0x4c59('0x27')](function(_0x178fdf){if(_0x178fdf){return _0x178fdf?{'count':_0x4f2980,'rows':_0x178fdf}:null;}})['then'](respondWithResult(_0x5219ed,null))[_0x4c59('0x41')](handleError(_0x5219ed,null));};exports[_0x4c59('0x4d')]=function(_0x2f984f,_0xecb805,_0x29d3df){var _0x534917={};var _0xb07f80={};var _0x43d306;var _0x498251;return db[_0x4c59('0x2d')][_0x4c59('0x4e')]({'where':{'id':_0x2f984f[_0x4c59('0x47')]['id']}})[_0x4c59('0x27')](handleEntityNotFound(_0xecb805,null))['then'](function(_0xb6a188){if(_0xb6a188){_0x43d306=_0xb6a188;_0xb07f80['model']=_[_0x4c59('0x30')](db[_0x4c59('0x4a')]['rawAttributes']);_0xb07f80['query']=_[_0x4c59('0x30')](_0x2f984f[_0x4c59('0x32')]);_0xb07f80[_0x4c59('0x38')]=_['intersection'](_0xb07f80[_0x4c59('0x2f')],_0xb07f80[_0x4c59('0x32')]);_0x534917[_0x4c59('0x33')]=_[_0x4c59('0x31')](_0xb07f80[_0x4c59('0x2f')],qs['fields'](_0x2f984f['query'][_0x4c59('0x34')]));_0x534917['attributes']=_0x534917[_0x4c59('0x33')][_0x4c59('0x35')]?_0x534917['attributes']:_0xb07f80[_0x4c59('0x2f')];_0x534917['order']=qs[_0x4c59('0x37')](_0x2f984f[_0x4c59('0x32')][_0x4c59('0x37')]);_0x534917[_0x4c59('0x3b')]=qs[_0x4c59('0x38')](_[_0x4c59('0x4c')](_0x2f984f[_0x4c59('0x32')],_0xb07f80[_0x4c59('0x38')]));if(_0x2f984f['query'][_0x4c59('0x39')]){_0x534917[_0x4c59('0x3b')]=_[_0x4c59('0x3a')](_0x534917[_0x4c59('0x3b')],{'$or':_[_0x4c59('0x2c')](_0x534917[_0x4c59('0x33')],function(_0x220e78){var _0x4a36c1={};_0x4a36c1[_0x220e78]={'$like':'%'+_0x2f984f[_0x4c59('0x32')][_0x4c59('0x39')]+'%'};return _0x4a36c1;})});}_0x534917=_[_0x4c59('0x3a')]({},_0x534917,_0x2f984f[_0x4c59('0x3e')]);return _0x43d306[_0x4c59('0x4d')](_0x534917);}})[_0x4c59('0x27')](function(_0x3ffbdd){if(_0x3ffbdd){_0x498251=_0x3ffbdd[_0x4c59('0x35')];if(!_0x2f984f[_0x4c59('0x32')][_0x4c59('0x36')](_0x4c59('0x4f'))){_0x534917[_0x4c59('0x1f')]=qs[_0x4c59('0x1f')](_0x2f984f[_0x4c59('0x32')][_0x4c59('0x1f')]);_0x534917[_0x4c59('0x1d')]=qs[_0x4c59('0x1d')](_0x2f984f[_0x4c59('0x32')][_0x4c59('0x1d')]);}return _0x43d306['getSubjects'](_0x534917);}})[_0x4c59('0x27')](function(_0xfbb034){if(_0xfbb034){return _0xfbb034?{'count':_0x498251,'rows':_0xfbb034}:null;}})['then'](respondWithResult(_0xecb805,null))['catch'](handleError(_0xecb805,null));};exports[_0x4c59('0x50')]=function(_0x22628d,_0x26f9c2,_0x274e25){var _0x254ecf={};var _0x5772c6={};var _0x4cac60;var _0x4e9ab7;return db[_0x4c59('0x2d')]['findOne']({'where':{'id':_0x22628d[_0x4c59('0x47')]['id']}})['then'](handleEntityNotFound(_0x26f9c2,null))['then'](function(_0x4defd1){if(_0x4defd1){_0x4cac60=_0x4defd1;_0x5772c6[_0x4c59('0x2f')]=_[_0x4c59('0x30')](db[_0x4c59('0x4a')][_0x4c59('0x42')]);_0x5772c6[_0x4c59('0x32')]=_['keys'](_0x22628d[_0x4c59('0x32')]);_0x5772c6['filters']=_[_0x4c59('0x31')](_0x5772c6[_0x4c59('0x2f')],_0x5772c6[_0x4c59('0x32')]);_0x254ecf[_0x4c59('0x33')]=_[_0x4c59('0x31')](_0x5772c6[_0x4c59('0x2f')],qs[_0x4c59('0x34')](_0x22628d[_0x4c59('0x32')][_0x4c59('0x34')]));_0x254ecf['attributes']=_0x254ecf[_0x4c59('0x33')][_0x4c59('0x35')]?_0x254ecf[_0x4c59('0x33')]:_0x5772c6['model'];_0x254ecf[_0x4c59('0x4b')]=qs[_0x4c59('0x37')](_0x22628d[_0x4c59('0x32')]['sort']);_0x254ecf[_0x4c59('0x3b')]=qs[_0x4c59('0x38')](_[_0x4c59('0x4c')](_0x22628d[_0x4c59('0x32')],_0x5772c6[_0x4c59('0x38')]));if(_0x22628d[_0x4c59('0x32')][_0x4c59('0x39')]){_0x254ecf[_0x4c59('0x3b')]=_[_0x4c59('0x3a')](_0x254ecf[_0x4c59('0x3b')],{'$or':_[_0x4c59('0x2c')](_0x254ecf[_0x4c59('0x33')],function(_0x3ca9d8){var _0xa6538d={};_0xa6538d[_0x3ca9d8]={'$like':'%'+_0x22628d['query'][_0x4c59('0x39')]+'%'};return _0xa6538d;})});}_0x254ecf=_['merge']({},_0x254ecf,_0x22628d['options']);return _0x4cac60[_0x4c59('0x50')](_0x254ecf);}})[_0x4c59('0x27')](function(_0x5084d7){if(_0x5084d7){_0x4e9ab7=_0x5084d7['length'];if(!_0x22628d[_0x4c59('0x32')][_0x4c59('0x36')](_0x4c59('0x4f'))){_0x254ecf[_0x4c59('0x1f')]=qs[_0x4c59('0x1f')](_0x22628d[_0x4c59('0x32')][_0x4c59('0x1f')]);_0x254ecf[_0x4c59('0x1d')]=qs[_0x4c59('0x1d')](_0x22628d[_0x4c59('0x32')]['offset']);}return _0x4cac60[_0x4c59('0x50')](_0x254ecf);}})['then'](function(_0x19596e){if(_0x19596e){return _0x19596e?{'count':_0x4e9ab7,'rows':_0x19596e}:null;}})['then'](respondWithResult(_0x26f9c2,null))[_0x4c59('0x41')](handleError(_0x26f9c2,null));};
\ No newline at end of file
+var _0x5c39=['update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','ZohoConfiguration','include','rows','show','params','length','catch','create','body','find','destroy','findOne','ZohoField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','save'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x5c39,0xd0));var _0x95c3=function(_0x506800,_0x1f947f){_0x506800=_0x506800-0x0;var _0x5bdd2e=_0x5c39[_0x506800];return _0x5bdd2e;};'use strict';var emlformat=require(_0x95c3('0x0'));var rimraf=require(_0x95c3('0x1'));var zipdir=require(_0x95c3('0x2'));var jsonpatch=require(_0x95c3('0x3'));var rp=require(_0x95c3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x95c3('0x5'));var util=require(_0x95c3('0x6'));var path=require(_0x95c3('0x7'));var sox=require(_0x95c3('0x8'));var csv=require(_0x95c3('0x9'));var ejs=require(_0x95c3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95c3('0xb'));var squel=require(_0x95c3('0xc'));var crypto=require(_0x95c3('0xd'));var jsforce=require(_0x95c3('0xe'));var deskjs=require(_0x95c3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x95c3('0x10'));var Papa=require(_0x95c3('0x11'));var Redis=require(_0x95c3('0x12'));var authService=require(_0x95c3('0x13'));var qs=require(_0x95c3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x95c3('0x15'))(_0x95c3('0x16'));var utils=require(_0x95c3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x95c3('0x18'));var db=require(_0x95c3('0x19'))['db'];function respondWithStatusCode(_0x76fb5e,_0x22976c){_0x22976c=_0x22976c||0xcc;return function(_0x327ef1){if(_0x327ef1){return _0x76fb5e[_0x95c3('0x1a')](_0x22976c);}return _0x76fb5e[_0x95c3('0x1b')](_0x22976c)[_0x95c3('0x1c')]();};}function respondWithResult(_0x10d821,_0x27ea7b){_0x27ea7b=_0x27ea7b||0xc8;return function(_0x5eb068){if(_0x5eb068){return _0x10d821[_0x95c3('0x1b')](_0x27ea7b)['json'](_0x5eb068);}};}function respondWithFilteredResult(_0x1a3d65,_0x491b65){return function(_0x1b23e8){if(_0x1b23e8){var _0x1c4c63=typeof _0x491b65['offset']==='undefined'&&typeof _0x491b65[_0x95c3('0x1d')]===_0x95c3('0x1e');var _0x4d48df=_0x1b23e8[_0x95c3('0x1f')];var _0x355d0d=_0x1c4c63?0x0:_0x491b65[_0x95c3('0x20')];var _0x53c4b4=_0x1c4c63?_0x1b23e8[_0x95c3('0x1f')]:_0x491b65[_0x95c3('0x20')]+_0x491b65[_0x95c3('0x1d')];var _0x21abf9;if(_0x53c4b4>=_0x4d48df){_0x53c4b4=_0x4d48df;_0x21abf9=0xc8;}else{_0x21abf9=0xce;}_0x1a3d65[_0x95c3('0x1b')](_0x21abf9);return _0x1a3d65['set'](_0x95c3('0x21'),_0x355d0d+'-'+_0x53c4b4+'/'+_0x4d48df)[_0x95c3('0x22')](_0x1b23e8);}return null;};}function patchUpdates(_0x1836a5){return function(_0x19496c){try{jsonpatch[_0x95c3('0x23')](_0x19496c,_0x1836a5,!![]);}catch(_0x296368){return BPromise[_0x95c3('0x24')](_0x296368);}return _0x19496c[_0x95c3('0x25')]();};}function saveUpdates(_0x16e087,_0x1f3edc){return function(_0x9c6a62){if(_0x9c6a62){return _0x9c6a62[_0x95c3('0x26')](_0x16e087)[_0x95c3('0x27')](function(_0x56c1cf){return _0x56c1cf;});}return null;};}function removeEntity(_0x5c15a3,_0x3d3d22){return function(_0x20e117){if(_0x20e117){return _0x20e117['destroy']()['then'](function(){_0x5c15a3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x247806,_0x38c0ef){return function(_0x198ddd){if(!_0x198ddd){_0x247806[_0x95c3('0x1a')](0x194);}return _0x198ddd;};}function handleError(_0x3041c2,_0x446243){_0x446243=_0x446243||0x1f4;return function(_0x190960){logger[_0x95c3('0x28')](_0x190960[_0x95c3('0x29')]);if(_0x190960['name']){delete _0x190960[_0x95c3('0x2a')];}_0x3041c2[_0x95c3('0x1b')](_0x446243)['send'](_0x190960);};}exports[_0x95c3('0x2b')]=function(_0x311f33,_0x5388c7){var _0x492211={},_0x50cc23={},_0xc4c959={'count':0x0,'rows':[]};var _0x5a1e8d=_['map'](db['ZohoConfiguration'][_0x95c3('0x2c')],function(_0x45f59d){return{'name':_0x45f59d[_0x95c3('0x2d')],'type':_0x45f59d['type'][_0x95c3('0x2e')]};});_0x50cc23[_0x95c3('0x2f')]=_[_0x95c3('0x30')](_0x5a1e8d,'name');_0x50cc23[_0x95c3('0x31')]=_[_0x95c3('0x32')](_0x311f33['query']);_0x50cc23[_0x95c3('0x33')]=_['intersection'](_0x50cc23[_0x95c3('0x2f')],_0x50cc23[_0x95c3('0x31')]);_0x492211[_0x95c3('0x34')]=_[_0x95c3('0x35')](_0x50cc23[_0x95c3('0x2f')],qs['fields'](_0x311f33[_0x95c3('0x31')][_0x95c3('0x36')]));_0x492211[_0x95c3('0x34')]=_0x492211['attributes']['length']?_0x492211['attributes']:_0x50cc23[_0x95c3('0x2f')];if(!_0x311f33[_0x95c3('0x31')][_0x95c3('0x37')](_0x95c3('0x38'))){_0x492211['limit']=qs['limit'](_0x311f33['query'][_0x95c3('0x1d')]);_0x492211[_0x95c3('0x20')]=qs['offset'](_0x311f33[_0x95c3('0x31')][_0x95c3('0x20')]);}_0x492211[_0x95c3('0x39')]=qs[_0x95c3('0x3a')](_0x311f33['query']['sort']);_0x492211['where']=qs['filters'](_[_0x95c3('0x3b')](_0x311f33['query'],_0x50cc23['filters']),_0x5a1e8d);if(_0x311f33[_0x95c3('0x31')][_0x95c3('0x3c')]){_0x492211['where']=_[_0x95c3('0x3d')](_0x492211['where'],{'$or':_[_0x95c3('0x30')](_0x5a1e8d,function(_0x48c25e){if(_0x48c25e[_0x95c3('0x3e')]!==_0x95c3('0x3f')){var _0x2c8ba0={};_0x2c8ba0[_0x48c25e['name']]={'$like':'%'+_0x311f33[_0x95c3('0x31')]['filter']+'%'};return _0x2c8ba0;}})});}_0x492211=_[_0x95c3('0x3d')]({},_0x492211,_0x311f33[_0x95c3('0x40')]);var _0x13e383={'where':_0x492211[_0x95c3('0x41')]};return db[_0x95c3('0x42')]['count'](_0x13e383)[_0x95c3('0x27')](function(_0x52d733){_0xc4c959['count']=_0x52d733;if(_0x311f33[_0x95c3('0x31')]['includeAll']){_0x492211[_0x95c3('0x43')]=[{'all':!![]}];}return db[_0x95c3('0x42')]['findAll'](_0x492211);})[_0x95c3('0x27')](function(_0x12992c){_0xc4c959[_0x95c3('0x44')]=_0x12992c;return _0xc4c959;})[_0x95c3('0x27')](respondWithFilteredResult(_0x5388c7,_0x492211))['catch'](handleError(_0x5388c7,null));};exports[_0x95c3('0x45')]=function(_0x371dd2,_0xede6ce){var _0x3711c9={'raw':![],'where':{'id':_0x371dd2[_0x95c3('0x46')]['id']}},_0x233c01={};_0x233c01[_0x95c3('0x2f')]=_[_0x95c3('0x32')](db[_0x95c3('0x42')][_0x95c3('0x2c')]);_0x233c01[_0x95c3('0x31')]=_[_0x95c3('0x32')](_0x371dd2[_0x95c3('0x31')]);_0x233c01['filters']=_[_0x95c3('0x35')](_0x233c01[_0x95c3('0x2f')],_0x233c01[_0x95c3('0x31')]);_0x3711c9[_0x95c3('0x34')]=_[_0x95c3('0x35')](_0x233c01[_0x95c3('0x2f')],qs[_0x95c3('0x36')](_0x371dd2[_0x95c3('0x31')]['fields']));_0x3711c9[_0x95c3('0x34')]=_0x3711c9['attributes'][_0x95c3('0x47')]?_0x3711c9[_0x95c3('0x34')]:_0x233c01[_0x95c3('0x2f')];if(_0x371dd2[_0x95c3('0x31')]['includeAll']){_0x3711c9[_0x95c3('0x43')]=[{'all':!![]}];}_0x3711c9=_['merge']({},_0x3711c9,_0x371dd2[_0x95c3('0x40')]);return db[_0x95c3('0x42')]['find'](_0x3711c9)[_0x95c3('0x27')](handleEntityNotFound(_0xede6ce,null))[_0x95c3('0x27')](respondWithResult(_0xede6ce,null))[_0x95c3('0x48')](handleError(_0xede6ce,null));};exports[_0x95c3('0x49')]=function(_0x3c2c42,_0x5449d7){return db['ZohoConfiguration'][_0x95c3('0x49')](_0x3c2c42[_0x95c3('0x4a')],{})[_0x95c3('0x27')](respondWithResult(_0x5449d7,0xc9))[_0x95c3('0x48')](handleError(_0x5449d7,null));};exports[_0x95c3('0x26')]=function(_0x4d9fef,_0x5929f1){if(_0x4d9fef[_0x95c3('0x4a')]['id']){delete _0x4d9fef[_0x95c3('0x4a')]['id'];}return db[_0x95c3('0x42')][_0x95c3('0x4b')]({'where':{'id':_0x4d9fef['params']['id']}})[_0x95c3('0x27')](handleEntityNotFound(_0x5929f1,null))[_0x95c3('0x27')](saveUpdates(_0x4d9fef[_0x95c3('0x4a')],null))[_0x95c3('0x27')](respondWithResult(_0x5929f1,null))[_0x95c3('0x48')](handleError(_0x5929f1,null));};exports[_0x95c3('0x4c')]=function(_0x2a0570,_0x28c8df){return db[_0x95c3('0x42')][_0x95c3('0x4b')]({'where':{'id':_0x2a0570[_0x95c3('0x46')]['id']}})['then'](handleEntityNotFound(_0x28c8df,null))['then'](removeEntity(_0x28c8df,null))[_0x95c3('0x48')](handleError(_0x28c8df,null));};exports['getFields']=function(_0x5c2342,_0x2545e9,_0x2db6e3){var _0x1c80b6={};var _0x1e2e5f={};var _0x35cffe;var _0x3fbc8d;return db[_0x95c3('0x42')][_0x95c3('0x4d')]({'where':{'id':_0x5c2342[_0x95c3('0x46')]['id']}})[_0x95c3('0x27')](handleEntityNotFound(_0x2545e9,null))['then'](function(_0x517f8e){if(_0x517f8e){_0x35cffe=_0x517f8e;_0x1e2e5f[_0x95c3('0x2f')]=_[_0x95c3('0x32')](db[_0x95c3('0x4e')]['rawAttributes']);_0x1e2e5f['query']=_[_0x95c3('0x32')](_0x5c2342[_0x95c3('0x31')]);_0x1e2e5f[_0x95c3('0x33')]=_[_0x95c3('0x35')](_0x1e2e5f['model'],_0x1e2e5f[_0x95c3('0x31')]);_0x1c80b6['attributes']=_[_0x95c3('0x35')](_0x1e2e5f[_0x95c3('0x2f')],qs['fields'](_0x5c2342[_0x95c3('0x31')][_0x95c3('0x36')]));_0x1c80b6[_0x95c3('0x34')]=_0x1c80b6['attributes']['length']?_0x1c80b6[_0x95c3('0x34')]:_0x1e2e5f[_0x95c3('0x2f')];_0x1c80b6[_0x95c3('0x39')]=qs[_0x95c3('0x3a')](_0x5c2342[_0x95c3('0x31')][_0x95c3('0x3a')]);_0x1c80b6[_0x95c3('0x41')]=qs[_0x95c3('0x33')](_[_0x95c3('0x3b')](_0x5c2342[_0x95c3('0x31')],_0x1e2e5f[_0x95c3('0x33')]));if(_0x5c2342[_0x95c3('0x31')][_0x95c3('0x3c')]){_0x1c80b6[_0x95c3('0x41')]=_[_0x95c3('0x3d')](_0x1c80b6['where'],{'$or':_[_0x95c3('0x30')](_0x1c80b6[_0x95c3('0x34')],function(_0x165f56){var _0xb53646={};_0xb53646[_0x165f56]={'$like':'%'+_0x5c2342[_0x95c3('0x31')][_0x95c3('0x3c')]+'%'};return _0xb53646;})});}_0x1c80b6=_['merge']({},_0x1c80b6,_0x5c2342[_0x95c3('0x40')]);return _0x35cffe[_0x95c3('0x4f')](_0x1c80b6);}})[_0x95c3('0x27')](function(_0x8c188b){if(_0x8c188b){_0x3fbc8d=_0x8c188b[_0x95c3('0x47')];if(!_0x5c2342[_0x95c3('0x31')]['hasOwnProperty'](_0x95c3('0x38'))){_0x1c80b6[_0x95c3('0x1d')]=qs[_0x95c3('0x1d')](_0x5c2342[_0x95c3('0x31')][_0x95c3('0x1d')]);_0x1c80b6['offset']=qs[_0x95c3('0x20')](_0x5c2342[_0x95c3('0x31')]['offset']);}return _0x35cffe['getFields'](_0x1c80b6);}})[_0x95c3('0x27')](function(_0x2fa298){if(_0x2fa298){return _0x2fa298?{'count':_0x3fbc8d,'rows':_0x2fa298}:null;}})[_0x95c3('0x27')](respondWithResult(_0x2545e9,null))[_0x95c3('0x48')](handleError(_0x2545e9,null));};exports[_0x95c3('0x50')]=function(_0x5d6eac,_0x12593a,_0x131f25){var _0x3b0f06={};var _0x158795={};var _0x43188d;var _0x399c1a;return db[_0x95c3('0x42')][_0x95c3('0x4d')]({'where':{'id':_0x5d6eac[_0x95c3('0x46')]['id']}})['then'](handleEntityNotFound(_0x12593a,null))['then'](function(_0x298e35){if(_0x298e35){_0x43188d=_0x298e35;_0x158795[_0x95c3('0x2f')]=_['keys'](db[_0x95c3('0x4e')][_0x95c3('0x2c')]);_0x158795[_0x95c3('0x31')]=_[_0x95c3('0x32')](_0x5d6eac[_0x95c3('0x31')]);_0x158795[_0x95c3('0x33')]=_[_0x95c3('0x35')](_0x158795[_0x95c3('0x2f')],_0x158795[_0x95c3('0x31')]);_0x3b0f06['attributes']=_[_0x95c3('0x35')](_0x158795[_0x95c3('0x2f')],qs[_0x95c3('0x36')](_0x5d6eac['query'][_0x95c3('0x36')]));_0x3b0f06[_0x95c3('0x34')]=_0x3b0f06[_0x95c3('0x34')][_0x95c3('0x47')]?_0x3b0f06[_0x95c3('0x34')]:_0x158795[_0x95c3('0x2f')];_0x3b0f06[_0x95c3('0x39')]=qs[_0x95c3('0x3a')](_0x5d6eac['query'][_0x95c3('0x3a')]);_0x3b0f06['where']=qs[_0x95c3('0x33')](_['pick'](_0x5d6eac['query'],_0x158795[_0x95c3('0x33')]));if(_0x5d6eac[_0x95c3('0x31')][_0x95c3('0x3c')]){_0x3b0f06[_0x95c3('0x41')]=_[_0x95c3('0x3d')](_0x3b0f06[_0x95c3('0x41')],{'$or':_['map'](_0x3b0f06[_0x95c3('0x34')],function(_0x57ce32){var _0x2c360b={};_0x2c360b[_0x57ce32]={'$like':'%'+_0x5d6eac[_0x95c3('0x31')][_0x95c3('0x3c')]+'%'};return _0x2c360b;})});}_0x3b0f06=_[_0x95c3('0x3d')]({},_0x3b0f06,_0x5d6eac[_0x95c3('0x40')]);return _0x43188d[_0x95c3('0x50')](_0x3b0f06);}})['then'](function(_0x5a0fca){if(_0x5a0fca){_0x399c1a=_0x5a0fca[_0x95c3('0x47')];if(!_0x5d6eac['query'][_0x95c3('0x37')](_0x95c3('0x38'))){_0x3b0f06[_0x95c3('0x1d')]=qs[_0x95c3('0x1d')](_0x5d6eac[_0x95c3('0x31')][_0x95c3('0x1d')]);_0x3b0f06['offset']=qs[_0x95c3('0x20')](_0x5d6eac['query']['offset']);}return _0x43188d[_0x95c3('0x50')](_0x3b0f06);}})[_0x95c3('0x27')](function(_0x1ac3f1){if(_0x1ac3f1){return _0x1ac3f1?{'count':_0x399c1a,'rows':_0x1ac3f1}:null;}})[_0x95c3('0x27')](respondWithResult(_0x12593a,null))['catch'](handleError(_0x12593a,null));};exports[_0x95c3('0x51')]=function(_0x3a20d0,_0x16aee9,_0x3e50f8){var _0x47e57d={};var _0xaba053={};var _0x593233;var _0x5b4789;return db[_0x95c3('0x42')][_0x95c3('0x4d')]({'where':{'id':_0x3a20d0['params']['id']}})['then'](handleEntityNotFound(_0x16aee9,null))[_0x95c3('0x27')](function(_0x6b6cd0){if(_0x6b6cd0){_0x593233=_0x6b6cd0;_0xaba053[_0x95c3('0x2f')]=_[_0x95c3('0x32')](db[_0x95c3('0x4e')]['rawAttributes']);_0xaba053[_0x95c3('0x31')]=_['keys'](_0x3a20d0[_0x95c3('0x31')]);_0xaba053[_0x95c3('0x33')]=_['intersection'](_0xaba053[_0x95c3('0x2f')],_0xaba053[_0x95c3('0x31')]);_0x47e57d[_0x95c3('0x34')]=_['intersection'](_0xaba053[_0x95c3('0x2f')],qs[_0x95c3('0x36')](_0x3a20d0['query'][_0x95c3('0x36')]));_0x47e57d[_0x95c3('0x34')]=_0x47e57d['attributes'][_0x95c3('0x47')]?_0x47e57d[_0x95c3('0x34')]:_0xaba053[_0x95c3('0x2f')];_0x47e57d[_0x95c3('0x39')]=qs[_0x95c3('0x3a')](_0x3a20d0['query'][_0x95c3('0x3a')]);_0x47e57d[_0x95c3('0x41')]=qs['filters'](_[_0x95c3('0x3b')](_0x3a20d0[_0x95c3('0x31')],_0xaba053['filters']));if(_0x3a20d0[_0x95c3('0x31')]['filter']){_0x47e57d['where']=_['merge'](_0x47e57d[_0x95c3('0x41')],{'$or':_['map'](_0x47e57d[_0x95c3('0x34')],function(_0x3018ab){var _0x23a4b7={};_0x23a4b7[_0x3018ab]={'$like':'%'+_0x3a20d0[_0x95c3('0x31')][_0x95c3('0x3c')]+'%'};return _0x23a4b7;})});}_0x47e57d=_[_0x95c3('0x3d')]({},_0x47e57d,_0x3a20d0['options']);return _0x593233[_0x95c3('0x51')](_0x47e57d);}})[_0x95c3('0x27')](function(_0x214200){if(_0x214200){_0x5b4789=_0x214200[_0x95c3('0x47')];if(!_0x3a20d0['query']['hasOwnProperty'](_0x95c3('0x38'))){_0x47e57d[_0x95c3('0x1d')]=qs[_0x95c3('0x1d')](_0x3a20d0[_0x95c3('0x31')][_0x95c3('0x1d')]);_0x47e57d['offset']=qs[_0x95c3('0x20')](_0x3a20d0[_0x95c3('0x31')][_0x95c3('0x20')]);}return _0x593233[_0x95c3('0x51')](_0x47e57d);}})[_0x95c3('0x27')](function(_0x3e7158){if(_0x3e7158){return _0x3e7158?{'count':_0x5b4789,'rows':_0x3e7158}:null;}})[_0x95c3('0x27')](respondWithResult(_0x16aee9,null))[_0x95c3('0x48')](handleError(_0x16aee9,null));};
\ No newline at end of file
index 817e7aa..3d51d25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8b5=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash'];(function(_0x4a9943,_0x182ae8){var _0x23ee08=function(_0x2d030a){while(--_0x2d030a){_0x4a9943['push'](_0x4a9943['shift']());}};_0x23ee08(++_0x182ae8);}(_0xf8b5,0x17f));var _0x5f8b=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xf8b5[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require(_0x5f8b('0x0'));var util=require(_0x5f8b('0x1'));var logger=require(_0x5f8b('0x2'))(_0x5f8b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5f8b('0x4'));var fs=require('fs');var path=require(_0x5f8b('0x5'));var rimraf=require(_0x5f8b('0x6'));var config=require(_0x5f8b('0x7'));var attributes=require(_0x5f8b('0x8'));module[_0x5f8b('0x9')]=function(_0x24472f,_0x3ddded){return _0x24472f[_0x5f8b('0xa')](_0x5f8b('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x35e1=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2c6464,_0x51817d){var _0x58e452=function(_0x39b8f3){while(--_0x39b8f3){_0x2c6464['push'](_0x2c6464['shift']());}};_0x58e452(++_0x51817d);}(_0x35e1,0x18e));var _0x135e=function(_0x52282a,_0x45aef7){_0x52282a=_0x52282a-0x0;var _0x3c66b4=_0x35e1[_0x52282a];return _0x3c66b4;};'use strict';var _=require(_0x135e('0x0'));var util=require('util');var logger=require(_0x135e('0x1'))(_0x135e('0x2'));var moment=require(_0x135e('0x3'));var BPromise=require(_0x135e('0x4'));var rp=require(_0x135e('0x5'));var fs=require('fs');var path=require(_0x135e('0x6'));var rimraf=require(_0x135e('0x7'));var config=require(_0x135e('0x8'));var attributes=require(_0x135e('0x9'));module[_0x135e('0xa')]=function(_0x3d05b2,_0x4fd49e){return _0x3d05b2[_0x135e('0xb')](_0x135e('0xc'),attributes,{'tableName':_0x135e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5d3159d..67b2272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaca5=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0xaca5,0x1d6));var _0x5aca=function(_0xb508f4,_0x1296b7){_0xb508f4=_0xb508f4-0x0;var _0x3ed9bd=_0xaca5[_0xb508f4];return _0x3ed9bd;};'use strict';var _=require('lodash');var util=require(_0x5aca('0x0'));var moment=require(_0x5aca('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5aca('0x2'));var db=require(_0x5aca('0x3'))['db'];var utils=require(_0x5aca('0x4'));var logger=require(_0x5aca('0x5'))(_0x5aca('0x6'));var config=require(_0x5aca('0x7'));var jayson=require(_0x5aca('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e9364,_0x188ab4,_0x29a8a6){return new BPromise(function(_0x456233,_0x3fc663){return client[_0x5aca('0x9')](_0x3e9364,_0x29a8a6)[_0x5aca('0xa')](function(_0x2e8ed8){logger[_0x5aca('0xb')](_0x5aca('0xc'),_0x188ab4,'request\x20sent');logger['debug'](_0x5aca('0xd'),_0x188ab4,_0x5aca('0xe'),JSON[_0x5aca('0xf')](_0x2e8ed8));if(_0x2e8ed8[_0x5aca('0x10')]){if(_0x2e8ed8[_0x5aca('0x10')][_0x5aca('0x11')]===0x1f4){logger[_0x5aca('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x188ab4,_0x2e8ed8[_0x5aca('0x10')][_0x5aca('0x12')]);return _0x3fc663(_0x2e8ed8[_0x5aca('0x10')][_0x5aca('0x12')]);}logger[_0x5aca('0x10')](_0x5aca('0xc'),_0x188ab4,_0x2e8ed8[_0x5aca('0x10')]['message']);return _0x456233(_0x2e8ed8[_0x5aca('0x10')][_0x5aca('0x12')]);}else{logger[_0x5aca('0xb')](_0x5aca('0xc'),_0x188ab4,_0x5aca('0xe'));_0x456233(_0x2e8ed8[_0x5aca('0x13')]['message']);}})[_0x5aca('0x14')](function(_0x1816b9){logger['error'](_0x5aca('0xc'),_0x188ab4,_0x1816b9);_0x3fc663(_0x1816b9);});});}
\ No newline at end of file
+var _0xd695=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0xd695,0x1bc));var _0x5d69=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0xd695[_0xe7281f];return _0x90dc99;};'use strict';var _=require(_0x5d69('0x0'));var util=require(_0x5d69('0x1'));var moment=require(_0x5d69('0x2'));var BPromise=require(_0x5d69('0x3'));var rs=require(_0x5d69('0x4'));var fs=require('fs');var Redis=require(_0x5d69('0x5'));var db=require(_0x5d69('0x6'))['db'];var utils=require(_0x5d69('0x7'));var logger=require('../../config/logger')(_0x5d69('0x8'));var config=require(_0x5d69('0x9'));var jayson=require(_0x5d69('0xa'));var client=jayson[_0x5d69('0xb')][_0x5d69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x314b04,_0xc9041a,_0x2c3d49){return new BPromise(function(_0x14a263,_0x2d59a3){return client['request'](_0x314b04,_0x2c3d49)[_0x5d69('0xd')](function(_0x59ef4a){logger[_0x5d69('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0xc9041a,_0x5d69('0xf'));logger[_0x5d69('0x10')](_0x5d69('0x11'),_0xc9041a,'request\x20sent',JSON[_0x5d69('0x12')](_0x59ef4a));if(_0x59ef4a[_0x5d69('0x13')]){if(_0x59ef4a['error'][_0x5d69('0x14')]===0x1f4){logger[_0x5d69('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0xc9041a,_0x59ef4a[_0x5d69('0x13')][_0x5d69('0x15')]);return _0x2d59a3(_0x59ef4a['error'][_0x5d69('0x15')]);}logger[_0x5d69('0x13')](_0x5d69('0x16'),_0xc9041a,_0x59ef4a[_0x5d69('0x13')]['message']);return _0x14a263(_0x59ef4a[_0x5d69('0x13')][_0x5d69('0x15')]);}else{logger[_0x5d69('0xe')](_0x5d69('0x16'),_0xc9041a,_0x5d69('0xf'));_0x14a263(_0x59ef4a[_0x5d69('0x17')][_0x5d69('0x15')]);}})[_0x5d69('0x18')](function(_0x3044d5){logger['error'](_0x5d69('0x16'),_0xc9041a,_0x3044d5);_0x2d59a3(_0x3044d5);});});}
\ No newline at end of file
index 1c1c3d9..0e155f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ccf=['../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x7efe31,_0x1b42d3){var _0x59ea5a=function(_0x299f73){while(--_0x299f73){_0x7efe31['push'](_0x7efe31['shift']());}};_0x59ea5a(++_0x1b42d3);}(_0x4ccf,0x170));var _0xf4cc=function(_0x49bc95,_0x1153ac){_0x49bc95=_0x49bc95-0x0;var _0x463fdd=_0x4ccf[_0x49bc95];return _0x463fdd;};'use strict';var multer=require('multer');var util=require(_0xf4cc('0x0'));var path=require(_0xf4cc('0x1'));var timeout=require(_0xf4cc('0x2'));var express=require(_0xf4cc('0x3'));var router=express['Router']();var fs_extra=require(_0xf4cc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf4cc('0x5'));var config=require(_0xf4cc('0x6'));var controller=require(_0xf4cc('0x7'));router[_0xf4cc('0x8')]('/',auth[_0xf4cc('0x9')](),controller[_0xf4cc('0xa')]);router[_0xf4cc('0x8')](_0xf4cc('0xb'),auth['isAuthenticated'](),controller[_0xf4cc('0xc')]);router[_0xf4cc('0xd')]('/',auth[_0xf4cc('0x9')](),controller[_0xf4cc('0xe')]);router['put'](_0xf4cc('0xb'),auth[_0xf4cc('0x9')](),controller['update']);router[_0xf4cc('0xf')](_0xf4cc('0xb'),auth[_0xf4cc('0x9')](),controller[_0xf4cc('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x45e1=['isAuthenticated','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x766909,_0x510154){var _0x16bc3f=function(_0x5259c5){while(--_0x5259c5){_0x766909['push'](_0x766909['shift']());}};_0x16bc3f(++_0x510154);}(_0x45e1,0xaa));var _0x145e=function(_0x39f023,_0x40eb0b){_0x39f023=_0x39f023-0x0;var _0x56e418=_0x45e1[_0x39f023];return _0x56e418;};'use strict';var multer=require(_0x145e('0x0'));var util=require(_0x145e('0x1'));var path=require(_0x145e('0x2'));var timeout=require(_0x145e('0x3'));var express=require('express');var router=express[_0x145e('0x4')]();var fs_extra=require(_0x145e('0x5'));var auth=require(_0x145e('0x6'));var interaction=require(_0x145e('0x7'));var config=require(_0x145e('0x8'));var controller=require(_0x145e('0x9'));router['get']('/',auth[_0x145e('0xa')](),controller['index']);router[_0x145e('0xb')](_0x145e('0xc'),auth['isAuthenticated'](),controller[_0x145e('0xd')]);router[_0x145e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x145e('0xf')](_0x145e('0xc'),auth['isAuthenticated'](),controller[_0x145e('0x10')]);router[_0x145e('0x11')](_0x145e('0xc'),auth[_0x145e('0xa')](),controller[_0x145e('0x12')]);module[_0x145e('0x13')]=router;
\ No newline at end of file
index 33632ba..2f6b1f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c89=['exports','string','variable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c89,0x6f));var _0x93c8=function(_0x3090e1,_0x274049){_0x3090e1=_0x3090e1-0x0;var _0x30b938=_0x3c89[_0x3090e1];return _0x30b938;};'use strict';var Sequelize=require(_0x93c8('0x0'));module[_0x93c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x93c8('0x2'),_0x93c8('0x3'),'customVariable',_0x93c8('0x4'),_0x93c8('0x5')),'defaultValue':_0x93c8('0x2')},'content':{'type':Sequelize[_0x93c8('0x6')]},'key':{'type':Sequelize[_0x93c8('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x93c8('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x93c8('0x6')]},'idField':{'type':Sequelize[_0x93c8('0x6')]},'nameField':{'type':Sequelize[_0x93c8('0x6')]},'customField':{'type':Sequelize[_0x93c8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x93c8('0x6')]}};
\ No newline at end of file
+var _0x699e=['string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x699e,0x72));var _0xe699=function(_0x1c3539,_0x589831){_0x1c3539=_0x1c3539-0x0;var _0x3f79e1=_0x699e[_0x1c3539];return _0x3f79e1;};'use strict';var Sequelize=require(_0xe699('0x0'));module[_0xe699('0x1')]={'type':{'type':Sequelize[_0xe699('0x2')](_0xe699('0x3'),_0xe699('0x4'),'customVariable','keyValue',_0xe699('0x5')),'defaultValue':_0xe699('0x3')},'content':{'type':Sequelize[_0xe699('0x6')]},'key':{'type':Sequelize[_0xe699('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe699('0x3'),_0xe699('0x4'),_0xe699('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe699('0x6')]},'nameField':{'type':Sequelize[_0xe699('0x6')]},'customField':{'type':Sequelize[_0xe699('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe699('0x6')]}};
\ No newline at end of file
index 151f96b..851df6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ce6=['sox','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','ZohoField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x3174b0,_0xa3de67){var _0x94b48c=function(_0x3df7d5){while(--_0x3df7d5){_0x3174b0['push'](_0x3174b0['shift']());}};_0x94b48c(++_0xa3de67);}(_0x8ce6,0xcf));var _0x68ce=function(_0x3280d5,_0x37e000){_0x3280d5=_0x3280d5-0x0;var _0x2d19e1=_0x8ce6[_0x3280d5];return _0x2d19e1;};'use strict';var emlformat=require(_0x68ce('0x0'));var rimraf=require(_0x68ce('0x1'));var zipdir=require(_0x68ce('0x2'));var jsonpatch=require(_0x68ce('0x3'));var rp=require(_0x68ce('0x4'));var moment=require(_0x68ce('0x5'));var BPromise=require(_0x68ce('0x6'));var Mustache=require('mustache');var util=require(_0x68ce('0x7'));var path=require(_0x68ce('0x8'));var sox=require(_0x68ce('0x9'));var csv=require('to-csv');var ejs=require(_0x68ce('0xa'));var fs=require('fs');var fs_extra=require(_0x68ce('0xb'));var _=require(_0x68ce('0xc'));var squel=require(_0x68ce('0xd'));var crypto=require(_0x68ce('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x68ce('0xf'));var Redis=require(_0x68ce('0x10'));var authService=require(_0x68ce('0x11'));var qs=require(_0x68ce('0x12'));var as=require(_0x68ce('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x68ce('0x14'))('api');var utils=require(_0x68ce('0x15'));var config=require(_0x68ce('0x16'));var licenseUtil=require(_0x68ce('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a66aa,_0x5a6193){_0x5a6193=_0x5a6193||0xcc;return function(_0x586735){if(_0x586735){return _0x1a66aa[_0x68ce('0x18')](_0x5a6193);}return _0x1a66aa[_0x68ce('0x19')](_0x5a6193)['end']();};}function respondWithResult(_0x36ba93,_0x4315a6){_0x4315a6=_0x4315a6||0xc8;return function(_0x25d882){if(_0x25d882){return _0x36ba93[_0x68ce('0x19')](_0x4315a6)[_0x68ce('0x1a')](_0x25d882);}};}function respondWithFilteredResult(_0x305d60,_0x54ffd4){return function(_0x84f5d5){if(_0x84f5d5){var _0x2f1cd8=typeof _0x54ffd4[_0x68ce('0x1b')]==='undefined'&&typeof _0x54ffd4[_0x68ce('0x1c')]===_0x68ce('0x1d');var _0xcccf9=_0x84f5d5[_0x68ce('0x1e')];var _0x542a81=_0x2f1cd8?0x0:_0x54ffd4[_0x68ce('0x1b')];var _0x21f4b8=_0x2f1cd8?_0x84f5d5[_0x68ce('0x1e')]:_0x54ffd4[_0x68ce('0x1b')]+_0x54ffd4[_0x68ce('0x1c')];var _0x5ccbb8;if(_0x21f4b8>=_0xcccf9){_0x21f4b8=_0xcccf9;_0x5ccbb8=0xc8;}else{_0x5ccbb8=0xce;}_0x305d60[_0x68ce('0x19')](_0x5ccbb8);return _0x305d60[_0x68ce('0x1f')](_0x68ce('0x20'),_0x542a81+'-'+_0x21f4b8+'/'+_0xcccf9)[_0x68ce('0x1a')](_0x84f5d5);}return null;};}function patchUpdates(_0x2b3e8c){return function(_0x51c6a7){try{jsonpatch['apply'](_0x51c6a7,_0x2b3e8c,!![]);}catch(_0x26d4fe){return BPromise[_0x68ce('0x21')](_0x26d4fe);}return _0x51c6a7[_0x68ce('0x22')]();};}function saveUpdates(_0x56b70b,_0x3f53d4){return function(_0x3fb683){if(_0x3fb683){return _0x3fb683[_0x68ce('0x23')](_0x56b70b)['then'](function(_0x45187b){return _0x45187b;});}return null;};}function removeEntity(_0x14216f,_0x477cb3){return function(_0x4378d6){if(_0x4378d6){return _0x4378d6[_0x68ce('0x24')]()[_0x68ce('0x25')](function(){_0x14216f[_0x68ce('0x19')](0xcc)[_0x68ce('0x26')]();});}};}function handleEntityNotFound(_0x589d96,_0xaa215){return function(_0x33c4df){if(!_0x33c4df){_0x589d96[_0x68ce('0x18')](0x194);}return _0x33c4df;};}function handleError(_0x280516,_0x1d777c){_0x1d777c=_0x1d777c||0x1f4;return function(_0x2a8a3c){logger[_0x68ce('0x27')](_0x2a8a3c[_0x68ce('0x28')]);if(_0x2a8a3c['name']){delete _0x2a8a3c[_0x68ce('0x29')];}_0x280516[_0x68ce('0x19')](_0x1d777c)[_0x68ce('0x2a')](_0x2a8a3c);};}exports['index']=function(_0x714a8d,_0x4b841b){var _0x1746e6={},_0x15ec49={},_0x566a09={'count':0x0,'rows':[]};var _0x37a29f=_['map'](db[_0x68ce('0x2b')][_0x68ce('0x2c')],function(_0x43ea6f){return{'name':_0x43ea6f[_0x68ce('0x2d')],'type':_0x43ea6f[_0x68ce('0x2e')]['key']};});_0x15ec49[_0x68ce('0x2f')]=_[_0x68ce('0x30')](_0x37a29f,_0x68ce('0x29'));_0x15ec49[_0x68ce('0x31')]=_[_0x68ce('0x32')](_0x714a8d[_0x68ce('0x31')]);_0x15ec49[_0x68ce('0x33')]=_[_0x68ce('0x34')](_0x15ec49['model'],_0x15ec49['query']);_0x1746e6[_0x68ce('0x35')]=_[_0x68ce('0x34')](_0x15ec49[_0x68ce('0x2f')],qs[_0x68ce('0x36')](_0x714a8d['query'][_0x68ce('0x36')]));_0x1746e6[_0x68ce('0x35')]=_0x1746e6[_0x68ce('0x35')]['length']?_0x1746e6[_0x68ce('0x35')]:_0x15ec49[_0x68ce('0x2f')];if(!_0x714a8d[_0x68ce('0x31')][_0x68ce('0x37')]('nolimit')){_0x1746e6[_0x68ce('0x1c')]=qs[_0x68ce('0x1c')](_0x714a8d[_0x68ce('0x31')][_0x68ce('0x1c')]);_0x1746e6[_0x68ce('0x1b')]=qs[_0x68ce('0x1b')](_0x714a8d['query'][_0x68ce('0x1b')]);}_0x1746e6['order']=qs['sort'](_0x714a8d[_0x68ce('0x31')][_0x68ce('0x38')]);_0x1746e6[_0x68ce('0x39')]=qs[_0x68ce('0x33')](_[_0x68ce('0x3a')](_0x714a8d[_0x68ce('0x31')],_0x15ec49[_0x68ce('0x33')]),_0x37a29f);if(_0x714a8d['query'][_0x68ce('0x3b')]){_0x1746e6[_0x68ce('0x39')]=_[_0x68ce('0x3c')](_0x1746e6['where'],{'$or':_[_0x68ce('0x30')](_0x37a29f,function(_0x3947bf){if(_0x3947bf['type']!==_0x68ce('0x3d')){var _0x5bbb44={};_0x5bbb44[_0x3947bf[_0x68ce('0x29')]]={'$like':'%'+_0x714a8d[_0x68ce('0x31')][_0x68ce('0x3b')]+'%'};return _0x5bbb44;}})});}_0x1746e6=_[_0x68ce('0x3c')]({},_0x1746e6,_0x714a8d[_0x68ce('0x3e')]);var _0x3bc565={'where':_0x1746e6[_0x68ce('0x39')]};return db[_0x68ce('0x2b')][_0x68ce('0x1e')](_0x3bc565)[_0x68ce('0x25')](function(_0x4579f0){_0x566a09[_0x68ce('0x1e')]=_0x4579f0;if(_0x714a8d[_0x68ce('0x31')]['includeAll']){_0x1746e6['include']=[{'all':!![]}];}return db[_0x68ce('0x2b')]['findAll'](_0x1746e6);})['then'](function(_0x501b7d){_0x566a09[_0x68ce('0x3f')]=_0x501b7d;return _0x566a09;})[_0x68ce('0x25')](respondWithFilteredResult(_0x4b841b,_0x1746e6))[_0x68ce('0x40')](handleError(_0x4b841b,null));};exports[_0x68ce('0x41')]=function(_0x182cf2,_0x3a09cf){var _0x5ebae3={'raw':!![],'where':{'id':_0x182cf2[_0x68ce('0x42')]['id']}},_0x48be66={};_0x48be66['model']=_['keys'](db['ZohoField'][_0x68ce('0x2c')]);_0x48be66['query']=_[_0x68ce('0x32')](_0x182cf2['query']);_0x48be66['filters']=_[_0x68ce('0x34')](_0x48be66[_0x68ce('0x2f')],_0x48be66[_0x68ce('0x31')]);_0x5ebae3[_0x68ce('0x35')]=_['intersection'](_0x48be66[_0x68ce('0x2f')],qs[_0x68ce('0x36')](_0x182cf2[_0x68ce('0x31')][_0x68ce('0x36')]));_0x5ebae3['attributes']=_0x5ebae3['attributes'][_0x68ce('0x43')]?_0x5ebae3[_0x68ce('0x35')]:_0x48be66[_0x68ce('0x2f')];if(_0x182cf2[_0x68ce('0x31')]['includeAll']){_0x5ebae3[_0x68ce('0x44')]=[{'all':!![]}];}_0x5ebae3=_[_0x68ce('0x3c')]({},_0x5ebae3,_0x182cf2[_0x68ce('0x3e')]);return db['ZohoField'][_0x68ce('0x45')](_0x5ebae3)['then'](handleEntityNotFound(_0x3a09cf,null))[_0x68ce('0x25')](respondWithResult(_0x3a09cf,null))[_0x68ce('0x40')](handleError(_0x3a09cf,null));};exports['create']=function(_0x4e5e8d,_0x5aea6f){return db[_0x68ce('0x2b')][_0x68ce('0x46')](_0x4e5e8d[_0x68ce('0x47')],{})[_0x68ce('0x25')](respondWithResult(_0x5aea6f,0xc9))[_0x68ce('0x40')](handleError(_0x5aea6f,null));};exports[_0x68ce('0x23')]=function(_0x4796e6,_0x51eb68){if(_0x4796e6[_0x68ce('0x47')]['id']){delete _0x4796e6['body']['id'];}return db['ZohoField'][_0x68ce('0x45')]({'where':{'id':_0x4796e6[_0x68ce('0x42')]['id']}})[_0x68ce('0x25')](handleEntityNotFound(_0x51eb68,null))['then'](saveUpdates(_0x4796e6[_0x68ce('0x47')],null))[_0x68ce('0x25')](respondWithResult(_0x51eb68,null))[_0x68ce('0x40')](handleError(_0x51eb68,null));};exports['destroy']=function(_0x455e4c,_0x59a4e3){return db[_0x68ce('0x2b')]['find']({'where':{'id':_0x455e4c['params']['id']}})[_0x68ce('0x25')](handleEntityNotFound(_0x59a4e3,null))[_0x68ce('0x25')](removeEntity(_0x59a4e3,null))[_0x68ce('0x40')](handleError(_0x59a4e3,null));};
\ No newline at end of file
+var _0x9dbe=['findAll','rows','catch','params','keys','length','includeAll','find','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','include'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0x9dbe,0x150));var _0xe9db=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0x9dbe[_0x414297];return _0x51ea47;};'use strict';var emlformat=require(_0xe9db('0x0'));var rimraf=require(_0xe9db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9db('0x2'));var rp=require(_0xe9db('0x3'));var moment=require('moment');var BPromise=require(_0xe9db('0x4'));var Mustache=require('mustache');var util=require(_0xe9db('0x5'));var path=require(_0xe9db('0x6'));var sox=require(_0xe9db('0x7'));var csv=require(_0xe9db('0x8'));var ejs=require(_0xe9db('0x9'));var fs=require('fs');var fs_extra=require(_0xe9db('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe9db('0xb'));var deskjs=require(_0xe9db('0xc'));var toCsv=require(_0xe9db('0x8'));var querystring=require(_0xe9db('0xd'));var Papa=require('papaparse');var Redis=require(_0xe9db('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe9db('0xf'));var as=require(_0xe9db('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe9db('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a3026,_0x4a04df){_0x4a04df=_0x4a04df||0xcc;return function(_0x8958bd){if(_0x8958bd){return _0x5a3026['sendStatus'](_0x4a04df);}return _0x5a3026[_0xe9db('0x12')](_0x4a04df)[_0xe9db('0x13')]();};}function respondWithResult(_0x21904,_0x4a8292){_0x4a8292=_0x4a8292||0xc8;return function(_0x2f010c){if(_0x2f010c){return _0x21904[_0xe9db('0x12')](_0x4a8292)[_0xe9db('0x14')](_0x2f010c);}};}function respondWithFilteredResult(_0x21151c,_0x3a5001){return function(_0x3780f2){if(_0x3780f2){var _0x338d0e=typeof _0x3a5001[_0xe9db('0x15')]===_0xe9db('0x16')&&typeof _0x3a5001[_0xe9db('0x17')]===_0xe9db('0x16');var _0x4f8f38=_0x3780f2[_0xe9db('0x18')];var _0xb9464e=_0x338d0e?0x0:_0x3a5001['offset'];var _0x3f29f1=_0x338d0e?_0x3780f2[_0xe9db('0x18')]:_0x3a5001[_0xe9db('0x15')]+_0x3a5001[_0xe9db('0x17')];var _0x1e1f25;if(_0x3f29f1>=_0x4f8f38){_0x3f29f1=_0x4f8f38;_0x1e1f25=0xc8;}else{_0x1e1f25=0xce;}_0x21151c[_0xe9db('0x12')](_0x1e1f25);return _0x21151c[_0xe9db('0x19')]('Content-Range',_0xb9464e+'-'+_0x3f29f1+'/'+_0x4f8f38)[_0xe9db('0x14')](_0x3780f2);}return null;};}function patchUpdates(_0x356383){return function(_0x16ab50){try{jsonpatch[_0xe9db('0x1a')](_0x16ab50,_0x356383,!![]);}catch(_0x5aed99){return BPromise['reject'](_0x5aed99);}return _0x16ab50[_0xe9db('0x1b')]();};}function saveUpdates(_0x34db02,_0x55b779){return function(_0xa21dc){if(_0xa21dc){return _0xa21dc['update'](_0x34db02)[_0xe9db('0x1c')](function(_0x18ec77){return _0x18ec77;});}return null;};}function removeEntity(_0x6d81e1,_0x39a29){return function(_0x4e2e0e){if(_0x4e2e0e){return _0x4e2e0e[_0xe9db('0x1d')]()[_0xe9db('0x1c')](function(){_0x6d81e1[_0xe9db('0x12')](0xcc)[_0xe9db('0x13')]();});}};}function handleEntityNotFound(_0x2d8f9b,_0x1ff188){return function(_0x5b5e10){if(!_0x5b5e10){_0x2d8f9b[_0xe9db('0x1e')](0x194);}return _0x5b5e10;};}function handleError(_0xb0327f,_0xae204){_0xae204=_0xae204||0x1f4;return function(_0x562785){logger['error'](_0x562785[_0xe9db('0x1f')]);if(_0x562785[_0xe9db('0x20')]){delete _0x562785[_0xe9db('0x20')];}_0xb0327f[_0xe9db('0x12')](_0xae204)[_0xe9db('0x21')](_0x562785);};}exports['index']=function(_0x304501,_0x598057){var _0x6babea={},_0x3f627d={},_0x3ff59f={'count':0x0,'rows':[]};var _0x226e10=_['map'](db['ZohoField'][_0xe9db('0x22')],function(_0x1d2544){return{'name':_0x1d2544[_0xe9db('0x23')],'type':_0x1d2544['type']['key']};});_0x3f627d[_0xe9db('0x24')]=_[_0xe9db('0x25')](_0x226e10,'name');_0x3f627d[_0xe9db('0x26')]=_['keys'](_0x304501[_0xe9db('0x26')]);_0x3f627d[_0xe9db('0x27')]=_[_0xe9db('0x28')](_0x3f627d[_0xe9db('0x24')],_0x3f627d[_0xe9db('0x26')]);_0x6babea[_0xe9db('0x29')]=_[_0xe9db('0x28')](_0x3f627d[_0xe9db('0x24')],qs[_0xe9db('0x2a')](_0x304501[_0xe9db('0x26')][_0xe9db('0x2a')]));_0x6babea[_0xe9db('0x29')]=_0x6babea[_0xe9db('0x29')]['length']?_0x6babea['attributes']:_0x3f627d[_0xe9db('0x24')];if(!_0x304501[_0xe9db('0x26')][_0xe9db('0x2b')]('nolimit')){_0x6babea[_0xe9db('0x17')]=qs['limit'](_0x304501[_0xe9db('0x26')][_0xe9db('0x17')]);_0x6babea['offset']=qs['offset'](_0x304501['query'][_0xe9db('0x15')]);}_0x6babea[_0xe9db('0x2c')]=qs[_0xe9db('0x2d')](_0x304501['query']['sort']);_0x6babea[_0xe9db('0x2e')]=qs[_0xe9db('0x27')](_[_0xe9db('0x2f')](_0x304501[_0xe9db('0x26')],_0x3f627d[_0xe9db('0x27')]),_0x226e10);if(_0x304501[_0xe9db('0x26')][_0xe9db('0x30')]){_0x6babea['where']=_[_0xe9db('0x31')](_0x6babea[_0xe9db('0x2e')],{'$or':_['map'](_0x226e10,function(_0x4e38a6){if(_0x4e38a6['type']!==_0xe9db('0x32')){var _0x3c554a={};_0x3c554a[_0x4e38a6['name']]={'$like':'%'+_0x304501[_0xe9db('0x26')][_0xe9db('0x30')]+'%'};return _0x3c554a;}})});}_0x6babea=_[_0xe9db('0x31')]({},_0x6babea,_0x304501[_0xe9db('0x33')]);var _0x475870={'where':_0x6babea['where']};return db[_0xe9db('0x34')]['count'](_0x475870)[_0xe9db('0x1c')](function(_0x16d9f0){_0x3ff59f[_0xe9db('0x18')]=_0x16d9f0;if(_0x304501['query']['includeAll']){_0x6babea[_0xe9db('0x35')]=[{'all':!![]}];}return db[_0xe9db('0x34')][_0xe9db('0x36')](_0x6babea);})['then'](function(_0x5ffe9a){_0x3ff59f[_0xe9db('0x37')]=_0x5ffe9a;return _0x3ff59f;})[_0xe9db('0x1c')](respondWithFilteredResult(_0x598057,_0x6babea))[_0xe9db('0x38')](handleError(_0x598057,null));};exports['show']=function(_0x1369e3,_0x3a47b1){var _0x51232c={'raw':!![],'where':{'id':_0x1369e3[_0xe9db('0x39')]['id']}},_0x4b16cf={};_0x4b16cf['model']=_[_0xe9db('0x3a')](db[_0xe9db('0x34')][_0xe9db('0x22')]);_0x4b16cf['query']=_[_0xe9db('0x3a')](_0x1369e3[_0xe9db('0x26')]);_0x4b16cf[_0xe9db('0x27')]=_[_0xe9db('0x28')](_0x4b16cf['model'],_0x4b16cf[_0xe9db('0x26')]);_0x51232c['attributes']=_[_0xe9db('0x28')](_0x4b16cf['model'],qs['fields'](_0x1369e3[_0xe9db('0x26')][_0xe9db('0x2a')]));_0x51232c[_0xe9db('0x29')]=_0x51232c[_0xe9db('0x29')][_0xe9db('0x3b')]?_0x51232c[_0xe9db('0x29')]:_0x4b16cf['model'];if(_0x1369e3[_0xe9db('0x26')][_0xe9db('0x3c')]){_0x51232c['include']=[{'all':!![]}];}_0x51232c=_[_0xe9db('0x31')]({},_0x51232c,_0x1369e3[_0xe9db('0x33')]);return db['ZohoField'][_0xe9db('0x3d')](_0x51232c)[_0xe9db('0x1c')](handleEntityNotFound(_0x3a47b1,null))[_0xe9db('0x1c')](respondWithResult(_0x3a47b1,null))['catch'](handleError(_0x3a47b1,null));};exports['create']=function(_0x203eab,_0xc08be9){return db['ZohoField'][_0xe9db('0x3e')](_0x203eab['body'],{})[_0xe9db('0x1c')](respondWithResult(_0xc08be9,0xc9))[_0xe9db('0x38')](handleError(_0xc08be9,null));};exports[_0xe9db('0x3f')]=function(_0x7f645c,_0x1fff77){if(_0x7f645c['body']['id']){delete _0x7f645c[_0xe9db('0x40')]['id'];}return db[_0xe9db('0x34')][_0xe9db('0x3d')]({'where':{'id':_0x7f645c[_0xe9db('0x39')]['id']}})[_0xe9db('0x1c')](handleEntityNotFound(_0x1fff77,null))[_0xe9db('0x1c')](saveUpdates(_0x7f645c['body'],null))[_0xe9db('0x1c')](respondWithResult(_0x1fff77,null))['catch'](handleError(_0x1fff77,null));};exports[_0xe9db('0x1d')]=function(_0x24342d,_0x593186){return db[_0xe9db('0x34')]['find']({'where':{'id':_0x24342d[_0xe9db('0x39')]['id']}})[_0xe9db('0x1c')](handleEntityNotFound(_0x593186,null))['then'](removeEntity(_0x593186,null))[_0xe9db('0x38')](handleError(_0x593186,null));};
\ No newline at end of file
index e581383..7cf6a6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5af=['zoho_unique_index','idField','util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','ZohoField','int_zoho_fields'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe5af,0x9c));var _0xfe5a=function(_0x1fc45c,_0x3c84df){_0x1fc45c=_0x1fc45c-0x0;var _0x152a8b=_0xe5af[_0x1fc45c];return _0x152a8b;};'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('./intZohoField.attributes');module[_0xfe5a('0x6')]=function(_0x2039cd,_0x4e418f){return _0x2039cd['define'](_0xfe5a('0x7'),attributes,{'tableName':_0xfe5a('0x8'),'paranoid':![],'indexes':[{'name':_0xfe5a('0x9'),'fields':[_0xfe5a('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6050=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','zoho_unique_index','idField','FieldId','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6050,0x196));var _0x0605=function(_0x360531,_0x2fac49){_0x360531=_0x360531-0x0;var _0x4017c8=_0x6050[_0x360531];return _0x4017c8;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0605('0x9'),'fields':[_0x0605('0xa'),_0x0605('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 2d0bdfa..8d68117 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cb0=['ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x4692f7,_0x293190){var _0x5212f4=function(_0x937d27){while(--_0x937d27){_0x4692f7['push'](_0x4692f7['shift']());}};_0x5212f4(++_0x293190);}(_0x7cb0,0xdf));var _0x07cb=function(_0x48cc05,_0x99c831){_0x48cc05=_0x48cc05-0x0;var _0x5aa91f=_0x7cb0[_0x48cc05];return _0x5aa91f;};'use strict';var _=require(_0x07cb('0x0'));var util=require(_0x07cb('0x1'));var moment=require(_0x07cb('0x2'));var BPromise=require(_0x07cb('0x3'));var rs=require(_0x07cb('0x4'));var fs=require('fs');var Redis=require(_0x07cb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x07cb('0x6'));var logger=require('../../config/logger')(_0x07cb('0x7'));var config=require('../../config/environment');var jayson=require(_0x07cb('0x8'));var client=jayson[_0x07cb('0x9')][_0x07cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x208107,_0x3b44e9,_0x46699c){return new BPromise(function(_0x5dae2f,_0x28351b){return client['request'](_0x208107,_0x46699c)[_0x07cb('0xb')](function(_0x1746a2){logger[_0x07cb('0xc')]('ZohoField,\x20%s,\x20%s',_0x3b44e9,'request\x20sent');logger[_0x07cb('0xd')](_0x07cb('0xe'),_0x3b44e9,_0x07cb('0xf'),JSON[_0x07cb('0x10')](_0x1746a2));if(_0x1746a2['error']){if(_0x1746a2['error'][_0x07cb('0x11')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x3b44e9,_0x1746a2[_0x07cb('0x12')]['message']);return _0x28351b(_0x1746a2[_0x07cb('0x12')]['message']);}logger[_0x07cb('0x12')](_0x07cb('0x13'),_0x3b44e9,_0x1746a2['error']['message']);return _0x5dae2f(_0x1746a2[_0x07cb('0x12')]['message']);}else{logger['info'](_0x07cb('0x13'),_0x3b44e9,'request\x20sent');_0x5dae2f(_0x1746a2['result'][_0x07cb('0x14')]);}})[_0x07cb('0x15')](function(_0x1f73dd){logger['error'](_0x07cb('0x13'),_0x3b44e9,_0x1f73dd);_0x28351b(_0x1f73dd);});});}
\ No newline at end of file
+var _0x20ee=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20ee,0x8e));var _0xe20e=function(_0x581dc4,_0x3f0e09){_0x581dc4=_0x581dc4-0x0;var _0x565709=_0x20ee[_0x581dc4];return _0x565709;};'use strict';var _=require(_0xe20e('0x0'));var util=require(_0xe20e('0x1'));var moment=require(_0xe20e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20e('0x3'));var fs=require('fs');var Redis=require(_0xe20e('0x4'));var db=require(_0xe20e('0x5'))['db'];var utils=require(_0xe20e('0x6'));var logger=require(_0xe20e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe20e('0x8'));var client=jayson[_0xe20e('0x9')][_0xe20e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b5de,_0x5b1721,_0x58d15f){return new BPromise(function(_0x5189b7,_0x304dfc){return client[_0xe20e('0xb')](_0x9b5de,_0x58d15f)[_0xe20e('0xc')](function(_0x204eca){logger[_0xe20e('0xd')](_0xe20e('0xe'),_0x5b1721,_0xe20e('0xf'));logger[_0xe20e('0x10')](_0xe20e('0x11'),_0x5b1721,_0xe20e('0xf'),JSON['stringify'](_0x204eca));if(_0x204eca['error']){if(_0x204eca[_0xe20e('0x12')][_0xe20e('0x13')]===0x1f4){logger[_0xe20e('0x12')](_0xe20e('0xe'),_0x5b1721,_0x204eca[_0xe20e('0x12')][_0xe20e('0x14')]);return _0x304dfc(_0x204eca[_0xe20e('0x12')][_0xe20e('0x14')]);}logger[_0xe20e('0x12')]('ZohoField,\x20%s,\x20%s',_0x5b1721,_0x204eca[_0xe20e('0x12')]['message']);return _0x5189b7(_0x204eca[_0xe20e('0x12')][_0xe20e('0x14')]);}else{logger['info'](_0xe20e('0xe'),_0x5b1721,'request\x20sent');_0x5189b7(_0x204eca[_0xe20e('0x15')][_0xe20e('0x14')]);}})[_0xe20e('0x16')](function(_0x46f9ce){logger[_0xe20e('0x12')]('ZohoField,\x20%s,\x20%s',_0x5b1721,_0x46f9ce);_0x304dfc(_0x46f9ce);});});}
\ No newline at end of file
index 541051b..617bcd3 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(_0x30977b,_0x22be64){var _0x339a92=function(_0x2d7a68){while(--_0x2d7a68){_0x30977b['push'](_0x30977b['shift']());}};_0x339a92(++_0x22be64);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2d9f30,_0x258111){var _0x243932=function(_0x2eca4a){while(--_0x2eca4a){_0x2d9f30['push'](_0x2d9f30['shift']());}};_0x243932(++_0x258111);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 4b94830..c7c93e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96db=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x1e6d93,_0x1459a4){var _0x1c84e2=function(_0x38eb4b){while(--_0x38eb4b){_0x1e6d93['push'](_0x1e6d93['shift']());}};_0x1c84e2(++_0x1459a4);}(_0x96db,0x10b));var _0xb96d=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x96db[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0xb96d('0x0'));module[_0xb96d('0x1')]={'name':{'type':Sequelize[_0xb96d('0x2')],'allowNull':![],'unique':_0xb96d('0x3')},'version':{'type':Sequelize[_0xb96d('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xb96d('0x2')],'defaultValue':_0xb96d('0x4')},'filename':{'type':Sequelize[_0xb96d('0x2')]},'path':{'type':Sequelize[_0xb96d('0x2')]},'type':{'type':Sequelize[_0xb96d('0x2')]},'size':{'type':Sequelize[_0xb96d('0x5')]},'active':{'type':Sequelize[_0xb96d('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xb96d('0x2')]},'logo':{'type':Sequelize[_0xb96d('0x2')]},'state':{'type':Sequelize[_0xb96d('0x2')],'unique':_0xb96d('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xb96d('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
+var _0x4e37=['STRING','unique_name_and_version','app.js','BOOLEAN','sequelize','exports'];(function(_0x572744,_0x4a768c){var _0x32cb23=function(_0x5c87d3){while(--_0x5c87d3){_0x572744['push'](_0x572744['shift']());}};_0x32cb23(++_0x4a768c);}(_0x4e37,0x1a8));var _0x74e3=function(_0x253cdb,_0x142a36){_0x253cdb=_0x253cdb-0x0;var _0x1ae7f4=_0x4e37[_0x253cdb];return _0x1ae7f4;};'use strict';var Sequelize=require(_0x74e3('0x0'));module[_0x74e3('0x1')]={'name':{'type':Sequelize[_0x74e3('0x2')],'allowNull':![],'unique':_0x74e3('0x3')},'version':{'type':Sequelize[_0x74e3('0x2')],'allowNull':![],'unique':_0x74e3('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x74e3('0x4')},'filename':{'type':Sequelize[_0x74e3('0x2')]},'path':{'type':Sequelize[_0x74e3('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x74e3('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x74e3('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x74e3('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x74e3('0x2')]},'link':{'type':Sequelize[_0x74e3('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index 329cdcd..10ef65d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2c7,0x134));var _0x7c2c=function(_0x407240,_0x2be9f7){_0x407240=_0x407240-0x0;var _0x2a23a2=_0xc2c7[_0x407240];return _0x2a23a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['Integration'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['Integration'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};
\ No newline at end of file
+var _0x90b1=['map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','Integration','includeAll','rows','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index'];(function(_0x5017db,_0x11968e){var _0x592d3d=function(_0x31eb21){while(--_0x31eb21){_0x5017db['push'](_0x5017db['shift']());}};_0x592d3d(++_0x11968e);}(_0x90b1,0x1bb));var _0x190b=function(_0x1a2edc,_0x718006){_0x1a2edc=_0x1a2edc-0x0;var _0xccd506=_0x90b1[_0x1a2edc];return _0xccd506;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['Integration'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['Integration'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};
\ No newline at end of file
index a89d461..7947343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdee9=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','integrations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdee9,0xb3));var _0x9dee=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xdee9[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x9dee('0x0'));var util=require(_0x9dee('0x1'));var logger=require(_0x9dee('0x2'))('api');var moment=require(_0x9dee('0x3'));var BPromise=require(_0x9dee('0x4'));var rp=require(_0x9dee('0x5'));var fs=require('fs');var path=require(_0x9dee('0x6'));var rimraf=require(_0x9dee('0x7'));var config=require('../../config/environment');var attributes=require(_0x9dee('0x8'));module[_0x9dee('0x9')]=function(_0x51a15f,_0x470825){return _0x51a15f[_0x9dee('0xa')]('Integration',attributes,{'tableName':_0x9dee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c83=['exports','define','Integration','integrations','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x4a98c2,_0x22b8f5){var _0x1dc173=function(_0x81290b){while(--_0x81290b){_0x4a98c2['push'](_0x4a98c2['shift']());}};_0x1dc173(++_0x22b8f5);}(_0x3c83,0x1d2));var _0x33c8=function(_0xe91d80,_0x91bde5){_0xe91d80=_0xe91d80-0x0;var _0x1e17c4=_0x3c83[_0xe91d80];return _0x1e17c4;};'use strict';var _=require('lodash');var util=require(_0x33c8('0x0'));var logger=require(_0x33c8('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x33c8('0x2'));var fs=require('fs');var path=require(_0x33c8('0x3'));var rimraf=require(_0x33c8('0x4'));var config=require(_0x33c8('0x5'));var attributes=require(_0x33c8('0x6'));module[_0x33c8('0x7')]=function(_0x4e92b3,_0x59c0cd){return _0x4e92b3[_0x33c8('0x8')](_0x33c8('0x9'),attributes,{'tableName':_0x33c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbab630..3658870 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x5411cb,_0x1cd69d){var _0x32727a=function(_0x22a762){while(--_0x22a762){_0x5411cb['push'](_0x5411cb['shift']());}};_0x32727a(++_0x1cd69d);}(_0x524e,0x15e));var _0xe524=function(_0x24bf4e,_0x7d9a1b){_0x24bf4e=_0x24bf4e-0x0;var _0x740d78=_0x524e[_0x24bf4e];return _0x740d78;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}
\ No newline at end of file
+var _0xdd4f=['lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x5d3416,_0x20c335){var _0x38da23=function(_0x247b4b){while(--_0x247b4b){_0x5d3416['push'](_0x5d3416['shift']());}};_0x38da23(++_0x20c335);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x1ff7ef,_0x56c924){_0x1ff7ef=_0x1ff7ef-0x0;var _0x5eacf2=_0xdd4f[_0x1ff7ef];return _0x5eacf2;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});}
\ No newline at end of file
index e60ca3a..6715245 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x4f62c9,_0x5e5b63){var _0x4dca96=function(_0x224bc5){while(--_0x224bc5){_0x4f62c9['push'](_0x4f62c9['shift']());}};_0x4dca96(++_0x5e5b63);}(_0x187d,0x93));var _0xd187=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x187d[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router;
\ No newline at end of file
+var _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0xc5db78,_0x11278c){var _0x2542f0=function(_0x5ad2f4){while(--_0x5ad2f4){_0xc5db78['push'](_0xc5db78['shift']());}};_0x2542f0(++_0x11278c);}(_0xef0f,0x168));var _0xfef0=function(_0x327b46,_0x204583){_0x327b46=_0x327b46-0x0;var _0x24d461=_0xef0f[_0x327b46];return _0x24d461;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router;
\ No newline at end of file
index 9040b65..02a5c8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cf9=['sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED'];(function(_0x45d2c5,_0x1810d9){var _0x37e695=function(_0x553b9d){while(--_0x553b9d){_0x45d2c5['push'](_0x45d2c5['shift']());}};_0x37e695(++_0x1810d9);}(_0x7cf9,0x75));var _0x97cf=function(_0x341517,_0x224aeb){_0x341517=_0x341517-0x0;var _0x1ea1ac=_0x7cf9[_0x341517];return _0x1ea1ac;};'use strict';var Sequelize=require(_0x97cf('0x0'));module['exports']={'integration':{'type':Sequelize[_0x97cf('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x97cf('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x97cf('0x2')]},'contacts':{'type':Sequelize[_0x97cf('0x1')]},'uniqueid':{'type':Sequelize[_0x97cf('0x1')]},'calleridnum':{'type':Sequelize[_0x97cf('0x1')]},'calleridname':{'type':Sequelize[_0x97cf('0x1')]},'queue':{'type':Sequelize[_0x97cf('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x97cf('0x3')]},'agentconnectAt':{'type':Sequelize[_0x97cf('0x3')]},'holdtime':{'type':Sequelize[_0x97cf('0x2')]},'agentcomplete':{'type':Sequelize[_0x97cf('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x97cf('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x97cf('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x97cf('0x2')]},'reason':{'type':Sequelize[_0x97cf('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x97cf('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x97cf('0x3')]},'agentdump':{'type':Sequelize[_0x97cf('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x97cf('0x3')]},'lastevent':{'type':Sequelize[_0x97cf('0x1')]},'channel':{'type':Sequelize[_0x97cf('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x97cf('0x1')]},'connectedlinenum':{'type':Sequelize[_0x97cf('0x1')]},'connectedlinename':{'type':Sequelize[_0x97cf('0x1')]},'language':{'type':Sequelize[_0x97cf('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x97cf('0x1')]},'exten':{'type':Sequelize[_0x97cf('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x97cf('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x97cf('0x1')]},'destcalleridnum':{'type':Sequelize[_0x97cf('0x1')]},'destcalleridname':{'type':Sequelize[_0x97cf('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x97cf('0x1')]},'destlanguage':{'type':Sequelize[_0x97cf('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x97cf('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x97cf('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x97cf('0x1')]},'inReplyTo':{'type':Sequelize[_0x97cf('0x1')]},'subject':{'type':Sequelize[_0x97cf('0x1')]},'from':{'type':Sequelize[_0x97cf('0x1')]},'to':{'type':Sequelize[_0x97cf('0x1')]},'cc':{'type':Sequelize[_0x97cf('0x1')]},'attachment':{'type':Sequelize[_0x97cf('0x5')]},'html':{'type':Sequelize[_0x97cf('0x5')]},'text':{'type':Sequelize[_0x97cf('0x5')]},'status':{'type':Sequelize['ENUM'](_0x97cf('0x6'),_0x97cf('0x7'),_0x97cf('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0805=['DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x43ca6f,_0x4d9b6e){var _0x1c83c0=function(_0x593d82){while(--_0x593d82){_0x43ca6f['push'](_0x43ca6f['shift']());}};_0x1c83c0(++_0x4d9b6e);}(_0x0805,0x17d));var _0x5080=function(_0xc67a6d,_0xbab1a7){_0xc67a6d=_0xc67a6d-0x0;var _0x27680e=_0x0805[_0xc67a6d];return _0x27680e;};'use strict';var Sequelize=require(_0x5080('0x0'));module[_0x5080('0x1')]={'integration':{'type':Sequelize[_0x5080('0x2')]},'eventChannel':{'type':Sequelize[_0x5080('0x2')]},'exitStatus':{'type':Sequelize[_0x5080('0x2')]},'ticketId':{'type':Sequelize[_0x5080('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5080('0x2')]},'calleridnum':{'type':Sequelize[_0x5080('0x2')]},'calleridname':{'type':Sequelize[_0x5080('0x2')]},'queue':{'type':Sequelize[_0x5080('0x2')]},'interface':{'type':Sequelize[_0x5080('0x2')]},'membername':{'type':Sequelize[_0x5080('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5080('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5080('0x3')]},'talktime':{'type':Sequelize[_0x5080('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5080('0x4')]},'reason':{'type':Sequelize[_0x5080('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5080('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5080('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5080('0x2')]},'channelstate':{'type':Sequelize[_0x5080('0x4')]},'channelstatedesc':{'type':Sequelize[_0x5080('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5080('0x2')]},'connectedlinename':{'type':Sequelize[_0x5080('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5080('0x2')]},'context':{'type':Sequelize[_0x5080('0x2')]},'exten':{'type':Sequelize[_0x5080('0x2')]},'priority':{'type':Sequelize[_0x5080('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5080('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5080('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5080('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5080('0x2')]},'destlanguage':{'type':Sequelize[_0x5080('0x2')]},'destaccountcode':{'type':Sequelize[_0x5080('0x2')]},'destcontext':{'type':Sequelize[_0x5080('0x2')]},'destexten':{'type':Sequelize[_0x5080('0x2')]},'destpriority':{'type':Sequelize[_0x5080('0x2')]},'destuniqueid':{'type':Sequelize[_0x5080('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x5080('0x2')]},'subject':{'type':Sequelize[_0x5080('0x2')]},'from':{'type':Sequelize[_0x5080('0x2')]},'to':{'type':Sequelize[_0x5080('0x2')]},'cc':{'type':Sequelize[_0x5080('0x2')]},'attachment':{'type':Sequelize[_0x5080('0x6')]},'html':{'type':Sequelize[_0x5080('0x6')]},'text':{'type':Sequelize[_0x5080('0x6')]},'status':{'type':Sequelize[_0x5080('0x7')](_0x5080('0x8'),_0x5080('0x9'),_0x5080('0xa'),_0x5080('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5080('0x2')]},'appdata':{'type':Sequelize[_0x5080('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index b039522..9769f72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dd6=['includeAll','findAll','catch','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','pick','where','VIRTUAL','name','merge','options'];(function(_0xec0810,_0x5ed468){var _0x26abdd=function(_0x2da861){while(--_0x2da861){_0xec0810['push'](_0xec0810['shift']());}};_0x26abdd(++_0x5ed468);}(_0x8dd6,0x180));var _0x68dd=function(_0x1104ed,_0x578ff9){_0x1104ed=_0x1104ed-0x0;var _0x27d221=_0x8dd6[_0x1104ed];return _0x27d221;};'use strict';var emlformat=require(_0x68dd('0x0'));var rimraf=require(_0x68dd('0x1'));var zipdir=require(_0x68dd('0x2'));var jsonpatch=require(_0x68dd('0x3'));var rp=require('request-promise');var moment=require(_0x68dd('0x4'));var BPromise=require(_0x68dd('0x5'));var Mustache=require(_0x68dd('0x6'));var util=require(_0x68dd('0x7'));var path=require('path');var sox=require(_0x68dd('0x8'));var csv=require(_0x68dd('0x9'));var ejs=require(_0x68dd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68dd('0xb'));var squel=require(_0x68dd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x68dd('0xd'));var toCsv=require(_0x68dd('0x9'));var querystring=require(_0x68dd('0xe'));var Papa=require(_0x68dd('0xf'));var Redis=require(_0x68dd('0x10'));var authService=require(_0x68dd('0x11'));var qs=require(_0x68dd('0x12'));var as=require(_0x68dd('0x13'));var hardwareService=require(_0x68dd('0x14'));var logger=require(_0x68dd('0x15'))(_0x68dd('0x16'));var utils=require(_0x68dd('0x17'));var config=require(_0x68dd('0x18'));var licenseUtil=require(_0x68dd('0x19'));var db=require(_0x68dd('0x1a'))['db'];function respondWithStatusCode(_0x26ae19,_0x4b4cb){_0x4b4cb=_0x4b4cb||0xcc;return function(_0x1552bb){if(_0x1552bb){return _0x26ae19[_0x68dd('0x1b')](_0x4b4cb);}return _0x26ae19[_0x68dd('0x1c')](_0x4b4cb)[_0x68dd('0x1d')]();};}function respondWithResult(_0x5c0ff9,_0x1505f4){_0x1505f4=_0x1505f4||0xc8;return function(_0x5ed7bb){if(_0x5ed7bb){return _0x5c0ff9[_0x68dd('0x1c')](_0x1505f4)[_0x68dd('0x1e')](_0x5ed7bb);}};}function respondWithFilteredResult(_0x4702eb,_0x54c49b){return function(_0x126b85){if(_0x126b85){var _0x1fe81f=typeof _0x54c49b['offset']===_0x68dd('0x1f')&&typeof _0x54c49b[_0x68dd('0x20')]==='undefined';var _0x305ed3=_0x126b85[_0x68dd('0x21')];var _0x12cf5c=_0x1fe81f?0x0:_0x54c49b[_0x68dd('0x22')];var _0x42934c=_0x1fe81f?_0x126b85[_0x68dd('0x21')]:_0x54c49b[_0x68dd('0x22')]+_0x54c49b[_0x68dd('0x20')];var _0x2ed6df;if(_0x42934c>=_0x305ed3){_0x42934c=_0x305ed3;_0x2ed6df=0xc8;}else{_0x2ed6df=0xce;}_0x4702eb[_0x68dd('0x1c')](_0x2ed6df);return _0x4702eb[_0x68dd('0x23')](_0x68dd('0x24'),_0x12cf5c+'-'+_0x42934c+'/'+_0x305ed3)[_0x68dd('0x1e')](_0x126b85);}return null;};}function patchUpdates(_0x4c73ef){return function(_0x51351f){try{jsonpatch[_0x68dd('0x25')](_0x51351f,_0x4c73ef,!![]);}catch(_0x39bfce){return BPromise['reject'](_0x39bfce);}return _0x51351f[_0x68dd('0x26')]();};}function saveUpdates(_0x193011,_0x1a5276){return function(_0x254f8b){if(_0x254f8b){return _0x254f8b[_0x68dd('0x27')](_0x193011)[_0x68dd('0x28')](function(_0x2b615a){return _0x2b615a;});}return null;};}function removeEntity(_0x7816a6,_0x189b44){return function(_0x13d110){if(_0x13d110){return _0x13d110[_0x68dd('0x29')]()['then'](function(){_0x7816a6[_0x68dd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f990,_0x432725){return function(_0x142ba8){if(!_0x142ba8){_0x15f990[_0x68dd('0x1b')](0x194);}return _0x142ba8;};}function handleError(_0x268c64,_0x3e877f){_0x3e877f=_0x3e877f||0x1f4;return function(_0x43b3f6){logger[_0x68dd('0x2a')](_0x43b3f6[_0x68dd('0x2b')]);if(_0x43b3f6['name']){delete _0x43b3f6['name'];}_0x268c64['status'](_0x3e877f)[_0x68dd('0x2c')](_0x43b3f6);};}exports[_0x68dd('0x2d')]=function(_0x384e7e,_0x51dcd5){var _0x2107cd={},_0x18c713={},_0x4b0745={'count':0x0,'rows':[]};var _0x34c61f=_[_0x68dd('0x2e')](db[_0x68dd('0x2f')][_0x68dd('0x30')],function(_0x5d044d){return{'name':_0x5d044d[_0x68dd('0x31')],'type':_0x5d044d[_0x68dd('0x32')][_0x68dd('0x33')]};});_0x18c713['model']=_[_0x68dd('0x2e')](_0x34c61f,'name');_0x18c713[_0x68dd('0x34')]=_[_0x68dd('0x35')](_0x384e7e['query']);_0x18c713[_0x68dd('0x36')]=_['intersection'](_0x18c713[_0x68dd('0x37')],_0x18c713['query']);_0x2107cd[_0x68dd('0x38')]=_[_0x68dd('0x39')](_0x18c713[_0x68dd('0x37')],qs[_0x68dd('0x3a')](_0x384e7e[_0x68dd('0x34')][_0x68dd('0x3a')]));_0x2107cd['attributes']=_0x2107cd[_0x68dd('0x38')]['length']?_0x2107cd['attributes']:_0x18c713['model'];if(!_0x384e7e[_0x68dd('0x34')][_0x68dd('0x3b')]('nolimit')){_0x2107cd['limit']=qs[_0x68dd('0x20')](_0x384e7e[_0x68dd('0x34')]['limit']);_0x2107cd[_0x68dd('0x22')]=qs[_0x68dd('0x22')](_0x384e7e['query']['offset']);}_0x2107cd['order']=qs['sort'](_0x384e7e[_0x68dd('0x34')]['sort']);_0x2107cd['where']=qs[_0x68dd('0x36')](_[_0x68dd('0x3c')](_0x384e7e[_0x68dd('0x34')],_0x18c713[_0x68dd('0x36')]),_0x34c61f);if(_0x384e7e[_0x68dd('0x34')]['filter']){_0x2107cd[_0x68dd('0x3d')]=_['merge'](_0x2107cd[_0x68dd('0x3d')],{'$or':_['map'](_0x34c61f,function(_0x74442){if(_0x74442[_0x68dd('0x32')]!==_0x68dd('0x3e')){var _0x4a9aaf={};_0x4a9aaf[_0x74442[_0x68dd('0x3f')]]={'$like':'%'+_0x384e7e[_0x68dd('0x34')]['filter']+'%'};return _0x4a9aaf;}})});}_0x2107cd=_[_0x68dd('0x40')]({},_0x2107cd,_0x384e7e[_0x68dd('0x41')]);var _0x5b6db7={'where':_0x2107cd[_0x68dd('0x3d')]};return db[_0x68dd('0x2f')]['count'](_0x5b6db7)['then'](function(_0x22ae76){_0x4b0745[_0x68dd('0x21')]=_0x22ae76;if(_0x384e7e[_0x68dd('0x34')][_0x68dd('0x42')]){_0x2107cd['include']=[{'all':!![]}];}return db[_0x68dd('0x2f')][_0x68dd('0x43')](_0x2107cd);})[_0x68dd('0x28')](function(_0x4b4686){_0x4b0745['rows']=_0x4b4686;return _0x4b0745;})['then'](respondWithFilteredResult(_0x51dcd5,_0x2107cd))[_0x68dd('0x44')](handleError(_0x51dcd5,null));};exports['show']=function(_0x2243ec,_0xee3e27){var _0xfd19cf={'raw':![],'where':{'id':_0x2243ec[_0x68dd('0x45')]['id']}},_0x13aca9={};_0x13aca9[_0x68dd('0x37')]=_[_0x68dd('0x35')](db[_0x68dd('0x2f')]['rawAttributes']);_0x13aca9['query']=_[_0x68dd('0x35')](_0x2243ec['query']);_0x13aca9[_0x68dd('0x36')]=_[_0x68dd('0x39')](_0x13aca9[_0x68dd('0x37')],_0x13aca9[_0x68dd('0x34')]);_0xfd19cf['attributes']=_[_0x68dd('0x39')](_0x13aca9[_0x68dd('0x37')],qs['fields'](_0x2243ec[_0x68dd('0x34')][_0x68dd('0x3a')]));_0xfd19cf[_0x68dd('0x38')]=_0xfd19cf[_0x68dd('0x38')][_0x68dd('0x46')]?_0xfd19cf[_0x68dd('0x38')]:_0x13aca9[_0x68dd('0x37')];if(_0x2243ec[_0x68dd('0x34')][_0x68dd('0x42')]){_0xfd19cf['include']=[{'all':!![]}];}_0xfd19cf=_['merge']({},_0xfd19cf,_0x2243ec['options']);return db['IntegrationReport'][_0x68dd('0x47')](_0xfd19cf)['then'](handleEntityNotFound(_0xee3e27,null))['then'](respondWithResult(_0xee3e27,null))[_0x68dd('0x44')](handleError(_0xee3e27,null));};exports['create']=function(_0x5586cf,_0x5d998e){return db['IntegrationReport'][_0x68dd('0x48')](_0x5586cf['body'],{})['then'](respondWithResult(_0x5d998e,0xc9))['catch'](handleError(_0x5d998e,null));};exports[_0x68dd('0x27')]=function(_0x4bd3ab,_0x5ef4e4){if(_0x4bd3ab[_0x68dd('0x49')]['id']){delete _0x4bd3ab['body']['id'];}return db[_0x68dd('0x2f')][_0x68dd('0x47')]({'where':{'id':_0x4bd3ab[_0x68dd('0x45')]['id']}})[_0x68dd('0x28')](handleEntityNotFound(_0x5ef4e4,null))[_0x68dd('0x28')](saveUpdates(_0x4bd3ab[_0x68dd('0x49')],null))['then'](respondWithResult(_0x5ef4e4,null))['catch'](handleError(_0x5ef4e4,null));};exports[_0x68dd('0x29')]=function(_0x1e7973,_0x505be8){return db[_0x68dd('0x2f')][_0x68dd('0x47')]({'where':{'id':_0x1e7973['params']['id']}})[_0x68dd('0x28')](handleEntityNotFound(_0x505be8,null))['then'](removeEntity(_0x505be8,null))[_0x68dd('0x44')](handleError(_0x505be8,null));};exports[_0x68dd('0x4a')]=function(_0x3103ef,_0x824a29){return db[_0x68dd('0x2f')][_0x68dd('0x4a')]()[_0x68dd('0x28')](respondWithResult(_0x824a29,null))[_0x68dd('0x44')](handleError(_0x824a29,null));};
\ No newline at end of file
+var _0x2aa0=['IntegrationReport','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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','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','map'];(function(_0x57350d,_0x7af3d3){var _0x26739c=function(_0x2211f5){while(--_0x2211f5){_0x57350d['push'](_0x57350d['shift']());}};_0x26739c(++_0x7af3d3);}(_0x2aa0,0x6c));var _0x02aa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2aa0[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x02aa('0x0'));var rimraf=require(_0x02aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02aa('0x2'));var rp=require(_0x02aa('0x3'));var moment=require('moment');var BPromise=require(_0x02aa('0x4'));var Mustache=require('mustache');var util=require(_0x02aa('0x5'));var path=require(_0x02aa('0x6'));var sox=require(_0x02aa('0x7'));var csv=require(_0x02aa('0x8'));var ejs=require(_0x02aa('0x9'));var fs=require('fs');var fs_extra=require(_0x02aa('0xa'));var _=require(_0x02aa('0xb'));var squel=require(_0x02aa('0xc'));var crypto=require(_0x02aa('0xd'));var jsforce=require(_0x02aa('0xe'));var deskjs=require(_0x02aa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x02aa('0x10'));var Papa=require(_0x02aa('0x11'));var Redis=require('ioredis');var authService=require(_0x02aa('0x12'));var qs=require(_0x02aa('0x13'));var as=require(_0x02aa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x02aa('0x15'));var utils=require(_0x02aa('0x16'));var config=require(_0x02aa('0x17'));var licenseUtil=require(_0x02aa('0x18'));var db=require(_0x02aa('0x19'))['db'];function respondWithStatusCode(_0x54dc33,_0x4ba601){_0x4ba601=_0x4ba601||0xcc;return function(_0x545b5e){if(_0x545b5e){return _0x54dc33[_0x02aa('0x1a')](_0x4ba601);}return _0x54dc33[_0x02aa('0x1b')](_0x4ba601)[_0x02aa('0x1c')]();};}function respondWithResult(_0x24c2ce,_0x2a00da){_0x2a00da=_0x2a00da||0xc8;return function(_0x191bd3){if(_0x191bd3){return _0x24c2ce[_0x02aa('0x1b')](_0x2a00da)[_0x02aa('0x1d')](_0x191bd3);}};}function respondWithFilteredResult(_0x14988e,_0x3a0f8c){return function(_0x45ca70){if(_0x45ca70){var _0x3ebcdf=typeof _0x3a0f8c[_0x02aa('0x1e')]===_0x02aa('0x1f')&&typeof _0x3a0f8c[_0x02aa('0x20')]===_0x02aa('0x1f');var _0x119ede=_0x45ca70[_0x02aa('0x21')];var _0xb0bc12=_0x3ebcdf?0x0:_0x3a0f8c[_0x02aa('0x1e')];var _0x529726=_0x3ebcdf?_0x45ca70[_0x02aa('0x21')]:_0x3a0f8c[_0x02aa('0x1e')]+_0x3a0f8c['limit'];var _0x460f20;if(_0x529726>=_0x119ede){_0x529726=_0x119ede;_0x460f20=0xc8;}else{_0x460f20=0xce;}_0x14988e[_0x02aa('0x1b')](_0x460f20);return _0x14988e[_0x02aa('0x22')]('Content-Range',_0xb0bc12+'-'+_0x529726+'/'+_0x119ede)[_0x02aa('0x1d')](_0x45ca70);}return null;};}function patchUpdates(_0x5b1dee){return function(_0x4be864){try{jsonpatch[_0x02aa('0x23')](_0x4be864,_0x5b1dee,!![]);}catch(_0x320889){return BPromise[_0x02aa('0x24')](_0x320889);}return _0x4be864[_0x02aa('0x25')]();};}function saveUpdates(_0x549e50,_0xf74047){return function(_0x108c00){if(_0x108c00){return _0x108c00[_0x02aa('0x26')](_0x549e50)[_0x02aa('0x27')](function(_0x1d6586){return _0x1d6586;});}return null;};}function removeEntity(_0x45ea2c,_0x1ba751){return function(_0x192f19){if(_0x192f19){return _0x192f19[_0x02aa('0x28')]()[_0x02aa('0x27')](function(){_0x45ea2c[_0x02aa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4531f7,_0x136d90){return function(_0x446f54){if(!_0x446f54){_0x4531f7[_0x02aa('0x1a')](0x194);}return _0x446f54;};}function handleError(_0x258993,_0x350f46){_0x350f46=_0x350f46||0x1f4;return function(_0x21eb2a){logger[_0x02aa('0x29')](_0x21eb2a[_0x02aa('0x2a')]);if(_0x21eb2a['name']){delete _0x21eb2a[_0x02aa('0x2b')];}_0x258993['status'](_0x350f46)[_0x02aa('0x2c')](_0x21eb2a);};}exports['index']=function(_0x540ece,_0x5afd3d){var _0x57b1fc={},_0x20cf72={},_0x1ccf22={'count':0x0,'rows':[]};var _0xf93497=_[_0x02aa('0x2d')](db[_0x02aa('0x2e')]['rawAttributes'],function(_0x37a702){return{'name':_0x37a702[_0x02aa('0x2f')],'type':_0x37a702[_0x02aa('0x30')][_0x02aa('0x31')]};});_0x20cf72[_0x02aa('0x32')]=_[_0x02aa('0x2d')](_0xf93497,_0x02aa('0x2b'));_0x20cf72[_0x02aa('0x33')]=_[_0x02aa('0x34')](_0x540ece['query']);_0x20cf72[_0x02aa('0x35')]=_['intersection'](_0x20cf72[_0x02aa('0x32')],_0x20cf72['query']);_0x57b1fc[_0x02aa('0x36')]=_['intersection'](_0x20cf72[_0x02aa('0x32')],qs[_0x02aa('0x37')](_0x540ece[_0x02aa('0x33')]['fields']));_0x57b1fc['attributes']=_0x57b1fc['attributes'][_0x02aa('0x38')]?_0x57b1fc['attributes']:_0x20cf72[_0x02aa('0x32')];if(!_0x540ece[_0x02aa('0x33')][_0x02aa('0x39')]('nolimit')){_0x57b1fc[_0x02aa('0x20')]=qs[_0x02aa('0x20')](_0x540ece[_0x02aa('0x33')][_0x02aa('0x20')]);_0x57b1fc['offset']=qs['offset'](_0x540ece['query'][_0x02aa('0x1e')]);}_0x57b1fc[_0x02aa('0x3a')]=qs[_0x02aa('0x3b')](_0x540ece[_0x02aa('0x33')]['sort']);_0x57b1fc['where']=qs[_0x02aa('0x35')](_['pick'](_0x540ece[_0x02aa('0x33')],_0x20cf72[_0x02aa('0x35')]),_0xf93497);if(_0x540ece[_0x02aa('0x33')][_0x02aa('0x3c')]){_0x57b1fc[_0x02aa('0x3d')]=_[_0x02aa('0x3e')](_0x57b1fc[_0x02aa('0x3d')],{'$or':_[_0x02aa('0x2d')](_0xf93497,function(_0x1db368){if(_0x1db368[_0x02aa('0x30')]!==_0x02aa('0x3f')){var _0x36583c={};_0x36583c[_0x1db368[_0x02aa('0x2b')]]={'$like':'%'+_0x540ece['query']['filter']+'%'};return _0x36583c;}})});}_0x57b1fc=_[_0x02aa('0x3e')]({},_0x57b1fc,_0x540ece[_0x02aa('0x40')]);var _0x505eb2={'where':_0x57b1fc[_0x02aa('0x3d')]};return db[_0x02aa('0x2e')][_0x02aa('0x21')](_0x505eb2)[_0x02aa('0x27')](function(_0x405dff){_0x1ccf22['count']=_0x405dff;if(_0x540ece[_0x02aa('0x33')][_0x02aa('0x41')]){_0x57b1fc[_0x02aa('0x42')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x57b1fc);})['then'](function(_0x377ef5){_0x1ccf22[_0x02aa('0x43')]=_0x377ef5;return _0x1ccf22;})[_0x02aa('0x27')](respondWithFilteredResult(_0x5afd3d,_0x57b1fc))[_0x02aa('0x44')](handleError(_0x5afd3d,null));};exports[_0x02aa('0x45')]=function(_0x3511e0,_0x12cd02){var _0x5edf54={'raw':![],'where':{'id':_0x3511e0[_0x02aa('0x46')]['id']}},_0x203862={};_0x203862['model']=_[_0x02aa('0x34')](db[_0x02aa('0x2e')][_0x02aa('0x47')]);_0x203862['query']=_[_0x02aa('0x34')](_0x3511e0[_0x02aa('0x33')]);_0x203862[_0x02aa('0x35')]=_[_0x02aa('0x48')](_0x203862[_0x02aa('0x32')],_0x203862['query']);_0x5edf54['attributes']=_['intersection'](_0x203862['model'],qs[_0x02aa('0x37')](_0x3511e0[_0x02aa('0x33')][_0x02aa('0x37')]));_0x5edf54[_0x02aa('0x36')]=_0x5edf54[_0x02aa('0x36')][_0x02aa('0x38')]?_0x5edf54['attributes']:_0x203862[_0x02aa('0x32')];if(_0x3511e0[_0x02aa('0x33')][_0x02aa('0x41')]){_0x5edf54['include']=[{'all':!![]}];}_0x5edf54=_[_0x02aa('0x3e')]({},_0x5edf54,_0x3511e0['options']);return db['IntegrationReport'][_0x02aa('0x49')](_0x5edf54)[_0x02aa('0x27')](handleEntityNotFound(_0x12cd02,null))[_0x02aa('0x27')](respondWithResult(_0x12cd02,null))[_0x02aa('0x44')](handleError(_0x12cd02,null));};exports['create']=function(_0x54c5a9,_0x38b8d5){return db[_0x02aa('0x2e')][_0x02aa('0x4a')](_0x54c5a9[_0x02aa('0x4b')],{})['then'](respondWithResult(_0x38b8d5,0xc9))[_0x02aa('0x44')](handleError(_0x38b8d5,null));};exports['update']=function(_0x50d96d,_0x48635f){if(_0x50d96d[_0x02aa('0x4b')]['id']){delete _0x50d96d[_0x02aa('0x4b')]['id'];}return db[_0x02aa('0x2e')][_0x02aa('0x49')]({'where':{'id':_0x50d96d[_0x02aa('0x46')]['id']}})[_0x02aa('0x27')](handleEntityNotFound(_0x48635f,null))['then'](saveUpdates(_0x50d96d['body'],null))[_0x02aa('0x27')](respondWithResult(_0x48635f,null))['catch'](handleError(_0x48635f,null));};exports[_0x02aa('0x28')]=function(_0x53fc19,_0x223293){return db['IntegrationReport'][_0x02aa('0x49')]({'where':{'id':_0x53fc19[_0x02aa('0x46')]['id']}})[_0x02aa('0x27')](handleEntityNotFound(_0x223293,null))[_0x02aa('0x27')](removeEntity(_0x223293,null))[_0x02aa('0x44')](handleError(_0x223293,null));};exports['describe']=function(_0x239aef,_0x28c060){return db[_0x02aa('0x2e')][_0x02aa('0x4c')]()[_0x02aa('0x27')](respondWithResult(_0x28c060,null))[_0x02aa('0x44')](handleError(_0x28c060,null));};
\ No newline at end of file
index 1f4f9bb..c5174fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00a5=['./integrationReport.attributes','exports','define','IntegrationReport','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x159641,_0x292389){var _0x41c53a=function(_0x21dd62){while(--_0x21dd62){_0x159641['push'](_0x159641['shift']());}};_0x41c53a(++_0x292389);}(_0x00a5,0x178));var _0x500a=function(_0x2da63e,_0x575b1a){_0x2da63e=_0x2da63e-0x0;var _0x531dc1=_0x00a5[_0x2da63e];return _0x531dc1;};'use strict';var _=require(_0x500a('0x0'));var util=require(_0x500a('0x1'));var logger=require('../../config/logger')(_0x500a('0x2'));var moment=require('moment');var BPromise=require(_0x500a('0x3'));var rp=require(_0x500a('0x4'));var fs=require('fs');var path=require(_0x500a('0x5'));var rimraf=require(_0x500a('0x6'));var config=require(_0x500a('0x7'));var attributes=require(_0x500a('0x8'));module[_0x500a('0x9')]=function(_0x33cfca,_0x255206){return _0x33cfca[_0x500a('0xa')](_0x500a('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf58=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration'];(function(_0x3de81c,_0x28c541){var _0x231571=function(_0x1329ed){while(--_0x1329ed){_0x3de81c['push'](_0x3de81c['shift']());}};_0x231571(++_0x28c541);}(_0xbf58,0x1e0));var _0x8bf5=function(_0x5bd87c,_0x58c1ed){_0x5bd87c=_0x5bd87c-0x0;var _0x39e3b3=_0xbf58[_0x5bd87c];return _0x39e3b3;};'use strict';var _=require(_0x8bf5('0x0'));var util=require(_0x8bf5('0x1'));var logger=require(_0x8bf5('0x2'))(_0x8bf5('0x3'));var moment=require(_0x8bf5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bf5('0x5'));var rimraf=require(_0x8bf5('0x6'));var config=require(_0x8bf5('0x7'));var attributes=require(_0x8bf5('0x8'));module['exports']=function(_0x560e72,_0x399dce){return _0x560e72[_0x8bf5('0x9')](_0x8bf5('0xa'),attributes,{'tableName':_0x8bf5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bfb5f09..9846321 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xf494,0x1c6));var _0x4f49=function(_0x90dd2f,_0x47ae43){_0x90dd2f=_0x90dd2f-0x0;var _0x566c8b=_0xf494[_0x90dd2f];return _0x566c8b;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}
\ No newline at end of file
index cfc6f64..608e6bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b04=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','isAuthenticated','index','get','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','put','delete','destroy','multer'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x0b04,0x164));var _0x40b0=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x0b04[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x40b0('0x0'));var util=require(_0x40b0('0x1'));var path=require(_0x40b0('0x2'));var timeout=require('connect-timeout');var express=require(_0x40b0('0x3'));var router=express[_0x40b0('0x4')]();var fs_extra=require(_0x40b0('0x5'));var auth=require(_0x40b0('0x6'));var interaction=require(_0x40b0('0x7'));var config=require('../../config/environment');var controller=require(_0x40b0('0x8'));router['get']('/',auth[_0x40b0('0x9')](),controller[_0x40b0('0xa')]);router[_0x40b0('0xb')](_0x40b0('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x40b0('0xb')](_0x40b0('0xd'),auth[_0x40b0('0x9')](),controller[_0x40b0('0xe')]);router[_0x40b0('0xf')]('/',auth[_0x40b0('0x9')](),controller[_0x40b0('0x10')]);router[_0x40b0('0xf')](_0x40b0('0xd'),auth[_0x40b0('0x9')](),controller[_0x40b0('0x11')]);router[_0x40b0('0xf')]('/:id/sub_intervals/create_many',auth[_0x40b0('0x9')](),controller['addIntervals']);router[_0x40b0('0x12')](_0x40b0('0xc'),auth[_0x40b0('0x9')](),controller['update']);router[_0x40b0('0x13')](_0x40b0('0xc'),auth['isAuthenticated'](),controller[_0x40b0('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x46e1=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29eb10,_0x190cb3){var _0x5371a2=function(_0x3109ea){while(--_0x3109ea){_0x29eb10['push'](_0x29eb10['shift']());}};_0x5371a2(++_0x190cb3);}(_0x46e1,0x155));var _0x146e=function(_0x4f2b2a,_0x3f44c0){_0x4f2b2a=_0x4f2b2a-0x0;var _0x2e4ca2=_0x46e1[_0x4f2b2a];return _0x2e4ca2;};'use strict';var multer=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var path=require(_0x146e('0x2'));var timeout=require(_0x146e('0x3'));var express=require(_0x146e('0x4'));var router=express[_0x146e('0x5')]();var fs_extra=require(_0x146e('0x6'));var auth=require(_0x146e('0x7'));var interaction=require(_0x146e('0x8'));var config=require(_0x146e('0x9'));var controller=require('./interval.controller');router[_0x146e('0xa')]('/',auth[_0x146e('0xb')](),controller[_0x146e('0xc')]);router[_0x146e('0xa')](_0x146e('0xd'),auth[_0x146e('0xb')](),controller[_0x146e('0xe')]);router['get'](_0x146e('0xf'),auth['isAuthenticated'](),controller[_0x146e('0x10')]);router[_0x146e('0x11')]('/',auth[_0x146e('0xb')](),controller[_0x146e('0x12')]);router[_0x146e('0x11')](_0x146e('0xf'),auth['isAuthenticated'](),controller['addInterval']);router[_0x146e('0x11')](_0x146e('0x13'),auth[_0x146e('0xb')](),controller[_0x146e('0x14')]);router[_0x146e('0x15')](_0x146e('0xd'),auth[_0x146e('0xb')](),controller[_0x146e('0x16')]);router['delete']('/:id',auth[_0x146e('0xb')](),controller[_0x146e('0x17')]);module[_0x146e('0x18')]=router;
\ No newline at end of file
index 53e6500..e46ec21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3255=['exports','STRING','sequelize'];(function(_0x155dc9,_0x432ae2){var _0x4d2c2b=function(_0x1ddabe){while(--_0x1ddabe){_0x155dc9['push'](_0x155dc9['shift']());}};_0x4d2c2b(++_0x432ae2);}(_0x3255,0xb6));var _0x5325=function(_0x26417c,_0x139403){_0x26417c=_0x26417c-0x0;var _0x5a2108=_0x3255[_0x26417c];return _0x5a2108;};'use strict';var Sequelize=require(_0x5325('0x0'));module[_0x5325('0x1')]={'name':{'type':Sequelize[_0x5325('0x2')]},'description':{'type':Sequelize[_0x5325('0x2')]},'interval':{'type':Sequelize[_0x5325('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x96c8=['STRING','sequelize','exports'];(function(_0x301403,_0x22151f){var _0x5d980d=function(_0x336252){while(--_0x336252){_0x301403['push'](_0x301403['shift']());}};_0x5d980d(++_0x22151f);}(_0x96c8,0xd6));var _0x896c=function(_0x35a590,_0x2d7d79){_0x35a590=_0x35a590-0x0;var _0x12fe29=_0x96c8[_0x35a590];return _0x12fe29;};'use strict';var Sequelize=require(_0x896c('0x0'));module[_0x896c('0x1')]={'name':{'type':Sequelize[_0x896c('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x896c('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 66ed19f..e058288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6d5=['findAll','rows','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','getIntervals','order','nolimit','addIntervals','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','get','Intervals','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Interval','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','count','includeAll'];(function(_0x43ccae,_0x2c6854){var _0x45d0c9=function(_0xd05cf5){while(--_0xd05cf5){_0x43ccae['push'](_0x43ccae['shift']());}};_0x45d0c9(++_0x2c6854);}(_0xe6d5,0x1d4));var _0x5e6d=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0xe6d5[_0x3457b4];return _0xaa8fa9;};'use strict';var emlformat=require(_0x5e6d('0x0'));var rimraf=require(_0x5e6d('0x1'));var zipdir=require(_0x5e6d('0x2'));var jsonpatch=require(_0x5e6d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5e6d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5e6d('0x5'));var ejs=require(_0x5e6d('0x6'));var fs=require('fs');var fs_extra=require(_0x5e6d('0x7'));var _=require('lodash');var squel=require(_0x5e6d('0x8'));var crypto=require(_0x5e6d('0x9'));var jsforce=require(_0x5e6d('0xa'));var deskjs=require(_0x5e6d('0xb'));var toCsv=require(_0x5e6d('0x5'));var querystring=require(_0x5e6d('0xc'));var Papa=require(_0x5e6d('0xd'));var Redis=require(_0x5e6d('0xe'));var authService=require(_0x5e6d('0xf'));var qs=require(_0x5e6d('0x10'));var as=require(_0x5e6d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e6d('0x12'))('api');var utils=require(_0x5e6d('0x13'));var config=require(_0x5e6d('0x14'));var licenseUtil=require(_0x5e6d('0x15'));var db=require(_0x5e6d('0x16'))['db'];var extensions=require(_0x5e6d('0x17'));function respondWithStatusCode(_0x57ec4d,_0x262c65){_0x262c65=_0x262c65||0xcc;return function(_0x7f908e){if(_0x7f908e){return _0x57ec4d['sendStatus'](_0x262c65);}return _0x57ec4d[_0x5e6d('0x18')](_0x262c65)['end']();};}function respondWithResult(_0xcd1185,_0x26d9c8){_0x26d9c8=_0x26d9c8||0xc8;return function(_0x50b129){if(_0x50b129){return _0xcd1185[_0x5e6d('0x18')](_0x26d9c8)[_0x5e6d('0x19')](_0x50b129);}};}function respondWithFilteredResult(_0x2b7c5d,_0x3fd1aa){return function(_0x326c0b){if(_0x326c0b){var _0x2957de=typeof _0x3fd1aa[_0x5e6d('0x1a')]===_0x5e6d('0x1b')&&typeof _0x3fd1aa[_0x5e6d('0x1c')]==='undefined';var _0x4556d1=_0x326c0b['count'];var _0x3cdcc6=_0x2957de?0x0:_0x3fd1aa[_0x5e6d('0x1a')];var _0x56bfb5=_0x2957de?_0x326c0b['count']:_0x3fd1aa[_0x5e6d('0x1a')]+_0x3fd1aa[_0x5e6d('0x1c')];var _0x22e2f7;if(_0x56bfb5>=_0x4556d1){_0x56bfb5=_0x4556d1;_0x22e2f7=0xc8;}else{_0x22e2f7=0xce;}_0x2b7c5d[_0x5e6d('0x18')](_0x22e2f7);return _0x2b7c5d[_0x5e6d('0x1d')](_0x5e6d('0x1e'),_0x3cdcc6+'-'+_0x56bfb5+'/'+_0x4556d1)['json'](_0x326c0b);}return null;};}function patchUpdates(_0x2ee9e7){return function(_0x557ea9){try{jsonpatch[_0x5e6d('0x1f')](_0x557ea9,_0x2ee9e7,!![]);}catch(_0x3cadca){return BPromise['reject'](_0x3cadca);}return _0x557ea9['save']();};}function saveUpdates(_0x1c49f3,_0x40fba2){return function(_0x6c87a3){if(_0x6c87a3){return _0x6c87a3[_0x5e6d('0x20')](_0x1c49f3)[_0x5e6d('0x21')](function(_0x41a6a6){return _0x41a6a6;});}return null;};}function removeEntity(_0x24add0,_0x1c5567){return function(_0x517e56){if(_0x517e56){return _0x517e56[_0x5e6d('0x22')]()[_0x5e6d('0x21')](function(){var _0x2ad805=_0x517e56[_0x5e6d('0x23')]({'plain':!![]});var _0x50d133=_0x5e6d('0x24');return db[_0x5e6d('0x25')]['destroy']({'where':{'type':_0x50d133,'resourceId':_0x2ad805['id']}})[_0x5e6d('0x21')](function(){return _0x517e56;});})[_0x5e6d('0x21')](function(){_0x24add0[_0x5e6d('0x18')](0xcc)[_0x5e6d('0x26')]();});}};}function handleEntityNotFound(_0x23c868,_0x46e495){return function(_0x2ed645){if(!_0x2ed645){_0x23c868[_0x5e6d('0x27')](0x194);}return _0x2ed645;};}function handleError(_0x123f75,_0x536c56){_0x536c56=_0x536c56||0x1f4;return function(_0x4fa973){logger[_0x5e6d('0x28')](_0x4fa973[_0x5e6d('0x29')]);if(_0x4fa973['name']){delete _0x4fa973[_0x5e6d('0x2a')];}_0x123f75['status'](_0x536c56)[_0x5e6d('0x2b')](_0x4fa973);};}exports[_0x5e6d('0x2c')]=function(_0x5907aa,_0xb2165){var _0x25880a={},_0x2f4199={},_0x5c1126={'count':0x0,'rows':[]};var _0x49a4c2=_[_0x5e6d('0x2d')](db[_0x5e6d('0x2e')][_0x5e6d('0x2f')],function(_0x3e9ee6){return{'name':_0x3e9ee6['fieldName'],'type':_0x3e9ee6[_0x5e6d('0x30')]['key']};});_0x2f4199[_0x5e6d('0x31')]=_[_0x5e6d('0x2d')](_0x49a4c2,_0x5e6d('0x2a'));_0x2f4199[_0x5e6d('0x32')]=_[_0x5e6d('0x33')](_0x5907aa[_0x5e6d('0x32')]);_0x2f4199[_0x5e6d('0x34')]=_[_0x5e6d('0x35')](_0x2f4199[_0x5e6d('0x31')],_0x2f4199['query']);_0x25880a['attributes']=_[_0x5e6d('0x35')](_0x2f4199[_0x5e6d('0x31')],qs[_0x5e6d('0x36')](_0x5907aa[_0x5e6d('0x32')][_0x5e6d('0x36')]));_0x25880a[_0x5e6d('0x37')]=_0x25880a[_0x5e6d('0x37')][_0x5e6d('0x38')]?_0x25880a[_0x5e6d('0x37')]:_0x2f4199[_0x5e6d('0x31')];if(!_0x5907aa[_0x5e6d('0x32')][_0x5e6d('0x39')]('nolimit')){_0x25880a[_0x5e6d('0x1c')]=qs[_0x5e6d('0x1c')](_0x5907aa['query'][_0x5e6d('0x1c')]);_0x25880a[_0x5e6d('0x1a')]=qs[_0x5e6d('0x1a')](_0x5907aa[_0x5e6d('0x32')][_0x5e6d('0x1a')]);}_0x25880a['order']=qs['sort'](_0x5907aa[_0x5e6d('0x32')][_0x5e6d('0x3a')]);_0x25880a[_0x5e6d('0x3b')]=qs['filters'](_['pick'](_0x5907aa[_0x5e6d('0x32')],_0x2f4199[_0x5e6d('0x34')]),_0x49a4c2);if(_0x5907aa['query']['filter']){_0x25880a[_0x5e6d('0x3b')]=_[_0x5e6d('0x3c')](_0x25880a['where'],{'$or':_[_0x5e6d('0x2d')](_0x49a4c2,function(_0x226ff5){if(_0x226ff5[_0x5e6d('0x30')]!==_0x5e6d('0x3d')){var _0x4f0e3e={};_0x4f0e3e[_0x226ff5[_0x5e6d('0x2a')]]={'$like':'%'+_0x5907aa[_0x5e6d('0x32')][_0x5e6d('0x3e')]+'%'};return _0x4f0e3e;}})});}_0x25880a=_['merge']({},_0x25880a,_0x5907aa[_0x5e6d('0x3f')]);var _0xf172a9={'where':_0x25880a[_0x5e6d('0x3b')]};return db[_0x5e6d('0x2e')][_0x5e6d('0x40')](_0xf172a9)[_0x5e6d('0x21')](function(_0x4f1ca5){_0x5c1126[_0x5e6d('0x40')]=_0x4f1ca5;if(_0x5907aa[_0x5e6d('0x32')][_0x5e6d('0x41')]){_0x25880a['include']=[{'all':!![]}];}return db[_0x5e6d('0x2e')][_0x5e6d('0x42')](_0x25880a);})[_0x5e6d('0x21')](function(_0x869c8f){_0x5c1126[_0x5e6d('0x43')]=_0x869c8f;return _0x5c1126;})[_0x5e6d('0x21')](respondWithFilteredResult(_0xb2165,_0x25880a))['catch'](handleError(_0xb2165,null));};exports[_0x5e6d('0x44')]=function(_0x97558d,_0x5ca969){var _0x2a7b94={'raw':!![],'where':{'id':_0x97558d['params']['id']}},_0xe38b87={};_0xe38b87[_0x5e6d('0x31')]=_[_0x5e6d('0x33')](db[_0x5e6d('0x2e')][_0x5e6d('0x2f')]);_0xe38b87[_0x5e6d('0x32')]=_[_0x5e6d('0x33')](_0x97558d[_0x5e6d('0x32')]);_0xe38b87[_0x5e6d('0x34')]=_['intersection'](_0xe38b87[_0x5e6d('0x31')],_0xe38b87[_0x5e6d('0x32')]);_0x2a7b94[_0x5e6d('0x37')]=_['intersection'](_0xe38b87[_0x5e6d('0x31')],qs[_0x5e6d('0x36')](_0x97558d[_0x5e6d('0x32')][_0x5e6d('0x36')]));_0x2a7b94[_0x5e6d('0x37')]=_0x2a7b94[_0x5e6d('0x37')][_0x5e6d('0x38')]?_0x2a7b94[_0x5e6d('0x37')]:_0xe38b87[_0x5e6d('0x31')];if(_0x97558d[_0x5e6d('0x32')][_0x5e6d('0x41')]){_0x2a7b94[_0x5e6d('0x45')]=[{'all':!![]}];}_0x2a7b94=_[_0x5e6d('0x3c')]({},_0x2a7b94,_0x97558d['options']);return db[_0x5e6d('0x2e')][_0x5e6d('0x46')](_0x2a7b94)[_0x5e6d('0x21')](handleEntityNotFound(_0x5ca969,null))['then'](respondWithResult(_0x5ca969,null))[_0x5e6d('0x47')](handleError(_0x5ca969,null));};exports[_0x5e6d('0x48')]=function(_0x1bd764,_0x19c58d){return db[_0x5e6d('0x2e')][_0x5e6d('0x48')](_0x1bd764[_0x5e6d('0x49')],{})[_0x5e6d('0x21')](function(_0x2af009){var _0x48b8b3=_0x1bd764[_0x5e6d('0x4a')][_0x5e6d('0x23')]({'plain':!![]});if(!_0x48b8b3)throw new Error(_0x5e6d('0x4b'));if(_0x48b8b3[_0x5e6d('0x4c')]===_0x5e6d('0x4a')){var _0x100627=_0x2af009['get']({'plain':!![]});var _0x3dbf09=_0x5e6d('0x24');return db[_0x5e6d('0x4d')][_0x5e6d('0x46')]({'where':{'name':_0x3dbf09,'userProfileId':_0x48b8b3[_0x5e6d('0x4e')]},'raw':!![]})[_0x5e6d('0x21')](function(_0xf428e0){if(_0xf428e0&&_0xf428e0['autoAssociation']===0x0){return db[_0x5e6d('0x25')]['create']({'name':_0x100627['name'],'resourceId':_0x100627['id'],'type':_0xf428e0[_0x5e6d('0x2a')],'sectionId':_0xf428e0['id']},{})[_0x5e6d('0x21')](function(){return _0x2af009;});}else{return _0x2af009;}})['catch'](function(_0x3328bc){logger[_0x5e6d('0x28')](_0x5e6d('0x4f'),_0x3328bc);throw _0x3328bc;});}return _0x2af009;})[_0x5e6d('0x21')](respondWithResult(_0x19c58d,0xc9))[_0x5e6d('0x47')](handleError(_0x19c58d,null));};exports[_0x5e6d('0x20')]=function(_0x3beea4,_0x5b2041){if(_0x3beea4[_0x5e6d('0x49')]['id']){delete _0x3beea4[_0x5e6d('0x49')]['id'];}return db[_0x5e6d('0x2e')][_0x5e6d('0x46')]({'where':{'id':_0x3beea4[_0x5e6d('0x50')]['id']}})[_0x5e6d('0x21')](handleEntityNotFound(_0x5b2041,null))[_0x5e6d('0x21')](saveUpdates(_0x3beea4[_0x5e6d('0x49')],null))[_0x5e6d('0x21')](respondWithResult(_0x5b2041,null))[_0x5e6d('0x47')](handleError(_0x5b2041,null));};exports[_0x5e6d('0x22')]=function(_0x3acf73,_0x3afdbb){return db[_0x5e6d('0x2e')]['find']({'where':{'id':_0x3acf73[_0x5e6d('0x50')]['id']}})['then'](handleEntityNotFound(_0x3afdbb,null))[_0x5e6d('0x21')](removeEntity(_0x3afdbb,null))[_0x5e6d('0x47')](handleError(_0x3afdbb,null));};exports[_0x5e6d('0x51')]=function(_0x47bfd2,_0x18d7f7,_0x4bb74e){if(_0x47bfd2[_0x5e6d('0x49')]['id']){delete _0x47bfd2['body']['id'];}return db['Interval'][_0x5e6d('0x46')]({'where':{'id':_0x47bfd2[_0x5e6d('0x50')]['id']}})['then'](handleEntityNotFound(_0x18d7f7,null))[_0x5e6d('0x21')](function(_0x306791){if(_0x306791){_0x47bfd2[_0x5e6d('0x49')][_0x5e6d('0x52')]=_0x306791['id'];return db['Interval'][_0x5e6d('0x48')](_0x47bfd2[_0x5e6d('0x49')]);}})[_0x5e6d('0x21')](respondWithResult(_0x18d7f7,null))[_0x5e6d('0x47')](handleError(_0x18d7f7,null));};exports[_0x5e6d('0x53')]=function(_0x11cb7a,_0x32ef8d,_0x18f090){var _0xabe854={};var _0x49b150={};var _0x5c06e9;var _0x4ab69d;return db[_0x5e6d('0x2e')]['findOne']({'where':{'id':_0x11cb7a[_0x5e6d('0x50')]['id']}})[_0x5e6d('0x21')](handleEntityNotFound(_0x32ef8d,null))[_0x5e6d('0x21')](function(_0x1cc617){if(_0x1cc617){_0x5c06e9=_0x1cc617;_0x49b150[_0x5e6d('0x31')]=_[_0x5e6d('0x33')](db[_0x5e6d('0x2e')][_0x5e6d('0x2f')]);_0x49b150[_0x5e6d('0x32')]=_[_0x5e6d('0x33')](_0x11cb7a[_0x5e6d('0x32')]);_0x49b150[_0x5e6d('0x34')]=_[_0x5e6d('0x35')](_0x49b150['model'],_0x49b150[_0x5e6d('0x32')]);_0xabe854['attributes']=_[_0x5e6d('0x35')](_0x49b150[_0x5e6d('0x31')],qs[_0x5e6d('0x36')](_0x11cb7a[_0x5e6d('0x32')][_0x5e6d('0x36')]));_0xabe854[_0x5e6d('0x37')]=_0xabe854['attributes'][_0x5e6d('0x38')]?_0xabe854[_0x5e6d('0x37')]:_0x49b150[_0x5e6d('0x31')];_0xabe854[_0x5e6d('0x54')]=qs['sort'](_0x11cb7a['query'][_0x5e6d('0x3a')]);_0xabe854['where']=qs[_0x5e6d('0x34')](_['pick'](_0x11cb7a[_0x5e6d('0x32')],_0x49b150[_0x5e6d('0x34')]));if(_0x11cb7a[_0x5e6d('0x32')]['filter']){_0xabe854[_0x5e6d('0x3b')]=_[_0x5e6d('0x3c')](_0xabe854[_0x5e6d('0x3b')],{'$or':_[_0x5e6d('0x2d')](_0xabe854[_0x5e6d('0x37')],function(_0x53c3a2){var _0x2f47d0={};_0x2f47d0[_0x53c3a2]={'$like':'%'+_0x11cb7a[_0x5e6d('0x32')][_0x5e6d('0x3e')]+'%'};return _0x2f47d0;})});}_0xabe854=_[_0x5e6d('0x3c')]({},_0xabe854,_0x11cb7a['options']);return _0x5c06e9[_0x5e6d('0x53')](_0xabe854);}})['then'](function(_0x4cf497){if(_0x4cf497){_0x4ab69d=_0x4cf497['length'];if(!_0x11cb7a[_0x5e6d('0x32')][_0x5e6d('0x39')](_0x5e6d('0x55'))){_0xabe854[_0x5e6d('0x1c')]=qs[_0x5e6d('0x1c')](_0x11cb7a[_0x5e6d('0x32')][_0x5e6d('0x1c')]);_0xabe854['offset']=qs[_0x5e6d('0x1a')](_0x11cb7a[_0x5e6d('0x32')][_0x5e6d('0x1a')]);}return _0x5c06e9[_0x5e6d('0x53')](_0xabe854);}})['then'](function(_0x326b5e){if(_0x326b5e){return _0x326b5e?{'count':_0x4ab69d,'rows':_0x326b5e}:null;}})[_0x5e6d('0x21')](respondWithResult(_0x32ef8d,null))['catch'](handleError(_0x32ef8d,null));};exports[_0x5e6d('0x56')]=function(_0xda9281,_0x241f78,_0x280f73){return db[_0x5e6d('0x2e')]['findOne']({'where':{'id':_0xda9281[_0x5e6d('0x50')]['id']}})[_0x5e6d('0x21')](handleEntityNotFound(_0x241f78,null))[_0x5e6d('0x21')](function(_0x24ca49){if(_0x24ca49){return db[_0x5e6d('0x57')][_0x5e6d('0x58')](function(_0x4a6fa5){return db[_0x5e6d('0x2e')][_0x5e6d('0x22')]({'where':{'IntervalId':_0xda9281[_0x5e6d('0x50')]['id']},'transaction':_0x4a6fa5})[_0x5e6d('0x21')](function(_0x216545){var _0x3610cf=_['map'](_0xda9281[_0x5e6d('0x49')],function(_0x228f56){delete _0x228f56['id'];_0x228f56['IntervalId']=_0xda9281[_0x5e6d('0x50')]['id'];return _0x228f56;});return db[_0x5e6d('0x2e')]['bulkCreate'](_0x3610cf,{'transaction':_0x4a6fa5});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0xda9281['params']['id']}});});}})['then'](respondWithResult(_0x241f78,null))['catch'](handleError(_0x241f78,null));};
\ No newline at end of file
+var _0xcf45=['../../config/logger','api','../../config/utils','../../config/license/util','../../components/extensions/rewrite','status','undefined','limit','offset','count','set','json','reject','save','update','then','get','Intervals','destroy','end','sendStatus','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','getIntervals','findOne','nolimit','sequelize','transaction','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x29fa3d,_0x45d24f){var _0x5d4bbf=function(_0x5b89ef){while(--_0x5b89ef){_0x29fa3d['push'](_0x29fa3d['shift']());}};_0x5d4bbf(++_0x45d24f);}(_0xcf45,0x100));var _0x5cf4=function(_0xc94941,_0x5a9cf2){_0xc94941=_0xc94941-0x0;var _0x4bcf9c=_0xcf45[_0xc94941];return _0x4bcf9c;};'use strict';var emlformat=require(_0x5cf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cf4('0x1'));var jsonpatch=require(_0x5cf4('0x2'));var rp=require('request-promise');var moment=require(_0x5cf4('0x3'));var BPromise=require(_0x5cf4('0x4'));var Mustache=require(_0x5cf4('0x5'));var util=require(_0x5cf4('0x6'));var path=require(_0x5cf4('0x7'));var sox=require(_0x5cf4('0x8'));var csv=require(_0x5cf4('0x9'));var ejs=require(_0x5cf4('0xa'));var fs=require('fs');var fs_extra=require(_0x5cf4('0xb'));var _=require(_0x5cf4('0xc'));var squel=require(_0x5cf4('0xd'));var crypto=require(_0x5cf4('0xe'));var jsforce=require(_0x5cf4('0xf'));var deskjs=require(_0x5cf4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5cf4('0x11'));var Papa=require(_0x5cf4('0x12'));var Redis=require(_0x5cf4('0x13'));var authService=require(_0x5cf4('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5cf4('0x15'));var hardwareService=require(_0x5cf4('0x16'));var logger=require(_0x5cf4('0x17'))(_0x5cf4('0x18'));var utils=require(_0x5cf4('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5cf4('0x1a'));var db=require('../../mysqldb')['db'];var extensions=require(_0x5cf4('0x1b'));function respondWithStatusCode(_0x4b06a2,_0x2eefbe){_0x2eefbe=_0x2eefbe||0xcc;return function(_0x5de29e){if(_0x5de29e){return _0x4b06a2['sendStatus'](_0x2eefbe);}return _0x4b06a2['status'](_0x2eefbe)['end']();};}function respondWithResult(_0xcb4a4b,_0x43cba9){_0x43cba9=_0x43cba9||0xc8;return function(_0x4ddbd4){if(_0x4ddbd4){return _0xcb4a4b[_0x5cf4('0x1c')](_0x43cba9)['json'](_0x4ddbd4);}};}function respondWithFilteredResult(_0x688ed0,_0x4753b0){return function(_0x517d21){if(_0x517d21){var _0x546c6d=typeof _0x4753b0['offset']===_0x5cf4('0x1d')&&typeof _0x4753b0[_0x5cf4('0x1e')]===_0x5cf4('0x1d');var _0x1ca315=_0x517d21['count'];var _0x16c08a=_0x546c6d?0x0:_0x4753b0[_0x5cf4('0x1f')];var _0x4427d7=_0x546c6d?_0x517d21[_0x5cf4('0x20')]:_0x4753b0[_0x5cf4('0x1f')]+_0x4753b0[_0x5cf4('0x1e')];var _0x24831c;if(_0x4427d7>=_0x1ca315){_0x4427d7=_0x1ca315;_0x24831c=0xc8;}else{_0x24831c=0xce;}_0x688ed0[_0x5cf4('0x1c')](_0x24831c);return _0x688ed0[_0x5cf4('0x21')]('Content-Range',_0x16c08a+'-'+_0x4427d7+'/'+_0x1ca315)[_0x5cf4('0x22')](_0x517d21);}return null;};}function patchUpdates(_0x233d78){return function(_0x9824d0){try{jsonpatch['apply'](_0x9824d0,_0x233d78,!![]);}catch(_0x3cb65f){return BPromise[_0x5cf4('0x23')](_0x3cb65f);}return _0x9824d0[_0x5cf4('0x24')]();};}function saveUpdates(_0x52a38b,_0x5afdcb){return function(_0x2bfa3d){if(_0x2bfa3d){return _0x2bfa3d[_0x5cf4('0x25')](_0x52a38b)[_0x5cf4('0x26')](function(_0x3b8494){return _0x3b8494;});}return null;};}function removeEntity(_0x239f22,_0x346927){return function(_0x8b335c){if(_0x8b335c){return _0x8b335c['destroy']()[_0x5cf4('0x26')](function(){var _0x2f6765=_0x8b335c[_0x5cf4('0x27')]({'plain':!![]});var _0x594855=_0x5cf4('0x28');return db['UserProfileResource'][_0x5cf4('0x29')]({'where':{'type':_0x594855,'resourceId':_0x2f6765['id']}})['then'](function(){return _0x8b335c;});})[_0x5cf4('0x26')](function(){_0x239f22['status'](0xcc)[_0x5cf4('0x2a')]();});}};}function handleEntityNotFound(_0x557a29,_0x6cfd8){return function(_0x38fce5){if(!_0x38fce5){_0x557a29[_0x5cf4('0x2b')](0x194);}return _0x38fce5;};}function handleError(_0x19cde9,_0x220fd9){_0x220fd9=_0x220fd9||0x1f4;return function(_0x6a13d8){logger[_0x5cf4('0x2c')](_0x6a13d8[_0x5cf4('0x2d')]);if(_0x6a13d8[_0x5cf4('0x2e')]){delete _0x6a13d8[_0x5cf4('0x2e')];}_0x19cde9[_0x5cf4('0x1c')](_0x220fd9)[_0x5cf4('0x2f')](_0x6a13d8);};}exports[_0x5cf4('0x30')]=function(_0x5e734b,_0x47ac4c){var _0x14fb8b={},_0x2f0110={},_0x4c6623={'count':0x0,'rows':[]};var _0x586f20=_[_0x5cf4('0x31')](db[_0x5cf4('0x32')][_0x5cf4('0x33')],function(_0x549ee9){return{'name':_0x549ee9[_0x5cf4('0x34')],'type':_0x549ee9[_0x5cf4('0x35')][_0x5cf4('0x36')]};});_0x2f0110[_0x5cf4('0x37')]=_['map'](_0x586f20,_0x5cf4('0x2e'));_0x2f0110['query']=_[_0x5cf4('0x38')](_0x5e734b[_0x5cf4('0x39')]);_0x2f0110['filters']=_[_0x5cf4('0x3a')](_0x2f0110[_0x5cf4('0x37')],_0x2f0110[_0x5cf4('0x39')]);_0x14fb8b[_0x5cf4('0x3b')]=_[_0x5cf4('0x3a')](_0x2f0110[_0x5cf4('0x37')],qs['fields'](_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x3c')]));_0x14fb8b['attributes']=_0x14fb8b['attributes'][_0x5cf4('0x3d')]?_0x14fb8b[_0x5cf4('0x3b')]:_0x2f0110[_0x5cf4('0x37')];if(!_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x3e')]('nolimit')){_0x14fb8b[_0x5cf4('0x1e')]=qs['limit'](_0x5e734b['query'][_0x5cf4('0x1e')]);_0x14fb8b['offset']=qs[_0x5cf4('0x1f')](_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x1f')]);}_0x14fb8b[_0x5cf4('0x3f')]=qs[_0x5cf4('0x40')](_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x40')]);_0x14fb8b[_0x5cf4('0x41')]=qs[_0x5cf4('0x42')](_[_0x5cf4('0x43')](_0x5e734b[_0x5cf4('0x39')],_0x2f0110[_0x5cf4('0x42')]),_0x586f20);if(_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x44')]){_0x14fb8b[_0x5cf4('0x41')]=_['merge'](_0x14fb8b[_0x5cf4('0x41')],{'$or':_[_0x5cf4('0x31')](_0x586f20,function(_0x4530a1){if(_0x4530a1[_0x5cf4('0x35')]!==_0x5cf4('0x45')){var _0x3a5e84={};_0x3a5e84[_0x4530a1[_0x5cf4('0x2e')]]={'$like':'%'+_0x5e734b['query'][_0x5cf4('0x44')]+'%'};return _0x3a5e84;}})});}_0x14fb8b=_[_0x5cf4('0x46')]({},_0x14fb8b,_0x5e734b['options']);var _0x5e9679={'where':_0x14fb8b[_0x5cf4('0x41')]};return db[_0x5cf4('0x32')]['count'](_0x5e9679)[_0x5cf4('0x26')](function(_0x443c5d){_0x4c6623['count']=_0x443c5d;if(_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x47')]){_0x14fb8b[_0x5cf4('0x48')]=[{'all':!![]}];}return db['Interval'][_0x5cf4('0x49')](_0x14fb8b);})[_0x5cf4('0x26')](function(_0x9a7dc9){_0x4c6623['rows']=_0x9a7dc9;return _0x4c6623;})[_0x5cf4('0x26')](respondWithFilteredResult(_0x47ac4c,_0x14fb8b))[_0x5cf4('0x4a')](handleError(_0x47ac4c,null));};exports['show']=function(_0x2c73d8,_0x48e410){var _0x121616={'raw':!![],'where':{'id':_0x2c73d8['params']['id']}},_0x207bbb={};_0x207bbb['model']=_[_0x5cf4('0x38')](db['Interval'][_0x5cf4('0x33')]);_0x207bbb['query']=_[_0x5cf4('0x38')](_0x2c73d8[_0x5cf4('0x39')]);_0x207bbb['filters']=_[_0x5cf4('0x3a')](_0x207bbb[_0x5cf4('0x37')],_0x207bbb['query']);_0x121616[_0x5cf4('0x3b')]=_[_0x5cf4('0x3a')](_0x207bbb[_0x5cf4('0x37')],qs[_0x5cf4('0x3c')](_0x2c73d8[_0x5cf4('0x39')][_0x5cf4('0x3c')]));_0x121616[_0x5cf4('0x3b')]=_0x121616['attributes'][_0x5cf4('0x3d')]?_0x121616[_0x5cf4('0x3b')]:_0x207bbb[_0x5cf4('0x37')];if(_0x2c73d8[_0x5cf4('0x39')]['includeAll']){_0x121616[_0x5cf4('0x48')]=[{'all':!![]}];}_0x121616=_[_0x5cf4('0x46')]({},_0x121616,_0x2c73d8[_0x5cf4('0x4b')]);return db['Interval']['find'](_0x121616)[_0x5cf4('0x26')](handleEntityNotFound(_0x48e410,null))[_0x5cf4('0x26')](respondWithResult(_0x48e410,null))[_0x5cf4('0x4a')](handleError(_0x48e410,null));};exports[_0x5cf4('0x4c')]=function(_0x26cd4c,_0x4c65df){return db[_0x5cf4('0x32')][_0x5cf4('0x4c')](_0x26cd4c[_0x5cf4('0x4d')],{})['then'](function(_0x4b80e4){var _0x2da3fc=_0x26cd4c['user'][_0x5cf4('0x27')]({'plain':!![]});if(!_0x2da3fc)throw new Error(_0x5cf4('0x4e'));if(_0x2da3fc['role']===_0x5cf4('0x4f')){var _0x489746=_0x4b80e4[_0x5cf4('0x27')]({'plain':!![]});var _0x459dc4=_0x5cf4('0x28');return db['UserProfileSection'][_0x5cf4('0x50')]({'where':{'name':_0x459dc4,'userProfileId':_0x2da3fc[_0x5cf4('0x51')]},'raw':!![]})[_0x5cf4('0x26')](function(_0x85d33){if(_0x85d33&&_0x85d33[_0x5cf4('0x52')]===0x0){return db[_0x5cf4('0x53')][_0x5cf4('0x4c')]({'name':_0x489746[_0x5cf4('0x2e')],'resourceId':_0x489746['id'],'type':_0x85d33[_0x5cf4('0x2e')],'sectionId':_0x85d33['id']},{})['then'](function(){return _0x4b80e4;});}else{return _0x4b80e4;}})[_0x5cf4('0x4a')](function(_0xe50090){logger[_0x5cf4('0x2c')](_0x5cf4('0x54'),_0xe50090);throw _0xe50090;});}return _0x4b80e4;})[_0x5cf4('0x26')](respondWithResult(_0x4c65df,0xc9))[_0x5cf4('0x4a')](handleError(_0x4c65df,null));};exports[_0x5cf4('0x25')]=function(_0xf7d930,_0x40e9f7){if(_0xf7d930[_0x5cf4('0x4d')]['id']){delete _0xf7d930['body']['id'];}return db[_0x5cf4('0x32')][_0x5cf4('0x50')]({'where':{'id':_0xf7d930[_0x5cf4('0x55')]['id']}})[_0x5cf4('0x26')](handleEntityNotFound(_0x40e9f7,null))[_0x5cf4('0x26')](saveUpdates(_0xf7d930['body'],null))['then'](respondWithResult(_0x40e9f7,null))[_0x5cf4('0x4a')](handleError(_0x40e9f7,null));};exports[_0x5cf4('0x29')]=function(_0x450a6e,_0x1487eb){return db[_0x5cf4('0x32')][_0x5cf4('0x50')]({'where':{'id':_0x450a6e['params']['id']}})[_0x5cf4('0x26')](handleEntityNotFound(_0x1487eb,null))[_0x5cf4('0x26')](removeEntity(_0x1487eb,null))[_0x5cf4('0x4a')](handleError(_0x1487eb,null));};exports[_0x5cf4('0x56')]=function(_0x168654,_0x462d4f,_0x9f78e6){if(_0x168654[_0x5cf4('0x4d')]['id']){delete _0x168654['body']['id'];}return db['Interval'][_0x5cf4('0x50')]({'where':{'id':_0x168654[_0x5cf4('0x55')]['id']}})[_0x5cf4('0x26')](handleEntityNotFound(_0x462d4f,null))['then'](function(_0xbfad80){if(_0xbfad80){_0x168654[_0x5cf4('0x4d')][_0x5cf4('0x57')]=_0xbfad80['id'];return db[_0x5cf4('0x32')][_0x5cf4('0x4c')](_0x168654[_0x5cf4('0x4d')]);}})['then'](respondWithResult(_0x462d4f,null))['catch'](handleError(_0x462d4f,null));};exports[_0x5cf4('0x58')]=function(_0x40b74e,_0x41f3e1,_0x83ac19){var _0x1383d3={};var _0x204894={};var _0x5afd30;var _0x3de68e;return db[_0x5cf4('0x32')][_0x5cf4('0x59')]({'where':{'id':_0x40b74e[_0x5cf4('0x55')]['id']}})['then'](handleEntityNotFound(_0x41f3e1,null))[_0x5cf4('0x26')](function(_0x181283){if(_0x181283){_0x5afd30=_0x181283;_0x204894[_0x5cf4('0x37')]=_['keys'](db[_0x5cf4('0x32')][_0x5cf4('0x33')]);_0x204894[_0x5cf4('0x39')]=_[_0x5cf4('0x38')](_0x40b74e[_0x5cf4('0x39')]);_0x204894['filters']=_[_0x5cf4('0x3a')](_0x204894[_0x5cf4('0x37')],_0x204894[_0x5cf4('0x39')]);_0x1383d3[_0x5cf4('0x3b')]=_['intersection'](_0x204894[_0x5cf4('0x37')],qs[_0x5cf4('0x3c')](_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x3c')]));_0x1383d3[_0x5cf4('0x3b')]=_0x1383d3[_0x5cf4('0x3b')][_0x5cf4('0x3d')]?_0x1383d3[_0x5cf4('0x3b')]:_0x204894[_0x5cf4('0x37')];_0x1383d3[_0x5cf4('0x3f')]=qs[_0x5cf4('0x40')](_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x40')]);_0x1383d3[_0x5cf4('0x41')]=qs[_0x5cf4('0x42')](_['pick'](_0x40b74e[_0x5cf4('0x39')],_0x204894[_0x5cf4('0x42')]));if(_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x44')]){_0x1383d3[_0x5cf4('0x41')]=_['merge'](_0x1383d3[_0x5cf4('0x41')],{'$or':_[_0x5cf4('0x31')](_0x1383d3[_0x5cf4('0x3b')],function(_0x2c7caf){var _0xf722a1={};_0xf722a1[_0x2c7caf]={'$like':'%'+_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x44')]+'%'};return _0xf722a1;})});}_0x1383d3=_[_0x5cf4('0x46')]({},_0x1383d3,_0x40b74e['options']);return _0x5afd30[_0x5cf4('0x58')](_0x1383d3);}})[_0x5cf4('0x26')](function(_0x5da942){if(_0x5da942){_0x3de68e=_0x5da942[_0x5cf4('0x3d')];if(!_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x3e')](_0x5cf4('0x5a'))){_0x1383d3[_0x5cf4('0x1e')]=qs[_0x5cf4('0x1e')](_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x1e')]);_0x1383d3[_0x5cf4('0x1f')]=qs['offset'](_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x1f')]);}return _0x5afd30[_0x5cf4('0x58')](_0x1383d3);}})[_0x5cf4('0x26')](function(_0x517a13){if(_0x517a13){return _0x517a13?{'count':_0x3de68e,'rows':_0x517a13}:null;}})[_0x5cf4('0x26')](respondWithResult(_0x41f3e1,null))[_0x5cf4('0x4a')](handleError(_0x41f3e1,null));};exports['addIntervals']=function(_0x4e7fd3,_0x59305f,_0x36c021){return db[_0x5cf4('0x32')]['findOne']({'where':{'id':_0x4e7fd3['params']['id']}})[_0x5cf4('0x26')](handleEntityNotFound(_0x59305f,null))[_0x5cf4('0x26')](function(_0x10ec38){if(_0x10ec38){return db[_0x5cf4('0x5b')][_0x5cf4('0x5c')](function(_0x423838){return db['Interval'][_0x5cf4('0x29')]({'where':{'IntervalId':_0x4e7fd3['params']['id']},'transaction':_0x423838})[_0x5cf4('0x26')](function(_0x3f54dc){var _0x2c1d34=_[_0x5cf4('0x31')](_0x4e7fd3[_0x5cf4('0x4d')],function(_0xa60079){delete _0xa60079['id'];_0xa60079[_0x5cf4('0x57')]=_0x4e7fd3[_0x5cf4('0x55')]['id'];return _0xa60079;});return db[_0x5cf4('0x32')]['bulkCreate'](_0x2c1d34,{'transaction':_0x423838});});})['then'](function(){return db['Interval'][_0x5cf4('0x49')]({'where':{'IntervalId':_0x4e7fd3[_0x5cf4('0x55')]['id']}});});}})[_0x5cf4('0x26')](respondWithResult(_0x59305f,null))['catch'](handleError(_0x59305f,null));};
\ No newline at end of file
index 275d8fd..2d28368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe056=['define','tools_intervals','rewrite','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xe056,0xdb));var _0x6e05=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0xe056[_0x5dfc2a];return _0x3f1a71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e05('0x0'))(_0x6e05('0x1'));var moment=require(_0x6e05('0x2'));var BPromise=require('bluebird');var rp=require(_0x6e05('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e05('0x4'));var config=require(_0x6e05('0x5'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x19837b,_0x390bb6){return _0x19837b[_0x6e05('0x6')]('Interval',attributes,{'tableName':_0x6e05('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x177b2c,_0x1a0ed3){extensions[_0x6e05('0x8')](_0x19837b,_0x177b2c);},'afterBulkCreate':function(_0x13af56,_0x52b72b,_0x330e12){_0x330e12();extensions[_0x6e05('0x8')](_0x19837b,_0x13af56[0x0]);},'afterUpdate':function(_0x321ee5,_0x178c9f){extensions[_0x6e05('0x8')](_0x19837b,_0x321ee5);},'afterDestroy':function(_0x21af62,_0x4ff533){extensions[_0x6e05('0x8')](_0x19837b,_0x21af62);}}});};
\ No newline at end of file
+var _0x9a2e=['Interval','rewrite','lodash','util','../../config/logger','path','rimraf','../../config/environment','exports','define'];(function(_0x493c5b,_0x4523de){var _0x3e487d=function(_0x3c4c48){while(--_0x3c4c48){_0x493c5b['push'](_0x493c5b['shift']());}};_0x3e487d(++_0x4523de);}(_0x9a2e,0xc0));var _0xe9a2=function(_0x1f4074,_0x23c424){_0x1f4074=_0x1f4074-0x0;var _0x4c1978=_0x9a2e[_0x1f4074];return _0x4c1978;};'use strict';var _=require(_0xe9a2('0x0'));var util=require(_0xe9a2('0x1'));var logger=require(_0xe9a2('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9a2('0x3'));var rimraf=require(_0xe9a2('0x4'));var config=require(_0xe9a2('0x5'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0xe9a2('0x6')]=function(_0x15072a,_0x153f89){return _0x15072a[_0xe9a2('0x7')](_0xe9a2('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x408422,_0x34cf37){extensions[_0xe9a2('0x9')](_0x15072a,_0x408422);},'afterBulkCreate':function(_0x1296e2,_0xd1a6e0,_0x3e196e){_0x3e196e();extensions[_0xe9a2('0x9')](_0x15072a,_0x1296e2[0x0]);},'afterUpdate':function(_0x33aad0,_0x4cf311){extensions['rewrite'](_0x15072a,_0x33aad0);},'afterDestroy':function(_0x2f7d9f,_0x4505ab){extensions[_0xe9a2('0x9')](_0x15072a,_0x2f7d9f);}}});};
\ No newline at end of file
index e040428..6d2698a 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(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 93988e1..5d5e57f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x3c05c8,_0x4dbdb4){var _0xb88fd3=function(_0x16602a){while(--_0x16602a){_0x3c05c8['push'](_0x3c05c8['shift']());}};_0xb88fd3(++_0x4dbdb4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x499c0d,_0x3a36b7){_0x499c0d=_0x499c0d-0x0;var _0x19dfb4=_0x5f2f[_0x499c0d];return _0x19dfb4;};'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
+var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'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
index e958f83..f812428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e4a=['toString','base64','request','setEncoding','utf8','data','end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','Bug','customfield_11500','customfield_11501','oldToken','fields','newToken','customfield_11503','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x2e4a,0x1a9));var _0xa2e4=function(_0x3acfba,_0x307866){_0x3acfba=_0x3acfba-0x0;var _0x3fcdd6=_0x2e4a[_0x3acfba];return _0x3fcdd6;};'use strict';var BPromise=require(_0xa2e4('0x0'));var https=require(_0xa2e4('0x1'));var logger=require(_0xa2e4('0x2'))(_0xa2e4('0x3'));var USERNAME='support';var PASSWORD=_0xa2e4('0x4');function openIssue(_0x3ea95c,_0x434a53){var _0x3f10d6={'fields':{'project':{'key':_0x3ea95c[_0xa2e4('0x5')]||_0xa2e4('0x6')},'summary':(_0x3ea95c['summary']||_0xa2e4('0x7'))+_0xa2e4('0x8')+_0x3ea95c['ip'],'description':_0x3ea95c[_0xa2e4('0x9')]||JSON[_0xa2e4('0xa')](_0x3ea95c),'issuetype':{'name':_0x3ea95c['issuetype']||_0xa2e4('0xb')}}};_0x3f10d6['fields'][_0xa2e4('0xc')]=_0x3ea95c['email'];_0x3f10d6['fields'][_0xa2e4('0xd')]=_0x3ea95c[_0xa2e4('0xe')];_0x3f10d6[_0xa2e4('0xf')]['customfield_11502']=_0x3ea95c[_0xa2e4('0x10')];_0x3f10d6[_0xa2e4('0xf')][_0xa2e4('0x11')]=_0x3ea95c['name'];_0x3f10d6[_0xa2e4('0xf')][_0xa2e4('0x12')]=_0x3ea95c[_0xa2e4('0x13')];_0x3f10d6[_0xa2e4('0xf')]['customfield_10102']=_0x3ea95c['ip'];var _0x4bb76f={'host':_0xa2e4('0x14'),'port':0x1bb,'path':_0xa2e4('0x15'),'method':_0xa2e4('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xa2e4('0x17'),'Authorization':_0xa2e4('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xa2e4('0x19')](_0xa2e4('0x1a'))}};var _0x18eac8=JSON[_0xa2e4('0xa')](_0x3f10d6);var _0x28f695=https[_0xa2e4('0x1b')](_0x4bb76f,function(_0xfc9f7b){_0xfc9f7b[_0xa2e4('0x1c')](_0xa2e4('0x1d'));var _0x17b6b1='';_0xfc9f7b['on'](_0xa2e4('0x1e'),function(_0x580c2d){_0x17b6b1+=_0x580c2d;});_0xfc9f7b['on'](_0xa2e4('0x1f'),function(){if(_0x434a53){return _0x434a53['status'](_0xfc9f7b[_0xa2e4('0x20')])[_0xa2e4('0x21')](JSON[_0xa2e4('0x22')](_0x17b6b1));}});});_0x28f695['on'](_0xa2e4('0x23'),function(_0x3fc28d){if(_0x434a53){return _0x434a53[_0xa2e4('0x24')](0x1f4)[_0xa2e4('0x21')]({'errors':[{'message':_0xa2e4('0x25'),'type':_0xa2e4('0x26')}]});}});_0x28f695['write'](_0x18eac8);_0x28f695[_0xa2e4('0x1f')]();}exports[_0xa2e4('0x27')]=openIssue;exports['send']=function(_0x4faddd,_0x1093a9){_0x4faddd[_0xa2e4('0x28')]['ip']=_0x4faddd['headers'][_0xa2e4('0x29')]||_0x4faddd[_0xa2e4('0x2a')][_0xa2e4('0x2b')]||_0x4faddd[_0xa2e4('0x2c')][_0xa2e4('0x2b')]||_0x4faddd['connection']['socket'][_0xa2e4('0x2b')];return openIssue(_0x4faddd[_0xa2e4('0x28')],_0x1093a9);};
\ No newline at end of file
+var _0xd525=['Bug','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','utf8','end','status','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify'];(function(_0x5eb77d,_0x134a0){var _0x1d71f7=function(_0x298d16){while(--_0x298d16){_0x5eb77d['push'](_0x5eb77d['shift']());}};_0x1d71f7(++_0x134a0);}(_0xd525,0x7b));var _0x5d52=function(_0x39156d,_0x359d79){_0x39156d=_0x39156d-0x0;var _0x5ab4d5=_0xd525[_0x39156d];return _0x5ab4d5;};'use strict';var BPromise=require(_0x5d52('0x0'));var https=require('https');var logger=require(_0x5d52('0x1'))('api');var USERNAME='support';var PASSWORD=_0x5d52('0x2');function openIssue(_0x2046e0,_0x46359e){var _0x12807e={'fields':{'project':{'key':_0x2046e0[_0x5d52('0x3')]||_0x5d52('0x4')},'summary':(_0x2046e0[_0x5d52('0x5')]||'Report')+_0x5d52('0x6')+_0x2046e0['ip'],'description':_0x2046e0[_0x5d52('0x7')]||JSON[_0x5d52('0x8')](_0x2046e0),'issuetype':{'name':_0x2046e0['issuetype']||_0x5d52('0x9')}}};_0x12807e['fields'][_0x5d52('0xa')]=_0x2046e0[_0x5d52('0xb')];_0x12807e[_0x5d52('0xc')][_0x5d52('0xd')]=_0x2046e0[_0x5d52('0xe')];_0x12807e[_0x5d52('0xc')][_0x5d52('0xf')]=_0x2046e0[_0x5d52('0x10')];_0x12807e['fields'][_0x5d52('0x11')]=_0x2046e0[_0x5d52('0x12')];_0x12807e['fields'][_0x5d52('0x13')]=_0x2046e0[_0x5d52('0x14')];_0x12807e['fields'][_0x5d52('0x15')]=_0x2046e0['ip'];var _0x9fc5d7={'host':_0x5d52('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x5d52('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x5d52('0x18'),'Authorization':_0x5d52('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x5d52('0x1a')](_0x5d52('0x1b'))}};var _0x5f3bae=JSON['stringify'](_0x12807e);var _0xae0ef4=https[_0x5d52('0x1c')](_0x9fc5d7,function(_0x26ec54){_0x26ec54['setEncoding'](_0x5d52('0x1d'));var _0x4094e8='';_0x26ec54['on']('data',function(_0x1f1a38){_0x4094e8+=_0x1f1a38;});_0x26ec54['on'](_0x5d52('0x1e'),function(){if(_0x46359e){return _0x46359e[_0x5d52('0x1f')](_0x26ec54['statusCode'])['json'](JSON['parse'](_0x4094e8));}});});_0xae0ef4['on'](_0x5d52('0x20'),function(_0x2b46e6){if(_0x46359e){return _0x46359e[_0x5d52('0x1f')](0x1f4)[_0x5d52('0x21')]({'errors':[{'message':_0x5d52('0x22'),'type':_0x5d52('0x23')}]});}});_0xae0ef4[_0x5d52('0x24')](_0x5f3bae);_0xae0ef4[_0x5d52('0x1e')]();}exports['openIssue']=openIssue;exports[_0x5d52('0x25')]=function(_0x4fdb7d,_0x509882){_0x4fdb7d[_0x5d52('0x26')]['ip']=_0x4fdb7d[_0x5d52('0x27')][_0x5d52('0x28')]||_0x4fdb7d['connection'][_0x5d52('0x29')]||_0x4fdb7d[_0x5d52('0x2a')][_0x5d52('0x29')]||_0x4fdb7d[_0x5d52('0x2b')][_0x5d52('0x2a')][_0x5d52('0x29')];return openIssue(_0x4fdb7d[_0x5d52('0x26')],_0x509882);};
\ No newline at end of file
index a66215f..9bea144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e9=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x3a5d66,_0x2ebe40){var _0x24f909=function(_0x403440){while(--_0x403440){_0x3a5d66['push'](_0x3a5d66['shift']());}};_0x24f909(++_0x2ebe40);}(_0x99e9,0xb4));var _0x999e=function(_0x3bee55,_0x4e25c8){_0x3bee55=_0x3bee55-0x0;var _0x5649d2=_0x99e9[_0x3bee55];return _0x5649d2;};'use strict';var multer=require('multer');var util=require(_0x999e('0x0'));var path=require(_0x999e('0x1'));var timeout=require(_0x999e('0x2'));var express=require(_0x999e('0x3'));var router=express['Router']();var fs_extra=require(_0x999e('0x4'));var auth=require(_0x999e('0x5'));var interaction=require(_0x999e('0x6'));var config=require('../../config/environment');var controller=require(_0x999e('0x7'));router['get']('/',auth[_0x999e('0x8')](),controller[_0x999e('0x9')]);router[_0x999e('0xa')](_0x999e('0xb'),auth['isAuthenticated'](),controller[_0x999e('0xc')]);router[_0x999e('0xa')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0xe')]);router[_0x999e('0xf')]('/',auth[_0x999e('0x8')](),controller[_0x999e('0x10')]);router[_0x999e('0x11')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x12')]);router[_0x999e('0x13')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x14')]);module[_0x999e('0x15')]=router;
\ No newline at end of file
+var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x521847,_0x2812cb){var _0x17d69d=function(_0x5c35f7){while(--_0x5c35f7){_0x521847['push'](_0x521847['shift']());}};_0x17d69d(++_0x2812cb);}(_0x91a7,0xe7));var _0x791a=function(_0x25c69f,_0x54f4cb){_0x25c69f=_0x25c69f-0x0;var _0x36dbd0=_0x91a7[_0x25c69f];return _0x36dbd0;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router;
\ No newline at end of file
index ff5601a..6aeac31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x5f01d4,_0x5ae3c3){_0x5f01d4=_0x5f01d4-0x0;var _0x1bab48=_0x7a54[_0x5f01d4];return _0x1bab48;};'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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x5e4cb8,_0x14c69c){_0x5e4cb8=_0x5e4cb8-0x0;var _0x3bffb1=_0x7a54[_0x5e4cb8];return _0x3bffb1;};'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 a1b180d..ee04524 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22da=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x22da,0x80));var _0xa22d=function(_0x4415ff,_0x393afe){_0x4415ff=_0x4415ff-0x0;var _0x193c22=_0x22da[_0x4415ff];return _0x193c22;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa22d('0x0'));var jsonpatch=require(_0xa22d('0x1'));var rp=require(_0xa22d('0x2'));var moment=require(_0xa22d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa22d('0x4'));var util=require(_0xa22d('0x5'));var path=require(_0xa22d('0x6'));var sox=require(_0xa22d('0x7'));var csv=require('to-csv');var ejs=require(_0xa22d('0x8'));var fs=require('fs');var fs_extra=require(_0xa22d('0x9'));var _=require('lodash');var squel=require(_0xa22d('0xa'));var crypto=require(_0xa22d('0xb'));var jsforce=require(_0xa22d('0xc'));var deskjs=require(_0xa22d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa22d('0xe'));var Redis=require(_0xa22d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa22d('0x10'));var as=require(_0xa22d('0x11'));var hardwareService=require(_0xa22d('0x12'));var logger=require(_0xa22d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa22d('0x14'));var licenseUtil=require(_0xa22d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x184309,_0x515d6c){_0x515d6c=_0x515d6c||0xcc;return function(_0x983182){if(_0x983182){return _0x184309[_0xa22d('0x16')](_0x515d6c);}return _0x184309[_0xa22d('0x17')](_0x515d6c)['end']();};}function respondWithResult(_0x174a3f,_0x20d7f3){_0x20d7f3=_0x20d7f3||0xc8;return function(_0xc0d11d){if(_0xc0d11d){return _0x174a3f[_0xa22d('0x17')](_0x20d7f3)[_0xa22d('0x18')](_0xc0d11d);}};}function respondWithFilteredResult(_0x4dfa44,_0x132b1d){return function(_0x1b8627){if(_0x1b8627){var _0x2af5c6=typeof _0x132b1d[_0xa22d('0x19')]===_0xa22d('0x1a')&&typeof _0x132b1d[_0xa22d('0x1b')]===_0xa22d('0x1a');var _0x5e56a6=_0x1b8627[_0xa22d('0x1c')];var _0x3d78b9=_0x2af5c6?0x0:_0x132b1d[_0xa22d('0x19')];var _0x1ed22e=_0x2af5c6?_0x1b8627[_0xa22d('0x1c')]:_0x132b1d[_0xa22d('0x19')]+_0x132b1d[_0xa22d('0x1b')];var _0x184604;if(_0x1ed22e>=_0x5e56a6){_0x1ed22e=_0x5e56a6;_0x184604=0xc8;}else{_0x184604=0xce;}_0x4dfa44['status'](_0x184604);return _0x4dfa44[_0xa22d('0x1d')](_0xa22d('0x1e'),_0x3d78b9+'-'+_0x1ed22e+'/'+_0x5e56a6)[_0xa22d('0x18')](_0x1b8627);}return null;};}function patchUpdates(_0x4ed606){return function(_0x4c0aed){try{jsonpatch['apply'](_0x4c0aed,_0x4ed606,!![]);}catch(_0x2cd394){return BPromise[_0xa22d('0x1f')](_0x2cd394);}return _0x4c0aed[_0xa22d('0x20')]();};}function saveUpdates(_0x5071e1,_0x389675){return function(_0x45f528){if(_0x45f528){return _0x45f528[_0xa22d('0x21')](_0x5071e1)['then'](function(_0xdb2773){return _0xdb2773;});}return null;};}function removeEntity(_0x1088ea,_0x502219){return function(_0x24701d){if(_0x24701d){return _0x24701d[_0xa22d('0x22')]()[_0xa22d('0x23')](function(){_0x1088ea[_0xa22d('0x17')](0xcc)[_0xa22d('0x24')]();});}};}function handleEntityNotFound(_0x1c83e8,_0x55f1ce){return function(_0x58aa49){if(!_0x58aa49){_0x1c83e8['sendStatus'](0x194);}return _0x58aa49;};}function handleError(_0x70bfb8,_0x2e4b26){_0x2e4b26=_0x2e4b26||0x1f4;return function(_0x2fe9e0){logger[_0xa22d('0x25')](_0x2fe9e0[_0xa22d('0x26')]);if(_0x2fe9e0[_0xa22d('0x27')]){delete _0x2fe9e0[_0xa22d('0x27')];}_0x70bfb8[_0xa22d('0x17')](_0x2e4b26)[_0xa22d('0x28')](_0x2fe9e0);};}exports[_0xa22d('0x29')]=function(_0x594ac5,_0x5ba48b){var _0xf687b9={},_0x4d460f={},_0x550dd7={'count':0x0,'rows':[]};var _0x1d7b33=_[_0xa22d('0x2a')](db[_0xa22d('0x2b')][_0xa22d('0x2c')],function(_0x1614f4){return{'name':_0x1614f4[_0xa22d('0x2d')],'type':_0x1614f4[_0xa22d('0x2e')][_0xa22d('0x2f')]};});_0x4d460f['model']=_[_0xa22d('0x2a')](_0x1d7b33,_0xa22d('0x27'));_0x4d460f[_0xa22d('0x30')]=_[_0xa22d('0x31')](_0x594ac5[_0xa22d('0x30')]);_0x4d460f[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4d460f[_0xa22d('0x34')],_0x4d460f[_0xa22d('0x30')]);_0xf687b9[_0xa22d('0x35')]=_['intersection'](_0x4d460f[_0xa22d('0x34')],qs[_0xa22d('0x36')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x36')]));_0xf687b9[_0xa22d('0x35')]=_0xf687b9[_0xa22d('0x35')]['length']?_0xf687b9[_0xa22d('0x35')]:_0x4d460f[_0xa22d('0x34')];if(!_0x594ac5['query'][_0xa22d('0x37')]('nolimit')){_0xf687b9[_0xa22d('0x1b')]=qs[_0xa22d('0x1b')](_0x594ac5['query'][_0xa22d('0x1b')]);_0xf687b9['offset']=qs[_0xa22d('0x19')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x19')]);}_0xf687b9[_0xa22d('0x38')]=qs[_0xa22d('0x39')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x39')]);_0xf687b9[_0xa22d('0x3a')]=qs['filters'](_[_0xa22d('0x3b')](_0x594ac5[_0xa22d('0x30')],_0x4d460f['filters']),_0x1d7b33);if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]){_0xf687b9['where']=_['merge'](_0xf687b9[_0xa22d('0x3a')],{'$or':_[_0xa22d('0x2a')](_0x1d7b33,function(_0x109944){if(_0x109944[_0xa22d('0x2e')]!==_0xa22d('0x3d')){var _0x180c37={};_0x180c37[_0x109944[_0xa22d('0x27')]]={'$like':'%'+_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]+'%'};return _0x180c37;}})});}_0xf687b9=_[_0xa22d('0x3e')]({},_0xf687b9,_0x594ac5['options']);var _0x36287a={'where':_0xf687b9[_0xa22d('0x3a')]};return db[_0xa22d('0x2b')][_0xa22d('0x1c')](_0x36287a)['then'](function(_0x11e608){_0x550dd7['count']=_0x11e608;if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3f')]){_0xf687b9[_0xa22d('0x40')]=[{'all':!![]}];}return db[_0xa22d('0x2b')][_0xa22d('0x41')](_0xf687b9);})[_0xa22d('0x23')](function(_0x55034d){_0x550dd7[_0xa22d('0x42')]=_0x55034d;return _0x550dd7;})[_0xa22d('0x23')](respondWithFilteredResult(_0x5ba48b,_0xf687b9))['catch'](handleError(_0x5ba48b,null));};exports[_0xa22d('0x43')]=function(_0x2e44c3,_0x5404d1){var _0x42a36b={'raw':!![],'where':{'id':_0x2e44c3[_0xa22d('0x44')]['id']}},_0x4aebbe={};_0x4aebbe[_0xa22d('0x34')]=_[_0xa22d('0x31')](db['JscriptyAnswerReport'][_0xa22d('0x2c')]);_0x4aebbe[_0xa22d('0x30')]=_['keys'](_0x2e44c3[_0xa22d('0x30')]);_0x4aebbe[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],_0x4aebbe[_0xa22d('0x30')]);_0x42a36b[_0xa22d('0x35')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],qs['fields'](_0x2e44c3['query'][_0xa22d('0x36')]));_0x42a36b['attributes']=_0x42a36b[_0xa22d('0x35')]['length']?_0x42a36b[_0xa22d('0x35')]:_0x4aebbe['model'];if(_0x2e44c3[_0xa22d('0x30')][_0xa22d('0x3f')]){_0x42a36b[_0xa22d('0x40')]=[{'all':!![]}];}_0x42a36b=_[_0xa22d('0x3e')]({},_0x42a36b,_0x2e44c3[_0xa22d('0x45')]);return db[_0xa22d('0x2b')][_0xa22d('0x46')](_0x42a36b)[_0xa22d('0x23')](handleEntityNotFound(_0x5404d1,null))[_0xa22d('0x23')](respondWithResult(_0x5404d1,null))[_0xa22d('0x47')](handleError(_0x5404d1,null));};exports['create']=function(_0x5f488e,_0x132be8){return db['JscriptyAnswerReport'][_0xa22d('0x48')](_0x5f488e['body'],{})[_0xa22d('0x23')](respondWithResult(_0x132be8,0xc9))[_0xa22d('0x47')](handleError(_0x132be8,null));};exports['update']=function(_0x4a1d04,_0x37e2b2){if(_0x4a1d04['body']['id']){delete _0x4a1d04[_0xa22d('0x49')]['id'];}return db['JscriptyAnswerReport'][_0xa22d('0x46')]({'where':{'id':_0x4a1d04[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x37e2b2,null))[_0xa22d('0x23')](saveUpdates(_0x4a1d04[_0xa22d('0x49')],null))[_0xa22d('0x23')](respondWithResult(_0x37e2b2,null))[_0xa22d('0x47')](handleError(_0x37e2b2,null));};exports[_0xa22d('0x22')]=function(_0x45672b,_0x5e5847){return db[_0xa22d('0x2b')][_0xa22d('0x46')]({'where':{'id':_0x45672b[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x5e5847,null))[_0xa22d('0x23')](removeEntity(_0x5e5847,null))[_0xa22d('0x47')](handleError(_0x5e5847,null));};exports[_0xa22d('0x4a')]=function(_0x432d39,_0x134e7a){return db[_0xa22d('0x2b')]['describe']()[_0xa22d('0x23')](respondWithResult(_0x134e7a,null))[_0xa22d('0x47')](handleError(_0x134e7a,null));};
\ No newline at end of file
+var _0x5a93=['VIRTUAL','filter','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','end','error','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','merge'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0x5a93,0xf6));var _0x35a9=function(_0x36c732,_0x37fa2a){_0x36c732=_0x36c732-0x0;var _0x45f202=_0x5a93[_0x36c732];return _0x45f202;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35a9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35a9('0x1'));var rp=require(_0x35a9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35a9('0x3'));var util=require(_0x35a9('0x4'));var path=require(_0x35a9('0x5'));var sox=require('sox');var csv=require(_0x35a9('0x6'));var ejs=require(_0x35a9('0x7'));var fs=require('fs');var fs_extra=require(_0x35a9('0x8'));var _=require(_0x35a9('0x9'));var squel=require(_0x35a9('0xa'));var crypto=require(_0x35a9('0xb'));var jsforce=require(_0x35a9('0xc'));var deskjs=require(_0x35a9('0xd'));var toCsv=require(_0x35a9('0x6'));var querystring=require(_0x35a9('0xe'));var Papa=require(_0x35a9('0xf'));var Redis=require(_0x35a9('0x10'));var authService=require(_0x35a9('0x11'));var qs=require(_0x35a9('0x12'));var as=require(_0x35a9('0x13'));var hardwareService=require(_0x35a9('0x14'));var logger=require(_0x35a9('0x15'))('api');var utils=require(_0x35a9('0x16'));var config=require(_0x35a9('0x17'));var licenseUtil=require(_0x35a9('0x18'));var db=require(_0x35a9('0x19'))['db'];function respondWithStatusCode(_0x49fe9f,_0x18322c){_0x18322c=_0x18322c||0xcc;return function(_0x1bd345){if(_0x1bd345){return _0x49fe9f[_0x35a9('0x1a')](_0x18322c);}return _0x49fe9f[_0x35a9('0x1b')](_0x18322c)['end']();};}function respondWithResult(_0x112b5e,_0x2e3faa){_0x2e3faa=_0x2e3faa||0xc8;return function(_0x76f27c){if(_0x76f27c){return _0x112b5e[_0x35a9('0x1b')](_0x2e3faa)['json'](_0x76f27c);}};}function respondWithFilteredResult(_0xb4c847,_0x47f65b){return function(_0x21b9f1){if(_0x21b9f1){var _0x5b0f9b=typeof _0x47f65b[_0x35a9('0x1c')]===_0x35a9('0x1d')&&typeof _0x47f65b[_0x35a9('0x1e')]===_0x35a9('0x1d');var _0x2a4786=_0x21b9f1[_0x35a9('0x1f')];var _0x56f31f=_0x5b0f9b?0x0:_0x47f65b[_0x35a9('0x1c')];var _0x4490d5=_0x5b0f9b?_0x21b9f1[_0x35a9('0x1f')]:_0x47f65b[_0x35a9('0x1c')]+_0x47f65b[_0x35a9('0x1e')];var _0x545462;if(_0x4490d5>=_0x2a4786){_0x4490d5=_0x2a4786;_0x545462=0xc8;}else{_0x545462=0xce;}_0xb4c847[_0x35a9('0x1b')](_0x545462);return _0xb4c847['set'](_0x35a9('0x20'),_0x56f31f+'-'+_0x4490d5+'/'+_0x2a4786)[_0x35a9('0x21')](_0x21b9f1);}return null;};}function patchUpdates(_0xb11616){return function(_0x2905a2){try{jsonpatch[_0x35a9('0x22')](_0x2905a2,_0xb11616,!![]);}catch(_0x6a7a9f){return BPromise[_0x35a9('0x23')](_0x6a7a9f);}return _0x2905a2[_0x35a9('0x24')]();};}function saveUpdates(_0x27032e,_0x5eb97d){return function(_0x32e07c){if(_0x32e07c){return _0x32e07c[_0x35a9('0x25')](_0x27032e)['then'](function(_0x59222a){return _0x59222a;});}return null;};}function removeEntity(_0x133bdf,_0x1dd1ab){return function(_0x1f9935){if(_0x1f9935){return _0x1f9935[_0x35a9('0x26')]()[_0x35a9('0x27')](function(){_0x133bdf['status'](0xcc)[_0x35a9('0x28')]();});}};}function handleEntityNotFound(_0xc31cd1,_0x98a89b){return function(_0x180472){if(!_0x180472){_0xc31cd1[_0x35a9('0x1a')](0x194);}return _0x180472;};}function handleError(_0x5ba62a,_0x484212){_0x484212=_0x484212||0x1f4;return function(_0x5dfc9f){logger[_0x35a9('0x29')](_0x5dfc9f['stack']);if(_0x5dfc9f[_0x35a9('0x2a')]){delete _0x5dfc9f[_0x35a9('0x2a')];}_0x5ba62a['status'](_0x484212)[_0x35a9('0x2b')](_0x5dfc9f);};}exports['index']=function(_0x1fc384,_0x42b5bd){var _0x59ae09={},_0x534455={},_0x16ee46={'count':0x0,'rows':[]};var _0x207444=_[_0x35a9('0x2c')](db[_0x35a9('0x2d')][_0x35a9('0x2e')],function(_0x15ac13){return{'name':_0x15ac13[_0x35a9('0x2f')],'type':_0x15ac13[_0x35a9('0x30')]['key']};});_0x534455[_0x35a9('0x31')]=_[_0x35a9('0x2c')](_0x207444,_0x35a9('0x2a'));_0x534455[_0x35a9('0x32')]=_[_0x35a9('0x33')](_0x1fc384[_0x35a9('0x32')]);_0x534455['filters']=_[_0x35a9('0x34')](_0x534455[_0x35a9('0x31')],_0x534455[_0x35a9('0x32')]);_0x59ae09['attributes']=_[_0x35a9('0x34')](_0x534455['model'],qs[_0x35a9('0x35')](_0x1fc384[_0x35a9('0x32')][_0x35a9('0x35')]));_0x59ae09[_0x35a9('0x36')]=_0x59ae09[_0x35a9('0x36')][_0x35a9('0x37')]?_0x59ae09['attributes']:_0x534455['model'];if(!_0x1fc384[_0x35a9('0x32')][_0x35a9('0x38')]('nolimit')){_0x59ae09['limit']=qs[_0x35a9('0x1e')](_0x1fc384['query']['limit']);_0x59ae09['offset']=qs[_0x35a9('0x1c')](_0x1fc384[_0x35a9('0x32')]['offset']);}_0x59ae09[_0x35a9('0x39')]=qs[_0x35a9('0x3a')](_0x1fc384[_0x35a9('0x32')][_0x35a9('0x3a')]);_0x59ae09['where']=qs[_0x35a9('0x3b')](_[_0x35a9('0x3c')](_0x1fc384[_0x35a9('0x32')],_0x534455[_0x35a9('0x3b')]),_0x207444);if(_0x1fc384[_0x35a9('0x32')]['filter']){_0x59ae09['where']=_[_0x35a9('0x3d')](_0x59ae09['where'],{'$or':_[_0x35a9('0x2c')](_0x207444,function(_0x22cef6){if(_0x22cef6[_0x35a9('0x30')]!==_0x35a9('0x3e')){var _0x2ef6b7={};_0x2ef6b7[_0x22cef6['name']]={'$like':'%'+_0x1fc384[_0x35a9('0x32')][_0x35a9('0x3f')]+'%'};return _0x2ef6b7;}})});}_0x59ae09=_['merge']({},_0x59ae09,_0x1fc384[_0x35a9('0x40')]);var _0x43a401={'where':_0x59ae09[_0x35a9('0x41')]};return db['JscriptyAnswerReport'][_0x35a9('0x1f')](_0x43a401)[_0x35a9('0x27')](function(_0x5c11ec){_0x16ee46[_0x35a9('0x1f')]=_0x5c11ec;if(_0x1fc384[_0x35a9('0x32')][_0x35a9('0x42')]){_0x59ae09[_0x35a9('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x35a9('0x44')](_0x59ae09);})['then'](function(_0x64c900){_0x16ee46[_0x35a9('0x45')]=_0x64c900;return _0x16ee46;})[_0x35a9('0x27')](respondWithFilteredResult(_0x42b5bd,_0x59ae09))[_0x35a9('0x46')](handleError(_0x42b5bd,null));};exports[_0x35a9('0x47')]=function(_0x12a376,_0x3f721f){var _0x34a560={'raw':!![],'where':{'id':_0x12a376[_0x35a9('0x48')]['id']}},_0x57f10d={};_0x57f10d[_0x35a9('0x31')]=_['keys'](db[_0x35a9('0x2d')][_0x35a9('0x2e')]);_0x57f10d[_0x35a9('0x32')]=_[_0x35a9('0x33')](_0x12a376[_0x35a9('0x32')]);_0x57f10d[_0x35a9('0x3b')]=_[_0x35a9('0x34')](_0x57f10d[_0x35a9('0x31')],_0x57f10d[_0x35a9('0x32')]);_0x34a560[_0x35a9('0x36')]=_[_0x35a9('0x34')](_0x57f10d[_0x35a9('0x31')],qs[_0x35a9('0x35')](_0x12a376[_0x35a9('0x32')][_0x35a9('0x35')]));_0x34a560[_0x35a9('0x36')]=_0x34a560[_0x35a9('0x36')][_0x35a9('0x37')]?_0x34a560[_0x35a9('0x36')]:_0x57f10d[_0x35a9('0x31')];if(_0x12a376[_0x35a9('0x32')]['includeAll']){_0x34a560[_0x35a9('0x43')]=[{'all':!![]}];}_0x34a560=_[_0x35a9('0x3d')]({},_0x34a560,_0x12a376['options']);return db[_0x35a9('0x2d')][_0x35a9('0x49')](_0x34a560)[_0x35a9('0x27')](handleEntityNotFound(_0x3f721f,null))[_0x35a9('0x27')](respondWithResult(_0x3f721f,null))[_0x35a9('0x46')](handleError(_0x3f721f,null));};exports[_0x35a9('0x4a')]=function(_0xa7dd8c,_0x278928){return db[_0x35a9('0x2d')][_0x35a9('0x4a')](_0xa7dd8c['body'],{})[_0x35a9('0x27')](respondWithResult(_0x278928,0xc9))[_0x35a9('0x46')](handleError(_0x278928,null));};exports[_0x35a9('0x25')]=function(_0x36e412,_0x484f8e){if(_0x36e412['body']['id']){delete _0x36e412[_0x35a9('0x4b')]['id'];}return db[_0x35a9('0x2d')][_0x35a9('0x49')]({'where':{'id':_0x36e412[_0x35a9('0x48')]['id']}})['then'](handleEntityNotFound(_0x484f8e,null))[_0x35a9('0x27')](saveUpdates(_0x36e412[_0x35a9('0x4b')],null))['then'](respondWithResult(_0x484f8e,null))[_0x35a9('0x46')](handleError(_0x484f8e,null));};exports[_0x35a9('0x26')]=function(_0x1ddcfb,_0xc6db73){return db[_0x35a9('0x2d')]['find']({'where':{'id':_0x1ddcfb[_0x35a9('0x48')]['id']}})[_0x35a9('0x27')](handleEntityNotFound(_0xc6db73,null))['then'](removeEntity(_0xc6db73,null))[_0x35a9('0x46')](handleError(_0xc6db73,null));};exports[_0x35a9('0x4c')]=function(_0x2cb891,_0x301a8c){return db[_0x35a9('0x2d')][_0x35a9('0x4c')]()[_0x35a9('0x27')](respondWithResult(_0x301a8c,null))[_0x35a9('0x46')](handleError(_0x301a8c,null));};
\ No newline at end of file
index 26e1e3e..8d81d81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe64d=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','lodash','../../config/logger','api','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe64d,0x15c));var _0xde64=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0xe64d[_0xd39959];return _0x1ff69c;};'use strict';var _=require(_0xde64('0x0'));var util=require('util');var logger=require(_0xde64('0x1'))(_0xde64('0x2'));var moment=require(_0xde64('0x3'));var BPromise=require(_0xde64('0x4'));var rp=require(_0xde64('0x5'));var fs=require('fs');var path=require(_0xde64('0x6'));var rimraf=require(_0xde64('0x7'));var config=require(_0xde64('0x8'));var attributes=require(_0xde64('0x9'));module[_0xde64('0xa')]=function(_0xe8c76,_0x1dcb97){return _0xe8c76['define']('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87d6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x5d960e,_0x3cd959){var _0x30d421=function(_0x1e0ebb){while(--_0x1e0ebb){_0x5d960e['push'](_0x5d960e['shift']());}};_0x30d421(++_0x3cd959);}(_0x87d6,0x1a3));var _0x687d=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x87d6[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x687d('0x0'));var util=require(_0x687d('0x1'));var logger=require(_0x687d('0x2'))(_0x687d('0x3'));var moment=require(_0x687d('0x4'));var BPromise=require(_0x687d('0x5'));var rp=require(_0x687d('0x6'));var fs=require('fs');var path=require(_0x687d('0x7'));var rimraf=require(_0x687d('0x8'));var config=require(_0x687d('0x9'));var attributes=require(_0x687d('0xa'));module[_0x687d('0xb')]=function(_0x3d45d2,_0x282c79){return _0x3d45d2[_0x687d('0xc')](_0x687d('0xd'),attributes,{'tableName':_0x687d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b0c1ef6..d4da5d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e8e=['jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x177c0f,_0x324360){var _0x1f4d28=function(_0x49d3f0){while(--_0x49d3f0){_0x177c0f['push'](_0x177c0f['shift']());}};_0x1f4d28(++_0x324360);}(_0x5e8e,0x1db));var _0xe5e8=function(_0x5b445b,_0xd251da){_0x5b445b=_0x5b445b-0x0;var _0x1a40fe=_0x5e8e[_0x5b445b];return _0x1a40fe;};'use strict';var _=require(_0xe5e8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe5e8('0x1'));var rs=require(_0xe5e8('0x2'));var fs=require('fs');var Redis=require(_0xe5e8('0x3'));var db=require(_0xe5e8('0x4'))['db'];var utils=require(_0xe5e8('0x5'));var logger=require('../../config/logger')(_0xe5e8('0x6'));var config=require(_0xe5e8('0x7'));var jayson=require(_0xe5e8('0x8'));var client=jayson[_0xe5e8('0x9')][_0xe5e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x431837,_0x530d18,_0x3e3549){return new BPromise(function(_0x579ff2,_0x5ae1a7){return client[_0xe5e8('0xb')](_0x431837,_0x3e3549)[_0xe5e8('0xc')](function(_0x35d86c){logger['info'](_0xe5e8('0xd'),_0x530d18,_0xe5e8('0xe'));logger[_0xe5e8('0xf')](_0xe5e8('0x10'),_0x530d18,_0xe5e8('0xe'),JSON[_0xe5e8('0x11')](_0x35d86c));if(_0x35d86c[_0xe5e8('0x12')]){if(_0x35d86c[_0xe5e8('0x12')][_0xe5e8('0x13')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x530d18,_0x35d86c[_0xe5e8('0x12')][_0xe5e8('0x14')]);return _0x5ae1a7(_0x35d86c[_0xe5e8('0x12')][_0xe5e8('0x14')]);}logger[_0xe5e8('0x12')](_0xe5e8('0xd'),_0x530d18,_0x35d86c[_0xe5e8('0x12')][_0xe5e8('0x14')]);return _0x579ff2(_0x35d86c[_0xe5e8('0x12')][_0xe5e8('0x14')]);}else{logger[_0xe5e8('0x15')](_0xe5e8('0xd'),_0x530d18,'request\x20sent');_0x579ff2(_0x35d86c[_0xe5e8('0x16')][_0xe5e8('0x14')]);}})['catch'](function(_0x7a07e7){logger[_0xe5e8('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x530d18,_0x7a07e7);_0x5ae1a7(_0x7a07e7);});});}
\ No newline at end of file
+var _0xac14=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e2670,_0x195421){var _0x55280b=function(_0x3b32f1){while(--_0x3b32f1){_0x1e2670['push'](_0x1e2670['shift']());}};_0x55280b(++_0x195421);}(_0xac14,0x1a9));var _0x4ac1=function(_0x5f5544,_0x11b951){_0x5f5544=_0x5f5544-0x0;var _0x18314c=_0xac14[_0x5f5544];return _0x18314c;};'use strict';var _=require(_0x4ac1('0x0'));var util=require('util');var moment=require(_0x4ac1('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ac1('0x2'));var fs=require('fs');var Redis=require(_0x4ac1('0x3'));var db=require(_0x4ac1('0x4'))['db'];var utils=require(_0x4ac1('0x5'));var logger=require(_0x4ac1('0x6'))(_0x4ac1('0x7'));var config=require(_0x4ac1('0x8'));var jayson=require(_0x4ac1('0x9'));var client=jayson[_0x4ac1('0xa')][_0x4ac1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1578f6,_0x26cd9d,_0x3fd96a){return new BPromise(function(_0x3b2e8e,_0x31f88){return client[_0x4ac1('0xc')](_0x1578f6,_0x3fd96a)[_0x4ac1('0xd')](function(_0x4852d0){logger[_0x4ac1('0xe')](_0x4ac1('0xf'),_0x26cd9d,'request\x20sent');logger[_0x4ac1('0x10')](_0x4ac1('0x11'),_0x26cd9d,_0x4ac1('0x12'),JSON[_0x4ac1('0x13')](_0x4852d0));if(_0x4852d0[_0x4ac1('0x14')]){if(_0x4852d0[_0x4ac1('0x14')][_0x4ac1('0x15')]===0x1f4){logger[_0x4ac1('0x14')](_0x4ac1('0xf'),_0x26cd9d,_0x4852d0['error'][_0x4ac1('0x16')]);return _0x31f88(_0x4852d0[_0x4ac1('0x14')][_0x4ac1('0x16')]);}logger['error'](_0x4ac1('0xf'),_0x26cd9d,_0x4852d0['error']['message']);return _0x3b2e8e(_0x4852d0[_0x4ac1('0x14')][_0x4ac1('0x16')]);}else{logger[_0x4ac1('0xe')](_0x4ac1('0xf'),_0x26cd9d,_0x4ac1('0x12'));_0x3b2e8e(_0x4852d0['result'][_0x4ac1('0x16')]);}})[_0x4ac1('0x17')](function(_0x24546b){logger[_0x4ac1('0x14')](_0x4ac1('0xf'),_0x26cd9d,_0x24546b);_0x31f88(_0x24546b);});});}
\ No newline at end of file
index 9ca4931..bb0ee74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a9c=['../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x4e1795,_0x362014){var _0x57e070=function(_0x2c950b){while(--_0x2c950b){_0x4e1795['push'](_0x4e1795['shift']());}};_0x57e070(++_0x362014);}(_0x0a9c,0x159));var _0xc0a9=function(_0x1b7787,_0x2a6e0b){_0x1b7787=_0x1b7787-0x0;var _0x134ceb=_0x0a9c[_0x1b7787];return _0x134ceb;};'use strict';var multer=require(_0xc0a9('0x0'));var util=require('util');var path=require(_0xc0a9('0x1'));var timeout=require(_0xc0a9('0x2'));var express=require('express');var router=express[_0xc0a9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0a9('0x4'));var config=require(_0xc0a9('0x5'));var controller=require(_0xc0a9('0x6'));router[_0xc0a9('0x7')]('/',auth[_0xc0a9('0x8')](),controller['index']);router[_0xc0a9('0x7')](_0xc0a9('0x9'),auth[_0xc0a9('0x8')](),controller[_0xc0a9('0xa')]);router[_0xc0a9('0x7')](_0xc0a9('0xb'),auth[_0xc0a9('0x8')](),controller[_0xc0a9('0xc')]);router[_0xc0a9('0x7')](_0xc0a9('0xd'),auth['isAuthenticated'](),controller[_0xc0a9('0xe')]);router[_0xc0a9('0x7')]('/:id/summary',auth['isAuthenticated'](),timeout(_0xc0a9('0xf')),controller[_0xc0a9('0x10')]);router[_0xc0a9('0x11')]('/',auth[_0xc0a9('0x8')](),controller[_0xc0a9('0x12')]);router[_0xc0a9('0x11')](_0xc0a9('0x13'),auth[_0xc0a9('0x8')](),controller[_0xc0a9('0x14')]);router[_0xc0a9('0x15')](_0xc0a9('0x9'),auth[_0xc0a9('0x8')](),controller[_0xc0a9('0x16')]);router['delete'](_0xc0a9('0x9'),auth[_0xc0a9('0x8')](),controller[_0xc0a9('0x17')]);module[_0xc0a9('0x18')]=router;
\ No newline at end of file
+var _0x2bc1=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/sessions','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','update','/:id','exports','multer','util','path'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x2bc1,0x131));var _0x12bc=function(_0x31be63,_0xfaf7d8){_0x31be63=_0x31be63-0x0;var _0x5a996e=_0x2bc1[_0x31be63];return _0x5a996e;};'use strict';var multer=require(_0x12bc('0x0'));var util=require(_0x12bc('0x1'));var path=require(_0x12bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x12bc('0x3'));var router=express[_0x12bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x12bc('0x5'));var interaction=require(_0x12bc('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x12bc('0x7')]('/',auth[_0x12bc('0x8')](),controller[_0x12bc('0x9')]);router['get']('/:id',auth[_0x12bc('0x8')](),controller[_0x12bc('0xa')]);router[_0x12bc('0x7')](_0x12bc('0xb'),auth['isAuthenticated'](),controller['getSessions']);router['get']('/:id/answers',auth[_0x12bc('0x8')](),controller[_0x12bc('0xc')]);router[_0x12bc('0x7')](_0x12bc('0xd'),auth[_0x12bc('0x8')](),timeout('30s'),controller[_0x12bc('0xe')]);router[_0x12bc('0xf')]('/',auth[_0x12bc('0x8')](),controller[_0x12bc('0x10')]);router[_0x12bc('0xf')](_0x12bc('0x11'),auth[_0x12bc('0x8')](),controller[_0x12bc('0x12')]);router['put']('/:id',auth[_0x12bc('0x8')](),controller[_0x12bc('0x13')]);router['delete'](_0x12bc('0x14'),auth[_0x12bc('0x8')](),controller['destroy']);module[_0x12bc('0x15')]=router;
\ No newline at end of file
index db837f6..b0faff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e50=['lodash','util','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','name','getDataValue','description','BOOLEAN','sequelize'];(function(_0x1d7791,_0x2a291f){var _0x2293f8=function(_0x464734){while(--_0x464734){_0x1d7791['push'](_0x1d7791['shift']());}};_0x2293f8(++_0x2a291f);}(_0x7e50,0x87));var _0x07e5=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0x7e50[_0x22f85a];return _0xaa717;};'use strict';var Sequelize=require(_0x07e5('0x0'));var _=require(_0x07e5('0x1'));var util=require(_0x07e5('0x2'));module[_0x07e5('0x3')]={'name':{'type':Sequelize[_0x07e5('0x4')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x07e5('0x5')](_0x07e5('0x6')),'set':function(_0x1f09e5){if(_[_0x07e5('0x7')](_0x1f09e5)){this[_0x07e5('0x8')](_0x07e5('0x9'),JSON[_0x07e5('0xa')](_0x1f09e5));}else if(_[_0x07e5('0xb')](_0x1f09e5)){this[_0x07e5('0x8')](_0x07e5('0x9'),_0x1f09e5);}else{this[_0x07e5('0x8')](_0x07e5('0x9'),util[_0x07e5('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x07e5('0xd'))||'',this[_0x07e5('0xe')](_0x07e5('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x07e5('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x07e5('0x10')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbd2a=['getDataValue','BOOLEAN','util','exports','name','STRING','TEXT','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x36f23a,_0x392225){var _0x29689e=function(_0x583193){while(--_0x583193){_0x36f23a['push'](_0x36f23a['shift']());}};_0x29689e(++_0x392225);}(_0xbd2a,0xc2));var _0xabd2=function(_0x30299b,_0x54b8f0){_0x30299b=_0x30299b-0x0;var _0x294256=_0xbd2a[_0x30299b];return _0x294256;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0xabd2('0x0'));module[_0xabd2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xabd2('0x2')},'description':{'type':Sequelize[_0xabd2('0x3')]},'formData':{'type':Sequelize[_0xabd2('0x4')]('long'),'set':function(_0x372799){if(_[_0xabd2('0x5')](_0x372799)){this[_0xabd2('0x6')](_0xabd2('0x7'),JSON[_0xabd2('0x8')](_0x372799));}else if(_[_0xabd2('0x9')](_0x372799)){this[_0xabd2('0x6')](_0xabd2('0x7'),_0x372799);}else{this[_0xabd2('0x6')](_0xabd2('0x7'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xabd2('0xa')](_0xabd2('0x2'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xabd2('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xabd2('0xb')],'defaultValue':![]}};
\ No newline at end of file
index 6c976d1..60d9077 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf84a=['updatedAt','body','UserProfileSection','userProfileId','update','getSessions','findOne','JscriptySessionReport','pick','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','getSummary','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','then','get','Projects','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','JscriptyProject','include','rows','catch','show','params','keys','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf84a,0x97));var _0xaf84=function(_0x271be6,_0x27ed98){_0x271be6=_0x271be6-0x0;var _0x15588b=_0xf84a[_0x271be6];return _0x15588b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf84('0x0'));var jsonpatch=require(_0xaf84('0x1'));var rp=require(_0xaf84('0x2'));var moment=require(_0xaf84('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaf84('0x4'));var util=require(_0xaf84('0x5'));var path=require('path');var sox=require(_0xaf84('0x6'));var csv=require(_0xaf84('0x7'));var ejs=require(_0xaf84('0x8'));var fs=require('fs');var fs_extra=require(_0xaf84('0x9'));var _=require('lodash');var squel=require(_0xaf84('0xa'));var crypto=require(_0xaf84('0xb'));var jsforce=require(_0xaf84('0xc'));var deskjs=require(_0xaf84('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaf84('0xe'));var Papa=require(_0xaf84('0xf'));var Redis=require(_0xaf84('0x10'));var authService=require(_0xaf84('0x11'));var qs=require(_0xaf84('0x12'));var as=require(_0xaf84('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xaf84('0x14'));var licenseUtil=require(_0xaf84('0x15'));var db=require(_0xaf84('0x16'))['db'];function respondWithStatusCode(_0x4124c4,_0x1e8bff){_0x1e8bff=_0x1e8bff||0xcc;return function(_0x1024af){if(_0x1024af){return _0x4124c4[_0xaf84('0x17')](_0x1e8bff);}return _0x4124c4[_0xaf84('0x18')](_0x1e8bff)['end']();};}function respondWithResult(_0x26673f,_0x387c02){_0x387c02=_0x387c02||0xc8;return function(_0x4fb427){if(_0x4fb427){return _0x26673f[_0xaf84('0x18')](_0x387c02)[_0xaf84('0x19')](_0x4fb427);}};}function respondWithFilteredResult(_0x48e183,_0x1230fb){return function(_0x3ee365){if(_0x3ee365){var _0x178ad0=typeof _0x1230fb[_0xaf84('0x1a')]===_0xaf84('0x1b')&&typeof _0x1230fb[_0xaf84('0x1c')]===_0xaf84('0x1b');var _0xeffecc=_0x3ee365[_0xaf84('0x1d')];var _0x500c2b=_0x178ad0?0x0:_0x1230fb[_0xaf84('0x1a')];var _0x4585ec=_0x178ad0?_0x3ee365[_0xaf84('0x1d')]:_0x1230fb[_0xaf84('0x1a')]+_0x1230fb[_0xaf84('0x1c')];var _0x2d0f5e;if(_0x4585ec>=_0xeffecc){_0x4585ec=_0xeffecc;_0x2d0f5e=0xc8;}else{_0x2d0f5e=0xce;}_0x48e183[_0xaf84('0x18')](_0x2d0f5e);return _0x48e183['set']('Content-Range',_0x500c2b+'-'+_0x4585ec+'/'+_0xeffecc)['json'](_0x3ee365);}return null;};}function patchUpdates(_0x4bba40){return function(_0x4fd425){try{jsonpatch['apply'](_0x4fd425,_0x4bba40,!![]);}catch(_0x472deb){return BPromise[_0xaf84('0x1e')](_0x472deb);}return _0x4fd425[_0xaf84('0x1f')]();};}function saveUpdates(_0x56f169,_0x20f79f){return function(_0x10d7ca){if(_0x10d7ca){return _0x10d7ca['update'](_0x56f169)[_0xaf84('0x20')](function(_0x1c797c){return _0x1c797c;});}return null;};}function removeEntity(_0x1e7756,_0x228199){return function(_0x70a624){if(_0x70a624){return _0x70a624['destroy']()[_0xaf84('0x20')](function(){var _0x120c43=_0x70a624[_0xaf84('0x21')]({'plain':!![]});var _0x5b2e54=_0xaf84('0x22');return db[_0xaf84('0x23')]['destroy']({'where':{'type':_0x5b2e54,'resourceId':_0x120c43['id']}})[_0xaf84('0x20')](function(){return _0x70a624;});})[_0xaf84('0x20')](function(){_0x1e7756[_0xaf84('0x18')](0xcc)[_0xaf84('0x24')]();});}};}function handleEntityNotFound(_0x3f07c3,_0x2991f2){return function(_0x3b1dec){if(!_0x3b1dec){_0x3f07c3[_0xaf84('0x17')](0x194);}return _0x3b1dec;};}function handleError(_0x4d861,_0x3eae33){_0x3eae33=_0x3eae33||0x1f4;return function(_0x4116e9){logger['error'](_0x4116e9['stack']);if(_0x4116e9[_0xaf84('0x25')]){delete _0x4116e9['name'];}_0x4d861[_0xaf84('0x18')](_0x3eae33)[_0xaf84('0x26')](_0x4116e9);};}exports[_0xaf84('0x27')]=function(_0x3d3aa1,_0x26b6f8){var _0x3b2f9d={},_0x17abde={},_0xe9811f={'count':0x0,'rows':[]};var _0xe0d5b5=_[_0xaf84('0x28')](db['JscriptyProject'][_0xaf84('0x29')],function(_0x1ea648){return{'name':_0x1ea648[_0xaf84('0x2a')],'type':_0x1ea648['type'][_0xaf84('0x2b')]};});_0x17abde[_0xaf84('0x2c')]=_[_0xaf84('0x28')](_0xe0d5b5,_0xaf84('0x25'));_0x17abde['query']=_['keys'](_0x3d3aa1[_0xaf84('0x2d')]);_0x17abde[_0xaf84('0x2e')]=_[_0xaf84('0x2f')](_0x17abde['model'],_0x17abde['query']);_0x3b2f9d[_0xaf84('0x30')]=_['intersection'](_0x17abde[_0xaf84('0x2c')],qs['fields'](_0x3d3aa1[_0xaf84('0x2d')][_0xaf84('0x31')]));_0x3b2f9d[_0xaf84('0x30')]=_0x3b2f9d[_0xaf84('0x30')][_0xaf84('0x32')]?_0x3b2f9d['attributes']:_0x17abde[_0xaf84('0x2c')];if(!_0x3d3aa1[_0xaf84('0x2d')][_0xaf84('0x33')](_0xaf84('0x34'))){_0x3b2f9d[_0xaf84('0x1c')]=qs[_0xaf84('0x1c')](_0x3d3aa1[_0xaf84('0x2d')][_0xaf84('0x1c')]);_0x3b2f9d['offset']=qs['offset'](_0x3d3aa1[_0xaf84('0x2d')][_0xaf84('0x1a')]);}_0x3b2f9d[_0xaf84('0x35')]=qs[_0xaf84('0x36')](_0x3d3aa1['query'][_0xaf84('0x36')]);_0x3b2f9d['where']=qs[_0xaf84('0x2e')](_['pick'](_0x3d3aa1[_0xaf84('0x2d')],_0x17abde[_0xaf84('0x2e')]),_0xe0d5b5);if(_0x3d3aa1[_0xaf84('0x2d')][_0xaf84('0x37')]){_0x3b2f9d[_0xaf84('0x38')]=_[_0xaf84('0x39')](_0x3b2f9d[_0xaf84('0x38')],{'$or':_[_0xaf84('0x28')](_0xe0d5b5,function(_0x261a09){if(_0x261a09[_0xaf84('0x3a')]!==_0xaf84('0x3b')){var _0x377a81={};_0x377a81[_0x261a09['name']]={'$like':'%'+_0x3d3aa1[_0xaf84('0x2d')]['filter']+'%'};return _0x377a81;}})});}_0x3b2f9d=_[_0xaf84('0x39')]({},_0x3b2f9d,_0x3d3aa1[_0xaf84('0x3c')]);var _0x733b09={'where':_0x3b2f9d['where']};return db[_0xaf84('0x3d')]['count'](_0x733b09)[_0xaf84('0x20')](function(_0x15f716){_0xe9811f[_0xaf84('0x1d')]=_0x15f716;if(_0x3d3aa1[_0xaf84('0x2d')]['includeAll']){_0x3b2f9d[_0xaf84('0x3e')]=[{'all':!![]}];}return db[_0xaf84('0x3d')]['findAll'](_0x3b2f9d);})[_0xaf84('0x20')](function(_0x863233){_0xe9811f[_0xaf84('0x3f')]=_0x863233;return _0xe9811f;})[_0xaf84('0x20')](respondWithFilteredResult(_0x26b6f8,_0x3b2f9d))[_0xaf84('0x40')](handleError(_0x26b6f8,null));};exports[_0xaf84('0x41')]=function(_0x3c1df3,_0x42b117){var _0x67089b={'raw':![],'where':{'id':_0x3c1df3[_0xaf84('0x42')]['id']}},_0x2489bf={};_0x2489bf[_0xaf84('0x2c')]=_[_0xaf84('0x43')](db['JscriptyProject'][_0xaf84('0x29')]);_0x2489bf[_0xaf84('0x2d')]=_[_0xaf84('0x43')](_0x3c1df3[_0xaf84('0x2d')]);_0x2489bf[_0xaf84('0x2e')]=_[_0xaf84('0x2f')](_0x2489bf[_0xaf84('0x2c')],_0x2489bf[_0xaf84('0x2d')]);_0x67089b['attributes']=_[_0xaf84('0x2f')](_0x2489bf[_0xaf84('0x2c')],qs['fields'](_0x3c1df3['query'][_0xaf84('0x31')]));_0x67089b['attributes']=_0x67089b['attributes'][_0xaf84('0x32')]?_0x67089b['attributes']:_0x2489bf['model'];if(_0x3c1df3[_0xaf84('0x2d')][_0xaf84('0x44')]){_0x67089b[_0xaf84('0x3e')]=[{'all':!![]}];}_0x67089b=_[_0xaf84('0x39')]({},_0x67089b,_0x3c1df3[_0xaf84('0x3c')]);return db[_0xaf84('0x3d')][_0xaf84('0x45')](_0x67089b)[_0xaf84('0x20')](handleEntityNotFound(_0x42b117,null))[_0xaf84('0x20')](respondWithResult(_0x42b117,null))[_0xaf84('0x40')](handleError(_0x42b117,null));};exports[_0xaf84('0x46')]=function(_0x167fa3,_0x46f95a){return db[_0xaf84('0x3d')][_0xaf84('0x46')](_0x167fa3['body'],{})[_0xaf84('0x20')](function(_0x3aef01){var _0x5bdd12=_0x167fa3['user'][_0xaf84('0x21')]({'plain':!![]});if(!_0x5bdd12)throw new Error(_0xaf84('0x47'));if(_0x5bdd12[_0xaf84('0x48')]==='user'){var _0x45d561=_0x3aef01['get']({'plain':!![]});var _0x1cb252=_0xaf84('0x22');return db['UserProfileSection'][_0xaf84('0x45')]({'where':{'name':_0x1cb252,'userProfileId':_0x5bdd12['userProfileId']},'raw':!![]})[_0xaf84('0x20')](function(_0x2dbc82){if(_0x2dbc82&&_0x2dbc82[_0xaf84('0x49')]===0x0){return db['UserProfileResource'][_0xaf84('0x46')]({'name':_0x45d561['name'],'resourceId':_0x45d561['id'],'type':_0x2dbc82[_0xaf84('0x25')],'sectionId':_0x2dbc82['id']},{})[_0xaf84('0x20')](function(){return _0x3aef01;});}else{return _0x3aef01;}})[_0xaf84('0x40')](function(_0x3f91ff){logger[_0xaf84('0x4a')](_0xaf84('0x4b'),_0x3f91ff);throw _0x3f91ff;});}return _0x3aef01;})['then'](respondWithResult(_0x46f95a,0xc9))[_0xaf84('0x40')](handleError(_0x46f95a,null));};exports[_0xaf84('0x4c')]=function(_0x231ac3,_0x325150){var _0x2b8d37={'where':{'id':_0x231ac3[_0xaf84('0x42')]['id']}},_0x32ed29={};_0x32ed29[_0xaf84('0x2c')]=_[_0xaf84('0x43')](db[_0xaf84('0x3d')]['rawAttributes']);_0x2b8d37[_0xaf84('0x30')]=_['intersection'](_0x32ed29['model'],qs['fields'](_0x231ac3[_0xaf84('0x2d')]['fields']));_0x2b8d37[_0xaf84('0x30')]=_0x2b8d37['attributes']['length']?_0x2b8d37['attributes']:_0x32ed29['model'];if(_0x231ac3[_0xaf84('0x2d')][_0xaf84('0x44')]){_0x2b8d37['include']=[{'all':!![]}];}_0x2b8d37=_[_0xaf84('0x39')]({},_0x2b8d37,_0x231ac3['options']);return db[_0xaf84('0x3d')][_0xaf84('0x45')](_0x2b8d37)['then'](handleEntityNotFound(_0x325150,null))[_0xaf84('0x20')](function(_0x57b2b2){if(_0x57b2b2){var _0x23dfa4=_0x57b2b2[_0xaf84('0x21')]({'plain':!![]});_0x23dfa4=qs[_0xaf84('0x4d')](_0x23dfa4,['id',_0xaf84('0x4e'),_0xaf84('0x4f')]);_0x231ac3[_0xaf84('0x50')]=_[_0xaf84('0x4d')](_0x231ac3[_0xaf84('0x50')],['id',_0xaf84('0x4e'),_0xaf84('0x4f')]);return db[_0xaf84('0x3d')][_0xaf84('0x46')](_[_0xaf84('0x39')](_0x23dfa4,_0x231ac3[_0xaf84('0x50')]),{'include':_0x231ac3[_0xaf84('0x2d')][_0xaf84('0x44')]?[{'all':!![]}]:undefined})[_0xaf84('0x20')](function(_0x336325){var _0x16c60e=_0x231ac3['user'][_0xaf84('0x21')]({'plain':!![]});if(!_0x16c60e)throw new Error(_0xaf84('0x47'));if(_0x16c60e['role']==='user'){var _0x4a70aa=_0x336325['get']({'plain':!![]});var _0x33cf63=_0xaf84('0x22');return db[_0xaf84('0x51')][_0xaf84('0x45')]({'where':{'name':_0x33cf63,'userProfileId':_0x16c60e[_0xaf84('0x52')]},'raw':!![]})[_0xaf84('0x20')](function(_0x178f3d){if(_0x178f3d&&_0x178f3d['autoAssociation']===0x0){return db[_0xaf84('0x23')][_0xaf84('0x46')]({'name':_0x4a70aa['name'],'resourceId':_0x4a70aa['id'],'type':_0x178f3d[_0xaf84('0x25')],'sectionId':_0x178f3d['id']},{})[_0xaf84('0x20')](function(){return _0x336325;});}else{return _0x336325;}})[_0xaf84('0x40')](function(_0x1d4934){logger['error'](_0xaf84('0x4b'),_0x1d4934);throw _0x1d4934;});}return _0x336325;});}})[_0xaf84('0x20')](respondWithResult(_0x325150,0xc9))[_0xaf84('0x40')](handleError(_0x325150,null));};exports[_0xaf84('0x53')]=function(_0x551695,_0x17ac57){if(_0x551695[_0xaf84('0x50')]['id']){delete _0x551695[_0xaf84('0x50')]['id'];}return db[_0xaf84('0x3d')][_0xaf84('0x45')]({'where':{'id':_0x551695[_0xaf84('0x42')]['id']}})[_0xaf84('0x20')](handleEntityNotFound(_0x17ac57,null))['then'](saveUpdates(_0x551695[_0xaf84('0x50')],null))[_0xaf84('0x20')](respondWithResult(_0x17ac57,null))[_0xaf84('0x40')](handleError(_0x17ac57,null));};exports['destroy']=function(_0x362521,_0x22effa){return db[_0xaf84('0x3d')][_0xaf84('0x45')]({'where':{'id':_0x362521[_0xaf84('0x42')]['id']}})[_0xaf84('0x20')](handleEntityNotFound(_0x22effa,null))[_0xaf84('0x20')](removeEntity(_0x22effa,null))[_0xaf84('0x40')](handleError(_0x22effa,null));};exports[_0xaf84('0x54')]=function(_0x2c27ed,_0x2b2f13,_0x331e33){var _0x93793b={'raw':!![],'where':{}};var _0x2481e8={};var _0x1981cb={'count':0x0,'rows':[]};return db[_0xaf84('0x3d')][_0xaf84('0x55')]({'where':{'id':_0x2c27ed[_0xaf84('0x42')]['id']}})[_0xaf84('0x20')](handleEntityNotFound(_0x2b2f13,null))['then'](function(_0x1ba716){if(_0x1ba716){_0x2481e8[_0xaf84('0x2c')]=_['keys'](db[_0xaf84('0x56')]['rawAttributes']);_0x2481e8[_0xaf84('0x2d')]=_[_0xaf84('0x43')](_0x2c27ed[_0xaf84('0x2d')]);_0x2481e8[_0xaf84('0x2e')]=_[_0xaf84('0x2f')](_0x2481e8[_0xaf84('0x2c')],_0x2481e8['query']);_0x93793b[_0xaf84('0x30')]=_[_0xaf84('0x2f')](_0x2481e8[_0xaf84('0x2c')],qs[_0xaf84('0x31')](_0x2c27ed[_0xaf84('0x2d')][_0xaf84('0x31')]));_0x93793b[_0xaf84('0x30')]=_0x93793b[_0xaf84('0x30')][_0xaf84('0x32')]?_0x93793b[_0xaf84('0x30')]:_0x2481e8[_0xaf84('0x2c')];if(!_0x2c27ed[_0xaf84('0x2d')][_0xaf84('0x33')]('nolimit')){_0x93793b[_0xaf84('0x1c')]=qs['limit'](_0x2c27ed[_0xaf84('0x2d')][_0xaf84('0x1c')]);_0x93793b[_0xaf84('0x1a')]=qs[_0xaf84('0x1a')](_0x2c27ed[_0xaf84('0x2d')][_0xaf84('0x1a')]);}_0x93793b[_0xaf84('0x35')]=qs['sort'](_0x2c27ed[_0xaf84('0x2d')][_0xaf84('0x36')]);_0x93793b['where']=qs[_0xaf84('0x2e')](_[_0xaf84('0x57')](_0x2c27ed['query'],_0x2481e8['filters']));_0x93793b[_0xaf84('0x38')][_0xaf84('0x58')]=_0x1ba716['id'];if(_0x2c27ed[_0xaf84('0x2d')][_0xaf84('0x37')]){_0x93793b[_0xaf84('0x38')]=_[_0xaf84('0x39')](_0x93793b['where'],{'$or':_[_0xaf84('0x28')](_0x93793b[_0xaf84('0x30')],function(_0x8467b0){var _0x47e27b={};_0x47e27b[_0x8467b0]={'$like':'%'+_0x2c27ed[_0xaf84('0x2d')][_0xaf84('0x37')]+'%'};return _0x47e27b;})});}_0x93793b=_[_0xaf84('0x39')]({},_0x93793b,_0x2c27ed[_0xaf84('0x3c')]);return db[_0xaf84('0x56')][_0xaf84('0x1d')]({'where':_0x93793b[_0xaf84('0x38')]})[_0xaf84('0x20')](function(_0x270406){_0x1981cb[_0xaf84('0x1d')]=_0x270406;if(_0x2c27ed['query'][_0xaf84('0x44')]){_0x93793b[_0xaf84('0x3e')]=[{'all':!![]}];}return db[_0xaf84('0x56')][_0xaf84('0x59')](_0x93793b);})[_0xaf84('0x20')](function(_0x4f28cc){_0x1981cb[_0xaf84('0x3f')]=_0x4f28cc;return _0x1981cb;});}})[_0xaf84('0x20')](respondWithFilteredResult(_0x2b2f13,_0x93793b))[_0xaf84('0x40')](handleError(_0x2b2f13,null));};exports[_0xaf84('0x5a')]=function(_0x519105,_0x281f58,_0x207f4f){var _0x2ec4e8={'raw':!![],'where':{}};var _0x21be53={};var _0x641d7d={'count':0x0,'rows':[]};return db[_0xaf84('0x3d')]['findOne']({'where':{'id':_0x519105[_0xaf84('0x42')]['id']}})[_0xaf84('0x20')](handleEntityNotFound(_0x281f58,null))[_0xaf84('0x20')](function(_0x1dca82){if(_0x1dca82){_0x21be53['model']=_[_0xaf84('0x43')](db['JscriptyAnswerReport']['rawAttributes']);_0x21be53[_0xaf84('0x2d')]=_['keys'](_0x519105[_0xaf84('0x2d')]);_0x21be53[_0xaf84('0x2e')]=_['intersection'](_0x21be53[_0xaf84('0x2c')],_0x21be53[_0xaf84('0x2d')]);_0x2ec4e8['attributes']=_[_0xaf84('0x2f')](_0x21be53[_0xaf84('0x2c')],qs[_0xaf84('0x31')](_0x519105[_0xaf84('0x2d')]['fields']));_0x2ec4e8['attributes']=_0x2ec4e8['attributes'][_0xaf84('0x32')]?_0x2ec4e8['attributes']:_0x21be53[_0xaf84('0x2c')];if(!_0x519105[_0xaf84('0x2d')][_0xaf84('0x33')](_0xaf84('0x34'))){_0x2ec4e8[_0xaf84('0x1c')]=qs[_0xaf84('0x1c')](_0x519105[_0xaf84('0x2d')][_0xaf84('0x1c')]);_0x2ec4e8['offset']=qs[_0xaf84('0x1a')](_0x519105[_0xaf84('0x2d')][_0xaf84('0x1a')]);}_0x2ec4e8['order']=qs['sort'](_0x519105[_0xaf84('0x2d')][_0xaf84('0x36')]);_0x2ec4e8[_0xaf84('0x38')]=qs[_0xaf84('0x2e')](_[_0xaf84('0x57')](_0x519105[_0xaf84('0x2d')],_0x21be53[_0xaf84('0x2e')]));_0x2ec4e8[_0xaf84('0x38')][_0xaf84('0x58')]=_0x1dca82['id'];if(_0x519105['query'][_0xaf84('0x37')]){_0x2ec4e8['where']=_['merge'](_0x2ec4e8[_0xaf84('0x38')],{'$or':_['map'](_0x2ec4e8['attributes'],function(_0x457302){var _0x232e90={};_0x232e90[_0x457302]={'$like':'%'+_0x519105['query'][_0xaf84('0x37')]+'%'};return _0x232e90;})});}_0x2ec4e8=_['merge']({},_0x2ec4e8,_0x519105[_0xaf84('0x3c')]);return db[_0xaf84('0x5b')][_0xaf84('0x1d')]({'where':_0x2ec4e8[_0xaf84('0x38')]})['then'](function(_0x4b5b8c){_0x641d7d[_0xaf84('0x1d')]=_0x4b5b8c;if(_0x519105[_0xaf84('0x2d')][_0xaf84('0x44')]){_0x2ec4e8[_0xaf84('0x3e')]=[{'all':!![]}];}return db[_0xaf84('0x5b')][_0xaf84('0x59')](_0x2ec4e8);})[_0xaf84('0x20')](function(_0x28f69d){_0x641d7d[_0xaf84('0x3f')]=_0x28f69d;return _0x641d7d;});}})[_0xaf84('0x20')](respondWithFilteredResult(_0x281f58,_0x2ec4e8))[_0xaf84('0x40')](handleError(_0x281f58,null));};function char(_0x452ccb){return _0xaf84('0x5c')===typeof _0x452ccb?String[_0xaf84('0x5d')][_0xaf84('0x5e')](null,arguments):_0x452ccb;}function needsEncapsulation(_0x2d2ccd){return!!_0x2d2ccd&&(_0x2d2ccd[_0xaf84('0x5f')]()['indexOf'](char(0xd))>=0x0||_0x2d2ccd[_0xaf84('0x5f')]()[_0xaf84('0x60')](char(0xa))>=0x0||_0x2d2ccd[_0xaf84('0x5f')]()[_0xaf84('0x60')](char(0x2c))>=0x0||_0x2d2ccd['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x358524){var _0xe132d3=char(0x22),_0x4e8546='\x5c'+char(0x22),_0x407a05=_0x358524[_0xaf84('0x5f')]()['replace'](new RegExp(_0xe132d3,'g'),_0x4e8546);return _0xe132d3+_0x407a05+_0xe132d3;}exports[_0xaf84('0x61')]=function(_0x415705,_0xdb351,_0x38b600){var _0x873e69,_0x1bc598;var _0x4d7b08={'where':{'ProjectId':_0x415705['params']['id']}};if(_0x415705[_0xaf84('0x2d')]['startTime']){_0x4d7b08[_0xaf84('0x38')][_0xaf84('0x62')]=JSON[_0xaf84('0x63')](_0x415705[_0xaf84('0x2d')]['startTime']);}return db[_0xaf84('0x56')][_0xaf84('0x59')](_0x4d7b08)[_0xaf84('0x20')](handleEntityNotFound(_0xdb351,null))[_0xaf84('0x20')](function(_0x5a8578){if(_0x5a8578){_0x873e69=_0x5a8578;return db[_0xaf84('0x64')][_0xaf84('0x59')]({'where':{'SessionId':{'$in':_['map'](_0x873e69,'id')},'ProjectId':_0x415705['params']['id']},'order':'-createdAt'});}})[_0xaf84('0x20')](handleEntityNotFound(_0xdb351,null))[_0xaf84('0x20')](function(_0x5e69b4){if(_0x5e69b4){_0x1bc598=_0x5e69b4;var _0x3be43f={};for(var _0x12ed45=0x0,_0x1bef7a=_0x1bc598[_0xaf84('0x32')];_0x12ed45<_0x1bef7a;_0x12ed45++){if(!_0x3be43f[_0xaf84('0x33')](_0x1bc598[_0x12ed45]['questionId'])){_0x3be43f[_0x1bc598[_0x12ed45][_0xaf84('0x65')]]=needsEncapsulation(_0x1bc598[_0x12ed45]['question'])?encapsulate(_0x1bc598[_0x12ed45][_0xaf84('0x66')]):_0x1bc598[_0x12ed45]['question'];}}var _0x20f524=[],_0x583014={};for(var _0x2a1ba7=0x0,_0x397750=_0x873e69['length'];_0x2a1ba7<_0x397750;_0x2a1ba7++){_0x583014={'ProjectId':_0x415705[_0xaf84('0x42')]['id'],'SessionId':_0x873e69[_0x2a1ba7]['id'],'StartTime':moment(_0x873e69[_0x2a1ba7][_0xaf84('0x62')])[_0xaf84('0x67')](_0xaf84('0x68'))};for(var _0x53b9df=0x0,_0x2a065f=_0x1bc598[_0xaf84('0x32')];_0x53b9df<_0x2a065f;_0x53b9df++){if(_0x1bc598[_0x53b9df][_0xaf84('0x69')]==_0x873e69[_0x2a1ba7]['id']&&_0x3be43f[_0xaf84('0x33')](_0x1bc598[_0x53b9df]['questionId'])){_0x583014[_0x3be43f[_0x1bc598[_0x53b9df][_0xaf84('0x65')]]]=_0x1bc598[_0x53b9df][_0xaf84('0x6a')];}}for(var _0x512ea0 in _0x3be43f){if(!_0x583014[_0xaf84('0x33')](_0x3be43f[_0x512ea0])){_0x583014[_0x3be43f[_0x512ea0]]=null;}}_0x20f524[_0xaf84('0x6b')](_0x583014);}return _0x20f524;}})[_0xaf84('0x20')](function(_0x102256){if(!_['isEmpty'](_0x102256)){var _0x3d726a=toCsv(_0x102256);var _0x395f08=Date['now']();fs['writeFileSync'](util[_0xaf84('0x67')](_0xaf84('0x6c'),_0x415705[_0xaf84('0x42')]['id'],_0x395f08),_0x3d726a);_0xdb351[_0xaf84('0x6d')](_0xaf84('0x6e'),_0xaf84('0x6f')+util[_0xaf84('0x67')](_0xaf84('0x70'),_0x415705[_0xaf84('0x42')]['id'],_0x395f08));_0xdb351['setHeader']('Content-type',_0xaf84('0x71'));return _0xdb351[_0xaf84('0x72')](util[_0xaf84('0x67')](_0xaf84('0x6c'),_0x415705[_0xaf84('0x42')]['id'],_0x395f08));}else{return _0xdb351['sendStatus'](0xcc);}})['catch'](handleError(_0xdb351,null));};
\ No newline at end of file
+var _0x9656=['startTime','starttime','parse','-createdAt','questionId','question','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','moment','path','to-csv','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','Projects','UserProfileResource','error','name','send','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','update','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace'];(function(_0x1fe7bf,_0x24493f){var _0x340e1f=function(_0x4e13df){while(--_0x4e13df){_0x1fe7bf['push'](_0x1fe7bf['shift']());}};_0x340e1f(++_0x24493f);}(_0x9656,0x15e));var _0x6965=function(_0x12d933,_0x29afe4){_0x12d933=_0x12d933-0x0;var _0x312ffe=_0x9656[_0x12d933];return _0x312ffe;};'use strict';var emlformat=require(_0x6965('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6965('0x1'));var jsonpatch=require(_0x6965('0x2'));var rp=require('request-promise');var moment=require(_0x6965('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6965('0x4'));var sox=require('sox');var csv=require(_0x6965('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6965('0x6'));var _=require('lodash');var squel=require(_0x6965('0x7'));var crypto=require(_0x6965('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6965('0x5'));var querystring=require(_0x6965('0x9'));var Papa=require(_0x6965('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6965('0xb'));var hardwareService=require(_0x6965('0xc'));var logger=require(_0x6965('0xd'))('api');var utils=require(_0x6965('0xe'));var config=require(_0x6965('0xf'));var licenseUtil=require(_0x6965('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48a1d0,_0x396c0a){_0x396c0a=_0x396c0a||0xcc;return function(_0x585d14){if(_0x585d14){return _0x48a1d0[_0x6965('0x11')](_0x396c0a);}return _0x48a1d0[_0x6965('0x12')](_0x396c0a)[_0x6965('0x13')]();};}function respondWithResult(_0x509f01,_0x2d52d5){_0x2d52d5=_0x2d52d5||0xc8;return function(_0x209912){if(_0x209912){return _0x509f01[_0x6965('0x12')](_0x2d52d5)[_0x6965('0x14')](_0x209912);}};}function respondWithFilteredResult(_0x3777b1,_0xd759ba){return function(_0x35e280){if(_0x35e280){var _0x40e4f3=typeof _0xd759ba[_0x6965('0x15')]===_0x6965('0x16')&&typeof _0xd759ba[_0x6965('0x17')]==='undefined';var _0x17f50e=_0x35e280[_0x6965('0x18')];var _0xc31577=_0x40e4f3?0x0:_0xd759ba['offset'];var _0x31e3f5=_0x40e4f3?_0x35e280[_0x6965('0x18')]:_0xd759ba[_0x6965('0x15')]+_0xd759ba[_0x6965('0x17')];var _0x130eff;if(_0x31e3f5>=_0x17f50e){_0x31e3f5=_0x17f50e;_0x130eff=0xc8;}else{_0x130eff=0xce;}_0x3777b1['status'](_0x130eff);return _0x3777b1[_0x6965('0x19')](_0x6965('0x1a'),_0xc31577+'-'+_0x31e3f5+'/'+_0x17f50e)[_0x6965('0x14')](_0x35e280);}return null;};}function patchUpdates(_0x263adc){return function(_0x5b9561){try{jsonpatch[_0x6965('0x1b')](_0x5b9561,_0x263adc,!![]);}catch(_0x414498){return BPromise['reject'](_0x414498);}return _0x5b9561[_0x6965('0x1c')]();};}function saveUpdates(_0x213e2c,_0x19148a){return function(_0x4e5015){if(_0x4e5015){return _0x4e5015['update'](_0x213e2c)[_0x6965('0x1d')](function(_0x38fd5b){return _0x38fd5b;});}return null;};}function removeEntity(_0x416ae4,_0x47d18b){return function(_0x175585){if(_0x175585){return _0x175585[_0x6965('0x1e')]()[_0x6965('0x1d')](function(){var _0x16a64a=_0x175585[_0x6965('0x1f')]({'plain':!![]});var _0x1726bb=_0x6965('0x20');return db[_0x6965('0x21')][_0x6965('0x1e')]({'where':{'type':_0x1726bb,'resourceId':_0x16a64a['id']}})[_0x6965('0x1d')](function(){return _0x175585;});})[_0x6965('0x1d')](function(){_0x416ae4[_0x6965('0x12')](0xcc)[_0x6965('0x13')]();});}};}function handleEntityNotFound(_0x4cf5ce,_0xd2e675){return function(_0x5ab0df){if(!_0x5ab0df){_0x4cf5ce[_0x6965('0x11')](0x194);}return _0x5ab0df;};}function handleError(_0x4fa13c,_0x1ee288){_0x1ee288=_0x1ee288||0x1f4;return function(_0x1ae67e){logger[_0x6965('0x22')](_0x1ae67e['stack']);if(_0x1ae67e[_0x6965('0x23')]){delete _0x1ae67e[_0x6965('0x23')];}_0x4fa13c[_0x6965('0x12')](_0x1ee288)[_0x6965('0x24')](_0x1ae67e);};}exports['index']=function(_0x35f56b,_0x16b353){var _0x144df0={},_0x5c36e7={},_0x49c8e8={'count':0x0,'rows':[]};var _0xcbd951=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x4de646){return{'name':_0x4de646['fieldName'],'type':_0x4de646[_0x6965('0x25')]['key']};});_0x5c36e7[_0x6965('0x26')]=_[_0x6965('0x27')](_0xcbd951,'name');_0x5c36e7[_0x6965('0x28')]=_['keys'](_0x35f56b[_0x6965('0x28')]);_0x5c36e7[_0x6965('0x29')]=_[_0x6965('0x2a')](_0x5c36e7[_0x6965('0x26')],_0x5c36e7[_0x6965('0x28')]);_0x144df0[_0x6965('0x2b')]=_[_0x6965('0x2a')](_0x5c36e7[_0x6965('0x26')],qs['fields'](_0x35f56b[_0x6965('0x28')][_0x6965('0x2c')]));_0x144df0[_0x6965('0x2b')]=_0x144df0[_0x6965('0x2b')]['length']?_0x144df0[_0x6965('0x2b')]:_0x5c36e7['model'];if(!_0x35f56b['query'][_0x6965('0x2d')](_0x6965('0x2e'))){_0x144df0[_0x6965('0x17')]=qs[_0x6965('0x17')](_0x35f56b['query'][_0x6965('0x17')]);_0x144df0[_0x6965('0x15')]=qs['offset'](_0x35f56b[_0x6965('0x28')][_0x6965('0x15')]);}_0x144df0[_0x6965('0x2f')]=qs[_0x6965('0x30')](_0x35f56b[_0x6965('0x28')][_0x6965('0x30')]);_0x144df0['where']=qs['filters'](_[_0x6965('0x31')](_0x35f56b[_0x6965('0x28')],_0x5c36e7[_0x6965('0x29')]),_0xcbd951);if(_0x35f56b['query'][_0x6965('0x32')]){_0x144df0['where']=_[_0x6965('0x33')](_0x144df0[_0x6965('0x34')],{'$or':_['map'](_0xcbd951,function(_0x2cf09c){if(_0x2cf09c[_0x6965('0x25')]!=='VIRTUAL'){var _0x56ec71={};_0x56ec71[_0x2cf09c['name']]={'$like':'%'+_0x35f56b[_0x6965('0x28')][_0x6965('0x32')]+'%'};return _0x56ec71;}})});}_0x144df0=_[_0x6965('0x33')]({},_0x144df0,_0x35f56b[_0x6965('0x35')]);var _0x36d526={'where':_0x144df0[_0x6965('0x34')]};return db['JscriptyProject'][_0x6965('0x18')](_0x36d526)[_0x6965('0x1d')](function(_0x2fe229){_0x49c8e8[_0x6965('0x18')]=_0x2fe229;if(_0x35f56b['query'][_0x6965('0x36')]){_0x144df0[_0x6965('0x37')]=[{'all':!![]}];}return db[_0x6965('0x38')][_0x6965('0x39')](_0x144df0);})[_0x6965('0x1d')](function(_0x1d660b){_0x49c8e8[_0x6965('0x3a')]=_0x1d660b;return _0x49c8e8;})[_0x6965('0x1d')](respondWithFilteredResult(_0x16b353,_0x144df0))[_0x6965('0x3b')](handleError(_0x16b353,null));};exports[_0x6965('0x3c')]=function(_0x39ef02,_0xd394fe){var _0x5f3d42={'raw':![],'where':{'id':_0x39ef02[_0x6965('0x3d')]['id']}},_0x120ec5={};_0x120ec5[_0x6965('0x26')]=_['keys'](db[_0x6965('0x38')][_0x6965('0x3e')]);_0x120ec5[_0x6965('0x28')]=_[_0x6965('0x3f')](_0x39ef02[_0x6965('0x28')]);_0x120ec5['filters']=_['intersection'](_0x120ec5[_0x6965('0x26')],_0x120ec5[_0x6965('0x28')]);_0x5f3d42[_0x6965('0x2b')]=_['intersection'](_0x120ec5[_0x6965('0x26')],qs[_0x6965('0x2c')](_0x39ef02[_0x6965('0x28')][_0x6965('0x2c')]));_0x5f3d42[_0x6965('0x2b')]=_0x5f3d42[_0x6965('0x2b')][_0x6965('0x40')]?_0x5f3d42[_0x6965('0x2b')]:_0x120ec5[_0x6965('0x26')];if(_0x39ef02['query'][_0x6965('0x36')]){_0x5f3d42[_0x6965('0x37')]=[{'all':!![]}];}_0x5f3d42=_[_0x6965('0x33')]({},_0x5f3d42,_0x39ef02[_0x6965('0x35')]);return db[_0x6965('0x38')][_0x6965('0x41')](_0x5f3d42)[_0x6965('0x1d')](handleEntityNotFound(_0xd394fe,null))[_0x6965('0x1d')](respondWithResult(_0xd394fe,null))['catch'](handleError(_0xd394fe,null));};exports[_0x6965('0x42')]=function(_0x344587,_0x49f3e5){return db[_0x6965('0x38')][_0x6965('0x42')](_0x344587['body'],{})[_0x6965('0x1d')](function(_0x36aeae){var _0x30862a=_0x344587[_0x6965('0x43')][_0x6965('0x1f')]({'plain':!![]});if(!_0x30862a)throw new Error(_0x6965('0x44'));if(_0x30862a[_0x6965('0x45')]===_0x6965('0x43')){var _0xfa8f2=_0x36aeae[_0x6965('0x1f')]({'plain':!![]});var _0x33a6a4=_0x6965('0x20');return db[_0x6965('0x46')][_0x6965('0x41')]({'where':{'name':_0x33a6a4,'userProfileId':_0x30862a[_0x6965('0x47')]},'raw':!![]})['then'](function(_0x21d1b0){if(_0x21d1b0&&_0x21d1b0[_0x6965('0x48')]===0x0){return db[_0x6965('0x21')][_0x6965('0x42')]({'name':_0xfa8f2['name'],'resourceId':_0xfa8f2['id'],'type':_0x21d1b0[_0x6965('0x23')],'sectionId':_0x21d1b0['id']},{})[_0x6965('0x1d')](function(){return _0x36aeae;});}else{return _0x36aeae;}})[_0x6965('0x3b')](function(_0x27fac5){logger['error'](_0x6965('0x49'),_0x27fac5);throw _0x27fac5;});}return _0x36aeae;})[_0x6965('0x1d')](respondWithResult(_0x49f3e5,0xc9))['catch'](handleError(_0x49f3e5,null));};exports[_0x6965('0x4a')]=function(_0x1cd77b,_0x38288d){var _0x3bdd93={'where':{'id':_0x1cd77b[_0x6965('0x3d')]['id']}},_0x132154={};_0x132154[_0x6965('0x26')]=_[_0x6965('0x3f')](db[_0x6965('0x38')][_0x6965('0x3e')]);_0x3bdd93['attributes']=_[_0x6965('0x2a')](_0x132154[_0x6965('0x26')],qs[_0x6965('0x2c')](_0x1cd77b['query'][_0x6965('0x2c')]));_0x3bdd93[_0x6965('0x2b')]=_0x3bdd93['attributes'][_0x6965('0x40')]?_0x3bdd93[_0x6965('0x2b')]:_0x132154['model'];if(_0x1cd77b[_0x6965('0x28')][_0x6965('0x36')]){_0x3bdd93[_0x6965('0x37')]=[{'all':!![]}];}_0x3bdd93=_[_0x6965('0x33')]({},_0x3bdd93,_0x1cd77b[_0x6965('0x35')]);return db[_0x6965('0x38')][_0x6965('0x41')](_0x3bdd93)[_0x6965('0x1d')](handleEntityNotFound(_0x38288d,null))[_0x6965('0x1d')](function(_0x3e41b2){if(_0x3e41b2){var _0x40f055=_0x3e41b2[_0x6965('0x1f')]({'plain':!![]});_0x40f055=qs['omit'](_0x40f055,['id',_0x6965('0x4b'),_0x6965('0x4c')]);_0x1cd77b[_0x6965('0x4d')]=_[_0x6965('0x4e')](_0x1cd77b[_0x6965('0x4d')],['id',_0x6965('0x4b'),_0x6965('0x4c')]);return db['JscriptyProject']['create'](_[_0x6965('0x33')](_0x40f055,_0x1cd77b[_0x6965('0x4d')]),{'include':_0x1cd77b[_0x6965('0x28')]['includeAll']?[{'all':!![]}]:undefined})[_0x6965('0x1d')](function(_0x4ad85a){var _0x287eaf=_0x1cd77b[_0x6965('0x43')][_0x6965('0x1f')]({'plain':!![]});if(!_0x287eaf)throw new Error(_0x6965('0x44'));if(_0x287eaf[_0x6965('0x45')]==='user'){var _0x2a7985=_0x4ad85a[_0x6965('0x1f')]({'plain':!![]});var _0xbf3eea=_0x6965('0x20');return db[_0x6965('0x46')]['find']({'where':{'name':_0xbf3eea,'userProfileId':_0x287eaf[_0x6965('0x47')]},'raw':!![]})['then'](function(_0x379cd2){if(_0x379cd2&&_0x379cd2['autoAssociation']===0x0){return db['UserProfileResource'][_0x6965('0x42')]({'name':_0x2a7985[_0x6965('0x23')],'resourceId':_0x2a7985['id'],'type':_0x379cd2[_0x6965('0x23')],'sectionId':_0x379cd2['id']},{})[_0x6965('0x1d')](function(){return _0x4ad85a;});}else{return _0x4ad85a;}})[_0x6965('0x3b')](function(_0x236d5d){logger[_0x6965('0x22')](_0x6965('0x49'),_0x236d5d);throw _0x236d5d;});}return _0x4ad85a;});}})['then'](respondWithResult(_0x38288d,0xc9))[_0x6965('0x3b')](handleError(_0x38288d,null));};exports[_0x6965('0x4f')]=function(_0x4041dc,_0x50d3ec){if(_0x4041dc['body']['id']){delete _0x4041dc[_0x6965('0x4d')]['id'];}return db[_0x6965('0x38')][_0x6965('0x41')]({'where':{'id':_0x4041dc[_0x6965('0x3d')]['id']}})[_0x6965('0x1d')](handleEntityNotFound(_0x50d3ec,null))[_0x6965('0x1d')](saveUpdates(_0x4041dc['body'],null))[_0x6965('0x1d')](respondWithResult(_0x50d3ec,null))[_0x6965('0x3b')](handleError(_0x50d3ec,null));};exports[_0x6965('0x1e')]=function(_0x4732ed,_0x415d86){return db[_0x6965('0x38')][_0x6965('0x41')]({'where':{'id':_0x4732ed[_0x6965('0x3d')]['id']}})['then'](handleEntityNotFound(_0x415d86,null))[_0x6965('0x1d')](removeEntity(_0x415d86,null))[_0x6965('0x3b')](handleError(_0x415d86,null));};exports['getSessions']=function(_0x5a2e1c,_0x95470d,_0x14d347){var _0x154996={'raw':!![],'where':{}};var _0x5e7dcb={};var _0x119ee4={'count':0x0,'rows':[]};return db[_0x6965('0x38')][_0x6965('0x50')]({'where':{'id':_0x5a2e1c[_0x6965('0x3d')]['id']}})['then'](handleEntityNotFound(_0x95470d,null))[_0x6965('0x1d')](function(_0x4e0c03){if(_0x4e0c03){_0x5e7dcb[_0x6965('0x26')]=_[_0x6965('0x3f')](db[_0x6965('0x51')]['rawAttributes']);_0x5e7dcb[_0x6965('0x28')]=_[_0x6965('0x3f')](_0x5a2e1c[_0x6965('0x28')]);_0x5e7dcb[_0x6965('0x29')]=_[_0x6965('0x2a')](_0x5e7dcb[_0x6965('0x26')],_0x5e7dcb['query']);_0x154996[_0x6965('0x2b')]=_[_0x6965('0x2a')](_0x5e7dcb[_0x6965('0x26')],qs[_0x6965('0x2c')](_0x5a2e1c[_0x6965('0x28')][_0x6965('0x2c')]));_0x154996[_0x6965('0x2b')]=_0x154996[_0x6965('0x2b')][_0x6965('0x40')]?_0x154996[_0x6965('0x2b')]:_0x5e7dcb[_0x6965('0x26')];if(!_0x5a2e1c[_0x6965('0x28')][_0x6965('0x2d')]('nolimit')){_0x154996[_0x6965('0x17')]=qs[_0x6965('0x17')](_0x5a2e1c[_0x6965('0x28')][_0x6965('0x17')]);_0x154996[_0x6965('0x15')]=qs['offset'](_0x5a2e1c[_0x6965('0x28')][_0x6965('0x15')]);}_0x154996['order']=qs['sort'](_0x5a2e1c[_0x6965('0x28')]['sort']);_0x154996[_0x6965('0x34')]=qs[_0x6965('0x29')](_[_0x6965('0x31')](_0x5a2e1c[_0x6965('0x28')],_0x5e7dcb[_0x6965('0x29')]));_0x154996[_0x6965('0x34')][_0x6965('0x52')]=_0x4e0c03['id'];if(_0x5a2e1c[_0x6965('0x28')][_0x6965('0x32')]){_0x154996['where']=_[_0x6965('0x33')](_0x154996[_0x6965('0x34')],{'$or':_[_0x6965('0x27')](_0x154996['attributes'],function(_0x373c5f){var _0x3441a8={};_0x3441a8[_0x373c5f]={'$like':'%'+_0x5a2e1c[_0x6965('0x28')]['filter']+'%'};return _0x3441a8;})});}_0x154996=_['merge']({},_0x154996,_0x5a2e1c['options']);return db[_0x6965('0x51')][_0x6965('0x18')]({'where':_0x154996['where']})[_0x6965('0x1d')](function(_0x2715a5){_0x119ee4[_0x6965('0x18')]=_0x2715a5;if(_0x5a2e1c[_0x6965('0x28')]['includeAll']){_0x154996[_0x6965('0x37')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x6965('0x39')](_0x154996);})[_0x6965('0x1d')](function(_0x521d99){_0x119ee4[_0x6965('0x3a')]=_0x521d99;return _0x119ee4;});}})['then'](respondWithFilteredResult(_0x95470d,_0x154996))[_0x6965('0x3b')](handleError(_0x95470d,null));};exports[_0x6965('0x53')]=function(_0x30f797,_0x298e62,_0x39cc5b){var _0x2e12d3={'raw':!![],'where':{}};var _0x34fb79={};var _0x2bbb76={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x6965('0x50')]({'where':{'id':_0x30f797[_0x6965('0x3d')]['id']}})[_0x6965('0x1d')](handleEntityNotFound(_0x298e62,null))[_0x6965('0x1d')](function(_0x1381c4){if(_0x1381c4){_0x34fb79['model']=_[_0x6965('0x3f')](db[_0x6965('0x54')][_0x6965('0x3e')]);_0x34fb79[_0x6965('0x28')]=_[_0x6965('0x3f')](_0x30f797[_0x6965('0x28')]);_0x34fb79['filters']=_[_0x6965('0x2a')](_0x34fb79[_0x6965('0x26')],_0x34fb79[_0x6965('0x28')]);_0x2e12d3['attributes']=_['intersection'](_0x34fb79['model'],qs[_0x6965('0x2c')](_0x30f797[_0x6965('0x28')][_0x6965('0x2c')]));_0x2e12d3[_0x6965('0x2b')]=_0x2e12d3['attributes'][_0x6965('0x40')]?_0x2e12d3[_0x6965('0x2b')]:_0x34fb79['model'];if(!_0x30f797[_0x6965('0x28')]['hasOwnProperty'](_0x6965('0x2e'))){_0x2e12d3[_0x6965('0x17')]=qs[_0x6965('0x17')](_0x30f797[_0x6965('0x28')]['limit']);_0x2e12d3[_0x6965('0x15')]=qs[_0x6965('0x15')](_0x30f797[_0x6965('0x28')][_0x6965('0x15')]);}_0x2e12d3['order']=qs[_0x6965('0x30')](_0x30f797[_0x6965('0x28')]['sort']);_0x2e12d3[_0x6965('0x34')]=qs[_0x6965('0x29')](_[_0x6965('0x31')](_0x30f797[_0x6965('0x28')],_0x34fb79[_0x6965('0x29')]));_0x2e12d3['where'][_0x6965('0x52')]=_0x1381c4['id'];if(_0x30f797[_0x6965('0x28')][_0x6965('0x32')]){_0x2e12d3[_0x6965('0x34')]=_[_0x6965('0x33')](_0x2e12d3[_0x6965('0x34')],{'$or':_[_0x6965('0x27')](_0x2e12d3[_0x6965('0x2b')],function(_0x2d0b0c){var _0x326aed={};_0x326aed[_0x2d0b0c]={'$like':'%'+_0x30f797['query'][_0x6965('0x32')]+'%'};return _0x326aed;})});}_0x2e12d3=_[_0x6965('0x33')]({},_0x2e12d3,_0x30f797[_0x6965('0x35')]);return db[_0x6965('0x54')][_0x6965('0x18')]({'where':_0x2e12d3['where']})[_0x6965('0x1d')](function(_0x4548fe){_0x2bbb76['count']=_0x4548fe;if(_0x30f797[_0x6965('0x28')][_0x6965('0x36')]){_0x2e12d3['include']=[{'all':!![]}];}return db[_0x6965('0x54')][_0x6965('0x39')](_0x2e12d3);})[_0x6965('0x1d')](function(_0x1cf512){_0x2bbb76[_0x6965('0x3a')]=_0x1cf512;return _0x2bbb76;});}})['then'](respondWithFilteredResult(_0x298e62,_0x2e12d3))[_0x6965('0x3b')](handleError(_0x298e62,null));};function char(_0x3e6dc2){return _0x6965('0x55')===typeof _0x3e6dc2?String[_0x6965('0x56')]['apply'](null,arguments):_0x3e6dc2;}function needsEncapsulation(_0x5d76e1){return!!_0x5d76e1&&(_0x5d76e1[_0x6965('0x57')]()[_0x6965('0x58')](char(0xd))>=0x0||_0x5d76e1[_0x6965('0x57')]()[_0x6965('0x58')](char(0xa))>=0x0||_0x5d76e1['toString']()['indexOf'](char(0x2c))>=0x0||_0x5d76e1[_0x6965('0x57')]()[_0x6965('0x58')](char(0x22))>=0x0);}function encapsulate(_0x3c0259){var _0x4be66f=char(0x22),_0x899c3d='\x5c'+char(0x22),_0x235aee=_0x3c0259[_0x6965('0x57')]()[_0x6965('0x59')](new RegExp(_0x4be66f,'g'),_0x899c3d);return _0x4be66f+_0x235aee+_0x4be66f;}exports['getSummary']=function(_0x4715c7,_0x4f13cd,_0x246e2c){var _0x14e09b,_0x17f3a8;var _0x2573af={'where':{'ProjectId':_0x4715c7[_0x6965('0x3d')]['id']}};if(_0x4715c7[_0x6965('0x28')][_0x6965('0x5a')]){_0x2573af[_0x6965('0x34')][_0x6965('0x5b')]=JSON[_0x6965('0x5c')](_0x4715c7['query'][_0x6965('0x5a')]);}return db[_0x6965('0x51')]['findAll'](_0x2573af)[_0x6965('0x1d')](handleEntityNotFound(_0x4f13cd,null))[_0x6965('0x1d')](function(_0x2f980d){if(_0x2f980d){_0x14e09b=_0x2f980d;return db['JscriptyQuestionReport'][_0x6965('0x39')]({'where':{'SessionId':{'$in':_[_0x6965('0x27')](_0x14e09b,'id')},'ProjectId':_0x4715c7[_0x6965('0x3d')]['id']},'order':_0x6965('0x5d')});}})[_0x6965('0x1d')](handleEntityNotFound(_0x4f13cd,null))['then'](function(_0x382568){if(_0x382568){_0x17f3a8=_0x382568;var _0x3ea746={};for(var _0x2eca03=0x0,_0xccea0a=_0x17f3a8[_0x6965('0x40')];_0x2eca03<_0xccea0a;_0x2eca03++){if(!_0x3ea746[_0x6965('0x2d')](_0x17f3a8[_0x2eca03]['questionId'])){_0x3ea746[_0x17f3a8[_0x2eca03][_0x6965('0x5e')]]=needsEncapsulation(_0x17f3a8[_0x2eca03][_0x6965('0x5f')])?encapsulate(_0x17f3a8[_0x2eca03][_0x6965('0x5f')]):_0x17f3a8[_0x2eca03][_0x6965('0x5f')];}}var _0x20725f=[],_0x4e92c2={};for(var _0x42e3a3=0x0,_0xf38753=_0x14e09b[_0x6965('0x40')];_0x42e3a3<_0xf38753;_0x42e3a3++){_0x4e92c2={'ProjectId':_0x4715c7[_0x6965('0x3d')]['id'],'SessionId':_0x14e09b[_0x42e3a3]['id'],'StartTime':moment(_0x14e09b[_0x42e3a3][_0x6965('0x5b')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3bbab3=0x0,_0x203354=_0x17f3a8[_0x6965('0x40')];_0x3bbab3<_0x203354;_0x3bbab3++){if(_0x17f3a8[_0x3bbab3]['SessionId']==_0x14e09b[_0x42e3a3]['id']&&_0x3ea746['hasOwnProperty'](_0x17f3a8[_0x3bbab3]['questionId'])){_0x4e92c2[_0x3ea746[_0x17f3a8[_0x3bbab3][_0x6965('0x5e')]]]=_0x17f3a8[_0x3bbab3][_0x6965('0x60')];}}for(var _0xafee79 in _0x3ea746){if(!_0x4e92c2['hasOwnProperty'](_0x3ea746[_0xafee79])){_0x4e92c2[_0x3ea746[_0xafee79]]=null;}}_0x20725f[_0x6965('0x61')](_0x4e92c2);}return _0x20725f;}})['then'](function(_0x26806f){if(!_[_0x6965('0x62')](_0x26806f)){var _0x26dbda=toCsv(_0x26806f);var _0x3a8712=Date[_0x6965('0x63')]();fs[_0x6965('0x64')](util[_0x6965('0x65')](_0x6965('0x66'),_0x4715c7['params']['id'],_0x3a8712),_0x26dbda);_0x4f13cd[_0x6965('0x67')](_0x6965('0x68'),_0x6965('0x69')+util[_0x6965('0x65')](_0x6965('0x6a'),_0x4715c7['params']['id'],_0x3a8712));_0x4f13cd[_0x6965('0x67')](_0x6965('0x6b'),_0x6965('0x6c'));return _0x4f13cd[_0x6965('0x6d')](util[_0x6965('0x65')](_0x6965('0x66'),_0x4715c7[_0x6965('0x3d')]['id'],_0x3a8712));}else{return _0x4f13cd[_0x6965('0x11')](0xcc);}})[_0x6965('0x3b')](handleError(_0x4f13cd,null));};
\ No newline at end of file
index b993def..6b38b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','lodash','util','api','moment','bluebird','path'];(function(_0x1c6ca9,_0x5c8bb5){var _0x4b1965=function(_0x6464d5){while(--_0x6464d5){_0x1c6ca9['push'](_0x1c6ca9['shift']());}};_0x4b1965(++_0x5c8bb5);}(_0xeff8,0x186));var _0x8eff=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xeff8[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b2a=['path','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b2a,0x127));var _0xa9b2=function(_0x4acbc6,_0x18aa65){_0x4acbc6=_0x4acbc6-0x0;var _0x36cd1e=_0x9b2a[_0x4acbc6];return _0x36cd1e;};'use strict';var _=require(_0xa9b2('0x0'));var util=require('util');var logger=require(_0xa9b2('0x1'))(_0xa9b2('0x2'));var moment=require(_0xa9b2('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9b2('0x4'));var fs=require('fs');var path=require(_0xa9b2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9b2('0x6'));module[_0xa9b2('0x7')]=function(_0x181a8f,_0xd7801e){return _0x181a8f['define'](_0xa9b2('0x8'),attributes,{'tableName':_0xa9b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a456372..1ae42b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x2f7234,_0x15bef5){var _0x3f4f5a=function(_0x18ccae){while(--_0x18ccae){_0x2f7234['push'](_0x2f7234['shift']());}};_0x3f4f5a(++_0x15bef5);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'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']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\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')]('JscriptyProject,\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')]('JscriptyProject,\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
+var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x532c55,_0x4dab9a){_0x532c55=_0x532c55-0x0;var _0x1eefe9=_0xbdb7[_0x532c55];return _0x1eefe9;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
index 6dfe74d..45089ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x167e=['express','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','multer','path'];(function(_0x4b77d3,_0x2d4b12){var _0x25fd4f=function(_0x48b82c){while(--_0x48b82c){_0x4b77d3['push'](_0x4b77d3['shift']());}};_0x25fd4f(++_0x2d4b12);}(_0x167e,0x1ce));var _0xe167=function(_0x1639a8,_0x21e78c){_0x1639a8=_0x1639a8-0x0;var _0x462fc3=_0x167e[_0x1639a8];return _0x462fc3;};'use strict';var multer=require(_0xe167('0x0'));var util=require('util');var path=require(_0xe167('0x1'));var timeout=require('connect-timeout');var express=require(_0xe167('0x2'));var router=express['Router']();var fs_extra=require(_0xe167('0x3'));var auth=require(_0xe167('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe167('0x5'));var controller=require(_0xe167('0x6'));router[_0xe167('0x7')]('/',auth[_0xe167('0x8')](),controller['index']);router['get']('/describe',auth[_0xe167('0x8')](),controller['describe']);router[_0xe167('0x7')]('/:id',auth[_0xe167('0x8')](),controller[_0xe167('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe167('0xa')]);router[_0xe167('0xb')](_0xe167('0xc'),auth[_0xe167('0x8')](),controller[_0xe167('0xd')]);router[_0xe167('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe167('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x8e13=['../../config/environment','index','get','/describe','isAuthenticated','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1c4fbf,_0x59a942){var _0x20e661=function(_0xabfc92){while(--_0xabfc92){_0x1c4fbf['push'](_0x1c4fbf['shift']());}};_0x20e661(++_0x59a942);}(_0x8e13,0x161));var _0x38e1=function(_0x1f3489,_0x4e8da2){_0x1f3489=_0x1f3489-0x0;var _0x12cd0d=_0x8e13[_0x1f3489];return _0x12cd0d;};'use strict';var multer=require(_0x38e1('0x0'));var util=require(_0x38e1('0x1'));var path=require(_0x38e1('0x2'));var timeout=require(_0x38e1('0x3'));var express=require(_0x38e1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x38e1('0x5'));var interaction=require(_0x38e1('0x6'));var config=require(_0x38e1('0x7'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x38e1('0x8')]);router[_0x38e1('0x9')](_0x38e1('0xa'),auth[_0x38e1('0xb')](),controller['describe']);router[_0x38e1('0x9')](_0x38e1('0xc'),auth[_0x38e1('0xb')](),controller[_0x38e1('0xd')]);router[_0x38e1('0xe')]('/',auth[_0x38e1('0xb')](),controller['create']);router[_0x38e1('0xf')]('/:id',auth[_0x38e1('0xb')](),controller[_0x38e1('0x10')]);router[_0x38e1('0x11')](_0x38e1('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 60d778e..faca015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7a54,0x106));var _0x47a5=function(_0x334161,_0x4e3da0){_0x334161=_0x334161-0x0;var _0x5d81f0=_0x7a54[_0x334161];return _0x5d81f0;};'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(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x31a2bb,_0x2d23c1){_0x31a2bb=_0x31a2bb-0x0;var _0x415038=_0x7a54[_0x31a2bb];return _0x415038;};'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 18397ff..487ecd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd48=['where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd48,0x140));var _0x8cd4=function(_0x5db908,_0x64c0d){_0x5db908=_0x5db908-0x0;var _0x89a805=_0xcd48[_0x5db908];return _0x89a805;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cd4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cd4('0x1'));var rp=require(_0x8cd4('0x2'));var moment=require(_0x8cd4('0x3'));var BPromise=require(_0x8cd4('0x4'));var Mustache=require(_0x8cd4('0x5'));var util=require(_0x8cd4('0x6'));var path=require(_0x8cd4('0x7'));var sox=require(_0x8cd4('0x8'));var csv=require(_0x8cd4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cd4('0xa'));var squel=require(_0x8cd4('0xb'));var crypto=require('crypto');var jsforce=require(_0x8cd4('0xc'));var deskjs=require(_0x8cd4('0xd'));var toCsv=require(_0x8cd4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8cd4('0xe'));var authService=require(_0x8cd4('0xf'));var qs=require(_0x8cd4('0x10'));var as=require(_0x8cd4('0x11'));var hardwareService=require(_0x8cd4('0x12'));var logger=require(_0x8cd4('0x13'))(_0x8cd4('0x14'));var utils=require('../../config/utils');var config=require(_0x8cd4('0x15'));var licenseUtil=require(_0x8cd4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b78a8,_0x315325){_0x315325=_0x315325||0xcc;return function(_0x31678a){if(_0x31678a){return _0x3b78a8[_0x8cd4('0x17')](_0x315325);}return _0x3b78a8['status'](_0x315325)[_0x8cd4('0x18')]();};}function respondWithResult(_0x20c83f,_0x8b528){_0x8b528=_0x8b528||0xc8;return function(_0x50da03){if(_0x50da03){return _0x20c83f[_0x8cd4('0x19')](_0x8b528)['json'](_0x50da03);}};}function respondWithFilteredResult(_0x28a798,_0x36d428){return function(_0x6c875d){if(_0x6c875d){var _0xe0b433=typeof _0x36d428['offset']===_0x8cd4('0x1a')&&typeof _0x36d428['limit']===_0x8cd4('0x1a');var _0x1d4f7a=_0x6c875d[_0x8cd4('0x1b')];var _0x32fb0f=_0xe0b433?0x0:_0x36d428[_0x8cd4('0x1c')];var _0x137ba5=_0xe0b433?_0x6c875d[_0x8cd4('0x1b')]:_0x36d428['offset']+_0x36d428[_0x8cd4('0x1d')];var _0x50a162;if(_0x137ba5>=_0x1d4f7a){_0x137ba5=_0x1d4f7a;_0x50a162=0xc8;}else{_0x50a162=0xce;}_0x28a798[_0x8cd4('0x19')](_0x50a162);return _0x28a798[_0x8cd4('0x1e')](_0x8cd4('0x1f'),_0x32fb0f+'-'+_0x137ba5+'/'+_0x1d4f7a)[_0x8cd4('0x20')](_0x6c875d);}return null;};}function patchUpdates(_0x2efda5){return function(_0x5d66df){try{jsonpatch['apply'](_0x5d66df,_0x2efda5,!![]);}catch(_0x35a302){return BPromise[_0x8cd4('0x21')](_0x35a302);}return _0x5d66df[_0x8cd4('0x22')]();};}function saveUpdates(_0x30c327,_0x450903){return function(_0x356d22){if(_0x356d22){return _0x356d22[_0x8cd4('0x23')](_0x30c327)[_0x8cd4('0x24')](function(_0x4b0c33){return _0x4b0c33;});}return null;};}function removeEntity(_0x5457d1,_0x3fdcae){return function(_0x4881d4){if(_0x4881d4){return _0x4881d4[_0x8cd4('0x25')]()[_0x8cd4('0x24')](function(){_0x5457d1[_0x8cd4('0x19')](0xcc)[_0x8cd4('0x18')]();});}};}function handleEntityNotFound(_0x382717,_0x2ca954){return function(_0x418748){if(!_0x418748){_0x382717[_0x8cd4('0x17')](0x194);}return _0x418748;};}function handleError(_0x1e6d10,_0x1476bd){_0x1476bd=_0x1476bd||0x1f4;return function(_0x4911c3){logger[_0x8cd4('0x26')](_0x4911c3[_0x8cd4('0x27')]);if(_0x4911c3[_0x8cd4('0x28')]){delete _0x4911c3[_0x8cd4('0x28')];}_0x1e6d10[_0x8cd4('0x19')](_0x1476bd)[_0x8cd4('0x29')](_0x4911c3);};}exports['index']=function(_0x217c19,_0x55b207){var _0x5b9aa6={},_0x2847db={},_0x45d266={'count':0x0,'rows':[]};var _0xc2664d=_[_0x8cd4('0x2a')](db[_0x8cd4('0x2b')][_0x8cd4('0x2c')],function(_0x3129d7){return{'name':_0x3129d7[_0x8cd4('0x2d')],'type':_0x3129d7[_0x8cd4('0x2e')][_0x8cd4('0x2f')]};});_0x2847db[_0x8cd4('0x30')]=_[_0x8cd4('0x2a')](_0xc2664d,_0x8cd4('0x28'));_0x2847db[_0x8cd4('0x31')]=_[_0x8cd4('0x32')](_0x217c19[_0x8cd4('0x31')]);_0x2847db[_0x8cd4('0x33')]=_[_0x8cd4('0x34')](_0x2847db['model'],_0x2847db[_0x8cd4('0x31')]);_0x5b9aa6['attributes']=_[_0x8cd4('0x34')](_0x2847db['model'],qs['fields'](_0x217c19[_0x8cd4('0x31')][_0x8cd4('0x35')]));_0x5b9aa6[_0x8cd4('0x36')]=_0x5b9aa6[_0x8cd4('0x36')][_0x8cd4('0x37')]?_0x5b9aa6[_0x8cd4('0x36')]:_0x2847db[_0x8cd4('0x30')];if(!_0x217c19[_0x8cd4('0x31')][_0x8cd4('0x38')](_0x8cd4('0x39'))){_0x5b9aa6[_0x8cd4('0x1d')]=qs[_0x8cd4('0x1d')](_0x217c19[_0x8cd4('0x31')][_0x8cd4('0x1d')]);_0x5b9aa6['offset']=qs[_0x8cd4('0x1c')](_0x217c19[_0x8cd4('0x31')][_0x8cd4('0x1c')]);}_0x5b9aa6[_0x8cd4('0x3a')]=qs[_0x8cd4('0x3b')](_0x217c19[_0x8cd4('0x31')][_0x8cd4('0x3b')]);_0x5b9aa6[_0x8cd4('0x3c')]=qs[_0x8cd4('0x33')](_[_0x8cd4('0x3d')](_0x217c19['query'],_0x2847db[_0x8cd4('0x33')]),_0xc2664d);if(_0x217c19[_0x8cd4('0x31')][_0x8cd4('0x3e')]){_0x5b9aa6[_0x8cd4('0x3c')]=_[_0x8cd4('0x3f')](_0x5b9aa6[_0x8cd4('0x3c')],{'$or':_[_0x8cd4('0x2a')](_0xc2664d,function(_0x11cec4){if(_0x11cec4[_0x8cd4('0x2e')]!=='VIRTUAL'){var _0x1263c0={};_0x1263c0[_0x11cec4[_0x8cd4('0x28')]]={'$like':'%'+_0x217c19[_0x8cd4('0x31')][_0x8cd4('0x3e')]+'%'};return _0x1263c0;}})});}_0x5b9aa6=_['merge']({},_0x5b9aa6,_0x217c19[_0x8cd4('0x40')]);var _0x24e90d={'where':_0x5b9aa6[_0x8cd4('0x3c')]};return db[_0x8cd4('0x2b')]['count'](_0x24e90d)[_0x8cd4('0x24')](function(_0x2b13a4){_0x45d266[_0x8cd4('0x1b')]=_0x2b13a4;if(_0x217c19[_0x8cd4('0x31')][_0x8cd4('0x41')]){_0x5b9aa6[_0x8cd4('0x42')]=[{'all':!![]}];}return db[_0x8cd4('0x2b')][_0x8cd4('0x43')](_0x5b9aa6);})[_0x8cd4('0x24')](function(_0x54f123){_0x45d266[_0x8cd4('0x44')]=_0x54f123;return _0x45d266;})[_0x8cd4('0x24')](respondWithFilteredResult(_0x55b207,_0x5b9aa6))[_0x8cd4('0x45')](handleError(_0x55b207,null));};exports[_0x8cd4('0x46')]=function(_0x4a9bae,_0x18905f){var _0x44ee96={'raw':!![],'where':{'id':_0x4a9bae[_0x8cd4('0x47')]['id']}},_0x53560d={};_0x53560d[_0x8cd4('0x30')]=_[_0x8cd4('0x32')](db[_0x8cd4('0x2b')][_0x8cd4('0x2c')]);_0x53560d[_0x8cd4('0x31')]=_['keys'](_0x4a9bae[_0x8cd4('0x31')]);_0x53560d[_0x8cd4('0x33')]=_[_0x8cd4('0x34')](_0x53560d[_0x8cd4('0x30')],_0x53560d[_0x8cd4('0x31')]);_0x44ee96[_0x8cd4('0x36')]=_['intersection'](_0x53560d[_0x8cd4('0x30')],qs[_0x8cd4('0x35')](_0x4a9bae[_0x8cd4('0x31')][_0x8cd4('0x35')]));_0x44ee96[_0x8cd4('0x36')]=_0x44ee96[_0x8cd4('0x36')][_0x8cd4('0x37')]?_0x44ee96[_0x8cd4('0x36')]:_0x53560d[_0x8cd4('0x30')];if(_0x4a9bae[_0x8cd4('0x31')]['includeAll']){_0x44ee96[_0x8cd4('0x42')]=[{'all':!![]}];}_0x44ee96=_[_0x8cd4('0x3f')]({},_0x44ee96,_0x4a9bae[_0x8cd4('0x40')]);return db['JscriptyQuestionReport'][_0x8cd4('0x48')](_0x44ee96)[_0x8cd4('0x24')](handleEntityNotFound(_0x18905f,null))[_0x8cd4('0x24')](respondWithResult(_0x18905f,null))[_0x8cd4('0x45')](handleError(_0x18905f,null));};exports['create']=function(_0x3a7ffa,_0x15546c){return db[_0x8cd4('0x2b')][_0x8cd4('0x49')](_0x3a7ffa[_0x8cd4('0x4a')],{})[_0x8cd4('0x24')](respondWithResult(_0x15546c,0xc9))[_0x8cd4('0x45')](handleError(_0x15546c,null));};exports[_0x8cd4('0x23')]=function(_0x298f0d,_0x395b8d){if(_0x298f0d[_0x8cd4('0x4a')]['id']){delete _0x298f0d[_0x8cd4('0x4a')]['id'];}return db[_0x8cd4('0x2b')]['find']({'where':{'id':_0x298f0d[_0x8cd4('0x47')]['id']}})[_0x8cd4('0x24')](handleEntityNotFound(_0x395b8d,null))['then'](saveUpdates(_0x298f0d['body'],null))['then'](respondWithResult(_0x395b8d,null))[_0x8cd4('0x45')](handleError(_0x395b8d,null));};exports['destroy']=function(_0x374ad6,_0x57d0d1){return db[_0x8cd4('0x2b')][_0x8cd4('0x48')]({'where':{'id':_0x374ad6[_0x8cd4('0x47')]['id']}})[_0x8cd4('0x24')](handleEntityNotFound(_0x57d0d1,null))[_0x8cd4('0x24')](removeEntity(_0x57d0d1,null))[_0x8cd4('0x45')](handleError(_0x57d0d1,null));};exports[_0x8cd4('0x4b')]=function(_0x340d06,_0x1e29b0){return db[_0x8cd4('0x2b')][_0x8cd4('0x4b')]()[_0x8cd4('0x24')](respondWithResult(_0x1e29b0,null))[_0x8cd4('0x45')](handleError(_0x1e29b0,null));};
\ No newline at end of file
+var _0xcd9e=['json','apply','reject','update','destroy','then','end','error','stack','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','keys','include','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xcd9e,0x1ee));var _0xecd9=function(_0xb01840,_0x4ab15d){_0xb01840=_0xb01840-0x0;var _0x1d38f9=_0xcd9e[_0xb01840];return _0x1d38f9;};'use strict';var emlformat=require(_0xecd9('0x0'));var rimraf=require(_0xecd9('0x1'));var zipdir=require(_0xecd9('0x2'));var jsonpatch=require(_0xecd9('0x3'));var rp=require(_0xecd9('0x4'));var moment=require(_0xecd9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xecd9('0x6'));var path=require('path');var sox=require(_0xecd9('0x7'));var csv=require(_0xecd9('0x8'));var ejs=require(_0xecd9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xecd9('0xa'));var squel=require('squel');var crypto=require(_0xecd9('0xb'));var jsforce=require(_0xecd9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xecd9('0x8'));var querystring=require(_0xecd9('0xd'));var Papa=require('papaparse');var Redis=require(_0xecd9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xecd9('0xf'));var as=require(_0xecd9('0x10'));var hardwareService=require(_0xecd9('0x11'));var logger=require(_0xecd9('0x12'))(_0xecd9('0x13'));var utils=require(_0xecd9('0x14'));var config=require(_0xecd9('0x15'));var licenseUtil=require(_0xecd9('0x16'));var db=require(_0xecd9('0x17'))['db'];function respondWithStatusCode(_0x989c1c,_0x5a3139){_0x5a3139=_0x5a3139||0xcc;return function(_0x6ba444){if(_0x6ba444){return _0x989c1c[_0xecd9('0x18')](_0x5a3139);}return _0x989c1c[_0xecd9('0x19')](_0x5a3139)['end']();};}function respondWithResult(_0x38822d,_0x10650a){_0x10650a=_0x10650a||0xc8;return function(_0x5d5ebb){if(_0x5d5ebb){return _0x38822d['status'](_0x10650a)['json'](_0x5d5ebb);}};}function respondWithFilteredResult(_0x36501e,_0x27dc68){return function(_0x1f32c6){if(_0x1f32c6){var _0x314343=typeof _0x27dc68[_0xecd9('0x1a')]===_0xecd9('0x1b')&&typeof _0x27dc68[_0xecd9('0x1c')]===_0xecd9('0x1b');var _0x5d8d6a=_0x1f32c6[_0xecd9('0x1d')];var _0x192b8e=_0x314343?0x0:_0x27dc68['offset'];var _0x46dd83=_0x314343?_0x1f32c6[_0xecd9('0x1d')]:_0x27dc68[_0xecd9('0x1a')]+_0x27dc68[_0xecd9('0x1c')];var _0x4786d4;if(_0x46dd83>=_0x5d8d6a){_0x46dd83=_0x5d8d6a;_0x4786d4=0xc8;}else{_0x4786d4=0xce;}_0x36501e[_0xecd9('0x19')](_0x4786d4);return _0x36501e['set'](_0xecd9('0x1e'),_0x192b8e+'-'+_0x46dd83+'/'+_0x5d8d6a)[_0xecd9('0x1f')](_0x1f32c6);}return null;};}function patchUpdates(_0x1a37f0){return function(_0x4bb755){try{jsonpatch[_0xecd9('0x20')](_0x4bb755,_0x1a37f0,!![]);}catch(_0x28b205){return BPromise[_0xecd9('0x21')](_0x28b205);}return _0x4bb755['save']();};}function saveUpdates(_0x49dd77,_0x582b39){return function(_0xda4895){if(_0xda4895){return _0xda4895[_0xecd9('0x22')](_0x49dd77)['then'](function(_0x1567d0){return _0x1567d0;});}return null;};}function removeEntity(_0x5c9dad,_0xd6b72a){return function(_0x406694){if(_0x406694){return _0x406694[_0xecd9('0x23')]()[_0xecd9('0x24')](function(){_0x5c9dad['status'](0xcc)[_0xecd9('0x25')]();});}};}function handleEntityNotFound(_0x215106,_0x241234){return function(_0x8ce901){if(!_0x8ce901){_0x215106[_0xecd9('0x18')](0x194);}return _0x8ce901;};}function handleError(_0x4a4f90,_0xe0bc17){_0xe0bc17=_0xe0bc17||0x1f4;return function(_0x4ea877){logger[_0xecd9('0x26')](_0x4ea877[_0xecd9('0x27')]);if(_0x4ea877['name']){delete _0x4ea877['name'];}_0x4a4f90[_0xecd9('0x19')](_0xe0bc17)[_0xecd9('0x28')](_0x4ea877);};}exports[_0xecd9('0x29')]=function(_0x2032b8,_0x37fcfa){var _0x2835b5={},_0x3461f5={},_0x5edb14={'count':0x0,'rows':[]};var _0x3fbbf6=_[_0xecd9('0x2a')](db[_0xecd9('0x2b')][_0xecd9('0x2c')],function(_0x3e7e2c){return{'name':_0x3e7e2c[_0xecd9('0x2d')],'type':_0x3e7e2c[_0xecd9('0x2e')][_0xecd9('0x2f')]};});_0x3461f5[_0xecd9('0x30')]=_['map'](_0x3fbbf6,_0xecd9('0x31'));_0x3461f5[_0xecd9('0x32')]=_['keys'](_0x2032b8[_0xecd9('0x32')]);_0x3461f5[_0xecd9('0x33')]=_['intersection'](_0x3461f5['model'],_0x3461f5['query']);_0x2835b5['attributes']=_[_0xecd9('0x34')](_0x3461f5[_0xecd9('0x30')],qs[_0xecd9('0x35')](_0x2032b8['query']['fields']));_0x2835b5['attributes']=_0x2835b5['attributes'][_0xecd9('0x36')]?_0x2835b5[_0xecd9('0x37')]:_0x3461f5[_0xecd9('0x30')];if(!_0x2032b8[_0xecd9('0x32')]['hasOwnProperty'](_0xecd9('0x38'))){_0x2835b5[_0xecd9('0x1c')]=qs[_0xecd9('0x1c')](_0x2032b8['query'][_0xecd9('0x1c')]);_0x2835b5[_0xecd9('0x1a')]=qs[_0xecd9('0x1a')](_0x2032b8[_0xecd9('0x32')][_0xecd9('0x1a')]);}_0x2835b5[_0xecd9('0x39')]=qs[_0xecd9('0x3a')](_0x2032b8[_0xecd9('0x32')]['sort']);_0x2835b5[_0xecd9('0x3b')]=qs[_0xecd9('0x33')](_[_0xecd9('0x3c')](_0x2032b8[_0xecd9('0x32')],_0x3461f5[_0xecd9('0x33')]),_0x3fbbf6);if(_0x2032b8[_0xecd9('0x32')][_0xecd9('0x3d')]){_0x2835b5[_0xecd9('0x3b')]=_[_0xecd9('0x3e')](_0x2835b5['where'],{'$or':_[_0xecd9('0x2a')](_0x3fbbf6,function(_0x3f7ace){if(_0x3f7ace[_0xecd9('0x2e')]!==_0xecd9('0x3f')){var _0x12f92a={};_0x12f92a[_0x3f7ace[_0xecd9('0x31')]]={'$like':'%'+_0x2032b8['query'][_0xecd9('0x3d')]+'%'};return _0x12f92a;}})});}_0x2835b5=_[_0xecd9('0x3e')]({},_0x2835b5,_0x2032b8['options']);var _0x52320d={'where':_0x2835b5['where']};return db[_0xecd9('0x2b')][_0xecd9('0x1d')](_0x52320d)[_0xecd9('0x24')](function(_0x36035b){_0x5edb14[_0xecd9('0x1d')]=_0x36035b;if(_0x2032b8[_0xecd9('0x32')][_0xecd9('0x40')]){_0x2835b5['include']=[{'all':!![]}];}return db[_0xecd9('0x2b')]['findAll'](_0x2835b5);})['then'](function(_0x47c6c5){_0x5edb14[_0xecd9('0x41')]=_0x47c6c5;return _0x5edb14;})[_0xecd9('0x24')](respondWithFilteredResult(_0x37fcfa,_0x2835b5))[_0xecd9('0x42')](handleError(_0x37fcfa,null));};exports['show']=function(_0x200574,_0x47d36a){var _0x159bd5={'raw':!![],'where':{'id':_0x200574['params']['id']}},_0x183d7c={};_0x183d7c[_0xecd9('0x30')]=_['keys'](db['JscriptyQuestionReport'][_0xecd9('0x2c')]);_0x183d7c['query']=_[_0xecd9('0x43')](_0x200574[_0xecd9('0x32')]);_0x183d7c[_0xecd9('0x33')]=_[_0xecd9('0x34')](_0x183d7c[_0xecd9('0x30')],_0x183d7c['query']);_0x159bd5['attributes']=_[_0xecd9('0x34')](_0x183d7c['model'],qs[_0xecd9('0x35')](_0x200574['query'][_0xecd9('0x35')]));_0x159bd5[_0xecd9('0x37')]=_0x159bd5[_0xecd9('0x37')][_0xecd9('0x36')]?_0x159bd5[_0xecd9('0x37')]:_0x183d7c[_0xecd9('0x30')];if(_0x200574[_0xecd9('0x32')][_0xecd9('0x40')]){_0x159bd5[_0xecd9('0x44')]=[{'all':!![]}];}_0x159bd5=_[_0xecd9('0x3e')]({},_0x159bd5,_0x200574[_0xecd9('0x45')]);return db[_0xecd9('0x2b')]['find'](_0x159bd5)[_0xecd9('0x24')](handleEntityNotFound(_0x47d36a,null))[_0xecd9('0x24')](respondWithResult(_0x47d36a,null))[_0xecd9('0x42')](handleError(_0x47d36a,null));};exports[_0xecd9('0x46')]=function(_0x498a55,_0x1cb792){return db['JscriptyQuestionReport'][_0xecd9('0x46')](_0x498a55[_0xecd9('0x47')],{})[_0xecd9('0x24')](respondWithResult(_0x1cb792,0xc9))[_0xecd9('0x42')](handleError(_0x1cb792,null));};exports[_0xecd9('0x22')]=function(_0x223145,_0x4c0425){if(_0x223145[_0xecd9('0x47')]['id']){delete _0x223145[_0xecd9('0x47')]['id'];}return db[_0xecd9('0x2b')][_0xecd9('0x48')]({'where':{'id':_0x223145[_0xecd9('0x49')]['id']}})[_0xecd9('0x24')](handleEntityNotFound(_0x4c0425,null))['then'](saveUpdates(_0x223145[_0xecd9('0x47')],null))[_0xecd9('0x24')](respondWithResult(_0x4c0425,null))[_0xecd9('0x42')](handleError(_0x4c0425,null));};exports['destroy']=function(_0x4692b9,_0x1b77d9){return db['JscriptyQuestionReport'][_0xecd9('0x48')]({'where':{'id':_0x4692b9[_0xecd9('0x49')]['id']}})[_0xecd9('0x24')](handleEntityNotFound(_0x1b77d9,null))[_0xecd9('0x24')](removeEntity(_0x1b77d9,null))[_0xecd9('0x42')](handleError(_0x1b77d9,null));};exports[_0xecd9('0x4a')]=function(_0x4b235d,_0x4d6bf7){return db[_0xecd9('0x2b')][_0xecd9('0x4a')]()['then'](respondWithResult(_0x4d6bf7,null))[_0xecd9('0x42')](handleError(_0x4d6bf7,null));};
\ No newline at end of file
index 9c37ef3..c3a7713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a75=['api','moment','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','util','../../config/logger'];(function(_0x56e09b,_0x3ec33b){var _0x5776c2=function(_0x30054c){while(--_0x30054c){_0x56e09b['push'](_0x56e09b['shift']());}};_0x5776c2(++_0x3ec33b);}(_0x4a75,0xcf));var _0x54a7=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x4a75[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require(_0x54a7('0x0'));var logger=require(_0x54a7('0x1'))(_0x54a7('0x2'));var moment=require(_0x54a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x54a7('0x4'));var fs=require('fs');var path=require(_0x54a7('0x5'));var rimraf=require('rimraf');var config=require(_0x54a7('0x6'));var attributes=require(_0x54a7('0x7'));module[_0x54a7('0x8')]=function(_0x3c3e44,_0x2d140f){return _0x3c3e44[_0x54a7('0x9')](_0x54a7('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc587=['exports','define','report_jscripty_questions','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x31f02b,_0x30a4d0){var _0x7b16d0=function(_0x9ca43b){while(--_0x9ca43b){_0x31f02b['push'](_0x31f02b['shift']());}};_0x7b16d0(++_0x30a4d0);}(_0xc587,0xf5));var _0x7c58=function(_0x139cf1,_0x4e068b){_0x139cf1=_0x139cf1-0x0;var _0x3b1aa7=_0xc587[_0x139cf1];return _0x3b1aa7;};'use strict';var _=require(_0x7c58('0x0'));var util=require('util');var logger=require(_0x7c58('0x1'))(_0x7c58('0x2'));var moment=require(_0x7c58('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c58('0x4'));var fs=require('fs');var path=require(_0x7c58('0x5'));var rimraf=require('rimraf');var config=require(_0x7c58('0x6'));var attributes=require(_0x7c58('0x7'));module[_0x7c58('0x8')]=function(_0x1b3786,_0x2b3352){return _0x1b3786[_0x7c58('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x7c58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 748e184..3338c07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d15=['http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d15,0x1f1));var _0x50d1=function(_0x4f8cd8,_0x5dc3d7){_0x4f8cd8=_0x4f8cd8-0x0;var _0x2e2b0b=_0x0d15[_0x4f8cd8];return _0x2e2b0b;};'use strict';var _=require('lodash');var util=require(_0x50d1('0x0'));var moment=require('moment');var BPromise=require(_0x50d1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x50d1('0x2'));var logger=require(_0x50d1('0x3'))('rpc');var config=require(_0x50d1('0x4'));var jayson=require(_0x50d1('0x5'));var client=jayson[_0x50d1('0x6')][_0x50d1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d7de8,_0x7def26,_0x3b61bd){return new BPromise(function(_0x167ffb,_0x183ed4){return client['request'](_0x1d7de8,_0x3b61bd)[_0x50d1('0x8')](function(_0x2e24f7){logger[_0x50d1('0x9')](_0x50d1('0xa'),_0x7def26,_0x50d1('0xb'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x7def26,_0x50d1('0xb'),JSON[_0x50d1('0xc')](_0x2e24f7));if(_0x2e24f7[_0x50d1('0xd')]){if(_0x2e24f7[_0x50d1('0xd')][_0x50d1('0xe')]===0x1f4){logger[_0x50d1('0xd')](_0x50d1('0xa'),_0x7def26,_0x2e24f7[_0x50d1('0xd')][_0x50d1('0xf')]);return _0x183ed4(_0x2e24f7['error'][_0x50d1('0xf')]);}logger[_0x50d1('0xd')](_0x50d1('0xa'),_0x7def26,_0x2e24f7[_0x50d1('0xd')][_0x50d1('0xf')]);return _0x167ffb(_0x2e24f7[_0x50d1('0xd')][_0x50d1('0xf')]);}else{logger['info'](_0x50d1('0xa'),_0x7def26,_0x50d1('0xb'));_0x167ffb(_0x2e24f7[_0x50d1('0x10')][_0x50d1('0xf')]);}})[_0x50d1('0x11')](function(_0x7f3b6){logger[_0x50d1('0xd')](_0x50d1('0xa'),_0x7def26,_0x7f3b6);_0x183ed4(_0x7f3b6);});});}
\ No newline at end of file
+var _0x41ee=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x68a21c,_0x40a24e){var _0x532d51=function(_0x3a9ad4){while(--_0x3a9ad4){_0x68a21c['push'](_0x68a21c['shift']());}};_0x532d51(++_0x40a24e);}(_0x41ee,0x92));var _0xe41e=function(_0x2401e6,_0x2248d7){_0x2401e6=_0x2401e6-0x0;var _0xf06a43=_0x41ee[_0x2401e6];return _0xf06a43;};'use strict';var _=require(_0xe41e('0x0'));var util=require(_0xe41e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe41e('0x2'));var fs=require('fs');var Redis=require(_0xe41e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe41e('0x4'));var logger=require(_0xe41e('0x5'))(_0xe41e('0x6'));var config=require(_0xe41e('0x7'));var jayson=require(_0xe41e('0x8'));var client=jayson[_0xe41e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35c9a3,_0x54a6cf,_0x39a23e){return new BPromise(function(_0xb869f1,_0x5f1c42){return client['request'](_0x35c9a3,_0x39a23e)[_0xe41e('0xa')](function(_0x1691bd){logger[_0xe41e('0xb')](_0xe41e('0xc'),_0x54a6cf,_0xe41e('0xd'));logger[_0xe41e('0xe')](_0xe41e('0xf'),_0x54a6cf,_0xe41e('0xd'),JSON[_0xe41e('0x10')](_0x1691bd));if(_0x1691bd[_0xe41e('0x11')]){if(_0x1691bd[_0xe41e('0x11')]['code']===0x1f4){logger['error'](_0xe41e('0xc'),_0x54a6cf,_0x1691bd[_0xe41e('0x11')][_0xe41e('0x12')]);return _0x5f1c42(_0x1691bd['error'][_0xe41e('0x12')]);}logger[_0xe41e('0x11')](_0xe41e('0xc'),_0x54a6cf,_0x1691bd[_0xe41e('0x11')]['message']);return _0xb869f1(_0x1691bd[_0xe41e('0x11')][_0xe41e('0x12')]);}else{logger[_0xe41e('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x54a6cf,'request\x20sent');_0xb869f1(_0x1691bd[_0xe41e('0x13')][_0xe41e('0x12')]);}})['catch'](function(_0x4e943d){logger[_0xe41e('0x11')](_0xe41e('0xc'),_0x54a6cf,_0x4e943d);_0x5f1c42(_0x4e943d);});});}
\ No newline at end of file
index 7015513..da0f3b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ff6=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','getQuestions','post','create','put','delete','destroy'];(function(_0x28c618,_0x51a7e0){var _0x4d11e1=function(_0x31fa2a){while(--_0x31fa2a){_0x28c618['push'](_0x28c618['shift']());}};_0x4d11e1(++_0x51a7e0);}(_0x7ff6,0x143));var _0x67ff=function(_0x41ad2d,_0x20b36f){_0x41ad2d=_0x41ad2d-0x0;var _0x3cb6ea=_0x7ff6[_0x41ad2d];return _0x3cb6ea;};'use strict';var multer=require('multer');var util=require(_0x67ff('0x0'));var path=require(_0x67ff('0x1'));var timeout=require(_0x67ff('0x2'));var express=require(_0x67ff('0x3'));var router=express[_0x67ff('0x4')]();var fs_extra=require(_0x67ff('0x5'));var auth=require(_0x67ff('0x6'));var interaction=require(_0x67ff('0x7'));var config=require(_0x67ff('0x8'));var controller=require(_0x67ff('0x9'));router[_0x67ff('0xa')]('/',auth[_0x67ff('0xb')](),controller['index']);router['get'](_0x67ff('0xc'),auth[_0x67ff('0xb')](),controller[_0x67ff('0xd')]);router[_0x67ff('0xa')](_0x67ff('0xe'),auth[_0x67ff('0xb')](),controller[_0x67ff('0xf')]);router[_0x67ff('0xa')]('/:id/questions',auth[_0x67ff('0xb')](),controller[_0x67ff('0x10')]);router[_0x67ff('0x11')]('/',auth['isAuthenticated'](),controller[_0x67ff('0x12')]);router[_0x67ff('0x13')](_0x67ff('0xe'),auth[_0x67ff('0xb')](),controller['update']);router[_0x67ff('0x14')](_0x67ff('0xe'),auth['isAuthenticated'](),controller[_0x67ff('0x15')]);module[_0x67ff('0x16')]=router;
\ No newline at end of file
+var _0x33af=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x374221,_0x4cb5b1){var _0x4daa58=function(_0x335572){while(--_0x335572){_0x374221['push'](_0x374221['shift']());}};_0x4daa58(++_0x4cb5b1);}(_0x33af,0xfc));var _0xf33a=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0x33af[_0x50cd41];return _0x399475;};'use strict';var multer=require(_0xf33a('0x0'));var util=require(_0xf33a('0x1'));var path=require('path');var timeout=require(_0xf33a('0x2'));var express=require(_0xf33a('0x3'));var router=express[_0xf33a('0x4')]();var fs_extra=require(_0xf33a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xf33a('0x7')]('/',auth[_0xf33a('0x8')](),controller[_0xf33a('0x9')]);router[_0xf33a('0x7')](_0xf33a('0xa'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xb')]);router[_0xf33a('0x7')](_0xf33a('0xc'),auth['isAuthenticated'](),controller[_0xf33a('0xd')]);router[_0xf33a('0x7')]('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router[_0xf33a('0xe')]('/',auth[_0xf33a('0x8')](),controller[_0xf33a('0xf')]);router[_0xf33a('0x10')](_0xf33a('0xc'),auth[_0xf33a('0x8')](),controller[_0xf33a('0x11')]);router[_0xf33a('0x12')](_0xf33a('0xc'),auth[_0xf33a('0x8')](),controller[_0xf33a('0x13')]);module[_0xf33a('0x14')]=router;
\ No newline at end of file
index 8553867..12b3330 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf13d=['exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize'];(function(_0x9aad68,_0x45377){var _0x281340=function(_0x494ac1){while(--_0x494ac1){_0x9aad68['push'](_0x9aad68['shift']());}};_0x281340(++_0x45377);}(_0xf13d,0x174));var _0xdf13=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xf13d[_0x4a53d];return _0x27410e;};'use strict';var moment=require(_0xdf13('0x0'));var Sequelize=require(_0xdf13('0x1'));module[_0xdf13('0x2')]={'starttime':{'type':Sequelize[_0xdf13('0x3')],'set':function(_0x785372){this[_0xdf13('0x4')](_0xdf13('0x5'),_0x785372);this[_0xdf13('0x4')](_0xdf13('0x6'),moment()[_0xdf13('0x7')](_0xdf13('0x8')));}},'endtime':{'type':Sequelize[_0xdf13('0x3')]},'membername':{'type':Sequelize[_0xdf13('0x9')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xdf13('0x9')]},'uniqueid':{'type':Sequelize[_0xdf13('0x9')]},'calleridname':{'type':Sequelize[_0xdf13('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xdf13('0xa')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5447=['moment','sequelize','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5447,0xd0));var _0x7544=function(_0x100aef,_0x47fbae){_0x100aef=_0x100aef-0x0;var _0x2fd2b2=_0x5447[_0x100aef];return _0x2fd2b2;};'use strict';var moment=require(_0x7544('0x0'));var Sequelize=require(_0x7544('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x7544('0x2')],'set':function(_0x2ded22){this[_0x7544('0x3')]('starttime',_0x2ded22);this['setDataValue'](_0x7544('0x4'),moment()[_0x7544('0x5')](_0x7544('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x7544('0x7')]},'projectname':{'type':Sequelize[_0x7544('0x7')]},'queue':{'type':Sequelize[_0x7544('0x7')]},'uniqueid':{'type':Sequelize[_0x7544('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 18ab37a..5e86dd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99a2=['describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','pick','SessionId','eml-format','rimraf','fast-json-patch','request-promise','moment','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','JscriptySessionReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x181063,_0x38b543){var _0x248efa=function(_0x13183d){while(--_0x13183d){_0x181063['push'](_0x181063['shift']());}};_0x248efa(++_0x38b543);}(_0x99a2,0xfa));var _0x299a=function(_0x1790bc,_0x422ae3){_0x1790bc=_0x1790bc-0x0;var _0x1d7e0b=_0x99a2[_0x1790bc];return _0x1d7e0b;};'use strict';var emlformat=require(_0x299a('0x0'));var rimraf=require(_0x299a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x299a('0x2'));var rp=require(_0x299a('0x3'));var moment=require(_0x299a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x299a('0x5'));var ejs=require(_0x299a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x299a('0x7'));var squel=require(_0x299a('0x8'));var crypto=require(_0x299a('0x9'));var jsforce=require(_0x299a('0xa'));var deskjs=require(_0x299a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x299a('0xc'));var Papa=require(_0x299a('0xd'));var Redis=require(_0x299a('0xe'));var authService=require(_0x299a('0xf'));var qs=require(_0x299a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x299a('0x11'))(_0x299a('0x12'));var utils=require(_0x299a('0x13'));var config=require(_0x299a('0x14'));var licenseUtil=require(_0x299a('0x15'));var db=require(_0x299a('0x16'))['db'];function respondWithStatusCode(_0x37eb7d,_0x8be852){_0x8be852=_0x8be852||0xcc;return function(_0x42642a){if(_0x42642a){return _0x37eb7d[_0x299a('0x17')](_0x8be852);}return _0x37eb7d[_0x299a('0x18')](_0x8be852)[_0x299a('0x19')]();};}function respondWithResult(_0x1addb3,_0x844b15){_0x844b15=_0x844b15||0xc8;return function(_0x489482){if(_0x489482){return _0x1addb3[_0x299a('0x18')](_0x844b15)[_0x299a('0x1a')](_0x489482);}};}function respondWithFilteredResult(_0x356401,_0x59bf78){return function(_0x1a6ae0){if(_0x1a6ae0){var _0x1de6e0=typeof _0x59bf78[_0x299a('0x1b')]===_0x299a('0x1c')&&typeof _0x59bf78[_0x299a('0x1d')]===_0x299a('0x1c');var _0x4303b7=_0x1a6ae0[_0x299a('0x1e')];var _0x4e817b=_0x1de6e0?0x0:_0x59bf78[_0x299a('0x1b')];var _0x143986=_0x1de6e0?_0x1a6ae0[_0x299a('0x1e')]:_0x59bf78[_0x299a('0x1b')]+_0x59bf78[_0x299a('0x1d')];var _0x5b57bc;if(_0x143986>=_0x4303b7){_0x143986=_0x4303b7;_0x5b57bc=0xc8;}else{_0x5b57bc=0xce;}_0x356401[_0x299a('0x18')](_0x5b57bc);return _0x356401[_0x299a('0x1f')](_0x299a('0x20'),_0x4e817b+'-'+_0x143986+'/'+_0x4303b7)[_0x299a('0x1a')](_0x1a6ae0);}return null;};}function patchUpdates(_0x39f9f9){return function(_0x253c7e){try{jsonpatch[_0x299a('0x21')](_0x253c7e,_0x39f9f9,!![]);}catch(_0x2944a4){return BPromise[_0x299a('0x22')](_0x2944a4);}return _0x253c7e[_0x299a('0x23')]();};}function saveUpdates(_0x443b66,_0x45ebde){return function(_0x19ce81){if(_0x19ce81){return _0x19ce81[_0x299a('0x24')](_0x443b66)['then'](function(_0x34faab){return _0x34faab;});}return null;};}function removeEntity(_0x76415d,_0x31a3f2){return function(_0x233ece){if(_0x233ece){return _0x233ece[_0x299a('0x25')]()['then'](function(){_0x76415d[_0x299a('0x18')](0xcc)[_0x299a('0x19')]();});}};}function handleEntityNotFound(_0x44c216,_0xc8d200){return function(_0xabcfb7){if(!_0xabcfb7){_0x44c216[_0x299a('0x17')](0x194);}return _0xabcfb7;};}function handleError(_0x3bfb58,_0x1d06b7){_0x1d06b7=_0x1d06b7||0x1f4;return function(_0x560027){logger[_0x299a('0x26')](_0x560027[_0x299a('0x27')]);if(_0x560027[_0x299a('0x28')]){delete _0x560027[_0x299a('0x28')];}_0x3bfb58[_0x299a('0x18')](_0x1d06b7)[_0x299a('0x29')](_0x560027);};}exports['index']=function(_0xba1a10,_0x4bc566){var _0x28391e={},_0x43fefe={},_0x1e164b={'count':0x0,'rows':[]};var _0x2a4088=_['map'](db[_0x299a('0x2a')]['rawAttributes'],function(_0x3b6559){return{'name':_0x3b6559[_0x299a('0x2b')],'type':_0x3b6559[_0x299a('0x2c')]['key']};});_0x43fefe[_0x299a('0x2d')]=_[_0x299a('0x2e')](_0x2a4088,_0x299a('0x28'));_0x43fefe[_0x299a('0x2f')]=_[_0x299a('0x30')](_0xba1a10[_0x299a('0x2f')]);_0x43fefe[_0x299a('0x31')]=_['intersection'](_0x43fefe[_0x299a('0x2d')],_0x43fefe[_0x299a('0x2f')]);_0x28391e[_0x299a('0x32')]=_[_0x299a('0x33')](_0x43fefe[_0x299a('0x2d')],qs[_0x299a('0x34')](_0xba1a10[_0x299a('0x2f')][_0x299a('0x34')]));_0x28391e['attributes']=_0x28391e[_0x299a('0x32')][_0x299a('0x35')]?_0x28391e['attributes']:_0x43fefe[_0x299a('0x2d')];if(!_0xba1a10[_0x299a('0x2f')][_0x299a('0x36')](_0x299a('0x37'))){_0x28391e[_0x299a('0x1d')]=qs[_0x299a('0x1d')](_0xba1a10[_0x299a('0x2f')]['limit']);_0x28391e['offset']=qs['offset'](_0xba1a10[_0x299a('0x2f')]['offset']);}_0x28391e[_0x299a('0x38')]=qs[_0x299a('0x39')](_0xba1a10['query'][_0x299a('0x39')]);_0x28391e[_0x299a('0x3a')]=qs[_0x299a('0x31')](_['pick'](_0xba1a10[_0x299a('0x2f')],_0x43fefe[_0x299a('0x31')]),_0x2a4088);if(_0xba1a10['query'][_0x299a('0x3b')]){_0x28391e[_0x299a('0x3a')]=_[_0x299a('0x3c')](_0x28391e['where'],{'$or':_[_0x299a('0x2e')](_0x2a4088,function(_0x5d1866){if(_0x5d1866['type']!==_0x299a('0x3d')){var _0x110352={};_0x110352[_0x5d1866[_0x299a('0x28')]]={'$like':'%'+_0xba1a10['query']['filter']+'%'};return _0x110352;}})});}_0x28391e=_[_0x299a('0x3c')]({},_0x28391e,_0xba1a10[_0x299a('0x3e')]);var _0x1b5cde={'where':_0x28391e[_0x299a('0x3a')]};return db[_0x299a('0x2a')][_0x299a('0x1e')](_0x1b5cde)[_0x299a('0x3f')](function(_0x1fb6ef){_0x1e164b[_0x299a('0x1e')]=_0x1fb6ef;if(_0xba1a10['query'][_0x299a('0x40')]){_0x28391e[_0x299a('0x41')]=[{'all':!![]}];}return db[_0x299a('0x2a')][_0x299a('0x42')](_0x28391e);})[_0x299a('0x3f')](function(_0x1f7206){_0x1e164b[_0x299a('0x43')]=_0x1f7206;return _0x1e164b;})[_0x299a('0x3f')](respondWithFilteredResult(_0x4bc566,_0x28391e))[_0x299a('0x44')](handleError(_0x4bc566,null));};exports[_0x299a('0x45')]=function(_0x379159,_0x55d2ed){var _0x10838e={'raw':!![],'where':{'id':_0x379159[_0x299a('0x46')]['id']}},_0x1dc36a={};_0x1dc36a[_0x299a('0x2d')]=_[_0x299a('0x30')](db[_0x299a('0x2a')]['rawAttributes']);_0x1dc36a['query']=_[_0x299a('0x30')](_0x379159['query']);_0x1dc36a[_0x299a('0x31')]=_[_0x299a('0x33')](_0x1dc36a[_0x299a('0x2d')],_0x1dc36a[_0x299a('0x2f')]);_0x10838e[_0x299a('0x32')]=_[_0x299a('0x33')](_0x1dc36a[_0x299a('0x2d')],qs['fields'](_0x379159[_0x299a('0x2f')][_0x299a('0x34')]));_0x10838e[_0x299a('0x32')]=_0x10838e[_0x299a('0x32')][_0x299a('0x35')]?_0x10838e[_0x299a('0x32')]:_0x1dc36a['model'];if(_0x379159[_0x299a('0x2f')]['includeAll']){_0x10838e[_0x299a('0x41')]=[{'all':!![]}];}_0x10838e=_[_0x299a('0x3c')]({},_0x10838e,_0x379159['options']);return db[_0x299a('0x2a')][_0x299a('0x47')](_0x10838e)[_0x299a('0x3f')](handleEntityNotFound(_0x55d2ed,null))[_0x299a('0x3f')](respondWithResult(_0x55d2ed,null))['catch'](handleError(_0x55d2ed,null));};exports[_0x299a('0x48')]=function(_0x71e4cb,_0x482e88){return db[_0x299a('0x2a')][_0x299a('0x48')](_0x71e4cb[_0x299a('0x49')],{})[_0x299a('0x3f')](respondWithResult(_0x482e88,0xc9))[_0x299a('0x44')](handleError(_0x482e88,null));};exports[_0x299a('0x24')]=function(_0x3b8d4f,_0x245327){if(_0x3b8d4f[_0x299a('0x49')]['id']){delete _0x3b8d4f[_0x299a('0x49')]['id'];}return db[_0x299a('0x2a')][_0x299a('0x47')]({'where':{'id':_0x3b8d4f[_0x299a('0x46')]['id']}})[_0x299a('0x3f')](handleEntityNotFound(_0x245327,null))[_0x299a('0x3f')](saveUpdates(_0x3b8d4f[_0x299a('0x49')],null))[_0x299a('0x3f')](respondWithResult(_0x245327,null))['catch'](handleError(_0x245327,null));};exports[_0x299a('0x25')]=function(_0x1991ba,_0x28a1f7){return db[_0x299a('0x2a')]['find']({'where':{'id':_0x1991ba[_0x299a('0x46')]['id']}})['then'](handleEntityNotFound(_0x28a1f7,null))[_0x299a('0x3f')](removeEntity(_0x28a1f7,null))[_0x299a('0x44')](handleError(_0x28a1f7,null));};exports[_0x299a('0x4a')]=function(_0x368acb,_0x33f426){return db[_0x299a('0x2a')][_0x299a('0x4a')]()[_0x299a('0x3f')](respondWithResult(_0x33f426,null))[_0x299a('0x44')](handleError(_0x33f426,null));};exports[_0x299a('0x4b')]=function(_0x3cc54c,_0x2a2cda,_0x253210){var _0x2abaef={'raw':!![],'where':{}};var _0x7eb7fd={};var _0x438c32={'count':0x0,'rows':[]};return db[_0x299a('0x2a')][_0x299a('0x4c')]({'where':{'id':_0x3cc54c[_0x299a('0x46')]['id']}})[_0x299a('0x3f')](handleEntityNotFound(_0x2a2cda,null))[_0x299a('0x3f')](function(_0x2653ad){if(_0x2653ad){_0x7eb7fd[_0x299a('0x2d')]=_[_0x299a('0x30')](db[_0x299a('0x4d')][_0x299a('0x4e')]);_0x7eb7fd[_0x299a('0x2f')]=_['keys'](_0x3cc54c[_0x299a('0x2f')]);_0x7eb7fd[_0x299a('0x31')]=_[_0x299a('0x33')](_0x7eb7fd[_0x299a('0x2d')],_0x7eb7fd['query']);_0x2abaef['attributes']=_[_0x299a('0x33')](_0x7eb7fd['model'],qs['fields'](_0x3cc54c[_0x299a('0x2f')][_0x299a('0x34')]));_0x2abaef[_0x299a('0x32')]=_0x2abaef[_0x299a('0x32')][_0x299a('0x35')]?_0x2abaef[_0x299a('0x32')]:_0x7eb7fd['model'];if(!_0x3cc54c[_0x299a('0x2f')][_0x299a('0x36')](_0x299a('0x37'))){_0x2abaef[_0x299a('0x1d')]=qs[_0x299a('0x1d')](_0x3cc54c['query']['limit']);_0x2abaef[_0x299a('0x1b')]=qs['offset'](_0x3cc54c[_0x299a('0x2f')]['offset']);}_0x2abaef[_0x299a('0x38')]=qs[_0x299a('0x39')](_0x3cc54c['query'][_0x299a('0x39')]);_0x2abaef[_0x299a('0x3a')]=qs[_0x299a('0x31')](_[_0x299a('0x4f')](_0x3cc54c[_0x299a('0x2f')],_0x7eb7fd[_0x299a('0x31')]));_0x2abaef[_0x299a('0x3a')][_0x299a('0x50')]=_0x2653ad['id'];if(_0x3cc54c[_0x299a('0x2f')][_0x299a('0x3b')]){_0x2abaef[_0x299a('0x3a')]=_[_0x299a('0x3c')](_0x2abaef[_0x299a('0x3a')],{'$or':_[_0x299a('0x2e')](_0x2abaef[_0x299a('0x32')],function(_0x41fdb2){var _0x7d11a4={};_0x7d11a4[_0x41fdb2]={'$like':'%'+_0x3cc54c[_0x299a('0x2f')][_0x299a('0x3b')]+'%'};return _0x7d11a4;})});}_0x2abaef=_[_0x299a('0x3c')]({},_0x2abaef,_0x3cc54c[_0x299a('0x3e')]);return db[_0x299a('0x4d')][_0x299a('0x1e')]({'where':_0x2abaef[_0x299a('0x3a')]})[_0x299a('0x3f')](function(_0x5407b7){_0x438c32[_0x299a('0x1e')]=_0x5407b7;if(_0x3cc54c['query'][_0x299a('0x40')]){_0x2abaef[_0x299a('0x41')]=[{'all':!![]}];}return db[_0x299a('0x4d')]['findAll'](_0x2abaef);})['then'](function(_0x1f38a3){_0x438c32[_0x299a('0x43')]=_0x1f38a3;return _0x438c32;});}})[_0x299a('0x3f')](respondWithFilteredResult(_0x2a2cda,_0x2abaef))[_0x299a('0x44')](handleError(_0x2a2cda,null));};
\ No newline at end of file
+var _0xcf9c=['fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','JscriptySessionReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','type','VIRTUAL','filter','findAll','rows','catch','show','params','include','options','find','create','body','describe','JscriptyQuestionReport','hasOwnProperty','pick','SessionId','merge','includeAll','eml-format','rimraf','zip-dir'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcf9c,0x12d));var _0xccf9=function(_0x1e8eb4,_0x53a726){_0x1e8eb4=_0x1e8eb4-0x0;var _0x3e3e6e=_0xcf9c[_0x1e8eb4];return _0x3e3e6e;};'use strict';var emlformat=require(_0xccf9('0x0'));var rimraf=require(_0xccf9('0x1'));var zipdir=require(_0xccf9('0x2'));var jsonpatch=require(_0xccf9('0x3'));var rp=require(_0xccf9('0x4'));var moment=require(_0xccf9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xccf9('0x6'));var util=require(_0xccf9('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xccf9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccf9('0x9'));var _=require(_0xccf9('0xa'));var squel=require(_0xccf9('0xb'));var crypto=require('crypto');var jsforce=require(_0xccf9('0xc'));var deskjs=require(_0xccf9('0xd'));var toCsv=require(_0xccf9('0x8'));var querystring=require(_0xccf9('0xe'));var Papa=require(_0xccf9('0xf'));var Redis=require(_0xccf9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccf9('0x11'));var logger=require(_0xccf9('0x12'))(_0xccf9('0x13'));var utils=require(_0xccf9('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f679,_0x5c1b6a){_0x5c1b6a=_0x5c1b6a||0xcc;return function(_0x1053d2){if(_0x1053d2){return _0x11f679[_0xccf9('0x15')](_0x5c1b6a);}return _0x11f679[_0xccf9('0x16')](_0x5c1b6a)[_0xccf9('0x17')]();};}function respondWithResult(_0x171601,_0x2ad2b9){_0x2ad2b9=_0x2ad2b9||0xc8;return function(_0x5200bd){if(_0x5200bd){return _0x171601[_0xccf9('0x16')](_0x2ad2b9)[_0xccf9('0x18')](_0x5200bd);}};}function respondWithFilteredResult(_0x4f9e3b,_0x3e101d){return function(_0x33bf52){if(_0x33bf52){var _0x55252b=typeof _0x3e101d['offset']===_0xccf9('0x19')&&typeof _0x3e101d['limit']===_0xccf9('0x19');var _0x22ffb6=_0x33bf52['count'];var _0x1b5271=_0x55252b?0x0:_0x3e101d['offset'];var _0x12a2f7=_0x55252b?_0x33bf52[_0xccf9('0x1a')]:_0x3e101d[_0xccf9('0x1b')]+_0x3e101d[_0xccf9('0x1c')];var _0x37bd5f;if(_0x12a2f7>=_0x22ffb6){_0x12a2f7=_0x22ffb6;_0x37bd5f=0xc8;}else{_0x37bd5f=0xce;}_0x4f9e3b[_0xccf9('0x16')](_0x37bd5f);return _0x4f9e3b[_0xccf9('0x1d')](_0xccf9('0x1e'),_0x1b5271+'-'+_0x12a2f7+'/'+_0x22ffb6)['json'](_0x33bf52);}return null;};}function patchUpdates(_0x46a892){return function(_0x452039){try{jsonpatch[_0xccf9('0x1f')](_0x452039,_0x46a892,!![]);}catch(_0x41ce6b){return BPromise[_0xccf9('0x20')](_0x41ce6b);}return _0x452039[_0xccf9('0x21')]();};}function saveUpdates(_0x575dea,_0x15b9b8){return function(_0x56fdc0){if(_0x56fdc0){return _0x56fdc0[_0xccf9('0x22')](_0x575dea)[_0xccf9('0x23')](function(_0x56ac08){return _0x56ac08;});}return null;};}function removeEntity(_0x235457,_0x1b1e30){return function(_0x3209d7){if(_0x3209d7){return _0x3209d7[_0xccf9('0x24')]()[_0xccf9('0x23')](function(){_0x235457[_0xccf9('0x16')](0xcc)[_0xccf9('0x17')]();});}};}function handleEntityNotFound(_0x39da78,_0x58c246){return function(_0xb4883c){if(!_0xb4883c){_0x39da78[_0xccf9('0x15')](0x194);}return _0xb4883c;};}function handleError(_0x2a0a7f,_0x4abe61){_0x4abe61=_0x4abe61||0x1f4;return function(_0x1d672d){logger[_0xccf9('0x25')](_0x1d672d[_0xccf9('0x26')]);if(_0x1d672d['name']){delete _0x1d672d[_0xccf9('0x27')];}_0x2a0a7f[_0xccf9('0x16')](_0x4abe61)[_0xccf9('0x28')](_0x1d672d);};}exports['index']=function(_0x5ceb52,_0x9ee16c){var _0x250598={},_0x1876fe={},_0x4da9d6={'count':0x0,'rows':[]};var _0x2d5fc3=_[_0xccf9('0x29')](db[_0xccf9('0x2a')][_0xccf9('0x2b')],function(_0x35fad3){return{'name':_0x35fad3['fieldName'],'type':_0x35fad3['type']['key']};});_0x1876fe[_0xccf9('0x2c')]=_['map'](_0x2d5fc3,_0xccf9('0x27'));_0x1876fe[_0xccf9('0x2d')]=_[_0xccf9('0x2e')](_0x5ceb52[_0xccf9('0x2d')]);_0x1876fe[_0xccf9('0x2f')]=_['intersection'](_0x1876fe[_0xccf9('0x2c')],_0x1876fe[_0xccf9('0x2d')]);_0x250598[_0xccf9('0x30')]=_[_0xccf9('0x31')](_0x1876fe[_0xccf9('0x2c')],qs[_0xccf9('0x32')](_0x5ceb52[_0xccf9('0x2d')][_0xccf9('0x32')]));_0x250598[_0xccf9('0x30')]=_0x250598[_0xccf9('0x30')][_0xccf9('0x33')]?_0x250598['attributes']:_0x1876fe['model'];if(!_0x5ceb52[_0xccf9('0x2d')]['hasOwnProperty'](_0xccf9('0x34'))){_0x250598['limit']=qs[_0xccf9('0x1c')](_0x5ceb52[_0xccf9('0x2d')][_0xccf9('0x1c')]);_0x250598['offset']=qs[_0xccf9('0x1b')](_0x5ceb52['query'][_0xccf9('0x1b')]);}_0x250598[_0xccf9('0x35')]=qs['sort'](_0x5ceb52['query'][_0xccf9('0x36')]);_0x250598[_0xccf9('0x37')]=qs[_0xccf9('0x2f')](_['pick'](_0x5ceb52[_0xccf9('0x2d')],_0x1876fe['filters']),_0x2d5fc3);if(_0x5ceb52[_0xccf9('0x2d')]['filter']){_0x250598[_0xccf9('0x37')]=_['merge'](_0x250598[_0xccf9('0x37')],{'$or':_[_0xccf9('0x29')](_0x2d5fc3,function(_0x462cf3){if(_0x462cf3[_0xccf9('0x38')]!==_0xccf9('0x39')){var _0x1ef71e={};_0x1ef71e[_0x462cf3[_0xccf9('0x27')]]={'$like':'%'+_0x5ceb52[_0xccf9('0x2d')][_0xccf9('0x3a')]+'%'};return _0x1ef71e;}})});}_0x250598=_['merge']({},_0x250598,_0x5ceb52['options']);var _0x53cc00={'where':_0x250598[_0xccf9('0x37')]};return db[_0xccf9('0x2a')][_0xccf9('0x1a')](_0x53cc00)[_0xccf9('0x23')](function(_0x4886fa){_0x4da9d6[_0xccf9('0x1a')]=_0x4886fa;if(_0x5ceb52[_0xccf9('0x2d')]['includeAll']){_0x250598['include']=[{'all':!![]}];}return db[_0xccf9('0x2a')][_0xccf9('0x3b')](_0x250598);})[_0xccf9('0x23')](function(_0x3d31c6){_0x4da9d6[_0xccf9('0x3c')]=_0x3d31c6;return _0x4da9d6;})[_0xccf9('0x23')](respondWithFilteredResult(_0x9ee16c,_0x250598))[_0xccf9('0x3d')](handleError(_0x9ee16c,null));};exports[_0xccf9('0x3e')]=function(_0x31c56e,_0x105307){var _0x52b247={'raw':!![],'where':{'id':_0x31c56e[_0xccf9('0x3f')]['id']}},_0x16097e={};_0x16097e['model']=_['keys'](db[_0xccf9('0x2a')][_0xccf9('0x2b')]);_0x16097e[_0xccf9('0x2d')]=_['keys'](_0x31c56e['query']);_0x16097e['filters']=_['intersection'](_0x16097e[_0xccf9('0x2c')],_0x16097e['query']);_0x52b247[_0xccf9('0x30')]=_[_0xccf9('0x31')](_0x16097e[_0xccf9('0x2c')],qs['fields'](_0x31c56e[_0xccf9('0x2d')]['fields']));_0x52b247[_0xccf9('0x30')]=_0x52b247[_0xccf9('0x30')][_0xccf9('0x33')]?_0x52b247[_0xccf9('0x30')]:_0x16097e['model'];if(_0x31c56e[_0xccf9('0x2d')]['includeAll']){_0x52b247[_0xccf9('0x40')]=[{'all':!![]}];}_0x52b247=_['merge']({},_0x52b247,_0x31c56e[_0xccf9('0x41')]);return db[_0xccf9('0x2a')][_0xccf9('0x42')](_0x52b247)[_0xccf9('0x23')](handleEntityNotFound(_0x105307,null))[_0xccf9('0x23')](respondWithResult(_0x105307,null))['catch'](handleError(_0x105307,null));};exports[_0xccf9('0x43')]=function(_0x55c708,_0x17546f){return db[_0xccf9('0x2a')][_0xccf9('0x43')](_0x55c708['body'],{})[_0xccf9('0x23')](respondWithResult(_0x17546f,0xc9))['catch'](handleError(_0x17546f,null));};exports[_0xccf9('0x22')]=function(_0x7d8366,_0x290a41){if(_0x7d8366[_0xccf9('0x44')]['id']){delete _0x7d8366[_0xccf9('0x44')]['id'];}return db[_0xccf9('0x2a')][_0xccf9('0x42')]({'where':{'id':_0x7d8366['params']['id']}})[_0xccf9('0x23')](handleEntityNotFound(_0x290a41,null))['then'](saveUpdates(_0x7d8366['body'],null))[_0xccf9('0x23')](respondWithResult(_0x290a41,null))[_0xccf9('0x3d')](handleError(_0x290a41,null));};exports[_0xccf9('0x24')]=function(_0x17b2e7,_0x23cc43){return db[_0xccf9('0x2a')][_0xccf9('0x42')]({'where':{'id':_0x17b2e7['params']['id']}})[_0xccf9('0x23')](handleEntityNotFound(_0x23cc43,null))[_0xccf9('0x23')](removeEntity(_0x23cc43,null))[_0xccf9('0x3d')](handleError(_0x23cc43,null));};exports['describe']=function(_0x2fdf64,_0x2cbcd6){return db[_0xccf9('0x2a')][_0xccf9('0x45')]()[_0xccf9('0x23')](respondWithResult(_0x2cbcd6,null))[_0xccf9('0x3d')](handleError(_0x2cbcd6,null));};exports['getQuestions']=function(_0x16458a,_0x729995,_0x4a80fd){var _0x3df838={'raw':!![],'where':{}};var _0x23acc2={};var _0x56460f={'count':0x0,'rows':[]};return db[_0xccf9('0x2a')]['findOne']({'where':{'id':_0x16458a[_0xccf9('0x3f')]['id']}})[_0xccf9('0x23')](handleEntityNotFound(_0x729995,null))['then'](function(_0x4841ed){if(_0x4841ed){_0x23acc2[_0xccf9('0x2c')]=_['keys'](db[_0xccf9('0x46')][_0xccf9('0x2b')]);_0x23acc2['query']=_[_0xccf9('0x2e')](_0x16458a[_0xccf9('0x2d')]);_0x23acc2[_0xccf9('0x2f')]=_[_0xccf9('0x31')](_0x23acc2[_0xccf9('0x2c')],_0x23acc2[_0xccf9('0x2d')]);_0x3df838['attributes']=_[_0xccf9('0x31')](_0x23acc2['model'],qs[_0xccf9('0x32')](_0x16458a[_0xccf9('0x2d')][_0xccf9('0x32')]));_0x3df838[_0xccf9('0x30')]=_0x3df838['attributes'][_0xccf9('0x33')]?_0x3df838[_0xccf9('0x30')]:_0x23acc2[_0xccf9('0x2c')];if(!_0x16458a[_0xccf9('0x2d')][_0xccf9('0x47')]('nolimit')){_0x3df838[_0xccf9('0x1c')]=qs[_0xccf9('0x1c')](_0x16458a[_0xccf9('0x2d')][_0xccf9('0x1c')]);_0x3df838[_0xccf9('0x1b')]=qs[_0xccf9('0x1b')](_0x16458a['query'][_0xccf9('0x1b')]);}_0x3df838[_0xccf9('0x35')]=qs['sort'](_0x16458a[_0xccf9('0x2d')][_0xccf9('0x36')]);_0x3df838[_0xccf9('0x37')]=qs['filters'](_[_0xccf9('0x48')](_0x16458a[_0xccf9('0x2d')],_0x23acc2[_0xccf9('0x2f')]));_0x3df838[_0xccf9('0x37')][_0xccf9('0x49')]=_0x4841ed['id'];if(_0x16458a['query']['filter']){_0x3df838[_0xccf9('0x37')]=_[_0xccf9('0x4a')](_0x3df838[_0xccf9('0x37')],{'$or':_[_0xccf9('0x29')](_0x3df838[_0xccf9('0x30')],function(_0x22ec41){var _0x9bd16d={};_0x9bd16d[_0x22ec41]={'$like':'%'+_0x16458a[_0xccf9('0x2d')][_0xccf9('0x3a')]+'%'};return _0x9bd16d;})});}_0x3df838=_['merge']({},_0x3df838,_0x16458a[_0xccf9('0x41')]);return db[_0xccf9('0x46')][_0xccf9('0x1a')]({'where':_0x3df838[_0xccf9('0x37')]})[_0xccf9('0x23')](function(_0x32123b){_0x56460f[_0xccf9('0x1a')]=_0x32123b;if(_0x16458a[_0xccf9('0x2d')][_0xccf9('0x4b')]){_0x3df838[_0xccf9('0x40')]=[{'all':!![]}];}return db[_0xccf9('0x46')][_0xccf9('0x3b')](_0x3df838);})[_0xccf9('0x23')](function(_0xc602fd){_0x56460f[_0xccf9('0x3c')]=_0xc602fd;return _0x56460f;});}})['then'](respondWithFilteredResult(_0x729995,_0x3df838))[_0xccf9('0x3d')](handleError(_0x729995,null));};
\ No newline at end of file
index 5ec1ff3..653c547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x885a,0x180));var _0xa885=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x885a[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c7b=['path','rimraf','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','moment','request-promise'];(function(_0x204f09,_0x480987){var _0x54576e=function(_0x5f139a){while(--_0x5f139a){_0x204f09['push'](_0x204f09['shift']());}};_0x54576e(++_0x480987);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x352f8d,_0x1b40e5){_0x352f8d=_0x352f8d-0x0;var _0x5c5768=_0x6c7b[_0x352f8d];return _0x5c5768;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb6c7('0x1'));var BPromise=require('bluebird');var rp=require(_0xb6c7('0x2'));var fs=require('fs');var path=require(_0xb6c7('0x3'));var rimraf=require(_0xb6c7('0x4'));var config=require('../../config/environment');var attributes=require(_0xb6c7('0x5'));module[_0xb6c7('0x6')]=function(_0xfe3eb9,_0x219abc){return _0xfe3eb9[_0xb6c7('0x7')]('JscriptySessionReport',attributes,{'tableName':_0xb6c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae762fb..6bad8e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82c4=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1ab313,_0x12bccc){var _0x2d73f4=function(_0x225f28){while(--_0x225f28){_0x1ab313['push'](_0x1ab313['shift']());}};_0x2d73f4(++_0x12bccc);}(_0x82c4,0x1ca));var _0x482c=function(_0x38a9cb,_0xfd8b2b){_0x38a9cb=_0x38a9cb-0x0;var _0xfa7687=_0x82c4[_0x38a9cb];return _0xfa7687;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfdb92,_0x32a503,_0x35cdab){return new BPromise(function(_0x1c10f2,_0x3846d8){return client['request'](_0xfdb92,_0x35cdab)[_0x482c('0xa')](function(_0x135cc1){logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));logger[_0x482c('0xe')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x32a503,_0x482c('0xd'),JSON[_0x482c('0xf')](_0x135cc1));if(_0x135cc1[_0x482c('0x10')]){if(_0x135cc1['error'][_0x482c('0x11')]===0x1f4){logger[_0x482c('0x10')](_0x482c('0xc'),_0x32a503,_0x135cc1['error']['message']);return _0x3846d8(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x32a503,_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);return _0x1c10f2(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));_0x1c10f2(_0x135cc1[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x363403){logger[_0x482c('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x32a503,_0x363403);_0x3846d8(_0x363403);});});}
\ No newline at end of file
+var _0x7bd0=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bd0,0x111));var _0x07bd=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x7bd0[_0x1b70e3];return _0x1452ab;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('JscriptySessionReport,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}
\ No newline at end of file
index fad77c5..3388b50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2171=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','exports','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2171,0x143));var _0x1217=function(_0x3295b6,_0x1bc521){_0x3295b6=_0x3295b6-0x0;var _0x4e7914=_0x2171[_0x3295b6];return _0x4e7914;};'use strict';var multer=require('multer');var util=require(_0x1217('0x0'));var path=require(_0x1217('0x1'));var timeout=require(_0x1217('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1217('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1217('0x4'));var config=require(_0x1217('0x5'));var controller=require(_0x1217('0x6'));router[_0x1217('0x7')]('/',controller['index']);router[_0x1217('0x8')](_0x1217('0x9'),auth[_0x1217('0xa')](),controller['update']);module[_0x1217('0xb')]=router;
\ No newline at end of file
+var _0xd730=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','put','isAuthenticated','exports'];(function(_0x3be20a,_0x223336){var _0x7382f6=function(_0x41c98f){while(--_0x41c98f){_0x3be20a['push'](_0x3be20a['shift']());}};_0x7382f6(++_0x223336);}(_0xd730,0xfd));var _0x0d73=function(_0x3fa330,_0x12dc4d){_0x3fa330=_0x3fa330-0x0;var _0xf0952f=_0xd730[_0x3fa330];return _0xf0952f;};'use strict';var multer=require('multer');var util=require(_0x0d73('0x0'));var path=require('path');var timeout=require(_0x0d73('0x1'));var express=require('express');var router=express[_0x0d73('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0d73('0x3'));var interaction=require(_0x0d73('0x4'));var config=require(_0x0d73('0x5'));var controller=require(_0x0d73('0x6'));router['get']('/',controller[_0x0d73('0x7')]);router[_0x0d73('0x8')]('/:id',auth[_0x0d73('0x9')](),controller['update']);module[_0x0d73('0xa')]=router;
\ No newline at end of file
index f3e578b..e4ea041 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab0=['sequelize','STRING'];(function(_0x34fda2,_0x2814b6){var _0x4f128d=function(_0x2a182c){while(--_0x2a182c){_0x34fda2['push'](_0x34fda2['shift']());}};_0x4f128d(++_0x2814b6);}(_0x1ab0,0x7a));var _0x01ab=function(_0x5f0ad2,_0xa5abab){_0x5f0ad2=_0x5f0ad2-0x0;var _0x57a055=_0x1ab0[_0x5f0ad2];return _0x57a055;};'use strict';var Sequelize=require(_0x01ab('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x01ab('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcb61=['sequelize','exports','TEXT','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcb61,0x8c));var _0x1cb6=function(_0x1e151a,_0x30ee1d){_0x1e151a=_0x1e151a-0x0;var _0x3a4c44=_0xcb61[_0x1e151a];return _0x3a4c44;};'use strict';var Sequelize=require(_0x1cb6('0x0'));module[_0x1cb6('0x1')]={'license':{'type':Sequelize[_0x1cb6('0x2')]},'data1':{'type':Sequelize[_0x1cb6('0x3')]},'data2':{'type':Sequelize[_0x1cb6('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index b5068a2..41c3fd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','License','find','checkLicense','key','demo','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x326f,0xd1));var _0xf326=function(_0x150e53,_0x121000){_0x150e53=_0x150e53-0x0;var _0x5d9b96=_0x326f[_0x150e53];return _0x5d9b96;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x6a8e89,_0x1ae23a){var _0x2fa28e={'raw':!![],'where':{'id':0x1}},_0x5dbe63={};_0x5dbe63[_0xf326('0x28')]=_[_0xf326('0x29')](db['License'][_0xf326('0x2a')]);_0x5dbe63[_0xf326('0x2b')]=_[_0xf326('0x29')](_0x6a8e89[_0xf326('0x2b')]);_0x5dbe63[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5dbe63[_0xf326('0x28')],_0x5dbe63[_0xf326('0x2b')]);_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2d')](_0x5dbe63['model'],qs[_0xf326('0x2f')](_0x6a8e89[_0xf326('0x2b')][_0xf326('0x2f')]));_0x2fa28e['attributes']=_0x2fa28e[_0xf326('0x2e')][_0xf326('0x30')]?_0x2fa28e[_0xf326('0x2e')]:_0x5dbe63['model'];_0x2fa28e=_['merge']({},_0x2fa28e,_0x6a8e89[_0xf326('0x31')]);return utilLicense[_0xf326('0x32')](_0x2fa28e)[_0xf326('0x24')](respondWithResult(_0x1ae23a,null))[_0xf326('0x33')](handleError(_0x1ae23a,null));};exports[_0xf326('0x22')]=function(_0x2e8a64,_0x62585a){if(_0x2e8a64[_0xf326('0x34')]['id']){delete _0x2e8a64['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x36')]({'where':{'id':_0x2e8a64['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x62585a,null))['then'](function(_0xce1cbb){var _0x481b64=_0xce1cbb['get']({'plain':!![]});return utilLicense[_0xf326('0x37')](_0x481b64,_0x2e8a64['body'][_0xf326('0x38')]);})['then'](function(_0x310dbb){if(!_0x310dbb[_0xf326('0x39')]){return saveUpdates(_0x2e8a64[_0xf326('0x34')],null);}return _0x310dbb;})['then'](respondWithResult(_0x62585a,null))[_0xf326('0x33')](handleError(_0x62585a,null));};
\ No newline at end of file
+var _0x53ec=['Content-Range','apply','reject','save','then','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','update','body','find','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3dba67,_0x1fce94){var _0x581ea7=function(_0x13fda7){while(--_0x13fda7){_0x3dba67['push'](_0x3dba67['shift']());}};_0x581ea7(++_0x1fce94);}(_0x53ec,0x192));var _0xc53e=function(_0x3d8d0a,_0x11bb87){_0x3d8d0a=_0x3d8d0a-0x0;var _0x5b9df5=_0x53ec[_0x3d8d0a];return _0x5b9df5;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}var utilLicense=require('../../config/license/util');exports[_0xc53e('0x28')]=function(_0x5112d2,_0x5ce216){var _0x8f0ee6={'raw':!![],'where':{'id':0x1}},_0x6a62b0={};_0x6a62b0[_0xc53e('0x29')]=_[_0xc53e('0x2a')](db[_0xc53e('0x2b')][_0xc53e('0x2c')]);_0x6a62b0[_0xc53e('0x2d')]=_[_0xc53e('0x2a')](_0x5112d2['query']);_0x6a62b0[_0xc53e('0x2e')]=_[_0xc53e('0x2f')](_0x6a62b0[_0xc53e('0x29')],_0x6a62b0['query']);_0x8f0ee6[_0xc53e('0x30')]=_['intersection'](_0x6a62b0[_0xc53e('0x29')],qs[_0xc53e('0x31')](_0x5112d2['query']['fields']));_0x8f0ee6[_0xc53e('0x30')]=_0x8f0ee6[_0xc53e('0x30')][_0xc53e('0x32')]?_0x8f0ee6[_0xc53e('0x30')]:_0x6a62b0[_0xc53e('0x29')];_0x8f0ee6=_[_0xc53e('0x33')]({},_0x8f0ee6,_0x5112d2[_0xc53e('0x34')]);return utilLicense[_0xc53e('0x35')](_0x8f0ee6)['then'](respondWithResult(_0x5ce216,null))[_0xc53e('0x36')](handleError(_0x5ce216,null));};exports[_0xc53e('0x37')]=function(_0x19020b,_0x17ad32){if(_0x19020b[_0xc53e('0x38')]['id']){delete _0x19020b[_0xc53e('0x38')]['id'];}return db[_0xc53e('0x2b')][_0xc53e('0x39')]({'where':{'id':_0x19020b[_0xc53e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x17ad32,null))[_0xc53e('0x24')](function(_0x48d7d0){var _0x1059f3=_0x48d7d0[_0xc53e('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x1059f3,_0x19020b[_0xc53e('0x38')][_0xc53e('0x3c')]);})[_0xc53e('0x24')](function(_0x5ed90b){if(!_0x5ed90b[_0xc53e('0x3d')]){return saveUpdates(_0x19020b[_0xc53e('0x38')],null);}return _0x5ed90b;})[_0xc53e('0x24')](respondWithResult(_0x17ad32,null))[_0xc53e('0x36')](handleError(_0x17ad32,null));};
\ No newline at end of file
index a7d8fa4..73acd35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x072d=['exports','define','License','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./license.attributes'];(function(_0x14bbda,_0x334f22){var _0x117a62=function(_0x16b85e){while(--_0x16b85e){_0x14bbda['push'](_0x14bbda['shift']());}};_0x117a62(++_0x334f22);}(_0x072d,0x7c));var _0xd072=function(_0x143759,_0x249c49){_0x143759=_0x143759-0x0;var _0x4582be=_0x072d[_0x143759];return _0x4582be;};'use strict';var _=require('lodash');var util=require(_0xd072('0x0'));var logger=require(_0xd072('0x1'))('api');var moment=require(_0xd072('0x2'));var BPromise=require(_0xd072('0x3'));var rp=require(_0xd072('0x4'));var fs=require('fs');var path=require(_0xd072('0x5'));var rimraf=require(_0xd072('0x6'));var config=require('../../config/environment');var attributes=require(_0xd072('0x7'));module[_0xd072('0x8')]=function(_0x2ca51d,_0x1458b6){return _0x2ca51d[_0xd072('0x9')](_0xd072('0xa'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2ad=['path','../../config/environment','./license.attributes','exports','license','util','api','moment','bluebird','request-promise'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x4958e7,_0x3eea43){_0x4958e7=_0x4958e7-0x0;var _0x40a80f=_0xb2ad[_0x4958e7];return _0x40a80f;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var logger=require('../../config/logger')(_0xdb2a('0x1'));var moment=require(_0xdb2a('0x2'));var BPromise=require(_0xdb2a('0x3'));var rp=require(_0xdb2a('0x4'));var fs=require('fs');var path=require(_0xdb2a('0x5'));var rimraf=require('rimraf');var config=require(_0xdb2a('0x6'));var attributes=require(_0xdb2a('0x7'));module[_0xdb2a('0x8')]=function(_0x1f9551,_0x5c69b1){return _0x1f9551['define']('License',attributes,{'tableName':_0xdb2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c54fadf..b804773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x126b=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x126b,0x1a1));var _0xb126=function(_0x29b495,_0x4c80ba){_0x29b495=_0x29b495-0x0;var _0x116570=_0x126b[_0x29b495];return _0x116570;};'use strict';var _=require('lodash');var util=require(_0xb126('0x0'));var moment=require('moment');var BPromise=require(_0xb126('0x1'));var rs=require(_0xb126('0x2'));var fs=require('fs');var Redis=require(_0xb126('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb126('0x4'));var logger=require(_0xb126('0x5'))('rpc');var config=require(_0xb126('0x6'));var jayson=require(_0xb126('0x7'));var client=jayson[_0xb126('0x8')][_0xb126('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3026b4,_0x262b35,_0x3deecb){return new BPromise(function(_0x56ba2d,_0x98605f){return client[_0xb126('0xa')](_0x3026b4,_0x3deecb)['then'](function(_0x57ed1f){logger[_0xb126('0xb')](_0xb126('0xc'),_0x262b35,_0xb126('0xd'));logger[_0xb126('0xe')](_0xb126('0xf'),_0x262b35,_0xb126('0xd'),JSON[_0xb126('0x10')](_0x57ed1f));if(_0x57ed1f[_0xb126('0x11')]){if(_0x57ed1f['error'][_0xb126('0x12')]===0x1f4){logger['error'](_0xb126('0xc'),_0x262b35,_0x57ed1f[_0xb126('0x11')][_0xb126('0x13')]);return _0x98605f(_0x57ed1f[_0xb126('0x11')]['message']);}logger[_0xb126('0x11')]('License,\x20%s,\x20%s',_0x262b35,_0x57ed1f[_0xb126('0x11')]['message']);return _0x56ba2d(_0x57ed1f['error']['message']);}else{logger[_0xb126('0xb')](_0xb126('0xc'),_0x262b35,_0xb126('0xd'));_0x56ba2d(_0x57ed1f[_0xb126('0x14')][_0xb126('0x13')]);}})[_0xb126('0x15')](function(_0x19267e){logger[_0xb126('0x11')](_0xb126('0xc'),_0x262b35,_0x19267e);_0x98605f(_0x19267e);});});}
\ No newline at end of file
+var _0x0593=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2baec7,_0x23f8a1){var _0x3ef9d8=function(_0x48b426){while(--_0x48b426){_0x2baec7['push'](_0x2baec7['shift']());}};_0x3ef9d8(++_0x23f8a1);}(_0x0593,0x175));var _0x3059=function(_0x20fc14,_0x449fde){_0x20fc14=_0x20fc14-0x0;var _0xed7035=_0x0593[_0x20fc14];return _0xed7035;};'use strict';var _=require(_0x3059('0x0'));var util=require(_0x3059('0x1'));var moment=require(_0x3059('0x2'));var BPromise=require(_0x3059('0x3'));var rs=require(_0x3059('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3059('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3059('0x6'))(_0x3059('0x7'));var config=require('../../config/environment');var jayson=require(_0x3059('0x8'));var client=jayson[_0x3059('0x9')][_0x3059('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x312ac4,_0xcae229,_0x5bd18a){return new BPromise(function(_0x2de48d,_0x4254b2){return client['request'](_0x312ac4,_0x5bd18a)['then'](function(_0x2ec3e9){logger[_0x3059('0xb')](_0x3059('0xc'),_0xcae229,_0x3059('0xd'));logger[_0x3059('0xe')](_0x3059('0xf'),_0xcae229,_0x3059('0xd'),JSON['stringify'](_0x2ec3e9));if(_0x2ec3e9[_0x3059('0x10')]){if(_0x2ec3e9[_0x3059('0x10')][_0x3059('0x11')]===0x1f4){logger[_0x3059('0x10')](_0x3059('0xc'),_0xcae229,_0x2ec3e9[_0x3059('0x10')][_0x3059('0x12')]);return _0x4254b2(_0x2ec3e9[_0x3059('0x10')][_0x3059('0x12')]);}logger[_0x3059('0x10')]('License,\x20%s,\x20%s',_0xcae229,_0x2ec3e9[_0x3059('0x10')][_0x3059('0x12')]);return _0x2de48d(_0x2ec3e9[_0x3059('0x10')][_0x3059('0x12')]);}else{logger[_0x3059('0xb')](_0x3059('0xc'),_0xcae229,'request\x20sent');_0x2de48d(_0x2ec3e9[_0x3059('0x13')][_0x3059('0x12')]);}})[_0x3059('0x14')](function(_0x1e7459){logger[_0x3059('0x10')](_0x3059('0xc'),_0xcae229,_0x1e7459);_0x4254b2(_0x1e7459);});});}
\ No newline at end of file
index 79bb7e1..94ca216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd334=['removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','/:id/interactions','getInteractions','getApplications','/:id/messages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','addImap','addSmtp','addInteraction','/:id/applications','addApplications','addAgents','put','update','/:id/dispositions','removeDispositions','delete','removeAnswers'];(function(_0x41e565,_0x11d9d7){var _0x61d87d=function(_0xbc47fd){while(--_0xbc47fd){_0x41e565['push'](_0x41e565['shift']());}};_0x61d87d(++_0x11d9d7);}(_0xd334,0x163));var _0x4d33=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xd334[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x4d33('0x0'));var util=require(_0x4d33('0x1'));var path=require(_0x4d33('0x2'));var timeout=require(_0x4d33('0x3'));var express=require(_0x4d33('0x4'));var router=express[_0x4d33('0x5')]();var fs_extra=require(_0x4d33('0x6'));var auth=require(_0x4d33('0x7'));var interaction=require(_0x4d33('0x8'));var config=require(_0x4d33('0x9'));var controller=require(_0x4d33('0xa'));router[_0x4d33('0xb')]('/',auth[_0x4d33('0xc')](),controller[_0x4d33('0xd')]);router[_0x4d33('0xb')](_0x4d33('0xe'),auth[_0x4d33('0xc')](),controller[_0x4d33('0xf')]);router[_0x4d33('0xb')](_0x4d33('0x10'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x11')]);router[_0x4d33('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4d33('0x12')]);router[_0x4d33('0xb')](_0x4d33('0x13'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x14')]);router[_0x4d33('0xb')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x4d33('0x15')]);router[_0x4d33('0xb')](_0x4d33('0x16'),auth['isAuthenticated'](),controller['getSmtp']);router[_0x4d33('0xb')](_0x4d33('0x17'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x18')]);router[_0x4d33('0xb')]('/:id/applications',auth[_0x4d33('0xc')](),controller[_0x4d33('0x19')]);router['get'](_0x4d33('0x1a'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x4d33('0x1b'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x1c')]);router[_0x4d33('0xb')]('/:id/users',auth[_0x4d33('0xc')](),controller[_0x4d33('0x1d')]);router[_0x4d33('0x1e')]('/:id/dispositions',auth[_0x4d33('0xc')](),controller[_0x4d33('0x1f')]);router[_0x4d33('0x1e')](_0x4d33('0x13'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x20')]);router[_0x4d33('0x1e')]('/',auth[_0x4d33('0xc')](),controller['create']);router[_0x4d33('0x1e')]('/:id/in_servers',auth[_0x4d33('0xc')](),controller[_0x4d33('0x21')]);router['post'](_0x4d33('0x16'),auth['isAuthenticated'](),controller[_0x4d33('0x22')]);router[_0x4d33('0x1e')](_0x4d33('0x17'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x23')]);router[_0x4d33('0x1e')](_0x4d33('0x24'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x25')]);router[_0x4d33('0x1e')]('/:id/send',auth[_0x4d33('0xc')](),controller['send']);router['post']('/:id/users',auth[_0x4d33('0xc')](),controller[_0x4d33('0x26')]);router[_0x4d33('0x27')](_0x4d33('0x10'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x28')]);router['delete'](_0x4d33('0x29'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x2a')]);router[_0x4d33('0x2b')](_0x4d33('0x13'),auth[_0x4d33('0xc')](),controller[_0x4d33('0x2c')]);router[_0x4d33('0x2b')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x4d33('0x2d')]);router['delete']('/:id/out_servers',auth[_0x4d33('0xc')](),controller[_0x4d33('0x2e')]);router[_0x4d33('0x2b')]('/:id',auth[_0x4d33('0xc')](),controller[_0x4d33('0x2f')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x4d33('0x30')]);module[_0x4d33('0x31')]=router;
\ No newline at end of file
+var _0xffa3=['addInteraction','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','getAgents','/:id/dispositions','addDisposition','post','addAnswer','addImap','addSmtp'];(function(_0xf66d47,_0x180a09){var _0x13e3bf=function(_0x284366){while(--_0x284366){_0xf66d47['push'](_0xf66d47['shift']());}};_0x13e3bf(++_0x180a09);}(_0xffa3,0x139));var _0x3ffa=function(_0x2417f9,_0x803ba4){_0x2417f9=_0x2417f9-0x0;var _0x142d82=_0xffa3[_0x2417f9];return _0x142d82;};'use strict';var multer=require('multer');var util=require(_0x3ffa('0x0'));var path=require(_0x3ffa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ffa('0x2'));var interaction=require(_0x3ffa('0x3'));var config=require(_0x3ffa('0x4'));var controller=require('./mailAccount.controller');router[_0x3ffa('0x5')]('/',auth[_0x3ffa('0x6')](),controller['index']);router[_0x3ffa('0x5')](_0x3ffa('0x7'),auth['isAuthenticated'](),controller[_0x3ffa('0x8')]);router['get'](_0x3ffa('0x9'),auth[_0x3ffa('0x6')](),controller['show']);router[_0x3ffa('0x5')]('/:id/dispositions',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0xa')]);router[_0x3ffa('0x5')](_0x3ffa('0xb'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0xc')]);router[_0x3ffa('0x5')](_0x3ffa('0xd'),auth['isAuthenticated'](),controller[_0x3ffa('0xe')]);router[_0x3ffa('0x5')](_0x3ffa('0xf'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x10')]);router[_0x3ffa('0x5')](_0x3ffa('0x11'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x12')]);router[_0x3ffa('0x5')](_0x3ffa('0x13'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x14')]);router[_0x3ffa('0x5')]('/:id/messages',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x15')]);router[_0x3ffa('0x5')](_0x3ffa('0x16'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x17')]);router[_0x3ffa('0x5')]('/:id/users',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x18')]);router['post'](_0x3ffa('0x19'),auth['isAuthenticated'](),controller[_0x3ffa('0x1a')]);router[_0x3ffa('0x1b')]('/:id/canned_answers',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x1c')]);router[_0x3ffa('0x1b')]('/',auth[_0x3ffa('0x6')](),controller['create']);router[_0x3ffa('0x1b')]('/:id/in_servers',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x1d')]);router['post'](_0x3ffa('0xf'),auth['isAuthenticated'](),controller[_0x3ffa('0x1e')]);router[_0x3ffa('0x1b')](_0x3ffa('0x11'),auth['isAuthenticated'](),controller[_0x3ffa('0x1f')]);router['post'](_0x3ffa('0x13'),auth[_0x3ffa('0x6')](),controller['addApplications']);router[_0x3ffa('0x1b')](_0x3ffa('0x20'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x21')]);router[_0x3ffa('0x1b')](_0x3ffa('0x22'),auth[_0x3ffa('0x6')](),controller['addAgents']);router[_0x3ffa('0x23')](_0x3ffa('0x9'),auth['isAuthenticated'](),controller[_0x3ffa('0x24')]);router[_0x3ffa('0x25')](_0x3ffa('0x19'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x26')]);router[_0x3ffa('0x25')](_0x3ffa('0xb'),auth['isAuthenticated'](),controller[_0x3ffa('0x27')]);router[_0x3ffa('0x25')]('/:id/in_servers',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x28')]);router[_0x3ffa('0x25')]('/:id/out_servers',auth[_0x3ffa('0x6')](),controller['removeSmtp']);router['delete'](_0x3ffa('0x9'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x29')]);router['delete'](_0x3ffa('0x22'),auth['isAuthenticated'](),controller[_0x3ffa('0x2a')]);module['exports']=router;
\ No newline at end of file
index 969a395..62d0da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79a8=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x79a8,0x1d0));var _0x879a=function(_0x14110b,_0x3ce4f6){_0x14110b=_0x14110b-0x0;var _0x33d8db=_0x79a8[_0x14110b];return _0x33d8db;};'use strict';var Sequelize=require(_0x879a('0x0'));module['exports']={'description':{'type':Sequelize[_0x879a('0x1')]},'name':{'type':Sequelize[_0x879a('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x879a('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x879a('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x879a('0x3')]},'markAsUnread':{'type':Sequelize[_0x879a('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x879a('0x1')],'allowNull':![],'defaultValue':_0x879a('0x4')},'fontSize':{'type':Sequelize[_0x879a('0x5')](0x2)[_0x879a('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x879a('0x3')],'defaultValue':function(){return _0x879a('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x879a('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x879a('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x879a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x879a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x879a('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x879a('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x879a('0x9'),'set':function(_0x1a40bc){if(!_0x1a40bc)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x879a('0xa')](_0x879a('0xb'),_0x1a40bc);}}};
\ No newline at end of file
+var _0xb205=['STRING','BOOLEAN','INTEGER','UNSIGNED','TEXT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x13e072,_0x402c4a){var _0x1231b0=function(_0x11bfcf){while(--_0x11bfcf){_0x13e072['push'](_0x13e072['shift']());}};_0x1231b0(++_0x402c4a);}(_0xb205,0xf0));var _0x5b20=function(_0x637192,_0x561d88){_0x637192=_0x637192-0x0;var _0x5c674f=_0xb205[_0x637192];return _0x5c674f;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'description':{'type':Sequelize[_0x5b20('0x2')]},'name':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5b20('0x4')](0x2)[_0x5b20('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5b20('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5b20('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b20('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b20('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x5b20('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![],'comment':_0x5b20('0x8'),'set':function(_0x5ebb0d){if(!_0x5ebb0d)this[_0x5b20('0x9')](_0x5b20('0xa'),null);this[_0x5b20('0x9')]('mandatoryDisposition',_0x5ebb0d);}}};
\ No newline at end of file
index 827cf8c..674cc85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae23=['count','set','Content-Range','apply','reject','update','then','destroy','get','MailAccounts','UserProfileResource','end','name','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','options','MailAccount','includeAll','include','findAll','rows','catch','show','find','body','params','Smtp','describe','addDisposition','Disposition','create','getDispositions','findOne','order','MailAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','ids','email','ListId','isNil','active','cservice','cauthentication','user','cuser','password','pass','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','stack','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','authentication','auth','secure','List\x20not\x20found','Contacts','defaults','messageId','subject','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','json','offset'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xae23,0x15b));var _0x3ae2=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xae23[_0x47e7cb];return _0x2a8874;};'use strict';var emlformat=require(_0x3ae2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ae2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ae2('0x2'));var moment=require(_0x3ae2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3ae2('0x4'));var util=require(_0x3ae2('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3ae2('0x6'));var ejs=require(_0x3ae2('0x7'));var fs=require('fs');var fs_extra=require(_0x3ae2('0x8'));var _=require(_0x3ae2('0x9'));var squel=require(_0x3ae2('0xa'));var crypto=require(_0x3ae2('0xb'));var jsforce=require(_0x3ae2('0xc'));var deskjs=require(_0x3ae2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3ae2('0xe'));var htmlToText=require(_0x3ae2('0xf'));var juice=require(_0x3ae2('0x10'));var Redis=require(_0x3ae2('0x11'));var authService=require(_0x3ae2('0x12'));var qs=require(_0x3ae2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ae2('0x14'));var logger=require(_0x3ae2('0x15'))(_0x3ae2('0x16'));var utils=require(_0x3ae2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3ae2('0x18'))['db'];config[_0x3ae2('0x19')]=_['defaults'](config[_0x3ae2('0x19')],{'host':_0x3ae2('0x1a'),'port':0x18eb});var socket=require(_0x3ae2('0x1b'))(new Redis(config[_0x3ae2('0x19')]));require('./mailAccount.socket')[_0x3ae2('0x1c')](socket);var jayson=require(_0x3ae2('0x1d'));var client=jayson[_0x3ae2('0x1e')][_0x3ae2('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x513035,_0x15a170,_0x2ff961,_0x12ee05){return new BPromise(function(_0x87f92c,_0x2562af){var _0x5e3926=_0x12ee05||client;return _0x5e3926[_0x3ae2('0x20')](_0x513035,_0x2ff961)['then'](function(_0x145726){logger[_0x3ae2('0x21')](_0x3ae2('0x22'),_0x15a170,_0x3ae2('0x23'));logger[_0x3ae2('0x24')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x15a170,_0x3ae2('0x23'),JSON['stringify'](_0x145726));if(_0x145726[_0x3ae2('0x25')]){if(_0x145726[_0x3ae2('0x25')][_0x3ae2('0x26')]===0x1f4){logger[_0x3ae2('0x25')](_0x3ae2('0x22'),_0x15a170,_0x145726['error'][_0x3ae2('0x27')]);return _0x2562af(_0x145726['error'][_0x3ae2('0x27')]);}logger[_0x3ae2('0x25')]('MailAccount,\x20%s,\x20%s',_0x15a170,_0x145726['error'][_0x3ae2('0x27')]);return _0x87f92c(_0x145726['error'][_0x3ae2('0x27')]);}else{logger[_0x3ae2('0x21')](_0x3ae2('0x22'),_0x15a170,_0x3ae2('0x23'));_0x87f92c(_0x145726[_0x3ae2('0x28')][_0x3ae2('0x27')]);}})['catch'](function(_0x4443f8){logger[_0x3ae2('0x25')]('MailAccount,\x20%s,\x20%s',_0x15a170,_0x4443f8);_0x2562af(_0x4443f8);});});}function respondWithStatusCode(_0x2dbdf4,_0x2c8043){_0x2c8043=_0x2c8043||0xcc;return function(_0xefddd){if(_0xefddd){return _0x2dbdf4[_0x3ae2('0x29')](_0x2c8043);}return _0x2dbdf4[_0x3ae2('0x2a')](_0x2c8043)['end']();};}function respondWithResult(_0x303bc7,_0x44c51d){_0x44c51d=_0x44c51d||0xc8;return function(_0x1ab660){if(_0x1ab660){return _0x303bc7['status'](_0x44c51d)[_0x3ae2('0x2b')](_0x1ab660);}};}function respondWithFilteredResult(_0x2b468a,_0x1ecf27){return function(_0x19c2be){if(_0x19c2be){var _0x3b185d=typeof _0x1ecf27[_0x3ae2('0x2c')]==='undefined'&&typeof _0x1ecf27['limit']==='undefined';var _0x1b941b=_0x19c2be[_0x3ae2('0x2d')];var _0x815b16=_0x3b185d?0x0:_0x1ecf27[_0x3ae2('0x2c')];var _0x4b8e11=_0x3b185d?_0x19c2be['count']:_0x1ecf27[_0x3ae2('0x2c')]+_0x1ecf27['limit'];var _0x2c0227;if(_0x4b8e11>=_0x1b941b){_0x4b8e11=_0x1b941b;_0x2c0227=0xc8;}else{_0x2c0227=0xce;}_0x2b468a[_0x3ae2('0x2a')](_0x2c0227);return _0x2b468a[_0x3ae2('0x2e')](_0x3ae2('0x2f'),_0x815b16+'-'+_0x4b8e11+'/'+_0x1b941b)[_0x3ae2('0x2b')](_0x19c2be);}return null;};}function patchUpdates(_0x2352ef){return function(_0x3d050e){try{jsonpatch[_0x3ae2('0x30')](_0x3d050e,_0x2352ef,!![]);}catch(_0x41b0d6){return BPromise[_0x3ae2('0x31')](_0x41b0d6);}return _0x3d050e['save']();};}function saveUpdates(_0x265ba8,_0x437558){return function(_0x358268){if(_0x358268){return _0x358268[_0x3ae2('0x32')](_0x265ba8)[_0x3ae2('0x33')](function(_0x5ced92){return _0x5ced92;});}return null;};}function removeEntity(_0xe664ed,_0x410b11){return function(_0x14a46f){if(_0x14a46f){return _0x14a46f[_0x3ae2('0x34')]()[_0x3ae2('0x33')](function(){var _0x552f49=_0x14a46f[_0x3ae2('0x35')]({'plain':!![]});var _0x3599c8=_0x3ae2('0x36');return db[_0x3ae2('0x37')][_0x3ae2('0x34')]({'where':{'type':_0x3599c8,'resourceId':_0x552f49['id']}})[_0x3ae2('0x33')](function(){return _0x14a46f;});})[_0x3ae2('0x33')](function(){_0xe664ed['status'](0xcc)[_0x3ae2('0x38')]();});}};}function handleEntityNotFound(_0x1c74d2,_0x39ed39){return function(_0x3c6cb3){if(!_0x3c6cb3){_0x1c74d2[_0x3ae2('0x29')](0x194);}return _0x3c6cb3;};}function handleError(_0x4cfd4d,_0x46c821){_0x46c821=_0x46c821||0x1f4;return function(_0x2c125a){logger[_0x3ae2('0x25')](_0x2c125a['stack']);if(_0x2c125a[_0x3ae2('0x39')]){delete _0x2c125a[_0x3ae2('0x39')];}_0x4cfd4d['status'](_0x46c821)['send'](_0x2c125a);};}exports[_0x3ae2('0x3a')]=function(_0x32c184,_0x1fbf2d){var _0x3e0df4={'include':[{'model':db[_0x3ae2('0x3b')],'as':_0x3ae2('0x3c')},{'model':db[_0x3ae2('0x3d')],'as':'Smtp'},{'model':db[_0x3ae2('0x3e')],'as':_0x3ae2('0x3f')}]},_0x7d6255={},_0x219ed8={'count':0x0,'rows':[]};var _0x2307ba=_[_0x3ae2('0x40')](db['MailAccount'][_0x3ae2('0x41')],function(_0x5e9c03){return{'name':_0x5e9c03[_0x3ae2('0x42')],'type':_0x5e9c03[_0x3ae2('0x43')][_0x3ae2('0x44')]};});_0x7d6255['model']=_['map'](_0x2307ba,'name');_0x7d6255['query']=_[_0x3ae2('0x45')](_0x32c184[_0x3ae2('0x46')]);_0x7d6255[_0x3ae2('0x47')]=_[_0x3ae2('0x48')](_0x7d6255[_0x3ae2('0x49')],_0x7d6255[_0x3ae2('0x46')]);_0x3e0df4[_0x3ae2('0x4a')]=_[_0x3ae2('0x48')](_0x7d6255[_0x3ae2('0x49')],qs[_0x3ae2('0x4b')](_0x32c184[_0x3ae2('0x46')][_0x3ae2('0x4b')]));_0x3e0df4[_0x3ae2('0x4a')]=_0x3e0df4[_0x3ae2('0x4a')][_0x3ae2('0x4c')]?_0x3e0df4[_0x3ae2('0x4a')]:_0x7d6255[_0x3ae2('0x49')];if(!_0x32c184[_0x3ae2('0x46')][_0x3ae2('0x4d')](_0x3ae2('0x4e'))){_0x3e0df4[_0x3ae2('0x4f')]=qs[_0x3ae2('0x4f')](_0x32c184[_0x3ae2('0x46')]['limit']);_0x3e0df4[_0x3ae2('0x2c')]=qs['offset'](_0x32c184['query'][_0x3ae2('0x2c')]);}_0x3e0df4['order']=qs['sort'](_0x32c184['query'][_0x3ae2('0x50')]);_0x3e0df4[_0x3ae2('0x51')]=qs[_0x3ae2('0x47')](_['pick'](_0x32c184[_0x3ae2('0x46')],_0x7d6255['filters']),_0x2307ba);if(_0x32c184[_0x3ae2('0x46')][_0x3ae2('0x52')]){_0x3e0df4[_0x3ae2('0x51')]=_[_0x3ae2('0x53')](_0x3e0df4[_0x3ae2('0x51')],{'$or':_[_0x3ae2('0x40')](_0x2307ba,function(_0x2c13eb){if(_0x2c13eb[_0x3ae2('0x43')]!=='VIRTUAL'){var _0x282262={};_0x282262[_0x2c13eb[_0x3ae2('0x39')]]={'$like':'%'+_0x32c184[_0x3ae2('0x46')][_0x3ae2('0x52')]+'%'};return _0x282262;}})});}_0x3e0df4=_['merge']({},_0x3e0df4,_0x32c184[_0x3ae2('0x54')]);var _0x36432e={'where':_0x3e0df4[_0x3ae2('0x51')]};return db[_0x3ae2('0x55')][_0x3ae2('0x2d')](_0x36432e)[_0x3ae2('0x33')](function(_0x465e91){_0x219ed8[_0x3ae2('0x2d')]=_0x465e91;if(_0x32c184[_0x3ae2('0x46')][_0x3ae2('0x56')]){_0x3e0df4[_0x3ae2('0x57')]=[{'all':!![]}];}return db[_0x3ae2('0x55')][_0x3ae2('0x58')](_0x3e0df4);})['then'](function(_0x5eff34){_0x219ed8[_0x3ae2('0x59')]=_0x5eff34;return _0x219ed8;})[_0x3ae2('0x33')](respondWithFilteredResult(_0x1fbf2d,_0x3e0df4))[_0x3ae2('0x5a')](handleError(_0x1fbf2d,null));};exports[_0x3ae2('0x5b')]=function(_0x492e49,_0x48248a){var _0x4ad84d={'raw':![],'where':{'id':_0x492e49['params']['id']},'include':[{'model':db[_0x3ae2('0x3b')],'as':_0x3ae2('0x3c')},{'model':db[_0x3ae2('0x3d')],'as':'Smtp'},{'model':db[_0x3ae2('0x3e')],'as':'mandatoryDispositionPause'}]},_0x33c94d={};_0x33c94d[_0x3ae2('0x49')]=_[_0x3ae2('0x45')](db[_0x3ae2('0x55')][_0x3ae2('0x41')]);_0x33c94d[_0x3ae2('0x46')]=_[_0x3ae2('0x45')](_0x492e49['query']);_0x33c94d[_0x3ae2('0x47')]=_['intersection'](_0x33c94d[_0x3ae2('0x49')],_0x33c94d[_0x3ae2('0x46')]);_0x4ad84d['attributes']=_[_0x3ae2('0x48')](_0x33c94d[_0x3ae2('0x49')],qs['fields'](_0x492e49[_0x3ae2('0x46')]['fields']));_0x4ad84d[_0x3ae2('0x4a')]=_0x4ad84d['attributes'][_0x3ae2('0x4c')]?_0x4ad84d[_0x3ae2('0x4a')]:_0x33c94d['model'];if(_0x492e49[_0x3ae2('0x46')][_0x3ae2('0x56')]){_0x4ad84d['include']=[{'all':!![]}];}_0x4ad84d=_[_0x3ae2('0x53')]({},_0x4ad84d,_0x492e49['options']);return db[_0x3ae2('0x55')][_0x3ae2('0x5c')](_0x4ad84d)[_0x3ae2('0x33')](handleEntityNotFound(_0x48248a,null))[_0x3ae2('0x33')](respondWithResult(_0x48248a,null))[_0x3ae2('0x5a')](handleError(_0x48248a,null));};exports[_0x3ae2('0x32')]=function(_0x47d33e,_0x228c81){if(_0x47d33e[_0x3ae2('0x5d')]['id']){delete _0x47d33e[_0x3ae2('0x5d')]['id'];}return db[_0x3ae2('0x55')][_0x3ae2('0x5c')]({'where':{'id':_0x47d33e[_0x3ae2('0x5e')]['id']},'include':[{'model':db[_0x3ae2('0x3b')],'as':_0x3ae2('0x3c')},{'model':db[_0x3ae2('0x3d')],'as':'Smtp'},{'model':db[_0x3ae2('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x3ae2('0x33')](handleEntityNotFound(_0x228c81,null))['then'](saveUpdates(_0x47d33e[_0x3ae2('0x5d')],null))[_0x3ae2('0x33')](function(_0x1862ce){if(_0x1862ce&&_0x47d33e[_0x3ae2('0x5d')][_0x3ae2('0x3c')]){return db[_0x3ae2('0x3b')][_0x3ae2('0x32')](_0x47d33e[_0x3ae2('0x5d')][_0x3ae2('0x3c')],{'where':{'MailAccountId':_0x1862ce['id']}})['then'](function(){return _0x1862ce;});}return _0x1862ce;})[_0x3ae2('0x33')](function(_0x452b47){if(_0x452b47&&_0x47d33e[_0x3ae2('0x5d')]['Smtp']){return db[_0x3ae2('0x3d')][_0x3ae2('0x32')](_0x47d33e[_0x3ae2('0x5d')][_0x3ae2('0x5f')],{'where':{'MailAccountId':_0x452b47['id']}})['then'](function(){return _0x452b47;});}return _0x452b47;})['then'](respondWithResult(_0x228c81,null))[_0x3ae2('0x5a')](handleError(_0x228c81,null));};exports[_0x3ae2('0x60')]=function(_0x1a2c01,_0x1cceb5){return db['MailAccount'][_0x3ae2('0x60')]()[_0x3ae2('0x33')](respondWithResult(_0x1cceb5,null))[_0x3ae2('0x5a')](handleError(_0x1cceb5,null));};exports[_0x3ae2('0x61')]=function(_0x5c8fce,_0x380c27,_0xbd19d6){if(_0x5c8fce[_0x3ae2('0x5d')]['id']){delete _0x5c8fce[_0x3ae2('0x5d')]['id'];}return db[_0x3ae2('0x55')][_0x3ae2('0x5c')]({'where':{'id':_0x5c8fce[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x380c27,null))[_0x3ae2('0x33')](function(_0x28b235){if(_0x28b235){_0x5c8fce[_0x3ae2('0x5d')]['MailAccountId']=_0x28b235['id'];return db[_0x3ae2('0x62')][_0x3ae2('0x63')](_0x5c8fce[_0x3ae2('0x5d')]);}})[_0x3ae2('0x33')](respondWithResult(_0x380c27,null))[_0x3ae2('0x5a')](handleError(_0x380c27,null));};exports[_0x3ae2('0x64')]=function(_0x3f7add,_0x4e37c4,_0x16e48d){var _0x158cdb={'raw':![],'where':{}};var _0x482cc0={};var _0x3575e0={'count':0x0,'rows':[]};return db[_0x3ae2('0x55')][_0x3ae2('0x65')]({'where':{'id':_0x3f7add[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x4e37c4,null))[_0x3ae2('0x33')](function(_0x2e5f60){if(_0x2e5f60){_0x482cc0[_0x3ae2('0x49')]=_[_0x3ae2('0x45')](db[_0x3ae2('0x62')][_0x3ae2('0x41')]);_0x482cc0[_0x3ae2('0x46')]=_['keys'](_0x3f7add[_0x3ae2('0x46')]);_0x482cc0[_0x3ae2('0x47')]=_[_0x3ae2('0x48')](_0x482cc0[_0x3ae2('0x49')],_0x482cc0['query']);_0x158cdb[_0x3ae2('0x4a')]=_[_0x3ae2('0x48')](_0x482cc0[_0x3ae2('0x49')],qs[_0x3ae2('0x4b')](_0x3f7add[_0x3ae2('0x46')][_0x3ae2('0x4b')]));_0x158cdb[_0x3ae2('0x4a')]=_0x158cdb[_0x3ae2('0x4a')][_0x3ae2('0x4c')]?_0x158cdb['attributes']:_0x482cc0[_0x3ae2('0x49')];if(!_0x3f7add[_0x3ae2('0x46')]['hasOwnProperty'](_0x3ae2('0x4e'))){_0x158cdb['limit']=qs[_0x3ae2('0x4f')](_0x3f7add['query']['limit']);_0x158cdb[_0x3ae2('0x2c')]=qs[_0x3ae2('0x2c')](_0x3f7add[_0x3ae2('0x46')]['offset']);}_0x158cdb[_0x3ae2('0x66')]=qs['sort'](_0x3f7add[_0x3ae2('0x46')][_0x3ae2('0x50')]);_0x158cdb['where']=qs[_0x3ae2('0x47')](_['pick'](_0x3f7add[_0x3ae2('0x46')],_0x482cc0['filters']));_0x158cdb['where'][_0x3ae2('0x67')]=_0x2e5f60['id'];if(_0x3f7add[_0x3ae2('0x46')][_0x3ae2('0x52')]){_0x158cdb[_0x3ae2('0x51')]=_[_0x3ae2('0x53')](_0x158cdb[_0x3ae2('0x51')],{'$or':_[_0x3ae2('0x40')](_0x158cdb[_0x3ae2('0x4a')],function(_0x3d7822){var _0x1c68e6={};_0x1c68e6[_0x3d7822]={'$like':'%'+_0x3f7add['query'][_0x3ae2('0x52')]+'%'};return _0x1c68e6;})});}_0x158cdb=_[_0x3ae2('0x53')]({},_0x158cdb,_0x3f7add['options']);return db[_0x3ae2('0x62')][_0x3ae2('0x2d')]({'where':_0x158cdb[_0x3ae2('0x51')]})[_0x3ae2('0x33')](function(_0x263de1){_0x3575e0['count']=_0x263de1;if(_0x3f7add[_0x3ae2('0x46')][_0x3ae2('0x56')]){_0x158cdb[_0x3ae2('0x57')]=[{'all':!![]}];}return db[_0x3ae2('0x62')][_0x3ae2('0x58')](_0x158cdb);})[_0x3ae2('0x33')](function(_0x745ca0){_0x3575e0[_0x3ae2('0x59')]=_0x745ca0;return _0x3575e0;});}})[_0x3ae2('0x33')](respondWithFilteredResult(_0x4e37c4,_0x158cdb))[_0x3ae2('0x5a')](handleError(_0x4e37c4,null));};exports[_0x3ae2('0x68')]=function(_0x55bd30,_0x48f95b,_0x512f0b){return db['MailAccount']['find']({'where':{'id':_0x55bd30[_0x3ae2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x48f95b,null))[_0x3ae2('0x33')](function(_0x1a31eb){if(_0x1a31eb){return _0x1a31eb[_0x3ae2('0x68')](_0x55bd30[_0x3ae2('0x46')]['ids']);}})[_0x3ae2('0x33')](respondWithStatusCode(_0x48f95b,null))[_0x3ae2('0x5a')](handleError(_0x48f95b,null));};exports[_0x3ae2('0x69')]=function(_0x17ee81,_0x271b2e,_0x853934){if(_0x17ee81[_0x3ae2('0x5d')]['id']){delete _0x17ee81[_0x3ae2('0x5d')]['id'];}return db[_0x3ae2('0x55')]['find']({'where':{'id':_0x17ee81[_0x3ae2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x271b2e,null))[_0x3ae2('0x33')](function(_0x2970d3){if(_0x2970d3){_0x17ee81['body'][_0x3ae2('0x67')]=_0x2970d3['id'];return db[_0x3ae2('0x6a')][_0x3ae2('0x63')](_0x17ee81[_0x3ae2('0x5d')]);}})['then'](respondWithResult(_0x271b2e,null))[_0x3ae2('0x5a')](handleError(_0x271b2e,null));};exports[_0x3ae2('0x6b')]=function(_0x2d2755,_0x2df5e8,_0x535f00){var _0x5c2a67={'raw':![],'where':{}};var _0x3f0b48={};var _0x268f8e={'count':0x0,'rows':[]};return db[_0x3ae2('0x55')]['findOne']({'where':{'id':_0x2d2755[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x2df5e8,null))['then'](function(_0x3834a3){if(_0x3834a3){_0x3f0b48[_0x3ae2('0x49')]=_[_0x3ae2('0x45')](db[_0x3ae2('0x6a')][_0x3ae2('0x41')]);_0x3f0b48[_0x3ae2('0x46')]=_[_0x3ae2('0x45')](_0x2d2755[_0x3ae2('0x46')]);_0x3f0b48[_0x3ae2('0x47')]=_['intersection'](_0x3f0b48[_0x3ae2('0x49')],_0x3f0b48['query']);_0x5c2a67[_0x3ae2('0x4a')]=_[_0x3ae2('0x48')](_0x3f0b48[_0x3ae2('0x49')],qs[_0x3ae2('0x4b')](_0x2d2755['query'][_0x3ae2('0x4b')]));_0x5c2a67[_0x3ae2('0x4a')]=_0x5c2a67[_0x3ae2('0x4a')]['length']?_0x5c2a67[_0x3ae2('0x4a')]:_0x3f0b48[_0x3ae2('0x49')];if(!_0x2d2755[_0x3ae2('0x46')][_0x3ae2('0x4d')](_0x3ae2('0x4e'))){_0x5c2a67[_0x3ae2('0x4f')]=qs[_0x3ae2('0x4f')](_0x2d2755['query'][_0x3ae2('0x4f')]);_0x5c2a67['offset']=qs[_0x3ae2('0x2c')](_0x2d2755[_0x3ae2('0x46')][_0x3ae2('0x2c')]);}_0x5c2a67[_0x3ae2('0x66')]=qs[_0x3ae2('0x50')](_0x2d2755[_0x3ae2('0x46')][_0x3ae2('0x50')]);_0x5c2a67['where']=qs['filters'](_[_0x3ae2('0x6c')](_0x2d2755[_0x3ae2('0x46')],_0x3f0b48[_0x3ae2('0x47')]));_0x5c2a67[_0x3ae2('0x51')][_0x3ae2('0x67')]=_0x3834a3['id'];if(_0x2d2755['query'][_0x3ae2('0x52')]){_0x5c2a67[_0x3ae2('0x51')]=_[_0x3ae2('0x53')](_0x5c2a67['where'],{'$or':_[_0x3ae2('0x40')](_0x5c2a67[_0x3ae2('0x4a')],function(_0x4c5eb1){var _0x5507f7={};_0x5507f7[_0x4c5eb1]={'$like':'%'+_0x2d2755[_0x3ae2('0x46')][_0x3ae2('0x52')]+'%'};return _0x5507f7;})});}_0x5c2a67=_['merge']({},_0x5c2a67,_0x2d2755[_0x3ae2('0x54')]);return db[_0x3ae2('0x6a')]['count']({'where':_0x5c2a67[_0x3ae2('0x51')]})[_0x3ae2('0x33')](function(_0x4a9589){_0x268f8e[_0x3ae2('0x2d')]=_0x4a9589;if(_0x2d2755[_0x3ae2('0x46')]['includeAll']){_0x5c2a67[_0x3ae2('0x57')]=[{'all':!![]}];}return db[_0x3ae2('0x6a')]['findAll'](_0x5c2a67);})['then'](function(_0x2f45fb){_0x268f8e[_0x3ae2('0x59')]=_0x2f45fb;return _0x268f8e;});}})[_0x3ae2('0x33')](respondWithFilteredResult(_0x2df5e8,_0x5c2a67))[_0x3ae2('0x5a')](handleError(_0x2df5e8,null));};exports[_0x3ae2('0x6d')]=function(_0x5c1333,_0x24a687,_0x24792c){return db['MailAccount'][_0x3ae2('0x5c')]({'where':{'id':_0x5c1333[_0x3ae2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x24a687,null))[_0x3ae2('0x33')](function(_0x20b405){if(_0x20b405){return _0x20b405['removeAnswers'](_0x5c1333['query'][_0x3ae2('0x6e')]);}})[_0x3ae2('0x33')](respondWithStatusCode(_0x24a687,null))[_0x3ae2('0x5a')](handleError(_0x24a687,null));};exports[_0x3ae2('0x63')]=function(_0x1121f8,_0x426bcd){var _0x196469={'name':_0x1121f8[_0x3ae2('0x5d')][_0x3ae2('0x39')],'key':_0x1121f8[_0x3ae2('0x5d')][_0x3ae2('0x44')],'email':_0x1121f8['body'][_0x3ae2('0x6f')],'ListId':_0x1121f8[_0x3ae2('0x5d')][_0x3ae2('0x70')],'active':!_[_0x3ae2('0x71')](_0x1121f8['body'][_0x3ae2('0x72')])?_0x1121f8['body'][_0x3ae2('0x72')]:!![],'description':_0x1121f8[_0x3ae2('0x5d')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x1121f8[_0x3ae2('0x5d')][_0x3ae2('0x73')])){if(_0x1121f8['body'][_0x3ae2('0x74')]){_0x196469[_0x3ae2('0x3c')][_0x3ae2('0x75')]=_0x196469[_0x3ae2('0x5f')][_0x3ae2('0x75')]=_0x1121f8[_0x3ae2('0x5d')][_0x3ae2('0x76')];_0x196469['Imap'][_0x3ae2('0x77')]=_0x196469[_0x3ae2('0x5f')][_0x3ae2('0x78')]=_0x1121f8['body']['cpassword'];}else{_0x196469[_0x3ae2('0x3c')]['authentication']=_0x196469[_0x3ae2('0x5f')]['authentication']=![];}_0x196469[_0x3ae2('0x3c')][_0x3ae2('0x79')]=_0x1121f8[_0x3ae2('0x5d')][_0x3ae2('0x3c')][_0x3ae2('0x79')];_0x196469[_0x3ae2('0x3c')][_0x3ae2('0x7a')]=_0x1121f8[_0x3ae2('0x5d')]['Imap'][_0x3ae2('0x7a')];_0x196469[_0x3ae2('0x5f')]['host']=_0x1121f8[_0x3ae2('0x5d')][_0x3ae2('0x5f')][_0x3ae2('0x79')];_0x196469[_0x3ae2('0x5f')][_0x3ae2('0x7a')]=_0x1121f8[_0x3ae2('0x5d')]['Smtp']['port'];}else{_0x196469['Imap'][_0x3ae2('0x7b')]=_0x196469[_0x3ae2('0x5f')][_0x3ae2('0x7b')]=_0x1121f8[_0x3ae2('0x5d')]['cservice'];_0x196469[_0x3ae2('0x3c')][_0x3ae2('0x75')]=_0x196469[_0x3ae2('0x5f')][_0x3ae2('0x75')]=_0x1121f8[_0x3ae2('0x5d')][_0x3ae2('0x76')];_0x196469[_0x3ae2('0x3c')][_0x3ae2('0x77')]=_0x196469[_0x3ae2('0x5f')][_0x3ae2('0x78')]=_0x1121f8['body']['cpassword'];}return db[_0x3ae2('0x55')][_0x3ae2('0x63')](_0x196469,{'include':[{'model':db['MailServerOut'],'as':_0x3ae2('0x5f')},{'model':db['MailServerIn'],'as':_0x3ae2('0x3c')}]})[_0x3ae2('0x33')](function(_0x1e2046){var _0x10cc65=_0x1121f8['user'][_0x3ae2('0x35')]({'plain':!![]});if(!_0x10cc65)throw new Error(_0x3ae2('0x7c'));if(_0x10cc65['role']===_0x3ae2('0x75')){var _0x2d7b11=_0x1e2046[_0x3ae2('0x35')]({'plain':!![]});return db[_0x3ae2('0x7d')][_0x3ae2('0x5c')]({'where':{'name':'MailAccounts','userProfileId':_0x10cc65['userProfileId']},'raw':!![]})['then'](function(_0x640c18){if(_0x640c18&&_0x640c18[_0x3ae2('0x7e')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d7b11[_0x3ae2('0x39')],'resourceId':_0x2d7b11['id'],'type':_0x640c18['name'],'sectionId':_0x640c18['id']},{})[_0x3ae2('0x33')](function(){return _0x1e2046;});}else{return _0x1e2046;}})[_0x3ae2('0x5a')](function(_0x42b5e9){logger[_0x3ae2('0x25')](_0x3ae2('0x7f'),_0x42b5e9);throw _0x42b5e9;});}return _0x1e2046;})['then'](respondWithResult(_0x426bcd,0xc9))[_0x3ae2('0x5a')](handleError(_0x426bcd,null));};exports[_0x3ae2('0x80')]=function(_0x473d3d,_0x30c2a2,_0x40c437){return db[_0x3ae2('0x55')][_0x3ae2('0x65')]({'where':{'id':_0x473d3d[_0x3ae2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x30c2a2,null))['then'](function(_0x353446){if(_0x353446){return _0x353446[_0x3ae2('0x80')]();}return null;})[_0x3ae2('0x33')](respondWithResult(_0x30c2a2,null))[_0x3ae2('0x5a')](handleError(_0x30c2a2,null));};exports[_0x3ae2('0x81')]=function(_0xa96877,_0x181c1f,_0x330b61){if(_0xa96877['body']['id']){delete _0xa96877[_0x3ae2('0x5d')]['id'];}return db[_0x3ae2('0x55')][_0x3ae2('0x5c')]({'where':{'id':_0xa96877['params']['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x181c1f,null))[_0x3ae2('0x33')](function(_0x275b69){if(_0x275b69){_0xa96877[_0x3ae2('0x5d')]['MailAccountId']=_0x275b69['id'];return db[_0x3ae2('0x3b')][_0x3ae2('0x63')](_0xa96877[_0x3ae2('0x5d')]);}})[_0x3ae2('0x33')](respondWithResult(_0x181c1f,null))['catch'](handleError(_0x181c1f,null));};exports[_0x3ae2('0x82')]=function(_0x42d825,_0x87da87,_0x3a4095){return db[_0x3ae2('0x55')][_0x3ae2('0x65')]({'where':{'id':_0x42d825[_0x3ae2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x87da87,null))[_0x3ae2('0x33')](function(_0x232374){if(_0x232374){return _0x232374['setImap'](null);}return null;})[_0x3ae2('0x33')](respondWithStatusCode(_0x87da87,null))['catch'](handleError(_0x87da87,null));};exports[_0x3ae2('0x83')]=function(_0x32c471,_0x46859e,_0x339326){return db[_0x3ae2('0x55')][_0x3ae2('0x65')]({'where':{'id':_0x32c471[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x46859e,null))[_0x3ae2('0x33')](function(_0x3a97ae){if(_0x3a97ae){return _0x3a97ae[_0x3ae2('0x83')]();}return null;})['then'](respondWithResult(_0x46859e,null))[_0x3ae2('0x5a')](handleError(_0x46859e,null));};exports[_0x3ae2('0x84')]=function(_0x58bbdf,_0x2b4da5,_0x1bf671){if(_0x58bbdf[_0x3ae2('0x5d')]['id']){delete _0x58bbdf[_0x3ae2('0x5d')]['id'];}return db['MailAccount'][_0x3ae2('0x5c')]({'where':{'id':_0x58bbdf[_0x3ae2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2b4da5,null))[_0x3ae2('0x33')](function(_0x151c21){if(_0x151c21){_0x58bbdf['body'][_0x3ae2('0x67')]=_0x151c21['id'];return db[_0x3ae2('0x3d')][_0x3ae2('0x63')](_0x58bbdf['body']);}})['then'](respondWithResult(_0x2b4da5,null))[_0x3ae2('0x5a')](handleError(_0x2b4da5,null));};exports[_0x3ae2('0x85')]=function(_0x5807f0,_0x3ade6c,_0xc2d56d){return db['MailAccount']['findOne']({'where':{'id':_0x5807f0[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x3ade6c,null))['then'](function(_0x45a909){if(_0x45a909){return _0x45a909[_0x3ae2('0x86')](null);}return null;})[_0x3ae2('0x33')](respondWithStatusCode(_0x3ade6c,null))['catch'](handleError(_0x3ade6c,null));};exports[_0x3ae2('0x87')]=function(_0x5c4257,_0x21bf09,_0x47a1a6){return db[_0x3ae2('0x88')][_0x3ae2('0x5c')]({'where':{'id':_0x5c4257[_0x3ae2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x21bf09,null))['then'](function(_0x194cf9){if(_0x194cf9){return _0x194cf9[_0x3ae2('0x87')](_0x5c4257['body']['ids'],_[_0x3ae2('0x89')](_0x5c4257['body'],['ids','id'])||{});}})[_0x3ae2('0x33')](respondWithResult(_0x21bf09,null))[_0x3ae2('0x5a')](handleError(_0x21bf09,null));};exports[_0x3ae2('0x8a')]=function(_0x29511c,_0x99b4e,_0x1aa7b6){var _0x3712c8={'raw':![],'where':{}};var _0x1f6e3a={};var _0x3f00da={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x29511c[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x99b4e,null))[_0x3ae2('0x33')](function(_0x3717d8){if(_0x3717d8){_0x1f6e3a['model']=_[_0x3ae2('0x45')](db[_0x3ae2('0x88')]['rawAttributes']);_0x1f6e3a['query']=_[_0x3ae2('0x45')](_0x29511c[_0x3ae2('0x46')]);_0x1f6e3a[_0x3ae2('0x47')]=_[_0x3ae2('0x48')](_0x1f6e3a[_0x3ae2('0x49')],_0x1f6e3a[_0x3ae2('0x46')]);_0x3712c8[_0x3ae2('0x4a')]=_[_0x3ae2('0x48')](_0x1f6e3a[_0x3ae2('0x49')],qs[_0x3ae2('0x4b')](_0x29511c[_0x3ae2('0x46')]['fields']));_0x3712c8['attributes']=_0x3712c8[_0x3ae2('0x4a')][_0x3ae2('0x4c')]?_0x3712c8[_0x3ae2('0x4a')]:_0x1f6e3a[_0x3ae2('0x49')];if(!_0x29511c[_0x3ae2('0x46')]['hasOwnProperty'](_0x3ae2('0x4e'))){_0x3712c8[_0x3ae2('0x4f')]=qs['limit'](_0x29511c['query'][_0x3ae2('0x4f')]);_0x3712c8[_0x3ae2('0x2c')]=qs[_0x3ae2('0x2c')](_0x29511c[_0x3ae2('0x46')]['offset']);}_0x3712c8['order']=qs[_0x3ae2('0x50')](_0x29511c[_0x3ae2('0x46')][_0x3ae2('0x50')]);_0x3712c8[_0x3ae2('0x51')]=qs[_0x3ae2('0x47')](_[_0x3ae2('0x6c')](_0x29511c[_0x3ae2('0x46')],_0x1f6e3a[_0x3ae2('0x47')]));_0x3712c8[_0x3ae2('0x51')][_0x3ae2('0x67')]=_0x3717d8['id'];if(_0x29511c[_0x3ae2('0x46')]['filter']){_0x3712c8['where']=_[_0x3ae2('0x53')](_0x3712c8[_0x3ae2('0x51')],{'$or':_[_0x3ae2('0x40')](_0x3712c8[_0x3ae2('0x4a')],function(_0x416781){var _0x47a7de={};_0x47a7de[_0x416781]={'$like':'%'+_0x29511c['query']['filter']+'%'};return _0x47a7de;})});}_0x3712c8=_[_0x3ae2('0x53')]({},_0x3712c8,_0x29511c[_0x3ae2('0x54')]);return db[_0x3ae2('0x88')][_0x3ae2('0x2d')]({'where':_0x3712c8['where']})[_0x3ae2('0x33')](function(_0x52640a){_0x3f00da['count']=_0x52640a;if(_0x29511c[_0x3ae2('0x46')][_0x3ae2('0x56')]){_0x3712c8[_0x3ae2('0x57')]=[{'model':db[_0x3ae2('0x8b')],'as':'Contact','required':![]},{'model':db[_0x3ae2('0x8c')],'as':_0x3ae2('0x8d'),'attributes':[_0x3ae2('0x39'),_0x3ae2('0x8e'),_0x3ae2('0x8f')],'required':![]},{'model':db['Tag'],'as':_0x3ae2('0x90'),'attributes':['id',_0x3ae2('0x39'),_0x3ae2('0x91')],'where':_0x29511c[_0x3ae2('0x46')][_0x3ae2('0x92')]?{'id':_0x29511c[_0x3ae2('0x46')]['tag']}:undefined,'required':_0x29511c[_0x3ae2('0x46')][_0x3ae2('0x92')]?!![]:![]}];}return db[_0x3ae2('0x88')][_0x3ae2('0x58')](_0x3712c8);})['then'](function(_0x1b245e){_0x3f00da[_0x3ae2('0x59')]=_0x1b245e;return _0x3f00da;});}})[_0x3ae2('0x33')](respondWithFilteredResult(_0x99b4e,_0x3712c8))['catch'](handleError(_0x99b4e,null));};exports[_0x3ae2('0x93')]=function addApplications(_0x1cecd2,_0x52a912){var _0x557366=_0x1cecd2[_0x3ae2('0x5e')]['id'];var _0x4b205d=_0x1cecd2[_0x3ae2('0x5d')];var _0x4b5c24=0xc8;var _0x1c0e29=null;return db[_0x3ae2('0x94')][_0x3ae2('0x95')]({'isolationLevel':db[_0x3ae2('0x94')]['Transaction'][_0x3ae2('0x96')][_0x3ae2('0x97')]},function(_0x461ac1){return db['MailAccount'][_0x3ae2('0x65')]({'where':{'id':_0x557366},'transaction':_0x461ac1})[_0x3ae2('0x33')](function(_0x11037c){if(_0x11037c){return db[_0x3ae2('0x98')][_0x3ae2('0x34')]({'where':{'MailAccountId':_0x557366},'transaction':_0x461ac1})[_0x3ae2('0x33')](function(){var _0x4eb67b=_['map'](_0x4b205d,function(_0x20f871){_0x20f871[_0x3ae2('0x67')]=_0x557366;return _0x20f871;});return db[_0x3ae2('0x98')]['bulkCreate'](_0x4eb67b,{'transaction':_0x461ac1});});}else{_0x4b5c24=0x194;_0x1c0e29=[];}});})[_0x3ae2('0x33')](function(){if(_0x4b5c24!==0x194){return db[_0x3ae2('0x98')]['findAndCountAll']({'where':{'MailAccountId':_0x557366},'order':_0x3ae2('0x99')})[_0x3ae2('0x33')](function(_0x2ecb5d){_0x1c0e29=_0x2ecb5d;});}})[_0x3ae2('0x5a')](function(_0x4b4527){_0x4b5c24=0x1f4;logger[_0x3ae2('0x25')](_0x4b4527[_0x3ae2('0x9a')]);if(_0x4b4527[_0x3ae2('0x39')]){delete _0x4b4527[_0x3ae2('0x39')];}_0x1c0e29=_0x4b4527;})[_0x3ae2('0x9b')](function(){if(_0x1c0e29===null){_0x52a912[_0x3ae2('0x29')](_0x4b5c24);}else{if(_0x4b5c24===0x1f4){_0x52a912[_0x3ae2('0x2a')](_0x4b5c24)[_0x3ae2('0x9c')](_0x1c0e29);}else{_0x52a912[_0x3ae2('0x2a')](_0x4b5c24)[_0x3ae2('0x2b')](_0x1c0e29);}}});};exports['getApplications']=function(_0x3bf33d,_0x1d454e,_0x567b15){var _0x21c3b2={};var _0x2530b5={};var _0x278a8f;var _0x37b315;return db[_0x3ae2('0x55')][_0x3ae2('0x65')]({'where':{'id':_0x3bf33d[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x1d454e,null))[_0x3ae2('0x33')](function(_0x5ec2a1){if(_0x5ec2a1){_0x278a8f=_0x5ec2a1;_0x2530b5[_0x3ae2('0x49')]=_[_0x3ae2('0x45')](db[_0x3ae2('0x98')][_0x3ae2('0x41')]);_0x2530b5[_0x3ae2('0x46')]=_[_0x3ae2('0x45')](_0x3bf33d[_0x3ae2('0x46')]);_0x2530b5[_0x3ae2('0x47')]=_[_0x3ae2('0x48')](_0x2530b5[_0x3ae2('0x49')],_0x2530b5[_0x3ae2('0x46')]);_0x21c3b2[_0x3ae2('0x4a')]=_[_0x3ae2('0x48')](_0x2530b5[_0x3ae2('0x49')],qs[_0x3ae2('0x4b')](_0x3bf33d[_0x3ae2('0x46')][_0x3ae2('0x4b')]));_0x21c3b2['attributes']=_0x21c3b2[_0x3ae2('0x4a')][_0x3ae2('0x4c')]?_0x21c3b2[_0x3ae2('0x4a')]:_0x2530b5['model'];_0x21c3b2[_0x3ae2('0x66')]=qs[_0x3ae2('0x50')](_0x3bf33d[_0x3ae2('0x46')][_0x3ae2('0x50')]);_0x21c3b2['where']=qs['filters'](_[_0x3ae2('0x6c')](_0x3bf33d[_0x3ae2('0x46')],_0x2530b5[_0x3ae2('0x47')]));if(_0x3bf33d[_0x3ae2('0x46')]['filter']){_0x21c3b2[_0x3ae2('0x51')]=_['merge'](_0x21c3b2[_0x3ae2('0x51')],{'$or':_[_0x3ae2('0x40')](_0x21c3b2[_0x3ae2('0x4a')],function(_0x4f54af){var _0x4a286b={};_0x4a286b[_0x4f54af]={'$like':'%'+_0x3bf33d[_0x3ae2('0x46')]['filter']+'%'};return _0x4a286b;})});}_0x21c3b2=_[_0x3ae2('0x53')]({},_0x21c3b2,_0x3bf33d['options']);return _0x278a8f[_0x3ae2('0x9d')](_0x21c3b2);}})['then'](function(_0x181dd7){if(_0x181dd7){_0x37b315=_0x181dd7[_0x3ae2('0x4c')];if(!_0x3bf33d[_0x3ae2('0x46')]['hasOwnProperty'](_0x3ae2('0x4e'))){_0x21c3b2[_0x3ae2('0x4f')]=qs[_0x3ae2('0x4f')](_0x3bf33d['query'][_0x3ae2('0x4f')]);_0x21c3b2['offset']=qs[_0x3ae2('0x2c')](_0x3bf33d['query'][_0x3ae2('0x2c')]);}return _0x278a8f[_0x3ae2('0x9d')](_0x21c3b2);}})['then'](function(_0x1b0bde){if(_0x1b0bde){return _0x1b0bde?{'count':_0x37b315,'rows':_0x1b0bde}:null;}})['then'](respondWithResult(_0x1d454e,null))[_0x3ae2('0x5a')](handleError(_0x1d454e,null));};exports[_0x3ae2('0x9e')]=function(_0x44d395,_0x273267,_0x33d7b6){var _0x5a0e6d={'raw':!![],'where':{}};var _0x603cfe={};var _0x38f0e4={'count':0x0,'rows':[]};return db[_0x3ae2('0x55')][_0x3ae2('0x65')]({'where':{'id':_0x44d395[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x273267,null))[_0x3ae2('0x33')](function(_0x26f660){if(_0x26f660){_0x603cfe[_0x3ae2('0x49')]=_[_0x3ae2('0x45')](db[_0x3ae2('0x9f')][_0x3ae2('0x41')]);_0x603cfe[_0x3ae2('0x46')]=_[_0x3ae2('0x45')](_0x44d395['query']);_0x603cfe[_0x3ae2('0x47')]=_['intersection'](_0x603cfe[_0x3ae2('0x49')],_0x603cfe[_0x3ae2('0x46')]);_0x5a0e6d[_0x3ae2('0x4a')]=_[_0x3ae2('0x48')](_0x603cfe[_0x3ae2('0x49')],qs['fields'](_0x44d395[_0x3ae2('0x46')][_0x3ae2('0x4b')]));_0x5a0e6d['attributes']=_0x5a0e6d[_0x3ae2('0x4a')][_0x3ae2('0x4c')]?_0x5a0e6d[_0x3ae2('0x4a')]:_0x603cfe[_0x3ae2('0x49')];if(!_0x44d395[_0x3ae2('0x46')]['hasOwnProperty']('nolimit')){_0x5a0e6d['limit']=qs['limit'](_0x44d395[_0x3ae2('0x46')][_0x3ae2('0x4f')]);_0x5a0e6d[_0x3ae2('0x2c')]=qs[_0x3ae2('0x2c')](_0x44d395[_0x3ae2('0x46')][_0x3ae2('0x2c')]);}_0x5a0e6d['order']=qs['sort'](_0x44d395['query'][_0x3ae2('0x50')]);_0x5a0e6d[_0x3ae2('0x51')]=qs[_0x3ae2('0x47')](_[_0x3ae2('0x6c')](_0x44d395[_0x3ae2('0x46')],_0x603cfe[_0x3ae2('0x47')]));_0x5a0e6d[_0x3ae2('0x51')][_0x3ae2('0x67')]=_0x26f660['id'];if(_0x44d395[_0x3ae2('0x46')][_0x3ae2('0x52')]){_0x5a0e6d[_0x3ae2('0x51')]=_[_0x3ae2('0x53')](_0x5a0e6d['where'],{'$or':_[_0x3ae2('0x40')](_0x5a0e6d[_0x3ae2('0x4a')],function(_0x1efd62){var _0x39dd48={};_0x39dd48[_0x1efd62]={'$like':'%'+_0x44d395['query'][_0x3ae2('0x52')]+'%'};return _0x39dd48;})});}if(_0x44d395[_0x3ae2('0x46')][_0x3ae2('0xa0')]){var _0x3f3e63=_0x44d395[_0x3ae2('0x46')][_0x3ae2('0xa0')][_0x3ae2('0xa1')](',');var _0x3bf8c7={};_0x3bf8c7[_0x3f3e63[0x0]]={'$gte':moment(_0x3f3e63[0x1])[_0x3ae2('0xa2')](_0x3ae2('0xa3'))};_0x5a0e6d[_0x3ae2('0x51')]=_[_0x3ae2('0x53')](_0x5a0e6d[_0x3ae2('0x51')],_0x3bf8c7);}_0x5a0e6d=_[_0x3ae2('0x53')]({},_0x5a0e6d,_0x44d395[_0x3ae2('0x54')]);return db[_0x3ae2('0x9f')][_0x3ae2('0x2d')]({'where':_0x5a0e6d['where']})[_0x3ae2('0x33')](function(_0x187438){_0x38f0e4[_0x3ae2('0x2d')]=_0x187438;if(_0x44d395['query'][_0x3ae2('0x56')]){_0x5a0e6d[_0x3ae2('0x57')]=[{'all':!![]}];}return db[_0x3ae2('0x9f')][_0x3ae2('0x58')](_0x5a0e6d);})[_0x3ae2('0x33')](function(_0x19bd30){if(_0x44d395[_0x3ae2('0x46')][_0x3ae2('0xa4')]===_0x3ae2('0xa5')){for(var _0x57dee8=0x0;_0x57dee8<_0x19bd30[_0x3ae2('0x4c')];_0x57dee8++){_0x19bd30[_0x57dee8][_0x3ae2('0x5d')]=juice(_0x19bd30[_0x57dee8][_0x3ae2('0x5d')]);}}_0x38f0e4[_0x3ae2('0x59')]=_0x19bd30;return _0x38f0e4;});}})[_0x3ae2('0x33')](respondWithFilteredResult(_0x273267,_0x5a0e6d))[_0x3ae2('0x5a')](handleError(_0x273267,null));};exports[_0x3ae2('0x9c')]=function(_0x3c4af8,_0x51f8ef,_0x1d2b2e){var _0x293d22,_0x484309={},_0x2e0065;if(_0x3c4af8[_0x3ae2('0x5d')]['to']){_0x2e0065=_0x3c4af8[_0x3ae2('0x5d')]['to'][_0x3ae2('0xa1')](',')[0x0];}return db[_0x3ae2('0x55')][_0x3ae2('0x5c')]({'where':{'id':_0x3c4af8[_0x3ae2('0x5e')]['id']},'include':[{'model':db[_0x3ae2('0xa6')],'as':_0x3ae2('0xa7'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x2e0065},'limit':0x1,'order':[['updatedAt',_0x3ae2('0xa8')]]}]},{'model':db['MailServerOut'],'as':_0x3ae2('0x5f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x51f8ef,null))['then'](function(_0x247d46){if(_0x247d46){_0x293d22=_0x247d46;if(_0x247d46['Smtp']){if(_[_0x3ae2('0x71')](_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xa9')])){_0x3c4af8['body'][_0x3ae2('0xa9')]=util[_0x3ae2('0xa2')](_0x3ae2('0xaa'),_0x247d46[_0x3ae2('0x39')],_0x247d46['email']||_0x247d46['Smtp'][_0x3ae2('0x75')]);}if(_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xab')]&&_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xab')][_0x3ae2('0x4c')]){for(var _0x574190=0x0;_0x574190<_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xab')][_0x3ae2('0x4c')];_0x574190+=0x1){_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xab')][_0x574190]={'filename':_0x3c4af8['body'][_0x3ae2('0xab')][_0x574190][_0x3ae2('0x39')],'path':path[_0x3ae2('0xac')](config[_0x3ae2('0xad')],_0x3ae2('0xae'),_0x3c4af8['body'][_0x3ae2('0xab')][_0x574190][_0x3ae2('0xaf')])};}}var _0x21edde={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x247d46[_0x3ae2('0x5f')][_0x3ae2('0x7b')])){if(_0x247d46['Smtp'][_0x3ae2('0xb0')]){_0x21edde[_0x3ae2('0xb1')]={'user':_0x247d46[_0x3ae2('0x5f')][_0x3ae2('0x75')],'pass':_0x247d46[_0x3ae2('0x5f')][_0x3ae2('0x78')]};}_0x21edde['host']=_0x247d46[_0x3ae2('0x5f')][_0x3ae2('0x79')];_0x21edde[_0x3ae2('0x7a')]=_0x247d46[_0x3ae2('0x5f')]['port'];_0x21edde['secure']=_0x247d46['Smtp'][_0x3ae2('0xb2')];}else{_0x21edde[_0x3ae2('0x7b')]=_0x247d46[_0x3ae2('0x5f')]['service'];_0x21edde[_0x3ae2('0xb1')]={'user':_0x247d46['Smtp'][_0x3ae2('0x75')],'pass':_0x247d46[_0x3ae2('0x5f')][_0x3ae2('0x78')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x21edde,'message':_0x3c4af8[_0x3ae2('0x5d')]});}else{throw new Error(_0x3ae2('0xb3'));}}})[_0x3ae2('0x33')](function(_0x87f6b1){if(_0x87f6b1){_0x484309=_0x87f6b1;if(_0x293d22[_0x3ae2('0xa7')]){if(_0x293d22[_0x3ae2('0xa7')][_0x3ae2('0xb4')][_0x3ae2('0x4c')]){return _0x293d22['List'][_0x3ae2('0xb4')][0x0];}else{return db[_0x3ae2('0x8b')][_0x3ae2('0x63')](_[_0x3ae2('0xb5')](_0x3c4af8['body'],{'firstName':_0x3c4af8['body']['to'],'email':_0x3c4af8[_0x3ae2('0x5d')]['to'],'phone':_0x3c4af8[_0x3ae2('0x5d')]['to'],'ListId':_0x293d22[_0x3ae2('0x70')]}));}}else{throw new Error(_0x3ae2('0xb3'));}}})[_0x3ae2('0x33')](function(_0x423a6d){if(_0x423a6d){var _0x345dd0={'UserId':_0x3c4af8[_0x3ae2('0x75')]['id'],'ContactId':_0x423a6d['id'],'MailAccountId':_0x293d22['id'],'inReplyTo':_0x484309[_0x3ae2('0xb6')],'to':_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xa9')],'cc':_0x3c4af8[_0x3ae2('0x5d')]['cc'],'subject':_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xb7')],'attach':_0x3c4af8[_0x3ae2('0x5d')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0x3ae2('0xa3')),'lastMsgDirection':_0x3ae2('0xb8'),'Messages':[_[_0x3ae2('0x53')](_0x3c4af8[_0x3ae2('0x5d')],{'messageId':_0x484309[_0x3ae2('0xb6')],'sentAt':moment()['format'](_0x3ae2('0xa3')),'read':!![],'MailAccountId':_0x293d22['id'],'UserId':_0x3c4af8[_0x3ae2('0x75')]['id'],'ContactId':_0x423a6d['id']})]};if(_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xb9')]){_0x345dd0=_[_0x3ae2('0x53')](_0x345dd0,_0x3c4af8[_0x3ae2('0x5d')][_0x3ae2('0xb9')]);}return db[_0x3ae2('0x88')][_0x3ae2('0x63')](_0x345dd0,{'include':[{'model':db[_0x3ae2('0x9f')],'as':_0x3ae2('0xba')}]});}})['then'](respondWithResult(_0x51f8ef,null))['catch'](handleError(_0x51f8ef,null));};exports['verifySmtp']=function(_0x346fb3,_0x1d84d4,_0x47176b){return db[_0x3ae2('0x55')][_0x3ae2('0x5c')]({'where':{'id':_0x346fb3[_0x3ae2('0x5e')]['id']},'include':[{'model':db[_0x3ae2('0x3d')],'as':_0x3ae2('0x5f'),'raw':!![]}]})[_0x3ae2('0x33')](handleEntityNotFound(_0x1d84d4,null))['then'](function(_0x529b9b){if(_0x529b9b&&_0x529b9b['Smtp']){var _0x1acd35={'id':_0x529b9b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x529b9b[_0x3ae2('0x5f')]['service']){_0x1acd35[_0x3ae2('0x7b')]=_0x529b9b[_0x3ae2('0x5f')][_0x3ae2('0x7b')];}else{_0x1acd35[_0x3ae2('0x79')]=_0x529b9b[_0x3ae2('0x5f')][_0x3ae2('0x79')];_0x1acd35[_0x3ae2('0x7a')]=_0x529b9b[_0x3ae2('0x5f')]['port'];_0x1acd35[_0x3ae2('0xb2')]=_0x529b9b[_0x3ae2('0x5f')][_0x3ae2('0xb2')];}if(_0x529b9b[_0x3ae2('0x5f')]['authentication']){_0x1acd35[_0x3ae2('0xb1')]={'user':_0x529b9b['Smtp'][_0x3ae2('0x75')],'pass':_0x529b9b[_0x3ae2('0x5f')][_0x3ae2('0x78')]};}return respondWithRpcPromise(_0x3ae2('0xbb'),_0x3ae2('0xbc'),{'account':_0x1acd35});}})[_0x3ae2('0x33')](respondWithResult(_0x1d84d4,null))['catch'](handleError(_0x1d84d4,null));};exports[_0x3ae2('0x34')]=function(_0x14b203,_0x2ae40c){return db[_0x3ae2('0x55')][_0x3ae2('0x5c')]({'where':{'id':_0x14b203['params']['id']}})['then'](handleEntityNotFound(_0x2ae40c,null))[_0x3ae2('0x33')](function(_0x4b6ce5){if(_0x4b6ce5&&_0x4b6ce5[_0x3ae2('0x7b')]){throw new db[(_0x3ae2('0xbd'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x4b6ce5;})[_0x3ae2('0x33')](removeEntity(_0x2ae40c,null))['catch'](handleError(_0x2ae40c,null));};exports[_0x3ae2('0xbe')]=function(_0x185cf9,_0x2e09b6,_0x467db2){return db[_0x3ae2('0x55')][_0x3ae2('0x5c')]({'where':{'id':_0x185cf9[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x2e09b6,null))['then'](function(_0x176b7b){if(_0x176b7b){return _0x176b7b['addAgents'](_0x185cf9[_0x3ae2('0x5d')][_0x3ae2('0x6e')],_[_0x3ae2('0x89')](_0x185cf9[_0x3ae2('0x5d')],[_0x3ae2('0x6e'),'id'])||{})['spread'](function(_0x12b942){for(var _0x122675=0x0;_0x122675<_0x185cf9['body']['ids'][_0x3ae2('0x4c')];_0x122675+=0x1){socket[_0x3ae2('0xbf')](_0x3ae2('0xc0'),{'UserId':Number(_0x185cf9[_0x3ae2('0x5d')][_0x3ae2('0x6e')][_0x122675]),'MailAccountId':Number(_0x185cf9['params']['id'])});}return _0x12b942;});}})['then'](respondWithResult(_0x2e09b6,null))[_0x3ae2('0x5a')](handleError(_0x2e09b6,null));};exports[_0x3ae2('0xc1')]=function(_0x4ad6e1,_0x5ad490,_0x1650b8){return db[_0x3ae2('0x55')][_0x3ae2('0x5c')]({'where':{'id':_0x4ad6e1[_0x3ae2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5ad490,null))[_0x3ae2('0x33')](function(_0x44ccc7){if(_0x44ccc7){return _0x44ccc7[_0x3ae2('0xc1')](_0x4ad6e1['query'][_0x3ae2('0x6e')])['then'](function(){if(_['isArray'](_0x4ad6e1[_0x3ae2('0x46')][_0x3ae2('0x6e')])){for(var _0x36f95e=0x0;_0x36f95e<_0x4ad6e1['query'][_0x3ae2('0x6e')][_0x3ae2('0x4c')];_0x36f95e+=0x1){socket['emit'](_0x3ae2('0xc2'),{'UserId':Number(_0x4ad6e1[_0x3ae2('0x46')]['ids'][_0x36f95e]),'MailAccountId':Number(_0x4ad6e1[_0x3ae2('0x5e')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x4ad6e1[_0x3ae2('0x46')][_0x3ae2('0x6e')]),'MailAccountId':Number(_0x4ad6e1[_0x3ae2('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x5ad490,null))[_0x3ae2('0x5a')](handleError(_0x5ad490,null));};exports[_0x3ae2('0xc3')]=function(_0x4ed969,_0x13ac2c,_0x56bcf2){var _0x4a7966={};var _0x2ac8a1={};var _0x274637;var _0x291b5e;return db[_0x3ae2('0x55')][_0x3ae2('0x65')]({'where':{'id':_0x4ed969[_0x3ae2('0x5e')]['id']}})[_0x3ae2('0x33')](handleEntityNotFound(_0x13ac2c,null))[_0x3ae2('0x33')](function(_0x33e5bb){if(_0x33e5bb){_0x274637=_0x33e5bb;_0x2ac8a1[_0x3ae2('0x49')]=_[_0x3ae2('0x45')](db['User'][_0x3ae2('0x41')]);_0x2ac8a1['query']=_[_0x3ae2('0x45')](_0x4ed969['query']);_0x2ac8a1['filters']=_[_0x3ae2('0x48')](_0x2ac8a1['model'],_0x2ac8a1[_0x3ae2('0x46')]);_0x4a7966[_0x3ae2('0x4a')]=_[_0x3ae2('0x48')](_0x2ac8a1['model'],qs['fields'](_0x4ed969[_0x3ae2('0x46')][_0x3ae2('0x4b')]));_0x4a7966[_0x3ae2('0x4a')]=_0x4a7966['attributes'][_0x3ae2('0x4c')]?_0x4a7966[_0x3ae2('0x4a')]:_0x2ac8a1[_0x3ae2('0x49')];_0x4a7966[_0x3ae2('0x66')]=qs[_0x3ae2('0x50')](_0x4ed969[_0x3ae2('0x46')]['sort']);_0x4a7966[_0x3ae2('0x51')]=qs[_0x3ae2('0x47')](_[_0x3ae2('0x6c')](_0x4ed969[_0x3ae2('0x46')],_0x2ac8a1['filters']));if(_0x4ed969[_0x3ae2('0x46')][_0x3ae2('0x52')]){_0x4a7966[_0x3ae2('0x51')]=_[_0x3ae2('0x53')](_0x4a7966[_0x3ae2('0x51')],{'$or':_[_0x3ae2('0x40')](_0x4a7966[_0x3ae2('0x4a')],function(_0x267dcf){var _0x369ecc={};_0x369ecc[_0x267dcf]={'$like':'%'+_0x4ed969[_0x3ae2('0x46')][_0x3ae2('0x52')]+'%'};return _0x369ecc;})});}_0x4a7966=_['merge']({},_0x4a7966,_0x4ed969['options']);return _0x274637[_0x3ae2('0xc3')](_0x4a7966);}})[_0x3ae2('0x33')](function(_0x2bddaf){if(_0x2bddaf){_0x291b5e=_0x2bddaf[_0x3ae2('0x4c')];if(!_0x4ed969[_0x3ae2('0x46')]['hasOwnProperty'](_0x3ae2('0x4e'))){_0x4a7966['limit']=qs['limit'](_0x4ed969[_0x3ae2('0x46')][_0x3ae2('0x4f')]);_0x4a7966['offset']=qs[_0x3ae2('0x2c')](_0x4ed969[_0x3ae2('0x46')]['offset']);}return _0x274637[_0x3ae2('0xc3')](_0x4a7966);}})[_0x3ae2('0x33')](function(_0x19d993){if(_0x19d993){return _0x19d993?{'count':_0x291b5e,'rows':_0x19d993}:null;}})[_0x3ae2('0x33')](respondWithResult(_0x13ac2c,null))[_0x3ae2('0x5a')](handleError(_0x13ac2c,null));};
\ No newline at end of file
+var _0x2785=['setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','internal','Tag','tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','priority','getApplications','MailMessage','$gte','format','inlineCss','true','split','List','Contacts','%s\x20<%s>','attachments','root','server/files/attachments','basename','secure','auth','List\x20not\x20found','messageId','from','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','ValidationError','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','juice','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','./mailAccount.socket','jayson/promise','client','http','request','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','info','result','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','MailAccounts','UserProfileResource','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','params','keys','find','catch','body','describe','MailAccountId','Disposition','create','getDispositions','findOne','order','pick','findAll','ids','CannedAnswer','getAnswers','ListId','isNil','active','description','cservice','user','pass','authentication','host','port','service','password','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap'];(function(_0x488b16,_0x3fa3f0){var _0x5bd8ce=function(_0x47b3d2){while(--_0x47b3d2){_0x488b16['push'](_0x488b16['shift']());}};_0x5bd8ce(++_0x3fa3f0);}(_0x2785,0x1be));var _0x5278=function(_0xfb3b3,_0x10db7a){_0xfb3b3=_0xfb3b3-0x0;var _0x36cae7=_0x2785[_0xfb3b3];return _0x36cae7;};'use strict';var emlformat=require(_0x5278('0x0'));var rimraf=require(_0x5278('0x1'));var zipdir=require(_0x5278('0x2'));var jsonpatch=require(_0x5278('0x3'));var rp=require(_0x5278('0x4'));var moment=require('moment');var BPromise=require(_0x5278('0x5'));var Mustache=require(_0x5278('0x6'));var util=require(_0x5278('0x7'));var path=require(_0x5278('0x8'));var sox=require(_0x5278('0x9'));var csv=require(_0x5278('0xa'));var ejs=require(_0x5278('0xb'));var fs=require('fs');var fs_extra=require(_0x5278('0xc'));var _=require(_0x5278('0xd'));var squel=require('squel');var crypto=require(_0x5278('0xe'));var jsforce=require(_0x5278('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5278('0xa'));var querystring=require(_0x5278('0x10'));var Papa=require('papaparse');var htmlToText=require('html-to-text');var juice=require(_0x5278('0x11'));var Redis=require(_0x5278('0x12'));var authService=require(_0x5278('0x13'));var qs=require(_0x5278('0x14'));var as=require(_0x5278('0x15'));var hardwareService=require(_0x5278('0x16'));var logger=require(_0x5278('0x17'))('api');var utils=require(_0x5278('0x18'));var config=require(_0x5278('0x19'));var licenseUtil=require(_0x5278('0x1a'));var db=require(_0x5278('0x1b'))['db'];config[_0x5278('0x1c')]=_[_0x5278('0x1d')](config[_0x5278('0x1c')],{'host':_0x5278('0x1e'),'port':0x18eb});var socket=require(_0x5278('0x1f'))(new Redis(config[_0x5278('0x1c')]));require(_0x5278('0x20'))['register'](socket);var jayson=require(_0x5278('0x21'));var client=jayson[_0x5278('0x22')][_0x5278('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x3c3bad,_0x32c8f3,_0x205ba7,_0x568052){return new BPromise(function(_0x56fc5e,_0x23aa05){var _0x26465e=_0x568052||client;return _0x26465e[_0x5278('0x24')](_0x3c3bad,_0x205ba7)['then'](function(_0x55ec42){logger['info']('MailAccount,\x20%s,\x20%s',_0x32c8f3,'request\x20sent');logger[_0x5278('0x25')](_0x5278('0x26'),_0x32c8f3,_0x5278('0x27'),JSON[_0x5278('0x28')](_0x55ec42));if(_0x55ec42[_0x5278('0x29')]){if(_0x55ec42[_0x5278('0x29')][_0x5278('0x2a')]===0x1f4){logger[_0x5278('0x29')](_0x5278('0x2b'),_0x32c8f3,_0x55ec42[_0x5278('0x29')][_0x5278('0x2c')]);return _0x23aa05(_0x55ec42['error'][_0x5278('0x2c')]);}logger['error'](_0x5278('0x2b'),_0x32c8f3,_0x55ec42[_0x5278('0x29')]['message']);return _0x56fc5e(_0x55ec42[_0x5278('0x29')][_0x5278('0x2c')]);}else{logger[_0x5278('0x2d')]('MailAccount,\x20%s,\x20%s',_0x32c8f3,'request\x20sent');_0x56fc5e(_0x55ec42[_0x5278('0x2e')]['message']);}})['catch'](function(_0x110491){logger['error'](_0x5278('0x2b'),_0x32c8f3,_0x110491);_0x23aa05(_0x110491);});});}function respondWithStatusCode(_0x5b2d83,_0x3af2ce){_0x3af2ce=_0x3af2ce||0xcc;return function(_0x44806c){if(_0x44806c){return _0x5b2d83[_0x5278('0x2f')](_0x3af2ce);}return _0x5b2d83['status'](_0x3af2ce)[_0x5278('0x30')]();};}function respondWithResult(_0x17092b,_0x242bbd){_0x242bbd=_0x242bbd||0xc8;return function(_0x38673b){if(_0x38673b){return _0x17092b[_0x5278('0x31')](_0x242bbd)[_0x5278('0x32')](_0x38673b);}};}function respondWithFilteredResult(_0x31bd0e,_0x3119b3){return function(_0x5f4fa2){if(_0x5f4fa2){var _0x580a9e=typeof _0x3119b3['offset']===_0x5278('0x33')&&typeof _0x3119b3['limit']==='undefined';var _0x11f109=_0x5f4fa2[_0x5278('0x34')];var _0x4df62a=_0x580a9e?0x0:_0x3119b3[_0x5278('0x35')];var _0x1bb83b=_0x580a9e?_0x5f4fa2[_0x5278('0x34')]:_0x3119b3[_0x5278('0x35')]+_0x3119b3[_0x5278('0x36')];var _0x11073b;if(_0x1bb83b>=_0x11f109){_0x1bb83b=_0x11f109;_0x11073b=0xc8;}else{_0x11073b=0xce;}_0x31bd0e[_0x5278('0x31')](_0x11073b);return _0x31bd0e[_0x5278('0x37')](_0x5278('0x38'),_0x4df62a+'-'+_0x1bb83b+'/'+_0x11f109)[_0x5278('0x32')](_0x5f4fa2);}return null;};}function patchUpdates(_0x12de01){return function(_0x4e65a8){try{jsonpatch['apply'](_0x4e65a8,_0x12de01,!![]);}catch(_0x585a4a){return BPromise[_0x5278('0x39')](_0x585a4a);}return _0x4e65a8[_0x5278('0x3a')]();};}function saveUpdates(_0x6bb4e7,_0x1d2a3a){return function(_0x550e19){if(_0x550e19){return _0x550e19[_0x5278('0x3b')](_0x6bb4e7)['then'](function(_0x1c2ea9){return _0x1c2ea9;});}return null;};}function removeEntity(_0x6dad5b,_0xc8187b){return function(_0x4097f2){if(_0x4097f2){return _0x4097f2[_0x5278('0x3c')]()[_0x5278('0x3d')](function(){var _0x14be4a=_0x4097f2[_0x5278('0x3e')]({'plain':!![]});var _0xd00e32=_0x5278('0x3f');return db[_0x5278('0x40')][_0x5278('0x3c')]({'where':{'type':_0xd00e32,'resourceId':_0x14be4a['id']}})[_0x5278('0x3d')](function(){return _0x4097f2;});})['then'](function(){_0x6dad5b[_0x5278('0x31')](0xcc)[_0x5278('0x30')]();});}};}function handleEntityNotFound(_0x2d61e1,_0x87da4b){return function(_0xaa57d1){if(!_0xaa57d1){_0x2d61e1[_0x5278('0x2f')](0x194);}return _0xaa57d1;};}function handleError(_0x1b69e7,_0x1304d3){_0x1304d3=_0x1304d3||0x1f4;return function(_0x20659e){logger[_0x5278('0x29')](_0x20659e['stack']);if(_0x20659e[_0x5278('0x41')]){delete _0x20659e[_0x5278('0x41')];}_0x1b69e7['status'](_0x1304d3)[_0x5278('0x42')](_0x20659e);};}exports[_0x5278('0x43')]=function(_0x39d388,_0x15138d){var _0x1be384={'include':[{'model':db[_0x5278('0x44')],'as':_0x5278('0x45')},{'model':db[_0x5278('0x46')],'as':_0x5278('0x47')},{'model':db[_0x5278('0x48')],'as':_0x5278('0x49')}]},_0x3a4c0a={},_0x3e0843={'count':0x0,'rows':[]};var _0x3becde=_['map'](db[_0x5278('0x4a')][_0x5278('0x4b')],function(_0x563067){return{'name':_0x563067[_0x5278('0x4c')],'type':_0x563067[_0x5278('0x4d')][_0x5278('0x4e')]};});_0x3a4c0a[_0x5278('0x4f')]=_['map'](_0x3becde,_0x5278('0x41'));_0x3a4c0a['query']=_['keys'](_0x39d388['query']);_0x3a4c0a[_0x5278('0x50')]=_[_0x5278('0x51')](_0x3a4c0a['model'],_0x3a4c0a['query']);_0x1be384['attributes']=_[_0x5278('0x51')](_0x3a4c0a[_0x5278('0x4f')],qs[_0x5278('0x52')](_0x39d388[_0x5278('0x53')]['fields']));_0x1be384[_0x5278('0x54')]=_0x1be384[_0x5278('0x54')][_0x5278('0x55')]?_0x1be384[_0x5278('0x54')]:_0x3a4c0a['model'];if(!_0x39d388['query'][_0x5278('0x56')](_0x5278('0x57'))){_0x1be384[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x39d388[_0x5278('0x53')][_0x5278('0x36')]);_0x1be384[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x39d388['query'][_0x5278('0x35')]);}_0x1be384['order']=qs[_0x5278('0x58')](_0x39d388[_0x5278('0x53')]['sort']);_0x1be384[_0x5278('0x59')]=qs[_0x5278('0x50')](_['pick'](_0x39d388[_0x5278('0x53')],_0x3a4c0a[_0x5278('0x50')]),_0x3becde);if(_0x39d388['query'][_0x5278('0x5a')]){_0x1be384[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x1be384['where'],{'$or':_[_0x5278('0x5c')](_0x3becde,function(_0x2c2995){if(_0x2c2995[_0x5278('0x4d')]!==_0x5278('0x5d')){var _0x1e933f={};_0x1e933f[_0x2c2995[_0x5278('0x41')]]={'$like':'%'+_0x39d388[_0x5278('0x53')][_0x5278('0x5a')]+'%'};return _0x1e933f;}})});}_0x1be384=_['merge']({},_0x1be384,_0x39d388[_0x5278('0x5e')]);var _0x19d0ba={'where':_0x1be384[_0x5278('0x59')]};return db[_0x5278('0x4a')][_0x5278('0x34')](_0x19d0ba)[_0x5278('0x3d')](function(_0x330ca0){_0x3e0843[_0x5278('0x34')]=_0x330ca0;if(_0x39d388['query'][_0x5278('0x5f')]){_0x1be384[_0x5278('0x60')]=[{'all':!![]}];}return db[_0x5278('0x4a')]['findAll'](_0x1be384);})[_0x5278('0x3d')](function(_0x1247b9){_0x3e0843[_0x5278('0x61')]=_0x1247b9;return _0x3e0843;})[_0x5278('0x3d')](respondWithFilteredResult(_0x15138d,_0x1be384))['catch'](handleError(_0x15138d,null));};exports['show']=function(_0x40d525,_0x3b494d){var _0x113090={'raw':![],'where':{'id':_0x40d525[_0x5278('0x62')]['id']},'include':[{'model':db[_0x5278('0x44')],'as':'Imap'},{'model':db[_0x5278('0x46')],'as':_0x5278('0x47')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x32225c={};_0x32225c['model']=_[_0x5278('0x63')](db[_0x5278('0x4a')][_0x5278('0x4b')]);_0x32225c[_0x5278('0x53')]=_[_0x5278('0x63')](_0x40d525[_0x5278('0x53')]);_0x32225c['filters']=_[_0x5278('0x51')](_0x32225c[_0x5278('0x4f')],_0x32225c[_0x5278('0x53')]);_0x113090[_0x5278('0x54')]=_['intersection'](_0x32225c[_0x5278('0x4f')],qs[_0x5278('0x52')](_0x40d525[_0x5278('0x53')][_0x5278('0x52')]));_0x113090[_0x5278('0x54')]=_0x113090[_0x5278('0x54')][_0x5278('0x55')]?_0x113090[_0x5278('0x54')]:_0x32225c[_0x5278('0x4f')];if(_0x40d525[_0x5278('0x53')][_0x5278('0x5f')]){_0x113090[_0x5278('0x60')]=[{'all':!![]}];}_0x113090=_['merge']({},_0x113090,_0x40d525['options']);return db['MailAccount'][_0x5278('0x64')](_0x113090)[_0x5278('0x3d')](handleEntityNotFound(_0x3b494d,null))[_0x5278('0x3d')](respondWithResult(_0x3b494d,null))[_0x5278('0x65')](handleError(_0x3b494d,null));};exports[_0x5278('0x3b')]=function(_0x166f37,_0x54e5fe){if(_0x166f37['body']['id']){delete _0x166f37[_0x5278('0x66')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x166f37[_0x5278('0x62')]['id']},'include':[{'model':db[_0x5278('0x44')],'as':_0x5278('0x45')},{'model':db[_0x5278('0x46')],'as':_0x5278('0x47')},{'model':db[_0x5278('0x48')],'as':_0x5278('0x49')}]})[_0x5278('0x3d')](handleEntityNotFound(_0x54e5fe,null))[_0x5278('0x3d')](saveUpdates(_0x166f37[_0x5278('0x66')],null))[_0x5278('0x3d')](function(_0x8eb03f){if(_0x8eb03f&&_0x166f37['body']['Imap']){return db[_0x5278('0x44')]['update'](_0x166f37[_0x5278('0x66')][_0x5278('0x45')],{'where':{'MailAccountId':_0x8eb03f['id']}})[_0x5278('0x3d')](function(){return _0x8eb03f;});}return _0x8eb03f;})[_0x5278('0x3d')](function(_0x4284ea){if(_0x4284ea&&_0x166f37['body'][_0x5278('0x47')]){return db['MailServerOut'][_0x5278('0x3b')](_0x166f37[_0x5278('0x66')][_0x5278('0x47')],{'where':{'MailAccountId':_0x4284ea['id']}})[_0x5278('0x3d')](function(){return _0x4284ea;});}return _0x4284ea;})[_0x5278('0x3d')](respondWithResult(_0x54e5fe,null))['catch'](handleError(_0x54e5fe,null));};exports[_0x5278('0x67')]=function(_0x3ce343,_0x341dcc){return db[_0x5278('0x4a')][_0x5278('0x67')]()[_0x5278('0x3d')](respondWithResult(_0x341dcc,null))[_0x5278('0x65')](handleError(_0x341dcc,null));};exports['addDisposition']=function(_0x35a254,_0x15f1f1,_0x1ae0e2){if(_0x35a254['body']['id']){delete _0x35a254[_0x5278('0x66')]['id'];}return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x35a254[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x15f1f1,null))[_0x5278('0x3d')](function(_0x1ff657){if(_0x1ff657){_0x35a254[_0x5278('0x66')][_0x5278('0x68')]=_0x1ff657['id'];return db[_0x5278('0x69')][_0x5278('0x6a')](_0x35a254[_0x5278('0x66')]);}})[_0x5278('0x3d')](respondWithResult(_0x15f1f1,null))['catch'](handleError(_0x15f1f1,null));};exports[_0x5278('0x6b')]=function(_0x5bfbce,_0x4460d8,_0x395931){var _0x2dee06={'raw':![],'where':{}};var _0x210cbb={};var _0x216b9e={'count':0x0,'rows':[]};return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x5bfbce[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x4460d8,null))['then'](function(_0x290ea5){if(_0x290ea5){_0x210cbb[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x69')][_0x5278('0x4b')]);_0x210cbb['query']=_[_0x5278('0x63')](_0x5bfbce[_0x5278('0x53')]);_0x210cbb[_0x5278('0x50')]=_[_0x5278('0x51')](_0x210cbb[_0x5278('0x4f')],_0x210cbb['query']);_0x2dee06[_0x5278('0x54')]=_[_0x5278('0x51')](_0x210cbb[_0x5278('0x4f')],qs['fields'](_0x5bfbce[_0x5278('0x53')]['fields']));_0x2dee06['attributes']=_0x2dee06[_0x5278('0x54')][_0x5278('0x55')]?_0x2dee06[_0x5278('0x54')]:_0x210cbb[_0x5278('0x4f')];if(!_0x5bfbce['query'][_0x5278('0x56')](_0x5278('0x57'))){_0x2dee06[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x5bfbce['query'][_0x5278('0x36')]);_0x2dee06[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x5bfbce[_0x5278('0x53')]['offset']);}_0x2dee06[_0x5278('0x6d')]=qs['sort'](_0x5bfbce[_0x5278('0x53')][_0x5278('0x58')]);_0x2dee06['where']=qs[_0x5278('0x50')](_[_0x5278('0x6e')](_0x5bfbce['query'],_0x210cbb['filters']));_0x2dee06[_0x5278('0x59')]['MailAccountId']=_0x290ea5['id'];if(_0x5bfbce[_0x5278('0x53')][_0x5278('0x5a')]){_0x2dee06[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x2dee06[_0x5278('0x59')],{'$or':_[_0x5278('0x5c')](_0x2dee06[_0x5278('0x54')],function(_0x4768b3){var _0x31775d={};_0x31775d[_0x4768b3]={'$like':'%'+_0x5bfbce['query'][_0x5278('0x5a')]+'%'};return _0x31775d;})});}_0x2dee06=_[_0x5278('0x5b')]({},_0x2dee06,_0x5bfbce['options']);return db[_0x5278('0x69')][_0x5278('0x34')]({'where':_0x2dee06[_0x5278('0x59')]})[_0x5278('0x3d')](function(_0x495566){_0x216b9e[_0x5278('0x34')]=_0x495566;if(_0x5bfbce['query'][_0x5278('0x5f')]){_0x2dee06[_0x5278('0x60')]=[{'all':!![]}];}return db[_0x5278('0x69')][_0x5278('0x6f')](_0x2dee06);})[_0x5278('0x3d')](function(_0x325c06){_0x216b9e[_0x5278('0x61')]=_0x325c06;return _0x216b9e;});}})['then'](respondWithFilteredResult(_0x4460d8,_0x2dee06))[_0x5278('0x65')](handleError(_0x4460d8,null));};exports['removeDispositions']=function(_0x2491b5,_0x4310a2,_0x34159c){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x2491b5[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x4310a2,null))['then'](function(_0x5dc829){if(_0x5dc829){return _0x5dc829['removeDispositions'](_0x2491b5[_0x5278('0x53')][_0x5278('0x70')]);}})[_0x5278('0x3d')](respondWithStatusCode(_0x4310a2,null))[_0x5278('0x65')](handleError(_0x4310a2,null));};exports['addAnswer']=function(_0x528309,_0x181799,_0x6a9f28){if(_0x528309[_0x5278('0x66')]['id']){delete _0x528309[_0x5278('0x66')]['id'];}return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x528309['params']['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x181799,null))['then'](function(_0x2f75e5){if(_0x2f75e5){_0x528309['body'][_0x5278('0x68')]=_0x2f75e5['id'];return db[_0x5278('0x71')][_0x5278('0x6a')](_0x528309['body']);}})[_0x5278('0x3d')](respondWithResult(_0x181799,null))[_0x5278('0x65')](handleError(_0x181799,null));};exports[_0x5278('0x72')]=function(_0x1ef343,_0x12d8c7,_0x59c3b2){var _0x5cb027={'raw':![],'where':{}};var _0x1fe7b7={};var _0x3419d8={'count':0x0,'rows':[]};return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x1ef343['params']['id']}})['then'](handleEntityNotFound(_0x12d8c7,null))['then'](function(_0x599e11){if(_0x599e11){_0x1fe7b7[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x71')]['rawAttributes']);_0x1fe7b7['query']=_['keys'](_0x1ef343['query']);_0x1fe7b7[_0x5278('0x50')]=_[_0x5278('0x51')](_0x1fe7b7[_0x5278('0x4f')],_0x1fe7b7[_0x5278('0x53')]);_0x5cb027['attributes']=_[_0x5278('0x51')](_0x1fe7b7[_0x5278('0x4f')],qs['fields'](_0x1ef343[_0x5278('0x53')][_0x5278('0x52')]));_0x5cb027[_0x5278('0x54')]=_0x5cb027[_0x5278('0x54')][_0x5278('0x55')]?_0x5cb027[_0x5278('0x54')]:_0x1fe7b7[_0x5278('0x4f')];if(!_0x1ef343[_0x5278('0x53')][_0x5278('0x56')](_0x5278('0x57'))){_0x5cb027['limit']=qs['limit'](_0x1ef343[_0x5278('0x53')][_0x5278('0x36')]);_0x5cb027[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x1ef343['query'][_0x5278('0x35')]);}_0x5cb027[_0x5278('0x6d')]=qs[_0x5278('0x58')](_0x1ef343[_0x5278('0x53')][_0x5278('0x58')]);_0x5cb027[_0x5278('0x59')]=qs[_0x5278('0x50')](_[_0x5278('0x6e')](_0x1ef343['query'],_0x1fe7b7[_0x5278('0x50')]));_0x5cb027[_0x5278('0x59')]['MailAccountId']=_0x599e11['id'];if(_0x1ef343[_0x5278('0x53')][_0x5278('0x5a')]){_0x5cb027['where']=_[_0x5278('0x5b')](_0x5cb027['where'],{'$or':_[_0x5278('0x5c')](_0x5cb027[_0x5278('0x54')],function(_0x5293a5){var _0x1ae7ca={};_0x1ae7ca[_0x5293a5]={'$like':'%'+_0x1ef343[_0x5278('0x53')][_0x5278('0x5a')]+'%'};return _0x1ae7ca;})});}_0x5cb027=_[_0x5278('0x5b')]({},_0x5cb027,_0x1ef343[_0x5278('0x5e')]);return db[_0x5278('0x71')][_0x5278('0x34')]({'where':_0x5cb027[_0x5278('0x59')]})[_0x5278('0x3d')](function(_0x2300ba){_0x3419d8[_0x5278('0x34')]=_0x2300ba;if(_0x1ef343[_0x5278('0x53')][_0x5278('0x5f')]){_0x5cb027[_0x5278('0x60')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5cb027);})[_0x5278('0x3d')](function(_0x35a2a9){_0x3419d8[_0x5278('0x61')]=_0x35a2a9;return _0x3419d8;});}})[_0x5278('0x3d')](respondWithFilteredResult(_0x12d8c7,_0x5cb027))[_0x5278('0x65')](handleError(_0x12d8c7,null));};exports['removeAnswers']=function(_0x541b10,_0x338b29,_0x28308a){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x541b10[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x338b29,null))['then'](function(_0x16130d){if(_0x16130d){return _0x16130d['removeAnswers'](_0x541b10['query'][_0x5278('0x70')]);}})[_0x5278('0x3d')](respondWithStatusCode(_0x338b29,null))[_0x5278('0x65')](handleError(_0x338b29,null));};exports[_0x5278('0x6a')]=function(_0x26b10a,_0x6aafff){var _0x4c0211={'name':_0x26b10a[_0x5278('0x66')][_0x5278('0x41')],'key':_0x26b10a[_0x5278('0x66')][_0x5278('0x4e')],'email':_0x26b10a[_0x5278('0x66')]['email'],'ListId':_0x26b10a[_0x5278('0x66')][_0x5278('0x73')],'active':!_[_0x5278('0x74')](_0x26b10a[_0x5278('0x66')][_0x5278('0x75')])?_0x26b10a[_0x5278('0x66')][_0x5278('0x75')]:!![],'description':_0x26b10a['body'][_0x5278('0x76')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x26b10a[_0x5278('0x66')][_0x5278('0x77')])){if(_0x26b10a['body']['cauthentication']){_0x4c0211[_0x5278('0x45')][_0x5278('0x78')]=_0x4c0211['Smtp'][_0x5278('0x78')]=_0x26b10a[_0x5278('0x66')]['cuser'];_0x4c0211[_0x5278('0x45')]['password']=_0x4c0211[_0x5278('0x47')][_0x5278('0x79')]=_0x26b10a[_0x5278('0x66')]['cpassword'];}else{_0x4c0211['Imap'][_0x5278('0x7a')]=_0x4c0211[_0x5278('0x47')]['authentication']=![];}_0x4c0211['Imap'][_0x5278('0x7b')]=_0x26b10a[_0x5278('0x66')]['Imap'][_0x5278('0x7b')];_0x4c0211['Imap'][_0x5278('0x7c')]=_0x26b10a[_0x5278('0x66')][_0x5278('0x45')]['port'];_0x4c0211[_0x5278('0x47')]['host']=_0x26b10a[_0x5278('0x66')][_0x5278('0x47')][_0x5278('0x7b')];_0x4c0211[_0x5278('0x47')][_0x5278('0x7c')]=_0x26b10a[_0x5278('0x66')][_0x5278('0x47')]['port'];}else{_0x4c0211[_0x5278('0x45')][_0x5278('0x7d')]=_0x4c0211[_0x5278('0x47')][_0x5278('0x7d')]=_0x26b10a[_0x5278('0x66')][_0x5278('0x77')];_0x4c0211['Imap']['user']=_0x4c0211['Smtp'][_0x5278('0x78')]=_0x26b10a[_0x5278('0x66')]['cuser'];_0x4c0211[_0x5278('0x45')][_0x5278('0x7e')]=_0x4c0211['Smtp'][_0x5278('0x79')]=_0x26b10a['body'][_0x5278('0x7f')];}return db[_0x5278('0x4a')][_0x5278('0x6a')](_0x4c0211,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x5278('0x44')],'as':_0x5278('0x45')}]})[_0x5278('0x3d')](function(_0x1eda45){var _0x18b21d=_0x26b10a['user'][_0x5278('0x3e')]({'plain':!![]});if(!_0x18b21d)throw new Error(_0x5278('0x80'));if(_0x18b21d[_0x5278('0x81')]===_0x5278('0x78')){var _0x19b2c6=_0x1eda45['get']({'plain':!![]});return db[_0x5278('0x82')][_0x5278('0x64')]({'where':{'name':_0x5278('0x3f'),'userProfileId':_0x18b21d[_0x5278('0x83')]},'raw':!![]})['then'](function(_0x338c17){if(_0x338c17&&_0x338c17[_0x5278('0x84')]===0x0){return db[_0x5278('0x40')]['create']({'name':_0x19b2c6[_0x5278('0x41')],'resourceId':_0x19b2c6['id'],'type':_0x338c17[_0x5278('0x41')],'sectionId':_0x338c17['id']},{})[_0x5278('0x3d')](function(){return _0x1eda45;});}else{return _0x1eda45;}})[_0x5278('0x65')](function(_0x11859b){logger[_0x5278('0x29')](_0x5278('0x85'),_0x11859b);throw _0x11859b;});}return _0x1eda45;})['then'](respondWithResult(_0x6aafff,0xc9))['catch'](handleError(_0x6aafff,null));};exports['getImap']=function(_0x557e4c,_0x3c03a4,_0x34fd0b){return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x557e4c[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x3c03a4,null))[_0x5278('0x3d')](function(_0x3d68c4){if(_0x3d68c4){return _0x3d68c4[_0x5278('0x86')]();}return null;})[_0x5278('0x3d')](respondWithResult(_0x3c03a4,null))[_0x5278('0x65')](handleError(_0x3c03a4,null));};exports['addImap']=function(_0x39053e,_0x3e890e,_0xf04bf4){if(_0x39053e['body']['id']){delete _0x39053e[_0x5278('0x66')]['id'];}return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x39053e[_0x5278('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e890e,null))[_0x5278('0x3d')](function(_0x45553f){if(_0x45553f){_0x39053e[_0x5278('0x66')]['MailAccountId']=_0x45553f['id'];return db[_0x5278('0x44')][_0x5278('0x6a')](_0x39053e[_0x5278('0x66')]);}})[_0x5278('0x3d')](respondWithResult(_0x3e890e,null))[_0x5278('0x65')](handleError(_0x3e890e,null));};exports[_0x5278('0x87')]=function(_0x2e22b3,_0x35b07f,_0x9a7d7c){return db['MailAccount'][_0x5278('0x6c')]({'where':{'id':_0x2e22b3[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x35b07f,null))[_0x5278('0x3d')](function(_0x389072){if(_0x389072){return _0x389072[_0x5278('0x88')](null);}return null;})[_0x5278('0x3d')](respondWithStatusCode(_0x35b07f,null))['catch'](handleError(_0x35b07f,null));};exports[_0x5278('0x89')]=function(_0x4d8f19,_0x21fcc2,_0x2571f3){return db[_0x5278('0x4a')]['findOne']({'where':{'id':_0x4d8f19['params']['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x21fcc2,null))[_0x5278('0x3d')](function(_0x15acd6){if(_0x15acd6){return _0x15acd6['getSmtp']();}return null;})[_0x5278('0x3d')](respondWithResult(_0x21fcc2,null))[_0x5278('0x65')](handleError(_0x21fcc2,null));};exports[_0x5278('0x8a')]=function(_0x349ce8,_0x53cbe4,_0x3e2336){if(_0x349ce8[_0x5278('0x66')]['id']){delete _0x349ce8[_0x5278('0x66')]['id'];}return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x349ce8[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x53cbe4,null))[_0x5278('0x3d')](function(_0x12515a){if(_0x12515a){_0x349ce8['body'][_0x5278('0x68')]=_0x12515a['id'];return db[_0x5278('0x46')]['create'](_0x349ce8[_0x5278('0x66')]);}})[_0x5278('0x3d')](respondWithResult(_0x53cbe4,null))[_0x5278('0x65')](handleError(_0x53cbe4,null));};exports[_0x5278('0x8b')]=function(_0xe3e790,_0x11ba96,_0x5bac90){return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0xe3e790['params']['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x11ba96,null))['then'](function(_0x1ae375){if(_0x1ae375){return _0x1ae375[_0x5278('0x8c')](null);}return null;})[_0x5278('0x3d')](respondWithStatusCode(_0x11ba96,null))[_0x5278('0x65')](handleError(_0x11ba96,null));};exports[_0x5278('0x8d')]=function(_0x40b08a,_0x2158e6,_0x49cc2b){return db[_0x5278('0x8e')]['find']({'where':{'id':_0x40b08a[_0x5278('0x62')]['id']}})['then'](handleEntityNotFound(_0x2158e6,null))[_0x5278('0x3d')](function(_0x173049){if(_0x173049){return _0x173049[_0x5278('0x8d')](_0x40b08a[_0x5278('0x66')][_0x5278('0x70')],_['omit'](_0x40b08a['body'],[_0x5278('0x70'),'id'])||{});}})['then'](respondWithResult(_0x2158e6,null))[_0x5278('0x65')](handleError(_0x2158e6,null));};exports[_0x5278('0x8f')]=function(_0x2c9eb7,_0xeec479,_0xc172c9){var _0x5c24a0={'raw':![],'where':{}};var _0x5090ae={};var _0x3e8a9f={'count':0x0,'rows':[]};return db['MailAccount'][_0x5278('0x6c')]({'where':{'id':_0x2c9eb7[_0x5278('0x62')]['id']}})['then'](handleEntityNotFound(_0xeec479,null))[_0x5278('0x3d')](function(_0x4751e0){if(_0x4751e0){_0x5090ae[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x8e')]['rawAttributes']);_0x5090ae['query']=_[_0x5278('0x63')](_0x2c9eb7[_0x5278('0x53')]);_0x5090ae[_0x5278('0x50')]=_['intersection'](_0x5090ae[_0x5278('0x4f')],_0x5090ae[_0x5278('0x53')]);_0x5c24a0[_0x5278('0x54')]=_[_0x5278('0x51')](_0x5090ae['model'],qs[_0x5278('0x52')](_0x2c9eb7[_0x5278('0x53')][_0x5278('0x52')]));_0x5c24a0[_0x5278('0x54')]=_0x5c24a0[_0x5278('0x54')]['length']?_0x5c24a0[_0x5278('0x54')]:_0x5090ae[_0x5278('0x4f')];if(!_0x2c9eb7[_0x5278('0x53')]['hasOwnProperty'](_0x5278('0x57'))){_0x5c24a0['limit']=qs[_0x5278('0x36')](_0x2c9eb7[_0x5278('0x53')][_0x5278('0x36')]);_0x5c24a0[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x2c9eb7[_0x5278('0x53')]['offset']);}_0x5c24a0[_0x5278('0x6d')]=qs['sort'](_0x2c9eb7[_0x5278('0x53')]['sort']);_0x5c24a0['where']=qs[_0x5278('0x50')](_['pick'](_0x2c9eb7['query'],_0x5090ae[_0x5278('0x50')]));_0x5c24a0[_0x5278('0x59')][_0x5278('0x68')]=_0x4751e0['id'];if(_0x2c9eb7['query'][_0x5278('0x5a')]){_0x5c24a0[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x5c24a0[_0x5278('0x59')],{'$or':_[_0x5278('0x5c')](_0x5c24a0[_0x5278('0x54')],function(_0x120635){var _0x4e7047={};_0x4e7047[_0x120635]={'$like':'%'+_0x2c9eb7['query'][_0x5278('0x5a')]+'%'};return _0x4e7047;})});}_0x5c24a0=_[_0x5278('0x5b')]({},_0x5c24a0,_0x2c9eb7[_0x5278('0x5e')]);return db[_0x5278('0x8e')][_0x5278('0x34')]({'where':_0x5c24a0['where']})[_0x5278('0x3d')](function(_0x2c015b){_0x3e8a9f['count']=_0x2c015b;if(_0x2c9eb7[_0x5278('0x53')]['includeAll']){_0x5c24a0[_0x5278('0x60')]=[{'model':db[_0x5278('0x90')],'as':_0x5278('0x91'),'required':![]},{'model':db[_0x5278('0x92')],'as':_0x5278('0x93'),'attributes':[_0x5278('0x41'),'fullname',_0x5278('0x94')],'required':![]},{'model':db[_0x5278('0x95')],'as':'Tags','attributes':['id',_0x5278('0x41'),'color'],'where':_0x2c9eb7[_0x5278('0x53')]['tag']?{'id':_0x2c9eb7[_0x5278('0x53')][_0x5278('0x96')]}:undefined,'required':_0x2c9eb7[_0x5278('0x53')][_0x5278('0x96')]?!![]:![]}];}return db[_0x5278('0x8e')][_0x5278('0x6f')](_0x5c24a0);})['then'](function(_0x40990a){_0x3e8a9f[_0x5278('0x61')]=_0x40990a;return _0x3e8a9f;});}})[_0x5278('0x3d')](respondWithFilteredResult(_0xeec479,_0x5c24a0))['catch'](handleError(_0xeec479,null));};exports[_0x5278('0x97')]=function addApplications(_0x5f0263,_0x9698d7){var _0x45844a=_0x5f0263[_0x5278('0x62')]['id'];var _0x584f74=_0x5f0263['body'];var _0x5a1210=0xc8;var _0x4a9823=null;return db[_0x5278('0x98')]['transaction']({'isolationLevel':db['sequelize'][_0x5278('0x99')]['ISOLATION_LEVELS'][_0x5278('0x9a')]},function(_0xd8c539){return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x45844a},'transaction':_0xd8c539})[_0x5278('0x3d')](function(_0x1a5e0d){if(_0x1a5e0d){return db[_0x5278('0x9b')][_0x5278('0x3c')]({'where':{'MailAccountId':_0x45844a},'transaction':_0xd8c539})[_0x5278('0x3d')](function(){var _0x20078a=_[_0x5278('0x5c')](_0x584f74,function(_0x20b6d1){_0x20b6d1[_0x5278('0x68')]=_0x45844a;return _0x20b6d1;});return db['MailApplication'][_0x5278('0x9c')](_0x20078a,{'transaction':_0xd8c539});});}else{_0x5a1210=0x194;_0x4a9823=[];}});})[_0x5278('0x3d')](function(){if(_0x5a1210!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x45844a},'order':_0x5278('0x9d')})[_0x5278('0x3d')](function(_0x22518b){_0x4a9823=_0x22518b;});}})[_0x5278('0x65')](function(_0xb8f749){_0x5a1210=0x1f4;logger[_0x5278('0x29')](_0xb8f749['stack']);if(_0xb8f749[_0x5278('0x41')]){delete _0xb8f749[_0x5278('0x41')];}_0x4a9823=_0xb8f749;})['finally'](function(){if(_0x4a9823===null){_0x9698d7[_0x5278('0x2f')](_0x5a1210);}else{if(_0x5a1210===0x1f4){_0x9698d7[_0x5278('0x31')](_0x5a1210)['send'](_0x4a9823);}else{_0x9698d7[_0x5278('0x31')](_0x5a1210)[_0x5278('0x32')](_0x4a9823);}}});};exports[_0x5278('0x9e')]=function(_0x103d25,_0x3e93d2,_0x2b7396){var _0x376ab6={};var _0x8a54f2={};var _0x1566b8;var _0x6ea46e;return db[_0x5278('0x4a')]['findOne']({'where':{'id':_0x103d25[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x3e93d2,null))[_0x5278('0x3d')](function(_0x26ac7b){if(_0x26ac7b){_0x1566b8=_0x26ac7b;_0x8a54f2[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x9b')][_0x5278('0x4b')]);_0x8a54f2[_0x5278('0x53')]=_[_0x5278('0x63')](_0x103d25[_0x5278('0x53')]);_0x8a54f2[_0x5278('0x50')]=_[_0x5278('0x51')](_0x8a54f2['model'],_0x8a54f2[_0x5278('0x53')]);_0x376ab6['attributes']=_['intersection'](_0x8a54f2[_0x5278('0x4f')],qs[_0x5278('0x52')](_0x103d25[_0x5278('0x53')][_0x5278('0x52')]));_0x376ab6[_0x5278('0x54')]=_0x376ab6[_0x5278('0x54')][_0x5278('0x55')]?_0x376ab6[_0x5278('0x54')]:_0x8a54f2['model'];_0x376ab6['order']=qs['sort'](_0x103d25[_0x5278('0x53')][_0x5278('0x58')]);_0x376ab6[_0x5278('0x59')]=qs[_0x5278('0x50')](_[_0x5278('0x6e')](_0x103d25[_0x5278('0x53')],_0x8a54f2[_0x5278('0x50')]));if(_0x103d25['query'][_0x5278('0x5a')]){_0x376ab6[_0x5278('0x59')]=_['merge'](_0x376ab6[_0x5278('0x59')],{'$or':_[_0x5278('0x5c')](_0x376ab6['attributes'],function(_0x1f84f0){var _0x1d1029={};_0x1d1029[_0x1f84f0]={'$like':'%'+_0x103d25['query'][_0x5278('0x5a')]+'%'};return _0x1d1029;})});}_0x376ab6=_[_0x5278('0x5b')]({},_0x376ab6,_0x103d25['options']);return _0x1566b8[_0x5278('0x9e')](_0x376ab6);}})[_0x5278('0x3d')](function(_0x129078){if(_0x129078){_0x6ea46e=_0x129078[_0x5278('0x55')];if(!_0x103d25[_0x5278('0x53')][_0x5278('0x56')](_0x5278('0x57'))){_0x376ab6[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x103d25[_0x5278('0x53')]['limit']);_0x376ab6[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x103d25[_0x5278('0x53')][_0x5278('0x35')]);}return _0x1566b8[_0x5278('0x9e')](_0x376ab6);}})['then'](function(_0x390f0c){if(_0x390f0c){return _0x390f0c?{'count':_0x6ea46e,'rows':_0x390f0c}:null;}})['then'](respondWithResult(_0x3e93d2,null))[_0x5278('0x65')](handleError(_0x3e93d2,null));};exports['getMessages']=function(_0x3e5eee,_0x3450c2,_0x3fce3b){var _0x60a9b0={'raw':!![],'where':{}};var _0x5d08a7={};var _0x251b4f={'count':0x0,'rows':[]};return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x3e5eee[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x3450c2,null))[_0x5278('0x3d')](function(_0x3b18ae){if(_0x3b18ae){_0x5d08a7[_0x5278('0x4f')]=_['keys'](db[_0x5278('0x9f')][_0x5278('0x4b')]);_0x5d08a7[_0x5278('0x53')]=_[_0x5278('0x63')](_0x3e5eee['query']);_0x5d08a7[_0x5278('0x50')]=_[_0x5278('0x51')](_0x5d08a7[_0x5278('0x4f')],_0x5d08a7['query']);_0x60a9b0[_0x5278('0x54')]=_['intersection'](_0x5d08a7[_0x5278('0x4f')],qs[_0x5278('0x52')](_0x3e5eee[_0x5278('0x53')][_0x5278('0x52')]));_0x60a9b0['attributes']=_0x60a9b0['attributes'][_0x5278('0x55')]?_0x60a9b0['attributes']:_0x5d08a7['model'];if(!_0x3e5eee[_0x5278('0x53')]['hasOwnProperty'](_0x5278('0x57'))){_0x60a9b0[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x3e5eee['query'][_0x5278('0x36')]);_0x60a9b0[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x3e5eee[_0x5278('0x53')]['offset']);}_0x60a9b0[_0x5278('0x6d')]=qs['sort'](_0x3e5eee[_0x5278('0x53')][_0x5278('0x58')]);_0x60a9b0['where']=qs[_0x5278('0x50')](_[_0x5278('0x6e')](_0x3e5eee[_0x5278('0x53')],_0x5d08a7[_0x5278('0x50')]));_0x60a9b0[_0x5278('0x59')][_0x5278('0x68')]=_0x3b18ae['id'];if(_0x3e5eee[_0x5278('0x53')][_0x5278('0x5a')]){_0x60a9b0['where']=_[_0x5278('0x5b')](_0x60a9b0['where'],{'$or':_[_0x5278('0x5c')](_0x60a9b0[_0x5278('0x54')],function(_0x5ef586){var _0x12d3f={};_0x12d3f[_0x5ef586]={'$like':'%'+_0x3e5eee[_0x5278('0x53')][_0x5278('0x5a')]+'%'};return _0x12d3f;})});}if(_0x3e5eee[_0x5278('0x53')][_0x5278('0xa0')]){var _0x24c575=_0x3e5eee['query'][_0x5278('0xa0')]['split'](',');var _0x1bd35a={};_0x1bd35a[_0x24c575[0x0]]={'$gte':moment(_0x24c575[0x1])[_0x5278('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x60a9b0[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x60a9b0[_0x5278('0x59')],_0x1bd35a);}_0x60a9b0=_[_0x5278('0x5b')]({},_0x60a9b0,_0x3e5eee['options']);return db[_0x5278('0x9f')][_0x5278('0x34')]({'where':_0x60a9b0[_0x5278('0x59')]})[_0x5278('0x3d')](function(_0x3f975e){_0x251b4f[_0x5278('0x34')]=_0x3f975e;if(_0x3e5eee[_0x5278('0x53')][_0x5278('0x5f')]){_0x60a9b0[_0x5278('0x60')]=[{'all':!![]}];}return db[_0x5278('0x9f')]['findAll'](_0x60a9b0);})[_0x5278('0x3d')](function(_0x4eea7c){if(_0x3e5eee['query'][_0x5278('0xa2')]===_0x5278('0xa3')){for(var _0x399d5=0x0;_0x399d5<_0x4eea7c[_0x5278('0x55')];_0x399d5++){_0x4eea7c[_0x399d5]['body']=juice(_0x4eea7c[_0x399d5][_0x5278('0x66')]);}}_0x251b4f['rows']=_0x4eea7c;return _0x251b4f;});}})['then'](respondWithFilteredResult(_0x3450c2,_0x60a9b0))[_0x5278('0x65')](handleError(_0x3450c2,null));};exports[_0x5278('0x42')]=function(_0x2fb345,_0x121e06,_0x4ce2b3){var _0x53d5d8,_0xa68cbc={},_0x12b2b9;if(_0x2fb345[_0x5278('0x66')]['to']){_0x12b2b9=_0x2fb345['body']['to'][_0x5278('0xa4')](',')[0x0];}return db['MailAccount'][_0x5278('0x64')]({'where':{'id':_0x2fb345[_0x5278('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x5278('0xa5'),'include':[{'model':db[_0x5278('0x90')],'as':_0x5278('0xa6'),'where':{'email':_0x12b2b9},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x5278('0x46')],'as':_0x5278('0x47'),'raw':!![]}]})[_0x5278('0x3d')](handleEntityNotFound(_0x121e06,null))['then'](function(_0x9c401b){if(_0x9c401b){_0x53d5d8=_0x9c401b;if(_0x9c401b[_0x5278('0x47')]){if(_[_0x5278('0x74')](_0x2fb345['body']['from'])){_0x2fb345[_0x5278('0x66')]['from']=util[_0x5278('0xa1')](_0x5278('0xa7'),_0x9c401b[_0x5278('0x41')],_0x9c401b['email']||_0x9c401b[_0x5278('0x47')]['user']);}if(_0x2fb345['body'][_0x5278('0xa8')]&&_0x2fb345[_0x5278('0x66')]['attachments'][_0x5278('0x55')]){for(var _0x357117=0x0;_0x357117<_0x2fb345[_0x5278('0x66')]['attachments'][_0x5278('0x55')];_0x357117+=0x1){_0x2fb345[_0x5278('0x66')][_0x5278('0xa8')][_0x357117]={'filename':_0x2fb345[_0x5278('0x66')][_0x5278('0xa8')][_0x357117][_0x5278('0x41')],'path':path['join'](config[_0x5278('0xa9')],_0x5278('0xaa'),_0x2fb345['body'][_0x5278('0xa8')][_0x357117][_0x5278('0xab')])};}}var _0x213782={'tls':{'rejectUnauthorized':![]}};if(_[_0x5278('0x74')](_0x9c401b['Smtp']['service'])){if(_0x9c401b[_0x5278('0x47')][_0x5278('0x7a')]){_0x213782['auth']={'user':_0x9c401b[_0x5278('0x47')][_0x5278('0x78')],'pass':_0x9c401b['Smtp']['pass']};}_0x213782[_0x5278('0x7b')]=_0x9c401b['Smtp'][_0x5278('0x7b')];_0x213782[_0x5278('0x7c')]=_0x9c401b[_0x5278('0x47')]['port'];_0x213782[_0x5278('0xac')]=_0x9c401b['Smtp'][_0x5278('0xac')];}else{_0x213782[_0x5278('0x7d')]=_0x9c401b[_0x5278('0x47')][_0x5278('0x7d')];_0x213782[_0x5278('0xad')]={'user':_0x9c401b[_0x5278('0x47')][_0x5278('0x78')],'pass':_0x9c401b['Smtp']['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x213782,'message':_0x2fb345['body']});}else{throw new Error(_0x5278('0xae'));}}})[_0x5278('0x3d')](function(_0x2e3e16){if(_0x2e3e16){_0xa68cbc=_0x2e3e16;if(_0x53d5d8['List']){if(_0x53d5d8[_0x5278('0xa5')][_0x5278('0xa6')][_0x5278('0x55')]){return _0x53d5d8[_0x5278('0xa5')][_0x5278('0xa6')][0x0];}else{return db[_0x5278('0x90')][_0x5278('0x6a')](_[_0x5278('0x1d')](_0x2fb345[_0x5278('0x66')],{'firstName':_0x2fb345[_0x5278('0x66')]['to'],'email':_0x2fb345[_0x5278('0x66')]['to'],'phone':_0x2fb345[_0x5278('0x66')]['to'],'ListId':_0x53d5d8[_0x5278('0x73')]}));}}else{throw new Error(_0x5278('0xae'));}}})[_0x5278('0x3d')](function(_0x2a69dd){if(_0x2a69dd){var _0x4cf982={'UserId':_0x2fb345['user']['id'],'ContactId':_0x2a69dd['id'],'MailAccountId':_0x53d5d8['id'],'inReplyTo':_0xa68cbc[_0x5278('0xaf')],'to':_0x2fb345[_0x5278('0x66')][_0x5278('0xb0')],'cc':_0x2fb345[_0x5278('0x66')]['cc'],'subject':_0x2fb345[_0x5278('0x66')][_0x5278('0xb1')],'attach':_0x2fb345[_0x5278('0x66')][_0x5278('0xb2')],'firstMsgDirection':_0x5278('0xb3'),'lastMsgAt':moment()[_0x5278('0xa1')](_0x5278('0xb4')),'lastMsgDirection':'out','Messages':[_[_0x5278('0x5b')](_0x2fb345[_0x5278('0x66')],{'messageId':_0xa68cbc[_0x5278('0xaf')],'sentAt':moment()[_0x5278('0xa1')](_0x5278('0xb4')),'read':!![],'MailAccountId':_0x53d5d8['id'],'UserId':_0x2fb345[_0x5278('0x78')]['id'],'ContactId':_0x2a69dd['id']})]};if(_0x2fb345[_0x5278('0x66')]['Interaction']){_0x4cf982=_[_0x5278('0x5b')](_0x4cf982,_0x2fb345[_0x5278('0x66')][_0x5278('0xb5')]);}return db['MailInteraction']['create'](_0x4cf982,{'include':[{'model':db[_0x5278('0x9f')],'as':'Messages'}]});}})[_0x5278('0x3d')](respondWithResult(_0x121e06,null))['catch'](handleError(_0x121e06,null));};exports[_0x5278('0xb6')]=function(_0x20fa10,_0x198d78,_0x1ad381){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x20fa10[_0x5278('0x62')]['id']},'include':[{'model':db[_0x5278('0x46')],'as':_0x5278('0x47'),'raw':!![]}]})[_0x5278('0x3d')](handleEntityNotFound(_0x198d78,null))[_0x5278('0x3d')](function(_0x4c5921){if(_0x4c5921&&_0x4c5921[_0x5278('0x47')]){var _0x5ae6bf={'id':_0x4c5921['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4c5921[_0x5278('0x47')][_0x5278('0x7d')]){_0x5ae6bf[_0x5278('0x7d')]=_0x4c5921[_0x5278('0x47')][_0x5278('0x7d')];}else{_0x5ae6bf[_0x5278('0x7b')]=_0x4c5921[_0x5278('0x47')][_0x5278('0x7b')];_0x5ae6bf[_0x5278('0x7c')]=_0x4c5921[_0x5278('0x47')][_0x5278('0x7c')];_0x5ae6bf[_0x5278('0xac')]=_0x4c5921['Smtp'][_0x5278('0xac')];}if(_0x4c5921[_0x5278('0x47')][_0x5278('0x7a')]){_0x5ae6bf[_0x5278('0xad')]={'user':_0x4c5921[_0x5278('0x47')][_0x5278('0x78')],'pass':_0x4c5921[_0x5278('0x47')]['pass']};}return respondWithRpcPromise(_0x5278('0xb7'),_0x5278('0xb6'),{'account':_0x5ae6bf});}})[_0x5278('0x3d')](respondWithResult(_0x198d78,null))[_0x5278('0x65')](handleError(_0x198d78,null));};exports[_0x5278('0x3c')]=function(_0x2e327e,_0x2f2e64){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x2e327e[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x2f2e64,null))[_0x5278('0x3d')](function(_0x1317df){if(_0x1317df&&_0x1317df[_0x5278('0x7d')]){throw new db['Sequelize'][(_0x5278('0xb8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1317df;})[_0x5278('0x3d')](removeEntity(_0x2f2e64,null))[_0x5278('0x65')](handleError(_0x2f2e64,null));};exports['addAgents']=function(_0x4b7871,_0x2de888,_0x548d1e){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x4b7871[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x2de888,null))[_0x5278('0x3d')](function(_0x3b0bd3){if(_0x3b0bd3){return _0x3b0bd3[_0x5278('0xb9')](_0x4b7871[_0x5278('0x66')][_0x5278('0x70')],_[_0x5278('0xba')](_0x4b7871['body'],[_0x5278('0x70'),'id'])||{})[_0x5278('0xbb')](function(_0x4f1004){for(var _0x17b04a=0x0;_0x17b04a<_0x4b7871[_0x5278('0x66')]['ids'][_0x5278('0x55')];_0x17b04a+=0x1){socket[_0x5278('0xbc')](_0x5278('0xbd'),{'UserId':Number(_0x4b7871[_0x5278('0x66')]['ids'][_0x17b04a]),'MailAccountId':Number(_0x4b7871['params']['id'])});}return _0x4f1004;});}})[_0x5278('0x3d')](respondWithResult(_0x2de888,null))[_0x5278('0x65')](handleError(_0x2de888,null));};exports[_0x5278('0xbe')]=function(_0xff40c9,_0x4b7fb6,_0x30516c){return db[_0x5278('0x4a')]['find']({'where':{'id':_0xff40c9[_0x5278('0x62')]['id']}})['then'](handleEntityNotFound(_0x4b7fb6,null))[_0x5278('0x3d')](function(_0x160dc0){if(_0x160dc0){return _0x160dc0['removeAgents'](_0xff40c9[_0x5278('0x53')][_0x5278('0x70')])[_0x5278('0x3d')](function(){if(_[_0x5278('0xbf')](_0xff40c9[_0x5278('0x53')]['ids'])){for(var _0x242c82=0x0;_0x242c82<_0xff40c9[_0x5278('0x53')]['ids'][_0x5278('0x55')];_0x242c82+=0x1){socket[_0x5278('0xbc')](_0x5278('0xc0'),{'UserId':Number(_0xff40c9['query']['ids'][_0x242c82]),'MailAccountId':Number(_0xff40c9['params']['id'])});}}else{socket[_0x5278('0xbc')](_0x5278('0xc0'),{'UserId':Number(_0xff40c9[_0x5278('0x53')][_0x5278('0x70')]),'MailAccountId':Number(_0xff40c9[_0x5278('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x4b7fb6,null))[_0x5278('0x65')](handleError(_0x4b7fb6,null));};exports[_0x5278('0xc1')]=function(_0x1611d8,_0x32804c,_0x5571ec){var _0x43a129={};var _0x1afcb9={};var _0x14a2b9;var _0x524dc4;return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x1611d8['params']['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x32804c,null))[_0x5278('0x3d')](function(_0xec8e06){if(_0xec8e06){_0x14a2b9=_0xec8e06;_0x1afcb9[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x92')][_0x5278('0x4b')]);_0x1afcb9[_0x5278('0x53')]=_[_0x5278('0x63')](_0x1611d8[_0x5278('0x53')]);_0x1afcb9[_0x5278('0x50')]=_[_0x5278('0x51')](_0x1afcb9[_0x5278('0x4f')],_0x1afcb9['query']);_0x43a129[_0x5278('0x54')]=_[_0x5278('0x51')](_0x1afcb9['model'],qs[_0x5278('0x52')](_0x1611d8[_0x5278('0x53')][_0x5278('0x52')]));_0x43a129['attributes']=_0x43a129[_0x5278('0x54')]['length']?_0x43a129[_0x5278('0x54')]:_0x1afcb9[_0x5278('0x4f')];_0x43a129[_0x5278('0x6d')]=qs[_0x5278('0x58')](_0x1611d8[_0x5278('0x53')][_0x5278('0x58')]);_0x43a129[_0x5278('0x59')]=qs['filters'](_[_0x5278('0x6e')](_0x1611d8['query'],_0x1afcb9[_0x5278('0x50')]));if(_0x1611d8['query'][_0x5278('0x5a')]){_0x43a129[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x43a129[_0x5278('0x59')],{'$or':_[_0x5278('0x5c')](_0x43a129[_0x5278('0x54')],function(_0x5e5071){var _0x27e5ff={};_0x27e5ff[_0x5e5071]={'$like':'%'+_0x1611d8[_0x5278('0x53')][_0x5278('0x5a')]+'%'};return _0x27e5ff;})});}_0x43a129=_[_0x5278('0x5b')]({},_0x43a129,_0x1611d8[_0x5278('0x5e')]);return _0x14a2b9[_0x5278('0xc1')](_0x43a129);}})['then'](function(_0x58bfae){if(_0x58bfae){_0x524dc4=_0x58bfae['length'];if(!_0x1611d8[_0x5278('0x53')][_0x5278('0x56')](_0x5278('0x57'))){_0x43a129[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x1611d8[_0x5278('0x53')]['limit']);_0x43a129[_0x5278('0x35')]=qs['offset'](_0x1611d8[_0x5278('0x53')][_0x5278('0x35')]);}return _0x14a2b9[_0x5278('0xc1')](_0x43a129);}})[_0x5278('0x3d')](function(_0x4aef88){if(_0x4aef88){return _0x4aef88?{'count':_0x524dc4,'rows':_0x4aef88}:null;}})[_0x5278('0x3d')](respondWithResult(_0x32804c,null))[_0x5278('0x65')](handleError(_0x32804c,null));};
\ No newline at end of file
index 1811ca0..1e81308 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa848=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','save','update','remove','emit'];(function(_0x23aacc,_0x4ed8a8){var _0x1d4afa=function(_0x21fb9a){while(--_0x21fb9a){_0x23aacc['push'](_0x23aacc['shift']());}};_0x1d4afa(++_0x4ed8a8);}(_0xa848,0x99));var _0x8a84=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa848[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x8a84('0x0'));var MailAccount=require(_0x8a84('0x1'))['db'][_0x8a84('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8a84('0x3'),'afterUpdate':_0x8a84('0x4'),'afterDestroy':_0x8a84('0x5')};function emitEvent(_0x1864ea){return function(_0x2a1376,_0x2315b7,_0x1a7e0f){MailAccountEvents[_0x8a84('0x6')](_0x1864ea+':'+_0x2a1376['id'],_0x2a1376);MailAccountEvents[_0x8a84('0x6')](_0x1864ea,_0x2a1376);_0x1a7e0f(null);};}for(var e in events){if(events[_0x8a84('0x7')](e)){var event=events[e];MailAccount[_0x8a84('0x8')](e,emitEvent(event));}}module[_0x8a84('0x9')]=MailAccountEvents;
\ No newline at end of file
+var _0xef66=['MailAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1765ad,_0x3670ff){var _0x519d0e=function(_0x220e78){while(--_0x220e78){_0x1765ad['push'](_0x1765ad['shift']());}};_0x519d0e(++_0x3670ff);}(_0xef66,0x1db));var _0x6ef6=function(_0x5d3686,_0x128c5d){_0x5d3686=_0x5d3686-0x0;var _0x421b7b=_0xef66[_0x5d3686];return _0x421b7b;};'use strict';var EventEmitter=require(_0x6ef6('0x0'));var MailAccount=require(_0x6ef6('0x1'))['db'][_0x6ef6('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6ef6('0x3')](0x0);var events={'afterCreate':_0x6ef6('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x447651){return function(_0x2443db,_0x337718,_0x1cc212){MailAccountEvents[_0x6ef6('0x5')](_0x447651+':'+_0x2443db['id'],_0x2443db);MailAccountEvents[_0x6ef6('0x5')](_0x447651,_0x2443db);_0x1cc212(null);};}for(var e in events){if(events[_0x6ef6('0x6')](e)){var event=events[e];MailAccount[_0x6ef6('0x7')](e,emitEvent(event));}}module[_0x6ef6('0x8')]=MailAccountEvents;
\ No newline at end of file
index b78df20..2230f92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10be=['moment','bluebird','request-promise','path','rimraf','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api'];(function(_0x362399,_0x556e3e){var _0x361f89=function(_0x22df1b){while(--_0x22df1b){_0x362399['push'](_0x362399['shift']());}};_0x361f89(++_0x556e3e);}(_0x10be,0x1c5));var _0xe10b=function(_0x662abb,_0x197be9){_0x662abb=_0x662abb-0x0;var _0x5945e7=_0x10be[_0x662abb];return _0x5945e7;};'use strict';var _=require(_0xe10b('0x0'));var util=require('util');var logger=require(_0xe10b('0x1'))(_0xe10b('0x2'));var moment=require(_0xe10b('0x3'));var BPromise=require(_0xe10b('0x4'));var rp=require(_0xe10b('0x5'));var fs=require('fs');var path=require(_0xe10b('0x6'));var rimraf=require(_0xe10b('0x7'));var config=require('../../config/environment');var attributes=require('./mailAccount.attributes');module[_0xe10b('0x8')]=function(_0x44506c,_0x395250){return _0x44506c[_0xe10b('0x9')](_0xe10b('0xa'),attributes,{'tableName':_0xe10b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1e9=['exports','MailAccount','mail_accounts','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x4d9bcd,_0x2e56d2){var _0x508ea2=function(_0x4c3de9){while(--_0x4c3de9){_0x4d9bcd['push'](_0x4d9bcd['shift']());}};_0x508ea2(++_0x2e56d2);}(_0xa1e9,0xc1));var _0x9a1e=function(_0x8f7825,_0xaa0ca0){_0x8f7825=_0x8f7825-0x0;var _0x29a7c9=_0xa1e9[_0x8f7825];return _0x29a7c9;};'use strict';var _=require(_0x9a1e('0x0'));var util=require(_0x9a1e('0x1'));var logger=require(_0x9a1e('0x2'))('api');var moment=require(_0x9a1e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a1e('0x4'));var rimraf=require(_0x9a1e('0x5'));var config=require(_0x9a1e('0x6'));var attributes=require('./mailAccount.attributes');module[_0x9a1e('0x7')]=function(_0x5ecf14,_0x59cf23){return _0x5ecf14['define'](_0x9a1e('0x8'),attributes,{'tableName':_0x9a1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 40dd734..66a067a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x463e=['*,*,*,*','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','MailAccount','findAll','options','where','limit','include','map','model','attributes','GetMailAccount','stringify','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','MailApplication','Applications','Smtp','get','applications','orderBy','asc','autoclose','push','close','length','defaults','from','create','List\x20not\x20found','messageId','generate','subject','attach','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','contact','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x463e,0x135));var _0xe463=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x463e[_0x29b609];return _0x54c952;};'use strict';var _=require('lodash');var util=require(_0xe463('0x0'));var moment=require(_0xe463('0x1'));var BPromise=require(_0xe463('0x2'));var rs=require(_0xe463('0x3'));var fs=require('fs');var Redis=require(_0xe463('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe463('0x5'));var logger=require(_0xe463('0x6'))(_0xe463('0x7'));var config=require(_0xe463('0x8'));var jayson=require(_0xe463('0x9'));var client=jayson['client'][_0xe463('0xa')]({'port':0x232c});config[_0xe463('0xb')]=_['defaults'](config[_0xe463('0xb')],{'host':_0xe463('0xc'),'port':0x18eb});var socket=require(_0xe463('0xd'))(new Redis(config[_0xe463('0xb')]));require('./mailAccount.socket')[_0xe463('0xe')](socket);function respondWithRpcPromise(_0x3b0d6d,_0x106254,_0x4981f8){return new BPromise(function(_0x31388a,_0x5a55d1){return client[_0xe463('0xf')](_0x3b0d6d,_0x4981f8)[_0xe463('0x10')](function(_0x559f0f){logger[_0xe463('0x11')](_0xe463('0x12'),_0x106254,_0xe463('0x13'));logger[_0xe463('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x106254,_0xe463('0x13'),JSON['stringify'](_0x559f0f));if(_0x559f0f[_0xe463('0x15')]){if(_0x559f0f[_0xe463('0x15')][_0xe463('0x16')]===0x1f4){logger[_0xe463('0x15')](_0xe463('0x12'),_0x106254,_0x559f0f['error'][_0xe463('0x17')]);return _0x5a55d1(_0x559f0f[_0xe463('0x15')][_0xe463('0x17')]);}logger[_0xe463('0x15')]('MailAccount,\x20%s,\x20%s',_0x106254,_0x559f0f[_0xe463('0x15')][_0xe463('0x17')]);return _0x31388a(_0x559f0f['error']['message']);}else{logger[_0xe463('0x11')](_0xe463('0x12'),_0x106254,_0xe463('0x13'));_0x31388a(_0x559f0f[_0xe463('0x18')][_0xe463('0x17')]);}})[_0xe463('0x19')](function(_0x11dc9c){logger[_0xe463('0x15')]('MailAccount,\x20%s,\x20%s',_0x106254,_0x11dc9c);_0x5a55d1(_0x11dc9c);});});}exports['GetMailAccount']=function(_0x430036){var _0x4e4909=this;return new Promise(function(_0x401c6f,_0x47fb8c){return db[_0xe463('0x1a')][_0xe463('0x1b')]({'raw':_0x430036[_0xe463('0x1c')]?_0x430036[_0xe463('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x430036['options']?_0x430036['options'][_0xe463('0x1d')]||null:null,'attributes':_0x430036[_0xe463('0x1c')]?_0x430036[_0xe463('0x1c')]['attributes']||null:null,'limit':_0x430036['options']?_0x430036[_0xe463('0x1c')][_0xe463('0x1e')]||null:null,'include':_0x430036[_0xe463('0x1c')]?_0x430036[_0xe463('0x1c')][_0xe463('0x1f')]?_[_0xe463('0x20')](_0x430036['options'][_0xe463('0x1f')],function(_0x4add44){return{'model':db[_0x4add44[_0xe463('0x21')]],'as':_0x4add44['as'],'attributes':_0x4add44[_0xe463('0x22')],'include':_0x4add44[_0xe463('0x1f')]?_['map'](_0x4add44[_0xe463('0x1f')],function(_0x11d049){return{'model':db[_0x11d049[_0xe463('0x21')]],'as':_0x11d049['as'],'attributes':_0x11d049[_0xe463('0x22')],'include':_0x11d049[_0xe463('0x1f')]?_[_0xe463('0x20')](_0x11d049[_0xe463('0x1f')],function(_0x50f325){return{'model':db[_0x50f325[_0xe463('0x21')]],'as':_0x50f325['as'],'attributes':_0x50f325[_0xe463('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe463('0x10')](function(_0x4aa3a3){logger[_0xe463('0x11')](_0xe463('0x23'),_0x430036);logger[_0xe463('0x14')](_0xe463('0x23'),_0x430036,JSON[_0xe463('0x24')](_0x4aa3a3));_0x401c6f(_0x4aa3a3);})[_0xe463('0x19')](function(_0x55db3a){logger['error']('GetMailAccount',_0x55db3a[_0xe463('0x17')],_0x430036);_0x47fb8c(_0x4e4909['error'](0x1f4,_0x55db3a[_0xe463('0x17')]));});});};exports[_0xe463('0x25')]=function(_0x24a920){var _0x334adf=this;return new Promise(function(_0x272afa,_0x22a10a){return db[_0xe463('0x1a')][_0xe463('0x26')]({'raw':_0x24a920[_0xe463('0x1c')]?_0x24a920['options']['raw']===undefined?!![]:![]:!![],'where':_0x24a920[_0xe463('0x1c')]?_0x24a920[_0xe463('0x1c')]['where']||null:null,'attributes':_0x24a920[_0xe463('0x1c')]?_0x24a920[_0xe463('0x1c')][_0xe463('0x22')]||null:null,'include':_0x24a920[_0xe463('0x1c')]?_0x24a920[_0xe463('0x1c')][_0xe463('0x1f')]?_[_0xe463('0x20')](_0x24a920['options'][_0xe463('0x1f')],function(_0x1cc833){return{'model':db[_0x1cc833[_0xe463('0x21')]],'as':_0x1cc833['as'],'attributes':_0x1cc833[_0xe463('0x22')],'include':_0x1cc833['include']?_[_0xe463('0x20')](_0x1cc833['include'],function(_0xd38d21){return{'model':db[_0xd38d21[_0xe463('0x21')]],'as':_0xd38d21['as'],'attributes':_0xd38d21[_0xe463('0x22')],'include':_0xd38d21[_0xe463('0x1f')]?_['map'](_0xd38d21['include'],function(_0xfe34f5){return{'model':db[_0xfe34f5['model']],'as':_0xfe34f5['as'],'attributes':_0xfe34f5[_0xe463('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d99a9){logger[_0xe463('0x11')](_0xe463('0x25'),_0x24a920);logger['debug'](_0xe463('0x25'),_0x24a920,JSON[_0xe463('0x24')](_0x4d99a9));_0x272afa(_0x4d99a9);})[_0xe463('0x19')](function(_0x4f1a9d){logger[_0xe463('0x15')](_0xe463('0x25'),_0x4f1a9d[_0xe463('0x17')],_0x24a920);_0x22a10a(_0x334adf[_0xe463('0x15')](0x1f4,_0x4f1a9d[_0xe463('0x17')]));});});};exports[_0xe463('0x27')]=function(_0x376e3b){var _0x5a7797=this;return new Promise(function(_0xf2a828,_0x225b6d){var _0x1dced0={'body':_0x376e3b[_0xe463('0x28')],'channel':_0xe463('0x29')};var _0x3f547f=_[_0xe463('0x2a')](_['keys'](db[_0xe463('0x2b')][_0xe463('0x2c')]),[_0xe463('0x2d'),_0xe463('0x2e'),'CompanyId',_0xe463('0x2f')]);var _0x505934=![];if(_0x376e3b[_0xe463('0x28')]['id']){delete _0x376e3b[_0xe463('0x28')]['id'];}if(_[_0xe463('0x30')](_0x376e3b['body']['from'])){return _0x225b6d(_0x5a7797['error'](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x376e3b[_0xe463('0x28')][_0xe463('0x28')])||_0x376e3b[_0xe463('0x28')][_0xe463('0x28')]===''){return _0x225b6d(_0x5a7797[_0xe463('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x376e3b[_0xe463('0x28')][_0xe463('0x31')])){return _0x225b6d(_0x5a7797['error'](0x1f4,_0xe463('0x32')+_0x3f547f));}if(!_['includes'](_0x3f547f,_0x376e3b[_0xe463('0x28')][_0xe463('0x31')])){return _0x225b6d(_0x5a7797[_0xe463('0x15')](0x1f4,_0xe463('0x33')+_0x3f547f));}var _0x5563d9={};_0x5563d9[_0x376e3b['body']['mapKey']]=_0x376e3b['body']['from'];return db[_0xe463('0x1a')]['find']({'where':{'id':_0x376e3b[_0xe463('0x34')]['id']},'include':[{'model':db[_0xe463('0x35')],'as':_0xe463('0x36'),'include':[{'model':db[_0xe463('0x2b')],'as':_0xe463('0x37'),'where':_0x5563d9,'limit':0x1,'order':[[_0xe463('0x2e'),'DESC']]}]},{'model':db[_0xe463('0x38')],'as':_0xe463('0x39')},{'model':db['MailServerOut'],'as':_0xe463('0x3a')}]})[_0xe463('0x10')](function(_0x36a11c){if(_0x36a11c&&_0x36a11c[_0xe463('0x36')]){var _0x5264c0=_0x36a11c[_0xe463('0x3b')]({'plain':!![]});_0x1dced0[_0xe463('0x34')]=_['omit'](_0x5264c0,[_0xe463('0x39'),'List']);_0x1dced0[_0xe463('0x3c')]=_0x5264c0[_0xe463('0x39')];_0x1dced0['list']=_0x5264c0[_0xe463('0x36')];_0x1dced0[_0xe463('0x3c')]=_[_0xe463('0x3d')](_0x1dced0[_0xe463('0x3c')],['priority'],[_0xe463('0x3e')]);if(_0x1dced0[_0xe463('0x34')]&&_0x1dced0[_0xe463('0x34')][_0xe463('0x3f')]){_0x1dced0[_0xe463('0x3c')][_0xe463('0x40')]({'id':0x0,'priority':_0x1dced0[_0xe463('0x3c')]['length']+0x1,'app':_0xe463('0x41'),'appdata':_0xe463('0x3f'),'interval':'*,*,*,*'});}if(_0x1dced0['account'][_0xe463('0x39')]){delete _0x1dced0[_0xe463('0x34')][_0xe463('0x39')];}if(_0x1dced0[_0xe463('0x34')][_0xe463('0x36')]){delete _0x1dced0['account']['List'];}if(_0x5264c0[_0xe463('0x36')][_0xe463('0x37')][_0xe463('0x42')]){return _0x5264c0['List'][_0xe463('0x37')][0x0];}var _0x38715d=_[_0xe463('0x43')](_0x376e3b[_0xe463('0x28')],{'firstName':_0x376e3b[_0xe463('0x28')]['from'],'ListId':_0x5264c0[_0xe463('0x2f')]});_0x38715d[_0x376e3b['body'][_0xe463('0x31')]]=_0x376e3b[_0xe463('0x28')][_0xe463('0x44')];return db['CmContact'][_0xe463('0x45')](_0x38715d);}else{throw new Error(_0xe463('0x46'));}})[_0xe463('0x10')](function(_0xae044d){_0x1dced0['contact']=_0xae044d;if(_0xae044d){if(!_0x376e3b[_0xe463('0x28')]['message'][_0xe463('0x47')]){_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['messageId']=rs[_0xe463('0x48')]()+'\x20'+_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x44')];}var _0xfae9ee={'ContactId':_0xae044d['id'],'MailAccountId':_0x376e3b['account']['id'],'inReplyTo':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['messageId'],'to':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['from'],'cc':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['cc'],'subject':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x49')],'attach':_0x376e3b['body'][_0xe463('0x17')][_0xe463('0x4a')],'lastMsgAt':moment()[_0xe463('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xe463('0x4c')][_0xe463('0x26')]({'where':{'closed':![],'MailAccountId':_0x376e3b[_0xe463('0x34')]['id']},'include':[{'model':db[_0xe463('0x4d')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x376e3b['body']['message'][_0xe463('0x4e')]}}]})['then'](function(_0x56735a){if(_0x56735a){return[_0x56735a,![]];}return db[_0xe463('0x4c')][_0xe463('0x45')](_0xfae9ee)[_0xe463('0x10')](function(_0x213378){return[_0x213378,!![]];});});}else{throw new Error(_0xe463('0x4f'));}})[_0xe463('0x50')](function(_0x2b25e4,_0x57f92b){if(_0x2b25e4){_0x505934=_0x57f92b;if(!_0x57f92b){return _0x2b25e4[_0xe463('0x51')]({'inReplyTo':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['messageId'],'to':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x44')],'cc':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['cc'],'subject':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['subject'],'attach':_0x2b25e4[_0xe463('0x4a')]?_0x2b25e4[_0xe463('0x4a')]:_0x376e3b['body'][_0xe463('0x17')][_0xe463('0x4a')],'substatus':null,'substatusAt':moment()[_0xe463('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xe463('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x2b25e4;}}})[_0xe463('0x10')](function(_0xeaebc5){_0x1dced0[_0xe463('0x52')]=_0xeaebc5['get']({'plain':!![]});_0x1dced0['interaction'][_0xe463('0x53')]=_0x505934;return db['MailMessage']['create']({'body':_0x376e3b['body'][_0xe463('0x28')],'MailAccountId':_0x376e3b[_0xe463('0x34')]['id'],'MailInteractionId':_0xeaebc5['id'],'direction':'in','ContactId':_0x1dced0[_0xe463('0x54')]['id'],'messageId':_0x376e3b[_0xe463('0x28')]['message'][_0xe463('0x47')],'from':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x44')],'to':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['to'],'cc':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['cc'],'subject':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x49')],'attach':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['attach'],'Attachments':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x55')],'originTo':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x56')],'originCc':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x57')],'bcc':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')]['bcc'],'ChatWebsiteId':_0x376e3b['body'][_0xe463('0x17')][_0xe463('0x58')]||null,'originChannel':_0x376e3b['body']['message'][_0xe463('0x59')]||_0xe463('0x5a'),'ChatOfflineMessageId':_0x376e3b[_0xe463('0x28')][_0xe463('0x17')][_0xe463('0x5b')]||null},{'include':[{'model':db[_0xe463('0x5c')],'as':_0xe463('0x5d')}]});})[_0xe463('0x10')](function(_0x5233b8){_0x1dced0[_0xe463('0x17')]=_0x5233b8;if(_0x1dced0[_0xe463('0x52')][_0xe463('0x5e')]){return db['User'][_0xe463('0x26')]({'attributes':['id',_0xe463('0x5f')],'where':{'id':_0x1dced0['interaction'][_0xe463('0x5e')]}})[_0xe463('0x10')](function(_0x55b47e){if(_0x55b47e){_0x1dced0[_0xe463('0x3c')][_0xe463('0x60')]({'id':0x0,'priority':0x0,'app':_0xe463('0x61'),'appdata':_0x55b47e['name']+','+(_0x1dced0['account'][_0xe463('0x62')]||0xa),'interval':_0xe463('0x63')});}return respondWithRpcPromise(_0xe463('0x64'),_0xe463('0x65'),_0x1dced0);});}return respondWithRpcPromise('Start',_0xe463('0x65'),_0x1dced0);})[_0xe463('0x10')](function(_0x1ac5e7){_0xf2a828(_0x1ac5e7);})[_0xe463('0x19')](function(_0x573bf5){_0x225b6d(_0x5a7797[_0xe463('0x15')](0x1f4,_0x573bf5[_0xe463('0x17')]));});});};
\ No newline at end of file
+var _0xd6c1=['asc','autoclose','push','length','close','*,*,*,*','create','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','MailMessage','originTo','originCc','originChannel','Attachment','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','model','map','ShowMailAccount','find','raw','NotifyMailAccount','body','mail','CmContact','rawAttributes','updatedAt','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','get','account','applications','priority'];(function(_0x1e2f38,_0x397605){var _0x4e76f3=function(_0xb991b3){while(--_0xb991b3){_0x1e2f38['push'](_0x1e2f38['shift']());}};_0x4e76f3(++_0x397605);}(_0xd6c1,0x1a9));var _0x1d6c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd6c1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1d6c('0x0'));var util=require(_0x1d6c('0x1'));var moment=require(_0x1d6c('0x2'));var BPromise=require(_0x1d6c('0x3'));var rs=require(_0x1d6c('0x4'));var fs=require('fs');var Redis=require(_0x1d6c('0x5'));var db=require(_0x1d6c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d6c('0x7'))(_0x1d6c('0x8'));var config=require(_0x1d6c('0x9'));var jayson=require(_0x1d6c('0xa'));var client=jayson['client'][_0x1d6c('0xb')]({'port':0x232c});config[_0x1d6c('0xc')]=_[_0x1d6c('0xd')](config[_0x1d6c('0xc')],{'host':_0x1d6c('0xe'),'port':0x18eb});var socket=require(_0x1d6c('0xf'))(new Redis(config[_0x1d6c('0xc')]));require('./mailAccount.socket')[_0x1d6c('0x10')](socket);function respondWithRpcPromise(_0x4d22da,_0x1e8eb9,_0x5d8147){return new BPromise(function(_0x28ac2b,_0x17342e){return client[_0x1d6c('0x11')](_0x4d22da,_0x5d8147)[_0x1d6c('0x12')](function(_0xd6cf5d){logger[_0x1d6c('0x13')](_0x1d6c('0x14'),_0x1e8eb9,_0x1d6c('0x15'));logger[_0x1d6c('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x1e8eb9,_0x1d6c('0x15'),JSON[_0x1d6c('0x17')](_0xd6cf5d));if(_0xd6cf5d['error']){if(_0xd6cf5d['error'][_0x1d6c('0x18')]===0x1f4){logger[_0x1d6c('0x19')](_0x1d6c('0x14'),_0x1e8eb9,_0xd6cf5d[_0x1d6c('0x19')][_0x1d6c('0x1a')]);return _0x17342e(_0xd6cf5d[_0x1d6c('0x19')][_0x1d6c('0x1a')]);}logger['error'](_0x1d6c('0x14'),_0x1e8eb9,_0xd6cf5d[_0x1d6c('0x19')]['message']);return _0x28ac2b(_0xd6cf5d[_0x1d6c('0x19')]['message']);}else{logger[_0x1d6c('0x13')]('MailAccount,\x20%s,\x20%s',_0x1e8eb9,_0x1d6c('0x15'));_0x28ac2b(_0xd6cf5d['result']['message']);}})[_0x1d6c('0x1b')](function(_0x485fb8){logger[_0x1d6c('0x19')]('MailAccount,\x20%s,\x20%s',_0x1e8eb9,_0x485fb8);_0x17342e(_0x485fb8);});});}exports[_0x1d6c('0x1c')]=function(_0x50ad0e){var _0x4a1d00=this;return new Promise(function(_0x4df291,_0x339c28){return db[_0x1d6c('0x1d')][_0x1d6c('0x1e')]({'raw':_0x50ad0e[_0x1d6c('0x1f')]?_0x50ad0e[_0x1d6c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x50ad0e['options']?_0x50ad0e[_0x1d6c('0x1f')][_0x1d6c('0x20')]||null:null,'attributes':_0x50ad0e[_0x1d6c('0x1f')]?_0x50ad0e[_0x1d6c('0x1f')][_0x1d6c('0x21')]||null:null,'limit':_0x50ad0e[_0x1d6c('0x1f')]?_0x50ad0e['options'][_0x1d6c('0x22')]||null:null,'include':_0x50ad0e['options']?_0x50ad0e[_0x1d6c('0x1f')][_0x1d6c('0x23')]?_['map'](_0x50ad0e[_0x1d6c('0x1f')][_0x1d6c('0x23')],function(_0x11e9a1){return{'model':db[_0x11e9a1[_0x1d6c('0x24')]],'as':_0x11e9a1['as'],'attributes':_0x11e9a1[_0x1d6c('0x21')],'include':_0x11e9a1[_0x1d6c('0x23')]?_[_0x1d6c('0x25')](_0x11e9a1['include'],function(_0x3cc7b4){return{'model':db[_0x3cc7b4[_0x1d6c('0x24')]],'as':_0x3cc7b4['as'],'attributes':_0x3cc7b4[_0x1d6c('0x21')],'include':_0x3cc7b4[_0x1d6c('0x23')]?_[_0x1d6c('0x25')](_0x3cc7b4[_0x1d6c('0x23')],function(_0xc77527){return{'model':db[_0xc77527['model']],'as':_0xc77527['as'],'attributes':_0xc77527[_0x1d6c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1d6c('0x12')](function(_0x5d91a9){logger[_0x1d6c('0x13')](_0x1d6c('0x1c'),_0x50ad0e);logger[_0x1d6c('0x16')](_0x1d6c('0x1c'),_0x50ad0e,JSON[_0x1d6c('0x17')](_0x5d91a9));_0x4df291(_0x5d91a9);})[_0x1d6c('0x1b')](function(_0x4d4ecd){logger[_0x1d6c('0x19')](_0x1d6c('0x1c'),_0x4d4ecd['message'],_0x50ad0e);_0x339c28(_0x4a1d00[_0x1d6c('0x19')](0x1f4,_0x4d4ecd[_0x1d6c('0x1a')]));});});};exports[_0x1d6c('0x26')]=function(_0x15b81e){var _0x23e2fa=this;return new Promise(function(_0x21c719,_0x1bd3a0){return db['MailAccount'][_0x1d6c('0x27')]({'raw':_0x15b81e[_0x1d6c('0x1f')]?_0x15b81e[_0x1d6c('0x1f')][_0x1d6c('0x28')]===undefined?!![]:![]:!![],'where':_0x15b81e[_0x1d6c('0x1f')]?_0x15b81e[_0x1d6c('0x1f')]['where']||null:null,'attributes':_0x15b81e[_0x1d6c('0x1f')]?_0x15b81e['options']['attributes']||null:null,'include':_0x15b81e[_0x1d6c('0x1f')]?_0x15b81e[_0x1d6c('0x1f')][_0x1d6c('0x23')]?_[_0x1d6c('0x25')](_0x15b81e[_0x1d6c('0x1f')][_0x1d6c('0x23')],function(_0x2a959e){return{'model':db[_0x2a959e[_0x1d6c('0x24')]],'as':_0x2a959e['as'],'attributes':_0x2a959e['attributes'],'include':_0x2a959e['include']?_['map'](_0x2a959e[_0x1d6c('0x23')],function(_0x2ac20e){return{'model':db[_0x2ac20e[_0x1d6c('0x24')]],'as':_0x2ac20e['as'],'attributes':_0x2ac20e['attributes'],'include':_0x2ac20e[_0x1d6c('0x23')]?_['map'](_0x2ac20e['include'],function(_0x3209be){return{'model':db[_0x3209be[_0x1d6c('0x24')]],'as':_0x3209be['as'],'attributes':_0x3209be['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d6c('0x12')](function(_0x5e51d2){logger[_0x1d6c('0x13')](_0x1d6c('0x26'),_0x15b81e);logger[_0x1d6c('0x16')]('ShowMailAccount',_0x15b81e,JSON[_0x1d6c('0x17')](_0x5e51d2));_0x21c719(_0x5e51d2);})['catch'](function(_0x45cd86){logger[_0x1d6c('0x19')](_0x1d6c('0x26'),_0x45cd86[_0x1d6c('0x1a')],_0x15b81e);_0x1bd3a0(_0x23e2fa['error'](0x1f4,_0x45cd86[_0x1d6c('0x1a')]));});});};exports[_0x1d6c('0x29')]=function(_0x4a1f44){var _0x5a0fa9=this;return new Promise(function(_0x39d227,_0x5b530d){var _0x28b723={'body':_0x4a1f44[_0x1d6c('0x2a')],'channel':_0x1d6c('0x2b')};var _0x269fad=_['difference'](_['keys'](db[_0x1d6c('0x2c')][_0x1d6c('0x2d')]),['createdAt',_0x1d6c('0x2e'),'CompanyId',_0x1d6c('0x2f')]);var _0xa65a82=![];if(_0x4a1f44[_0x1d6c('0x2a')]['id']){delete _0x4a1f44[_0x1d6c('0x2a')]['id'];}if(_[_0x1d6c('0x30')](_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x31')])){return _0x5b530d(_0x5a0fa9['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x1d6c('0x30')](_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x2a')])||_0x4a1f44['body'][_0x1d6c('0x2a')]===''){return _0x5b530d(_0x5a0fa9[_0x1d6c('0x19')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1d6c('0x30')](_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x32')])){return _0x5b530d(_0x5a0fa9[_0x1d6c('0x19')](0x1f4,_0x1d6c('0x33')+_0x269fad));}if(!_[_0x1d6c('0x34')](_0x269fad,_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x32')])){return _0x5b530d(_0x5a0fa9[_0x1d6c('0x19')](0x1f4,_0x1d6c('0x35')+_0x269fad));}var _0x34dfd6={};_0x34dfd6[_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x32')]]=_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x31')];return db[_0x1d6c('0x1d')][_0x1d6c('0x27')]({'where':{'id':_0x4a1f44['account']['id']},'include':[{'model':db[_0x1d6c('0x36')],'as':_0x1d6c('0x37'),'include':[{'model':db[_0x1d6c('0x2c')],'as':_0x1d6c('0x38'),'where':_0x34dfd6,'limit':0x1,'order':[[_0x1d6c('0x2e'),_0x1d6c('0x39')]]}]},{'model':db[_0x1d6c('0x3a')],'as':_0x1d6c('0x3b')},{'model':db['MailServerOut'],'as':_0x1d6c('0x3c')}]})[_0x1d6c('0x12')](function(_0x5d5895){if(_0x5d5895&&_0x5d5895[_0x1d6c('0x37')]){var _0x5d87f1=_0x5d5895[_0x1d6c('0x3d')]({'plain':!![]});_0x28b723[_0x1d6c('0x3e')]=_['omit'](_0x5d87f1,[_0x1d6c('0x3b'),_0x1d6c('0x37')]);_0x28b723['applications']=_0x5d87f1[_0x1d6c('0x3b')];_0x28b723['list']=_0x5d87f1[_0x1d6c('0x37')];_0x28b723[_0x1d6c('0x3f')]=_['orderBy'](_0x28b723[_0x1d6c('0x3f')],[_0x1d6c('0x40')],[_0x1d6c('0x41')]);if(_0x28b723[_0x1d6c('0x3e')]&&_0x28b723['account'][_0x1d6c('0x42')]){_0x28b723['applications'][_0x1d6c('0x43')]({'id':0x0,'priority':_0x28b723[_0x1d6c('0x3f')][_0x1d6c('0x44')]+0x1,'app':_0x1d6c('0x45'),'appdata':_0x1d6c('0x42'),'interval':_0x1d6c('0x46')});}if(_0x28b723['account'][_0x1d6c('0x3b')]){delete _0x28b723[_0x1d6c('0x3e')][_0x1d6c('0x3b')];}if(_0x28b723['account'][_0x1d6c('0x37')]){delete _0x28b723['account'][_0x1d6c('0x37')];}if(_0x5d87f1[_0x1d6c('0x37')][_0x1d6c('0x38')]['length']){return _0x5d87f1[_0x1d6c('0x37')][_0x1d6c('0x38')][0x0];}var _0x335ead=_[_0x1d6c('0xd')](_0x4a1f44[_0x1d6c('0x2a')],{'firstName':_0x4a1f44['body']['from'],'ListId':_0x5d87f1[_0x1d6c('0x2f')]});_0x335ead[_0x4a1f44['body'][_0x1d6c('0x32')]]=_0x4a1f44[_0x1d6c('0x2a')]['from'];return db[_0x1d6c('0x2c')][_0x1d6c('0x47')](_0x335ead);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x565480){_0x28b723[_0x1d6c('0x48')]=_0x565480;if(_0x565480){if(!_0x4a1f44['body'][_0x1d6c('0x1a')][_0x1d6c('0x49')]){_0x4a1f44['body']['message']['messageId']=rs[_0x1d6c('0x4a')]()+'\x20'+_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x31')];}var _0x47b1fa={'ContactId':_0x565480['id'],'MailAccountId':_0x4a1f44[_0x1d6c('0x3e')]['id'],'inReplyTo':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['messageId'],'to':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['from'],'cc':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['cc'],'subject':_0x4a1f44[_0x1d6c('0x2a')]['message']['subject'],'attach':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x4b')],'lastMsgAt':moment()[_0x1d6c('0x4c')](_0x1d6c('0x4d')),'lastMsgDirection':'in'};return db[_0x1d6c('0x4e')]['find']({'where':{'closed':![],'MailAccountId':_0x4a1f44['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x1d6c('0x4f'),'attributes':[_0x1d6c('0x49')],'where':{'messageId':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x50')]}}]})[_0x1d6c('0x12')](function(_0x1e3afa){if(_0x1e3afa){return[_0x1e3afa,![]];}return db['MailInteraction']['create'](_0x47b1fa)[_0x1d6c('0x12')](function(_0x2d3ae4){return[_0x2d3ae4,!![]];});});}else{throw new Error(_0x1d6c('0x51'));}})[_0x1d6c('0x52')](function(_0x4ba25f,_0x3a74ba){if(_0x4ba25f){_0xa65a82=_0x3a74ba;if(!_0x3a74ba){return _0x4ba25f[_0x1d6c('0x53')]({'inReplyTo':_0x4a1f44[_0x1d6c('0x2a')]['message']['messageId'],'to':_0x4a1f44[_0x1d6c('0x2a')]['message'][_0x1d6c('0x31')],'cc':_0x4a1f44[_0x1d6c('0x2a')]['message']['cc'],'subject':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x54')],'attach':_0x4ba25f[_0x1d6c('0x4b')]?_0x4ba25f[_0x1d6c('0x4b')]:_0x4a1f44[_0x1d6c('0x2a')]['message'][_0x1d6c('0x4b')],'substatus':null,'substatusAt':moment()[_0x1d6c('0x4c')](_0x1d6c('0x4d')),'lastMsgAt':moment()['format'](_0x1d6c('0x4d')),'lastMsgDirection':'in'});}else{return _0x4ba25f;}}})[_0x1d6c('0x12')](function(_0x32bf4d){_0x28b723[_0x1d6c('0x55')]=_0x32bf4d[_0x1d6c('0x3d')]({'plain':!![]});_0x28b723[_0x1d6c('0x55')]['created']=_0xa65a82;return db[_0x1d6c('0x56')]['create']({'body':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x2a')],'MailAccountId':_0x4a1f44['account']['id'],'MailInteractionId':_0x32bf4d['id'],'direction':'in','ContactId':_0x28b723['contact']['id'],'messageId':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['messageId'],'from':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x31')],'to':_0x4a1f44['body'][_0x1d6c('0x1a')]['to'],'cc':_0x4a1f44['body'][_0x1d6c('0x1a')]['cc'],'subject':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['subject'],'attach':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x4b')],'Attachments':_0x4a1f44[_0x1d6c('0x2a')]['message']['attachments'],'originTo':_0x4a1f44['body'][_0x1d6c('0x1a')][_0x1d6c('0x57')],'originCc':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x58')],'bcc':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['bcc'],'ChatWebsiteId':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x59')]||'Email','ChatOfflineMessageId':_0x4a1f44[_0x1d6c('0x2a')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x1d6c('0x5a')],'as':'Attachments'}]});})[_0x1d6c('0x12')](function(_0x566cca){_0x28b723[_0x1d6c('0x1a')]=_0x566cca;if(_0x28b723[_0x1d6c('0x55')][_0x1d6c('0x5b')]){return db['User'][_0x1d6c('0x27')]({'attributes':['id',_0x1d6c('0x5c')],'where':{'id':_0x28b723[_0x1d6c('0x55')][_0x1d6c('0x5b')]}})[_0x1d6c('0x12')](function(_0x404df5){if(_0x404df5){_0x28b723[_0x1d6c('0x3f')][_0x1d6c('0x5d')]({'id':0x0,'priority':0x0,'app':_0x1d6c('0x5e'),'appdata':_0x404df5['name']+','+(_0x28b723[_0x1d6c('0x3e')][_0x1d6c('0x5f')]||0xa),'interval':_0x1d6c('0x46')});}return respondWithRpcPromise(_0x1d6c('0x60'),'startRouting',_0x28b723);});}return respondWithRpcPromise(_0x1d6c('0x60'),_0x1d6c('0x61'),_0x28b723);})[_0x1d6c('0x12')](function(_0x239bac){_0x39d227(_0x239bac);})['catch'](function(_0x213ced){_0x5b530d(_0x5a0fa9['error'](0x1f4,_0x213ced['message']));});});};
\ No newline at end of file
index c744684..3a76c7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb1c=['./mailAccount.events','save','remove','update','emit','register','length','mailAccount:'];(function(_0x4bb62f,_0x578539){var _0x32c36e=function(_0x40a851){while(--_0x40a851){_0x4bb62f['push'](_0x4bb62f['shift']());}};_0x32c36e(++_0x578539);}(_0xeb1c,0xa0));var _0xceb1=function(_0x4257af,_0x1b70b2){_0x4257af=_0x4257af-0x0;var _0x49ee70=_0xeb1c[_0x4257af];return _0x49ee70;};'use strict';var MailAccountEvents=require(_0xceb1('0x0'));var events=[_0xceb1('0x1'),_0xceb1('0x2'),_0xceb1('0x3')];function createListener(_0x578a58,_0x329c3e){return function(_0x44c233){_0x329c3e[_0xceb1('0x4')](_0x578a58,_0x44c233);};}function removeListener(_0x331ec9,_0x1dced8){return function(){MailAccountEvents['removeListener'](_0x331ec9,_0x1dced8);};}exports[_0xceb1('0x5')]=function(_0x3adc82){for(var _0x30b2fc=0x0,_0x3d5fb5=events[_0xceb1('0x6')];_0x30b2fc<_0x3d5fb5;_0x30b2fc++){var _0x3adfbf=events[_0x30b2fc];var _0x595e57=createListener(_0xceb1('0x7')+_0x3adfbf,_0x3adc82);MailAccountEvents['on'](_0x3adfbf,_0x595e57);}};
\ No newline at end of file
+var _0x929b=['removeListener','register','length','save','emit'];(function(_0x3b46b9,_0x1d78e7){var _0x46b5e6=function(_0x3424c6){while(--_0x3424c6){_0x3b46b9['push'](_0x3b46b9['shift']());}};_0x46b5e6(++_0x1d78e7);}(_0x929b,0x1f2));var _0xb929=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x929b[_0x22f8ab];return _0x2a70e5;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xb929('0x0'),'remove','update'];function createListener(_0x1ebaed,_0x103ff8){return function(_0x36caae){_0x103ff8[_0xb929('0x1')](_0x1ebaed,_0x36caae);};}function removeListener(_0x3d51d6,_0x1d10a5){return function(){MailAccountEvents[_0xb929('0x2')](_0x3d51d6,_0x1d10a5);};}exports[_0xb929('0x3')]=function(_0x28d21f){for(var _0x1b2c99=0x0,_0xe08ec5=events[_0xb929('0x4')];_0x1b2c99<_0xe08ec5;_0x1b2c99++){var _0x22dcb0=events[_0x1b2c99];var _0x2d7dee=createListener('mailAccount:'+_0x22dcb0,_0x28d21f);MailAccountEvents['on'](_0x22dcb0,_0x2d7dee);}};
\ No newline at end of file
index 8ac5cc0..33edf87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1e4=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete'];(function(_0x510b46,_0x3ee861){var _0x384de8=function(_0x1f7a74){while(--_0x1f7a74){_0x510b46['push'](_0x510b46['shift']());}};_0x384de8(++_0x3ee861);}(_0xd1e4,0x111));var _0x4d1e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xd1e4[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0x4d1e('0x0'));var util=require(_0x4d1e('0x1'));var path=require(_0x4d1e('0x2'));var timeout=require(_0x4d1e('0x3'));var express=require(_0x4d1e('0x4'));var router=express[_0x4d1e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4d1e('0x6'));var config=require(_0x4d1e('0x7'));var controller=require(_0x4d1e('0x8'));router['get'](_0x4d1e('0x9'),auth[_0x4d1e('0xa')](),controller[_0x4d1e('0xb')]);router[_0x4d1e('0xc')](_0x4d1e('0x9'),auth[_0x4d1e('0xa')](),controller[_0x4d1e('0xd')]);router[_0x4d1e('0xe')](_0x4d1e('0x9'),auth[_0x4d1e('0xa')](),controller['destroy']);module[_0x4d1e('0xf')]=router;
\ No newline at end of file
+var _0x0cb8=['./mailApplication.controller','isAuthenticated','show','/:id','destroy','exports','util','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20af7f,_0x12c1ac){var _0x1532ca=function(_0x5a3a4b){while(--_0x5a3a4b){_0x20af7f['push'](_0x20af7f['shift']());}};_0x1532ca(++_0x12c1ac);}(_0x0cb8,0x178));var _0x80cb=function(_0x569cd0,_0x2d3fef){_0x569cd0=_0x569cd0-0x0;var _0x4c5af4=_0x0cb8[_0x569cd0];return _0x4c5af4;};'use strict';var multer=require('multer');var util=require(_0x80cb('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(_0x80cb('0x1'));var interaction=require(_0x80cb('0x2'));var config=require(_0x80cb('0x3'));var controller=require(_0x80cb('0x4'));router['get']('/:id',auth[_0x80cb('0x5')](),controller[_0x80cb('0x6')]);router['put'](_0x80cb('0x7'),auth[_0x80cb('0x5')](),controller['update']);router['delete'](_0x80cb('0x7'),auth[_0x80cb('0x5')](),controller[_0x80cb('0x8')]);module[_0x80cb('0x9')]=router;
\ No newline at end of file
index 7ca2c28..f37a5ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ba=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x52753e,_0x1718bc){var _0x5b2cd5=function(_0x3e1c7c){while(--_0x3e1c7c){_0x52753e['push'](_0x52753e['shift']());}};_0x5b2cd5(++_0x1718bc);}(_0x42ba,0x123));var _0xa42b=function(_0x2b1469,_0x5ed4e7){_0x2b1469=_0x2b1469-0x0;var _0x511b46=_0x42ba[_0x2b1469];return _0x511b46;};'use strict';var Sequelize=require(_0xa42b('0x0'));module[_0xa42b('0x1')]={'priority':{'type':Sequelize[_0xa42b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa42b('0x3')],'allowNull':![],'defaultValue':_0xa42b('0x4')},'appdata':{'type':Sequelize[_0xa42b('0x5')]()},'description':{'type':Sequelize[_0xa42b('0x3')]},'interval':{'type':Sequelize[_0xa42b('0x3')],'defaultValue':_0xa42b('0x6')}};
\ No newline at end of file
+var _0x1878=['noop','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x675f27,_0x5e7204){var _0x591503=function(_0x16c751){while(--_0x16c751){_0x675f27['push'](_0x675f27['shift']());}};_0x591503(++_0x5e7204);}(_0x1878,0x1b1));var _0x8187=function(_0x3d19dc,_0x359435){_0x3d19dc=_0x3d19dc-0x0;var _0x20e1fd=_0x1878[_0x3d19dc];return _0x20e1fd;};'use strict';var Sequelize=require(_0x8187('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8187('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8187('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8187('0x3')]},'interval':{'type':Sequelize[_0x8187('0x3')],'defaultValue':_0x8187('0x4')}};
\ No newline at end of file
index 45edc1b..7059e18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xaa88[_0x41cfd4];return _0x190f48;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));};
\ No newline at end of file
+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(_0x27a606,_0x20f88f){var _0x13a547=function(_0x36c3bc){while(--_0x36c3bc){_0x27a606['push'](_0x27a606['shift']());}};_0x13a547(++_0x20f88f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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
index 8428b7d..256fda8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30c1=['rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path'];(function(_0xb74937,_0x450898){var _0x30a3ac=function(_0x4b62d3){while(--_0x4b62d3){_0xb74937['push'](_0xb74937['shift']());}};_0x30a3ac(++_0x450898);}(_0x30c1,0x1a8));var _0x130c=function(_0x54d5c8,_0x344ce5){_0x54d5c8=_0x54d5c8-0x0;var _0x525e2e=_0x30c1[_0x54d5c8];return _0x525e2e;};'use strict';var _=require(_0x130c('0x0'));var util=require(_0x130c('0x1'));var logger=require('../../config/logger')(_0x130c('0x2'));var moment=require('moment');var BPromise=require(_0x130c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x130c('0x4'));var rimraf=require(_0x130c('0x5'));var config=require(_0x130c('0x6'));var attributes=require(_0x130c('0x7'));module[_0x130c('0x8')]=function(_0x24e454,_0x3a0744){return _0x24e454[_0x130c('0x9')](_0x130c('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x130c('0xb'),'collate':_0x130c('0xc')});};
\ No newline at end of file
+var _0x355f=['lodash','../../config/logger','api','bluebird','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x446b1c,_0x58f235){var _0x50d5cd=function(_0x1d532e){while(--_0x1d532e){_0x446b1c['push'](_0x446b1c['shift']());}};_0x50d5cd(++_0x58f235);}(_0x355f,0xdc));var _0xf355=function(_0x3b3507,_0x2f886a){_0x3b3507=_0x3b3507-0x0;var _0x20cc1c=_0x355f[_0x3b3507];return _0x20cc1c;};'use strict';var _=require(_0xf355('0x0'));var util=require('util');var logger=require(_0xf355('0x1'))(_0xf355('0x2'));var moment=require('moment');var BPromise=require(_0xf355('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf355('0x4'));var attributes=require(_0xf355('0x5'));module[_0xf355('0x6')]=function(_0x2f353f,_0x5c6682){return _0x2f353f[_0xf355('0x7')](_0xf355('0x8'),attributes,{'tableName':_0xf355('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf355('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index c59a2ac..a1326b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24aa=['MailApplication,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','UpdateMailApplication','update','body','options','raw','where','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0xde0e17,_0x18dc4c){var _0x3f86bb=function(_0x226e9f){while(--_0x226e9f){_0xde0e17['push'](_0xde0e17['shift']());}};_0x3f86bb(++_0x18dc4c);}(_0x24aa,0x91));var _0xa24a=function(_0x4f2161,_0x1e5f60){_0x4f2161=_0x4f2161-0x0;var _0x21b5ae=_0x24aa[_0x4f2161];return _0x21b5ae;};'use strict';var _=require(_0xa24a('0x0'));var util=require(_0xa24a('0x1'));var moment=require(_0xa24a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa24a('0x3'));var fs=require('fs');var Redis=require(_0xa24a('0x4'));var db=require(_0xa24a('0x5'))['db'];var utils=require(_0xa24a('0x6'));var logger=require(_0xa24a('0x7'))(_0xa24a('0x8'));var config=require(_0xa24a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa24a('0xa')][_0xa24a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f92cf,_0x1a4ed6,_0x27e0c4){return new BPromise(function(_0x20ffdc,_0x479156){return client[_0xa24a('0xc')](_0x2f92cf,_0x27e0c4)[_0xa24a('0xd')](function(_0x55b93f){logger[_0xa24a('0xe')](_0xa24a('0xf'),_0x1a4ed6,'request\x20sent');logger[_0xa24a('0x10')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1a4ed6,_0xa24a('0x11'),JSON['stringify'](_0x55b93f));if(_0x55b93f[_0xa24a('0x12')]){if(_0x55b93f['error'][_0xa24a('0x13')]===0x1f4){logger[_0xa24a('0x12')]('MailApplication,\x20%s,\x20%s',_0x1a4ed6,_0x55b93f[_0xa24a('0x12')]['message']);return _0x479156(_0x55b93f[_0xa24a('0x12')][_0xa24a('0x14')]);}logger[_0xa24a('0x12')](_0xa24a('0xf'),_0x1a4ed6,_0x55b93f['error'][_0xa24a('0x14')]);return _0x20ffdc(_0x55b93f[_0xa24a('0x12')]['message']);}else{logger[_0xa24a('0xe')](_0xa24a('0xf'),_0x1a4ed6,_0xa24a('0x11'));_0x20ffdc(_0x55b93f[_0xa24a('0x15')][_0xa24a('0x14')]);}})[_0xa24a('0x16')](function(_0x51a4bc){logger[_0xa24a('0x12')](_0xa24a('0xf'),_0x1a4ed6,_0x51a4bc);_0x479156(_0x51a4bc);});});}exports[_0xa24a('0x17')]=function(_0x9621de){var _0x370cc6=this;return new Promise(function(_0x24b35a,_0x3e719f){return db['MailApplication'][_0xa24a('0x18')](_0x9621de[_0xa24a('0x19')],{'raw':_0x9621de['options']?_0x9621de[_0xa24a('0x1a')][_0xa24a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9621de[_0xa24a('0x1a')]?_0x9621de[_0xa24a('0x1a')][_0xa24a('0x1c')]||null:null,'attributes':_0x9621de[_0xa24a('0x1a')]?_0x9621de['options'][_0xa24a('0x1d')]||null:null,'limit':_0x9621de[_0xa24a('0x1a')]?_0x9621de[_0xa24a('0x1a')][_0xa24a('0x1e')]||null:null})[_0xa24a('0xd')](function(_0x2ad8d7){logger[_0xa24a('0xe')]('UpdateMailApplication',_0x9621de);logger['debug']('UpdateMailApplication',_0x9621de,JSON[_0xa24a('0x1f')](_0x2ad8d7));_0x24b35a(_0x2ad8d7);})[_0xa24a('0x16')](function(_0x1f9c22){logger['error']('UpdateMailApplication',_0x1f9c22[_0xa24a('0x14')],_0x9621de);_0x3e719f(_0x370cc6[_0xa24a('0x12')](0x1f4,_0x1f9c22[_0xa24a('0x14')]));});});};
\ No newline at end of file
+var _0x0d0a=['result','catch','UpdateMailApplication','MailApplication','update','options','raw','where','attributes','limit','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x3cd68d,_0x4c686c){var _0x289878=function(_0x27cf97){while(--_0x27cf97){_0x3cd68d['push'](_0x3cd68d['shift']());}};_0x289878(++_0x4c686c);}(_0x0d0a,0x155));var _0xa0d0=function(_0x24bfed,_0x43f870){_0x24bfed=_0x24bfed-0x0;var _0x1f211f=_0x0d0a[_0x24bfed];return _0x1f211f;};'use strict';var _=require(_0xa0d0('0x0'));var util=require(_0xa0d0('0x1'));var moment=require('moment');var BPromise=require(_0xa0d0('0x2'));var rs=require(_0xa0d0('0x3'));var fs=require('fs');var Redis=require(_0xa0d0('0x4'));var db=require(_0xa0d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa0d0('0x6'));var config=require(_0xa0d0('0x7'));var jayson=require(_0xa0d0('0x8'));var client=jayson[_0xa0d0('0x9')][_0xa0d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17ecd8,_0x5843fa,_0x52b116){return new BPromise(function(_0x61c692,_0x309fb2){return client['request'](_0x17ecd8,_0x52b116)[_0xa0d0('0xb')](function(_0x5bde00){logger[_0xa0d0('0xc')](_0xa0d0('0xd'),_0x5843fa,'request\x20sent');logger[_0xa0d0('0xe')](_0xa0d0('0xf'),_0x5843fa,_0xa0d0('0x10'),JSON['stringify'](_0x5bde00));if(_0x5bde00[_0xa0d0('0x11')]){if(_0x5bde00[_0xa0d0('0x11')]['code']===0x1f4){logger[_0xa0d0('0x11')](_0xa0d0('0xd'),_0x5843fa,_0x5bde00['error'][_0xa0d0('0x12')]);return _0x309fb2(_0x5bde00[_0xa0d0('0x11')][_0xa0d0('0x12')]);}logger[_0xa0d0('0x11')]('MailApplication,\x20%s,\x20%s',_0x5843fa,_0x5bde00[_0xa0d0('0x11')]['message']);return _0x61c692(_0x5bde00[_0xa0d0('0x11')]['message']);}else{logger['info'](_0xa0d0('0xd'),_0x5843fa,_0xa0d0('0x10'));_0x61c692(_0x5bde00[_0xa0d0('0x13')][_0xa0d0('0x12')]);}})[_0xa0d0('0x14')](function(_0x5a73d4){logger['error'](_0xa0d0('0xd'),_0x5843fa,_0x5a73d4);_0x309fb2(_0x5a73d4);});});}exports[_0xa0d0('0x15')]=function(_0x102245){var _0x4e95e5=this;return new Promise(function(_0x5995ae,_0x21fdba){return db[_0xa0d0('0x16')][_0xa0d0('0x17')](_0x102245['body'],{'raw':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1a')]||null:null,'attributes':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1b')]||null:null,'limit':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1c')]||null:null})[_0xa0d0('0xb')](function(_0x2629fa){logger['info'](_0xa0d0('0x15'),_0x102245);logger[_0xa0d0('0xe')]('UpdateMailApplication',_0x102245,JSON[_0xa0d0('0x1d')](_0x2629fa));_0x5995ae(_0x2629fa);})['catch'](function(_0x1afabb){logger[_0xa0d0('0x11')](_0xa0d0('0x15'),_0x1afabb['message'],_0x102245);_0x21fdba(_0x4e95e5['error'](0x1f4,_0x1afabb[_0xa0d0('0x12')]));});});};
\ No newline at end of file
index f6f5b8f..5781dd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb99b=['/:id/download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xb99b,0x96));var _0xbb99=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb99b[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0xbb99('0x0'));var router=express[_0xbb99('0x1')]();var auth=require(_0xbb99('0x2'));var interaction=require(_0xbb99('0x3'));var controller=require(_0xbb99('0x4'));router[_0xbb99('0x5')]('/',auth[_0xbb99('0x6')](),controller[_0xbb99('0x7')]);router[_0xbb99('0x5')]('/describe',auth['isAuthenticated'](),controller[_0xbb99('0x8')]);router[_0xbb99('0x5')](_0xbb99('0x9'),auth[_0xbb99('0x6')](),controller['show']);router[_0xbb99('0x5')](_0xbb99('0xa'),auth[_0xbb99('0x6')](),controller[_0xbb99('0xb')]);router[_0xbb99('0x5')](_0xbb99('0xc'),auth[_0xbb99('0x6')](),controller['download']);router[_0xbb99('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbb99('0xd')](_0xbb99('0xa'),auth[_0xbb99('0x6')](),controller[_0xbb99('0xe')]);router['post'](_0xbb99('0xf'),auth[_0xbb99('0x6')](),interaction[_0xbb99('0x10')](_0xbb99('0x11'),_0xbb99('0x12')),controller[_0xbb99('0x13')]);router[_0xbb99('0x14')](_0xbb99('0x9'),auth[_0xbb99('0x6')](),interaction['tracked']('mail',_0xbb99('0x15')),controller[_0xbb99('0x16')]);router['delete'](_0xbb99('0x9'),auth['isAuthenticated'](),interaction['tracked']('mail',_0xbb99('0x17')),controller[_0xbb99('0x18')]);router[_0xbb99('0x19')](_0xbb99('0xf'),auth[_0xbb99('0x6')](),controller['removeTags']);module[_0xbb99('0x1a')]=router;
\ No newline at end of file
+var _0xe686=['index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','mailinteraction:addtags','addTags','put','tracked','mail','update','delete','mailinteraction:destroy','removeTags','exports','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x19d5db,_0x3eec9f){var _0x384455=function(_0x2dca6e){while(--_0x2dca6e){_0x19d5db['push'](_0x19d5db['shift']());}};_0x384455(++_0x3eec9f);}(_0xe686,0x181));var _0x6e68=function(_0x458b0f,_0x5b71c7){_0x458b0f=_0x458b0f-0x0;var _0x4a12bd=_0xe686[_0x458b0f];return _0x4a12bd;};'use strict';var express=require('express');var router=express[_0x6e68('0x0')]();var auth=require(_0x6e68('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x6e68('0x2'));router[_0x6e68('0x3')]('/',auth[_0x6e68('0x4')](),controller[_0x6e68('0x5')]);router[_0x6e68('0x3')]('/describe',auth['isAuthenticated'](),controller[_0x6e68('0x6')]);router['get'](_0x6e68('0x7'),auth['isAuthenticated'](),controller[_0x6e68('0x8')]);router[_0x6e68('0x3')](_0x6e68('0x9'),auth[_0x6e68('0x4')](),controller[_0x6e68('0xa')]);router['get'](_0x6e68('0xb'),auth[_0x6e68('0x4')](),controller[_0x6e68('0xc')]);router[_0x6e68('0xd')]('/',auth[_0x6e68('0x4')](),controller[_0x6e68('0xe')]);router[_0x6e68('0xd')](_0x6e68('0x9'),auth[_0x6e68('0x4')](),controller['addMessage']);router['post'](_0x6e68('0xf'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x6e68('0x10')),controller[_0x6e68('0x11')]);router[_0x6e68('0x12')]('/:id',auth['isAuthenticated'](),interaction[_0x6e68('0x13')](_0x6e68('0x14'),'mailinteraction:update'),controller[_0x6e68('0x15')]);router[_0x6e68('0x16')](_0x6e68('0x7'),auth['isAuthenticated'](),interaction['tracked'](_0x6e68('0x14'),_0x6e68('0x17')),controller['destroy']);router[_0x6e68('0x16')](_0x6e68('0xf'),auth[_0x6e68('0x4')](),controller[_0x6e68('0x18')]);module[_0x6e68('0x19')]=router;
\ No newline at end of file
index f795e74..d3e8075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c0a=['long','out','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x4f47c9,_0x238f1a){var _0x334286=function(_0x389999){while(--_0x389999){_0x4f47c9['push'](_0x4f47c9['shift']());}};_0x334286(++_0x238f1a);}(_0x1c0a,0x14a));var _0xa1c0=function(_0x2cfb90,_0x18474c){_0x2cfb90=_0x2cfb90-0x0;var _0x40db9b=_0x1c0a[_0x2cfb90];return _0x40db9b;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xa1c0('0x0'));module[_0xa1c0('0x1')]={'closed':{'type':Sequelize[_0xa1c0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa1c0('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa1c0('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa1c0('0x4')]},'note':{'type':Sequelize[_0xa1c0('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xa1c0('0x4')]},'cc':{'type':Sequelize[_0xa1c0('0x5')](_0xa1c0('0x6'))},'subject':{'type':Sequelize[_0xa1c0('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa1c0('0x3')]},'substatus':{'type':Sequelize[_0xa1c0('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xa1c0('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa1c0('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa1c0('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0899=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x0899,0x183));var _0x9089=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x0899[_0x622035];return _0x326cf2;};'use strict';var Sequelize=require(_0x9089('0x0'));var iconv=require(_0x9089('0x1'));module[_0x9089('0x2')]={'closed':{'type':Sequelize[_0x9089('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9089('0x4')]},'disposition':{'type':Sequelize[_0x9089('0x5')]},'secondDisposition':{'type':Sequelize[_0x9089('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9089('0x5')]},'inReplyTo':{'type':Sequelize[_0x9089('0x5')](0x1fe)},'to':{'type':Sequelize[_0x9089('0x5')]},'cc':{'type':Sequelize[_0x9089('0x6')]('long')},'subject':{'type':Sequelize[_0x9089('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x9089('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9089('0x7')]('in',_0x9089('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9089('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9089('0x3')],'defaultValue':![]}};
\ No newline at end of file
index d043152..a3d91c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff6f=['o.fullname','Owner.fullname','groupBy','MailInteractionId','Setting','enableEmailPreview','push','all','rows','params','includeAll','include','options','create','body','destroy','describe','addMessage','omit','ids','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','mkdirSync','each','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','util','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','error','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','MailMessage','out','plainBody','-id','lastMsgText','trimStart','catch','MailInteraction','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','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_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','expr','parseSearch','search','length','conditions','value','`\x20=\x200','having','`\x20>\x200','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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','start','some','compact','i.MailAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','isEmpty','t.id\x20IN\x20?','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.attach','i.disposition','i.thirdDisposition','i.to','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xff6f,0x121));var _0xfff6=function(_0x307cec,_0x1cf922){_0x307cec=_0x307cec-0x0;var _0x285c73=_0xff6f[_0x307cec];return _0x285c73;};'use strict';var emlformat=require(_0xfff6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfff6('0x1'));var moment=require(_0xfff6('0x2'));var BPromise=require(_0xfff6('0x3'));var util=require(_0xfff6('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xfff6('0x5'));var squel=require(_0xfff6('0x6'));var juice=require(_0xfff6('0x7'));var Redis=require('ioredis');var qs=require(_0xfff6('0x8'));var as=require(_0xfff6('0x9'));var logger=require('../../config/logger')(_0xfff6('0xa'));var config=require(_0xfff6('0xb'));var db=require(_0xfff6('0xc'))['db'];var htmlEntities=require(_0xfff6('0xd'));config[_0xfff6('0xe')]=_[_0xfff6('0xf')](config['redis'],{'host':_0xfff6('0x10'),'port':0x18eb});var socket=require(_0xfff6('0x11'))(new Redis(config['redis']));require(_0xfff6('0x12'))[_0xfff6('0x13')](socket);function respondWithStatusCode(_0x2287c1,_0x378aba){_0x378aba=_0x378aba||0xcc;return function(_0x16b23e){if(_0x16b23e){return _0x2287c1['sendStatus'](_0x378aba);}return _0x2287c1[_0xfff6('0x14')](_0x378aba)[_0xfff6('0x15')]();};}function respondWithResult(_0x208047,_0x4e94a5){_0x4e94a5=_0x4e94a5||0xc8;return function(_0x48e0ca){if(_0x48e0ca){return _0x208047[_0xfff6('0x14')](_0x4e94a5)[_0xfff6('0x16')](_0x48e0ca);}};}function respondWithFilteredResult(_0x1577d6,_0x527fad){return function(_0x3e951d){if(_0x3e951d){var _0x389409=typeof _0x527fad['offset']===_0xfff6('0x17')&&typeof _0x527fad[_0xfff6('0x18')]===_0xfff6('0x17');var _0x2841b5=_0x3e951d[_0xfff6('0x19')];var _0x23a477=_0x389409?0x0:_0x527fad[_0xfff6('0x1a')];var _0x5bfdfb=_0x389409?_0x3e951d[_0xfff6('0x19')]:_0x527fad['offset']+_0x527fad[_0xfff6('0x18')];var _0x2955b3;if(_0x5bfdfb>=_0x2841b5){_0x5bfdfb=_0x2841b5;_0x2955b3=0xc8;}else{_0x2955b3=0xce;}_0x1577d6[_0xfff6('0x14')](_0x2955b3);return _0x1577d6[_0xfff6('0x1b')](_0xfff6('0x1c'),_0x23a477+'-'+_0x5bfdfb+'/'+_0x2841b5)[_0xfff6('0x16')](_0x3e951d);}return null;};}function saveUpdates(_0x484b22){return function(_0x3bf3cd){if(_0x3bf3cd){return _0x3bf3cd[_0xfff6('0x1d')](_0x484b22)[_0xfff6('0x1e')](function(_0x4cff22){return _0x4cff22;});}return null;};}function removeEntity(_0x4ec3e7){return function(_0x3dae8c){if(_0x3dae8c){return _0x3dae8c['destroy']()['then'](function(){_0x4ec3e7['status'](0xcc)[_0xfff6('0x15')]();});}};}function handleEntityNotFound(_0x316094){return function(_0x40840c){if(!_0x40840c){_0x316094['sendStatus'](0x194);}return _0x40840c;};}function handleError(_0x5603f0,_0x1f6c85){_0x1f6c85=_0x1f6c85||0x1f4;return function(_0x3401ea){logger[_0xfff6('0x1f')](_0x3401ea[_0xfff6('0x20')]);if(_0x3401ea[_0xfff6('0x21')]){delete _0x3401ea[_0xfff6('0x21')];}_0x5603f0['status'](_0x1f6c85)[_0xfff6('0x22')](_0x3401ea);};}function getInteractionUsers(_0x5d113a,_0x4b321d){return new BPromise(function(_0x18c94b,_0x15ba0e){try{if(_0x4b321d[_0x5d113a['id']]){_0x5d113a[_0xfff6('0x23')]=_['map'](_0x4b321d[_0x5d113a['id']],function(_0x244878){return{'id':_0x244878['id'],'fullname':_0x244878[_0xfff6('0x24')]};});}}catch(_0x176e2f){_0x15ba0e(_0x176e2f);}_0x18c94b(_0x5d113a);});}function getInteractionTags(_0x61dbf5,_0x21aac3){return new BPromise(function(_0x3e8447,_0x43f1eb){try{if(_0x61dbf5[_0xfff6('0x25')]){_0x61dbf5['Tags']=[];_0x61dbf5[_0xfff6('0x25')][_0xfff6('0x26')](',')[_0xfff6('0x27')](function(_0x3c668d){_0x61dbf5[_0xfff6('0x28')]['push'](_0x21aac3[_0x3c668d]);});}delete _0x61dbf5[_0xfff6('0x25')];}catch(_0x1e08e2){_0x43f1eb(_0x1e08e2);}_0x3e8447(_0x61dbf5);});}function getLastMessageText(_0x3b4ff1){return new BPromise(function(_0x541fc3,_0x17e900){return db[_0xfff6('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x3b4ff1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xfff6('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xfff6('0x2b')],'order':_0xfff6('0x2c'),'raw':!![]})[_0xfff6('0x1e')](function(_0x4a5a41){if(_0x4a5a41&&_0x4a5a41[_0xfff6('0x2b')]){_0x3b4ff1[_0xfff6('0x2d')]=_[_0xfff6('0x2e')](_0x4a5a41[_0xfff6('0x2b')]);}_0x541fc3(_0x3b4ff1);})[_0xfff6('0x2f')](function(_0x50bba2){_0x17e900(_0x50bba2);});});}function updateMailInteraction(_0x425c31,_0x2b8e7a,_0x2fc61c,_0x424893){return new BPromise(function(_0x3f1f7d,_0x428a6b){return getInteractionUsers(_0x425c31,_0x2fc61c)[_0xfff6('0x1e')](function(_0x1c7000){return getInteractionTags(_0x1c7000,_0x2b8e7a);})[_0xfff6('0x1e')](function(_0x4141f3){if(_0x424893){_0x3f1f7d(getLastMessageText(_0x4141f3));}else{_0x3f1f7d(_0x4141f3);}})[_0xfff6('0x2f')](function(_0x5523e8){_0x428a6b(_0x5523e8);});});}exports['index']=function(_0x5f2d20,_0xda9431){var _0x528cc7={},_0x13d4a1={},_0x5a3069={'count':0x0,'rows':[]};var _0x4e2925=_['map'](db[_0xfff6('0x30')][_0xfff6('0x31')],function(_0x292587){return{'name':_0x292587[_0xfff6('0x32')],'type':_0x292587[_0xfff6('0x33')][_0xfff6('0x34')]};});_0x13d4a1[_0xfff6('0x35')]=_[_0xfff6('0x36')](_0x4e2925,_0xfff6('0x21'));_0x13d4a1[_0xfff6('0x37')]=_[_0xfff6('0x38')](_0x5f2d20['query']);_0x13d4a1[_0xfff6('0x39')]=_[_0xfff6('0x3a')](_0x13d4a1[_0xfff6('0x35')],_0x13d4a1[_0xfff6('0x37')]);_0x528cc7[_0xfff6('0x3b')]=_['intersection'](_0x13d4a1[_0xfff6('0x35')],qs[_0xfff6('0x3c')](_0x5f2d20[_0xfff6('0x37')]['fields']));_0x528cc7['attributes']=_0x528cc7['attributes']['length']?_0x528cc7[_0xfff6('0x3b')]:_0x13d4a1[_0xfff6('0x35')];if(!_0x5f2d20[_0xfff6('0x37')]['hasOwnProperty'](_0xfff6('0x3d'))){_0x528cc7['limit']=qs[_0xfff6('0x18')](_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x18')]);_0x528cc7[_0xfff6('0x1a')]=qs[_0xfff6('0x1a')](_0x5f2d20['query'][_0xfff6('0x1a')]);}_0x528cc7[_0xfff6('0x3e')]=qs[_0xfff6('0x3f')](_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x3f')]);_0x528cc7[_0xfff6('0x40')]=qs[_0xfff6('0x39')](_[_0xfff6('0x41')](_0x5f2d20[_0xfff6('0x37')],_0x13d4a1[_0xfff6('0x39')]),_0x4e2925);var _0x105d91=[];var _0x643071=squel[_0xfff6('0x42')]()[_0xfff6('0x43')]('id')[_0xfff6('0x43')](_0xfff6('0x21'))[_0xfff6('0x43')](_0xfff6('0x44'))[_0xfff6('0x45')](_0xfff6('0x46'));var _0x1306bb=squel[_0xfff6('0x42')]()[_0xfff6('0x43')]('u.id')[_0xfff6('0x43')](_0xfff6('0x47'))[_0xfff6('0x43')](_0xfff6('0x48'))['from'](_0xfff6('0x49'),'ui')[_0xfff6('0x4a')](_0xfff6('0x4b'),'u',_0xfff6('0x4c'));var _0x32ed38=squel[_0xfff6('0x42')]()[_0xfff6('0x45')](_0xfff6('0x4d'),'i')[_0xfff6('0x4a')](_0xfff6('0x4e'),'c',_0xfff6('0x4f'))['left_join'](_0xfff6('0x4b'),'o',_0xfff6('0x50'))[_0xfff6('0x4a')](_0xfff6('0x51'),'a',_0xfff6('0x52'))['left_join'](_0xfff6('0x53'),'me','me.MailInteractionId\x20=\x20i.id')[_0xfff6('0x4a')](_0xfff6('0x54'),'it','it.MailInteractionId\x20=\x20i.id')[_0xfff6('0x4a')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x176ab8=squel['expr']();var _0x1a3cee=[];var _0x2a58f8=squel[_0xfff6('0x55')]();var _0x54a273;if(_0x5f2d20[_0xfff6('0x37')]['search']){_0x54a273=as[_0xfff6('0x56')](_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x57')]);var _0x4fa502=_0x54a273['sqlOperator'];for(var _0x773cb9=0x0;_0x773cb9<_0x54a273['conditions'][_0xfff6('0x58')];_0x773cb9++){var _0x484df2=_0x54a273[_0xfff6('0x59')][_0x773cb9];var _0x366a6e='i';var _0x16c518=_['find'](_0x4e2925,[_0xfff6('0x21'),_0x484df2[_0xfff6('0x43')]]);if(!_0x16c518){switch(_0x484df2['field']){case'unreadMessages':if(_0x484df2[_0xfff6('0x5a')]==0x1){_0x32ed38['having']('`'+_0x484df2[_0xfff6('0x43')]+_0xfff6('0x5b'));}else{_0x32ed38[_0xfff6('0x5c')]('`'+_0x484df2[_0xfff6('0x43')]+_0xfff6('0x5d'));}break;case'Contact':if(_0x484df2[_0xfff6('0x5e')]===_0xfff6('0x5f')){if(_0x484df2['value'][_0xfff6('0x26')]('\x20')['length']>0x1){_0x176ab8[_0x4fa502](_0xfff6('0x60'),qs[_0xfff6('0x61')](_0x484df2['value']),null);}else{var _0x1da828='%'+_0x484df2[_0xfff6('0x5a')]+'%';_0x176ab8[_0x4fa502](_0xfff6('0x62'),_0x1da828,_0x1da828,_0x1da828);}}else{_0x16c518=_['find'](_0x4e2925,['name',_0xfff6('0x63')]);_0x484df2[_0xfff6('0x43')]=_0xfff6('0x63');_0x44bcae=as[_0xfff6('0x64')](_0x366a6e,_0x16c518[_0xfff6('0x33')],_0x484df2);_0x176ab8[_0x4fa502](_0x44bcae[_0xfff6('0x65')],_0x44bcae[_0xfff6('0x5a')]['start'],_0x44bcae[_0xfff6('0x5a')][_0xfff6('0x15')]);}break;case'Tag':var _0x3e025c=_0x484df2[_0xfff6('0x5a')]['split'](',')[_0xfff6('0x36')](function(_0xb9b6ba){return Number(_0xb9b6ba);});_0x3e025c['forEach'](function(_0x1df4e9){_0x2a58f8['or'](_0xfff6('0x66'),'%,'+_0x1df4e9+',%');});_0x1a3cee=_['union'](_0x1a3cee,_0x3e025c);break;case'User':if(_0x484df2[_0xfff6('0x5e')]==='$substring'){_0x176ab8[_0x4fa502](_0xfff6('0x67'),'%'+_0x484df2[_0xfff6('0x5a')]+'%',null);}else{_0x16c518=_[_0xfff6('0x68')](_0x4e2925,['name',_0xfff6('0x69')]);_0x484df2[_0xfff6('0x43')]=_0xfff6('0x69');_0x44bcae=as['buildExpression'](_0x366a6e,_0x16c518[_0xfff6('0x33')],_0x484df2);_0x176ab8[_0x4fa502](_0x44bcae[_0xfff6('0x65')],_0x44bcae[_0xfff6('0x5a')][_0xfff6('0x6a')],_0x44bcae[_0xfff6('0x5a')]['end']);}break;case _0xfff6('0x2b'):_0x44bcae=as[_0xfff6('0x64')]('me',null,_0x484df2);_0x176ab8[_0x4fa502](_0x44bcae[_0xfff6('0x65')],_0x44bcae[_0xfff6('0x5a')][_0xfff6('0x6a')],_0x44bcae[_0xfff6('0x5a')][_0xfff6('0x15')]);break;}}else{var _0x44bcae=as[_0xfff6('0x64')](_0x366a6e,_0x16c518[_0xfff6('0x33')],_0x484df2);_0x176ab8[_0x4fa502](_0x44bcae[_0xfff6('0x65')],_0x44bcae[_0xfff6('0x5a')][_0xfff6('0x6a')],_0x44bcae[_0xfff6('0x5a')]['end']);}}}else{var _0x361984=_(_0x5f2d20[_0xfff6('0x37')])[_0xfff6('0x38')]()[_0xfff6('0x36')](function(_0x386036){return _[_0xfff6('0x6b')](_0x4e2925,[_0xfff6('0x21'),_0x386036])?_0x386036:undefined;})[_0xfff6('0x6c')]()[_0xfff6('0x5a')]();if(!_['isEmpty'](_0x361984)){_0x361984[_0xfff6('0x27')](function(_0x43479f){if(_0x43479f==='MailAccountId'){_0x32ed38[_0xfff6('0x40')](_0xfff6('0x6d'),[]['concat'](_0x5f2d20[_0xfff6('0x37')][_0x43479f]));}else if(_0x43479f==='createdAt'){var _0x546e8d=JSON[_0xfff6('0x6e')](_0x5f2d20[_0xfff6('0x37')][_0x43479f])[_0xfff6('0x6f')];var _0x21fb1e=JSON['parse'](_0x5f2d20[_0xfff6('0x37')][_0x43479f])[_0xfff6('0x70')];_0x32ed38[_0xfff6('0x40')](_0xfff6('0x71'),_0x546e8d,_0x21fb1e);}else{if(_0x5f2d20[_0xfff6('0x37')][_0x43479f]===_0xfff6('0x72')){_0x32ed38['where']('i.'+_0x43479f+_0xfff6('0x73'));}else{_0x32ed38[_0xfff6('0x40')]('i.'+_0x43479f+_0xfff6('0x74'),_0x5f2d20[_0xfff6('0x37')][_0x43479f]);}}});}if(_0x5f2d20[_0xfff6('0x37')]['read']){if(_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x75')]==0x1){_0x32ed38[_0xfff6('0x5c')](_0xfff6('0x76'));}else{_0x32ed38[_0xfff6('0x5c')](_0xfff6('0x77'));}}if(_0x5f2d20['query'][_0xfff6('0x78')]){_0x1a3cee=_[_0xfff6('0x79')](_0x5f2d20['query'][_0xfff6('0x78')])?_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x78')]:new Array(_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x78')]);_0x1a3cee[_0xfff6('0x27')](function(_0x145fe1){_0x2a58f8['or'](_0xfff6('0x66'),'%,'+_0x145fe1+',%');});}if(_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x7a')]){var _0x4faabd=_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x7a')][_0xfff6('0x7b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xfff6('0x7c')](_0x4faabd)){_0x176ab8['or'](_0xfff6('0x7d'),_0x4faabd+'%');}else if(qs[_0xfff6('0x7e')](_0x4faabd)){_0x176ab8['or'](_0xfff6('0x7f'),_0x4faabd+'%');}else{_0x176ab8['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfff6('0x61')](_0x4faabd))['or'](_0xfff6('0x80'),qs[_0xfff6('0x61')](_0x4faabd));}}}_0x32ed38[_0xfff6('0x40')](_0x176ab8);_0x32ed38['group'](_0xfff6('0x81'));var _0x1e44df={'type':db[_0xfff6('0x82')][_0xfff6('0x83')][_0xfff6('0x84')],'raw':!![]};var _0x5681f6=_0x32ed38[_0xfff6('0x85')]();_0x5681f6[_0xfff6('0x43')](_0xfff6('0x81'));_0x5681f6['field'](_0xfff6('0x86'),_0xfff6('0x87'));if(_0x528cc7[_0xfff6('0x3e')]){_0x528cc7[_0xfff6('0x3e')][_0xfff6('0x27')](function(_0x254b66){var _0x1ddd85=_0x254b66[0x0]==='contactName'?_0x254b66[0x0]:'i.'+_0x254b66[0x0];_0x32ed38[_0xfff6('0x3e')](_0x1ddd85,_0x254b66[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfff6('0x88')](_0x1a3cee)){_0x32ed38[_0xfff6('0x5c')](_0x2a58f8);_0x5681f6[_0xfff6('0x40')](_0xfff6('0x89'),_0x1a3cee);}BPromise['resolve']()['then'](function(){if(!_0x54a273){if(_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x8a')])return;_0x5681f6['where'](_0xfff6('0x8b'));_0x32ed38[_0xfff6('0x40')](_0xfff6('0x8b'));return;}if(_0x5f2d20['user'][_0xfff6('0x8c')]!==_0xfff6('0x8d'))return;return _0x5f2d20[_0xfff6('0x8e')][_0xfff6('0x8f')]({'attributes':['id'],'raw':!![]})[_0xfff6('0x1e')](function(_0x15b2b1){if(_[_0xfff6('0x88')](_0x15b2b1)){_0x5681f6[_0xfff6('0x40')](_0xfff6('0x90'));_0x32ed38[_0xfff6('0x40')]('i.MailAccountId\x20IS\x20NULL');}else{_0x5681f6[_0xfff6('0x40')](_0xfff6('0x6d'),_[_0xfff6('0x36')](_0x15b2b1,'id'));_0x32ed38['where'](_0xfff6('0x6d'),_['map'](_0x15b2b1,'id'));}});})['then'](function(){if(_0x5f2d20[_0xfff6('0x8e')][_0xfff6('0x8c')]===_0xfff6('0x8d')&&!_0x54a273&&!_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x8a')])return[];return db[_0xfff6('0x91')][_0xfff6('0x37')](_0x5681f6[_0xfff6('0x92')](),_0x1e44df);})[_0xfff6('0x1e')](function(_0x551a8f){_0x5a3069['count']=_0x551a8f[_0xfff6('0x58')];if(_0x5a3069[_0xfff6('0x19')]===0x0)return[];return db['sequelize']['query'](_0x643071[_0xfff6('0x92')](),_0x1e44df)[_0xfff6('0x1e')](function(_0x5c230f){_0x105d91=_['keyBy'](_0x5c230f,'id');_0x1e44df=_[_0xfff6('0x93')](_0x1e44df,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5f2d20[_0xfff6('0x37')][_0xfff6('0x3c')]){_0x528cc7[_0xfff6('0x3b')][_0xfff6('0x27')](function(_0x312c27){_0x32ed38[_0xfff6('0x43')]('i.'+_0x312c27);});}else{_0x32ed38[_0xfff6('0x43')](_0xfff6('0x86'),_0xfff6('0x87'));_0x32ed38[_0xfff6('0x43')](_0xfff6('0x94'),_0xfff6('0x95'));_0x32ed38['field'](_0xfff6('0x96'),_0xfff6('0x97'));_0x32ed38[_0xfff6('0x43')]('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');_0x32ed38[_0xfff6('0x43')]('i.id');_0x32ed38[_0xfff6('0x43')]('i.createdAt');_0x32ed38[_0xfff6('0x43')](_0xfff6('0x98'));_0x32ed38[_0xfff6('0x43')](_0xfff6('0x99'));_0x32ed38[_0xfff6('0x43')](_0xfff6('0x9a'));_0x32ed38['field'](_0xfff6('0x9b'));_0x32ed38[_0xfff6('0x43')]('i.lastMsgAt');_0x32ed38[_0xfff6('0x43')]('i.lastMsgDirection');_0x32ed38['field']('i.subject');_0x32ed38[_0xfff6('0x43')](_0xfff6('0x9c'));_0x32ed38['field']('i.secondDisposition');_0x32ed38[_0xfff6('0x43')](_0xfff6('0x9d'));_0x32ed38[_0xfff6('0x43')]('i.substatus');_0x32ed38['field'](_0xfff6('0x9e'));_0x32ed38[_0xfff6('0x43')]('i.ContactId');_0x32ed38[_0xfff6('0x43')]('i.MailAccountId');_0x32ed38[_0xfff6('0x43')](_0xfff6('0x9f'));_0x32ed38['field'](_0xfff6('0xa0'),_0xfff6('0xa1'));_0x32ed38['field'](_0xfff6('0xa2'),_0xfff6('0xa3'));_0x32ed38[_0xfff6('0x43')](_0xfff6('0xa4'),_0xfff6('0xa5'));_0x32ed38['field']('c.phone',_0xfff6('0xa6'));_0x32ed38[_0xfff6('0x43')]('c.mobile',_0xfff6('0xa7'));_0x32ed38[_0xfff6('0x43')](_0xfff6('0xa8'),'Contact.fax');_0x32ed38[_0xfff6('0x43')](_0xfff6('0xa9'),_0xfff6('0xaa'));_0x32ed38[_0xfff6('0x43')]('o.internal','Owner.internal');_0x32ed38[_0xfff6('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfff6('0x25'));}if(_0x528cc7['limit'])_0x32ed38[_0xfff6('0x18')](_0x528cc7[_0xfff6('0x18')]);if(_0x528cc7['offset'])_0x32ed38[_0xfff6('0x1a')](_0x528cc7[_0xfff6('0x1a')]);return db[_0xfff6('0x91')][_0xfff6('0x37')](_0x32ed38[_0xfff6('0x92')](),_0x1e44df);})['then'](function(_0x55ea45){if(_0x55ea45[_0xfff6('0x58')]>0x0)_0x1306bb[_0xfff6('0x40')]('ui.MailInteractionId\x20IN\x20?',_[_0xfff6('0x36')](_0x55ea45,'id'));return db['sequelize'][_0xfff6('0x37')](_0x1306bb[_0xfff6('0x92')](),_0x1e44df)[_0xfff6('0x1e')](function(_0x234820){var _0x40e4a3=_[_0xfff6('0xab')](_0x234820,_0xfff6('0xac'));var _0x392ff4=[];return db[_0xfff6('0xad')]['findOne']({'attributes':[_0xfff6('0xae')],'raw':!![]})[_0xfff6('0x1e')](function(_0x58416e){var _0x1cb64a=_0x58416e[_0xfff6('0xae')];_0x55ea45[_0xfff6('0x27')](function(_0x157256){_0x392ff4[_0xfff6('0xaf')](updateMailInteraction(_0x157256,_0x105d91,_0x40e4a3,_0x1cb64a));});return BPromise[_0xfff6('0xb0')](_0x392ff4);});});});})[_0xfff6('0x1e')](function(_0xfb1f39){_0x5a3069[_0xfff6('0xb1')]=_0xfb1f39;return _0x5a3069;})[_0xfff6('0x1e')](respondWithFilteredResult(_0xda9431,_0x528cc7))[_0xfff6('0x2f')](handleError(_0xda9431,null));};exports['show']=function(_0x304cca,_0x3f992a){var _0x44353b={'raw':![],'where':{'id':_0x304cca[_0xfff6('0xb2')]['id']}},_0x596cbf={};_0x596cbf['model']=_[_0xfff6('0x38')](db[_0xfff6('0x30')]['rawAttributes']);_0x596cbf[_0xfff6('0x37')]=_[_0xfff6('0x38')](_0x304cca['query']);_0x596cbf[_0xfff6('0x39')]=_['intersection'](_0x596cbf['model'],_0x596cbf[_0xfff6('0x37')]);_0x44353b[_0xfff6('0x3b')]=_[_0xfff6('0x3a')](_0x596cbf[_0xfff6('0x35')],qs[_0xfff6('0x3c')](_0x304cca[_0xfff6('0x37')][_0xfff6('0x3c')]));_0x44353b['attributes']=_0x44353b[_0xfff6('0x3b')][_0xfff6('0x58')]?_0x44353b[_0xfff6('0x3b')]:_0x596cbf[_0xfff6('0x35')];if(_0x304cca[_0xfff6('0x37')][_0xfff6('0xb3')]){_0x44353b[_0xfff6('0xb4')]=[{'all':!![]}];}_0x44353b=_[_0xfff6('0x93')]({},_0x44353b,_0x304cca[_0xfff6('0xb5')]);return db[_0xfff6('0x30')]['find'](_0x44353b)[_0xfff6('0x1e')](handleEntityNotFound(_0x3f992a,null))[_0xfff6('0x1e')](respondWithResult(_0x3f992a,null))[_0xfff6('0x2f')](handleError(_0x3f992a,null));};exports['create']=function(_0x27510c,_0x23648c){return db[_0xfff6('0x30')][_0xfff6('0xb6')](_0x27510c[_0xfff6('0xb7')],{})[_0xfff6('0x1e')](respondWithResult(_0x23648c,0xc9))['catch'](handleError(_0x23648c,null));};exports[_0xfff6('0x1d')]=function(_0x3b7492,_0x2ba74d){if(_0x3b7492[_0xfff6('0xb7')]['id']){delete _0x3b7492[_0xfff6('0xb7')]['id'];}return db[_0xfff6('0x30')][_0xfff6('0x68')]({'where':{'id':_0x3b7492[_0xfff6('0xb2')]['id']}})[_0xfff6('0x1e')](handleEntityNotFound(_0x2ba74d,null))[_0xfff6('0x1e')](saveUpdates(_0x3b7492['body'],null))[_0xfff6('0x1e')](respondWithResult(_0x2ba74d,null))[_0xfff6('0x2f')](handleError(_0x2ba74d,null));};exports[_0xfff6('0xb8')]=function(_0x3c85fd,_0x3151c7){return db[_0xfff6('0x30')][_0xfff6('0x68')]({'where':{'id':_0x3c85fd[_0xfff6('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3151c7,null))['then'](removeEntity(_0x3151c7,null))[_0xfff6('0x2f')](handleError(_0x3151c7,null));};exports[_0xfff6('0xb9')]=function(_0x593cb1,_0x1c5a85){return db[_0xfff6('0x30')][_0xfff6('0xb9')]()[_0xfff6('0x1e')](respondWithResult(_0x1c5a85,null))['catch'](handleError(_0x1c5a85,null));};exports['addMessage']=function(_0x3d4fc2,_0x35a11a){return db['MailMessage'][_0xfff6('0x68')]({'where':{'id':_0x3d4fc2[_0xfff6('0xb2')]['id']}})['then'](handleEntityNotFound(_0x35a11a,null))[_0xfff6('0x1e')](function(_0x18fdb5){if(_0x18fdb5){return _0x18fdb5[_0xfff6('0xba')](_0x3d4fc2[_0xfff6('0xb7')]['ids'],_[_0xfff6('0xbb')](_0x3d4fc2['body'],[_0xfff6('0xbc'),'id'])||{});}})[_0xfff6('0x1e')](respondWithResult(_0x35a11a,null))[_0xfff6('0x2f')](handleError(_0x35a11a,null));};exports[_0xfff6('0xbd')]=function(_0x5d3280,_0x3612b9){var _0x41f2d5={'raw':![],'where':{}};var _0x716f68={};var _0x5af164={'count':0x0,'rows':[]};return db['MailInteraction'][_0xfff6('0xbe')]({'where':{'id':_0x5d3280['params']['id']}})[_0xfff6('0x1e')](handleEntityNotFound(_0x3612b9,null))[_0xfff6('0x1e')](function(_0x6013be){if(_0x6013be){_0x716f68[_0xfff6('0x35')]=_['keys'](db['MailMessage'][_0xfff6('0x31')]);_0x716f68[_0xfff6('0x37')]=_[_0xfff6('0x38')](_0x5d3280[_0xfff6('0x37')]);_0x716f68['filters']=_[_0xfff6('0x3a')](_0x716f68['model'],_0x716f68[_0xfff6('0x37')]);_0x41f2d5['attributes']=_['intersection'](_0x716f68[_0xfff6('0x35')],qs[_0xfff6('0x3c')](_0x5d3280[_0xfff6('0x37')]['fields']));_0x41f2d5[_0xfff6('0x3b')]=_0x41f2d5[_0xfff6('0x3b')][_0xfff6('0x58')]?_0x41f2d5[_0xfff6('0x3b')]:_0x716f68['model'];if(!_0x5d3280[_0xfff6('0x37')][_0xfff6('0xbf')]('nolimit')){_0x41f2d5[_0xfff6('0x18')]=qs[_0xfff6('0x18')](_0x5d3280['query'][_0xfff6('0x18')]);_0x41f2d5[_0xfff6('0x1a')]=qs['offset'](_0x5d3280[_0xfff6('0x37')][_0xfff6('0x1a')]);}_0x41f2d5[_0xfff6('0x3e')]=qs[_0xfff6('0x3f')](_0x5d3280['query'][_0xfff6('0x3f')]);_0x41f2d5[_0xfff6('0x40')]=qs[_0xfff6('0x39')](_[_0xfff6('0x41')](_0x5d3280[_0xfff6('0x37')],_0x716f68['filters']));_0x41f2d5['where'][_0xfff6('0xac')]=_0x6013be['id'];if(_0x5d3280[_0xfff6('0x37')][_0xfff6('0x7a')]){_0x41f2d5['where']=_[_0xfff6('0x93')](_0x41f2d5[_0xfff6('0x40')],{'$or':_['map'](_0x41f2d5[_0xfff6('0x3b')],function(_0x2bfbbe){var _0x1f3a48={};_0x1f3a48[_0x2bfbbe]={'$like':'%'+_0x5d3280[_0xfff6('0x37')]['filter']+'%'};return _0x1f3a48;})});}if(_0x5d3280[_0xfff6('0x37')][_0xfff6('0x6f')]){var _0x642648=_0x5d3280['query']['$gte'][_0xfff6('0x26')](',');var _0x28b29e={};_0x28b29e[_0x642648[0x0]]={'$gte':moment(_0x642648[0x1])[_0xfff6('0xc0')](_0xfff6('0xc1'))};_0x41f2d5['where']=_[_0xfff6('0x93')](_0x41f2d5[_0xfff6('0x40')],_0x28b29e);}_0x41f2d5=_[_0xfff6('0x93')]({},_0x41f2d5,_0x5d3280[_0xfff6('0xb5')]);return db[_0xfff6('0x29')][_0xfff6('0x19')]({'where':_0x41f2d5['where']})['then'](function(_0x1e14e7){_0x5af164[_0xfff6('0x19')]=_0x1e14e7;if(_0x5d3280['query'][_0xfff6('0xb3')]){_0x41f2d5[_0xfff6('0xb4')]=[{'all':!![]}];}return db[_0xfff6('0x29')][_0xfff6('0xc2')](_0x41f2d5);})[_0xfff6('0x1e')](function(_0x5e657b){if(_0x5d3280[_0xfff6('0x37')][_0xfff6('0xc3')]===_0xfff6('0xc4')){for(var _0x3020b9=0x0;_0x3020b9<_0x5e657b[_0xfff6('0x58')];_0x3020b9++){_0x5e657b[_0x3020b9][_0xfff6('0xb7')]=juice(_0x5e657b[_0x3020b9][_0xfff6('0xb7')]);}}_0x5af164[_0xfff6('0xb1')]=_0x5e657b;return _0x5af164;});}})[_0xfff6('0x1e')](respondWithFilteredResult(_0x3612b9,_0x41f2d5))['catch'](handleError(_0x3612b9,null));};exports[_0xfff6('0xc5')]=function(_0x50e677,_0x4d4b9f){return db[_0xfff6('0x30')]['find']({'where':{'id':_0x50e677['params']['id']}})[_0xfff6('0x1e')](handleEntityNotFound(_0x4d4b9f,null))[_0xfff6('0x1e')](function(_0x5e796e){if(_0x5e796e){return _0x5e796e[_0xfff6('0xc6')](_0x50e677[_0xfff6('0xb7')][_0xfff6('0xbc')],_[_0xfff6('0xbb')](_0x50e677[_0xfff6('0xb7')],[_0xfff6('0xbc'),'id'])||{})[_0xfff6('0xc7')](function(){return db[_0xfff6('0xc8')][_0xfff6('0xc2')]({'attributes':['id',_0xfff6('0x21'),_0xfff6('0x44')],'where':{'id':_0x50e677['body'][_0xfff6('0xbc')]}});})[_0xfff6('0x1e')](function(_0x45fcb7){socket[_0xfff6('0xc9')](_0xfff6('0xca'),{'id':Number(_0x50e677['params']['id']),'tags':_0x45fcb7||[]});return{'id':Number(_0x50e677[_0xfff6('0xb2')]['id']),'tags':_0x45fcb7||[]};});}})[_0xfff6('0x1e')](respondWithResult(_0x4d4b9f,null))[_0xfff6('0x2f')](handleError(_0x4d4b9f,null));};exports[_0xfff6('0xcb')]=function(_0x1ff733,_0x5127b1){return db[_0xfff6('0x30')][_0xfff6('0x68')]({'where':{'id':_0x1ff733[_0xfff6('0xb2')]['id']}})[_0xfff6('0x1e')](handleEntityNotFound(_0x5127b1,null))[_0xfff6('0x1e')](function(_0x5146e9){if(_0x5146e9){return _0x5146e9[_0xfff6('0xcb')](_0x1ff733[_0xfff6('0x37')][_0xfff6('0xbc')]);}})['then'](respondWithStatusCode(_0x5127b1,null))['catch'](handleError(_0x5127b1,null));};exports[_0xfff6('0xcc')]=function(_0x45160b,_0x5bf2bf){var _0x2d64e7=moment()[_0xfff6('0xcd')]()[_0xfff6('0x92')]();var _0x2350e7=path[_0xfff6('0xce')](config[_0xfff6('0xcf')],_0xfff6('0xd0'),_0xfff6('0xd1'),'tmp');var _0x15b026=path[_0xfff6('0xce')](config[_0xfff6('0xcf')],_0xfff6('0xd0'),_0xfff6('0xd1'),_0xfff6('0xd2'));var _0x2ba2d9=path['join'](_0x2350e7,_0x2d64e7);var _0x28c579=util['format'](_0xfff6('0xd3'),_0x45160b['params']['id'],_0x2d64e7);var _0x3bc9be=path[_0xfff6('0xce')](_0x2350e7,_0x28c579);var _0x4409b5=[];if(_0x45160b[_0xfff6('0x37')][_0xfff6('0xd2')]){_0x4409b5['push']({'model':db[_0xfff6('0xd4')],'as':_0xfff6('0xd5'),'raw':!![]});}var _0x364df1=[{'model':db[_0xfff6('0x29')],'as':_0xfff6('0xd6'),'attributes':['id','body',_0xfff6('0x45'),'to','cc',_0xfff6('0xd7'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0xfff6('0x3f')]('id'),'include':_0x4409b5}];return db[_0xfff6('0x30')][_0xfff6('0x68')]({'where':{'id':_0x45160b[_0xfff6('0xb2')]['id']},'include':_0x364df1})[_0xfff6('0x1e')](handleEntityNotFound(_0x5bf2bf,null))[_0xfff6('0x1e')](function(_0x5cdce6){if(_0x5cdce6&&_0x5cdce6['Messages']){var _0xd195e5=_0x5cdce6[_0xfff6('0xd8')]({'plain':!![]});fs[_0xfff6('0xd9')](_0x2ba2d9);return BPromise[_0xfff6('0xda')](_0xd195e5[_0xfff6('0xd6')],function(_0x4175a5,_0x151d30){var _0x3eecf9={'from':_0x4175a5[_0xfff6('0x45')],'to':_0x4175a5['to'],'subject':_0x4175a5[_0xfff6('0xdb')],'html':htmlEntities[_0xfff6('0xdc')](_0x4175a5[_0xfff6('0xb7')]),'headers':{'Date':moment(_0x4175a5[_0xfff6('0xdd')])[_0xfff6('0xc0')](_0xfff6('0xde'))},'attachments':[]};if(_0x4175a5['cc']){_0x3eecf9['headers']['Cc']=_0x4175a5['cc'];}if(_0x4175a5[_0xfff6('0xd7')]){_0x3eecf9['headers']['Bcc']=_0x4175a5[_0xfff6('0xd7')];}return new BPromise(function(_0xc7b578,_0x11a0a2){if(_0x4175a5[_0xfff6('0xd5')]){for(var _0x565f91=0x0;_0x565f91<_0x4175a5[_0xfff6('0xd5')][_0xfff6('0x58')];_0x565f91++){var _0x5f2ba9=_0x4175a5['Attachments'][_0x565f91];var _0xefc468=path[_0xfff6('0xce')](_0x15b026,_0x5f2ba9[_0xfff6('0xdf')]);if(fs['existsSync'](_0xefc468)){_0x3eecf9[_0xfff6('0xd2')][_0xfff6('0xaf')]({'name':_0x5f2ba9[_0xfff6('0x21')],'contentType':_0x5f2ba9['type'],'data':fs[_0xfff6('0xe0')](_0xefc468)});}}}emlformat[_0xfff6('0xe1')](_0x3eecf9,function(_0x1df5d9,_0x44722c){if(_0x1df5d9)return _0x11a0a2(_0x1df5d9);fs[_0xfff6('0xe2')](path[_0xfff6('0xce')](_0x2ba2d9,util['format'](_0xfff6('0xe3'),_0x151d30)),_0x44722c);return _0xc7b578(_0x44722c);});});})['then'](function(){return new BPromise(function(_0x2dd66e,_0xff1ef0){zipdir(_0x2ba2d9,{'saveTo':_0x3bc9be},function(_0x414482,_0x5ebeb6){if(_0x414482)return _0xff1ef0(_0x414482);return _0x2dd66e(_0x5ebeb6);});})[_0xfff6('0x1e')](function(){return new BPromise(function(_0x2c2943,_0x530550){rimraf(_0x2ba2d9,function(_0x229a51){if(_0x229a51)_0x530550(_0x229a51);return _0x2c2943();});});})[_0xfff6('0x1e')](function(){return _0x5bf2bf[_0xfff6('0xcc')](_0x3bc9be,_0x28c579,function(_0x249e65){if(!_0x249e65)fs[_0xfff6('0xe4')](_0x3bc9be);});});});}else{return _0x5bf2bf['sendStatus'](0xc8);}})[_0xfff6('0x2f')](handleError(_0x5bf2bf,null));};
\ No newline at end of file
+var _0x6fbb=['unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','end','status','json','offset','limit','count','set','Content-Range','update','then','destroy','sendStatus','send','fullname','TagIds','Tags','forEach','push','MailMessage','out','plainBody','lastMsgText','trimStart','catch','index','map','MailInteraction','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','select','field','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_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','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','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.UserId','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','all','show','includeAll','include','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','rows','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download'];(function(_0x4244d1,_0x5126d1){var _0xe76461=function(_0xe77502){while(--_0xe77502){_0x4244d1['push'](_0x4244d1['shift']());}};_0xe76461(++_0x5126d1);}(_0x6fbb,0x104));var _0xb6fb=function(_0x24f3d3,_0xb13780){_0x24f3d3=_0x24f3d3-0x0;var _0x2b9655=_0x6fbb[_0x24f3d3];return _0x2b9655;};'use strict';var emlformat=require(_0xb6fb('0x0'));var rimraf=require(_0xb6fb('0x1'));var zipdir=require(_0xb6fb('0x2'));var moment=require('moment');var BPromise=require(_0xb6fb('0x3'));var util=require(_0xb6fb('0x4'));var path=require(_0xb6fb('0x5'));var fs=require('fs');var _=require(_0xb6fb('0x6'));var squel=require('squel');var juice=require('juice');var Redis=require(_0xb6fb('0x7'));var qs=require(_0xb6fb('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')('api');var config=require(_0xb6fb('0x9'));var db=require(_0xb6fb('0xa'))['db'];var htmlEntities=require(_0xb6fb('0xb'));config[_0xb6fb('0xc')]=_['defaults'](config[_0xb6fb('0xc')],{'host':_0xb6fb('0xd'),'port':0x18eb});var socket=require(_0xb6fb('0xe'))(new Redis(config[_0xb6fb('0xc')]));require(_0xb6fb('0xf'))[_0xb6fb('0x10')](socket);function respondWithStatusCode(_0x36ab15,_0x3348c5){_0x3348c5=_0x3348c5||0xcc;return function(_0x1b1dba){if(_0x1b1dba){return _0x36ab15['sendStatus'](_0x3348c5);}return _0x36ab15['status'](_0x3348c5)[_0xb6fb('0x11')]();};}function respondWithResult(_0x2ef767,_0x2be212){_0x2be212=_0x2be212||0xc8;return function(_0x270863){if(_0x270863){return _0x2ef767[_0xb6fb('0x12')](_0x2be212)[_0xb6fb('0x13')](_0x270863);}};}function respondWithFilteredResult(_0x26350c,_0xeacd47){return function(_0xae6a9){if(_0xae6a9){var _0x402b49=typeof _0xeacd47[_0xb6fb('0x14')]==='undefined'&&typeof _0xeacd47[_0xb6fb('0x15')]==='undefined';var _0x52f4e3=_0xae6a9[_0xb6fb('0x16')];var _0xfaf75=_0x402b49?0x0:_0xeacd47['offset'];var _0x2e6cdf=_0x402b49?_0xae6a9[_0xb6fb('0x16')]:_0xeacd47[_0xb6fb('0x14')]+_0xeacd47[_0xb6fb('0x15')];var _0x351a91;if(_0x2e6cdf>=_0x52f4e3){_0x2e6cdf=_0x52f4e3;_0x351a91=0xc8;}else{_0x351a91=0xce;}_0x26350c[_0xb6fb('0x12')](_0x351a91);return _0x26350c[_0xb6fb('0x17')](_0xb6fb('0x18'),_0xfaf75+'-'+_0x2e6cdf+'/'+_0x52f4e3)[_0xb6fb('0x13')](_0xae6a9);}return null;};}function saveUpdates(_0x38f080){return function(_0x347aa0){if(_0x347aa0){return _0x347aa0[_0xb6fb('0x19')](_0x38f080)[_0xb6fb('0x1a')](function(_0xd80c7c){return _0xd80c7c;});}return null;};}function removeEntity(_0xa0be04){return function(_0x661c3c){if(_0x661c3c){return _0x661c3c[_0xb6fb('0x1b')]()[_0xb6fb('0x1a')](function(){_0xa0be04[_0xb6fb('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52c178){return function(_0x270fae){if(!_0x270fae){_0x52c178[_0xb6fb('0x1c')](0x194);}return _0x270fae;};}function handleError(_0x362c6e,_0x31bbdd){_0x31bbdd=_0x31bbdd||0x1f4;return function(_0x1e7387){logger['error'](_0x1e7387['stack']);if(_0x1e7387['name']){delete _0x1e7387['name'];}_0x362c6e[_0xb6fb('0x12')](_0x31bbdd)[_0xb6fb('0x1d')](_0x1e7387);};}function getInteractionUsers(_0x518dc5,_0x446c2a){return new BPromise(function(_0x11c22b,_0x2c09ad){try{if(_0x446c2a[_0x518dc5['id']]){_0x518dc5['Users']=_['map'](_0x446c2a[_0x518dc5['id']],function(_0x3b1775){return{'id':_0x3b1775['id'],'fullname':_0x3b1775[_0xb6fb('0x1e')]};});}}catch(_0xe29855){_0x2c09ad(_0xe29855);}_0x11c22b(_0x518dc5);});}function getInteractionTags(_0x3ab95b,_0x5f361f){return new BPromise(function(_0x296dd0,_0x3be43c){try{if(_0x3ab95b[_0xb6fb('0x1f')]){_0x3ab95b[_0xb6fb('0x20')]=[];_0x3ab95b['TagIds']['split'](',')[_0xb6fb('0x21')](function(_0x582cdb){_0x3ab95b['Tags'][_0xb6fb('0x22')](_0x5f361f[_0x582cdb]);});}delete _0x3ab95b['TagIds'];}catch(_0x584fe7){_0x3be43c(_0x584fe7);}_0x296dd0(_0x3ab95b);});}function getLastMessageText(_0x3d9a0f){return new BPromise(function(_0x1ca783,_0x46da09){return db[_0xb6fb('0x23')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x3d9a0f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb6fb('0x24')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xb6fb('0x1a')](function(_0x152265){if(_0x152265&&_0x152265[_0xb6fb('0x25')]){_0x3d9a0f[_0xb6fb('0x26')]=_[_0xb6fb('0x27')](_0x152265[_0xb6fb('0x25')]);}_0x1ca783(_0x3d9a0f);})[_0xb6fb('0x28')](function(_0x50589e){_0x46da09(_0x50589e);});});}function updateMailInteraction(_0x5ddbb3,_0x53a1eb,_0x13a2f6,_0x23214f){return new BPromise(function(_0x2aa6f5,_0x451be7){return getInteractionUsers(_0x5ddbb3,_0x13a2f6)[_0xb6fb('0x1a')](function(_0x45d9eb){return getInteractionTags(_0x45d9eb,_0x53a1eb);})[_0xb6fb('0x1a')](function(_0x46ec0a){if(_0x23214f){_0x2aa6f5(getLastMessageText(_0x46ec0a));}else{_0x2aa6f5(_0x46ec0a);}})[_0xb6fb('0x28')](function(_0x133cdd){_0x451be7(_0x133cdd);});});}exports[_0xb6fb('0x29')]=function(_0x21d862,_0x51f218){var _0x341b4b={},_0x546f15={},_0x14b550={'count':0x0,'rows':[]};var _0x539eb6=_[_0xb6fb('0x2a')](db[_0xb6fb('0x2b')][_0xb6fb('0x2c')],function(_0x147c29){return{'name':_0x147c29[_0xb6fb('0x2d')],'type':_0x147c29[_0xb6fb('0x2e')]['key']};});_0x546f15[_0xb6fb('0x2f')]=_['map'](_0x539eb6,_0xb6fb('0x30'));_0x546f15[_0xb6fb('0x31')]=_[_0xb6fb('0x32')](_0x21d862[_0xb6fb('0x31')]);_0x546f15[_0xb6fb('0x33')]=_[_0xb6fb('0x34')](_0x546f15[_0xb6fb('0x2f')],_0x546f15[_0xb6fb('0x31')]);_0x341b4b[_0xb6fb('0x35')]=_[_0xb6fb('0x34')](_0x546f15[_0xb6fb('0x2f')],qs[_0xb6fb('0x36')](_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x36')]));_0x341b4b[_0xb6fb('0x35')]=_0x341b4b['attributes'][_0xb6fb('0x37')]?_0x341b4b[_0xb6fb('0x35')]:_0x546f15[_0xb6fb('0x2f')];if(!_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x38')]('nolimit')){_0x341b4b[_0xb6fb('0x15')]=qs['limit'](_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x15')]);_0x341b4b[_0xb6fb('0x14')]=qs[_0xb6fb('0x14')](_0x21d862['query'][_0xb6fb('0x14')]);}_0x341b4b[_0xb6fb('0x39')]=qs['sort'](_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x3a')]);_0x341b4b[_0xb6fb('0x3b')]=qs[_0xb6fb('0x33')](_[_0xb6fb('0x3c')](_0x21d862['query'],_0x546f15[_0xb6fb('0x33')]),_0x539eb6);var _0x260fe9=[];var _0x4f1a8e=squel[_0xb6fb('0x3d')]()[_0xb6fb('0x3e')]('id')[_0xb6fb('0x3e')]('name')[_0xb6fb('0x3e')]('color')[_0xb6fb('0x3f')](_0xb6fb('0x40'));var _0x37a0d2=squel['select']()[_0xb6fb('0x3e')](_0xb6fb('0x41'))[_0xb6fb('0x3e')](_0xb6fb('0x42'))[_0xb6fb('0x3e')](_0xb6fb('0x43'))[_0xb6fb('0x3f')](_0xb6fb('0x44'),'ui')[_0xb6fb('0x45')](_0xb6fb('0x46'),'u',_0xb6fb('0x47'));var _0x338c53=squel[_0xb6fb('0x3d')]()[_0xb6fb('0x3f')](_0xb6fb('0x48'),'i')[_0xb6fb('0x45')](_0xb6fb('0x49'),'c',_0xb6fb('0x4a'))[_0xb6fb('0x45')]('users','o',_0xb6fb('0x4b'))[_0xb6fb('0x45')](_0xb6fb('0x4c'),'a',_0xb6fb('0x4d'))['left_join'](_0xb6fb('0x4e'),'me',_0xb6fb('0x4f'))['left_join'](_0xb6fb('0x50'),'it','it.MailInteractionId\x20=\x20i.id')[_0xb6fb('0x45')]('tools_tags','t',_0xb6fb('0x51'));var _0x1f3f91=squel['expr']();var _0x2463c6=[];var _0x2a9794=squel[_0xb6fb('0x52')]();var _0x2360f4;if(_0x21d862['query'][_0xb6fb('0x53')]){_0x2360f4=as[_0xb6fb('0x54')](_0x21d862['query'][_0xb6fb('0x53')]);var _0x8d4f76=_0x2360f4[_0xb6fb('0x55')];for(var _0x39ee50=0x0;_0x39ee50<_0x2360f4[_0xb6fb('0x56')][_0xb6fb('0x37')];_0x39ee50++){var _0x2d3c48=_0x2360f4[_0xb6fb('0x56')][_0x39ee50];var _0xf789cf='i';var _0x1ea733=_[_0xb6fb('0x57')](_0x539eb6,['name',_0x2d3c48[_0xb6fb('0x3e')]]);if(!_0x1ea733){switch(_0x2d3c48[_0xb6fb('0x3e')]){case _0xb6fb('0x58'):if(_0x2d3c48[_0xb6fb('0x59')]==0x1){_0x338c53[_0xb6fb('0x5a')]('`'+_0x2d3c48[_0xb6fb('0x3e')]+_0xb6fb('0x5b'));}else{_0x338c53[_0xb6fb('0x5a')]('`'+_0x2d3c48[_0xb6fb('0x3e')]+_0xb6fb('0x5c'));}break;case _0xb6fb('0x5d'):if(_0x2d3c48[_0xb6fb('0x5e')]==='$substring'){if(_0x2d3c48[_0xb6fb('0x59')]['split']('\x20')[_0xb6fb('0x37')]>0x1){_0x1f3f91[_0x8d4f76](_0xb6fb('0x5f'),qs[_0xb6fb('0x60')](_0x2d3c48['value']),null);}else{var _0x5afd0b='%'+_0x2d3c48[_0xb6fb('0x59')]+'%';_0x1f3f91[_0x8d4f76](_0xb6fb('0x61'),_0x5afd0b,_0x5afd0b,_0x5afd0b);}}else{_0x1ea733=_[_0xb6fb('0x57')](_0x539eb6,[_0xb6fb('0x30'),'ContactId']);_0x2d3c48['field']=_0xb6fb('0x62');_0xb20675=as[_0xb6fb('0x63')](_0xf789cf,_0x1ea733[_0xb6fb('0x2e')],_0x2d3c48);_0x1f3f91[_0x8d4f76](_0xb20675[_0xb6fb('0x64')],_0xb20675[_0xb6fb('0x59')][_0xb6fb('0x65')],_0xb20675['value'][_0xb6fb('0x11')]);}break;case _0xb6fb('0x66'):var _0x7e5a20=_0x2d3c48[_0xb6fb('0x59')]['split'](',')[_0xb6fb('0x2a')](function(_0x366677){return Number(_0x366677);});_0x7e5a20[_0xb6fb('0x21')](function(_0x340f2d){_0x2a9794['or'](_0xb6fb('0x67'),'%,'+_0x340f2d+',%');});_0x2463c6=_[_0xb6fb('0x68')](_0x2463c6,_0x7e5a20);break;case'User':if(_0x2d3c48['operator']===_0xb6fb('0x69')){_0x1f3f91[_0x8d4f76](_0xb6fb('0x6a'),'%'+_0x2d3c48[_0xb6fb('0x59')]+'%',null);}else{_0x1ea733=_['find'](_0x539eb6,[_0xb6fb('0x30'),'UserId']);_0x2d3c48['field']=_0xb6fb('0x6b');_0xb20675=as[_0xb6fb('0x63')](_0xf789cf,_0x1ea733[_0xb6fb('0x2e')],_0x2d3c48);_0x1f3f91[_0x8d4f76](_0xb20675[_0xb6fb('0x64')],_0xb20675[_0xb6fb('0x59')][_0xb6fb('0x65')],_0xb20675[_0xb6fb('0x59')][_0xb6fb('0x11')]);}break;case _0xb6fb('0x25'):_0xb20675=as[_0xb6fb('0x63')]('me',null,_0x2d3c48);_0x1f3f91[_0x8d4f76](_0xb20675['text'],_0xb20675['value']['start'],_0xb20675['value'][_0xb6fb('0x11')]);break;}}else{var _0xb20675=as[_0xb6fb('0x63')](_0xf789cf,_0x1ea733['type'],_0x2d3c48);_0x1f3f91[_0x8d4f76](_0xb20675[_0xb6fb('0x64')],_0xb20675[_0xb6fb('0x59')]['start'],_0xb20675[_0xb6fb('0x59')]['end']);}}}else{var _0x4e9a78=_(_0x21d862[_0xb6fb('0x31')])[_0xb6fb('0x32')]()[_0xb6fb('0x2a')](function(_0x4a0c03){return _[_0xb6fb('0x6c')](_0x539eb6,[_0xb6fb('0x30'),_0x4a0c03])?_0x4a0c03:undefined;})[_0xb6fb('0x6d')]()[_0xb6fb('0x59')]();if(!_[_0xb6fb('0x6e')](_0x4e9a78)){_0x4e9a78[_0xb6fb('0x21')](function(_0xa2fdbe){if(_0xa2fdbe===_0xb6fb('0x6f')){_0x338c53[_0xb6fb('0x3b')](_0xb6fb('0x70'),[][_0xb6fb('0x71')](_0x21d862[_0xb6fb('0x31')][_0xa2fdbe]));}else if(_0xa2fdbe===_0xb6fb('0x72')){var _0x5684ef=JSON['parse'](_0x21d862[_0xb6fb('0x31')][_0xa2fdbe])[_0xb6fb('0x73')];var _0x571c6e=JSON['parse'](_0x21d862[_0xb6fb('0x31')][_0xa2fdbe])[_0xb6fb('0x74')];_0x338c53['where'](_0xb6fb('0x75'),_0x5684ef,_0x571c6e);}else{if(_0x21d862['query'][_0xa2fdbe]===_0xb6fb('0x76')){_0x338c53['where']('i.'+_0xa2fdbe+_0xb6fb('0x77'));}else{_0x338c53[_0xb6fb('0x3b')]('i.'+_0xa2fdbe+_0xb6fb('0x78'),_0x21d862['query'][_0xa2fdbe]);}}});}if(_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x79')]){if(_0x21d862['query'][_0xb6fb('0x79')]==0x1){_0x338c53[_0xb6fb('0x5a')](_0xb6fb('0x7a'));}else{_0x338c53[_0xb6fb('0x5a')](_0xb6fb('0x7b'));}}if(_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x7c')]){_0x2463c6=_['isArray'](_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x7c')])?_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x7c')]:new Array(_0x21d862[_0xb6fb('0x31')]['tag']);_0x2463c6[_0xb6fb('0x21')](function(_0x16be54){_0x2a9794['or'](_0xb6fb('0x67'),'%,'+_0x16be54+',%');});}if(_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x7d')]){var _0x1aa34d=_0x21d862[_0xb6fb('0x31')]['filter'][_0xb6fb('0x7e')]('\x5c','\x5c\x5c')[_0xb6fb('0x7e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1aa34d)){_0x1f3f91['or'](_0xb6fb('0x7f'),_0x1aa34d+'%');}else if(qs[_0xb6fb('0x80')](_0x1aa34d)){_0x1f3f91['or'](_0xb6fb('0x81'),_0x1aa34d+'%');}else{_0x1f3f91['or'](_0xb6fb('0x82'),qs[_0xb6fb('0x60')](_0x1aa34d))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb6fb('0x60')](_0x1aa34d));}}}_0x338c53['where'](_0x1f3f91);_0x338c53[_0xb6fb('0x83')](_0xb6fb('0x84'));var _0x40f6c2={'type':db[_0xb6fb('0x85')][_0xb6fb('0x86')]['SELECT'],'raw':!![]};var _0x49cbb4=_0x338c53[_0xb6fb('0x87')]();_0x49cbb4[_0xb6fb('0x3e')](_0xb6fb('0x84'));_0x49cbb4[_0xb6fb('0x3e')](_0xb6fb('0x88'),_0xb6fb('0x58'));if(_0x341b4b[_0xb6fb('0x39')]){_0x341b4b[_0xb6fb('0x39')][_0xb6fb('0x21')](function(_0x3bf734){var _0x1e13ac=_0x3bf734[0x0]===_0xb6fb('0x89')?_0x3bf734[0x0]:'i.'+_0x3bf734[0x0];_0x338c53['order'](_0x1e13ac,_0x3bf734[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb6fb('0x6e')](_0x2463c6)){_0x338c53['having'](_0x2a9794);_0x49cbb4['where']('t.id\x20IN\x20?',_0x2463c6);}BPromise[_0xb6fb('0x8a')]()['then'](function(){if(!_0x2360f4){if(_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x6f')])return;_0x49cbb4[_0xb6fb('0x3b')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x338c53['where'](_0xb6fb('0x8b'));return;}if(_0x21d862[_0xb6fb('0x8c')]['role']!==_0xb6fb('0x8d'))return;return _0x21d862['user'][_0xb6fb('0x8e')]({'attributes':['id'],'raw':!![]})[_0xb6fb('0x1a')](function(_0x27a148){if(_[_0xb6fb('0x6e')](_0x27a148)){_0x49cbb4[_0xb6fb('0x3b')](_0xb6fb('0x8f'));_0x338c53[_0xb6fb('0x3b')](_0xb6fb('0x8f'));}else{_0x49cbb4[_0xb6fb('0x3b')](_0xb6fb('0x70'),_['map'](_0x27a148,'id'));_0x338c53['where'](_0xb6fb('0x70'),_['map'](_0x27a148,'id'));}});})[_0xb6fb('0x1a')](function(){if(_0x21d862[_0xb6fb('0x8c')][_0xb6fb('0x90')]===_0xb6fb('0x8d')&&!_0x2360f4&&!_0x21d862[_0xb6fb('0x31')]['MailAccountId'])return[];return db[_0xb6fb('0x91')][_0xb6fb('0x31')](_0x49cbb4[_0xb6fb('0x92')](),_0x40f6c2);})[_0xb6fb('0x1a')](function(_0x4b2000){_0x14b550['count']=_0x4b2000['length'];if(_0x14b550['count']===0x0)return[];return db[_0xb6fb('0x91')][_0xb6fb('0x31')](_0x4f1a8e[_0xb6fb('0x92')](),_0x40f6c2)[_0xb6fb('0x1a')](function(_0x75b17b){_0x260fe9=_[_0xb6fb('0x93')](_0x75b17b,'id');_0x40f6c2=_[_0xb6fb('0x94')](_0x40f6c2,{'model':db[_0xb6fb('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x21d862['query']['fields']){_0x341b4b[_0xb6fb('0x35')][_0xb6fb('0x21')](function(_0x1fb061){_0x338c53[_0xb6fb('0x3e')]('i.'+_0x1fb061);});}else{_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x88'),_0xb6fb('0x58'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x95'),_0xb6fb('0x96'));_0x338c53['field'](_0xb6fb('0x97'),_0xb6fb('0x98'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x99'),'contactName');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x84'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9a'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9b'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9c'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9d'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9e'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9f'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa0'));_0x338c53[_0xb6fb('0x3e')]('i.subject');_0x338c53['field'](_0xb6fb('0xa1'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa2'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa3'));_0x338c53[_0xb6fb('0x3e')]('i.substatus');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa4'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa5'));_0x338c53['field']('i.MailAccountId');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa6'));_0x338c53['field']('c.firstName','Contact.firstName');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa7'),_0xb6fb('0xa8'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa9'),_0xb6fb('0xaa'));_0x338c53['field'](_0xb6fb('0xab'),_0xb6fb('0xac'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xad'),_0xb6fb('0xae'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xaf'),_0xb6fb('0xb0'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xb1'),'Owner.fullname');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xb2'),'Owner.internal');_0x338c53[_0xb6fb('0x3e')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x341b4b[_0xb6fb('0x15')])_0x338c53[_0xb6fb('0x15')](_0x341b4b['limit']);if(_0x341b4b[_0xb6fb('0x14')])_0x338c53['offset'](_0x341b4b['offset']);return db['sequelize'][_0xb6fb('0x31')](_0x338c53[_0xb6fb('0x92')](),_0x40f6c2);})['then'](function(_0xe18660){if(_0xe18660[_0xb6fb('0x37')]>0x0)_0x37a0d2[_0xb6fb('0x3b')](_0xb6fb('0xb3'),_[_0xb6fb('0x2a')](_0xe18660,'id'));return db[_0xb6fb('0x91')][_0xb6fb('0x31')](_0x37a0d2[_0xb6fb('0x92')](),_0x40f6c2)[_0xb6fb('0x1a')](function(_0x1c2395){var _0x1a8b19=_['groupBy'](_0x1c2395,_0xb6fb('0xb4'));var _0x4ada67=[];return db[_0xb6fb('0xb5')]['findOne']({'attributes':[_0xb6fb('0xb6')],'raw':!![]})[_0xb6fb('0x1a')](function(_0x53e28d){var _0x244b40=_0x53e28d['enableEmailPreview'];_0xe18660['forEach'](function(_0x283e4a){_0x4ada67[_0xb6fb('0x22')](updateMailInteraction(_0x283e4a,_0x260fe9,_0x1a8b19,_0x244b40));});return BPromise[_0xb6fb('0xb7')](_0x4ada67);});});});})[_0xb6fb('0x1a')](function(_0x7e7164){_0x14b550['rows']=_0x7e7164;return _0x14b550;})[_0xb6fb('0x1a')](respondWithFilteredResult(_0x51f218,_0x341b4b))[_0xb6fb('0x28')](handleError(_0x51f218,null));};exports[_0xb6fb('0xb8')]=function(_0x24c413,_0xc38514){var _0x3100a2={'raw':![],'where':{'id':_0x24c413['params']['id']}},_0x44d61b={};_0x44d61b[_0xb6fb('0x2f')]=_[_0xb6fb('0x32')](db[_0xb6fb('0x2b')][_0xb6fb('0x2c')]);_0x44d61b[_0xb6fb('0x31')]=_[_0xb6fb('0x32')](_0x24c413[_0xb6fb('0x31')]);_0x44d61b[_0xb6fb('0x33')]=_[_0xb6fb('0x34')](_0x44d61b['model'],_0x44d61b[_0xb6fb('0x31')]);_0x3100a2[_0xb6fb('0x35')]=_[_0xb6fb('0x34')](_0x44d61b[_0xb6fb('0x2f')],qs[_0xb6fb('0x36')](_0x24c413[_0xb6fb('0x31')][_0xb6fb('0x36')]));_0x3100a2[_0xb6fb('0x35')]=_0x3100a2[_0xb6fb('0x35')][_0xb6fb('0x37')]?_0x3100a2[_0xb6fb('0x35')]:_0x44d61b[_0xb6fb('0x2f')];if(_0x24c413[_0xb6fb('0x31')][_0xb6fb('0xb9')]){_0x3100a2[_0xb6fb('0xba')]=[{'all':!![]}];}_0x3100a2=_[_0xb6fb('0x94')]({},_0x3100a2,_0x24c413['options']);return db[_0xb6fb('0x2b')][_0xb6fb('0x57')](_0x3100a2)[_0xb6fb('0x1a')](handleEntityNotFound(_0xc38514,null))[_0xb6fb('0x1a')](respondWithResult(_0xc38514,null))[_0xb6fb('0x28')](handleError(_0xc38514,null));};exports[_0xb6fb('0xbb')]=function(_0x48ddc5,_0x3d073a){return db[_0xb6fb('0x2b')][_0xb6fb('0xbb')](_0x48ddc5[_0xb6fb('0xbc')],{})[_0xb6fb('0x1a')](respondWithResult(_0x3d073a,0xc9))[_0xb6fb('0x28')](handleError(_0x3d073a,null));};exports[_0xb6fb('0x19')]=function(_0xceb05d,_0x4d4a39){if(_0xceb05d[_0xb6fb('0xbc')]['id']){delete _0xceb05d[_0xb6fb('0xbc')]['id'];}return db[_0xb6fb('0x2b')]['find']({'where':{'id':_0xceb05d[_0xb6fb('0xbd')]['id']}})['then'](handleEntityNotFound(_0x4d4a39,null))[_0xb6fb('0x1a')](saveUpdates(_0xceb05d['body'],null))[_0xb6fb('0x1a')](respondWithResult(_0x4d4a39,null))[_0xb6fb('0x28')](handleError(_0x4d4a39,null));};exports[_0xb6fb('0x1b')]=function(_0x14a6e3,_0x22d7f6){return db['MailInteraction'][_0xb6fb('0x57')]({'where':{'id':_0x14a6e3['params']['id']}})[_0xb6fb('0x1a')](handleEntityNotFound(_0x22d7f6,null))[_0xb6fb('0x1a')](removeEntity(_0x22d7f6,null))[_0xb6fb('0x28')](handleError(_0x22d7f6,null));};exports[_0xb6fb('0xbe')]=function(_0x55c573,_0x17eaf8){return db[_0xb6fb('0x2b')][_0xb6fb('0xbe')]()[_0xb6fb('0x1a')](respondWithResult(_0x17eaf8,null))['catch'](handleError(_0x17eaf8,null));};exports[_0xb6fb('0xbf')]=function(_0x4f52dd,_0x439ec3){return db[_0xb6fb('0x23')][_0xb6fb('0x57')]({'where':{'id':_0x4f52dd[_0xb6fb('0xbd')]['id']}})[_0xb6fb('0x1a')](handleEntityNotFound(_0x439ec3,null))[_0xb6fb('0x1a')](function(_0x3a6b76){if(_0x3a6b76){return _0x3a6b76[_0xb6fb('0xbf')](_0x4f52dd[_0xb6fb('0xbc')][_0xb6fb('0xc0')],_[_0xb6fb('0xc1')](_0x4f52dd['body'],[_0xb6fb('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x439ec3,null))[_0xb6fb('0x28')](handleError(_0x439ec3,null));};exports[_0xb6fb('0xc2')]=function(_0x48209f,_0x42dcd2){var _0x799a0d={'raw':![],'where':{}};var _0x54e978={};var _0x12c637={'count':0x0,'rows':[]};return db['MailInteraction'][_0xb6fb('0xc3')]({'where':{'id':_0x48209f['params']['id']}})[_0xb6fb('0x1a')](handleEntityNotFound(_0x42dcd2,null))[_0xb6fb('0x1a')](function(_0x447824){if(_0x447824){_0x54e978[_0xb6fb('0x2f')]=_[_0xb6fb('0x32')](db[_0xb6fb('0x23')][_0xb6fb('0x2c')]);_0x54e978['query']=_['keys'](_0x48209f[_0xb6fb('0x31')]);_0x54e978[_0xb6fb('0x33')]=_[_0xb6fb('0x34')](_0x54e978[_0xb6fb('0x2f')],_0x54e978[_0xb6fb('0x31')]);_0x799a0d['attributes']=_[_0xb6fb('0x34')](_0x54e978[_0xb6fb('0x2f')],qs[_0xb6fb('0x36')](_0x48209f['query'][_0xb6fb('0x36')]));_0x799a0d[_0xb6fb('0x35')]=_0x799a0d[_0xb6fb('0x35')][_0xb6fb('0x37')]?_0x799a0d[_0xb6fb('0x35')]:_0x54e978[_0xb6fb('0x2f')];if(!_0x48209f[_0xb6fb('0x31')]['hasOwnProperty'](_0xb6fb('0xc4'))){_0x799a0d[_0xb6fb('0x15')]=qs[_0xb6fb('0x15')](_0x48209f[_0xb6fb('0x31')]['limit']);_0x799a0d[_0xb6fb('0x14')]=qs[_0xb6fb('0x14')](_0x48209f[_0xb6fb('0x31')]['offset']);}_0x799a0d[_0xb6fb('0x39')]=qs[_0xb6fb('0x3a')](_0x48209f['query'][_0xb6fb('0x3a')]);_0x799a0d[_0xb6fb('0x3b')]=qs[_0xb6fb('0x33')](_[_0xb6fb('0x3c')](_0x48209f['query'],_0x54e978[_0xb6fb('0x33')]));_0x799a0d[_0xb6fb('0x3b')][_0xb6fb('0xb4')]=_0x447824['id'];if(_0x48209f[_0xb6fb('0x31')]['filter']){_0x799a0d['where']=_[_0xb6fb('0x94')](_0x799a0d[_0xb6fb('0x3b')],{'$or':_[_0xb6fb('0x2a')](_0x799a0d[_0xb6fb('0x35')],function(_0x3b61aa){var _0x50193a={};_0x50193a[_0x3b61aa]={'$like':'%'+_0x48209f['query'][_0xb6fb('0x7d')]+'%'};return _0x50193a;})});}if(_0x48209f[_0xb6fb('0x31')][_0xb6fb('0x73')]){var _0x539245=_0x48209f[_0xb6fb('0x31')]['$gte']['split'](',');var _0x715d8a={};_0x715d8a[_0x539245[0x0]]={'$gte':moment(_0x539245[0x1])[_0xb6fb('0xc5')](_0xb6fb('0xc6'))};_0x799a0d['where']=_['merge'](_0x799a0d['where'],_0x715d8a);}_0x799a0d=_['merge']({},_0x799a0d,_0x48209f[_0xb6fb('0xc7')]);return db[_0xb6fb('0x23')][_0xb6fb('0x16')]({'where':_0x799a0d[_0xb6fb('0x3b')]})['then'](function(_0x4649b7){_0x12c637[_0xb6fb('0x16')]=_0x4649b7;if(_0x48209f[_0xb6fb('0x31')][_0xb6fb('0xb9')]){_0x799a0d[_0xb6fb('0xba')]=[{'all':!![]}];}return db[_0xb6fb('0x23')][_0xb6fb('0xc8')](_0x799a0d);})[_0xb6fb('0x1a')](function(_0x23311c){if(_0x48209f[_0xb6fb('0x31')][_0xb6fb('0xc9')]===_0xb6fb('0xca')){for(var _0x2e90a8=0x0;_0x2e90a8<_0x23311c['length'];_0x2e90a8++){_0x23311c[_0x2e90a8][_0xb6fb('0xbc')]=juice(_0x23311c[_0x2e90a8][_0xb6fb('0xbc')]);}}_0x12c637[_0xb6fb('0xcb')]=_0x23311c;return _0x12c637;});}})['then'](respondWithFilteredResult(_0x42dcd2,_0x799a0d))[_0xb6fb('0x28')](handleError(_0x42dcd2,null));};exports[_0xb6fb('0xcc')]=function(_0x3d711d,_0x50a6c5){return db[_0xb6fb('0x2b')]['find']({'where':{'id':_0x3d711d[_0xb6fb('0xbd')]['id']}})[_0xb6fb('0x1a')](handleEntityNotFound(_0x50a6c5,null))['then'](function(_0x194acd){if(_0x194acd){return _0x194acd[_0xb6fb('0xcd')](_0x3d711d[_0xb6fb('0xbc')][_0xb6fb('0xc0')],_[_0xb6fb('0xc1')](_0x3d711d[_0xb6fb('0xbc')],['ids','id'])||{})[_0xb6fb('0xce')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb6fb('0x30'),_0xb6fb('0xcf')],'where':{'id':_0x3d711d['body']['ids']}});})['then'](function(_0x1865f3){socket[_0xb6fb('0xd0')](_0xb6fb('0xd1'),{'id':Number(_0x3d711d[_0xb6fb('0xbd')]['id']),'tags':_0x1865f3||[]});return{'id':Number(_0x3d711d[_0xb6fb('0xbd')]['id']),'tags':_0x1865f3||[]};});}})[_0xb6fb('0x1a')](respondWithResult(_0x50a6c5,null))[_0xb6fb('0x28')](handleError(_0x50a6c5,null));};exports[_0xb6fb('0xd2')]=function(_0xfc2b93,_0x516527){return db[_0xb6fb('0x2b')][_0xb6fb('0x57')]({'where':{'id':_0xfc2b93[_0xb6fb('0xbd')]['id']}})['then'](handleEntityNotFound(_0x516527,null))['then'](function(_0x4056c4){if(_0x4056c4){return _0x4056c4['removeTags'](_0xfc2b93['query'][_0xb6fb('0xc0')]);}})[_0xb6fb('0x1a')](respondWithStatusCode(_0x516527,null))[_0xb6fb('0x28')](handleError(_0x516527,null));};exports[_0xb6fb('0xd3')]=function(_0x4264ae,_0x3415e7){var _0x409ac6=moment()[_0xb6fb('0xd4')]()['toString']();var _0x454271=path[_0xb6fb('0xd5')](config['root'],_0xb6fb('0xd6'),_0xb6fb('0xd7'),_0xb6fb('0xd8'));var _0x581400=path['join'](config[_0xb6fb('0xd9')],'server','files',_0xb6fb('0xda'));var _0x5a3a6e=path[_0xb6fb('0xd5')](_0x454271,_0x409ac6);var _0x483388=util['format'](_0xb6fb('0xdb'),_0x4264ae[_0xb6fb('0xbd')]['id'],_0x409ac6);var _0x302b8b=path[_0xb6fb('0xd5')](_0x454271,_0x483388);var _0x559aa6=[];if(_0x4264ae[_0xb6fb('0x31')][_0xb6fb('0xda')]){_0x559aa6[_0xb6fb('0x22')]({'model':db[_0xb6fb('0xdc')],'as':'Attachments','raw':!![]});}var _0x460100=[{'model':db[_0xb6fb('0x23')],'as':_0xb6fb('0xdd'),'attributes':['id',_0xb6fb('0xbc'),_0xb6fb('0x3f'),'to','cc',_0xb6fb('0xde'),_0xb6fb('0xdf'),_0xb6fb('0x72')],'where':{'secret':![]},'order':qs[_0xb6fb('0x3a')]('id'),'include':_0x559aa6}];return db[_0xb6fb('0x2b')][_0xb6fb('0x57')]({'where':{'id':_0x4264ae[_0xb6fb('0xbd')]['id']},'include':_0x460100})[_0xb6fb('0x1a')](handleEntityNotFound(_0x3415e7,null))['then'](function(_0x5e55ba){if(_0x5e55ba&&_0x5e55ba[_0xb6fb('0xdd')]){var _0x5ef87d=_0x5e55ba['get']({'plain':!![]});fs['mkdirSync'](_0x5a3a6e);return BPromise[_0xb6fb('0xe0')](_0x5ef87d[_0xb6fb('0xdd')],function(_0x4d06cd,_0x534f5d){var _0x2d3997={'from':_0x4d06cd[_0xb6fb('0x3f')],'to':_0x4d06cd['to'],'subject':_0x4d06cd[_0xb6fb('0xdf')],'html':htmlEntities[_0xb6fb('0xe1')](_0x4d06cd[_0xb6fb('0xbc')]),'headers':{'Date':moment(_0x4d06cd[_0xb6fb('0x72')])['format'](_0xb6fb('0xe2'))},'attachments':[]};if(_0x4d06cd['cc']){_0x2d3997['headers']['Cc']=_0x4d06cd['cc'];}if(_0x4d06cd[_0xb6fb('0xde')]){_0x2d3997[_0xb6fb('0xe3')][_0xb6fb('0xe4')]=_0x4d06cd[_0xb6fb('0xde')];}return new BPromise(function(_0x12e5a1,_0x22ce5f){if(_0x4d06cd[_0xb6fb('0xe5')]){for(var _0x2f77be=0x0;_0x2f77be<_0x4d06cd[_0xb6fb('0xe5')][_0xb6fb('0x37')];_0x2f77be++){var _0x4043a3=_0x4d06cd['Attachments'][_0x2f77be];var _0x2960a3=path[_0xb6fb('0xd5')](_0x581400,_0x4043a3[_0xb6fb('0xe6')]);if(fs[_0xb6fb('0xe7')](_0x2960a3)){_0x2d3997[_0xb6fb('0xda')][_0xb6fb('0x22')]({'name':_0x4043a3[_0xb6fb('0x30')],'contentType':_0x4043a3[_0xb6fb('0x2e')],'data':fs['readFileSync'](_0x2960a3)});}}}emlformat[_0xb6fb('0xe8')](_0x2d3997,function(_0x3812c9,_0x5baf7d){if(_0x3812c9)return _0x22ce5f(_0x3812c9);fs[_0xb6fb('0xe9')](path[_0xb6fb('0xd5')](_0x5a3a6e,util['format'](_0xb6fb('0xea'),_0x534f5d)),_0x5baf7d);return _0x12e5a1(_0x5baf7d);});});})[_0xb6fb('0x1a')](function(){return new BPromise(function(_0x101de7,_0x14144c){zipdir(_0x5a3a6e,{'saveTo':_0x302b8b},function(_0x5f33db,_0x221d67){if(_0x5f33db)return _0x14144c(_0x5f33db);return _0x101de7(_0x221d67);});})[_0xb6fb('0x1a')](function(){return new BPromise(function(_0x308177,_0x41e59f){rimraf(_0x5a3a6e,function(_0x10422a){if(_0x10422a)_0x41e59f(_0x10422a);return _0x308177();});});})[_0xb6fb('0x1a')](function(){return _0x3415e7[_0xb6fb('0xd3')](_0x302b8b,_0x483388,function(_0x179c4c){if(!_0x179c4c)fs[_0xb6fb('0xeb')](_0x302b8b);});});});}else{return _0x3415e7['sendStatus'](0xc8);}})[_0xb6fb('0x28')](handleError(_0x3415e7,null));};
\ No newline at end of file
index 70bd850..c1d7c46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8781=['getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8781,0x1de));var _0x1878=function(_0x291a8f,_0x46d0de){_0x291a8f=_0x291a8f-0x0;var _0x5d1b76=_0x8781[_0x291a8f];return _0x5d1b76;};'use strict';var EventEmitter=require(_0x1878('0x0'));var MailInteraction=require(_0x1878('0x1'))['db'][_0x1878('0x2')];var MailMessage=require(_0x1878('0x1'))['db'][_0x1878('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1878('0x4')](0x0);var events={'afterCreate':_0x1878('0x5'),'afterUpdate':_0x1878('0x6'),'afterDestroy':_0x1878('0x7')};function emitEvent(_0x18d7a4){return function(_0x5a0cb2,_0x7e71d1,_0x2cbfe0){_0x5a0cb2[_0x1878('0x8')]({'attributes':['id'],'raw':!![]})[_0x1878('0x9')](function(_0x14a74e){_0x5a0cb2[_0x1878('0xa')](_0x1878('0xb'),_0x14a74e['map'](function(_0x405ca2){return{'id':_0x405ca2['id']};}));return MailMessage[_0x1878('0xc')]({'where':{'MailInteractionId':_0x5a0cb2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1878('0x9')](function(_0x27f171){_0x5a0cb2[_0x1878('0xa')](_0x1878('0xd'),_0x27f171['length']);MailInteractionEvents[_0x1878('0xe')](_0x18d7a4+':'+_0x5a0cb2['id'],_0x5a0cb2);MailInteractionEvents[_0x1878('0xe')](_0x18d7a4,_0x5a0cb2);_0x2cbfe0(null);})[_0x1878('0xf')](_0x2cbfe0(null));};}for(var e in events){if(events[_0x1878('0x10')](e)){var event=events[e];MailInteraction[_0x1878('0x11')](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
+var _0xa5a4=['setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction'];(function(_0xbbf4e1,_0x556824){var _0x40c2fc=function(_0x21a764){while(--_0x21a764){_0xbbf4e1['push'](_0xbbf4e1['shift']());}};_0x40c2fc(++_0x556824);}(_0xa5a4,0x1c5));var _0x4a5a=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xa5a4[_0x271060];return _0x40540b;};'use strict';var EventEmitter=require(_0x4a5a('0x0'));var MailInteraction=require(_0x4a5a('0x1'))['db'][_0x4a5a('0x2')];var MailMessage=require(_0x4a5a('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4a5a('0x3')](0x0);var events={'afterCreate':_0x4a5a('0x4'),'afterUpdate':_0x4a5a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x193e41){return function(_0x3ca5b5,_0xa3eab0,_0x47c034){_0x3ca5b5[_0x4a5a('0x6')]({'attributes':['id'],'raw':!![]})[_0x4a5a('0x7')](function(_0x287b08){_0x3ca5b5[_0x4a5a('0x8')](_0x4a5a('0x9'),_0x287b08[_0x4a5a('0xa')](function(_0x5bc9f0){return{'id':_0x5bc9f0['id']};}));return MailMessage[_0x4a5a('0xb')]({'where':{'MailInteractionId':_0x3ca5b5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4a5a('0x7')](function(_0x121bc8){_0x3ca5b5['setDataValue'](_0x4a5a('0xc'),_0x121bc8[_0x4a5a('0xd')]);MailInteractionEvents['emit'](_0x193e41+':'+_0x3ca5b5['id'],_0x3ca5b5);MailInteractionEvents[_0x4a5a('0xe')](_0x193e41,_0x3ca5b5);_0x47c034(null);})[_0x4a5a('0xf')](_0x47c034(null));};}for(var e in events){if(events[_0x4a5a('0x10')](e)){var event=events[e];MailInteraction[_0x4a5a('0x11')](e,emitEvent(event));}}module[_0x4a5a('0x12')]=MailInteractionEvents;
\ No newline at end of file
index a2641bb..3cf1f1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ef8=['substatus','models','get','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','MailInteraction','fti_mail_interactions','subject','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed'];(function(_0x400596,_0x556a9b){var _0xf2abaa=function(_0x4834e5){while(--_0x4834e5){_0x400596['push'](_0x400596['shift']());}};_0xf2abaa(++_0x556a9b);}(_0x1ef8,0x18c));var _0x81ef=function(_0x86bef3,_0xc2953b){_0x86bef3=_0x86bef3-0x0;var _0x302aae=_0x1ef8[_0x86bef3];return _0x302aae;};'use strict';var _=require('lodash');var util=require(_0x81ef('0x0'));var logger=require(_0x81ef('0x1'))(_0x81ef('0x2'));var moment=require(_0x81ef('0x3'));var BPromise=require(_0x81ef('0x4'));var rp=require(_0x81ef('0x5'));var fs=require('fs');var path=require(_0x81ef('0x6'));var rimraf=require(_0x81ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x81ef('0x8'));module['exports']=function(_0x272875,_0x1ba2c5){return _0x272875['define'](_0x81ef('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x81ef('0xa'),'fields':[_0x81ef('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ffcab,_0x221386,_0x19c496){if(_0x2ffcab['substatus']){_0x2ffcab[_0x81ef('0xc')]=moment()['format'](_0x81ef('0xd'));}if(_0x2ffcab[_0x81ef('0xe')]){_0x2ffcab[_0x81ef('0xf')]=moment()[_0x81ef('0x10')](_0x81ef('0xd'));}_0x19c496(null,_0x221386);},'beforeUpdate':function(_0x114875,_0x1578c3,_0x40f73a){if(_0x114875[_0x81ef('0x11')](_0x81ef('0x12'))){_0x114875[_0x81ef('0xc')]=_0x114875[_0x81ef('0x12')]?moment()[_0x81ef('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x114875[_0x81ef('0x11')](_0x81ef('0xe'))){_0x114875['closedAt']=moment()[_0x81ef('0x10')](_0x81ef('0xd'));_0x114875[_0x81ef('0x12')]=null;_0x114875[_0x81ef('0xc')]=null;}_0x40f73a(null,_0x114875);},'afterUpdate':function(_0x1c26f8,_0x1474b4,_0x565b8b){var _0xcf2304=_0x272875[_0x81ef('0x13')];var _0x554b36=_0x1c26f8[_0x81ef('0x14')]({'plain':!![]});if(_0x554b36[_0x81ef('0xe')]){return _0xcf2304['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x554b36['id']}})['then'](function(){_0x565b8b();})[_0x81ef('0x15')](function(_0x229c41){_0x565b8b(_0x229c41);});}else{_0x565b8b();}}},'charset':'utf8mb4','collate':_0x81ef('0x16')});};
\ No newline at end of file
+var _0x7d84=['update','then','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','MailMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7d84,0xa0));var _0x47d8=function(_0x292bab,_0x18b725){_0x292bab=_0x292bab-0x0;var _0x3a1de1=_0x7d84[_0x292bab];return _0x3a1de1;};'use strict';var _=require('lodash');var util=require(_0x47d8('0x0'));var logger=require(_0x47d8('0x1'))(_0x47d8('0x2'));var moment=require(_0x47d8('0x3'));var BPromise=require(_0x47d8('0x4'));var rp=require(_0x47d8('0x5'));var fs=require('fs');var path=require(_0x47d8('0x6'));var rimraf=require('rimraf');var config=require(_0x47d8('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x47d8('0x8')]=function(_0x2a39b1,_0x513f75){return _0x2a39b1[_0x47d8('0x9')]('MailInteraction',attributes,{'tableName':_0x47d8('0xa'),'paranoid':![],'indexes':[{'name':_0x47d8('0xb'),'fields':[_0x47d8('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4d228b,_0xa81fdd,_0x83c154){if(_0x4d228b[_0x47d8('0xd')]){_0x4d228b[_0x47d8('0xe')]=moment()[_0x47d8('0xf')](_0x47d8('0x10'));}if(_0x4d228b[_0x47d8('0x11')]){_0x4d228b[_0x47d8('0x12')]=moment()[_0x47d8('0xf')](_0x47d8('0x10'));}_0x83c154(null,_0xa81fdd);},'beforeUpdate':function(_0x55600a,_0x5d34c4,_0x452cf3){if(_0x55600a[_0x47d8('0x13')](_0x47d8('0xd'))){_0x55600a[_0x47d8('0xe')]=_0x55600a[_0x47d8('0xd')]?moment()['format'](_0x47d8('0x10')):null;}if(_0x55600a[_0x47d8('0x13')](_0x47d8('0x11'))){_0x55600a[_0x47d8('0x12')]=moment()[_0x47d8('0xf')](_0x47d8('0x10'));_0x55600a[_0x47d8('0xd')]=null;_0x55600a[_0x47d8('0xe')]=null;}_0x452cf3(null,_0x55600a);},'afterUpdate':function(_0x1ca50f,_0x1cd087,_0xdeab61){var _0x1bafe3=_0x2a39b1['models'];var _0x195e53=_0x1ca50f[_0x47d8('0x14')]({'plain':!![]});if(_0x195e53[_0x47d8('0x11')]){return _0x1bafe3[_0x47d8('0x15')][_0x47d8('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x195e53['id']}})[_0x47d8('0x17')](function(){_0xdeab61();})[_0x47d8('0x18')](function(_0x40b788){_0xdeab61(_0x40b788);});}else{_0xdeab61();}}},'charset':'utf8mb4','collate':_0x47d8('0x19')});};
\ No newline at end of file
index b361f38..c993ef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7a3=['options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','redis','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update'];(function(_0x52fc45,_0x1673be){var _0xbbad2f=function(_0x37d023){while(--_0x37d023){_0x52fc45['push'](_0x52fc45['shift']());}};_0xbbad2f(++_0x1673be);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x1c8e2f,_0x4b4464){_0x1c8e2f=_0x1c8e2f-0x0;var _0x3b099a=_0xc7a3[_0x1c8e2f];return _0x3b099a;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var moment=require(_0x3c7a('0x1'));var BPromise=require(_0x3c7a('0x2'));var rs=require(_0x3c7a('0x3'));var fs=require('fs');var Redis=require(_0x3c7a('0x4'));var db=require(_0x3c7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c7a('0x6'))(_0x3c7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x3c7a('0x8'));var client=jayson[_0x3c7a('0x9')][_0x3c7a('0xa')]({'port':0x232a});config['redis']=_[_0x3c7a('0xb')](config['redis'],{'host':_0x3c7a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c7a('0xd')]));require(_0x3c7a('0xe'))[_0x3c7a('0xf')](socket);function respondWithRpcPromise(_0x5902a0,_0x32633f,_0x314593){return new BPromise(function(_0x590cb9,_0x298840){return client['request'](_0x5902a0,_0x314593)[_0x3c7a('0x10')](function(_0x4e5413){logger[_0x3c7a('0x11')](_0x3c7a('0x12'),_0x32633f,_0x3c7a('0x13'));logger[_0x3c7a('0x14')](_0x3c7a('0x15'),_0x32633f,'request\x20sent',JSON[_0x3c7a('0x16')](_0x4e5413));if(_0x4e5413[_0x3c7a('0x17')]){if(_0x4e5413[_0x3c7a('0x17')][_0x3c7a('0x18')]===0x1f4){logger[_0x3c7a('0x17')]('MailInteraction,\x20%s,\x20%s',_0x32633f,_0x4e5413[_0x3c7a('0x17')][_0x3c7a('0x19')]);return _0x298840(_0x4e5413['error']['message']);}logger[_0x3c7a('0x17')](_0x3c7a('0x12'),_0x32633f,_0x4e5413[_0x3c7a('0x17')]['message']);return _0x590cb9(_0x4e5413[_0x3c7a('0x17')]['message']);}else{logger[_0x3c7a('0x11')](_0x3c7a('0x12'),_0x32633f,_0x3c7a('0x13'));_0x590cb9(_0x4e5413[_0x3c7a('0x1a')][_0x3c7a('0x19')]);}})[_0x3c7a('0x1b')](function(_0x5975de){logger[_0x3c7a('0x17')](_0x3c7a('0x12'),_0x32633f,_0x5975de);_0x298840(_0x5975de);});});}exports[_0x3c7a('0x1c')]=function(_0xbe7a8f){var _0x3a79e3=this;return new Promise(function(_0x320730,_0x11a06b){return db[_0x3c7a('0x1d')][_0x3c7a('0x1e')](_0xbe7a8f['body'],{'raw':_0xbe7a8f[_0x3c7a('0x1f')]?_0xbe7a8f['options'][_0x3c7a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbe7a8f['options']?_0xbe7a8f[_0x3c7a('0x1f')][_0x3c7a('0x21')]||null:null,'attributes':_0xbe7a8f[_0x3c7a('0x1f')]?_0xbe7a8f[_0x3c7a('0x1f')][_0x3c7a('0x22')]||null:null,'limit':_0xbe7a8f[_0x3c7a('0x1f')]?_0xbe7a8f[_0x3c7a('0x1f')][_0x3c7a('0x23')]||null:null})[_0x3c7a('0x10')](function(_0x42bcbe){logger[_0x3c7a('0x11')](_0x3c7a('0x1c'),_0xbe7a8f);logger['debug'](_0x3c7a('0x1c'),_0xbe7a8f,JSON[_0x3c7a('0x16')](_0x42bcbe));_0x320730(_0x42bcbe);})[_0x3c7a('0x1b')](function(_0x3829de){logger[_0x3c7a('0x17')](_0x3c7a('0x1c'),_0x3829de[_0x3c7a('0x19')],_0xbe7a8f);_0x11a06b(_0x3a79e3[_0x3c7a('0x17')](0x1f4,_0x3829de['message']));});});};exports[_0x3c7a('0x24')]=function(_0xb1b1c7){return new Promise(function(_0x1d2b92,_0x197012){return db[_0x3c7a('0x1d')][_0x3c7a('0x25')]({'where':_0xb1b1c7[_0x3c7a('0x1f')]?_0xb1b1c7[_0x3c7a('0x1f')][_0x3c7a('0x21')]||null:null})[_0x3c7a('0x10')](function(_0x235b69){if(_0x235b69){return _0x235b69[_0x3c7a('0x26')](_0xb1b1c7[_0x3c7a('0x27')][_0x3c7a('0x28')],_[_0x3c7a('0x29')](_0xb1b1c7[_0x3c7a('0x27')],[_0x3c7a('0x28'),'id'])||{});}})[_0x3c7a('0x2a')](function(_0x1b2f58){logger[_0x3c7a('0x11')](_0x3c7a('0x2b'),_0xb1b1c7);logger[_0x3c7a('0x14')]('AddTags',_0xb1b1c7,JSON['stringify'](_0x1b2f58));_0x1d2b92(_0x1b2f58);})['catch'](function(_0x56247c){logger[_0x3c7a('0x17')](_0x3c7a('0x2b'),_0x56247c[_0x3c7a('0x19')],_0xb1b1c7);_0x197012(_this[_0x3c7a('0x17')](0x1f4,_0x56247c[_0x3c7a('0x19')]));});});};
\ No newline at end of file
+var _0xef94=['UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','AddTagsToMailInteraction','find','where','omit','ids','spread','AddTags','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x3a9ed3,_0xe1b156){var _0x4df70b=function(_0x42e193){while(--_0x42e193){_0x3a9ed3['push'](_0x3a9ed3['shift']());}};_0x4df70b(++_0xe1b156);}(_0xef94,0x113));var _0x4ef9=function(_0x52ff77,_0x51ab49){_0x52ff77=_0x52ff77-0x0;var _0x280dae=_0xef94[_0x52ff77];return _0x280dae;};'use strict';var _=require(_0x4ef9('0x0'));var util=require(_0x4ef9('0x1'));var moment=require(_0x4ef9('0x2'));var BPromise=require(_0x4ef9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ef9('0x4'));var db=require(_0x4ef9('0x5'))['db'];var utils=require(_0x4ef9('0x6'));var logger=require(_0x4ef9('0x7'))(_0x4ef9('0x8'));var config=require('../../config/environment');var jayson=require(_0x4ef9('0x9'));var client=jayson['client'][_0x4ef9('0xa')]({'port':0x232a});config[_0x4ef9('0xb')]=_[_0x4ef9('0xc')](config['redis'],{'host':_0x4ef9('0xd'),'port':0x18eb});var socket=require(_0x4ef9('0xe'))(new Redis(config[_0x4ef9('0xb')]));require('./mailInteraction.socket')[_0x4ef9('0xf')](socket);function respondWithRpcPromise(_0x255a65,_0x2c5cc1,_0x571dac){return new BPromise(function(_0x1dd969,_0x35a96e){return client[_0x4ef9('0x10')](_0x255a65,_0x571dac)[_0x4ef9('0x11')](function(_0x58c055){logger['info'](_0x4ef9('0x12'),_0x2c5cc1,_0x4ef9('0x13'));logger[_0x4ef9('0x14')](_0x4ef9('0x15'),_0x2c5cc1,_0x4ef9('0x13'),JSON['stringify'](_0x58c055));if(_0x58c055[_0x4ef9('0x16')]){if(_0x58c055[_0x4ef9('0x16')]['code']===0x1f4){logger[_0x4ef9('0x16')](_0x4ef9('0x12'),_0x2c5cc1,_0x58c055[_0x4ef9('0x16')][_0x4ef9('0x17')]);return _0x35a96e(_0x58c055[_0x4ef9('0x16')]['message']);}logger[_0x4ef9('0x16')](_0x4ef9('0x12'),_0x2c5cc1,_0x58c055[_0x4ef9('0x16')]['message']);return _0x1dd969(_0x58c055['error'][_0x4ef9('0x17')]);}else{logger[_0x4ef9('0x18')](_0x4ef9('0x12'),_0x2c5cc1,_0x4ef9('0x13'));_0x1dd969(_0x58c055[_0x4ef9('0x19')]['message']);}})['catch'](function(_0x52049d){logger[_0x4ef9('0x16')]('MailInteraction,\x20%s,\x20%s',_0x2c5cc1,_0x52049d);_0x35a96e(_0x52049d);});});}exports[_0x4ef9('0x1a')]=function(_0x1fa23a){var _0x5ce177=this;return new Promise(function(_0x395c01,_0x532cc3){return db[_0x4ef9('0x1b')][_0x4ef9('0x1c')](_0x1fa23a[_0x4ef9('0x1d')],{'raw':_0x1fa23a[_0x4ef9('0x1e')]?_0x1fa23a[_0x4ef9('0x1e')][_0x4ef9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fa23a['options']?_0x1fa23a[_0x4ef9('0x1e')]['where']||null:null,'attributes':_0x1fa23a['options']?_0x1fa23a[_0x4ef9('0x1e')][_0x4ef9('0x20')]||null:null,'limit':_0x1fa23a['options']?_0x1fa23a[_0x4ef9('0x1e')][_0x4ef9('0x21')]||null:null})[_0x4ef9('0x11')](function(_0x4a69dd){logger['info'](_0x4ef9('0x1a'),_0x1fa23a);logger[_0x4ef9('0x14')](_0x4ef9('0x1a'),_0x1fa23a,JSON['stringify'](_0x4a69dd));_0x395c01(_0x4a69dd);})['catch'](function(_0x1a6ed0){logger[_0x4ef9('0x16')](_0x4ef9('0x1a'),_0x1a6ed0[_0x4ef9('0x17')],_0x1fa23a);_0x532cc3(_0x5ce177['error'](0x1f4,_0x1a6ed0['message']));});});};exports[_0x4ef9('0x22')]=function(_0x8c736f){return new Promise(function(_0x1e489b,_0xe386a0){return db[_0x4ef9('0x1b')][_0x4ef9('0x23')]({'where':_0x8c736f[_0x4ef9('0x1e')]?_0x8c736f[_0x4ef9('0x1e')][_0x4ef9('0x24')]||null:null})['then'](function(_0x2f6d85){if(_0x2f6d85){return _0x2f6d85['addTags'](_0x8c736f[_0x4ef9('0x1d')]['ids'],_[_0x4ef9('0x25')](_0x8c736f[_0x4ef9('0x1d')],[_0x4ef9('0x26'),'id'])||{});}})[_0x4ef9('0x27')](function(_0x3f0f52){logger['info'](_0x4ef9('0x28'),_0x8c736f);logger['debug'](_0x4ef9('0x28'),_0x8c736f,JSON[_0x4ef9('0x29')](_0x3f0f52));_0x1e489b(_0x3f0f52);})[_0x4ef9('0x2a')](function(_0x32c51d){logger[_0x4ef9('0x16')](_0x4ef9('0x28'),_0x32c51d[_0x4ef9('0x17')],_0x8c736f);_0xe386a0(_this[_0x4ef9('0x16')](0x1f4,_0x32c51d['message']));});});};
\ No newline at end of file
index 06e409f..e455c02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1757=['remove','update','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x2e95e2,_0x17da77){var _0xd15fe1=function(_0x51a65e){while(--_0x51a65e){_0x2e95e2['push'](_0x2e95e2['shift']());}};_0xd15fe1(++_0x17da77);}(_0x1757,0x1ee));var _0x7175=function(_0x525ac5,_0x4fb82e){_0x525ac5=_0x525ac5-0x0;var _0x17044a=_0x1757[_0x525ac5];return _0x17044a;};'use strict';var MailInteractionEvents=require(_0x7175('0x0'));var events=[_0x7175('0x1'),_0x7175('0x2'),_0x7175('0x3')];function createListener(_0x21f8ce,_0x23d0ee){return function(_0x415f05){_0x23d0ee['emit'](_0x21f8ce,_0x415f05);};}function removeListener(_0x19fdc5,_0x5ca3a4){return function(){MailInteractionEvents[_0x7175('0x4')](_0x19fdc5,_0x5ca3a4);};}exports[_0x7175('0x5')]=function(_0x3cca3b){for(var _0xa3ed30=0x0,_0x2fca17=events[_0x7175('0x6')];_0xa3ed30<_0x2fca17;_0xa3ed30++){var _0x5063d5=events[_0xa3ed30];var _0x2d68d0=createListener(_0x7175('0x7')+_0x5063d5,_0x3cca3b);MailInteractionEvents['on'](_0x5063d5,_0x2d68d0);}};
\ No newline at end of file
+var _0x4969=['length','mailInteraction:','./mailInteraction.events','save','remove','update','register'];(function(_0x52ca49,_0x38c102){var _0x23c8f7=function(_0x5cff34){while(--_0x5cff34){_0x52ca49['push'](_0x52ca49['shift']());}};_0x23c8f7(++_0x38c102);}(_0x4969,0x79));var _0x9496=function(_0x31cb77,_0x348021){_0x31cb77=_0x31cb77-0x0;var _0x710374=_0x4969[_0x31cb77];return _0x710374;};'use strict';var MailInteractionEvents=require(_0x9496('0x0'));var events=[_0x9496('0x1'),_0x9496('0x2'),_0x9496('0x3')];function createListener(_0x22784f,_0x4f8e9a){return function(_0x366f97){_0x4f8e9a['emit'](_0x22784f,_0x366f97);};}function removeListener(_0x174609,_0x5e1cbf){return function(){MailInteractionEvents['removeListener'](_0x174609,_0x5e1cbf);};}exports[_0x9496('0x4')]=function(_0x67d4df){for(var _0x9cc416=0x0,_0x2d15df=events[_0x9496('0x5')];_0x9cc416<_0x2d15df;_0x9cc416++){var _0x18ec0f=events[_0x9cc416];var _0xe3662f=createListener(_0x9496('0x6')+_0x18ec0f,_0x67d4df);MailInteractionEvents['on'](_0x18ec0f,_0xe3662f);}};
\ No newline at end of file
index 80b5eb2..607afad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb945=['exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','mail','create','put','update','/:id/accept','accept','delete','destroy'];(function(_0x38a6c6,_0x4062ca){var _0x142f0a=function(_0x1531ce){while(--_0x1531ce){_0x38a6c6['push'](_0x38a6c6['shift']());}};_0x142f0a(++_0x4062ca);}(_0xb945,0x97));var _0x5b94=function(_0x75e81a,_0x55970c){_0x75e81a=_0x75e81a-0x0;var _0x235e84=_0xb945[_0x75e81a];return _0x235e84;};'use strict';var multer=require(_0x5b94('0x0'));var util=require('util');var path=require(_0x5b94('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b94('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5b94('0x3'));var interaction=require(_0x5b94('0x4'));var config=require(_0x5b94('0x5'));var controller=require(_0x5b94('0x6'));router[_0x5b94('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b94('0x7')](_0x5b94('0x8'),auth[_0x5b94('0x9')](),controller[_0x5b94('0xa')]);router['get'](_0x5b94('0xb'),auth['isAuthenticated'](),controller[_0x5b94('0xc')]);router[_0x5b94('0x7')](_0x5b94('0xd'),auth[_0x5b94('0x9')](),controller[_0x5b94('0xe')]);router[_0x5b94('0xf')]('/',auth[_0x5b94('0x9')](),interaction['tracked'](_0x5b94('0x10'),'mailmessage:create'),controller[_0x5b94('0x11')]);router[_0x5b94('0x12')](_0x5b94('0xb'),auth[_0x5b94('0x9')](),controller[_0x5b94('0x13')]);router['put'](_0x5b94('0x14'),auth[_0x5b94('0x9')](),controller[_0x5b94('0x15')]);router[_0x5b94('0x12')]('/:id/reject',auth[_0x5b94('0x9')](),controller['reject']);router[_0x5b94('0x16')](_0x5b94('0xb'),auth['isAuthenticated'](),controller[_0x5b94('0x17')]);module[_0x5b94('0x18')]=router;
\ No newline at end of file
+var _0x7c59=['delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','put','update','accept','/:id/reject','reject'];(function(_0x12db42,_0x325530){var _0x36de65=function(_0x438d3e){while(--_0x438d3e){_0x12db42['push'](_0x12db42['shift']());}};_0x36de65(++_0x325530);}(_0x7c59,0x147));var _0x97c5=function(_0x2f0b1c,_0x53456c){_0x2f0b1c=_0x2f0b1c-0x0;var _0x38b41a=_0x7c59[_0x2f0b1c];return _0x38b41a;};'use strict';var multer=require('multer');var util=require(_0x97c5('0x0'));var path=require(_0x97c5('0x1'));var timeout=require(_0x97c5('0x2'));var express=require(_0x97c5('0x3'));var router=express['Router']();var fs_extra=require(_0x97c5('0x4'));var auth=require(_0x97c5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x97c5('0x6'));router[_0x97c5('0x7')]('/',auth[_0x97c5('0x8')](),controller[_0x97c5('0x9')]);router[_0x97c5('0x7')]('/describe',auth[_0x97c5('0x8')](),controller['describe']);router['get'](_0x97c5('0xa'),auth[_0x97c5('0x8')](),controller[_0x97c5('0xb')]);router['get'](_0x97c5('0xc'),auth[_0x97c5('0x8')](),controller[_0x97c5('0xd')]);router[_0x97c5('0xe')]('/',auth['isAuthenticated'](),interaction[_0x97c5('0xf')](_0x97c5('0x10'),_0x97c5('0x11')),controller['create']);router[_0x97c5('0x12')](_0x97c5('0xa'),auth[_0x97c5('0x8')](),controller[_0x97c5('0x13')]);router[_0x97c5('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x97c5('0x14')]);router[_0x97c5('0x12')](_0x97c5('0x15'),auth[_0x97c5('0x8')](),controller[_0x97c5('0x16')]);router[_0x97c5('0x17')](_0x97c5('0xa'),auth[_0x97c5('0x8')](),controller[_0x97c5('0x18')]);module['exports']=router;
\ No newline at end of file
index 452e1b8..05effaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa747=['DATE','INTEGER','Chat','Email','sequelize','lodash','TEXT','medium','BOOLEAN','ENUM','out','STRING','long'];(function(_0x4d315e,_0x41972f){var _0x33b5b5=function(_0x3642cf){while(--_0x3642cf){_0x4d315e['push'](_0x4d315e['shift']());}};_0x33b5b5(++_0x41972f);}(_0xa747,0x12f));var _0x7a74=function(_0x274855,_0x2f02d5){_0x274855=_0x274855-0x0;var _0xfe7712=_0xa747[_0x274855];return _0xfe7712;};'use strict';var Sequelize=require(_0x7a74('0x0'));var _=require(_0x7a74('0x1'));module['exports']={'body':{'type':Sequelize[_0x7a74('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x7a74('0x3'))},'read':{'type':Sequelize[_0x7a74('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7a74('0x5')]('in',_0x7a74('0x6')),'defaultValue':_0x7a74('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x7a74('0x7')]},'to':{'type':Sequelize[_0x7a74('0x2')](_0x7a74('0x8'))},'cc':{'type':Sequelize[_0x7a74('0x2')](_0x7a74('0x8'))},'bcc':{'type':Sequelize[_0x7a74('0x2')](_0x7a74('0x8'))},'subject':{'type':Sequelize[_0x7a74('0x2')]},'sentAt':{'type':Sequelize[_0x7a74('0x9')]},'attach':{'type':Sequelize[_0x7a74('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7a74('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7a74('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x7a74('0x8'))},'originCc':{'type':Sequelize[_0x7a74('0x2')](_0x7a74('0x8'))},'originChannel':{'type':Sequelize[_0x7a74('0x5')]('Email',_0x7a74('0xb')),'defaultValue':_0x7a74('0xc'),'allowNull':![]}};
\ No newline at end of file
+var _0xb6a2=['STRING','DATE','BOOLEAN','Email','Chat','exports','TEXT','long','medium','ENUM','out'];(function(_0x3d2321,_0x2c9450){var _0x2cc827=function(_0x1fa35d){while(--_0x1fa35d){_0x3d2321['push'](_0x3d2321['shift']());}};_0x2cc827(++_0x2c9450);}(_0xb6a2,0x170));var _0x2b6a=function(_0x35c469,_0x4cd87d){_0x35c469=_0x35c469-0x0;var _0x5674ac=_0xb6a2[_0x35c469];return _0x5674ac;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x2b6a('0x0')]={'body':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2b6a('0x4')]('in',_0x2b6a('0x5')),'defaultValue':_0x2b6a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2b6a('0x6')](0x1fe)},'from':{'type':Sequelize[_0x2b6a('0x6')]},'to':{'type':Sequelize['TEXT'](_0x2b6a('0x2'))},'cc':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x2'))},'bcc':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x2'))},'subject':{'type':Sequelize[_0x2b6a('0x1')]},'sentAt':{'type':Sequelize[_0x2b6a('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2b6a('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2b6a('0x7')]},'originTo':{'type':Sequelize[_0x2b6a('0x1')]('long')},'originCc':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0x2b6a('0x9'),_0x2b6a('0xa')),'defaultValue':_0x2b6a('0x9'),'allowNull':![]}};
\ No newline at end of file
index 9bbf832..bdb194f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd7f=['get','MailInteraction','interaction','ContactId','Sequelize','QueryTypes','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','reject','rejectmessage','download','unix','toString','join','files','root','from','bcc','subject','createdAt','Attachment','Attachments','decode','Bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','undefined','limit','count','offset','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','MailMessage','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','findAll','show','params','rawAttributes','include','body','find','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','server/files/attachments','basename','Contacts','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','readAt','UserId','agent'];(function(_0x884f32,_0x23e846){var _0x5cd484=function(_0x12e849){while(--_0x12e849){_0x884f32['push'](_0x884f32['shift']());}};_0x5cd484(++_0x23e846);}(_0xcd7f,0x175));var _0xfcd7=function(_0x4e9f70,_0x1370e0){_0x4e9f70=_0x4e9f70-0x0;var _0x97f592=_0xcd7f[_0x4e9f70];return _0x97f592;};'use strict';var emlformat=require(_0xfcd7('0x0'));var moment=require(_0xfcd7('0x1'));var BPromise=require(_0xfcd7('0x2'));var util=require(_0xfcd7('0x3'));var path=require(_0xfcd7('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xfcd7('0x5'));var htmlToText=require(_0xfcd7('0x6'));var qs=require(_0xfcd7('0x7'));var logger=require(_0xfcd7('0x8'))(_0xfcd7('0x9'));var interaction_log=require(_0xfcd7('0x8'))(_0xfcd7('0xa'));var config=require(_0xfcd7('0xb'));var db=require(_0xfcd7('0xc'))['db'];config[_0xfcd7('0xd')]=_[_0xfcd7('0xe')](config[_0xfcd7('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcd7('0xf'))(new Redis(config[_0xfcd7('0xd')]));var htmlEntities=require(_0xfcd7('0x10'));require(_0xfcd7('0x11'))['register'](socket);var jayson=require(_0xfcd7('0x12'));var client=jayson[_0xfcd7('0x13')][_0xfcd7('0x14')]({'port':0x232c});var client9003=jayson[_0xfcd7('0x13')][_0xfcd7('0x14')]({'port':0x232b});var client9002=jayson[_0xfcd7('0x13')][_0xfcd7('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x12fabb,_0x45fd1f,_0x47a725,_0x5f1b5a){return new BPromise(function(_0x352f44,_0x5d9147){var _0x29f1cf=_0x5f1b5a||client;return _0x29f1cf[_0xfcd7('0x15')](_0x12fabb,_0x47a725)[_0xfcd7('0x16')](function(_0x33dabf){logger[_0xfcd7('0x17')](_0xfcd7('0x18'),_0x45fd1f,_0xfcd7('0x19'));logger[_0xfcd7('0x1a')](_0xfcd7('0x1b'),_0x45fd1f,_0xfcd7('0x19'),JSON['stringify'](_0x33dabf));if(_0x33dabf[_0xfcd7('0x1c')]){if(_0x33dabf[_0xfcd7('0x1c')][_0xfcd7('0x1d')]===0x1f4){logger[_0xfcd7('0x1c')]('MailMessage,\x20%s,\x20%s',_0x45fd1f,_0x33dabf[_0xfcd7('0x1c')][_0xfcd7('0x1e')]);return _0x5d9147(_0x33dabf['error']['message']);}logger['error'](_0xfcd7('0x18'),_0x45fd1f,_0x33dabf[_0xfcd7('0x1c')][_0xfcd7('0x1e')]);return _0x352f44(_0x33dabf[_0xfcd7('0x1c')][_0xfcd7('0x1e')]);}else{logger[_0xfcd7('0x17')](_0xfcd7('0x18'),_0x45fd1f,_0xfcd7('0x19'));_0x352f44(_0x33dabf[_0xfcd7('0x1f')]['message']);}})[_0xfcd7('0x20')](function(_0x114649){logger['error']('MailMessage,\x20%s,\x20%s',_0x45fd1f,_0x114649);_0x5d9147(_0x114649);});});}function respondWithResult(_0x4eb0f1,_0x1d6c24){_0x1d6c24=_0x1d6c24||0xc8;return function(_0x4caef3){if(_0x4caef3){return _0x4eb0f1[_0xfcd7('0x21')](_0x1d6c24)[_0xfcd7('0x22')](_0x4caef3);}};}function respondWithFilteredResult(_0x49923a,_0x1b4082){return function(_0x114759){if(_0x114759){var _0x50dcec=typeof _0x1b4082['offset']===_0xfcd7('0x23')&&typeof _0x1b4082[_0xfcd7('0x24')]===_0xfcd7('0x23');var _0x3ac425=_0x114759[_0xfcd7('0x25')];var _0x9349d7=_0x50dcec?0x0:_0x1b4082['offset'];var _0x50e85f=_0x50dcec?_0x114759[_0xfcd7('0x25')]:_0x1b4082[_0xfcd7('0x26')]+_0x1b4082[_0xfcd7('0x24')];var _0x606e2c;if(_0x50e85f>=_0x3ac425){_0x50e85f=_0x3ac425;_0x606e2c=0xc8;}else{_0x606e2c=0xce;}_0x49923a['status'](_0x606e2c);return _0x49923a['set'](_0xfcd7('0x27'),_0x9349d7+'-'+_0x50e85f+'/'+_0x3ac425)['json'](_0x114759);}return null;};}function saveUpdates(_0x5138e3){return function(_0x3833a2){if(_0x3833a2){return _0x3833a2[_0xfcd7('0x28')](_0x5138e3)['then'](function(_0x4288ae){return _0x4288ae;});}return null;};}function removeEntity(_0x1d41cd){return function(_0x5ad70e){if(_0x5ad70e){return _0x5ad70e[_0xfcd7('0x29')]()['then'](function(){_0x1d41cd[_0xfcd7('0x21')](0xcc)[_0xfcd7('0x2a')]();});}};}function handleEntityNotFound(_0x338fb7){return function(_0x21fa90){if(!_0x21fa90){_0x338fb7[_0xfcd7('0x2b')](0x194);}return _0x21fa90;};}function handleError(_0x21a07b,_0x59ba32){_0x59ba32=_0x59ba32||0x1f4;return function(_0x4ec617){logger[_0xfcd7('0x1c')](_0x4ec617[_0xfcd7('0x2c')]);if(_0x4ec617[_0xfcd7('0x2d')]){delete _0x4ec617[_0xfcd7('0x2d')];}_0x21a07b[_0xfcd7('0x21')](_0x59ba32)[_0xfcd7('0x2e')](_0x4ec617);};}exports[_0xfcd7('0x2f')]=function(_0x240ad,_0x3dd795){var _0x131d4f={},_0x5166c9={},_0x2c3518={'count':0x0,'rows':[]};var _0x2d0257=_['map'](db[_0xfcd7('0x30')]['rawAttributes'],function(_0x2857f9){return{'name':_0x2857f9[_0xfcd7('0x31')],'type':_0x2857f9['type'][_0xfcd7('0x32')]};});_0x5166c9[_0xfcd7('0x33')]=_[_0xfcd7('0x34')](_0x2d0257,_0xfcd7('0x2d'));_0x5166c9['query']=_[_0xfcd7('0x35')](_0x240ad[_0xfcd7('0x36')]);_0x5166c9[_0xfcd7('0x37')]=_[_0xfcd7('0x38')](_0x5166c9[_0xfcd7('0x33')],_0x5166c9[_0xfcd7('0x36')]);_0x131d4f[_0xfcd7('0x39')]=_['intersection'](_0x5166c9['model'],qs[_0xfcd7('0x3a')](_0x240ad['query']['fields']));_0x131d4f['attributes']=_0x131d4f[_0xfcd7('0x39')][_0xfcd7('0x3b')]?_0x131d4f[_0xfcd7('0x39')]:_0x5166c9['model'];if(!_0x240ad['query']['hasOwnProperty'](_0xfcd7('0x3c'))){_0x131d4f[_0xfcd7('0x24')]=qs['limit'](_0x240ad[_0xfcd7('0x36')][_0xfcd7('0x24')]);_0x131d4f['offset']=qs['offset'](_0x240ad[_0xfcd7('0x36')][_0xfcd7('0x26')]);}_0x131d4f[_0xfcd7('0x3d')]=qs[_0xfcd7('0x3e')](_0x240ad[_0xfcd7('0x36')][_0xfcd7('0x3e')]);_0x131d4f[_0xfcd7('0x3f')]=qs['filters'](_[_0xfcd7('0x40')](_0x240ad[_0xfcd7('0x36')],_0x5166c9[_0xfcd7('0x37')]),_0x2d0257);if(_0x240ad['query'][_0xfcd7('0x41')]){_0x131d4f['where']=_['merge'](_0x131d4f['where'],{'$or':_['map'](_0x2d0257,function(_0x4be235){if(_0x4be235[_0xfcd7('0x42')]!=='VIRTUAL'){var _0x2bbaa1={};_0x2bbaa1[_0x4be235['name']]={'$like':'%'+_0x240ad[_0xfcd7('0x36')][_0xfcd7('0x41')]+'%'};return _0x2bbaa1;}})});}_0x131d4f=_[_0xfcd7('0x43')]({},_0x131d4f,_0x240ad[_0xfcd7('0x44')]);var _0x2620b7={'where':_0x131d4f['where']};return db[_0xfcd7('0x30')][_0xfcd7('0x25')](_0x2620b7)['then'](function(_0x56865e){_0x2c3518[_0xfcd7('0x25')]=_0x56865e;if(_0x240ad['query'][_0xfcd7('0x45')]){_0x131d4f['include']=[{'all':!![]}];}return db[_0xfcd7('0x30')][_0xfcd7('0x46')](_0x131d4f);})[_0xfcd7('0x16')](function(_0x663a5a){_0x2c3518['rows']=_0x663a5a;return _0x2c3518;})[_0xfcd7('0x16')](respondWithFilteredResult(_0x3dd795,_0x131d4f))[_0xfcd7('0x20')](handleError(_0x3dd795,null));};exports[_0xfcd7('0x47')]=function(_0x3d3e38,_0x212c96){var _0x1e9766={'raw':!![],'where':{'id':_0x3d3e38[_0xfcd7('0x48')]['id']}},_0x4e1806={};_0x4e1806[_0xfcd7('0x33')]=_[_0xfcd7('0x35')](db[_0xfcd7('0x30')][_0xfcd7('0x49')]);_0x4e1806[_0xfcd7('0x36')]=_[_0xfcd7('0x35')](_0x3d3e38[_0xfcd7('0x36')]);_0x4e1806['filters']=_[_0xfcd7('0x38')](_0x4e1806[_0xfcd7('0x33')],_0x4e1806[_0xfcd7('0x36')]);_0x1e9766[_0xfcd7('0x39')]=_[_0xfcd7('0x38')](_0x4e1806[_0xfcd7('0x33')],qs[_0xfcd7('0x3a')](_0x3d3e38[_0xfcd7('0x36')][_0xfcd7('0x3a')]));_0x1e9766[_0xfcd7('0x39')]=_0x1e9766[_0xfcd7('0x39')][_0xfcd7('0x3b')]?_0x1e9766[_0xfcd7('0x39')]:_0x4e1806[_0xfcd7('0x33')];if(_0x3d3e38[_0xfcd7('0x36')][_0xfcd7('0x45')]){_0x1e9766[_0xfcd7('0x4a')]=[{'all':!![]}];}_0x1e9766=_['merge']({},_0x1e9766,_0x3d3e38[_0xfcd7('0x44')]);return db[_0xfcd7('0x30')]['find'](_0x1e9766)['then'](handleEntityNotFound(_0x212c96,null))['then'](respondWithResult(_0x212c96,null))[_0xfcd7('0x20')](handleError(_0x212c96,null));};exports[_0xfcd7('0x28')]=function(_0x52780f,_0x574b7d){if(_0x52780f[_0xfcd7('0x4b')]['id']){delete _0x52780f['body']['id'];}return db[_0xfcd7('0x30')][_0xfcd7('0x4c')]({'where':{'id':_0x52780f['params']['id']}})[_0xfcd7('0x16')](handleEntityNotFound(_0x574b7d,null))[_0xfcd7('0x16')](saveUpdates(_0x52780f[_0xfcd7('0x4b')],null))[_0xfcd7('0x16')](respondWithResult(_0x574b7d,null))['catch'](handleError(_0x574b7d,null));};exports[_0xfcd7('0x29')]=function(_0x33b731,_0x4a964b){return db[_0xfcd7('0x30')]['find']({'where':{'id':_0x33b731[_0xfcd7('0x48')]['id']}})[_0xfcd7('0x16')](handleEntityNotFound(_0x4a964b,null))['then'](removeEntity(_0x4a964b,null))[_0xfcd7('0x20')](handleError(_0x4a964b,null));};exports['describe']=function(_0x5aa102,_0x3e19d5){return db['MailMessage'][_0xfcd7('0x4d')]()[_0xfcd7('0x16')](respondWithResult(_0x3e19d5,null))['catch'](handleError(_0x3e19d5,null));};exports[_0xfcd7('0x4e')]=function(_0x245c83,_0x45d679){return db['MailMessage']['create'](_0x245c83['body'])[_0xfcd7('0x16')](function(_0x2e7f2f){if(_0x2e7f2f){if(_0x2e7f2f[_0xfcd7('0x4f')]===_0xfcd7('0x50')&&!_0x2e7f2f[_0xfcd7('0x51')]){var _0x3f3ceb,_0x1923e0,_0x53375e;if(_0x245c83['body']['to']){_0x1923e0=_0x245c83['body']['to'][_0xfcd7('0x52')](',')[0x0];}return db['MailAccount'][_0xfcd7('0x53')]({'where':{'id':_0x2e7f2f[_0xfcd7('0x54')]},'include':[{'model':db[_0xfcd7('0x55')],'as':_0xfcd7('0x56'),'include':[{'model':db[_0xfcd7('0x57')],'as':'Contacts','where':{'email':_0x1923e0},'limit':0x1,'order':[[_0xfcd7('0x58'),_0xfcd7('0x59')]]}]},{'model':db[_0xfcd7('0x5a')],'as':'Smtp','raw':!![]}]})['then'](function(_0x22c5c6){_0x3f3ceb=_0x22c5c6;if(_0x3f3ceb&&_0x3f3ceb[_0xfcd7('0x5b')]){var _0x3282dd={'tls':{'rejectUnauthorized':![]}};if(_[_0xfcd7('0x5c')](_0x3f3ceb['Smtp']['service'])){_0x3282dd[_0xfcd7('0x5d')]=_0x3f3ceb[_0xfcd7('0x5b')][_0xfcd7('0x5d')];_0x3282dd[_0xfcd7('0x5e')]=_0x3f3ceb['Smtp'][_0xfcd7('0x5e')];_0x3282dd[_0xfcd7('0x5f')]=_0x3f3ceb[_0xfcd7('0x5b')]['secure'];if(_0x3f3ceb[_0xfcd7('0x5b')][_0xfcd7('0x60')]){_0x3282dd[_0xfcd7('0x61')]={'user':_0x3f3ceb[_0xfcd7('0x5b')][_0xfcd7('0x62')],'pass':_0x3f3ceb[_0xfcd7('0x5b')][_0xfcd7('0x63')]};}}else{_0x3282dd[_0xfcd7('0x64')]=_0x3f3ceb['Smtp'][_0xfcd7('0x64')];_0x3282dd[_0xfcd7('0x61')]={'user':_0x3f3ceb[_0xfcd7('0x5b')]['user'],'pass':_0x3f3ceb[_0xfcd7('0x5b')][_0xfcd7('0x63')]};_0x3282dd[_0xfcd7('0x5f')]=_0x3f3ceb[_0xfcd7('0x5b')][_0xfcd7('0x5f')];}if(_0x245c83[_0xfcd7('0x4b')][_0xfcd7('0x65')]&&_0x245c83[_0xfcd7('0x4b')]['attachments'][_0xfcd7('0x3b')]){for(var _0xfd529a=0x0;_0xfd529a<_0x245c83[_0xfcd7('0x4b')][_0xfcd7('0x65')][_0xfcd7('0x3b')];_0xfd529a+=0x1){_0x245c83[_0xfcd7('0x4b')][_0xfcd7('0x65')][_0xfd529a]={'filename':_0x245c83['body']['attachments'][_0xfd529a][_0xfcd7('0x2d')],'path':path['join'](config['root'],_0xfcd7('0x66'),_0x245c83['body'][_0xfcd7('0x65')][_0xfd529a][_0xfcd7('0x67')])};}}_0x53375e={'account':_0x3282dd,'message':_0x245c83['body']};return;}})['then'](function(){if(_0x3f3ceb['List']){if(_0x3f3ceb[_0xfcd7('0x56')][_0xfcd7('0x68')]['length']){return _0x3f3ceb[_0xfcd7('0x56')][_0xfcd7('0x68')][0x0];}else{return db[_0xfcd7('0x57')][_0xfcd7('0x4e')](_['defaults'](_0x245c83['body'],{'firstName':_0x245c83['body']['to'],'email':_0x245c83[_0xfcd7('0x4b')]['to'],'phone':_0x245c83['body']['to'],'ListId':_0x3f3ceb['ListId']}));}}else{throw new Error(_0xfcd7('0x69'));}})[_0xfcd7('0x16')](function(){if(_0x53375e){return respondWithRpcPromise(_0xfcd7('0x6a'),_0xfcd7('0x6b'),_0x53375e,client9003)[_0xfcd7('0x16')](function(_0xe4a81c){return _0x2e7f2f[_0xfcd7('0x28')]({'read':!![],'messageId':_0xe4a81c['messageId'],'sentAt':moment()[_0xfcd7('0x6c')](_0xfcd7('0x6d'))});})[_0xfcd7('0x20')](function(_0xc4c6f8){logger[_0xfcd7('0x1c')]('%s',JSON[_0xfcd7('0x6e')](_0xc4c6f8));return _0x2e7f2f;});}return _0x2e7f2f;});}return _0x2e7f2f;}})['then'](respondWithResult(_0x45d679,0xc9))[_0xfcd7('0x20')](handleError(_0x45d679,null));};exports[_0xfcd7('0x6f')]=function(_0x3a48da,_0x2a046b){var _0x29f9cf={'agent':{},'channel':_0xfcd7('0x70')};if(_0x3a48da[_0xfcd7('0x4b')]['id']){delete _0x3a48da['body']['id'];}_0x3a48da['body']['read']=!![];_0x3a48da[_0xfcd7('0x4b')][_0xfcd7('0x71')]=moment()[_0xfcd7('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a48da[_0xfcd7('0x4b')][_0xfcd7('0x72')]=_0x3a48da[_0xfcd7('0x4b')]['UserId']||_0x3a48da[_0xfcd7('0x62')]['id'];_0x29f9cf[_0xfcd7('0x73')]['id']=_0x3a48da['body']['UserId'];return db[_0xfcd7('0x30')][_0xfcd7('0x4c')]({'where':{'id':_0x3a48da[_0xfcd7('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2a046b,null))[_0xfcd7('0x16')](saveUpdates(_0x3a48da[_0xfcd7('0x4b')],null))['then'](function(_0xc426eb){if(_0xc426eb){_0x29f9cf['message']=_0xc426eb[_0xfcd7('0x74')]({'plain':!![]});return db[_0xfcd7('0x75')][_0xfcd7('0x4c')]({'where':{'id':_0xc426eb['MailInteractionId']}});}return null;})[_0xfcd7('0x16')](handleEntityNotFound(_0x2a046b,null))[_0xfcd7('0x16')](function(_0x48954b){if(_0x48954b){return _0x48954b[_0xfcd7('0x28')]({'UserId':_0x3a48da[_0xfcd7('0x4b')][_0xfcd7('0x72')],'read1stAt':_['isNil'](_0x48954b['read1stAt'])?moment()['format'](_0xfcd7('0x6d')):undefined});}return null;})[_0xfcd7('0x16')](function(_0x47a395){if(_0x47a395){_0x29f9cf[_0xfcd7('0x76')]=_0x47a395[_0xfcd7('0x74')]({'plain':!![]});interaction_log[_0xfcd7('0x17')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a48da['user']['id'],_0x3a48da[_0xfcd7('0x62')][_0xfcd7('0x2d')],_0x3a48da[_0xfcd7('0x62')]['role'],_0x29f9cf[_0xfcd7('0x76')]['id'],_0x3a48da[_0xfcd7('0x4b')]?JSON[_0xfcd7('0x6e')](_0x3a48da['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x29f9cf);}return null;})[_0xfcd7('0x16')](function(_0x49d404){var _0x5c1404='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49d404['message'][_0xfcd7('0x77')];return db['sequelize'][_0xfcd7('0x36')](_0x5c1404,{'type':db[_0xfcd7('0x78')][_0xfcd7('0x79')]['SELECT'],'raw':!![]})[_0xfcd7('0x16')](function(_0x45d96c){return _0x45d96c;});})[_0xfcd7('0x16')](function(_0x1ad1a6){if(_0x1ad1a6){_0x29f9cf['message']['contact']=_0x1ad1a6[0x0];if(!_0x3a48da[_0xfcd7('0x4b')]['UserId'])return;return db[_0xfcd7('0x7a')]['find']({'where':{'id':_0x3a48da[_0xfcd7('0x4b')][_0xfcd7('0x72')],'role':_0xfcd7('0x73')},'attributes':['id',_0xfcd7('0x2d'),_0xfcd7('0x7b'),_0xfcd7('0x7c'),_0xfcd7('0x7d')],'raw':!![]});}return null;})[_0xfcd7('0x16')](function(_0x2d2e1a){if(!_0x2d2e1a)return null;_0x29f9cf['message'][_0xfcd7('0x73')]=_0x2d2e1a;return _0x29f9cf;})[_0xfcd7('0x16')](function(_0x100bcc){if(_0x100bcc){if(_0x3a48da[_0xfcd7('0x4b')]['manual']){_0x29f9cf[_0xfcd7('0x1e')][_0xfcd7('0x7e')]=util['format'](_0xfcd7('0x7f'),_0x3a48da[_0xfcd7('0x62')][_0xfcd7('0x2d')]);_0x29f9cf['message'][_0xfcd7('0x80')]=_0x29f9cf[_0xfcd7('0x80')];_0x29f9cf[_0xfcd7('0x1e')][_0xfcd7('0x81')]=_0x29f9cf[_0xfcd7('0x80')];_0x29f9cf[_0xfcd7('0x1e')][_0xfcd7('0x82')]=_0xfcd7('0x6f');_0x29f9cf[_0xfcd7('0x1e')][_0xfcd7('0x4b')]=htmlToText[_0xfcd7('0x83')](_0x29f9cf[_0xfcd7('0x1e')][_0xfcd7('0x4b')]);return respondWithRpcPromise(_0xfcd7('0x84'),'EventManager',{'event':_0xfcd7('0x85'),'message':_0x29f9cf[_0xfcd7('0x1e')]},client9002)[_0xfcd7('0x16')](function(){return _0x29f9cf;});}return _0x29f9cf;}return null;})[_0xfcd7('0x16')](respondWithResult(_0x2a046b,null))[_0xfcd7('0x20')](handleError(_0x2a046b,null));};exports['reject']=function(_0x59fbfe,_0x54eb1c){var _0x2b8688={'agent':{},'channel':_0xfcd7('0x70')};if(_0x59fbfe[_0xfcd7('0x4b')]['id']){delete _0x59fbfe['body']['id'];}_0x59fbfe[_0xfcd7('0x4b')]['UserId']=_0x59fbfe[_0xfcd7('0x4b')][_0xfcd7('0x72')]||_0x59fbfe[_0xfcd7('0x62')]['id'];_0x2b8688['agent']['id']=_0x59fbfe['body'][_0xfcd7('0x72')];return db['MailMessage'][_0xfcd7('0x4c')]({'where':{'id':_0x59fbfe[_0xfcd7('0x48')]['id'],'UserId':null}})[_0xfcd7('0x16')](handleEntityNotFound(_0x54eb1c,null))[_0xfcd7('0x16')](function(_0x265442){if(_0x265442){_0x2b8688[_0xfcd7('0x1e')]=_0x265442[_0xfcd7('0x74')]({'plain':!![]});return db['MailInteraction'][_0xfcd7('0x4c')]({'where':{'id':_0x265442[_0xfcd7('0x86')]}});}return null;})[_0xfcd7('0x16')](handleEntityNotFound(_0x54eb1c,null))[_0xfcd7('0x16')](function(_0x25e42a){if(_0x25e42a){_0x2b8688[_0xfcd7('0x76')]=_0x25e42a[_0xfcd7('0x74')]({'plain':!![]});interaction_log[_0xfcd7('0x17')](_0xfcd7('0x87'),_0x59fbfe['user']['id'],_0x59fbfe[_0xfcd7('0x62')][_0xfcd7('0x2d')],_0x59fbfe[_0xfcd7('0x62')][_0xfcd7('0x88')],_0x2b8688[_0xfcd7('0x76')]['id'],_0x59fbfe[_0xfcd7('0x4b')]?JSON['stringify'](_0x59fbfe[_0xfcd7('0x4b')]):_0xfcd7('0x89'));return respondWithRpcPromise('RejectMessage',_0xfcd7('0x8a'),_0x2b8688);}return null;})['then'](function(_0x244650){var _0x1d9ce5=_0xfcd7('0x8b')+_0x244650[_0xfcd7('0x1e')][_0xfcd7('0x77')];return db[_0xfcd7('0x8c')]['query'](_0x1d9ce5,{'type':db['Sequelize'][_0xfcd7('0x79')]['SELECT'],'raw':!![]})[_0xfcd7('0x16')](function(_0xd1c4fe){return _0xd1c4fe;});})[_0xfcd7('0x16')](function(_0x25da8b){if(_0x25da8b){_0x2b8688[_0xfcd7('0x1e')][_0xfcd7('0x8d')]=_0x25da8b[0x0];if(!_0x59fbfe['body']['UserId'])return;return db[_0xfcd7('0x7a')][_0xfcd7('0x4c')]({'where':{'id':_0x59fbfe[_0xfcd7('0x4b')]['UserId'],'role':_0xfcd7('0x73')},'attributes':['id',_0xfcd7('0x2d'),'fullname',_0xfcd7('0x7c'),_0xfcd7('0x7d')],'raw':!![]});}return null;})[_0xfcd7('0x16')](function(_0x100084){if(!_0x100084)return null;_0x2b8688[_0xfcd7('0x1e')]['agent']=_0x100084;return _0x2b8688;})[_0xfcd7('0x16')](function(_0x104eb0){if(_0x104eb0){_0x104eb0[_0xfcd7('0x1e')][_0xfcd7('0x7e')]=util[_0xfcd7('0x6c')](_0xfcd7('0x7f'),_0x59fbfe['user'][_0xfcd7('0x2d')]);_0x104eb0[_0xfcd7('0x1e')][_0xfcd7('0x80')]=_0x2b8688[_0xfcd7('0x80')];_0x104eb0[_0xfcd7('0x1e')][_0xfcd7('0x81')]=_0x2b8688['channel'];_0x104eb0[_0xfcd7('0x1e')]['event']=_0xfcd7('0x8e');_0x104eb0[_0xfcd7('0x1e')][_0xfcd7('0x4b')]=htmlToText[_0xfcd7('0x83')](_0x2b8688[_0xfcd7('0x1e')][_0xfcd7('0x4b')]);respondWithRpcPromise(_0xfcd7('0x84'),_0xfcd7('0x84'),{'event':_0xfcd7('0x8f'),'message':_0x104eb0[_0xfcd7('0x1e')]},client9002);return _0x2b8688;}return null;})['then'](respondWithResult(_0x54eb1c,null))[_0xfcd7('0x20')](handleError(_0x54eb1c,null));};exports[_0xfcd7('0x90')]=function(_0x3bf315,_0x4628f4){var _0x11372d=moment()[_0xfcd7('0x91')]()[_0xfcd7('0x92')]();var _0x36c4c6=path[_0xfcd7('0x93')](config['root'],'server',_0xfcd7('0x94'),'tmp');var _0x5161d7=path[_0xfcd7('0x93')](config[_0xfcd7('0x95')],'server','files','attachments');var _0x163f45=util[_0xfcd7('0x6c')]('message-%s.eml',_0x11372d);return db[_0xfcd7('0x30')][_0xfcd7('0x4c')]({'where':{'id':_0x3bf315[_0xfcd7('0x48')]['id']},'attributes':['id',_0xfcd7('0x4b'),_0xfcd7('0x96'),'to','cc',_0xfcd7('0x97'),_0xfcd7('0x98'),_0xfcd7('0x99')],'include':_0x3bf315[_0xfcd7('0x36')]['attachments']?[{'model':db[_0xfcd7('0x9a')],'as':_0xfcd7('0x9b')}]:undefined})['then'](handleEntityNotFound(_0x4628f4,null))['then'](function(_0x361413){if(_0x361413){var _0xbe9f1e=_0x361413;var _0x430486={'from':_0xbe9f1e['from'],'to':_0xbe9f1e['to'],'subject':_0xbe9f1e['subject'],'html':htmlEntities[_0xfcd7('0x9c')](_0xbe9f1e['body']),'headers':{'Date':moment(_0xbe9f1e['createdAt'])[_0xfcd7('0x6c')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x361413['cc']){_0x430486['headers']['Cc']=_0x361413['cc'];}if(_0x361413['bcc']){_0x430486['headers'][_0xfcd7('0x9d')]=_0x361413['bcc'];}return new BPromise(function(_0x5720fb,_0x2b6eb2){if(_0x361413[_0xfcd7('0x9b')]){for(var _0x1cbafa=0x0;_0x1cbafa<_0x361413[_0xfcd7('0x9b')]['length'];_0x1cbafa++){var _0x3cb4bc=_0x361413['Attachments'][_0x1cbafa];var _0xb2de2b=path[_0xfcd7('0x93')](_0x5161d7,_0x3cb4bc[_0xfcd7('0x67')]);if(fs[_0xfcd7('0x9e')](_0xb2de2b)){_0x430486[_0xfcd7('0x65')]['push']({'name':_0x3cb4bc[_0xfcd7('0x2d')],'contentType':_0x3cb4bc[_0xfcd7('0x42')],'data':fs[_0xfcd7('0x9f')](_0xb2de2b)});}}}emlformat[_0xfcd7('0xa0')](_0x430486,function(_0x18b25b,_0x1797c9){if(_0x18b25b)return _0x2b6eb2(_0x18b25b);fs[_0xfcd7('0xa1')](path[_0xfcd7('0x93')](_0x36c4c6,_0x163f45),_0x1797c9);return _0x5720fb(_0x1797c9);});});}})[_0xfcd7('0x16')](function(_0x568a8d){if(_0x568a8d){return _0x4628f4[_0xfcd7('0x90')](path[_0xfcd7('0x93')](_0x36c4c6,_0x163f45),_0x163f45,function(_0x2dac74){if(!_0x2dac74)fs[_0xfcd7('0xa2')](path[_0xfcd7('0x93')](_0x36c4c6,_0x163f45));});}})[_0xfcd7('0x20')](handleError(_0x4628f4,null));};
\ No newline at end of file
+var _0xef59=['./mailMessage.socket','register','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','find','body','describe','create','direction','out','secret','split','findOne','CmList','List','CmContact','updatedAt','DESC','Smtp','isNil','service','host','port','authentication','auth','user','pass','secure','attachments','root','server/files/attachments','basename','Contacts','defaults','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','User','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','email','rejectmessage','download','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','html-entities'];(function(_0xb38932,_0x41071b){var _0x15a86c=function(_0x1b048d){while(--_0x1b048d){_0xb38932['push'](_0xb38932['shift']());}};_0x15a86c(++_0x41071b);}(_0xef59,0x9b));var _0x9ef5=function(_0x4a0411,_0x5a91d4){_0x4a0411=_0x4a0411-0x0;var _0x248d1f=_0xef59[_0x4a0411];return _0x248d1f;};'use strict';var emlformat=require(_0x9ef5('0x0'));var moment=require(_0x9ef5('0x1'));var BPromise=require(_0x9ef5('0x2'));var util=require('util');var path=require(_0x9ef5('0x3'));var fs=require('fs');var _=require(_0x9ef5('0x4'));var Redis=require(_0x9ef5('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x9ef5('0x6'))(_0x9ef5('0x7'));var interaction_log=require(_0x9ef5('0x6'))('mail-interactions');var config=require(_0x9ef5('0x8'));var db=require(_0x9ef5('0x9'))['db'];config['redis']=_['defaults'](config[_0x9ef5('0xa')],{'host':_0x9ef5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ef5('0xa')]));var htmlEntities=require(_0x9ef5('0xc'));require(_0x9ef5('0xd'))[_0x9ef5('0xe')](socket);var jayson=require(_0x9ef5('0xf'));var client=jayson['client'][_0x9ef5('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x9ef5('0x10')]({'port':0x232b});var client9002=jayson[_0x9ef5('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fab37,_0x122205,_0x36de2c,_0x49cbbd){return new BPromise(function(_0x3af354,_0x2819db){var _0x164e8d=_0x49cbbd||client;return _0x164e8d[_0x9ef5('0x12')](_0x4fab37,_0x36de2c)['then'](function(_0x391ccb){logger[_0x9ef5('0x13')](_0x9ef5('0x14'),_0x122205,_0x9ef5('0x15'));logger[_0x9ef5('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x122205,_0x9ef5('0x15'),JSON[_0x9ef5('0x17')](_0x391ccb));if(_0x391ccb[_0x9ef5('0x18')]){if(_0x391ccb['error']['code']===0x1f4){logger[_0x9ef5('0x18')](_0x9ef5('0x14'),_0x122205,_0x391ccb['error']['message']);return _0x2819db(_0x391ccb[_0x9ef5('0x18')]['message']);}logger[_0x9ef5('0x18')](_0x9ef5('0x14'),_0x122205,_0x391ccb[_0x9ef5('0x18')][_0x9ef5('0x19')]);return _0x3af354(_0x391ccb[_0x9ef5('0x18')][_0x9ef5('0x19')]);}else{logger['info'](_0x9ef5('0x14'),_0x122205,_0x9ef5('0x15'));_0x3af354(_0x391ccb[_0x9ef5('0x1a')]['message']);}})['catch'](function(_0x365c82){logger[_0x9ef5('0x18')]('MailMessage,\x20%s,\x20%s',_0x122205,_0x365c82);_0x2819db(_0x365c82);});});}function respondWithResult(_0x6d3bc4,_0x44e661){_0x44e661=_0x44e661||0xc8;return function(_0x5f3345){if(_0x5f3345){return _0x6d3bc4[_0x9ef5('0x1b')](_0x44e661)['json'](_0x5f3345);}};}function respondWithFilteredResult(_0xb900d7,_0x5a3119){return function(_0x4baa84){if(_0x4baa84){var _0x3b71b5=typeof _0x5a3119['offset']===_0x9ef5('0x1c')&&typeof _0x5a3119[_0x9ef5('0x1d')]==='undefined';var _0x4b2f1a=_0x4baa84[_0x9ef5('0x1e')];var _0x29aed0=_0x3b71b5?0x0:_0x5a3119[_0x9ef5('0x1f')];var _0x42c801=_0x3b71b5?_0x4baa84[_0x9ef5('0x1e')]:_0x5a3119[_0x9ef5('0x1f')]+_0x5a3119[_0x9ef5('0x1d')];var _0x3d56a4;if(_0x42c801>=_0x4b2f1a){_0x42c801=_0x4b2f1a;_0x3d56a4=0xc8;}else{_0x3d56a4=0xce;}_0xb900d7[_0x9ef5('0x1b')](_0x3d56a4);return _0xb900d7[_0x9ef5('0x20')](_0x9ef5('0x21'),_0x29aed0+'-'+_0x42c801+'/'+_0x4b2f1a)[_0x9ef5('0x22')](_0x4baa84);}return null;};}function saveUpdates(_0x58c3d9){return function(_0x54402c){if(_0x54402c){return _0x54402c[_0x9ef5('0x23')](_0x58c3d9)[_0x9ef5('0x24')](function(_0xae1976){return _0xae1976;});}return null;};}function removeEntity(_0x36a65d){return function(_0x17fd06){if(_0x17fd06){return _0x17fd06[_0x9ef5('0x25')]()[_0x9ef5('0x24')](function(){_0x36a65d[_0x9ef5('0x1b')](0xcc)[_0x9ef5('0x26')]();});}};}function handleEntityNotFound(_0x563053){return function(_0x3913e7){if(!_0x3913e7){_0x563053['sendStatus'](0x194);}return _0x3913e7;};}function handleError(_0x4b2154,_0x2475c9){_0x2475c9=_0x2475c9||0x1f4;return function(_0x39afd2){logger[_0x9ef5('0x18')](_0x39afd2[_0x9ef5('0x27')]);if(_0x39afd2[_0x9ef5('0x28')]){delete _0x39afd2[_0x9ef5('0x28')];}_0x4b2154[_0x9ef5('0x1b')](_0x2475c9)[_0x9ef5('0x29')](_0x39afd2);};}exports[_0x9ef5('0x2a')]=function(_0x257c4a,_0x35653e){var _0x41c121={},_0x2b9c1c={},_0x2d60a2={'count':0x0,'rows':[]};var _0x13efe5=_[_0x9ef5('0x2b')](db[_0x9ef5('0x2c')][_0x9ef5('0x2d')],function(_0x48ea9a){return{'name':_0x48ea9a[_0x9ef5('0x2e')],'type':_0x48ea9a[_0x9ef5('0x2f')][_0x9ef5('0x30')]};});_0x2b9c1c[_0x9ef5('0x31')]=_[_0x9ef5('0x2b')](_0x13efe5,_0x9ef5('0x28'));_0x2b9c1c['query']=_[_0x9ef5('0x32')](_0x257c4a[_0x9ef5('0x33')]);_0x2b9c1c['filters']=_[_0x9ef5('0x34')](_0x2b9c1c['model'],_0x2b9c1c[_0x9ef5('0x33')]);_0x41c121[_0x9ef5('0x35')]=_['intersection'](_0x2b9c1c[_0x9ef5('0x31')],qs[_0x9ef5('0x36')](_0x257c4a[_0x9ef5('0x33')][_0x9ef5('0x36')]));_0x41c121['attributes']=_0x41c121[_0x9ef5('0x35')][_0x9ef5('0x37')]?_0x41c121[_0x9ef5('0x35')]:_0x2b9c1c[_0x9ef5('0x31')];if(!_0x257c4a[_0x9ef5('0x33')][_0x9ef5('0x38')](_0x9ef5('0x39'))){_0x41c121[_0x9ef5('0x1d')]=qs[_0x9ef5('0x1d')](_0x257c4a[_0x9ef5('0x33')][_0x9ef5('0x1d')]);_0x41c121[_0x9ef5('0x1f')]=qs[_0x9ef5('0x1f')](_0x257c4a[_0x9ef5('0x33')]['offset']);}_0x41c121[_0x9ef5('0x3a')]=qs['sort'](_0x257c4a['query'][_0x9ef5('0x3b')]);_0x41c121[_0x9ef5('0x3c')]=qs[_0x9ef5('0x3d')](_[_0x9ef5('0x3e')](_0x257c4a[_0x9ef5('0x33')],_0x2b9c1c[_0x9ef5('0x3d')]),_0x13efe5);if(_0x257c4a[_0x9ef5('0x33')]['filter']){_0x41c121[_0x9ef5('0x3c')]=_['merge'](_0x41c121[_0x9ef5('0x3c')],{'$or':_['map'](_0x13efe5,function(_0xa60c15){if(_0xa60c15[_0x9ef5('0x2f')]!==_0x9ef5('0x3f')){var _0x591a29={};_0x591a29[_0xa60c15[_0x9ef5('0x28')]]={'$like':'%'+_0x257c4a[_0x9ef5('0x33')]['filter']+'%'};return _0x591a29;}})});}_0x41c121=_[_0x9ef5('0x40')]({},_0x41c121,_0x257c4a['options']);var _0x1eb403={'where':_0x41c121[_0x9ef5('0x3c')]};return db[_0x9ef5('0x2c')][_0x9ef5('0x1e')](_0x1eb403)[_0x9ef5('0x24')](function(_0x277a6c){_0x2d60a2['count']=_0x277a6c;if(_0x257c4a['query'][_0x9ef5('0x41')]){_0x41c121['include']=[{'all':!![]}];}return db[_0x9ef5('0x2c')][_0x9ef5('0x42')](_0x41c121);})['then'](function(_0x3f3349){_0x2d60a2[_0x9ef5('0x43')]=_0x3f3349;return _0x2d60a2;})[_0x9ef5('0x24')](respondWithFilteredResult(_0x35653e,_0x41c121))[_0x9ef5('0x44')](handleError(_0x35653e,null));};exports[_0x9ef5('0x45')]=function(_0x5a8df3,_0x1e0969){var _0x5f16b9={'raw':!![],'where':{'id':_0x5a8df3[_0x9ef5('0x46')]['id']}},_0x22a0f={};_0x22a0f[_0x9ef5('0x31')]=_[_0x9ef5('0x32')](db[_0x9ef5('0x2c')]['rawAttributes']);_0x22a0f[_0x9ef5('0x33')]=_[_0x9ef5('0x32')](_0x5a8df3[_0x9ef5('0x33')]);_0x22a0f[_0x9ef5('0x3d')]=_[_0x9ef5('0x34')](_0x22a0f['model'],_0x22a0f[_0x9ef5('0x33')]);_0x5f16b9[_0x9ef5('0x35')]=_[_0x9ef5('0x34')](_0x22a0f[_0x9ef5('0x31')],qs[_0x9ef5('0x36')](_0x5a8df3[_0x9ef5('0x33')]['fields']));_0x5f16b9['attributes']=_0x5f16b9['attributes']['length']?_0x5f16b9[_0x9ef5('0x35')]:_0x22a0f[_0x9ef5('0x31')];if(_0x5a8df3[_0x9ef5('0x33')][_0x9ef5('0x41')]){_0x5f16b9[_0x9ef5('0x47')]=[{'all':!![]}];}_0x5f16b9=_[_0x9ef5('0x40')]({},_0x5f16b9,_0x5a8df3['options']);return db[_0x9ef5('0x2c')][_0x9ef5('0x48')](_0x5f16b9)[_0x9ef5('0x24')](handleEntityNotFound(_0x1e0969,null))[_0x9ef5('0x24')](respondWithResult(_0x1e0969,null))[_0x9ef5('0x44')](handleError(_0x1e0969,null));};exports[_0x9ef5('0x23')]=function(_0x47c43c,_0x5e17ee){if(_0x47c43c[_0x9ef5('0x49')]['id']){delete _0x47c43c[_0x9ef5('0x49')]['id'];}return db[_0x9ef5('0x2c')][_0x9ef5('0x48')]({'where':{'id':_0x47c43c[_0x9ef5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e17ee,null))[_0x9ef5('0x24')](saveUpdates(_0x47c43c['body'],null))[_0x9ef5('0x24')](respondWithResult(_0x5e17ee,null))['catch'](handleError(_0x5e17ee,null));};exports[_0x9ef5('0x25')]=function(_0xbf9ca9,_0x268f2e){return db['MailMessage'][_0x9ef5('0x48')]({'where':{'id':_0xbf9ca9['params']['id']}})[_0x9ef5('0x24')](handleEntityNotFound(_0x268f2e,null))[_0x9ef5('0x24')](removeEntity(_0x268f2e,null))['catch'](handleError(_0x268f2e,null));};exports[_0x9ef5('0x4a')]=function(_0x3c5130,_0xf7cf0f){return db['MailMessage']['describe']()['then'](respondWithResult(_0xf7cf0f,null))[_0x9ef5('0x44')](handleError(_0xf7cf0f,null));};exports[_0x9ef5('0x4b')]=function(_0x364093,_0xa643f4){return db[_0x9ef5('0x2c')][_0x9ef5('0x4b')](_0x364093[_0x9ef5('0x49')])[_0x9ef5('0x24')](function(_0x3e3c63){if(_0x3e3c63){if(_0x3e3c63[_0x9ef5('0x4c')]===_0x9ef5('0x4d')&&!_0x3e3c63[_0x9ef5('0x4e')]){var _0x38f56e,_0x494235,_0x591aa9;if(_0x364093['body']['to']){_0x494235=_0x364093[_0x9ef5('0x49')]['to'][_0x9ef5('0x4f')](',')[0x0];}return db['MailAccount'][_0x9ef5('0x50')]({'where':{'id':_0x3e3c63['MailAccountId']},'include':[{'model':db[_0x9ef5('0x51')],'as':_0x9ef5('0x52'),'include':[{'model':db[_0x9ef5('0x53')],'as':'Contacts','where':{'email':_0x494235},'limit':0x1,'order':[[_0x9ef5('0x54'),_0x9ef5('0x55')]]}]},{'model':db['MailServerOut'],'as':_0x9ef5('0x56'),'raw':!![]}]})['then'](function(_0x319cdd){_0x38f56e=_0x319cdd;if(_0x38f56e&&_0x38f56e['Smtp']){var _0x1b9d41={'tls':{'rejectUnauthorized':![]}};if(_[_0x9ef5('0x57')](_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x58')])){_0x1b9d41[_0x9ef5('0x59')]=_0x38f56e['Smtp']['host'];_0x1b9d41[_0x9ef5('0x5a')]=_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5a')];_0x1b9d41['secure']=_0x38f56e[_0x9ef5('0x56')]['secure'];if(_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5b')]){_0x1b9d41[_0x9ef5('0x5c')]={'user':_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5d')],'pass':_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5e')]};}}else{_0x1b9d41[_0x9ef5('0x58')]=_0x38f56e['Smtp'][_0x9ef5('0x58')];_0x1b9d41[_0x9ef5('0x5c')]={'user':_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5d')],'pass':_0x38f56e[_0x9ef5('0x56')]['pass']};_0x1b9d41[_0x9ef5('0x5f')]=_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5f')];}if(_0x364093[_0x9ef5('0x49')][_0x9ef5('0x60')]&&_0x364093[_0x9ef5('0x49')]['attachments'][_0x9ef5('0x37')]){for(var _0x2074cb=0x0;_0x2074cb<_0x364093['body']['attachments']['length'];_0x2074cb+=0x1){_0x364093[_0x9ef5('0x49')][_0x9ef5('0x60')][_0x2074cb]={'filename':_0x364093['body'][_0x9ef5('0x60')][_0x2074cb][_0x9ef5('0x28')],'path':path['join'](config[_0x9ef5('0x61')],_0x9ef5('0x62'),_0x364093['body']['attachments'][_0x2074cb][_0x9ef5('0x63')])};}}_0x591aa9={'account':_0x1b9d41,'message':_0x364093['body']};return;}})[_0x9ef5('0x24')](function(){if(_0x38f56e[_0x9ef5('0x52')]){if(_0x38f56e[_0x9ef5('0x52')][_0x9ef5('0x64')][_0x9ef5('0x37')]){return _0x38f56e[_0x9ef5('0x52')][_0x9ef5('0x64')][0x0];}else{return db['CmContact'][_0x9ef5('0x4b')](_[_0x9ef5('0x65')](_0x364093[_0x9ef5('0x49')],{'firstName':_0x364093['body']['to'],'email':_0x364093[_0x9ef5('0x49')]['to'],'phone':_0x364093[_0x9ef5('0x49')]['to'],'ListId':_0x38f56e[_0x9ef5('0x66')]}));}}else{throw new Error(_0x9ef5('0x67'));}})[_0x9ef5('0x24')](function(){if(_0x591aa9){return respondWithRpcPromise('SendMail',_0x9ef5('0x68'),_0x591aa9,client9003)[_0x9ef5('0x24')](function(_0x19ac3f){return _0x3e3c63[_0x9ef5('0x23')]({'read':!![],'messageId':_0x19ac3f[_0x9ef5('0x69')],'sentAt':moment()[_0x9ef5('0x6a')](_0x9ef5('0x6b'))});})[_0x9ef5('0x44')](function(_0x5197ff){logger[_0x9ef5('0x18')]('%s',JSON['stringify'](_0x5197ff));return _0x3e3c63;});}return _0x3e3c63;});}return _0x3e3c63;}})[_0x9ef5('0x24')](respondWithResult(_0xa643f4,0xc9))[_0x9ef5('0x44')](handleError(_0xa643f4,null));};exports[_0x9ef5('0x6c')]=function(_0x2129af,_0x54635c){var _0x12b581={'agent':{},'channel':'mail'};if(_0x2129af[_0x9ef5('0x49')]['id']){delete _0x2129af[_0x9ef5('0x49')]['id'];}_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6d')]=!![];_0x2129af['body'][_0x9ef5('0x6e')]=moment()['format'](_0x9ef5('0x6b'));_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6f')]=_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6f')]||_0x2129af['user']['id'];_0x12b581[_0x9ef5('0x70')]['id']=_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6f')];return db[_0x9ef5('0x2c')][_0x9ef5('0x48')]({'where':{'id':_0x2129af[_0x9ef5('0x46')]['id'],'UserId':null}})[_0x9ef5('0x24')](handleEntityNotFound(_0x54635c,null))['then'](saveUpdates(_0x2129af[_0x9ef5('0x49')],null))[_0x9ef5('0x24')](function(_0x15fe22){if(_0x15fe22){_0x12b581[_0x9ef5('0x19')]=_0x15fe22[_0x9ef5('0x71')]({'plain':!![]});return db[_0x9ef5('0x72')][_0x9ef5('0x48')]({'where':{'id':_0x15fe22['MailInteractionId']}});}return null;})[_0x9ef5('0x24')](handleEntityNotFound(_0x54635c,null))[_0x9ef5('0x24')](function(_0x265a68){if(_0x265a68){return _0x265a68[_0x9ef5('0x23')]({'UserId':_0x2129af[_0x9ef5('0x49')]['UserId'],'read1stAt':_[_0x9ef5('0x57')](_0x265a68[_0x9ef5('0x73')])?moment()[_0x9ef5('0x6a')](_0x9ef5('0x6b')):undefined});}return null;})[_0x9ef5('0x24')](function(_0xc313be){if(_0xc313be){_0x12b581[_0x9ef5('0x74')]=_0xc313be['get']({'plain':!![]});interaction_log[_0x9ef5('0x13')](_0x9ef5('0x75'),_0x2129af[_0x9ef5('0x5d')]['id'],_0x2129af[_0x9ef5('0x5d')][_0x9ef5('0x28')],_0x2129af[_0x9ef5('0x5d')][_0x9ef5('0x76')],_0x12b581[_0x9ef5('0x74')]['id'],_0x2129af['body']?JSON[_0x9ef5('0x17')](_0x2129af['body']):_0x9ef5('0x77'));return respondWithRpcPromise(_0x9ef5('0x78'),_0x9ef5('0x79'),_0x12b581);}return null;})[_0x9ef5('0x24')](function(_0x273f91){var _0x35a7b2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x273f91[_0x9ef5('0x19')]['ContactId'];return db[_0x9ef5('0x7a')][_0x9ef5('0x33')](_0x35a7b2,{'type':db[_0x9ef5('0x7b')][_0x9ef5('0x7c')][_0x9ef5('0x7d')],'raw':!![]})[_0x9ef5('0x24')](function(_0x31b4a2){return _0x31b4a2;});})['then'](function(_0x35cc1a){if(_0x35cc1a){_0x12b581[_0x9ef5('0x19')]['contact']=_0x35cc1a[0x0];if(!_0x2129af['body'][_0x9ef5('0x6f')])return;return db[_0x9ef5('0x7e')][_0x9ef5('0x48')]({'where':{'id':_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6f')],'role':_0x9ef5('0x70')},'attributes':['id',_0x9ef5('0x28'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x9ef5('0x24')](function(_0x517311){if(!_0x517311)return null;_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x70')]=_0x517311;return _0x12b581;})[_0x9ef5('0x24')](function(_0x1514a4){if(_0x1514a4){if(_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x7f')]){_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x80')]=util[_0x9ef5('0x6a')](_0x9ef5('0x81'),_0x2129af[_0x9ef5('0x5d')][_0x9ef5('0x28')]);_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x82')]=_0x12b581['channel'];_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x83')]=_0x12b581[_0x9ef5('0x82')];_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x84')]=_0x9ef5('0x6c');_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x49')]=htmlToText[_0x9ef5('0x85')](_0x12b581['message']['body']);return respondWithRpcPromise(_0x9ef5('0x86'),_0x9ef5('0x86'),{'event':_0x9ef5('0x87'),'message':_0x12b581[_0x9ef5('0x19')]},client9002)[_0x9ef5('0x24')](function(){return _0x12b581;});}return _0x12b581;}return null;})[_0x9ef5('0x24')](respondWithResult(_0x54635c,null))['catch'](handleError(_0x54635c,null));};exports[_0x9ef5('0x88')]=function(_0x323cfc,_0x5f0472){var _0x34f08f={'agent':{},'channel':_0x9ef5('0x89')};if(_0x323cfc[_0x9ef5('0x49')]['id']){delete _0x323cfc['body']['id'];}_0x323cfc[_0x9ef5('0x49')][_0x9ef5('0x6f')]=_0x323cfc[_0x9ef5('0x49')][_0x9ef5('0x6f')]||_0x323cfc[_0x9ef5('0x5d')]['id'];_0x34f08f['agent']['id']=_0x323cfc[_0x9ef5('0x49')]['UserId'];return db[_0x9ef5('0x2c')]['find']({'where':{'id':_0x323cfc[_0x9ef5('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5f0472,null))[_0x9ef5('0x24')](function(_0x3dbc20){if(_0x3dbc20){_0x34f08f[_0x9ef5('0x19')]=_0x3dbc20[_0x9ef5('0x71')]({'plain':!![]});return db[_0x9ef5('0x72')][_0x9ef5('0x48')]({'where':{'id':_0x3dbc20[_0x9ef5('0x8a')]}});}return null;})[_0x9ef5('0x24')](handleEntityNotFound(_0x5f0472,null))[_0x9ef5('0x24')](function(_0x1d3da6){if(_0x1d3da6){_0x34f08f[_0x9ef5('0x74')]=_0x1d3da6[_0x9ef5('0x71')]({'plain':!![]});interaction_log[_0x9ef5('0x13')](_0x9ef5('0x8b'),_0x323cfc[_0x9ef5('0x5d')]['id'],_0x323cfc[_0x9ef5('0x5d')][_0x9ef5('0x28')],_0x323cfc[_0x9ef5('0x5d')][_0x9ef5('0x76')],_0x34f08f['interaction']['id'],_0x323cfc[_0x9ef5('0x49')]?JSON[_0x9ef5('0x17')](_0x323cfc['body']):_0x9ef5('0x77'));return respondWithRpcPromise(_0x9ef5('0x8c'),_0x9ef5('0x8d'),_0x34f08f);}return null;})['then'](function(_0xce4696){var _0x5eaabd=_0x9ef5('0x8e')+_0xce4696['message'][_0x9ef5('0x8f')];return db[_0x9ef5('0x7a')][_0x9ef5('0x33')](_0x5eaabd,{'type':db[_0x9ef5('0x7b')][_0x9ef5('0x7c')]['SELECT'],'raw':!![]})[_0x9ef5('0x24')](function(_0x419564){return _0x419564;});})['then'](function(_0x41d404){if(_0x41d404){_0x34f08f[_0x9ef5('0x19')][_0x9ef5('0x90')]=_0x41d404[0x0];if(!_0x323cfc[_0x9ef5('0x49')][_0x9ef5('0x6f')])return;return db[_0x9ef5('0x7e')]['find']({'where':{'id':_0x323cfc[_0x9ef5('0x49')][_0x9ef5('0x6f')],'role':_0x9ef5('0x70')},'attributes':['id',_0x9ef5('0x28'),'fullname',_0x9ef5('0x91'),'internal'],'raw':!![]});}return null;})[_0x9ef5('0x24')](function(_0x2635d2){if(!_0x2635d2)return null;_0x34f08f['message'][_0x9ef5('0x70')]=_0x2635d2;return _0x34f08f;})[_0x9ef5('0x24')](function(_0x569691){if(_0x569691){_0x569691[_0x9ef5('0x19')]['interface']=util[_0x9ef5('0x6a')](_0x9ef5('0x81'),_0x323cfc[_0x9ef5('0x5d')][_0x9ef5('0x28')]);_0x569691[_0x9ef5('0x19')][_0x9ef5('0x82')]=_0x34f08f[_0x9ef5('0x82')];_0x569691[_0x9ef5('0x19')]['motionChannel']=_0x34f08f[_0x9ef5('0x82')];_0x569691[_0x9ef5('0x19')][_0x9ef5('0x84')]='reject';_0x569691[_0x9ef5('0x19')][_0x9ef5('0x49')]=htmlToText[_0x9ef5('0x85')](_0x34f08f[_0x9ef5('0x19')][_0x9ef5('0x49')]);respondWithRpcPromise(_0x9ef5('0x86'),_0x9ef5('0x86'),{'event':_0x9ef5('0x92'),'message':_0x569691['message']},client9002);return _0x34f08f;}return null;})[_0x9ef5('0x24')](respondWithResult(_0x5f0472,null))[_0x9ef5('0x44')](handleError(_0x5f0472,null));};exports[_0x9ef5('0x93')]=function(_0x1433a8,_0x47eba2){var _0x30298c=moment()[_0x9ef5('0x94')]()[_0x9ef5('0x95')]();var _0x543deb=path[_0x9ef5('0x96')](config[_0x9ef5('0x61')],_0x9ef5('0x97'),_0x9ef5('0x98'),_0x9ef5('0x99'));var _0x3c0f1d=path[_0x9ef5('0x96')](config[_0x9ef5('0x61')],_0x9ef5('0x97'),'files',_0x9ef5('0x60'));var _0x227ea4=util[_0x9ef5('0x6a')](_0x9ef5('0x9a'),_0x30298c);return db[_0x9ef5('0x2c')][_0x9ef5('0x48')]({'where':{'id':_0x1433a8[_0x9ef5('0x46')]['id']},'attributes':['id',_0x9ef5('0x49'),_0x9ef5('0x9b'),'to','cc',_0x9ef5('0x9c'),_0x9ef5('0x9d'),'createdAt'],'include':_0x1433a8['query'][_0x9ef5('0x60')]?[{'model':db[_0x9ef5('0x9e')],'as':_0x9ef5('0x9f')}]:undefined})[_0x9ef5('0x24')](handleEntityNotFound(_0x47eba2,null))['then'](function(_0x169554){if(_0x169554){var _0x36a682=_0x169554;var _0x2c19f0={'from':_0x36a682[_0x9ef5('0x9b')],'to':_0x36a682['to'],'subject':_0x36a682[_0x9ef5('0x9d')],'html':htmlEntities[_0x9ef5('0xa0')](_0x36a682[_0x9ef5('0x49')]),'headers':{'Date':moment(_0x36a682['createdAt'])['format'](_0x9ef5('0xa1'))},'attachments':[]};if(_0x169554['cc']){_0x2c19f0[_0x9ef5('0xa2')]['Cc']=_0x169554['cc'];}if(_0x169554['bcc']){_0x2c19f0['headers'][_0x9ef5('0xa3')]=_0x169554[_0x9ef5('0x9c')];}return new BPromise(function(_0x4670cf,_0x8db28f){if(_0x169554[_0x9ef5('0x9f')]){for(var _0x29ad43=0x0;_0x29ad43<_0x169554[_0x9ef5('0x9f')]['length'];_0x29ad43++){var _0x44ff3a=_0x169554[_0x9ef5('0x9f')][_0x29ad43];var _0x47dae9=path[_0x9ef5('0x96')](_0x3c0f1d,_0x44ff3a[_0x9ef5('0x63')]);if(fs[_0x9ef5('0xa4')](_0x47dae9)){_0x2c19f0[_0x9ef5('0x60')][_0x9ef5('0xa5')]({'name':_0x44ff3a[_0x9ef5('0x28')],'contentType':_0x44ff3a[_0x9ef5('0x2f')],'data':fs[_0x9ef5('0xa6')](_0x47dae9)});}}}emlformat['build'](_0x2c19f0,function(_0x541497,_0xaf7433){if(_0x541497)return _0x8db28f(_0x541497);fs['writeFileSync'](path['join'](_0x543deb,_0x227ea4),_0xaf7433);return _0x4670cf(_0xaf7433);});});}})[_0x9ef5('0x24')](function(_0x19be8a){if(_0x19be8a){return _0x47eba2['download'](path[_0x9ef5('0x96')](_0x543deb,_0x227ea4),_0x227ea4,function(_0x179f74){if(!_0x179f74)fs[_0x9ef5('0xa7')](path[_0x9ef5('0x96')](_0x543deb,_0x227ea4));});}})[_0x9ef5('0x44')](handleError(_0x47eba2,null));};
\ No newline at end of file
index b64969a..5d9d9b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf906=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x51d8a2,_0xcc52b7){var _0x4b9218=function(_0x8eb289){while(--_0x8eb289){_0x51d8a2['push'](_0x51d8a2['shift']());}};_0x4b9218(++_0xcc52b7);}(_0xf906,0x163));var _0x6f90=function(_0x13571d,_0x68904c){_0x13571d=_0x13571d-0x0;var _0x3a8e64=_0xf906[_0x13571d];return _0x3a8e64;};'use strict';var EventEmitter=require(_0x6f90('0x0'));var MailMessage=require(_0x6f90('0x1'))['db'][_0x6f90('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6f90('0x3')](0x0);var events={'afterCreate':_0x6f90('0x4'),'afterUpdate':'update','afterDestroy':_0x6f90('0x5')};function emitEvent(_0x5ef936){return function(_0x59dae5,_0x18e81b,_0x224305){MailMessageEvents[_0x6f90('0x6')](_0x5ef936+':'+_0x59dae5['id'],_0x59dae5);MailMessageEvents[_0x6f90('0x6')](_0x5ef936,_0x59dae5);_0x224305(null);};}for(var e in events){if(events[_0x6f90('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x6f90('0x8')]=MailMessageEvents;
\ No newline at end of file
+var _0x7e28=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x438df1,_0x4737de){var _0x2a8478=function(_0x28b33d){while(--_0x28b33d){_0x438df1['push'](_0x438df1['shift']());}};_0x2a8478(++_0x4737de);}(_0x7e28,0x1dd));var _0x87e2=function(_0x37e264,_0xb44ec0){_0x37e264=_0x37e264-0x0;var _0x26e4ff=_0x7e28[_0x37e264];return _0x26e4ff;};'use strict';var EventEmitter=require(_0x87e2('0x0'));var MailMessage=require(_0x87e2('0x1'))['db'][_0x87e2('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x87e2('0x3')](0x0);var events={'afterCreate':_0x87e2('0x4'),'afterUpdate':'update','afterDestroy':_0x87e2('0x5')};function emitEvent(_0x4742ae){return function(_0x54fe7f,_0x30e047,_0x6b36b2){MailMessageEvents[_0x87e2('0x6')](_0x4742ae+':'+_0x54fe7f['id'],_0x54fe7f);MailMessageEvents[_0x87e2('0x6')](_0x4742ae,_0x54fe7f);_0x6b36b2(null);};}for(var e in events){if(events[_0x87e2('0x7')](e)){var event=events[e];MailMessage[_0x87e2('0x8')](e,emitEvent(event));}}module[_0x87e2('0x9')]=MailMessageEvents;
\ No newline at end of file
index ed649ec..d755138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8489=['mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','MailMessage'];(function(_0x5eddcf,_0x4070ee){var _0x3a336d=function(_0x38da12){while(--_0x38da12){_0x5eddcf['push'](_0x5eddcf['shift']());}};_0x3a336d(++_0x4070ee);}(_0x8489,0x152));var _0x9848=function(_0x44a3c1,_0x4dcced){_0x44a3c1=_0x44a3c1-0x0;var _0x2879fc=_0x8489[_0x44a3c1];return _0x2879fc;};'use strict';var _=require('lodash');var util=require(_0x9848('0x0'));var logger=require(_0x9848('0x1'))(_0x9848('0x2'));var moment=require(_0x9848('0x3'));var BPromise=require(_0x9848('0x4'));var rp=require(_0x9848('0x5'));var htmlToText=require(_0x9848('0x6'));var fs=require('fs');var path=require(_0x9848('0x7'));var rimraf=require(_0x9848('0x8'));var config=require(_0x9848('0x9'));var attributes=require(_0x9848('0xa'));module['exports']=function(_0x14952f,_0x7bca14){return _0x14952f['define'](_0x9848('0xb'),attributes,{'tableName':_0x9848('0xc'),'paranoid':![],'indexes':[{'name':_0x9848('0xd'),'fields':['messageId']},{'name':_0x9848('0xe'),'fields':[_0x9848('0xf'),'subject'],'type':_0x9848('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4ead2e,_0x4485f5,_0x5ca51e){if(_0x4ead2e[_0x9848('0x11')]){_0x4ead2e[_0x9848('0xf')]=htmlToText[_0x9848('0x12')](_0x4ead2e[_0x9848('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5ca51e(null,_0x4485f5);},'afterCreate':function(_0x4c9761,_0xc203cf,_0xd20f79){var _0x4cab5f=_0x14952f[_0x9848('0x13')];var _0xb7f522=_0x4c9761[_0x9848('0x14')]({'plain':!![]});if(_0xb7f522[_0x9848('0x15')][_0x9848('0x16')]()==='in'||_0xb7f522[_0x9848('0x15')]['toLowerCase']()===_0x9848('0x17')&&!_0xb7f522[_0x9848('0x18')]&&!_[_0x9848('0x19')](_0xb7f522[_0x9848('0x1a')])){_0x4cab5f['MailInteraction'][_0x9848('0x1b')]({'where':{'id':_0xb7f522['MailInteractionId']}})[_0x9848('0x1c')](function(_0x1f2e4b){if(_0x1f2e4b){_0x1f2e4b[_0x9848('0x1d')]({'lastMsgAt':_0xb7f522[_0x9848('0x1e')],'lastMsgDirection':_0xb7f522[_0x9848('0x15')][_0x9848('0x16')]()});}})[_0x9848('0x1f')](function(_0x455d17){console[_0x9848('0x20')](_0x455d17);});}_0xd20f79();}},'charset':_0x9848('0x21'),'collate':_0x9848('0x22')});};
\ No newline at end of file
+var _0x4d73=['MailInteraction','findOne','MailInteractionId','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','get','toLowerCase','out','isNil','UserId'];(function(_0x582001,_0x4e4d3d){var _0x5953fc=function(_0x457207){while(--_0x457207){_0x582001['push'](_0x582001['shift']());}};_0x5953fc(++_0x4e4d3d);}(_0x4d73,0x111));var _0x34d7=function(_0xf52fb6,_0x550581){_0xf52fb6=_0xf52fb6-0x0;var _0x4784df=_0x4d73[_0xf52fb6];return _0x4784df;};'use strict';var _=require(_0x34d7('0x0'));var util=require('util');var logger=require(_0x34d7('0x1'))(_0x34d7('0x2'));var moment=require(_0x34d7('0x3'));var BPromise=require(_0x34d7('0x4'));var rp=require(_0x34d7('0x5'));var htmlToText=require(_0x34d7('0x6'));var fs=require('fs');var path=require(_0x34d7('0x7'));var rimraf=require(_0x34d7('0x8'));var config=require(_0x34d7('0x9'));var attributes=require(_0x34d7('0xa'));module['exports']=function(_0x33a986,_0x4e4f9a){return _0x33a986[_0x34d7('0xb')](_0x34d7('0xc'),attributes,{'tableName':_0x34d7('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x34d7('0xe')]},{'name':'fti_mail_messages','fields':[_0x34d7('0xf'),_0x34d7('0x10')],'type':_0x34d7('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47df40,_0x39323d,_0x47faa0){if(_0x47df40['body']){_0x47df40[_0x34d7('0xf')]=htmlToText['fromString'](_0x47df40[_0x34d7('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x47faa0(null,_0x39323d);},'afterCreate':function(_0x3e0e2d,_0x4a44c9,_0x4a63ca){var _0x272eb6=_0x33a986['models'];var _0x560dfc=_0x3e0e2d[_0x34d7('0x13')]({'plain':!![]});if(_0x560dfc['direction'][_0x34d7('0x14')]()==='in'||_0x560dfc['direction'][_0x34d7('0x14')]()===_0x34d7('0x15')&&!_0x560dfc['secret']&&!_[_0x34d7('0x16')](_0x560dfc[_0x34d7('0x17')])){_0x272eb6[_0x34d7('0x18')][_0x34d7('0x19')]({'where':{'id':_0x560dfc[_0x34d7('0x1a')]}})['then'](function(_0x4bc30c){if(_0x4bc30c){_0x4bc30c['update']({'lastMsgAt':_0x560dfc[_0x34d7('0x1b')],'lastMsgDirection':_0x560dfc[_0x34d7('0x1c')][_0x34d7('0x14')]()});}})[_0x34d7('0x1d')](function(_0x55f242){console[_0x34d7('0x1e')](_0x55f242);});}_0x4a63ca();}},'charset':_0x34d7('0x1f'),'collate':_0x34d7('0x20')});};
\ No newline at end of file
index 8a34bd6..71f5baa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0abf=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x307296,_0x49b881){var _0x32f975=function(_0x4ed150){while(--_0x4ed150){_0x307296['push'](_0x307296['shift']());}};_0x32f975(++_0x49b881);}(_0x0abf,0xe8));var _0xf0ab=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0abf[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./mailMessage.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});}exports[_0xf0ab('0x1a')]=function(_0x715579){var _0xdfcfb2=this;return new Promise(function(_0xf43bc4,_0x22a205){return db[_0xf0ab('0x1b')][_0xf0ab('0x1c')](_0x715579['body'],{'raw':_0x715579[_0xf0ab('0x1d')]?_0x715579[_0xf0ab('0x1d')][_0xf0ab('0x1e')]===undefined?!![]:![]:!![]})[_0xf0ab('0xe')](function(_0x3bf6a1){logger[_0xf0ab('0xf')](_0xf0ab('0x1a'),_0x715579);logger[_0xf0ab('0x12')](_0xf0ab('0x1a'),_0x715579,JSON[_0xf0ab('0x14')](_0x3bf6a1));_0xf43bc4(_0x3bf6a1);})[_0xf0ab('0x19')](function(_0x5645b2){logger['error']('CreateMailMessage',_0x5645b2[_0xf0ab('0x17')],_0x715579);_0x22a205(_0xdfcfb2['error'](0x1f4,_0x5645b2[_0xf0ab('0x17')]));});});};
\ No newline at end of file
+var _0x087b=['options','raw','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x087b,0x11a));var _0xb087=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x087b[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});config[_0xb087('0xb')]=_[_0xb087('0xc')](config[_0xb087('0xb')],{'host':_0xb087('0xd'),'port':0x18eb});var socket=require(_0xb087('0xe'))(new Redis(config[_0xb087('0xb')]));require(_0xb087('0xf'))[_0xb087('0x10')](socket);function respondWithRpcPromise(_0x379041,_0x583d25,_0x244abc){return new BPromise(function(_0x108451,_0x903a16){return client[_0xb087('0x11')](_0x379041,_0x244abc)[_0xb087('0x12')](function(_0x2f43e9){logger[_0xb087('0x13')]('MailMessage,\x20%s,\x20%s',_0x583d25,_0xb087('0x14'));logger[_0xb087('0x15')](_0xb087('0x16'),_0x583d25,'request\x20sent',JSON[_0xb087('0x17')](_0x2f43e9));if(_0x2f43e9[_0xb087('0x18')]){if(_0x2f43e9[_0xb087('0x18')][_0xb087('0x19')]===0x1f4){logger[_0xb087('0x18')](_0xb087('0x1a'),_0x583d25,_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);return _0x903a16(_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);}logger['error'](_0xb087('0x1a'),_0x583d25,_0x2f43e9[_0xb087('0x18')]['message']);return _0x108451(_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);}else{logger[_0xb087('0x13')]('MailMessage,\x20%s,\x20%s',_0x583d25,_0xb087('0x14'));_0x108451(_0x2f43e9[_0xb087('0x1c')][_0xb087('0x1b')]);}})[_0xb087('0x1d')](function(_0x4e333b){logger[_0xb087('0x18')](_0xb087('0x1a'),_0x583d25,_0x4e333b);_0x903a16(_0x4e333b);});});}exports[_0xb087('0x1e')]=function(_0x23c1b6){var _0x5b4ef0=this;return new Promise(function(_0x5aeab1,_0x5ea3dc){return db['MailMessage'][_0xb087('0x1f')](_0x23c1b6[_0xb087('0x20')],{'raw':_0x23c1b6[_0xb087('0x21')]?_0x23c1b6[_0xb087('0x21')][_0xb087('0x22')]===undefined?!![]:![]:!![]})[_0xb087('0x12')](function(_0x31ae01){logger['info'](_0xb087('0x1e'),_0x23c1b6);logger[_0xb087('0x15')](_0xb087('0x1e'),_0x23c1b6,JSON[_0xb087('0x17')](_0x31ae01));_0x5aeab1(_0x31ae01);})[_0xb087('0x1d')](function(_0x4d9028){logger[_0xb087('0x18')](_0xb087('0x1e'),_0x4d9028['message'],_0x23c1b6);_0x5ea3dc(_0x5b4ef0['error'](0x1f4,_0x4d9028['message']));});});};
\ No newline at end of file
index 8fc4487..421cf50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x172c=['mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0x172c,0xb9));var _0xc172=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x172c[_0x2a0738];return _0x159679;};'use strict';var MailMessageEvents=require(_0xc172('0x0'));var events=[_0xc172('0x1'),_0xc172('0x2'),_0xc172('0x3')];function createListener(_0x5f5ca3,_0xd051a4){return function(_0x182655){_0xd051a4[_0xc172('0x4')](_0x5f5ca3,_0x182655);};}function removeListener(_0x486dec,_0x3cbc9b){return function(){MailMessageEvents[_0xc172('0x5')](_0x486dec,_0x3cbc9b);};}exports['register']=function(_0x5033f7){for(var _0x2a2fcd=0x0,_0x43ca97=events[_0xc172('0x6')];_0x2a2fcd<_0x43ca97;_0x2a2fcd++){var _0x4d210d=events[_0x2a2fcd];var _0x597159=createListener(_0xc172('0x7')+_0x4d210d,_0x5033f7);MailMessageEvents['on'](_0x4d210d,_0x597159);}};
\ No newline at end of file
+var _0xb281=['emit','mailMessage:','./mailMessage.events','remove'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xb281,0x176));var _0x1b28=function(_0x57590f,_0x29a371){_0x57590f=_0x57590f-0x0;var _0x21a86b=_0xb281[_0x57590f];return _0x21a86b;};'use strict';var MailMessageEvents=require(_0x1b28('0x0'));var events=['save',_0x1b28('0x1'),'update'];function createListener(_0x2c8462,_0x2ae00e){return function(_0x3abed6){_0x2ae00e[_0x1b28('0x2')](_0x2c8462,_0x3abed6);};}function removeListener(_0x55c70a,_0x179600){return function(){MailMessageEvents['removeListener'](_0x55c70a,_0x179600);};}exports['register']=function(_0x55d854){for(var _0x32b49c=0x0,_0x542069=events['length'];_0x32b49c<_0x542069;_0x32b49c++){var _0x346f18=events[_0x32b49c];var _0x4fd627=createListener(_0x1b28('0x3')+_0x346f18,_0x55d854);MailMessageEvents['on'](_0x346f18,_0x4fd627);}};
\ No newline at end of file
index a7267cf..b215993 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4996=['/:id','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','show','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents'];(function(_0x11f34d,_0x37892e){var _0x4a5888=function(_0x58f1af){while(--_0x58f1af){_0x11f34d['push'](_0x11f34d['shift']());}};_0x4a5888(++_0x37892e);}(_0x4996,0xe5));var _0x6499=function(_0xe59443,_0x1c7fbc){_0xe59443=_0xe59443-0x0;var _0x155142=_0x4996[_0xe59443];return _0x155142;};'use strict';var multer=require('multer');var util=require(_0x6499('0x0'));var path=require(_0x6499('0x1'));var timeout=require(_0x6499('0x2'));var express=require(_0x6499('0x3'));var router=express[_0x6499('0x4')]();var fs_extra=require(_0x6499('0x5'));var auth=require(_0x6499('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6499('0x7'));var controller=require(_0x6499('0x8'));router[_0x6499('0x9')]('/',auth[_0x6499('0xa')](),controller[_0x6499('0xb')]);router[_0x6499('0x9')](_0x6499('0xc'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x6499('0xa')](),controller[_0x6499('0xd')]);router[_0x6499('0x9')]('/:id/members',auth[_0x6499('0xa')](),controller[_0x6499('0xe')]);router[_0x6499('0x9')](_0x6499('0xf'),auth['isAuthenticated'](),controller[_0x6499('0x10')]);router['get']('/:id/users',auth[_0x6499('0xa')](),controller[_0x6499('0x11')]);router[_0x6499('0x12')]('/',auth[_0x6499('0xa')](),controller[_0x6499('0x13')]);router['post'](_0x6499('0xf'),auth[_0x6499('0xa')](),controller[_0x6499('0x14')]);router[_0x6499('0x12')](_0x6499('0x15'),auth[_0x6499('0xa')](),controller[_0x6499('0x16')]);router['put'](_0x6499('0x17'),auth[_0x6499('0xa')](),controller[_0x6499('0x18')]);router[_0x6499('0x19')](_0x6499('0x17'),auth[_0x6499('0xa')](),controller[_0x6499('0x1a')]);router[_0x6499('0x19')](_0x6499('0xf'),auth[_0x6499('0xa')](),controller['removeTeams']);router[_0x6499('0x19')](_0x6499('0x15'),auth[_0x6499('0xa')](),controller[_0x6499('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x06a6=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','getMembers','/:id/teams','/:id/users','post','create','addAgents','put','/:id','update','delete','destroy','removeTeams','exports','multer','util','path'];(function(_0x5e761b,_0x355e38){var _0x98502c=function(_0x4e52d5){while(--_0x4e52d5){_0x5e761b['push'](_0x5e761b['shift']());}};_0x98502c(++_0x355e38);}(_0x06a6,0x93));var _0x606a=function(_0x1d7448,_0x481e34){_0x1d7448=_0x1d7448-0x0;var _0x4208ee=_0x06a6[_0x1d7448];return _0x4208ee;};'use strict';var multer=require(_0x606a('0x0'));var util=require(_0x606a('0x1'));var path=require(_0x606a('0x2'));var timeout=require(_0x606a('0x3'));var express=require(_0x606a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x606a('0x5'));var interaction=require(_0x606a('0x6'));var config=require(_0x606a('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x606a('0x8')](),controller[_0x606a('0x9')]);router[_0x606a('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x606a('0xb')]);router[_0x606a('0xa')]('/:id',auth[_0x606a('0x8')](),controller['show']);router[_0x606a('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x606a('0xc')]);router[_0x606a('0xa')](_0x606a('0xd'),auth[_0x606a('0x8')](),controller['getTeams']);router['get'](_0x606a('0xe'),auth[_0x606a('0x8')](),controller['getAgents']);router[_0x606a('0xf')]('/',auth[_0x606a('0x8')](),controller[_0x606a('0x10')]);router[_0x606a('0xf')](_0x606a('0xd'),auth[_0x606a('0x8')](),controller['addTeams']);router[_0x606a('0xf')]('/:id/users',auth[_0x606a('0x8')](),controller[_0x606a('0x11')]);router[_0x606a('0x12')](_0x606a('0x13'),auth[_0x606a('0x8')](),controller[_0x606a('0x14')]);router[_0x606a('0x15')](_0x606a('0x13'),auth[_0x606a('0x8')](),controller[_0x606a('0x16')]);router[_0x606a('0x15')](_0x606a('0xd'),auth['isAuthenticated'](),controller[_0x606a('0x17')]);router[_0x606a('0x15')]('/:id/users',auth[_0x606a('0x8')](),controller['removeAgents']);module[_0x606a('0x18')]=router;
\ No newline at end of file
index b77d911..57fa038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62c5=['rrmemory','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x1e6773,_0x138124){var _0x4c81a0=function(_0x5e6b7c){while(--_0x5e6b7c){_0x1e6773['push'](_0x1e6773['shift']());}};_0x4c81a0(++_0x138124);}(_0x62c5,0x16e));var _0x562c=function(_0x20d1f9,_0x2d19d7){_0x20d1f9=_0x20d1f9-0x0;var _0x8e48fb=_0x62c5[_0x20d1f9];return _0x8e48fb;};'use strict';var Sequelize=require('sequelize');module[_0x562c('0x0')]={'name':{'type':Sequelize[_0x562c('0x1')],'unique':_0x562c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x562c('0x1')]},'timeout':{'type':Sequelize[_0x562c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x562c('0x4')](_0x562c('0x5'),'beepall',_0x562c('0x6'))}};
\ No newline at end of file
+var _0x106a=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x393436,_0x2100f4){var _0x1a54a4=function(_0x2318f3){while(--_0x2318f3){_0x393436['push'](_0x393436['shift']());}};_0x1a54a4(++_0x2100f4);}(_0x106a,0x1ee));var _0xa106=function(_0x2627e4,_0x1a02e0){_0x2627e4=_0x2627e4-0x0;var _0x102358=_0x106a[_0x2627e4];return _0x102358;};'use strict';var Sequelize=require(_0xa106('0x0'));module[_0xa106('0x1')]={'name':{'type':Sequelize[_0xa106('0x2')],'unique':_0xa106('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa106('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa106('0x5')](_0xa106('0x6'),'beepall',_0xa106('0x7'))}};
\ No newline at end of file
index 66be6b8..c1e532e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e89=['where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','order','MailQueueId','UserMailQueue','User','updatedAt','createdAt','format','%s/%s','mailPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','emit','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','MailQueues','destroy','error','stack','name','send','MailQueue','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x2e89,0x1e9));var _0x92e8=function(_0x330ee5,_0x2492a7){_0x330ee5=_0x330ee5-0x0;var _0x3a2236=_0x2e89[_0x330ee5];return _0x3a2236;};'use strict';var emlformat=require(_0x92e8('0x0'));var rimraf=require(_0x92e8('0x1'));var zipdir=require(_0x92e8('0x2'));var jsonpatch=require(_0x92e8('0x3'));var rp=require('request-promise');var moment=require(_0x92e8('0x4'));var BPromise=require(_0x92e8('0x5'));var Mustache=require(_0x92e8('0x6'));var util=require(_0x92e8('0x7'));var path=require('path');var sox=require(_0x92e8('0x8'));var csv=require('to-csv');var ejs=require(_0x92e8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92e8('0xa'));var squel=require(_0x92e8('0xb'));var crypto=require(_0x92e8('0xc'));var jsforce=require(_0x92e8('0xd'));var deskjs=require(_0x92e8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x92e8('0xf'));var Papa=require('papaparse');var Redis=require(_0x92e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x92e8('0x11'));var as=require(_0x92e8('0x12'));var hardwareService=require(_0x92e8('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x92e8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x92e8('0x15'))['db'];config[_0x92e8('0x16')]=_[_0x92e8('0x17')](config[_0x92e8('0x16')],{'host':_0x92e8('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x92e8('0x19'))[_0x92e8('0x1a')](socket);function respondWithStatusCode(_0xe6ce8b,_0x475ced){_0x475ced=_0x475ced||0xcc;return function(_0x2b4227){if(_0x2b4227){return _0xe6ce8b[_0x92e8('0x1b')](_0x475ced);}return _0xe6ce8b[_0x92e8('0x1c')](_0x475ced)[_0x92e8('0x1d')]();};}function respondWithResult(_0x2aae29,_0x30ba93){_0x30ba93=_0x30ba93||0xc8;return function(_0xbca2d){if(_0xbca2d){return _0x2aae29[_0x92e8('0x1c')](_0x30ba93)[_0x92e8('0x1e')](_0xbca2d);}};}function respondWithFilteredResult(_0x969f06,_0x2b8428){return function(_0x17cf89){if(_0x17cf89){var _0x465b45=typeof _0x2b8428[_0x92e8('0x1f')]===_0x92e8('0x20')&&typeof _0x2b8428[_0x92e8('0x21')]==='undefined';var _0x175e9b=_0x17cf89['count'];var _0x3e6290=_0x465b45?0x0:_0x2b8428[_0x92e8('0x1f')];var _0x220d14=_0x465b45?_0x17cf89[_0x92e8('0x22')]:_0x2b8428[_0x92e8('0x1f')]+_0x2b8428[_0x92e8('0x21')];var _0x3283af;if(_0x220d14>=_0x175e9b){_0x220d14=_0x175e9b;_0x3283af=0xc8;}else{_0x3283af=0xce;}_0x969f06['status'](_0x3283af);return _0x969f06[_0x92e8('0x23')](_0x92e8('0x24'),_0x3e6290+'-'+_0x220d14+'/'+_0x175e9b)[_0x92e8('0x1e')](_0x17cf89);}return null;};}function patchUpdates(_0x276ba2){return function(_0x3282fd){try{jsonpatch['apply'](_0x3282fd,_0x276ba2,!![]);}catch(_0x46e76c){return BPromise[_0x92e8('0x25')](_0x46e76c);}return _0x3282fd[_0x92e8('0x26')]();};}function saveUpdates(_0x13ed1f,_0x196845){return function(_0xe4d6d3){if(_0xe4d6d3){return _0xe4d6d3[_0x92e8('0x27')](_0x13ed1f)[_0x92e8('0x28')](function(_0x323529){return _0x323529;});}return null;};}function removeEntity(_0x4c5fe5,_0x3955cd){return function(_0x114734){if(_0x114734){return _0x114734['destroy']()[_0x92e8('0x28')](function(){var _0x5c96f6=_0x114734[_0x92e8('0x29')]({'plain':!![]});var _0x339826=_0x92e8('0x2a');return db['UserProfileResource'][_0x92e8('0x2b')]({'where':{'type':_0x339826,'resourceId':_0x5c96f6['id']}})[_0x92e8('0x28')](function(){return _0x114734;});})[_0x92e8('0x28')](function(){_0x4c5fe5[_0x92e8('0x1c')](0xcc)[_0x92e8('0x1d')]();});}};}function handleEntityNotFound(_0x40f39f,_0x2d69af){return function(_0xe5990e){if(!_0xe5990e){_0x40f39f[_0x92e8('0x1b')](0x194);}return _0xe5990e;};}function handleError(_0x3a802c,_0x34508c){_0x34508c=_0x34508c||0x1f4;return function(_0x46188d){logger[_0x92e8('0x2c')](_0x46188d[_0x92e8('0x2d')]);if(_0x46188d[_0x92e8('0x2e')]){delete _0x46188d[_0x92e8('0x2e')];}_0x3a802c[_0x92e8('0x1c')](_0x34508c)[_0x92e8('0x2f')](_0x46188d);};}exports['index']=function(_0x4e9fe7,_0x499577){var _0x41f310={},_0xebffd3={},_0x2994c6={'count':0x0,'rows':[]};var _0x696942=_['map'](db[_0x92e8('0x30')]['rawAttributes'],function(_0x569c50){return{'name':_0x569c50[_0x92e8('0x31')],'type':_0x569c50[_0x92e8('0x32')][_0x92e8('0x33')]};});_0xebffd3[_0x92e8('0x34')]=_[_0x92e8('0x35')](_0x696942,_0x92e8('0x2e'));_0xebffd3[_0x92e8('0x36')]=_[_0x92e8('0x37')](_0x4e9fe7[_0x92e8('0x36')]);_0xebffd3[_0x92e8('0x38')]=_[_0x92e8('0x39')](_0xebffd3[_0x92e8('0x34')],_0xebffd3['query']);_0x41f310[_0x92e8('0x3a')]=_['intersection'](_0xebffd3[_0x92e8('0x34')],qs[_0x92e8('0x3b')](_0x4e9fe7[_0x92e8('0x36')][_0x92e8('0x3b')]));_0x41f310[_0x92e8('0x3a')]=_0x41f310[_0x92e8('0x3a')][_0x92e8('0x3c')]?_0x41f310[_0x92e8('0x3a')]:_0xebffd3[_0x92e8('0x34')];if(!_0x4e9fe7[_0x92e8('0x36')][_0x92e8('0x3d')]('nolimit')){_0x41f310[_0x92e8('0x21')]=qs[_0x92e8('0x21')](_0x4e9fe7[_0x92e8('0x36')][_0x92e8('0x21')]);_0x41f310['offset']=qs['offset'](_0x4e9fe7[_0x92e8('0x36')][_0x92e8('0x1f')]);}_0x41f310['order']=qs[_0x92e8('0x3e')](_0x4e9fe7[_0x92e8('0x36')][_0x92e8('0x3e')]);_0x41f310[_0x92e8('0x3f')]=qs[_0x92e8('0x38')](_[_0x92e8('0x40')](_0x4e9fe7[_0x92e8('0x36')],_0xebffd3[_0x92e8('0x38')]),_0x696942);if(_0x4e9fe7[_0x92e8('0x36')][_0x92e8('0x41')]){_0x41f310[_0x92e8('0x3f')]=_['merge'](_0x41f310[_0x92e8('0x3f')],{'$or':_['map'](_0x696942,function(_0x10e382){if(_0x10e382['type']!==_0x92e8('0x42')){var _0x25808a={};_0x25808a[_0x10e382[_0x92e8('0x2e')]]={'$like':'%'+_0x4e9fe7[_0x92e8('0x36')][_0x92e8('0x41')]+'%'};return _0x25808a;}})});}_0x41f310=_[_0x92e8('0x43')]({},_0x41f310,_0x4e9fe7[_0x92e8('0x44')]);var _0x5e3369={'where':_0x41f310[_0x92e8('0x3f')]};return db['MailQueue'][_0x92e8('0x22')](_0x5e3369)[_0x92e8('0x28')](function(_0x2ae210){_0x2994c6['count']=_0x2ae210;if(_0x4e9fe7['query']['includeAll']){_0x41f310['include']=[{'all':!![]}];}return db[_0x92e8('0x30')][_0x92e8('0x45')](_0x41f310);})[_0x92e8('0x28')](function(_0x476109){_0x2994c6[_0x92e8('0x46')]=_0x476109;return _0x2994c6;})[_0x92e8('0x28')](respondWithFilteredResult(_0x499577,_0x41f310))[_0x92e8('0x47')](handleError(_0x499577,null));};exports[_0x92e8('0x48')]=function(_0x345c63,_0x1873af){var _0x37f270={'raw':!![],'where':{'id':_0x345c63[_0x92e8('0x49')]['id']}},_0x3e7aec={};_0x3e7aec[_0x92e8('0x34')]=_[_0x92e8('0x37')](db['MailQueue'][_0x92e8('0x4a')]);_0x3e7aec[_0x92e8('0x36')]=_[_0x92e8('0x37')](_0x345c63[_0x92e8('0x36')]);_0x3e7aec[_0x92e8('0x38')]=_[_0x92e8('0x39')](_0x3e7aec[_0x92e8('0x34')],_0x3e7aec['query']);_0x37f270[_0x92e8('0x3a')]=_[_0x92e8('0x39')](_0x3e7aec[_0x92e8('0x34')],qs[_0x92e8('0x3b')](_0x345c63['query'][_0x92e8('0x3b')]));_0x37f270[_0x92e8('0x3a')]=_0x37f270[_0x92e8('0x3a')][_0x92e8('0x3c')]?_0x37f270[_0x92e8('0x3a')]:_0x3e7aec['model'];if(_0x345c63[_0x92e8('0x36')][_0x92e8('0x4b')]){_0x37f270['include']=[{'all':!![]}];}_0x37f270=_[_0x92e8('0x43')]({},_0x37f270,_0x345c63['options']);return db['MailQueue']['find'](_0x37f270)['then'](handleEntityNotFound(_0x1873af,null))['then'](respondWithResult(_0x1873af,null))[_0x92e8('0x47')](handleError(_0x1873af,null));};exports[_0x92e8('0x4c')]=function(_0x277527,_0x26f1dd){return db[_0x92e8('0x30')][_0x92e8('0x4c')](_0x277527[_0x92e8('0x4d')],{})[_0x92e8('0x28')](function(_0x312161){var _0x4a8788=_0x277527[_0x92e8('0x4e')][_0x92e8('0x29')]({'plain':!![]});if(!_0x4a8788)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a8788['role']===_0x92e8('0x4e')){var _0x3e7bc7=_0x312161[_0x92e8('0x29')]({'plain':!![]});var _0x3daff4=_0x92e8('0x2a');return db[_0x92e8('0x4f')][_0x92e8('0x50')]({'where':{'name':_0x3daff4,'userProfileId':_0x4a8788[_0x92e8('0x51')]},'raw':!![]})[_0x92e8('0x28')](function(_0x487274){if(_0x487274&&_0x487274['autoAssociation']===0x0){return db[_0x92e8('0x52')][_0x92e8('0x4c')]({'name':_0x3e7bc7[_0x92e8('0x2e')],'resourceId':_0x3e7bc7['id'],'type':_0x487274[_0x92e8('0x2e')],'sectionId':_0x487274['id']},{})[_0x92e8('0x28')](function(){return _0x312161;});}else{return _0x312161;}})[_0x92e8('0x47')](function(_0x305330){logger[_0x92e8('0x2c')](_0x92e8('0x53'),_0x305330);throw _0x305330;});}return _0x312161;})[_0x92e8('0x28')](respondWithResult(_0x26f1dd,0xc9))[_0x92e8('0x47')](handleError(_0x26f1dd,null));};exports[_0x92e8('0x27')]=function(_0x5be260,_0xa3e140){if(_0x5be260[_0x92e8('0x4d')]['id']){delete _0x5be260[_0x92e8('0x4d')]['id'];}return db[_0x92e8('0x30')][_0x92e8('0x50')]({'where':{'id':_0x5be260[_0x92e8('0x49')]['id']}})[_0x92e8('0x28')](handleEntityNotFound(_0xa3e140,null))['then'](saveUpdates(_0x5be260[_0x92e8('0x4d')],null))[_0x92e8('0x28')](respondWithResult(_0xa3e140,null))[_0x92e8('0x47')](handleError(_0xa3e140,null));};exports[_0x92e8('0x2b')]=function(_0x2a87df,_0x525e55){return db[_0x92e8('0x30')]['find']({'where':{'id':_0x2a87df[_0x92e8('0x49')]['id']}})[_0x92e8('0x28')](handleEntityNotFound(_0x525e55,null))[_0x92e8('0x28')](removeEntity(_0x525e55,null))[_0x92e8('0x47')](handleError(_0x525e55,null));};exports[_0x92e8('0x54')]=function(_0x2e0402,_0x191f88){return db['MailQueue'][_0x92e8('0x54')]()[_0x92e8('0x28')](respondWithResult(_0x191f88,null))[_0x92e8('0x47')](handleError(_0x191f88,null));};exports[_0x92e8('0x55')]=function(_0x47645d,_0x49cb12,_0x5224ae){var _0x5495dd={'raw':!![],'where':{}},_0x643e35={},_0x52f0e7;return db[_0x92e8('0x30')][_0x92e8('0x56')]({'where':{'id':_0x47645d[_0x92e8('0x49')]['id']}})[_0x92e8('0x28')](handleEntityNotFound(_0x49cb12,null))[_0x92e8('0x28')](function(_0x29ffe3){if(_0x29ffe3){_0x52f0e7=_0x29ffe3['get']({'plain':!![]});_0x643e35[_0x92e8('0x34')]=_[_0x92e8('0x37')](db['UserMailQueue'][_0x92e8('0x4a')]);_0x643e35[_0x92e8('0x36')]=_[_0x92e8('0x37')](_0x47645d[_0x92e8('0x36')]);_0x643e35[_0x92e8('0x38')]=_['intersection'](_0x643e35[_0x92e8('0x34')],_0x643e35[_0x92e8('0x36')]);_0x5495dd[_0x92e8('0x3a')]=_[_0x92e8('0x39')](_0x643e35['model'],qs[_0x92e8('0x3b')](_0x47645d[_0x92e8('0x36')]['fields']));_0x5495dd[_0x92e8('0x3a')]=_0x5495dd[_0x92e8('0x3a')][_0x92e8('0x3c')]?_0x5495dd[_0x92e8('0x3a')]:_0x643e35['model'];if(!_0x47645d[_0x92e8('0x36')]['hasOwnProperty'](_0x92e8('0x57'))){_0x5495dd[_0x92e8('0x21')]=qs[_0x92e8('0x21')](_0x47645d[_0x92e8('0x36')]['limit']);_0x5495dd['offset']=qs[_0x92e8('0x1f')](_0x47645d[_0x92e8('0x36')][_0x92e8('0x1f')]);}_0x5495dd[_0x92e8('0x58')]=qs['sort'](_0x47645d[_0x92e8('0x36')][_0x92e8('0x3e')]);_0x5495dd[_0x92e8('0x3f')]=qs[_0x92e8('0x38')](_[_0x92e8('0x40')](_0x47645d[_0x92e8('0x36')],_0x643e35[_0x92e8('0x38')]));_0x5495dd[_0x92e8('0x3f')][_0x92e8('0x59')]=_0x29ffe3['id'];if(_0x47645d['query'][_0x92e8('0x41')]){_0x5495dd['where']=_[_0x92e8('0x43')](_0x5495dd['where'],{'$or':_[_0x92e8('0x35')](_0x5495dd[_0x92e8('0x3a')],function(_0x30d5e9){var _0x49bfad={};_0x49bfad[_0x30d5e9]={'$like':'%'+_0x47645d[_0x92e8('0x36')][_0x92e8('0x41')]+'%'};return _0x49bfad;})});}_0x5495dd=_[_0x92e8('0x43')]({},_0x5495dd,_0x47645d[_0x92e8('0x44')]);return db[_0x92e8('0x5a')][_0x92e8('0x45')](_0x5495dd);}})[_0x92e8('0x28')](function(_0x1a649d){if(_0x1a649d){return db[_0x92e8('0x5b')]['findAndCountAll']({'where':{'id':_[_0x92e8('0x35')](_0x1a649d,'UserId'),'role':'agent'},'attributes':['id',_0x92e8('0x2e'),'mailPause',_0x92e8('0x5c'),_0x92e8('0x5d')]});}})[_0x92e8('0x28')](function(_0x4083cf){if(_0x4083cf){return{'count':_0x4083cf['count'],'rows':_[_0x92e8('0x35')](_0x4083cf[_0x92e8('0x46')],function(_0x3e8e2f){return{'membername':_0x3e8e2f[_0x92e8('0x2e')],'UserId':_0x3e8e2f['id'],'queue_name':_0x52f0e7['name'],'MailQueueId':_0x52f0e7['id'],'interface':util[_0x92e8('0x5e')](_0x92e8('0x5f'),'SIP',_0x3e8e2f['name']),'penalty':0x0,'paused':_0x3e8e2f[_0x92e8('0x60')],'createdAt':_0x3e8e2f['createdAt'],'updatedAt':_0x3e8e2f[_0x92e8('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x92e8('0x28')](respondWithFilteredResult(_0x49cb12,_0x5495dd))['catch'](handleError(_0x49cb12,null));};exports[_0x92e8('0x61')]=function(_0x3351ce,_0x21a5df,_0x3f231b){var _0x28ad42={};var _0x105cb8={};var _0x43fce7;var _0x9ae4fd;return db[_0x92e8('0x30')][_0x92e8('0x56')]({'where':{'id':_0x3351ce[_0x92e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x21a5df,null))[_0x92e8('0x28')](function(_0x3579b8){if(_0x3579b8){_0x43fce7=_0x3579b8;_0x105cb8[_0x92e8('0x34')]=_[_0x92e8('0x37')](db[_0x92e8('0x62')][_0x92e8('0x4a')]);_0x105cb8['query']=_[_0x92e8('0x37')](_0x3351ce['query']);_0x105cb8[_0x92e8('0x38')]=_['intersection'](_0x105cb8[_0x92e8('0x34')],_0x105cb8[_0x92e8('0x36')]);_0x28ad42['attributes']=_[_0x92e8('0x39')](_0x105cb8['model'],qs[_0x92e8('0x3b')](_0x3351ce[_0x92e8('0x36')][_0x92e8('0x3b')]));_0x28ad42['attributes']=_0x28ad42[_0x92e8('0x3a')]['length']?_0x28ad42[_0x92e8('0x3a')]:_0x105cb8[_0x92e8('0x34')];_0x28ad42[_0x92e8('0x58')]=qs[_0x92e8('0x3e')](_0x3351ce[_0x92e8('0x36')]['sort']);_0x28ad42[_0x92e8('0x3f')]=qs['filters'](_[_0x92e8('0x40')](_0x3351ce[_0x92e8('0x36')],_0x105cb8[_0x92e8('0x38')]));if(_0x3351ce[_0x92e8('0x36')][_0x92e8('0x41')]){_0x28ad42[_0x92e8('0x3f')]=_['merge'](_0x28ad42[_0x92e8('0x3f')],{'$or':_[_0x92e8('0x35')](_0x28ad42['attributes'],function(_0x48c714){var _0x4e60ad={};_0x4e60ad[_0x48c714]={'$like':'%'+_0x3351ce['query'][_0x92e8('0x41')]+'%'};return _0x4e60ad;})});}_0x28ad42=_[_0x92e8('0x43')]({},_0x28ad42,_0x3351ce[_0x92e8('0x44')]);return _0x43fce7[_0x92e8('0x61')](_0x28ad42);}})[_0x92e8('0x28')](function(_0x32ee22){if(_0x32ee22){_0x9ae4fd=_0x32ee22[_0x92e8('0x3c')];if(!_0x3351ce[_0x92e8('0x36')][_0x92e8('0x3d')](_0x92e8('0x57'))){_0x28ad42['limit']=qs[_0x92e8('0x21')](_0x3351ce[_0x92e8('0x36')][_0x92e8('0x21')]);_0x28ad42['offset']=qs[_0x92e8('0x1f')](_0x3351ce[_0x92e8('0x36')][_0x92e8('0x1f')]);}return _0x43fce7['getTeams'](_0x28ad42);}})[_0x92e8('0x28')](function(_0x319079){if(_0x319079){return _0x319079?{'count':_0x9ae4fd,'rows':_0x319079}:null;}})[_0x92e8('0x28')](respondWithResult(_0x21a5df,null))[_0x92e8('0x47')](handleError(_0x21a5df,null));};exports[_0x92e8('0x63')]=function(_0x474fb9,_0x3216ec,_0x1d094b){var _0x450ba0=_0x474fb9[_0x92e8('0x4d')][_0x92e8('0x64')];return db[_0x92e8('0x62')][_0x92e8('0x45')]({'where':{'id':_0x450ba0},'attributes':['id'],'include':[{'model':db[_0x92e8('0x5b')],'as':_0x92e8('0x65'),'attributes':['id','name',_0x92e8('0x66'),_0x92e8('0x67'),_0x92e8('0x68')],'raw':!![]}]})[_0x92e8('0x28')](function(_0x4983b8){if(_0x4983b8){var _0x31c383=_[_0x92e8('0x69')](_0x4983b8,function(_0x4d7046){var _0x384725=_0x4d7046[_0x92e8('0x29')]({'plain':!![]});return _0x384725['Agents'];});return db[_0x92e8('0x30')][_0x92e8('0x50')]({'where':{'id':_0x474fb9[_0x92e8('0x49')]['id']}})['then'](function(_0x2e80c1){return db[_0x92e8('0x6a')][_0x92e8('0x6b')](function(_0x2c3a0e){return _0x2e80c1[_0x92e8('0x63')](_0x450ba0,{'transaction':_0x2c3a0e})[_0x92e8('0x28')](function(){return BPromise[_0x92e8('0x6c')](_0x31c383,function(_0x18e459){return db[_0x92e8('0x5a')][_0x92e8('0x6d')]({'where':{'UserId':_0x18e459['id'],'MailQueueId':_0x474fb9[_0x92e8('0x49')]['id']},'transaction':_0x2c3a0e});});})[_0x92e8('0x28')](function(){_0x31c383[_0x92e8('0x6e')](function(_0x57c9ec){socket['emit']('userMailQueue:save',{'UserId':_0x57c9ec['id'],'MailQueueId':_0x2e80c1['id']});});});});});}})[_0x92e8('0x28')](respondWithStatusCode(_0x3216ec,null))[_0x92e8('0x47')](handleError(_0x3216ec,null));};exports[_0x92e8('0x6f')]=function(_0x586280,_0x44b08e,_0x22d15f){return db[_0x92e8('0x62')][_0x92e8('0x45')]({'where':{'id':_0x586280['query'][_0x92e8('0x64')]},'attributes':['id'],'include':[{'model':db[_0x92e8('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x92e8('0x28')](handleEntityNotFound(_0x44b08e,null))['then'](function(_0x1d5741){var _0x45fb17=_[_0x92e8('0x35')](_0x1d5741,'id');var _0x56798e=[];var _0x182aac=[];var _0x3421db=squel[_0x92e8('0x70')]();_0x3421db[_0x92e8('0x71')]('tq.TeamId')[_0x92e8('0x72')]('team_has_mail_queues','tq')[_0x92e8('0x73')](_0x92e8('0x74'),'ut',_0x92e8('0x75'))['where']('MailQueueId\x20=\x20?',_0x586280[_0x92e8('0x49')]['id']);for(var _0x43c847=0x0;_0x43c847<_0x1d5741[_0x92e8('0x3c')];_0x43c847+=0x1){let _0x3a6723=_0x1d5741[_0x43c847];for(var _0x936273=0x0;_0x936273<_0x3a6723[_0x92e8('0x65')]['length'];_0x936273+=0x1){let _0x485c85=_0x3a6723[_0x92e8('0x65')][_0x936273];var _0x42cf90=_0x3421db[_0x92e8('0x76')]();_0x42cf90[_0x92e8('0x3f')]('ut.UserId\x20=\x20?',_0x485c85['id']);_0x182aac[_0x92e8('0x77')](db[_0x92e8('0x6a')][_0x92e8('0x36')](_0x42cf90[_0x92e8('0x78')](),{'type':db['sequelize'][_0x92e8('0x79')][_0x92e8('0x7a')]})[_0x92e8('0x28')](function(_0x3842ab){if(_0x3842ab['length']===0x1){return _0x485c85['id'];}else{var _0x202432=_['every'](_[_0x92e8('0x35')](_0x3842ab,_0x92e8('0x7b')),function(_0x25717f){return _[_0x92e8('0x7c')](_0x45fb17,_0x25717f);});if(_0x202432){return _0x485c85['id'];}}}));}}return BPromise[_0x92e8('0x7d')](_0x182aac)['then'](function(_0x3c426f){_0x56798e=_(_0x56798e)[_0x92e8('0x7e')](_0x3c426f)[_0x92e8('0x7f')]()[_0x92e8('0x80')]();return db[_0x92e8('0x30')][_0x92e8('0x50')]({'where':{'id':_0x586280[_0x92e8('0x49')]['id']}})[_0x92e8('0x28')](function(_0x553395){return db['sequelize'][_0x92e8('0x6b')](function(_0x4a44e3){return _0x553395['removeTeams'](_0x586280['query'][_0x92e8('0x64')],{'transaction':_0x4a44e3})[_0x92e8('0x28')](function(){if(!_[_0x92e8('0x81')](_0x56798e)){return _0x553395[_0x92e8('0x82')](_0x56798e,{'transaction':_0x4a44e3});}})['then'](function(){_0x56798e[_0x92e8('0x6e')](function(_0x2d22c0){socket['emit'](_0x92e8('0x83'),{'UserId':_0x2d22c0,'MailQueueId':_0x553395['id']});});});});});});})[_0x92e8('0x28')](respondWithStatusCode(_0x44b08e,null))[_0x92e8('0x47')](handleError(_0x44b08e,null));};exports[_0x92e8('0x84')]=function(_0x10cf21,_0x568fb6,_0x1eed4d){return db[_0x92e8('0x30')][_0x92e8('0x50')]({'where':{'id':_0x10cf21[_0x92e8('0x49')]['id']}})[_0x92e8('0x28')](handleEntityNotFound(_0x568fb6,null))[_0x92e8('0x28')](function(_0x3ea49f){if(_0x3ea49f){return _0x3ea49f[_0x92e8('0x84')](_0x10cf21[_0x92e8('0x4d')][_0x92e8('0x64')],_['omit'](_0x10cf21[_0x92e8('0x4d')],[_0x92e8('0x64'),'id'])||{})[_0x92e8('0x85')](function(_0x2cff09){for(var _0x39e30a=0x0;_0x39e30a<_0x10cf21['body']['ids'][_0x92e8('0x3c')];_0x39e30a+=0x1){socket[_0x92e8('0x86')](_0x92e8('0x87'),{'UserId':Number(_0x10cf21[_0x92e8('0x4d')][_0x92e8('0x64')][_0x39e30a]),'MailQueueId':Number(_0x10cf21[_0x92e8('0x49')]['id'])});}return _0x2cff09;});}})[_0x92e8('0x28')](respondWithResult(_0x568fb6,null))[_0x92e8('0x47')](handleError(_0x568fb6,null));};exports[_0x92e8('0x82')]=function(_0x36e7bb,_0x4dd1b7,_0xf28a19){return db[_0x92e8('0x30')]['find']({'where':{'id':_0x36e7bb[_0x92e8('0x49')]['id']}})[_0x92e8('0x28')](handleEntityNotFound(_0x4dd1b7,null))[_0x92e8('0x28')](function(_0x2aecfb){if(_0x2aecfb){return _0x2aecfb[_0x92e8('0x82')](_0x36e7bb[_0x92e8('0x36')][_0x92e8('0x64')])[_0x92e8('0x28')](function(){if(_[_0x92e8('0x88')](_0x36e7bb[_0x92e8('0x36')][_0x92e8('0x64')])){for(var _0x3fdb18=0x0;_0x3fdb18<_0x36e7bb[_0x92e8('0x36')][_0x92e8('0x64')][_0x92e8('0x3c')];_0x3fdb18+=0x1){socket[_0x92e8('0x86')](_0x92e8('0x83'),{'UserId':Number(_0x36e7bb[_0x92e8('0x36')][_0x92e8('0x64')][_0x3fdb18]),'MailQueueId':Number(_0x36e7bb[_0x92e8('0x49')]['id'])});}}else{socket[_0x92e8('0x86')](_0x92e8('0x83'),{'UserId':Number(_0x36e7bb[_0x92e8('0x36')][_0x92e8('0x64')]),'MailQueueId':Number(_0x36e7bb[_0x92e8('0x49')]['id'])});}});}})[_0x92e8('0x28')](respondWithStatusCode(_0x4dd1b7,null))[_0x92e8('0x47')](handleError(_0x4dd1b7,null));};exports[_0x92e8('0x89')]=function(_0x554eb6,_0x3e0660,_0x15d7fc){var _0x893e64={};var _0x52b16c={};var _0x41b7d7;var _0x22dab8;return db[_0x92e8('0x30')][_0x92e8('0x56')]({'where':{'id':_0x554eb6['params']['id']}})[_0x92e8('0x28')](handleEntityNotFound(_0x3e0660,null))['then'](function(_0x2c7cb6){if(_0x2c7cb6){_0x41b7d7=_0x2c7cb6;_0x52b16c[_0x92e8('0x34')]=_[_0x92e8('0x37')](db[_0x92e8('0x5b')][_0x92e8('0x4a')]);_0x52b16c['query']=_[_0x92e8('0x37')](_0x554eb6[_0x92e8('0x36')]);_0x52b16c[_0x92e8('0x38')]=_[_0x92e8('0x39')](_0x52b16c[_0x92e8('0x34')],_0x52b16c[_0x92e8('0x36')]);_0x893e64['attributes']=_[_0x92e8('0x39')](_0x52b16c[_0x92e8('0x34')],qs[_0x92e8('0x3b')](_0x554eb6[_0x92e8('0x36')][_0x92e8('0x3b')]));_0x893e64[_0x92e8('0x3a')]=_0x893e64[_0x92e8('0x3a')]['length']?_0x893e64['attributes']:_0x52b16c[_0x92e8('0x34')];_0x893e64['order']=qs[_0x92e8('0x3e')](_0x554eb6[_0x92e8('0x36')][_0x92e8('0x3e')]);_0x893e64[_0x92e8('0x3f')]=qs[_0x92e8('0x38')](_[_0x92e8('0x40')](_0x554eb6[_0x92e8('0x36')],_0x52b16c[_0x92e8('0x38')]));if(_0x554eb6[_0x92e8('0x36')][_0x92e8('0x41')]){_0x893e64[_0x92e8('0x3f')]=_[_0x92e8('0x43')](_0x893e64['where'],{'$or':_[_0x92e8('0x35')](_0x893e64[_0x92e8('0x3a')],function(_0x13fa42){var _0x1b9758={};_0x1b9758[_0x13fa42]={'$like':'%'+_0x554eb6[_0x92e8('0x36')][_0x92e8('0x41')]+'%'};return _0x1b9758;})});}_0x893e64=_[_0x92e8('0x43')]({},_0x893e64,_0x554eb6[_0x92e8('0x44')]);return _0x41b7d7['getAgents'](_0x893e64);}})[_0x92e8('0x28')](function(_0xb3d56a){if(_0xb3d56a){_0x22dab8=_0xb3d56a[_0x92e8('0x3c')];if(!_0x554eb6['query'][_0x92e8('0x3d')](_0x92e8('0x57'))){_0x893e64[_0x92e8('0x21')]=qs['limit'](_0x554eb6[_0x92e8('0x36')]['limit']);_0x893e64[_0x92e8('0x1f')]=qs[_0x92e8('0x1f')](_0x554eb6[_0x92e8('0x36')][_0x92e8('0x1f')]);}return _0x41b7d7[_0x92e8('0x89')](_0x893e64);}})[_0x92e8('0x28')](function(_0x311616){if(_0x311616){return _0x311616?{'count':_0x22dab8,'rows':_0x311616}:null;}})[_0x92e8('0x28')](respondWithResult(_0x3e0660,null))[_0x92e8('0x47')](handleError(_0x3e0660,null));};
\ No newline at end of file
+var _0xea03=['merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','describe','getMembers','findOne','hasOwnProperty','filter','User','findAndCountAll','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','Agents','online','flatMap','sequelize','each','UserMailQueue','findOrCreate','forEach','emit','userMailQueue:save','ids','select','field','tq.TeamId','from','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','sendStatus','error','stack','name','send','map','MailQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xea03,0x15e));var _0x3ea0=function(_0x469add,_0x50ef21){_0x469add=_0x469add-0x0;var _0x2e8a26=_0xea03[_0x469add];return _0x2e8a26;};'use strict';var emlformat=require(_0x3ea0('0x0'));var rimraf=require(_0x3ea0('0x1'));var zipdir=require(_0x3ea0('0x2'));var jsonpatch=require(_0x3ea0('0x3'));var rp=require(_0x3ea0('0x4'));var moment=require(_0x3ea0('0x5'));var BPromise=require(_0x3ea0('0x6'));var Mustache=require('mustache');var util=require(_0x3ea0('0x7'));var path=require(_0x3ea0('0x8'));var sox=require(_0x3ea0('0x9'));var csv=require(_0x3ea0('0xa'));var ejs=require(_0x3ea0('0xb'));var fs=require('fs');var fs_extra=require(_0x3ea0('0xc'));var _=require(_0x3ea0('0xd'));var squel=require(_0x3ea0('0xe'));var crypto=require('crypto');var jsforce=require(_0x3ea0('0xf'));var deskjs=require(_0x3ea0('0x10'));var toCsv=require(_0x3ea0('0xa'));var querystring=require(_0x3ea0('0x11'));var Papa=require('papaparse');var Redis=require(_0x3ea0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3ea0('0x13'));var as=require(_0x3ea0('0x14'));var hardwareService=require(_0x3ea0('0x15'));var logger=require(_0x3ea0('0x16'))(_0x3ea0('0x17'));var utils=require(_0x3ea0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3ea0('0x19'));var db=require(_0x3ea0('0x1a'))['db'];config[_0x3ea0('0x1b')]=_[_0x3ea0('0x1c')](config[_0x3ea0('0x1b')],{'host':_0x3ea0('0x1d'),'port':0x18eb});var socket=require(_0x3ea0('0x1e'))(new Redis(config[_0x3ea0('0x1b')]));require(_0x3ea0('0x1f'))[_0x3ea0('0x20')](socket);function respondWithStatusCode(_0x45ab6a,_0x12e724){_0x12e724=_0x12e724||0xcc;return function(_0x585a8c){if(_0x585a8c){return _0x45ab6a['sendStatus'](_0x12e724);}return _0x45ab6a[_0x3ea0('0x21')](_0x12e724)['end']();};}function respondWithResult(_0x2f757f,_0x3a75e5){_0x3a75e5=_0x3a75e5||0xc8;return function(_0x3f85f4){if(_0x3f85f4){return _0x2f757f[_0x3ea0('0x21')](_0x3a75e5)[_0x3ea0('0x22')](_0x3f85f4);}};}function respondWithFilteredResult(_0x56edec,_0x2efbfd){return function(_0x514ec8){if(_0x514ec8){var _0xe87b35=typeof _0x2efbfd[_0x3ea0('0x23')]==='undefined'&&typeof _0x2efbfd[_0x3ea0('0x24')]===_0x3ea0('0x25');var _0x56bed1=_0x514ec8[_0x3ea0('0x26')];var _0xe618b3=_0xe87b35?0x0:_0x2efbfd[_0x3ea0('0x23')];var _0x541ae5=_0xe87b35?_0x514ec8['count']:_0x2efbfd[_0x3ea0('0x23')]+_0x2efbfd[_0x3ea0('0x24')];var _0x420a70;if(_0x541ae5>=_0x56bed1){_0x541ae5=_0x56bed1;_0x420a70=0xc8;}else{_0x420a70=0xce;}_0x56edec[_0x3ea0('0x21')](_0x420a70);return _0x56edec[_0x3ea0('0x27')]('Content-Range',_0xe618b3+'-'+_0x541ae5+'/'+_0x56bed1)[_0x3ea0('0x22')](_0x514ec8);}return null;};}function patchUpdates(_0xe73905){return function(_0x3cda1e){try{jsonpatch[_0x3ea0('0x28')](_0x3cda1e,_0xe73905,!![]);}catch(_0x4e8253){return BPromise[_0x3ea0('0x29')](_0x4e8253);}return _0x3cda1e[_0x3ea0('0x2a')]();};}function saveUpdates(_0x440ced,_0x3fcd8e){return function(_0x3fa1a9){if(_0x3fa1a9){return _0x3fa1a9[_0x3ea0('0x2b')](_0x440ced)[_0x3ea0('0x2c')](function(_0x26562d){return _0x26562d;});}return null;};}function removeEntity(_0x313a2b,_0x1d6031){return function(_0x277562){if(_0x277562){return _0x277562[_0x3ea0('0x2d')]()[_0x3ea0('0x2c')](function(){var _0x46d82f=_0x277562[_0x3ea0('0x2e')]({'plain':!![]});var _0x573f11=_0x3ea0('0x2f');return db[_0x3ea0('0x30')]['destroy']({'where':{'type':_0x573f11,'resourceId':_0x46d82f['id']}})[_0x3ea0('0x2c')](function(){return _0x277562;});})['then'](function(){_0x313a2b[_0x3ea0('0x21')](0xcc)[_0x3ea0('0x31')]();});}};}function handleEntityNotFound(_0x4fd347,_0x4c4b2f){return function(_0x5d403a){if(!_0x5d403a){_0x4fd347[_0x3ea0('0x32')](0x194);}return _0x5d403a;};}function handleError(_0x37dbc0,_0x23f8fa){_0x23f8fa=_0x23f8fa||0x1f4;return function(_0x24fb50){logger[_0x3ea0('0x33')](_0x24fb50[_0x3ea0('0x34')]);if(_0x24fb50[_0x3ea0('0x35')]){delete _0x24fb50[_0x3ea0('0x35')];}_0x37dbc0[_0x3ea0('0x21')](_0x23f8fa)[_0x3ea0('0x36')](_0x24fb50);};}exports['index']=function(_0x460875,_0x501ccb){var _0x67c14c={},_0x2aecd4={},_0x4d1c38={'count':0x0,'rows':[]};var _0x13d75c=_[_0x3ea0('0x37')](db[_0x3ea0('0x38')][_0x3ea0('0x39')],function(_0x247209){return{'name':_0x247209['fieldName'],'type':_0x247209[_0x3ea0('0x3a')][_0x3ea0('0x3b')]};});_0x2aecd4[_0x3ea0('0x3c')]=_[_0x3ea0('0x37')](_0x13d75c,_0x3ea0('0x35'));_0x2aecd4[_0x3ea0('0x3d')]=_[_0x3ea0('0x3e')](_0x460875[_0x3ea0('0x3d')]);_0x2aecd4[_0x3ea0('0x3f')]=_[_0x3ea0('0x40')](_0x2aecd4[_0x3ea0('0x3c')],_0x2aecd4[_0x3ea0('0x3d')]);_0x67c14c[_0x3ea0('0x41')]=_[_0x3ea0('0x40')](_0x2aecd4[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x460875['query'][_0x3ea0('0x42')]));_0x67c14c['attributes']=_0x67c14c[_0x3ea0('0x41')]['length']?_0x67c14c[_0x3ea0('0x41')]:_0x2aecd4[_0x3ea0('0x3c')];if(!_0x460875[_0x3ea0('0x3d')]['hasOwnProperty'](_0x3ea0('0x43'))){_0x67c14c[_0x3ea0('0x24')]=qs[_0x3ea0('0x24')](_0x460875['query'][_0x3ea0('0x24')]);_0x67c14c[_0x3ea0('0x23')]=qs[_0x3ea0('0x23')](_0x460875[_0x3ea0('0x3d')][_0x3ea0('0x23')]);}_0x67c14c[_0x3ea0('0x44')]=qs['sort'](_0x460875[_0x3ea0('0x3d')][_0x3ea0('0x45')]);_0x67c14c[_0x3ea0('0x46')]=qs[_0x3ea0('0x3f')](_[_0x3ea0('0x47')](_0x460875[_0x3ea0('0x3d')],_0x2aecd4[_0x3ea0('0x3f')]),_0x13d75c);if(_0x460875[_0x3ea0('0x3d')]['filter']){_0x67c14c[_0x3ea0('0x46')]=_['merge'](_0x67c14c[_0x3ea0('0x46')],{'$or':_[_0x3ea0('0x37')](_0x13d75c,function(_0x2090a6){if(_0x2090a6[_0x3ea0('0x3a')]!==_0x3ea0('0x48')){var _0x121573={};_0x121573[_0x2090a6[_0x3ea0('0x35')]]={'$like':'%'+_0x460875[_0x3ea0('0x3d')]['filter']+'%'};return _0x121573;}})});}_0x67c14c=_[_0x3ea0('0x49')]({},_0x67c14c,_0x460875[_0x3ea0('0x4a')]);var _0x4a6681={'where':_0x67c14c[_0x3ea0('0x46')]};return db[_0x3ea0('0x38')]['count'](_0x4a6681)[_0x3ea0('0x2c')](function(_0x217c29){_0x4d1c38[_0x3ea0('0x26')]=_0x217c29;if(_0x460875[_0x3ea0('0x3d')][_0x3ea0('0x4b')]){_0x67c14c[_0x3ea0('0x4c')]=[{'all':!![]}];}return db['MailQueue'][_0x3ea0('0x4d')](_0x67c14c);})[_0x3ea0('0x2c')](function(_0x2e4296){_0x4d1c38[_0x3ea0('0x4e')]=_0x2e4296;return _0x4d1c38;})['then'](respondWithFilteredResult(_0x501ccb,_0x67c14c))[_0x3ea0('0x4f')](handleError(_0x501ccb,null));};exports['show']=function(_0x39d8e2,_0x217326){var _0x4a3deb={'raw':!![],'where':{'id':_0x39d8e2[_0x3ea0('0x50')]['id']}},_0x49ab0f={};_0x49ab0f['model']=_['keys'](db[_0x3ea0('0x38')][_0x3ea0('0x39')]);_0x49ab0f['query']=_[_0x3ea0('0x3e')](_0x39d8e2['query']);_0x49ab0f['filters']=_['intersection'](_0x49ab0f[_0x3ea0('0x3c')],_0x49ab0f[_0x3ea0('0x3d')]);_0x4a3deb[_0x3ea0('0x41')]=_[_0x3ea0('0x40')](_0x49ab0f[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x39d8e2['query'][_0x3ea0('0x42')]));_0x4a3deb[_0x3ea0('0x41')]=_0x4a3deb[_0x3ea0('0x41')][_0x3ea0('0x51')]?_0x4a3deb['attributes']:_0x49ab0f[_0x3ea0('0x3c')];if(_0x39d8e2['query'][_0x3ea0('0x4b')]){_0x4a3deb['include']=[{'all':!![]}];}_0x4a3deb=_[_0x3ea0('0x49')]({},_0x4a3deb,_0x39d8e2['options']);return db['MailQueue'][_0x3ea0('0x52')](_0x4a3deb)['then'](handleEntityNotFound(_0x217326,null))[_0x3ea0('0x2c')](respondWithResult(_0x217326,null))[_0x3ea0('0x4f')](handleError(_0x217326,null));};exports[_0x3ea0('0x53')]=function(_0x503938,_0x1ed4ba){return db[_0x3ea0('0x38')][_0x3ea0('0x53')](_0x503938[_0x3ea0('0x54')],{})[_0x3ea0('0x2c')](function(_0x131a68){var _0x2a8037=_0x503938[_0x3ea0('0x55')]['get']({'plain':!![]});if(!_0x2a8037)throw new Error(_0x3ea0('0x56'));if(_0x2a8037['role']===_0x3ea0('0x55')){var _0x138742=_0x131a68['get']({'plain':!![]});var _0x260bfc=_0x3ea0('0x2f');return db[_0x3ea0('0x57')][_0x3ea0('0x52')]({'where':{'name':_0x260bfc,'userProfileId':_0x2a8037['userProfileId']},'raw':!![]})['then'](function(_0x726e45){if(_0x726e45&&_0x726e45[_0x3ea0('0x58')]===0x0){return db[_0x3ea0('0x30')][_0x3ea0('0x53')]({'name':_0x138742[_0x3ea0('0x35')],'resourceId':_0x138742['id'],'type':_0x726e45['name'],'sectionId':_0x726e45['id']},{})['then'](function(){return _0x131a68;});}else{return _0x131a68;}})[_0x3ea0('0x4f')](function(_0x9106e5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9106e5);throw _0x9106e5;});}return _0x131a68;})[_0x3ea0('0x2c')](respondWithResult(_0x1ed4ba,0xc9))[_0x3ea0('0x4f')](handleError(_0x1ed4ba,null));};exports[_0x3ea0('0x2b')]=function(_0x12cbe4,_0x1fdda3){if(_0x12cbe4['body']['id']){delete _0x12cbe4[_0x3ea0('0x54')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x12cbe4[_0x3ea0('0x50')]['id']}})['then'](handleEntityNotFound(_0x1fdda3,null))['then'](saveUpdates(_0x12cbe4[_0x3ea0('0x54')],null))['then'](respondWithResult(_0x1fdda3,null))['catch'](handleError(_0x1fdda3,null));};exports[_0x3ea0('0x2d')]=function(_0x245099,_0x4335c5){return db['MailQueue'][_0x3ea0('0x52')]({'where':{'id':_0x245099[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](handleEntityNotFound(_0x4335c5,null))[_0x3ea0('0x2c')](removeEntity(_0x4335c5,null))[_0x3ea0('0x4f')](handleError(_0x4335c5,null));};exports[_0x3ea0('0x59')]=function(_0x489fa7,_0x513a42){return db[_0x3ea0('0x38')][_0x3ea0('0x59')]()[_0x3ea0('0x2c')](respondWithResult(_0x513a42,null))[_0x3ea0('0x4f')](handleError(_0x513a42,null));};exports[_0x3ea0('0x5a')]=function(_0x2561b8,_0x595a92,_0x214bdf){var _0x571042={'raw':!![],'where':{}},_0x227e93={},_0x597210;return db['MailQueue'][_0x3ea0('0x5b')]({'where':{'id':_0x2561b8[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](handleEntityNotFound(_0x595a92,null))[_0x3ea0('0x2c')](function(_0x119aa0){if(_0x119aa0){_0x597210=_0x119aa0[_0x3ea0('0x2e')]({'plain':!![]});_0x227e93[_0x3ea0('0x3c')]=_[_0x3ea0('0x3e')](db['UserMailQueue'][_0x3ea0('0x39')]);_0x227e93['query']=_[_0x3ea0('0x3e')](_0x2561b8[_0x3ea0('0x3d')]);_0x227e93[_0x3ea0('0x3f')]=_[_0x3ea0('0x40')](_0x227e93[_0x3ea0('0x3c')],_0x227e93['query']);_0x571042[_0x3ea0('0x41')]=_[_0x3ea0('0x40')](_0x227e93[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x2561b8[_0x3ea0('0x3d')]['fields']));_0x571042['attributes']=_0x571042['attributes'][_0x3ea0('0x51')]?_0x571042[_0x3ea0('0x41')]:_0x227e93[_0x3ea0('0x3c')];if(!_0x2561b8[_0x3ea0('0x3d')][_0x3ea0('0x5c')](_0x3ea0('0x43'))){_0x571042['limit']=qs['limit'](_0x2561b8[_0x3ea0('0x3d')][_0x3ea0('0x24')]);_0x571042[_0x3ea0('0x23')]=qs['offset'](_0x2561b8['query'][_0x3ea0('0x23')]);}_0x571042['order']=qs['sort'](_0x2561b8['query'][_0x3ea0('0x45')]);_0x571042[_0x3ea0('0x46')]=qs[_0x3ea0('0x3f')](_[_0x3ea0('0x47')](_0x2561b8['query'],_0x227e93[_0x3ea0('0x3f')]));_0x571042['where']['MailQueueId']=_0x119aa0['id'];if(_0x2561b8[_0x3ea0('0x3d')][_0x3ea0('0x5d')]){_0x571042[_0x3ea0('0x46')]=_[_0x3ea0('0x49')](_0x571042[_0x3ea0('0x46')],{'$or':_[_0x3ea0('0x37')](_0x571042[_0x3ea0('0x41')],function(_0x207e5a){var _0x340a49={};_0x340a49[_0x207e5a]={'$like':'%'+_0x2561b8[_0x3ea0('0x3d')][_0x3ea0('0x5d')]+'%'};return _0x340a49;})});}_0x571042=_[_0x3ea0('0x49')]({},_0x571042,_0x2561b8[_0x3ea0('0x4a')]);return db['UserMailQueue'][_0x3ea0('0x4d')](_0x571042);}})[_0x3ea0('0x2c')](function(_0x5f2504){if(_0x5f2504){return db[_0x3ea0('0x5e')][_0x3ea0('0x5f')]({'where':{'id':_[_0x3ea0('0x37')](_0x5f2504,'UserId'),'role':_0x3ea0('0x60')},'attributes':['id','name',_0x3ea0('0x61'),_0x3ea0('0x62'),'createdAt']});}})[_0x3ea0('0x2c')](function(_0x5aa0d0){if(_0x5aa0d0){return{'count':_0x5aa0d0[_0x3ea0('0x26')],'rows':_['map'](_0x5aa0d0[_0x3ea0('0x4e')],function(_0x202267){return{'membername':_0x202267['name'],'UserId':_0x202267['id'],'queue_name':_0x597210[_0x3ea0('0x35')],'MailQueueId':_0x597210['id'],'interface':util[_0x3ea0('0x63')](_0x3ea0('0x64'),_0x3ea0('0x65'),_0x202267[_0x3ea0('0x35')]),'penalty':0x0,'paused':_0x202267[_0x3ea0('0x61')],'createdAt':_0x202267[_0x3ea0('0x66')],'updatedAt':_0x202267[_0x3ea0('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3ea0('0x2c')](respondWithFilteredResult(_0x595a92,_0x571042))[_0x3ea0('0x4f')](handleError(_0x595a92,null));};exports[_0x3ea0('0x67')]=function(_0x42749f,_0x15e8bd,_0x5bfd5c){var _0x1122cf={};var _0x3bd7b3={};var _0x451b48;var _0x5801a5;return db[_0x3ea0('0x38')]['findOne']({'where':{'id':_0x42749f[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](handleEntityNotFound(_0x15e8bd,null))[_0x3ea0('0x2c')](function(_0x4ad81d){if(_0x4ad81d){_0x451b48=_0x4ad81d;_0x3bd7b3[_0x3ea0('0x3c')]=_[_0x3ea0('0x3e')](db[_0x3ea0('0x68')][_0x3ea0('0x39')]);_0x3bd7b3[_0x3ea0('0x3d')]=_['keys'](_0x42749f[_0x3ea0('0x3d')]);_0x3bd7b3[_0x3ea0('0x3f')]=_[_0x3ea0('0x40')](_0x3bd7b3['model'],_0x3bd7b3[_0x3ea0('0x3d')]);_0x1122cf[_0x3ea0('0x41')]=_[_0x3ea0('0x40')](_0x3bd7b3[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x42749f['query'][_0x3ea0('0x42')]));_0x1122cf['attributes']=_0x1122cf['attributes'][_0x3ea0('0x51')]?_0x1122cf['attributes']:_0x3bd7b3[_0x3ea0('0x3c')];_0x1122cf['order']=qs[_0x3ea0('0x45')](_0x42749f[_0x3ea0('0x3d')]['sort']);_0x1122cf[_0x3ea0('0x46')]=qs['filters'](_[_0x3ea0('0x47')](_0x42749f[_0x3ea0('0x3d')],_0x3bd7b3[_0x3ea0('0x3f')]));if(_0x42749f[_0x3ea0('0x3d')]['filter']){_0x1122cf[_0x3ea0('0x46')]=_['merge'](_0x1122cf[_0x3ea0('0x46')],{'$or':_[_0x3ea0('0x37')](_0x1122cf[_0x3ea0('0x41')],function(_0x386091){var _0x18996e={};_0x18996e[_0x386091]={'$like':'%'+_0x42749f[_0x3ea0('0x3d')][_0x3ea0('0x5d')]+'%'};return _0x18996e;})});}_0x1122cf=_[_0x3ea0('0x49')]({},_0x1122cf,_0x42749f[_0x3ea0('0x4a')]);return _0x451b48[_0x3ea0('0x67')](_0x1122cf);}})[_0x3ea0('0x2c')](function(_0x5396ce){if(_0x5396ce){_0x5801a5=_0x5396ce['length'];if(!_0x42749f[_0x3ea0('0x3d')][_0x3ea0('0x5c')](_0x3ea0('0x43'))){_0x1122cf[_0x3ea0('0x24')]=qs[_0x3ea0('0x24')](_0x42749f[_0x3ea0('0x3d')]['limit']);_0x1122cf['offset']=qs[_0x3ea0('0x23')](_0x42749f['query'][_0x3ea0('0x23')]);}return _0x451b48[_0x3ea0('0x67')](_0x1122cf);}})[_0x3ea0('0x2c')](function(_0x1716e3){if(_0x1716e3){return _0x1716e3?{'count':_0x5801a5,'rows':_0x1716e3}:null;}})['then'](respondWithResult(_0x15e8bd,null))[_0x3ea0('0x4f')](handleError(_0x15e8bd,null));};exports[_0x3ea0('0x69')]=function(_0x22b1c7,_0x36e6af,_0x854ff9){var _0x184e40=_0x22b1c7[_0x3ea0('0x54')]['ids'];return db[_0x3ea0('0x68')][_0x3ea0('0x4d')]({'where':{'id':_0x184e40},'attributes':['id'],'include':[{'model':db[_0x3ea0('0x5e')],'as':_0x3ea0('0x6a'),'attributes':['id',_0x3ea0('0x35'),_0x3ea0('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0x3ea0('0x2c')](function(_0x4510b9){if(_0x4510b9){var _0x1082fb=_[_0x3ea0('0x6c')](_0x4510b9,function(_0x49256a){var _0x17a9f6=_0x49256a[_0x3ea0('0x2e')]({'plain':!![]});return _0x17a9f6['Agents'];});return db['MailQueue'][_0x3ea0('0x52')]({'where':{'id':_0x22b1c7[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](function(_0x368233){return db[_0x3ea0('0x6d')]['transaction'](function(_0x2f82f0){return _0x368233['addTeams'](_0x184e40,{'transaction':_0x2f82f0})[_0x3ea0('0x2c')](function(){return BPromise[_0x3ea0('0x6e')](_0x1082fb,function(_0x5179b2){return db[_0x3ea0('0x6f')][_0x3ea0('0x70')]({'where':{'UserId':_0x5179b2['id'],'MailQueueId':_0x22b1c7[_0x3ea0('0x50')]['id']},'transaction':_0x2f82f0});});})[_0x3ea0('0x2c')](function(){_0x1082fb[_0x3ea0('0x71')](function(_0x326dc3){socket[_0x3ea0('0x72')](_0x3ea0('0x73'),{'UserId':_0x326dc3['id'],'MailQueueId':_0x368233['id']});});});});});}})[_0x3ea0('0x2c')](respondWithStatusCode(_0x36e6af,null))[_0x3ea0('0x4f')](handleError(_0x36e6af,null));};exports['removeTeams']=function(_0x5aace2,_0x15713f,_0x5f5309){return db[_0x3ea0('0x68')][_0x3ea0('0x4d')]({'where':{'id':_0x5aace2[_0x3ea0('0x3d')][_0x3ea0('0x74')]},'attributes':['id'],'include':[{'model':db[_0x3ea0('0x5e')],'as':_0x3ea0('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x15713f,null))[_0x3ea0('0x2c')](function(_0x4c8065){var _0xa7a117=_[_0x3ea0('0x37')](_0x4c8065,'id');var _0x1aa541=[];var _0x3df196=[];var _0x2ec0bc=squel[_0x3ea0('0x75')]();_0x2ec0bc[_0x3ea0('0x76')](_0x3ea0('0x77'))[_0x3ea0('0x78')]('team_has_mail_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3ea0('0x46')]('MailQueueId\x20=\x20?',_0x5aace2[_0x3ea0('0x50')]['id']);for(var _0x919388=0x0;_0x919388<_0x4c8065[_0x3ea0('0x51')];_0x919388+=0x1){let _0x30f41f=_0x4c8065[_0x919388];for(var _0x4a0a87=0x0;_0x4a0a87<_0x30f41f[_0x3ea0('0x6a')][_0x3ea0('0x51')];_0x4a0a87+=0x1){let _0x5c8b24=_0x30f41f['Agents'][_0x4a0a87];var _0x2bdd0b=_0x2ec0bc[_0x3ea0('0x79')]();_0x2bdd0b[_0x3ea0('0x46')](_0x3ea0('0x7a'),_0x5c8b24['id']);_0x3df196[_0x3ea0('0x7b')](db['sequelize'][_0x3ea0('0x3d')](_0x2bdd0b[_0x3ea0('0x7c')](),{'type':db[_0x3ea0('0x6d')][_0x3ea0('0x7d')]['SELECT']})['then'](function(_0x5f03fb){if(_0x5f03fb[_0x3ea0('0x51')]===0x1){return _0x5c8b24['id'];}else{var _0x4771cb=_[_0x3ea0('0x7e')](_[_0x3ea0('0x37')](_0x5f03fb,_0x3ea0('0x7f')),function(_0x451e0d){return _[_0x3ea0('0x80')](_0xa7a117,_0x451e0d);});if(_0x4771cb){return _0x5c8b24['id'];}}}));}}return BPromise[_0x3ea0('0x81')](_0x3df196)[_0x3ea0('0x2c')](function(_0xe230f5){_0x1aa541=_(_0x1aa541)[_0x3ea0('0x82')](_0xe230f5)[_0x3ea0('0x83')]()['value']();return db[_0x3ea0('0x38')]['find']({'where':{'id':_0x5aace2[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](function(_0x4f8284){return db[_0x3ea0('0x6d')]['transaction'](function(_0xbc4332){return _0x4f8284[_0x3ea0('0x84')](_0x5aace2[_0x3ea0('0x3d')][_0x3ea0('0x74')],{'transaction':_0xbc4332})[_0x3ea0('0x2c')](function(){if(!_[_0x3ea0('0x85')](_0x1aa541)){return _0x4f8284[_0x3ea0('0x86')](_0x1aa541,{'transaction':_0xbc4332});}})[_0x3ea0('0x2c')](function(){_0x1aa541[_0x3ea0('0x71')](function(_0x553778){socket[_0x3ea0('0x72')](_0x3ea0('0x87'),{'UserId':_0x553778,'MailQueueId':_0x4f8284['id']});});});});});});})[_0x3ea0('0x2c')](respondWithStatusCode(_0x15713f,null))['catch'](handleError(_0x15713f,null));};exports[_0x3ea0('0x88')]=function(_0x540026,_0x444f6d,_0x1954f3){return db[_0x3ea0('0x38')][_0x3ea0('0x52')]({'where':{'id':_0x540026[_0x3ea0('0x50')]['id']}})['then'](handleEntityNotFound(_0x444f6d,null))['then'](function(_0x349e49){if(_0x349e49){return _0x349e49[_0x3ea0('0x88')](_0x540026['body'][_0x3ea0('0x74')],_[_0x3ea0('0x89')](_0x540026[_0x3ea0('0x54')],['ids','id'])||{})[_0x3ea0('0x8a')](function(_0x5a710a){for(var _0x4da028=0x0;_0x4da028<_0x540026[_0x3ea0('0x54')][_0x3ea0('0x74')][_0x3ea0('0x51')];_0x4da028+=0x1){socket['emit'](_0x3ea0('0x73'),{'UserId':Number(_0x540026[_0x3ea0('0x54')][_0x3ea0('0x74')][_0x4da028]),'MailQueueId':Number(_0x540026[_0x3ea0('0x50')]['id'])});}return _0x5a710a;});}})[_0x3ea0('0x2c')](respondWithResult(_0x444f6d,null))[_0x3ea0('0x4f')](handleError(_0x444f6d,null));};exports[_0x3ea0('0x86')]=function(_0x223955,_0x4b8b8b,_0x90ec0c){return db[_0x3ea0('0x38')][_0x3ea0('0x52')]({'where':{'id':_0x223955[_0x3ea0('0x50')]['id']}})['then'](handleEntityNotFound(_0x4b8b8b,null))[_0x3ea0('0x2c')](function(_0x54ebb4){if(_0x54ebb4){return _0x54ebb4[_0x3ea0('0x86')](_0x223955[_0x3ea0('0x3d')][_0x3ea0('0x74')])[_0x3ea0('0x2c')](function(){if(_[_0x3ea0('0x8b')](_0x223955[_0x3ea0('0x3d')][_0x3ea0('0x74')])){for(var _0x4c664e=0x0;_0x4c664e<_0x223955[_0x3ea0('0x3d')]['ids'][_0x3ea0('0x51')];_0x4c664e+=0x1){socket[_0x3ea0('0x72')](_0x3ea0('0x87'),{'UserId':Number(_0x223955['query']['ids'][_0x4c664e]),'MailQueueId':Number(_0x223955[_0x3ea0('0x50')]['id'])});}}else{socket['emit'](_0x3ea0('0x87'),{'UserId':Number(_0x223955['query']['ids']),'MailQueueId':Number(_0x223955[_0x3ea0('0x50')]['id'])});}});}})[_0x3ea0('0x2c')](respondWithStatusCode(_0x4b8b8b,null))[_0x3ea0('0x4f')](handleError(_0x4b8b8b,null));};exports['getAgents']=function(_0x3b0416,_0x226ff8,_0x2b8682){var _0x552144={};var _0x543467={};var _0x50f9fa;var _0x417092;return db['MailQueue'][_0x3ea0('0x5b')]({'where':{'id':_0x3b0416[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](handleEntityNotFound(_0x226ff8,null))[_0x3ea0('0x2c')](function(_0x2963c8){if(_0x2963c8){_0x50f9fa=_0x2963c8;_0x543467[_0x3ea0('0x3c')]=_[_0x3ea0('0x3e')](db[_0x3ea0('0x5e')][_0x3ea0('0x39')]);_0x543467[_0x3ea0('0x3d')]=_[_0x3ea0('0x3e')](_0x3b0416[_0x3ea0('0x3d')]);_0x543467['filters']=_[_0x3ea0('0x40')](_0x543467['model'],_0x543467['query']);_0x552144['attributes']=_[_0x3ea0('0x40')](_0x543467[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x3b0416[_0x3ea0('0x3d')][_0x3ea0('0x42')]));_0x552144[_0x3ea0('0x41')]=_0x552144[_0x3ea0('0x41')][_0x3ea0('0x51')]?_0x552144[_0x3ea0('0x41')]:_0x543467['model'];_0x552144[_0x3ea0('0x44')]=qs['sort'](_0x3b0416[_0x3ea0('0x3d')]['sort']);_0x552144[_0x3ea0('0x46')]=qs[_0x3ea0('0x3f')](_[_0x3ea0('0x47')](_0x3b0416[_0x3ea0('0x3d')],_0x543467['filters']));if(_0x3b0416[_0x3ea0('0x3d')]['filter']){_0x552144['where']=_['merge'](_0x552144[_0x3ea0('0x46')],{'$or':_[_0x3ea0('0x37')](_0x552144[_0x3ea0('0x41')],function(_0x5933c6){var _0x4f9003={};_0x4f9003[_0x5933c6]={'$like':'%'+_0x3b0416[_0x3ea0('0x3d')]['filter']+'%'};return _0x4f9003;})});}_0x552144=_[_0x3ea0('0x49')]({},_0x552144,_0x3b0416[_0x3ea0('0x4a')]);return _0x50f9fa['getAgents'](_0x552144);}})[_0x3ea0('0x2c')](function(_0x26dbbb){if(_0x26dbbb){_0x417092=_0x26dbbb[_0x3ea0('0x51')];if(!_0x3b0416[_0x3ea0('0x3d')][_0x3ea0('0x5c')](_0x3ea0('0x43'))){_0x552144['limit']=qs[_0x3ea0('0x24')](_0x3b0416[_0x3ea0('0x3d')]['limit']);_0x552144['offset']=qs[_0x3ea0('0x23')](_0x3b0416[_0x3ea0('0x3d')][_0x3ea0('0x23')]);}return _0x50f9fa[_0x3ea0('0x8c')](_0x552144);}})[_0x3ea0('0x2c')](function(_0x1c7390){if(_0x1c7390){return _0x1c7390?{'count':_0x417092,'rows':_0x1c7390}:null;}})['then'](respondWithResult(_0x226ff8,null))[_0x3ea0('0x4f')](handleError(_0x226ff8,null));};
\ No newline at end of file
index 052cefb..f5c6ac8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c91=['hasOwnProperty','hook','../../mysqldb','MailQueue','save','update','remove','emit'];(function(_0x54f4cd,_0x1462c4){var _0x381dd8=function(_0x18edbc){while(--_0x18edbc){_0x54f4cd['push'](_0x54f4cd['shift']());}};_0x381dd8(++_0x1462c4);}(_0x7c91,0x1ea));var _0x17c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c91[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x17c9('0x0'))['db'][_0x17c9('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17c9('0x2'),'afterUpdate':_0x17c9('0x3'),'afterDestroy':_0x17c9('0x4')};function emitEvent(_0x4f0cfb){return function(_0x5459d4,_0x555aab,_0x5ed22e){MailQueueEvents[_0x17c9('0x5')](_0x4f0cfb+':'+_0x5459d4['id'],_0x5459d4);MailQueueEvents[_0x17c9('0x5')](_0x4f0cfb,_0x5459d4);_0x5ed22e(null);};}for(var e in events){if(events[_0x17c9('0x6')](e)){var event=events[e];MailQueue[_0x17c9('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
+var _0x6825=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','save','remove'];(function(_0x1068e9,_0x95c929){var _0x1a5449=function(_0x2c7475){while(--_0x2c7475){_0x1068e9['push'](_0x1068e9['shift']());}};_0x1a5449(++_0x95c929);}(_0x6825,0x18c));var _0x5682=function(_0x14d902,_0x11c094){_0x14d902=_0x14d902-0x0;var _0x2a5480=_0x6825[_0x14d902];return _0x2a5480;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x5682('0x0'))['db'][_0x5682('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5682('0x2'),'afterUpdate':'update','afterDestroy':_0x5682('0x3')};function emitEvent(_0x2bb8fb){return function(_0x23a5e0,_0x293945,_0x504281){MailQueueEvents[_0x5682('0x4')](_0x2bb8fb+':'+_0x23a5e0['id'],_0x23a5e0);MailQueueEvents[_0x5682('0x4')](_0x2bb8fb,_0x23a5e0);_0x504281(null);};}for(var e in events){if(events[_0x5682('0x5')](e)){var event=events[e];MailQueue[_0x5682('0x6')](e,emitEvent(event));}}module[_0x5682('0x7')]=MailQueueEvents;
\ No newline at end of file
index 9bbc32e..2eeb238 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa690=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','MailQueue','mail_queues','lodash','util'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0xa690,0xcf));var _0x0a69=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xa690[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require(_0x0a69('0x0'));var util=require(_0x0a69('0x1'));var logger=require(_0x0a69('0x2'))(_0x0a69('0x3'));var moment=require('moment');var BPromise=require(_0x0a69('0x4'));var rp=require(_0x0a69('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a69('0x6'));var config=require(_0x0a69('0x7'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x4701b9,_0x5427e0){return _0x4701b9[_0x0a69('0x8')](_0x0a69('0x9'),attributes,{'tableName':_0x0a69('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d94=['moment','bluebird','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','../../config/logger','api'];(function(_0x5101ec,_0x7b1185){var _0x28a366=function(_0x3560e1){while(--_0x3560e1){_0x5101ec['push'](_0x5101ec['shift']());}};_0x28a366(++_0x7b1185);}(_0x8d94,0x17d));var _0x48d9=function(_0x9ce5d1,_0x9f2aaf){_0x9ce5d1=_0x9ce5d1-0x0;var _0x7d4264=_0x8d94[_0x9ce5d1];return _0x7d4264;};'use strict';var _=require(_0x48d9('0x0'));var util=require('util');var logger=require(_0x48d9('0x1'))(_0x48d9('0x2'));var moment=require(_0x48d9('0x3'));var BPromise=require(_0x48d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48d9('0x5'));var rimraf=require('rimraf');var config=require(_0x48d9('0x6'));var attributes=require(_0x48d9('0x7'));module[_0x48d9('0x8')]=function(_0x2b72b0,_0xb846c9){return _0x2b72b0[_0x48d9('0x9')](_0x48d9('0xa'),attributes,{'tableName':_0x48d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8ec3061..1cb5980 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87e8=['MailQueue','options','raw','where','limit','include','map','model','attributes','GetMailQueue','catch','ShowMailQueue','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x3a1700,_0x24fb52){var _0x4a6ef2=function(_0x241899){while(--_0x241899){_0x3a1700['push'](_0x3a1700['shift']());}};_0x4a6ef2(++_0x24fb52);}(_0x87e8,0x16a));var _0x887e=function(_0x10ec31,_0xed2ecd){_0x10ec31=_0x10ec31-0x0;var _0x2f0869=_0x87e8[_0x10ec31];return _0x2f0869;};'use strict';var _=require(_0x887e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x887e('0x1'));var fs=require('fs');var Redis=require(_0x887e('0x2'));var db=require(_0x887e('0x3'))['db'];var utils=require(_0x887e('0x4'));var logger=require('../../config/logger')(_0x887e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x887e('0x6')]['http']({'port':0x232a});config['redis']=_[_0x887e('0x7')](config[_0x887e('0x8')],{'host':_0x887e('0x9'),'port':0x18eb});var socket=require(_0x887e('0xa'))(new Redis(config[_0x887e('0x8')]));require(_0x887e('0xb'))[_0x887e('0xc')](socket);function respondWithRpcPromise(_0x54907a,_0xbcd12b,_0x1e0e6){return new BPromise(function(_0x429f2b,_0x269038){return client[_0x887e('0xd')](_0x54907a,_0x1e0e6)[_0x887e('0xe')](function(_0x4f4ea4){logger[_0x887e('0xf')](_0x887e('0x10'),_0xbcd12b,_0x887e('0x11'));logger[_0x887e('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0xbcd12b,'request\x20sent',JSON[_0x887e('0x13')](_0x4f4ea4));if(_0x4f4ea4[_0x887e('0x14')]){if(_0x4f4ea4[_0x887e('0x14')][_0x887e('0x15')]===0x1f4){logger[_0x887e('0x14')](_0x887e('0x10'),_0xbcd12b,_0x4f4ea4['error'][_0x887e('0x16')]);return _0x269038(_0x4f4ea4[_0x887e('0x14')][_0x887e('0x16')]);}logger[_0x887e('0x14')](_0x887e('0x10'),_0xbcd12b,_0x4f4ea4[_0x887e('0x14')][_0x887e('0x16')]);return _0x429f2b(_0x4f4ea4[_0x887e('0x14')][_0x887e('0x16')]);}else{logger[_0x887e('0xf')](_0x887e('0x10'),_0xbcd12b,'request\x20sent');_0x429f2b(_0x4f4ea4['result'][_0x887e('0x16')]);}})['catch'](function(_0x14faa4){logger[_0x887e('0x14')]('MailQueue,\x20%s,\x20%s',_0xbcd12b,_0x14faa4);_0x269038(_0x14faa4);});});}exports['GetMailQueue']=function(_0x1b6297){var _0x2cd72f=this;return new Promise(function(_0x278f34,_0x4fdf08){return db[_0x887e('0x17')]['findAll']({'raw':_0x1b6297[_0x887e('0x18')]?_0x1b6297['options'][_0x887e('0x19')]===undefined?!![]:![]:!![],'where':_0x1b6297[_0x887e('0x18')]?_0x1b6297['options'][_0x887e('0x1a')]||null:null,'attributes':_0x1b6297['options']?_0x1b6297['options']['attributes']||null:null,'limit':_0x1b6297[_0x887e('0x18')]?_0x1b6297[_0x887e('0x18')][_0x887e('0x1b')]||null:null,'include':_0x1b6297['options']?_0x1b6297[_0x887e('0x18')][_0x887e('0x1c')]?_[_0x887e('0x1d')](_0x1b6297['options'][_0x887e('0x1c')],function(_0x49d4c2){return{'model':db[_0x49d4c2[_0x887e('0x1e')]],'as':_0x49d4c2['as'],'attributes':_0x49d4c2[_0x887e('0x1f')],'include':_0x49d4c2['include']?_[_0x887e('0x1d')](_0x49d4c2[_0x887e('0x1c')],function(_0x41ec35){return{'model':db[_0x41ec35['model']],'as':_0x41ec35['as'],'attributes':_0x41ec35[_0x887e('0x1f')],'include':_0x41ec35[_0x887e('0x1c')]?_[_0x887e('0x1d')](_0x41ec35['include'],function(_0x321db3){return{'model':db[_0x321db3[_0x887e('0x1e')]],'as':_0x321db3['as'],'attributes':_0x321db3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x26946c){logger['info']('GetMailQueue',_0x1b6297);logger[_0x887e('0x12')](_0x887e('0x20'),_0x1b6297,JSON[_0x887e('0x13')](_0x26946c));_0x278f34(_0x26946c);})[_0x887e('0x21')](function(_0x514b40){logger[_0x887e('0x14')](_0x887e('0x20'),_0x514b40[_0x887e('0x16')],_0x1b6297);_0x4fdf08(_0x2cd72f[_0x887e('0x14')](0x1f4,_0x514b40[_0x887e('0x16')]));});});};exports[_0x887e('0x22')]=function(_0x3699fc){var _0x3e9e6e=this;return new Promise(function(_0x510f92,_0x5cc861){return db[_0x887e('0x17')]['find']({'raw':_0x3699fc[_0x887e('0x18')]?_0x3699fc['options'][_0x887e('0x19')]===undefined?!![]:![]:!![],'where':_0x3699fc[_0x887e('0x18')]?_0x3699fc[_0x887e('0x18')]['where']||null:null,'attributes':_0x3699fc[_0x887e('0x18')]?_0x3699fc[_0x887e('0x18')]['attributes']||null:null,'include':_0x3699fc['options']?_0x3699fc[_0x887e('0x18')][_0x887e('0x1c')]?_[_0x887e('0x1d')](_0x3699fc[_0x887e('0x18')][_0x887e('0x1c')],function(_0x437e37){return{'model':db[_0x437e37[_0x887e('0x1e')]],'as':_0x437e37['as'],'attributes':_0x437e37[_0x887e('0x1f')],'include':_0x437e37[_0x887e('0x1c')]?_[_0x887e('0x1d')](_0x437e37[_0x887e('0x1c')],function(_0x60726){return{'model':db[_0x60726[_0x887e('0x1e')]],'as':_0x60726['as'],'attributes':_0x60726[_0x887e('0x1f')],'include':_0x60726[_0x887e('0x1c')]?_[_0x887e('0x1d')](_0x60726[_0x887e('0x1c')],function(_0x4edb95){return{'model':db[_0x4edb95[_0x887e('0x1e')]],'as':_0x4edb95['as'],'attributes':_0x4edb95[_0x887e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x887e('0xe')](function(_0x2475d2){logger[_0x887e('0xf')]('ShowMailQueue',_0x3699fc);logger['debug']('ShowMailQueue',_0x3699fc,JSON[_0x887e('0x13')](_0x2475d2));_0x510f92(_0x2475d2);})[_0x887e('0x21')](function(_0x12b95a){logger[_0x887e('0x14')](_0x887e('0x22'),_0x12b95a[_0x887e('0x16')],_0x3699fc);_0x5cc861(_0x3e9e6e[_0x887e('0x14')](0x1f4,_0x12b95a[_0x887e('0x16')]));});});};
\ No newline at end of file
+var _0x4bf2=['raw','where','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','./mailQueue.socket','register','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','map','model','then','catch','ShowMailQueue','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bf2,0xa3));var _0x24bf=function(_0x14a513,_0x3239f){_0x14a513=_0x14a513-0x0;var _0x47236c=_0x4bf2[_0x14a513];return _0x47236c;};'use strict';var _=require('lodash');var util=require(_0x24bf('0x0'));var moment=require(_0x24bf('0x1'));var BPromise=require(_0x24bf('0x2'));var rs=require(_0x24bf('0x3'));var fs=require('fs');var Redis=require(_0x24bf('0x4'));var db=require(_0x24bf('0x5'))['db'];var utils=require(_0x24bf('0x6'));var logger=require(_0x24bf('0x7'))(_0x24bf('0x8'));var config=require(_0x24bf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x24bf('0xa')]['http']({'port':0x232a});config['redis']=_[_0x24bf('0xb')](config[_0x24bf('0xc')],{'host':_0x24bf('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x24bf('0xc')]));require(_0x24bf('0xe'))[_0x24bf('0xf')](socket);function respondWithRpcPromise(_0x184360,_0x4b879f,_0xfe1833){return new BPromise(function(_0x28cc72,_0x4fdab2){return client['request'](_0x184360,_0xfe1833)['then'](function(_0x92a028){logger['info'](_0x24bf('0x10'),_0x4b879f,'request\x20sent');logger[_0x24bf('0x11')](_0x24bf('0x12'),_0x4b879f,_0x24bf('0x13'),JSON['stringify'](_0x92a028));if(_0x92a028[_0x24bf('0x14')]){if(_0x92a028[_0x24bf('0x14')]['code']===0x1f4){logger[_0x24bf('0x14')](_0x24bf('0x10'),_0x4b879f,_0x92a028['error'][_0x24bf('0x15')]);return _0x4fdab2(_0x92a028['error']['message']);}logger[_0x24bf('0x14')](_0x24bf('0x10'),_0x4b879f,_0x92a028[_0x24bf('0x14')][_0x24bf('0x15')]);return _0x28cc72(_0x92a028[_0x24bf('0x14')][_0x24bf('0x15')]);}else{logger[_0x24bf('0x16')]('MailQueue,\x20%s,\x20%s',_0x4b879f,_0x24bf('0x13'));_0x28cc72(_0x92a028[_0x24bf('0x17')][_0x24bf('0x15')]);}})['catch'](function(_0x170c5e){logger[_0x24bf('0x14')]('MailQueue,\x20%s,\x20%s',_0x4b879f,_0x170c5e);_0x4fdab2(_0x170c5e);});});}exports[_0x24bf('0x18')]=function(_0x235377){var _0x3a7808=this;return new Promise(function(_0x2fde4a,_0x534799){return db[_0x24bf('0x19')][_0x24bf('0x1a')]({'raw':_0x235377['options']?_0x235377[_0x24bf('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x235377[_0x24bf('0x1b')]?_0x235377['options']['where']||null:null,'attributes':_0x235377['options']?_0x235377['options'][_0x24bf('0x1c')]||null:null,'limit':_0x235377[_0x24bf('0x1b')]?_0x235377[_0x24bf('0x1b')][_0x24bf('0x1d')]||null:null,'include':_0x235377[_0x24bf('0x1b')]?_0x235377[_0x24bf('0x1b')][_0x24bf('0x1e')]?_[_0x24bf('0x1f')](_0x235377['options'][_0x24bf('0x1e')],function(_0x17d027){return{'model':db[_0x17d027[_0x24bf('0x20')]],'as':_0x17d027['as'],'attributes':_0x17d027[_0x24bf('0x1c')],'include':_0x17d027['include']?_[_0x24bf('0x1f')](_0x17d027[_0x24bf('0x1e')],function(_0x47e9bd){return{'model':db[_0x47e9bd[_0x24bf('0x20')]],'as':_0x47e9bd['as'],'attributes':_0x47e9bd[_0x24bf('0x1c')],'include':_0x47e9bd[_0x24bf('0x1e')]?_['map'](_0x47e9bd[_0x24bf('0x1e')],function(_0x259c5a){return{'model':db[_0x259c5a[_0x24bf('0x20')]],'as':_0x259c5a['as'],'attributes':_0x259c5a[_0x24bf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x24bf('0x21')](function(_0x56e313){logger[_0x24bf('0x16')](_0x24bf('0x18'),_0x235377);logger[_0x24bf('0x11')]('GetMailQueue',_0x235377,JSON['stringify'](_0x56e313));_0x2fde4a(_0x56e313);})[_0x24bf('0x22')](function(_0x38abfc){logger[_0x24bf('0x14')]('GetMailQueue',_0x38abfc[_0x24bf('0x15')],_0x235377);_0x534799(_0x3a7808[_0x24bf('0x14')](0x1f4,_0x38abfc['message']));});});};exports[_0x24bf('0x23')]=function(_0x335690){var _0xe5e172=this;return new Promise(function(_0x1ea2c0,_0x290384){return db['MailQueue'][_0x24bf('0x24')]({'raw':_0x335690['options']?_0x335690[_0x24bf('0x1b')][_0x24bf('0x25')]===undefined?!![]:![]:!![],'where':_0x335690[_0x24bf('0x1b')]?_0x335690[_0x24bf('0x1b')][_0x24bf('0x26')]||null:null,'attributes':_0x335690['options']?_0x335690[_0x24bf('0x1b')]['attributes']||null:null,'include':_0x335690['options']?_0x335690['options']['include']?_[_0x24bf('0x1f')](_0x335690[_0x24bf('0x1b')][_0x24bf('0x1e')],function(_0x235980){return{'model':db[_0x235980[_0x24bf('0x20')]],'as':_0x235980['as'],'attributes':_0x235980['attributes'],'include':_0x235980[_0x24bf('0x1e')]?_[_0x24bf('0x1f')](_0x235980['include'],function(_0x4b3844){return{'model':db[_0x4b3844['model']],'as':_0x4b3844['as'],'attributes':_0x4b3844[_0x24bf('0x1c')],'include':_0x4b3844[_0x24bf('0x1e')]?_[_0x24bf('0x1f')](_0x4b3844[_0x24bf('0x1e')],function(_0x194ff8){return{'model':db[_0x194ff8['model']],'as':_0x194ff8['as'],'attributes':_0x194ff8[_0x24bf('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29fcb2){logger['info'](_0x24bf('0x23'),_0x335690);logger['debug'](_0x24bf('0x23'),_0x335690,JSON[_0x24bf('0x27')](_0x29fcb2));_0x1ea2c0(_0x29fcb2);})[_0x24bf('0x22')](function(_0xb757ac){logger[_0x24bf('0x14')](_0x24bf('0x23'),_0xb757ac[_0x24bf('0x15')],_0x335690);_0x290384(_0xe5e172[_0x24bf('0x14')](0x1f4,_0xb757ac[_0x24bf('0x15')]));});});};
\ No newline at end of file
index 9f0f2f1..9371ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafa2=['register','length','mailQueue:','./mailQueue.events','remove','update','emit','removeListener'];(function(_0x375bfd,_0x7c9e97){var _0x5ae9af=function(_0x1b8e61){while(--_0x1b8e61){_0x375bfd['push'](_0x375bfd['shift']());}};_0x5ae9af(++_0x7c9e97);}(_0xafa2,0xfb));var _0x2afa=function(_0x44ffa8,_0x536a87){_0x44ffa8=_0x44ffa8-0x0;var _0x3f56af=_0xafa2[_0x44ffa8];return _0x3f56af;};'use strict';var MailQueueEvents=require(_0x2afa('0x0'));var events=['save',_0x2afa('0x1'),_0x2afa('0x2')];function createListener(_0x9fc9a5,_0x54e37b){return function(_0x3d3913){_0x54e37b[_0x2afa('0x3')](_0x9fc9a5,_0x3d3913);};}function removeListener(_0x5812c3,_0x42ac34){return function(){MailQueueEvents[_0x2afa('0x4')](_0x5812c3,_0x42ac34);};}exports[_0x2afa('0x5')]=function(_0x17d3b9){for(var _0x251412=0x0,_0x500cc3=events[_0x2afa('0x6')];_0x251412<_0x500cc3;_0x251412++){var _0x46c546=events[_0x251412];var _0x3d467c=createListener(_0x2afa('0x7')+_0x46c546,_0x17d3b9);MailQueueEvents['on'](_0x46c546,_0x3d467c);}};
\ No newline at end of file
+var _0x57c0=['length','mailQueue:','./mailQueue.events','save','update','emit','removeListener','register'];(function(_0x569f4e,_0x2f449a){var _0x377df8=function(_0x4eaf2d){while(--_0x4eaf2d){_0x569f4e['push'](_0x569f4e['shift']());}};_0x377df8(++_0x2f449a);}(_0x57c0,0xba));var _0x057c=function(_0x27842c,_0x324fcb){_0x27842c=_0x27842c-0x0;var _0x493de8=_0x57c0[_0x27842c];return _0x493de8;};'use strict';var MailQueueEvents=require(_0x057c('0x0'));var events=[_0x057c('0x1'),'remove',_0x057c('0x2')];function createListener(_0x4bea9d,_0x1d19a8){return function(_0x20b16c){_0x1d19a8[_0x057c('0x3')](_0x4bea9d,_0x20b16c);};}function removeListener(_0x423d79,_0x2e577b){return function(){MailQueueEvents[_0x057c('0x4')](_0x423d79,_0x2e577b);};}exports[_0x057c('0x5')]=function(_0x446902){for(var _0x5a1286=0x0,_0x199cad=events[_0x057c('0x6')];_0x5a1286<_0x199cad;_0x5a1286++){var _0x22c3da=events[_0x5a1286];var _0x2fa8d4=createListener(_0x057c('0x7')+_0x22c3da,_0x446902);MailQueueEvents['on'](_0x22c3da,_0x2fa8d4);}};
\ No newline at end of file
index 5fe3288..4ff6cd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecc9=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','util'];(function(_0xceedd7,_0xbd7a15){var _0x443240=function(_0x45d75f){while(--_0x45d75f){_0xceedd7['push'](_0xceedd7['shift']());}};_0x443240(++_0xbd7a15);}(_0xecc9,0xef));var _0x9ecc=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0xecc9[_0x2cc0b3];return _0x1667ef;};'use strict';var multer=require('multer');var util=require(_0x9ecc('0x0'));var path=require(_0x9ecc('0x1'));var timeout=require(_0x9ecc('0x2'));var express=require(_0x9ecc('0x3'));var router=express[_0x9ecc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9ecc('0x5'));var config=require(_0x9ecc('0x6'));var controller=require(_0x9ecc('0x7'));router[_0x9ecc('0x8')]('/',auth[_0x9ecc('0x9')](),controller[_0x9ecc('0xa')]);router[_0x9ecc('0x8')](_0x9ecc('0xb'),auth['isAuthenticated'](),controller[_0x9ecc('0xc')]);router[_0x9ecc('0x8')](_0x9ecc('0xd'),auth[_0x9ecc('0x9')](),controller[_0x9ecc('0xe')]);router[_0x9ecc('0xf')]('/',auth[_0x9ecc('0x9')](),controller['create']);router[_0x9ecc('0x10')](_0x9ecc('0xd'),auth['isAuthenticated'](),controller[_0x9ecc('0x11')]);router[_0x9ecc('0x12')]('/:id',auth[_0x9ecc('0x9')](),controller[_0x9ecc('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xc38f=['create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x4710ed,_0x211c8c){var _0x3c1e56=function(_0x3ec711){while(--_0x3ec711){_0x4710ed['push'](_0x4710ed['shift']());}};_0x3c1e56(++_0x211c8c);}(_0xc38f,0x1e4));var _0xfc38=function(_0x43e699,_0x57a402){_0x43e699=_0x43e699-0x0;var _0x60d519=_0xc38f[_0x43e699];return _0x60d519;};'use strict';var multer=require(_0xfc38('0x0'));var util=require(_0xfc38('0x1'));var path=require(_0xfc38('0x2'));var timeout=require(_0xfc38('0x3'));var express=require(_0xfc38('0x4'));var router=express[_0xfc38('0x5')]();var fs_extra=require(_0xfc38('0x6'));var auth=require(_0xfc38('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfc38('0x8'));var controller=require(_0xfc38('0x9'));router[_0xfc38('0xa')]('/',auth[_0xfc38('0xb')](),controller[_0xfc38('0xc')]);router['get'](_0xfc38('0xd'),auth[_0xfc38('0xb')](),controller['describe']);router[_0xfc38('0xa')](_0xfc38('0xe'),auth[_0xfc38('0xb')](),controller[_0xfc38('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfc38('0x10')]);router['put']('/:id',auth[_0xfc38('0xb')](),controller[_0xfc38('0x11')]);router[_0xfc38('0x12')](_0xfc38('0xe'),auth[_0xfc38('0xb')](),controller[_0xfc38('0x13')]);module['exports']=router;
\ No newline at end of file
index 2ba4510..47eab4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x651f=['moment','sequelize','STRING','DATE'];(function(_0x39a568,_0x4daefd){var _0x21a34c=function(_0x4ff259){while(--_0x4ff259){_0x39a568['push'](_0x39a568['shift']());}};_0x21a34c(++_0x4daefd);}(_0x651f,0x158));var _0xf651=function(_0x4a6689,_0x101532){_0x4a6689=_0x4a6689-0x0;var _0x465d5b=_0x651f[_0x4a6689];return _0x465d5b;};'use strict';var moment=require(_0xf651('0x0'));var Sequelize=require(_0xf651('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf651('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf651('0x2')]},'joinAt':{'type':Sequelize[_0xf651('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf651('0x2')]}};
\ No newline at end of file
+var _0xfb63=['DATE','moment','sequelize','exports','STRING'];(function(_0x36a077,_0x1a1ff1){var _0x934cbd=function(_0x2016ba){while(--_0x2016ba){_0x36a077['push'](_0x36a077['shift']());}};_0x934cbd(++_0x1a1ff1);}(_0xfb63,0x12d));var _0x3fb6=function(_0x154722,_0x2c1460){_0x154722=_0x154722-0x0;var _0x11928c=_0xfb63[_0x154722];return _0x11928c;};'use strict';var moment=require(_0x3fb6('0x0'));var Sequelize=require(_0x3fb6('0x1'));module[_0x3fb6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3fb6('0x3')]},'joinAt':{'type':Sequelize[_0x3fb6('0x4')]},'leaveAt':{'type':Sequelize[_0x3fb6('0x4')]},'acceptAt':{'type':Sequelize[_0x3fb6('0x4')]},'exitAt':{'type':Sequelize[_0x3fb6('0x4')]},'reason':{'type':Sequelize[_0x3fb6('0x3')]}};
\ No newline at end of file
index eefa0d3..3db2469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','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','apply','reject','save','then','destroy','end','error','name','send','index','map','MailQueueReport','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x5c19fe,_0x5892fe){var _0xa5f11f=function(_0xbea7e6){while(--_0xbea7e6){_0x5c19fe['push'](_0x5c19fe['shift']());}};_0xa5f11f(++_0x5892fe);}(_0xb016,0x159));var _0x6b01=function(_0x38f11d,_0x485f0a){_0x38f11d=_0x38f11d-0x0;var _0x16edee=_0xb016[_0x38f11d];return _0x16edee;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':!![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['MailQueueReport'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));};
\ No newline at end of file
+var _0xa30a=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','find','body'];(function(_0x34ca44,_0x2fc8b4){var _0x1f7920=function(_0x354aba){while(--_0x354aba){_0x34ca44['push'](_0x34ca44['shift']());}};_0x1f7920(++_0x2fc8b4);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){_0x13128a[_0xaa30('0x19')](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x12da2f,_0x97b038){return function(_0x2a59ce){if(!_0x2a59ce){_0x12da2f['sendStatus'](0x194);}return _0x2a59ce;};}function handleError(_0x467850,_0x465701){_0x465701=_0x465701||0x1f4;return function(_0x5d4da8){logger[_0xaa30('0x24')](_0x5d4da8['stack']);if(_0x5d4da8[_0xaa30('0x25')]){delete _0x5d4da8[_0xaa30('0x25')];}_0x467850[_0xaa30('0x19')](_0x465701)[_0xaa30('0x26')](_0x5d4da8);};}exports[_0xaa30('0x27')]=function(_0xc10b8f,_0x6ff09a){var _0x39f708={},_0x1f288c={},_0x43fb30={'count':0x0,'rows':[]};var _0x44aa9b=_[_0xaa30('0x28')](db[_0xaa30('0x29')][_0xaa30('0x2a')],function(_0x40e4ee){return{'name':_0x40e4ee[_0xaa30('0x2b')],'type':_0x40e4ee[_0xaa30('0x2c')][_0xaa30('0x2d')]};});_0x1f288c['model']=_[_0xaa30('0x28')](_0x44aa9b,_0xaa30('0x25'));_0x1f288c[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0xc10b8f[_0xaa30('0x2e')]);_0x1f288c[_0xaa30('0x30')]=_['intersection'](_0x1f288c['model'],_0x1f288c['query']);_0x39f708[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x1f288c[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0xc10b8f[_0xaa30('0x2e')]['fields']));_0x39f708['attributes']=_0x39f708[_0xaa30('0x31')][_0xaa30('0x35')]?_0x39f708['attributes']:_0x1f288c[_0xaa30('0x33')];if(!_0xc10b8f['query'][_0xaa30('0x36')]('nolimit')){_0x39f708[_0xaa30('0x1f')]=qs[_0xaa30('0x1f')](_0xc10b8f['query'][_0xaa30('0x1f')]);_0x39f708[_0xaa30('0x1c')]=qs[_0xaa30('0x1c')](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x1c')]);}_0x39f708[_0xaa30('0x37')]=qs['sort'](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x38')]);_0x39f708['where']=qs[_0xaa30('0x30')](_[_0xaa30('0x39')](_0xc10b8f[_0xaa30('0x2e')],_0x1f288c['filters']),_0x44aa9b);if(_0xc10b8f['query'][_0xaa30('0x3a')]){_0x39f708[_0xaa30('0x3b')]=_[_0xaa30('0x3c')](_0x39f708[_0xaa30('0x3b')],{'$or':_[_0xaa30('0x28')](_0x44aa9b,function(_0x291854){if(_0x291854['type']!=='VIRTUAL'){var _0x120c43={};_0x120c43[_0x291854[_0xaa30('0x25')]]={'$like':'%'+_0xc10b8f[_0xaa30('0x2e')]['filter']+'%'};return _0x120c43;}})});}_0x39f708=_[_0xaa30('0x3c')]({},_0x39f708,_0xc10b8f[_0xaa30('0x3d')]);var _0x8fb95e={'where':_0x39f708[_0xaa30('0x3b')]};return db['MailQueueReport'][_0xaa30('0x1e')](_0x8fb95e)[_0xaa30('0x23')](function(_0x2c5ddb){_0x43fb30[_0xaa30('0x1e')]=_0x2c5ddb;if(_0xc10b8f[_0xaa30('0x2e')]['includeAll']){_0x39f708[_0xaa30('0x3e')]=[{'all':!![]}];}return db[_0xaa30('0x29')][_0xaa30('0x3f')](_0x39f708);})[_0xaa30('0x23')](function(_0x13f08f){_0x43fb30[_0xaa30('0x40')]=_0x13f08f;return _0x43fb30;})[_0xaa30('0x23')](respondWithFilteredResult(_0x6ff09a,_0x39f708))[_0xaa30('0x41')](handleError(_0x6ff09a,null));};exports['show']=function(_0x59ef25,_0x18771d){var _0x4a170a={'raw':!![],'where':{'id':_0x59ef25['params']['id']}},_0x5208f8={};_0x5208f8[_0xaa30('0x33')]=_['keys'](db[_0xaa30('0x29')]['rawAttributes']);_0x5208f8[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0x59ef25[_0xaa30('0x2e')]);_0x5208f8[_0xaa30('0x30')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],_0x5208f8[_0xaa30('0x2e')]);_0x4a170a[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0x59ef25['query'][_0xaa30('0x34')]));_0x4a170a[_0xaa30('0x31')]=_0x4a170a[_0xaa30('0x31')][_0xaa30('0x35')]?_0x4a170a[_0xaa30('0x31')]:_0x5208f8['model'];if(_0x59ef25['query'][_0xaa30('0x42')]){_0x4a170a['include']=[{'all':!![]}];}_0x4a170a=_[_0xaa30('0x3c')]({},_0x4a170a,_0x59ef25[_0xaa30('0x3d')]);return db[_0xaa30('0x29')][_0xaa30('0x43')](_0x4a170a)[_0xaa30('0x23')](handleEntityNotFound(_0x18771d,null))[_0xaa30('0x23')](respondWithResult(_0x18771d,null))[_0xaa30('0x41')](handleError(_0x18771d,null));};exports['create']=function(_0x3cf0bb,_0x6c9da6){return db[_0xaa30('0x29')]['create'](_0x3cf0bb[_0xaa30('0x44')],{})[_0xaa30('0x23')](respondWithResult(_0x6c9da6,0xc9))['catch'](handleError(_0x6c9da6,null));};exports[_0xaa30('0x22')]=function(_0x4a8fcc,_0x25d227){if(_0x4a8fcc['body']['id']){delete _0x4a8fcc['body']['id'];}return db[_0xaa30('0x29')]['find']({'where':{'id':_0x4a8fcc['params']['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x25d227,null))[_0xaa30('0x23')](saveUpdates(_0x4a8fcc[_0xaa30('0x44')],null))[_0xaa30('0x23')](respondWithResult(_0x25d227,null))[_0xaa30('0x41')](handleError(_0x25d227,null));};exports[_0xaa30('0x45')]=function(_0x5616cd,_0x17d75d){return db[_0xaa30('0x29')][_0xaa30('0x43')]({'where':{'id':_0x5616cd['params']['id']}})['then'](handleEntityNotFound(_0x17d75d,null))['then'](removeEntity(_0x17d75d,null))['catch'](handleError(_0x17d75d,null));};exports[_0xaa30('0x46')]=function(_0x1ba164,_0xdc32bc){return db[_0xaa30('0x29')][_0xaa30('0x46')]()[_0xaa30('0x23')](respondWithResult(_0xdc32bc,null))['catch'](handleError(_0xdc32bc,null));};
\ No newline at end of file
index 596eaa2..26a03bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc811=['path','define','MailQueueReport','report_mail_queue','uniqueid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ff775,_0x9790a6){var _0x21be0b=function(_0x1666ff){while(--_0x1666ff){_0x3ff775['push'](_0x3ff775['shift']());}};_0x21be0b(++_0x9790a6);}(_0xc811,0x14f));var _0x1c81=function(_0x3fd9b5,_0x814f52){_0x3fd9b5=_0x3fd9b5-0x0;var _0x51d631=_0xc811[_0x3fd9b5];return _0x51d631;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c81('0x0'))(_0x1c81('0x1'));var moment=require(_0x1c81('0x2'));var BPromise=require(_0x1c81('0x3'));var rp=require(_0x1c81('0x4'));var fs=require('fs');var path=require(_0x1c81('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x2bbcc4,_0x6dece5){return _0x2bbcc4[_0x1c81('0x6')](_0x1c81('0x7'),attributes,{'tableName':_0x1c81('0x8'),'paranoid':![],'indexes':[{'name':_0x1c81('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xedc3=['bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','lodash','util','../../config/logger','api','moment'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0xedc3,0x7f));var _0x3edc=function(_0x4df7a0,_0x919c55){_0x4df7a0=_0x4df7a0-0x0;var _0x33e432=_0xedc3[_0x4df7a0];return _0x33e432;};'use strict';var _=require(_0x3edc('0x0'));var util=require(_0x3edc('0x1'));var logger=require(_0x3edc('0x2'))(_0x3edc('0x3'));var moment=require(_0x3edc('0x4'));var BPromise=require(_0x3edc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3edc('0x6'));var rimraf=require(_0x3edc('0x7'));var config=require(_0x3edc('0x8'));var attributes=require(_0x3edc('0x9'));module['exports']=function(_0x2f82c1,_0x5d564e){return _0x2f82c1[_0x3edc('0xa')](_0x3edc('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index f8c990e..be4cba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','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(_0x4dc279,_0x5d590a){var _0x37df6d=function(_0x426c1a){while(--_0x426c1a){_0x4dc279['push'](_0x4dc279['shift']());}};_0x37df6d(++_0x5d590a);}(_0x7a54,0x106));var _0x47a5=function(_0x5b629d,_0x20234f){_0x5b629d=_0x5b629d-0x0;var _0x5e401c=_0x7a54[_0x5b629d];return _0x5e401c;};'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
+var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x34366b,_0x248c3c){var _0x33921b=function(_0x55946a){while(--_0x55946a){_0x34366b['push'](_0x34366b['shift']());}};_0x33921b(++_0x248c3c);}(_0xdb28,0x106));var _0x8db2=function(_0x20fa28,_0xc57b53){_0x20fa28=_0x20fa28-0x0;var _0x201b50=_0xdb28[_0x20fa28];return _0x201b50;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});};
\ No newline at end of file
index acd6c73..a2a6ef2 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(_0x2d3bf9,_0x316601){var _0x150076=function(_0x54fa9f){while(--_0x54fa9f){_0x2d3bf9['push'](_0x2d3bf9['shift']());}};_0x150076(++_0x316601);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x37116f,_0xadb079){var _0x925b84=function(_0x226e9){while(--_0x226e9){_0x37116f['push'](_0x37116f['shift']());}};_0x925b84(++_0xadb079);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xcb91[_0x609988];return _0x159984;};'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 6584f8b..39de935 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0647=['BOOLEAN','INBOX','INTEGER','sequelize','STRING'];(function(_0x351a97,_0x4044d7){var _0x2dbbae=function(_0x206a94){while(--_0x206a94){_0x351a97['push'](_0x351a97['shift']());}};_0x2dbbae(++_0x4044d7);}(_0x0647,0xd0));var _0x7064=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x0647[_0x4cbf20];return _0x582ae4;};'use strict';var Sequelize=require(_0x7064('0x0'));module['exports']={'description':{'type':Sequelize[_0x7064('0x1')]},'host':{'type':Sequelize[_0x7064('0x1')]},'authentication':{'type':Sequelize[_0x7064('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x7064('0x1')]},'password':{'type':Sequelize[_0x7064('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7064('0x1')],'defaultValue':_0x7064('0x3')},'connTimeout':{'type':Sequelize[_0x7064('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7064('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7064('0x1')]}};
\ No newline at end of file
+var _0x97c1=['INBOX','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3f2a2b,_0x438f0b){var _0x4303c9=function(_0x19d12c){while(--_0x19d12c){_0x3f2a2b['push'](_0x3f2a2b['shift']());}};_0x4303c9(++_0x438f0b);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x197c('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x197c('0x2')]},'port':{'type':Sequelize[_0x197c('0x3')]},'tls':{'type':Sequelize[_0x197c('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x197c('0x2')],'defaultValue':_0x197c('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x197c('0x2')]}};
\ No newline at end of file
index 7288e70..ee73666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f8=['exports','define','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes'];(function(_0x4cccd5,_0x2c1054){var _0x5f62b9=function(_0x37310e){while(--_0x37310e){_0x4cccd5['push'](_0x4cccd5['shift']());}};_0x5f62b9(++_0x2c1054);}(_0x73f8,0x1b3));var _0x873f=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x73f8[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x873f('0x0'));var util=require('util');var logger=require(_0x873f('0x1'))(_0x873f('0x2'));var moment=require(_0x873f('0x3'));var BPromise=require(_0x873f('0x4'));var rp=require(_0x873f('0x5'));var fs=require('fs');var path=require(_0x873f('0x6'));var rimraf=require('rimraf');var config=require(_0x873f('0x7'));var attributes=require(_0x873f('0x8'));module[_0x873f('0x9')]=function(_0x5cdb0b,_0x4208ae){return _0x5cdb0b[_0x873f('0xa')]('MailServerIn',attributes,{'tableName':_0x873f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebf0=['lodash','util','moment','bluebird','request-promise','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in'];(function(_0x2215bc,_0xfc961d){var _0x35fdba=function(_0xd2d9e6){while(--_0xd2d9e6){_0x2215bc['push'](_0x2215bc['shift']());}};_0x35fdba(++_0xfc961d);}(_0xebf0,0x108));var _0x0ebf=function(_0x524263,_0x495d04){_0x524263=_0x524263-0x0;var _0x8bcfcd=_0xebf0[_0x524263];return _0x8bcfcd;};'use strict';var _=require(_0x0ebf('0x0'));var util=require(_0x0ebf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0ebf('0x2'));var BPromise=require(_0x0ebf('0x3'));var rp=require(_0x0ebf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ebf('0x5'));var config=require('../../config/environment');var attributes=require(_0x0ebf('0x6'));module[_0x0ebf('0x7')]=function(_0x394e55,_0x2289ad){return _0x394e55[_0x0ebf('0x8')](_0x0ebf('0x9'),attributes,{'tableName':_0x0ebf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 34ab0d5..dad4246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf00e=['request\x20sent','stringify','MailServerIn,\x20%s,\x20%s','message','error','result','catch','options','attributes','limit','model','include','map','then','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x107539,_0x3ba3b0){var _0x384525=function(_0x152ff9){while(--_0x152ff9){_0x107539['push'](_0x107539['shift']());}};_0x384525(++_0x3ba3b0);}(_0xf00e,0x12f));var _0xef00=function(_0x4bce08,_0x15af64){_0x4bce08=_0x4bce08-0x0;var _0x498071=_0xf00e[_0x4bce08];return _0x498071;};'use strict';var _=require(_0xef00('0x0'));var util=require(_0xef00('0x1'));var moment=require(_0xef00('0x2'));var BPromise=require(_0xef00('0x3'));var rs=require(_0xef00('0x4'));var fs=require('fs');var Redis=require(_0xef00('0x5'));var db=require(_0xef00('0x6'))['db'];var utils=require(_0xef00('0x7'));var logger=require(_0xef00('0x8'))(_0xef00('0x9'));var config=require(_0xef00('0xa'));var jayson=require(_0xef00('0xb'));var client=jayson[_0xef00('0xc')][_0xef00('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x254f2e,_0x17ec9e,_0x2245a3){return new BPromise(function(_0xdfd1bd,_0x543859){return client[_0xef00('0xe')](_0x254f2e,_0x2245a3)['then'](function(_0x50e9c9){logger[_0xef00('0xf')]('MailServerIn,\x20%s,\x20%s',_0x17ec9e,'request\x20sent');logger[_0xef00('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x17ec9e,_0xef00('0x11'),JSON[_0xef00('0x12')](_0x50e9c9));if(_0x50e9c9['error']){if(_0x50e9c9['error']['code']===0x1f4){logger['error'](_0xef00('0x13'),_0x17ec9e,_0x50e9c9['error'][_0xef00('0x14')]);return _0x543859(_0x50e9c9['error'][_0xef00('0x14')]);}logger[_0xef00('0x15')](_0xef00('0x13'),_0x17ec9e,_0x50e9c9[_0xef00('0x15')][_0xef00('0x14')]);return _0xdfd1bd(_0x50e9c9['error'][_0xef00('0x14')]);}else{logger[_0xef00('0xf')]('MailServerIn,\x20%s,\x20%s',_0x17ec9e,_0xef00('0x11'));_0xdfd1bd(_0x50e9c9[_0xef00('0x16')][_0xef00('0x14')]);}})[_0xef00('0x17')](function(_0x581008){logger[_0xef00('0x15')](_0xef00('0x13'),_0x17ec9e,_0x581008);_0x543859(_0x581008);});});}exports['GetMailServerIn']=function(_0x45a9d4){var _0x387453=this;return new Promise(function(_0x242658,_0x5e266d){return db['MailServerIn']['findAll']({'raw':_0x45a9d4[_0xef00('0x18')]?_0x45a9d4[_0xef00('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x45a9d4[_0xef00('0x18')]?_0x45a9d4[_0xef00('0x18')]['where']||null:null,'attributes':_0x45a9d4['options']?_0x45a9d4[_0xef00('0x18')][_0xef00('0x19')]||null:null,'limit':_0x45a9d4['options']?_0x45a9d4[_0xef00('0x18')][_0xef00('0x1a')]||null:null,'include':_0x45a9d4['options']?_0x45a9d4[_0xef00('0x18')]['include']?_['map'](_0x45a9d4[_0xef00('0x18')]['include'],function(_0x639d69){return{'model':db[_0x639d69[_0xef00('0x1b')]],'as':_0x639d69['as'],'attributes':_0x639d69[_0xef00('0x19')],'include':_0x639d69[_0xef00('0x1c')]?_['map'](_0x639d69[_0xef00('0x1c')],function(_0x1ec423){return{'model':db[_0x1ec423[_0xef00('0x1b')]],'as':_0x1ec423['as'],'attributes':_0x1ec423['attributes'],'include':_0x1ec423[_0xef00('0x1c')]?_[_0xef00('0x1d')](_0x1ec423[_0xef00('0x1c')],function(_0x2cec14){return{'model':db[_0x2cec14[_0xef00('0x1b')]],'as':_0x2cec14['as'],'attributes':_0x2cec14[_0xef00('0x19')]};}):[]};}):[]};}):[]:[]})[_0xef00('0x1e')](function(_0x4c1978){logger['info'](_0xef00('0x1f'),_0x45a9d4);logger[_0xef00('0x10')](_0xef00('0x1f'),_0x45a9d4,JSON['stringify'](_0x4c1978));_0x242658(_0x4c1978);})[_0xef00('0x17')](function(_0x152209){logger[_0xef00('0x15')](_0xef00('0x1f'),_0x152209[_0xef00('0x14')],_0x45a9d4);_0x5e266d(_0x387453['error'](0x1f4,_0x152209[_0xef00('0x14')]));});});};
\ No newline at end of file
+var _0x9e0d=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailServerIn','options','raw','where','attributes','map','include','model','GetMailServerIn','lodash'];(function(_0x4742d0,_0x3667bd){var _0x43bc00=function(_0x5b03dd){while(--_0x5b03dd){_0x4742d0['push'](_0x4742d0['shift']());}};_0x43bc00(++_0x3667bd);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x45da6f,_0x3d85d3){_0x45da6f=_0x45da6f-0x0;var _0x1c7d63=_0x9e0d[_0x45da6f];return _0x1c7d63;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ce1e,_0x36d1c7,_0x3f8bb2){return new BPromise(function(_0x256df0,_0x3315d8){return client['request'](_0x28ce1e,_0x3f8bb2)[_0xd9e0('0xb')](function(_0x36e6e7){logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,_0xd9e0('0xe'));logger[_0xd9e0('0xf')](_0xd9e0('0x10'),_0x36d1c7,'request\x20sent',JSON[_0xd9e0('0x11')](_0x36e6e7));if(_0x36e6e7[_0xd9e0('0x12')]){if(_0x36e6e7['error'][_0xd9e0('0x13')]===0x1f4){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);return _0x3315d8(_0x36e6e7['error'][_0xd9e0('0x14')]);}logger['error'](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7['error'][_0xd9e0('0x14')]);return _0x256df0(_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);}else{logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,'request\x20sent');_0x256df0(_0x36e6e7['result']['message']);}})[_0xd9e0('0x15')](function(_0x386816){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x386816);_0x3315d8(_0x386816);});});}exports['GetMailServerIn']=function(_0x209c04){var _0x56421e=this;return new Promise(function(_0x483b74,_0x2fcad6){return db[_0xd9e0('0x16')]['findAll']({'raw':_0x209c04['options']?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x18')]===undefined?!![]:![]:!![],'where':_0x209c04['options']?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x19')]||null:null,'attributes':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x1a')]||null:null,'limit':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')]['limit']||null:null,'include':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')]['include']?_[_0xd9e0('0x1b')](_0x209c04[_0xd9e0('0x17')]['include'],function(_0x357bd9){return{'model':db[_0x357bd9['model']],'as':_0x357bd9['as'],'attributes':_0x357bd9[_0xd9e0('0x1a')],'include':_0x357bd9[_0xd9e0('0x1c')]?_['map'](_0x357bd9[_0xd9e0('0x1c')],function(_0x53cf67){return{'model':db[_0x53cf67['model']],'as':_0x53cf67['as'],'attributes':_0x53cf67['attributes'],'include':_0x53cf67[_0xd9e0('0x1c')]?_[_0xd9e0('0x1b')](_0x53cf67[_0xd9e0('0x1c')],function(_0x1c36df){return{'model':db[_0x1c36df[_0xd9e0('0x1d')]],'as':_0x1c36df['as'],'attributes':_0x1c36df[_0xd9e0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd9e0('0xb')](function(_0x5d56ba){logger[_0xd9e0('0xc')](_0xd9e0('0x1e'),_0x209c04);logger[_0xd9e0('0xf')](_0xd9e0('0x1e'),_0x209c04,JSON[_0xd9e0('0x11')](_0x5d56ba));_0x483b74(_0x5d56ba);})['catch'](function(_0x4b4f7d){logger['error'](_0xd9e0('0x1e'),_0x4b4f7d[_0xd9e0('0x14')],_0x209c04);_0x2fcad6(_0x56421e['error'](0x1f4,_0x4b4f7d[_0xd9e0('0x14')]));});});};
\ No newline at end of file
index 800935b..8b749a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x5c4599,_0x89780a){_0x5c4599=_0x5c4599-0x0;var _0x4922b0=_0x7a54[_0x5c4599];return _0x4922b0;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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
index a9bc210..f93613c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bdf=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9bdf,0x103));var _0xf9bd=function(_0x36211c,_0x178508){_0x36211c=_0x36211c-0x0;var _0xd2487b=_0x9bdf[_0x36211c];return _0xd2487b;};'use strict';var Sequelize=require(_0xf9bd('0x0'));module[_0xf9bd('0x1')]={'description':{'type':Sequelize[_0xf9bd('0x2')]},'host':{'type':Sequelize[_0xf9bd('0x2')]},'user':{'type':Sequelize[_0xf9bd('0x2')]},'pass':{'type':Sequelize[_0xf9bd('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xf9bd('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xf9bd('0x2')]},'authentication':{'type':Sequelize[_0xf9bd('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5120=['STRING','sequelize'];(function(_0x3be002,_0x1ac993){var _0x3e3664=function(_0x5c324c){while(--_0x5c324c){_0x3be002['push'](_0x3be002['shift']());}};_0x3e3664(++_0x1ac993);}(_0x5120,0xdf));var _0x0512=function(_0x1bb6aa,_0x40fe82){_0x1bb6aa=_0x1bb6aa-0x0;var _0x2ef28e=_0x5120[_0x1bb6aa];return _0x2ef28e;};'use strict';var Sequelize=require(_0x0512('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0512('0x1')]},'user':{'type':Sequelize[_0x0512('0x1')]},'pass':{'type':Sequelize[_0x0512('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x0512('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 515b43e..5a94b65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x302a=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','index','map','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','where','filter','merge','VIRTUAL','name','MailServerOut','includeAll','include','findAll','catch','show','rawAttributes','options','find','create','body','params','eml-format','moment','bluebird','sox','to-csv','ejs'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x302a,0x1cf));var _0xa302=function(_0x2ccbee,_0x2b364c){_0x2ccbee=_0x2ccbee-0x0;var _0x357c28=_0x302a[_0x2ccbee];return _0x357c28;};'use strict';var emlformat=require(_0xa302('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa302('0x1'));var BPromise=require(_0xa302('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa302('0x3'));var csv=require(_0xa302('0x4'));var ejs=require(_0xa302('0x5'));var fs=require('fs');var fs_extra=require(_0xa302('0x6'));var _=require(_0xa302('0x7'));var squel=require(_0xa302('0x8'));var crypto=require(_0xa302('0x9'));var jsforce=require(_0xa302('0xa'));var deskjs=require(_0xa302('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa302('0xc'));var Papa=require('papaparse');var Redis=require(_0xa302('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa302('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa302('0xf'));var logger=require('../../config/logger')(_0xa302('0x10'));var utils=require('../../config/utils');var config=require(_0xa302('0x11'));var licenseUtil=require(_0xa302('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x489b4e,_0x250e15){_0x250e15=_0x250e15||0xcc;return function(_0x3674ee){if(_0x3674ee){return _0x489b4e['sendStatus'](_0x250e15);}return _0x489b4e[_0xa302('0x13')](_0x250e15)[_0xa302('0x14')]();};}function respondWithResult(_0x29af14,_0x55d40b){_0x55d40b=_0x55d40b||0xc8;return function(_0x54b7f8){if(_0x54b7f8){return _0x29af14['status'](_0x55d40b)['json'](_0x54b7f8);}};}function respondWithFilteredResult(_0x9f3b4f,_0x4520af){return function(_0x43f876){if(_0x43f876){var _0x515d48=typeof _0x4520af[_0xa302('0x15')]===_0xa302('0x16')&&typeof _0x4520af[_0xa302('0x17')]===_0xa302('0x16');var _0x55f4d8=_0x43f876[_0xa302('0x18')];var _0x22f679=_0x515d48?0x0:_0x4520af['offset'];var _0x21e3c7=_0x515d48?_0x43f876[_0xa302('0x18')]:_0x4520af[_0xa302('0x15')]+_0x4520af[_0xa302('0x17')];var _0x3f0ef9;if(_0x21e3c7>=_0x55f4d8){_0x21e3c7=_0x55f4d8;_0x3f0ef9=0xc8;}else{_0x3f0ef9=0xce;}_0x9f3b4f['status'](_0x3f0ef9);return _0x9f3b4f[_0xa302('0x19')](_0xa302('0x1a'),_0x22f679+'-'+_0x21e3c7+'/'+_0x55f4d8)[_0xa302('0x1b')](_0x43f876);}return null;};}function patchUpdates(_0x1154e4){return function(_0x1e6523){try{jsonpatch[_0xa302('0x1c')](_0x1e6523,_0x1154e4,!![]);}catch(_0x34d13a){return BPromise[_0xa302('0x1d')](_0x34d13a);}return _0x1e6523[_0xa302('0x1e')]();};}function saveUpdates(_0x29a45b,_0x8a5c7b){return function(_0x4be2c2){if(_0x4be2c2){return _0x4be2c2[_0xa302('0x1f')](_0x29a45b)[_0xa302('0x20')](function(_0x1e2950){return _0x1e2950;});}return null;};}function removeEntity(_0x258344,_0x193b90){return function(_0x401ce6){if(_0x401ce6){return _0x401ce6[_0xa302('0x21')]()[_0xa302('0x20')](function(){_0x258344['status'](0xcc)[_0xa302('0x14')]();});}};}function handleEntityNotFound(_0x450bf1,_0x497600){return function(_0x47cb85){if(!_0x47cb85){_0x450bf1['sendStatus'](0x194);}return _0x47cb85;};}function handleError(_0x44a227,_0x4454f7){_0x4454f7=_0x4454f7||0x1f4;return function(_0x4bd318){logger[_0xa302('0x22')](_0x4bd318[_0xa302('0x23')]);if(_0x4bd318['name']){delete _0x4bd318['name'];}_0x44a227[_0xa302('0x13')](_0x4454f7)[_0xa302('0x24')](_0x4bd318);};}exports[_0xa302('0x25')]=function(_0x13854e,_0x38d17f){var _0x3fcf67={},_0x37b77b={},_0x2ff84c={'count':0x0,'rows':[]};var _0x86749d=_[_0xa302('0x26')](db['MailServerOut']['rawAttributes'],function(_0x488f14){return{'name':_0x488f14[_0xa302('0x27')],'type':_0x488f14[_0xa302('0x28')]['key']};});_0x37b77b[_0xa302('0x29')]=_[_0xa302('0x26')](_0x86749d,'name');_0x37b77b['query']=_[_0xa302('0x2a')](_0x13854e['query']);_0x37b77b[_0xa302('0x2b')]=_[_0xa302('0x2c')](_0x37b77b[_0xa302('0x29')],_0x37b77b[_0xa302('0x2d')]);_0x3fcf67[_0xa302('0x2e')]=_[_0xa302('0x2c')](_0x37b77b['model'],qs[_0xa302('0x2f')](_0x13854e[_0xa302('0x2d')][_0xa302('0x2f')]));_0x3fcf67[_0xa302('0x2e')]=_0x3fcf67[_0xa302('0x2e')][_0xa302('0x30')]?_0x3fcf67['attributes']:_0x37b77b[_0xa302('0x29')];if(!_0x13854e['query']['hasOwnProperty'](_0xa302('0x31'))){_0x3fcf67['limit']=qs[_0xa302('0x17')](_0x13854e['query'][_0xa302('0x17')]);_0x3fcf67['offset']=qs['offset'](_0x13854e[_0xa302('0x2d')][_0xa302('0x15')]);}_0x3fcf67['order']=qs['sort'](_0x13854e[_0xa302('0x2d')]['sort']);_0x3fcf67[_0xa302('0x32')]=qs['filters'](_['pick'](_0x13854e[_0xa302('0x2d')],_0x37b77b[_0xa302('0x2b')]),_0x86749d);if(_0x13854e[_0xa302('0x2d')][_0xa302('0x33')]){_0x3fcf67[_0xa302('0x32')]=_[_0xa302('0x34')](_0x3fcf67[_0xa302('0x32')],{'$or':_['map'](_0x86749d,function(_0x4cf739){if(_0x4cf739[_0xa302('0x28')]!==_0xa302('0x35')){var _0xb6b990={};_0xb6b990[_0x4cf739[_0xa302('0x36')]]={'$like':'%'+_0x13854e[_0xa302('0x2d')][_0xa302('0x33')]+'%'};return _0xb6b990;}})});}_0x3fcf67=_[_0xa302('0x34')]({},_0x3fcf67,_0x13854e['options']);var _0x2b0b92={'where':_0x3fcf67[_0xa302('0x32')]};return db[_0xa302('0x37')]['count'](_0x2b0b92)[_0xa302('0x20')](function(_0x468c2f){_0x2ff84c['count']=_0x468c2f;if(_0x13854e[_0xa302('0x2d')][_0xa302('0x38')]){_0x3fcf67[_0xa302('0x39')]=[{'all':!![]}];}return db['MailServerOut'][_0xa302('0x3a')](_0x3fcf67);})[_0xa302('0x20')](function(_0x28c3c6){_0x2ff84c['rows']=_0x28c3c6;return _0x2ff84c;})[_0xa302('0x20')](respondWithFilteredResult(_0x38d17f,_0x3fcf67))[_0xa302('0x3b')](handleError(_0x38d17f,null));};exports[_0xa302('0x3c')]=function(_0x180165,_0x467e26){var _0x39d68a={'raw':!![],'where':{'id':_0x180165['params']['id']}},_0x459993={};_0x459993['model']=_[_0xa302('0x2a')](db['MailServerOut'][_0xa302('0x3d')]);_0x459993['query']=_[_0xa302('0x2a')](_0x180165[_0xa302('0x2d')]);_0x459993[_0xa302('0x2b')]=_[_0xa302('0x2c')](_0x459993[_0xa302('0x29')],_0x459993[_0xa302('0x2d')]);_0x39d68a['attributes']=_[_0xa302('0x2c')](_0x459993[_0xa302('0x29')],qs['fields'](_0x180165[_0xa302('0x2d')][_0xa302('0x2f')]));_0x39d68a[_0xa302('0x2e')]=_0x39d68a[_0xa302('0x2e')][_0xa302('0x30')]?_0x39d68a[_0xa302('0x2e')]:_0x459993[_0xa302('0x29')];if(_0x180165[_0xa302('0x2d')]['includeAll']){_0x39d68a[_0xa302('0x39')]=[{'all':!![]}];}_0x39d68a=_[_0xa302('0x34')]({},_0x39d68a,_0x180165[_0xa302('0x3e')]);return db['MailServerOut'][_0xa302('0x3f')](_0x39d68a)[_0xa302('0x20')](handleEntityNotFound(_0x467e26,null))[_0xa302('0x20')](respondWithResult(_0x467e26,null))[_0xa302('0x3b')](handleError(_0x467e26,null));};exports[_0xa302('0x40')]=function(_0x11792a,_0x3885bb){return db['MailServerOut'][_0xa302('0x40')](_0x11792a[_0xa302('0x41')],{})[_0xa302('0x20')](respondWithResult(_0x3885bb,0xc9))[_0xa302('0x3b')](handleError(_0x3885bb,null));};exports[_0xa302('0x1f')]=function(_0x458e04,_0xd5b04b){if(_0x458e04['body']['id']){delete _0x458e04[_0xa302('0x41')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x458e04[_0xa302('0x42')]['id']}})['then'](handleEntityNotFound(_0xd5b04b,null))[_0xa302('0x20')](saveUpdates(_0x458e04['body'],null))[_0xa302('0x20')](respondWithResult(_0xd5b04b,null))[_0xa302('0x3b')](handleError(_0xd5b04b,null));};exports[_0xa302('0x21')]=function(_0x2ea9c6,_0x2e4e67){return db[_0xa302('0x37')][_0xa302('0x3f')]({'where':{'id':_0x2ea9c6[_0xa302('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e4e67,null))[_0xa302('0x20')](removeEntity(_0x2e4e67,null))['catch'](handleError(_0x2e4e67,null));};
\ No newline at end of file
+var _0x6761=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','name','index','map','MailServerOut','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','show','params','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6761,0x85));var _0x1676=function(_0xa891af,_0x5ccb9f){_0xa891af=_0xa891af-0x0;var _0x32a3c5=_0x6761[_0xa891af];return _0x32a3c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1676('0x0'));var zipdir=require(_0x1676('0x1'));var jsonpatch=require(_0x1676('0x2'));var rp=require('request-promise');var moment=require(_0x1676('0x3'));var BPromise=require(_0x1676('0x4'));var Mustache=require(_0x1676('0x5'));var util=require('util');var path=require(_0x1676('0x6'));var sox=require(_0x1676('0x7'));var csv=require(_0x1676('0x8'));var ejs=require(_0x1676('0x9'));var fs=require('fs');var fs_extra=require(_0x1676('0xa'));var _=require(_0x1676('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1676('0xc'));var deskjs=require(_0x1676('0xd'));var toCsv=require(_0x1676('0x8'));var querystring=require(_0x1676('0xe'));var Papa=require(_0x1676('0xf'));var Redis=require(_0x1676('0x10'));var authService=require(_0x1676('0x11'));var qs=require(_0x1676('0x12'));var as=require(_0x1676('0x13'));var hardwareService=require(_0x1676('0x14'));var logger=require(_0x1676('0x15'))(_0x1676('0x16'));var utils=require(_0x1676('0x17'));var config=require(_0x1676('0x18'));var licenseUtil=require(_0x1676('0x19'));var db=require(_0x1676('0x1a'))['db'];function respondWithStatusCode(_0x17074f,_0x1130f4){_0x1130f4=_0x1130f4||0xcc;return function(_0x6f888b){if(_0x6f888b){return _0x17074f[_0x1676('0x1b')](_0x1130f4);}return _0x17074f[_0x1676('0x1c')](_0x1130f4)['end']();};}function respondWithResult(_0x4faa07,_0x2f4643){_0x2f4643=_0x2f4643||0xc8;return function(_0x453890){if(_0x453890){return _0x4faa07[_0x1676('0x1c')](_0x2f4643)[_0x1676('0x1d')](_0x453890);}};}function respondWithFilteredResult(_0x4e58a2,_0x4b4819){return function(_0x5b617){if(_0x5b617){var _0xdc416e=typeof _0x4b4819[_0x1676('0x1e')]===_0x1676('0x1f')&&typeof _0x4b4819[_0x1676('0x20')]===_0x1676('0x1f');var _0x3514f1=_0x5b617[_0x1676('0x21')];var _0xc93779=_0xdc416e?0x0:_0x4b4819['offset'];var _0x2ec2c8=_0xdc416e?_0x5b617[_0x1676('0x21')]:_0x4b4819[_0x1676('0x1e')]+_0x4b4819[_0x1676('0x20')];var _0x19e056;if(_0x2ec2c8>=_0x3514f1){_0x2ec2c8=_0x3514f1;_0x19e056=0xc8;}else{_0x19e056=0xce;}_0x4e58a2[_0x1676('0x1c')](_0x19e056);return _0x4e58a2[_0x1676('0x22')](_0x1676('0x23'),_0xc93779+'-'+_0x2ec2c8+'/'+_0x3514f1)['json'](_0x5b617);}return null;};}function patchUpdates(_0xc54753){return function(_0x28c32a){try{jsonpatch[_0x1676('0x24')](_0x28c32a,_0xc54753,!![]);}catch(_0x4f0f3a){return BPromise[_0x1676('0x25')](_0x4f0f3a);}return _0x28c32a['save']();};}function saveUpdates(_0x8bca9f,_0x1761c2){return function(_0xf3bccf){if(_0xf3bccf){return _0xf3bccf['update'](_0x8bca9f)[_0x1676('0x26')](function(_0x1831e0){return _0x1831e0;});}return null;};}function removeEntity(_0x2607d2,_0x15372c){return function(_0x1b9cfe){if(_0x1b9cfe){return _0x1b9cfe[_0x1676('0x27')]()[_0x1676('0x26')](function(){_0x2607d2[_0x1676('0x1c')](0xcc)[_0x1676('0x28')]();});}};}function handleEntityNotFound(_0x15232b,_0xd95675){return function(_0x3cc488){if(!_0x3cc488){_0x15232b[_0x1676('0x1b')](0x194);}return _0x3cc488;};}function handleError(_0x450fdc,_0x56f697){_0x56f697=_0x56f697||0x1f4;return function(_0x416e22){logger[_0x1676('0x29')](_0x416e22['stack']);if(_0x416e22[_0x1676('0x2a')]){delete _0x416e22[_0x1676('0x2a')];}_0x450fdc[_0x1676('0x1c')](_0x56f697)['send'](_0x416e22);};}exports[_0x1676('0x2b')]=function(_0xdbac69,_0x579923){var _0x5b7a82={},_0xa0a173={},_0x2301a0={'count':0x0,'rows':[]};var _0x555452=_[_0x1676('0x2c')](db[_0x1676('0x2d')][_0x1676('0x2e')],function(_0x373376){return{'name':_0x373376[_0x1676('0x2f')],'type':_0x373376[_0x1676('0x30')]['key']};});_0xa0a173[_0x1676('0x31')]=_[_0x1676('0x2c')](_0x555452,_0x1676('0x2a'));_0xa0a173[_0x1676('0x32')]=_[_0x1676('0x33')](_0xdbac69[_0x1676('0x32')]);_0xa0a173[_0x1676('0x34')]=_[_0x1676('0x35')](_0xa0a173[_0x1676('0x31')],_0xa0a173[_0x1676('0x32')]);_0x5b7a82[_0x1676('0x36')]=_[_0x1676('0x35')](_0xa0a173['model'],qs[_0x1676('0x37')](_0xdbac69[_0x1676('0x32')][_0x1676('0x37')]));_0x5b7a82[_0x1676('0x36')]=_0x5b7a82['attributes'][_0x1676('0x38')]?_0x5b7a82['attributes']:_0xa0a173[_0x1676('0x31')];if(!_0xdbac69[_0x1676('0x32')]['hasOwnProperty'](_0x1676('0x39'))){_0x5b7a82['limit']=qs[_0x1676('0x20')](_0xdbac69[_0x1676('0x32')][_0x1676('0x20')]);_0x5b7a82[_0x1676('0x1e')]=qs[_0x1676('0x1e')](_0xdbac69[_0x1676('0x32')][_0x1676('0x1e')]);}_0x5b7a82['order']=qs[_0x1676('0x3a')](_0xdbac69[_0x1676('0x32')]['sort']);_0x5b7a82['where']=qs['filters'](_[_0x1676('0x3b')](_0xdbac69[_0x1676('0x32')],_0xa0a173[_0x1676('0x34')]),_0x555452);if(_0xdbac69['query']['filter']){_0x5b7a82[_0x1676('0x3c')]=_[_0x1676('0x3d')](_0x5b7a82['where'],{'$or':_['map'](_0x555452,function(_0xf110df){if(_0xf110df[_0x1676('0x30')]!==_0x1676('0x3e')){var _0x223158={};_0x223158[_0xf110df[_0x1676('0x2a')]]={'$like':'%'+_0xdbac69['query'][_0x1676('0x3f')]+'%'};return _0x223158;}})});}_0x5b7a82=_[_0x1676('0x3d')]({},_0x5b7a82,_0xdbac69['options']);var _0x4ede4e={'where':_0x5b7a82[_0x1676('0x3c')]};return db['MailServerOut']['count'](_0x4ede4e)[_0x1676('0x26')](function(_0x371a7f){_0x2301a0[_0x1676('0x21')]=_0x371a7f;if(_0xdbac69['query']['includeAll']){_0x5b7a82[_0x1676('0x40')]=[{'all':!![]}];}return db[_0x1676('0x2d')][_0x1676('0x41')](_0x5b7a82);})[_0x1676('0x26')](function(_0x4c7a77){_0x2301a0[_0x1676('0x42')]=_0x4c7a77;return _0x2301a0;})['then'](respondWithFilteredResult(_0x579923,_0x5b7a82))['catch'](handleError(_0x579923,null));};exports[_0x1676('0x43')]=function(_0x13e593,_0x3e9348){var _0x4001e9={'raw':!![],'where':{'id':_0x13e593[_0x1676('0x44')]['id']}},_0x2fc31c={};_0x2fc31c[_0x1676('0x31')]=_[_0x1676('0x33')](db[_0x1676('0x2d')]['rawAttributes']);_0x2fc31c[_0x1676('0x32')]=_[_0x1676('0x33')](_0x13e593[_0x1676('0x32')]);_0x2fc31c[_0x1676('0x34')]=_['intersection'](_0x2fc31c[_0x1676('0x31')],_0x2fc31c[_0x1676('0x32')]);_0x4001e9[_0x1676('0x36')]=_[_0x1676('0x35')](_0x2fc31c[_0x1676('0x31')],qs[_0x1676('0x37')](_0x13e593[_0x1676('0x32')][_0x1676('0x37')]));_0x4001e9[_0x1676('0x36')]=_0x4001e9[_0x1676('0x36')]['length']?_0x4001e9[_0x1676('0x36')]:_0x2fc31c[_0x1676('0x31')];if(_0x13e593['query']['includeAll']){_0x4001e9[_0x1676('0x40')]=[{'all':!![]}];}_0x4001e9=_['merge']({},_0x4001e9,_0x13e593[_0x1676('0x45')]);return db[_0x1676('0x2d')][_0x1676('0x46')](_0x4001e9)[_0x1676('0x26')](handleEntityNotFound(_0x3e9348,null))[_0x1676('0x26')](respondWithResult(_0x3e9348,null))[_0x1676('0x47')](handleError(_0x3e9348,null));};exports[_0x1676('0x48')]=function(_0x2a8813,_0x12faa5){return db[_0x1676('0x2d')][_0x1676('0x48')](_0x2a8813[_0x1676('0x49')],{})[_0x1676('0x26')](respondWithResult(_0x12faa5,0xc9))['catch'](handleError(_0x12faa5,null));};exports['update']=function(_0xd5f87a,_0xb08181){if(_0xd5f87a[_0x1676('0x49')]['id']){delete _0xd5f87a[_0x1676('0x49')]['id'];}return db[_0x1676('0x2d')][_0x1676('0x46')]({'where':{'id':_0xd5f87a[_0x1676('0x44')]['id']}})[_0x1676('0x26')](handleEntityNotFound(_0xb08181,null))[_0x1676('0x26')](saveUpdates(_0xd5f87a[_0x1676('0x49')],null))[_0x1676('0x26')](respondWithResult(_0xb08181,null))['catch'](handleError(_0xb08181,null));};exports[_0x1676('0x27')]=function(_0x11659c,_0x4f72de){return db['MailServerOut'][_0x1676('0x46')]({'where':{'id':_0x11659c[_0x1676('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f72de,null))[_0x1676('0x26')](removeEntity(_0x4f72de,null))[_0x1676('0x47')](handleError(_0x4f72de,null));};
\ No newline at end of file
index ec002a4..330e557 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70bc=['api','moment','request-promise','path','./mailServerOut.attributes','mail_servers_out','lodash','../../config/logger'];(function(_0x392cd9,_0x4a1b6a){var _0x26c01b=function(_0x4b3f1e){while(--_0x4b3f1e){_0x392cd9['push'](_0x392cd9['shift']());}};_0x26c01b(++_0x4a1b6a);}(_0x70bc,0x1be));var _0xc70b=function(_0x2dd1df,_0x2d54a0){_0x2dd1df=_0x2dd1df-0x0;var _0x1631c8=_0x70bc[_0x2dd1df];return _0x1631c8;};'use strict';var _=require(_0xc70b('0x0'));var util=require('util');var logger=require(_0xc70b('0x1'))(_0xc70b('0x2'));var moment=require(_0xc70b('0x3'));var BPromise=require('bluebird');var rp=require(_0xc70b('0x4'));var fs=require('fs');var path=require(_0xc70b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc70b('0x6'));module['exports']=function(_0x439ae2,_0x12adaa){return _0x439ae2['define']('MailServerOut',attributes,{'tableName':_0xc70b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0cf=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x263845,_0xb4b6d2){var _0x3ec47d=function(_0x1d4af6){while(--_0x1d4af6){_0x263845['push'](_0x263845['shift']());}};_0x3ec47d(++_0xb4b6d2);}(_0xb0cf,0x16e));var _0xfb0c=function(_0x105639,_0x3e8689){_0x105639=_0x105639-0x0;var _0xf6c4c9=_0xb0cf[_0x105639];return _0xf6c4c9;};'use strict';var _=require(_0xfb0c('0x0'));var util=require(_0xfb0c('0x1'));var logger=require(_0xfb0c('0x2'))(_0xfb0c('0x3'));var moment=require(_0xfb0c('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb0c('0x5'));var fs=require('fs');var path=require(_0xfb0c('0x6'));var rimraf=require(_0xfb0c('0x7'));var config=require(_0xfb0c('0x8'));var attributes=require(_0xfb0c('0x9'));module[_0xfb0c('0xa')]=function(_0x1011f9,_0x3ff2c8){return _0x1011f9[_0xfb0c('0xb')](_0xfb0c('0xc'),attributes,{'tableName':_0xfb0c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d3d3ce1..bf5fe6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x30d1ab,_0x2e3c8a){var _0x21d164=function(_0x13ef94){while(--_0x13ef94){_0x30d1ab['push'](_0x30d1ab['shift']());}};_0x21d164(++_0x2e3c8a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1a8155,_0x432a76){var _0x54be6a=function(_0x4b6457){while(--_0x4b6457){_0x1a8155['push'](_0x1a8155['shift']());}};_0x54be6a(++_0x432a76);}(_0xdb28,0x106));var _0x8db2=function(_0x43a73d,_0x291598){_0x43a73d=_0x43a73d-0x0;var _0x1e90c5=_0xdb28[_0x43a73d];return _0x1e90c5;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index 86dd46b..32ac986 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a7=['/describe','show','post','/:id','update','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index'];(function(_0x5236f5,_0xdeba4f){var _0x4f9072=function(_0x4aa339){while(--_0x4aa339){_0x5236f5['push'](_0x5236f5['shift']());}};_0x4f9072(++_0xdeba4f);}(_0xb7a7,0x1c1));var _0x7b7a=function(_0x25f986,_0x484d6c){_0x25f986=_0x25f986-0x0;var _0x2b3048=_0xb7a7[_0x25f986];return _0x2b3048;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7b7a('0x0'));var timeout=require(_0x7b7a('0x1'));var express=require(_0x7b7a('0x2'));var router=express[_0x7b7a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7b7a('0x4'));var config=require(_0x7b7a('0x5'));var controller=require(_0x7b7a('0x6'));router[_0x7b7a('0x7')]('/',auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x9')]);router[_0x7b7a('0x7')](_0x7b7a('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7b7a('0x7')]('/:id',auth[_0x7b7a('0x8')](),controller[_0x7b7a('0xb')]);router[_0x7b7a('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7b7a('0xd'),auth['isAuthenticated'](),controller[_0x7b7a('0xe')]);router[_0x7b7a('0xf')](_0x7b7a('0xd'),auth[_0x7b7a('0x8')](),controller['destroy']);module[_0x7b7a('0x10')]=router;
\ No newline at end of file
+var _0x5ff8=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4a30f1,_0x2e75a8){var _0x1e0a09=function(_0xfc5f54){while(--_0xfc5f54){_0x4a30f1['push'](_0x4a30f1['shift']());}};_0x1e0a09(++_0x2e75a8);}(_0x5ff8,0x17e));var _0x85ff=function(_0x4945d1,_0x561d33){_0x4945d1=_0x4945d1-0x0;var _0xa1fdc=_0x5ff8[_0x4945d1];return _0xa1fdc;};'use strict';var multer=require(_0x85ff('0x0'));var util=require('util');var path=require(_0x85ff('0x1'));var timeout=require(_0x85ff('0x2'));var express=require(_0x85ff('0x3'));var router=express[_0x85ff('0x4')]();var fs_extra=require(_0x85ff('0x5'));var auth=require(_0x85ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x85ff('0x7'));var controller=require(_0x85ff('0x8'));router[_0x85ff('0x9')]('/',auth[_0x85ff('0xa')](),controller[_0x85ff('0xb')]);router[_0x85ff('0x9')](_0x85ff('0xc'),auth[_0x85ff('0xa')](),controller[_0x85ff('0xd')]);router[_0x85ff('0x9')]('/:id',auth[_0x85ff('0xa')](),controller[_0x85ff('0xe')]);router[_0x85ff('0xf')]('/',auth[_0x85ff('0xa')](),controller[_0x85ff('0x10')]);router[_0x85ff('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x85ff('0x12')]);router[_0x85ff('0x13')]('/:id',auth[_0x85ff('0xa')](),controller[_0x85ff('0x14')]);module[_0x85ff('0x15')]=router;
\ No newline at end of file
index 306cff6..685b230 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c09=['exports','STRING'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x7c09,0x102));var _0x97c0=function(_0x37ddef,_0x3638c4){_0x37ddef=_0x37ddef-0x0;var _0x1d7903=_0x7c09[_0x37ddef];return _0x1d7903;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x97c0('0x1')]}};
\ No newline at end of file
+var _0x0d4d=['STRING','name','sequelize','exports'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x0d4d,0x132));var _0xd0d4=function(_0x1ec5c5,_0xbf3c1c){_0x1ec5c5=_0x1ec5c5-0x0;var _0x5b16a6=_0x0d4d[_0x1ec5c5];return _0x5b16a6;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'unique':_0xd0d4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd0d4('0x2')]}};
\ No newline at end of file
index a3bcbae..05879b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4c4=['update','then','destroy','error','stack','name','send','MailSubstatus','fieldName','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4c4,0x155));var _0x4b4c=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xb4c4[_0x3bd52b];return _0x1e5b89;};'use strict';var emlformat=require(_0x4b4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b4c('0x2'));var moment=require('moment');var BPromise=require(_0x4b4c('0x3'));var Mustache=require(_0x4b4c('0x4'));var util=require(_0x4b4c('0x5'));var path=require('path');var sox=require(_0x4b4c('0x6'));var csv=require('to-csv');var ejs=require(_0x4b4c('0x7'));var fs=require('fs');var fs_extra=require(_0x4b4c('0x8'));var _=require(_0x4b4c('0x9'));var squel=require(_0x4b4c('0xa'));var crypto=require(_0x4b4c('0xb'));var jsforce=require(_0x4b4c('0xc'));var deskjs=require(_0x4b4c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4b4c('0xe'));var Papa=require(_0x4b4c('0xf'));var Redis=require(_0x4b4c('0x10'));var authService=require(_0x4b4c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b4c('0x12'));var logger=require(_0x4b4c('0x13'))(_0x4b4c('0x14'));var utils=require(_0x4b4c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cdaa7,_0x3ac0fe){_0x3ac0fe=_0x3ac0fe||0xcc;return function(_0x56b475){if(_0x56b475){return _0x5cdaa7[_0x4b4c('0x16')](_0x3ac0fe);}return _0x5cdaa7[_0x4b4c('0x17')](_0x3ac0fe)[_0x4b4c('0x18')]();};}function respondWithResult(_0x487869,_0x66da3f){_0x66da3f=_0x66da3f||0xc8;return function(_0x3ede3b){if(_0x3ede3b){return _0x487869[_0x4b4c('0x17')](_0x66da3f)[_0x4b4c('0x19')](_0x3ede3b);}};}function respondWithFilteredResult(_0x616895,_0xf77cd7){return function(_0x193053){if(_0x193053){var _0xe023ee=typeof _0xf77cd7[_0x4b4c('0x1a')]===_0x4b4c('0x1b')&&typeof _0xf77cd7[_0x4b4c('0x1c')]===_0x4b4c('0x1b');var _0x459bde=_0x193053['count'];var _0xa7f07b=_0xe023ee?0x0:_0xf77cd7[_0x4b4c('0x1a')];var _0x3de3a5=_0xe023ee?_0x193053[_0x4b4c('0x1d')]:_0xf77cd7[_0x4b4c('0x1a')]+_0xf77cd7[_0x4b4c('0x1c')];var _0xade1fd;if(_0x3de3a5>=_0x459bde){_0x3de3a5=_0x459bde;_0xade1fd=0xc8;}else{_0xade1fd=0xce;}_0x616895[_0x4b4c('0x17')](_0xade1fd);return _0x616895[_0x4b4c('0x1e')](_0x4b4c('0x1f'),_0xa7f07b+'-'+_0x3de3a5+'/'+_0x459bde)[_0x4b4c('0x19')](_0x193053);}return null;};}function patchUpdates(_0x21be0f){return function(_0x61824f){try{jsonpatch[_0x4b4c('0x20')](_0x61824f,_0x21be0f,!![]);}catch(_0x43ec89){return BPromise[_0x4b4c('0x21')](_0x43ec89);}return _0x61824f['save']();};}function saveUpdates(_0x409f86,_0x32213a){return function(_0xfa8dbb){if(_0xfa8dbb){return _0xfa8dbb[_0x4b4c('0x22')](_0x409f86)[_0x4b4c('0x23')](function(_0x56e796){return _0x56e796;});}return null;};}function removeEntity(_0x25cd26,_0x1502f8){return function(_0x4312b9){if(_0x4312b9){return _0x4312b9[_0x4b4c('0x24')]()['then'](function(){_0x25cd26[_0x4b4c('0x17')](0xcc)[_0x4b4c('0x18')]();});}};}function handleEntityNotFound(_0x1f4d3f,_0xc87de4){return function(_0x16d809){if(!_0x16d809){_0x1f4d3f[_0x4b4c('0x16')](0x194);}return _0x16d809;};}function handleError(_0x326a6e,_0x5f1b1f){_0x5f1b1f=_0x5f1b1f||0x1f4;return function(_0x357dfc){logger[_0x4b4c('0x25')](_0x357dfc[_0x4b4c('0x26')]);if(_0x357dfc[_0x4b4c('0x27')]){delete _0x357dfc[_0x4b4c('0x27')];}_0x326a6e[_0x4b4c('0x17')](_0x5f1b1f)[_0x4b4c('0x28')](_0x357dfc);};}exports['index']=function(_0x2cab87,_0x508d61){var _0x46c9d5={},_0x126cbb={},_0x5a9c81={'count':0x0,'rows':[]};var _0x249def=_['map'](db[_0x4b4c('0x29')]['rawAttributes'],function(_0x1b2203){return{'name':_0x1b2203[_0x4b4c('0x2a')],'type':_0x1b2203['type'][_0x4b4c('0x2b')]};});_0x126cbb[_0x4b4c('0x2c')]=_[_0x4b4c('0x2d')](_0x249def,'name');_0x126cbb[_0x4b4c('0x2e')]=_[_0x4b4c('0x2f')](_0x2cab87['query']);_0x126cbb[_0x4b4c('0x30')]=_['intersection'](_0x126cbb[_0x4b4c('0x2c')],_0x126cbb[_0x4b4c('0x2e')]);_0x46c9d5[_0x4b4c('0x31')]=_['intersection'](_0x126cbb[_0x4b4c('0x2c')],qs['fields'](_0x2cab87[_0x4b4c('0x2e')][_0x4b4c('0x32')]));_0x46c9d5[_0x4b4c('0x31')]=_0x46c9d5[_0x4b4c('0x31')][_0x4b4c('0x33')]?_0x46c9d5[_0x4b4c('0x31')]:_0x126cbb[_0x4b4c('0x2c')];if(!_0x2cab87[_0x4b4c('0x2e')][_0x4b4c('0x34')](_0x4b4c('0x35'))){_0x46c9d5[_0x4b4c('0x1c')]=qs[_0x4b4c('0x1c')](_0x2cab87[_0x4b4c('0x2e')]['limit']);_0x46c9d5[_0x4b4c('0x1a')]=qs[_0x4b4c('0x1a')](_0x2cab87[_0x4b4c('0x2e')][_0x4b4c('0x1a')]);}_0x46c9d5[_0x4b4c('0x36')]=qs[_0x4b4c('0x37')](_0x2cab87[_0x4b4c('0x2e')][_0x4b4c('0x37')]);_0x46c9d5[_0x4b4c('0x38')]=qs[_0x4b4c('0x30')](_[_0x4b4c('0x39')](_0x2cab87[_0x4b4c('0x2e')],_0x126cbb['filters']),_0x249def);if(_0x2cab87[_0x4b4c('0x2e')][_0x4b4c('0x3a')]){_0x46c9d5[_0x4b4c('0x38')]=_[_0x4b4c('0x3b')](_0x46c9d5[_0x4b4c('0x38')],{'$or':_['map'](_0x249def,function(_0x3daeed){if(_0x3daeed['type']!==_0x4b4c('0x3c')){var _0x3bbf90={};_0x3bbf90[_0x3daeed['name']]={'$like':'%'+_0x2cab87[_0x4b4c('0x2e')][_0x4b4c('0x3a')]+'%'};return _0x3bbf90;}})});}_0x46c9d5=_[_0x4b4c('0x3b')]({},_0x46c9d5,_0x2cab87['options']);var _0xbb53cc={'where':_0x46c9d5['where']};return db[_0x4b4c('0x29')][_0x4b4c('0x1d')](_0xbb53cc)[_0x4b4c('0x23')](function(_0x53a79e){_0x5a9c81[_0x4b4c('0x1d')]=_0x53a79e;if(_0x2cab87[_0x4b4c('0x2e')][_0x4b4c('0x3d')]){_0x46c9d5[_0x4b4c('0x3e')]=[{'all':!![]}];}return db['MailSubstatus'][_0x4b4c('0x3f')](_0x46c9d5);})[_0x4b4c('0x23')](function(_0x5c8534){_0x5a9c81[_0x4b4c('0x40')]=_0x5c8534;return _0x5a9c81;})['then'](respondWithFilteredResult(_0x508d61,_0x46c9d5))[_0x4b4c('0x41')](handleError(_0x508d61,null));};exports[_0x4b4c('0x42')]=function(_0x2821bf,_0x356500){var _0x3cdc63={'raw':!![],'where':{'id':_0x2821bf[_0x4b4c('0x43')]['id']}},_0x271897={};_0x271897[_0x4b4c('0x2c')]=_[_0x4b4c('0x2f')](db['MailSubstatus'][_0x4b4c('0x44')]);_0x271897['query']=_[_0x4b4c('0x2f')](_0x2821bf[_0x4b4c('0x2e')]);_0x271897[_0x4b4c('0x30')]=_['intersection'](_0x271897['model'],_0x271897['query']);_0x3cdc63[_0x4b4c('0x31')]=_[_0x4b4c('0x45')](_0x271897[_0x4b4c('0x2c')],qs[_0x4b4c('0x32')](_0x2821bf[_0x4b4c('0x2e')][_0x4b4c('0x32')]));_0x3cdc63[_0x4b4c('0x31')]=_0x3cdc63['attributes']['length']?_0x3cdc63['attributes']:_0x271897[_0x4b4c('0x2c')];if(_0x2821bf[_0x4b4c('0x2e')]['includeAll']){_0x3cdc63['include']=[{'all':!![]}];}_0x3cdc63=_[_0x4b4c('0x3b')]({},_0x3cdc63,_0x2821bf[_0x4b4c('0x46')]);return db[_0x4b4c('0x29')][_0x4b4c('0x47')](_0x3cdc63)['then'](handleEntityNotFound(_0x356500,null))[_0x4b4c('0x23')](respondWithResult(_0x356500,null))[_0x4b4c('0x41')](handleError(_0x356500,null));};exports['create']=function(_0xfd18c3,_0x75dd5a){return db['MailSubstatus'][_0x4b4c('0x48')](_0xfd18c3['body'],{})[_0x4b4c('0x23')](respondWithResult(_0x75dd5a,0xc9))[_0x4b4c('0x41')](handleError(_0x75dd5a,null));};exports[_0x4b4c('0x22')]=function(_0x3b5987,_0x45ab91){if(_0x3b5987[_0x4b4c('0x49')]['id']){delete _0x3b5987['body']['id'];}return db[_0x4b4c('0x29')]['find']({'where':{'id':_0x3b5987[_0x4b4c('0x43')]['id']}})[_0x4b4c('0x23')](handleEntityNotFound(_0x45ab91,null))[_0x4b4c('0x23')](saveUpdates(_0x3b5987[_0x4b4c('0x49')],null))[_0x4b4c('0x23')](respondWithResult(_0x45ab91,null))['catch'](handleError(_0x45ab91,null));};exports['destroy']=function(_0x403e75,_0x540ec3){return db['MailSubstatus']['find']({'where':{'id':_0x403e75['params']['id']}})[_0x4b4c('0x23')](handleEntityNotFound(_0x540ec3,null))[_0x4b4c('0x23')](removeEntity(_0x540ec3,null))[_0x4b4c('0x41')](handleError(_0x540ec3,null));};exports[_0x4b4c('0x4a')]=function(_0x4ff9b1,_0x5b0e98){return db[_0x4b4c('0x29')][_0x4b4c('0x4a')]()[_0x4b4c('0x23')](respondWithResult(_0x5b0e98,null))[_0x4b4c('0x41')](handleError(_0x5b0e98,null));};
\ No newline at end of file
+var _0x8052=['index','map','MailSubstatus','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x27f926,_0x3c6d0e){var _0x16b939=function(_0x54b9fe){while(--_0x54b9fe){_0x27f926['push'](_0x27f926['shift']());}};_0x16b939(++_0x3c6d0e);}(_0x8052,0xbc));var _0x2805=function(_0x472619,_0x369fcc){_0x472619=_0x472619-0x0;var _0x14a669=_0x8052[_0x472619];return _0x14a669;};'use strict';var emlformat=require(_0x2805('0x0'));var rimraf=require(_0x2805('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2805('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2805('0x3'));var util=require(_0x2805('0x4'));var path=require(_0x2805('0x5'));var sox=require('sox');var csv=require(_0x2805('0x6'));var ejs=require(_0x2805('0x7'));var fs=require('fs');var fs_extra=require(_0x2805('0x8'));var _=require(_0x2805('0x9'));var squel=require(_0x2805('0xa'));var crypto=require('crypto');var jsforce=require(_0x2805('0xb'));var deskjs=require(_0x2805('0xc'));var toCsv=require(_0x2805('0x6'));var querystring=require('querystring');var Papa=require(_0x2805('0xd'));var Redis=require(_0x2805('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2805('0xf'));var as=require(_0x2805('0x10'));var hardwareService=require(_0x2805('0x11'));var logger=require(_0x2805('0x12'))(_0x2805('0x13'));var utils=require(_0x2805('0x14'));var config=require(_0x2805('0x15'));var licenseUtil=require(_0x2805('0x16'));var db=require(_0x2805('0x17'))['db'];function respondWithStatusCode(_0xe24c3a,_0x1b7220){_0x1b7220=_0x1b7220||0xcc;return function(_0xabb767){if(_0xabb767){return _0xe24c3a[_0x2805('0x18')](_0x1b7220);}return _0xe24c3a[_0x2805('0x19')](_0x1b7220)[_0x2805('0x1a')]();};}function respondWithResult(_0x1aa512,_0x273978){_0x273978=_0x273978||0xc8;return function(_0x30e2f5){if(_0x30e2f5){return _0x1aa512[_0x2805('0x19')](_0x273978)['json'](_0x30e2f5);}};}function respondWithFilteredResult(_0x2a8ccd,_0x298091){return function(_0x20d434){if(_0x20d434){var _0x33be63=typeof _0x298091[_0x2805('0x1b')]===_0x2805('0x1c')&&typeof _0x298091[_0x2805('0x1d')]===_0x2805('0x1c');var _0x32fe76=_0x20d434['count'];var _0x328f3f=_0x33be63?0x0:_0x298091['offset'];var _0x124a5d=_0x33be63?_0x20d434[_0x2805('0x1e')]:_0x298091[_0x2805('0x1b')]+_0x298091['limit'];var _0x44f8a7;if(_0x124a5d>=_0x32fe76){_0x124a5d=_0x32fe76;_0x44f8a7=0xc8;}else{_0x44f8a7=0xce;}_0x2a8ccd['status'](_0x44f8a7);return _0x2a8ccd[_0x2805('0x1f')](_0x2805('0x20'),_0x328f3f+'-'+_0x124a5d+'/'+_0x32fe76)[_0x2805('0x21')](_0x20d434);}return null;};}function patchUpdates(_0x4bd35c){return function(_0x48a4f8){try{jsonpatch[_0x2805('0x22')](_0x48a4f8,_0x4bd35c,!![]);}catch(_0x3d9440){return BPromise[_0x2805('0x23')](_0x3d9440);}return _0x48a4f8[_0x2805('0x24')]();};}function saveUpdates(_0x5089cd,_0x1ad218){return function(_0xbe10f2){if(_0xbe10f2){return _0xbe10f2[_0x2805('0x25')](_0x5089cd)[_0x2805('0x26')](function(_0xa626c3){return _0xa626c3;});}return null;};}function removeEntity(_0x2ef20f,_0x183641){return function(_0x22249d){if(_0x22249d){return _0x22249d[_0x2805('0x27')]()['then'](function(){_0x2ef20f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1509f4,_0xba5de){return function(_0x59fbc6){if(!_0x59fbc6){_0x1509f4['sendStatus'](0x194);}return _0x59fbc6;};}function handleError(_0x57943c,_0x448244){_0x448244=_0x448244||0x1f4;return function(_0x2ad8ba){logger[_0x2805('0x28')](_0x2ad8ba[_0x2805('0x29')]);if(_0x2ad8ba[_0x2805('0x2a')]){delete _0x2ad8ba[_0x2805('0x2a')];}_0x57943c[_0x2805('0x19')](_0x448244)['send'](_0x2ad8ba);};}exports[_0x2805('0x2b')]=function(_0x16ad39,_0x4b2d96){var _0x533061={},_0x1a86cf={},_0x5c6246={'count':0x0,'rows':[]};var _0x304d1d=_[_0x2805('0x2c')](db[_0x2805('0x2d')][_0x2805('0x2e')],function(_0x294b71){return{'name':_0x294b71['fieldName'],'type':_0x294b71['type'][_0x2805('0x2f')]};});_0x1a86cf[_0x2805('0x30')]=_[_0x2805('0x2c')](_0x304d1d,_0x2805('0x2a'));_0x1a86cf[_0x2805('0x31')]=_[_0x2805('0x32')](_0x16ad39[_0x2805('0x31')]);_0x1a86cf[_0x2805('0x33')]=_['intersection'](_0x1a86cf['model'],_0x1a86cf[_0x2805('0x31')]);_0x533061[_0x2805('0x34')]=_[_0x2805('0x35')](_0x1a86cf[_0x2805('0x30')],qs[_0x2805('0x36')](_0x16ad39[_0x2805('0x31')][_0x2805('0x36')]));_0x533061[_0x2805('0x34')]=_0x533061[_0x2805('0x34')][_0x2805('0x37')]?_0x533061[_0x2805('0x34')]:_0x1a86cf[_0x2805('0x30')];if(!_0x16ad39['query'][_0x2805('0x38')](_0x2805('0x39'))){_0x533061[_0x2805('0x1d')]=qs[_0x2805('0x1d')](_0x16ad39['query']['limit']);_0x533061[_0x2805('0x1b')]=qs[_0x2805('0x1b')](_0x16ad39[_0x2805('0x31')][_0x2805('0x1b')]);}_0x533061[_0x2805('0x3a')]=qs[_0x2805('0x3b')](_0x16ad39[_0x2805('0x31')]['sort']);_0x533061[_0x2805('0x3c')]=qs[_0x2805('0x33')](_[_0x2805('0x3d')](_0x16ad39[_0x2805('0x31')],_0x1a86cf[_0x2805('0x33')]),_0x304d1d);if(_0x16ad39[_0x2805('0x31')]['filter']){_0x533061[_0x2805('0x3c')]=_['merge'](_0x533061[_0x2805('0x3c')],{'$or':_['map'](_0x304d1d,function(_0x432753){if(_0x432753[_0x2805('0x3e')]!==_0x2805('0x3f')){var _0x29b04c={};_0x29b04c[_0x432753['name']]={'$like':'%'+_0x16ad39[_0x2805('0x31')][_0x2805('0x40')]+'%'};return _0x29b04c;}})});}_0x533061=_[_0x2805('0x41')]({},_0x533061,_0x16ad39[_0x2805('0x42')]);var _0x4bed60={'where':_0x533061[_0x2805('0x3c')]};return db[_0x2805('0x2d')][_0x2805('0x1e')](_0x4bed60)[_0x2805('0x26')](function(_0x1abf25){_0x5c6246[_0x2805('0x1e')]=_0x1abf25;if(_0x16ad39['query'][_0x2805('0x43')]){_0x533061[_0x2805('0x44')]=[{'all':!![]}];}return db[_0x2805('0x2d')]['findAll'](_0x533061);})[_0x2805('0x26')](function(_0x4c1b4c){_0x5c6246[_0x2805('0x45')]=_0x4c1b4c;return _0x5c6246;})[_0x2805('0x26')](respondWithFilteredResult(_0x4b2d96,_0x533061))[_0x2805('0x46')](handleError(_0x4b2d96,null));};exports[_0x2805('0x47')]=function(_0x2cd429,_0xf857fc){var _0x4f14e0={'raw':!![],'where':{'id':_0x2cd429['params']['id']}},_0x59b92c={};_0x59b92c['model']=_[_0x2805('0x32')](db[_0x2805('0x2d')]['rawAttributes']);_0x59b92c['query']=_[_0x2805('0x32')](_0x2cd429[_0x2805('0x31')]);_0x59b92c[_0x2805('0x33')]=_[_0x2805('0x35')](_0x59b92c['model'],_0x59b92c[_0x2805('0x31')]);_0x4f14e0[_0x2805('0x34')]=_[_0x2805('0x35')](_0x59b92c[_0x2805('0x30')],qs[_0x2805('0x36')](_0x2cd429[_0x2805('0x31')][_0x2805('0x36')]));_0x4f14e0[_0x2805('0x34')]=_0x4f14e0['attributes'][_0x2805('0x37')]?_0x4f14e0[_0x2805('0x34')]:_0x59b92c[_0x2805('0x30')];if(_0x2cd429['query'][_0x2805('0x43')]){_0x4f14e0['include']=[{'all':!![]}];}_0x4f14e0=_[_0x2805('0x41')]({},_0x4f14e0,_0x2cd429[_0x2805('0x42')]);return db['MailSubstatus'][_0x2805('0x48')](_0x4f14e0)[_0x2805('0x26')](handleEntityNotFound(_0xf857fc,null))[_0x2805('0x26')](respondWithResult(_0xf857fc,null))[_0x2805('0x46')](handleError(_0xf857fc,null));};exports[_0x2805('0x49')]=function(_0x395ffa,_0x870d96){return db[_0x2805('0x2d')]['create'](_0x395ffa['body'],{})[_0x2805('0x26')](respondWithResult(_0x870d96,0xc9))[_0x2805('0x46')](handleError(_0x870d96,null));};exports['update']=function(_0x3eaaa5,_0x2094ad){if(_0x3eaaa5['body']['id']){delete _0x3eaaa5[_0x2805('0x4a')]['id'];}return db[_0x2805('0x2d')]['find']({'where':{'id':_0x3eaaa5[_0x2805('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2094ad,null))[_0x2805('0x26')](saveUpdates(_0x3eaaa5[_0x2805('0x4a')],null))[_0x2805('0x26')](respondWithResult(_0x2094ad,null))[_0x2805('0x46')](handleError(_0x2094ad,null));};exports[_0x2805('0x27')]=function(_0x2a4265,_0x5c2228){return db[_0x2805('0x2d')][_0x2805('0x48')]({'where':{'id':_0x2a4265[_0x2805('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c2228,null))[_0x2805('0x26')](removeEntity(_0x5c2228,null))['catch'](handleError(_0x5c2228,null));};exports[_0x2805('0x4c')]=function(_0x3f07b3,_0x12df29){return db['MailSubstatus']['describe']()[_0x2805('0x26')](respondWithResult(_0x12df29,null))[_0x2805('0x46')](handleError(_0x12df29,null));};
\ No newline at end of file
index a06fdb2..6b1bb3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf62e=['path','./mailSubstatus.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xf62e,0xa9));var _0xef62=function(_0x19aaf3,_0x2d6db7){_0x19aaf3=_0x19aaf3-0x0;var _0x492eb9=_0xf62e[_0x19aaf3];return _0x492eb9;};'use strict';var _=require(_0xef62('0x0'));var util=require(_0xef62('0x1'));var logger=require(_0xef62('0x2'))(_0xef62('0x3'));var moment=require(_0xef62('0x4'));var BPromise=require(_0xef62('0x5'));var rp=require(_0xef62('0x6'));var fs=require('fs');var path=require(_0xef62('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef62('0x8'));module[_0xef62('0x9')]=function(_0x47815f,_0x2ba590){return _0x47815f[_0xef62('0xa')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f5d=['./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','../../config/logger','moment','path','../../config/environment'];(function(_0x2c4ece,_0x1b49c1){var _0x4a75a0=function(_0x270cf5){while(--_0x270cf5){_0x2c4ece['push'](_0x2c4ece['shift']());}};_0x4a75a0(++_0x1b49c1);}(_0x3f5d,0x13f));var _0xd3f5=function(_0x260aff,_0x26a602){_0x260aff=_0x260aff-0x0;var _0x57a755=_0x3f5d[_0x260aff];return _0x57a755;};'use strict';var _=require(_0xd3f5('0x0'));var util=require('util');var logger=require(_0xd3f5('0x1'))('api');var moment=require(_0xd3f5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3f5('0x3'));var rimraf=require('rimraf');var config=require(_0xd3f5('0x4'));var attributes=require(_0xd3f5('0x5'));module['exports']=function(_0x1ad2fd,_0x34e133){return _0x1ad2fd[_0xd3f5('0x6')](_0xd3f5('0x7'),attributes,{'tableName':_0xd3f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b10c0c..1d23812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x285b=['MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x285b,0x16f));var _0xb285=function(_0x2f8622,_0x3f8635){_0x2f8622=_0x2f8622-0x0;var _0x4c9583=_0x285b[_0x2f8622];return _0x4c9583;};'use strict';var _=require(_0xb285('0x0'));var util=require(_0xb285('0x1'));var moment=require('moment');var BPromise=require(_0xb285('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb285('0x3'));var db=require(_0xb285('0x4'))['db'];var utils=require(_0xb285('0x5'));var logger=require(_0xb285('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb285('0x7'));var client=jayson['client'][_0xb285('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c597a,_0x270ea3,_0x551c36){return new BPromise(function(_0x387d0f,_0x337b54){return client['request'](_0x1c597a,_0x551c36)['then'](function(_0x3b1091){logger[_0xb285('0x9')](_0xb285('0xa'),_0x270ea3,_0xb285('0xb'));logger[_0xb285('0xc')](_0xb285('0xd'),_0x270ea3,_0xb285('0xb'),JSON['stringify'](_0x3b1091));if(_0x3b1091['error']){if(_0x3b1091[_0xb285('0xe')][_0xb285('0xf')]===0x1f4){logger[_0xb285('0xe')](_0xb285('0xa'),_0x270ea3,_0x3b1091[_0xb285('0xe')][_0xb285('0x10')]);return _0x337b54(_0x3b1091[_0xb285('0xe')][_0xb285('0x10')]);}logger[_0xb285('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x270ea3,_0x3b1091[_0xb285('0xe')][_0xb285('0x10')]);return _0x387d0f(_0x3b1091[_0xb285('0xe')][_0xb285('0x10')]);}else{logger[_0xb285('0x9')]('MailSubstatus,\x20%s,\x20%s',_0x270ea3,'request\x20sent');_0x387d0f(_0x3b1091[_0xb285('0x11')][_0xb285('0x10')]);}})[_0xb285('0x12')](function(_0x23c6fd){logger[_0xb285('0xe')](_0xb285('0xa'),_0x270ea3,_0x23c6fd);_0x337b54(_0x23c6fd);});});}
\ No newline at end of file
+var _0x4457=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x52ce3e,_0x25abc7){var _0x49f0ef=function(_0x108653){while(--_0x108653){_0x52ce3e['push'](_0x52ce3e['shift']());}};_0x49f0ef(++_0x25abc7);}(_0x4457,0xa9));var _0x7445=function(_0x5b2865,_0x3b814b){_0x5b2865=_0x5b2865-0x0;var _0x3cb4c6=_0x4457[_0x5b2865];return _0x3cb4c6;};'use strict';var _=require('lodash');var util=require(_0x7445('0x0'));var moment=require(_0x7445('0x1'));var BPromise=require(_0x7445('0x2'));var rs=require(_0x7445('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7445('0x4'))['db'];var utils=require(_0x7445('0x5'));var logger=require('../../config/logger')(_0x7445('0x6'));var config=require(_0x7445('0x7'));var jayson=require(_0x7445('0x8'));var client=jayson[_0x7445('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x313a4f,_0x2767c9,_0x286aa0){return new BPromise(function(_0x7c2b2d,_0x17144a){return client[_0x7445('0xa')](_0x313a4f,_0x286aa0)['then'](function(_0x17e096){logger[_0x7445('0xb')](_0x7445('0xc'),_0x2767c9,_0x7445('0xd'));logger[_0x7445('0xe')](_0x7445('0xf'),_0x2767c9,'request\x20sent',JSON[_0x7445('0x10')](_0x17e096));if(_0x17e096['error']){if(_0x17e096[_0x7445('0x11')]['code']===0x1f4){logger[_0x7445('0x11')](_0x7445('0xc'),_0x2767c9,_0x17e096[_0x7445('0x11')][_0x7445('0x12')]);return _0x17144a(_0x17e096[_0x7445('0x11')][_0x7445('0x12')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2767c9,_0x17e096[_0x7445('0x11')]['message']);return _0x7c2b2d(_0x17e096[_0x7445('0x11')][_0x7445('0x12')]);}else{logger['info'](_0x7445('0xc'),_0x2767c9,'request\x20sent');_0x7c2b2d(_0x17e096[_0x7445('0x13')]['message']);}})[_0x7445('0x14')](function(_0x9dfcc9){logger[_0x7445('0x11')](_0x7445('0xc'),_0x2767c9,_0x9dfcc9);_0x17144a(_0x9dfcc9);});});}
\ No newline at end of file
index e8b7607..17e86f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefa9=['put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0xefa9,0x6c));var _0x9efa=function(_0x28c147,_0x4eaff6){_0x28c147=_0x28c147-0x0;var _0x518d5b=_0xefa9[_0x28c147];return _0x518d5b;};'use strict';var multer=require(_0x9efa('0x0'));var util=require('util');var path=require(_0x9efa('0x1'));var timeout=require(_0x9efa('0x2'));var express=require(_0x9efa('0x3'));var router=express[_0x9efa('0x4')]();var fs_extra=require(_0x9efa('0x5'));var auth=require(_0x9efa('0x6'));var interaction=require(_0x9efa('0x7'));var config=require(_0x9efa('0x8'));var controller=require(_0x9efa('0x9'));router[_0x9efa('0xa')]('/',auth[_0x9efa('0xb')](),controller[_0x9efa('0xc')]);router[_0x9efa('0xa')](_0x9efa('0xd'),auth[_0x9efa('0xb')](),controller[_0x9efa('0xe')]);router[_0x9efa('0xa')](_0x9efa('0xf'),auth['isAuthenticated'](),controller[_0x9efa('0x10')]);router[_0x9efa('0x11')]('/',auth[_0x9efa('0xb')](),controller['create']);router[_0x9efa('0x12')](_0x9efa('0xf'),auth['isAuthenticated'](),controller[_0x9efa('0x13')]);router['delete'](_0x9efa('0xf'),auth['isAuthenticated'](),controller[_0x9efa('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xe45b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','destroy','exports','multer','util','path'];(function(_0x5c85c8,_0x16110b){var _0x42d66f=function(_0x2c6dda){while(--_0x2c6dda){_0x5c85c8['push'](_0x5c85c8['shift']());}};_0x42d66f(++_0x16110b);}(_0xe45b,0xd9));var _0xbe45=function(_0x567883,_0x3e80ca){_0x567883=_0x567883-0x0;var _0x5429d8=_0xe45b[_0x567883];return _0x5429d8;};'use strict';var multer=require(_0xbe45('0x0'));var util=require(_0xbe45('0x1'));var path=require(_0xbe45('0x2'));var timeout=require(_0xbe45('0x3'));var express=require(_0xbe45('0x4'));var router=express[_0xbe45('0x5')]();var fs_extra=require(_0xbe45('0x6'));var auth=require(_0xbe45('0x7'));var interaction=require(_0xbe45('0x8'));var config=require(_0xbe45('0x9'));var controller=require(_0xbe45('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xbe45('0xb')]);router[_0xbe45('0xc')](_0xbe45('0xd'),auth[_0xbe45('0xe')](),controller[_0xbe45('0xf')]);router[_0xbe45('0xc')](_0xbe45('0x10'),auth[_0xbe45('0xe')](),controller[_0xbe45('0x11')]);router[_0xbe45('0x12')]('/',auth[_0xbe45('0xe')](),controller[_0xbe45('0x13')]);router['put'](_0xbe45('0x10'),auth[_0xbe45('0xe')](),controller['update']);router['delete']('/:id',auth[_0xbe45('0xe')](),controller[_0xbe45('0x14')]);module[_0xbe45('0x15')]=router;
\ No newline at end of file
index 8cac97b..35044d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x151e10,_0x5e91cd){var _0x5326e7=function(_0xcb6b47){while(--_0xcb6b47){_0x151e10['push'](_0x151e10['shift']());}};_0x5326e7(++_0x5e91cd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x00bb[_0x397e5f];return _0x5302b8;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0xfa5032,_0x5be306){var _0x41f425=function(_0x3771f7){while(--_0x3771f7){_0xfa5032['push'](_0xfa5032['shift']());}};_0x41f425(++_0x5be306);}(_0x4b84,0x1cc));var _0x44b8=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x4b84[_0x134c2e];return _0x2825db;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 8733a26..60874f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ed=['query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','model'];(function(_0x70bb8,_0x1da278){var _0x48ba84=function(_0xb567b9){while(--_0xb567b9){_0x70bb8['push'](_0x70bb8['shift']());}};_0x48ba84(++_0x1da278);}(_0x61ed,0xf5));var _0xd61e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61ed[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd61e('0x0'));var zipdir=require(_0xd61e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd61e('0x2'));var BPromise=require(_0xd61e('0x3'));var Mustache=require('mustache');var util=require(_0xd61e('0x4'));var path=require(_0xd61e('0x5'));var sox=require(_0xd61e('0x6'));var csv=require('to-csv');var ejs=require(_0xd61e('0x7'));var fs=require('fs');var fs_extra=require(_0xd61e('0x8'));var _=require(_0xd61e('0x9'));var squel=require('squel');var crypto=require(_0xd61e('0xa'));var jsforce=require(_0xd61e('0xb'));var deskjs=require(_0xd61e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd61e('0xd'));var authService=require(_0xd61e('0xe'));var qs=require(_0xd61e('0xf'));var as=require(_0xd61e('0x10'));var hardwareService=require(_0xd61e('0x11'));var logger=require('../../config/logger')(_0xd61e('0x12'));var utils=require(_0xd61e('0x13'));var config=require(_0xd61e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x396a10,_0x4cac53){_0x4cac53=_0x4cac53||0xcc;return function(_0x4a2d7e){if(_0x4a2d7e){return _0x396a10[_0xd61e('0x15')](_0x4cac53);}return _0x396a10['status'](_0x4cac53)[_0xd61e('0x16')]();};}function respondWithResult(_0x196990,_0x417ee2){_0x417ee2=_0x417ee2||0xc8;return function(_0x380478){if(_0x380478){return _0x196990[_0xd61e('0x17')](_0x417ee2)['json'](_0x380478);}};}function respondWithFilteredResult(_0xe0fc4a,_0x5ecd03){return function(_0x7a5354){if(_0x7a5354){var _0x56ebd5=typeof _0x5ecd03[_0xd61e('0x18')]===_0xd61e('0x19')&&typeof _0x5ecd03[_0xd61e('0x1a')]===_0xd61e('0x19');var _0x30ab63=_0x7a5354[_0xd61e('0x1b')];var _0xf44dd5=_0x56ebd5?0x0:_0x5ecd03[_0xd61e('0x18')];var _0x47086e=_0x56ebd5?_0x7a5354[_0xd61e('0x1b')]:_0x5ecd03[_0xd61e('0x18')]+_0x5ecd03[_0xd61e('0x1a')];var _0x5d2a1a;if(_0x47086e>=_0x30ab63){_0x47086e=_0x30ab63;_0x5d2a1a=0xc8;}else{_0x5d2a1a=0xce;}_0xe0fc4a['status'](_0x5d2a1a);return _0xe0fc4a[_0xd61e('0x1c')](_0xd61e('0x1d'),_0xf44dd5+'-'+_0x47086e+'/'+_0x30ab63)[_0xd61e('0x1e')](_0x7a5354);}return null;};}function patchUpdates(_0x17bd06){return function(_0x2baf17){try{jsonpatch[_0xd61e('0x1f')](_0x2baf17,_0x17bd06,!![]);}catch(_0x2cd6f7){return BPromise[_0xd61e('0x20')](_0x2cd6f7);}return _0x2baf17[_0xd61e('0x21')]();};}function saveUpdates(_0x483ffd,_0x2841e4){return function(_0x4f1935){if(_0x4f1935){return _0x4f1935[_0xd61e('0x22')](_0x483ffd)['then'](function(_0x11c271){return _0x11c271;});}return null;};}function removeEntity(_0x42dda5,_0x313e62){return function(_0x1d0c60){if(_0x1d0c60){return _0x1d0c60[_0xd61e('0x23')]()[_0xd61e('0x24')](function(){_0x42dda5[_0xd61e('0x17')](0xcc)[_0xd61e('0x16')]();});}};}function handleEntityNotFound(_0x308739,_0x36bd67){return function(_0x2d6370){if(!_0x2d6370){_0x308739[_0xd61e('0x15')](0x194);}return _0x2d6370;};}function handleError(_0x3dab96,_0x3ce333){_0x3ce333=_0x3ce333||0x1f4;return function(_0x3dd2a4){logger[_0xd61e('0x25')](_0x3dd2a4[_0xd61e('0x26')]);if(_0x3dd2a4[_0xd61e('0x27')]){delete _0x3dd2a4[_0xd61e('0x27')];}_0x3dab96[_0xd61e('0x17')](_0x3ce333)['send'](_0x3dd2a4);};}exports[_0xd61e('0x28')]=function(_0x276c71,_0x1c2f77){var _0x447637={},_0x913838={},_0x1229cb={'count':0x0,'rows':[]};var _0x20f5a9=_[_0xd61e('0x29')](db[_0xd61e('0x2a')][_0xd61e('0x2b')],function(_0x1173c3){return{'name':_0x1173c3[_0xd61e('0x2c')],'type':_0x1173c3[_0xd61e('0x2d')]['key']};});_0x913838[_0xd61e('0x2e')]=_[_0xd61e('0x29')](_0x20f5a9,_0xd61e('0x27'));_0x913838[_0xd61e('0x2f')]=_[_0xd61e('0x30')](_0x276c71['query']);_0x913838[_0xd61e('0x31')]=_[_0xd61e('0x32')](_0x913838['model'],_0x913838[_0xd61e('0x2f')]);_0x447637['attributes']=_[_0xd61e('0x32')](_0x913838[_0xd61e('0x2e')],qs['fields'](_0x276c71[_0xd61e('0x2f')][_0xd61e('0x33')]));_0x447637[_0xd61e('0x34')]=_0x447637[_0xd61e('0x34')]['length']?_0x447637[_0xd61e('0x34')]:_0x913838[_0xd61e('0x2e')];if(!_0x276c71['query'][_0xd61e('0x35')](_0xd61e('0x36'))){_0x447637['limit']=qs[_0xd61e('0x1a')](_0x276c71[_0xd61e('0x2f')][_0xd61e('0x1a')]);_0x447637[_0xd61e('0x18')]=qs['offset'](_0x276c71['query'][_0xd61e('0x18')]);}_0x447637[_0xd61e('0x37')]=qs['sort'](_0x276c71[_0xd61e('0x2f')][_0xd61e('0x38')]);_0x447637[_0xd61e('0x39')]=qs['filters'](_[_0xd61e('0x3a')](_0x276c71['query'],_0x913838[_0xd61e('0x31')]),_0x20f5a9);if(_0x276c71[_0xd61e('0x2f')][_0xd61e('0x3b')]){_0x447637[_0xd61e('0x39')]=_[_0xd61e('0x3c')](_0x447637[_0xd61e('0x39')],{'$or':_['map'](_0x20f5a9,function(_0x2ad497){if(_0x2ad497[_0xd61e('0x2d')]!==_0xd61e('0x3d')){var _0x13cd77={};_0x13cd77[_0x2ad497[_0xd61e('0x27')]]={'$like':'%'+_0x276c71[_0xd61e('0x2f')][_0xd61e('0x3b')]+'%'};return _0x13cd77;}})});}_0x447637=_[_0xd61e('0x3c')]({},_0x447637,_0x276c71['options']);var _0x118f98={'where':_0x447637['where']};return db[_0xd61e('0x2a')]['count'](_0x118f98)[_0xd61e('0x24')](function(_0x21957a){_0x1229cb[_0xd61e('0x1b')]=_0x21957a;if(_0x276c71[_0xd61e('0x2f')][_0xd61e('0x3e')]){_0x447637[_0xd61e('0x3f')]=[{'all':!![]}];}return db['MailTransferReport'][_0xd61e('0x40')](_0x447637);})['then'](function(_0x343059){_0x1229cb[_0xd61e('0x41')]=_0x343059;return _0x1229cb;})[_0xd61e('0x24')](respondWithFilteredResult(_0x1c2f77,_0x447637))[_0xd61e('0x42')](handleError(_0x1c2f77,null));};exports['show']=function(_0x35cb45,_0x371bbb){var _0x38453b={'raw':!![],'where':{'id':_0x35cb45[_0xd61e('0x43')]['id']}},_0x58b66f={};_0x58b66f[_0xd61e('0x2e')]=_['keys'](db[_0xd61e('0x2a')][_0xd61e('0x2b')]);_0x58b66f[_0xd61e('0x2f')]=_['keys'](_0x35cb45[_0xd61e('0x2f')]);_0x58b66f[_0xd61e('0x31')]=_['intersection'](_0x58b66f['model'],_0x58b66f[_0xd61e('0x2f')]);_0x38453b[_0xd61e('0x34')]=_[_0xd61e('0x32')](_0x58b66f['model'],qs[_0xd61e('0x33')](_0x35cb45[_0xd61e('0x2f')]['fields']));_0x38453b[_0xd61e('0x34')]=_0x38453b['attributes'][_0xd61e('0x44')]?_0x38453b[_0xd61e('0x34')]:_0x58b66f[_0xd61e('0x2e')];if(_0x35cb45[_0xd61e('0x2f')]['includeAll']){_0x38453b[_0xd61e('0x3f')]=[{'all':!![]}];}_0x38453b=_['merge']({},_0x38453b,_0x35cb45[_0xd61e('0x45')]);return db['MailTransferReport'][_0xd61e('0x46')](_0x38453b)[_0xd61e('0x24')](handleEntityNotFound(_0x371bbb,null))['then'](respondWithResult(_0x371bbb,null))[_0xd61e('0x42')](handleError(_0x371bbb,null));};exports[_0xd61e('0x47')]=function(_0x4f4a42,_0x5f128f){return db[_0xd61e('0x2a')][_0xd61e('0x47')](_0x4f4a42[_0xd61e('0x48')],{})[_0xd61e('0x24')](respondWithResult(_0x5f128f,0xc9))['catch'](handleError(_0x5f128f,null));};exports[_0xd61e('0x22')]=function(_0x255c7a,_0x430c8d){if(_0x255c7a[_0xd61e('0x48')]['id']){delete _0x255c7a[_0xd61e('0x48')]['id'];}return db['MailTransferReport'][_0xd61e('0x46')]({'where':{'id':_0x255c7a[_0xd61e('0x43')]['id']}})[_0xd61e('0x24')](handleEntityNotFound(_0x430c8d,null))[_0xd61e('0x24')](saveUpdates(_0x255c7a[_0xd61e('0x48')],null))[_0xd61e('0x24')](respondWithResult(_0x430c8d,null))[_0xd61e('0x42')](handleError(_0x430c8d,null));};exports[_0xd61e('0x23')]=function(_0x1c9951,_0x2d7438){return db[_0xd61e('0x2a')][_0xd61e('0x46')]({'where':{'id':_0x1c9951[_0xd61e('0x43')]['id']}})[_0xd61e('0x24')](handleEntityNotFound(_0x2d7438,null))[_0xd61e('0x24')](removeEntity(_0x2d7438,null))[_0xd61e('0x42')](handleError(_0x2d7438,null));};exports['describe']=function(_0x20f399,_0x10e2e6){return db['MailTransferReport']['describe']()[_0xd61e('0x24')](respondWithResult(_0x10e2e6,null))[_0xd61e('0x42')](handleError(_0x10e2e6,null));};
\ No newline at end of file
+var _0x35ec=['jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','MailTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2c91c0,_0x38b7f3){var _0x18c3d7=function(_0xd60931){while(--_0xd60931){_0x2c91c0['push'](_0x2c91c0['shift']());}};_0x18c3d7(++_0x38b7f3);}(_0x35ec,0xc5));var _0xc35e=function(_0x7b2713,_0x38f494){_0x7b2713=_0x7b2713-0x0;var _0x28fb59=_0x35ec[_0x7b2713];return _0x28fb59;};'use strict';var emlformat=require(_0xc35e('0x0'));var rimraf=require(_0xc35e('0x1'));var zipdir=require(_0xc35e('0x2'));var jsonpatch=require(_0xc35e('0x3'));var rp=require(_0xc35e('0x4'));var moment=require(_0xc35e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc35e('0x6'));var util=require(_0xc35e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc35e('0x8'));var ejs=require(_0xc35e('0x9'));var fs=require('fs');var fs_extra=require(_0xc35e('0xa'));var _=require(_0xc35e('0xb'));var squel=require(_0xc35e('0xc'));var crypto=require('crypto');var jsforce=require(_0xc35e('0xd'));var deskjs=require(_0xc35e('0xe'));var toCsv=require(_0xc35e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc35e('0xf'));var authService=require(_0xc35e('0x10'));var qs=require(_0xc35e('0x11'));var as=require(_0xc35e('0x12'));var hardwareService=require(_0xc35e('0x13'));var logger=require('../../config/logger')(_0xc35e('0x14'));var utils=require(_0xc35e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc35e('0x16'))['db'];function respondWithStatusCode(_0x14c53a,_0x322735){_0x322735=_0x322735||0xcc;return function(_0x4d2658){if(_0x4d2658){return _0x14c53a[_0xc35e('0x17')](_0x322735);}return _0x14c53a[_0xc35e('0x18')](_0x322735)[_0xc35e('0x19')]();};}function respondWithResult(_0x342a81,_0x319e3f){_0x319e3f=_0x319e3f||0xc8;return function(_0x3994c3){if(_0x3994c3){return _0x342a81['status'](_0x319e3f)['json'](_0x3994c3);}};}function respondWithFilteredResult(_0xf47354,_0x3cd94b){return function(_0x4710b5){if(_0x4710b5){var _0x17ad72=typeof _0x3cd94b[_0xc35e('0x1a')]==='undefined'&&typeof _0x3cd94b[_0xc35e('0x1b')]===_0xc35e('0x1c');var _0x536b47=_0x4710b5['count'];var _0x3cd68d=_0x17ad72?0x0:_0x3cd94b[_0xc35e('0x1a')];var _0x4f160a=_0x17ad72?_0x4710b5[_0xc35e('0x1d')]:_0x3cd94b[_0xc35e('0x1a')]+_0x3cd94b[_0xc35e('0x1b')];var _0x2b690f;if(_0x4f160a>=_0x536b47){_0x4f160a=_0x536b47;_0x2b690f=0xc8;}else{_0x2b690f=0xce;}_0xf47354[_0xc35e('0x18')](_0x2b690f);return _0xf47354[_0xc35e('0x1e')](_0xc35e('0x1f'),_0x3cd68d+'-'+_0x4f160a+'/'+_0x536b47)['json'](_0x4710b5);}return null;};}function patchUpdates(_0x3b7969){return function(_0x5a5586){try{jsonpatch[_0xc35e('0x20')](_0x5a5586,_0x3b7969,!![]);}catch(_0x31f5eb){return BPromise[_0xc35e('0x21')](_0x31f5eb);}return _0x5a5586['save']();};}function saveUpdates(_0x3fdfc3,_0x19eb37){return function(_0x229a49){if(_0x229a49){return _0x229a49[_0xc35e('0x22')](_0x3fdfc3)[_0xc35e('0x23')](function(_0x163469){return _0x163469;});}return null;};}function removeEntity(_0xfbd409,_0x25d3e0){return function(_0xdaf419){if(_0xdaf419){return _0xdaf419[_0xc35e('0x24')]()[_0xc35e('0x23')](function(){_0xfbd409['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa58a5,_0x4168e3){return function(_0x4d3f10){if(!_0x4d3f10){_0xaa58a5[_0xc35e('0x17')](0x194);}return _0x4d3f10;};}function handleError(_0x5b47e6,_0x1f1a02){_0x1f1a02=_0x1f1a02||0x1f4;return function(_0x13eca8){logger['error'](_0x13eca8['stack']);if(_0x13eca8[_0xc35e('0x25')]){delete _0x13eca8[_0xc35e('0x25')];}_0x5b47e6['status'](_0x1f1a02)[_0xc35e('0x26')](_0x13eca8);};}exports[_0xc35e('0x27')]=function(_0x10e215,_0x16efde){var _0x3301b7={},_0x228b4c={},_0x4a8e49={'count':0x0,'rows':[]};var _0x1cc7d3=_[_0xc35e('0x28')](db[_0xc35e('0x29')][_0xc35e('0x2a')],function(_0x1edca0){return{'name':_0x1edca0[_0xc35e('0x2b')],'type':_0x1edca0['type']['key']};});_0x228b4c[_0xc35e('0x2c')]=_[_0xc35e('0x28')](_0x1cc7d3,_0xc35e('0x25'));_0x228b4c[_0xc35e('0x2d')]=_[_0xc35e('0x2e')](_0x10e215[_0xc35e('0x2d')]);_0x228b4c[_0xc35e('0x2f')]=_[_0xc35e('0x30')](_0x228b4c[_0xc35e('0x2c')],_0x228b4c[_0xc35e('0x2d')]);_0x3301b7['attributes']=_[_0xc35e('0x30')](_0x228b4c[_0xc35e('0x2c')],qs[_0xc35e('0x31')](_0x10e215[_0xc35e('0x2d')][_0xc35e('0x31')]));_0x3301b7['attributes']=_0x3301b7['attributes'][_0xc35e('0x32')]?_0x3301b7[_0xc35e('0x33')]:_0x228b4c[_0xc35e('0x2c')];if(!_0x10e215['query'][_0xc35e('0x34')](_0xc35e('0x35'))){_0x3301b7[_0xc35e('0x1b')]=qs[_0xc35e('0x1b')](_0x10e215['query'][_0xc35e('0x1b')]);_0x3301b7[_0xc35e('0x1a')]=qs[_0xc35e('0x1a')](_0x10e215[_0xc35e('0x2d')][_0xc35e('0x1a')]);}_0x3301b7[_0xc35e('0x36')]=qs[_0xc35e('0x37')](_0x10e215[_0xc35e('0x2d')][_0xc35e('0x37')]);_0x3301b7[_0xc35e('0x38')]=qs['filters'](_['pick'](_0x10e215[_0xc35e('0x2d')],_0x228b4c[_0xc35e('0x2f')]),_0x1cc7d3);if(_0x10e215[_0xc35e('0x2d')]['filter']){_0x3301b7[_0xc35e('0x38')]=_[_0xc35e('0x39')](_0x3301b7[_0xc35e('0x38')],{'$or':_['map'](_0x1cc7d3,function(_0x4174aa){if(_0x4174aa['type']!==_0xc35e('0x3a')){var _0x398bce={};_0x398bce[_0x4174aa[_0xc35e('0x25')]]={'$like':'%'+_0x10e215['query'][_0xc35e('0x3b')]+'%'};return _0x398bce;}})});}_0x3301b7=_[_0xc35e('0x39')]({},_0x3301b7,_0x10e215[_0xc35e('0x3c')]);var _0x5e8195={'where':_0x3301b7[_0xc35e('0x38')]};return db[_0xc35e('0x29')][_0xc35e('0x1d')](_0x5e8195)[_0xc35e('0x23')](function(_0x49d57b){_0x4a8e49['count']=_0x49d57b;if(_0x10e215[_0xc35e('0x2d')][_0xc35e('0x3d')]){_0x3301b7[_0xc35e('0x3e')]=[{'all':!![]}];}return db[_0xc35e('0x29')]['findAll'](_0x3301b7);})[_0xc35e('0x23')](function(_0x59b68d){_0x4a8e49[_0xc35e('0x3f')]=_0x59b68d;return _0x4a8e49;})[_0xc35e('0x23')](respondWithFilteredResult(_0x16efde,_0x3301b7))[_0xc35e('0x40')](handleError(_0x16efde,null));};exports[_0xc35e('0x41')]=function(_0x1c85e8,_0x18e8a6){var _0x4a911d={'raw':!![],'where':{'id':_0x1c85e8['params']['id']}},_0x4734c0={};_0x4734c0[_0xc35e('0x2c')]=_[_0xc35e('0x2e')](db['MailTransferReport'][_0xc35e('0x2a')]);_0x4734c0['query']=_[_0xc35e('0x2e')](_0x1c85e8['query']);_0x4734c0['filters']=_[_0xc35e('0x30')](_0x4734c0[_0xc35e('0x2c')],_0x4734c0[_0xc35e('0x2d')]);_0x4a911d[_0xc35e('0x33')]=_['intersection'](_0x4734c0[_0xc35e('0x2c')],qs['fields'](_0x1c85e8[_0xc35e('0x2d')]['fields']));_0x4a911d[_0xc35e('0x33')]=_0x4a911d['attributes'][_0xc35e('0x32')]?_0x4a911d['attributes']:_0x4734c0['model'];if(_0x1c85e8[_0xc35e('0x2d')][_0xc35e('0x3d')]){_0x4a911d['include']=[{'all':!![]}];}_0x4a911d=_[_0xc35e('0x39')]({},_0x4a911d,_0x1c85e8['options']);return db[_0xc35e('0x29')][_0xc35e('0x42')](_0x4a911d)[_0xc35e('0x23')](handleEntityNotFound(_0x18e8a6,null))[_0xc35e('0x23')](respondWithResult(_0x18e8a6,null))[_0xc35e('0x40')](handleError(_0x18e8a6,null));};exports[_0xc35e('0x43')]=function(_0x3f455f,_0x47081c){return db[_0xc35e('0x29')][_0xc35e('0x43')](_0x3f455f[_0xc35e('0x44')],{})[_0xc35e('0x23')](respondWithResult(_0x47081c,0xc9))[_0xc35e('0x40')](handleError(_0x47081c,null));};exports['update']=function(_0x2d60d8,_0x788be3){if(_0x2d60d8['body']['id']){delete _0x2d60d8[_0xc35e('0x44')]['id'];}return db[_0xc35e('0x29')][_0xc35e('0x42')]({'where':{'id':_0x2d60d8[_0xc35e('0x45')]['id']}})['then'](handleEntityNotFound(_0x788be3,null))['then'](saveUpdates(_0x2d60d8[_0xc35e('0x44')],null))[_0xc35e('0x23')](respondWithResult(_0x788be3,null))[_0xc35e('0x40')](handleError(_0x788be3,null));};exports[_0xc35e('0x24')]=function(_0x685241,_0x5a0029){return db[_0xc35e('0x29')][_0xc35e('0x42')]({'where':{'id':_0x685241[_0xc35e('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a0029,null))[_0xc35e('0x23')](removeEntity(_0x5a0029,null))[_0xc35e('0x40')](handleError(_0x5a0029,null));};exports['describe']=function(_0x3ea909,_0x56a444){return db[_0xc35e('0x29')]['describe']()[_0xc35e('0x23')](respondWithResult(_0x56a444,null))[_0xc35e('0x40')](handleError(_0x56a444,null));};
\ No newline at end of file
index 2f66ddc..6551ba4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbac8=['uniqueid','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','define','MailTransferReport','report_mail_transfer'];(function(_0x2b9e3c,_0x385f13){var _0x481485=function(_0x93a510){while(--_0x93a510){_0x2b9e3c['push'](_0x2b9e3c['shift']());}};_0x481485(++_0x385f13);}(_0xbac8,0x140));var _0x8bac=function(_0xc67e91,_0x959872){_0xc67e91=_0xc67e91-0x0;var _0x2cf532=_0xbac8[_0xc67e91];return _0x2cf532;};'use strict';var _=require(_0x8bac('0x0'));var util=require(_0x8bac('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8bac('0x2'));var BPromise=require(_0x8bac('0x3'));var rp=require(_0x8bac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bac('0x5'));var config=require(_0x8bac('0x6'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x28b1d1,_0x36f5b4){return _0x28b1d1[_0x8bac('0x7')](_0x8bac('0x8'),attributes,{'tableName':_0x8bac('0x9'),'paranoid':![],'indexes':[{'name':_0x8bac('0xa'),'fields':[_0x8bac('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a06=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x107132,_0x13f848){var _0xeb25b1=function(_0xfe9356){while(--_0xfe9356){_0x107132['push'](_0x107132['shift']());}};_0xeb25b1(++_0x13f848);}(_0x4a06,0x1f2));var _0x64a0=function(_0xc18197,_0x372a47){_0xc18197=_0xc18197-0x0;var _0x5d1917=_0x4a06[_0xc18197];return _0x5d1917;};'use strict';var _=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var logger=require(_0x64a0('0x2'))(_0x64a0('0x3'));var moment=require(_0x64a0('0x4'));var BPromise=require(_0x64a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64a0('0x6'));var rimraf=require(_0x64a0('0x7'));var config=require(_0x64a0('0x8'));var attributes=require(_0x64a0('0x9'));module[_0x64a0('0xa')]=function(_0xba1d8f,_0x37464e){return _0xba1d8f[_0x64a0('0xb')](_0x64a0('0xc'),attributes,{'tableName':_0x64a0('0xd'),'paranoid':![],'indexes':[{'name':_0x64a0('0xe'),'fields':[_0x64a0('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 0177f93..d703d2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e4b=['../../config/environment','jayson/promise','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x45b28e,_0x4e2853){var _0x3d131=function(_0x3d8c83){while(--_0x3d8c83){_0x45b28e['push'](_0x45b28e['shift']());}};_0x3d131(++_0x4e2853);}(_0x0e4b,0x91));var _0xb0e4=function(_0x4dd2ac,_0x5ad179){_0x4dd2ac=_0x4dd2ac-0x0;var _0x2526e9=_0x0e4b[_0x4dd2ac];return _0x2526e9;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var moment=require(_0xb0e4('0x2'));var BPromise=require(_0xb0e4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0e4('0x4'));var db=require(_0xb0e4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb0e4('0x6'));var config=require(_0xb0e4('0x7'));var jayson=require(_0xb0e4('0x8'));var client=jayson['client'][_0xb0e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x562b47,_0x27dda3,_0x3b0100){return new BPromise(function(_0x1d2e4a,_0x5aad71){return client[_0xb0e4('0xa')](_0x562b47,_0x3b0100)[_0xb0e4('0xb')](function(_0x311878){logger[_0xb0e4('0xc')](_0xb0e4('0xd'),_0x27dda3,_0xb0e4('0xe'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x27dda3,_0xb0e4('0xe'),JSON['stringify'](_0x311878));if(_0x311878['error']){if(_0x311878[_0xb0e4('0xf')][_0xb0e4('0x10')]===0x1f4){logger['error'](_0xb0e4('0xd'),_0x27dda3,_0x311878[_0xb0e4('0xf')][_0xb0e4('0x11')]);return _0x5aad71(_0x311878[_0xb0e4('0xf')][_0xb0e4('0x11')]);}logger[_0xb0e4('0xf')](_0xb0e4('0xd'),_0x27dda3,_0x311878['error'][_0xb0e4('0x11')]);return _0x1d2e4a(_0x311878[_0xb0e4('0xf')]['message']);}else{logger['info'](_0xb0e4('0xd'),_0x27dda3,_0xb0e4('0xe'));_0x1d2e4a(_0x311878['result'][_0xb0e4('0x11')]);}})[_0xb0e4('0x12')](function(_0x551591){logger[_0xb0e4('0xf')](_0xb0e4('0xd'),_0x27dda3,_0x551591);_0x5aad71(_0x551591);});});}
\ No newline at end of file
+var _0x54cc=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0xf6ad60,_0x27e422){var _0x430850=function(_0x2cc438){while(--_0x2cc438){_0xf6ad60['push'](_0xf6ad60['shift']());}};_0x430850(++_0x27e422);}(_0x54cc,0xa0));var _0xc54c=function(_0x31e321,_0x5c15f0){_0x31e321=_0x31e321-0x0;var _0x1e3d47=_0x54cc[_0x31e321];return _0x1e3d47;};'use strict';var _=require(_0xc54c('0x0'));var util=require('util');var moment=require(_0xc54c('0x1'));var BPromise=require(_0xc54c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc54c('0x3'));var db=require(_0xc54c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc54c('0x5'))(_0xc54c('0x6'));var config=require(_0xc54c('0x7'));var jayson=require(_0xc54c('0x8'));var client=jayson[_0xc54c('0x9')][_0xc54c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6dca6c,_0x1b06d8,_0x370893){return new BPromise(function(_0x2b3e0e,_0x108651){return client['request'](_0x6dca6c,_0x370893)[_0xc54c('0xb')](function(_0x1f9a3d){logger[_0xc54c('0xc')](_0xc54c('0xd'),_0x1b06d8,_0xc54c('0xe'));logger[_0xc54c('0xf')](_0xc54c('0x10'),_0x1b06d8,_0xc54c('0xe'),JSON[_0xc54c('0x11')](_0x1f9a3d));if(_0x1f9a3d[_0xc54c('0x12')]){if(_0x1f9a3d[_0xc54c('0x12')][_0xc54c('0x13')]===0x1f4){logger['error'](_0xc54c('0xd'),_0x1b06d8,_0x1f9a3d['error'][_0xc54c('0x14')]);return _0x108651(_0x1f9a3d['error'][_0xc54c('0x14')]);}logger[_0xc54c('0x12')](_0xc54c('0xd'),_0x1b06d8,_0x1f9a3d[_0xc54c('0x12')][_0xc54c('0x14')]);return _0x2b3e0e(_0x1f9a3d[_0xc54c('0x12')]['message']);}else{logger[_0xc54c('0xc')](_0xc54c('0xd'),_0x1b06d8,_0xc54c('0xe'));_0x2b3e0e(_0x1f9a3d[_0xc54c('0x15')][_0xc54c('0x14')]);}})[_0xc54c('0x16')](function(_0x8e4f10){logger['error'](_0xc54c('0xd'),_0x1b06d8,_0x8e4f10);_0x108651(_0x8e4f10);});});}
\ No newline at end of file
index 182c20e..8b68ced 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe819=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x403deb,_0x2416a8){var _0x437d55=function(_0x41f254){while(--_0x41f254){_0x403deb['push'](_0x403deb['shift']());}};_0x437d55(++_0x2416a8);}(_0xe819,0x128));var _0x9e81=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe819[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x9e81('0x0'));var util=require(_0x9e81('0x1'));var path=require(_0x9e81('0x2'));var timeout=require(_0x9e81('0x3'));var express=require(_0x9e81('0x4'));var router=express['Router']();var fs_extra=require(_0x9e81('0x5'));var auth=require(_0x9e81('0x6'));var interaction=require(_0x9e81('0x7'));var config=require('../../config/environment');var controller=require(_0x9e81('0x8'));router['get']('/',auth[_0x9e81('0x9')](),controller[_0x9e81('0xa')]);router['get'](_0x9e81('0xb'),auth[_0x9e81('0x9')](),controller[_0x9e81('0xc')]);router['get'](_0x9e81('0xd'),auth[_0x9e81('0x9')](),controller[_0x9e81('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9e81('0xf')]);router[_0x9e81('0x10')]('/:id',auth[_0x9e81('0x9')](),controller[_0x9e81('0x11')]);router[_0x9e81('0x12')](_0x9e81('0xd'),auth[_0x9e81('0x9')](),controller['destroy']);module[_0x9e81('0x13')]=router;
\ No newline at end of file
+var _0x7e68=['put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7e68,0x11c));var _0x87e6=function(_0x1adaac,_0x1fb30b){_0x1adaac=_0x1adaac-0x0;var _0x423bad=_0x7e68[_0x1adaac];return _0x423bad;};'use strict';var multer=require(_0x87e6('0x0'));var util=require(_0x87e6('0x1'));var path=require(_0x87e6('0x2'));var timeout=require(_0x87e6('0x3'));var express=require('express');var router=express[_0x87e6('0x4')]();var fs_extra=require(_0x87e6('0x5'));var auth=require(_0x87e6('0x6'));var interaction=require(_0x87e6('0x7'));var config=require('../../config/environment');var controller=require(_0x87e6('0x8'));router[_0x87e6('0x9')]('/',auth[_0x87e6('0xa')](),controller['index']);router[_0x87e6('0x9')](_0x87e6('0xb'),auth[_0x87e6('0xa')](),controller[_0x87e6('0xc')]);router[_0x87e6('0x9')](_0x87e6('0xd'),auth[_0x87e6('0xa')](),controller[_0x87e6('0xe')]);router[_0x87e6('0xf')]('/',auth[_0x87e6('0xa')](),controller['create']);router[_0x87e6('0x10')](_0x87e6('0xd'),auth['isAuthenticated'](),controller[_0x87e6('0x11')]);router[_0x87e6('0x12')](_0x87e6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x87e6('0x13')]=router;
\ No newline at end of file
index a624fcf..3b628bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacfe=['DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','exports','STRING'];(function(_0xd8fdf,_0x41a20c){var _0x2e139a=function(_0x42508d){while(--_0x42508d){_0xd8fdf['push'](_0xd8fdf['shift']());}};_0x2e139a(++_0x41a20c);}(_0xacfe,0xfd));var _0xeacf=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xacfe[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xeacf('0x0')]={'channel':{'type':Sequelize[_0xeacf('0x1')]},'membername':{'type':Sequelize[_0xeacf('0x1')]},'interface':{'type':Sequelize[_0xeacf('0x1')]},'type':{'type':Sequelize[_0xeacf('0x1')],'defaultValue':_0xeacf('0x2'),'comment':_0xeacf('0x3')},'duration':{'type':Sequelize[_0xeacf('0x4')]},'enterAt':{'type':Sequelize[_0xeacf('0x5')]},'exitAt':{'type':Sequelize[_0xeacf('0x5')],'set':function(_0x369ad7){var _0x229f28=moment(_0x369ad7);var _0x13cba2=moment(this['getDataValue'](_0xeacf('0x6')));var _0xce0437=_0x229f28[_0xeacf('0x7')](_0x13cba2,_0xeacf('0x8'));this['setDataValue'](_0xeacf('0x9'),_0x369ad7);this['setDataValue'](_0xeacf('0xa'),_0xce0437||null);}},'data1':{'type':Sequelize[_0xeacf('0x1')],'comment':_0xeacf('0xb')},'data2':{'type':Sequelize[_0xeacf('0x1')],'comment':_0xeacf('0xc')},'data3':{'type':Sequelize[_0xeacf('0x1')],'comment':_0xeacf('0xd')},'data4':{'type':Sequelize[_0xeacf('0x1')],'comment':_0xeacf('0xe')},'data5':{'type':Sequelize[_0xeacf('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xeacf('0x1')]},'internal':{'type':Sequelize[_0xeacf('0x4')]},'uniqueid':{'type':Sequelize[_0xeacf('0x1')]}};
\ No newline at end of file
+var _0x0fec=['diff','seconds','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE'];(function(_0x8be777,_0x2f69f7){var _0x5f470a=function(_0x264a8b){while(--_0x264a8b){_0x8be777['push'](_0x8be777['shift']());}};_0x5f470a(++_0x2f69f7);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x11896b,_0xd83c89){_0x11896b=_0x11896b-0x0;var _0xd5a624=_0x0fec[_0x11896b];return _0xd5a624;};'use strict';var Sequelize=require(_0xc0fe('0x0'));var moment=require(_0xc0fe('0x1'));module[_0xc0fe('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc0fe('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xc0fe('0x4'),'comment':_0xc0fe('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xc0fe('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3fce36){var _0x1073f0=moment(_0x3fce36);var _0x4cc359=moment(this['getDataValue']('enterAt'));var _0x326ab7=_0x1073f0[_0xc0fe('0x7')](_0x4cc359,_0xc0fe('0x8'));this['setDataValue']('exitAt',_0x3fce36);this['setDataValue'](_0xc0fe('0x9'),_0x326ab7||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xc0fe('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0xc0fe('0xb')},'data3':{'type':Sequelize[_0xc0fe('0x3')],'comment':_0xc0fe('0xc')},'data4':{'type':Sequelize[_0xc0fe('0x3')],'comment':_0xc0fe('0xd')},'data5':{'type':Sequelize[_0xc0fe('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xc0fe('0x3')]},'internal':{'type':Sequelize[_0xc0fe('0xe')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index bce5adf..0342f18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x2c4625,_0x17287c){var _0x2e421f=function(_0x3dca03){while(--_0x3dca03){_0x2c4625['push'](_0x2c4625['shift']());}};_0x2e421f(++_0x17287c);}(_0x008c,0x188));var _0xc008=function(_0x22e690,_0x5f570e){_0x22e690=_0x22e690-0x0;var _0x2b515f=_0x008c[_0x22e690];return _0x2b515f;};'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(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));};
\ No newline at end of file
+var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x4990f2,_0x592c9d){var _0x13aeec=function(_0x597de6){while(--_0x597de6){_0x4990f2['push'](_0x4990f2['shift']());}};_0x13aeec(++_0x592c9d);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));};
\ No newline at end of file
index ca752cd..339169d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabb7=['rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5edd83,_0x55b699){var _0x5d062f=function(_0x484fc5){while(--_0x484fc5){_0x5edd83['push'](_0x5edd83['shift']());}};_0x5d062f(++_0x55b699);}(_0xabb7,0x190));var _0x7abb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xabb7[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7abb('0x0'))(_0x7abb('0x1'));var moment=require('moment');var BPromise=require(_0x7abb('0x2'));var rp=require(_0x7abb('0x3'));var fs=require('fs');var path=require(_0x7abb('0x4'));var rimraf=require(_0x7abb('0x5'));var config=require(_0x7abb('0x6'));var attributes=require(_0x7abb('0x7'));module[_0x7abb('0x8')]=function(_0x5bb08c,_0x4974f8){return _0x5bb08c[_0x7abb('0x9')](_0x7abb('0xa'),attributes,{'tableName':_0x7abb('0xb'),'paranoid':![],'indexes':[{'name':_0x7abb('0xc'),'fields':[_0x7abb('0xd'),_0x7abb('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b20=['./memberReport.attributes','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5b20,0x86));var _0x05b2=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5b20[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var logger=require(_0x05b2('0x2'))(_0x05b2('0x3'));var moment=require(_0x05b2('0x4'));var BPromise=require(_0x05b2('0x5'));var rp=require(_0x05b2('0x6'));var fs=require('fs');var path=require(_0x05b2('0x7'));var rimraf=require(_0x05b2('0x8'));var config=require(_0x05b2('0x9'));var attributes=require(_0x05b2('0xa'));module['exports']=function(_0x22e0e2,_0x83fd18){return _0x22e0e2['define'](_0x05b2('0xb'),attributes,{'tableName':_0x05b2('0xc'),'paranoid':![],'indexes':[{'name':_0x05b2('0xd'),'fields':[_0x05b2('0xe'),_0x05b2('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index f883724..21722a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d4d=['map','model','attributes','GetMemberReport','catch','CreateMemberReport','body','raw','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','MemberReport','options','where','limit','include'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x0d4d,0x132));var _0xd0d4=function(_0x759edd,_0x52edaf){_0x759edd=_0x759edd-0x0;var _0x26bb72=_0x0d4d[_0x759edd];return _0x26bb72;};'use strict';var _=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var moment=require(_0xd0d4('0x2'));var BPromise=require(_0xd0d4('0x3'));var rs=require(_0xd0d4('0x4'));var fs=require('fs');var Redis=require(_0xd0d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0d4('0x6'));var logger=require('../../config/logger')(_0xd0d4('0x7'));var config=require(_0xd0d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd0d4('0x9')][_0xd0d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c5d01,_0x5c8c7b,_0x5bfae8){return new BPromise(function(_0x5403c0,_0x3fdd50){return client['request'](_0x1c5d01,_0x5bfae8)[_0xd0d4('0xb')](function(_0x314cd5){logger[_0xd0d4('0xc')]('MemberReport,\x20%s,\x20%s',_0x5c8c7b,_0xd0d4('0xd'));logger[_0xd0d4('0xe')](_0xd0d4('0xf'),_0x5c8c7b,_0xd0d4('0xd'),JSON[_0xd0d4('0x10')](_0x314cd5));if(_0x314cd5[_0xd0d4('0x11')]){if(_0x314cd5['error'][_0xd0d4('0x12')]===0x1f4){logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x314cd5[_0xd0d4('0x11')][_0xd0d4('0x14')]);return _0x3fdd50(_0x314cd5[_0xd0d4('0x11')]['message']);}logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x314cd5[_0xd0d4('0x11')]['message']);return _0x5403c0(_0x314cd5['error'][_0xd0d4('0x14')]);}else{logger[_0xd0d4('0xc')]('MemberReport,\x20%s,\x20%s',_0x5c8c7b,_0xd0d4('0xd'));_0x5403c0(_0x314cd5[_0xd0d4('0x15')]['message']);}})['catch'](function(_0x1b64f){logger[_0xd0d4('0x11')](_0xd0d4('0x13'),_0x5c8c7b,_0x1b64f);_0x3fdd50(_0x1b64f);});});}exports['GetMemberReport']=function(_0x5cf4c6){var _0x5eb5e4=this;return new Promise(function(_0x407cda,_0x1e46db){return db[_0xd0d4('0x16')]['findAll']({'raw':_0x5cf4c6['options']?_0x5cf4c6[_0xd0d4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5cf4c6[_0xd0d4('0x17')]?_0x5cf4c6[_0xd0d4('0x17')][_0xd0d4('0x18')]||null:null,'attributes':_0x5cf4c6['options']?_0x5cf4c6[_0xd0d4('0x17')]['attributes']||null:null,'limit':_0x5cf4c6['options']?_0x5cf4c6[_0xd0d4('0x17')][_0xd0d4('0x19')]||null:null,'include':_0x5cf4c6['options']?_0x5cf4c6['options'][_0xd0d4('0x1a')]?_[_0xd0d4('0x1b')](_0x5cf4c6[_0xd0d4('0x17')][_0xd0d4('0x1a')],function(_0x1d8033){return{'model':db[_0x1d8033[_0xd0d4('0x1c')]],'as':_0x1d8033['as'],'attributes':_0x1d8033['attributes'],'include':_0x1d8033[_0xd0d4('0x1a')]?_['map'](_0x1d8033[_0xd0d4('0x1a')],function(_0x1b03ef){return{'model':db[_0x1b03ef[_0xd0d4('0x1c')]],'as':_0x1b03ef['as'],'attributes':_0x1b03ef['attributes'],'include':_0x1b03ef['include']?_[_0xd0d4('0x1b')](_0x1b03ef['include'],function(_0x50e7f0){return{'model':db[_0x50e7f0[_0xd0d4('0x1c')]],'as':_0x50e7f0['as'],'attributes':_0x50e7f0[_0xd0d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd0d4('0xb')](function(_0x320efe){logger['info'](_0xd0d4('0x1e'),_0x5cf4c6);logger[_0xd0d4('0xe')](_0xd0d4('0x1e'),_0x5cf4c6,JSON[_0xd0d4('0x10')](_0x320efe));_0x407cda(_0x320efe);})[_0xd0d4('0x1f')](function(_0xefce4f){logger[_0xd0d4('0x11')](_0xd0d4('0x1e'),_0xefce4f[_0xd0d4('0x14')],_0x5cf4c6);_0x1e46db(_0x5eb5e4['error'](0x1f4,_0xefce4f[_0xd0d4('0x14')]));});});};exports[_0xd0d4('0x20')]=function(_0x192f43){var _0x18096a=this;return new Promise(function(_0x2ea5d9,_0x198991){return db['MemberReport']['create'](_0x192f43[_0xd0d4('0x21')],{'raw':_0x192f43['options']?_0x192f43[_0xd0d4('0x17')][_0xd0d4('0x22')]===undefined?!![]:![]:!![]})[_0xd0d4('0xb')](function(_0x446763){logger[_0xd0d4('0xc')](_0xd0d4('0x20'),_0x192f43);logger[_0xd0d4('0xe')]('CreateMemberReport',_0x192f43,JSON['stringify'](_0x446763));_0x2ea5d9(_0x446763);})[_0xd0d4('0x1f')](function(_0x161d17){logger['error'](_0xd0d4('0x20'),_0x161d17['message'],_0x192f43);_0x198991(_0x18096a['error'](0x1f4,_0x161d17[_0xd0d4('0x14')]));});});};exports[_0xd0d4('0x23')]=function(_0x3fd1b1){var _0x26a080=this;return new Promise(function(_0x5011dd,_0x47e4c5){return db[_0xd0d4('0x16')][_0xd0d4('0x24')](_0x3fd1b1[_0xd0d4('0x21')],{'raw':_0x3fd1b1['options']?_0x3fd1b1[_0xd0d4('0x17')][_0xd0d4('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fd1b1[_0xd0d4('0x17')]?_0x3fd1b1[_0xd0d4('0x17')][_0xd0d4('0x18')]||null:null,'attributes':_0x3fd1b1[_0xd0d4('0x17')]?_0x3fd1b1[_0xd0d4('0x17')][_0xd0d4('0x1d')]||null:null,'limit':_0x3fd1b1['options']?_0x3fd1b1[_0xd0d4('0x17')]['limit']||null:null})['then'](function(_0x29434a){logger['info'](_0xd0d4('0x23'),_0x3fd1b1);logger[_0xd0d4('0xe')](_0xd0d4('0x23'),_0x3fd1b1,JSON[_0xd0d4('0x10')](_0x29434a));_0x5011dd(_0x29434a);})[_0xd0d4('0x1f')](function(_0x3b24c8){logger['error'](_0xd0d4('0x23'),_0x3b24c8[_0xd0d4('0x14')],_0x3fd1b1);_0x47e4c5(_0x26a080['error'](0x1f4,_0x3b24c8['message']));});});};
\ No newline at end of file
+var _0x374c=['request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MemberReport,\x20%s,\x20%s','result','catch','GetMemberReport','findAll','options','where','attributes','limit','include','map','model','then','debug','create','raw','CreateMemberReport','UpdateMemberReport','MemberReport','update','body','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x374c,0x1e3));var _0xc374=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x374c[_0x4ea69d];return _0x5318e0;};'use strict';var _=require('lodash');var util=require(_0xc374('0x0'));var moment=require(_0xc374('0x1'));var BPromise=require(_0xc374('0x2'));var rs=require(_0xc374('0x3'));var fs=require('fs');var Redis=require(_0xc374('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc374('0x5'));var logger=require('../../config/logger')(_0xc374('0x6'));var config=require(_0xc374('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc374('0x8')][_0xc374('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x264e9a,_0x229105,_0x43cae8){return new BPromise(function(_0x4fc640,_0x33acc1){return client['request'](_0x264e9a,_0x43cae8)['then'](function(_0x1c85eb){logger[_0xc374('0xa')]('MemberReport,\x20%s,\x20%s',_0x229105,_0xc374('0xb'));logger['debug'](_0xc374('0xc'),_0x229105,_0xc374('0xb'),JSON[_0xc374('0xd')](_0x1c85eb));if(_0x1c85eb['error']){if(_0x1c85eb[_0xc374('0xe')][_0xc374('0xf')]===0x1f4){logger[_0xc374('0xe')]('MemberReport,\x20%s,\x20%s',_0x229105,_0x1c85eb[_0xc374('0xe')][_0xc374('0x10')]);return _0x33acc1(_0x1c85eb[_0xc374('0xe')]['message']);}logger[_0xc374('0xe')]('MemberReport,\x20%s,\x20%s',_0x229105,_0x1c85eb[_0xc374('0xe')][_0xc374('0x10')]);return _0x4fc640(_0x1c85eb['error'][_0xc374('0x10')]);}else{logger[_0xc374('0xa')](_0xc374('0x11'),_0x229105,_0xc374('0xb'));_0x4fc640(_0x1c85eb[_0xc374('0x12')][_0xc374('0x10')]);}})[_0xc374('0x13')](function(_0x116d76){logger[_0xc374('0xe')](_0xc374('0x11'),_0x229105,_0x116d76);_0x33acc1(_0x116d76);});});}exports[_0xc374('0x14')]=function(_0x5957c5){var _0x57c828=this;return new Promise(function(_0x3553bb,_0x2feee7){return db['MemberReport'][_0xc374('0x15')]({'raw':_0x5957c5[_0xc374('0x16')]?_0x5957c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5957c5[_0xc374('0x16')]?_0x5957c5[_0xc374('0x16')][_0xc374('0x17')]||null:null,'attributes':_0x5957c5[_0xc374('0x16')]?_0x5957c5['options'][_0xc374('0x18')]||null:null,'limit':_0x5957c5[_0xc374('0x16')]?_0x5957c5[_0xc374('0x16')][_0xc374('0x19')]||null:null,'include':_0x5957c5[_0xc374('0x16')]?_0x5957c5[_0xc374('0x16')][_0xc374('0x1a')]?_[_0xc374('0x1b')](_0x5957c5[_0xc374('0x16')][_0xc374('0x1a')],function(_0x4110a5){return{'model':db[_0x4110a5['model']],'as':_0x4110a5['as'],'attributes':_0x4110a5[_0xc374('0x18')],'include':_0x4110a5[_0xc374('0x1a')]?_[_0xc374('0x1b')](_0x4110a5['include'],function(_0x460fe1){return{'model':db[_0x460fe1[_0xc374('0x1c')]],'as':_0x460fe1['as'],'attributes':_0x460fe1[_0xc374('0x18')],'include':_0x460fe1[_0xc374('0x1a')]?_['map'](_0x460fe1['include'],function(_0x4ad849){return{'model':db[_0x4ad849[_0xc374('0x1c')]],'as':_0x4ad849['as'],'attributes':_0x4ad849[_0xc374('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc374('0x1d')](function(_0x5530a3){logger[_0xc374('0xa')]('GetMemberReport',_0x5957c5);logger[_0xc374('0x1e')](_0xc374('0x14'),_0x5957c5,JSON[_0xc374('0xd')](_0x5530a3));_0x3553bb(_0x5530a3);})[_0xc374('0x13')](function(_0x2a87f2){logger[_0xc374('0xe')](_0xc374('0x14'),_0x2a87f2[_0xc374('0x10')],_0x5957c5);_0x2feee7(_0x57c828['error'](0x1f4,_0x2a87f2[_0xc374('0x10')]));});});};exports['CreateMemberReport']=function(_0x10736e){var _0x27abe6=this;return new Promise(function(_0x33327a,_0x1dcdaa){return db['MemberReport'][_0xc374('0x1f')](_0x10736e['body'],{'raw':_0x10736e[_0xc374('0x16')]?_0x10736e[_0xc374('0x16')][_0xc374('0x20')]===undefined?!![]:![]:!![]})[_0xc374('0x1d')](function(_0x14e8e9){logger[_0xc374('0xa')](_0xc374('0x21'),_0x10736e);logger[_0xc374('0x1e')](_0xc374('0x21'),_0x10736e,JSON[_0xc374('0xd')](_0x14e8e9));_0x33327a(_0x14e8e9);})[_0xc374('0x13')](function(_0x2076ec){logger['error'](_0xc374('0x21'),_0x2076ec['message'],_0x10736e);_0x1dcdaa(_0x27abe6[_0xc374('0xe')](0x1f4,_0x2076ec[_0xc374('0x10')]));});});};exports[_0xc374('0x22')]=function(_0x531295){var _0xefa3bf=this;return new Promise(function(_0x1d44a9,_0x5d5da7){return db[_0xc374('0x23')][_0xc374('0x24')](_0x531295[_0xc374('0x25')],{'raw':_0x531295[_0xc374('0x16')]?_0x531295[_0xc374('0x16')][_0xc374('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531295[_0xc374('0x16')]?_0x531295['options']['where']||null:null,'attributes':_0x531295['options']?_0x531295[_0xc374('0x16')][_0xc374('0x18')]||null:null,'limit':_0x531295[_0xc374('0x16')]?_0x531295[_0xc374('0x16')]['limit']||null:null})[_0xc374('0x1d')](function(_0x1595b2){logger[_0xc374('0xa')](_0xc374('0x22'),_0x531295);logger['debug']('UpdateMemberReport',_0x531295,JSON['stringify'](_0x1595b2));_0x1d44a9(_0x1595b2);})[_0xc374('0x13')](function(_0x295ec4){logger['error'](_0xc374('0x22'),_0x295ec4[_0xc374('0x10')],_0x531295);_0x5d5da7(_0xefa3bf['error'](0x1f4,_0x295ec4[_0xc374('0x10')]));});});};
\ No newline at end of file
index 687abcb..d9a539c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b3=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','multer','connect-timeout'];(function(_0x409b34,_0x46679a){var _0xd122f4=function(_0x352925){while(--_0x352925){_0x409b34['push'](_0x409b34['shift']());}};_0xd122f4(++_0x46679a);}(_0x00b3,0x97));var _0x300b=function(_0x3b96d4,_0x339b04){_0x3b96d4=_0x3b96d4-0x0;var _0x40bd53=_0x00b3[_0x3b96d4];return _0x40bd53;};'use strict';var multer=require(_0x300b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x300b('0x1'));var express=require(_0x300b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x300b('0x3'));var interaction=require(_0x300b('0x4'));var config=require(_0x300b('0x5'));var controller=require('./migration.controller');router[_0x300b('0x6')]('/',controller[_0x300b('0x7')]);module[_0x300b('0x8')]=router;
\ No newline at end of file
+var _0x61de=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x464a1a,_0x1f5497){var _0x28bc61=function(_0x2d2480){while(--_0x2d2480){_0x464a1a['push'](_0x464a1a['shift']());}};_0x28bc61(++_0x1f5497);}(_0x61de,0x18c));var _0xe61d=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x61de[_0x1a36a5];return _0x746243;};'use strict';var multer=require(_0xe61d('0x0'));var util=require(_0xe61d('0x1'));var path=require(_0xe61d('0x2'));var timeout=require(_0xe61d('0x3'));var express=require(_0xe61d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe61d('0x5'));var interaction=require(_0xe61d('0x6'));var config=require(_0xe61d('0x7'));var controller=require(_0xe61d('0x8'));router[_0xe61d('0x9')]('/',controller[_0xe61d('0xa')]);module[_0xe61d('0xb')]=router;
\ No newline at end of file
index c50a951..7e86e4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa34d=['sequelize','STRING','version'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa34d,0xae));var _0xda34=function(_0x4a266c,_0x39417e){_0x4a266c=_0x4a266c-0x0;var _0x47e774=_0xa34d[_0x4a266c];return _0x47e774;};'use strict';var Sequelize=require(_0xda34('0x0'));module['exports']={'version':{'type':Sequelize[_0xda34('0x1')],'unique':_0xda34('0x2')}};
\ No newline at end of file
+var _0xa672=['exports','version'];(function(_0x5e6a48,_0x3e233c){var _0x365e83=function(_0x3f9cf9){while(--_0x3f9cf9){_0x5e6a48['push'](_0x5e6a48['shift']());}};_0x365e83(++_0x3e233c);}(_0xa672,0x19e));var _0x2a67=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xa672[_0xb24a3e];return _0x4038d7;};'use strict';var Sequelize=require('sequelize');module[_0x2a67('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0x2a67('0x1')}};
\ No newline at end of file
index b61cde2..2e840d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x096f=['then','destroy','error','name','send','index','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x3866c8,_0x3ddeaa){var _0x4b61b3=function(_0x2fb299){while(--_0x2fb299){_0x3866c8['push'](_0x3866c8['shift']());}};_0x4b61b3(++_0x3ddeaa);}(_0x096f,0x17a));var _0xf096=function(_0x441c8d,_0x5a3fd1){_0x441c8d=_0x441c8d-0x0;var _0x49646b=_0x096f[_0x441c8d];return _0x49646b;};'use strict';var emlformat=require(_0xf096('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf096('0x1'));var jsonpatch=require(_0xf096('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf096('0x3'));var util=require(_0xf096('0x4'));var path=require(_0xf096('0x5'));var sox=require(_0xf096('0x6'));var csv=require(_0xf096('0x7'));var ejs=require(_0xf096('0x8'));var fs=require('fs');var fs_extra=require(_0xf096('0x9'));var _=require(_0xf096('0xa'));var squel=require(_0xf096('0xb'));var crypto=require(_0xf096('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf096('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf096('0xe'));var Papa=require(_0xf096('0xf'));var Redis=require(_0xf096('0x10'));var authService=require(_0xf096('0x11'));var qs=require(_0xf096('0x12'));var as=require(_0xf096('0x13'));var hardwareService=require(_0xf096('0x14'));var logger=require(_0xf096('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf096('0x16'));var licenseUtil=require(_0xf096('0x17'));var db=require(_0xf096('0x18'))['db'];function respondWithStatusCode(_0x2c3bf5,_0x3bf341){_0x3bf341=_0x3bf341||0xcc;return function(_0x104c75){if(_0x104c75){return _0x2c3bf5[_0xf096('0x19')](_0x3bf341);}return _0x2c3bf5['status'](_0x3bf341)[_0xf096('0x1a')]();};}function respondWithResult(_0x21bf93,_0x305c58){_0x305c58=_0x305c58||0xc8;return function(_0x3ec8b7){if(_0x3ec8b7){return _0x21bf93[_0xf096('0x1b')](_0x305c58)[_0xf096('0x1c')](_0x3ec8b7);}};}function respondWithFilteredResult(_0xd3ab66,_0x2f00d1){return function(_0x17a945){if(_0x17a945){var _0x43b948=typeof _0x2f00d1[_0xf096('0x1d')]===_0xf096('0x1e')&&typeof _0x2f00d1[_0xf096('0x1f')]===_0xf096('0x1e');var _0x4b46d1=_0x17a945[_0xf096('0x20')];var _0x3089b6=_0x43b948?0x0:_0x2f00d1[_0xf096('0x1d')];var _0x35a2d=_0x43b948?_0x17a945['count']:_0x2f00d1[_0xf096('0x1d')]+_0x2f00d1['limit'];var _0x31b826;if(_0x35a2d>=_0x4b46d1){_0x35a2d=_0x4b46d1;_0x31b826=0xc8;}else{_0x31b826=0xce;}_0xd3ab66[_0xf096('0x1b')](_0x31b826);return _0xd3ab66[_0xf096('0x21')](_0xf096('0x22'),_0x3089b6+'-'+_0x35a2d+'/'+_0x4b46d1)[_0xf096('0x1c')](_0x17a945);}return null;};}function patchUpdates(_0xa9409a){return function(_0x107a9b){try{jsonpatch[_0xf096('0x23')](_0x107a9b,_0xa9409a,!![]);}catch(_0x56993e){return BPromise['reject'](_0x56993e);}return _0x107a9b['save']();};}function saveUpdates(_0x47e1c6,_0xf577df){return function(_0x1f60ec){if(_0x1f60ec){return _0x1f60ec['update'](_0x47e1c6)[_0xf096('0x24')](function(_0x205891){return _0x205891;});}return null;};}function removeEntity(_0x281386,_0x3fd12e){return function(_0x4b264a){if(_0x4b264a){return _0x4b264a[_0xf096('0x25')]()[_0xf096('0x24')](function(){_0x281386[_0xf096('0x1b')](0xcc)[_0xf096('0x1a')]();});}};}function handleEntityNotFound(_0x175431,_0x4920c6){return function(_0x232e76){if(!_0x232e76){_0x175431[_0xf096('0x19')](0x194);}return _0x232e76;};}function handleError(_0xf81faa,_0x3f06aa){_0x3f06aa=_0x3f06aa||0x1f4;return function(_0x1d3f85){logger[_0xf096('0x26')](_0x1d3f85['stack']);if(_0x1d3f85['name']){delete _0x1d3f85[_0xf096('0x27')];}_0xf81faa[_0xf096('0x1b')](_0x3f06aa)[_0xf096('0x28')](_0x1d3f85);};}exports[_0xf096('0x29')]=function(_0x17c5c3,_0x5eef50){var _0x168dd0={},_0x57cd46={},_0x420292={'count':0x0,'rows':[]};var _0x1f82a9=_[_0xf096('0x2a')](db[_0xf096('0x2b')][_0xf096('0x2c')],function(_0x3c8e5d){return{'name':_0x3c8e5d[_0xf096('0x2d')],'type':_0x3c8e5d['type'][_0xf096('0x2e')]};});_0x57cd46[_0xf096('0x2f')]=_['map'](_0x1f82a9,'name');_0x57cd46[_0xf096('0x30')]=_[_0xf096('0x31')](_0x17c5c3[_0xf096('0x30')]);_0x57cd46[_0xf096('0x32')]=_[_0xf096('0x33')](_0x57cd46[_0xf096('0x2f')],_0x57cd46[_0xf096('0x30')]);_0x168dd0[_0xf096('0x34')]=_[_0xf096('0x33')](_0x57cd46[_0xf096('0x2f')],qs[_0xf096('0x35')](_0x17c5c3[_0xf096('0x30')][_0xf096('0x35')]));_0x168dd0[_0xf096('0x34')]=_0x168dd0['attributes'][_0xf096('0x36')]?_0x168dd0['attributes']:_0x57cd46[_0xf096('0x2f')];if(!_0x17c5c3[_0xf096('0x30')][_0xf096('0x37')](_0xf096('0x38'))){_0x168dd0[_0xf096('0x1f')]=qs[_0xf096('0x1f')](_0x17c5c3[_0xf096('0x30')][_0xf096('0x1f')]);_0x168dd0[_0xf096('0x1d')]=qs['offset'](_0x17c5c3[_0xf096('0x30')]['offset']);}_0x168dd0[_0xf096('0x39')]=qs[_0xf096('0x3a')](_0x17c5c3[_0xf096('0x30')][_0xf096('0x3a')]);_0x168dd0['where']=qs[_0xf096('0x32')](_[_0xf096('0x3b')](_0x17c5c3['query'],_0x57cd46[_0xf096('0x32')]),_0x1f82a9);if(_0x17c5c3['query'][_0xf096('0x3c')]){_0x168dd0[_0xf096('0x3d')]=_[_0xf096('0x3e')](_0x168dd0['where'],{'$or':_[_0xf096('0x2a')](_0x1f82a9,function(_0x315ce4){if(_0x315ce4['type']!==_0xf096('0x3f')){var _0x2db4d3={};_0x2db4d3[_0x315ce4[_0xf096('0x27')]]={'$like':'%'+_0x17c5c3['query'][_0xf096('0x3c')]+'%'};return _0x2db4d3;}})});}_0x168dd0=_[_0xf096('0x3e')]({},_0x168dd0,_0x17c5c3[_0xf096('0x40')]);var _0x401b1d={'where':_0x168dd0[_0xf096('0x3d')]};return db[_0xf096('0x2b')][_0xf096('0x20')](_0x401b1d)['then'](function(_0x2c78b1){_0x420292[_0xf096('0x20')]=_0x2c78b1;if(_0x17c5c3[_0xf096('0x30')][_0xf096('0x41')]){_0x168dd0['include']=[{'all':!![]}];}return db['Migration'][_0xf096('0x42')](_0x168dd0);})['then'](function(_0xd47807){_0x420292[_0xf096('0x43')]=_0xd47807;return _0x420292;})[_0xf096('0x24')](respondWithFilteredResult(_0x5eef50,_0x168dd0))[_0xf096('0x44')](handleError(_0x5eef50,null));};
\ No newline at end of file
+var _0xc668=['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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Migration','include','findAll','catch','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0xc668,0x107));var _0x8c66=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc668[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c66('0x0'));var zipdir=require(_0x8c66('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c66('0x2'));var BPromise=require(_0x8c66('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c66('0x4'));var sox=require(_0x8c66('0x5'));var csv=require(_0x8c66('0x6'));var ejs=require(_0x8c66('0x7'));var fs=require('fs');var fs_extra=require(_0x8c66('0x8'));var _=require('lodash');var squel=require(_0x8c66('0x9'));var crypto=require(_0x8c66('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8c66('0xb'));var toCsv=require(_0x8c66('0x6'));var querystring=require(_0x8c66('0xc'));var Papa=require(_0x8c66('0xd'));var Redis=require(_0x8c66('0xe'));var authService=require(_0x8c66('0xf'));var qs=require(_0x8c66('0x10'));var as=require(_0x8c66('0x11'));var hardwareService=require(_0x8c66('0x12'));var logger=require(_0x8c66('0x13'))(_0x8c66('0x14'));var utils=require(_0x8c66('0x15'));var config=require(_0x8c66('0x16'));var licenseUtil=require(_0x8c66('0x17'));var db=require(_0x8c66('0x18'))['db'];function respondWithStatusCode(_0x1f62ee,_0x33b4f6){_0x33b4f6=_0x33b4f6||0xcc;return function(_0x380012){if(_0x380012){return _0x1f62ee[_0x8c66('0x19')](_0x33b4f6);}return _0x1f62ee[_0x8c66('0x1a')](_0x33b4f6)['end']();};}function respondWithResult(_0x5d3f53,_0x2206f7){_0x2206f7=_0x2206f7||0xc8;return function(_0x488876){if(_0x488876){return _0x5d3f53[_0x8c66('0x1a')](_0x2206f7)[_0x8c66('0x1b')](_0x488876);}};}function respondWithFilteredResult(_0x557fcd,_0x1bc5ea){return function(_0x5ac509){if(_0x5ac509){var _0x382122=typeof _0x1bc5ea['offset']===_0x8c66('0x1c')&&typeof _0x1bc5ea['limit']===_0x8c66('0x1c');var _0x97f96c=_0x5ac509[_0x8c66('0x1d')];var _0x3c6e1c=_0x382122?0x0:_0x1bc5ea[_0x8c66('0x1e')];var _0x4bbf9f=_0x382122?_0x5ac509[_0x8c66('0x1d')]:_0x1bc5ea[_0x8c66('0x1e')]+_0x1bc5ea[_0x8c66('0x1f')];var _0x56c9b9;if(_0x4bbf9f>=_0x97f96c){_0x4bbf9f=_0x97f96c;_0x56c9b9=0xc8;}else{_0x56c9b9=0xce;}_0x557fcd[_0x8c66('0x1a')](_0x56c9b9);return _0x557fcd[_0x8c66('0x20')](_0x8c66('0x21'),_0x3c6e1c+'-'+_0x4bbf9f+'/'+_0x97f96c)[_0x8c66('0x1b')](_0x5ac509);}return null;};}function patchUpdates(_0x8648db){return function(_0x30b82d){try{jsonpatch['apply'](_0x30b82d,_0x8648db,!![]);}catch(_0x5abce3){return BPromise['reject'](_0x5abce3);}return _0x30b82d['save']();};}function saveUpdates(_0x3b9cd2,_0x5e5f2b){return function(_0x3d548b){if(_0x3d548b){return _0x3d548b[_0x8c66('0x22')](_0x3b9cd2)[_0x8c66('0x23')](function(_0x5c37da){return _0x5c37da;});}return null;};}function removeEntity(_0x4934b6,_0x29cf26){return function(_0xf6157e){if(_0xf6157e){return _0xf6157e['destroy']()[_0x8c66('0x23')](function(){_0x4934b6[_0x8c66('0x1a')](0xcc)[_0x8c66('0x24')]();});}};}function handleEntityNotFound(_0x4747fe,_0x2a56b8){return function(_0x159be8){if(!_0x159be8){_0x4747fe[_0x8c66('0x19')](0x194);}return _0x159be8;};}function handleError(_0x534862,_0x3232bb){_0x3232bb=_0x3232bb||0x1f4;return function(_0x5e9462){logger[_0x8c66('0x25')](_0x5e9462[_0x8c66('0x26')]);if(_0x5e9462[_0x8c66('0x27')]){delete _0x5e9462['name'];}_0x534862[_0x8c66('0x1a')](_0x3232bb)[_0x8c66('0x28')](_0x5e9462);};}exports['index']=function(_0x43e5ac,_0x511ccc){var _0x570a14={},_0xa61bf4={},_0x18e0d0={'count':0x0,'rows':[]};var _0x1a066d=_[_0x8c66('0x29')](db['Migration'][_0x8c66('0x2a')],function(_0x3bcde6){return{'name':_0x3bcde6[_0x8c66('0x2b')],'type':_0x3bcde6[_0x8c66('0x2c')][_0x8c66('0x2d')]};});_0xa61bf4['model']=_[_0x8c66('0x29')](_0x1a066d,_0x8c66('0x27'));_0xa61bf4['query']=_[_0x8c66('0x2e')](_0x43e5ac['query']);_0xa61bf4[_0x8c66('0x2f')]=_[_0x8c66('0x30')](_0xa61bf4[_0x8c66('0x31')],_0xa61bf4[_0x8c66('0x32')]);_0x570a14[_0x8c66('0x33')]=_[_0x8c66('0x30')](_0xa61bf4[_0x8c66('0x31')],qs['fields'](_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x34')]));_0x570a14[_0x8c66('0x33')]=_0x570a14[_0x8c66('0x33')][_0x8c66('0x35')]?_0x570a14[_0x8c66('0x33')]:_0xa61bf4[_0x8c66('0x31')];if(!_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x36')](_0x8c66('0x37'))){_0x570a14[_0x8c66('0x1f')]=qs['limit'](_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x1f')]);_0x570a14[_0x8c66('0x1e')]=qs[_0x8c66('0x1e')](_0x43e5ac['query'][_0x8c66('0x1e')]);}_0x570a14[_0x8c66('0x38')]=qs[_0x8c66('0x39')](_0x43e5ac['query'][_0x8c66('0x39')]);_0x570a14[_0x8c66('0x3a')]=qs[_0x8c66('0x2f')](_[_0x8c66('0x3b')](_0x43e5ac[_0x8c66('0x32')],_0xa61bf4[_0x8c66('0x2f')]),_0x1a066d);if(_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x3c')]){_0x570a14[_0x8c66('0x3a')]=_['merge'](_0x570a14[_0x8c66('0x3a')],{'$or':_[_0x8c66('0x29')](_0x1a066d,function(_0x3b7ee3){if(_0x3b7ee3[_0x8c66('0x2c')]!==_0x8c66('0x3d')){var _0x11e69c={};_0x11e69c[_0x3b7ee3[_0x8c66('0x27')]]={'$like':'%'+_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x3c')]+'%'};return _0x11e69c;}})});}_0x570a14=_[_0x8c66('0x3e')]({},_0x570a14,_0x43e5ac[_0x8c66('0x3f')]);var _0x5ccae8={'where':_0x570a14['where']};return db[_0x8c66('0x40')][_0x8c66('0x1d')](_0x5ccae8)[_0x8c66('0x23')](function(_0x9e299){_0x18e0d0[_0x8c66('0x1d')]=_0x9e299;if(_0x43e5ac['query']['includeAll']){_0x570a14[_0x8c66('0x41')]=[{'all':!![]}];}return db[_0x8c66('0x40')][_0x8c66('0x42')](_0x570a14);})[_0x8c66('0x23')](function(_0xd40151){_0x18e0d0['rows']=_0xd40151;return _0x18e0d0;})[_0x8c66('0x23')](respondWithFilteredResult(_0x511ccc,_0x570a14))[_0x8c66('0x43')](handleError(_0x511ccc,null));};
\ No newline at end of file
index 2a78b48..f64b9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7d2=['path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','api','moment','request-promise'];(function(_0x5e5c4c,_0x21abba){var _0x176148=function(_0x59522a){while(--_0x59522a){_0x5e5c4c['push'](_0x5e5c4c['shift']());}};_0x176148(++_0x21abba);}(_0xa7d2,0x70));var _0x2a7d=function(_0x5186b2,_0x27cd83){_0x5186b2=_0x5186b2-0x0;var _0x8f5754=_0xa7d2[_0x5186b2];return _0x8f5754;};'use strict';var _=require(_0x2a7d('0x0'));var util=require(_0x2a7d('0x1'));var logger=require('../../config/logger')(_0x2a7d('0x2'));var moment=require(_0x2a7d('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a7d('0x4'));var fs=require('fs');var path=require(_0x2a7d('0x5'));var rimraf=require(_0x2a7d('0x6'));var config=require(_0x2a7d('0x7'));var attributes=require(_0x2a7d('0x8'));module[_0x2a7d('0x9')]=function(_0xc3d4e2,_0x9b9c86){return _0xc3d4e2[_0x2a7d('0xa')](_0x2a7d('0xb'),attributes,{'tableName':_0x2a7d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a71=['define','Migration','migrations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes'];(function(_0x2e55d7,_0x2698a5){var _0x47750f=function(_0xcf96ee){while(--_0xcf96ee){_0x2e55d7['push'](_0x2e55d7['shift']());}};_0x47750f(++_0x2698a5);}(_0x5a71,0x1b3));var _0x15a7=function(_0x5933fb,_0x9115ad){_0x5933fb=_0x5933fb-0x0;var _0x44d988=_0x5a71[_0x5933fb];return _0x44d988;};'use strict';var _=require('lodash');var util=require(_0x15a7('0x0'));var logger=require(_0x15a7('0x1'))('api');var moment=require(_0x15a7('0x2'));var BPromise=require(_0x15a7('0x3'));var rp=require(_0x15a7('0x4'));var fs=require('fs');var path=require(_0x15a7('0x5'));var rimraf=require(_0x15a7('0x6'));var config=require(_0x15a7('0x7'));var attributes=require(_0x15a7('0x8'));module['exports']=function(_0x62442c,_0x3482b3){return _0x62442c[_0x15a7('0x9')](_0x15a7('0xa'),attributes,{'tableName':_0x15a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8cb8b1d..750559a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf430=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0xf430,0x1e4));var _0x0f43=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0xf430[_0x223461];return _0x4dbe0a;};'use strict';var _=require(_0x0f43('0x0'));var util=require(_0x0f43('0x1'));var moment=require(_0x0f43('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f43('0x3'));var fs=require('fs');var Redis=require(_0x0f43('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0f43('0x5'))(_0x0f43('0x6'));var config=require(_0x0f43('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0f43('0x8')][_0x0f43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x490bc1,_0x562cf2,_0x2e8f68){return new BPromise(function(_0x39bc4c,_0x18e735){return client['request'](_0x490bc1,_0x2e8f68)[_0x0f43('0xa')](function(_0x59508b){logger[_0x0f43('0xb')](_0x0f43('0xc'),_0x562cf2,'request\x20sent');logger['debug'](_0x0f43('0xd'),_0x562cf2,_0x0f43('0xe'),JSON[_0x0f43('0xf')](_0x59508b));if(_0x59508b[_0x0f43('0x10')]){if(_0x59508b[_0x0f43('0x10')]['code']===0x1f4){logger[_0x0f43('0x10')](_0x0f43('0xc'),_0x562cf2,_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);return _0x18e735(_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);}logger[_0x0f43('0x10')](_0x0f43('0xc'),_0x562cf2,_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);return _0x39bc4c(_0x59508b[_0x0f43('0x10')]['message']);}else{logger[_0x0f43('0xb')](_0x0f43('0xc'),_0x562cf2,'request\x20sent');_0x39bc4c(_0x59508b[_0x0f43('0x12')][_0x0f43('0x11')]);}})[_0x0f43('0x13')](function(_0x5631e1){logger[_0x0f43('0x10')]('Migration,\x20%s,\x20%s',_0x562cf2,_0x5631e1);_0x18e735(_0x5631e1);});});}
\ No newline at end of file
+var _0x4977=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x313927,_0x2b3a6d){var _0x545b28=function(_0x1be96e){while(--_0x1be96e){_0x313927['push'](_0x313927['shift']());}};_0x545b28(++_0x2b3a6d);}(_0x4977,0x1cd));var _0x7497=function(_0x4e3610,_0x18cc72){_0x4e3610=_0x4e3610-0x0;var _0x55a9be=_0x4977[_0x4e3610];return _0x55a9be;};'use strict';var _=require(_0x7497('0x0'));var util=require(_0x7497('0x1'));var moment=require(_0x7497('0x2'));var BPromise=require(_0x7497('0x3'));var rs=require(_0x7497('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7497('0x5'))['db'];var utils=require(_0x7497('0x6'));var logger=require(_0x7497('0x7'))(_0x7497('0x8'));var config=require(_0x7497('0x9'));var jayson=require(_0x7497('0xa'));var client=jayson['client'][_0x7497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21d9d5,_0x2cafd5,_0x15c322){return new BPromise(function(_0x180bf8,_0x54da2d){return client[_0x7497('0xc')](_0x21d9d5,_0x15c322)[_0x7497('0xd')](function(_0x5b4f54){logger[_0x7497('0xe')](_0x7497('0xf'),_0x2cafd5,_0x7497('0x10'));logger[_0x7497('0x11')](_0x7497('0x12'),_0x2cafd5,_0x7497('0x10'),JSON[_0x7497('0x13')](_0x5b4f54));if(_0x5b4f54[_0x7497('0x14')]){if(_0x5b4f54['error'][_0x7497('0x15')]===0x1f4){logger[_0x7497('0x14')]('Migration,\x20%s,\x20%s',_0x2cafd5,_0x5b4f54['error'][_0x7497('0x16')]);return _0x54da2d(_0x5b4f54[_0x7497('0x14')][_0x7497('0x16')]);}logger[_0x7497('0x14')](_0x7497('0xf'),_0x2cafd5,_0x5b4f54['error'][_0x7497('0x16')]);return _0x180bf8(_0x5b4f54['error'][_0x7497('0x16')]);}else{logger[_0x7497('0xe')](_0x7497('0xf'),_0x2cafd5,_0x7497('0x10'));_0x180bf8(_0x5b4f54[_0x7497('0x17')]['message']);}})[_0x7497('0x18')](function(_0x460b3e){logger[_0x7497('0x14')](_0x7497('0xf'),_0x2cafd5,_0x460b3e);_0x54da2d(_0x460b3e);});});}
\ No newline at end of file
index 22b5048..d4607f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e47=['get','isAuthenticated','/:id','show','post','create','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e47,0x17f));var _0x74e4=function(_0x555a5a,_0x5863bb){_0x555a5a=_0x555a5a-0x0;var _0x3d16e8=_0x4e47[_0x555a5a];return _0x3d16e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x74e4('0x0'));var timeout=require(_0x74e4('0x1'));var express=require(_0x74e4('0x2'));var router=express[_0x74e4('0x3')]();var fs_extra=require(_0x74e4('0x4'));var auth=require(_0x74e4('0x5'));var interaction=require(_0x74e4('0x6'));var config=require(_0x74e4('0x7'));var controller=require('./network.controller');router[_0x74e4('0x8')]('/',auth[_0x74e4('0x9')](),controller['index']);router[_0x74e4('0x8')](_0x74e4('0xa'),auth[_0x74e4('0x9')](),controller[_0x74e4('0xb')]);router[_0x74e4('0xc')]('/',auth['isAuthenticated'](),controller[_0x74e4('0xd')]);router[_0x74e4('0xe')](_0x74e4('0xa'),auth[_0x74e4('0x9')](),controller[_0x74e4('0xf')]);router['delete'](_0x74e4('0xa'),auth[_0x74e4('0x9')](),controller['destroy']);module[_0x74e4('0x10')]=router;
\ No newline at end of file
+var _0x2cc4=['isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./network.controller','get'];(function(_0x51705b,_0x2d33da){var _0x342455=function(_0x12203d){while(--_0x12203d){_0x51705b['push'](_0x51705b['shift']());}};_0x342455(++_0x2d33da);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x2cc4[_0x166e96];return _0x553d73;};'use strict';var multer=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var path=require(_0x42cc('0x2'));var timeout=require(_0x42cc('0x3'));var express=require('express');var router=express[_0x42cc('0x4')]();var fs_extra=require(_0x42cc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x42cc('0x6'));router[_0x42cc('0x7')]('/',auth[_0x42cc('0x8')](),controller[_0x42cc('0x9')]);router[_0x42cc('0x7')]('/:id',auth[_0x42cc('0x8')](),controller[_0x42cc('0xa')]);router[_0x42cc('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x42cc('0xc')](_0x42cc('0xd'),auth[_0x42cc('0x8')](),controller[_0x42cc('0xe')]);router[_0x42cc('0xf')](_0x42cc('0xd'),auth[_0x42cc('0x8')](),controller[_0x42cc('0x10')]);module[_0x42cc('0x11')]=router;
\ No newline at end of file
index 02d0e73..4f397fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f6d=['stun','STRING','exports','ENUM','localnet','externip'];(function(_0x5950bd,_0x103e16){var _0x33e816=function(_0x439344){while(--_0x439344){_0x5950bd['push'](_0x5950bd['shift']());}};_0x33e816(++_0x103e16);}(_0x4f6d,0x116));var _0xd4f6=function(_0x169379,_0x2616c8){_0x169379=_0x169379-0x0;var _0x483e3a=_0x4f6d[_0x169379];return _0x483e3a;};'use strict';var Sequelize=require('sequelize');module[_0xd4f6('0x0')]={'type':{'type':Sequelize[_0xd4f6('0x1')](_0xd4f6('0x2'),_0xd4f6('0x3'),_0xd4f6('0x4'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd4f6('0x5')]},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xad2b=['turn','STRING','sequelize','exports','ENUM','stun'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xad2b,0xc2));var _0xbad2=function(_0x13d569,_0x357628){_0x13d569=_0x13d569-0x0;var _0x504564=_0xad2b[_0x13d569];return _0x504564;};'use strict';var Sequelize=require(_0xbad2('0x0'));module[_0xbad2('0x1')]={'type':{'type':Sequelize[_0xbad2('0x2')]('localnet','externip',_0xbad2('0x3'),_0xbad2('0x4'))},'value':{'type':Sequelize[_0xbad2('0x5')]},'username':{'type':Sequelize[_0xbad2('0x5')]},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ecaf1f6..e4b98fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97f6=['format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','filter','merge','where','options','includeAll','include','findAll','show','params','create','sequelize','body','toUpperCase','STUN','join','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','transaction','find','readFileSync','chan_sip.so'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x97f6,0x199));var _0x697f=function(_0x963d38,_0x5de965){_0x963d38=_0x963d38-0x0;var _0xab8912=_0x97f6[_0x963d38];return _0xab8912;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x697f('0x0'));var rp=require(_0x697f('0x1'));var moment=require(_0x697f('0x2'));var BPromise=require(_0x697f('0x3'));var Mustache=require('mustache');var util=require(_0x697f('0x4'));var path=require(_0x697f('0x5'));var sox=require('sox');var csv=require(_0x697f('0x6'));var ejs=require(_0x697f('0x7'));var fs=require('fs');var fs_extra=require(_0x697f('0x8'));var _=require(_0x697f('0x9'));var squel=require('squel');var crypto=require(_0x697f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x697f('0xb'));var toCsv=require(_0x697f('0x6'));var querystring=require('querystring');var Papa=require(_0x697f('0xc'));var Redis=require(_0x697f('0xd'));var authService=require(_0x697f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x697f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x697f('0x10'));var config=require(_0x697f('0x11'));var licenseUtil=require(_0x697f('0x12'));var db=require(_0x697f('0x13'))['db'];var jayson=require(_0x697f('0x14'));var client=jayson['client'][_0x697f('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x5c5640,_0x2439f8,_0x426ddc,_0x228606){return new BPromise(function(_0x503def,_0x4e2fac){var _0x3947f9=_0x228606||client;return _0x3947f9['request'](_0x5c5640,_0x426ddc)[_0x697f('0x16')](function(_0x30a954){logger[_0x697f('0x17')](_0x697f('0x18'),_0x2439f8,_0x697f('0x19'));logger[_0x697f('0x1a')]('Network,\x20%s,\x20%s,\x20%s',_0x2439f8,_0x697f('0x19'),JSON[_0x697f('0x1b')](_0x30a954));if(_0x30a954[_0x697f('0x1c')]){if(_0x30a954['error']['code']===0x1f4){logger['error'](_0x697f('0x18'),_0x2439f8,_0x30a954[_0x697f('0x1c')][_0x697f('0x1d')]);return _0x4e2fac(_0x30a954['error'][_0x697f('0x1d')]);}logger[_0x697f('0x1c')](_0x697f('0x18'),_0x2439f8,_0x30a954[_0x697f('0x1c')]['message']);return _0x503def(_0x30a954[_0x697f('0x1c')][_0x697f('0x1d')]);}else{logger[_0x697f('0x17')](_0x697f('0x18'),_0x2439f8,_0x697f('0x19'));_0x503def(_0x30a954[_0x697f('0x1e')]['message']);}})[_0x697f('0x1f')](function(_0x34c2e4){logger[_0x697f('0x1c')](_0x697f('0x18'),_0x2439f8,_0x34c2e4);_0x4e2fac(_0x34c2e4);});});}function respondWithStatusCode(_0x1add5e,_0x581da1){_0x581da1=_0x581da1||0xcc;return function(_0x180619){if(_0x180619){return _0x1add5e['sendStatus'](_0x581da1);}return _0x1add5e[_0x697f('0x20')](_0x581da1)[_0x697f('0x21')]();};}function respondWithResult(_0x30deec,_0x4ebad8){_0x4ebad8=_0x4ebad8||0xc8;return function(_0x5e64eb){if(_0x5e64eb){return _0x30deec['status'](_0x4ebad8)['json'](_0x5e64eb);}};}function respondWithFilteredResult(_0x424665,_0x384c55){return function(_0x3bf9fd){if(_0x3bf9fd){var _0x2ba1b5=typeof _0x384c55[_0x697f('0x22')]===_0x697f('0x23')&&typeof _0x384c55[_0x697f('0x24')]==='undefined';var _0x1f4865=_0x3bf9fd[_0x697f('0x25')];var _0x2e64e0=_0x2ba1b5?0x0:_0x384c55['offset'];var _0x31c95f=_0x2ba1b5?_0x3bf9fd['count']:_0x384c55[_0x697f('0x22')]+_0x384c55['limit'];var _0xb5e992;if(_0x31c95f>=_0x1f4865){_0x31c95f=_0x1f4865;_0xb5e992=0xc8;}else{_0xb5e992=0xce;}_0x424665[_0x697f('0x20')](_0xb5e992);return _0x424665[_0x697f('0x26')](_0x697f('0x27'),_0x2e64e0+'-'+_0x31c95f+'/'+_0x1f4865)[_0x697f('0x28')](_0x3bf9fd);}return null;};}function patchUpdates(_0x2215bf){return function(_0x50fea0){try{jsonpatch[_0x697f('0x29')](_0x50fea0,_0x2215bf,!![]);}catch(_0x4b94e0){return BPromise[_0x697f('0x2a')](_0x4b94e0);}return _0x50fea0[_0x697f('0x2b')]();};}function saveUpdates(_0x1dc4e7,_0x3afa36){return function(_0x30f27e){if(_0x30f27e){return _0x30f27e[_0x697f('0x2c')](_0x1dc4e7)['then'](function(_0x1fd7cb){return _0x1fd7cb;});}return null;};}function removeEntity(_0x1d674c,_0x24b10a){return function(_0x56bf5a){if(_0x56bf5a){return _0x56bf5a[_0x697f('0x2d')]()[_0x697f('0x16')](function(){_0x1d674c['status'](0xcc)[_0x697f('0x21')]();});}};}function handleEntityNotFound(_0x4afc8a,_0x3404d3){return function(_0x3472e7){if(!_0x3472e7){_0x4afc8a[_0x697f('0x2e')](0x194);}return _0x3472e7;};}function handleError(_0x22cebb,_0x16a3f7){_0x16a3f7=_0x16a3f7||0x1f4;return function(_0x146d6f){logger['error'](_0x146d6f[_0x697f('0x2f')]);if(_0x146d6f[_0x697f('0x30')]){delete _0x146d6f[_0x697f('0x30')];}_0x22cebb['status'](_0x16a3f7)[_0x697f('0x31')](_0x146d6f);};}exports[_0x697f('0x32')]=function(_0x1e54da,_0x17fa22){var _0x482006={},_0x2988b8={},_0x409baf={'count':0x0,'rows':[]};var _0x55143e=_[_0x697f('0x33')](db[_0x697f('0x34')][_0x697f('0x35')],function(_0x59610b){return{'name':_0x59610b[_0x697f('0x36')],'type':_0x59610b[_0x697f('0x37')][_0x697f('0x38')]};});_0x2988b8['model']=_['map'](_0x55143e,'name');_0x2988b8['query']=_[_0x697f('0x39')](_0x1e54da[_0x697f('0x3a')]);_0x2988b8['filters']=_['intersection'](_0x2988b8[_0x697f('0x3b')],_0x2988b8[_0x697f('0x3a')]);_0x482006[_0x697f('0x3c')]=_[_0x697f('0x3d')](_0x2988b8['model'],qs['fields'](_0x1e54da[_0x697f('0x3a')][_0x697f('0x3e')]));_0x482006[_0x697f('0x3c')]=_0x482006[_0x697f('0x3c')][_0x697f('0x3f')]?_0x482006[_0x697f('0x3c')]:_0x2988b8['model'];if(!_0x1e54da[_0x697f('0x3a')][_0x697f('0x40')](_0x697f('0x41'))){_0x482006[_0x697f('0x24')]=qs[_0x697f('0x24')](_0x1e54da[_0x697f('0x3a')]['limit']);_0x482006['offset']=qs[_0x697f('0x22')](_0x1e54da[_0x697f('0x3a')][_0x697f('0x22')]);}_0x482006[_0x697f('0x42')]=qs['sort'](_0x1e54da['query']['sort']);_0x482006['where']=qs[_0x697f('0x43')](_['pick'](_0x1e54da['query'],_0x2988b8[_0x697f('0x43')]),_0x55143e);if(_0x1e54da[_0x697f('0x3a')][_0x697f('0x44')]){_0x482006['where']=_[_0x697f('0x45')](_0x482006[_0x697f('0x46')],{'$or':_[_0x697f('0x33')](_0x55143e,function(_0x245157){if(_0x245157['type']!=='VIRTUAL'){var _0x350a1e={};_0x350a1e[_0x245157[_0x697f('0x30')]]={'$like':'%'+_0x1e54da[_0x697f('0x3a')]['filter']+'%'};return _0x350a1e;}})});}_0x482006=_[_0x697f('0x45')]({},_0x482006,_0x1e54da[_0x697f('0x47')]);var _0x238312={'where':_0x482006[_0x697f('0x46')]};return db['Network']['count'](_0x238312)[_0x697f('0x16')](function(_0x3c42a2){_0x409baf[_0x697f('0x25')]=_0x3c42a2;if(_0x1e54da[_0x697f('0x3a')][_0x697f('0x48')]){_0x482006[_0x697f('0x49')]=[{'all':!![]}];}return db[_0x697f('0x34')][_0x697f('0x4a')](_0x482006);})[_0x697f('0x16')](function(_0x36a30e){_0x409baf['rows']=_0x36a30e;return _0x409baf;})[_0x697f('0x16')](respondWithFilteredResult(_0x17fa22,_0x482006))[_0x697f('0x1f')](handleError(_0x17fa22,null));};exports[_0x697f('0x4b')]=function(_0x39ced5,_0x4e922f){var _0x5dc936={'raw':!![],'where':{'id':_0x39ced5[_0x697f('0x4c')]['id']}},_0x36ca92={};_0x36ca92[_0x697f('0x3b')]=_['keys'](db['Network'][_0x697f('0x35')]);_0x36ca92[_0x697f('0x3a')]=_[_0x697f('0x39')](_0x39ced5[_0x697f('0x3a')]);_0x36ca92[_0x697f('0x43')]=_[_0x697f('0x3d')](_0x36ca92['model'],_0x36ca92[_0x697f('0x3a')]);_0x5dc936[_0x697f('0x3c')]=_[_0x697f('0x3d')](_0x36ca92[_0x697f('0x3b')],qs[_0x697f('0x3e')](_0x39ced5[_0x697f('0x3a')]['fields']));_0x5dc936[_0x697f('0x3c')]=_0x5dc936[_0x697f('0x3c')][_0x697f('0x3f')]?_0x5dc936[_0x697f('0x3c')]:_0x36ca92[_0x697f('0x3b')];if(_0x39ced5[_0x697f('0x3a')][_0x697f('0x48')]){_0x5dc936['include']=[{'all':!![]}];}_0x5dc936=_[_0x697f('0x45')]({},_0x5dc936,_0x39ced5[_0x697f('0x47')]);return db[_0x697f('0x34')]['find'](_0x5dc936)[_0x697f('0x16')](handleEntityNotFound(_0x4e922f,null))[_0x697f('0x16')](respondWithResult(_0x4e922f,null))[_0x697f('0x1f')](handleError(_0x4e922f,null));};exports[_0x697f('0x4d')]=function(_0x49aba0,_0x49f7b6,_0x4ba545){var _0x6cd80c;return db[_0x697f('0x4e')]['transaction'](function(_0x313c9b){return db[_0x697f('0x34')]['create'](_0x49aba0[_0x697f('0x4f')],{'raw':!![]})[_0x697f('0x16')](function(_0xf49120){_0x6cd80c=_0xf49120;return db[_0x697f('0x34')][_0x697f('0x4a')]({'where':{'type':_0x49aba0[_0x697f('0x4f')][_0x697f('0x37')]},'raw':!![]});})[_0x697f('0x16')](function(_0x3f155f){if(_0x6cd80c[_0x697f('0x37')][_0x697f('0x50')]()==_0x697f('0x51')){var _0x86b7ba=fs['readFileSync'](path[_0x697f('0x52')](config['root'],_0x697f('0x53')),_0x697f('0x54'));var _0x41bdda=ejs['render'](_0x86b7ba,{'networks':_0x3f155f||[]});fs[_0x697f('0x55')](_0x697f('0x56'),_0x41bdda);return respondWithRpcPromise(_0x697f('0x57'),_0x697f('0x4d'),{'module':_0x697f('0x58')});}else if(_0x6cd80c[_0x697f('0x37')][_0x697f('0x50')]()==_0x697f('0x59')){var _0x2e78ce=fs['readFileSync'](path['join'](config[_0x697f('0x5a')],_0x697f('0x5b')),_0x697f('0x54'));var _0x18cad2=ejs[_0x697f('0x5c')](_0x2e78ce,{'networks':_0x3f155f||[]});fs[_0x697f('0x55')](_0x697f('0x5d'),_0x18cad2);return respondWithRpcPromise(_0x697f('0x57'),_0x697f('0x4d'),{'module':'res_stun_monitor.so'});}else{var _0x336d97=fs['readFileSync'](path[_0x697f('0x52')](config[_0x697f('0x5a')],_0x697f('0x5e')),_0x697f('0x54'));var _0x4bd492=ejs[_0x697f('0x5c')](_0x336d97,{'networks':_0x3f155f||[]});fs[_0x697f('0x55')](util['format'](_0x697f('0x5f'),_0x49aba0[_0x697f('0x4f')][_0x697f('0x37')][_0x697f('0x60')]()),_0x4bd492);return respondWithRpcPromise(_0x697f('0x57'),_0x697f('0x4d'),{'module':'chan_sip.so'});}return null;})[_0x697f('0x16')](function(){return _0x6cd80c;});})[_0x697f('0x16')](respondWithResult(_0x49f7b6,0xc9))['catch'](handleError(_0x49f7b6,null));};exports[_0x697f('0x2c')]=function(_0x4bc870,_0x1257f7,_0x5b1bcf){var _0x14cf1c;return db[_0x697f('0x4e')][_0x697f('0x61')](function(_0x4186b3){return db[_0x697f('0x34')][_0x697f('0x62')]({'where':{'id':_0x4bc870[_0x697f('0x4c')]['id']}})[_0x697f('0x16')](handleEntityNotFound(_0x1257f7,null))[_0x697f('0x16')](saveUpdates(_0x4bc870[_0x697f('0x4f')],null))['then'](function(_0x167e4d){if(_0x167e4d){_0x14cf1c=_0x167e4d;return db[_0x697f('0x34')][_0x697f('0x4a')]({'where':{'type':_0x14cf1c[_0x697f('0x37')]},'raw':!![]});}return null;})[_0x697f('0x16')](function(_0xbc421){if(_0x14cf1c[_0x697f('0x37')][_0x697f('0x50')]()=='STUN'){var _0x242180=fs['readFileSync'](path['join'](config[_0x697f('0x5a')],_0x697f('0x53')),'utf8');var _0x24a0d0=ejs['render'](_0x242180,{'networks':_0xbc421||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x24a0d0);return respondWithRpcPromise(_0x697f('0x57'),'update',{'module':_0x697f('0x58')});}else if(_0x14cf1c['type']['toUpperCase']()==_0x697f('0x59')){var _0x3cdaa7=fs['readFileSync'](path[_0x697f('0x52')](config[_0x697f('0x5a')],'server/files/templates/turn_multiple.ejs'),_0x697f('0x54'));var _0x403510=ejs[_0x697f('0x5c')](_0x3cdaa7,{'networks':_0xbc421||[]});fs[_0x697f('0x55')](_0x697f('0x5d'),_0x403510);return respondWithRpcPromise(_0x697f('0x57'),_0x697f('0x2c'),{'module':_0x697f('0x58')});}else{var _0xfcc582=fs[_0x697f('0x63')](path['join'](config[_0x697f('0x5a')],'server/files/templates/network.ejs'),_0x697f('0x54'));var _0x1cc5b2=ejs[_0x697f('0x5c')](_0xfcc582,{'networks':_0xbc421||[]});fs[_0x697f('0x55')](util['format'](_0x697f('0x5f'),_0x4bc870[_0x697f('0x4f')]['type'][_0x697f('0x60')]()),_0x1cc5b2);return respondWithRpcPromise(_0x697f('0x57'),'update',{'module':_0x697f('0x64')});}return null;})[_0x697f('0x16')](function(_0x474c5f){if(_0x474c5f){return _0x14cf1c;}return null;});})[_0x697f('0x16')](respondWithResult(_0x1257f7,null))[_0x697f('0x1f')](handleError(_0x1257f7,null));};exports[_0x697f('0x2d')]=function(_0x36ceb8,_0x5274cd,_0x29759d){var _0xbdfb25;return db[_0x697f('0x34')][_0x697f('0x62')]({'where':{'id':_0x36ceb8[_0x697f('0x4c')]['id']}})[_0x697f('0x16')](function(_0x2f51f0){_0xbdfb25=_0x2f51f0;return _0x2f51f0;})[_0x697f('0x16')](handleEntityNotFound(_0x5274cd,null))[_0x697f('0x16')](removeEntity(_0x5274cd,null))[_0x697f('0x16')](function(){if(_0xbdfb25){return db[_0x697f('0x34')][_0x697f('0x4a')]({'where':{'type':_0xbdfb25['type']},'raw':!![]});}})['then'](function(_0x19f4cd){if(_0xbdfb25[_0x697f('0x37')][_0x697f('0x50')]()==_0x697f('0x51')){var _0x1ec995=fs['readFileSync'](path['join'](config[_0x697f('0x5a')],_0x697f('0x53')),_0x697f('0x54'));var _0x263f35=ejs['render'](_0x1ec995,{'networks':_0x19f4cd||[]});fs[_0x697f('0x55')](_0x697f('0x56'),_0x263f35);return respondWithRpcPromise(_0x697f('0x57'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0xbdfb25['type']['toUpperCase']()==_0x697f('0x59')){var _0x14d27f=fs[_0x697f('0x63')](path[_0x697f('0x52')](config['root'],_0x697f('0x5b')),'utf8');var _0x3cb890=ejs[_0x697f('0x5c')](_0x14d27f,{'networks':_0x19f4cd||[]});fs[_0x697f('0x55')]('/etc/asterisk/turn_xcally.conf',_0x3cb890);return respondWithRpcPromise('Reload',_0x697f('0x2d'),{'module':_0x697f('0x58')});}else{var _0x595ec6=fs[_0x697f('0x63')](path[_0x697f('0x52')](config[_0x697f('0x5a')],'server/files/templates/network.ejs'),_0x697f('0x54'));var _0x1cae5d=ejs[_0x697f('0x5c')](_0x595ec6,{'networks':_0x19f4cd||[]});fs[_0x697f('0x55')](util[_0x697f('0x65')](_0x697f('0x5f'),_0x36ceb8[_0x697f('0x4f')][_0x697f('0x37')][_0x697f('0x60')]()),_0x1cae5d);return respondWithRpcPromise(_0x697f('0x57'),'destroy',{'module':_0x697f('0x64')});}return null;})[_0x697f('0x1f')](handleError(_0x5274cd,null));};
\ No newline at end of file
+var _0xcb88=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','map','VIRTUAL','merge','options','Network','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','sequelize','transaction','body','type','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','toLowerCase','STUN','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','destroy','eml-format'];(function(_0x192cff,_0x361327){var _0x20d2f6=function(_0x37baf9){while(--_0x37baf9){_0x192cff['push'](_0x192cff['shift']());}};_0x20d2f6(++_0x361327);}(_0xcb88,0x14c));var _0x8cb8=function(_0x11e904,_0x469a24){_0x11e904=_0x11e904-0x0;var _0x380c89=_0xcb88[_0x11e904];return _0x380c89;};'use strict';var emlformat=require(_0x8cb8('0x0'));var rimraf=require(_0x8cb8('0x1'));var zipdir=require(_0x8cb8('0x2'));var jsonpatch=require(_0x8cb8('0x3'));var rp=require(_0x8cb8('0x4'));var moment=require('moment');var BPromise=require(_0x8cb8('0x5'));var Mustache=require(_0x8cb8('0x6'));var util=require(_0x8cb8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8cb8('0x8'));var ejs=require(_0x8cb8('0x9'));var fs=require('fs');var fs_extra=require(_0x8cb8('0xa'));var _=require(_0x8cb8('0xb'));var squel=require(_0x8cb8('0xc'));var crypto=require(_0x8cb8('0xd'));var jsforce=require(_0x8cb8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8cb8('0x8'));var querystring=require('querystring');var Papa=require(_0x8cb8('0xf'));var Redis=require('ioredis');var authService=require(_0x8cb8('0x10'));var qs=require(_0x8cb8('0x11'));var as=require(_0x8cb8('0x12'));var hardwareService=require(_0x8cb8('0x13'));var logger=require(_0x8cb8('0x14'))('api');var utils=require(_0x8cb8('0x15'));var config=require(_0x8cb8('0x16'));var licenseUtil=require(_0x8cb8('0x17'));var db=require(_0x8cb8('0x18'))['db'];var jayson=require(_0x8cb8('0x19'));var client=jayson[_0x8cb8('0x1a')][_0x8cb8('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x35c0b1,_0x2fb616,_0x25f198,_0x4f3cf2){return new BPromise(function(_0x22b22e,_0x49c725){var _0x4474f7=_0x4f3cf2||client;return _0x4474f7[_0x8cb8('0x1c')](_0x35c0b1,_0x25f198)[_0x8cb8('0x1d')](function(_0x3e90c7){logger[_0x8cb8('0x1e')](_0x8cb8('0x1f'),_0x2fb616,'request\x20sent');logger[_0x8cb8('0x20')](_0x8cb8('0x21'),_0x2fb616,_0x8cb8('0x22'),JSON[_0x8cb8('0x23')](_0x3e90c7));if(_0x3e90c7[_0x8cb8('0x24')]){if(_0x3e90c7[_0x8cb8('0x24')][_0x8cb8('0x25')]===0x1f4){logger[_0x8cb8('0x24')]('Network,\x20%s,\x20%s',_0x2fb616,_0x3e90c7[_0x8cb8('0x24')]['message']);return _0x49c725(_0x3e90c7['error'][_0x8cb8('0x26')]);}logger[_0x8cb8('0x24')](_0x8cb8('0x1f'),_0x2fb616,_0x3e90c7[_0x8cb8('0x24')][_0x8cb8('0x26')]);return _0x22b22e(_0x3e90c7[_0x8cb8('0x24')]['message']);}else{logger[_0x8cb8('0x1e')]('Network,\x20%s,\x20%s',_0x2fb616,'request\x20sent');_0x22b22e(_0x3e90c7['result']['message']);}})[_0x8cb8('0x27')](function(_0x6b4a4d){logger[_0x8cb8('0x24')](_0x8cb8('0x1f'),_0x2fb616,_0x6b4a4d);_0x49c725(_0x6b4a4d);});});}function respondWithStatusCode(_0x9c2f59,_0x3ed330){_0x3ed330=_0x3ed330||0xcc;return function(_0x466199){if(_0x466199){return _0x9c2f59[_0x8cb8('0x28')](_0x3ed330);}return _0x9c2f59[_0x8cb8('0x29')](_0x3ed330)[_0x8cb8('0x2a')]();};}function respondWithResult(_0xb1249c,_0x3c69da){_0x3c69da=_0x3c69da||0xc8;return function(_0x39c6c8){if(_0x39c6c8){return _0xb1249c[_0x8cb8('0x29')](_0x3c69da)[_0x8cb8('0x2b')](_0x39c6c8);}};}function respondWithFilteredResult(_0x34c151,_0x13353c){return function(_0x43e3aa){if(_0x43e3aa){var _0x24147b=typeof _0x13353c[_0x8cb8('0x2c')]===_0x8cb8('0x2d')&&typeof _0x13353c[_0x8cb8('0x2e')]==='undefined';var _0x367ca2=_0x43e3aa[_0x8cb8('0x2f')];var _0xba3765=_0x24147b?0x0:_0x13353c[_0x8cb8('0x2c')];var _0x1fa1b8=_0x24147b?_0x43e3aa[_0x8cb8('0x2f')]:_0x13353c[_0x8cb8('0x2c')]+_0x13353c['limit'];var _0x1790b0;if(_0x1fa1b8>=_0x367ca2){_0x1fa1b8=_0x367ca2;_0x1790b0=0xc8;}else{_0x1790b0=0xce;}_0x34c151[_0x8cb8('0x29')](_0x1790b0);return _0x34c151[_0x8cb8('0x30')](_0x8cb8('0x31'),_0xba3765+'-'+_0x1fa1b8+'/'+_0x367ca2)[_0x8cb8('0x2b')](_0x43e3aa);}return null;};}function patchUpdates(_0x1a29e8){return function(_0x52087c){try{jsonpatch[_0x8cb8('0x32')](_0x52087c,_0x1a29e8,!![]);}catch(_0x55f13c){return BPromise[_0x8cb8('0x33')](_0x55f13c);}return _0x52087c[_0x8cb8('0x34')]();};}function saveUpdates(_0x4c3327,_0x50c283){return function(_0x4359d2){if(_0x4359d2){return _0x4359d2[_0x8cb8('0x35')](_0x4c3327)[_0x8cb8('0x1d')](function(_0x4bfa06){return _0x4bfa06;});}return null;};}function removeEntity(_0x4449ef,_0x2e72a8){return function(_0x57f91a){if(_0x57f91a){return _0x57f91a['destroy']()['then'](function(){_0x4449ef[_0x8cb8('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169609,_0x21ff77){return function(_0x3797c5){if(!_0x3797c5){_0x169609['sendStatus'](0x194);}return _0x3797c5;};}function handleError(_0x550352,_0x18da44){_0x18da44=_0x18da44||0x1f4;return function(_0x38c4d0){logger['error'](_0x38c4d0[_0x8cb8('0x36')]);if(_0x38c4d0[_0x8cb8('0x37')]){delete _0x38c4d0['name'];}_0x550352[_0x8cb8('0x29')](_0x18da44)[_0x8cb8('0x38')](_0x38c4d0);};}exports[_0x8cb8('0x39')]=function(_0x3694a4,_0x5c3bca){var _0x25411f={},_0x12e217={},_0x2baef4={'count':0x0,'rows':[]};var _0x821dff=_['map'](db['Network']['rawAttributes'],function(_0xc1d75f){return{'name':_0xc1d75f['fieldName'],'type':_0xc1d75f['type']['key']};});_0x12e217[_0x8cb8('0x3a')]=_['map'](_0x821dff,'name');_0x12e217['query']=_[_0x8cb8('0x3b')](_0x3694a4[_0x8cb8('0x3c')]);_0x12e217[_0x8cb8('0x3d')]=_[_0x8cb8('0x3e')](_0x12e217[_0x8cb8('0x3a')],_0x12e217['query']);_0x25411f[_0x8cb8('0x3f')]=_[_0x8cb8('0x3e')](_0x12e217[_0x8cb8('0x3a')],qs[_0x8cb8('0x40')](_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x40')]));_0x25411f[_0x8cb8('0x3f')]=_0x25411f[_0x8cb8('0x3f')][_0x8cb8('0x41')]?_0x25411f[_0x8cb8('0x3f')]:_0x12e217[_0x8cb8('0x3a')];if(!_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x42')](_0x8cb8('0x43'))){_0x25411f[_0x8cb8('0x2e')]=qs[_0x8cb8('0x2e')](_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x2e')]);_0x25411f[_0x8cb8('0x2c')]=qs[_0x8cb8('0x2c')](_0x3694a4[_0x8cb8('0x3c')]['offset']);}_0x25411f[_0x8cb8('0x44')]=qs[_0x8cb8('0x45')](_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x45')]);_0x25411f['where']=qs[_0x8cb8('0x3d')](_['pick'](_0x3694a4[_0x8cb8('0x3c')],_0x12e217[_0x8cb8('0x3d')]),_0x821dff);if(_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x46')]){_0x25411f[_0x8cb8('0x47')]=_['merge'](_0x25411f[_0x8cb8('0x47')],{'$or':_[_0x8cb8('0x48')](_0x821dff,function(_0x29374e){if(_0x29374e['type']!==_0x8cb8('0x49')){var _0x3a81e9={};_0x3a81e9[_0x29374e[_0x8cb8('0x37')]]={'$like':'%'+_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x46')]+'%'};return _0x3a81e9;}})});}_0x25411f=_[_0x8cb8('0x4a')]({},_0x25411f,_0x3694a4[_0x8cb8('0x4b')]);var _0x5bb075={'where':_0x25411f[_0x8cb8('0x47')]};return db[_0x8cb8('0x4c')][_0x8cb8('0x2f')](_0x5bb075)['then'](function(_0x9d2f78){_0x2baef4[_0x8cb8('0x2f')]=_0x9d2f78;if(_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x4d')]){_0x25411f['include']=[{'all':!![]}];}return db[_0x8cb8('0x4c')][_0x8cb8('0x4e')](_0x25411f);})[_0x8cb8('0x1d')](function(_0x3464d5){_0x2baef4[_0x8cb8('0x4f')]=_0x3464d5;return _0x2baef4;})[_0x8cb8('0x1d')](respondWithFilteredResult(_0x5c3bca,_0x25411f))[_0x8cb8('0x27')](handleError(_0x5c3bca,null));};exports[_0x8cb8('0x50')]=function(_0x48787c,_0x2a56c9){var _0x1e583b={'raw':!![],'where':{'id':_0x48787c[_0x8cb8('0x51')]['id']}},_0x457d3c={};_0x457d3c[_0x8cb8('0x3a')]=_[_0x8cb8('0x3b')](db[_0x8cb8('0x4c')][_0x8cb8('0x52')]);_0x457d3c['query']=_['keys'](_0x48787c[_0x8cb8('0x3c')]);_0x457d3c[_0x8cb8('0x3d')]=_[_0x8cb8('0x3e')](_0x457d3c[_0x8cb8('0x3a')],_0x457d3c['query']);_0x1e583b['attributes']=_['intersection'](_0x457d3c[_0x8cb8('0x3a')],qs[_0x8cb8('0x40')](_0x48787c['query'][_0x8cb8('0x40')]));_0x1e583b[_0x8cb8('0x3f')]=_0x1e583b[_0x8cb8('0x3f')][_0x8cb8('0x41')]?_0x1e583b['attributes']:_0x457d3c[_0x8cb8('0x3a')];if(_0x48787c[_0x8cb8('0x3c')][_0x8cb8('0x4d')]){_0x1e583b[_0x8cb8('0x53')]=[{'all':!![]}];}_0x1e583b=_[_0x8cb8('0x4a')]({},_0x1e583b,_0x48787c[_0x8cb8('0x4b')]);return db[_0x8cb8('0x4c')][_0x8cb8('0x54')](_0x1e583b)[_0x8cb8('0x1d')](handleEntityNotFound(_0x2a56c9,null))[_0x8cb8('0x1d')](respondWithResult(_0x2a56c9,null))[_0x8cb8('0x27')](handleError(_0x2a56c9,null));};exports[_0x8cb8('0x55')]=function(_0x20e529,_0x40e423,_0x2cdc11){var _0x499236;return db[_0x8cb8('0x56')][_0x8cb8('0x57')](function(_0x48d0d9){return db[_0x8cb8('0x4c')]['create'](_0x20e529[_0x8cb8('0x58')],{'raw':!![]})['then'](function(_0x532d8c){_0x499236=_0x532d8c;return db[_0x8cb8('0x4c')][_0x8cb8('0x4e')]({'where':{'type':_0x20e529[_0x8cb8('0x58')]['type']},'raw':!![]});})[_0x8cb8('0x1d')](function(_0x373401){if(_0x499236[_0x8cb8('0x59')]['toUpperCase']()=='STUN'){var _0x19b249=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x5d')),_0x8cb8('0x5e'));var _0x379325=ejs[_0x8cb8('0x5f')](_0x19b249,{'networks':_0x373401||[]});fs['writeFileSync'](_0x8cb8('0x60'),_0x379325);return respondWithRpcPromise('Reload',_0x8cb8('0x55'),{'module':_0x8cb8('0x61')});}else if(_0x499236[_0x8cb8('0x59')][_0x8cb8('0x62')]()==_0x8cb8('0x63')){var _0x388a07=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x64')),_0x8cb8('0x5e'));var _0x19cd62=ejs[_0x8cb8('0x5f')](_0x388a07,{'networks':_0x373401||[]});fs[_0x8cb8('0x65')](_0x8cb8('0x66'),_0x19cd62);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x55'),{'module':_0x8cb8('0x61')});}else{var _0x2580c9=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],'server/files/templates/network.ejs'),'utf8');var _0x55512f=ejs['render'](_0x2580c9,{'networks':_0x373401||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x20e529['body'][_0x8cb8('0x59')][_0x8cb8('0x68')]()),_0x55512f);return respondWithRpcPromise(_0x8cb8('0x67'),'create',{'module':'chan_sip.so'});}return null;})[_0x8cb8('0x1d')](function(){return _0x499236;});})[_0x8cb8('0x1d')](respondWithResult(_0x40e423,0xc9))['catch'](handleError(_0x40e423,null));};exports[_0x8cb8('0x35')]=function(_0x1ffe12,_0x505695,_0xf4cbca){var _0x445bdb;return db[_0x8cb8('0x56')]['transaction'](function(_0x2edac9){return db[_0x8cb8('0x4c')][_0x8cb8('0x54')]({'where':{'id':_0x1ffe12[_0x8cb8('0x51')]['id']}})[_0x8cb8('0x1d')](handleEntityNotFound(_0x505695,null))['then'](saveUpdates(_0x1ffe12['body'],null))['then'](function(_0x1a0adb){if(_0x1a0adb){_0x445bdb=_0x1a0adb;return db['Network']['findAll']({'where':{'type':_0x445bdb[_0x8cb8('0x59')]},'raw':!![]});}return null;})[_0x8cb8('0x1d')](function(_0x3e324e){if(_0x445bdb[_0x8cb8('0x59')][_0x8cb8('0x62')]()==_0x8cb8('0x69')){var _0xf133f1=fs['readFileSync'](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],'server/files/templates/stun_multiple.ejs'),_0x8cb8('0x5e'));var _0x57cb60=ejs[_0x8cb8('0x5f')](_0xf133f1,{'networks':_0x3e324e||[]});fs[_0x8cb8('0x65')]('/etc/asterisk/stun_xcally.conf',_0x57cb60);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x35'),{'module':_0x8cb8('0x61')});}else if(_0x445bdb[_0x8cb8('0x59')][_0x8cb8('0x62')]()==_0x8cb8('0x63')){var _0x3525ec=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x64')),_0x8cb8('0x5e'));var _0x47a660=ejs[_0x8cb8('0x5f')](_0x3525ec,{'networks':_0x3e324e||[]});fs[_0x8cb8('0x65')](_0x8cb8('0x66'),_0x47a660);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x35'),{'module':_0x8cb8('0x61')});}else{var _0x1a6ea2=fs['readFileSync'](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x6a')),_0x8cb8('0x5e'));var _0x4591a2=ejs[_0x8cb8('0x5f')](_0x1a6ea2,{'networks':_0x3e324e||[]});fs[_0x8cb8('0x65')](util[_0x8cb8('0x6b')](_0x8cb8('0x6c'),_0x1ffe12['body'][_0x8cb8('0x59')][_0x8cb8('0x68')]()),_0x4591a2);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x35'),{'module':_0x8cb8('0x6d')});}return null;})[_0x8cb8('0x1d')](function(_0x5a1f9c){if(_0x5a1f9c){return _0x445bdb;}return null;});})[_0x8cb8('0x1d')](respondWithResult(_0x505695,null))[_0x8cb8('0x27')](handleError(_0x505695,null));};exports[_0x8cb8('0x6e')]=function(_0x8f9f56,_0x375334,_0x52b5b1){var _0x1f7b43;return db[_0x8cb8('0x4c')][_0x8cb8('0x54')]({'where':{'id':_0x8f9f56[_0x8cb8('0x51')]['id']}})[_0x8cb8('0x1d')](function(_0x35af36){_0x1f7b43=_0x35af36;return _0x35af36;})[_0x8cb8('0x1d')](handleEntityNotFound(_0x375334,null))[_0x8cb8('0x1d')](removeEntity(_0x375334,null))['then'](function(){if(_0x1f7b43){return db[_0x8cb8('0x4c')][_0x8cb8('0x4e')]({'where':{'type':_0x1f7b43[_0x8cb8('0x59')]},'raw':!![]});}})[_0x8cb8('0x1d')](function(_0x20b6e8){if(_0x1f7b43['type']['toUpperCase']()==_0x8cb8('0x69')){var _0x252f01=fs['readFileSync'](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x5d')),'utf8');var _0x426886=ejs[_0x8cb8('0x5f')](_0x252f01,{'networks':_0x20b6e8||[]});fs[_0x8cb8('0x65')](_0x8cb8('0x60'),_0x426886);return respondWithRpcPromise('Reload',_0x8cb8('0x6e'),{'module':_0x8cb8('0x61')});}else if(_0x1f7b43[_0x8cb8('0x59')][_0x8cb8('0x62')]()==_0x8cb8('0x63')){var _0x1ec153=fs[_0x8cb8('0x5a')](path['join'](config[_0x8cb8('0x5c')],_0x8cb8('0x64')),_0x8cb8('0x5e'));var _0x4efa5b=ejs[_0x8cb8('0x5f')](_0x1ec153,{'networks':_0x20b6e8||[]});fs['writeFileSync'](_0x8cb8('0x66'),_0x4efa5b);return respondWithRpcPromise(_0x8cb8('0x67'),'destroy',{'module':_0x8cb8('0x61')});}else{var _0x251bee=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x6a')),_0x8cb8('0x5e'));var _0x4a6e00=ejs[_0x8cb8('0x5f')](_0x251bee,{'networks':_0x20b6e8||[]});fs[_0x8cb8('0x65')](util['format'](_0x8cb8('0x6c'),_0x8f9f56[_0x8cb8('0x58')][_0x8cb8('0x59')]['toLowerCase']()),_0x4a6e00);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x6e'),{'module':'chan_sip.so'});}return null;})[_0x8cb8('0x27')](handleError(_0x375334,null));};
\ No newline at end of file
index c16f272..b63bf51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0565=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x19b370,_0x4e705e){var _0x5b50c5=function(_0x4e0eb6){while(--_0x4e0eb6){_0x19b370['push'](_0x19b370['shift']());}};_0x5b50c5(++_0x4e705e);}(_0x0565,0xf2));var _0x5056=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x0565[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var moment=require(_0x5056('0x4'));var BPromise=require(_0x5056('0x5'));var rp=require(_0x5056('0x6'));var fs=require('fs');var path=require(_0x5056('0x7'));var rimraf=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var attributes=require('./network.attributes');module[_0x5056('0xa')]=function(_0x105ea8,_0x1143df){return _0x105ea8[_0x5056('0xb')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2504=['../../config/environment','./network.attributes','exports','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x2504,0xee));var _0x4250=function(_0x3602f4,_0xd49cdb){_0x3602f4=_0x3602f4-0x0;var _0x266499=_0x2504[_0x3602f4];return _0x266499;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var logger=require(_0x4250('0x2'))(_0x4250('0x3'));var moment=require(_0x4250('0x4'));var BPromise=require(_0x4250('0x5'));var rp=require(_0x4250('0x6'));var fs=require('fs');var path=require(_0x4250('0x7'));var rimraf=require(_0x4250('0x8'));var config=require(_0x4250('0x9'));var attributes=require(_0x4250('0xa'));module[_0x4250('0xb')]=function(_0x493da9,_0x473cb8){return _0x493da9['define']('Network',attributes,{'tableName':_0x4250('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9b69826..02757f9 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(_0x371653,_0x1bcceb){var _0x44bfec=function(_0x1500c7){while(--_0x1500c7){_0x371653['push'](_0x371653['shift']());}};_0x44bfec(++_0x1bcceb);}(_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 _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(_0x6f21f4,_0x5388c2){var _0x28933f=function(_0x105848){while(--_0x105848){_0x6f21f4['push'](_0x6f21f4['shift']());}};_0x28933f(++_0x5388c2);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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
index c8edf26..cb8416d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x508f=['../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','/:id/dispositions','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x9e575,_0x5894d4){var _0x522277=function(_0x1f5458){while(--_0x1f5458){_0x9e575['push'](_0x9e575['shift']());}};_0x522277(++_0x5894d4);}(_0x508f,0x1d8));var _0xf508=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x508f[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xf508('0x0'));var util=require(_0xf508('0x1'));var path=require(_0xf508('0x2'));var timeout=require(_0xf508('0x3'));var express=require(_0xf508('0x4'));var router=express[_0xf508('0x5')]();var fs_extra=require(_0xf508('0x6'));var auth=require(_0xf508('0x7'));var interaction=require(_0xf508('0x8'));var config=require(_0xf508('0x9'));var controller=require(_0xf508('0xa'));router[_0xf508('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf508('0xb')](_0xf508('0xc'),auth[_0xf508('0xd')](),controller[_0xf508('0xe')]);router[_0xf508('0xb')](_0xf508('0xf'),auth[_0xf508('0xd')](),controller[_0xf508('0x10')]);router[_0xf508('0xb')]('/:id/dispositions',auth[_0xf508('0xd')](),controller[_0xf508('0x11')]);router[_0xf508('0xb')](_0xf508('0x12'),auth['isAuthenticated'](),controller[_0xf508('0x13')]);router[_0xf508('0xb')](_0xf508('0x14'),auth[_0xf508('0xd')](),controller['getApplications']);router[_0xf508('0xb')](_0xf508('0x15'),auth[_0xf508('0xd')](),controller[_0xf508('0x16')]);router[_0xf508('0xb')](_0xf508('0x17'),auth[_0xf508('0xd')](),controller[_0xf508('0x18')]);router['post']('/',auth[_0xf508('0xd')](),controller['create']);router[_0xf508('0x19')](_0xf508('0x1a'),auth[_0xf508('0xd')](),controller['addDisposition']);router[_0xf508('0x19')](_0xf508('0x12'),auth['isAuthenticated'](),controller[_0xf508('0x1b')]);router[_0xf508('0x19')]('/:id/notify',controller[_0xf508('0x1c')]);router[_0xf508('0x19')](_0xf508('0x14'),auth[_0xf508('0xd')](),controller[_0xf508('0x1d')]);router['post']('/:id/users',auth[_0xf508('0xd')](),controller[_0xf508('0x1e')]);router[_0xf508('0x19')](_0xf508('0x1f'),auth[_0xf508('0xd')](),controller[_0xf508('0x20')]);router[_0xf508('0x21')](_0xf508('0xf'),auth[_0xf508('0xd')](),controller[_0xf508('0x22')]);router[_0xf508('0x23')](_0xf508('0xf'),auth['isAuthenticated'](),controller[_0xf508('0x24')]);router[_0xf508('0x23')](_0xf508('0x1a'),auth[_0xf508('0xd')](),controller[_0xf508('0x25')]);router[_0xf508('0x23')](_0xf508('0x12'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xf508('0x23')]('/:id/users',auth[_0xf508('0xd')](),controller[_0xf508('0x26')]);module[_0xf508('0x27')]=router;
\ No newline at end of file
+var _0x9ca3=['removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','put','update','delete'];(function(_0x16ad4c,_0x7a1daa){var _0x2eec11=function(_0x15e717){while(--_0x15e717){_0x16ad4c['push'](_0x16ad4c['shift']());}};_0x2eec11(++_0x7a1daa);}(_0x9ca3,0x134));var _0x39ca=function(_0x1fc3b5,_0x37fa95){_0x1fc3b5=_0x1fc3b5-0x0;var _0x18a56c=_0x9ca3[_0x1fc3b5];return _0x18a56c;};'use strict';var multer=require(_0x39ca('0x0'));var util=require(_0x39ca('0x1'));var path=require(_0x39ca('0x2'));var timeout=require(_0x39ca('0x3'));var express=require(_0x39ca('0x4'));var router=express[_0x39ca('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x39ca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x39ca('0x7'));var controller=require('./openchannelAccount.controller');router[_0x39ca('0x8')]('/',auth[_0x39ca('0x9')](),controller[_0x39ca('0xa')]);router[_0x39ca('0x8')](_0x39ca('0xb'),auth[_0x39ca('0x9')](),controller['describe']);router['get'](_0x39ca('0xc'),auth[_0x39ca('0x9')](),controller[_0x39ca('0xd')]);router[_0x39ca('0x8')](_0x39ca('0xe'),auth[_0x39ca('0x9')](),controller[_0x39ca('0xf')]);router[_0x39ca('0x8')]('/:id/canned_answers',auth[_0x39ca('0x9')](),controller[_0x39ca('0x10')]);router[_0x39ca('0x8')](_0x39ca('0x11'),auth[_0x39ca('0x9')](),controller[_0x39ca('0x12')]);router[_0x39ca('0x8')](_0x39ca('0x13'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x39ca('0x8')](_0x39ca('0x14'),auth[_0x39ca('0x9')](),controller[_0x39ca('0x15')]);router[_0x39ca('0x16')]('/',auth[_0x39ca('0x9')](),controller['create']);router[_0x39ca('0x16')]('/:id/dispositions',auth[_0x39ca('0x9')](),controller[_0x39ca('0x17')]);router[_0x39ca('0x16')](_0x39ca('0x18'),auth[_0x39ca('0x9')](),controller[_0x39ca('0x19')]);router[_0x39ca('0x16')](_0x39ca('0x1a'),controller[_0x39ca('0x1b')]);router[_0x39ca('0x16')]('/:id/applications',auth[_0x39ca('0x9')](),controller[_0x39ca('0x1c')]);router[_0x39ca('0x16')](_0x39ca('0x14'),auth[_0x39ca('0x9')](),controller[_0x39ca('0x1d')]);router['post'](_0x39ca('0x1e'),auth[_0x39ca('0x9')](),controller['send']);router[_0x39ca('0x1f')](_0x39ca('0xc'),auth['isAuthenticated'](),controller[_0x39ca('0x20')]);router[_0x39ca('0x21')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x39ca('0x21')]('/:id/dispositions',auth[_0x39ca('0x9')](),controller[_0x39ca('0x22')]);router[_0x39ca('0x21')]('/:id/canned_answers',auth[_0x39ca('0x9')](),controller[_0x39ca('0x23')]);router[_0x39ca('0x21')]('/:id/users',auth[_0x39ca('0x9')](),controller[_0x39ca('0x24')]);module[_0x39ca('0x25')]=router;
\ No newline at end of file
index c59024b..4476c87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5601=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','BOOLEAN','INTEGER'];(function(_0x15a3b3,_0x266dc1){var _0x3211be=function(_0x1e1b2f){while(--_0x1e1b2f){_0x15a3b3['push'](_0x15a3b3['shift']());}};_0x3211be(++_0x266dc1);}(_0x5601,0x12e));var _0x1560=function(_0x29d2e1,_0x465471){_0x29d2e1=_0x29d2e1-0x0;var _0x5ebc7f=_0x5601[_0x29d2e1];return _0x5ebc7f;};'use strict';var Sequelize=require(_0x1560('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x1560('0x1')],'unique':_0x1560('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1560('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1560('0x3')]();}},'replyUri':{'type':Sequelize[_0x1560('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1560('0x1')],'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[_0x1560('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1560('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1560('0x1')]},'queueTransfer':{'type':Sequelize[_0x1560('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1560('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1560('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1560('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1560('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x1560('0x4')],'defaultValue':![],'comment':_0x1560('0x7'),'set':function(_0x3ee6de){if(!_0x3ee6de)this[_0x1560('0x8')](_0x1560('0x9'),null);this[_0x1560('0x8')](_0x1560('0xa'),_0x3ee6de);}}};
\ No newline at end of file
+var _0x3fc0=['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','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x41ffdb,_0x212ee2){var _0x2e1dad=function(_0x2f735b){while(--_0x2f735b){_0x41ffdb['push'](_0x41ffdb['shift']());}};_0x2e1dad(++_0x212ee2);}(_0x3fc0,0x1ab));var _0x03fc=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x3fc0[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x03fc('0x0'));var rs=require(_0x03fc('0x1'));module[_0x03fc('0x2')]={'name':{'type':Sequelize[_0x03fc('0x3')],'unique':_0x03fc('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x03fc('0x3')],'defaultValue':function(){return rs[_0x03fc('0x5')]();}},'replyUri':{'type':Sequelize[_0x03fc('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x03fc('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x03fc('0x6')],'defaultValue':function(){return _0x03fc('0x7');}},'notificationSound':{'type':Sequelize[_0x03fc('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x03fc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x03fc('0x3')]},'queueTransfer':{'type':Sequelize[_0x03fc('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x03fc('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x03fc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x03fc('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x03fc('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x03fc('0x8')],'defaultValue':![],'comment':_0x03fc('0xb'),'set':function(_0x5e305e){if(!_0x5e305e)this[_0x03fc('0xc')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x03fc('0xd'),_0x5e305e);}}};
\ No newline at end of file
index 7da3e4a..344ee32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7bc=['sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','send','index','Pause','map','OpenchannelAccount','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','body','mandatoryDispositionPause','describe','Disposition','getDispositions','findOne','rawAttributes','hasOwnProperty','OpenchannelAccountId','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','notify','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','Owner','fullname','internal','Tag','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','Messages','dataValues','rimraf','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x39736a,_0x2536df){var _0xc2f741=function(_0x9f6848){while(--_0x9f6848){_0x39736a['push'](_0x39736a['shift']());}};_0xc2f741(++_0x2536df);}(_0xa7bc,0x147));var _0xca7b=function(_0x51ee8f,_0x31c8ff){_0x51ee8f=_0x51ee8f-0x0;var _0x5d5478=_0xa7bc[_0x51ee8f];return _0x5d5478;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca7b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xca7b('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xca7b('0x2'));var util=require(_0xca7b('0x3'));var path=require(_0xca7b('0x4'));var sox=require(_0xca7b('0x5'));var csv=require('to-csv');var ejs=require(_0xca7b('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca7b('0x7'));var squel=require(_0xca7b('0x8'));var crypto=require(_0xca7b('0x9'));var jsforce=require(_0xca7b('0xa'));var deskjs=require(_0xca7b('0xb'));var toCsv=require(_0xca7b('0xc'));var querystring=require(_0xca7b('0xd'));var Papa=require(_0xca7b('0xe'));var Redis=require('ioredis');var authService=require(_0xca7b('0xf'));var qs=require(_0xca7b('0x10'));var as=require(_0xca7b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca7b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xca7b('0x13'));var licenseUtil=require(_0xca7b('0x14'));var db=require(_0xca7b('0x15'))['db'];config[_0xca7b('0x16')]=_['defaults'](config[_0xca7b('0x16')],{'host':_0xca7b('0x17'),'port':0x18eb});var socket=require(_0xca7b('0x18'))(new Redis(config[_0xca7b('0x16')]));require('./openchannelAccount.socket')[_0xca7b('0x19')](socket);var jayson=require(_0xca7b('0x1a'));var client=jayson[_0xca7b('0x1b')][_0xca7b('0x1c')]({'port':0x232c});var client9002=jayson[_0xca7b('0x1b')][_0xca7b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1ec46f,_0x28bce0,_0x12ca22,_0x3c4153){return new BPromise(function(_0xf442b6,_0x19b909){var _0x43549a=_0x3c4153||client;return _0x43549a['request'](_0x1ec46f,_0x12ca22)[_0xca7b('0x1d')](function(_0x5d6284){logger[_0xca7b('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x28bce0,'request\x20sent');logger[_0xca7b('0x1f')](_0xca7b('0x20'),_0x28bce0,'request\x20sent',JSON['stringify'](_0x5d6284));if(_0x5d6284[_0xca7b('0x21')]){if(_0x5d6284[_0xca7b('0x21')]['code']===0x1f4){logger[_0xca7b('0x21')](_0xca7b('0x22'),_0x28bce0,_0x5d6284['error'][_0xca7b('0x23')]);return _0x19b909(_0x5d6284[_0xca7b('0x21')][_0xca7b('0x23')]);}logger[_0xca7b('0x21')](_0xca7b('0x22'),_0x28bce0,_0x5d6284[_0xca7b('0x21')]['message']);return _0xf442b6(_0x5d6284[_0xca7b('0x21')][_0xca7b('0x23')]);}else{logger[_0xca7b('0x1e')](_0xca7b('0x22'),_0x28bce0,_0xca7b('0x24'));_0xf442b6(_0x5d6284[_0xca7b('0x25')][_0xca7b('0x23')]);}})[_0xca7b('0x26')](function(_0x46e579){logger[_0xca7b('0x21')](_0xca7b('0x22'),_0x28bce0,_0x46e579);_0x19b909(_0x46e579);});});}function respondWithStatusCode(_0x18c6e0,_0x419b90){_0x419b90=_0x419b90||0xcc;return function(_0x17c644){if(_0x17c644){return _0x18c6e0[_0xca7b('0x27')](_0x419b90);}return _0x18c6e0['status'](_0x419b90)[_0xca7b('0x28')]();};}function respondWithResult(_0x57b527,_0x3d21f5){_0x3d21f5=_0x3d21f5||0xc8;return function(_0x19f803){if(_0x19f803){return _0x57b527[_0xca7b('0x29')](_0x3d21f5)[_0xca7b('0x2a')](_0x19f803);}};}function respondWithFilteredResult(_0x163226,_0x5b2968){return function(_0x3fa904){if(_0x3fa904){var _0x3a76b4=typeof _0x5b2968['offset']===_0xca7b('0x2b')&&typeof _0x5b2968[_0xca7b('0x2c')]===_0xca7b('0x2b');var _0x2e6a91=_0x3fa904[_0xca7b('0x2d')];var _0x4ecfed=_0x3a76b4?0x0:_0x5b2968[_0xca7b('0x2e')];var _0x2e1d25=_0x3a76b4?_0x3fa904[_0xca7b('0x2d')]:_0x5b2968[_0xca7b('0x2e')]+_0x5b2968[_0xca7b('0x2c')];var _0x3f56c1;if(_0x2e1d25>=_0x2e6a91){_0x2e1d25=_0x2e6a91;_0x3f56c1=0xc8;}else{_0x3f56c1=0xce;}_0x163226[_0xca7b('0x29')](_0x3f56c1);return _0x163226[_0xca7b('0x2f')](_0xca7b('0x30'),_0x4ecfed+'-'+_0x2e1d25+'/'+_0x2e6a91)[_0xca7b('0x2a')](_0x3fa904);}return null;};}function patchUpdates(_0x5dc740){return function(_0x5262c4){try{jsonpatch['apply'](_0x5262c4,_0x5dc740,!![]);}catch(_0x49a10b){return BPromise[_0xca7b('0x31')](_0x49a10b);}return _0x5262c4[_0xca7b('0x32')]();};}function saveUpdates(_0x612a09,_0x46d343){return function(_0x43b8b9){if(_0x43b8b9){return _0x43b8b9[_0xca7b('0x33')](_0x612a09)['then'](function(_0x433514){return _0x433514;});}return null;};}function removeEntity(_0x281846,_0x1f617a){return function(_0x5b10de){if(_0x5b10de){return _0x5b10de[_0xca7b('0x34')]()[_0xca7b('0x1d')](function(){var _0x4d9170=_0x5b10de[_0xca7b('0x35')]({'plain':!![]});var _0xfe8832=_0xca7b('0x36');return db[_0xca7b('0x37')][_0xca7b('0x34')]({'where':{'type':_0xfe8832,'resourceId':_0x4d9170['id']}})[_0xca7b('0x1d')](function(){return _0x5b10de;});})[_0xca7b('0x1d')](function(){_0x281846[_0xca7b('0x29')](0xcc)[_0xca7b('0x28')]();});}};}function handleEntityNotFound(_0x48efc2,_0x344ba5){return function(_0x60cea0){if(!_0x60cea0){_0x48efc2[_0xca7b('0x27')](0x194);}return _0x60cea0;};}function handleError(_0x181b4c,_0x48a48c){_0x48a48c=_0x48a48c||0x1f4;return function(_0x5de14d){logger['error'](_0x5de14d['stack']);if(_0x5de14d['name']){delete _0x5de14d['name'];}_0x181b4c['status'](_0x48a48c)[_0xca7b('0x38')](_0x5de14d);};}exports[_0xca7b('0x39')]=function(_0x5430e9,_0x58e654){var _0x4a33e6={'include':[{'model':db[_0xca7b('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1def74={},_0x3f4bac={'count':0x0,'rows':[]};var _0x306525=_[_0xca7b('0x3b')](db[_0xca7b('0x3c')]['rawAttributes'],function(_0x396ebd){return{'name':_0x396ebd[_0xca7b('0x3d')],'type':_0x396ebd[_0xca7b('0x3e')][_0xca7b('0x3f')]};});_0x1def74['model']=_['map'](_0x306525,_0xca7b('0x40'));_0x1def74[_0xca7b('0x41')]=_[_0xca7b('0x42')](_0x5430e9[_0xca7b('0x41')]);_0x1def74[_0xca7b('0x43')]=_[_0xca7b('0x44')](_0x1def74[_0xca7b('0x45')],_0x1def74[_0xca7b('0x41')]);_0x4a33e6[_0xca7b('0x46')]=_[_0xca7b('0x44')](_0x1def74[_0xca7b('0x45')],qs[_0xca7b('0x47')](_0x5430e9[_0xca7b('0x41')][_0xca7b('0x47')]));_0x4a33e6['attributes']=_0x4a33e6[_0xca7b('0x46')][_0xca7b('0x48')]?_0x4a33e6[_0xca7b('0x46')]:_0x1def74[_0xca7b('0x45')];if(!_0x5430e9['query']['hasOwnProperty'](_0xca7b('0x49'))){_0x4a33e6[_0xca7b('0x2c')]=qs[_0xca7b('0x2c')](_0x5430e9[_0xca7b('0x41')][_0xca7b('0x2c')]);_0x4a33e6[_0xca7b('0x2e')]=qs[_0xca7b('0x2e')](_0x5430e9[_0xca7b('0x41')][_0xca7b('0x2e')]);}_0x4a33e6[_0xca7b('0x4a')]=qs[_0xca7b('0x4b')](_0x5430e9[_0xca7b('0x41')][_0xca7b('0x4b')]);_0x4a33e6[_0xca7b('0x4c')]=qs['filters'](_[_0xca7b('0x4d')](_0x5430e9['query'],_0x1def74[_0xca7b('0x43')]),_0x306525);if(_0x5430e9[_0xca7b('0x41')][_0xca7b('0x4e')]){_0x4a33e6[_0xca7b('0x4c')]=_['merge'](_0x4a33e6[_0xca7b('0x4c')],{'$or':_['map'](_0x306525,function(_0x2a5bcf){if(_0x2a5bcf[_0xca7b('0x3e')]!==_0xca7b('0x4f')){var _0x27f5e2={};_0x27f5e2[_0x2a5bcf[_0xca7b('0x40')]]={'$like':'%'+_0x5430e9['query'][_0xca7b('0x4e')]+'%'};return _0x27f5e2;}})});}_0x4a33e6=_[_0xca7b('0x50')]({},_0x4a33e6,_0x5430e9[_0xca7b('0x51')]);var _0x108580={'where':_0x4a33e6[_0xca7b('0x4c')]};return db[_0xca7b('0x3c')][_0xca7b('0x2d')](_0x108580)[_0xca7b('0x1d')](function(_0x4a4725){_0x3f4bac[_0xca7b('0x2d')]=_0x4a4725;if(_0x5430e9[_0xca7b('0x41')]['includeAll']){_0x4a33e6[_0xca7b('0x52')]=[{'all':!![]}];}return db[_0xca7b('0x3c')]['findAll'](_0x4a33e6);})[_0xca7b('0x1d')](function(_0x2438f1){_0x3f4bac['rows']=_0x2438f1;return _0x3f4bac;})[_0xca7b('0x1d')](respondWithFilteredResult(_0x58e654,_0x4a33e6))['catch'](handleError(_0x58e654,null));};exports[_0xca7b('0x53')]=function(_0x362765,_0xb52f92){var _0x30f451={'raw':![],'where':{'id':_0x362765[_0xca7b('0x54')]['id']},'include':[{'model':db[_0xca7b('0x3a')],'as':'mandatoryDispositionPause'}]},_0x50ec6d={};_0x50ec6d[_0xca7b('0x45')]=_[_0xca7b('0x42')](db[_0xca7b('0x3c')]['rawAttributes']);_0x50ec6d[_0xca7b('0x41')]=_['keys'](_0x362765[_0xca7b('0x41')]);_0x50ec6d[_0xca7b('0x43')]=_['intersection'](_0x50ec6d[_0xca7b('0x45')],_0x50ec6d['query']);_0x30f451[_0xca7b('0x46')]=_['intersection'](_0x50ec6d[_0xca7b('0x45')],qs[_0xca7b('0x47')](_0x362765['query'][_0xca7b('0x47')]));_0x30f451[_0xca7b('0x46')]=_0x30f451[_0xca7b('0x46')][_0xca7b('0x48')]?_0x30f451[_0xca7b('0x46')]:_0x50ec6d[_0xca7b('0x45')];if(_0x362765[_0xca7b('0x41')][_0xca7b('0x55')]){_0x30f451[_0xca7b('0x52')]=[{'all':!![]}];}_0x30f451=_[_0xca7b('0x50')]({},_0x30f451,_0x362765['options']);return db[_0xca7b('0x3c')][_0xca7b('0x56')](_0x30f451)[_0xca7b('0x1d')](handleEntityNotFound(_0xb52f92,null))[_0xca7b('0x1d')](respondWithResult(_0xb52f92,null))[_0xca7b('0x26')](handleError(_0xb52f92,null));};exports[_0xca7b('0x57')]=function(_0x24f43d,_0x335dd7){return db[_0xca7b('0x3c')][_0xca7b('0x57')](_0x24f43d['body'],{})['then'](function(_0x552b04){var _0x2e7c52=_0x24f43d[_0xca7b('0x58')][_0xca7b('0x35')]({'plain':!![]});if(!_0x2e7c52)throw new Error(_0xca7b('0x59'));if(_0x2e7c52[_0xca7b('0x5a')]===_0xca7b('0x58')){var _0x18a7f7=_0x552b04[_0xca7b('0x35')]({'plain':!![]});var _0x1829e8='OpenchannelAccounts';return db['UserProfileSection'][_0xca7b('0x56')]({'where':{'name':_0x1829e8,'userProfileId':_0x2e7c52[_0xca7b('0x5b')]},'raw':!![]})[_0xca7b('0x1d')](function(_0xde5831){if(_0xde5831&&_0xde5831['autoAssociation']===0x0){return db[_0xca7b('0x37')][_0xca7b('0x57')]({'name':_0x18a7f7[_0xca7b('0x40')],'resourceId':_0x18a7f7['id'],'type':_0xde5831[_0xca7b('0x40')],'sectionId':_0xde5831['id']},{})[_0xca7b('0x1d')](function(){return _0x552b04;});}else{return _0x552b04;}})['catch'](function(_0x5a9ae2){logger[_0xca7b('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a9ae2);throw _0x5a9ae2;});}return _0x552b04;})[_0xca7b('0x1d')](respondWithResult(_0x335dd7,0xc9))[_0xca7b('0x26')](handleError(_0x335dd7,null));};exports['update']=function(_0x1edf52,_0x1ecfe0){if(_0x1edf52['body']['id']){delete _0x1edf52[_0xca7b('0x5c')]['id'];}return db[_0xca7b('0x3c')]['find']({'where':{'id':_0x1edf52[_0xca7b('0x54')]['id']},'include':[{'model':db[_0xca7b('0x3a')],'as':_0xca7b('0x5d')}]})['then'](handleEntityNotFound(_0x1ecfe0,null))['then'](saveUpdates(_0x1edf52[_0xca7b('0x5c')],null))['then'](respondWithResult(_0x1ecfe0,null))[_0xca7b('0x26')](handleError(_0x1ecfe0,null));};exports[_0xca7b('0x34')]=function(_0x434f24,_0x15fe77){return db['OpenchannelAccount'][_0xca7b('0x56')]({'where':{'id':_0x434f24[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x15fe77,null))['then'](removeEntity(_0x15fe77,null))['catch'](handleError(_0x15fe77,null));};exports[_0xca7b('0x5e')]=function(_0x59ffb4,_0x57e339){return db[_0xca7b('0x3c')][_0xca7b('0x5e')]()[_0xca7b('0x1d')](respondWithResult(_0x57e339,null))['catch'](handleError(_0x57e339,null));};exports['addDisposition']=function(_0x58f67b,_0x525873,_0xf6370a){if(_0x58f67b['body']['id']){delete _0x58f67b[_0xca7b('0x5c')]['id'];}return db[_0xca7b('0x3c')][_0xca7b('0x56')]({'where':{'id':_0x58f67b[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x525873,null))[_0xca7b('0x1d')](function(_0x1152c8){if(_0x1152c8){_0x58f67b[_0xca7b('0x5c')]['OpenchannelAccountId']=_0x1152c8['id'];return db[_0xca7b('0x5f')][_0xca7b('0x57')](_0x58f67b[_0xca7b('0x5c')]);}})['then'](respondWithResult(_0x525873,null))[_0xca7b('0x26')](handleError(_0x525873,null));};exports[_0xca7b('0x60')]=function(_0x154464,_0x1deeda,_0x56be12){var _0x5ea8dc={'raw':![],'where':{}};var _0x3b2651={};var _0x3c9b69={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xca7b('0x61')]({'where':{'id':_0x154464[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x1deeda,null))[_0xca7b('0x1d')](function(_0x19997d){if(_0x19997d){_0x3b2651[_0xca7b('0x45')]=_[_0xca7b('0x42')](db[_0xca7b('0x5f')][_0xca7b('0x62')]);_0x3b2651[_0xca7b('0x41')]=_[_0xca7b('0x42')](_0x154464['query']);_0x3b2651[_0xca7b('0x43')]=_[_0xca7b('0x44')](_0x3b2651[_0xca7b('0x45')],_0x3b2651[_0xca7b('0x41')]);_0x5ea8dc['attributes']=_['intersection'](_0x3b2651[_0xca7b('0x45')],qs['fields'](_0x154464[_0xca7b('0x41')][_0xca7b('0x47')]));_0x5ea8dc[_0xca7b('0x46')]=_0x5ea8dc[_0xca7b('0x46')][_0xca7b('0x48')]?_0x5ea8dc[_0xca7b('0x46')]:_0x3b2651[_0xca7b('0x45')];if(!_0x154464['query'][_0xca7b('0x63')](_0xca7b('0x49'))){_0x5ea8dc[_0xca7b('0x2c')]=qs[_0xca7b('0x2c')](_0x154464[_0xca7b('0x41')][_0xca7b('0x2c')]);_0x5ea8dc[_0xca7b('0x2e')]=qs[_0xca7b('0x2e')](_0x154464[_0xca7b('0x41')][_0xca7b('0x2e')]);}_0x5ea8dc[_0xca7b('0x4a')]=qs[_0xca7b('0x4b')](_0x154464['query'][_0xca7b('0x4b')]);_0x5ea8dc['where']=qs[_0xca7b('0x43')](_[_0xca7b('0x4d')](_0x154464[_0xca7b('0x41')],_0x3b2651[_0xca7b('0x43')]));_0x5ea8dc['where'][_0xca7b('0x64')]=_0x19997d['id'];if(_0x154464[_0xca7b('0x41')][_0xca7b('0x4e')]){_0x5ea8dc[_0xca7b('0x4c')]=_[_0xca7b('0x50')](_0x5ea8dc['where'],{'$or':_[_0xca7b('0x3b')](_0x5ea8dc[_0xca7b('0x46')],function(_0x159db1){var _0x4e7ec7={};_0x4e7ec7[_0x159db1]={'$like':'%'+_0x154464[_0xca7b('0x41')][_0xca7b('0x4e')]+'%'};return _0x4e7ec7;})});}_0x5ea8dc=_['merge']({},_0x5ea8dc,_0x154464['options']);return db[_0xca7b('0x5f')][_0xca7b('0x2d')]({'where':_0x5ea8dc[_0xca7b('0x4c')]})[_0xca7b('0x1d')](function(_0x423a99){_0x3c9b69[_0xca7b('0x2d')]=_0x423a99;if(_0x154464[_0xca7b('0x41')][_0xca7b('0x55')]){_0x5ea8dc[_0xca7b('0x52')]=[{'all':!![]}];}return db['Disposition'][_0xca7b('0x65')](_0x5ea8dc);})[_0xca7b('0x1d')](function(_0x43c8b9){_0x3c9b69[_0xca7b('0x66')]=_0x43c8b9;return _0x3c9b69;});}})[_0xca7b('0x1d')](respondWithFilteredResult(_0x1deeda,_0x5ea8dc))['catch'](handleError(_0x1deeda,null));};exports[_0xca7b('0x67')]=function(_0x464b2f,_0x532f27,_0x4f9b34){return db[_0xca7b('0x3c')]['find']({'where':{'id':_0x464b2f[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x532f27,null))[_0xca7b('0x1d')](function(_0x1c1a32){if(_0x1c1a32){return _0x1c1a32[_0xca7b('0x67')](_0x464b2f[_0xca7b('0x41')][_0xca7b('0x68')]);}})[_0xca7b('0x1d')](respondWithStatusCode(_0x532f27,null))[_0xca7b('0x26')](handleError(_0x532f27,null));};exports[_0xca7b('0x69')]=function(_0x57f167,_0x402df0,_0x226603){if(_0x57f167[_0xca7b('0x5c')]['id']){delete _0x57f167[_0xca7b('0x5c')]['id'];}return db[_0xca7b('0x3c')][_0xca7b('0x56')]({'where':{'id':_0x57f167[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x402df0,null))['then'](function(_0x2455c6){if(_0x2455c6){_0x57f167[_0xca7b('0x5c')]['OpenchannelAccountId']=_0x2455c6['id'];return db[_0xca7b('0x6a')][_0xca7b('0x57')](_0x57f167[_0xca7b('0x5c')]);}})[_0xca7b('0x1d')](respondWithResult(_0x402df0,null))[_0xca7b('0x26')](handleError(_0x402df0,null));};exports[_0xca7b('0x6b')]=function(_0x208d4c,_0xf638b1,_0x18bda6){var _0x54ed83={'raw':![],'where':{}};var _0x212142={};var _0x183fcc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xca7b('0x61')]({'where':{'id':_0x208d4c['params']['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0xf638b1,null))[_0xca7b('0x1d')](function(_0x4480fa){if(_0x4480fa){_0x212142[_0xca7b('0x45')]=_[_0xca7b('0x42')](db['CannedAnswer'][_0xca7b('0x62')]);_0x212142[_0xca7b('0x41')]=_[_0xca7b('0x42')](_0x208d4c[_0xca7b('0x41')]);_0x212142['filters']=_[_0xca7b('0x44')](_0x212142[_0xca7b('0x45')],_0x212142[_0xca7b('0x41')]);_0x54ed83[_0xca7b('0x46')]=_['intersection'](_0x212142['model'],qs[_0xca7b('0x47')](_0x208d4c[_0xca7b('0x41')][_0xca7b('0x47')]));_0x54ed83[_0xca7b('0x46')]=_0x54ed83[_0xca7b('0x46')]['length']?_0x54ed83['attributes']:_0x212142[_0xca7b('0x45')];if(!_0x208d4c[_0xca7b('0x41')][_0xca7b('0x63')](_0xca7b('0x49'))){_0x54ed83[_0xca7b('0x2c')]=qs['limit'](_0x208d4c[_0xca7b('0x41')]['limit']);_0x54ed83[_0xca7b('0x2e')]=qs[_0xca7b('0x2e')](_0x208d4c[_0xca7b('0x41')][_0xca7b('0x2e')]);}_0x54ed83['order']=qs[_0xca7b('0x4b')](_0x208d4c[_0xca7b('0x41')][_0xca7b('0x4b')]);_0x54ed83[_0xca7b('0x4c')]=qs[_0xca7b('0x43')](_[_0xca7b('0x4d')](_0x208d4c['query'],_0x212142['filters']));_0x54ed83[_0xca7b('0x4c')]['OpenchannelAccountId']=_0x4480fa['id'];if(_0x208d4c[_0xca7b('0x41')][_0xca7b('0x4e')]){_0x54ed83[_0xca7b('0x4c')]=_[_0xca7b('0x50')](_0x54ed83[_0xca7b('0x4c')],{'$or':_[_0xca7b('0x3b')](_0x54ed83[_0xca7b('0x46')],function(_0x301f4a){var _0x7b4637={};_0x7b4637[_0x301f4a]={'$like':'%'+_0x208d4c['query']['filter']+'%'};return _0x7b4637;})});}_0x54ed83=_[_0xca7b('0x50')]({},_0x54ed83,_0x208d4c[_0xca7b('0x51')]);return db[_0xca7b('0x6a')][_0xca7b('0x2d')]({'where':_0x54ed83[_0xca7b('0x4c')]})[_0xca7b('0x1d')](function(_0x1cbcf7){_0x183fcc[_0xca7b('0x2d')]=_0x1cbcf7;if(_0x208d4c[_0xca7b('0x41')][_0xca7b('0x55')]){_0x54ed83[_0xca7b('0x52')]=[{'all':!![]}];}return db[_0xca7b('0x6a')][_0xca7b('0x65')](_0x54ed83);})[_0xca7b('0x1d')](function(_0x4f877d){_0x183fcc[_0xca7b('0x66')]=_0x4f877d;return _0x183fcc;});}})[_0xca7b('0x1d')](respondWithFilteredResult(_0xf638b1,_0x54ed83))['catch'](handleError(_0xf638b1,null));};exports[_0xca7b('0x6c')]=function(_0x1bfb27,_0x293505,_0x11d378){return db[_0xca7b('0x3c')][_0xca7b('0x56')]({'where':{'id':_0x1bfb27[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x293505,null))['then'](function(_0x5b244a){if(_0x5b244a){return _0x5b244a[_0xca7b('0x6c')](_0x1bfb27[_0xca7b('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x293505,null))[_0xca7b('0x26')](handleError(_0x293505,null));};exports['notify']=function(_0x244309,_0x391916,_0x16613f){var _0x3f5a0e={'body':_0x244309[_0xca7b('0x5c')],'channel':_0xca7b('0x6d')};var _0xe9ed41=[];var _0x353989=[];var _0x447605={};var _0x471762=![];return db[_0xca7b('0x6e')][_0xca7b('0x5e')]()[_0xca7b('0x1d')](function(_0x4c9224){if(!_0x4c9224){throw new db['Sequelize'][(_0xca7b('0x6f'))](_0xca7b('0x70'));}_0xe9ed41=_['difference'](_[_0xca7b('0x42')](_0x4c9224),[_0xca7b('0x71'),_0xca7b('0x72')]);_0x353989=_[_0xca7b('0x73')](_['keys'](_0x4c9224),['createdAt',_0xca7b('0x72'),_0xca7b('0x74'),_0xca7b('0x75')]);if(_0x244309[_0xca7b('0x5c')]['id']){delete _0x244309[_0xca7b('0x5c')]['id'];}if(_[_0xca7b('0x76')](_0x244309[_0xca7b('0x5c')]['from'])){throw new db[(_0xca7b('0x77'))][(_0xca7b('0x6f'))](_0xca7b('0x78'));}if(_[_0xca7b('0x76')](_0x244309[_0xca7b('0x5c')][_0xca7b('0x5c')])||_0x244309['body'][_0xca7b('0x5c')]===''){throw new db[(_0xca7b('0x77'))][(_0xca7b('0x6f'))](_0xca7b('0x79'));}if(_['isNil'](_0x244309['body']['mapKey'])){throw new db[(_0xca7b('0x77'))][(_0xca7b('0x6f'))](_0xca7b('0x7a')+_0x353989);}if(!_[_0xca7b('0x7b')](_0x353989,_0x244309[_0xca7b('0x5c')]['mapKey'])){throw new db[(_0xca7b('0x77'))][(_0xca7b('0x6f'))](_0xca7b('0x7c')+_0x353989);}_0x447605[_0x244309['body'][_0xca7b('0x7d')]]=_0x244309[_0xca7b('0x5c')][_0xca7b('0x7e')];})[_0xca7b('0x1d')](function(){return db[_0xca7b('0x3c')][_0xca7b('0x56')]({'where':{'id':_0x244309['params']['id']},'include':[{'model':db[_0xca7b('0x7f')],'as':_0xca7b('0x80'),'include':[{'model':db[_0xca7b('0x6e')],'as':_0xca7b('0x81'),'where':_0x447605,'limit':0x1,'order':[[_0xca7b('0x72'),_0xca7b('0x82')]]}]},{'model':db[_0xca7b('0x83')],'as':_0xca7b('0x84')}]});})[_0xca7b('0x1d')](handleEntityNotFound(_0x391916,null))['then'](function(_0x4c13c4){if(_0x4c13c4&&_0x4c13c4[_0xca7b('0x80')]){_0x3f5a0e[_0xca7b('0x85')]=_0x4c13c4;_0x3f5a0e[_0xca7b('0x86')]=_0x4c13c4[_0xca7b('0x84')];_0x3f5a0e[_0xca7b('0x87')]=_0x4c13c4[_0xca7b('0x80')];_0x3f5a0e[_0xca7b('0x86')]=_[_0xca7b('0x88')](_0x3f5a0e[_0xca7b('0x86')],[_0xca7b('0x89')],[_0xca7b('0x8a')]);if(_0x3f5a0e[_0xca7b('0x85')]['Applications']){delete _0x3f5a0e[_0xca7b('0x85')]['Applications'];}if(_0x3f5a0e[_0xca7b('0x85')][_0xca7b('0x80')]&&_0x3f5a0e[_0xca7b('0x85')]['List'][_0xca7b('0x81')]['length']){return _0x3f5a0e[_0xca7b('0x85')][_0xca7b('0x80')][_0xca7b('0x81')][0x0];}var _0xc5311=_[_0xca7b('0x8b')](_0x244309['body'],{'firstName':_0x244309[_0xca7b('0x5c')]['from'],'ListId':_0x4c13c4[_0xca7b('0x75')]});_0xc5311[_0x244309[_0xca7b('0x5c')][_0xca7b('0x7d')]]=_0x244309[_0xca7b('0x5c')][_0xca7b('0x7e')];return db['CmContact']['create'](_0xc5311,{'fields':_0xe9ed41,'raw':!![]});}})[_0xca7b('0x1d')](handleEntityNotFound(_0x391916,null))['then'](function(_0x466c8d){_0x3f5a0e[_0xca7b('0x8c')]=_0x466c8d;if(_0x466c8d){var _0x3c437b={'ContactId':_0x466c8d['id'],'OpenchannelAccountId':_0x244309[_0xca7b('0x54')]['id'],'from':(_0x466c8d[_0xca7b('0x8d')]||'')+'\x20'+(_0x466c8d[_0xca7b('0x8e')]||'')};var _0x54cf7a={'OpenchannelAccountId':_0x244309[_0xca7b('0x54')]['id'],'closed':![]};if(_0x244309['body'][_0xca7b('0x8f')]){_0x54cf7a['threadId']=_0x244309[_0xca7b('0x5c')][_0xca7b('0x8f')];return db[_0xca7b('0x90')][_0xca7b('0x56')]({'where':_0x54cf7a})[_0xca7b('0x1d')](function(_0x2acc09){if(_0x2acc09){return[_0x2acc09,![]];}_0x3c437b[_0xca7b('0x8f')]=_0x244309['body'][_0xca7b('0x8f')];_0x3c437b[_0xca7b('0x91')]=_0x244309[_0xca7b('0x5c')][_0xca7b('0x91')];return db[_0xca7b('0x90')]['create'](_0x3c437b)['then'](function(_0x30bcb8){return[_0x30bcb8,!![]];});});}else{_0x54cf7a[_0xca7b('0x8f')]=null;}_0x54cf7a['ContactId']=_0x466c8d['id'];return db[_0xca7b('0x90')][_0xca7b('0x56')]({'where':_0x54cf7a})[_0xca7b('0x1d')](function(_0x4f0aba){if(_0x4f0aba){return[_0x4f0aba,![]];}return db[_0xca7b('0x90')]['create'](_0x3c437b)[_0xca7b('0x1d')](function(_0xdc057d){return[_0xdc057d,!![]];});});}})[_0xca7b('0x92')](function(_0x57acb0,_0x178062){if(_0x57acb0){_0x471762=_0x178062;if(!_0x178062){var _0x3d8407={'from':(_0x3f5a0e[_0xca7b('0x8c')][_0xca7b('0x8d')]||'')+'\x20'+(_0x3f5a0e[_0xca7b('0x8c')][_0xca7b('0x8e')]||'')};if(_0x244309['body']['threadId']&&_0x244309['body'][_0xca7b('0x93')]&&_0x244309[_0xca7b('0x5c')][_0xca7b('0x8f')]!=_0x244309[_0xca7b('0x5c')][_0xca7b('0x93')]){_0x3d8407[_0xca7b('0x8f')]=_0x244309[_0xca7b('0x5c')][_0xca7b('0x93')];}return _0x57acb0[_0xca7b('0x33')](_0x3d8407);}else{return _0x57acb0;}}})['then'](function(_0x5c6a70){_0x3f5a0e[_0xca7b('0x94')]=_0x5c6a70[_0xca7b('0x35')]({'plain':!![]});_0x3f5a0e['interaction']['created']=_0x471762;if(_0x3f5a0e[_0xca7b('0x94')][_0xca7b('0x95')]){if(_0x3f5a0e[_0xca7b('0x85')][_0xca7b('0x96')]){_0x3f5a0e[_0xca7b('0x86')][_0xca7b('0x97')]({'id':0x0,'priority':_0x3f5a0e[_0xca7b('0x86')][_0xca7b('0x48')]+0x1,'app':_0xca7b('0x98'),'appdata':_0xca7b('0x99'),'interval':_0xca7b('0x9a')});}}return db[_0xca7b('0x9b')][_0xca7b('0x57')]({'body':_0x244309['body'][_0xca7b('0x5c')],'OpenchannelAccountId':_0x244309[_0xca7b('0x54')]['id'],'OpenchannelInteractionId':_0x5c6a70['id'],'direction':'in','ContactId':_0x3f5a0e['contact']['id'],'AttachmentId':_0x244309[_0xca7b('0x5c')][_0xca7b('0x9c')]});})['then'](function(_0x2bf867){_0x3f5a0e[_0xca7b('0x23')]=_0x2bf867;if(_0x3f5a0e['interaction'][_0xca7b('0x9d')]){return db[_0xca7b('0x9e')]['find']({'attributes':['id','name'],'where':{'id':_0x3f5a0e['interaction'][_0xca7b('0x9d')]}})[_0xca7b('0x1d')](function(_0x1a7a08){if(_0x1a7a08){_0x3f5a0e['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1a7a08[_0xca7b('0x40')]+','+(_0x3f5a0e[_0xca7b('0x85')][_0xca7b('0x9f')]||0xa),'interval':_0xca7b('0x9a')});_0x3f5a0e[_0xca7b('0xa0')]=![];}return respondWithRpcPromise('Start',_0xca7b('0xa1'),_0x3f5a0e);});}return respondWithRpcPromise('Start',_0xca7b('0xa1'),_0x3f5a0e);})['then'](function(_0x418f88){respondWithRpcPromise(_0xca7b('0xa2'),_0xca7b('0xa2'),{'event':_0xca7b('0xa3'),'message':_0x418f88},client9002);return _0x418f88;})[_0xca7b('0x1d')](respondWithResult(_0x391916,null))[_0xca7b('0x26')](handleError(_0x391916,null));};exports[_0xca7b('0xa4')]=function(_0x5d63cf,_0x4d4739,_0x243f6d){return db[_0xca7b('0x3c')][_0xca7b('0x61')]({'where':{'id':_0x5d63cf[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x4d4739,null))['then'](function(_0x58cbc3){if(_0x58cbc3){return db['sequelize'][_0xca7b('0xa5')](function(_0x14f93e){return db[_0xca7b('0x83')][_0xca7b('0x34')]({'where':{'OpenchannelAccountId':_0x5d63cf[_0xca7b('0x54')]['id']},'transaction':_0x14f93e})[_0xca7b('0x1d')](function(_0x102cf1){var _0x30842e=_[_0xca7b('0x3b')](_0x5d63cf[_0xca7b('0x5c')],function(_0xd0154){_0xd0154[_0xca7b('0x64')]=_0x5d63cf[_0xca7b('0x54')]['id'];return _0xd0154;});return db[_0xca7b('0x83')][_0xca7b('0xa6')](_0x30842e,{'transaction':_0x14f93e});});})[_0xca7b('0x1d')](function(){return db[_0xca7b('0x83')][_0xca7b('0xa7')]({'where':{'OpenchannelAccountId':_0x5d63cf[_0xca7b('0x54')]['id']},'order':_0xca7b('0x89')});});}})['then'](respondWithResult(_0x4d4739,null))['catch'](handleError(_0x4d4739,null));};exports[_0xca7b('0xa8')]=function(_0x9ca70e,_0x1355ad,_0x31ad8f){var _0x3d7d69={};var _0x238a4d={};var _0x504fd3;var _0x3051be;return db[_0xca7b('0x3c')][_0xca7b('0x61')]({'where':{'id':_0x9ca70e['params']['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x1355ad,null))[_0xca7b('0x1d')](function(_0x2432ab){if(_0x2432ab){_0x504fd3=_0x2432ab;_0x238a4d[_0xca7b('0x45')]=_['keys'](db['OpenchannelApplication'][_0xca7b('0x62')]);_0x238a4d[_0xca7b('0x41')]=_[_0xca7b('0x42')](_0x9ca70e[_0xca7b('0x41')]);_0x238a4d[_0xca7b('0x43')]=_[_0xca7b('0x44')](_0x238a4d[_0xca7b('0x45')],_0x238a4d[_0xca7b('0x41')]);_0x3d7d69[_0xca7b('0x46')]=_[_0xca7b('0x44')](_0x238a4d[_0xca7b('0x45')],qs['fields'](_0x9ca70e[_0xca7b('0x41')][_0xca7b('0x47')]));_0x3d7d69['attributes']=_0x3d7d69[_0xca7b('0x46')][_0xca7b('0x48')]?_0x3d7d69['attributes']:_0x238a4d[_0xca7b('0x45')];_0x3d7d69[_0xca7b('0x4a')]=qs[_0xca7b('0x4b')](_0x9ca70e[_0xca7b('0x41')]['sort']);_0x3d7d69[_0xca7b('0x4c')]=qs[_0xca7b('0x43')](_[_0xca7b('0x4d')](_0x9ca70e['query'],_0x238a4d['filters']));if(_0x9ca70e[_0xca7b('0x41')][_0xca7b('0x4e')]){_0x3d7d69['where']=_[_0xca7b('0x50')](_0x3d7d69[_0xca7b('0x4c')],{'$or':_[_0xca7b('0x3b')](_0x3d7d69['attributes'],function(_0x1b4655){var _0xbdfae9={};_0xbdfae9[_0x1b4655]={'$like':'%'+_0x9ca70e['query'][_0xca7b('0x4e')]+'%'};return _0xbdfae9;})});}_0x3d7d69=_[_0xca7b('0x50')]({},_0x3d7d69,_0x9ca70e['options']);return _0x504fd3[_0xca7b('0xa8')](_0x3d7d69);}})[_0xca7b('0x1d')](function(_0x7284ba){if(_0x7284ba){_0x3051be=_0x7284ba[_0xca7b('0x48')];if(!_0x9ca70e[_0xca7b('0x41')][_0xca7b('0x63')](_0xca7b('0x49'))){_0x3d7d69[_0xca7b('0x2c')]=qs[_0xca7b('0x2c')](_0x9ca70e[_0xca7b('0x41')]['limit']);_0x3d7d69['offset']=qs[_0xca7b('0x2e')](_0x9ca70e[_0xca7b('0x41')][_0xca7b('0x2e')]);}return _0x504fd3[_0xca7b('0xa8')](_0x3d7d69);}})[_0xca7b('0x1d')](function(_0x493229){if(_0x493229){return _0x493229?{'count':_0x3051be,'rows':_0x493229}:null;}})[_0xca7b('0x1d')](respondWithResult(_0x1355ad,null))[_0xca7b('0x26')](handleError(_0x1355ad,null));};exports['getInteractions']=function(_0x44dc04,_0x10a672,_0x467df3){var _0x38c538={'raw':![],'where':{}};var _0x47c49d={};var _0x59c0f5={'count':0x0,'rows':[]};return db[_0xca7b('0x3c')][_0xca7b('0x61')]({'where':{'id':_0x44dc04[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x10a672,null))[_0xca7b('0x1d')](function(_0x3cf8bd){if(_0x3cf8bd){_0x47c49d[_0xca7b('0x45')]=_[_0xca7b('0x42')](db['OpenchannelInteraction'][_0xca7b('0x62')]);_0x47c49d[_0xca7b('0x41')]=_[_0xca7b('0x42')](_0x44dc04[_0xca7b('0x41')]);_0x47c49d['filters']=_[_0xca7b('0x44')](_0x47c49d['model'],_0x47c49d[_0xca7b('0x41')]);_0x38c538[_0xca7b('0x46')]=_[_0xca7b('0x44')](_0x47c49d[_0xca7b('0x45')],qs[_0xca7b('0x47')](_0x44dc04[_0xca7b('0x41')]['fields']));_0x38c538['attributes']=_0x38c538[_0xca7b('0x46')]['length']?_0x38c538['attributes']:_0x47c49d['model'];if(!_0x44dc04[_0xca7b('0x41')]['hasOwnProperty']('nolimit')){_0x38c538[_0xca7b('0x2c')]=qs[_0xca7b('0x2c')](_0x44dc04['query'][_0xca7b('0x2c')]);_0x38c538['offset']=qs[_0xca7b('0x2e')](_0x44dc04[_0xca7b('0x41')][_0xca7b('0x2e')]);}_0x38c538[_0xca7b('0x4a')]=qs[_0xca7b('0x4b')](_0x44dc04['query'][_0xca7b('0x4b')]);_0x38c538['where']=qs[_0xca7b('0x43')](_['pick'](_0x44dc04['query'],_0x47c49d[_0xca7b('0x43')]));_0x38c538['where']['OpenchannelAccountId']=_0x3cf8bd['id'];if(_0x44dc04[_0xca7b('0x41')][_0xca7b('0x4e')]){_0x38c538[_0xca7b('0x4c')]=_[_0xca7b('0x50')](_0x38c538[_0xca7b('0x4c')],{'$or':_[_0xca7b('0x3b')](_0x38c538[_0xca7b('0x46')],function(_0x1d0b69){var _0x337188={};_0x337188[_0x1d0b69]={'$like':'%'+_0x44dc04['query'][_0xca7b('0x4e')]+'%'};return _0x337188;})});}_0x38c538=_['merge']({},_0x38c538,_0x44dc04[_0xca7b('0x51')]);return db[_0xca7b('0x90')][_0xca7b('0x2d')]({'where':_0x38c538[_0xca7b('0x4c')]})[_0xca7b('0x1d')](function(_0x308ac9){_0x59c0f5[_0xca7b('0x2d')]=_0x308ac9;if(_0x44dc04[_0xca7b('0x41')][_0xca7b('0x55')]){_0x38c538[_0xca7b('0x52')]=[{'model':db[_0xca7b('0x6e')],'as':'Contact','required':![]},{'model':db[_0xca7b('0x9e')],'as':_0xca7b('0xa9'),'attributes':[_0xca7b('0x40'),_0xca7b('0xaa'),_0xca7b('0xab')],'required':![]},{'model':db[_0xca7b('0xac')],'as':'Tags','attributes':['id',_0xca7b('0x40'),'color'],'where':_0x44dc04[_0xca7b('0x41')][_0xca7b('0xad')]?{'id':_0x44dc04[_0xca7b('0x41')][_0xca7b('0xad')]}:undefined,'required':_0x44dc04[_0xca7b('0x41')]['tag']?!![]:![]}];}return db[_0xca7b('0x90')][_0xca7b('0x65')](_0x38c538);})[_0xca7b('0x1d')](function(_0x426c18){_0x59c0f5[_0xca7b('0x66')]=_0x426c18;return _0x59c0f5;});}})[_0xca7b('0x1d')](respondWithFilteredResult(_0x10a672,_0x38c538))[_0xca7b('0x26')](handleError(_0x10a672,null));};exports[_0xca7b('0xae')]=function(_0x3894eb,_0x5890dc,_0x19e158){return db[_0xca7b('0x3c')][_0xca7b('0x56')]({'where':{'id':_0x3894eb[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x5890dc,null))[_0xca7b('0x1d')](function(_0x49ba60){if(_0x49ba60){return _0x49ba60[_0xca7b('0xae')](_0x3894eb[_0xca7b('0x5c')][_0xca7b('0x68')],_['omit'](_0x3894eb[_0xca7b('0x5c')],['ids','id'])||{})[_0xca7b('0x92')](function(_0x3e67a5){for(var _0xb7bd39=0x0;_0xb7bd39<_0x3894eb[_0xca7b('0x5c')][_0xca7b('0x68')][_0xca7b('0x48')];_0xb7bd39+=0x1){socket[_0xca7b('0xaf')](_0xca7b('0xb0'),{'UserId':Number(_0x3894eb[_0xca7b('0x5c')][_0xca7b('0x68')][_0xb7bd39]),'OpenchannelAccountId':Number(_0x3894eb[_0xca7b('0x54')]['id'])});}return _0x3e67a5;});}})[_0xca7b('0x1d')](respondWithResult(_0x5890dc,null))['catch'](handleError(_0x5890dc,null));};exports['removeAgents']=function(_0x46bf9b,_0x3763f0,_0x42d5af){return db[_0xca7b('0x3c')][_0xca7b('0x56')]({'where':{'id':_0x46bf9b[_0xca7b('0x54')]['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x3763f0,null))[_0xca7b('0x1d')](function(_0x4a610d){if(_0x4a610d){return _0x4a610d[_0xca7b('0xb1')](_0x46bf9b['query'][_0xca7b('0x68')])['then'](function(){if(_[_0xca7b('0xb2')](_0x46bf9b[_0xca7b('0x41')]['ids'])){for(var _0x1a6dfc=0x0;_0x1a6dfc<_0x46bf9b['query'][_0xca7b('0x68')][_0xca7b('0x48')];_0x1a6dfc+=0x1){socket[_0xca7b('0xaf')](_0xca7b('0xb3'),{'UserId':Number(_0x46bf9b[_0xca7b('0x41')][_0xca7b('0x68')][_0x1a6dfc]),'OpenchannelAccountId':Number(_0x46bf9b[_0xca7b('0x54')]['id'])});}}else{socket[_0xca7b('0xaf')](_0xca7b('0xb3'),{'UserId':Number(_0x46bf9b[_0xca7b('0x41')][_0xca7b('0x68')]),'OpenchannelAccountId':Number(_0x46bf9b[_0xca7b('0x54')]['id'])});}});}})[_0xca7b('0x1d')](respondWithStatusCode(_0x3763f0,null))['catch'](handleError(_0x3763f0,null));};exports[_0xca7b('0xb4')]=function(_0x13bb90,_0xf90e,_0x47e6da){var _0x253641={};var _0x1d4c5c={};var _0x20d0f5;var _0x4a0582;return db[_0xca7b('0x3c')][_0xca7b('0x61')]({'where':{'id':_0x13bb90['params']['id']}})['then'](handleEntityNotFound(_0xf90e,null))['then'](function(_0x176af7){if(_0x176af7){_0x20d0f5=_0x176af7;_0x1d4c5c['model']=_[_0xca7b('0x42')](db[_0xca7b('0x9e')][_0xca7b('0x62')]);_0x1d4c5c['query']=_[_0xca7b('0x42')](_0x13bb90[_0xca7b('0x41')]);_0x1d4c5c[_0xca7b('0x43')]=_[_0xca7b('0x44')](_0x1d4c5c['model'],_0x1d4c5c['query']);_0x253641[_0xca7b('0x46')]=_[_0xca7b('0x44')](_0x1d4c5c[_0xca7b('0x45')],qs['fields'](_0x13bb90['query']['fields']));_0x253641[_0xca7b('0x46')]=_0x253641[_0xca7b('0x46')][_0xca7b('0x48')]?_0x253641['attributes']:_0x1d4c5c[_0xca7b('0x45')];_0x253641['order']=qs[_0xca7b('0x4b')](_0x13bb90[_0xca7b('0x41')][_0xca7b('0x4b')]);_0x253641[_0xca7b('0x4c')]=qs[_0xca7b('0x43')](_['pick'](_0x13bb90[_0xca7b('0x41')],_0x1d4c5c[_0xca7b('0x43')]));if(_0x13bb90[_0xca7b('0x41')][_0xca7b('0x4e')]){_0x253641[_0xca7b('0x4c')]=_[_0xca7b('0x50')](_0x253641['where'],{'$or':_['map'](_0x253641[_0xca7b('0x46')],function(_0x2a6377){var _0x8a5503={};_0x8a5503[_0x2a6377]={'$like':'%'+_0x13bb90[_0xca7b('0x41')]['filter']+'%'};return _0x8a5503;})});}_0x253641=_[_0xca7b('0x50')]({},_0x253641,_0x13bb90[_0xca7b('0x51')]);return _0x20d0f5[_0xca7b('0xb4')](_0x253641);}})[_0xca7b('0x1d')](function(_0x171344){if(_0x171344){_0x4a0582=_0x171344[_0xca7b('0x48')];if(!_0x13bb90[_0xca7b('0x41')][_0xca7b('0x63')]('nolimit')){_0x253641[_0xca7b('0x2c')]=qs[_0xca7b('0x2c')](_0x13bb90[_0xca7b('0x41')]['limit']);_0x253641['offset']=qs['offset'](_0x13bb90[_0xca7b('0x41')][_0xca7b('0x2e')]);}return _0x20d0f5[_0xca7b('0xb4')](_0x253641);}})[_0xca7b('0x1d')](function(_0x42040a){if(_0x42040a){return _0x42040a?{'count':_0x4a0582,'rows':_0x42040a}:null;}})[_0xca7b('0x1d')](respondWithResult(_0xf90e,null))[_0xca7b('0x26')](handleError(_0xf90e,null));};exports['send']=function(_0x2fbb89,_0x1c0502,_0x5a7638){var _0x199e55,_0x54a734,_0x3fde2a;if(_[_0xca7b('0x76')](_0x2fbb89[_0xca7b('0x5c')][_0xca7b('0x5c')])||_0x2fbb89[_0xca7b('0x5c')]['body']===''){throw new db[(_0xca7b('0x77'))][(_0xca7b('0x6f'))](_0xca7b('0x79'));}if(_['isNil'](_0x2fbb89[_0xca7b('0x5c')]['to'])){}_0x199e55=_0x2fbb89[_0xca7b('0x5c')]['to'];return db[_0xca7b('0x3c')][_0xca7b('0x61')]({'where':{'id':_0x2fbb89['params']['id']}})[_0xca7b('0x1d')](handleEntityNotFound(_0x1c0502,null))[_0xca7b('0x1d')](function(_0x37d113){if(_0x37d113){return db[_0xca7b('0x3c')][_0xca7b('0x56')]({'where':{'id':_0x37d113['id']},'include':[{'model':db[_0xca7b('0x7f')],'as':_0xca7b('0x80'),'include':[{'model':db[_0xca7b('0x6e')],'as':_0xca7b('0x81'),'where':{[_0x37d113[_0xca7b('0x7d')]]:_0x199e55},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xca7b('0x1d')](handleEntityNotFound(_0x1c0502,null))['then'](function(_0x38bf3e){if(_0x38bf3e&&_0x38bf3e[_0xca7b('0x80')]){_0x54a734=_0x38bf3e[_0xca7b('0x35')]({'plain':!![]});if(_0x54a734[_0xca7b('0x80')]&&_0x54a734[_0xca7b('0x80')][_0xca7b('0x81')][_0xca7b('0x48')]){return _0x54a734['List'][_0xca7b('0x81')][0x0];}return db[_0xca7b('0x6e')]['create'](_[_0xca7b('0x8b')](_0x2fbb89[_0xca7b('0x5c')],{'firstName':_0x199e55,[_0x38bf3e['mapKey']]:_0x199e55,'phone':_0x199e55,'ListId':_0x54a734[_0xca7b('0x75')]}));}})['then'](handleEntityNotFound(_0x1c0502,null))['then'](function(_0x25a720){if(_0x25a720){_0x3fde2a=_0x25a720;return db[_0xca7b('0x90')][_0xca7b('0x56')]({'where':{'ContactId':_0x3fde2a['id'],'closed':![],'OpenchannelAccountId':_0x54a734['id']}})['then'](function(_0xc9df46){if(_0xc9df46){return[_0xc9df46,![]];}return db[_0xca7b('0x90')]['create']({'UserId':_0x2fbb89[_0xca7b('0x58')]['id'],'ContactId':_0x3fde2a['id'],'OpenchannelAccountId':_0x54a734['id'],'lastMsgDirection':'out','Messages':[_['merge'](_0x2fbb89[_0xca7b('0x5c')],{'read':![],'body':_0x2fbb89['body'][_0xca7b('0x5c')],'OpenchannelAccountId':_0x54a734['id'],'UserId':_0x2fbb89[_0xca7b('0x58')]['id'],'ContactId':_0x3fde2a['id']})]},{'include':[{'model':db[_0xca7b('0x9b')],'as':_0xca7b('0xb5')}]})[_0xca7b('0x1d')](function(_0x463760){return[_0x463760,!![]];});});}})['spread'](function(_0x3c9a37,_0x16efd7){if(_0x16efd7){return _0x3c9a37;}return db['OpenchannelMessage'][_0xca7b('0x57')](_[_0xca7b('0x50')](_0x2fbb89[_0xca7b('0x5c')],{'read':![],'body':_0x2fbb89[_0xca7b('0x5c')][_0xca7b('0x5c')],'OpenchannelAccountId':_0x54a734['id'],'OpenchannelInteractionId':_0x3c9a37['id'],'UserId':_0x2fbb89['user']['id'],'ContactId':_0x3fde2a['id']}))[_0xca7b('0x1d')](function(_0x21e030){_0x3c9a37[_0xca7b('0xb6')][_0xca7b('0xb5')]=[];_0x3c9a37[_0xca7b('0xb6')][_0xca7b('0xb5')][_0xca7b('0x97')](_0x21e030['dataValues']);return _0x3c9a37;});});}})[_0xca7b('0x1d')](respondWithResult(_0x1c0502,null))[_0xca7b('0x26')](handleError(_0x1c0502,null));};
\ No newline at end of file
+var _0x9a26=['count','set','Content-Range','json','apply','reject','save','update','destroy','OpenchannelAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','show','params','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','list','applications','orderBy','priority','asc','account','Applications','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','contact','messageId','interaction','created','autoclose','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','bulkCreate','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','offset','undefined','limit'];(function(_0x4d1691,_0x1e5151){var _0x350e14=function(_0x5c46c6){while(--_0x5c46c6){_0x4d1691['push'](_0x4d1691['shift']());}};_0x350e14(++_0x1e5151);}(_0x9a26,0x149));var _0x69a2=function(_0x37d8ae,_0x17e484){_0x37d8ae=_0x37d8ae-0x0;var _0x4de500=_0x9a26[_0x37d8ae];return _0x4de500;};'use strict';var emlformat=require(_0x69a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69a2('0x1'));var jsonpatch=require(_0x69a2('0x2'));var rp=require(_0x69a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x69a2('0x4'));var util=require(_0x69a2('0x5'));var path=require('path');var sox=require(_0x69a2('0x6'));var csv=require(_0x69a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69a2('0x8'));var _=require('lodash');var squel=require(_0x69a2('0x9'));var crypto=require(_0x69a2('0xa'));var jsforce=require(_0x69a2('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x69a2('0xc'));var Papa=require(_0x69a2('0xd'));var Redis=require(_0x69a2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x69a2('0xf'));var as=require(_0x69a2('0x10'));var hardwareService=require(_0x69a2('0x11'));var logger=require(_0x69a2('0x12'))(_0x69a2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x69a2('0x14'));var db=require('../../mysqldb')['db'];config[_0x69a2('0x15')]=_[_0x69a2('0x16')](config[_0x69a2('0x15')],{'host':_0x69a2('0x17'),'port':0x18eb});var socket=require(_0x69a2('0x18'))(new Redis(config[_0x69a2('0x15')]));require(_0x69a2('0x19'))[_0x69a2('0x1a')](socket);var jayson=require(_0x69a2('0x1b'));var client=jayson[_0x69a2('0x1c')][_0x69a2('0x1d')]({'port':0x232c});var client9002=jayson[_0x69a2('0x1c')][_0x69a2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x15bbf6,_0x443c50,_0x313b08,_0x15c207){return new BPromise(function(_0x30462d,_0x3c33e8){var _0x3a047e=_0x15c207||client;return _0x3a047e['request'](_0x15bbf6,_0x313b08)[_0x69a2('0x1e')](function(_0x39b6d0){logger[_0x69a2('0x1f')](_0x69a2('0x20'),_0x443c50,_0x69a2('0x21'));logger[_0x69a2('0x22')](_0x69a2('0x23'),_0x443c50,_0x69a2('0x21'),JSON['stringify'](_0x39b6d0));if(_0x39b6d0['error']){if(_0x39b6d0[_0x69a2('0x24')]['code']===0x1f4){logger[_0x69a2('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x443c50,_0x39b6d0[_0x69a2('0x24')][_0x69a2('0x25')]);return _0x3c33e8(_0x39b6d0[_0x69a2('0x24')][_0x69a2('0x25')]);}logger[_0x69a2('0x24')](_0x69a2('0x20'),_0x443c50,_0x39b6d0[_0x69a2('0x24')]['message']);return _0x30462d(_0x39b6d0['error'][_0x69a2('0x25')]);}else{logger[_0x69a2('0x1f')](_0x69a2('0x20'),_0x443c50,_0x69a2('0x21'));_0x30462d(_0x39b6d0[_0x69a2('0x26')]['message']);}})[_0x69a2('0x27')](function(_0x271696){logger[_0x69a2('0x24')](_0x69a2('0x20'),_0x443c50,_0x271696);_0x3c33e8(_0x271696);});});}function respondWithStatusCode(_0xc0f704,_0x241ec8){_0x241ec8=_0x241ec8||0xcc;return function(_0x288519){if(_0x288519){return _0xc0f704[_0x69a2('0x28')](_0x241ec8);}return _0xc0f704[_0x69a2('0x29')](_0x241ec8)['end']();};}function respondWithResult(_0x4fdaf1,_0x5acb23){_0x5acb23=_0x5acb23||0xc8;return function(_0x2454f0){if(_0x2454f0){return _0x4fdaf1[_0x69a2('0x29')](_0x5acb23)['json'](_0x2454f0);}};}function respondWithFilteredResult(_0x20ea7d,_0x3718c9){return function(_0x53e65d){if(_0x53e65d){var _0x3be949=typeof _0x3718c9[_0x69a2('0x2a')]===_0x69a2('0x2b')&&typeof _0x3718c9[_0x69a2('0x2c')]===_0x69a2('0x2b');var _0x4059fe=_0x53e65d[_0x69a2('0x2d')];var _0x37115f=_0x3be949?0x0:_0x3718c9['offset'];var _0x5ed21a=_0x3be949?_0x53e65d[_0x69a2('0x2d')]:_0x3718c9[_0x69a2('0x2a')]+_0x3718c9[_0x69a2('0x2c')];var _0xd33be7;if(_0x5ed21a>=_0x4059fe){_0x5ed21a=_0x4059fe;_0xd33be7=0xc8;}else{_0xd33be7=0xce;}_0x20ea7d[_0x69a2('0x29')](_0xd33be7);return _0x20ea7d[_0x69a2('0x2e')](_0x69a2('0x2f'),_0x37115f+'-'+_0x5ed21a+'/'+_0x4059fe)[_0x69a2('0x30')](_0x53e65d);}return null;};}function patchUpdates(_0xe96eb6){return function(_0x5ea4ee){try{jsonpatch[_0x69a2('0x31')](_0x5ea4ee,_0xe96eb6,!![]);}catch(_0x1ce399){return BPromise[_0x69a2('0x32')](_0x1ce399);}return _0x5ea4ee[_0x69a2('0x33')]();};}function saveUpdates(_0x4947dc,_0x69cb75){return function(_0x20e2e3){if(_0x20e2e3){return _0x20e2e3[_0x69a2('0x34')](_0x4947dc)[_0x69a2('0x1e')](function(_0x31ce51){return _0x31ce51;});}return null;};}function removeEntity(_0x238c2c,_0x2d187d){return function(_0x28de42){if(_0x28de42){return _0x28de42[_0x69a2('0x35')]()[_0x69a2('0x1e')](function(){var _0x545905=_0x28de42['get']({'plain':!![]});var _0x14f631=_0x69a2('0x36');return db['UserProfileResource'][_0x69a2('0x35')]({'where':{'type':_0x14f631,'resourceId':_0x545905['id']}})[_0x69a2('0x1e')](function(){return _0x28de42;});})['then'](function(){_0x238c2c[_0x69a2('0x29')](0xcc)[_0x69a2('0x37')]();});}};}function handleEntityNotFound(_0xd31883,_0x357269){return function(_0x34a9a8){if(!_0x34a9a8){_0xd31883[_0x69a2('0x28')](0x194);}return _0x34a9a8;};}function handleError(_0x116800,_0x340456){_0x340456=_0x340456||0x1f4;return function(_0x1d5863){logger[_0x69a2('0x24')](_0x1d5863[_0x69a2('0x38')]);if(_0x1d5863['name']){delete _0x1d5863[_0x69a2('0x39')];}_0x116800[_0x69a2('0x29')](_0x340456)[_0x69a2('0x3a')](_0x1d5863);};}exports[_0x69a2('0x3b')]=function(_0x2f75c6,_0x3dd17d){var _0xe367c5={'include':[{'model':db[_0x69a2('0x3c')],'as':_0x69a2('0x3d')}]},_0x11e6b3={},_0x1635c2={'count':0x0,'rows':[]};var _0x11f63c=_[_0x69a2('0x3e')](db[_0x69a2('0x3f')]['rawAttributes'],function(_0x3a9db4){return{'name':_0x3a9db4['fieldName'],'type':_0x3a9db4[_0x69a2('0x40')]['key']};});_0x11e6b3[_0x69a2('0x41')]=_[_0x69a2('0x3e')](_0x11f63c,_0x69a2('0x39'));_0x11e6b3['query']=_[_0x69a2('0x42')](_0x2f75c6[_0x69a2('0x43')]);_0x11e6b3[_0x69a2('0x44')]=_[_0x69a2('0x45')](_0x11e6b3[_0x69a2('0x41')],_0x11e6b3[_0x69a2('0x43')]);_0xe367c5[_0x69a2('0x46')]=_['intersection'](_0x11e6b3['model'],qs[_0x69a2('0x47')](_0x2f75c6[_0x69a2('0x43')]['fields']));_0xe367c5[_0x69a2('0x46')]=_0xe367c5[_0x69a2('0x46')][_0x69a2('0x48')]?_0xe367c5['attributes']:_0x11e6b3[_0x69a2('0x41')];if(!_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x49')](_0x69a2('0x4a'))){_0xe367c5[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x2c')]);_0xe367c5[_0x69a2('0x2a')]=qs[_0x69a2('0x2a')](_0x2f75c6['query'][_0x69a2('0x2a')]);}_0xe367c5[_0x69a2('0x4b')]=qs[_0x69a2('0x4c')](_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x4c')]);_0xe367c5['where']=qs[_0x69a2('0x44')](_[_0x69a2('0x4d')](_0x2f75c6[_0x69a2('0x43')],_0x11e6b3['filters']),_0x11f63c);if(_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x4e')]){_0xe367c5[_0x69a2('0x4f')]=_[_0x69a2('0x50')](_0xe367c5['where'],{'$or':_[_0x69a2('0x3e')](_0x11f63c,function(_0x2b6d19){if(_0x2b6d19[_0x69a2('0x40')]!=='VIRTUAL'){var _0x1582e2={};_0x1582e2[_0x2b6d19[_0x69a2('0x39')]]={'$like':'%'+_0x2f75c6[_0x69a2('0x43')]['filter']+'%'};return _0x1582e2;}})});}_0xe367c5=_['merge']({},_0xe367c5,_0x2f75c6[_0x69a2('0x51')]);var _0x48a82f={'where':_0xe367c5['where']};return db[_0x69a2('0x3f')][_0x69a2('0x2d')](_0x48a82f)[_0x69a2('0x1e')](function(_0x2c951f){_0x1635c2[_0x69a2('0x2d')]=_0x2c951f;if(_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x52')]){_0xe367c5['include']=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0xe367c5);})[_0x69a2('0x1e')](function(_0x2e7383){_0x1635c2['rows']=_0x2e7383;return _0x1635c2;})['then'](respondWithFilteredResult(_0x3dd17d,_0xe367c5))[_0x69a2('0x27')](handleError(_0x3dd17d,null));};exports[_0x69a2('0x53')]=function(_0xfa9606,_0x181735){var _0x24b30d={'raw':![],'where':{'id':_0xfa9606[_0x69a2('0x54')]['id']},'include':[{'model':db[_0x69a2('0x3c')],'as':_0x69a2('0x3d')}]},_0xaae1e0={};_0xaae1e0[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0x3f')][_0x69a2('0x55')]);_0xaae1e0[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0xfa9606[_0x69a2('0x43')]);_0xaae1e0[_0x69a2('0x44')]=_[_0x69a2('0x45')](_0xaae1e0[_0x69a2('0x41')],_0xaae1e0[_0x69a2('0x43')]);_0x24b30d[_0x69a2('0x46')]=_['intersection'](_0xaae1e0[_0x69a2('0x41')],qs['fields'](_0xfa9606['query'][_0x69a2('0x47')]));_0x24b30d['attributes']=_0x24b30d[_0x69a2('0x46')]['length']?_0x24b30d[_0x69a2('0x46')]:_0xaae1e0[_0x69a2('0x41')];if(_0xfa9606[_0x69a2('0x43')][_0x69a2('0x52')]){_0x24b30d[_0x69a2('0x56')]=[{'all':!![]}];}_0x24b30d=_[_0x69a2('0x50')]({},_0x24b30d,_0xfa9606[_0x69a2('0x51')]);return db[_0x69a2('0x3f')][_0x69a2('0x57')](_0x24b30d)[_0x69a2('0x1e')](handleEntityNotFound(_0x181735,null))[_0x69a2('0x1e')](respondWithResult(_0x181735,null))[_0x69a2('0x27')](handleError(_0x181735,null));};exports['create']=function(_0x3e3416,_0x4851e9){return db['OpenchannelAccount'][_0x69a2('0x58')](_0x3e3416[_0x69a2('0x59')],{})[_0x69a2('0x1e')](function(_0x297eb8){var _0xa80926=_0x3e3416[_0x69a2('0x5a')][_0x69a2('0x5b')]({'plain':!![]});if(!_0xa80926)throw new Error(_0x69a2('0x5c'));if(_0xa80926[_0x69a2('0x5d')]===_0x69a2('0x5a')){var _0x177873=_0x297eb8[_0x69a2('0x5b')]({'plain':!![]});var _0x4efa93=_0x69a2('0x36');return db[_0x69a2('0x5e')][_0x69a2('0x57')]({'where':{'name':_0x4efa93,'userProfileId':_0xa80926[_0x69a2('0x5f')]},'raw':!![]})['then'](function(_0x38218a){if(_0x38218a&&_0x38218a[_0x69a2('0x60')]===0x0){return db[_0x69a2('0x61')][_0x69a2('0x58')]({'name':_0x177873[_0x69a2('0x39')],'resourceId':_0x177873['id'],'type':_0x38218a[_0x69a2('0x39')],'sectionId':_0x38218a['id']},{})[_0x69a2('0x1e')](function(){return _0x297eb8;});}else{return _0x297eb8;}})[_0x69a2('0x27')](function(_0x32764e){logger[_0x69a2('0x24')](_0x69a2('0x62'),_0x32764e);throw _0x32764e;});}return _0x297eb8;})['then'](respondWithResult(_0x4851e9,0xc9))[_0x69a2('0x27')](handleError(_0x4851e9,null));};exports[_0x69a2('0x34')]=function(_0x33a1aa,_0x190850){if(_0x33a1aa['body']['id']){delete _0x33a1aa[_0x69a2('0x59')]['id'];}return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x33a1aa['params']['id']},'include':[{'model':db[_0x69a2('0x3c')],'as':_0x69a2('0x3d')}]})['then'](handleEntityNotFound(_0x190850,null))['then'](saveUpdates(_0x33a1aa['body'],null))[_0x69a2('0x1e')](respondWithResult(_0x190850,null))['catch'](handleError(_0x190850,null));};exports[_0x69a2('0x35')]=function(_0x4f426a,_0x50ba3a){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x4f426a[_0x69a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x50ba3a,null))[_0x69a2('0x1e')](removeEntity(_0x50ba3a,null))['catch'](handleError(_0x50ba3a,null));};exports[_0x69a2('0x63')]=function(_0x42fb8d,_0x257e3e){return db[_0x69a2('0x3f')][_0x69a2('0x63')]()[_0x69a2('0x1e')](respondWithResult(_0x257e3e,null))[_0x69a2('0x27')](handleError(_0x257e3e,null));};exports[_0x69a2('0x64')]=function(_0x133fd5,_0x4d9251,_0xec8339){if(_0x133fd5[_0x69a2('0x59')]['id']){delete _0x133fd5[_0x69a2('0x59')]['id'];}return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x133fd5['params']['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x4d9251,null))['then'](function(_0x46db07){if(_0x46db07){_0x133fd5[_0x69a2('0x59')][_0x69a2('0x65')]=_0x46db07['id'];return db[_0x69a2('0x66')][_0x69a2('0x58')](_0x133fd5['body']);}})[_0x69a2('0x1e')](respondWithResult(_0x4d9251,null))[_0x69a2('0x27')](handleError(_0x4d9251,null));};exports[_0x69a2('0x67')]=function(_0x2ba802,_0x5d359b,_0x240fc0){var _0x4ad5ed={'raw':![],'where':{}};var _0x1d4b4f={};var _0x2689a2={'count':0x0,'rows':[]};return db[_0x69a2('0x3f')][_0x69a2('0x68')]({'where':{'id':_0x2ba802[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x5d359b,null))[_0x69a2('0x1e')](function(_0x351e3d){if(_0x351e3d){_0x1d4b4f[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0x66')][_0x69a2('0x55')]);_0x1d4b4f[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0x2ba802[_0x69a2('0x43')]);_0x1d4b4f[_0x69a2('0x44')]=_[_0x69a2('0x45')](_0x1d4b4f['model'],_0x1d4b4f[_0x69a2('0x43')]);_0x4ad5ed['attributes']=_['intersection'](_0x1d4b4f[_0x69a2('0x41')],qs[_0x69a2('0x47')](_0x2ba802[_0x69a2('0x43')][_0x69a2('0x47')]));_0x4ad5ed[_0x69a2('0x46')]=_0x4ad5ed['attributes'][_0x69a2('0x48')]?_0x4ad5ed[_0x69a2('0x46')]:_0x1d4b4f[_0x69a2('0x41')];if(!_0x2ba802[_0x69a2('0x43')][_0x69a2('0x49')](_0x69a2('0x4a'))){_0x4ad5ed[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x2ba802[_0x69a2('0x43')][_0x69a2('0x2c')]);_0x4ad5ed[_0x69a2('0x2a')]=qs['offset'](_0x2ba802[_0x69a2('0x43')]['offset']);}_0x4ad5ed[_0x69a2('0x4b')]=qs['sort'](_0x2ba802[_0x69a2('0x43')][_0x69a2('0x4c')]);_0x4ad5ed[_0x69a2('0x4f')]=qs[_0x69a2('0x44')](_[_0x69a2('0x4d')](_0x2ba802[_0x69a2('0x43')],_0x1d4b4f[_0x69a2('0x44')]));_0x4ad5ed[_0x69a2('0x4f')][_0x69a2('0x65')]=_0x351e3d['id'];if(_0x2ba802[_0x69a2('0x43')]['filter']){_0x4ad5ed['where']=_[_0x69a2('0x50')](_0x4ad5ed[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x4ad5ed['attributes'],function(_0x40a999){var _0x3a551c={};_0x3a551c[_0x40a999]={'$like':'%'+_0x2ba802['query'][_0x69a2('0x4e')]+'%'};return _0x3a551c;})});}_0x4ad5ed=_[_0x69a2('0x50')]({},_0x4ad5ed,_0x2ba802[_0x69a2('0x51')]);return db[_0x69a2('0x66')][_0x69a2('0x2d')]({'where':_0x4ad5ed['where']})[_0x69a2('0x1e')](function(_0x82668a){_0x2689a2['count']=_0x82668a;if(_0x2ba802[_0x69a2('0x43')]['includeAll']){_0x4ad5ed[_0x69a2('0x56')]=[{'all':!![]}];}return db[_0x69a2('0x66')]['findAll'](_0x4ad5ed);})[_0x69a2('0x1e')](function(_0x5a8e7d){_0x2689a2['rows']=_0x5a8e7d;return _0x2689a2;});}})['then'](respondWithFilteredResult(_0x5d359b,_0x4ad5ed))[_0x69a2('0x27')](handleError(_0x5d359b,null));};exports[_0x69a2('0x69')]=function(_0x3addff,_0x5211fb,_0x5642e5){return db['OpenchannelAccount'][_0x69a2('0x57')]({'where':{'id':_0x3addff[_0x69a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x5211fb,null))[_0x69a2('0x1e')](function(_0x4da4ee){if(_0x4da4ee){return _0x4da4ee[_0x69a2('0x69')](_0x3addff['query'][_0x69a2('0x6a')]);}})[_0x69a2('0x1e')](respondWithStatusCode(_0x5211fb,null))[_0x69a2('0x27')](handleError(_0x5211fb,null));};exports[_0x69a2('0x6b')]=function(_0x1cf69b,_0x3b9add,_0x158233){if(_0x1cf69b[_0x69a2('0x59')]['id']){delete _0x1cf69b[_0x69a2('0x59')]['id'];}return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x1cf69b[_0x69a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x3b9add,null))[_0x69a2('0x1e')](function(_0x406ffa){if(_0x406ffa){_0x1cf69b[_0x69a2('0x59')]['OpenchannelAccountId']=_0x406ffa['id'];return db[_0x69a2('0x6c')]['create'](_0x1cf69b[_0x69a2('0x59')]);}})[_0x69a2('0x1e')](respondWithResult(_0x3b9add,null))[_0x69a2('0x27')](handleError(_0x3b9add,null));};exports[_0x69a2('0x6d')]=function(_0x16e763,_0x840bf4,_0x11d8a5){var _0x2a3181={'raw':![],'where':{}};var _0x43bf96={};var _0x4a93aa={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x16e763[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x840bf4,null))['then'](function(_0xd22b47){if(_0xd22b47){_0x43bf96[_0x69a2('0x41')]=_[_0x69a2('0x42')](db['CannedAnswer']['rawAttributes']);_0x43bf96[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0x16e763['query']);_0x43bf96[_0x69a2('0x44')]=_['intersection'](_0x43bf96[_0x69a2('0x41')],_0x43bf96[_0x69a2('0x43')]);_0x2a3181['attributes']=_[_0x69a2('0x45')](_0x43bf96[_0x69a2('0x41')],qs[_0x69a2('0x47')](_0x16e763[_0x69a2('0x43')][_0x69a2('0x47')]));_0x2a3181[_0x69a2('0x46')]=_0x2a3181[_0x69a2('0x46')]['length']?_0x2a3181['attributes']:_0x43bf96[_0x69a2('0x41')];if(!_0x16e763[_0x69a2('0x43')]['hasOwnProperty'](_0x69a2('0x4a'))){_0x2a3181[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x16e763[_0x69a2('0x43')]['limit']);_0x2a3181[_0x69a2('0x2a')]=qs[_0x69a2('0x2a')](_0x16e763[_0x69a2('0x43')]['offset']);}_0x2a3181[_0x69a2('0x4b')]=qs['sort'](_0x16e763[_0x69a2('0x43')][_0x69a2('0x4c')]);_0x2a3181[_0x69a2('0x4f')]=qs[_0x69a2('0x44')](_['pick'](_0x16e763[_0x69a2('0x43')],_0x43bf96[_0x69a2('0x44')]));_0x2a3181['where'][_0x69a2('0x65')]=_0xd22b47['id'];if(_0x16e763[_0x69a2('0x43')][_0x69a2('0x4e')]){_0x2a3181[_0x69a2('0x4f')]=_[_0x69a2('0x50')](_0x2a3181[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x2a3181['attributes'],function(_0xf2d6f2){var _0xd59d73={};_0xd59d73[_0xf2d6f2]={'$like':'%'+_0x16e763[_0x69a2('0x43')][_0x69a2('0x4e')]+'%'};return _0xd59d73;})});}_0x2a3181=_[_0x69a2('0x50')]({},_0x2a3181,_0x16e763[_0x69a2('0x51')]);return db['CannedAnswer']['count']({'where':_0x2a3181[_0x69a2('0x4f')]})[_0x69a2('0x1e')](function(_0x29e604){_0x4a93aa['count']=_0x29e604;if(_0x16e763[_0x69a2('0x43')]['includeAll']){_0x2a3181[_0x69a2('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2a3181);})[_0x69a2('0x1e')](function(_0x51784a){_0x4a93aa[_0x69a2('0x6e')]=_0x51784a;return _0x4a93aa;});}})['then'](respondWithFilteredResult(_0x840bf4,_0x2a3181))['catch'](handleError(_0x840bf4,null));};exports[_0x69a2('0x6f')]=function(_0x33d92c,_0x5e8749,_0x4a6d2f){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x33d92c['params']['id']}})['then'](handleEntityNotFound(_0x5e8749,null))[_0x69a2('0x1e')](function(_0x5e88a4){if(_0x5e88a4){return _0x5e88a4[_0x69a2('0x6f')](_0x33d92c['query'][_0x69a2('0x6a')]);}})['then'](respondWithStatusCode(_0x5e8749,null))[_0x69a2('0x27')](handleError(_0x5e8749,null));};exports['notify']=function(_0xa7525d,_0x21e4af,_0x29efa0){var _0x1f6872={'body':_0xa7525d['body'],'channel':_0x69a2('0x70')};var _0x26feb2=[];var _0x253396=[];var _0x122032={};var _0x35461a=![];return db[_0x69a2('0x71')][_0x69a2('0x63')]()[_0x69a2('0x1e')](function(_0x13bf6a){if(!_0x13bf6a){throw new db[(_0x69a2('0x72'))][(_0x69a2('0x73'))](_0x69a2('0x74'));}_0x26feb2=_[_0x69a2('0x75')](_['keys'](_0x13bf6a),['createdAt',_0x69a2('0x76')]);_0x253396=_['difference'](_[_0x69a2('0x42')](_0x13bf6a),['createdAt','updatedAt',_0x69a2('0x77'),_0x69a2('0x78')]);if(_0xa7525d[_0x69a2('0x59')]['id']){delete _0xa7525d[_0x69a2('0x59')]['id'];}if(_[_0x69a2('0x79')](_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7a')])){throw new db[(_0x69a2('0x72'))][(_0x69a2('0x73'))](_0x69a2('0x7b'));}if(_[_0x69a2('0x79')](_0xa7525d['body'][_0x69a2('0x59')])||_0xa7525d['body']['body']===''){throw new db['Sequelize'][(_0x69a2('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x69a2('0x79')](_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7c')])){throw new db[(_0x69a2('0x72'))][(_0x69a2('0x73'))](_0x69a2('0x7d')+_0x253396);}if(!_[_0x69a2('0x7e')](_0x253396,_0xa7525d['body'][_0x69a2('0x7c')])){throw new db[(_0x69a2('0x72'))][(_0x69a2('0x73'))](_0x69a2('0x7f')+_0x253396);}_0x122032[_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7c')]]=_0xa7525d['body'][_0x69a2('0x7a')];})[_0x69a2('0x1e')](function(){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0xa7525d['params']['id']},'include':[{'model':db['CmList'],'as':_0x69a2('0x80'),'include':[{'model':db[_0x69a2('0x71')],'as':_0x69a2('0x81'),'where':_0x122032,'limit':0x1,'order':[[_0x69a2('0x76'),_0x69a2('0x82')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x69a2('0x1e')](handleEntityNotFound(_0x21e4af,null))[_0x69a2('0x1e')](function(_0x1bac3e){if(_0x1bac3e&&_0x1bac3e[_0x69a2('0x80')]){_0x1f6872['account']=_0x1bac3e;_0x1f6872['applications']=_0x1bac3e['Applications'];_0x1f6872[_0x69a2('0x83')]=_0x1bac3e[_0x69a2('0x80')];_0x1f6872[_0x69a2('0x84')]=_[_0x69a2('0x85')](_0x1f6872[_0x69a2('0x84')],[_0x69a2('0x86')],[_0x69a2('0x87')]);if(_0x1f6872[_0x69a2('0x88')][_0x69a2('0x89')]){delete _0x1f6872[_0x69a2('0x88')][_0x69a2('0x89')];}if(_0x1f6872[_0x69a2('0x88')][_0x69a2('0x80')]&&_0x1f6872[_0x69a2('0x88')]['List']['Contacts'][_0x69a2('0x48')]){return _0x1f6872['account'][_0x69a2('0x80')]['Contacts'][0x0];}var _0x3b9b05=_[_0x69a2('0x16')](_0xa7525d[_0x69a2('0x59')],{'firstName':_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7a')],'ListId':_0x1bac3e['ListId']});_0x3b9b05[_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7c')]]=_0xa7525d['body'][_0x69a2('0x7a')];return db[_0x69a2('0x71')][_0x69a2('0x58')](_0x3b9b05,{'fields':_0x26feb2,'raw':!![]});}})[_0x69a2('0x1e')](handleEntityNotFound(_0x21e4af,null))[_0x69a2('0x1e')](function(_0x256b5d){_0x1f6872['contact']=_0x256b5d;if(_0x256b5d){var _0x4aae65={'ContactId':_0x256b5d['id'],'OpenchannelAccountId':_0xa7525d[_0x69a2('0x54')]['id'],'from':(_0x256b5d[_0x69a2('0x8a')]||'')+'\x20'+(_0x256b5d[_0x69a2('0x8b')]||'')};var _0x26577c={'OpenchannelAccountId':_0xa7525d['params']['id'],'closed':![]};if(_0xa7525d['body'][_0x69a2('0x8c')]){_0x26577c['threadId']=_0xa7525d[_0x69a2('0x59')][_0x69a2('0x8c')];return db[_0x69a2('0x8d')][_0x69a2('0x57')]({'where':_0x26577c})[_0x69a2('0x1e')](function(_0x43d3f3){if(_0x43d3f3){return[_0x43d3f3,![]];}_0x4aae65[_0x69a2('0x8c')]=_0xa7525d[_0x69a2('0x59')][_0x69a2('0x8c')];_0x4aae65[_0x69a2('0x8e')]=_0xa7525d[_0x69a2('0x59')][_0x69a2('0x8e')];return db['OpenchannelInteraction'][_0x69a2('0x58')](_0x4aae65)[_0x69a2('0x1e')](function(_0x410fc5){return[_0x410fc5,!![]];});});}else{_0x26577c['threadId']=null;}_0x26577c['ContactId']=_0x256b5d['id'];return db[_0x69a2('0x8d')]['find']({'where':_0x26577c})[_0x69a2('0x1e')](function(_0x44a856){if(_0x44a856){return[_0x44a856,![]];}return db[_0x69a2('0x8d')][_0x69a2('0x58')](_0x4aae65)[_0x69a2('0x1e')](function(_0x38fa1a){return[_0x38fa1a,!![]];});});}})['spread'](function(_0x2be60b,_0x34d133){if(_0x2be60b){_0x35461a=_0x34d133;if(!_0x34d133){var _0x150586={'from':(_0x1f6872[_0x69a2('0x8f')][_0x69a2('0x8a')]||'')+'\x20'+(_0x1f6872[_0x69a2('0x8f')][_0x69a2('0x8b')]||'')};if(_0xa7525d[_0x69a2('0x59')][_0x69a2('0x8c')]&&_0xa7525d[_0x69a2('0x59')][_0x69a2('0x90')]&&_0xa7525d[_0x69a2('0x59')]['threadId']!=_0xa7525d[_0x69a2('0x59')][_0x69a2('0x90')]){_0x150586['threadId']=_0xa7525d['body'][_0x69a2('0x90')];}return _0x2be60b[_0x69a2('0x34')](_0x150586);}else{return _0x2be60b;}}})[_0x69a2('0x1e')](function(_0x255b30){_0x1f6872[_0x69a2('0x91')]=_0x255b30[_0x69a2('0x5b')]({'plain':!![]});_0x1f6872[_0x69a2('0x91')][_0x69a2('0x92')]=_0x35461a;if(_0x1f6872[_0x69a2('0x91')][_0x69a2('0x92')]){if(_0x1f6872[_0x69a2('0x88')][_0x69a2('0x93')]){_0x1f6872[_0x69a2('0x84')]['push']({'id':0x0,'priority':_0x1f6872['applications'][_0x69a2('0x48')]+0x1,'app':'close','appdata':_0x69a2('0x94'),'interval':_0x69a2('0x95')});}}return db[_0x69a2('0x96')][_0x69a2('0x58')]({'body':_0xa7525d[_0x69a2('0x59')][_0x69a2('0x59')],'OpenchannelAccountId':_0xa7525d['params']['id'],'OpenchannelInteractionId':_0x255b30['id'],'direction':'in','ContactId':_0x1f6872[_0x69a2('0x8f')]['id'],'AttachmentId':_0xa7525d[_0x69a2('0x59')][_0x69a2('0x97')]});})[_0x69a2('0x1e')](function(_0x45a7de){_0x1f6872[_0x69a2('0x25')]=_0x45a7de;if(_0x1f6872['interaction']['UserId']){return db[_0x69a2('0x98')][_0x69a2('0x57')]({'attributes':['id','name'],'where':{'id':_0x1f6872[_0x69a2('0x91')][_0x69a2('0x99')]}})['then'](function(_0x53ed4e){if(_0x53ed4e){_0x1f6872[_0x69a2('0x84')][_0x69a2('0x9a')]({'id':0x0,'priority':0x0,'app':_0x69a2('0x9b'),'appdata':_0x53ed4e[_0x69a2('0x39')]+','+(_0x1f6872['account']['waitForTheAssignedAgent']||0xa),'interval':_0x69a2('0x95')});_0x1f6872[_0x69a2('0x9c')]=![];}return respondWithRpcPromise(_0x69a2('0x9d'),_0x69a2('0x9e'),_0x1f6872);});}return respondWithRpcPromise(_0x69a2('0x9d'),'startRouting',_0x1f6872);})['then'](function(_0x19ccd3){respondWithRpcPromise(_0x69a2('0x9f'),_0x69a2('0x9f'),{'event':_0x69a2('0xa0'),'message':_0x19ccd3},client9002);return _0x19ccd3;})['then'](respondWithResult(_0x21e4af,null))['catch'](handleError(_0x21e4af,null));};exports[_0x69a2('0xa1')]=function(_0x46c2d3,_0x2c83e3,_0xaedd91){return db[_0x69a2('0x3f')]['findOne']({'where':{'id':_0x46c2d3[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x2c83e3,null))[_0x69a2('0x1e')](function(_0x463bfd){if(_0x463bfd){return db[_0x69a2('0xa2')]['transaction'](function(_0x6450de){return db['OpenchannelApplication'][_0x69a2('0x35')]({'where':{'OpenchannelAccountId':_0x46c2d3[_0x69a2('0x54')]['id']},'transaction':_0x6450de})[_0x69a2('0x1e')](function(_0x251862){var _0x38199c=_[_0x69a2('0x3e')](_0x46c2d3[_0x69a2('0x59')],function(_0x24fcb9){_0x24fcb9[_0x69a2('0x65')]=_0x46c2d3['params']['id'];return _0x24fcb9;});return db['OpenchannelApplication'][_0x69a2('0xa3')](_0x38199c,{'transaction':_0x6450de});});})[_0x69a2('0x1e')](function(){return db[_0x69a2('0xa4')][_0x69a2('0xa5')]({'where':{'OpenchannelAccountId':_0x46c2d3[_0x69a2('0x54')]['id']},'order':_0x69a2('0x86')});});}})[_0x69a2('0x1e')](respondWithResult(_0x2c83e3,null))[_0x69a2('0x27')](handleError(_0x2c83e3,null));};exports['getApplications']=function(_0x2f90c1,_0x3ce862,_0x4cfea2){var _0x54454f={};var _0x3162f9={};var _0x29ce2b;var _0x17ac1b;return db[_0x69a2('0x3f')][_0x69a2('0x68')]({'where':{'id':_0x2f90c1[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x3ce862,null))['then'](function(_0x1ca6c4){if(_0x1ca6c4){_0x29ce2b=_0x1ca6c4;_0x3162f9[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0xa4')][_0x69a2('0x55')]);_0x3162f9[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0x2f90c1[_0x69a2('0x43')]);_0x3162f9[_0x69a2('0x44')]=_[_0x69a2('0x45')](_0x3162f9[_0x69a2('0x41')],_0x3162f9[_0x69a2('0x43')]);_0x54454f['attributes']=_['intersection'](_0x3162f9['model'],qs[_0x69a2('0x47')](_0x2f90c1[_0x69a2('0x43')][_0x69a2('0x47')]));_0x54454f['attributes']=_0x54454f['attributes'][_0x69a2('0x48')]?_0x54454f['attributes']:_0x3162f9[_0x69a2('0x41')];_0x54454f['order']=qs['sort'](_0x2f90c1['query'][_0x69a2('0x4c')]);_0x54454f['where']=qs[_0x69a2('0x44')](_[_0x69a2('0x4d')](_0x2f90c1['query'],_0x3162f9[_0x69a2('0x44')]));if(_0x2f90c1[_0x69a2('0x43')]['filter']){_0x54454f[_0x69a2('0x4f')]=_[_0x69a2('0x50')](_0x54454f[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x54454f[_0x69a2('0x46')],function(_0x2c61bc){var _0x57dbbb={};_0x57dbbb[_0x2c61bc]={'$like':'%'+_0x2f90c1[_0x69a2('0x43')]['filter']+'%'};return _0x57dbbb;})});}_0x54454f=_[_0x69a2('0x50')]({},_0x54454f,_0x2f90c1[_0x69a2('0x51')]);return _0x29ce2b[_0x69a2('0xa6')](_0x54454f);}})['then'](function(_0x202f1c){if(_0x202f1c){_0x17ac1b=_0x202f1c[_0x69a2('0x48')];if(!_0x2f90c1[_0x69a2('0x43')][_0x69a2('0x49')](_0x69a2('0x4a'))){_0x54454f[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x2f90c1[_0x69a2('0x43')]['limit']);_0x54454f[_0x69a2('0x2a')]=qs[_0x69a2('0x2a')](_0x2f90c1[_0x69a2('0x43')][_0x69a2('0x2a')]);}return _0x29ce2b[_0x69a2('0xa6')](_0x54454f);}})['then'](function(_0x2e3a37){if(_0x2e3a37){return _0x2e3a37?{'count':_0x17ac1b,'rows':_0x2e3a37}:null;}})[_0x69a2('0x1e')](respondWithResult(_0x3ce862,null))[_0x69a2('0x27')](handleError(_0x3ce862,null));};exports[_0x69a2('0xa7')]=function(_0xba3cac,_0x2137c4,_0x41575b){var _0x56603e={'raw':![],'where':{}};var _0x2e7efc={};var _0x5efbea={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x69a2('0x68')]({'where':{'id':_0xba3cac[_0x69a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x2137c4,null))[_0x69a2('0x1e')](function(_0x6afe2b){if(_0x6afe2b){_0x2e7efc[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0x8d')][_0x69a2('0x55')]);_0x2e7efc[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0xba3cac[_0x69a2('0x43')]);_0x2e7efc['filters']=_['intersection'](_0x2e7efc[_0x69a2('0x41')],_0x2e7efc[_0x69a2('0x43')]);_0x56603e[_0x69a2('0x46')]=_[_0x69a2('0x45')](_0x2e7efc[_0x69a2('0x41')],qs[_0x69a2('0x47')](_0xba3cac[_0x69a2('0x43')][_0x69a2('0x47')]));_0x56603e[_0x69a2('0x46')]=_0x56603e[_0x69a2('0x46')][_0x69a2('0x48')]?_0x56603e['attributes']:_0x2e7efc[_0x69a2('0x41')];if(!_0xba3cac[_0x69a2('0x43')][_0x69a2('0x49')](_0x69a2('0x4a'))){_0x56603e[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0xba3cac[_0x69a2('0x43')][_0x69a2('0x2c')]);_0x56603e['offset']=qs[_0x69a2('0x2a')](_0xba3cac[_0x69a2('0x43')][_0x69a2('0x2a')]);}_0x56603e[_0x69a2('0x4b')]=qs['sort'](_0xba3cac[_0x69a2('0x43')][_0x69a2('0x4c')]);_0x56603e[_0x69a2('0x4f')]=qs[_0x69a2('0x44')](_[_0x69a2('0x4d')](_0xba3cac[_0x69a2('0x43')],_0x2e7efc[_0x69a2('0x44')]));_0x56603e[_0x69a2('0x4f')][_0x69a2('0x65')]=_0x6afe2b['id'];if(_0xba3cac[_0x69a2('0x43')][_0x69a2('0x4e')]){_0x56603e[_0x69a2('0x4f')]=_[_0x69a2('0x50')](_0x56603e[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x56603e['attributes'],function(_0x5bf4b5){var _0x2878a3={};_0x2878a3[_0x5bf4b5]={'$like':'%'+_0xba3cac[_0x69a2('0x43')]['filter']+'%'};return _0x2878a3;})});}_0x56603e=_[_0x69a2('0x50')]({},_0x56603e,_0xba3cac[_0x69a2('0x51')]);return db[_0x69a2('0x8d')][_0x69a2('0x2d')]({'where':_0x56603e[_0x69a2('0x4f')]})['then'](function(_0x181a63){_0x5efbea[_0x69a2('0x2d')]=_0x181a63;if(_0xba3cac['query'][_0x69a2('0x52')]){_0x56603e[_0x69a2('0x56')]=[{'model':db[_0x69a2('0x71')],'as':_0x69a2('0xa8'),'required':![]},{'model':db[_0x69a2('0x98')],'as':'Owner','attributes':[_0x69a2('0x39'),_0x69a2('0xa9'),_0x69a2('0xaa')],'required':![]},{'model':db['Tag'],'as':_0x69a2('0xab'),'attributes':['id',_0x69a2('0x39'),_0x69a2('0xac')],'where':_0xba3cac[_0x69a2('0x43')][_0x69a2('0xad')]?{'id':_0xba3cac[_0x69a2('0x43')][_0x69a2('0xad')]}:undefined,'required':_0xba3cac[_0x69a2('0x43')][_0x69a2('0xad')]?!![]:![]}];}return db[_0x69a2('0x8d')]['findAll'](_0x56603e);})['then'](function(_0x43eb2f){_0x5efbea[_0x69a2('0x6e')]=_0x43eb2f;return _0x5efbea;});}})[_0x69a2('0x1e')](respondWithFilteredResult(_0x2137c4,_0x56603e))['catch'](handleError(_0x2137c4,null));};exports[_0x69a2('0xae')]=function(_0x129b5e,_0xa60817,_0x50e564){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x129b5e[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0xa60817,null))[_0x69a2('0x1e')](function(_0x2d5c2b){if(_0x2d5c2b){return _0x2d5c2b[_0x69a2('0xae')](_0x129b5e['body'][_0x69a2('0x6a')],_[_0x69a2('0xaf')](_0x129b5e[_0x69a2('0x59')],[_0x69a2('0x6a'),'id'])||{})[_0x69a2('0xb0')](function(_0x2c8e8f){for(var _0x1610ad=0x0;_0x1610ad<_0x129b5e[_0x69a2('0x59')]['ids'][_0x69a2('0x48')];_0x1610ad+=0x1){socket[_0x69a2('0xb1')](_0x69a2('0xb2'),{'UserId':Number(_0x129b5e[_0x69a2('0x59')][_0x69a2('0x6a')][_0x1610ad]),'OpenchannelAccountId':Number(_0x129b5e[_0x69a2('0x54')]['id'])});}return _0x2c8e8f;});}})[_0x69a2('0x1e')](respondWithResult(_0xa60817,null))[_0x69a2('0x27')](handleError(_0xa60817,null));};exports['removeAgents']=function(_0xfaabf6,_0x17dbc3,_0xe81c8b){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0xfaabf6[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x17dbc3,null))[_0x69a2('0x1e')](function(_0x303fe3){if(_0x303fe3){return _0x303fe3['removeAgents'](_0xfaabf6[_0x69a2('0x43')][_0x69a2('0x6a')])[_0x69a2('0x1e')](function(){if(_[_0x69a2('0xb3')](_0xfaabf6[_0x69a2('0x43')][_0x69a2('0x6a')])){for(var _0x3c410e=0x0;_0x3c410e<_0xfaabf6[_0x69a2('0x43')]['ids'][_0x69a2('0x48')];_0x3c410e+=0x1){socket[_0x69a2('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0xfaabf6[_0x69a2('0x43')][_0x69a2('0x6a')][_0x3c410e]),'OpenchannelAccountId':Number(_0xfaabf6[_0x69a2('0x54')]['id'])});}}else{socket[_0x69a2('0xb1')](_0x69a2('0xb4'),{'UserId':Number(_0xfaabf6[_0x69a2('0x43')][_0x69a2('0x6a')]),'OpenchannelAccountId':Number(_0xfaabf6['params']['id'])});}});}})[_0x69a2('0x1e')](respondWithStatusCode(_0x17dbc3,null))[_0x69a2('0x27')](handleError(_0x17dbc3,null));};exports[_0x69a2('0xb5')]=function(_0x2cc533,_0x4f48f5,_0x4e8336){var _0x3ceebb={};var _0x8fb723={};var _0x1d9d34;var _0x1ff196;return db[_0x69a2('0x3f')]['findOne']({'where':{'id':_0x2cc533[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x4f48f5,null))[_0x69a2('0x1e')](function(_0x37362f){if(_0x37362f){_0x1d9d34=_0x37362f;_0x8fb723[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0x98')]['rawAttributes']);_0x8fb723[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0x2cc533['query']);_0x8fb723['filters']=_['intersection'](_0x8fb723[_0x69a2('0x41')],_0x8fb723[_0x69a2('0x43')]);_0x3ceebb[_0x69a2('0x46')]=_['intersection'](_0x8fb723[_0x69a2('0x41')],qs[_0x69a2('0x47')](_0x2cc533[_0x69a2('0x43')][_0x69a2('0x47')]));_0x3ceebb[_0x69a2('0x46')]=_0x3ceebb['attributes'][_0x69a2('0x48')]?_0x3ceebb[_0x69a2('0x46')]:_0x8fb723['model'];_0x3ceebb['order']=qs[_0x69a2('0x4c')](_0x2cc533[_0x69a2('0x43')]['sort']);_0x3ceebb[_0x69a2('0x4f')]=qs['filters'](_[_0x69a2('0x4d')](_0x2cc533[_0x69a2('0x43')],_0x8fb723['filters']));if(_0x2cc533[_0x69a2('0x43')][_0x69a2('0x4e')]){_0x3ceebb[_0x69a2('0x4f')]=_['merge'](_0x3ceebb[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x3ceebb[_0x69a2('0x46')],function(_0xe96a62){var _0x803f1c={};_0x803f1c[_0xe96a62]={'$like':'%'+_0x2cc533[_0x69a2('0x43')][_0x69a2('0x4e')]+'%'};return _0x803f1c;})});}_0x3ceebb=_[_0x69a2('0x50')]({},_0x3ceebb,_0x2cc533[_0x69a2('0x51')]);return _0x1d9d34[_0x69a2('0xb5')](_0x3ceebb);}})[_0x69a2('0x1e')](function(_0x2fb06b){if(_0x2fb06b){_0x1ff196=_0x2fb06b[_0x69a2('0x48')];if(!_0x2cc533[_0x69a2('0x43')][_0x69a2('0x49')]('nolimit')){_0x3ceebb[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x2cc533[_0x69a2('0x43')][_0x69a2('0x2c')]);_0x3ceebb[_0x69a2('0x2a')]=qs['offset'](_0x2cc533['query'][_0x69a2('0x2a')]);}return _0x1d9d34[_0x69a2('0xb5')](_0x3ceebb);}})[_0x69a2('0x1e')](function(_0x578114){if(_0x578114){return _0x578114?{'count':_0x1ff196,'rows':_0x578114}:null;}})[_0x69a2('0x1e')](respondWithResult(_0x4f48f5,null))[_0x69a2('0x27')](handleError(_0x4f48f5,null));};exports[_0x69a2('0x3a')]=function(_0x3b9c12,_0x56b5e5,_0x40f7ef){var _0x19253f,_0x2334c5,_0x2dbc6e;if(_[_0x69a2('0x79')](_0x3b9c12[_0x69a2('0x59')][_0x69a2('0x59')])||_0x3b9c12['body'][_0x69a2('0x59')]===''){throw new db[(_0x69a2('0x72'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x69a2('0x79')](_0x3b9c12[_0x69a2('0x59')]['to'])){}_0x19253f=_0x3b9c12[_0x69a2('0x59')]['to'];return db[_0x69a2('0x3f')][_0x69a2('0x68')]({'where':{'id':_0x3b9c12[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x56b5e5,null))[_0x69a2('0x1e')](function(_0x1ba34b){if(_0x1ba34b){return db['OpenchannelAccount'][_0x69a2('0x57')]({'where':{'id':_0x1ba34b['id']},'include':[{'model':db[_0x69a2('0xb6')],'as':_0x69a2('0x80'),'include':[{'model':db[_0x69a2('0x71')],'as':_0x69a2('0x81'),'where':{[_0x1ba34b[_0x69a2('0x7c')]]:_0x19253f},'limit':0x1,'order':[['updatedAt',_0x69a2('0x82')]]}]}]})[_0x69a2('0x1e')](handleEntityNotFound(_0x56b5e5,null))[_0x69a2('0x1e')](function(_0x376f8e){if(_0x376f8e&&_0x376f8e[_0x69a2('0x80')]){_0x2334c5=_0x376f8e[_0x69a2('0x5b')]({'plain':!![]});if(_0x2334c5['List']&&_0x2334c5[_0x69a2('0x80')]['Contacts']['length']){return _0x2334c5[_0x69a2('0x80')]['Contacts'][0x0];}return db['CmContact'][_0x69a2('0x58')](_[_0x69a2('0x16')](_0x3b9c12[_0x69a2('0x59')],{'firstName':_0x19253f,[_0x376f8e['mapKey']]:_0x19253f,'phone':_0x19253f,'ListId':_0x2334c5['ListId']}));}})[_0x69a2('0x1e')](handleEntityNotFound(_0x56b5e5,null))[_0x69a2('0x1e')](function(_0x24d568){if(_0x24d568){_0x2dbc6e=_0x24d568;return db[_0x69a2('0x8d')][_0x69a2('0x57')]({'where':{'ContactId':_0x2dbc6e['id'],'closed':![],'OpenchannelAccountId':_0x2334c5['id']}})[_0x69a2('0x1e')](function(_0x22499f){if(_0x22499f){return[_0x22499f,![]];}return db[_0x69a2('0x8d')][_0x69a2('0x58')]({'UserId':_0x3b9c12[_0x69a2('0x5a')]['id'],'ContactId':_0x2dbc6e['id'],'OpenchannelAccountId':_0x2334c5['id'],'lastMsgDirection':_0x69a2('0xb7'),'Messages':[_[_0x69a2('0x50')](_0x3b9c12[_0x69a2('0x59')],{'read':![],'body':_0x3b9c12[_0x69a2('0x59')][_0x69a2('0x59')],'OpenchannelAccountId':_0x2334c5['id'],'UserId':_0x3b9c12['user']['id'],'ContactId':_0x2dbc6e['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x69a2('0xb8')}]})[_0x69a2('0x1e')](function(_0x175244){return[_0x175244,!![]];});});}})[_0x69a2('0xb0')](function(_0x5e862f,_0x163964){if(_0x163964){return _0x5e862f;}return db[_0x69a2('0x96')][_0x69a2('0x58')](_['merge'](_0x3b9c12[_0x69a2('0x59')],{'read':![],'body':_0x3b9c12[_0x69a2('0x59')][_0x69a2('0x59')],'OpenchannelAccountId':_0x2334c5['id'],'OpenchannelInteractionId':_0x5e862f['id'],'UserId':_0x3b9c12[_0x69a2('0x5a')]['id'],'ContactId':_0x2dbc6e['id']}))[_0x69a2('0x1e')](function(_0x2b52cd){_0x5e862f[_0x69a2('0xb9')][_0x69a2('0xb8')]=[];_0x5e862f['dataValues'][_0x69a2('0xb8')][_0x69a2('0xba')](_0x2b52cd['dataValues']);return _0x5e862f;});});}})[_0x69a2('0x1e')](respondWithResult(_0x56b5e5,null))['catch'](handleError(_0x56b5e5,null));};
\ No newline at end of file
index fcd8186..d95d668 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda55=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xda55,0x6d));var _0x5da5=function(_0x49cfb6,_0x5ccff2){_0x49cfb6=_0x49cfb6-0x0;var _0x1ba905=_0xda55[_0x49cfb6];return _0x1ba905;};'use strict';var EventEmitter=require(_0x5da5('0x0'));var OpenchannelAccount=require(_0x5da5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5da5('0x2'),'afterUpdate':_0x5da5('0x3'),'afterDestroy':_0x5da5('0x4')};function emitEvent(_0x50cf9f){return function(_0x1c3afd,_0x5da254,_0x3400e9){OpenchannelAccountEvents['emit'](_0x50cf9f+':'+_0x1c3afd['id'],_0x1c3afd);OpenchannelAccountEvents[_0x5da5('0x5')](_0x50cf9f,_0x1c3afd);_0x3400e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x5da5('0x6')](e,emitEvent(event));}}module[_0x5da5('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x878f=['hook','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x352de7,_0xff4ac7){var _0x1fa898=function(_0x370537){while(--_0x370537){_0x352de7['push'](_0x352de7['shift']());}};_0x1fa898(++_0xff4ac7);}(_0x878f,0x173));var _0xf878=function(_0x19dc06,_0x387829){_0x19dc06=_0x19dc06-0x0;var _0x387a25=_0x878f[_0x19dc06];return _0x387a25;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xf878('0x0'))['db'][_0xf878('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf878('0x2')](0x0);var events={'afterCreate':_0xf878('0x3'),'afterUpdate':_0xf878('0x4'),'afterDestroy':_0xf878('0x5')};function emitEvent(_0x9e6783){return function(_0x45a37b,_0x240b48,_0xcf1927){OpenchannelAccountEvents[_0xf878('0x6')](_0x9e6783+':'+_0x45a37b['id'],_0x45a37b);OpenchannelAccountEvents['emit'](_0x9e6783,_0x45a37b);_0xcf1927(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xf878('0x7')](e,emitEvent(event));}}module[_0xf878('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
index 0726325..4155abb 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(_0x592e8c,_0x53ff3e){var _0x40841a=function(_0x2b541){while(--_0x2b541){_0x592e8c['push'](_0x592e8c['shift']());}};_0x40841a(++_0x53ff3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2c3a64,_0x1cbae3){var _0x16a141=function(_0x41b1d5){while(--_0x41b1d5){_0x2c3a64['push'](_0x2c3a64['shift']());}};_0x16a141(++_0x1cbae3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 aa8b469..19e1cc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae60=['client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x5be8a0,_0x13fb71){var _0x3373a2=function(_0x1de76f){while(--_0x1de76f){_0x5be8a0['push'](_0x5be8a0['shift']());}};_0x3373a2(++_0x13fb71);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xae60[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});config[_0x0ae6('0xb')]=_[_0x0ae6('0xc')](config[_0x0ae6('0xb')],{'host':_0x0ae6('0xd'),'port':0x18eb});var socket=require(_0x0ae6('0xe'))(new Redis(config['redis']));require(_0x0ae6('0xf'))[_0x0ae6('0x10')](socket);function respondWithRpcPromise(_0x3a8b0e,_0x39787a,_0x4c2698){return new BPromise(function(_0x24e211,_0x1def8c){return client[_0x0ae6('0x11')](_0x3a8b0e,_0x4c2698)[_0x0ae6('0x12')](function(_0x3ae7fa){logger[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x39787a,_0x0ae6('0x15'));logger[_0x0ae6('0x16')](_0x0ae6('0x17'),_0x39787a,_0x0ae6('0x15'),JSON[_0x0ae6('0x18')](_0x3ae7fa));if(_0x3ae7fa[_0x0ae6('0x19')]){if(_0x3ae7fa[_0x0ae6('0x19')]['code']===0x1f4){logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);return _0x1def8c(_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);}logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);return _0x24e211(_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);}else{logger[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x39787a,_0x0ae6('0x15'));_0x24e211(_0x3ae7fa[_0x0ae6('0x1b')][_0x0ae6('0x1a')]);}})[_0x0ae6('0x1c')](function(_0x2ca2a3){logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x2ca2a3);_0x1def8c(_0x2ca2a3);});});}
\ No newline at end of file
+var _0x8caf=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug'];(function(_0x3221ae,_0x10dd4c){var _0x314b92=function(_0x4886a0){while(--_0x4886a0){_0x3221ae['push'](_0x3221ae['shift']());}};_0x314b92(++_0x10dd4c);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x1cc4e1,_0x1629d4){_0x1cc4e1=_0x1cc4e1-0x0;var _0x192d47=_0x8caf[_0x1cc4e1];return _0x192d47;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var moment=require(_0xf8ca('0x1'));var BPromise=require(_0xf8ca('0x2'));var rs=require(_0xf8ca('0x3'));var fs=require('fs');var Redis=require(_0xf8ca('0x4'));var db=require(_0xf8ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8ca('0x6'))(_0xf8ca('0x7'));var config=require(_0xf8ca('0x8'));var jayson=require(_0xf8ca('0x9'));var client=jayson[_0xf8ca('0xa')][_0xf8ca('0xb')]({'port':0x232a});config['redis']=_[_0xf8ca('0xc')](config[_0xf8ca('0xd')],{'host':_0xf8ca('0xe'),'port':0x18eb});var socket=require(_0xf8ca('0xf'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xf8ca('0x10')](socket);function respondWithRpcPromise(_0x576e9d,_0x2f67c5,_0x2e86a6){return new BPromise(function(_0x2daa43,_0x2be477){return client['request'](_0x576e9d,_0x2e86a6)[_0xf8ca('0x11')](function(_0x6f3f7b){logger[_0xf8ca('0x12')](_0xf8ca('0x13'),_0x2f67c5,'request\x20sent');logger[_0xf8ca('0x14')](_0xf8ca('0x15'),_0x2f67c5,'request\x20sent',JSON[_0xf8ca('0x16')](_0x6f3f7b));if(_0x6f3f7b[_0xf8ca('0x17')]){if(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x18')]===0x1f4){logger[_0xf8ca('0x17')](_0xf8ca('0x13'),_0x2f67c5,_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);return _0x2be477(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);}logger['error'](_0xf8ca('0x13'),_0x2f67c5,_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);return _0x2daa43(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);}else{logger[_0xf8ca('0x12')](_0xf8ca('0x13'),_0x2f67c5,_0xf8ca('0x1a'));_0x2daa43(_0x6f3f7b['result'][_0xf8ca('0x19')]);}})[_0xf8ca('0x1b')](function(_0x17eefa){logger[_0xf8ca('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f67c5,_0x17eefa);_0x2be477(_0x17eefa);});});}
\ No newline at end of file
index bbb27dd..cfd7a5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4876=['length','openchannelAccount:','remove','emit','removeListener'];(function(_0x1261fa,_0x91b0cc){var _0x5eacb9=function(_0x15575e){while(--_0x15575e){_0x1261fa['push'](_0x1261fa['shift']());}};_0x5eacb9(++_0x91b0cc);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x6487('0x0'),'update'];function createListener(_0x502614,_0x236189){return function(_0x498e31){_0x236189[_0x6487('0x1')](_0x502614,_0x498e31);};}function removeListener(_0x2bace9,_0x192d3c){return function(){OpenchannelAccountEvents[_0x6487('0x2')](_0x2bace9,_0x192d3c);};}exports['register']=function(_0x23e50b){for(var _0x856b1c=0x0,_0x52177e=events[_0x6487('0x3')];_0x856b1c<_0x52177e;_0x856b1c++){var _0x14d6d8=events[_0x856b1c];var _0x2df3c1=createListener(_0x6487('0x4')+_0x14d6d8,_0x23e50b);OpenchannelAccountEvents['on'](_0x14d6d8,_0x2df3c1);}};
\ No newline at end of file
+var _0xedd9=['removeListener','register','length','openchannelAccount:','save','remove','update','emit'];(function(_0x418ddf,_0xd714a8){var _0x1be0d5=function(_0x27603c){while(--_0x27603c){_0x418ddf['push'](_0x418ddf['shift']());}};_0x1be0d5(++_0xd714a8);}(_0xedd9,0xfc));var _0x9edd=function(_0x249d4b,_0xf8d113){_0x249d4b=_0x249d4b-0x0;var _0x42f9db=_0xedd9[_0x249d4b];return _0x42f9db;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){OpenchannelAccountEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);OpenchannelAccountEvents['on'](_0x571af9,_0x172522);}};
\ No newline at end of file
index 2ce1b03..4a3682c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0314=['fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x28d819,_0x523fc5){var _0x40acc1=function(_0x54e27c){while(--_0x54e27c){_0x28d819['push'](_0x28d819['shift']());}};_0x40acc1(++_0x523fc5);}(_0x0314,0x12d));var _0x4031=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0314[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4031('0x0'));var util=require(_0x4031('0x1'));var path=require(_0x4031('0x2'));var timeout=require(_0x4031('0x3'));var express=require(_0x4031('0x4'));var router=express['Router']();var fs_extra=require(_0x4031('0x5'));var auth=require(_0x4031('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4031('0x7'));var controller=require(_0x4031('0x8'));router[_0x4031('0x9')]('/',auth[_0x4031('0xa')](),controller[_0x4031('0xb')]);router[_0x4031('0x9')]('/:id',auth[_0x4031('0xa')](),controller['show']);router['post']('/',auth[_0x4031('0xa')](),controller[_0x4031('0xc')]);router[_0x4031('0xd')](_0x4031('0xe'),auth[_0x4031('0xa')](),controller['update']);router[_0x4031('0xf')](_0x4031('0xe'),auth[_0x4031('0xa')](),controller[_0x4031('0x10')]);module[_0x4031('0x11')]=router;
\ No newline at end of file
+var _0x0364=['isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','/:id','show','post','create','put'];(function(_0x430db0,_0x385280){var _0x11ee02=function(_0x402253){while(--_0x402253){_0x430db0['push'](_0x430db0['shift']());}};_0x11ee02(++_0x385280);}(_0x0364,0x16d));var _0x4036=function(_0x4e6e24,_0x2388a3){_0x4e6e24=_0x4e6e24-0x0;var _0x118f40=_0x0364[_0x4e6e24];return _0x118f40;};'use strict';var multer=require(_0x4036('0x0'));var util=require(_0x4036('0x1'));var path=require('path');var timeout=require(_0x4036('0x2'));var express=require('express');var router=express[_0x4036('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4036('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4036('0x5'));var controller=require(_0x4036('0x6'));router[_0x4036('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4036('0x8'),auth['isAuthenticated'](),controller[_0x4036('0x9')]);router[_0x4036('0xa')]('/',auth['isAuthenticated'](),controller[_0x4036('0xb')]);router[_0x4036('0xc')](_0x4036('0x8'),auth[_0x4036('0xd')](),controller[_0x4036('0xe')]);router[_0x4036('0xf')](_0x4036('0x8'),auth[_0x4036('0xd')](),controller[_0x4036('0x10')]);module[_0x4036('0x11')]=router;
\ No newline at end of file
index ce579f7..9cb0a87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91c6=['noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0xf60092,_0x4d5642){var _0x4245ac=function(_0x508910){while(--_0x508910){_0xf60092['push'](_0xf60092['shift']());}};_0x4245ac(++_0x4d5642);}(_0x91c6,0x6a));var _0x691c=function(_0x520570,_0x4490){_0x520570=_0x520570-0x0;var _0x30247a=_0x91c6[_0x520570];return _0x30247a;};'use strict';var Sequelize=require(_0x691c('0x0'));module[_0x691c('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x691c('0x2')},'appdata':{'type':Sequelize[_0x691c('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x691c('0x4')],'defaultValue':_0x691c('0x5')}};
\ No newline at end of file
+var _0x2670=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2670,0xed));var _0x0267=function(_0x328fc2,_0x1fe6f3){_0x328fc2=_0x328fc2-0x0;var _0x136815=_0x2670[_0x328fc2];return _0x136815;};'use strict';var Sequelize=require(_0x0267('0x0'));module[_0x0267('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0267('0x2')],'allowNull':![],'defaultValue':_0x0267('0x3')},'appdata':{'type':Sequelize[_0x0267('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0267('0x2')],'defaultValue':_0x0267('0x5')}};
\ No newline at end of file
index bed23e6..36d8f75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd4=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','end','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','fields','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x1721a6,_0x1afe1e){var _0x1f6b11=function(_0x459d04){while(--_0x459d04){_0x1721a6['push'](_0x1721a6['shift']());}};_0x1f6b11(++_0x1afe1e);}(_0x4bd4,0x1dd));var _0x44bd=function(_0x1451d8,_0x5b4080){_0x1451d8=_0x1451d8-0x0;var _0x4c2c58=_0x4bd4[_0x1451d8];return _0x4c2c58;};'use strict';var emlformat=require(_0x44bd('0x0'));var rimraf=require(_0x44bd('0x1'));var zipdir=require(_0x44bd('0x2'));var jsonpatch=require(_0x44bd('0x3'));var rp=require(_0x44bd('0x4'));var moment=require(_0x44bd('0x5'));var BPromise=require(_0x44bd('0x6'));var Mustache=require(_0x44bd('0x7'));var util=require(_0x44bd('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44bd('0x9'));var fs=require('fs');var fs_extra=require(_0x44bd('0xa'));var _=require(_0x44bd('0xb'));var squel=require(_0x44bd('0xc'));var crypto=require(_0x44bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x44bd('0xe'));var toCsv=require(_0x44bd('0xf'));var querystring=require(_0x44bd('0x10'));var Papa=require('papaparse');var Redis=require(_0x44bd('0x11'));var authService=require(_0x44bd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x44bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44bd('0x14'))(_0x44bd('0x15'));var utils=require(_0x44bd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x44bd('0x17'));var db=require(_0x44bd('0x18'))['db'];function respondWithStatusCode(_0x12234b,_0x2e167c){_0x2e167c=_0x2e167c||0xcc;return function(_0x527634){if(_0x527634){return _0x12234b['sendStatus'](_0x2e167c);}return _0x12234b[_0x44bd('0x19')](_0x2e167c)['end']();};}function respondWithResult(_0x7dff55,_0x4c1dcf){_0x4c1dcf=_0x4c1dcf||0xc8;return function(_0x44caf4){if(_0x44caf4){return _0x7dff55['status'](_0x4c1dcf)[_0x44bd('0x1a')](_0x44caf4);}};}function respondWithFilteredResult(_0x4296a3,_0x465b5a){return function(_0x44a8e3){if(_0x44a8e3){var _0x29e06b=typeof _0x465b5a['offset']===_0x44bd('0x1b')&&typeof _0x465b5a[_0x44bd('0x1c')]===_0x44bd('0x1b');var _0x4b058f=_0x44a8e3[_0x44bd('0x1d')];var _0x18b4da=_0x29e06b?0x0:_0x465b5a[_0x44bd('0x1e')];var _0x1a03f6=_0x29e06b?_0x44a8e3[_0x44bd('0x1d')]:_0x465b5a[_0x44bd('0x1e')]+_0x465b5a[_0x44bd('0x1c')];var _0x2f5ac0;if(_0x1a03f6>=_0x4b058f){_0x1a03f6=_0x4b058f;_0x2f5ac0=0xc8;}else{_0x2f5ac0=0xce;}_0x4296a3[_0x44bd('0x19')](_0x2f5ac0);return _0x4296a3[_0x44bd('0x1f')]('Content-Range',_0x18b4da+'-'+_0x1a03f6+'/'+_0x4b058f)[_0x44bd('0x1a')](_0x44a8e3);}return null;};}function patchUpdates(_0x5d4134){return function(_0x4bd69b){try{jsonpatch[_0x44bd('0x20')](_0x4bd69b,_0x5d4134,!![]);}catch(_0x366e50){return BPromise[_0x44bd('0x21')](_0x366e50);}return _0x4bd69b[_0x44bd('0x22')]();};}function saveUpdates(_0x287b18,_0x4d1286){return function(_0x20775e){if(_0x20775e){return _0x20775e[_0x44bd('0x23')](_0x287b18)[_0x44bd('0x24')](function(_0x236ae2){return _0x236ae2;});}return null;};}function removeEntity(_0x2415aa,_0x1f892b){return function(_0x34877d){if(_0x34877d){return _0x34877d['destroy']()[_0x44bd('0x24')](function(){_0x2415aa[_0x44bd('0x19')](0xcc)[_0x44bd('0x25')]();});}};}function handleEntityNotFound(_0x44b54e,_0x4debd5){return function(_0x330a0a){if(!_0x330a0a){_0x44b54e['sendStatus'](0x194);}return _0x330a0a;};}function handleError(_0x4faf7a,_0x48f03d){_0x48f03d=_0x48f03d||0x1f4;return function(_0x139e54){logger['error'](_0x139e54[_0x44bd('0x26')]);if(_0x139e54[_0x44bd('0x27')]){delete _0x139e54['name'];}_0x4faf7a[_0x44bd('0x19')](_0x48f03d)['send'](_0x139e54);};}exports[_0x44bd('0x28')]=function(_0x5a792b,_0xc624b6){var _0x161d0a={},_0x5cdeee={},_0x4a05c4={'count':0x0,'rows':[]};var _0x3b2ddc=_[_0x44bd('0x29')](db[_0x44bd('0x2a')][_0x44bd('0x2b')],function(_0x56a343){return{'name':_0x56a343[_0x44bd('0x2c')],'type':_0x56a343[_0x44bd('0x2d')]['key']};});_0x5cdeee[_0x44bd('0x2e')]=_[_0x44bd('0x29')](_0x3b2ddc,'name');_0x5cdeee['query']=_[_0x44bd('0x2f')](_0x5a792b[_0x44bd('0x30')]);_0x5cdeee['filters']=_[_0x44bd('0x31')](_0x5cdeee[_0x44bd('0x2e')],_0x5cdeee[_0x44bd('0x30')]);_0x161d0a['attributes']=_[_0x44bd('0x31')](_0x5cdeee[_0x44bd('0x2e')],qs['fields'](_0x5a792b['query']['fields']));_0x161d0a['attributes']=_0x161d0a[_0x44bd('0x32')][_0x44bd('0x33')]?_0x161d0a[_0x44bd('0x32')]:_0x5cdeee[_0x44bd('0x2e')];if(!_0x5a792b[_0x44bd('0x30')]['hasOwnProperty'](_0x44bd('0x34'))){_0x161d0a['limit']=qs[_0x44bd('0x1c')](_0x5a792b[_0x44bd('0x30')][_0x44bd('0x1c')]);_0x161d0a[_0x44bd('0x1e')]=qs[_0x44bd('0x1e')](_0x5a792b[_0x44bd('0x30')][_0x44bd('0x1e')]);}_0x161d0a['order']=qs[_0x44bd('0x35')](_0x5a792b[_0x44bd('0x30')][_0x44bd('0x35')]);_0x161d0a[_0x44bd('0x36')]=qs['filters'](_['pick'](_0x5a792b[_0x44bd('0x30')],_0x5cdeee[_0x44bd('0x37')]),_0x3b2ddc);if(_0x5a792b[_0x44bd('0x30')][_0x44bd('0x38')]){_0x161d0a[_0x44bd('0x36')]=_[_0x44bd('0x39')](_0x161d0a[_0x44bd('0x36')],{'$or':_['map'](_0x3b2ddc,function(_0xb9935c){if(_0xb9935c[_0x44bd('0x2d')]!==_0x44bd('0x3a')){var _0x5d9946={};_0x5d9946[_0xb9935c[_0x44bd('0x27')]]={'$like':'%'+_0x5a792b[_0x44bd('0x30')][_0x44bd('0x38')]+'%'};return _0x5d9946;}})});}_0x161d0a=_[_0x44bd('0x39')]({},_0x161d0a,_0x5a792b[_0x44bd('0x3b')]);var _0x2362cc={'where':_0x161d0a['where']};return db[_0x44bd('0x2a')][_0x44bd('0x1d')](_0x2362cc)[_0x44bd('0x24')](function(_0x16582e){_0x4a05c4[_0x44bd('0x1d')]=_0x16582e;if(_0x5a792b['query'][_0x44bd('0x3c')]){_0x161d0a['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x44bd('0x3d')](_0x161d0a);})[_0x44bd('0x24')](function(_0x2c0311){_0x4a05c4[_0x44bd('0x3e')]=_0x2c0311;return _0x4a05c4;})[_0x44bd('0x24')](respondWithFilteredResult(_0xc624b6,_0x161d0a))[_0x44bd('0x3f')](handleError(_0xc624b6,null));};exports['show']=function(_0x1375b6,_0x3e4f52){var _0x360516={'raw':!![],'where':{'id':_0x1375b6[_0x44bd('0x40')]['id']}},_0x4ac099={};_0x4ac099[_0x44bd('0x2e')]=_[_0x44bd('0x2f')](db[_0x44bd('0x2a')][_0x44bd('0x2b')]);_0x4ac099[_0x44bd('0x30')]=_[_0x44bd('0x2f')](_0x1375b6[_0x44bd('0x30')]);_0x4ac099[_0x44bd('0x37')]=_['intersection'](_0x4ac099[_0x44bd('0x2e')],_0x4ac099[_0x44bd('0x30')]);_0x360516[_0x44bd('0x32')]=_[_0x44bd('0x31')](_0x4ac099[_0x44bd('0x2e')],qs[_0x44bd('0x41')](_0x1375b6[_0x44bd('0x30')]['fields']));_0x360516[_0x44bd('0x32')]=_0x360516[_0x44bd('0x32')][_0x44bd('0x33')]?_0x360516[_0x44bd('0x32')]:_0x4ac099[_0x44bd('0x2e')];if(_0x1375b6['query'][_0x44bd('0x3c')]){_0x360516[_0x44bd('0x42')]=[{'all':!![]}];}_0x360516=_[_0x44bd('0x39')]({},_0x360516,_0x1375b6[_0x44bd('0x3b')]);return db[_0x44bd('0x2a')][_0x44bd('0x43')](_0x360516)[_0x44bd('0x24')](handleEntityNotFound(_0x3e4f52,null))['then'](respondWithResult(_0x3e4f52,null))[_0x44bd('0x3f')](handleError(_0x3e4f52,null));};exports[_0x44bd('0x44')]=function(_0x3b7c3b,_0x34ee8e){return db[_0x44bd('0x2a')]['create'](_0x3b7c3b['body'],{})[_0x44bd('0x24')](respondWithResult(_0x34ee8e,0xc9))[_0x44bd('0x3f')](handleError(_0x34ee8e,null));};exports[_0x44bd('0x23')]=function(_0x369c9f,_0x5e8dee){if(_0x369c9f[_0x44bd('0x45')]['id']){delete _0x369c9f[_0x44bd('0x45')]['id'];}return db[_0x44bd('0x2a')][_0x44bd('0x43')]({'where':{'id':_0x369c9f[_0x44bd('0x40')]['id']}})[_0x44bd('0x24')](handleEntityNotFound(_0x5e8dee,null))[_0x44bd('0x24')](saveUpdates(_0x369c9f[_0x44bd('0x45')],null))[_0x44bd('0x24')](respondWithResult(_0x5e8dee,null))[_0x44bd('0x3f')](handleError(_0x5e8dee,null));};exports[_0x44bd('0x46')]=function(_0x3862fa,_0x5d58d1){return db[_0x44bd('0x2a')][_0x44bd('0x43')]({'where':{'id':_0x3862fa['params']['id']}})[_0x44bd('0x24')](handleEntityNotFound(_0x5d58d1,null))['then'](removeEntity(_0x5d58d1,null))[_0x44bd('0x3f')](handleError(_0x5d58d1,null));};
\ No newline at end of file
+var _0x6e61=['include','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','OpenchannelApplication','then','includeAll'];(function(_0x2dc1bc,_0x18255b){var _0x57fda9=function(_0x35e3f9){while(--_0x35e3f9){_0x2dc1bc['push'](_0x2dc1bc['shift']());}};_0x57fda9(++_0x18255b);}(_0x6e61,0x1ab));var _0x16e6=function(_0x300b55,_0x1ca5f8){_0x300b55=_0x300b55-0x0;var _0x144472=_0x6e61[_0x300b55];return _0x144472;};'use strict';var emlformat=require(_0x16e6('0x0'));var rimraf=require(_0x16e6('0x1'));var zipdir=require(_0x16e6('0x2'));var jsonpatch=require(_0x16e6('0x3'));var rp=require(_0x16e6('0x4'));var moment=require(_0x16e6('0x5'));var BPromise=require(_0x16e6('0x6'));var Mustache=require(_0x16e6('0x7'));var util=require('util');var path=require(_0x16e6('0x8'));var sox=require(_0x16e6('0x9'));var csv=require(_0x16e6('0xa'));var ejs=require(_0x16e6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x16e6('0xc'));var crypto=require(_0x16e6('0xd'));var jsforce=require(_0x16e6('0xe'));var deskjs=require(_0x16e6('0xf'));var toCsv=require(_0x16e6('0xa'));var querystring=require(_0x16e6('0x10'));var Papa=require(_0x16e6('0x11'));var Redis=require('ioredis');var authService=require(_0x16e6('0x12'));var qs=require(_0x16e6('0x13'));var as=require(_0x16e6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x16e6('0x15'))['db'];function respondWithStatusCode(_0x38e7c8,_0x404f36){_0x404f36=_0x404f36||0xcc;return function(_0x26e446){if(_0x26e446){return _0x38e7c8[_0x16e6('0x16')](_0x404f36);}return _0x38e7c8[_0x16e6('0x17')](_0x404f36)['end']();};}function respondWithResult(_0x1c2dcb,_0x432547){_0x432547=_0x432547||0xc8;return function(_0x2a3d46){if(_0x2a3d46){return _0x1c2dcb[_0x16e6('0x17')](_0x432547)[_0x16e6('0x18')](_0x2a3d46);}};}function respondWithFilteredResult(_0x533112,_0x44b12d){return function(_0x383144){if(_0x383144){var _0x2c75cf=typeof _0x44b12d['offset']===_0x16e6('0x19')&&typeof _0x44b12d[_0x16e6('0x1a')]===_0x16e6('0x19');var _0x13fe2a=_0x383144[_0x16e6('0x1b')];var _0x3c935b=_0x2c75cf?0x0:_0x44b12d[_0x16e6('0x1c')];var _0x269afc=_0x2c75cf?_0x383144[_0x16e6('0x1b')]:_0x44b12d[_0x16e6('0x1c')]+_0x44b12d[_0x16e6('0x1a')];var _0x43d43e;if(_0x269afc>=_0x13fe2a){_0x269afc=_0x13fe2a;_0x43d43e=0xc8;}else{_0x43d43e=0xce;}_0x533112[_0x16e6('0x17')](_0x43d43e);return _0x533112[_0x16e6('0x1d')](_0x16e6('0x1e'),_0x3c935b+'-'+_0x269afc+'/'+_0x13fe2a)['json'](_0x383144);}return null;};}function patchUpdates(_0x295f82){return function(_0x3a2f01){try{jsonpatch[_0x16e6('0x1f')](_0x3a2f01,_0x295f82,!![]);}catch(_0x2c3d92){return BPromise[_0x16e6('0x20')](_0x2c3d92);}return _0x3a2f01[_0x16e6('0x21')]();};}function saveUpdates(_0x5b97b2,_0x443bd3){return function(_0x4806e0){if(_0x4806e0){return _0x4806e0[_0x16e6('0x22')](_0x5b97b2)['then'](function(_0x2a0a58){return _0x2a0a58;});}return null;};}function removeEntity(_0x591d29,_0x5e1660){return function(_0x170246){if(_0x170246){return _0x170246[_0x16e6('0x23')]()['then'](function(){_0x591d29[_0x16e6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x247f03,_0x5a6ddd){return function(_0x374307){if(!_0x374307){_0x247f03['sendStatus'](0x194);}return _0x374307;};}function handleError(_0x905342,_0x4c1b5d){_0x4c1b5d=_0x4c1b5d||0x1f4;return function(_0x3f0cb2){logger[_0x16e6('0x24')](_0x3f0cb2[_0x16e6('0x25')]);if(_0x3f0cb2[_0x16e6('0x26')]){delete _0x3f0cb2[_0x16e6('0x26')];}_0x905342['status'](_0x4c1b5d)[_0x16e6('0x27')](_0x3f0cb2);};}exports['index']=function(_0x3ec73f,_0x15755a){var _0x55878f={},_0x5495f9={},_0x2f03b1={'count':0x0,'rows':[]};var _0x111ff6=_[_0x16e6('0x28')](db['OpenchannelApplication'][_0x16e6('0x29')],function(_0x4fa1e9){return{'name':_0x4fa1e9[_0x16e6('0x2a')],'type':_0x4fa1e9[_0x16e6('0x2b')][_0x16e6('0x2c')]};});_0x5495f9['model']=_[_0x16e6('0x28')](_0x111ff6,_0x16e6('0x26'));_0x5495f9[_0x16e6('0x2d')]=_[_0x16e6('0x2e')](_0x3ec73f[_0x16e6('0x2d')]);_0x5495f9[_0x16e6('0x2f')]=_[_0x16e6('0x30')](_0x5495f9[_0x16e6('0x31')],_0x5495f9[_0x16e6('0x2d')]);_0x55878f[_0x16e6('0x32')]=_[_0x16e6('0x30')](_0x5495f9['model'],qs[_0x16e6('0x33')](_0x3ec73f[_0x16e6('0x2d')]['fields']));_0x55878f['attributes']=_0x55878f['attributes'][_0x16e6('0x34')]?_0x55878f['attributes']:_0x5495f9[_0x16e6('0x31')];if(!_0x3ec73f[_0x16e6('0x2d')][_0x16e6('0x35')](_0x16e6('0x36'))){_0x55878f[_0x16e6('0x1a')]=qs[_0x16e6('0x1a')](_0x3ec73f['query']['limit']);_0x55878f[_0x16e6('0x1c')]=qs['offset'](_0x3ec73f[_0x16e6('0x2d')]['offset']);}_0x55878f['order']=qs[_0x16e6('0x37')](_0x3ec73f[_0x16e6('0x2d')][_0x16e6('0x37')]);_0x55878f[_0x16e6('0x38')]=qs[_0x16e6('0x2f')](_['pick'](_0x3ec73f[_0x16e6('0x2d')],_0x5495f9[_0x16e6('0x2f')]),_0x111ff6);if(_0x3ec73f[_0x16e6('0x2d')][_0x16e6('0x39')]){_0x55878f['where']=_[_0x16e6('0x3a')](_0x55878f[_0x16e6('0x38')],{'$or':_[_0x16e6('0x28')](_0x111ff6,function(_0x52ff6f){if(_0x52ff6f['type']!=='VIRTUAL'){var _0x3135e3={};_0x3135e3[_0x52ff6f['name']]={'$like':'%'+_0x3ec73f['query'][_0x16e6('0x39')]+'%'};return _0x3135e3;}})});}_0x55878f=_['merge']({},_0x55878f,_0x3ec73f[_0x16e6('0x3b')]);var _0x535917={'where':_0x55878f[_0x16e6('0x38')]};return db[_0x16e6('0x3c')][_0x16e6('0x1b')](_0x535917)[_0x16e6('0x3d')](function(_0x47255f){_0x2f03b1[_0x16e6('0x1b')]=_0x47255f;if(_0x3ec73f['query'][_0x16e6('0x3e')]){_0x55878f[_0x16e6('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x55878f);})['then'](function(_0x1f29a9){_0x2f03b1['rows']=_0x1f29a9;return _0x2f03b1;})[_0x16e6('0x3d')](respondWithFilteredResult(_0x15755a,_0x55878f))[_0x16e6('0x40')](handleError(_0x15755a,null));};exports[_0x16e6('0x41')]=function(_0xe71741,_0x2deffb){var _0x52d11a={'raw':!![],'where':{'id':_0xe71741['params']['id']}},_0x2745bf={};_0x2745bf[_0x16e6('0x31')]=_[_0x16e6('0x2e')](db[_0x16e6('0x3c')][_0x16e6('0x29')]);_0x2745bf[_0x16e6('0x2d')]=_[_0x16e6('0x2e')](_0xe71741[_0x16e6('0x2d')]);_0x2745bf[_0x16e6('0x2f')]=_[_0x16e6('0x30')](_0x2745bf[_0x16e6('0x31')],_0x2745bf[_0x16e6('0x2d')]);_0x52d11a[_0x16e6('0x32')]=_[_0x16e6('0x30')](_0x2745bf[_0x16e6('0x31')],qs['fields'](_0xe71741[_0x16e6('0x2d')]['fields']));_0x52d11a[_0x16e6('0x32')]=_0x52d11a[_0x16e6('0x32')][_0x16e6('0x34')]?_0x52d11a[_0x16e6('0x32')]:_0x2745bf[_0x16e6('0x31')];if(_0xe71741[_0x16e6('0x2d')][_0x16e6('0x3e')]){_0x52d11a[_0x16e6('0x3f')]=[{'all':!![]}];}_0x52d11a=_[_0x16e6('0x3a')]({},_0x52d11a,_0xe71741[_0x16e6('0x3b')]);return db[_0x16e6('0x3c')][_0x16e6('0x42')](_0x52d11a)[_0x16e6('0x3d')](handleEntityNotFound(_0x2deffb,null))['then'](respondWithResult(_0x2deffb,null))[_0x16e6('0x40')](handleError(_0x2deffb,null));};exports[_0x16e6('0x43')]=function(_0x4e101b,_0x21e4c5){return db[_0x16e6('0x3c')][_0x16e6('0x43')](_0x4e101b[_0x16e6('0x44')],{})['then'](respondWithResult(_0x21e4c5,0xc9))[_0x16e6('0x40')](handleError(_0x21e4c5,null));};exports['update']=function(_0xed5203,_0x128f39){if(_0xed5203[_0x16e6('0x44')]['id']){delete _0xed5203[_0x16e6('0x44')]['id'];}return db[_0x16e6('0x3c')][_0x16e6('0x42')]({'where':{'id':_0xed5203[_0x16e6('0x45')]['id']}})[_0x16e6('0x3d')](handleEntityNotFound(_0x128f39,null))['then'](saveUpdates(_0xed5203[_0x16e6('0x44')],null))[_0x16e6('0x3d')](respondWithResult(_0x128f39,null))[_0x16e6('0x40')](handleError(_0x128f39,null));};exports['destroy']=function(_0x1f453d,_0x2d074d){return db[_0x16e6('0x3c')][_0x16e6('0x42')]({'where':{'id':_0x1f453d[_0x16e6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d074d,null))[_0x16e6('0x3d')](removeEntity(_0x2d074d,null))[_0x16e6('0x40')](handleError(_0x2d074d,null));};
\ No newline at end of file
index 10d1d40..13e69df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6a2=['./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1ddd3e,_0x1f0763){var _0x575123=function(_0x3ab547){while(--_0x3ab547){_0x1ddd3e['push'](_0x1ddd3e['shift']());}};_0x575123(++_0x1f0763);}(_0xb6a2,0x1d3));var _0x2b6a=function(_0x1b49d4,_0x8386e9){_0x1b49d4=_0x1b49d4-0x0;var _0x119339=_0xb6a2[_0x1b49d4];return _0x119339;};'use strict';var _=require(_0x2b6a('0x0'));var util=require(_0x2b6a('0x1'));var logger=require(_0x2b6a('0x2'))(_0x2b6a('0x3'));var moment=require('moment');var BPromise=require(_0x2b6a('0x4'));var rp=require(_0x2b6a('0x5'));var fs=require('fs');var path=require(_0x2b6a('0x6'));var rimraf=require(_0x2b6a('0x7'));var config=require(_0x2b6a('0x8'));var attributes=require(_0x2b6a('0x9'));module[_0x2b6a('0xa')]=function(_0x56bec1,_0x3f4022){return _0x56bec1['define'](_0x2b6a('0xb'),attributes,{'tableName':_0x2b6a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b6a('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf5b2=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0xe85054,_0x26e82b){var _0x197608=function(_0x4f2557){while(--_0x4f2557){_0xe85054['push'](_0xe85054['shift']());}};_0x197608(++_0x26e82b);}(_0xf5b2,0xfc));var _0x2f5b=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xf5b2[_0x2b45b5];return _0x1d9c06;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f5b('0x0'))('api');var moment=require(_0x2f5b('0x1'));var BPromise=require(_0x2f5b('0x2'));var rp=require(_0x2f5b('0x3'));var fs=require('fs');var path=require(_0x2f5b('0x4'));var rimraf=require('rimraf');var config=require(_0x2f5b('0x5'));var attributes=require(_0x2f5b('0x6'));module[_0x2f5b('0x7')]=function(_0x270cd5,_0x3f5d10){return _0x270cd5[_0x2f5b('0x8')](_0x2f5b('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f5b('0xa'),'collate':_0x2f5b('0xb')});};
\ No newline at end of file
index 0b987d7..5554076 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc59b=['../../mysqldb','../../config/environment','jayson/promise','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateOpenchannelApplication','update','body','options','raw','attributes','limit','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc59b,0x97));var _0xbc59=function(_0xb9a1fb,_0x587833){_0xb9a1fb=_0xb9a1fb-0x0;var _0x3b40a5=_0xc59b[_0xb9a1fb];return _0x3b40a5;};'use strict';var _=require('lodash');var util=require(_0xbc59('0x0'));var moment=require(_0xbc59('0x1'));var BPromise=require(_0xbc59('0x2'));var rs=require(_0xbc59('0x3'));var fs=require('fs');var Redis=require(_0xbc59('0x4'));var db=require(_0xbc59('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc59('0x6'));var jayson=require(_0xbc59('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x451a7e,_0x4caa58,_0x31388b){return new BPromise(function(_0x382f6e,_0xa08403){return client[_0xbc59('0x8')](_0x451a7e,_0x31388b)['then'](function(_0x45f08f){logger[_0xbc59('0x9')](_0xbc59('0xa'),_0x4caa58,_0xbc59('0xb'));logger[_0xbc59('0xc')](_0xbc59('0xd'),_0x4caa58,_0xbc59('0xb'),JSON[_0xbc59('0xe')](_0x45f08f));if(_0x45f08f['error']){if(_0x45f08f[_0xbc59('0xf')]['code']===0x1f4){logger[_0xbc59('0xf')](_0xbc59('0xa'),_0x4caa58,_0x45f08f['error'][_0xbc59('0x10')]);return _0xa08403(_0x45f08f[_0xbc59('0xf')][_0xbc59('0x10')]);}logger[_0xbc59('0xf')](_0xbc59('0xa'),_0x4caa58,_0x45f08f['error'][_0xbc59('0x10')]);return _0x382f6e(_0x45f08f['error'][_0xbc59('0x10')]);}else{logger[_0xbc59('0x9')](_0xbc59('0xa'),_0x4caa58,'request\x20sent');_0x382f6e(_0x45f08f[_0xbc59('0x11')]['message']);}})['catch'](function(_0x578927){logger[_0xbc59('0xf')](_0xbc59('0xa'),_0x4caa58,_0x578927);_0xa08403(_0x578927);});});}exports[_0xbc59('0x12')]=function(_0x328fdc){var _0x33ffdf=this;return new Promise(function(_0x49a939,_0x52310f){return db['OpenchannelApplication'][_0xbc59('0x13')](_0x328fdc[_0xbc59('0x14')],{'raw':_0x328fdc[_0xbc59('0x15')]?_0x328fdc['options'][_0xbc59('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x328fdc[_0xbc59('0x15')]?_0x328fdc[_0xbc59('0x15')]['where']||null:null,'attributes':_0x328fdc['options']?_0x328fdc[_0xbc59('0x15')][_0xbc59('0x17')]||null:null,'limit':_0x328fdc['options']?_0x328fdc[_0xbc59('0x15')][_0xbc59('0x18')]||null:null})['then'](function(_0x2fe455){logger[_0xbc59('0x9')]('UpdateOpenchannelApplication',_0x328fdc);logger['debug'](_0xbc59('0x12'),_0x328fdc,JSON[_0xbc59('0xe')](_0x2fe455));_0x49a939(_0x2fe455);})[_0xbc59('0x19')](function(_0x24d21d){logger[_0xbc59('0xf')](_0xbc59('0x12'),_0x24d21d['message'],_0x328fdc);_0x52310f(_0x33ffdf[_0xbc59('0xf')](0x1f4,_0x24d21d['message']));});});};
\ No newline at end of file
+var _0xcf67=['catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','OpenchannelApplication,\x20%s,\x20%s','result'];(function(_0x3b14ad,_0x5e4401){var _0x392677=function(_0x4c9139){while(--_0x4c9139){_0x3b14ad['push'](_0x3b14ad['shift']());}};_0x392677(++_0x5e4401);}(_0xcf67,0xf9));var _0x7cf6=function(_0xb7b878,_0x5c3b92){_0xb7b878=_0xb7b878-0x0;var _0x3c84b9=_0xcf67[_0xb7b878];return _0x3c84b9;};'use strict';var _=require(_0x7cf6('0x0'));var util=require(_0x7cf6('0x1'));var moment=require(_0x7cf6('0x2'));var BPromise=require(_0x7cf6('0x3'));var rs=require(_0x7cf6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cf6('0x5'))['db'];var utils=require(_0x7cf6('0x6'));var logger=require('../../config/logger')(_0x7cf6('0x7'));var config=require(_0x7cf6('0x8'));var jayson=require(_0x7cf6('0x9'));var client=jayson[_0x7cf6('0xa')][_0x7cf6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54e08a,_0x403f05,_0x1aad57){return new BPromise(function(_0x57bf6c,_0x3db960){return client[_0x7cf6('0xc')](_0x54e08a,_0x1aad57)[_0x7cf6('0xd')](function(_0x5608f3){logger[_0x7cf6('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x403f05,_0x7cf6('0xf'));logger['debug'](_0x7cf6('0x10'),_0x403f05,_0x7cf6('0xf'),JSON['stringify'](_0x5608f3));if(_0x5608f3[_0x7cf6('0x11')]){if(_0x5608f3[_0x7cf6('0x11')]['code']===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x403f05,_0x5608f3[_0x7cf6('0x11')][_0x7cf6('0x12')]);return _0x3db960(_0x5608f3['error']['message']);}logger[_0x7cf6('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x403f05,_0x5608f3[_0x7cf6('0x11')][_0x7cf6('0x12')]);return _0x57bf6c(_0x5608f3[_0x7cf6('0x11')]['message']);}else{logger[_0x7cf6('0xe')](_0x7cf6('0x13'),_0x403f05,_0x7cf6('0xf'));_0x57bf6c(_0x5608f3[_0x7cf6('0x14')][_0x7cf6('0x12')]);}})[_0x7cf6('0x15')](function(_0x4a6756){logger['error'](_0x7cf6('0x13'),_0x403f05,_0x4a6756);_0x3db960(_0x4a6756);});});}exports[_0x7cf6('0x16')]=function(_0x57a667){var _0x5215c3=this;return new Promise(function(_0x3e7e83,_0x4e36bb){return db[_0x7cf6('0x17')]['update'](_0x57a667[_0x7cf6('0x18')],{'raw':_0x57a667['options']?_0x57a667[_0x7cf6('0x19')][_0x7cf6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a667[_0x7cf6('0x19')]?_0x57a667[_0x7cf6('0x19')][_0x7cf6('0x1b')]||null:null,'attributes':_0x57a667[_0x7cf6('0x19')]?_0x57a667['options'][_0x7cf6('0x1c')]||null:null,'limit':_0x57a667[_0x7cf6('0x19')]?_0x57a667[_0x7cf6('0x19')]['limit']||null:null})[_0x7cf6('0xd')](function(_0x317063){logger['info'](_0x7cf6('0x16'),_0x57a667);logger['debug'](_0x7cf6('0x16'),_0x57a667,JSON[_0x7cf6('0x1d')](_0x317063));_0x3e7e83(_0x317063);})[_0x7cf6('0x15')](function(_0x1026c1){logger[_0x7cf6('0x11')](_0x7cf6('0x16'),_0x1026c1[_0x7cf6('0x12')],_0x57a667);_0x4e36bb(_0x5215c3[_0x7cf6('0x11')](0x1f4,_0x1026c1['message']));});});};
\ No newline at end of file
index 169d6f4..c7bee36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4d9=['create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','/:id','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x49779d,_0x1e525f){var _0x128906=function(_0x453697){while(--_0x453697){_0x49779d['push'](_0x49779d['shift']());}};_0x128906(++_0x1e525f);}(_0xd4d9,0x168));var _0x9d4d=function(_0x31825b,_0x2318d8){_0x31825b=_0x31825b-0x0;var _0x5978fe=_0xd4d9[_0x31825b];return _0x5978fe;};'use strict';var multer=require('multer');var util=require(_0x9d4d('0x0'));var path=require(_0x9d4d('0x1'));var timeout=require(_0x9d4d('0x2'));var express=require('express');var router=express[_0x9d4d('0x3')]();var fs_extra=require(_0x9d4d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9d4d('0x5'));var config=require(_0x9d4d('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x9d4d('0x7')]('/',auth[_0x9d4d('0x8')](),controller[_0x9d4d('0x9')]);router[_0x9d4d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x9d4d('0xa')]);router[_0x9d4d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9d4d('0xb')]);router[_0x9d4d('0x7')](_0x9d4d('0xc'),auth[_0x9d4d('0x8')](),controller[_0x9d4d('0xd')]);router[_0x9d4d('0x7')](_0x9d4d('0xe'),auth[_0x9d4d('0x8')](),controller[_0x9d4d('0xf')]);router[_0x9d4d('0x10')]('/',auth[_0x9d4d('0x8')](),controller[_0x9d4d('0x11')]);router[_0x9d4d('0x10')](_0x9d4d('0xc'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x9d4d('0x12'),auth[_0x9d4d('0x8')](),interaction[_0x9d4d('0x13')](_0x9d4d('0x14'),_0x9d4d('0x15')),controller['addTags']);router[_0x9d4d('0x16')](_0x9d4d('0x17'),auth[_0x9d4d('0x8')](),interaction['tracked'](_0x9d4d('0x14'),_0x9d4d('0x18')),controller['update']);router[_0x9d4d('0x19')](_0x9d4d('0x17'),auth['isAuthenticated'](),interaction[_0x9d4d('0x13')]('openchannel',_0x9d4d('0x1a')),controller[_0x9d4d('0x1b')]);router[_0x9d4d('0x19')](_0x9d4d('0x12'),auth[_0x9d4d('0x8')](),controller['removeTags']);module[_0x9d4d('0x1c')]=router;
\ No newline at end of file
+var _0x8163=['create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8163,0xad));var _0x3816=function(_0x265b3c,_0x11a590){_0x265b3c=_0x265b3c-0x0;var _0x30a6da=_0x8163[_0x265b3c];return _0x30a6da;};'use strict';var multer=require(_0x3816('0x0'));var util=require(_0x3816('0x1'));var path=require('path');var timeout=require(_0x3816('0x2'));var express=require(_0x3816('0x3'));var router=express[_0x3816('0x4')]();var fs_extra=require(_0x3816('0x5'));var auth=require(_0x3816('0x6'));var interaction=require(_0x3816('0x7'));var config=require(_0x3816('0x8'));var controller=require(_0x3816('0x9'));router[_0x3816('0xa')]('/',auth[_0x3816('0xb')](),controller[_0x3816('0xc')]);router[_0x3816('0xa')](_0x3816('0xd'),auth[_0x3816('0xb')](),controller[_0x3816('0xe')]);router[_0x3816('0xa')](_0x3816('0xf'),auth[_0x3816('0xb')](),controller[_0x3816('0x10')]);router[_0x3816('0xa')]('/:id/messages',auth[_0x3816('0xb')](),controller[_0x3816('0x11')]);router[_0x3816('0xa')]('/:id/download',auth[_0x3816('0xb')](),controller['download']);router[_0x3816('0x12')]('/',auth['isAuthenticated'](),controller[_0x3816('0x13')]);router[_0x3816('0x12')](_0x3816('0x14'),auth['isAuthenticated'](),controller[_0x3816('0x15')]);router['post'](_0x3816('0x16'),auth[_0x3816('0xb')](),interaction[_0x3816('0x17')](_0x3816('0x18'),_0x3816('0x19')),controller[_0x3816('0x1a')]);router['put'](_0x3816('0xf'),auth['isAuthenticated'](),interaction[_0x3816('0x17')]('openchannel',_0x3816('0x1b')),controller[_0x3816('0x1c')]);router[_0x3816('0x1d')](_0x3816('0xf'),auth[_0x3816('0xb')](),interaction[_0x3816('0x17')](_0x3816('0x18'),_0x3816('0x1e')),controller[_0x3816('0x1f')]);router[_0x3816('0x1d')](_0x3816('0x16'),auth[_0x3816('0xb')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index 61b7f2c..250c41f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cd4=['sequelize','BOOLEAN','DATE','STRING','out'];(function(_0x8583e,_0x1f965c){var _0x1ba58a=function(_0x3a1d5e){while(--_0x3a1d5e){_0x8583e['push'](_0x8583e['shift']());}};_0x1ba58a(++_0x1f965c);}(_0x2cd4,0xd2));var _0x42cd=function(_0x3a2118,_0x31fc3c){_0x3a2118=_0x3a2118-0x0;var _0x1d181d=_0x2cd4[_0x3a2118];return _0x1d181d;};'use strict';var Sequelize=require(_0x42cd('0x0'));module['exports']={'closed':{'type':Sequelize[_0x42cd('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x42cd('0x2')]},'disposition':{'type':Sequelize[_0x42cd('0x3')]},'secondDisposition':{'type':Sequelize[_0x42cd('0x3')]},'thirdDisposition':{'type':Sequelize[_0x42cd('0x3')]},'note':{'type':Sequelize[_0x42cd('0x3')]},'read1stAt':{'type':Sequelize[_0x42cd('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x42cd('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x42cd('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x42cd('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x42cd('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0fc8=['ENUM','out','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x2468b5,_0x506b9e){var _0x1056e4=function(_0x26da1c){while(--_0x26da1c){_0x2468b5['push'](_0x2468b5['shift']());}};_0x1056e4(++_0x506b9e);}(_0x0fc8,0x145));var _0x80fc=function(_0x102e7a,_0x283e8e){_0x102e7a=_0x102e7a-0x0;var _0x5239cf=_0x0fc8[_0x102e7a];return _0x5239cf;};'use strict';var Sequelize=require(_0x80fc('0x0'));module[_0x80fc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x80fc('0x2')]},'thirdDisposition':{'type':Sequelize[_0x80fc('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x80fc('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x80fc('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x80fc('0x4')]('in',_0x80fc('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x80fc('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x80fc('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 0539929..9d19e4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe149=['setTags','findAll','removeTags','unix','join','files','tmp','attachments','format','CmContact','firstName','lastName','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closed','disposition','threadId','Public','Private','Attachment','basename','existsSync','createWriteStream','out','System','root','server','views','downloadInteraction.ejs','transcript-','.pdf','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','index','OpenchannelInteraction','rawAttributes','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','parse','$lte','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','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','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','options','create','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','nolimit','pick','merge','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xe149,0x10f));var _0x9e14=function(_0x5c8133,_0x38d473){_0x5c8133=_0x5c8133-0x0;var _0x579576=_0xe149[_0x5c8133];return _0x579576;};'use strict';var emlformat=require(_0x9e14('0x0'));var rimraf=require(_0x9e14('0x1'));var zipdir=require(_0x9e14('0x2'));var jsonpatch=require(_0x9e14('0x3'));var rp=require(_0x9e14('0x4'));var moment=require(_0x9e14('0x5'));var BPromise=require(_0x9e14('0x6'));var Mustache=require(_0x9e14('0x7'));var util=require(_0x9e14('0x8'));var path=require('path');var sox=require(_0x9e14('0x9'));var csv=require(_0x9e14('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e14('0xb'));var squel=require(_0x9e14('0xc'));var crypto=require(_0x9e14('0xd'));var jsforce=require(_0x9e14('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9e14('0xa'));var querystring=require(_0x9e14('0xf'));var Papa=require(_0x9e14('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9e14('0x11'));var as=require(_0x9e14('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x9e14('0x13'));var logger=require(_0x9e14('0x14'))(_0x9e14('0x15'));var utils=require(_0x9e14('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9e14('0x17'));var db=require(_0x9e14('0x18'))['db'];config[_0x9e14('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9e14('0x1a'))[_0x9e14('0x1b')](socket);function respondWithStatusCode(_0x344770,_0x39b223){_0x39b223=_0x39b223||0xcc;return function(_0x3c93f2){if(_0x3c93f2){return _0x344770[_0x9e14('0x1c')](_0x39b223);}return _0x344770[_0x9e14('0x1d')](_0x39b223)[_0x9e14('0x1e')]();};}function respondWithResult(_0x35970a,_0x4d140f){_0x4d140f=_0x4d140f||0xc8;return function(_0x51b4de){if(_0x51b4de){return _0x35970a[_0x9e14('0x1d')](_0x4d140f)[_0x9e14('0x1f')](_0x51b4de);}};}function respondWithFilteredResult(_0x2ed1fd,_0x1a756a){return function(_0x285c15){if(_0x285c15){var _0x1dfdba=typeof _0x1a756a['offset']===_0x9e14('0x20')&&typeof _0x1a756a[_0x9e14('0x21')]===_0x9e14('0x20');var _0x34a7dd=_0x285c15['count'];var _0x20f17c=_0x1dfdba?0x0:_0x1a756a[_0x9e14('0x22')];var _0x46ee73=_0x1dfdba?_0x285c15[_0x9e14('0x23')]:_0x1a756a[_0x9e14('0x22')]+_0x1a756a[_0x9e14('0x21')];var _0x83e8f2;if(_0x46ee73>=_0x34a7dd){_0x46ee73=_0x34a7dd;_0x83e8f2=0xc8;}else{_0x83e8f2=0xce;}_0x2ed1fd[_0x9e14('0x1d')](_0x83e8f2);return _0x2ed1fd[_0x9e14('0x24')](_0x9e14('0x25'),_0x20f17c+'-'+_0x46ee73+'/'+_0x34a7dd)[_0x9e14('0x1f')](_0x285c15);}return null;};}function patchUpdates(_0x3cf80f){return function(_0xa030b0){try{jsonpatch['apply'](_0xa030b0,_0x3cf80f,!![]);}catch(_0x3376df){return BPromise[_0x9e14('0x26')](_0x3376df);}return _0xa030b0[_0x9e14('0x27')]();};}function saveUpdates(_0x2680cb,_0x46036d){return function(_0xfc38f4){if(_0xfc38f4){return _0xfc38f4[_0x9e14('0x28')](_0x2680cb)[_0x9e14('0x29')](function(_0xd0e35e){return _0xd0e35e;});}return null;};}function removeEntity(_0x579a6c,_0x3885d1){return function(_0x40f6fb){if(_0x40f6fb){return _0x40f6fb[_0x9e14('0x2a')]()[_0x9e14('0x29')](function(){_0x579a6c['status'](0xcc)[_0x9e14('0x1e')]();});}};}function handleEntityNotFound(_0xc9b208,_0x40a3cc){return function(_0x311c8b){if(!_0x311c8b){_0xc9b208[_0x9e14('0x1c')](0x194);}return _0x311c8b;};}function handleError(_0x4663d1,_0x3d45fc){_0x3d45fc=_0x3d45fc||0x1f4;return function(_0x41b726){logger['error'](_0x41b726['stack']);if(_0x41b726['name']){delete _0x41b726['name'];}_0x4663d1[_0x9e14('0x1d')](_0x3d45fc)['send'](_0x41b726);};}function getInteractionUsers(_0x41797e,_0xf7170c){return new BPromise(function(_0x37d029,_0x29c917){try{if(_0xf7170c[_0x41797e['id']]){_0x41797e[_0x9e14('0x2b')]=_[_0x9e14('0x2c')](_0xf7170c[_0x41797e['id']],function(_0x410d16){return{'id':_0x410d16['id'],'fullname':_0x410d16[_0x9e14('0x2d')]};});}}catch(_0x445ea5){_0x29c917(_0x445ea5);}_0x37d029(_0x41797e);});}function getInteractionTags(_0x59ffc6,_0x5689d5){return new BPromise(function(_0x1005d8,_0x241294){try{if(_0x59ffc6[_0x9e14('0x2e')]){_0x59ffc6['Tags']=[];_0x59ffc6[_0x9e14('0x2e')][_0x9e14('0x2f')](',')[_0x9e14('0x30')](function(_0x36891f){_0x59ffc6[_0x9e14('0x31')][_0x9e14('0x32')](_0x5689d5[_0x36891f]);});}delete _0x59ffc6[_0x9e14('0x2e')];}catch(_0x4e265a){_0x241294(_0x4e265a);}_0x1005d8(_0x59ffc6);});}function updateOpenchannelInteraction(_0x598325,_0x221f9c,_0x38ad97){return new BPromise(function(_0x32ce29,_0x5d6299){return getInteractionUsers(_0x598325,_0x38ad97)[_0x9e14('0x29')](function(_0x59be4a){return getInteractionTags(_0x59be4a,_0x221f9c);})['then'](function(_0x6421a0){_0x32ce29(_0x6421a0);})[_0x9e14('0x33')](function(_0x5c1269){_0x5d6299(_0x5c1269);});});}exports[_0x9e14('0x34')]=function(_0x1d2224,_0x2e8293){var _0x45039b={},_0x2c638b={},_0xd14b51={'count':0x0,'rows':[]};var _0x4d4990=_['map'](db[_0x9e14('0x35')][_0x9e14('0x36')],function(_0x4d43b4){return{'name':_0x4d43b4['fieldName'],'type':_0x4d43b4[_0x9e14('0x37')][_0x9e14('0x38')]};});_0x2c638b[_0x9e14('0x39')]=_['map'](_0x4d4990,_0x9e14('0x3a'));_0x2c638b[_0x9e14('0x3b')]=_[_0x9e14('0x3c')](_0x1d2224[_0x9e14('0x3b')]);_0x2c638b[_0x9e14('0x3d')]=_[_0x9e14('0x3e')](_0x2c638b[_0x9e14('0x39')],_0x2c638b[_0x9e14('0x3b')]);_0x45039b['attributes']=_[_0x9e14('0x3e')](_0x2c638b[_0x9e14('0x39')],qs[_0x9e14('0x3f')](_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x3f')]));_0x45039b[_0x9e14('0x40')]=_0x45039b[_0x9e14('0x40')][_0x9e14('0x41')]?_0x45039b[_0x9e14('0x40')]:_0x2c638b[_0x9e14('0x39')];if(!_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x42')]('nolimit')){_0x45039b['limit']=qs['limit'](_0x1d2224[_0x9e14('0x3b')]['limit']);_0x45039b[_0x9e14('0x22')]=qs[_0x9e14('0x22')](_0x1d2224['query'][_0x9e14('0x22')]);}_0x45039b['order']=qs[_0x9e14('0x43')](_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x43')]);_0x45039b[_0x9e14('0x44')]=qs[_0x9e14('0x3d')](_['pick'](_0x1d2224[_0x9e14('0x3b')],_0x2c638b[_0x9e14('0x3d')]),_0x4d4990);var _0x546d5e=[];var _0xa1705f=squel[_0x9e14('0x45')]()[_0x9e14('0x46')]('id')['field'](_0x9e14('0x3a'))[_0x9e14('0x46')](_0x9e14('0x47'))[_0x9e14('0x48')](_0x9e14('0x49'));var _0x33b382=squel['select']()[_0x9e14('0x46')](_0x9e14('0x4a'))[_0x9e14('0x46')](_0x9e14('0x4b'))[_0x9e14('0x46')](_0x9e14('0x4c'))[_0x9e14('0x48')](_0x9e14('0x4d'),'ui')[_0x9e14('0x4e')](_0x9e14('0x4f'),'u',_0x9e14('0x50'));var _0x57893a=squel[_0x9e14('0x45')]()[_0x9e14('0x48')]('openchannel_interactions','i')[_0x9e14('0x4e')](_0x9e14('0x51'),'c',_0x9e14('0x52'))['left_join']('users','o',_0x9e14('0x53'))['left_join'](_0x9e14('0x54'),'a',_0x9e14('0x55'))[_0x9e14('0x4e')](_0x9e14('0x56'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x9e14('0x4e')](_0x9e14('0x57'),'it',_0x9e14('0x58'))[_0x9e14('0x4e')](_0x9e14('0x49'),'t','t.id\x20=\x20it.TagId');var _0x26cc24=squel[_0x9e14('0x59')]();var _0x1d16ad=[];var _0x158ab2=squel[_0x9e14('0x59')]();var _0x10c4a9;if(_0x1d2224['query'][_0x9e14('0x5a')]){_0x10c4a9=as[_0x9e14('0x5b')](_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x5a')]);var _0x40902e=_0x10c4a9[_0x9e14('0x5c')];for(var _0x537f5f=0x0;_0x537f5f<_0x10c4a9[_0x9e14('0x5d')][_0x9e14('0x41')];_0x537f5f++){var _0x5a20c5=_0x10c4a9['conditions'][_0x537f5f];var _0x18d499='i';var _0x79a959=_[_0x9e14('0x5e')](_0x4d4990,['name',_0x5a20c5['field']]);if(!_0x79a959){switch(_0x5a20c5['field']){case _0x9e14('0x5f'):if(_0x5a20c5[_0x9e14('0x60')]==0x1){_0x57893a[_0x9e14('0x61')]('`'+_0x5a20c5[_0x9e14('0x46')]+_0x9e14('0x62'));}else{_0x57893a['having']('`'+_0x5a20c5['field']+_0x9e14('0x63'));}break;case _0x9e14('0x64'):if(_0x5a20c5[_0x9e14('0x65')]===_0x9e14('0x66')){if(_0x5a20c5[_0x9e14('0x60')][_0x9e14('0x2f')]('\x20')[_0x9e14('0x41')]>0x1){_0x26cc24[_0x40902e](_0x9e14('0x67'),qs[_0x9e14('0x68')](_0x5a20c5[_0x9e14('0x60')]),null);}else{var _0x5b3e5c='%'+_0x5a20c5['value']+'%';_0x26cc24[_0x40902e](_0x9e14('0x69'),_0x5b3e5c,_0x5b3e5c,_0x5b3e5c);}}else{_0x79a959=_[_0x9e14('0x5e')](_0x4d4990,[_0x9e14('0x3a'),_0x9e14('0x6a')]);_0x5a20c5[_0x9e14('0x46')]=_0x9e14('0x6a');_0x59fd46=as[_0x9e14('0x6b')](_0x18d499,_0x79a959['type'],_0x5a20c5);_0x26cc24[_0x40902e](_0x59fd46[_0x9e14('0x6c')],_0x59fd46[_0x9e14('0x60')][_0x9e14('0x6d')],_0x59fd46[_0x9e14('0x60')][_0x9e14('0x1e')]);}break;case _0x9e14('0x6e'):var _0x535e4a=_0x5a20c5[_0x9e14('0x60')]['split'](',')['map'](function(_0xd75fa7){return Number(_0xd75fa7);});_0x535e4a['forEach'](function(_0x1454ec){_0x158ab2['or'](_0x9e14('0x6f'),'%,'+_0x1454ec+',%');});_0x1d16ad=_[_0x9e14('0x70')](_0x1d16ad,_0x535e4a);break;case _0x9e14('0x71'):if(_0x5a20c5['operator']===_0x9e14('0x66')){_0x26cc24[_0x40902e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5a20c5[_0x9e14('0x60')]+'%',null);}else{_0x79a959=_['find'](_0x4d4990,[_0x9e14('0x3a'),_0x9e14('0x72')]);_0x5a20c5[_0x9e14('0x46')]=_0x9e14('0x72');_0x59fd46=as['buildExpression'](_0x18d499,_0x79a959[_0x9e14('0x37')],_0x5a20c5);_0x26cc24[_0x40902e](_0x59fd46[_0x9e14('0x6c')],_0x59fd46[_0x9e14('0x60')][_0x9e14('0x6d')],_0x59fd46[_0x9e14('0x60')][_0x9e14('0x1e')]);}break;case _0x9e14('0x73'):_0x59fd46=as['buildExpression']('me',null,_0x5a20c5);_0x26cc24[_0x40902e](_0x59fd46[_0x9e14('0x6c')],_0x59fd46[_0x9e14('0x60')]['start'],_0x59fd46['value']['end']);break;}}else{var _0x59fd46=as['buildExpression'](_0x18d499,_0x79a959[_0x9e14('0x37')],_0x5a20c5);_0x26cc24[_0x40902e](_0x59fd46[_0x9e14('0x6c')],_0x59fd46['value'][_0x9e14('0x6d')],_0x59fd46[_0x9e14('0x60')][_0x9e14('0x1e')]);}}}else{var _0xbb74a9=_(_0x1d2224[_0x9e14('0x3b')])[_0x9e14('0x3c')]()[_0x9e14('0x2c')](function(_0x4228be){return _[_0x9e14('0x74')](_0x4d4990,[_0x9e14('0x3a'),_0x4228be])?_0x4228be:undefined;})['compact']()['value']();if(!_[_0x9e14('0x75')](_0xbb74a9)){_0xbb74a9['forEach'](function(_0x2f88e4){if(_0x2f88e4===_0x9e14('0x76')){_0x57893a['where'](_0x9e14('0x77'),[][_0x9e14('0x78')](_0x1d2224['query'][_0x2f88e4]));}else if(_0x2f88e4==='createdAt'){var _0x5bc5dc=JSON['parse'](_0x1d2224[_0x9e14('0x3b')][_0x2f88e4])[_0x9e14('0x79')];var _0x2330c0=JSON[_0x9e14('0x7a')](_0x1d2224[_0x9e14('0x3b')][_0x2f88e4])[_0x9e14('0x7b')];_0x57893a['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5bc5dc,_0x2330c0);}else{if(_0x1d2224[_0x9e14('0x3b')][_0x2f88e4]==='null'){_0x57893a[_0x9e14('0x44')]('i.'+_0x2f88e4+'\x20IS\x20NULL');}else{_0x57893a[_0x9e14('0x44')]('i.'+_0x2f88e4+_0x9e14('0x7c'),_0x1d2224['query'][_0x2f88e4]);}}});}if(_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x7d')]){if(_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x7d')]==0x1){_0x57893a[_0x9e14('0x61')]('`unreadMessages`\x20=\x200');}else{_0x57893a[_0x9e14('0x61')](_0x9e14('0x7e'));}}if(_0x1d2224['query'][_0x9e14('0x7f')]){_0x1d16ad=_[_0x9e14('0x80')](_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x7f')])?_0x1d2224[_0x9e14('0x3b')]['tag']:new Array(_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x7f')]);_0x1d16ad[_0x9e14('0x30')](function(_0x5169d9){_0x158ab2['or'](_0x9e14('0x6f'),'%,'+_0x5169d9+',%');});}if(_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x81')]){var _0xdb872a=_0x1d2224[_0x9e14('0x3b')]['filter'][_0x9e14('0x82')]('\x5c','\x5c\x5c')[_0x9e14('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xdb872a)){_0x26cc24['or'](_0x9e14('0x83'),_0xdb872a+'%');}else{_0x26cc24['or'](_0x9e14('0x84'),qs['getFullTextValue'](_0xdb872a))['or'](_0x9e14('0x85'),_0xdb872a+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xdb872a+'%');}}}_0x57893a[_0x9e14('0x44')](_0x26cc24);_0x57893a[_0x9e14('0x86')](_0x9e14('0x87'));var _0x17f205={'type':db[_0x9e14('0x88')][_0x9e14('0x89')][_0x9e14('0x8a')],'raw':!![]};var _0x4f2180=_0x57893a['clone']();_0x4f2180['field']('i.id');_0x4f2180[_0x9e14('0x46')](_0x9e14('0x8b'),'unreadMessages');if(_0x45039b[_0x9e14('0x8c')]){_0x45039b['order'][_0x9e14('0x30')](function(_0x1e5f1d){var _0x3d232a=_0x1e5f1d[0x0]==='contactName'?_0x1e5f1d[0x0]:'i.'+_0x1e5f1d[0x0];_0x57893a['order'](_0x3d232a,_0x1e5f1d[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9e14('0x75')](_0x1d16ad)){_0x57893a['having'](_0x158ab2);_0x4f2180[_0x9e14('0x44')]('t.id\x20IN\x20?',_0x1d16ad);}BPromise[_0x9e14('0x8d')]()['then'](function(){if(!_0x10c4a9){if(_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x76')])return;_0x4f2180['where'](_0x9e14('0x8e'));_0x57893a[_0x9e14('0x44')](_0x9e14('0x8e'));return;}if(_0x1d2224['user'][_0x9e14('0x8f')]!==_0x9e14('0x90'))return;return _0x1d2224[_0x9e14('0x91')][_0x9e14('0x92')]({'attributes':['id'],'raw':!![]})[_0x9e14('0x29')](function(_0x3bd9e9){if(_['isEmpty'](_0x3bd9e9)){_0x4f2180[_0x9e14('0x44')](_0x9e14('0x93'));_0x57893a['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x4f2180[_0x9e14('0x44')](_0x9e14('0x77'),_[_0x9e14('0x2c')](_0x3bd9e9,'id'));_0x57893a[_0x9e14('0x44')](_0x9e14('0x77'),_[_0x9e14('0x2c')](_0x3bd9e9,'id'));}});})['then'](function(){if(_0x1d2224[_0x9e14('0x91')][_0x9e14('0x8f')]===_0x9e14('0x90')&&!_0x10c4a9&&!_0x1d2224['query'][_0x9e14('0x76')])return[];return db[_0x9e14('0x94')][_0x9e14('0x3b')](_0x4f2180[_0x9e14('0x95')](),_0x17f205);})[_0x9e14('0x29')](function(_0x207956){_0xd14b51[_0x9e14('0x23')]=_0x207956[_0x9e14('0x41')];if(_0xd14b51[_0x9e14('0x23')]===0x0)return[];return db[_0x9e14('0x94')][_0x9e14('0x3b')](_0xa1705f[_0x9e14('0x95')](),_0x17f205)['then'](function(_0x2ce81f){_0x546d5e=_[_0x9e14('0x96')](_0x2ce81f,'id');_0x17f205=_['merge'](_0x17f205,{'model':db[_0x9e14('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1d2224[_0x9e14('0x3b')][_0x9e14('0x3f')]){_0x45039b[_0x9e14('0x40')][_0x9e14('0x30')](function(_0x884f0e){_0x57893a[_0x9e14('0x46')]('i.'+_0x884f0e);});}else{_0x57893a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9e14('0x5f'));_0x57893a[_0x9e14('0x46')](_0x9e14('0x97'),'Account.key');_0x57893a[_0x9e14('0x46')]('a.mandatoryDisposition',_0x9e14('0x98'));_0x57893a['field'](_0x9e14('0x99'),_0x9e14('0x9a'));_0x57893a['field'](_0x9e14('0x9b'));_0x57893a['field']('c.firstName',_0x9e14('0x9c'));_0x57893a['field'](_0x9e14('0x9d'),_0x9e14('0x9e'));_0x57893a[_0x9e14('0x46')]('c.email',_0x9e14('0x9f'));_0x57893a[_0x9e14('0x46')](_0x9e14('0xa0'),_0x9e14('0xa1'));_0x57893a[_0x9e14('0x46')](_0x9e14('0xa2'),'Contact.mobile');_0x57893a[_0x9e14('0x46')]('c.fax',_0x9e14('0xa3'));_0x57893a['field'](_0x9e14('0xa4'),_0x9e14('0xa5'));_0x57893a[_0x9e14('0x46')](_0x9e14('0xa6'),'Owner.internal');_0x57893a[_0x9e14('0x46')](_0x9e14('0xa7'),_0x9e14('0x2e'));}if(_0x45039b['limit'])_0x57893a[_0x9e14('0x21')](_0x45039b[_0x9e14('0x21')]);if(_0x45039b[_0x9e14('0x22')])_0x57893a[_0x9e14('0x22')](_0x45039b[_0x9e14('0x22')]);return db[_0x9e14('0x94')][_0x9e14('0x3b')](_0x57893a['toString'](),_0x17f205);})['then'](function(_0x2cdf14){if(_0x2cdf14[_0x9e14('0x41')]>0x0)_0x33b382[_0x9e14('0x44')](_0x9e14('0xa8'),_[_0x9e14('0x2c')](_0x2cdf14,'id'));return db['sequelize'][_0x9e14('0x3b')](_0x33b382['toString'](),_0x17f205)[_0x9e14('0x29')](function(_0xdd7069){var _0x31057b=_[_0x9e14('0xa9')](_0xdd7069,_0x9e14('0xaa'));var _0x493d5c=[];_0x2cdf14[_0x9e14('0x30')](function(_0x16d34f){_0x493d5c[_0x9e14('0x32')](updateOpenchannelInteraction(_0x16d34f,_0x546d5e,_0x31057b));});return BPromise[_0x9e14('0xab')](_0x493d5c);});});})[_0x9e14('0x29')](function(_0x1e78a0){_0xd14b51[_0x9e14('0xac')]=_0x1e78a0;return _0xd14b51;})[_0x9e14('0x29')](respondWithFilteredResult(_0x2e8293,_0x45039b))[_0x9e14('0x33')](handleError(_0x2e8293,null));};exports[_0x9e14('0xad')]=function(_0x121708,_0x5d756b){var _0x48f1fa={};if(_0x121708[_0x9e14('0x3b')][_0x9e14('0x37')]&&_0x121708[_0x9e14('0x3b')][_0x9e14('0x37')]===_0x9e14('0x48')){_0x48f1fa[_0x9e14('0x48')]=_0x121708[_0x9e14('0xae')]['id'];}else{_0x48f1fa['id']=_0x121708['params']['id'];}var _0x2aab2e={'raw':![],'where':_0x48f1fa},_0x5ef3c4={};_0x5ef3c4[_0x9e14('0x39')]=_[_0x9e14('0x3c')](db[_0x9e14('0x35')][_0x9e14('0x36')]);_0x5ef3c4[_0x9e14('0x3b')]=_[_0x9e14('0x3c')](_0x121708[_0x9e14('0x3b')]);_0x5ef3c4['filters']=_[_0x9e14('0x3e')](_0x5ef3c4['model'],_0x5ef3c4[_0x9e14('0x3b')]);_0x2aab2e[_0x9e14('0x40')]=_['intersection'](_0x5ef3c4[_0x9e14('0x39')],qs[_0x9e14('0x3f')](_0x121708[_0x9e14('0x3b')][_0x9e14('0x3f')]));_0x2aab2e[_0x9e14('0x40')]=_0x2aab2e[_0x9e14('0x40')][_0x9e14('0x41')]?_0x2aab2e[_0x9e14('0x40')]:_0x5ef3c4[_0x9e14('0x39')];if(_0x121708[_0x9e14('0x3b')]['includeAll']){_0x2aab2e['include']=[{'all':!![]}];}_0x2aab2e=_['merge']({},_0x2aab2e,_0x121708[_0x9e14('0xaf')]);return db[_0x9e14('0x35')][_0x9e14('0x5e')](_0x2aab2e)[_0x9e14('0x29')](handleEntityNotFound(_0x5d756b,null))['then'](respondWithResult(_0x5d756b,null))[_0x9e14('0x33')](handleError(_0x5d756b,null));};exports[_0x9e14('0xb0')]=function(_0x2f34d6,_0x2afb32){return db[_0x9e14('0x35')][_0x9e14('0xb0')](_0x2f34d6[_0x9e14('0x73')],{})[_0x9e14('0x29')](respondWithResult(_0x2afb32,0xc9))[_0x9e14('0x33')](handleError(_0x2afb32,null));};exports[_0x9e14('0x28')]=function(_0x1ac41d,_0x55cd9b){if(_0x1ac41d[_0x9e14('0x73')]['id']){delete _0x1ac41d[_0x9e14('0x73')]['id'];}return db[_0x9e14('0x35')][_0x9e14('0x5e')]({'where':{'id':_0x1ac41d[_0x9e14('0xae')]['id']}})[_0x9e14('0x29')](handleEntityNotFound(_0x55cd9b,null))[_0x9e14('0x29')](saveUpdates(_0x1ac41d[_0x9e14('0x73')],null))[_0x9e14('0x29')](respondWithResult(_0x55cd9b,null))[_0x9e14('0x33')](handleError(_0x55cd9b,null));};exports[_0x9e14('0x2a')]=function(_0x4bc31e,_0x9a643d){return db[_0x9e14('0x35')][_0x9e14('0x5e')]({'where':{'id':_0x4bc31e['params']['id']}})[_0x9e14('0x29')](handleEntityNotFound(_0x9a643d,null))[_0x9e14('0x29')](removeEntity(_0x9a643d,null))[_0x9e14('0x33')](handleError(_0x9a643d,null));};exports[_0x9e14('0xb1')]=function(_0x4e9005,_0x51eff6){return db[_0x9e14('0x35')][_0x9e14('0xb1')]()[_0x9e14('0x29')](respondWithResult(_0x51eff6,null))[_0x9e14('0x33')](handleError(_0x51eff6,null));};exports[_0x9e14('0xb2')]=function(_0x9c92e9,_0x5e091c,_0x16cd7d){return db[_0x9e14('0xb3')][_0x9e14('0x5e')]({'where':{'id':_0x9c92e9[_0x9e14('0xae')]['id']}})[_0x9e14('0x29')](handleEntityNotFound(_0x5e091c,null))[_0x9e14('0x29')](function(_0x36f375){if(_0x36f375){return _0x36f375[_0x9e14('0xb2')](_0x9c92e9[_0x9e14('0x73')][_0x9e14('0xb4')],_['omit'](_0x9c92e9[_0x9e14('0x73')],[_0x9e14('0xb4'),'id'])||{});}})[_0x9e14('0x29')](respondWithResult(_0x5e091c,null))[_0x9e14('0x33')](handleError(_0x5e091c,null));};exports[_0x9e14('0xb5')]=function(_0x36c08b,_0x105e73,_0x5e45c7){var _0x364699={'raw':![],'where':{}};var _0x1d648f={};var _0x4da749={'count':0x0,'rows':[]};return db[_0x9e14('0x35')][_0x9e14('0xb6')]({'where':{'id':_0x36c08b[_0x9e14('0xae')]['id']}})[_0x9e14('0x29')](handleEntityNotFound(_0x105e73,null))[_0x9e14('0x29')](function(_0x117726){if(_0x117726){_0x1d648f[_0x9e14('0x39')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x1d648f['query']=_['keys'](_0x36c08b[_0x9e14('0x3b')]);_0x1d648f[_0x9e14('0x3d')]=_[_0x9e14('0x3e')](_0x1d648f[_0x9e14('0x39')],_0x1d648f[_0x9e14('0x3b')]);_0x364699['attributes']=_[_0x9e14('0x3e')](_0x1d648f[_0x9e14('0x39')],qs[_0x9e14('0x3f')](_0x36c08b[_0x9e14('0x3b')][_0x9e14('0x3f')]));_0x364699['attributes']=_0x364699[_0x9e14('0x40')]['length']?_0x364699[_0x9e14('0x40')]:_0x1d648f[_0x9e14('0x39')];if(!_0x36c08b[_0x9e14('0x3b')][_0x9e14('0x42')](_0x9e14('0xb7'))){_0x364699[_0x9e14('0x21')]=qs['limit'](_0x36c08b[_0x9e14('0x3b')][_0x9e14('0x21')]);_0x364699['offset']=qs[_0x9e14('0x22')](_0x36c08b[_0x9e14('0x3b')][_0x9e14('0x22')]);}_0x364699[_0x9e14('0x8c')]=qs[_0x9e14('0x43')](_0x36c08b[_0x9e14('0x3b')][_0x9e14('0x43')]);_0x364699[_0x9e14('0x44')]=qs[_0x9e14('0x3d')](_[_0x9e14('0xb8')](_0x36c08b[_0x9e14('0x3b')],_0x1d648f[_0x9e14('0x3d')]));_0x364699['where'][_0x9e14('0xaa')]=_0x117726['id'];if(_0x36c08b[_0x9e14('0x3b')]['filter']){_0x364699[_0x9e14('0x44')]=_[_0x9e14('0xb9')](_0x364699[_0x9e14('0x44')],{'$or':_[_0x9e14('0x2c')](_0x364699[_0x9e14('0x40')],function(_0x27f9f4){var _0xa780d4={};_0xa780d4[_0x27f9f4]={'$like':'%'+_0x36c08b[_0x9e14('0x3b')][_0x9e14('0x81')]+'%'};return _0xa780d4;})});}if(_0x36c08b[_0x9e14('0x3b')][_0x9e14('0x79')]){var _0x189bab=_0x36c08b[_0x9e14('0x3b')][_0x9e14('0x79')]['split'](',');var _0xb2a516={};_0xb2a516[_0x189bab[0x0]]={'$gte':moment(_0x189bab[0x1])['format'](_0x9e14('0xba'))};_0x364699[_0x9e14('0x44')]=_[_0x9e14('0xb9')](_0x364699[_0x9e14('0x44')],_0xb2a516);}_0x364699=_[_0x9e14('0xb9')]({},_0x364699,_0x36c08b[_0x9e14('0xaf')]);return db[_0x9e14('0xb3')][_0x9e14('0x23')]({'where':_0x364699[_0x9e14('0x44')]})[_0x9e14('0x29')](function(_0x273a59){_0x4da749['count']=_0x273a59;if(_0x36c08b[_0x9e14('0x3b')][_0x9e14('0xbb')]){_0x364699['include']=[{'all':!![]}];}return db[_0x9e14('0xb3')]['findAll'](_0x364699);})[_0x9e14('0x29')](function(_0x279841){_0x4da749[_0x9e14('0xac')]=_0x279841;return _0x4da749;});}})['then'](respondWithFilteredResult(_0x105e73,_0x364699))[_0x9e14('0x33')](handleError(_0x105e73,null));};exports[_0x9e14('0xbc')]=function(_0x5cc5ff,_0x239a55,_0x439f81){return db['OpenchannelInteraction']['find']({'where':{'id':_0x5cc5ff[_0x9e14('0xae')]['id']}})[_0x9e14('0x29')](handleEntityNotFound(_0x239a55,null))[_0x9e14('0x29')](function(_0x2c495b){if(_0x2c495b){return _0x2c495b[_0x9e14('0xbd')](_0x5cc5ff[_0x9e14('0x73')]['ids'],_['omit'](_0x5cc5ff[_0x9e14('0x73')],[_0x9e14('0xb4'),'id'])||{})['spread'](function(){return db[_0x9e14('0x6e')][_0x9e14('0xbe')]({'attributes':['id',_0x9e14('0x3a'),_0x9e14('0x47')],'where':{'id':_0x5cc5ff['body']['ids']}});})[_0x9e14('0x29')](function(_0x567b1e){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x5cc5ff[_0x9e14('0xae')]['id']),'tags':_0x567b1e||[]});return{'id':Number(_0x5cc5ff['params']['id']),'tags':_0x567b1e||[]};});}})[_0x9e14('0x29')](respondWithResult(_0x239a55,null))[_0x9e14('0x33')](handleError(_0x239a55,null));};exports[_0x9e14('0xbf')]=function(_0x586bde,_0x792f54,_0x4dedbd){return db[_0x9e14('0x35')][_0x9e14('0x5e')]({'where':{'id':_0x586bde[_0x9e14('0xae')]['id']}})[_0x9e14('0x29')](handleEntityNotFound(_0x792f54,null))[_0x9e14('0x29')](function(_0x19584b){if(_0x19584b){return _0x19584b['removeTags'](_0x586bde['query'][_0x9e14('0xb4')]);}})[_0x9e14('0x29')](respondWithStatusCode(_0x792f54,null))[_0x9e14('0x33')](handleError(_0x792f54,null));};exports['download']=function(_0x233f9d,_0x21a364){var _0x53cb1b=moment()[_0x9e14('0xc0')]()[_0x9e14('0x95')]();var _0x2b72ce=path[_0x9e14('0xc1')](config['root'],'server',_0x9e14('0xc2'),_0x9e14('0xc3'));var _0x20bf95=path[_0x9e14('0xc1')](config['root'],'server',_0x9e14('0xc2'),_0x9e14('0xc4'));var _0x122de5=path[_0x9e14('0xc1')](_0x2b72ce,_0x53cb1b);var _0x135d1d=util[_0x9e14('0xc5')]('transcript-%d-%s.zip',_0x233f9d[_0x9e14('0xae')]['id'],_0x53cb1b);var _0x54a19b=path[_0x9e14('0xc1')](_0x2b72ce,_0x135d1d);var _0x316974=[];_0x316974[_0x9e14('0x32')]({'model':db['User'],'as':_0x9e14('0x71'),'attributes':['id',_0x9e14('0x2d')],'raw':!![]});_0x316974[_0x9e14('0x32')]({'model':db[_0x9e14('0xc6')],'as':_0x9e14('0x64'),'attributes':['id',_0x9e14('0xc7'),_0x9e14('0xc8')],'raw':!![]});if(_0x233f9d[_0x9e14('0x3b')][_0x9e14('0xc4')]){_0x316974[_0x9e14('0x32')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2c3582=[{'model':db[_0x9e14('0xb3')],'as':'Messages','attributes':['id','body',_0x9e14('0xc9'),_0x9e14('0xca'),_0x9e14('0xcb'),_0x9e14('0x7d')],'include':_0x316974}];_0x2c3582[_0x9e14('0x32')]({'model':db[_0x9e14('0xcc')],'as':_0x9e14('0xcd'),'attributes':['id','name']});_0x2c3582['push']({'model':db[_0x9e14('0x71')],'as':_0x9e14('0xce'),'attributes':['id',_0x9e14('0x2d')]});return db['OpenchannelInteraction'][_0x9e14('0x5e')]({'where':{'id':_0x233f9d['params']['id']},'include':_0x2c3582})[_0x9e14('0x29')](handleEntityNotFound(_0x21a364,null))['then'](function(_0x3d74f6){if(_0x3d74f6){var _0x301e6f=_0x3d74f6[_0x9e14('0xcf')]({'plain':!![]});fs[_0x9e14('0xd0')](_0x122de5);var _0x1b1101={'channel':_0x9e14('0xd1'),'account':_0x301e6f[_0x9e14('0xcd')][_0x9e14('0x3a')],'agent':_0x301e6f[_0x9e14('0xce')]?_0x301e6f[_0x9e14('0xce')][_0x9e14('0x2d')]:'N.A.','createdAt':moment(_0x301e6f[_0x9e14('0xc9')])[_0x9e14('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x301e6f[_0x9e14('0xd2')]?moment(_0x301e6f['closedAt'])['format'](_0x9e14('0xba'))[_0x9e14('0x95')]():'','disposition':_0x301e6f[_0x9e14('0xd3')],'visibility':_0x301e6f[_0x9e14('0xd4')]?_0x9e14('0xd5'):_0x9e14('0xd6'),'messages':_(_0x301e6f['Messages'])[_0x9e14('0x81')]({'secret':![]})[_0x9e14('0x2c')](function(_0x23050e){if(_0x23050e[_0x9e14('0xd7')]){var _0x3275ef=path['join'](_0x20bf95,_0x23050e[_0x9e14('0xd7')][_0x9e14('0xd8')]);if(fs[_0x9e14('0xd9')](_0x3275ef)){fs['createReadStream'](_0x3275ef)['pipe'](fs[_0x9e14('0xda')](path['join'](_0x122de5,_0x23050e[_0x9e14('0xd7')]['basename'])));}}return{'date':moment(_0x23050e['createdAt'])[_0x9e14('0xc5')](_0x9e14('0xba'))[_0x9e14('0x95')](),'sender':_0x23050e[_0x9e14('0xca')]===_0x9e14('0xdb')?_0x23050e[_0x9e14('0x71')]?_0x23050e[_0x9e14('0x71')][_0x9e14('0x2d')]:_0x9e14('0xdc'):_0x23050e['Contact'][_0x9e14('0xc7')]+(_0x23050e[_0x9e14('0x64')][_0x9e14('0xc8')]?'\x20'+_0x23050e[_0x9e14('0x64')][_0x9e14('0xc8')]:''),'body':_0x23050e[_0x9e14('0xd7')]?_0x23050e['Attachment'][_0x9e14('0xd8')]:_0x23050e['body'],'direction':_0x23050e[_0x9e14('0xca')]===_0x9e14('0xdb')?'A':'C','secret':_0x23050e[_0x9e14('0xcb')],'read':_0x23050e[_0x9e14('0x7d')],'attachment':_0x23050e[_0x9e14('0xd7')]};})[_0x9e14('0x60')]()};return ejs['renderFile'](path['join'](config[_0x9e14('0xdd')],_0x9e14('0xde'),_0x9e14('0xdf'),_0x9e14('0xe0')),{'interaction':_0x1b1101})[_0x9e14('0x29')](function(_0x53b984){var _0x2ee764=path[_0x9e14('0xc1')](_0x122de5,_0x9e14('0xe1')+_0x301e6f['id']+'-'+_0x53cb1b+_0x9e14('0xe2'));var _0x284a7a={'path':_0x2ee764,'channel':_0x9e14('0xd1'),'interactionId':_0x301e6f['id']};return pdf['createPdfFromHTML'](_0x53b984,_0x284a7a);})[_0x9e14('0x29')](function(){return new BPromise(function(_0xd024e4,_0x3a4114){zipdir(_0x122de5,{'saveTo':_0x54a19b},function(_0x48c604,_0x3c247b){if(_0x48c604)return _0x3a4114(_0x48c604);return _0xd024e4(_0x3c247b);});})[_0x9e14('0x29')](function(){return new BPromise(function(_0x5bde5d,_0x561bde){rimraf(_0x122de5,function(_0xc882a4){if(_0xc882a4)_0x561bde(_0xc882a4);return _0x5bde5d();});});})[_0x9e14('0x29')](function(){return _0x21a364[_0x9e14('0xe3')](_0x54a19b,_0x135d1d,function(_0x2968eb){if(_0x2968eb){console[_0x9e14('0xe4')](_0x9e14('0xe5'),_0x2968eb);}else{fs['unlinkSync'](_0x54a19b);}});});});}else{return _0x21a364['sendStatus'](0xc8);}})[_0x9e14('0x33')](handleError(_0x21a364,null));};
\ No newline at end of file
+var _0x53ab=['Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','direction','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','map','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','from','u.fullname','ui.OpenchannelInteractionId','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','parseSearch','conditions','length','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','buildExpression','some','isEmpty','OpenchannelAccountId','concat','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','user','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','rows','show','includeAll','options','create','params','describe','addMessage','OpenchannelMessage','ids','omit','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','Account'];(function(_0x1f3eeb,_0x285352){var _0x91229=function(_0x312727){while(--_0x312727){_0x1f3eeb['push'](_0x1f3eeb['shift']());}};_0x91229(++_0x285352);}(_0x53ab,0x101));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb53a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb53a('0x1'));var jsonpatch=require(_0xb53a('0x2'));var rp=require('request-promise');var moment=require(_0xb53a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb53a('0x4'));var util=require(_0xb53a('0x5'));var path=require(_0xb53a('0x6'));var sox=require(_0xb53a('0x7'));var csv=require(_0xb53a('0x8'));var ejs=require(_0xb53a('0x9'));var fs=require('fs');var fs_extra=require(_0xb53a('0xa'));var _=require(_0xb53a('0xb'));var squel=require(_0xb53a('0xc'));var crypto=require('crypto');var jsforce=require(_0xb53a('0xd'));var deskjs=require(_0xb53a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb53a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb53a('0x10'));var as=require(_0xb53a('0x11'));var pdf=require(_0xb53a('0x12'));var hardwareService=require(_0xb53a('0x13'));var logger=require(_0xb53a('0x14'))(_0xb53a('0x15'));var utils=require(_0xb53a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb53a('0x17'));var db=require(_0xb53a('0x18'))['db'];config[_0xb53a('0x19')]=_['defaults'](config[_0xb53a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb53a('0x1a'))(new Redis(config[_0xb53a('0x19')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1cd080,_0x32df9b){_0x32df9b=_0x32df9b||0xcc;return function(_0x347fd8){if(_0x347fd8){return _0x1cd080['sendStatus'](_0x32df9b);}return _0x1cd080[_0xb53a('0x1b')](_0x32df9b)[_0xb53a('0x1c')]();};}function respondWithResult(_0x1873e3,_0x3cdcd5){_0x3cdcd5=_0x3cdcd5||0xc8;return function(_0x21fb1e){if(_0x21fb1e){return _0x1873e3['status'](_0x3cdcd5)['json'](_0x21fb1e);}};}function respondWithFilteredResult(_0x44d882,_0xaabc10){return function(_0x4de9d9){if(_0x4de9d9){var _0x43c5e2=typeof _0xaabc10[_0xb53a('0x1d')]==='undefined'&&typeof _0xaabc10[_0xb53a('0x1e')]==='undefined';var _0x28608e=_0x4de9d9[_0xb53a('0x1f')];var _0x23a6f4=_0x43c5e2?0x0:_0xaabc10[_0xb53a('0x1d')];var _0x2f290b=_0x43c5e2?_0x4de9d9[_0xb53a('0x1f')]:_0xaabc10[_0xb53a('0x1d')]+_0xaabc10[_0xb53a('0x1e')];var _0x163f16;if(_0x2f290b>=_0x28608e){_0x2f290b=_0x28608e;_0x163f16=0xc8;}else{_0x163f16=0xce;}_0x44d882[_0xb53a('0x1b')](_0x163f16);return _0x44d882[_0xb53a('0x20')](_0xb53a('0x21'),_0x23a6f4+'-'+_0x2f290b+'/'+_0x28608e)[_0xb53a('0x22')](_0x4de9d9);}return null;};}function patchUpdates(_0x565b56){return function(_0xd21200){try{jsonpatch[_0xb53a('0x23')](_0xd21200,_0x565b56,!![]);}catch(_0x354d9f){return BPromise['reject'](_0x354d9f);}return _0xd21200[_0xb53a('0x24')]();};}function saveUpdates(_0x4e168a,_0x5b7ab3){return function(_0x8d809a){if(_0x8d809a){return _0x8d809a[_0xb53a('0x25')](_0x4e168a)[_0xb53a('0x26')](function(_0x27c868){return _0x27c868;});}return null;};}function removeEntity(_0x2e3c42,_0x9cdc3c){return function(_0x101f39){if(_0x101f39){return _0x101f39[_0xb53a('0x27')]()[_0xb53a('0x26')](function(){_0x2e3c42[_0xb53a('0x1b')](0xcc)[_0xb53a('0x1c')]();});}};}function handleEntityNotFound(_0xbed537,_0x419c29){return function(_0x27c9e3){if(!_0x27c9e3){_0xbed537[_0xb53a('0x28')](0x194);}return _0x27c9e3;};}function handleError(_0x10bba3,_0x5b1e37){_0x5b1e37=_0x5b1e37||0x1f4;return function(_0x4045db){logger['error'](_0x4045db[_0xb53a('0x29')]);if(_0x4045db[_0xb53a('0x2a')]){delete _0x4045db[_0xb53a('0x2a')];}_0x10bba3[_0xb53a('0x1b')](_0x5b1e37)[_0xb53a('0x2b')](_0x4045db);};}function getInteractionUsers(_0x67d3c2,_0x52605a){return new BPromise(function(_0x3fd34b,_0x1b4599){try{if(_0x52605a[_0x67d3c2['id']]){_0x67d3c2['Users']=_[_0xb53a('0x2c')](_0x52605a[_0x67d3c2['id']],function(_0x2767c3){return{'id':_0x2767c3['id'],'fullname':_0x2767c3['fullname']};});}}catch(_0x3f0db5){_0x1b4599(_0x3f0db5);}_0x3fd34b(_0x67d3c2);});}function getInteractionTags(_0x51aa38,_0x2ee8d5){return new BPromise(function(_0x4f721c,_0x253220){try{if(_0x51aa38[_0xb53a('0x2d')]){_0x51aa38[_0xb53a('0x2e')]=[];_0x51aa38[_0xb53a('0x2d')][_0xb53a('0x2f')](',')[_0xb53a('0x30')](function(_0x3084a3){_0x51aa38['Tags'][_0xb53a('0x31')](_0x2ee8d5[_0x3084a3]);});}delete _0x51aa38[_0xb53a('0x2d')];}catch(_0x116564){_0x253220(_0x116564);}_0x4f721c(_0x51aa38);});}function updateOpenchannelInteraction(_0x303e2b,_0xf86b77,_0x1c439f){return new BPromise(function(_0x31a8aa,_0x5a4243){return getInteractionUsers(_0x303e2b,_0x1c439f)[_0xb53a('0x26')](function(_0x5bfa3f){return getInteractionTags(_0x5bfa3f,_0xf86b77);})[_0xb53a('0x26')](function(_0x48c6a3){_0x31a8aa(_0x48c6a3);})[_0xb53a('0x32')](function(_0x6d33d7){_0x5a4243(_0x6d33d7);});});}exports[_0xb53a('0x33')]=function(_0x44b286,_0x5e7db6){var _0x826038={},_0x3c7fc9={},_0xa750f8={'count':0x0,'rows':[]};var _0x4a20f3=_[_0xb53a('0x2c')](db[_0xb53a('0x34')][_0xb53a('0x35')],function(_0x2ab853){return{'name':_0x2ab853[_0xb53a('0x36')],'type':_0x2ab853[_0xb53a('0x37')]['key']};});_0x3c7fc9[_0xb53a('0x38')]=_[_0xb53a('0x2c')](_0x4a20f3,_0xb53a('0x2a'));_0x3c7fc9[_0xb53a('0x39')]=_[_0xb53a('0x3a')](_0x44b286[_0xb53a('0x39')]);_0x3c7fc9[_0xb53a('0x3b')]=_[_0xb53a('0x3c')](_0x3c7fc9[_0xb53a('0x38')],_0x3c7fc9[_0xb53a('0x39')]);_0x826038[_0xb53a('0x3d')]=_[_0xb53a('0x3c')](_0x3c7fc9[_0xb53a('0x38')],qs['fields'](_0x44b286[_0xb53a('0x39')][_0xb53a('0x3e')]));_0x826038[_0xb53a('0x3d')]=_0x826038[_0xb53a('0x3d')]['length']?_0x826038[_0xb53a('0x3d')]:_0x3c7fc9['model'];if(!_0x44b286['query']['hasOwnProperty'](_0xb53a('0x3f'))){_0x826038[_0xb53a('0x1e')]=qs['limit'](_0x44b286[_0xb53a('0x39')][_0xb53a('0x1e')]);_0x826038[_0xb53a('0x1d')]=qs[_0xb53a('0x1d')](_0x44b286[_0xb53a('0x39')][_0xb53a('0x1d')]);}_0x826038[_0xb53a('0x40')]=qs[_0xb53a('0x41')](_0x44b286[_0xb53a('0x39')][_0xb53a('0x41')]);_0x826038[_0xb53a('0x42')]=qs[_0xb53a('0x3b')](_[_0xb53a('0x43')](_0x44b286[_0xb53a('0x39')],_0x3c7fc9[_0xb53a('0x3b')]),_0x4a20f3);var _0x531cf1=[];var _0x4b4e6f=squel[_0xb53a('0x44')]()[_0xb53a('0x45')]('id')[_0xb53a('0x45')](_0xb53a('0x2a'))['field']('color')[_0xb53a('0x46')]('tools_tags');var _0x3b4937=squel['select']()[_0xb53a('0x45')]('u.id')[_0xb53a('0x45')](_0xb53a('0x47'))['field'](_0xb53a('0x48'))[_0xb53a('0x46')]('user_has_openchannel_interactions','ui')['left_join'](_0xb53a('0x49'),'u',_0xb53a('0x4a'));var _0x4a8c70=squel[_0xb53a('0x44')]()['from'](_0xb53a('0x4b'),'i')[_0xb53a('0x4c')]('cm_contacts','c',_0xb53a('0x4d'))['left_join'](_0xb53a('0x49'),'o',_0xb53a('0x4e'))['left_join'](_0xb53a('0x4f'),'a',_0xb53a('0x50'))[_0xb53a('0x4c')](_0xb53a('0x51'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xb53a('0x4c')](_0xb53a('0x52'),'it',_0xb53a('0x53'))[_0xb53a('0x4c')](_0xb53a('0x54'),'t','t.id\x20=\x20it.TagId');var _0x46113f=squel[_0xb53a('0x55')]();var _0x66dcdc=[];var _0x128c43=squel[_0xb53a('0x55')]();var _0x36d74e;if(_0x44b286[_0xb53a('0x39')]['search']){_0x36d74e=as[_0xb53a('0x56')](_0x44b286[_0xb53a('0x39')]['search']);var _0x2b0f7e=_0x36d74e['sqlOperator'];for(var _0x3456d2=0x0;_0x3456d2<_0x36d74e[_0xb53a('0x57')][_0xb53a('0x58')];_0x3456d2++){var _0x6c7c5a=_0x36d74e[_0xb53a('0x57')][_0x3456d2];var _0x4dfe92='i';var _0x59b100=_['find'](_0x4a20f3,['name',_0x6c7c5a[_0xb53a('0x45')]]);if(!_0x59b100){switch(_0x6c7c5a[_0xb53a('0x45')]){case _0xb53a('0x59'):if(_0x6c7c5a['value']==0x1){_0x4a8c70[_0xb53a('0x5a')]('`'+_0x6c7c5a[_0xb53a('0x45')]+_0xb53a('0x5b'));}else{_0x4a8c70[_0xb53a('0x5a')]('`'+_0x6c7c5a[_0xb53a('0x45')]+_0xb53a('0x5c'));}break;case _0xb53a('0x5d'):if(_0x6c7c5a[_0xb53a('0x5e')]===_0xb53a('0x5f')){if(_0x6c7c5a[_0xb53a('0x60')][_0xb53a('0x2f')]('\x20')[_0xb53a('0x58')]>0x1){_0x46113f[_0x2b0f7e](_0xb53a('0x61'),qs[_0xb53a('0x62')](_0x6c7c5a[_0xb53a('0x60')]),null);}else{var _0x11132f='%'+_0x6c7c5a[_0xb53a('0x60')]+'%';_0x46113f[_0x2b0f7e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x11132f,_0x11132f,_0x11132f);}}else{_0x59b100=_[_0xb53a('0x63')](_0x4a20f3,[_0xb53a('0x2a'),_0xb53a('0x64')]);_0x6c7c5a['field']=_0xb53a('0x64');_0x28216a=as['buildExpression'](_0x4dfe92,_0x59b100[_0xb53a('0x37')],_0x6c7c5a);_0x46113f[_0x2b0f7e](_0x28216a['text'],_0x28216a[_0xb53a('0x60')][_0xb53a('0x65')],_0x28216a[_0xb53a('0x60')]['end']);}break;case _0xb53a('0x66'):var _0x26825e=_0x6c7c5a[_0xb53a('0x60')]['split'](',')['map'](function(_0x1f1a16){return Number(_0x1f1a16);});_0x26825e[_0xb53a('0x30')](function(_0x11304f){_0x128c43['or'](_0xb53a('0x67'),'%,'+_0x11304f+',%');});_0x66dcdc=_['union'](_0x66dcdc,_0x26825e);break;case _0xb53a('0x68'):if(_0x6c7c5a[_0xb53a('0x5e')]===_0xb53a('0x5f')){_0x46113f[_0x2b0f7e](_0xb53a('0x69'),'%'+_0x6c7c5a['value']+'%',null);}else{_0x59b100=_[_0xb53a('0x63')](_0x4a20f3,[_0xb53a('0x2a'),'UserId']);_0x6c7c5a['field']='UserId';_0x28216a=as['buildExpression'](_0x4dfe92,_0x59b100[_0xb53a('0x37')],_0x6c7c5a);_0x46113f[_0x2b0f7e](_0x28216a[_0xb53a('0x6a')],_0x28216a[_0xb53a('0x60')][_0xb53a('0x65')],_0x28216a[_0xb53a('0x60')][_0xb53a('0x1c')]);}break;case _0xb53a('0x6b'):_0x28216a=as[_0xb53a('0x6c')]('me',null,_0x6c7c5a);_0x46113f[_0x2b0f7e](_0x28216a['text'],_0x28216a[_0xb53a('0x60')][_0xb53a('0x65')],_0x28216a[_0xb53a('0x60')]['end']);break;}}else{var _0x28216a=as[_0xb53a('0x6c')](_0x4dfe92,_0x59b100[_0xb53a('0x37')],_0x6c7c5a);_0x46113f[_0x2b0f7e](_0x28216a['text'],_0x28216a[_0xb53a('0x60')][_0xb53a('0x65')],_0x28216a[_0xb53a('0x60')][_0xb53a('0x1c')]);}}}else{var _0x483fa8=_(_0x44b286[_0xb53a('0x39')])[_0xb53a('0x3a')]()[_0xb53a('0x2c')](function(_0x18d0bc){return _[_0xb53a('0x6d')](_0x4a20f3,[_0xb53a('0x2a'),_0x18d0bc])?_0x18d0bc:undefined;})['compact']()[_0xb53a('0x60')]();if(!_[_0xb53a('0x6e')](_0x483fa8)){_0x483fa8[_0xb53a('0x30')](function(_0x1ec0e6){if(_0x1ec0e6===_0xb53a('0x6f')){_0x4a8c70[_0xb53a('0x42')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xb53a('0x70')](_0x44b286[_0xb53a('0x39')][_0x1ec0e6]));}else if(_0x1ec0e6==='createdAt'){var _0x32bc9e=JSON['parse'](_0x44b286[_0xb53a('0x39')][_0x1ec0e6])[_0xb53a('0x71')];var _0xc5d8ab=JSON['parse'](_0x44b286['query'][_0x1ec0e6])[_0xb53a('0x72')];_0x4a8c70[_0xb53a('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x32bc9e,_0xc5d8ab);}else{if(_0x44b286[_0xb53a('0x39')][_0x1ec0e6]===_0xb53a('0x73')){_0x4a8c70[_0xb53a('0x42')]('i.'+_0x1ec0e6+_0xb53a('0x74'));}else{_0x4a8c70[_0xb53a('0x42')]('i.'+_0x1ec0e6+_0xb53a('0x75'),_0x44b286[_0xb53a('0x39')][_0x1ec0e6]);}}});}if(_0x44b286[_0xb53a('0x39')][_0xb53a('0x76')]){if(_0x44b286[_0xb53a('0x39')]['read']==0x1){_0x4a8c70[_0xb53a('0x5a')](_0xb53a('0x77'));}else{_0x4a8c70[_0xb53a('0x5a')]('`unreadMessages`\x20>\x200');}}if(_0x44b286[_0xb53a('0x39')][_0xb53a('0x78')]){_0x66dcdc=_[_0xb53a('0x79')](_0x44b286[_0xb53a('0x39')][_0xb53a('0x78')])?_0x44b286[_0xb53a('0x39')][_0xb53a('0x78')]:new Array(_0x44b286[_0xb53a('0x39')][_0xb53a('0x78')]);_0x66dcdc['forEach'](function(_0x107e3f){_0x128c43['or'](_0xb53a('0x67'),'%,'+_0x107e3f+',%');});}if(_0x44b286[_0xb53a('0x39')][_0xb53a('0x7a')]){var _0x445a4e=_0x44b286[_0xb53a('0x39')]['filter'][_0xb53a('0x7b')]('\x5c','\x5c\x5c')[_0xb53a('0x7b')](/'/g,'\x27\x27');if(qs[_0xb53a('0x7c')](_0x445a4e)){_0x46113f['or'](_0xb53a('0x7d'),_0x445a4e+'%');}else{_0x46113f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x445a4e))['or']('i.from\x20LIKE\x20?',_0x445a4e+'%')['or'](_0xb53a('0x7e'),_0x445a4e+'%');}}}_0x4a8c70[_0xb53a('0x42')](_0x46113f);_0x4a8c70[_0xb53a('0x7f')](_0xb53a('0x80'));var _0x448ba1={'type':db[_0xb53a('0x81')][_0xb53a('0x82')]['SELECT'],'raw':!![]};var _0x5d0a1b=_0x4a8c70[_0xb53a('0x83')]();_0x5d0a1b[_0xb53a('0x45')](_0xb53a('0x80'));_0x5d0a1b[_0xb53a('0x45')](_0xb53a('0x84'),_0xb53a('0x59'));if(_0x826038['order']){_0x826038[_0xb53a('0x40')][_0xb53a('0x30')](function(_0xc32bd2){var _0x49a844=_0xc32bd2[0x0]===_0xb53a('0x85')?_0xc32bd2[0x0]:'i.'+_0xc32bd2[0x0];_0x4a8c70[_0xb53a('0x40')](_0x49a844,_0xc32bd2[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb53a('0x6e')](_0x66dcdc)){_0x4a8c70[_0xb53a('0x5a')](_0x128c43);_0x5d0a1b['where'](_0xb53a('0x86'),_0x66dcdc);}BPromise[_0xb53a('0x87')]()[_0xb53a('0x26')](function(){if(!_0x36d74e){if(_0x44b286[_0xb53a('0x39')]['OpenchannelAccountId'])return;_0x5d0a1b[_0xb53a('0x42')](_0xb53a('0x88'));_0x4a8c70[_0xb53a('0x42')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x44b286['user'][_0xb53a('0x89')]!==_0xb53a('0x8a'))return;return _0x44b286['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xb53a('0x26')](function(_0x1e76da){if(_[_0xb53a('0x6e')](_0x1e76da)){_0x5d0a1b[_0xb53a('0x42')](_0xb53a('0x8b'));_0x4a8c70[_0xb53a('0x42')](_0xb53a('0x8b'));}else{_0x5d0a1b['where'](_0xb53a('0x8c'),_['map'](_0x1e76da,'id'));_0x4a8c70[_0xb53a('0x42')](_0xb53a('0x8c'),_[_0xb53a('0x2c')](_0x1e76da,'id'));}});})[_0xb53a('0x26')](function(){if(_0x44b286[_0xb53a('0x8d')]['role']===_0xb53a('0x8a')&&!_0x36d74e&&!_0x44b286[_0xb53a('0x39')]['OpenchannelAccountId'])return[];return db[_0xb53a('0x8e')]['query'](_0x5d0a1b[_0xb53a('0x8f')](),_0x448ba1);})[_0xb53a('0x26')](function(_0x826d34){_0xa750f8[_0xb53a('0x1f')]=_0x826d34[_0xb53a('0x58')];if(_0xa750f8['count']===0x0)return[];return db[_0xb53a('0x8e')][_0xb53a('0x39')](_0x4b4e6f[_0xb53a('0x8f')](),_0x448ba1)[_0xb53a('0x26')](function(_0x5c8d5a){_0x531cf1=_[_0xb53a('0x90')](_0x5c8d5a,'id');_0x448ba1=_[_0xb53a('0x91')](_0x448ba1,{'model':db[_0xb53a('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x44b286[_0xb53a('0x39')][_0xb53a('0x3e')]){_0x826038[_0xb53a('0x3d')][_0xb53a('0x30')](function(_0x5e72f1){_0x4a8c70[_0xb53a('0x45')]('i.'+_0x5e72f1);});}else{_0x4a8c70[_0xb53a('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb53a('0x59'));_0x4a8c70['field']('a.key',_0xb53a('0x92'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0x93'),_0xb53a('0x94'));_0x4a8c70['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');_0x4a8c70['field'](_0xb53a('0x95'));_0x4a8c70['field'](_0xb53a('0x96'),_0xb53a('0x97'));_0x4a8c70[_0xb53a('0x45')]('c.lastName',_0xb53a('0x98'));_0x4a8c70['field'](_0xb53a('0x99'),_0xb53a('0x9a'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0x9b'),_0xb53a('0x9c'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0x9d'),_0xb53a('0x9e'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0x9f'),_0xb53a('0xa0'));_0x4a8c70[_0xb53a('0x45')]('o.fullname',_0xb53a('0xa1'));_0x4a8c70['field'](_0xb53a('0xa2'),_0xb53a('0xa3'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0xa4'),_0xb53a('0x2d'));}if(_0x826038[_0xb53a('0x1e')])_0x4a8c70[_0xb53a('0x1e')](_0x826038['limit']);if(_0x826038[_0xb53a('0x1d')])_0x4a8c70['offset'](_0x826038[_0xb53a('0x1d')]);return db['sequelize'][_0xb53a('0x39')](_0x4a8c70[_0xb53a('0x8f')](),_0x448ba1);})[_0xb53a('0x26')](function(_0xd04c54){if(_0xd04c54[_0xb53a('0x58')]>0x0)_0x3b4937['where'](_0xb53a('0xa5'),_['map'](_0xd04c54,'id'));return db[_0xb53a('0x8e')][_0xb53a('0x39')](_0x3b4937[_0xb53a('0x8f')](),_0x448ba1)[_0xb53a('0x26')](function(_0x48c680){var _0x5b273c=_['groupBy'](_0x48c680,_0xb53a('0xa6'));var _0x20f26f=[];_0xd04c54[_0xb53a('0x30')](function(_0x478197){_0x20f26f[_0xb53a('0x31')](updateOpenchannelInteraction(_0x478197,_0x531cf1,_0x5b273c));});return BPromise['all'](_0x20f26f);});});})[_0xb53a('0x26')](function(_0x1085b3){_0xa750f8[_0xb53a('0xa7')]=_0x1085b3;return _0xa750f8;})['then'](respondWithFilteredResult(_0x5e7db6,_0x826038))[_0xb53a('0x32')](handleError(_0x5e7db6,null));};exports[_0xb53a('0xa8')]=function(_0x1a2952,_0x58de77){var _0x1a67f2={};if(_0x1a2952[_0xb53a('0x39')][_0xb53a('0x37')]&&_0x1a2952[_0xb53a('0x39')]['type']===_0xb53a('0x46')){_0x1a67f2[_0xb53a('0x46')]=_0x1a2952['params']['id'];}else{_0x1a67f2['id']=_0x1a2952['params']['id'];}var _0x7abd1b={'raw':![],'where':_0x1a67f2},_0x14971d={};_0x14971d[_0xb53a('0x38')]=_[_0xb53a('0x3a')](db[_0xb53a('0x34')][_0xb53a('0x35')]);_0x14971d[_0xb53a('0x39')]=_['keys'](_0x1a2952['query']);_0x14971d['filters']=_[_0xb53a('0x3c')](_0x14971d[_0xb53a('0x38')],_0x14971d['query']);_0x7abd1b[_0xb53a('0x3d')]=_['intersection'](_0x14971d[_0xb53a('0x38')],qs[_0xb53a('0x3e')](_0x1a2952[_0xb53a('0x39')]['fields']));_0x7abd1b[_0xb53a('0x3d')]=_0x7abd1b['attributes'][_0xb53a('0x58')]?_0x7abd1b[_0xb53a('0x3d')]:_0x14971d['model'];if(_0x1a2952[_0xb53a('0x39')][_0xb53a('0xa9')]){_0x7abd1b['include']=[{'all':!![]}];}_0x7abd1b=_[_0xb53a('0x91')]({},_0x7abd1b,_0x1a2952[_0xb53a('0xaa')]);return db[_0xb53a('0x34')]['find'](_0x7abd1b)[_0xb53a('0x26')](handleEntityNotFound(_0x58de77,null))[_0xb53a('0x26')](respondWithResult(_0x58de77,null))['catch'](handleError(_0x58de77,null));};exports[_0xb53a('0xab')]=function(_0x54d981,_0x866698){return db['OpenchannelInteraction'][_0xb53a('0xab')](_0x54d981[_0xb53a('0x6b')],{})[_0xb53a('0x26')](respondWithResult(_0x866698,0xc9))[_0xb53a('0x32')](handleError(_0x866698,null));};exports[_0xb53a('0x25')]=function(_0x45cd0b,_0x2777db){if(_0x45cd0b['body']['id']){delete _0x45cd0b[_0xb53a('0x6b')]['id'];}return db[_0xb53a('0x34')]['find']({'where':{'id':_0x45cd0b[_0xb53a('0xac')]['id']}})['then'](handleEntityNotFound(_0x2777db,null))['then'](saveUpdates(_0x45cd0b[_0xb53a('0x6b')],null))[_0xb53a('0x26')](respondWithResult(_0x2777db,null))[_0xb53a('0x32')](handleError(_0x2777db,null));};exports['destroy']=function(_0x4ac19f,_0x43d59e){return db[_0xb53a('0x34')][_0xb53a('0x63')]({'where':{'id':_0x4ac19f[_0xb53a('0xac')]['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x43d59e,null))[_0xb53a('0x26')](removeEntity(_0x43d59e,null))[_0xb53a('0x32')](handleError(_0x43d59e,null));};exports['describe']=function(_0x59d2f8,_0x5c5c71){return db[_0xb53a('0x34')][_0xb53a('0xad')]()[_0xb53a('0x26')](respondWithResult(_0x5c5c71,null))[_0xb53a('0x32')](handleError(_0x5c5c71,null));};exports[_0xb53a('0xae')]=function(_0xd040d4,_0x595007,_0x24cb19){return db[_0xb53a('0xaf')][_0xb53a('0x63')]({'where':{'id':_0xd040d4[_0xb53a('0xac')]['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x595007,null))[_0xb53a('0x26')](function(_0x5e5f3c){if(_0x5e5f3c){return _0x5e5f3c[_0xb53a('0xae')](_0xd040d4[_0xb53a('0x6b')][_0xb53a('0xb0')],_[_0xb53a('0xb1')](_0xd040d4[_0xb53a('0x6b')],[_0xb53a('0xb0'),'id'])||{});}})[_0xb53a('0x26')](respondWithResult(_0x595007,null))[_0xb53a('0x32')](handleError(_0x595007,null));};exports['getMessages']=function(_0x2c2933,_0x53194c,_0x567de1){var _0x2579e6={'raw':![],'where':{}};var _0x584d52={};var _0x5f4b45={'count':0x0,'rows':[]};return db[_0xb53a('0x34')][_0xb53a('0xb2')]({'where':{'id':_0x2c2933['params']['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x53194c,null))['then'](function(_0x5a853a){if(_0x5a853a){_0x584d52['model']=_[_0xb53a('0x3a')](db[_0xb53a('0xaf')][_0xb53a('0x35')]);_0x584d52[_0xb53a('0x39')]=_[_0xb53a('0x3a')](_0x2c2933['query']);_0x584d52['filters']=_[_0xb53a('0x3c')](_0x584d52['model'],_0x584d52[_0xb53a('0x39')]);_0x2579e6['attributes']=_[_0xb53a('0x3c')](_0x584d52[_0xb53a('0x38')],qs['fields'](_0x2c2933[_0xb53a('0x39')][_0xb53a('0x3e')]));_0x2579e6[_0xb53a('0x3d')]=_0x2579e6[_0xb53a('0x3d')][_0xb53a('0x58')]?_0x2579e6[_0xb53a('0x3d')]:_0x584d52[_0xb53a('0x38')];if(!_0x2c2933[_0xb53a('0x39')][_0xb53a('0xb3')](_0xb53a('0x3f'))){_0x2579e6['limit']=qs[_0xb53a('0x1e')](_0x2c2933[_0xb53a('0x39')][_0xb53a('0x1e')]);_0x2579e6[_0xb53a('0x1d')]=qs['offset'](_0x2c2933['query'][_0xb53a('0x1d')]);}_0x2579e6[_0xb53a('0x40')]=qs['sort'](_0x2c2933['query']['sort']);_0x2579e6[_0xb53a('0x42')]=qs[_0xb53a('0x3b')](_[_0xb53a('0x43')](_0x2c2933['query'],_0x584d52['filters']));_0x2579e6[_0xb53a('0x42')][_0xb53a('0xa6')]=_0x5a853a['id'];if(_0x2c2933[_0xb53a('0x39')][_0xb53a('0x7a')]){_0x2579e6['where']=_[_0xb53a('0x91')](_0x2579e6[_0xb53a('0x42')],{'$or':_[_0xb53a('0x2c')](_0x2579e6[_0xb53a('0x3d')],function(_0x5bf1e9){var _0x5cbda0={};_0x5cbda0[_0x5bf1e9]={'$like':'%'+_0x2c2933['query'][_0xb53a('0x7a')]+'%'};return _0x5cbda0;})});}if(_0x2c2933['query'][_0xb53a('0x71')]){var _0x29586d=_0x2c2933[_0xb53a('0x39')][_0xb53a('0x71')][_0xb53a('0x2f')](',');var _0x33caba={};_0x33caba[_0x29586d[0x0]]={'$gte':moment(_0x29586d[0x1])[_0xb53a('0xb4')](_0xb53a('0xb5'))};_0x2579e6[_0xb53a('0x42')]=_[_0xb53a('0x91')](_0x2579e6['where'],_0x33caba);}_0x2579e6=_[_0xb53a('0x91')]({},_0x2579e6,_0x2c2933[_0xb53a('0xaa')]);return db[_0xb53a('0xaf')][_0xb53a('0x1f')]({'where':_0x2579e6[_0xb53a('0x42')]})[_0xb53a('0x26')](function(_0x2573ea){_0x5f4b45[_0xb53a('0x1f')]=_0x2573ea;if(_0x2c2933[_0xb53a('0x39')]['includeAll']){_0x2579e6[_0xb53a('0xb6')]=[{'all':!![]}];}return db[_0xb53a('0xaf')]['findAll'](_0x2579e6);})[_0xb53a('0x26')](function(_0x2afc50){_0x5f4b45[_0xb53a('0xa7')]=_0x2afc50;return _0x5f4b45;});}})[_0xb53a('0x26')](respondWithFilteredResult(_0x53194c,_0x2579e6))[_0xb53a('0x32')](handleError(_0x53194c,null));};exports[_0xb53a('0xb7')]=function(_0x2c3f19,_0x17f579,_0x333b47){return db[_0xb53a('0x34')][_0xb53a('0x63')]({'where':{'id':_0x2c3f19[_0xb53a('0xac')]['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x17f579,null))[_0xb53a('0x26')](function(_0x1a2a2a){if(_0x1a2a2a){return _0x1a2a2a[_0xb53a('0xb8')](_0x2c3f19[_0xb53a('0x6b')][_0xb53a('0xb0')],_[_0xb53a('0xb1')](_0x2c3f19['body'],[_0xb53a('0xb0'),'id'])||{})[_0xb53a('0xb9')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xb53a('0xba')],'where':{'id':_0x2c3f19[_0xb53a('0x6b')][_0xb53a('0xb0')]}});})['then'](function(_0x215383){socket[_0xb53a('0xbb')](_0xb53a('0xbc'),{'id':Number(_0x2c3f19[_0xb53a('0xac')]['id']),'tags':_0x215383||[]});return{'id':Number(_0x2c3f19[_0xb53a('0xac')]['id']),'tags':_0x215383||[]};});}})[_0xb53a('0x26')](respondWithResult(_0x17f579,null))[_0xb53a('0x32')](handleError(_0x17f579,null));};exports[_0xb53a('0xbd')]=function(_0x2a38f5,_0x37f822,_0x33c89d){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2a38f5[_0xb53a('0xac')]['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x37f822,null))[_0xb53a('0x26')](function(_0x253432){if(_0x253432){return _0x253432['removeTags'](_0x2a38f5[_0xb53a('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x37f822,null))[_0xb53a('0x32')](handleError(_0x37f822,null));};exports[_0xb53a('0xbe')]=function(_0x1b7b48,_0x42cf77){var _0x2e45e4=moment()[_0xb53a('0xbf')]()['toString']();var _0x573d74=path[_0xb53a('0xc0')](config[_0xb53a('0xc1')],_0xb53a('0xc2'),'files',_0xb53a('0xc3'));var _0x14eb1d=path['join'](config[_0xb53a('0xc1')],_0xb53a('0xc2'),'files',_0xb53a('0xc4'));var _0x26ad7a=path[_0xb53a('0xc0')](_0x573d74,_0x2e45e4);var _0x44a187=util[_0xb53a('0xb4')](_0xb53a('0xc5'),_0x1b7b48[_0xb53a('0xac')]['id'],_0x2e45e4);var _0x21fccb=path[_0xb53a('0xc0')](_0x573d74,_0x44a187);var _0x352f88=[];_0x352f88[_0xb53a('0x31')]({'model':db[_0xb53a('0x68')],'as':_0xb53a('0x68'),'attributes':['id',_0xb53a('0xc6')],'raw':!![]});_0x352f88[_0xb53a('0x31')]({'model':db[_0xb53a('0xc7')],'as':_0xb53a('0x5d'),'attributes':['id',_0xb53a('0xc8'),_0xb53a('0xc9')],'raw':!![]});if(_0x1b7b48[_0xb53a('0x39')][_0xb53a('0xc4')]){_0x352f88[_0xb53a('0x31')]({'model':db[_0xb53a('0xca')],'as':_0xb53a('0xca'),'raw':!![]});}var _0x8ef33=[{'model':db['OpenchannelMessage'],'as':_0xb53a('0xcb'),'attributes':['id',_0xb53a('0x6b'),_0xb53a('0xcc'),'direction',_0xb53a('0xcd'),_0xb53a('0x76')],'include':_0x352f88}];_0x8ef33[_0xb53a('0x31')]({'model':db['OpenchannelAccount'],'as':_0xb53a('0xce'),'attributes':['id',_0xb53a('0x2a')]});_0x8ef33[_0xb53a('0x31')]({'model':db[_0xb53a('0x68')],'as':_0xb53a('0xcf'),'attributes':['id','fullname']});return db[_0xb53a('0x34')][_0xb53a('0x63')]({'where':{'id':_0x1b7b48[_0xb53a('0xac')]['id']},'include':_0x8ef33})['then'](handleEntityNotFound(_0x42cf77,null))['then'](function(_0x159b11){if(_0x159b11){var _0x141565=_0x159b11[_0xb53a('0xd0')]({'plain':!![]});fs[_0xb53a('0xd1')](_0x26ad7a);var _0x560b56={'channel':_0xb53a('0xd2'),'account':_0x141565[_0xb53a('0xce')][_0xb53a('0x2a')],'agent':_0x141565['Owner']?_0x141565[_0xb53a('0xcf')][_0xb53a('0xc6')]:_0xb53a('0xd3'),'createdAt':moment(_0x141565[_0xb53a('0xcc')])[_0xb53a('0xb4')](_0xb53a('0xb5'))[_0xb53a('0x8f')](),'closedAt':_0x141565[_0xb53a('0xd4')]?moment(_0x141565[_0xb53a('0xd5')])['format'](_0xb53a('0xb5'))['toString']():'','disposition':_0x141565[_0xb53a('0xd6')],'visibility':_0x141565[_0xb53a('0xd7')]?_0xb53a('0xd8'):_0xb53a('0xd9'),'messages':_(_0x141565[_0xb53a('0xcb')])[_0xb53a('0x7a')]({'secret':![]})[_0xb53a('0x2c')](function(_0x4f7bc9){if(_0x4f7bc9[_0xb53a('0xca')]){var _0x10c742=path[_0xb53a('0xc0')](_0x14eb1d,_0x4f7bc9[_0xb53a('0xca')][_0xb53a('0xda')]);if(fs[_0xb53a('0xdb')](_0x10c742)){fs[_0xb53a('0xdc')](_0x10c742)[_0xb53a('0xdd')](fs[_0xb53a('0xde')](path['join'](_0x26ad7a,_0x4f7bc9[_0xb53a('0xca')][_0xb53a('0xda')])));}}return{'date':moment(_0x4f7bc9[_0xb53a('0xcc')])['format'](_0xb53a('0xb5'))['toString'](),'sender':_0x4f7bc9['direction']===_0xb53a('0xdf')?_0x4f7bc9[_0xb53a('0x68')]?_0x4f7bc9[_0xb53a('0x68')][_0xb53a('0xc6')]:_0xb53a('0xe0'):_0x4f7bc9[_0xb53a('0x5d')][_0xb53a('0xc8')]+(_0x4f7bc9[_0xb53a('0x5d')][_0xb53a('0xc9')]?'\x20'+_0x4f7bc9[_0xb53a('0x5d')][_0xb53a('0xc9')]:''),'body':_0x4f7bc9[_0xb53a('0xca')]?_0x4f7bc9['Attachment'][_0xb53a('0xda')]:_0x4f7bc9['body'],'direction':_0x4f7bc9[_0xb53a('0xe1')]===_0xb53a('0xdf')?'A':'C','secret':_0x4f7bc9[_0xb53a('0xcd')],'read':_0x4f7bc9[_0xb53a('0x76')],'attachment':_0x4f7bc9[_0xb53a('0xca')]};})[_0xb53a('0x60')]()};return ejs[_0xb53a('0xe2')](path['join'](config[_0xb53a('0xc1')],_0xb53a('0xc2'),'views',_0xb53a('0xe3')),{'interaction':_0x560b56})[_0xb53a('0x26')](function(_0x39c065){var _0x34bc59=path[_0xb53a('0xc0')](_0x26ad7a,_0xb53a('0xe4')+_0x141565['id']+'-'+_0x2e45e4+'.pdf');var _0x522054={'path':_0x34bc59,'channel':'Openchannel','interactionId':_0x141565['id']};return pdf[_0xb53a('0xe5')](_0x39c065,_0x522054);})[_0xb53a('0x26')](function(){return new BPromise(function(_0x475334,_0x3bc69f){zipdir(_0x26ad7a,{'saveTo':_0x21fccb},function(_0x1bec5a,_0x29e69b){if(_0x1bec5a)return _0x3bc69f(_0x1bec5a);return _0x475334(_0x29e69b);});})[_0xb53a('0x26')](function(){return new BPromise(function(_0x48d78e,_0x5b7320){rimraf(_0x26ad7a,function(_0x27ad55){if(_0x27ad55)_0x5b7320(_0x27ad55);return _0x48d78e();});});})[_0xb53a('0x26')](function(){return _0x42cf77[_0xb53a('0xbe')](_0x21fccb,_0x44a187,function(_0x4edb66){if(_0x4edb66){console['log'](_0xb53a('0xe6'),_0x4edb66);}else{fs[_0xb53a('0xe7')](_0x21fccb);}});});});}else{return _0x42cf77[_0xb53a('0x28')](0xc8);}})[_0xb53a('0x32')](handleError(_0x42cf77,null));};
\ No newline at end of file
index fa4f9ab..17f75f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfb7=['update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x2937ed,_0x41efb6){var _0x5427ae=function(_0x50c4b0){while(--_0x50c4b0){_0x2937ed['push'](_0x2937ed['shift']());}};_0x5427ae(++_0x41efb6);}(_0xcfb7,0x183));var _0x7cfb=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xcfb7[_0x47b58b];return _0x46bebe;};'use strict';var EventEmitter=require(_0x7cfb('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x7cfb('0x1'))['db'][_0x7cfb('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7cfb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7cfb('0x4'),'afterDestroy':_0x7cfb('0x5')};function emitEvent(_0x1a3b66){return function(_0x4622b0,_0x4a1135,_0x4771db){_0x4622b0['getUsers']({'attributes':['id'],'raw':!![]})[_0x7cfb('0x6')](function(_0x46a4ee){_0x4622b0[_0x7cfb('0x7')](_0x7cfb('0x8'),_0x46a4ee['map'](function(_0x568c01){return{'id':_0x568c01['id']};}));return OpenchannelMessage[_0x7cfb('0x9')]({'where':{'OpenchannelInteractionId':_0x4622b0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x27aa98){_0x4622b0[_0x7cfb('0x7')](_0x7cfb('0xa'),_0x27aa98[_0x7cfb('0xb')]);OpenchannelInteractionEvents[_0x7cfb('0xc')](_0x1a3b66+':'+_0x4622b0['id'],_0x4622b0);OpenchannelInteractionEvents[_0x7cfb('0xc')](_0x1a3b66,_0x4622b0);_0x4771db(null);})[_0x7cfb('0xd')](_0x4771db(null));};}for(var e in events){if(events[_0x7cfb('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x7cfb('0xf')](e,emitEvent(event));}}module[_0x7cfb('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xa3f7=['OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','events','OpenchannelInteraction'];(function(_0x9f316f,_0x598f59){var _0x2a53cc=function(_0x1d16b7){while(--_0x1d16b7){_0x9f316f['push'](_0x9f316f['shift']());}};_0x2a53cc(++_0x598f59);}(_0xa3f7,0x154));var _0x7a3f=function(_0x54357c,_0x162612){_0x54357c=_0x54357c-0x0;var _0x7c7c42=_0xa3f7[_0x54357c];return _0x7c7c42;};'use strict';var EventEmitter=require(_0x7a3f('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x7a3f('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x7a3f('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7a3f('0x3')](0x0);var events={'afterCreate':_0x7a3f('0x4'),'afterUpdate':_0x7a3f('0x5'),'afterDestroy':_0x7a3f('0x6')};function emitEvent(_0x570878){return function(_0x1ee7fd,_0x597aa1,_0x442ecc){_0x1ee7fd[_0x7a3f('0x7')]({'attributes':['id'],'raw':!![]})[_0x7a3f('0x8')](function(_0x5c4ac9){_0x1ee7fd['setDataValue'](_0x7a3f('0x9'),_0x5c4ac9[_0x7a3f('0xa')](function(_0x384810){return{'id':_0x384810['id']};}));return OpenchannelMessage[_0x7a3f('0xb')]({'where':{'OpenchannelInteractionId':_0x1ee7fd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7a3f('0x8')](function(_0x68d774){_0x1ee7fd[_0x7a3f('0xc')](_0x7a3f('0xd'),_0x68d774[_0x7a3f('0xe')]);OpenchannelInteractionEvents[_0x7a3f('0xf')](_0x570878+':'+_0x1ee7fd['id'],_0x1ee7fd);OpenchannelInteractionEvents[_0x7a3f('0xf')](_0x570878,_0x1ee7fd);_0x442ecc(null);})['catch'](_0x442ecc(null));};}for(var e in events){if(events[_0x7a3f('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x7a3f('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index 660ee1b..3a283f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f58=['utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','define','OpenchannelInteraction'];(function(_0xb99f62,_0x2443fe){var _0x590d56=function(_0x299593){while(--_0x299593){_0xb99f62['push'](_0xb99f62['shift']());}};_0x590d56(++_0x2443fe);}(_0x5f58,0x15f));var _0x85f5=function(_0x58d3c5,_0x5865c6){_0x58d3c5=_0x58d3c5-0x0;var _0x4722f8=_0x5f58[_0x58d3c5];return _0x4722f8;};'use strict';var _=require(_0x85f5('0x0'));var util=require(_0x85f5('0x1'));var logger=require(_0x85f5('0x2'))('api');var moment=require(_0x85f5('0x3'));var BPromise=require(_0x85f5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x85f5('0x5'));var config=require(_0x85f5('0x6'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x566418,_0x5b1512){return _0x566418[_0x85f5('0x7')](_0x85f5('0x8'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x85f5('0x9'),'collate':_0x85f5('0xa'),'hooks':{'beforeUpdate':function(_0x58f330,_0x373d60,_0x5465f1){if(_0x58f330[_0x85f5('0xb')](_0x85f5('0xc'))){_0x58f330[_0x85f5('0xd')]=moment()['format'](_0x85f5('0xe'));}_0x5465f1(null,_0x58f330);}}});};
\ No newline at end of file
+var _0xd3ef=['request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird'];(function(_0x2afb35,_0x2ecbc5){var _0x2e17d6=function(_0xd78c03){while(--_0xd78c03){_0x2afb35['push'](_0x2afb35['shift']());}};_0x2e17d6(++_0x2ecbc5);}(_0xd3ef,0xdc));var _0xfd3e=function(_0x573f95,_0x39d1de){_0x573f95=_0x573f95-0x0;var _0xf4875f=_0xd3ef[_0x573f95];return _0xf4875f;};'use strict';var _=require(_0xfd3e('0x0'));var util=require('util');var logger=require(_0xfd3e('0x1'))('api');var moment=require(_0xfd3e('0x2'));var BPromise=require(_0xfd3e('0x3'));var rp=require(_0xfd3e('0x4'));var fs=require('fs');var path=require(_0xfd3e('0x5'));var rimraf=require(_0xfd3e('0x6'));var config=require(_0xfd3e('0x7'));var attributes=require(_0xfd3e('0x8'));module[_0xfd3e('0x9')]=function(_0xf4588c,_0x1c8c6b){return _0xf4588c['define'](_0xfd3e('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfd3e('0xb'),'hooks':{'beforeUpdate':function(_0x211c4f,_0x44c295,_0x426e82){if(_0x211c4f[_0xfd3e('0xc')]('closed')){_0x211c4f[_0xfd3e('0xd')]=moment()[_0xfd3e('0xe')](_0xfd3e('0xf'));}_0x426e82(null,_0x211c4f);}}});};
\ No newline at end of file
index d53a58e..00556b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe392=['where','addTags','ids','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','update','body','options','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find'];(function(_0x425e2,_0x5e59d4){var _0x5cf33b=function(_0xc21d6d){while(--_0xc21d6d){_0x425e2['push'](_0x425e2['shift']());}};_0x5cf33b(++_0x5e59d4);}(_0xe392,0x1c1));var _0x2e39=function(_0x4e195e,_0x220f15){_0x4e195e=_0x4e195e-0x0;var _0x12506e=_0xe392[_0x4e195e];return _0x12506e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2e39('0x0'));var BPromise=require(_0x2e39('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e39('0x2'));var db=require(_0x2e39('0x3'))['db'];var utils=require(_0x2e39('0x4'));var logger=require('../../config/logger')(_0x2e39('0x5'));var config=require(_0x2e39('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e39('0x7')]['http']({'port':0x232a});config[_0x2e39('0x8')]=_[_0x2e39('0x9')](config[_0x2e39('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2e39('0xa'))[_0x2e39('0xb')](socket);function respondWithRpcPromise(_0x4b7edc,_0x363eb5,_0x3316de){return new BPromise(function(_0x592aa8,_0x1d275f){return client[_0x2e39('0xc')](_0x4b7edc,_0x3316de)[_0x2e39('0xd')](function(_0xe52659){logger['info'](_0x2e39('0xe'),_0x363eb5,_0x2e39('0xf'));logger[_0x2e39('0x10')](_0x2e39('0x11'),_0x363eb5,_0x2e39('0xf'),JSON[_0x2e39('0x12')](_0xe52659));if(_0xe52659[_0x2e39('0x13')]){if(_0xe52659[_0x2e39('0x13')][_0x2e39('0x14')]===0x1f4){logger[_0x2e39('0x13')](_0x2e39('0xe'),_0x363eb5,_0xe52659[_0x2e39('0x13')][_0x2e39('0x15')]);return _0x1d275f(_0xe52659[_0x2e39('0x13')][_0x2e39('0x15')]);}logger[_0x2e39('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x363eb5,_0xe52659[_0x2e39('0x13')][_0x2e39('0x15')]);return _0x592aa8(_0xe52659['error'][_0x2e39('0x15')]);}else{logger[_0x2e39('0x16')](_0x2e39('0xe'),_0x363eb5,_0x2e39('0xf'));_0x592aa8(_0xe52659['result']['message']);}})[_0x2e39('0x17')](function(_0x4c442f){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x363eb5,_0x4c442f);_0x1d275f(_0x4c442f);});});}exports['UpdateOpenchannelInteraction']=function(_0x382761){var _0x23f45f=this;return new Promise(function(_0x3f694e,_0x36fa3b){return db['OpenchannelInteraction'][_0x2e39('0x18')](_0x382761[_0x2e39('0x19')],{'raw':_0x382761[_0x2e39('0x1a')]?_0x382761[_0x2e39('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x382761[_0x2e39('0x1a')]?_0x382761[_0x2e39('0x1a')]['where']||null:null,'attributes':_0x382761[_0x2e39('0x1a')]?_0x382761[_0x2e39('0x1a')]['attributes']||null:null,'limit':_0x382761[_0x2e39('0x1a')]?_0x382761[_0x2e39('0x1a')][_0x2e39('0x1b')]||null:null})[_0x2e39('0xd')](function(_0x759f72){logger['info']('UpdateOpenchannelInteraction',_0x382761);logger['debug'](_0x2e39('0x1c'),_0x382761,JSON['stringify'](_0x759f72));_0x3f694e(_0x759f72);})[_0x2e39('0x17')](function(_0x12edaf){logger[_0x2e39('0x13')](_0x2e39('0x1c'),_0x12edaf[_0x2e39('0x15')],_0x382761);_0x36fa3b(_0x23f45f[_0x2e39('0x13')](0x1f4,_0x12edaf[_0x2e39('0x15')]));});});};exports[_0x2e39('0x1d')]=function(_0x2e2a7a){return new Promise(function(_0x5f2faf,_0x48754f){return db[_0x2e39('0x1e')][_0x2e39('0x1f')]({'where':_0x2e2a7a[_0x2e39('0x1a')]?_0x2e2a7a[_0x2e39('0x1a')][_0x2e39('0x20')]||null:null})[_0x2e39('0xd')](function(_0x1cbdbb){if(_0x1cbdbb){return _0x1cbdbb[_0x2e39('0x21')](_0x2e2a7a[_0x2e39('0x19')][_0x2e39('0x22')],_['omit'](_0x2e2a7a['body'],['ids','id'])||{});}})[_0x2e39('0x23')](function(_0x42ae78){logger[_0x2e39('0x16')](_0x2e39('0x24'),_0x2e2a7a);logger[_0x2e39('0x10')](_0x2e39('0x24'),_0x2e2a7a,JSON[_0x2e39('0x12')](_0x42ae78));_0x5f2faf(_0x42ae78);})['catch'](function(_0x3c55f8){logger[_0x2e39('0x13')]('AddTags',_0x3c55f8[_0x2e39('0x15')],_0x2e2a7a);_0x48754f(_this[_0x2e39('0x13')](0x1f4,_0x3c55f8[_0x2e39('0x15')]));});});};
\ No newline at end of file
+var _0xd016=['socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x35c6df,_0x53ddc5){var _0x4ceda3=function(_0x33b932){while(--_0x33b932){_0x35c6df['push'](_0x35c6df['shift']());}};_0x4ceda3(++_0x53ddc5);}(_0xd016,0x96));var _0x6d01=function(_0x4cb648,_0x13fac1){_0x4cb648=_0x4cb648-0x0;var _0x3699a8=_0xd016[_0x4cb648];return _0x3699a8;};'use strict';var _=require(_0x6d01('0x0'));var util=require(_0x6d01('0x1'));var moment=require(_0x6d01('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d01('0x3'));var fs=require('fs');var Redis=require(_0x6d01('0x4'));var db=require(_0x6d01('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d01('0x6'))(_0x6d01('0x7'));var config=require(_0x6d01('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d01('0x9')][_0x6d01('0xa')]({'port':0x232a});config[_0x6d01('0xb')]=_[_0x6d01('0xc')](config[_0x6d01('0xb')],{'host':_0x6d01('0xd'),'port':0x18eb});var socket=require(_0x6d01('0xe'))(new Redis(config[_0x6d01('0xb')]));require(_0x6d01('0xf'))['register'](socket);function respondWithRpcPromise(_0xd8c28b,_0x226f89,_0x3fe94e){return new BPromise(function(_0x1e56be,_0x1b8f2a){return client[_0x6d01('0x10')](_0xd8c28b,_0x3fe94e)[_0x6d01('0x11')](function(_0x4b8dc8){logger[_0x6d01('0x12')](_0x6d01('0x13'),_0x226f89,_0x6d01('0x14'));logger[_0x6d01('0x15')](_0x6d01('0x16'),_0x226f89,_0x6d01('0x14'),JSON[_0x6d01('0x17')](_0x4b8dc8));if(_0x4b8dc8['error']){if(_0x4b8dc8[_0x6d01('0x18')]['code']===0x1f4){logger[_0x6d01('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x226f89,_0x4b8dc8[_0x6d01('0x18')][_0x6d01('0x19')]);return _0x1b8f2a(_0x4b8dc8[_0x6d01('0x18')][_0x6d01('0x19')]);}logger[_0x6d01('0x18')](_0x6d01('0x13'),_0x226f89,_0x4b8dc8[_0x6d01('0x18')][_0x6d01('0x19')]);return _0x1e56be(_0x4b8dc8[_0x6d01('0x18')]['message']);}else{logger[_0x6d01('0x12')](_0x6d01('0x13'),_0x226f89,'request\x20sent');_0x1e56be(_0x4b8dc8['result'][_0x6d01('0x19')]);}})[_0x6d01('0x1a')](function(_0x4ea57a){logger[_0x6d01('0x18')](_0x6d01('0x13'),_0x226f89,_0x4ea57a);_0x1b8f2a(_0x4ea57a);});});}exports[_0x6d01('0x1b')]=function(_0x180991){var _0x1bca2e=this;return new Promise(function(_0x3465a4,_0x4bbc11){return db[_0x6d01('0x1c')][_0x6d01('0x1d')](_0x180991[_0x6d01('0x1e')],{'raw':_0x180991[_0x6d01('0x1f')]?_0x180991[_0x6d01('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x180991[_0x6d01('0x1f')]?_0x180991[_0x6d01('0x1f')][_0x6d01('0x20')]||null:null,'attributes':_0x180991[_0x6d01('0x1f')]?_0x180991['options'][_0x6d01('0x21')]||null:null,'limit':_0x180991[_0x6d01('0x1f')]?_0x180991[_0x6d01('0x1f')][_0x6d01('0x22')]||null:null})[_0x6d01('0x11')](function(_0x52cda6){logger['info']('UpdateOpenchannelInteraction',_0x180991);logger[_0x6d01('0x15')](_0x6d01('0x1b'),_0x180991,JSON['stringify'](_0x52cda6));_0x3465a4(_0x52cda6);})[_0x6d01('0x1a')](function(_0x4c4701){logger[_0x6d01('0x18')](_0x6d01('0x1b'),_0x4c4701[_0x6d01('0x19')],_0x180991);_0x4bbc11(_0x1bca2e[_0x6d01('0x18')](0x1f4,_0x4c4701['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2cd65a){return new Promise(function(_0x232522,_0x2ca5e2){return db['OpenchannelInteraction'][_0x6d01('0x23')]({'where':_0x2cd65a[_0x6d01('0x1f')]?_0x2cd65a[_0x6d01('0x1f')]['where']||null:null})['then'](function(_0x2993d4){if(_0x2993d4){return _0x2993d4[_0x6d01('0x24')](_0x2cd65a['body'][_0x6d01('0x25')],_[_0x6d01('0x26')](_0x2cd65a['body'],[_0x6d01('0x25'),'id'])||{});}})[_0x6d01('0x27')](function(_0x35706c){logger['info'](_0x6d01('0x28'),_0x2cd65a);logger[_0x6d01('0x15')]('AddTags',_0x2cd65a,JSON[_0x6d01('0x17')](_0x35706c));_0x232522(_0x35706c);})[_0x6d01('0x1a')](function(_0x1574d4){logger[_0x6d01('0x18')]('AddTags',_0x1574d4[_0x6d01('0x19')],_0x2cd65a);_0x2ca5e2(_this[_0x6d01('0x18')](0x1f4,_0x1574d4[_0x6d01('0x19')]));});});};
\ No newline at end of file
index 919477d..6a08bf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c53=['removeListener','register','openchannelInteraction:','save','remove','update'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1c53,0x1b9));var _0x31c5=function(_0x4d81c5,_0x131026){_0x4d81c5=_0x4d81c5-0x0;var _0x245b9e=_0x1c53[_0x4d81c5];return _0x245b9e;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x31c5('0x0'),_0x31c5('0x1'),_0x31c5('0x2')];function createListener(_0x2db1c8,_0x3cc010){return function(_0x5c73fa){_0x3cc010['emit'](_0x2db1c8,_0x5c73fa);};}function removeListener(_0x4cdf82,_0x536bb0){return function(){OpenchannelInteractionEvents[_0x31c5('0x3')](_0x4cdf82,_0x536bb0);};}exports[_0x31c5('0x4')]=function(_0x223d95){for(var _0x56e798=0x0,_0x156d6b=events['length'];_0x56e798<_0x156d6b;_0x56e798++){var _0x2d1523=events[_0x56e798];var _0x359f0b=createListener(_0x31c5('0x5')+_0x2d1523,_0x223d95);OpenchannelInteractionEvents['on'](_0x2d1523,_0x359f0b);}};
\ No newline at end of file
+var _0xc543=['openchannelInteraction:','./openchannelInteraction.events','save','update','emit','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc543,0x71));var _0x3c54=function(_0x4c06ac,_0x568788){_0x4c06ac=_0x4c06ac-0x0;var _0x2333cb=_0xc543[_0x4c06ac];return _0x2333cb;};'use strict';var OpenchannelInteractionEvents=require(_0x3c54('0x0'));var events=[_0x3c54('0x1'),'remove',_0x3c54('0x2')];function createListener(_0x4942a6,_0xbfbe0c){return function(_0x313a68){_0xbfbe0c[_0x3c54('0x3')](_0x4942a6,_0x313a68);};}function removeListener(_0x5b5a22,_0x1d153a){return function(){OpenchannelInteractionEvents['removeListener'](_0x5b5a22,_0x1d153a);};}exports[_0x3c54('0x4')]=function(_0x5ce870){for(var _0x30d73a=0x0,_0x2e84f0=events[_0x3c54('0x5')];_0x30d73a<_0x2e84f0;_0x30d73a++){var _0xfa788=events[_0x30d73a];var _0x254f77=createListener(_0x3c54('0x6')+_0xfa788,_0x5ce870);OpenchannelInteractionEvents['on'](_0xfa788,_0x254f77);}};
\ No newline at end of file
index 5704405..f4a1b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x4d8b8e,_0x12fb10){var _0x3103ba=function(_0x361cae){while(--_0x361cae){_0x4d8b8e['push'](_0x4d8b8e['shift']());}};_0x3103ba(++_0x12fb10);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xcb91[_0x1b1e76];return _0x3d743a;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router;
\ No newline at end of file
+var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x852450,_0xd2456e){var _0x329404=function(_0x4d482b){while(--_0x4d482b){_0x852450['push'](_0x852450['shift']());}};_0x329404(++_0xd2456e);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
index 903902f..99465cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5454=['out','DATE','STRING','medium'];(function(_0x27923d,_0xa2c725){var _0x1911d3=function(_0x3de7c1){while(--_0x3de7c1){_0x27923d['push'](_0x27923d['shift']());}};_0x1911d3(++_0xa2c725);}(_0x5454,0x15b));var _0x4545=function(_0x31664f,_0x103ea2){_0x31664f=_0x31664f-0x0;var _0x429e16=_0x5454[_0x31664f];return _0x429e16;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x4545('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4545('0x1')),'defaultValue':_0x4545('0x1'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4545('0x2')]},'providerName':{'type':Sequelize[_0x4545('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xe605=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x43bb5c,_0x5aefe5){var _0x106a0c=function(_0x5071bd){while(--_0x5071bd){_0x43bb5c['push'](_0x43bb5c['shift']());}};_0x106a0c(++_0x5aefe5);}(_0xe605,0x92));var _0x5e60=function(_0x58ea9c,_0x354b12){_0x58ea9c=_0x58ea9c-0x0;var _0x5ce4fd=_0xe605[_0x58ea9c];return _0x5ce4fd;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5e60('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5e60('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5e60('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5e60('0x4')]('in',_0x5e60('0x5')),'defaultValue':_0x5e60('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5e60('0x6')]},'providerName':{'type':Sequelize[_0x5e60('0x7')]},'providerResponse':{'type':Sequelize[_0x5e60('0x8')]}};
\ No newline at end of file
index 60cd455..888396e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e29=['query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','OpenchannelMessage','findAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','params','get','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','interface','reject','rejectmessage','eml-format','rimraf','fast-json-patch','moment','util','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','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','stack','name','index','map','type','key','keys'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x8e29,0x143));var _0x98e2=function(_0x47d040,_0x1cc676){_0x47d040=_0x47d040-0x0;var _0x36761d=_0x8e29[_0x47d040];return _0x36761d;};'use strict';var emlformat=require(_0x98e2('0x0'));var rimraf=require(_0x98e2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98e2('0x2'));var rp=require('request-promise');var moment=require(_0x98e2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x98e2('0x4'));var path=require(_0x98e2('0x5'));var sox=require('sox');var csv=require(_0x98e2('0x6'));var ejs=require(_0x98e2('0x7'));var fs=require('fs');var fs_extra=require(_0x98e2('0x8'));var _=require(_0x98e2('0x9'));var squel=require(_0x98e2('0xa'));var crypto=require('crypto');var jsforce=require(_0x98e2('0xb'));var deskjs=require(_0x98e2('0xc'));var toCsv=require(_0x98e2('0x6'));var querystring=require(_0x98e2('0xd'));var Papa=require(_0x98e2('0xe'));var Redis=require('ioredis');var authService=require(_0x98e2('0xf'));var qs=require(_0x98e2('0x10'));var as=require(_0x98e2('0x11'));var hardwareService=require(_0x98e2('0x12'));var logger=require(_0x98e2('0x13'))(_0x98e2('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x98e2('0x15'))['db'];config[_0x98e2('0x16')]=_['defaults'](config[_0x98e2('0x16')],{'host':_0x98e2('0x17'),'port':0x18eb});var socket=require(_0x98e2('0x18'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0x98e2('0x19')](socket);var jayson=require(_0x98e2('0x1a'));var client=jayson[_0x98e2('0x1b')][_0x98e2('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f4c98,_0x224807,_0x185489,_0x2711d8){return new BPromise(function(_0x21199f,_0x261873){var _0x1c922e=_0x2711d8||client;return _0x1c922e[_0x98e2('0x1d')](_0x5f4c98,_0x185489)[_0x98e2('0x1e')](function(_0x1fad22){logger[_0x98e2('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x224807,_0x98e2('0x20'));logger[_0x98e2('0x21')](_0x98e2('0x22'),_0x224807,_0x98e2('0x20'),JSON['stringify'](_0x1fad22));if(_0x1fad22[_0x98e2('0x23')]){if(_0x1fad22['error'][_0x98e2('0x24')]===0x1f4){logger[_0x98e2('0x23')](_0x98e2('0x25'),_0x224807,_0x1fad22[_0x98e2('0x23')][_0x98e2('0x26')]);return _0x261873(_0x1fad22[_0x98e2('0x23')][_0x98e2('0x26')]);}logger[_0x98e2('0x23')](_0x98e2('0x25'),_0x224807,_0x1fad22[_0x98e2('0x23')][_0x98e2('0x26')]);return _0x21199f(_0x1fad22[_0x98e2('0x23')][_0x98e2('0x26')]);}else{logger[_0x98e2('0x1f')](_0x98e2('0x25'),_0x224807,_0x98e2('0x20'));_0x21199f(_0x1fad22[_0x98e2('0x27')][_0x98e2('0x26')]);}})[_0x98e2('0x28')](function(_0x40bac5){logger[_0x98e2('0x23')](_0x98e2('0x25'),_0x224807,_0x40bac5);_0x261873(_0x40bac5);});});}function respondWithStatusCode(_0x3bf60b,_0x175be8){_0x175be8=_0x175be8||0xcc;return function(_0x2a1aee){if(_0x2a1aee){return _0x3bf60b[_0x98e2('0x29')](_0x175be8);}return _0x3bf60b['status'](_0x175be8)[_0x98e2('0x2a')]();};}function respondWithResult(_0x33ea38,_0x30e8a6){_0x30e8a6=_0x30e8a6||0xc8;return function(_0x5dcd1d){if(_0x5dcd1d){return _0x33ea38[_0x98e2('0x2b')](_0x30e8a6)[_0x98e2('0x2c')](_0x5dcd1d);}};}function respondWithFilteredResult(_0x1fe545,_0x1bf4bd){return function(_0xf4d45a){if(_0xf4d45a){var _0x5b34a4=typeof _0x1bf4bd[_0x98e2('0x2d')]===_0x98e2('0x2e')&&typeof _0x1bf4bd[_0x98e2('0x2f')]===_0x98e2('0x2e');var _0x3d343e=_0xf4d45a[_0x98e2('0x30')];var _0x27fc7f=_0x5b34a4?0x0:_0x1bf4bd[_0x98e2('0x2d')];var _0x4a8df9=_0x5b34a4?_0xf4d45a['count']:_0x1bf4bd[_0x98e2('0x2d')]+_0x1bf4bd[_0x98e2('0x2f')];var _0x25c07e;if(_0x4a8df9>=_0x3d343e){_0x4a8df9=_0x3d343e;_0x25c07e=0xc8;}else{_0x25c07e=0xce;}_0x1fe545[_0x98e2('0x2b')](_0x25c07e);return _0x1fe545[_0x98e2('0x31')]('Content-Range',_0x27fc7f+'-'+_0x4a8df9+'/'+_0x3d343e)['json'](_0xf4d45a);}return null;};}function patchUpdates(_0x244f92){return function(_0xa0a40c){try{jsonpatch[_0x98e2('0x32')](_0xa0a40c,_0x244f92,!![]);}catch(_0x3fb26d){return BPromise['reject'](_0x3fb26d);}return _0xa0a40c[_0x98e2('0x33')]();};}function saveUpdates(_0x5dfd29,_0x4c3c06){return function(_0x4791e6){if(_0x4791e6){return _0x4791e6[_0x98e2('0x34')](_0x5dfd29)[_0x98e2('0x1e')](function(_0xc702c2){return _0xc702c2;});}return null;};}function removeEntity(_0x3c8b70,_0x531df3){return function(_0x589926){if(_0x589926){return _0x589926[_0x98e2('0x35')]()[_0x98e2('0x1e')](function(){_0x3c8b70[_0x98e2('0x2b')](0xcc)[_0x98e2('0x2a')]();});}};}function handleEntityNotFound(_0xcd1d5d,_0x161266){return function(_0x4d4268){if(!_0x4d4268){_0xcd1d5d[_0x98e2('0x29')](0x194);}return _0x4d4268;};}function handleError(_0x23a269,_0x543438){_0x543438=_0x543438||0x1f4;return function(_0x192c23){logger[_0x98e2('0x23')](_0x192c23[_0x98e2('0x36')]);if(_0x192c23[_0x98e2('0x37')]){delete _0x192c23[_0x98e2('0x37')];}_0x23a269['status'](_0x543438)['send'](_0x192c23);};}exports[_0x98e2('0x38')]=function(_0x5bd699,_0x983c7d){var _0xa64c47={},_0x61a139={},_0x3c3e13={'count':0x0,'rows':[]};var _0x4715ec=_[_0x98e2('0x39')](db['OpenchannelMessage']['rawAttributes'],function(_0x1d442e){return{'name':_0x1d442e['fieldName'],'type':_0x1d442e[_0x98e2('0x3a')][_0x98e2('0x3b')]};});_0x61a139['model']=_['map'](_0x4715ec,_0x98e2('0x37'));_0x61a139['query']=_[_0x98e2('0x3c')](_0x5bd699[_0x98e2('0x3d')]);_0x61a139[_0x98e2('0x3e')]=_[_0x98e2('0x3f')](_0x61a139[_0x98e2('0x40')],_0x61a139[_0x98e2('0x3d')]);_0xa64c47[_0x98e2('0x41')]=_[_0x98e2('0x3f')](_0x61a139[_0x98e2('0x40')],qs[_0x98e2('0x42')](_0x5bd699[_0x98e2('0x3d')][_0x98e2('0x42')]));_0xa64c47[_0x98e2('0x41')]=_0xa64c47['attributes'][_0x98e2('0x43')]?_0xa64c47[_0x98e2('0x41')]:_0x61a139[_0x98e2('0x40')];if(!_0x5bd699[_0x98e2('0x3d')]['hasOwnProperty'](_0x98e2('0x44'))){_0xa64c47[_0x98e2('0x2f')]=qs['limit'](_0x5bd699['query'][_0x98e2('0x2f')]);_0xa64c47[_0x98e2('0x2d')]=qs[_0x98e2('0x2d')](_0x5bd699[_0x98e2('0x3d')][_0x98e2('0x2d')]);}_0xa64c47[_0x98e2('0x45')]=qs[_0x98e2('0x46')](_0x5bd699[_0x98e2('0x3d')][_0x98e2('0x46')]);_0xa64c47[_0x98e2('0x47')]=qs[_0x98e2('0x3e')](_[_0x98e2('0x48')](_0x5bd699['query'],_0x61a139[_0x98e2('0x3e')]),_0x4715ec);if(_0x5bd699['query'][_0x98e2('0x49')]){_0xa64c47[_0x98e2('0x47')]=_[_0x98e2('0x4a')](_0xa64c47['where'],{'$or':_[_0x98e2('0x39')](_0x4715ec,function(_0x40c007){if(_0x40c007[_0x98e2('0x3a')]!==_0x98e2('0x4b')){var _0x51cf15={};_0x51cf15[_0x40c007[_0x98e2('0x37')]]={'$like':'%'+_0x5bd699['query'][_0x98e2('0x49')]+'%'};return _0x51cf15;}})});}_0xa64c47=_['merge']({},_0xa64c47,_0x5bd699[_0x98e2('0x4c')]);var _0xdc70c3={'where':_0xa64c47[_0x98e2('0x47')]};return db['OpenchannelMessage'][_0x98e2('0x30')](_0xdc70c3)[_0x98e2('0x1e')](function(_0x375de2){_0x3c3e13[_0x98e2('0x30')]=_0x375de2;if(_0x5bd699['query']['includeAll']){_0xa64c47[_0x98e2('0x4d')]=[{'all':!![]}];}return db[_0x98e2('0x4e')][_0x98e2('0x4f')](_0xa64c47);})['then'](function(_0xf368cd){_0x3c3e13['rows']=_0xf368cd;return _0x3c3e13;})[_0x98e2('0x1e')](respondWithFilteredResult(_0x983c7d,_0xa64c47))[_0x98e2('0x28')](handleError(_0x983c7d,null));};exports['show']=function(_0x2ff594,_0x460d6c){var _0xe0529c={'raw':!![],'where':{'id':_0x2ff594['params']['id']}},_0x498323={};_0x498323[_0x98e2('0x40')]=_['keys'](db[_0x98e2('0x4e')]['rawAttributes']);_0x498323[_0x98e2('0x3d')]=_['keys'](_0x2ff594['query']);_0x498323[_0x98e2('0x3e')]=_[_0x98e2('0x3f')](_0x498323[_0x98e2('0x40')],_0x498323['query']);_0xe0529c[_0x98e2('0x41')]=_[_0x98e2('0x3f')](_0x498323[_0x98e2('0x40')],qs[_0x98e2('0x42')](_0x2ff594[_0x98e2('0x3d')][_0x98e2('0x42')]));_0xe0529c[_0x98e2('0x41')]=_0xe0529c['attributes'][_0x98e2('0x43')]?_0xe0529c[_0x98e2('0x41')]:_0x498323[_0x98e2('0x40')];if(_0x2ff594[_0x98e2('0x3d')]['includeAll']){_0xe0529c[_0x98e2('0x4d')]=[{'all':!![]}];}_0xe0529c=_[_0x98e2('0x4a')]({},_0xe0529c,_0x2ff594[_0x98e2('0x4c')]);return db[_0x98e2('0x4e')][_0x98e2('0x50')](_0xe0529c)[_0x98e2('0x1e')](handleEntityNotFound(_0x460d6c,null))['then'](respondWithResult(_0x460d6c,null))[_0x98e2('0x28')](handleError(_0x460d6c,null));};exports[_0x98e2('0x51')]=function(_0x26e616,_0x1c4dcf){return db[_0x98e2('0x4e')][_0x98e2('0x51')](_0x26e616[_0x98e2('0x52')],{})[_0x98e2('0x1e')](respondWithResult(_0x1c4dcf,0xc9))[_0x98e2('0x28')](handleError(_0x1c4dcf,null));};exports[_0x98e2('0x34')]=function(_0x4ff09a,_0x2053b6){if(_0x4ff09a[_0x98e2('0x52')]['id']){delete _0x4ff09a[_0x98e2('0x52')]['id'];}return db[_0x98e2('0x4e')][_0x98e2('0x50')]({'where':{'id':_0x4ff09a['params']['id']}})['then'](handleEntityNotFound(_0x2053b6,null))['then'](saveUpdates(_0x4ff09a[_0x98e2('0x52')],null))[_0x98e2('0x1e')](respondWithResult(_0x2053b6,null))['catch'](handleError(_0x2053b6,null));};exports[_0x98e2('0x35')]=function(_0x4f2d6c,_0x4ae4db){return db[_0x98e2('0x4e')][_0x98e2('0x50')]({'where':{'id':_0x4f2d6c['params']['id']}})[_0x98e2('0x1e')](handleEntityNotFound(_0x4ae4db,null))[_0x98e2('0x1e')](removeEntity(_0x4ae4db,null))[_0x98e2('0x28')](handleError(_0x4ae4db,null));};exports[_0x98e2('0x53')]=function(_0x1c5eaa,_0x31cf25){return db[_0x98e2('0x4e')][_0x98e2('0x53')]()[_0x98e2('0x1e')](respondWithResult(_0x31cf25,null))[_0x98e2('0x28')](handleError(_0x31cf25,null));};var interaction_log=require(_0x98e2('0x13'))(_0x98e2('0x54'));exports[_0x98e2('0x55')]=function(_0x9f06a0,_0x3c25cb,_0x17ef68){var _0xea0975={'agent':{},'channel':_0x98e2('0x56')};if(_0x9f06a0[_0x98e2('0x52')]['id']){delete _0x9f06a0[_0x98e2('0x52')]['id'];}_0x9f06a0[_0x98e2('0x52')][_0x98e2('0x57')]=!![];_0x9f06a0[_0x98e2('0x52')][_0x98e2('0x58')]=moment()[_0x98e2('0x59')](_0x98e2('0x5a'));_0x9f06a0['body']['UserId']=_0x9f06a0[_0x98e2('0x52')]['UserId']||_0x9f06a0[_0x98e2('0x5b')]['id'];_0xea0975[_0x98e2('0x5c')]['id']=_0x9f06a0[_0x98e2('0x52')][_0x98e2('0x5d')];return db['OpenchannelMessage'][_0x98e2('0x50')]({'where':{'id':_0x9f06a0[_0x98e2('0x5e')]['id'],'UserId':null}})[_0x98e2('0x1e')](handleEntityNotFound(_0x3c25cb,null))[_0x98e2('0x1e')](saveUpdates(_0x9f06a0[_0x98e2('0x52')],null))[_0x98e2('0x1e')](function(_0x2056e6){if(_0x2056e6){_0xea0975['message']=_0x2056e6[_0x98e2('0x5f')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x2056e6[_0x98e2('0x60')]}});}return null;})[_0x98e2('0x1e')](handleEntityNotFound(_0x3c25cb,null))['then'](function(_0x1b5e73){if(_0x1b5e73){return _0x1b5e73[_0x98e2('0x34')]({'UserId':_0x9f06a0[_0x98e2('0x52')][_0x98e2('0x5d')],'read1stAt':_[_0x98e2('0x61')](_0x1b5e73[_0x98e2('0x62')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x98e2('0x1e')](function(_0x3c3d49){if(_0x3c3d49){_0xea0975['interaction']=_0x3c3d49[_0x98e2('0x5f')]({'plain':!![]});interaction_log[_0x98e2('0x1f')](_0x98e2('0x63'),_0x9f06a0['user']['id'],_0x9f06a0[_0x98e2('0x5b')]['name'],_0x9f06a0[_0x98e2('0x5b')][_0x98e2('0x64')],_0xea0975[_0x98e2('0x65')]['id'],_0x9f06a0['body']?JSON[_0x98e2('0x66')](_0x9f06a0[_0x98e2('0x52')]):_0x98e2('0x67'));return respondWithRpcPromise(_0x98e2('0x68'),'acceptMessage',_0xea0975);}return null;})[_0x98e2('0x1e')](function(_0x25c902){var _0x5c1c03=_0x98e2('0x69')+_0x25c902[_0x98e2('0x26')]['ContactId'];return db[_0x98e2('0x6a')][_0x98e2('0x3d')](_0x5c1c03,{'type':db[_0x98e2('0x6b')][_0x98e2('0x6c')][_0x98e2('0x6d')],'raw':!![]})['then'](function(_0xfc3c7e){return _0xfc3c7e;});})[_0x98e2('0x1e')](function(_0x4bbb1a){if(_0x4bbb1a){_0xea0975['message'][_0x98e2('0x6e')]=_0x4bbb1a[0x0];if(!_0x9f06a0[_0x98e2('0x52')][_0x98e2('0x5d')])return;return db[_0x98e2('0x6f')][_0x98e2('0x50')]({'where':{'id':_0x9f06a0[_0x98e2('0x52')]['UserId'],'role':_0x98e2('0x5c')},'attributes':['id',_0x98e2('0x37'),_0x98e2('0x70'),_0x98e2('0x71'),_0x98e2('0x72')],'raw':!![]});}return null;})[_0x98e2('0x1e')](function(_0x5ab4ce){if(!_0x5ab4ce)return null;_0xea0975[_0x98e2('0x26')][_0x98e2('0x5c')]=_0x5ab4ce;return _0xea0975;})['then'](function(_0x1d6b9e){if(_0x1d6b9e){if(_0x9f06a0[_0x98e2('0x52')]['manual']){_0xea0975['message']['interface']=util[_0x98e2('0x59')](_0x98e2('0x73'),_0x9f06a0[_0x98e2('0x5b')][_0x98e2('0x37')]);_0xea0975[_0x98e2('0x26')][_0x98e2('0x74')]=_0xea0975[_0x98e2('0x74')];_0xea0975[_0x98e2('0x26')][_0x98e2('0x75')]=_0xea0975[_0x98e2('0x74')];_0xea0975['message'][_0x98e2('0x76')]=_0x98e2('0x55');return respondWithRpcPromise(_0x98e2('0x77'),'EventManager',{'event':'acceptmessage','message':_0xea0975['message']},client9002)[_0x98e2('0x1e')](function(){return _0xea0975;});}return _0xea0975;}return null;})['then'](respondWithResult(_0x3c25cb,null))[_0x98e2('0x28')](handleError(_0x3c25cb,null));};var interaction_log=require('../../config/logger')(_0x98e2('0x54'));exports['reject']=function(_0x170922,_0x482c6d,_0x2a202d){var _0x3a5cc9={'agent':{},'channel':_0x98e2('0x56')};if(_0x170922['body']['id']){delete _0x170922['body']['id'];}_0x170922[_0x98e2('0x52')][_0x98e2('0x5d')]=_0x170922[_0x98e2('0x52')]['UserId']||_0x170922['user']['id'];_0x3a5cc9[_0x98e2('0x5c')]['id']=_0x170922[_0x98e2('0x52')][_0x98e2('0x5d')];return db[_0x98e2('0x4e')][_0x98e2('0x50')]({'where':{'id':_0x170922['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x482c6d,null))[_0x98e2('0x1e')](function(_0x1bca26){if(_0x1bca26){_0x3a5cc9['message']=_0x1bca26[_0x98e2('0x5f')]({'plain':!![]});return db[_0x98e2('0x78')]['find']({'where':{'id':_0x1bca26[_0x98e2('0x60')]}});}return null;})[_0x98e2('0x1e')](handleEntityNotFound(_0x482c6d,null))['then'](function(_0xfd562){if(_0xfd562){_0x3a5cc9['interaction']=_0xfd562['get']({'plain':!![]});interaction_log[_0x98e2('0x1f')](_0x98e2('0x79'),_0x170922[_0x98e2('0x5b')]['id'],_0x170922['user']['name'],_0x170922['user'][_0x98e2('0x64')],_0x3a5cc9[_0x98e2('0x65')]['id'],_0x170922[_0x98e2('0x52')]?JSON['stringify'](_0x170922['body']):_0x98e2('0x67'));return respondWithRpcPromise(_0x98e2('0x7a'),_0x98e2('0x7b'),_0x3a5cc9);}return null;})['then'](function(_0x14bd2f){var _0x2f23a0=_0x98e2('0x69')+_0x14bd2f[_0x98e2('0x26')][_0x98e2('0x7c')];return db[_0x98e2('0x6a')]['query'](_0x2f23a0,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x98e2('0x1e')](function(_0x899521){return _0x899521;});})[_0x98e2('0x1e')](function(_0x38f0d6){if(_0x38f0d6){_0x3a5cc9[_0x98e2('0x26')][_0x98e2('0x6e')]=_0x38f0d6[0x0];if(!_0x170922['body'][_0x98e2('0x5d')])return;return db[_0x98e2('0x6f')]['find']({'where':{'id':_0x170922[_0x98e2('0x52')][_0x98e2('0x5d')],'role':_0x98e2('0x5c')},'attributes':['id',_0x98e2('0x37'),_0x98e2('0x70'),_0x98e2('0x71'),_0x98e2('0x72')],'raw':!![]});}return null;})[_0x98e2('0x1e')](function(_0x2f065a){if(!_0x2f065a)return null;_0x3a5cc9[_0x98e2('0x26')]['agent']=_0x2f065a;return _0x3a5cc9;})[_0x98e2('0x1e')](function(_0x342a81){if(_0x342a81){_0x342a81[_0x98e2('0x26')][_0x98e2('0x7d')]=util[_0x98e2('0x59')](_0x98e2('0x73'),_0x170922[_0x98e2('0x5b')]['name']);_0x342a81[_0x98e2('0x26')][_0x98e2('0x74')]=_0x3a5cc9[_0x98e2('0x74')];_0x342a81[_0x98e2('0x26')][_0x98e2('0x75')]=_0x3a5cc9[_0x98e2('0x74')];_0x342a81[_0x98e2('0x26')][_0x98e2('0x76')]=_0x98e2('0x7e');respondWithRpcPromise(_0x98e2('0x77'),_0x98e2('0x77'),{'event':_0x98e2('0x7f'),'message':_0x342a81[_0x98e2('0x26')]},client9002);return _0x3a5cc9;}return null;})[_0x98e2('0x1e')](respondWithResult(_0x482c6d,null))[_0x98e2('0x28')](handleError(_0x482c6d,null));};
\ No newline at end of file
+var _0x043a=['name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','findAll','rows','show','params','OpenchannelMessage','include','find','catch','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','info','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','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','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','request','then','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x043a,0x1e4));var _0xa043=function(_0x36ba35,_0x50a084){_0x36ba35=_0x36ba35-0x0;var _0xf012c6=_0x043a[_0x36ba35];return _0xf012c6;};'use strict';var emlformat=require(_0xa043('0x0'));var rimraf=require(_0xa043('0x1'));var zipdir=require(_0xa043('0x2'));var jsonpatch=require(_0xa043('0x3'));var rp=require('request-promise');var moment=require(_0xa043('0x4'));var BPromise=require(_0xa043('0x5'));var Mustache=require(_0xa043('0x6'));var util=require(_0xa043('0x7'));var path=require('path');var sox=require(_0xa043('0x8'));var csv=require('to-csv');var ejs=require(_0xa043('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa043('0xa'));var squel=require(_0xa043('0xb'));var crypto=require(_0xa043('0xc'));var jsforce=require(_0xa043('0xd'));var deskjs=require(_0xa043('0xe'));var toCsv=require(_0xa043('0xf'));var querystring=require(_0xa043('0x10'));var Papa=require(_0xa043('0x11'));var Redis=require('ioredis');var authService=require(_0xa043('0x12'));var qs=require(_0xa043('0x13'));var as=require(_0xa043('0x14'));var hardwareService=require(_0xa043('0x15'));var logger=require(_0xa043('0x16'))(_0xa043('0x17'));var utils=require(_0xa043('0x18'));var config=require(_0xa043('0x19'));var licenseUtil=require(_0xa043('0x1a'));var db=require(_0xa043('0x1b'))['db'];config['redis']=_['defaults'](config[_0xa043('0x1c')],{'host':_0xa043('0x1d'),'port':0x18eb});var socket=require(_0xa043('0x1e'))(new Redis(config['redis']));require(_0xa043('0x1f'))[_0xa043('0x20')](socket);var jayson=require(_0xa043('0x21'));var client=jayson[_0xa043('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xa043('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x575f7d,_0x55b20f,_0x176329,_0x122f2e){return new BPromise(function(_0x10df07,_0x50d379){var _0x24757d=_0x122f2e||client;return _0x24757d[_0xa043('0x23')](_0x575f7d,_0x176329)[_0xa043('0x24')](function(_0x5b75fb){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x55b20f,'request\x20sent');logger[_0xa043('0x25')](_0xa043('0x26'),_0x55b20f,_0xa043('0x27'),JSON[_0xa043('0x28')](_0x5b75fb));if(_0x5b75fb[_0xa043('0x29')]){if(_0x5b75fb['error']['code']===0x1f4){logger[_0xa043('0x29')](_0xa043('0x2a'),_0x55b20f,_0x5b75fb[_0xa043('0x29')]['message']);return _0x50d379(_0x5b75fb[_0xa043('0x29')][_0xa043('0x2b')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x55b20f,_0x5b75fb[_0xa043('0x29')][_0xa043('0x2b')]);return _0x10df07(_0x5b75fb['error'][_0xa043('0x2b')]);}else{logger['info'](_0xa043('0x2a'),_0x55b20f,_0xa043('0x27'));_0x10df07(_0x5b75fb[_0xa043('0x2c')][_0xa043('0x2b')]);}})['catch'](function(_0x10446a){logger[_0xa043('0x29')](_0xa043('0x2a'),_0x55b20f,_0x10446a);_0x50d379(_0x10446a);});});}function respondWithStatusCode(_0x465860,_0x2f6a08){_0x2f6a08=_0x2f6a08||0xcc;return function(_0x295951){if(_0x295951){return _0x465860[_0xa043('0x2d')](_0x2f6a08);}return _0x465860[_0xa043('0x2e')](_0x2f6a08)[_0xa043('0x2f')]();};}function respondWithResult(_0x4be824,_0x439962){_0x439962=_0x439962||0xc8;return function(_0x3144cb){if(_0x3144cb){return _0x4be824[_0xa043('0x2e')](_0x439962)[_0xa043('0x30')](_0x3144cb);}};}function respondWithFilteredResult(_0x1071c9,_0xcc2739){return function(_0x15944f){if(_0x15944f){var _0x5247a8=typeof _0xcc2739[_0xa043('0x31')]===_0xa043('0x32')&&typeof _0xcc2739[_0xa043('0x33')]===_0xa043('0x32');var _0x59a1aa=_0x15944f[_0xa043('0x34')];var _0x3dd094=_0x5247a8?0x0:_0xcc2739[_0xa043('0x31')];var _0xd04cb6=_0x5247a8?_0x15944f[_0xa043('0x34')]:_0xcc2739[_0xa043('0x31')]+_0xcc2739[_0xa043('0x33')];var _0x3e4b36;if(_0xd04cb6>=_0x59a1aa){_0xd04cb6=_0x59a1aa;_0x3e4b36=0xc8;}else{_0x3e4b36=0xce;}_0x1071c9[_0xa043('0x2e')](_0x3e4b36);return _0x1071c9[_0xa043('0x35')]('Content-Range',_0x3dd094+'-'+_0xd04cb6+'/'+_0x59a1aa)['json'](_0x15944f);}return null;};}function patchUpdates(_0x2f2535){return function(_0x3ef78e){try{jsonpatch[_0xa043('0x36')](_0x3ef78e,_0x2f2535,!![]);}catch(_0x37e289){return BPromise[_0xa043('0x37')](_0x37e289);}return _0x3ef78e[_0xa043('0x38')]();};}function saveUpdates(_0x2829cb,_0x5c923a){return function(_0x117c6b){if(_0x117c6b){return _0x117c6b[_0xa043('0x39')](_0x2829cb)[_0xa043('0x24')](function(_0x481a4a){return _0x481a4a;});}return null;};}function removeEntity(_0x445130,_0x39baf4){return function(_0x4270b6){if(_0x4270b6){return _0x4270b6[_0xa043('0x3a')]()['then'](function(){_0x445130[_0xa043('0x2e')](0xcc)[_0xa043('0x2f')]();});}};}function handleEntityNotFound(_0x429a6c,_0x3305d3){return function(_0x12131f){if(!_0x12131f){_0x429a6c['sendStatus'](0x194);}return _0x12131f;};}function handleError(_0x56bf50,_0x50deca){_0x50deca=_0x50deca||0x1f4;return function(_0x160f17){logger['error'](_0x160f17[_0xa043('0x3b')]);if(_0x160f17[_0xa043('0x3c')]){delete _0x160f17[_0xa043('0x3c')];}_0x56bf50['status'](_0x50deca)[_0xa043('0x3d')](_0x160f17);};}exports[_0xa043('0x3e')]=function(_0x5243b5,_0xdd5e2a){var _0x7160f={},_0x4d6aee={},_0x242c5c={'count':0x0,'rows':[]};var _0x249db6=_[_0xa043('0x3f')](db['OpenchannelMessage']['rawAttributes'],function(_0x7cfe24){return{'name':_0x7cfe24[_0xa043('0x40')],'type':_0x7cfe24[_0xa043('0x41')]['key']};});_0x4d6aee[_0xa043('0x42')]=_[_0xa043('0x3f')](_0x249db6,_0xa043('0x3c'));_0x4d6aee[_0xa043('0x43')]=_[_0xa043('0x44')](_0x5243b5['query']);_0x4d6aee[_0xa043('0x45')]=_[_0xa043('0x46')](_0x4d6aee[_0xa043('0x42')],_0x4d6aee[_0xa043('0x43')]);_0x7160f[_0xa043('0x47')]=_[_0xa043('0x46')](_0x4d6aee[_0xa043('0x42')],qs[_0xa043('0x48')](_0x5243b5['query'][_0xa043('0x48')]));_0x7160f[_0xa043('0x47')]=_0x7160f[_0xa043('0x47')][_0xa043('0x49')]?_0x7160f[_0xa043('0x47')]:_0x4d6aee[_0xa043('0x42')];if(!_0x5243b5[_0xa043('0x43')][_0xa043('0x4a')](_0xa043('0x4b'))){_0x7160f[_0xa043('0x33')]=qs['limit'](_0x5243b5[_0xa043('0x43')]['limit']);_0x7160f[_0xa043('0x31')]=qs[_0xa043('0x31')](_0x5243b5[_0xa043('0x43')][_0xa043('0x31')]);}_0x7160f['order']=qs[_0xa043('0x4c')](_0x5243b5[_0xa043('0x43')]['sort']);_0x7160f['where']=qs['filters'](_[_0xa043('0x4d')](_0x5243b5['query'],_0x4d6aee[_0xa043('0x45')]),_0x249db6);if(_0x5243b5[_0xa043('0x43')][_0xa043('0x4e')]){_0x7160f['where']=_[_0xa043('0x4f')](_0x7160f[_0xa043('0x50')],{'$or':_[_0xa043('0x3f')](_0x249db6,function(_0x568406){if(_0x568406[_0xa043('0x41')]!=='VIRTUAL'){var _0x2609c9={};_0x2609c9[_0x568406[_0xa043('0x3c')]]={'$like':'%'+_0x5243b5[_0xa043('0x43')][_0xa043('0x4e')]+'%'};return _0x2609c9;}})});}_0x7160f=_[_0xa043('0x4f')]({},_0x7160f,_0x5243b5[_0xa043('0x51')]);var _0x487c12={'where':_0x7160f[_0xa043('0x50')]};return db['OpenchannelMessage'][_0xa043('0x34')](_0x487c12)[_0xa043('0x24')](function(_0x110ec7){_0x242c5c[_0xa043('0x34')]=_0x110ec7;if(_0x5243b5['query'][_0xa043('0x52')]){_0x7160f['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xa043('0x53')](_0x7160f);})[_0xa043('0x24')](function(_0x523cff){_0x242c5c[_0xa043('0x54')]=_0x523cff;return _0x242c5c;})[_0xa043('0x24')](respondWithFilteredResult(_0xdd5e2a,_0x7160f))['catch'](handleError(_0xdd5e2a,null));};exports[_0xa043('0x55')]=function(_0x149d16,_0x466812){var _0x9f7309={'raw':!![],'where':{'id':_0x149d16[_0xa043('0x56')]['id']}},_0x4c88={};_0x4c88['model']=_['keys'](db[_0xa043('0x57')]['rawAttributes']);_0x4c88[_0xa043('0x43')]=_[_0xa043('0x44')](_0x149d16[_0xa043('0x43')]);_0x4c88[_0xa043('0x45')]=_[_0xa043('0x46')](_0x4c88['model'],_0x4c88[_0xa043('0x43')]);_0x9f7309['attributes']=_[_0xa043('0x46')](_0x4c88[_0xa043('0x42')],qs[_0xa043('0x48')](_0x149d16[_0xa043('0x43')]['fields']));_0x9f7309[_0xa043('0x47')]=_0x9f7309[_0xa043('0x47')][_0xa043('0x49')]?_0x9f7309['attributes']:_0x4c88[_0xa043('0x42')];if(_0x149d16['query']['includeAll']){_0x9f7309[_0xa043('0x58')]=[{'all':!![]}];}_0x9f7309=_[_0xa043('0x4f')]({},_0x9f7309,_0x149d16[_0xa043('0x51')]);return db[_0xa043('0x57')][_0xa043('0x59')](_0x9f7309)[_0xa043('0x24')](handleEntityNotFound(_0x466812,null))['then'](respondWithResult(_0x466812,null))[_0xa043('0x5a')](handleError(_0x466812,null));};exports[_0xa043('0x5b')]=function(_0xc64000,_0x5182b4){return db[_0xa043('0x57')]['create'](_0xc64000['body'],{})[_0xa043('0x24')](respondWithResult(_0x5182b4,0xc9))['catch'](handleError(_0x5182b4,null));};exports[_0xa043('0x39')]=function(_0x174b6e,_0x583f34){if(_0x174b6e[_0xa043('0x5c')]['id']){delete _0x174b6e['body']['id'];}return db[_0xa043('0x57')][_0xa043('0x59')]({'where':{'id':_0x174b6e[_0xa043('0x56')]['id']}})[_0xa043('0x24')](handleEntityNotFound(_0x583f34,null))['then'](saveUpdates(_0x174b6e[_0xa043('0x5c')],null))[_0xa043('0x24')](respondWithResult(_0x583f34,null))[_0xa043('0x5a')](handleError(_0x583f34,null));};exports[_0xa043('0x3a')]=function(_0x34988d,_0x507b75){return db['OpenchannelMessage'][_0xa043('0x59')]({'where':{'id':_0x34988d[_0xa043('0x56')]['id']}})['then'](handleEntityNotFound(_0x507b75,null))[_0xa043('0x24')](removeEntity(_0x507b75,null))[_0xa043('0x5a')](handleError(_0x507b75,null));};exports[_0xa043('0x5d')]=function(_0x54a46b,_0x5aadf1){return db[_0xa043('0x57')][_0xa043('0x5d')]()[_0xa043('0x24')](respondWithResult(_0x5aadf1,null))[_0xa043('0x5a')](handleError(_0x5aadf1,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xa043('0x5e')]=function(_0x25f5a6,_0x200656,_0xd52e72){var _0x297680={'agent':{},'channel':'openchannel'};if(_0x25f5a6[_0xa043('0x5c')]['id']){delete _0x25f5a6['body']['id'];}_0x25f5a6[_0xa043('0x5c')][_0xa043('0x5f')]=!![];_0x25f5a6[_0xa043('0x5c')][_0xa043('0x60')]=moment()[_0xa043('0x61')](_0xa043('0x62'));_0x25f5a6[_0xa043('0x5c')][_0xa043('0x63')]=_0x25f5a6[_0xa043('0x5c')]['UserId']||_0x25f5a6['user']['id'];_0x297680[_0xa043('0x64')]['id']=_0x25f5a6[_0xa043('0x5c')][_0xa043('0x63')];return db[_0xa043('0x57')][_0xa043('0x59')]({'where':{'id':_0x25f5a6[_0xa043('0x56')]['id'],'UserId':null}})[_0xa043('0x24')](handleEntityNotFound(_0x200656,null))[_0xa043('0x24')](saveUpdates(_0x25f5a6['body'],null))[_0xa043('0x24')](function(_0x27f29e){if(_0x27f29e){_0x297680['message']=_0x27f29e['get']({'plain':!![]});return db[_0xa043('0x65')][_0xa043('0x59')]({'where':{'id':_0x27f29e['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x200656,null))[_0xa043('0x24')](function(_0x46957d){if(_0x46957d){return _0x46957d[_0xa043('0x39')]({'UserId':_0x25f5a6[_0xa043('0x5c')][_0xa043('0x63')],'read1stAt':_[_0xa043('0x66')](_0x46957d[_0xa043('0x67')])?moment()[_0xa043('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa043('0x24')](function(_0x449057){if(_0x449057){_0x297680[_0xa043('0x68')]=_0x449057[_0xa043('0x69')]({'plain':!![]});interaction_log[_0xa043('0x6a')](_0xa043('0x6b'),_0x25f5a6[_0xa043('0x6c')]['id'],_0x25f5a6[_0xa043('0x6c')][_0xa043('0x3c')],_0x25f5a6[_0xa043('0x6c')][_0xa043('0x6d')],_0x297680['interaction']['id'],_0x25f5a6[_0xa043('0x5c')]?JSON['stringify'](_0x25f5a6[_0xa043('0x5c')]):_0xa043('0x6e'));return respondWithRpcPromise(_0xa043('0x6f'),'acceptMessage',_0x297680);}return null;})[_0xa043('0x24')](function(_0x95c87f){var _0x516643=_0xa043('0x70')+_0x95c87f[_0xa043('0x2b')]['ContactId'];return db[_0xa043('0x71')]['query'](_0x516643,{'type':db[_0xa043('0x72')][_0xa043('0x73')]['SELECT'],'raw':!![]})[_0xa043('0x24')](function(_0x5021f2){return _0x5021f2;});})[_0xa043('0x24')](function(_0x4e59f7){if(_0x4e59f7){_0x297680[_0xa043('0x2b')][_0xa043('0x74')]=_0x4e59f7[0x0];if(!_0x25f5a6[_0xa043('0x5c')][_0xa043('0x63')])return;return db[_0xa043('0x75')][_0xa043('0x59')]({'where':{'id':_0x25f5a6['body']['UserId'],'role':_0xa043('0x64')},'attributes':['id',_0xa043('0x3c'),_0xa043('0x76'),_0xa043('0x77'),_0xa043('0x78')],'raw':!![]});}return null;})[_0xa043('0x24')](function(_0x1439b3){if(!_0x1439b3)return null;_0x297680['message'][_0xa043('0x64')]=_0x1439b3;return _0x297680;})[_0xa043('0x24')](function(_0x4e6bbe){if(_0x4e6bbe){if(_0x25f5a6[_0xa043('0x5c')][_0xa043('0x79')]){_0x297680[_0xa043('0x2b')]['interface']=util['format'](_0xa043('0x7a'),_0x25f5a6[_0xa043('0x6c')][_0xa043('0x3c')]);_0x297680[_0xa043('0x2b')]['channel']=_0x297680[_0xa043('0x7b')];_0x297680[_0xa043('0x2b')][_0xa043('0x7c')]=_0x297680[_0xa043('0x7b')];_0x297680[_0xa043('0x2b')][_0xa043('0x7d')]=_0xa043('0x5e');return respondWithRpcPromise(_0xa043('0x7e'),_0xa043('0x7e'),{'event':_0xa043('0x7f'),'message':_0x297680[_0xa043('0x2b')]},client9002)[_0xa043('0x24')](function(){return _0x297680;});}return _0x297680;}return null;})[_0xa043('0x24')](respondWithResult(_0x200656,null))[_0xa043('0x5a')](handleError(_0x200656,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xa043('0x37')]=function(_0x5f07c0,_0x824942,_0x25e3be){var _0x6624bf={'agent':{},'channel':_0xa043('0x80')};if(_0x5f07c0['body']['id']){delete _0x5f07c0['body']['id'];}_0x5f07c0['body']['UserId']=_0x5f07c0[_0xa043('0x5c')][_0xa043('0x63')]||_0x5f07c0['user']['id'];_0x6624bf[_0xa043('0x64')]['id']=_0x5f07c0[_0xa043('0x5c')][_0xa043('0x63')];return db[_0xa043('0x57')][_0xa043('0x59')]({'where':{'id':_0x5f07c0['params']['id'],'UserId':null}})[_0xa043('0x24')](handleEntityNotFound(_0x824942,null))[_0xa043('0x24')](function(_0xc19633){if(_0xc19633){_0x6624bf[_0xa043('0x2b')]=_0xc19633[_0xa043('0x69')]({'plain':!![]});return db[_0xa043('0x65')]['find']({'where':{'id':_0xc19633[_0xa043('0x81')]}});}return null;})[_0xa043('0x24')](handleEntityNotFound(_0x824942,null))[_0xa043('0x24')](function(_0x4e30e0){if(_0x4e30e0){_0x6624bf[_0xa043('0x68')]=_0x4e30e0[_0xa043('0x69')]({'plain':!![]});interaction_log[_0xa043('0x6a')](_0xa043('0x82'),_0x5f07c0[_0xa043('0x6c')]['id'],_0x5f07c0[_0xa043('0x6c')][_0xa043('0x3c')],_0x5f07c0[_0xa043('0x6c')][_0xa043('0x6d')],_0x6624bf['interaction']['id'],_0x5f07c0['body']?JSON[_0xa043('0x28')](_0x5f07c0[_0xa043('0x5c')]):'null');return respondWithRpcPromise(_0xa043('0x83'),_0xa043('0x84'),_0x6624bf);}return null;})[_0xa043('0x24')](function(_0x38fb4c){var _0x19b720='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x38fb4c[_0xa043('0x2b')][_0xa043('0x85')];return db[_0xa043('0x71')][_0xa043('0x43')](_0x19b720,{'type':db[_0xa043('0x72')][_0xa043('0x73')][_0xa043('0x86')],'raw':!![]})[_0xa043('0x24')](function(_0xdc5b38){return _0xdc5b38;});})[_0xa043('0x24')](function(_0x20fd8c){if(_0x20fd8c){_0x6624bf[_0xa043('0x2b')][_0xa043('0x74')]=_0x20fd8c[0x0];if(!_0x5f07c0[_0xa043('0x5c')]['UserId'])return;return db[_0xa043('0x75')][_0xa043('0x59')]({'where':{'id':_0x5f07c0['body'][_0xa043('0x63')],'role':_0xa043('0x64')},'attributes':['id','name',_0xa043('0x76'),_0xa043('0x77'),_0xa043('0x78')],'raw':!![]});}return null;})[_0xa043('0x24')](function(_0x1f4207){if(!_0x1f4207)return null;_0x6624bf[_0xa043('0x2b')][_0xa043('0x64')]=_0x1f4207;return _0x6624bf;})[_0xa043('0x24')](function(_0x2bdab4){if(_0x2bdab4){_0x2bdab4[_0xa043('0x2b')]['interface']=util[_0xa043('0x61')](_0xa043('0x7a'),_0x5f07c0['user']['name']);_0x2bdab4[_0xa043('0x2b')]['channel']=_0x6624bf[_0xa043('0x7b')];_0x2bdab4['message'][_0xa043('0x7c')]=_0x6624bf[_0xa043('0x7b')];_0x2bdab4[_0xa043('0x2b')]['event']='reject';respondWithRpcPromise('EventManager',_0xa043('0x7e'),{'event':_0xa043('0x87'),'message':_0x2bdab4[_0xa043('0x2b')]},client9002);return _0x6624bf;}return null;})[_0xa043('0x24')](respondWithResult(_0x824942,null))[_0xa043('0x5a')](handleError(_0x824942,null));};
\ No newline at end of file
index 3b0502f..7f83a28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ce7=['update','remove','emit','hook','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x14795f,_0x530a6d){var _0x96f40e=function(_0x51c14f){while(--_0x51c14f){_0x14795f['push'](_0x14795f['shift']());}};_0x96f40e(++_0x530a6d);}(_0x6ce7,0x154));var _0x76ce=function(_0x2b2a2c,_0x3f5427){_0x2b2a2c=_0x2b2a2c-0x0;var _0xf5a621=_0x6ce7[_0x2b2a2c];return _0xf5a621;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x76ce('0x0'))['db'][_0x76ce('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x76ce('0x2')](0x0);var events={'afterCreate':_0x76ce('0x3'),'afterUpdate':_0x76ce('0x4'),'afterDestroy':_0x76ce('0x5')};function emitEvent(_0x14c5aa){return function(_0x5862ad,_0x47726d,_0x404e77){OpenchannelMessageEvents[_0x76ce('0x6')](_0x14c5aa+':'+_0x5862ad['id'],_0x5862ad);OpenchannelMessageEvents[_0x76ce('0x6')](_0x14c5aa,_0x5862ad);_0x404e77(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x76ce('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xf38d=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage'];(function(_0x78598,_0x51fcbe){var _0x556e8d=function(_0x4fd0c6){while(--_0x4fd0c6){_0x78598['push'](_0x78598['shift']());}};_0x556e8d(++_0x51fcbe);}(_0xf38d,0x1b7));var _0xdf38=function(_0x13f11f,_0x2ea721){_0x13f11f=_0x13f11f-0x0;var _0x3fdb10=_0xf38d[_0x13f11f];return _0x3fdb10;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xdf38('0x0'))['db'][_0xdf38('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xdf38('0x2')](0x0);var events={'afterCreate':_0xdf38('0x3'),'afterUpdate':_0xdf38('0x4'),'afterDestroy':'remove'};function emitEvent(_0x177b64){return function(_0x134f94,_0x31c406,_0x3fea15){OpenchannelMessageEvents['emit'](_0x177b64+':'+_0x134f94['id'],_0x134f94);OpenchannelMessageEvents[_0xdf38('0x5')](_0x177b64,_0x134f94);_0x3fea15(null);};}for(var e in events){if(events[_0xdf38('0x6')](e)){var event=events[e];OpenchannelMessage[_0xdf38('0x7')](e,emitEvent(event));}}module[_0xdf38('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
index da8e50c..57c0bd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['util','api','moment','path','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','out','find','OpenchannelAccountId','Interactions','CmContact','Contact','keys','then','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x373cfa,_0xaa057d){var _0x58a029=function(_0x2d7e5a){while(--_0x2d7e5a){_0x373cfa['push'](_0x373cfa['shift']());}};_0x58a029(++_0xaa057d);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6e6c[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc6e6('0x9'),'fields':[_0xc6e6('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x324f05,_0x481799,_0x172aa9){var _0x3b2f50=_0x1182c7[_0xc6e6('0xb')];var _0x3ddf6f=_0x324f05[_0xc6e6('0xc')]({'plain':!![]});if(_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='in'||_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='out'&&!_0x3ddf6f[_0xc6e6('0xf')]&&!_['isNil'](_0x3ddf6f[_0xc6e6('0x10')])){_0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x12')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]}})['then'](function(_0x149ac6){if(_0x149ac6){_0x149ac6[_0xc6e6('0x14')]({'lastMsgAt':_0x3ddf6f[_0xc6e6('0x15')],'lastMsgDirection':_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()});}})['catch'](function(_0x413cf8){console[_0xc6e6('0x16')](_0x413cf8);});}if(_0x3ddf6f['direction']===_0xc6e6('0x17')&&!_0x3ddf6f[_0xc6e6('0xf')]){var _0xedf127;_0x3b2f50['CmContact']['describe']()['then'](function(_0x3a1ccc){return _0x3b2f50['OpenchannelAccount'][_0xc6e6('0x18')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x19')]},'include':[{'model':_0x3b2f50[_0xc6e6('0x11')],'as':_0xc6e6('0x1a'),'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]},'limit':0x1,'include':[{'model':_0x3b2f50[_0xc6e6('0x1b')],'as':_0xc6e6('0x1c'),'attributes':_[_0xc6e6('0x1d')](_0x3a1ccc)}]}]});})[_0xc6e6('0x1e')](function(_0x3d734d){_0xedf127=_0x3d734d['get']({'plain':!![]});if(_0xedf127&&_0xedf127[_0xc6e6('0x1f')]){logger['info'](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x22')](_0xc6e6('0x23'),_0x3ddf6f['id'],_0xedf127['replyUri']));if(_0xedf127[_0xc6e6('0x1a')]&&_0xedf127[_0xc6e6('0x1a')][_0xc6e6('0x24')]){_0x3ddf6f[_0xc6e6('0x25')]=_[_0xc6e6('0x26')](_0xedf127['Interactions'][0x0],_0xc6e6('0x1c'));_0x3ddf6f['Contact']=_0xedf127[_0xc6e6('0x1a')][0x0][_0xc6e6('0x1c')];}var _0x481799={'method':_0xc6e6('0x27'),'uri':encodeURI(_0xedf127['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x481799[_0xc6e6('0x28')]){case'GET':_0x481799['qs']=_0x3ddf6f;break;case _0xc6e6('0x27'):_0x481799['body']=_0x3ddf6f;break;}return rp(_0x481799)[_0xc6e6('0x1e')](function(_0x16dcd9){logger[_0xc6e6('0x29')](_0xc6e6('0x20'),_0xc6e6('0x21'),util['format'](_0xc6e6('0x2a'),_0x3ddf6f['id'],_0xedf127[_0xc6e6('0x1f')]));if(_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]&&_0x16dcd9['body'][_0xc6e6('0x2b')]!=_0x3ddf6f['Interaction'][_0xc6e6('0x2b')]){return _0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x14')]({'threadId':_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]},{'logging':!![],'where':{'id':_0x3ddf6f[_0xc6e6('0x25')]['id']}});}else{return;}})[_0xc6e6('0x1e')](function(){return _0x324f05[_0xc6e6('0x14')]({'read':!![]});})[_0xc6e6('0x2c')](function(_0x1eb477){logger[_0xc6e6('0x16')](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x2d')](_0x1eb477,{'showHidden':![],'depth':null}));_0x172aa9();});}else{_0x172aa9();}})[_0xc6e6('0x2e')](function(){_0x172aa9();});}else{_0x172aa9();}}},'charset':_0xc6e6('0x2f'),'collate':_0xc6e6('0x30')});};
\ No newline at end of file
+var _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x2372d7,_0x4e5c9d){var _0x39a7be=function(_0x35b2f3){while(--_0x35b2f3){_0x2372d7['push'](_0x2372d7['shift']());}};_0x39a7be(++_0x4e5c9d);}(_0x2032,0xd9));var _0x2203=function(_0x54e482,_0x3c1fe2){_0x54e482=_0x54e482-0x0;var _0x4b0d0f=_0x2032[_0x54e482];return _0x4b0d0f;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});};
\ No newline at end of file
index ba6c511..3229b2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x222516,_0x49d99a){var _0x1f4c2c=function(_0x456502){while(--_0x456502){_0x222516['push'](_0x222516['shift']());}};_0x1f4c2c(++_0x49d99a);}(_0x2ef3,0xba));var _0x32ef=function(_0x3c5add,_0x1d5bbf){_0x3c5add=_0x3c5add-0x0;var _0x55341c=_0x2ef3[_0x3c5add];return _0x55341c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});};
\ No newline at end of file
+var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xe6daf,_0x4c6437){var _0x533bd3=function(_0x28bb3f){while(--_0x28bb3f){_0xe6daf['push'](_0xe6daf['shift']());}};_0x533bd3(++_0x4c6437);}(_0x2ef3,0xba));var _0x32ef=function(_0x2f667b,_0x543d95){_0x2f667b=_0x2f667b-0x0;var _0x2724e5=_0x2ef3[_0x2f667b];return _0x2724e5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});};
\ No newline at end of file
index 8ea2215..a60a777 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8efc=['removeListener','length','openchannelMessage:','remove','emit'];(function(_0x3e0e63,_0x56e46b){var _0x18589d=function(_0x5b0225){while(--_0x5b0225){_0x3e0e63['push'](_0x3e0e63['shift']());}};_0x18589d(++_0x56e46b);}(_0x8efc,0x8f));var _0xc8ef=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x8efc[_0x487b0c];return _0x1adbdc;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xc8ef('0x0'),'update'];function createListener(_0x35d82e,_0x48fc28){return function(_0x16d145){_0x48fc28[_0xc8ef('0x1')](_0x35d82e,_0x16d145);};}function removeListener(_0x4dbf24,_0x4ee0cc){return function(){OpenchannelMessageEvents[_0xc8ef('0x2')](_0x4dbf24,_0x4ee0cc);};}exports['register']=function(_0x1d65c1){for(var _0x1b4901=0x0,_0x1648ac=events[_0xc8ef('0x3')];_0x1b4901<_0x1648ac;_0x1b4901++){var _0x819e70=events[_0x1b4901];var _0x522d75=createListener(_0xc8ef('0x4')+_0x819e70,_0x1d65c1);OpenchannelMessageEvents['on'](_0x819e70,_0x522d75);}};
\ No newline at end of file
+var _0x5687=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x3ab0ec,_0x339990){var _0x226137=function(_0x7ab685){while(--_0x7ab685){_0x3ab0ec['push'](_0x3ab0ec['shift']());}};_0x226137(++_0x339990);}(_0x5687,0x1ce));var _0x7568=function(_0x4d03d8,_0x1000c1){_0x4d03d8=_0x4d03d8-0x0;var _0x1a6505=_0x5687[_0x4d03d8];return _0x1a6505;};'use strict';var OpenchannelMessageEvents=require(_0x7568('0x0'));var events=[_0x7568('0x1'),_0x7568('0x2'),_0x7568('0x3')];function createListener(_0x15ee08,_0x18182a){return function(_0xfb8891){_0x18182a[_0x7568('0x4')](_0x15ee08,_0xfb8891);};}function removeListener(_0x28894f,_0x58cfad){return function(){OpenchannelMessageEvents[_0x7568('0x5')](_0x28894f,_0x58cfad);};}exports[_0x7568('0x6')]=function(_0x327400){for(var _0x248492=0x0,_0x53ac94=events[_0x7568('0x7')];_0x248492<_0x53ac94;_0x248492++){var _0x1ad91f=events[_0x248492];var _0x500856=createListener(_0x7568('0x8')+_0x1ad91f,_0x327400);OpenchannelMessageEvents['on'](_0x1ad91f,_0x500856);}};
\ No newline at end of file
index 7a98d57..9eb8c6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30fd=['../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeTeams','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x30fd,0x14d));var _0xd30f=function(_0x3fe774,_0x2c484b){_0x3fe774=_0x3fe774-0x0;var _0x52b410=_0x30fd[_0x3fe774];return _0x52b410;};'use strict';var multer=require('multer');var util=require(_0xd30f('0x0'));var path=require(_0xd30f('0x1'));var timeout=require(_0xd30f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd30f('0x3'));var auth=require(_0xd30f('0x4'));var interaction=require(_0xd30f('0x5'));var config=require(_0xd30f('0x6'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0xd30f('0x7')](),controller[_0xd30f('0x8')]);router['get'](_0xd30f('0x9'),auth[_0xd30f('0x7')](),controller[_0xd30f('0xa')]);router[_0xd30f('0xb')](_0xd30f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd30f('0xb')](_0xd30f('0xd'),auth[_0xd30f('0x7')](),controller[_0xd30f('0xe')]);router[_0xd30f('0xb')](_0xd30f('0xf'),auth['isAuthenticated'](),controller[_0xd30f('0x10')]);router['get'](_0xd30f('0x11'),auth[_0xd30f('0x7')](),controller[_0xd30f('0x12')]);router[_0xd30f('0x13')]('/',auth[_0xd30f('0x7')](),controller[_0xd30f('0x14')]);router[_0xd30f('0x13')](_0xd30f('0xf'),auth[_0xd30f('0x7')](),controller[_0xd30f('0x15')]);router[_0xd30f('0x13')](_0xd30f('0x11'),auth[_0xd30f('0x7')](),controller[_0xd30f('0x16')]);router[_0xd30f('0x17')](_0xd30f('0xc'),auth[_0xd30f('0x7')](),controller['update']);router[_0xd30f('0x18')]('/:id',auth[_0xd30f('0x7')](),controller['destroy']);router[_0xd30f('0x18')]('/:id/teams',auth[_0xd30f('0x7')](),controller[_0xd30f('0x19')]);router[_0xd30f('0x18')](_0xd30f('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x473d=['index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x473d,0x76));var _0xd473=function(_0x5186e1,_0x40f98b){_0x5186e1=_0x5186e1-0x0;var _0x2636af=_0x473d[_0x5186e1];return _0x2636af;};'use strict';var multer=require(_0xd473('0x0'));var util=require(_0xd473('0x1'));var path=require(_0xd473('0x2'));var timeout=require('connect-timeout');var express=require(_0xd473('0x3'));var router=express['Router']();var fs_extra=require(_0xd473('0x4'));var auth=require(_0xd473('0x5'));var interaction=require(_0xd473('0x6'));var config=require(_0xd473('0x7'));var controller=require(_0xd473('0x8'));router['get']('/',auth[_0xd473('0x9')](),controller[_0xd473('0xa')]);router[_0xd473('0xb')](_0xd473('0xc'),auth[_0xd473('0x9')](),controller[_0xd473('0xd')]);router[_0xd473('0xb')](_0xd473('0xe'),auth[_0xd473('0x9')](),controller[_0xd473('0xf')]);router[_0xd473('0xb')](_0xd473('0x10'),auth[_0xd473('0x9')](),controller[_0xd473('0x11')]);router[_0xd473('0xb')](_0xd473('0x12'),auth[_0xd473('0x9')](),controller[_0xd473('0x13')]);router[_0xd473('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0xd473('0x14')]);router[_0xd473('0x15')]('/',auth['isAuthenticated'](),controller[_0xd473('0x16')]);router[_0xd473('0x15')]('/:id/teams',auth[_0xd473('0x9')](),controller[_0xd473('0x17')]);router[_0xd473('0x15')](_0xd473('0x18'),auth[_0xd473('0x9')](),controller[_0xd473('0x19')]);router[_0xd473('0x1a')]('/:id',auth[_0xd473('0x9')](),controller[_0xd473('0x1b')]);router[_0xd473('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xd473('0x1d')]);router[_0xd473('0x1c')]('/:id/teams',auth[_0xd473('0x9')](),controller[_0xd473('0x1e')]);router[_0xd473('0x1c')](_0xd473('0x18'),auth[_0xd473('0x9')](),controller['removeAgents']);module[_0xd473('0x1f')]=router;
\ No newline at end of file
index cff61fc..b1b62a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe55=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x469be8,_0xf2af2c){var _0x556bbb=function(_0x158f5b){while(--_0x158f5b){_0x469be8['push'](_0x469be8['shift']());}};_0x556bbb(++_0xf2af2c);}(_0xbe55,0xb4));var _0x5be5=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xbe55[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require(_0x5be5('0x0'));module[_0x5be5('0x1')]={'name':{'type':Sequelize[_0x5be5('0x2')],'unique':_0x5be5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5be5('0x2')]},'timeout':{'type':Sequelize[_0x5be5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5be5('0x5'),_0x5be5('0x6'),_0x5be5('0x7'))}};
\ No newline at end of file
+var _0x4af7=['ENUM','beepall','sequelize','STRING'];(function(_0x42593c,_0x25b52a){var _0x4d026d=function(_0x10826c){while(--_0x10826c){_0x42593c['push'](_0x42593c['shift']());}};_0x4d026d(++_0x25b52a);}(_0x4af7,0x1da));var _0x74af=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x4af7[_0x1597e2];return _0x4c8c0a;};'use strict';var Sequelize=require(_0x74af('0x0'));module['exports']={'name':{'type':Sequelize[_0x74af('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x74af('0x2')]('rrmemory',_0x74af('0x3'),'roundrobin')}};
\ No newline at end of file
index 96d2baf..05ed0bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f06=['defaults','localhost','redis','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','OpenchannelQueue','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','order','findAndCountAll','agent','createdAt','format','%s/%s','SIP','openchannelPause','updatedAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','ids','User','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x248968,_0x52908d){var _0x2a0df9=function(_0x98037e){while(--_0x98037e){_0x248968['push'](_0x248968['shift']());}};_0x2a0df9(++_0x52908d);}(_0x3f06,0x76));var _0x63f0=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3f06[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x63f0('0x0'));var rimraf=require(_0x63f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x63f0('0x2'));var rp=require(_0x63f0('0x3'));var moment=require('moment');var BPromise=require(_0x63f0('0x4'));var Mustache=require(_0x63f0('0x5'));var util=require('util');var path=require('path');var sox=require(_0x63f0('0x6'));var csv=require(_0x63f0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63f0('0x8'));var _=require(_0x63f0('0x9'));var squel=require(_0x63f0('0xa'));var crypto=require(_0x63f0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x63f0('0xc'));var toCsv=require(_0x63f0('0x7'));var querystring=require('querystring');var Papa=require(_0x63f0('0xd'));var Redis=require(_0x63f0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x63f0('0xf'));var as=require(_0x63f0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x63f0('0x11'));var utils=require(_0x63f0('0x12'));var config=require(_0x63f0('0x13'));var licenseUtil=require(_0x63f0('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x63f0('0x15')](config['redis'],{'host':_0x63f0('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63f0('0x17')]));require('./openchannelQueue.socket')[_0x63f0('0x18')](socket);function respondWithStatusCode(_0x385d52,_0x57e61f){_0x57e61f=_0x57e61f||0xcc;return function(_0x3d6834){if(_0x3d6834){return _0x385d52[_0x63f0('0x19')](_0x57e61f);}return _0x385d52['status'](_0x57e61f)[_0x63f0('0x1a')]();};}function respondWithResult(_0x2a9f17,_0x4accf8){_0x4accf8=_0x4accf8||0xc8;return function(_0x2b6dd1){if(_0x2b6dd1){return _0x2a9f17[_0x63f0('0x1b')](_0x4accf8)[_0x63f0('0x1c')](_0x2b6dd1);}};}function respondWithFilteredResult(_0x59af3e,_0x3ebd17){return function(_0x32d689){if(_0x32d689){var _0x5de1eb=typeof _0x3ebd17[_0x63f0('0x1d')]===_0x63f0('0x1e')&&typeof _0x3ebd17[_0x63f0('0x1f')]==='undefined';var _0x50e73a=_0x32d689['count'];var _0x1808ee=_0x5de1eb?0x0:_0x3ebd17['offset'];var _0x1a80c7=_0x5de1eb?_0x32d689[_0x63f0('0x20')]:_0x3ebd17[_0x63f0('0x1d')]+_0x3ebd17[_0x63f0('0x1f')];var _0x3d17be;if(_0x1a80c7>=_0x50e73a){_0x1a80c7=_0x50e73a;_0x3d17be=0xc8;}else{_0x3d17be=0xce;}_0x59af3e[_0x63f0('0x1b')](_0x3d17be);return _0x59af3e[_0x63f0('0x21')](_0x63f0('0x22'),_0x1808ee+'-'+_0x1a80c7+'/'+_0x50e73a)[_0x63f0('0x1c')](_0x32d689);}return null;};}function patchUpdates(_0x2d521f){return function(_0x72806){try{jsonpatch['apply'](_0x72806,_0x2d521f,!![]);}catch(_0x38e34b){return BPromise[_0x63f0('0x23')](_0x38e34b);}return _0x72806[_0x63f0('0x24')]();};}function saveUpdates(_0x1a5fe7,_0xa31667){return function(_0x4d87fa){if(_0x4d87fa){return _0x4d87fa[_0x63f0('0x25')](_0x1a5fe7)[_0x63f0('0x26')](function(_0x2bb341){return _0x2bb341;});}return null;};}function removeEntity(_0xbf2a90,_0x1eed43){return function(_0x4ba0d1){if(_0x4ba0d1){return _0x4ba0d1[_0x63f0('0x27')]()[_0x63f0('0x26')](function(){var _0x5cae54=_0x4ba0d1['get']({'plain':!![]});var _0x10cf25=_0x63f0('0x28');return db[_0x63f0('0x29')][_0x63f0('0x27')]({'where':{'type':_0x10cf25,'resourceId':_0x5cae54['id']}})[_0x63f0('0x26')](function(){return _0x4ba0d1;});})[_0x63f0('0x26')](function(){_0xbf2a90[_0x63f0('0x1b')](0xcc)[_0x63f0('0x1a')]();});}};}function handleEntityNotFound(_0x53ffcd,_0x518365){return function(_0x4c2713){if(!_0x4c2713){_0x53ffcd['sendStatus'](0x194);}return _0x4c2713;};}function handleError(_0x5bfae1,_0x1107c7){_0x1107c7=_0x1107c7||0x1f4;return function(_0x277d0c){logger[_0x63f0('0x2a')](_0x277d0c[_0x63f0('0x2b')]);if(_0x277d0c[_0x63f0('0x2c')]){delete _0x277d0c[_0x63f0('0x2c')];}_0x5bfae1[_0x63f0('0x1b')](_0x1107c7)[_0x63f0('0x2d')](_0x277d0c);};}exports['index']=function(_0x3e9f51,_0x44087a){var _0x36ab85={},_0x521962={},_0x331443={'count':0x0,'rows':[]};var _0x47f79b=_['map'](db[_0x63f0('0x2e')]['rawAttributes'],function(_0x254ed4){return{'name':_0x254ed4[_0x63f0('0x2f')],'type':_0x254ed4[_0x63f0('0x30')][_0x63f0('0x31')]};});_0x521962[_0x63f0('0x32')]=_[_0x63f0('0x33')](_0x47f79b,_0x63f0('0x2c'));_0x521962['query']=_[_0x63f0('0x34')](_0x3e9f51[_0x63f0('0x35')]);_0x521962[_0x63f0('0x36')]=_[_0x63f0('0x37')](_0x521962['model'],_0x521962[_0x63f0('0x35')]);_0x36ab85['attributes']=_[_0x63f0('0x37')](_0x521962[_0x63f0('0x32')],qs[_0x63f0('0x38')](_0x3e9f51[_0x63f0('0x35')][_0x63f0('0x38')]));_0x36ab85[_0x63f0('0x39')]=_0x36ab85['attributes'][_0x63f0('0x3a')]?_0x36ab85[_0x63f0('0x39')]:_0x521962[_0x63f0('0x32')];if(!_0x3e9f51['query'][_0x63f0('0x3b')]('nolimit')){_0x36ab85['limit']=qs[_0x63f0('0x1f')](_0x3e9f51[_0x63f0('0x35')][_0x63f0('0x1f')]);_0x36ab85[_0x63f0('0x1d')]=qs[_0x63f0('0x1d')](_0x3e9f51['query'][_0x63f0('0x1d')]);}_0x36ab85['order']=qs[_0x63f0('0x3c')](_0x3e9f51[_0x63f0('0x35')][_0x63f0('0x3c')]);_0x36ab85['where']=qs['filters'](_[_0x63f0('0x3d')](_0x3e9f51[_0x63f0('0x35')],_0x521962[_0x63f0('0x36')]),_0x47f79b);if(_0x3e9f51[_0x63f0('0x35')][_0x63f0('0x3e')]){_0x36ab85[_0x63f0('0x3f')]=_['merge'](_0x36ab85[_0x63f0('0x3f')],{'$or':_['map'](_0x47f79b,function(_0x5a4734){if(_0x5a4734['type']!==_0x63f0('0x40')){var _0x29e6c0={};_0x29e6c0[_0x5a4734[_0x63f0('0x2c')]]={'$like':'%'+_0x3e9f51['query']['filter']+'%'};return _0x29e6c0;}})});}_0x36ab85=_[_0x63f0('0x41')]({},_0x36ab85,_0x3e9f51[_0x63f0('0x42')]);var _0x6365cc={'where':_0x36ab85[_0x63f0('0x3f')]};return db[_0x63f0('0x2e')]['count'](_0x6365cc)[_0x63f0('0x26')](function(_0x4c0937){_0x331443[_0x63f0('0x20')]=_0x4c0937;if(_0x3e9f51[_0x63f0('0x35')][_0x63f0('0x43')]){_0x36ab85[_0x63f0('0x44')]=[{'all':!![]}];}return db[_0x63f0('0x2e')][_0x63f0('0x45')](_0x36ab85);})[_0x63f0('0x26')](function(_0x584743){_0x331443[_0x63f0('0x46')]=_0x584743;return _0x331443;})['then'](respondWithFilteredResult(_0x44087a,_0x36ab85))['catch'](handleError(_0x44087a,null));};exports[_0x63f0('0x47')]=function(_0x55b183,_0x1abc9e){var _0x3384a8={'raw':!![],'where':{'id':_0x55b183[_0x63f0('0x48')]['id']}},_0x2de1cc={};_0x2de1cc[_0x63f0('0x32')]=_[_0x63f0('0x34')](db[_0x63f0('0x2e')][_0x63f0('0x49')]);_0x2de1cc['query']=_[_0x63f0('0x34')](_0x55b183[_0x63f0('0x35')]);_0x2de1cc[_0x63f0('0x36')]=_[_0x63f0('0x37')](_0x2de1cc['model'],_0x2de1cc[_0x63f0('0x35')]);_0x3384a8[_0x63f0('0x39')]=_['intersection'](_0x2de1cc[_0x63f0('0x32')],qs['fields'](_0x55b183[_0x63f0('0x35')][_0x63f0('0x38')]));_0x3384a8['attributes']=_0x3384a8[_0x63f0('0x39')]['length']?_0x3384a8[_0x63f0('0x39')]:_0x2de1cc['model'];if(_0x55b183[_0x63f0('0x35')]['includeAll']){_0x3384a8[_0x63f0('0x44')]=[{'all':!![]}];}_0x3384a8=_[_0x63f0('0x41')]({},_0x3384a8,_0x55b183['options']);return db['OpenchannelQueue'][_0x63f0('0x4a')](_0x3384a8)['then'](handleEntityNotFound(_0x1abc9e,null))['then'](respondWithResult(_0x1abc9e,null))[_0x63f0('0x4b')](handleError(_0x1abc9e,null));};exports[_0x63f0('0x4c')]=function(_0x2efaea,_0x2248ad){return db[_0x63f0('0x2e')]['create'](_0x2efaea[_0x63f0('0x4d')],{})[_0x63f0('0x26')](function(_0x429f1a){var _0x47214f=_0x2efaea['user'][_0x63f0('0x4e')]({'plain':!![]});if(!_0x47214f)throw new Error(_0x63f0('0x4f'));if(_0x47214f[_0x63f0('0x50')]===_0x63f0('0x51')){var _0x545ffa=_0x429f1a['get']({'plain':!![]});var _0x494219=_0x63f0('0x28');return db[_0x63f0('0x52')][_0x63f0('0x4a')]({'where':{'name':_0x494219,'userProfileId':_0x47214f[_0x63f0('0x53')]},'raw':!![]})[_0x63f0('0x26')](function(_0x2d0dd0){if(_0x2d0dd0&&_0x2d0dd0[_0x63f0('0x54')]===0x0){return db['UserProfileResource'][_0x63f0('0x4c')]({'name':_0x545ffa[_0x63f0('0x2c')],'resourceId':_0x545ffa['id'],'type':_0x2d0dd0['name'],'sectionId':_0x2d0dd0['id']},{})[_0x63f0('0x26')](function(){return _0x429f1a;});}else{return _0x429f1a;}})['catch'](function(_0x294e71){logger[_0x63f0('0x2a')](_0x63f0('0x55'),_0x294e71);throw _0x294e71;});}return _0x429f1a;})[_0x63f0('0x26')](respondWithResult(_0x2248ad,0xc9))[_0x63f0('0x4b')](handleError(_0x2248ad,null));};exports[_0x63f0('0x25')]=function(_0x15cc19,_0x45ad30){if(_0x15cc19[_0x63f0('0x4d')]['id']){delete _0x15cc19[_0x63f0('0x4d')]['id'];}return db[_0x63f0('0x2e')][_0x63f0('0x4a')]({'where':{'id':_0x15cc19[_0x63f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x45ad30,null))[_0x63f0('0x26')](saveUpdates(_0x15cc19[_0x63f0('0x4d')],null))['then'](respondWithResult(_0x45ad30,null))[_0x63f0('0x4b')](handleError(_0x45ad30,null));};exports[_0x63f0('0x27')]=function(_0x5c4c57,_0x1bd47d){return db['OpenchannelQueue'][_0x63f0('0x4a')]({'where':{'id':_0x5c4c57[_0x63f0('0x48')]['id']}})[_0x63f0('0x26')](handleEntityNotFound(_0x1bd47d,null))[_0x63f0('0x26')](removeEntity(_0x1bd47d,null))[_0x63f0('0x4b')](handleError(_0x1bd47d,null));};exports[_0x63f0('0x56')]=function(_0x430552,_0x5ce9e2){return db[_0x63f0('0x2e')][_0x63f0('0x56')]()[_0x63f0('0x26')](respondWithResult(_0x5ce9e2,null))[_0x63f0('0x4b')](handleError(_0x5ce9e2,null));};exports[_0x63f0('0x57')]=function(_0xb55a46,_0x2e57d0,_0x8286ed){var _0xa2f629={'raw':!![],'where':{}},_0x3ef876={},_0x2c8ef9;return db[_0x63f0('0x2e')][_0x63f0('0x58')]({'where':{'id':_0xb55a46[_0x63f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e57d0,null))[_0x63f0('0x26')](function(_0x336b34){if(_0x336b34){_0x2c8ef9=_0x336b34[_0x63f0('0x4e')]({'plain':!![]});_0x3ef876[_0x63f0('0x32')]=_[_0x63f0('0x34')](db[_0x63f0('0x59')][_0x63f0('0x49')]);_0x3ef876['query']=_[_0x63f0('0x34')](_0xb55a46[_0x63f0('0x35')]);_0x3ef876['filters']=_[_0x63f0('0x37')](_0x3ef876[_0x63f0('0x32')],_0x3ef876[_0x63f0('0x35')]);_0xa2f629[_0x63f0('0x39')]=_['intersection'](_0x3ef876[_0x63f0('0x32')],qs[_0x63f0('0x38')](_0xb55a46[_0x63f0('0x35')][_0x63f0('0x38')]));_0xa2f629['attributes']=_0xa2f629[_0x63f0('0x39')]['length']?_0xa2f629[_0x63f0('0x39')]:_0x3ef876[_0x63f0('0x32')];if(!_0xb55a46[_0x63f0('0x35')][_0x63f0('0x3b')](_0x63f0('0x5a'))){_0xa2f629[_0x63f0('0x1f')]=qs[_0x63f0('0x1f')](_0xb55a46[_0x63f0('0x35')][_0x63f0('0x1f')]);_0xa2f629[_0x63f0('0x1d')]=qs[_0x63f0('0x1d')](_0xb55a46[_0x63f0('0x35')][_0x63f0('0x1d')]);}_0xa2f629[_0x63f0('0x5b')]=qs[_0x63f0('0x3c')](_0xb55a46['query'][_0x63f0('0x3c')]);_0xa2f629['where']=qs[_0x63f0('0x36')](_[_0x63f0('0x3d')](_0xb55a46[_0x63f0('0x35')],_0x3ef876[_0x63f0('0x36')]));_0xa2f629[_0x63f0('0x3f')]['OpenchannelQueueId']=_0x336b34['id'];if(_0xb55a46[_0x63f0('0x35')][_0x63f0('0x3e')]){_0xa2f629[_0x63f0('0x3f')]=_['merge'](_0xa2f629['where'],{'$or':_[_0x63f0('0x33')](_0xa2f629[_0x63f0('0x39')],function(_0x50477e){var _0x4965de={};_0x4965de[_0x50477e]={'$like':'%'+_0xb55a46[_0x63f0('0x35')][_0x63f0('0x3e')]+'%'};return _0x4965de;})});}_0xa2f629=_[_0x63f0('0x41')]({},_0xa2f629,_0xb55a46[_0x63f0('0x42')]);return db[_0x63f0('0x59')][_0x63f0('0x45')](_0xa2f629);}})['then'](function(_0x5668a6){if(_0x5668a6){return db['User'][_0x63f0('0x5c')]({'where':{'id':_[_0x63f0('0x33')](_0x5668a6,'UserId'),'role':_0x63f0('0x5d')},'attributes':['id',_0x63f0('0x2c'),'openchannelPause','updatedAt',_0x63f0('0x5e')]});}})[_0x63f0('0x26')](function(_0xd3bdcc){if(_0xd3bdcc){return{'count':_0xd3bdcc[_0x63f0('0x20')],'rows':_[_0x63f0('0x33')](_0xd3bdcc[_0x63f0('0x46')],function(_0xd8b229){return{'membername':_0xd8b229[_0x63f0('0x2c')],'UserId':_0xd8b229['id'],'queue_name':_0x2c8ef9['name'],'OpenchannelQueueId':_0x2c8ef9['id'],'interface':util[_0x63f0('0x5f')](_0x63f0('0x60'),_0x63f0('0x61'),_0xd8b229[_0x63f0('0x2c')]),'penalty':0x0,'paused':_0xd8b229[_0x63f0('0x62')],'createdAt':_0xd8b229[_0x63f0('0x5e')],'updatedAt':_0xd8b229[_0x63f0('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x63f0('0x26')](respondWithFilteredResult(_0x2e57d0,_0xa2f629))[_0x63f0('0x4b')](handleError(_0x2e57d0,null));};exports['getTeams']=function(_0x513191,_0x2a195a,_0x4df1c1){var _0x195b9e={};var _0x2a9d04={};var _0x4c9e36;var _0x30b733;return db[_0x63f0('0x2e')][_0x63f0('0x58')]({'where':{'id':_0x513191[_0x63f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a195a,null))['then'](function(_0x219d89){if(_0x219d89){_0x4c9e36=_0x219d89;_0x2a9d04['model']=_['keys'](db[_0x63f0('0x64')][_0x63f0('0x49')]);_0x2a9d04[_0x63f0('0x35')]=_[_0x63f0('0x34')](_0x513191['query']);_0x2a9d04[_0x63f0('0x36')]=_['intersection'](_0x2a9d04[_0x63f0('0x32')],_0x2a9d04['query']);_0x195b9e[_0x63f0('0x39')]=_[_0x63f0('0x37')](_0x2a9d04[_0x63f0('0x32')],qs[_0x63f0('0x38')](_0x513191[_0x63f0('0x35')][_0x63f0('0x38')]));_0x195b9e[_0x63f0('0x39')]=_0x195b9e[_0x63f0('0x39')][_0x63f0('0x3a')]?_0x195b9e[_0x63f0('0x39')]:_0x2a9d04['model'];_0x195b9e['order']=qs[_0x63f0('0x3c')](_0x513191['query'][_0x63f0('0x3c')]);_0x195b9e[_0x63f0('0x3f')]=qs['filters'](_[_0x63f0('0x3d')](_0x513191[_0x63f0('0x35')],_0x2a9d04[_0x63f0('0x36')]));if(_0x513191[_0x63f0('0x35')][_0x63f0('0x3e')]){_0x195b9e['where']=_[_0x63f0('0x41')](_0x195b9e[_0x63f0('0x3f')],{'$or':_[_0x63f0('0x33')](_0x195b9e['attributes'],function(_0x4f961c){var _0xd5e7b2={};_0xd5e7b2[_0x4f961c]={'$like':'%'+_0x513191['query'][_0x63f0('0x3e')]+'%'};return _0xd5e7b2;})});}_0x195b9e=_[_0x63f0('0x41')]({},_0x195b9e,_0x513191['options']);return _0x4c9e36[_0x63f0('0x65')](_0x195b9e);}})[_0x63f0('0x26')](function(_0x39ef63){if(_0x39ef63){_0x30b733=_0x39ef63[_0x63f0('0x3a')];if(!_0x513191['query'][_0x63f0('0x3b')](_0x63f0('0x5a'))){_0x195b9e['limit']=qs[_0x63f0('0x1f')](_0x513191['query'][_0x63f0('0x1f')]);_0x195b9e[_0x63f0('0x1d')]=qs[_0x63f0('0x1d')](_0x513191[_0x63f0('0x35')][_0x63f0('0x1d')]);}return _0x4c9e36['getTeams'](_0x195b9e);}})[_0x63f0('0x26')](function(_0x367d47){if(_0x367d47){return _0x367d47?{'count':_0x30b733,'rows':_0x367d47}:null;}})[_0x63f0('0x26')](respondWithResult(_0x2a195a,null))[_0x63f0('0x4b')](handleError(_0x2a195a,null));};exports[_0x63f0('0x66')]=function(_0x2efbb2,_0x1f2657,_0x2f4c46){var _0xf05d0f=_0x2efbb2['body']['ids'];return db['Team'][_0x63f0('0x45')]({'where':{'id':_0xf05d0f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x63f0('0x67'),'attributes':['id',_0x63f0('0x2c'),_0x63f0('0x68'),_0x63f0('0x69'),_0x63f0('0x6a')],'raw':!![]}]})[_0x63f0('0x26')](function(_0x22e5ee){if(_0x22e5ee){var _0x47d372=_[_0x63f0('0x6b')](_0x22e5ee,function(_0x541963){var _0x834eab=_0x541963[_0x63f0('0x4e')]({'plain':!![]});return _0x834eab[_0x63f0('0x67')];});return db[_0x63f0('0x2e')]['find']({'where':{'id':_0x2efbb2[_0x63f0('0x48')]['id']}})[_0x63f0('0x26')](function(_0x20991f){return db[_0x63f0('0x6c')][_0x63f0('0x6d')](function(_0x546b24){return _0x20991f[_0x63f0('0x66')](_0xf05d0f,{'transaction':_0x546b24})[_0x63f0('0x26')](function(){return BPromise[_0x63f0('0x6e')](_0x47d372,function(_0x3749bd){return db[_0x63f0('0x59')][_0x63f0('0x6f')]({'where':{'UserId':_0x3749bd['id'],'OpenchannelQueueId':_0x2efbb2[_0x63f0('0x48')]['id']},'transaction':_0x546b24});});})[_0x63f0('0x26')](function(){_0x47d372[_0x63f0('0x70')](function(_0x559802){socket[_0x63f0('0x71')](_0x63f0('0x72'),{'UserId':_0x559802['id'],'OpenchannelQueueId':_0x20991f['id']});});});});});}})[_0x63f0('0x26')](respondWithStatusCode(_0x1f2657,null))[_0x63f0('0x4b')](handleError(_0x1f2657,null));};exports['removeTeams']=function(_0x1e7d9a,_0x42c153,_0x3923c2){return db[_0x63f0('0x64')][_0x63f0('0x45')]({'where':{'id':_0x1e7d9a[_0x63f0('0x35')][_0x63f0('0x73')]},'attributes':['id'],'include':[{'model':db[_0x63f0('0x74')],'as':_0x63f0('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x42c153,null))[_0x63f0('0x26')](function(_0x19d6b4){var _0x1aa451=_[_0x63f0('0x33')](_0x19d6b4,'id');var _0x125cb3=[];var _0x52a446=[];var _0x50634d=squel[_0x63f0('0x75')]();_0x50634d[_0x63f0('0x76')](_0x63f0('0x77'))[_0x63f0('0x78')](_0x63f0('0x79'),'tq')[_0x63f0('0x7a')]('user_has_teams','ut',_0x63f0('0x7b'))['where']('OpenchannelQueueId\x20=\x20?',_0x1e7d9a['params']['id']);for(var _0x4ee3bf=0x0;_0x4ee3bf<_0x19d6b4[_0x63f0('0x3a')];_0x4ee3bf+=0x1){let _0x112120=_0x19d6b4[_0x4ee3bf];for(var _0x27862c=0x0;_0x27862c<_0x112120[_0x63f0('0x67')][_0x63f0('0x3a')];_0x27862c+=0x1){let _0x4564a0=_0x112120[_0x63f0('0x67')][_0x27862c];var _0x34affb=_0x50634d['clone']();_0x34affb['where'](_0x63f0('0x7c'),_0x4564a0['id']);_0x52a446['push'](db[_0x63f0('0x6c')][_0x63f0('0x35')](_0x34affb['toString'](),{'type':db['sequelize'][_0x63f0('0x7d')][_0x63f0('0x7e')]})[_0x63f0('0x26')](function(_0x203b05){if(_0x203b05[_0x63f0('0x3a')]===0x1){return _0x4564a0['id'];}else{var _0x5722b3=_[_0x63f0('0x7f')](_['map'](_0x203b05,_0x63f0('0x80')),function(_0x559e5b){return _['includes'](_0x1aa451,_0x559e5b);});if(_0x5722b3){return _0x4564a0['id'];}}}));}}return BPromise['all'](_0x52a446)['then'](function(_0x122c3c){_0x125cb3=_(_0x125cb3)[_0x63f0('0x81')](_0x122c3c)[_0x63f0('0x82')]()[_0x63f0('0x83')]();return db[_0x63f0('0x2e')][_0x63f0('0x4a')]({'where':{'id':_0x1e7d9a[_0x63f0('0x48')]['id']}})['then'](function(_0x1062de){return db[_0x63f0('0x6c')]['transaction'](function(_0x125dd6){return _0x1062de['removeTeams'](_0x1e7d9a[_0x63f0('0x35')][_0x63f0('0x73')],{'transaction':_0x125dd6})[_0x63f0('0x26')](function(){if(!_[_0x63f0('0x84')](_0x125cb3)){return _0x1062de[_0x63f0('0x85')](_0x125cb3,{'transaction':_0x125dd6});}})[_0x63f0('0x26')](function(){_0x125cb3[_0x63f0('0x70')](function(_0x534de4){socket['emit'](_0x63f0('0x86'),{'UserId':_0x534de4,'OpenchannelQueueId':_0x1062de['id']});});});});});});})[_0x63f0('0x26')](respondWithStatusCode(_0x42c153,null))[_0x63f0('0x4b')](handleError(_0x42c153,null));};exports[_0x63f0('0x87')]=function(_0x465c6a,_0x3c4259,_0x20ac54){return db[_0x63f0('0x2e')][_0x63f0('0x4a')]({'where':{'id':_0x465c6a['params']['id']}})['then'](handleEntityNotFound(_0x3c4259,null))[_0x63f0('0x26')](function(_0x2d69cd){if(_0x2d69cd){return _0x2d69cd[_0x63f0('0x87')](_0x465c6a[_0x63f0('0x4d')][_0x63f0('0x73')],_[_0x63f0('0x88')](_0x465c6a[_0x63f0('0x4d')],['ids','id'])||{})['spread'](function(_0x337fc4){for(var _0x179423=0x0;_0x179423<_0x465c6a['body'][_0x63f0('0x73')]['length'];_0x179423+=0x1){socket[_0x63f0('0x71')](_0x63f0('0x72'),{'UserId':Number(_0x465c6a['body'][_0x63f0('0x73')][_0x179423]),'OpenchannelQueueId':Number(_0x465c6a['params']['id'])});}return _0x337fc4;});}})[_0x63f0('0x26')](respondWithResult(_0x3c4259,null))[_0x63f0('0x4b')](handleError(_0x3c4259,null));};exports[_0x63f0('0x85')]=function(_0x13d437,_0x5773a6,_0x4772a4){return db['OpenchannelQueue']['find']({'where':{'id':_0x13d437[_0x63f0('0x48')]['id']}})[_0x63f0('0x26')](handleEntityNotFound(_0x5773a6,null))[_0x63f0('0x26')](function(_0x155186){if(_0x155186){return _0x155186[_0x63f0('0x85')](_0x13d437[_0x63f0('0x35')][_0x63f0('0x73')])[_0x63f0('0x26')](function(){if(_[_0x63f0('0x89')](_0x13d437[_0x63f0('0x35')]['ids'])){for(var _0x248ec9=0x0;_0x248ec9<_0x13d437[_0x63f0('0x35')]['ids'][_0x63f0('0x3a')];_0x248ec9+=0x1){socket[_0x63f0('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x13d437[_0x63f0('0x35')][_0x63f0('0x73')][_0x248ec9]),'OpenchannelQueueId':Number(_0x13d437[_0x63f0('0x48')]['id'])});}}else{socket[_0x63f0('0x71')](_0x63f0('0x86'),{'UserId':Number(_0x13d437[_0x63f0('0x35')][_0x63f0('0x73')]),'OpenchannelQueueId':Number(_0x13d437[_0x63f0('0x48')]['id'])});}});}})[_0x63f0('0x26')](respondWithStatusCode(_0x5773a6,null))[_0x63f0('0x4b')](handleError(_0x5773a6,null));};exports['getAgents']=function(_0x25a187,_0x483939,_0x22f1ab){var _0x48d45e={};var _0x57e952={};var _0x459c20;var _0x32ae4f;return db[_0x63f0('0x2e')]['findOne']({'where':{'id':_0x25a187['params']['id']}})[_0x63f0('0x26')](handleEntityNotFound(_0x483939,null))[_0x63f0('0x26')](function(_0xc3f12f){if(_0xc3f12f){_0x459c20=_0xc3f12f;_0x57e952[_0x63f0('0x32')]=_['keys'](db['User'][_0x63f0('0x49')]);_0x57e952[_0x63f0('0x35')]=_[_0x63f0('0x34')](_0x25a187[_0x63f0('0x35')]);_0x57e952[_0x63f0('0x36')]=_[_0x63f0('0x37')](_0x57e952['model'],_0x57e952[_0x63f0('0x35')]);_0x48d45e[_0x63f0('0x39')]=_[_0x63f0('0x37')](_0x57e952['model'],qs[_0x63f0('0x38')](_0x25a187[_0x63f0('0x35')]['fields']));_0x48d45e[_0x63f0('0x39')]=_0x48d45e[_0x63f0('0x39')][_0x63f0('0x3a')]?_0x48d45e['attributes']:_0x57e952['model'];_0x48d45e[_0x63f0('0x5b')]=qs[_0x63f0('0x3c')](_0x25a187[_0x63f0('0x35')][_0x63f0('0x3c')]);_0x48d45e['where']=qs[_0x63f0('0x36')](_[_0x63f0('0x3d')](_0x25a187[_0x63f0('0x35')],_0x57e952['filters']));if(_0x25a187[_0x63f0('0x35')][_0x63f0('0x3e')]){_0x48d45e[_0x63f0('0x3f')]=_[_0x63f0('0x41')](_0x48d45e['where'],{'$or':_[_0x63f0('0x33')](_0x48d45e['attributes'],function(_0x3f65f5){var _0x9f7677={};_0x9f7677[_0x3f65f5]={'$like':'%'+_0x25a187['query'][_0x63f0('0x3e')]+'%'};return _0x9f7677;})});}_0x48d45e=_[_0x63f0('0x41')]({},_0x48d45e,_0x25a187[_0x63f0('0x42')]);return _0x459c20['getAgents'](_0x48d45e);}})[_0x63f0('0x26')](function(_0x20fbf4){if(_0x20fbf4){_0x32ae4f=_0x20fbf4[_0x63f0('0x3a')];if(!_0x25a187[_0x63f0('0x35')][_0x63f0('0x3b')]('nolimit')){_0x48d45e[_0x63f0('0x1f')]=qs[_0x63f0('0x1f')](_0x25a187[_0x63f0('0x35')][_0x63f0('0x1f')]);_0x48d45e[_0x63f0('0x1d')]=qs[_0x63f0('0x1d')](_0x25a187[_0x63f0('0x35')][_0x63f0('0x1d')]);}return _0x459c20[_0x63f0('0x8a')](_0x48d45e);}})[_0x63f0('0x26')](function(_0x3162e2){if(_0x3162e2){return _0x3162e2?{'count':_0x32ae4f,'rows':_0x3162e2}:null;}})[_0x63f0('0x26')](respondWithResult(_0x483939,null))[_0x63f0('0x4b')](handleError(_0x483939,null));};
\ No newline at end of file
+var _0x18b6=['ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeAgents','userOpenchannelQueue:remove','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','then','UserProfileResource','destroy','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','describe','getMembers','nolimit','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','rows','%s/%s','Team','getTeams','ids','findAll','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','Agents','clone'];(function(_0x2a38f0,_0x44fd07){var _0x2d1b98=function(_0x4abbb6){while(--_0x4abbb6){_0x2a38f0['push'](_0x2a38f0['shift']());}};_0x2d1b98(++_0x44fd07);}(_0x18b6,0x99));var _0x618b=function(_0x5df414,_0x34eb15){_0x5df414=_0x5df414-0x0;var _0x403b60=_0x18b6[_0x5df414];return _0x403b60;};'use strict';var emlformat=require(_0x618b('0x0'));var rimraf=require(_0x618b('0x1'));var zipdir=require(_0x618b('0x2'));var jsonpatch=require(_0x618b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x618b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x618b('0x5'));var sox=require(_0x618b('0x6'));var csv=require(_0x618b('0x7'));var ejs=require(_0x618b('0x8'));var fs=require('fs');var fs_extra=require(_0x618b('0x9'));var _=require('lodash');var squel=require(_0x618b('0xa'));var crypto=require('crypto');var jsforce=require(_0x618b('0xb'));var deskjs=require(_0x618b('0xc'));var toCsv=require(_0x618b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x618b('0xd'));var qs=require(_0x618b('0xe'));var as=require(_0x618b('0xf'));var hardwareService=require(_0x618b('0x10'));var logger=require(_0x618b('0x11'))('api');var utils=require(_0x618b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x618b('0x13'));var db=require(_0x618b('0x14'))['db'];config[_0x618b('0x15')]=_[_0x618b('0x16')](config[_0x618b('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x618b('0x17'))(new Redis(config[_0x618b('0x15')]));require(_0x618b('0x18'))[_0x618b('0x19')](socket);function respondWithStatusCode(_0x2fadd9,_0x2a5fe1){_0x2a5fe1=_0x2a5fe1||0xcc;return function(_0x3832ab){if(_0x3832ab){return _0x2fadd9[_0x618b('0x1a')](_0x2a5fe1);}return _0x2fadd9['status'](_0x2a5fe1)['end']();};}function respondWithResult(_0x56bad3,_0x4c5a46){_0x4c5a46=_0x4c5a46||0xc8;return function(_0x145436){if(_0x145436){return _0x56bad3[_0x618b('0x1b')](_0x4c5a46)[_0x618b('0x1c')](_0x145436);}};}function respondWithFilteredResult(_0x4b2147,_0x1fe830){return function(_0xbdf3c){if(_0xbdf3c){var _0x1ae0c5=typeof _0x1fe830[_0x618b('0x1d')]===_0x618b('0x1e')&&typeof _0x1fe830['limit']===_0x618b('0x1e');var _0x1d528a=_0xbdf3c[_0x618b('0x1f')];var _0x3fa387=_0x1ae0c5?0x0:_0x1fe830[_0x618b('0x1d')];var _0x1eb0e1=_0x1ae0c5?_0xbdf3c['count']:_0x1fe830['offset']+_0x1fe830[_0x618b('0x20')];var _0x461d14;if(_0x1eb0e1>=_0x1d528a){_0x1eb0e1=_0x1d528a;_0x461d14=0xc8;}else{_0x461d14=0xce;}_0x4b2147['status'](_0x461d14);return _0x4b2147['set'](_0x618b('0x21'),_0x3fa387+'-'+_0x1eb0e1+'/'+_0x1d528a)['json'](_0xbdf3c);}return null;};}function patchUpdates(_0x4b5e){return function(_0x55f0c6){try{jsonpatch[_0x618b('0x22')](_0x55f0c6,_0x4b5e,!![]);}catch(_0xa71167){return BPromise['reject'](_0xa71167);}return _0x55f0c6[_0x618b('0x23')]();};}function saveUpdates(_0x1c28f7,_0x5b75be){return function(_0x44acd8){if(_0x44acd8){return _0x44acd8['update'](_0x1c28f7)[_0x618b('0x24')](function(_0xe3474e){return _0xe3474e;});}return null;};}function removeEntity(_0x1478fb,_0x57c6bd){return function(_0x2b9f37){if(_0x2b9f37){return _0x2b9f37['destroy']()['then'](function(){var _0x10e39e=_0x2b9f37['get']({'plain':!![]});var _0x59ec58='OpenchannelQueues';return db[_0x618b('0x25')][_0x618b('0x26')]({'where':{'type':_0x59ec58,'resourceId':_0x10e39e['id']}})[_0x618b('0x24')](function(){return _0x2b9f37;});})[_0x618b('0x24')](function(){_0x1478fb[_0x618b('0x1b')](0xcc)[_0x618b('0x27')]();});}};}function handleEntityNotFound(_0x54370e,_0x2144a1){return function(_0x2ca82d){if(!_0x2ca82d){_0x54370e[_0x618b('0x1a')](0x194);}return _0x2ca82d;};}function handleError(_0x1b9d09,_0x304725){_0x304725=_0x304725||0x1f4;return function(_0x16add1){logger[_0x618b('0x28')](_0x16add1[_0x618b('0x29')]);if(_0x16add1[_0x618b('0x2a')]){delete _0x16add1[_0x618b('0x2a')];}_0x1b9d09[_0x618b('0x1b')](_0x304725)[_0x618b('0x2b')](_0x16add1);};}exports[_0x618b('0x2c')]=function(_0x45f2bf,_0x216ef2){var _0x531f58={},_0x4f56ce={},_0x14708c={'count':0x0,'rows':[]};var _0x14d67a=_[_0x618b('0x2d')](db[_0x618b('0x2e')][_0x618b('0x2f')],function(_0x569a86){return{'name':_0x569a86[_0x618b('0x30')],'type':_0x569a86[_0x618b('0x31')][_0x618b('0x32')]};});_0x4f56ce[_0x618b('0x33')]=_[_0x618b('0x2d')](_0x14d67a,'name');_0x4f56ce['query']=_[_0x618b('0x34')](_0x45f2bf['query']);_0x4f56ce['filters']=_[_0x618b('0x35')](_0x4f56ce[_0x618b('0x33')],_0x4f56ce[_0x618b('0x36')]);_0x531f58[_0x618b('0x37')]=_[_0x618b('0x35')](_0x4f56ce['model'],qs[_0x618b('0x38')](_0x45f2bf['query'][_0x618b('0x38')]));_0x531f58[_0x618b('0x37')]=_0x531f58[_0x618b('0x37')][_0x618b('0x39')]?_0x531f58[_0x618b('0x37')]:_0x4f56ce[_0x618b('0x33')];if(!_0x45f2bf['query'][_0x618b('0x3a')]('nolimit')){_0x531f58['limit']=qs[_0x618b('0x20')](_0x45f2bf[_0x618b('0x36')][_0x618b('0x20')]);_0x531f58['offset']=qs[_0x618b('0x1d')](_0x45f2bf[_0x618b('0x36')][_0x618b('0x1d')]);}_0x531f58[_0x618b('0x3b')]=qs[_0x618b('0x3c')](_0x45f2bf[_0x618b('0x36')][_0x618b('0x3c')]);_0x531f58[_0x618b('0x3d')]=qs[_0x618b('0x3e')](_[_0x618b('0x3f')](_0x45f2bf['query'],_0x4f56ce['filters']),_0x14d67a);if(_0x45f2bf[_0x618b('0x36')]['filter']){_0x531f58[_0x618b('0x3d')]=_[_0x618b('0x40')](_0x531f58[_0x618b('0x3d')],{'$or':_[_0x618b('0x2d')](_0x14d67a,function(_0x3fce1b){if(_0x3fce1b[_0x618b('0x31')]!==_0x618b('0x41')){var _0x37d2b8={};_0x37d2b8[_0x3fce1b['name']]={'$like':'%'+_0x45f2bf[_0x618b('0x36')][_0x618b('0x42')]+'%'};return _0x37d2b8;}})});}_0x531f58=_['merge']({},_0x531f58,_0x45f2bf[_0x618b('0x43')]);var _0x1bcdb1={'where':_0x531f58['where']};return db[_0x618b('0x2e')][_0x618b('0x1f')](_0x1bcdb1)['then'](function(_0x30ac80){_0x14708c['count']=_0x30ac80;if(_0x45f2bf['query']['includeAll']){_0x531f58[_0x618b('0x44')]=[{'all':!![]}];}return db[_0x618b('0x2e')]['findAll'](_0x531f58);})[_0x618b('0x24')](function(_0x1078ad){_0x14708c['rows']=_0x1078ad;return _0x14708c;})[_0x618b('0x24')](respondWithFilteredResult(_0x216ef2,_0x531f58))[_0x618b('0x45')](handleError(_0x216ef2,null));};exports[_0x618b('0x46')]=function(_0x22a75c,_0x5b7772){var _0x392be1={'raw':!![],'where':{'id':_0x22a75c[_0x618b('0x47')]['id']}},_0x20d88a={};_0x20d88a['model']=_['keys'](db[_0x618b('0x2e')][_0x618b('0x2f')]);_0x20d88a['query']=_['keys'](_0x22a75c['query']);_0x20d88a[_0x618b('0x3e')]=_[_0x618b('0x35')](_0x20d88a['model'],_0x20d88a[_0x618b('0x36')]);_0x392be1['attributes']=_['intersection'](_0x20d88a[_0x618b('0x33')],qs['fields'](_0x22a75c['query'][_0x618b('0x38')]));_0x392be1[_0x618b('0x37')]=_0x392be1[_0x618b('0x37')]['length']?_0x392be1[_0x618b('0x37')]:_0x20d88a[_0x618b('0x33')];if(_0x22a75c[_0x618b('0x36')]['includeAll']){_0x392be1['include']=[{'all':!![]}];}_0x392be1=_[_0x618b('0x40')]({},_0x392be1,_0x22a75c[_0x618b('0x43')]);return db[_0x618b('0x2e')][_0x618b('0x48')](_0x392be1)['then'](handleEntityNotFound(_0x5b7772,null))[_0x618b('0x24')](respondWithResult(_0x5b7772,null))[_0x618b('0x45')](handleError(_0x5b7772,null));};exports[_0x618b('0x49')]=function(_0x24bbb3,_0x43b02e){return db[_0x618b('0x2e')]['create'](_0x24bbb3[_0x618b('0x4a')],{})[_0x618b('0x24')](function(_0x48d09a){var _0xe411ea=_0x24bbb3[_0x618b('0x4b')][_0x618b('0x4c')]({'plain':!![]});if(!_0xe411ea)throw new Error(_0x618b('0x4d'));if(_0xe411ea['role']===_0x618b('0x4b')){var _0xe736b5=_0x48d09a[_0x618b('0x4c')]({'plain':!![]});var _0x4a5bdd='OpenchannelQueues';return db[_0x618b('0x4e')][_0x618b('0x48')]({'where':{'name':_0x4a5bdd,'userProfileId':_0xe411ea[_0x618b('0x4f')]},'raw':!![]})[_0x618b('0x24')](function(_0x4085d0){if(_0x4085d0&&_0x4085d0[_0x618b('0x50')]===0x0){return db[_0x618b('0x25')][_0x618b('0x49')]({'name':_0xe736b5['name'],'resourceId':_0xe736b5['id'],'type':_0x4085d0[_0x618b('0x2a')],'sectionId':_0x4085d0['id']},{})[_0x618b('0x24')](function(){return _0x48d09a;});}else{return _0x48d09a;}})[_0x618b('0x45')](function(_0x44f519){logger[_0x618b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44f519);throw _0x44f519;});}return _0x48d09a;})[_0x618b('0x24')](respondWithResult(_0x43b02e,0xc9))[_0x618b('0x45')](handleError(_0x43b02e,null));};exports[_0x618b('0x51')]=function(_0x5df173,_0x1db56a){if(_0x5df173[_0x618b('0x4a')]['id']){delete _0x5df173[_0x618b('0x4a')]['id'];}return db['OpenchannelQueue'][_0x618b('0x48')]({'where':{'id':_0x5df173[_0x618b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1db56a,null))[_0x618b('0x24')](saveUpdates(_0x5df173[_0x618b('0x4a')],null))[_0x618b('0x24')](respondWithResult(_0x1db56a,null))[_0x618b('0x45')](handleError(_0x1db56a,null));};exports[_0x618b('0x26')]=function(_0x49b58a,_0x1e94e1){return db['OpenchannelQueue']['find']({'where':{'id':_0x49b58a['params']['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x1e94e1,null))[_0x618b('0x24')](removeEntity(_0x1e94e1,null))[_0x618b('0x45')](handleError(_0x1e94e1,null));};exports[_0x618b('0x52')]=function(_0x199e8d,_0x323360){return db[_0x618b('0x2e')][_0x618b('0x52')]()[_0x618b('0x24')](respondWithResult(_0x323360,null))[_0x618b('0x45')](handleError(_0x323360,null));};exports[_0x618b('0x53')]=function(_0x1d144a,_0x210aa9,_0x52129d){var _0x200c85={'raw':!![],'where':{}},_0xd67f6e={},_0x47fe1f;return db[_0x618b('0x2e')]['findOne']({'where':{'id':_0x1d144a['params']['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x210aa9,null))['then'](function(_0x5622ee){if(_0x5622ee){_0x47fe1f=_0x5622ee[_0x618b('0x4c')]({'plain':!![]});_0xd67f6e[_0x618b('0x33')]=_['keys'](db['UserOpenchannelQueue'][_0x618b('0x2f')]);_0xd67f6e['query']=_[_0x618b('0x34')](_0x1d144a['query']);_0xd67f6e[_0x618b('0x3e')]=_[_0x618b('0x35')](_0xd67f6e[_0x618b('0x33')],_0xd67f6e[_0x618b('0x36')]);_0x200c85[_0x618b('0x37')]=_['intersection'](_0xd67f6e[_0x618b('0x33')],qs['fields'](_0x1d144a[_0x618b('0x36')][_0x618b('0x38')]));_0x200c85[_0x618b('0x37')]=_0x200c85[_0x618b('0x37')][_0x618b('0x39')]?_0x200c85[_0x618b('0x37')]:_0xd67f6e['model'];if(!_0x1d144a[_0x618b('0x36')][_0x618b('0x3a')](_0x618b('0x54'))){_0x200c85[_0x618b('0x20')]=qs[_0x618b('0x20')](_0x1d144a[_0x618b('0x36')][_0x618b('0x20')]);_0x200c85[_0x618b('0x1d')]=qs[_0x618b('0x1d')](_0x1d144a[_0x618b('0x36')][_0x618b('0x1d')]);}_0x200c85[_0x618b('0x3b')]=qs[_0x618b('0x3c')](_0x1d144a[_0x618b('0x36')]['sort']);_0x200c85[_0x618b('0x3d')]=qs[_0x618b('0x3e')](_['pick'](_0x1d144a[_0x618b('0x36')],_0xd67f6e['filters']));_0x200c85[_0x618b('0x3d')]['OpenchannelQueueId']=_0x5622ee['id'];if(_0x1d144a[_0x618b('0x36')][_0x618b('0x42')]){_0x200c85[_0x618b('0x3d')]=_[_0x618b('0x40')](_0x200c85[_0x618b('0x3d')],{'$or':_[_0x618b('0x2d')](_0x200c85[_0x618b('0x37')],function(_0x455018){var _0x57943e={};_0x57943e[_0x455018]={'$like':'%'+_0x1d144a[_0x618b('0x36')][_0x618b('0x42')]+'%'};return _0x57943e;})});}_0x200c85=_[_0x618b('0x40')]({},_0x200c85,_0x1d144a['options']);return db['UserOpenchannelQueue']['findAll'](_0x200c85);}})[_0x618b('0x24')](function(_0x55d150){if(_0x55d150){return db[_0x618b('0x55')][_0x618b('0x56')]({'where':{'id':_[_0x618b('0x2d')](_0x55d150,_0x618b('0x57')),'role':_0x618b('0x58')},'attributes':['id','name',_0x618b('0x59'),_0x618b('0x5a'),_0x618b('0x5b')]});}})[_0x618b('0x24')](function(_0x4c6ee4){if(_0x4c6ee4){return{'count':_0x4c6ee4[_0x618b('0x1f')],'rows':_[_0x618b('0x2d')](_0x4c6ee4[_0x618b('0x5c')],function(_0x136667){return{'membername':_0x136667[_0x618b('0x2a')],'UserId':_0x136667['id'],'queue_name':_0x47fe1f[_0x618b('0x2a')],'OpenchannelQueueId':_0x47fe1f['id'],'interface':util['format'](_0x618b('0x5d'),'SIP',_0x136667['name']),'penalty':0x0,'paused':_0x136667[_0x618b('0x59')],'createdAt':_0x136667['createdAt'],'updatedAt':_0x136667[_0x618b('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x618b('0x24')](respondWithFilteredResult(_0x210aa9,_0x200c85))[_0x618b('0x45')](handleError(_0x210aa9,null));};exports['getTeams']=function(_0x3e7937,_0x32b87a,_0x178f54){var _0x51f8e0={};var _0x4e7c66={};var _0x5d723d;var _0x84992d;return db[_0x618b('0x2e')]['findOne']({'where':{'id':_0x3e7937[_0x618b('0x47')]['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x32b87a,null))[_0x618b('0x24')](function(_0x5a5805){if(_0x5a5805){_0x5d723d=_0x5a5805;_0x4e7c66[_0x618b('0x33')]=_[_0x618b('0x34')](db[_0x618b('0x5e')][_0x618b('0x2f')]);_0x4e7c66[_0x618b('0x36')]=_['keys'](_0x3e7937['query']);_0x4e7c66[_0x618b('0x3e')]=_[_0x618b('0x35')](_0x4e7c66['model'],_0x4e7c66[_0x618b('0x36')]);_0x51f8e0['attributes']=_['intersection'](_0x4e7c66[_0x618b('0x33')],qs['fields'](_0x3e7937[_0x618b('0x36')]['fields']));_0x51f8e0[_0x618b('0x37')]=_0x51f8e0[_0x618b('0x37')][_0x618b('0x39')]?_0x51f8e0['attributes']:_0x4e7c66[_0x618b('0x33')];_0x51f8e0[_0x618b('0x3b')]=qs[_0x618b('0x3c')](_0x3e7937[_0x618b('0x36')][_0x618b('0x3c')]);_0x51f8e0['where']=qs[_0x618b('0x3e')](_[_0x618b('0x3f')](_0x3e7937[_0x618b('0x36')],_0x4e7c66[_0x618b('0x3e')]));if(_0x3e7937['query'][_0x618b('0x42')]){_0x51f8e0[_0x618b('0x3d')]=_[_0x618b('0x40')](_0x51f8e0[_0x618b('0x3d')],{'$or':_[_0x618b('0x2d')](_0x51f8e0[_0x618b('0x37')],function(_0x543767){var _0x5e4408={};_0x5e4408[_0x543767]={'$like':'%'+_0x3e7937[_0x618b('0x36')][_0x618b('0x42')]+'%'};return _0x5e4408;})});}_0x51f8e0=_['merge']({},_0x51f8e0,_0x3e7937['options']);return _0x5d723d[_0x618b('0x5f')](_0x51f8e0);}})[_0x618b('0x24')](function(_0x1d5485){if(_0x1d5485){_0x84992d=_0x1d5485[_0x618b('0x39')];if(!_0x3e7937[_0x618b('0x36')][_0x618b('0x3a')](_0x618b('0x54'))){_0x51f8e0[_0x618b('0x20')]=qs[_0x618b('0x20')](_0x3e7937[_0x618b('0x36')]['limit']);_0x51f8e0[_0x618b('0x1d')]=qs['offset'](_0x3e7937[_0x618b('0x36')][_0x618b('0x1d')]);}return _0x5d723d[_0x618b('0x5f')](_0x51f8e0);}})[_0x618b('0x24')](function(_0x54beb5){if(_0x54beb5){return _0x54beb5?{'count':_0x84992d,'rows':_0x54beb5}:null;}})[_0x618b('0x24')](respondWithResult(_0x32b87a,null))[_0x618b('0x45')](handleError(_0x32b87a,null));};exports['addTeams']=function(_0x18c080,_0x33d2b4,_0x23613e){var _0x299b04=_0x18c080[_0x618b('0x4a')][_0x618b('0x60')];return db[_0x618b('0x5e')][_0x618b('0x61')]({'where':{'id':_0x299b04},'attributes':['id'],'include':[{'model':db[_0x618b('0x55')],'as':'Agents','attributes':['id','name',_0x618b('0x62'),_0x618b('0x63'),_0x618b('0x64')],'raw':!![]}]})['then'](function(_0x305a9d){if(_0x305a9d){var _0x1f4c3f=_[_0x618b('0x65')](_0x305a9d,function(_0x5bd4c6){var _0x5f1dc7=_0x5bd4c6[_0x618b('0x4c')]({'plain':!![]});return _0x5f1dc7['Agents'];});return db[_0x618b('0x2e')]['find']({'where':{'id':_0x18c080[_0x618b('0x47')]['id']}})[_0x618b('0x24')](function(_0x2fcdc7){return db[_0x618b('0x66')][_0x618b('0x67')](function(_0x472e49){return _0x2fcdc7['addTeams'](_0x299b04,{'transaction':_0x472e49})[_0x618b('0x24')](function(){return BPromise[_0x618b('0x68')](_0x1f4c3f,function(_0x4c1b30){return db['UserOpenchannelQueue'][_0x618b('0x69')]({'where':{'UserId':_0x4c1b30['id'],'OpenchannelQueueId':_0x18c080[_0x618b('0x47')]['id']},'transaction':_0x472e49});});})[_0x618b('0x24')](function(){_0x1f4c3f[_0x618b('0x6a')](function(_0x2cab97){socket[_0x618b('0x6b')]('userOpenchannelQueue:save',{'UserId':_0x2cab97['id'],'OpenchannelQueueId':_0x2fcdc7['id']});});});});});}})['then'](respondWithStatusCode(_0x33d2b4,null))['catch'](handleError(_0x33d2b4,null));};exports[_0x618b('0x6c')]=function(_0x3618d4,_0x4e6a5b,_0x4a38bd){return db[_0x618b('0x5e')]['findAll']({'where':{'id':_0x3618d4[_0x618b('0x36')][_0x618b('0x60')]},'attributes':['id'],'include':[{'model':db[_0x618b('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x618b('0x24')](handleEntityNotFound(_0x4e6a5b,null))['then'](function(_0x42c0f0){var _0x3fe538=_[_0x618b('0x2d')](_0x42c0f0,'id');var _0xa1389a=[];var _0x291f90=[];var _0xc94ae6=squel[_0x618b('0x6d')]();_0xc94ae6[_0x618b('0x6e')](_0x618b('0x6f'))[_0x618b('0x70')](_0x618b('0x71'),'tq')[_0x618b('0x72')]('user_has_teams','ut',_0x618b('0x73'))[_0x618b('0x3d')](_0x618b('0x74'),_0x3618d4['params']['id']);for(var _0x53e98d=0x0;_0x53e98d<_0x42c0f0[_0x618b('0x39')];_0x53e98d+=0x1){let _0x579886=_0x42c0f0[_0x53e98d];for(var _0x3e9b9d=0x0;_0x3e9b9d<_0x579886[_0x618b('0x75')][_0x618b('0x39')];_0x3e9b9d+=0x1){let _0x2797fb=_0x579886[_0x618b('0x75')][_0x3e9b9d];var _0x36cab4=_0xc94ae6[_0x618b('0x76')]();_0x36cab4[_0x618b('0x3d')](_0x618b('0x77'),_0x2797fb['id']);_0x291f90[_0x618b('0x78')](db[_0x618b('0x66')]['query'](_0x36cab4[_0x618b('0x79')](),{'type':db[_0x618b('0x66')][_0x618b('0x7a')][_0x618b('0x7b')]})['then'](function(_0x55901c){if(_0x55901c[_0x618b('0x39')]===0x1){return _0x2797fb['id'];}else{var _0xa8ccf6=_[_0x618b('0x7c')](_[_0x618b('0x2d')](_0x55901c,'TeamId'),function(_0x4ae3fc){return _[_0x618b('0x7d')](_0x3fe538,_0x4ae3fc);});if(_0xa8ccf6){return _0x2797fb['id'];}}}));}}return BPromise[_0x618b('0x7e')](_0x291f90)[_0x618b('0x24')](function(_0x5a544b){_0xa1389a=_(_0xa1389a)[_0x618b('0x7f')](_0x5a544b)[_0x618b('0x80')]()[_0x618b('0x81')]();return db[_0x618b('0x2e')][_0x618b('0x48')]({'where':{'id':_0x3618d4[_0x618b('0x47')]['id']}})[_0x618b('0x24')](function(_0x537e17){return db['sequelize'][_0x618b('0x67')](function(_0x1126eb){return _0x537e17[_0x618b('0x6c')](_0x3618d4[_0x618b('0x36')][_0x618b('0x60')],{'transaction':_0x1126eb})[_0x618b('0x24')](function(){if(!_['isEmpty'](_0xa1389a)){return _0x537e17[_0x618b('0x82')](_0xa1389a,{'transaction':_0x1126eb});}})[_0x618b('0x24')](function(){_0xa1389a[_0x618b('0x6a')](function(_0x368e58){socket[_0x618b('0x6b')](_0x618b('0x83'),{'UserId':_0x368e58,'OpenchannelQueueId':_0x537e17['id']});});});});});});})[_0x618b('0x24')](respondWithStatusCode(_0x4e6a5b,null))['catch'](handleError(_0x4e6a5b,null));};exports['addAgents']=function(_0x2889ef,_0x2da0f5,_0x26095d){return db[_0x618b('0x2e')][_0x618b('0x48')]({'where':{'id':_0x2889ef[_0x618b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2da0f5,null))[_0x618b('0x24')](function(_0x1449c4){if(_0x1449c4){return _0x1449c4['addAgents'](_0x2889ef[_0x618b('0x4a')]['ids'],_[_0x618b('0x84')](_0x2889ef[_0x618b('0x4a')],[_0x618b('0x60'),'id'])||{})[_0x618b('0x85')](function(_0x22bf93){for(var _0xf479c8=0x0;_0xf479c8<_0x2889ef[_0x618b('0x4a')]['ids'][_0x618b('0x39')];_0xf479c8+=0x1){socket[_0x618b('0x6b')]('userOpenchannelQueue:save',{'UserId':Number(_0x2889ef['body']['ids'][_0xf479c8]),'OpenchannelQueueId':Number(_0x2889ef[_0x618b('0x47')]['id'])});}return _0x22bf93;});}})[_0x618b('0x24')](respondWithResult(_0x2da0f5,null))[_0x618b('0x45')](handleError(_0x2da0f5,null));};exports['removeAgents']=function(_0x31dbd1,_0x5dcbc5,_0x3a43a0){return db[_0x618b('0x2e')][_0x618b('0x48')]({'where':{'id':_0x31dbd1[_0x618b('0x47')]['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x5dcbc5,null))[_0x618b('0x24')](function(_0x3ce823){if(_0x3ce823){return _0x3ce823[_0x618b('0x82')](_0x31dbd1[_0x618b('0x36')][_0x618b('0x60')])[_0x618b('0x24')](function(){if(_[_0x618b('0x86')](_0x31dbd1[_0x618b('0x36')][_0x618b('0x60')])){for(var _0x56cbe3=0x0;_0x56cbe3<_0x31dbd1['query']['ids'][_0x618b('0x39')];_0x56cbe3+=0x1){socket[_0x618b('0x6b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x31dbd1['query'][_0x618b('0x60')][_0x56cbe3]),'OpenchannelQueueId':Number(_0x31dbd1[_0x618b('0x47')]['id'])});}}else{socket[_0x618b('0x6b')](_0x618b('0x83'),{'UserId':Number(_0x31dbd1[_0x618b('0x36')][_0x618b('0x60')]),'OpenchannelQueueId':Number(_0x31dbd1[_0x618b('0x47')]['id'])});}});}})[_0x618b('0x24')](respondWithStatusCode(_0x5dcbc5,null))[_0x618b('0x45')](handleError(_0x5dcbc5,null));};exports['getAgents']=function(_0x428daa,_0x44255e,_0x56e69c){var _0x4a81e7={};var _0x1b5fdd={};var _0x4bacad;var _0xb5bd2d;return db[_0x618b('0x2e')]['findOne']({'where':{'id':_0x428daa[_0x618b('0x47')]['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x44255e,null))[_0x618b('0x24')](function(_0x2dd0a7){if(_0x2dd0a7){_0x4bacad=_0x2dd0a7;_0x1b5fdd[_0x618b('0x33')]=_[_0x618b('0x34')](db['User']['rawAttributes']);_0x1b5fdd[_0x618b('0x36')]=_[_0x618b('0x34')](_0x428daa[_0x618b('0x36')]);_0x1b5fdd[_0x618b('0x3e')]=_[_0x618b('0x35')](_0x1b5fdd[_0x618b('0x33')],_0x1b5fdd[_0x618b('0x36')]);_0x4a81e7[_0x618b('0x37')]=_[_0x618b('0x35')](_0x1b5fdd[_0x618b('0x33')],qs[_0x618b('0x38')](_0x428daa[_0x618b('0x36')][_0x618b('0x38')]));_0x4a81e7[_0x618b('0x37')]=_0x4a81e7[_0x618b('0x37')][_0x618b('0x39')]?_0x4a81e7[_0x618b('0x37')]:_0x1b5fdd[_0x618b('0x33')];_0x4a81e7[_0x618b('0x3b')]=qs['sort'](_0x428daa[_0x618b('0x36')][_0x618b('0x3c')]);_0x4a81e7['where']=qs[_0x618b('0x3e')](_[_0x618b('0x3f')](_0x428daa[_0x618b('0x36')],_0x1b5fdd[_0x618b('0x3e')]));if(_0x428daa['query'][_0x618b('0x42')]){_0x4a81e7[_0x618b('0x3d')]=_[_0x618b('0x40')](_0x4a81e7['where'],{'$or':_[_0x618b('0x2d')](_0x4a81e7[_0x618b('0x37')],function(_0x3354ae){var _0x39aca2={};_0x39aca2[_0x3354ae]={'$like':'%'+_0x428daa['query']['filter']+'%'};return _0x39aca2;})});}_0x4a81e7=_['merge']({},_0x4a81e7,_0x428daa[_0x618b('0x43')]);return _0x4bacad['getAgents'](_0x4a81e7);}})['then'](function(_0x30477f){if(_0x30477f){_0xb5bd2d=_0x30477f[_0x618b('0x39')];if(!_0x428daa[_0x618b('0x36')][_0x618b('0x3a')](_0x618b('0x54'))){_0x4a81e7[_0x618b('0x20')]=qs[_0x618b('0x20')](_0x428daa[_0x618b('0x36')][_0x618b('0x20')]);_0x4a81e7[_0x618b('0x1d')]=qs[_0x618b('0x1d')](_0x428daa['query']['offset']);}return _0x4bacad[_0x618b('0x87')](_0x4a81e7);}})[_0x618b('0x24')](function(_0x42962e){if(_0x42962e){return _0x42962e?{'count':_0xb5bd2d,'rows':_0x42962e}:null;}})[_0x618b('0x24')](respondWithResult(_0x44255e,null))['catch'](handleError(_0x44255e,null));};
\ No newline at end of file
index 3517bed..496649c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc47f=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0xc47f,0xf5));var _0xfc47=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xc47f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require(_0xfc47('0x0'));var OpenchannelQueue=require(_0xfc47('0x1'))['db'][_0xfc47('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xfc47('0x3')](0x0);var events={'afterCreate':_0xfc47('0x4'),'afterUpdate':_0xfc47('0x5'),'afterDestroy':_0xfc47('0x6')};function emitEvent(_0x319856){return function(_0x4f8814,_0x19f195,_0x2a1277){OpenchannelQueueEvents[_0xfc47('0x7')](_0x319856+':'+_0x4f8814['id'],_0x4f8814);OpenchannelQueueEvents[_0xfc47('0x7')](_0x319856,_0x4f8814);_0x2a1277(null);};}for(var e in events){if(events[_0xfc47('0x8')](e)){var event=events[e];OpenchannelQueue[_0xfc47('0x9')](e,emitEvent(event));}}module[_0xfc47('0xa')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xaac3=['events','../../mysqldb','remove','emit','hasOwnProperty','hook'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xaac3,0x102));var _0x3aac=function(_0x5d11af,_0x105daf){_0x5d11af=_0x5d11af-0x0;var _0x3ca491=_0xaac3[_0x5d11af];return _0x3ca491;};'use strict';var EventEmitter=require(_0x3aac('0x0'));var OpenchannelQueue=require(_0x3aac('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3aac('0x2')};function emitEvent(_0x161208){return function(_0x2165fa,_0x4ff852,_0x3f0a22){OpenchannelQueueEvents[_0x3aac('0x3')](_0x161208+':'+_0x2165fa['id'],_0x2165fa);OpenchannelQueueEvents[_0x3aac('0x3')](_0x161208,_0x2165fa);_0x3f0a22(null);};}for(var e in events){if(events[_0x3aac('0x4')](e)){var event=events[e];OpenchannelQueue[_0x3aac('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index 81a968a..bb8c4c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7ec=['util','../../config/logger','bluebird','request-promise','path','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x3e7842,_0x1f543a){var _0x384272=function(_0x53c830){while(--_0x53c830){_0x3e7842['push'](_0x3e7842['shift']());}};_0x384272(++_0x1f543a);}(_0xa7ec,0x107));var _0xca7e=function(_0x226e69,_0x418992){_0x226e69=_0x226e69-0x0;var _0x3011ce=_0xa7ec[_0x226e69];return _0x3011ce;};'use strict';var _=require(_0xca7e('0x0'));var util=require(_0xca7e('0x1'));var logger=require(_0xca7e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xca7e('0x3'));var rp=require(_0xca7e('0x4'));var fs=require('fs');var path=require(_0xca7e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca7e('0x6'));module[_0xca7e('0x7')]=function(_0x3dbef4,_0x347607){return _0x3dbef4[_0xca7e('0x8')](_0xca7e('0x9'),attributes,{'tableName':_0xca7e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x47c0=['bluebird','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0x33055e,_0x54dff9){var _0x41dfb4=function(_0x5b4123){while(--_0x5b4123){_0x33055e['push'](_0x33055e['shift']());}};_0x41dfb4(++_0x54dff9);}(_0x47c0,0x97));var _0x047c=function(_0x15fb5b,_0xdab39d){_0x15fb5b=_0x15fb5b-0x0;var _0x10a1a1=_0x47c0[_0x15fb5b];return _0x10a1a1;};'use strict';var _=require(_0x047c('0x0'));var util=require(_0x047c('0x1'));var logger=require(_0x047c('0x2'))(_0x047c('0x3'));var moment=require(_0x047c('0x4'));var BPromise=require(_0x047c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x047c('0x6'));var config=require(_0x047c('0x7'));var attributes=require(_0x047c('0x8'));module[_0x047c('0x9')]=function(_0x5da111,_0x11ddec){return _0x5da111['define'](_0x047c('0xa'),attributes,{'tableName':_0x047c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ca6ad3b..01a8dc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff8=['defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','map','include','model','ShowOpenchannelQueue','find','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x15f523,_0x148436){var _0x59de0d=function(_0x4c2457){while(--_0x4c2457){_0x15f523['push'](_0x15f523['shift']());}};_0x59de0d(++_0x148436);}(_0xfff8,0x1a1));var _0x8fff=function(_0x462d34,_0x30ae52){_0x462d34=_0x462d34-0x0;var _0x9b28b0=_0xfff8[_0x462d34];return _0x9b28b0;};'use strict';var _=require(_0x8fff('0x0'));var util=require(_0x8fff('0x1'));var moment=require('moment');var BPromise=require(_0x8fff('0x2'));var rs=require(_0x8fff('0x3'));var fs=require('fs');var Redis=require(_0x8fff('0x4'));var db=require(_0x8fff('0x5'))['db'];var utils=require(_0x8fff('0x6'));var logger=require(_0x8fff('0x7'))(_0x8fff('0x8'));var config=require(_0x8fff('0x9'));var jayson=require(_0x8fff('0xa'));var client=jayson['client'][_0x8fff('0xb')]({'port':0x232a});config[_0x8fff('0xc')]=_[_0x8fff('0xd')](config[_0x8fff('0xc')],{'host':_0x8fff('0xe'),'port':0x18eb});var socket=require(_0x8fff('0xf'))(new Redis(config[_0x8fff('0xc')]));require(_0x8fff('0x10'))[_0x8fff('0x11')](socket);function respondWithRpcPromise(_0x3927e6,_0x91c01c,_0x4869d){return new BPromise(function(_0x45c0e3,_0x197217){return client[_0x8fff('0x12')](_0x3927e6,_0x4869d)[_0x8fff('0x13')](function(_0x3aafa2){logger[_0x8fff('0x14')](_0x8fff('0x15'),_0x91c01c,_0x8fff('0x16'));logger[_0x8fff('0x17')](_0x8fff('0x18'),_0x91c01c,_0x8fff('0x16'),JSON[_0x8fff('0x19')](_0x3aafa2));if(_0x3aafa2[_0x8fff('0x1a')]){if(_0x3aafa2['error'][_0x8fff('0x1b')]===0x1f4){logger[_0x8fff('0x1a')](_0x8fff('0x15'),_0x91c01c,_0x3aafa2[_0x8fff('0x1a')][_0x8fff('0x1c')]);return _0x197217(_0x3aafa2[_0x8fff('0x1a')][_0x8fff('0x1c')]);}logger[_0x8fff('0x1a')](_0x8fff('0x15'),_0x91c01c,_0x3aafa2[_0x8fff('0x1a')][_0x8fff('0x1c')]);return _0x45c0e3(_0x3aafa2['error'][_0x8fff('0x1c')]);}else{logger[_0x8fff('0x14')](_0x8fff('0x15'),_0x91c01c,_0x8fff('0x16'));_0x45c0e3(_0x3aafa2[_0x8fff('0x1d')]['message']);}})['catch'](function(_0xe3f792){logger[_0x8fff('0x1a')](_0x8fff('0x15'),_0x91c01c,_0xe3f792);_0x197217(_0xe3f792);});});}exports[_0x8fff('0x1e')]=function(_0x432e20){var _0x34d482=this;return new Promise(function(_0xa1dba6,_0x538147){return db[_0x8fff('0x1f')]['findAll']({'raw':_0x432e20[_0x8fff('0x20')]?_0x432e20[_0x8fff('0x20')][_0x8fff('0x21')]===undefined?!![]:![]:!![],'where':_0x432e20[_0x8fff('0x20')]?_0x432e20[_0x8fff('0x20')][_0x8fff('0x22')]||null:null,'attributes':_0x432e20['options']?_0x432e20[_0x8fff('0x20')][_0x8fff('0x23')]||null:null,'limit':_0x432e20[_0x8fff('0x20')]?_0x432e20[_0x8fff('0x20')][_0x8fff('0x24')]||null:null,'include':_0x432e20[_0x8fff('0x20')]?_0x432e20[_0x8fff('0x20')]['include']?_[_0x8fff('0x25')](_0x432e20[_0x8fff('0x20')][_0x8fff('0x26')],function(_0x2af521){return{'model':db[_0x2af521[_0x8fff('0x27')]],'as':_0x2af521['as'],'attributes':_0x2af521[_0x8fff('0x23')],'include':_0x2af521[_0x8fff('0x26')]?_[_0x8fff('0x25')](_0x2af521[_0x8fff('0x26')],function(_0x1e25f4){return{'model':db[_0x1e25f4[_0x8fff('0x27')]],'as':_0x1e25f4['as'],'attributes':_0x1e25f4[_0x8fff('0x23')],'include':_0x1e25f4[_0x8fff('0x26')]?_[_0x8fff('0x25')](_0x1e25f4[_0x8fff('0x26')],function(_0x4dd175){return{'model':db[_0x4dd175[_0x8fff('0x27')]],'as':_0x4dd175['as'],'attributes':_0x4dd175[_0x8fff('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8fff('0x13')](function(_0x49c289){logger[_0x8fff('0x14')](_0x8fff('0x1e'),_0x432e20);logger[_0x8fff('0x17')](_0x8fff('0x1e'),_0x432e20,JSON[_0x8fff('0x19')](_0x49c289));_0xa1dba6(_0x49c289);})['catch'](function(_0x17ac7e){logger['error'](_0x8fff('0x1e'),_0x17ac7e[_0x8fff('0x1c')],_0x432e20);_0x538147(_0x34d482[_0x8fff('0x1a')](0x1f4,_0x17ac7e[_0x8fff('0x1c')]));});});};exports[_0x8fff('0x28')]=function(_0x43f90d){var _0x3a5004=this;return new Promise(function(_0x1e106f,_0x21fbc7){return db[_0x8fff('0x1f')][_0x8fff('0x29')]({'raw':_0x43f90d[_0x8fff('0x20')]?_0x43f90d['options'][_0x8fff('0x21')]===undefined?!![]:![]:!![],'where':_0x43f90d[_0x8fff('0x20')]?_0x43f90d[_0x8fff('0x20')][_0x8fff('0x22')]||null:null,'attributes':_0x43f90d[_0x8fff('0x20')]?_0x43f90d[_0x8fff('0x20')]['attributes']||null:null,'include':_0x43f90d[_0x8fff('0x20')]?_0x43f90d[_0x8fff('0x20')]['include']?_[_0x8fff('0x25')](_0x43f90d[_0x8fff('0x20')][_0x8fff('0x26')],function(_0x174d3d){return{'model':db[_0x174d3d[_0x8fff('0x27')]],'as':_0x174d3d['as'],'attributes':_0x174d3d[_0x8fff('0x23')],'include':_0x174d3d[_0x8fff('0x26')]?_[_0x8fff('0x25')](_0x174d3d[_0x8fff('0x26')],function(_0x2333a4){return{'model':db[_0x2333a4[_0x8fff('0x27')]],'as':_0x2333a4['as'],'attributes':_0x2333a4['attributes'],'include':_0x2333a4['include']?_[_0x8fff('0x25')](_0x2333a4['include'],function(_0x339c4b){return{'model':db[_0x339c4b[_0x8fff('0x27')]],'as':_0x339c4b['as'],'attributes':_0x339c4b[_0x8fff('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8fff('0x13')](function(_0x1b475f){logger[_0x8fff('0x14')](_0x8fff('0x28'),_0x43f90d);logger[_0x8fff('0x17')](_0x8fff('0x28'),_0x43f90d,JSON[_0x8fff('0x19')](_0x1b475f));_0x1e106f(_0x1b475f);})[_0x8fff('0x2a')](function(_0x5261d8){logger[_0x8fff('0x1a')](_0x8fff('0x28'),_0x5261d8[_0x8fff('0x1c')],_0x43f90d);_0x21fbc7(_0x3a5004[_0x8fff('0x1a')](0x1f4,_0x5261d8[_0x8fff('0x1c')]));});});};
\ No newline at end of file
+var _0x2188=['GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','model','ShowOpenchannelQueue','find','raw','map','then','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x150f28,_0x303c14){var _0x4f3998=function(_0x473ce4){while(--_0x473ce4){_0x150f28['push'](_0x150f28['shift']());}};_0x4f3998(++_0x303c14);}(_0x2188,0x1d2));var _0x8218=function(_0x25bafe,_0xa87491){_0x25bafe=_0x25bafe-0x0;var _0x3a5407=_0x2188[_0x25bafe];return _0x3a5407;};'use strict';var _=require(_0x8218('0x0'));var util=require(_0x8218('0x1'));var moment=require(_0x8218('0x2'));var BPromise=require('bluebird');var rs=require(_0x8218('0x3'));var fs=require('fs');var Redis=require(_0x8218('0x4'));var db=require(_0x8218('0x5'))['db'];var utils=require(_0x8218('0x6'));var logger=require(_0x8218('0x7'))(_0x8218('0x8'));var config=require('../../config/environment');var jayson=require(_0x8218('0x9'));var client=jayson['client'][_0x8218('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8218('0xb')],{'host':_0x8218('0xc'),'port':0x18eb});var socket=require(_0x8218('0xd'))(new Redis(config[_0x8218('0xb')]));require(_0x8218('0xe'))[_0x8218('0xf')](socket);function respondWithRpcPromise(_0x563a01,_0x435fac,_0x295acd){return new BPromise(function(_0x3d7f2d,_0x43cffb){return client[_0x8218('0x10')](_0x563a01,_0x295acd)['then'](function(_0x261d0f){logger['info'](_0x8218('0x11'),_0x435fac,_0x8218('0x12'));logger[_0x8218('0x13')](_0x8218('0x14'),_0x435fac,_0x8218('0x12'),JSON[_0x8218('0x15')](_0x261d0f));if(_0x261d0f['error']){if(_0x261d0f[_0x8218('0x16')][_0x8218('0x17')]===0x1f4){logger[_0x8218('0x16')](_0x8218('0x11'),_0x435fac,_0x261d0f['error'][_0x8218('0x18')]);return _0x43cffb(_0x261d0f['error'][_0x8218('0x18')]);}logger['error'](_0x8218('0x11'),_0x435fac,_0x261d0f[_0x8218('0x16')][_0x8218('0x18')]);return _0x3d7f2d(_0x261d0f[_0x8218('0x16')][_0x8218('0x18')]);}else{logger['info'](_0x8218('0x11'),_0x435fac,_0x8218('0x12'));_0x3d7f2d(_0x261d0f['result'][_0x8218('0x18')]);}})[_0x8218('0x19')](function(_0x2e6b68){logger['error'](_0x8218('0x11'),_0x435fac,_0x2e6b68);_0x43cffb(_0x2e6b68);});});}exports[_0x8218('0x1a')]=function(_0x34903d){var _0x530a78=this;return new Promise(function(_0x16f2ae,_0x38a1a2){return db[_0x8218('0x1b')][_0x8218('0x1c')]({'raw':_0x34903d[_0x8218('0x1d')]?_0x34903d[_0x8218('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x34903d['options']?_0x34903d[_0x8218('0x1d')][_0x8218('0x1e')]||null:null,'attributes':_0x34903d['options']?_0x34903d[_0x8218('0x1d')][_0x8218('0x1f')]||null:null,'limit':_0x34903d[_0x8218('0x1d')]?_0x34903d[_0x8218('0x1d')][_0x8218('0x20')]||null:null,'include':_0x34903d[_0x8218('0x1d')]?_0x34903d['options'][_0x8218('0x21')]?_['map'](_0x34903d['options']['include'],function(_0x29f33c){return{'model':db[_0x29f33c[_0x8218('0x22')]],'as':_0x29f33c['as'],'attributes':_0x29f33c['attributes'],'include':_0x29f33c['include']?_['map'](_0x29f33c[_0x8218('0x21')],function(_0x3c6f6e){return{'model':db[_0x3c6f6e[_0x8218('0x22')]],'as':_0x3c6f6e['as'],'attributes':_0x3c6f6e['attributes'],'include':_0x3c6f6e[_0x8218('0x21')]?_['map'](_0x3c6f6e['include'],function(_0x150d5f){return{'model':db[_0x150d5f['model']],'as':_0x150d5f['as'],'attributes':_0x150d5f[_0x8218('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc00e69){logger['info'](_0x8218('0x1a'),_0x34903d);logger[_0x8218('0x13')](_0x8218('0x1a'),_0x34903d,JSON[_0x8218('0x15')](_0xc00e69));_0x16f2ae(_0xc00e69);})[_0x8218('0x19')](function(_0x3e27e3){logger['error']('GetOpenchannelQueue',_0x3e27e3[_0x8218('0x18')],_0x34903d);_0x38a1a2(_0x530a78[_0x8218('0x16')](0x1f4,_0x3e27e3['message']));});});};exports[_0x8218('0x23')]=function(_0x348de5){var _0x269df3=this;return new Promise(function(_0x18ee9d,_0x2f8fba){return db[_0x8218('0x1b')][_0x8218('0x24')]({'raw':_0x348de5[_0x8218('0x1d')]?_0x348de5['options'][_0x8218('0x25')]===undefined?!![]:![]:!![],'where':_0x348de5[_0x8218('0x1d')]?_0x348de5[_0x8218('0x1d')]['where']||null:null,'attributes':_0x348de5[_0x8218('0x1d')]?_0x348de5[_0x8218('0x1d')]['attributes']||null:null,'include':_0x348de5[_0x8218('0x1d')]?_0x348de5['options'][_0x8218('0x21')]?_['map'](_0x348de5[_0x8218('0x1d')][_0x8218('0x21')],function(_0x276722){return{'model':db[_0x276722['model']],'as':_0x276722['as'],'attributes':_0x276722[_0x8218('0x1f')],'include':_0x276722[_0x8218('0x21')]?_['map'](_0x276722[_0x8218('0x21')],function(_0x32ebee){return{'model':db[_0x32ebee[_0x8218('0x22')]],'as':_0x32ebee['as'],'attributes':_0x32ebee[_0x8218('0x1f')],'include':_0x32ebee[_0x8218('0x21')]?_[_0x8218('0x26')](_0x32ebee['include'],function(_0x1cb718){return{'model':db[_0x1cb718['model']],'as':_0x1cb718['as'],'attributes':_0x1cb718['attributes']};}):[]};}):[]};}):[]:[]})[_0x8218('0x27')](function(_0x12ab88){logger[_0x8218('0x28')](_0x8218('0x23'),_0x348de5);logger[_0x8218('0x13')](_0x8218('0x23'),_0x348de5,JSON[_0x8218('0x15')](_0x12ab88));_0x18ee9d(_0x12ab88);})[_0x8218('0x19')](function(_0xd8b2e2){logger[_0x8218('0x16')]('ShowOpenchannelQueue',_0xd8b2e2['message'],_0x348de5);_0x2f8fba(_0x269df3[_0x8218('0x16')](0x1f4,_0xd8b2e2[_0x8218('0x18')]));});});};
\ No newline at end of file
index bc3fcc8..cc6efb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e5c=['remove','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x5b72ef,_0x48c7e0){var _0x26bbc5=function(_0x36625){while(--_0x36625){_0x5b72ef['push'](_0x5b72ef['shift']());}};_0x26bbc5(++_0x48c7e0);}(_0x4e5c,0x149));var _0xc4e5=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x4e5c[_0x5cb1af];return _0x8d7940;};'use strict';var OpenchannelQueueEvents=require(_0xc4e5('0x0'));var events=['save',_0xc4e5('0x1'),'update'];function createListener(_0x31e94d,_0x27a49f){return function(_0x253810){_0x27a49f['emit'](_0x31e94d,_0x253810);};}function removeListener(_0x4cd665,_0x4ecd96){return function(){OpenchannelQueueEvents[_0xc4e5('0x2')](_0x4cd665,_0x4ecd96);};}exports[_0xc4e5('0x3')]=function(_0x3b4b2c){for(var _0x81444b=0x0,_0x36da95=events[_0xc4e5('0x4')];_0x81444b<_0x36da95;_0x81444b++){var _0x40c9df=events[_0x81444b];var _0x3fb6b7=createListener(_0xc4e5('0x5')+_0x40c9df,_0x3b4b2c);OpenchannelQueueEvents['on'](_0x40c9df,_0x3fb6b7);}};
\ No newline at end of file
+var _0x82ae=['openchannelQueue:','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82ae,0x1b7));var _0xe82a=function(_0x200858,_0x4ef46a){_0x200858=_0x200858-0x0;var _0xef3753=_0x82ae[_0x200858];return _0xef3753;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xe82a('0x0'),_0xe82a('0x1')];function createListener(_0x45d2f1,_0x5567b3){return function(_0x3a34b0){_0x5567b3[_0xe82a('0x2')](_0x45d2f1,_0x3a34b0);};}function removeListener(_0x3d1e77,_0x3819a3){return function(){OpenchannelQueueEvents['removeListener'](_0x3d1e77,_0x3819a3);};}exports[_0xe82a('0x3')]=function(_0x40d837){for(var _0x527e69=0x0,_0x5abb8f=events[_0xe82a('0x4')];_0x527e69<_0x5abb8f;_0x527e69++){var _0x6a01b1=events[_0x527e69];var _0x4fe037=createListener(_0xe82a('0x5')+_0x6a01b1,_0x40d837);OpenchannelQueueEvents['on'](_0x6a01b1,_0x4fe037);}};
\ No newline at end of file
index 2ffc0a9..bcca706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1f8=['get','isAuthenticated','index','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./openchannelQueueReport.controller'];(function(_0x133c95,_0x1c083e){var _0x8b3ebf=function(_0x7ebba){while(--_0x7ebba){_0x133c95['push'](_0x133c95['shift']());}};_0x8b3ebf(++_0x1c083e);}(_0xe1f8,0xf4));var _0x8e1f=function(_0x305a13,_0x6f39d0){_0x305a13=_0x305a13-0x0;var _0x58fb01=_0xe1f8[_0x305a13];return _0x58fb01;};'use strict';var multer=require(_0x8e1f('0x0'));var util=require(_0x8e1f('0x1'));var path=require(_0x8e1f('0x2'));var timeout=require(_0x8e1f('0x3'));var express=require('express');var router=express[_0x8e1f('0x4')]();var fs_extra=require(_0x8e1f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e1f('0x6'));var config=require('../../config/environment');var controller=require(_0x8e1f('0x7'));router[_0x8e1f('0x8')]('/',auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xa')]);router[_0x8e1f('0x8')]('/describe',auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xb')]);router[_0x8e1f('0x8')](_0x8e1f('0xc'),auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xd')]);router[_0x8e1f('0xe')]('/',auth['isAuthenticated'](),controller[_0x8e1f('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8e1f('0x10')](_0x8e1f('0xc'),auth[_0x8e1f('0x9')](),controller['destroy']);module[_0x8e1f('0x11')]=router;
\ No newline at end of file
+var _0xe609=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xe609,0xf0));var _0x9e60=function(_0x4576b7,_0x50057b){_0x4576b7=_0x4576b7-0x0;var _0x3a81e0=_0xe609[_0x4576b7];return _0x3a81e0;};'use strict';var multer=require(_0x9e60('0x0'));var util=require(_0x9e60('0x1'));var path=require(_0x9e60('0x2'));var timeout=require(_0x9e60('0x3'));var express=require(_0x9e60('0x4'));var router=express[_0x9e60('0x5')]();var fs_extra=require(_0x9e60('0x6'));var auth=require(_0x9e60('0x7'));var interaction=require(_0x9e60('0x8'));var config=require(_0x9e60('0x9'));var controller=require(_0x9e60('0xa'));router[_0x9e60('0xb')]('/',auth[_0x9e60('0xc')](),controller[_0x9e60('0xd')]);router[_0x9e60('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x9e60('0xe'),auth[_0x9e60('0xc')](),controller[_0x9e60('0xf')]);router[_0x9e60('0x10')]('/',auth[_0x9e60('0xc')](),controller['create']);router[_0x9e60('0x11')](_0x9e60('0xe'),auth[_0x9e60('0xc')](),controller[_0x9e60('0x12')]);router[_0x9e60('0x13')]('/:id',auth[_0x9e60('0xc')](),controller[_0x9e60('0x14')]);module[_0x9e60('0x15')]=router;
\ No newline at end of file
index 51f8dbf..9dd85ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6c5=['DATE','moment','STRING'];(function(_0x2ae9a6,_0x30528a){var _0x322947=function(_0x54c0d7){while(--_0x54c0d7){_0x2ae9a6['push'](_0x2ae9a6['shift']());}};_0x322947(++_0x30528a);}(_0xe6c5,0x67));var _0x5e6c=function(_0x44bd4f,_0x3648d0){_0x44bd4f=_0x44bd4f-0x0;var _0x2a7cfd=_0xe6c5[_0x44bd4f];return _0x2a7cfd;};'use strict';var moment=require(_0x5e6c('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5e6c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5e6c('0x1')]},'joinAt':{'type':Sequelize[_0x5e6c('0x2')]},'leaveAt':{'type':Sequelize[_0x5e6c('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5e6c('0x2')]},'reason':{'type':Sequelize[_0x5e6c('0x1')]}};
\ No newline at end of file
+var _0xe313=['sequelize','exports','STRING','DATE','moment'];(function(_0x39e7d0,_0xd3e3c0){var _0x33180a=function(_0x14878d){while(--_0x14878d){_0x39e7d0['push'](_0x39e7d0['shift']());}};_0x33180a(++_0xd3e3c0);}(_0xe313,0xe5));var _0x3e31=function(_0x13348a,_0x7a6e2d){_0x13348a=_0x13348a-0x0;var _0x5d71c9=_0xe313[_0x13348a];return _0x5d71c9;};'use strict';var moment=require(_0x3e31('0x0'));var Sequelize=require(_0x3e31('0x1'));module[_0x3e31('0x2')]={'uniqueid':{'type':Sequelize[_0x3e31('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3e31('0x3')]},'joinAt':{'type':Sequelize[_0x3e31('0x4')]},'leaveAt':{'type':Sequelize[_0x3e31('0x4')]},'acceptAt':{'type':Sequelize[_0x3e31('0x4')]},'exitAt':{'type':Sequelize[_0x3e31('0x4')]},'reason':{'type':Sequelize[_0x3e31('0x3')]}};
\ No newline at end of file
index 161efc1..5154404 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a24=['fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','OpenchannelQueueReport','findAll','rows','keys','find','catch','create','body','update','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','name','index','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes'];(function(_0x10c90b,_0x44a52a){var _0x4eaa71=function(_0x23c1c9){while(--_0x23c1c9){_0x10c90b['push'](_0x10c90b['shift']());}};_0x4eaa71(++_0x44a52a);}(_0x4a24,0x106));var _0x44a2=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x4a24[_0x5756c6];return _0x4b5806;};'use strict';var emlformat=require(_0x44a2('0x0'));var rimraf=require(_0x44a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44a2('0x2'));var rp=require(_0x44a2('0x3'));var moment=require(_0x44a2('0x4'));var BPromise=require(_0x44a2('0x5'));var Mustache=require(_0x44a2('0x6'));var util=require('util');var path=require(_0x44a2('0x7'));var sox=require(_0x44a2('0x8'));var csv=require(_0x44a2('0x9'));var ejs=require(_0x44a2('0xa'));var fs=require('fs');var fs_extra=require(_0x44a2('0xb'));var _=require(_0x44a2('0xc'));var squel=require(_0x44a2('0xd'));var crypto=require(_0x44a2('0xe'));var jsforce=require(_0x44a2('0xf'));var deskjs=require(_0x44a2('0x10'));var toCsv=require(_0x44a2('0x9'));var querystring=require(_0x44a2('0x11'));var Papa=require(_0x44a2('0x12'));var Redis=require('ioredis');var authService=require(_0x44a2('0x13'));var qs=require(_0x44a2('0x14'));var as=require(_0x44a2('0x15'));var hardwareService=require(_0x44a2('0x16'));var logger=require(_0x44a2('0x17'))(_0x44a2('0x18'));var utils=require(_0x44a2('0x19'));var config=require(_0x44a2('0x1a'));var licenseUtil=require(_0x44a2('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cf8a0,_0x219e6c){_0x219e6c=_0x219e6c||0xcc;return function(_0x3ec651){if(_0x3ec651){return _0x3cf8a0[_0x44a2('0x1c')](_0x219e6c);}return _0x3cf8a0[_0x44a2('0x1d')](_0x219e6c)[_0x44a2('0x1e')]();};}function respondWithResult(_0x1ee6fe,_0x35965f){_0x35965f=_0x35965f||0xc8;return function(_0x313af8){if(_0x313af8){return _0x1ee6fe[_0x44a2('0x1d')](_0x35965f)['json'](_0x313af8);}};}function respondWithFilteredResult(_0x16d95e,_0x3bc18f){return function(_0x1afbac){if(_0x1afbac){var _0x43e300=typeof _0x3bc18f[_0x44a2('0x1f')]===_0x44a2('0x20')&&typeof _0x3bc18f[_0x44a2('0x21')]==='undefined';var _0x437ad5=_0x1afbac[_0x44a2('0x22')];var _0x5e85e4=_0x43e300?0x0:_0x3bc18f[_0x44a2('0x1f')];var _0x552d08=_0x43e300?_0x1afbac[_0x44a2('0x22')]:_0x3bc18f[_0x44a2('0x1f')]+_0x3bc18f[_0x44a2('0x21')];var _0x42739f;if(_0x552d08>=_0x437ad5){_0x552d08=_0x437ad5;_0x42739f=0xc8;}else{_0x42739f=0xce;}_0x16d95e[_0x44a2('0x1d')](_0x42739f);return _0x16d95e[_0x44a2('0x23')](_0x44a2('0x24'),_0x5e85e4+'-'+_0x552d08+'/'+_0x437ad5)[_0x44a2('0x25')](_0x1afbac);}return null;};}function patchUpdates(_0x505121){return function(_0xb19bf8){try{jsonpatch[_0x44a2('0x26')](_0xb19bf8,_0x505121,!![]);}catch(_0x15510a){return BPromise[_0x44a2('0x27')](_0x15510a);}return _0xb19bf8[_0x44a2('0x28')]();};}function saveUpdates(_0xcf5183,_0x1e5d8e){return function(_0x35b778){if(_0x35b778){return _0x35b778['update'](_0xcf5183)[_0x44a2('0x29')](function(_0x19741d){return _0x19741d;});}return null;};}function removeEntity(_0x1f26f9,_0x1f0d9b){return function(_0x5286af){if(_0x5286af){return _0x5286af['destroy']()[_0x44a2('0x29')](function(){_0x1f26f9[_0x44a2('0x1d')](0xcc)[_0x44a2('0x1e')]();});}};}function handleEntityNotFound(_0xd8451d,_0x34ecb2){return function(_0x28ee91){if(!_0x28ee91){_0xd8451d[_0x44a2('0x1c')](0x194);}return _0x28ee91;};}function handleError(_0x1ef9b8,_0x48aab3){_0x48aab3=_0x48aab3||0x1f4;return function(_0x30a739){logger[_0x44a2('0x2a')](_0x30a739['stack']);if(_0x30a739[_0x44a2('0x2b')]){delete _0x30a739[_0x44a2('0x2b')];}_0x1ef9b8[_0x44a2('0x1d')](_0x48aab3)['send'](_0x30a739);};}exports[_0x44a2('0x2c')]=function(_0x18cc45,_0x34419f){var _0xf11ff2={},_0x4bf56e={},_0x4af4a0={'count':0x0,'rows':[]};var _0x203a9a=_['map'](db['OpenchannelQueueReport'][_0x44a2('0x2d')],function(_0x5a0733){return{'name':_0x5a0733[_0x44a2('0x2e')],'type':_0x5a0733[_0x44a2('0x2f')][_0x44a2('0x30')]};});_0x4bf56e[_0x44a2('0x31')]=_[_0x44a2('0x32')](_0x203a9a,'name');_0x4bf56e[_0x44a2('0x33')]=_['keys'](_0x18cc45[_0x44a2('0x33')]);_0x4bf56e['filters']=_[_0x44a2('0x34')](_0x4bf56e['model'],_0x4bf56e[_0x44a2('0x33')]);_0xf11ff2[_0x44a2('0x35')]=_[_0x44a2('0x34')](_0x4bf56e[_0x44a2('0x31')],qs[_0x44a2('0x36')](_0x18cc45[_0x44a2('0x33')][_0x44a2('0x36')]));_0xf11ff2[_0x44a2('0x35')]=_0xf11ff2['attributes'][_0x44a2('0x37')]?_0xf11ff2[_0x44a2('0x35')]:_0x4bf56e[_0x44a2('0x31')];if(!_0x18cc45[_0x44a2('0x33')]['hasOwnProperty'](_0x44a2('0x38'))){_0xf11ff2[_0x44a2('0x21')]=qs[_0x44a2('0x21')](_0x18cc45[_0x44a2('0x33')][_0x44a2('0x21')]);_0xf11ff2[_0x44a2('0x1f')]=qs[_0x44a2('0x1f')](_0x18cc45['query'][_0x44a2('0x1f')]);}_0xf11ff2[_0x44a2('0x39')]=qs['sort'](_0x18cc45[_0x44a2('0x33')][_0x44a2('0x3a')]);_0xf11ff2[_0x44a2('0x3b')]=qs[_0x44a2('0x3c')](_[_0x44a2('0x3d')](_0x18cc45['query'],_0x4bf56e[_0x44a2('0x3c')]),_0x203a9a);if(_0x18cc45[_0x44a2('0x33')]['filter']){_0xf11ff2[_0x44a2('0x3b')]=_[_0x44a2('0x3e')](_0xf11ff2['where'],{'$or':_['map'](_0x203a9a,function(_0x4597a8){if(_0x4597a8[_0x44a2('0x2f')]!==_0x44a2('0x3f')){var _0x17c921={};_0x17c921[_0x4597a8[_0x44a2('0x2b')]]={'$like':'%'+_0x18cc45[_0x44a2('0x33')][_0x44a2('0x40')]+'%'};return _0x17c921;}})});}_0xf11ff2=_[_0x44a2('0x3e')]({},_0xf11ff2,_0x18cc45[_0x44a2('0x41')]);var _0x5b0c2b={'where':_0xf11ff2[_0x44a2('0x3b')]};return db['OpenchannelQueueReport'][_0x44a2('0x22')](_0x5b0c2b)['then'](function(_0x107b02){_0x4af4a0[_0x44a2('0x22')]=_0x107b02;if(_0x18cc45[_0x44a2('0x33')][_0x44a2('0x42')]){_0xf11ff2[_0x44a2('0x43')]=[{'all':!![]}];}return db[_0x44a2('0x44')][_0x44a2('0x45')](_0xf11ff2);})[_0x44a2('0x29')](function(_0x4fbc23){_0x4af4a0[_0x44a2('0x46')]=_0x4fbc23;return _0x4af4a0;})['then'](respondWithFilteredResult(_0x34419f,_0xf11ff2))['catch'](handleError(_0x34419f,null));};exports['show']=function(_0x6f41e4,_0x875967){var _0x3b0ab4={'raw':!![],'where':{'id':_0x6f41e4['params']['id']}},_0xd884c0={};_0xd884c0[_0x44a2('0x31')]=_['keys'](db['OpenchannelQueueReport'][_0x44a2('0x2d')]);_0xd884c0[_0x44a2('0x33')]=_[_0x44a2('0x47')](_0x6f41e4['query']);_0xd884c0[_0x44a2('0x3c')]=_[_0x44a2('0x34')](_0xd884c0[_0x44a2('0x31')],_0xd884c0[_0x44a2('0x33')]);_0x3b0ab4[_0x44a2('0x35')]=_[_0x44a2('0x34')](_0xd884c0[_0x44a2('0x31')],qs[_0x44a2('0x36')](_0x6f41e4[_0x44a2('0x33')][_0x44a2('0x36')]));_0x3b0ab4[_0x44a2('0x35')]=_0x3b0ab4[_0x44a2('0x35')][_0x44a2('0x37')]?_0x3b0ab4['attributes']:_0xd884c0['model'];if(_0x6f41e4[_0x44a2('0x33')][_0x44a2('0x42')]){_0x3b0ab4[_0x44a2('0x43')]=[{'all':!![]}];}_0x3b0ab4=_[_0x44a2('0x3e')]({},_0x3b0ab4,_0x6f41e4[_0x44a2('0x41')]);return db['OpenchannelQueueReport'][_0x44a2('0x48')](_0x3b0ab4)['then'](handleEntityNotFound(_0x875967,null))[_0x44a2('0x29')](respondWithResult(_0x875967,null))[_0x44a2('0x49')](handleError(_0x875967,null));};exports[_0x44a2('0x4a')]=function(_0x30bc6e,_0x35be22){return db[_0x44a2('0x44')][_0x44a2('0x4a')](_0x30bc6e[_0x44a2('0x4b')],{})[_0x44a2('0x29')](respondWithResult(_0x35be22,0xc9))[_0x44a2('0x49')](handleError(_0x35be22,null));};exports[_0x44a2('0x4c')]=function(_0x1179e1,_0x3bfd0a){if(_0x1179e1[_0x44a2('0x4b')]['id']){delete _0x1179e1[_0x44a2('0x4b')]['id'];}return db['OpenchannelQueueReport'][_0x44a2('0x48')]({'where':{'id':_0x1179e1[_0x44a2('0x4d')]['id']}})[_0x44a2('0x29')](handleEntityNotFound(_0x3bfd0a,null))[_0x44a2('0x29')](saveUpdates(_0x1179e1[_0x44a2('0x4b')],null))[_0x44a2('0x29')](respondWithResult(_0x3bfd0a,null))['catch'](handleError(_0x3bfd0a,null));};exports[_0x44a2('0x4e')]=function(_0x1f4c80,_0x3a1169){return db[_0x44a2('0x44')][_0x44a2('0x48')]({'where':{'id':_0x1f4c80[_0x44a2('0x4d')]['id']}})[_0x44a2('0x29')](handleEntityNotFound(_0x3a1169,null))['then'](removeEntity(_0x3a1169,null))['catch'](handleError(_0x3a1169,null));};exports['describe']=function(_0x1b7de9,_0xc69f7e){return db[_0x44a2('0x44')]['describe']()[_0x44a2('0x29')](respondWithResult(_0xc69f7e,null))[_0x44a2('0x49')](handleError(_0xc69f7e,null));};
\ No newline at end of file
+var _0x31e3=['../../mysqldb','status','end','offset','limit','undefined','count','set','json','apply','save','destroy','then','sendStatus','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','hasOwnProperty','order','where','pick','filter','merge','includeAll','include','catch','show','keys','fields','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x31e3,0x13d));var _0x331e=function(_0x5cce95,_0x3b8c5c){_0x5cce95=_0x5cce95-0x0;var _0xc0f440=_0x31e3[_0x5cce95];return _0xc0f440;};'use strict';var emlformat=require(_0x331e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x331e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x331e('0x2'));var moment=require(_0x331e('0x3'));var BPromise=require(_0x331e('0x4'));var Mustache=require('mustache');var util=require(_0x331e('0x5'));var path=require('path');var sox=require(_0x331e('0x6'));var csv=require(_0x331e('0x7'));var ejs=require(_0x331e('0x8'));var fs=require('fs');var fs_extra=require(_0x331e('0x9'));var _=require(_0x331e('0xa'));var squel=require(_0x331e('0xb'));var crypto=require('crypto');var jsforce=require(_0x331e('0xc'));var deskjs=require(_0x331e('0xd'));var toCsv=require(_0x331e('0x7'));var querystring=require(_0x331e('0xe'));var Papa=require(_0x331e('0xf'));var Redis=require('ioredis');var authService=require(_0x331e('0x10'));var qs=require(_0x331e('0x11'));var as=require(_0x331e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x331e('0x13'));var utils=require(_0x331e('0x14'));var config=require(_0x331e('0x15'));var licenseUtil=require(_0x331e('0x16'));var db=require(_0x331e('0x17'))['db'];function respondWithStatusCode(_0x1e8798,_0x3ce78d){_0x3ce78d=_0x3ce78d||0xcc;return function(_0xe94122){if(_0xe94122){return _0x1e8798['sendStatus'](_0x3ce78d);}return _0x1e8798[_0x331e('0x18')](_0x3ce78d)[_0x331e('0x19')]();};}function respondWithResult(_0x5a11d9,_0x9fbe8d){_0x9fbe8d=_0x9fbe8d||0xc8;return function(_0x513db8){if(_0x513db8){return _0x5a11d9[_0x331e('0x18')](_0x9fbe8d)['json'](_0x513db8);}};}function respondWithFilteredResult(_0x2d3e68,_0x3863ea){return function(_0x108b9c){if(_0x108b9c){var _0x41ad3f=typeof _0x3863ea[_0x331e('0x1a')]==='undefined'&&typeof _0x3863ea[_0x331e('0x1b')]===_0x331e('0x1c');var _0x2ce298=_0x108b9c[_0x331e('0x1d')];var _0x3c928a=_0x41ad3f?0x0:_0x3863ea['offset'];var _0x3d14f5=_0x41ad3f?_0x108b9c[_0x331e('0x1d')]:_0x3863ea['offset']+_0x3863ea[_0x331e('0x1b')];var _0x2b1056;if(_0x3d14f5>=_0x2ce298){_0x3d14f5=_0x2ce298;_0x2b1056=0xc8;}else{_0x2b1056=0xce;}_0x2d3e68[_0x331e('0x18')](_0x2b1056);return _0x2d3e68[_0x331e('0x1e')]('Content-Range',_0x3c928a+'-'+_0x3d14f5+'/'+_0x2ce298)[_0x331e('0x1f')](_0x108b9c);}return null;};}function patchUpdates(_0x282be9){return function(_0xeb06cf){try{jsonpatch[_0x331e('0x20')](_0xeb06cf,_0x282be9,!![]);}catch(_0x22e0f9){return BPromise['reject'](_0x22e0f9);}return _0xeb06cf[_0x331e('0x21')]();};}function saveUpdates(_0x43ecb5,_0x4b4996){return function(_0xfd512c){if(_0xfd512c){return _0xfd512c['update'](_0x43ecb5)['then'](function(_0x1d12e6){return _0x1d12e6;});}return null;};}function removeEntity(_0x316194,_0x47d8fc){return function(_0x30d768){if(_0x30d768){return _0x30d768[_0x331e('0x22')]()[_0x331e('0x23')](function(){_0x316194['status'](0xcc)[_0x331e('0x19')]();});}};}function handleEntityNotFound(_0x5752e7,_0x2a4974){return function(_0x1dc300){if(!_0x1dc300){_0x5752e7[_0x331e('0x24')](0x194);}return _0x1dc300;};}function handleError(_0x271fd7,_0x5c65a0){_0x5c65a0=_0x5c65a0||0x1f4;return function(_0x1993b2){logger['error'](_0x1993b2[_0x331e('0x25')]);if(_0x1993b2[_0x331e('0x26')]){delete _0x1993b2[_0x331e('0x26')];}_0x271fd7[_0x331e('0x18')](_0x5c65a0)['send'](_0x1993b2);};}exports[_0x331e('0x27')]=function(_0x3d84bf,_0x3fe423){var _0x4890f8={},_0x31978a={},_0x371bfe={'count':0x0,'rows':[]};var _0x4092df=_[_0x331e('0x28')](db[_0x331e('0x29')][_0x331e('0x2a')],function(_0x5f1a91){return{'name':_0x5f1a91[_0x331e('0x2b')],'type':_0x5f1a91[_0x331e('0x2c')]['key']};});_0x31978a['model']=_[_0x331e('0x28')](_0x4092df,_0x331e('0x26'));_0x31978a[_0x331e('0x2d')]=_['keys'](_0x3d84bf[_0x331e('0x2d')]);_0x31978a[_0x331e('0x2e')]=_[_0x331e('0x2f')](_0x31978a[_0x331e('0x30')],_0x31978a['query']);_0x4890f8[_0x331e('0x31')]=_[_0x331e('0x2f')](_0x31978a[_0x331e('0x30')],qs['fields'](_0x3d84bf['query']['fields']));_0x4890f8[_0x331e('0x31')]=_0x4890f8['attributes'][_0x331e('0x32')]?_0x4890f8[_0x331e('0x31')]:_0x31978a[_0x331e('0x30')];if(!_0x3d84bf[_0x331e('0x2d')][_0x331e('0x33')]('nolimit')){_0x4890f8[_0x331e('0x1b')]=qs[_0x331e('0x1b')](_0x3d84bf[_0x331e('0x2d')][_0x331e('0x1b')]);_0x4890f8[_0x331e('0x1a')]=qs[_0x331e('0x1a')](_0x3d84bf[_0x331e('0x2d')]['offset']);}_0x4890f8[_0x331e('0x34')]=qs['sort'](_0x3d84bf[_0x331e('0x2d')]['sort']);_0x4890f8[_0x331e('0x35')]=qs[_0x331e('0x2e')](_[_0x331e('0x36')](_0x3d84bf[_0x331e('0x2d')],_0x31978a[_0x331e('0x2e')]),_0x4092df);if(_0x3d84bf['query'][_0x331e('0x37')]){_0x4890f8['where']=_[_0x331e('0x38')](_0x4890f8[_0x331e('0x35')],{'$or':_[_0x331e('0x28')](_0x4092df,function(_0x5538d1){if(_0x5538d1[_0x331e('0x2c')]!=='VIRTUAL'){var _0xf2fdb5={};_0xf2fdb5[_0x5538d1['name']]={'$like':'%'+_0x3d84bf[_0x331e('0x2d')][_0x331e('0x37')]+'%'};return _0xf2fdb5;}})});}_0x4890f8=_[_0x331e('0x38')]({},_0x4890f8,_0x3d84bf['options']);var _0x40025c={'where':_0x4890f8[_0x331e('0x35')]};return db[_0x331e('0x29')][_0x331e('0x1d')](_0x40025c)[_0x331e('0x23')](function(_0x4618fe){_0x371bfe['count']=_0x4618fe;if(_0x3d84bf[_0x331e('0x2d')][_0x331e('0x39')]){_0x4890f8[_0x331e('0x3a')]=[{'all':!![]}];}return db[_0x331e('0x29')]['findAll'](_0x4890f8);})['then'](function(_0xec5bf3){_0x371bfe['rows']=_0xec5bf3;return _0x371bfe;})[_0x331e('0x23')](respondWithFilteredResult(_0x3fe423,_0x4890f8))[_0x331e('0x3b')](handleError(_0x3fe423,null));};exports[_0x331e('0x3c')]=function(_0x583414,_0x5519f1){var _0xd84002={'raw':!![],'where':{'id':_0x583414['params']['id']}},_0x124abc={};_0x124abc[_0x331e('0x30')]=_[_0x331e('0x3d')](db['OpenchannelQueueReport']['rawAttributes']);_0x124abc['query']=_[_0x331e('0x3d')](_0x583414[_0x331e('0x2d')]);_0x124abc[_0x331e('0x2e')]=_['intersection'](_0x124abc[_0x331e('0x30')],_0x124abc[_0x331e('0x2d')]);_0xd84002[_0x331e('0x31')]=_[_0x331e('0x2f')](_0x124abc[_0x331e('0x30')],qs[_0x331e('0x3e')](_0x583414[_0x331e('0x2d')][_0x331e('0x3e')]));_0xd84002[_0x331e('0x31')]=_0xd84002[_0x331e('0x31')][_0x331e('0x32')]?_0xd84002[_0x331e('0x31')]:_0x124abc['model'];if(_0x583414[_0x331e('0x2d')][_0x331e('0x39')]){_0xd84002[_0x331e('0x3a')]=[{'all':!![]}];}_0xd84002=_['merge']({},_0xd84002,_0x583414['options']);return db[_0x331e('0x29')][_0x331e('0x3f')](_0xd84002)[_0x331e('0x23')](handleEntityNotFound(_0x5519f1,null))[_0x331e('0x23')](respondWithResult(_0x5519f1,null))[_0x331e('0x3b')](handleError(_0x5519f1,null));};exports[_0x331e('0x40')]=function(_0x584c1f,_0x293dff){return db[_0x331e('0x29')][_0x331e('0x40')](_0x584c1f[_0x331e('0x41')],{})[_0x331e('0x23')](respondWithResult(_0x293dff,0xc9))[_0x331e('0x3b')](handleError(_0x293dff,null));};exports['update']=function(_0xe781cf,_0x51b3a4){if(_0xe781cf[_0x331e('0x41')]['id']){delete _0xe781cf[_0x331e('0x41')]['id'];}return db['OpenchannelQueueReport'][_0x331e('0x3f')]({'where':{'id':_0xe781cf[_0x331e('0x42')]['id']}})[_0x331e('0x23')](handleEntityNotFound(_0x51b3a4,null))['then'](saveUpdates(_0xe781cf['body'],null))[_0x331e('0x23')](respondWithResult(_0x51b3a4,null))['catch'](handleError(_0x51b3a4,null));};exports[_0x331e('0x22')]=function(_0x12f8fa,_0x47871e){return db[_0x331e('0x29')]['find']({'where':{'id':_0x12f8fa[_0x331e('0x42')]['id']}})[_0x331e('0x23')](handleEntityNotFound(_0x47871e,null))[_0x331e('0x23')](removeEntity(_0x47871e,null))[_0x331e('0x3b')](handleError(_0x47871e,null));};exports['describe']=function(_0xbb39ca,_0x5395bc){return db[_0x331e('0x29')][_0x331e('0x43')]()[_0x331e('0x23')](respondWithResult(_0x5395bc,null))['catch'](handleError(_0x5395bc,null));};
\ No newline at end of file
index a3d347e..fd388ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x814b,0x1a2));var _0xb814=function(_0x48a928,_0x430727){_0x48a928=_0x48a928-0x0;var _0x11c1e9=_0x814b[_0x48a928];return _0x11c1e9;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0xfb0281,_0x3ff38b){var _0x408dd3=function(_0x5d8017){while(--_0x5d8017){_0xfb0281['push'](_0xfb0281['shift']());}};_0x408dd3(++_0x3ff38b);}(_0x814b,0x1a2));var _0xb814=function(_0x347399,_0x42bbda){_0x347399=_0x347399-0x0;var _0x24e7be=_0x814b[_0x347399];return _0x24e7be;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 7c79ad5..b907430 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f59=['raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','then','debug','stringify','catch','update'];(function(_0x30b3fa,_0x244b65){var _0x11d163=function(_0x41d15c){while(--_0x41d15c){_0x30b3fa['push'](_0x30b3fa['shift']());}};_0x11d163(++_0x244b65);}(_0x8f59,0x11d));var _0x98f5=function(_0x1e37be,_0x405f43){_0x1e37be=_0x1e37be-0x0;var _0x749eca=_0x8f59[_0x1e37be];return _0x749eca;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2acf,_0x5869ee,_0x5e91b3){return new BPromise(function(_0x109417,_0x1cd8a8){return client[_0x98f5('0xc')](_0x2e2acf,_0x5e91b3)['then'](function(_0x456329){logger[_0x98f5('0xd')](_0x98f5('0xe'),_0x5869ee,_0x98f5('0xf'));logger['debug'](_0x98f5('0x10'),_0x5869ee,'request\x20sent',JSON['stringify'](_0x456329));if(_0x456329[_0x98f5('0x11')]){if(_0x456329[_0x98f5('0x11')]['code']===0x1f4){logger[_0x98f5('0x11')](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);return _0x1cd8a8(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}logger['error'](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')]['message']);return _0x109417(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}else{logger[_0x98f5('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5869ee,_0x98f5('0xf'));_0x109417(_0x456329[_0x98f5('0x13')][_0x98f5('0x12')]);}})['catch'](function(_0x440cfa){logger[_0x98f5('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5869ee,_0x440cfa);_0x1cd8a8(_0x440cfa);});});}exports[_0x98f5('0x14')]=function(_0x51a567){var _0x10c57c=this;return new Promise(function(_0x9e42dd,_0x2291d5){return db[_0x98f5('0x15')][_0x98f5('0x16')](_0x51a567[_0x98f5('0x17')],{'raw':_0x51a567['options']?_0x51a567[_0x98f5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x98f5('0x19')](function(_0x191f23){logger['info'](_0x98f5('0x14'),_0x51a567);logger[_0x98f5('0x1a')](_0x98f5('0x14'),_0x51a567,JSON[_0x98f5('0x1b')](_0x191f23));_0x9e42dd(_0x191f23);})[_0x98f5('0x1c')](function(_0x3dc7c2){logger[_0x98f5('0x11')]('CreateOpenchannelQueueReport',_0x3dc7c2[_0x98f5('0x12')],_0x51a567);_0x2291d5(_0x10c57c['error'](0x1f4,_0x3dc7c2[_0x98f5('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x44bfbb){var _0x40c69b=this;return new Promise(function(_0x106b24,_0x5c64e){return db[_0x98f5('0x15')][_0x98f5('0x1d')](_0x44bfbb[_0x98f5('0x17')],{'raw':_0x44bfbb['options']?_0x44bfbb[_0x98f5('0x18')][_0x98f5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44bfbb['options']?_0x44bfbb[_0x98f5('0x18')][_0x98f5('0x1f')]||null:null,'attributes':_0x44bfbb[_0x98f5('0x18')]?_0x44bfbb[_0x98f5('0x18')][_0x98f5('0x20')]||null:null,'limit':_0x44bfbb[_0x98f5('0x18')]?_0x44bfbb[_0x98f5('0x18')][_0x98f5('0x21')]||null:null})['then'](function(_0x4c10b8){logger[_0x98f5('0xd')](_0x98f5('0x22'),_0x44bfbb);logger[_0x98f5('0x1a')](_0x98f5('0x22'),_0x44bfbb,JSON[_0x98f5('0x1b')](_0x4c10b8));_0x106b24(_0x4c10b8);})[_0x98f5('0x1c')](function(_0x5e9d73){logger[_0x98f5('0x11')](_0x98f5('0x22'),_0x5e9d73[_0x98f5('0x12')],_0x44bfbb);_0x5c64e(_0x40c69b[_0x98f5('0x11')](0x1f4,_0x5e9d73[_0x98f5('0x12')]));});});};
\ No newline at end of file
+var _0x2b65=['jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','stringify','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x2b65,0x131));var _0x52b6=function(_0xf9b7a3,_0x2a66f4){_0xf9b7a3=_0xf9b7a3-0x0;var _0x25f0a2=_0x2b65[_0xf9b7a3];return _0x25f0a2;};'use strict';var _=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var moment=require(_0x52b6('0x2'));var BPromise=require(_0x52b6('0x3'));var rs=require(_0x52b6('0x4'));var fs=require('fs');var Redis=require(_0x52b6('0x5'));var db=require(_0x52b6('0x6'))['db'];var utils=require(_0x52b6('0x7'));var logger=require('../../config/logger')(_0x52b6('0x8'));var config=require(_0x52b6('0x9'));var jayson=require(_0x52b6('0xa'));var client=jayson[_0x52b6('0xb')][_0x52b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d451f,_0x70579,_0x1af78f){return new BPromise(function(_0x432726,_0x27c5b9){return client['request'](_0x2d451f,_0x1af78f)[_0x52b6('0xd')](function(_0x1c2cb5){logger[_0x52b6('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x70579,_0x52b6('0xf'));logger[_0x52b6('0x10')](_0x52b6('0x11'),_0x70579,_0x52b6('0xf'),JSON['stringify'](_0x1c2cb5));if(_0x1c2cb5[_0x52b6('0x12')]){if(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x13')]===0x1f4){logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')]['message']);return _0x27c5b9(_0x1c2cb5[_0x52b6('0x12')]['message']);}logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);return _0x432726(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);}else{logger[_0x52b6('0xe')](_0x52b6('0x14'),_0x70579,_0x52b6('0xf'));_0x432726(_0x1c2cb5[_0x52b6('0x16')][_0x52b6('0x15')]);}})[_0x52b6('0x17')](function(_0x307594){logger[_0x52b6('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x70579,_0x307594);_0x27c5b9(_0x307594);});});}exports[_0x52b6('0x18')]=function(_0x2fa3ed){var _0x9bab0a=this;return new Promise(function(_0x47d203,_0x36d376){return db[_0x52b6('0x19')]['create'](_0x2fa3ed['body'],{'raw':_0x2fa3ed[_0x52b6('0x1a')]?_0x2fa3ed['options'][_0x52b6('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2e472f){logger[_0x52b6('0xe')](_0x52b6('0x18'),_0x2fa3ed);logger[_0x52b6('0x10')]('CreateOpenchannelQueueReport',_0x2fa3ed,JSON[_0x52b6('0x1c')](_0x2e472f));_0x47d203(_0x2e472f);})[_0x52b6('0x17')](function(_0x1246db){logger[_0x52b6('0x12')](_0x52b6('0x18'),_0x1246db[_0x52b6('0x15')],_0x2fa3ed);_0x36d376(_0x9bab0a[_0x52b6('0x12')](0x1f4,_0x1246db[_0x52b6('0x15')]));});});};exports[_0x52b6('0x1d')]=function(_0x55aa4c){var _0x2a97c0=this;return new Promise(function(_0x2ff6f4,_0x3a2fb0){return db[_0x52b6('0x19')][_0x52b6('0x1e')](_0x55aa4c[_0x52b6('0x1f')],{'raw':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x20')]||null:null,'attributes':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x21')]||null:null,'limit':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c['options'][_0x52b6('0x22')]||null:null})[_0x52b6('0xd')](function(_0x1716b6){logger[_0x52b6('0xe')](_0x52b6('0x1d'),_0x55aa4c);logger[_0x52b6('0x10')](_0x52b6('0x1d'),_0x55aa4c,JSON['stringify'](_0x1716b6));_0x2ff6f4(_0x1716b6);})[_0x52b6('0x17')](function(_0x42ac9b){logger['error'](_0x52b6('0x1d'),_0x42ac9b[_0x52b6('0x15')],_0x55aa4c);_0x3a2fb0(_0x2a97c0[_0x52b6('0x12')](0x1f4,_0x42ac9b[_0x52b6('0x15')]));});});};
\ No newline at end of file
index 1d52eaf..4dae7b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e3d=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9e3d,0x80));var _0xd9e3=function(_0x542114,_0x36face){_0x542114=_0x542114-0x0;var _0x5b7f41=_0x9e3d[_0x542114];return _0x5b7f41;};'use strict';var multer=require(_0xd9e3('0x0'));var util=require(_0xd9e3('0x1'));var path=require(_0xd9e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9e3('0x3'));var router=express[_0xd9e3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd9e3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd9e3('0x6'));router[_0xd9e3('0x7')]('/',auth[_0xd9e3('0x8')](),controller[_0xd9e3('0x9')]);router[_0xd9e3('0x7')](_0xd9e3('0xa'),auth[_0xd9e3('0x8')](),controller[_0xd9e3('0xb')]);router[_0xd9e3('0x7')](_0xd9e3('0xc'),auth[_0xd9e3('0x8')](),controller[_0xd9e3('0xd')]);router[_0xd9e3('0xe')]('/',auth[_0xd9e3('0x8')](),controller[_0xd9e3('0xf')]);router['put'](_0xd9e3('0xc'),auth[_0xd9e3('0x8')](),controller[_0xd9e3('0x10')]);router[_0xd9e3('0x11')]('/:id',auth[_0xd9e3('0x8')](),controller[_0xd9e3('0x12')]);module[_0xd9e3('0x13')]=router;
\ No newline at end of file
+var _0x2de1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2de1,0x89));var _0x12de=function(_0x32cd01,_0x591d5d){_0x32cd01=_0x32cd01-0x0;var _0x44d819=_0x2de1[_0x32cd01];return _0x44d819;};'use strict';var multer=require(_0x12de('0x0'));var util=require(_0x12de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x12de('0x2'));var router=express['Router']();var fs_extra=require(_0x12de('0x3'));var auth=require(_0x12de('0x4'));var interaction=require(_0x12de('0x5'));var config=require(_0x12de('0x6'));var controller=require(_0x12de('0x7'));router['get']('/',auth[_0x12de('0x8')](),controller[_0x12de('0x9')]);router[_0x12de('0xa')](_0x12de('0xb'),auth['isAuthenticated'](),controller[_0x12de('0xc')]);router['get'](_0x12de('0xd'),auth[_0x12de('0x8')](),controller[_0x12de('0xe')]);router[_0x12de('0xf')]('/',auth[_0x12de('0x8')](),controller['create']);router['put'](_0x12de('0xd'),auth[_0x12de('0x8')](),controller[_0x12de('0x10')]);router[_0x12de('0x11')](_0x12de('0xd'),auth[_0x12de('0x8')](),controller[_0x12de('0x12')]);module[_0x12de('0x13')]=router;
\ No newline at end of file
index 323dc60..010434c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x38e08b,_0x4ac41f){var _0x1f611a=function(_0x12d390){while(--_0x12d390){_0x38e08b['push'](_0x38e08b['shift']());}};_0x1f611a(++_0x4ac41f);}(_0xedd9,0xfc));var _0x9edd=function(_0x18f074,_0x41b2c0){_0x18f074=_0x18f074-0x0;var _0x24832a=_0xedd9[_0x18f074];return _0x24832a;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x37cc47,_0x127615){var _0x460104=function(_0x253c09){while(--_0x253c09){_0x37cc47['push'](_0x37cc47['shift']());}};_0x460104(++_0x127615);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0xcb91[_0x40b493];return _0x548365;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
index 9af5956..d32cbe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fa4=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','show','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','map','rawAttributes','fieldName','type','model','name','query','filters','attributes','intersection','fields'];(function(_0x17605a,_0x286ddb){var _0x1b89d8=function(_0x322132){while(--_0x322132){_0x17605a['push'](_0x17605a['shift']());}};_0x1b89d8(++_0x286ddb);}(_0x2fa4,0xfa));var _0x42fa=function(_0x5e8142,_0x46c327){_0x5e8142=_0x5e8142-0x0;var _0x279813=_0x2fa4[_0x5e8142];return _0x279813;};'use strict';var emlformat=require(_0x42fa('0x0'));var rimraf=require(_0x42fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42fa('0x2'));var rp=require(_0x42fa('0x3'));var moment=require(_0x42fa('0x4'));var BPromise=require(_0x42fa('0x5'));var Mustache=require(_0x42fa('0x6'));var util=require(_0x42fa('0x7'));var path=require(_0x42fa('0x8'));var sox=require(_0x42fa('0x9'));var csv=require(_0x42fa('0xa'));var ejs=require(_0x42fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x42fa('0xc'));var jsforce=require(_0x42fa('0xd'));var deskjs=require(_0x42fa('0xe'));var toCsv=require(_0x42fa('0xa'));var querystring=require(_0x42fa('0xf'));var Papa=require(_0x42fa('0x10'));var Redis=require(_0x42fa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x42fa('0x12'));var as=require(_0x42fa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42fa('0x14'))(_0x42fa('0x15'));var utils=require(_0x42fa('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x42fa('0x17'));var db=require(_0x42fa('0x18'))['db'];function respondWithStatusCode(_0x3c6da6,_0x356c51){_0x356c51=_0x356c51||0xcc;return function(_0x241ca4){if(_0x241ca4){return _0x3c6da6[_0x42fa('0x19')](_0x356c51);}return _0x3c6da6[_0x42fa('0x1a')](_0x356c51)[_0x42fa('0x1b')]();};}function respondWithResult(_0x321b7f,_0x503f51){_0x503f51=_0x503f51||0xc8;return function(_0x20d8fb){if(_0x20d8fb){return _0x321b7f[_0x42fa('0x1a')](_0x503f51)[_0x42fa('0x1c')](_0x20d8fb);}};}function respondWithFilteredResult(_0x377fa8,_0x1da42f){return function(_0x2de495){if(_0x2de495){var _0x45b750=typeof _0x1da42f[_0x42fa('0x1d')]==='undefined'&&typeof _0x1da42f[_0x42fa('0x1e')]===_0x42fa('0x1f');var _0x51fb2a=_0x2de495['count'];var _0x3cb444=_0x45b750?0x0:_0x1da42f[_0x42fa('0x1d')];var _0x502629=_0x45b750?_0x2de495[_0x42fa('0x20')]:_0x1da42f[_0x42fa('0x1d')]+_0x1da42f[_0x42fa('0x1e')];var _0x105bbd;if(_0x502629>=_0x51fb2a){_0x502629=_0x51fb2a;_0x105bbd=0xc8;}else{_0x105bbd=0xce;}_0x377fa8[_0x42fa('0x1a')](_0x105bbd);return _0x377fa8[_0x42fa('0x21')](_0x42fa('0x22'),_0x3cb444+'-'+_0x502629+'/'+_0x51fb2a)[_0x42fa('0x1c')](_0x2de495);}return null;};}function patchUpdates(_0x3a8aa0){return function(_0x2a041d){try{jsonpatch[_0x42fa('0x23')](_0x2a041d,_0x3a8aa0,!![]);}catch(_0x5804bc){return BPromise[_0x42fa('0x24')](_0x5804bc);}return _0x2a041d[_0x42fa('0x25')]();};}function saveUpdates(_0x3a319a,_0x3fb38b){return function(_0x425f2f){if(_0x425f2f){return _0x425f2f[_0x42fa('0x26')](_0x3a319a)[_0x42fa('0x27')](function(_0x55a7db){return _0x55a7db;});}return null;};}function removeEntity(_0x31d804,_0x288097){return function(_0x1c5132){if(_0x1c5132){return _0x1c5132[_0x42fa('0x28')]()[_0x42fa('0x27')](function(){_0x31d804[_0x42fa('0x1a')](0xcc)[_0x42fa('0x1b')]();});}};}function handleEntityNotFound(_0x2a6f42,_0x177867){return function(_0x46a254){if(!_0x46a254){_0x2a6f42['sendStatus'](0x194);}return _0x46a254;};}function handleError(_0x36dad9,_0x27c10f){_0x27c10f=_0x27c10f||0x1f4;return function(_0x574b2d){logger['error'](_0x574b2d[_0x42fa('0x29')]);if(_0x574b2d['name']){delete _0x574b2d['name'];}_0x36dad9['status'](_0x27c10f)[_0x42fa('0x2a')](_0x574b2d);};}exports['index']=function(_0x358d5e,_0x4853e1){var _0x307d49={},_0x5a27e3={},_0x273f0f={'count':0x0,'rows':[]};var _0x5df8ff=_[_0x42fa('0x2b')](db['OpenchannelTransferReport'][_0x42fa('0x2c')],function(_0x9d6bdf){return{'name':_0x9d6bdf[_0x42fa('0x2d')],'type':_0x9d6bdf[_0x42fa('0x2e')]['key']};});_0x5a27e3[_0x42fa('0x2f')]=_[_0x42fa('0x2b')](_0x5df8ff,_0x42fa('0x30'));_0x5a27e3['query']=_['keys'](_0x358d5e[_0x42fa('0x31')]);_0x5a27e3[_0x42fa('0x32')]=_['intersection'](_0x5a27e3[_0x42fa('0x2f')],_0x5a27e3['query']);_0x307d49[_0x42fa('0x33')]=_[_0x42fa('0x34')](_0x5a27e3[_0x42fa('0x2f')],qs[_0x42fa('0x35')](_0x358d5e[_0x42fa('0x31')][_0x42fa('0x35')]));_0x307d49['attributes']=_0x307d49[_0x42fa('0x33')][_0x42fa('0x36')]?_0x307d49['attributes']:_0x5a27e3[_0x42fa('0x2f')];if(!_0x358d5e[_0x42fa('0x31')][_0x42fa('0x37')](_0x42fa('0x38'))){_0x307d49[_0x42fa('0x1e')]=qs[_0x42fa('0x1e')](_0x358d5e[_0x42fa('0x31')][_0x42fa('0x1e')]);_0x307d49[_0x42fa('0x1d')]=qs[_0x42fa('0x1d')](_0x358d5e['query'][_0x42fa('0x1d')]);}_0x307d49[_0x42fa('0x39')]=qs['sort'](_0x358d5e[_0x42fa('0x31')][_0x42fa('0x3a')]);_0x307d49[_0x42fa('0x3b')]=qs['filters'](_[_0x42fa('0x3c')](_0x358d5e[_0x42fa('0x31')],_0x5a27e3[_0x42fa('0x32')]),_0x5df8ff);if(_0x358d5e[_0x42fa('0x31')][_0x42fa('0x3d')]){_0x307d49[_0x42fa('0x3b')]=_[_0x42fa('0x3e')](_0x307d49[_0x42fa('0x3b')],{'$or':_[_0x42fa('0x2b')](_0x5df8ff,function(_0x4171e1){if(_0x4171e1['type']!==_0x42fa('0x3f')){var _0x40f424={};_0x40f424[_0x4171e1[_0x42fa('0x30')]]={'$like':'%'+_0x358d5e[_0x42fa('0x31')][_0x42fa('0x3d')]+'%'};return _0x40f424;}})});}_0x307d49=_['merge']({},_0x307d49,_0x358d5e[_0x42fa('0x40')]);var _0x304062={'where':_0x307d49[_0x42fa('0x3b')]};return db[_0x42fa('0x41')]['count'](_0x304062)[_0x42fa('0x27')](function(_0x3c0e7a){_0x273f0f[_0x42fa('0x20')]=_0x3c0e7a;if(_0x358d5e['query'][_0x42fa('0x42')]){_0x307d49[_0x42fa('0x43')]=[{'all':!![]}];}return db[_0x42fa('0x41')][_0x42fa('0x44')](_0x307d49);})[_0x42fa('0x27')](function(_0x9178b8){_0x273f0f['rows']=_0x9178b8;return _0x273f0f;})[_0x42fa('0x27')](respondWithFilteredResult(_0x4853e1,_0x307d49))['catch'](handleError(_0x4853e1,null));};exports[_0x42fa('0x45')]=function(_0x286bde,_0x340501){var _0x1e2a23={'raw':!![],'where':{'id':_0x286bde['params']['id']}},_0x19361f={};_0x19361f[_0x42fa('0x2f')]=_['keys'](db[_0x42fa('0x41')][_0x42fa('0x2c')]);_0x19361f['query']=_['keys'](_0x286bde['query']);_0x19361f[_0x42fa('0x32')]=_[_0x42fa('0x34')](_0x19361f['model'],_0x19361f[_0x42fa('0x31')]);_0x1e2a23[_0x42fa('0x33')]=_[_0x42fa('0x34')](_0x19361f[_0x42fa('0x2f')],qs['fields'](_0x286bde[_0x42fa('0x31')][_0x42fa('0x35')]));_0x1e2a23[_0x42fa('0x33')]=_0x1e2a23['attributes'][_0x42fa('0x36')]?_0x1e2a23['attributes']:_0x19361f[_0x42fa('0x2f')];if(_0x286bde[_0x42fa('0x31')][_0x42fa('0x42')]){_0x1e2a23[_0x42fa('0x43')]=[{'all':!![]}];}_0x1e2a23=_[_0x42fa('0x3e')]({},_0x1e2a23,_0x286bde[_0x42fa('0x40')]);return db[_0x42fa('0x41')][_0x42fa('0x46')](_0x1e2a23)[_0x42fa('0x27')](handleEntityNotFound(_0x340501,null))[_0x42fa('0x27')](respondWithResult(_0x340501,null))[_0x42fa('0x47')](handleError(_0x340501,null));};exports[_0x42fa('0x48')]=function(_0x1cbf12,_0x1f7d5a){return db[_0x42fa('0x41')][_0x42fa('0x48')](_0x1cbf12['body'],{})[_0x42fa('0x27')](respondWithResult(_0x1f7d5a,0xc9))[_0x42fa('0x47')](handleError(_0x1f7d5a,null));};exports[_0x42fa('0x26')]=function(_0x11443b,_0x201b6e){if(_0x11443b['body']['id']){delete _0x11443b[_0x42fa('0x49')]['id'];}return db[_0x42fa('0x41')][_0x42fa('0x46')]({'where':{'id':_0x11443b[_0x42fa('0x4a')]['id']}})[_0x42fa('0x27')](handleEntityNotFound(_0x201b6e,null))[_0x42fa('0x27')](saveUpdates(_0x11443b['body'],null))[_0x42fa('0x27')](respondWithResult(_0x201b6e,null))[_0x42fa('0x47')](handleError(_0x201b6e,null));};exports[_0x42fa('0x28')]=function(_0x1fb903,_0x289d7c){return db[_0x42fa('0x41')][_0x42fa('0x46')]({'where':{'id':_0x1fb903[_0x42fa('0x4a')]['id']}})[_0x42fa('0x27')](handleEntityNotFound(_0x289d7c,null))[_0x42fa('0x27')](removeEntity(_0x289d7c,null))['catch'](handleError(_0x289d7c,null));};exports[_0x42fa('0x4b')]=function(_0x37d636,_0xc5359c){return db[_0x42fa('0x41')]['describe']()[_0x42fa('0x27')](respondWithResult(_0xc5359c,null))['catch'](handleError(_0xc5359c,null));};
\ No newline at end of file
+var _0x32c8=['params','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','OpenchannelTransferReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x4d338b,_0x4439c4){var _0xcaaf07=function(_0x41efd2){while(--_0x41efd2){_0x4d338b['push'](_0x4d338b['shift']());}};_0xcaaf07(++_0x4439c4);}(_0x32c8,0x17c));var _0x832c=function(_0x1664af,_0x4faf0d){_0x1664af=_0x1664af-0x0;var _0x794ed4=_0x32c8[_0x1664af];return _0x794ed4;};'use strict';var emlformat=require(_0x832c('0x0'));var rimraf=require(_0x832c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x832c('0x2'));var rp=require('request-promise');var moment=require(_0x832c('0x3'));var BPromise=require(_0x832c('0x4'));var Mustache=require(_0x832c('0x5'));var util=require(_0x832c('0x6'));var path=require('path');var sox=require(_0x832c('0x7'));var csv=require('to-csv');var ejs=require(_0x832c('0x8'));var fs=require('fs');var fs_extra=require(_0x832c('0x9'));var _=require(_0x832c('0xa'));var squel=require('squel');var crypto=require(_0x832c('0xb'));var jsforce=require(_0x832c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x832c('0xd'));var querystring=require(_0x832c('0xe'));var Papa=require('papaparse');var Redis=require(_0x832c('0xf'));var authService=require(_0x832c('0x10'));var qs=require(_0x832c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x832c('0x12'));var logger=require(_0x832c('0x13'))(_0x832c('0x14'));var utils=require(_0x832c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x832c('0x16'))['db'];function respondWithStatusCode(_0x357573,_0x1afe8f){_0x1afe8f=_0x1afe8f||0xcc;return function(_0x21698f){if(_0x21698f){return _0x357573[_0x832c('0x17')](_0x1afe8f);}return _0x357573[_0x832c('0x18')](_0x1afe8f)[_0x832c('0x19')]();};}function respondWithResult(_0x5466ae,_0x165812){_0x165812=_0x165812||0xc8;return function(_0x6cdeb3){if(_0x6cdeb3){return _0x5466ae[_0x832c('0x18')](_0x165812)[_0x832c('0x1a')](_0x6cdeb3);}};}function respondWithFilteredResult(_0x275434,_0x19256b){return function(_0x3009ce){if(_0x3009ce){var _0x3e80c7=typeof _0x19256b['offset']===_0x832c('0x1b')&&typeof _0x19256b[_0x832c('0x1c')]==='undefined';var _0x277c77=_0x3009ce[_0x832c('0x1d')];var _0x3b4f0e=_0x3e80c7?0x0:_0x19256b[_0x832c('0x1e')];var _0x4bb6e9=_0x3e80c7?_0x3009ce['count']:_0x19256b[_0x832c('0x1e')]+_0x19256b[_0x832c('0x1c')];var _0x388b80;if(_0x4bb6e9>=_0x277c77){_0x4bb6e9=_0x277c77;_0x388b80=0xc8;}else{_0x388b80=0xce;}_0x275434[_0x832c('0x18')](_0x388b80);return _0x275434[_0x832c('0x1f')]('Content-Range',_0x3b4f0e+'-'+_0x4bb6e9+'/'+_0x277c77)[_0x832c('0x1a')](_0x3009ce);}return null;};}function patchUpdates(_0x2baeb9){return function(_0x445f6d){try{jsonpatch[_0x832c('0x20')](_0x445f6d,_0x2baeb9,!![]);}catch(_0x321b00){return BPromise[_0x832c('0x21')](_0x321b00);}return _0x445f6d[_0x832c('0x22')]();};}function saveUpdates(_0x524d30,_0x16609c){return function(_0x51e2fc){if(_0x51e2fc){return _0x51e2fc[_0x832c('0x23')](_0x524d30)[_0x832c('0x24')](function(_0x5c6b18){return _0x5c6b18;});}return null;};}function removeEntity(_0x2cc11e,_0x2c6b58){return function(_0x1a37f9){if(_0x1a37f9){return _0x1a37f9[_0x832c('0x25')]()['then'](function(){_0x2cc11e['status'](0xcc)[_0x832c('0x19')]();});}};}function handleEntityNotFound(_0x33907f,_0x271e61){return function(_0xbe69d){if(!_0xbe69d){_0x33907f[_0x832c('0x17')](0x194);}return _0xbe69d;};}function handleError(_0x738560,_0x469f8c){_0x469f8c=_0x469f8c||0x1f4;return function(_0x2bb85c){logger[_0x832c('0x26')](_0x2bb85c[_0x832c('0x27')]);if(_0x2bb85c['name']){delete _0x2bb85c[_0x832c('0x28')];}_0x738560[_0x832c('0x18')](_0x469f8c)['send'](_0x2bb85c);};}exports[_0x832c('0x29')]=function(_0x37dfb8,_0x447a23){var _0x19332f={},_0x1e3df7={},_0x396622={'count':0x0,'rows':[]};var _0x542b21=_[_0x832c('0x2a')](db[_0x832c('0x2b')]['rawAttributes'],function(_0x5127bc){return{'name':_0x5127bc[_0x832c('0x2c')],'type':_0x5127bc['type'][_0x832c('0x2d')]};});_0x1e3df7[_0x832c('0x2e')]=_['map'](_0x542b21,_0x832c('0x28'));_0x1e3df7[_0x832c('0x2f')]=_[_0x832c('0x30')](_0x37dfb8[_0x832c('0x2f')]);_0x1e3df7[_0x832c('0x31')]=_[_0x832c('0x32')](_0x1e3df7[_0x832c('0x2e')],_0x1e3df7[_0x832c('0x2f')]);_0x19332f[_0x832c('0x33')]=_[_0x832c('0x32')](_0x1e3df7[_0x832c('0x2e')],qs[_0x832c('0x34')](_0x37dfb8[_0x832c('0x2f')][_0x832c('0x34')]));_0x19332f[_0x832c('0x33')]=_0x19332f[_0x832c('0x33')][_0x832c('0x35')]?_0x19332f[_0x832c('0x33')]:_0x1e3df7[_0x832c('0x2e')];if(!_0x37dfb8[_0x832c('0x2f')][_0x832c('0x36')](_0x832c('0x37'))){_0x19332f[_0x832c('0x1c')]=qs[_0x832c('0x1c')](_0x37dfb8[_0x832c('0x2f')][_0x832c('0x1c')]);_0x19332f[_0x832c('0x1e')]=qs[_0x832c('0x1e')](_0x37dfb8[_0x832c('0x2f')][_0x832c('0x1e')]);}_0x19332f[_0x832c('0x38')]=qs[_0x832c('0x39')](_0x37dfb8[_0x832c('0x2f')][_0x832c('0x39')]);_0x19332f[_0x832c('0x3a')]=qs[_0x832c('0x31')](_[_0x832c('0x3b')](_0x37dfb8['query'],_0x1e3df7['filters']),_0x542b21);if(_0x37dfb8[_0x832c('0x2f')][_0x832c('0x3c')]){_0x19332f[_0x832c('0x3a')]=_[_0x832c('0x3d')](_0x19332f[_0x832c('0x3a')],{'$or':_[_0x832c('0x2a')](_0x542b21,function(_0x56e5d6){if(_0x56e5d6[_0x832c('0x3e')]!==_0x832c('0x3f')){var _0x1257d2={};_0x1257d2[_0x56e5d6['name']]={'$like':'%'+_0x37dfb8[_0x832c('0x2f')]['filter']+'%'};return _0x1257d2;}})});}_0x19332f=_[_0x832c('0x3d')]({},_0x19332f,_0x37dfb8[_0x832c('0x40')]);var _0x527c05={'where':_0x19332f['where']};return db[_0x832c('0x2b')]['count'](_0x527c05)[_0x832c('0x24')](function(_0xf8ce44){_0x396622[_0x832c('0x1d')]=_0xf8ce44;if(_0x37dfb8[_0x832c('0x2f')][_0x832c('0x41')]){_0x19332f[_0x832c('0x42')]=[{'all':!![]}];}return db[_0x832c('0x2b')][_0x832c('0x43')](_0x19332f);})[_0x832c('0x24')](function(_0x277127){_0x396622[_0x832c('0x44')]=_0x277127;return _0x396622;})[_0x832c('0x24')](respondWithFilteredResult(_0x447a23,_0x19332f))[_0x832c('0x45')](handleError(_0x447a23,null));};exports['show']=function(_0x5497d7,_0x130aa2){var _0x541837={'raw':!![],'where':{'id':_0x5497d7[_0x832c('0x46')]['id']}},_0x3519cc={};_0x3519cc[_0x832c('0x2e')]=_['keys'](db[_0x832c('0x2b')]['rawAttributes']);_0x3519cc[_0x832c('0x2f')]=_[_0x832c('0x30')](_0x5497d7[_0x832c('0x2f')]);_0x3519cc[_0x832c('0x31')]=_[_0x832c('0x32')](_0x3519cc[_0x832c('0x2e')],_0x3519cc['query']);_0x541837[_0x832c('0x33')]=_[_0x832c('0x32')](_0x3519cc[_0x832c('0x2e')],qs['fields'](_0x5497d7['query'][_0x832c('0x34')]));_0x541837[_0x832c('0x33')]=_0x541837[_0x832c('0x33')]['length']?_0x541837[_0x832c('0x33')]:_0x3519cc['model'];if(_0x5497d7['query']['includeAll']){_0x541837['include']=[{'all':!![]}];}_0x541837=_[_0x832c('0x3d')]({},_0x541837,_0x5497d7[_0x832c('0x40')]);return db[_0x832c('0x2b')][_0x832c('0x47')](_0x541837)[_0x832c('0x24')](handleEntityNotFound(_0x130aa2,null))['then'](respondWithResult(_0x130aa2,null))[_0x832c('0x45')](handleError(_0x130aa2,null));};exports[_0x832c('0x48')]=function(_0x276f34,_0x5a7cf1){return db[_0x832c('0x2b')][_0x832c('0x48')](_0x276f34[_0x832c('0x49')],{})[_0x832c('0x24')](respondWithResult(_0x5a7cf1,0xc9))['catch'](handleError(_0x5a7cf1,null));};exports[_0x832c('0x23')]=function(_0x3154e4,_0x521911){if(_0x3154e4[_0x832c('0x49')]['id']){delete _0x3154e4[_0x832c('0x49')]['id'];}return db[_0x832c('0x2b')][_0x832c('0x47')]({'where':{'id':_0x3154e4['params']['id']}})[_0x832c('0x24')](handleEntityNotFound(_0x521911,null))['then'](saveUpdates(_0x3154e4[_0x832c('0x49')],null))['then'](respondWithResult(_0x521911,null))[_0x832c('0x45')](handleError(_0x521911,null));};exports['destroy']=function(_0x47d2fc,_0x5e4230){return db['OpenchannelTransferReport'][_0x832c('0x47')]({'where':{'id':_0x47d2fc[_0x832c('0x46')]['id']}})[_0x832c('0x24')](handleEntityNotFound(_0x5e4230,null))[_0x832c('0x24')](removeEntity(_0x5e4230,null))[_0x832c('0x45')](handleError(_0x5e4230,null));};exports[_0x832c('0x4a')]=function(_0x33a3c6,_0x5ede23){return db[_0x832c('0x2b')]['describe']()['then'](respondWithResult(_0x5ede23,null))[_0x832c('0x45')](handleError(_0x5ede23,null));};
\ No newline at end of file
index 22add4b..4c95fcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49f8=['path','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','util','api','moment','bluebird','request-promise'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x49f8,0x133));var _0x849f=function(_0x4bfdbd,_0x486709){_0x4bfdbd=_0x4bfdbd-0x0;var _0x1625f5=_0x49f8[_0x4bfdbd];return _0x1625f5;};'use strict';var _=require('lodash');var util=require(_0x849f('0x0'));var logger=require('../../config/logger')(_0x849f('0x1'));var moment=require(_0x849f('0x2'));var BPromise=require(_0x849f('0x3'));var rp=require(_0x849f('0x4'));var fs=require('fs');var path=require(_0x849f('0x5'));var rimraf=require(_0x849f('0x6'));var config=require('../../config/environment');var attributes=require(_0x849f('0x7'));module[_0x849f('0x8')]=function(_0xb9b1d6,_0x191966){return _0xb9b1d6[_0x849f('0x9')](_0x849f('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x849f('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x15a3=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0xd9e622,_0x93d8ca){var _0x19aa69=function(_0x156bee){while(--_0x156bee){_0xd9e622['push'](_0xd9e622['shift']());}};_0x19aa69(++_0x93d8ca);}(_0x15a3,0xf8));var _0x315a=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0x15a3[_0x42bb6d];return _0x1db89b;};'use strict';var _=require(_0x315a('0x0'));var util=require('util');var logger=require(_0x315a('0x1'))(_0x315a('0x2'));var moment=require(_0x315a('0x3'));var BPromise=require(_0x315a('0x4'));var rp=require(_0x315a('0x5'));var fs=require('fs');var path=require(_0x315a('0x6'));var rimraf=require('rimraf');var config=require(_0x315a('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x315a('0x8')]=function(_0x50e39f,_0x285a26){return _0x50e39f[_0x315a('0x9')](_0x315a('0xa'),attributes,{'tableName':_0x315a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x315a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 23bbf1a..969ea62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f05=['client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','message','error','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2a0f1a,_0x21a610){var _0x562e22=function(_0x24f230){while(--_0x24f230){_0x2a0f1a['push'](_0x2a0f1a['shift']());}};_0x562e22(++_0x21a610);}(_0x7f05,0xdc));var _0x57f0=function(_0x4ded6b,_0x19befb){_0x4ded6b=_0x4ded6b-0x0;var _0x26b95b=_0x7f05[_0x4ded6b];return _0x26b95b;};'use strict';var _=require(_0x57f0('0x0'));var util=require(_0x57f0('0x1'));var moment=require(_0x57f0('0x2'));var BPromise=require('bluebird');var rs=require(_0x57f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57f0('0x4'))['db'];var utils=require(_0x57f0('0x5'));var logger=require('../../config/logger')(_0x57f0('0x6'));var config=require(_0x57f0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x57f0('0x8')][_0x57f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4975ec,_0x434121,_0x574a16){return new BPromise(function(_0x3f7ebc,_0x55d417){return client['request'](_0x4975ec,_0x574a16)[_0x57f0('0xa')](function(_0x54bee0){logger[_0x57f0('0xb')](_0x57f0('0xc'),_0x434121,_0x57f0('0xd'));logger[_0x57f0('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x434121,'request\x20sent',JSON[_0x57f0('0xf')](_0x54bee0));if(_0x54bee0['error']){if(_0x54bee0['error']['code']===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x434121,_0x54bee0['error'][_0x57f0('0x10')]);return _0x55d417(_0x54bee0[_0x57f0('0x11')][_0x57f0('0x10')]);}logger[_0x57f0('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x434121,_0x54bee0['error'][_0x57f0('0x10')]);return _0x3f7ebc(_0x54bee0[_0x57f0('0x11')][_0x57f0('0x10')]);}else{logger[_0x57f0('0xb')](_0x57f0('0xc'),_0x434121,_0x57f0('0xd'));_0x3f7ebc(_0x54bee0['result']['message']);}})[_0x57f0('0x12')](function(_0x5be425){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x434121,_0x5be425);_0x55d417(_0x5be425);});});}
\ No newline at end of file
+var _0x7250=['../../config/environment','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e6d2b,_0x16db67){var _0xb57205=function(_0x1aff41){while(--_0x1aff41){_0x1e6d2b['push'](_0x1e6d2b['shift']());}};_0xb57205(++_0x16db67);}(_0x7250,0x1b1));var _0x0725=function(_0x501e4a,_0x1a04d3){_0x501e4a=_0x501e4a-0x0;var _0x16384d=_0x7250[_0x501e4a];return _0x16384d;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var moment=require('moment');var BPromise=require(_0x0725('0x2'));var rs=require(_0x0725('0x3'));var fs=require('fs');var Redis=require(_0x0725('0x4'));var db=require(_0x0725('0x5'))['db'];var utils=require(_0x0725('0x6'));var logger=require(_0x0725('0x7'))('rpc');var config=require(_0x0725('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0725('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b8653,_0x14a2a7,_0x415a9c){return new BPromise(function(_0x49bed0,_0x2f34e5){return client[_0x0725('0xa')](_0x4b8653,_0x415a9c)[_0x0725('0xb')](function(_0xc12c1e){logger[_0x0725('0xc')](_0x0725('0xd'),_0x14a2a7,_0x0725('0xe'));logger['debug'](_0x0725('0xf'),_0x14a2a7,_0x0725('0xe'),JSON[_0x0725('0x10')](_0xc12c1e));if(_0xc12c1e['error']){if(_0xc12c1e['error'][_0x0725('0x11')]===0x1f4){logger[_0x0725('0x12')](_0x0725('0xd'),_0x14a2a7,_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);return _0x2f34e5(_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);}logger[_0x0725('0x12')](_0x0725('0xd'),_0x14a2a7,_0xc12c1e['error'][_0x0725('0x13')]);return _0x49bed0(_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);}else{logger[_0x0725('0xc')](_0x0725('0xd'),_0x14a2a7,_0x0725('0xe'));_0x49bed0(_0xc12c1e['result']['message']);}})[_0x0725('0x14')](function(_0x58777d){logger[_0x0725('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x14a2a7,_0x58777d);_0x2f34e5(_0x58777d);});});}
\ No newline at end of file
index fb1dcd4..d869d51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6ca=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','isAuthenticated'];(function(_0x57171b,_0xfe67c6){var _0x33a2c8=function(_0x31e60d){while(--_0x31e60d){_0x57171b['push'](_0x57171b['shift']());}};_0x33a2c8(++_0xfe67c6);}(_0xe6ca,0x1a7));var _0xae6c=function(_0x4d16b7,_0x312d29){_0x4d16b7=_0x4d16b7-0x0;var _0x336038=_0xe6ca[_0x4d16b7];return _0x336038;};'use strict';var multer=require(_0xae6c('0x0'));var util=require(_0xae6c('0x1'));var path=require(_0xae6c('0x2'));var timeout=require('connect-timeout');var express=require(_0xae6c('0x3'));var router=express[_0xae6c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae6c('0x5'));var interaction=require(_0xae6c('0x6'));var config=require(_0xae6c('0x7'));var controller=require('./pause.controller');router[_0xae6c('0x8')]('/',auth['isAuthenticated'](),controller[_0xae6c('0x9')]);router[_0xae6c('0x8')](_0xae6c('0xa'),auth['isAuthenticated'](),controller[_0xae6c('0xb')]);router[_0xae6c('0xc')]('/',auth[_0xae6c('0xd')](),controller['create']);router[_0xae6c('0xe')](_0xae6c('0xa'),auth[_0xae6c('0xd')](),controller[_0xae6c('0xf')]);router[_0xae6c('0x10')](_0xae6c('0xa'),auth['isAuthenticated'](),controller[_0xae6c('0x11')]);module[_0xae6c('0x12')]=router;
\ No newline at end of file
+var _0x0dc2=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','delete','destroy','exports'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x0dc2,0x1d1));var _0x20dc=function(_0x267ed1,_0x30b548){_0x267ed1=_0x267ed1-0x0;var _0x3cd023=_0x0dc2[_0x267ed1];return _0x3cd023;};'use strict';var multer=require('multer');var util=require(_0x20dc('0x0'));var path=require('path');var timeout=require(_0x20dc('0x1'));var express=require(_0x20dc('0x2'));var router=express['Router']();var fs_extra=require(_0x20dc('0x3'));var auth=require(_0x20dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x20dc('0x5'));var controller=require('./pause.controller');router[_0x20dc('0x6')]('/',auth[_0x20dc('0x7')](),controller[_0x20dc('0x8')]);router['get'](_0x20dc('0x9'),auth[_0x20dc('0x7')](),controller['show']);router[_0x20dc('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x20dc('0xb')](_0x20dc('0x9'),auth[_0x20dc('0x7')](),controller['update']);router[_0x20dc('0xc')](_0x20dc('0x9'),auth[_0x20dc('0x7')](),controller[_0x20dc('0xd')]);module[_0x20dc('0xe')]=router;
\ No newline at end of file
index 1f86212..7a73d42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0ad=['STRING','name','sequelize','exports'];(function(_0x5485ff,_0x3d8be4){var _0x5f0a07=function(_0x13cfeb){while(--_0x13cfeb){_0x5485ff['push'](_0x5485ff['shift']());}};_0x5f0a07(++_0x3d8be4);}(_0xa0ad,0x1aa));var _0xda0a=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0xa0ad[_0x421cf8];return _0x145c48;};'use strict';var Sequelize=require(_0xda0a('0x0'));module[_0xda0a('0x1')]={'name':{'type':Sequelize[_0xda0a('0x2')],'unique':_0xda0a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xda0a('0x2')]}};
\ No newline at end of file
+var _0x50c7=['STRING','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x50c7,0xc7));var _0x750c=function(_0xdbf292,_0x334876){_0xdbf292=_0xdbf292-0x0;var _0x45a542=_0x50c7[_0xdbf292];return _0x45a542;};'use strict';var Sequelize=require(_0x750c('0x0'));module[_0x750c('0x1')]={'name':{'type':Sequelize[_0x750c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x750c('0x2')]}};
\ No newline at end of file
index be8e4b8..37224d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ebb=['model','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','fields','includeAll','find','catch','create','body','user','get','Pauses','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','Pause','rawAttributes','fieldName','type','key'];(function(_0x13a186,_0x3a294b){var _0x55ca3e=function(_0x2dd443){while(--_0x2dd443){_0x13a186['push'](_0x13a186['shift']());}};_0x55ca3e(++_0x3a294b);}(_0x8ebb,0x110));var _0xb8eb=function(_0x32efdc,_0x5d01d2){_0x32efdc=_0x32efdc-0x0;var _0x1ead49=_0x8ebb[_0x32efdc];return _0x1ead49;};'use strict';var emlformat=require(_0xb8eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8eb('0x1'));var jsonpatch=require(_0xb8eb('0x2'));var rp=require('request-promise');var moment=require(_0xb8eb('0x3'));var BPromise=require(_0xb8eb('0x4'));var Mustache=require('mustache');var util=require(_0xb8eb('0x5'));var path=require(_0xb8eb('0x6'));var sox=require(_0xb8eb('0x7'));var csv=require('to-csv');var ejs=require(_0xb8eb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8eb('0x9'));var squel=require(_0xb8eb('0xa'));var crypto=require(_0xb8eb('0xb'));var jsforce=require(_0xb8eb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb8eb('0xd'));var querystring=require(_0xb8eb('0xe'));var Papa=require(_0xb8eb('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb8eb('0x10'));var as=require(_0xb8eb('0x11'));var hardwareService=require(_0xb8eb('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb8eb('0x13'));var config=require(_0xb8eb('0x14'));var licenseUtil=require(_0xb8eb('0x15'));var db=require(_0xb8eb('0x16'))['db'];function respondWithStatusCode(_0x2dd732,_0x8c0344){_0x8c0344=_0x8c0344||0xcc;return function(_0x937c99){if(_0x937c99){return _0x2dd732[_0xb8eb('0x17')](_0x8c0344);}return _0x2dd732[_0xb8eb('0x18')](_0x8c0344)['end']();};}function respondWithResult(_0x41c8a3,_0x1cf3c7){_0x1cf3c7=_0x1cf3c7||0xc8;return function(_0x1cd1cc){if(_0x1cd1cc){return _0x41c8a3['status'](_0x1cf3c7)[_0xb8eb('0x19')](_0x1cd1cc);}};}function respondWithFilteredResult(_0x197acc,_0xe47d3a){return function(_0x1c33e1){if(_0x1c33e1){var _0x2f8016=typeof _0xe47d3a['offset']===_0xb8eb('0x1a')&&typeof _0xe47d3a[_0xb8eb('0x1b')]==='undefined';var _0x2b8b1b=_0x1c33e1[_0xb8eb('0x1c')];var _0x396ae3=_0x2f8016?0x0:_0xe47d3a['offset'];var _0x565d69=_0x2f8016?_0x1c33e1[_0xb8eb('0x1c')]:_0xe47d3a[_0xb8eb('0x1d')]+_0xe47d3a[_0xb8eb('0x1b')];var _0x393c67;if(_0x565d69>=_0x2b8b1b){_0x565d69=_0x2b8b1b;_0x393c67=0xc8;}else{_0x393c67=0xce;}_0x197acc[_0xb8eb('0x18')](_0x393c67);return _0x197acc[_0xb8eb('0x1e')](_0xb8eb('0x1f'),_0x396ae3+'-'+_0x565d69+'/'+_0x2b8b1b)[_0xb8eb('0x19')](_0x1c33e1);}return null;};}function patchUpdates(_0x3ca516){return function(_0x2e71af){try{jsonpatch[_0xb8eb('0x20')](_0x2e71af,_0x3ca516,!![]);}catch(_0xa06758){return BPromise[_0xb8eb('0x21')](_0xa06758);}return _0x2e71af[_0xb8eb('0x22')]();};}function saveUpdates(_0x115b52,_0xa7403e){return function(_0x29c8b1){if(_0x29c8b1){return _0x29c8b1['update'](_0x115b52)[_0xb8eb('0x23')](function(_0x55219e){return _0x55219e;});}return null;};}function removeEntity(_0x46efc0,_0x47c2d4){return function(_0xfde3e9){if(_0xfde3e9){return _0xfde3e9[_0xb8eb('0x24')]()[_0xb8eb('0x23')](function(){var _0x5c424b=_0xfde3e9['get']({'plain':!![]});var _0x4530ed='Pauses';return db['UserProfileResource'][_0xb8eb('0x24')]({'where':{'type':_0x4530ed,'resourceId':_0x5c424b['id']}})[_0xb8eb('0x23')](function(){return _0xfde3e9;});})['then'](function(){_0x46efc0[_0xb8eb('0x18')](0xcc)[_0xb8eb('0x25')]();});}};}function handleEntityNotFound(_0x1f2d3d,_0x353bbe){return function(_0x2af488){if(!_0x2af488){_0x1f2d3d[_0xb8eb('0x17')](0x194);}return _0x2af488;};}function handleError(_0x275dcb,_0x5f5810){_0x5f5810=_0x5f5810||0x1f4;return function(_0x4cd878){logger[_0xb8eb('0x26')](_0x4cd878[_0xb8eb('0x27')]);if(_0x4cd878[_0xb8eb('0x28')]){delete _0x4cd878[_0xb8eb('0x28')];}_0x275dcb[_0xb8eb('0x18')](_0x5f5810)['send'](_0x4cd878);};}exports[_0xb8eb('0x29')]=function(_0x4e4bac,_0x449100){var _0x36188b={},_0x1bf6fe={},_0x4a7580={'count':0x0,'rows':[]};var _0x10178c=_[_0xb8eb('0x2a')](db[_0xb8eb('0x2b')][_0xb8eb('0x2c')],function(_0x598628){return{'name':_0x598628[_0xb8eb('0x2d')],'type':_0x598628[_0xb8eb('0x2e')][_0xb8eb('0x2f')]};});_0x1bf6fe[_0xb8eb('0x30')]=_['map'](_0x10178c,_0xb8eb('0x28'));_0x1bf6fe['query']=_[_0xb8eb('0x31')](_0x4e4bac[_0xb8eb('0x32')]);_0x1bf6fe[_0xb8eb('0x33')]=_[_0xb8eb('0x34')](_0x1bf6fe[_0xb8eb('0x30')],_0x1bf6fe[_0xb8eb('0x32')]);_0x36188b[_0xb8eb('0x35')]=_[_0xb8eb('0x34')](_0x1bf6fe['model'],qs['fields'](_0x4e4bac['query']['fields']));_0x36188b['attributes']=_0x36188b[_0xb8eb('0x35')]['length']?_0x36188b[_0xb8eb('0x35')]:_0x1bf6fe[_0xb8eb('0x30')];if(!_0x4e4bac[_0xb8eb('0x32')][_0xb8eb('0x36')]('nolimit')){_0x36188b['limit']=qs[_0xb8eb('0x1b')](_0x4e4bac['query'][_0xb8eb('0x1b')]);_0x36188b[_0xb8eb('0x1d')]=qs[_0xb8eb('0x1d')](_0x4e4bac[_0xb8eb('0x32')][_0xb8eb('0x1d')]);}_0x36188b[_0xb8eb('0x37')]=qs[_0xb8eb('0x38')](_0x4e4bac[_0xb8eb('0x32')]['sort']);_0x36188b['where']=qs[_0xb8eb('0x33')](_['pick'](_0x4e4bac[_0xb8eb('0x32')],_0x1bf6fe[_0xb8eb('0x33')]),_0x10178c);if(_0x4e4bac[_0xb8eb('0x32')][_0xb8eb('0x39')]){_0x36188b[_0xb8eb('0x3a')]=_['merge'](_0x36188b['where'],{'$or':_[_0xb8eb('0x2a')](_0x10178c,function(_0x1bd671){if(_0x1bd671['type']!==_0xb8eb('0x3b')){var _0x2421ef={};_0x2421ef[_0x1bd671[_0xb8eb('0x28')]]={'$like':'%'+_0x4e4bac[_0xb8eb('0x32')][_0xb8eb('0x39')]+'%'};return _0x2421ef;}})});}_0x36188b=_[_0xb8eb('0x3c')]({},_0x36188b,_0x4e4bac[_0xb8eb('0x3d')]);var _0x355c3e={'where':_0x36188b[_0xb8eb('0x3a')]};return db[_0xb8eb('0x2b')][_0xb8eb('0x1c')](_0x355c3e)[_0xb8eb('0x23')](function(_0xa9a89f){_0x4a7580[_0xb8eb('0x1c')]=_0xa9a89f;if(_0x4e4bac[_0xb8eb('0x32')]['includeAll']){_0x36188b[_0xb8eb('0x3e')]=[{'all':!![]}];}return db['Pause'][_0xb8eb('0x3f')](_0x36188b);})[_0xb8eb('0x23')](function(_0x1a5262){_0x4a7580[_0xb8eb('0x40')]=_0x1a5262;return _0x4a7580;})[_0xb8eb('0x23')](respondWithFilteredResult(_0x449100,_0x36188b))['catch'](handleError(_0x449100,null));};exports[_0xb8eb('0x41')]=function(_0x38e40a,_0x33d577){var _0x552164={'raw':!![],'where':{'id':_0x38e40a['params']['id']}},_0xbe5a1={};_0xbe5a1[_0xb8eb('0x30')]=_[_0xb8eb('0x31')](db['Pause'][_0xb8eb('0x2c')]);_0xbe5a1['query']=_['keys'](_0x38e40a[_0xb8eb('0x32')]);_0xbe5a1[_0xb8eb('0x33')]=_[_0xb8eb('0x34')](_0xbe5a1[_0xb8eb('0x30')],_0xbe5a1['query']);_0x552164['attributes']=_[_0xb8eb('0x34')](_0xbe5a1[_0xb8eb('0x30')],qs[_0xb8eb('0x42')](_0x38e40a['query'][_0xb8eb('0x42')]));_0x552164['attributes']=_0x552164['attributes']['length']?_0x552164[_0xb8eb('0x35')]:_0xbe5a1[_0xb8eb('0x30')];if(_0x38e40a[_0xb8eb('0x32')][_0xb8eb('0x43')]){_0x552164[_0xb8eb('0x3e')]=[{'all':!![]}];}_0x552164=_[_0xb8eb('0x3c')]({},_0x552164,_0x38e40a[_0xb8eb('0x3d')]);return db['Pause'][_0xb8eb('0x44')](_0x552164)[_0xb8eb('0x23')](handleEntityNotFound(_0x33d577,null))[_0xb8eb('0x23')](respondWithResult(_0x33d577,null))[_0xb8eb('0x45')](handleError(_0x33d577,null));};exports[_0xb8eb('0x46')]=function(_0xf4d911,_0x18b648){return db[_0xb8eb('0x2b')][_0xb8eb('0x46')](_0xf4d911[_0xb8eb('0x47')],{})[_0xb8eb('0x23')](function(_0xae2f77){var _0x4cae2b=_0xf4d911[_0xb8eb('0x48')][_0xb8eb('0x49')]({'plain':!![]});if(!_0x4cae2b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cae2b['role']===_0xb8eb('0x48')){var _0x390cdd=_0xae2f77[_0xb8eb('0x49')]({'plain':!![]});var _0x4bec2b=_0xb8eb('0x4a');return db['UserProfileSection'][_0xb8eb('0x44')]({'where':{'name':_0x4bec2b,'userProfileId':_0x4cae2b[_0xb8eb('0x4b')]},'raw':!![]})[_0xb8eb('0x23')](function(_0x30ed0c){if(_0x30ed0c&&_0x30ed0c[_0xb8eb('0x4c')]===0x0){return db['UserProfileResource'][_0xb8eb('0x46')]({'name':_0x390cdd[_0xb8eb('0x28')],'resourceId':_0x390cdd['id'],'type':_0x30ed0c['name'],'sectionId':_0x30ed0c['id']},{})[_0xb8eb('0x23')](function(){return _0xae2f77;});}else{return _0xae2f77;}})['catch'](function(_0x3449c9){logger[_0xb8eb('0x26')](_0xb8eb('0x4d'),_0x3449c9);throw _0x3449c9;});}return _0xae2f77;})[_0xb8eb('0x23')](respondWithResult(_0x18b648,0xc9))[_0xb8eb('0x45')](handleError(_0x18b648,null));};exports[_0xb8eb('0x4e')]=function(_0x19ac24,_0x1fc9fa){if(_0x19ac24[_0xb8eb('0x47')]['id']){delete _0x19ac24[_0xb8eb('0x47')]['id'];}return db['Pause'][_0xb8eb('0x44')]({'where':{'id':_0x19ac24[_0xb8eb('0x4f')]['id']}})[_0xb8eb('0x23')](handleEntityNotFound(_0x1fc9fa,null))[_0xb8eb('0x23')](saveUpdates(_0x19ac24['body'],null))[_0xb8eb('0x23')](respondWithResult(_0x1fc9fa,null))[_0xb8eb('0x45')](handleError(_0x1fc9fa,null));};exports['destroy']=function(_0x2f4690,_0x33fc07){return db[_0xb8eb('0x2b')][_0xb8eb('0x44')]({'where':{'id':_0x2f4690['params']['id']}})[_0xb8eb('0x23')](handleEntityNotFound(_0x33fc07,null))[_0xb8eb('0x23')](removeEntity(_0x33fc07,null))[_0xb8eb('0x45')](handleError(_0x33fc07,null));};
\ No newline at end of file
+var _0x7f08=['../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','then','destroy','Pauses','UserProfileResource','sendStatus','stack','name','send','index','map','Pause','fieldName','type','key','query','filters','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','model','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xd1214,_0x5ee273){var _0x1dac33=function(_0x1e5755){while(--_0x1e5755){_0xd1214['push'](_0xd1214['shift']());}};_0x1dac33(++_0x5ee273);}(_0x7f08,0x147));var _0x87f0=function(_0x3c8ddd,_0x3facdc){_0x3c8ddd=_0x3c8ddd-0x0;var _0x218c21=_0x7f08[_0x3c8ddd];return _0x218c21;};'use strict';var emlformat=require(_0x87f0('0x0'));var rimraf=require(_0x87f0('0x1'));var zipdir=require(_0x87f0('0x2'));var jsonpatch=require(_0x87f0('0x3'));var rp=require(_0x87f0('0x4'));var moment=require(_0x87f0('0x5'));var BPromise=require(_0x87f0('0x6'));var Mustache=require(_0x87f0('0x7'));var util=require(_0x87f0('0x8'));var path=require(_0x87f0('0x9'));var sox=require(_0x87f0('0xa'));var csv=require('to-csv');var ejs=require(_0x87f0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87f0('0xc'));var squel=require(_0x87f0('0xd'));var crypto=require(_0x87f0('0xe'));var jsforce=require(_0x87f0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x87f0('0x10'));var querystring=require(_0x87f0('0x11'));var Papa=require(_0x87f0('0x12'));var Redis=require(_0x87f0('0x13'));var authService=require(_0x87f0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x87f0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87f0('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x87f0('0x17'));var licenseUtil=require(_0x87f0('0x18'));var db=require(_0x87f0('0x19'))['db'];function respondWithStatusCode(_0x5927f6,_0x4fbf97){_0x4fbf97=_0x4fbf97||0xcc;return function(_0x75d16e){if(_0x75d16e){return _0x5927f6['sendStatus'](_0x4fbf97);}return _0x5927f6[_0x87f0('0x1a')](_0x4fbf97)[_0x87f0('0x1b')]();};}function respondWithResult(_0x15cbd2,_0x50311b){_0x50311b=_0x50311b||0xc8;return function(_0x495afb){if(_0x495afb){return _0x15cbd2[_0x87f0('0x1a')](_0x50311b)[_0x87f0('0x1c')](_0x495afb);}};}function respondWithFilteredResult(_0x50684b,_0x1d8ef1){return function(_0x114cf7){if(_0x114cf7){var _0x4a983b=typeof _0x1d8ef1['offset']==='undefined'&&typeof _0x1d8ef1[_0x87f0('0x1d')]===_0x87f0('0x1e');var _0xb29366=_0x114cf7[_0x87f0('0x1f')];var _0x3d71b6=_0x4a983b?0x0:_0x1d8ef1[_0x87f0('0x20')];var _0x35de54=_0x4a983b?_0x114cf7[_0x87f0('0x1f')]:_0x1d8ef1[_0x87f0('0x20')]+_0x1d8ef1['limit'];var _0x5157af;if(_0x35de54>=_0xb29366){_0x35de54=_0xb29366;_0x5157af=0xc8;}else{_0x5157af=0xce;}_0x50684b['status'](_0x5157af);return _0x50684b[_0x87f0('0x21')](_0x87f0('0x22'),_0x3d71b6+'-'+_0x35de54+'/'+_0xb29366)[_0x87f0('0x1c')](_0x114cf7);}return null;};}function patchUpdates(_0x515c7c){return function(_0x3132){try{jsonpatch['apply'](_0x3132,_0x515c7c,!![]);}catch(_0x2d29b7){return BPromise[_0x87f0('0x23')](_0x2d29b7);}return _0x3132['save']();};}function saveUpdates(_0x140a1b,_0x3200f7){return function(_0x310093){if(_0x310093){return _0x310093[_0x87f0('0x24')](_0x140a1b)[_0x87f0('0x25')](function(_0x577e80){return _0x577e80;});}return null;};}function removeEntity(_0x537ebb,_0x2967b6){return function(_0x261412){if(_0x261412){return _0x261412[_0x87f0('0x26')]()[_0x87f0('0x25')](function(){var _0x1f402f=_0x261412['get']({'plain':!![]});var _0x5d2446=_0x87f0('0x27');return db[_0x87f0('0x28')][_0x87f0('0x26')]({'where':{'type':_0x5d2446,'resourceId':_0x1f402f['id']}})[_0x87f0('0x25')](function(){return _0x261412;});})['then'](function(){_0x537ebb[_0x87f0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcf8e85,_0x3dbff1){return function(_0x1e3685){if(!_0x1e3685){_0xcf8e85[_0x87f0('0x29')](0x194);}return _0x1e3685;};}function handleError(_0x1f3000,_0x30fb86){_0x30fb86=_0x30fb86||0x1f4;return function(_0x7ba809){logger['error'](_0x7ba809[_0x87f0('0x2a')]);if(_0x7ba809['name']){delete _0x7ba809[_0x87f0('0x2b')];}_0x1f3000[_0x87f0('0x1a')](_0x30fb86)[_0x87f0('0x2c')](_0x7ba809);};}exports[_0x87f0('0x2d')]=function(_0x32e23c,_0x10af9d){var _0x143cf0={},_0x1bf42f={},_0x169793={'count':0x0,'rows':[]};var _0x17f7c4=_[_0x87f0('0x2e')](db[_0x87f0('0x2f')]['rawAttributes'],function(_0x489089){return{'name':_0x489089[_0x87f0('0x30')],'type':_0x489089[_0x87f0('0x31')][_0x87f0('0x32')]};});_0x1bf42f['model']=_[_0x87f0('0x2e')](_0x17f7c4,'name');_0x1bf42f[_0x87f0('0x33')]=_['keys'](_0x32e23c[_0x87f0('0x33')]);_0x1bf42f[_0x87f0('0x34')]=_['intersection'](_0x1bf42f['model'],_0x1bf42f[_0x87f0('0x33')]);_0x143cf0[_0x87f0('0x35')]=_['intersection'](_0x1bf42f['model'],qs['fields'](_0x32e23c[_0x87f0('0x33')][_0x87f0('0x36')]));_0x143cf0[_0x87f0('0x35')]=_0x143cf0[_0x87f0('0x35')]['length']?_0x143cf0[_0x87f0('0x35')]:_0x1bf42f['model'];if(!_0x32e23c[_0x87f0('0x33')]['hasOwnProperty'](_0x87f0('0x37'))){_0x143cf0['limit']=qs[_0x87f0('0x1d')](_0x32e23c[_0x87f0('0x33')][_0x87f0('0x1d')]);_0x143cf0[_0x87f0('0x20')]=qs[_0x87f0('0x20')](_0x32e23c['query']['offset']);}_0x143cf0[_0x87f0('0x38')]=qs[_0x87f0('0x39')](_0x32e23c[_0x87f0('0x33')][_0x87f0('0x39')]);_0x143cf0['where']=qs['filters'](_[_0x87f0('0x3a')](_0x32e23c[_0x87f0('0x33')],_0x1bf42f[_0x87f0('0x34')]),_0x17f7c4);if(_0x32e23c[_0x87f0('0x33')][_0x87f0('0x3b')]){_0x143cf0[_0x87f0('0x3c')]=_[_0x87f0('0x3d')](_0x143cf0[_0x87f0('0x3c')],{'$or':_[_0x87f0('0x2e')](_0x17f7c4,function(_0x2f416f){if(_0x2f416f[_0x87f0('0x31')]!==_0x87f0('0x3e')){var _0x51a15e={};_0x51a15e[_0x2f416f[_0x87f0('0x2b')]]={'$like':'%'+_0x32e23c[_0x87f0('0x33')]['filter']+'%'};return _0x51a15e;}})});}_0x143cf0=_[_0x87f0('0x3d')]({},_0x143cf0,_0x32e23c[_0x87f0('0x3f')]);var _0x20bdcc={'where':_0x143cf0[_0x87f0('0x3c')]};return db[_0x87f0('0x2f')][_0x87f0('0x1f')](_0x20bdcc)[_0x87f0('0x25')](function(_0x438149){_0x169793['count']=_0x438149;if(_0x32e23c[_0x87f0('0x33')][_0x87f0('0x40')]){_0x143cf0[_0x87f0('0x41')]=[{'all':!![]}];}return db[_0x87f0('0x2f')][_0x87f0('0x42')](_0x143cf0);})[_0x87f0('0x25')](function(_0x3c9c6f){_0x169793[_0x87f0('0x43')]=_0x3c9c6f;return _0x169793;})[_0x87f0('0x25')](respondWithFilteredResult(_0x10af9d,_0x143cf0))[_0x87f0('0x44')](handleError(_0x10af9d,null));};exports[_0x87f0('0x45')]=function(_0x35fbac,_0x294dbf){var _0x179c31={'raw':!![],'where':{'id':_0x35fbac[_0x87f0('0x46')]['id']}},_0x515413={};_0x515413['model']=_[_0x87f0('0x47')](db[_0x87f0('0x2f')][_0x87f0('0x48')]);_0x515413['query']=_[_0x87f0('0x47')](_0x35fbac[_0x87f0('0x33')]);_0x515413[_0x87f0('0x34')]=_[_0x87f0('0x49')](_0x515413[_0x87f0('0x4a')],_0x515413['query']);_0x179c31[_0x87f0('0x35')]=_['intersection'](_0x515413[_0x87f0('0x4a')],qs[_0x87f0('0x36')](_0x35fbac['query'][_0x87f0('0x36')]));_0x179c31[_0x87f0('0x35')]=_0x179c31[_0x87f0('0x35')][_0x87f0('0x4b')]?_0x179c31['attributes']:_0x515413['model'];if(_0x35fbac[_0x87f0('0x33')][_0x87f0('0x40')]){_0x179c31[_0x87f0('0x41')]=[{'all':!![]}];}_0x179c31=_['merge']({},_0x179c31,_0x35fbac['options']);return db[_0x87f0('0x2f')]['find'](_0x179c31)[_0x87f0('0x25')](handleEntityNotFound(_0x294dbf,null))[_0x87f0('0x25')](respondWithResult(_0x294dbf,null))[_0x87f0('0x44')](handleError(_0x294dbf,null));};exports[_0x87f0('0x4c')]=function(_0x7b775,_0x2078b3){return db[_0x87f0('0x2f')]['create'](_0x7b775[_0x87f0('0x4d')],{})[_0x87f0('0x25')](function(_0x56ae40){var _0x4d0b29=_0x7b775[_0x87f0('0x4e')][_0x87f0('0x4f')]({'plain':!![]});if(!_0x4d0b29)throw new Error(_0x87f0('0x50'));if(_0x4d0b29[_0x87f0('0x51')]==='user'){var _0x10ec16=_0x56ae40[_0x87f0('0x4f')]({'plain':!![]});var _0x5db8cd='Pauses';return db[_0x87f0('0x52')]['find']({'where':{'name':_0x5db8cd,'userProfileId':_0x4d0b29[_0x87f0('0x53')]},'raw':!![]})[_0x87f0('0x25')](function(_0x206bb4){if(_0x206bb4&&_0x206bb4[_0x87f0('0x54')]===0x0){return db[_0x87f0('0x28')][_0x87f0('0x4c')]({'name':_0x10ec16[_0x87f0('0x2b')],'resourceId':_0x10ec16['id'],'type':_0x206bb4[_0x87f0('0x2b')],'sectionId':_0x206bb4['id']},{})[_0x87f0('0x25')](function(){return _0x56ae40;});}else{return _0x56ae40;}})[_0x87f0('0x44')](function(_0x159954){logger[_0x87f0('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x159954);throw _0x159954;});}return _0x56ae40;})[_0x87f0('0x25')](respondWithResult(_0x2078b3,0xc9))[_0x87f0('0x44')](handleError(_0x2078b3,null));};exports[_0x87f0('0x24')]=function(_0x57b90b,_0x278ac5){if(_0x57b90b[_0x87f0('0x4d')]['id']){delete _0x57b90b[_0x87f0('0x4d')]['id'];}return db[_0x87f0('0x2f')][_0x87f0('0x56')]({'where':{'id':_0x57b90b['params']['id']}})[_0x87f0('0x25')](handleEntityNotFound(_0x278ac5,null))[_0x87f0('0x25')](saveUpdates(_0x57b90b[_0x87f0('0x4d')],null))[_0x87f0('0x25')](respondWithResult(_0x278ac5,null))['catch'](handleError(_0x278ac5,null));};exports[_0x87f0('0x26')]=function(_0x565e95,_0x48d41c){return db[_0x87f0('0x2f')]['find']({'where':{'id':_0x565e95['params']['id']}})[_0x87f0('0x25')](handleEntityNotFound(_0x48d41c,null))[_0x87f0('0x25')](removeEntity(_0x48d41c,null))[_0x87f0('0x44')](handleError(_0x48d41c,null));};
\ No newline at end of file
index f2e2b37..c90036d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x3da3ca,_0x538002){var _0x1bee5e=function(_0x4120c9){while(--_0x4120c9){_0x3da3ca['push'](_0x3da3ca['shift']());}};_0x1bee5e(++_0x538002);}(_0xe14b,0x93));var _0xbe14=function(_0x35a8db,_0x351f2c){_0x35a8db=_0x35a8db-0x0;var _0x315cdd=_0xe14b[_0x35a8db];return _0x315cdd;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6aa7,0x178));var _0x76aa=function(_0x59a4fa,_0x5f0014){_0x59a4fa=_0x59a4fa-0x0;var _0x4552e0=_0x6aa7[_0x59a4fa];return _0x4552e0;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f83f30..cb88112 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(_0x55bd35,_0x3876a3){var _0xb187a8=function(_0x2e8c1c){while(--_0x2e8c1c){_0x55bd35['push'](_0x55bd35['shift']());}};_0xb187a8(++_0x3876a3);}(_0x7a54,0x106));var _0x47a5=function(_0x2b6df5,_0x3a6c6f){_0x2b6df5=_0x2b6df5-0x0;var _0x9770c4=_0x7a54[_0x2b6df5];return _0x9770c4;};'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(_0x13ed2c,_0x990334){var _0x2f9562=function(_0x355f92){while(--_0x355f92){_0x13ed2c['push'](_0x13ed2c['shift']());}};_0x2f9562(++_0x990334);}(_0xb10b,0x12a));var _0xbb10=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xb10b[_0x3132e8];return _0x43eb8c;};'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 c3cd63f..a9e07f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3667=['download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download'];(function(_0x5b6c0f,_0x1a3f01){var _0xe4818c=function(_0x568ae7){while(--_0x568ae7){_0x5b6c0f['push'](_0x5b6c0f['shift']());}};_0xe4818c(++_0x1a3f01);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var path=require(_0x7366('0x2'));var timeout=require(_0x7366('0x3'));var express=require(_0x7366('0x4'));var router=express['Router']();var fs_extra=require(_0x7366('0x5'));var auth=require(_0x7366('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7366('0x7'));var controller=require(_0x7366('0x8'));router[_0x7366('0x9')]('/',auth[_0x7366('0xa')](),controller[_0x7366('0xb')]);router['get'](_0x7366('0xc'),controller[_0x7366('0xd')]);router[_0x7366('0x9')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller[_0x7366('0xf')]);router[_0x7366('0x9')](_0x7366('0x10'),auth[_0x7366('0xa')](),controller[_0x7366('0x11')]);var upload=multer({'storage':multer[_0x7366('0x12')]({'destination':function(_0x2d7e38,_0x57ea7f,_0x425ee4){_0x425ee4(null,path[_0x7366('0x13')](config[_0x7366('0x14')],_0x7366('0x15')));},'filename':function(_0x25a565,_0xd5bac8,_0x3e3a73){_0xd5bac8[_0x7366('0x16')]=_0xd5bac8[_0x7366('0x16')][_0x7366('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3e3a73(null,util[_0x7366('0x18')](_0x7366('0x19'),path[_0x7366('0x1a')](_0xd5bac8[_0x7366('0x16')],path[_0x7366('0x1b')](_0xd5bac8['originalname'])),Date[_0x7366('0x1c')](),path[_0x7366('0x1b')](_0xd5bac8[_0x7366('0x16')])));}})});router[_0x7366('0x1d')]('/',upload[_0x7366('0x1e')](_0x7366('0x1f')),controller[_0x7366('0x20')]);router[_0x7366('0x1d')](_0x7366('0xc'),controller[_0x7366('0x21')]);router[_0x7366('0x22')]('/:id',auth[_0x7366('0xa')](),controller['update']);router[_0x7366('0x23')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller['delete']);module[_0x7366('0x24')]=router;
\ No newline at end of file
+var _0x72b1=['./plugin.controller','get','isAuthenticated','index','/webhook','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6bb4fa,_0x4603e3){var _0x4cd4d0=function(_0x194f14){while(--_0x194f14){_0x6bb4fa['push'](_0x6bb4fa['shift']());}};_0x4cd4d0(++_0x4603e3);}(_0x72b1,0x16e));var _0x172b=function(_0x2dc997,_0xb3857f){_0x2dc997=_0x2dc997-0x0;var _0x26f739=_0x72b1[_0x2dc997];return _0x26f739;};'use strict';var multer=require(_0x172b('0x0'));var util=require('util');var path=require(_0x172b('0x1'));var timeout=require(_0x172b('0x2'));var express=require(_0x172b('0x3'));var router=express[_0x172b('0x4')]();var fs_extra=require(_0x172b('0x5'));var auth=require(_0x172b('0x6'));var interaction=require(_0x172b('0x7'));var config=require('../../config/environment');var controller=require(_0x172b('0x8'));router[_0x172b('0x9')]('/',auth[_0x172b('0xa')](),controller[_0x172b('0xb')]);router['get'](_0x172b('0xc'),controller['webhookGet']);router[_0x172b('0x9')]('/:id',auth[_0x172b('0xa')](),controller[_0x172b('0xd')]);router[_0x172b('0x9')](_0x172b('0xe'),auth['isAuthenticated'](),controller[_0x172b('0xf')]);var upload=multer({'storage':multer[_0x172b('0x10')]({'destination':function(_0x28aaad,_0x161c7c,_0xa4ada9){_0xa4ada9(null,path[_0x172b('0x11')](config[_0x172b('0x12')],'server/files/plugins'));},'filename':function(_0x13d285,_0x82727f,_0xdf832e){_0x82727f['originalname']=_0x82727f[_0x172b('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xdf832e(null,util[_0x172b('0x14')](_0x172b('0x15'),path['basename'](_0x82727f[_0x172b('0x13')],path[_0x172b('0x16')](_0x82727f[_0x172b('0x13')])),Date[_0x172b('0x17')](),path['extname'](_0x82727f['originalname'])));}})});router[_0x172b('0x18')]('/',upload[_0x172b('0x19')](_0x172b('0x1a')),controller[_0x172b('0x1b')]);router['post']('/webhook',controller[_0x172b('0x1c')]);router[_0x172b('0x1d')](_0x172b('0x1e'),auth[_0x172b('0xa')](),controller[_0x172b('0x1f')]);router['delete'](_0x172b('0x1e'),auth[_0x172b('0xa')](),controller[_0x172b('0x20')]);module[_0x172b('0x21')]=router;
\ No newline at end of file
index 55ac74e..3b82ca5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1f1=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','script','TEXT'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xd1f1,0x91));var _0x1d1f=function(_0x4be57c,_0x151881){_0x4be57c=_0x4be57c-0x0;var _0x5901da=_0xd1f1[_0x4be57c];return _0x5901da;};'use strict';var Sequelize=require('sequelize');module[_0x1d1f('0x0')]={'name':{'type':Sequelize[_0x1d1f('0x1')]},'type':{'type':Sequelize[_0x1d1f('0x2')]('html',_0x1d1f('0x3'))},'description':{'type':Sequelize[_0x1d1f('0x4')]},'version':{'type':Sequelize[_0x1d1f('0x4')]},'path':{'type':Sequelize[_0x1d1f('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x1d1f('0x2')](_0x1d1f('0x5'),_0x1d1f('0x6'),_0x1d1f('0x7'),_0x1d1f('0x8')),'defaultValue':_0x1d1f('0x7'),'comment':_0x1d1f('0x9')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x1d1f('0x1')]},'agentUrl':{'type':Sequelize[_0x1d1f('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x1d1f('0x1')]}};
\ No newline at end of file
+var _0x4ce7=['exports','STRING','html','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x1c7e62,_0x1fdb74){var _0x44f89b=function(_0x54898c){while(--_0x54898c){_0x1c7e62['push'](_0x1c7e62['shift']());}};_0x44f89b(++_0x1fdb74);}(_0x4ce7,0x1c2));var _0x74ce=function(_0x54b1bb,_0x34b999){_0x54b1bb=_0x54b1bb-0x0;var _0x3d0610=_0x4ce7[_0x54b1bb];return _0x3d0610;};'use strict';var Sequelize=require(_0x74ce('0x0'));module[_0x74ce('0x1')]={'name':{'type':Sequelize[_0x74ce('0x2')]},'type':{'type':Sequelize['ENUM'](_0x74ce('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x74ce('0x2')],'comment':_0x74ce('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x74ce('0x5')},'sidebar':{'type':Sequelize[_0x74ce('0x6')](_0x74ce('0x7'),'agentOnly',_0x74ce('0x8'),_0x74ce('0x9')),'defaultValue':_0x74ce('0x8'),'comment':_0x74ce('0xa')},'icon':{'type':Sequelize[_0x74ce('0x2')]},'adminUrl':{'type':Sequelize[_0x74ce('0x2')]},'agentUrl':{'type':Sequelize[_0x74ce('0x2')]},'scriptName':{'type':Sequelize[_0x74ce('0x2')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e6808c3..cf9f835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1e6=['stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','Plugin','includeAll','include','findAll','catch','params','keys','find','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','code','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','**/*','dirname','basename','node_modules/**/*','attachments/**/*','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','html','views','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','method','%s%s','headers','content-type','endsWith','statusCode','webhookPost','resolve','http://localhost:','content-length','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','UserProfileResource','end'];(function(_0x1f2422,_0x125fd2){var _0x4fb420=function(_0x1b8cc6){while(--_0x1b8cc6){_0x1f2422['push'](_0x1f2422['shift']());}};_0x4fb420(++_0x125fd2);}(_0xd1e6,0x74));var _0x6d1e=function(_0x5a2601,_0x505649){_0x5a2601=_0x5a2601-0x0;var _0x4d58c5=_0xd1e6[_0x5a2601];return _0x4d58c5;};'use strict';var emlformat=require(_0x6d1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d1e('0x1'));var jsonpatch=require(_0x6d1e('0x2'));var rp=require(_0x6d1e('0x3'));var moment=require(_0x6d1e('0x4'));var BPromise=require(_0x6d1e('0x5'));var Mustache=require(_0x6d1e('0x6'));var util=require(_0x6d1e('0x7'));var path=require(_0x6d1e('0x8'));var sox=require(_0x6d1e('0x9'));var csv=require(_0x6d1e('0xa'));var ejs=require(_0x6d1e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6d1e('0xc'));var crypto=require('crypto');var jsforce=require(_0x6d1e('0xd'));var deskjs=require(_0x6d1e('0xe'));var toCsv=require(_0x6d1e('0xa'));var querystring=require(_0x6d1e('0xf'));var Papa=require(_0x6d1e('0x10'));var extract=require(_0x6d1e('0x11'));var rimraf=require('rimraf');var archiver=require(_0x6d1e('0x12'));var Redis=require(_0x6d1e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6d1e('0x14'));var as=require(_0x6d1e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d1e('0x16'))(_0x6d1e('0x17'));var utils=require(_0x6d1e('0x18'));var config=require(_0x6d1e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d1e('0x1a'))['db'];config[_0x6d1e('0x1b')]=_[_0x6d1e('0x1c')](config[_0x6d1e('0x1b')],{'host':_0x6d1e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0x6d1e('0x1e')](socket);function respondWithStatusCode(_0x3e0ace,_0x129f32){_0x129f32=_0x129f32||0xcc;return function(_0x18859d){if(_0x18859d){return _0x3e0ace[_0x6d1e('0x1f')](_0x129f32);}return _0x3e0ace[_0x6d1e('0x20')](_0x129f32)['end']();};}function respondWithResult(_0x599f1c,_0x4e5047){_0x4e5047=_0x4e5047||0xc8;return function(_0x46175b){if(_0x46175b){return _0x599f1c[_0x6d1e('0x20')](_0x4e5047)[_0x6d1e('0x21')](_0x46175b);}};}function respondWithFilteredResult(_0x36e066,_0x15e810){return function(_0x19c5a1){if(_0x19c5a1){var _0x59067a=typeof _0x15e810[_0x6d1e('0x22')]===_0x6d1e('0x23')&&typeof _0x15e810[_0x6d1e('0x24')]==='undefined';var _0x5ee022=_0x19c5a1[_0x6d1e('0x25')];var _0x3753f1=_0x59067a?0x0:_0x15e810[_0x6d1e('0x22')];var _0x1b892d=_0x59067a?_0x19c5a1[_0x6d1e('0x25')]:_0x15e810[_0x6d1e('0x22')]+_0x15e810[_0x6d1e('0x24')];var _0x564b59;if(_0x1b892d>=_0x5ee022){_0x1b892d=_0x5ee022;_0x564b59=0xc8;}else{_0x564b59=0xce;}_0x36e066[_0x6d1e('0x20')](_0x564b59);return _0x36e066[_0x6d1e('0x26')]('Content-Range',_0x3753f1+'-'+_0x1b892d+'/'+_0x5ee022)[_0x6d1e('0x21')](_0x19c5a1);}return null;};}function patchUpdates(_0x2f2492){return function(_0x4e039e){try{jsonpatch[_0x6d1e('0x27')](_0x4e039e,_0x2f2492,!![]);}catch(_0xd6d9b2){return BPromise[_0x6d1e('0x28')](_0xd6d9b2);}return _0x4e039e['save']();};}function saveUpdates(_0x35b85c,_0x90f7e5){return function(_0x4c838f){if(_0x4c838f){return _0x4c838f[_0x6d1e('0x29')](_0x35b85c)[_0x6d1e('0x2a')](function(_0x458a48){return _0x458a48;});}return null;};}function removeEntity(_0x2aeb67,_0x2aa6bd){return function(_0x480e5f){if(_0x480e5f){return _0x480e5f[_0x6d1e('0x2b')]()[_0x6d1e('0x2a')](function(){var _0x563330=_0x480e5f[_0x6d1e('0x2c')]({'plain':!![]});var _0x4d8af5='Plugins';return db[_0x6d1e('0x2d')][_0x6d1e('0x2b')]({'where':{'type':_0x4d8af5,'resourceId':_0x563330['id']}})[_0x6d1e('0x2a')](function(){return _0x480e5f;});})[_0x6d1e('0x2a')](function(){_0x2aeb67['status'](0xcc)[_0x6d1e('0x2e')]();});}};}function handleEntityNotFound(_0x1e699d,_0x333b57){return function(_0x4e3f4e){if(!_0x4e3f4e){_0x1e699d[_0x6d1e('0x1f')](0x194);}return _0x4e3f4e;};}function handleError(_0x10e205,_0x26ebff){_0x26ebff=_0x26ebff||0x1f4;return function(_0x3a8e15){logger['error'](_0x3a8e15[_0x6d1e('0x2f')]);if(_0x3a8e15[_0x6d1e('0x30')]){delete _0x3a8e15[_0x6d1e('0x30')];}_0x10e205[_0x6d1e('0x20')](_0x26ebff)[_0x6d1e('0x31')](_0x3a8e15);};}exports['index']=function(_0x4466bd,_0xf6e22b){var _0xa0ab8c={},_0x3a7db4={},_0x40e08e={'count':0x0,'rows':[]};var _0x2e5a26=_[_0x6d1e('0x32')](db['Plugin'][_0x6d1e('0x33')],function(_0x6f3843){return{'name':_0x6f3843[_0x6d1e('0x34')],'type':_0x6f3843[_0x6d1e('0x35')][_0x6d1e('0x36')]};});_0x3a7db4['model']=_[_0x6d1e('0x32')](_0x2e5a26,_0x6d1e('0x30'));_0x3a7db4[_0x6d1e('0x37')]=_['keys'](_0x4466bd['query']);_0x3a7db4[_0x6d1e('0x38')]=_[_0x6d1e('0x39')](_0x3a7db4[_0x6d1e('0x3a')],_0x3a7db4[_0x6d1e('0x37')]);_0xa0ab8c[_0x6d1e('0x3b')]=_['intersection'](_0x3a7db4[_0x6d1e('0x3a')],qs[_0x6d1e('0x3c')](_0x4466bd['query']['fields']));_0xa0ab8c[_0x6d1e('0x3b')]=_0xa0ab8c[_0x6d1e('0x3b')][_0x6d1e('0x3d')]?_0xa0ab8c[_0x6d1e('0x3b')]:_0x3a7db4[_0x6d1e('0x3a')];if(!_0x4466bd[_0x6d1e('0x37')]['hasOwnProperty'](_0x6d1e('0x3e'))){_0xa0ab8c[_0x6d1e('0x24')]=qs['limit'](_0x4466bd[_0x6d1e('0x37')][_0x6d1e('0x24')]);_0xa0ab8c['offset']=qs[_0x6d1e('0x22')](_0x4466bd[_0x6d1e('0x37')][_0x6d1e('0x22')]);}_0xa0ab8c[_0x6d1e('0x3f')]=qs['sort'](_0x4466bd[_0x6d1e('0x37')][_0x6d1e('0x40')]);_0xa0ab8c[_0x6d1e('0x41')]=qs[_0x6d1e('0x38')](_['pick'](_0x4466bd[_0x6d1e('0x37')],_0x3a7db4['filters']),_0x2e5a26);if(_0x4466bd[_0x6d1e('0x37')]['filter']){_0xa0ab8c[_0x6d1e('0x41')]=_['merge'](_0xa0ab8c[_0x6d1e('0x41')],{'$or':_['map'](_0x2e5a26,function(_0x1f87dd){if(_0x1f87dd[_0x6d1e('0x35')]!==_0x6d1e('0x42')){var _0x1f81be={};_0x1f81be[_0x1f87dd['name']]={'$like':'%'+_0x4466bd['query'][_0x6d1e('0x43')]+'%'};return _0x1f81be;}})});}_0xa0ab8c=_[_0x6d1e('0x44')]({},_0xa0ab8c,_0x4466bd[_0x6d1e('0x45')]);var _0x422529={'where':_0xa0ab8c[_0x6d1e('0x41')]};return db[_0x6d1e('0x46')]['count'](_0x422529)['then'](function(_0x27c3b2){_0x40e08e['count']=_0x27c3b2;if(_0x4466bd['query'][_0x6d1e('0x47')]){_0xa0ab8c[_0x6d1e('0x48')]=[{'all':!![]}];}return db[_0x6d1e('0x46')][_0x6d1e('0x49')](_0xa0ab8c);})[_0x6d1e('0x2a')](function(_0x370b0f){_0x40e08e['rows']=_0x370b0f;return _0x40e08e;})[_0x6d1e('0x2a')](respondWithFilteredResult(_0xf6e22b,_0xa0ab8c))[_0x6d1e('0x4a')](handleError(_0xf6e22b,null));};exports['show']=function(_0x137ee8,_0x5da0cf){var _0xdd32b1={'raw':!![],'where':{'id':_0x137ee8[_0x6d1e('0x4b')]['id']}},_0x43ac84={};_0x43ac84[_0x6d1e('0x3a')]=_[_0x6d1e('0x4c')](db[_0x6d1e('0x46')][_0x6d1e('0x33')]);_0x43ac84[_0x6d1e('0x37')]=_['keys'](_0x137ee8[_0x6d1e('0x37')]);_0x43ac84[_0x6d1e('0x38')]=_[_0x6d1e('0x39')](_0x43ac84['model'],_0x43ac84[_0x6d1e('0x37')]);_0xdd32b1[_0x6d1e('0x3b')]=_[_0x6d1e('0x39')](_0x43ac84[_0x6d1e('0x3a')],qs[_0x6d1e('0x3c')](_0x137ee8['query'][_0x6d1e('0x3c')]));_0xdd32b1[_0x6d1e('0x3b')]=_0xdd32b1[_0x6d1e('0x3b')][_0x6d1e('0x3d')]?_0xdd32b1[_0x6d1e('0x3b')]:_0x43ac84[_0x6d1e('0x3a')];if(_0x137ee8['query'][_0x6d1e('0x47')]){_0xdd32b1['include']=[{'all':!![]}];}_0xdd32b1=_['merge']({},_0xdd32b1,_0x137ee8[_0x6d1e('0x45')]);return db[_0x6d1e('0x46')][_0x6d1e('0x4d')](_0xdd32b1)[_0x6d1e('0x2a')](handleEntityNotFound(_0x5da0cf,null))['then'](respondWithResult(_0x5da0cf,null))['catch'](handleError(_0x5da0cf,null));};exports[_0x6d1e('0x4e')]=function(_0x29024c,_0x1b4418,_0x1932e5){return db['Plugin'][_0x6d1e('0x4d')]({'where':{'id':_0x29024c[_0x6d1e('0x4b')]['id']},'attributes':['name',_0x6d1e('0x8')],'raw':!![]})[_0x6d1e('0x2a')](handleEntityNotFound(_0x1b4418,null))[_0x6d1e('0x2a')](function(_0x811330){if(_0x811330){var _0x411098=path[_0x6d1e('0x4f')](config[_0x6d1e('0x50')],_0x6d1e('0x51'),util[_0x6d1e('0x52')](_0x6d1e('0x53'),path['basename'](_0x811330[_0x6d1e('0x8')])));var _0x20124a=fs[_0x6d1e('0x54')](_0x411098);var _0x51945c=archiver(_0x6d1e('0x55'),{'zlib':{'level':0x9}});_0x51945c['on']('warning',function(_0x4de804){if(_0x4de804[_0x6d1e('0x56')]===_0x6d1e('0x57')){logger[_0x6d1e('0x58')](_0x4de804);}else{throw new db[(_0x6d1e('0x59'))]['Error'](_0x6d1e('0x5a'));}});_0x51945c['on'](_0x6d1e('0x58'),function(_0x164c9a){throw new db[(_0x6d1e('0x59'))][(_0x6d1e('0x5b'))](_0x6d1e('0x5a'));});_0x51945c[_0x6d1e('0x5c')](_0x20124a);_0x51945c['glob'](_0x6d1e('0x5d'),{'cwd':path[_0x6d1e('0x4f')](config[_0x6d1e('0x50')],_0x6d1e('0x51'),path[_0x6d1e('0x5e')](_0x811330[_0x6d1e('0x8')])),'ignore':[path[_0x6d1e('0x4f')](path[_0x6d1e('0x5f')](_0x811330[_0x6d1e('0x8')]),_0x6d1e('0x60')),path['join'](path[_0x6d1e('0x5f')](_0x811330['path']),_0x6d1e('0x61'))],'nodir':!![]})['finalize']();_0x20124a['on']('close',function(){if(!fs['existsSync'](_0x411098)){throw new db[(_0x6d1e('0x59'))][(_0x6d1e('0x5b'))](_0x6d1e('0x62'));}return _0x1b4418[_0x6d1e('0x4e')](_0x411098,util[_0x6d1e('0x52')](_0x6d1e('0x53'),path['basename'](_0x811330[_0x6d1e('0x8')])),function(_0x373d66){if(_0x373d66){throw new db[(_0x6d1e('0x59'))][(_0x6d1e('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x6d1e('0x63')](_0x411098);logger[_0x6d1e('0x64')](_0x6d1e('0x65'));logger[_0x6d1e('0x64')](_0x6d1e('0x66'));});});}return null;})['catch'](handleError(_0x1b4418,null));};exports['upload']=function(_0x1ac0c1,_0x9abecf,_0x567b49){var _0x347d61=path['basename'](_0x1ac0c1['file'][_0x6d1e('0x67')],path[_0x6d1e('0x68')](_0x1ac0c1[_0x6d1e('0x69')]['filename']));var _0x14c039=path[_0x6d1e('0x4f')](config[_0x6d1e('0x50')],_0x6d1e('0x51'),_0x1ac0c1[_0x6d1e('0x69')]['filename']);var _0x50cf5d=path[_0x6d1e('0x4f')](config[_0x6d1e('0x50')],'server/files/plugins',_0x347d61);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x14c039);logger[_0x6d1e('0x64')]('Plugin\x20upload\x20destination:\x20%s',_0x50cf5d);try{fs[_0x6d1e('0x6a')](_0x14c039,parseInt(_0x6d1e('0x6b'),0x8));extract(_0x14c039,{'dir':_0x50cf5d},function(_0x58e670){if(_0x58e670){logger[_0x6d1e('0x58')](_0x58e670);handleError(_0x58e670,!![]);};var _0xe4d48b=fs[_0x6d1e('0x6c')](_0x50cf5d);if(_0xe4d48b[_0x6d1e('0x3d')]>0x1){removeReferences(_0x14c039,_0x50cf5d);logger[_0x6d1e('0x58')]('Invalid\x20plugin\x20structure');return _0x567b49(new Error('Invalid\x20plugin\x20structure'));}var _0x1b9437=fs['lstatSync'](path[_0x6d1e('0x4f')](_0x50cf5d,_0xe4d48b[0x0]));if(_0x1b9437['isFile']()){removeReferences(_0x14c039,_0x50cf5d);logger[_0x6d1e('0x58')](_0x6d1e('0x6d'));return _0x567b49(new Error(_0x6d1e('0x6d')));}if(_0x1b9437[_0x6d1e('0x6e')]()){var _0x6b4b63=fs[_0x6d1e('0x6c')](path[_0x6d1e('0x4f')](_0x50cf5d,_0xe4d48b[0x0]));if(_0x6b4b63[_0x6d1e('0x3d')]===0x0){removeReferences(_0x14c039,_0x50cf5d);logger['error'](_0x6d1e('0x6d'));return _0x567b49(new Error(_0x6d1e('0x6d')));}var _0x436b88=_0x6b4b63[_0x6d1e('0x6f')](function(_0x254ee9){return _0x254ee9===_0x6d1e('0x70');});if(!_0x436b88){return _0x567b49(new Error('Plugin\x20manifest\x20missing'));}var _0x28bbe4=fs[_0x6d1e('0x71')](path[_0x6d1e('0x4f')](_0x50cf5d,_0xe4d48b[0x0],_0x6d1e('0x70')));var _0x19f526=JSON[_0x6d1e('0x72')](_0x28bbe4);if(_0x6d1e('0x23')==typeof _0x19f526[_0x6d1e('0x30')]){return _0x567b49(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x6d1e('0x23')==typeof _0x19f526[_0x6d1e('0x35')]){return _0x567b49(new Error(_0x6d1e('0x73')));}if(_0x6d1e('0x23')==typeof _0x19f526[_0x6d1e('0x74')]){return _0x567b49(new Error(_0x6d1e('0x75')));}if(_0x6d1e('0x23')==typeof _0x19f526[_0x6d1e('0x76')]){return _0x567b49(new Error(_0x6d1e('0x77')));}if(_0x19f526['type']==='html'){if(_0x6d1e('0x23')==typeof _0x19f526[_0x6d1e('0x76')]['views']){return _0x567b49(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x6d1e('0x23')==typeof _0x19f526[_0x6d1e('0x76')]['views'][_0x6d1e('0x78')]&&_0x6d1e('0x23')==typeof _0x19f526[_0x6d1e('0x76')]['views'][_0x6d1e('0x79')]){return _0x567b49(new Error(_0x6d1e('0x7a')));}}else if(_0x19f526[_0x6d1e('0x35')]==='script'){if(_0x6d1e('0x23')==typeof _0x19f526[_0x6d1e('0x76')][_0x6d1e('0x7b')]){return _0x567b49(new Error(_0x6d1e('0x7c')));}if('undefined'==typeof _0x19f526[_0x6d1e('0x76')][_0x6d1e('0x7d')]){return _0x567b49(new Error(_0x6d1e('0x7e')));}}else{return _0x567b49(new Error(_0x6d1e('0x7f')));}var _0x4a4a7b=_0x19f526[_0x6d1e('0x30')];var _0x21192b=_0x19f526[_0x6d1e('0x80')];var _0x4fc2a8=_0x19f526['type'];var _0x5bb941=_0x19f526[_0x6d1e('0x81')]?_0x19f526[_0x6d1e('0x81')]:'always';var _0x29da48=_0x19f526[_0x6d1e('0x82')]?_0x19f526[_0x6d1e('0x82')]:'icon-apps';var _0x594088='';var _0x4c98a7='';var _0x26b1a9='';var _0x11ecee='';var _0x39756d=_0x19f526['version'];if(_0x4fc2a8===_0x6d1e('0x83')){if('undefined'!=typeof _0x19f526[_0x6d1e('0x76')][_0x6d1e('0x84')]['admin']){var _0x216cd0=_0x19f526[_0x6d1e('0x76')][_0x6d1e('0x84')][_0x6d1e('0x78')];if(!/^(f|ht)tps?:\/\//i[_0x6d1e('0x85')](_0x216cd0)){_0x594088=path[_0x6d1e('0x4f')](_0x6d1e('0x86'),_0x347d61,_0xe4d48b[0x0],_0x216cd0);}else{_0x594088=_0x216cd0;}}else{logger['info'](_0x6d1e('0x87'));}if(_0x6d1e('0x23')!=typeof _0x19f526[_0x6d1e('0x76')][_0x6d1e('0x84')][_0x6d1e('0x79')]){var _0x3add5f=_0x19f526[_0x6d1e('0x76')][_0x6d1e('0x84')][_0x6d1e('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x6d1e('0x85')](_0x3add5f)){_0x4c98a7=path[_0x6d1e('0x4f')](_0x6d1e('0x86'),_0x347d61,_0xe4d48b[0x0],_0x3add5f);}else{_0x4c98a7=_0x3add5f;}}else{logger[_0x6d1e('0x64')](_0x6d1e('0x88'));}}else if(_0x4fc2a8===_0x6d1e('0x89')){_0x26b1a9=_0x19f526[_0x6d1e('0x76')]['scriptName'];_0x11ecee=_0x19f526['parameters'][_0x6d1e('0x7d')];if(_0x6d1e('0x23')!=typeof _0x19f526['parameters'][_0x6d1e('0x84')]){if(_0x6d1e('0x23')!=typeof _0x19f526[_0x6d1e('0x76')]['views'][_0x6d1e('0x78')]){var _0x216cd0=_0x19f526[_0x6d1e('0x76')][_0x6d1e('0x84')][_0x6d1e('0x78')];if(!/^(f|ht)tps?:\/\//i[_0x6d1e('0x85')](_0x216cd0)){_0x594088=path['join']('plugins',_0x347d61,_0xe4d48b[0x0],_0x216cd0);}else{_0x594088=_0x216cd0;}}if('undefined'!=typeof _0x19f526['parameters'][_0x6d1e('0x84')][_0x6d1e('0x79')]){var _0x3add5f=_0x19f526[_0x6d1e('0x76')][_0x6d1e('0x84')][_0x6d1e('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x6d1e('0x85')](_0x3add5f)){_0x4c98a7=path['join'](_0x6d1e('0x86'),_0x347d61,_0xe4d48b[0x0],_0x3add5f);}else{_0x4c98a7=_0x3add5f;}}}}var _0x4dc1f7={'name':_0x4a4a7b,'description':_0x21192b,'path':path[_0x6d1e('0x4f')](_0x347d61,_0xe4d48b[0x0]),'type':_0x4fc2a8,'sidebar':_0x5bb941,'icon':_0x29da48,'adminUrl':_0x594088,'agentUrl':_0x4c98a7,'scriptName':_0x26b1a9,'scriptPath':_0x11ecee,'version':_0x39756d};removeReferences(_0x14c039,null);return db[_0x6d1e('0x46')][_0x6d1e('0x8a')](_0x4dc1f7)['then'](function(_0x38fdae){var _0x51c83a={'role':_0x1ac0c1[_0x6d1e('0x8b')][_0x6d1e('0x8c')],'userProfileId':_0x1ac0c1[_0x6d1e('0x8b')]['userProfileId']};if(!_0x51c83a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51c83a['role']===_0x6d1e('0x8d')){var _0x161cae=_0x38fdae[_0x6d1e('0x2c')]({'plain':!![]});return db[_0x6d1e('0x8e')][_0x6d1e('0x4d')]({'where':{'name':'Plugins','userProfileId':_0x51c83a[_0x6d1e('0x8f')]},'raw':!![]})[_0x6d1e('0x2a')](function(_0xb9a54a){if(_0xb9a54a&&_0xb9a54a[_0x6d1e('0x90')]===0x0){return db['UserProfileResource'][_0x6d1e('0x8a')]({'name':_0x161cae[_0x6d1e('0x30')],'resourceId':_0x161cae['id'],'type':_0xb9a54a['name'],'sectionId':_0xb9a54a['id']},{})['then'](function(){return _0x38fdae;});}else{return _0x38fdae;}})[_0x6d1e('0x4a')](function(_0x10fe21){logger[_0x6d1e('0x58')](_0x6d1e('0x91'),_0x10fe21);throw _0x10fe21;});}return _0x38fdae;})[_0x6d1e('0x2a')](respondWithResult(_0x9abecf,null))[_0x6d1e('0x4a')](handleError(_0x9abecf,null));}});}catch(_0x1d2e65){_0x9abecf[_0x6d1e('0x20')](0x1f4)['send'](_0x1d2e65);}};function removeReferences(_0x4d4657,_0x75e4e){try{if(_0x4d4657){fs[_0x6d1e('0x63')](_0x4d4657);logger['info'](_0x6d1e('0x92'));}if(_0x75e4e){rimraf(_0x75e4e,function(){});logger['info'](_0x6d1e('0x93'));}}catch(_0x2430e8){logger['error'](_0x2430e8);}}exports[_0x6d1e('0x29')]=function(_0x263242,_0x2a758f,_0x6c1ece){return db[_0x6d1e('0x46')][_0x6d1e('0x4d')]({'where':{'id':_0x263242['params']['id']}})[_0x6d1e('0x2a')](handleEntityNotFound(_0x2a758f,null))[_0x6d1e('0x2a')](saveUpdates(_0x263242[_0x6d1e('0x8b')],null))[_0x6d1e('0x2a')](respondWithResult(_0x2a758f,null))['catch'](handleError(_0x2a758f,null));};exports[_0x6d1e('0x94')]=function(_0x58be90,_0x667f18,_0x29f517){return db[_0x6d1e('0x46')][_0x6d1e('0x4d')]({'where':{'id':_0x58be90['params']['id']}})[_0x6d1e('0x2a')](function(_0x47bc13){if(_0x47bc13){return _0x47bc13[_0x6d1e('0x2b')]();}})['then'](function(_0x1544a2){rimraf(path[_0x6d1e('0x4f')](config[_0x6d1e('0x50')],_0x6d1e('0x51'),path[_0x6d1e('0x5e')](_0x1544a2[_0x6d1e('0x8')])),function(){});return _0x1544a2;})[_0x6d1e('0x2a')](handleEntityNotFound(_0x667f18,null))[_0x6d1e('0x2a')](respondWithStatusCode(_0x667f18,null))[_0x6d1e('0x4a')](handleError(_0x667f18,null));};exports['webhookGet']=function(_0xa51661,_0x152985,_0x4ca691){return BPromise['resolve']()[_0x6d1e('0x2a')](function(){if(!_0xa51661[_0x6d1e('0x37')]['path']){throw new Error(_0x6d1e('0x95'));}if(!_0xa51661[_0x6d1e('0x37')][_0x6d1e('0x96')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x18bf5e=_0xa51661['query'][_0x6d1e('0x97')]?_0xa51661[_0x6d1e('0x37')][_0x6d1e('0x97')]+':'+_0xa51661[_0x6d1e('0x37')][_0x6d1e('0x96')]:'http://localhost:'+_0xa51661[_0x6d1e('0x37')][_0x6d1e('0x96')];var _0x5542fd=_0xa51661[_0x6d1e('0x37')]['json']?_0xa51661[_0x6d1e('0x37')][_0x6d1e('0x21')]:!![];var _0x4d441e=_0xa51661[_0x6d1e('0x37')][_0x6d1e('0x98')]?_0xa51661[_0x6d1e('0x37')][_0x6d1e('0x98')]:null;var _0x1da64d={'method':_0xa51661[_0x6d1e('0x99')],'uri':util[_0x6d1e('0x52')](_0x6d1e('0x9a'),_0x18bf5e,_0xa51661[_0x6d1e('0x37')]['path']),'json':_0x5542fd,'resolveWithFullResponse':!![],'encoding':_0x4d441e,'qs':_0xa51661['query']};if(_0xa51661['headers']){_0x1da64d[_0x6d1e('0x9b')]=_0xa51661['headers'];if(_0x1da64d[_0x6d1e('0x9b')]['content-length']){delete _0x1da64d['headers']['content-length'];}}if(_0x1da64d[_0x6d1e('0x9b')]['content-type']){delete _0x1da64d[_0x6d1e('0x9b')][_0x6d1e('0x9c')];}return rp(_0x1da64d);})[_0x6d1e('0x2a')](function(_0x3c5105){if(_0x3c5105){_0x152985[_0x6d1e('0x26')](_0x3c5105[_0x6d1e('0x9b')]);logger[_0x6d1e('0x64')](_0x3c5105['body']);if(_[_0x6d1e('0x9d')](_0xa51661['query'][_0x6d1e('0x8')],_0x6d1e('0x4e'))&&_0x3c5105[_0x6d1e('0x9e')]==0x1f4){return _0x152985[_0x6d1e('0x1f')](_0x3c5105[_0x6d1e('0x9e')]);}else{return _0x152985[_0x6d1e('0x20')](_0x3c5105[_0x6d1e('0x9e')])[_0x6d1e('0x31')](_0x3c5105['body']);}}else{return _0x152985[_0x6d1e('0x1f')](0xc8);}})[_0x6d1e('0x4a')](handleError(_0x152985,null));};exports[_0x6d1e('0x9f')]=function(_0x1071cc,_0x16828c,_0x3c759f){return BPromise[_0x6d1e('0xa0')]()[_0x6d1e('0x2a')](function(){if(!_0x1071cc[_0x6d1e('0x37')][_0x6d1e('0x8')]){throw new Error(_0x6d1e('0x95'));}if(!_0x1071cc[_0x6d1e('0x37')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2c9987=_0x1071cc['query'][_0x6d1e('0x97')]?_0x1071cc[_0x6d1e('0x37')][_0x6d1e('0x97')]+':'+_0x1071cc['query'][_0x6d1e('0x96')]:_0x6d1e('0xa1')+_0x1071cc[_0x6d1e('0x37')][_0x6d1e('0x96')];var _0xad1dc6=_0x1071cc[_0x6d1e('0x37')][_0x6d1e('0x21')]?_0x1071cc['query'][_0x6d1e('0x21')]:!![];var _0x3b090d=_0x1071cc['query'][_0x6d1e('0x98')]?_0x1071cc[_0x6d1e('0x37')]['encoding']:null;var _0x529676={'method':_0x1071cc[_0x6d1e('0x99')],'uri':util[_0x6d1e('0x52')](_0x6d1e('0x9a'),_0x2c9987,_0x1071cc['query'][_0x6d1e('0x8')]),'json':_0xad1dc6,'resolveWithFullResponse':!![],'encoding':_0x3b090d,'body':_0x1071cc[_0x6d1e('0x8b')]};if(_0x1071cc[_0x6d1e('0x9b')]){_0x529676['headers']=_0x1071cc['headers'];if(_0x529676[_0x6d1e('0x9b')][_0x6d1e('0xa2')]){delete _0x529676['headers'][_0x6d1e('0xa2')];}}if(_0x529676[_0x6d1e('0x9b')][_0x6d1e('0x9c')]){delete _0x529676['headers']['content-type'];}return rp(_0x529676);})[_0x6d1e('0x2a')](function(_0x399e08){if(_0x399e08){_0x16828c[_0x6d1e('0x26')](_0x399e08[_0x6d1e('0x9b')]);logger[_0x6d1e('0x64')](_0x399e08[_0x6d1e('0x8b')]);return _0x16828c['status'](_0x399e08[_0x6d1e('0x9e')])['send'](_0x399e08[_0x6d1e('0x8b')]);}else{return _0x16828c[_0x6d1e('0x1f')](0xc8);}})[_0x6d1e('0x4a')](handleError(_0x16828c,null));};
\ No newline at end of file
+var _0x0aff=['%s%s','headers','content-length','content-type','endsWith','statusCode','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./plugin.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','Plugins','UserProfileResource','end','name','send','index','map','Plugin','type','key','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','fields','download','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','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','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method'];(function(_0x8e815a,_0x5248b6){var _0x4c01fa=function(_0x3965e3){while(--_0x3965e3){_0x8e815a['push'](_0x8e815a['shift']());}};_0x4c01fa(++_0x5248b6);}(_0x0aff,0xb5));var _0xf0af=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0x0aff[_0x4d337e];return _0x247963;};'use strict';var emlformat=require(_0xf0af('0x0'));var rimraf=require(_0xf0af('0x1'));var zipdir=require(_0xf0af('0x2'));var jsonpatch=require(_0xf0af('0x3'));var rp=require(_0xf0af('0x4'));var moment=require(_0xf0af('0x5'));var BPromise=require(_0xf0af('0x6'));var Mustache=require(_0xf0af('0x7'));var util=require('util');var path=require(_0xf0af('0x8'));var sox=require(_0xf0af('0x9'));var csv=require(_0xf0af('0xa'));var ejs=require(_0xf0af('0xb'));var fs=require('fs');var fs_extra=require(_0xf0af('0xc'));var _=require(_0xf0af('0xd'));var squel=require(_0xf0af('0xe'));var crypto=require(_0xf0af('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf0af('0x10'));var toCsv=require(_0xf0af('0xa'));var querystring=require(_0xf0af('0x11'));var Papa=require(_0xf0af('0x12'));var extract=require(_0xf0af('0x13'));var rimraf=require(_0xf0af('0x1'));var archiver=require(_0xf0af('0x14'));var Redis=require(_0xf0af('0x15'));var authService=require(_0xf0af('0x16'));var qs=require(_0xf0af('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0af('0x18'));var logger=require(_0xf0af('0x19'))('api');var utils=require(_0xf0af('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xf0af('0x1b'));var db=require(_0xf0af('0x1c'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xf0af('0x1d'),'port':0x18eb});var socket=require(_0xf0af('0x1e'))(new Redis(config[_0xf0af('0x1f')]));require(_0xf0af('0x20'))[_0xf0af('0x21')](socket);function respondWithStatusCode(_0x30f076,_0x303cb3){_0x303cb3=_0x303cb3||0xcc;return function(_0x5946a2){if(_0x5946a2){return _0x30f076[_0xf0af('0x22')](_0x303cb3);}return _0x30f076[_0xf0af('0x23')](_0x303cb3)['end']();};}function respondWithResult(_0xa2878,_0x340700){_0x340700=_0x340700||0xc8;return function(_0xfeff0){if(_0xfeff0){return _0xa2878[_0xf0af('0x23')](_0x340700)[_0xf0af('0x24')](_0xfeff0);}};}function respondWithFilteredResult(_0xe64431,_0x3d318f){return function(_0xdb9874){if(_0xdb9874){var _0x594362=typeof _0x3d318f[_0xf0af('0x25')]===_0xf0af('0x26')&&typeof _0x3d318f[_0xf0af('0x27')]===_0xf0af('0x26');var _0x363f9b=_0xdb9874[_0xf0af('0x28')];var _0xcadd70=_0x594362?0x0:_0x3d318f[_0xf0af('0x25')];var _0x25fb55=_0x594362?_0xdb9874['count']:_0x3d318f[_0xf0af('0x25')]+_0x3d318f[_0xf0af('0x27')];var _0x387098;if(_0x25fb55>=_0x363f9b){_0x25fb55=_0x363f9b;_0x387098=0xc8;}else{_0x387098=0xce;}_0xe64431['status'](_0x387098);return _0xe64431[_0xf0af('0x29')](_0xf0af('0x2a'),_0xcadd70+'-'+_0x25fb55+'/'+_0x363f9b)[_0xf0af('0x24')](_0xdb9874);}return null;};}function patchUpdates(_0x2b4021){return function(_0x51e183){try{jsonpatch[_0xf0af('0x2b')](_0x51e183,_0x2b4021,!![]);}catch(_0x2fce17){return BPromise[_0xf0af('0x2c')](_0x2fce17);}return _0x51e183['save']();};}function saveUpdates(_0x48620b,_0x2aca4f){return function(_0x528e96){if(_0x528e96){return _0x528e96[_0xf0af('0x2d')](_0x48620b)['then'](function(_0x4f47bd){return _0x4f47bd;});}return null;};}function removeEntity(_0x5d1349,_0x8854e8){return function(_0x2eb398){if(_0x2eb398){return _0x2eb398[_0xf0af('0x2e')]()[_0xf0af('0x2f')](function(){var _0x112f07=_0x2eb398['get']({'plain':!![]});var _0x34ecec=_0xf0af('0x30');return db[_0xf0af('0x31')][_0xf0af('0x2e')]({'where':{'type':_0x34ecec,'resourceId':_0x112f07['id']}})[_0xf0af('0x2f')](function(){return _0x2eb398;});})['then'](function(){_0x5d1349[_0xf0af('0x23')](0xcc)[_0xf0af('0x32')]();});}};}function handleEntityNotFound(_0x5c9813,_0x293ad6){return function(_0x2286f1){if(!_0x2286f1){_0x5c9813[_0xf0af('0x22')](0x194);}return _0x2286f1;};}function handleError(_0x14aee1,_0x387c41){_0x387c41=_0x387c41||0x1f4;return function(_0x43103e){logger['error'](_0x43103e['stack']);if(_0x43103e[_0xf0af('0x33')]){delete _0x43103e[_0xf0af('0x33')];}_0x14aee1[_0xf0af('0x23')](_0x387c41)[_0xf0af('0x34')](_0x43103e);};}exports[_0xf0af('0x35')]=function(_0x510fab,_0x1fdcf7){var _0x44befe={},_0x1bc8d8={},_0x557d49={'count':0x0,'rows':[]};var _0x36d0a8=_[_0xf0af('0x36')](db[_0xf0af('0x37')]['rawAttributes'],function(_0x24db3c){return{'name':_0x24db3c['fieldName'],'type':_0x24db3c[_0xf0af('0x38')][_0xf0af('0x39')]};});_0x1bc8d8['model']=_['map'](_0x36d0a8,'name');_0x1bc8d8[_0xf0af('0x3a')]=_['keys'](_0x510fab['query']);_0x1bc8d8[_0xf0af('0x3b')]=_['intersection'](_0x1bc8d8[_0xf0af('0x3c')],_0x1bc8d8['query']);_0x44befe[_0xf0af('0x3d')]=_[_0xf0af('0x3e')](_0x1bc8d8[_0xf0af('0x3c')],qs['fields'](_0x510fab[_0xf0af('0x3a')]['fields']));_0x44befe['attributes']=_0x44befe['attributes'][_0xf0af('0x3f')]?_0x44befe['attributes']:_0x1bc8d8['model'];if(!_0x510fab[_0xf0af('0x3a')][_0xf0af('0x40')](_0xf0af('0x41'))){_0x44befe[_0xf0af('0x27')]=qs[_0xf0af('0x27')](_0x510fab[_0xf0af('0x3a')][_0xf0af('0x27')]);_0x44befe[_0xf0af('0x25')]=qs['offset'](_0x510fab[_0xf0af('0x3a')][_0xf0af('0x25')]);}_0x44befe['order']=qs['sort'](_0x510fab[_0xf0af('0x3a')][_0xf0af('0x42')]);_0x44befe[_0xf0af('0x43')]=qs[_0xf0af('0x3b')](_[_0xf0af('0x44')](_0x510fab[_0xf0af('0x3a')],_0x1bc8d8[_0xf0af('0x3b')]),_0x36d0a8);if(_0x510fab[_0xf0af('0x3a')][_0xf0af('0x45')]){_0x44befe[_0xf0af('0x43')]=_[_0xf0af('0x46')](_0x44befe[_0xf0af('0x43')],{'$or':_[_0xf0af('0x36')](_0x36d0a8,function(_0x37a048){if(_0x37a048[_0xf0af('0x38')]!==_0xf0af('0x47')){var _0x597e96={};_0x597e96[_0x37a048[_0xf0af('0x33')]]={'$like':'%'+_0x510fab[_0xf0af('0x3a')][_0xf0af('0x45')]+'%'};return _0x597e96;}})});}_0x44befe=_[_0xf0af('0x46')]({},_0x44befe,_0x510fab[_0xf0af('0x48')]);var _0x16f3d3={'where':_0x44befe[_0xf0af('0x43')]};return db[_0xf0af('0x37')]['count'](_0x16f3d3)[_0xf0af('0x2f')](function(_0x189df0){_0x557d49['count']=_0x189df0;if(_0x510fab[_0xf0af('0x3a')][_0xf0af('0x49')]){_0x44befe[_0xf0af('0x4a')]=[{'all':!![]}];}return db[_0xf0af('0x37')][_0xf0af('0x4b')](_0x44befe);})['then'](function(_0x10cd9e){_0x557d49['rows']=_0x10cd9e;return _0x557d49;})[_0xf0af('0x2f')](respondWithFilteredResult(_0x1fdcf7,_0x44befe))[_0xf0af('0x4c')](handleError(_0x1fdcf7,null));};exports[_0xf0af('0x4d')]=function(_0x1c442e,_0x77485d){var _0x18491f={'raw':!![],'where':{'id':_0x1c442e[_0xf0af('0x4e')]['id']}},_0x418d24={};_0x418d24['model']=_[_0xf0af('0x4f')](db[_0xf0af('0x37')][_0xf0af('0x50')]);_0x418d24[_0xf0af('0x3a')]=_[_0xf0af('0x4f')](_0x1c442e[_0xf0af('0x3a')]);_0x418d24[_0xf0af('0x3b')]=_['intersection'](_0x418d24[_0xf0af('0x3c')],_0x418d24[_0xf0af('0x3a')]);_0x18491f[_0xf0af('0x3d')]=_['intersection'](_0x418d24[_0xf0af('0x3c')],qs[_0xf0af('0x51')](_0x1c442e['query'][_0xf0af('0x51')]));_0x18491f[_0xf0af('0x3d')]=_0x18491f[_0xf0af('0x3d')][_0xf0af('0x3f')]?_0x18491f[_0xf0af('0x3d')]:_0x418d24[_0xf0af('0x3c')];if(_0x1c442e[_0xf0af('0x3a')][_0xf0af('0x49')]){_0x18491f[_0xf0af('0x4a')]=[{'all':!![]}];}_0x18491f=_[_0xf0af('0x46')]({},_0x18491f,_0x1c442e[_0xf0af('0x48')]);return db[_0xf0af('0x37')]['find'](_0x18491f)[_0xf0af('0x2f')](handleEntityNotFound(_0x77485d,null))[_0xf0af('0x2f')](respondWithResult(_0x77485d,null))[_0xf0af('0x4c')](handleError(_0x77485d,null));};exports[_0xf0af('0x52')]=function(_0x36da24,_0x59a927,_0xa4c88){return db['Plugin'][_0xf0af('0x53')]({'where':{'id':_0x36da24['params']['id']},'attributes':[_0xf0af('0x33'),_0xf0af('0x8')],'raw':!![]})[_0xf0af('0x2f')](handleEntityNotFound(_0x59a927,null))[_0xf0af('0x2f')](function(_0x278fe1){if(_0x278fe1){var _0x5dfcea=path['join'](config[_0xf0af('0x54')],_0xf0af('0x55'),util[_0xf0af('0x56')](_0xf0af('0x57'),path[_0xf0af('0x58')](_0x278fe1['path'])));var _0x5e349a=fs[_0xf0af('0x59')](_0x5dfcea);var _0x14c840=archiver(_0xf0af('0x5a'),{'zlib':{'level':0x9}});_0x14c840['on'](_0xf0af('0x5b'),function(_0x452a26){if(_0x452a26[_0xf0af('0x5c')]===_0xf0af('0x5d')){logger[_0xf0af('0x5e')](_0x452a26);}else{throw new db[(_0xf0af('0x5f'))][(_0xf0af('0x60'))](_0xf0af('0x61'));}});_0x14c840['on']('error',function(_0x305df4){throw new db['Sequelize'][(_0xf0af('0x60'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x14c840[_0xf0af('0x62')](_0x5e349a);_0x14c840[_0xf0af('0x63')](_0xf0af('0x64'),{'cwd':path[_0xf0af('0x65')](config[_0xf0af('0x54')],_0xf0af('0x55'),path[_0xf0af('0x66')](_0x278fe1['path'])),'ignore':[path['join'](path['basename'](_0x278fe1[_0xf0af('0x8')]),_0xf0af('0x67')),path[_0xf0af('0x65')](path[_0xf0af('0x58')](_0x278fe1['path']),_0xf0af('0x68'))],'nodir':!![]})[_0xf0af('0x69')]();_0x5e349a['on'](_0xf0af('0x6a'),function(){if(!fs[_0xf0af('0x6b')](_0x5dfcea)){throw new db[(_0xf0af('0x5f'))]['Error'](_0xf0af('0x6c'));}return _0x59a927[_0xf0af('0x52')](_0x5dfcea,util[_0xf0af('0x56')](_0xf0af('0x57'),path[_0xf0af('0x58')](_0x278fe1[_0xf0af('0x8')])),function(_0x4c5a96){if(_0x4c5a96){throw new db[(_0xf0af('0x5f'))]['Error'](_0xf0af('0x6d'));}fs[_0xf0af('0x6e')](_0x5dfcea);logger[_0xf0af('0x6f')](_0xf0af('0x70'));logger[_0xf0af('0x6f')](_0xf0af('0x71'));});});}return null;})[_0xf0af('0x4c')](handleError(_0x59a927,null));};exports[_0xf0af('0x72')]=function(_0x231695,_0x3982ae,_0x3b38c4){var _0x1bf43c=path['basename'](_0x231695[_0xf0af('0x73')][_0xf0af('0x74')],path[_0xf0af('0x75')](_0x231695['file'][_0xf0af('0x74')]));var _0x56ee8a=path[_0xf0af('0x65')](config['root'],_0xf0af('0x55'),_0x231695['file'][_0xf0af('0x74')]);var _0x3d0448=path[_0xf0af('0x65')](config[_0xf0af('0x54')],_0xf0af('0x55'),_0x1bf43c);logger[_0xf0af('0x6f')]('Plugin\x20upload\x20filepath:\x20%s',_0x56ee8a);logger[_0xf0af('0x6f')](_0xf0af('0x76'),_0x3d0448);try{fs['chmodSync'](_0x56ee8a,parseInt('0777',0x8));extract(_0x56ee8a,{'dir':_0x3d0448},function(_0x360c5e){if(_0x360c5e){logger[_0xf0af('0x5e')](_0x360c5e);handleError(_0x360c5e,!![]);};var _0x51b834=fs[_0xf0af('0x77')](_0x3d0448);if(_0x51b834['length']>0x1){removeReferences(_0x56ee8a,_0x3d0448);logger[_0xf0af('0x5e')](_0xf0af('0x78'));return _0x3b38c4(new Error(_0xf0af('0x78')));}var _0x25b7c5=fs[_0xf0af('0x79')](path[_0xf0af('0x65')](_0x3d0448,_0x51b834[0x0]));if(_0x25b7c5[_0xf0af('0x7a')]()){removeReferences(_0x56ee8a,_0x3d0448);logger['error'](_0xf0af('0x78'));return _0x3b38c4(new Error('Invalid\x20plugin\x20structure'));}if(_0x25b7c5[_0xf0af('0x7b')]()){var _0x3e5770=fs[_0xf0af('0x77')](path[_0xf0af('0x65')](_0x3d0448,_0x51b834[0x0]));if(_0x3e5770[_0xf0af('0x3f')]===0x0){removeReferences(_0x56ee8a,_0x3d0448);logger['error'](_0xf0af('0x78'));return _0x3b38c4(new Error(_0xf0af('0x78')));}var _0x24e8c4=_0x3e5770[_0xf0af('0x7c')](function(_0x402b2b){return _0x402b2b==='manifest.json';});if(!_0x24e8c4){return _0x3b38c4(new Error('Plugin\x20manifest\x20missing'));}var _0x140fac=fs[_0xf0af('0x7d')](path[_0xf0af('0x65')](_0x3d0448,_0x51b834[0x0],_0xf0af('0x7e')));var _0x4db305=JSON['parse'](_0x140fac);if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x33')]){return _0x3b38c4(new Error(_0xf0af('0x7f')));}if(_0xf0af('0x26')==typeof _0x4db305['type']){return _0x3b38c4(new Error(_0xf0af('0x80')));}if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x81')]){return _0x3b38c4(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x4db305[_0xf0af('0x82')]){return _0x3b38c4(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4db305[_0xf0af('0x38')]==='html'){if(_0xf0af('0x26')==typeof _0x4db305['parameters'][_0xf0af('0x83')]){return _0x3b38c4(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x83')][_0xf0af('0x84')]&&_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x83')][_0xf0af('0x85')]){return _0x3b38c4(new Error(_0xf0af('0x86')));}}else if(_0x4db305[_0xf0af('0x38')]===_0xf0af('0x87')){if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x88')]){return _0x3b38c4(new Error(_0xf0af('0x89')));}if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x8a')]){return _0x3b38c4(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3b38c4(new Error(_0xf0af('0x8b')));}var _0x1ce5d9=_0x4db305['name'];var _0x1d691f=_0x4db305[_0xf0af('0x8c')];var _0xbccd12=_0x4db305[_0xf0af('0x38')];var _0x16a674=_0x4db305[_0xf0af('0x8d')]?_0x4db305[_0xf0af('0x8d')]:_0xf0af('0x8e');var _0x15fa10=_0x4db305[_0xf0af('0x8f')]?_0x4db305[_0xf0af('0x8f')]:_0xf0af('0x90');var _0x19e711='';var _0x416bf2='';var _0x589928='';var _0x583a13='';var _0x2aceb4=_0x4db305[_0xf0af('0x81')];if(_0xbccd12==='html'){if(_0xf0af('0x26')!=typeof _0x4db305[_0xf0af('0x82')]['views'][_0xf0af('0x84')]){var _0x1e1e7c=_0x4db305[_0xf0af('0x82')][_0xf0af('0x83')][_0xf0af('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xf0af('0x91')](_0x1e1e7c)){_0x19e711=path[_0xf0af('0x65')](_0xf0af('0x92'),_0x1bf43c,_0x51b834[0x0],_0x1e1e7c);}else{_0x19e711=_0x1e1e7c;}}else{logger[_0xf0af('0x6f')](_0xf0af('0x93'));}if(_0xf0af('0x26')!=typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x83')][_0xf0af('0x85')]){var _0x18254a=_0x4db305['parameters'][_0xf0af('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf0af('0x91')](_0x18254a)){_0x416bf2=path[_0xf0af('0x65')]('plugins',_0x1bf43c,_0x51b834[0x0],_0x18254a);}else{_0x416bf2=_0x18254a;}}else{logger[_0xf0af('0x6f')](_0xf0af('0x94'));}}else if(_0xbccd12==='script'){_0x589928=_0x4db305['parameters']['scriptName'];_0x583a13=_0x4db305['parameters']['scriptPath'];if(_0xf0af('0x26')!=typeof _0x4db305[_0xf0af('0x82')]['views']){if(_0xf0af('0x26')!=typeof _0x4db305['parameters'][_0xf0af('0x83')][_0xf0af('0x84')]){var _0x1e1e7c=_0x4db305[_0xf0af('0x82')][_0xf0af('0x83')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xf0af('0x91')](_0x1e1e7c)){_0x19e711=path[_0xf0af('0x65')](_0xf0af('0x92'),_0x1bf43c,_0x51b834[0x0],_0x1e1e7c);}else{_0x19e711=_0x1e1e7c;}}if(_0xf0af('0x26')!=typeof _0x4db305['parameters'][_0xf0af('0x83')][_0xf0af('0x85')]){var _0x18254a=_0x4db305[_0xf0af('0x82')][_0xf0af('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf0af('0x91')](_0x18254a)){_0x416bf2=path[_0xf0af('0x65')](_0xf0af('0x92'),_0x1bf43c,_0x51b834[0x0],_0x18254a);}else{_0x416bf2=_0x18254a;}}}}var _0x4e9680={'name':_0x1ce5d9,'description':_0x1d691f,'path':path[_0xf0af('0x65')](_0x1bf43c,_0x51b834[0x0]),'type':_0xbccd12,'sidebar':_0x16a674,'icon':_0x15fa10,'adminUrl':_0x19e711,'agentUrl':_0x416bf2,'scriptName':_0x589928,'scriptPath':_0x583a13,'version':_0x2aceb4};removeReferences(_0x56ee8a,null);return db[_0xf0af('0x37')][_0xf0af('0x95')](_0x4e9680)[_0xf0af('0x2f')](function(_0x599afc){var _0x2c4d37={'role':_0x231695[_0xf0af('0x96')][_0xf0af('0x97')],'userProfileId':_0x231695[_0xf0af('0x96')][_0xf0af('0x98')]};if(!_0x2c4d37)throw new Error(_0xf0af('0x99'));if(_0x2c4d37['role']===_0xf0af('0x9a')){var _0x35c5e4=_0x599afc[_0xf0af('0x9b')]({'plain':!![]});return db[_0xf0af('0x9c')]['find']({'where':{'name':_0xf0af('0x30'),'userProfileId':_0x2c4d37[_0xf0af('0x98')]},'raw':!![]})['then'](function(_0x596589){if(_0x596589&&_0x596589[_0xf0af('0x9d')]===0x0){return db['UserProfileResource'][_0xf0af('0x95')]({'name':_0x35c5e4['name'],'resourceId':_0x35c5e4['id'],'type':_0x596589[_0xf0af('0x33')],'sectionId':_0x596589['id']},{})['then'](function(){return _0x599afc;});}else{return _0x599afc;}})[_0xf0af('0x4c')](function(_0x291a7e){logger[_0xf0af('0x5e')](_0xf0af('0x9e'),_0x291a7e);throw _0x291a7e;});}return _0x599afc;})[_0xf0af('0x2f')](respondWithResult(_0x3982ae,null))[_0xf0af('0x4c')](handleError(_0x3982ae,null));}});}catch(_0x39d080){_0x3982ae[_0xf0af('0x23')](0x1f4)[_0xf0af('0x34')](_0x39d080);}};function removeReferences(_0x33377c,_0x12ef02){try{if(_0x33377c){fs[_0xf0af('0x6e')](_0x33377c);logger['info']('Zip\x20archive\x20removed');}if(_0x12ef02){rimraf(_0x12ef02,function(){});logger[_0xf0af('0x6f')]('Extracted\x20folder\x20removed');}}catch(_0x2f0282){logger['error'](_0x2f0282);}}exports[_0xf0af('0x2d')]=function(_0x1ece34,_0x1c5b46,_0x18da66){return db[_0xf0af('0x37')][_0xf0af('0x53')]({'where':{'id':_0x1ece34[_0xf0af('0x4e')]['id']}})[_0xf0af('0x2f')](handleEntityNotFound(_0x1c5b46,null))['then'](saveUpdates(_0x1ece34[_0xf0af('0x96')],null))['then'](respondWithResult(_0x1c5b46,null))['catch'](handleError(_0x1c5b46,null));};exports['delete']=function(_0x17e0ae,_0x51dfda,_0x4fe755){return db[_0xf0af('0x37')][_0xf0af('0x53')]({'where':{'id':_0x17e0ae[_0xf0af('0x4e')]['id']}})['then'](function(_0x477fd6){if(_0x477fd6){return _0x477fd6[_0xf0af('0x2e')]();}})[_0xf0af('0x2f')](function(_0x403d48){rimraf(path[_0xf0af('0x65')](config[_0xf0af('0x54')],_0xf0af('0x55'),path[_0xf0af('0x66')](_0x403d48[_0xf0af('0x8')])),function(){});return _0x403d48;})[_0xf0af('0x2f')](handleEntityNotFound(_0x51dfda,null))['then'](respondWithStatusCode(_0x51dfda,null))[_0xf0af('0x4c')](handleError(_0x51dfda,null));};exports[_0xf0af('0x9f')]=function(_0x216a21,_0x48e5c8,_0x879c55){return BPromise[_0xf0af('0xa0')]()[_0xf0af('0x2f')](function(){if(!_0x216a21['query'][_0xf0af('0x8')]){throw new Error(_0xf0af('0xa1'));}if(!_0x216a21['query'][_0xf0af('0xa2')]){throw new Error(_0xf0af('0xa3'));}var _0x335527=_0x216a21[_0xf0af('0x3a')][_0xf0af('0xa4')]?_0x216a21['query'][_0xf0af('0xa4')]+':'+_0x216a21['query'][_0xf0af('0xa2')]:'http://localhost:'+_0x216a21['query'][_0xf0af('0xa2')];var _0x2e5e93=_0x216a21[_0xf0af('0x3a')][_0xf0af('0x24')]?_0x216a21[_0xf0af('0x3a')][_0xf0af('0x24')]:!![];var _0x4379e5=_0x216a21['query'][_0xf0af('0xa5')]?_0x216a21[_0xf0af('0x3a')]['encoding']:null;var _0x5c6926={'method':_0x216a21[_0xf0af('0xa6')],'uri':util[_0xf0af('0x56')](_0xf0af('0xa7'),_0x335527,_0x216a21[_0xf0af('0x3a')][_0xf0af('0x8')]),'json':_0x2e5e93,'resolveWithFullResponse':!![],'encoding':_0x4379e5,'qs':_0x216a21[_0xf0af('0x3a')]};if(_0x216a21[_0xf0af('0xa8')]){_0x5c6926[_0xf0af('0xa8')]=_0x216a21[_0xf0af('0xa8')];if(_0x5c6926['headers']['content-length']){delete _0x5c6926[_0xf0af('0xa8')][_0xf0af('0xa9')];}}if(_0x5c6926['headers']['content-type']){delete _0x5c6926[_0xf0af('0xa8')][_0xf0af('0xaa')];}return rp(_0x5c6926);})[_0xf0af('0x2f')](function(_0x54990f){if(_0x54990f){_0x48e5c8[_0xf0af('0x29')](_0x54990f[_0xf0af('0xa8')]);logger[_0xf0af('0x6f')](_0x54990f['body']);if(_[_0xf0af('0xab')](_0x216a21['query'][_0xf0af('0x8')],'download')&&_0x54990f['statusCode']==0x1f4){return _0x48e5c8[_0xf0af('0x22')](_0x54990f['statusCode']);}else{return _0x48e5c8[_0xf0af('0x23')](_0x54990f[_0xf0af('0xac')])[_0xf0af('0x34')](_0x54990f[_0xf0af('0x96')]);}}else{return _0x48e5c8['sendStatus'](0xc8);}})[_0xf0af('0x4c')](handleError(_0x48e5c8,null));};exports['webhookPost']=function(_0x9b23c3,_0x13cbcc,_0x1accd3){return BPromise['resolve']()[_0xf0af('0x2f')](function(){if(!_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0x8')]){throw new Error(_0xf0af('0xa1'));}if(!_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa2')]){throw new Error(_0xf0af('0xa3'));}var _0x58390a=_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa4')]?_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa4')]+':'+_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa2')]:_0xf0af('0xad')+_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa2')];var _0x2a1bbf=_0x9b23c3[_0xf0af('0x3a')]['json']?_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0x24')]:!![];var _0x513a90=_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa5')]?_0x9b23c3['query'][_0xf0af('0xa5')]:null;var _0xb053f1={'method':_0x9b23c3['method'],'uri':util[_0xf0af('0x56')]('%s%s',_0x58390a,_0x9b23c3['query']['path']),'json':_0x2a1bbf,'resolveWithFullResponse':!![],'encoding':_0x513a90,'body':_0x9b23c3[_0xf0af('0x96')]};if(_0x9b23c3[_0xf0af('0xa8')]){_0xb053f1[_0xf0af('0xa8')]=_0x9b23c3[_0xf0af('0xa8')];if(_0xb053f1[_0xf0af('0xa8')][_0xf0af('0xa9')]){delete _0xb053f1['headers'][_0xf0af('0xa9')];}}if(_0xb053f1[_0xf0af('0xa8')][_0xf0af('0xaa')]){delete _0xb053f1[_0xf0af('0xa8')][_0xf0af('0xaa')];}return rp(_0xb053f1);})[_0xf0af('0x2f')](function(_0x3fcc15){if(_0x3fcc15){_0x13cbcc['set'](_0x3fcc15[_0xf0af('0xa8')]);logger[_0xf0af('0x6f')](_0x3fcc15[_0xf0af('0x96')]);return _0x13cbcc[_0xf0af('0x23')](_0x3fcc15[_0xf0af('0xac')])[_0xf0af('0x34')](_0x3fcc15[_0xf0af('0x96')]);}else{return _0x13cbcc[_0xf0af('0x22')](0xc8);}})[_0xf0af('0x4c')](handleError(_0x13cbcc,null));};
\ No newline at end of file
index 1903fc3..df5486a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038b=['emit','hook','exports','../../mysqldb','Plugin','setMaxListeners','update'];(function(_0x43f0a2,_0x1b5f70){var _0x1496ab=function(_0x3e028f){while(--_0x3e028f){_0x43f0a2['push'](_0x43f0a2['shift']());}};_0x1496ab(++_0x1b5f70);}(_0x038b,0x114));var _0xb038=function(_0x43c795,_0x51b13b){_0x43c795=_0x43c795-0x0;var _0x54a2f6=_0x038b[_0x43c795];return _0x54a2f6;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xb038('0x0'))['db'][_0xb038('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xb038('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb038('0x3'),'afterDestroy':'remove'};function emitEvent(_0x23574d){return function(_0x3d090b,_0x4a8a30,_0x3737b5){PluginEvents[_0xb038('0x4')](_0x23574d+':'+_0x3d090b['id'],_0x3d090b);PluginEvents['emit'](_0x23574d,_0x3d090b);_0x3737b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xb038('0x5')](e,emitEvent(event));}}module[_0xb038('0x6')]=PluginEvents;
\ No newline at end of file
+var _0x41d9=['hook','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0x3009e5,_0x2dc1f9){var _0x3494ff=function(_0x142c84){while(--_0x142c84){_0x3009e5['push'](_0x3009e5['shift']());}};_0x3494ff(++_0x2dc1f9);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x941d('0x0'));var Plugin=require(_0x941d('0x1'))['db'][_0x941d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x941d('0x3')](0x0);var events={'afterCreate':_0x941d('0x4'),'afterUpdate':_0x941d('0x5'),'afterDestroy':_0x941d('0x6')};function emitEvent(_0x55b5a6){return function(_0x446c52,_0x832a33,_0x5e562f){PluginEvents[_0x941d('0x7')](_0x55b5a6+':'+_0x446c52['id'],_0x446c52);PluginEvents[_0x941d('0x7')](_0x55b5a6,_0x446c52);_0x5e562f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x941d('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index 9d93b60..18704aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6305=['../../config/environment','./plugin.attributes','define','Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1ccb5d,_0x341da9){var _0x1fe071=function(_0x12433e){while(--_0x12433e){_0x1ccb5d['push'](_0x1ccb5d['shift']());}};_0x1fe071(++_0x341da9);}(_0x6305,0xad));var _0x5630=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6305[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x5630('0x0'));var util=require(_0x5630('0x1'));var logger=require(_0x5630('0x2'))(_0x5630('0x3'));var moment=require(_0x5630('0x4'));var BPromise=require(_0x5630('0x5'));var rp=require(_0x5630('0x6'));var fs=require('fs');var path=require(_0x5630('0x7'));var rimraf=require(_0x5630('0x8'));var config=require(_0x5630('0x9'));var attributes=require(_0x5630('0xa'));module['exports']=function(_0x445b7e,_0x3f8ae3){return _0x445b7e[_0x5630('0xb')](_0x5630('0xc'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b27=['rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x525b56,_0xdaac84){var _0x4b82ef=function(_0x3f8b01){while(--_0x3f8b01){_0x525b56['push'](_0x525b56['shift']());}};_0x4b82ef(++_0xdaac84);}(_0x7b27,0x186));var _0x77b2=function(_0x471a7f,_0x5de150){_0x471a7f=_0x471a7f-0x0;var _0x3aa053=_0x7b27[_0x471a7f];return _0x3aa053;};'use strict';var _=require(_0x77b2('0x0'));var util=require('util');var logger=require(_0x77b2('0x1'))(_0x77b2('0x2'));var moment=require(_0x77b2('0x3'));var BPromise=require(_0x77b2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x77b2('0x5'));var rimraf=require(_0x77b2('0x6'));var config=require('../../config/environment');var attributes=require(_0x77b2('0x7'));module[_0x77b2('0x8')]=function(_0x243b61,_0x569bce){return _0x243b61[_0x77b2('0x9')](_0x77b2('0xa'),attributes,{'tableName':_0x77b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b53df59..1d20725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83b2=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreatePlugin','Plugin','create','body','options','raw','catch','bluebird'];(function(_0x6b9d16,_0x294a14){var _0x440a7c=function(_0x201ee6){while(--_0x201ee6){_0x6b9d16['push'](_0x6b9d16['shift']());}};_0x440a7c(++_0x294a14);}(_0x83b2,0xb9));var _0x283b=function(_0x1b268f,_0x5e09ec){_0x1b268f=_0x1b268f-0x0;var _0x2df848=_0x83b2[_0x1b268f];return _0x2df848;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x283b('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x283b('0x1'))['db'];var utils=require(_0x283b('0x2'));var logger=require(_0x283b('0x3'))(_0x283b('0x4'));var config=require('../../config/environment');var jayson=require(_0x283b('0x5'));var client=jayson['client'][_0x283b('0x6')]({'port':0x232a});config[_0x283b('0x7')]=_[_0x283b('0x8')](config[_0x283b('0x7')],{'host':_0x283b('0x9'),'port':0x18eb});var socket=require(_0x283b('0xa'))(new Redis(config[_0x283b('0x7')]));require(_0x283b('0xb'))['register'](socket);function respondWithRpcPromise(_0x46f163,_0x5a2acc,_0x384534){return new BPromise(function(_0x6ceb72,_0x520864){return client[_0x283b('0xc')](_0x46f163,_0x384534)[_0x283b('0xd')](function(_0x187b57){logger[_0x283b('0xe')](_0x283b('0xf'),_0x5a2acc,'request\x20sent');logger[_0x283b('0x10')](_0x283b('0x11'),_0x5a2acc,_0x283b('0x12'),JSON[_0x283b('0x13')](_0x187b57));if(_0x187b57[_0x283b('0x14')]){if(_0x187b57['error'][_0x283b('0x15')]===0x1f4){logger[_0x283b('0x14')](_0x283b('0xf'),_0x5a2acc,_0x187b57[_0x283b('0x14')]['message']);return _0x520864(_0x187b57[_0x283b('0x14')][_0x283b('0x16')]);}logger[_0x283b('0x14')]('Plugin,\x20%s,\x20%s',_0x5a2acc,_0x187b57['error'][_0x283b('0x16')]);return _0x6ceb72(_0x187b57[_0x283b('0x14')]['message']);}else{logger['info'](_0x283b('0xf'),_0x5a2acc,_0x283b('0x12'));_0x6ceb72(_0x187b57[_0x283b('0x17')][_0x283b('0x16')]);}})['catch'](function(_0x168ad8){logger[_0x283b('0x14')](_0x283b('0xf'),_0x5a2acc,_0x168ad8);_0x520864(_0x168ad8);});});}exports[_0x283b('0x18')]=function(_0x232faa){var _0x113b49=this;return new Promise(function(_0x43f014,_0x403fcd){return db[_0x283b('0x19')][_0x283b('0x1a')](_0x232faa[_0x283b('0x1b')],{'raw':_0x232faa[_0x283b('0x1c')]?_0x232faa[_0x283b('0x1c')][_0x283b('0x1d')]===undefined?!![]:![]:!![]})[_0x283b('0xd')](function(_0x1f2d0e){logger[_0x283b('0xe')](_0x283b('0x18'),_0x232faa);logger[_0x283b('0x10')](_0x283b('0x18'),_0x232faa,JSON[_0x283b('0x13')](_0x1f2d0e));_0x43f014(_0x1f2d0e);})[_0x283b('0x1e')](function(_0x37ec5c){logger['error']('CreatePlugin',_0x37ec5c[_0x283b('0x16')],_0x232faa);_0x403fcd(_0x113b49[_0x283b('0x14')](0x1f4,_0x37ec5c['message']));});});};
\ No newline at end of file
+var _0xeee6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','body','options','raw','lodash','util','moment','randomstring'];(function(_0x1f5a09,_0x5c23e9){var _0x49be45=function(_0x138348){while(--_0x138348){_0x1f5a09['push'](_0x1f5a09['shift']());}};_0x49be45(++_0x5c23e9);}(_0xeee6,0x84));var _0x6eee=function(_0x34ef11,_0x518d62){_0x34ef11=_0x34ef11-0x0;var _0x3db266=_0xeee6[_0x34ef11];return _0x3db266;};'use strict';var _=require(_0x6eee('0x0'));var util=require(_0x6eee('0x1'));var moment=require(_0x6eee('0x2'));var BPromise=require('bluebird');var rs=require(_0x6eee('0x3'));var fs=require('fs');var Redis=require(_0x6eee('0x4'));var db=require(_0x6eee('0x5'))['db'];var utils=require(_0x6eee('0x6'));var logger=require(_0x6eee('0x7'))(_0x6eee('0x8'));var config=require(_0x6eee('0x9'));var jayson=require(_0x6eee('0xa'));var client=jayson[_0x6eee('0xb')][_0x6eee('0xc')]({'port':0x232a});config['redis']=_[_0x6eee('0xd')](config[_0x6eee('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x6eee('0xf'))(new Redis(config[_0x6eee('0xe')]));require('./plugin.socket')[_0x6eee('0x10')](socket);function respondWithRpcPromise(_0x29b96d,_0x332db2,_0x4e3449){return new BPromise(function(_0x3d44a3,_0x1c67ca){return client[_0x6eee('0x11')](_0x29b96d,_0x4e3449)[_0x6eee('0x12')](function(_0x4901af){logger[_0x6eee('0x13')]('Plugin,\x20%s,\x20%s',_0x332db2,_0x6eee('0x14'));logger[_0x6eee('0x15')](_0x6eee('0x16'),_0x332db2,_0x6eee('0x14'),JSON[_0x6eee('0x17')](_0x4901af));if(_0x4901af[_0x6eee('0x18')]){if(_0x4901af[_0x6eee('0x18')][_0x6eee('0x19')]===0x1f4){logger['error'](_0x6eee('0x1a'),_0x332db2,_0x4901af[_0x6eee('0x18')][_0x6eee('0x1b')]);return _0x1c67ca(_0x4901af[_0x6eee('0x18')]['message']);}logger['error'](_0x6eee('0x1a'),_0x332db2,_0x4901af[_0x6eee('0x18')][_0x6eee('0x1b')]);return _0x3d44a3(_0x4901af['error'][_0x6eee('0x1b')]);}else{logger[_0x6eee('0x13')](_0x6eee('0x1a'),_0x332db2,_0x6eee('0x14'));_0x3d44a3(_0x4901af[_0x6eee('0x1c')][_0x6eee('0x1b')]);}})[_0x6eee('0x1d')](function(_0x3d4f93){logger[_0x6eee('0x18')](_0x6eee('0x1a'),_0x332db2,_0x3d4f93);_0x1c67ca(_0x3d4f93);});});}exports[_0x6eee('0x1e')]=function(_0x47a2fb){var _0x3f33be=this;return new Promise(function(_0x5969bb,_0x4a1bba){return db['Plugin']['create'](_0x47a2fb[_0x6eee('0x1f')],{'raw':_0x47a2fb[_0x6eee('0x20')]?_0x47a2fb[_0x6eee('0x20')][_0x6eee('0x21')]===undefined?!![]:![]:!![]})[_0x6eee('0x12')](function(_0x241898){logger[_0x6eee('0x13')](_0x6eee('0x1e'),_0x47a2fb);logger[_0x6eee('0x15')](_0x6eee('0x1e'),_0x47a2fb,JSON[_0x6eee('0x17')](_0x241898));_0x5969bb(_0x241898);})['catch'](function(_0xed7c63){logger[_0x6eee('0x18')](_0x6eee('0x1e'),_0xed7c63[_0x6eee('0x1b')],_0x47a2fb);_0x4a1bba(_0x3f33be['error'](0x1f4,_0xed7c63[_0x6eee('0x1b')]));});});};
\ No newline at end of file
index 42f5eae..4619d65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27bc=['register','length','plugin:','./plugin.events','save','remove','removeListener'];(function(_0x133be3,_0x316778){var _0x1e7c90=function(_0x27905b){while(--_0x27905b){_0x133be3['push'](_0x133be3['shift']());}};_0x1e7c90(++_0x316778);}(_0x27bc,0x65));var _0xc27b=function(_0x14af1b,_0x62b15d){_0x14af1b=_0x14af1b-0x0;var _0x1d68d4=_0x27bc[_0x14af1b];return _0x1d68d4;};'use strict';var PluginEvents=require(_0xc27b('0x0'));var events=[_0xc27b('0x1'),_0xc27b('0x2'),'update'];function createListener(_0x28c1ca,_0x1507d7){return function(_0x1db166){_0x1507d7['emit'](_0x28c1ca,_0x1db166);};}function removeListener(_0x4ad5f9,_0x2e6a32){return function(){PluginEvents[_0xc27b('0x3')](_0x4ad5f9,_0x2e6a32);};}exports[_0xc27b('0x4')]=function(_0x569e05){for(var _0x508d57=0x0,_0x6790b=events[_0xc27b('0x5')];_0x508d57<_0x6790b;_0x508d57++){var _0x595042=events[_0x508d57];var _0x24b627=createListener(_0xc27b('0x6')+_0x595042,_0x569e05);PluginEvents['on'](_0x595042,_0x24b627);}};
\ No newline at end of file
+var _0xad52=['register','length','plugin:','./plugin.events','emit','removeListener'];(function(_0x2476b5,_0x5f31ad){var _0x298d7f=function(_0x4521bb){while(--_0x4521bb){_0x2476b5['push'](_0x2476b5['shift']());}};_0x298d7f(++_0x5f31ad);}(_0xad52,0xb7));var _0x2ad5=function(_0x13dd37,_0x1a62d7){_0x13dd37=_0x13dd37-0x0;var _0x4018ef=_0xad52[_0x13dd37];return _0x4018ef;};'use strict';var PluginEvents=require(_0x2ad5('0x0'));var events=['save','remove','update'];function createListener(_0x37851e,_0x2bf92b){return function(_0x53ef0e){_0x2bf92b[_0x2ad5('0x1')](_0x37851e,_0x53ef0e);};}function removeListener(_0x4d9580,_0x429ad9){return function(){PluginEvents[_0x2ad5('0x2')](_0x4d9580,_0x429ad9);};}exports[_0x2ad5('0x3')]=function(_0x4dadc1){for(var _0x2ff9e0=0x0,_0x40453a=events[_0x2ad5('0x4')];_0x2ff9e0<_0x40453a;_0x2ff9e0++){var _0x1795a0=events[_0x2ff9e0];var _0x185307=createListener(_0x2ad5('0x5')+_0x1795a0,_0x4dadc1);PluginEvents['on'](_0x1795a0,_0x185307);}};
\ No newline at end of file
index 99659f3..55861c3 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(_0x26cc1c,_0x4f6b44){var _0x23d79c=function(_0x4782ad){while(--_0x4782ad){_0x26cc1c['push'](_0x26cc1c['shift']());}};_0x23d79c(++_0x4f6b44);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x24a346,_0x16ec9b){var _0x1b0794=function(_0x122ab2){while(--_0x122ab2){_0x24a346['push'](_0x24a346['shift']());}};_0x1b0794(++_0x16ec9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 39f8af0..1bfd0f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ded=['name','express','motion2','catch','show','create','body','script','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','params','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','send','info','index','list','then','reject'];(function(_0x34416a,_0x621a20){var _0x37c192=function(_0x25d30a){while(--_0x25d30a){_0x34416a['push'](_0x34416a['shift']());}};_0x37c192(++_0x621a20);}(_0x4ded,0x116));var _0xd4de=function(_0x14edf3,_0x2282e1){_0x14edf3=_0x14edf3-0x0;var _0x5a3670=_0x4ded[_0x14edf3];return _0x5a3670;};'use strict';var _=require(_0xd4de('0x0'));var pm2=require(_0xd4de('0x1'));var logger=require(_0xd4de('0x2'))(_0xd4de('0x3'));var path=require(_0xd4de('0x4'));var exec=require(_0xd4de('0x5'))[_0xd4de('0x6')];var BPromise=require(_0xd4de('0x7'));function handleEntityNotFound(_0x20930f,_0x36d4dd){return function(_0x2e8d86){if(!_0x2e8d86){_0x20930f[_0xd4de('0x8')](0x194);;}return _0x2e8d86;};}function respondWithResult(_0x554a51,_0x23e5b9){_0x23e5b9=_0x23e5b9||0xc8;return function(_0x2433b8){if(_0x2433b8){return _0x554a51[_0xd4de('0x9')](_0x23e5b9)[_0xd4de('0xa')](_0x2433b8);}return null;};}function handleError(_0x4453c2,_0x1e8c35){_0x1e8c35=_0x1e8c35||0x1f4;return function(_0x5c612f){logger[_0xd4de('0xb')](_0x5c612f['stack']);if(_0x5c612f['name']){delete _0x5c612f['name'];}_0x4453c2[_0xd4de('0x9')](_0x1e8c35)[_0xd4de('0xc')](_0x5c612f);};}function execChildProcess(){return new BPromise(function(_0x4e5b10,_0x5b6dc4){exec('npm\x20install',function(_0x29e265,_0x49d931,_0x38ac13){logger[_0xd4de('0xd')](_0x49d931);logger[_0xd4de('0xd')](_0x38ac13);if(_0x29e265){logger[_0xd4de('0xb')](_0x29e265);return _0x5b6dc4(_0x29e265);}return _0x4e5b10(_0x49d931);});});}exports[_0xd4de('0xe')]=function(_0x3af6e0,_0x1dc9d5){return pm2[_0xd4de('0xf')]()[_0xd4de('0x10')](function(_0x37cb9f){if(_0x37cb9f){var _0x691ba9=_[_0xd4de('0x11')](_0x37cb9f,function(_0x164ca0){return _0x164ca0[_0xd4de('0x12')]===_0xd4de('0x13')||_0x164ca0[_0xd4de('0x12')]===_0xd4de('0x14');});return{'rows':_0x691ba9,'count':_0x691ba9['length']};}return null;})['then'](respondWithResult(_0x1dc9d5,null))[_0xd4de('0x15')](handleError(_0x1dc9d5,null));};exports[_0xd4de('0x16')]=function(_0x17b377,_0x428aa2){return pm2['describe'](_0x17b377['params']['id'])[_0xd4de('0x10')](respondWithResult(_0x428aa2,null))['then'](handleEntityNotFound(_0x428aa2,null))[_0xd4de('0x15')](handleError(_0x428aa2,null));};exports[_0xd4de('0x17')]=function(_0x50b9e3,_0xc15081){if(_0x50b9e3['body'][_0xd4de('0x12')]&&_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x19')]){var _0x8e8712=path['join'](__dirname,_0xd4de('0x1a'),_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x19')]);var _0xdb3fc=process[_0xd4de('0x1b')]();process[_0xd4de('0x1c')](path[_0xd4de('0x1d')](_0x8e8712));return execChildProcess()[_0xd4de('0x10')](function(_0x2f9de6){process[_0xd4de('0x1c')](_0xdb3fc);return pm2['start']({'name':_0x50b9e3[_0xd4de('0x18')][_0xd4de('0x12')],'script':_0x8e8712});})[_0xd4de('0x10')](function(_0x22970c){pm2[_0xd4de('0x1e')]();return _0x22970c[0x0];})[_0xd4de('0x10')](respondWithResult(_0xc15081,0xc9))[_0xd4de('0x15')](handleError(_0xc15081,null));}else{return _0xc15081[_0xd4de('0x9')](0x1f4)[_0xd4de('0xc')]({'message':_0xd4de('0x1f')});}};exports[_0xd4de('0x20')]=function(_0xb2d8a1,_0x586126){if(_0xb2d8a1[_0xd4de('0x18')]['id']){delete _0xb2d8a1[_0xd4de('0x18')]['id'];}var _0x5005b0={'online':_0xd4de('0x21'),'stopped':'stop'};if(_0x5005b0[_0xd4de('0x22')](_0xb2d8a1[_0xd4de('0x18')][_0xd4de('0x9')])){return pm2[_0x5005b0[_0xb2d8a1['body'][_0xd4de('0x9')]]](_0xb2d8a1[_0xd4de('0x23')]['id'])[_0xd4de('0x10')](respondWithResult(_0x586126,0xc8))['catch'](handleError(_0x586126,null));}else{return _0x586126[_0xd4de('0x9')](0x1f4)[_0xd4de('0xc')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x5706fe,_0x3f6491){if(_0x5706fe['body']['id']){delete _0x5706fe[_0xd4de('0x18')]['id'];}if(_0x5706fe[_0xd4de('0x23')]['id']){return pm2[_0xd4de('0x24')](_0x5706fe[_0xd4de('0x23')]['id'])['then'](function(_0x3fe6c8){pm2[_0xd4de('0x1e')]();return _0x3fe6c8[0x0];})['then'](respondWithResult(_0x3f6491,null))[_0xd4de('0x15')](handleError(_0x3f6491,null));}else{return _0x3f6491[_0xd4de('0x9')](0x1f4)['send']({'message':'Unknown\x20id'});}};
\ 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(_0x436985,_0x2e7f0b){var _0x2a8d4d=function(_0x9aadd4){while(--_0x9aadd4){_0x436985['push'](_0x436985['shift']());}};_0x2a8d4d(++_0x2e7f0b);}(_0xee5b,0x1f4));var _0xbee5=function(_0xd7c673,_0x2b510a){_0xd7c673=_0xd7c673-0x0;var _0x30d746=_0xee5b[_0xd7c673];return _0x30d746;};'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 62264a0..ab2b109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e7b=['/queues','isAuthenticated','exports','express','Router','./realtime.controller'];(function(_0x3cfb14,_0x4de48d){var _0x5b0ecf=function(_0x519b3d){while(--_0x519b3d){_0x3cfb14['push'](_0x3cfb14['shift']());}};_0x5b0ecf(++_0x4de48d);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x329c11,_0x1bca13){_0x329c11=_0x329c11-0x0;var _0x5b30ec=_0x4e7b[_0x329c11];return _0x5b30ec;};'use strict';var express=require(_0xb4e7('0x0'));var router=express[_0xb4e7('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xb4e7('0x2'));router['get'](_0xb4e7('0x3'),auth[_0xb4e7('0x4')](),controller['getQueues']);module[_0xb4e7('0x5')]=router;
\ No newline at end of file
+var _0xebc4=['get','isAuthenticated','getQueues','Router','../../components/auth/service','./realtime.controller'];(function(_0x41f745,_0x4b5c4a){var _0x2cbbcb=function(_0x4d5c74){while(--_0x4d5c74){_0x41f745['push'](_0x41f745['shift']());}};_0x2cbbcb(++_0x4b5c4a);}(_0xebc4,0xf9));var _0x4ebc=function(_0x112ddb,_0x259b69){_0x112ddb=_0x112ddb-0x0;var _0x51fff1=_0xebc4[_0x112ddb];return _0x51fff1;};'use strict';var express=require('express');var router=express[_0x4ebc('0x0')]();var auth=require(_0x4ebc('0x1'));var controller=require(_0x4ebc('0x2'));router[_0x4ebc('0x3')]('/queues',auth[_0x4ebc('0x4')](),controller[_0x4ebc('0x5')]);module['exports']=router;
\ No newline at end of file
index bd56d8e..d2b4b74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf62a=['filter','queue','some','connectedlinenum','internal','getMembers','length','UserId','accountcode','online','voiceStatus','User','Queue','findAll','QueueId','chat','sms','openchannel','fax','whatsapp','resolve','query','channel','includes','toLowerCase','Invalid\x20channel','rawAttributes','type','role','user','userProfileId','QueueCampaigns','UserProfile','getResources','findAndCountAll','rows','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','undefined','limit','count','offset','status','json','error','stack','name','send','Agents','then','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','waiting','talking','paused','outbound','push','pTalking','originated','message','dialMethod','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','agents','loggedInDb','available','busy','find'];(function(_0x4a2ea4,_0x6190d4){var _0x5086c5=function(_0x4d5b49){while(--_0x4d5b49){_0x4a2ea4['push'](_0x4a2ea4['shift']());}};_0x5086c5(++_0x6190d4);}(_0xf62a,0x85));var _0xaf62=function(_0x55550f,_0x4311c0){_0x55550f=_0x55550f-0x0;var _0x306237=_0xf62a[_0x55550f];return _0x306237;};'use strict';var util=require(_0xaf62('0x0'));var _=require(_0xaf62('0x1'));var jayson=require(_0xaf62('0x2'));var qs=require(_0xaf62('0x3'));var logger=require(_0xaf62('0x4'))(_0xaf62('0x5'));var db=require(_0xaf62('0x6'))['db'];var amiClient=jayson['client'][_0xaf62('0x7')]({'port':0x232a});var routingClient=jayson['client'][_0xaf62('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x4c8346,_0x23300c){return function(_0x3875ca){if(_0x3875ca){var _0x56cd02=typeof _0x23300c['offset']===_0xaf62('0x8')&&typeof _0x23300c[_0xaf62('0x9')]===_0xaf62('0x8');var _0x17565e=_0x3875ca[_0xaf62('0xa')];var _0x4c6caa=_0x56cd02?0x0:_0x23300c[_0xaf62('0xb')];var _0x42c26e=_0x56cd02?_0x3875ca['count']:_0x23300c[_0xaf62('0xb')]+_0x23300c[_0xaf62('0x9')];var _0x1318a7;if(_0x42c26e>=_0x17565e){_0x42c26e=_0x17565e;_0x1318a7=0xc8;}else{_0x1318a7=0xce;}_0x4c8346[_0xaf62('0xc')](_0x1318a7);return _0x4c8346['set']('Content-Range',_0x4c6caa+'-'+_0x42c26e+'/'+_0x17565e)[_0xaf62('0xd')](_0x3875ca);}return null;};}function handleError(_0x5db7a5,_0x4f98fe){_0x4f98fe=_0x4f98fe||0x1f4;return function(_0x5df279){logger[_0xaf62('0xe')](_0x5df279[_0xaf62('0xf')]);if(_0x5df279[_0xaf62('0x10')]){delete _0x5df279[_0xaf62('0x10')];}_0x5db7a5['status'](_0x4f98fe)[_0xaf62('0x11')](_0x5df279);};}function getRealtimeAgents(){return new Promise(function(_0xa77f85,_0x3d80d1){return amiClient['request'](_0xaf62('0x12'),{})[_0xaf62('0x13')](function(_0x382fd5){if(_0x382fd5[_0xaf62('0xe')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x3d04ed=_0x382fd5[_0xaf62('0x14')];return routingClient[_0xaf62('0x15')]('Agents',{})[_0xaf62('0x13')](function(_0x263cd0){if(_0x263cd0[_0xaf62('0xe')])throw new Error(_0xaf62('0x16'));var _0x4b3c22=_0x263cd0['result'];return _0xa77f85(_['merge']({},_0x3d04ed,_0x4b3c22));});})[_0xaf62('0x17')](function(_0x127c6e){_0x3d80d1(_0x127c6e);});});}function getRealtimeQueues(_0x34bbc4,_0x1f4bd5){return new Promise(function(_0xe691e7,_0x2534db){var _0x3313c4=_0x1f4bd5===_0xaf62('0x18')?amiClient:routingClient;return _0x3313c4[_0xaf62('0x15')](_[_0xaf62('0x19')](_0x1f4bd5)+_0xaf62('0x1a'),_0x34bbc4)['then'](function(_0x249cc7){if(_0x249cc7[_0xaf62('0xe')])throw new Error(util[_0xaf62('0x1b')](_0xaf62('0x1c'),_0x1f4bd5));return _0xe691e7(_0x249cc7[_0xaf62('0x14')]);})[_0xaf62('0x17')](function(_0x3c5215){_0x2534db(_0x3c5215);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x244b7e,_0x3ee3f2){return amiClient['request']('VoiceQueuesChannels',{})[_0xaf62('0x13')](function(_0x1aaf84){if(_0x1aaf84[_0xaf62('0xe')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x244b7e(_0x1aaf84[_0xaf62('0x14')]);})[_0xaf62('0x17')](function(_0x540dd0){_0x3ee3f2(_0x540dd0);});});}function initializeQueues(_0x37d3b4,_0x2cc042,_0x4f854a,_0x3d6904){var _0x5aca2d=[_0xaf62('0x1d'),'available',_0xaf62('0x1e'),_0xaf62('0x1f'),_0xaf62('0x20')];if(_0x4f854a===_0xaf62('0x18')&&_0x3d6904===_0xaf62('0x21')){_0x5aca2d[_0xaf62('0x22')](_0xaf62('0x23'),_0xaf62('0x24'),_0xaf62('0x25'),'dialActive',_0xaf62('0x26'),'Trunk',_0xaf62('0x27'),_0xaf62('0x28'),_0xaf62('0x29'),'erlangCallToSecond',_0xaf62('0x2a'),'erlangBusyFactor',_0xaf62('0x2b'),_0xaf62('0x2c'),_0xaf62('0x2d'),_0xaf62('0x2e'),_0xaf62('0x2f'),_0xaf62('0x30'),_0xaf62('0x31'),_0xaf62('0x32'),_0xaf62('0x33'),'predictiveIntervalAvgTalktime');}return _0x37d3b4[_0xaf62('0x34')](function(_0x45a2ce){var _0x482760=_0x45a2ce[_0xaf62('0x35')]({'plain':!![]});_0x482760[_0xaf62('0x36')]=[];_0x482760['paused']=0x0;_0x482760[_0xaf62('0x37')]=0x0;_0x482760['loggedIn']=0x0;_0x482760[_0xaf62('0x38')]=0x0;_0x482760[_0xaf62('0x1e')]=0x0;if(_0x4f854a===_0xaf62('0x18')){_0x482760[_0xaf62('0x1f')]=0x0;_0x482760[_0xaf62('0x39')]=0x0;if(_0x3d6904==='outbound'){_0x482760['pTalking']=0x0;_0x482760[_0xaf62('0x24')]=0x0;}}var _0x160d46=_[_0xaf62('0x3a')](_0x2cc042,['id',_0x482760['id']]);if(_0x160d46)_['merge'](_0x482760,_['pick'](_0x160d46,_0x5aca2d));return _0x482760;});}function updateAgentVoiceStatus(_0x50e188,_0x4fdf41,_0x3dd65d){var _0x76533a=_[_0xaf62('0x3b')](_0x3dd65d,[_0xaf62('0x3c'),_0x4fdf41[_0xaf62('0x10')]]);if(_0x76533a['length']===0x0)return _0x50e188[_0xaf62('0x39')]=!![];if(_[_0xaf62('0x3d')](_0x76533a,[_0xaf62('0x3e'),_0x50e188[_0xaf62('0x3f')]['toString']()]))return _0x50e188['talking']=!![];if(!_0x50e188[_0xaf62('0x1f')])return _0x50e188[_0xaf62('0x39')]=!![];}function getVoiceQueueAgents(_0x29845d,_0xdadfcf,_0x2c9e91,_0x5c2e6f){var _0x5d6846=_[_0xaf62('0x3a')](_0xdadfcf,['id',_0x29845d['id']]);if(!_0x5d6846)return _0x29845d;return _0x5d6846[_0xaf62('0x40')]({'raw':!![]})[_0xaf62('0x13')](function(_0x2e92b7){for(var _0x4dae76=0x0;_0x4dae76<_0x2e92b7[_0xaf62('0x41')];_0x4dae76++){var _0x447b4e=_[_0xaf62('0x3a')](_0x2c9e91,['id',_0x2e92b7[_0x4dae76]['UserId']]);if(!_0x447b4e){_0x447b4e={'id':_0x2e92b7[_0x4dae76][_0xaf62('0x42')],'name':_0x2e92b7[_0x4dae76][_0xaf62('0x42')],'accountcode':'','online':![]};}var _0x35ef41={'id':_0x447b4e['id'],'name':_0x447b4e[_0xaf62('0x10')],'internal':_0x447b4e[_0xaf62('0x43')],'online':Boolean(_0x447b4e[_0xaf62('0x44')]),'paused':Boolean(_0x2e92b7[_0x4dae76][_0xaf62('0x20')])};if(_0x447b4e[_0xaf62('0x45')]==='talking')updateAgentVoiceStatus(_0x35ef41,_0x29845d,_0x5c2e6f);if(_0x35ef41[_0xaf62('0x44')])_0x29845d[_0xaf62('0x37')]++;if(_0x35ef41['busy'])_0x29845d[_0xaf62('0x39')]++;if(_0x35ef41[_0xaf62('0x20')]&&!_0x35ef41['busy']&&!_0x35ef41[_0xaf62('0x1f')])_0x29845d[_0xaf62('0x20')]++;_0x29845d[_0xaf62('0x36')][_0xaf62('0x22')](_0x35ef41);}return _0x29845d;});}function getQueueAgents(_0x5cb0cd,_0x24fd6b,_0xe647b8){var _0x1f6705=_0xaf62('0x46')+_[_0xaf62('0x19')](_0xe647b8)+_0xaf62('0x47');var _0x72e939=_0xe647b8+'Pause';return db[_0x1f6705][_0xaf62('0x48')]({'where':{[_[_0xaf62('0x19')](_0xe647b8)+_0xaf62('0x49')]:_0x5cb0cd['id']},'raw':!![]})[_0xaf62('0x13')](function(_0x575e6b){for(var _0xf920aa=0x0;_0xf920aa<_0x575e6b[_0xaf62('0x41')];_0xf920aa++){var _0x4b4c93=_[_0xaf62('0x3a')](_0x24fd6b,['id',_0x575e6b[_0xf920aa][_0xaf62('0x42')]]);if(!_0x4b4c93){_0x4b4c93={'id':_0x575e6b[_0xf920aa]['UserId'],'name':_0x575e6b[_0xf920aa]['UserId'],'online':![],['pauseField']:![]};}var _0x4b6df7={'id':_0x4b4c93['id'],'name':_0x4b4c93['name'],'online':Boolean(_0x4b4c93[_0xaf62('0x44')]),'paused':Boolean(_0x4b4c93[_0x72e939])};if(_0x4b6df7[_0xaf62('0x44')])_0x5cb0cd[_0xaf62('0x37')]++;_0x5cb0cd[_0xaf62('0x36')][_0xaf62('0x22')](_0x4b6df7);}return _0x5cb0cd;});}exports['getQueues']=function(_0x5776f9,_0x1cb052){var _0x57ad6b=['mail',_0xaf62('0x4a'),_0xaf62('0x4b'),_0xaf62('0x4c'),_0xaf62('0x4d'),_0xaf62('0x4e'),_0xaf62('0x18')];var _0x9e6073={'count':0x0,'rows':[]},_0x6d7117={},_0x15c4b1,_0x54d8e8,_0xa3ffd9,_0x1aa21e,_0x463a4f;Promise[_0xaf62('0x4f')]()[_0xaf62('0x13')](function(){if(_0x5776f9[_0xaf62('0x50')][_0xaf62('0x51')]){if(!_[_0xaf62('0x52')](_0x57ad6b,_0x5776f9[_0xaf62('0x50')]['channel'][_0xaf62('0x53')]()))throw new Error(_0xaf62('0x54'));_0x15c4b1=_0x5776f9[_0xaf62('0x50')][_0xaf62('0x51')]['toLowerCase']();}var _0x230ecf=_['startCase'](_0x15c4b1)+_0xaf62('0x47');var _0x3bce8f=_[_0xaf62('0x34')](db[_0x230ecf][_0xaf62('0x55')],function(_0x37e6eb){return{'name':_0x37e6eb['fieldName'],'type':_0x37e6eb[_0xaf62('0x56')]['key']};});_0x6d7117=qs['getOptions'](_0x3bce8f,_0x5776f9);if(_0x5776f9['user'][_0xaf62('0x57')]===_0xaf62('0x58')){var _0x535fc={'params':{'id':_0x5776f9[_0xaf62('0x58')][_0xaf62('0x59')]},'query':{'section':_0x15c4b1===_0xaf62('0x18')&&_0x5776f9[_0xaf62('0x50')][_0xaf62('0x56')]===_0xaf62('0x21')?_0xaf62('0x5a'):_[_0xaf62('0x19')](_0x15c4b1)+'Queues','type':_0x5776f9[_0xaf62('0x50')][_0xaf62('0x56')],'nolimit':!![],'sort':_0xaf62('0x10'),'filter':_0x5776f9[_0xaf62('0x50')][_0xaf62('0x3b')]}};return db[_0xaf62('0x5b')][_0xaf62('0x5c')](_0x535fc);}return db[_0x230ecf][_0xaf62('0x5d')](_0x6d7117);})[_0xaf62('0x13')](function(_0x1bfb85){_0x9e6073['count']=_0x1bfb85['count'];_0x54d8e8=_0x1bfb85['rows'];return getRealtimeQueues(_0x5776f9,_0x15c4b1);})['then'](function(_0x5cd2f4){_0x1aa21e=_0x5cd2f4[_0xaf62('0x5e')];return getRealtimeAgents();})[_0xaf62('0x13')](function(_0x20f2b7){_0xa3ffd9=_0x20f2b7['rows'];if(_0x15c4b1!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x317221){_0x463a4f=_0x317221?_0x317221[_0xaf62('0x5e')]:[];return initializeQueues(_0x54d8e8,_0x1aa21e,_0x15c4b1,_0x5776f9['query'][_0xaf62('0x56')]);})[_0xaf62('0x13')](function(_0x1a6395){var _0x2602aa=_0x1a6395[_0xaf62('0x34')](function(_0x3acb93){if(_0x15c4b1===_0xaf62('0x18'))return getVoiceQueueAgents(_0x3acb93,_0x54d8e8,_0xa3ffd9,_0x463a4f);else return getQueueAgents(_0x3acb93,_0xa3ffd9,_0x15c4b1);});return Promise[_0xaf62('0x5f')](_0x2602aa);})[_0xaf62('0x13')](function(_0x11454d){_0x9e6073[_0xaf62('0x5e')]=_0x11454d;return _0x9e6073;})['then'](respondWithFilteredResult(_0x1cb052,_0x6d7117))[_0xaf62('0x17')](handleError(_0x1cb052,null));};
\ No newline at end of file
+var _0xb952=['findAndCountAll','rows','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','client','http','undefined','limit','count','offset','status','set','Content-Range','json','error','stack','name','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','merge','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','voice','push','pTalking','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','loggedInDb','busy','outbound','find','pick','length','some','connectedlinenum','internal','toString','UserId','accountcode','voiceStatus','online','User','Queue','Pause','findAll','QueueId','agents','getQueues','chat','sms','fax','resolve','query','channel','toLowerCase','Invalid\x20channel','rawAttributes','fieldName','type','key','getOptions','user','role','QueueCampaigns','getResources'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb952,0xc5));var _0x2b95=function(_0x2b9b66,_0x481352){_0x2b9b66=_0x2b9b66-0x0;var _0x4ca35a=_0xb952[_0x2b9b66];return _0x4ca35a;};'use strict';var util=require(_0x2b95('0x0'));var _=require(_0x2b95('0x1'));var jayson=require(_0x2b95('0x2'));var qs=require(_0x2b95('0x3'));var logger=require(_0x2b95('0x4'))('api');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x2b95('0x5')][_0x2b95('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0x2b95('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x2fe817,_0x15b871){return function(_0x33fb65){if(_0x33fb65){var _0x31aa22=typeof _0x15b871['offset']===_0x2b95('0x7')&&typeof _0x15b871[_0x2b95('0x8')]==='undefined';var _0xdb27a2=_0x33fb65['count'];var _0x2b7926=_0x31aa22?0x0:_0x15b871['offset'];var _0x16405e=_0x31aa22?_0x33fb65[_0x2b95('0x9')]:_0x15b871[_0x2b95('0xa')]+_0x15b871[_0x2b95('0x8')];var _0x5abce4;if(_0x16405e>=_0xdb27a2){_0x16405e=_0xdb27a2;_0x5abce4=0xc8;}else{_0x5abce4=0xce;}_0x2fe817[_0x2b95('0xb')](_0x5abce4);return _0x2fe817[_0x2b95('0xc')](_0x2b95('0xd'),_0x2b7926+'-'+_0x16405e+'/'+_0xdb27a2)[_0x2b95('0xe')](_0x33fb65);}return null;};}function handleError(_0x472399,_0x24ca62){_0x24ca62=_0x24ca62||0x1f4;return function(_0x585fe6){logger[_0x2b95('0xf')](_0x585fe6[_0x2b95('0x10')]);if(_0x585fe6[_0x2b95('0x11')]){delete _0x585fe6[_0x2b95('0x11')];}_0x472399[_0x2b95('0xb')](_0x24ca62)['send'](_0x585fe6);};}function getRealtimeAgents(){return new Promise(function(_0x4698d7,_0x2488fa){return amiClient[_0x2b95('0x12')]('Agents',{})[_0x2b95('0x13')](function(_0x18ec0a){if(_0x18ec0a['error'])throw new Error(_0x2b95('0x14'));var _0x2507da=_0x18ec0a[_0x2b95('0x15')];return routingClient[_0x2b95('0x12')](_0x2b95('0x16'),{})[_0x2b95('0x13')](function(_0x48c51f){if(_0x48c51f[_0x2b95('0xf')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x54143e=_0x48c51f[_0x2b95('0x15')];return _0x4698d7(_[_0x2b95('0x17')]({},_0x2507da,_0x54143e));});})['catch'](function(_0x3c1692){_0x2488fa(_0x3c1692);});});}function getRealtimeQueues(_0x305862,_0x350f6c){return new Promise(function(_0xc49e65,_0x40c733){var _0x1b01d1=_0x350f6c==='voice'?amiClient:routingClient;return _0x1b01d1[_0x2b95('0x12')](_[_0x2b95('0x18')](_0x350f6c)+_0x2b95('0x19'),_0x305862)[_0x2b95('0x13')](function(_0xd15295){if(_0xd15295['error'])throw new Error(util[_0x2b95('0x1a')](_0x2b95('0x1b'),_0x350f6c));return _0xc49e65(_0xd15295[_0x2b95('0x15')]);})[_0x2b95('0x1c')](function(_0x10e9ef){_0x40c733(_0x10e9ef);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4eabfe,_0xdca099){return amiClient[_0x2b95('0x12')](_0x2b95('0x1d'),{})[_0x2b95('0x13')](function(_0x5a449e){if(_0x5a449e['error'])throw new Error(_0x2b95('0x1e'));return _0x4eabfe(_0x5a449e[_0x2b95('0x15')]);})[_0x2b95('0x1c')](function(_0x3ab79b){_0xdca099(_0x3ab79b);});});}function initializeQueues(_0x415146,_0x205983,_0x5216cd,_0x3c7f19){var _0x27e089=[_0x2b95('0x1f'),_0x2b95('0x20'),_0x2b95('0x21'),_0x2b95('0x22'),_0x2b95('0x23')];if(_0x5216cd===_0x2b95('0x24')&&_0x3c7f19==='outbound'){_0x27e089[_0x2b95('0x25')](_0x2b95('0x26'),_0x2b95('0x27'),_0x2b95('0x28'),'dialActive',_0x2b95('0x29'),_0x2b95('0x2a'),_0x2b95('0x2b'),_0x2b95('0x2c'),_0x2b95('0x2d'),'erlangCallToSecond',_0x2b95('0x2e'),'erlangBusyFactor',_0x2b95('0x2f'),_0x2b95('0x30'),_0x2b95('0x31'),'predictiveIntervalAvailable',_0x2b95('0x32'),'predictiveIntervalAnsweredCalls',_0x2b95('0x33'),_0x2b95('0x34'),'predictiveIntervalAvgHoldtime',_0x2b95('0x35'));}return _0x415146[_0x2b95('0x36')](function(_0x4ae2f3){var _0xa241a8=_0x4ae2f3[_0x2b95('0x37')]({'plain':!![]});_0xa241a8['agents']=[];_0xa241a8[_0x2b95('0x23')]=0x0;_0xa241a8[_0x2b95('0x38')]=0x0;_0xa241a8[_0x2b95('0x1f')]=0x0;_0xa241a8[_0x2b95('0x20')]=0x0;_0xa241a8[_0x2b95('0x21')]=0x0;if(_0x5216cd===_0x2b95('0x24')){_0xa241a8[_0x2b95('0x22')]=0x0;_0xa241a8[_0x2b95('0x39')]=0x0;if(_0x3c7f19===_0x2b95('0x3a')){_0xa241a8['pTalking']=0x0;_0xa241a8[_0x2b95('0x27')]=0x0;}}var _0x5e26fd=_[_0x2b95('0x3b')](_0x205983,['id',_0xa241a8['id']]);if(_0x5e26fd)_[_0x2b95('0x17')](_0xa241a8,_[_0x2b95('0x3c')](_0x5e26fd,_0x27e089));return _0xa241a8;});}function updateAgentVoiceStatus(_0x52d677,_0x1301ef,_0xc30159){var _0x38b87f=_['filter'](_0xc30159,['queue',_0x1301ef[_0x2b95('0x11')]]);if(_0x38b87f[_0x2b95('0x3d')]===0x0)return _0x52d677[_0x2b95('0x39')]=!![];if(_[_0x2b95('0x3e')](_0x38b87f,[_0x2b95('0x3f'),_0x52d677[_0x2b95('0x40')][_0x2b95('0x41')]()]))return _0x52d677[_0x2b95('0x22')]=!![];if(!_0x52d677[_0x2b95('0x22')])return _0x52d677['busy']=!![];}function getVoiceQueueAgents(_0x2444ea,_0x421712,_0x445b38,_0x1ff574){var _0x3612be=_[_0x2b95('0x3b')](_0x421712,['id',_0x2444ea['id']]);if(!_0x3612be)return _0x2444ea;return _0x3612be['getMembers']({'raw':!![]})[_0x2b95('0x13')](function(_0x5b53e8){for(var _0x1d8ede=0x0;_0x1d8ede<_0x5b53e8['length'];_0x1d8ede++){var _0x1ec7b8=_[_0x2b95('0x3b')](_0x445b38,['id',_0x5b53e8[_0x1d8ede]['UserId']]);if(!_0x1ec7b8){_0x1ec7b8={'id':_0x5b53e8[_0x1d8ede]['UserId'],'name':_0x5b53e8[_0x1d8ede][_0x2b95('0x42')],'accountcode':'','online':![]};}var _0x4e6f64={'id':_0x1ec7b8['id'],'name':_0x1ec7b8[_0x2b95('0x11')],'internal':_0x1ec7b8[_0x2b95('0x43')],'online':Boolean(_0x1ec7b8['online']),'paused':Boolean(_0x5b53e8[_0x1d8ede]['paused'])};if(_0x1ec7b8[_0x2b95('0x44')]===_0x2b95('0x22'))updateAgentVoiceStatus(_0x4e6f64,_0x2444ea,_0x1ff574);if(_0x4e6f64[_0x2b95('0x45')])_0x2444ea[_0x2b95('0x38')]++;if(_0x4e6f64[_0x2b95('0x39')])_0x2444ea['busy']++;if(_0x4e6f64[_0x2b95('0x23')]&&!_0x4e6f64[_0x2b95('0x39')]&&!_0x4e6f64[_0x2b95('0x22')])_0x2444ea[_0x2b95('0x23')]++;_0x2444ea['agents'][_0x2b95('0x25')](_0x4e6f64);}return _0x2444ea;});}function getQueueAgents(_0x171c19,_0x1f08d9,_0x1abdc8){var _0x1a625c=_0x2b95('0x46')+_[_0x2b95('0x18')](_0x1abdc8)+_0x2b95('0x47');var _0x528359=_0x1abdc8+_0x2b95('0x48');return db[_0x1a625c][_0x2b95('0x49')]({'where':{[_[_0x2b95('0x18')](_0x1abdc8)+_0x2b95('0x4a')]:_0x171c19['id']},'raw':!![]})[_0x2b95('0x13')](function(_0x3e95f6){for(var _0x5e50f6=0x0;_0x5e50f6<_0x3e95f6[_0x2b95('0x3d')];_0x5e50f6++){var _0x546e4c=_[_0x2b95('0x3b')](_0x1f08d9,['id',_0x3e95f6[_0x5e50f6][_0x2b95('0x42')]]);if(!_0x546e4c){_0x546e4c={'id':_0x3e95f6[_0x5e50f6][_0x2b95('0x42')],'name':_0x3e95f6[_0x5e50f6][_0x2b95('0x42')],'online':![],['pauseField']:![]};}var _0x2f3803={'id':_0x546e4c['id'],'name':_0x546e4c[_0x2b95('0x11')],'online':Boolean(_0x546e4c[_0x2b95('0x45')]),'paused':Boolean(_0x546e4c[_0x528359])};if(_0x2f3803[_0x2b95('0x45')])_0x171c19[_0x2b95('0x38')]++;_0x171c19[_0x2b95('0x4b')][_0x2b95('0x25')](_0x2f3803);}return _0x171c19;});}exports[_0x2b95('0x4c')]=function(_0x470554,_0x1770be){var _0x3160f4=['mail',_0x2b95('0x4d'),_0x2b95('0x4e'),'openchannel',_0x2b95('0x4f'),'whatsapp',_0x2b95('0x24')];var _0x48640f={'count':0x0,'rows':[]},_0x1676b0={},_0x479ee2,_0x548aa7,_0x579f66,_0x8f36cc,_0x22644c;Promise[_0x2b95('0x50')]()[_0x2b95('0x13')](function(){if(_0x470554[_0x2b95('0x51')]['channel']){if(!_['includes'](_0x3160f4,_0x470554[_0x2b95('0x51')][_0x2b95('0x52')][_0x2b95('0x53')]()))throw new Error(_0x2b95('0x54'));_0x479ee2=_0x470554['query'][_0x2b95('0x52')][_0x2b95('0x53')]();}var _0x3650e3=_['startCase'](_0x479ee2)+_0x2b95('0x47');var _0xd34c97=_['map'](db[_0x3650e3][_0x2b95('0x55')],function(_0x559f1d){return{'name':_0x559f1d[_0x2b95('0x56')],'type':_0x559f1d[_0x2b95('0x57')][_0x2b95('0x58')]};});_0x1676b0=qs[_0x2b95('0x59')](_0xd34c97,_0x470554);if(_0x470554[_0x2b95('0x5a')][_0x2b95('0x5b')]===_0x2b95('0x5a')){var _0x1144d2={'params':{'id':_0x470554[_0x2b95('0x5a')]['userProfileId']},'query':{'section':_0x479ee2===_0x2b95('0x24')&&_0x470554['query'][_0x2b95('0x57')]===_0x2b95('0x3a')?_0x2b95('0x5c'):_[_0x2b95('0x18')](_0x479ee2)+_0x2b95('0x19'),'type':_0x470554[_0x2b95('0x51')][_0x2b95('0x57')],'nolimit':!![],'sort':'name','filter':_0x470554['query']['filter']}};return db['UserProfile'][_0x2b95('0x5d')](_0x1144d2);}return db[_0x3650e3][_0x2b95('0x5e')](_0x1676b0);})[_0x2b95('0x13')](function(_0x33d033){_0x48640f[_0x2b95('0x9')]=_0x33d033['count'];_0x548aa7=_0x33d033[_0x2b95('0x5f')];return getRealtimeQueues(_0x470554,_0x479ee2);})[_0x2b95('0x13')](function(_0x2c37fc){_0x8f36cc=_0x2c37fc[_0x2b95('0x5f')];return getRealtimeAgents();})[_0x2b95('0x13')](function(_0x40fce0){_0x579f66=_0x40fce0[_0x2b95('0x5f')];if(_0x479ee2!=_0x2b95('0x24'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x2447c4){_0x22644c=_0x2447c4?_0x2447c4[_0x2b95('0x5f')]:[];return initializeQueues(_0x548aa7,_0x8f36cc,_0x479ee2,_0x470554[_0x2b95('0x51')][_0x2b95('0x57')]);})['then'](function(_0xbc454e){var _0x5b8718=_0xbc454e[_0x2b95('0x36')](function(_0x4f8841){if(_0x479ee2===_0x2b95('0x24'))return getVoiceQueueAgents(_0x4f8841,_0x548aa7,_0x579f66,_0x22644c);else return getQueueAgents(_0x4f8841,_0x579f66,_0x479ee2);});return Promise[_0x2b95('0x60')](_0x5b8718);})[_0x2b95('0x13')](function(_0xf822f){_0x48640f[_0x2b95('0x5f')]=_0xf822f;return _0x48640f;})[_0x2b95('0x13')](respondWithFilteredResult(_0x1770be,_0x1676b0))[_0x2b95('0x1c')](handleError(_0x1770be,null));};
\ No newline at end of file
index 9409f78..9de215c 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(_0x433d0a,_0x348f5b){var _0x883e8e=function(_0x16b4eb){while(--_0x16b4eb){_0x433d0a['push'](_0x433d0a['shift']());}};_0x883e8e(++_0x348f5b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x6f115b,_0x57eaea){var _0x5e0809=function(_0x4546cb){while(--_0x4546cb){_0x6f115b['push'](_0x6f115b['shift']());}};_0x5e0809(++_0x57eaea);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0xcb91[_0x34aec4];return _0x51e1a7;};'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 0c327df..331da12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21cd=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x826627,_0x4d8f0b){var _0xf36ac2=function(_0xd32a9d){while(--_0xd32a9d){_0x826627['push'](_0x826627['shift']());}};_0xf36ac2(++_0x4d8f0b);}(_0x21cd,0x6a));var _0xd21c=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x21cd[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xd21c('0x0'));module[_0xd21c('0x1')]={'state':{'type':Sequelize[_0xd21c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd21c('0x3')]},'scheduledat':{'type':Sequelize[_0xd21c('0x4')]},'uniqueid':{'type':Sequelize[_0xd21c('0x3')]},'starttime':{'type':Sequelize[_0xd21c('0x4')]},'responsetime':{'type':Sequelize[_0xd21c('0x4')]},'ringtime':{'type':Sequelize[_0xd21c('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd21c('0x3')]}};
\ No newline at end of file
+var _0xce1a=['DATE','STRING','INTEGER','sequelize'];(function(_0x14f296,_0x435eef){var _0x12c777=function(_0x1baf3f){while(--_0x1baf3f){_0x14f296['push'](_0x14f296['shift']());}};_0x12c777(++_0x435eef);}(_0xce1a,0xbf));var _0xace1=function(_0x3dbce4,_0x656452){_0x3dbce4=_0x3dbce4-0x0;var _0x369770=_0xce1a[_0x3dbce4];return _0x369770;};'use strict';var Sequelize=require(_0xace1('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xace1('0x1')]},'uniqueid':{'type':Sequelize[_0xace1('0x2')]},'starttime':{'type':Sequelize[_0xace1('0x1')]},'responsetime':{'type':Sequelize[_0xace1('0x1')]},'ringtime':{'type':Sequelize[_0xace1('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xace1('0x2')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3f974d4..6a18221 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcabe=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','lodash','util'];(function(_0x173418,_0x4fdb9e){var _0x123cbc=function(_0x1f93fd){while(--_0x1f93fd){_0x173418['push'](_0x173418['shift']());}};_0x123cbc(++_0x4fdb9e);}(_0xcabe,0xfa));var _0xecab=function(_0xbf4e4f,_0x4c4253){_0xbf4e4f=_0xbf4e4f-0x0;var _0x6e57e6=_0xcabe[_0xbf4e4f];return _0x6e57e6;};'use strict';var _=require(_0xecab('0x0'));var util=require(_0xecab('0x1'));var logger=require(_0xecab('0x2'))('api');var moment=require(_0xecab('0x3'));var BPromise=require(_0xecab('0x4'));var rp=require(_0xecab('0x5'));var fs=require('fs');var path=require(_0xecab('0x6'));var rimraf=require(_0xecab('0x7'));var config=require(_0xecab('0x8'));var attributes=require(_0xecab('0x9'));module[_0xecab('0xa')]=function(_0x48a70a,_0xd2bceb){return _0x48a70a['define'](_0xecab('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x26cb=['request-promise','path','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x1ad851,_0x5f664c){var _0x49de7b=function(_0x40c9b0){while(--_0x40c9b0){_0x1ad851['push'](_0x1ad851['shift']());}};_0x49de7b(++_0x5f664c);}(_0x26cb,0x133));var _0xb26c=function(_0x239866,_0x3ab44d){_0x239866=_0x239866-0x0;var _0x37af78=_0x26cb[_0x239866];return _0x37af78;};'use strict';var _=require(_0xb26c('0x0'));var util=require(_0xb26c('0x1'));var logger=require(_0xb26c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb26c('0x3'));var fs=require('fs');var path=require(_0xb26c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb26c('0x5'));module[_0xb26c('0x6')]=function(_0x3c2304,_0x85b9db){return _0x3c2304[_0xb26c('0x7')](_0xb26c('0x8'),attributes,{'tableName':_0xb26c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 060749b..3864762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeca7=['message','result','catch','ReportAgentPreview','create','body','raw','CreateReportAgentPreview','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0xeca7,0x1b9));var _0x7eca=function(_0x5b4f98,_0x4e2213){_0x5b4f98=_0x5b4f98-0x0;var _0x1f5022=_0xeca7[_0x5b4f98];return _0x1f5022;};'use strict';var _=require(_0x7eca('0x0'));var util=require(_0x7eca('0x1'));var moment=require(_0x7eca('0x2'));var BPromise=require(_0x7eca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7eca('0x4'))['db'];var utils=require(_0x7eca('0x5'));var logger=require(_0x7eca('0x6'))(_0x7eca('0x7'));var config=require(_0x7eca('0x8'));var jayson=require(_0x7eca('0x9'));var client=jayson['client'][_0x7eca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x497325,_0x119ea9,_0x231144){return new BPromise(function(_0x3be82c,_0x5a1f5f){return client[_0x7eca('0xb')](_0x497325,_0x231144)['then'](function(_0x2c97e2){logger[_0x7eca('0xc')](_0x7eca('0xd'),_0x119ea9,'request\x20sent');logger['debug'](_0x7eca('0xe'),_0x119ea9,_0x7eca('0xf'),JSON[_0x7eca('0x10')](_0x2c97e2));if(_0x2c97e2[_0x7eca('0x11')]){if(_0x2c97e2['error']['code']===0x1f4){logger['error'](_0x7eca('0xd'),_0x119ea9,_0x2c97e2['error']['message']);return _0x5a1f5f(_0x2c97e2[_0x7eca('0x11')][_0x7eca('0x12')]);}logger[_0x7eca('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x119ea9,_0x2c97e2[_0x7eca('0x11')][_0x7eca('0x12')]);return _0x3be82c(_0x2c97e2[_0x7eca('0x11')]['message']);}else{logger[_0x7eca('0xc')](_0x7eca('0xd'),_0x119ea9,_0x7eca('0xf'));_0x3be82c(_0x2c97e2[_0x7eca('0x13')][_0x7eca('0x12')]);}})[_0x7eca('0x14')](function(_0xdbe542){logger[_0x7eca('0x11')](_0x7eca('0xd'),_0x119ea9,_0xdbe542);_0x5a1f5f(_0xdbe542);});});}exports['CreateReportAgentPreview']=function(_0x5534d6){var _0x22c981=this;return new Promise(function(_0x329755,_0xc78840){return db[_0x7eca('0x15')][_0x7eca('0x16')](_0x5534d6[_0x7eca('0x17')],{'raw':_0x5534d6['options']?_0x5534d6['options'][_0x7eca('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4ca189){logger[_0x7eca('0xc')](_0x7eca('0x19'),_0x5534d6);logger[_0x7eca('0x1a')](_0x7eca('0x19'),_0x5534d6,JSON[_0x7eca('0x10')](_0x4ca189));_0x329755(_0x4ca189);})[_0x7eca('0x14')](function(_0x4d6221){logger['error'](_0x7eca('0x19'),_0x4d6221[_0x7eca('0x12')],_0x5534d6);_0xc78840(_0x22c981[_0x7eca('0x11')](0x1f4,_0x4d6221[_0x7eca('0x12')]));});});};
\ No newline at end of file
+var _0xb078=['ReportAgentPreview','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0xb078,0xa1));var _0x8b07=function(_0x48749a,_0x5d7d69){_0x48749a=_0x48749a-0x0;var _0x18ab20=_0xb078[_0x48749a];return _0x18ab20;};'use strict';var _=require(_0x8b07('0x0'));var util=require(_0x8b07('0x1'));var moment=require(_0x8b07('0x2'));var BPromise=require(_0x8b07('0x3'));var rs=require(_0x8b07('0x4'));var fs=require('fs');var Redis=require(_0x8b07('0x5'));var db=require(_0x8b07('0x6'))['db'];var utils=require(_0x8b07('0x7'));var logger=require('../../config/logger')(_0x8b07('0x8'));var config=require(_0x8b07('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8b07('0xa')][_0x8b07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab8919,_0x300012,_0x495e77){return new BPromise(function(_0x5417e2,_0x38d211){return client[_0x8b07('0xc')](_0xab8919,_0x495e77)[_0x8b07('0xd')](function(_0x31ed18){logger[_0x8b07('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x300012,_0x8b07('0xf'));logger[_0x8b07('0x10')](_0x8b07('0x11'),_0x300012,'request\x20sent',JSON['stringify'](_0x31ed18));if(_0x31ed18['error']){if(_0x31ed18[_0x8b07('0x12')][_0x8b07('0x13')]===0x1f4){logger[_0x8b07('0x12')](_0x8b07('0x14'),_0x300012,_0x31ed18['error'][_0x8b07('0x15')]);return _0x38d211(_0x31ed18[_0x8b07('0x12')][_0x8b07('0x15')]);}logger[_0x8b07('0x12')](_0x8b07('0x14'),_0x300012,_0x31ed18[_0x8b07('0x12')][_0x8b07('0x15')]);return _0x5417e2(_0x31ed18[_0x8b07('0x12')]['message']);}else{logger['info'](_0x8b07('0x14'),_0x300012,_0x8b07('0xf'));_0x5417e2(_0x31ed18[_0x8b07('0x16')][_0x8b07('0x15')]);}})[_0x8b07('0x17')](function(_0x48fd2b){logger[_0x8b07('0x12')](_0x8b07('0x14'),_0x300012,_0x48fd2b);_0x38d211(_0x48fd2b);});});}exports[_0x8b07('0x18')]=function(_0x204df2){var _0x4ff7af=this;return new Promise(function(_0x89fe28,_0x174448){return db[_0x8b07('0x19')][_0x8b07('0x1a')](_0x204df2[_0x8b07('0x1b')],{'raw':_0x204df2[_0x8b07('0x1c')]?_0x204df2[_0x8b07('0x1c')][_0x8b07('0x1d')]===undefined?!![]:![]:!![]})[_0x8b07('0xd')](function(_0x1bacc9){logger[_0x8b07('0xe')]('CreateReportAgentPreview',_0x204df2);logger[_0x8b07('0x10')]('CreateReportAgentPreview',_0x204df2,JSON[_0x8b07('0x1e')](_0x1bacc9));_0x89fe28(_0x1bacc9);})[_0x8b07('0x17')](function(_0x20e806){logger['error'](_0x8b07('0x18'),_0x20e806[_0x8b07('0x15')],_0x204df2);_0x174448(_0x4ff7af['error'](0x1f4,_0x20e806['message']));});});};
\ No newline at end of file
index 2db2bea..c03a1ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61cd=['Router','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','outboundChannels','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express'];(function(_0x2a22ff,_0x3d4d7c){var _0x3b59b=function(_0x145cc6){while(--_0x145cc6){_0x2a22ff['push'](_0x2a22ff['shift']());}};_0x3b59b(++_0x3d4d7c);}(_0x61cd,0xa2));var _0xd61c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x61cd[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xd61c('0x0'));var util=require(_0xd61c('0x1'));var path=require(_0xd61c('0x2'));var express=require(_0xd61c('0x3'));var router=express[_0xd61c('0x4')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get']('/voice/channels',auth['isAuthenticated'](),controller[_0xd61c('0x5')]);router[_0xd61c('0x6')](_0xd61c('0x7'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x9')]);router[_0xd61c('0x6')](_0xd61c('0xa'),auth[_0xd61c('0x8')](),controller[_0xd61c('0xb')]);router['get'](_0xd61c('0xc'),auth[_0xd61c('0x8')](),controller['voiceQueues']);router[_0xd61c('0x6')](_0xd61c('0xd'),auth[_0xd61c('0x8')](),controller[_0xd61c('0xe')]);router[_0xd61c('0x6')](_0xd61c('0xf'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x10')]);router['get'](_0xd61c('0x11'),auth[_0xd61c('0x8')](),controller['mailAccounts']);router[_0xd61c('0x6')](_0xd61c('0x12'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x13')]);router[_0xd61c('0x6')](_0xd61c('0x14'),auth[_0xd61c('0x8')](),controller['smsQueues']);router[_0xd61c('0x6')](_0xd61c('0x15'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x16')]);router[_0xd61c('0x6')](_0xd61c('0x17'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x18')]);router[_0xd61c('0x6')](_0xd61c('0x19'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0xd61c('0x6')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0xd61c('0x1a')]);router[_0xd61c('0x6')](_0xd61c('0x1b'),auth[_0xd61c('0x8')](),controller['voiceQueuesChannel']);router[_0xd61c('0x6')](_0xd61c('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xd61c('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xd61c('0x8')](),controller[_0xd61c('0x1d')]);router[_0xd61c('0x6')](_0xd61c('0x1e'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x1f')]);router[_0xd61c('0x20')](_0xd61c('0x1e'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x21')]);router[_0xd61c('0x6')](_0xd61c('0x22'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x23')]);router[_0xd61c('0x6')]('/outbound/channels',auth[_0xd61c('0x8')](),controller[_0xd61c('0x24')]);router[_0xd61c('0x6')]('/agents',auth[_0xd61c('0x8')](),controller[_0xd61c('0x25')]);router[_0xd61c('0x20')](_0xd61c('0x26'),auth[_0xd61c('0x8')](),controller['agentCapacity']);router[_0xd61c('0x6')](_0xd61c('0x27'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x28')]);router[_0xd61c('0x6')](_0xd61c('0x29'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x2a')]);router[_0xd61c('0x6')](_0xd61c('0x2b'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x2c')]);router[_0xd61c('0x6')](_0xd61c('0x2d'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x2e')]);router['get'](_0xd61c('0x2f'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x30')]);router['get'](_0xd61c('0x31'),auth['isAuthenticated'](),controller[_0xd61c('0x32')]);router[_0xd61c('0x6')](_0xd61c('0x33'),auth[_0xd61c('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0xd61c('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0xd61c('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0xd61c('0x34'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x35')]);router[_0xd61c('0x6')](_0xd61c('0x36'),auth[_0xd61c('0x8')](),controller['whatsappQueuesWaitingInteractions']);router[_0xd61c('0x6')](_0xd61c('0x37'),auth[_0xd61c('0x8')](),controller['faxQueuesWaitingInteractions']);router['post'](_0xd61c('0x38'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x39')](_0xd61c('0x3a')));router['get'](_0xd61c('0x3b'),auth['isAuthenticated'](),controller[_0xd61c('0x3c')]);router[_0xd61c('0x3d')](_0xd61c('0x3e'),auth['isAuthenticated'](),controller[_0xd61c('0x39')](_0xd61c('0x3f')));router[_0xd61c('0x6')](_0xd61c('0x40'),auth['isAuthenticated'](),controller[_0xd61c('0x41')]);router[_0xd61c('0x3d')](_0xd61c('0x42'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x39')](_0xd61c('0x43')));router['get']('/fax/queues/:id',auth[_0xd61c('0x8')](),controller[_0xd61c('0x44')]);router[_0xd61c('0x3d')](_0xd61c('0x45'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x39')](_0xd61c('0x46')));router[_0xd61c('0x6')](_0xd61c('0x47'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x48')]);router[_0xd61c('0x3d')](_0xd61c('0x49'),auth[_0xd61c('0x8')](),controller['queueNotify']('sms'));router['post'](_0xd61c('0x4a'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x39')](_0xd61c('0x4b')));router[_0xd61c('0x6')](_0xd61c('0x4c'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x4d')]);router[_0xd61c('0x6')](_0xd61c('0x4e'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x4f')]);router['post'](_0xd61c('0x50'),auth[_0xd61c('0x8')](),controller[_0xd61c('0x51')]);module[_0xd61c('0x52')]=router;
\ No newline at end of file
+var _0x8dd8=['openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts'];(function(_0x1b8248,_0xfaeb02){var _0x4fbc2a=function(_0x71b6e1){while(--_0x71b6e1){_0x1b8248['push'](_0x1b8248['shift']());}};_0x4fbc2a(++_0xfaeb02);}(_0x8dd8,0xe9));var _0x88dd=function(_0x54a36e,_0x47b214){_0x54a36e=_0x54a36e-0x0;var _0x5810a2=_0x8dd8[_0x54a36e];return _0x5810a2;};'use strict';var multer=require('multer');var util=require(_0x88dd('0x0'));var path=require(_0x88dd('0x1'));var express=require(_0x88dd('0x2'));var router=express[_0x88dd('0x3')]();var auth=require(_0x88dd('0x4'));var controller=require(_0x88dd('0x5'));router[_0x88dd('0x6')]('/voice/channels',auth[_0x88dd('0x7')](),controller[_0x88dd('0x8')]);router[_0x88dd('0x6')](_0x88dd('0x9'),auth[_0x88dd('0x7')](),controller[_0x88dd('0xa')]);router[_0x88dd('0x6')](_0x88dd('0xb'),auth['isAuthenticated'](),controller[_0x88dd('0xc')]);router[_0x88dd('0x6')]('/voice/queues',auth[_0x88dd('0x7')](),controller['voiceQueues']);router['get'](_0x88dd('0xd'),auth[_0x88dd('0x7')](),controller[_0x88dd('0xe')]);router['get'](_0x88dd('0xf'),auth['isAuthenticated'](),controller[_0x88dd('0x10')]);router[_0x88dd('0x6')](_0x88dd('0x11'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x12')]);router['get']('/openchannel/queues',auth[_0x88dd('0x7')](),controller[_0x88dd('0x13')]);router[_0x88dd('0x6')](_0x88dd('0x14'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x15')]);router['get']('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x88dd('0x16')]);router[_0x88dd('0x6')](_0x88dd('0x17'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x18')]);router[_0x88dd('0x6')]('/voice/queues/preview/:id',auth[_0x88dd('0x7')](),controller[_0x88dd('0x19')]);router['get'](_0x88dd('0x1a'),auth['isAuthenticated'](),controller[_0x88dd('0x1b')]);router[_0x88dd('0x6')](_0x88dd('0x1c'),auth['isAuthenticated'](),controller[_0x88dd('0x1d')]);router[_0x88dd('0x6')](_0x88dd('0x1e'),auth['isAuthenticated'](),controller[_0x88dd('0x1f')]);router['get'](_0x88dd('0x20'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x21')]);router[_0x88dd('0x6')](_0x88dd('0x22'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x23')]);router[_0x88dd('0x24')]('/voice/queues/:id',auth[_0x88dd('0x7')](),controller[_0x88dd('0x25')]);router[_0x88dd('0x6')](_0x88dd('0x26'),auth['isAuthenticated'](),controller[_0x88dd('0x27')]);router['get'](_0x88dd('0x28'),auth[_0x88dd('0x7')](),controller['outboundChannels']);router[_0x88dd('0x6')]('/agents',auth[_0x88dd('0x7')](),controller[_0x88dd('0x29')]);router[_0x88dd('0x24')](_0x88dd('0x2a'),auth['isAuthenticated'](),controller[_0x88dd('0x2b')]);router[_0x88dd('0x6')]('/telephones',auth[_0x88dd('0x7')](),controller[_0x88dd('0x2c')]);router[_0x88dd('0x6')](_0x88dd('0x2d'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x2e')]);router[_0x88dd('0x6')](_0x88dd('0x2f'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x30')]);router['get'](_0x88dd('0x31'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x32')]);router[_0x88dd('0x6')](_0x88dd('0x33'),auth['isAuthenticated'](),controller[_0x88dd('0x34')]);router[_0x88dd('0x6')](_0x88dd('0x35'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x36')]);router['get'](_0x88dd('0x37'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x38')]);router[_0x88dd('0x6')](_0x88dd('0x39'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x3a')]);router[_0x88dd('0x6')]('/sms/queues/waitinginteractions',auth[_0x88dd('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x88dd('0x6')](_0x88dd('0x3b'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x88dd('0x6')](_0x88dd('0x3c'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x3d')]);router[_0x88dd('0x3e')](_0x88dd('0x3f'),auth[_0x88dd('0x7')](),controller['queueNotify']('mail'));router[_0x88dd('0x6')](_0x88dd('0x40'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x41')]);router[_0x88dd('0x3e')](_0x88dd('0x42'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x43')](_0x88dd('0x44')));router[_0x88dd('0x6')](_0x88dd('0x45'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x46')]);router['post'](_0x88dd('0x47'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x43')](_0x88dd('0x48')));router[_0x88dd('0x6')](_0x88dd('0x49'),auth[_0x88dd('0x7')](),controller['showFaxQueues']);router['post'](_0x88dd('0x4a'),auth[_0x88dd('0x7')](),controller['queueNotify'](_0x88dd('0x4b')));router['get'](_0x88dd('0x4c'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x4d')]);router['post'](_0x88dd('0x4e'),auth['isAuthenticated'](),controller[_0x88dd('0x43')]('sms'));router['post']('/whatsapp/queues/:id/notify',auth[_0x88dd('0x7')](),controller[_0x88dd('0x43')]('whatsapp'));router['get']('/sms/queues/:id',auth[_0x88dd('0x7')](),controller['showSmsQueues']);router[_0x88dd('0x6')](_0x88dd('0x4f'),auth['isAuthenticated'](),controller[_0x88dd('0x50')]);router[_0x88dd('0x3e')](_0x88dd('0x51'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x52')]);module[_0x88dd('0x53')]=router;
\ No newline at end of file
index 205f82e..4fb877f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bae=['agent','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','QueueId','TransferReport','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','MessageId','From','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','json','sendStatus','stack','name','isNil','voiceChannels','VoiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','MemberReport','findOrCreate','interface','SIP/%s'];(function(_0x4cfb02,_0x583554){var _0x479d9a=function(_0x16af7a){while(--_0x16af7a){_0x4cfb02['push'](_0x4cfb02['shift']());}};_0x479d9a(++_0x583554);}(_0x7bae,0x13b));var _0xe7ba=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x7bae[_0x2576d7];return _0x16a08c;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xe7ba('0x2'))('api');var jayson=require(_0xe7ba('0x3'));var amiClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232a});var mailClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232b});var routingClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){var _0x41c39d=_0x34fb18?_0x34fb18:amiClient;return _0x41c39d[_0xe7ba('0x6')](_0x3c5e59,_0x10b307)['then'](function(_0x3df8bf){if(_0x3df8bf[_0xe7ba('0x7')]){if(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x8')]===0x1f4){return _0x27b1d5(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}return _0x160565(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}else{_0x160565(_0x3df8bf[_0xe7ba('0xa')]);}})['catch'](function(_0xf4fcb0){_0x27b1d5(_0xf4fcb0);});});}function respondWithResult(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xc8;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0xb')](_0x602b1)[_0xe7ba('0xc')](_0x45229c);}return _0x588c8b[_0xe7ba('0xd')](0x194);};}function handleError(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0x1f4;return function(_0x561c48){logger[_0xe7ba('0x7')](_0x561c48[_0xe7ba('0xe')]);if(_0x561c48[_0xe7ba('0xf')]){delete _0x561c48['name'];}_0x41369f[_0xe7ba('0xb')](_0x561dbb)['send'](_0x561c48);};}function findById(_0x590bab){return function(_0x5e9176){if(!_[_0xe7ba('0x10')](_0x590bab)&&!_['isNil'](_0x5e9176)&&!_[_0xe7ba('0x10')](_0x5e9176['rows'])){return _['find'](_0x5e9176['rows'],function(_0x3f326a){return _0x3f326a['id']==_0x590bab;});}return null;};}exports[_0xe7ba('0x11')]=function(_0x39ca38,_0x3c06c3){return respondWithRpcPromise(_0xe7ba('0x12'),_0x39ca38['query'])[_0xe7ba('0x13')](respondWithResult(_0x3c06c3,null))[_0xe7ba('0x14')](handleError(_0x3c06c3,null));};exports[_0xe7ba('0x15')]=function(_0x136ec6,_0x4aaf35){return respondWithRpcPromise(_0xe7ba('0x16'),_[_0xe7ba('0x17')](_0x136ec6['query'],_0x136ec6[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x4aaf35,null))[_0xe7ba('0x14')](handleError(_0x4aaf35,null));};exports[_0xe7ba('0x19')]=function(_0x394b69,_0x2acfc2){return respondWithRpcPromise(_0xe7ba('0x1a'),_[_0xe7ba('0x17')](_0x394b69[_0xe7ba('0x1b')],_0x394b69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x2acfc2,null))['catch'](handleError(_0x2acfc2,null));};exports['voiceQueues']=function(_0x4cd124,_0x4363a8){return respondWithRpcPromise('VoiceQueues',_0x4cd124['query'])['then'](respondWithResult(_0x4363a8,null))[_0xe7ba('0x14')](handleError(_0x4363a8,null));};exports[_0xe7ba('0x1c')]=function(_0xe32862,_0x2ea78a){return respondWithRpcPromise(_0xe7ba('0x1d'),_0xe32862[_0xe7ba('0x1b')])[_0xe7ba('0x13')](findById(_0xe32862[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x2ea78a,null))[_0xe7ba('0x14')](handleError(_0x2ea78a,null));};exports['updateVoiceQueue']=function(_0x102925,_0x92fe7){return respondWithRpcPromise(_0xe7ba('0x1e'),_['merge'](_0x102925['body'],_0x102925[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x92fe7,null))[_0xe7ba('0x14')](handleError(_0x92fe7,null));};exports[_0xe7ba('0x1f')]=function(_0x268308,_0x5279dd){return respondWithRpcPromise(_0xe7ba('0x20'),_[_0xe7ba('0x17')](_0x268308['query'],_0x268308[_0xe7ba('0x18')]))['then'](respondWithResult(_0x5279dd,null))['catch'](handleError(_0x5279dd,null));};exports[_0xe7ba('0x21')]=function(_0x134f21,_0x1be947){return respondWithRpcPromise('VoiceQueuesChannels',_0x134f21[_0xe7ba('0x1b')])['then'](respondWithResult(_0x1be947,null))[_0xe7ba('0x14')](handleError(_0x1be947,null));};exports[_0xe7ba('0x22')]=function(_0x3b0a69,_0x27a8d4){return respondWithRpcPromise(_0xe7ba('0x23'),_['merge'](_0x3b0a69[_0xe7ba('0x1b')],_0x3b0a69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x27a8d4,null))[_0xe7ba('0x14')](handleError(_0x27a8d4,null));};exports[_0xe7ba('0x24')]=function(_0x499d3b,_0x524726){return respondWithRpcPromise(_0xe7ba('0x25'),_[_0xe7ba('0x17')](_0x499d3b['query'],_0x499d3b[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x524726,null))[_0xe7ba('0x14')](handleError(_0x524726,null));};exports['voiceQueuesChannelRedirect']=function(_0x3e6eb7,_0x43b313){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xe7ba('0x17')](_0x3e6eb7[_0xe7ba('0x1b')],_0x3e6eb7[_0xe7ba('0x18')]))['then'](respondWithResult(_0x43b313,null))['catch'](handleError(_0x43b313,null));};exports[_0xe7ba('0x26')]=function(_0x2ebb27,_0x58d2a){return respondWithRpcPromise(_0xe7ba('0x27'),_0x2ebb27[_0xe7ba('0x1b')])['then'](respondWithResult(_0x58d2a,null))[_0xe7ba('0x14')](handleError(_0x58d2a,null));};exports[_0xe7ba('0x28')]=function(_0x3139a6,_0x23a912){return respondWithRpcPromise('OutboundChannels',_0x3139a6[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x23a912,null))[_0xe7ba('0x14')](handleError(_0x23a912,null));};exports[_0xe7ba('0x29')]=function(_0x35a5f3,_0x3793c6){var _0x124cc4;return respondWithRpcPromise('Agents',_0x35a5f3[_0xe7ba('0x1b')])[_0xe7ba('0x13')](function(_0x359a4d){_0x124cc4=_0x359a4d;return respondWithRpcPromise(_0xe7ba('0x2a'),_0x35a5f3[_0xe7ba('0x1b')],routingClient);})[_0xe7ba('0x13')](function(_0x220c3b){return _[_0xe7ba('0x17')]({},_0x220c3b,_0x124cc4);})[_0xe7ba('0x13')](respondWithResult(_0x3793c6,null))['catch'](handleError(_0x3793c6,null));};exports[_0xe7ba('0x2b')]=function(_0x417734,_0x5d4be2){if(_0x417734['body']&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]&&_0x417734[_0xe7ba('0x2e')]&&_0x417734['user'][_0xe7ba('0xf')]){for(var _0x82246e in _0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]){if(_0x417734[_0xe7ba('0x2c')]['interaction'][_0xe7ba('0x2f')](_0x82246e)){db['MemberReport'][_0xe7ba('0x30')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':_0xe7ba('0x31'),'exitAt':null,'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]['length']?{'$notIn':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]}:{'$ne':null}}})[_0xe7ba('0x13')](function(_0x37dcaa){var _0x3620bc=moment()[_0xe7ba('0x32')](_0xe7ba('0x33'));for(var _0x2c54ac=0x0,_0x45f49a=_0x37dcaa[_0xe7ba('0x34')];_0x2c54ac<_0x45f49a;_0x2c54ac+=0x1){_0x37dcaa[_0x2c54ac]['updateAttributes']({'exitAt':_0x3620bc});}});for(var _0x19ccde=0x0;_0x19ccde<_0x417734['body'][_0xe7ba('0x2d')][_0x82246e][_0xe7ba('0x34')];_0x19ccde+=0x1){db[_0xe7ba('0x35')][_0xe7ba('0x36')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':'INTERACTION','uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde],'exitAt':null},'defaults':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'interface':_[_0xe7ba('0x10')](_0x417734[_0xe7ba('0x2e')][_0xe7ba('0x37')])?util[_0xe7ba('0x32')](_0xe7ba('0x38'),_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')]):_0x417734['user'][_0xe7ba('0x37')],'type':_0xe7ba('0x31'),'enterAt':moment()[_0xe7ba('0x32')](_0xe7ba('0x33')),'role':_0xe7ba('0x39'),'internal':_0x417734[_0xe7ba('0x2e')]['internal'],'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x417734[_0xe7ba('0x18')]['id'],'capacity':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x3a')]},routingClient)[_0xe7ba('0x13')](respondWithResult(_0x5d4be2,null))['catch'](handleError(_0x5d4be2,null));};exports['telephones']=function(_0xa80cf,_0x2cfdc3){return respondWithRpcPromise(_0xe7ba('0x3b'),_0xa80cf['query'])[_0xe7ba('0x13')](respondWithResult(_0x2cfdc3,null))[_0xe7ba('0x14')](handleError(_0x2cfdc3,null));};exports[_0xe7ba('0x3c')]=function(_0x45bcbd,_0x14beb3){return respondWithRpcPromise(_0xe7ba('0x3d'),_0x45bcbd[_0xe7ba('0x1b')])['then'](respondWithResult(_0x14beb3,null))[_0xe7ba('0x14')](handleError(_0x14beb3,null));};exports[_0xe7ba('0x3e')]=function(_0x316b51,_0x5863c8){return respondWithRpcPromise(_0xe7ba('0x3f'),_0x316b51[_0xe7ba('0x1b')])['then'](respondWithResult(_0x5863c8,null))[_0xe7ba('0x14')](handleError(_0x5863c8,null));};exports[_0xe7ba('0x40')]=function(_0x4da728,_0x3b4ae4){return respondWithRpcPromise('ChatQueues',_0x4da728[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x3b4ae4,null))[_0xe7ba('0x14')](handleError(_0x3b4ae4,null));};exports['showChatQueues']=function(_0x38829a,_0x1128be){return respondWithRpcPromise(_0xe7ba('0x41'),_0x38829a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x38829a['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x1128be,null))[_0xe7ba('0x14')](handleError(_0x1128be,null));};exports[_0xe7ba('0x42')]=function(_0x19159c,_0x435dee){return respondWithRpcPromise('MailQueues',_0x19159c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x435dee,null))[_0xe7ba('0x14')](handleError(_0x435dee,null));};exports[_0xe7ba('0x43')]=function(_0x57b23e,_0x3e31c1){return respondWithRpcPromise(_0xe7ba('0x44'),_0x57b23e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x57b23e[_0xe7ba('0x18')]['id']))[_0xe7ba('0x13')](respondWithResult(_0x3e31c1,null))['catch'](handleError(_0x3e31c1,null));};exports[_0xe7ba('0x45')]=function(_0x103762,_0x3bd82f){return respondWithRpcPromise('MailAccounts',_0x103762[_0xe7ba('0x1b')],mailClient)[_0xe7ba('0x13')](respondWithResult(_0x3bd82f,null))[_0xe7ba('0x14')](handleError(_0x3bd82f,null));};exports[_0xe7ba('0x46')]=function(_0x45fb0f,_0x162d7f){return respondWithRpcPromise(_0xe7ba('0x47'),_0x45fb0f[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x162d7f,null))[_0xe7ba('0x14')](handleError(_0x162d7f,null));};exports[_0xe7ba('0x48')]=function(_0x27422d,_0x4a5c8c){return respondWithRpcPromise(_0xe7ba('0x47'),_0x27422d[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x27422d['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x4a5c8c,null))['catch'](handleError(_0x4a5c8c,null));};exports[_0xe7ba('0x49')]=function(_0x194dff,_0x781e04){return respondWithRpcPromise('SmsQueues',_0x194dff['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x781e04,null))[_0xe7ba('0x14')](handleError(_0x781e04,null));};exports[_0xe7ba('0x4a')]=function(_0x4de4c9,_0x3ba4fd){return respondWithRpcPromise(_0xe7ba('0x4b'),_0x4de4c9[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x4de4c9[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x3ba4fd,null))[_0xe7ba('0x14')](handleError(_0x3ba4fd,null));};exports[_0xe7ba('0x4c')]=function(_0x70ce9c,_0x50cc8b){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x70ce9c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x50cc8b,null))[_0xe7ba('0x14')](handleError(_0x50cc8b,null));};exports[_0xe7ba('0x4e')]=function(_0x29c046,_0x6c8738){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x29c046[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x29c046['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x6c8738,null))[_0xe7ba('0x14')](handleError(_0x6c8738,null));};exports[_0xe7ba('0x4f')]=function(_0xa6da9e,_0x4d8773){return respondWithRpcPromise('FaxQueues',_0xa6da9e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x4d8773,null))[_0xe7ba('0x14')](handleError(_0x4d8773,null));};exports['showFaxQueues']=function(_0x53ebd1,_0x5561cc){return respondWithRpcPromise(_0xe7ba('0x50'),_0x53ebd1[_0xe7ba('0x1b')],routingClient)['then'](findById(_0x53ebd1[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x5561cc,null))[_0xe7ba('0x14')](handleError(_0x5561cc,null));};exports['faxAccounts']=function(_0x11aded,_0x4ebe4a){return respondWithRpcPromise('FaxAccounts',_0x11aded[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x4ebe4a,null))[_0xe7ba('0x14')](handleError(_0x4ebe4a,null));};exports[_0xe7ba('0x51')]=function(_0x157d41,_0x35b755){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x157d41['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x35b755,null))[_0xe7ba('0x14')](handleError(_0x35b755,null));};exports[_0xe7ba('0x52')]=function(_0x2e6e90,_0x18f23e){return respondWithRpcPromise(_0xe7ba('0x53'),_0x2e6e90[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x18f23e,null))[_0xe7ba('0x14')](handleError(_0x18f23e,null));};exports[_0xe7ba('0x54')]=function(_0x325ecb,_0x246f91){return respondWithRpcPromise(_0xe7ba('0x55'),_0x325ecb[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x246f91,null))['catch'](handleError(_0x246f91,null));};exports[_0xe7ba('0x56')]=function(_0x3acb1a,_0x5e16f1){return respondWithRpcPromise(_0xe7ba('0x55'),_0x3acb1a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](function(_0x2471c8){if(_0x3acb1a[_0xe7ba('0x1b')][_0xe7ba('0x57')]!==undefined){var _0x24c94a=_(_0x2471c8[_0xe7ba('0x58')])[_0xe7ba('0x59')]([_0x3acb1a['query'][_0xe7ba('0x57')],_0x3acb1a['params']['id']])[_0xe7ba('0x5a')](_0xe7ba('0x5b'))[_0xe7ba('0x5c')]()['value']();return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x2f1938){return _0x24c94a[_0xe7ba('0x5d')](_0x2f1938['queue_id'])>-0x1;});}else{return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x433644){return _0x433644[_0xe7ba('0x5b')]===parseInt(_0x3acb1a['params']['id']);});}})[_0xe7ba('0x13')](respondWithResult(_0x5e16f1,null))[_0xe7ba('0x14')](handleError(_0x5e16f1,null));};exports[_0xe7ba('0x5e')]=function(_0x1bfb80,_0x16af73){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1bfb80['query'],routingClient)['then'](respondWithResult(_0x16af73,null))[_0xe7ba('0x14')](handleError(_0x16af73,null));};exports[_0xe7ba('0x5f')]=function(_0x41a346,_0x27e7a5){return respondWithRpcPromise(_0xe7ba('0x60'),_0x41a346[_0xe7ba('0x1b')],routingClient)['then'](respondWithResult(_0x27e7a5,null))[_0xe7ba('0x14')](handleError(_0x27e7a5,null));};exports['faxQueuesWaitingInteractions']=function(_0x439c96,_0x2e3e28){return respondWithRpcPromise(_0xe7ba('0x61'),_0x439c96[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x2e3e28,null))[_0xe7ba('0x14')](handleError(_0x2e3e28,null));};exports['queueNotify']=function(_0x44563b){return function(_0x4904d2,_0x8cba2c){var _0x18e715,_0x1d3035;var _0x5e70d9=_[_0xe7ba('0x62')](_0x44563b);var _0x52d73a=_0x44563b===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0x5e70d9+_0xe7ba('0x66')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x4904d2[_0xe7ba('0x18')]['id']}})[_0xe7ba('0x13')](function(_0x3bf6b8){if(_[_0xe7ba('0x10')](_0x3bf6b8)){throw new Error(_0x5e70d9+_0xe7ba('0x68'));}_0x18e715=_0x3bf6b8;return db[_0x5e70d9+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x4904d2[_0xe7ba('0x2c')][_0xe7ba('0x6a')]},'include':[{'model':db[_0x5e70d9+_0xe7ba('0x6b')],'as':_0xe7ba('0x6b')},{'model':db[_0x5e70d9+_0x52d73a],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x691f8c){if(_[_0xe7ba('0x10')](_0x691f8c)){throw new Error(_0x5e70d9+_0xe7ba('0x6c'));}_0x1d3035=_0x691f8c;return _0x691f8c[_0xe7ba('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe7ba('0x13')](function(){var _0x36cf6d={'uniqueid':_0x44563b+'.'+_0x1d3035['id']+'.'+_0x1d3035[_0xe7ba('0x6b')]['id'],'FromUserId':_0x4904d2['user']['id'],'type':'queue'};_0x36cf6d[_0x5e70d9+'MessageId']=_0x1d3035['id'];_0x36cf6d[_0x5e70d9+_0xe7ba('0x6e')]=_0x1d3035[_0xe7ba('0x6b')]['id'];_0x36cf6d['From'+_0x5e70d9+_0x52d73a+'Id']=_0x1d3035['Account']['id'];_0x36cf6d['To'+_0x5e70d9+_0xe7ba('0x6f')]=_0x18e715['id'];return db[_0x5e70d9+_0xe7ba('0x70')]['create'](_0x36cf6d);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise('Start',{'channel':_0x44563b,'interaction':_0x1d3035['Interaction'],'message':_0x1d3035,'account':_0x1d3035['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7ba('0x71'),'appdata':_0x18e715[_0xe7ba('0xf')]+','+(_0x1d3035[_0xe7ba('0x65')][_0xe7ba('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7ba('0x13')](respondWithResult(_0x8cba2c,null))[_0xe7ba('0x14')](handleError(_0x8cba2c,null));};};exports['agentNotify']=function(_0x575170,_0x459b0c){var _0x5d5722,_0x40ae10;if(_[_0xe7ba('0x10')](_0x575170[_0xe7ba('0x2c')]['channel'])){throw new Error(_0xe7ba('0x73'));}var _0x17391f=_0x575170[_0xe7ba('0x2c')][_0xe7ba('0x74')];var _0x34b5d8=_[_0xe7ba('0x62')](_0x17391f);var _0x44c657=_0x17391f===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0xe7ba('0x75')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x575170[_0xe7ba('0x18')]['id'],'role':_0xe7ba('0x39')}})[_0xe7ba('0x13')](function(_0x16b3df){if(_[_0xe7ba('0x10')](_0x16b3df)){throw new Error(_0xe7ba('0x76'));}_0x5d5722=_0x16b3df;return db[_0x34b5d8+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x575170[_0xe7ba('0x2c')]['messageId']},'include':[{'model':db[_0x34b5d8+'Interaction'],'as':'Interaction'},{'model':db[_0x34b5d8+_0x44c657],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x34f0f9){if(_[_0xe7ba('0x10')](_0x34f0f9)){throw new Error(_0x34b5d8+_0xe7ba('0x6c'));}_0x40ae10=_0x34f0f9;return _0x34f0f9['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2c86d2={'uniqueid':_0x17391f+'.'+_0x40ae10['id']+'.'+_0x40ae10['Interaction']['id'],'FromUserId':_0x575170[_0xe7ba('0x2e')]['id'],'type':_0xe7ba('0x71'),'ToUserId':_0x5d5722['id']};_0x2c86d2[_0x34b5d8+_0xe7ba('0x77')]=_0x40ae10['id'];_0x2c86d2[_0x34b5d8+_0xe7ba('0x6e')]=_0x40ae10[_0xe7ba('0x6b')]['id'];_0x2c86d2[_0xe7ba('0x78')+_0x34b5d8+_0x44c657+'Id']=_0x40ae10[_0xe7ba('0x65')]['id'];return db[_0x34b5d8+_0xe7ba('0x70')]['create'](_0x2c86d2);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise(_0xe7ba('0x79'),{'channel':_0x17391f,'interaction':_0x40ae10[_0xe7ba('0x6b')],'message':_0x40ae10,'account':_0x40ae10['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x5d5722[_0xe7ba('0xf')]+','+(_0x40ae10[_0xe7ba('0x65')][_0xe7ba('0x7a')]||0x12c),'interval':_0xe7ba('0x7b')}]},routingClient);})['then'](respondWithResult(_0x459b0c,null))[_0xe7ba('0x14')](handleError(_0x459b0c,null));};
\ No newline at end of file
+var _0x425d=['http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','isNil','rows','find','query','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','length','format','updateAttributes','findOrCreate','INTERACTION','interface','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','campaigns','Campaigns','ChatQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client'];(function(_0xc3704a,_0x1a3ff7){var _0x11e3b9=function(_0x3beab8){while(--_0x3beab8){_0xc3704a['push'](_0xc3704a['shift']());}};_0x11e3b9(++_0x1a3ff7);}(_0x425d,0x1e0));var _0xd425=function(_0x3f975a,_0xf22b0b){_0x3f975a=_0x3f975a-0x0;var _0x512370=_0x425d[_0x3f975a];return _0x512370;};'use strict';var BPromise=require(_0xd425('0x0'));var moment=require('moment');var _=require(_0xd425('0x1'));var util=require(_0xd425('0x2'));var db=require(_0xd425('0x3'))['db'];var logger=require(_0xd425('0x4'))(_0xd425('0x5'));var jayson=require(_0xd425('0x6'));var amiClient=jayson[_0xd425('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232b});var routingClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){var _0x262b02=_0x50b061?_0x50b061:amiClient;return _0x262b02[_0xd425('0x9')](_0x1d97d9,_0x1d2ed0)[_0xd425('0xa')](function(_0x2beb20){if(_0x2beb20[_0xd425('0xb')]){if(_0x2beb20[_0xd425('0xb')][_0xd425('0xc')]===0x1f4){return _0x374c3d(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}return _0xb6ba8e(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}else{_0xb6ba8e(_0x2beb20[_0xd425('0xe')]);}})[_0xd425('0xf')](function(_0x2385a5){_0x374c3d(_0x2385a5);});});}function respondWithResult(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xc8;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x10')](_0x3cacf7)['json'](_0x3b5de8);}return _0x9bb611[_0xd425('0x11')](0x194);};}function handleError(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0x1f4;return function(_0x5d3d60){logger[_0xd425('0xb')](_0x5d3d60[_0xd425('0x12')]);if(_0x5d3d60[_0xd425('0x13')]){delete _0x5d3d60[_0xd425('0x13')];}_0x17a498[_0xd425('0x10')](_0x336dc3)['send'](_0x5d3d60);};}function findById(_0x278626){return function(_0x471267){if(!_[_0xd425('0x14')](_0x278626)&&!_[_0xd425('0x14')](_0x471267)&&!_['isNil'](_0x471267[_0xd425('0x15')])){return _[_0xd425('0x16')](_0x471267[_0xd425('0x15')],function(_0x1155bc){return _0x1155bc['id']==_0x278626;});}return null;};}exports['voiceChannels']=function(_0x58a0c1,_0x5debc3){return respondWithRpcPromise('VoiceChannels',_0x58a0c1[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x5debc3,null))[_0xd425('0xf')](handleError(_0x5debc3,null));};exports['voiceChannelMixMonitor']=function(_0x355af0,_0x7e982e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xd425('0x18')](_0x355af0[_0xd425('0x17')],_0x355af0[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x7e982e,null))[_0xd425('0xf')](handleError(_0x7e982e,null));};exports[_0xd425('0x1a')]=function(_0x2480a0,_0x3500bb){return respondWithRpcPromise(_0xd425('0x1b'),_[_0xd425('0x18')](_0x2480a0[_0xd425('0x17')],_0x2480a0[_0xd425('0x19')]))['then'](respondWithResult(_0x3500bb,null))[_0xd425('0xf')](handleError(_0x3500bb,null));};exports[_0xd425('0x1c')]=function(_0x398985,_0x1908a5){return respondWithRpcPromise(_0xd425('0x1d'),_0x398985[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x1908a5,null))['catch'](handleError(_0x1908a5,null));};exports[_0xd425('0x1e')]=function(_0x177de2,_0x1d8861){return respondWithRpcPromise('VoiceQueues',_0x177de2[_0xd425('0x17')])[_0xd425('0xa')](findById(_0x177de2[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x1d8861,null))[_0xd425('0xf')](handleError(_0x1d8861,null));};exports[_0xd425('0x1f')]=function(_0x2fd17a,_0x37b63c){return respondWithRpcPromise(_0xd425('0x20'),_[_0xd425('0x18')](_0x2fd17a['body'],_0x2fd17a[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x37b63c,null))[_0xd425('0xf')](handleError(_0x37b63c,null));};exports[_0xd425('0x21')]=function(_0x3275b1,_0x1abf33){return respondWithRpcPromise(_0xd425('0x22'),_[_0xd425('0x18')](_0x3275b1[_0xd425('0x17')],_0x3275b1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x1abf33,null))['catch'](handleError(_0x1abf33,null));};exports[_0xd425('0x23')]=function(_0x2a2a9b,_0x3120a4){return respondWithRpcPromise(_0xd425('0x24'),_0x2a2a9b[_0xd425('0x17')])['then'](respondWithResult(_0x3120a4,null))[_0xd425('0xf')](handleError(_0x3120a4,null));};exports[_0xd425('0x25')]=function(_0x4cfcd1,_0x574962){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xd425('0x18')](_0x4cfcd1[_0xd425('0x17')],_0x4cfcd1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x574962,null))['catch'](handleError(_0x574962,null));};exports[_0xd425('0x26')]=function(_0x1d4414,_0x30a9dc){return respondWithRpcPromise(_0xd425('0x27'),_[_0xd425('0x18')](_0x1d4414[_0xd425('0x17')],_0x1d4414[_0xd425('0x19')]))['then'](respondWithResult(_0x30a9dc,null))[_0xd425('0xf')](handleError(_0x30a9dc,null));};exports['voiceQueuesChannelRedirect']=function(_0x22df81,_0x29cca9){return respondWithRpcPromise(_0xd425('0x28'),_['merge'](_0x22df81[_0xd425('0x17')],_0x22df81[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x29cca9,null))[_0xd425('0xf')](handleError(_0x29cca9,null));};exports['outbound']=function(_0x1d38fa,_0x3cf540){return respondWithRpcPromise('Outbound',_0x1d38fa['query'])['then'](respondWithResult(_0x3cf540,null))[_0xd425('0xf')](handleError(_0x3cf540,null));};exports[_0xd425('0x29')]=function(_0x1f30c1,_0x588688){return respondWithRpcPromise('OutboundChannels',_0x1f30c1['query'])[_0xd425('0xa')](respondWithResult(_0x588688,null))[_0xd425('0xf')](handleError(_0x588688,null));};exports[_0xd425('0x2a')]=function(_0x1d5017,_0xa9fd7c){var _0x14f3be;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'])[_0xd425('0xa')](function(_0x3c88a8){_0x14f3be=_0x3c88a8;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'],routingClient);})[_0xd425('0xa')](function(_0x2dffc7){return _[_0xd425('0x18')]({},_0x2dffc7,_0x14f3be);})['then'](respondWithResult(_0xa9fd7c,null))[_0xd425('0xf')](handleError(_0xa9fd7c,null));};exports[_0xd425('0x2c')]=function(_0x1c5ba6,_0x2d7a2f){if(_0x1c5ba6['body']&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]&&_0x1c5ba6[_0xd425('0x2f')]&&_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]){for(var _0x2f6bf7 in _0x1c5ba6[_0xd425('0x2d')]['interaction']){if(_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]['hasOwnProperty'](_0x2f6bf7)){db[_0xd425('0x30')]['findAll']({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6['user'][_0xd425('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1c5ba6[_0xd425('0x2d')]['interaction'][_0x2f6bf7]&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')]?{'$notIn':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7]}:{'$ne':null}}})['then'](function(_0x2e4b21){var _0x5f3cfd=moment()[_0xd425('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x78ed9b=0x0,_0x16f61c=_0x2e4b21[_0xd425('0x31')];_0x78ed9b<_0x16f61c;_0x78ed9b+=0x1){_0x2e4b21[_0x78ed9b][_0xd425('0x33')]({'exitAt':_0x5f3cfd});}});for(var _0x624543=0x0;_0x624543<_0x1c5ba6['body'][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')];_0x624543+=0x1){db[_0xd425('0x30')][_0xd425('0x34')]({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')]['name'],'type':_0xd425('0x35'),'uniqueid':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0x624543],'exitAt':null},'defaults':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')],'interface':_[_0xd425('0x14')](_0x1c5ba6['user'][_0xd425('0x36')])?util[_0xd425('0x32')]('SIP/%s',_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]):_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x36')],'type':'INTERACTION','enterAt':moment()[_0xd425('0x32')](_0xd425('0x37')),'role':_0xd425('0x38'),'internal':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x39')],'uniqueid':_0x1c5ba6['body']['interaction'][_0x2f6bf7][_0x624543]}});}}}}return respondWithRpcPromise(_0xd425('0x3a'),{'id':_0x1c5ba6['params']['id'],'capacity':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x3b')]},routingClient)['then'](respondWithResult(_0x2d7a2f,null))[_0xd425('0xf')](handleError(_0x2d7a2f,null));};exports['telephones']=function(_0x48d5b8,_0x39f588){return respondWithRpcPromise(_0xd425('0x3c'),_0x48d5b8[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x39f588,null))[_0xd425('0xf')](handleError(_0x39f588,null));};exports[_0xd425('0x3d')]=function(_0xeb3586,_0x4118fe){return respondWithRpcPromise('Trunks',_0xeb3586[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x4118fe,null))[_0xd425('0xf')](handleError(_0x4118fe,null));};exports[_0xd425('0x3e')]=function(_0x7b1080,_0x1c80c2){return respondWithRpcPromise(_0xd425('0x3f'),_0x7b1080[_0xd425('0x17')])['then'](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['chatQueues']=function(_0x145e76,_0x2c5d01){return respondWithRpcPromise(_0xd425('0x40'),_0x145e76[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x2c5d01,null))['catch'](handleError(_0x2c5d01,null));};exports['showChatQueues']=function(_0x5e1294,_0x254b8b){return respondWithRpcPromise(_0xd425('0x40'),_0x5e1294['query'],routingClient)[_0xd425('0xa')](findById(_0x5e1294[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x254b8b,null))['catch'](handleError(_0x254b8b,null));};exports['mailQueues']=function(_0x599cb5,_0x49d75e){return respondWithRpcPromise('MailQueues',_0x599cb5['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x49d75e,null))[_0xd425('0xf')](handleError(_0x49d75e,null));};exports[_0xd425('0x41')]=function(_0x5b2323,_0x3395d8){return respondWithRpcPromise('MailQueues',_0x5b2323[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5b2323[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x3395d8,null))[_0xd425('0xf')](handleError(_0x3395d8,null));};exports[_0xd425('0x42')]=function(_0xa21f7c,_0x3ca6a6){return respondWithRpcPromise(_0xd425('0x43'),_0xa21f7c['query'],mailClient)[_0xd425('0xa')](respondWithResult(_0x3ca6a6,null))[_0xd425('0xf')](handleError(_0x3ca6a6,null));};exports[_0xd425('0x44')]=function(_0xf22906,_0x5c4df8){return respondWithRpcPromise('OpenchannelQueues',_0xf22906[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5c4df8,null))[_0xd425('0xf')](handleError(_0x5c4df8,null));};exports[_0xd425('0x45')]=function(_0x464ed1,_0x2e0f00){return respondWithRpcPromise(_0xd425('0x46'),_0x464ed1[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x464ed1[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x2e0f00,null))[_0xd425('0xf')](handleError(_0x2e0f00,null));};exports[_0xd425('0x47')]=function(_0x28979e,_0x5e72db){return respondWithRpcPromise(_0xd425('0x48'),_0x28979e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5e72db,null))['catch'](handleError(_0x5e72db,null));};exports['showSmsQueues']=function(_0x5ade1a,_0x403cb3){return respondWithRpcPromise(_0xd425('0x48'),_0x5ade1a[_0xd425('0x17')],routingClient)['then'](findById(_0x5ade1a[_0xd425('0x19')]['id']))['then'](respondWithResult(_0x403cb3,null))[_0xd425('0xf')](handleError(_0x403cb3,null));};exports[_0xd425('0x49')]=function(_0x21d26e,_0x5113fc){return respondWithRpcPromise(_0xd425('0x4a'),_0x21d26e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5113fc,null))[_0xd425('0xf')](handleError(_0x5113fc,null));};exports[_0xd425('0x4b')]=function(_0x43b1a9,_0x38a762){return respondWithRpcPromise(_0xd425('0x4a'),_0x43b1a9[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x43b1a9[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x38a762,null))[_0xd425('0xf')](handleError(_0x38a762,null));};exports[_0xd425('0x4c')]=function(_0x445f98,_0x443126){return respondWithRpcPromise(_0xd425('0x4d'),_0x445f98[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x443126,null))['catch'](handleError(_0x443126,null));};exports[_0xd425('0x4e')]=function(_0x5c333a,_0x135048){return respondWithRpcPromise(_0xd425('0x4d'),_0x5c333a[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5c333a['params']['id']))[_0xd425('0xa')](respondWithResult(_0x135048,null))[_0xd425('0xf')](handleError(_0x135048,null));};exports[_0xd425('0x4f')]=function(_0x689332,_0x2536bd){return respondWithRpcPromise(_0xd425('0x50'),_0x689332['query'])['then'](respondWithResult(_0x2536bd,null))[_0xd425('0xf')](handleError(_0x2536bd,null));};exports[_0xd425('0x51')]=function(_0x5e76f5,_0x174081){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5e76f5[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x174081,null))[_0xd425('0xf')](handleError(_0x174081,null));};exports[_0xd425('0x52')]=function(_0x376134,_0x2514fa){return respondWithRpcPromise(_0xd425('0x53'),_0x376134['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x2514fa,null))[_0xd425('0xf')](handleError(_0x2514fa,null));};exports[_0xd425('0x54')]=function(_0x233efa,_0xfcba08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x233efa[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0xfcba08,null))['catch'](handleError(_0xfcba08,null));};exports[_0xd425('0x55')]=function(_0x4599b0,_0x48bed3){return respondWithRpcPromise(_0xd425('0x56'),_0x4599b0[_0xd425('0x17')],routingClient)[_0xd425('0xa')](function(_0xd923bb){if(_0x4599b0[_0xd425('0x17')]['type']!==undefined){var _0x454cce=_(_0xd923bb['rows'])[_0xd425('0x57')]([_0x4599b0[_0xd425('0x17')]['type'],_0x4599b0[_0xd425('0x19')]['id']])[_0xd425('0x58')](_0xd425('0x59'))[_0xd425('0x5a')]()['value']();return _0xd923bb['rows'][_0xd425('0x57')](function(_0x2312c1){return _0x454cce[_0xd425('0x5b')](_0x2312c1['queue_id'])>-0x1;});}else{return _0xd923bb[_0xd425('0x15')][_0xd425('0x57')](function(_0x5b932c){return _0x5b932c[_0xd425('0x59')]===parseInt(_0x4599b0['params']['id']);});}})[_0xd425('0xa')](respondWithResult(_0x48bed3,null))[_0xd425('0xf')](handleError(_0x48bed3,null));};exports[_0xd425('0x5c')]=function(_0x2493e7,_0x5750dc){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2493e7[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5750dc,null))['catch'](handleError(_0x5750dc,null));};exports[_0xd425('0x5d')]=function(_0x389099,_0x51c9ad){return respondWithRpcPromise(_0xd425('0x5e'),_0x389099[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x51c9ad,null))[_0xd425('0xf')](handleError(_0x51c9ad,null));};exports[_0xd425('0x5f')]=function(_0xf251e6,_0x302066){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0xf251e6['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x302066,null))['catch'](handleError(_0x302066,null));};exports[_0xd425('0x60')]=function(_0x236030){return function(_0x58cad5,_0x244789){var _0x1c1c77,_0x5dac05;var _0x592c40=_[_0xd425('0x61')](_0x236030);var _0x242ed8=_0x236030===_0xd425('0x62')?_0xd425('0x63'):_0xd425('0x64');return db[_0x592c40+_0xd425('0x65')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x58cad5[_0xd425('0x19')]['id']}})['then'](function(_0x2cff42){if(_[_0xd425('0x14')](_0x2cff42)){throw new Error(_0x592c40+'\x20Queue\x20not\x20found');}_0x1c1c77=_0x2cff42;return db[_0x592c40+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x58cad5[_0xd425('0x2d')][_0xd425('0x68')]},'include':[{'model':db[_0x592c40+_0xd425('0x69')],'as':_0xd425('0x69')},{'model':db[_0x592c40+_0x242ed8],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0x334062){if(_[_0xd425('0x14')](_0x334062)){throw new Error(_0x592c40+_0xd425('0x6a'));}_0x5dac05=_0x334062;return _0x334062['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd425('0xa')](function(){var _0x498e81={'uniqueid':_0x236030+'.'+_0x5dac05['id']+'.'+_0x5dac05['Interaction']['id'],'FromUserId':_0x58cad5[_0xd425('0x2f')]['id'],'type':'queue'};_0x498e81[_0x592c40+_0xd425('0x6b')]=_0x5dac05['id'];_0x498e81[_0x592c40+_0xd425('0x6c')]=_0x5dac05[_0xd425('0x69')]['id'];_0x498e81[_0xd425('0x6d')+_0x592c40+_0x242ed8+'Id']=_0x5dac05[_0xd425('0x64')]['id'];_0x498e81['To'+_0x592c40+_0xd425('0x6e')]=_0x1c1c77['id'];return db[_0x592c40+_0xd425('0x6f')]['create'](_0x498e81);})[_0xd425('0xa')](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x236030,'interaction':_0x5dac05[_0xd425('0x69')],'message':_0x5dac05,'account':_0x5dac05[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x71'),'appdata':_0x1c1c77['name']+','+(_0x5dac05[_0xd425('0x64')][_0xd425('0x72')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})[_0xd425('0xa')](respondWithResult(_0x244789,null))[_0xd425('0xf')](handleError(_0x244789,null));};};exports[_0xd425('0x74')]=function(_0x409612,_0x4147eb){var _0x433e5d,_0x334226;if(_[_0xd425('0x14')](_0x409612[_0xd425('0x2d')]['channel'])){throw new Error(_0xd425('0x75'));}var _0x5d8a47=_0x409612[_0xd425('0x2d')][_0xd425('0x76')];var _0x1c03d6=_[_0xd425('0x61')](_0x5d8a47);var _0xf06395=_0x5d8a47==='chat'?_0xd425('0x63'):_0xd425('0x64');return db[_0xd425('0x77')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x409612[_0xd425('0x19')]['id'],'role':_0xd425('0x38')}})[_0xd425('0xa')](function(_0x568a83){if(_[_0xd425('0x14')](_0x568a83)){throw new Error('Agent\x20not\x20found');}_0x433e5d=_0x568a83;return db[_0x1c03d6+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x409612['body'][_0xd425('0x68')]},'include':[{'model':db[_0x1c03d6+_0xd425('0x69')],'as':'Interaction'},{'model':db[_0x1c03d6+_0xf06395],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0xca2955){if(_[_0xd425('0x14')](_0xca2955)){throw new Error(_0x1c03d6+_0xd425('0x6a'));}_0x334226=_0xca2955;return _0xca2955[_0xd425('0x78')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3f1a48={'uniqueid':_0x5d8a47+'.'+_0x334226['id']+'.'+_0x334226['Interaction']['id'],'FromUserId':_0x409612[_0xd425('0x2f')]['id'],'type':'queue','ToUserId':_0x433e5d['id']};_0x3f1a48[_0x1c03d6+_0xd425('0x6b')]=_0x334226['id'];_0x3f1a48[_0x1c03d6+_0xd425('0x6c')]=_0x334226[_0xd425('0x69')]['id'];_0x3f1a48[_0xd425('0x6d')+_0x1c03d6+_0xf06395+'Id']=_0x334226['Account']['id'];return db[_0x1c03d6+'TransferReport']['create'](_0x3f1a48);})['then'](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x5d8a47,'interaction':_0x334226['Interaction'],'message':_0x334226,'account':_0x334226[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x38'),'appdata':_0x433e5d[_0xd425('0x13')]+','+(_0x334226[_0xd425('0x64')][_0xd425('0x79')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})['then'](respondWithResult(_0x4147eb,null))[_0xd425('0xf')](handleError(_0x4147eb,null));};
\ No newline at end of file
index a4b126f..8313faa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf31b=['isAuthenticated','show','/:id/run','post','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id'];(function(_0x5dbd67,_0x4f98e9){var _0x4e3f93=function(_0x1f4182){while(--_0x1f4182){_0x5dbd67['push'](_0x5dbd67['shift']());}};_0x4e3f93(++_0x4f98e9);}(_0xf31b,0x1cf));var _0xbf31=function(_0x29ec09,_0x3bb3bc){_0x29ec09=_0x29ec09-0x0;var _0x535143=_0xf31b[_0x29ec09];return _0x535143;};'use strict';var multer=require('multer');var util=require(_0xbf31('0x0'));var path=require(_0xbf31('0x1'));var timeout=require(_0xbf31('0x2'));var express=require(_0xbf31('0x3'));var router=express['Router']();var fs_extra=require(_0xbf31('0x4'));var auth=require(_0xbf31('0x5'));var interaction=require(_0xbf31('0x6'));var config=require(_0xbf31('0x7'));var controller=require(_0xbf31('0x8'));router[_0xbf31('0x9')]('/',auth['isAuthenticated'](),controller[_0xbf31('0xa')]);router[_0xbf31('0x9')](_0xbf31('0xb'),auth[_0xbf31('0xc')](),controller[_0xbf31('0xd')]);router[_0xbf31('0x9')](_0xbf31('0xe'),auth[_0xbf31('0xc')](),controller['run']);router[_0xbf31('0xf')]('/',auth[_0xbf31('0xc')](),controller['create']);router['put'](_0xbf31('0xb'),auth[_0xbf31('0xc')](),controller[_0xbf31('0x10')]);router['delete'](_0xbf31('0xb'),auth[_0xbf31('0xc')](),controller[_0xbf31('0x11')]);module[_0xbf31('0x12')]=router;
\ No newline at end of file
+var _0x8d81=['../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','/:id/run','run','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x8d81,0x1f1));var _0x18d8=function(_0x33dd8d,_0x26cc07){_0x33dd8d=_0x33dd8d-0x0;var _0x522b1a=_0x8d81[_0x33dd8d];return _0x522b1a;};'use strict';var multer=require(_0x18d8('0x0'));var util=require(_0x18d8('0x1'));var path=require('path');var timeout=require(_0x18d8('0x2'));var express=require(_0x18d8('0x3'));var router=express[_0x18d8('0x4')]();var fs_extra=require(_0x18d8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x18d8('0x6'));var config=require(_0x18d8('0x7'));var controller=require(_0x18d8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x18d8('0x9')](_0x18d8('0xa'),auth[_0x18d8('0xb')](),controller[_0x18d8('0xc')]);router[_0x18d8('0x9')](_0x18d8('0xd'),auth['isAuthenticated'](),controller[_0x18d8('0xe')]);router[_0x18d8('0xf')]('/',auth[_0x18d8('0xb')](),controller[_0x18d8('0x10')]);router[_0x18d8('0x11')](_0x18d8('0xa'),auth[_0x18d8('0xb')](),controller[_0x18d8('0x12')]);router[_0x18d8('0x13')](_0x18d8('0xa'),auth['isAuthenticated'](),controller[_0x18d8('0x14')]);module['exports']=router;
\ No newline at end of file
index 82490ad..31e30b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffff=['pdf','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','weeks','days','hours','minutes','csv'];(function(_0x34b053,_0x4b2a42){var _0x23db31=function(_0x15ef55){while(--_0x15ef55){_0x34b053['push'](_0x34b053['shift']());}};_0x23db31(++_0x4b2a42);}(_0xffff,0x1a6));var _0xffff=function(_0x4ea62e,_0x20fe48){_0x4ea62e=_0x4ea62e-0x0;var _0x8af359=_0xffff[_0x4ea62e];return _0x8af359;};'use strict';var Sequelize=require(_0xffff('0x0'));module[_0xffff('0x1')]={'name':{'type':Sequelize[_0xffff('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xffff('0x2')]},'active':{'type':Sequelize[_0xffff('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xffff('0x2')],'allowNull':![],'defaultValue':_0xffff('0x4')},'startAt':{'type':Sequelize[_0xffff('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xffff('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xffff('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xffff('0x7')](_0xffff('0x8'),'quarters',_0xffff('0x9'),_0xffff('0xa'),_0xffff('0xb'),_0xffff('0xc'),_0xffff('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xffff('0x7')](_0xffff('0xe'),_0xffff('0xf'),'xlsx'),'allowNull':![],'defaultValue':_0xffff('0xe')},'type':{'type':Sequelize[_0xffff('0x7')]('custom',_0xffff('0x10')),'allowNull':![],'defaultValue':_0xffff('0x11')},'sendMail':{'type':Sequelize[_0xffff('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xffff('0x2')]},'cc':{'type':Sequelize[_0xffff('0x12')]},'bcc':{'type':Sequelize[_0xffff('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xffff('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb582=['months','weeks','days','hours','ENUM','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb582,0xc9));var _0x2b58=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb582[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x2b58('0x0'));module[_0x2b58('0x1')]={'name':{'type':Sequelize[_0x2b58('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2b58('0x2')]},'active':{'type':Sequelize[_0x2b58('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2b58('0x2')],'allowNull':![],'defaultValue':_0x2b58('0x4')},'startAt':{'type':Sequelize[_0x2b58('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2b58('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2b58('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x2b58('0x7'),'quarters',_0x2b58('0x8'),_0x2b58('0x9'),_0x2b58('0xa'),_0x2b58('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x2b58('0xa')},'output':{'type':Sequelize[_0x2b58('0xc')](_0x2b58('0xd'),_0x2b58('0xe'),_0x2b58('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x2b58('0xc')](_0x2b58('0x10'),_0x2b58('0x11')),'allowNull':![],'defaultValue':_0x2b58('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x2b58('0x2')]},'cc':{'type':Sequelize[_0x2b58('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 14c4e85..d61aa42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81f9=['name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','catch','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','Scheduler','UserProfileResource','error','stack'];(function(_0xf1226a,_0x29a250){var _0x1b8fe7=function(_0x7178a5){while(--_0x7178a5){_0xf1226a['push'](_0xf1226a['shift']());}};_0x1b8fe7(++_0x29a250);}(_0x81f9,0x1b1));var _0x981f=function(_0x3cd975,_0x23f21f){_0x3cd975=_0x3cd975-0x0;var _0x579111=_0x81f9[_0x3cd975];return _0x579111;};'use strict';var emlformat=require(_0x981f('0x0'));var rimraf=require(_0x981f('0x1'));var zipdir=require(_0x981f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x981f('0x3'));var BPromise=require(_0x981f('0x4'));var Mustache=require('mustache');var util=require(_0x981f('0x5'));var path=require(_0x981f('0x6'));var sox=require(_0x981f('0x7'));var csv=require('to-csv');var ejs=require(_0x981f('0x8'));var fs=require('fs');var fs_extra=require(_0x981f('0x9'));var _=require(_0x981f('0xa'));var squel=require('squel');var crypto=require(_0x981f('0xb'));var jsforce=require(_0x981f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x981f('0xd'));var Papa=require('papaparse');var Redis=require(_0x981f('0xe'));var authService=require(_0x981f('0xf'));var qs=require(_0x981f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x981f('0x11'))(_0x981f('0x12'));var utils=require(_0x981f('0x13'));var config=require(_0x981f('0x14'));var licenseUtil=require(_0x981f('0x15'));var db=require(_0x981f('0x16'))['db'];function respondWithStatusCode(_0x55bfa3,_0x3d0c05){_0x3d0c05=_0x3d0c05||0xcc;return function(_0xb120b9){if(_0xb120b9){return _0x55bfa3[_0x981f('0x17')](_0x3d0c05);}return _0x55bfa3[_0x981f('0x18')](_0x3d0c05)[_0x981f('0x19')]();};}function respondWithResult(_0x1b5eab,_0x572abd){_0x572abd=_0x572abd||0xc8;return function(_0x481a6f){if(_0x481a6f){return _0x1b5eab['status'](_0x572abd)[_0x981f('0x1a')](_0x481a6f);}};}function respondWithFilteredResult(_0x51aa19,_0x5d699d){return function(_0x408e06){if(_0x408e06){var _0x3d56e2=typeof _0x5d699d[_0x981f('0x1b')]===_0x981f('0x1c')&&typeof _0x5d699d[_0x981f('0x1d')]===_0x981f('0x1c');var _0x66f2bf=_0x408e06[_0x981f('0x1e')];var _0x28ce3a=_0x3d56e2?0x0:_0x5d699d['offset'];var _0x13e9a3=_0x3d56e2?_0x408e06[_0x981f('0x1e')]:_0x5d699d[_0x981f('0x1b')]+_0x5d699d[_0x981f('0x1d')];var _0x528427;if(_0x13e9a3>=_0x66f2bf){_0x13e9a3=_0x66f2bf;_0x528427=0xc8;}else{_0x528427=0xce;}_0x51aa19[_0x981f('0x18')](_0x528427);return _0x51aa19[_0x981f('0x1f')](_0x981f('0x20'),_0x28ce3a+'-'+_0x13e9a3+'/'+_0x66f2bf)[_0x981f('0x1a')](_0x408e06);}return null;};}function patchUpdates(_0x2488ca){return function(_0x435aff){try{jsonpatch['apply'](_0x435aff,_0x2488ca,!![]);}catch(_0xfbc536){return BPromise['reject'](_0xfbc536);}return _0x435aff['save']();};}function saveUpdates(_0x2258fa,_0x2c485d){return function(_0x2cabec){if(_0x2cabec){return _0x2cabec[_0x981f('0x21')](_0x2258fa)[_0x981f('0x22')](function(_0x479cd2){return _0x479cd2;});}return null;};}function removeEntity(_0x5e5d63,_0x4b31a7){return function(_0x207e04){if(_0x207e04){return _0x207e04[_0x981f('0x23')]()['then'](function(){var _0x47d67b=_0x207e04[_0x981f('0x24')]({'plain':!![]});var _0x1f52ff=_0x981f('0x25');return db[_0x981f('0x26')][_0x981f('0x23')]({'where':{'type':_0x1f52ff,'resourceId':_0x47d67b['id']}})[_0x981f('0x22')](function(){return _0x207e04;});})['then'](function(){_0x5e5d63[_0x981f('0x18')](0xcc)[_0x981f('0x19')]();});}};}function handleEntityNotFound(_0x16fc6f,_0x31f22e){return function(_0x584461){if(!_0x584461){_0x16fc6f['sendStatus'](0x194);}return _0x584461;};}function handleError(_0x4de353,_0x3a6f38){_0x3a6f38=_0x3a6f38||0x1f4;return function(_0x3d7a76){logger[_0x981f('0x27')](_0x3d7a76[_0x981f('0x28')]);if(_0x3d7a76[_0x981f('0x29')]){delete _0x3d7a76[_0x981f('0x29')];}_0x4de353[_0x981f('0x18')](_0x3a6f38)[_0x981f('0x2a')](_0x3d7a76);};}exports[_0x981f('0x2b')]=function(_0x52bb62,_0x393821){var _0x4399d3={},_0x1665c9={},_0x1f1532={'count':0x0,'rows':[]};var _0x1f2172=_[_0x981f('0x2c')](db[_0x981f('0x2d')][_0x981f('0x2e')],function(_0xc78423){return{'name':_0xc78423[_0x981f('0x2f')],'type':_0xc78423[_0x981f('0x30')][_0x981f('0x31')]};});_0x1665c9[_0x981f('0x32')]=_['map'](_0x1f2172,_0x981f('0x29'));_0x1665c9[_0x981f('0x33')]=_[_0x981f('0x34')](_0x52bb62[_0x981f('0x33')]);_0x1665c9[_0x981f('0x35')]=_['intersection'](_0x1665c9[_0x981f('0x32')],_0x1665c9[_0x981f('0x33')]);_0x4399d3[_0x981f('0x36')]=_[_0x981f('0x37')](_0x1665c9[_0x981f('0x32')],qs[_0x981f('0x38')](_0x52bb62['query']['fields']));_0x4399d3['attributes']=_0x4399d3[_0x981f('0x36')][_0x981f('0x39')]?_0x4399d3['attributes']:_0x1665c9[_0x981f('0x32')];if(!_0x52bb62[_0x981f('0x33')][_0x981f('0x3a')]('nolimit')){_0x4399d3[_0x981f('0x1d')]=qs['limit'](_0x52bb62[_0x981f('0x33')][_0x981f('0x1d')]);_0x4399d3[_0x981f('0x1b')]=qs[_0x981f('0x1b')](_0x52bb62[_0x981f('0x33')][_0x981f('0x1b')]);}_0x4399d3[_0x981f('0x3b')]=qs[_0x981f('0x3c')](_0x52bb62[_0x981f('0x33')][_0x981f('0x3c')]);_0x4399d3[_0x981f('0x3d')]=qs[_0x981f('0x35')](_['pick'](_0x52bb62[_0x981f('0x33')],_0x1665c9[_0x981f('0x35')]),_0x1f2172);if(_0x52bb62[_0x981f('0x33')][_0x981f('0x3e')]){_0x4399d3[_0x981f('0x3d')]=_[_0x981f('0x3f')](_0x4399d3['where'],{'$or':_[_0x981f('0x2c')](_0x1f2172,function(_0x43e31d){if(_0x43e31d[_0x981f('0x30')]!=='VIRTUAL'){var _0x49e6a8={};_0x49e6a8[_0x43e31d[_0x981f('0x29')]]={'$like':'%'+_0x52bb62[_0x981f('0x33')]['filter']+'%'};return _0x49e6a8;}})});}_0x4399d3=_[_0x981f('0x3f')]({},_0x4399d3,_0x52bb62[_0x981f('0x40')]);var _0x28f312={'where':_0x4399d3[_0x981f('0x3d')]};return db['Schedule'][_0x981f('0x1e')](_0x28f312)[_0x981f('0x22')](function(_0x3e865f){_0x1f1532[_0x981f('0x1e')]=_0x3e865f;if(_0x52bb62[_0x981f('0x33')][_0x981f('0x41')]){_0x4399d3[_0x981f('0x42')]=[{'all':!![]}];}return db[_0x981f('0x2d')]['findAll'](_0x4399d3);})['then'](function(_0x195d07){_0x1f1532['rows']=_0x195d07;return _0x1f1532;})[_0x981f('0x22')](respondWithFilteredResult(_0x393821,_0x4399d3))[_0x981f('0x43')](handleError(_0x393821,null));};exports['show']=function(_0x45e49e,_0x13dc66){var _0x57f9d5={'raw':![],'where':{'id':_0x45e49e['params']['id']}},_0x44ba05={};_0x44ba05['model']=_[_0x981f('0x34')](db[_0x981f('0x2d')][_0x981f('0x2e')]);_0x44ba05[_0x981f('0x33')]=_[_0x981f('0x34')](_0x45e49e[_0x981f('0x33')]);_0x44ba05[_0x981f('0x35')]=_[_0x981f('0x37')](_0x44ba05[_0x981f('0x32')],_0x44ba05[_0x981f('0x33')]);_0x57f9d5[_0x981f('0x36')]=_[_0x981f('0x37')](_0x44ba05[_0x981f('0x32')],qs[_0x981f('0x38')](_0x45e49e[_0x981f('0x33')]['fields']));_0x57f9d5[_0x981f('0x36')]=_0x57f9d5[_0x981f('0x36')]['length']?_0x57f9d5[_0x981f('0x36')]:_0x44ba05['model'];if(_0x45e49e[_0x981f('0x33')][_0x981f('0x41')]){_0x57f9d5['include']=[{'all':!![]}];}_0x57f9d5=_[_0x981f('0x3f')]({},_0x57f9d5,_0x45e49e[_0x981f('0x40')]);return db[_0x981f('0x2d')][_0x981f('0x44')](_0x57f9d5)[_0x981f('0x22')](handleEntityNotFound(_0x13dc66,null))[_0x981f('0x22')](respondWithResult(_0x13dc66,null))['catch'](handleError(_0x13dc66,null));};exports[_0x981f('0x45')]=function(_0x4d6b8e,_0x25ab85){return db[_0x981f('0x2d')][_0x981f('0x45')](_0x4d6b8e[_0x981f('0x46')],{})[_0x981f('0x22')](function(_0x3d3cf2){var _0x3388d6=_0x4d6b8e[_0x981f('0x47')][_0x981f('0x24')]({'plain':!![]});if(!_0x3388d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3388d6[_0x981f('0x48')]===_0x981f('0x47')){var _0x304ed5=_0x3d3cf2[_0x981f('0x24')]({'plain':!![]});var _0x172ca2=_0x981f('0x25');return db['UserProfileSection'][_0x981f('0x44')]({'where':{'name':_0x172ca2,'userProfileId':_0x3388d6[_0x981f('0x49')]},'raw':!![]})[_0x981f('0x22')](function(_0x25e58f){if(_0x25e58f&&_0x25e58f[_0x981f('0x4a')]===0x0){return db[_0x981f('0x26')][_0x981f('0x45')]({'name':_0x304ed5[_0x981f('0x29')],'resourceId':_0x304ed5['id'],'type':_0x25e58f[_0x981f('0x29')],'sectionId':_0x25e58f['id']},{})[_0x981f('0x22')](function(){return _0x3d3cf2;});}else{return _0x3d3cf2;}})[_0x981f('0x43')](function(_0x5af314){logger[_0x981f('0x27')](_0x981f('0x4b'),_0x5af314);throw _0x5af314;});}return _0x3d3cf2;})[_0x981f('0x22')](respondWithResult(_0x25ab85,0xc9))[_0x981f('0x43')](handleError(_0x25ab85,null));};exports[_0x981f('0x21')]=function(_0x297af7,_0x1f050b){if(_0x297af7[_0x981f('0x46')]['id']){delete _0x297af7[_0x981f('0x46')]['id'];}return db['Schedule'][_0x981f('0x44')]({'where':{'id':_0x297af7[_0x981f('0x4c')]['id']}})[_0x981f('0x22')](handleEntityNotFound(_0x1f050b,null))[_0x981f('0x22')](saveUpdates(_0x297af7['body'],null))[_0x981f('0x22')](respondWithResult(_0x1f050b,null))['catch'](handleError(_0x1f050b,null));};exports[_0x981f('0x23')]=function(_0xb8e72f,_0x2aaa02){return db[_0x981f('0x2d')]['find']({'where':{'id':_0xb8e72f[_0x981f('0x4c')]['id']}})[_0x981f('0x22')](handleEntityNotFound(_0x2aaa02,null))[_0x981f('0x22')](removeEntity(_0x2aaa02,null))['catch'](handleError(_0x2aaa02,null));};exports[_0x981f('0x4d')]=function(_0x1dbf19,_0x2cc95a,_0xa9f07f){var _0x272a10=require(_0x981f('0x4e'));return db[_0x981f('0x2d')][_0x981f('0x44')]({'where':{'id':_0x1dbf19[_0x981f('0x4c')]['id']},'raw':!![]})[_0x981f('0x22')](handleEntityNotFound(_0x2cc95a,null))[_0x981f('0x22')](function(){_0x272a10[_0x981f('0x4d')](_0x1dbf19[_0x981f('0x4c')]['id']);})['then'](respondWithStatusCode(_0x2cc95a,null))[_0x981f('0x43')](handleError(_0x2cc95a,null));};
\ No newline at end of file
+var _0x9741=['nolimit','sort','pick','filter','where','merge','options','findAll','rows','keys','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','params','run','eml-format','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/parsers/advancedSearch','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','map','filters','intersection','fields','attributes','length','query'];(function(_0x40552c,_0x410889){var _0xdda8cf=function(_0x27dc6c){while(--_0x27dc6c){_0x40552c['push'](_0x40552c['shift']());}};_0xdda8cf(++_0x410889);}(_0x9741,0xb2));var _0x1974=function(_0x41c6ae,_0x313008){_0x41c6ae=_0x41c6ae-0x0;var _0x395a8a=_0x9741[_0x41c6ae];return _0x395a8a;};'use strict';var emlformat=require(_0x1974('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1974('0x1'));var BPromise=require(_0x1974('0x2'));var Mustache=require(_0x1974('0x3'));var util=require(_0x1974('0x4'));var path=require(_0x1974('0x5'));var sox=require(_0x1974('0x6'));var csv=require(_0x1974('0x7'));var ejs=require(_0x1974('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1974('0x9'));var squel=require(_0x1974('0xa'));var crypto=require(_0x1974('0xb'));var jsforce=require(_0x1974('0xc'));var deskjs=require(_0x1974('0xd'));var toCsv=require(_0x1974('0x7'));var querystring=require(_0x1974('0xe'));var Papa=require(_0x1974('0xf'));var Redis=require(_0x1974('0x10'));var authService=require(_0x1974('0x11'));var qs=require(_0x1974('0x12'));var as=require(_0x1974('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1974('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1974('0x15'))['db'];function respondWithStatusCode(_0x202ec7,_0x5201ae){_0x5201ae=_0x5201ae||0xcc;return function(_0x16e281){if(_0x16e281){return _0x202ec7['sendStatus'](_0x5201ae);}return _0x202ec7[_0x1974('0x16')](_0x5201ae)[_0x1974('0x17')]();};}function respondWithResult(_0x307b57,_0x137814){_0x137814=_0x137814||0xc8;return function(_0x3de8fd){if(_0x3de8fd){return _0x307b57[_0x1974('0x16')](_0x137814)[_0x1974('0x18')](_0x3de8fd);}};}function respondWithFilteredResult(_0x1ddf93,_0x1966a7){return function(_0x1c252d){if(_0x1c252d){var _0x5edb5b=typeof _0x1966a7[_0x1974('0x19')]===_0x1974('0x1a')&&typeof _0x1966a7[_0x1974('0x1b')]===_0x1974('0x1a');var _0x3539a8=_0x1c252d[_0x1974('0x1c')];var _0xf4eacf=_0x5edb5b?0x0:_0x1966a7[_0x1974('0x19')];var _0x5e5599=_0x5edb5b?_0x1c252d[_0x1974('0x1c')]:_0x1966a7['offset']+_0x1966a7[_0x1974('0x1b')];var _0x47e34d;if(_0x5e5599>=_0x3539a8){_0x5e5599=_0x3539a8;_0x47e34d=0xc8;}else{_0x47e34d=0xce;}_0x1ddf93[_0x1974('0x16')](_0x47e34d);return _0x1ddf93['set'](_0x1974('0x1d'),_0xf4eacf+'-'+_0x5e5599+'/'+_0x3539a8)[_0x1974('0x18')](_0x1c252d);}return null;};}function patchUpdates(_0x244425){return function(_0x2338bb){try{jsonpatch['apply'](_0x2338bb,_0x244425,!![]);}catch(_0xd3815a){return BPromise[_0x1974('0x1e')](_0xd3815a);}return _0x2338bb[_0x1974('0x1f')]();};}function saveUpdates(_0x2c9b21,_0x14104b){return function(_0xc7e563){if(_0xc7e563){return _0xc7e563[_0x1974('0x20')](_0x2c9b21)[_0x1974('0x21')](function(_0x5653d7){return _0x5653d7;});}return null;};}function removeEntity(_0x3553cf,_0x39bb1f){return function(_0x2cb7d3){if(_0x2cb7d3){return _0x2cb7d3[_0x1974('0x22')]()['then'](function(){var _0x1938c4=_0x2cb7d3[_0x1974('0x23')]({'plain':!![]});var _0x27c5e0=_0x1974('0x24');return db[_0x1974('0x25')][_0x1974('0x22')]({'where':{'type':_0x27c5e0,'resourceId':_0x1938c4['id']}})[_0x1974('0x21')](function(){return _0x2cb7d3;});})[_0x1974('0x21')](function(){_0x3553cf[_0x1974('0x16')](0xcc)[_0x1974('0x17')]();});}};}function handleEntityNotFound(_0x4df01f,_0x701c71){return function(_0x5cdd8b){if(!_0x5cdd8b){_0x4df01f[_0x1974('0x26')](0x194);}return _0x5cdd8b;};}function handleError(_0x449c17,_0x5addcd){_0x5addcd=_0x5addcd||0x1f4;return function(_0x334c39){logger['error'](_0x334c39[_0x1974('0x27')]);if(_0x334c39['name']){delete _0x334c39[_0x1974('0x28')];}_0x449c17[_0x1974('0x16')](_0x5addcd)[_0x1974('0x29')](_0x334c39);};}exports[_0x1974('0x2a')]=function(_0x18facc,_0xfcbaeb){var _0x41eff5={},_0x526953={},_0x40f88e={'count':0x0,'rows':[]};var _0x52f12f=_['map'](db[_0x1974('0x2b')][_0x1974('0x2c')],function(_0x28c720){return{'name':_0x28c720[_0x1974('0x2d')],'type':_0x28c720[_0x1974('0x2e')][_0x1974('0x2f')]};});_0x526953[_0x1974('0x30')]=_[_0x1974('0x31')](_0x52f12f,'name');_0x526953['query']=_['keys'](_0x18facc['query']);_0x526953[_0x1974('0x32')]=_[_0x1974('0x33')](_0x526953[_0x1974('0x30')],_0x526953['query']);_0x41eff5['attributes']=_[_0x1974('0x33')](_0x526953[_0x1974('0x30')],qs['fields'](_0x18facc['query'][_0x1974('0x34')]));_0x41eff5[_0x1974('0x35')]=_0x41eff5[_0x1974('0x35')][_0x1974('0x36')]?_0x41eff5[_0x1974('0x35')]:_0x526953[_0x1974('0x30')];if(!_0x18facc[_0x1974('0x37')]['hasOwnProperty'](_0x1974('0x38'))){_0x41eff5[_0x1974('0x1b')]=qs[_0x1974('0x1b')](_0x18facc[_0x1974('0x37')][_0x1974('0x1b')]);_0x41eff5['offset']=qs[_0x1974('0x19')](_0x18facc[_0x1974('0x37')]['offset']);}_0x41eff5['order']=qs[_0x1974('0x39')](_0x18facc[_0x1974('0x37')]['sort']);_0x41eff5['where']=qs['filters'](_[_0x1974('0x3a')](_0x18facc['query'],_0x526953['filters']),_0x52f12f);if(_0x18facc[_0x1974('0x37')][_0x1974('0x3b')]){_0x41eff5[_0x1974('0x3c')]=_[_0x1974('0x3d')](_0x41eff5['where'],{'$or':_[_0x1974('0x31')](_0x52f12f,function(_0x1133c7){if(_0x1133c7[_0x1974('0x2e')]!=='VIRTUAL'){var _0x3e3a0c={};_0x3e3a0c[_0x1133c7['name']]={'$like':'%'+_0x18facc['query'][_0x1974('0x3b')]+'%'};return _0x3e3a0c;}})});}_0x41eff5=_[_0x1974('0x3d')]({},_0x41eff5,_0x18facc[_0x1974('0x3e')]);var _0x5305c7={'where':_0x41eff5[_0x1974('0x3c')]};return db[_0x1974('0x2b')][_0x1974('0x1c')](_0x5305c7)[_0x1974('0x21')](function(_0x3ce877){_0x40f88e[_0x1974('0x1c')]=_0x3ce877;if(_0x18facc[_0x1974('0x37')]['includeAll']){_0x41eff5['include']=[{'all':!![]}];}return db[_0x1974('0x2b')][_0x1974('0x3f')](_0x41eff5);})[_0x1974('0x21')](function(_0x5525f0){_0x40f88e[_0x1974('0x40')]=_0x5525f0;return _0x40f88e;})[_0x1974('0x21')](respondWithFilteredResult(_0xfcbaeb,_0x41eff5))['catch'](handleError(_0xfcbaeb,null));};exports['show']=function(_0x1ffb6a,_0x3283cb){var _0xd5c68c={'raw':![],'where':{'id':_0x1ffb6a['params']['id']}},_0x386991={};_0x386991[_0x1974('0x30')]=_[_0x1974('0x41')](db[_0x1974('0x2b')][_0x1974('0x2c')]);_0x386991[_0x1974('0x37')]=_[_0x1974('0x41')](_0x1ffb6a[_0x1974('0x37')]);_0x386991[_0x1974('0x32')]=_[_0x1974('0x33')](_0x386991[_0x1974('0x30')],_0x386991[_0x1974('0x37')]);_0xd5c68c[_0x1974('0x35')]=_[_0x1974('0x33')](_0x386991['model'],qs[_0x1974('0x34')](_0x1ffb6a[_0x1974('0x37')]['fields']));_0xd5c68c['attributes']=_0xd5c68c[_0x1974('0x35')][_0x1974('0x36')]?_0xd5c68c[_0x1974('0x35')]:_0x386991[_0x1974('0x30')];if(_0x1ffb6a[_0x1974('0x37')][_0x1974('0x42')]){_0xd5c68c[_0x1974('0x43')]=[{'all':!![]}];}_0xd5c68c=_[_0x1974('0x3d')]({},_0xd5c68c,_0x1ffb6a['options']);return db[_0x1974('0x2b')][_0x1974('0x44')](_0xd5c68c)[_0x1974('0x21')](handleEntityNotFound(_0x3283cb,null))[_0x1974('0x21')](respondWithResult(_0x3283cb,null))[_0x1974('0x45')](handleError(_0x3283cb,null));};exports['create']=function(_0x5ee7f8,_0x3ec7b7){return db[_0x1974('0x2b')][_0x1974('0x46')](_0x5ee7f8[_0x1974('0x47')],{})[_0x1974('0x21')](function(_0x4adf10){var _0x384754=_0x5ee7f8[_0x1974('0x48')][_0x1974('0x23')]({'plain':!![]});if(!_0x384754)throw new Error(_0x1974('0x49'));if(_0x384754[_0x1974('0x4a')]===_0x1974('0x48')){var _0x3d448c=_0x4adf10[_0x1974('0x23')]({'plain':!![]});var _0x137213='Scheduler';return db['UserProfileSection'][_0x1974('0x44')]({'where':{'name':_0x137213,'userProfileId':_0x384754[_0x1974('0x4b')]},'raw':!![]})[_0x1974('0x21')](function(_0x15b031){if(_0x15b031&&_0x15b031['autoAssociation']===0x0){return db[_0x1974('0x25')]['create']({'name':_0x3d448c['name'],'resourceId':_0x3d448c['id'],'type':_0x15b031[_0x1974('0x28')],'sectionId':_0x15b031['id']},{})['then'](function(){return _0x4adf10;});}else{return _0x4adf10;}})[_0x1974('0x45')](function(_0x2cfcee){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cfcee);throw _0x2cfcee;});}return _0x4adf10;})[_0x1974('0x21')](respondWithResult(_0x3ec7b7,0xc9))[_0x1974('0x45')](handleError(_0x3ec7b7,null));};exports['update']=function(_0x33ac43,_0x15a38f){if(_0x33ac43[_0x1974('0x47')]['id']){delete _0x33ac43['body']['id'];}return db[_0x1974('0x2b')]['find']({'where':{'id':_0x33ac43[_0x1974('0x4c')]['id']}})[_0x1974('0x21')](handleEntityNotFound(_0x15a38f,null))[_0x1974('0x21')](saveUpdates(_0x33ac43[_0x1974('0x47')],null))[_0x1974('0x21')](respondWithResult(_0x15a38f,null))[_0x1974('0x45')](handleError(_0x15a38f,null));};exports['destroy']=function(_0x3c949b,_0x20a3c3){return db[_0x1974('0x2b')][_0x1974('0x44')]({'where':{'id':_0x3c949b[_0x1974('0x4c')]['id']}})[_0x1974('0x21')](handleEntityNotFound(_0x20a3c3,null))[_0x1974('0x21')](removeEntity(_0x20a3c3,null))[_0x1974('0x45')](handleError(_0x20a3c3,null));};exports[_0x1974('0x4d')]=function(_0x56056a,_0x20fd07,_0x3cf13b){var _0x51abd1=require('../../config/schedule');return db[_0x1974('0x2b')]['find']({'where':{'id':_0x56056a[_0x1974('0x4c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x20fd07,null))[_0x1974('0x21')](function(){_0x51abd1[_0x1974('0x4d')](_0x56056a[_0x1974('0x4c')]['id']);})[_0x1974('0x21')](respondWithStatusCode(_0x20fd07,null))[_0x1974('0x45')](handleError(_0x20fd07,null));};
\ No newline at end of file
index fa11440..ebdc060 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb7a=['tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x537bcf,_0x425d45){var _0x29e166=function(_0x13aee1){while(--_0x13aee1){_0x537bcf['push'](_0x537bcf['shift']());}};_0x29e166(++_0x425d45);}(_0xdb7a,0x88));var _0xadb7=function(_0x2b7c29,_0x534ba9){_0x2b7c29=_0x2b7c29-0x0;var _0x2d29aa=_0xdb7a[_0x2b7c29];return _0x2d29aa;};'use strict';var _=require(_0xadb7('0x0'));var util=require(_0xadb7('0x1'));var logger=require(_0xadb7('0x2'))(_0xadb7('0x3'));var moment=require(_0xadb7('0x4'));var BPromise=require(_0xadb7('0x5'));var rp=require(_0xadb7('0x6'));var fs=require('fs');var path=require(_0xadb7('0x7'));var rimraf=require(_0xadb7('0x8'));var config=require(_0xadb7('0x9'));var attributes=require(_0xadb7('0xa'));module[_0xadb7('0xb')]=function(_0x335978,_0x347417){return _0x335978[_0xadb7('0xc')](_0xadb7('0xd'),attributes,{'tableName':_0xadb7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb16b=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Schedule'];(function(_0x148ab5,_0x584ea2){var _0x1d87a1=function(_0x11d9f1){while(--_0x11d9f1){_0x148ab5['push'](_0x148ab5['shift']());}};_0x1d87a1(++_0x584ea2);}(_0xb16b,0x8c));var _0xbb16=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xb16b[_0x57474e];return _0xfaae8c;};'use strict';var _=require(_0xbb16('0x0'));var util=require(_0xbb16('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbb16('0x2'));var BPromise=require(_0xbb16('0x3'));var rp=require(_0xbb16('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb16('0x5'));var config=require(_0xbb16('0x6'));var attributes=require('./schedule.attributes');module[_0xbb16('0x7')]=function(_0xa58fc0,_0x5050c9){return _0xa58fc0[_0xbb16('0x8')](_0xbb16('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d0c59b2..4617918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e6=['stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x334b49,_0x156a79){var _0x576636=function(_0x367588){while(--_0x367588){_0x334b49['push'](_0x334b49['shift']());}};_0x576636(++_0x156a79);}(_0x50e6,0x1e2));var _0x650e=function(_0x1bdf80,_0x361054){_0x1bdf80=_0x1bdf80-0x0;var _0x4f3b56=_0x50e6[_0x1bdf80];return _0x4f3b56;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x650e('0x0'));var BPromise=require('bluebird');var rs=require(_0x650e('0x1'));var fs=require('fs');var Redis=require(_0x650e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x650e('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x650e('0x4'));var client=jayson[_0x650e('0x5')][_0x650e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3b2126,_0x212e2b,_0x3eabf1){return new BPromise(function(_0x37ae83,_0x305d31){return client[_0x650e('0x7')](_0x3b2126,_0x3eabf1)['then'](function(_0x528b6e){logger[_0x650e('0x8')]('Schedule,\x20%s,\x20%s',_0x212e2b,_0x650e('0x9'));logger[_0x650e('0xa')](_0x650e('0xb'),_0x212e2b,_0x650e('0x9'),JSON[_0x650e('0xc')](_0x528b6e));if(_0x528b6e[_0x650e('0xd')]){if(_0x528b6e[_0x650e('0xd')][_0x650e('0xe')]===0x1f4){logger[_0x650e('0xd')](_0x650e('0xf'),_0x212e2b,_0x528b6e[_0x650e('0xd')][_0x650e('0x10')]);return _0x305d31(_0x528b6e['error'][_0x650e('0x10')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x212e2b,_0x528b6e[_0x650e('0xd')][_0x650e('0x10')]);return _0x37ae83(_0x528b6e[_0x650e('0xd')][_0x650e('0x10')]);}else{logger[_0x650e('0x8')](_0x650e('0xf'),_0x212e2b,'request\x20sent');_0x37ae83(_0x528b6e[_0x650e('0x11')][_0x650e('0x10')]);}})[_0x650e('0x12')](function(_0x343860){logger[_0x650e('0xd')](_0x650e('0xf'),_0x212e2b,_0x343860);_0x305d31(_0x343860);});});}
\ No newline at end of file
+var _0x4fd8=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x4351ef,_0x178920){var _0x41a551=function(_0x337381){while(--_0x337381){_0x4351ef['push'](_0x4351ef['shift']());}};_0x41a551(++_0x178920);}(_0x4fd8,0x128));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x84fd('0x0'));var util=require(_0x84fd('0x1'));var moment=require(_0x84fd('0x2'));var BPromise=require(_0x84fd('0x3'));var rs=require(_0x84fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x84fd('0x5'))(_0x84fd('0x6'));var config=require(_0x84fd('0x7'));var jayson=require(_0x84fd('0x8'));var client=jayson[_0x84fd('0x9')][_0x84fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20b036,_0x5354fb,_0xafc230){return new BPromise(function(_0x1d8e83,_0x23752e){return client[_0x84fd('0xb')](_0x20b036,_0xafc230)[_0x84fd('0xc')](function(_0x4b3faf){logger[_0x84fd('0xd')](_0x84fd('0xe'),_0x5354fb,_0x84fd('0xf'));logger[_0x84fd('0x10')](_0x84fd('0x11'),_0x5354fb,_0x84fd('0xf'),JSON[_0x84fd('0x12')](_0x4b3faf));if(_0x4b3faf['error']){if(_0x4b3faf[_0x84fd('0x13')]['code']===0x1f4){logger['error'](_0x84fd('0xe'),_0x5354fb,_0x4b3faf[_0x84fd('0x13')][_0x84fd('0x14')]);return _0x23752e(_0x4b3faf[_0x84fd('0x13')][_0x84fd('0x14')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x5354fb,_0x4b3faf[_0x84fd('0x13')]['message']);return _0x1d8e83(_0x4b3faf[_0x84fd('0x13')][_0x84fd('0x14')]);}else{logger['info'](_0x84fd('0xe'),_0x5354fb,_0x84fd('0xf'));_0x1d8e83(_0x4b3faf[_0x84fd('0x15')][_0x84fd('0x14')]);}})[_0x84fd('0x16')](function(_0xd43051){logger[_0x84fd('0x13')](_0x84fd('0xe'),_0x5354fb,_0xd43051);_0x23752e(_0xd43051);});});}
\ No newline at end of file
index 109df1f..7cc15d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfad9=['create','put','update','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xfad9,0x17e));var _0x9fad=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0xfad9[_0x1e5cc3];return _0x15c596;};'use strict';var multer=require('multer');var util=require(_0x9fad('0x0'));var path=require('path');var timeout=require(_0x9fad('0x1'));var express=require(_0x9fad('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9fad('0x3'));var interaction=require(_0x9fad('0x4'));var config=require(_0x9fad('0x5'));var controller=require(_0x9fad('0x6'));router[_0x9fad('0x7')]('/',auth[_0x9fad('0x8')](),controller[_0x9fad('0x9')]);router[_0x9fad('0x7')](_0x9fad('0xa'),auth[_0x9fad('0x8')](),controller[_0x9fad('0xb')]);router[_0x9fad('0x7')](_0x9fad('0xc'),auth[_0x9fad('0x8')](),controller[_0x9fad('0xd')]);router[_0x9fad('0x7')](_0x9fad('0xe'),auth[_0x9fad('0x8')](),controller[_0x9fad('0xf')]);router[_0x9fad('0x10')]('/',auth[_0x9fad('0x8')](),controller[_0x9fad('0x11')]);router[_0x9fad('0x12')](_0x9fad('0xc'),auth['isAuthenticated'](),controller[_0x9fad('0x13')]);router['delete'](_0x9fad('0xc'),auth[_0x9fad('0x8')](),controller['destroy']);module[_0x9fad('0x14')]=router;
\ No newline at end of file
+var _0x709e=['put','/:id','update','delete','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/download'];(function(_0x402f9b,_0x20d321){var _0xcd7db2=function(_0x2ff845){while(--_0x2ff845){_0x402f9b['push'](_0x402f9b['shift']());}};_0xcd7db2(++_0x20d321);}(_0x709e,0x199));var _0xe709=function(_0x1e12e8,_0x9f8894){_0x1e12e8=_0x1e12e8-0x0;var _0x251fc2=_0x709e[_0x1e12e8];return _0x251fc2;};'use strict';var multer=require(_0xe709('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe709('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe709('0x2'));var interaction=require(_0xe709('0x3'));var config=require(_0xe709('0x4'));var controller=require('./screenRecording.controller');router[_0xe709('0x5')]('/',auth[_0xe709('0x6')](),controller['index']);router[_0xe709('0x5')](_0xe709('0x7'),auth['isAuthenticated'](),controller[_0xe709('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe709('0x9')]);router['get'](_0xe709('0xa'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe709('0xb')](_0xe709('0xc'),auth[_0xe709('0x6')](),controller[_0xe709('0xd')]);router[_0xe709('0xe')](_0xe709('0xc'),auth[_0xe709('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 24c67dd..090deb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bab=['extname','STRING','replace','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x6bab[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0xb6ba('0x0'));var moment=require(_0xb6ba('0x1'));var path=require(_0xb6ba('0x2'));var config=require(_0xb6ba('0x3'));module['exports']={'format':{'type':Sequelize[_0xb6ba('0x4')],'get':function(){return this[_0xb6ba('0x5')](_0xb6ba('0x6'))?path[_0xb6ba('0x7')](this[_0xb6ba('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xb6ba('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xb6ba('0x8')],'set':function(_0x389a0d){var _0x3fd283=_0x389a0d[_0xb6ba('0x9')](/\\/g,'/');this[_0xb6ba('0xa')](_0xb6ba('0x6'),_0x3fd283);}},'rating':{'type':Sequelize[_0xb6ba('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb6ba('0xb')],'set':function(_0x36bdc2){this['setDataValue'](_0xb6ba('0xc'),moment()['subtract'](_0x36bdc2,'ms'));this['setDataValue']('closedAt',moment());this[_0xb6ba('0xa')](_0xb6ba('0xd'),_0x36bdc2);}},'startedAt':{'type':Sequelize[_0xb6ba('0xe')],'get':function(){return moment(this['getDataValue'](_0xb6ba('0xc')))[_0xb6ba('0xf')](_0xb6ba('0x10'))[_0xb6ba('0x11')]();}},'closedAt':{'type':Sequelize[_0xb6ba('0xe')],'get':function(){return moment(this[_0xb6ba('0x5')](_0xb6ba('0x12')))[_0xb6ba('0xf')](_0xb6ba('0x10'))[_0xb6ba('0x11')]();}},'createdAt':{'type':Sequelize[_0xb6ba('0xe')],'get':function(){return moment(this[_0xb6ba('0x5')](_0xb6ba('0x13')))[_0xb6ba('0xf')](_0xb6ba('0x10'))[_0xb6ba('0x11')]();}},'updatedAt':{'type':Sequelize[_0xb6ba('0xe')],'get':function(){return moment(this[_0xb6ba('0x5')](_0xb6ba('0x14')))['format'](_0xb6ba('0x10'))['toString']();}}};
\ No newline at end of file
+var _0xd506=['getDataValue','updatedAt','sequelize','extname','STRING','replace','setDataValue','value','INTEGER','startedAt','subtract','closedAt','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x2492a5,_0x20fcf6){var _0xdb3668=function(_0x63a38b){while(--_0x63a38b){_0x2492a5['push'](_0x2492a5['shift']());}};_0xdb3668(++_0x20fcf6);}(_0xd506,0x197));var _0x6d50=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd506[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x6d50('0x0'));var moment=require('moment');var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('value')?path[_0x6d50('0x1')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6d50('0x2')]},'value':{'type':Sequelize[_0x6d50('0x2')],'set':function(_0x1b0af3){var _0x4cf512=_0x1b0af3[_0x6d50('0x3')](/\\/g,'/');this[_0x6d50('0x4')](_0x6d50('0x5'),_0x4cf512);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6d50('0x6')],'set':function(_0x5012ed){this[_0x6d50('0x4')](_0x6d50('0x7'),moment()[_0x6d50('0x8')](_0x5012ed,'ms'));this[_0x6d50('0x4')](_0x6d50('0x9'),moment());this[_0x6d50('0x4')]('duration',_0x5012ed);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x6d50('0x7')))[_0x6d50('0xa')](_0x6d50('0xb'))[_0x6d50('0xc')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6d50('0xd')]('closedAt'))[_0x6d50('0xa')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6d50('0xd')]('createdAt'))[_0x6d50('0xa')](_0x6d50('0xb'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6d50('0xd')](_0x6d50('0xe')))[_0x6d50('0xa')]('MM-DD-YYYY\x20HH:mm')[_0x6d50('0xc')]();}}};
\ No newline at end of file
index 7b0250e..4f81c99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5a=['ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','recording','existsSync','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','map','rawAttributes','fieldName','key','model','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x50003d,_0x501872){_0x50003d=_0x50003d-0x0;var _0xa723c1=_0x9c5a[_0x50003d];return _0xa723c1;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)[_0xa9c5('0x18')]();});}};}function handleEntityNotFound(_0x32fc7d,_0x4cbba1){return function(_0x40f08b){if(!_0x40f08b){_0x32fc7d[_0xa9c5('0x17')](0x194);}return _0x40f08b;};}function handleError(_0x51b64a,_0x4e8a7f){_0x4e8a7f=_0x4e8a7f||0x1f4;return function(_0x242771){logger['error'](_0x242771[_0xa9c5('0x25')]);if(_0x242771[_0xa9c5('0x26')]){delete _0x242771['name'];}_0x51b64a[_0xa9c5('0x19')](_0x4e8a7f)[_0xa9c5('0x27')](_0x242771);};}exports['index']=function(_0x413edf,_0x32baf9){var _0x198cdf={},_0x185eb8={},_0x325c65={'count':0x0,'rows':[]};var _0x4f6e70=_[_0xa9c5('0x28')](db['ScreenRecording'][_0xa9c5('0x29')],function(_0x1ef388){return{'name':_0x1ef388[_0xa9c5('0x2a')],'type':_0x1ef388['type'][_0xa9c5('0x2b')]};});_0x185eb8[_0xa9c5('0x2c')]=_['differenceBy'](_[_0xa9c5('0x28')](_0x4f6e70,_0xa9c5('0x26')),[_0xa9c5('0x2d')]);_0x185eb8[_0xa9c5('0x2e')]=_[_0xa9c5('0x2f')](_0x413edf[_0xa9c5('0x2e')]);_0x185eb8[_0xa9c5('0x30')]=_['intersection'](_0x185eb8[_0xa9c5('0x2c')],_0x185eb8[_0xa9c5('0x2e')]);_0x198cdf[_0xa9c5('0x31')]=_[_0xa9c5('0x32')](_0x185eb8[_0xa9c5('0x2c')],qs[_0xa9c5('0x33')](_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x33')]));_0x198cdf['attributes']=_0x198cdf['attributes'][_0xa9c5('0x34')]?_0x198cdf[_0xa9c5('0x31')]:_0x185eb8[_0xa9c5('0x2c')];if(!_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x35')](_0xa9c5('0x36'))){_0x198cdf['limit']=qs['limit'](_0x413edf['query'][_0xa9c5('0x1c')]);_0x198cdf[_0xa9c5('0x1e')]=qs['offset'](_0x413edf[_0xa9c5('0x2e')]['offset']);}_0x198cdf[_0xa9c5('0x37')]=qs[_0xa9c5('0x38')](_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x38')]);_0x198cdf['where']=qs[_0xa9c5('0x30')](_[_0xa9c5('0x39')](_0x413edf[_0xa9c5('0x2e')],_0x185eb8[_0xa9c5('0x30')]),_0x4f6e70);if(_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x3a')]){_0x198cdf[_0xa9c5('0x3b')]=_[_0xa9c5('0x3c')](_0x198cdf['where'],{'$or':_[_0xa9c5('0x28')](_0x4f6e70,function(_0x46e5d2){if(_0x46e5d2[_0xa9c5('0x3d')]!==_0xa9c5('0x3e')){var _0x1132e0={};_0x1132e0[_0x46e5d2[_0xa9c5('0x26')]]={'$like':'%'+_0x413edf['query'][_0xa9c5('0x3a')]+'%'};return _0x1132e0;}})});}_0x198cdf=_['merge']({},_0x198cdf,_0x413edf[_0xa9c5('0x3f')]);var _0x5c89e7={'where':_0x198cdf[_0xa9c5('0x3b')]};return db[_0xa9c5('0x40')][_0xa9c5('0x1d')](_0x5c89e7)['then'](function(_0x12e19c){_0x325c65[_0xa9c5('0x1d')]=_0x12e19c;if(_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x41')]){_0x198cdf['include']=[{'all':!![]}];}return db[_0xa9c5('0x40')][_0xa9c5('0x42')](_0x198cdf);})[_0xa9c5('0x24')](function(_0x45668e){_0x325c65[_0xa9c5('0x43')]=_0x45668e;return _0x325c65;})['then'](respondWithFilteredResult(_0x32baf9,_0x198cdf))[_0xa9c5('0x44')](handleError(_0x32baf9,null));};exports['show']=function(_0x1de605,_0x397614){var _0x2998ad={'raw':![],'where':{'id':_0x1de605[_0xa9c5('0x45')]['id']}},_0xc8fca4={};_0xc8fca4[_0xa9c5('0x2c')]=_[_0xa9c5('0x2f')](db[_0xa9c5('0x40')][_0xa9c5('0x29')]);_0xc8fca4[_0xa9c5('0x2e')]=_['keys'](_0x1de605[_0xa9c5('0x2e')]);_0xc8fca4[_0xa9c5('0x30')]=_[_0xa9c5('0x32')](_0xc8fca4[_0xa9c5('0x2c')],_0xc8fca4[_0xa9c5('0x2e')]);_0x2998ad[_0xa9c5('0x31')]=_['intersection'](_0xc8fca4[_0xa9c5('0x2c')],qs[_0xa9c5('0x33')](_0x1de605['query']['fields']));_0x2998ad['attributes']=_0x2998ad['attributes']['length']?_0x2998ad[_0xa9c5('0x31')]:_0xc8fca4[_0xa9c5('0x2c')];if(_0x1de605[_0xa9c5('0x2e')][_0xa9c5('0x41')]){_0x2998ad[_0xa9c5('0x46')]=[{'all':!![]}];}_0x2998ad=_[_0xa9c5('0x3c')]({},_0x2998ad,_0x1de605[_0xa9c5('0x3f')]);return db[_0xa9c5('0x40')][_0xa9c5('0x47')](_0x2998ad)[_0xa9c5('0x24')](handleEntityNotFound(_0x397614,null))[_0xa9c5('0x24')](respondWithResult(_0x397614,null))[_0xa9c5('0x44')](handleError(_0x397614,null));};exports[_0xa9c5('0x48')]=function(_0x4bf8b4,_0x1108f0){return db['ScreenRecording'][_0xa9c5('0x48')](_0x4bf8b4[_0xa9c5('0x49')],{})['then'](respondWithResult(_0x1108f0,0xc9))['catch'](handleError(_0x1108f0,null));};exports[_0xa9c5('0x23')]=function(_0x32e64a,_0xeb0720){if(_0x32e64a['body']['id']){delete _0x32e64a['body']['id'];}delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4a')];delete _0x32e64a['body'][_0xa9c5('0x4b')];delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4c')];delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4d')];return db[_0xa9c5('0x40')]['find']({'where':{'id':_0x32e64a['params']['id']}})['then'](handleEntityNotFound(_0xeb0720,null))[_0xa9c5('0x24')](saveUpdates(_0x32e64a[_0xa9c5('0x49')],null))[_0xa9c5('0x24')](respondWithResult(_0xeb0720,null))[_0xa9c5('0x44')](handleError(_0xeb0720,null));};exports[_0xa9c5('0x4e')]=function(_0x15d044,_0x56bc1d){return db[_0xa9c5('0x40')][_0xa9c5('0x4e')]()[_0xa9c5('0x24')](respondWithResult(_0x56bc1d,null))[_0xa9c5('0x44')](handleError(_0x56bc1d,null));};exports[_0xa9c5('0x4f')]=function(_0x242e8a,_0x547654,_0x4fcc44){var _0x10ff6b=require('../../components/encryptor');var _0x1b158f=![];var _0x5ea9b0={};if(_0x242e8a[_0xa9c5('0x2e')][_0xa9c5('0x3d')]&&_0x242e8a[_0xa9c5('0x2e')]['type']===_0xa9c5('0x50')){_0x5ea9b0[_0xa9c5('0x50')]=_0x242e8a[_0xa9c5('0x45')]['id'];}else{_0x5ea9b0['id']=_0x242e8a[_0xa9c5('0x45')]['id'];}return db['ScreenRecording']['find']({'where':_0x5ea9b0,'attributes':['id',_0xa9c5('0x4d')],'raw':!![]})[_0xa9c5('0x24')](handleEntityNotFound(_0x547654,null))[_0xa9c5('0x24')](function(_0x5b4323){if(_0x5b4323){var _0x31e12e=path[_0xa9c5('0x51')](config[_0xa9c5('0x52')],_0xa9c5('0x53'),_0x5b4323[_0xa9c5('0x4d')]);var _0x29b198=util[_0xa9c5('0x2d')](_0xa9c5('0x54'),_0x31e12e);if(fs['existsSync'](_0x29b198)){_0x1b158f=!![];return _0x10ff6b[_0xa9c5('0x55')](_0x29b198,_0x31e12e,config['secrets'][_0xa9c5('0x56')])[_0xa9c5('0x24')](function(){return _0x5b4323;});}return _0x5b4323;}})[_0xa9c5('0x24')](function(_0x4dfe3a){if(_0x4dfe3a){var _0x4d475a=path[_0xa9c5('0x51')](config['root'],_0xa9c5('0x53'),_0x4dfe3a[_0xa9c5('0x4d')]);if(!fs[_0xa9c5('0x57')](_0x4d475a)){throw new db[(_0xa9c5('0x58'))]['ValidationError'](_0xa9c5('0x59'));}if(_0x4dfe3a[_0xa9c5('0x5a')]){return _0x547654[_0xa9c5('0x4f')](_0x4d475a,_0x4dfe3a[_0xa9c5('0x5a')]+path['extname'](_0x4d475a),function(){if(_0x1b158f){fs['unlink'](_0x4d475a);}});}else{return _0x547654[_0xa9c5('0x4f')](_0x4d475a,function(_0x3deb64){if(_0x1b158f){fs[_0xa9c5('0x5b')](_0x4d475a);}});}}})[_0xa9c5('0x44')](function(_0x279a26){if(_0x279a26[_0xa9c5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x547654[_0xa9c5('0x19')](0x194)[_0xa9c5('0x27')](_0xa9c5('0x5d'));}else{return handleError(_0x547654,null);}});};exports[_0xa9c5('0x5e')]=function(_0x2b8575,_0x372ab9){return db[_0xa9c5('0x40')][_0xa9c5('0x47')]({'where':{'id':_0x2b8575[_0xa9c5('0x45')]['id']}})[_0xa9c5('0x24')](function(_0x50d438){if(_['isNil'](_0x50d438)){throw new ReferenceError(_0xa9c5('0x5f'));}return _0x50d438;})[_0xa9c5('0x24')](function(_0x3322cc){var _0x47afaa=path['join'](config[_0xa9c5('0x52')],'server/files/screen_recordings',_0x3322cc[_0xa9c5('0x4d')]);logger[_0xa9c5('0x60')](_0xa9c5('0x61'),_0x47afaa);if(!_[_0xa9c5('0x62')](_0x3322cc[_0xa9c5('0x4d')])&&fs[_0xa9c5('0x57')](_0x47afaa)){logger[_0xa9c5('0x60')](_0xa9c5('0x63')+_0x47afaa+_0xa9c5('0x64'));fs[_0xa9c5('0x65')](_0x47afaa);}_0x47afaa=_0x47afaa+_0xa9c5('0x66');if(!_[_0xa9c5('0x62')](_0x3322cc['value'])&&fs[_0xa9c5('0x57')](_0x47afaa)){logger[_0xa9c5('0x60')](_0xa9c5('0x63')+_0x47afaa+_0xa9c5('0x64'));fs[_0xa9c5('0x65')](_0x47afaa);}return _0x3322cc;})[_0xa9c5('0x24')](function(_0x28ba54){if(!_0x28ba54)throw new InternalError();return _0x28ba54['destroy']();})['then'](function(){_0x372ab9[_0xa9c5('0x19')](0xcc)['end']();})[_0xa9c5('0x44')](handleError(_0x372ab9,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(_0x25d19f,_0x594c16){var _0xa51b5e=function(_0x5eb420){while(--_0x5eb420){_0x25d19f['push'](_0x25d19f['shift']());}};_0xa51b5e(++_0x594c16);}(_0x8958,0x93));var _0x8895=function(_0x5a55e3,_0x5c9bd5){_0x5a55e3=_0x5a55e3-0x0;var _0x1ed739=_0x8958[_0x5a55e3];return _0x1ed739;};'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 bca462d..7a40776 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8cf=['ScreenRecording','interactionid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3de36b,_0x22b3d8){var _0x13c38e=function(_0x2a353c){while(--_0x2a353c){_0x3de36b['push'](_0x3de36b['shift']());}};_0x13c38e(++_0x22b3d8);}(_0xe8cf,0x12d));var _0xfe8c=function(_0x3523cb,_0x511b5c){_0x3523cb=_0x3523cb-0x0;var _0x54efd9=_0xe8cf[_0x3523cb];return _0x54efd9;};'use strict';var _=require(_0xfe8c('0x0'));var util=require(_0xfe8c('0x1'));var logger=require(_0xfe8c('0x2'))('api');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(_0xfe8c('0x8'));var attributes=require('./screenRecording.attributes');module[_0xfe8c('0x9')]=function(_0x57b251,_0x42c7e2){return _0x57b251[_0xfe8c('0xa')](_0xfe8c('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xfe8c('0xc'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa66b=['interactionid','util','api','moment','bluebird','path','rimraf','./screenRecording.attributes','define','ScreenRecording','screen_recordings'];(function(_0x2da811,_0x4a0a42){var _0xeb2f0c=function(_0x490748){while(--_0x490748){_0x2da811['push'](_0x2da811['shift']());}};_0xeb2f0c(++_0x4a0a42);}(_0xa66b,0x1ae));var _0xba66=function(_0x426de2,_0x24acaf){_0x426de2=_0x426de2-0x0;var _0x1dbafc=_0xa66b[_0x426de2];return _0x1dbafc;};'use strict';var _=require('lodash');var util=require(_0xba66('0x0'));var logger=require('../../config/logger')(_0xba66('0x1'));var moment=require(_0xba66('0x2'));var BPromise=require(_0xba66('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba66('0x4'));var rimraf=require(_0xba66('0x5'));var config=require('../../config/environment');var attributes=require(_0xba66('0x6'));module['exports']=function(_0xc99b86,_0x1068df){return _0xc99b86[_0xba66('0x7')](_0xba66('0x8'),attributes,{'tableName':_0xba66('0x9'),'paranoid':![],'indexes':[{'name':_0xba66('0xa'),'fields':[_0xba66('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index dc4731e..aeb74e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x900b=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','util','moment','bluebird','randomstring'];(function(_0x25e954,_0x4368f1){var _0x582b4f=function(_0x3e45c5){while(--_0x3e45c5){_0x25e954['push'](_0x25e954['shift']());}};_0x582b4f(++_0x4368f1);}(_0x900b,0x94));var _0xb900=function(_0x18c0fb,_0x36d3be){_0x18c0fb=_0x18c0fb-0x0;var _0x12eed1=_0x900b[_0x18c0fb];return _0x12eed1;};'use strict';var _=require('lodash');var util=require(_0xb900('0x0'));var moment=require(_0xb900('0x1'));var BPromise=require(_0xb900('0x2'));var rs=require(_0xb900('0x3'));var fs=require('fs');var Redis=require(_0xb900('0x4'));var db=require(_0xb900('0x5'))['db'];var utils=require(_0xb900('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb900('0x7'));var client=jayson[_0xb900('0x8')][_0xb900('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21556b,_0x2606f9,_0x391cb4){return new BPromise(function(_0x270ebf,_0x378f42){return client[_0xb900('0xa')](_0x21556b,_0x391cb4)[_0xb900('0xb')](function(_0x3e9a8a){logger['info'](_0xb900('0xc'),_0x2606f9,_0xb900('0xd'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2606f9,_0xb900('0xd'),JSON[_0xb900('0xe')](_0x3e9a8a));if(_0x3e9a8a[_0xb900('0xf')]){if(_0x3e9a8a['error'][_0xb900('0x10')]===0x1f4){logger[_0xb900('0xf')](_0xb900('0xc'),_0x2606f9,_0x3e9a8a[_0xb900('0xf')][_0xb900('0x11')]);return _0x378f42(_0x3e9a8a[_0xb900('0xf')][_0xb900('0x11')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x2606f9,_0x3e9a8a['error'][_0xb900('0x11')]);return _0x270ebf(_0x3e9a8a[_0xb900('0xf')][_0xb900('0x11')]);}else{logger[_0xb900('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2606f9,'request\x20sent');_0x270ebf(_0x3e9a8a['result']['message']);}})['catch'](function(_0x1885b1){logger[_0xb900('0xf')](_0xb900('0xc'),_0x2606f9,_0x1885b1);_0x378f42(_0x1885b1);});});}
\ No newline at end of file
+var _0x83a8=['rpc','../../config/environment','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x41e137,_0x34f2bb){var _0x41e9be=function(_0x2addd9){while(--_0x2addd9){_0x41e137['push'](_0x41e137['shift']());}};_0x41e9be(++_0x34f2bb);}(_0x83a8,0x16f));var _0x883a=function(_0x3709d3,_0x35300e){_0x3709d3=_0x3709d3-0x0;var _0x40025c=_0x83a8[_0x3709d3];return _0x40025c;};'use strict';var _=require(_0x883a('0x0'));var util=require('util');var moment=require(_0x883a('0x1'));var BPromise=require(_0x883a('0x2'));var rs=require(_0x883a('0x3'));var fs=require('fs');var Redis=require(_0x883a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x883a('0x5'));var logger=require(_0x883a('0x6'))(_0x883a('0x7'));var config=require(_0x883a('0x8'));var jayson=require(_0x883a('0x9'));var client=jayson['client'][_0x883a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x277781,_0x5a581f,_0x273f3c){return new BPromise(function(_0x4986bd,_0x13e529){return client['request'](_0x277781,_0x273f3c)[_0x883a('0xb')](function(_0x3ba221){logger[_0x883a('0xc')](_0x883a('0xd'),_0x5a581f,_0x883a('0xe'));logger['debug'](_0x883a('0xf'),_0x5a581f,_0x883a('0xe'),JSON[_0x883a('0x10')](_0x3ba221));if(_0x3ba221[_0x883a('0x11')]){if(_0x3ba221[_0x883a('0x11')][_0x883a('0x12')]===0x1f4){logger[_0x883a('0x11')](_0x883a('0xd'),_0x5a581f,_0x3ba221[_0x883a('0x11')]['message']);return _0x13e529(_0x3ba221['error'][_0x883a('0x13')]);}logger[_0x883a('0x11')](_0x883a('0xd'),_0x5a581f,_0x3ba221['error'][_0x883a('0x13')]);return _0x4986bd(_0x3ba221[_0x883a('0x11')][_0x883a('0x13')]);}else{logger[_0x883a('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x5a581f,_0x883a('0xe'));_0x4986bd(_0x3ba221[_0x883a('0x14')][_0x883a('0x13')]);}})[_0x883a('0x15')](function(_0x1f7376){logger[_0x883a('0x11')](_0x883a('0xd'),_0x5a581f,_0x1f7376);_0x13e529(_0x1f7376);});});}
\ No newline at end of file
index 0b39c24..872eddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['join','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','file','addLogo','root','logologin','preferred','addPreferred','format','favicon','addFavicon','put','isAuthenticated','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/now','getDate','/:id','getLogo','/:id/logo_login','getLogoLogin','get','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x5fab,0x148));var _0xb5fa=function(_0x29c7ed,_0x389f4b){_0x29c7ed=_0x29c7ed-0x0;var _0x22b24d=_0x5fab[_0x29c7ed];return _0x22b24d;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require(_0xb5fa('0x2'));var timeout=require(_0xb5fa('0x3'));var express=require(_0xb5fa('0x4'));var router=express[_0xb5fa('0x5')]();var fs_extra=require(_0xb5fa('0x6'));var auth=require(_0xb5fa('0x7'));var interaction=require(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb5fa('0xa')]);router['get'](_0xb5fa('0xb'),controller[_0xb5fa('0xc')]);router['get'](_0xb5fa('0xd'),controller['show']);router['get']('/:id/logo',controller[_0xb5fa('0xe')]);router['get'](_0xb5fa('0xf'),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0x12'),controller[_0xb5fa('0x13')]);router[_0xb5fa('0x11')](_0xb5fa('0x14'),controller[_0xb5fa('0x15')]);router[_0xb5fa('0x11')](_0xb5fa('0x16'),controller['getFavicon']);var upload=multer({'storage':multer[_0xb5fa('0x17')]({'destination':function(_0x534dc2,_0x56f674,_0x17dedf){_0x17dedf(null,path[_0xb5fa('0x18')](config['root'],_0xb5fa('0x19')));},'filename':function(_0x3a82dd,_0x52b57a,_0x3035aa){_0x3035aa(null,util['format'](_0xb5fa('0x1a'),_0xb5fa('0x1b'),path[_0xb5fa('0x1c')](_0x52b57a[_0xb5fa('0x1d')])));}})});router[_0xb5fa('0x1e')]('/:id/logo',upload[_0xb5fa('0x1f')](_0xb5fa('0x20')),controller[_0xb5fa('0x21')]);var upload=multer({'storage':multer[_0xb5fa('0x17')]({'destination':function(_0x1e2c5b,_0x1a6f2a,_0x2468dc){_0x2468dc(null,path[_0xb5fa('0x18')](config[_0xb5fa('0x22')],_0xb5fa('0x19')));},'filename':function(_0x2bb848,_0x2c7ce9,_0x1aa12b){_0x1aa12b(null,util['format'](_0xb5fa('0x1a'),_0xb5fa('0x23'),path['extname'](_0x2c7ce9['originalname'])));}})});router['post'](_0xb5fa('0xf'),upload[_0xb5fa('0x1f')](_0xb5fa('0x20')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xb5fa('0x17')]({'destination':function(_0x350d98,_0x50d1b9,_0x36610b){_0x36610b(null,path[_0xb5fa('0x18')](config[_0xb5fa('0x22')],_0xb5fa('0x19')));},'filename':function(_0x34f195,_0x12c7ec,_0x3d0d51){_0x3d0d51(null,util['format'](_0xb5fa('0x1a'),_0xb5fa('0x24'),path['extname'](_0x12c7ec[_0xb5fa('0x1d')])));}})});router[_0xb5fa('0x1e')](_0xb5fa('0x14'),upload[_0xb5fa('0x1f')](_0xb5fa('0x20')),controller[_0xb5fa('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x131b56,_0xb72a3c,_0x1ee3ab){_0x1ee3ab(null,path[_0xb5fa('0x18')](config['root'],_0xb5fa('0x19')));},'filename':function(_0x4b4578,_0x1e1fa7,_0x537a85){_0x537a85(null,util[_0xb5fa('0x26')](_0xb5fa('0x1a'),_0xb5fa('0x27'),path[_0xb5fa('0x1c')](_0x1e1fa7[_0xb5fa('0x1d')])));}})});router[_0xb5fa('0x1e')](_0xb5fa('0x16'),upload[_0xb5fa('0x1f')](_0xb5fa('0x20')),controller[_0xb5fa('0x28')]);router[_0xb5fa('0x29')](_0xb5fa('0xd'),auth[_0xb5fa('0x2a')](),controller[_0xb5fa('0x2b')]);module['exports']=router;
\ No newline at end of file
+var _0x7cda=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./setting.controller','isAuthenticated','index','get','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','logo','extname','originalname','post','file','addLogo','server/files/images/logos/','format','%s%s','logologin','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','multer','util','path'];(function(_0x264beb,_0x4b52d9){var _0x4914ec=function(_0x1aec9b){while(--_0x1aec9b){_0x264beb['push'](_0x264beb['shift']());}};_0x4914ec(++_0x4b52d9);}(_0x7cda,0x189));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa7cd('0x0'));var util=require(_0xa7cd('0x1'));var path=require(_0xa7cd('0x2'));var timeout=require(_0xa7cd('0x3'));var express=require(_0xa7cd('0x4'));var router=express[_0xa7cd('0x5')]();var fs_extra=require(_0xa7cd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa7cd('0x7'));var config=require('../../config/environment');var controller=require(_0xa7cd('0x8'));router['get']('/',auth[_0xa7cd('0x9')](),controller[_0xa7cd('0xa')]);router[_0xa7cd('0xb')](_0xa7cd('0xc'),controller['getDate']);router[_0xa7cd('0xb')](_0xa7cd('0xd'),controller['show']);router['get'](_0xa7cd('0xe'),controller[_0xa7cd('0xf')]);router['get'](_0xa7cd('0x10'),controller[_0xa7cd('0x11')]);router[_0xa7cd('0xb')]('/:id/gdpr',controller[_0xa7cd('0x12')]);router[_0xa7cd('0xb')](_0xa7cd('0x13'),controller[_0xa7cd('0x14')]);router['get'](_0xa7cd('0x15'),controller[_0xa7cd('0x16')]);var upload=multer({'storage':multer[_0xa7cd('0x17')]({'destination':function(_0x1322cc,_0x473a29,_0x1a3686){_0x1a3686(null,path[_0xa7cd('0x18')](config[_0xa7cd('0x19')],'server/files/images/logos/'));},'filename':function(_0x49a44f,_0x105aba,_0x27782b){_0x27782b(null,util['format']('%s%s',_0xa7cd('0x1a'),path[_0xa7cd('0x1b')](_0x105aba[_0xa7cd('0x1c')])));}})});router[_0xa7cd('0x1d')](_0xa7cd('0xe'),upload['single'](_0xa7cd('0x1e')),controller[_0xa7cd('0x1f')]);var upload=multer({'storage':multer[_0xa7cd('0x17')]({'destination':function(_0x52919f,_0x32b26b,_0xee3ebe){_0xee3ebe(null,path[_0xa7cd('0x18')](config['root'],_0xa7cd('0x20')));},'filename':function(_0x222bfb,_0x4780ca,_0xfd327a){_0xfd327a(null,util[_0xa7cd('0x21')](_0xa7cd('0x22'),_0xa7cd('0x23'),path['extname'](_0x4780ca[_0xa7cd('0x1c')])));}})});router[_0xa7cd('0x1d')]('/:id/logo_login',upload[_0xa7cd('0x24')](_0xa7cd('0x1e')),controller[_0xa7cd('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1c597a,_0x13dd4c,_0x52bd91){_0x52bd91(null,path[_0xa7cd('0x18')](config[_0xa7cd('0x19')],_0xa7cd('0x20')));},'filename':function(_0x412c38,_0xec496c,_0xd4ec26){_0xd4ec26(null,util[_0xa7cd('0x21')](_0xa7cd('0x22'),_0xa7cd('0x26'),path[_0xa7cd('0x1b')](_0xec496c[_0xa7cd('0x1c')])));}})});router[_0xa7cd('0x1d')]('/:id/preferred',upload['single'](_0xa7cd('0x1e')),controller[_0xa7cd('0x27')]);var upload=multer({'storage':multer[_0xa7cd('0x17')]({'destination':function(_0x3a82b0,_0x4efafd,_0x126b32){_0x126b32(null,path['join'](config[_0xa7cd('0x19')],_0xa7cd('0x20')));},'filename':function(_0x55e019,_0x36e9b0,_0x40a90d){_0x40a90d(null,util[_0xa7cd('0x21')](_0xa7cd('0x22'),_0xa7cd('0x28'),path['extname'](_0x36e9b0['originalname'])));}})});router[_0xa7cd('0x1d')](_0xa7cd('0x15'),upload[_0xa7cd('0x24')](_0xa7cd('0x1e')),controller[_0xa7cd('0x29')]);router[_0xa7cd('0x2a')](_0xa7cd('0xd'),auth['isAuthenticated'](),controller[_0xa7cd('0x2b')]);module['exports']=router;
\ No newline at end of file
index df6f9fa..d8e8764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x3f4a9c,_0x226b17){var _0x23dea3=function(_0x18a024){while(--_0x18a024){_0x3f4a9c['push'](_0x3f4a9c['shift']());}};_0x23dea3(++_0x226b17);}(_0x7a54,0x106));var _0x47a5=function(_0x146751,_0x1c699d){_0x146751=_0x146751-0x0;var _0x2e02dc=_0x7a54[_0x146751];return _0x2e02dc;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x2d886e,_0x39c9d3){var _0x1b8fb2=function(_0x2183db){while(--_0x2183db){_0x2d886e['push'](_0x2d886e['shift']());}};_0x1b8fb2(++_0x39c9d3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28107d,_0x2ec8b3){_0x28107d=_0x28107d-0x0;var _0x2b1cbe=_0x5f2f[_0x28107d];return _0x2b1cbe;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 8a97cb3..5668ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c40=['addFavicon','default_favicon.ico','getDate','utcOffset','now','format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','apply','save','update','sendStatus','name','send','index','map','fieldName','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','Setting','rows','show','params','rawAttributes','includeAll','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','server/files/images/logos','default_loginLogo.svg','download','gdpr','securePassword','getPreferred','default_preferred.png'];(function(_0xa8dc5e,_0x360e04){var _0x9046b4=function(_0x150e47){while(--_0x150e47){_0xa8dc5e['push'](_0xa8dc5e['shift']());}};_0x9046b4(++_0x360e04);}(_0x3c40,0xf4));var _0x03c4=function(_0x2e3416,_0x5073f4){_0x2e3416=_0x2e3416-0x0;var _0x1749ff=_0x3c40[_0x2e3416];return _0x1749ff;};'use strict';var emlformat=require(_0x03c4('0x0'));var rimraf=require(_0x03c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03c4('0x2'));var rp=require(_0x03c4('0x3'));var moment=require(_0x03c4('0x4'));var BPromise=require(_0x03c4('0x5'));var Mustache=require('mustache');var util=require(_0x03c4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x03c4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03c4('0x8'));var squel=require(_0x03c4('0x9'));var crypto=require(_0x03c4('0xa'));var jsforce=require(_0x03c4('0xb'));var deskjs=require(_0x03c4('0xc'));var toCsv=require(_0x03c4('0x7'));var querystring=require(_0x03c4('0xd'));var Papa=require(_0x03c4('0xe'));var Redis=require('ioredis');var authService=require(_0x03c4('0xf'));var qs=require(_0x03c4('0x10'));var as=require(_0x03c4('0x11'));var hardwareService=require(_0x03c4('0x12'));var logger=require(_0x03c4('0x13'))(_0x03c4('0x14'));var utils=require('../../config/utils');var config=require(_0x03c4('0x15'));var licenseUtil=require(_0x03c4('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x03c4('0x17'));var client=jayson[_0x03c4('0x18')][_0x03c4('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4b6a85,_0x4cd60e,_0x148022,_0x4ea158){return new BPromise(function(_0x43e827,_0x58c453){var _0x4d018e=_0x4ea158||client;return _0x4d018e['request'](_0x4b6a85,_0x148022)[_0x03c4('0x1a')](function(_0x3fa72b){logger['info'](_0x03c4('0x1b'),_0x4cd60e,_0x03c4('0x1c'));logger[_0x03c4('0x1d')](_0x03c4('0x1e'),_0x4cd60e,_0x03c4('0x1c'),JSON[_0x03c4('0x1f')](_0x3fa72b));if(_0x3fa72b[_0x03c4('0x20')]){if(_0x3fa72b[_0x03c4('0x20')][_0x03c4('0x21')]===0x1f4){logger[_0x03c4('0x20')](_0x03c4('0x1b'),_0x4cd60e,_0x3fa72b['error'][_0x03c4('0x22')]);return _0x58c453(_0x3fa72b[_0x03c4('0x20')][_0x03c4('0x22')]);}logger[_0x03c4('0x20')]('Setting,\x20%s,\x20%s',_0x4cd60e,_0x3fa72b[_0x03c4('0x20')][_0x03c4('0x22')]);return _0x43e827(_0x3fa72b[_0x03c4('0x20')]['message']);}else{logger[_0x03c4('0x23')](_0x03c4('0x1b'),_0x4cd60e,_0x03c4('0x1c'));_0x43e827(_0x3fa72b[_0x03c4('0x24')][_0x03c4('0x22')]);}})[_0x03c4('0x25')](function(_0xc56464){logger['error']('Setting,\x20%s,\x20%s',_0x4cd60e,_0xc56464);_0x58c453(_0xc56464);});});}function respondWithStatusCode(_0x2065d4,_0xe086d6){_0xe086d6=_0xe086d6||0xcc;return function(_0x5c6be5){if(_0x5c6be5){return _0x2065d4['sendStatus'](_0xe086d6);}return _0x2065d4[_0x03c4('0x26')](_0xe086d6)[_0x03c4('0x27')]();};}function respondWithResult(_0x286bf3,_0x41be2a){_0x41be2a=_0x41be2a||0xc8;return function(_0x2911b9){if(_0x2911b9){return _0x286bf3['status'](_0x41be2a)[_0x03c4('0x28')](_0x2911b9);}};}function respondWithFilteredResult(_0x43fbaf,_0x5d6034){return function(_0x287d65){if(_0x287d65){var _0x14adbb=typeof _0x5d6034[_0x03c4('0x29')]===_0x03c4('0x2a')&&typeof _0x5d6034[_0x03c4('0x2b')]==='undefined';var _0x421b24=_0x287d65[_0x03c4('0x2c')];var _0x5667d8=_0x14adbb?0x0:_0x5d6034[_0x03c4('0x29')];var _0x2e3cfa=_0x14adbb?_0x287d65[_0x03c4('0x2c')]:_0x5d6034[_0x03c4('0x29')]+_0x5d6034['limit'];var _0xf98abe;if(_0x2e3cfa>=_0x421b24){_0x2e3cfa=_0x421b24;_0xf98abe=0xc8;}else{_0xf98abe=0xce;}_0x43fbaf[_0x03c4('0x26')](_0xf98abe);return _0x43fbaf[_0x03c4('0x2d')]('Content-Range',_0x5667d8+'-'+_0x2e3cfa+'/'+_0x421b24)[_0x03c4('0x28')](_0x287d65);}return null;};}function patchUpdates(_0x2f3625){return function(_0x46277f){try{jsonpatch[_0x03c4('0x2e')](_0x46277f,_0x2f3625,!![]);}catch(_0x4981f8){return BPromise['reject'](_0x4981f8);}return _0x46277f[_0x03c4('0x2f')]();};}function saveUpdates(_0x570c1b,_0x474b78){return function(_0x377355){if(_0x377355){return _0x377355[_0x03c4('0x30')](_0x570c1b)[_0x03c4('0x1a')](function(_0x5286d1){return _0x5286d1;});}return null;};}function removeEntity(_0x40ada4,_0x11e8bd){return function(_0x48e9bc){if(_0x48e9bc){return _0x48e9bc['destroy']()[_0x03c4('0x1a')](function(){_0x40ada4[_0x03c4('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3890b6,_0x1cbf89){return function(_0x8f80a0){if(!_0x8f80a0){_0x3890b6[_0x03c4('0x31')](0x194);}return _0x8f80a0;};}function handleError(_0x533fbc,_0x261e26){_0x261e26=_0x261e26||0x1f4;return function(_0x5e65c5){logger[_0x03c4('0x20')](_0x5e65c5['stack']);if(_0x5e65c5[_0x03c4('0x32')]){delete _0x5e65c5[_0x03c4('0x32')];}_0x533fbc[_0x03c4('0x26')](_0x261e26)[_0x03c4('0x33')](_0x5e65c5);};}exports[_0x03c4('0x34')]=function(_0x3445a3,_0x303280){var _0x4cd41b={},_0x27ffdf={},_0x57290e={'count':0x0,'rows':[]};var _0x1a4b30=_[_0x03c4('0x35')](db['Setting']['rawAttributes'],function(_0x220420){return{'name':_0x220420[_0x03c4('0x36')],'type':_0x220420['type']['key']};});_0x27ffdf[_0x03c4('0x37')]=_[_0x03c4('0x35')](_0x1a4b30,_0x03c4('0x32'));_0x27ffdf[_0x03c4('0x38')]=_[_0x03c4('0x39')](_0x3445a3[_0x03c4('0x38')]);_0x27ffdf[_0x03c4('0x3a')]=_['intersection'](_0x27ffdf[_0x03c4('0x37')],_0x27ffdf[_0x03c4('0x38')]);_0x4cd41b[_0x03c4('0x3b')]=_[_0x03c4('0x3c')](_0x27ffdf[_0x03c4('0x37')],qs['fields'](_0x3445a3[_0x03c4('0x38')][_0x03c4('0x3d')]));_0x4cd41b[_0x03c4('0x3b')]=_0x4cd41b[_0x03c4('0x3b')][_0x03c4('0x3e')]?_0x4cd41b[_0x03c4('0x3b')]:_0x27ffdf[_0x03c4('0x37')];if(!_0x3445a3[_0x03c4('0x38')]['hasOwnProperty'](_0x03c4('0x3f'))){_0x4cd41b[_0x03c4('0x2b')]=qs['limit'](_0x3445a3[_0x03c4('0x38')][_0x03c4('0x2b')]);_0x4cd41b[_0x03c4('0x29')]=qs['offset'](_0x3445a3[_0x03c4('0x38')][_0x03c4('0x29')]);}_0x4cd41b[_0x03c4('0x40')]=qs[_0x03c4('0x41')](_0x3445a3[_0x03c4('0x38')]['sort']);_0x4cd41b[_0x03c4('0x42')]=qs[_0x03c4('0x3a')](_['pick'](_0x3445a3[_0x03c4('0x38')],_0x27ffdf[_0x03c4('0x3a')]),_0x1a4b30);if(_0x3445a3[_0x03c4('0x38')][_0x03c4('0x43')]){_0x4cd41b['where']=_['merge'](_0x4cd41b[_0x03c4('0x42')],{'$or':_[_0x03c4('0x35')](_0x1a4b30,function(_0x10e46b){if(_0x10e46b[_0x03c4('0x44')]!==_0x03c4('0x45')){var _0x47b9b7={};_0x47b9b7[_0x10e46b['name']]={'$like':'%'+_0x3445a3['query']['filter']+'%'};return _0x47b9b7;}})});}_0x4cd41b=_[_0x03c4('0x46')]({},_0x4cd41b,_0x3445a3[_0x03c4('0x47')]);var _0xbefa05={'where':_0x4cd41b[_0x03c4('0x42')]};return db['Setting'][_0x03c4('0x2c')](_0xbefa05)[_0x03c4('0x1a')](function(_0x3fdbcc){_0x57290e[_0x03c4('0x2c')]=_0x3fdbcc;if(_0x3445a3[_0x03c4('0x38')]['includeAll']){_0x4cd41b['include']=[{'all':!![]}];}return db[_0x03c4('0x48')]['findAll'](_0x4cd41b);})['then'](function(_0x4a1005){_0x57290e[_0x03c4('0x49')]=_0x4a1005;return _0x57290e;})[_0x03c4('0x1a')](respondWithFilteredResult(_0x303280,_0x4cd41b))['catch'](handleError(_0x303280,null));};exports[_0x03c4('0x4a')]=function(_0x535982,_0x81b694){var _0x4e075e={'raw':![],'where':{'id':_0x535982[_0x03c4('0x4b')]['id']}},_0x510313={};_0x510313['model']=_[_0x03c4('0x39')](db[_0x03c4('0x48')][_0x03c4('0x4c')]);_0x510313['query']=_[_0x03c4('0x39')](_0x535982[_0x03c4('0x38')]);_0x510313[_0x03c4('0x3a')]=_[_0x03c4('0x3c')](_0x510313[_0x03c4('0x37')],_0x510313['query']);_0x4e075e[_0x03c4('0x3b')]=_[_0x03c4('0x3c')](_0x510313[_0x03c4('0x37')],qs[_0x03c4('0x3d')](_0x535982[_0x03c4('0x38')][_0x03c4('0x3d')]));_0x4e075e[_0x03c4('0x3b')]=_0x4e075e[_0x03c4('0x3b')][_0x03c4('0x3e')]?_0x4e075e['attributes']:_0x510313[_0x03c4('0x37')];if(_0x535982[_0x03c4('0x38')][_0x03c4('0x4d')]){_0x4e075e['include']=[{'all':!![]}];}_0x4e075e=_[_0x03c4('0x46')]({},_0x4e075e,_0x535982[_0x03c4('0x47')]);return db[_0x03c4('0x48')][_0x03c4('0x4e')](_0x4e075e)[_0x03c4('0x1a')](handleEntityNotFound(_0x81b694,null))[_0x03c4('0x1a')](respondWithResult(_0x81b694,null))[_0x03c4('0x25')](handleError(_0x81b694,null));};exports[_0x03c4('0x30')]=function(_0x4a54c2,_0x39ae1f){if(_0x4a54c2[_0x03c4('0x4f')]['id']){delete _0x4a54c2[_0x03c4('0x4f')]['id'];}return db[_0x03c4('0x48')]['find']({'where':{'id':_0x4a54c2[_0x03c4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39ae1f,null))[_0x03c4('0x1a')](saveUpdates(_0x4a54c2[_0x03c4('0x4f')],null))[_0x03c4('0x1a')](respondWithResult(_0x39ae1f,null))[_0x03c4('0x25')](handleError(_0x39ae1f,null));};exports[_0x03c4('0x50')]=function(_0x17ec91,_0x51f07d,_0x4aa536){if(_0x17ec91[_0x03c4('0x51')]&&_0x17ec91[_0x03c4('0x51')][_0x03c4('0x52')]){_0x17ec91[_0x03c4('0x4f')]['logo']=_0x17ec91[_0x03c4('0x51')]['filename'];}return db[_0x03c4('0x48')][_0x03c4('0x4e')]({'where':{'id':_0x17ec91[_0x03c4('0x4b')]['id']}})[_0x03c4('0x1a')](handleEntityNotFound(_0x51f07d,null))['then'](saveUpdates(_0x17ec91[_0x03c4('0x4f')],null))['then'](respondWithResult(_0x51f07d,null))[_0x03c4('0x25')](handleError(_0x51f07d,null));};exports[_0x03c4('0x53')]=function(_0x54f79c,_0x210450,_0x5468c8){if(_0x54f79c['file']&&_0x54f79c[_0x03c4('0x51')]['filename']){_0x54f79c[_0x03c4('0x4f')][_0x03c4('0x54')]=_0x54f79c[_0x03c4('0x51')]['filename'];}return db[_0x03c4('0x48')]['find']({'where':{'id':_0x54f79c[_0x03c4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x210450,null))[_0x03c4('0x1a')](saveUpdates(_0x54f79c[_0x03c4('0x4f')],null))[_0x03c4('0x1a')](respondWithResult(_0x210450,null))[_0x03c4('0x25')](handleError(_0x210450,null));};var utilLicense=require(_0x03c4('0x16'));exports[_0x03c4('0x55')]=function(_0x3087d9,_0x5790ce,_0x514c3c){var _0x1d1740='server/files/images/logos';var _0x512fc4={'custom':![]};return utilLicense[_0x03c4('0x56')]()[_0x03c4('0x1a')](function(_0x1a89eb){if(_0x1a89eb){_0x512fc4=_0x1a89eb;}return db[_0x03c4('0x48')][_0x03c4('0x4e')]({'where':{'id':_0x3087d9[_0x03c4('0x4b')]['id']},'attributes':[_0x03c4('0x57'),_0x03c4('0x54'),_0x03c4('0x58'),_0x03c4('0x59'),_0x03c4('0x5a'),_0x03c4('0x5b'),_0x03c4('0x5c'),_0x03c4('0x5d')],'raw':!![]});})[_0x03c4('0x1a')](handleEntityNotFound(_0x5790ce,null))['then'](function(_0x498afd){if(_0x498afd){var _0x22a4e8=_0x498afd[_0x03c4('0x57')]&&fs[_0x03c4('0x5e')](path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x1d1740,_['toLower'](_0x498afd[_0x03c4('0x57')])))?path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x1d1740,_[_0x03c4('0x61')](_0x498afd['logo'])):path['join'](config[_0x03c4('0x60')],_0x1d1740,_['toLower'](_0x03c4('0x62')));var _0x33a2dc=_0x03c4('0x63')+_[_0x03c4('0x64')](_0x03c4('0x57'));if(_0x498afd[_0x33a2dc]||!_0x512fc4[_0x03c4('0x65')]){_0x22a4e8=path['join'](config[_0x03c4('0x60')],_0x1d1740,_[_0x03c4('0x61')]('default_logo.svg'));}if(!fs['existsSync'](_0x22a4e8)){throw new db[(_0x03c4('0x66'))][(_0x03c4('0x67'))](_[_0x03c4('0x64')](_0x03c4('0x57'))+_0x03c4('0x68'));}return _0x5790ce['download'](_0x22a4e8);}})[_0x03c4('0x25')](handleError(_0x5790ce,null));};var utilLicense=require(_0x03c4('0x16'));exports[_0x03c4('0x69')]=function(_0x4bf4b1,_0x38cd24,_0x2c87f1){var _0x288a3d=_0x03c4('0x6a');var _0x41ed24={'custom':![]};return utilLicense[_0x03c4('0x56')]()[_0x03c4('0x1a')](function(_0x485edb){if(_0x485edb){_0x41ed24=_0x485edb;}return db[_0x03c4('0x48')][_0x03c4('0x4e')]({'where':{'id':_0x4bf4b1['params']['id']},'attributes':[_0x03c4('0x57'),_0x03c4('0x54'),_0x03c4('0x58'),_0x03c4('0x59'),_0x03c4('0x5a'),_0x03c4('0x5b'),_0x03c4('0x5c'),_0x03c4('0x5d')],'raw':!![]});})[_0x03c4('0x1a')](handleEntityNotFound(_0x38cd24,null))[_0x03c4('0x1a')](function(_0x24d5e2){if(_0x24d5e2){var _0xa85d04=_0x24d5e2[_0x03c4('0x54')]&&fs['existsSync'](path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x288a3d,_[_0x03c4('0x61')](_0x24d5e2['loginLogo'])))?path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x288a3d,_['toLower'](_0x24d5e2['loginLogo'])):path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x288a3d,_['toLower'](_0x03c4('0x6b')));var _0x3c5f19=_0x03c4('0x63')+_[_0x03c4('0x64')](_0x03c4('0x54'));if(_0x24d5e2[_0x3c5f19]||!_0x41ed24[_0x03c4('0x65')]){_0xa85d04=path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x288a3d,_[_0x03c4('0x61')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0xa85d04)){throw new db['Sequelize'][(_0x03c4('0x67'))](_[_0x03c4('0x64')](_0x03c4('0x54'))+_0x03c4('0x68'));}return _0x38cd24[_0x03c4('0x6c')](_0xa85d04);}})[_0x03c4('0x25')](handleError(_0x38cd24,null));};exports[_0x03c4('0x6d')]=function(_0xb7262c,_0x1a3d38){return db['Setting']['find']({'where':{'id':_0xb7262c[_0x03c4('0x4b')]['id']},'attributes':[_0x03c4('0x6e')]})[_0x03c4('0x1a')](respondWithResult(_0x1a3d38,null))['catch'](handleError(_0x1a3d38,null));};exports['addPreferred']=function(_0x4451f2,_0x4a5532,_0x31639a){if(_0x4451f2[_0x03c4('0x51')]&&_0x4451f2[_0x03c4('0x51')][_0x03c4('0x52')]){_0x4451f2[_0x03c4('0x4f')][_0x03c4('0x58')]=_0x4451f2['file'][_0x03c4('0x52')];}return db[_0x03c4('0x48')]['find']({'where':{'id':_0x4451f2['params']['id']}})[_0x03c4('0x1a')](handleEntityNotFound(_0x4a5532,null))[_0x03c4('0x1a')](saveUpdates(_0x4451f2[_0x03c4('0x4f')],null))[_0x03c4('0x1a')](respondWithResult(_0x4a5532,null))['catch'](handleError(_0x4a5532,null));};var utilLicense=require('../../config/license/util');exports[_0x03c4('0x6f')]=function(_0x120f07,_0x292f09,_0x6d92cc){var _0x193c38=_0x03c4('0x6a');var _0x18c7a0={'custom':![]};return utilLicense['getLicense']()[_0x03c4('0x1a')](function(_0x3ebb8d){if(_0x3ebb8d){_0x18c7a0=_0x3ebb8d;}return db[_0x03c4('0x48')][_0x03c4('0x4e')]({'where':{'id':_0x120f07[_0x03c4('0x4b')]['id']},'attributes':[_0x03c4('0x57'),_0x03c4('0x54'),_0x03c4('0x58'),_0x03c4('0x59'),_0x03c4('0x5a'),_0x03c4('0x5b'),_0x03c4('0x5c'),_0x03c4('0x5d')],'raw':!![]});})[_0x03c4('0x1a')](handleEntityNotFound(_0x292f09,null))[_0x03c4('0x1a')](function(_0x1a057c){if(_0x1a057c){var _0x3c8410=_0x1a057c[_0x03c4('0x58')]&&fs[_0x03c4('0x5e')](path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x193c38,_[_0x03c4('0x61')](_0x1a057c[_0x03c4('0x58')])))?path['join'](config[_0x03c4('0x60')],_0x193c38,_[_0x03c4('0x61')](_0x1a057c[_0x03c4('0x58')])):path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x193c38,_[_0x03c4('0x61')]('default_preferred.png'));var _0x2189f8=_0x03c4('0x63')+_[_0x03c4('0x64')]('preferred');if(_0x1a057c[_0x2189f8]||!_0x18c7a0[_0x03c4('0x65')]||!_0x18c7a0['preferred']){_0x3c8410=path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x193c38,_[_0x03c4('0x61')](_0x03c4('0x70')));}if(!fs[_0x03c4('0x5e')](_0x3c8410)){throw new db['Sequelize'][(_0x03c4('0x67'))](_[_0x03c4('0x64')](_0x03c4('0x58'))+_0x03c4('0x68'));}return _0x292f09[_0x03c4('0x6c')](_0x3c8410);}})['catch'](handleError(_0x292f09,null));};exports[_0x03c4('0x71')]=function(_0x4a43e9,_0x28dc26,_0x38b182){if(_0x4a43e9['file']&&_0x4a43e9[_0x03c4('0x51')][_0x03c4('0x52')]){_0x4a43e9[_0x03c4('0x4f')][_0x03c4('0x59')]=_0x4a43e9[_0x03c4('0x51')][_0x03c4('0x52')];}return db[_0x03c4('0x48')][_0x03c4('0x4e')]({'where':{'id':_0x4a43e9[_0x03c4('0x4b')]['id']}})[_0x03c4('0x1a')](handleEntityNotFound(_0x28dc26,null))[_0x03c4('0x1a')](saveUpdates(_0x4a43e9['body'],null))[_0x03c4('0x1a')](respondWithResult(_0x28dc26,null))[_0x03c4('0x25')](handleError(_0x28dc26,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x4eb71b,_0x28b4fb,_0x2be099){var _0x2e2287=_0x03c4('0x6a');var _0x3c3ba3={'custom':![]};return utilLicense[_0x03c4('0x56')]()[_0x03c4('0x1a')](function(_0x5b77d3){if(_0x5b77d3){_0x3c3ba3=_0x5b77d3;}return db[_0x03c4('0x48')]['find']({'where':{'id':_0x4eb71b[_0x03c4('0x4b')]['id']},'attributes':['logo',_0x03c4('0x54'),'preferred','favicon',_0x03c4('0x5a'),_0x03c4('0x5b'),_0x03c4('0x5c'),_0x03c4('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x28b4fb,null))[_0x03c4('0x1a')](function(_0x42dad8){if(_0x42dad8){var _0x34687c=_0x42dad8['favicon']&&fs[_0x03c4('0x5e')](path[_0x03c4('0x5f')](config['root'],_0x2e2287,_[_0x03c4('0x61')](_0x42dad8['favicon'])))?path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x2e2287,_[_0x03c4('0x61')](_0x42dad8[_0x03c4('0x59')])):path[_0x03c4('0x5f')](config[_0x03c4('0x60')],_0x2e2287,_[_0x03c4('0x61')](_0x03c4('0x72')));var _0x36ab7d=_0x03c4('0x63')+_[_0x03c4('0x64')](_0x03c4('0x59'));if(_0x42dad8[_0x36ab7d]||!_0x3c3ba3[_0x03c4('0x65')]){_0x34687c=path[_0x03c4('0x5f')](config['root'],_0x2e2287,_['toLower'](_0x03c4('0x72')));}if(!fs[_0x03c4('0x5e')](_0x34687c)){throw new db[(_0x03c4('0x66'))]['ValidationError'](_['upperFirst'](_0x03c4('0x59'))+_0x03c4('0x68'));}return _0x28b4fb['download'](_0x34687c);}})[_0x03c4('0x25')](handleError(_0x28b4fb,null));};exports[_0x03c4('0x73')]=function(_0x3aad96,_0x585583){var _0xd5709e={'offset':moment()[_0x03c4('0x74')]()};_0xd5709e[_0x03c4('0x75')]=moment()[_0x03c4('0x74')](_0xd5709e['offset'])[_0x03c4('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x585583['status'](0xc8)[_0x03c4('0x33')](_0xd5709e);};
\ No newline at end of file
+var _0x865d=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Setting','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join','default_logo.svg','default','custom','Sequelize','upperFirst','download','getLogoLogin','getLicense','default_loginLogo.svg','ValidationError','\x20not\x20found','addPreferred','getPreferred','defaultFavicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x53cd39,_0x351f5e){var _0xb41d5f=function(_0x2cdbf2){while(--_0x2cdbf2){_0x53cd39['push'](_0x53cd39['shift']());}};_0xb41d5f(++_0x351f5e);}(_0x865d,0x1d9));var _0xd865=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x865d[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xd865('0x0'));var rimraf=require(_0xd865('0x1'));var zipdir=require(_0xd865('0x2'));var jsonpatch=require(_0xd865('0x3'));var rp=require(_0xd865('0x4'));var moment=require(_0xd865('0x5'));var BPromise=require(_0xd865('0x6'));var Mustache=require(_0xd865('0x7'));var util=require('util');var path=require(_0xd865('0x8'));var sox=require(_0xd865('0x9'));var csv=require(_0xd865('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd865('0xb'));var crypto=require(_0xd865('0xc'));var jsforce=require(_0xd865('0xd'));var deskjs=require(_0xd865('0xe'));var toCsv=require(_0xd865('0xa'));var querystring=require('querystring');var Papa=require(_0xd865('0xf'));var Redis=require(_0xd865('0x10'));var authService=require(_0xd865('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd865('0x12'));var hardwareService=require(_0xd865('0x13'));var logger=require(_0xd865('0x14'))(_0xd865('0x15'));var utils=require(_0xd865('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd865('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd865('0x18'));var client=jayson['client'][_0xd865('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x234e6e,_0x547b49,_0x14d301,_0x41dd56){return new BPromise(function(_0x1bface,_0x29ea17){var _0xf8e22b=_0x41dd56||client;return _0xf8e22b[_0xd865('0x1a')](_0x234e6e,_0x14d301)['then'](function(_0x272273){logger[_0xd865('0x1b')](_0xd865('0x1c'),_0x547b49,_0xd865('0x1d'));logger[_0xd865('0x1e')](_0xd865('0x1f'),_0x547b49,_0xd865('0x1d'),JSON[_0xd865('0x20')](_0x272273));if(_0x272273[_0xd865('0x21')]){if(_0x272273[_0xd865('0x21')][_0xd865('0x22')]===0x1f4){logger[_0xd865('0x21')](_0xd865('0x1c'),_0x547b49,_0x272273[_0xd865('0x21')][_0xd865('0x23')]);return _0x29ea17(_0x272273['error']['message']);}logger[_0xd865('0x21')](_0xd865('0x1c'),_0x547b49,_0x272273[_0xd865('0x21')]['message']);return _0x1bface(_0x272273['error'][_0xd865('0x23')]);}else{logger[_0xd865('0x1b')](_0xd865('0x1c'),_0x547b49,_0xd865('0x1d'));_0x1bface(_0x272273[_0xd865('0x24')]['message']);}})[_0xd865('0x25')](function(_0x5ede23){logger[_0xd865('0x21')]('Setting,\x20%s,\x20%s',_0x547b49,_0x5ede23);_0x29ea17(_0x5ede23);});});}function respondWithStatusCode(_0x360ffc,_0x34b99e){_0x34b99e=_0x34b99e||0xcc;return function(_0x1b1f49){if(_0x1b1f49){return _0x360ffc[_0xd865('0x26')](_0x34b99e);}return _0x360ffc[_0xd865('0x27')](_0x34b99e)[_0xd865('0x28')]();};}function respondWithResult(_0x563509,_0x219b36){_0x219b36=_0x219b36||0xc8;return function(_0x38c300){if(_0x38c300){return _0x563509[_0xd865('0x27')](_0x219b36)['json'](_0x38c300);}};}function respondWithFilteredResult(_0x330f7f,_0xa909b5){return function(_0xff4452){if(_0xff4452){var _0x5ab036=typeof _0xa909b5[_0xd865('0x29')]==='undefined'&&typeof _0xa909b5['limit']==='undefined';var _0x2e9ec5=_0xff4452[_0xd865('0x2a')];var _0x4e5711=_0x5ab036?0x0:_0xa909b5[_0xd865('0x29')];var _0x5a90e2=_0x5ab036?_0xff4452['count']:_0xa909b5[_0xd865('0x29')]+_0xa909b5['limit'];var _0x4a04b3;if(_0x5a90e2>=_0x2e9ec5){_0x5a90e2=_0x2e9ec5;_0x4a04b3=0xc8;}else{_0x4a04b3=0xce;}_0x330f7f[_0xd865('0x27')](_0x4a04b3);return _0x330f7f[_0xd865('0x2b')](_0xd865('0x2c'),_0x4e5711+'-'+_0x5a90e2+'/'+_0x2e9ec5)['json'](_0xff4452);}return null;};}function patchUpdates(_0x31d3a0){return function(_0x463da5){try{jsonpatch[_0xd865('0x2d')](_0x463da5,_0x31d3a0,!![]);}catch(_0x257d60){return BPromise[_0xd865('0x2e')](_0x257d60);}return _0x463da5[_0xd865('0x2f')]();};}function saveUpdates(_0x4bcead,_0x530ee0){return function(_0x3ce7e0){if(_0x3ce7e0){return _0x3ce7e0[_0xd865('0x30')](_0x4bcead)[_0xd865('0x31')](function(_0x7730ae){return _0x7730ae;});}return null;};}function removeEntity(_0x3f5d52,_0x304868){return function(_0x17c1eb){if(_0x17c1eb){return _0x17c1eb[_0xd865('0x32')]()['then'](function(){_0x3f5d52[_0xd865('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2becdc,_0x3b4e40){return function(_0x1b8ce3){if(!_0x1b8ce3){_0x2becdc[_0xd865('0x26')](0x194);}return _0x1b8ce3;};}function handleError(_0x2070b7,_0x36b0a5){_0x36b0a5=_0x36b0a5||0x1f4;return function(_0x2ae144){logger['error'](_0x2ae144[_0xd865('0x33')]);if(_0x2ae144[_0xd865('0x34')]){delete _0x2ae144[_0xd865('0x34')];}_0x2070b7['status'](_0x36b0a5)[_0xd865('0x35')](_0x2ae144);};}exports[_0xd865('0x36')]=function(_0x4cd5b6,_0xb05a29){var _0x5a2763={},_0x484600={},_0x5ef260={'count':0x0,'rows':[]};var _0x2000e5=_[_0xd865('0x37')](db[_0xd865('0x38')]['rawAttributes'],function(_0x442268){return{'name':_0x442268[_0xd865('0x39')],'type':_0x442268[_0xd865('0x3a')]['key']};});_0x484600[_0xd865('0x3b')]=_[_0xd865('0x37')](_0x2000e5,'name');_0x484600[_0xd865('0x3c')]=_['keys'](_0x4cd5b6[_0xd865('0x3c')]);_0x484600[_0xd865('0x3d')]=_[_0xd865('0x3e')](_0x484600[_0xd865('0x3b')],_0x484600[_0xd865('0x3c')]);_0x5a2763[_0xd865('0x3f')]=_['intersection'](_0x484600[_0xd865('0x3b')],qs[_0xd865('0x40')](_0x4cd5b6[_0xd865('0x3c')]['fields']));_0x5a2763[_0xd865('0x3f')]=_0x5a2763['attributes'][_0xd865('0x41')]?_0x5a2763['attributes']:_0x484600[_0xd865('0x3b')];if(!_0x4cd5b6['query']['hasOwnProperty'](_0xd865('0x42'))){_0x5a2763[_0xd865('0x43')]=qs[_0xd865('0x43')](_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x43')]);_0x5a2763[_0xd865('0x29')]=qs[_0xd865('0x29')](_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x29')]);}_0x5a2763[_0xd865('0x44')]=qs[_0xd865('0x45')](_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x45')]);_0x5a2763[_0xd865('0x46')]=qs[_0xd865('0x3d')](_['pick'](_0x4cd5b6[_0xd865('0x3c')],_0x484600[_0xd865('0x3d')]),_0x2000e5);if(_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x47')]){_0x5a2763[_0xd865('0x46')]=_[_0xd865('0x48')](_0x5a2763[_0xd865('0x46')],{'$or':_['map'](_0x2000e5,function(_0x57aebc){if(_0x57aebc[_0xd865('0x3a')]!==_0xd865('0x49')){var _0x2215d7={};_0x2215d7[_0x57aebc[_0xd865('0x34')]]={'$like':'%'+_0x4cd5b6[_0xd865('0x3c')]['filter']+'%'};return _0x2215d7;}})});}_0x5a2763=_['merge']({},_0x5a2763,_0x4cd5b6['options']);var _0x29bb5c={'where':_0x5a2763[_0xd865('0x46')]};return db[_0xd865('0x38')][_0xd865('0x2a')](_0x29bb5c)[_0xd865('0x31')](function(_0x29fb1a){_0x5ef260[_0xd865('0x2a')]=_0x29fb1a;if(_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x4a')]){_0x5a2763[_0xd865('0x4b')]=[{'all':!![]}];}return db[_0xd865('0x38')][_0xd865('0x4c')](_0x5a2763);})['then'](function(_0x9a387e){_0x5ef260[_0xd865('0x4d')]=_0x9a387e;return _0x5ef260;})['then'](respondWithFilteredResult(_0xb05a29,_0x5a2763))[_0xd865('0x25')](handleError(_0xb05a29,null));};exports[_0xd865('0x4e')]=function(_0x41668b,_0xde9fc){var _0x37efbd={'raw':![],'where':{'id':_0x41668b[_0xd865('0x4f')]['id']}},_0x4a2b9b={};_0x4a2b9b[_0xd865('0x3b')]=_[_0xd865('0x50')](db[_0xd865('0x38')][_0xd865('0x51')]);_0x4a2b9b[_0xd865('0x3c')]=_[_0xd865('0x50')](_0x41668b[_0xd865('0x3c')]);_0x4a2b9b[_0xd865('0x3d')]=_[_0xd865('0x3e')](_0x4a2b9b[_0xd865('0x3b')],_0x4a2b9b[_0xd865('0x3c')]);_0x37efbd[_0xd865('0x3f')]=_[_0xd865('0x3e')](_0x4a2b9b[_0xd865('0x3b')],qs[_0xd865('0x40')](_0x41668b[_0xd865('0x3c')][_0xd865('0x40')]));_0x37efbd[_0xd865('0x3f')]=_0x37efbd[_0xd865('0x3f')][_0xd865('0x41')]?_0x37efbd[_0xd865('0x3f')]:_0x4a2b9b[_0xd865('0x3b')];if(_0x41668b[_0xd865('0x3c')][_0xd865('0x4a')]){_0x37efbd[_0xd865('0x4b')]=[{'all':!![]}];}_0x37efbd=_[_0xd865('0x48')]({},_0x37efbd,_0x41668b[_0xd865('0x52')]);return db['Setting'][_0xd865('0x53')](_0x37efbd)[_0xd865('0x31')](handleEntityNotFound(_0xde9fc,null))[_0xd865('0x31')](respondWithResult(_0xde9fc,null))['catch'](handleError(_0xde9fc,null));};exports['update']=function(_0x526e6a,_0x8452b0){if(_0x526e6a[_0xd865('0x54')]['id']){delete _0x526e6a['body']['id'];}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x526e6a[_0xd865('0x4f')]['id']}})['then'](handleEntityNotFound(_0x8452b0,null))[_0xd865('0x31')](saveUpdates(_0x526e6a[_0xd865('0x54')],null))['then'](respondWithResult(_0x8452b0,null))[_0xd865('0x25')](handleError(_0x8452b0,null));};exports['addLogo']=function(_0x5a0a03,_0x3a3529,_0x4cabe6){if(_0x5a0a03['file']&&_0x5a0a03[_0xd865('0x55')][_0xd865('0x56')]){_0x5a0a03[_0xd865('0x54')][_0xd865('0x57')]=_0x5a0a03[_0xd865('0x55')][_0xd865('0x56')];}return db['Setting'][_0xd865('0x53')]({'where':{'id':_0x5a0a03['params']['id']}})[_0xd865('0x31')](handleEntityNotFound(_0x3a3529,null))[_0xd865('0x31')](saveUpdates(_0x5a0a03[_0xd865('0x54')],null))['then'](respondWithResult(_0x3a3529,null))[_0xd865('0x25')](handleError(_0x3a3529,null));};exports[_0xd865('0x58')]=function(_0x5111fa,_0x16276b,_0x472f22){if(_0x5111fa[_0xd865('0x55')]&&_0x5111fa[_0xd865('0x55')][_0xd865('0x56')]){_0x5111fa['body'][_0xd865('0x59')]=_0x5111fa['file'][_0xd865('0x56')];}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x5111fa[_0xd865('0x4f')]['id']}})[_0xd865('0x31')](handleEntityNotFound(_0x16276b,null))[_0xd865('0x31')](saveUpdates(_0x5111fa['body'],null))[_0xd865('0x31')](respondWithResult(_0x16276b,null))[_0xd865('0x25')](handleError(_0x16276b,null));};var utilLicense=require('../../config/license/util');exports[_0xd865('0x5a')]=function(_0x3a3dbd,_0x562226,_0x449ac6){var _0x222411=_0xd865('0x5b');var _0xcd3c7c={'custom':![]};return utilLicense['getLicense']()[_0xd865('0x31')](function(_0x266642){if(_0x266642){_0xcd3c7c=_0x266642;}return db[_0xd865('0x38')]['find']({'where':{'id':_0x3a3dbd[_0xd865('0x4f')]['id']},'attributes':[_0xd865('0x57'),'loginLogo',_0xd865('0x5c'),_0xd865('0x5d'),_0xd865('0x5e'),_0xd865('0x5f'),_0xd865('0x60'),'defaultFavicon'],'raw':!![]});})[_0xd865('0x31')](handleEntityNotFound(_0x562226,null))['then'](function(_0x9e1cd0){if(_0x9e1cd0){var _0x9263e5=_0x9e1cd0[_0xd865('0x57')]&&fs[_0xd865('0x61')](path['join'](config[_0xd865('0x62')],_0x222411,_[_0xd865('0x63')](_0x9e1cd0[_0xd865('0x57')])))?path['join'](config[_0xd865('0x62')],_0x222411,_[_0xd865('0x63')](_0x9e1cd0[_0xd865('0x57')])):path[_0xd865('0x64')](config[_0xd865('0x62')],_0x222411,_[_0xd865('0x63')](_0xd865('0x65')));var _0x449fa7=_0xd865('0x66')+_['upperFirst'](_0xd865('0x57'));if(_0x9e1cd0[_0x449fa7]||!_0xcd3c7c[_0xd865('0x67')]){_0x9263e5=path['join'](config[_0xd865('0x62')],_0x222411,_[_0xd865('0x63')](_0xd865('0x65')));}if(!fs[_0xd865('0x61')](_0x9263e5)){throw new db[(_0xd865('0x68'))]['ValidationError'](_[_0xd865('0x69')](_0xd865('0x57'))+'\x20not\x20found');}return _0x562226[_0xd865('0x6a')](_0x9263e5);}})[_0xd865('0x25')](handleError(_0x562226,null));};var utilLicense=require(_0xd865('0x17'));exports[_0xd865('0x6b')]=function(_0x406da2,_0x5d6575,_0x281254){var _0x529a28='server/files/images/logos';var _0x45392b={'custom':![]};return utilLicense[_0xd865('0x6c')]()['then'](function(_0x259fbf){if(_0x259fbf){_0x45392b=_0x259fbf;}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x406da2['params']['id']},'attributes':[_0xd865('0x57'),_0xd865('0x59'),_0xd865('0x5c'),_0xd865('0x5d'),_0xd865('0x5e'),_0xd865('0x5f'),_0xd865('0x60'),'defaultFavicon'],'raw':!![]});})[_0xd865('0x31')](handleEntityNotFound(_0x5d6575,null))[_0xd865('0x31')](function(_0x2597e2){if(_0x2597e2){var _0x4ee66c=_0x2597e2['loginLogo']&&fs[_0xd865('0x61')](path[_0xd865('0x64')](config[_0xd865('0x62')],_0x529a28,_['toLower'](_0x2597e2[_0xd865('0x59')])))?path[_0xd865('0x64')](config['root'],_0x529a28,_['toLower'](_0x2597e2[_0xd865('0x59')])):path['join'](config[_0xd865('0x62')],_0x529a28,_[_0xd865('0x63')](_0xd865('0x6d')));var _0x5b1659=_0xd865('0x66')+_['upperFirst'](_0xd865('0x59'));if(_0x2597e2[_0x5b1659]||!_0x45392b[_0xd865('0x67')]){_0x4ee66c=path[_0xd865('0x64')](config[_0xd865('0x62')],_0x529a28,_[_0xd865('0x63')](_0xd865('0x6d')));}if(!fs[_0xd865('0x61')](_0x4ee66c)){throw new db[(_0xd865('0x68'))][(_0xd865('0x6e'))](_[_0xd865('0x69')](_0xd865('0x59'))+_0xd865('0x6f'));}return _0x5d6575[_0xd865('0x6a')](_0x4ee66c);}})[_0xd865('0x25')](handleError(_0x5d6575,null));};exports['gdpr']=function(_0x281f04,_0x5c3be4){return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x281f04[_0xd865('0x4f')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x5c3be4,null))[_0xd865('0x25')](handleError(_0x5c3be4,null));};exports[_0xd865('0x70')]=function(_0x286ff5,_0x3226a8,_0x349703){if(_0x286ff5[_0xd865('0x55')]&&_0x286ff5[_0xd865('0x55')][_0xd865('0x56')]){_0x286ff5['body'][_0xd865('0x5c')]=_0x286ff5[_0xd865('0x55')]['filename'];}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x286ff5[_0xd865('0x4f')]['id']}})[_0xd865('0x31')](handleEntityNotFound(_0x3226a8,null))['then'](saveUpdates(_0x286ff5[_0xd865('0x54')],null))[_0xd865('0x31')](respondWithResult(_0x3226a8,null))[_0xd865('0x25')](handleError(_0x3226a8,null));};var utilLicense=require(_0xd865('0x17'));exports[_0xd865('0x71')]=function(_0x34241d,_0x5b775a,_0x28e6fd){var _0x4e11d6=_0xd865('0x5b');var _0x4a1a94={'custom':![]};return utilLicense[_0xd865('0x6c')]()[_0xd865('0x31')](function(_0x22dc34){if(_0x22dc34){_0x4a1a94=_0x22dc34;}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x34241d[_0xd865('0x4f')]['id']},'attributes':[_0xd865('0x57'),'loginLogo',_0xd865('0x5c'),_0xd865('0x5d'),_0xd865('0x5e'),'defaultLoginLogo',_0xd865('0x60'),_0xd865('0x72')],'raw':!![]});})[_0xd865('0x31')](handleEntityNotFound(_0x5b775a,null))[_0xd865('0x31')](function(_0x6c896){if(_0x6c896){var _0x17f619=_0x6c896[_0xd865('0x5c')]&&fs['existsSync'](path['join'](config[_0xd865('0x62')],_0x4e11d6,_[_0xd865('0x63')](_0x6c896['preferred'])))?path[_0xd865('0x64')](config[_0xd865('0x62')],_0x4e11d6,_[_0xd865('0x63')](_0x6c896['preferred'])):path[_0xd865('0x64')](config[_0xd865('0x62')],_0x4e11d6,_['toLower'](_0xd865('0x73')));var _0x3c29fa=_0xd865('0x66')+_[_0xd865('0x69')](_0xd865('0x5c'));if(_0x6c896[_0x3c29fa]||!_0x4a1a94[_0xd865('0x67')]||!_0x4a1a94[_0xd865('0x5c')]){_0x17f619=path[_0xd865('0x64')](config[_0xd865('0x62')],_0x4e11d6,_[_0xd865('0x63')](_0xd865('0x73')));}if(!fs[_0xd865('0x61')](_0x17f619)){throw new db[(_0xd865('0x68'))][(_0xd865('0x6e'))](_[_0xd865('0x69')]('preferred')+_0xd865('0x6f'));}return _0x5b775a['download'](_0x17f619);}})[_0xd865('0x25')](handleError(_0x5b775a,null));};exports[_0xd865('0x74')]=function(_0xcf6a92,_0x133901,_0x1b9f96){if(_0xcf6a92[_0xd865('0x55')]&&_0xcf6a92[_0xd865('0x55')][_0xd865('0x56')]){_0xcf6a92[_0xd865('0x54')][_0xd865('0x5d')]=_0xcf6a92[_0xd865('0x55')][_0xd865('0x56')];}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0xcf6a92[_0xd865('0x4f')]['id']}})[_0xd865('0x31')](handleEntityNotFound(_0x133901,null))[_0xd865('0x31')](saveUpdates(_0xcf6a92[_0xd865('0x54')],null))[_0xd865('0x31')](respondWithResult(_0x133901,null))[_0xd865('0x25')](handleError(_0x133901,null));};var utilLicense=require(_0xd865('0x17'));exports[_0xd865('0x75')]=function(_0x6599c7,_0x1a1232,_0x520e77){var _0x20cb2e='server/files/images/logos';var _0x705aba={'custom':![]};return utilLicense[_0xd865('0x6c')]()[_0xd865('0x31')](function(_0x2d6a18){if(_0x2d6a18){_0x705aba=_0x2d6a18;}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x6599c7[_0xd865('0x4f')]['id']},'attributes':['logo','loginLogo',_0xd865('0x5c'),_0xd865('0x5d'),_0xd865('0x5e'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xd865('0x31')](handleEntityNotFound(_0x1a1232,null))[_0xd865('0x31')](function(_0x12071a){if(_0x12071a){var _0x394255=_0x12071a[_0xd865('0x5d')]&&fs[_0xd865('0x61')](path[_0xd865('0x64')](config[_0xd865('0x62')],_0x20cb2e,_[_0xd865('0x63')](_0x12071a[_0xd865('0x5d')])))?path['join'](config['root'],_0x20cb2e,_[_0xd865('0x63')](_0x12071a[_0xd865('0x5d')])):path[_0xd865('0x64')](config[_0xd865('0x62')],_0x20cb2e,_[_0xd865('0x63')](_0xd865('0x76')));var _0x2eed5b=_0xd865('0x66')+_['upperFirst'](_0xd865('0x5d'));if(_0x12071a[_0x2eed5b]||!_0x705aba[_0xd865('0x67')]){_0x394255=path[_0xd865('0x64')](config[_0xd865('0x62')],_0x20cb2e,_[_0xd865('0x63')](_0xd865('0x76')));}if(!fs[_0xd865('0x61')](_0x394255)){throw new db[(_0xd865('0x68'))][(_0xd865('0x6e'))](_[_0xd865('0x69')](_0xd865('0x5d'))+_0xd865('0x6f'));}return _0x1a1232[_0xd865('0x6a')](_0x394255);}})[_0xd865('0x25')](handleError(_0x1a1232,null));};exports['getDate']=function(_0x1977f0,_0x3f8da2){var _0x40841e={'offset':moment()[_0xd865('0x77')]()};_0x40841e[_0xd865('0x78')]=moment()['utcOffset'](_0x40841e['offset'])[_0xd865('0x79')](_0xd865('0x7a'));return _0x3f8da2['status'](0xc8)['send'](_0x40841e);};
\ No newline at end of file
index 9d8612a..aabd509 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x5232ad,_0x527d3d){var _0x31955b=function(_0x51ead8){while(--_0x51ead8){_0x5232ad['push'](_0x5232ad['shift']());}};_0x31955b(++_0x527d3d);}(_0xedd9,0xfc));var _0x9edd=function(_0x8fa10,_0x10d722){_0x8fa10=_0x8fa10-0x0;var _0x37cc9f=_0xedd9[_0x8fa10];return _0x37cc9f;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0x55ca,0x126));var _0xa55c=function(_0x246cbe,_0x19305c){_0x246cbe=_0x246cbe-0x0;var _0x855b0=_0x55ca[_0x246cbe];return _0x855b0;};'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
index 7105aa6..0e73e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1741=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','info','result','ShowSetting','Setting','options','map','include','model','lodash'];(function(_0x54a472,_0x3bcd23){var _0xb1ff95=function(_0x45e04f){while(--_0x45e04f){_0x54a472['push'](_0x54a472['shift']());}};_0xb1ff95(++_0x3bcd23);}(_0x1741,0x67));var _0x1174=function(_0x1111ac,_0x27f3d9){_0x1111ac=_0x1111ac-0x0;var _0x2b30c6=_0x1741[_0x1111ac];return _0x2b30c6;};'use strict';var _=require(_0x1174('0x0'));var util=require(_0x1174('0x1'));var moment=require(_0x1174('0x2'));var BPromise=require(_0x1174('0x3'));var rs=require(_0x1174('0x4'));var fs=require('fs');var Redis=require(_0x1174('0x5'));var db=require(_0x1174('0x6'))['db'];var utils=require(_0x1174('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1174('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26fd95,_0x36bb29,_0xa1e48e){return new BPromise(function(_0x5c4894,_0x4fa098){return client['request'](_0x26fd95,_0xa1e48e)[_0x1174('0x9')](function(_0x343c27){logger['info']('Setting,\x20%s,\x20%s',_0x36bb29,_0x1174('0xa'));logger[_0x1174('0xb')](_0x1174('0xc'),_0x36bb29,_0x1174('0xa'),JSON[_0x1174('0xd')](_0x343c27));if(_0x343c27[_0x1174('0xe')]){if(_0x343c27[_0x1174('0xe')][_0x1174('0xf')]===0x1f4){logger[_0x1174('0xe')](_0x1174('0x10'),_0x36bb29,_0x343c27[_0x1174('0xe')][_0x1174('0x11')]);return _0x4fa098(_0x343c27[_0x1174('0xe')]['message']);}logger[_0x1174('0xe')](_0x1174('0x10'),_0x36bb29,_0x343c27[_0x1174('0xe')]['message']);return _0x5c4894(_0x343c27['error'][_0x1174('0x11')]);}else{logger[_0x1174('0x12')](_0x1174('0x10'),_0x36bb29,_0x1174('0xa'));_0x5c4894(_0x343c27[_0x1174('0x13')]['message']);}})['catch'](function(_0x204b13){logger[_0x1174('0xe')](_0x1174('0x10'),_0x36bb29,_0x204b13);_0x4fa098(_0x204b13);});});}exports[_0x1174('0x14')]=function(_0x1a92a2){var _0x195032=this;return new Promise(function(_0x2f21d2,_0x429ee1){return db[_0x1174('0x15')]['find']({'raw':_0x1a92a2[_0x1174('0x16')]?_0x1a92a2[_0x1174('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1a92a2[_0x1174('0x16')]?_0x1a92a2[_0x1174('0x16')]['where']||null:null,'attributes':_0x1a92a2['options']?_0x1a92a2[_0x1174('0x16')]['attributes']||null:null,'include':_0x1a92a2[_0x1174('0x16')]?_0x1a92a2['options']['include']?_[_0x1174('0x17')](_0x1a92a2[_0x1174('0x16')][_0x1174('0x18')],function(_0x5b14c4){return{'model':db[_0x5b14c4[_0x1174('0x19')]],'as':_0x5b14c4['as'],'attributes':_0x5b14c4['attributes'],'include':_0x5b14c4['include']?_[_0x1174('0x17')](_0x5b14c4['include'],function(_0x6dd50f){return{'model':db[_0x6dd50f[_0x1174('0x19')]],'as':_0x6dd50f['as'],'attributes':_0x6dd50f['attributes'],'include':_0x6dd50f['include']?_['map'](_0x6dd50f['include'],function(_0x963430){return{'model':db[_0x963430['model']],'as':_0x963430['as'],'attributes':_0x963430['attributes']};}):[]};}):[]};}):[]:[]})[_0x1174('0x9')](function(_0x2c8f6d){logger['info']('ShowSetting',_0x1a92a2);logger[_0x1174('0xb')](_0x1174('0x14'),_0x1a92a2,JSON[_0x1174('0xd')](_0x2c8f6d));_0x2f21d2(_0x2c8f6d);})['catch'](function(_0x10f3ef){logger['error'](_0x1174('0x14'),_0x10f3ef[_0x1174('0x11')],_0x1a92a2);_0x429ee1(_0x195032[_0x1174('0xe')](0x1f4,_0x10f3ef[_0x1174('0x11')]));});});};
\ No newline at end of file
+var _0x0d3f=['raw','options','where','attributes','include','map','model','then','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','client','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','ShowSetting','Setting'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0d3f,0x79));var _0xf0d3=function(_0x16b992,_0x43d74c){_0x16b992=_0x16b992-0x0;var _0x385c78=_0x0d3f[_0x16b992];return _0x385c78;};'use strict';var _=require(_0xf0d3('0x0'));var util=require(_0xf0d3('0x1'));var moment=require(_0xf0d3('0x2'));var BPromise=require(_0xf0d3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0d3('0x5'))(_0xf0d3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf0d3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x269a2f,_0x2ce7a0,_0x44121a){return new BPromise(function(_0x3a0ef8,_0x3e2318){return client[_0xf0d3('0x8')](_0x269a2f,_0x44121a)['then'](function(_0x3b70d8){logger[_0xf0d3('0x9')]('Setting,\x20%s,\x20%s',_0x2ce7a0,_0xf0d3('0xa'));logger[_0xf0d3('0xb')](_0xf0d3('0xc'),_0x2ce7a0,_0xf0d3('0xa'),JSON[_0xf0d3('0xd')](_0x3b70d8));if(_0x3b70d8[_0xf0d3('0xe')]){if(_0x3b70d8['error']['code']===0x1f4){logger[_0xf0d3('0xe')](_0xf0d3('0xf'),_0x2ce7a0,_0x3b70d8[_0xf0d3('0xe')]['message']);return _0x3e2318(_0x3b70d8[_0xf0d3('0xe')][_0xf0d3('0x10')]);}logger['error'](_0xf0d3('0xf'),_0x2ce7a0,_0x3b70d8['error']['message']);return _0x3a0ef8(_0x3b70d8[_0xf0d3('0xe')]['message']);}else{logger[_0xf0d3('0x9')](_0xf0d3('0xf'),_0x2ce7a0,'request\x20sent');_0x3a0ef8(_0x3b70d8['result'][_0xf0d3('0x10')]);}})['catch'](function(_0x594247){logger['error'](_0xf0d3('0xf'),_0x2ce7a0,_0x594247);_0x3e2318(_0x594247);});});}exports[_0xf0d3('0x11')]=function(_0x3513ac){var _0x50e0c9=this;return new Promise(function(_0xcbf6c3,_0x1bcd2d){return db[_0xf0d3('0x12')]['find']({'raw':_0x3513ac['options']?_0x3513ac['options'][_0xf0d3('0x13')]===undefined?!![]:![]:!![],'where':_0x3513ac[_0xf0d3('0x14')]?_0x3513ac[_0xf0d3('0x14')][_0xf0d3('0x15')]||null:null,'attributes':_0x3513ac[_0xf0d3('0x14')]?_0x3513ac['options'][_0xf0d3('0x16')]||null:null,'include':_0x3513ac[_0xf0d3('0x14')]?_0x3513ac[_0xf0d3('0x14')][_0xf0d3('0x17')]?_[_0xf0d3('0x18')](_0x3513ac[_0xf0d3('0x14')][_0xf0d3('0x17')],function(_0x1cb629){return{'model':db[_0x1cb629[_0xf0d3('0x19')]],'as':_0x1cb629['as'],'attributes':_0x1cb629[_0xf0d3('0x16')],'include':_0x1cb629[_0xf0d3('0x17')]?_['map'](_0x1cb629[_0xf0d3('0x17')],function(_0x2ba3b1){return{'model':db[_0x2ba3b1[_0xf0d3('0x19')]],'as':_0x2ba3b1['as'],'attributes':_0x2ba3b1['attributes'],'include':_0x2ba3b1[_0xf0d3('0x17')]?_[_0xf0d3('0x18')](_0x2ba3b1[_0xf0d3('0x17')],function(_0x3242f6){return{'model':db[_0x3242f6['model']],'as':_0x3242f6['as'],'attributes':_0x3242f6[_0xf0d3('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf0d3('0x1a')](function(_0x1f6a95){logger[_0xf0d3('0x9')](_0xf0d3('0x11'),_0x3513ac);logger[_0xf0d3('0xb')](_0xf0d3('0x11'),_0x3513ac,JSON['stringify'](_0x1f6a95));_0xcbf6c3(_0x1f6a95);})[_0xf0d3('0x1b')](function(_0xfd72f8){logger[_0xf0d3('0xe')](_0xf0d3('0x11'),_0xfd72f8[_0xf0d3('0x10')],_0x3513ac);_0x1bcd2d(_0x50e0c9[_0xf0d3('0xe')](0x1f4,_0xfd72f8['message']));});});};
\ No newline at end of file
index c79362d..96ec318 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x2bdedb,_0x5e0a61){var _0x3ff5d5=function(_0x27ecb1){while(--_0x27ecb1){_0x2bdedb['push'](_0x2bdedb['shift']());}};_0x3ff5d5(++_0x5e0a61);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'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['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router;
\ No newline at end of file
+var _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x2992af,_0x1a9b57){var _0x141157=function(_0xace62f){while(--_0xace62f){_0x2992af['push'](_0x2992af['shift']());}};_0x141157(++_0x1a9b57);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x46c318,_0x3a5b3f){_0x46c318=_0x46c318-0x0;var _0x143050=_0x7fbe[_0x46c318];return _0x143050;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index d134446..1010351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f7a=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio','skebby','connectel','clicksend','clickatell','bandwidth','infobip','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1f7a,0xe9));var _0xa1f7=function(_0x45001a,_0x8768d7){_0x45001a=_0x45001a-0x0;var _0x56b35c=_0x1f7a[_0x45001a];return _0x56b35c;};'use strict';var Sequelize=require(_0xa1f7('0x0'));var rs=require(_0xa1f7('0x1'));module[_0xa1f7('0x2')]={'name':{'type':Sequelize[_0xa1f7('0x3')],'unique':_0xa1f7('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xa1f7('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa1f7('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa1f7('0x3')],'defaultValue':function(){return rs[_0xa1f7('0x5')]();}},'phone':{'type':Sequelize[_0xa1f7('0x3')]},'type':{'type':Sequelize['ENUM'](_0xa1f7('0x6'),_0xa1f7('0x7'),_0xa1f7('0x8'),_0xa1f7('0x9'),'plivo',_0xa1f7('0xa'),_0xa1f7('0xb'),'csc',_0xa1f7('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0xa1f7('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xa1f7('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xa1f7('0x3')]},'password':{'type':Sequelize[_0xa1f7('0x3')]},'apiKey':{'type':Sequelize[_0xa1f7('0x3')]},'applicationId':{'type':Sequelize[_0xa1f7('0x3')]},'accountId':{'type':Sequelize[_0xa1f7('0x3')]},'senderString':{'type':Sequelize[_0xa1f7('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xa1f7('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa1f7('0xd')],'defaultValue':function(){return _0xa1f7('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa1f7('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa1f7('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa1f7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa1f7('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa1f7('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa1f7('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa1f7('0xf')],'defaultValue':![],'comment':_0xa1f7('0x11'),'set':function(_0x3d6257){if(!_0x3d6257)this[_0xa1f7('0x12')](_0xa1f7('0x13'),null);this[_0xa1f7('0x12')](_0xa1f7('0x14'),_0x3d6257);}}};
\ No newline at end of file
+var _0x41ae=['exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0xda8684,_0x40ac51){var _0x396c80=function(_0x4617e8){while(--_0x4617e8){_0xda8684['push'](_0xda8684['shift']());}};_0x396c80(++_0x40ac51);}(_0x41ae,0x11e));var _0xe41a=function(_0x19e96c,_0x56c275){_0x19e96c=_0x19e96c-0x0;var _0x4fe77c=_0x41ae[_0x19e96c];return _0x4fe77c;};'use strict';var Sequelize=require(_0xe41a('0x0'));var rs=require(_0xe41a('0x1'));module[_0xe41a('0x2')]={'name':{'type':Sequelize[_0xe41a('0x3')],'unique':_0xe41a('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe41a('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe41a('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xe41a('0x3')],'defaultValue':function(){return rs[_0xe41a('0x5')]();}},'phone':{'type':Sequelize[_0xe41a('0x3')]},'type':{'type':Sequelize[_0xe41a('0x6')](_0xe41a('0x7'),_0xe41a('0x8'),_0xe41a('0x9'),_0xe41a('0xa'),_0xe41a('0xb'),'clickatell',_0xe41a('0xc'),_0xe41a('0xd'),_0xe41a('0xe'),_0xe41a('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xe41a('0x3')]},'authToken':{'type':Sequelize[_0xe41a('0x3')]},'smsMethod':{'type':Sequelize[_0xe41a('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xe41a('0x3')]},'applicationId':{'type':Sequelize[_0xe41a('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xe41a('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xe41a('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe41a('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe41a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe41a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe41a('0x12')],'comment':_0xe41a('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':![],'comment':_0xe41a('0x14'),'set':function(_0x381c03){if(!_0x381c03)this['setDataValue'](_0xe41a('0x15'),null);this[_0xe41a('0x16')](_0xe41a('0x17'),_0x381c03);}}};
\ No newline at end of file
index ad952f1..3a1d733 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bf7=['csc','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','mustache','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/utils','../../mysqldb','redis','localhost','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','stack','name','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','SmsAccount','includeAll','findAll','rows','show','Pause','mandatoryDispositionPause','include','find','create','body','user','get','SmsAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rawAttributes','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','Applications','account','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','From','Body','MessageSid','skebby','sender','text','messageId','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','SmsInteraction','spread','interaction','created','push','close','unmanaged','SmsMessage','ContactId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','Owner','internal','Tags','color','tag','to\x20is\x20mandatory','List','defaults','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','statusInt','clicksend','status_code','DELIVERED','groupName','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id'];(function(_0x112aa9,_0x51a391){var _0xebc169=function(_0x52ce81){while(--_0x52ce81){_0x112aa9['push'](_0x112aa9['shift']());}};_0xebc169(++_0x51a391);}(_0x2bf7,0xe7));var _0x72bf=function(_0x299760,_0x3485c9){_0x299760=_0x299760-0x0;var _0x240aa8=_0x2bf7[_0x299760];return _0x240aa8;};'use strict';var emlformat=require(_0x72bf('0x0'));var rimraf=require(_0x72bf('0x1'));var zipdir=require(_0x72bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x72bf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x72bf('0x4'));var util=require('util');var path=require(_0x72bf('0x5'));var sox=require(_0x72bf('0x6'));var csv=require(_0x72bf('0x7'));var ejs=require(_0x72bf('0x8'));var fs=require('fs');var fs_extra=require(_0x72bf('0x9'));var _=require(_0x72bf('0xa'));var squel=require(_0x72bf('0xb'));var crypto=require(_0x72bf('0xc'));var jsforce=require(_0x72bf('0xd'));var deskjs=require(_0x72bf('0xe'));var toCsv=require(_0x72bf('0x7'));var querystring=require(_0x72bf('0xf'));var Papa=require(_0x72bf('0x10'));var Redis=require(_0x72bf('0x11'));var authService=require(_0x72bf('0x12'));var qs=require(_0x72bf('0x13'));var as=require(_0x72bf('0x14'));var hardwareService=require(_0x72bf('0x15'));var logger=require(_0x72bf('0x16'))(_0x72bf('0x17'));var utils=require(_0x72bf('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x72bf('0x19'))['db'];config[_0x72bf('0x1a')]=_['defaults'](config[_0x72bf('0x1a')],{'host':_0x72bf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x72bf('0x1c'))['register'](socket);var jayson=require(_0x72bf('0x1d'));var client=jayson[_0x72bf('0x1e')][_0x72bf('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xee6724,_0x28d0e1,_0x1d6aa4,_0x1c20a8){return new BPromise(function(_0xc6194a,_0x4d8a1c){var _0x43b5be=_0x1c20a8||client;return _0x43b5be[_0x72bf('0x20')](_0xee6724,_0x1d6aa4)[_0x72bf('0x21')](function(_0x4e0bda){logger[_0x72bf('0x22')](_0x72bf('0x23'),_0x28d0e1,_0x72bf('0x24'));logger[_0x72bf('0x25')](_0x72bf('0x26'),_0x28d0e1,_0x72bf('0x24'),JSON['stringify'](_0x4e0bda));if(_0x4e0bda[_0x72bf('0x27')]){if(_0x4e0bda[_0x72bf('0x27')]['code']===0x1f4){logger[_0x72bf('0x27')](_0x72bf('0x23'),_0x28d0e1,_0x4e0bda[_0x72bf('0x27')][_0x72bf('0x28')]);return _0x4d8a1c(_0x4e0bda[_0x72bf('0x27')][_0x72bf('0x28')]);}logger[_0x72bf('0x27')]('SmsAccount,\x20%s,\x20%s',_0x28d0e1,_0x4e0bda[_0x72bf('0x27')][_0x72bf('0x28')]);return _0xc6194a(_0x4e0bda[_0x72bf('0x27')][_0x72bf('0x28')]);}else{logger[_0x72bf('0x22')]('SmsAccount,\x20%s,\x20%s',_0x28d0e1,_0x72bf('0x24'));_0xc6194a(_0x4e0bda[_0x72bf('0x29')]['message']);}})[_0x72bf('0x2a')](function(_0x39dc08){logger[_0x72bf('0x27')](_0x72bf('0x23'),_0x28d0e1,_0x39dc08);_0x4d8a1c(_0x39dc08);});});}function respondWithStatusCode(_0xeac0cd,_0x3f145a){_0x3f145a=_0x3f145a||0xcc;return function(_0x4b79e8){if(_0x4b79e8){return _0xeac0cd[_0x72bf('0x2b')](_0x3f145a);}return _0xeac0cd[_0x72bf('0x2c')](_0x3f145a)['end']();};}function respondWithResult(_0x330a46,_0x1466c6){_0x1466c6=_0x1466c6||0xc8;return function(_0x3d3251){if(_0x3d3251){return _0x330a46['status'](_0x1466c6)[_0x72bf('0x2d')](_0x3d3251);}};}function respondWithFilteredResult(_0x2b34aa,_0x6b7cd5){return function(_0x3a2cf9){if(_0x3a2cf9){var _0x1effc5=typeof _0x6b7cd5[_0x72bf('0x2e')]===_0x72bf('0x2f')&&typeof _0x6b7cd5['limit']==='undefined';var _0x2d4031=_0x3a2cf9['count'];var _0xe549fe=_0x1effc5?0x0:_0x6b7cd5[_0x72bf('0x2e')];var _0x3c7cdb=_0x1effc5?_0x3a2cf9[_0x72bf('0x30')]:_0x6b7cd5['offset']+_0x6b7cd5[_0x72bf('0x31')];var _0x21c577;if(_0x3c7cdb>=_0x2d4031){_0x3c7cdb=_0x2d4031;_0x21c577=0xc8;}else{_0x21c577=0xce;}_0x2b34aa[_0x72bf('0x2c')](_0x21c577);return _0x2b34aa[_0x72bf('0x32')](_0x72bf('0x33'),_0xe549fe+'-'+_0x3c7cdb+'/'+_0x2d4031)[_0x72bf('0x2d')](_0x3a2cf9);}return null;};}function patchUpdates(_0x57d4db){return function(_0x29067b){try{jsonpatch[_0x72bf('0x34')](_0x29067b,_0x57d4db,!![]);}catch(_0x1f7ff1){return BPromise[_0x72bf('0x35')](_0x1f7ff1);}return _0x29067b[_0x72bf('0x36')]();};}function saveUpdates(_0x43503b,_0x11ca38){return function(_0x445e61){if(_0x445e61){return _0x445e61[_0x72bf('0x37')](_0x43503b)['then'](function(_0x3ec739){return _0x3ec739;});}return null;};}function removeEntity(_0x4f9402,_0x290e15){return function(_0xc95fc9){if(_0xc95fc9){return _0xc95fc9[_0x72bf('0x38')]()[_0x72bf('0x21')](function(){var _0x18ab2f=_0xc95fc9['get']({'plain':!![]});var _0x51e619='SmsAccounts';return db[_0x72bf('0x39')][_0x72bf('0x38')]({'where':{'type':_0x51e619,'resourceId':_0x18ab2f['id']}})[_0x72bf('0x21')](function(){return _0xc95fc9;});})[_0x72bf('0x21')](function(){_0x4f9402[_0x72bf('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b126,_0x50aa9a){return function(_0xe3c4e){if(!_0xe3c4e){_0x20b126[_0x72bf('0x2b')](0x194);}return _0xe3c4e;};}function handleError(_0x4016de,_0x191c84){_0x191c84=_0x191c84||0x1f4;return function(_0x47f4e8){logger['error'](_0x47f4e8[_0x72bf('0x3a')]);if(_0x47f4e8['name']){delete _0x47f4e8[_0x72bf('0x3b')];}_0x4016de[_0x72bf('0x2c')](_0x191c84)['send'](_0x47f4e8);};}exports['index']=function(_0x24481,_0x221f9c){var _0x3d9fbd={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x58aed5={},_0x134003={'count':0x0,'rows':[]};var _0x1df0be=_['map'](db['SmsAccount']['rawAttributes'],function(_0x22d0a8){return{'name':_0x22d0a8[_0x72bf('0x3c')],'type':_0x22d0a8[_0x72bf('0x3d')][_0x72bf('0x3e')]};});_0x58aed5[_0x72bf('0x3f')]=_['map'](_0x1df0be,_0x72bf('0x3b'));_0x58aed5[_0x72bf('0x40')]=_[_0x72bf('0x41')](_0x24481['query']);_0x58aed5[_0x72bf('0x42')]=_[_0x72bf('0x43')](_0x58aed5[_0x72bf('0x3f')],_0x58aed5[_0x72bf('0x40')]);_0x3d9fbd[_0x72bf('0x44')]=_['intersection'](_0x58aed5[_0x72bf('0x3f')],qs[_0x72bf('0x45')](_0x24481['query'][_0x72bf('0x45')]));_0x3d9fbd[_0x72bf('0x44')]=_0x3d9fbd['attributes'][_0x72bf('0x46')]?_0x3d9fbd[_0x72bf('0x44')]:_0x58aed5['model'];if(!_0x24481[_0x72bf('0x40')][_0x72bf('0x47')](_0x72bf('0x48'))){_0x3d9fbd['limit']=qs['limit'](_0x24481[_0x72bf('0x40')][_0x72bf('0x31')]);_0x3d9fbd[_0x72bf('0x2e')]=qs[_0x72bf('0x2e')](_0x24481[_0x72bf('0x40')]['offset']);}_0x3d9fbd[_0x72bf('0x49')]=qs[_0x72bf('0x4a')](_0x24481[_0x72bf('0x40')]['sort']);_0x3d9fbd[_0x72bf('0x4b')]=qs[_0x72bf('0x42')](_[_0x72bf('0x4c')](_0x24481[_0x72bf('0x40')],_0x58aed5[_0x72bf('0x42')]),_0x1df0be);if(_0x24481[_0x72bf('0x40')][_0x72bf('0x4d')]){_0x3d9fbd['where']=_[_0x72bf('0x4e')](_0x3d9fbd[_0x72bf('0x4b')],{'$or':_[_0x72bf('0x4f')](_0x1df0be,function(_0x376e43){if(_0x376e43[_0x72bf('0x3d')]!=='VIRTUAL'){var _0x58966a={};_0x58966a[_0x376e43[_0x72bf('0x3b')]]={'$like':'%'+_0x24481[_0x72bf('0x40')][_0x72bf('0x4d')]+'%'};return _0x58966a;}})});}_0x3d9fbd=_[_0x72bf('0x4e')]({},_0x3d9fbd,_0x24481[_0x72bf('0x50')]);var _0x1a5419={'where':_0x3d9fbd[_0x72bf('0x4b')]};return db[_0x72bf('0x51')][_0x72bf('0x30')](_0x1a5419)[_0x72bf('0x21')](function(_0x1c99ed){_0x134003['count']=_0x1c99ed;if(_0x24481[_0x72bf('0x40')][_0x72bf('0x52')]){_0x3d9fbd['include']=[{'all':!![]}];}return db['SmsAccount'][_0x72bf('0x53')](_0x3d9fbd);})[_0x72bf('0x21')](function(_0x20b3b5){_0x134003[_0x72bf('0x54')]=_0x20b3b5;return _0x134003;})[_0x72bf('0x21')](respondWithFilteredResult(_0x221f9c,_0x3d9fbd))['catch'](handleError(_0x221f9c,null));};exports[_0x72bf('0x55')]=function(_0x564137,_0x430728){var _0x3f2268={'raw':![],'where':{'id':_0x564137['params']['id']},'include':[{'model':db[_0x72bf('0x56')],'as':_0x72bf('0x57')}]},_0x30e3af={};_0x30e3af[_0x72bf('0x3f')]=_[_0x72bf('0x41')](db[_0x72bf('0x51')]['rawAttributes']);_0x30e3af[_0x72bf('0x40')]=_[_0x72bf('0x41')](_0x564137['query']);_0x30e3af[_0x72bf('0x42')]=_[_0x72bf('0x43')](_0x30e3af[_0x72bf('0x3f')],_0x30e3af[_0x72bf('0x40')]);_0x3f2268[_0x72bf('0x44')]=_[_0x72bf('0x43')](_0x30e3af[_0x72bf('0x3f')],qs[_0x72bf('0x45')](_0x564137[_0x72bf('0x40')][_0x72bf('0x45')]));_0x3f2268[_0x72bf('0x44')]=_0x3f2268[_0x72bf('0x44')][_0x72bf('0x46')]?_0x3f2268[_0x72bf('0x44')]:_0x30e3af[_0x72bf('0x3f')];if(_0x564137[_0x72bf('0x40')]['includeAll']){_0x3f2268[_0x72bf('0x58')]=[{'all':!![]}];}_0x3f2268=_[_0x72bf('0x4e')]({},_0x3f2268,_0x564137[_0x72bf('0x50')]);return db['SmsAccount'][_0x72bf('0x59')](_0x3f2268)['then'](handleEntityNotFound(_0x430728,null))['then'](respondWithResult(_0x430728,null))[_0x72bf('0x2a')](handleError(_0x430728,null));};exports[_0x72bf('0x5a')]=function(_0x1a92ff,_0x76370a){return db[_0x72bf('0x51')]['create'](_0x1a92ff[_0x72bf('0x5b')],{})['then'](function(_0x214795){var _0x474656=_0x1a92ff[_0x72bf('0x5c')][_0x72bf('0x5d')]({'plain':!![]});if(!_0x474656)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x474656['role']===_0x72bf('0x5c')){var _0x42a609=_0x214795[_0x72bf('0x5d')]({'plain':!![]});var _0x183120=_0x72bf('0x5e');return db[_0x72bf('0x5f')]['find']({'where':{'name':_0x183120,'userProfileId':_0x474656[_0x72bf('0x60')]},'raw':!![]})[_0x72bf('0x21')](function(_0x4a74ca){if(_0x4a74ca&&_0x4a74ca['autoAssociation']===0x0){return db[_0x72bf('0x39')][_0x72bf('0x5a')]({'name':_0x42a609['name'],'resourceId':_0x42a609['id'],'type':_0x4a74ca[_0x72bf('0x3b')],'sectionId':_0x4a74ca['id']},{})[_0x72bf('0x21')](function(){return _0x214795;});}else{return _0x214795;}})[_0x72bf('0x2a')](function(_0xb5fa8c){logger['error'](_0x72bf('0x61'),_0xb5fa8c);throw _0xb5fa8c;});}return _0x214795;})[_0x72bf('0x21')](respondWithResult(_0x76370a,0xc9))[_0x72bf('0x2a')](handleError(_0x76370a,null));};exports[_0x72bf('0x37')]=function(_0x1fc431,_0x54ca6e){if(_0x1fc431[_0x72bf('0x5b')]['id']){delete _0x1fc431[_0x72bf('0x5b')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x1fc431[_0x72bf('0x62')]['id']},'include':[{'model':db[_0x72bf('0x56')],'as':_0x72bf('0x57')}]})['then'](handleEntityNotFound(_0x54ca6e,null))[_0x72bf('0x21')](saveUpdates(_0x1fc431[_0x72bf('0x5b')],null))['then'](respondWithResult(_0x54ca6e,null))[_0x72bf('0x2a')](handleError(_0x54ca6e,null));};exports[_0x72bf('0x38')]=function(_0x34eae0,_0x50724d){return db[_0x72bf('0x51')][_0x72bf('0x59')]({'where':{'id':_0x34eae0['params']['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x50724d,null))[_0x72bf('0x21')](removeEntity(_0x50724d,null))[_0x72bf('0x2a')](handleError(_0x50724d,null));};exports['describe']=function(_0x44cbcc,_0x4444fd){return db[_0x72bf('0x51')][_0x72bf('0x63')]()[_0x72bf('0x21')](respondWithResult(_0x4444fd,null))[_0x72bf('0x2a')](handleError(_0x4444fd,null));};exports[_0x72bf('0x64')]=function(_0x327c00,_0x2f452a,_0x2b0630){if(_0x327c00['body']['id']){delete _0x327c00[_0x72bf('0x5b')]['id'];}return db['SmsAccount'][_0x72bf('0x59')]({'where':{'id':_0x327c00['params']['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x2f452a,null))[_0x72bf('0x21')](function(_0x43f203){if(_0x43f203){_0x327c00[_0x72bf('0x5b')][_0x72bf('0x65')]=_0x43f203['id'];return db[_0x72bf('0x66')][_0x72bf('0x5a')](_0x327c00[_0x72bf('0x5b')]);}})[_0x72bf('0x21')](respondWithResult(_0x2f452a,null))[_0x72bf('0x2a')](handleError(_0x2f452a,null));};exports[_0x72bf('0x67')]=function(_0x1f9512,_0x365d0e,_0x5ab7ab){var _0x3c0c96={'raw':![],'where':{}};var _0x291342={};var _0x34a913={'count':0x0,'rows':[]};return db[_0x72bf('0x51')][_0x72bf('0x68')]({'where':{'id':_0x1f9512[_0x72bf('0x62')]['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x365d0e,null))[_0x72bf('0x21')](function(_0x5c7660){if(_0x5c7660){_0x291342['model']=_[_0x72bf('0x41')](db[_0x72bf('0x66')][_0x72bf('0x69')]);_0x291342[_0x72bf('0x40')]=_[_0x72bf('0x41')](_0x1f9512[_0x72bf('0x40')]);_0x291342['filters']=_['intersection'](_0x291342[_0x72bf('0x3f')],_0x291342[_0x72bf('0x40')]);_0x3c0c96[_0x72bf('0x44')]=_[_0x72bf('0x43')](_0x291342[_0x72bf('0x3f')],qs[_0x72bf('0x45')](_0x1f9512[_0x72bf('0x40')][_0x72bf('0x45')]));_0x3c0c96[_0x72bf('0x44')]=_0x3c0c96['attributes'][_0x72bf('0x46')]?_0x3c0c96[_0x72bf('0x44')]:_0x291342['model'];if(!_0x1f9512[_0x72bf('0x40')][_0x72bf('0x47')](_0x72bf('0x48'))){_0x3c0c96[_0x72bf('0x31')]=qs[_0x72bf('0x31')](_0x1f9512['query'][_0x72bf('0x31')]);_0x3c0c96[_0x72bf('0x2e')]=qs[_0x72bf('0x2e')](_0x1f9512[_0x72bf('0x40')]['offset']);}_0x3c0c96[_0x72bf('0x49')]=qs[_0x72bf('0x4a')](_0x1f9512[_0x72bf('0x40')]['sort']);_0x3c0c96[_0x72bf('0x4b')]=qs[_0x72bf('0x42')](_[_0x72bf('0x4c')](_0x1f9512['query'],_0x291342[_0x72bf('0x42')]));_0x3c0c96[_0x72bf('0x4b')][_0x72bf('0x65')]=_0x5c7660['id'];if(_0x1f9512[_0x72bf('0x40')]['filter']){_0x3c0c96[_0x72bf('0x4b')]=_[_0x72bf('0x4e')](_0x3c0c96[_0x72bf('0x4b')],{'$or':_[_0x72bf('0x4f')](_0x3c0c96[_0x72bf('0x44')],function(_0x8f3690){var _0x2d65a4={};_0x2d65a4[_0x8f3690]={'$like':'%'+_0x1f9512[_0x72bf('0x40')]['filter']+'%'};return _0x2d65a4;})});}_0x3c0c96=_[_0x72bf('0x4e')]({},_0x3c0c96,_0x1f9512[_0x72bf('0x50')]);return db[_0x72bf('0x66')][_0x72bf('0x30')]({'where':_0x3c0c96[_0x72bf('0x4b')]})[_0x72bf('0x21')](function(_0x1f18a6){_0x34a913[_0x72bf('0x30')]=_0x1f18a6;if(_0x1f9512[_0x72bf('0x40')]['includeAll']){_0x3c0c96[_0x72bf('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x72bf('0x53')](_0x3c0c96);})['then'](function(_0x126b72){_0x34a913[_0x72bf('0x54')]=_0x126b72;return _0x34a913;});}})[_0x72bf('0x21')](respondWithFilteredResult(_0x365d0e,_0x3c0c96))[_0x72bf('0x2a')](handleError(_0x365d0e,null));};exports[_0x72bf('0x6a')]=function(_0x4c736f,_0x2f4230,_0x356058){return db[_0x72bf('0x51')][_0x72bf('0x59')]({'where':{'id':_0x4c736f['params']['id']}})['then'](handleEntityNotFound(_0x2f4230,null))[_0x72bf('0x21')](function(_0x5a661e){if(_0x5a661e){return _0x5a661e[_0x72bf('0x6a')](_0x4c736f[_0x72bf('0x40')][_0x72bf('0x6b')]);}})[_0x72bf('0x21')](respondWithStatusCode(_0x2f4230,null))[_0x72bf('0x2a')](handleError(_0x2f4230,null));};exports[_0x72bf('0x6c')]=function(_0xac0333,_0x5873bb,_0x48b8e6){if(_0xac0333[_0x72bf('0x5b')]['id']){delete _0xac0333[_0x72bf('0x5b')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0xac0333[_0x72bf('0x62')]['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x5873bb,null))[_0x72bf('0x21')](function(_0x28b20d){if(_0x28b20d){_0xac0333['body']['SmsAccountId']=_0x28b20d['id'];return db[_0x72bf('0x6d')][_0x72bf('0x5a')](_0xac0333[_0x72bf('0x5b')]);}})['then'](respondWithResult(_0x5873bb,null))[_0x72bf('0x2a')](handleError(_0x5873bb,null));};exports[_0x72bf('0x6e')]=function(_0xde2269,_0x5a030f,_0x558d41){var _0x197cd5={'raw':![],'where':{}};var _0x7df4eb={};var _0x5c1d29={'count':0x0,'rows':[]};return db[_0x72bf('0x51')][_0x72bf('0x68')]({'where':{'id':_0xde2269['params']['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x5a030f,null))[_0x72bf('0x21')](function(_0x2283c7){if(_0x2283c7){_0x7df4eb[_0x72bf('0x3f')]=_['keys'](db[_0x72bf('0x6d')][_0x72bf('0x69')]);_0x7df4eb[_0x72bf('0x40')]=_['keys'](_0xde2269[_0x72bf('0x40')]);_0x7df4eb[_0x72bf('0x42')]=_[_0x72bf('0x43')](_0x7df4eb[_0x72bf('0x3f')],_0x7df4eb[_0x72bf('0x40')]);_0x197cd5[_0x72bf('0x44')]=_[_0x72bf('0x43')](_0x7df4eb[_0x72bf('0x3f')],qs[_0x72bf('0x45')](_0xde2269['query']['fields']));_0x197cd5[_0x72bf('0x44')]=_0x197cd5[_0x72bf('0x44')][_0x72bf('0x46')]?_0x197cd5[_0x72bf('0x44')]:_0x7df4eb[_0x72bf('0x3f')];if(!_0xde2269[_0x72bf('0x40')][_0x72bf('0x47')](_0x72bf('0x48'))){_0x197cd5[_0x72bf('0x31')]=qs[_0x72bf('0x31')](_0xde2269['query'][_0x72bf('0x31')]);_0x197cd5[_0x72bf('0x2e')]=qs[_0x72bf('0x2e')](_0xde2269[_0x72bf('0x40')]['offset']);}_0x197cd5[_0x72bf('0x49')]=qs[_0x72bf('0x4a')](_0xde2269[_0x72bf('0x40')][_0x72bf('0x4a')]);_0x197cd5[_0x72bf('0x4b')]=qs['filters'](_[_0x72bf('0x4c')](_0xde2269[_0x72bf('0x40')],_0x7df4eb[_0x72bf('0x42')]));_0x197cd5[_0x72bf('0x4b')][_0x72bf('0x65')]=_0x2283c7['id'];if(_0xde2269[_0x72bf('0x40')][_0x72bf('0x4d')]){_0x197cd5[_0x72bf('0x4b')]=_[_0x72bf('0x4e')](_0x197cd5[_0x72bf('0x4b')],{'$or':_[_0x72bf('0x4f')](_0x197cd5['attributes'],function(_0x1f2719){var _0xd36c4d={};_0xd36c4d[_0x1f2719]={'$like':'%'+_0xde2269[_0x72bf('0x40')][_0x72bf('0x4d')]+'%'};return _0xd36c4d;})});}_0x197cd5=_[_0x72bf('0x4e')]({},_0x197cd5,_0xde2269[_0x72bf('0x50')]);return db[_0x72bf('0x6d')][_0x72bf('0x30')]({'where':_0x197cd5[_0x72bf('0x4b')]})[_0x72bf('0x21')](function(_0x399e74){_0x5c1d29['count']=_0x399e74;if(_0xde2269[_0x72bf('0x40')]['includeAll']){_0x197cd5[_0x72bf('0x58')]=[{'all':!![]}];}return db[_0x72bf('0x6d')]['findAll'](_0x197cd5);})[_0x72bf('0x21')](function(_0x187650){_0x5c1d29[_0x72bf('0x54')]=_0x187650;return _0x5c1d29;});}})['then'](respondWithFilteredResult(_0x5a030f,_0x197cd5))[_0x72bf('0x2a')](handleError(_0x5a030f,null));};exports[_0x72bf('0x6f')]=function(_0x3ec6ff,_0x1cee12,_0x3ae36c){return db['SmsAccount'][_0x72bf('0x59')]({'where':{'id':_0x3ec6ff[_0x72bf('0x62')]['id']}})['then'](handleEntityNotFound(_0x1cee12,null))[_0x72bf('0x21')](function(_0x194ce9){if(_0x194ce9){return _0x194ce9[_0x72bf('0x6f')](_0x3ec6ff[_0x72bf('0x40')][_0x72bf('0x6b')]);}})[_0x72bf('0x21')](respondWithStatusCode(_0x1cee12,null))['catch'](handleError(_0x1cee12,null));};exports['notify']=function(_0x3e5cb4,_0x7eda62,_0x41a544){var _0x7a579e={'channel':_0x72bf('0x70')};var _0x549630=[];var _0x1c3143=[];var _0xe8f47f={};return db[_0x72bf('0x51')][_0x72bf('0x59')]({'where':{'id':_0x3e5cb4[_0x72bf('0x62')]['id']},'include':[{'model':db[_0x72bf('0x71')],'as':_0x72bf('0x72')}]})[_0x72bf('0x21')](handleEntityNotFound(_0x7eda62,null))[_0x72bf('0x21')](function(_0x585efc){_0x7a579e[_0x72bf('0x73')]=_0x585efc;_0x7a579e[_0x72bf('0x74')]=_['orderBy'](_0x585efc[_0x72bf('0x72')],['priority'],[_0x72bf('0x75')]);if(_0x7a579e[_0x72bf('0x73')]['Applications']){delete _0x7a579e[_0x72bf('0x73')][_0x72bf('0x72')];}return db[_0x72bf('0x76')][_0x72bf('0x63')]();})[_0x72bf('0x21')](function(_0x2a6abb){if(!_0x2a6abb){throw new db[(_0x72bf('0x77'))][(_0x72bf('0x78'))](_0x72bf('0x79'));}_0x549630=_[_0x72bf('0x7a')](_[_0x72bf('0x41')](_0x2a6abb),['createdAt',_0x72bf('0x7b')]);_0x1c3143=_[_0x72bf('0x7a')](_[_0x72bf('0x41')](_0x2a6abb),[_0x72bf('0x7c'),_0x72bf('0x7b'),_0x72bf('0x7d'),_0x72bf('0x7e')]);_0x7a579e[_0x72bf('0x5b')]={'mapKey':'mobile'};if(_0x7a579e[_0x72bf('0x73')][_0x72bf('0x3d')]){switch(_0x7a579e['account'][_0x72bf('0x3d')]){case'twilio':_0x7a579e['body'][_0x72bf('0x7f')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x80')];_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x81')];_0x7a579e[_0x72bf('0x5b')]['messageId']=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x82')];break;case _0x72bf('0x83'):_0x7a579e[_0x72bf('0x5b')]['from']='+'+_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x84')];_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x85')];break;case'connectel':_0x7a579e['body'][_0x72bf('0x7f')]=_0x3e5cb4[_0x72bf('0x5b')]['from'];_0x7a579e[_0x72bf('0x5b')]['body']=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x28')];break;case'clicksend':_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x7f')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x7f')];_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x5b')];_0x7a579e['body'][_0x72bf('0x86')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x87')];break;case _0x72bf('0x88'):_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x7f')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x80')];_0x7a579e[_0x72bf('0x5b')]['body']=_0x3e5cb4['body'][_0x72bf('0x89')];_0x7a579e['body'][_0x72bf('0x86')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x8a')];break;case _0x72bf('0x8b'):_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x7f')]='+'+_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x8c')][0x0][_0x72bf('0x7f')];_0x7a579e['body'][_0x72bf('0x5b')]=_0x3e5cb4[_0x72bf('0x5b')]['results'][0x0][_0x72bf('0x85')];_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x86')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x8c')][0x0][_0x72bf('0x86')];break;case'csc':_0x7a579e['body'][_0x72bf('0x7f')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x8d')];_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')]=_0x3e5cb4[_0x72bf('0x5b')]['segmentedMessage'][_0x72bf('0x28')];break;case'clickatell':_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x7f')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x8e')];_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')]=_0x3e5cb4[_0x72bf('0x5b')]['text'];_0x7a579e['body'][_0x72bf('0x86')]=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x8f')];break;case _0x72bf('0x90'):_0x7a579e['body'][_0x72bf('0x86')]=_0x3e5cb4[_0x72bf('0x5b')][0x0]['message']['id'];_0x7a579e[_0x72bf('0x5b')]['from']=_0x3e5cb4[_0x72bf('0x5b')][0x0][_0x72bf('0x28')]['from'];_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')]=_0x3e5cb4['body'][0x0][_0x72bf('0x28')][_0x72bf('0x85')];break;case _0x72bf('0x91'):_0x7a579e[_0x72bf('0x5b')]['from']=_0x3e5cb4[_0x72bf('0x5b')][_0x72bf('0x7f')];_0x7a579e[_0x72bf('0x5b')]['body']=_0x3e5cb4['body'][_0x72bf('0x28')];_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x86')]=_0x3e5cb4[_0x72bf('0x5b')]['refid'];break;}}if(_0x7a579e[_0x72bf('0x5b')]['id']){delete _0x7a579e[_0x72bf('0x5b')]['id'];}if(_[_0x72bf('0x92')](_0x7a579e[_0x72bf('0x5b')]['from'])){throw new db[(_0x72bf('0x77'))]['ValidationError'](_0x72bf('0x93'));}if(_[_0x72bf('0x92')](_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')])||_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')]===''){throw new db['Sequelize'][(_0x72bf('0x78'))](_0x72bf('0x94'));}if(_['isNil'](_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x95')])){throw new db[(_0x72bf('0x77'))][(_0x72bf('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c3143);}if(!_[_0x72bf('0x96')](_0x1c3143,_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x95')])){throw new db[(_0x72bf('0x77'))][(_0x72bf('0x78'))](_0x72bf('0x97')+_0x1c3143);}_0xe8f47f[_0x7a579e['body'][_0x72bf('0x95')]]=_0x7a579e[_0x72bf('0x5b')]['from'];return db[_0x72bf('0x98')][_0x72bf('0x59')]({'where':{'id':_0x7a579e[_0x72bf('0x73')][_0x72bf('0x7e')]},'include':[{'model':db[_0x72bf('0x76')],'as':_0x72bf('0x99'),'where':_0xe8f47f,'limit':0x1,'order':[['updatedAt',_0x72bf('0x9a')]]}]});})['then'](handleEntityNotFound(_0x7eda62,null))[_0x72bf('0x21')](function(_0x12eee3){if(_0x12eee3){_0x7a579e['list']=_['omit'](_0x12eee3,['Contacts']);if(_0x12eee3[_0x72bf('0x99')][_0x72bf('0x46')]){return _0x12eee3[_0x72bf('0x99')][0x0];}var _0x3ca7bb=_['defaults'](_0x7a579e[_0x72bf('0x5b')],{'firstName':_0x7a579e[_0x72bf('0x5b')]['from'],'ListId':_0x12eee3['id']});_0x3ca7bb[_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x95')]]=_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x7f')];return db[_0x72bf('0x76')]['create'](_0x3ca7bb,{'fields':_0x549630,'raw':!![]});}})[_0x72bf('0x21')](handleEntityNotFound(_0x7eda62,null))[_0x72bf('0x21')](function(_0xf3333b){if(_0xf3333b){_0x7a579e['contact']=_0xf3333b;var _0x450cdf={'ContactId':_0xf3333b['id'],'phone':_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x7f')],'SmsAccountId':_0x3e5cb4[_0x72bf('0x62')]['id']};var _0x457a62={'ContactId':_0xf3333b['id'],'SmsAccountId':_0x3e5cb4['params']['id'],'closed':![]};return db[_0x72bf('0x9b')][_0x72bf('0x59')]({'where':_0x457a62})['then'](function(_0x3c9f07){if(_0x3c9f07){return[_0x3c9f07,![]];}return db[_0x72bf('0x9b')][_0x72bf('0x5a')](_0x450cdf)[_0x72bf('0x21')](function(_0x3acd24){return[_0x3acd24,!![]];});});}})[_0x72bf('0x9c')](function(_0x4d2c4b,_0x4b544a){_0x7a579e['interaction']=_0x4d2c4b[_0x72bf('0x5d')]({'plain':!![]});_0x7a579e[_0x72bf('0x9d')][_0x72bf('0x9e')]=![];if(_0x4b544a){if(_0x7a579e[_0x72bf('0x73')]['autoclose']){_0x7a579e['applications'][_0x72bf('0x9f')]({'id':0x0,'priority':_0x7a579e[_0x72bf('0x74')][_0x72bf('0x46')]+0x1,'app':_0x72bf('0xa0'),'appdata':_0x72bf('0xa1'),'interval':'*,*,*,*'});}_0x7a579e['interaction'][_0x72bf('0x9e')]=!![];}return db[_0x72bf('0xa2')][_0x72bf('0x5a')]({'phone':_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x7f')],'messageId':_0x7a579e[_0x72bf('0x5b')]['messageId'],'body':_0x7a579e[_0x72bf('0x5b')][_0x72bf('0x5b')],'SmsAccountId':_0x3e5cb4[_0x72bf('0x62')]['id'],'SmsInteractionId':_0x4d2c4b['id'],'direction':'in','ContactId':_0x4d2c4b[_0x72bf('0xa3')],'AttachmentId':_0x7a579e[_0x72bf('0x5b')]['AttachmentId']});})['then'](function(_0x444596){_0x7a579e[_0x72bf('0x28')]=_0x444596;if(_0x7a579e[_0x72bf('0x9d')][_0x72bf('0xa4')]){return db[_0x72bf('0xa5')][_0x72bf('0x59')]({'attributes':['id',_0x72bf('0x3b')],'where':{'id':_0x7a579e[_0x72bf('0x9d')][_0x72bf('0xa4')]}})['then'](function(_0x28ce3f){if(_0x28ce3f){_0x7a579e[_0x72bf('0x74')]['unshift']({'id':0x0,'priority':0x0,'app':_0x72bf('0xa6'),'appdata':_0x28ce3f['name']+','+(_0x7a579e[_0x72bf('0x73')][_0x72bf('0xa7')]||0xa),'interval':_0x72bf('0xa8')});}return respondWithRpcPromise(_0x72bf('0xa9'),_0x72bf('0xaa'),_0x7a579e);});}return respondWithRpcPromise('Start',_0x72bf('0xaa'),_0x7a579e);})[_0x72bf('0x21')](function(_0x17d78e){if(_0x17d78e){var _0x4e906d=0xc8;var _0x11523e=_0x72bf('0xab');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x11523e,_0x4e906d,_0x72bf('0xac'));logger[_0x72bf('0x25')](_0x72bf('0xad'),_0x11523e,_0x4e906d,_0x72bf('0xac'),JSON[_0x72bf('0xae')](_0x17d78e));if(_0x7a579e[_0x72bf('0x73')]['type']==='twilio'){return _0x7eda62[_0x72bf('0x2c')](_0x4e906d)[_0x72bf('0x32')](_0x72bf('0xaf'),_0x72bf('0xb0'))[_0x72bf('0xb1')](_0x72bf('0xb2'));}else{return _0x7eda62[_0x72bf('0x2c')](_0x4e906d)[_0x72bf('0x2d')](_0x17d78e);}}})['catch'](handleError(_0x7eda62,null));};exports[_0x72bf('0xb3')]=function(_0x394d7a,_0x188c25,_0x21abeb){return db['SmsAccount'][_0x72bf('0x68')]({'where':{'id':_0x394d7a['params']['id']}})['then'](handleEntityNotFound(_0x188c25,null))['then'](function(_0x528629){if(_0x528629){return db['sequelize'][_0x72bf('0xb4')](function(_0xa5bcd1){return db[_0x72bf('0x71')][_0x72bf('0x38')]({'where':{'SmsAccountId':_0x394d7a[_0x72bf('0x62')]['id']},'transaction':_0xa5bcd1})['then'](function(_0x43ff2c){var _0x4bb6ea=_[_0x72bf('0x4f')](_0x394d7a[_0x72bf('0x5b')],function(_0x1794e0){_0x1794e0['SmsAccountId']=_0x394d7a[_0x72bf('0x62')]['id'];return _0x1794e0;});return db[_0x72bf('0x71')][_0x72bf('0xb5')](_0x4bb6ea,{'transaction':_0xa5bcd1});});})[_0x72bf('0x21')](function(){return db[_0x72bf('0x71')][_0x72bf('0xb6')]({'where':{'SmsAccountId':_0x394d7a[_0x72bf('0x62')]['id']},'order':'priority'});});}})[_0x72bf('0x21')](respondWithResult(_0x188c25,null))[_0x72bf('0x2a')](handleError(_0x188c25,null));};exports[_0x72bf('0xb7')]=function(_0x5ee2fd,_0x442daa,_0x311c4f){var _0x4c1605={};var _0x1d8b23={};var _0x4d7260;var _0x37a2d2;return db[_0x72bf('0x51')][_0x72bf('0x68')]({'where':{'id':_0x5ee2fd[_0x72bf('0x62')]['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x442daa,null))[_0x72bf('0x21')](function(_0x512061){if(_0x512061){_0x4d7260=_0x512061;_0x1d8b23[_0x72bf('0x3f')]=_[_0x72bf('0x41')](db[_0x72bf('0x71')][_0x72bf('0x69')]);_0x1d8b23['query']=_[_0x72bf('0x41')](_0x5ee2fd[_0x72bf('0x40')]);_0x1d8b23[_0x72bf('0x42')]=_[_0x72bf('0x43')](_0x1d8b23['model'],_0x1d8b23['query']);_0x4c1605[_0x72bf('0x44')]=_[_0x72bf('0x43')](_0x1d8b23[_0x72bf('0x3f')],qs['fields'](_0x5ee2fd[_0x72bf('0x40')][_0x72bf('0x45')]));_0x4c1605[_0x72bf('0x44')]=_0x4c1605['attributes'][_0x72bf('0x46')]?_0x4c1605[_0x72bf('0x44')]:_0x1d8b23[_0x72bf('0x3f')];_0x4c1605['order']=qs[_0x72bf('0x4a')](_0x5ee2fd[_0x72bf('0x40')]['sort']);_0x4c1605[_0x72bf('0x4b')]=qs[_0x72bf('0x42')](_['pick'](_0x5ee2fd[_0x72bf('0x40')],_0x1d8b23[_0x72bf('0x42')]));if(_0x5ee2fd['query'][_0x72bf('0x4d')]){_0x4c1605['where']=_['merge'](_0x4c1605[_0x72bf('0x4b')],{'$or':_['map'](_0x4c1605[_0x72bf('0x44')],function(_0x4cb72b){var _0x12585f={};_0x12585f[_0x4cb72b]={'$like':'%'+_0x5ee2fd[_0x72bf('0x40')][_0x72bf('0x4d')]+'%'};return _0x12585f;})});}_0x4c1605=_['merge']({},_0x4c1605,_0x5ee2fd['options']);return _0x4d7260[_0x72bf('0xb7')](_0x4c1605);}})['then'](function(_0x5f0a66){if(_0x5f0a66){_0x37a2d2=_0x5f0a66['length'];if(!_0x5ee2fd[_0x72bf('0x40')][_0x72bf('0x47')](_0x72bf('0x48'))){_0x4c1605[_0x72bf('0x31')]=qs[_0x72bf('0x31')](_0x5ee2fd[_0x72bf('0x40')][_0x72bf('0x31')]);_0x4c1605[_0x72bf('0x2e')]=qs[_0x72bf('0x2e')](_0x5ee2fd[_0x72bf('0x40')]['offset']);}return _0x4d7260[_0x72bf('0xb7')](_0x4c1605);}})[_0x72bf('0x21')](function(_0x3f9a69){if(_0x3f9a69){return _0x3f9a69?{'count':_0x37a2d2,'rows':_0x3f9a69}:null;}})[_0x72bf('0x21')](respondWithResult(_0x442daa,null))[_0x72bf('0x2a')](handleError(_0x442daa,null));};exports['getInteractions']=function(_0x53248a,_0x11b7ce,_0x34e031){var _0x3c4510={'raw':![],'where':{}};var _0x19510d={};var _0x13d647={'count':0x0,'rows':[]};return db[_0x72bf('0x51')][_0x72bf('0x68')]({'where':{'id':_0x53248a[_0x72bf('0x62')]['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x11b7ce,null))[_0x72bf('0x21')](function(_0x4c913e){if(_0x4c913e){_0x19510d[_0x72bf('0x3f')]=_['keys'](db[_0x72bf('0x9b')][_0x72bf('0x69')]);_0x19510d[_0x72bf('0x40')]=_[_0x72bf('0x41')](_0x53248a['query']);_0x19510d['filters']=_[_0x72bf('0x43')](_0x19510d[_0x72bf('0x3f')],_0x19510d[_0x72bf('0x40')]);_0x3c4510['attributes']=_['intersection'](_0x19510d[_0x72bf('0x3f')],qs['fields'](_0x53248a[_0x72bf('0x40')][_0x72bf('0x45')]));_0x3c4510[_0x72bf('0x44')]=_0x3c4510['attributes'][_0x72bf('0x46')]?_0x3c4510[_0x72bf('0x44')]:_0x19510d[_0x72bf('0x3f')];if(!_0x53248a[_0x72bf('0x40')][_0x72bf('0x47')]('nolimit')){_0x3c4510['limit']=qs[_0x72bf('0x31')](_0x53248a[_0x72bf('0x40')]['limit']);_0x3c4510['offset']=qs[_0x72bf('0x2e')](_0x53248a[_0x72bf('0x40')][_0x72bf('0x2e')]);}_0x3c4510[_0x72bf('0x49')]=qs['sort'](_0x53248a[_0x72bf('0x40')][_0x72bf('0x4a')]);_0x3c4510[_0x72bf('0x4b')]=qs[_0x72bf('0x42')](_['pick'](_0x53248a[_0x72bf('0x40')],_0x19510d[_0x72bf('0x42')]));_0x3c4510[_0x72bf('0x4b')][_0x72bf('0x65')]=_0x4c913e['id'];if(_0x53248a[_0x72bf('0x40')][_0x72bf('0x4d')]){_0x3c4510[_0x72bf('0x4b')]=_[_0x72bf('0x4e')](_0x3c4510[_0x72bf('0x4b')],{'$or':_[_0x72bf('0x4f')](_0x3c4510[_0x72bf('0x44')],function(_0x15f615){var _0x1684d3={};_0x1684d3[_0x15f615]={'$like':'%'+_0x53248a[_0x72bf('0x40')][_0x72bf('0x4d')]+'%'};return _0x1684d3;})});}_0x3c4510=_[_0x72bf('0x4e')]({},_0x3c4510,_0x53248a['options']);return db[_0x72bf('0x9b')]['count']({'where':_0x3c4510[_0x72bf('0x4b')]})[_0x72bf('0x21')](function(_0xb89b8a){_0x13d647[_0x72bf('0x30')]=_0xb89b8a;if(_0x53248a[_0x72bf('0x40')][_0x72bf('0x52')]){_0x3c4510[_0x72bf('0x58')]=[{'model':db[_0x72bf('0x76')],'as':'Contact','required':![]},{'model':db[_0x72bf('0xa5')],'as':_0x72bf('0xb8'),'attributes':[_0x72bf('0x3b'),'fullname',_0x72bf('0xb9')],'required':![]},{'model':db['Tag'],'as':_0x72bf('0xba'),'attributes':['id','name',_0x72bf('0xbb')],'where':_0x53248a['query'][_0x72bf('0xbc')]?{'id':_0x53248a[_0x72bf('0x40')][_0x72bf('0xbc')]}:undefined,'required':_0x53248a[_0x72bf('0x40')][_0x72bf('0xbc')]?!![]:![]}];}return db[_0x72bf('0x9b')][_0x72bf('0x53')](_0x3c4510);})[_0x72bf('0x21')](function(_0x250619){_0x13d647[_0x72bf('0x54')]=_0x250619;return _0x13d647;});}})[_0x72bf('0x21')](respondWithFilteredResult(_0x11b7ce,_0x3c4510))[_0x72bf('0x2a')](handleError(_0x11b7ce,null));};exports[_0x72bf('0xb1')]=function(_0x1b3759,_0x366409,_0x8ea744){var _0x72d88c,_0x1927dc,_0x374333;if(_[_0x72bf('0x92')](_0x1b3759['body'][_0x72bf('0x5b')])||_0x1b3759[_0x72bf('0x5b')]['body']===''){throw new db[(_0x72bf('0x77'))]['ValidationError'](_0x72bf('0x94'));}if(_[_0x72bf('0x92')](_0x1b3759[_0x72bf('0x5b')]['to'])){throw new db[(_0x72bf('0x77'))][(_0x72bf('0x78'))](_0x72bf('0xbd'));}_0x72d88c=_0x1b3759[_0x72bf('0x5b')]['to'];return db[_0x72bf('0x51')][_0x72bf('0x59')]({'where':{'id':_0x1b3759['params']['id']},'include':[{'model':db[_0x72bf('0x98')],'as':_0x72bf('0xbe'),'include':[{'model':db[_0x72bf('0x76')],'as':'Contacts','where':{'mobile':_0x72d88c},'limit':0x1,'order':[[_0x72bf('0x7b'),_0x72bf('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x366409,null))['then'](function(_0x5f16e0){if(_0x5f16e0&&_0x5f16e0['List']){_0x1927dc=_0x5f16e0[_0x72bf('0x5d')]({'plain':!![]});if(_0x1927dc[_0x72bf('0xbe')]&&_0x1927dc[_0x72bf('0xbe')][_0x72bf('0x99')][_0x72bf('0x46')]){return _0x1927dc[_0x72bf('0xbe')][_0x72bf('0x99')][0x0];}return db[_0x72bf('0x76')]['create'](_[_0x72bf('0xbf')](_0x1b3759[_0x72bf('0x5b')],{'firstName':_0x72d88c,'mobile':_0x72d88c,'phone':_0x72d88c,'ListId':_0x1927dc['ListId']}));}})[_0x72bf('0x21')](handleEntityNotFound(_0x366409,null))[_0x72bf('0x21')](function(_0x1cdc18){if(_0x1cdc18){_0x374333=_0x1cdc18;return db['SmsInteraction'][_0x72bf('0x59')]({'where':{'ContactId':_0x374333['id'],'closed':![],'SmsAccountId':_0x1927dc['id']}})[_0x72bf('0x21')](function(_0x2bef11){if(_0x2bef11){return[_0x2bef11,![]];}return db[_0x72bf('0x9b')][_0x72bf('0x5a')]({'UserId':_0x1b3759[_0x72bf('0x5c')]['id'],'ContactId':_0x374333['id'],'SmsAccountId':_0x1927dc['id'],'phone':_0x72d88c,'firstMsgDirection':'out','Messages':[_[_0x72bf('0x4e')](_0x1b3759[_0x72bf('0x5b')],{'read':![],'body':_0x1b3759[_0x72bf('0x5b')][_0x72bf('0x5b')],'phone':_0x72d88c,'SmsAccountId':_0x1927dc['id'],'UserId':_0x1b3759[_0x72bf('0x5c')]['id'],'ContactId':_0x374333['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x72bf('0xc0')}]})[_0x72bf('0x21')](function(_0x4f835b){return[_0x4f835b,!![]];});});}})[_0x72bf('0x9c')](function(_0x37e0d0,_0xbc619d){if(_0xbc619d){return _0x37e0d0;}return db[_0x72bf('0xa2')][_0x72bf('0x5a')](_[_0x72bf('0x4e')](_0x1b3759[_0x72bf('0x5b')],{'read':![],'body':_0x1b3759[_0x72bf('0x5b')][_0x72bf('0x5b')],'phone':_0x72d88c,'SmsAccountId':_0x1927dc['id'],'SmsInteractionId':_0x37e0d0['id'],'UserId':_0x1b3759[_0x72bf('0x5c')]['id'],'ContactId':_0x374333['id']}))[_0x72bf('0x21')](function(_0x5f121d){_0x37e0d0[_0x72bf('0xc1')][_0x72bf('0xc0')]=[];_0x37e0d0['dataValues'][_0x72bf('0xc0')]['push'](_0x5f121d[_0x72bf('0xc1')]);return _0x37e0d0;});})[_0x72bf('0x21')](respondWithResult(_0x366409,null))[_0x72bf('0x2a')](handleError(_0x366409,null));};exports[_0x72bf('0x2c')]=function(_0x5c1d1d,_0x41510a,_0x4ba1a5){if(_0x5c1d1d[_0x72bf('0x5b')]['id']){delete _0x5c1d1d[_0x72bf('0x5b')]['id'];}var _0x18467d,_0x58ccef,_0xceeae4;return db[_0x72bf('0x51')][_0x72bf('0x59')]({'where':{'id':_0x5c1d1d[_0x72bf('0x62')]['id']}})['then'](handleEntityNotFound(_0x41510a,null))[_0x72bf('0x21')](function(_0x2e25e9){if(_0x2e25e9){_0xceeae4=_0x2e25e9;logger[_0x72bf('0x25')](_0x72bf('0x26'),_0x72bf('0x2c'),_0x72bf('0xc2'),_0x2e25e9['type'],util[_0x72bf('0xc3')](_0x5c1d1d[_0x72bf('0x5b')],{'showHidden':![],'depth':null}));switch(_0x2e25e9[_0x72bf('0x3d')]){case _0x72bf('0x83'):if(_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0xc4')]&&_0x5c1d1d[_0x72bf('0x5b')]['status']){_0x58ccef=_0x5c1d1d['body'][_0x72bf('0x2c')];return db[_0x72bf('0xa2')][_0x72bf('0x59')]({'where':{'messageId':_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0xc4')]}});}break;case _0x72bf('0xc5'):if(_0x5c1d1d[_0x72bf('0x5b')]['requestid']&&_0x5c1d1d['body']['statusInt']){_0x58ccef=_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0xc6')];return db[_0x72bf('0xa2')][_0x72bf('0x59')]({'where':{'messageId':_0x5c1d1d[_0x72bf('0x5b')]['requestid']}});}break;case _0x72bf('0xc7'):if(_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0x87')]&&_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0xc8')]){_0x58ccef=_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0xc8')];return db[_0x72bf('0xa2')][_0x72bf('0x59')]({'where':{'messageId':_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0x87')]}});}break;case _0x72bf('0x8b'):var _0x23671c=_0x5c1d1d['body'][_0x72bf('0x8c')][0x0];if(_0x23671c['messageId']&&_0x23671c[_0x72bf('0x2c')]['groupName']===_0x72bf('0xc9')){_0x58ccef=_0x23671c[_0x72bf('0x2c')][_0x72bf('0xca')];return db[_0x72bf('0xa2')][_0x72bf('0x59')]({'where':{'messageId':_0x23671c[_0x72bf('0x86')]}});}break;case _0x72bf('0xcb'):if(_0x5c1d1d[_0x72bf('0x5b')]['messageId']&&_0x5c1d1d['body'][_0x72bf('0x2c')]){_0x58ccef=_0x5c1d1d['body'][_0x72bf('0x2c')];return db[_0x72bf('0xa2')][_0x72bf('0x59')]({'where':{'messageId':_0x5c1d1d[_0x72bf('0x5b')]['messageId']}});}break;case'bandwidth':if(_0x5c1d1d[_0x72bf('0x5b')][0x0]['message']['id']){_0x58ccef=_0x5c1d1d['body'][0x0][_0x72bf('0x3d')];return db[_0x72bf('0xa2')][_0x72bf('0x59')]({'where':{'messageId':_0x5c1d1d['body'][0x0][_0x72bf('0x28')]['id']}});}break;case'intelepeer':if(_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0xcc')]&&_0x5c1d1d['body'][_0x72bf('0x2c')]){_0x58ccef=_0x5c1d1d[_0x72bf('0x5b')]['status'];return db[_0x72bf('0xa2')][_0x72bf('0x59')]({'where':{'messageId':_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0xcc')]}});}break;}}})[_0x72bf('0x21')](handleEntityNotFound(_0x41510a,null))['then'](function(_0x4c499b){if(_0x4c499b){_0x18467d=_0x4c499b;switch(_0xceeae4[_0x72bf('0x3d')]){case _0x72bf('0x83'):if(_0x58ccef==='DELIVERED'){return _0x18467d[_0x72bf('0x37')]({'read':!![]});}else{logger[_0x72bf('0x27')](_0x72bf('0x26'),'status',_0x72bf('0x83'),util[_0x72bf('0xc3')](_0x5c1d1d[_0x72bf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x72bf('0xc5'):if(_0x58ccef==='1'){return _0x18467d[_0x72bf('0x37')]({'read':!![]});}else{logger[_0x72bf('0x27')](_0x72bf('0x26'),'status',_0x72bf('0x83'),util[_0x72bf('0xc3')](_0x5c1d1d[_0x72bf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x72bf('0xc7'):if(!_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0xcd')]&&_0x58ccef>=0xc8&&_0x58ccef<=0xce){return _0x18467d[_0x72bf('0x37')]({'read':!![]});}else{logger[_0x72bf('0x27')](_0x72bf('0x26'),'status',_0x72bf('0xc7'),util[_0x72bf('0xc3')](_0x5c1d1d[_0x72bf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x72bf('0x8b'):var _0x2d2f02=_0x5c1d1d[_0x72bf('0x5b')][_0x72bf('0x8c')][0x0];if(_0x2d2f02[_0x72bf('0x2c')][_0x72bf('0xca')]===_0x72bf('0xc9')){return _0x18467d[_0x72bf('0x37')]({'read':!![]});}else{logger[_0x72bf('0x27')](_0x72bf('0x26'),_0x72bf('0x2c'),_0x72bf('0x8b'),util[_0x72bf('0xc3')](_0x5c1d1d[_0x72bf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x72bf('0xcb'):if(_0x58ccef==_0x72bf('0xce')||_0x58ccef==_0x72bf('0xcf')){return _0x18467d[_0x72bf('0x37')]({'read':!![]});}else{logger[_0x72bf('0x27')](_0x72bf('0x26'),_0x72bf('0x2c'),'clickatell',util[_0x72bf('0xc3')](_0x5c1d1d[_0x72bf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x72bf('0x90'):if(_0x58ccef=='message-delivered'){return _0x18467d[_0x72bf('0x37')]({'read':!![]});}else{logger[_0x72bf('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x72bf('0x2c'),_0x72bf('0x90'),util['inspect'](_0x5c1d1d[_0x72bf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x72bf('0x91'):if(_0x58ccef===_0x72bf('0xd0')||_0x58ccef===_0x72bf('0xd1')){return _0x18467d[_0x72bf('0x37')]({'read':!![]});}else{logger[_0x72bf('0x27')](_0x72bf('0x26'),'status','intelepeer',util[_0x72bf('0xc3')](_0x5c1d1d[_0x72bf('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x18467d;}})['then'](respondWithResult(_0x41510a,null))[_0x72bf('0x2a')](handleError(_0x41510a,null));};exports[_0x72bf('0xd2')]=function(_0x279f64,_0x3e53d4,_0x430650){var _0x563bfe,_0x4effb9,_0x414eed;return db[_0x72bf('0x51')][_0x72bf('0x59')]({'where':{'id':_0x279f64[_0x72bf('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e53d4,null))[_0x72bf('0x21')](function(_0x14760e){if(_0x14760e){_0x414eed=_0x14760e;logger['debug'](_0x72bf('0x26'),_0x72bf('0x2c'),_0x72bf('0xc2'),_0x14760e[_0x72bf('0x3d')],util[_0x72bf('0xc3')](_0x279f64[_0x72bf('0x40')],{'showHidden':![],'depth':null}));switch(_0x14760e['type']){case'csc':if(_0x279f64['query']['message-id']&&_0x279f64['query'][_0x72bf('0xd3')]){_0x4effb9=_0x279f64[_0x72bf('0x40')][_0x72bf('0xd3')];return db['SmsMessage'][_0x72bf('0x59')]({'where':{'messageId':_0x279f64[_0x72bf('0x40')][_0x72bf('0xd4')]}});}break;}}})['then'](handleEntityNotFound(_0x3e53d4,null))[_0x72bf('0x21')](function(_0x4c0195){if(_0x4c0195){_0x563bfe=_0x4c0195;switch(_0x414eed[_0x72bf('0x3d')]){case _0x72bf('0xd5'):if(_0x4effb9==='2'||_0x4effb9==='6'){return _0x563bfe[_0x72bf('0x37')]({'read':!![]});}else{logger[_0x72bf('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x72bf('0x2c'),_0x72bf('0xd5'),util['inspect'](_0x279f64[_0x72bf('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x563bfe;}})[_0x72bf('0x21')](respondWithResult(_0x3e53d4,null))[_0x72bf('0x2a')](handleError(_0x3e53d4,null));};exports[_0x72bf('0xd6')]=function(_0x560313,_0x1e8ab6,_0x5d76cf){return db[_0x72bf('0x51')]['find']({'where':{'id':_0x560313[_0x72bf('0x62')]['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x1e8ab6,null))['then'](function(_0x426caf){if(_0x426caf){return _0x426caf[_0x72bf('0xd6')](_0x560313[_0x72bf('0x5b')]['ids'],_[_0x72bf('0xd7')](_0x560313[_0x72bf('0x5b')],[_0x72bf('0x6b'),'id'])||{})[_0x72bf('0x9c')](function(_0x504984){for(var _0x535ef2=0x0;_0x535ef2<_0x560313[_0x72bf('0x5b')][_0x72bf('0x6b')][_0x72bf('0x46')];_0x535ef2+=0x1){socket[_0x72bf('0xd8')](_0x72bf('0xd9'),{'UserId':Number(_0x560313[_0x72bf('0x5b')][_0x72bf('0x6b')][_0x535ef2]),'SmsAccountId':Number(_0x560313[_0x72bf('0x62')]['id'])});}return _0x504984;});}})[_0x72bf('0x21')](respondWithResult(_0x1e8ab6,null))[_0x72bf('0x2a')](handleError(_0x1e8ab6,null));};exports[_0x72bf('0xda')]=function(_0x1215dd,_0x2e3c91,_0x185864){return db[_0x72bf('0x51')][_0x72bf('0x59')]({'where':{'id':_0x1215dd[_0x72bf('0x62')]['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x2e3c91,null))[_0x72bf('0x21')](function(_0x294625){if(_0x294625){return _0x294625[_0x72bf('0xda')](_0x1215dd['query']['ids'])[_0x72bf('0x21')](function(){if(_[_0x72bf('0xdb')](_0x1215dd[_0x72bf('0x40')][_0x72bf('0x6b')])){for(var _0x2d45ec=0x0;_0x2d45ec<_0x1215dd[_0x72bf('0x40')]['ids'][_0x72bf('0x46')];_0x2d45ec+=0x1){socket[_0x72bf('0xd8')](_0x72bf('0xdc'),{'UserId':Number(_0x1215dd['query'][_0x72bf('0x6b')][_0x2d45ec]),'SmsAccountId':Number(_0x1215dd[_0x72bf('0x62')]['id'])});}}else{socket[_0x72bf('0xd8')](_0x72bf('0xdc'),{'UserId':Number(_0x1215dd['query'][_0x72bf('0x6b')]),'SmsAccountId':Number(_0x1215dd[_0x72bf('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x2e3c91,null))['catch'](handleError(_0x2e3c91,null));};exports[_0x72bf('0xdd')]=function(_0x2b8e44,_0x55f26e,_0x14ffa4){var _0x4d1af1={};var _0xa3c093={};var _0xe2c857;var _0x488d16;return db[_0x72bf('0x51')][_0x72bf('0x68')]({'where':{'id':_0x2b8e44[_0x72bf('0x62')]['id']}})[_0x72bf('0x21')](handleEntityNotFound(_0x55f26e,null))['then'](function(_0x1a4383){if(_0x1a4383){_0xe2c857=_0x1a4383;_0xa3c093[_0x72bf('0x3f')]=_[_0x72bf('0x41')](db[_0x72bf('0xa5')][_0x72bf('0x69')]);_0xa3c093[_0x72bf('0x40')]=_[_0x72bf('0x41')](_0x2b8e44[_0x72bf('0x40')]);_0xa3c093[_0x72bf('0x42')]=_[_0x72bf('0x43')](_0xa3c093[_0x72bf('0x3f')],_0xa3c093[_0x72bf('0x40')]);_0x4d1af1[_0x72bf('0x44')]=_[_0x72bf('0x43')](_0xa3c093[_0x72bf('0x3f')],qs['fields'](_0x2b8e44[_0x72bf('0x40')][_0x72bf('0x45')]));_0x4d1af1[_0x72bf('0x44')]=_0x4d1af1[_0x72bf('0x44')]['length']?_0x4d1af1['attributes']:_0xa3c093['model'];_0x4d1af1[_0x72bf('0x49')]=qs[_0x72bf('0x4a')](_0x2b8e44[_0x72bf('0x40')]['sort']);_0x4d1af1[_0x72bf('0x4b')]=qs[_0x72bf('0x42')](_[_0x72bf('0x4c')](_0x2b8e44[_0x72bf('0x40')],_0xa3c093['filters']));if(_0x2b8e44[_0x72bf('0x40')][_0x72bf('0x4d')]){_0x4d1af1[_0x72bf('0x4b')]=_[_0x72bf('0x4e')](_0x4d1af1[_0x72bf('0x4b')],{'$or':_['map'](_0x4d1af1[_0x72bf('0x44')],function(_0x14b524){var _0x3edeed={};_0x3edeed[_0x14b524]={'$like':'%'+_0x2b8e44[_0x72bf('0x40')][_0x72bf('0x4d')]+'%'};return _0x3edeed;})});}_0x4d1af1=_[_0x72bf('0x4e')]({},_0x4d1af1,_0x2b8e44[_0x72bf('0x50')]);return _0xe2c857['getAgents'](_0x4d1af1);}})[_0x72bf('0x21')](function(_0x5e20da){if(_0x5e20da){_0x488d16=_0x5e20da[_0x72bf('0x46')];if(!_0x2b8e44[_0x72bf('0x40')]['hasOwnProperty']('nolimit')){_0x4d1af1['limit']=qs['limit'](_0x2b8e44[_0x72bf('0x40')][_0x72bf('0x31')]);_0x4d1af1[_0x72bf('0x2e')]=qs['offset'](_0x2b8e44[_0x72bf('0x40')]['offset']);}return _0xe2c857['getAgents'](_0x4d1af1);}})['then'](function(_0x34fbba){if(_0x34fbba){return _0x34fbba?{'count':_0x488d16,'rows':_0x34fbba}:null;}})['then'](respondWithResult(_0x55f26e,null))[_0x72bf('0x2a')](handleError(_0x55f26e,null));};
\ No newline at end of file
+var _0x6056=['keys','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','sms','SmsApplication','account','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','From','Body','messageId','from','sender','text','connectel','clicksend','plivo','infobip','results','originatingAddress','clickatell','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','SmsInteraction','spread','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','User','UserId','unshift','agent','Start','startRouting','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','json','sequelize','findAndCountAll','priority','getInteractions','Owner','fullname','internal','Tag','Tags','tag','List','out','Messages','dataValues','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','status_code','message_id','groupName','redif','DELIVERED','DELIVERED_TO_GATEWAY','bandwidth','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','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','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','offset','undefined','limit','count','set','apply','save','get','UserProfileResource','destroy','end','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','show','params'];(function(_0x58e0e,_0x122b69){var _0x1b5996=function(_0xe88577){while(--_0xe88577){_0x58e0e['push'](_0x58e0e['shift']());}};_0x1b5996(++_0x122b69);}(_0x6056,0x85));var _0x6605=function(_0x3a4b6c,_0x3b8490){_0x3a4b6c=_0x3a4b6c-0x0;var _0x59b956=_0x6056[_0x3a4b6c];return _0x59b956;};'use strict';var emlformat=require(_0x6605('0x0'));var rimraf=require(_0x6605('0x1'));var zipdir=require(_0x6605('0x2'));var jsonpatch=require(_0x6605('0x3'));var rp=require('request-promise');var moment=require(_0x6605('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6605('0x5'));var util=require(_0x6605('0x6'));var path=require(_0x6605('0x7'));var sox=require(_0x6605('0x8'));var csv=require(_0x6605('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6605('0xa'));var _=require(_0x6605('0xb'));var squel=require(_0x6605('0xc'));var crypto=require(_0x6605('0xd'));var jsforce=require(_0x6605('0xe'));var deskjs=require(_0x6605('0xf'));var toCsv=require(_0x6605('0x9'));var querystring=require(_0x6605('0x10'));var Papa=require(_0x6605('0x11'));var Redis=require(_0x6605('0x12'));var authService=require(_0x6605('0x13'));var qs=require(_0x6605('0x14'));var as=require(_0x6605('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6605('0x16'));var utils=require(_0x6605('0x17'));var config=require(_0x6605('0x18'));var licenseUtil=require(_0x6605('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6605('0x1a')](config[_0x6605('0x1b')],{'host':_0x6605('0x1c'),'port':0x18eb});var socket=require(_0x6605('0x1d'))(new Redis(config[_0x6605('0x1b')]));require(_0x6605('0x1e'))[_0x6605('0x1f')](socket);var jayson=require(_0x6605('0x20'));var client=jayson['client'][_0x6605('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x34732e,_0x10dd05,_0x309a8d,_0x3120a3){return new BPromise(function(_0x10e0c6,_0x39892f){var _0xb3c19c=_0x3120a3||client;return _0xb3c19c[_0x6605('0x22')](_0x34732e,_0x309a8d)[_0x6605('0x23')](function(_0xc3225a){logger[_0x6605('0x24')](_0x6605('0x25'),_0x10dd05,_0x6605('0x26'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x10dd05,_0x6605('0x26'),JSON[_0x6605('0x27')](_0xc3225a));if(_0xc3225a[_0x6605('0x28')]){if(_0xc3225a[_0x6605('0x28')][_0x6605('0x29')]===0x1f4){logger[_0x6605('0x28')]('SmsAccount,\x20%s,\x20%s',_0x10dd05,_0xc3225a[_0x6605('0x28')][_0x6605('0x2a')]);return _0x39892f(_0xc3225a[_0x6605('0x28')]['message']);}logger[_0x6605('0x28')](_0x6605('0x25'),_0x10dd05,_0xc3225a[_0x6605('0x28')][_0x6605('0x2a')]);return _0x10e0c6(_0xc3225a['error'][_0x6605('0x2a')]);}else{logger[_0x6605('0x24')](_0x6605('0x25'),_0x10dd05,_0x6605('0x26'));_0x10e0c6(_0xc3225a[_0x6605('0x2b')][_0x6605('0x2a')]);}})['catch'](function(_0x8f4aff){logger['error']('SmsAccount,\x20%s,\x20%s',_0x10dd05,_0x8f4aff);_0x39892f(_0x8f4aff);});});}function respondWithStatusCode(_0x4cb093,_0x11f3ce){_0x11f3ce=_0x11f3ce||0xcc;return function(_0x5d1d3c){if(_0x5d1d3c){return _0x4cb093['sendStatus'](_0x11f3ce);}return _0x4cb093[_0x6605('0x2c')](_0x11f3ce)['end']();};}function respondWithResult(_0x4ffc9a,_0x11779d){_0x11779d=_0x11779d||0xc8;return function(_0x597237){if(_0x597237){return _0x4ffc9a['status'](_0x11779d)['json'](_0x597237);}};}function respondWithFilteredResult(_0x255cd1,_0xbd0b1a){return function(_0x45ea86){if(_0x45ea86){var _0x3db741=typeof _0xbd0b1a[_0x6605('0x2d')]===_0x6605('0x2e')&&typeof _0xbd0b1a[_0x6605('0x2f')]===_0x6605('0x2e');var _0x26af91=_0x45ea86['count'];var _0x5629f4=_0x3db741?0x0:_0xbd0b1a['offset'];var _0x4ea1a0=_0x3db741?_0x45ea86[_0x6605('0x30')]:_0xbd0b1a[_0x6605('0x2d')]+_0xbd0b1a['limit'];var _0x33d6fc;if(_0x4ea1a0>=_0x26af91){_0x4ea1a0=_0x26af91;_0x33d6fc=0xc8;}else{_0x33d6fc=0xce;}_0x255cd1['status'](_0x33d6fc);return _0x255cd1[_0x6605('0x31')]('Content-Range',_0x5629f4+'-'+_0x4ea1a0+'/'+_0x26af91)['json'](_0x45ea86);}return null;};}function patchUpdates(_0x147b5f){return function(_0x508e02){try{jsonpatch[_0x6605('0x32')](_0x508e02,_0x147b5f,!![]);}catch(_0x28b46c){return BPromise['reject'](_0x28b46c);}return _0x508e02[_0x6605('0x33')]();};}function saveUpdates(_0x8a05e7,_0x5fbdde){return function(_0x58bc26){if(_0x58bc26){return _0x58bc26['update'](_0x8a05e7)[_0x6605('0x23')](function(_0x2644c1){return _0x2644c1;});}return null;};}function removeEntity(_0x5bae35,_0x4b8a8){return function(_0x1549c5){if(_0x1549c5){return _0x1549c5['destroy']()[_0x6605('0x23')](function(){var _0x6d5024=_0x1549c5[_0x6605('0x34')]({'plain':!![]});var _0x52128d='SmsAccounts';return db[_0x6605('0x35')][_0x6605('0x36')]({'where':{'type':_0x52128d,'resourceId':_0x6d5024['id']}})[_0x6605('0x23')](function(){return _0x1549c5;});})[_0x6605('0x23')](function(){_0x5bae35[_0x6605('0x2c')](0xcc)[_0x6605('0x37')]();});}};}function handleEntityNotFound(_0x444ee1,_0x2bd3a6){return function(_0x1ab9c4){if(!_0x1ab9c4){_0x444ee1[_0x6605('0x38')](0x194);}return _0x1ab9c4;};}function handleError(_0x39b64f,_0x5ae452){_0x5ae452=_0x5ae452||0x1f4;return function(_0x12a848){logger['error'](_0x12a848['stack']);if(_0x12a848[_0x6605('0x39')]){delete _0x12a848[_0x6605('0x39')];}_0x39b64f[_0x6605('0x2c')](_0x5ae452)[_0x6605('0x3a')](_0x12a848);};}exports[_0x6605('0x3b')]=function(_0x12d0ed,_0x2f4920){var _0x2a7130={'include':[{'model':db[_0x6605('0x3c')],'as':_0x6605('0x3d')}]},_0x1d0bbe={},_0x9ed7c6={'count':0x0,'rows':[]};var _0x500334=_[_0x6605('0x3e')](db[_0x6605('0x3f')][_0x6605('0x40')],function(_0x1f8ed7){return{'name':_0x1f8ed7[_0x6605('0x41')],'type':_0x1f8ed7[_0x6605('0x42')][_0x6605('0x43')]};});_0x1d0bbe['model']=_[_0x6605('0x3e')](_0x500334,_0x6605('0x39'));_0x1d0bbe[_0x6605('0x44')]=_['keys'](_0x12d0ed[_0x6605('0x44')]);_0x1d0bbe[_0x6605('0x45')]=_[_0x6605('0x46')](_0x1d0bbe[_0x6605('0x47')],_0x1d0bbe[_0x6605('0x44')]);_0x2a7130[_0x6605('0x48')]=_['intersection'](_0x1d0bbe[_0x6605('0x47')],qs[_0x6605('0x49')](_0x12d0ed[_0x6605('0x44')][_0x6605('0x49')]));_0x2a7130['attributes']=_0x2a7130[_0x6605('0x48')][_0x6605('0x4a')]?_0x2a7130[_0x6605('0x48')]:_0x1d0bbe['model'];if(!_0x12d0ed[_0x6605('0x44')][_0x6605('0x4b')](_0x6605('0x4c'))){_0x2a7130[_0x6605('0x2f')]=qs[_0x6605('0x2f')](_0x12d0ed['query'][_0x6605('0x2f')]);_0x2a7130[_0x6605('0x2d')]=qs['offset'](_0x12d0ed[_0x6605('0x44')]['offset']);}_0x2a7130[_0x6605('0x4d')]=qs[_0x6605('0x4e')](_0x12d0ed['query']['sort']);_0x2a7130[_0x6605('0x4f')]=qs[_0x6605('0x45')](_['pick'](_0x12d0ed[_0x6605('0x44')],_0x1d0bbe[_0x6605('0x45')]),_0x500334);if(_0x12d0ed['query']['filter']){_0x2a7130['where']=_[_0x6605('0x50')](_0x2a7130[_0x6605('0x4f')],{'$or':_['map'](_0x500334,function(_0x16c04c){if(_0x16c04c[_0x6605('0x42')]!=='VIRTUAL'){var _0x33cf46={};_0x33cf46[_0x16c04c[_0x6605('0x39')]]={'$like':'%'+_0x12d0ed[_0x6605('0x44')][_0x6605('0x51')]+'%'};return _0x33cf46;}})});}_0x2a7130=_[_0x6605('0x50')]({},_0x2a7130,_0x12d0ed[_0x6605('0x52')]);var _0x5498f5={'where':_0x2a7130[_0x6605('0x4f')]};return db[_0x6605('0x3f')][_0x6605('0x30')](_0x5498f5)[_0x6605('0x23')](function(_0x452bee){_0x9ed7c6[_0x6605('0x30')]=_0x452bee;if(_0x12d0ed[_0x6605('0x44')][_0x6605('0x53')]){_0x2a7130[_0x6605('0x54')]=[{'all':!![]}];}return db[_0x6605('0x3f')][_0x6605('0x55')](_0x2a7130);})[_0x6605('0x23')](function(_0x3872a5){_0x9ed7c6['rows']=_0x3872a5;return _0x9ed7c6;})[_0x6605('0x23')](respondWithFilteredResult(_0x2f4920,_0x2a7130))['catch'](handleError(_0x2f4920,null));};exports[_0x6605('0x56')]=function(_0xdbe4b2,_0x2e3b69){var _0xe15d42={'raw':![],'where':{'id':_0xdbe4b2[_0x6605('0x57')]['id']},'include':[{'model':db[_0x6605('0x3c')],'as':_0x6605('0x3d')}]},_0x4178ee={};_0x4178ee[_0x6605('0x47')]=_[_0x6605('0x58')](db[_0x6605('0x3f')][_0x6605('0x40')]);_0x4178ee['query']=_[_0x6605('0x58')](_0xdbe4b2['query']);_0x4178ee[_0x6605('0x45')]=_[_0x6605('0x46')](_0x4178ee[_0x6605('0x47')],_0x4178ee[_0x6605('0x44')]);_0xe15d42[_0x6605('0x48')]=_[_0x6605('0x46')](_0x4178ee[_0x6605('0x47')],qs['fields'](_0xdbe4b2['query'][_0x6605('0x49')]));_0xe15d42[_0x6605('0x48')]=_0xe15d42[_0x6605('0x48')][_0x6605('0x4a')]?_0xe15d42[_0x6605('0x48')]:_0x4178ee['model'];if(_0xdbe4b2[_0x6605('0x44')][_0x6605('0x53')]){_0xe15d42[_0x6605('0x54')]=[{'all':!![]}];}_0xe15d42=_['merge']({},_0xe15d42,_0xdbe4b2[_0x6605('0x52')]);return db[_0x6605('0x3f')]['find'](_0xe15d42)[_0x6605('0x23')](handleEntityNotFound(_0x2e3b69,null))['then'](respondWithResult(_0x2e3b69,null))['catch'](handleError(_0x2e3b69,null));};exports[_0x6605('0x59')]=function(_0x4e9a0f,_0x25bdd1){return db[_0x6605('0x3f')][_0x6605('0x59')](_0x4e9a0f['body'],{})[_0x6605('0x23')](function(_0x3ce031){var _0x532885=_0x4e9a0f['user'][_0x6605('0x34')]({'plain':!![]});if(!_0x532885)throw new Error(_0x6605('0x5a'));if(_0x532885[_0x6605('0x5b')]===_0x6605('0x5c')){var _0x4a5f82=_0x3ce031['get']({'plain':!![]});var _0xe3b783='SmsAccounts';return db[_0x6605('0x5d')][_0x6605('0x5e')]({'where':{'name':_0xe3b783,'userProfileId':_0x532885['userProfileId']},'raw':!![]})[_0x6605('0x23')](function(_0x464d32){if(_0x464d32&&_0x464d32[_0x6605('0x5f')]===0x0){return db[_0x6605('0x35')][_0x6605('0x59')]({'name':_0x4a5f82[_0x6605('0x39')],'resourceId':_0x4a5f82['id'],'type':_0x464d32[_0x6605('0x39')],'sectionId':_0x464d32['id']},{})[_0x6605('0x23')](function(){return _0x3ce031;});}else{return _0x3ce031;}})[_0x6605('0x60')](function(_0x1f9a46){logger[_0x6605('0x28')](_0x6605('0x61'),_0x1f9a46);throw _0x1f9a46;});}return _0x3ce031;})[_0x6605('0x23')](respondWithResult(_0x25bdd1,0xc9))['catch'](handleError(_0x25bdd1,null));};exports[_0x6605('0x62')]=function(_0x19a62f,_0xb818ef){if(_0x19a62f[_0x6605('0x63')]['id']){delete _0x19a62f['body']['id'];}return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x19a62f['params']['id']},'include':[{'model':db[_0x6605('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xb818ef,null))['then'](saveUpdates(_0x19a62f['body'],null))[_0x6605('0x23')](respondWithResult(_0xb818ef,null))[_0x6605('0x60')](handleError(_0xb818ef,null));};exports[_0x6605('0x36')]=function(_0x44b9ac,_0x4d4d90){return db['SmsAccount'][_0x6605('0x5e')]({'where':{'id':_0x44b9ac[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x4d4d90,null))[_0x6605('0x23')](removeEntity(_0x4d4d90,null))[_0x6605('0x60')](handleError(_0x4d4d90,null));};exports[_0x6605('0x64')]=function(_0x385a1a,_0x1089a2){return db[_0x6605('0x3f')]['describe']()['then'](respondWithResult(_0x1089a2,null))['catch'](handleError(_0x1089a2,null));};exports[_0x6605('0x65')]=function(_0x51b506,_0x36a45e,_0x45c532){if(_0x51b506['body']['id']){delete _0x51b506[_0x6605('0x63')]['id'];}return db['SmsAccount'][_0x6605('0x5e')]({'where':{'id':_0x51b506[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x36a45e,null))[_0x6605('0x23')](function(_0x465b47){if(_0x465b47){_0x51b506[_0x6605('0x63')][_0x6605('0x66')]=_0x465b47['id'];return db[_0x6605('0x67')][_0x6605('0x59')](_0x51b506[_0x6605('0x63')]);}})[_0x6605('0x23')](respondWithResult(_0x36a45e,null))['catch'](handleError(_0x36a45e,null));};exports[_0x6605('0x68')]=function(_0x368bc5,_0x52dc7d,_0x447580){var _0x54d92b={'raw':![],'where':{}};var _0x13f69b={};var _0x470f7d={'count':0x0,'rows':[]};return db[_0x6605('0x3f')][_0x6605('0x69')]({'where':{'id':_0x368bc5[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x52dc7d,null))['then'](function(_0x2d2f6e){if(_0x2d2f6e){_0x13f69b[_0x6605('0x47')]=_['keys'](db[_0x6605('0x67')][_0x6605('0x40')]);_0x13f69b[_0x6605('0x44')]=_[_0x6605('0x58')](_0x368bc5[_0x6605('0x44')]);_0x13f69b['filters']=_[_0x6605('0x46')](_0x13f69b['model'],_0x13f69b[_0x6605('0x44')]);_0x54d92b[_0x6605('0x48')]=_[_0x6605('0x46')](_0x13f69b['model'],qs['fields'](_0x368bc5['query'][_0x6605('0x49')]));_0x54d92b[_0x6605('0x48')]=_0x54d92b[_0x6605('0x48')][_0x6605('0x4a')]?_0x54d92b[_0x6605('0x48')]:_0x13f69b[_0x6605('0x47')];if(!_0x368bc5['query'][_0x6605('0x4b')](_0x6605('0x4c'))){_0x54d92b[_0x6605('0x2f')]=qs[_0x6605('0x2f')](_0x368bc5[_0x6605('0x44')][_0x6605('0x2f')]);_0x54d92b[_0x6605('0x2d')]=qs[_0x6605('0x2d')](_0x368bc5[_0x6605('0x44')][_0x6605('0x2d')]);}_0x54d92b[_0x6605('0x4d')]=qs[_0x6605('0x4e')](_0x368bc5[_0x6605('0x44')][_0x6605('0x4e')]);_0x54d92b[_0x6605('0x4f')]=qs['filters'](_['pick'](_0x368bc5[_0x6605('0x44')],_0x13f69b[_0x6605('0x45')]));_0x54d92b[_0x6605('0x4f')][_0x6605('0x66')]=_0x2d2f6e['id'];if(_0x368bc5[_0x6605('0x44')][_0x6605('0x51')]){_0x54d92b[_0x6605('0x4f')]=_[_0x6605('0x50')](_0x54d92b[_0x6605('0x4f')],{'$or':_['map'](_0x54d92b[_0x6605('0x48')],function(_0xfc6ab3){var _0x46cac0={};_0x46cac0[_0xfc6ab3]={'$like':'%'+_0x368bc5[_0x6605('0x44')][_0x6605('0x51')]+'%'};return _0x46cac0;})});}_0x54d92b=_[_0x6605('0x50')]({},_0x54d92b,_0x368bc5[_0x6605('0x52')]);return db[_0x6605('0x67')][_0x6605('0x30')]({'where':_0x54d92b[_0x6605('0x4f')]})[_0x6605('0x23')](function(_0x143bc0){_0x470f7d[_0x6605('0x30')]=_0x143bc0;if(_0x368bc5[_0x6605('0x44')]['includeAll']){_0x54d92b['include']=[{'all':!![]}];}return db[_0x6605('0x67')][_0x6605('0x55')](_0x54d92b);})['then'](function(_0x2928dc){_0x470f7d[_0x6605('0x6a')]=_0x2928dc;return _0x470f7d;});}})[_0x6605('0x23')](respondWithFilteredResult(_0x52dc7d,_0x54d92b))[_0x6605('0x60')](handleError(_0x52dc7d,null));};exports[_0x6605('0x6b')]=function(_0x47b3b8,_0x343c24,_0x5fef33){return db['SmsAccount'][_0x6605('0x5e')]({'where':{'id':_0x47b3b8[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x343c24,null))[_0x6605('0x23')](function(_0x3563aa){if(_0x3563aa){return _0x3563aa['removeDispositions'](_0x47b3b8['query'][_0x6605('0x6c')]);}})[_0x6605('0x23')](respondWithStatusCode(_0x343c24,null))['catch'](handleError(_0x343c24,null));};exports[_0x6605('0x6d')]=function(_0x324588,_0x57af2d,_0x38dbda){if(_0x324588[_0x6605('0x63')]['id']){delete _0x324588['body']['id'];}return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x324588[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x57af2d,null))['then'](function(_0x3f1c26){if(_0x3f1c26){_0x324588[_0x6605('0x63')][_0x6605('0x66')]=_0x3f1c26['id'];return db[_0x6605('0x6e')][_0x6605('0x59')](_0x324588[_0x6605('0x63')]);}})[_0x6605('0x23')](respondWithResult(_0x57af2d,null))[_0x6605('0x60')](handleError(_0x57af2d,null));};exports[_0x6605('0x6f')]=function(_0x41638c,_0x4941f1,_0x4ad319){var _0x1ed53c={'raw':![],'where':{}};var _0x372669={};var _0x1a661c={'count':0x0,'rows':[]};return db[_0x6605('0x3f')][_0x6605('0x69')]({'where':{'id':_0x41638c[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x4941f1,null))[_0x6605('0x23')](function(_0x1e8074){if(_0x1e8074){_0x372669[_0x6605('0x47')]=_[_0x6605('0x58')](db[_0x6605('0x6e')][_0x6605('0x40')]);_0x372669[_0x6605('0x44')]=_[_0x6605('0x58')](_0x41638c['query']);_0x372669[_0x6605('0x45')]=_['intersection'](_0x372669[_0x6605('0x47')],_0x372669[_0x6605('0x44')]);_0x1ed53c[_0x6605('0x48')]=_[_0x6605('0x46')](_0x372669['model'],qs[_0x6605('0x49')](_0x41638c['query'][_0x6605('0x49')]));_0x1ed53c[_0x6605('0x48')]=_0x1ed53c[_0x6605('0x48')][_0x6605('0x4a')]?_0x1ed53c[_0x6605('0x48')]:_0x372669['model'];if(!_0x41638c['query'][_0x6605('0x4b')](_0x6605('0x4c'))){_0x1ed53c[_0x6605('0x2f')]=qs[_0x6605('0x2f')](_0x41638c['query'][_0x6605('0x2f')]);_0x1ed53c['offset']=qs[_0x6605('0x2d')](_0x41638c[_0x6605('0x44')]['offset']);}_0x1ed53c[_0x6605('0x4d')]=qs[_0x6605('0x4e')](_0x41638c[_0x6605('0x44')][_0x6605('0x4e')]);_0x1ed53c[_0x6605('0x4f')]=qs['filters'](_[_0x6605('0x70')](_0x41638c[_0x6605('0x44')],_0x372669['filters']));_0x1ed53c[_0x6605('0x4f')]['SmsAccountId']=_0x1e8074['id'];if(_0x41638c[_0x6605('0x44')]['filter']){_0x1ed53c[_0x6605('0x4f')]=_[_0x6605('0x50')](_0x1ed53c[_0x6605('0x4f')],{'$or':_['map'](_0x1ed53c[_0x6605('0x48')],function(_0x547638){var _0x53332f={};_0x53332f[_0x547638]={'$like':'%'+_0x41638c[_0x6605('0x44')][_0x6605('0x51')]+'%'};return _0x53332f;})});}_0x1ed53c=_[_0x6605('0x50')]({},_0x1ed53c,_0x41638c['options']);return db[_0x6605('0x6e')][_0x6605('0x30')]({'where':_0x1ed53c[_0x6605('0x4f')]})[_0x6605('0x23')](function(_0x477d7d){_0x1a661c[_0x6605('0x30')]=_0x477d7d;if(_0x41638c[_0x6605('0x44')][_0x6605('0x53')]){_0x1ed53c['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x6605('0x55')](_0x1ed53c);})['then'](function(_0x742adc){_0x1a661c[_0x6605('0x6a')]=_0x742adc;return _0x1a661c;});}})[_0x6605('0x23')](respondWithFilteredResult(_0x4941f1,_0x1ed53c))[_0x6605('0x60')](handleError(_0x4941f1,null));};exports[_0x6605('0x71')]=function(_0x30215b,_0x45ce71,_0x16a943){return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x30215b['params']['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x45ce71,null))[_0x6605('0x23')](function(_0x46757a){if(_0x46757a){return _0x46757a[_0x6605('0x71')](_0x30215b['query']['ids']);}})['then'](respondWithStatusCode(_0x45ce71,null))[_0x6605('0x60')](handleError(_0x45ce71,null));};exports['notify']=function(_0x2e0875,_0xdbfe90,_0x2a1d7c){var _0x1ea851={'channel':_0x6605('0x72')};var _0x573b7e=[];var _0x393159=[];var _0x492d29={};return db[_0x6605('0x3f')]['find']({'where':{'id':_0x2e0875[_0x6605('0x57')]['id']},'include':[{'model':db[_0x6605('0x73')],'as':'Applications'}]})['then'](handleEntityNotFound(_0xdbfe90,null))[_0x6605('0x23')](function(_0x2e11c9){_0x1ea851[_0x6605('0x74')]=_0x2e11c9;_0x1ea851['applications']=_[_0x6605('0x75')](_0x2e11c9[_0x6605('0x76')],['priority'],[_0x6605('0x77')]);if(_0x1ea851[_0x6605('0x74')][_0x6605('0x76')]){delete _0x1ea851['account']['Applications'];}return db[_0x6605('0x78')]['describe']();})[_0x6605('0x23')](function(_0x2195de){if(!_0x2195de){throw new db[(_0x6605('0x79'))][(_0x6605('0x7a'))](_0x6605('0x7b'));}_0x573b7e=_[_0x6605('0x7c')](_[_0x6605('0x58')](_0x2195de),[_0x6605('0x7d'),_0x6605('0x7e')]);_0x393159=_[_0x6605('0x7c')](_['keys'](_0x2195de),[_0x6605('0x7d'),'updatedAt','CompanyId',_0x6605('0x7f')]);_0x1ea851[_0x6605('0x63')]={'mapKey':_0x6605('0x80')};if(_0x1ea851['account'][_0x6605('0x42')]){switch(_0x1ea851[_0x6605('0x74')]['type']){case _0x6605('0x81'):_0x1ea851[_0x6605('0x63')]['from']=_0x2e0875[_0x6605('0x63')][_0x6605('0x82')];_0x1ea851['body']['body']=_0x2e0875[_0x6605('0x63')][_0x6605('0x83')];_0x1ea851[_0x6605('0x63')][_0x6605('0x84')]=_0x2e0875[_0x6605('0x63')]['MessageSid'];break;case'skebby':_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]='+'+_0x2e0875[_0x6605('0x63')][_0x6605('0x86')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x87')];break;case _0x6605('0x88'):_0x1ea851['body'][_0x6605('0x85')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x85')];_0x1ea851[_0x6605('0x63')]['body']=_0x2e0875['body'][_0x6605('0x2a')];break;case _0x6605('0x89'):_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]=_0x2e0875['body']['from'];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875['body'][_0x6605('0x63')];_0x1ea851[_0x6605('0x63')][_0x6605('0x84')]=_0x2e0875['body']['message_id'];break;case _0x6605('0x8a'):_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x82')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')]['Text'];_0x1ea851[_0x6605('0x63')]['messageId']=_0x2e0875[_0x6605('0x63')]['MessageUUID'];break;case _0x6605('0x8b'):_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]='+'+_0x2e0875[_0x6605('0x63')][_0x6605('0x8c')][0x0][_0x6605('0x85')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x8c')][0x0][_0x6605('0x87')];_0x1ea851['body']['messageId']=_0x2e0875[_0x6605('0x63')][_0x6605('0x8c')][0x0][_0x6605('0x84')];break;case'csc':_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x8d')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')]['segmentedMessage'][_0x6605('0x2a')];break;case _0x6605('0x8e'):_0x1ea851['body'][_0x6605('0x85')]=_0x2e0875['body']['fromNumber'];_0x1ea851['body'][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x87')];_0x1ea851[_0x6605('0x63')][_0x6605('0x84')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x8f')];break;case'bandwidth':_0x1ea851[_0x6605('0x63')][_0x6605('0x84')]=_0x2e0875[_0x6605('0x63')][0x0][_0x6605('0x2a')]['id'];_0x1ea851[_0x6605('0x63')]['from']=_0x2e0875['body'][0x0][_0x6605('0x2a')][_0x6605('0x85')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')][0x0]['message'][_0x6605('0x87')];break;case _0x6605('0x90'):_0x1ea851[_0x6605('0x63')]['from']=_0x2e0875[_0x6605('0x63')][_0x6605('0x85')];_0x1ea851['body']['body']=_0x2e0875[_0x6605('0x63')]['message'];_0x1ea851['body'][_0x6605('0x84')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x91')];break;}}if(_0x1ea851[_0x6605('0x63')]['id']){delete _0x1ea851[_0x6605('0x63')]['id'];}if(_[_0x6605('0x92')](_0x1ea851[_0x6605('0x63')]['from'])){throw new db[(_0x6605('0x79'))]['ValidationError'](_0x6605('0x93'));}if(_[_0x6605('0x92')](_0x1ea851[_0x6605('0x63')][_0x6605('0x63')])||_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]===''){throw new db[(_0x6605('0x79'))]['ValidationError'](_0x6605('0x94'));}if(_['isNil'](_0x1ea851['body'][_0x6605('0x95')])){throw new db[(_0x6605('0x79'))][(_0x6605('0x7a'))](_0x6605('0x96')+_0x393159);}if(!_[_0x6605('0x97')](_0x393159,_0x1ea851[_0x6605('0x63')][_0x6605('0x95')])){throw new db[(_0x6605('0x79'))][(_0x6605('0x7a'))](_0x6605('0x98')+_0x393159);}_0x492d29[_0x1ea851[_0x6605('0x63')][_0x6605('0x95')]]=_0x1ea851['body'][_0x6605('0x85')];return db[_0x6605('0x99')][_0x6605('0x5e')]({'where':{'id':_0x1ea851[_0x6605('0x74')][_0x6605('0x7f')]},'include':[{'model':db[_0x6605('0x78')],'as':'Contacts','where':_0x492d29,'limit':0x1,'order':[[_0x6605('0x7e'),_0x6605('0x9a')]]}]});})[_0x6605('0x23')](handleEntityNotFound(_0xdbfe90,null))[_0x6605('0x23')](function(_0x214530){if(_0x214530){_0x1ea851[_0x6605('0x9b')]=_[_0x6605('0x9c')](_0x214530,[_0x6605('0x9d')]);if(_0x214530['Contacts'][_0x6605('0x4a')]){return _0x214530[_0x6605('0x9d')][0x0];}var _0x4a0366=_[_0x6605('0x1a')](_0x1ea851[_0x6605('0x63')],{'firstName':_0x1ea851[_0x6605('0x63')][_0x6605('0x85')],'ListId':_0x214530['id']});_0x4a0366[_0x1ea851[_0x6605('0x63')]['mapKey']]=_0x1ea851['body'][_0x6605('0x85')];return db[_0x6605('0x78')][_0x6605('0x59')](_0x4a0366,{'fields':_0x573b7e,'raw':!![]});}})[_0x6605('0x23')](handleEntityNotFound(_0xdbfe90,null))[_0x6605('0x23')](function(_0x2b6d90){if(_0x2b6d90){_0x1ea851['contact']=_0x2b6d90;var _0x299cb7={'ContactId':_0x2b6d90['id'],'phone':_0x1ea851[_0x6605('0x63')][_0x6605('0x85')],'SmsAccountId':_0x2e0875[_0x6605('0x57')]['id']};var _0x2a662b={'ContactId':_0x2b6d90['id'],'SmsAccountId':_0x2e0875[_0x6605('0x57')]['id'],'closed':![]};return db[_0x6605('0x9e')][_0x6605('0x5e')]({'where':_0x2a662b})[_0x6605('0x23')](function(_0x1e1dfd){if(_0x1e1dfd){return[_0x1e1dfd,![]];}return db[_0x6605('0x9e')][_0x6605('0x59')](_0x299cb7)[_0x6605('0x23')](function(_0xf5f993){return[_0xf5f993,!![]];});});}})[_0x6605('0x9f')](function(_0x4e6723,_0x50a29f){_0x1ea851[_0x6605('0xa0')]=_0x4e6723['get']({'plain':!![]});_0x1ea851[_0x6605('0xa0')][_0x6605('0xa1')]=![];if(_0x50a29f){if(_0x1ea851[_0x6605('0x74')][_0x6605('0xa2')]){_0x1ea851['applications'][_0x6605('0xa3')]({'id':0x0,'priority':_0x1ea851[_0x6605('0xa4')][_0x6605('0x4a')]+0x1,'app':_0x6605('0xa5'),'appdata':_0x6605('0xa6'),'interval':_0x6605('0xa7')});}_0x1ea851['interaction'][_0x6605('0xa1')]=!![];}return db[_0x6605('0xa8')][_0x6605('0x59')]({'phone':_0x1ea851['body'][_0x6605('0x85')],'messageId':_0x1ea851[_0x6605('0x63')][_0x6605('0x84')],'body':_0x1ea851[_0x6605('0x63')]['body'],'SmsAccountId':_0x2e0875['params']['id'],'SmsInteractionId':_0x4e6723['id'],'direction':'in','ContactId':_0x4e6723['ContactId'],'AttachmentId':_0x1ea851[_0x6605('0x63')][_0x6605('0xa9')]});})[_0x6605('0x23')](function(_0x50efeb){_0x1ea851[_0x6605('0x2a')]=_0x50efeb;if(_0x1ea851[_0x6605('0xa0')]['UserId']){return db[_0x6605('0xaa')][_0x6605('0x5e')]({'attributes':['id',_0x6605('0x39')],'where':{'id':_0x1ea851['interaction'][_0x6605('0xab')]}})['then'](function(_0x19d619){if(_0x19d619){_0x1ea851['applications'][_0x6605('0xac')]({'id':0x0,'priority':0x0,'app':_0x6605('0xad'),'appdata':_0x19d619['name']+','+(_0x1ea851['account']['waitForTheAssignedAgent']||0xa),'interval':_0x6605('0xa7')});}return respondWithRpcPromise(_0x6605('0xae'),'startRouting',_0x1ea851);});}return respondWithRpcPromise(_0x6605('0xae'),_0x6605('0xaf'),_0x1ea851);})[_0x6605('0x23')](function(_0x1442ca){if(_0x1442ca){var _0x2627d1=0xc8;var _0x19af46='receiveMessage';logger[_0x6605('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x19af46,_0x2627d1,'entity\x20found');logger[_0x6605('0xb0')](_0x6605('0xb1'),_0x19af46,_0x2627d1,'entity\x20found',JSON[_0x6605('0x27')](_0x1442ca));if(_0x1ea851[_0x6605('0x74')][_0x6605('0x42')]===_0x6605('0x81')){return _0xdbfe90[_0x6605('0x2c')](_0x2627d1)[_0x6605('0x31')](_0x6605('0xb2'),'text/xml')[_0x6605('0x3a')](_0x6605('0xb3'));}else{return _0xdbfe90['status'](_0x2627d1)[_0x6605('0xb4')](_0x1442ca);}}})['catch'](handleError(_0xdbfe90,null));};exports['addApplications']=function(_0x351427,_0x1fd492,_0x45a2a9){return db[_0x6605('0x3f')][_0x6605('0x69')]({'where':{'id':_0x351427[_0x6605('0x57')]['id']}})['then'](handleEntityNotFound(_0x1fd492,null))[_0x6605('0x23')](function(_0x249d94){if(_0x249d94){return db[_0x6605('0xb5')]['transaction'](function(_0x5bfc18){return db[_0x6605('0x73')][_0x6605('0x36')]({'where':{'SmsAccountId':_0x351427['params']['id']},'transaction':_0x5bfc18})[_0x6605('0x23')](function(_0xf69fbb){var _0x6a9ada=_[_0x6605('0x3e')](_0x351427['body'],function(_0x494350){_0x494350[_0x6605('0x66')]=_0x351427[_0x6605('0x57')]['id'];return _0x494350;});return db[_0x6605('0x73')]['bulkCreate'](_0x6a9ada,{'transaction':_0x5bfc18});});})[_0x6605('0x23')](function(){return db[_0x6605('0x73')][_0x6605('0xb6')]({'where':{'SmsAccountId':_0x351427[_0x6605('0x57')]['id']},'order':_0x6605('0xb7')});});}})[_0x6605('0x23')](respondWithResult(_0x1fd492,null))[_0x6605('0x60')](handleError(_0x1fd492,null));};exports['getApplications']=function(_0x393e94,_0x443786,_0x46dd02){var _0xbde371={};var _0x460908={};var _0x24cd67;var _0x18605c;return db[_0x6605('0x3f')]['findOne']({'where':{'id':_0x393e94['params']['id']}})['then'](handleEntityNotFound(_0x443786,null))[_0x6605('0x23')](function(_0x6db979){if(_0x6db979){_0x24cd67=_0x6db979;_0x460908[_0x6605('0x47')]=_['keys'](db[_0x6605('0x73')][_0x6605('0x40')]);_0x460908[_0x6605('0x44')]=_[_0x6605('0x58')](_0x393e94['query']);_0x460908[_0x6605('0x45')]=_[_0x6605('0x46')](_0x460908[_0x6605('0x47')],_0x460908['query']);_0xbde371['attributes']=_[_0x6605('0x46')](_0x460908[_0x6605('0x47')],qs[_0x6605('0x49')](_0x393e94[_0x6605('0x44')][_0x6605('0x49')]));_0xbde371[_0x6605('0x48')]=_0xbde371[_0x6605('0x48')][_0x6605('0x4a')]?_0xbde371['attributes']:_0x460908[_0x6605('0x47')];_0xbde371[_0x6605('0x4d')]=qs['sort'](_0x393e94[_0x6605('0x44')][_0x6605('0x4e')]);_0xbde371[_0x6605('0x4f')]=qs[_0x6605('0x45')](_[_0x6605('0x70')](_0x393e94[_0x6605('0x44')],_0x460908[_0x6605('0x45')]));if(_0x393e94[_0x6605('0x44')][_0x6605('0x51')]){_0xbde371[_0x6605('0x4f')]=_['merge'](_0xbde371[_0x6605('0x4f')],{'$or':_[_0x6605('0x3e')](_0xbde371[_0x6605('0x48')],function(_0x5df49f){var _0x14500c={};_0x14500c[_0x5df49f]={'$like':'%'+_0x393e94['query'][_0x6605('0x51')]+'%'};return _0x14500c;})});}_0xbde371=_[_0x6605('0x50')]({},_0xbde371,_0x393e94[_0x6605('0x52')]);return _0x24cd67['getApplications'](_0xbde371);}})['then'](function(_0x2f7bfd){if(_0x2f7bfd){_0x18605c=_0x2f7bfd['length'];if(!_0x393e94[_0x6605('0x44')][_0x6605('0x4b')](_0x6605('0x4c'))){_0xbde371[_0x6605('0x2f')]=qs['limit'](_0x393e94[_0x6605('0x44')][_0x6605('0x2f')]);_0xbde371[_0x6605('0x2d')]=qs[_0x6605('0x2d')](_0x393e94[_0x6605('0x44')][_0x6605('0x2d')]);}return _0x24cd67['getApplications'](_0xbde371);}})['then'](function(_0x22422e){if(_0x22422e){return _0x22422e?{'count':_0x18605c,'rows':_0x22422e}:null;}})[_0x6605('0x23')](respondWithResult(_0x443786,null))[_0x6605('0x60')](handleError(_0x443786,null));};exports[_0x6605('0xb8')]=function(_0x4b786b,_0x32d0d7,_0x354701){var _0x2bd6c9={'raw':![],'where':{}};var _0x56d1a2={};var _0x2c6f49={'count':0x0,'rows':[]};return db[_0x6605('0x3f')]['findOne']({'where':{'id':_0x4b786b[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x32d0d7,null))['then'](function(_0xdd06f3){if(_0xdd06f3){_0x56d1a2[_0x6605('0x47')]=_[_0x6605('0x58')](db['SmsInteraction'][_0x6605('0x40')]);_0x56d1a2[_0x6605('0x44')]=_[_0x6605('0x58')](_0x4b786b[_0x6605('0x44')]);_0x56d1a2[_0x6605('0x45')]=_[_0x6605('0x46')](_0x56d1a2[_0x6605('0x47')],_0x56d1a2[_0x6605('0x44')]);_0x2bd6c9['attributes']=_[_0x6605('0x46')](_0x56d1a2[_0x6605('0x47')],qs[_0x6605('0x49')](_0x4b786b[_0x6605('0x44')]['fields']));_0x2bd6c9[_0x6605('0x48')]=_0x2bd6c9[_0x6605('0x48')][_0x6605('0x4a')]?_0x2bd6c9['attributes']:_0x56d1a2[_0x6605('0x47')];if(!_0x4b786b[_0x6605('0x44')][_0x6605('0x4b')](_0x6605('0x4c'))){_0x2bd6c9['limit']=qs[_0x6605('0x2f')](_0x4b786b[_0x6605('0x44')][_0x6605('0x2f')]);_0x2bd6c9[_0x6605('0x2d')]=qs[_0x6605('0x2d')](_0x4b786b[_0x6605('0x44')]['offset']);}_0x2bd6c9['order']=qs[_0x6605('0x4e')](_0x4b786b[_0x6605('0x44')]['sort']);_0x2bd6c9['where']=qs[_0x6605('0x45')](_[_0x6605('0x70')](_0x4b786b[_0x6605('0x44')],_0x56d1a2[_0x6605('0x45')]));_0x2bd6c9[_0x6605('0x4f')][_0x6605('0x66')]=_0xdd06f3['id'];if(_0x4b786b['query'][_0x6605('0x51')]){_0x2bd6c9[_0x6605('0x4f')]=_[_0x6605('0x50')](_0x2bd6c9[_0x6605('0x4f')],{'$or':_[_0x6605('0x3e')](_0x2bd6c9[_0x6605('0x48')],function(_0x2bc76c){var _0x29342f={};_0x29342f[_0x2bc76c]={'$like':'%'+_0x4b786b[_0x6605('0x44')][_0x6605('0x51')]+'%'};return _0x29342f;})});}_0x2bd6c9=_['merge']({},_0x2bd6c9,_0x4b786b[_0x6605('0x52')]);return db[_0x6605('0x9e')][_0x6605('0x30')]({'where':_0x2bd6c9[_0x6605('0x4f')]})[_0x6605('0x23')](function(_0x2748f9){_0x2c6f49[_0x6605('0x30')]=_0x2748f9;if(_0x4b786b[_0x6605('0x44')][_0x6605('0x53')]){_0x2bd6c9[_0x6605('0x54')]=[{'model':db[_0x6605('0x78')],'as':'Contact','required':![]},{'model':db[_0x6605('0xaa')],'as':_0x6605('0xb9'),'attributes':['name',_0x6605('0xba'),_0x6605('0xbb')],'required':![]},{'model':db[_0x6605('0xbc')],'as':_0x6605('0xbd'),'attributes':['id','name','color'],'where':_0x4b786b[_0x6605('0x44')][_0x6605('0xbe')]?{'id':_0x4b786b[_0x6605('0x44')][_0x6605('0xbe')]}:undefined,'required':_0x4b786b['query'][_0x6605('0xbe')]?!![]:![]}];}return db[_0x6605('0x9e')][_0x6605('0x55')](_0x2bd6c9);})[_0x6605('0x23')](function(_0x2a7497){_0x2c6f49[_0x6605('0x6a')]=_0x2a7497;return _0x2c6f49;});}})[_0x6605('0x23')](respondWithFilteredResult(_0x32d0d7,_0x2bd6c9))[_0x6605('0x60')](handleError(_0x32d0d7,null));};exports['send']=function(_0x4a5623,_0x29e90a,_0x1f6fbe){var _0x293ed0,_0x5b4d69,_0x4b76cd;if(_['isNil'](_0x4a5623[_0x6605('0x63')][_0x6605('0x63')])||_0x4a5623[_0x6605('0x63')][_0x6605('0x63')]===''){throw new db[(_0x6605('0x79'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6605('0x92')](_0x4a5623[_0x6605('0x63')]['to'])){throw new db[(_0x6605('0x79'))]['ValidationError']('to\x20is\x20mandatory');}_0x293ed0=_0x4a5623['body']['to'];return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x4a5623[_0x6605('0x57')]['id']},'include':[{'model':db[_0x6605('0x99')],'as':_0x6605('0xbf'),'include':[{'model':db[_0x6605('0x78')],'as':_0x6605('0x9d'),'where':{'mobile':_0x293ed0},'limit':0x1,'order':[[_0x6605('0x7e'),'DESC']]}]}]})[_0x6605('0x23')](handleEntityNotFound(_0x29e90a,null))[_0x6605('0x23')](function(_0x151ec1){if(_0x151ec1&&_0x151ec1[_0x6605('0xbf')]){_0x5b4d69=_0x151ec1['get']({'plain':!![]});if(_0x5b4d69[_0x6605('0xbf')]&&_0x5b4d69['List']['Contacts'][_0x6605('0x4a')]){return _0x5b4d69[_0x6605('0xbf')][_0x6605('0x9d')][0x0];}return db[_0x6605('0x78')][_0x6605('0x59')](_[_0x6605('0x1a')](_0x4a5623[_0x6605('0x63')],{'firstName':_0x293ed0,'mobile':_0x293ed0,'phone':_0x293ed0,'ListId':_0x5b4d69[_0x6605('0x7f')]}));}})[_0x6605('0x23')](handleEntityNotFound(_0x29e90a,null))[_0x6605('0x23')](function(_0x5a9d14){if(_0x5a9d14){_0x4b76cd=_0x5a9d14;return db['SmsInteraction'][_0x6605('0x5e')]({'where':{'ContactId':_0x4b76cd['id'],'closed':![],'SmsAccountId':_0x5b4d69['id']}})[_0x6605('0x23')](function(_0x4ac949){if(_0x4ac949){return[_0x4ac949,![]];}return db['SmsInteraction']['create']({'UserId':_0x4a5623[_0x6605('0x5c')]['id'],'ContactId':_0x4b76cd['id'],'SmsAccountId':_0x5b4d69['id'],'phone':_0x293ed0,'firstMsgDirection':_0x6605('0xc0'),'Messages':[_[_0x6605('0x50')](_0x4a5623['body'],{'read':![],'body':_0x4a5623['body']['body'],'phone':_0x293ed0,'SmsAccountId':_0x5b4d69['id'],'UserId':_0x4a5623[_0x6605('0x5c')]['id'],'ContactId':_0x4b76cd['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x6605('0xc1')}]})[_0x6605('0x23')](function(_0x155e74){return[_0x155e74,!![]];});});}})[_0x6605('0x9f')](function(_0x1b552c,_0x3ddef4){if(_0x3ddef4){return _0x1b552c;}return db[_0x6605('0xa8')][_0x6605('0x59')](_[_0x6605('0x50')](_0x4a5623[_0x6605('0x63')],{'read':![],'body':_0x4a5623['body']['body'],'phone':_0x293ed0,'SmsAccountId':_0x5b4d69['id'],'SmsInteractionId':_0x1b552c['id'],'UserId':_0x4a5623['user']['id'],'ContactId':_0x4b76cd['id']}))[_0x6605('0x23')](function(_0xa629a9){_0x1b552c['dataValues'][_0x6605('0xc1')]=[];_0x1b552c[_0x6605('0xc2')][_0x6605('0xc1')][_0x6605('0xa3')](_0xa629a9[_0x6605('0xc2')]);return _0x1b552c;});})['then'](respondWithResult(_0x29e90a,null))[_0x6605('0x60')](handleError(_0x29e90a,null));};exports[_0x6605('0x2c')]=function(_0x13e965,_0x4cec93,_0x198a7d){if(_0x13e965[_0x6605('0x63')]['id']){delete _0x13e965[_0x6605('0x63')]['id'];}var _0xc59394,_0x37f106,_0x53539d;return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x13e965[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x4cec93,null))[_0x6605('0x23')](function(_0x3a3c8f){if(_0x3a3c8f){_0x53539d=_0x3a3c8f;logger['debug'](_0x6605('0xc3'),'status',_0x6605('0xc4'),_0x3a3c8f[_0x6605('0x42')],util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));switch(_0x3a3c8f[_0x6605('0x42')]){case _0x6605('0xc6'):if(_0x13e965[_0x6605('0x63')][_0x6605('0xc7')]&&_0x13e965['body'][_0x6605('0x2c')]){_0x37f106=_0x13e965[_0x6605('0x63')][_0x6605('0x2c')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')][_0x6605('0xc7')]}});}break;case _0x6605('0x88'):if(_0x13e965[_0x6605('0x63')][_0x6605('0xc8')]&&_0x13e965[_0x6605('0x63')]['statusInt']){_0x37f106=_0x13e965[_0x6605('0x63')]['statusInt'];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')]['requestid']}});}break;case _0x6605('0x89'):if(_0x13e965['body']['message_id']&&_0x13e965['body'][_0x6605('0xc9')]){_0x37f106=_0x13e965[_0x6605('0x63')][_0x6605('0xc9')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965['body'][_0x6605('0xca')]}});}break;case _0x6605('0x8b'):var _0x10065d=_0x13e965[_0x6605('0x63')]['results'][0x0];if(_0x10065d[_0x6605('0x84')]&&_0x10065d[_0x6605('0x2c')][_0x6605('0xcb')]==='DELIVERED'){_0x37f106=_0x10065d[_0x6605('0x2c')][_0x6605('0xcb')];return db[_0x6605('0xa8')]['find']({'where':{'messageId':_0x10065d[_0x6605('0x84')]}});}break;case'clickatell':if(_0x13e965['body'][_0x6605('0x84')]&&_0x13e965['body'][_0x6605('0x2c')]){_0x37f106=_0x13e965[_0x6605('0x63')][_0x6605('0x2c')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')][_0x6605('0x84')]}});}break;case'bandwidth':if(_0x13e965['body'][0x0][_0x6605('0x2a')]['id']){_0x37f106=_0x13e965[_0x6605('0x63')][0x0][_0x6605('0x42')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')][0x0][_0x6605('0x2a')]['id']}});}break;case _0x6605('0x90'):if(_0x13e965[_0x6605('0x63')][_0x6605('0xcc')]&&_0x13e965['body'][_0x6605('0x2c')]){_0x37f106=_0x13e965[_0x6605('0x63')][_0x6605('0x2c')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')][_0x6605('0xcc')]}});}break;}}})[_0x6605('0x23')](handleEntityNotFound(_0x4cec93,null))[_0x6605('0x23')](function(_0x4b4165){if(_0x4b4165){_0xc59394=_0x4b4165;switch(_0x53539d[_0x6605('0x42')]){case _0x6605('0xc6'):if(_0x37f106===_0x6605('0xcd')){return _0xc59394['update']({'read':!![]});}else{logger['error'](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0xc6'),util['inspect'](_0x13e965['body'],{'showHidden':![],'depth':null}));}break;case _0x6605('0x88'):if(_0x37f106==='1'){return _0xc59394['update']({'read':!![]});}else{logger['error'](_0x6605('0xc3'),'status','skebby',util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x13e965[_0x6605('0x63')]['error_code']&&_0x37f106>=0xc8&&_0x37f106<=0xce){return _0xc59394[_0x6605('0x62')]({'read':!![]});}else{logger[_0x6605('0x28')](_0x6605('0xc3'),'status',_0x6605('0x89'),util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2c3054=_0x13e965[_0x6605('0x63')][_0x6605('0x8c')][0x0];if(_0x2c3054[_0x6605('0x2c')][_0x6605('0xcb')]===_0x6605('0xcd')){return _0xc59394[_0x6605('0x62')]({'read':!![]});}else{logger['error'](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0x8b'),util[_0x6605('0xc5')](_0x13e965['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x37f106==_0x6605('0xce')||_0x37f106=='RECEIVED_BY_RECIPIENT'){return _0xc59394['update']({'read':!![]});}else{logger[_0x6605('0x28')](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0x8e'),util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;case _0x6605('0xcf'):if(_0x37f106==_0x6605('0xd0')){return _0xc59394[_0x6605('0x62')]({'read':!![]});}else{logger[_0x6605('0x28')](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0xcf'),util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x37f106===_0x6605('0xd1')||_0x37f106===_0x6605('0xd2')){return _0xc59394[_0x6605('0x62')]({'read':!![]});}else{logger['error'](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0x90'),util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;}return _0xc59394;}})[_0x6605('0x23')](respondWithResult(_0x4cec93,null))['catch'](handleError(_0x4cec93,null));};exports[_0x6605('0xd3')]=function(_0x1d4f38,_0x5eb6ff,_0x552a89){var _0x287eae,_0xdc61a2,_0x3145a7;return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x1d4f38['params']['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x5eb6ff,null))[_0x6605('0x23')](function(_0x3263ee){if(_0x3263ee){_0x3145a7=_0x3263ee;logger[_0x6605('0xb0')](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0xc4'),_0x3263ee[_0x6605('0x42')],util[_0x6605('0xc5')](_0x1d4f38[_0x6605('0x44')],{'showHidden':![],'depth':null}));switch(_0x3263ee['type']){case _0x6605('0xd4'):if(_0x1d4f38[_0x6605('0x44')][_0x6605('0xd5')]&&_0x1d4f38[_0x6605('0x44')][_0x6605('0xd6')]){_0xdc61a2=_0x1d4f38[_0x6605('0x44')]['state'];return db[_0x6605('0xa8')]['find']({'where':{'messageId':_0x1d4f38['query'][_0x6605('0xd5')]}});}break;}}})[_0x6605('0x23')](handleEntityNotFound(_0x5eb6ff,null))[_0x6605('0x23')](function(_0x294586){if(_0x294586){_0x287eae=_0x294586;switch(_0x3145a7[_0x6605('0x42')]){case _0x6605('0xd4'):if(_0xdc61a2==='2'||_0xdc61a2==='6'){return _0x287eae['update']({'read':!![]});}else{logger['error'](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0xd4'),util['inspect'](_0x1d4f38['query'],{'showHidden':![],'depth':null}));};break;}return _0x287eae;}})[_0x6605('0x23')](respondWithResult(_0x5eb6ff,null))[_0x6605('0x60')](handleError(_0x5eb6ff,null));};exports['addAgents']=function(_0x50f7a3,_0x558792,_0x1bad1b){return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x50f7a3[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x558792,null))[_0x6605('0x23')](function(_0x14d09a){if(_0x14d09a){return _0x14d09a[_0x6605('0xd7')](_0x50f7a3[_0x6605('0x63')][_0x6605('0x6c')],_[_0x6605('0x9c')](_0x50f7a3[_0x6605('0x63')],[_0x6605('0x6c'),'id'])||{})['spread'](function(_0x54f01b){for(var _0x553c58=0x0;_0x553c58<_0x50f7a3[_0x6605('0x63')]['ids'][_0x6605('0x4a')];_0x553c58+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x50f7a3[_0x6605('0x63')][_0x6605('0x6c')][_0x553c58]),'SmsAccountId':Number(_0x50f7a3[_0x6605('0x57')]['id'])});}return _0x54f01b;});}})[_0x6605('0x23')](respondWithResult(_0x558792,null))[_0x6605('0x60')](handleError(_0x558792,null));};exports[_0x6605('0xd8')]=function(_0xa995db,_0x4d4095,_0xe9f87a){return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0xa995db['params']['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x4d4095,null))[_0x6605('0x23')](function(_0x2bc1da){if(_0x2bc1da){return _0x2bc1da[_0x6605('0xd8')](_0xa995db[_0x6605('0x44')][_0x6605('0x6c')])[_0x6605('0x23')](function(){if(_[_0x6605('0xd9')](_0xa995db[_0x6605('0x44')][_0x6605('0x6c')])){for(var _0x2cc617=0x0;_0x2cc617<_0xa995db[_0x6605('0x44')]['ids']['length'];_0x2cc617+=0x1){socket[_0x6605('0xda')](_0x6605('0xdb'),{'UserId':Number(_0xa995db[_0x6605('0x44')]['ids'][_0x2cc617]),'SmsAccountId':Number(_0xa995db[_0x6605('0x57')]['id'])});}}else{socket[_0x6605('0xda')]('userSmsAccount:remove',{'UserId':Number(_0xa995db[_0x6605('0x44')][_0x6605('0x6c')]),'SmsAccountId':Number(_0xa995db['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4d4095,null))[_0x6605('0x60')](handleError(_0x4d4095,null));};exports[_0x6605('0xdc')]=function(_0x4db27c,_0x403968,_0x1fb93c){var _0xf01628={};var _0x20bae8={};var _0x2f44e5;var _0x35bb66;return db[_0x6605('0x3f')]['findOne']({'where':{'id':_0x4db27c[_0x6605('0x57')]['id']}})['then'](handleEntityNotFound(_0x403968,null))[_0x6605('0x23')](function(_0x56cce2){if(_0x56cce2){_0x2f44e5=_0x56cce2;_0x20bae8['model']=_[_0x6605('0x58')](db[_0x6605('0xaa')][_0x6605('0x40')]);_0x20bae8['query']=_[_0x6605('0x58')](_0x4db27c['query']);_0x20bae8[_0x6605('0x45')]=_[_0x6605('0x46')](_0x20bae8[_0x6605('0x47')],_0x20bae8[_0x6605('0x44')]);_0xf01628[_0x6605('0x48')]=_[_0x6605('0x46')](_0x20bae8[_0x6605('0x47')],qs[_0x6605('0x49')](_0x4db27c[_0x6605('0x44')]['fields']));_0xf01628[_0x6605('0x48')]=_0xf01628['attributes'][_0x6605('0x4a')]?_0xf01628[_0x6605('0x48')]:_0x20bae8[_0x6605('0x47')];_0xf01628[_0x6605('0x4d')]=qs[_0x6605('0x4e')](_0x4db27c[_0x6605('0x44')][_0x6605('0x4e')]);_0xf01628[_0x6605('0x4f')]=qs[_0x6605('0x45')](_['pick'](_0x4db27c['query'],_0x20bae8[_0x6605('0x45')]));if(_0x4db27c['query'][_0x6605('0x51')]){_0xf01628[_0x6605('0x4f')]=_['merge'](_0xf01628[_0x6605('0x4f')],{'$or':_[_0x6605('0x3e')](_0xf01628[_0x6605('0x48')],function(_0x3f21be){var _0x517ad4={};_0x517ad4[_0x3f21be]={'$like':'%'+_0x4db27c[_0x6605('0x44')]['filter']+'%'};return _0x517ad4;})});}_0xf01628=_[_0x6605('0x50')]({},_0xf01628,_0x4db27c[_0x6605('0x52')]);return _0x2f44e5[_0x6605('0xdc')](_0xf01628);}})[_0x6605('0x23')](function(_0x495f43){if(_0x495f43){_0x35bb66=_0x495f43[_0x6605('0x4a')];if(!_0x4db27c['query'][_0x6605('0x4b')](_0x6605('0x4c'))){_0xf01628[_0x6605('0x2f')]=qs[_0x6605('0x2f')](_0x4db27c[_0x6605('0x44')]['limit']);_0xf01628[_0x6605('0x2d')]=qs[_0x6605('0x2d')](_0x4db27c[_0x6605('0x44')][_0x6605('0x2d')]);}return _0x2f44e5[_0x6605('0xdc')](_0xf01628);}})[_0x6605('0x23')](function(_0xd77056){if(_0xd77056){return _0xd77056?{'count':_0x35bb66,'rows':_0xd77056}:null;}})[_0x6605('0x23')](respondWithResult(_0x403968,null))[_0x6605('0x60')](handleError(_0x403968,null));};
\ No newline at end of file
index d1ffcb9..62f4c50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2b9=['setMaxListeners','save','remove','hasOwnProperty','hook','events','SmsAccount'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe2b9,0x140));var _0x9e2b=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0xe2b9[_0x3f0b30];return _0x2748a5;};'use strict';var EventEmitter=require(_0x9e2b('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x9e2b('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9e2b('0x2')](0x0);var events={'afterCreate':_0x9e2b('0x3'),'afterUpdate':'update','afterDestroy':_0x9e2b('0x4')};function emitEvent(_0x14a79d){return function(_0x35f3f2,_0x4fedbf,_0x576d72){SmsAccountEvents['emit'](_0x14a79d+':'+_0x35f3f2['id'],_0x35f3f2);SmsAccountEvents['emit'](_0x14a79d,_0x35f3f2);_0x576d72(null);};}for(var e in events){if(events[_0x9e2b('0x5')](e)){var event=events[e];SmsAccount[_0x9e2b('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0x9b27=['hook','exports','events','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x13a1ed,_0x1f8a2a){var _0x2433a2=function(_0x2fbb9b){while(--_0x2fbb9b){_0x13a1ed['push'](_0x13a1ed['shift']());}};_0x2433a2(++_0x1f8a2a);}(_0x9b27,0x185));var _0x79b2=function(_0x14ddd4,_0x5b527d){_0x14ddd4=_0x14ddd4-0x0;var _0x421616=_0x9b27[_0x14ddd4];return _0x421616;};'use strict';var EventEmitter=require(_0x79b2('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x79b2('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x79b2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x79b2('0x3'),'afterDestroy':_0x79b2('0x4')};function emitEvent(_0x330a60){return function(_0x1ea54a,_0x370699,_0x33a8ec){SmsAccountEvents[_0x79b2('0x5')](_0x330a60+':'+_0x1ea54a['id'],_0x1ea54a);SmsAccountEvents[_0x79b2('0x5')](_0x330a60,_0x1ea54a);_0x33a8ec(null);};}for(var e in events){if(events[_0x79b2('0x6')](e)){var event=events[e];SmsAccount[_0x79b2('0x7')](e,emitEvent(event));}}module[_0x79b2('0x8')]=SmsAccountEvents;
\ No newline at end of file
index 73b6f36..c79a7a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5c9=['util','../../config/logger','api','request-promise','path','exports','define','sms_accounts','lodash'];(function(_0x1796d6,_0x3f93d7){var _0x2d40af=function(_0x44d14c){while(--_0x44d14c){_0x1796d6['push'](_0x1796d6['shift']());}};_0x2d40af(++_0x3f93d7);}(_0xa5c9,0x143));var _0x9a5c=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xa5c9[_0x4bcf38];return _0x4a89be;};'use strict';var _=require(_0x9a5c('0x0'));var util=require(_0x9a5c('0x1'));var logger=require(_0x9a5c('0x2'))(_0x9a5c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a5c('0x4'));var fs=require('fs');var path=require(_0x9a5c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x9a5c('0x6')]=function(_0x2a697c,_0x2cac2a){return _0x2a697c[_0x9a5c('0x7')]('SmsAccount',attributes,{'tableName':_0x9a5c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85be=['./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a3ab8,_0x5c9511){var _0x1a0ffa=function(_0x679894){while(--_0x679894){_0x5a3ab8['push'](_0x5a3ab8['shift']());}};_0x1a0ffa(++_0x5c9511);}(_0x85be,0x1d8));var _0xe85b=function(_0x5304c3,_0x2fffa5){_0x5304c3=_0x5304c3-0x0;var _0x2a98ee=_0x85be[_0x5304c3];return _0x2a98ee;};'use strict';var _=require(_0xe85b('0x0'));var util=require('util');var logger=require(_0xe85b('0x1'))(_0xe85b('0x2'));var moment=require('moment');var BPromise=require(_0xe85b('0x3'));var rp=require(_0xe85b('0x4'));var fs=require('fs');var path=require(_0xe85b('0x5'));var rimraf=require(_0xe85b('0x6'));var config=require(_0xe85b('0x7'));var attributes=require(_0xe85b('0x8'));module[_0xe85b('0x9')]=function(_0x2581bc,_0x26c7c5){return _0x2581bc['define'](_0xe85b('0xa'),attributes,{'tableName':_0xe85b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cabed30..79f23a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdee=['code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x26b7f6,_0x19eb8c){var _0x290c32=function(_0x198697){while(--_0x198697){_0x26b7f6['push'](_0x26b7f6['shift']());}};_0x290c32(++_0x19eb8c);}(_0xbdee,0x119));var _0xebde=function(_0x4bdc51,_0x2c3adf){_0x4bdc51=_0x4bdc51-0x0;var _0x5db2b8=_0xbdee[_0x4bdc51];return _0x5db2b8;};'use strict';var _=require(_0xebde('0x0'));var util=require(_0xebde('0x1'));var moment=require(_0xebde('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebde('0x3'))['db'];var utils=require(_0xebde('0x4'));var logger=require(_0xebde('0x5'))('rpc');var config=require(_0xebde('0x6'));var jayson=require(_0xebde('0x7'));var client=jayson[_0xebde('0x8')][_0xebde('0x9')]({'port':0x232a});config['redis']=_[_0xebde('0xa')](config['redis'],{'host':_0xebde('0xb'),'port':0x18eb});var socket=require(_0xebde('0xc'))(new Redis(config[_0xebde('0xd')]));require(_0xebde('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a7fa2,_0x4bc8cd,_0x37cd28){return new BPromise(function(_0x589df7,_0x41033e){return client[_0xebde('0xf')](_0x4a7fa2,_0x37cd28)[_0xebde('0x10')](function(_0x9343c1){logger[_0xebde('0x11')](_0xebde('0x12'),_0x4bc8cd,_0xebde('0x13'));logger[_0xebde('0x14')](_0xebde('0x15'),_0x4bc8cd,_0xebde('0x13'),JSON['stringify'](_0x9343c1));if(_0x9343c1['error']){if(_0x9343c1[_0xebde('0x16')][_0xebde('0x17')]===0x1f4){logger[_0xebde('0x16')](_0xebde('0x12'),_0x4bc8cd,_0x9343c1[_0xebde('0x16')][_0xebde('0x18')]);return _0x41033e(_0x9343c1[_0xebde('0x16')][_0xebde('0x18')]);}logger[_0xebde('0x16')](_0xebde('0x12'),_0x4bc8cd,_0x9343c1[_0xebde('0x16')][_0xebde('0x18')]);return _0x589df7(_0x9343c1['error']['message']);}else{logger[_0xebde('0x11')](_0xebde('0x12'),_0x4bc8cd,_0xebde('0x13'));_0x589df7(_0x9343c1[_0xebde('0x19')][_0xebde('0x18')]);}})[_0xebde('0x1a')](function(_0x284b29){logger[_0xebde('0x16')]('SmsAccount,\x20%s,\x20%s',_0x4bc8cd,_0x284b29);_0x41033e(_0x284b29);});});}exports[_0xebde('0x1b')]=function(_0x3ab834){var _0x4dbee5=this;return new Promise(function(_0x52af55,_0x1cd7b8){return db[_0xebde('0x1c')][_0xebde('0x1d')]({'raw':_0x3ab834[_0xebde('0x1e')]?_0x3ab834['options'][_0xebde('0x1f')]===undefined?!![]:![]:!![],'where':_0x3ab834[_0xebde('0x1e')]?_0x3ab834[_0xebde('0x1e')][_0xebde('0x20')]||null:null,'attributes':_0x3ab834[_0xebde('0x1e')]?_0x3ab834[_0xebde('0x1e')][_0xebde('0x21')]||null:null,'include':_0x3ab834['options']?_0x3ab834[_0xebde('0x1e')]['include']?_[_0xebde('0x22')](_0x3ab834[_0xebde('0x1e')][_0xebde('0x23')],function(_0x5ab14c){return{'model':db[_0x5ab14c[_0xebde('0x24')]],'as':_0x5ab14c['as'],'attributes':_0x5ab14c[_0xebde('0x21')],'include':_0x5ab14c[_0xebde('0x23')]?_[_0xebde('0x22')](_0x5ab14c[_0xebde('0x23')],function(_0x229260){return{'model':db[_0x229260['model']],'as':_0x229260['as'],'attributes':_0x229260[_0xebde('0x21')],'include':_0x229260[_0xebde('0x23')]?_[_0xebde('0x22')](_0x229260[_0xebde('0x23')],function(_0x19c7f1){return{'model':db[_0x19c7f1['model']],'as':_0x19c7f1['as'],'attributes':_0x19c7f1[_0xebde('0x21')]};}):[]};}):[]};}):[]:[]})[_0xebde('0x10')](function(_0xd1ef67){logger[_0xebde('0x11')](_0xebde('0x1b'),_0x3ab834);logger[_0xebde('0x14')](_0xebde('0x1b'),_0x3ab834,JSON[_0xebde('0x25')](_0xd1ef67));_0x52af55(_0xd1ef67);})['catch'](function(_0x414ce1){logger[_0xebde('0x16')](_0xebde('0x1b'),_0x414ce1[_0xebde('0x18')],_0x3ab834);_0x1cd7b8(_0x4dbee5[_0xebde('0x16')](0x1f4,_0x414ce1[_0xebde('0x18')]));});});};
\ No newline at end of file
+var _0xd66d=['code','message','catch','ShowSmsAccount','SmsAccount','options','raw','include','map','model','attributes','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x18a4f7,_0x3f915c){var _0x368cf3=function(_0x173245){while(--_0x173245){_0x18a4f7['push'](_0x18a4f7['shift']());}};_0x368cf3(++_0x3f915c);}(_0xd66d,0x123));var _0xdd66=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xd66d[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0xdd66('0x0'));var util=require(_0xdd66('0x1'));var moment=require('moment');var BPromise=require(_0xdd66('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd66('0x3'));var db=require(_0xdd66('0x4'))['db'];var utils=require(_0xdd66('0x5'));var logger=require(_0xdd66('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdd66('0x7')][_0xdd66('0x8')]({'port':0x232a});config[_0xdd66('0x9')]=_[_0xdd66('0xa')](config[_0xdd66('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd66('0x9')]));require('./smsAccount.socket')[_0xdd66('0xb')](socket);function respondWithRpcPromise(_0x3ed195,_0x55d6b4,_0xbbd3fd){return new BPromise(function(_0x21b6eb,_0x1f0ab2){return client[_0xdd66('0xc')](_0x3ed195,_0xbbd3fd)[_0xdd66('0xd')](function(_0x44c269){logger[_0xdd66('0xe')](_0xdd66('0xf'),_0x55d6b4,_0xdd66('0x10'));logger[_0xdd66('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x55d6b4,_0xdd66('0x10'),JSON['stringify'](_0x44c269));if(_0x44c269[_0xdd66('0x12')]){if(_0x44c269[_0xdd66('0x12')][_0xdd66('0x13')]===0x1f4){logger[_0xdd66('0x12')](_0xdd66('0xf'),_0x55d6b4,_0x44c269['error'][_0xdd66('0x14')]);return _0x1f0ab2(_0x44c269[_0xdd66('0x12')][_0xdd66('0x14')]);}logger['error'](_0xdd66('0xf'),_0x55d6b4,_0x44c269['error'][_0xdd66('0x14')]);return _0x21b6eb(_0x44c269['error'][_0xdd66('0x14')]);}else{logger[_0xdd66('0xe')](_0xdd66('0xf'),_0x55d6b4,_0xdd66('0x10'));_0x21b6eb(_0x44c269['result'][_0xdd66('0x14')]);}})[_0xdd66('0x15')](function(_0x17a9b6){logger['error'](_0xdd66('0xf'),_0x55d6b4,_0x17a9b6);_0x1f0ab2(_0x17a9b6);});});}exports[_0xdd66('0x16')]=function(_0x4a94ac){var _0x4cf537=this;return new Promise(function(_0x1f4d03,_0x1c4a77){return db[_0xdd66('0x17')]['find']({'raw':_0x4a94ac[_0xdd66('0x18')]?_0x4a94ac[_0xdd66('0x18')][_0xdd66('0x19')]===undefined?!![]:![]:!![],'where':_0x4a94ac[_0xdd66('0x18')]?_0x4a94ac[_0xdd66('0x18')]['where']||null:null,'attributes':_0x4a94ac[_0xdd66('0x18')]?_0x4a94ac[_0xdd66('0x18')]['attributes']||null:null,'include':_0x4a94ac['options']?_0x4a94ac[_0xdd66('0x18')][_0xdd66('0x1a')]?_[_0xdd66('0x1b')](_0x4a94ac['options'][_0xdd66('0x1a')],function(_0x4c755b){return{'model':db[_0x4c755b[_0xdd66('0x1c')]],'as':_0x4c755b['as'],'attributes':_0x4c755b[_0xdd66('0x1d')],'include':_0x4c755b[_0xdd66('0x1a')]?_[_0xdd66('0x1b')](_0x4c755b[_0xdd66('0x1a')],function(_0x270886){return{'model':db[_0x270886[_0xdd66('0x1c')]],'as':_0x270886['as'],'attributes':_0x270886[_0xdd66('0x1d')],'include':_0x270886[_0xdd66('0x1a')]?_[_0xdd66('0x1b')](_0x270886['include'],function(_0x4b1904){return{'model':db[_0x4b1904[_0xdd66('0x1c')]],'as':_0x4b1904['as'],'attributes':_0x4b1904[_0xdd66('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdd66('0xd')](function(_0x5490c9){logger['info'](_0xdd66('0x16'),_0x4a94ac);logger[_0xdd66('0x11')]('ShowSmsAccount',_0x4a94ac,JSON[_0xdd66('0x1e')](_0x5490c9));_0x1f4d03(_0x5490c9);})[_0xdd66('0x15')](function(_0x5c363b){logger['error'](_0xdd66('0x16'),_0x5c363b[_0xdd66('0x14')],_0x4a94ac);_0x1c4a77(_0x4cf537[_0xdd66('0x12')](0x1f4,_0x5c363b[_0xdd66('0x14')]));});});};
\ No newline at end of file
index 8795d83..1612304 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 f6bbab1..2bdeed9 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','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 _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(_0x4d7707,_0x9784ca){var _0x5d3421=function(_0x57dd26){while(--_0x57dd26){_0x4d7707['push'](_0x4d7707['shift']());}};_0x5d3421(++_0x9784ca);}(_0x34e8,0x12c));var _0x834e=function(_0x23d8c5,_0x4fd5c2){_0x23d8c5=_0x23d8c5-0x0;var _0x261dde=_0x34e8[_0x23d8c5];return _0x261dde;};'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 d67c706..f282ea0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae99=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5f37d7,_0x2638dd){var _0x16b12e=function(_0x1cac0f){while(--_0x1cac0f){_0x5f37d7['push'](_0x5f37d7['shift']());}};_0x16b12e(++_0x2638dd);}(_0xae99,0x1a5));var _0x9ae9=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xae99[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x9ae9('0x0'));module[_0x9ae9('0x1')]={'priority':{'type':Sequelize[_0x9ae9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9ae9('0x3')],'allowNull':![],'defaultValue':_0x9ae9('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9ae9('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9ae9('0x5')}};
\ No newline at end of file
+var _0x2f55=['exports','INTEGER','STRING','noop','sequelize'];(function(_0x4bf17d,_0x4b4d80){var _0x415bb9=function(_0x3b9833){while(--_0x3b9833){_0x4bf17d['push'](_0x4bf17d['shift']());}};_0x415bb9(++_0x4b4d80);}(_0x2f55,0x130));var _0x52f5=function(_0x4a15f8,_0x16b405){_0x4a15f8=_0x4a15f8-0x0;var _0x18ed0d=_0x2f55[_0x4a15f8];return _0x18ed0d;};'use strict';var Sequelize=require(_0x52f5('0x0'));module[_0x52f5('0x1')]={'priority':{'type':Sequelize[_0x52f5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x52f5('0x3')],'allowNull':![],'defaultValue':_0x52f5('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x52f5('0x3')]},'interval':{'type':Sequelize[_0x52f5('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 366c7d0..0e34740 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc04c=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsApplication','include','catch','params','keys','includeAll','find','create','update','body','destroy','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis'];(function(_0x549106,_0x590d91){var _0x5d185c=function(_0x16f4eb){while(--_0x16f4eb){_0x549106['push'](_0x549106['shift']());}};_0x5d185c(++_0x590d91);}(_0xc04c,0x84));var _0xcc04=function(_0x5841db,_0x23ab23){_0x5841db=_0x5841db-0x0;var _0x208896=_0xc04c[_0x5841db];return _0x208896;};'use strict';var emlformat=require(_0xcc04('0x0'));var rimraf=require(_0xcc04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc04('0x2'));var rp=require('request-promise');var moment=require(_0xcc04('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcc04('0x4'));var util=require(_0xcc04('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xcc04('0x6'));var ejs=require(_0xcc04('0x7'));var fs=require('fs');var fs_extra=require(_0xcc04('0x8'));var _=require(_0xcc04('0x9'));var squel=require(_0xcc04('0xa'));var crypto=require(_0xcc04('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcc04('0x6'));var querystring=require(_0xcc04('0xc'));var Papa=require('papaparse');var Redis=require(_0xcc04('0xd'));var authService=require(_0xcc04('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcc04('0xf'));var hardwareService=require(_0xcc04('0x10'));var logger=require(_0xcc04('0x11'))(_0xcc04('0x12'));var utils=require(_0xcc04('0x13'));var config=require(_0xcc04('0x14'));var licenseUtil=require(_0xcc04('0x15'));var db=require(_0xcc04('0x16'))['db'];function respondWithStatusCode(_0x329790,_0x27f1d0){_0x27f1d0=_0x27f1d0||0xcc;return function(_0x39b05e){if(_0x39b05e){return _0x329790[_0xcc04('0x17')](_0x27f1d0);}return _0x329790['status'](_0x27f1d0)[_0xcc04('0x18')]();};}function respondWithResult(_0x54fe9f,_0x464093){_0x464093=_0x464093||0xc8;return function(_0x5854a6){if(_0x5854a6){return _0x54fe9f[_0xcc04('0x19')](_0x464093)['json'](_0x5854a6);}};}function respondWithFilteredResult(_0x1c990a,_0x3e9feb){return function(_0x4c955e){if(_0x4c955e){var _0x2439b4=typeof _0x3e9feb['offset']===_0xcc04('0x1a')&&typeof _0x3e9feb[_0xcc04('0x1b')]===_0xcc04('0x1a');var _0x2eb7ce=_0x4c955e[_0xcc04('0x1c')];var _0x58fd69=_0x2439b4?0x0:_0x3e9feb['offset'];var _0x5e2ec0=_0x2439b4?_0x4c955e[_0xcc04('0x1c')]:_0x3e9feb[_0xcc04('0x1d')]+_0x3e9feb[_0xcc04('0x1b')];var _0x31eb7f;if(_0x5e2ec0>=_0x2eb7ce){_0x5e2ec0=_0x2eb7ce;_0x31eb7f=0xc8;}else{_0x31eb7f=0xce;}_0x1c990a['status'](_0x31eb7f);return _0x1c990a[_0xcc04('0x1e')](_0xcc04('0x1f'),_0x58fd69+'-'+_0x5e2ec0+'/'+_0x2eb7ce)[_0xcc04('0x20')](_0x4c955e);}return null;};}function patchUpdates(_0x2ca99a){return function(_0x52be4d){try{jsonpatch[_0xcc04('0x21')](_0x52be4d,_0x2ca99a,!![]);}catch(_0x56bd1b){return BPromise[_0xcc04('0x22')](_0x56bd1b);}return _0x52be4d[_0xcc04('0x23')]();};}function saveUpdates(_0x3c3883,_0xd7bb0){return function(_0x3f55b9){if(_0x3f55b9){return _0x3f55b9['update'](_0x3c3883)[_0xcc04('0x24')](function(_0x19e926){return _0x19e926;});}return null;};}function removeEntity(_0x336b1b,_0x198cc1){return function(_0x4d60e2){if(_0x4d60e2){return _0x4d60e2['destroy']()[_0xcc04('0x24')](function(){_0x336b1b[_0xcc04('0x19')](0xcc)[_0xcc04('0x18')]();});}};}function handleEntityNotFound(_0x1bc1aa,_0x230dd4){return function(_0x239ece){if(!_0x239ece){_0x1bc1aa['sendStatus'](0x194);}return _0x239ece;};}function handleError(_0x48169c,_0x2f1a95){_0x2f1a95=_0x2f1a95||0x1f4;return function(_0xdbd0a1){logger[_0xcc04('0x25')](_0xdbd0a1[_0xcc04('0x26')]);if(_0xdbd0a1[_0xcc04('0x27')]){delete _0xdbd0a1[_0xcc04('0x27')];}_0x48169c['status'](_0x2f1a95)[_0xcc04('0x28')](_0xdbd0a1);};}exports[_0xcc04('0x29')]=function(_0x4cf3b7,_0x4ac782){var _0x1eef05={},_0x407fee={},_0x267554={'count':0x0,'rows':[]};var _0x21fb12=_[_0xcc04('0x2a')](db['SmsApplication'][_0xcc04('0x2b')],function(_0x444541){return{'name':_0x444541[_0xcc04('0x2c')],'type':_0x444541['type']['key']};});_0x407fee['model']=_[_0xcc04('0x2a')](_0x21fb12,_0xcc04('0x27'));_0x407fee[_0xcc04('0x2d')]=_['keys'](_0x4cf3b7[_0xcc04('0x2d')]);_0x407fee[_0xcc04('0x2e')]=_[_0xcc04('0x2f')](_0x407fee[_0xcc04('0x30')],_0x407fee[_0xcc04('0x2d')]);_0x1eef05[_0xcc04('0x31')]=_['intersection'](_0x407fee['model'],qs[_0xcc04('0x32')](_0x4cf3b7['query'][_0xcc04('0x32')]));_0x1eef05[_0xcc04('0x31')]=_0x1eef05[_0xcc04('0x31')][_0xcc04('0x33')]?_0x1eef05['attributes']:_0x407fee[_0xcc04('0x30')];if(!_0x4cf3b7[_0xcc04('0x2d')]['hasOwnProperty'](_0xcc04('0x34'))){_0x1eef05['limit']=qs[_0xcc04('0x1b')](_0x4cf3b7[_0xcc04('0x2d')]['limit']);_0x1eef05['offset']=qs[_0xcc04('0x1d')](_0x4cf3b7[_0xcc04('0x2d')]['offset']);}_0x1eef05[_0xcc04('0x35')]=qs[_0xcc04('0x36')](_0x4cf3b7[_0xcc04('0x2d')][_0xcc04('0x36')]);_0x1eef05[_0xcc04('0x37')]=qs[_0xcc04('0x2e')](_[_0xcc04('0x38')](_0x4cf3b7['query'],_0x407fee[_0xcc04('0x2e')]),_0x21fb12);if(_0x4cf3b7[_0xcc04('0x2d')][_0xcc04('0x39')]){_0x1eef05[_0xcc04('0x37')]=_[_0xcc04('0x3a')](_0x1eef05[_0xcc04('0x37')],{'$or':_[_0xcc04('0x2a')](_0x21fb12,function(_0x473979){if(_0x473979[_0xcc04('0x3b')]!==_0xcc04('0x3c')){var _0x227ef6={};_0x227ef6[_0x473979[_0xcc04('0x27')]]={'$like':'%'+_0x4cf3b7[_0xcc04('0x2d')][_0xcc04('0x39')]+'%'};return _0x227ef6;}})});}_0x1eef05=_[_0xcc04('0x3a')]({},_0x1eef05,_0x4cf3b7[_0xcc04('0x3d')]);var _0x321214={'where':_0x1eef05[_0xcc04('0x37')]};return db[_0xcc04('0x3e')][_0xcc04('0x1c')](_0x321214)['then'](function(_0x12243c){_0x267554[_0xcc04('0x1c')]=_0x12243c;if(_0x4cf3b7[_0xcc04('0x2d')]['includeAll']){_0x1eef05[_0xcc04('0x3f')]=[{'all':!![]}];}return db[_0xcc04('0x3e')]['findAll'](_0x1eef05);})[_0xcc04('0x24')](function(_0x7b7c8b){_0x267554['rows']=_0x7b7c8b;return _0x267554;})['then'](respondWithFilteredResult(_0x4ac782,_0x1eef05))[_0xcc04('0x40')](handleError(_0x4ac782,null));};exports['show']=function(_0x4aed8f,_0x2fd5e1){var _0x2d9658={'raw':!![],'where':{'id':_0x4aed8f[_0xcc04('0x41')]['id']}},_0x4e96a5={};_0x4e96a5[_0xcc04('0x30')]=_['keys'](db[_0xcc04('0x3e')][_0xcc04('0x2b')]);_0x4e96a5[_0xcc04('0x2d')]=_[_0xcc04('0x42')](_0x4aed8f[_0xcc04('0x2d')]);_0x4e96a5[_0xcc04('0x2e')]=_[_0xcc04('0x2f')](_0x4e96a5['model'],_0x4e96a5[_0xcc04('0x2d')]);_0x2d9658['attributes']=_[_0xcc04('0x2f')](_0x4e96a5[_0xcc04('0x30')],qs[_0xcc04('0x32')](_0x4aed8f['query'][_0xcc04('0x32')]));_0x2d9658[_0xcc04('0x31')]=_0x2d9658['attributes'][_0xcc04('0x33')]?_0x2d9658[_0xcc04('0x31')]:_0x4e96a5[_0xcc04('0x30')];if(_0x4aed8f[_0xcc04('0x2d')][_0xcc04('0x43')]){_0x2d9658['include']=[{'all':!![]}];}_0x2d9658=_[_0xcc04('0x3a')]({},_0x2d9658,_0x4aed8f[_0xcc04('0x3d')]);return db[_0xcc04('0x3e')][_0xcc04('0x44')](_0x2d9658)[_0xcc04('0x24')](handleEntityNotFound(_0x2fd5e1,null))[_0xcc04('0x24')](respondWithResult(_0x2fd5e1,null))[_0xcc04('0x40')](handleError(_0x2fd5e1,null));};exports['create']=function(_0x31df04,_0x3d7625){return db[_0xcc04('0x3e')][_0xcc04('0x45')](_0x31df04['body'],{})[_0xcc04('0x24')](respondWithResult(_0x3d7625,0xc9))[_0xcc04('0x40')](handleError(_0x3d7625,null));};exports[_0xcc04('0x46')]=function(_0x4bd8b4,_0x4f6b31){if(_0x4bd8b4['body']['id']){delete _0x4bd8b4[_0xcc04('0x47')]['id'];}return db[_0xcc04('0x3e')][_0xcc04('0x44')]({'where':{'id':_0x4bd8b4[_0xcc04('0x41')]['id']}})[_0xcc04('0x24')](handleEntityNotFound(_0x4f6b31,null))[_0xcc04('0x24')](saveUpdates(_0x4bd8b4[_0xcc04('0x47')],null))[_0xcc04('0x24')](respondWithResult(_0x4f6b31,null))[_0xcc04('0x40')](handleError(_0x4f6b31,null));};exports[_0xcc04('0x48')]=function(_0x432325,_0xeeba86){return db[_0xcc04('0x3e')][_0xcc04('0x44')]({'where':{'id':_0x432325[_0xcc04('0x41')]['id']}})[_0xcc04('0x24')](handleEntityNotFound(_0xeeba86,null))[_0xcc04('0x24')](removeEntity(_0xeeba86,null))['catch'](handleError(_0xeeba86,null));};
\ No newline at end of file
+var _0xe87d=['status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','SmsApplication','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x184513,_0x3aa313){var _0x169d0b=function(_0x10dfae){while(--_0x10dfae){_0x184513['push'](_0x184513['shift']());}};_0x169d0b(++_0x3aa313);}(_0xe87d,0x1a7));var _0xde87=function(_0x9e9e16,_0x2d096d){_0x9e9e16=_0x9e9e16-0x0;var _0x4c6885=_0xe87d[_0x9e9e16];return _0x4c6885;};'use strict';var emlformat=require(_0xde87('0x0'));var rimraf=require(_0xde87('0x1'));var zipdir=require(_0xde87('0x2'));var jsonpatch=require(_0xde87('0x3'));var rp=require('request-promise');var moment=require(_0xde87('0x4'));var BPromise=require(_0xde87('0x5'));var Mustache=require(_0xde87('0x6'));var util=require(_0xde87('0x7'));var path=require(_0xde87('0x8'));var sox=require(_0xde87('0x9'));var csv=require(_0xde87('0xa'));var ejs=require(_0xde87('0xb'));var fs=require('fs');var fs_extra=require(_0xde87('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xde87('0xd'));var toCsv=require(_0xde87('0xa'));var querystring=require('querystring');var Papa=require(_0xde87('0xe'));var Redis=require(_0xde87('0xf'));var authService=require(_0xde87('0x10'));var qs=require(_0xde87('0x11'));var as=require(_0xde87('0x12'));var hardwareService=require(_0xde87('0x13'));var logger=require(_0xde87('0x14'))(_0xde87('0x15'));var utils=require(_0xde87('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xde87('0x17'));var db=require(_0xde87('0x18'))['db'];function respondWithStatusCode(_0x58a35d,_0x1441ba){_0x1441ba=_0x1441ba||0xcc;return function(_0x197bd2){if(_0x197bd2){return _0x58a35d[_0xde87('0x19')](_0x1441ba);}return _0x58a35d['status'](_0x1441ba)[_0xde87('0x1a')]();};}function respondWithResult(_0x3bc455,_0xe8389d){_0xe8389d=_0xe8389d||0xc8;return function(_0x5cd676){if(_0x5cd676){return _0x3bc455[_0xde87('0x1b')](_0xe8389d)[_0xde87('0x1c')](_0x5cd676);}};}function respondWithFilteredResult(_0x12377a,_0x1e741a){return function(_0x52f250){if(_0x52f250){var _0x6b7821=typeof _0x1e741a[_0xde87('0x1d')]===_0xde87('0x1e')&&typeof _0x1e741a[_0xde87('0x1f')]==='undefined';var _0x1d0583=_0x52f250[_0xde87('0x20')];var _0x49406b=_0x6b7821?0x0:_0x1e741a['offset'];var _0x426909=_0x6b7821?_0x52f250[_0xde87('0x20')]:_0x1e741a[_0xde87('0x1d')]+_0x1e741a[_0xde87('0x1f')];var _0x3a149d;if(_0x426909>=_0x1d0583){_0x426909=_0x1d0583;_0x3a149d=0xc8;}else{_0x3a149d=0xce;}_0x12377a['status'](_0x3a149d);return _0x12377a[_0xde87('0x21')]('Content-Range',_0x49406b+'-'+_0x426909+'/'+_0x1d0583)[_0xde87('0x1c')](_0x52f250);}return null;};}function patchUpdates(_0x437d35){return function(_0x548bcf){try{jsonpatch[_0xde87('0x22')](_0x548bcf,_0x437d35,!![]);}catch(_0x864036){return BPromise[_0xde87('0x23')](_0x864036);}return _0x548bcf[_0xde87('0x24')]();};}function saveUpdates(_0x1870ee,_0x839d96){return function(_0x4381a9){if(_0x4381a9){return _0x4381a9['update'](_0x1870ee)[_0xde87('0x25')](function(_0x25e7cc){return _0x25e7cc;});}return null;};}function removeEntity(_0x50d6b0,_0x19af13){return function(_0x29dcb6){if(_0x29dcb6){return _0x29dcb6[_0xde87('0x26')]()[_0xde87('0x25')](function(){_0x50d6b0[_0xde87('0x1b')](0xcc)[_0xde87('0x1a')]();});}};}function handleEntityNotFound(_0x20ffc6,_0x137e6c){return function(_0x23680b){if(!_0x23680b){_0x20ffc6[_0xde87('0x19')](0x194);}return _0x23680b;};}function handleError(_0x30730c,_0x580019){_0x580019=_0x580019||0x1f4;return function(_0x1f10e4){logger['error'](_0x1f10e4[_0xde87('0x27')]);if(_0x1f10e4[_0xde87('0x28')]){delete _0x1f10e4['name'];}_0x30730c[_0xde87('0x1b')](_0x580019)['send'](_0x1f10e4);};}exports['index']=function(_0x41cb18,_0x4a1fc3){var _0x4aee5c={},_0x5cb785={},_0x2ba630={'count':0x0,'rows':[]};var _0x362258=_[_0xde87('0x29')](db['SmsApplication'][_0xde87('0x2a')],function(_0x2e977f){return{'name':_0x2e977f[_0xde87('0x2b')],'type':_0x2e977f[_0xde87('0x2c')][_0xde87('0x2d')]};});_0x5cb785[_0xde87('0x2e')]=_[_0xde87('0x29')](_0x362258,_0xde87('0x28'));_0x5cb785[_0xde87('0x2f')]=_[_0xde87('0x30')](_0x41cb18['query']);_0x5cb785[_0xde87('0x31')]=_[_0xde87('0x32')](_0x5cb785[_0xde87('0x2e')],_0x5cb785[_0xde87('0x2f')]);_0x4aee5c[_0xde87('0x33')]=_[_0xde87('0x32')](_0x5cb785[_0xde87('0x2e')],qs[_0xde87('0x34')](_0x41cb18[_0xde87('0x2f')][_0xde87('0x34')]));_0x4aee5c[_0xde87('0x33')]=_0x4aee5c[_0xde87('0x33')]['length']?_0x4aee5c[_0xde87('0x33')]:_0x5cb785[_0xde87('0x2e')];if(!_0x41cb18[_0xde87('0x2f')][_0xde87('0x35')](_0xde87('0x36'))){_0x4aee5c[_0xde87('0x1f')]=qs[_0xde87('0x1f')](_0x41cb18[_0xde87('0x2f')][_0xde87('0x1f')]);_0x4aee5c[_0xde87('0x1d')]=qs[_0xde87('0x1d')](_0x41cb18['query']['offset']);}_0x4aee5c[_0xde87('0x37')]=qs[_0xde87('0x38')](_0x41cb18[_0xde87('0x2f')]['sort']);_0x4aee5c[_0xde87('0x39')]=qs[_0xde87('0x31')](_[_0xde87('0x3a')](_0x41cb18[_0xde87('0x2f')],_0x5cb785[_0xde87('0x31')]),_0x362258);if(_0x41cb18['query'][_0xde87('0x3b')]){_0x4aee5c[_0xde87('0x39')]=_['merge'](_0x4aee5c[_0xde87('0x39')],{'$or':_[_0xde87('0x29')](_0x362258,function(_0x38edcb){if(_0x38edcb['type']!==_0xde87('0x3c')){var _0x4bd0c5={};_0x4bd0c5[_0x38edcb[_0xde87('0x28')]]={'$like':'%'+_0x41cb18[_0xde87('0x2f')]['filter']+'%'};return _0x4bd0c5;}})});}_0x4aee5c=_[_0xde87('0x3d')]({},_0x4aee5c,_0x41cb18[_0xde87('0x3e')]);var _0x576891={'where':_0x4aee5c[_0xde87('0x39')]};return db['SmsApplication'][_0xde87('0x20')](_0x576891)[_0xde87('0x25')](function(_0x50b0c5){_0x2ba630[_0xde87('0x20')]=_0x50b0c5;if(_0x41cb18['query'][_0xde87('0x3f')]){_0x4aee5c[_0xde87('0x40')]=[{'all':!![]}];}return db['SmsApplication'][_0xde87('0x41')](_0x4aee5c);})[_0xde87('0x25')](function(_0x34a43e){_0x2ba630[_0xde87('0x42')]=_0x34a43e;return _0x2ba630;})[_0xde87('0x25')](respondWithFilteredResult(_0x4a1fc3,_0x4aee5c))[_0xde87('0x43')](handleError(_0x4a1fc3,null));};exports[_0xde87('0x44')]=function(_0x5a9321,_0x117e3b){var _0xc6d8f0={'raw':!![],'where':{'id':_0x5a9321['params']['id']}},_0x3da8f3={};_0x3da8f3[_0xde87('0x2e')]=_[_0xde87('0x30')](db[_0xde87('0x45')][_0xde87('0x2a')]);_0x3da8f3[_0xde87('0x2f')]=_['keys'](_0x5a9321[_0xde87('0x2f')]);_0x3da8f3[_0xde87('0x31')]=_['intersection'](_0x3da8f3[_0xde87('0x2e')],_0x3da8f3['query']);_0xc6d8f0[_0xde87('0x33')]=_[_0xde87('0x32')](_0x3da8f3['model'],qs['fields'](_0x5a9321[_0xde87('0x2f')][_0xde87('0x34')]));_0xc6d8f0[_0xde87('0x33')]=_0xc6d8f0[_0xde87('0x33')][_0xde87('0x46')]?_0xc6d8f0[_0xde87('0x33')]:_0x3da8f3['model'];if(_0x5a9321[_0xde87('0x2f')][_0xde87('0x3f')]){_0xc6d8f0['include']=[{'all':!![]}];}_0xc6d8f0=_[_0xde87('0x3d')]({},_0xc6d8f0,_0x5a9321[_0xde87('0x3e')]);return db['SmsApplication'][_0xde87('0x47')](_0xc6d8f0)['then'](handleEntityNotFound(_0x117e3b,null))[_0xde87('0x25')](respondWithResult(_0x117e3b,null))['catch'](handleError(_0x117e3b,null));};exports['create']=function(_0x57c4c1,_0x280148){return db['SmsApplication'][_0xde87('0x48')](_0x57c4c1[_0xde87('0x49')],{})['then'](respondWithResult(_0x280148,0xc9))[_0xde87('0x43')](handleError(_0x280148,null));};exports['update']=function(_0x17bbcb,_0x2a2222){if(_0x17bbcb[_0xde87('0x49')]['id']){delete _0x17bbcb[_0xde87('0x49')]['id'];}return db['SmsApplication'][_0xde87('0x47')]({'where':{'id':_0x17bbcb[_0xde87('0x4a')]['id']}})[_0xde87('0x25')](handleEntityNotFound(_0x2a2222,null))[_0xde87('0x25')](saveUpdates(_0x17bbcb[_0xde87('0x49')],null))[_0xde87('0x25')](respondWithResult(_0x2a2222,null))[_0xde87('0x43')](handleError(_0x2a2222,null));};exports[_0xde87('0x26')]=function(_0x946136,_0x5e7490){return db[_0xde87('0x45')][_0xde87('0x47')]({'where':{'id':_0x946136[_0xde87('0x4a')]['id']}})[_0xde87('0x25')](handleEntityNotFound(_0x5e7490,null))[_0xde87('0x25')](removeEntity(_0x5e7490,null))[_0xde87('0x43')](handleError(_0x5e7490,null));};
\ No newline at end of file
index 9844931..b971be3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c0e=['../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x23e766,_0x49abb2){var _0x4ad25a=function(_0x2b0ebd){while(--_0x2b0ebd){_0x23e766['push'](_0x23e766['shift']());}};_0x4ad25a(++_0x49abb2);}(_0x8c0e,0x1c9));var _0xe8c0=function(_0x6fd56a,_0x21de39){_0x6fd56a=_0x6fd56a-0x0;var _0x1c960b=_0x8c0e[_0x6fd56a];return _0x1c960b;};'use strict';var _=require(_0xe8c0('0x0'));var util=require(_0xe8c0('0x1'));var logger=require('../../config/logger')(_0xe8c0('0x2'));var moment=require(_0xe8c0('0x3'));var BPromise=require(_0xe8c0('0x4'));var rp=require(_0xe8c0('0x5'));var fs=require('fs');var path=require(_0xe8c0('0x6'));var rimraf=require(_0xe8c0('0x7'));var config=require(_0xe8c0('0x8'));var attributes=require(_0xe8c0('0x9'));module[_0xe8c0('0xa')]=function(_0x49e7f7,_0x137eb2){return _0x49e7f7[_0xe8c0('0xb')](_0xe8c0('0xc'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe8c0('0xd'),'collate':_0xe8c0('0xe')});};
\ No newline at end of file
+var _0x7497=['../../config/environment','exports','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x17149c,_0xe8ce82){var _0x451cea=function(_0xf1cd37){while(--_0xf1cd37){_0x17149c['push'](_0x17149c['shift']());}};_0x451cea(++_0xe8ce82);}(_0x7497,0xef));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var logger=require(_0x7749('0x2'))(_0x7749('0x3'));var moment=require(_0x7749('0x4'));var BPromise=require(_0x7749('0x5'));var rp=require(_0x7749('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7749('0x7'));var config=require(_0x7749('0x8'));var attributes=require('./smsApplication.attributes');module[_0x7749('0x9')]=function(_0x5a458e,_0x59e560){return _0x5a458e['define'](_0x7749('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7749('0xb'),'collate':_0x7749('0xc')});};
\ No newline at end of file
index a20fa98..8615de9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e82=['SmsApplication,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x42d42b,_0x419414){var _0x3a8ea5=function(_0x1b6ecc){while(--_0x1b6ecc){_0x42d42b['push'](_0x42d42b['shift']());}};_0x3a8ea5(++_0x419414);}(_0x1e82,0x8b));var _0x21e8=function(_0x399859,_0x2048b0){_0x399859=_0x399859-0x0;var _0xcfa039=_0x1e82[_0x399859];return _0xcfa039;};'use strict';var _=require(_0x21e8('0x0'));var util=require(_0x21e8('0x1'));var moment=require(_0x21e8('0x2'));var BPromise=require(_0x21e8('0x3'));var rs=require(_0x21e8('0x4'));var fs=require('fs');var Redis=require(_0x21e8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x21e8('0x6'));var logger=require(_0x21e8('0x7'))('rpc');var config=require(_0x21e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x21e8('0x9')][_0x21e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38c3d0,_0x22cbd4,_0x47b3b3){return new BPromise(function(_0x45e5c1,_0x3754c9){return client[_0x21e8('0xb')](_0x38c3d0,_0x47b3b3)['then'](function(_0x31b6c2){logger[_0x21e8('0xc')](_0x21e8('0xd'),_0x22cbd4,_0x21e8('0xe'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x22cbd4,_0x21e8('0xe'),JSON['stringify'](_0x31b6c2));if(_0x31b6c2[_0x21e8('0xf')]){if(_0x31b6c2[_0x21e8('0xf')]['code']===0x1f4){logger[_0x21e8('0xf')]('SmsApplication,\x20%s,\x20%s',_0x22cbd4,_0x31b6c2[_0x21e8('0xf')][_0x21e8('0x10')]);return _0x3754c9(_0x31b6c2[_0x21e8('0xf')]['message']);}logger[_0x21e8('0xf')]('SmsApplication,\x20%s,\x20%s',_0x22cbd4,_0x31b6c2[_0x21e8('0xf')][_0x21e8('0x10')]);return _0x45e5c1(_0x31b6c2[_0x21e8('0xf')]['message']);}else{logger['info'](_0x21e8('0xd'),_0x22cbd4,_0x21e8('0xe'));_0x45e5c1(_0x31b6c2[_0x21e8('0x11')][_0x21e8('0x10')]);}})[_0x21e8('0x12')](function(_0x13da4f){logger[_0x21e8('0xf')](_0x21e8('0xd'),_0x22cbd4,_0x13da4f);_0x3754c9(_0x13da4f);});});}
\ No newline at end of file
+var _0x881e=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SmsApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2be2d3,_0xbe4083){var _0x386e0e=function(_0x2e9ea0){while(--_0x2e9ea0){_0x2be2d3['push'](_0x2be2d3['shift']());}};_0x386e0e(++_0xbe4083);}(_0x881e,0x146));var _0xe881=function(_0x3cef58,_0x32225b){_0x3cef58=_0x3cef58-0x0;var _0x2c33f3=_0x881e[_0x3cef58];return _0x2c33f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe881('0x0'));var BPromise=require(_0xe881('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe881('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe881('0x3'));var logger=require(_0xe881('0x4'))(_0xe881('0x5'));var config=require(_0xe881('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe881('0x7')][_0xe881('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x561c1c,_0x3f6894,_0x2413dc){return new BPromise(function(_0xe16d23,_0x547217){return client['request'](_0x561c1c,_0x2413dc)[_0xe881('0x9')](function(_0x26e29e){logger[_0xe881('0xa')](_0xe881('0xb'),_0x3f6894,'request\x20sent');logger[_0xe881('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3f6894,_0xe881('0xd'),JSON[_0xe881('0xe')](_0x26e29e));if(_0x26e29e[_0xe881('0xf')]){if(_0x26e29e[_0xe881('0xf')][_0xe881('0x10')]===0x1f4){logger[_0xe881('0xf')](_0xe881('0xb'),_0x3f6894,_0x26e29e['error'][_0xe881('0x11')]);return _0x547217(_0x26e29e[_0xe881('0xf')][_0xe881('0x11')]);}logger['error'](_0xe881('0xb'),_0x3f6894,_0x26e29e['error'][_0xe881('0x11')]);return _0xe16d23(_0x26e29e[_0xe881('0xf')][_0xe881('0x11')]);}else{logger[_0xe881('0xa')]('SmsApplication,\x20%s,\x20%s',_0x3f6894,_0xe881('0xd'));_0xe16d23(_0x26e29e[_0xe881('0x12')][_0xe881('0x11')]);}})[_0xe881('0x13')](function(_0x59b441){logger[_0xe881('0xf')](_0xe881('0xb'),_0x3f6894,_0x59b441);_0x547217(_0x59b441);});});}
\ No newline at end of file
index 7833ec5..2400a84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4483=['isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4483,0x1a3));var _0x3448=function(_0x430089,_0x576623){_0x430089=_0x430089-0x0;var _0x5c2d14=_0x4483[_0x430089];return _0x5c2d14;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3448('0x13')](_0x3448('0xf'),auth['isAuthenticated'](),controller[_0x3448('0x14')]);router[_0x3448('0x13')](_0x3448('0x15'),auth['isAuthenticated'](),interaction[_0x3448('0x16')](_0x3448('0x17'),'smsinteraction:addtags'),controller[_0x3448('0x18')]);router[_0x3448('0x19')](_0x3448('0x1a'),auth['isAuthenticated'](),interaction[_0x3448('0x16')](_0x3448('0x17'),_0x3448('0x1b')),controller[_0x3448('0x1c')]);router[_0x3448('0x1d')](_0x3448('0x1a'),auth[_0x3448('0xa')](),interaction[_0x3448('0x16')]('sms',_0x3448('0x1e')),controller['destroy']);router['delete']('/:id/tags',auth[_0x3448('0xa')](),controller[_0x3448('0x1f')]);module[_0x3448('0x20')]=router;
\ No newline at end of file
+var _0x8603=['sms','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','get','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x27657c,_0x36813e){var _0x12324a=function(_0x3f6eea){while(--_0x3f6eea){_0x27657c['push'](_0x27657c['shift']());}};_0x12324a(++_0x36813e);}(_0x8603,0x190));var _0x3860=function(_0x3f6834,_0x62927e){_0x3f6834=_0x3f6834-0x0;var _0x2b830d=_0x8603[_0x3f6834];return _0x2b830d;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['describe']);router['get']('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xb')]);router['get'](_0x3860('0xc'),auth[_0x3860('0x7')](),controller['getMessages']);router[_0x3860('0x9')](_0x3860('0xd'),auth['isAuthenticated'](),controller[_0x3860('0xe')]);router[_0x3860('0xf')]('/',auth['isAuthenticated'](),controller[_0x3860('0x10')]);router[_0x3860('0xf')](_0x3860('0xc'),auth[_0x3860('0x7')](),controller[_0x3860('0x11')]);router[_0x3860('0xf')](_0x3860('0x12'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),'smsinteraction:addtags'),controller[_0x3860('0x15')]);router[_0x3860('0x16')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),_0x3860('0x18')),controller[_0x3860('0x19')]);router[_0x3860('0x1a')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')]('sms','smsinteraction:destroy'),controller[_0x3860('0x1b')]);router[_0x3860('0x1a')](_0x3860('0x12'),auth['isAuthenticated'](),controller[_0x3860('0x1c')]);module[_0x3860('0x1d')]=router;
\ No newline at end of file
index 6c1ffd1..163355d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f74=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x46d0f4,_0x513489){var _0x2eca27=function(_0x5c417d){while(--_0x5c417d){_0x46d0f4['push'](_0x46d0f4['shift']());}};_0x2eca27(++_0x513489);}(_0x2f74,0x7b));var _0x42f7=function(_0x448a7e,_0x25d4b1){_0x448a7e=_0x448a7e-0x0;var _0x460433=_0x2f74[_0x448a7e];return _0x460433;};'use strict';var Sequelize=require(_0x42f7('0x0'));var moment=require('moment');module[_0x42f7('0x1')]={'closed':{'type':Sequelize[_0x42f7('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x42f7('0x3')]},'disposition':{'type':Sequelize[_0x42f7('0x4')]},'secondDisposition':{'type':Sequelize[_0x42f7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x42f7('0x4')]},'note':{'type':Sequelize[_0x42f7('0x4')]},'phone':{'type':Sequelize[_0x42f7('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x42f7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x42f7('0x5')]('in',_0x42f7('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x42f7('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x36b2=['ENUM','out','BOOLEAN','sequelize','moment','exports','DATE','STRING'];(function(_0x5b2b34,_0xe14d30){var _0x31db59=function(_0xfdb941){while(--_0xfdb941){_0x5b2b34['push'](_0x5b2b34['shift']());}};_0x31db59(++_0xe14d30);}(_0x36b2,0x6b));var _0x236b=function(_0x42be2f,_0x4cab51){_0x42be2f=_0x42be2f-0x0;var _0x298acf=_0x36b2[_0x42be2f];return _0x298acf;};'use strict';var Sequelize=require(_0x236b('0x0'));var moment=require(_0x236b('0x1'));module[_0x236b('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x236b('0x3')]},'disposition':{'type':Sequelize[_0x236b('0x4')]},'secondDisposition':{'type':Sequelize[_0x236b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x236b('0x4')]},'phone':{'type':Sequelize[_0x236b('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x236b('0x5')]('in',_0x236b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x236b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x236b('0x5')]('in',_0x236b('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x236b('0x7')],'defaultValue':![]}};
\ No newline at end of file
index ad2258d..391ca14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df7=['\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SmsInteraction','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','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','options','catch','destroy','describe','SmsMessage','addMessage','omit','ids','getMessages','findOne','format','addTags','setTags','spread','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','Sms','Owner','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','out','System','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','map','fullname','TagIds','split','forEach','Tags','push','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','concat','createdAt','$gte','parse','$lte'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6df7,0x72));var _0x76df=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6df7[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x76df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76df('0x1'));var jsonpatch=require(_0x76df('0x2'));var rp=require('request-promise');var moment=require(_0x76df('0x3'));var BPromise=require(_0x76df('0x4'));var Mustache=require('mustache');var util=require(_0x76df('0x5'));var path=require(_0x76df('0x6'));var sox=require(_0x76df('0x7'));var csv=require('to-csv');var ejs=require(_0x76df('0x8'));var fs=require('fs');var fs_extra=require(_0x76df('0x9'));var _=require(_0x76df('0xa'));var squel=require('squel');var crypto=require(_0x76df('0xb'));var jsforce=require(_0x76df('0xc'));var deskjs=require(_0x76df('0xd'));var toCsv=require(_0x76df('0xe'));var querystring=require(_0x76df('0xf'));var Papa=require('papaparse');var Redis=require(_0x76df('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x76df('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x76df('0x12'));var hardwareService=require(_0x76df('0x13'));var logger=require(_0x76df('0x14'))(_0x76df('0x15'));var utils=require(_0x76df('0x16'));var config=require(_0x76df('0x17'));var licenseUtil=require(_0x76df('0x18'));var db=require(_0x76df('0x19'))['db'];config[_0x76df('0x1a')]=_[_0x76df('0x1b')](config[_0x76df('0x1a')],{'host':_0x76df('0x1c'),'port':0x18eb});var socket=require(_0x76df('0x1d'))(new Redis(config[_0x76df('0x1a')]));require(_0x76df('0x1e'))[_0x76df('0x1f')](socket);function respondWithStatusCode(_0x46f981,_0x408b18){_0x408b18=_0x408b18||0xcc;return function(_0x296f53){if(_0x296f53){return _0x46f981[_0x76df('0x20')](_0x408b18);}return _0x46f981[_0x76df('0x21')](_0x408b18)[_0x76df('0x22')]();};}function respondWithResult(_0x4fa45d,_0x4a0f4d){_0x4a0f4d=_0x4a0f4d||0xc8;return function(_0x26ae44){if(_0x26ae44){return _0x4fa45d[_0x76df('0x21')](_0x4a0f4d)['json'](_0x26ae44);}};}function respondWithFilteredResult(_0xb79f01,_0x323a2c){return function(_0x182182){if(_0x182182){var _0x3ddc43=typeof _0x323a2c[_0x76df('0x23')]===_0x76df('0x24')&&typeof _0x323a2c[_0x76df('0x25')]==='undefined';var _0x16a8d5=_0x182182[_0x76df('0x26')];var _0x1e2295=_0x3ddc43?0x0:_0x323a2c[_0x76df('0x23')];var _0x4bc8b3=_0x3ddc43?_0x182182[_0x76df('0x26')]:_0x323a2c['offset']+_0x323a2c[_0x76df('0x25')];var _0x4b332a;if(_0x4bc8b3>=_0x16a8d5){_0x4bc8b3=_0x16a8d5;_0x4b332a=0xc8;}else{_0x4b332a=0xce;}_0xb79f01[_0x76df('0x21')](_0x4b332a);return _0xb79f01[_0x76df('0x27')]('Content-Range',_0x1e2295+'-'+_0x4bc8b3+'/'+_0x16a8d5)[_0x76df('0x28')](_0x182182);}return null;};}function patchUpdates(_0x1de576){return function(_0x142803){try{jsonpatch[_0x76df('0x29')](_0x142803,_0x1de576,!![]);}catch(_0x422ee7){return BPromise[_0x76df('0x2a')](_0x422ee7);}return _0x142803[_0x76df('0x2b')]();};}function saveUpdates(_0x55c1fd,_0x2094a9){return function(_0x3cd369){if(_0x3cd369){return _0x3cd369[_0x76df('0x2c')](_0x55c1fd)[_0x76df('0x2d')](function(_0x226ca3){return _0x226ca3;});}return null;};}function removeEntity(_0x52bf42,_0x263629){return function(_0x19ad96){if(_0x19ad96){return _0x19ad96['destroy']()[_0x76df('0x2d')](function(){_0x52bf42['status'](0xcc)[_0x76df('0x22')]();});}};}function handleEntityNotFound(_0x2115d0,_0x2a4779){return function(_0x50d3f4){if(!_0x50d3f4){_0x2115d0['sendStatus'](0x194);}return _0x50d3f4;};}function handleError(_0x1824e3,_0x1ced3b){_0x1ced3b=_0x1ced3b||0x1f4;return function(_0xa546e8){logger[_0x76df('0x2e')](_0xa546e8[_0x76df('0x2f')]);if(_0xa546e8[_0x76df('0x30')]){delete _0xa546e8[_0x76df('0x30')];}_0x1824e3[_0x76df('0x21')](_0x1ced3b)[_0x76df('0x31')](_0xa546e8);};}function getInteractionUsers(_0x54d803,_0x2fb811){return new BPromise(function(_0x3d3190,_0x3a9960){try{if(_0x2fb811[_0x54d803['id']]){_0x54d803['Users']=_[_0x76df('0x32')](_0x2fb811[_0x54d803['id']],function(_0x4fa767){return{'id':_0x4fa767['id'],'fullname':_0x4fa767[_0x76df('0x33')]};});}}catch(_0x105c78){_0x3a9960(_0x105c78);}_0x3d3190(_0x54d803);});}function getInteractionTags(_0xc60e3c,_0x3e84e7){return new BPromise(function(_0x2bb8ee,_0xf1e82f){try{if(_0xc60e3c[_0x76df('0x34')]){_0xc60e3c['Tags']=[];_0xc60e3c[_0x76df('0x34')][_0x76df('0x35')](',')[_0x76df('0x36')](function(_0x53d4c6){_0xc60e3c[_0x76df('0x37')][_0x76df('0x38')](_0x3e84e7[_0x53d4c6]);});}delete _0xc60e3c[_0x76df('0x34')];}catch(_0x11e284){_0xf1e82f(_0x11e284);}_0x2bb8ee(_0xc60e3c);});}function updateSmsInteraction(_0x7058fd,_0x4e2957,_0x7ebce6){return new BPromise(function(_0x122cb3,_0x13b2e9){return getInteractionUsers(_0x7058fd,_0x7ebce6)[_0x76df('0x2d')](function(_0x57a273){return getInteractionTags(_0x57a273,_0x4e2957);})[_0x76df('0x2d')](function(_0x592345){_0x122cb3(_0x592345);})['catch'](function(_0x3fccf0){_0x13b2e9(_0x3fccf0);});});}exports['index']=function(_0x4156ce,_0x47dff4){var _0x26e98e={},_0x24f6b7={},_0x3cd6ee={'count':0x0,'rows':[]};var _0x4fd940=_[_0x76df('0x32')](db['SmsInteraction'][_0x76df('0x39')],function(_0x29a14e){return{'name':_0x29a14e[_0x76df('0x3a')],'type':_0x29a14e[_0x76df('0x3b')][_0x76df('0x3c')]};});_0x24f6b7[_0x76df('0x3d')]=_[_0x76df('0x32')](_0x4fd940,_0x76df('0x30'));_0x24f6b7[_0x76df('0x3e')]=_[_0x76df('0x3f')](_0x4156ce['query']);_0x24f6b7[_0x76df('0x40')]=_[_0x76df('0x41')](_0x24f6b7['model'],_0x24f6b7[_0x76df('0x3e')]);_0x26e98e[_0x76df('0x42')]=_[_0x76df('0x41')](_0x24f6b7[_0x76df('0x3d')],qs[_0x76df('0x43')](_0x4156ce[_0x76df('0x3e')][_0x76df('0x43')]));_0x26e98e[_0x76df('0x42')]=_0x26e98e[_0x76df('0x42')][_0x76df('0x44')]?_0x26e98e[_0x76df('0x42')]:_0x24f6b7[_0x76df('0x3d')];if(!_0x4156ce[_0x76df('0x3e')][_0x76df('0x45')](_0x76df('0x46'))){_0x26e98e[_0x76df('0x25')]=qs['limit'](_0x4156ce[_0x76df('0x3e')][_0x76df('0x25')]);_0x26e98e['offset']=qs['offset'](_0x4156ce[_0x76df('0x3e')][_0x76df('0x23')]);}_0x26e98e['order']=qs[_0x76df('0x47')](_0x4156ce['query'][_0x76df('0x47')]);_0x26e98e[_0x76df('0x48')]=qs[_0x76df('0x40')](_[_0x76df('0x49')](_0x4156ce[_0x76df('0x3e')],_0x24f6b7[_0x76df('0x40')]),_0x4fd940);var _0x42ad91=[];var _0x382049=squel[_0x76df('0x4a')]()[_0x76df('0x4b')]('id')[_0x76df('0x4b')](_0x76df('0x30'))[_0x76df('0x4b')](_0x76df('0x4c'))[_0x76df('0x4d')](_0x76df('0x4e'));var _0x406c72=squel[_0x76df('0x4a')]()[_0x76df('0x4b')](_0x76df('0x4f'))[_0x76df('0x4b')](_0x76df('0x50'))[_0x76df('0x4b')]('ui.SmsInteractionId')[_0x76df('0x4d')](_0x76df('0x51'),'ui')[_0x76df('0x52')](_0x76df('0x53'),'u',_0x76df('0x54'));var _0x18cfce=squel['select']()[_0x76df('0x4d')](_0x76df('0x55'),'i')[_0x76df('0x52')](_0x76df('0x56'),'c',_0x76df('0x57'))[_0x76df('0x52')]('users','o',_0x76df('0x58'))[_0x76df('0x52')](_0x76df('0x59'),'a',_0x76df('0x5a'))[_0x76df('0x52')](_0x76df('0x5b'),'me',_0x76df('0x5c'))[_0x76df('0x52')]('sms_interaction_has_tags','it',_0x76df('0x5d'))[_0x76df('0x52')](_0x76df('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x3e7a3d=squel[_0x76df('0x5e')]();var _0x3a4f1a=[];var _0x5cd29e=squel[_0x76df('0x5e')]();var _0x556e84;if(_0x4156ce['query']['search']){_0x556e84=as[_0x76df('0x5f')](_0x4156ce[_0x76df('0x3e')][_0x76df('0x60')]);var _0x5f29e0=_0x556e84['sqlOperator'];for(var _0x4c5ae4=0x0;_0x4c5ae4<_0x556e84[_0x76df('0x61')][_0x76df('0x44')];_0x4c5ae4++){var _0x2b143a=_0x556e84[_0x76df('0x61')][_0x4c5ae4];var _0x4a907b='i';var _0x3b066d=_[_0x76df('0x62')](_0x4fd940,[_0x76df('0x30'),_0x2b143a[_0x76df('0x4b')]]);if(!_0x3b066d){switch(_0x2b143a[_0x76df('0x4b')]){case _0x76df('0x63'):if(_0x2b143a[_0x76df('0x64')]==0x1){_0x18cfce[_0x76df('0x65')]('`'+_0x2b143a[_0x76df('0x4b')]+'`\x20=\x200');}else{_0x18cfce[_0x76df('0x65')]('`'+_0x2b143a['field']+_0x76df('0x66'));}break;case _0x76df('0x67'):if(_0x2b143a['operator']===_0x76df('0x68')){if(_0x2b143a[_0x76df('0x64')][_0x76df('0x35')]('\x20')[_0x76df('0x44')]>0x1){_0x3e7a3d[_0x5f29e0](_0x76df('0x69'),qs['getFullTextValue'](_0x2b143a[_0x76df('0x64')]),null);}else{var _0x588f6b='%'+_0x2b143a[_0x76df('0x64')]+'%';_0x3e7a3d[_0x5f29e0](_0x76df('0x6a'),_0x588f6b,_0x588f6b,_0x588f6b);}}else{_0x3b066d=_['find'](_0x4fd940,[_0x76df('0x30'),_0x76df('0x6b')]);_0x2b143a['field']=_0x76df('0x6b');_0xe04e54=as[_0x76df('0x6c')](_0x4a907b,_0x3b066d[_0x76df('0x3b')],_0x2b143a);_0x3e7a3d[_0x5f29e0](_0xe04e54[_0x76df('0x6d')],_0xe04e54[_0x76df('0x64')][_0x76df('0x6e')],_0xe04e54[_0x76df('0x64')]['end']);}break;case _0x76df('0x6f'):var _0x3324b8=_0x2b143a[_0x76df('0x64')]['split'](',')['map'](function(_0x25792e){return Number(_0x25792e);});_0x3324b8[_0x76df('0x36')](function(_0x4360f3){_0x5cd29e['or'](_0x76df('0x70'),'%,'+_0x4360f3+',%');});_0x3a4f1a=_[_0x76df('0x71')](_0x3a4f1a,_0x3324b8);break;case _0x76df('0x72'):if(_0x2b143a[_0x76df('0x73')]===_0x76df('0x68')){_0x3e7a3d[_0x5f29e0](_0x76df('0x74'),'%'+_0x2b143a[_0x76df('0x64')]+'%',null);}else{_0x3b066d=_[_0x76df('0x62')](_0x4fd940,[_0x76df('0x30'),_0x76df('0x75')]);_0x2b143a['field']=_0x76df('0x75');_0xe04e54=as[_0x76df('0x6c')](_0x4a907b,_0x3b066d[_0x76df('0x3b')],_0x2b143a);_0x3e7a3d[_0x5f29e0](_0xe04e54['text'],_0xe04e54['value'][_0x76df('0x6e')],_0xe04e54[_0x76df('0x64')][_0x76df('0x22')]);}break;case _0x76df('0x76'):_0xe04e54=as[_0x76df('0x6c')]('me',null,_0x2b143a);_0x3e7a3d[_0x5f29e0](_0xe04e54['text'],_0xe04e54['value'][_0x76df('0x6e')],_0xe04e54[_0x76df('0x64')][_0x76df('0x22')]);break;}}else{var _0xe04e54=as[_0x76df('0x6c')](_0x4a907b,_0x3b066d['type'],_0x2b143a);_0x3e7a3d[_0x5f29e0](_0xe04e54['text'],_0xe04e54[_0x76df('0x64')][_0x76df('0x6e')],_0xe04e54[_0x76df('0x64')][_0x76df('0x22')]);}}}else{var _0x23f709=_(_0x4156ce['query'])[_0x76df('0x3f')]()['map'](function(_0x43444f){return _[_0x76df('0x77')](_0x4fd940,[_0x76df('0x30'),_0x43444f])?_0x43444f:undefined;})[_0x76df('0x78')]()['value']();if(!_[_0x76df('0x79')](_0x23f709)){_0x23f709[_0x76df('0x36')](function(_0x5565c5){if(_0x5565c5===_0x76df('0x7a')){_0x18cfce[_0x76df('0x48')]('i.SmsAccountId\x20IN\x20?',[][_0x76df('0x7b')](_0x4156ce[_0x76df('0x3e')][_0x5565c5]));}else if(_0x5565c5===_0x76df('0x7c')){var _0x19d7a9=JSON['parse'](_0x4156ce[_0x76df('0x3e')][_0x5565c5])[_0x76df('0x7d')];var _0x4cc0bf=JSON[_0x76df('0x7e')](_0x4156ce[_0x76df('0x3e')][_0x5565c5])[_0x76df('0x7f')];_0x18cfce['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19d7a9,_0x4cc0bf);}else{if(_0x4156ce['query'][_0x5565c5]==='null'){_0x18cfce[_0x76df('0x48')]('i.'+_0x5565c5+_0x76df('0x80'));}else{_0x18cfce[_0x76df('0x48')]('i.'+_0x5565c5+_0x76df('0x81'),_0x4156ce['query'][_0x5565c5]);}}});}if(_0x4156ce['query'][_0x76df('0x82')]){if(_0x4156ce[_0x76df('0x3e')][_0x76df('0x82')]==0x1){_0x18cfce['having'](_0x76df('0x83'));}else{_0x18cfce[_0x76df('0x65')]('`unreadMessages`\x20>\x200');}}if(_0x4156ce['query'][_0x76df('0x84')]){_0x3a4f1a=_['isArray'](_0x4156ce[_0x76df('0x3e')][_0x76df('0x84')])?_0x4156ce[_0x76df('0x3e')][_0x76df('0x84')]:new Array(_0x4156ce['query'][_0x76df('0x84')]);_0x3a4f1a[_0x76df('0x36')](function(_0x198039){_0x5cd29e['or'](_0x76df('0x70'),'%,'+_0x198039+',%');});}if(_0x4156ce[_0x76df('0x3e')][_0x76df('0x85')]){var _0x3939f2=_0x4156ce[_0x76df('0x3e')][_0x76df('0x85')][_0x76df('0x86')]('\x5c','\x5c\x5c')[_0x76df('0x86')](/'/g,'\x27\x27');if(qs[_0x76df('0x87')](_0x3939f2)){_0x3e7a3d['or'](_0x76df('0x88'),_0x3939f2+'%')['or'](_0x76df('0x89'),_0x3939f2+'%');}else{_0x3e7a3d['or'](_0x76df('0x8a'),qs['getFullTextValue'](_0x3939f2))['or'](_0x76df('0x8b'),_0x3939f2+'%');}}}_0x18cfce[_0x76df('0x48')](_0x3e7a3d);_0x18cfce[_0x76df('0x8c')](_0x76df('0x8d'));var _0x3fc7d0={'type':db[_0x76df('0x8e')][_0x76df('0x8f')][_0x76df('0x90')],'raw':!![]};var _0x2c4a56=_0x18cfce[_0x76df('0x91')]();_0x2c4a56[_0x76df('0x4b')](_0x76df('0x8d'));_0x2c4a56[_0x76df('0x4b')](_0x76df('0x92'),'unreadMessages');if(_0x26e98e['order']){_0x26e98e[_0x76df('0x93')][_0x76df('0x36')](function(_0x32b5d1){var _0x5a6141=_0x32b5d1[0x0]==='contactName'?_0x32b5d1[0x0]:'i.'+_0x32b5d1[0x0];_0x18cfce[_0x76df('0x93')](_0x5a6141,_0x32b5d1[0x1]===_0x76df('0x94')?![]:!![]);});}if(!_[_0x76df('0x79')](_0x3a4f1a)){_0x18cfce[_0x76df('0x65')](_0x5cd29e);_0x2c4a56[_0x76df('0x48')]('t.id\x20IN\x20?',_0x3a4f1a);}BPromise[_0x76df('0x95')]()[_0x76df('0x2d')](function(){if(!_0x556e84){if(_0x4156ce[_0x76df('0x3e')][_0x76df('0x7a')])return;_0x2c4a56[_0x76df('0x48')](_0x76df('0x96'));_0x18cfce[_0x76df('0x48')](_0x76df('0x96'));return;}if(_0x4156ce[_0x76df('0x97')][_0x76df('0x98')]!==_0x76df('0x99'))return;return _0x4156ce[_0x76df('0x97')][_0x76df('0x9a')]({'attributes':['id'],'raw':!![]})[_0x76df('0x2d')](function(_0x30d2d1){if(_[_0x76df('0x79')](_0x30d2d1)){_0x2c4a56['where'](_0x76df('0x9b'));_0x18cfce['where'](_0x76df('0x9b'));}else{_0x2c4a56['where'](_0x76df('0x9c'),_['map'](_0x30d2d1,'id'));_0x18cfce[_0x76df('0x48')](_0x76df('0x9c'),_[_0x76df('0x32')](_0x30d2d1,'id'));}});})[_0x76df('0x2d')](function(){if(_0x4156ce[_0x76df('0x97')]['role']===_0x76df('0x99')&&!_0x556e84&&!_0x4156ce[_0x76df('0x3e')][_0x76df('0x7a')])return[];return db[_0x76df('0x9d')][_0x76df('0x3e')](_0x2c4a56[_0x76df('0x9e')](),_0x3fc7d0);})[_0x76df('0x2d')](function(_0x2d3763){_0x3cd6ee['count']=_0x2d3763[_0x76df('0x44')];if(_0x3cd6ee['count']===0x0)return[];return db[_0x76df('0x9d')]['query'](_0x382049[_0x76df('0x9e')](),_0x3fc7d0)[_0x76df('0x2d')](function(_0x59867c){_0x42ad91=_[_0x76df('0x9f')](_0x59867c,'id');_0x3fc7d0=_[_0x76df('0xa0')](_0x3fc7d0,{'model':db[_0x76df('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4156ce[_0x76df('0x3e')]['fields']){_0x26e98e[_0x76df('0x42')]['forEach'](function(_0x5e84e5){_0x18cfce[_0x76df('0x4b')]('i.'+_0x5e84e5);});}else{_0x18cfce[_0x76df('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x76df('0x63'));_0x18cfce[_0x76df('0x4b')](_0x76df('0xa2'),_0x76df('0xa3'));_0x18cfce[_0x76df('0x4b')](_0x76df('0xa4'),_0x76df('0xa5'));_0x18cfce[_0x76df('0x4b')](_0x76df('0xa6'),_0x76df('0xa7'));_0x18cfce[_0x76df('0x4b')]('i.*');_0x18cfce[_0x76df('0x4b')](_0x76df('0xa8'),_0x76df('0xa9'));_0x18cfce[_0x76df('0x4b')](_0x76df('0xaa'),_0x76df('0xab'));_0x18cfce['field'](_0x76df('0xac'),_0x76df('0xad'));_0x18cfce['field'](_0x76df('0xae'),_0x76df('0xaf'));_0x18cfce[_0x76df('0x4b')](_0x76df('0xb0'),_0x76df('0xb1'));_0x18cfce['field'](_0x76df('0xb2'),_0x76df('0xb3'));_0x18cfce[_0x76df('0x4b')](_0x76df('0xb4'),_0x76df('0xb5'));_0x18cfce[_0x76df('0x4b')]('o.internal',_0x76df('0xb6'));_0x18cfce[_0x76df('0x4b')](_0x76df('0xb7'),_0x76df('0x34'));}if(_0x26e98e[_0x76df('0x25')])_0x18cfce['limit'](_0x26e98e[_0x76df('0x25')]);if(_0x26e98e['offset'])_0x18cfce[_0x76df('0x23')](_0x26e98e[_0x76df('0x23')]);return db['sequelize'][_0x76df('0x3e')](_0x18cfce['toString'](),_0x3fc7d0);})[_0x76df('0x2d')](function(_0x22b93a){if(_0x22b93a[_0x76df('0x44')]>0x0)_0x406c72[_0x76df('0x48')](_0x76df('0xb8'),_['map'](_0x22b93a,'id'));return db[_0x76df('0x9d')][_0x76df('0x3e')](_0x406c72[_0x76df('0x9e')](),_0x3fc7d0)[_0x76df('0x2d')](function(_0x598789){var _0x1209f4=_[_0x76df('0xb9')](_0x598789,_0x76df('0xba'));var _0x46668b=[];_0x22b93a['forEach'](function(_0x4a2612){_0x46668b[_0x76df('0x38')](updateSmsInteraction(_0x4a2612,_0x42ad91,_0x1209f4));});return BPromise[_0x76df('0xbb')](_0x46668b);});});})[_0x76df('0x2d')](function(_0x1dc82a){_0x3cd6ee[_0x76df('0xbc')]=_0x1dc82a;return _0x3cd6ee;})['then'](respondWithFilteredResult(_0x47dff4,_0x26e98e))['catch'](handleError(_0x47dff4,null));};exports[_0x76df('0xbd')]=function(_0xb6cee4,_0x1c72de){var _0x448ee2={'raw':![],'where':{'id':_0xb6cee4[_0x76df('0xbe')]['id']}},_0x4e5e63={};_0x4e5e63[_0x76df('0x3d')]=_[_0x76df('0x3f')](db[_0x76df('0xa1')][_0x76df('0x39')]);_0x4e5e63[_0x76df('0x3e')]=_[_0x76df('0x3f')](_0xb6cee4[_0x76df('0x3e')]);_0x4e5e63[_0x76df('0x40')]=_[_0x76df('0x41')](_0x4e5e63[_0x76df('0x3d')],_0x4e5e63['query']);_0x448ee2['attributes']=_['intersection'](_0x4e5e63[_0x76df('0x3d')],qs['fields'](_0xb6cee4['query'][_0x76df('0x43')]));_0x448ee2['attributes']=_0x448ee2[_0x76df('0x42')]['length']?_0x448ee2[_0x76df('0x42')]:_0x4e5e63[_0x76df('0x3d')];if(_0xb6cee4[_0x76df('0x3e')][_0x76df('0xbf')]){_0x448ee2[_0x76df('0xc0')]=[{'all':!![]}];}_0x448ee2=_[_0x76df('0xa0')]({},_0x448ee2,_0xb6cee4[_0x76df('0xc1')]);return db[_0x76df('0xa1')][_0x76df('0x62')](_0x448ee2)[_0x76df('0x2d')](handleEntityNotFound(_0x1c72de,null))[_0x76df('0x2d')](respondWithResult(_0x1c72de,null))[_0x76df('0xc2')](handleError(_0x1c72de,null));};exports['create']=function(_0x13623d,_0x124a19){return db['SmsInteraction']['create'](_0x13623d[_0x76df('0x76')],{})[_0x76df('0x2d')](respondWithResult(_0x124a19,0xc9))[_0x76df('0xc2')](handleError(_0x124a19,null));};exports['update']=function(_0x125993,_0x525bb2){if(_0x125993[_0x76df('0x76')]['id']){delete _0x125993[_0x76df('0x76')]['id'];}return db['SmsInteraction'][_0x76df('0x62')]({'where':{'id':_0x125993[_0x76df('0xbe')]['id']}})['then'](handleEntityNotFound(_0x525bb2,null))[_0x76df('0x2d')](saveUpdates(_0x125993[_0x76df('0x76')],null))['then'](respondWithResult(_0x525bb2,null))[_0x76df('0xc2')](handleError(_0x525bb2,null));};exports[_0x76df('0xc3')]=function(_0x241b92,_0x753b16){return db[_0x76df('0xa1')]['find']({'where':{'id':_0x241b92['params']['id']}})[_0x76df('0x2d')](handleEntityNotFound(_0x753b16,null))[_0x76df('0x2d')](removeEntity(_0x753b16,null))[_0x76df('0xc2')](handleError(_0x753b16,null));};exports[_0x76df('0xc4')]=function(_0x186993,_0x2b5e45){return db[_0x76df('0xa1')][_0x76df('0xc4')]()[_0x76df('0x2d')](respondWithResult(_0x2b5e45,null))['catch'](handleError(_0x2b5e45,null));};exports['addMessage']=function(_0x283bdd,_0x505bf7,_0x58bb90){return db[_0x76df('0xc5')][_0x76df('0x62')]({'where':{'id':_0x283bdd[_0x76df('0xbe')]['id']}})[_0x76df('0x2d')](handleEntityNotFound(_0x505bf7,null))['then'](function(_0x2708ba){if(_0x2708ba){return _0x2708ba[_0x76df('0xc6')](_0x283bdd[_0x76df('0x76')]['ids'],_[_0x76df('0xc7')](_0x283bdd[_0x76df('0x76')],[_0x76df('0xc8'),'id'])||{});}})[_0x76df('0x2d')](respondWithResult(_0x505bf7,null))[_0x76df('0xc2')](handleError(_0x505bf7,null));};exports[_0x76df('0xc9')]=function(_0x17bbbd,_0x2699a0,_0x26c105){var _0x2db3fb={'raw':![],'where':{}};var _0x5c961b={};var _0x1aaa7d={'count':0x0,'rows':[]};return db[_0x76df('0xa1')][_0x76df('0xca')]({'where':{'id':_0x17bbbd[_0x76df('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2699a0,null))[_0x76df('0x2d')](function(_0x2a0597){if(_0x2a0597){_0x5c961b[_0x76df('0x3d')]=_[_0x76df('0x3f')](db['SmsMessage'][_0x76df('0x39')]);_0x5c961b[_0x76df('0x3e')]=_['keys'](_0x17bbbd['query']);_0x5c961b[_0x76df('0x40')]=_[_0x76df('0x41')](_0x5c961b[_0x76df('0x3d')],_0x5c961b[_0x76df('0x3e')]);_0x2db3fb[_0x76df('0x42')]=_[_0x76df('0x41')](_0x5c961b[_0x76df('0x3d')],qs['fields'](_0x17bbbd[_0x76df('0x3e')][_0x76df('0x43')]));_0x2db3fb[_0x76df('0x42')]=_0x2db3fb[_0x76df('0x42')][_0x76df('0x44')]?_0x2db3fb['attributes']:_0x5c961b[_0x76df('0x3d')];if(!_0x17bbbd[_0x76df('0x3e')][_0x76df('0x45')](_0x76df('0x46'))){_0x2db3fb['limit']=qs['limit'](_0x17bbbd['query'][_0x76df('0x25')]);_0x2db3fb['offset']=qs['offset'](_0x17bbbd[_0x76df('0x3e')][_0x76df('0x23')]);}_0x2db3fb['order']=qs[_0x76df('0x47')](_0x17bbbd['query']['sort']);_0x2db3fb[_0x76df('0x48')]=qs['filters'](_[_0x76df('0x49')](_0x17bbbd[_0x76df('0x3e')],_0x5c961b[_0x76df('0x40')]));_0x2db3fb[_0x76df('0x48')][_0x76df('0xba')]=_0x2a0597['id'];if(_0x17bbbd[_0x76df('0x3e')]['filter']){_0x2db3fb[_0x76df('0x48')]=_[_0x76df('0xa0')](_0x2db3fb[_0x76df('0x48')],{'$or':_[_0x76df('0x32')](_0x2db3fb['attributes'],function(_0x6d2b5){var _0x1988df={};_0x1988df[_0x6d2b5]={'$like':'%'+_0x17bbbd['query'][_0x76df('0x85')]+'%'};return _0x1988df;})});}if(_0x17bbbd[_0x76df('0x3e')][_0x76df('0x7d')]){var _0x170356=_0x17bbbd['query'][_0x76df('0x7d')]['split'](',');var _0x57b764={};_0x57b764[_0x170356[0x0]]={'$gte':moment(_0x170356[0x1])[_0x76df('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2db3fb['where']=_['merge'](_0x2db3fb[_0x76df('0x48')],_0x57b764);}_0x2db3fb=_[_0x76df('0xa0')]({},_0x2db3fb,_0x17bbbd[_0x76df('0xc1')]);return db['SmsMessage']['count']({'where':_0x2db3fb[_0x76df('0x48')]})[_0x76df('0x2d')](function(_0x42d466){_0x1aaa7d['count']=_0x42d466;if(_0x17bbbd[_0x76df('0x3e')][_0x76df('0xbf')]){_0x2db3fb['include']=[{'all':!![]}];}return db[_0x76df('0xc5')]['findAll'](_0x2db3fb);})[_0x76df('0x2d')](function(_0x337897){_0x1aaa7d[_0x76df('0xbc')]=_0x337897;return _0x1aaa7d;});}})[_0x76df('0x2d')](respondWithFilteredResult(_0x2699a0,_0x2db3fb))[_0x76df('0xc2')](handleError(_0x2699a0,null));};exports[_0x76df('0xcc')]=function(_0x401985,_0x49982d,_0x54558d){return db[_0x76df('0xa1')][_0x76df('0x62')]({'where':{'id':_0x401985[_0x76df('0xbe')]['id']}})[_0x76df('0x2d')](handleEntityNotFound(_0x49982d,null))[_0x76df('0x2d')](function(_0x105155){if(_0x105155){return _0x105155[_0x76df('0xcd')](_0x401985[_0x76df('0x76')][_0x76df('0xc8')],_[_0x76df('0xc7')](_0x401985[_0x76df('0x76')],[_0x76df('0xc8'),'id'])||{})[_0x76df('0xce')](function(){return db[_0x76df('0x6f')]['findAll']({'attributes':['id',_0x76df('0x30'),'color'],'where':{'id':_0x401985[_0x76df('0x76')][_0x76df('0xc8')]}});})['then'](function(_0x134bcb){socket['emit'](_0x76df('0xcf'),{'id':Number(_0x401985[_0x76df('0xbe')]['id']),'tags':_0x134bcb||[]});return{'id':Number(_0x401985[_0x76df('0xbe')]['id']),'tags':_0x134bcb||[]};});}})[_0x76df('0x2d')](respondWithResult(_0x49982d,null))[_0x76df('0xc2')](handleError(_0x49982d,null));};exports[_0x76df('0xd0')]=function(_0xea326b,_0x884a26,_0x84f7eb){return db[_0x76df('0xa1')][_0x76df('0x62')]({'where':{'id':_0xea326b[_0x76df('0xbe')]['id']}})['then'](handleEntityNotFound(_0x884a26,null))['then'](function(_0x23e440){if(_0x23e440){return _0x23e440[_0x76df('0xd0')](_0xea326b[_0x76df('0x3e')][_0x76df('0xc8')]);}})[_0x76df('0x2d')](respondWithStatusCode(_0x884a26,null))[_0x76df('0xc2')](handleError(_0x884a26,null));};exports[_0x76df('0xd1')]=function(_0x34e5f1,_0x2b0ece){var _0x386ac2=moment()['unix']()['toString']();var _0x3e40c4=path[_0x76df('0xd2')](config[_0x76df('0xd3')],_0x76df('0xd4'),_0x76df('0xd5'),_0x76df('0xd6'));var _0x4438ea=path[_0x76df('0xd2')](config[_0x76df('0xd3')],'server','files',_0x76df('0xd7'));var _0x1f020c=path[_0x76df('0xd2')](_0x3e40c4,_0x386ac2);var _0x3e699d=util[_0x76df('0xcb')](_0x76df('0xd8'),_0x34e5f1[_0x76df('0xbe')]['id'],_0x386ac2);var _0x12bee7=path[_0x76df('0xd2')](_0x3e40c4,_0x3e699d);var _0x2ca393=[];_0x2ca393['push']({'model':db[_0x76df('0x72')],'as':_0x76df('0x72'),'attributes':['id',_0x76df('0x33')],'raw':!![]});_0x2ca393[_0x76df('0x38')]({'model':db['CmContact'],'as':_0x76df('0x67'),'attributes':['id','firstName',_0x76df('0xd9')],'raw':!![]});var _0x3166fe=[{'model':db['SmsMessage'],'as':_0x76df('0xda'),'attributes':['id',_0x76df('0x76'),'createdAt',_0x76df('0xdb'),_0x76df('0xdc'),'read'],'include':_0x2ca393}];_0x3166fe[_0x76df('0x38')]({'model':db[_0x76df('0xdd')],'as':_0x76df('0xde'),'attributes':['id','name']});_0x3166fe[_0x76df('0x38')]({'model':db[_0x76df('0x72')],'as':'Owner','attributes':['id',_0x76df('0x33')]});return db[_0x76df('0xa1')][_0x76df('0x62')]({'where':{'id':_0x34e5f1[_0x76df('0xbe')]['id']},'include':_0x3166fe})[_0x76df('0x2d')](handleEntityNotFound(_0x2b0ece,null))[_0x76df('0x2d')](function(_0x370760){if(_0x370760){var _0x306d8c=_0x370760[_0x76df('0xdf')]({'plain':!![]});fs[_0x76df('0xe0')](_0x1f020c);var _0x1b62c1={'channel':_0x76df('0xe1'),'account':_0x306d8c['Account'][_0x76df('0x30')],'agent':_0x306d8c[_0x76df('0xe2')]?_0x306d8c[_0x76df('0xe2')][_0x76df('0x33')]:'N.A.','createdAt':moment(_0x306d8c[_0x76df('0x7c')])[_0x76df('0xcb')](_0x76df('0xe3'))[_0x76df('0x9e')](),'closedAt':_0x306d8c[_0x76df('0xe4')]?moment(_0x306d8c['closedAt'])[_0x76df('0xcb')](_0x76df('0xe3'))[_0x76df('0x9e')]():'','disposition':_0x306d8c[_0x76df('0xe5')],'messages':_(_0x306d8c[_0x76df('0xda')])[_0x76df('0x85')]({'secret':![]})[_0x76df('0x32')](function(_0x5e0d0c){return{'date':moment(_0x5e0d0c[_0x76df('0x7c')])[_0x76df('0xcb')](_0x76df('0xe3'))[_0x76df('0x9e')](),'sender':_0x5e0d0c['direction']===_0x76df('0xe6')?_0x5e0d0c['User']?_0x5e0d0c[_0x76df('0x72')][_0x76df('0x33')]:_0x76df('0xe7'):_0x5e0d0c['Contact'][_0x76df('0xe8')]+(_0x5e0d0c[_0x76df('0x67')][_0x76df('0xd9')]?'\x20'+_0x5e0d0c['Contact'][_0x76df('0xd9')]:''),'body':_0x5e0d0c['body'],'direction':_0x5e0d0c['direction']==='out'?'A':'C','secret':_0x5e0d0c[_0x76df('0xdc')],'read':_0x5e0d0c[_0x76df('0x82')]};})[_0x76df('0x64')]()};return ejs[_0x76df('0xe9')](path['join'](config[_0x76df('0xd3')],_0x76df('0xd4'),_0x76df('0xea'),_0x76df('0xeb')),{'interaction':_0x1b62c1})['then'](function(_0x580706){var _0x19c72e=path[_0x76df('0xd2')](_0x1f020c,_0x76df('0xec')+_0x306d8c['id']+'-'+_0x386ac2+_0x76df('0xed'));var _0x4b7da7={'path':_0x19c72e,'channel':_0x76df('0xe1'),'interactionId':_0x306d8c['id']};return pdf[_0x76df('0xee')](_0x580706,_0x4b7da7);})['then'](function(){return new BPromise(function(_0x775be2,_0x2d2fe6){zipdir(_0x1f020c,{'saveTo':_0x12bee7},function(_0x1c6646,_0xb42bfe){if(_0x1c6646)return _0x2d2fe6(_0x1c6646);return _0x775be2(_0xb42bfe);});})[_0x76df('0x2d')](function(){return new BPromise(function(_0x2fe594,_0x15b8e4){rimraf(_0x1f020c,function(_0x5dd240){if(_0x5dd240)_0x15b8e4(_0x5dd240);return _0x2fe594();});});})[_0x76df('0x2d')](function(){return _0x2b0ece['download'](_0x12bee7,_0x3e699d,function(_0x520d70){if(_0x520d70){console[_0x76df('0xef')](_0x76df('0xf0'),_0x520d70);}else{fs[_0x76df('0xf1')](_0x12bee7);}});});});}else{return _0x2b0ece[_0x76df('0x20')](0xc8);}})['catch'](handleError(_0x2b0ece,null));};
\ No newline at end of file
+var _0xa6c4=['mkdirSync','Sms','Owner','closedAt','disposition','Messages','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','stack','name','send','Users','fullname','TagIds','Tags','push','then','catch','index','map','SmsInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','pick','field','color','from','tools_tags','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_messages','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','order','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','include','options','create','body','update','destroy','describe','addMessage','SmsMessage','ids','getMessages','findOne','sort','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','Tag','smsInteractionTags:save','removeTags','download','unix','join','files','root','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','direction','secret','SmsAccount','Account'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6c4,0x1da));var _0x4a6c=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xa6c4[_0x3ff685];return _0x2046c9;};'use strict';var emlformat=require(_0x4a6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a6c('0x1'));var jsonpatch=require(_0x4a6c('0x2'));var rp=require(_0x4a6c('0x3'));var moment=require(_0x4a6c('0x4'));var BPromise=require(_0x4a6c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a6c('0x6'));var sox=require(_0x4a6c('0x7'));var csv=require('to-csv');var ejs=require(_0x4a6c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4a6c('0x9'));var jsforce=require(_0x4a6c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4a6c('0xb'));var querystring=require(_0x4a6c('0xc'));var Papa=require(_0x4a6c('0xd'));var Redis=require('ioredis');var authService=require(_0x4a6c('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x4a6c('0xf'));var hardwareService=require(_0x4a6c('0x10'));var logger=require(_0x4a6c('0x11'))(_0x4a6c('0x12'));var utils=require(_0x4a6c('0x13'));var config=require(_0x4a6c('0x14'));var licenseUtil=require(_0x4a6c('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4a6c('0x16')](config[_0x4a6c('0x17')],{'host':_0x4a6c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a6c('0x17')]));require(_0x4a6c('0x19'))['register'](socket);function respondWithStatusCode(_0xc1e66f,_0x385b2a){_0x385b2a=_0x385b2a||0xcc;return function(_0x3f41bc){if(_0x3f41bc){return _0xc1e66f[_0x4a6c('0x1a')](_0x385b2a);}return _0xc1e66f[_0x4a6c('0x1b')](_0x385b2a)[_0x4a6c('0x1c')]();};}function respondWithResult(_0x3b15b3,_0x5c5204){_0x5c5204=_0x5c5204||0xc8;return function(_0x19d8b8){if(_0x19d8b8){return _0x3b15b3[_0x4a6c('0x1b')](_0x5c5204)[_0x4a6c('0x1d')](_0x19d8b8);}};}function respondWithFilteredResult(_0x16f6ef,_0x17896f){return function(_0x3e4e2b){if(_0x3e4e2b){var _0xe27609=typeof _0x17896f[_0x4a6c('0x1e')]===_0x4a6c('0x1f')&&typeof _0x17896f['limit']===_0x4a6c('0x1f');var _0x575295=_0x3e4e2b[_0x4a6c('0x20')];var _0x2dfeb8=_0xe27609?0x0:_0x17896f[_0x4a6c('0x1e')];var _0x1245f8=_0xe27609?_0x3e4e2b[_0x4a6c('0x20')]:_0x17896f[_0x4a6c('0x1e')]+_0x17896f[_0x4a6c('0x21')];var _0xf53d4;if(_0x1245f8>=_0x575295){_0x1245f8=_0x575295;_0xf53d4=0xc8;}else{_0xf53d4=0xce;}_0x16f6ef['status'](_0xf53d4);return _0x16f6ef['set'](_0x4a6c('0x22'),_0x2dfeb8+'-'+_0x1245f8+'/'+_0x575295)['json'](_0x3e4e2b);}return null;};}function patchUpdates(_0x26524f){return function(_0x3d4eb2){try{jsonpatch[_0x4a6c('0x23')](_0x3d4eb2,_0x26524f,!![]);}catch(_0x14d0c6){return BPromise['reject'](_0x14d0c6);}return _0x3d4eb2[_0x4a6c('0x24')]();};}function saveUpdates(_0x5336ac,_0x5f1bf1){return function(_0x44e24c){if(_0x44e24c){return _0x44e24c['update'](_0x5336ac)['then'](function(_0x1b95a5){return _0x1b95a5;});}return null;};}function removeEntity(_0x5e4590,_0x5afab4){return function(_0x501af9){if(_0x501af9){return _0x501af9['destroy']()['then'](function(){_0x5e4590['status'](0xcc)[_0x4a6c('0x1c')]();});}};}function handleEntityNotFound(_0x5a7996,_0x305f17){return function(_0x62d5ae){if(!_0x62d5ae){_0x5a7996['sendStatus'](0x194);}return _0x62d5ae;};}function handleError(_0x4505a7,_0x1f730f){_0x1f730f=_0x1f730f||0x1f4;return function(_0x4c1bb3){logger['error'](_0x4c1bb3[_0x4a6c('0x25')]);if(_0x4c1bb3[_0x4a6c('0x26')]){delete _0x4c1bb3[_0x4a6c('0x26')];}_0x4505a7[_0x4a6c('0x1b')](_0x1f730f)[_0x4a6c('0x27')](_0x4c1bb3);};}function getInteractionUsers(_0x1333e9,_0x4071cd){return new BPromise(function(_0x518a53,_0x522d36){try{if(_0x4071cd[_0x1333e9['id']]){_0x1333e9[_0x4a6c('0x28')]=_['map'](_0x4071cd[_0x1333e9['id']],function(_0x4d31a4){return{'id':_0x4d31a4['id'],'fullname':_0x4d31a4[_0x4a6c('0x29')]};});}}catch(_0x1fbe6e){_0x522d36(_0x1fbe6e);}_0x518a53(_0x1333e9);});}function getInteractionTags(_0xbc6546,_0x26e4e7){return new BPromise(function(_0x4727e5,_0x4d89c2){try{if(_0xbc6546[_0x4a6c('0x2a')]){_0xbc6546[_0x4a6c('0x2b')]=[];_0xbc6546[_0x4a6c('0x2a')]['split'](',')['forEach'](function(_0x4c4506){_0xbc6546[_0x4a6c('0x2b')][_0x4a6c('0x2c')](_0x26e4e7[_0x4c4506]);});}delete _0xbc6546['TagIds'];}catch(_0x5ae835){_0x4d89c2(_0x5ae835);}_0x4727e5(_0xbc6546);});}function updateSmsInteraction(_0x1caa0e,_0x37fdd0,_0x1fbbd6){return new BPromise(function(_0x51f0ad,_0x1b4492){return getInteractionUsers(_0x1caa0e,_0x1fbbd6)[_0x4a6c('0x2d')](function(_0x3a4958){return getInteractionTags(_0x3a4958,_0x37fdd0);})[_0x4a6c('0x2d')](function(_0x1d3eca){_0x51f0ad(_0x1d3eca);})[_0x4a6c('0x2e')](function(_0x4d563f){_0x1b4492(_0x4d563f);});});}exports[_0x4a6c('0x2f')]=function(_0xbc3fad,_0x4b4dbd){var _0xfd1356={},_0x1cf186={},_0x1ffe48={'count':0x0,'rows':[]};var _0x540731=_[_0x4a6c('0x30')](db[_0x4a6c('0x31')][_0x4a6c('0x32')],function(_0x5b48af){return{'name':_0x5b48af[_0x4a6c('0x33')],'type':_0x5b48af[_0x4a6c('0x34')][_0x4a6c('0x35')]};});_0x1cf186['model']=_[_0x4a6c('0x30')](_0x540731,_0x4a6c('0x26'));_0x1cf186[_0x4a6c('0x36')]=_[_0x4a6c('0x37')](_0xbc3fad['query']);_0x1cf186[_0x4a6c('0x38')]=_[_0x4a6c('0x39')](_0x1cf186[_0x4a6c('0x3a')],_0x1cf186[_0x4a6c('0x36')]);_0xfd1356[_0x4a6c('0x3b')]=_[_0x4a6c('0x39')](_0x1cf186[_0x4a6c('0x3a')],qs[_0x4a6c('0x3c')](_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x3c')]));_0xfd1356[_0x4a6c('0x3b')]=_0xfd1356[_0x4a6c('0x3b')][_0x4a6c('0x3d')]?_0xfd1356[_0x4a6c('0x3b')]:_0x1cf186[_0x4a6c('0x3a')];if(!_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x3e')](_0x4a6c('0x3f'))){_0xfd1356['limit']=qs['limit'](_0xbc3fad[_0x4a6c('0x36')]['limit']);_0xfd1356['offset']=qs[_0x4a6c('0x1e')](_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x1e')]);}_0xfd1356['order']=qs['sort'](_0xbc3fad[_0x4a6c('0x36')]['sort']);_0xfd1356['where']=qs[_0x4a6c('0x38')](_[_0x4a6c('0x40')](_0xbc3fad['query'],_0x1cf186[_0x4a6c('0x38')]),_0x540731);var _0x37abfc=[];var _0x22144d=squel['select']()[_0x4a6c('0x41')]('id')[_0x4a6c('0x41')]('name')[_0x4a6c('0x41')](_0x4a6c('0x42'))[_0x4a6c('0x43')](_0x4a6c('0x44'));var _0x595b0b=squel[_0x4a6c('0x45')]()[_0x4a6c('0x41')]('u.id')[_0x4a6c('0x41')](_0x4a6c('0x46'))['field'](_0x4a6c('0x47'))[_0x4a6c('0x43')](_0x4a6c('0x48'),'ui')['left_join'](_0x4a6c('0x49'),'u',_0x4a6c('0x4a'));var _0x4266cd=squel['select']()[_0x4a6c('0x43')]('sms_interactions','i')[_0x4a6c('0x4b')](_0x4a6c('0x4c'),'c',_0x4a6c('0x4d'))[_0x4a6c('0x4b')](_0x4a6c('0x49'),'o',_0x4a6c('0x4e'))[_0x4a6c('0x4b')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x4a6c('0x4b')](_0x4a6c('0x4f'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join']('sms_interaction_has_tags','it',_0x4a6c('0x50'))['left_join'](_0x4a6c('0x44'),'t',_0x4a6c('0x51'));var _0x5afeb0=squel['expr']();var _0x8d9243=[];var _0x6d0703=squel[_0x4a6c('0x52')]();var _0x813868;if(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x53')]){_0x813868=as[_0x4a6c('0x54')](_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x53')]);var _0x412ba4=_0x813868[_0x4a6c('0x55')];for(var _0x2ab081=0x0;_0x2ab081<_0x813868[_0x4a6c('0x56')][_0x4a6c('0x3d')];_0x2ab081++){var _0x55ed45=_0x813868[_0x4a6c('0x56')][_0x2ab081];var _0x407567='i';var _0x21b069=_[_0x4a6c('0x57')](_0x540731,['name',_0x55ed45[_0x4a6c('0x41')]]);if(!_0x21b069){switch(_0x55ed45['field']){case _0x4a6c('0x58'):if(_0x55ed45[_0x4a6c('0x59')]==0x1){_0x4266cd[_0x4a6c('0x5a')]('`'+_0x55ed45[_0x4a6c('0x41')]+'`\x20=\x200');}else{_0x4266cd[_0x4a6c('0x5a')]('`'+_0x55ed45[_0x4a6c('0x41')]+_0x4a6c('0x5b'));}break;case _0x4a6c('0x5c'):if(_0x55ed45[_0x4a6c('0x5d')]==='$substring'){if(_0x55ed45['value'][_0x4a6c('0x5e')]('\x20')[_0x4a6c('0x3d')]>0x1){_0x5afeb0[_0x412ba4](_0x4a6c('0x5f'),qs[_0x4a6c('0x60')](_0x55ed45['value']),null);}else{var _0x230cb8='%'+_0x55ed45['value']+'%';_0x5afeb0[_0x412ba4](_0x4a6c('0x61'),_0x230cb8,_0x230cb8,_0x230cb8);}}else{_0x21b069=_['find'](_0x540731,['name',_0x4a6c('0x62')]);_0x55ed45[_0x4a6c('0x41')]=_0x4a6c('0x62');_0x227602=as[_0x4a6c('0x63')](_0x407567,_0x21b069['type'],_0x55ed45);_0x5afeb0[_0x412ba4](_0x227602[_0x4a6c('0x64')],_0x227602[_0x4a6c('0x59')]['start'],_0x227602[_0x4a6c('0x59')]['end']);}break;case'Tag':var _0x181ff6=_0x55ed45[_0x4a6c('0x59')][_0x4a6c('0x5e')](',')[_0x4a6c('0x30')](function(_0x4bebce){return Number(_0x4bebce);});_0x181ff6[_0x4a6c('0x65')](function(_0x2bb40c){_0x6d0703['or'](_0x4a6c('0x66'),'%,'+_0x2bb40c+',%');});_0x8d9243=_[_0x4a6c('0x67')](_0x8d9243,_0x181ff6);break;case'User':if(_0x55ed45[_0x4a6c('0x5d')]===_0x4a6c('0x68')){_0x5afeb0[_0x412ba4](_0x4a6c('0x69'),'%'+_0x55ed45[_0x4a6c('0x59')]+'%',null);}else{_0x21b069=_['find'](_0x540731,[_0x4a6c('0x26'),_0x4a6c('0x6a')]);_0x55ed45[_0x4a6c('0x41')]=_0x4a6c('0x6a');_0x227602=as[_0x4a6c('0x63')](_0x407567,_0x21b069[_0x4a6c('0x34')],_0x55ed45);_0x5afeb0[_0x412ba4](_0x227602[_0x4a6c('0x64')],_0x227602[_0x4a6c('0x59')]['start'],_0x227602[_0x4a6c('0x59')][_0x4a6c('0x1c')]);}break;case'body':_0x227602=as[_0x4a6c('0x63')]('me',null,_0x55ed45);_0x5afeb0[_0x412ba4](_0x227602[_0x4a6c('0x64')],_0x227602[_0x4a6c('0x59')]['start'],_0x227602[_0x4a6c('0x59')][_0x4a6c('0x1c')]);break;}}else{var _0x227602=as[_0x4a6c('0x63')](_0x407567,_0x21b069[_0x4a6c('0x34')],_0x55ed45);_0x5afeb0[_0x412ba4](_0x227602[_0x4a6c('0x64')],_0x227602[_0x4a6c('0x59')][_0x4a6c('0x6b')],_0x227602['value']['end']);}}}else{var _0x1da226=_(_0xbc3fad[_0x4a6c('0x36')])['keys']()['map'](function(_0x38be44){return _[_0x4a6c('0x6c')](_0x540731,[_0x4a6c('0x26'),_0x38be44])?_0x38be44:undefined;})['compact']()[_0x4a6c('0x59')]();if(!_[_0x4a6c('0x6d')](_0x1da226)){_0x1da226['forEach'](function(_0x3c78f0){if(_0x3c78f0===_0x4a6c('0x6e')){_0x4266cd['where'](_0x4a6c('0x6f'),[][_0x4a6c('0x70')](_0xbc3fad[_0x4a6c('0x36')][_0x3c78f0]));}else if(_0x3c78f0===_0x4a6c('0x71')){var _0xa32f94=JSON[_0x4a6c('0x72')](_0xbc3fad['query'][_0x3c78f0])[_0x4a6c('0x73')];var _0x4a8674=JSON[_0x4a6c('0x72')](_0xbc3fad[_0x4a6c('0x36')][_0x3c78f0])[_0x4a6c('0x74')];_0x4266cd[_0x4a6c('0x75')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xa32f94,_0x4a8674);}else{if(_0xbc3fad['query'][_0x3c78f0]===_0x4a6c('0x76')){_0x4266cd[_0x4a6c('0x75')]('i.'+_0x3c78f0+_0x4a6c('0x77'));}else{_0x4266cd['where']('i.'+_0x3c78f0+_0x4a6c('0x78'),_0xbc3fad[_0x4a6c('0x36')][_0x3c78f0]);}}});}if(_0xbc3fad[_0x4a6c('0x36')]['read']){if(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x79')]==0x1){_0x4266cd[_0x4a6c('0x5a')](_0x4a6c('0x7a'));}else{_0x4266cd[_0x4a6c('0x5a')](_0x4a6c('0x7b'));}}if(_0xbc3fad[_0x4a6c('0x36')]['tag']){_0x8d9243=_['isArray'](_0xbc3fad['query'][_0x4a6c('0x7c')])?_0xbc3fad[_0x4a6c('0x36')]['tag']:new Array(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x7c')]);_0x8d9243[_0x4a6c('0x65')](function(_0x1cce2d){_0x6d0703['or'](_0x4a6c('0x66'),'%,'+_0x1cce2d+',%');});}if(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x7d')]){var _0x31ca25=_0xbc3fad['query']['filter'][_0x4a6c('0x7e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x4a6c('0x7f')](_0x31ca25)){_0x5afeb0['or'](_0x4a6c('0x80'),_0x31ca25+'%')['or'](_0x4a6c('0x81'),_0x31ca25+'%');}else{_0x5afeb0['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4a6c('0x60')](_0x31ca25))['or'](_0x4a6c('0x82'),_0x31ca25+'%');}}}_0x4266cd[_0x4a6c('0x75')](_0x5afeb0);_0x4266cd['group'](_0x4a6c('0x83'));var _0x44a232={'type':db[_0x4a6c('0x84')][_0x4a6c('0x85')][_0x4a6c('0x86')],'raw':!![]};var _0x4b21f5=_0x4266cd['clone']();_0x4b21f5[_0x4a6c('0x41')](_0x4a6c('0x83'));_0x4b21f5[_0x4a6c('0x41')](_0x4a6c('0x87'),_0x4a6c('0x58'));if(_0xfd1356['order']){_0xfd1356['order'][_0x4a6c('0x65')](function(_0x112070){var _0x3f8ba8=_0x112070[0x0]===_0x4a6c('0x88')?_0x112070[0x0]:'i.'+_0x112070[0x0];_0x4266cd[_0x4a6c('0x89')](_0x3f8ba8,_0x112070[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x8d9243)){_0x4266cd[_0x4a6c('0x5a')](_0x6d0703);_0x4b21f5['where'](_0x4a6c('0x8a'),_0x8d9243);}BPromise[_0x4a6c('0x8b')]()[_0x4a6c('0x2d')](function(){if(!_0x813868){if(_0xbc3fad[_0x4a6c('0x36')]['SmsAccountId'])return;_0x4b21f5[_0x4a6c('0x75')](_0x4a6c('0x8c'));_0x4266cd['where'](_0x4a6c('0x8c'));return;}if(_0xbc3fad[_0x4a6c('0x8d')]['role']!==_0x4a6c('0x8e'))return;return _0xbc3fad[_0x4a6c('0x8d')][_0x4a6c('0x8f')]({'attributes':['id'],'raw':!![]})[_0x4a6c('0x2d')](function(_0x1f79ef){if(_[_0x4a6c('0x6d')](_0x1f79ef)){_0x4b21f5[_0x4a6c('0x75')]('i.SmsAccountId\x20IS\x20NULL');_0x4266cd[_0x4a6c('0x75')](_0x4a6c('0x90'));}else{_0x4b21f5[_0x4a6c('0x75')](_0x4a6c('0x6f'),_['map'](_0x1f79ef,'id'));_0x4266cd[_0x4a6c('0x75')](_0x4a6c('0x6f'),_[_0x4a6c('0x30')](_0x1f79ef,'id'));}});})[_0x4a6c('0x2d')](function(){if(_0xbc3fad[_0x4a6c('0x8d')][_0x4a6c('0x91')]==='agent'&&!_0x813868&&!_0xbc3fad['query'][_0x4a6c('0x6e')])return[];return db[_0x4a6c('0x92')][_0x4a6c('0x36')](_0x4b21f5[_0x4a6c('0x93')](),_0x44a232);})[_0x4a6c('0x2d')](function(_0x5df52b){_0x1ffe48[_0x4a6c('0x20')]=_0x5df52b[_0x4a6c('0x3d')];if(_0x1ffe48[_0x4a6c('0x20')]===0x0)return[];return db[_0x4a6c('0x92')][_0x4a6c('0x36')](_0x22144d[_0x4a6c('0x93')](),_0x44a232)[_0x4a6c('0x2d')](function(_0x2ce3e){_0x37abfc=_[_0x4a6c('0x94')](_0x2ce3e,'id');_0x44a232=_[_0x4a6c('0x95')](_0x44a232,{'model':db[_0x4a6c('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x3c')]){_0xfd1356[_0x4a6c('0x3b')][_0x4a6c('0x65')](function(_0x460d72){_0x4266cd[_0x4a6c('0x41')]('i.'+_0x460d72);});}else{_0x4266cd['field'](_0x4a6c('0x87'),_0x4a6c('0x58'));_0x4266cd['field'](_0x4a6c('0x96'),_0x4a6c('0x97'));_0x4266cd['field'](_0x4a6c('0x98'),_0x4a6c('0x99'));_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0x9a'),_0x4a6c('0x88'));_0x4266cd[_0x4a6c('0x41')]('i.*');_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0x9b'),_0x4a6c('0x9c'));_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0x9d'),_0x4a6c('0x9e'));_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0x9f'),'Contact.email');_0x4266cd['field'](_0x4a6c('0xa0'),_0x4a6c('0xa1'));_0x4266cd[_0x4a6c('0x41')]('c.mobile',_0x4a6c('0xa2'));_0x4266cd['field'](_0x4a6c('0xa3'),_0x4a6c('0xa4'));_0x4266cd['field']('o.fullname','Owner.fullname');_0x4266cd['field'](_0x4a6c('0xa5'),_0x4a6c('0xa6'));_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0xa7'),_0x4a6c('0x2a'));}if(_0xfd1356[_0x4a6c('0x21')])_0x4266cd[_0x4a6c('0x21')](_0xfd1356[_0x4a6c('0x21')]);if(_0xfd1356['offset'])_0x4266cd[_0x4a6c('0x1e')](_0xfd1356[_0x4a6c('0x1e')]);return db['sequelize'][_0x4a6c('0x36')](_0x4266cd[_0x4a6c('0x93')](),_0x44a232);})[_0x4a6c('0x2d')](function(_0x46d007){if(_0x46d007['length']>0x0)_0x595b0b[_0x4a6c('0x75')](_0x4a6c('0xa8'),_[_0x4a6c('0x30')](_0x46d007,'id'));return db[_0x4a6c('0x92')]['query'](_0x595b0b[_0x4a6c('0x93')](),_0x44a232)[_0x4a6c('0x2d')](function(_0x4f64c7){var _0x3fbf59=_[_0x4a6c('0xa9')](_0x4f64c7,_0x4a6c('0xaa'));var _0x59f05c=[];_0x46d007['forEach'](function(_0x55b65c){_0x59f05c[_0x4a6c('0x2c')](updateSmsInteraction(_0x55b65c,_0x37abfc,_0x3fbf59));});return BPromise[_0x4a6c('0xab')](_0x59f05c);});});})[_0x4a6c('0x2d')](function(_0x32491a){_0x1ffe48[_0x4a6c('0xac')]=_0x32491a;return _0x1ffe48;})['then'](respondWithFilteredResult(_0x4b4dbd,_0xfd1356))[_0x4a6c('0x2e')](handleError(_0x4b4dbd,null));};exports[_0x4a6c('0xad')]=function(_0x4454be,_0xdb4519){var _0x1e5cce={'raw':![],'where':{'id':_0x4454be[_0x4a6c('0xae')]['id']}},_0x3bfe50={};_0x3bfe50[_0x4a6c('0x3a')]=_[_0x4a6c('0x37')](db[_0x4a6c('0x31')][_0x4a6c('0x32')]);_0x3bfe50[_0x4a6c('0x36')]=_[_0x4a6c('0x37')](_0x4454be['query']);_0x3bfe50[_0x4a6c('0x38')]=_[_0x4a6c('0x39')](_0x3bfe50[_0x4a6c('0x3a')],_0x3bfe50[_0x4a6c('0x36')]);_0x1e5cce[_0x4a6c('0x3b')]=_['intersection'](_0x3bfe50[_0x4a6c('0x3a')],qs['fields'](_0x4454be['query']['fields']));_0x1e5cce['attributes']=_0x1e5cce['attributes']['length']?_0x1e5cce[_0x4a6c('0x3b')]:_0x3bfe50[_0x4a6c('0x3a')];if(_0x4454be['query']['includeAll']){_0x1e5cce[_0x4a6c('0xaf')]=[{'all':!![]}];}_0x1e5cce=_[_0x4a6c('0x95')]({},_0x1e5cce,_0x4454be[_0x4a6c('0xb0')]);return db[_0x4a6c('0x31')][_0x4a6c('0x57')](_0x1e5cce)[_0x4a6c('0x2d')](handleEntityNotFound(_0xdb4519,null))[_0x4a6c('0x2d')](respondWithResult(_0xdb4519,null))[_0x4a6c('0x2e')](handleError(_0xdb4519,null));};exports[_0x4a6c('0xb1')]=function(_0x2f8be3,_0xecb04b){return db[_0x4a6c('0x31')]['create'](_0x2f8be3[_0x4a6c('0xb2')],{})[_0x4a6c('0x2d')](respondWithResult(_0xecb04b,0xc9))['catch'](handleError(_0xecb04b,null));};exports[_0x4a6c('0xb3')]=function(_0x32d2e0,_0x14f3e4){if(_0x32d2e0[_0x4a6c('0xb2')]['id']){delete _0x32d2e0[_0x4a6c('0xb2')]['id'];}return db[_0x4a6c('0x31')][_0x4a6c('0x57')]({'where':{'id':_0x32d2e0['params']['id']}})[_0x4a6c('0x2d')](handleEntityNotFound(_0x14f3e4,null))[_0x4a6c('0x2d')](saveUpdates(_0x32d2e0[_0x4a6c('0xb2')],null))['then'](respondWithResult(_0x14f3e4,null))[_0x4a6c('0x2e')](handleError(_0x14f3e4,null));};exports[_0x4a6c('0xb4')]=function(_0x499a53,_0x235efc){return db[_0x4a6c('0x31')]['find']({'where':{'id':_0x499a53[_0x4a6c('0xae')]['id']}})['then'](handleEntityNotFound(_0x235efc,null))[_0x4a6c('0x2d')](removeEntity(_0x235efc,null))[_0x4a6c('0x2e')](handleError(_0x235efc,null));};exports[_0x4a6c('0xb5')]=function(_0x1a90ef,_0x2579b5){return db[_0x4a6c('0x31')][_0x4a6c('0xb5')]()[_0x4a6c('0x2d')](respondWithResult(_0x2579b5,null))[_0x4a6c('0x2e')](handleError(_0x2579b5,null));};exports[_0x4a6c('0xb6')]=function(_0x2b01d6,_0x29b2dd,_0x383c8c){return db[_0x4a6c('0xb7')]['find']({'where':{'id':_0x2b01d6[_0x4a6c('0xae')]['id']}})[_0x4a6c('0x2d')](handleEntityNotFound(_0x29b2dd,null))[_0x4a6c('0x2d')](function(_0x7b3d07){if(_0x7b3d07){return _0x7b3d07[_0x4a6c('0xb6')](_0x2b01d6[_0x4a6c('0xb2')][_0x4a6c('0xb8')],_['omit'](_0x2b01d6[_0x4a6c('0xb2')],[_0x4a6c('0xb8'),'id'])||{});}})[_0x4a6c('0x2d')](respondWithResult(_0x29b2dd,null))[_0x4a6c('0x2e')](handleError(_0x29b2dd,null));};exports[_0x4a6c('0xb9')]=function(_0xdc7408,_0x4cbc9d,_0x5c1c35){var _0x2b7cba={'raw':![],'where':{}};var _0x29a1={};var _0x2c4208={'count':0x0,'rows':[]};return db[_0x4a6c('0x31')][_0x4a6c('0xba')]({'where':{'id':_0xdc7408[_0x4a6c('0xae')]['id']}})[_0x4a6c('0x2d')](handleEntityNotFound(_0x4cbc9d,null))[_0x4a6c('0x2d')](function(_0x9d27b3){if(_0x9d27b3){_0x29a1['model']=_[_0x4a6c('0x37')](db[_0x4a6c('0xb7')][_0x4a6c('0x32')]);_0x29a1['query']=_[_0x4a6c('0x37')](_0xdc7408['query']);_0x29a1[_0x4a6c('0x38')]=_[_0x4a6c('0x39')](_0x29a1[_0x4a6c('0x3a')],_0x29a1[_0x4a6c('0x36')]);_0x2b7cba[_0x4a6c('0x3b')]=_['intersection'](_0x29a1[_0x4a6c('0x3a')],qs['fields'](_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x3c')]));_0x2b7cba['attributes']=_0x2b7cba['attributes'][_0x4a6c('0x3d')]?_0x2b7cba[_0x4a6c('0x3b')]:_0x29a1['model'];if(!_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x3e')]('nolimit')){_0x2b7cba['limit']=qs[_0x4a6c('0x21')](_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x21')]);_0x2b7cba[_0x4a6c('0x1e')]=qs[_0x4a6c('0x1e')](_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x1e')]);}_0x2b7cba[_0x4a6c('0x89')]=qs[_0x4a6c('0xbb')](_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0xbb')]);_0x2b7cba[_0x4a6c('0x75')]=qs[_0x4a6c('0x38')](_[_0x4a6c('0x40')](_0xdc7408[_0x4a6c('0x36')],_0x29a1[_0x4a6c('0x38')]));_0x2b7cba[_0x4a6c('0x75')]['SmsInteractionId']=_0x9d27b3['id'];if(_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x7d')]){_0x2b7cba[_0x4a6c('0x75')]=_[_0x4a6c('0x95')](_0x2b7cba[_0x4a6c('0x75')],{'$or':_[_0x4a6c('0x30')](_0x2b7cba[_0x4a6c('0x3b')],function(_0x22b3d3){var _0x55e0a6={};_0x55e0a6[_0x22b3d3]={'$like':'%'+_0xdc7408[_0x4a6c('0x36')]['filter']+'%'};return _0x55e0a6;})});}if(_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x73')]){var _0x4c2e22=_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x73')]['split'](',');var _0x50268c={};_0x50268c[_0x4c2e22[0x0]]={'$gte':moment(_0x4c2e22[0x1])[_0x4a6c('0xbc')](_0x4a6c('0xbd'))};_0x2b7cba[_0x4a6c('0x75')]=_[_0x4a6c('0x95')](_0x2b7cba[_0x4a6c('0x75')],_0x50268c);}_0x2b7cba=_['merge']({},_0x2b7cba,_0xdc7408[_0x4a6c('0xb0')]);return db[_0x4a6c('0xb7')][_0x4a6c('0x20')]({'where':_0x2b7cba[_0x4a6c('0x75')]})['then'](function(_0x551ec8){_0x2c4208[_0x4a6c('0x20')]=_0x551ec8;if(_0xdc7408[_0x4a6c('0x36')]['includeAll']){_0x2b7cba[_0x4a6c('0xaf')]=[{'all':!![]}];}return db[_0x4a6c('0xb7')][_0x4a6c('0xbe')](_0x2b7cba);})[_0x4a6c('0x2d')](function(_0x96733f){_0x2c4208[_0x4a6c('0xac')]=_0x96733f;return _0x2c4208;});}})[_0x4a6c('0x2d')](respondWithFilteredResult(_0x4cbc9d,_0x2b7cba))[_0x4a6c('0x2e')](handleError(_0x4cbc9d,null));};exports[_0x4a6c('0xbf')]=function(_0x53a215,_0x2167e4,_0x14bd43){return db['SmsInteraction']['find']({'where':{'id':_0x53a215[_0x4a6c('0xae')]['id']}})['then'](handleEntityNotFound(_0x2167e4,null))['then'](function(_0x4c42fc){if(_0x4c42fc){return _0x4c42fc[_0x4a6c('0xc0')](_0x53a215['body'][_0x4a6c('0xb8')],_[_0x4a6c('0xc1')](_0x53a215[_0x4a6c('0xb2')],[_0x4a6c('0xb8'),'id'])||{})[_0x4a6c('0xc2')](function(){return db[_0x4a6c('0xc3')][_0x4a6c('0xbe')]({'attributes':['id',_0x4a6c('0x26'),_0x4a6c('0x42')],'where':{'id':_0x53a215[_0x4a6c('0xb2')]['ids']}});})[_0x4a6c('0x2d')](function(_0x2e0183){socket['emit'](_0x4a6c('0xc4'),{'id':Number(_0x53a215[_0x4a6c('0xae')]['id']),'tags':_0x2e0183||[]});return{'id':Number(_0x53a215['params']['id']),'tags':_0x2e0183||[]};});}})[_0x4a6c('0x2d')](respondWithResult(_0x2167e4,null))[_0x4a6c('0x2e')](handleError(_0x2167e4,null));};exports[_0x4a6c('0xc5')]=function(_0x46c281,_0x4a5d24,_0x58cebc){return db[_0x4a6c('0x31')][_0x4a6c('0x57')]({'where':{'id':_0x46c281[_0x4a6c('0xae')]['id']}})[_0x4a6c('0x2d')](handleEntityNotFound(_0x4a5d24,null))[_0x4a6c('0x2d')](function(_0x587709){if(_0x587709){return _0x587709['removeTags'](_0x46c281[_0x4a6c('0x36')][_0x4a6c('0xb8')]);}})['then'](respondWithStatusCode(_0x4a5d24,null))[_0x4a6c('0x2e')](handleError(_0x4a5d24,null));};exports[_0x4a6c('0xc6')]=function(_0x580247,_0x49ba89){var _0xcc561=moment()[_0x4a6c('0xc7')]()[_0x4a6c('0x93')]();var _0x1e1fbb=path[_0x4a6c('0xc8')](config['root'],'server',_0x4a6c('0xc9'),'tmp');var _0x4580ae=path[_0x4a6c('0xc8')](config[_0x4a6c('0xca')],'server',_0x4a6c('0xc9'),_0x4a6c('0xcb'));var _0x443d50=path[_0x4a6c('0xc8')](_0x1e1fbb,_0xcc561);var _0x4ddd4d=util[_0x4a6c('0xbc')](_0x4a6c('0xcc'),_0x580247[_0x4a6c('0xae')]['id'],_0xcc561);var _0x44c410=path[_0x4a6c('0xc8')](_0x1e1fbb,_0x4ddd4d);var _0x4a9244=[];_0x4a9244['push']({'model':db[_0x4a6c('0xcd')],'as':_0x4a6c('0xcd'),'attributes':['id',_0x4a6c('0x29')],'raw':!![]});_0x4a9244[_0x4a6c('0x2c')]({'model':db[_0x4a6c('0xce')],'as':_0x4a6c('0x5c'),'attributes':['id',_0x4a6c('0xcf'),_0x4a6c('0xd0')],'raw':!![]});var _0x5acd69=[{'model':db[_0x4a6c('0xb7')],'as':'Messages','attributes':['id',_0x4a6c('0xb2'),_0x4a6c('0x71'),_0x4a6c('0xd1'),_0x4a6c('0xd2'),_0x4a6c('0x79')],'include':_0x4a9244}];_0x5acd69[_0x4a6c('0x2c')]({'model':db[_0x4a6c('0xd3')],'as':_0x4a6c('0xd4'),'attributes':['id','name']});_0x5acd69['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x4a6c('0x29')]});return db[_0x4a6c('0x31')]['find']({'where':{'id':_0x580247['params']['id']},'include':_0x5acd69})[_0x4a6c('0x2d')](handleEntityNotFound(_0x49ba89,null))[_0x4a6c('0x2d')](function(_0x2d2487){if(_0x2d2487){var _0x5c2f2d=_0x2d2487['get']({'plain':!![]});fs[_0x4a6c('0xd5')](_0x443d50);var _0x2ec6ab={'channel':_0x4a6c('0xd6'),'account':_0x5c2f2d[_0x4a6c('0xd4')][_0x4a6c('0x26')],'agent':_0x5c2f2d[_0x4a6c('0xd7')]?_0x5c2f2d[_0x4a6c('0xd7')]['fullname']:'N.A.','createdAt':moment(_0x5c2f2d[_0x4a6c('0x71')])['format'](_0x4a6c('0xbd'))[_0x4a6c('0x93')](),'closedAt':_0x5c2f2d['closed']?moment(_0x5c2f2d[_0x4a6c('0xd8')])[_0x4a6c('0xbc')](_0x4a6c('0xbd'))[_0x4a6c('0x93')]():'','disposition':_0x5c2f2d[_0x4a6c('0xd9')],'messages':_(_0x5c2f2d[_0x4a6c('0xda')])[_0x4a6c('0x7d')]({'secret':![]})[_0x4a6c('0x30')](function(_0x180aee){return{'date':moment(_0x180aee['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4a6c('0x93')](),'sender':_0x180aee['direction']===_0x4a6c('0xdb')?_0x180aee['User']?_0x180aee[_0x4a6c('0xcd')][_0x4a6c('0x29')]:'System':_0x180aee[_0x4a6c('0x5c')][_0x4a6c('0xcf')]+(_0x180aee['Contact'][_0x4a6c('0xd0')]?'\x20'+_0x180aee[_0x4a6c('0x5c')][_0x4a6c('0xd0')]:''),'body':_0x180aee[_0x4a6c('0xb2')],'direction':_0x180aee[_0x4a6c('0xd1')]===_0x4a6c('0xdb')?'A':'C','secret':_0x180aee['secret'],'read':_0x180aee[_0x4a6c('0x79')]};})[_0x4a6c('0x59')]()};return ejs[_0x4a6c('0xdc')](path[_0x4a6c('0xc8')](config[_0x4a6c('0xca')],'server',_0x4a6c('0xdd'),_0x4a6c('0xde')),{'interaction':_0x2ec6ab})[_0x4a6c('0x2d')](function(_0x147bee){var _0x3f675c=path[_0x4a6c('0xc8')](_0x443d50,_0x4a6c('0xdf')+_0x5c2f2d['id']+'-'+_0xcc561+_0x4a6c('0xe0'));var _0x55b742={'path':_0x3f675c,'channel':_0x4a6c('0xd6'),'interactionId':_0x5c2f2d['id']};return pdf[_0x4a6c('0xe1')](_0x147bee,_0x55b742);})[_0x4a6c('0x2d')](function(){return new BPromise(function(_0x4e92d3,_0x4ff6b6){zipdir(_0x443d50,{'saveTo':_0x44c410},function(_0x59b560,_0x8c39cd){if(_0x59b560)return _0x4ff6b6(_0x59b560);return _0x4e92d3(_0x8c39cd);});})['then'](function(){return new BPromise(function(_0xec5e7f,_0x569457){rimraf(_0x443d50,function(_0x31f8ec){if(_0x31f8ec)_0x569457(_0x31f8ec);return _0xec5e7f();});});})[_0x4a6c('0x2d')](function(){return _0x49ba89[_0x4a6c('0xc6')](_0x44c410,_0x4ddd4d,function(_0x9875c8){if(_0x9875c8){console[_0x4a6c('0xe2')](_0x4a6c('0xe3'),_0x9875c8);}else{fs[_0x4a6c('0xe4')](_0x44c410);}});});});}else{return _0x49ba89[_0x4a6c('0x1a')](0xc8);}})[_0x4a6c('0x2e')](handleError(_0x49ba89,null));};
\ No newline at end of file
index e440d37..da63573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb44a=['hook','exports','SmsInteraction','SmsMessage','update','getUsers','then','setDataValue','Users','map','findAll','length','catch','hasOwnProperty'];(function(_0x41af1d,_0xfd0190){var _0x31131f=function(_0x4b0406){while(--_0x4b0406){_0x41af1d['push'](_0x41af1d['shift']());}};_0x31131f(++_0xfd0190);}(_0xb44a,0x1c2));var _0xab44=function(_0x2460d9,_0x15da87){_0x2460d9=_0x2460d9-0x0;var _0x4bc204=_0xb44a[_0x2460d9];return _0x4bc204;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0xab44('0x0')];var SmsMessage=require('../../mysqldb')['db'][_0xab44('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xab44('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1b9e05){return function(_0x32396c,_0x2e3662,_0x28681a){_0x32396c[_0xab44('0x3')]({'attributes':['id'],'raw':!![]})[_0xab44('0x4')](function(_0x3ead8d){_0x32396c[_0xab44('0x5')](_0xab44('0x6'),_0x3ead8d[_0xab44('0x7')](function(_0x2ba1c1){return{'id':_0x2ba1c1['id']};}));return SmsMessage[_0xab44('0x8')]({'where':{'SmsInteractionId':_0x32396c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xab44('0x4')](function(_0x55c7d2){_0x32396c[_0xab44('0x5')]('unreadMessages',_0x55c7d2[_0xab44('0x9')]);SmsInteractionEvents['emit'](_0x1b9e05+':'+_0x32396c['id'],_0x32396c);SmsInteractionEvents['emit'](_0x1b9e05,_0x32396c);_0x28681a(null);})[_0xab44('0xa')](_0x28681a(null));};}for(var e in events){if(events[_0xab44('0xb')](e)){var event=events[e];SmsInteraction[_0xab44('0xc')](e,emitEvent(event));}}module[_0xab44('0xd')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x8952=['Users','map','findAll','unreadMessages','catch','hasOwnProperty','hook','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','setDataValue'];(function(_0x2d6bf3,_0x267f85){var _0x122b86=function(_0x307fa4){while(--_0x307fa4){_0x2d6bf3['push'](_0x2d6bf3['shift']());}};_0x122b86(++_0x267f85);}(_0x8952,0x17e));var _0x2895=function(_0x2c8b0b,_0x4ac922){_0x2c8b0b=_0x2c8b0b-0x0;var _0x4ee90b=_0x8952[_0x2c8b0b];return _0x4ee90b;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2895('0x0'))['db'][_0x2895('0x1')];var SmsMessage=require(_0x2895('0x0'))['db'][_0x2895('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2895('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2895('0x4'),'afterDestroy':_0x2895('0x5')};function emitEvent(_0x1f69f6){return function(_0x5b28c6,_0x32429c,_0x73c245){_0x5b28c6[_0x2895('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x526c32){_0x5b28c6[_0x2895('0x7')](_0x2895('0x8'),_0x526c32[_0x2895('0x9')](function(_0x294446){return{'id':_0x294446['id']};}));return SmsMessage[_0x2895('0xa')]({'where':{'SmsInteractionId':_0x5b28c6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x14fb67){_0x5b28c6['setDataValue'](_0x2895('0xb'),_0x14fb67['length']);SmsInteractionEvents['emit'](_0x1f69f6+':'+_0x5b28c6['id'],_0x5b28c6);SmsInteractionEvents['emit'](_0x1f69f6,_0x5b28c6);_0x73c245(null);})[_0x2895('0xc')](_0x73c245(null));};}for(var e in events){if(events[_0x2895('0xd')](e)){var event=events[e];SmsInteraction[_0x2895('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
index ff797e6..322dd67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee92=['path','rimraf','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x4b1df1,_0x332a89){var _0x39ad9b=function(_0x57653b){while(--_0x57653b){_0x4b1df1['push'](_0x4b1df1['shift']());}};_0x39ad9b(++_0x332a89);}(_0xee92,0x1a0));var _0x2ee9=function(_0x43371b,_0x193bf3){_0x43371b=_0x43371b-0x0;var _0x413af8=_0xee92[_0x43371b];return _0x413af8;};'use strict';var _=require('lodash');var util=require(_0x2ee9('0x0'));var logger=require(_0x2ee9('0x1'))(_0x2ee9('0x2'));var moment=require(_0x2ee9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ee9('0x4'));var rimraf=require(_0x2ee9('0x5'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x5b104a,_0x715a5f){return _0x5b104a[_0x2ee9('0x6')](_0x2ee9('0x7'),attributes,{'tableName':_0x2ee9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1bbd23,_0x157ee6,_0x68ffeb){if(_0x1bbd23[_0x2ee9('0x9')](_0x2ee9('0xa'))){_0x1bbd23[_0x2ee9('0xb')]=moment()[_0x2ee9('0xc')](_0x2ee9('0xd'));}_0x68ffeb(null,_0x1bbd23);}}});};
\ No newline at end of file
+var _0xd6e3=['request-promise','path','rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0xd6e3,0x1ea));var _0x3d6e=function(_0x3c4e37,_0x37b07d){_0x3c4e37=_0x3c4e37-0x0;var _0x1d9efc=_0xd6e3[_0x3c4e37];return _0x1d9efc;};'use strict';var _=require('lodash');var util=require(_0x3d6e('0x0'));var logger=require(_0x3d6e('0x1'))(_0x3d6e('0x2'));var moment=require(_0x3d6e('0x3'));var BPromise=require(_0x3d6e('0x4'));var rp=require(_0x3d6e('0x5'));var fs=require('fs');var path=require(_0x3d6e('0x6'));var rimraf=require(_0x3d6e('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d6e('0x8'));module['exports']=function(_0x55b47a,_0x5dfdc8){return _0x55b47a[_0x3d6e('0x9')](_0x3d6e('0xa'),attributes,{'tableName':_0x3d6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e6f59,_0xeef585,_0x263e9d){if(_0x2e6f59[_0x3d6e('0xc')]('closed')){_0x2e6f59['closedAt']=moment()[_0x3d6e('0xd')](_0x3d6e('0xe'));}_0x263e9d(null,_0x2e6f59);}}});};
\ No newline at end of file
index 1b3eab8..40d5b3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa136=['attributes','stringify','AddTagsToSmsInteraction','addTags','ids','omit','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateSmsInteraction','body','options','where'];(function(_0x1769a8,_0x328d23){var _0x217eb8=function(_0xd82868){while(--_0xd82868){_0x1769a8['push'](_0x1769a8['shift']());}};_0x217eb8(++_0x328d23);}(_0xa136,0x19f));var _0x6a13=function(_0x24182f,_0x5b066b){_0x24182f=_0x24182f-0x0;var _0x479194=_0xa136[_0x24182f];return _0x479194;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a13('0x0'));var BPromise=require(_0x6a13('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a13('0x2'));var db=require(_0x6a13('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a13('0x4'))(_0x6a13('0x5'));var config=require(_0x6a13('0x6'));var jayson=require(_0x6a13('0x7'));var client=jayson[_0x6a13('0x8')][_0x6a13('0x9')]({'port':0x232a});config[_0x6a13('0xa')]=_[_0x6a13('0xb')](config['redis'],{'host':_0x6a13('0xc'),'port':0x18eb});var socket=require(_0x6a13('0xd'))(new Redis(config['redis']));require(_0x6a13('0xe'))[_0x6a13('0xf')](socket);function respondWithRpcPromise(_0x38411a,_0x1e484f,_0x2b38ac){return new BPromise(function(_0x43a43f,_0x518874){return client['request'](_0x38411a,_0x2b38ac)[_0x6a13('0x10')](function(_0x5b620c){logger[_0x6a13('0x11')](_0x6a13('0x12'),_0x1e484f,_0x6a13('0x13'));logger[_0x6a13('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x1e484f,_0x6a13('0x13'),JSON['stringify'](_0x5b620c));if(_0x5b620c[_0x6a13('0x15')]){if(_0x5b620c[_0x6a13('0x15')]['code']===0x1f4){logger[_0x6a13('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x1e484f,_0x5b620c[_0x6a13('0x15')][_0x6a13('0x16')]);return _0x518874(_0x5b620c[_0x6a13('0x15')][_0x6a13('0x16')]);}logger[_0x6a13('0x15')](_0x6a13('0x12'),_0x1e484f,_0x5b620c[_0x6a13('0x15')][_0x6a13('0x16')]);return _0x43a43f(_0x5b620c[_0x6a13('0x15')]['message']);}else{logger[_0x6a13('0x11')](_0x6a13('0x12'),_0x1e484f,_0x6a13('0x13'));_0x43a43f(_0x5b620c[_0x6a13('0x17')][_0x6a13('0x16')]);}})[_0x6a13('0x18')](function(_0x4bc1ec){logger[_0x6a13('0x15')](_0x6a13('0x12'),_0x1e484f,_0x4bc1ec);_0x518874(_0x4bc1ec);});});}exports[_0x6a13('0x19')]=function(_0xa1f60e){var _0x3fd0d8=this;return new Promise(function(_0x293590,_0x2c6a26){return db['SmsInteraction']['update'](_0xa1f60e[_0x6a13('0x1a')],{'raw':_0xa1f60e[_0x6a13('0x1b')]?_0xa1f60e[_0x6a13('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa1f60e['options']?_0xa1f60e[_0x6a13('0x1b')][_0x6a13('0x1c')]||null:null,'attributes':_0xa1f60e[_0x6a13('0x1b')]?_0xa1f60e[_0x6a13('0x1b')][_0x6a13('0x1d')]||null:null,'limit':_0xa1f60e[_0x6a13('0x1b')]?_0xa1f60e[_0x6a13('0x1b')]['limit']||null:null})[_0x6a13('0x10')](function(_0xeb7fe1){logger[_0x6a13('0x11')](_0x6a13('0x19'),_0xa1f60e);logger['debug'](_0x6a13('0x19'),_0xa1f60e,JSON[_0x6a13('0x1e')](_0xeb7fe1));_0x293590(_0xeb7fe1);})['catch'](function(_0x366898){logger[_0x6a13('0x15')](_0x6a13('0x19'),_0x366898[_0x6a13('0x16')],_0xa1f60e);_0x2c6a26(_0x3fd0d8[_0x6a13('0x15')](0x1f4,_0x366898[_0x6a13('0x16')]));});});};exports[_0x6a13('0x1f')]=function(_0x75df5f){return new Promise(function(_0x1e8459,_0x1b9a3b){return db['SmsInteraction']['find']({'where':_0x75df5f[_0x6a13('0x1b')]?_0x75df5f[_0x6a13('0x1b')][_0x6a13('0x1c')]||null:null})[_0x6a13('0x10')](function(_0x464ea8){if(_0x464ea8){return _0x464ea8[_0x6a13('0x20')](_0x75df5f['body'][_0x6a13('0x21')],_[_0x6a13('0x22')](_0x75df5f['body'],[_0x6a13('0x21'),'id'])||{});}})[_0x6a13('0x23')](function(_0x34e37a){logger[_0x6a13('0x11')](_0x6a13('0x24'),_0x75df5f);logger[_0x6a13('0x14')](_0x6a13('0x24'),_0x75df5f,JSON['stringify'](_0x34e37a));_0x1e8459(_0x34e37a);})[_0x6a13('0x18')](function(_0x26fbb9){logger[_0x6a13('0x15')](_0x6a13('0x24'),_0x26fbb9[_0x6a13('0x16')],_0x75df5f);_0x1b9a3b(_this[_0x6a13('0x15')](0x1f4,_0x26fbb9[_0x6a13('0x16')]));});});};
\ No newline at end of file
+var _0xd959=['redis','./smsInteraction.socket','register','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsInteraction,\x20%s,\x20%s','result','UpdateSmsInteraction','SmsInteraction','body','options','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost'];(function(_0x20edb2,_0x127ca7){var _0x24e94a=function(_0x52163a){while(--_0x52163a){_0x20edb2['push'](_0x20edb2['shift']());}};_0x24e94a(++_0x127ca7);}(_0xd959,0x67));var _0x9d95=function(_0x509922,_0x5c0ed4){_0x509922=_0x509922-0x0;var _0xe7ba01=_0xd959[_0x509922];return _0xe7ba01;};'use strict';var _=require('lodash');var util=require(_0x9d95('0x0'));var moment=require(_0x9d95('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d95('0x2'))['db'];var utils=require(_0x9d95('0x3'));var logger=require(_0x9d95('0x4'))(_0x9d95('0x5'));var config=require(_0x9d95('0x6'));var jayson=require(_0x9d95('0x7'));var client=jayson[_0x9d95('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9d95('0x9')](config['redis'],{'host':_0x9d95('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d95('0xb')]));require(_0x9d95('0xc'))[_0x9d95('0xd')](socket);function respondWithRpcPromise(_0x5c7076,_0x1af7cc,_0x133247){return new BPromise(function(_0x4cf1eb,_0x5b09b3){return client['request'](_0x5c7076,_0x133247)['then'](function(_0x21a09b){logger[_0x9d95('0xe')]('SmsInteraction,\x20%s,\x20%s',_0x1af7cc,_0x9d95('0xf'));logger[_0x9d95('0x10')](_0x9d95('0x11'),_0x1af7cc,'request\x20sent',JSON[_0x9d95('0x12')](_0x21a09b));if(_0x21a09b[_0x9d95('0x13')]){if(_0x21a09b['error']['code']===0x1f4){logger[_0x9d95('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x1af7cc,_0x21a09b[_0x9d95('0x13')][_0x9d95('0x14')]);return _0x5b09b3(_0x21a09b[_0x9d95('0x13')][_0x9d95('0x14')]);}logger[_0x9d95('0x13')](_0x9d95('0x15'),_0x1af7cc,_0x21a09b[_0x9d95('0x13')][_0x9d95('0x14')]);return _0x4cf1eb(_0x21a09b[_0x9d95('0x13')][_0x9d95('0x14')]);}else{logger[_0x9d95('0xe')](_0x9d95('0x15'),_0x1af7cc,'request\x20sent');_0x4cf1eb(_0x21a09b[_0x9d95('0x16')]['message']);}})['catch'](function(_0x38a4ac){logger['error'](_0x9d95('0x15'),_0x1af7cc,_0x38a4ac);_0x5b09b3(_0x38a4ac);});});}exports[_0x9d95('0x17')]=function(_0x334052){var _0x577c16=this;return new Promise(function(_0x108a30,_0x26ef26){return db[_0x9d95('0x18')]['update'](_0x334052[_0x9d95('0x19')],{'raw':_0x334052['options']?_0x334052[_0x9d95('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x334052['options']?_0x334052[_0x9d95('0x1a')]['where']||null:null,'attributes':_0x334052[_0x9d95('0x1a')]?_0x334052[_0x9d95('0x1a')][_0x9d95('0x1b')]||null:null,'limit':_0x334052[_0x9d95('0x1a')]?_0x334052['options'][_0x9d95('0x1c')]||null:null})[_0x9d95('0x1d')](function(_0x15ac7a){logger[_0x9d95('0xe')](_0x9d95('0x17'),_0x334052);logger[_0x9d95('0x10')](_0x9d95('0x17'),_0x334052,JSON[_0x9d95('0x12')](_0x15ac7a));_0x108a30(_0x15ac7a);})['catch'](function(_0x2954cd){logger[_0x9d95('0x13')]('UpdateSmsInteraction',_0x2954cd['message'],_0x334052);_0x26ef26(_0x577c16[_0x9d95('0x13')](0x1f4,_0x2954cd[_0x9d95('0x14')]));});});};exports[_0x9d95('0x1e')]=function(_0x2c0442){return new Promise(function(_0x2b2103,_0x1ca101){return db[_0x9d95('0x18')][_0x9d95('0x1f')]({'where':_0x2c0442['options']?_0x2c0442[_0x9d95('0x1a')]['where']||null:null})[_0x9d95('0x1d')](function(_0xfd5c5a){if(_0xfd5c5a){return _0xfd5c5a[_0x9d95('0x20')](_0x2c0442[_0x9d95('0x19')][_0x9d95('0x21')],_[_0x9d95('0x22')](_0x2c0442['body'],[_0x9d95('0x21'),'id'])||{});}})[_0x9d95('0x23')](function(_0x429542){logger[_0x9d95('0xe')](_0x9d95('0x24'),_0x2c0442);logger[_0x9d95('0x10')](_0x9d95('0x24'),_0x2c0442,JSON['stringify'](_0x429542));_0x2b2103(_0x429542);})[_0x9d95('0x25')](function(_0x33c887){logger[_0x9d95('0x13')](_0x9d95('0x24'),_0x33c887['message'],_0x2c0442);_0x1ca101(_this[_0x9d95('0x13')](0x1f4,_0x33c887[_0x9d95('0x14')]));});});};
\ No newline at end of file
index c9bc52d..4eae3d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e23=['save','update','register','length','smsInteraction:','./smsInteraction.events'];(function(_0xcb6793,_0x3d715a){var _0x177538=function(_0x15ccaf){while(--_0x15ccaf){_0xcb6793['push'](_0xcb6793['shift']());}};_0x177538(++_0x3d715a);}(_0x9e23,0xa7));var _0x39e2=function(_0x32b9af,_0x25d366){_0x32b9af=_0x32b9af-0x0;var _0x325ece=_0x9e23[_0x32b9af];return _0x325ece;};'use strict';var SmsInteractionEvents=require(_0x39e2('0x0'));var events=[_0x39e2('0x1'),'remove',_0x39e2('0x2')];function createListener(_0x430429,_0x3c9b1b){return function(_0x31c981){_0x3c9b1b['emit'](_0x430429,_0x31c981);};}function removeListener(_0xff5cec,_0x3948cb){return function(){SmsInteractionEvents['removeListener'](_0xff5cec,_0x3948cb);};}exports[_0x39e2('0x3')]=function(_0x253f04){for(var _0x3f5be0=0x0,_0x1b543f=events[_0x39e2('0x4')];_0x3f5be0<_0x1b543f;_0x3f5be0++){var _0x518bd7=events[_0x3f5be0];var _0x9c544d=createListener(_0x39e2('0x5')+_0x518bd7,_0x253f04);SmsInteractionEvents['on'](_0x518bd7,_0x9c544d);}};
\ No newline at end of file
+var _0xa14c=['smsInteraction:','./smsInteraction.events','update','emit','removeListener','register','length'];(function(_0x5e28c2,_0x1e48ab){var _0x1a8cc6=function(_0x1218bf){while(--_0x1218bf){_0x5e28c2['push'](_0x5e28c2['shift']());}};_0x1a8cc6(++_0x1e48ab);}(_0xa14c,0x182));var _0xca14=function(_0x5d4caa,_0x1cc966){_0x5d4caa=_0x5d4caa-0x0;var _0x4c8bbd=_0xa14c[_0x5d4caa];return _0x4c8bbd;};'use strict';var SmsInteractionEvents=require(_0xca14('0x0'));var events=['save','remove',_0xca14('0x1')];function createListener(_0x4eaf3b,_0x5c92a6){return function(_0x21f99c){_0x5c92a6[_0xca14('0x2')](_0x4eaf3b,_0x21f99c);};}function removeListener(_0x49f341,_0xa68aea){return function(){SmsInteractionEvents[_0xca14('0x3')](_0x49f341,_0xa68aea);};}exports[_0xca14('0x4')]=function(_0x12c303){for(var _0x437858=0x0,_0x5f41af=events[_0xca14('0x5')];_0x437858<_0x5f41af;_0x437858++){var _0x4dedfc=events[_0x437858];var _0x4a688e=createListener(_0xca14('0x6')+_0x4dedfc,_0x12c303);SmsInteractionEvents['on'](_0x4dedfc,_0x4a688e);}};
\ No newline at end of file
index b385102..ac816b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe073=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','sms','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0xe073,0x1b6));var _0x3e07=function(_0x524166,_0x50c5d0){_0x524166=_0x524166-0x0;var _0x40e721=_0xe073[_0x524166];return _0x40e721;};'use strict';var multer=require(_0x3e07('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3e07('0x1'));var express=require(_0x3e07('0x2'));var router=express[_0x3e07('0x3')]();var fs_extra=require(_0x3e07('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3e07('0x5'));var config=require(_0x3e07('0x6'));var controller=require(_0x3e07('0x7'));router[_0x3e07('0x8')]('/',auth[_0x3e07('0x9')](),controller[_0x3e07('0xa')]);router[_0x3e07('0x8')](_0x3e07('0xb'),auth[_0x3e07('0x9')](),controller['describe']);router[_0x3e07('0x8')](_0x3e07('0xc'),auth['isAuthenticated'](),controller[_0x3e07('0xd')]);router[_0x3e07('0xe')]('/',auth['isAuthenticated'](),interaction[_0x3e07('0xf')](_0x3e07('0x10'),'smsmessage:create'),controller[_0x3e07('0x11')]);router['post'](_0x3e07('0x12'),controller[_0x3e07('0x13')]);router[_0x3e07('0x14')](_0x3e07('0xc'),auth[_0x3e07('0x9')](),controller[_0x3e07('0x15')]);router[_0x3e07('0x14')](_0x3e07('0x16'),auth[_0x3e07('0x9')](),controller[_0x3e07('0x17')]);router[_0x3e07('0x14')](_0x3e07('0x18'),auth[_0x3e07('0x9')](),controller[_0x3e07('0x19')]);router[_0x3e07('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x3e07('0x1b')]);module[_0x3e07('0x1c')]=router;
\ No newline at end of file
+var _0xf6c1=['get','isAuthenticated','index','describe','/:id','show','post','create','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36115d,_0x4071a1){var _0x58cd1f=function(_0x43c7bd){while(--_0x43c7bd){_0x36115d['push'](_0x36115d['shift']());}};_0x58cd1f(++_0x4071a1);}(_0xf6c1,0x149));var _0x1f6c=function(_0x9f9daa,_0x4f0c8f){_0x9f9daa=_0x9f9daa-0x0;var _0x3684d3=_0xf6c1[_0x9f9daa];return _0x3684d3;};'use strict';var multer=require(_0x1f6c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1f6c('0x1'));var express=require('express');var router=express[_0x1f6c('0x2')]();var fs_extra=require(_0x1f6c('0x3'));var auth=require(_0x1f6c('0x4'));var interaction=require(_0x1f6c('0x5'));var config=require(_0x1f6c('0x6'));var controller=require('./smsMessage.controller');router[_0x1f6c('0x7')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x9')]);router[_0x1f6c('0x7')]('/describe',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xa')]);router[_0x1f6c('0x7')](_0x1f6c('0xb'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xc')]);router[_0x1f6c('0xd')]('/',auth[_0x1f6c('0x8')](),interaction['tracked']('sms','smsmessage:create'),controller[_0x1f6c('0xe')]);router[_0x1f6c('0xd')]('/:id/status',controller[_0x1f6c('0xf')]);router[_0x1f6c('0x10')]('/:id',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x11')]);router[_0x1f6c('0x10')](_0x1f6c('0x12'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x13')]);router[_0x1f6c('0x10')]('/:id/reject',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x14')]);router[_0x1f6c('0x15')](_0x1f6c('0xb'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x16')]);module[_0x1f6c('0x17')]=router;
\ No newline at end of file
index 0f64614..554d9cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x711c=['ENUM','STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x711c,0x74));var _0xc711=function(_0x2ab924,_0x54d9e4){_0x2ab924=_0x2ab924-0x0;var _0x531cd0=_0x711c[_0x2ab924];return _0x531cd0;};'use strict';var Sequelize=require(_0xc711('0x0'));module[_0xc711('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc711('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc711('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc711('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xc711('0x5')]},'readAt':{'type':Sequelize[_0xc711('0x6')]},'secret':{'type':Sequelize[_0xc711('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc711('0x5')]},'providerResponse':{'type':Sequelize[_0xc711('0x7')]}};
\ No newline at end of file
+var _0xf64e=['exports','medium','ENUM','out','STRING','BOOLEAN'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0xf64e,0x66));var _0xef64=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf64e[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module[_0xef64('0x0')]={'body':{'type':Sequelize['TEXT'](_0xef64('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xef64('0x2')]('in',_0xef64('0x3')),'defaultValue':_0xef64('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xef64('0x4')](0xbe)},'phone':{'type':Sequelize[_0xef64('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xef64('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xef64('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 382f548..a3e72de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a12=['update','end','stack','name','map','SmsMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','include','rows','includeAll','create','body','find','params','destroy','describe','sms-interactions','accept','sms','readAt','format','UserId','user','agent','get','SmsInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','channel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','inspect','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','http','client','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','json','reject'];(function(_0x270f10,_0x520a15){var _0x3aba28=function(_0x36eefc){while(--_0x36eefc){_0x270f10['push'](_0x270f10['shift']());}};_0x3aba28(++_0x520a15);}(_0x7a12,0xe8));var _0x27a1=function(_0x4f4cfd,_0xe8a8be){_0x4f4cfd=_0x4f4cfd-0x0;var _0x5a6dae=_0x7a12[_0x4f4cfd];return _0x5a6dae;};'use strict';var emlformat=require(_0x27a1('0x0'));var rimraf=require(_0x27a1('0x1'));var zipdir=require(_0x27a1('0x2'));var jsonpatch=require(_0x27a1('0x3'));var rp=require(_0x27a1('0x4'));var moment=require(_0x27a1('0x5'));var BPromise=require(_0x27a1('0x6'));var Mustache=require(_0x27a1('0x7'));var util=require('util');var path=require(_0x27a1('0x8'));var sox=require(_0x27a1('0x9'));var csv=require(_0x27a1('0xa'));var ejs=require(_0x27a1('0xb'));var fs=require('fs');var fs_extra=require(_0x27a1('0xc'));var _=require(_0x27a1('0xd'));var squel=require('squel');var crypto=require(_0x27a1('0xe'));var jsforce=require(_0x27a1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x27a1('0xa'));var querystring=require(_0x27a1('0x10'));var Papa=require('papaparse');var Redis=require(_0x27a1('0x11'));var authService=require(_0x27a1('0x12'));var qs=require(_0x27a1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27a1('0x14'));var logger=require(_0x27a1('0x15'))(_0x27a1('0x16'));var utils=require(_0x27a1('0x17'));var config=require(_0x27a1('0x18'));var licenseUtil=require(_0x27a1('0x19'));var db=require(_0x27a1('0x1a'))['db'];config['redis']=_[_0x27a1('0x1b')](config[_0x27a1('0x1c')],{'host':_0x27a1('0x1d'),'port':0x18eb});var socket=require(_0x27a1('0x1e'))(new Redis(config['redis']));require(_0x27a1('0x1f'))[_0x27a1('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x27a1('0x21')]({'port':0x232c});var client9002=jayson[_0x27a1('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x443cff,_0x17ebb1,_0x5d5b4a,_0xe3f54){return new BPromise(function(_0x3efeff,_0x1722e8){var _0xbd87d1=_0xe3f54||client;return _0xbd87d1['request'](_0x443cff,_0x5d5b4a)[_0x27a1('0x23')](function(_0x5800cc){logger[_0x27a1('0x24')](_0x27a1('0x25'),_0x17ebb1,'request\x20sent');logger[_0x27a1('0x26')](_0x27a1('0x27'),_0x17ebb1,_0x27a1('0x28'),JSON[_0x27a1('0x29')](_0x5800cc));if(_0x5800cc['error']){if(_0x5800cc[_0x27a1('0x2a')][_0x27a1('0x2b')]===0x1f4){logger[_0x27a1('0x2a')](_0x27a1('0x25'),_0x17ebb1,_0x5800cc[_0x27a1('0x2a')]['message']);return _0x1722e8(_0x5800cc[_0x27a1('0x2a')][_0x27a1('0x2c')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x17ebb1,_0x5800cc[_0x27a1('0x2a')]['message']);return _0x3efeff(_0x5800cc[_0x27a1('0x2a')][_0x27a1('0x2c')]);}else{logger[_0x27a1('0x24')](_0x27a1('0x25'),_0x17ebb1,_0x27a1('0x28'));_0x3efeff(_0x5800cc[_0x27a1('0x2d')]['message']);}})[_0x27a1('0x2e')](function(_0x25307a){logger['error'](_0x27a1('0x25'),_0x17ebb1,_0x25307a);_0x1722e8(_0x25307a);});});}function respondWithStatusCode(_0x530e54,_0x1ef90c){_0x1ef90c=_0x1ef90c||0xcc;return function(_0x5d4b36){if(_0x5d4b36){return _0x530e54[_0x27a1('0x2f')](_0x1ef90c);}return _0x530e54[_0x27a1('0x30')](_0x1ef90c)['end']();};}function respondWithResult(_0x7083e8,_0x17c6f7){_0x17c6f7=_0x17c6f7||0xc8;return function(_0x2748d0){if(_0x2748d0){return _0x7083e8[_0x27a1('0x30')](_0x17c6f7)['json'](_0x2748d0);}};}function respondWithFilteredResult(_0x353b18,_0x4ecc83){return function(_0x2089aa){if(_0x2089aa){var _0x23e8b2=typeof _0x4ecc83[_0x27a1('0x31')]===_0x27a1('0x32')&&typeof _0x4ecc83['limit']===_0x27a1('0x32');var _0xaeed0c=_0x2089aa[_0x27a1('0x33')];var _0x3feec5=_0x23e8b2?0x0:_0x4ecc83[_0x27a1('0x31')];var _0x4c52a9=_0x23e8b2?_0x2089aa[_0x27a1('0x33')]:_0x4ecc83['offset']+_0x4ecc83[_0x27a1('0x34')];var _0x43e34e;if(_0x4c52a9>=_0xaeed0c){_0x4c52a9=_0xaeed0c;_0x43e34e=0xc8;}else{_0x43e34e=0xce;}_0x353b18['status'](_0x43e34e);return _0x353b18[_0x27a1('0x35')]('Content-Range',_0x3feec5+'-'+_0x4c52a9+'/'+_0xaeed0c)[_0x27a1('0x36')](_0x2089aa);}return null;};}function patchUpdates(_0x256dc2){return function(_0xc35538){try{jsonpatch['apply'](_0xc35538,_0x256dc2,!![]);}catch(_0x5bc0da){return BPromise[_0x27a1('0x37')](_0x5bc0da);}return _0xc35538['save']();};}function saveUpdates(_0x50a71c,_0x45e4a3){return function(_0x3fdf07){if(_0x3fdf07){return _0x3fdf07[_0x27a1('0x38')](_0x50a71c)[_0x27a1('0x23')](function(_0xcacea9){return _0xcacea9;});}return null;};}function removeEntity(_0x27a60e,_0x1b931e){return function(_0x3b14d6){if(_0x3b14d6){return _0x3b14d6['destroy']()['then'](function(){_0x27a60e['status'](0xcc)[_0x27a1('0x39')]();});}};}function handleEntityNotFound(_0xcdbe1c,_0x3ccd4c){return function(_0x39ffad){if(!_0x39ffad){_0xcdbe1c['sendStatus'](0x194);}return _0x39ffad;};}function handleError(_0x52086e,_0x37a7d9){_0x37a7d9=_0x37a7d9||0x1f4;return function(_0x1ec560){logger[_0x27a1('0x2a')](_0x1ec560[_0x27a1('0x3a')]);if(_0x1ec560[_0x27a1('0x3b')]){delete _0x1ec560[_0x27a1('0x3b')];}_0x52086e[_0x27a1('0x30')](_0x37a7d9)['send'](_0x1ec560);};}exports['index']=function(_0x209f4a,_0x1b26a){var _0x12aa52={},_0x4f100b={},_0x2d7d0b={'count':0x0,'rows':[]};var _0x3114fd=_[_0x27a1('0x3c')](db[_0x27a1('0x3d')]['rawAttributes'],function(_0x146352){return{'name':_0x146352[_0x27a1('0x3e')],'type':_0x146352[_0x27a1('0x3f')][_0x27a1('0x40')]};});_0x4f100b[_0x27a1('0x41')]=_[_0x27a1('0x3c')](_0x3114fd,_0x27a1('0x3b'));_0x4f100b[_0x27a1('0x42')]=_[_0x27a1('0x43')](_0x209f4a[_0x27a1('0x42')]);_0x4f100b[_0x27a1('0x44')]=_[_0x27a1('0x45')](_0x4f100b['model'],_0x4f100b[_0x27a1('0x42')]);_0x12aa52[_0x27a1('0x46')]=_[_0x27a1('0x45')](_0x4f100b['model'],qs[_0x27a1('0x47')](_0x209f4a['query'][_0x27a1('0x47')]));_0x12aa52[_0x27a1('0x46')]=_0x12aa52['attributes'][_0x27a1('0x48')]?_0x12aa52[_0x27a1('0x46')]:_0x4f100b['model'];if(!_0x209f4a['query'][_0x27a1('0x49')]('nolimit')){_0x12aa52['limit']=qs[_0x27a1('0x34')](_0x209f4a[_0x27a1('0x42')][_0x27a1('0x34')]);_0x12aa52[_0x27a1('0x31')]=qs[_0x27a1('0x31')](_0x209f4a['query']['offset']);}_0x12aa52[_0x27a1('0x4a')]=qs[_0x27a1('0x4b')](_0x209f4a[_0x27a1('0x42')][_0x27a1('0x4b')]);_0x12aa52[_0x27a1('0x4c')]=qs[_0x27a1('0x44')](_[_0x27a1('0x4d')](_0x209f4a[_0x27a1('0x42')],_0x4f100b[_0x27a1('0x44')]),_0x3114fd);if(_0x209f4a[_0x27a1('0x42')][_0x27a1('0x4e')]){_0x12aa52[_0x27a1('0x4c')]=_['merge'](_0x12aa52['where'],{'$or':_[_0x27a1('0x3c')](_0x3114fd,function(_0xf4be96){if(_0xf4be96['type']!==_0x27a1('0x4f')){var _0x217a70={};_0x217a70[_0xf4be96['name']]={'$like':'%'+_0x209f4a[_0x27a1('0x42')][_0x27a1('0x4e')]+'%'};return _0x217a70;}})});}_0x12aa52=_[_0x27a1('0x50')]({},_0x12aa52,_0x209f4a['options']);var _0x3a563c={'where':_0x12aa52[_0x27a1('0x4c')]};return db[_0x27a1('0x3d')][_0x27a1('0x33')](_0x3a563c)[_0x27a1('0x23')](function(_0x499ee0){_0x2d7d0b[_0x27a1('0x33')]=_0x499ee0;if(_0x209f4a[_0x27a1('0x42')]['includeAll']){_0x12aa52[_0x27a1('0x51')]=[{'all':!![]}];}return db[_0x27a1('0x3d')]['findAll'](_0x12aa52);})[_0x27a1('0x23')](function(_0xba56c3){_0x2d7d0b[_0x27a1('0x52')]=_0xba56c3;return _0x2d7d0b;})[_0x27a1('0x23')](respondWithFilteredResult(_0x1b26a,_0x12aa52))[_0x27a1('0x2e')](handleError(_0x1b26a,null));};exports['show']=function(_0x3d3bf7,_0x49fe49){var _0x626e1c={'raw':!![],'where':{'id':_0x3d3bf7['params']['id']}},_0x3f1614={};_0x3f1614[_0x27a1('0x41')]=_[_0x27a1('0x43')](db[_0x27a1('0x3d')]['rawAttributes']);_0x3f1614[_0x27a1('0x42')]=_[_0x27a1('0x43')](_0x3d3bf7[_0x27a1('0x42')]);_0x3f1614[_0x27a1('0x44')]=_[_0x27a1('0x45')](_0x3f1614[_0x27a1('0x41')],_0x3f1614['query']);_0x626e1c[_0x27a1('0x46')]=_[_0x27a1('0x45')](_0x3f1614['model'],qs[_0x27a1('0x47')](_0x3d3bf7[_0x27a1('0x42')]['fields']));_0x626e1c[_0x27a1('0x46')]=_0x626e1c[_0x27a1('0x46')][_0x27a1('0x48')]?_0x626e1c[_0x27a1('0x46')]:_0x3f1614[_0x27a1('0x41')];if(_0x3d3bf7[_0x27a1('0x42')][_0x27a1('0x53')]){_0x626e1c[_0x27a1('0x51')]=[{'all':!![]}];}_0x626e1c=_['merge']({},_0x626e1c,_0x3d3bf7['options']);return db[_0x27a1('0x3d')]['find'](_0x626e1c)[_0x27a1('0x23')](handleEntityNotFound(_0x49fe49,null))[_0x27a1('0x23')](respondWithResult(_0x49fe49,null))[_0x27a1('0x2e')](handleError(_0x49fe49,null));};exports['create']=function(_0x8ebb3b,_0x4c2795){return db[_0x27a1('0x3d')][_0x27a1('0x54')](_0x8ebb3b['body'],{})[_0x27a1('0x23')](respondWithResult(_0x4c2795,0xc9))['catch'](handleError(_0x4c2795,null));};exports[_0x27a1('0x38')]=function(_0xd803cf,_0x28cd2e){if(_0xd803cf[_0x27a1('0x55')]['id']){delete _0xd803cf[_0x27a1('0x55')]['id'];}return db['SmsMessage'][_0x27a1('0x56')]({'where':{'id':_0xd803cf[_0x27a1('0x57')]['id']}})[_0x27a1('0x23')](handleEntityNotFound(_0x28cd2e,null))[_0x27a1('0x23')](saveUpdates(_0xd803cf[_0x27a1('0x55')],null))[_0x27a1('0x23')](respondWithResult(_0x28cd2e,null))[_0x27a1('0x2e')](handleError(_0x28cd2e,null));};exports[_0x27a1('0x58')]=function(_0x94bb51,_0x2efaa9){return db[_0x27a1('0x3d')][_0x27a1('0x56')]({'where':{'id':_0x94bb51['params']['id']}})[_0x27a1('0x23')](handleEntityNotFound(_0x2efaa9,null))[_0x27a1('0x23')](removeEntity(_0x2efaa9,null))[_0x27a1('0x2e')](handleError(_0x2efaa9,null));};exports[_0x27a1('0x59')]=function(_0x54b64c,_0x46825c){return db[_0x27a1('0x3d')][_0x27a1('0x59')]()[_0x27a1('0x23')](respondWithResult(_0x46825c,null))[_0x27a1('0x2e')](handleError(_0x46825c,null));};var interaction_log=require(_0x27a1('0x15'))(_0x27a1('0x5a'));exports[_0x27a1('0x5b')]=function(_0x1e3621,_0x2bc88b,_0x300803){var _0x49faa2={'agent':{},'channel':_0x27a1('0x5c')};if(_0x1e3621['body']['id']){delete _0x1e3621[_0x27a1('0x55')]['id'];}_0x1e3621[_0x27a1('0x55')]['read']=!![];_0x1e3621[_0x27a1('0x55')][_0x27a1('0x5d')]=moment()[_0x27a1('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e3621[_0x27a1('0x55')][_0x27a1('0x5f')]=_0x1e3621['body'][_0x27a1('0x5f')]||_0x1e3621[_0x27a1('0x60')]['id'];_0x49faa2[_0x27a1('0x61')]['id']=_0x1e3621[_0x27a1('0x55')]['UserId'];return db[_0x27a1('0x3d')]['find']({'where':{'id':_0x1e3621[_0x27a1('0x57')]['id'],'UserId':null}})[_0x27a1('0x23')](handleEntityNotFound(_0x2bc88b,null))[_0x27a1('0x23')](saveUpdates(_0x1e3621[_0x27a1('0x55')],null))[_0x27a1('0x23')](function(_0x8ed637){if(_0x8ed637){_0x49faa2[_0x27a1('0x2c')]=_0x8ed637[_0x27a1('0x62')]({'plain':!![]});return db[_0x27a1('0x63')][_0x27a1('0x56')]({'where':{'id':_0x8ed637['SmsInteractionId']}});}return null;})[_0x27a1('0x23')](handleEntityNotFound(_0x2bc88b,null))[_0x27a1('0x23')](function(_0x5d4e0c){if(_0x5d4e0c){return _0x5d4e0c['update']({'UserId':_0x1e3621['body'][_0x27a1('0x5f')],'read1stAt':_[_0x27a1('0x64')](_0x5d4e0c[_0x27a1('0x65')])?moment()[_0x27a1('0x5e')](_0x27a1('0x66')):undefined});}return null;})['then'](function(_0x38c05f){if(_0x38c05f){_0x49faa2[_0x27a1('0x67')]=_0x38c05f[_0x27a1('0x62')]({'plain':!![]});interaction_log[_0x27a1('0x24')](_0x27a1('0x68'),_0x1e3621[_0x27a1('0x60')]['id'],_0x1e3621['user']['name'],_0x1e3621[_0x27a1('0x60')][_0x27a1('0x69')],_0x49faa2[_0x27a1('0x67')]['id'],_0x1e3621[_0x27a1('0x55')]?JSON[_0x27a1('0x29')](_0x1e3621[_0x27a1('0x55')]):_0x27a1('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x27a1('0x6b'),_0x49faa2);}return null;})[_0x27a1('0x23')](function(_0x8c9685){var _0x2fc678=_0x27a1('0x6c')+_0x8c9685[_0x27a1('0x2c')][_0x27a1('0x6d')];return db[_0x27a1('0x6e')][_0x27a1('0x42')](_0x2fc678,{'type':db[_0x27a1('0x6f')][_0x27a1('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x37507b){return _0x37507b;});})[_0x27a1('0x23')](function(_0xc8b58e){if(_0xc8b58e){_0x49faa2['message'][_0x27a1('0x71')]=_0xc8b58e[0x0];if(!_0x1e3621[_0x27a1('0x55')]['UserId'])return;return db[_0x27a1('0x72')]['find']({'where':{'id':_0x1e3621[_0x27a1('0x55')][_0x27a1('0x5f')],'role':_0x27a1('0x61')},'attributes':['id','name',_0x27a1('0x73'),_0x27a1('0x74'),_0x27a1('0x75')],'raw':!![]});}return null;})[_0x27a1('0x23')](function(_0x4bc659){if(!_0x4bc659)return null;_0x49faa2['message'][_0x27a1('0x61')]=_0x4bc659;return _0x49faa2;})[_0x27a1('0x23')](function(_0x5f182d){if(_0x5f182d){if(_0x1e3621['body'][_0x27a1('0x76')]){_0x49faa2['message'][_0x27a1('0x77')]=util[_0x27a1('0x5e')]('SIP/%s',_0x1e3621[_0x27a1('0x60')]['name']);_0x49faa2[_0x27a1('0x2c')][_0x27a1('0x78')]=_0x49faa2[_0x27a1('0x78')];_0x49faa2[_0x27a1('0x2c')]['motionChannel']=_0x49faa2['channel'];_0x49faa2[_0x27a1('0x2c')][_0x27a1('0x79')]=_0x27a1('0x5b');return respondWithRpcPromise(_0x27a1('0x7a'),_0x27a1('0x7a'),{'event':_0x27a1('0x7b'),'message':_0x49faa2[_0x27a1('0x2c')]},client9002)[_0x27a1('0x23')](function(){return _0x49faa2;});}return _0x49faa2;}return null;})['then'](respondWithResult(_0x2bc88b,null))[_0x27a1('0x2e')](handleError(_0x2bc88b,null));};var interaction_log=require(_0x27a1('0x15'))(_0x27a1('0x5a'));exports[_0x27a1('0x37')]=function(_0x427285,_0x4692d7,_0x5c0ad2){var _0x5708af={'agent':{},'channel':_0x27a1('0x5c')};if(_0x427285[_0x27a1('0x55')]['id']){delete _0x427285[_0x27a1('0x55')]['id'];}_0x427285[_0x27a1('0x55')][_0x27a1('0x5f')]=_0x427285[_0x27a1('0x55')][_0x27a1('0x5f')]||_0x427285[_0x27a1('0x60')]['id'];_0x5708af[_0x27a1('0x61')]['id']=_0x427285[_0x27a1('0x55')][_0x27a1('0x5f')];return db[_0x27a1('0x3d')][_0x27a1('0x56')]({'where':{'id':_0x427285['params']['id'],'UserId':null}})[_0x27a1('0x23')](handleEntityNotFound(_0x4692d7,null))[_0x27a1('0x23')](function(_0x378866){if(_0x378866){_0x5708af[_0x27a1('0x2c')]=_0x378866[_0x27a1('0x62')]({'plain':!![]});return db[_0x27a1('0x63')][_0x27a1('0x56')]({'where':{'id':_0x378866[_0x27a1('0x7c')]}});}return null;})['then'](handleEntityNotFound(_0x4692d7,null))[_0x27a1('0x23')](function(_0x31e706){if(_0x31e706){_0x5708af['interaction']=_0x31e706['get']({'plain':!![]});interaction_log[_0x27a1('0x24')](_0x27a1('0x7d'),_0x427285['user']['id'],_0x427285[_0x27a1('0x60')][_0x27a1('0x3b')],_0x427285[_0x27a1('0x60')][_0x27a1('0x69')],_0x5708af[_0x27a1('0x67')]['id'],_0x427285[_0x27a1('0x55')]?JSON['stringify'](_0x427285[_0x27a1('0x55')]):_0x27a1('0x6a'));return respondWithRpcPromise('RejectMessage',_0x27a1('0x7e'),_0x5708af);}return null;})[_0x27a1('0x23')](function(_0x5bbf69){var _0x560bbb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5bbf69[_0x27a1('0x2c')][_0x27a1('0x6d')];return db[_0x27a1('0x6e')]['query'](_0x560bbb,{'type':db[_0x27a1('0x6f')][_0x27a1('0x70')][_0x27a1('0x7f')],'raw':!![]})[_0x27a1('0x23')](function(_0x1b67f7){return _0x1b67f7;});})[_0x27a1('0x23')](function(_0x2b0cb5){if(_0x2b0cb5){_0x5708af[_0x27a1('0x2c')]['contact']=_0x2b0cb5[0x0];if(!_0x427285[_0x27a1('0x55')]['UserId'])return;return db[_0x27a1('0x72')][_0x27a1('0x56')]({'where':{'id':_0x427285[_0x27a1('0x55')][_0x27a1('0x5f')],'role':_0x27a1('0x61')},'attributes':['id',_0x27a1('0x3b'),'fullname',_0x27a1('0x74'),'internal'],'raw':!![]});}return null;})[_0x27a1('0x23')](function(_0x5d2e2e){if(!_0x5d2e2e)return null;_0x5708af[_0x27a1('0x2c')][_0x27a1('0x61')]=_0x5d2e2e;return _0x5708af;})[_0x27a1('0x23')](function(_0x3fe867){if(_0x3fe867){_0x3fe867[_0x27a1('0x2c')][_0x27a1('0x77')]=util[_0x27a1('0x5e')]('SIP/%s',_0x427285['user'][_0x27a1('0x3b')]);_0x3fe867[_0x27a1('0x2c')][_0x27a1('0x78')]=_0x5708af[_0x27a1('0x78')];_0x3fe867[_0x27a1('0x2c')]['motionChannel']=_0x5708af['channel'];_0x3fe867[_0x27a1('0x2c')][_0x27a1('0x79')]=_0x27a1('0x37');respondWithRpcPromise(_0x27a1('0x7a'),_0x27a1('0x7a'),{'event':_0x27a1('0x80'),'message':_0x3fe867[_0x27a1('0x2c')]},client9002);return _0x5708af;}return null;})[_0x27a1('0x23')](respondWithResult(_0x4692d7,null))[_0x27a1('0x2e')](handleError(_0x4692d7,null));};exports['status']=function(_0x21642f,_0x196da5,_0x5acd93){if(_0x21642f[_0x27a1('0x55')]['id']){delete _0x21642f['body']['id'];}var _0x5d6938;return db[_0x27a1('0x3d')][_0x27a1('0x56')]({'where':{'id':_0x21642f[_0x27a1('0x57')]['id']}})[_0x27a1('0x23')](handleEntityNotFound(_0x196da5,null))['then'](function(_0x3fc13c){if(_0x3fc13c){_0x5d6938=_0x3fc13c;return db[_0x27a1('0x81')]['find']({'where':{'id':_0x3fc13c['SmsAccountId']}});}})[_0x27a1('0x23')](handleEntityNotFound(_0x196da5,null))[_0x27a1('0x23')](function(_0x4a6fc9){if(_0x4a6fc9){logger[_0x27a1('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27a1('0x30'),_0x27a1('0x82'),_0x4a6fc9[_0x27a1('0x3f')],util['inspect'](_0x21642f[_0x27a1('0x55')],{'showHidden':![],'depth':null}));switch(_0x4a6fc9[_0x27a1('0x3f')]){case'twilio':if(_0x21642f[_0x27a1('0x55')][_0x27a1('0x83')]&&_0x21642f[_0x27a1('0x55')][_0x27a1('0x83')]===_0x5d6938[_0x27a1('0x84')]){return _0x5d6938['update']({'read':!![]});}else{logger[_0x27a1('0x2a')](_0x27a1('0x85'),'status','twilio',util['inspect'](_0x21642f[_0x27a1('0x55')],{'showHidden':![],'depth':null}));}break;case _0x27a1('0x86'):if(_0x21642f[_0x27a1('0x55')][_0x27a1('0x87')]&&_0x21642f[_0x27a1('0x55')][_0x27a1('0x87')]===_0x5d6938[_0x27a1('0x84')]&&_[_0x27a1('0x88')]([_0x27a1('0x89'),'delivered'],_0x21642f['body'][_0x27a1('0x8a')])>=0x0){return _0x5d6938[_0x27a1('0x38')]({'read':!![]});}else{logger[_0x27a1('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x27a1('0x30'),'plivio',util[_0x27a1('0x8b')](_0x21642f[_0x27a1('0x55')],{'showHidden':![],'depth':null}));}break;case _0x27a1('0x8c'):var _0x15cd4d=_0x21642f[_0x27a1('0x55')][_0x27a1('0x8d')][0x0];if(_0x15cd4d[_0x27a1('0x30')][_0x27a1('0x8e')]===_0x27a1('0x8f')){return _0x5d6938['update']({'read':!![]});}else{logger[_0x27a1('0x2a')](_0x27a1('0x85'),_0x27a1('0x30'),_0x27a1('0x8c'),util[_0x27a1('0x8b')](_0x21642f[_0x27a1('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x5d6938;}})[_0x27a1('0x23')](respondWithResult(_0x196da5,null))[_0x27a1('0x2e')](handleError(_0x196da5,null));};
\ No newline at end of file
+var _0x4628=['findAll','rows','params','length','include','create','body','find','destroy','sms-interactions','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','rejectmessage','SmsAccountId','debug','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','DELIVERED','infobip','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','json','offset','limit','count','status','set','apply','reject','save','update','end','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','SmsMessage','includeAll'];(function(_0x53f8d3,_0x3e565e){var _0x520993=function(_0x20e05b){while(--_0x20e05b){_0x53f8d3['push'](_0x53f8d3['shift']());}};_0x520993(++_0x3e565e);}(_0x4628,0xd3));var _0x8462=function(_0x435a09,_0x26a21f){_0x435a09=_0x435a09-0x0;var _0x4dd280=_0x4628[_0x435a09];return _0x4dd280;};'use strict';var emlformat=require(_0x8462('0x0'));var rimraf=require(_0x8462('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8462('0x2'));var rp=require(_0x8462('0x3'));var moment=require(_0x8462('0x4'));var BPromise=require(_0x8462('0x5'));var Mustache=require(_0x8462('0x6'));var util=require('util');var path=require(_0x8462('0x7'));var sox=require(_0x8462('0x8'));var csv=require(_0x8462('0x9'));var ejs=require(_0x8462('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8462('0xb'));var squel=require('squel');var crypto=require(_0x8462('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8462('0xd'));var toCsv=require(_0x8462('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8462('0xe'));var authService=require(_0x8462('0xf'));var qs=require(_0x8462('0x10'));var as=require(_0x8462('0x11'));var hardwareService=require(_0x8462('0x12'));var logger=require(_0x8462('0x13'))('api');var utils=require(_0x8462('0x14'));var config=require(_0x8462('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8462('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8462('0x17'),'port':0x18eb});var socket=require(_0x8462('0x18'))(new Redis(config[_0x8462('0x19')]));require('./smsMessage.socket')[_0x8462('0x1a')](socket);var jayson=require(_0x8462('0x1b'));var client=jayson[_0x8462('0x1c')][_0x8462('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x8462('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3a19a9,_0x4f3824,_0x3a261a,_0x2bdd11){return new BPromise(function(_0xabd292,_0x315db9){var _0x49ef1f=_0x2bdd11||client;return _0x49ef1f[_0x8462('0x1e')](_0x3a19a9,_0x3a261a)[_0x8462('0x1f')](function(_0x114157){logger[_0x8462('0x20')](_0x8462('0x21'),_0x4f3824,'request\x20sent');logger['debug'](_0x8462('0x22'),_0x4f3824,_0x8462('0x23'),JSON[_0x8462('0x24')](_0x114157));if(_0x114157[_0x8462('0x25')]){if(_0x114157['error']['code']===0x1f4){logger[_0x8462('0x25')](_0x8462('0x21'),_0x4f3824,_0x114157[_0x8462('0x25')][_0x8462('0x26')]);return _0x315db9(_0x114157[_0x8462('0x25')]['message']);}logger[_0x8462('0x25')]('SmsMessage,\x20%s,\x20%s',_0x4f3824,_0x114157['error']['message']);return _0xabd292(_0x114157['error'][_0x8462('0x26')]);}else{logger[_0x8462('0x20')](_0x8462('0x21'),_0x4f3824,_0x8462('0x23'));_0xabd292(_0x114157[_0x8462('0x27')][_0x8462('0x26')]);}})[_0x8462('0x28')](function(_0x5ca724){logger[_0x8462('0x25')](_0x8462('0x21'),_0x4f3824,_0x5ca724);_0x315db9(_0x5ca724);});});}function respondWithStatusCode(_0x1e5b0c,_0x412a21){_0x412a21=_0x412a21||0xcc;return function(_0x27b8b9){if(_0x27b8b9){return _0x1e5b0c[_0x8462('0x29')](_0x412a21);}return _0x1e5b0c['status'](_0x412a21)['end']();};}function respondWithResult(_0x593681,_0x3c9d95){_0x3c9d95=_0x3c9d95||0xc8;return function(_0x279637){if(_0x279637){return _0x593681['status'](_0x3c9d95)[_0x8462('0x2a')](_0x279637);}};}function respondWithFilteredResult(_0x3e4e30,_0xdafc1d){return function(_0x19adb8){if(_0x19adb8){var _0x5b5105=typeof _0xdafc1d[_0x8462('0x2b')]==='undefined'&&typeof _0xdafc1d[_0x8462('0x2c')]==='undefined';var _0x4541c8=_0x19adb8['count'];var _0x5994f0=_0x5b5105?0x0:_0xdafc1d[_0x8462('0x2b')];var _0x45efda=_0x5b5105?_0x19adb8[_0x8462('0x2d')]:_0xdafc1d[_0x8462('0x2b')]+_0xdafc1d['limit'];var _0x1add08;if(_0x45efda>=_0x4541c8){_0x45efda=_0x4541c8;_0x1add08=0xc8;}else{_0x1add08=0xce;}_0x3e4e30[_0x8462('0x2e')](_0x1add08);return _0x3e4e30[_0x8462('0x2f')]('Content-Range',_0x5994f0+'-'+_0x45efda+'/'+_0x4541c8)[_0x8462('0x2a')](_0x19adb8);}return null;};}function patchUpdates(_0x3fc528){return function(_0x51c206){try{jsonpatch[_0x8462('0x30')](_0x51c206,_0x3fc528,!![]);}catch(_0x45cd1b){return BPromise[_0x8462('0x31')](_0x45cd1b);}return _0x51c206[_0x8462('0x32')]();};}function saveUpdates(_0x3d7f2d,_0x2fe22c){return function(_0x19c2bf){if(_0x19c2bf){return _0x19c2bf[_0x8462('0x33')](_0x3d7f2d)['then'](function(_0x284ef5){return _0x284ef5;});}return null;};}function removeEntity(_0x6c2400,_0x50218a){return function(_0xd5a665){if(_0xd5a665){return _0xd5a665['destroy']()[_0x8462('0x1f')](function(){_0x6c2400['status'](0xcc)[_0x8462('0x34')]();});}};}function handleEntityNotFound(_0x8698d,_0x3f2c57){return function(_0x302877){if(!_0x302877){_0x8698d[_0x8462('0x29')](0x194);}return _0x302877;};}function handleError(_0x4809fb,_0x3fdf98){_0x3fdf98=_0x3fdf98||0x1f4;return function(_0x27eef6){logger[_0x8462('0x25')](_0x27eef6['stack']);if(_0x27eef6[_0x8462('0x35')]){delete _0x27eef6[_0x8462('0x35')];}_0x4809fb['status'](_0x3fdf98)[_0x8462('0x36')](_0x27eef6);};}exports['index']=function(_0x5d3047,_0x11a27f){var _0x4ca308={},_0x525f0f={},_0x3787d8={'count':0x0,'rows':[]};var _0x84f831=_[_0x8462('0x37')](db['SmsMessage'][_0x8462('0x38')],function(_0x5498f2){return{'name':_0x5498f2[_0x8462('0x39')],'type':_0x5498f2['type'][_0x8462('0x3a')]};});_0x525f0f[_0x8462('0x3b')]=_[_0x8462('0x37')](_0x84f831,'name');_0x525f0f[_0x8462('0x3c')]=_[_0x8462('0x3d')](_0x5d3047[_0x8462('0x3c')]);_0x525f0f[_0x8462('0x3e')]=_[_0x8462('0x3f')](_0x525f0f[_0x8462('0x3b')],_0x525f0f[_0x8462('0x3c')]);_0x4ca308[_0x8462('0x40')]=_[_0x8462('0x3f')](_0x525f0f[_0x8462('0x3b')],qs[_0x8462('0x41')](_0x5d3047[_0x8462('0x3c')][_0x8462('0x41')]));_0x4ca308[_0x8462('0x40')]=_0x4ca308['attributes']['length']?_0x4ca308[_0x8462('0x40')]:_0x525f0f[_0x8462('0x3b')];if(!_0x5d3047['query'][_0x8462('0x42')](_0x8462('0x43'))){_0x4ca308[_0x8462('0x2c')]=qs[_0x8462('0x2c')](_0x5d3047['query']['limit']);_0x4ca308[_0x8462('0x2b')]=qs[_0x8462('0x2b')](_0x5d3047[_0x8462('0x3c')][_0x8462('0x2b')]);}_0x4ca308[_0x8462('0x44')]=qs[_0x8462('0x45')](_0x5d3047[_0x8462('0x3c')]['sort']);_0x4ca308['where']=qs[_0x8462('0x3e')](_['pick'](_0x5d3047['query'],_0x525f0f['filters']),_0x84f831);if(_0x5d3047[_0x8462('0x3c')][_0x8462('0x46')]){_0x4ca308[_0x8462('0x47')]=_[_0x8462('0x48')](_0x4ca308[_0x8462('0x47')],{'$or':_[_0x8462('0x37')](_0x84f831,function(_0x2c0da7){if(_0x2c0da7['type']!=='VIRTUAL'){var _0x28bde7={};_0x28bde7[_0x2c0da7['name']]={'$like':'%'+_0x5d3047['query'][_0x8462('0x46')]+'%'};return _0x28bde7;}})});}_0x4ca308=_['merge']({},_0x4ca308,_0x5d3047['options']);var _0x35bcf9={'where':_0x4ca308[_0x8462('0x47')]};return db[_0x8462('0x49')][_0x8462('0x2d')](_0x35bcf9)[_0x8462('0x1f')](function(_0xdf4051){_0x3787d8[_0x8462('0x2d')]=_0xdf4051;if(_0x5d3047[_0x8462('0x3c')][_0x8462('0x4a')]){_0x4ca308['include']=[{'all':!![]}];}return db[_0x8462('0x49')][_0x8462('0x4b')](_0x4ca308);})['then'](function(_0x2b9c7a){_0x3787d8[_0x8462('0x4c')]=_0x2b9c7a;return _0x3787d8;})[_0x8462('0x1f')](respondWithFilteredResult(_0x11a27f,_0x4ca308))[_0x8462('0x28')](handleError(_0x11a27f,null));};exports['show']=function(_0x57752c,_0x407786){var _0x1c0091={'raw':!![],'where':{'id':_0x57752c[_0x8462('0x4d')]['id']}},_0x25815a={};_0x25815a[_0x8462('0x3b')]=_[_0x8462('0x3d')](db[_0x8462('0x49')][_0x8462('0x38')]);_0x25815a['query']=_[_0x8462('0x3d')](_0x57752c[_0x8462('0x3c')]);_0x25815a['filters']=_['intersection'](_0x25815a[_0x8462('0x3b')],_0x25815a[_0x8462('0x3c')]);_0x1c0091[_0x8462('0x40')]=_[_0x8462('0x3f')](_0x25815a[_0x8462('0x3b')],qs[_0x8462('0x41')](_0x57752c[_0x8462('0x3c')][_0x8462('0x41')]));_0x1c0091[_0x8462('0x40')]=_0x1c0091[_0x8462('0x40')][_0x8462('0x4e')]?_0x1c0091['attributes']:_0x25815a[_0x8462('0x3b')];if(_0x57752c['query']['includeAll']){_0x1c0091[_0x8462('0x4f')]=[{'all':!![]}];}_0x1c0091=_[_0x8462('0x48')]({},_0x1c0091,_0x57752c['options']);return db[_0x8462('0x49')]['find'](_0x1c0091)[_0x8462('0x1f')](handleEntityNotFound(_0x407786,null))[_0x8462('0x1f')](respondWithResult(_0x407786,null))[_0x8462('0x28')](handleError(_0x407786,null));};exports[_0x8462('0x50')]=function(_0x167f4c,_0x496b75){return db[_0x8462('0x49')][_0x8462('0x50')](_0x167f4c[_0x8462('0x51')],{})['then'](respondWithResult(_0x496b75,0xc9))['catch'](handleError(_0x496b75,null));};exports['update']=function(_0x73705f,_0x2c1d50){if(_0x73705f[_0x8462('0x51')]['id']){delete _0x73705f[_0x8462('0x51')]['id'];}return db['SmsMessage'][_0x8462('0x52')]({'where':{'id':_0x73705f[_0x8462('0x4d')]['id']}})[_0x8462('0x1f')](handleEntityNotFound(_0x2c1d50,null))[_0x8462('0x1f')](saveUpdates(_0x73705f[_0x8462('0x51')],null))['then'](respondWithResult(_0x2c1d50,null))[_0x8462('0x28')](handleError(_0x2c1d50,null));};exports[_0x8462('0x53')]=function(_0x2579dc,_0x5c26b4){return db[_0x8462('0x49')][_0x8462('0x52')]({'where':{'id':_0x2579dc[_0x8462('0x4d')]['id']}})[_0x8462('0x1f')](handleEntityNotFound(_0x5c26b4,null))[_0x8462('0x1f')](removeEntity(_0x5c26b4,null))['catch'](handleError(_0x5c26b4,null));};exports['describe']=function(_0x57405a,_0x380268){return db['SmsMessage']['describe']()[_0x8462('0x1f')](respondWithResult(_0x380268,null))[_0x8462('0x28')](handleError(_0x380268,null));};var interaction_log=require(_0x8462('0x13'))(_0x8462('0x54'));exports['accept']=function(_0xc2ff88,_0x4710c5,_0x5bee14){var _0x598ecc={'agent':{},'channel':_0x8462('0x55')};if(_0xc2ff88[_0x8462('0x51')]['id']){delete _0xc2ff88[_0x8462('0x51')]['id'];}_0xc2ff88[_0x8462('0x51')][_0x8462('0x56')]=!![];_0xc2ff88[_0x8462('0x51')]['readAt']=moment()[_0x8462('0x57')](_0x8462('0x58'));_0xc2ff88[_0x8462('0x51')][_0x8462('0x59')]=_0xc2ff88[_0x8462('0x51')][_0x8462('0x59')]||_0xc2ff88['user']['id'];_0x598ecc[_0x8462('0x5a')]['id']=_0xc2ff88[_0x8462('0x51')]['UserId'];return db[_0x8462('0x49')][_0x8462('0x52')]({'where':{'id':_0xc2ff88['params']['id'],'UserId':null}})[_0x8462('0x1f')](handleEntityNotFound(_0x4710c5,null))['then'](saveUpdates(_0xc2ff88[_0x8462('0x51')],null))['then'](function(_0x5b822f){if(_0x5b822f){_0x598ecc[_0x8462('0x26')]=_0x5b822f[_0x8462('0x5b')]({'plain':!![]});return db[_0x8462('0x5c')]['find']({'where':{'id':_0x5b822f[_0x8462('0x5d')]}});}return null;})[_0x8462('0x1f')](handleEntityNotFound(_0x4710c5,null))[_0x8462('0x1f')](function(_0x406f78){if(_0x406f78){return _0x406f78['update']({'UserId':_0xc2ff88['body']['UserId'],'read1stAt':_['isNil'](_0x406f78[_0x8462('0x5e')])?moment()['format'](_0x8462('0x58')):undefined});}return null;})[_0x8462('0x1f')](function(_0x56d100){if(_0x56d100){_0x598ecc['interaction']=_0x56d100['get']({'plain':!![]});interaction_log['info'](_0x8462('0x5f'),_0xc2ff88[_0x8462('0x60')]['id'],_0xc2ff88['user'][_0x8462('0x35')],_0xc2ff88['user']['role'],_0x598ecc[_0x8462('0x61')]['id'],_0xc2ff88['body']?JSON[_0x8462('0x24')](_0xc2ff88[_0x8462('0x51')]):_0x8462('0x62'));return respondWithRpcPromise(_0x8462('0x63'),_0x8462('0x64'),_0x598ecc);}return null;})['then'](function(_0x56fe49){var _0x140784=_0x8462('0x65')+_0x56fe49[_0x8462('0x26')][_0x8462('0x66')];return db['sequelize']['query'](_0x140784,{'type':db[_0x8462('0x67')]['QueryTypes'][_0x8462('0x68')],'raw':!![]})['then'](function(_0x15f294){return _0x15f294;});})[_0x8462('0x1f')](function(_0x27b9e8){if(_0x27b9e8){_0x598ecc[_0x8462('0x26')][_0x8462('0x69')]=_0x27b9e8[0x0];if(!_0xc2ff88['body']['UserId'])return;return db[_0x8462('0x6a')][_0x8462('0x52')]({'where':{'id':_0xc2ff88[_0x8462('0x51')][_0x8462('0x59')],'role':_0x8462('0x5a')},'attributes':['id','name',_0x8462('0x6b'),_0x8462('0x6c'),_0x8462('0x6d')],'raw':!![]});}return null;})[_0x8462('0x1f')](function(_0x3baec8){if(!_0x3baec8)return null;_0x598ecc[_0x8462('0x26')][_0x8462('0x5a')]=_0x3baec8;return _0x598ecc;})[_0x8462('0x1f')](function(_0x434852){if(_0x434852){if(_0xc2ff88['body'][_0x8462('0x6e')]){_0x598ecc[_0x8462('0x26')][_0x8462('0x6f')]=util['format'](_0x8462('0x70'),_0xc2ff88[_0x8462('0x60')][_0x8462('0x35')]);_0x598ecc[_0x8462('0x26')]['channel']=_0x598ecc[_0x8462('0x71')];_0x598ecc['message'][_0x8462('0x72')]=_0x598ecc[_0x8462('0x71')];_0x598ecc['message'][_0x8462('0x73')]=_0x8462('0x74');return respondWithRpcPromise(_0x8462('0x75'),_0x8462('0x75'),{'event':_0x8462('0x76'),'message':_0x598ecc['message']},client9002)[_0x8462('0x1f')](function(){return _0x598ecc;});}return _0x598ecc;}return null;})[_0x8462('0x1f')](respondWithResult(_0x4710c5,null))[_0x8462('0x28')](handleError(_0x4710c5,null));};var interaction_log=require(_0x8462('0x13'))(_0x8462('0x54'));exports[_0x8462('0x31')]=function(_0x4b20db,_0x5c9f8d,_0x500641){var _0x2d1357={'agent':{},'channel':_0x8462('0x55')};if(_0x4b20db['body']['id']){delete _0x4b20db[_0x8462('0x51')]['id'];}_0x4b20db['body'][_0x8462('0x59')]=_0x4b20db[_0x8462('0x51')][_0x8462('0x59')]||_0x4b20db[_0x8462('0x60')]['id'];_0x2d1357[_0x8462('0x5a')]['id']=_0x4b20db[_0x8462('0x51')]['UserId'];return db[_0x8462('0x49')][_0x8462('0x52')]({'where':{'id':_0x4b20db[_0x8462('0x4d')]['id'],'UserId':null}})[_0x8462('0x1f')](handleEntityNotFound(_0x5c9f8d,null))[_0x8462('0x1f')](function(_0x3964b6){if(_0x3964b6){_0x2d1357[_0x8462('0x26')]=_0x3964b6[_0x8462('0x5b')]({'plain':!![]});return db['SmsInteraction'][_0x8462('0x52')]({'where':{'id':_0x3964b6[_0x8462('0x5d')]}});}return null;})[_0x8462('0x1f')](handleEntityNotFound(_0x5c9f8d,null))[_0x8462('0x1f')](function(_0x2fbe3a){if(_0x2fbe3a){_0x2d1357[_0x8462('0x61')]=_0x2fbe3a['get']({'plain':!![]});interaction_log['info'](_0x8462('0x77'),_0x4b20db[_0x8462('0x60')]['id'],_0x4b20db[_0x8462('0x60')]['name'],_0x4b20db['user'][_0x8462('0x78')],_0x2d1357[_0x8462('0x61')]['id'],_0x4b20db[_0x8462('0x51')]?JSON['stringify'](_0x4b20db['body']):_0x8462('0x62'));return respondWithRpcPromise(_0x8462('0x79'),_0x8462('0x7a'),_0x2d1357);}return null;})[_0x8462('0x1f')](function(_0x3f0aff){var _0x1508c1=_0x8462('0x65')+_0x3f0aff[_0x8462('0x26')][_0x8462('0x66')];return db['sequelize']['query'](_0x1508c1,{'type':db[_0x8462('0x67')][_0x8462('0x7b')][_0x8462('0x68')],'raw':!![]})[_0x8462('0x1f')](function(_0x225b67){return _0x225b67;});})[_0x8462('0x1f')](function(_0x297a31){if(_0x297a31){_0x2d1357[_0x8462('0x26')][_0x8462('0x69')]=_0x297a31[0x0];if(!_0x4b20db['body'][_0x8462('0x59')])return;return db['User'][_0x8462('0x52')]({'where':{'id':_0x4b20db[_0x8462('0x51')][_0x8462('0x59')],'role':_0x8462('0x5a')},'attributes':['id','name',_0x8462('0x6b'),_0x8462('0x6c'),'internal'],'raw':!![]});}return null;})[_0x8462('0x1f')](function(_0x22307e){if(!_0x22307e)return null;_0x2d1357[_0x8462('0x26')][_0x8462('0x5a')]=_0x22307e;return _0x2d1357;})[_0x8462('0x1f')](function(_0x572ef0){if(_0x572ef0){_0x572ef0['message']['interface']=util[_0x8462('0x57')](_0x8462('0x70'),_0x4b20db['user'][_0x8462('0x35')]);_0x572ef0[_0x8462('0x26')][_0x8462('0x71')]=_0x2d1357[_0x8462('0x71')];_0x572ef0[_0x8462('0x26')][_0x8462('0x72')]=_0x2d1357[_0x8462('0x71')];_0x572ef0[_0x8462('0x26')][_0x8462('0x73')]=_0x8462('0x31');respondWithRpcPromise(_0x8462('0x75'),_0x8462('0x75'),{'event':_0x8462('0x7c'),'message':_0x572ef0[_0x8462('0x26')]},client9002);return _0x2d1357;}return null;})['then'](respondWithResult(_0x5c9f8d,null))[_0x8462('0x28')](handleError(_0x5c9f8d,null));};exports['status']=function(_0x14b078,_0x1b4938,_0x18f0c2){if(_0x14b078[_0x8462('0x51')]['id']){delete _0x14b078['body']['id'];}var _0x4e769c;return db[_0x8462('0x49')][_0x8462('0x52')]({'where':{'id':_0x14b078[_0x8462('0x4d')]['id']}})[_0x8462('0x1f')](handleEntityNotFound(_0x1b4938,null))[_0x8462('0x1f')](function(_0x1cc019){if(_0x1cc019){_0x4e769c=_0x1cc019;return db['SmsAccount'][_0x8462('0x52')]({'where':{'id':_0x1cc019[_0x8462('0x7d')]}});}})[_0x8462('0x1f')](handleEntityNotFound(_0x1b4938,null))[_0x8462('0x1f')](function(_0x1f4273){if(_0x1f4273){logger[_0x8462('0x7e')](_0x8462('0x22'),_0x8462('0x2e'),_0x8462('0x7f'),_0x1f4273[_0x8462('0x80')],util[_0x8462('0x81')](_0x14b078[_0x8462('0x51')],{'showHidden':![],'depth':null}));switch(_0x1f4273['type']){case _0x8462('0x82'):if(_0x14b078[_0x8462('0x51')]['MessageSid']&&_0x14b078[_0x8462('0x51')][_0x8462('0x83')]===_0x4e769c[_0x8462('0x84')]){return _0x4e769c[_0x8462('0x33')]({'read':!![]});}else{logger[_0x8462('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x8462('0x82'),util[_0x8462('0x81')](_0x14b078['body'],{'showHidden':![],'depth':null}));}break;case _0x8462('0x85'):if(_0x14b078['body']['MessageUUID']&&_0x14b078['body'][_0x8462('0x86')]===_0x4e769c[_0x8462('0x84')]&&_['indexOf']([_0x8462('0x87'),_0x8462('0x88')],_0x14b078[_0x8462('0x51')][_0x8462('0x89')])>=0x0){return _0x4e769c[_0x8462('0x33')]({'read':!![]});}else{logger[_0x8462('0x25')](_0x8462('0x8a'),_0x8462('0x2e'),_0x8462('0x8b'),util[_0x8462('0x81')](_0x14b078[_0x8462('0x51')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x525983=_0x14b078[_0x8462('0x51')][_0x8462('0x8c')][0x0];if(_0x525983[_0x8462('0x2e')]['groupName']===_0x8462('0x8d')){return _0x4e769c[_0x8462('0x33')]({'read':!![]});}else{logger[_0x8462('0x25')](_0x8462('0x8a'),_0x8462('0x2e'),_0x8462('0x8e'),util[_0x8462('0x81')](_0x14b078[_0x8462('0x51')],{'showHidden':![],'depth':null}));}break;}return _0x4e769c;}})['then'](respondWithResult(_0x1b4938,null))[_0x8462('0x28')](handleError(_0x1b4938,null));};
\ No newline at end of file
index d7e403f..05e6575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb45=['setMaxListeners','update','remove','emit','exports','events','SmsMessage'];(function(_0x5b0f21,_0x8161f){var _0x42463b=function(_0x297c91){while(--_0x297c91){_0x5b0f21['push'](_0x5b0f21['shift']());}};_0x42463b(++_0x8161f);}(_0xcb45,0x116));var _0x5cb4=function(_0x3c4f3f,_0x2d801e){_0x3c4f3f=_0x3c4f3f-0x0;var _0x462466=_0xcb45[_0x3c4f3f];return _0x462466;};'use strict';var EventEmitter=require(_0x5cb4('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x5cb4('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5cb4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5cb4('0x3'),'afterDestroy':_0x5cb4('0x4')};function emitEvent(_0x32b4a2){return function(_0x1f241e,_0x16ca1e,_0x406d23){SmsMessageEvents[_0x5cb4('0x5')](_0x32b4a2+':'+_0x1f241e['id'],_0x1f241e);SmsMessageEvents[_0x5cb4('0x5')](_0x32b4a2,_0x1f241e);_0x406d23(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x5cb4('0x6')]=SmsMessageEvents;
\ No newline at end of file
+var _0xd5dc=['hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5c5eb8,_0x53e878){var _0x3bf307=function(_0x2e1a79){while(--_0x2e1a79){_0x5c5eb8['push'](_0x5c5eb8['shift']());}};_0x3bf307(++_0x53e878);}(_0xd5dc,0x122));var _0xcd5d=function(_0x44b1c5,_0x1e7fdf){_0x44b1c5=_0x44b1c5-0x0;var _0x365acd=_0xd5dc[_0x44b1c5];return _0x365acd;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xcd5d('0x0'))['db'][_0xcd5d('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xcd5d('0x2')](0x0);var events={'afterCreate':_0xcd5d('0x3'),'afterUpdate':'update','afterDestroy':_0xcd5d('0x4')};function emitEvent(_0x259e7a){return function(_0x39a8ad,_0x424a3d,_0x32e14e){SmsMessageEvents[_0xcd5d('0x5')](_0x259e7a+':'+_0x39a8ad['id'],_0x39a8ad);SmsMessageEvents['emit'](_0x259e7a,_0x39a8ad);_0x32e14e(null);};}for(var e in events){if(events[_0xcd5d('0x6')](e)){var event=events[e];SmsMessage[_0xcd5d('0x7')](e,emitEvent(event));}}module[_0xcd5d('0x8')]=SmsMessageEvents;
\ No newline at end of file
index a4abb09..981fac5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2c7=['isNil','SmsInteraction','findOne','update','error','secret','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','remote','/status?token=','token','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','authId','Missing\x20parameters:\x20authId,\x20authToken','infobip','/auth/1/session','baseUrl','/sms/2/text/advanced','/api/sms/messages/','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','status','refid','Token\x20not\x20received','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0xf2c7[_0x9c8b4a];return _0x198bef;};'use strict';var _=require(_0x7f2c('0x0'));var util=require(_0x7f2c('0x1'));var logger=require(_0x7f2c('0x2'))(_0x7f2c('0x3'));var moment=require('moment');var BPromise=require(_0x7f2c('0x4'));var rp=require(_0x7f2c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7f2c('0x6'));var attributes=require('./smsMessage.attributes');module[_0x7f2c('0x7')]=function(_0x835eeb,_0x4e348c){return _0x835eeb[_0x7f2c('0x8')](_0x7f2c('0x9'),attributes,{'tableName':_0x7f2c('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x7f2c('0xb')]},{'name':_0x7f2c('0xc'),'fields':[_0x7f2c('0xd')],'type':_0x7f2c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x364e2a,_0x2e93d9,_0x4d60eb){var _0x34c9f2=_0x835eeb[_0x7f2c('0xf')];var _0x3edb66=_0x364e2a[_0x7f2c('0x10')]({'plain':!![]});if(_0x3edb66[_0x7f2c('0x11')][_0x7f2c('0x12')]()==='in'||_0x3edb66[_0x7f2c('0x11')][_0x7f2c('0x12')]()===_0x7f2c('0x13')&&!_0x3edb66['secret']&&!_[_0x7f2c('0x14')](_0x3edb66['UserId'])){_0x34c9f2[_0x7f2c('0x15')][_0x7f2c('0x16')]({'where':{'id':_0x3edb66['SmsInteractionId']}})['then'](function(_0x2a3409){if(_0x2a3409){_0x2a3409[_0x7f2c('0x17')]({'lastMsgAt':_0x3edb66['createdAt'],'lastMsgDirection':_0x3edb66[_0x7f2c('0x11')][_0x7f2c('0x12')]()});}})['catch'](function(_0x1846c6){console[_0x7f2c('0x18')](_0x1846c6);});}if(_0x3edb66[_0x7f2c('0x11')]===_0x7f2c('0x13')&&!_0x3edb66[_0x7f2c('0x19')]){var _0x31858f;_0x34c9f2[_0x7f2c('0x1a')][_0x7f2c('0x1b')]({'where':{'id':_0x3edb66[_0x7f2c('0x1c')]},'raw':!![]})[_0x7f2c('0x1d')](function(_0x5f4ae5){_0x31858f=_0x5f4ae5;if(_0x31858f&&_0x31858f['type']){switch(_0x31858f[_0x7f2c('0x1e')]){case _0x7f2c('0x1f'):var _0x1278fb=require(_0x7f2c('0x1f'));if(_0x31858f[_0x7f2c('0x20')]&&_0x31858f[_0x7f2c('0x21')]&&_0x31858f[_0x7f2c('0x22')]){var _0x13d338=new _0x1278fb(_0x31858f[_0x7f2c('0x20')],_0x31858f[_0x7f2c('0x21')]);_0x13d338[_0x7f2c('0x23')][_0x7f2c('0x24')]({'body':_0x3edb66[_0x7f2c('0xd')],'to':_0x3edb66[_0x7f2c('0x22')],'from':_0x31858f[_0x7f2c('0x22')],'statusCallback':_0x31858f[_0x7f2c('0x25')]+'/api/sms/messages/'+_0x3edb66['id']+_0x7f2c('0x26')+_0x31858f[_0x7f2c('0x27')]})['then'](function(_0x38f472){if(_0x38f472[_0x7f2c('0x28')]){return _0x364e2a[_0x7f2c('0x17')]({'messageId':_0x38f472['sid']});}})[_0x7f2c('0x29')](function(_0x2386bf){logger[_0x7f2c('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7f2c('0x2a'),_0x7f2c('0x1f'),util[_0x7f2c('0x2b')](_0x2386bf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7f2c('0x2c'),'afterCreate',_0x7f2c('0x1f'),_0x7f2c('0x2d'));}break;case _0x7f2c('0x2e'):var _0xb37dc6=_0x7f2c('0x2f');if(_0x31858f[_0x7f2c('0x30')]&&_0x31858f[_0x7f2c('0x31')]){var _0x287124={'recipient':[_0x3edb66['phone']],'message':_0x3edb66[_0x7f2c('0xd')],'message_type':_0x31858f[_0x7f2c('0x32')]};if(_0x31858f[_0x7f2c('0x32')]&&_0x31858f[_0x7f2c('0x32')]!=='SI'){_0x287124[_0x7f2c('0x33')]=_0x31858f[_0x7f2c('0x22')];}var _0x1516bb={'url':_0xb37dc6+_0x7f2c('0x34')+_0x31858f[_0x7f2c('0x30')]+_0x7f2c('0x35')+_0x31858f[_0x7f2c('0x31')],'method':_0x7f2c('0x36')};rp(_0x1516bb)[_0x7f2c('0x1d')](function(_0x4de0fd){var _0x21e2e9=_0x4de0fd['split'](';');var _0xb69430={'user_key':_0x21e2e9[0x0],'session_key':_0x21e2e9[0x1]};_0x1516bb={'url':_0xb37dc6+_0x7f2c('0x37'),'method':_0x7f2c('0x38'),'headers':{'user_key':_0xb69430[_0x7f2c('0x39')],'Session_key':_0xb69430['session_key']},'json':!![],'body':_0x287124};return rp(_0x1516bb);})['then'](function(_0x222d88){if(_0x222d88[_0x7f2c('0x3a')]>=0x1){var _0x2185d7={'messageId':_0x222d88[_0x7f2c('0x3b')]};if(_0x31858f[_0x7f2c('0x32')]!=='GP'||!_0x31858f[_0x7f2c('0x3c')]){_0x2185d7[_0x7f2c('0x3d')]=!![];}return _0x364e2a['update'](_0x2185d7);}else{return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x2e'),util[_0x7f2c('0x2b')](_0x222d88,{'showHidden':![],'depth':null}));}})['catch'](function(_0xf2385e){return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x2e'),util[_0x7f2c('0x2b')](_0xf2385e,{'showHidden':![],'depth':null}));});}else{logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x31858f[_0x7f2c('0x21')]){var _0x142b3c={'recipient':_0x3edb66[_0x7f2c('0x22')],'message':_0x3edb66[_0x7f2c('0xd')],'sender':_0x31858f[_0x7f2c('0x3e')]||_0x31858f[_0x7f2c('0x22')],'authorization':_0x31858f['authToken']};var _0x2e93d9={'method':'POST','uri':_0x7f2c('0x3f'),'body':_0x142b3c,'json':!![]};rp(_0x2e93d9)[_0x7f2c('0x1d')](function(_0x1d789b){var _0x64db68={'messageId':_0x1d789b[_0x7f2c('0x40')]};if(!_0x31858f[_0x7f2c('0x3c')]){_0x64db68['read']=!![];}return _0x364e2a[_0x7f2c('0x17')](_0x64db68);})['catch'](function(_0x5eb47d){logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),'afterCreate',_0x7f2c('0x41'),util['inspect'](_0x5eb47d,{'showHidden':![],'depth':null}));});}else{logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),'afterCreate',_0x7f2c('0x41'),_0x7f2c('0x42'));}break;case _0x7f2c('0x43'):if(_0x31858f[_0x7f2c('0x30')]&&_0x31858f['password']){var _0x142b3c={'messages':[{'source':'xCALLY\x20Motion','to':_0x3edb66[_0x7f2c('0x22')],'body':_0x3edb66[_0x7f2c('0xd')],'from':_0x31858f[_0x7f2c('0x3e')]||_0x31858f[_0x7f2c('0x22')]}]};var _0x45a56d=util['format']('%s:%s',_0x31858f[_0x7f2c('0x30')],_0x31858f[_0x7f2c('0x31')]);var _0x2e93d9={'method':'POST','uri':_0x7f2c('0x44'),'body':_0x142b3c,'headers':{'Authorization':util[_0x7f2c('0x45')](_0x7f2c('0x46'),new Buffer(_0x45a56d)[_0x7f2c('0x47')](_0x7f2c('0x48')))},'json':!![]};rp(_0x2e93d9)[_0x7f2c('0x1d')](function(_0x4c8a62){if(_0x4c8a62[_0x7f2c('0x49')]>=0xc8&&_0x4c8a62[_0x7f2c('0x49')]<=0xce){if(_0x4c8a62[_0x7f2c('0x4a')]&&_0x4c8a62['data']['queued_count']>0x0){var _0x10bcd2=_['head'](_0x4c8a62[_0x7f2c('0x4a')]['messages']);var _0x27e0a2={'messageId':_0x10bcd2[_0x7f2c('0x4b')]};if(!_0x31858f[_0x7f2c('0x3c')]){_0x27e0a2['read']=!![];}return _0x364e2a[_0x7f2c('0x17')](_0x27e0a2);}else{logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),'afterCreate','clickSend',util[_0x7f2c('0x2b')](_0x4c8a62,{'showHidden':![],'depth':null}));}}else{logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),'clickSend',util[_0x7f2c('0x2b')](_0x4c8a62,{'showHidden':![],'depth':null}));}})[_0x7f2c('0x29')](function(_0x400a94){logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),'afterCreate',_0x7f2c('0x4c'),util[_0x7f2c('0x2b')](_0x400a94,{'showHidden':![],'depth':null}));});}else{logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x4c'),_0x7f2c('0x4d'));}break;case _0x7f2c('0x4e'):if(_0x31858f['authId']&&_0x31858f[_0x7f2c('0x21')]){var _0x142b3c={'dst':_0x3edb66[_0x7f2c('0x22')],'text':_0x3edb66[_0x7f2c('0xd')],'src':_0x31858f[_0x7f2c('0x3e')]||_0x31858f[_0x7f2c('0x22')],'url':_0x31858f['remote']+'/api/sms/messages/'+_0x3edb66['id']+_0x7f2c('0x26')+_0x31858f[_0x7f2c('0x27')]};var _0x45a56d=util[_0x7f2c('0x45')](_0x7f2c('0x4f'),_0x31858f['authId'],_0x31858f[_0x7f2c('0x21')]);var _0x2e93d9={'method':_0x7f2c('0x38'),'uri':util[_0x7f2c('0x45')](_0x7f2c('0x50'),_0x31858f[_0x7f2c('0x51')]),'body':_0x142b3c,'headers':{'Authorization':util[_0x7f2c('0x45')]('Basic\x20%s',new Buffer(_0x45a56d)[_0x7f2c('0x47')](_0x7f2c('0x48')))},'json':!![]};rp(_0x2e93d9)[_0x7f2c('0x1d')](function(_0x485c1a){var _0x1ee043={'messageId':_0x485c1a['message_uuid'][0x0]};return _0x364e2a[_0x7f2c('0x17')](_0x1ee043);})['catch'](function(_0x25f1e0){logger['error'](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x4e'),util[_0x7f2c('0x2b')](_0x25f1e0,{'showHidden':![],'depth':null}));});}else{logger[_0x7f2c('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7f2c('0x2a'),_0x7f2c('0x4e'),_0x7f2c('0x52'));}break;case _0x7f2c('0x53'):if(_0x31858f['username']&&_0x31858f[_0x7f2c('0x31')]){if(_0x31858f['baseUrl']){var _0x5e17e={'method':_0x7f2c('0x38'),'uri':_0x31858f['baseUrl']+_0x7f2c('0x54'),'body':{'username':_0x31858f['username'],'password':_0x31858f['password']},'json':!![]};return rp(_0x5e17e)['then'](function(_0x518aef){var _0x48a1b8={'method':_0x7f2c('0x38'),'uri':_0x31858f[_0x7f2c('0x55')]+_0x7f2c('0x56'),'body':{'messages':[{'from':_0x31858f[_0x7f2c('0x22')],'destinations':[{'to':_0x3edb66[_0x7f2c('0x22')]}],'text':_0x3edb66[_0x7f2c('0xd')],'notifyUrl':_0x31858f['remote']+_0x7f2c('0x57')+_0x3edb66['id']+_0x7f2c('0x26')+_0x31858f[_0x7f2c('0x27')],'notifyContentType':_0x7f2c('0x58'),'callbackData':_0x31858f[_0x7f2c('0x22')]+';'+_0x3edb66[_0x7f2c('0xd')]}]},'headers':{'Authorization':_0x7f2c('0x59')+_0x518aef[_0x7f2c('0x27')]},'json':!![]};return rp(_0x48a1b8)[_0x7f2c('0x1d')](function(_0x926cd1){if(_0x926cd1[_0x7f2c('0x23')]){var _0x2cae9b={'messageId':_0x926cd1[_0x7f2c('0x23')][0x0]['messageId']};if(!_0x31858f[_0x7f2c('0x3c')]){_0x2cae9b['read']=!![];}return _0x364e2a['update'](_0x2cae9b);}else{return logger[_0x7f2c('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7f2c('0x2a'),_0x7f2c('0x53'),util[_0x7f2c('0x2b')](_0x926cd1,{'showHidden':![],'depth':null}));}});})[_0x7f2c('0x29')](function(_0xaa436d){return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),'afterCreate',_0x7f2c('0x53'),util[_0x7f2c('0x2b')](_0xaa436d,{'showHidden':![],'depth':null}));});}else{logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),'afterCreate',_0x7f2c('0x53'),_0x7f2c('0x5a'));}}else{logger['error'](_0x7f2c('0x2c'),'afterCreate',_0x7f2c('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x7f2c('0x5b'):var _0x1e69bd=require(_0x7f2c('0x5c'));if(_0x31858f[_0x7f2c('0x5d')]){var _0x1c7851={};_0x1c7851['login']=_0x31858f['username'];_0x1c7851[_0x7f2c('0x22')]=_0x3edb66[_0x7f2c('0x22')];_0x1c7851[_0x7f2c('0x33')]=_0x31858f[_0x7f2c('0x22')];_0x1c7851[_0x7f2c('0x5e')]=_0x3edb66[_0x7f2c('0xd')];_0x1c7851['timestamp']=+new Date();var _0x1834ee='';var _0x2adf5e='';var _0x4e3733=Object[_0x7f2c('0x5f')](_0x1c7851);_0x4e3733['sort']();for(var _0x5b1a38=0x0;_0x5b1a38<_0x4e3733[_0x7f2c('0x60')];_0x5b1a38++){if(_0x1834ee!=''){_0x1834ee+='&';}_0x1834ee+=_0x4e3733[_0x5b1a38]+'='+encodeURIComponent(_0x1c7851[_0x4e3733[_0x5b1a38]]);_0x2adf5e+=_0x1c7851[_0x4e3733[_0x5b1a38]];}_0x2adf5e+=_0x31858f[_0x7f2c('0x5d')];_0x2adf5e=_0x1e69bd[_0x7f2c('0x61')](_0x7f2c('0x62'))['update'](_0x2adf5e)[_0x7f2c('0x63')](_0x7f2c('0x64'));if(_0x1834ee!==''){_0x1834ee+='&';}_0x1834ee+=_0x7f2c('0x65')+_0x2adf5e;var _0x1516bb={'method':'GET','uri':_0x31858f['baseUrl']+_0x7f2c('0x66')+_0x1834ee,'json':!![]};return rp(_0x1516bb)[_0x7f2c('0x1d')](function(_0x48dfb1){var _0x52dd62=Object[_0x7f2c('0x5f')](_0x48dfb1);if(_0x48dfb1[_0x52dd62[0x0]]['error']&&parseInt(_0x48dfb1[_0x52dd62[0x0]][_0x7f2c('0x18')])===0x0){var _0x456e9e={'messageId':_0x48dfb1[_0x52dd62[0x0]]['id_sms']};if(!_0x31858f[_0x7f2c('0x3c')]){_0x456e9e[_0x7f2c('0x3d')]=!![];}return _0x364e2a['update'](_0x456e9e);}else{return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),'afterCreate','csc',util['inspect'](_0x48dfb1[_0x7f2c('0x18')],{'showHidden':![],'depth':null}));}})[_0x7f2c('0x29')](function(_0xce667e){return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),'csc',util[_0x7f2c('0x2b')](_0xce667e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x5b'),_0x7f2c('0x67'));}break;case _0x7f2c('0x68'):if(_0x31858f[_0x7f2c('0x5d')]){var _0x2f2a55={'method':_0x7f2c('0x38'),'uri':_0x7f2c('0x69'),'headers':{'Authorization':_0x31858f[_0x7f2c('0x5d')]},'body':{'content':_0x3edb66['body'],'to':[_0x3edb66[_0x7f2c('0x22')]],'from':_0x31858f[_0x7f2c('0x22')],'binary':![],'clientMessageId':_0x7f2c('0x6a'),'charset':_0x7f2c('0x6b')},'json':!![]};rp(_0x2f2a55)[_0x7f2c('0x1d')](function(_0x39f156){if(!_0x39f156[_0x7f2c('0x18')]){var _0x198270={'messageId':_0x39f156['messages'][0x0]['apiMessageId']};if(!_0x31858f[_0x7f2c('0x3c')]){_0x198270[_0x7f2c('0x3d')]=!![];}return _0x364e2a[_0x7f2c('0x17')](_0x198270);}else{return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),'clickatell',util['inspect'](_0x39f156['error'],{'showHidden':![],'depth':null}));}})[_0x7f2c('0x29')](function(_0x2ebfef){return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x68'),util[_0x7f2c('0x2b')](_0x2ebfef,{'showHidden':![],'depth':null}));});}else{logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x68'),_0x7f2c('0x67'));}break;case _0x7f2c('0x6c'):if(_0x31858f[_0x7f2c('0x30')]&&_0x31858f[_0x7f2c('0x31')]){var _0x45a56d=util[_0x7f2c('0x45')](_0x7f2c('0x4f'),_0x31858f[_0x7f2c('0x30')],_0x31858f[_0x7f2c('0x31')]);var _0x2e93d9={'method':_0x7f2c('0x38'),'uri':_0x7f2c('0x6d')+_0x31858f[_0x7f2c('0x6e')]+_0x7f2c('0x6f'),'body':{'to':[_0x3edb66[_0x7f2c('0x22')]],'text':_0x3edb66['body'],'from':_0x31858f[_0x7f2c('0x22')],'applicationId':_0x31858f[_0x7f2c('0x70')]},'headers':{'Authorization':util[_0x7f2c('0x45')](_0x7f2c('0x46'),new Buffer(_0x45a56d)['toString'](_0x7f2c('0x48')))},'json':!![]};rp(_0x2e93d9)[_0x7f2c('0x1d')](function(_0xff640b){if(_0xff640b['id']){var _0x33aeb2={'messageId':_0xff640b['id']};return _0x364e2a['update'](_0x33aeb2);}else{logger['error'](_0x7f2c('0x2c'),'afterCreate',_0x7f2c('0x6c'),util[_0x7f2c('0x2b')](_0xff640b,{'showHidden':![],'depth':null}));}})[_0x7f2c('0x29')](function(_0x5f2d2b){logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),'bandwidth',util[_0x7f2c('0x2b')](_0x5f2d2b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7f2c('0x2c'),'afterCreate','bandwidth',_0x7f2c('0x4d'));}break;case _0x7f2c('0x71'):if(_0x31858f[_0x7f2c('0x5d')]){var _0x251d0b={};var _0x1516bb={'method':_0x7f2c('0x38'),'uri':_0x7f2c('0x72'),'headers':{'Authorization':'Bearer\x20'+_0x31858f[_0x7f2c('0x5d')],'Content-Type':_0x7f2c('0x58')},'body':{'from':_0x31858f[_0x7f2c('0x22')],'to':_0x3edb66[_0x7f2c('0x22')],'text':_0x3edb66['body']},'json':!![]};return rp(_0x1516bb)[_0x7f2c('0x1d')](function(_0x31f4d1){if(_0x31f4d1[_0x7f2c('0x73')]==0xca){_0x251d0b[_0x7f2c('0x74')]=_0x31f4d1;var _0x3bb27a={'method':_0x7f2c('0x38'),'uri':_0x7f2c('0x75'),'headers':{'Authorization':_0x7f2c('0x76')+_0x31858f[_0x7f2c('0x5d')],'Content-Type':'application/json'},'body':{'refid':_0x251d0b[_0x7f2c('0x74')]['refid']},'json':!![]};return rp(_0x3bb27a)[_0x7f2c('0x1d')](function(_0x276abc){_0x251d0b[_0x7f2c('0x77')]=_0x276abc;var _0x1be2c6={'messageId':_0x251d0b[_0x7f2c('0x74')][_0x7f2c('0x78')],'read':!![]};return _0x364e2a['update'](_0x1be2c6);});}else{return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),_0x7f2c('0x2a'),'intelepeer',util['inspect'](_0x31f4d1,{'showHidden':![],'depth':null}));}})[_0x7f2c('0x29')](function(_0x17f9ed){return logger['error'](_0x7f2c('0x2c'),_0x7f2c('0x2a'),_0x7f2c('0x71'),util[_0x7f2c('0x2b')](_0x17f9ed,{'showHidden':![],'depth':null}));});}else{return logger[_0x7f2c('0x18')](_0x7f2c('0x2c'),'afterCreate','intelepeer',_0x7f2c('0x79'));}break;}}})['finally'](function(){_0x4d60eb();});}else{_0x4d60eb();}}},'charset':_0x7f2c('0x7a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1b73=['utf8mb4','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','catch','out','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','error','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','login?username=','GET','sms','POST','user_key','session_key','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','username','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','accountId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','intelepeer'];(function(_0x42ebd6,_0x3c8f5e){var _0x429d4e=function(_0x531cd3){while(--_0x531cd3){_0x42ebd6['push'](_0x42ebd6['shift']());}};_0x429d4e(++_0x3c8f5e);}(_0x1b73,0x1d5));var _0x31b7=function(_0x75f30e,_0x1bc242){_0x75f30e=_0x75f30e-0x0;var _0x967dca=_0x1b73[_0x75f30e];return _0x967dca;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var logger=require(_0x31b7('0x1'))(_0x31b7('0x2'));var moment=require(_0x31b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x31b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31b7('0x5'));var config=require(_0x31b7('0x6'));var attributes=require('./smsMessage.attributes');module[_0x31b7('0x7')]=function(_0x3d058f,_0x15c31e){return _0x3d058f['define'](_0x31b7('0x8'),attributes,{'tableName':_0x31b7('0x9'),'paranoid':![],'indexes':[{'name':_0x31b7('0xa'),'fields':[_0x31b7('0xa')]},{'name':_0x31b7('0xb'),'fields':[_0x31b7('0xc')],'type':_0x31b7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x499568,_0x268428,_0x3ea646){var _0x2497bd=_0x3d058f[_0x31b7('0xe')];var _0x1d1f0f=_0x499568[_0x31b7('0xf')]({'plain':!![]});if(_0x1d1f0f[_0x31b7('0x10')][_0x31b7('0x11')]()==='in'||_0x1d1f0f[_0x31b7('0x10')][_0x31b7('0x11')]()==='out'&&!_0x1d1f0f[_0x31b7('0x12')]&&!_[_0x31b7('0x13')](_0x1d1f0f[_0x31b7('0x14')])){_0x2497bd[_0x31b7('0x15')][_0x31b7('0x16')]({'where':{'id':_0x1d1f0f[_0x31b7('0x17')]}})[_0x31b7('0x18')](function(_0x34e917){if(_0x34e917){_0x34e917[_0x31b7('0x19')]({'lastMsgAt':_0x1d1f0f['createdAt'],'lastMsgDirection':_0x1d1f0f[_0x31b7('0x10')]['toLowerCase']()});}})[_0x31b7('0x1a')](function(_0xf213c9){console['error'](_0xf213c9);});}if(_0x1d1f0f[_0x31b7('0x10')]===_0x31b7('0x1b')&&!_0x1d1f0f[_0x31b7('0x12')]){var _0x39eee9;_0x2497bd[_0x31b7('0x1c')]['find']({'where':{'id':_0x1d1f0f[_0x31b7('0x1d')]},'raw':!![]})[_0x31b7('0x18')](function(_0x1dc28c){_0x39eee9=_0x1dc28c;if(_0x39eee9&&_0x39eee9[_0x31b7('0x1e')]){switch(_0x39eee9[_0x31b7('0x1e')]){case'twilio':var _0x19ad46=require(_0x31b7('0x1f'));if(_0x39eee9[_0x31b7('0x20')]&&_0x39eee9[_0x31b7('0x21')]&&_0x39eee9['phone']){var _0x892fe4=new _0x19ad46(_0x39eee9[_0x31b7('0x20')],_0x39eee9[_0x31b7('0x21')]);_0x892fe4[_0x31b7('0x22')]['create']({'body':_0x1d1f0f[_0x31b7('0xc')],'to':_0x1d1f0f[_0x31b7('0x23')],'from':_0x39eee9[_0x31b7('0x23')],'statusCallback':_0x39eee9[_0x31b7('0x24')]+_0x31b7('0x25')+_0x1d1f0f['id']+_0x31b7('0x26')+_0x39eee9[_0x31b7('0x27')]})[_0x31b7('0x18')](function(_0x3b0eff){if(_0x3b0eff['sid']){return _0x499568[_0x31b7('0x19')]({'messageId':_0x3b0eff[_0x31b7('0x28')]});}})[_0x31b7('0x1a')](function(_0x2c993b){logger['error'](_0x31b7('0x29'),'afterCreate',_0x31b7('0x1f'),util[_0x31b7('0x2a')](_0x2c993b,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x1f'),_0x31b7('0x2d'));}break;case _0x31b7('0x2e'):var _0x4e58e5='https://api.skebby.it/API/v1.0/REST/';if(_0x39eee9['username']&&_0x39eee9[_0x31b7('0x2f')]){var _0x39521d={'recipient':[_0x1d1f0f[_0x31b7('0x23')]],'message':_0x1d1f0f['body'],'message_type':_0x39eee9[_0x31b7('0x30')]};if(_0x39eee9[_0x31b7('0x30')]&&_0x39eee9[_0x31b7('0x30')]!=='SI'){_0x39521d[_0x31b7('0x31')]=_0x39eee9['phone'];}var _0xc974a2={'url':_0x4e58e5+_0x31b7('0x32')+_0x39eee9['username']+'&password='+_0x39eee9[_0x31b7('0x2f')],'method':_0x31b7('0x33')};rp(_0xc974a2)[_0x31b7('0x18')](function(_0x35f83c){var _0x53f1cb=_0x35f83c['split'](';');var _0x45f029={'user_key':_0x53f1cb[0x0],'session_key':_0x53f1cb[0x1]};_0xc974a2={'url':_0x4e58e5+_0x31b7('0x34'),'method':_0x31b7('0x35'),'headers':{'user_key':_0x45f029[_0x31b7('0x36')],'Session_key':_0x45f029[_0x31b7('0x37')]},'json':!![],'body':_0x39521d};return rp(_0xc974a2);})['then'](function(_0x4e6863){if(_0x4e6863[_0x31b7('0x38')]>=0x1){var _0x2234cd={'messageId':_0x4e6863['internal_order_id']};if(_0x39eee9[_0x31b7('0x30')]!=='GP'||!_0x39eee9[_0x31b7('0x39')]){_0x2234cd['read']=!![];}return _0x499568[_0x31b7('0x19')](_0x2234cd);}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x2e'),util[_0x31b7('0x2a')](_0x4e6863,{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x200314){return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x2e'),util[_0x31b7('0x2a')](_0x200314,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),_0x31b7('0x2e'),_0x31b7('0x3a'));}break;case _0x31b7('0x3b'):if(_0x39eee9[_0x31b7('0x21')]){var _0xe3e29f={'recipient':_0x1d1f0f[_0x31b7('0x23')],'message':_0x1d1f0f[_0x31b7('0xc')],'sender':_0x39eee9[_0x31b7('0x3c')]||_0x39eee9[_0x31b7('0x23')],'authorization':_0x39eee9['authToken']};var _0x268428={'method':_0x31b7('0x35'),'uri':_0x31b7('0x3d'),'body':_0xe3e29f,'json':!![]};rp(_0x268428)[_0x31b7('0x18')](function(_0x5c9cec){var _0x20e865={'messageId':_0x5c9cec[_0x31b7('0x3e')]};if(!_0x39eee9['deliveryReport']){_0x20e865[_0x31b7('0x3f')]=!![];}return _0x499568['update'](_0x20e865);})['catch'](function(_0x6b2bbd){logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x3b'),util['inspect'](_0x6b2bbd,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0x31b7('0x40'));}break;case _0x31b7('0x41'):if(_0x39eee9[_0x31b7('0x42')]&&_0x39eee9[_0x31b7('0x2f')]){var _0xe3e29f={'messages':[{'source':'xCALLY\x20Motion','to':_0x1d1f0f[_0x31b7('0x23')],'body':_0x1d1f0f['body'],'from':_0x39eee9[_0x31b7('0x3c')]||_0x39eee9[_0x31b7('0x23')]}]};var _0x3bf1f1=util[_0x31b7('0x43')]('%s:%s',_0x39eee9[_0x31b7('0x42')],_0x39eee9[_0x31b7('0x2f')]);var _0x268428={'method':'POST','uri':_0x31b7('0x44'),'body':_0xe3e29f,'headers':{'Authorization':util['format'](_0x31b7('0x45'),new Buffer(_0x3bf1f1)[_0x31b7('0x46')]('base64'))},'json':!![]};rp(_0x268428)[_0x31b7('0x18')](function(_0x3b65de){if(_0x3b65de[_0x31b7('0x47')]>=0xc8&&_0x3b65de[_0x31b7('0x47')]<=0xce){if(_0x3b65de['data']&&_0x3b65de[_0x31b7('0x48')]['queued_count']>0x0){var _0x558d82=_[_0x31b7('0x49')](_0x3b65de[_0x31b7('0x48')][_0x31b7('0x22')]);var _0x104a71={'messageId':_0x558d82['message_id']};if(!_0x39eee9[_0x31b7('0x39')]){_0x104a71[_0x31b7('0x3f')]=!![];}return _0x499568['update'](_0x104a71);}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),'clickSend',util[_0x31b7('0x2a')](_0x3b65de,{'showHidden':![],'depth':null}));}}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x4a'),util[_0x31b7('0x2a')](_0x3b65de,{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x40aead){logger['error'](_0x31b7('0x29'),'afterCreate','clickSend',util[_0x31b7('0x2a')](_0x40aead,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),'clickSend',_0x31b7('0x3a'));}break;case _0x31b7('0x4b'):if(_0x39eee9[_0x31b7('0x4c')]&&_0x39eee9['authToken']){var _0xe3e29f={'dst':_0x1d1f0f[_0x31b7('0x23')],'text':_0x1d1f0f[_0x31b7('0xc')],'src':_0x39eee9[_0x31b7('0x3c')]||_0x39eee9[_0x31b7('0x23')],'url':_0x39eee9[_0x31b7('0x24')]+_0x31b7('0x25')+_0x1d1f0f['id']+_0x31b7('0x26')+_0x39eee9['token']};var _0x3bf1f1=util[_0x31b7('0x43')](_0x31b7('0x4d'),_0x39eee9[_0x31b7('0x4c')],_0x39eee9[_0x31b7('0x21')]);var _0x268428={'method':'POST','uri':util[_0x31b7('0x43')](_0x31b7('0x4e'),_0x39eee9[_0x31b7('0x4c')]),'body':_0xe3e29f,'headers':{'Authorization':util[_0x31b7('0x43')](_0x31b7('0x45'),new Buffer(_0x3bf1f1)[_0x31b7('0x46')](_0x31b7('0x4f')))},'json':!![]};rp(_0x268428)[_0x31b7('0x18')](function(_0x5a67a9){var _0x535a3c={'messageId':_0x5a67a9[_0x31b7('0x50')][0x0]};return _0x499568[_0x31b7('0x19')](_0x535a3c);})[_0x31b7('0x1a')](function(_0x36943d){logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x4b'),util[_0x31b7('0x2a')](_0x36943d,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x31b7('0x4b'),_0x31b7('0x51'));}break;case _0x31b7('0x52'):if(_0x39eee9[_0x31b7('0x42')]&&_0x39eee9['password']){if(_0x39eee9[_0x31b7('0x53')]){var _0x12b15d={'method':_0x31b7('0x35'),'uri':_0x39eee9[_0x31b7('0x53')]+_0x31b7('0x54'),'body':{'username':_0x39eee9[_0x31b7('0x42')],'password':_0x39eee9[_0x31b7('0x2f')]},'json':!![]};return rp(_0x12b15d)[_0x31b7('0x18')](function(_0x1c58a7){var _0x289a0b={'method':_0x31b7('0x35'),'uri':_0x39eee9['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x39eee9[_0x31b7('0x23')],'destinations':[{'to':_0x1d1f0f[_0x31b7('0x23')]}],'text':_0x1d1f0f[_0x31b7('0xc')],'notifyUrl':_0x39eee9[_0x31b7('0x24')]+_0x31b7('0x25')+_0x1d1f0f['id']+_0x31b7('0x26')+_0x39eee9['token'],'notifyContentType':_0x31b7('0x55'),'callbackData':_0x39eee9['phone']+';'+_0x1d1f0f['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x1c58a7[_0x31b7('0x27')]},'json':!![]};return rp(_0x289a0b)[_0x31b7('0x18')](function(_0x2ea5b6){if(_0x2ea5b6[_0x31b7('0x22')]){var _0x44934f={'messageId':_0x2ea5b6[_0x31b7('0x22')][0x0][_0x31b7('0xa')]};if(!_0x39eee9[_0x31b7('0x39')]){_0x44934f[_0x31b7('0x3f')]=!![];}return _0x499568[_0x31b7('0x19')](_0x44934f);}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x52'),util[_0x31b7('0x2a')](_0x2ea5b6,{'showHidden':![],'depth':null}));}});})[_0x31b7('0x1a')](function(_0x317558){return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x52'),util[_0x31b7('0x2a')](_0x317558,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),'afterCreate',_0x31b7('0x52'),_0x31b7('0x56'));}}else{logger['error'](_0x31b7('0x29'),'afterCreate',_0x31b7('0x52'),_0x31b7('0x3a'));}break;case _0x31b7('0x57'):var _0x516eac=require('crypto');if(_0x39eee9[_0x31b7('0x58')]){var _0x52208e={};_0x52208e[_0x31b7('0x59')]=_0x39eee9[_0x31b7('0x42')];_0x52208e[_0x31b7('0x23')]=_0x1d1f0f[_0x31b7('0x23')];_0x52208e[_0x31b7('0x31')]=_0x39eee9[_0x31b7('0x23')];_0x52208e['text']=_0x1d1f0f[_0x31b7('0xc')];_0x52208e[_0x31b7('0x5a')]=+new Date();var _0x45ee19='';var _0x23a45e='';var _0x3c0cf8=Object[_0x31b7('0x5b')](_0x52208e);_0x3c0cf8[_0x31b7('0x5c')]();for(var _0x409a7c=0x0;_0x409a7c<_0x3c0cf8[_0x31b7('0x5d')];_0x409a7c++){if(_0x45ee19!=''){_0x45ee19+='&';}_0x45ee19+=_0x3c0cf8[_0x409a7c]+'='+encodeURIComponent(_0x52208e[_0x3c0cf8[_0x409a7c]]);_0x23a45e+=_0x52208e[_0x3c0cf8[_0x409a7c]];}_0x23a45e+=_0x39eee9[_0x31b7('0x58')];_0x23a45e=_0x516eac[_0x31b7('0x5e')](_0x31b7('0x5f'))[_0x31b7('0x19')](_0x23a45e)[_0x31b7('0x60')](_0x31b7('0x61'));if(_0x45ee19!==''){_0x45ee19+='&';}_0x45ee19+=_0x31b7('0x62')+_0x23a45e;var _0xc974a2={'method':_0x31b7('0x33'),'uri':_0x39eee9[_0x31b7('0x53')]+_0x31b7('0x63')+_0x45ee19,'json':!![]};return rp(_0xc974a2)[_0x31b7('0x18')](function(_0x2640db){var _0x3f9ef3=Object[_0x31b7('0x5b')](_0x2640db);if(_0x2640db[_0x3f9ef3[0x0]][_0x31b7('0x2b')]&&parseInt(_0x2640db[_0x3f9ef3[0x0]][_0x31b7('0x2b')])===0x0){var _0x14f87a={'messageId':_0x2640db[_0x3f9ef3[0x0]][_0x31b7('0x64')]};if(!_0x39eee9[_0x31b7('0x39')]){_0x14f87a[_0x31b7('0x3f')]=!![];}return _0x499568[_0x31b7('0x19')](_0x14f87a);}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x57'),util[_0x31b7('0x2a')](_0x2640db[_0x31b7('0x2b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3c978d){return logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),_0x31b7('0x57'),util[_0x31b7('0x2a')](_0x3c978d,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),'afterCreate',_0x31b7('0x57'),_0x31b7('0x65'));}break;case _0x31b7('0x66'):if(_0x39eee9[_0x31b7('0x58')]){var _0x22aa06={'method':_0x31b7('0x35'),'uri':_0x31b7('0x67'),'headers':{'Authorization':_0x39eee9[_0x31b7('0x58')]},'body':{'content':_0x1d1f0f[_0x31b7('0xc')],'to':[_0x1d1f0f[_0x31b7('0x23')]],'from':_0x39eee9[_0x31b7('0x23')],'binary':![],'clientMessageId':_0x31b7('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x22aa06)['then'](function(_0x53dcd6){if(!_0x53dcd6[_0x31b7('0x2b')]){var _0x5d4fd3={'messageId':_0x53dcd6[_0x31b7('0x22')][0x0][_0x31b7('0x69')]};if(!_0x39eee9['deliveryReport']){_0x5d4fd3[_0x31b7('0x3f')]=!![];}return _0x499568[_0x31b7('0x19')](_0x5d4fd3);}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),'afterCreate','clickatell',util[_0x31b7('0x2a')](_0x53dcd6[_0x31b7('0x2b')],{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x332190){return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x66'),util[_0x31b7('0x2a')](_0x332190,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),'clickatell',_0x31b7('0x65'));}break;case'bandwidth':if(_0x39eee9[_0x31b7('0x42')]&&_0x39eee9[_0x31b7('0x2f')]){var _0x3bf1f1=util[_0x31b7('0x43')]('%s:%s',_0x39eee9['username'],_0x39eee9['password']);var _0x268428={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x39eee9[_0x31b7('0x6a')]+'/messages','body':{'to':[_0x1d1f0f[_0x31b7('0x23')]],'text':_0x1d1f0f[_0x31b7('0xc')],'from':_0x39eee9['phone'],'applicationId':_0x39eee9['applicationId']},'headers':{'Authorization':util[_0x31b7('0x43')](_0x31b7('0x45'),new Buffer(_0x3bf1f1)[_0x31b7('0x46')](_0x31b7('0x4f')))},'json':!![]};rp(_0x268428)[_0x31b7('0x18')](function(_0x56ebb9){if(_0x56ebb9['id']){var _0x228cb6={'messageId':_0x56ebb9['id']};return _0x499568[_0x31b7('0x19')](_0x228cb6);}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x6b'),util['inspect'](_0x56ebb9,{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x4028e3){logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x6b'),util['inspect'](_0x4028e3,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),'bandwidth',_0x31b7('0x3a'));}break;case'intelepeer':if(_0x39eee9['apiKey']){var _0x39956e={};var _0xc974a2={'method':'POST','uri':_0x31b7('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x39eee9[_0x31b7('0x58')],'Content-Type':_0x31b7('0x55')},'body':{'from':_0x39eee9[_0x31b7('0x23')],'to':_0x1d1f0f[_0x31b7('0x23')],'text':_0x1d1f0f[_0x31b7('0xc')]},'json':!![]};return rp(_0xc974a2)['then'](function(_0x514d6b){if(_0x514d6b[_0x31b7('0x6d')]==0xca){_0x39956e[_0x31b7('0x6e')]=_0x514d6b;var _0x3f8b01={'method':'POST','uri':_0x31b7('0x6f'),'headers':{'Authorization':_0x31b7('0x70')+_0x39eee9[_0x31b7('0x58')],'Content-Type':'application/json'},'body':{'refid':_0x39956e['message'][_0x31b7('0x71')]},'json':!![]};return rp(_0x3f8b01)['then'](function(_0x27132b){_0x39956e[_0x31b7('0x72')]=_0x27132b;var _0x5da016={'messageId':_0x39956e[_0x31b7('0x6e')]['refid'],'read':!![]};return _0x499568['update'](_0x5da016);});}else{return logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),_0x31b7('0x73'),util['inspect'](_0x514d6b,{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x4436d0){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x31b7('0x73'),util[_0x31b7('0x2a')](_0x4436d0,{'showHidden':![],'depth':null}));});}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x73'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x3ea646();});}else{_0x3ea646();}}},'charset':_0x31b7('0x74'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d231bba..6decdcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2558=['error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','SmsMessage','create','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','stringify'];(function(_0x3aafbe,_0x2447df){var _0x2b4b3c=function(_0x2278a0){while(--_0x2278a0){_0x3aafbe['push'](_0x3aafbe['shift']());}};_0x2b4b3c(++_0x2447df);}(_0x2558,0xb5));var _0x8255=function(_0x3a02c6,_0x595ec6){_0x3a02c6=_0x3a02c6-0x0;var _0x3f7ded=_0x2558[_0x3a02c6];return _0x3f7ded;};'use strict';var _=require(_0x8255('0x0'));var util=require(_0x8255('0x1'));var moment=require(_0x8255('0x2'));var BPromise=require(_0x8255('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8255('0x4'));var db=require(_0x8255('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8255('0x6'))(_0x8255('0x7'));var config=require(_0x8255('0x8'));var jayson=require(_0x8255('0x9'));var client=jayson['client'][_0x8255('0xa')]({'port':0x232a});config['redis']=_[_0x8255('0xb')](config[_0x8255('0xc')],{'host':_0x8255('0xd'),'port':0x18eb});var socket=require(_0x8255('0xe'))(new Redis(config['redis']));require(_0x8255('0xf'))[_0x8255('0x10')](socket);function respondWithRpcPromise(_0x4c4653,_0x3efdcb,_0x23c394){return new BPromise(function(_0x3dae3f,_0x3b59e9){return client[_0x8255('0x11')](_0x4c4653,_0x23c394)[_0x8255('0x12')](function(_0x37ad47){logger[_0x8255('0x13')]('SmsMessage,\x20%s,\x20%s',_0x3efdcb,_0x8255('0x14'));logger[_0x8255('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3efdcb,'request\x20sent',JSON[_0x8255('0x16')](_0x37ad47));if(_0x37ad47[_0x8255('0x17')]){if(_0x37ad47[_0x8255('0x17')][_0x8255('0x18')]===0x1f4){logger[_0x8255('0x17')](_0x8255('0x19'),_0x3efdcb,_0x37ad47[_0x8255('0x17')][_0x8255('0x1a')]);return _0x3b59e9(_0x37ad47[_0x8255('0x17')][_0x8255('0x1a')]);}logger[_0x8255('0x17')](_0x8255('0x19'),_0x3efdcb,_0x37ad47[_0x8255('0x17')][_0x8255('0x1a')]);return _0x3dae3f(_0x37ad47['error'][_0x8255('0x1a')]);}else{logger['info'](_0x8255('0x19'),_0x3efdcb,_0x8255('0x14'));_0x3dae3f(_0x37ad47[_0x8255('0x1b')]['message']);}})[_0x8255('0x1c')](function(_0x20fc47){logger[_0x8255('0x17')](_0x8255('0x19'),_0x3efdcb,_0x20fc47);_0x3b59e9(_0x20fc47);});});}exports['CreateSmsMessage']=function(_0x44760b){var _0x12f13d=this;return new Promise(function(_0x54cb6f,_0x5515a4){return db[_0x8255('0x1d')][_0x8255('0x1e')](_0x44760b['body'],{'raw':_0x44760b['options']?_0x44760b[_0x8255('0x1f')][_0x8255('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x522972){logger[_0x8255('0x13')]('CreateSmsMessage',_0x44760b);logger[_0x8255('0x15')](_0x8255('0x21'),_0x44760b,JSON[_0x8255('0x16')](_0x522972));_0x54cb6f(_0x522972);})[_0x8255('0x1c')](function(_0x49b035){logger[_0x8255('0x17')](_0x8255('0x21'),_0x49b035['message'],_0x44760b);_0x5515a4(_0x12f13d['error'](0x1f4,_0x49b035['message']));});});};
\ No newline at end of file
+var _0xf68b=['request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register'];(function(_0x42b677,_0x5ddbd2){var _0x250fa4=function(_0x5dec89){while(--_0x5dec89){_0x42b677['push'](_0x42b677['shift']());}};_0x250fa4(++_0x5ddbd2);}(_0xf68b,0xeb));var _0xbf68=function(_0x33b9db,_0x2e0887){_0x33b9db=_0x33b9db-0x0;var _0x12490e=_0xf68b[_0x33b9db];return _0x12490e;};'use strict';var _=require(_0xbf68('0x0'));var util=require(_0xbf68('0x1'));var moment=require(_0xbf68('0x2'));var BPromise=require(_0xbf68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf68('0x4'));var db=require(_0xbf68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf68('0x6'))(_0xbf68('0x7'));var config=require(_0xbf68('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf68('0x9')][_0xbf68('0xa')]({'port':0x232a});config[_0xbf68('0xb')]=_[_0xbf68('0xc')](config['redis'],{'host':_0xbf68('0xd'),'port':0x18eb});var socket=require(_0xbf68('0xe'))(new Redis(config[_0xbf68('0xb')]));require(_0xbf68('0xf'))[_0xbf68('0x10')](socket);function respondWithRpcPromise(_0x7842a7,_0xba8e98,_0x1d0a34){return new BPromise(function(_0x57c272,_0xf7f7db){return client[_0xbf68('0x11')](_0x7842a7,_0x1d0a34)[_0xbf68('0x12')](function(_0x316eae){logger[_0xbf68('0x13')](_0xbf68('0x14'),_0xba8e98,_0xbf68('0x15'));logger['debug'](_0xbf68('0x16'),_0xba8e98,_0xbf68('0x15'),JSON[_0xbf68('0x17')](_0x316eae));if(_0x316eae[_0xbf68('0x18')]){if(_0x316eae[_0xbf68('0x18')][_0xbf68('0x19')]===0x1f4){logger[_0xbf68('0x18')](_0xbf68('0x14'),_0xba8e98,_0x316eae[_0xbf68('0x18')][_0xbf68('0x1a')]);return _0xf7f7db(_0x316eae[_0xbf68('0x18')][_0xbf68('0x1a')]);}logger['error'](_0xbf68('0x14'),_0xba8e98,_0x316eae[_0xbf68('0x18')][_0xbf68('0x1a')]);return _0x57c272(_0x316eae[_0xbf68('0x18')][_0xbf68('0x1a')]);}else{logger[_0xbf68('0x13')](_0xbf68('0x14'),_0xba8e98,_0xbf68('0x15'));_0x57c272(_0x316eae[_0xbf68('0x1b')][_0xbf68('0x1a')]);}})[_0xbf68('0x1c')](function(_0x516857){logger[_0xbf68('0x18')]('SmsMessage,\x20%s,\x20%s',_0xba8e98,_0x516857);_0xf7f7db(_0x516857);});});}exports[_0xbf68('0x1d')]=function(_0x1e9551){var _0x376079=this;return new Promise(function(_0x297768,_0x167389){return db[_0xbf68('0x1e')][_0xbf68('0x1f')](_0x1e9551[_0xbf68('0x20')],{'raw':_0x1e9551[_0xbf68('0x21')]?_0x1e9551[_0xbf68('0x21')][_0xbf68('0x22')]===undefined?!![]:![]:!![]})[_0xbf68('0x12')](function(_0xdf2094){logger['info']('CreateSmsMessage',_0x1e9551);logger[_0xbf68('0x23')](_0xbf68('0x1d'),_0x1e9551,JSON['stringify'](_0xdf2094));_0x297768(_0xdf2094);})[_0xbf68('0x1c')](function(_0x2f095c){logger[_0xbf68('0x18')]('CreateSmsMessage',_0x2f095c[_0xbf68('0x1a')],_0x1e9551);_0x167389(_0x376079['error'](0x1f4,_0x2f095c[_0xbf68('0x1a')]));});});};
\ No newline at end of file
index 423985c..fc20d8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eb9=['removeListener','register','length','smsMessage:','./smsMessage.events','remove','update'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x6eb9,0xe4));var _0x96eb=function(_0x11a485,_0x44430f){_0x11a485=_0x11a485-0x0;var _0x19308b=_0x6eb9[_0x11a485];return _0x19308b;};'use strict';var SmsMessageEvents=require(_0x96eb('0x0'));var events=['save',_0x96eb('0x1'),_0x96eb('0x2')];function createListener(_0x4f4163,_0xd526c2){return function(_0x4b75c1){_0xd526c2['emit'](_0x4f4163,_0x4b75c1);};}function removeListener(_0x268b9e,_0x3d819f){return function(){SmsMessageEvents[_0x96eb('0x3')](_0x268b9e,_0x3d819f);};}exports[_0x96eb('0x4')]=function(_0x3f7220){for(var _0x526a32=0x0,_0x52b951=events[_0x96eb('0x5')];_0x526a32<_0x52b951;_0x526a32++){var _0x178b15=events[_0x526a32];var _0x155dfe=createListener(_0x96eb('0x6')+_0x178b15,_0x3f7220);SmsMessageEvents['on'](_0x178b15,_0x155dfe);}};
\ No newline at end of file
+var _0xda64=['register','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x27dc6f,_0x5dbea8){var _0x461137=function(_0x406252){while(--_0x406252){_0x27dc6f['push'](_0x27dc6f['shift']());}};_0x461137(++_0x5dbea8);}(_0xda64,0x152));var _0x4da6=function(_0x3050ce,_0x5edb0b){_0x3050ce=_0x3050ce-0x0;var _0x40e80b=_0xda64[_0x3050ce];return _0x40e80b;};'use strict';var SmsMessageEvents=require(_0x4da6('0x0'));var events=[_0x4da6('0x1'),_0x4da6('0x2'),_0x4da6('0x3')];function createListener(_0x5441cb,_0x42aaf2){return function(_0x311124){_0x42aaf2['emit'](_0x5441cb,_0x311124);};}function removeListener(_0x47f3f3,_0xcac840){return function(){SmsMessageEvents['removeListener'](_0x47f3f3,_0xcac840);};}exports[_0x4da6('0x4')]=function(_0x5e54c8){for(var _0x545fb5=0x0,_0x4398e0=events['length'];_0x545fb5<_0x4398e0;_0x545fb5++){var _0x5af661=events[_0x545fb5];var _0x605d9c=createListener(_0x4da6('0x5')+_0x5af661,_0x5e54c8);SmsMessageEvents['on'](_0x5af661,_0x605d9c);}};
\ No newline at end of file
index 2e789ec..0117d13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x113d=['delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x113d,0xed));var _0xd113=function(_0x19666b,_0x359495){_0x19666b=_0x19666b-0x0;var _0x45068f=_0x113d[_0x19666b];return _0x45068f;};'use strict';var multer=require(_0xd113('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd113('0x1'));var express=require('express');var router=express[_0xd113('0x2')]();var fs_extra=require(_0xd113('0x3'));var auth=require(_0xd113('0x4'));var interaction=require(_0xd113('0x5'));var config=require(_0xd113('0x6'));var controller=require(_0xd113('0x7'));router[_0xd113('0x8')]('/',auth[_0xd113('0x9')](),controller[_0xd113('0xa')]);router['get'](_0xd113('0xb'),auth['isAuthenticated'](),controller[_0xd113('0xc')]);router[_0xd113('0x8')](_0xd113('0xd'),auth[_0xd113('0x9')](),controller['show']);router[_0xd113('0x8')](_0xd113('0xe'),auth[_0xd113('0x9')](),controller['getMembers']);router[_0xd113('0x8')]('/:id/teams',auth[_0xd113('0x9')](),controller[_0xd113('0xf')]);router['get'](_0xd113('0x10'),auth['isAuthenticated'](),controller[_0xd113('0x11')]);router[_0xd113('0x12')]('/',auth['isAuthenticated'](),controller[_0xd113('0x13')]);router[_0xd113('0x12')](_0xd113('0x14'),auth[_0xd113('0x9')](),controller['addTeams']);router[_0xd113('0x12')](_0xd113('0x10'),auth[_0xd113('0x9')](),controller[_0xd113('0x15')]);router[_0xd113('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xd113('0x17')]);router[_0xd113('0x18')](_0xd113('0xd'),auth['isAuthenticated'](),controller[_0xd113('0x19')]);router['delete'](_0xd113('0x14'),auth[_0xd113('0x9')](),controller[_0xd113('0x1a')]);router[_0xd113('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xd113('0x1b')]);module[_0xd113('0x1c')]=router;
\ No newline at end of file
+var _0x7192=['../../components/auth/service','../../components/interaction/service','./smsQueue.controller','index','get','/describe','/:id','isAuthenticated','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x2c0c2e,_0x685550){var _0x409ebe=function(_0x176e80){while(--_0x176e80){_0x2c0c2e['push'](_0x2c0c2e['shift']());}};_0x409ebe(++_0x685550);}(_0x7192,0x123));var _0x2719=function(_0x2b2aae,_0x7f097e){_0x2b2aae=_0x2b2aae-0x0;var _0x1bd623=_0x7192[_0x2b2aae];return _0x1bd623;};'use strict';var multer=require(_0x2719('0x0'));var util=require(_0x2719('0x1'));var path=require(_0x2719('0x2'));var timeout=require(_0x2719('0x3'));var express=require('express');var router=express[_0x2719('0x4')]();var fs_extra=require(_0x2719('0x5'));var auth=require(_0x2719('0x6'));var interaction=require(_0x2719('0x7'));var config=require('../../config/environment');var controller=require(_0x2719('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2719('0x9')]);router[_0x2719('0xa')](_0x2719('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2719('0xc'),auth[_0x2719('0xd')](),controller['show']);router[_0x2719('0xa')]('/:id/members',auth[_0x2719('0xd')](),controller[_0x2719('0xe')]);router['get'](_0x2719('0xf'),auth[_0x2719('0xd')](),controller[_0x2719('0x10')]);router[_0x2719('0xa')](_0x2719('0x11'),auth[_0x2719('0xd')](),controller['getAgents']);router[_0x2719('0x12')]('/',auth[_0x2719('0xd')](),controller[_0x2719('0x13')]);router[_0x2719('0x12')](_0x2719('0xf'),auth[_0x2719('0xd')](),controller[_0x2719('0x14')]);router[_0x2719('0x12')](_0x2719('0x11'),auth[_0x2719('0xd')](),controller['addAgents']);router[_0x2719('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x2719('0x16')]);router[_0x2719('0x17')]('/:id',auth[_0x2719('0xd')](),controller[_0x2719('0x18')]);router[_0x2719('0x17')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x2719('0x11'),auth[_0x2719('0xd')](),controller[_0x2719('0x19')]);module[_0x2719('0x1a')]=router;
\ No newline at end of file
index 9812b67..92e4b3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x268c=['roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x23b80d,_0x4c7d3a){var _0x461b37=function(_0x46a978){while(--_0x46a978){_0x23b80d['push'](_0x23b80d['shift']());}};_0x461b37(++_0x4c7d3a);}(_0x268c,0x1d6));var _0xc268=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0x268c[_0x2d8434];return _0x26b9e4;};'use strict';var Sequelize=require(_0xc268('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc268('0x1')]},'timeout':{'type':Sequelize[_0xc268('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc268('0x3')](_0xc268('0x4'),_0xc268('0x5'),_0xc268('0x6'))}};
\ No newline at end of file
+var _0x9e6b=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x5ee58d,_0x1c8168){var _0xfc536d=function(_0x208f88){while(--_0x208f88){_0x5ee58d['push'](_0x5ee58d['shift']());}};_0xfc536d(++_0x1c8168);}(_0x9e6b,0xd4));var _0xb9e6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9e6b[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xb9e6('0x0'));module[_0xb9e6('0x1')]={'name':{'type':Sequelize[_0xb9e6('0x2')],'unique':_0xb9e6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb9e6('0x2')]},'timeout':{'type':Sequelize[_0xb9e6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9e6('0x5')](_0xb9e6('0x6'),_0xb9e6('0x7'),'roundrobin')}};
\ No newline at end of file
index 2c42d14..24a30d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd01d=['smsPause','createdAt','format','%s/%s','Team','getTeams','addTeams','ids','findAll','User','online','voicePause','interface','Agents','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','end','sendStatus','error','stack','name','send','index','SmsQueue','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','order','SmsQueueId','findAndCountAll','UserId','agent'];(function(_0x53ebf0,_0x30701f){var _0x226074=function(_0xe3b908){while(--_0xe3b908){_0x53ebf0['push'](_0x53ebf0['shift']());}};_0x226074(++_0x30701f);}(_0xd01d,0xbe));var _0xdd01=function(_0x339266,_0x26c1e6){_0x339266=_0x339266-0x0;var _0x25469a=_0xd01d[_0x339266];return _0x25469a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd01('0x1'));var rp=require(_0xdd01('0x2'));var moment=require(_0xdd01('0x3'));var BPromise=require(_0xdd01('0x4'));var Mustache=require(_0xdd01('0x5'));var util=require(_0xdd01('0x6'));var path=require(_0xdd01('0x7'));var sox=require(_0xdd01('0x8'));var csv=require(_0xdd01('0x9'));var ejs=require(_0xdd01('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd01('0xb'));var crypto=require(_0xdd01('0xc'));var jsforce=require(_0xdd01('0xd'));var deskjs=require(_0xdd01('0xe'));var toCsv=require(_0xdd01('0x9'));var querystring=require('querystring');var Papa=require(_0xdd01('0xf'));var Redis=require(_0xdd01('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdd01('0x11'));var hardwareService=require(_0xdd01('0x12'));var logger=require(_0xdd01('0x13'))(_0xdd01('0x14'));var utils=require(_0xdd01('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdd01('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdd01('0x17')](config[_0xdd01('0x18')],{'host':_0xdd01('0x19'),'port':0x18eb});var socket=require(_0xdd01('0x1a'))(new Redis(config[_0xdd01('0x18')]));require('./smsQueue.socket')[_0xdd01('0x1b')](socket);function respondWithStatusCode(_0x592613,_0x344226){_0x344226=_0x344226||0xcc;return function(_0x4d2350){if(_0x4d2350){return _0x592613['sendStatus'](_0x344226);}return _0x592613[_0xdd01('0x1c')](_0x344226)['end']();};}function respondWithResult(_0xcc7985,_0x449241){_0x449241=_0x449241||0xc8;return function(_0x90c77d){if(_0x90c77d){return _0xcc7985['status'](_0x449241)[_0xdd01('0x1d')](_0x90c77d);}};}function respondWithFilteredResult(_0x99b519,_0x3b51d4){return function(_0x5d2760){if(_0x5d2760){var _0x36a2c5=typeof _0x3b51d4[_0xdd01('0x1e')]===_0xdd01('0x1f')&&typeof _0x3b51d4[_0xdd01('0x20')]===_0xdd01('0x1f');var _0xf9f29=_0x5d2760[_0xdd01('0x21')];var _0x351331=_0x36a2c5?0x0:_0x3b51d4[_0xdd01('0x1e')];var _0x4bf924=_0x36a2c5?_0x5d2760[_0xdd01('0x21')]:_0x3b51d4['offset']+_0x3b51d4[_0xdd01('0x20')];var _0xa4ef26;if(_0x4bf924>=_0xf9f29){_0x4bf924=_0xf9f29;_0xa4ef26=0xc8;}else{_0xa4ef26=0xce;}_0x99b519[_0xdd01('0x1c')](_0xa4ef26);return _0x99b519[_0xdd01('0x22')](_0xdd01('0x23'),_0x351331+'-'+_0x4bf924+'/'+_0xf9f29)[_0xdd01('0x1d')](_0x5d2760);}return null;};}function patchUpdates(_0x17a6d9){return function(_0x3c0d4f){try{jsonpatch['apply'](_0x3c0d4f,_0x17a6d9,!![]);}catch(_0x1d0d38){return BPromise[_0xdd01('0x24')](_0x1d0d38);}return _0x3c0d4f[_0xdd01('0x25')]();};}function saveUpdates(_0x59611c,_0x4093c2){return function(_0x3ed1c1){if(_0x3ed1c1){return _0x3ed1c1[_0xdd01('0x26')](_0x59611c)[_0xdd01('0x27')](function(_0x317f0f){return _0x317f0f;});}return null;};}function removeEntity(_0x3dc014,_0xda81fa){return function(_0x587eb2){if(_0x587eb2){return _0x587eb2[_0xdd01('0x28')]()['then'](function(){var _0x431c67=_0x587eb2[_0xdd01('0x29')]({'plain':!![]});var _0x470514=_0xdd01('0x2a');return db[_0xdd01('0x2b')]['destroy']({'where':{'type':_0x470514,'resourceId':_0x431c67['id']}})[_0xdd01('0x27')](function(){return _0x587eb2;});})['then'](function(){_0x3dc014[_0xdd01('0x1c')](0xcc)[_0xdd01('0x2c')]();});}};}function handleEntityNotFound(_0x19d92b,_0x17181f){return function(_0x13d1c2){if(!_0x13d1c2){_0x19d92b[_0xdd01('0x2d')](0x194);}return _0x13d1c2;};}function handleError(_0x37949d,_0x6ff499){_0x6ff499=_0x6ff499||0x1f4;return function(_0x340aea){logger[_0xdd01('0x2e')](_0x340aea[_0xdd01('0x2f')]);if(_0x340aea[_0xdd01('0x30')]){delete _0x340aea[_0xdd01('0x30')];}_0x37949d['status'](_0x6ff499)[_0xdd01('0x31')](_0x340aea);};}exports[_0xdd01('0x32')]=function(_0x3c1286,_0x2cf391){var _0x25d56d={},_0x1288bd={},_0x160918={'count':0x0,'rows':[]};var _0x3e5452=_['map'](db[_0xdd01('0x33')][_0xdd01('0x34')],function(_0xf69c33){return{'name':_0xf69c33[_0xdd01('0x35')],'type':_0xf69c33['type'][_0xdd01('0x36')]};});_0x1288bd[_0xdd01('0x37')]=_[_0xdd01('0x38')](_0x3e5452,_0xdd01('0x30'));_0x1288bd[_0xdd01('0x39')]=_[_0xdd01('0x3a')](_0x3c1286[_0xdd01('0x39')]);_0x1288bd['filters']=_[_0xdd01('0x3b')](_0x1288bd[_0xdd01('0x37')],_0x1288bd['query']);_0x25d56d[_0xdd01('0x3c')]=_[_0xdd01('0x3b')](_0x1288bd[_0xdd01('0x37')],qs[_0xdd01('0x3d')](_0x3c1286[_0xdd01('0x39')][_0xdd01('0x3d')]));_0x25d56d[_0xdd01('0x3c')]=_0x25d56d['attributes'][_0xdd01('0x3e')]?_0x25d56d[_0xdd01('0x3c')]:_0x1288bd[_0xdd01('0x37')];if(!_0x3c1286[_0xdd01('0x39')][_0xdd01('0x3f')](_0xdd01('0x40'))){_0x25d56d['limit']=qs['limit'](_0x3c1286[_0xdd01('0x39')][_0xdd01('0x20')]);_0x25d56d[_0xdd01('0x1e')]=qs['offset'](_0x3c1286[_0xdd01('0x39')]['offset']);}_0x25d56d['order']=qs[_0xdd01('0x41')](_0x3c1286[_0xdd01('0x39')][_0xdd01('0x41')]);_0x25d56d[_0xdd01('0x42')]=qs[_0xdd01('0x43')](_[_0xdd01('0x44')](_0x3c1286['query'],_0x1288bd[_0xdd01('0x43')]),_0x3e5452);if(_0x3c1286['query']['filter']){_0x25d56d['where']=_[_0xdd01('0x45')](_0x25d56d[_0xdd01('0x42')],{'$or':_[_0xdd01('0x38')](_0x3e5452,function(_0x217aef){if(_0x217aef[_0xdd01('0x46')]!==_0xdd01('0x47')){var _0x25d46d={};_0x25d46d[_0x217aef['name']]={'$like':'%'+_0x3c1286[_0xdd01('0x39')][_0xdd01('0x48')]+'%'};return _0x25d46d;}})});}_0x25d56d=_[_0xdd01('0x45')]({},_0x25d56d,_0x3c1286[_0xdd01('0x49')]);var _0x3e6485={'where':_0x25d56d[_0xdd01('0x42')]};return db[_0xdd01('0x33')][_0xdd01('0x21')](_0x3e6485)[_0xdd01('0x27')](function(_0x4a35cc){_0x160918[_0xdd01('0x21')]=_0x4a35cc;if(_0x3c1286[_0xdd01('0x39')][_0xdd01('0x4a')]){_0x25d56d[_0xdd01('0x4b')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x25d56d);})[_0xdd01('0x27')](function(_0xba7d1){_0x160918[_0xdd01('0x4c')]=_0xba7d1;return _0x160918;})[_0xdd01('0x27')](respondWithFilteredResult(_0x2cf391,_0x25d56d))[_0xdd01('0x4d')](handleError(_0x2cf391,null));};exports[_0xdd01('0x4e')]=function(_0x5e770f,_0x4a3015){var _0x493de3={'raw':!![],'where':{'id':_0x5e770f[_0xdd01('0x4f')]['id']}},_0x54bcae={};_0x54bcae[_0xdd01('0x37')]=_[_0xdd01('0x3a')](db[_0xdd01('0x33')][_0xdd01('0x34')]);_0x54bcae[_0xdd01('0x39')]=_[_0xdd01('0x3a')](_0x5e770f[_0xdd01('0x39')]);_0x54bcae[_0xdd01('0x43')]=_[_0xdd01('0x3b')](_0x54bcae[_0xdd01('0x37')],_0x54bcae['query']);_0x493de3['attributes']=_['intersection'](_0x54bcae[_0xdd01('0x37')],qs[_0xdd01('0x3d')](_0x5e770f['query'][_0xdd01('0x3d')]));_0x493de3[_0xdd01('0x3c')]=_0x493de3[_0xdd01('0x3c')]['length']?_0x493de3[_0xdd01('0x3c')]:_0x54bcae[_0xdd01('0x37')];if(_0x5e770f['query'][_0xdd01('0x4a')]){_0x493de3[_0xdd01('0x4b')]=[{'all':!![]}];}_0x493de3=_[_0xdd01('0x45')]({},_0x493de3,_0x5e770f[_0xdd01('0x49')]);return db[_0xdd01('0x33')]['find'](_0x493de3)[_0xdd01('0x27')](handleEntityNotFound(_0x4a3015,null))[_0xdd01('0x27')](respondWithResult(_0x4a3015,null))[_0xdd01('0x4d')](handleError(_0x4a3015,null));};exports[_0xdd01('0x50')]=function(_0x2e2bc5,_0x57aac1){return db[_0xdd01('0x33')][_0xdd01('0x50')](_0x2e2bc5[_0xdd01('0x51')],{})[_0xdd01('0x27')](function(_0x4dbcc5){var _0x46c91c=_0x2e2bc5[_0xdd01('0x52')]['get']({'plain':!![]});if(!_0x46c91c)throw new Error(_0xdd01('0x53'));if(_0x46c91c['role']==='user'){var _0x7b5b42=_0x4dbcc5[_0xdd01('0x29')]({'plain':!![]});var _0x24915f=_0xdd01('0x2a');return db[_0xdd01('0x54')][_0xdd01('0x55')]({'where':{'name':_0x24915f,'userProfileId':_0x46c91c[_0xdd01('0x56')]},'raw':!![]})[_0xdd01('0x27')](function(_0x18f4b0){if(_0x18f4b0&&_0x18f4b0[_0xdd01('0x57')]===0x0){return db[_0xdd01('0x2b')]['create']({'name':_0x7b5b42[_0xdd01('0x30')],'resourceId':_0x7b5b42['id'],'type':_0x18f4b0[_0xdd01('0x30')],'sectionId':_0x18f4b0['id']},{})[_0xdd01('0x27')](function(){return _0x4dbcc5;});}else{return _0x4dbcc5;}})[_0xdd01('0x4d')](function(_0x47913e){logger['error'](_0xdd01('0x58'),_0x47913e);throw _0x47913e;});}return _0x4dbcc5;})[_0xdd01('0x27')](respondWithResult(_0x57aac1,0xc9))[_0xdd01('0x4d')](handleError(_0x57aac1,null));};exports[_0xdd01('0x26')]=function(_0x3f9cd5,_0xa43c20){if(_0x3f9cd5[_0xdd01('0x51')]['id']){delete _0x3f9cd5['body']['id'];}return db[_0xdd01('0x33')][_0xdd01('0x55')]({'where':{'id':_0x3f9cd5['params']['id']}})[_0xdd01('0x27')](handleEntityNotFound(_0xa43c20,null))[_0xdd01('0x27')](saveUpdates(_0x3f9cd5[_0xdd01('0x51')],null))['then'](respondWithResult(_0xa43c20,null))[_0xdd01('0x4d')](handleError(_0xa43c20,null));};exports[_0xdd01('0x28')]=function(_0x457473,_0x4fc164){return db[_0xdd01('0x33')]['find']({'where':{'id':_0x457473[_0xdd01('0x4f')]['id']}})[_0xdd01('0x27')](handleEntityNotFound(_0x4fc164,null))['then'](removeEntity(_0x4fc164,null))[_0xdd01('0x4d')](handleError(_0x4fc164,null));};exports[_0xdd01('0x59')]=function(_0x4c3e8d,_0x3ac9fb){return db[_0xdd01('0x33')][_0xdd01('0x59')]()[_0xdd01('0x27')](respondWithResult(_0x3ac9fb,null))[_0xdd01('0x4d')](handleError(_0x3ac9fb,null));};exports[_0xdd01('0x5a')]=function(_0x29d478,_0x452f59,_0xdc4bac){var _0x284dd4={'raw':!![],'where':{}},_0x394d45={},_0x122d51;return db['SmsQueue'][_0xdd01('0x5b')]({'where':{'id':_0x29d478[_0xdd01('0x4f')]['id']}})['then'](handleEntityNotFound(_0x452f59,null))[_0xdd01('0x27')](function(_0x2a9417){if(_0x2a9417){_0x122d51=_0x2a9417[_0xdd01('0x29')]({'plain':!![]});_0x394d45[_0xdd01('0x37')]=_['keys'](db[_0xdd01('0x5c')][_0xdd01('0x34')]);_0x394d45[_0xdd01('0x39')]=_[_0xdd01('0x3a')](_0x29d478['query']);_0x394d45['filters']=_[_0xdd01('0x3b')](_0x394d45[_0xdd01('0x37')],_0x394d45['query']);_0x284dd4[_0xdd01('0x3c')]=_[_0xdd01('0x3b')](_0x394d45[_0xdd01('0x37')],qs[_0xdd01('0x3d')](_0x29d478[_0xdd01('0x39')][_0xdd01('0x3d')]));_0x284dd4[_0xdd01('0x3c')]=_0x284dd4[_0xdd01('0x3c')][_0xdd01('0x3e')]?_0x284dd4[_0xdd01('0x3c')]:_0x394d45[_0xdd01('0x37')];if(!_0x29d478[_0xdd01('0x39')][_0xdd01('0x3f')](_0xdd01('0x40'))){_0x284dd4['limit']=qs[_0xdd01('0x20')](_0x29d478[_0xdd01('0x39')][_0xdd01('0x20')]);_0x284dd4[_0xdd01('0x1e')]=qs['offset'](_0x29d478[_0xdd01('0x39')][_0xdd01('0x1e')]);}_0x284dd4[_0xdd01('0x5d')]=qs['sort'](_0x29d478[_0xdd01('0x39')][_0xdd01('0x41')]);_0x284dd4[_0xdd01('0x42')]=qs[_0xdd01('0x43')](_[_0xdd01('0x44')](_0x29d478[_0xdd01('0x39')],_0x394d45['filters']));_0x284dd4[_0xdd01('0x42')][_0xdd01('0x5e')]=_0x2a9417['id'];if(_0x29d478['query'][_0xdd01('0x48')]){_0x284dd4[_0xdd01('0x42')]=_[_0xdd01('0x45')](_0x284dd4[_0xdd01('0x42')],{'$or':_['map'](_0x284dd4[_0xdd01('0x3c')],function(_0x17f3cb){var _0x4aac30={};_0x4aac30[_0x17f3cb]={'$like':'%'+_0x29d478[_0xdd01('0x39')][_0xdd01('0x48')]+'%'};return _0x4aac30;})});}_0x284dd4=_[_0xdd01('0x45')]({},_0x284dd4,_0x29d478[_0xdd01('0x49')]);return db['UserSmsQueue']['findAll'](_0x284dd4);}})[_0xdd01('0x27')](function(_0x26872b){if(_0x26872b){return db['User'][_0xdd01('0x5f')]({'where':{'id':_[_0xdd01('0x38')](_0x26872b,_0xdd01('0x60')),'role':_0xdd01('0x61')},'attributes':['id',_0xdd01('0x30'),_0xdd01('0x62'),'updatedAt',_0xdd01('0x63')]});}})[_0xdd01('0x27')](function(_0x27d660){if(_0x27d660){return{'count':_0x27d660['count'],'rows':_[_0xdd01('0x38')](_0x27d660[_0xdd01('0x4c')],function(_0x3c6f28){return{'membername':_0x3c6f28[_0xdd01('0x30')],'UserId':_0x3c6f28['id'],'queue_name':_0x122d51[_0xdd01('0x30')],'SmsQueueId':_0x122d51['id'],'interface':util[_0xdd01('0x64')](_0xdd01('0x65'),'SIP',_0x3c6f28['name']),'penalty':0x0,'paused':_0x3c6f28[_0xdd01('0x62')],'createdAt':_0x3c6f28['createdAt'],'updatedAt':_0x3c6f28['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdd01('0x27')](respondWithFilteredResult(_0x452f59,_0x284dd4))[_0xdd01('0x4d')](handleError(_0x452f59,null));};exports['getTeams']=function(_0x3bcd13,_0x1bb707,_0x2d1df1){var _0x3f33e6={};var _0x4958a4={};var _0x92b2de;var _0x10aa16;return db[_0xdd01('0x33')][_0xdd01('0x5b')]({'where':{'id':_0x3bcd13[_0xdd01('0x4f')]['id']}})[_0xdd01('0x27')](handleEntityNotFound(_0x1bb707,null))[_0xdd01('0x27')](function(_0x541d54){if(_0x541d54){_0x92b2de=_0x541d54;_0x4958a4['model']=_[_0xdd01('0x3a')](db[_0xdd01('0x66')][_0xdd01('0x34')]);_0x4958a4[_0xdd01('0x39')]=_[_0xdd01('0x3a')](_0x3bcd13[_0xdd01('0x39')]);_0x4958a4['filters']=_[_0xdd01('0x3b')](_0x4958a4[_0xdd01('0x37')],_0x4958a4[_0xdd01('0x39')]);_0x3f33e6[_0xdd01('0x3c')]=_[_0xdd01('0x3b')](_0x4958a4['model'],qs[_0xdd01('0x3d')](_0x3bcd13['query']['fields']));_0x3f33e6[_0xdd01('0x3c')]=_0x3f33e6['attributes'][_0xdd01('0x3e')]?_0x3f33e6[_0xdd01('0x3c')]:_0x4958a4[_0xdd01('0x37')];_0x3f33e6[_0xdd01('0x5d')]=qs['sort'](_0x3bcd13[_0xdd01('0x39')][_0xdd01('0x41')]);_0x3f33e6[_0xdd01('0x42')]=qs[_0xdd01('0x43')](_[_0xdd01('0x44')](_0x3bcd13[_0xdd01('0x39')],_0x4958a4[_0xdd01('0x43')]));if(_0x3bcd13['query'][_0xdd01('0x48')]){_0x3f33e6['where']=_[_0xdd01('0x45')](_0x3f33e6[_0xdd01('0x42')],{'$or':_[_0xdd01('0x38')](_0x3f33e6[_0xdd01('0x3c')],function(_0x4de6b4){var _0x4882e3={};_0x4882e3[_0x4de6b4]={'$like':'%'+_0x3bcd13['query']['filter']+'%'};return _0x4882e3;})});}_0x3f33e6=_[_0xdd01('0x45')]({},_0x3f33e6,_0x3bcd13[_0xdd01('0x49')]);return _0x92b2de[_0xdd01('0x67')](_0x3f33e6);}})['then'](function(_0x14c4dc){if(_0x14c4dc){_0x10aa16=_0x14c4dc[_0xdd01('0x3e')];if(!_0x3bcd13[_0xdd01('0x39')][_0xdd01('0x3f')](_0xdd01('0x40'))){_0x3f33e6['limit']=qs[_0xdd01('0x20')](_0x3bcd13[_0xdd01('0x39')][_0xdd01('0x20')]);_0x3f33e6[_0xdd01('0x1e')]=qs[_0xdd01('0x1e')](_0x3bcd13['query'][_0xdd01('0x1e')]);}return _0x92b2de[_0xdd01('0x67')](_0x3f33e6);}})['then'](function(_0x3ac567){if(_0x3ac567){return _0x3ac567?{'count':_0x10aa16,'rows':_0x3ac567}:null;}})[_0xdd01('0x27')](respondWithResult(_0x1bb707,null))[_0xdd01('0x4d')](handleError(_0x1bb707,null));};exports[_0xdd01('0x68')]=function(_0x2f3222,_0x36b242,_0x29fb5f){var _0x5c8767=_0x2f3222[_0xdd01('0x51')][_0xdd01('0x69')];return db['Team'][_0xdd01('0x6a')]({'where':{'id':_0x5c8767},'attributes':['id'],'include':[{'model':db[_0xdd01('0x6b')],'as':'Agents','attributes':['id',_0xdd01('0x30'),_0xdd01('0x6c'),_0xdd01('0x6d'),_0xdd01('0x6e')],'raw':!![]}]})[_0xdd01('0x27')](function(_0x39d16b){if(_0x39d16b){var _0x3de992=_['flatMap'](_0x39d16b,function(_0x408064){var _0x3fddd1=_0x408064[_0xdd01('0x29')]({'plain':!![]});return _0x3fddd1[_0xdd01('0x6f')];});return db[_0xdd01('0x33')]['find']({'where':{'id':_0x2f3222[_0xdd01('0x4f')]['id']}})[_0xdd01('0x27')](function(_0x1c990a){return db['sequelize'][_0xdd01('0x70')](function(_0x46b264){return _0x1c990a[_0xdd01('0x68')](_0x5c8767,{'transaction':_0x46b264})[_0xdd01('0x27')](function(){return BPromise[_0xdd01('0x71')](_0x3de992,function(_0x2b9680){return db[_0xdd01('0x5c')][_0xdd01('0x72')]({'where':{'UserId':_0x2b9680['id'],'SmsQueueId':_0x2f3222[_0xdd01('0x4f')]['id']},'transaction':_0x46b264});});})[_0xdd01('0x27')](function(){_0x3de992[_0xdd01('0x73')](function(_0x572d7a){socket[_0xdd01('0x74')](_0xdd01('0x75'),{'UserId':_0x572d7a['id'],'SmsQueueId':_0x1c990a['id']});});});});});}})[_0xdd01('0x27')](respondWithStatusCode(_0x36b242,null))[_0xdd01('0x4d')](handleError(_0x36b242,null));};exports[_0xdd01('0x76')]=function(_0x2364e3,_0x3f7f2a,_0x26746e){return db[_0xdd01('0x66')][_0xdd01('0x6a')]({'where':{'id':_0x2364e3[_0xdd01('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xdd01('0x6b')],'as':_0xdd01('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xdd01('0x27')](handleEntityNotFound(_0x3f7f2a,null))[_0xdd01('0x27')](function(_0x5d9e15){var _0x2d17cc=_[_0xdd01('0x38')](_0x5d9e15,'id');var _0x49402d=[];var _0x21adaa=[];var _0x4e5412=squel['select']();_0x4e5412['field']('tq.TeamId')[_0xdd01('0x77')](_0xdd01('0x78'),'tq')['join'](_0xdd01('0x79'),'ut',_0xdd01('0x7a'))['where'](_0xdd01('0x7b'),_0x2364e3[_0xdd01('0x4f')]['id']);for(var _0x5ed020=0x0;_0x5ed020<_0x5d9e15['length'];_0x5ed020+=0x1){let _0x5de08a=_0x5d9e15[_0x5ed020];for(var _0x3a6877=0x0;_0x3a6877<_0x5de08a[_0xdd01('0x6f')][_0xdd01('0x3e')];_0x3a6877+=0x1){let _0xb489fc=_0x5de08a['Agents'][_0x3a6877];var _0x189545=_0x4e5412[_0xdd01('0x7c')]();_0x189545[_0xdd01('0x42')](_0xdd01('0x7d'),_0xb489fc['id']);_0x21adaa[_0xdd01('0x7e')](db['sequelize'][_0xdd01('0x39')](_0x189545['toString'](),{'type':db[_0xdd01('0x7f')][_0xdd01('0x80')][_0xdd01('0x81')]})[_0xdd01('0x27')](function(_0x14fb59){if(_0x14fb59[_0xdd01('0x3e')]===0x1){return _0xb489fc['id'];}else{var _0x2683bb=_[_0xdd01('0x82')](_['map'](_0x14fb59,'TeamId'),function(_0x45d8a7){return _[_0xdd01('0x83')](_0x2d17cc,_0x45d8a7);});if(_0x2683bb){return _0xb489fc['id'];}}}));}}return BPromise[_0xdd01('0x84')](_0x21adaa)[_0xdd01('0x27')](function(_0x551dde){_0x49402d=_(_0x49402d)[_0xdd01('0x85')](_0x551dde)[_0xdd01('0x86')]()[_0xdd01('0x87')]();return db[_0xdd01('0x33')][_0xdd01('0x55')]({'where':{'id':_0x2364e3['params']['id']}})[_0xdd01('0x27')](function(_0x8e49b0){return db[_0xdd01('0x7f')][_0xdd01('0x70')](function(_0x20350d){return _0x8e49b0[_0xdd01('0x76')](_0x2364e3['query']['ids'],{'transaction':_0x20350d})[_0xdd01('0x27')](function(){if(!_[_0xdd01('0x88')](_0x49402d)){return _0x8e49b0[_0xdd01('0x89')](_0x49402d,{'transaction':_0x20350d});}})[_0xdd01('0x27')](function(){_0x49402d[_0xdd01('0x73')](function(_0x1d6282){socket[_0xdd01('0x74')](_0xdd01('0x8a'),{'UserId':_0x1d6282,'SmsQueueId':_0x8e49b0['id']});});});});});});})[_0xdd01('0x27')](respondWithStatusCode(_0x3f7f2a,null))[_0xdd01('0x4d')](handleError(_0x3f7f2a,null));};exports[_0xdd01('0x8b')]=function(_0x3eda01,_0x45fdba,_0x268e5){return db[_0xdd01('0x33')][_0xdd01('0x55')]({'where':{'id':_0x3eda01[_0xdd01('0x4f')]['id']}})['then'](handleEntityNotFound(_0x45fdba,null))[_0xdd01('0x27')](function(_0x1f69f7){if(_0x1f69f7){return _0x1f69f7[_0xdd01('0x8b')](_0x3eda01[_0xdd01('0x51')][_0xdd01('0x69')],_[_0xdd01('0x8c')](_0x3eda01['body'],[_0xdd01('0x69'),'id'])||{})[_0xdd01('0x8d')](function(_0x3e7441){for(var _0x1a8957=0x0;_0x1a8957<_0x3eda01[_0xdd01('0x51')]['ids']['length'];_0x1a8957+=0x1){socket[_0xdd01('0x74')](_0xdd01('0x75'),{'UserId':Number(_0x3eda01['body'][_0xdd01('0x69')][_0x1a8957]),'SmsQueueId':Number(_0x3eda01[_0xdd01('0x4f')]['id'])});}return _0x3e7441;});}})['then'](respondWithResult(_0x45fdba,null))['catch'](handleError(_0x45fdba,null));};exports[_0xdd01('0x89')]=function(_0x3df2f8,_0x2f3ea2,_0xa11db){return db[_0xdd01('0x33')][_0xdd01('0x55')]({'where':{'id':_0x3df2f8[_0xdd01('0x4f')]['id']}})[_0xdd01('0x27')](handleEntityNotFound(_0x2f3ea2,null))[_0xdd01('0x27')](function(_0x1fd617){if(_0x1fd617){return _0x1fd617[_0xdd01('0x89')](_0x3df2f8['query'][_0xdd01('0x69')])[_0xdd01('0x27')](function(){if(_[_0xdd01('0x8e')](_0x3df2f8[_0xdd01('0x39')]['ids'])){for(var _0x55fb3a=0x0;_0x55fb3a<_0x3df2f8[_0xdd01('0x39')][_0xdd01('0x69')][_0xdd01('0x3e')];_0x55fb3a+=0x1){socket['emit'](_0xdd01('0x8a'),{'UserId':Number(_0x3df2f8[_0xdd01('0x39')]['ids'][_0x55fb3a]),'SmsQueueId':Number(_0x3df2f8[_0xdd01('0x4f')]['id'])});}}else{socket['emit'](_0xdd01('0x8a'),{'UserId':Number(_0x3df2f8[_0xdd01('0x39')]['ids']),'SmsQueueId':Number(_0x3df2f8['params']['id'])});}});}})[_0xdd01('0x27')](respondWithStatusCode(_0x2f3ea2,null))['catch'](handleError(_0x2f3ea2,null));};exports['getAgents']=function(_0xfb50,_0x13b218,_0xe3ce47){var _0x33d6b2={};var _0x5223f8={};var _0x12cd23;var _0x1d0df7;return db[_0xdd01('0x33')]['findOne']({'where':{'id':_0xfb50[_0xdd01('0x4f')]['id']}})[_0xdd01('0x27')](handleEntityNotFound(_0x13b218,null))['then'](function(_0x3ff0d6){if(_0x3ff0d6){_0x12cd23=_0x3ff0d6;_0x5223f8[_0xdd01('0x37')]=_[_0xdd01('0x3a')](db['User'][_0xdd01('0x34')]);_0x5223f8[_0xdd01('0x39')]=_[_0xdd01('0x3a')](_0xfb50[_0xdd01('0x39')]);_0x5223f8[_0xdd01('0x43')]=_['intersection'](_0x5223f8[_0xdd01('0x37')],_0x5223f8[_0xdd01('0x39')]);_0x33d6b2['attributes']=_[_0xdd01('0x3b')](_0x5223f8[_0xdd01('0x37')],qs[_0xdd01('0x3d')](_0xfb50[_0xdd01('0x39')][_0xdd01('0x3d')]));_0x33d6b2[_0xdd01('0x3c')]=_0x33d6b2['attributes'][_0xdd01('0x3e')]?_0x33d6b2[_0xdd01('0x3c')]:_0x5223f8[_0xdd01('0x37')];_0x33d6b2[_0xdd01('0x5d')]=qs[_0xdd01('0x41')](_0xfb50[_0xdd01('0x39')][_0xdd01('0x41')]);_0x33d6b2[_0xdd01('0x42')]=qs[_0xdd01('0x43')](_[_0xdd01('0x44')](_0xfb50[_0xdd01('0x39')],_0x5223f8[_0xdd01('0x43')]));if(_0xfb50[_0xdd01('0x39')]['filter']){_0x33d6b2['where']=_['merge'](_0x33d6b2['where'],{'$or':_[_0xdd01('0x38')](_0x33d6b2[_0xdd01('0x3c')],function(_0x4673e0){var _0x4fb19f={};_0x4fb19f[_0x4673e0]={'$like':'%'+_0xfb50[_0xdd01('0x39')][_0xdd01('0x48')]+'%'};return _0x4fb19f;})});}_0x33d6b2=_[_0xdd01('0x45')]({},_0x33d6b2,_0xfb50[_0xdd01('0x49')]);return _0x12cd23[_0xdd01('0x8f')](_0x33d6b2);}})[_0xdd01('0x27')](function(_0x2dbd78){if(_0x2dbd78){_0x1d0df7=_0x2dbd78[_0xdd01('0x3e')];if(!_0xfb50['query'][_0xdd01('0x3f')](_0xdd01('0x40'))){_0x33d6b2[_0xdd01('0x20')]=qs['limit'](_0xfb50[_0xdd01('0x39')][_0xdd01('0x20')]);_0x33d6b2[_0xdd01('0x1e')]=qs[_0xdd01('0x1e')](_0xfb50['query'][_0xdd01('0x1e')]);}return _0x12cd23[_0xdd01('0x8f')](_0x33d6b2);}})[_0xdd01('0x27')](function(_0x3c37f5){if(_0x3c37f5){return _0x3c37f5?{'count':_0x1d0df7,'rows':_0x3c37f5}:null;}})[_0xdd01('0x27')](respondWithResult(_0x13b218,null))[_0xdd01('0x4d')](handleError(_0x13b218,null));};
\ No newline at end of file
+var _0x39d3=['VIRTUAL','includeAll','include','findAll','catch','show','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','voicePause','interface','Agents','sequelize','addTeams','findOrCreate','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','union','value','transaction','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x2eec1f,_0x1b9987){var _0x543075=function(_0x5792d2){while(--_0x5792d2){_0x2eec1f['push'](_0x2eec1f['shift']());}};_0x543075(++_0x1b9987);}(_0x39d3,0x1e5));var _0x339d=function(_0x2086ce,_0x5bffce){_0x2086ce=_0x2086ce-0x0;var _0x30b904=_0x39d3[_0x2086ce];return _0x30b904;};'use strict';var emlformat=require(_0x339d('0x0'));var rimraf=require(_0x339d('0x1'));var zipdir=require(_0x339d('0x2'));var jsonpatch=require(_0x339d('0x3'));var rp=require(_0x339d('0x4'));var moment=require('moment');var BPromise=require(_0x339d('0x5'));var Mustache=require(_0x339d('0x6'));var util=require(_0x339d('0x7'));var path=require(_0x339d('0x8'));var sox=require(_0x339d('0x9'));var csv=require(_0x339d('0xa'));var ejs=require(_0x339d('0xb'));var fs=require('fs');var fs_extra=require(_0x339d('0xc'));var _=require(_0x339d('0xd'));var squel=require(_0x339d('0xe'));var crypto=require(_0x339d('0xf'));var jsforce=require(_0x339d('0x10'));var deskjs=require(_0x339d('0x11'));var toCsv=require(_0x339d('0xa'));var querystring=require(_0x339d('0x12'));var Papa=require(_0x339d('0x13'));var Redis=require('ioredis');var authService=require(_0x339d('0x14'));var qs=require(_0x339d('0x15'));var as=require(_0x339d('0x16'));var hardwareService=require(_0x339d('0x17'));var logger=require(_0x339d('0x18'))(_0x339d('0x19'));var utils=require(_0x339d('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x339d('0x1b')]=_[_0x339d('0x1c')](config[_0x339d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x339d('0x1d'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x339d('0x1e')](socket);function respondWithStatusCode(_0x3598c0,_0xa77b10){_0xa77b10=_0xa77b10||0xcc;return function(_0x5b53fb){if(_0x5b53fb){return _0x3598c0[_0x339d('0x1f')](_0xa77b10);}return _0x3598c0[_0x339d('0x20')](_0xa77b10)[_0x339d('0x21')]();};}function respondWithResult(_0x2dab01,_0x1c98d2){_0x1c98d2=_0x1c98d2||0xc8;return function(_0x4c6136){if(_0x4c6136){return _0x2dab01[_0x339d('0x20')](_0x1c98d2)[_0x339d('0x22')](_0x4c6136);}};}function respondWithFilteredResult(_0x3dc1ce,_0x2337ea){return function(_0x2409fe){if(_0x2409fe){var _0x3fe3f5=typeof _0x2337ea[_0x339d('0x23')]===_0x339d('0x24')&&typeof _0x2337ea['limit']==='undefined';var _0x4b30a7=_0x2409fe[_0x339d('0x25')];var _0x4c8ddf=_0x3fe3f5?0x0:_0x2337ea[_0x339d('0x23')];var _0x401414=_0x3fe3f5?_0x2409fe[_0x339d('0x25')]:_0x2337ea['offset']+_0x2337ea[_0x339d('0x26')];var _0x1c305a;if(_0x401414>=_0x4b30a7){_0x401414=_0x4b30a7;_0x1c305a=0xc8;}else{_0x1c305a=0xce;}_0x3dc1ce[_0x339d('0x20')](_0x1c305a);return _0x3dc1ce['set'](_0x339d('0x27'),_0x4c8ddf+'-'+_0x401414+'/'+_0x4b30a7)[_0x339d('0x22')](_0x2409fe);}return null;};}function patchUpdates(_0x573e6f){return function(_0x5763b5){try{jsonpatch[_0x339d('0x28')](_0x5763b5,_0x573e6f,!![]);}catch(_0x20ae3a){return BPromise[_0x339d('0x29')](_0x20ae3a);}return _0x5763b5[_0x339d('0x2a')]();};}function saveUpdates(_0x18eda6,_0x243a53){return function(_0xe80a59){if(_0xe80a59){return _0xe80a59[_0x339d('0x2b')](_0x18eda6)[_0x339d('0x2c')](function(_0x45b5e1){return _0x45b5e1;});}return null;};}function removeEntity(_0x39b461,_0x460da7){return function(_0x3083d4){if(_0x3083d4){return _0x3083d4[_0x339d('0x2d')]()['then'](function(){var _0x51008e=_0x3083d4[_0x339d('0x2e')]({'plain':!![]});var _0x24b04b=_0x339d('0x2f');return db[_0x339d('0x30')][_0x339d('0x2d')]({'where':{'type':_0x24b04b,'resourceId':_0x51008e['id']}})[_0x339d('0x2c')](function(){return _0x3083d4;});})[_0x339d('0x2c')](function(){_0x39b461[_0x339d('0x20')](0xcc)[_0x339d('0x21')]();});}};}function handleEntityNotFound(_0x30b0a3,_0x18326f){return function(_0x362519){if(!_0x362519){_0x30b0a3[_0x339d('0x1f')](0x194);}return _0x362519;};}function handleError(_0x2bd74c,_0x24c8b7){_0x24c8b7=_0x24c8b7||0x1f4;return function(_0xb79635){logger[_0x339d('0x31')](_0xb79635[_0x339d('0x32')]);if(_0xb79635[_0x339d('0x33')]){delete _0xb79635[_0x339d('0x33')];}_0x2bd74c[_0x339d('0x20')](_0x24c8b7)['send'](_0xb79635);};}exports[_0x339d('0x34')]=function(_0xef274a,_0x26c2d0){var _0x3400d9={},_0x428817={},_0x3864cc={'count':0x0,'rows':[]};var _0x2cb1f6=_[_0x339d('0x35')](db[_0x339d('0x36')][_0x339d('0x37')],function(_0xe555e2){return{'name':_0xe555e2[_0x339d('0x38')],'type':_0xe555e2[_0x339d('0x39')][_0x339d('0x3a')]};});_0x428817[_0x339d('0x3b')]=_[_0x339d('0x35')](_0x2cb1f6,_0x339d('0x33'));_0x428817[_0x339d('0x3c')]=_[_0x339d('0x3d')](_0xef274a[_0x339d('0x3c')]);_0x428817[_0x339d('0x3e')]=_['intersection'](_0x428817[_0x339d('0x3b')],_0x428817['query']);_0x3400d9[_0x339d('0x3f')]=_[_0x339d('0x40')](_0x428817[_0x339d('0x3b')],qs[_0x339d('0x41')](_0xef274a['query'][_0x339d('0x41')]));_0x3400d9[_0x339d('0x3f')]=_0x3400d9[_0x339d('0x3f')][_0x339d('0x42')]?_0x3400d9['attributes']:_0x428817[_0x339d('0x3b')];if(!_0xef274a['query'][_0x339d('0x43')](_0x339d('0x44'))){_0x3400d9[_0x339d('0x26')]=qs[_0x339d('0x26')](_0xef274a[_0x339d('0x3c')]['limit']);_0x3400d9['offset']=qs[_0x339d('0x23')](_0xef274a[_0x339d('0x3c')][_0x339d('0x23')]);}_0x3400d9[_0x339d('0x45')]=qs['sort'](_0xef274a[_0x339d('0x3c')][_0x339d('0x46')]);_0x3400d9[_0x339d('0x47')]=qs[_0x339d('0x3e')](_[_0x339d('0x48')](_0xef274a[_0x339d('0x3c')],_0x428817['filters']),_0x2cb1f6);if(_0xef274a[_0x339d('0x3c')][_0x339d('0x49')]){_0x3400d9[_0x339d('0x47')]=_[_0x339d('0x4a')](_0x3400d9[_0x339d('0x47')],{'$or':_[_0x339d('0x35')](_0x2cb1f6,function(_0x11a084){if(_0x11a084[_0x339d('0x39')]!==_0x339d('0x4b')){var _0x77c96b={};_0x77c96b[_0x11a084['name']]={'$like':'%'+_0xef274a[_0x339d('0x3c')][_0x339d('0x49')]+'%'};return _0x77c96b;}})});}_0x3400d9=_[_0x339d('0x4a')]({},_0x3400d9,_0xef274a['options']);var _0xd9447f={'where':_0x3400d9[_0x339d('0x47')]};return db[_0x339d('0x36')][_0x339d('0x25')](_0xd9447f)[_0x339d('0x2c')](function(_0x253374){_0x3864cc[_0x339d('0x25')]=_0x253374;if(_0xef274a[_0x339d('0x3c')][_0x339d('0x4c')]){_0x3400d9[_0x339d('0x4d')]=[{'all':!![]}];}return db['SmsQueue'][_0x339d('0x4e')](_0x3400d9);})[_0x339d('0x2c')](function(_0x135813){_0x3864cc['rows']=_0x135813;return _0x3864cc;})[_0x339d('0x2c')](respondWithFilteredResult(_0x26c2d0,_0x3400d9))[_0x339d('0x4f')](handleError(_0x26c2d0,null));};exports[_0x339d('0x50')]=function(_0x60344d,_0x3cc109){var _0x1d31ba={'raw':!![],'where':{'id':_0x60344d['params']['id']}},_0xbcbe2c={};_0xbcbe2c[_0x339d('0x3b')]=_[_0x339d('0x3d')](db[_0x339d('0x36')][_0x339d('0x37')]);_0xbcbe2c['query']=_['keys'](_0x60344d[_0x339d('0x3c')]);_0xbcbe2c[_0x339d('0x3e')]=_[_0x339d('0x40')](_0xbcbe2c[_0x339d('0x3b')],_0xbcbe2c['query']);_0x1d31ba[_0x339d('0x3f')]=_['intersection'](_0xbcbe2c['model'],qs[_0x339d('0x41')](_0x60344d[_0x339d('0x3c')]['fields']));_0x1d31ba['attributes']=_0x1d31ba['attributes']['length']?_0x1d31ba[_0x339d('0x3f')]:_0xbcbe2c['model'];if(_0x60344d[_0x339d('0x3c')][_0x339d('0x4c')]){_0x1d31ba['include']=[{'all':!![]}];}_0x1d31ba=_[_0x339d('0x4a')]({},_0x1d31ba,_0x60344d[_0x339d('0x51')]);return db['SmsQueue'][_0x339d('0x52')](_0x1d31ba)[_0x339d('0x2c')](handleEntityNotFound(_0x3cc109,null))[_0x339d('0x2c')](respondWithResult(_0x3cc109,null))['catch'](handleError(_0x3cc109,null));};exports[_0x339d('0x53')]=function(_0x4fed5e,_0x3b0b03){return db['SmsQueue'][_0x339d('0x53')](_0x4fed5e[_0x339d('0x54')],{})[_0x339d('0x2c')](function(_0x281183){var _0x45c1ac=_0x4fed5e['user'][_0x339d('0x2e')]({'plain':!![]});if(!_0x45c1ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45c1ac['role']===_0x339d('0x55')){var _0x4fdd77=_0x281183['get']({'plain':!![]});var _0x30ebb0=_0x339d('0x2f');return db[_0x339d('0x56')][_0x339d('0x52')]({'where':{'name':_0x30ebb0,'userProfileId':_0x45c1ac[_0x339d('0x57')]},'raw':!![]})[_0x339d('0x2c')](function(_0x223b4e){if(_0x223b4e&&_0x223b4e[_0x339d('0x58')]===0x0){return db[_0x339d('0x30')][_0x339d('0x53')]({'name':_0x4fdd77[_0x339d('0x33')],'resourceId':_0x4fdd77['id'],'type':_0x223b4e[_0x339d('0x33')],'sectionId':_0x223b4e['id']},{})[_0x339d('0x2c')](function(){return _0x281183;});}else{return _0x281183;}})['catch'](function(_0x2ddba0){logger[_0x339d('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ddba0);throw _0x2ddba0;});}return _0x281183;})[_0x339d('0x2c')](respondWithResult(_0x3b0b03,0xc9))[_0x339d('0x4f')](handleError(_0x3b0b03,null));};exports['update']=function(_0x358284,_0x1d5cd4){if(_0x358284[_0x339d('0x54')]['id']){delete _0x358284[_0x339d('0x54')]['id'];}return db[_0x339d('0x36')][_0x339d('0x52')]({'where':{'id':_0x358284[_0x339d('0x59')]['id']}})[_0x339d('0x2c')](handleEntityNotFound(_0x1d5cd4,null))[_0x339d('0x2c')](saveUpdates(_0x358284[_0x339d('0x54')],null))[_0x339d('0x2c')](respondWithResult(_0x1d5cd4,null))[_0x339d('0x4f')](handleError(_0x1d5cd4,null));};exports[_0x339d('0x2d')]=function(_0x449919,_0x1c730d){return db[_0x339d('0x36')][_0x339d('0x52')]({'where':{'id':_0x449919[_0x339d('0x59')]['id']}})[_0x339d('0x2c')](handleEntityNotFound(_0x1c730d,null))['then'](removeEntity(_0x1c730d,null))[_0x339d('0x4f')](handleError(_0x1c730d,null));};exports['describe']=function(_0x44e3c4,_0xec384b){return db['SmsQueue'][_0x339d('0x5a')]()[_0x339d('0x2c')](respondWithResult(_0xec384b,null))[_0x339d('0x4f')](handleError(_0xec384b,null));};exports[_0x339d('0x5b')]=function(_0x49a037,_0x4d4522,_0x59043e){var _0x39af50={'raw':!![],'where':{}},_0xb1d004={},_0x553053;return db[_0x339d('0x36')][_0x339d('0x5c')]({'where':{'id':_0x49a037[_0x339d('0x59')]['id']}})[_0x339d('0x2c')](handleEntityNotFound(_0x4d4522,null))[_0x339d('0x2c')](function(_0x1bf665){if(_0x1bf665){_0x553053=_0x1bf665['get']({'plain':!![]});_0xb1d004[_0x339d('0x3b')]=_['keys'](db[_0x339d('0x5d')][_0x339d('0x37')]);_0xb1d004[_0x339d('0x3c')]=_[_0x339d('0x3d')](_0x49a037[_0x339d('0x3c')]);_0xb1d004[_0x339d('0x3e')]=_[_0x339d('0x40')](_0xb1d004[_0x339d('0x3b')],_0xb1d004[_0x339d('0x3c')]);_0x39af50[_0x339d('0x3f')]=_[_0x339d('0x40')](_0xb1d004[_0x339d('0x3b')],qs[_0x339d('0x41')](_0x49a037[_0x339d('0x3c')][_0x339d('0x41')]));_0x39af50[_0x339d('0x3f')]=_0x39af50['attributes']['length']?_0x39af50[_0x339d('0x3f')]:_0xb1d004[_0x339d('0x3b')];if(!_0x49a037[_0x339d('0x3c')][_0x339d('0x43')](_0x339d('0x44'))){_0x39af50[_0x339d('0x26')]=qs['limit'](_0x49a037[_0x339d('0x3c')][_0x339d('0x26')]);_0x39af50[_0x339d('0x23')]=qs[_0x339d('0x23')](_0x49a037[_0x339d('0x3c')][_0x339d('0x23')]);}_0x39af50[_0x339d('0x45')]=qs[_0x339d('0x46')](_0x49a037[_0x339d('0x3c')][_0x339d('0x46')]);_0x39af50['where']=qs[_0x339d('0x3e')](_['pick'](_0x49a037['query'],_0xb1d004[_0x339d('0x3e')]));_0x39af50[_0x339d('0x47')][_0x339d('0x5e')]=_0x1bf665['id'];if(_0x49a037[_0x339d('0x3c')][_0x339d('0x49')]){_0x39af50[_0x339d('0x47')]=_['merge'](_0x39af50[_0x339d('0x47')],{'$or':_['map'](_0x39af50[_0x339d('0x3f')],function(_0x5b4067){var _0x1abd3a={};_0x1abd3a[_0x5b4067]={'$like':'%'+_0x49a037[_0x339d('0x3c')][_0x339d('0x49')]+'%'};return _0x1abd3a;})});}_0x39af50=_[_0x339d('0x4a')]({},_0x39af50,_0x49a037[_0x339d('0x51')]);return db[_0x339d('0x5d')][_0x339d('0x4e')](_0x39af50);}})[_0x339d('0x2c')](function(_0x56b69c){if(_0x56b69c){return db[_0x339d('0x5f')][_0x339d('0x60')]({'where':{'id':_[_0x339d('0x35')](_0x56b69c,_0x339d('0x61')),'role':'agent'},'attributes':['id',_0x339d('0x33'),_0x339d('0x62'),_0x339d('0x63'),_0x339d('0x64')]});}})[_0x339d('0x2c')](function(_0x56ce29){if(_0x56ce29){return{'count':_0x56ce29[_0x339d('0x25')],'rows':_[_0x339d('0x35')](_0x56ce29['rows'],function(_0x2d7a14){return{'membername':_0x2d7a14[_0x339d('0x33')],'UserId':_0x2d7a14['id'],'queue_name':_0x553053[_0x339d('0x33')],'SmsQueueId':_0x553053['id'],'interface':util[_0x339d('0x65')](_0x339d('0x66'),_0x339d('0x67'),_0x2d7a14[_0x339d('0x33')]),'penalty':0x0,'paused':_0x2d7a14[_0x339d('0x62')],'createdAt':_0x2d7a14[_0x339d('0x64')],'updatedAt':_0x2d7a14['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x339d('0x2c')](respondWithFilteredResult(_0x4d4522,_0x39af50))['catch'](handleError(_0x4d4522,null));};exports['getTeams']=function(_0x159970,_0x31a624,_0x20717f){var _0x37b925={};var _0x261ecf={};var _0x4b80a5;var _0x3de86c;return db[_0x339d('0x36')]['findOne']({'where':{'id':_0x159970[_0x339d('0x59')]['id']}})['then'](handleEntityNotFound(_0x31a624,null))[_0x339d('0x2c')](function(_0x18d9db){if(_0x18d9db){_0x4b80a5=_0x18d9db;_0x261ecf[_0x339d('0x3b')]=_[_0x339d('0x3d')](db[_0x339d('0x68')][_0x339d('0x37')]);_0x261ecf[_0x339d('0x3c')]=_[_0x339d('0x3d')](_0x159970[_0x339d('0x3c')]);_0x261ecf[_0x339d('0x3e')]=_[_0x339d('0x40')](_0x261ecf[_0x339d('0x3b')],_0x261ecf['query']);_0x37b925[_0x339d('0x3f')]=_[_0x339d('0x40')](_0x261ecf[_0x339d('0x3b')],qs[_0x339d('0x41')](_0x159970[_0x339d('0x3c')][_0x339d('0x41')]));_0x37b925[_0x339d('0x3f')]=_0x37b925[_0x339d('0x3f')][_0x339d('0x42')]?_0x37b925[_0x339d('0x3f')]:_0x261ecf['model'];_0x37b925[_0x339d('0x45')]=qs['sort'](_0x159970[_0x339d('0x3c')][_0x339d('0x46')]);_0x37b925['where']=qs[_0x339d('0x3e')](_['pick'](_0x159970[_0x339d('0x3c')],_0x261ecf[_0x339d('0x3e')]));if(_0x159970['query']['filter']){_0x37b925[_0x339d('0x47')]=_[_0x339d('0x4a')](_0x37b925[_0x339d('0x47')],{'$or':_[_0x339d('0x35')](_0x37b925[_0x339d('0x3f')],function(_0x50063c){var _0x35b3ae={};_0x35b3ae[_0x50063c]={'$like':'%'+_0x159970[_0x339d('0x3c')][_0x339d('0x49')]+'%'};return _0x35b3ae;})});}_0x37b925=_[_0x339d('0x4a')]({},_0x37b925,_0x159970[_0x339d('0x51')]);return _0x4b80a5[_0x339d('0x69')](_0x37b925);}})[_0x339d('0x2c')](function(_0x3a51d2){if(_0x3a51d2){_0x3de86c=_0x3a51d2['length'];if(!_0x159970[_0x339d('0x3c')]['hasOwnProperty']('nolimit')){_0x37b925[_0x339d('0x26')]=qs[_0x339d('0x26')](_0x159970[_0x339d('0x3c')][_0x339d('0x26')]);_0x37b925[_0x339d('0x23')]=qs[_0x339d('0x23')](_0x159970[_0x339d('0x3c')]['offset']);}return _0x4b80a5[_0x339d('0x69')](_0x37b925);}})[_0x339d('0x2c')](function(_0x190f33){if(_0x190f33){return _0x190f33?{'count':_0x3de86c,'rows':_0x190f33}:null;}})[_0x339d('0x2c')](respondWithResult(_0x31a624,null))[_0x339d('0x4f')](handleError(_0x31a624,null));};exports['addTeams']=function(_0xe41da1,_0x15a7d5,_0x2d0296){var _0x27f0fa=_0xe41da1[_0x339d('0x54')][_0x339d('0x6a')];return db[_0x339d('0x68')][_0x339d('0x4e')]({'where':{'id':_0x27f0fa},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x339d('0x33'),'online',_0x339d('0x6b'),_0x339d('0x6c')],'raw':!![]}]})[_0x339d('0x2c')](function(_0x310304){if(_0x310304){var _0x521a38=_['flatMap'](_0x310304,function(_0xaf16d3){var _0x2d5bf0=_0xaf16d3['get']({'plain':!![]});return _0x2d5bf0[_0x339d('0x6d')];});return db[_0x339d('0x36')][_0x339d('0x52')]({'where':{'id':_0xe41da1['params']['id']}})[_0x339d('0x2c')](function(_0xe499f0){return db[_0x339d('0x6e')]['transaction'](function(_0x451c31){return _0xe499f0[_0x339d('0x6f')](_0x27f0fa,{'transaction':_0x451c31})[_0x339d('0x2c')](function(){return BPromise['each'](_0x521a38,function(_0x39edae){return db[_0x339d('0x5d')][_0x339d('0x70')]({'where':{'UserId':_0x39edae['id'],'SmsQueueId':_0xe41da1[_0x339d('0x59')]['id']},'transaction':_0x451c31});});})['then'](function(){_0x521a38[_0x339d('0x71')](function(_0x146eb1){socket['emit'](_0x339d('0x72'),{'UserId':_0x146eb1['id'],'SmsQueueId':_0xe499f0['id']});});});});});}})[_0x339d('0x2c')](respondWithStatusCode(_0x15a7d5,null))[_0x339d('0x4f')](handleError(_0x15a7d5,null));};exports[_0x339d('0x73')]=function(_0x1e64d8,_0x59df3b,_0x1ae311){return db[_0x339d('0x68')][_0x339d('0x4e')]({'where':{'id':_0x1e64d8[_0x339d('0x3c')][_0x339d('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x339d('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x339d('0x2c')](handleEntityNotFound(_0x59df3b,null))[_0x339d('0x2c')](function(_0x5a935e){var _0x196089=_[_0x339d('0x35')](_0x5a935e,'id');var _0x3b757d=[];var _0x5a4e0d=[];var _0x554fe9=squel[_0x339d('0x74')]();_0x554fe9[_0x339d('0x75')](_0x339d('0x76'))[_0x339d('0x77')](_0x339d('0x78'),'tq')[_0x339d('0x79')](_0x339d('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x339d('0x47')]('SmsQueueId\x20=\x20?',_0x1e64d8[_0x339d('0x59')]['id']);for(var _0x325005=0x0;_0x325005<_0x5a935e[_0x339d('0x42')];_0x325005+=0x1){let _0x1eef4b=_0x5a935e[_0x325005];for(var _0x2a8aa6=0x0;_0x2a8aa6<_0x1eef4b['Agents'][_0x339d('0x42')];_0x2a8aa6+=0x1){let _0x2cc505=_0x1eef4b[_0x339d('0x6d')][_0x2a8aa6];var _0xf8765c=_0x554fe9[_0x339d('0x7b')]();_0xf8765c[_0x339d('0x47')](_0x339d('0x7c'),_0x2cc505['id']);_0x5a4e0d[_0x339d('0x7d')](db[_0x339d('0x6e')][_0x339d('0x3c')](_0xf8765c[_0x339d('0x7e')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x140100){if(_0x140100['length']===0x1){return _0x2cc505['id'];}else{var _0x5c1544=_[_0x339d('0x7f')](_[_0x339d('0x35')](_0x140100,_0x339d('0x80')),function(_0x2e330d){return _['includes'](_0x196089,_0x2e330d);});if(_0x5c1544){return _0x2cc505['id'];}}}));}}return BPromise[_0x339d('0x81')](_0x5a4e0d)[_0x339d('0x2c')](function(_0x203610){_0x3b757d=_(_0x3b757d)[_0x339d('0x82')](_0x203610)['compact']()[_0x339d('0x83')]();return db[_0x339d('0x36')][_0x339d('0x52')]({'where':{'id':_0x1e64d8[_0x339d('0x59')]['id']}})[_0x339d('0x2c')](function(_0x3b4cbd){return db['sequelize'][_0x339d('0x84')](function(_0x4080cc){return _0x3b4cbd['removeTeams'](_0x1e64d8[_0x339d('0x3c')]['ids'],{'transaction':_0x4080cc})[_0x339d('0x2c')](function(){if(!_[_0x339d('0x85')](_0x3b757d)){return _0x3b4cbd[_0x339d('0x86')](_0x3b757d,{'transaction':_0x4080cc});}})[_0x339d('0x2c')](function(){_0x3b757d['forEach'](function(_0x4474d5){socket[_0x339d('0x87')](_0x339d('0x88'),{'UserId':_0x4474d5,'SmsQueueId':_0x3b4cbd['id']});});});});});});})['then'](respondWithStatusCode(_0x59df3b,null))[_0x339d('0x4f')](handleError(_0x59df3b,null));};exports[_0x339d('0x89')]=function(_0x4d58b5,_0x1e8640,_0x18e67d){return db[_0x339d('0x36')]['find']({'where':{'id':_0x4d58b5['params']['id']}})['then'](handleEntityNotFound(_0x1e8640,null))['then'](function(_0x5b31e9){if(_0x5b31e9){return _0x5b31e9[_0x339d('0x89')](_0x4d58b5[_0x339d('0x54')][_0x339d('0x6a')],_[_0x339d('0x8a')](_0x4d58b5[_0x339d('0x54')],[_0x339d('0x6a'),'id'])||{})['spread'](function(_0x4dbba1){for(var _0x5431c0=0x0;_0x5431c0<_0x4d58b5[_0x339d('0x54')][_0x339d('0x6a')][_0x339d('0x42')];_0x5431c0+=0x1){socket[_0x339d('0x87')](_0x339d('0x72'),{'UserId':Number(_0x4d58b5[_0x339d('0x54')][_0x339d('0x6a')][_0x5431c0]),'SmsQueueId':Number(_0x4d58b5[_0x339d('0x59')]['id'])});}return _0x4dbba1;});}})[_0x339d('0x2c')](respondWithResult(_0x1e8640,null))[_0x339d('0x4f')](handleError(_0x1e8640,null));};exports[_0x339d('0x86')]=function(_0x252a64,_0x23f7de,_0x199657){return db['SmsQueue'][_0x339d('0x52')]({'where':{'id':_0x252a64[_0x339d('0x59')]['id']}})['then'](handleEntityNotFound(_0x23f7de,null))[_0x339d('0x2c')](function(_0x123382){if(_0x123382){return _0x123382[_0x339d('0x86')](_0x252a64[_0x339d('0x3c')][_0x339d('0x6a')])['then'](function(){if(_['isArray'](_0x252a64[_0x339d('0x3c')][_0x339d('0x6a')])){for(var _0x443ff8=0x0;_0x443ff8<_0x252a64['query'][_0x339d('0x6a')][_0x339d('0x42')];_0x443ff8+=0x1){socket[_0x339d('0x87')](_0x339d('0x88'),{'UserId':Number(_0x252a64[_0x339d('0x3c')][_0x339d('0x6a')][_0x443ff8]),'SmsQueueId':Number(_0x252a64[_0x339d('0x59')]['id'])});}}else{socket[_0x339d('0x87')](_0x339d('0x88'),{'UserId':Number(_0x252a64[_0x339d('0x3c')][_0x339d('0x6a')]),'SmsQueueId':Number(_0x252a64[_0x339d('0x59')]['id'])});}});}})[_0x339d('0x2c')](respondWithStatusCode(_0x23f7de,null))[_0x339d('0x4f')](handleError(_0x23f7de,null));};exports['getAgents']=function(_0x3d3d71,_0x275f86,_0x1faeb4){var _0x7838de={};var _0x408216={};var _0x2d45d0;var _0x39de75;return db[_0x339d('0x36')]['findOne']({'where':{'id':_0x3d3d71['params']['id']}})['then'](handleEntityNotFound(_0x275f86,null))['then'](function(_0x1c817b){if(_0x1c817b){_0x2d45d0=_0x1c817b;_0x408216[_0x339d('0x3b')]=_[_0x339d('0x3d')](db['User'][_0x339d('0x37')]);_0x408216['query']=_[_0x339d('0x3d')](_0x3d3d71['query']);_0x408216[_0x339d('0x3e')]=_['intersection'](_0x408216[_0x339d('0x3b')],_0x408216[_0x339d('0x3c')]);_0x7838de[_0x339d('0x3f')]=_[_0x339d('0x40')](_0x408216[_0x339d('0x3b')],qs['fields'](_0x3d3d71[_0x339d('0x3c')][_0x339d('0x41')]));_0x7838de[_0x339d('0x3f')]=_0x7838de[_0x339d('0x3f')][_0x339d('0x42')]?_0x7838de['attributes']:_0x408216[_0x339d('0x3b')];_0x7838de['order']=qs['sort'](_0x3d3d71[_0x339d('0x3c')][_0x339d('0x46')]);_0x7838de[_0x339d('0x47')]=qs[_0x339d('0x3e')](_[_0x339d('0x48')](_0x3d3d71[_0x339d('0x3c')],_0x408216[_0x339d('0x3e')]));if(_0x3d3d71[_0x339d('0x3c')]['filter']){_0x7838de['where']=_[_0x339d('0x4a')](_0x7838de['where'],{'$or':_[_0x339d('0x35')](_0x7838de[_0x339d('0x3f')],function(_0x52eab2){var _0x13d01e={};_0x13d01e[_0x52eab2]={'$like':'%'+_0x3d3d71[_0x339d('0x3c')][_0x339d('0x49')]+'%'};return _0x13d01e;})});}_0x7838de=_[_0x339d('0x4a')]({},_0x7838de,_0x3d3d71[_0x339d('0x51')]);return _0x2d45d0[_0x339d('0x8b')](_0x7838de);}})['then'](function(_0x563497){if(_0x563497){_0x39de75=_0x563497[_0x339d('0x42')];if(!_0x3d3d71[_0x339d('0x3c')]['hasOwnProperty'](_0x339d('0x44'))){_0x7838de['limit']=qs[_0x339d('0x26')](_0x3d3d71[_0x339d('0x3c')]['limit']);_0x7838de[_0x339d('0x23')]=qs['offset'](_0x3d3d71['query'][_0x339d('0x23')]);}return _0x2d45d0['getAgents'](_0x7838de);}})[_0x339d('0x2c')](function(_0x50015c){if(_0x50015c){return _0x50015c?{'count':_0x39de75,'rows':_0x50015c}:null;}})[_0x339d('0x2c')](respondWithResult(_0x275f86,null))[_0x339d('0x4f')](handleError(_0x275f86,null));};
\ No newline at end of file
index c578743..fd58895 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd084=['../../mysqldb','remove','emit','hasOwnProperty','events'];(function(_0xe83e66,_0x3ae6dc){var _0x2731f2=function(_0x53d4a6){while(--_0x53d4a6){_0xe83e66['push'](_0xe83e66['shift']());}};_0x2731f2(++_0x3ae6dc);}(_0xd084,0x158));var _0x4d08=function(_0x14c14b,_0xeba916){_0x14c14b=_0x14c14b-0x0;var _0x345436=_0xd084[_0x14c14b];return _0x345436;};'use strict';var EventEmitter=require(_0x4d08('0x0'));var SmsQueue=require(_0x4d08('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4d08('0x2')};function emitEvent(_0x2d229c){return function(_0x51a521,_0x1bc640,_0x5085b6){SmsQueueEvents[_0x4d08('0x3')](_0x2d229c+':'+_0x51a521['id'],_0x51a521);SmsQueueEvents['emit'](_0x2d229c,_0x51a521);_0x5085b6(null);};}for(var e in events){if(events[_0x4d08('0x4')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
+var _0x3100=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3100,0xc9));var _0x0310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3100[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0310('0x0'));var SmsQueue=require(_0x0310('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x0310('0x2')](0x0);var events={'afterCreate':_0x0310('0x3'),'afterUpdate':_0x0310('0x4'),'afterDestroy':_0x0310('0x5')};function emitEvent(_0x19651b){return function(_0x5a1056,_0x40eaa7,_0x366aa6){SmsQueueEvents[_0x0310('0x6')](_0x19651b+':'+_0x5a1056['id'],_0x5a1056);SmsQueueEvents[_0x0310('0x6')](_0x19651b,_0x5a1056);_0x366aa6(null);};}for(var e in events){if(events[_0x0310('0x7')](e)){var event=events[e];SmsQueue[_0x0310('0x8')](e,emitEvent(event));}}module[_0x0310('0x9')]=SmsQueueEvents;
\ No newline at end of file
index 1d66542..bcbfe3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9fa=['rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','util','../../config/logger'];(function(_0x163a1c,_0x4f81ea){var _0x239113=function(_0x45eaeb){while(--_0x45eaeb){_0x163a1c['push'](_0x163a1c['shift']());}};_0x239113(++_0x4f81ea);}(_0xe9fa,0xba));var _0xae9f=function(_0x10d59e,_0x4191bc){_0x10d59e=_0x10d59e-0x0;var _0x182750=_0xe9fa[_0x10d59e];return _0x182750;};'use strict';var _=require(_0xae9f('0x0'));var util=require(_0xae9f('0x1'));var logger=require(_0xae9f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xae9f('0x3'));var config=require(_0xae9f('0x4'));var attributes=require(_0xae9f('0x5'));module['exports']=function(_0x26d84e,_0x24e80a){return _0x26d84e[_0xae9f('0x6')](_0xae9f('0x7'),attributes,{'tableName':_0xae9f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e7d=['path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36afe7,_0x4bbd79){var _0xd28d41=function(_0x4255f6){while(--_0x4255f6){_0x36afe7['push'](_0x36afe7['shift']());}};_0xd28d41(++_0x4bbd79);}(_0x4e7d,0x77));var _0xd4e7=function(_0x197463,_0x2a3fc7){_0x197463=_0x197463-0x0;var _0x5e3278=_0x4e7d[_0x197463];return _0x5e3278;};'use strict';var _=require(_0xd4e7('0x0'));var util=require(_0xd4e7('0x1'));var logger=require(_0xd4e7('0x2'))(_0xd4e7('0x3'));var moment=require(_0xd4e7('0x4'));var BPromise=require(_0xd4e7('0x5'));var rp=require(_0xd4e7('0x6'));var fs=require('fs');var path=require(_0xd4e7('0x7'));var rimraf=require(_0xd4e7('0x8'));var config=require(_0xd4e7('0x9'));var attributes=require(_0xd4e7('0xa'));module[_0xd4e7('0xb')]=function(_0x4d3dd1,_0x49a3b7){return _0x4d3dd1[_0xd4e7('0xc')]('SmsQueue',attributes,{'tableName':_0xd4e7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8800ee9..3bac1e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf710=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','raw','options','attributes','limit','include','map','model','ShowSmsQueue','where','catch'];(function(_0x588f72,_0x207a01){var _0x3f249d=function(_0xe4e3a2){while(--_0xe4e3a2){_0x588f72['push'](_0x588f72['shift']());}};_0x3f249d(++_0x207a01);}(_0xf710,0x1b8));var _0x0f71=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xf710[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0f71('0x0'));var util=require(_0x0f71('0x1'));var moment=require(_0x0f71('0x2'));var BPromise=require(_0x0f71('0x3'));var rs=require(_0x0f71('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f71('0x5'))['db'];var utils=require(_0x0f71('0x6'));var logger=require(_0x0f71('0x7'))(_0x0f71('0x8'));var config=require(_0x0f71('0x9'));var jayson=require(_0x0f71('0xa'));var client=jayson[_0x0f71('0xb')][_0x0f71('0xc')]({'port':0x232a});config['redis']=_[_0x0f71('0xd')](config[_0x0f71('0xe')],{'host':_0x0f71('0xf'),'port':0x18eb});var socket=require(_0x0f71('0x10'))(new Redis(config[_0x0f71('0xe')]));require(_0x0f71('0x11'))[_0x0f71('0x12')](socket);function respondWithRpcPromise(_0x929ccd,_0x365ed2,_0x789b5b){return new BPromise(function(_0x2025c2,_0x581802){return client[_0x0f71('0x13')](_0x929ccd,_0x789b5b)[_0x0f71('0x14')](function(_0x3c2868){logger[_0x0f71('0x15')](_0x0f71('0x16'),_0x365ed2,_0x0f71('0x17'));logger[_0x0f71('0x18')](_0x0f71('0x19'),_0x365ed2,'request\x20sent',JSON[_0x0f71('0x1a')](_0x3c2868));if(_0x3c2868['error']){if(_0x3c2868[_0x0f71('0x1b')][_0x0f71('0x1c')]===0x1f4){logger[_0x0f71('0x1b')](_0x0f71('0x16'),_0x365ed2,_0x3c2868[_0x0f71('0x1b')][_0x0f71('0x1d')]);return _0x581802(_0x3c2868[_0x0f71('0x1b')][_0x0f71('0x1d')]);}logger[_0x0f71('0x1b')](_0x0f71('0x16'),_0x365ed2,_0x3c2868['error'][_0x0f71('0x1d')]);return _0x2025c2(_0x3c2868[_0x0f71('0x1b')]['message']);}else{logger['info'](_0x0f71('0x16'),_0x365ed2,_0x0f71('0x17'));_0x2025c2(_0x3c2868[_0x0f71('0x1e')][_0x0f71('0x1d')]);}})['catch'](function(_0x2f0b76){logger['error'](_0x0f71('0x16'),_0x365ed2,_0x2f0b76);_0x581802(_0x2f0b76);});});}exports[_0x0f71('0x1f')]=function(_0xd84ef5){var _0x35f3db=this;return new Promise(function(_0x5cf356,_0x77adee){return db[_0x0f71('0x20')][_0x0f71('0x21')]({'raw':_0xd84ef5['options']?_0xd84ef5['options'][_0x0f71('0x22')]===undefined?!![]:![]:!![],'where':_0xd84ef5[_0x0f71('0x23')]?_0xd84ef5['options']['where']||null:null,'attributes':_0xd84ef5[_0x0f71('0x23')]?_0xd84ef5[_0x0f71('0x23')][_0x0f71('0x24')]||null:null,'limit':_0xd84ef5['options']?_0xd84ef5[_0x0f71('0x23')][_0x0f71('0x25')]||null:null,'include':_0xd84ef5[_0x0f71('0x23')]?_0xd84ef5[_0x0f71('0x23')][_0x0f71('0x26')]?_[_0x0f71('0x27')](_0xd84ef5[_0x0f71('0x23')][_0x0f71('0x26')],function(_0x46100a){return{'model':db[_0x46100a[_0x0f71('0x28')]],'as':_0x46100a['as'],'attributes':_0x46100a[_0x0f71('0x24')],'include':_0x46100a['include']?_[_0x0f71('0x27')](_0x46100a[_0x0f71('0x26')],function(_0x1f8809){return{'model':db[_0x1f8809[_0x0f71('0x28')]],'as':_0x1f8809['as'],'attributes':_0x1f8809[_0x0f71('0x24')],'include':_0x1f8809[_0x0f71('0x26')]?_['map'](_0x1f8809['include'],function(_0x58ff65){return{'model':db[_0x58ff65[_0x0f71('0x28')]],'as':_0x58ff65['as'],'attributes':_0x58ff65[_0x0f71('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0f71('0x14')](function(_0x500baf){logger[_0x0f71('0x15')](_0x0f71('0x1f'),_0xd84ef5);logger[_0x0f71('0x18')](_0x0f71('0x1f'),_0xd84ef5,JSON['stringify'](_0x500baf));_0x5cf356(_0x500baf);})['catch'](function(_0x3d822f){logger[_0x0f71('0x1b')](_0x0f71('0x1f'),_0x3d822f[_0x0f71('0x1d')],_0xd84ef5);_0x77adee(_0x35f3db[_0x0f71('0x1b')](0x1f4,_0x3d822f['message']));});});};exports[_0x0f71('0x29')]=function(_0x4b54c9){var _0x2b40f3=this;return new Promise(function(_0x33b386,_0x12fa72){return db['SmsQueue']['find']({'raw':_0x4b54c9[_0x0f71('0x23')]?_0x4b54c9['options'][_0x0f71('0x22')]===undefined?!![]:![]:!![],'where':_0x4b54c9[_0x0f71('0x23')]?_0x4b54c9[_0x0f71('0x23')][_0x0f71('0x2a')]||null:null,'attributes':_0x4b54c9[_0x0f71('0x23')]?_0x4b54c9[_0x0f71('0x23')][_0x0f71('0x24')]||null:null,'include':_0x4b54c9[_0x0f71('0x23')]?_0x4b54c9[_0x0f71('0x23')][_0x0f71('0x26')]?_['map'](_0x4b54c9['options'][_0x0f71('0x26')],function(_0x409da2){return{'model':db[_0x409da2[_0x0f71('0x28')]],'as':_0x409da2['as'],'attributes':_0x409da2[_0x0f71('0x24')],'include':_0x409da2['include']?_['map'](_0x409da2[_0x0f71('0x26')],function(_0x59c1cf){return{'model':db[_0x59c1cf['model']],'as':_0x59c1cf['as'],'attributes':_0x59c1cf[_0x0f71('0x24')],'include':_0x59c1cf[_0x0f71('0x26')]?_[_0x0f71('0x27')](_0x59c1cf['include'],function(_0x5001c1){return{'model':db[_0x5001c1[_0x0f71('0x28')]],'as':_0x5001c1['as'],'attributes':_0x5001c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f71('0x14')](function(_0x11e79){logger[_0x0f71('0x15')](_0x0f71('0x29'),_0x4b54c9);logger[_0x0f71('0x18')](_0x0f71('0x29'),_0x4b54c9,JSON[_0x0f71('0x1a')](_0x11e79));_0x33b386(_0x11e79);})[_0x0f71('0x2b')](function(_0x2bc8fa){logger[_0x0f71('0x1b')](_0x0f71('0x29'),_0x2bc8fa[_0x0f71('0x1d')],_0x4b54c9);_0x12fa72(_0x2b40f3[_0x0f71('0x1b')](0x1f4,_0x2bc8fa[_0x0f71('0x1d')]));});});};
\ No newline at end of file
+var _0x7cc7=['error','code','message','SmsQueue,\x20%s,\x20%s','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','then','catch','ShowSmsQueue','find','model','info','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','debug','request\x20sent','stringify'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x7cc7,0x1af));var _0x77cc=function(_0x2f5d1d,_0x54ca1f){_0x2f5d1d=_0x2f5d1d-0x0;var _0x200f94=_0x7cc7[_0x2f5d1d];return _0x200f94;};'use strict';var _=require(_0x77cc('0x0'));var util=require(_0x77cc('0x1'));var moment=require(_0x77cc('0x2'));var BPromise=require(_0x77cc('0x3'));var rs=require(_0x77cc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x77cc('0x5'))(_0x77cc('0x6'));var config=require(_0x77cc('0x7'));var jayson=require(_0x77cc('0x8'));var client=jayson['client'][_0x77cc('0x9')]({'port':0x232a});config[_0x77cc('0xa')]=_[_0x77cc('0xb')](config['redis'],{'host':_0x77cc('0xc'),'port':0x18eb});var socket=require(_0x77cc('0xd'))(new Redis(config[_0x77cc('0xa')]));require(_0x77cc('0xe'))[_0x77cc('0xf')](socket);function respondWithRpcPromise(_0x55042c,_0x34e230,_0x3d4ea6){return new BPromise(function(_0x4dbc13,_0x4592c8){return client[_0x77cc('0x10')](_0x55042c,_0x3d4ea6)['then'](function(_0x255217){logger['info']('SmsQueue,\x20%s,\x20%s',_0x34e230,'request\x20sent');logger[_0x77cc('0x11')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x34e230,_0x77cc('0x12'),JSON[_0x77cc('0x13')](_0x255217));if(_0x255217[_0x77cc('0x14')]){if(_0x255217[_0x77cc('0x14')][_0x77cc('0x15')]===0x1f4){logger[_0x77cc('0x14')]('SmsQueue,\x20%s,\x20%s',_0x34e230,_0x255217[_0x77cc('0x14')]['message']);return _0x4592c8(_0x255217['error'][_0x77cc('0x16')]);}logger[_0x77cc('0x14')](_0x77cc('0x17'),_0x34e230,_0x255217['error']['message']);return _0x4dbc13(_0x255217['error'][_0x77cc('0x16')]);}else{logger['info'](_0x77cc('0x17'),_0x34e230,_0x77cc('0x12'));_0x4dbc13(_0x255217[_0x77cc('0x18')][_0x77cc('0x16')]);}})['catch'](function(_0x2244d1){logger[_0x77cc('0x14')](_0x77cc('0x17'),_0x34e230,_0x2244d1);_0x4592c8(_0x2244d1);});});}exports[_0x77cc('0x19')]=function(_0x3102fb){var _0x24c7b7=this;return new Promise(function(_0x51b2ec,_0x1557a0){return db[_0x77cc('0x1a')][_0x77cc('0x1b')]({'raw':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb[_0x77cc('0x1c')][_0x77cc('0x1d')]===undefined?!![]:![]:!![],'where':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb['options'][_0x77cc('0x1e')]||null:null,'attributes':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb[_0x77cc('0x1c')][_0x77cc('0x1f')]||null:null,'limit':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb[_0x77cc('0x1c')][_0x77cc('0x20')]||null:null,'include':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb['options'][_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x3102fb[_0x77cc('0x1c')][_0x77cc('0x21')],function(_0x10a854){return{'model':db[_0x10a854['model']],'as':_0x10a854['as'],'attributes':_0x10a854[_0x77cc('0x1f')],'include':_0x10a854[_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x10a854[_0x77cc('0x21')],function(_0x1f0d0d){return{'model':db[_0x1f0d0d['model']],'as':_0x1f0d0d['as'],'attributes':_0x1f0d0d[_0x77cc('0x1f')],'include':_0x1f0d0d[_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x1f0d0d[_0x77cc('0x21')],function(_0x5cf38b){return{'model':db[_0x5cf38b['model']],'as':_0x5cf38b['as'],'attributes':_0x5cf38b[_0x77cc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x77cc('0x23')](function(_0x49122b){logger['info']('GetSmsQueue',_0x3102fb);logger[_0x77cc('0x11')](_0x77cc('0x19'),_0x3102fb,JSON[_0x77cc('0x13')](_0x49122b));_0x51b2ec(_0x49122b);})[_0x77cc('0x24')](function(_0x38a40f){logger[_0x77cc('0x14')](_0x77cc('0x19'),_0x38a40f[_0x77cc('0x16')],_0x3102fb);_0x1557a0(_0x24c7b7[_0x77cc('0x14')](0x1f4,_0x38a40f[_0x77cc('0x16')]));});});};exports[_0x77cc('0x25')]=function(_0x21659c){var _0x33f8a9=this;return new Promise(function(_0x440faf,_0x16a8dd){return db['SmsQueue'][_0x77cc('0x26')]({'raw':_0x21659c[_0x77cc('0x1c')]?_0x21659c[_0x77cc('0x1c')][_0x77cc('0x1d')]===undefined?!![]:![]:!![],'where':_0x21659c[_0x77cc('0x1c')]?_0x21659c[_0x77cc('0x1c')][_0x77cc('0x1e')]||null:null,'attributes':_0x21659c[_0x77cc('0x1c')]?_0x21659c[_0x77cc('0x1c')][_0x77cc('0x1f')]||null:null,'include':_0x21659c['options']?_0x21659c[_0x77cc('0x1c')][_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x21659c[_0x77cc('0x1c')][_0x77cc('0x21')],function(_0x1ea2e7){return{'model':db[_0x1ea2e7['model']],'as':_0x1ea2e7['as'],'attributes':_0x1ea2e7[_0x77cc('0x1f')],'include':_0x1ea2e7[_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x1ea2e7[_0x77cc('0x21')],function(_0x3e6be4){return{'model':db[_0x3e6be4[_0x77cc('0x27')]],'as':_0x3e6be4['as'],'attributes':_0x3e6be4['attributes'],'include':_0x3e6be4[_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x3e6be4[_0x77cc('0x21')],function(_0x44b6c5){return{'model':db[_0x44b6c5['model']],'as':_0x44b6c5['as'],'attributes':_0x44b6c5['attributes']};}):[]};}):[]};}):[]:[]})[_0x77cc('0x23')](function(_0x8eda97){logger[_0x77cc('0x28')](_0x77cc('0x25'),_0x21659c);logger[_0x77cc('0x11')]('ShowSmsQueue',_0x21659c,JSON[_0x77cc('0x13')](_0x8eda97));_0x440faf(_0x8eda97);})[_0x77cc('0x24')](function(_0xcc8f46){logger[_0x77cc('0x14')]('ShowSmsQueue',_0xcc8f46[_0x77cc('0x16')],_0x21659c);_0x16a8dd(_0x33f8a9[_0x77cc('0x14')](0x1f4,_0xcc8f46[_0x77cc('0x16')]));});});};
\ No newline at end of file
index e9d2d6c..fd4c75c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17c7=['./smsQueue.events','save','update','removeListener','length','smsQueue:'];(function(_0x476639,_0x44fc1b){var _0x56735b=function(_0x4bf6b5){while(--_0x4bf6b5){_0x476639['push'](_0x476639['shift']());}};_0x56735b(++_0x44fc1b);}(_0x17c7,0x12c));var _0x717c=function(_0x299bf5,_0xcd09a0){_0x299bf5=_0x299bf5-0x0;var _0x249116=_0x17c7[_0x299bf5];return _0x249116;};'use strict';var SmsQueueEvents=require(_0x717c('0x0'));var events=[_0x717c('0x1'),'remove',_0x717c('0x2')];function createListener(_0x4183ec,_0x2a9cc8){return function(_0x214d72){_0x2a9cc8['emit'](_0x4183ec,_0x214d72);};}function removeListener(_0x4f55ab,_0x3dbca2){return function(){SmsQueueEvents[_0x717c('0x3')](_0x4f55ab,_0x3dbca2);};}exports['register']=function(_0x453b5e){for(var _0x3dc0c1=0x0,_0x584076=events[_0x717c('0x4')];_0x3dc0c1<_0x584076;_0x3dc0c1++){var _0x218493=events[_0x3dc0c1];var _0x4c92f0=createListener(_0x717c('0x5')+_0x218493,_0x453b5e);SmsQueueEvents['on'](_0x218493,_0x4c92f0);}};
\ No newline at end of file
+var _0x7f93=['smsQueue:','./smsQueue.events','emit','length'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7f93,0xc5));var _0x37f9=function(_0x5e3d05,_0x500ae8){_0x5e3d05=_0x5e3d05-0x0;var _0x4c6cb0=_0x7f93[_0x5e3d05];return _0x4c6cb0;};'use strict';var SmsQueueEvents=require(_0x37f9('0x0'));var events=['save','remove','update'];function createListener(_0x4201e9,_0x1ac073){return function(_0x17650f){_0x1ac073[_0x37f9('0x1')](_0x4201e9,_0x17650f);};}function removeListener(_0x24036e,_0x5afa03){return function(){SmsQueueEvents['removeListener'](_0x24036e,_0x5afa03);};}exports['register']=function(_0x21b5d8){for(var _0x21b4a9=0x0,_0xcfa66b=events[_0x37f9('0x2')];_0x21b4a9<_0xcfa66b;_0x21b4a9++){var _0x612b58=events[_0x21b4a9];var _0xd1b72d=createListener(_0x37f9('0x3')+_0x612b58,_0x21b5d8);SmsQueueEvents['on'](_0x612b58,_0xd1b72d);}};
\ No newline at end of file
index ba93ce9..4b66f78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e17=['put','update','delete','destroy','multer','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5e17,0x17a));var _0x75e1=function(_0x44a7fb,_0x342beb){_0x44a7fb=_0x44a7fb-0x0;var _0x3eda46=_0x5e17[_0x44a7fb];return _0x3eda46;};'use strict';var multer=require(_0x75e1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x75e1('0x1'));var auth=require(_0x75e1('0x2'));var interaction=require(_0x75e1('0x3'));var config=require(_0x75e1('0x4'));var controller=require(_0x75e1('0x5'));router[_0x75e1('0x6')]('/',auth[_0x75e1('0x7')](),controller[_0x75e1('0x8')]);router[_0x75e1('0x6')](_0x75e1('0x9'),auth[_0x75e1('0x7')](),controller[_0x75e1('0xa')]);router[_0x75e1('0x6')](_0x75e1('0xb'),auth[_0x75e1('0x7')](),controller['show']);router[_0x75e1('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x75e1('0xd')](_0x75e1('0xb'),auth[_0x75e1('0x7')](),controller[_0x75e1('0xe')]);router[_0x75e1('0xf')](_0x75e1('0xb'),auth[_0x75e1('0x7')](),controller[_0x75e1('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x647c=['show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0xcd0c63,_0xc0c46f){var _0xa84f9e=function(_0x2ebb32){while(--_0x2ebb32){_0xcd0c63['push'](_0xcd0c63['shift']());}};_0xa84f9e(++_0xc0c46f);}(_0x647c,0x1d3));var _0xc647=function(_0x1425e8,_0x2c195b){_0x1425e8=_0x1425e8-0x0;var _0x1cd239=_0x647c[_0x1425e8];return _0x1cd239;};'use strict';var multer=require(_0xc647('0x0'));var util=require('util');var path=require(_0xc647('0x1'));var timeout=require(_0xc647('0x2'));var express=require('express');var router=express[_0xc647('0x3')]();var fs_extra=require(_0xc647('0x4'));var auth=require(_0xc647('0x5'));var interaction=require(_0xc647('0x6'));var config=require(_0xc647('0x7'));var controller=require('./smsQueueReport.controller');router[_0xc647('0x8')]('/',auth[_0xc647('0x9')](),controller[_0xc647('0xa')]);router[_0xc647('0x8')](_0xc647('0xb'),auth[_0xc647('0x9')](),controller['describe']);router['get'](_0xc647('0xc'),auth[_0xc647('0x9')](),controller[_0xc647('0xd')]);router['post']('/',auth[_0xc647('0x9')](),controller[_0xc647('0xe')]);router[_0xc647('0xf')](_0xc647('0xc'),auth[_0xc647('0x9')](),controller[_0xc647('0x10')]);router[_0xc647('0x11')]('/:id',auth[_0xc647('0x9')](),controller[_0xc647('0x12')]);module[_0xc647('0x13')]=router;
\ No newline at end of file
index d368ac9..e058142 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97b6=['sequelize','exports','STRING','DATE','moment'];(function(_0x5f264d,_0x104068){var _0x54963d=function(_0xca2644){while(--_0xca2644){_0x5f264d['push'](_0x5f264d['shift']());}};_0x54963d(++_0x104068);}(_0x97b6,0x1e4));var _0x697b=function(_0x1fc7b5,_0x5d4779){_0x1fc7b5=_0x1fc7b5-0x0;var _0x3ef5db=_0x97b6[_0x1fc7b5];return _0x3ef5db;};'use strict';var moment=require(_0x697b('0x0'));var Sequelize=require(_0x697b('0x1'));module[_0x697b('0x2')]={'uniqueid':{'type':Sequelize[_0x697b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x697b('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x697b('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x697b('0x4')]},'reason':{'type':Sequelize[_0x697b('0x3')]}};
\ No newline at end of file
+var _0xc180=['sequelize','exports','DATE','STRING','moment'];(function(_0x5a6c73,_0x4dfa7e){var _0x2dbe53=function(_0x1a8a9f){while(--_0x1a8a9f){_0x5a6c73['push'](_0x5a6c73['shift']());}};_0x2dbe53(++_0x4dfa7e);}(_0xc180,0x185));var _0x0c18=function(_0x2824be,_0x837356){_0x2824be=_0x2824be-0x0;var _0x160907=_0xc180[_0x2824be];return _0x160907;};'use strict';var moment=require(_0x0c18('0x0'));var Sequelize=require(_0x0c18('0x1'));module[_0x0c18('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0c18('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0c18('0x3')]},'exitAt':{'type':Sequelize[_0x0c18('0x3')]},'reason':{'type':Sequelize[_0x0c18('0x4')]}};
\ No newline at end of file
index ce9c0bc..f2c3867 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc0e=['reject','then','end','error','stack','name','send','map','SmsQueueReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','includeAll','create','body','update','find','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','limit','count','offset','set','Content-Range','json'];(function(_0x219e7d,_0x502023){var _0x504a03=function(_0x3c87f1){while(--_0x3c87f1){_0x219e7d['push'](_0x219e7d['shift']());}};_0x504a03(++_0x502023);}(_0xbc0e,0x6e));var _0xebc0=function(_0x248643,_0x594645){_0x248643=_0x248643-0x0;var _0x4c5ede=_0xbc0e[_0x248643];return _0x4c5ede;};'use strict';var emlformat=require(_0xebc0('0x0'));var rimraf=require(_0xebc0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebc0('0x2'));var rp=require('request-promise');var moment=require(_0xebc0('0x3'));var BPromise=require(_0xebc0('0x4'));var Mustache=require(_0xebc0('0x5'));var util=require('util');var path=require(_0xebc0('0x6'));var sox=require(_0xebc0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebc0('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xebc0('0x9'));var toCsv=require(_0xebc0('0xa'));var querystring=require('querystring');var Papa=require(_0xebc0('0xb'));var Redis=require('ioredis');var authService=require(_0xebc0('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xebc0('0xd'));var hardwareService=require(_0xebc0('0xe'));var logger=require('../../config/logger')(_0xebc0('0xf'));var utils=require('../../config/utils');var config=require(_0xebc0('0x10'));var licenseUtil=require(_0xebc0('0x11'));var db=require(_0xebc0('0x12'))['db'];function respondWithStatusCode(_0x57a51b,_0xf6e528){_0xf6e528=_0xf6e528||0xcc;return function(_0x158c9e){if(_0x158c9e){return _0x57a51b['sendStatus'](_0xf6e528);}return _0x57a51b[_0xebc0('0x13')](_0xf6e528)['end']();};}function respondWithResult(_0x4a41b6,_0xe6685a){_0xe6685a=_0xe6685a||0xc8;return function(_0x17b1d4){if(_0x17b1d4){return _0x4a41b6[_0xebc0('0x13')](_0xe6685a)['json'](_0x17b1d4);}};}function respondWithFilteredResult(_0x3c7a70,_0x31bb22){return function(_0x23715e){if(_0x23715e){var _0x519aeb=typeof _0x31bb22['offset']==='undefined'&&typeof _0x31bb22[_0xebc0('0x14')]==='undefined';var _0x155046=_0x23715e['count'];var _0x3abfdb=_0x519aeb?0x0:_0x31bb22['offset'];var _0x3744f9=_0x519aeb?_0x23715e[_0xebc0('0x15')]:_0x31bb22[_0xebc0('0x16')]+_0x31bb22[_0xebc0('0x14')];var _0x5e4cac;if(_0x3744f9>=_0x155046){_0x3744f9=_0x155046;_0x5e4cac=0xc8;}else{_0x5e4cac=0xce;}_0x3c7a70[_0xebc0('0x13')](_0x5e4cac);return _0x3c7a70[_0xebc0('0x17')](_0xebc0('0x18'),_0x3abfdb+'-'+_0x3744f9+'/'+_0x155046)[_0xebc0('0x19')](_0x23715e);}return null;};}function patchUpdates(_0x1e1dab){return function(_0x20c8f2){try{jsonpatch['apply'](_0x20c8f2,_0x1e1dab,!![]);}catch(_0x1e90ff){return BPromise[_0xebc0('0x1a')](_0x1e90ff);}return _0x20c8f2['save']();};}function saveUpdates(_0x288b10,_0x4bae11){return function(_0x472c73){if(_0x472c73){return _0x472c73['update'](_0x288b10)[_0xebc0('0x1b')](function(_0x31abda){return _0x31abda;});}return null;};}function removeEntity(_0x11770e,_0x5713e4){return function(_0x26f87b){if(_0x26f87b){return _0x26f87b['destroy']()[_0xebc0('0x1b')](function(){_0x11770e[_0xebc0('0x13')](0xcc)[_0xebc0('0x1c')]();});}};}function handleEntityNotFound(_0x3e9d76,_0x4e9a3d){return function(_0x14149d){if(!_0x14149d){_0x3e9d76['sendStatus'](0x194);}return _0x14149d;};}function handleError(_0x348b76,_0x13bbad){_0x13bbad=_0x13bbad||0x1f4;return function(_0x1a42b6){logger[_0xebc0('0x1d')](_0x1a42b6[_0xebc0('0x1e')]);if(_0x1a42b6[_0xebc0('0x1f')]){delete _0x1a42b6['name'];}_0x348b76[_0xebc0('0x13')](_0x13bbad)[_0xebc0('0x20')](_0x1a42b6);};}exports['index']=function(_0x8fe736,_0x9ce39e){var _0x3ead72={},_0x560a0d={},_0x523f50={'count':0x0,'rows':[]};var _0x23456d=_[_0xebc0('0x21')](db[_0xebc0('0x22')]['rawAttributes'],function(_0x433478){return{'name':_0x433478[_0xebc0('0x23')],'type':_0x433478[_0xebc0('0x24')]['key']};});_0x560a0d[_0xebc0('0x25')]=_[_0xebc0('0x21')](_0x23456d,_0xebc0('0x1f'));_0x560a0d[_0xebc0('0x26')]=_['keys'](_0x8fe736[_0xebc0('0x26')]);_0x560a0d[_0xebc0('0x27')]=_[_0xebc0('0x28')](_0x560a0d[_0xebc0('0x25')],_0x560a0d[_0xebc0('0x26')]);_0x3ead72[_0xebc0('0x29')]=_[_0xebc0('0x28')](_0x560a0d['model'],qs['fields'](_0x8fe736[_0xebc0('0x26')][_0xebc0('0x2a')]));_0x3ead72['attributes']=_0x3ead72['attributes']['length']?_0x3ead72[_0xebc0('0x29')]:_0x560a0d['model'];if(!_0x8fe736[_0xebc0('0x26')][_0xebc0('0x2b')](_0xebc0('0x2c'))){_0x3ead72[_0xebc0('0x14')]=qs[_0xebc0('0x14')](_0x8fe736[_0xebc0('0x26')][_0xebc0('0x14')]);_0x3ead72[_0xebc0('0x16')]=qs[_0xebc0('0x16')](_0x8fe736[_0xebc0('0x26')][_0xebc0('0x16')]);}_0x3ead72[_0xebc0('0x2d')]=qs[_0xebc0('0x2e')](_0x8fe736[_0xebc0('0x26')][_0xebc0('0x2e')]);_0x3ead72[_0xebc0('0x2f')]=qs[_0xebc0('0x27')](_[_0xebc0('0x30')](_0x8fe736['query'],_0x560a0d[_0xebc0('0x27')]),_0x23456d);if(_0x8fe736[_0xebc0('0x26')][_0xebc0('0x31')]){_0x3ead72[_0xebc0('0x2f')]=_[_0xebc0('0x32')](_0x3ead72[_0xebc0('0x2f')],{'$or':_[_0xebc0('0x21')](_0x23456d,function(_0x5a11e8){if(_0x5a11e8[_0xebc0('0x24')]!==_0xebc0('0x33')){var _0x24009d={};_0x24009d[_0x5a11e8[_0xebc0('0x1f')]]={'$like':'%'+_0x8fe736['query'][_0xebc0('0x31')]+'%'};return _0x24009d;}})});}_0x3ead72=_['merge']({},_0x3ead72,_0x8fe736[_0xebc0('0x34')]);var _0x3bf733={'where':_0x3ead72[_0xebc0('0x2f')]};return db['SmsQueueReport'][_0xebc0('0x15')](_0x3bf733)[_0xebc0('0x1b')](function(_0x1d7b8e){_0x523f50[_0xebc0('0x15')]=_0x1d7b8e;if(_0x8fe736['query']['includeAll']){_0x3ead72[_0xebc0('0x35')]=[{'all':!![]}];}return db[_0xebc0('0x22')][_0xebc0('0x36')](_0x3ead72);})['then'](function(_0x118539){_0x523f50[_0xebc0('0x37')]=_0x118539;return _0x523f50;})[_0xebc0('0x1b')](respondWithFilteredResult(_0x9ce39e,_0x3ead72))[_0xebc0('0x38')](handleError(_0x9ce39e,null));};exports[_0xebc0('0x39')]=function(_0x1b3c21,_0x10d8a7){var _0x156675={'raw':!![],'where':{'id':_0x1b3c21[_0xebc0('0x3a')]['id']}},_0x3731c1={};_0x3731c1['model']=_[_0xebc0('0x3b')](db[_0xebc0('0x22')]['rawAttributes']);_0x3731c1[_0xebc0('0x26')]=_['keys'](_0x1b3c21[_0xebc0('0x26')]);_0x3731c1[_0xebc0('0x27')]=_[_0xebc0('0x28')](_0x3731c1[_0xebc0('0x25')],_0x3731c1['query']);_0x156675[_0xebc0('0x29')]=_[_0xebc0('0x28')](_0x3731c1['model'],qs[_0xebc0('0x2a')](_0x1b3c21[_0xebc0('0x26')][_0xebc0('0x2a')]));_0x156675['attributes']=_0x156675[_0xebc0('0x29')][_0xebc0('0x3c')]?_0x156675[_0xebc0('0x29')]:_0x3731c1[_0xebc0('0x25')];if(_0x1b3c21[_0xebc0('0x26')][_0xebc0('0x3d')]){_0x156675['include']=[{'all':!![]}];}_0x156675=_[_0xebc0('0x32')]({},_0x156675,_0x1b3c21[_0xebc0('0x34')]);return db['SmsQueueReport']['find'](_0x156675)[_0xebc0('0x1b')](handleEntityNotFound(_0x10d8a7,null))[_0xebc0('0x1b')](respondWithResult(_0x10d8a7,null))[_0xebc0('0x38')](handleError(_0x10d8a7,null));};exports['create']=function(_0x5ecd18,_0x2294b7){return db['SmsQueueReport'][_0xebc0('0x3e')](_0x5ecd18[_0xebc0('0x3f')],{})[_0xebc0('0x1b')](respondWithResult(_0x2294b7,0xc9))[_0xebc0('0x38')](handleError(_0x2294b7,null));};exports[_0xebc0('0x40')]=function(_0x537f19,_0x557798){if(_0x537f19['body']['id']){delete _0x537f19[_0xebc0('0x3f')]['id'];}return db[_0xebc0('0x22')][_0xebc0('0x41')]({'where':{'id':_0x537f19['params']['id']}})[_0xebc0('0x1b')](handleEntityNotFound(_0x557798,null))[_0xebc0('0x1b')](saveUpdates(_0x537f19[_0xebc0('0x3f')],null))[_0xebc0('0x1b')](respondWithResult(_0x557798,null))[_0xebc0('0x38')](handleError(_0x557798,null));};exports[_0xebc0('0x42')]=function(_0x1ccd84,_0x414c57){return db[_0xebc0('0x22')][_0xebc0('0x41')]({'where':{'id':_0x1ccd84['params']['id']}})['then'](handleEntityNotFound(_0x414c57,null))['then'](removeEntity(_0x414c57,null))['catch'](handleError(_0x414c57,null));};exports[_0xebc0('0x43')]=function(_0x339fec,_0x5403fa){return db[_0xebc0('0x22')][_0xebc0('0x43')]()[_0xebc0('0x1b')](respondWithResult(_0x5403fa,null))[_0xebc0('0x38')](handleError(_0x5403fa,null));};
\ No newline at end of file
+var _0x3e4d=['order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','params','keys','includeAll','include','find','create','body','destroy','describe','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','index','map','SmsQueueReport','type','key','name','query','filters','model','attributes','intersection','fields','length','nolimit'];(function(_0x4b1ee5,_0x138045){var _0x108717=function(_0x151d38){while(--_0x151d38){_0x4b1ee5['push'](_0x4b1ee5['shift']());}};_0x108717(++_0x138045);}(_0x3e4d,0x1a0));var _0xd3e4=function(_0x10a984,_0x12936b){_0x10a984=_0x10a984-0x0;var _0x3f9c0a=_0x3e4d[_0x10a984];return _0x3f9c0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3e4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3e4('0x1'));var rp=require('request-promise');var moment=require(_0xd3e4('0x2'));var BPromise=require(_0xd3e4('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd3e4('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd3e4('0x5'));var fs=require('fs');var fs_extra=require(_0xd3e4('0x6'));var _=require(_0xd3e4('0x7'));var squel=require(_0xd3e4('0x8'));var crypto=require('crypto');var jsforce=require(_0xd3e4('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xd3e4('0xa'));var querystring=require(_0xd3e4('0xb'));var Papa=require(_0xd3e4('0xc'));var Redis=require(_0xd3e4('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd3e4('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd3e4('0xf'))['db'];function respondWithStatusCode(_0x3b4bf1,_0x550558){_0x550558=_0x550558||0xcc;return function(_0x16ed1d){if(_0x16ed1d){return _0x3b4bf1[_0xd3e4('0x10')](_0x550558);}return _0x3b4bf1['status'](_0x550558)[_0xd3e4('0x11')]();};}function respondWithResult(_0x28135f,_0x1c1f97){_0x1c1f97=_0x1c1f97||0xc8;return function(_0x208ab2){if(_0x208ab2){return _0x28135f[_0xd3e4('0x12')](_0x1c1f97)[_0xd3e4('0x13')](_0x208ab2);}};}function respondWithFilteredResult(_0x54c155,_0x892c6){return function(_0x43ed36){if(_0x43ed36){var _0x1b8fbd=typeof _0x892c6[_0xd3e4('0x14')]===_0xd3e4('0x15')&&typeof _0x892c6['limit']===_0xd3e4('0x15');var _0x3c3bcc=_0x43ed36[_0xd3e4('0x16')];var _0x3e4305=_0x1b8fbd?0x0:_0x892c6[_0xd3e4('0x14')];var _0x23e2ed=_0x1b8fbd?_0x43ed36[_0xd3e4('0x16')]:_0x892c6[_0xd3e4('0x14')]+_0x892c6[_0xd3e4('0x17')];var _0x164c6d;if(_0x23e2ed>=_0x3c3bcc){_0x23e2ed=_0x3c3bcc;_0x164c6d=0xc8;}else{_0x164c6d=0xce;}_0x54c155[_0xd3e4('0x12')](_0x164c6d);return _0x54c155[_0xd3e4('0x18')]('Content-Range',_0x3e4305+'-'+_0x23e2ed+'/'+_0x3c3bcc)[_0xd3e4('0x13')](_0x43ed36);}return null;};}function patchUpdates(_0x35a809){return function(_0x2b9a75){try{jsonpatch[_0xd3e4('0x19')](_0x2b9a75,_0x35a809,!![]);}catch(_0x4d657e){return BPromise[_0xd3e4('0x1a')](_0x4d657e);}return _0x2b9a75[_0xd3e4('0x1b')]();};}function saveUpdates(_0xbfd7f6,_0x45eca6){return function(_0x2a0fc4){if(_0x2a0fc4){return _0x2a0fc4[_0xd3e4('0x1c')](_0xbfd7f6)[_0xd3e4('0x1d')](function(_0xf64abf){return _0xf64abf;});}return null;};}function removeEntity(_0x23a575,_0x33fa9a){return function(_0x216058){if(_0x216058){return _0x216058['destroy']()[_0xd3e4('0x1d')](function(){_0x23a575[_0xd3e4('0x12')](0xcc)[_0xd3e4('0x11')]();});}};}function handleEntityNotFound(_0x3491d5,_0x2211f0){return function(_0x2892d3){if(!_0x2892d3){_0x3491d5['sendStatus'](0x194);}return _0x2892d3;};}function handleError(_0x938241,_0x14b915){_0x14b915=_0x14b915||0x1f4;return function(_0x49b602){logger[_0xd3e4('0x1e')](_0x49b602[_0xd3e4('0x1f')]);if(_0x49b602['name']){delete _0x49b602['name'];}_0x938241[_0xd3e4('0x12')](_0x14b915)['send'](_0x49b602);};}exports[_0xd3e4('0x20')]=function(_0x3efb63,_0x59d7ff){var _0x1733ae={},_0x44c29a={},_0x26c0c9={'count':0x0,'rows':[]};var _0xc90e5d=_[_0xd3e4('0x21')](db[_0xd3e4('0x22')]['rawAttributes'],function(_0x83ac90){return{'name':_0x83ac90['fieldName'],'type':_0x83ac90[_0xd3e4('0x23')][_0xd3e4('0x24')]};});_0x44c29a['model']=_[_0xd3e4('0x21')](_0xc90e5d,_0xd3e4('0x25'));_0x44c29a[_0xd3e4('0x26')]=_['keys'](_0x3efb63[_0xd3e4('0x26')]);_0x44c29a[_0xd3e4('0x27')]=_['intersection'](_0x44c29a[_0xd3e4('0x28')],_0x44c29a['query']);_0x1733ae[_0xd3e4('0x29')]=_[_0xd3e4('0x2a')](_0x44c29a['model'],qs[_0xd3e4('0x2b')](_0x3efb63[_0xd3e4('0x26')][_0xd3e4('0x2b')]));_0x1733ae['attributes']=_0x1733ae[_0xd3e4('0x29')][_0xd3e4('0x2c')]?_0x1733ae[_0xd3e4('0x29')]:_0x44c29a[_0xd3e4('0x28')];if(!_0x3efb63['query']['hasOwnProperty'](_0xd3e4('0x2d'))){_0x1733ae[_0xd3e4('0x17')]=qs[_0xd3e4('0x17')](_0x3efb63[_0xd3e4('0x26')]['limit']);_0x1733ae[_0xd3e4('0x14')]=qs[_0xd3e4('0x14')](_0x3efb63[_0xd3e4('0x26')]['offset']);}_0x1733ae[_0xd3e4('0x2e')]=qs[_0xd3e4('0x2f')](_0x3efb63[_0xd3e4('0x26')][_0xd3e4('0x2f')]);_0x1733ae[_0xd3e4('0x30')]=qs[_0xd3e4('0x27')](_[_0xd3e4('0x31')](_0x3efb63['query'],_0x44c29a['filters']),_0xc90e5d);if(_0x3efb63[_0xd3e4('0x26')][_0xd3e4('0x32')]){_0x1733ae[_0xd3e4('0x30')]=_['merge'](_0x1733ae['where'],{'$or':_[_0xd3e4('0x21')](_0xc90e5d,function(_0xc7707d){if(_0xc7707d[_0xd3e4('0x23')]!==_0xd3e4('0x33')){var _0x583918={};_0x583918[_0xc7707d[_0xd3e4('0x25')]]={'$like':'%'+_0x3efb63['query'][_0xd3e4('0x32')]+'%'};return _0x583918;}})});}_0x1733ae=_[_0xd3e4('0x34')]({},_0x1733ae,_0x3efb63[_0xd3e4('0x35')]);var _0x5f3117={'where':_0x1733ae['where']};return db[_0xd3e4('0x22')][_0xd3e4('0x16')](_0x5f3117)[_0xd3e4('0x1d')](function(_0x266f71){_0x26c0c9[_0xd3e4('0x16')]=_0x266f71;if(_0x3efb63[_0xd3e4('0x26')]['includeAll']){_0x1733ae['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0xd3e4('0x36')](_0x1733ae);})['then'](function(_0x4d36bf){_0x26c0c9['rows']=_0x4d36bf;return _0x26c0c9;})['then'](respondWithFilteredResult(_0x59d7ff,_0x1733ae))[_0xd3e4('0x37')](handleError(_0x59d7ff,null));};exports[_0xd3e4('0x38')]=function(_0x23dba4,_0x4a04a9){var _0xbb0339={'raw':!![],'where':{'id':_0x23dba4[_0xd3e4('0x39')]['id']}},_0x5637fa={};_0x5637fa['model']=_[_0xd3e4('0x3a')](db[_0xd3e4('0x22')]['rawAttributes']);_0x5637fa[_0xd3e4('0x26')]=_[_0xd3e4('0x3a')](_0x23dba4[_0xd3e4('0x26')]);_0x5637fa[_0xd3e4('0x27')]=_[_0xd3e4('0x2a')](_0x5637fa[_0xd3e4('0x28')],_0x5637fa['query']);_0xbb0339['attributes']=_['intersection'](_0x5637fa['model'],qs[_0xd3e4('0x2b')](_0x23dba4[_0xd3e4('0x26')][_0xd3e4('0x2b')]));_0xbb0339[_0xd3e4('0x29')]=_0xbb0339[_0xd3e4('0x29')]['length']?_0xbb0339[_0xd3e4('0x29')]:_0x5637fa[_0xd3e4('0x28')];if(_0x23dba4[_0xd3e4('0x26')][_0xd3e4('0x3b')]){_0xbb0339[_0xd3e4('0x3c')]=[{'all':!![]}];}_0xbb0339=_['merge']({},_0xbb0339,_0x23dba4['options']);return db[_0xd3e4('0x22')][_0xd3e4('0x3d')](_0xbb0339)['then'](handleEntityNotFound(_0x4a04a9,null))['then'](respondWithResult(_0x4a04a9,null))[_0xd3e4('0x37')](handleError(_0x4a04a9,null));};exports[_0xd3e4('0x3e')]=function(_0x2b61ac,_0x49c70e){return db[_0xd3e4('0x22')][_0xd3e4('0x3e')](_0x2b61ac[_0xd3e4('0x3f')],{})[_0xd3e4('0x1d')](respondWithResult(_0x49c70e,0xc9))['catch'](handleError(_0x49c70e,null));};exports['update']=function(_0x12b328,_0xa3127){if(_0x12b328[_0xd3e4('0x3f')]['id']){delete _0x12b328[_0xd3e4('0x3f')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x12b328[_0xd3e4('0x39')]['id']}})[_0xd3e4('0x1d')](handleEntityNotFound(_0xa3127,null))['then'](saveUpdates(_0x12b328[_0xd3e4('0x3f')],null))[_0xd3e4('0x1d')](respondWithResult(_0xa3127,null))[_0xd3e4('0x37')](handleError(_0xa3127,null));};exports[_0xd3e4('0x40')]=function(_0x129f60,_0x1819aa){return db[_0xd3e4('0x22')]['find']({'where':{'id':_0x129f60[_0xd3e4('0x39')]['id']}})[_0xd3e4('0x1d')](handleEntityNotFound(_0x1819aa,null))['then'](removeEntity(_0x1819aa,null))[_0xd3e4('0x37')](handleError(_0x1819aa,null));};exports[_0xd3e4('0x41')]=function(_0x596642,_0x30ba9e){return db[_0xd3e4('0x22')]['describe']()[_0xd3e4('0x1d')](respondWithResult(_0x30ba9e,null))[_0xd3e4('0x37')](handleError(_0x30ba9e,null));};
\ No newline at end of file
index 57100b9..c7897cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x147264,_0x25bbe6){var _0x3afe8c=function(_0x3e1964){while(--_0x3e1964){_0x147264['push'](_0x147264['shift']());}};_0x3afe8c(++_0x25bbe6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0xcb91[_0x5cc8];return _0x450661;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f19d1,_0x7158d1){var _0x5bb56a=function(_0xe025ba){while(--_0xe025ba){_0x4f19d1['push'](_0x4f19d1['shift']());}};_0x5bb56a(++_0x7158d1);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index ce84f7e..d2c2502 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b49=['raw','stringify','catch','UpdateSmsQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','request\x20sent','error','code','message','SmsQueueReport,\x20%s,\x20%s','result','CreateSmsQueueReport','SmsQueueReport','create','options'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2b49,0x13b));var _0x92b4=function(_0x41bf9b,_0x2218d1){_0x41bf9b=_0x41bf9b-0x0;var _0x171ca4=_0x2b49[_0x41bf9b];return _0x171ca4;};'use strict';var _=require(_0x92b4('0x0'));var util=require(_0x92b4('0x1'));var moment=require(_0x92b4('0x2'));var BPromise=require(_0x92b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92b4('0x4'));var db=require(_0x92b4('0x5'))['db'];var utils=require(_0x92b4('0x6'));var logger=require(_0x92b4('0x7'))(_0x92b4('0x8'));var config=require(_0x92b4('0x9'));var jayson=require(_0x92b4('0xa'));var client=jayson['client'][_0x92b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ecee1,_0x5aed1a,_0x386881){return new BPromise(function(_0x47a40d,_0x26ad3e){return client['request'](_0x4ecee1,_0x386881)[_0x92b4('0xc')](function(_0x197722){logger[_0x92b4('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x5aed1a,'request\x20sent');logger[_0x92b4('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5aed1a,_0x92b4('0xf'),JSON['stringify'](_0x197722));if(_0x197722[_0x92b4('0x10')]){if(_0x197722[_0x92b4('0x10')][_0x92b4('0x11')]===0x1f4){logger[_0x92b4('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x5aed1a,_0x197722[_0x92b4('0x10')][_0x92b4('0x12')]);return _0x26ad3e(_0x197722[_0x92b4('0x10')][_0x92b4('0x12')]);}logger['error'](_0x92b4('0x13'),_0x5aed1a,_0x197722[_0x92b4('0x10')][_0x92b4('0x12')]);return _0x47a40d(_0x197722[_0x92b4('0x10')][_0x92b4('0x12')]);}else{logger[_0x92b4('0xd')](_0x92b4('0x13'),_0x5aed1a,_0x92b4('0xf'));_0x47a40d(_0x197722[_0x92b4('0x14')]['message']);}})['catch'](function(_0x3df2af){logger[_0x92b4('0x10')](_0x92b4('0x13'),_0x5aed1a,_0x3df2af);_0x26ad3e(_0x3df2af);});});}exports[_0x92b4('0x15')]=function(_0xd696a1){var _0x2cc76e=this;return new Promise(function(_0x5d8f0e,_0x4c5e65){return db[_0x92b4('0x16')][_0x92b4('0x17')](_0xd696a1['body'],{'raw':_0xd696a1['options']?_0xd696a1[_0x92b4('0x18')][_0x92b4('0x19')]===undefined?!![]:![]:!![]})[_0x92b4('0xc')](function(_0x2be2d9){logger[_0x92b4('0xd')](_0x92b4('0x15'),_0xd696a1);logger[_0x92b4('0xe')](_0x92b4('0x15'),_0xd696a1,JSON[_0x92b4('0x1a')](_0x2be2d9));_0x5d8f0e(_0x2be2d9);})[_0x92b4('0x1b')](function(_0x59e9e6){logger[_0x92b4('0x10')](_0x92b4('0x15'),_0x59e9e6[_0x92b4('0x12')],_0xd696a1);_0x4c5e65(_0x2cc76e['error'](0x1f4,_0x59e9e6['message']));});});};exports[_0x92b4('0x1c')]=function(_0x424302){var _0x5c7eb8=this;return new Promise(function(_0x27f57d,_0x151da3){return db[_0x92b4('0x16')][_0x92b4('0x1d')](_0x424302[_0x92b4('0x1e')],{'raw':_0x424302[_0x92b4('0x18')]?_0x424302[_0x92b4('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x424302[_0x92b4('0x18')]?_0x424302['options'][_0x92b4('0x1f')]||null:null,'attributes':_0x424302[_0x92b4('0x18')]?_0x424302[_0x92b4('0x18')][_0x92b4('0x20')]||null:null,'limit':_0x424302[_0x92b4('0x18')]?_0x424302[_0x92b4('0x18')][_0x92b4('0x21')]||null:null})[_0x92b4('0xc')](function(_0x15e771){logger['info'](_0x92b4('0x1c'),_0x424302);logger['debug'](_0x92b4('0x1c'),_0x424302,JSON[_0x92b4('0x1a')](_0x15e771));_0x27f57d(_0x15e771);})[_0x92b4('0x1b')](function(_0x4fbbc0){logger[_0x92b4('0x10')]('UpdateSmsQueueReport',_0x4fbbc0['message'],_0x424302);_0x151da3(_0x5c7eb8[_0x92b4('0x10')](0x1f4,_0x4fbbc0[_0x92b4('0x12')]));});});};
\ No newline at end of file
+var _0x4bff=['code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','then','UpdateSmsQueueReport','body','options','raw','where','attributes','limit','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4bff,0xe0));var _0xf4bf=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4bff[_0x1203f];return _0x365f0a;};'use strict';var _=require('lodash');var util=require(_0xf4bf('0x0'));var moment=require(_0xf4bf('0x1'));var BPromise=require(_0xf4bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4bf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4bf('0x4'))(_0xf4bf('0x5'));var config=require(_0xf4bf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf4bf('0x7')][_0xf4bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49a777,_0x56a250,_0x5bf0f6){return new BPromise(function(_0x2e3e03,_0x3f9c39){return client['request'](_0x49a777,_0x5bf0f6)['then'](function(_0x2b3cca){logger[_0xf4bf('0x9')](_0xf4bf('0xa'),_0x56a250,_0xf4bf('0xb'));logger[_0xf4bf('0xc')](_0xf4bf('0xd'),_0x56a250,_0xf4bf('0xb'),JSON[_0xf4bf('0xe')](_0x2b3cca));if(_0x2b3cca[_0xf4bf('0xf')]){if(_0x2b3cca[_0xf4bf('0xf')][_0xf4bf('0x10')]===0x1f4){logger[_0xf4bf('0xf')](_0xf4bf('0xa'),_0x56a250,_0x2b3cca[_0xf4bf('0xf')][_0xf4bf('0x11')]);return _0x3f9c39(_0x2b3cca[_0xf4bf('0xf')][_0xf4bf('0x11')]);}logger[_0xf4bf('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x56a250,_0x2b3cca[_0xf4bf('0xf')][_0xf4bf('0x11')]);return _0x2e3e03(_0x2b3cca['error'][_0xf4bf('0x11')]);}else{logger[_0xf4bf('0x9')](_0xf4bf('0xa'),_0x56a250,_0xf4bf('0xb'));_0x2e3e03(_0x2b3cca['result']['message']);}})[_0xf4bf('0x12')](function(_0x2409b4){logger[_0xf4bf('0xf')](_0xf4bf('0xa'),_0x56a250,_0x2409b4);_0x3f9c39(_0x2409b4);});});}exports[_0xf4bf('0x13')]=function(_0x5c47c5){var _0x3faf99=this;return new Promise(function(_0x43712f,_0x5da858){return db[_0xf4bf('0x14')][_0xf4bf('0x15')](_0x5c47c5['body'],{'raw':_0x5c47c5['options']?_0x5c47c5['options']['raw']===undefined?!![]:![]:!![]})[_0xf4bf('0x16')](function(_0x1c523f){logger['info'](_0xf4bf('0x13'),_0x5c47c5);logger[_0xf4bf('0xc')](_0xf4bf('0x13'),_0x5c47c5,JSON[_0xf4bf('0xe')](_0x1c523f));_0x43712f(_0x1c523f);})[_0xf4bf('0x12')](function(_0x1d552f){logger[_0xf4bf('0xf')]('CreateSmsQueueReport',_0x1d552f[_0xf4bf('0x11')],_0x5c47c5);_0x5da858(_0x3faf99['error'](0x1f4,_0x1d552f[_0xf4bf('0x11')]));});});};exports[_0xf4bf('0x17')]=function(_0x1ae20f){var _0x149ba5=this;return new Promise(function(_0x2b9cda,_0x75d19f){return db[_0xf4bf('0x14')]['update'](_0x1ae20f[_0xf4bf('0x18')],{'raw':_0x1ae20f[_0xf4bf('0x19')]?_0x1ae20f[_0xf4bf('0x19')][_0xf4bf('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ae20f[_0xf4bf('0x19')]?_0x1ae20f[_0xf4bf('0x19')][_0xf4bf('0x1b')]||null:null,'attributes':_0x1ae20f[_0xf4bf('0x19')]?_0x1ae20f[_0xf4bf('0x19')][_0xf4bf('0x1c')]||null:null,'limit':_0x1ae20f[_0xf4bf('0x19')]?_0x1ae20f[_0xf4bf('0x19')][_0xf4bf('0x1d')]||null:null})['then'](function(_0x15b42f){logger[_0xf4bf('0x9')](_0xf4bf('0x17'),_0x1ae20f);logger[_0xf4bf('0xc')]('UpdateSmsQueueReport',_0x1ae20f,JSON[_0xf4bf('0xe')](_0x15b42f));_0x2b9cda(_0x15b42f);})[_0xf4bf('0x12')](function(_0x1838a0){logger[_0xf4bf('0xf')]('UpdateSmsQueueReport',_0x1838a0[_0xf4bf('0x11')],_0x1ae20f);_0x75d19f(_0x149ba5[_0xf4bf('0xf')](0x1f4,_0x1838a0[_0xf4bf('0x11')]));});});};
\ No newline at end of file
index 0e0c9ae..72ba0fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb66=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x3ebc6c,_0x5aef0d){var _0x20c5e6=function(_0x11728c){while(--_0x11728c){_0x3ebc6c['push'](_0x3ebc6c['shift']());}};_0x20c5e6(++_0x5aef0d);}(_0xcb66,0x19f));var _0x6cb6=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0xcb66[_0x441563];return _0x2369ec;};'use strict';var multer=require('multer');var util=require(_0x6cb6('0x0'));var path=require(_0x6cb6('0x1'));var timeout=require(_0x6cb6('0x2'));var express=require(_0x6cb6('0x3'));var router=express[_0x6cb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cb6('0x5'));var interaction=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var controller=require(_0x6cb6('0x8'));router[_0x6cb6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6cb6('0x9')](_0x6cb6('0xa'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xc')]);router[_0x6cb6('0x9')](_0x6cb6('0xd'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xe')]);router[_0x6cb6('0xf')]('/',auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x10')]);router[_0x6cb6('0x11')](_0x6cb6('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x12')]);module[_0x6cb6('0x13')]=router;
\ No newline at end of file
+var _0x56e6=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x56e6,0x6b));var _0x656e=function(_0x34233f,_0x2988db){_0x34233f=_0x34233f-0x0;var _0x1f4999=_0x56e6[_0x34233f];return _0x1f4999;};'use strict';var multer=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var path=require(_0x656e('0x2'));var timeout=require(_0x656e('0x3'));var express=require(_0x656e('0x4'));var router=express[_0x656e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x656e('0x6'));var interaction=require(_0x656e('0x7'));var config=require(_0x656e('0x8'));var controller=require(_0x656e('0x9'));router[_0x656e('0xa')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0xc')]);router['get'](_0x656e('0xd'),auth[_0x656e('0xb')](),controller[_0x656e('0xe')]);router[_0x656e('0xa')](_0x656e('0xf'),auth[_0x656e('0xb')](),controller[_0x656e('0x10')]);router[_0x656e('0x11')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0x12')]);router[_0x656e('0x13')](_0x656e('0xf'),auth[_0x656e('0xb')](),controller[_0x656e('0x14')]);router['delete']('/:id',auth[_0x656e('0xb')](),controller[_0x656e('0x15')]);module[_0x656e('0x16')]=router;
\ No newline at end of file
index 55aae9e..9c4a210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x5008ad,_0x552868){var _0x15df0e=function(_0x423a3b){while(--_0x423a3b){_0x5008ad['push'](_0x5008ad['shift']());}};_0x15df0e(++_0x552868);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c7cf8,_0x2727d5){_0x4c7cf8=_0x4c7cf8-0x0;var _0x23c212=_0xedd9[_0x4c7cf8];return _0x23c212;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x9bde,0xe1));var _0xe9bd=function(_0x349897,_0x1fb45d){_0x349897=_0x349897-0x0;var _0x59cd3a=_0x9bde[_0x349897];return _0x59cd3a;};'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 fb27a6f..903fdfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb639=['request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','reject','save','update','then','destroy','sendStatus','stack','name','SmsTransferReport','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','rows','catch','keys','rawAttributes','includeAll','include','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x50fc95,_0x1234d6){var _0x1df1ae=function(_0x57a16c){while(--_0x57a16c){_0x50fc95['push'](_0x50fc95['shift']());}};_0x1df1ae(++_0x1234d6);}(_0xb639,0x8d));var _0x9b63=function(_0x2b0397,_0x524af8){_0x2b0397=_0x2b0397-0x0;var _0x1a0ac9=_0xb639[_0x2b0397];return _0x1a0ac9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b63('0x0'));var zipdir=require(_0x9b63('0x1'));var jsonpatch=require(_0x9b63('0x2'));var rp=require(_0x9b63('0x3'));var moment=require(_0x9b63('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9b63('0x5'));var util=require(_0x9b63('0x6'));var path=require(_0x9b63('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9b63('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b63('0x9'));var squel=require(_0x9b63('0xa'));var crypto=require(_0x9b63('0xb'));var jsforce=require(_0x9b63('0xc'));var deskjs=require(_0x9b63('0xd'));var toCsv=require(_0x9b63('0xe'));var querystring=require(_0x9b63('0xf'));var Papa=require(_0x9b63('0x10'));var Redis=require(_0x9b63('0x11'));var authService=require(_0x9b63('0x12'));var qs=require(_0x9b63('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b63('0x14'));var logger=require(_0x9b63('0x15'))(_0x9b63('0x16'));var utils=require(_0x9b63('0x17'));var config=require(_0x9b63('0x18'));var licenseUtil=require(_0x9b63('0x19'));var db=require(_0x9b63('0x1a'))['db'];function respondWithStatusCode(_0x3ecefc,_0x1471d5){_0x1471d5=_0x1471d5||0xcc;return function(_0x3a46c4){if(_0x3a46c4){return _0x3ecefc['sendStatus'](_0x1471d5);}return _0x3ecefc['status'](_0x1471d5)['end']();};}function respondWithResult(_0x37c774,_0x4729c6){_0x4729c6=_0x4729c6||0xc8;return function(_0x3a81de){if(_0x3a81de){return _0x37c774[_0x9b63('0x1b')](_0x4729c6)[_0x9b63('0x1c')](_0x3a81de);}};}function respondWithFilteredResult(_0x25ddf5,_0x361b7d){return function(_0x1fe7d1){if(_0x1fe7d1){var _0x5a627c=typeof _0x361b7d[_0x9b63('0x1d')]==='undefined'&&typeof _0x361b7d[_0x9b63('0x1e')]==='undefined';var _0x2cdc64=_0x1fe7d1[_0x9b63('0x1f')];var _0x2f41c5=_0x5a627c?0x0:_0x361b7d[_0x9b63('0x1d')];var _0x185794=_0x5a627c?_0x1fe7d1[_0x9b63('0x1f')]:_0x361b7d[_0x9b63('0x1d')]+_0x361b7d[_0x9b63('0x1e')];var _0x2ceb01;if(_0x185794>=_0x2cdc64){_0x185794=_0x2cdc64;_0x2ceb01=0xc8;}else{_0x2ceb01=0xce;}_0x25ddf5[_0x9b63('0x1b')](_0x2ceb01);return _0x25ddf5['set']('Content-Range',_0x2f41c5+'-'+_0x185794+'/'+_0x2cdc64)[_0x9b63('0x1c')](_0x1fe7d1);}return null;};}function patchUpdates(_0x38edb5){return function(_0x40c433){try{jsonpatch['apply'](_0x40c433,_0x38edb5,!![]);}catch(_0x8e6a0b){return BPromise[_0x9b63('0x20')](_0x8e6a0b);}return _0x40c433[_0x9b63('0x21')]();};}function saveUpdates(_0x311b97,_0x1c848a){return function(_0xacf488){if(_0xacf488){return _0xacf488[_0x9b63('0x22')](_0x311b97)[_0x9b63('0x23')](function(_0x3d8669){return _0x3d8669;});}return null;};}function removeEntity(_0x598656,_0xe60f0f){return function(_0xfdd25e){if(_0xfdd25e){return _0xfdd25e[_0x9b63('0x24')]()[_0x9b63('0x23')](function(){_0x598656[_0x9b63('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x593118,_0x383ebe){return function(_0x1c6080){if(!_0x1c6080){_0x593118[_0x9b63('0x25')](0x194);}return _0x1c6080;};}function handleError(_0x7e5657,_0x21ae77){_0x21ae77=_0x21ae77||0x1f4;return function(_0x1c32f8){logger['error'](_0x1c32f8[_0x9b63('0x26')]);if(_0x1c32f8['name']){delete _0x1c32f8[_0x9b63('0x27')];}_0x7e5657[_0x9b63('0x1b')](_0x21ae77)['send'](_0x1c32f8);};}exports['index']=function(_0x16c257,_0x5de1a9){var _0x319ac8={},_0x128405={},_0x5a6c4c={'count':0x0,'rows':[]};var _0x3085b4=_['map'](db[_0x9b63('0x28')]['rawAttributes'],function(_0x6da9b5){return{'name':_0x6da9b5[_0x9b63('0x29')],'type':_0x6da9b5[_0x9b63('0x2a')][_0x9b63('0x2b')]};});_0x128405[_0x9b63('0x2c')]=_[_0x9b63('0x2d')](_0x3085b4,'name');_0x128405[_0x9b63('0x2e')]=_['keys'](_0x16c257['query']);_0x128405[_0x9b63('0x2f')]=_[_0x9b63('0x30')](_0x128405[_0x9b63('0x2c')],_0x128405[_0x9b63('0x2e')]);_0x319ac8[_0x9b63('0x31')]=_[_0x9b63('0x30')](_0x128405[_0x9b63('0x2c')],qs[_0x9b63('0x32')](_0x16c257[_0x9b63('0x2e')]['fields']));_0x319ac8[_0x9b63('0x31')]=_0x319ac8[_0x9b63('0x31')][_0x9b63('0x33')]?_0x319ac8[_0x9b63('0x31')]:_0x128405['model'];if(!_0x16c257[_0x9b63('0x2e')][_0x9b63('0x34')](_0x9b63('0x35'))){_0x319ac8[_0x9b63('0x1e')]=qs[_0x9b63('0x1e')](_0x16c257[_0x9b63('0x2e')][_0x9b63('0x1e')]);_0x319ac8[_0x9b63('0x1d')]=qs['offset'](_0x16c257[_0x9b63('0x2e')][_0x9b63('0x1d')]);}_0x319ac8[_0x9b63('0x36')]=qs[_0x9b63('0x37')](_0x16c257['query'][_0x9b63('0x37')]);_0x319ac8[_0x9b63('0x38')]=qs[_0x9b63('0x2f')](_[_0x9b63('0x39')](_0x16c257[_0x9b63('0x2e')],_0x128405[_0x9b63('0x2f')]),_0x3085b4);if(_0x16c257['query'][_0x9b63('0x3a')]){_0x319ac8[_0x9b63('0x38')]=_['merge'](_0x319ac8[_0x9b63('0x38')],{'$or':_[_0x9b63('0x2d')](_0x3085b4,function(_0x5e451b){if(_0x5e451b['type']!=='VIRTUAL'){var _0x4dd9b5={};_0x4dd9b5[_0x5e451b[_0x9b63('0x27')]]={'$like':'%'+_0x16c257[_0x9b63('0x2e')]['filter']+'%'};return _0x4dd9b5;}})});}_0x319ac8=_['merge']({},_0x319ac8,_0x16c257[_0x9b63('0x3b')]);var _0x3657d2={'where':_0x319ac8[_0x9b63('0x38')]};return db[_0x9b63('0x28')][_0x9b63('0x1f')](_0x3657d2)[_0x9b63('0x23')](function(_0x1260da){_0x5a6c4c[_0x9b63('0x1f')]=_0x1260da;if(_0x16c257[_0x9b63('0x2e')]['includeAll']){_0x319ac8['include']=[{'all':!![]}];}return db[_0x9b63('0x28')][_0x9b63('0x3c')](_0x319ac8);})[_0x9b63('0x23')](function(_0xb80bbf){_0x5a6c4c[_0x9b63('0x3d')]=_0xb80bbf;return _0x5a6c4c;})[_0x9b63('0x23')](respondWithFilteredResult(_0x5de1a9,_0x319ac8))[_0x9b63('0x3e')](handleError(_0x5de1a9,null));};exports['show']=function(_0x182167,_0x28cf57){var _0x20291d={'raw':!![],'where':{'id':_0x182167['params']['id']}},_0x33fc54={};_0x33fc54['model']=_[_0x9b63('0x3f')](db[_0x9b63('0x28')][_0x9b63('0x40')]);_0x33fc54[_0x9b63('0x2e')]=_['keys'](_0x182167['query']);_0x33fc54[_0x9b63('0x2f')]=_['intersection'](_0x33fc54[_0x9b63('0x2c')],_0x33fc54['query']);_0x20291d['attributes']=_[_0x9b63('0x30')](_0x33fc54[_0x9b63('0x2c')],qs[_0x9b63('0x32')](_0x182167[_0x9b63('0x2e')][_0x9b63('0x32')]));_0x20291d[_0x9b63('0x31')]=_0x20291d[_0x9b63('0x31')]['length']?_0x20291d[_0x9b63('0x31')]:_0x33fc54[_0x9b63('0x2c')];if(_0x182167['query'][_0x9b63('0x41')]){_0x20291d[_0x9b63('0x42')]=[{'all':!![]}];}_0x20291d=_['merge']({},_0x20291d,_0x182167[_0x9b63('0x3b')]);return db[_0x9b63('0x28')]['find'](_0x20291d)[_0x9b63('0x23')](handleEntityNotFound(_0x28cf57,null))[_0x9b63('0x23')](respondWithResult(_0x28cf57,null))['catch'](handleError(_0x28cf57,null));};exports[_0x9b63('0x43')]=function(_0x59ec36,_0x1426da){return db['SmsTransferReport'][_0x9b63('0x43')](_0x59ec36[_0x9b63('0x44')],{})[_0x9b63('0x23')](respondWithResult(_0x1426da,0xc9))[_0x9b63('0x3e')](handleError(_0x1426da,null));};exports[_0x9b63('0x22')]=function(_0x4b0287,_0x1da0c5){if(_0x4b0287[_0x9b63('0x44')]['id']){delete _0x4b0287['body']['id'];}return db['SmsTransferReport'][_0x9b63('0x45')]({'where':{'id':_0x4b0287[_0x9b63('0x46')]['id']}})['then'](handleEntityNotFound(_0x1da0c5,null))[_0x9b63('0x23')](saveUpdates(_0x4b0287['body'],null))[_0x9b63('0x23')](respondWithResult(_0x1da0c5,null))[_0x9b63('0x3e')](handleError(_0x1da0c5,null));};exports[_0x9b63('0x24')]=function(_0x18e5de,_0xc94228){return db[_0x9b63('0x28')][_0x9b63('0x45')]({'where':{'id':_0x18e5de[_0x9b63('0x46')]['id']}})[_0x9b63('0x23')](handleEntityNotFound(_0xc94228,null))[_0x9b63('0x23')](removeEntity(_0xc94228,null))[_0x9b63('0x3e')](handleError(_0xc94228,null));};exports[_0x9b63('0x47')]=function(_0x318d6b,_0x7085bf){return db[_0x9b63('0x28')]['describe']()[_0x9b63('0x23')](respondWithResult(_0x7085bf,null))[_0x9b63('0x3e')](handleError(_0x7085bf,null));};
\ No newline at end of file
+var _0xc789=['pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','error','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where'];(function(_0x4ffa9d,_0x56c145){var _0x377fd3=function(_0x270769){while(--_0x270769){_0x4ffa9d['push'](_0x4ffa9d['shift']());}};_0x377fd3(++_0x56c145);}(_0xc789,0xe6));var _0x9c78=function(_0x3966f0,_0x2cca42){_0x3966f0=_0x3966f0-0x0;var _0x2f71db=_0xc789[_0x3966f0];return _0x2f71db;};'use strict';var emlformat=require(_0x9c78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c78('0x1'));var jsonpatch=require(_0x9c78('0x2'));var rp=require(_0x9c78('0x3'));var moment=require(_0x9c78('0x4'));var BPromise=require(_0x9c78('0x5'));var Mustache=require(_0x9c78('0x6'));var util=require(_0x9c78('0x7'));var path=require(_0x9c78('0x8'));var sox=require(_0x9c78('0x9'));var csv=require(_0x9c78('0xa'));var ejs=require(_0x9c78('0xb'));var fs=require('fs');var fs_extra=require(_0x9c78('0xc'));var _=require(_0x9c78('0xd'));var squel=require(_0x9c78('0xe'));var crypto=require(_0x9c78('0xf'));var jsforce=require(_0x9c78('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9c78('0xa'));var querystring=require('querystring');var Papa=require(_0x9c78('0x11'));var Redis=require(_0x9c78('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9c78('0x13'));var as=require(_0x9c78('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9c78('0x15'));var utils=require(_0x9c78('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9c78('0x17'));var db=require(_0x9c78('0x18'))['db'];function respondWithStatusCode(_0x1a4378,_0x377a75){_0x377a75=_0x377a75||0xcc;return function(_0x52ab2e){if(_0x52ab2e){return _0x1a4378[_0x9c78('0x19')](_0x377a75);}return _0x1a4378['status'](_0x377a75)[_0x9c78('0x1a')]();};}function respondWithResult(_0x22a37f,_0x37c05b){_0x37c05b=_0x37c05b||0xc8;return function(_0x27f208){if(_0x27f208){return _0x22a37f[_0x9c78('0x1b')](_0x37c05b)[_0x9c78('0x1c')](_0x27f208);}};}function respondWithFilteredResult(_0x23498e,_0x32836b){return function(_0x22b127){if(_0x22b127){var _0x196381=typeof _0x32836b[_0x9c78('0x1d')]==='undefined'&&typeof _0x32836b['limit']===_0x9c78('0x1e');var _0x539993=_0x22b127[_0x9c78('0x1f')];var _0x2a0a5f=_0x196381?0x0:_0x32836b[_0x9c78('0x1d')];var _0x2c0f94=_0x196381?_0x22b127[_0x9c78('0x1f')]:_0x32836b[_0x9c78('0x1d')]+_0x32836b[_0x9c78('0x20')];var _0xca4082;if(_0x2c0f94>=_0x539993){_0x2c0f94=_0x539993;_0xca4082=0xc8;}else{_0xca4082=0xce;}_0x23498e[_0x9c78('0x1b')](_0xca4082);return _0x23498e[_0x9c78('0x21')](_0x9c78('0x22'),_0x2a0a5f+'-'+_0x2c0f94+'/'+_0x539993)[_0x9c78('0x1c')](_0x22b127);}return null;};}function patchUpdates(_0x30c6ce){return function(_0x375057){try{jsonpatch[_0x9c78('0x23')](_0x375057,_0x30c6ce,!![]);}catch(_0x46a8a2){return BPromise['reject'](_0x46a8a2);}return _0x375057[_0x9c78('0x24')]();};}function saveUpdates(_0x2ee7d5,_0x4c92d3){return function(_0x3155df){if(_0x3155df){return _0x3155df['update'](_0x2ee7d5)[_0x9c78('0x25')](function(_0x173e85){return _0x173e85;});}return null;};}function removeEntity(_0xc0cde2,_0x87d0c1){return function(_0x593e54){if(_0x593e54){return _0x593e54['destroy']()[_0x9c78('0x25')](function(){_0xc0cde2[_0x9c78('0x1b')](0xcc)[_0x9c78('0x1a')]();});}};}function handleEntityNotFound(_0x49bdd3,_0x1a23c5){return function(_0x5f531a){if(!_0x5f531a){_0x49bdd3[_0x9c78('0x19')](0x194);}return _0x5f531a;};}function handleError(_0x5f404b,_0x36ef39){_0x36ef39=_0x36ef39||0x1f4;return function(_0x42caa5){logger[_0x9c78('0x26')](_0x42caa5['stack']);if(_0x42caa5['name']){delete _0x42caa5[_0x9c78('0x27')];}_0x5f404b[_0x9c78('0x1b')](_0x36ef39)[_0x9c78('0x28')](_0x42caa5);};}exports['index']=function(_0x375118,_0x30f4d8){var _0x387df6={},_0x463808={},_0x20ff0c={'count':0x0,'rows':[]};var _0x1d51d4=_[_0x9c78('0x29')](db[_0x9c78('0x2a')][_0x9c78('0x2b')],function(_0x49e8ff){return{'name':_0x49e8ff[_0x9c78('0x2c')],'type':_0x49e8ff[_0x9c78('0x2d')][_0x9c78('0x2e')]};});_0x463808[_0x9c78('0x2f')]=_['map'](_0x1d51d4,'name');_0x463808[_0x9c78('0x30')]=_[_0x9c78('0x31')](_0x375118[_0x9c78('0x30')]);_0x463808[_0x9c78('0x32')]=_[_0x9c78('0x33')](_0x463808[_0x9c78('0x2f')],_0x463808['query']);_0x387df6[_0x9c78('0x34')]=_['intersection'](_0x463808[_0x9c78('0x2f')],qs[_0x9c78('0x35')](_0x375118[_0x9c78('0x30')][_0x9c78('0x35')]));_0x387df6[_0x9c78('0x34')]=_0x387df6[_0x9c78('0x34')][_0x9c78('0x36')]?_0x387df6[_0x9c78('0x34')]:_0x463808['model'];if(!_0x375118[_0x9c78('0x30')][_0x9c78('0x37')]('nolimit')){_0x387df6[_0x9c78('0x20')]=qs[_0x9c78('0x20')](_0x375118['query'][_0x9c78('0x20')]);_0x387df6['offset']=qs[_0x9c78('0x1d')](_0x375118[_0x9c78('0x30')][_0x9c78('0x1d')]);}_0x387df6['order']=qs[_0x9c78('0x38')](_0x375118[_0x9c78('0x30')][_0x9c78('0x38')]);_0x387df6[_0x9c78('0x39')]=qs[_0x9c78('0x32')](_[_0x9c78('0x3a')](_0x375118['query'],_0x463808[_0x9c78('0x32')]),_0x1d51d4);if(_0x375118['query']['filter']){_0x387df6[_0x9c78('0x39')]=_['merge'](_0x387df6[_0x9c78('0x39')],{'$or':_['map'](_0x1d51d4,function(_0x421e40){if(_0x421e40[_0x9c78('0x2d')]!==_0x9c78('0x3b')){var _0x3f6345={};_0x3f6345[_0x421e40[_0x9c78('0x27')]]={'$like':'%'+_0x375118['query'][_0x9c78('0x3c')]+'%'};return _0x3f6345;}})});}_0x387df6=_['merge']({},_0x387df6,_0x375118[_0x9c78('0x3d')]);var _0x4e39e9={'where':_0x387df6[_0x9c78('0x39')]};return db[_0x9c78('0x2a')]['count'](_0x4e39e9)[_0x9c78('0x25')](function(_0x248c24){_0x20ff0c[_0x9c78('0x1f')]=_0x248c24;if(_0x375118[_0x9c78('0x30')][_0x9c78('0x3e')]){_0x387df6[_0x9c78('0x3f')]=[{'all':!![]}];}return db[_0x9c78('0x2a')][_0x9c78('0x40')](_0x387df6);})[_0x9c78('0x25')](function(_0x1b45fb){_0x20ff0c[_0x9c78('0x41')]=_0x1b45fb;return _0x20ff0c;})[_0x9c78('0x25')](respondWithFilteredResult(_0x30f4d8,_0x387df6))[_0x9c78('0x42')](handleError(_0x30f4d8,null));};exports['show']=function(_0x345b26,_0x354f49){var _0x4b191e={'raw':!![],'where':{'id':_0x345b26[_0x9c78('0x43')]['id']}},_0x276ea5={};_0x276ea5[_0x9c78('0x2f')]=_[_0x9c78('0x31')](db[_0x9c78('0x2a')]['rawAttributes']);_0x276ea5['query']=_[_0x9c78('0x31')](_0x345b26[_0x9c78('0x30')]);_0x276ea5[_0x9c78('0x32')]=_[_0x9c78('0x33')](_0x276ea5[_0x9c78('0x2f')],_0x276ea5['query']);_0x4b191e[_0x9c78('0x34')]=_[_0x9c78('0x33')](_0x276ea5[_0x9c78('0x2f')],qs[_0x9c78('0x35')](_0x345b26[_0x9c78('0x30')][_0x9c78('0x35')]));_0x4b191e[_0x9c78('0x34')]=_0x4b191e[_0x9c78('0x34')][_0x9c78('0x36')]?_0x4b191e[_0x9c78('0x34')]:_0x276ea5[_0x9c78('0x2f')];if(_0x345b26[_0x9c78('0x30')][_0x9c78('0x3e')]){_0x4b191e[_0x9c78('0x3f')]=[{'all':!![]}];}_0x4b191e=_['merge']({},_0x4b191e,_0x345b26['options']);return db[_0x9c78('0x2a')][_0x9c78('0x44')](_0x4b191e)[_0x9c78('0x25')](handleEntityNotFound(_0x354f49,null))['then'](respondWithResult(_0x354f49,null))[_0x9c78('0x42')](handleError(_0x354f49,null));};exports[_0x9c78('0x45')]=function(_0x572f43,_0x44ee29){return db[_0x9c78('0x2a')][_0x9c78('0x45')](_0x572f43[_0x9c78('0x46')],{})[_0x9c78('0x25')](respondWithResult(_0x44ee29,0xc9))[_0x9c78('0x42')](handleError(_0x44ee29,null));};exports['update']=function(_0x204ea1,_0x452db8){if(_0x204ea1[_0x9c78('0x46')]['id']){delete _0x204ea1[_0x9c78('0x46')]['id'];}return db[_0x9c78('0x2a')][_0x9c78('0x44')]({'where':{'id':_0x204ea1['params']['id']}})['then'](handleEntityNotFound(_0x452db8,null))[_0x9c78('0x25')](saveUpdates(_0x204ea1[_0x9c78('0x46')],null))[_0x9c78('0x25')](respondWithResult(_0x452db8,null))[_0x9c78('0x42')](handleError(_0x452db8,null));};exports['destroy']=function(_0x3e6b8f,_0x2da007){return db[_0x9c78('0x2a')][_0x9c78('0x44')]({'where':{'id':_0x3e6b8f[_0x9c78('0x43')]['id']}})[_0x9c78('0x25')](handleEntityNotFound(_0x2da007,null))[_0x9c78('0x25')](removeEntity(_0x2da007,null))[_0x9c78('0x42')](handleError(_0x2da007,null));};exports[_0x9c78('0x47')]=function(_0x2f4b58,_0x34b20e){return db[_0x9c78('0x2a')]['describe']()['then'](respondWithResult(_0x34b20e,null))[_0x9c78('0x42')](handleError(_0x34b20e,null));};
\ No newline at end of file
index 26503b4..dcaa500 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf72f=['./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x149ad5,_0x12b417){var _0x2566b7=function(_0x157f10){while(--_0x157f10){_0x149ad5['push'](_0x149ad5['shift']());}};_0x2566b7(++_0x12b417);}(_0xf72f,0x171));var _0xff72=function(_0x59aa2f,_0x176145){_0x59aa2f=_0x59aa2f-0x0;var _0x359e93=_0xf72f[_0x59aa2f];return _0x359e93;};'use strict';var _=require('lodash');var util=require(_0xff72('0x0'));var logger=require(_0xff72('0x1'))('api');var moment=require(_0xff72('0x2'));var BPromise=require(_0xff72('0x3'));var rp=require(_0xff72('0x4'));var fs=require('fs');var path=require(_0xff72('0x5'));var rimraf=require(_0xff72('0x6'));var config=require(_0xff72('0x7'));var attributes=require(_0xff72('0x8'));module[_0xff72('0x9')]=function(_0x5ae437,_0x56fbc7){return _0x5ae437[_0xff72('0xa')]('SmsTransferReport',attributes,{'tableName':_0xff72('0xb'),'paranoid':![],'indexes':[{'name':_0xff72('0xc'),'fields':[_0xff72('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb85a=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsTransferReport.attributes','exports','report_sms_transfer','uniqueid'];(function(_0x24bfff,_0x2a78ab){var _0xf8a4fd=function(_0x56fabc){while(--_0x56fabc){_0x24bfff['push'](_0x24bfff['shift']());}};_0xf8a4fd(++_0x2a78ab);}(_0xb85a,0xb0));var _0xab85=function(_0x104c9b,_0x56944d){_0x104c9b=_0x104c9b-0x0;var _0x39ba4d=_0xb85a[_0x104c9b];return _0x39ba4d;};'use strict';var _=require('lodash');var util=require(_0xab85('0x0'));var logger=require(_0xab85('0x1'))(_0xab85('0x2'));var moment=require(_0xab85('0x3'));var BPromise=require(_0xab85('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab85('0x5'));var config=require(_0xab85('0x6'));var attributes=require(_0xab85('0x7'));module[_0xab85('0x8')]=function(_0x386c9e,_0x487a2e){return _0x386c9e['define']('SmsTransferReport',attributes,{'tableName':_0xab85('0x9'),'paranoid':![],'indexes':[{'name':_0xab85('0xa'),'fields':[_0xab85('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 49a39c7..7ffab48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x1a82af,_0x434179){var _0x4ccacb=function(_0x34efcc){while(--_0x34efcc){_0x1a82af['push'](_0x1a82af['shift']());}};_0x4ccacb(++_0x434179);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x00bb[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}
\ No newline at end of file
+var _0x8c25=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','request'];(function(_0x3b320d,_0x16a0bd){var _0x1340c6=function(_0x5d681){while(--_0x5d681){_0x3b320d['push'](_0x3b320d['shift']());}};_0x1340c6(++_0x16a0bd);}(_0x8c25,0x15e));var _0x58c2=function(_0x2376ac,_0x3fbb7c){_0x2376ac=_0x2376ac-0x0;var _0x428e54=_0x8c25[_0x2376ac];return _0x428e54;};'use strict';var _=require(_0x58c2('0x0'));var util=require(_0x58c2('0x1'));var moment=require(_0x58c2('0x2'));var BPromise=require(_0x58c2('0x3'));var rs=require(_0x58c2('0x4'));var fs=require('fs');var Redis=require(_0x58c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x58c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x58c2('0x7'));var client=jayson['client'][_0x58c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4be512,_0x5f3536,_0x331863){return new BPromise(function(_0xddbb7e,_0x52cfa7){return client[_0x58c2('0x9')](_0x4be512,_0x331863)[_0x58c2('0xa')](function(_0xf9aef5){logger[_0x58c2('0xb')](_0x58c2('0xc'),_0x5f3536,_0x58c2('0xd'));logger[_0x58c2('0xe')](_0x58c2('0xf'),_0x5f3536,'request\x20sent',JSON[_0x58c2('0x10')](_0xf9aef5));if(_0xf9aef5[_0x58c2('0x11')]){if(_0xf9aef5[_0x58c2('0x11')]['code']===0x1f4){logger[_0x58c2('0x11')](_0x58c2('0xc'),_0x5f3536,_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);return _0x52cfa7(_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);}logger[_0x58c2('0x11')](_0x58c2('0xc'),_0x5f3536,_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);return _0xddbb7e(_0xf9aef5['error']['message']);}else{logger[_0x58c2('0xb')](_0x58c2('0xc'),_0x5f3536,_0x58c2('0xd'));_0xddbb7e(_0xf9aef5[_0x58c2('0x13')][_0x58c2('0x12')]);}})['catch'](function(_0x3a6312){logger[_0x58c2('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x5f3536,_0x3a6312);_0x52cfa7(_0x3a6312);});});}
\ No newline at end of file
index ae78772..31f0d07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x993e=['originalname','format','%s-%s%s','extname','now','single','file','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','join','root','server/files/sounds/original/'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x993e,0xa1));var _0xe993=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x993e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe993('0x0'));var util=require(_0xe993('0x1'));var path=require(_0xe993('0x2'));var timeout=require(_0xe993('0x3'));var express=require('express');var router=express[_0xe993('0x4')]();var fs_extra=require(_0xe993('0x5'));var auth=require(_0xe993('0x6'));var interaction=require(_0xe993('0x7'));var config=require(_0xe993('0x8'));var controller=require('./sound.controller');router[_0xe993('0x9')]('/',auth[_0xe993('0xa')](),controller[_0xe993('0xb')]);router[_0xe993('0x9')](_0xe993('0xc'),auth['isAuthenticated'](),controller[_0xe993('0xd')]);router['get'](_0xe993('0xe'),auth[_0xe993('0xa')](),controller[_0xe993('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x13161d,_0x753054,_0x4bbc75){_0x4bbc75(null,path[_0xe993('0x10')](config[_0xe993('0x11')],_0xe993('0x12')));},'filename':function(_0x11a37c,_0xe31bfb,_0x5167fb){_0xe31bfb[_0xe993('0x13')]=_0xe31bfb[_0xe993('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5167fb(null,util[_0xe993('0x14')](_0xe993('0x15'),path['basename'](_0xe31bfb[_0xe993('0x13')],path[_0xe993('0x16')](_0xe31bfb[_0xe993('0x13')])),Date[_0xe993('0x17')](),path['extname'](_0xe31bfb[_0xe993('0x13')])));}})});router['post']('/',upload[_0xe993('0x18')](_0xe993('0x19')),controller[_0xe993('0x1a')]);router['put'](_0xe993('0xc'),auth[_0xe993('0xa')](),controller[_0xe993('0x1b')]);router[_0xe993('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xe993('0x1c')]);module[_0xe993('0x1d')]=router;
\ No newline at end of file
+var _0xc9c1=['put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','show','/:id/download','diskStorage','join','root','originalname','format','basename','extname','now','post','single','file','create'];(function(_0x5975ee,_0x37076e){var _0x4534c3=function(_0x16283e){while(--_0x16283e){_0x5975ee['push'](_0x5975ee['shift']());}};_0x4534c3(++_0x37076e);}(_0xc9c1,0x15a));var _0x1c9c=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xc9c1[_0x18a79d];return _0x4f8848;};'use strict';var multer=require(_0x1c9c('0x0'));var util=require(_0x1c9c('0x1'));var path=require(_0x1c9c('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c9c('0x3'));var router=express[_0x1c9c('0x4')]();var fs_extra=require(_0x1c9c('0x5'));var auth=require(_0x1c9c('0x6'));var interaction=require(_0x1c9c('0x7'));var config=require('../../config/environment');var controller=require(_0x1c9c('0x8'));router[_0x1c9c('0x9')]('/',auth[_0x1c9c('0xa')](),controller[_0x1c9c('0xb')]);router[_0x1c9c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1c9c('0xc')]);router['get'](_0x1c9c('0xd'),auth[_0x1c9c('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x1c9c('0xe')]({'destination':function(_0x2b08bf,_0x48bcfd,_0x260289){_0x260289(null,path[_0x1c9c('0xf')](config[_0x1c9c('0x10')],'server/files/sounds/original/'));},'filename':function(_0x136a59,_0x66312f,_0x176ef6){_0x66312f[_0x1c9c('0x11')]=_0x66312f[_0x1c9c('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x176ef6(null,util[_0x1c9c('0x12')]('%s-%s%s',path[_0x1c9c('0x13')](_0x66312f[_0x1c9c('0x11')],path[_0x1c9c('0x14')](_0x66312f[_0x1c9c('0x11')])),Date[_0x1c9c('0x15')](),path[_0x1c9c('0x14')](_0x66312f[_0x1c9c('0x11')])));}})});router[_0x1c9c('0x16')]('/',upload[_0x1c9c('0x17')](_0x1c9c('0x18')),controller[_0x1c9c('0x19')]);router[_0x1c9c('0x1a')](_0x1c9c('0x1b'),auth[_0x1c9c('0xa')](),controller[_0x1c9c('0x1c')]);router['delete'](_0x1c9c('0x1b'),auth['isAuthenticated'](),controller[_0x1c9c('0x1d')]);module[_0x1c9c('0x1e')]=router;
\ No newline at end of file
index 4fed23d..6b73887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ec3=['FLOAT','BIGINT','INTEGER','sequelize','exports','name','STRING'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x0ec3,0x1d1));var _0x30ec=function(_0x21ac96,_0x1be316){_0x21ac96=_0x21ac96-0x0;var _0x3b5586=_0x0ec3[_0x21ac96];return _0x3b5586;};'use strict';var Sequelize=require(_0x30ec('0x0'));module[_0x30ec('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x30ec('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x30ec('0x3')]},'display_name':{'type':Sequelize[_0x30ec('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x30ec('0x3')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x30ec('0x4')]},'original_sampleCount':{'type':Sequelize[_0x30ec('0x5')]},'original_channelCount':{'type':Sequelize[_0x30ec('0x6')]},'original_bitRate':{'type':Sequelize[_0x30ec('0x5')]},'original_sampleRate':{'type':Sequelize[_0x30ec('0x6')]},'converted_format':{'type':Sequelize[_0x30ec('0x3')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x30ec('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xcdc4=['STRING','BIGINT','INTEGER','FLOAT','exports'];(function(_0x28c89b,_0x2510b3){var _0x176500=function(_0x3dfee2){while(--_0x3dfee2){_0x28c89b['push'](_0x28c89b['shift']());}};_0x176500(++_0x2510b3);}(_0xcdc4,0x199));var _0x4cdc=function(_0x4ea98d,_0x5c3a56){_0x4ea98d=_0x4ea98d-0x0;var _0x151023=_0xcdc4[_0x4ea98d];return _0x151023;};'use strict';var Sequelize=require('sequelize');module[_0x4cdc('0x0')]={'name':{'type':Sequelize[_0x4cdc('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x4cdc('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x4cdc('0x1')]},'original_format':{'type':Sequelize[_0x4cdc('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x4cdc('0x2')]},'original_channelCount':{'type':Sequelize[_0x4cdc('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x4cdc('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x4cdc('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x4cdc('0x2')]},'converted_channelCount':{'type':Sequelize[_0x4cdc('0x3')]},'converted_bitRate':{'type':Sequelize[_0x4cdc('0x2')]},'converted_sampleRate':{'type':Sequelize[_0x4cdc('0x3')]}};
\ No newline at end of file
index 5567cc6..b69fbc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b1=['file','extname','originalname','filename','substring','wav','server/files/sounds/original','server/files/sounds/converted','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','eml-format','zip-dir','request-promise','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','find','download','params','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename'];(function(_0x116c04,_0x4963da){var _0x9e011d=function(_0x143880){while(--_0x143880){_0x116c04['push'](_0x116c04['shift']());}};_0x9e011d(++_0x4963da);}(_0x00b1,0x19c));var _0x100b=function(_0xaaff2d,_0x5c8edf){_0xaaff2d=_0xaaff2d-0x0;var _0x36d44d=_0x00b1[_0xaaff2d];return _0x36d44d;};'use strict';var emlformat=require(_0x100b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x100b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x100b('0x2'));var moment=require('moment');var BPromise=require(_0x100b('0x3'));var Mustache=require('mustache');var util=require(_0x100b('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x100b('0x5'));var ejs=require(_0x100b('0x6'));var fs=require('fs');var fs_extra=require(_0x100b('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x100b('0x8'));var jsforce=require(_0x100b('0x9'));var deskjs=require(_0x100b('0xa'));var toCsv=require(_0x100b('0x5'));var querystring=require(_0x100b('0xb'));var Papa=require('papaparse');var Redis=require(_0x100b('0xc'));var authService=require(_0x100b('0xd'));var qs=require(_0x100b('0xe'));var as=require(_0x100b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x100b('0x10'))(_0x100b('0x11'));var utils=require(_0x100b('0x12'));var config=require(_0x100b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x100b('0x14'))['db'];function respondWithStatusCode(_0x4fea87,_0x416e52){_0x416e52=_0x416e52||0xcc;return function(_0x3e045b){if(_0x3e045b){return _0x4fea87[_0x100b('0x15')](_0x416e52);}return _0x4fea87[_0x100b('0x16')](_0x416e52)[_0x100b('0x17')]();};}function respondWithResult(_0x24218c,_0x2dc68f){_0x2dc68f=_0x2dc68f||0xc8;return function(_0x1979df){if(_0x1979df){return _0x24218c[_0x100b('0x16')](_0x2dc68f)[_0x100b('0x18')](_0x1979df);}};}function respondWithFilteredResult(_0x1d5dfc,_0x1713c3){return function(_0x28f6ae){if(_0x28f6ae){var _0x3431da=typeof _0x1713c3[_0x100b('0x19')]===_0x100b('0x1a')&&typeof _0x1713c3[_0x100b('0x1b')]===_0x100b('0x1a');var _0x1fe68e=_0x28f6ae[_0x100b('0x1c')];var _0x212c7c=_0x3431da?0x0:_0x1713c3[_0x100b('0x19')];var _0x215c8e=_0x3431da?_0x28f6ae[_0x100b('0x1c')]:_0x1713c3[_0x100b('0x19')]+_0x1713c3[_0x100b('0x1b')];var _0x3f9a49;if(_0x215c8e>=_0x1fe68e){_0x215c8e=_0x1fe68e;_0x3f9a49=0xc8;}else{_0x3f9a49=0xce;}_0x1d5dfc[_0x100b('0x16')](_0x3f9a49);return _0x1d5dfc[_0x100b('0x1d')](_0x100b('0x1e'),_0x212c7c+'-'+_0x215c8e+'/'+_0x1fe68e)['json'](_0x28f6ae);}return null;};}function patchUpdates(_0xe65f11){return function(_0x19ec32){try{jsonpatch[_0x100b('0x1f')](_0x19ec32,_0xe65f11,!![]);}catch(_0x5e0f60){return BPromise['reject'](_0x5e0f60);}return _0x19ec32[_0x100b('0x20')]();};}function saveUpdates(_0x3b13e5,_0x1075f0){return function(_0x2835e2){if(_0x2835e2){return _0x2835e2[_0x100b('0x21')](_0x3b13e5)[_0x100b('0x22')](function(_0xe82552){return _0xe82552;});}return null;};}function removeEntity(_0x307776,_0x1f1ec4){return function(_0x374447){if(_0x374447){return _0x374447[_0x100b('0x23')]()['then'](function(){var _0x1d8032=_0x374447[_0x100b('0x24')]({'plain':!![]});var _0xca62af=_0x100b('0x25');return db[_0x100b('0x26')][_0x100b('0x23')]({'where':{'type':_0xca62af,'resourceId':_0x1d8032['id']}})[_0x100b('0x22')](function(){return _0x374447;});})['then'](function(){_0x307776[_0x100b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4a43,_0x1b5e49){return function(_0x52fe8c){if(!_0x52fe8c){_0x4b4a43[_0x100b('0x15')](0x194);}return _0x52fe8c;};}function handleError(_0x555506,_0x2b9fa1){_0x2b9fa1=_0x2b9fa1||0x1f4;return function(_0x5ed0a7){logger[_0x100b('0x27')](_0x5ed0a7[_0x100b('0x28')]);if(_0x5ed0a7[_0x100b('0x29')]){delete _0x5ed0a7[_0x100b('0x29')];}_0x555506[_0x100b('0x16')](_0x2b9fa1)[_0x100b('0x2a')](_0x5ed0a7);};}exports[_0x100b('0x2b')]=function(_0x367ead,_0x1922fb){var _0x3b5da6={},_0x39d400={},_0x5cbae7={'count':0x0,'rows':[]};var _0x188645=_[_0x100b('0x2c')](db[_0x100b('0x2d')][_0x100b('0x2e')],function(_0x4f9083){return{'name':_0x4f9083[_0x100b('0x2f')],'type':_0x4f9083['type'][_0x100b('0x30')]};});_0x39d400[_0x100b('0x31')]=_['map'](_0x188645,'name');_0x39d400['query']=_['keys'](_0x367ead[_0x100b('0x32')]);_0x39d400[_0x100b('0x33')]=_[_0x100b('0x34')](_0x39d400[_0x100b('0x31')],_0x39d400['query']);_0x3b5da6[_0x100b('0x35')]=_['intersection'](_0x39d400[_0x100b('0x31')],qs[_0x100b('0x36')](_0x367ead[_0x100b('0x32')][_0x100b('0x36')]));_0x3b5da6[_0x100b('0x35')]=_0x3b5da6[_0x100b('0x35')]['length']?_0x3b5da6[_0x100b('0x35')]:_0x39d400[_0x100b('0x31')];if(!_0x367ead['query'][_0x100b('0x37')](_0x100b('0x38'))){_0x3b5da6[_0x100b('0x1b')]=qs['limit'](_0x367ead[_0x100b('0x32')][_0x100b('0x1b')]);_0x3b5da6[_0x100b('0x19')]=qs[_0x100b('0x19')](_0x367ead['query'][_0x100b('0x19')]);}_0x3b5da6[_0x100b('0x39')]=qs['sort'](_0x367ead['query'][_0x100b('0x3a')]);_0x3b5da6['where']=qs[_0x100b('0x33')](_[_0x100b('0x3b')](_0x367ead[_0x100b('0x32')],_0x39d400[_0x100b('0x33')]),_0x188645);if(_0x367ead[_0x100b('0x32')][_0x100b('0x3c')]){_0x3b5da6[_0x100b('0x3d')]=_['merge'](_0x3b5da6[_0x100b('0x3d')],{'$or':_['map'](_0x188645,function(_0x3347fa){if(_0x3347fa[_0x100b('0x3e')]!=='VIRTUAL'){var _0x45b3e2={};_0x45b3e2[_0x3347fa[_0x100b('0x29')]]={'$like':'%'+_0x367ead[_0x100b('0x32')][_0x100b('0x3c')]+'%'};return _0x45b3e2;}})});}_0x3b5da6=_[_0x100b('0x3f')]({},_0x3b5da6,_0x367ead[_0x100b('0x40')]);var _0x3b34e5={'where':_0x3b5da6[_0x100b('0x3d')]};return db[_0x100b('0x2d')]['count'](_0x3b34e5)[_0x100b('0x22')](function(_0x599d15){_0x5cbae7[_0x100b('0x1c')]=_0x599d15;if(_0x367ead[_0x100b('0x32')][_0x100b('0x41')]){_0x3b5da6[_0x100b('0x42')]=[{'all':!![]}];}return db['Sound'][_0x100b('0x43')](_0x3b5da6);})[_0x100b('0x22')](function(_0x56f00e){_0x5cbae7[_0x100b('0x44')]=_0x56f00e;return _0x5cbae7;})[_0x100b('0x22')](respondWithFilteredResult(_0x1922fb,_0x3b5da6))[_0x100b('0x45')](handleError(_0x1922fb,null));};exports[_0x100b('0x46')]=function(_0x4f740a,_0x5155dd){var _0x33bacf={'raw':!![],'where':{'id':_0x4f740a['params']['id']}},_0xfab93c={};_0xfab93c[_0x100b('0x31')]=_[_0x100b('0x47')](db[_0x100b('0x2d')][_0x100b('0x2e')]);_0xfab93c[_0x100b('0x32')]=_[_0x100b('0x47')](_0x4f740a['query']);_0xfab93c['filters']=_['intersection'](_0xfab93c[_0x100b('0x31')],_0xfab93c['query']);_0x33bacf[_0x100b('0x35')]=_[_0x100b('0x34')](_0xfab93c['model'],qs[_0x100b('0x36')](_0x4f740a[_0x100b('0x32')][_0x100b('0x36')]));_0x33bacf['attributes']=_0x33bacf['attributes'][_0x100b('0x48')]?_0x33bacf[_0x100b('0x35')]:_0xfab93c[_0x100b('0x31')];if(_0x4f740a['query'][_0x100b('0x41')]){_0x33bacf[_0x100b('0x42')]=[{'all':!![]}];}_0x33bacf=_[_0x100b('0x3f')]({},_0x33bacf,_0x4f740a[_0x100b('0x40')]);return db[_0x100b('0x2d')][_0x100b('0x49')](_0x33bacf)[_0x100b('0x22')](handleEntityNotFound(_0x5155dd,null))[_0x100b('0x22')](respondWithResult(_0x5155dd,null))['catch'](handleError(_0x5155dd,null));};exports[_0x100b('0x4a')]=function(_0x5d3fad,_0x5b1782,_0x2001ee){return db[_0x100b('0x2d')][_0x100b('0x49')]({'where':{'id':_0x5d3fad[_0x100b('0x4b')]['id']},'attributes':[_0x100b('0x29'),_0x100b('0x4c'),_0x100b('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x5b1782,null))[_0x100b('0x22')](function(_0x3d7a4c){if(_0x3d7a4c){if(!fs[_0x100b('0x4e')](path[_0x100b('0x4f')](config[_0x100b('0x50')],'server/files/sounds/converted',_0x3d7a4c[_0x100b('0x4c')]+'.'+_0x3d7a4c[_0x100b('0x4d')]))){throw new db[(_0x100b('0x51'))][(_0x100b('0x52'))](_0x100b('0x53'));}return _0x5b1782[_0x100b('0x4a')](path[_0x100b('0x4f')](config[_0x100b('0x50')],'server/files/sounds/converted',util[_0x100b('0x54')](_0x100b('0x55'),_0x3d7a4c['save_name'],_0x3d7a4c['converted_format'])),util['format'](_0x100b('0x55'),_0x3d7a4c['name'],_0x3d7a4c[_0x100b('0x4d')]));}return null;})[_0x100b('0x45')](handleError(_0x5b1782,null));};exports[_0x100b('0x56')]=function(_0xf717a7,_0xaec48e,_0x2d4f6d){var _0x2bc51a={'name':path[_0x100b('0x57')](_0xf717a7[_0x100b('0x58')]['originalname'],path[_0x100b('0x59')](_0xf717a7[_0x100b('0x58')][_0x100b('0x5a')])),'save_name':path[_0x100b('0x57')](_0xf717a7[_0x100b('0x58')]['filename'],path['extname'](_0xf717a7[_0x100b('0x58')][_0x100b('0x5b')])),'original_format':path[_0x100b('0x59')](_0xf717a7[_0x100b('0x58')]['originalname'])[_0x100b('0x5c')](0x1),'converted_format':_0x100b('0x5d')};var _0x55a824=path[_0x100b('0x4f')](config[_0x100b('0x50')],_0x100b('0x5e'),_0xf717a7[_0x100b('0x58')][_0x100b('0x5b')]);var _0x2e8084=path[_0x100b('0x4f')](config['root'],_0x100b('0x5f'),util[_0x100b('0x54')](_0x100b('0x55'),path[_0x100b('0x57')](_0xf717a7[_0x100b('0x58')][_0x100b('0x5b')],path[_0x100b('0x59')](_0xf717a7[_0x100b('0x58')][_0x100b('0x5b')])),_0x2bc51a['converted_format']));logger[_0x100b('0x60')](_0x100b('0x61'),_0x55a824);logger[_0x100b('0x60')](_0x100b('0x62'),_0x2e8084);try{fs[_0x100b('0x63')](_0x55a824,parseInt('0777',0x8));var _0x4ae5db=sox[_0x100b('0x64')](_0x55a824,_0x2e8084,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4ae5db['on'](_0x100b('0x27'),function(_0x11b7ce){fs[_0x100b('0x65')](_0x55a824);_0xaec48e[_0x100b('0x16')](0x1f4)[_0x100b('0x2a')](_0x11b7ce);});_0x4ae5db['on'](_0x100b('0x66'),function(_0x3310a4){_0x2bc51a['original_duration']=isNaN(_0x3310a4[_0x100b('0x67')])?null:_0x3310a4[_0x100b('0x67')]*0x3e8;_0x2bc51a[_0x100b('0x68')]=isNaN(_0x3310a4[_0x100b('0x69')])?null:_0x3310a4[_0x100b('0x69')];_0x2bc51a[_0x100b('0x6a')]=isNaN(_0x3310a4[_0x100b('0x6b')])?null:_0x3310a4[_0x100b('0x6b')];_0x2bc51a['original_bitRate']=isNaN(_0x3310a4[_0x100b('0x6c')])?null:_0x3310a4[_0x100b('0x6c')];_0x2bc51a[_0x100b('0x6d')]=isNaN(_0x3310a4['sampleRate'])?null:_0x3310a4['sampleRate'];});_0x4ae5db['on']('dest',function(_0x31f692){_0x2bc51a['converted_duration']=isNaN(_0x31f692[_0x100b('0x67')])?null:_0x31f692['duration']*0x3e8;_0x2bc51a[_0x100b('0x6e')]=isNaN(_0x31f692[_0x100b('0x69')])?null:_0x31f692[_0x100b('0x69')];_0x2bc51a[_0x100b('0x6f')]=isNaN(_0x31f692['channelCount'])?null:_0x31f692[_0x100b('0x6b')];_0x2bc51a[_0x100b('0x70')]=isNaN(_0x31f692[_0x100b('0x6c')])?null:_0x31f692[_0x100b('0x6c')];_0x2bc51a[_0x100b('0x71')]=isNaN(_0x31f692[_0x100b('0x72')])?null:_0x31f692[_0x100b('0x72')];});_0x4ae5db['on'](_0x100b('0x17'),function(){fs['chmodSync'](_0x2e8084,parseInt(_0x100b('0x73'),0x8));return db[_0x100b('0x2d')]['create'](_0x2bc51a)[_0x100b('0x22')](function(_0x3f590b){var _0x1000bf={'role':_0xf717a7[_0x100b('0x74')][_0x100b('0x75')],'userProfileId':_0xf717a7[_0x100b('0x74')][_0x100b('0x76')]};if(!_0x1000bf)throw new Error(_0x100b('0x77'));if(_0x1000bf[_0x100b('0x75')]==='user'){var _0x1cdd5b=_0x3f590b['get']({'plain':!![]});return db['UserProfileSection'][_0x100b('0x49')]({'where':{'name':_0x100b('0x25'),'userProfileId':_0x1000bf['userProfileId']},'raw':!![]})['then'](function(_0xc20d37){if(_0xc20d37&&_0xc20d37[_0x100b('0x78')]===0x0){return db[_0x100b('0x26')]['create']({'name':_0x1cdd5b[_0x100b('0x29')],'resourceId':_0x1cdd5b['id'],'type':_0xc20d37['name'],'sectionId':_0xc20d37['id']},{})[_0x100b('0x22')](function(){return _0x3f590b;});}else{return _0x3f590b;}})['catch'](function(_0x3e4fb1){logger[_0x100b('0x27')](_0x100b('0x79'),_0x3e4fb1);throw _0x3e4fb1;});}return _0x3f590b;})[_0x100b('0x22')](respondWithResult(_0xaec48e,null))[_0x100b('0x45')](handleError(_0xaec48e,null));});_0x4ae5db['start']();}catch(_0x5e5ed0){_0xaec48e['status'](0x1f4)[_0x100b('0x2a')](_0x5e5ed0);}};exports[_0x100b('0x21')]=function(_0x51344f,_0x8bb3c1,_0x8449c8){return db[_0x100b('0x2d')][_0x100b('0x49')]({'where':{'id':_0x51344f[_0x100b('0x4b')]['id']}})[_0x100b('0x22')](handleEntityNotFound(_0x8bb3c1,null))[_0x100b('0x22')](saveUpdates(_[_0x100b('0x3b')](_0x51344f[_0x100b('0x74')],['name',_0x100b('0x7a')]),null))['then'](respondWithResult(_0x8bb3c1,null))['catch'](handleError(_0x8bb3c1,null));};exports[_0x100b('0x7b')]=function(_0x2ed176,_0x35d586,_0x11cfc5){return db[_0x100b('0x2d')][_0x100b('0x49')]({'where':{'id':_0x2ed176['params']['id']}})[_0x100b('0x22')](function(_0x34b0ae){if(_0x34b0ae){return _0x34b0ae[_0x100b('0x23')]();}})[_0x100b('0x22')](function(_0x3d4ac0){var _0x5c2975=path['join'](config[_0x100b('0x50')],_0x100b('0x5e'),util[_0x100b('0x54')](_0x100b('0x55'),_0x3d4ac0[_0x100b('0x4c')],_0x3d4ac0[_0x100b('0x7c')]));var _0x525696=path[_0x100b('0x4f')](config[_0x100b('0x50')],'server/files/sounds/converted',util[_0x100b('0x54')](_0x100b('0x55'),_0x3d4ac0[_0x100b('0x4c')],_0x3d4ac0['converted_format']));fs[_0x100b('0x65')](_0x5c2975);fs[_0x100b('0x65')](_0x525696);return _0x3d4ac0;})['then'](function(_0x442325){if(_0x442325){return _0x35d586[_0x100b('0x16')](0xcc)[_0x100b('0x17')]();}})['then'](handleEntityNotFound(_0x35d586,null))[_0x100b('0x45')](handleError(_0x35d586,null));};
\ No newline at end of file
+var _0x834b=['description','delete','format','original_format','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','Sound','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','download','save_name','converted_format','existsSync','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','root','%s.%s','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','body','userProfileId','role','user','UserProfileSection','Sounds','autoAssociation','UserProfileResource'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x834b,0x1dd));var _0xb834=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x834b[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb834('0x0'));var zipdir=require(_0xb834('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb834('0x2'));var moment=require(_0xb834('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb834('0x4'));var util=require(_0xb834('0x5'));var path=require(_0xb834('0x6'));var sox=require(_0xb834('0x7'));var csv=require(_0xb834('0x8'));var ejs=require(_0xb834('0x9'));var fs=require('fs');var fs_extra=require(_0xb834('0xa'));var _=require(_0xb834('0xb'));var squel=require('squel');var crypto=require(_0xb834('0xc'));var jsforce=require(_0xb834('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb834('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb834('0xe'));var authService=require(_0xb834('0xf'));var qs=require(_0xb834('0x10'));var as=require(_0xb834('0x11'));var hardwareService=require(_0xb834('0x12'));var logger=require(_0xb834('0x13'))(_0xb834('0x14'));var utils=require(_0xb834('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb834('0x16'))['db'];function respondWithStatusCode(_0x1d14a2,_0x2849b1){_0x2849b1=_0x2849b1||0xcc;return function(_0x3db052){if(_0x3db052){return _0x1d14a2['sendStatus'](_0x2849b1);}return _0x1d14a2[_0xb834('0x17')](_0x2849b1)[_0xb834('0x18')]();};}function respondWithResult(_0x145e3a,_0x2c95cb){_0x2c95cb=_0x2c95cb||0xc8;return function(_0x114541){if(_0x114541){return _0x145e3a['status'](_0x2c95cb)['json'](_0x114541);}};}function respondWithFilteredResult(_0x1a212a,_0x511be8){return function(_0x3d97cc){if(_0x3d97cc){var _0x5cecba=typeof _0x511be8[_0xb834('0x19')]===_0xb834('0x1a')&&typeof _0x511be8[_0xb834('0x1b')]===_0xb834('0x1a');var _0x33a23b=_0x3d97cc['count'];var _0x4d2c02=_0x5cecba?0x0:_0x511be8[_0xb834('0x19')];var _0x57c5c1=_0x5cecba?_0x3d97cc[_0xb834('0x1c')]:_0x511be8[_0xb834('0x19')]+_0x511be8[_0xb834('0x1b')];var _0x4567ed;if(_0x57c5c1>=_0x33a23b){_0x57c5c1=_0x33a23b;_0x4567ed=0xc8;}else{_0x4567ed=0xce;}_0x1a212a[_0xb834('0x17')](_0x4567ed);return _0x1a212a[_0xb834('0x1d')](_0xb834('0x1e'),_0x4d2c02+'-'+_0x57c5c1+'/'+_0x33a23b)['json'](_0x3d97cc);}return null;};}function patchUpdates(_0xc51013){return function(_0x1a4d2f){try{jsonpatch['apply'](_0x1a4d2f,_0xc51013,!![]);}catch(_0x5947af){return BPromise[_0xb834('0x1f')](_0x5947af);}return _0x1a4d2f[_0xb834('0x20')]();};}function saveUpdates(_0x11789e,_0x1beac7){return function(_0x4763e1){if(_0x4763e1){return _0x4763e1[_0xb834('0x21')](_0x11789e)['then'](function(_0x4fc1c1){return _0x4fc1c1;});}return null;};}function removeEntity(_0x1ddd80,_0x48bcd1){return function(_0x50321e){if(_0x50321e){return _0x50321e[_0xb834('0x22')]()[_0xb834('0x23')](function(){var _0x6c61a9=_0x50321e['get']({'plain':!![]});var _0x50c577='Sounds';return db['UserProfileResource'][_0xb834('0x22')]({'where':{'type':_0x50c577,'resourceId':_0x6c61a9['id']}})['then'](function(){return _0x50321e;});})[_0xb834('0x23')](function(){_0x1ddd80['status'](0xcc)[_0xb834('0x18')]();});}};}function handleEntityNotFound(_0x3b810d,_0x1e0f6f){return function(_0x403f4f){if(!_0x403f4f){_0x3b810d['sendStatus'](0x194);}return _0x403f4f;};}function handleError(_0x5725ec,_0x3c886f){_0x3c886f=_0x3c886f||0x1f4;return function(_0x2d9a77){logger[_0xb834('0x24')](_0x2d9a77[_0xb834('0x25')]);if(_0x2d9a77[_0xb834('0x26')]){delete _0x2d9a77[_0xb834('0x26')];}_0x5725ec[_0xb834('0x17')](_0x3c886f)[_0xb834('0x27')](_0x2d9a77);};}exports['index']=function(_0x2500ea,_0xbf27af){var _0x5e2dd8={},_0x23db2a={},_0x41b9e1={'count':0x0,'rows':[]};var _0x9b477d=_['map'](db[_0xb834('0x28')][_0xb834('0x29')],function(_0x4d3078){return{'name':_0x4d3078[_0xb834('0x2a')],'type':_0x4d3078[_0xb834('0x2b')][_0xb834('0x2c')]};});_0x23db2a[_0xb834('0x2d')]=_[_0xb834('0x2e')](_0x9b477d,'name');_0x23db2a['query']=_[_0xb834('0x2f')](_0x2500ea['query']);_0x23db2a[_0xb834('0x30')]=_[_0xb834('0x31')](_0x23db2a[_0xb834('0x2d')],_0x23db2a[_0xb834('0x32')]);_0x5e2dd8[_0xb834('0x33')]=_[_0xb834('0x31')](_0x23db2a[_0xb834('0x2d')],qs['fields'](_0x2500ea[_0xb834('0x32')][_0xb834('0x34')]));_0x5e2dd8[_0xb834('0x33')]=_0x5e2dd8[_0xb834('0x33')]['length']?_0x5e2dd8[_0xb834('0x33')]:_0x23db2a[_0xb834('0x2d')];if(!_0x2500ea[_0xb834('0x32')][_0xb834('0x35')]('nolimit')){_0x5e2dd8[_0xb834('0x1b')]=qs[_0xb834('0x1b')](_0x2500ea[_0xb834('0x32')][_0xb834('0x1b')]);_0x5e2dd8[_0xb834('0x19')]=qs[_0xb834('0x19')](_0x2500ea['query'][_0xb834('0x19')]);}_0x5e2dd8[_0xb834('0x36')]=qs[_0xb834('0x37')](_0x2500ea['query'][_0xb834('0x37')]);_0x5e2dd8[_0xb834('0x38')]=qs[_0xb834('0x30')](_['pick'](_0x2500ea[_0xb834('0x32')],_0x23db2a[_0xb834('0x30')]),_0x9b477d);if(_0x2500ea[_0xb834('0x32')][_0xb834('0x39')]){_0x5e2dd8[_0xb834('0x38')]=_[_0xb834('0x3a')](_0x5e2dd8[_0xb834('0x38')],{'$or':_[_0xb834('0x2e')](_0x9b477d,function(_0x48b528){if(_0x48b528[_0xb834('0x2b')]!==_0xb834('0x3b')){var _0x4cffd8={};_0x4cffd8[_0x48b528[_0xb834('0x26')]]={'$like':'%'+_0x2500ea['query']['filter']+'%'};return _0x4cffd8;}})});}_0x5e2dd8=_[_0xb834('0x3a')]({},_0x5e2dd8,_0x2500ea[_0xb834('0x3c')]);var _0x5e8077={'where':_0x5e2dd8[_0xb834('0x38')]};return db[_0xb834('0x28')]['count'](_0x5e8077)[_0xb834('0x23')](function(_0x2c49ef){_0x41b9e1[_0xb834('0x1c')]=_0x2c49ef;if(_0x2500ea[_0xb834('0x32')][_0xb834('0x3d')]){_0x5e2dd8[_0xb834('0x3e')]=[{'all':!![]}];}return db[_0xb834('0x28')][_0xb834('0x3f')](_0x5e2dd8);})['then'](function(_0x23fde7){_0x41b9e1[_0xb834('0x40')]=_0x23fde7;return _0x41b9e1;})[_0xb834('0x23')](respondWithFilteredResult(_0xbf27af,_0x5e2dd8))['catch'](handleError(_0xbf27af,null));};exports['show']=function(_0x38ecb2,_0xe8cffe){var _0x3b2e4e={'raw':!![],'where':{'id':_0x38ecb2[_0xb834('0x41')]['id']}},_0x423095={};_0x423095[_0xb834('0x2d')]=_[_0xb834('0x2f')](db[_0xb834('0x28')][_0xb834('0x29')]);_0x423095['query']=_[_0xb834('0x2f')](_0x38ecb2[_0xb834('0x32')]);_0x423095[_0xb834('0x30')]=_['intersection'](_0x423095[_0xb834('0x2d')],_0x423095[_0xb834('0x32')]);_0x3b2e4e['attributes']=_[_0xb834('0x31')](_0x423095[_0xb834('0x2d')],qs[_0xb834('0x34')](_0x38ecb2['query']['fields']));_0x3b2e4e[_0xb834('0x33')]=_0x3b2e4e[_0xb834('0x33')][_0xb834('0x42')]?_0x3b2e4e[_0xb834('0x33')]:_0x423095[_0xb834('0x2d')];if(_0x38ecb2[_0xb834('0x32')][_0xb834('0x3d')]){_0x3b2e4e[_0xb834('0x3e')]=[{'all':!![]}];}_0x3b2e4e=_[_0xb834('0x3a')]({},_0x3b2e4e,_0x38ecb2[_0xb834('0x3c')]);return db[_0xb834('0x28')][_0xb834('0x43')](_0x3b2e4e)[_0xb834('0x23')](handleEntityNotFound(_0xe8cffe,null))[_0xb834('0x23')](respondWithResult(_0xe8cffe,null))[_0xb834('0x44')](handleError(_0xe8cffe,null));};exports[_0xb834('0x45')]=function(_0xd07ce1,_0x4dc886,_0x5aab0e){return db[_0xb834('0x28')]['find']({'where':{'id':_0xd07ce1[_0xb834('0x41')]['id']},'attributes':[_0xb834('0x26'),_0xb834('0x46'),_0xb834('0x47')],'raw':!![]})[_0xb834('0x23')](handleEntityNotFound(_0x4dc886,null))[_0xb834('0x23')](function(_0x5d1682){if(_0x5d1682){if(!fs[_0xb834('0x48')](path['join'](config['root'],_0xb834('0x49'),_0x5d1682[_0xb834('0x46')]+'.'+_0x5d1682[_0xb834('0x47')]))){throw new db[(_0xb834('0x4a'))][(_0xb834('0x4b'))](_0xb834('0x4c'));}return _0x4dc886[_0xb834('0x45')](path[_0xb834('0x4d')](config[_0xb834('0x4e')],_0xb834('0x49'),util['format']('%s.%s',_0x5d1682['save_name'],_0x5d1682[_0xb834('0x47')])),util['format'](_0xb834('0x4f'),_0x5d1682[_0xb834('0x26')],_0x5d1682[_0xb834('0x47')]));}return null;})[_0xb834('0x44')](handleError(_0x4dc886,null));};exports[_0xb834('0x50')]=function(_0x31f07a,_0x329a11,_0x1f36a3){var _0x5a404a={'name':path[_0xb834('0x51')](_0x31f07a[_0xb834('0x52')]['originalname'],path[_0xb834('0x53')](_0x31f07a['file'][_0xb834('0x54')])),'save_name':path['basename'](_0x31f07a[_0xb834('0x52')][_0xb834('0x55')],path[_0xb834('0x53')](_0x31f07a['file'][_0xb834('0x55')])),'original_format':path['extname'](_0x31f07a['file'][_0xb834('0x54')])[_0xb834('0x56')](0x1),'converted_format':_0xb834('0x57')};var _0x515c70=path[_0xb834('0x4d')](config[_0xb834('0x4e')],_0xb834('0x58'),_0x31f07a[_0xb834('0x52')][_0xb834('0x55')]);var _0xef2f84=path[_0xb834('0x4d')](config[_0xb834('0x4e')],_0xb834('0x49'),util['format'](_0xb834('0x4f'),path['basename'](_0x31f07a['file'][_0xb834('0x55')],path[_0xb834('0x53')](_0x31f07a[_0xb834('0x52')][_0xb834('0x55')])),_0x5a404a[_0xb834('0x47')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x515c70);logger[_0xb834('0x59')](_0xb834('0x5a'),_0xef2f84);try{fs[_0xb834('0x5b')](_0x515c70,parseInt(_0xb834('0x5c'),0x8));var _0x3fa09f=sox[_0xb834('0x5d')](_0x515c70,_0xef2f84,{'sampleRate':0x1f40,'format':_0xb834('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3fa09f['on'](_0xb834('0x24'),function(_0x422b3f){fs['unlinkSync'](_0x515c70);_0x329a11['status'](0x1f4)[_0xb834('0x27')](_0x422b3f);});_0x3fa09f['on']('src',function(_0x4745b6){_0x5a404a['original_duration']=isNaN(_0x4745b6['duration'])?null:_0x4745b6[_0xb834('0x5e')]*0x3e8;_0x5a404a[_0xb834('0x5f')]=isNaN(_0x4745b6[_0xb834('0x60')])?null:_0x4745b6['sampleCount'];_0x5a404a[_0xb834('0x61')]=isNaN(_0x4745b6[_0xb834('0x62')])?null:_0x4745b6['channelCount'];_0x5a404a['original_bitRate']=isNaN(_0x4745b6[_0xb834('0x63')])?null:_0x4745b6['bitRate'];_0x5a404a['original_sampleRate']=isNaN(_0x4745b6[_0xb834('0x64')])?null:_0x4745b6[_0xb834('0x64')];});_0x3fa09f['on'](_0xb834('0x65'),function(_0x424a8e){_0x5a404a[_0xb834('0x66')]=isNaN(_0x424a8e[_0xb834('0x5e')])?null:_0x424a8e[_0xb834('0x5e')]*0x3e8;_0x5a404a[_0xb834('0x67')]=isNaN(_0x424a8e[_0xb834('0x60')])?null:_0x424a8e[_0xb834('0x60')];_0x5a404a[_0xb834('0x68')]=isNaN(_0x424a8e[_0xb834('0x62')])?null:_0x424a8e['channelCount'];_0x5a404a['converted_bitRate']=isNaN(_0x424a8e['bitRate'])?null:_0x424a8e[_0xb834('0x63')];_0x5a404a['converted_sampleRate']=isNaN(_0x424a8e[_0xb834('0x64')])?null:_0x424a8e[_0xb834('0x64')];});_0x3fa09f['on'](_0xb834('0x18'),function(){fs[_0xb834('0x5b')](_0xef2f84,parseInt('0777',0x8));return db[_0xb834('0x28')][_0xb834('0x50')](_0x5a404a)[_0xb834('0x23')](function(_0x398e40){var _0x5372c7={'role':_0x31f07a[_0xb834('0x69')]['role'],'userProfileId':_0x31f07a[_0xb834('0x69')][_0xb834('0x6a')]};if(!_0x5372c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5372c7[_0xb834('0x6b')]===_0xb834('0x6c')){var _0x52521b=_0x398e40['get']({'plain':!![]});return db[_0xb834('0x6d')][_0xb834('0x43')]({'where':{'name':_0xb834('0x6e'),'userProfileId':_0x5372c7[_0xb834('0x6a')]},'raw':!![]})[_0xb834('0x23')](function(_0x598656){if(_0x598656&&_0x598656[_0xb834('0x6f')]===0x0){return db[_0xb834('0x70')][_0xb834('0x50')]({'name':_0x52521b[_0xb834('0x26')],'resourceId':_0x52521b['id'],'type':_0x598656[_0xb834('0x26')],'sectionId':_0x598656['id']},{})['then'](function(){return _0x398e40;});}else{return _0x398e40;}})[_0xb834('0x44')](function(_0x184214){logger[_0xb834('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x184214);throw _0x184214;});}return _0x398e40;})[_0xb834('0x23')](respondWithResult(_0x329a11,null))['catch'](handleError(_0x329a11,null));});_0x3fa09f['start']();}catch(_0x3f0fa6){_0x329a11['status'](0x1f4)[_0xb834('0x27')](_0x3f0fa6);}};exports[_0xb834('0x21')]=function(_0x55ec7a,_0x5248f3,_0x477f36){return db[_0xb834('0x28')]['find']({'where':{'id':_0x55ec7a['params']['id']}})[_0xb834('0x23')](handleEntityNotFound(_0x5248f3,null))[_0xb834('0x23')](saveUpdates(_['pick'](_0x55ec7a[_0xb834('0x69')],[_0xb834('0x26'),_0xb834('0x71')]),null))['then'](respondWithResult(_0x5248f3,null))['catch'](handleError(_0x5248f3,null));};exports[_0xb834('0x72')]=function(_0x25148b,_0x35783d,_0x577aee){return db[_0xb834('0x28')][_0xb834('0x43')]({'where':{'id':_0x25148b['params']['id']}})[_0xb834('0x23')](function(_0x5ffeaa){if(_0x5ffeaa){return _0x5ffeaa['destroy']();}})[_0xb834('0x23')](function(_0x621e2){var _0x141e9c=path['join'](config[_0xb834('0x4e')],_0xb834('0x58'),util[_0xb834('0x73')](_0xb834('0x4f'),_0x621e2[_0xb834('0x46')],_0x621e2[_0xb834('0x74')]));var _0x24d800=path['join'](config[_0xb834('0x4e')],_0xb834('0x49'),util[_0xb834('0x73')](_0xb834('0x4f'),_0x621e2[_0xb834('0x46')],_0x621e2['converted_format']));fs[_0xb834('0x75')](_0x141e9c);fs[_0xb834('0x75')](_0x24d800);return _0x621e2;})['then'](function(_0x244dc2){if(_0x244dc2){return _0x35783d[_0xb834('0x17')](0xcc)[_0xb834('0x18')]();}})[_0xb834('0x23')](handleEntityNotFound(_0x35783d,null))[_0xb834('0x44')](handleError(_0x35783d,null));};
\ No newline at end of file
index bf93faa..5b749aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x638e=['Sound','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./sound.attributes','exports'];(function(_0x3c563f,_0x20fab0){var _0x566dfd=function(_0x313972){while(--_0x313972){_0x3c563f['push'](_0x3c563f['shift']());}};_0x566dfd(++_0x20fab0);}(_0x638e,0x85));var _0xe638=function(_0xfe7ce3,_0x394ba8){_0xfe7ce3=_0xfe7ce3-0x0;var _0x108672=_0x638e[_0xfe7ce3];return _0x108672;};'use strict';var _=require(_0xe638('0x0'));var util=require(_0xe638('0x1'));var logger=require(_0xe638('0x2'))(_0xe638('0x3'));var moment=require(_0xe638('0x4'));var BPromise=require(_0xe638('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe638('0x6'));var rimraf=require(_0xe638('0x7'));var config=require('../../config/environment');var attributes=require(_0xe638('0x8'));module[_0xe638('0x9')]=function(_0x3639b7,_0x5edf2e){return _0x3639b7['define'](_0xe638('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cae=['moment','rimraf','exports','Sound','lodash','util','../../config/logger','api'];(function(_0x4be24f,_0x2b4b23){var _0x5ce2c3=function(_0x4f6829){while(--_0x4f6829){_0x4be24f['push'](_0x4be24f['shift']());}};_0x5ce2c3(++_0x2b4b23);}(_0x1cae,0x11c));var _0xe1ca=function(_0x4cbd85,_0x3c4c4f){_0x4cbd85=_0x4cbd85-0x0;var _0x1e9cba=_0x1cae[_0x4cbd85];return _0x1e9cba;};'use strict';var _=require(_0xe1ca('0x0'));var util=require(_0xe1ca('0x1'));var logger=require(_0xe1ca('0x2'))(_0xe1ca('0x3'));var moment=require(_0xe1ca('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe1ca('0x5'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0xe1ca('0x6')]=function(_0x463149,_0x24d113){return _0x463149['define'](_0xe1ca('0x7'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12810b8..b2a7985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bef=['Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Sound','find','options','raw','attributes','map','model','include','ShowSound','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3110b8,_0x1e54b1){var _0xd41d04=function(_0x1eb317){while(--_0x1eb317){_0x3110b8['push'](_0x3110b8['shift']());}};_0xd41d04(++_0x1e54b1);}(_0x8bef,0x167));var _0xf8be=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0x8bef[_0x4e0026];return _0x3f8ee7;};'use strict';var _=require(_0xf8be('0x0'));var util=require(_0xf8be('0x1'));var moment=require(_0xf8be('0x2'));var BPromise=require(_0xf8be('0x3'));var rs=require(_0xf8be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8be('0x5'))['db'];var utils=require(_0xf8be('0x6'));var logger=require(_0xf8be('0x7'))(_0xf8be('0x8'));var config=require(_0xf8be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf8be('0xa')][_0xf8be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x240fcf,_0x4b03a5,_0x1b3c0d){return new BPromise(function(_0x3d5dc7,_0x274ddb){return client[_0xf8be('0xc')](_0x240fcf,_0x1b3c0d)[_0xf8be('0xd')](function(_0x24ca31){logger[_0xf8be('0xe')](_0xf8be('0xf'),_0x4b03a5,_0xf8be('0x10'));logger['debug'](_0xf8be('0x11'),_0x4b03a5,_0xf8be('0x10'),JSON[_0xf8be('0x12')](_0x24ca31));if(_0x24ca31['error']){if(_0x24ca31[_0xf8be('0x13')][_0xf8be('0x14')]===0x1f4){logger['error'](_0xf8be('0xf'),_0x4b03a5,_0x24ca31[_0xf8be('0x13')][_0xf8be('0x15')]);return _0x274ddb(_0x24ca31['error'][_0xf8be('0x15')]);}logger[_0xf8be('0x13')](_0xf8be('0xf'),_0x4b03a5,_0x24ca31['error']['message']);return _0x3d5dc7(_0x24ca31['error'][_0xf8be('0x15')]);}else{logger[_0xf8be('0xe')](_0xf8be('0xf'),_0x4b03a5,_0xf8be('0x10'));_0x3d5dc7(_0x24ca31[_0xf8be('0x16')]['message']);}})[_0xf8be('0x17')](function(_0x5c5c43){logger['error'](_0xf8be('0xf'),_0x4b03a5,_0x5c5c43);_0x274ddb(_0x5c5c43);});});}exports['ShowSound']=function(_0x2da7a9){var _0x619182=this;return new Promise(function(_0x5e7f17,_0xd790e9){return db[_0xf8be('0x18')][_0xf8be('0x19')]({'raw':_0x2da7a9[_0xf8be('0x1a')]?_0x2da7a9['options'][_0xf8be('0x1b')]===undefined?!![]:![]:!![],'where':_0x2da7a9[_0xf8be('0x1a')]?_0x2da7a9[_0xf8be('0x1a')]['where']||null:null,'attributes':_0x2da7a9[_0xf8be('0x1a')]?_0x2da7a9['options'][_0xf8be('0x1c')]||null:null,'include':_0x2da7a9['options']?_0x2da7a9[_0xf8be('0x1a')]['include']?_[_0xf8be('0x1d')](_0x2da7a9[_0xf8be('0x1a')]['include'],function(_0x311ed3){return{'model':db[_0x311ed3[_0xf8be('0x1e')]],'as':_0x311ed3['as'],'attributes':_0x311ed3[_0xf8be('0x1c')],'include':_0x311ed3[_0xf8be('0x1f')]?_[_0xf8be('0x1d')](_0x311ed3['include'],function(_0x4b9364){return{'model':db[_0x4b9364['model']],'as':_0x4b9364['as'],'attributes':_0x4b9364['attributes'],'include':_0x4b9364[_0xf8be('0x1f')]?_[_0xf8be('0x1d')](_0x4b9364[_0xf8be('0x1f')],function(_0x21b712){return{'model':db[_0x21b712[_0xf8be('0x1e')]],'as':_0x21b712['as'],'attributes':_0x21b712[_0xf8be('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf8be('0xd')](function(_0x28a9e6){logger[_0xf8be('0xe')](_0xf8be('0x20'),_0x2da7a9);logger[_0xf8be('0x21')]('ShowSound',_0x2da7a9,JSON[_0xf8be('0x12')](_0x28a9e6));_0x5e7f17(_0x28a9e6);})[_0xf8be('0x17')](function(_0x3ee200){logger[_0xf8be('0x13')](_0xf8be('0x20'),_0x3ee200['message'],_0x2da7a9);_0xd790e9(_0x619182[_0xf8be('0x13')](0x1f4,_0x3ee200[_0xf8be('0x15')]));});});};
\ No newline at end of file
+var _0xf2c0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','options','where','attributes','model','include','map','stringify','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf2c0,0x9f));var _0x0f2c=function(_0xa6dac,_0x463a69){_0xa6dac=_0xa6dac-0x0;var _0x2e1551=_0xf2c0[_0xa6dac];return _0x2e1551;};'use strict';var _=require(_0x0f2c('0x0'));var util=require(_0x0f2c('0x1'));var moment=require(_0x0f2c('0x2'));var BPromise=require(_0x0f2c('0x3'));var rs=require(_0x0f2c('0x4'));var fs=require('fs');var Redis=require(_0x0f2c('0x5'));var db=require(_0x0f2c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f2c('0x7'))(_0x0f2c('0x8'));var config=require(_0x0f2c('0x9'));var jayson=require(_0x0f2c('0xa'));var client=jayson[_0x0f2c('0xb')][_0x0f2c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x137127,_0x2a7242,_0x480acf){return new BPromise(function(_0x1e16d4,_0x30ab8e){return client['request'](_0x137127,_0x480acf)[_0x0f2c('0xd')](function(_0x56997c){logger[_0x0f2c('0xe')]('Sound,\x20%s,\x20%s',_0x2a7242,_0x0f2c('0xf'));logger['debug'](_0x0f2c('0x10'),_0x2a7242,'request\x20sent',JSON['stringify'](_0x56997c));if(_0x56997c[_0x0f2c('0x11')]){if(_0x56997c[_0x0f2c('0x11')][_0x0f2c('0x12')]===0x1f4){logger[_0x0f2c('0x11')](_0x0f2c('0x13'),_0x2a7242,_0x56997c['error']['message']);return _0x30ab8e(_0x56997c[_0x0f2c('0x11')][_0x0f2c('0x14')]);}logger['error']('Sound,\x20%s,\x20%s',_0x2a7242,_0x56997c[_0x0f2c('0x11')][_0x0f2c('0x14')]);return _0x1e16d4(_0x56997c['error'][_0x0f2c('0x14')]);}else{logger[_0x0f2c('0xe')](_0x0f2c('0x13'),_0x2a7242,_0x0f2c('0xf'));_0x1e16d4(_0x56997c[_0x0f2c('0x15')]['message']);}})[_0x0f2c('0x16')](function(_0xdcb3be){logger[_0x0f2c('0x11')]('Sound,\x20%s,\x20%s',_0x2a7242,_0xdcb3be);_0x30ab8e(_0xdcb3be);});});}exports[_0x0f2c('0x17')]=function(_0x177319){var _0x4f6114=this;return new Promise(function(_0x27c36b,_0x368bef){return db[_0x0f2c('0x18')]['find']({'raw':_0x177319[_0x0f2c('0x19')]?_0x177319[_0x0f2c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x177319[_0x0f2c('0x19')]?_0x177319[_0x0f2c('0x19')][_0x0f2c('0x1a')]||null:null,'attributes':_0x177319[_0x0f2c('0x19')]?_0x177319['options'][_0x0f2c('0x1b')]||null:null,'include':_0x177319[_0x0f2c('0x19')]?_0x177319[_0x0f2c('0x19')]['include']?_['map'](_0x177319[_0x0f2c('0x19')]['include'],function(_0x2a9efa){return{'model':db[_0x2a9efa[_0x0f2c('0x1c')]],'as':_0x2a9efa['as'],'attributes':_0x2a9efa['attributes'],'include':_0x2a9efa[_0x0f2c('0x1d')]?_[_0x0f2c('0x1e')](_0x2a9efa[_0x0f2c('0x1d')],function(_0x318a11){return{'model':db[_0x318a11[_0x0f2c('0x1c')]],'as':_0x318a11['as'],'attributes':_0x318a11[_0x0f2c('0x1b')],'include':_0x318a11[_0x0f2c('0x1d')]?_['map'](_0x318a11['include'],function(_0x367a33){return{'model':db[_0x367a33['model']],'as':_0x367a33['as'],'attributes':_0x367a33[_0x0f2c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0f2c('0xd')](function(_0x4a3991){logger['info'](_0x0f2c('0x17'),_0x177319);logger['debug'](_0x0f2c('0x17'),_0x177319,JSON[_0x0f2c('0x1f')](_0x4a3991));_0x27c36b(_0x4a3991);})['catch'](function(_0x1c8561){logger['error'](_0x0f2c('0x17'),_0x1c8561[_0x0f2c('0x14')],_0x177319);_0x368bef(_0x4f6114[_0x0f2c('0x11')](0x1f4,_0x1c8561['message']));});});};
\ No newline at end of file
index 7231a94..f618d72 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(_0x528bfd,_0x3e8e19){var _0x4c7e4f=function(_0x344b44){while(--_0x344b44){_0x528bfd['push'](_0x528bfd['shift']());}};_0x4c7e4f(++_0x3e8e19);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x1ca122,_0x5cab7c){var _0x50d1ba=function(_0x562ae9){while(--_0x562ae9){_0x1ca122['push'](_0x1ca122['shift']());}};_0x50d1ba(++_0x5cab7c);}(_0xda2d,0x102));var _0xdda2=function(_0x19dcf9,_0x3e0613){_0x19dcf9=_0x19dcf9-0x0;var _0xf094b3=_0xda2d[_0x19dcf9];return _0xf094b3;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router;
\ No newline at end of file
index 823d6d5..ba6e152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd77b=['STRING','out','TEXT'];(function(_0x2828fe,_0x2e224f){var _0x2ee178=function(_0x5c736b){while(--_0x5c736b){_0x2828fe['push'](_0x2828fe['shift']());}};_0x2ee178(++_0x2e224f);}(_0xd77b,0xe1));var _0xbd77=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xd77b[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbd77('0x0')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbd77('0x1')),'defaultValue':_0xbd77('0x1'),'allowNull':![]},'providerName':{'type':Sequelize[_0xbd77('0x0')]},'providerResponse':{'type':Sequelize[_0xbd77('0x2')]}};
\ No newline at end of file
+var _0x2ef4=['out','exports','STRING','TEXT','medium','ENUM'];(function(_0x370c57,_0x5023b9){var _0x5d3b28=function(_0x19104b){while(--_0x19104b){_0x370c57['push'](_0x370c57['shift']());}};_0x5d3b28(++_0x5023b9);}(_0x2ef4,0xe5));var _0x42ef=function(_0x59a135,_0x5316d8){_0x59a135=_0x59a135-0x0;var _0x3cd388=_0x2ef4[_0x59a135];return _0x3cd388;};'use strict';var Sequelize=require('sequelize');module[_0x42ef('0x0')]={'uniqueid':{'type':Sequelize[_0x42ef('0x1')]},'body':{'type':Sequelize[_0x42ef('0x2')](_0x42ef('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x42ef('0x4')]('in',_0x42ef('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x42ef('0x1')]},'providerResponse':{'type':Sequelize[_0x42ef('0x2')]}};
\ No newline at end of file
index 179713f..3accd8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd739=['rows','params','keys','rawAttributes','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll'];(function(_0xf1a7e0,_0x124528){var _0x20bf44=function(_0x2744c0){while(--_0x2744c0){_0xf1a7e0['push'](_0xf1a7e0['shift']());}};_0x20bf44(++_0x124528);}(_0xd739,0x135));var _0x9d73=function(_0x16941d,_0x133b71){_0x16941d=_0x16941d-0x0;var _0x4501e5=_0xd739[_0x16941d];return _0x4501e5;};'use strict';var emlformat=require(_0x9d73('0x0'));var rimraf=require(_0x9d73('0x1'));var zipdir=require(_0x9d73('0x2'));var jsonpatch=require(_0x9d73('0x3'));var rp=require(_0x9d73('0x4'));var moment=require('moment');var BPromise=require(_0x9d73('0x5'));var Mustache=require(_0x9d73('0x6'));var util=require(_0x9d73('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9d73('0x8'));var ejs=require(_0x9d73('0x9'));var fs=require('fs');var fs_extra=require(_0x9d73('0xa'));var _=require(_0x9d73('0xb'));var squel=require(_0x9d73('0xc'));var crypto=require('crypto');var jsforce=require(_0x9d73('0xd'));var deskjs=require(_0x9d73('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9d73('0xf'));var Papa=require(_0x9d73('0x10'));var Redis=require(_0x9d73('0x11'));var authService=require(_0x9d73('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d73('0x13'));var logger=require(_0x9d73('0x14'))(_0x9d73('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d73('0x16'));var db=require(_0x9d73('0x17'))['db'];function respondWithStatusCode(_0x51a818,_0x306dcd){_0x306dcd=_0x306dcd||0xcc;return function(_0x5d75cd){if(_0x5d75cd){return _0x51a818[_0x9d73('0x18')](_0x306dcd);}return _0x51a818[_0x9d73('0x19')](_0x306dcd)[_0x9d73('0x1a')]();};}function respondWithResult(_0x5011a4,_0x514490){_0x514490=_0x514490||0xc8;return function(_0x3a25d6){if(_0x3a25d6){return _0x5011a4[_0x9d73('0x19')](_0x514490)[_0x9d73('0x1b')](_0x3a25d6);}};}function respondWithFilteredResult(_0x3d9a2d,_0x3a93ed){return function(_0x24d72a){if(_0x24d72a){var _0x2046cb=typeof _0x3a93ed['offset']===_0x9d73('0x1c')&&typeof _0x3a93ed[_0x9d73('0x1d')]===_0x9d73('0x1c');var _0x4b75bb=_0x24d72a[_0x9d73('0x1e')];var _0x5114e7=_0x2046cb?0x0:_0x3a93ed['offset'];var _0x518143=_0x2046cb?_0x24d72a[_0x9d73('0x1e')]:_0x3a93ed['offset']+_0x3a93ed['limit'];var _0x39a6ec;if(_0x518143>=_0x4b75bb){_0x518143=_0x4b75bb;_0x39a6ec=0xc8;}else{_0x39a6ec=0xce;}_0x3d9a2d[_0x9d73('0x19')](_0x39a6ec);return _0x3d9a2d[_0x9d73('0x1f')](_0x9d73('0x20'),_0x5114e7+'-'+_0x518143+'/'+_0x4b75bb)[_0x9d73('0x1b')](_0x24d72a);}return null;};}function patchUpdates(_0x54d761){return function(_0x6e52b5){try{jsonpatch[_0x9d73('0x21')](_0x6e52b5,_0x54d761,!![]);}catch(_0x5bab69){return BPromise[_0x9d73('0x22')](_0x5bab69);}return _0x6e52b5[_0x9d73('0x23')]();};}function saveUpdates(_0x58bb76,_0x544a4a){return function(_0x10792d){if(_0x10792d){return _0x10792d[_0x9d73('0x24')](_0x58bb76)[_0x9d73('0x25')](function(_0x284331){return _0x284331;});}return null;};}function removeEntity(_0x1a2c3a,_0x5cfbc2){return function(_0x2f680d){if(_0x2f680d){return _0x2f680d[_0x9d73('0x26')]()['then'](function(){_0x1a2c3a[_0x9d73('0x19')](0xcc)[_0x9d73('0x1a')]();});}};}function handleEntityNotFound(_0xf185e4,_0x1dc4da){return function(_0x28e362){if(!_0x28e362){_0xf185e4['sendStatus'](0x194);}return _0x28e362;};}function handleError(_0x1e32e7,_0x27375e){_0x27375e=_0x27375e||0x1f4;return function(_0x2d6a25){logger[_0x9d73('0x27')](_0x2d6a25[_0x9d73('0x28')]);if(_0x2d6a25[_0x9d73('0x29')]){delete _0x2d6a25['name'];}_0x1e32e7[_0x9d73('0x19')](_0x27375e)['send'](_0x2d6a25);};}exports[_0x9d73('0x2a')]=function(_0x12cd23,_0x198b0a){var _0x50e63d={},_0x52422e={},_0x4e1c95={'count':0x0,'rows':[]};var _0x59575b=_[_0x9d73('0x2b')](db[_0x9d73('0x2c')]['rawAttributes'],function(_0x5a33fe){return{'name':_0x5a33fe[_0x9d73('0x2d')],'type':_0x5a33fe[_0x9d73('0x2e')][_0x9d73('0x2f')]};});_0x52422e[_0x9d73('0x30')]=_[_0x9d73('0x2b')](_0x59575b,_0x9d73('0x29'));_0x52422e[_0x9d73('0x31')]=_['keys'](_0x12cd23['query']);_0x52422e[_0x9d73('0x32')]=_[_0x9d73('0x33')](_0x52422e[_0x9d73('0x30')],_0x52422e[_0x9d73('0x31')]);_0x50e63d[_0x9d73('0x34')]=_['intersection'](_0x52422e[_0x9d73('0x30')],qs['fields'](_0x12cd23[_0x9d73('0x31')][_0x9d73('0x35')]));_0x50e63d[_0x9d73('0x34')]=_0x50e63d[_0x9d73('0x34')][_0x9d73('0x36')]?_0x50e63d[_0x9d73('0x34')]:_0x52422e['model'];if(!_0x12cd23['query'][_0x9d73('0x37')]('nolimit')){_0x50e63d['limit']=qs[_0x9d73('0x1d')](_0x12cd23[_0x9d73('0x31')][_0x9d73('0x1d')]);_0x50e63d[_0x9d73('0x38')]=qs['offset'](_0x12cd23[_0x9d73('0x31')][_0x9d73('0x38')]);}_0x50e63d[_0x9d73('0x39')]=qs[_0x9d73('0x3a')](_0x12cd23[_0x9d73('0x31')][_0x9d73('0x3a')]);_0x50e63d['where']=qs[_0x9d73('0x32')](_['pick'](_0x12cd23['query'],_0x52422e['filters']),_0x59575b);if(_0x12cd23['query']['filter']){_0x50e63d[_0x9d73('0x3b')]=_[_0x9d73('0x3c')](_0x50e63d[_0x9d73('0x3b')],{'$or':_[_0x9d73('0x2b')](_0x59575b,function(_0x249f2d){if(_0x249f2d['type']!==_0x9d73('0x3d')){var _0x353630={};_0x353630[_0x249f2d[_0x9d73('0x29')]]={'$like':'%'+_0x12cd23['query'][_0x9d73('0x3e')]+'%'};return _0x353630;}})});}_0x50e63d=_[_0x9d73('0x3c')]({},_0x50e63d,_0x12cd23['options']);var _0x26ac24={'where':_0x50e63d[_0x9d73('0x3b')]};return db[_0x9d73('0x2c')][_0x9d73('0x1e')](_0x26ac24)['then'](function(_0x5e35a6){_0x4e1c95[_0x9d73('0x1e')]=_0x5e35a6;if(_0x12cd23[_0x9d73('0x31')][_0x9d73('0x3f')]){_0x50e63d[_0x9d73('0x40')]=[{'all':!![]}];}return db[_0x9d73('0x2c')][_0x9d73('0x41')](_0x50e63d);})['then'](function(_0x344517){_0x4e1c95[_0x9d73('0x42')]=_0x344517;return _0x4e1c95;})[_0x9d73('0x25')](respondWithFilteredResult(_0x198b0a,_0x50e63d))['catch'](handleError(_0x198b0a,null));};exports['show']=function(_0x4f859a,_0x34f449){var _0xe87967={'raw':!![],'where':{'id':_0x4f859a[_0x9d73('0x43')]['id']}},_0x125b17={};_0x125b17[_0x9d73('0x30')]=_[_0x9d73('0x44')](db[_0x9d73('0x2c')][_0x9d73('0x45')]);_0x125b17[_0x9d73('0x31')]=_[_0x9d73('0x44')](_0x4f859a[_0x9d73('0x31')]);_0x125b17[_0x9d73('0x32')]=_[_0x9d73('0x33')](_0x125b17[_0x9d73('0x30')],_0x125b17[_0x9d73('0x31')]);_0xe87967[_0x9d73('0x34')]=_[_0x9d73('0x33')](_0x125b17[_0x9d73('0x30')],qs[_0x9d73('0x35')](_0x4f859a[_0x9d73('0x31')][_0x9d73('0x35')]));_0xe87967[_0x9d73('0x34')]=_0xe87967[_0x9d73('0x34')]['length']?_0xe87967[_0x9d73('0x34')]:_0x125b17[_0x9d73('0x30')];if(_0x4f859a[_0x9d73('0x31')][_0x9d73('0x3f')]){_0xe87967[_0x9d73('0x40')]=[{'all':!![]}];}_0xe87967=_['merge']({},_0xe87967,_0x4f859a[_0x9d73('0x46')]);return db[_0x9d73('0x2c')][_0x9d73('0x47')](_0xe87967)['then'](handleEntityNotFound(_0x34f449,null))['then'](respondWithResult(_0x34f449,null))['catch'](handleError(_0x34f449,null));};exports['create']=function(_0x4939ce,_0x50845e){return db[_0x9d73('0x2c')][_0x9d73('0x48')](_0x4939ce[_0x9d73('0x49')],{})[_0x9d73('0x25')](respondWithResult(_0x50845e,0xc9))[_0x9d73('0x4a')](handleError(_0x50845e,null));};exports['update']=function(_0x36211a,_0x291460){if(_0x36211a['body']['id']){delete _0x36211a[_0x9d73('0x49')]['id'];}return db['SquareMessage'][_0x9d73('0x47')]({'where':{'id':_0x36211a[_0x9d73('0x43')]['id']}})[_0x9d73('0x25')](handleEntityNotFound(_0x291460,null))[_0x9d73('0x25')](saveUpdates(_0x36211a[_0x9d73('0x49')],null))['then'](respondWithResult(_0x291460,null))[_0x9d73('0x4a')](handleError(_0x291460,null));};exports[_0x9d73('0x26')]=function(_0x576982,_0x5a6760){return db[_0x9d73('0x2c')][_0x9d73('0x47')]({'where':{'id':_0x576982[_0x9d73('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a6760,null))['then'](removeEntity(_0x5a6760,null))[_0x9d73('0x4a')](handleError(_0x5a6760,null));};
\ No newline at end of file
+var _0x5d2f=['end','json','offset','limit','count','Content-Range','apply','save','then','destroy','error','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2a0a14,_0x21f6e2){var _0x22736e=function(_0x3efdf1){while(--_0x3efdf1){_0x2a0a14['push'](_0x2a0a14['shift']());}};_0x22736e(++_0x21f6e2);}(_0x5d2f,0x17d));var _0xf5d2=function(_0x21c09f,_0x6ce866){_0x21c09f=_0x21c09f-0x0;var _0x164d58=_0x5d2f[_0x21c09f];return _0x164d58;};'use strict';var emlformat=require(_0xf5d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5d2('0x1'));var jsonpatch=require(_0xf5d2('0x2'));var rp=require(_0xf5d2('0x3'));var moment=require(_0xf5d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf5d2('0x5'));var util=require(_0xf5d2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf5d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5d2('0x8'));var _=require(_0xf5d2('0x9'));var squel=require(_0xf5d2('0xa'));var crypto=require('crypto');var jsforce=require(_0xf5d2('0xb'));var deskjs=require(_0xf5d2('0xc'));var toCsv=require(_0xf5d2('0x7'));var querystring=require(_0xf5d2('0xd'));var Papa=require(_0xf5d2('0xe'));var Redis=require(_0xf5d2('0xf'));var authService=require(_0xf5d2('0x10'));var qs=require(_0xf5d2('0x11'));var as=require(_0xf5d2('0x12'));var hardwareService=require(_0xf5d2('0x13'));var logger=require(_0xf5d2('0x14'))('api');var utils=require(_0xf5d2('0x15'));var config=require(_0xf5d2('0x16'));var licenseUtil=require(_0xf5d2('0x17'));var db=require(_0xf5d2('0x18'))['db'];function respondWithStatusCode(_0x862893,_0x45a78b){_0x45a78b=_0x45a78b||0xcc;return function(_0x18643d){if(_0x18643d){return _0x862893[_0xf5d2('0x19')](_0x45a78b);}return _0x862893[_0xf5d2('0x1a')](_0x45a78b)[_0xf5d2('0x1b')]();};}function respondWithResult(_0x4e3dbe,_0x3feeae){_0x3feeae=_0x3feeae||0xc8;return function(_0x235d16){if(_0x235d16){return _0x4e3dbe[_0xf5d2('0x1a')](_0x3feeae)[_0xf5d2('0x1c')](_0x235d16);}};}function respondWithFilteredResult(_0x19ff31,_0x10ebe5){return function(_0x1925d0){if(_0x1925d0){var _0x294af7=typeof _0x10ebe5[_0xf5d2('0x1d')]==='undefined'&&typeof _0x10ebe5[_0xf5d2('0x1e')]==='undefined';var _0x4feb1e=_0x1925d0[_0xf5d2('0x1f')];var _0xcce1ad=_0x294af7?0x0:_0x10ebe5[_0xf5d2('0x1d')];var _0x1f1d54=_0x294af7?_0x1925d0[_0xf5d2('0x1f')]:_0x10ebe5[_0xf5d2('0x1d')]+_0x10ebe5[_0xf5d2('0x1e')];var _0x20623c;if(_0x1f1d54>=_0x4feb1e){_0x1f1d54=_0x4feb1e;_0x20623c=0xc8;}else{_0x20623c=0xce;}_0x19ff31[_0xf5d2('0x1a')](_0x20623c);return _0x19ff31['set'](_0xf5d2('0x20'),_0xcce1ad+'-'+_0x1f1d54+'/'+_0x4feb1e)[_0xf5d2('0x1c')](_0x1925d0);}return null;};}function patchUpdates(_0x2b46ef){return function(_0x451743){try{jsonpatch[_0xf5d2('0x21')](_0x451743,_0x2b46ef,!![]);}catch(_0x2c5a3e){return BPromise['reject'](_0x2c5a3e);}return _0x451743[_0xf5d2('0x22')]();};}function saveUpdates(_0x1805e7,_0x446b27){return function(_0x43e3d4){if(_0x43e3d4){return _0x43e3d4['update'](_0x1805e7)[_0xf5d2('0x23')](function(_0x380234){return _0x380234;});}return null;};}function removeEntity(_0x1acdd1,_0x23dd3d){return function(_0xcbe249){if(_0xcbe249){return _0xcbe249[_0xf5d2('0x24')]()['then'](function(){_0x1acdd1[_0xf5d2('0x1a')](0xcc)[_0xf5d2('0x1b')]();});}};}function handleEntityNotFound(_0x285c31,_0x14c57a){return function(_0x5b07d0){if(!_0x5b07d0){_0x285c31[_0xf5d2('0x19')](0x194);}return _0x5b07d0;};}function handleError(_0x2e35e7,_0x2733eb){_0x2733eb=_0x2733eb||0x1f4;return function(_0x5f04ef){logger[_0xf5d2('0x25')](_0x5f04ef['stack']);if(_0x5f04ef[_0xf5d2('0x26')]){delete _0x5f04ef[_0xf5d2('0x26')];}_0x2e35e7[_0xf5d2('0x1a')](_0x2733eb)['send'](_0x5f04ef);};}exports[_0xf5d2('0x27')]=function(_0x5a4ce6,_0x4db99c){var _0x217a7e={},_0x581a79={},_0x4c9bb0={'count':0x0,'rows':[]};var _0x56f99c=_[_0xf5d2('0x28')](db[_0xf5d2('0x29')][_0xf5d2('0x2a')],function(_0x29727b){return{'name':_0x29727b[_0xf5d2('0x2b')],'type':_0x29727b[_0xf5d2('0x2c')][_0xf5d2('0x2d')]};});_0x581a79[_0xf5d2('0x2e')]=_['map'](_0x56f99c,'name');_0x581a79[_0xf5d2('0x2f')]=_[_0xf5d2('0x30')](_0x5a4ce6[_0xf5d2('0x2f')]);_0x581a79[_0xf5d2('0x31')]=_[_0xf5d2('0x32')](_0x581a79['model'],_0x581a79[_0xf5d2('0x2f')]);_0x217a7e[_0xf5d2('0x33')]=_['intersection'](_0x581a79[_0xf5d2('0x2e')],qs['fields'](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x34')]));_0x217a7e[_0xf5d2('0x33')]=_0x217a7e[_0xf5d2('0x33')][_0xf5d2('0x35')]?_0x217a7e[_0xf5d2('0x33')]:_0x581a79['model'];if(!_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x36')]('nolimit')){_0x217a7e[_0xf5d2('0x1e')]=qs[_0xf5d2('0x1e')](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x1e')]);_0x217a7e[_0xf5d2('0x1d')]=qs[_0xf5d2('0x1d')](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x1d')]);}_0x217a7e['order']=qs['sort'](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x37')]);_0x217a7e[_0xf5d2('0x38')]=qs[_0xf5d2('0x31')](_['pick'](_0x5a4ce6['query'],_0x581a79['filters']),_0x56f99c);if(_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x39')]){_0x217a7e[_0xf5d2('0x38')]=_[_0xf5d2('0x3a')](_0x217a7e['where'],{'$or':_[_0xf5d2('0x28')](_0x56f99c,function(_0x225e2b){if(_0x225e2b[_0xf5d2('0x2c')]!=='VIRTUAL'){var _0x21959b={};_0x21959b[_0x225e2b[_0xf5d2('0x26')]]={'$like':'%'+_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x39')]+'%'};return _0x21959b;}})});}_0x217a7e=_[_0xf5d2('0x3a')]({},_0x217a7e,_0x5a4ce6[_0xf5d2('0x3b')]);var _0x1c8d0e={'where':_0x217a7e['where']};return db['SquareMessage'][_0xf5d2('0x1f')](_0x1c8d0e)[_0xf5d2('0x23')](function(_0x23bfbf){_0x4c9bb0[_0xf5d2('0x1f')]=_0x23bfbf;if(_0x5a4ce6['query'][_0xf5d2('0x3c')]){_0x217a7e[_0xf5d2('0x3d')]=[{'all':!![]}];}return db[_0xf5d2('0x29')][_0xf5d2('0x3e')](_0x217a7e);})['then'](function(_0x23dc08){_0x4c9bb0['rows']=_0x23dc08;return _0x4c9bb0;})[_0xf5d2('0x23')](respondWithFilteredResult(_0x4db99c,_0x217a7e))[_0xf5d2('0x3f')](handleError(_0x4db99c,null));};exports['show']=function(_0x5b8645,_0x1b2faa){var _0x115957={'raw':!![],'where':{'id':_0x5b8645[_0xf5d2('0x40')]['id']}},_0x1d2914={};_0x1d2914[_0xf5d2('0x2e')]=_['keys'](db[_0xf5d2('0x29')][_0xf5d2('0x2a')]);_0x1d2914['query']=_[_0xf5d2('0x30')](_0x5b8645[_0xf5d2('0x2f')]);_0x1d2914[_0xf5d2('0x31')]=_[_0xf5d2('0x32')](_0x1d2914[_0xf5d2('0x2e')],_0x1d2914[_0xf5d2('0x2f')]);_0x115957[_0xf5d2('0x33')]=_[_0xf5d2('0x32')](_0x1d2914['model'],qs[_0xf5d2('0x34')](_0x5b8645[_0xf5d2('0x2f')][_0xf5d2('0x34')]));_0x115957[_0xf5d2('0x33')]=_0x115957[_0xf5d2('0x33')][_0xf5d2('0x35')]?_0x115957[_0xf5d2('0x33')]:_0x1d2914[_0xf5d2('0x2e')];if(_0x5b8645['query'][_0xf5d2('0x3c')]){_0x115957[_0xf5d2('0x3d')]=[{'all':!![]}];}_0x115957=_['merge']({},_0x115957,_0x5b8645[_0xf5d2('0x3b')]);return db[_0xf5d2('0x29')][_0xf5d2('0x41')](_0x115957)[_0xf5d2('0x23')](handleEntityNotFound(_0x1b2faa,null))[_0xf5d2('0x23')](respondWithResult(_0x1b2faa,null))[_0xf5d2('0x3f')](handleError(_0x1b2faa,null));};exports[_0xf5d2('0x42')]=function(_0x23a0bc,_0x5e4115){return db[_0xf5d2('0x29')][_0xf5d2('0x42')](_0x23a0bc[_0xf5d2('0x43')],{})[_0xf5d2('0x23')](respondWithResult(_0x5e4115,0xc9))[_0xf5d2('0x3f')](handleError(_0x5e4115,null));};exports['update']=function(_0x4b2b6e,_0x37b3e0){if(_0x4b2b6e['body']['id']){delete _0x4b2b6e[_0xf5d2('0x43')]['id'];}return db[_0xf5d2('0x29')][_0xf5d2('0x41')]({'where':{'id':_0x4b2b6e['params']['id']}})[_0xf5d2('0x23')](handleEntityNotFound(_0x37b3e0,null))[_0xf5d2('0x23')](saveUpdates(_0x4b2b6e[_0xf5d2('0x43')],null))[_0xf5d2('0x23')](respondWithResult(_0x37b3e0,null))[_0xf5d2('0x3f')](handleError(_0x37b3e0,null));};exports['destroy']=function(_0x831fcd,_0x1a14db){return db[_0xf5d2('0x29')][_0xf5d2('0x41')]({'where':{'id':_0x831fcd['params']['id']}})[_0xf5d2('0x23')](handleEntityNotFound(_0x1a14db,null))[_0xf5d2('0x23')](removeEntity(_0x1a14db,null))[_0xf5d2('0x3f')](handleError(_0x1a14db,null));};
\ No newline at end of file
index 4ebbf5f..47702f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x013b=['./squareMessage.attributes','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x013b,0x93));var _0xb013=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0x013b[_0x572165];return _0x8c8709;};'use strict';var _=require(_0xb013('0x0'));var util=require('util');var logger=require(_0xb013('0x1'))(_0xb013('0x2'));var moment=require(_0xb013('0x3'));var BPromise=require(_0xb013('0x4'));var rp=require(_0xb013('0x5'));var fs=require('fs');var path=require(_0xb013('0x6'));var rimraf=require(_0xb013('0x7'));var config=require(_0xb013('0x8'));var attributes=require(_0xb013('0x9'));module['exports']=function(_0x5e43fb,_0x23d7a3){return _0x5e43fb[_0xb013('0xa')](_0xb013('0xb'),attributes,{'tableName':_0xb013('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1835=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','SquareMessage','square_messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1835,0x108));var _0x5183=function(_0x46a262,_0x355ec8){_0x46a262=_0x46a262-0x0;var _0x2fb92f=_0x1835[_0x46a262];return _0x2fb92f;};'use strict';var _=require(_0x5183('0x0'));var util=require(_0x5183('0x1'));var logger=require(_0x5183('0x2'))(_0x5183('0x3'));var moment=require('moment');var BPromise=require(_0x5183('0x4'));var rp=require(_0x5183('0x5'));var fs=require('fs');var path=require(_0x5183('0x6'));var rimraf=require('rimraf');var config=require(_0x5183('0x7'));var attributes=require(_0x5183('0x8'));module['exports']=function(_0x3b0a2d,_0x4e3792){return _0x3b0a2d['define'](_0x5183('0x9'),attributes,{'tableName':_0x5183('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ce2f819..029c324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd2d=['message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52a18b,_0x467cf0){var _0x354202=function(_0xad85c){while(--_0xad85c){_0x52a18b['push'](_0x52a18b['shift']());}};_0x354202(++_0x467cf0);}(_0xcd2d,0xe1));var _0xdcd2=function(_0x249b5a,_0x39896d){_0x249b5a=_0x249b5a-0x0;var _0x20c008=_0xcd2d[_0x249b5a];return _0x20c008;};'use strict';var _=require(_0xdcd2('0x0'));var util=require(_0xdcd2('0x1'));var moment=require(_0xdcd2('0x2'));var BPromise=require(_0xdcd2('0x3'));var rs=require(_0xdcd2('0x4'));var fs=require('fs');var Redis=require(_0xdcd2('0x5'));var db=require(_0xdcd2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdcd2('0x7'))(_0xdcd2('0x8'));var config=require(_0xdcd2('0x9'));var jayson=require(_0xdcd2('0xa'));var client=jayson[_0xdcd2('0xb')][_0xdcd2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ad7b0,_0x11de9f,_0x339c34){return new BPromise(function(_0x38f3b4,_0x1605af){return client[_0xdcd2('0xd')](_0x4ad7b0,_0x339c34)[_0xdcd2('0xe')](function(_0xb001df){logger[_0xdcd2('0xf')](_0xdcd2('0x10'),_0x11de9f,_0xdcd2('0x11'));logger[_0xdcd2('0x12')](_0xdcd2('0x13'),_0x11de9f,_0xdcd2('0x11'),JSON[_0xdcd2('0x14')](_0xb001df));if(_0xb001df['error']){if(_0xb001df[_0xdcd2('0x15')][_0xdcd2('0x16')]===0x1f4){logger[_0xdcd2('0x15')](_0xdcd2('0x10'),_0x11de9f,_0xb001df[_0xdcd2('0x15')][_0xdcd2('0x17')]);return _0x1605af(_0xb001df[_0xdcd2('0x15')][_0xdcd2('0x17')]);}logger['error'](_0xdcd2('0x10'),_0x11de9f,_0xb001df[_0xdcd2('0x15')][_0xdcd2('0x17')]);return _0x38f3b4(_0xb001df[_0xdcd2('0x15')]['message']);}else{logger[_0xdcd2('0xf')](_0xdcd2('0x10'),_0x11de9f,_0xdcd2('0x11'));_0x38f3b4(_0xb001df[_0xdcd2('0x18')]['message']);}})[_0xdcd2('0x19')](function(_0x321487){logger[_0xdcd2('0x15')](_0xdcd2('0x10'),_0x11de9f,_0x321487);_0x1605af(_0x321487);});});}exports[_0xdcd2('0x1a')]=function(_0x225018){var _0x1a7629=this;return new Promise(function(_0x10e665,_0x34c11b){return db[_0xdcd2('0x1b')][_0xdcd2('0x1c')](_0x225018[_0xdcd2('0x1d')],{'raw':_0x225018[_0xdcd2('0x1e')]?_0x225018[_0xdcd2('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x299de8){logger[_0xdcd2('0xf')](_0xdcd2('0x1a'),_0x225018);logger[_0xdcd2('0x12')](_0xdcd2('0x1a'),_0x225018,JSON[_0xdcd2('0x14')](_0x299de8));_0x10e665(_0x299de8);})['catch'](function(_0x4f0194){logger[_0xdcd2('0x15')](_0xdcd2('0x1a'),_0x4f0194['message'],_0x225018);_0x34c11b(_0x1a7629[_0xdcd2('0x15')](0x1f4,_0x4f0194['message']));});});};
\ No newline at end of file
+var _0xb9a1=['options','raw','catch','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','SquareMessage','body'];(function(_0x1e7345,_0x18bcce){var _0x33017c=function(_0x2b274f){while(--_0x2b274f){_0x1e7345['push'](_0x1e7345['shift']());}};_0x33017c(++_0x18bcce);}(_0xb9a1,0x1b3));var _0x1b9a=function(_0x372e53,_0x26ceaf){_0x372e53=_0x372e53-0x0;var _0x450285=_0xb9a1[_0x372e53];return _0x450285;};'use strict';var _=require('lodash');var util=require(_0x1b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b9a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b9a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b9a('0x3'))(_0x1b9a('0x4'));var config=require(_0x1b9a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1b9a('0x6')][_0x1b9a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3708c0,_0x2874d6,_0x1dd667){return new BPromise(function(_0x19c658,_0x581efa){return client[_0x1b9a('0x8')](_0x3708c0,_0x1dd667)['then'](function(_0x56e07f){logger[_0x1b9a('0x9')]('SquareMessage,\x20%s,\x20%s',_0x2874d6,_0x1b9a('0xa'));logger[_0x1b9a('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2874d6,_0x1b9a('0xa'),JSON[_0x1b9a('0xc')](_0x56e07f));if(_0x56e07f[_0x1b9a('0xd')]){if(_0x56e07f['error'][_0x1b9a('0xe')]===0x1f4){logger[_0x1b9a('0xd')](_0x1b9a('0xf'),_0x2874d6,_0x56e07f[_0x1b9a('0xd')][_0x1b9a('0x10')]);return _0x581efa(_0x56e07f[_0x1b9a('0xd')]['message']);}logger[_0x1b9a('0xd')](_0x1b9a('0xf'),_0x2874d6,_0x56e07f[_0x1b9a('0xd')][_0x1b9a('0x10')]);return _0x19c658(_0x56e07f[_0x1b9a('0xd')][_0x1b9a('0x10')]);}else{logger[_0x1b9a('0x9')](_0x1b9a('0xf'),_0x2874d6,'request\x20sent');_0x19c658(_0x56e07f[_0x1b9a('0x11')]['message']);}})['catch'](function(_0x76a0f2){logger[_0x1b9a('0xd')](_0x1b9a('0xf'),_0x2874d6,_0x76a0f2);_0x581efa(_0x76a0f2);});});}exports[_0x1b9a('0x12')]=function(_0x2a3e48){var _0xf60e30=this;return new Promise(function(_0xb85578,_0x5cb706){return db[_0x1b9a('0x13')]['create'](_0x2a3e48[_0x1b9a('0x14')],{'raw':_0x2a3e48[_0x1b9a('0x15')]?_0x2a3e48[_0x1b9a('0x15')][_0x1b9a('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x939bc3){logger[_0x1b9a('0x9')](_0x1b9a('0x12'),_0x2a3e48);logger['debug']('CreateSquareMessage',_0x2a3e48,JSON['stringify'](_0x939bc3));_0xb85578(_0x939bc3);})[_0x1b9a('0x17')](function(_0x23b842){logger[_0x1b9a('0xd')]('CreateSquareMessage',_0x23b842[_0x1b9a('0x10')],_0x2a3e48);_0x5cb706(_0xf60e30['error'](0x1f4,_0x23b842['message']));});});};
\ No newline at end of file
index bc6c573..7c1cda5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3836=['multer','util','path','connect-timeout','express','../../components/auth/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x3836,0x78));var _0x6383=function(_0x57f442,_0x521bd8){_0x57f442=_0x57f442-0x0;var _0x499120=_0x3836[_0x57f442];return _0x499120;};'use strict';var multer=require(_0x6383('0x0'));var util=require(_0x6383('0x1'));var path=require(_0x6383('0x2'));var timeout=require(_0x6383('0x3'));var express=require(_0x6383('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6383('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6383('0x6'));router[_0x6383('0x7')]('/',auth[_0x6383('0x8')](),controller[_0x6383('0x9')]);router[_0x6383('0x7')](_0x6383('0xa'),auth[_0x6383('0x8')](),controller['show']);router[_0x6383('0x7')]('/:id/test',auth[_0x6383('0x8')](),timeout('15s'),controller['test']);router[_0x6383('0xb')]('/',auth[_0x6383('0x8')](),controller[_0x6383('0xc')]);router['put'](_0x6383('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6383('0xd')](_0x6383('0xa'),auth['isAuthenticated'](),controller[_0x6383('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x3403=['destroy','exports','multer','path','connect-timeout','../../components/interaction/service','./squareOdbc.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x3403,0x68));var _0x3340=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3403[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x3340('0x0'));var util=require('util');var path=require(_0x3340('0x1'));var timeout=require(_0x3340('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3340('0x3'));var config=require('../../config/environment');var controller=require(_0x3340('0x4'));router[_0x3340('0x5')]('/',auth['isAuthenticated'](),controller[_0x3340('0x6')]);router['get']('/:id',auth[_0x3340('0x7')](),controller[_0x3340('0x8')]);router['get']('/:id/test',auth[_0x3340('0x7')](),timeout('15s'),controller['test']);router[_0x3340('0x9')]('/',auth['isAuthenticated'](),controller[_0x3340('0xa')]);router[_0x3340('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3340('0xc')]);router[_0x3340('0xd')](_0x3340('0xe'),auth[_0x3340('0x7')](),controller[_0x3340('0xf')]);module[_0x3340('0x10')]=router;
\ No newline at end of file
index cc8eff2..f1cc07c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce0f=['sequelize','STRING','name'];(function(_0x1ffff7,_0x2f9ff6){var _0x49d017=function(_0x1d2483){while(--_0x1d2483){_0x1ffff7['push'](_0x1ffff7['shift']());}};_0x49d017(++_0x2f9ff6);}(_0xce0f,0x99));var _0xfce0=function(_0x1b47bc,_0x4bc698){_0x1b47bc=_0x1b47bc-0x0;var _0x559eb5=_0xce0f[_0x1b47bc];return _0x559eb5;};'use strict';var Sequelize=require(_0xfce0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfce0('0x1')],'unique':_0xfce0('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xfce0('0x1')]},'description':{'type':Sequelize[_0xfce0('0x1')]}};
\ No newline at end of file
+var _0x6ae0=['name','exports','STRING'];(function(_0x4dd91d,_0x7de3f6){var _0x2f0699=function(_0xed81c4){while(--_0xed81c4){_0x4dd91d['push'](_0x4dd91d['shift']());}};_0x2f0699(++_0x7de3f6);}(_0x6ae0,0x112));var _0x06ae=function(_0x45b4c8,_0x2c0c03){_0x45b4c8=_0x45b4c8-0x0;var _0x33126b=_0x6ae0[_0x45b4c8];return _0x33126b;};'use strict';var Sequelize=require('sequelize');module[_0x06ae('0x0')]={'name':{'type':Sequelize[_0x06ae('0x1')],'unique':_0x06ae('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x06ae('0x1')]},'description':{'type':Sequelize[_0x06ae('0x1')]}};
\ No newline at end of file
index e040707..88437f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3350=['map','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','SquareOdbc','include','findAll','rows','catch','show','params','find','create','body','user','get','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','closeSync','zip-dir','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','ODBC','destroy','sendStatus','error','name','index','rawAttributes','fieldName','type','key'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3350,0x1a6));var _0x0335=function(_0x58672b,_0x1c52c7){_0x58672b=_0x58672b-0x0;var _0x1942ef=_0x3350[_0x58672b];return _0x1942ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0335('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0335('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0335('0x2'));var util=require('util');var path=require(_0x0335('0x3'));var sox=require(_0x0335('0x4'));var csv=require(_0x0335('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0335('0x6'));var _=require(_0x0335('0x7'));var squel=require(_0x0335('0x8'));var crypto=require('crypto');var jsforce=require(_0x0335('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0335('0x5'));var querystring=require(_0x0335('0xa'));var Papa=require(_0x0335('0xb'));var Redis=require('ioredis');var authService=require(_0x0335('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0335('0xd'));var logger=require(_0x0335('0xe'))(_0x0335('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0335('0x10'));var db=require(_0x0335('0x11'))['db'];function respondWithStatusCode(_0xab6b06,_0x3c6986){_0x3c6986=_0x3c6986||0xcc;return function(_0x19a520){if(_0x19a520){return _0xab6b06['sendStatus'](_0x3c6986);}return _0xab6b06[_0x0335('0x12')](_0x3c6986)['end']();};}function respondWithResult(_0x2324b2,_0x1d5079){_0x1d5079=_0x1d5079||0xc8;return function(_0x5a9f1e){if(_0x5a9f1e){return _0x2324b2[_0x0335('0x12')](_0x1d5079)['json'](_0x5a9f1e);}};}function respondWithFilteredResult(_0x4375ad,_0x27b0ef){return function(_0x221a9d){if(_0x221a9d){var _0x133d67=typeof _0x27b0ef['offset']===_0x0335('0x13')&&typeof _0x27b0ef['limit']===_0x0335('0x13');var _0x114358=_0x221a9d[_0x0335('0x14')];var _0x1075e1=_0x133d67?0x0:_0x27b0ef[_0x0335('0x15')];var _0x2ea097=_0x133d67?_0x221a9d['count']:_0x27b0ef[_0x0335('0x15')]+_0x27b0ef[_0x0335('0x16')];var _0x2df1bc;if(_0x2ea097>=_0x114358){_0x2ea097=_0x114358;_0x2df1bc=0xc8;}else{_0x2df1bc=0xce;}_0x4375ad[_0x0335('0x12')](_0x2df1bc);return _0x4375ad['set'](_0x0335('0x17'),_0x1075e1+'-'+_0x2ea097+'/'+_0x114358)[_0x0335('0x18')](_0x221a9d);}return null;};}function patchUpdates(_0x429706){return function(_0x527967){try{jsonpatch[_0x0335('0x19')](_0x527967,_0x429706,!![]);}catch(_0x224b2d){return BPromise[_0x0335('0x1a')](_0x224b2d);}return _0x527967[_0x0335('0x1b')]();};}function saveUpdates(_0x3e9b18,_0x5e1194){return function(_0x40d88e){if(_0x40d88e){return _0x40d88e[_0x0335('0x1c')](_0x3e9b18)[_0x0335('0x1d')](function(_0x414e03){return _0x414e03;});}return null;};}function removeEntity(_0x1d3b75,_0x5267be){return function(_0x24910d){if(_0x24910d){return _0x24910d['destroy']()[_0x0335('0x1d')](function(){var _0x45d93d=_0x24910d['get']({'plain':!![]});var _0x1a2478=_0x0335('0x1e');return db['UserProfileResource'][_0x0335('0x1f')]({'where':{'type':_0x1a2478,'resourceId':_0x45d93d['id']}})['then'](function(){return _0x24910d;});})[_0x0335('0x1d')](function(){_0x1d3b75[_0x0335('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f61e3,_0xf0980c){return function(_0x1b5c8e){if(!_0x1b5c8e){_0x2f61e3[_0x0335('0x20')](0x194);}return _0x1b5c8e;};}function handleError(_0x33e84c,_0x2ea998){_0x2ea998=_0x2ea998||0x1f4;return function(_0xfaca38){logger[_0x0335('0x21')](_0xfaca38['stack']);if(_0xfaca38[_0x0335('0x22')]){delete _0xfaca38[_0x0335('0x22')];}_0x33e84c[_0x0335('0x12')](_0x2ea998)['send'](_0xfaca38);};}exports[_0x0335('0x23')]=function(_0x11f2e8,_0x1616b4){var _0x14b2c0={},_0x3ab813={},_0x3e772e={'count':0x0,'rows':[]};var _0x244980=_['map'](db['SquareOdbc'][_0x0335('0x24')],function(_0x4ae7a5){return{'name':_0x4ae7a5[_0x0335('0x25')],'type':_0x4ae7a5[_0x0335('0x26')][_0x0335('0x27')]};});_0x3ab813['model']=_[_0x0335('0x28')](_0x244980,_0x0335('0x22'));_0x3ab813['query']=_[_0x0335('0x29')](_0x11f2e8[_0x0335('0x2a')]);_0x3ab813['filters']=_['intersection'](_0x3ab813[_0x0335('0x2b')],_0x3ab813[_0x0335('0x2a')]);_0x14b2c0['attributes']=_[_0x0335('0x2c')](_0x3ab813[_0x0335('0x2b')],qs[_0x0335('0x2d')](_0x11f2e8[_0x0335('0x2a')][_0x0335('0x2d')]));_0x14b2c0[_0x0335('0x2e')]=_0x14b2c0[_0x0335('0x2e')][_0x0335('0x2f')]?_0x14b2c0[_0x0335('0x2e')]:_0x3ab813['model'];if(!_0x11f2e8[_0x0335('0x2a')][_0x0335('0x30')](_0x0335('0x31'))){_0x14b2c0[_0x0335('0x16')]=qs[_0x0335('0x16')](_0x11f2e8[_0x0335('0x2a')]['limit']);_0x14b2c0['offset']=qs['offset'](_0x11f2e8[_0x0335('0x2a')][_0x0335('0x15')]);}_0x14b2c0['order']=qs[_0x0335('0x32')](_0x11f2e8['query']['sort']);_0x14b2c0[_0x0335('0x33')]=qs['filters'](_[_0x0335('0x34')](_0x11f2e8['query'],_0x3ab813[_0x0335('0x35')]),_0x244980);if(_0x11f2e8[_0x0335('0x2a')]['filter']){_0x14b2c0[_0x0335('0x33')]=_[_0x0335('0x36')](_0x14b2c0[_0x0335('0x33')],{'$or':_['map'](_0x244980,function(_0x5e7d77){if(_0x5e7d77[_0x0335('0x26')]!==_0x0335('0x37')){var _0x6b7f12={};_0x6b7f12[_0x5e7d77[_0x0335('0x22')]]={'$like':'%'+_0x11f2e8[_0x0335('0x2a')][_0x0335('0x38')]+'%'};return _0x6b7f12;}})});}_0x14b2c0=_[_0x0335('0x36')]({},_0x14b2c0,_0x11f2e8[_0x0335('0x39')]);var _0x2d0307={'where':_0x14b2c0[_0x0335('0x33')]};return db[_0x0335('0x3a')][_0x0335('0x14')](_0x2d0307)[_0x0335('0x1d')](function(_0x465837){_0x3e772e[_0x0335('0x14')]=_0x465837;if(_0x11f2e8[_0x0335('0x2a')]['includeAll']){_0x14b2c0[_0x0335('0x3b')]=[{'all':!![]}];}return db[_0x0335('0x3a')][_0x0335('0x3c')](_0x14b2c0);})['then'](function(_0x411129){_0x3e772e[_0x0335('0x3d')]=_0x411129;return _0x3e772e;})['then'](respondWithFilteredResult(_0x1616b4,_0x14b2c0))[_0x0335('0x3e')](handleError(_0x1616b4,null));};exports[_0x0335('0x3f')]=function(_0x1f0ba4,_0x2eb6c6){var _0x2d3179={'raw':!![],'where':{'id':_0x1f0ba4[_0x0335('0x40')]['id']}},_0x565367={};_0x565367[_0x0335('0x2b')]=_[_0x0335('0x29')](db[_0x0335('0x3a')][_0x0335('0x24')]);_0x565367['query']=_['keys'](_0x1f0ba4['query']);_0x565367['filters']=_[_0x0335('0x2c')](_0x565367[_0x0335('0x2b')],_0x565367['query']);_0x2d3179[_0x0335('0x2e')]=_['intersection'](_0x565367[_0x0335('0x2b')],qs[_0x0335('0x2d')](_0x1f0ba4[_0x0335('0x2a')][_0x0335('0x2d')]));_0x2d3179[_0x0335('0x2e')]=_0x2d3179['attributes'][_0x0335('0x2f')]?_0x2d3179[_0x0335('0x2e')]:_0x565367[_0x0335('0x2b')];if(_0x1f0ba4[_0x0335('0x2a')]['includeAll']){_0x2d3179[_0x0335('0x3b')]=[{'all':!![]}];}_0x2d3179=_[_0x0335('0x36')]({},_0x2d3179,_0x1f0ba4[_0x0335('0x39')]);return db[_0x0335('0x3a')][_0x0335('0x41')](_0x2d3179)[_0x0335('0x1d')](handleEntityNotFound(_0x2eb6c6,null))[_0x0335('0x1d')](respondWithResult(_0x2eb6c6,null))[_0x0335('0x3e')](handleError(_0x2eb6c6,null));};exports[_0x0335('0x42')]=function(_0x30151c,_0x46ab14){return db['SquareOdbc'][_0x0335('0x42')](_0x30151c[_0x0335('0x43')],{})[_0x0335('0x1d')](function(_0x205403){var _0x3f656b=_0x30151c[_0x0335('0x44')][_0x0335('0x45')]({'plain':!![]});if(!_0x3f656b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f656b[_0x0335('0x46')]===_0x0335('0x44')){var _0x23ec52=_0x205403[_0x0335('0x45')]({'plain':!![]});var _0xd725a4=_0x0335('0x1e');return db[_0x0335('0x47')][_0x0335('0x41')]({'where':{'name':_0xd725a4,'userProfileId':_0x3f656b['userProfileId']},'raw':!![]})[_0x0335('0x1d')](function(_0x5542a4){if(_0x5542a4&&_0x5542a4[_0x0335('0x48')]===0x0){return db[_0x0335('0x49')][_0x0335('0x42')]({'name':_0x23ec52[_0x0335('0x22')],'resourceId':_0x23ec52['id'],'type':_0x5542a4[_0x0335('0x22')],'sectionId':_0x5542a4['id']},{})['then'](function(){return _0x205403;});}else{return _0x205403;}})[_0x0335('0x3e')](function(_0x4ce4d7){logger['error'](_0x0335('0x4a'),_0x4ce4d7);throw _0x4ce4d7;});}return _0x205403;})[_0x0335('0x1d')](respondWithResult(_0x46ab14,0xc9))[_0x0335('0x3e')](handleError(_0x46ab14,null));};exports[_0x0335('0x1c')]=function(_0x3db2f5,_0x198145){if(_0x3db2f5[_0x0335('0x43')]['id']){delete _0x3db2f5[_0x0335('0x43')]['id'];}return db[_0x0335('0x3a')][_0x0335('0x41')]({'where':{'id':_0x3db2f5[_0x0335('0x40')]['id']}})[_0x0335('0x1d')](handleEntityNotFound(_0x198145,null))[_0x0335('0x1d')](saveUpdates(_0x3db2f5['body'],null))[_0x0335('0x1d')](respondWithResult(_0x198145,null))[_0x0335('0x3e')](handleError(_0x198145,null));};exports[_0x0335('0x1f')]=function(_0x38d984,_0x56098d){return db[_0x0335('0x3a')][_0x0335('0x41')]({'where':{'id':_0x38d984['params']['id']}})[_0x0335('0x1d')](handleEntityNotFound(_0x56098d,null))['then'](removeEntity(_0x56098d,null))['catch'](handleError(_0x56098d,null));};exports[_0x0335('0x4b')]=function(_0x2af60b,_0x148547,_0x16e412){var _0x40b1f8;return db[_0x0335('0x3a')][_0x0335('0x41')]({'where':{'id':_0x2af60b['params']['id']},'attributes':['id','dsn']})[_0x0335('0x1d')](handleEntityNotFound(_0x148547,null))[_0x0335('0x1d')](function(_0x24eb40){if(_0x24eb40){var _0x48511a=require('odbc')();_0x48511a['openSync'](_0x24eb40['dsn']);_0x48511a[_0x0335('0x4c')]();return _0x24eb40;}})[_0x0335('0x1d')](respondWithResult(_0x148547,null))[_0x0335('0x3e')](handleError(_0x148547,null));};
\ No newline at end of file
+var _0x6ded=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','dsn','odbc','openSync','closeSync','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','get','ODBC','end','stack','send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','show','length','includeAll','include','find','create','user','UserProfileSection','userProfileId'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x6ded,0x162));var _0xd6de=function(_0xf70ae9,_0x2b04bd){_0xf70ae9=_0xf70ae9-0x0;var _0x4c6ffb=_0x6ded[_0xf70ae9];return _0x4c6ffb;};'use strict';var emlformat=require(_0xd6de('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd6de('0x1'));var rp=require('request-promise');var moment=require(_0xd6de('0x2'));var BPromise=require(_0xd6de('0x3'));var Mustache=require(_0xd6de('0x4'));var util=require(_0xd6de('0x5'));var path=require(_0xd6de('0x6'));var sox=require('sox');var csv=require(_0xd6de('0x7'));var ejs=require(_0xd6de('0x8'));var fs=require('fs');var fs_extra=require(_0xd6de('0x9'));var _=require(_0xd6de('0xa'));var squel=require(_0xd6de('0xb'));var crypto=require(_0xd6de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd6de('0xd'));var toCsv=require(_0xd6de('0x7'));var querystring=require(_0xd6de('0xe'));var Papa=require(_0xd6de('0xf'));var Redis=require(_0xd6de('0x10'));var authService=require(_0xd6de('0x11'));var qs=require(_0xd6de('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6de('0x13'));var logger=require(_0xd6de('0x14'))(_0xd6de('0x15'));var utils=require(_0xd6de('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6de('0x17'));var db=require(_0xd6de('0x18'))['db'];function respondWithStatusCode(_0x1050fe,_0x4d16f0){_0x4d16f0=_0x4d16f0||0xcc;return function(_0x3e9ffe){if(_0x3e9ffe){return _0x1050fe[_0xd6de('0x19')](_0x4d16f0);}return _0x1050fe['status'](_0x4d16f0)['end']();};}function respondWithResult(_0x3545d3,_0x2b5912){_0x2b5912=_0x2b5912||0xc8;return function(_0x157a83){if(_0x157a83){return _0x3545d3[_0xd6de('0x1a')](_0x2b5912)[_0xd6de('0x1b')](_0x157a83);}};}function respondWithFilteredResult(_0x1a5ce4,_0x434eeb){return function(_0xa8b8e){if(_0xa8b8e){var _0x401daa=typeof _0x434eeb['offset']===_0xd6de('0x1c')&&typeof _0x434eeb[_0xd6de('0x1d')]===_0xd6de('0x1c');var _0x36abf6=_0xa8b8e[_0xd6de('0x1e')];var _0x49f85e=_0x401daa?0x0:_0x434eeb[_0xd6de('0x1f')];var _0x3eac60=_0x401daa?_0xa8b8e[_0xd6de('0x1e')]:_0x434eeb[_0xd6de('0x1f')]+_0x434eeb[_0xd6de('0x1d')];var _0x12911b;if(_0x3eac60>=_0x36abf6){_0x3eac60=_0x36abf6;_0x12911b=0xc8;}else{_0x12911b=0xce;}_0x1a5ce4[_0xd6de('0x1a')](_0x12911b);return _0x1a5ce4['set'](_0xd6de('0x20'),_0x49f85e+'-'+_0x3eac60+'/'+_0x36abf6)[_0xd6de('0x1b')](_0xa8b8e);}return null;};}function patchUpdates(_0x7f0b64){return function(_0x3d1371){try{jsonpatch[_0xd6de('0x21')](_0x3d1371,_0x7f0b64,!![]);}catch(_0x5e40c4){return BPromise[_0xd6de('0x22')](_0x5e40c4);}return _0x3d1371['save']();};}function saveUpdates(_0x340ea9,_0x2633fd){return function(_0x5f0493){if(_0x5f0493){return _0x5f0493['update'](_0x340ea9)[_0xd6de('0x23')](function(_0x40009d){return _0x40009d;});}return null;};}function removeEntity(_0x359616,_0x4899c6){return function(_0x12c0b5){if(_0x12c0b5){return _0x12c0b5[_0xd6de('0x24')]()['then'](function(){var _0x5775f2=_0x12c0b5[_0xd6de('0x25')]({'plain':!![]});var _0x5b3de0=_0xd6de('0x26');return db['UserProfileResource'][_0xd6de('0x24')]({'where':{'type':_0x5b3de0,'resourceId':_0x5775f2['id']}})['then'](function(){return _0x12c0b5;});})[_0xd6de('0x23')](function(){_0x359616[_0xd6de('0x1a')](0xcc)[_0xd6de('0x27')]();});}};}function handleEntityNotFound(_0x2c90e0,_0x5f1757){return function(_0xf01c47){if(!_0xf01c47){_0x2c90e0[_0xd6de('0x19')](0x194);}return _0xf01c47;};}function handleError(_0x3034b4,_0x2308db){_0x2308db=_0x2308db||0x1f4;return function(_0x38f188){logger['error'](_0x38f188[_0xd6de('0x28')]);if(_0x38f188['name']){delete _0x38f188['name'];}_0x3034b4[_0xd6de('0x1a')](_0x2308db)[_0xd6de('0x29')](_0x38f188);};}exports[_0xd6de('0x2a')]=function(_0x53f445,_0x8db982){var _0x153e21={},_0x17e64a={},_0x3d048e={'count':0x0,'rows':[]};var _0x3d31c5=_[_0xd6de('0x2b')](db[_0xd6de('0x2c')][_0xd6de('0x2d')],function(_0x2d0d15){return{'name':_0x2d0d15[_0xd6de('0x2e')],'type':_0x2d0d15['type'][_0xd6de('0x2f')]};});_0x17e64a[_0xd6de('0x30')]=_[_0xd6de('0x2b')](_0x3d31c5,_0xd6de('0x31'));_0x17e64a[_0xd6de('0x32')]=_[_0xd6de('0x33')](_0x53f445['query']);_0x17e64a['filters']=_[_0xd6de('0x34')](_0x17e64a[_0xd6de('0x30')],_0x17e64a[_0xd6de('0x32')]);_0x153e21[_0xd6de('0x35')]=_[_0xd6de('0x34')](_0x17e64a[_0xd6de('0x30')],qs[_0xd6de('0x36')](_0x53f445[_0xd6de('0x32')][_0xd6de('0x36')]));_0x153e21[_0xd6de('0x35')]=_0x153e21[_0xd6de('0x35')]['length']?_0x153e21[_0xd6de('0x35')]:_0x17e64a[_0xd6de('0x30')];if(!_0x53f445['query'][_0xd6de('0x37')]('nolimit')){_0x153e21[_0xd6de('0x1d')]=qs[_0xd6de('0x1d')](_0x53f445[_0xd6de('0x32')][_0xd6de('0x1d')]);_0x153e21[_0xd6de('0x1f')]=qs[_0xd6de('0x1f')](_0x53f445[_0xd6de('0x32')][_0xd6de('0x1f')]);}_0x153e21[_0xd6de('0x38')]=qs[_0xd6de('0x39')](_0x53f445[_0xd6de('0x32')]['sort']);_0x153e21[_0xd6de('0x3a')]=qs[_0xd6de('0x3b')](_['pick'](_0x53f445[_0xd6de('0x32')],_0x17e64a[_0xd6de('0x3b')]),_0x3d31c5);if(_0x53f445['query'][_0xd6de('0x3c')]){_0x153e21[_0xd6de('0x3a')]=_[_0xd6de('0x3d')](_0x153e21[_0xd6de('0x3a')],{'$or':_[_0xd6de('0x2b')](_0x3d31c5,function(_0x38ec29){if(_0x38ec29['type']!==_0xd6de('0x3e')){var _0x23ffec={};_0x23ffec[_0x38ec29[_0xd6de('0x31')]]={'$like':'%'+_0x53f445['query'][_0xd6de('0x3c')]+'%'};return _0x23ffec;}})});}_0x153e21=_[_0xd6de('0x3d')]({},_0x153e21,_0x53f445[_0xd6de('0x3f')]);var _0x25a8cd={'where':_0x153e21[_0xd6de('0x3a')]};return db['SquareOdbc'][_0xd6de('0x1e')](_0x25a8cd)['then'](function(_0x2c7bc5){_0x3d048e[_0xd6de('0x1e')]=_0x2c7bc5;if(_0x53f445[_0xd6de('0x32')]['includeAll']){_0x153e21['include']=[{'all':!![]}];}return db[_0xd6de('0x2c')][_0xd6de('0x40')](_0x153e21);})[_0xd6de('0x23')](function(_0x2fc76d){_0x3d048e[_0xd6de('0x41')]=_0x2fc76d;return _0x3d048e;})[_0xd6de('0x23')](respondWithFilteredResult(_0x8db982,_0x153e21))[_0xd6de('0x42')](handleError(_0x8db982,null));};exports[_0xd6de('0x43')]=function(_0x134388,_0x4774f4){var _0x14618d={'raw':!![],'where':{'id':_0x134388['params']['id']}},_0x2a37df={};_0x2a37df[_0xd6de('0x30')]=_[_0xd6de('0x33')](db[_0xd6de('0x2c')][_0xd6de('0x2d')]);_0x2a37df[_0xd6de('0x32')]=_[_0xd6de('0x33')](_0x134388[_0xd6de('0x32')]);_0x2a37df[_0xd6de('0x3b')]=_[_0xd6de('0x34')](_0x2a37df['model'],_0x2a37df[_0xd6de('0x32')]);_0x14618d['attributes']=_['intersection'](_0x2a37df['model'],qs[_0xd6de('0x36')](_0x134388[_0xd6de('0x32')][_0xd6de('0x36')]));_0x14618d['attributes']=_0x14618d['attributes'][_0xd6de('0x44')]?_0x14618d['attributes']:_0x2a37df[_0xd6de('0x30')];if(_0x134388[_0xd6de('0x32')][_0xd6de('0x45')]){_0x14618d[_0xd6de('0x46')]=[{'all':!![]}];}_0x14618d=_[_0xd6de('0x3d')]({},_0x14618d,_0x134388['options']);return db[_0xd6de('0x2c')][_0xd6de('0x47')](_0x14618d)[_0xd6de('0x23')](handleEntityNotFound(_0x4774f4,null))[_0xd6de('0x23')](respondWithResult(_0x4774f4,null))['catch'](handleError(_0x4774f4,null));};exports[_0xd6de('0x48')]=function(_0x31e025,_0x37a094){return db['SquareOdbc']['create'](_0x31e025['body'],{})[_0xd6de('0x23')](function(_0x852c44){var _0x2c6f25=_0x31e025[_0xd6de('0x49')][_0xd6de('0x25')]({'plain':!![]});if(!_0x2c6f25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c6f25['role']==='user'){var _0x13a7fc=_0x852c44[_0xd6de('0x25')]({'plain':!![]});var _0xa8766a='ODBC';return db[_0xd6de('0x4a')][_0xd6de('0x47')]({'where':{'name':_0xa8766a,'userProfileId':_0x2c6f25[_0xd6de('0x4b')]},'raw':!![]})[_0xd6de('0x23')](function(_0x5881ee){if(_0x5881ee&&_0x5881ee[_0xd6de('0x4c')]===0x0){return db['UserProfileResource'][_0xd6de('0x48')]({'name':_0x13a7fc[_0xd6de('0x31')],'resourceId':_0x13a7fc['id'],'type':_0x5881ee[_0xd6de('0x31')],'sectionId':_0x5881ee['id']},{})['then'](function(){return _0x852c44;});}else{return _0x852c44;}})[_0xd6de('0x42')](function(_0xbbf33b){logger[_0xd6de('0x4d')](_0xd6de('0x4e'),_0xbbf33b);throw _0xbbf33b;});}return _0x852c44;})[_0xd6de('0x23')](respondWithResult(_0x37a094,0xc9))['catch'](handleError(_0x37a094,null));};exports['update']=function(_0x2f3bae,_0x13e032){if(_0x2f3bae[_0xd6de('0x4f')]['id']){delete _0x2f3bae[_0xd6de('0x4f')]['id'];}return db[_0xd6de('0x2c')][_0xd6de('0x47')]({'where':{'id':_0x2f3bae[_0xd6de('0x50')]['id']}})[_0xd6de('0x23')](handleEntityNotFound(_0x13e032,null))[_0xd6de('0x23')](saveUpdates(_0x2f3bae['body'],null))[_0xd6de('0x23')](respondWithResult(_0x13e032,null))[_0xd6de('0x42')](handleError(_0x13e032,null));};exports['destroy']=function(_0xf158,_0x4bc5ab){return db[_0xd6de('0x2c')][_0xd6de('0x47')]({'where':{'id':_0xf158[_0xd6de('0x50')]['id']}})[_0xd6de('0x23')](handleEntityNotFound(_0x4bc5ab,null))['then'](removeEntity(_0x4bc5ab,null))[_0xd6de('0x42')](handleError(_0x4bc5ab,null));};exports[_0xd6de('0x51')]=function(_0x1ddf50,_0x52c4f4,_0x49889d){var _0x30f418;return db[_0xd6de('0x2c')][_0xd6de('0x47')]({'where':{'id':_0x1ddf50[_0xd6de('0x50')]['id']},'attributes':['id',_0xd6de('0x52')]})[_0xd6de('0x23')](handleEntityNotFound(_0x52c4f4,null))[_0xd6de('0x23')](function(_0x3cdf79){if(_0x3cdf79){var _0x28ea1b=require(_0xd6de('0x53'))();_0x28ea1b[_0xd6de('0x54')](_0x3cdf79[_0xd6de('0x52')]);_0x28ea1b[_0xd6de('0x55')]();return _0x3cdf79;}})[_0xd6de('0x23')](respondWithResult(_0x52c4f4,null))[_0xd6de('0x42')](handleError(_0x52c4f4,null));};
\ No newline at end of file
index 0e4f0a9..719f7cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb826=['./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x51e3ef,_0x96cefd){var _0x40f621=function(_0x5d8fef){while(--_0x5d8fef){_0x51e3ef['push'](_0x51e3ef['shift']());}};_0x40f621(++_0x96cefd);}(_0xb826,0x149));var _0x6b82=function(_0x36b132,_0x5146c5){_0x36b132=_0x36b132-0x0;var _0x11f3cf=_0xb826[_0x36b132];return _0x11f3cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6b82('0x0'))(_0x6b82('0x1'));var moment=require(_0x6b82('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b82('0x3'));var fs=require('fs');var path=require(_0x6b82('0x4'));var rimraf=require(_0x6b82('0x5'));var config=require(_0x6b82('0x6'));var attributes=require(_0x6b82('0x7'));module[_0x6b82('0x8')]=function(_0x284c4b,_0x3b1ba2){return _0x284c4b[_0x6b82('0x9')](_0x6b82('0xa'),attributes,{'tableName':_0x6b82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b41=['moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','define','SquareOdbc','square_odbc','util'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0x2b41,0xbd));var _0x12b4=function(_0x330412,_0xfeadf4){_0x330412=_0x330412-0x0;var _0x3f18b4=_0x2b41[_0x330412];return _0x3f18b4;};'use strict';var _=require('lodash');var util=require(_0x12b4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x12b4('0x1'));var BPromise=require(_0x12b4('0x2'));var rp=require(_0x12b4('0x3'));var fs=require('fs');var path=require(_0x12b4('0x4'));var rimraf=require(_0x12b4('0x5'));var config=require('../../config/environment');var attributes=require(_0x12b4('0x6'));module['exports']=function(_0x5cba7f,_0x4109ae){return _0x5cba7f[_0x12b4('0x7')](_0x12b4('0x8'),attributes,{'tableName':_0x12b4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f52df33..25642f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffed=['raw','where','attributes','include','map','model','then','ShowSquareOdbc','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options'];(function(_0x516089,_0xe9037a){var _0x31c17b=function(_0x2d7c18){while(--_0x2d7c18){_0x516089['push'](_0x516089['shift']());}};_0x31c17b(++_0xe9037a);}(_0xffed,0x168));var _0xdffe=function(_0x4fd321,_0x36b181){_0x4fd321=_0x4fd321-0x0;var _0x4d6c11=_0xffed[_0x4fd321];return _0x4d6c11;};'use strict';var _=require(_0xdffe('0x0'));var util=require(_0xdffe('0x1'));var moment=require(_0xdffe('0x2'));var BPromise=require('bluebird');var rs=require(_0xdffe('0x3'));var fs=require('fs');var Redis=require(_0xdffe('0x4'));var db=require(_0xdffe('0x5'))['db'];var utils=require(_0xdffe('0x6'));var logger=require(_0xdffe('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdffe('0x8'));var client=jayson[_0xdffe('0x9')][_0xdffe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x495a3d,_0x51abe6,_0x2ce93b){return new BPromise(function(_0x530130,_0x17dd3d){return client[_0xdffe('0xb')](_0x495a3d,_0x2ce93b)['then'](function(_0xdf11b3){logger[_0xdffe('0xc')](_0xdffe('0xd'),_0x51abe6,_0xdffe('0xe'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x51abe6,_0xdffe('0xe'),JSON[_0xdffe('0xf')](_0xdf11b3));if(_0xdf11b3['error']){if(_0xdf11b3[_0xdffe('0x10')][_0xdffe('0x11')]===0x1f4){logger[_0xdffe('0x10')](_0xdffe('0xd'),_0x51abe6,_0xdf11b3[_0xdffe('0x10')][_0xdffe('0x12')]);return _0x17dd3d(_0xdf11b3['error'][_0xdffe('0x12')]);}logger['error'](_0xdffe('0xd'),_0x51abe6,_0xdf11b3[_0xdffe('0x10')]['message']);return _0x530130(_0xdf11b3[_0xdffe('0x10')][_0xdffe('0x12')]);}else{logger[_0xdffe('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x51abe6,_0xdffe('0xe'));_0x530130(_0xdf11b3[_0xdffe('0x13')][_0xdffe('0x12')]);}})[_0xdffe('0x14')](function(_0x4a8857){logger[_0xdffe('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x51abe6,_0x4a8857);_0x17dd3d(_0x4a8857);});});}exports['ShowSquareOdbc']=function(_0x3e59db){var _0x11567d=this;return new Promise(function(_0x42404f,_0x4ee17a){return db[_0xdffe('0x15')][_0xdffe('0x16')]({'raw':_0x3e59db[_0xdffe('0x17')]?_0x3e59db[_0xdffe('0x17')][_0xdffe('0x18')]===undefined?!![]:![]:!![],'where':_0x3e59db['options']?_0x3e59db[_0xdffe('0x17')][_0xdffe('0x19')]||null:null,'attributes':_0x3e59db[_0xdffe('0x17')]?_0x3e59db[_0xdffe('0x17')][_0xdffe('0x1a')]||null:null,'include':_0x3e59db[_0xdffe('0x17')]?_0x3e59db['options'][_0xdffe('0x1b')]?_[_0xdffe('0x1c')](_0x3e59db[_0xdffe('0x17')]['include'],function(_0x36447a){return{'model':db[_0x36447a[_0xdffe('0x1d')]],'as':_0x36447a['as'],'attributes':_0x36447a[_0xdffe('0x1a')],'include':_0x36447a[_0xdffe('0x1b')]?_[_0xdffe('0x1c')](_0x36447a[_0xdffe('0x1b')],function(_0x366d11){return{'model':db[_0x366d11[_0xdffe('0x1d')]],'as':_0x366d11['as'],'attributes':_0x366d11['attributes'],'include':_0x366d11['include']?_[_0xdffe('0x1c')](_0x366d11[_0xdffe('0x1b')],function(_0x270bd4){return{'model':db[_0x270bd4[_0xdffe('0x1d')]],'as':_0x270bd4['as'],'attributes':_0x270bd4[_0xdffe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdffe('0x1e')](function(_0x5af7a2){logger[_0xdffe('0xc')](_0xdffe('0x1f'),_0x3e59db);logger['debug'](_0xdffe('0x1f'),_0x3e59db,JSON[_0xdffe('0xf')](_0x5af7a2));_0x42404f(_0x5af7a2);})[_0xdffe('0x14')](function(_0x5d430f){logger['error']('ShowSquareOdbc',_0x5d430f['message'],_0x3e59db);_0x4ee17a(_0x11567d[_0xdffe('0x10')](0x1f4,_0x5d430f[_0xdffe('0x12')]));});});};
\ No newline at end of file
+var _0x5062=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','SquareOdbc','options','attributes','include','map','model','ShowSquareOdbc','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x5062,0x131));var _0x2506=function(_0x35b242,_0x4399a2){_0x35b242=_0x35b242-0x0;var _0x343538=_0x5062[_0x35b242];return _0x343538;};'use strict';var _=require('lodash');var util=require(_0x2506('0x0'));var moment=require(_0x2506('0x1'));var BPromise=require(_0x2506('0x2'));var rs=require(_0x2506('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2506('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2506('0x5'))(_0x2506('0x6'));var config=require(_0x2506('0x7'));var jayson=require(_0x2506('0x8'));var client=jayson[_0x2506('0x9')][_0x2506('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x120f15,_0x5480c2,_0x182110){return new BPromise(function(_0x1f11e1,_0x2e42ca){return client[_0x2506('0xb')](_0x120f15,_0x182110)[_0x2506('0xc')](function(_0x2b4440){logger['info'](_0x2506('0xd'),_0x5480c2,_0x2506('0xe'));logger[_0x2506('0xf')](_0x2506('0x10'),_0x5480c2,_0x2506('0xe'),JSON[_0x2506('0x11')](_0x2b4440));if(_0x2b4440['error']){if(_0x2b4440[_0x2506('0x12')]['code']===0x1f4){logger[_0x2506('0x12')](_0x2506('0xd'),_0x5480c2,_0x2b4440[_0x2506('0x12')][_0x2506('0x13')]);return _0x2e42ca(_0x2b4440[_0x2506('0x12')][_0x2506('0x13')]);}logger[_0x2506('0x12')](_0x2506('0xd'),_0x5480c2,_0x2b4440[_0x2506('0x12')][_0x2506('0x13')]);return _0x1f11e1(_0x2b4440[_0x2506('0x12')][_0x2506('0x13')]);}else{logger[_0x2506('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x5480c2,'request\x20sent');_0x1f11e1(_0x2b4440['result'][_0x2506('0x13')]);}})[_0x2506('0x15')](function(_0x1f5a56){logger[_0x2506('0x12')](_0x2506('0xd'),_0x5480c2,_0x1f5a56);_0x2e42ca(_0x1f5a56);});});}exports['ShowSquareOdbc']=function(_0x5582f3){var _0x1a3d7b=this;return new Promise(function(_0x2180b8,_0x468808){return db[_0x2506('0x16')]['find']({'raw':_0x5582f3[_0x2506('0x17')]?_0x5582f3[_0x2506('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5582f3['options']?_0x5582f3[_0x2506('0x17')]['where']||null:null,'attributes':_0x5582f3['options']?_0x5582f3['options'][_0x2506('0x18')]||null:null,'include':_0x5582f3[_0x2506('0x17')]?_0x5582f3[_0x2506('0x17')][_0x2506('0x19')]?_[_0x2506('0x1a')](_0x5582f3[_0x2506('0x17')][_0x2506('0x19')],function(_0x113d13){return{'model':db[_0x113d13[_0x2506('0x1b')]],'as':_0x113d13['as'],'attributes':_0x113d13[_0x2506('0x18')],'include':_0x113d13[_0x2506('0x19')]?_[_0x2506('0x1a')](_0x113d13[_0x2506('0x19')],function(_0x3892cc){return{'model':db[_0x3892cc[_0x2506('0x1b')]],'as':_0x3892cc['as'],'attributes':_0x3892cc[_0x2506('0x18')],'include':_0x3892cc[_0x2506('0x19')]?_[_0x2506('0x1a')](_0x3892cc[_0x2506('0x19')],function(_0x40a48f){return{'model':db[_0x40a48f[_0x2506('0x1b')]],'as':_0x40a48f['as'],'attributes':_0x40a48f[_0x2506('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20a3ce){logger['info'](_0x2506('0x1c'),_0x5582f3);logger[_0x2506('0xf')]('ShowSquareOdbc',_0x5582f3,JSON[_0x2506('0x11')](_0x20a3ce));_0x2180b8(_0x20a3ce);})['catch'](function(_0x3e4ae7){logger[_0x2506('0x12')](_0x2506('0x1c'),_0x3e4ae7[_0x2506('0x13')],_0x5582f3);_0x468808(_0x1a3d7b[_0x2506('0x12')](0x1f4,_0x3e4ae7[_0x2506('0x13')]));});});};
\ No newline at end of file
index 8e1a9b7..5857a0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0447=['removeUsers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','getUsers','post','create','put','delete','/:id','destroy'];(function(_0x4a33e9,_0x3924a4){var _0x295f69=function(_0x51658b){while(--_0x51658b){_0x4a33e9['push'](_0x4a33e9['shift']());}};_0x295f69(++_0x3924a4);}(_0x0447,0x8b));var _0x7044=function(_0x595cc4,_0x4f535d){_0x595cc4=_0x595cc4-0x0;var _0xe13592=_0x0447[_0x595cc4];return _0xe13592;};'use strict';var multer=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var path=require(_0x7044('0x2'));var timeout=require(_0x7044('0x3'));var express=require(_0x7044('0x4'));var router=express['Router']();var fs_extra=require(_0x7044('0x5'));var auth=require(_0x7044('0x6'));var interaction=require(_0x7044('0x7'));var config=require(_0x7044('0x8'));var controller=require(_0x7044('0x9'));router[_0x7044('0xa')]('/',auth[_0x7044('0xb')](),controller[_0x7044('0xc')]);router[_0x7044('0xa')]('/:id',auth[_0x7044('0xb')](),controller[_0x7044('0xd')]);router[_0x7044('0xa')](_0x7044('0xe'),auth['isAuthenticated'](),controller[_0x7044('0xf')]);router[_0x7044('0x10')]('/',auth['isAuthenticated'](),controller[_0x7044('0x11')]);router[_0x7044('0x10')](_0x7044('0xe'),auth[_0x7044('0xb')](),controller['addUsers']);router[_0x7044('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7044('0x13')](_0x7044('0x14'),auth[_0x7044('0xb')](),controller[_0x7044('0x15')]);router['delete']('/:id/users',auth[_0x7044('0xb')](),controller[_0x7044('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xa1cc=['isAuthenticated','index','show','post','create','/:id/users','addUsers','/:id','delete','destroy','removeUsers','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./squareProject.controller','get'];(function(_0x2d224c,_0x4602fa){var _0x47f222=function(_0x44633f){while(--_0x44633f){_0x2d224c['push'](_0x2d224c['shift']());}};_0x47f222(++_0x4602fa);}(_0xa1cc,0x10f));var _0xca1c=function(_0x299615,_0x196441){_0x299615=_0x299615-0x0;var _0x47b824=_0xa1cc[_0x299615];return _0x47b824;};'use strict';var multer=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var path=require(_0xca1c('0x2'));var timeout=require('connect-timeout');var express=require(_0xca1c('0x3'));var router=express[_0xca1c('0x4')]();var fs_extra=require(_0xca1c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xca1c('0x6'));var config=require('../../config/environment');var controller=require(_0xca1c('0x7'));router[_0xca1c('0x8')]('/',auth[_0xca1c('0x9')](),controller[_0xca1c('0xa')]);router['get']('/:id',auth[_0xca1c('0x9')](),controller[_0xca1c('0xb')]);router[_0xca1c('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getUsers']);router[_0xca1c('0xc')]('/',auth['isAuthenticated'](),controller[_0xca1c('0xd')]);router[_0xca1c('0xc')](_0xca1c('0xe'),auth[_0xca1c('0x9')](),controller[_0xca1c('0xf')]);router['put'](_0xca1c('0x10'),auth[_0xca1c('0x9')](),controller['update']);router[_0xca1c('0x11')]('/:id',auth[_0xca1c('0x9')](),controller[_0xca1c('0x12')]);router[_0xca1c('0x11')]('/:id/users',auth[_0xca1c('0x9')](),controller[_0xca1c('0x13')]);module['exports']=router;
\ No newline at end of file
index a6e2bce..ac4360b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb39c=['name','STRING','TEXT','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize','exports'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0xb39c,0x136));var _0xcb39=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb39c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xcb39('0x0'));module[_0xcb39('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcb39('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcb39('0x3')]},'notes':{'type':Sequelize[_0xcb39('0x4')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xcb39('0x5')](_0xcb39('0x6'))){return this[_0xcb39('0x5')](_0xcb39('0x6'))[_0xcb39('0x7')](_0xcb39('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xcb39('0x9')),'get':function(){if(this['getDataValue'](_0xcb39('0xa'))){return this[_0xcb39('0x5')](_0xcb39('0xa'))[_0xcb39('0x7')](_0xcb39('0x8'));}}},'savedAt':{'type':Sequelize[_0xcb39('0xb')]},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x6519=['utf8','production','toString','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0xa9e99e,_0x2166c7){var _0x1d0bb0=function(_0x4e3140){while(--_0x4e3140){_0xa9e99e['push'](_0xa9e99e['shift']());}};_0x1d0bb0(++_0x2166c7);}(_0x6519,0x163));var _0x9651=function(_0x225d44,_0x399b52){_0x225d44=_0x225d44-0x0;var _0x4aa98a=_0x6519[_0x225d44];return _0x4aa98a;};'use strict';var Sequelize=require(_0x9651('0x0'));module[_0x9651('0x1')]={'name':{'type':Sequelize[_0x9651('0x2')],'unique':_0x9651('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9651('0x2')]},'notes':{'type':Sequelize[_0x9651('0x4')]},'preproduction':{'type':Sequelize[_0x9651('0x5')](_0x9651('0x6')),'get':function(){if(this[_0x9651('0x7')](_0x9651('0x8'))){return this['getDataValue'](_0x9651('0x8'))['toString'](_0x9651('0x9'));}}},'production':{'type':Sequelize[_0x9651('0x5')](_0x9651('0x6')),'get':function(){if(this['getDataValue'](_0x9651('0xa'))){return this[_0x9651('0x7')](_0x9651('0xa'))[_0x9651('0xb')](_0x9651('0x9'));}}},'savedAt':{'type':Sequelize[_0x9651('0xc')]},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index b338446..1f7cc82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d5a=['Content-Range','reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','end','error','stack','name','send','index','map','SquareProject','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','filter','findAll','rows','show','params','rawAttributes','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','sort','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x412564,_0x39fa1a){var _0x5389dc=function(_0xb0f1c7){while(--_0xb0f1c7){_0x412564['push'](_0x412564['shift']());}};_0x5389dc(++_0x39fa1a);}(_0x5d5a,0x1bc));var _0xa5d5=function(_0x3a857d,_0x39a376){_0x3a857d=_0x3a857d-0x0;var _0x239c18=_0x5d5a[_0x3a857d];return _0x239c18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5d5('0x0'));var zipdir=require(_0xa5d5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5d5('0x2'));var moment=require('moment');var BPromise=require(_0xa5d5('0x3'));var Mustache=require('mustache');var util=require(_0xa5d5('0x4'));var path=require(_0xa5d5('0x5'));var sox=require(_0xa5d5('0x6'));var csv=require(_0xa5d5('0x7'));var ejs=require(_0xa5d5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa5d5('0x9'));var crypto=require(_0xa5d5('0xa'));var jsforce=require(_0xa5d5('0xb'));var deskjs=require(_0xa5d5('0xc'));var toCsv=require(_0xa5d5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa5d5('0xd'));var authService=require(_0xa5d5('0xe'));var qs=require(_0xa5d5('0xf'));var as=require(_0xa5d5('0x10'));var hardwareService=require(_0xa5d5('0x11'));var logger=require('../../config/logger')(_0xa5d5('0x12'));var utils=require('../../config/utils');var config=require(_0xa5d5('0x13'));var licenseUtil=require(_0xa5d5('0x14'));var db=require(_0xa5d5('0x15'))['db'];config[_0xa5d5('0x16')]=_[_0xa5d5('0x17')](config[_0xa5d5('0x16')],{'host':_0xa5d5('0x18'),'port':0x18eb});var socket=require(_0xa5d5('0x19'))(new Redis(config[_0xa5d5('0x16')]));require(_0xa5d5('0x1a'))[_0xa5d5('0x1b')](socket);function respondWithStatusCode(_0x3518ff,_0x43f085){_0x43f085=_0x43f085||0xcc;return function(_0x132c4c){if(_0x132c4c){return _0x3518ff[_0xa5d5('0x1c')](_0x43f085);}return _0x3518ff[_0xa5d5('0x1d')](_0x43f085)['end']();};}function respondWithResult(_0x31f9f1,_0xfa884c){_0xfa884c=_0xfa884c||0xc8;return function(_0x443d6a){if(_0x443d6a){return _0x31f9f1[_0xa5d5('0x1d')](_0xfa884c)[_0xa5d5('0x1e')](_0x443d6a);}};}function respondWithFilteredResult(_0x40dc70,_0x51af67){return function(_0x6920e7){if(_0x6920e7){var _0x424abc=typeof _0x51af67[_0xa5d5('0x1f')]===_0xa5d5('0x20')&&typeof _0x51af67[_0xa5d5('0x21')]==='undefined';var _0x172ff3=_0x6920e7['count'];var _0x1d8f26=_0x424abc?0x0:_0x51af67[_0xa5d5('0x1f')];var _0x4f61b2=_0x424abc?_0x6920e7[_0xa5d5('0x22')]:_0x51af67[_0xa5d5('0x1f')]+_0x51af67[_0xa5d5('0x21')];var _0x24d4d4;if(_0x4f61b2>=_0x172ff3){_0x4f61b2=_0x172ff3;_0x24d4d4=0xc8;}else{_0x24d4d4=0xce;}_0x40dc70[_0xa5d5('0x1d')](_0x24d4d4);return _0x40dc70[_0xa5d5('0x23')](_0xa5d5('0x24'),_0x1d8f26+'-'+_0x4f61b2+'/'+_0x172ff3)['json'](_0x6920e7);}return null;};}function patchUpdates(_0x4c3dc8){return function(_0x58394c){try{jsonpatch['apply'](_0x58394c,_0x4c3dc8,!![]);}catch(_0x5431df){return BPromise[_0xa5d5('0x25')](_0x5431df);}return _0x58394c[_0xa5d5('0x26')]();};}function saveUpdates(_0x1007bd,_0x289196){return function(_0x306b95){if(_0x306b95){return _0x306b95[_0xa5d5('0x27')](_0x1007bd)[_0xa5d5('0x28')](function(_0x1cafc5){return _0x1cafc5;});}return null;};}function removeEntity(_0x3b38f0,_0x4b4338){return function(_0x3dd6d6){if(_0x3dd6d6){return _0x3dd6d6['destroy']()[_0xa5d5('0x28')](function(){var _0xb82aaa=_0x3dd6d6[_0xa5d5('0x29')]({'plain':!![]});var _0x28c15=_0xa5d5('0x2a');return db[_0xa5d5('0x2b')][_0xa5d5('0x2c')]({'where':{'type':_0x28c15,'resourceId':_0xb82aaa['id']}})['then'](function(){return _0x3dd6d6;});})[_0xa5d5('0x28')](function(){_0x3b38f0[_0xa5d5('0x1d')](0xcc)[_0xa5d5('0x2d')]();});}};}function handleEntityNotFound(_0x3b7feb,_0x597b91){return function(_0x18bde7){if(!_0x18bde7){_0x3b7feb[_0xa5d5('0x1c')](0x194);}return _0x18bde7;};}function handleError(_0x2f3bde,_0x47917f){_0x47917f=_0x47917f||0x1f4;return function(_0x24be0b){logger[_0xa5d5('0x2e')](_0x24be0b[_0xa5d5('0x2f')]);if(_0x24be0b[_0xa5d5('0x30')]){delete _0x24be0b['name'];}_0x2f3bde[_0xa5d5('0x1d')](_0x47917f)[_0xa5d5('0x31')](_0x24be0b);};}exports[_0xa5d5('0x32')]=function(_0x307b60,_0x44e0a3){var _0x378d64={},_0xd6b2b={},_0x59f035={'count':0x0,'rows':[]};var _0x1c32cd=_[_0xa5d5('0x33')](db[_0xa5d5('0x34')]['rawAttributes'],function(_0x3c6abb){return{'name':_0x3c6abb[_0xa5d5('0x35')],'type':_0x3c6abb[_0xa5d5('0x36')][_0xa5d5('0x37')]};});_0xd6b2b[_0xa5d5('0x38')]=_[_0xa5d5('0x33')](_0x1c32cd,'name');_0xd6b2b[_0xa5d5('0x39')]=_[_0xa5d5('0x3a')](_0x307b60[_0xa5d5('0x39')]);_0xd6b2b[_0xa5d5('0x3b')]=_[_0xa5d5('0x3c')](_0xd6b2b[_0xa5d5('0x38')],_0xd6b2b[_0xa5d5('0x39')]);_0x378d64['attributes']=_[_0xa5d5('0x3c')](_0xd6b2b[_0xa5d5('0x38')],qs[_0xa5d5('0x3d')](_0x307b60['query']['fields']));_0x378d64['attributes']=_0x378d64[_0xa5d5('0x3e')][_0xa5d5('0x3f')]?_0x378d64[_0xa5d5('0x3e')]:_0xd6b2b[_0xa5d5('0x38')];if(!_0x307b60[_0xa5d5('0x39')][_0xa5d5('0x40')](_0xa5d5('0x41'))){_0x378d64['limit']=qs[_0xa5d5('0x21')](_0x307b60['query']['limit']);_0x378d64['offset']=qs[_0xa5d5('0x1f')](_0x307b60[_0xa5d5('0x39')]['offset']);}_0x378d64[_0xa5d5('0x42')]=qs['sort'](_0x307b60[_0xa5d5('0x39')]['sort']);_0x378d64[_0xa5d5('0x43')]=qs[_0xa5d5('0x3b')](_[_0xa5d5('0x44')](_0x307b60[_0xa5d5('0x39')],_0xd6b2b[_0xa5d5('0x3b')]),_0x1c32cd);if(_0x307b60[_0xa5d5('0x39')]['filter']){_0x378d64[_0xa5d5('0x43')]=_[_0xa5d5('0x45')](_0x378d64[_0xa5d5('0x43')],{'$or':_['map'](_0x1c32cd,function(_0x5ce535){if(_0x5ce535['type']!=='VIRTUAL'){var _0x361ec1={};_0x361ec1[_0x5ce535[_0xa5d5('0x30')]]={'$like':'%'+_0x307b60[_0xa5d5('0x39')][_0xa5d5('0x46')]+'%'};return _0x361ec1;}})});}_0x378d64=_['merge']({},_0x378d64,_0x307b60['options']);var _0x59ff7b={'where':_0x378d64[_0xa5d5('0x43')]};return db[_0xa5d5('0x34')][_0xa5d5('0x22')](_0x59ff7b)[_0xa5d5('0x28')](function(_0x3da511){_0x59f035['count']=_0x3da511;if(_0x307b60[_0xa5d5('0x39')]['includeAll']){_0x378d64['include']=[{'all':!![]}];}return db[_0xa5d5('0x34')][_0xa5d5('0x47')](_0x378d64);})[_0xa5d5('0x28')](function(_0x10e180){_0x59f035[_0xa5d5('0x48')]=_0x10e180;return _0x59f035;})[_0xa5d5('0x28')](respondWithFilteredResult(_0x44e0a3,_0x378d64))['catch'](handleError(_0x44e0a3,null));};exports[_0xa5d5('0x49')]=function(_0x3c57de,_0x5e8470){var _0x1d9cd7={'raw':![],'where':{'id':_0x3c57de[_0xa5d5('0x4a')]['id']}},_0x40c8bf={};_0x40c8bf[_0xa5d5('0x38')]=_[_0xa5d5('0x3a')](db[_0xa5d5('0x34')][_0xa5d5('0x4b')]);_0x40c8bf['query']=_[_0xa5d5('0x3a')](_0x3c57de[_0xa5d5('0x39')]);_0x40c8bf[_0xa5d5('0x3b')]=_[_0xa5d5('0x3c')](_0x40c8bf['model'],_0x40c8bf[_0xa5d5('0x39')]);_0x1d9cd7[_0xa5d5('0x3e')]=_[_0xa5d5('0x3c')](_0x40c8bf['model'],qs[_0xa5d5('0x3d')](_0x3c57de['query'][_0xa5d5('0x3d')]));_0x1d9cd7[_0xa5d5('0x3e')]=_0x1d9cd7[_0xa5d5('0x3e')][_0xa5d5('0x3f')]?_0x1d9cd7[_0xa5d5('0x3e')]:_0x40c8bf[_0xa5d5('0x38')];if(_0x3c57de['query'][_0xa5d5('0x4c')]){_0x1d9cd7['include']=[{'all':!![]}];}_0x1d9cd7=_[_0xa5d5('0x45')]({},_0x1d9cd7,_0x3c57de[_0xa5d5('0x4d')]);return db['SquareProject'][_0xa5d5('0x4e')](_0x1d9cd7)[_0xa5d5('0x28')](handleEntityNotFound(_0x5e8470,null))[_0xa5d5('0x28')](respondWithResult(_0x5e8470,null))[_0xa5d5('0x4f')](handleError(_0x5e8470,null));};exports[_0xa5d5('0x50')]=function(_0x5b0b29,_0x629641){return db[_0xa5d5('0x34')][_0xa5d5('0x50')](_0x5b0b29[_0xa5d5('0x51')],{})[_0xa5d5('0x28')](function(_0x477a61){var _0x438530=_0x5b0b29[_0xa5d5('0x52')][_0xa5d5('0x29')]({'plain':!![]});if(!_0x438530)throw new Error(_0xa5d5('0x53'));if(_0x438530[_0xa5d5('0x54')]===_0xa5d5('0x52')){var _0x4dc84b=_0x477a61['get']({'plain':!![]});var _0x5c610c=_0xa5d5('0x2a');return db['UserProfileSection'][_0xa5d5('0x4e')]({'where':{'name':_0x5c610c,'userProfileId':_0x438530['userProfileId']},'raw':!![]})[_0xa5d5('0x28')](function(_0x38dc56){if(_0x38dc56&&_0x38dc56['autoAssociation']===0x0){return db[_0xa5d5('0x2b')][_0xa5d5('0x50')]({'name':_0x4dc84b['name'],'resourceId':_0x4dc84b['id'],'type':_0x38dc56[_0xa5d5('0x30')],'sectionId':_0x38dc56['id']},{})[_0xa5d5('0x28')](function(){return _0x477a61;});}else{return _0x477a61;}})[_0xa5d5('0x4f')](function(_0x585ad7){logger[_0xa5d5('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x585ad7);throw _0x585ad7;});}return _0x477a61;})[_0xa5d5('0x28')](respondWithResult(_0x629641,0xc9))[_0xa5d5('0x4f')](handleError(_0x629641,null));};exports[_0xa5d5('0x27')]=function(_0x1fdcf5,_0x342777){if(_0x1fdcf5[_0xa5d5('0x51')]['id']){delete _0x1fdcf5['body']['id'];}return db['SquareProject']['find']({'where':{'id':_0x1fdcf5[_0xa5d5('0x4a')]['id']}})[_0xa5d5('0x28')](handleEntityNotFound(_0x342777,null))[_0xa5d5('0x28')](saveUpdates(_0x1fdcf5[_0xa5d5('0x51')],null))[_0xa5d5('0x28')](respondWithResult(_0x342777,null))[_0xa5d5('0x4f')](handleError(_0x342777,null));};exports[_0xa5d5('0x2c')]=function(_0x1268a2,_0x3d00c5){return db[_0xa5d5('0x34')][_0xa5d5('0x4e')]({'where':{'id':_0x1268a2[_0xa5d5('0x4a')]['id']}})[_0xa5d5('0x28')](handleEntityNotFound(_0x3d00c5,null))[_0xa5d5('0x28')](removeEntity(_0x3d00c5,null))[_0xa5d5('0x4f')](handleError(_0x3d00c5,null));};exports[_0xa5d5('0x55')]=function(_0x490e8e,_0x7ad91e,_0x55f1b6){return db[_0xa5d5('0x34')][_0xa5d5('0x4e')]({'where':{'id':_0x490e8e[_0xa5d5('0x4a')]['id']}})[_0xa5d5('0x28')](handleEntityNotFound(_0x7ad91e,null))[_0xa5d5('0x28')](function(_0x406a71){if(_0x406a71){return _0x406a71[_0xa5d5('0x55')](_0x490e8e[_0xa5d5('0x51')][_0xa5d5('0x56')],_[_0xa5d5('0x57')](_0x490e8e[_0xa5d5('0x51')],['ids','id'])||{});}})[_0xa5d5('0x28')](respondWithResult(_0x7ad91e,null))[_0xa5d5('0x4f')](handleError(_0x7ad91e,null));};exports['removeUsers']=function(_0x4215fe,_0x3e571b,_0xa87349){return db[_0xa5d5('0x34')]['find']({'where':{'id':_0x4215fe[_0xa5d5('0x4a')]['id']}})[_0xa5d5('0x28')](handleEntityNotFound(_0x3e571b,null))[_0xa5d5('0x28')](function(_0x160355){if(_0x160355){return _0x160355[_0xa5d5('0x58')](_0x4215fe['query'][_0xa5d5('0x56')])[_0xa5d5('0x28')](function(){if(_[_0xa5d5('0x59')](_0x4215fe[_0xa5d5('0x39')][_0xa5d5('0x56')])){for(var _0x430d46=0x0;_0x430d46<_0x4215fe[_0xa5d5('0x39')]['ids'][_0xa5d5('0x3f')];_0x430d46+=0x1){socket[_0xa5d5('0x5a')]('userSquareProject:remove',{'UserId':Number(_0x4215fe[_0xa5d5('0x39')][_0xa5d5('0x56')][_0x430d46]),'SquareProjectId':Number(_0x4215fe[_0xa5d5('0x4a')]['id'])});}}else{socket['emit'](_0xa5d5('0x5b'),{'UserId':Number(_0x4215fe[_0xa5d5('0x39')]['ids']),'SquareProjectId':Number(_0x4215fe[_0xa5d5('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e571b,null))[_0xa5d5('0x4f')](handleError(_0x3e571b,null));};exports[_0xa5d5('0x5c')]=function(_0x26b509,_0x271d67,_0x4a6947){var _0x18ef3c={};var _0xd90ae1={};var _0x3a81ca;var _0x48441d;return db[_0xa5d5('0x34')][_0xa5d5('0x5d')]({'where':{'id':_0x26b509[_0xa5d5('0x4a')]['id']}})[_0xa5d5('0x28')](handleEntityNotFound(_0x271d67,null))['then'](function(_0x2512d4){if(_0x2512d4){_0x3a81ca=_0x2512d4;_0xd90ae1[_0xa5d5('0x38')]=_[_0xa5d5('0x3a')](db[_0xa5d5('0x5e')][_0xa5d5('0x4b')]);_0xd90ae1[_0xa5d5('0x39')]=_[_0xa5d5('0x3a')](_0x26b509[_0xa5d5('0x39')]);_0xd90ae1[_0xa5d5('0x3b')]=_[_0xa5d5('0x3c')](_0xd90ae1['model'],_0xd90ae1[_0xa5d5('0x39')]);_0x18ef3c['attributes']=_['intersection'](_0xd90ae1[_0xa5d5('0x38')],qs['fields'](_0x26b509['query'][_0xa5d5('0x3d')]));_0x18ef3c[_0xa5d5('0x3e')]=_0x18ef3c['attributes'][_0xa5d5('0x3f')]?_0x18ef3c['attributes']:_0xd90ae1[_0xa5d5('0x38')];_0x18ef3c['order']=qs[_0xa5d5('0x5f')](_0x26b509[_0xa5d5('0x39')][_0xa5d5('0x5f')]);_0x18ef3c[_0xa5d5('0x43')]=qs[_0xa5d5('0x3b')](_[_0xa5d5('0x44')](_0x26b509[_0xa5d5('0x39')],_0xd90ae1[_0xa5d5('0x3b')]));if(_0x26b509[_0xa5d5('0x39')][_0xa5d5('0x46')]){_0x18ef3c[_0xa5d5('0x43')]=_[_0xa5d5('0x45')](_0x18ef3c[_0xa5d5('0x43')],{'$or':_[_0xa5d5('0x33')](_0x18ef3c[_0xa5d5('0x3e')],function(_0xd66bf9){var _0x476c4d={};_0x476c4d[_0xd66bf9]={'$like':'%'+_0x26b509[_0xa5d5('0x39')][_0xa5d5('0x46')]+'%'};return _0x476c4d;})});}_0x18ef3c=_[_0xa5d5('0x45')]({},_0x18ef3c,_0x26b509[_0xa5d5('0x4d')]);return _0x3a81ca[_0xa5d5('0x5c')](_0x18ef3c);}})[_0xa5d5('0x28')](function(_0x2272bc){if(_0x2272bc){_0x48441d=_0x2272bc[_0xa5d5('0x3f')];if(!_0x26b509['query']['hasOwnProperty'](_0xa5d5('0x41'))){_0x18ef3c[_0xa5d5('0x21')]=qs['limit'](_0x26b509[_0xa5d5('0x39')][_0xa5d5('0x21')]);_0x18ef3c[_0xa5d5('0x1f')]=qs['offset'](_0x26b509[_0xa5d5('0x39')]['offset']);}return _0x3a81ca[_0xa5d5('0x5c')](_0x18ef3c);}})['then'](function(_0x5cefec){if(_0x5cefec){return _0x5cefec?{'count':_0x48441d,'rows':_0x5cefec}:null;}})[_0xa5d5('0x28')](respondWithResult(_0x271d67,null))[_0xa5d5('0x4f')](handleError(_0x271d67,null));};
\ No newline at end of file
+var _0x63be=['error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','filter','getUsers','catch','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','limit','undefined','offset','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource'];(function(_0x643bf4,_0x2d888f){var _0x3657b3=function(_0x2a3231){while(--_0x2a3231){_0x643bf4['push'](_0x643bf4['shift']());}};_0x3657b3(++_0x2d888f);}(_0x63be,0x94));var _0xe63b=function(_0x51e7f6,_0x572d69){_0x51e7f6=_0x51e7f6-0x0;var _0x3eb052=_0x63be[_0x51e7f6];return _0x3eb052;};'use strict';var emlformat=require(_0xe63b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe63b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe63b('0x2'));var BPromise=require(_0xe63b('0x3'));var Mustache=require(_0xe63b('0x4'));var util=require(_0xe63b('0x5'));var path=require(_0xe63b('0x6'));var sox=require('sox');var csv=require(_0xe63b('0x7'));var ejs=require(_0xe63b('0x8'));var fs=require('fs');var fs_extra=require(_0xe63b('0x9'));var _=require(_0xe63b('0xa'));var squel=require(_0xe63b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe63b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe63b('0xd'));var Papa=require('papaparse');var Redis=require(_0xe63b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe63b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe63b('0x10'))(_0xe63b('0x11'));var utils=require('../../config/utils');var config=require(_0xe63b('0x12'));var licenseUtil=require(_0xe63b('0x13'));var db=require(_0xe63b('0x14'))['db'];config[_0xe63b('0x15')]=_[_0xe63b('0x16')](config[_0xe63b('0x15')],{'host':_0xe63b('0x17'),'port':0x18eb});var socket=require(_0xe63b('0x18'))(new Redis(config[_0xe63b('0x15')]));require(_0xe63b('0x19'))[_0xe63b('0x1a')](socket);function respondWithStatusCode(_0x350afc,_0x4cbfd7){_0x4cbfd7=_0x4cbfd7||0xcc;return function(_0x450844){if(_0x450844){return _0x350afc[_0xe63b('0x1b')](_0x4cbfd7);}return _0x350afc['status'](_0x4cbfd7)[_0xe63b('0x1c')]();};}function respondWithResult(_0x494d79,_0x57c7b0){_0x57c7b0=_0x57c7b0||0xc8;return function(_0x3b46e7){if(_0x3b46e7){return _0x494d79['status'](_0x57c7b0)['json'](_0x3b46e7);}};}function respondWithFilteredResult(_0x348008,_0x5f2f57){return function(_0x30cd97){if(_0x30cd97){var _0x4a2be0=typeof _0x5f2f57['offset']==='undefined'&&typeof _0x5f2f57[_0xe63b('0x1d')]===_0xe63b('0x1e');var _0x10e36f=_0x30cd97['count'];var _0x49c569=_0x4a2be0?0x0:_0x5f2f57[_0xe63b('0x1f')];var _0x5b6f40=_0x4a2be0?_0x30cd97[_0xe63b('0x20')]:_0x5f2f57[_0xe63b('0x1f')]+_0x5f2f57['limit'];var _0x23efb2;if(_0x5b6f40>=_0x10e36f){_0x5b6f40=_0x10e36f;_0x23efb2=0xc8;}else{_0x23efb2=0xce;}_0x348008[_0xe63b('0x21')](_0x23efb2);return _0x348008[_0xe63b('0x22')](_0xe63b('0x23'),_0x49c569+'-'+_0x5b6f40+'/'+_0x10e36f)[_0xe63b('0x24')](_0x30cd97);}return null;};}function patchUpdates(_0x2a4d94){return function(_0xf8f37e){try{jsonpatch[_0xe63b('0x25')](_0xf8f37e,_0x2a4d94,!![]);}catch(_0x351233){return BPromise[_0xe63b('0x26')](_0x351233);}return _0xf8f37e[_0xe63b('0x27')]();};}function saveUpdates(_0x4f5815,_0x3d0171){return function(_0x410feb){if(_0x410feb){return _0x410feb[_0xe63b('0x28')](_0x4f5815)[_0xe63b('0x29')](function(_0x126024){return _0x126024;});}return null;};}function removeEntity(_0x4e33c5,_0x275855){return function(_0x5fdc15){if(_0x5fdc15){return _0x5fdc15[_0xe63b('0x2a')]()[_0xe63b('0x29')](function(){var _0x8fb7d6=_0x5fdc15[_0xe63b('0x2b')]({'plain':!![]});var _0x3c9123=_0xe63b('0x2c');return db[_0xe63b('0x2d')]['destroy']({'where':{'type':_0x3c9123,'resourceId':_0x8fb7d6['id']}})['then'](function(){return _0x5fdc15;});})[_0xe63b('0x29')](function(){_0x4e33c5['status'](0xcc)[_0xe63b('0x1c')]();});}};}function handleEntityNotFound(_0xd2d95,_0x47ca1a){return function(_0x2407e8){if(!_0x2407e8){_0xd2d95[_0xe63b('0x1b')](0x194);}return _0x2407e8;};}function handleError(_0x29e995,_0x5dad79){_0x5dad79=_0x5dad79||0x1f4;return function(_0x5cd073){logger[_0xe63b('0x2e')](_0x5cd073[_0xe63b('0x2f')]);if(_0x5cd073['name']){delete _0x5cd073[_0xe63b('0x30')];}_0x29e995[_0xe63b('0x21')](_0x5dad79)[_0xe63b('0x31')](_0x5cd073);};}exports[_0xe63b('0x32')]=function(_0x432029,_0x81fb64){var _0x5db180={},_0x483510={},_0xd4b88b={'count':0x0,'rows':[]};var _0x492486=_[_0xe63b('0x33')](db[_0xe63b('0x34')][_0xe63b('0x35')],function(_0x1ace9b){return{'name':_0x1ace9b[_0xe63b('0x36')],'type':_0x1ace9b[_0xe63b('0x37')][_0xe63b('0x38')]};});_0x483510[_0xe63b('0x39')]=_[_0xe63b('0x33')](_0x492486,'name');_0x483510[_0xe63b('0x3a')]=_[_0xe63b('0x3b')](_0x432029['query']);_0x483510[_0xe63b('0x3c')]=_[_0xe63b('0x3d')](_0x483510[_0xe63b('0x39')],_0x483510['query']);_0x5db180[_0xe63b('0x3e')]=_['intersection'](_0x483510[_0xe63b('0x39')],qs[_0xe63b('0x3f')](_0x432029[_0xe63b('0x3a')]['fields']));_0x5db180['attributes']=_0x5db180['attributes'][_0xe63b('0x40')]?_0x5db180[_0xe63b('0x3e')]:_0x483510['model'];if(!_0x432029['query'][_0xe63b('0x41')](_0xe63b('0x42'))){_0x5db180[_0xe63b('0x1d')]=qs[_0xe63b('0x1d')](_0x432029[_0xe63b('0x3a')][_0xe63b('0x1d')]);_0x5db180[_0xe63b('0x1f')]=qs[_0xe63b('0x1f')](_0x432029[_0xe63b('0x3a')][_0xe63b('0x1f')]);}_0x5db180[_0xe63b('0x43')]=qs['sort'](_0x432029[_0xe63b('0x3a')][_0xe63b('0x44')]);_0x5db180['where']=qs[_0xe63b('0x3c')](_[_0xe63b('0x45')](_0x432029[_0xe63b('0x3a')],_0x483510[_0xe63b('0x3c')]),_0x492486);if(_0x432029[_0xe63b('0x3a')]['filter']){_0x5db180[_0xe63b('0x46')]=_['merge'](_0x5db180[_0xe63b('0x46')],{'$or':_[_0xe63b('0x33')](_0x492486,function(_0x26f2e5){if(_0x26f2e5[_0xe63b('0x37')]!==_0xe63b('0x47')){var _0x460f40={};_0x460f40[_0x26f2e5[_0xe63b('0x30')]]={'$like':'%'+_0x432029[_0xe63b('0x3a')]['filter']+'%'};return _0x460f40;}})});}_0x5db180=_[_0xe63b('0x48')]({},_0x5db180,_0x432029[_0xe63b('0x49')]);var _0x1e3a6f={'where':_0x5db180['where']};return db[_0xe63b('0x34')][_0xe63b('0x20')](_0x1e3a6f)[_0xe63b('0x29')](function(_0x4c1a38){_0xd4b88b[_0xe63b('0x20')]=_0x4c1a38;if(_0x432029[_0xe63b('0x3a')][_0xe63b('0x4a')]){_0x5db180['include']=[{'all':!![]}];}return db['SquareProject'][_0xe63b('0x4b')](_0x5db180);})[_0xe63b('0x29')](function(_0x261899){_0xd4b88b[_0xe63b('0x4c')]=_0x261899;return _0xd4b88b;})[_0xe63b('0x29')](respondWithFilteredResult(_0x81fb64,_0x5db180))['catch'](handleError(_0x81fb64,null));};exports[_0xe63b('0x4d')]=function(_0x1392e5,_0x360581){var _0x18d7e9={'raw':![],'where':{'id':_0x1392e5[_0xe63b('0x4e')]['id']}},_0x47edc9={};_0x47edc9[_0xe63b('0x39')]=_[_0xe63b('0x3b')](db[_0xe63b('0x34')]['rawAttributes']);_0x47edc9[_0xe63b('0x3a')]=_[_0xe63b('0x3b')](_0x1392e5[_0xe63b('0x3a')]);_0x47edc9[_0xe63b('0x3c')]=_[_0xe63b('0x3d')](_0x47edc9[_0xe63b('0x39')],_0x47edc9[_0xe63b('0x3a')]);_0x18d7e9['attributes']=_[_0xe63b('0x3d')](_0x47edc9['model'],qs[_0xe63b('0x3f')](_0x1392e5[_0xe63b('0x3a')][_0xe63b('0x3f')]));_0x18d7e9['attributes']=_0x18d7e9[_0xe63b('0x3e')][_0xe63b('0x40')]?_0x18d7e9['attributes']:_0x47edc9[_0xe63b('0x39')];if(_0x1392e5[_0xe63b('0x3a')][_0xe63b('0x4a')]){_0x18d7e9['include']=[{'all':!![]}];}_0x18d7e9=_[_0xe63b('0x48')]({},_0x18d7e9,_0x1392e5['options']);return db['SquareProject'][_0xe63b('0x4f')](_0x18d7e9)[_0xe63b('0x29')](handleEntityNotFound(_0x360581,null))[_0xe63b('0x29')](respondWithResult(_0x360581,null))['catch'](handleError(_0x360581,null));};exports[_0xe63b('0x50')]=function(_0x4905ce,_0x51a910){return db[_0xe63b('0x34')][_0xe63b('0x50')](_0x4905ce['body'],{})[_0xe63b('0x29')](function(_0x446624){var _0x585da3=_0x4905ce['user'][_0xe63b('0x2b')]({'plain':!![]});if(!_0x585da3)throw new Error(_0xe63b('0x51'));if(_0x585da3['role']===_0xe63b('0x52')){var _0x4c05ad=_0x446624[_0xe63b('0x2b')]({'plain':!![]});var _0x4aa46c=_0xe63b('0x2c');return db[_0xe63b('0x53')][_0xe63b('0x4f')]({'where':{'name':_0x4aa46c,'userProfileId':_0x585da3[_0xe63b('0x54')]},'raw':!![]})[_0xe63b('0x29')](function(_0x77c671){if(_0x77c671&&_0x77c671['autoAssociation']===0x0){return db[_0xe63b('0x2d')][_0xe63b('0x50')]({'name':_0x4c05ad['name'],'resourceId':_0x4c05ad['id'],'type':_0x77c671[_0xe63b('0x30')],'sectionId':_0x77c671['id']},{})[_0xe63b('0x29')](function(){return _0x446624;});}else{return _0x446624;}})['catch'](function(_0x525fe7){logger['error'](_0xe63b('0x55'),_0x525fe7);throw _0x525fe7;});}return _0x446624;})[_0xe63b('0x29')](respondWithResult(_0x51a910,0xc9))['catch'](handleError(_0x51a910,null));};exports[_0xe63b('0x28')]=function(_0x3ef71a,_0x571801){if(_0x3ef71a[_0xe63b('0x56')]['id']){delete _0x3ef71a['body']['id'];}return db[_0xe63b('0x34')][_0xe63b('0x4f')]({'where':{'id':_0x3ef71a['params']['id']}})['then'](handleEntityNotFound(_0x571801,null))[_0xe63b('0x29')](saveUpdates(_0x3ef71a[_0xe63b('0x56')],null))[_0xe63b('0x29')](respondWithResult(_0x571801,null))['catch'](handleError(_0x571801,null));};exports[_0xe63b('0x2a')]=function(_0x3d6330,_0x22dede){return db[_0xe63b('0x34')]['find']({'where':{'id':_0x3d6330[_0xe63b('0x4e')]['id']}})[_0xe63b('0x29')](handleEntityNotFound(_0x22dede,null))[_0xe63b('0x29')](removeEntity(_0x22dede,null))['catch'](handleError(_0x22dede,null));};exports[_0xe63b('0x57')]=function(_0x548e0c,_0x3f945b,_0x2c2a29){return db[_0xe63b('0x34')][_0xe63b('0x4f')]({'where':{'id':_0x548e0c[_0xe63b('0x4e')]['id']}})[_0xe63b('0x29')](handleEntityNotFound(_0x3f945b,null))['then'](function(_0x40b851){if(_0x40b851){return _0x40b851[_0xe63b('0x57')](_0x548e0c[_0xe63b('0x56')][_0xe63b('0x58')],_[_0xe63b('0x59')](_0x548e0c[_0xe63b('0x56')],[_0xe63b('0x58'),'id'])||{});}})[_0xe63b('0x29')](respondWithResult(_0x3f945b,null))['catch'](handleError(_0x3f945b,null));};exports['removeUsers']=function(_0x2cc994,_0x212f91,_0x38b16f){return db[_0xe63b('0x34')][_0xe63b('0x4f')]({'where':{'id':_0x2cc994[_0xe63b('0x4e')]['id']}})[_0xe63b('0x29')](handleEntityNotFound(_0x212f91,null))['then'](function(_0x46ca08){if(_0x46ca08){return _0x46ca08[_0xe63b('0x5a')](_0x2cc994[_0xe63b('0x3a')][_0xe63b('0x58')])['then'](function(){if(_[_0xe63b('0x5b')](_0x2cc994['query']['ids'])){for(var _0x2ae8df=0x0;_0x2ae8df<_0x2cc994['query'][_0xe63b('0x58')][_0xe63b('0x40')];_0x2ae8df+=0x1){socket[_0xe63b('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x2cc994[_0xe63b('0x3a')]['ids'][_0x2ae8df]),'SquareProjectId':Number(_0x2cc994[_0xe63b('0x4e')]['id'])});}}else{socket[_0xe63b('0x5c')](_0xe63b('0x5d'),{'UserId':Number(_0x2cc994['query'][_0xe63b('0x58')]),'SquareProjectId':Number(_0x2cc994[_0xe63b('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x212f91,null))['catch'](handleError(_0x212f91,null));};exports['getUsers']=function(_0xff2e5a,_0x304310,_0x3ad392){var _0x1b458b={};var _0x7084c7={};var _0x2426e6;var _0x38bafc;return db[_0xe63b('0x34')]['findOne']({'where':{'id':_0xff2e5a[_0xe63b('0x4e')]['id']}})[_0xe63b('0x29')](handleEntityNotFound(_0x304310,null))[_0xe63b('0x29')](function(_0x58ea16){if(_0x58ea16){_0x2426e6=_0x58ea16;_0x7084c7['model']=_[_0xe63b('0x3b')](db['User']['rawAttributes']);_0x7084c7[_0xe63b('0x3a')]=_[_0xe63b('0x3b')](_0xff2e5a['query']);_0x7084c7[_0xe63b('0x3c')]=_[_0xe63b('0x3d')](_0x7084c7[_0xe63b('0x39')],_0x7084c7['query']);_0x1b458b['attributes']=_[_0xe63b('0x3d')](_0x7084c7['model'],qs['fields'](_0xff2e5a['query'][_0xe63b('0x3f')]));_0x1b458b[_0xe63b('0x3e')]=_0x1b458b[_0xe63b('0x3e')][_0xe63b('0x40')]?_0x1b458b[_0xe63b('0x3e')]:_0x7084c7[_0xe63b('0x39')];_0x1b458b['order']=qs[_0xe63b('0x44')](_0xff2e5a['query'][_0xe63b('0x44')]);_0x1b458b[_0xe63b('0x46')]=qs[_0xe63b('0x3c')](_[_0xe63b('0x45')](_0xff2e5a['query'],_0x7084c7[_0xe63b('0x3c')]));if(_0xff2e5a[_0xe63b('0x3a')][_0xe63b('0x5e')]){_0x1b458b[_0xe63b('0x46')]=_[_0xe63b('0x48')](_0x1b458b['where'],{'$or':_['map'](_0x1b458b[_0xe63b('0x3e')],function(_0x442cbe){var _0x41d544={};_0x41d544[_0x442cbe]={'$like':'%'+_0xff2e5a[_0xe63b('0x3a')]['filter']+'%'};return _0x41d544;})});}_0x1b458b=_[_0xe63b('0x48')]({},_0x1b458b,_0xff2e5a[_0xe63b('0x49')]);return _0x2426e6['getUsers'](_0x1b458b);}})[_0xe63b('0x29')](function(_0x4ccb5d){if(_0x4ccb5d){_0x38bafc=_0x4ccb5d[_0xe63b('0x40')];if(!_0xff2e5a[_0xe63b('0x3a')][_0xe63b('0x41')](_0xe63b('0x42'))){_0x1b458b[_0xe63b('0x1d')]=qs[_0xe63b('0x1d')](_0xff2e5a[_0xe63b('0x3a')][_0xe63b('0x1d')]);_0x1b458b[_0xe63b('0x1f')]=qs[_0xe63b('0x1f')](_0xff2e5a[_0xe63b('0x3a')][_0xe63b('0x1f')]);}return _0x2426e6[_0xe63b('0x5f')](_0x1b458b);}})['then'](function(_0x4b5e26){if(_0x4b5e26){return _0x4b5e26?{'count':_0x38bafc,'rows':_0x4b5e26}:null;}})['then'](respondWithResult(_0x304310,null))[_0xe63b('0x60')](handleError(_0x304310,null));};
\ No newline at end of file
index f1a7a9f..6d76b85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f00=['exports','events','../../mysqldb','SquareProject','emit','hasOwnProperty','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5f00,0x189));var _0x05f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f00[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x05f0('0x0'));var SquareProject=require(_0x05f0('0x1'))['db'][_0x05f0('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x193695){return function(_0x3f6602,_0x384f18,_0x160c76){SquareProjectEvents[_0x05f0('0x3')](_0x193695+':'+_0x3f6602['id'],_0x3f6602);SquareProjectEvents[_0x05f0('0x3')](_0x193695,_0x3f6602);_0x160c76(null);};}for(var e in events){if(events[_0x05f0('0x4')](e)){var event=events[e];SquareProject[_0x05f0('0x5')](e,emitEvent(event));}}module[_0x05f0('0x6')]=SquareProjectEvents;
\ No newline at end of file
+var _0x9f0b=['emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0xa9b16f,_0x1ec464){var _0x5299da=function(_0x102d2f){while(--_0x102d2f){_0xa9b16f['push'](_0xa9b16f['shift']());}};_0x5299da(++_0x1ec464);}(_0x9f0b,0x1e0));var _0xb9f0=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0x9f0b[_0x35181c];return _0xe14bf9;};'use strict';var EventEmitter=require(_0xb9f0('0x0'));var SquareProject=require(_0xb9f0('0x1'))['db'][_0xb9f0('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb9f0('0x3')](0x0);var events={'afterCreate':_0xb9f0('0x4'),'afterUpdate':_0xb9f0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f1a6b){return function(_0x4cb330,_0x103a49,_0x3cb1d9){SquareProjectEvents[_0xb9f0('0x6')](_0x4f1a6b+':'+_0x4cb330['id'],_0x4cb330);SquareProjectEvents[_0xb9f0('0x6')](_0x4f1a6b,_0x4cb330);_0x3cb1d9(null);};}for(var e in events){if(events[_0xb9f0('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xb9f0('0x8')]=SquareProjectEvents;
\ No newline at end of file
index 722a2aa..ebae450 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7ad=['format','production','publishedAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','savedAt'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0xc7ad,0x192));var _0xdc7a=function(_0x1eeab2,_0x3bd5fe){_0x1eeab2=_0x1eeab2-0x0;var _0x69ee8d=_0xc7ad[_0x1eeab2];return _0x69ee8d;};'use strict';var _=require(_0xdc7a('0x0'));var util=require('util');var logger=require(_0xdc7a('0x1'))(_0xdc7a('0x2'));var moment=require(_0xdc7a('0x3'));var BPromise=require(_0xdc7a('0x4'));var rp=require(_0xdc7a('0x5'));var fs=require('fs');var path=require(_0xdc7a('0x6'));var rimraf=require(_0xdc7a('0x7'));var config=require(_0xdc7a('0x8'));var attributes=require(_0xdc7a('0x9'));module[_0xdc7a('0xa')]=function(_0x318d03,_0x105da9){return _0x318d03[_0xdc7a('0xb')](_0xdc7a('0xc'),attributes,{'tableName':_0xdc7a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f7131,_0x551d7d,_0x9fec35){if(_0x1f7131[_0xdc7a('0xe')]('preproduction')){_0x1f7131[_0xdc7a('0xf')]=moment()[_0xdc7a('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1f7131[_0xdc7a('0xe')](_0xdc7a('0x11'))){_0x1f7131[_0xdc7a('0x12')]=moment()[_0xdc7a('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x9fec35(null,_0x1f7131);}}});};
\ No newline at end of file
+var _0x4925=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format','production'];(function(_0x25d6ea,_0xbc9fe6){var _0x38b18f=function(_0x2b0a11){while(--_0x2b0a11){_0x25d6ea['push'](_0x25d6ea['shift']());}};_0x38b18f(++_0xbc9fe6);}(_0x4925,0xf1));var _0x5492=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x4925[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0x5492('0x0'));var util=require(_0x5492('0x1'));var logger=require(_0x5492('0x2'))(_0x5492('0x3'));var moment=require(_0x5492('0x4'));var BPromise=require(_0x5492('0x5'));var rp=require(_0x5492('0x6'));var fs=require('fs');var path=require(_0x5492('0x7'));var rimraf=require(_0x5492('0x8'));var config=require(_0x5492('0x9'));var attributes=require(_0x5492('0xa'));module[_0x5492('0xb')]=function(_0x433d64,_0x210456){return _0x433d64[_0x5492('0xc')](_0x5492('0xd'),attributes,{'tableName':_0x5492('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8010ae,_0x25f3ee,_0x401667){if(_0x8010ae[_0x5492('0xf')](_0x5492('0x10'))){_0x8010ae['savedAt']=moment()[_0x5492('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x8010ae[_0x5492('0xf')](_0x5492('0x12'))){_0x8010ae['publishedAt']=moment()[_0x5492('0x11')](_0x5492('0x13'));}_0x401667(null,_0x8010ae);}}});};
\ No newline at end of file
index 0e73a9a..d7cf31c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98c6=['request\x20sent','stringify','error','code','SquareProject,\x20%s,\x20%s','message','info','result','catch','find','options','where','attributes','include','model','ShowSquareProject','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./squareProject.socket','register','request','SquareProject,\x20%s,\x20%s,\x20%s'];(function(_0x48083f,_0x4188e2){var _0x5a0953=function(_0x40879b){while(--_0x40879b){_0x48083f['push'](_0x48083f['shift']());}};_0x5a0953(++_0x4188e2);}(_0x98c6,0x15a));var _0x698c=function(_0x36a3bc,_0x2c964f){_0x36a3bc=_0x36a3bc-0x0;var _0x2be32c=_0x98c6[_0x36a3bc];return _0x2be32c;};'use strict';var _=require(_0x698c('0x0'));var util=require(_0x698c('0x1'));var moment=require(_0x698c('0x2'));var BPromise=require(_0x698c('0x3'));var rs=require(_0x698c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x698c('0x5'))['db'];var utils=require(_0x698c('0x6'));var logger=require('../../config/logger')(_0x698c('0x7'));var config=require('../../config/environment');var jayson=require(_0x698c('0x8'));var client=jayson['client'][_0x698c('0x9')]({'port':0x232a});config[_0x698c('0xa')]=_[_0x698c('0xb')](config[_0x698c('0xa')],{'host':_0x698c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x698c('0xa')]));require(_0x698c('0xd'))[_0x698c('0xe')](socket);function respondWithRpcPromise(_0x71f1f3,_0x34d6c4,_0x35e255){return new BPromise(function(_0x8edd2,_0x5c79ac){return client[_0x698c('0xf')](_0x71f1f3,_0x35e255)['then'](function(_0x3a65ab){logger['info']('SquareProject,\x20%s,\x20%s',_0x34d6c4,'request\x20sent');logger['debug'](_0x698c('0x10'),_0x34d6c4,_0x698c('0x11'),JSON[_0x698c('0x12')](_0x3a65ab));if(_0x3a65ab[_0x698c('0x13')]){if(_0x3a65ab[_0x698c('0x13')][_0x698c('0x14')]===0x1f4){logger[_0x698c('0x13')](_0x698c('0x15'),_0x34d6c4,_0x3a65ab[_0x698c('0x13')]['message']);return _0x5c79ac(_0x3a65ab[_0x698c('0x13')][_0x698c('0x16')]);}logger[_0x698c('0x13')](_0x698c('0x15'),_0x34d6c4,_0x3a65ab[_0x698c('0x13')]['message']);return _0x8edd2(_0x3a65ab['error'][_0x698c('0x16')]);}else{logger[_0x698c('0x17')](_0x698c('0x15'),_0x34d6c4,'request\x20sent');_0x8edd2(_0x3a65ab[_0x698c('0x18')]['message']);}})[_0x698c('0x19')](function(_0x12b9d6){logger[_0x698c('0x13')](_0x698c('0x15'),_0x34d6c4,_0x12b9d6);_0x5c79ac(_0x12b9d6);});});}exports['ShowSquareProject']=function(_0x3ec3b8){var _0x39c7f6=this;return new Promise(function(_0x1a2296,_0x52a135){return db['SquareProject'][_0x698c('0x1a')]({'raw':_0x3ec3b8[_0x698c('0x1b')]?_0x3ec3b8['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ec3b8[_0x698c('0x1b')]?_0x3ec3b8[_0x698c('0x1b')][_0x698c('0x1c')]||null:null,'attributes':_0x3ec3b8[_0x698c('0x1b')]?_0x3ec3b8['options'][_0x698c('0x1d')]||null:null,'include':_0x3ec3b8['options']?_0x3ec3b8['options'][_0x698c('0x1e')]?_['map'](_0x3ec3b8['options'][_0x698c('0x1e')],function(_0x2ad6e5){return{'model':db[_0x2ad6e5['model']],'as':_0x2ad6e5['as'],'attributes':_0x2ad6e5[_0x698c('0x1d')],'include':_0x2ad6e5['include']?_['map'](_0x2ad6e5['include'],function(_0x25d9aa){return{'model':db[_0x25d9aa[_0x698c('0x1f')]],'as':_0x25d9aa['as'],'attributes':_0x25d9aa[_0x698c('0x1d')],'include':_0x25d9aa[_0x698c('0x1e')]?_['map'](_0x25d9aa[_0x698c('0x1e')],function(_0x10c5a4){return{'model':db[_0x10c5a4[_0x698c('0x1f')]],'as':_0x10c5a4['as'],'attributes':_0x10c5a4[_0x698c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x392a14){logger['info'](_0x698c('0x20'),_0x3ec3b8);logger['debug'](_0x698c('0x20'),_0x3ec3b8,JSON[_0x698c('0x12')](_0x392a14));_0x1a2296(_0x392a14);})[_0x698c('0x19')](function(_0x366d3a){logger['error']('ShowSquareProject',_0x366d3a[_0x698c('0x16')],_0x3ec3b8);_0x52a135(_0x39c7f6[_0x698c('0x13')](0x1f4,_0x366d3a['message']));});});};
\ No newline at end of file
+var _0x4c1a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','debug','request\x20sent','stringify','error','SquareProject,\x20%s,\x20%s','message','info','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','map','include','model','lodash','moment','bluebird','randomstring'];(function(_0x2e0e1a,_0x1c2ec2){var _0xd46d6b=function(_0x4ed379){while(--_0x4ed379){_0x2e0e1a['push'](_0x2e0e1a['shift']());}};_0xd46d6b(++_0x1c2ec2);}(_0x4c1a,0xe0));var _0xa4c1=function(_0x458d3b,_0xa004c){_0x458d3b=_0x458d3b-0x0;var _0x19333e=_0x4c1a[_0x458d3b];return _0x19333e;};'use strict';var _=require(_0xa4c1('0x0'));var util=require('util');var moment=require(_0xa4c1('0x1'));var BPromise=require(_0xa4c1('0x2'));var rs=require(_0xa4c1('0x3'));var fs=require('fs');var Redis=require(_0xa4c1('0x4'));var db=require(_0xa4c1('0x5'))['db'];var utils=require(_0xa4c1('0x6'));var logger=require('../../config/logger')(_0xa4c1('0x7'));var config=require(_0xa4c1('0x8'));var jayson=require(_0xa4c1('0x9'));var client=jayson[_0xa4c1('0xa')][_0xa4c1('0xb')]({'port':0x232a});config[_0xa4c1('0xc')]=_[_0xa4c1('0xd')](config['redis'],{'host':_0xa4c1('0xe'),'port':0x18eb});var socket=require(_0xa4c1('0xf'))(new Redis(config[_0xa4c1('0xc')]));require(_0xa4c1('0x10'))[_0xa4c1('0x11')](socket);function respondWithRpcPromise(_0x1ce2f4,_0xf71eae,_0x32a605){return new BPromise(function(_0x249c11,_0xe752ae){return client[_0xa4c1('0x12')](_0x1ce2f4,_0x32a605)[_0xa4c1('0x13')](function(_0x18af98){logger['info']('SquareProject,\x20%s,\x20%s',_0xf71eae,'request\x20sent');logger[_0xa4c1('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0xf71eae,_0xa4c1('0x15'),JSON[_0xa4c1('0x16')](_0x18af98));if(_0x18af98[_0xa4c1('0x17')]){if(_0x18af98['error']['code']===0x1f4){logger[_0xa4c1('0x17')](_0xa4c1('0x18'),_0xf71eae,_0x18af98[_0xa4c1('0x17')]['message']);return _0xe752ae(_0x18af98[_0xa4c1('0x17')][_0xa4c1('0x19')]);}logger[_0xa4c1('0x17')](_0xa4c1('0x18'),_0xf71eae,_0x18af98[_0xa4c1('0x17')][_0xa4c1('0x19')]);return _0x249c11(_0x18af98[_0xa4c1('0x17')][_0xa4c1('0x19')]);}else{logger[_0xa4c1('0x1a')](_0xa4c1('0x18'),_0xf71eae,_0xa4c1('0x15'));_0x249c11(_0x18af98[_0xa4c1('0x1b')][_0xa4c1('0x19')]);}})[_0xa4c1('0x1c')](function(_0x2db6df){logger[_0xa4c1('0x17')](_0xa4c1('0x18'),_0xf71eae,_0x2db6df);_0xe752ae(_0x2db6df);});});}exports[_0xa4c1('0x1d')]=function(_0x5d2382){var _0x4b3faa=this;return new Promise(function(_0x3f470b,_0x14a5c4){return db[_0xa4c1('0x1e')][_0xa4c1('0x1f')]({'raw':_0x5d2382[_0xa4c1('0x20')]?_0x5d2382['options'][_0xa4c1('0x21')]===undefined?!![]:![]:!![],'where':_0x5d2382[_0xa4c1('0x20')]?_0x5d2382[_0xa4c1('0x20')]['where']||null:null,'attributes':_0x5d2382[_0xa4c1('0x20')]?_0x5d2382['options'][_0xa4c1('0x22')]||null:null,'include':_0x5d2382[_0xa4c1('0x20')]?_0x5d2382[_0xa4c1('0x20')]['include']?_[_0xa4c1('0x23')](_0x5d2382[_0xa4c1('0x20')][_0xa4c1('0x24')],function(_0x1cfc81){return{'model':db[_0x1cfc81[_0xa4c1('0x25')]],'as':_0x1cfc81['as'],'attributes':_0x1cfc81[_0xa4c1('0x22')],'include':_0x1cfc81[_0xa4c1('0x24')]?_[_0xa4c1('0x23')](_0x1cfc81['include'],function(_0x34717d){return{'model':db[_0x34717d[_0xa4c1('0x25')]],'as':_0x34717d['as'],'attributes':_0x34717d[_0xa4c1('0x22')],'include':_0x34717d[_0xa4c1('0x24')]?_[_0xa4c1('0x23')](_0x34717d['include'],function(_0x3091cf){return{'model':db[_0x3091cf['model']],'as':_0x3091cf['as'],'attributes':_0x3091cf[_0xa4c1('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41ccbc){logger[_0xa4c1('0x1a')](_0xa4c1('0x1d'),_0x5d2382);logger[_0xa4c1('0x14')](_0xa4c1('0x1d'),_0x5d2382,JSON[_0xa4c1('0x16')](_0x41ccbc));_0x3f470b(_0x41ccbc);})['catch'](function(_0x5c5a6c){logger[_0xa4c1('0x17')](_0xa4c1('0x1d'),_0x5c5a6c['message'],_0x5d2382);_0x14a5c4(_0x4b3faa[_0xa4c1('0x17')](0x1f4,_0x5c5a6c[_0xa4c1('0x19')]));});});};
\ No newline at end of file
index 2e3da87..e01950c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39be=['emit','removeListener','register','squareProject:','./squareProject.events','save','remove'];(function(_0x2b9720,_0x12ba32){var _0x2e7b9a=function(_0x4e8733){while(--_0x4e8733){_0x2b9720['push'](_0x2b9720['shift']());}};_0x2e7b9a(++_0x12ba32);}(_0x39be,0x89));var _0xe39b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39be[_0x167cc1];return _0x10bc4b;};'use strict';var SquareProjectEvents=require(_0xe39b('0x0'));var events=[_0xe39b('0x1'),_0xe39b('0x2'),'update'];function createListener(_0xba4653,_0x557ef2){return function(_0x432363){_0x557ef2[_0xe39b('0x3')](_0xba4653,_0x432363);};}function removeListener(_0x1189af,_0x3efa07){return function(){SquareProjectEvents[_0xe39b('0x4')](_0x1189af,_0x3efa07);};}exports[_0xe39b('0x5')]=function(_0x163a3d){for(var _0x65a1f5=0x0,_0x4cbf75=events['length'];_0x65a1f5<_0x4cbf75;_0x65a1f5++){var _0x4933c4=events[_0x65a1f5];var _0x474c68=createListener(_0xe39b('0x6')+_0x4933c4,_0x163a3d);SquareProjectEvents['on'](_0x4933c4,_0x474c68);}};
\ No newline at end of file
+var _0x0624=['removeListener','register','length','squareProject:','save','update','emit'];(function(_0x4003f6,_0x3a8f3e){var _0x534c36=function(_0x25bf64){while(--_0x25bf64){_0x4003f6['push'](_0x4003f6['shift']());}};_0x534c36(++_0x3a8f3e);}(_0x0624,0xc8));var _0x4062=function(_0x5df7bd,_0x111492){_0x5df7bd=_0x5df7bd-0x0;var _0x3eb982=_0x0624[_0x5df7bd];return _0x3eb982;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x4062('0x0'),'remove',_0x4062('0x1')];function createListener(_0x1a621e,_0x208810){return function(_0x129511){_0x208810[_0x4062('0x2')](_0x1a621e,_0x129511);};}function removeListener(_0x4150ab,_0x16961c){return function(){SquareProjectEvents[_0x4062('0x3')](_0x4150ab,_0x16961c);};}exports[_0x4062('0x4')]=function(_0x72f99a){for(var _0x2eca98=0x0,_0x37295b=events[_0x4062('0x5')];_0x2eca98<_0x37295b;_0x2eca98++){var _0x8cc655=events[_0x2eca98];var _0x1ecddf=createListener(_0x4062('0x6')+_0x8cc655,_0x72f99a);SquareProjectEvents['on'](_0x8cc655,_0x1ecddf);}};
\ No newline at end of file
index 8ef3e0d..b61fc46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x565ac3,_0xa2ff0b){var _0x9178d1=function(_0x330bc8){while(--_0x330bc8){_0x565ac3['push'](_0x565ac3['shift']());}};_0x9178d1(++_0xa2ff0b);}(_0x1cb9,0x14e));var _0x91cb=function(_0x573dbb,_0x2b478e){_0x573dbb=_0x573dbb-0x0;var _0x591dcb=_0x1cb9[_0x573dbb];return _0x591dcb;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router;
\ No newline at end of file
+var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x4a79bd,_0x3f7827){var _0x26fd6a=function(_0x193ee6){while(--_0x193ee6){_0x4a79bd['push'](_0x4a79bd['shift']());}};_0x26fd6a(++_0x3f7827);}(_0x326f,0xd1));var _0xf326=function(_0xb547e,_0x10f2c8){_0xb547e=_0xb547e-0x0;var _0xc7657d=_0x326f[_0xb547e];return _0xc7657d;};'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/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router;
\ No newline at end of file
index 1608a3e..a775394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d17,0x17e));var _0x72d1=function(_0x21cd47,_0x3d9da1){_0x21cd47=_0x21cd47-0x0;var _0x1ef746=_0x2d17[_0x21cd47];return _0x1ef746;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}};
\ No newline at end of file
+var _0xda19=['getDataValue','exports','STRING','VIRTUAL'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0xda19,0xd5));var _0x9da1=function(_0x2cea85,_0x47f20b){_0x2cea85=_0x2cea85-0x0;var _0x47760e=_0xda19[_0x2cea85];return _0x47760e;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'uniqueid':{'type':Sequelize[_0x9da1('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9da1('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9da1('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9da1('0x1')]},'dnid':{'type':Sequelize[_0x9da1('0x1')]},'projectName':{'type':Sequelize[_0x9da1('0x1')]},'saveName':{'type':Sequelize[_0x9da1('0x1')]},'filename':{'type':Sequelize[_0x9da1('0x1')]},'savePath':{'type':Sequelize[_0x9da1('0x1')]},'format':{'type':Sequelize[_0x9da1('0x2')],'get':function(){var _0x2c3cdd='';var _0x1c24e6=this[_0x9da1('0x3')]('savePath');if(_0x1c24e6){_0x2c3cdd=_0x1c24e6['substring'](_0x1c24e6['lastIndexOf']('.'));}return _0x2c3cdd;}}};
\ No newline at end of file
index 945ffae..87d8e8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc61d=['options','includeAll','findAll','rows','catch','params','include','find','create','body','update','download','uniqueid','savePath','format','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','File:\x20\x22','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','error','stack','name','send','index','SquareRecording','rawAttributes','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x121d72,_0x41a6e3){var _0x5c4337=function(_0x448cde){while(--_0x448cde){_0x121d72['push'](_0x121d72['shift']());}};_0x5c4337(++_0x41a6e3);}(_0xc61d,0x1ec));var _0xdc61=function(_0x49b3a9,_0x5a6673){_0x49b3a9=_0x49b3a9-0x0;var _0x500b0c=_0xc61d[_0x49b3a9];return _0x500b0c;};'use strict';var emlformat=require(_0xdc61('0x0'));var rimraf=require(_0xdc61('0x1'));var zipdir=require(_0xdc61('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc61('0x3'));var moment=require(_0xdc61('0x4'));var BPromise=require(_0xdc61('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdc61('0x6'));var sox=require('sox');var csv=require(_0xdc61('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc61('0x8'));var squel=require(_0xdc61('0x9'));var crypto=require(_0xdc61('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdc61('0xb'));var toCsv=require(_0xdc61('0x7'));var querystring=require(_0xdc61('0xc'));var Papa=require(_0xdc61('0xd'));var Redis=require('ioredis');var authService=require(_0xdc61('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xdc61('0xf'));var hardwareService=require(_0xdc61('0x10'));var logger=require(_0xdc61('0x11'))('api');var utils=require(_0xdc61('0x12'));var config=require(_0xdc61('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc61('0x14'))['db'];function respondWithStatusCode(_0x114e9b,_0x2dac75){_0x2dac75=_0x2dac75||0xcc;return function(_0x29571c){if(_0x29571c){return _0x114e9b[_0xdc61('0x15')](_0x2dac75);}return _0x114e9b[_0xdc61('0x16')](_0x2dac75)[_0xdc61('0x17')]();};}function respondWithResult(_0x184938,_0x319c41){_0x319c41=_0x319c41||0xc8;return function(_0x5af8ff){if(_0x5af8ff){return _0x184938['status'](_0x319c41)[_0xdc61('0x18')](_0x5af8ff);}};}function respondWithFilteredResult(_0x5ee070,_0x5cc0cb){return function(_0x385e46){if(_0x385e46){var _0xcc435c=typeof _0x5cc0cb[_0xdc61('0x19')]===_0xdc61('0x1a')&&typeof _0x5cc0cb['limit']===_0xdc61('0x1a');var _0x1c28d3=_0x385e46[_0xdc61('0x1b')];var _0x403720=_0xcc435c?0x0:_0x5cc0cb['offset'];var _0x312f17=_0xcc435c?_0x385e46['count']:_0x5cc0cb['offset']+_0x5cc0cb['limit'];var _0x1714d2;if(_0x312f17>=_0x1c28d3){_0x312f17=_0x1c28d3;_0x1714d2=0xc8;}else{_0x1714d2=0xce;}_0x5ee070['status'](_0x1714d2);return _0x5ee070[_0xdc61('0x1c')](_0xdc61('0x1d'),_0x403720+'-'+_0x312f17+'/'+_0x1c28d3)['json'](_0x385e46);}return null;};}function patchUpdates(_0x228501){return function(_0x303737){try{jsonpatch[_0xdc61('0x1e')](_0x303737,_0x228501,!![]);}catch(_0x2e7742){return BPromise['reject'](_0x2e7742);}return _0x303737[_0xdc61('0x1f')]();};}function saveUpdates(_0x2f960c,_0x55d0cf){return function(_0x579de3){if(_0x579de3){return _0x579de3['update'](_0x2f960c)['then'](function(_0x11d4fe){return _0x11d4fe;});}return null;};}function removeEntity(_0x580f32,_0x3594c1){return function(_0x522d20){if(_0x522d20){return _0x522d20['destroy']()[_0xdc61('0x20')](function(){_0x580f32[_0xdc61('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1df6f9,_0x11a347){return function(_0x56fa90){if(!_0x56fa90){_0x1df6f9[_0xdc61('0x15')](0x194);}return _0x56fa90;};}function handleError(_0x46fc1e,_0x1903eb){_0x1903eb=_0x1903eb||0x1f4;return function(_0x4c4b2d){logger[_0xdc61('0x21')](_0x4c4b2d[_0xdc61('0x22')]);if(_0x4c4b2d[_0xdc61('0x23')]){delete _0x4c4b2d['name'];}_0x46fc1e[_0xdc61('0x16')](_0x1903eb)[_0xdc61('0x24')](_0x4c4b2d);};}exports[_0xdc61('0x25')]=function(_0x383d05,_0x3d04b8){var _0x34c686={},_0x4df274={},_0x38ccef={'count':0x0,'rows':[]};var _0x114633=_['map'](db[_0xdc61('0x26')][_0xdc61('0x27')],function(_0x4a63c9){return{'name':_0x4a63c9['fieldName'],'type':_0x4a63c9[_0xdc61('0x28')][_0xdc61('0x29')]};});_0x4df274[_0xdc61('0x2a')]=_[_0xdc61('0x2b')](_0x114633,_0xdc61('0x23'));_0x4df274['query']=_[_0xdc61('0x2c')](_0x383d05['query']);_0x4df274[_0xdc61('0x2d')]=_['intersection'](_0x4df274[_0xdc61('0x2a')],_0x4df274[_0xdc61('0x2e')]);_0x34c686[_0xdc61('0x2f')]=_[_0xdc61('0x30')](_0x4df274['model'],qs[_0xdc61('0x31')](_0x383d05[_0xdc61('0x2e')][_0xdc61('0x31')]));_0x34c686[_0xdc61('0x2f')]=_0x34c686[_0xdc61('0x2f')][_0xdc61('0x32')]?_0x34c686[_0xdc61('0x2f')]:_0x4df274['model'];if(!_0x383d05[_0xdc61('0x2e')][_0xdc61('0x33')](_0xdc61('0x34'))){_0x34c686[_0xdc61('0x35')]=qs[_0xdc61('0x35')](_0x383d05[_0xdc61('0x2e')][_0xdc61('0x35')]);_0x34c686['offset']=qs[_0xdc61('0x19')](_0x383d05[_0xdc61('0x2e')][_0xdc61('0x19')]);}_0x34c686[_0xdc61('0x36')]=qs[_0xdc61('0x37')](_0x383d05[_0xdc61('0x2e')][_0xdc61('0x37')]);_0x34c686[_0xdc61('0x38')]=qs[_0xdc61('0x2d')](_['pick'](_0x383d05[_0xdc61('0x2e')],_0x4df274['filters']),_0x114633);if(_0x383d05[_0xdc61('0x2e')][_0xdc61('0x39')]){_0x34c686[_0xdc61('0x38')]=_['merge'](_0x34c686[_0xdc61('0x38')],{'$or':_[_0xdc61('0x2b')](_0x114633,function(_0x1c5d5f){if(_0x1c5d5f[_0xdc61('0x28')]!==_0xdc61('0x3a')){var _0x28e9f3={};_0x28e9f3[_0x1c5d5f['name']]={'$like':'%'+_0x383d05['query'][_0xdc61('0x39')]+'%'};return _0x28e9f3;}})});}_0x34c686=_[_0xdc61('0x3b')]({},_0x34c686,_0x383d05[_0xdc61('0x3c')]);var _0x15669b={'where':_0x34c686['where']};return db['SquareRecording'][_0xdc61('0x1b')](_0x15669b)[_0xdc61('0x20')](function(_0x12855c){_0x38ccef[_0xdc61('0x1b')]=_0x12855c;if(_0x383d05[_0xdc61('0x2e')][_0xdc61('0x3d')]){_0x34c686['include']=[{'all':!![]}];}return db[_0xdc61('0x26')][_0xdc61('0x3e')](_0x34c686);})[_0xdc61('0x20')](function(_0x7d71ac){_0x38ccef[_0xdc61('0x3f')]=_0x7d71ac;return _0x38ccef;})[_0xdc61('0x20')](respondWithFilteredResult(_0x3d04b8,_0x34c686))[_0xdc61('0x40')](handleError(_0x3d04b8,null));};exports['show']=function(_0xebba92,_0x465b5e){var _0x28c5e8={'raw':!![],'where':{'id':_0xebba92[_0xdc61('0x41')]['id']}},_0x74ecad={};_0x74ecad[_0xdc61('0x2a')]=_[_0xdc61('0x2c')](db['SquareRecording'][_0xdc61('0x27')]);_0x74ecad[_0xdc61('0x2e')]=_['keys'](_0xebba92['query']);_0x74ecad[_0xdc61('0x2d')]=_[_0xdc61('0x30')](_0x74ecad[_0xdc61('0x2a')],_0x74ecad[_0xdc61('0x2e')]);_0x28c5e8[_0xdc61('0x2f')]=_[_0xdc61('0x30')](_0x74ecad['model'],qs[_0xdc61('0x31')](_0xebba92[_0xdc61('0x2e')][_0xdc61('0x31')]));_0x28c5e8[_0xdc61('0x2f')]=_0x28c5e8[_0xdc61('0x2f')][_0xdc61('0x32')]?_0x28c5e8['attributes']:_0x74ecad[_0xdc61('0x2a')];if(_0xebba92[_0xdc61('0x2e')][_0xdc61('0x3d')]){_0x28c5e8[_0xdc61('0x42')]=[{'all':!![]}];}_0x28c5e8=_[_0xdc61('0x3b')]({},_0x28c5e8,_0xebba92[_0xdc61('0x3c')]);return db[_0xdc61('0x26')][_0xdc61('0x43')](_0x28c5e8)[_0xdc61('0x20')](handleEntityNotFound(_0x465b5e,null))['then'](respondWithResult(_0x465b5e,null))['catch'](handleError(_0x465b5e,null));};exports[_0xdc61('0x44')]=function(_0x4e5052,_0x305ccd){return db[_0xdc61('0x26')][_0xdc61('0x44')](_0x4e5052[_0xdc61('0x45')],{})['then'](respondWithResult(_0x305ccd,0xc9))['catch'](handleError(_0x305ccd,null));};exports[_0xdc61('0x46')]=function(_0x5b5545,_0x1e8664){if(_0x5b5545[_0xdc61('0x45')]['id']){delete _0x5b5545[_0xdc61('0x45')]['id'];}return db['SquareRecording'][_0xdc61('0x43')]({'where':{'id':_0x5b5545['params']['id']}})['then'](handleEntityNotFound(_0x1e8664,null))[_0xdc61('0x20')](saveUpdates(_0x5b5545[_0xdc61('0x45')],null))[_0xdc61('0x20')](respondWithResult(_0x1e8664,null))[_0xdc61('0x40')](handleError(_0x1e8664,null));};exports[_0xdc61('0x47')]=function(_0x38e786,_0x3a5df3,_0x526061){var _0x30d33f=require('../../components/encryptor');var _0x3e7bd8=![];var _0x3627f3={};if(_0x38e786['query']['type']&&_0x38e786[_0xdc61('0x2e')]['type']===_0xdc61('0x48')){_0x3627f3[_0xdc61('0x48')]=_0x38e786[_0xdc61('0x41')]['id'];}else{_0x3627f3['id']=_0x38e786[_0xdc61('0x41')]['id'];}return db[_0xdc61('0x26')]['find']({'where':_0x3627f3,'attributes':['id',_0xdc61('0x49'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x3a5df3,null))[_0xdc61('0x20')](function(_0x3c8996){if(_0x3c8996){var _0xdd777a=_0x3c8996['savePath'];var _0x203d47=util[_0xdc61('0x4a')]('%s.cypher',_0xdd777a);if(fs['existsSync'](_0x203d47)){_0x3e7bd8=!![];return _0x30d33f[_0xdc61('0x4b')](_0x203d47,_0xdd777a,config['secrets'][_0xdc61('0x4c')])[_0xdc61('0x20')](function(){return _0x3c8996;});}return _0x3c8996;}})['then'](function(_0xb6c761){if(_0xb6c761){var _0x26deed=_0xb6c761[_0xdc61('0x49')];if(!fs['existsSync'](_0x26deed)){throw new db[(_0xdc61('0x4d'))][(_0xdc61('0x4e'))](_0xdc61('0x4f'));}if(_0xb6c761['filename']){return _0x3a5df3['download'](_0x26deed,_0xb6c761['filename']+path[_0xdc61('0x50')](_0x26deed),function(){if(_0x3e7bd8){fs[_0xdc61('0x51')](_0x26deed);}});}else{return _0x3a5df3[_0xdc61('0x47')](_0x26deed,function(_0x3db75d){if(_0x3e7bd8){fs['unlink'](_0x26deed);}});}}})[_0xdc61('0x40')](function(_0x1972c6){if(_0x1972c6[_0xdc61('0x52')]==='SquareRecording\x20not\x20found'){_0x3a5df3[_0xdc61('0x16')](0x194)[_0xdc61('0x24')]('Not\x20found');}else{return handleError(_0x3a5df3,null);}});};exports[_0xdc61('0x53')]=function(_0x20092b,_0xf83263){return db[_0xdc61('0x26')]['find']({'where':{'id':_0x20092b[_0xdc61('0x41')]['id']}})[_0xdc61('0x20')](function(_0x10428b){if(_[_0xdc61('0x54')](_0x10428b)){throw new ReferenceError(_0xdc61('0x55'));}return _0x10428b;})['then'](function(_0x1fd9fe){var _0x2061bb=_0x1fd9fe[_0xdc61('0x49')];logger[_0xdc61('0x56')](_0xdc61('0x57'),_0x2061bb);if(!_[_0xdc61('0x54')](_0x1fd9fe['savePath'])&&fs[_0xdc61('0x58')](_0x2061bb)){logger[_0xdc61('0x56')]('File:\x20\x22'+_0x2061bb+_0xdc61('0x59'));fs['unlinkSync'](_0x2061bb);}_0x2061bb=_0x2061bb+'.cypher';if(!_[_0xdc61('0x54')](_0x1fd9fe[_0xdc61('0x49')])&&fs['existsSync'](_0x2061bb)){logger['info'](_0xdc61('0x5a')+_0x2061bb+_0xdc61('0x59'));fs[_0xdc61('0x5b')](_0x2061bb);}return _0x1fd9fe;})[_0xdc61('0x20')](function(_0x1d9c19){if(!_0x1d9c19)throw new InternalError();return _0x1d9c19[_0xdc61('0x53')]();})[_0xdc61('0x20')](function(){_0xf83263[_0xdc61('0x16')](0xcc)[_0xdc61('0x17')]();})['catch'](handleError(_0xf83263,null));};
\ No newline at end of file
+var _0x8131=['length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','send','index','map','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8131,0xe5));var _0x1813=function(_0x5d198a,_0x4fc0e8){_0x5d198a=_0x5d198a-0x0;var _0xba47e3=_0x8131[_0x5d198a];return _0xba47e3;};'use strict';var emlformat=require(_0x1813('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1813('0x1'));var jsonpatch=require(_0x1813('0x2'));var rp=require(_0x1813('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1813('0x4'));var path=require(_0x1813('0x5'));var sox=require(_0x1813('0x6'));var csv=require(_0x1813('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1813('0x8'));var _=require('lodash');var squel=require(_0x1813('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1813('0xa'));var toCsv=require(_0x1813('0x7'));var querystring=require(_0x1813('0xb'));var Papa=require(_0x1813('0xc'));var Redis=require(_0x1813('0xd'));var authService=require(_0x1813('0xe'));var qs=require(_0x1813('0xf'));var as=require(_0x1813('0x10'));var hardwareService=require(_0x1813('0x11'));var logger=require(_0x1813('0x12'))('api');var utils=require(_0x1813('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1813('0x14'))['db'];function respondWithStatusCode(_0x1b357e,_0x4af240){_0x4af240=_0x4af240||0xcc;return function(_0x572b81){if(_0x572b81){return _0x1b357e[_0x1813('0x15')](_0x4af240);}return _0x1b357e[_0x1813('0x16')](_0x4af240)[_0x1813('0x17')]();};}function respondWithResult(_0x920a9b,_0x26d0d9){_0x26d0d9=_0x26d0d9||0xc8;return function(_0xb484f9){if(_0xb484f9){return _0x920a9b['status'](_0x26d0d9)[_0x1813('0x18')](_0xb484f9);}};}function respondWithFilteredResult(_0x3caf8f,_0x3b80ed){return function(_0x56291f){if(_0x56291f){var _0x39669f=typeof _0x3b80ed[_0x1813('0x19')]==='undefined'&&typeof _0x3b80ed['limit']===_0x1813('0x1a');var _0x219828=_0x56291f[_0x1813('0x1b')];var _0x22502b=_0x39669f?0x0:_0x3b80ed[_0x1813('0x19')];var _0x5e5911=_0x39669f?_0x56291f[_0x1813('0x1b')]:_0x3b80ed[_0x1813('0x19')]+_0x3b80ed[_0x1813('0x1c')];var _0x4d5b6f;if(_0x5e5911>=_0x219828){_0x5e5911=_0x219828;_0x4d5b6f=0xc8;}else{_0x4d5b6f=0xce;}_0x3caf8f[_0x1813('0x16')](_0x4d5b6f);return _0x3caf8f[_0x1813('0x1d')](_0x1813('0x1e'),_0x22502b+'-'+_0x5e5911+'/'+_0x219828)['json'](_0x56291f);}return null;};}function patchUpdates(_0x5dbdcd){return function(_0x28d34c){try{jsonpatch['apply'](_0x28d34c,_0x5dbdcd,!![]);}catch(_0x4fbd88){return BPromise[_0x1813('0x1f')](_0x4fbd88);}return _0x28d34c[_0x1813('0x20')]();};}function saveUpdates(_0x4d137b,_0x373763){return function(_0x22a3c8){if(_0x22a3c8){return _0x22a3c8[_0x1813('0x21')](_0x4d137b)['then'](function(_0x12d302){return _0x12d302;});}return null;};}function removeEntity(_0x456447,_0x1471cc){return function(_0x5ca8d4){if(_0x5ca8d4){return _0x5ca8d4['destroy']()[_0x1813('0x22')](function(){_0x456447['status'](0xcc)[_0x1813('0x17')]();});}};}function handleEntityNotFound(_0x540f02,_0x194d53){return function(_0x532078){if(!_0x532078){_0x540f02[_0x1813('0x15')](0x194);}return _0x532078;};}function handleError(_0x24e377,_0x53968f){_0x53968f=_0x53968f||0x1f4;return function(_0x586469){logger[_0x1813('0x23')](_0x586469[_0x1813('0x24')]);if(_0x586469['name']){delete _0x586469['name'];}_0x24e377[_0x1813('0x16')](_0x53968f)[_0x1813('0x25')](_0x586469);};}exports[_0x1813('0x26')]=function(_0x571083,_0x5076fc){var _0x38b85c={},_0x316eb6={},_0x26ff37={'count':0x0,'rows':[]};var _0x4f8c59=_[_0x1813('0x27')](db['SquareRecording']['rawAttributes'],function(_0x270b28){return{'name':_0x270b28[_0x1813('0x28')],'type':_0x270b28['type'][_0x1813('0x29')]};});_0x316eb6[_0x1813('0x2a')]=_['map'](_0x4f8c59,_0x1813('0x2b'));_0x316eb6[_0x1813('0x2c')]=_[_0x1813('0x2d')](_0x571083[_0x1813('0x2c')]);_0x316eb6[_0x1813('0x2e')]=_[_0x1813('0x2f')](_0x316eb6[_0x1813('0x2a')],_0x316eb6[_0x1813('0x2c')]);_0x38b85c[_0x1813('0x30')]=_[_0x1813('0x2f')](_0x316eb6[_0x1813('0x2a')],qs[_0x1813('0x31')](_0x571083[_0x1813('0x2c')][_0x1813('0x31')]));_0x38b85c['attributes']=_0x38b85c['attributes'][_0x1813('0x32')]?_0x38b85c[_0x1813('0x30')]:_0x316eb6[_0x1813('0x2a')];if(!_0x571083['query']['hasOwnProperty']('nolimit')){_0x38b85c[_0x1813('0x1c')]=qs['limit'](_0x571083[_0x1813('0x2c')][_0x1813('0x1c')]);_0x38b85c['offset']=qs[_0x1813('0x19')](_0x571083[_0x1813('0x2c')][_0x1813('0x19')]);}_0x38b85c[_0x1813('0x33')]=qs[_0x1813('0x34')](_0x571083[_0x1813('0x2c')][_0x1813('0x34')]);_0x38b85c[_0x1813('0x35')]=qs['filters'](_[_0x1813('0x36')](_0x571083['query'],_0x316eb6[_0x1813('0x2e')]),_0x4f8c59);if(_0x571083[_0x1813('0x2c')]['filter']){_0x38b85c[_0x1813('0x35')]=_[_0x1813('0x37')](_0x38b85c[_0x1813('0x35')],{'$or':_[_0x1813('0x27')](_0x4f8c59,function(_0x5e2bc1){if(_0x5e2bc1[_0x1813('0x38')]!==_0x1813('0x39')){var _0x56b1f0={};_0x56b1f0[_0x5e2bc1['name']]={'$like':'%'+_0x571083['query'][_0x1813('0x3a')]+'%'};return _0x56b1f0;}})});}_0x38b85c=_['merge']({},_0x38b85c,_0x571083[_0x1813('0x3b')]);var _0x4db07d={'where':_0x38b85c['where']};return db[_0x1813('0x3c')][_0x1813('0x1b')](_0x4db07d)[_0x1813('0x22')](function(_0xed1fcf){_0x26ff37[_0x1813('0x1b')]=_0xed1fcf;if(_0x571083[_0x1813('0x2c')][_0x1813('0x3d')]){_0x38b85c[_0x1813('0x3e')]=[{'all':!![]}];}return db[_0x1813('0x3c')][_0x1813('0x3f')](_0x38b85c);})[_0x1813('0x22')](function(_0x4a6702){_0x26ff37[_0x1813('0x40')]=_0x4a6702;return _0x26ff37;})[_0x1813('0x22')](respondWithFilteredResult(_0x5076fc,_0x38b85c))[_0x1813('0x41')](handleError(_0x5076fc,null));};exports[_0x1813('0x42')]=function(_0x5653bf,_0x2b1242){var _0x1f8bc5={'raw':!![],'where':{'id':_0x5653bf[_0x1813('0x43')]['id']}},_0x1b7c80={};_0x1b7c80[_0x1813('0x2a')]=_['keys'](db['SquareRecording']['rawAttributes']);_0x1b7c80['query']=_[_0x1813('0x2d')](_0x5653bf[_0x1813('0x2c')]);_0x1b7c80['filters']=_[_0x1813('0x2f')](_0x1b7c80[_0x1813('0x2a')],_0x1b7c80[_0x1813('0x2c')]);_0x1f8bc5[_0x1813('0x30')]=_['intersection'](_0x1b7c80[_0x1813('0x2a')],qs[_0x1813('0x31')](_0x5653bf[_0x1813('0x2c')][_0x1813('0x31')]));_0x1f8bc5['attributes']=_0x1f8bc5['attributes'][_0x1813('0x32')]?_0x1f8bc5[_0x1813('0x30')]:_0x1b7c80[_0x1813('0x2a')];if(_0x5653bf[_0x1813('0x2c')][_0x1813('0x3d')]){_0x1f8bc5[_0x1813('0x3e')]=[{'all':!![]}];}_0x1f8bc5=_[_0x1813('0x37')]({},_0x1f8bc5,_0x5653bf[_0x1813('0x3b')]);return db[_0x1813('0x3c')][_0x1813('0x44')](_0x1f8bc5)[_0x1813('0x22')](handleEntityNotFound(_0x2b1242,null))[_0x1813('0x22')](respondWithResult(_0x2b1242,null))[_0x1813('0x41')](handleError(_0x2b1242,null));};exports['create']=function(_0x519d22,_0x4359c9){return db[_0x1813('0x3c')][_0x1813('0x45')](_0x519d22['body'],{})[_0x1813('0x22')](respondWithResult(_0x4359c9,0xc9))[_0x1813('0x41')](handleError(_0x4359c9,null));};exports['update']=function(_0x588d02,_0x970fbb){if(_0x588d02[_0x1813('0x46')]['id']){delete _0x588d02[_0x1813('0x46')]['id'];}return db[_0x1813('0x3c')][_0x1813('0x44')]({'where':{'id':_0x588d02[_0x1813('0x43')]['id']}})[_0x1813('0x22')](handleEntityNotFound(_0x970fbb,null))[_0x1813('0x22')](saveUpdates(_0x588d02['body'],null))[_0x1813('0x22')](respondWithResult(_0x970fbb,null))[_0x1813('0x41')](handleError(_0x970fbb,null));};exports[_0x1813('0x47')]=function(_0x5676b4,_0x160557,_0x5dea9d){var _0x3180b3=require(_0x1813('0x48'));var _0x5b770d=![];var _0x459177={};if(_0x5676b4['query']['type']&&_0x5676b4[_0x1813('0x2c')][_0x1813('0x38')]===_0x1813('0x49')){_0x459177['uniqueid']=_0x5676b4[_0x1813('0x43')]['id'];}else{_0x459177['id']=_0x5676b4['params']['id'];}return db[_0x1813('0x3c')][_0x1813('0x44')]({'where':_0x459177,'attributes':['id',_0x1813('0x4a'),_0x1813('0x4b')],'raw':!![]})[_0x1813('0x22')](handleEntityNotFound(_0x160557,null))['then'](function(_0x1be838){if(_0x1be838){var _0x544d03=_0x1be838[_0x1813('0x4a')];var _0x2fedc6=util[_0x1813('0x4c')]('%s.cypher',_0x544d03);if(fs[_0x1813('0x4d')](_0x2fedc6)){_0x5b770d=!![];return _0x3180b3['decryptFile'](_0x2fedc6,_0x544d03,config[_0x1813('0x4e')][_0x1813('0x4f')])[_0x1813('0x22')](function(){return _0x1be838;});}return _0x1be838;}})[_0x1813('0x22')](function(_0x49ea39){if(_0x49ea39){var _0xadad56=_0x49ea39[_0x1813('0x4a')];if(!fs[_0x1813('0x4d')](_0xadad56)){throw new db[(_0x1813('0x50'))]['ValidationError'](_0x1813('0x51'));}if(_0x49ea39[_0x1813('0x4b')]){return _0x160557[_0x1813('0x47')](_0xadad56,_0x49ea39[_0x1813('0x4b')]+path[_0x1813('0x52')](_0xadad56),function(){if(_0x5b770d){fs[_0x1813('0x53')](_0xadad56);}});}else{return _0x160557[_0x1813('0x47')](_0xadad56,function(_0xf594ac){if(_0x5b770d){fs[_0x1813('0x53')](_0xadad56);}});}}})[_0x1813('0x41')](function(_0x1ccd60){if(_0x1ccd60[_0x1813('0x54')]==='SquareRecording\x20not\x20found'){_0x160557[_0x1813('0x16')](0x194)[_0x1813('0x25')]('Not\x20found');}else{return handleError(_0x160557,null);}});};exports[_0x1813('0x55')]=function(_0x539988,_0x2c41c1){return db[_0x1813('0x3c')]['find']({'where':{'id':_0x539988[_0x1813('0x43')]['id']}})[_0x1813('0x22')](function(_0x52e20f){if(_[_0x1813('0x56')](_0x52e20f)){throw new ReferenceError(_0x1813('0x57'));}return _0x52e20f;})[_0x1813('0x22')](function(_0x52a7ee){var _0x5081d8=_0x52a7ee[_0x1813('0x4a')];logger[_0x1813('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x5081d8);if(!_[_0x1813('0x56')](_0x52a7ee[_0x1813('0x4a')])&&fs[_0x1813('0x4d')](_0x5081d8)){logger['info'](_0x1813('0x59')+_0x5081d8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1813('0x5a')](_0x5081d8);}_0x5081d8=_0x5081d8+_0x1813('0x5b');if(!_[_0x1813('0x56')](_0x52a7ee[_0x1813('0x4a')])&&fs[_0x1813('0x4d')](_0x5081d8)){logger[_0x1813('0x58')](_0x1813('0x59')+_0x5081d8+_0x1813('0x5c'));fs[_0x1813('0x5a')](_0x5081d8);}return _0x52a7ee;})[_0x1813('0x22')](function(_0x2fd9d2){if(!_0x2fd9d2)throw new InternalError();return _0x2fd9d2['destroy']();})[_0x1813('0x22')](function(){_0x2c41c1[_0x1813('0x16')](0xcc)['end']();})[_0x1813('0x41')](handleError(_0x2c41c1,null));};
\ No newline at end of file
index 7710573..01c32fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc7a=['request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','moment','bluebird'];(function(_0x30e083,_0x7f4e){var _0x33b187=function(_0x1ed75f){while(--_0x1ed75f){_0x30e083['push'](_0x30e083['shift']());}};_0x33b187(++_0x7f4e);}(_0xbc7a,0xa4));var _0xabc7=function(_0x1bfb5a,_0x414948){_0x1bfb5a=_0x1bfb5a-0x0;var _0x53029e=_0xbc7a[_0x1bfb5a];return _0x53029e;};'use strict';var _=require(_0xabc7('0x0'));var util=require(_0xabc7('0x1'));var logger=require(_0xabc7('0x2'))('api');var moment=require(_0xabc7('0x3'));var BPromise=require(_0xabc7('0x4'));var rp=require(_0xabc7('0x5'));var fs=require('fs');var path=require(_0xabc7('0x6'));var rimraf=require(_0xabc7('0x7'));var config=require(_0xabc7('0x8'));var attributes=require('./squareRecording.attributes');module[_0xabc7('0x9')]=function(_0xc4f32a,_0x3a5248){return _0xc4f32a[_0xabc7('0xa')](_0xabc7('0xb'),attributes,{'tableName':_0xabc7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a05=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareRecording.attributes','square_recordings','lodash','util'];(function(_0x4caef8,_0x31fe01){var _0x305585=function(_0x4c27e5){while(--_0x4c27e5){_0x4caef8['push'](_0x4caef8['shift']());}};_0x305585(++_0x31fe01);}(_0x0a05,0x9e));var _0x50a0=function(_0x263204,_0x19286b){_0x263204=_0x263204-0x0;var _0xed3987=_0x0a05[_0x263204];return _0xed3987;};'use strict';var _=require(_0x50a0('0x0'));var util=require(_0x50a0('0x1'));var logger=require(_0x50a0('0x2'))(_0x50a0('0x3'));var moment=require(_0x50a0('0x4'));var BPromise=require(_0x50a0('0x5'));var rp=require(_0x50a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50a0('0x7'));var config=require('../../config/environment');var attributes=require(_0x50a0('0x8'));module['exports']=function(_0x3546f9,_0x41a18d){return _0x3546f9['define']('SquareRecording',attributes,{'tableName':_0x50a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1774058..76de5f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ca1=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','create','body','options','lodash'];(function(_0x5d4818,_0x45099d){var _0x370e72=function(_0x311779){while(--_0x311779){_0x5d4818['push'](_0x5d4818['shift']());}};_0x370e72(++_0x45099d);}(_0x3ca1,0xd7));var _0x13ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x13ca('0x0'));var util=require(_0x13ca('0x1'));var moment=require('moment');var BPromise=require(_0x13ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13ca('0x3'));var db=require(_0x13ca('0x4'))['db'];var utils=require(_0x13ca('0x5'));var logger=require(_0x13ca('0x6'))('rpc');var config=require(_0x13ca('0x7'));var jayson=require(_0x13ca('0x8'));var client=jayson[_0x13ca('0x9')][_0x13ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x88b675,_0x49e1d5,_0x5bca3e){return new BPromise(function(_0x69685e,_0x2a905e){return client[_0x13ca('0xb')](_0x88b675,_0x5bca3e)[_0x13ca('0xc')](function(_0x53602f){logger[_0x13ca('0xd')](_0x13ca('0xe'),_0x49e1d5,_0x13ca('0xf'));logger[_0x13ca('0x10')](_0x13ca('0x11'),_0x49e1d5,_0x13ca('0xf'),JSON[_0x13ca('0x12')](_0x53602f));if(_0x53602f[_0x13ca('0x13')]){if(_0x53602f['error'][_0x13ca('0x14')]===0x1f4){logger[_0x13ca('0x13')]('SquareRecording,\x20%s,\x20%s',_0x49e1d5,_0x53602f[_0x13ca('0x13')]['message']);return _0x2a905e(_0x53602f[_0x13ca('0x13')][_0x13ca('0x15')]);}logger[_0x13ca('0x13')]('SquareRecording,\x20%s,\x20%s',_0x49e1d5,_0x53602f[_0x13ca('0x13')][_0x13ca('0x15')]);return _0x69685e(_0x53602f[_0x13ca('0x13')][_0x13ca('0x15')]);}else{logger[_0x13ca('0xd')]('SquareRecording,\x20%s,\x20%s',_0x49e1d5,_0x13ca('0xf'));_0x69685e(_0x53602f[_0x13ca('0x16')][_0x13ca('0x15')]);}})['catch'](function(_0x1fee9c){logger[_0x13ca('0x13')]('SquareRecording,\x20%s,\x20%s',_0x49e1d5,_0x1fee9c);_0x2a905e(_0x1fee9c);});});}exports[_0x13ca('0x17')]=function(_0x4685c9){var _0x3eb008=this;return new Promise(function(_0x2ed758,_0xff7fea){return db['SquareRecording'][_0x13ca('0x18')](_0x4685c9[_0x13ca('0x19')],{'raw':_0x4685c9[_0x13ca('0x1a')]?_0x4685c9['options']['raw']===undefined?!![]:![]:!![]})[_0x13ca('0xc')](function(_0x56744b){logger[_0x13ca('0xd')](_0x13ca('0x17'),_0x4685c9);logger[_0x13ca('0x10')](_0x13ca('0x17'),_0x4685c9,JSON[_0x13ca('0x12')](_0x56744b));_0x2ed758(_0x56744b);})['catch'](function(_0x265c3c){logger[_0x13ca('0x13')](_0x13ca('0x17'),_0x265c3c[_0x13ca('0x15')],_0x4685c9);_0xff7fea(_0x3eb008[_0x13ca('0x13')](0x1f4,_0x265c3c[_0x13ca('0x15')]));});});};
\ No newline at end of file
+var _0x32f9=['stringify','error','code','message','catch','CreateSquareRecording','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0xc1078,_0x87768b){var _0x1eb9bd=function(_0x5c35f9){while(--_0x5c35f9){_0xc1078['push'](_0xc1078['shift']());}};_0x1eb9bd(++_0x87768b);}(_0x32f9,0x118));var _0x932f=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x32f9[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0x932f('0x0'));var util=require('util');var moment=require(_0x932f('0x1'));var BPromise=require(_0x932f('0x2'));var rs=require(_0x932f('0x3'));var fs=require('fs');var Redis=require(_0x932f('0x4'));var db=require(_0x932f('0x5'))['db'];var utils=require(_0x932f('0x6'));var logger=require(_0x932f('0x7'))(_0x932f('0x8'));var config=require(_0x932f('0x9'));var jayson=require(_0x932f('0xa'));var client=jayson[_0x932f('0xb')][_0x932f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x597c48,_0x3e5ba5,_0x9f4cfe){return new BPromise(function(_0x916d49,_0x50080b){return client[_0x932f('0xd')](_0x597c48,_0x9f4cfe)[_0x932f('0xe')](function(_0x3ebd11){logger[_0x932f('0xf')](_0x932f('0x10'),_0x3e5ba5,_0x932f('0x11'));logger[_0x932f('0x12')](_0x932f('0x13'),_0x3e5ba5,_0x932f('0x11'),JSON[_0x932f('0x14')](_0x3ebd11));if(_0x3ebd11[_0x932f('0x15')]){if(_0x3ebd11[_0x932f('0x15')][_0x932f('0x16')]===0x1f4){logger[_0x932f('0x15')](_0x932f('0x10'),_0x3e5ba5,_0x3ebd11[_0x932f('0x15')][_0x932f('0x17')]);return _0x50080b(_0x3ebd11['error'][_0x932f('0x17')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x3e5ba5,_0x3ebd11[_0x932f('0x15')][_0x932f('0x17')]);return _0x916d49(_0x3ebd11[_0x932f('0x15')][_0x932f('0x17')]);}else{logger[_0x932f('0xf')](_0x932f('0x10'),_0x3e5ba5,'request\x20sent');_0x916d49(_0x3ebd11['result'][_0x932f('0x17')]);}})[_0x932f('0x18')](function(_0x5401dd){logger[_0x932f('0x15')](_0x932f('0x10'),_0x3e5ba5,_0x5401dd);_0x50080b(_0x5401dd);});});}exports[_0x932f('0x19')]=function(_0x3b5491){var _0x3e6a00=this;return new Promise(function(_0x55e2e8,_0x4517a3){return db['SquareRecording'][_0x932f('0x1a')](_0x3b5491[_0x932f('0x1b')],{'raw':_0x3b5491[_0x932f('0x1c')]?_0x3b5491[_0x932f('0x1c')][_0x932f('0x1d')]===undefined?!![]:![]:!![]})[_0x932f('0xe')](function(_0x5f24ad){logger[_0x932f('0xf')](_0x932f('0x19'),_0x3b5491);logger[_0x932f('0x12')](_0x932f('0x19'),_0x3b5491,JSON[_0x932f('0x14')](_0x5f24ad));_0x55e2e8(_0x5f24ad);})[_0x932f('0x18')](function(_0xb904ad){logger[_0x932f('0x15')]('CreateSquareRecording',_0xb904ad['message'],_0x3b5491);_0x4517a3(_0x3e6a00[_0x932f('0x15')](0x1f4,_0xb904ad[_0x932f('0x17')]));});});};
\ No newline at end of file
index 0063cf6..de8daf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x18fdaf,_0x457de2){var _0x557a9b=function(_0x4a6b5a){while(--_0x4a6b5a){_0x18fdaf['push'](_0x18fdaf['shift']());}};_0x557a9b(++_0x457de2);}(_0xe706,0xa3));var _0x6e70=function(_0x2bf76a,_0xb01832){_0x2bf76a=_0x2bf76a-0x0;var _0x1ec759=_0xe706[_0x2bf76a];return _0x1ec759;};'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
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_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')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 5d02a04..516b733 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a6f=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x520d1f,_0x1f8546){var _0x50bc9f=function(_0x2f6d29){while(--_0x2f6d29){_0x520d1f['push'](_0x520d1f['shift']());}};_0x50bc9f(++_0x1f8546);}(_0x3a6f,0x1a2));var _0xf3a6=function(_0x5018a8,_0x3e89f5){_0x5018a8=_0x5018a8-0x0;var _0x4db2aa=_0x3a6f[_0x5018a8];return _0x4db2aa;};'use strict';var Sequelize=require(_0xf3a6('0x0'));module[_0xf3a6('0x1')]={'network':{'type':Sequelize[_0xf3a6('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf3a6('0x2')]},'uniqueid':{'type':Sequelize[_0xf3a6('0x2')]},'version':{'type':Sequelize[_0xf3a6('0x2')]},'callerid':{'type':Sequelize[_0xf3a6('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xf3a6('0x2')]},'callingani2':{'type':Sequelize[_0xf3a6('0x2')]},'callington':{'type':Sequelize[_0xf3a6('0x2')]},'callingtns':{'type':Sequelize[_0xf3a6('0x2')]},'dnid':{'type':Sequelize[_0xf3a6('0x2')]},'rdnis':{'type':Sequelize[_0xf3a6('0x2')]},'context':{'type':Sequelize[_0xf3a6('0x2')]},'extension':{'type':Sequelize[_0xf3a6('0x2')]},'priority':{'type':Sequelize[_0xf3a6('0x2')]},'enhanced':{'type':Sequelize[_0xf3a6('0x2')]},'accountcode':{'type':Sequelize[_0xf3a6('0x2')]},'threadid':{'type':Sequelize[_0xf3a6('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf3a6('0x3')]},'leaveAt':{'type':Sequelize[_0xf3a6('0x3')]},'bot':{'type':Sequelize[_0xf3a6('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7640=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x397b4a,_0x34e886){var _0x2576d5=function(_0x55c256){while(--_0x55c256){_0x397b4a['push'](_0x397b4a['shift']());}};_0x2576d5(++_0x34e886);}(_0x7640,0xdc));var _0x0764=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x7640[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require(_0x0764('0x0'));module[_0x0764('0x1')]={'network':{'type':Sequelize[_0x0764('0x2')]},'network_script':{'type':Sequelize[_0x0764('0x2')]},'request':{'type':Sequelize[_0x0764('0x2')]},'channel':{'type':Sequelize[_0x0764('0x2')]},'language':{'type':Sequelize[_0x0764('0x2')]},'type':{'type':Sequelize[_0x0764('0x2')]},'uniqueid':{'type':Sequelize[_0x0764('0x2')]},'version':{'type':Sequelize[_0x0764('0x2')]},'callerid':{'type':Sequelize[_0x0764('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x0764('0x2')]},'callingani2':{'type':Sequelize[_0x0764('0x2')]},'callington':{'type':Sequelize[_0x0764('0x2')]},'callingtns':{'type':Sequelize[_0x0764('0x2')]},'dnid':{'type':Sequelize[_0x0764('0x2')]},'rdnis':{'type':Sequelize[_0x0764('0x2')]},'context':{'type':Sequelize[_0x0764('0x2')]},'extension':{'type':Sequelize[_0x0764('0x2')]},'priority':{'type':Sequelize[_0x0764('0x2')]},'enhanced':{'type':Sequelize[_0x0764('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x0764('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0764('0x3')]},'leaveAt':{'type':Sequelize[_0x0764('0x3')]},'bot':{'type':Sequelize[_0x0764('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 9a26ff1..d34d918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bf3=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','SquareReport','rawAttributes','fieldName','map','query','keys','filters','model','intersection','fields','attributes','length','nolimit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x126934,_0x91db42){var _0x4273cc=function(_0x3f3cfe){while(--_0x3f3cfe){_0x126934['push'](_0x126934['shift']());}};_0x4273cc(++_0x91db42);}(_0x6bf3,0xc5));var _0x36bf=function(_0xf009a,_0x1ec056){_0xf009a=_0xf009a-0x0;var _0x241b7b=_0x6bf3[_0xf009a];return _0x241b7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36bf('0x0'));var zipdir=require(_0x36bf('0x1'));var jsonpatch=require(_0x36bf('0x2'));var rp=require('request-promise');var moment=require(_0x36bf('0x3'));var BPromise=require(_0x36bf('0x4'));var Mustache=require(_0x36bf('0x5'));var util=require('util');var path=require(_0x36bf('0x6'));var sox=require(_0x36bf('0x7'));var csv=require(_0x36bf('0x8'));var ejs=require(_0x36bf('0x9'));var fs=require('fs');var fs_extra=require(_0x36bf('0xa'));var _=require(_0x36bf('0xb'));var squel=require(_0x36bf('0xc'));var crypto=require(_0x36bf('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x36bf('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x36bf('0xe'));var as=require(_0x36bf('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36bf('0x10'))(_0x36bf('0x11'));var utils=require(_0x36bf('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x36bf('0x13'));var db=require(_0x36bf('0x14'))['db'];function respondWithStatusCode(_0x2e182b,_0x5730bb){_0x5730bb=_0x5730bb||0xcc;return function(_0xa77a51){if(_0xa77a51){return _0x2e182b[_0x36bf('0x15')](_0x5730bb);}return _0x2e182b[_0x36bf('0x16')](_0x5730bb)['end']();};}function respondWithResult(_0x405fb4,_0x44deb0){_0x44deb0=_0x44deb0||0xc8;return function(_0x2e9f05){if(_0x2e9f05){return _0x405fb4[_0x36bf('0x16')](_0x44deb0)[_0x36bf('0x17')](_0x2e9f05);}};}function respondWithFilteredResult(_0x38aaa5,_0x3a064b){return function(_0x82de5a){if(_0x82de5a){var _0x2e5c5b=typeof _0x3a064b[_0x36bf('0x18')]===_0x36bf('0x19')&&typeof _0x3a064b[_0x36bf('0x1a')]===_0x36bf('0x19');var _0xfdc0ce=_0x82de5a[_0x36bf('0x1b')];var _0x466606=_0x2e5c5b?0x0:_0x3a064b[_0x36bf('0x18')];var _0x31f9a5=_0x2e5c5b?_0x82de5a[_0x36bf('0x1b')]:_0x3a064b[_0x36bf('0x18')]+_0x3a064b[_0x36bf('0x1a')];var _0x1806f7;if(_0x31f9a5>=_0xfdc0ce){_0x31f9a5=_0xfdc0ce;_0x1806f7=0xc8;}else{_0x1806f7=0xce;}_0x38aaa5[_0x36bf('0x16')](_0x1806f7);return _0x38aaa5[_0x36bf('0x1c')](_0x36bf('0x1d'),_0x466606+'-'+_0x31f9a5+'/'+_0xfdc0ce)[_0x36bf('0x17')](_0x82de5a);}return null;};}function patchUpdates(_0x26c5bb){return function(_0x4ee4f7){try{jsonpatch[_0x36bf('0x1e')](_0x4ee4f7,_0x26c5bb,!![]);}catch(_0x2fb88f){return BPromise[_0x36bf('0x1f')](_0x2fb88f);}return _0x4ee4f7[_0x36bf('0x20')]();};}function saveUpdates(_0x48626e,_0x47e272){return function(_0x5f1c32){if(_0x5f1c32){return _0x5f1c32[_0x36bf('0x21')](_0x48626e)[_0x36bf('0x22')](function(_0xd39e60){return _0xd39e60;});}return null;};}function removeEntity(_0x2132b2,_0x5edd7f){return function(_0x116a0a){if(_0x116a0a){return _0x116a0a['destroy']()['then'](function(){_0x2132b2[_0x36bf('0x16')](0xcc)[_0x36bf('0x23')]();});}};}function handleEntityNotFound(_0x1b481d,_0x548e58){return function(_0x3b9599){if(!_0x3b9599){_0x1b481d[_0x36bf('0x15')](0x194);}return _0x3b9599;};}function handleError(_0x3de4c6,_0x1af377){_0x1af377=_0x1af377||0x1f4;return function(_0x38d056){logger['error'](_0x38d056[_0x36bf('0x24')]);if(_0x38d056[_0x36bf('0x25')]){delete _0x38d056[_0x36bf('0x25')];}_0x3de4c6[_0x36bf('0x16')](_0x1af377)[_0x36bf('0x26')](_0x38d056);};}exports[_0x36bf('0x27')]=function(_0x1fea06,_0x36d0a9){var _0x5a2e13={},_0x4c58d7={},_0x417010={'count':0x0,'rows':[]};var _0xe28b5c=_['map'](db[_0x36bf('0x28')][_0x36bf('0x29')],function(_0x27cf4b){return{'name':_0x27cf4b[_0x36bf('0x2a')],'type':_0x27cf4b['type']['key']};});_0x4c58d7['model']=_[_0x36bf('0x2b')](_0xe28b5c,_0x36bf('0x25'));_0x4c58d7[_0x36bf('0x2c')]=_[_0x36bf('0x2d')](_0x1fea06[_0x36bf('0x2c')]);_0x4c58d7[_0x36bf('0x2e')]=_['intersection'](_0x4c58d7[_0x36bf('0x2f')],_0x4c58d7[_0x36bf('0x2c')]);_0x5a2e13['attributes']=_[_0x36bf('0x30')](_0x4c58d7[_0x36bf('0x2f')],qs['fields'](_0x1fea06['query'][_0x36bf('0x31')]));_0x5a2e13['attributes']=_0x5a2e13[_0x36bf('0x32')][_0x36bf('0x33')]?_0x5a2e13[_0x36bf('0x32')]:_0x4c58d7['model'];if(!_0x1fea06[_0x36bf('0x2c')]['hasOwnProperty'](_0x36bf('0x34'))){_0x5a2e13['limit']=qs[_0x36bf('0x1a')](_0x1fea06['query'][_0x36bf('0x1a')]);_0x5a2e13['offset']=qs[_0x36bf('0x18')](_0x1fea06[_0x36bf('0x2c')][_0x36bf('0x18')]);}_0x5a2e13['order']=qs['sort'](_0x1fea06['query']['sort']);_0x5a2e13[_0x36bf('0x35')]=qs[_0x36bf('0x2e')](_[_0x36bf('0x36')](_0x1fea06[_0x36bf('0x2c')],_0x4c58d7['filters']),_0xe28b5c);if(_0x1fea06['query'][_0x36bf('0x37')]){_0x5a2e13[_0x36bf('0x35')]=_[_0x36bf('0x38')](_0x5a2e13[_0x36bf('0x35')],{'$or':_['map'](_0xe28b5c,function(_0x594bdb){if(_0x594bdb[_0x36bf('0x39')]!==_0x36bf('0x3a')){var _0x32aa94={};_0x32aa94[_0x594bdb[_0x36bf('0x25')]]={'$like':'%'+_0x1fea06['query'][_0x36bf('0x37')]+'%'};return _0x32aa94;}})});}_0x5a2e13=_[_0x36bf('0x38')]({},_0x5a2e13,_0x1fea06[_0x36bf('0x3b')]);var _0x5bafeb={'where':_0x5a2e13[_0x36bf('0x35')]};return db['SquareReport'][_0x36bf('0x1b')](_0x5bafeb)[_0x36bf('0x22')](function(_0x2eb790){_0x417010[_0x36bf('0x1b')]=_0x2eb790;if(_0x1fea06[_0x36bf('0x2c')][_0x36bf('0x3c')]){_0x5a2e13[_0x36bf('0x3d')]=[{'all':!![]}];}return db[_0x36bf('0x28')][_0x36bf('0x3e')](_0x5a2e13);})[_0x36bf('0x22')](function(_0x6c2317){_0x417010[_0x36bf('0x3f')]=_0x6c2317;return _0x417010;})[_0x36bf('0x22')](respondWithFilteredResult(_0x36d0a9,_0x5a2e13))[_0x36bf('0x40')](handleError(_0x36d0a9,null));};exports[_0x36bf('0x41')]=function(_0x5041ce,_0x1e0b6e){var _0xb0ae70={'raw':!![],'where':{'id':_0x5041ce[_0x36bf('0x42')]['id']}},_0x551ce7={};_0x551ce7[_0x36bf('0x2f')]=_[_0x36bf('0x2d')](db[_0x36bf('0x28')][_0x36bf('0x29')]);_0x551ce7[_0x36bf('0x2c')]=_['keys'](_0x5041ce[_0x36bf('0x2c')]);_0x551ce7['filters']=_['intersection'](_0x551ce7[_0x36bf('0x2f')],_0x551ce7[_0x36bf('0x2c')]);_0xb0ae70[_0x36bf('0x32')]=_[_0x36bf('0x30')](_0x551ce7[_0x36bf('0x2f')],qs[_0x36bf('0x31')](_0x5041ce[_0x36bf('0x2c')]['fields']));_0xb0ae70[_0x36bf('0x32')]=_0xb0ae70['attributes'][_0x36bf('0x33')]?_0xb0ae70[_0x36bf('0x32')]:_0x551ce7[_0x36bf('0x2f')];if(_0x5041ce[_0x36bf('0x2c')][_0x36bf('0x3c')]){_0xb0ae70[_0x36bf('0x3d')]=[{'all':!![]}];}_0xb0ae70=_['merge']({},_0xb0ae70,_0x5041ce['options']);return db['SquareReport']['find'](_0xb0ae70)[_0x36bf('0x22')](handleEntityNotFound(_0x1e0b6e,null))[_0x36bf('0x22')](respondWithResult(_0x1e0b6e,null))[_0x36bf('0x40')](handleError(_0x1e0b6e,null));};exports[_0x36bf('0x43')]=function(_0x3c4585,_0x42feb4){return db['SquareReport'][_0x36bf('0x43')](_0x3c4585['body'],{})[_0x36bf('0x22')](respondWithResult(_0x42feb4,0xc9))[_0x36bf('0x40')](handleError(_0x42feb4,null));};exports['update']=function(_0x212a0d,_0x20a22e){if(_0x212a0d[_0x36bf('0x44')]['id']){delete _0x212a0d[_0x36bf('0x44')]['id'];}return db[_0x36bf('0x28')]['find']({'where':{'id':_0x212a0d[_0x36bf('0x42')]['id']}})['then'](handleEntityNotFound(_0x20a22e,null))[_0x36bf('0x22')](saveUpdates(_0x212a0d['body'],null))['then'](respondWithResult(_0x20a22e,null))[_0x36bf('0x40')](handleError(_0x20a22e,null));};exports[_0x36bf('0x45')]=function(_0x18bde5,_0x49fa8a){return db[_0x36bf('0x28')][_0x36bf('0x46')]({'where':{'id':_0x18bde5[_0x36bf('0x42')]['id']}})[_0x36bf('0x22')](handleEntityNotFound(_0x49fa8a,null))[_0x36bf('0x22')](removeEntity(_0x49fa8a,null))[_0x36bf('0x40')](handleError(_0x49fa8a,null));};exports[_0x36bf('0x47')]=function(_0x1ef700,_0x4bd4d0){return db[_0x36bf('0x28')][_0x36bf('0x47')]()['then'](respondWithResult(_0x4bd4d0,null))[_0x36bf('0x40')](handleError(_0x4bd4d0,null));};
\ No newline at end of file
+var _0x7ec0=['VIRTUAL','options','SquareReport','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','name','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0x7ec0,0xe7));var _0x07ec=function(_0x2a4767,_0xd1f908){_0x2a4767=_0x2a4767-0x0;var _0x2ec9ca=_0x7ec0[_0x2a4767];return _0x2ec9ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07ec('0x0'));var zipdir=require(_0x07ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07ec('0x2'));var moment=require(_0x07ec('0x3'));var BPromise=require(_0x07ec('0x4'));var Mustache=require(_0x07ec('0x5'));var util=require(_0x07ec('0x6'));var path=require(_0x07ec('0x7'));var sox=require(_0x07ec('0x8'));var csv=require('to-csv');var ejs=require(_0x07ec('0x9'));var fs=require('fs');var fs_extra=require(_0x07ec('0xa'));var _=require(_0x07ec('0xb'));var squel=require('squel');var crypto=require(_0x07ec('0xc'));var jsforce=require(_0x07ec('0xd'));var deskjs=require(_0x07ec('0xe'));var toCsv=require(_0x07ec('0xf'));var querystring=require(_0x07ec('0x10'));var Papa=require(_0x07ec('0x11'));var Redis=require('ioredis');var authService=require(_0x07ec('0x12'));var qs=require(_0x07ec('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x07ec('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x07ec('0x15'))['db'];function respondWithStatusCode(_0x4dcdd7,_0x264fb9){_0x264fb9=_0x264fb9||0xcc;return function(_0x2c0a36){if(_0x2c0a36){return _0x4dcdd7[_0x07ec('0x16')](_0x264fb9);}return _0x4dcdd7[_0x07ec('0x17')](_0x264fb9)['end']();};}function respondWithResult(_0x461fba,_0x1a03a3){_0x1a03a3=_0x1a03a3||0xc8;return function(_0x1d2a90){if(_0x1d2a90){return _0x461fba[_0x07ec('0x17')](_0x1a03a3)[_0x07ec('0x18')](_0x1d2a90);}};}function respondWithFilteredResult(_0x2086f4,_0x35ccfd){return function(_0x2d1590){if(_0x2d1590){var _0x2a7429=typeof _0x35ccfd[_0x07ec('0x19')]===_0x07ec('0x1a')&&typeof _0x35ccfd[_0x07ec('0x1b')]===_0x07ec('0x1a');var _0x4d97cb=_0x2d1590[_0x07ec('0x1c')];var _0xaa8e72=_0x2a7429?0x0:_0x35ccfd['offset'];var _0x5e9e1c=_0x2a7429?_0x2d1590[_0x07ec('0x1c')]:_0x35ccfd[_0x07ec('0x19')]+_0x35ccfd[_0x07ec('0x1b')];var _0x1d8ac6;if(_0x5e9e1c>=_0x4d97cb){_0x5e9e1c=_0x4d97cb;_0x1d8ac6=0xc8;}else{_0x1d8ac6=0xce;}_0x2086f4[_0x07ec('0x17')](_0x1d8ac6);return _0x2086f4['set'](_0x07ec('0x1d'),_0xaa8e72+'-'+_0x5e9e1c+'/'+_0x4d97cb)[_0x07ec('0x18')](_0x2d1590);}return null;};}function patchUpdates(_0x1a9f5d){return function(_0x4d5d6d){try{jsonpatch['apply'](_0x4d5d6d,_0x1a9f5d,!![]);}catch(_0x411e23){return BPromise[_0x07ec('0x1e')](_0x411e23);}return _0x4d5d6d[_0x07ec('0x1f')]();};}function saveUpdates(_0xd9b98,_0x52c2b7){return function(_0x36da78){if(_0x36da78){return _0x36da78[_0x07ec('0x20')](_0xd9b98)[_0x07ec('0x21')](function(_0x5c4560){return _0x5c4560;});}return null;};}function removeEntity(_0x397c50,_0x4de5f6){return function(_0x513c7c){if(_0x513c7c){return _0x513c7c[_0x07ec('0x22')]()[_0x07ec('0x21')](function(){_0x397c50[_0x07ec('0x17')](0xcc)[_0x07ec('0x23')]();});}};}function handleEntityNotFound(_0x1c7593,_0x28106e){return function(_0x9f4f12){if(!_0x9f4f12){_0x1c7593[_0x07ec('0x16')](0x194);}return _0x9f4f12;};}function handleError(_0x5d079f,_0x3670ec){_0x3670ec=_0x3670ec||0x1f4;return function(_0x437a6b){logger[_0x07ec('0x24')](_0x437a6b['stack']);if(_0x437a6b[_0x07ec('0x25')]){delete _0x437a6b[_0x07ec('0x25')];}_0x5d079f[_0x07ec('0x17')](_0x3670ec)['send'](_0x437a6b);};}exports['index']=function(_0x46fe75,_0x2c1065){var _0x47d1b8={},_0x130433={},_0x3e638b={'count':0x0,'rows':[]};var _0x1b252d=_['map'](db['SquareReport']['rawAttributes'],function(_0x1b5044){return{'name':_0x1b5044[_0x07ec('0x26')],'type':_0x1b5044[_0x07ec('0x27')]['key']};});_0x130433['model']=_[_0x07ec('0x28')](_0x1b252d,_0x07ec('0x25'));_0x130433[_0x07ec('0x29')]=_[_0x07ec('0x2a')](_0x46fe75['query']);_0x130433[_0x07ec('0x2b')]=_[_0x07ec('0x2c')](_0x130433[_0x07ec('0x2d')],_0x130433[_0x07ec('0x29')]);_0x47d1b8['attributes']=_[_0x07ec('0x2c')](_0x130433['model'],qs[_0x07ec('0x2e')](_0x46fe75[_0x07ec('0x29')][_0x07ec('0x2e')]));_0x47d1b8[_0x07ec('0x2f')]=_0x47d1b8[_0x07ec('0x2f')][_0x07ec('0x30')]?_0x47d1b8[_0x07ec('0x2f')]:_0x130433[_0x07ec('0x2d')];if(!_0x46fe75[_0x07ec('0x29')][_0x07ec('0x31')](_0x07ec('0x32'))){_0x47d1b8[_0x07ec('0x1b')]=qs['limit'](_0x46fe75[_0x07ec('0x29')][_0x07ec('0x1b')]);_0x47d1b8[_0x07ec('0x19')]=qs[_0x07ec('0x19')](_0x46fe75[_0x07ec('0x29')][_0x07ec('0x19')]);}_0x47d1b8[_0x07ec('0x33')]=qs[_0x07ec('0x34')](_0x46fe75[_0x07ec('0x29')]['sort']);_0x47d1b8[_0x07ec('0x35')]=qs[_0x07ec('0x2b')](_[_0x07ec('0x36')](_0x46fe75[_0x07ec('0x29')],_0x130433[_0x07ec('0x2b')]),_0x1b252d);if(_0x46fe75[_0x07ec('0x29')][_0x07ec('0x37')]){_0x47d1b8[_0x07ec('0x35')]=_[_0x07ec('0x38')](_0x47d1b8[_0x07ec('0x35')],{'$or':_[_0x07ec('0x28')](_0x1b252d,function(_0xf87c9e){if(_0xf87c9e[_0x07ec('0x27')]!==_0x07ec('0x39')){var _0x4b8522={};_0x4b8522[_0xf87c9e[_0x07ec('0x25')]]={'$like':'%'+_0x46fe75[_0x07ec('0x29')][_0x07ec('0x37')]+'%'};return _0x4b8522;}})});}_0x47d1b8=_[_0x07ec('0x38')]({},_0x47d1b8,_0x46fe75[_0x07ec('0x3a')]);var _0x2da0ef={'where':_0x47d1b8['where']};return db[_0x07ec('0x3b')][_0x07ec('0x1c')](_0x2da0ef)[_0x07ec('0x21')](function(_0x5f2cc7){_0x3e638b[_0x07ec('0x1c')]=_0x5f2cc7;if(_0x46fe75[_0x07ec('0x29')]['includeAll']){_0x47d1b8[_0x07ec('0x3c')]=[{'all':!![]}];}return db[_0x07ec('0x3b')][_0x07ec('0x3d')](_0x47d1b8);})[_0x07ec('0x21')](function(_0x5bddd2){_0x3e638b[_0x07ec('0x3e')]=_0x5bddd2;return _0x3e638b;})['then'](respondWithFilteredResult(_0x2c1065,_0x47d1b8))[_0x07ec('0x3f')](handleError(_0x2c1065,null));};exports[_0x07ec('0x40')]=function(_0x34cc74,_0x48ad54){var _0x3982fc={'raw':!![],'where':{'id':_0x34cc74['params']['id']}},_0x3562f7={};_0x3562f7[_0x07ec('0x2d')]=_['keys'](db[_0x07ec('0x3b')][_0x07ec('0x41')]);_0x3562f7[_0x07ec('0x29')]=_[_0x07ec('0x2a')](_0x34cc74[_0x07ec('0x29')]);_0x3562f7[_0x07ec('0x2b')]=_[_0x07ec('0x2c')](_0x3562f7[_0x07ec('0x2d')],_0x3562f7[_0x07ec('0x29')]);_0x3982fc['attributes']=_[_0x07ec('0x2c')](_0x3562f7[_0x07ec('0x2d')],qs[_0x07ec('0x2e')](_0x34cc74[_0x07ec('0x29')][_0x07ec('0x2e')]));_0x3982fc['attributes']=_0x3982fc[_0x07ec('0x2f')][_0x07ec('0x30')]?_0x3982fc['attributes']:_0x3562f7[_0x07ec('0x2d')];if(_0x34cc74[_0x07ec('0x29')][_0x07ec('0x42')]){_0x3982fc[_0x07ec('0x3c')]=[{'all':!![]}];}_0x3982fc=_[_0x07ec('0x38')]({},_0x3982fc,_0x34cc74[_0x07ec('0x3a')]);return db[_0x07ec('0x3b')][_0x07ec('0x43')](_0x3982fc)[_0x07ec('0x21')](handleEntityNotFound(_0x48ad54,null))['then'](respondWithResult(_0x48ad54,null))['catch'](handleError(_0x48ad54,null));};exports['create']=function(_0x437c2e,_0x322691){return db[_0x07ec('0x3b')][_0x07ec('0x44')](_0x437c2e[_0x07ec('0x45')],{})[_0x07ec('0x21')](respondWithResult(_0x322691,0xc9))['catch'](handleError(_0x322691,null));};exports[_0x07ec('0x20')]=function(_0xfd8c1e,_0x1a8f7d){if(_0xfd8c1e[_0x07ec('0x45')]['id']){delete _0xfd8c1e[_0x07ec('0x45')]['id'];}return db['SquareReport'][_0x07ec('0x43')]({'where':{'id':_0xfd8c1e[_0x07ec('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a8f7d,null))[_0x07ec('0x21')](saveUpdates(_0xfd8c1e['body'],null))['then'](respondWithResult(_0x1a8f7d,null))[_0x07ec('0x3f')](handleError(_0x1a8f7d,null));};exports['destroy']=function(_0x3ed7da,_0x1ff694){return db[_0x07ec('0x3b')]['find']({'where':{'id':_0x3ed7da[_0x07ec('0x46')]['id']}})[_0x07ec('0x21')](handleEntityNotFound(_0x1ff694,null))['then'](removeEntity(_0x1ff694,null))['catch'](handleError(_0x1ff694,null));};exports[_0x07ec('0x47')]=function(_0x1307a4,_0x3851be){return db[_0x07ec('0x3b')][_0x07ec('0x47')]()[_0x07ec('0x21')](respondWithResult(_0x3851be,null))['catch'](handleError(_0x3851be,null));};
\ No newline at end of file
index 90f0789..7dd6f94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x400f=['lodash','util','../../config/logger','api','moment','rimraf','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x37082e,_0x54ac47){var _0x1793e3=function(_0x277562){while(--_0x277562){_0x37082e['push'](_0x37082e['shift']());}};_0x1793e3(++_0x54ac47);}(_0x400f,0x196));var _0xf400=function(_0x299dd0,_0x371b3a){_0x299dd0=_0x299dd0-0x0;var _0x244170=_0x400f[_0x299dd0];return _0x244170;};'use strict';var _=require(_0xf400('0x0'));var util=require(_0xf400('0x1'));var logger=require(_0xf400('0x2'))(_0xf400('0x3'));var moment=require(_0xf400('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf400('0x5'));var config=require('../../config/environment');var attributes=require(_0xf400('0x6'));module[_0xf400('0x7')]=function(_0xac3831,_0x1b01ba){return _0xac3831[_0xf400('0x8')]('SquareReport',attributes,{'tableName':_0xf400('0x9'),'paranoid':![],'indexes':[{'name':_0xf400('0xa'),'fields':[_0xf400('0xb'),_0xf400('0xc')]},{'name':_0xf400('0xd'),'fields':[_0xf400('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe065=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe065,0xc6));var _0x5e06=function(_0x1988e3,_0x1f19fb){_0x1988e3=_0x1988e3-0x0;var _0x3952f4=_0xe065[_0x1988e3];return _0x3952f4;};'use strict';var _=require(_0x5e06('0x0'));var util=require('util');var logger=require(_0x5e06('0x1'))(_0x5e06('0x2'));var moment=require(_0x5e06('0x3'));var BPromise=require(_0x5e06('0x4'));var rp=require(_0x5e06('0x5'));var fs=require('fs');var path=require(_0x5e06('0x6'));var rimraf=require(_0x5e06('0x7'));var config=require(_0x5e06('0x8'));var attributes=require(_0x5e06('0x9'));module[_0x5e06('0xa')]=function(_0x3c1dca,_0x40f66e){return _0x3c1dca[_0x5e06('0xb')](_0x5e06('0xc'),attributes,{'tableName':_0x5e06('0xd'),'paranoid':![],'indexes':[{'name':_0x5e06('0xe'),'fields':[_0x5e06('0xf'),_0x5e06('0x10')]},{'name':_0x5e06('0x11'),'fields':[_0x5e06('0x11')]}],'timestamps':!![]});};
\ No newline at end of file
index a1d056d..1bbc3b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e3f=['attributes','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','code','error','message','info','SquareReport,\x20%s,\x20%s','result','catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','update','where'];(function(_0x1b3fdc,_0x1cdebc){var _0x2f447a=function(_0x213312){while(--_0x213312){_0x1b3fdc['push'](_0x1b3fdc['shift']());}};_0x2f447a(++_0x1cdebc);}(_0x2e3f,0x195));var _0xf2e3=function(_0x1b2bea,_0x2387ab){_0x1b2bea=_0x1b2bea-0x0;var _0xe0c4b1=_0x2e3f[_0x1b2bea];return _0xe0c4b1;};'use strict';var _=require(_0xf2e3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf2e3('0x1'));var rs=require(_0xf2e3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2e3('0x3'))['db'];var utils=require(_0xf2e3('0x4'));var logger=require(_0xf2e3('0x5'))(_0xf2e3('0x6'));var config=require('../../config/environment');var jayson=require(_0xf2e3('0x7'));var client=jayson['client'][_0xf2e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3477e6,_0x2ee637,_0x3e6a64){return new BPromise(function(_0x5991b2,_0x995e){return client[_0xf2e3('0x9')](_0x3477e6,_0x3e6a64)[_0xf2e3('0xa')](function(_0xeb2489){logger['info']('SquareReport,\x20%s,\x20%s',_0x2ee637,_0xf2e3('0xb'));logger[_0xf2e3('0xc')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x2ee637,_0xf2e3('0xb'),JSON[_0xf2e3('0xd')](_0xeb2489));if(_0xeb2489['error']){if(_0xeb2489['error'][_0xf2e3('0xe')]===0x1f4){logger[_0xf2e3('0xf')]('SquareReport,\x20%s,\x20%s',_0x2ee637,_0xeb2489[_0xf2e3('0xf')][_0xf2e3('0x10')]);return _0x995e(_0xeb2489['error'][_0xf2e3('0x10')]);}logger[_0xf2e3('0xf')]('SquareReport,\x20%s,\x20%s',_0x2ee637,_0xeb2489[_0xf2e3('0xf')][_0xf2e3('0x10')]);return _0x5991b2(_0xeb2489['error']['message']);}else{logger[_0xf2e3('0x11')](_0xf2e3('0x12'),_0x2ee637,_0xf2e3('0xb'));_0x5991b2(_0xeb2489[_0xf2e3('0x13')][_0xf2e3('0x10')]);}})[_0xf2e3('0x14')](function(_0x17a697){logger['error'](_0xf2e3('0x12'),_0x2ee637,_0x17a697);_0x995e(_0x17a697);});});}exports[_0xf2e3('0x15')]=function(_0x2f12b1){var _0x561af4=this;return new Promise(function(_0x845917,_0x538f31){return db[_0xf2e3('0x16')]['create'](_0x2f12b1[_0xf2e3('0x17')],{'raw':_0x2f12b1[_0xf2e3('0x18')]?_0x2f12b1[_0xf2e3('0x18')][_0xf2e3('0x19')]===undefined?!![]:![]:!![]})[_0xf2e3('0xa')](function(_0x347962){logger[_0xf2e3('0x11')](_0xf2e3('0x15'),_0x2f12b1);logger[_0xf2e3('0xc')](_0xf2e3('0x15'),_0x2f12b1,JSON[_0xf2e3('0xd')](_0x347962));_0x845917(_0x347962);})[_0xf2e3('0x14')](function(_0x11e1bc){logger[_0xf2e3('0xf')](_0xf2e3('0x15'),_0x11e1bc[_0xf2e3('0x10')],_0x2f12b1);_0x538f31(_0x561af4['error'](0x1f4,_0x11e1bc[_0xf2e3('0x10')]));});});};exports[_0xf2e3('0x1a')]=function(_0x2d5555){var _0x31b2d3=this;return new Promise(function(_0x20e800,_0x722e02){return db['SquareReport'][_0xf2e3('0x1b')](_0x2d5555[_0xf2e3('0x17')],{'raw':_0x2d5555[_0xf2e3('0x18')]?_0x2d5555[_0xf2e3('0x18')][_0xf2e3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5555[_0xf2e3('0x18')]?_0x2d5555[_0xf2e3('0x18')][_0xf2e3('0x1c')]||null:null,'attributes':_0x2d5555[_0xf2e3('0x18')]?_0x2d5555[_0xf2e3('0x18')][_0xf2e3('0x1d')]||null:null,'limit':_0x2d5555[_0xf2e3('0x18')]?_0x2d5555[_0xf2e3('0x18')][_0xf2e3('0x1e')]||null:null})[_0xf2e3('0xa')](function(_0xa42471){logger['info']('UpdateSquareReport',_0x2d5555);logger[_0xf2e3('0xc')](_0xf2e3('0x1a'),_0x2d5555,JSON[_0xf2e3('0xd')](_0xa42471));_0x20e800(_0xa42471);})[_0xf2e3('0x14')](function(_0x36d46b){logger[_0xf2e3('0xf')](_0xf2e3('0x1a'),_0x36d46b[_0xf2e3('0x10')],_0x2d5555);_0x722e02(_0x31b2d3[_0xf2e3('0xf')](0x1f4,_0x36d46b[_0xf2e3('0x10')]));});});};
\ No newline at end of file
+var _0xd200=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','options','raw','debug','CreateSquareReport','catch','UpdateSquareReport','SquareReport','update','body','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s'];(function(_0x57834a,_0xfac574){var _0x5788d9=function(_0x290392){while(--_0x290392){_0x57834a['push'](_0x57834a['shift']());}};_0x5788d9(++_0xfac574);}(_0xd200,0x1b2));var _0x0d20=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xd200[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x0d20('0x0'));var util=require('util');var moment=require(_0x0d20('0x1'));var BPromise=require(_0x0d20('0x2'));var rs=require(_0x0d20('0x3'));var fs=require('fs');var Redis=require(_0x0d20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d20('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0d20('0x6'));var jayson=require(_0x0d20('0x7'));var client=jayson[_0x0d20('0x8')][_0x0d20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bbcac,_0x569c81,_0x9ee98a){return new BPromise(function(_0x5bf515,_0xa38fd4){return client[_0x0d20('0xa')](_0x5bbcac,_0x9ee98a)[_0x0d20('0xb')](function(_0x54e539){logger[_0x0d20('0xc')](_0x0d20('0xd'),_0x569c81,'request\x20sent');logger['debug'](_0x0d20('0xe'),_0x569c81,'request\x20sent',JSON[_0x0d20('0xf')](_0x54e539));if(_0x54e539[_0x0d20('0x10')]){if(_0x54e539[_0x0d20('0x10')][_0x0d20('0x11')]===0x1f4){logger[_0x0d20('0x10')](_0x0d20('0xd'),_0x569c81,_0x54e539[_0x0d20('0x10')][_0x0d20('0x12')]);return _0xa38fd4(_0x54e539[_0x0d20('0x10')][_0x0d20('0x12')]);}logger[_0x0d20('0x10')](_0x0d20('0xd'),_0x569c81,_0x54e539['error'][_0x0d20('0x12')]);return _0x5bf515(_0x54e539[_0x0d20('0x10')][_0x0d20('0x12')]);}else{logger[_0x0d20('0xc')]('SquareReport,\x20%s,\x20%s',_0x569c81,'request\x20sent');_0x5bf515(_0x54e539[_0x0d20('0x13')][_0x0d20('0x12')]);}})['catch'](function(_0x765c85){logger[_0x0d20('0x10')](_0x0d20('0xd'),_0x569c81,_0x765c85);_0xa38fd4(_0x765c85);});});}exports['CreateSquareReport']=function(_0x57311d){var _0x497ed2=this;return new Promise(function(_0x42eff5,_0x3f52ce){return db['SquareReport'][_0x0d20('0x14')](_0x57311d['body'],{'raw':_0x57311d[_0x0d20('0x15')]?_0x57311d[_0x0d20('0x15')][_0x0d20('0x16')]===undefined?!![]:![]:!![]})[_0x0d20('0xb')](function(_0x3823f2){logger[_0x0d20('0xc')]('CreateSquareReport',_0x57311d);logger[_0x0d20('0x17')](_0x0d20('0x18'),_0x57311d,JSON[_0x0d20('0xf')](_0x3823f2));_0x42eff5(_0x3823f2);})[_0x0d20('0x19')](function(_0x26499b){logger['error'](_0x0d20('0x18'),_0x26499b[_0x0d20('0x12')],_0x57311d);_0x3f52ce(_0x497ed2[_0x0d20('0x10')](0x1f4,_0x26499b[_0x0d20('0x12')]));});});};exports[_0x0d20('0x1a')]=function(_0x4a332b){var _0x27025a=this;return new Promise(function(_0x51d4e5,_0x194b8a){return db[_0x0d20('0x1b')][_0x0d20('0x1c')](_0x4a332b[_0x0d20('0x1d')],{'raw':_0x4a332b['options']?_0x4a332b[_0x0d20('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a332b['options']?_0x4a332b['options']['where']||null:null,'attributes':_0x4a332b[_0x0d20('0x15')]?_0x4a332b[_0x0d20('0x15')][_0x0d20('0x1e')]||null:null,'limit':_0x4a332b[_0x0d20('0x15')]?_0x4a332b[_0x0d20('0x15')][_0x0d20('0x1f')]||null:null})['then'](function(_0x241a4f){logger[_0x0d20('0xc')](_0x0d20('0x1a'),_0x4a332b);logger[_0x0d20('0x17')]('UpdateSquareReport',_0x4a332b,JSON[_0x0d20('0xf')](_0x241a4f));_0x51d4e5(_0x241a4f);})[_0x0d20('0x19')](function(_0x109a1b){logger[_0x0d20('0x10')](_0x0d20('0x1a'),_0x109a1b[_0x0d20('0x12')],_0x4a332b);_0x194b8a(_0x27025a[_0x0d20('0x10')](0x1f4,_0x109a1b[_0x0d20('0x12')]));});});};
\ No newline at end of file
index 06bb97a..61bd91f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc102=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy','exports','multer','util'];(function(_0x4b5d82,_0x13d21f){var _0x5a2119=function(_0x46f28c){while(--_0x46f28c){_0x4b5d82['push'](_0x4b5d82['shift']());}};_0x5a2119(++_0x13d21f);}(_0xc102,0xa6));var _0x2c10=function(_0x2a4cc5,_0x2c43af){_0x2a4cc5=_0x2a4cc5-0x0;var _0x18c1ad=_0xc102[_0x2a4cc5];return _0x18c1ad;};'use strict';var multer=require(_0x2c10('0x0'));var util=require(_0x2c10('0x1'));var path=require(_0x2c10('0x2'));var timeout=require(_0x2c10('0x3'));var express=require(_0x2c10('0x4'));var router=express[_0x2c10('0x5')]();var fs_extra=require(_0x2c10('0x6'));var auth=require(_0x2c10('0x7'));var interaction=require(_0x2c10('0x8'));var config=require('../../config/environment');var controller=require(_0x2c10('0x9'));router[_0x2c10('0xa')]('/',auth[_0x2c10('0xb')](),controller[_0x2c10('0xc')]);router[_0x2c10('0xa')](_0x2c10('0xd'),auth[_0x2c10('0xb')](),controller[_0x2c10('0xe')]);router[_0x2c10('0xa')](_0x2c10('0xf'),auth['isAuthenticated'](),controller[_0x2c10('0x10')]);router[_0x2c10('0x11')]('/',auth[_0x2c10('0xb')](),controller[_0x2c10('0x12')]);router['put'](_0x2c10('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2c10('0xf'),auth[_0x2c10('0xb')](),controller[_0x2c10('0x13')]);module[_0x2c10('0x14')]=router;
\ No newline at end of file
+var _0x6f02=['post','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','index','get','/describe','describe','/:id','isAuthenticated','show'];(function(_0x2e2219,_0x490ba9){var _0x1f5937=function(_0x339b6e){while(--_0x339b6e){_0x2e2219['push'](_0x2e2219['shift']());}};_0x1f5937(++_0x490ba9);}(_0x6f02,0x1bd));var _0x26f0=function(_0x601730,_0x282c03){_0x601730=_0x601730-0x0;var _0x280c7c=_0x6f02[_0x601730];return _0x280c7c;};'use strict';var multer=require(_0x26f0('0x0'));var util=require(_0x26f0('0x1'));var path=require(_0x26f0('0x2'));var timeout=require(_0x26f0('0x3'));var express=require(_0x26f0('0x4'));var router=express[_0x26f0('0x5')]();var fs_extra=require(_0x26f0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x26f0('0x7'));var config=require(_0x26f0('0x8'));var controller=require(_0x26f0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x26f0('0xa')]);router[_0x26f0('0xb')](_0x26f0('0xc'),auth['isAuthenticated'](),controller[_0x26f0('0xd')]);router[_0x26f0('0xb')](_0x26f0('0xe'),auth[_0x26f0('0xf')](),controller[_0x26f0('0x10')]);router[_0x26f0('0x11')]('/',auth[_0x26f0('0xf')](),controller['create']);router[_0x26f0('0x12')](_0x26f0('0xe'),auth['isAuthenticated'](),controller[_0x26f0('0x13')]);router['delete'](_0x26f0('0xe'),auth[_0x26f0('0xf')](),controller[_0x26f0('0x14')]);module['exports']=router;
\ No newline at end of file
index d623519..9351810 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1da=['STRING','TEXT','sequelize','exports'];(function(_0x54c30a,_0x137ddb){var _0x504554=function(_0x27fb87){while(--_0x27fb87){_0x54c30a['push'](_0x54c30a['shift']());}};_0x504554(++_0x137ddb);}(_0xd1da,0x162));var _0xad1d=function(_0x46b1c9,_0x169f87){_0x46b1c9=_0x46b1c9-0x0;var _0x17569c=_0xd1da[_0x46b1c9];return _0x17569c;};'use strict';var Sequelize=require(_0xad1d('0x0'));module[_0xad1d('0x1')]={'uniqueid':{'type':Sequelize[_0xad1d('0x2')]},'node':{'type':Sequelize[_0xad1d('0x2')]},'application':{'type':Sequelize[_0xad1d('0x2')]},'data':{'type':Sequelize[_0xad1d('0x3')]},'project_name':{'type':Sequelize[_0xad1d('0x2')]},'callerid':{'type':Sequelize[_0xad1d('0x2')]}};
\ No newline at end of file
+var _0x3142=['exports','STRING','TEXT','sequelize'];(function(_0x5cef41,_0x15681b){var _0x5f40bd=function(_0x261e30){while(--_0x261e30){_0x5cef41['push'](_0x5cef41['shift']());}};_0x5f40bd(++_0x15681b);}(_0x3142,0x1e3));var _0x2314=function(_0x3330c7,_0x36fdb9){_0x3330c7=_0x3330c7-0x0;var _0x5662e3=_0x3142[_0x3330c7];return _0x5662e3;};'use strict';var Sequelize=require(_0x2314('0x0'));module[_0x2314('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x2314('0x2')]},'application':{'type':Sequelize[_0x2314('0x2')]},'data':{'type':Sequelize[_0x2314('0x3')]},'project_name':{'type':Sequelize[_0x2314('0x2')]},'callerid':{'type':Sequelize[_0x2314('0x2')]}};
\ No newline at end of file
index 4672138..aab60aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x543c=['order','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','findAll','rows','catch','fields','include','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x543c,0xf8));var _0xc543=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x543c[_0x431ff8];return _0x84ccd4;};'use strict';var emlformat=require(_0xc543('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc543('0x1'));var jsonpatch=require(_0xc543('0x2'));var rp=require('request-promise');var moment=require(_0xc543('0x3'));var BPromise=require(_0xc543('0x4'));var Mustache=require(_0xc543('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc543('0x6'));var csv=require(_0xc543('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc543('0x8'));var _=require(_0xc543('0x9'));var squel=require('squel');var crypto=require(_0xc543('0xa'));var jsforce=require(_0xc543('0xb'));var deskjs=require(_0xc543('0xc'));var toCsv=require(_0xc543('0x7'));var querystring=require(_0xc543('0xd'));var Papa=require(_0xc543('0xe'));var Redis=require(_0xc543('0xf'));var authService=require(_0xc543('0x10'));var qs=require(_0xc543('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc543('0x12'))(_0xc543('0x13'));var utils=require(_0xc543('0x14'));var config=require(_0xc543('0x15'));var licenseUtil=require(_0xc543('0x16'));var db=require(_0xc543('0x17'))['db'];function respondWithStatusCode(_0x503cc5,_0xe1b55){_0xe1b55=_0xe1b55||0xcc;return function(_0xd4c873){if(_0xd4c873){return _0x503cc5['sendStatus'](_0xe1b55);}return _0x503cc5[_0xc543('0x18')](_0xe1b55)[_0xc543('0x19')]();};}function respondWithResult(_0x805840,_0x4ea2f3){_0x4ea2f3=_0x4ea2f3||0xc8;return function(_0x2636ca){if(_0x2636ca){return _0x805840[_0xc543('0x18')](_0x4ea2f3)['json'](_0x2636ca);}};}function respondWithFilteredResult(_0x1103d1,_0x1c41b9){return function(_0x4ddb09){if(_0x4ddb09){var _0xb856a6=typeof _0x1c41b9[_0xc543('0x1a')]===_0xc543('0x1b')&&typeof _0x1c41b9[_0xc543('0x1c')]===_0xc543('0x1b');var _0x3cea92=_0x4ddb09[_0xc543('0x1d')];var _0x1cb442=_0xb856a6?0x0:_0x1c41b9[_0xc543('0x1a')];var _0x1c05e6=_0xb856a6?_0x4ddb09[_0xc543('0x1d')]:_0x1c41b9[_0xc543('0x1a')]+_0x1c41b9['limit'];var _0x552b5d;if(_0x1c05e6>=_0x3cea92){_0x1c05e6=_0x3cea92;_0x552b5d=0xc8;}else{_0x552b5d=0xce;}_0x1103d1[_0xc543('0x18')](_0x552b5d);return _0x1103d1['set'](_0xc543('0x1e'),_0x1cb442+'-'+_0x1c05e6+'/'+_0x3cea92)[_0xc543('0x1f')](_0x4ddb09);}return null;};}function patchUpdates(_0x46e37b){return function(_0x4f8714){try{jsonpatch['apply'](_0x4f8714,_0x46e37b,!![]);}catch(_0x4a465f){return BPromise[_0xc543('0x20')](_0x4a465f);}return _0x4f8714[_0xc543('0x21')]();};}function saveUpdates(_0x1ffad2,_0x2db0dc){return function(_0x4251d3){if(_0x4251d3){return _0x4251d3[_0xc543('0x22')](_0x1ffad2)[_0xc543('0x23')](function(_0x1765f0){return _0x1765f0;});}return null;};}function removeEntity(_0x29645a,_0x53d800){return function(_0x352478){if(_0x352478){return _0x352478[_0xc543('0x24')]()[_0xc543('0x23')](function(){_0x29645a[_0xc543('0x18')](0xcc)[_0xc543('0x19')]();});}};}function handleEntityNotFound(_0x1fd489,_0x4e8119){return function(_0x32a1c3){if(!_0x32a1c3){_0x1fd489[_0xc543('0x25')](0x194);}return _0x32a1c3;};}function handleError(_0x3eec0a,_0x357950){_0x357950=_0x357950||0x1f4;return function(_0x3329a2){logger[_0xc543('0x26')](_0x3329a2['stack']);if(_0x3329a2[_0xc543('0x27')]){delete _0x3329a2['name'];}_0x3eec0a[_0xc543('0x18')](_0x357950)[_0xc543('0x28')](_0x3329a2);};}exports[_0xc543('0x29')]=function(_0x54004e,_0x3b6355){var _0x12ab83={},_0x8842e7={},_0x31886e={'count':0x0,'rows':[]};var _0x35d09a=_[_0xc543('0x2a')](db['SquareDetailsReport'][_0xc543('0x2b')],function(_0x4698ec){return{'name':_0x4698ec[_0xc543('0x2c')],'type':_0x4698ec[_0xc543('0x2d')][_0xc543('0x2e')]};});_0x8842e7[_0xc543('0x2f')]=_[_0xc543('0x2a')](_0x35d09a,_0xc543('0x27'));_0x8842e7[_0xc543('0x30')]=_[_0xc543('0x31')](_0x54004e[_0xc543('0x30')]);_0x8842e7[_0xc543('0x32')]=_[_0xc543('0x33')](_0x8842e7['model'],_0x8842e7[_0xc543('0x30')]);_0x12ab83[_0xc543('0x34')]=_['intersection'](_0x8842e7[_0xc543('0x2f')],qs['fields'](_0x54004e[_0xc543('0x30')]['fields']));_0x12ab83[_0xc543('0x34')]=_0x12ab83[_0xc543('0x34')][_0xc543('0x35')]?_0x12ab83[_0xc543('0x34')]:_0x8842e7[_0xc543('0x2f')];if(!_0x54004e[_0xc543('0x30')][_0xc543('0x36')](_0xc543('0x37'))){_0x12ab83['limit']=qs[_0xc543('0x1c')](_0x54004e[_0xc543('0x30')][_0xc543('0x1c')]);_0x12ab83[_0xc543('0x1a')]=qs[_0xc543('0x1a')](_0x54004e[_0xc543('0x30')][_0xc543('0x1a')]);}_0x12ab83[_0xc543('0x38')]=qs['sort'](_0x54004e[_0xc543('0x30')][_0xc543('0x39')]);_0x12ab83[_0xc543('0x3a')]=qs['filters'](_[_0xc543('0x3b')](_0x54004e[_0xc543('0x30')],_0x8842e7[_0xc543('0x32')]),_0x35d09a);if(_0x54004e[_0xc543('0x30')][_0xc543('0x3c')]){_0x12ab83[_0xc543('0x3a')]=_[_0xc543('0x3d')](_0x12ab83[_0xc543('0x3a')],{'$or':_['map'](_0x35d09a,function(_0x2c7ef3){if(_0x2c7ef3[_0xc543('0x2d')]!==_0xc543('0x3e')){var _0x532bc5={};_0x532bc5[_0x2c7ef3[_0xc543('0x27')]]={'$like':'%'+_0x54004e[_0xc543('0x30')][_0xc543('0x3c')]+'%'};return _0x532bc5;}})});}_0x12ab83=_[_0xc543('0x3d')]({},_0x12ab83,_0x54004e[_0xc543('0x3f')]);var _0x1b9303={'where':_0x12ab83[_0xc543('0x3a')]};return db[_0xc543('0x40')][_0xc543('0x1d')](_0x1b9303)[_0xc543('0x23')](function(_0x26e5f6){_0x31886e[_0xc543('0x1d')]=_0x26e5f6;if(_0x54004e[_0xc543('0x30')][_0xc543('0x41')]){_0x12ab83['include']=[{'all':!![]}];}return db[_0xc543('0x40')][_0xc543('0x42')](_0x12ab83);})[_0xc543('0x23')](function(_0x3b0a8a){_0x31886e[_0xc543('0x43')]=_0x3b0a8a;return _0x31886e;})[_0xc543('0x23')](respondWithFilteredResult(_0x3b6355,_0x12ab83))[_0xc543('0x44')](handleError(_0x3b6355,null));};exports['show']=function(_0x21a91e,_0xe53a98){var _0x361ad4={'raw':!![],'where':{'id':_0x21a91e['params']['id']}},_0x234d8f={};_0x234d8f['model']=_[_0xc543('0x31')](db['SquareDetailsReport']['rawAttributes']);_0x234d8f['query']=_[_0xc543('0x31')](_0x21a91e[_0xc543('0x30')]);_0x234d8f[_0xc543('0x32')]=_[_0xc543('0x33')](_0x234d8f[_0xc543('0x2f')],_0x234d8f[_0xc543('0x30')]);_0x361ad4[_0xc543('0x34')]=_['intersection'](_0x234d8f['model'],qs[_0xc543('0x45')](_0x21a91e[_0xc543('0x30')][_0xc543('0x45')]));_0x361ad4[_0xc543('0x34')]=_0x361ad4['attributes'][_0xc543('0x35')]?_0x361ad4[_0xc543('0x34')]:_0x234d8f[_0xc543('0x2f')];if(_0x21a91e[_0xc543('0x30')][_0xc543('0x41')]){_0x361ad4[_0xc543('0x46')]=[{'all':!![]}];}_0x361ad4=_[_0xc543('0x3d')]({},_0x361ad4,_0x21a91e[_0xc543('0x3f')]);return db[_0xc543('0x40')][_0xc543('0x47')](_0x361ad4)[_0xc543('0x23')](handleEntityNotFound(_0xe53a98,null))[_0xc543('0x23')](respondWithResult(_0xe53a98,null))[_0xc543('0x44')](handleError(_0xe53a98,null));};exports[_0xc543('0x48')]=function(_0x57023d,_0x5e3f4a){return db['SquareDetailsReport'][_0xc543('0x48')](_0x57023d['body'],{})[_0xc543('0x23')](respondWithResult(_0x5e3f4a,0xc9))[_0xc543('0x44')](handleError(_0x5e3f4a,null));};exports[_0xc543('0x22')]=function(_0x4dee76,_0x592751){if(_0x4dee76['body']['id']){delete _0x4dee76[_0xc543('0x49')]['id'];}return db[_0xc543('0x40')][_0xc543('0x47')]({'where':{'id':_0x4dee76[_0xc543('0x4a')]['id']}})[_0xc543('0x23')](handleEntityNotFound(_0x592751,null))[_0xc543('0x23')](saveUpdates(_0x4dee76['body'],null))[_0xc543('0x23')](respondWithResult(_0x592751,null))['catch'](handleError(_0x592751,null));};exports['destroy']=function(_0x2e8134,_0x36d781){return db['SquareDetailsReport'][_0xc543('0x47')]({'where':{'id':_0x2e8134[_0xc543('0x4a')]['id']}})[_0xc543('0x23')](handleEntityNotFound(_0x36d781,null))[_0xc543('0x23')](removeEntity(_0x36d781,null))[_0xc543('0x44')](handleError(_0x36d781,null));};exports[_0xc543('0x4b')]=function(_0x512e55,_0x14ddd5){return db[_0xc543('0x40')][_0xc543('0x4b')]()['then'](respondWithResult(_0x14ddd5,null))[_0xc543('0x44')](handleError(_0x14ddd5,null));};
\ No newline at end of file
+var _0xb0e4=['intersection','model','fields','length','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','send','index','map','SquareDetailsReport','fieldName','key','name','keys','query','filters','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb0e4,0x67));var _0x4b0e=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xb0e4[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x4b0e('0x0'));var rimraf=require(_0x4b0e('0x1'));var zipdir=require(_0x4b0e('0x2'));var jsonpatch=require(_0x4b0e('0x3'));var rp=require('request-promise');var moment=require(_0x4b0e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4b0e('0x5'));var sox=require('sox');var csv=require(_0x4b0e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b0e('0x7'));var _=require(_0x4b0e('0x8'));var squel=require(_0x4b0e('0x9'));var crypto=require(_0x4b0e('0xa'));var jsforce=require(_0x4b0e('0xb'));var deskjs=require(_0x4b0e('0xc'));var toCsv=require(_0x4b0e('0x6'));var querystring=require(_0x4b0e('0xd'));var Papa=require(_0x4b0e('0xe'));var Redis=require(_0x4b0e('0xf'));var authService=require(_0x4b0e('0x10'));var qs=require(_0x4b0e('0x11'));var as=require(_0x4b0e('0x12'));var hardwareService=require(_0x4b0e('0x13'));var logger=require(_0x4b0e('0x14'))(_0x4b0e('0x15'));var utils=require(_0x4b0e('0x16'));var config=require(_0x4b0e('0x17'));var licenseUtil=require(_0x4b0e('0x18'));var db=require(_0x4b0e('0x19'))['db'];function respondWithStatusCode(_0x5a306b,_0x18702e){_0x18702e=_0x18702e||0xcc;return function(_0x5a4a31){if(_0x5a4a31){return _0x5a306b[_0x4b0e('0x1a')](_0x18702e);}return _0x5a306b[_0x4b0e('0x1b')](_0x18702e)[_0x4b0e('0x1c')]();};}function respondWithResult(_0x2b4fec,_0x23b697){_0x23b697=_0x23b697||0xc8;return function(_0x44040b){if(_0x44040b){return _0x2b4fec[_0x4b0e('0x1b')](_0x23b697)['json'](_0x44040b);}};}function respondWithFilteredResult(_0x19f1a1,_0x242060){return function(_0x93f233){if(_0x93f233){var _0x5359c6=typeof _0x242060[_0x4b0e('0x1d')]===_0x4b0e('0x1e')&&typeof _0x242060[_0x4b0e('0x1f')]===_0x4b0e('0x1e');var _0x577a21=_0x93f233['count'];var _0x166edd=_0x5359c6?0x0:_0x242060[_0x4b0e('0x1d')];var _0x342bdd=_0x5359c6?_0x93f233['count']:_0x242060['offset']+_0x242060[_0x4b0e('0x1f')];var _0x312ba6;if(_0x342bdd>=_0x577a21){_0x342bdd=_0x577a21;_0x312ba6=0xc8;}else{_0x312ba6=0xce;}_0x19f1a1['status'](_0x312ba6);return _0x19f1a1[_0x4b0e('0x20')](_0x4b0e('0x21'),_0x166edd+'-'+_0x342bdd+'/'+_0x577a21)[_0x4b0e('0x22')](_0x93f233);}return null;};}function patchUpdates(_0x7c8b11){return function(_0x227075){try{jsonpatch[_0x4b0e('0x23')](_0x227075,_0x7c8b11,!![]);}catch(_0x163d29){return BPromise[_0x4b0e('0x24')](_0x163d29);}return _0x227075[_0x4b0e('0x25')]();};}function saveUpdates(_0x4daa9e,_0x294482){return function(_0x1cb238){if(_0x1cb238){return _0x1cb238[_0x4b0e('0x26')](_0x4daa9e)[_0x4b0e('0x27')](function(_0x588ea4){return _0x588ea4;});}return null;};}function removeEntity(_0x3275d3,_0x240a48){return function(_0x21560a){if(_0x21560a){return _0x21560a[_0x4b0e('0x28')]()[_0x4b0e('0x27')](function(){_0x3275d3['status'](0xcc)[_0x4b0e('0x1c')]();});}};}function handleEntityNotFound(_0x4de021,_0x38af17){return function(_0x14677e){if(!_0x14677e){_0x4de021['sendStatus'](0x194);}return _0x14677e;};}function handleError(_0x3b56cb,_0x1ea91d){_0x1ea91d=_0x1ea91d||0x1f4;return function(_0x542c6c){logger['error'](_0x542c6c[_0x4b0e('0x29')]);if(_0x542c6c['name']){delete _0x542c6c['name'];}_0x3b56cb[_0x4b0e('0x1b')](_0x1ea91d)[_0x4b0e('0x2a')](_0x542c6c);};}exports[_0x4b0e('0x2b')]=function(_0x54ac75,_0x43e1e9){var _0x3b3630={},_0x2e0bf5={},_0x47c558={'count':0x0,'rows':[]};var _0x391c0a=_[_0x4b0e('0x2c')](db[_0x4b0e('0x2d')]['rawAttributes'],function(_0x1b35e1){return{'name':_0x1b35e1[_0x4b0e('0x2e')],'type':_0x1b35e1['type'][_0x4b0e('0x2f')]};});_0x2e0bf5['model']=_['map'](_0x391c0a,_0x4b0e('0x30'));_0x2e0bf5['query']=_[_0x4b0e('0x31')](_0x54ac75[_0x4b0e('0x32')]);_0x2e0bf5[_0x4b0e('0x33')]=_['intersection'](_0x2e0bf5['model'],_0x2e0bf5['query']);_0x3b3630[_0x4b0e('0x34')]=_[_0x4b0e('0x35')](_0x2e0bf5[_0x4b0e('0x36')],qs[_0x4b0e('0x37')](_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x37')]));_0x3b3630[_0x4b0e('0x34')]=_0x3b3630['attributes'][_0x4b0e('0x38')]?_0x3b3630['attributes']:_0x2e0bf5['model'];if(!_0x54ac75['query']['hasOwnProperty'](_0x4b0e('0x39'))){_0x3b3630['limit']=qs['limit'](_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x1f')]);_0x3b3630['offset']=qs[_0x4b0e('0x1d')](_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x1d')]);}_0x3b3630['order']=qs[_0x4b0e('0x3a')](_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x3a')]);_0x3b3630['where']=qs[_0x4b0e('0x33')](_[_0x4b0e('0x3b')](_0x54ac75[_0x4b0e('0x32')],_0x2e0bf5[_0x4b0e('0x33')]),_0x391c0a);if(_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x3c')]){_0x3b3630['where']=_[_0x4b0e('0x3d')](_0x3b3630[_0x4b0e('0x3e')],{'$or':_[_0x4b0e('0x2c')](_0x391c0a,function(_0x452254){if(_0x452254[_0x4b0e('0x3f')]!==_0x4b0e('0x40')){var _0x13df84={};_0x13df84[_0x452254[_0x4b0e('0x30')]]={'$like':'%'+_0x54ac75['query'][_0x4b0e('0x3c')]+'%'};return _0x13df84;}})});}_0x3b3630=_[_0x4b0e('0x3d')]({},_0x3b3630,_0x54ac75[_0x4b0e('0x41')]);var _0x52e66e={'where':_0x3b3630[_0x4b0e('0x3e')]};return db['SquareDetailsReport'][_0x4b0e('0x42')](_0x52e66e)[_0x4b0e('0x27')](function(_0x444e1b){_0x47c558[_0x4b0e('0x42')]=_0x444e1b;if(_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x43')]){_0x3b3630[_0x4b0e('0x44')]=[{'all':!![]}];}return db[_0x4b0e('0x2d')][_0x4b0e('0x45')](_0x3b3630);})[_0x4b0e('0x27')](function(_0x27d626){_0x47c558[_0x4b0e('0x46')]=_0x27d626;return _0x47c558;})['then'](respondWithFilteredResult(_0x43e1e9,_0x3b3630))[_0x4b0e('0x47')](handleError(_0x43e1e9,null));};exports['show']=function(_0x3ba17d,_0x39feb9){var _0x159777={'raw':!![],'where':{'id':_0x3ba17d[_0x4b0e('0x48')]['id']}},_0x1db9f8={};_0x1db9f8[_0x4b0e('0x36')]=_[_0x4b0e('0x31')](db[_0x4b0e('0x2d')][_0x4b0e('0x49')]);_0x1db9f8['query']=_['keys'](_0x3ba17d[_0x4b0e('0x32')]);_0x1db9f8[_0x4b0e('0x33')]=_[_0x4b0e('0x35')](_0x1db9f8['model'],_0x1db9f8[_0x4b0e('0x32')]);_0x159777['attributes']=_[_0x4b0e('0x35')](_0x1db9f8[_0x4b0e('0x36')],qs[_0x4b0e('0x37')](_0x3ba17d[_0x4b0e('0x32')][_0x4b0e('0x37')]));_0x159777[_0x4b0e('0x34')]=_0x159777[_0x4b0e('0x34')][_0x4b0e('0x38')]?_0x159777[_0x4b0e('0x34')]:_0x1db9f8['model'];if(_0x3ba17d[_0x4b0e('0x32')][_0x4b0e('0x43')]){_0x159777[_0x4b0e('0x44')]=[{'all':!![]}];}_0x159777=_[_0x4b0e('0x3d')]({},_0x159777,_0x3ba17d['options']);return db['SquareDetailsReport']['find'](_0x159777)['then'](handleEntityNotFound(_0x39feb9,null))['then'](respondWithResult(_0x39feb9,null))[_0x4b0e('0x47')](handleError(_0x39feb9,null));};exports[_0x4b0e('0x4a')]=function(_0x2da7be,_0x5bae66){return db[_0x4b0e('0x2d')]['create'](_0x2da7be[_0x4b0e('0x4b')],{})[_0x4b0e('0x27')](respondWithResult(_0x5bae66,0xc9))[_0x4b0e('0x47')](handleError(_0x5bae66,null));};exports['update']=function(_0x4730a5,_0x31c104){if(_0x4730a5[_0x4b0e('0x4b')]['id']){delete _0x4730a5['body']['id'];}return db[_0x4b0e('0x2d')][_0x4b0e('0x4c')]({'where':{'id':_0x4730a5[_0x4b0e('0x48')]['id']}})[_0x4b0e('0x27')](handleEntityNotFound(_0x31c104,null))['then'](saveUpdates(_0x4730a5[_0x4b0e('0x4b')],null))[_0x4b0e('0x27')](respondWithResult(_0x31c104,null))[_0x4b0e('0x47')](handleError(_0x31c104,null));};exports[_0x4b0e('0x28')]=function(_0x2eae1f,_0x46b55f){return db[_0x4b0e('0x2d')][_0x4b0e('0x4c')]({'where':{'id':_0x2eae1f[_0x4b0e('0x48')]['id']}})[_0x4b0e('0x27')](handleEntityNotFound(_0x46b55f,null))[_0x4b0e('0x27')](removeEntity(_0x46b55f,null))[_0x4b0e('0x47')](handleError(_0x46b55f,null));};exports[_0x4b0e('0x4d')]=function(_0x5cc78d,_0x317028){return db[_0x4b0e('0x2d')][_0x4b0e('0x4d')]()[_0x4b0e('0x27')](respondWithResult(_0x317028,null))['catch'](handleError(_0x317028,null));};
\ No newline at end of file
index 9acc773..0b1b3ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15cc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','util'];(function(_0x18f8b3,_0x4702d6){var _0x48a302=function(_0x117919){while(--_0x117919){_0x18f8b3['push'](_0x18f8b3['shift']());}};_0x48a302(++_0x4702d6);}(_0x15cc,0x144));var _0xc15c=function(_0xb71c35,_0x129343){_0xb71c35=_0xb71c35-0x0;var _0x39224f=_0x15cc[_0xb71c35];return _0x39224f;};'use strict';var _=require('lodash');var util=require(_0xc15c('0x0'));var logger=require(_0xc15c('0x1'))(_0xc15c('0x2'));var moment=require(_0xc15c('0x3'));var BPromise=require(_0xc15c('0x4'));var rp=require(_0xc15c('0x5'));var fs=require('fs');var path=require(_0xc15c('0x6'));var rimraf=require(_0xc15c('0x7'));var config=require('../../config/environment');var attributes=require(_0xc15c('0x8'));module[_0xc15c('0x9')]=function(_0x5b2ed1,_0x4e0ba2){return _0x5b2ed1[_0xc15c('0xa')](_0xc15c('0xb'),attributes,{'tableName':_0xc15c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdf8=['rimraf','../../config/environment','exports','define','SquareDetailsReport','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0xc76ae7,_0x1428aa){var _0x128025=function(_0x4e2443){while(--_0x4e2443){_0xc76ae7['push'](_0xc76ae7['shift']());}};_0x128025(++_0x1428aa);}(_0xfdf8,0x123));var _0x8fdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdf8[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x8fdf('0x0'));var util=require(_0x8fdf('0x1'));var logger=require(_0x8fdf('0x2'))('api');var moment=require(_0x8fdf('0x3'));var BPromise=require(_0x8fdf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fdf('0x5'));var rimraf=require(_0x8fdf('0x6'));var config=require(_0x8fdf('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x8fdf('0x8')]=function(_0x3f134e,_0x3fedf6){return _0x3f134e[_0x8fdf('0x9')](_0x8fdf('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bfc70b2..59ef6fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2884=['then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','body','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x1c14ae,_0x782f15){var _0x256af4=function(_0x48e128){while(--_0x48e128){_0x1c14ae['push'](_0x1c14ae['shift']());}};_0x256af4(++_0x782f15);}(_0x2884,0x1eb));var _0x4288=function(_0x2d3206,_0x434cf5){_0x2d3206=_0x2d3206-0x0;var _0x18702d=_0x2884[_0x2d3206];return _0x18702d;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526a07,_0x3a930e,_0x5e4cfc){return new BPromise(function(_0x25023a,_0x237b02){return client['request'](_0x526a07,_0x5e4cfc)[_0x4288('0x9')](function(_0x3c8d6e){logger[_0x4288('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a930e,'request\x20sent');logger[_0x4288('0xb')](_0x4288('0xc'),_0x3a930e,_0x4288('0xd'),JSON[_0x4288('0xe')](_0x3c8d6e));if(_0x3c8d6e[_0x4288('0xf')]){if(_0x3c8d6e[_0x4288('0xf')][_0x4288('0x10')]===0x1f4){logger['error'](_0x4288('0x11'),_0x3a930e,_0x3c8d6e[_0x4288('0xf')][_0x4288('0x12')]);return _0x237b02(_0x3c8d6e[_0x4288('0xf')]['message']);}logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x3c8d6e['error'][_0x4288('0x12')]);return _0x25023a(_0x3c8d6e['error'][_0x4288('0x12')]);}else{logger['info'](_0x4288('0x11'),_0x3a930e,_0x4288('0xd'));_0x25023a(_0x3c8d6e[_0x4288('0x13')][_0x4288('0x12')]);}})[_0x4288('0x14')](function(_0x1db33b){logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x1db33b);_0x237b02(_0x1db33b);});});}exports[_0x4288('0x15')]=function(_0x53fb81){var _0x199919=this;return new Promise(function(_0xde03f4,_0x5e6de1){return db['SquareDetailsReport']['create'](_0x53fb81[_0x4288('0x16')],{'raw':_0x53fb81[_0x4288('0x17')]?_0x53fb81['options'][_0x4288('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x865365){logger[_0x4288('0xa')](_0x4288('0x15'),_0x53fb81);logger['debug'](_0x4288('0x15'),_0x53fb81,JSON[_0x4288('0xe')](_0x865365));_0xde03f4(_0x865365);})[_0x4288('0x14')](function(_0x4b9cda){logger['error'](_0x4288('0x15'),_0x4b9cda[_0x4288('0x12')],_0x53fb81);_0x5e6de1(_0x199919[_0x4288('0xf')](0x1f4,_0x4b9cda[_0x4288('0x12')]));});});};
\ No newline at end of file
+var _0x594d=['then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','create','options','raw','CreateSquareDetailsReport','stringify','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x788ccb,_0x1e422f){var _0x1c9d99=function(_0x2d3ca7){while(--_0x2d3ca7){_0x788ccb['push'](_0x788ccb['shift']());}};_0x1c9d99(++_0x1e422f);}(_0x594d,0x92));var _0xd594=function(_0x18ccd4,_0x8bf39a){_0x18ccd4=_0x18ccd4-0x0;var _0x56d0fb=_0x594d[_0x18ccd4];return _0x56d0fb;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd594('0x4'));var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd594('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1c64,_0x446711,_0xeedad0){return new BPromise(function(_0x20325a,_0x20718a){return client[_0xd594('0x9')](_0x3b1c64,_0xeedad0)[_0xd594('0xa')](function(_0xf3043e){logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');logger[_0xd594('0xd')](_0xd594('0xe'),_0x446711,_0xd594('0xf'),JSON['stringify'](_0xf3043e));if(_0xf3043e[_0xd594('0x10')]){if(_0xf3043e[_0xd594('0x10')][_0xd594('0x11')]===0x1f4){logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e[_0xd594('0x10')][_0xd594('0x12')]);return _0x20718a(_0xf3043e['error']['message']);}logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e['error'][_0xd594('0x12')]);return _0x20325a(_0xf3043e['error'][_0xd594('0x12')]);}else{logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');_0x20325a(_0xf3043e[_0xd594('0x13')]['message']);}})['catch'](function(_0x2a5f17){logger[_0xd594('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x446711,_0x2a5f17);_0x20718a(_0x2a5f17);});});}exports['CreateSquareDetailsReport']=function(_0x232776){var _0x4ea0d5=this;return new Promise(function(_0x54f640,_0x3ae9be){return db['SquareDetailsReport'][_0xd594('0x14')](_0x232776['body'],{'raw':_0x232776[_0xd594('0x15')]?_0x232776['options'][_0xd594('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3b0fda){logger[_0xd594('0xb')](_0xd594('0x17'),_0x232776);logger[_0xd594('0xd')](_0xd594('0x17'),_0x232776,JSON[_0xd594('0x18')](_0x3b0fda));_0x54f640(_0x3b0fda);})[_0xd594('0x19')](function(_0x2b8495){logger[_0xd594('0x10')](_0xd594('0x17'),_0x2b8495[_0xd594('0x12')],_0x232776);_0x3ae9be(_0x4ea0d5[_0xd594('0x10')](0x1f4,_0x2b8495[_0xd594('0x12')]));});});};
\ No newline at end of file
index 05ade29..ea5fdb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb41=['killProcess','exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated','get','/process/:pid/kill'];(function(_0x5b19f9,_0x5752ab){var _0x541c23=function(_0x5c641d){while(--_0x5c641d){_0x5b19f9['push'](_0x5b19f9['shift']());}};_0x541c23(++_0x5752ab);}(_0xcb41,0x1df));var _0x1cb4=function(_0x32e816,_0xdc61f6){_0x32e816=_0x32e816-0x0;var _0x41a7a3=_0xcb41[_0x32e816];return _0x41a7a3;};'use strict';var express=require(_0x1cb4('0x0'));var router=express[_0x1cb4('0x1')]();var auth=require(_0x1cb4('0x2'));var controller=require(_0x1cb4('0x3'));router['get']('/',auth[_0x1cb4('0x4')](),controller['index']);router[_0x1cb4('0x5')](_0x1cb4('0x6'),auth[_0x1cb4('0x4')](),controller[_0x1cb4('0x7')]);module[_0x1cb4('0x8')]=router;
\ No newline at end of file
+var _0xc6f1=['killProcess','express','Router','get','/process/:pid/kill','isAuthenticated'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc6f1,0x133));var _0x1c6f=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0xc6f1[_0x3cb152];return _0x4f54c3;};'use strict';var express=require(_0x1c6f('0x0'));var router=express[_0x1c6f('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x1c6f('0x2')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1c6f('0x3'),auth[_0x1c6f('0x4')](),controller[_0x1c6f('0x5')]);module['exports']=router;
\ No newline at end of file
index b09bcd7..dacd4db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb774=['json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData'];(function(_0x430cb0,_0x860700){var _0x4e21d5=function(_0x1369fd){while(--_0x1369fd){_0x430cb0['push'](_0x430cb0['shift']());}};_0x4e21d5(++_0x860700);}(_0xb774,0x15a));var _0x4b77=function(_0x1c2cd8,_0x35a443){_0x1c2cd8=_0x1c2cd8-0x0;var _0x3fc7c5=_0xb774[_0x1c2cd8];return _0x3fc7c5;};'use strict';var info=require(_0x4b77('0x0'));var exec=require(_0x4b77('0x1'))[_0x4b77('0x2')];var logger=require('../../config/logger')('api');var util=require(_0x4b77('0x3'));var BPromise=require(_0x4b77('0x4'));var _=require(_0x4b77('0x5'));function handleError(_0x28a8e9,_0x5a2944,_0x410690){_0x5a2944=_0x5a2944||0x1f4;return function(_0x3d61d8){logger[_0x4b77('0x6')](_0x4b77('0x7'),_0x410690,_0x5a2944,util[_0x4b77('0x8')](_0x3d61d8,{'showHidden':![],'depth':null}));delete _0x3d61d8[_0x4b77('0x9')];_0x28a8e9[_0x4b77('0xa')](_0x5a2944)[_0x4b77('0xb')](_0x3d61d8);};}exports[_0x4b77('0xc')]=function(_0x29c3bf,_0x2bbb1a){return info[_0x4b77('0xd')]()['then'](function(_0x1d9045){return _0x2bbb1a[_0x4b77('0xa')](0xc8)[_0x4b77('0xe')](_0x1d9045);})[_0x4b77('0xf')](function(_0x178023){return _0x2bbb1a[_0x4b77('0xa')](0x1f4)['json'](_0x178023);});};exports[_0x4b77('0x10')]=function(_0x45c7f9,_0x31d5b7){var _0x56dcbe=[_0x4b77('0x11')];return new BPromise(function(_0x3d108c,_0xbec9e0){return exec(util[_0x4b77('0x12')](_0x4b77('0x13'),_0x45c7f9[_0x4b77('0x14')][_0x4b77('0x15')]),function(_0x231e25,_0x2acf29,_0x3c3b8c){if(_0x231e25){return _0xbec9e0(_0x231e25);}return _0x3d108c(_0x2acf29);});})[_0x4b77('0x16')](function(_0x3b3545){var _0x1ba1a4=![];var _0x4dc61b=_0x3b3545[_0x4b77('0x17')](/\n/);for(var _0x4369e9=0x0,_0x38a948=_0x56dcbe[_0x4b77('0x18')];_0x4369e9<_0x38a948,_0x1ba1a4===![];_0x4369e9+=0x1){if(_0x3b3545[_0x4b77('0x19')](_0x56dcbe[_0x4369e9])>=0x0){_0x1ba1a4=!![];}}if(!_0x1ba1a4){throw new Error(util[_0x4b77('0x12')](_0x4b77('0x1a'),_0x45c7f9['params']['pid']));}process[_0x4b77('0x1b')](_0x45c7f9[_0x4b77('0x14')]['pid'],_0x4b77('0x1c'));return _0x31d5b7[_0x4b77('0xa')](0xc8)[_0x4b77('0xe')]({'message':util[_0x4b77('0x12')](_0x4b77('0x1d'),_0x45c7f9['params']['pid'])});})[_0x4b77('0xf')](handleError(_0x31d5b7,null,_0x4b77('0x10')));};
\ No newline at end of file
+var _0xfab5=['split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','../../config/logger','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','then','json','killProcess','format','params','pid'];(function(_0xa32db1,_0x9fcec5){var _0x34f30b=function(_0x16866b){while(--_0x16866b){_0xa32db1['push'](_0xa32db1['shift']());}};_0x34f30b(++_0x9fcec5);}(_0xfab5,0xe9));var _0x5fab=function(_0x3d7a9e,_0x1686d7){_0x3d7a9e=_0x3d7a9e-0x0;var _0x28c9b8=_0xfab5[_0x3d7a9e];return _0x28c9b8;};'use strict';var info=require(_0x5fab('0x0'));var exec=require(_0x5fab('0x1'))['exec'];var logger=require(_0x5fab('0x2'))('api');var util=require(_0x5fab('0x3'));var BPromise=require(_0x5fab('0x4'));var _=require(_0x5fab('0x5'));function handleError(_0x51cf28,_0x26d5ef,_0x2088c7){_0x26d5ef=_0x26d5ef||0x1f4;return function(_0x310fc4){logger['error'](_0x5fab('0x6'),_0x2088c7,_0x26d5ef,util[_0x5fab('0x7')](_0x310fc4,{'showHidden':![],'depth':null}));delete _0x310fc4[_0x5fab('0x8')];_0x51cf28[_0x5fab('0x9')](_0x26d5ef)['send'](_0x310fc4);};}exports[_0x5fab('0xa')]=function(_0x33caff,_0x45b158){return info['getAllData']()[_0x5fab('0xb')](function(_0x29396a){return _0x45b158['status'](0xc8)[_0x5fab('0xc')](_0x29396a);})['catch'](function(_0x23640a){return _0x45b158[_0x5fab('0x9')](0x1f4)[_0x5fab('0xc')](_0x23640a);});};exports[_0x5fab('0xd')]=function(_0x3bbd51,_0x3b8e2b){var _0x132dfe=['components/import/cm'];return new BPromise(function(_0x2b1665,_0x9bf43){return exec(util[_0x5fab('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x3bbd51[_0x5fab('0xf')][_0x5fab('0x10')]),function(_0x108da9,_0x59fcfa,_0x4e63b7){if(_0x108da9){return _0x9bf43(_0x108da9);}return _0x2b1665(_0x59fcfa);});})['then'](function(_0x1766a4){var _0x1be0a4=![];var _0x15eabb=_0x1766a4[_0x5fab('0x11')](/\n/);for(var _0x3dd093=0x0,_0x5c0505=_0x132dfe[_0x5fab('0x12')];_0x3dd093<_0x5c0505,_0x1be0a4===![];_0x3dd093+=0x1){if(_0x1766a4[_0x5fab('0x13')](_0x132dfe[_0x3dd093])>=0x0){_0x1be0a4=!![];}}if(!_0x1be0a4){throw new Error(util[_0x5fab('0xe')](_0x5fab('0x14'),_0x3bbd51['params'][_0x5fab('0x10')]));}process[_0x5fab('0x15')](_0x3bbd51[_0x5fab('0xf')][_0x5fab('0x10')],_0x5fab('0x16'));return _0x3b8e2b[_0x5fab('0x9')](0xc8)[_0x5fab('0xc')]({'message':util[_0x5fab('0xe')](_0x5fab('0x17'),_0x3bbd51['params'][_0x5fab('0x10')])});})[_0x5fab('0x18')](handleError(_0x3b8e2b,null,'killProcess'));};
\ No newline at end of file
index e8c577a..1b0c006 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59ac=['index','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated'];(function(_0x5763a9,_0x5699e3){var _0x5386fc=function(_0xd4821){while(--_0xd4821){_0x5763a9['push'](_0x5763a9['shift']());}};_0x5386fc(++_0x5699e3);}(_0x59ac,0x73));var _0xc59a=function(_0x25cedc,_0x20c76f){_0x25cedc=_0x25cedc-0x0;var _0xbbfe8f=_0x59ac[_0x25cedc];return _0xbbfe8f;};'use strict';var multer=require(_0xc59a('0x0'));var util=require(_0xc59a('0x1'));var path=require(_0xc59a('0x2'));var timeout=require(_0xc59a('0x3'));var express=require(_0xc59a('0x4'));var router=express['Router']();var fs_extra=require(_0xc59a('0x5'));var auth=require(_0xc59a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc59a('0x7'));var controller=require(_0xc59a('0x8'));router[_0xc59a('0x9')]('/',auth[_0xc59a('0xa')](),controller[_0xc59a('0xb')]);router['get'](_0xc59a('0xc'),auth['isAuthenticated'](),controller[_0xc59a('0xd')]);router['post']('/',auth[_0xc59a('0xa')](),controller['create']);router[_0xc59a('0xe')]('/:id',auth[_0xc59a('0xa')](),controller['update']);router[_0xc59a('0xf')]('/:id',auth[_0xc59a('0xa')](),controller[_0xc59a('0x10')]);module[_0xc59a('0x11')]=router;
\ No newline at end of file
+var _0x8c7d=['put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','post'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x8c7d,0xe1));var _0xd8c7=function(_0x5fb6c7,_0x5bb772){_0x5fb6c7=_0x5fb6c7-0x0;var _0x250d8f=_0x8c7d[_0x5fb6c7];return _0x250d8f;};'use strict';var multer=require(_0xd8c7('0x0'));var util=require('util');var path=require(_0xd8c7('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8c7('0x2'));var router=express[_0xd8c7('0x3')]();var fs_extra=require(_0xd8c7('0x4'));var auth=require(_0xd8c7('0x5'));var interaction=require(_0xd8c7('0x6'));var config=require(_0xd8c7('0x7'));var controller=require(_0xd8c7('0x8'));router[_0xd8c7('0x9')]('/',auth[_0xd8c7('0xa')](),controller['index']);router['get'](_0xd8c7('0xb'),auth[_0xd8c7('0xa')](),controller['show']);router[_0xd8c7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd8c7('0xd')](_0xd8c7('0xb'),auth[_0xd8c7('0xa')](),controller[_0xd8c7('0xe')]);router['delete'](_0xd8c7('0xb'),auth['isAuthenticated'](),controller[_0xd8c7('0xf')]);module[_0xd8c7('0x10')]=router;
\ No newline at end of file
index da6454b..0fb0c82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c1b=['#0091EA','sequelize','exports','STRING','name'];(function(_0x295572,_0x58a177){var _0x285bef=function(_0x3d284e){while(--_0x3d284e){_0x295572['push'](_0x295572['shift']());}};_0x285bef(++_0x58a177);}(_0x2c1b,0xb0));var _0xb2c1=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x2c1b[_0x2ed8f3];return _0x525a55;};'use strict';var Sequelize=require(_0xb2c1('0x0'));module[_0xb2c1('0x1')]={'name':{'type':Sequelize[_0xb2c1('0x2')],'unique':_0xb2c1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb2c1('0x2')],'defaultValue':_0xb2c1('0x4')},'description':{'type':Sequelize[_0xb2c1('0x2')]}};
\ No newline at end of file
+var _0x0e21=['exports','STRING','name','#0091EA'];(function(_0xd95342,_0xb75bf6){var _0x54d694=function(_0x1190c1){while(--_0x1190c1){_0xd95342['push'](_0xd95342['shift']());}};_0x54d694(++_0xb75bf6);}(_0x0e21,0xe8));var _0x10e2=function(_0x5e4be2,_0x4d7944){_0x5e4be2=_0x5e4be2-0x0;var _0x2e223c=_0x0e21[_0x5e4be2];return _0x2e223c;};'use strict';var Sequelize=require('sequelize');module[_0x10e2('0x0')]={'name':{'type':Sequelize[_0x10e2('0x1')],'unique':_0x10e2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x10e2('0x3')},'description':{'type':Sequelize[_0x10e2('0x1')]}};
\ No newline at end of file
index ca64ed0..36685e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['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','count','limit','set','Content-Range','apply','update','destroy','then','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','params','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','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x35665d,_0x30573a){var _0x25d130=function(_0x4a29a6){while(--_0x4a29a6){_0x35665d['push'](_0x35665d['shift']());}};_0x25d130(++_0x30573a);}(_0x668b,0x140));var _0xb668=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x668b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xb668('0x0'));var rimraf=require(_0xb668('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb668('0x2'));var rp=require(_0xb668('0x3'));var moment=require('moment');var BPromise=require(_0xb668('0x4'));var Mustache=require('mustache');var util=require(_0xb668('0x5'));var path=require(_0xb668('0x6'));var sox=require(_0xb668('0x7'));var csv=require('to-csv');var ejs=require(_0xb668('0x8'));var fs=require('fs');var fs_extra=require(_0xb668('0x9'));var _=require(_0xb668('0xa'));var squel=require(_0xb668('0xb'));var crypto=require(_0xb668('0xc'));var jsforce=require(_0xb668('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb668('0xe'));var querystring=require(_0xb668('0xf'));var Papa=require(_0xb668('0x10'));var Redis=require(_0xb668('0x11'));var authService=require(_0xb668('0x12'));var qs=require(_0xb668('0x13'));var as=require(_0xb668('0x14'));var hardwareService=require(_0xb668('0x15'));var logger=require('../../config/logger')(_0xb668('0x16'));var utils=require(_0xb668('0x17'));var config=require(_0xb668('0x18'));var licenseUtil=require(_0xb668('0x19'));var db=require(_0xb668('0x1a'))['db'];function respondWithStatusCode(_0x167057,_0x1d111a){_0x1d111a=_0x1d111a||0xcc;return function(_0x10ed24){if(_0x10ed24){return _0x167057[_0xb668('0x1b')](_0x1d111a);}return _0x167057[_0xb668('0x1c')](_0x1d111a)[_0xb668('0x1d')]();};}function respondWithResult(_0x3b7556,_0x3aed25){_0x3aed25=_0x3aed25||0xc8;return function(_0xd0450f){if(_0xd0450f){return _0x3b7556[_0xb668('0x1c')](_0x3aed25)[_0xb668('0x1e')](_0xd0450f);}};}function respondWithFilteredResult(_0x1ca6e7,_0x222cad){return function(_0x4fa32a){if(_0x4fa32a){var _0x4a755b=typeof _0x222cad[_0xb668('0x1f')]===_0xb668('0x20')&&typeof _0x222cad['limit']===_0xb668('0x20');var _0x567ad7=_0x4fa32a[_0xb668('0x21')];var _0x89fe72=_0x4a755b?0x0:_0x222cad['offset'];var _0x38595d=_0x4a755b?_0x4fa32a[_0xb668('0x21')]:_0x222cad['offset']+_0x222cad[_0xb668('0x22')];var _0x5b31ab;if(_0x38595d>=_0x567ad7){_0x38595d=_0x567ad7;_0x5b31ab=0xc8;}else{_0x5b31ab=0xce;}_0x1ca6e7[_0xb668('0x1c')](_0x5b31ab);return _0x1ca6e7[_0xb668('0x23')](_0xb668('0x24'),_0x89fe72+'-'+_0x38595d+'/'+_0x567ad7)[_0xb668('0x1e')](_0x4fa32a);}return null;};}function patchUpdates(_0x5d33ae){return function(_0x2b7f96){try{jsonpatch[_0xb668('0x25')](_0x2b7f96,_0x5d33ae,!![]);}catch(_0x25e5be){return BPromise['reject'](_0x25e5be);}return _0x2b7f96['save']();};}function saveUpdates(_0x43a70b,_0x1e5620){return function(_0x517eee){if(_0x517eee){return _0x517eee[_0xb668('0x26')](_0x43a70b)['then'](function(_0x2f1394){return _0x2f1394;});}return null;};}function removeEntity(_0x4bd365,_0x3f4745){return function(_0x1e1c94){if(_0x1e1c94){return _0x1e1c94[_0xb668('0x27')]()[_0xb668('0x28')](function(){var _0x2a5b3d=_0x1e1c94[_0xb668('0x29')]({'plain':!![]});var _0x4d4bf8=_0xb668('0x2a');return db[_0xb668('0x2b')][_0xb668('0x27')]({'where':{'type':_0x4d4bf8,'resourceId':_0x2a5b3d['id']}})['then'](function(){return _0x1e1c94;});})['then'](function(){_0x4bd365[_0xb668('0x1c')](0xcc)[_0xb668('0x1d')]();});}};}function handleEntityNotFound(_0x30b965,_0x5a67e9){return function(_0x3a2543){if(!_0x3a2543){_0x30b965[_0xb668('0x1b')](0x194);}return _0x3a2543;};}function handleError(_0x1616e5,_0x4c78a0){_0x4c78a0=_0x4c78a0||0x1f4;return function(_0x5709e2){logger[_0xb668('0x2c')](_0x5709e2[_0xb668('0x2d')]);if(_0x5709e2['name']){delete _0x5709e2[_0xb668('0x2e')];}_0x1616e5[_0xb668('0x1c')](_0x4c78a0)[_0xb668('0x2f')](_0x5709e2);};}exports[_0xb668('0x30')]=function(_0x256a8,_0x5f36b5){var _0x138ee5={},_0x3bd27c={},_0x5dfa2c={'count':0x0,'rows':[]};var _0x28bcdd=_['map'](db[_0xb668('0x31')][_0xb668('0x32')],function(_0x467fea){return{'name':_0x467fea[_0xb668('0x33')],'type':_0x467fea[_0xb668('0x34')][_0xb668('0x35')]};});_0x3bd27c[_0xb668('0x36')]=_[_0xb668('0x37')](_0x28bcdd,_0xb668('0x2e'));_0x3bd27c['query']=_[_0xb668('0x38')](_0x256a8[_0xb668('0x39')]);_0x3bd27c[_0xb668('0x3a')]=_['intersection'](_0x3bd27c[_0xb668('0x36')],_0x3bd27c[_0xb668('0x39')]);_0x138ee5[_0xb668('0x3b')]=_[_0xb668('0x3c')](_0x3bd27c['model'],qs[_0xb668('0x3d')](_0x256a8[_0xb668('0x39')][_0xb668('0x3d')]));_0x138ee5[_0xb668('0x3b')]=_0x138ee5[_0xb668('0x3b')][_0xb668('0x3e')]?_0x138ee5[_0xb668('0x3b')]:_0x3bd27c['model'];if(!_0x256a8[_0xb668('0x39')][_0xb668('0x3f')]('nolimit')){_0x138ee5[_0xb668('0x22')]=qs['limit'](_0x256a8['query'][_0xb668('0x22')]);_0x138ee5[_0xb668('0x1f')]=qs['offset'](_0x256a8[_0xb668('0x39')]['offset']);}_0x138ee5[_0xb668('0x40')]=qs['sort'](_0x256a8['query'][_0xb668('0x41')]);_0x138ee5[_0xb668('0x42')]=qs['filters'](_['pick'](_0x256a8[_0xb668('0x39')],_0x3bd27c[_0xb668('0x3a')]),_0x28bcdd);if(_0x256a8[_0xb668('0x39')][_0xb668('0x43')]){_0x138ee5[_0xb668('0x42')]=_['merge'](_0x138ee5['where'],{'$or':_[_0xb668('0x37')](_0x28bcdd,function(_0x43e98c){if(_0x43e98c[_0xb668('0x34')]!==_0xb668('0x44')){var _0x41aeca={};_0x41aeca[_0x43e98c[_0xb668('0x2e')]]={'$like':'%'+_0x256a8['query']['filter']+'%'};return _0x41aeca;}})});}_0x138ee5=_[_0xb668('0x45')]({},_0x138ee5,_0x256a8[_0xb668('0x46')]);var _0x89956d={'where':_0x138ee5[_0xb668('0x42')]};return db[_0xb668('0x31')]['count'](_0x89956d)[_0xb668('0x28')](function(_0x429b14){_0x5dfa2c['count']=_0x429b14;if(_0x256a8[_0xb668('0x39')][_0xb668('0x47')]){_0x138ee5[_0xb668('0x48')]=[{'all':!![]}];}return db[_0xb668('0x31')]['findAll'](_0x138ee5);})['then'](function(_0x4b7192){_0x5dfa2c[_0xb668('0x49')]=_0x4b7192;return _0x5dfa2c;})['then'](respondWithFilteredResult(_0x5f36b5,_0x138ee5))['catch'](handleError(_0x5f36b5,null));};exports['show']=function(_0x50ffe0,_0x467ac9){var _0x4874a8={'raw':!![],'where':{'id':_0x50ffe0[_0xb668('0x4a')]['id']}},_0x14b269={};_0x14b269[_0xb668('0x36')]=_[_0xb668('0x38')](db[_0xb668('0x31')]['rawAttributes']);_0x14b269[_0xb668('0x39')]=_[_0xb668('0x38')](_0x50ffe0[_0xb668('0x39')]);_0x14b269[_0xb668('0x3a')]=_[_0xb668('0x3c')](_0x14b269[_0xb668('0x36')],_0x14b269[_0xb668('0x39')]);_0x4874a8[_0xb668('0x3b')]=_[_0xb668('0x3c')](_0x14b269[_0xb668('0x36')],qs[_0xb668('0x3d')](_0x50ffe0['query'][_0xb668('0x3d')]));_0x4874a8[_0xb668('0x3b')]=_0x4874a8[_0xb668('0x3b')]['length']?_0x4874a8['attributes']:_0x14b269[_0xb668('0x36')];if(_0x50ffe0['query'][_0xb668('0x47')]){_0x4874a8['include']=[{'all':!![]}];}_0x4874a8=_['merge']({},_0x4874a8,_0x50ffe0['options']);return db[_0xb668('0x31')][_0xb668('0x4b')](_0x4874a8)['then'](handleEntityNotFound(_0x467ac9,null))[_0xb668('0x28')](respondWithResult(_0x467ac9,null))[_0xb668('0x4c')](handleError(_0x467ac9,null));};exports[_0xb668('0x4d')]=function(_0x1b649f,_0x16d06f){return db[_0xb668('0x31')][_0xb668('0x4d')](_0x1b649f[_0xb668('0x4e')],{})[_0xb668('0x28')](function(_0x4065f7){var _0x4e0628=_0x1b649f[_0xb668('0x4f')][_0xb668('0x29')]({'plain':!![]});if(!_0x4e0628)throw new Error(_0xb668('0x50'));if(_0x4e0628[_0xb668('0x51')]===_0xb668('0x4f')){var _0x3da9ba=_0x4065f7[_0xb668('0x29')]({'plain':!![]});var _0x1bff79=_0xb668('0x2a');return db['UserProfileSection'][_0xb668('0x4b')]({'where':{'name':_0x1bff79,'userProfileId':_0x4e0628[_0xb668('0x52')]},'raw':!![]})[_0xb668('0x28')](function(_0x4c9eab){if(_0x4c9eab&&_0x4c9eab['autoAssociation']===0x0){return db[_0xb668('0x2b')][_0xb668('0x4d')]({'name':_0x3da9ba[_0xb668('0x2e')],'resourceId':_0x3da9ba['id'],'type':_0x4c9eab['name'],'sectionId':_0x4c9eab['id']},{})[_0xb668('0x28')](function(){return _0x4065f7;});}else{return _0x4065f7;}})['catch'](function(_0x51a5d3){logger[_0xb668('0x2c')](_0xb668('0x53'),_0x51a5d3);throw _0x51a5d3;});}return _0x4065f7;})[_0xb668('0x28')](respondWithResult(_0x16d06f,0xc9))[_0xb668('0x4c')](handleError(_0x16d06f,null));};exports[_0xb668('0x26')]=function(_0x42b306,_0x40f9a0){if(_0x42b306[_0xb668('0x4e')]['id']){delete _0x42b306[_0xb668('0x4e')]['id'];}return db[_0xb668('0x31')][_0xb668('0x4b')]({'where':{'id':_0x42b306[_0xb668('0x4a')]['id']}})[_0xb668('0x28')](handleEntityNotFound(_0x40f9a0,null))[_0xb668('0x28')](saveUpdates(_0x42b306[_0xb668('0x4e')],null))[_0xb668('0x28')](respondWithResult(_0x40f9a0,null))[_0xb668('0x4c')](handleError(_0x40f9a0,null));};exports[_0xb668('0x27')]=function(_0x414660,_0x3b4fd5){return db[_0xb668('0x31')][_0xb668('0x4b')]({'where':{'id':_0x414660[_0xb668('0x4a')]['id']}})[_0xb668('0x28')](handleEntityNotFound(_0x3b4fd5,null))[_0xb668('0x28')](removeEntity(_0x3b4fd5,null))[_0xb668('0x4c')](handleError(_0x3b4fd5,null));};
\ No newline at end of file
+var _0x9c44=['update','destroy','get','UserProfileResource','then','sendStatus','error','stack','name','send','index','Tag','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','keys','include','find','catch','create','body','user','Tags','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3365a7,_0x180fd5){var _0x23a58c=function(_0x3befe2){while(--_0x3befe2){_0x3365a7['push'](_0x3365a7['shift']());}};_0x23a58c(++_0x180fd5);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){var _0x5850f2=_0x26c640[_0x49c4('0x24')]({'plain':!![]});var _0x9cb797='Tags';return db[_0x49c4('0x25')][_0x49c4('0x23')]({'where':{'type':_0x9cb797,'resourceId':_0x5850f2['id']}})[_0x49c4('0x26')](function(){return _0x26c640;});})[_0x49c4('0x26')](function(){_0x2263ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x449960,_0x53c199){return function(_0x3800b7){if(!_0x3800b7){_0x449960[_0x49c4('0x27')](0x194);}return _0x3800b7;};}function handleError(_0x3f1708,_0x372a47){_0x372a47=_0x372a47||0x1f4;return function(_0x5987ae){logger[_0x49c4('0x28')](_0x5987ae[_0x49c4('0x29')]);if(_0x5987ae[_0x49c4('0x2a')]){delete _0x5987ae[_0x49c4('0x2a')];}_0x3f1708[_0x49c4('0x16')](_0x372a47)[_0x49c4('0x2b')](_0x5987ae);};}exports[_0x49c4('0x2c')]=function(_0x427b26,_0x17b50f){var _0x2cbd88={},_0x46f7ea={},_0x4ea6ea={'count':0x0,'rows':[]};var _0x4f4495=_['map'](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x1eb035){return{'name':_0x1eb035[_0x49c4('0x2f')],'type':_0x1eb035[_0x49c4('0x30')]['key']};});_0x46f7ea[_0x49c4('0x31')]=_[_0x49c4('0x32')](_0x4f4495,_0x49c4('0x2a'));_0x46f7ea[_0x49c4('0x33')]=_['keys'](_0x427b26['query']);_0x46f7ea[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x46f7ea[_0x49c4('0x31')],_0x46f7ea[_0x49c4('0x33')]);_0x2cbd88[_0x49c4('0x36')]=_['intersection'](_0x46f7ea[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x427b26[_0x49c4('0x33')]['fields']));_0x2cbd88['attributes']=_0x2cbd88[_0x49c4('0x36')][_0x49c4('0x38')]?_0x2cbd88[_0x49c4('0x36')]:_0x46f7ea[_0x49c4('0x31')];if(!_0x427b26[_0x49c4('0x33')][_0x49c4('0x39')](_0x49c4('0x3a'))){_0x2cbd88[_0x49c4('0x1b')]=qs[_0x49c4('0x1b')](_0x427b26['query'][_0x49c4('0x1b')]);_0x2cbd88['offset']=qs[_0x49c4('0x19')](_0x427b26[_0x49c4('0x33')][_0x49c4('0x19')]);}_0x2cbd88[_0x49c4('0x3b')]=qs['sort'](_0x427b26[_0x49c4('0x33')][_0x49c4('0x3c')]);_0x2cbd88[_0x49c4('0x3d')]=qs['filters'](_[_0x49c4('0x3e')](_0x427b26[_0x49c4('0x33')],_0x46f7ea[_0x49c4('0x34')]),_0x4f4495);if(_0x427b26[_0x49c4('0x33')][_0x49c4('0x3f')]){_0x2cbd88[_0x49c4('0x3d')]=_[_0x49c4('0x40')](_0x2cbd88[_0x49c4('0x3d')],{'$or':_[_0x49c4('0x32')](_0x4f4495,function(_0x2f1105){if(_0x2f1105[_0x49c4('0x30')]!=='VIRTUAL'){var _0x2d2510={};_0x2d2510[_0x2f1105[_0x49c4('0x2a')]]={'$like':'%'+_0x427b26[_0x49c4('0x33')][_0x49c4('0x3f')]+'%'};return _0x2d2510;}})});}_0x2cbd88=_[_0x49c4('0x40')]({},_0x2cbd88,_0x427b26[_0x49c4('0x41')]);var _0x1be62d={'where':_0x2cbd88[_0x49c4('0x3d')]};return db[_0x49c4('0x2d')][_0x49c4('0x1c')](_0x1be62d)[_0x49c4('0x26')](function(_0xa3d59e){_0x4ea6ea[_0x49c4('0x1c')]=_0xa3d59e;if(_0x427b26['query'][_0x49c4('0x42')]){_0x2cbd88['include']=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x43')](_0x2cbd88);})[_0x49c4('0x26')](function(_0x1480da){_0x4ea6ea[_0x49c4('0x44')]=_0x1480da;return _0x4ea6ea;})[_0x49c4('0x26')](respondWithFilteredResult(_0x17b50f,_0x2cbd88))['catch'](handleError(_0x17b50f,null));};exports['show']=function(_0x20490b,_0x1e7bdc){var _0x38349b={'raw':!![],'where':{'id':_0x20490b['params']['id']}},_0x117151={};_0x117151[_0x49c4('0x31')]=_[_0x49c4('0x45')](db[_0x49c4('0x2d')][_0x49c4('0x2e')]);_0x117151[_0x49c4('0x33')]=_[_0x49c4('0x45')](_0x20490b[_0x49c4('0x33')]);_0x117151[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x117151['model'],_0x117151[_0x49c4('0x33')]);_0x38349b['attributes']=_[_0x49c4('0x35')](_0x117151[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x20490b[_0x49c4('0x33')][_0x49c4('0x37')]));_0x38349b['attributes']=_0x38349b[_0x49c4('0x36')][_0x49c4('0x38')]?_0x38349b[_0x49c4('0x36')]:_0x117151[_0x49c4('0x31')];if(_0x20490b[_0x49c4('0x33')][_0x49c4('0x42')]){_0x38349b[_0x49c4('0x46')]=[{'all':!![]}];}_0x38349b=_['merge']({},_0x38349b,_0x20490b[_0x49c4('0x41')]);return db['Tag'][_0x49c4('0x47')](_0x38349b)[_0x49c4('0x26')](handleEntityNotFound(_0x1e7bdc,null))[_0x49c4('0x26')](respondWithResult(_0x1e7bdc,null))[_0x49c4('0x48')](handleError(_0x1e7bdc,null));};exports[_0x49c4('0x49')]=function(_0x30bea5,_0x2c6be1){return db['Tag'][_0x49c4('0x49')](_0x30bea5[_0x49c4('0x4a')],{})['then'](function(_0x1e1ac4){var _0xaece5f=_0x30bea5[_0x49c4('0x4b')][_0x49c4('0x24')]({'plain':!![]});if(!_0xaece5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaece5f['role']===_0x49c4('0x4b')){var _0x4e8221=_0x1e1ac4[_0x49c4('0x24')]({'plain':!![]});var _0x1f941f=_0x49c4('0x4c');return db[_0x49c4('0x4d')][_0x49c4('0x47')]({'where':{'name':_0x1f941f,'userProfileId':_0xaece5f[_0x49c4('0x4e')]},'raw':!![]})[_0x49c4('0x26')](function(_0x563f0b){if(_0x563f0b&&_0x563f0b[_0x49c4('0x4f')]===0x0){return db[_0x49c4('0x25')][_0x49c4('0x49')]({'name':_0x4e8221[_0x49c4('0x2a')],'resourceId':_0x4e8221['id'],'type':_0x563f0b[_0x49c4('0x2a')],'sectionId':_0x563f0b['id']},{})[_0x49c4('0x26')](function(){return _0x1e1ac4;});}else{return _0x1e1ac4;}})[_0x49c4('0x48')](function(_0x25d174){logger[_0x49c4('0x28')](_0x49c4('0x50'),_0x25d174);throw _0x25d174;});}return _0x1e1ac4;})['then'](respondWithResult(_0x2c6be1,0xc9))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x22')]=function(_0x3f9a9d,_0x527e74){if(_0x3f9a9d['body']['id']){delete _0x3f9a9d[_0x49c4('0x4a')]['id'];}return db['Tag']['find']({'where':{'id':_0x3f9a9d[_0x49c4('0x51')]['id']}})[_0x49c4('0x26')](handleEntityNotFound(_0x527e74,null))[_0x49c4('0x26')](saveUpdates(_0x3f9a9d[_0x49c4('0x4a')],null))[_0x49c4('0x26')](respondWithResult(_0x527e74,null))[_0x49c4('0x48')](handleError(_0x527e74,null));};exports[_0x49c4('0x23')]=function(_0x50798e,_0x859dde){return db[_0x49c4('0x2d')][_0x49c4('0x47')]({'where':{'id':_0x50798e[_0x49c4('0x51')]['id']}})[_0x49c4('0x26')](handleEntityNotFound(_0x859dde,null))[_0x49c4('0x26')](removeEntity(_0x859dde,null))['catch'](handleError(_0x859dde,null));};
\ No newline at end of file
index 16429f6..769dace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7ba=['./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf7ba,0x184));var _0xaf7b=function(_0xdb1f10,_0x38431c){_0xdb1f10=_0xdb1f10-0x0;var _0x2e741a=_0xf7ba[_0xdb1f10];return _0x2e741a;};'use strict';var _=require(_0xaf7b('0x0'));var util=require(_0xaf7b('0x1'));var logger=require(_0xaf7b('0x2'))('api');var moment=require(_0xaf7b('0x3'));var BPromise=require(_0xaf7b('0x4'));var rp=require(_0xaf7b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf7b('0x6'));var config=require(_0xaf7b('0x7'));var attributes=require(_0xaf7b('0x8'));module[_0xaf7b('0x9')]=function(_0x1ce087,_0x51c036){return _0x1ce087[_0xaf7b('0xa')](_0xaf7b('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3f2=['api','bluebird','request-promise','./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe3f2,0x101));var _0x2e3f=function(_0x234812,_0x24207a){_0x234812=_0x234812-0x0;var _0xf9e306=_0xe3f2[_0x234812];return _0xf9e306;};'use strict';var _=require(_0x2e3f('0x0'));var util=require(_0x2e3f('0x1'));var logger=require(_0x2e3f('0x2'))(_0x2e3f('0x3'));var moment=require('moment');var BPromise=require(_0x2e3f('0x4'));var rp=require(_0x2e3f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e3f('0x6'));module['exports']=function(_0x19756d,_0x101606){return _0x19756d[_0x2e3f('0x7')](_0x2e3f('0x8'),attributes,{'tableName':_0x2e3f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7a30c95..9d2fbc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe181=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0xe181,0x68));var _0x1e18=function(_0x3ee8b1,_0x375088){_0x3ee8b1=_0x3ee8b1-0x0;var _0x53aa77=_0xe181[_0x3ee8b1];return _0x53aa77;};'use strict';var _=require(_0x1e18('0x0'));var util=require('util');var moment=require(_0x1e18('0x1'));var BPromise=require(_0x1e18('0x2'));var rs=require(_0x1e18('0x3'));var fs=require('fs');var Redis=require(_0x1e18('0x4'));var db=require(_0x1e18('0x5'))['db'];var utils=require(_0x1e18('0x6'));var logger=require(_0x1e18('0x7'))('rpc');var config=require(_0x1e18('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x182c98,_0x46ba95,_0x25b786){return new BPromise(function(_0x9f9541,_0x398f77){return client['request'](_0x182c98,_0x25b786)[_0x1e18('0xa')](function(_0x40fda9){logger[_0x1e18('0xb')](_0x1e18('0xc'),_0x46ba95,_0x1e18('0xd'));logger[_0x1e18('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x46ba95,_0x1e18('0xd'),JSON[_0x1e18('0xf')](_0x40fda9));if(_0x40fda9[_0x1e18('0x10')]){if(_0x40fda9[_0x1e18('0x10')][_0x1e18('0x11')]===0x1f4){logger[_0x1e18('0x10')](_0x1e18('0xc'),_0x46ba95,_0x40fda9[_0x1e18('0x10')]['message']);return _0x398f77(_0x40fda9[_0x1e18('0x10')]['message']);}logger[_0x1e18('0x10')]('Tag,\x20%s,\x20%s',_0x46ba95,_0x40fda9[_0x1e18('0x10')][_0x1e18('0x12')]);return _0x9f9541(_0x40fda9[_0x1e18('0x10')][_0x1e18('0x12')]);}else{logger[_0x1e18('0xb')](_0x1e18('0xc'),_0x46ba95,_0x1e18('0xd'));_0x9f9541(_0x40fda9[_0x1e18('0x13')][_0x1e18('0x12')]);}})[_0x1e18('0x14')](function(_0x12ef98){logger[_0x1e18('0x10')](_0x1e18('0xc'),_0x46ba95,_0x12ef98);_0x398f77(_0x12ef98);});});}
\ No newline at end of file
+var _0x7a59=['debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x7a59,0x16e));var _0x97a5=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7a59[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x97a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x97a5('0x1'));var rs=require(_0x97a5('0x2'));var fs=require('fs');var Redis=require(_0x97a5('0x3'));var db=require(_0x97a5('0x4'))['db'];var utils=require(_0x97a5('0x5'));var logger=require('../../config/logger')(_0x97a5('0x6'));var config=require(_0x97a5('0x7'));var jayson=require(_0x97a5('0x8'));var client=jayson['client'][_0x97a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d32f,_0x2663b9,_0x2c0efa){return new BPromise(function(_0x27e8a6,_0x156789){return client[_0x97a5('0xa')](_0x52d32f,_0x2c0efa)['then'](function(_0x4f34e8){logger[_0x97a5('0xb')](_0x97a5('0xc'),_0x2663b9,_0x97a5('0xd'));logger[_0x97a5('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x2663b9,'request\x20sent',JSON[_0x97a5('0xf')](_0x4f34e8));if(_0x4f34e8[_0x97a5('0x10')]){if(_0x4f34e8[_0x97a5('0x10')]['code']===0x1f4){logger[_0x97a5('0x10')](_0x97a5('0xc'),_0x2663b9,_0x4f34e8['error']['message']);return _0x156789(_0x4f34e8[_0x97a5('0x10')][_0x97a5('0x11')]);}logger['error']('Tag,\x20%s,\x20%s',_0x2663b9,_0x4f34e8['error']['message']);return _0x27e8a6(_0x4f34e8[_0x97a5('0x10')][_0x97a5('0x11')]);}else{logger[_0x97a5('0xb')]('Tag,\x20%s,\x20%s',_0x2663b9,_0x97a5('0xd'));_0x27e8a6(_0x4f34e8[_0x97a5('0x12')]['message']);}})[_0x97a5('0x13')](function(_0x5ee8ca){logger[_0x97a5('0x10')]('Tag,\x20%s,\x20%s',_0x2663b9,_0x5ee8ca);_0x156789(_0x5ee8ca);});});}
\ No newline at end of file
index 81b8f55..b816cc8 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 5ad02eb..810436a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xb7e7,0x121));var _0x7b7e=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xb7e7[_0x369151];return _0x4292d5;};'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 _0xd8b0=['exports','sequelize'];(function(_0x25ef57,_0x4167c3){var _0x2857fa=function(_0x108166){while(--_0x108166){_0x25ef57['push'](_0x25ef57['shift']());}};_0x2857fa(++_0x4167c3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index a3bb7d8..7e106d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x556b=['keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','count','include','findAll','catch','show','params','merge','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','sequelize','transaction','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','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','isValidChannel','ValidationError','Queue','options','capitalize','toLowerCase','Queues','addQueues','ids','removeQueues','Unknown\x20channel','remove','addAgents','isArray','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','TeamVoiceQueue','User','emit','Queue:save','QueueId','online','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','all','TeamVoicePrefix','Chat','removeAgents','user','Queue:remove','getAgents','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','query'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0x556b,0x66));var _0xb556=function(_0x3f95c1,_0x2e700d){_0x3f95c1=_0x3f95c1-0x0;var _0x48f9bd=_0x556b[_0x3f95c1];return _0x48f9bd;};'use strict';var emlformat=require(_0xb556('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb556('0x1'));var jsonpatch=require(_0xb556('0x2'));var rp=require(_0xb556('0x3'));var moment=require(_0xb556('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb556('0x5'));var util=require(_0xb556('0x6'));var path=require(_0xb556('0x7'));var sox=require(_0xb556('0x8'));var csv=require('to-csv');var ejs=require(_0xb556('0x9'));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('to-csv');var querystring=require(_0xb556('0xf'));var Papa=require(_0xb556('0x10'));var Redis=require('ioredis');var authService=require(_0xb556('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb556('0x12'));var hardwareService=require(_0xb556('0x13'));var logger=require('../../config/logger')(_0xb556('0x14'));var utils=require(_0xb556('0x15'));var config=require(_0xb556('0x16'));var licenseUtil=require(_0xb556('0x17'));var db=require(_0xb556('0x18'))['db'];config['redis']=_[_0xb556('0x19')](config[_0xb556('0x1a')],{'host':_0xb556('0x1b'),'port':0x18eb});var socket=require(_0xb556('0x1c'))(new Redis(config['redis']));require('./team.socket')[_0xb556('0x1d')](socket);function respondWithStatusCode(_0x24a14e,_0x2f873f){_0x2f873f=_0x2f873f||0xcc;return function(_0x1ead2a){if(_0x1ead2a){return _0x24a14e[_0xb556('0x1e')](_0x2f873f);}return _0x24a14e[_0xb556('0x1f')](_0x2f873f)['end']();};}function respondWithResult(_0x5c3548,_0xb389fa){_0xb389fa=_0xb389fa||0xc8;return function(_0x383246){if(_0x383246){return _0x5c3548[_0xb556('0x1f')](_0xb389fa)['json'](_0x383246);}};}function respondWithFilteredResult(_0xed8902,_0x5e532d){return function(_0x37756e){if(_0x37756e){var _0xf7e8e4=typeof _0x5e532d[_0xb556('0x20')]==='undefined'&&typeof _0x5e532d[_0xb556('0x21')]===_0xb556('0x22');var _0xa57adb=_0x37756e['count'];var _0x248375=_0xf7e8e4?0x0:_0x5e532d[_0xb556('0x20')];var _0x3d1992=_0xf7e8e4?_0x37756e['count']:_0x5e532d[_0xb556('0x20')]+_0x5e532d[_0xb556('0x21')];var _0x270d3f;if(_0x3d1992>=_0xa57adb){_0x3d1992=_0xa57adb;_0x270d3f=0xc8;}else{_0x270d3f=0xce;}_0xed8902['status'](_0x270d3f);return _0xed8902[_0xb556('0x23')](_0xb556('0x24'),_0x248375+'-'+_0x3d1992+'/'+_0xa57adb)[_0xb556('0x25')](_0x37756e);}return null;};}function patchUpdates(_0x2b9de9){return function(_0x5cd119){try{jsonpatch[_0xb556('0x26')](_0x5cd119,_0x2b9de9,!![]);}catch(_0x35d616){return BPromise[_0xb556('0x27')](_0x35d616);}return _0x5cd119['save']();};}function saveUpdates(_0x1f8108,_0x190646){return function(_0x4c8df1){if(_0x4c8df1){return _0x4c8df1[_0xb556('0x28')](_0x1f8108)[_0xb556('0x29')](function(_0x4db168){return _0x4db168;});}return null;};}function handleEntityNotFound(_0x312601,_0x1ef21b){return function(_0x49563f){if(!_0x49563f){_0x312601[_0xb556('0x1e')](0x194);}return _0x49563f;};}function handleError(_0x345804,_0x20dc08){_0x20dc08=_0x20dc08||0x1f4;return function(_0x402be9){logger[_0xb556('0x2a')](_0x402be9[_0xb556('0x2b')]);if(_0x402be9[_0xb556('0x2c')]){delete _0x402be9[_0xb556('0x2c')];}_0x345804[_0xb556('0x1f')](_0x20dc08)[_0xb556('0x2d')](_0x402be9);};}exports[_0xb556('0x2e')]=function(_0x4a2107,_0x550eac){var _0x5dcb04={},_0x1ed316={},_0x302440={'count':0x0,'rows':[]};var _0x5ea872=_[_0xb556('0x2f')](db[_0xb556('0x30')][_0xb556('0x31')],function(_0x1dde9c){return{'name':_0x1dde9c[_0xb556('0x32')],'type':_0x1dde9c[_0xb556('0x33')][_0xb556('0x34')]};});_0x1ed316['model']=_['map'](_0x5ea872,'name');_0x1ed316[_0xb556('0x35')]=_[_0xb556('0x36')](_0x4a2107[_0xb556('0x35')]);_0x1ed316[_0xb556('0x37')]=_[_0xb556('0x38')](_0x1ed316['model'],_0x1ed316[_0xb556('0x35')]);_0x5dcb04[_0xb556('0x39')]=_[_0xb556('0x38')](_0x1ed316[_0xb556('0x3a')],qs[_0xb556('0x3b')](_0x4a2107['query']['fields']));_0x5dcb04['attributes']=_0x5dcb04[_0xb556('0x39')][_0xb556('0x3c')]?_0x5dcb04[_0xb556('0x39')]:_0x1ed316[_0xb556('0x3a')];if(!_0x4a2107['query']['hasOwnProperty'](_0xb556('0x3d'))){_0x5dcb04[_0xb556('0x21')]=qs[_0xb556('0x21')](_0x4a2107[_0xb556('0x35')][_0xb556('0x21')]);_0x5dcb04['offset']=qs[_0xb556('0x20')](_0x4a2107[_0xb556('0x35')][_0xb556('0x20')]);}_0x5dcb04[_0xb556('0x3e')]=qs[_0xb556('0x3f')](_0x4a2107['query']['sort']);_0x5dcb04[_0xb556('0x40')]=qs[_0xb556('0x37')](_[_0xb556('0x41')](_0x4a2107['query'],_0x1ed316[_0xb556('0x37')]),_0x5ea872);if(_0x4a2107[_0xb556('0x35')][_0xb556('0x42')]){_0x5dcb04[_0xb556('0x40')]=_['merge'](_0x5dcb04[_0xb556('0x40')],{'$or':_[_0xb556('0x2f')](_0x5ea872,function(_0x16024a){if(_0x16024a['type']!=='VIRTUAL'){var _0x2e5dd8={};_0x2e5dd8[_0x16024a[_0xb556('0x2c')]]={'$like':'%'+_0x4a2107[_0xb556('0x35')][_0xb556('0x42')]+'%'};return _0x2e5dd8;}})});}_0x5dcb04=_['merge']({},_0x5dcb04,_0x4a2107['options']);var _0x2c46db={'where':_0x5dcb04[_0xb556('0x40')]};return db['Team']['count'](_0x2c46db)[_0xb556('0x29')](function(_0x2d044b){_0x302440[_0xb556('0x43')]=_0x2d044b;if(_0x4a2107[_0xb556('0x35')]['includeAll']){_0x5dcb04[_0xb556('0x44')]=[{'all':!![]}];}return db[_0xb556('0x30')][_0xb556('0x45')](_0x5dcb04);})['then'](function(_0x2f0e9d){_0x302440['rows']=_0x2f0e9d;return _0x302440;})[_0xb556('0x29')](respondWithFilteredResult(_0x550eac,_0x5dcb04))[_0xb556('0x46')](handleError(_0x550eac,null));};exports[_0xb556('0x47')]=function(_0x446f31,_0x4f04db){var _0x12ff8c={'raw':![],'where':{'id':_0x446f31[_0xb556('0x48')]['id']}},_0xe935c6={};_0xe935c6['model']=_['keys'](db[_0xb556('0x30')][_0xb556('0x31')]);_0xe935c6[_0xb556('0x35')]=_[_0xb556('0x36')](_0x446f31['query']);_0xe935c6[_0xb556('0x37')]=_[_0xb556('0x38')](_0xe935c6['model'],_0xe935c6[_0xb556('0x35')]);_0x12ff8c[_0xb556('0x39')]=_[_0xb556('0x38')](_0xe935c6[_0xb556('0x3a')],qs['fields'](_0x446f31[_0xb556('0x35')][_0xb556('0x3b')]));_0x12ff8c['attributes']=_0x12ff8c[_0xb556('0x39')]['length']?_0x12ff8c['attributes']:_0xe935c6[_0xb556('0x3a')];if(_0x446f31[_0xb556('0x35')]['includeAll']){_0x12ff8c['include']=[{'all':!![]}];}_0x12ff8c=_[_0xb556('0x49')]({},_0x12ff8c,_0x446f31['options']);return db[_0xb556('0x30')][_0xb556('0x4a')](_0x12ff8c)[_0xb556('0x29')](handleEntityNotFound(_0x4f04db,null))[_0xb556('0x29')](respondWithResult(_0x4f04db,null))[_0xb556('0x46')](handleError(_0x4f04db,null));};exports[_0xb556('0x4b')]=function(_0x581370,_0x13a345){return db['Team']['create'](_0x581370['body'],{})[_0xb556('0x29')](function(_0x36dfb6){var _0x47476e=_0x581370['user'][_0xb556('0x4c')]({'plain':!![]});if(!_0x47476e)throw new Error(_0xb556('0x4d'));if(_0x47476e[_0xb556('0x4e')]==='user'){var _0x281fed=_0x36dfb6['get']({'plain':!![]});var _0x53b0d7=_0xb556('0x4f');return db[_0xb556('0x50')]['find']({'where':{'name':_0x53b0d7,'userProfileId':_0x47476e[_0xb556('0x51')]},'raw':!![]})['then'](function(_0x14c325){if(_0x14c325&&_0x14c325[_0xb556('0x52')]===0x0){return db[_0xb556('0x53')]['create']({'name':_0x281fed[_0xb556('0x2c')],'resourceId':_0x281fed['id'],'type':_0x14c325['name'],'sectionId':_0x14c325['id']},{})['then'](function(){return _0x36dfb6;});}else{return _0x36dfb6;}})[_0xb556('0x46')](function(_0x28cfbc){logger['error'](_0xb556('0x54'),_0x28cfbc);throw _0x28cfbc;});}return _0x36dfb6;})[_0xb556('0x29')](respondWithResult(_0x13a345,0xc9))[_0xb556('0x46')](handleError(_0x13a345,null));};exports[_0xb556('0x28')]=function(_0x61e4b0,_0x1a8966){if(_0x61e4b0['body']['id']){delete _0x61e4b0[_0xb556('0x55')]['id'];}return db[_0xb556('0x30')][_0xb556('0x4a')]({'where':{'id':_0x61e4b0[_0xb556('0x48')]['id']}})[_0xb556('0x29')](handleEntityNotFound(_0x1a8966,null))['then'](saveUpdates(_0x61e4b0[_0xb556('0x55')],null))[_0xb556('0x29')](respondWithResult(_0x1a8966,null))[_0xb556('0x46')](handleError(_0x1a8966,null));};exports['destroy']=function(_0x37dd3a,_0xbb406f){var _0x3987ea=_0x37dd3a[_0xb556('0x48')]['id'];var _0x1ec1d4=[];return db[_0xb556('0x56')][_0xb556('0x57')](function(_0x440d3a){var _0x4fbeeb=_0xb556('0x58')+_0x3987ea;return db['sequelize'][_0xb556('0x35')](_0x4fbeeb,{'type':db[_0xb556('0x59')][_0xb556('0x5a')][_0xb556('0x5b')],'raw':!![],'transaction':_0x440d3a})[_0xb556('0x29')](function(_0xade36a){_0x1ec1d4=_[_0xb556('0x2f')](_0xade36a,function(_0x20b4d4){return Number(_0x20b4d4[_0xb556('0x5c')]);});})[_0xb556('0x29')](function(){var _0x23a9d4=_0xb556('0x5d')+_0x3987ea;return db[_0xb556('0x56')][_0xb556('0x35')](_0x23a9d4,{'type':db['Sequelize'][_0xb556('0x5a')][_0xb556('0x5b')],'raw':!![],'transaction':_0x440d3a});})[_0xb556('0x29')](function(_0x3e133a){var _0x370353=_[_0xb556('0x2f')](_0x3e133a,function(_0x44ceda){return Number(_0x44ceda[_0xb556('0x5e')]);});return db['UserVoiceQueue'][_0xb556('0x5f')]({'where':{'UserId':{'$in':_0x1ec1d4},'VoiceQueueId':{'$in':_0x370353}},'transaction':_0x440d3a});})[_0xb556('0x29')](function(){var _0x411716=_0xb556('0x60')+_0x3987ea;return db[_0xb556('0x56')][_0xb556('0x35')](_0x411716,{'type':db[_0xb556('0x59')][_0xb556('0x5a')]['SELECT'],'raw':!![],'transaction':_0x440d3a});})[_0xb556('0x29')](function(_0x48c235){var _0x1a0b38=_['map'](_0x48c235,function(_0x55fb33){return Number(_0x55fb33[_0xb556('0x61')]);});return db[_0xb556('0x62')][_0xb556('0x5f')]({'where':{'UserId':{'$in':_0x1ec1d4},'MailQueueId':{'$in':_0x1a0b38}},'transaction':_0x440d3a});})[_0xb556('0x29')](function(){var _0x34bc64=_0xb556('0x63')+_0x3987ea;return db['sequelize']['query'](_0x34bc64,{'type':db[_0xb556('0x59')]['QueryTypes'][_0xb556('0x5b')],'raw':!![],'transaction':_0x440d3a});})['then'](function(_0x35d61b){var _0x2e8a8b=_[_0xb556('0x2f')](_0x35d61b,function(_0x203179){return Number(_0x203179[_0xb556('0x64')]);});return db['UserSmsQueue'][_0xb556('0x5f')]({'where':{'UserId':{'$in':_0x1ec1d4},'SmsQueueId':{'$in':_0x2e8a8b}},'transaction':_0x440d3a});})[_0xb556('0x29')](function(){var _0x115eee='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3987ea;return db[_0xb556('0x56')][_0xb556('0x35')](_0x115eee,{'type':db[_0xb556('0x59')][_0xb556('0x5a')][_0xb556('0x5b')],'raw':!![],'transaction':_0x440d3a});})[_0xb556('0x29')](function(_0x547e3a){var _0x49dd03=_['map'](_0x547e3a,function(_0x269cc7){return Number(_0x269cc7[_0xb556('0x65')]);});return db[_0xb556('0x66')][_0xb556('0x5f')]({'where':{'UserId':{'$in':_0x1ec1d4},'ChatQueueId':{'$in':_0x49dd03}},'transaction':_0x440d3a});})[_0xb556('0x29')](function(){var _0x8ba763=_0xb556('0x67')+_0x3987ea;return db[_0xb556('0x56')][_0xb556('0x35')](_0x8ba763,{'type':db[_0xb556('0x59')][_0xb556('0x5a')][_0xb556('0x5b')],'raw':!![],'transaction':_0x440d3a});})[_0xb556('0x29')](function(_0x294601){var _0x1cad37=_['map'](_0x294601,function(_0x3e8df7){return Number(_0x3e8df7['FaxQueueId']);});return db['UserFaxQueue'][_0xb556('0x5f')]({'where':{'UserId':{'$in':_0x1ec1d4},'FaxQueueId':{'$in':_0x1cad37}},'transaction':_0x440d3a});})[_0xb556('0x29')](function(){var _0x4de16a=_0xb556('0x68')+_0x3987ea;return db[_0xb556('0x56')][_0xb556('0x35')](_0x4de16a,{'type':db[_0xb556('0x59')][_0xb556('0x5a')]['SELECT'],'raw':!![],'transaction':_0x440d3a});})[_0xb556('0x29')](function(_0x4a16b6){var _0x5eff7d=_[_0xb556('0x2f')](_0x4a16b6,function(_0x385896){return Number(_0x385896['OpenchannelQueueId']);});return db[_0xb556('0x69')][_0xb556('0x5f')]({'where':{'UserId':{'$in':_0x1ec1d4},'OpenchannelQueueId':{'$in':_0x5eff7d}},'transaction':_0x440d3a});})[_0xb556('0x29')](function(){var _0x1e4ee8='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3987ea;return db[_0xb556('0x56')]['query'](_0x1e4ee8,{'type':db[_0xb556('0x59')][_0xb556('0x5a')]['SELECT'],'raw':!![],'transaction':_0x440d3a});})[_0xb556('0x29')](function(_0x342795){var _0x166fff=_[_0xb556('0x2f')](_0x342795,function(_0x5e4029){return Number(_0x5e4029[_0xb556('0x6a')]);});return db[_0xb556('0x6b')][_0xb556('0x5f')]({'where':{'UserId':{'$in':_0x1ec1d4},'WhatsappQueueId':{'$in':_0x166fff}},'transaction':_0x440d3a});})[_0xb556('0x29')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x3987ea}});})[_0xb556('0x29')](function(_0x37b6e9){if(_0x37b6e9===null){return;}return db[_0xb556('0x6c')][_0xb556('0x5f')]({'where':{'UserId':{'$in':_0x1ec1d4},'VoicePrefixId':_0x37b6e9[_0xb556('0x6d')]},'transaction':_0x440d3a});})[_0xb556('0x29')](function(){return db[_0xb556('0x30')]['destroy']({'where':{'id':_0x3987ea},'cascade':!![],'transaction':_0x440d3a});})[_0xb556('0x29')](function(_0x504209){if(_0x504209===0x0){_0xbb406f[_0xb556('0x1e')](0x194);}else{return db[_0xb556('0x53')][_0xb556('0x5f')]({'where':{'type':_0xb556('0x4f'),'resourceId':_0x3987ea},'cascade':!![],'transaction':_0x440d3a})['then'](function(){_0xbb406f[_0xb556('0x1f')](0xcc)[_0xb556('0x6e')]();});}})[_0xb556('0x46')](function(_0x125863){_0xbb406f[_0xb556('0x1f')](0x1f4)[_0xb556('0x2d')](_0x125863);});});};exports[_0xb556('0x6f')]=function(_0x15b3ac,_0x2a10e8,_0x589576){return db['Team'][_0xb556('0x70')]({'where':{'id':_0x15b3ac['params']['id']}})[_0xb556('0x29')](handleEntityNotFound(_0x2a10e8,null))[_0xb556('0x29')](function(_0x13bbbb){if(!_0x15b3ac[_0xb556('0x35')][_0xb556('0x71')]||!utils[_0xb556('0x72')](_0x15b3ac['query'][_0xb556('0x71')])){throw new db[(_0xb556('0x59'))][(_0xb556('0x73'))]('Unknown\x20channel');}var _0x5197a6={};var _0x48e63d={};_0x48e63d[_0xb556('0x3a')]=_[_0xb556('0x36')](db[_['capitalize'](_0x15b3ac[_0xb556('0x35')][_0xb556('0x71')]['toLowerCase']())+_0xb556('0x74')][_0xb556('0x31')]);_0x48e63d['query']=_[_0xb556('0x36')](_0x15b3ac['query']);_0x48e63d['filters']=_[_0xb556('0x38')](_0x48e63d['model'],_0x48e63d[_0xb556('0x35')]);_0x5197a6[_0xb556('0x39')]=_[_0xb556('0x38')](_0x48e63d[_0xb556('0x3a')],qs[_0xb556('0x3b')](_0x15b3ac['query'][_0xb556('0x3b')]));_0x5197a6[_0xb556('0x39')]=_0x5197a6[_0xb556('0x39')]['length']?_0x5197a6[_0xb556('0x39')]:_0x48e63d[_0xb556('0x3a')];_0x5197a6[_0xb556('0x21')]=qs['limit'](_0x15b3ac['query'][_0xb556('0x21')]);_0x5197a6[_0xb556('0x20')]=qs[_0xb556('0x20')](_0x15b3ac[_0xb556('0x35')][_0xb556('0x20')]);_0x5197a6[_0xb556('0x3e')]=qs[_0xb556('0x3f')](_0x15b3ac[_0xb556('0x35')]['sort']);_0x5197a6[_0xb556('0x40')]=qs[_0xb556('0x37')](_[_0xb556('0x41')](_0x15b3ac[_0xb556('0x35')],_0x48e63d[_0xb556('0x37')]));_0x5197a6=_[_0xb556('0x49')]({},_0x5197a6,_0x15b3ac[_0xb556('0x75')]);return _0x13bbbb['get'+_[_0xb556('0x76')](_0x15b3ac[_0xb556('0x35')]['channel'][_0xb556('0x77')]())+_0xb556('0x78')](_0x5197a6);})['then'](respondWithResult(_0x2a10e8,null))['catch'](handleError(_0x2a10e8,null));};exports[_0xb556('0x79')]=function(_0x126d75,_0x41d332,_0x1261f5){return db[_0xb556('0x30')][_0xb556('0x70')]({'where':{'id':_0x126d75[_0xb556('0x48')]['id']}})[_0xb556('0x29')](function(_0x2c1636){if(_0x2c1636){if(!_0x126d75[_0xb556('0x55')][_0xb556('0x71')]||!utils['isValidChannel'](_0x126d75[_0xb556('0x55')]['channel'])){throw new db[(_0xb556('0x59'))][(_0xb556('0x73'))]('Unknown\x20channel');}return _0x2c1636['add'+_[_0xb556('0x76')](_0x126d75['body'][_0xb556('0x71')][_0xb556('0x77')]())+_0xb556('0x78')](_0x126d75['body'][_0xb556('0x7a')]);}return null;})[_0xb556('0x29')](handleEntityNotFound(_0x41d332,null))[_0xb556('0x29')](respondWithStatusCode(_0x41d332,null))[_0xb556('0x46')](handleError(_0x41d332,null));};exports[_0xb556('0x7b')]=function(_0x3f3328,_0x48a60f,_0x20795b){return db[_0xb556('0x30')]['findOne']({'where':{'id':_0x3f3328['params']['id']}})['then'](function(_0x5cffee){if(_0x5cffee){if(!_0x3f3328[_0xb556('0x35')]['channel']||!utils[_0xb556('0x72')](_0x3f3328[_0xb556('0x35')][_0xb556('0x71')])){throw new db[(_0xb556('0x59'))][(_0xb556('0x73'))](_0xb556('0x7c'));}return _0x5cffee[_0xb556('0x7d')+_[_0xb556('0x76')](_0x3f3328['query'][_0xb556('0x71')]['toLowerCase']())+_0xb556('0x78')](_0x3f3328[_0xb556('0x35')][_0xb556('0x7a')]);}return null;})['then'](handleEntityNotFound(_0x48a60f,null))[_0xb556('0x29')](respondWithStatusCode(_0x48a60f,null))[_0xb556('0x46')](handleError(_0x48a60f,null));};exports[_0xb556('0x7e')]=function(_0x5946ec,_0x500096){var _0x218967=_[_0xb556('0x7f')](_0x5946ec[_0xb556('0x55')][_0xb556('0x7a')])?_0x5946ec[_0xb556('0x55')]['ids']:[_0x5946ec[_0xb556('0x55')][_0xb556('0x7a')]];var _0x3ca89e=_0x5946ec[_0xb556('0x48')]['id'];return db[_0xb556('0x30')][_0xb556('0x4a')]({'where':{'id':_0x3ca89e}})[_0xb556('0x29')](handleEntityNotFound(_0x500096,null))[_0xb556('0x29')](function(_0x1a0fdc){if(_0x1a0fdc){var _0x2b9a79=[_0xb556('0x80'),'Chat',_0xb556('0x81'),_0xb556('0x82'),_0xb556('0x83'),_0xb556('0x84'),_0xb556('0x85')];return db[_0xb556('0x56')]['transaction'](function(_0x55ac1a){var _0x17ad2e=_[_0xb556('0x2f')](_0x2b9a79,function(_0x5240fe){var _0x4b6497={'attributes':['id',_0xb556('0x2c')]};if(_0x5240fe===_0xb556('0x80')){_0x4b6497[_0xb556('0x86')]={'attributes':[_0xb556('0x87')]};}return _0x1a0fdc[_0xb556('0x4c')+_0x5240fe+_0xb556('0x78')](_0x4b6497)['then'](function(_0x326599){var _0x1e525c=_[_0xb556('0x2f')](_0x326599,function(_0x420451){var _0x3d5a4d=_[_0xb556('0x2f')](_0x218967,function(_0x43372f){var _0x8c84fa={'where':{'UserId':_0x43372f,[_0x5240fe+'QueueId']:_0x420451['id']},'transaction':_0x55ac1a};if(_0x5240fe===_0xb556('0x80')){_0x8c84fa['defaults']={'penalty':_0x420451[_0xb556('0x88')][_0xb556('0x87')]};}return db[_0xb556('0x89')+_0x5240fe+_0xb556('0x74')]['findOrCreate'](_0x8c84fa)[_0xb556('0x29')](function(){socket[_0xb556('0x8a')]('user'+_0x5240fe+_0xb556('0x8b'),{'UserId':_0x43372f,[_0x5240fe+_0xb556('0x8c')]:_0x420451['id']});if(_0x5240fe!==_0xb556('0x80')){return;}return db[_0xb556('0x89')][_0xb556('0x45')]({'where':{'id':_0x218967,'online':0x1},'attributes':['id',_0xb556('0x2c'),_0xb556('0x8d'),'voicePause','interface'],'raw':!![]})['then'](function(_0xb686cc){var _0x494602=_[_0xb556('0x2f')](_0xb686cc,function(_0x53694c){return db[_0xb556('0x8e')][_0xb556('0x8f')]({'membername':_0x53694c[_0xb556('0x2c')],'UserId':_0x53694c['id'],'queue_name':_0x420451[_0xb556('0x2c')],'VoiceQueueId':_0x420451['id'],'interface':_[_0xb556('0x90')](_0x53694c[_0xb556('0x91')])?util[_0xb556('0x92')](_0xb556('0x93'),_0x53694c[_0xb556('0x2c')]):_0x53694c[_0xb556('0x91')],'paused':_0x53694c['voicePause']||![],'penalty':_0x420451[_0xb556('0x88')][_0xb556('0x87')]},{'transaction':_0x55ac1a});});return Promise[_0xb556('0x94')](_0x494602);});});});return Promise['all'](_0x3d5a4d);});return Promise['all'](_0x1e525c);})[_0xb556('0x29')](function(){return db[_0xb556('0x95')]['findOne']({'where':{'teamId':_0x3ca89e}})[_0xb556('0x29')](function(_0x5a9c7c){if(_0x5a9c7c){var _0x3f532b=_[_0xb556('0x2f')](_0x218967,function(_0x447584){db[_0xb556('0x6c')][_0xb556('0x8f')]({'UserId':_0x447584,'VoicePrefixId':_0x5a9c7c[_0xb556('0x6d')]});});return Promise[_0xb556('0x94')](_0x3f532b);}});});});return Promise[_0xb556('0x94')](_0x17ad2e)[_0xb556('0x29')](function(){return _0x1a0fdc['addAgents'](_0x218967,{'transaction':_0x55ac1a})['spread'](function(_0x2ee75d){return _0x2ee75d;});});});}})[_0xb556('0x29')](respondWithResult(_0x500096,null))[_0xb556('0x46')](handleError(_0x500096,null));};exports['removeAgents']=function(_0x585d09,_0x41fd83){var _0x54f51c=_[_0xb556('0x7f')](_0x585d09['query'][_0xb556('0x7a')])?_0x585d09[_0xb556('0x35')][_0xb556('0x7a')]:[_0x585d09[_0xb556('0x35')]['ids']];var _0x33addf=_0x585d09['params']['id'];return db[_0xb556('0x30')][_0xb556('0x4a')]({'where':{'id':_0x33addf}})[_0xb556('0x29')](handleEntityNotFound(_0x41fd83,null))['then'](function(_0x299cfb){if(_0x299cfb){var _0xddfd6c=[_0xb556('0x80'),_0xb556('0x96'),_0xb556('0x81'),_0xb556('0x82'),'Fax',_0xb556('0x84'),_0xb556('0x85')];return db[_0xb556('0x56')][_0xb556('0x57')](function(_0x55eef2){var _0x181593=_[_0xb556('0x2f')](_0xddfd6c,function(_0xcb68ec){var _0x55ba6a={'attributes':['id','name']};return _0x299cfb[_0xb556('0x4c')+_0xcb68ec+_0xb556('0x78')](_0x55ba6a)[_0xb556('0x29')](function(_0x52ad1a){var _0x5b13de=_['map'](_0x52ad1a,function(_0x583f3d){return _0x583f3d[_0xb556('0x97')](_0x54f51c,{'transaction':_0x55eef2})[_0xb556('0x29')](function(){var _0x257f6b=_[_0xb556('0x2f')](_0x54f51c,function(_0x455a1b){socket[_0xb556('0x8a')](_0xb556('0x98')+_0xcb68ec+_0xb556('0x99'),{'UserId':Number(_0x455a1b),[_0xcb68ec+'QueueId']:_0x583f3d['id']});if(_0xcb68ec!==_0xb556('0x80')){return;}return db[_0xb556('0x8e')][_0xb556('0x5f')]({'where':{'VoiceQueueId':_0x583f3d['id'],'UserId':_0x455a1b},'transaction':_0x55eef2});});return Promise[_0xb556('0x94')](_0x257f6b);});});return Promise[_0xb556('0x94')](_0x5b13de);});});return Promise[_0xb556('0x94')](_0x181593)[_0xb556('0x29')](function(){return _0x299cfb[_0xb556('0x97')](_0x54f51c,{'transaction':_0x55eef2});})['then'](function(){return db[_0xb556('0x95')][_0xb556('0x70')]({'where':{'teamId':_0x33addf}})[_0xb556('0x29')](function(_0x5780f1){if(_0x5780f1){var _0x13f26c=_['map'](_0x54f51c,function(_0x1192f6){db[_0xb556('0x6c')][_0xb556('0x5f')]({'where':{'UserId':_0x1192f6,'VoicePrefixId':_0x5780f1[_0xb556('0x6d')]}});});return Promise[_0xb556('0x94')](_0x13f26c);}});});});}})['then'](respondWithStatusCode(_0x41fd83,null))['catch'](handleError(_0x41fd83,null));};exports[_0xb556('0x9a')]=function(_0x4e3286,_0x11bad0,_0x31c0ed){var _0x32da3a={};var _0x4516b7={};var _0x79aa9a;var _0x476c9b;return db[_0xb556('0x30')][_0xb556('0x70')]({'where':{'id':_0x4e3286[_0xb556('0x48')]['id']}})[_0xb556('0x29')](handleEntityNotFound(_0x11bad0,null))[_0xb556('0x29')](function(_0x373c4f){if(_0x373c4f){_0x79aa9a=_0x373c4f;_0x4516b7[_0xb556('0x3a')]=_[_0xb556('0x36')](db['User'][_0xb556('0x31')]);_0x4516b7[_0xb556('0x35')]=_[_0xb556('0x36')](_0x4e3286[_0xb556('0x35')]);_0x4516b7[_0xb556('0x37')]=_['intersection'](_0x4516b7[_0xb556('0x3a')],_0x4516b7[_0xb556('0x35')]);_0x32da3a[_0xb556('0x39')]=_[_0xb556('0x38')](_0x4516b7['model'],qs[_0xb556('0x3b')](_0x4e3286[_0xb556('0x35')][_0xb556('0x3b')]));_0x32da3a[_0xb556('0x39')]=_0x32da3a['attributes'][_0xb556('0x3c')]?_0x32da3a['attributes']:_0x4516b7['model'];_0x32da3a[_0xb556('0x3e')]=qs[_0xb556('0x3f')](_0x4e3286[_0xb556('0x35')][_0xb556('0x3f')]);_0x32da3a[_0xb556('0x40')]=qs['filters'](_[_0xb556('0x41')](_0x4e3286['query'],_0x4516b7[_0xb556('0x37')]));if(_0x4e3286['query']['filter']){_0x32da3a[_0xb556('0x40')]=_['merge'](_0x32da3a[_0xb556('0x40')],{'$or':_['map'](_0x32da3a[_0xb556('0x39')],function(_0x2e09c8){var _0x1fc1eb={};_0x1fc1eb[_0x2e09c8]={'$like':'%'+_0x4e3286['query'][_0xb556('0x42')]+'%'};return _0x1fc1eb;})});}_0x32da3a=_[_0xb556('0x49')]({},_0x32da3a,_0x4e3286[_0xb556('0x75')]);return _0x79aa9a[_0xb556('0x9a')](_0x32da3a);}})[_0xb556('0x29')](function(_0x1001c1){if(_0x1001c1){_0x476c9b=_0x1001c1[_0xb556('0x3c')];if(!_0x4e3286[_0xb556('0x35')][_0xb556('0x9b')](_0xb556('0x3d'))){_0x32da3a['limit']=qs[_0xb556('0x21')](_0x4e3286['query'][_0xb556('0x21')]);_0x32da3a[_0xb556('0x20')]=qs[_0xb556('0x20')](_0x4e3286['query'][_0xb556('0x20')]);}return _0x79aa9a[_0xb556('0x9a')](_0x32da3a);}})[_0xb556('0x29')](function(_0x5995db){if(_0x5995db){return _0x5995db?{'count':_0x476c9b,'rows':_0x5995db}:null;}})['then'](respondWithResult(_0x11bad0,null))[_0xb556('0x46')](handleError(_0x11bad0,null));};
\ No newline at end of file
+var _0x9480=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','order','sort','where','pick','VIRTUAL','filter','Team','include','rows','catch','show','params','fields','includeAll','merge','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','find','userProfileId','autoAssociation','sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserMailQueue','SmsQueueId','UserSmsQueue','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','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','sendStatus','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','add','ids','remove','addAgents','isArray','Chat','Sms','Fax','Openchannel','Whatsapp','through','Voice','User','Queue','findOrCreate','emit','Queue:save','QueueId','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','penalty','all','spread','removeAgents','Mail','transaction','getAgents','keys','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x9480,0x128));var _0x0948=function(_0x46f4bb,_0x7dc8a9){_0x46f4bb=_0x46f4bb-0x0;var _0x29f2af=_0x9480[_0x46f4bb];return _0x29f2af;};'use strict';var emlformat=require(_0x0948('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0948('0x1'));var jsonpatch=require(_0x0948('0x2'));var rp=require(_0x0948('0x3'));var moment=require('moment');var BPromise=require(_0x0948('0x4'));var Mustache=require(_0x0948('0x5'));var util=require(_0x0948('0x6'));var path=require(_0x0948('0x7'));var sox=require(_0x0948('0x8'));var csv=require(_0x0948('0x9'));var ejs=require(_0x0948('0xa'));var fs=require('fs');var fs_extra=require(_0x0948('0xb'));var _=require(_0x0948('0xc'));var squel=require(_0x0948('0xd'));var crypto=require(_0x0948('0xe'));var jsforce=require(_0x0948('0xf'));var deskjs=require(_0x0948('0x10'));var toCsv=require(_0x0948('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0948('0x11'));var authService=require(_0x0948('0x12'));var qs=require(_0x0948('0x13'));var as=require(_0x0948('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0948('0x15'))(_0x0948('0x16'));var utils=require(_0x0948('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0948('0x18'));var db=require(_0x0948('0x19'))['db'];config[_0x0948('0x1a')]=_[_0x0948('0x1b')](config['redis'],{'host':_0x0948('0x1c'),'port':0x18eb});var socket=require(_0x0948('0x1d'))(new Redis(config[_0x0948('0x1a')]));require(_0x0948('0x1e'))[_0x0948('0x1f')](socket);function respondWithStatusCode(_0x124f17,_0x144aaa){_0x144aaa=_0x144aaa||0xcc;return function(_0x30494e){if(_0x30494e){return _0x124f17['sendStatus'](_0x144aaa);}return _0x124f17[_0x0948('0x20')](_0x144aaa)[_0x0948('0x21')]();};}function respondWithResult(_0x3094bd,_0x4dc397){_0x4dc397=_0x4dc397||0xc8;return function(_0x155dc7){if(_0x155dc7){return _0x3094bd[_0x0948('0x20')](_0x4dc397)[_0x0948('0x22')](_0x155dc7);}};}function respondWithFilteredResult(_0x5f40de,_0x1a4e0c){return function(_0x168a9a){if(_0x168a9a){var _0x51dc2e=typeof _0x1a4e0c[_0x0948('0x23')]===_0x0948('0x24')&&typeof _0x1a4e0c[_0x0948('0x25')]===_0x0948('0x24');var _0x422ebd=_0x168a9a[_0x0948('0x26')];var _0x543f7c=_0x51dc2e?0x0:_0x1a4e0c[_0x0948('0x23')];var _0x1b67f8=_0x51dc2e?_0x168a9a[_0x0948('0x26')]:_0x1a4e0c[_0x0948('0x23')]+_0x1a4e0c['limit'];var _0x439437;if(_0x1b67f8>=_0x422ebd){_0x1b67f8=_0x422ebd;_0x439437=0xc8;}else{_0x439437=0xce;}_0x5f40de[_0x0948('0x20')](_0x439437);return _0x5f40de['set'](_0x0948('0x27'),_0x543f7c+'-'+_0x1b67f8+'/'+_0x422ebd)[_0x0948('0x22')](_0x168a9a);}return null;};}function patchUpdates(_0x44c11a){return function(_0x51dc6f){try{jsonpatch['apply'](_0x51dc6f,_0x44c11a,!![]);}catch(_0x24f4f8){return BPromise[_0x0948('0x28')](_0x24f4f8);}return _0x51dc6f[_0x0948('0x29')]();};}function saveUpdates(_0x75c5c7,_0x3dbae2){return function(_0x379c02){if(_0x379c02){return _0x379c02[_0x0948('0x2a')](_0x75c5c7)[_0x0948('0x2b')](function(_0x300a67){return _0x300a67;});}return null;};}function handleEntityNotFound(_0x389fcf,_0x17d5b1){return function(_0x26ca08){if(!_0x26ca08){_0x389fcf['sendStatus'](0x194);}return _0x26ca08;};}function handleError(_0x5e4bd9,_0x3b8e56){_0x3b8e56=_0x3b8e56||0x1f4;return function(_0x4d1643){logger[_0x0948('0x2c')](_0x4d1643[_0x0948('0x2d')]);if(_0x4d1643[_0x0948('0x2e')]){delete _0x4d1643[_0x0948('0x2e')];}_0x5e4bd9[_0x0948('0x20')](_0x3b8e56)['send'](_0x4d1643);};}exports['index']=function(_0x5ae5f6,_0x4d1a4f){var _0x436b8a={},_0x1b9a5e={},_0x1a3588={'count':0x0,'rows':[]};var _0x5cc3a9=_['map'](db['Team'][_0x0948('0x2f')],function(_0x1e5537){return{'name':_0x1e5537[_0x0948('0x30')],'type':_0x1e5537[_0x0948('0x31')][_0x0948('0x32')]};});_0x1b9a5e[_0x0948('0x33')]=_[_0x0948('0x34')](_0x5cc3a9,'name');_0x1b9a5e['query']=_['keys'](_0x5ae5f6[_0x0948('0x35')]);_0x1b9a5e[_0x0948('0x36')]=_[_0x0948('0x37')](_0x1b9a5e[_0x0948('0x33')],_0x1b9a5e['query']);_0x436b8a[_0x0948('0x38')]=_[_0x0948('0x37')](_0x1b9a5e['model'],qs['fields'](_0x5ae5f6[_0x0948('0x35')]['fields']));_0x436b8a[_0x0948('0x38')]=_0x436b8a[_0x0948('0x38')][_0x0948('0x39')]?_0x436b8a['attributes']:_0x1b9a5e[_0x0948('0x33')];if(!_0x5ae5f6[_0x0948('0x35')]['hasOwnProperty']('nolimit')){_0x436b8a[_0x0948('0x25')]=qs[_0x0948('0x25')](_0x5ae5f6[_0x0948('0x35')][_0x0948('0x25')]);_0x436b8a[_0x0948('0x23')]=qs[_0x0948('0x23')](_0x5ae5f6[_0x0948('0x35')]['offset']);}_0x436b8a[_0x0948('0x3a')]=qs[_0x0948('0x3b')](_0x5ae5f6['query'][_0x0948('0x3b')]);_0x436b8a[_0x0948('0x3c')]=qs[_0x0948('0x36')](_[_0x0948('0x3d')](_0x5ae5f6[_0x0948('0x35')],_0x1b9a5e[_0x0948('0x36')]),_0x5cc3a9);if(_0x5ae5f6[_0x0948('0x35')]['filter']){_0x436b8a[_0x0948('0x3c')]=_['merge'](_0x436b8a['where'],{'$or':_[_0x0948('0x34')](_0x5cc3a9,function(_0x34f434){if(_0x34f434[_0x0948('0x31')]!==_0x0948('0x3e')){var _0x2be71d={};_0x2be71d[_0x34f434[_0x0948('0x2e')]]={'$like':'%'+_0x5ae5f6['query'][_0x0948('0x3f')]+'%'};return _0x2be71d;}})});}_0x436b8a=_['merge']({},_0x436b8a,_0x5ae5f6['options']);var _0x47a00a={'where':_0x436b8a[_0x0948('0x3c')]};return db[_0x0948('0x40')][_0x0948('0x26')](_0x47a00a)[_0x0948('0x2b')](function(_0x154b28){_0x1a3588[_0x0948('0x26')]=_0x154b28;if(_0x5ae5f6[_0x0948('0x35')]['includeAll']){_0x436b8a[_0x0948('0x41')]=[{'all':!![]}];}return db[_0x0948('0x40')]['findAll'](_0x436b8a);})['then'](function(_0x2b5ff0){_0x1a3588[_0x0948('0x42')]=_0x2b5ff0;return _0x1a3588;})[_0x0948('0x2b')](respondWithFilteredResult(_0x4d1a4f,_0x436b8a))[_0x0948('0x43')](handleError(_0x4d1a4f,null));};exports[_0x0948('0x44')]=function(_0x363b2a,_0x40815a){var _0x39aff6={'raw':![],'where':{'id':_0x363b2a[_0x0948('0x45')]['id']}},_0x1e4b62={};_0x1e4b62[_0x0948('0x33')]=_['keys'](db[_0x0948('0x40')][_0x0948('0x2f')]);_0x1e4b62[_0x0948('0x35')]=_['keys'](_0x363b2a[_0x0948('0x35')]);_0x1e4b62[_0x0948('0x36')]=_[_0x0948('0x37')](_0x1e4b62['model'],_0x1e4b62[_0x0948('0x35')]);_0x39aff6[_0x0948('0x38')]=_[_0x0948('0x37')](_0x1e4b62[_0x0948('0x33')],qs[_0x0948('0x46')](_0x363b2a['query'][_0x0948('0x46')]));_0x39aff6[_0x0948('0x38')]=_0x39aff6[_0x0948('0x38')][_0x0948('0x39')]?_0x39aff6[_0x0948('0x38')]:_0x1e4b62['model'];if(_0x363b2a[_0x0948('0x35')][_0x0948('0x47')]){_0x39aff6[_0x0948('0x41')]=[{'all':!![]}];}_0x39aff6=_[_0x0948('0x48')]({},_0x39aff6,_0x363b2a[_0x0948('0x49')]);return db[_0x0948('0x40')]['find'](_0x39aff6)[_0x0948('0x2b')](handleEntityNotFound(_0x40815a,null))['then'](respondWithResult(_0x40815a,null))[_0x0948('0x43')](handleError(_0x40815a,null));};exports[_0x0948('0x4a')]=function(_0x3da91b,_0xca12d3){return db[_0x0948('0x40')]['create'](_0x3da91b[_0x0948('0x4b')],{})['then'](function(_0x2d542f){var _0x25bfe9=_0x3da91b['user'][_0x0948('0x4c')]({'plain':!![]});if(!_0x25bfe9)throw new Error(_0x0948('0x4d'));if(_0x25bfe9[_0x0948('0x4e')]===_0x0948('0x4f')){var _0x16b2f9=_0x2d542f['get']({'plain':!![]});var _0x564df7=_0x0948('0x50');return db['UserProfileSection'][_0x0948('0x51')]({'where':{'name':_0x564df7,'userProfileId':_0x25bfe9[_0x0948('0x52')]},'raw':!![]})[_0x0948('0x2b')](function(_0x10dfce){if(_0x10dfce&&_0x10dfce[_0x0948('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x16b2f9[_0x0948('0x2e')],'resourceId':_0x16b2f9['id'],'type':_0x10dfce[_0x0948('0x2e')],'sectionId':_0x10dfce['id']},{})[_0x0948('0x2b')](function(){return _0x2d542f;});}else{return _0x2d542f;}})['catch'](function(_0x1bb2f5){logger[_0x0948('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bb2f5);throw _0x1bb2f5;});}return _0x2d542f;})[_0x0948('0x2b')](respondWithResult(_0xca12d3,0xc9))[_0x0948('0x43')](handleError(_0xca12d3,null));};exports[_0x0948('0x2a')]=function(_0x2da8c5,_0x4f9185){if(_0x2da8c5[_0x0948('0x4b')]['id']){delete _0x2da8c5['body']['id'];}return db['Team'][_0x0948('0x51')]({'where':{'id':_0x2da8c5[_0x0948('0x45')]['id']}})[_0x0948('0x2b')](handleEntityNotFound(_0x4f9185,null))[_0x0948('0x2b')](saveUpdates(_0x2da8c5[_0x0948('0x4b')],null))['then'](respondWithResult(_0x4f9185,null))['catch'](handleError(_0x4f9185,null));};exports['destroy']=function(_0x48bd71,_0x3c6329){var _0x276005=_0x48bd71[_0x0948('0x45')]['id'];var _0x219f59=[];return db[_0x0948('0x54')]['transaction'](function(_0x25172b){var _0x2d5100='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x276005;return db[_0x0948('0x54')]['query'](_0x2d5100,{'type':db[_0x0948('0x55')]['QueryTypes'][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b})[_0x0948('0x2b')](function(_0x8fb804){_0x219f59=_[_0x0948('0x34')](_0x8fb804,function(_0x12a6be){return Number(_0x12a6be[_0x0948('0x57')]);});})['then'](function(){var _0x15f237=_0x0948('0x58')+_0x276005;return db['sequelize'][_0x0948('0x35')](_0x15f237,{'type':db[_0x0948('0x55')]['QueryTypes'][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x8ee0a4){var _0x5350cf=_['map'](_0x8ee0a4,function(_0x296c47){return Number(_0x296c47[_0x0948('0x59')]);});return db[_0x0948('0x5a')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'VoiceQueueId':{'$in':_0x5350cf}},'transaction':_0x25172b});})['then'](function(){var _0x1002ba=_0x0948('0x5c')+_0x276005;return db[_0x0948('0x54')][_0x0948('0x35')](_0x1002ba,{'type':db['Sequelize'][_0x0948('0x5d')][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x5df8ac){var _0x23ec67=_[_0x0948('0x34')](_0x5df8ac,function(_0x2efc26){return Number(_0x2efc26['MailQueueId']);});return db[_0x0948('0x5e')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'MailQueueId':{'$in':_0x23ec67}},'transaction':_0x25172b});})['then'](function(){var _0x266495='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x276005;return db['sequelize'][_0x0948('0x35')](_0x266495,{'type':db['Sequelize'][_0x0948('0x5d')][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x9c8cf8){var _0x3bc273=_['map'](_0x9c8cf8,function(_0x14467f){return Number(_0x14467f[_0x0948('0x5f')]);});return db[_0x0948('0x60')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'SmsQueueId':{'$in':_0x3bc273}},'transaction':_0x25172b});})['then'](function(){var _0x57844d='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x276005;return db[_0x0948('0x54')][_0x0948('0x35')](_0x57844d,{'type':db['Sequelize'][_0x0948('0x5d')]['SELECT'],'raw':!![],'transaction':_0x25172b});})['then'](function(_0x74aefb){var _0x62ab90=_[_0x0948('0x34')](_0x74aefb,function(_0x4f05c7){return Number(_0x4f05c7[_0x0948('0x61')]);});return db[_0x0948('0x62')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'ChatQueueId':{'$in':_0x62ab90}},'transaction':_0x25172b});})['then'](function(){var _0x54148b=_0x0948('0x63')+_0x276005;return db[_0x0948('0x54')][_0x0948('0x35')](_0x54148b,{'type':db['Sequelize'][_0x0948('0x5d')][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x48877b){var _0x489f87=_[_0x0948('0x34')](_0x48877b,function(_0x48f5c3){return Number(_0x48f5c3[_0x0948('0x64')]);});return db[_0x0948('0x65')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'FaxQueueId':{'$in':_0x489f87}},'transaction':_0x25172b});})['then'](function(){var _0x5e1e10=_0x0948('0x66')+_0x276005;return db[_0x0948('0x54')][_0x0948('0x35')](_0x5e1e10,{'type':db['Sequelize']['QueryTypes'][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x3dfe06){var _0x5de399=_[_0x0948('0x34')](_0x3dfe06,function(_0x348056){return Number(_0x348056['OpenchannelQueueId']);});return db[_0x0948('0x67')]['destroy']({'where':{'UserId':{'$in':_0x219f59},'OpenchannelQueueId':{'$in':_0x5de399}},'transaction':_0x25172b});})['then'](function(){var _0x478b02=_0x0948('0x68')+_0x276005;return db[_0x0948('0x54')]['query'](_0x478b02,{'type':db[_0x0948('0x55')][_0x0948('0x5d')][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x4aa5a1){var _0x340c19=_['map'](_0x4aa5a1,function(_0x35cff5){return Number(_0x35cff5[_0x0948('0x69')]);});return db[_0x0948('0x6a')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'WhatsappQueueId':{'$in':_0x340c19}},'transaction':_0x25172b});})[_0x0948('0x2b')](function(){return db[_0x0948('0x6b')][_0x0948('0x51')]({'where':{'TeamId':_0x276005}});})[_0x0948('0x2b')](function(_0x31e507){if(_0x31e507===null){return;}return db[_0x0948('0x6c')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'VoicePrefixId':_0x31e507[_0x0948('0x6d')]},'transaction':_0x25172b});})[_0x0948('0x2b')](function(){return db[_0x0948('0x40')]['destroy']({'where':{'id':_0x276005},'cascade':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x1e543b){if(_0x1e543b===0x0){_0x3c6329[_0x0948('0x6e')](0x194);}else{return db['UserProfileResource'][_0x0948('0x5b')]({'where':{'type':'Teams','resourceId':_0x276005},'cascade':!![],'transaction':_0x25172b})['then'](function(){_0x3c6329[_0x0948('0x20')](0xcc)['end']();});}})[_0x0948('0x43')](function(_0x1c94f3){_0x3c6329[_0x0948('0x20')](0x1f4)['send'](_0x1c94f3);});});};exports['getQueues']=function(_0x5cb6a2,_0x4eed57,_0x1e03ff){return db[_0x0948('0x40')][_0x0948('0x6f')]({'where':{'id':_0x5cb6a2[_0x0948('0x45')]['id']}})[_0x0948('0x2b')](handleEntityNotFound(_0x4eed57,null))[_0x0948('0x2b')](function(_0x382f1b){if(!_0x5cb6a2[_0x0948('0x35')][_0x0948('0x70')]||!utils[_0x0948('0x71')](_0x5cb6a2[_0x0948('0x35')][_0x0948('0x70')])){throw new db['Sequelize'][(_0x0948('0x72'))](_0x0948('0x73'));}var _0xa0f340={};var _0x22da4d={};_0x22da4d['model']=_['keys'](db[_[_0x0948('0x74')](_0x5cb6a2[_0x0948('0x35')][_0x0948('0x70')][_0x0948('0x75')]())+'Queue'][_0x0948('0x2f')]);_0x22da4d['query']=_['keys'](_0x5cb6a2[_0x0948('0x35')]);_0x22da4d[_0x0948('0x36')]=_[_0x0948('0x37')](_0x22da4d[_0x0948('0x33')],_0x22da4d[_0x0948('0x35')]);_0xa0f340['attributes']=_['intersection'](_0x22da4d[_0x0948('0x33')],qs['fields'](_0x5cb6a2[_0x0948('0x35')]['fields']));_0xa0f340[_0x0948('0x38')]=_0xa0f340[_0x0948('0x38')]['length']?_0xa0f340['attributes']:_0x22da4d[_0x0948('0x33')];_0xa0f340[_0x0948('0x25')]=qs['limit'](_0x5cb6a2[_0x0948('0x35')][_0x0948('0x25')]);_0xa0f340[_0x0948('0x23')]=qs['offset'](_0x5cb6a2['query'][_0x0948('0x23')]);_0xa0f340[_0x0948('0x3a')]=qs[_0x0948('0x3b')](_0x5cb6a2[_0x0948('0x35')][_0x0948('0x3b')]);_0xa0f340[_0x0948('0x3c')]=qs['filters'](_[_0x0948('0x3d')](_0x5cb6a2[_0x0948('0x35')],_0x22da4d[_0x0948('0x36')]));_0xa0f340=_[_0x0948('0x48')]({},_0xa0f340,_0x5cb6a2[_0x0948('0x49')]);return _0x382f1b[_0x0948('0x4c')+_['capitalize'](_0x5cb6a2[_0x0948('0x35')]['channel'][_0x0948('0x75')]())+_0x0948('0x76')](_0xa0f340);})[_0x0948('0x2b')](respondWithResult(_0x4eed57,null))[_0x0948('0x43')](handleError(_0x4eed57,null));};exports[_0x0948('0x77')]=function(_0x39f749,_0x4b20c6,_0x20ca13){return db[_0x0948('0x40')]['findOne']({'where':{'id':_0x39f749['params']['id']}})[_0x0948('0x2b')](function(_0x47dd9b){if(_0x47dd9b){if(!_0x39f749[_0x0948('0x4b')][_0x0948('0x70')]||!utils[_0x0948('0x71')](_0x39f749[_0x0948('0x4b')]['channel'])){throw new db[(_0x0948('0x55'))][(_0x0948('0x72'))](_0x0948('0x73'));}return _0x47dd9b[_0x0948('0x78')+_[_0x0948('0x74')](_0x39f749['body']['channel'][_0x0948('0x75')]())+_0x0948('0x76')](_0x39f749[_0x0948('0x4b')][_0x0948('0x79')]);}return null;})['then'](handleEntityNotFound(_0x4b20c6,null))['then'](respondWithStatusCode(_0x4b20c6,null))['catch'](handleError(_0x4b20c6,null));};exports['removeQueues']=function(_0x37ee01,_0x146cf6,_0x5a5798){return db['Team'][_0x0948('0x6f')]({'where':{'id':_0x37ee01['params']['id']}})[_0x0948('0x2b')](function(_0x1caf27){if(_0x1caf27){if(!_0x37ee01[_0x0948('0x35')][_0x0948('0x70')]||!utils[_0x0948('0x71')](_0x37ee01['query'][_0x0948('0x70')])){throw new db[(_0x0948('0x55'))][(_0x0948('0x72'))]('Unknown\x20channel');}return _0x1caf27[_0x0948('0x7a')+_[_0x0948('0x74')](_0x37ee01['query'][_0x0948('0x70')][_0x0948('0x75')]())+_0x0948('0x76')](_0x37ee01[_0x0948('0x35')][_0x0948('0x79')]);}return null;})['then'](handleEntityNotFound(_0x146cf6,null))[_0x0948('0x2b')](respondWithStatusCode(_0x146cf6,null))[_0x0948('0x43')](handleError(_0x146cf6,null));};exports[_0x0948('0x7b')]=function(_0x2642ae,_0x505f90){var _0x1ba326=_[_0x0948('0x7c')](_0x2642ae[_0x0948('0x4b')]['ids'])?_0x2642ae[_0x0948('0x4b')][_0x0948('0x79')]:[_0x2642ae[_0x0948('0x4b')]['ids']];var _0x4ce129=_0x2642ae[_0x0948('0x45')]['id'];return db[_0x0948('0x40')]['find']({'where':{'id':_0x4ce129}})[_0x0948('0x2b')](handleEntityNotFound(_0x505f90,null))[_0x0948('0x2b')](function(_0x9b28b1){if(_0x9b28b1){var _0x20ec50=['Voice',_0x0948('0x7d'),'Mail',_0x0948('0x7e'),_0x0948('0x7f'),_0x0948('0x80'),_0x0948('0x81')];return db[_0x0948('0x54')]['transaction'](function(_0x3fa9a8){var _0xf524f4=_[_0x0948('0x34')](_0x20ec50,function(_0x4d6327){var _0x47dabf={'attributes':['id',_0x0948('0x2e')]};if(_0x4d6327==='Voice'){_0x47dabf[_0x0948('0x82')]={'attributes':['penalty']};}return _0x9b28b1[_0x0948('0x4c')+_0x4d6327+_0x0948('0x76')](_0x47dabf)[_0x0948('0x2b')](function(_0x4a4fd8){var _0x582d50=_[_0x0948('0x34')](_0x4a4fd8,function(_0xf2e452){var _0x5320bb=_['map'](_0x1ba326,function(_0x1d9562){var _0x416749={'where':{'UserId':_0x1d9562,[_0x4d6327+'QueueId']:_0xf2e452['id']},'transaction':_0x3fa9a8};if(_0x4d6327===_0x0948('0x83')){_0x416749[_0x0948('0x1b')]={'penalty':_0xf2e452['TeamVoiceQueue']['penalty']};}return db[_0x0948('0x84')+_0x4d6327+_0x0948('0x85')][_0x0948('0x86')](_0x416749)[_0x0948('0x2b')](function(){socket[_0x0948('0x87')](_0x0948('0x4f')+_0x4d6327+_0x0948('0x88'),{'UserId':_0x1d9562,[_0x4d6327+_0x0948('0x89')]:_0xf2e452['id']});if(_0x4d6327!=='Voice'){return;}return db['User'][_0x0948('0x8a')]({'where':{'id':_0x1ba326,'online':0x1},'attributes':['id','name',_0x0948('0x8b'),_0x0948('0x8c'),_0x0948('0x8d')],'raw':!![]})['then'](function(_0x22333f){var _0x1bf8ec=_['map'](_0x22333f,function(_0x2069f4){return db[_0x0948('0x8e')][_0x0948('0x8f')]({'membername':_0x2069f4[_0x0948('0x2e')],'UserId':_0x2069f4['id'],'queue_name':_0xf2e452[_0x0948('0x2e')],'VoiceQueueId':_0xf2e452['id'],'interface':_[_0x0948('0x90')](_0x2069f4[_0x0948('0x8d')])?util[_0x0948('0x91')](_0x0948('0x92'),_0x2069f4[_0x0948('0x2e')]):_0x2069f4['interface'],'paused':_0x2069f4[_0x0948('0x8c')]||![],'penalty':_0xf2e452['TeamVoiceQueue'][_0x0948('0x93')]},{'transaction':_0x3fa9a8});});return Promise[_0x0948('0x94')](_0x1bf8ec);});});});return Promise[_0x0948('0x94')](_0x5320bb);});return Promise[_0x0948('0x94')](_0x582d50);})['then'](function(){return db[_0x0948('0x6b')]['findOne']({'where':{'teamId':_0x4ce129}})[_0x0948('0x2b')](function(_0x195ece){if(_0x195ece){var _0x2ce63d=_[_0x0948('0x34')](_0x1ba326,function(_0x375e24){db[_0x0948('0x6c')][_0x0948('0x8f')]({'UserId':_0x375e24,'VoicePrefixId':_0x195ece['VoicePrefixId']});});return Promise[_0x0948('0x94')](_0x2ce63d);}});});});return Promise[_0x0948('0x94')](_0xf524f4)[_0x0948('0x2b')](function(){return _0x9b28b1[_0x0948('0x7b')](_0x1ba326,{'transaction':_0x3fa9a8})[_0x0948('0x95')](function(_0x203515){return _0x203515;});});});}})[_0x0948('0x2b')](respondWithResult(_0x505f90,null))[_0x0948('0x43')](handleError(_0x505f90,null));};exports[_0x0948('0x96')]=function(_0x5313c9,_0x1ae8f3){var _0x3d23f7=_[_0x0948('0x7c')](_0x5313c9[_0x0948('0x35')]['ids'])?_0x5313c9['query'][_0x0948('0x79')]:[_0x5313c9[_0x0948('0x35')][_0x0948('0x79')]];var _0x1cc63a=_0x5313c9[_0x0948('0x45')]['id'];return db['Team'][_0x0948('0x51')]({'where':{'id':_0x1cc63a}})[_0x0948('0x2b')](handleEntityNotFound(_0x1ae8f3,null))[_0x0948('0x2b')](function(_0x4be1d0){if(_0x4be1d0){var _0x2c3adb=[_0x0948('0x83'),_0x0948('0x7d'),_0x0948('0x97'),_0x0948('0x7e'),_0x0948('0x7f'),_0x0948('0x80'),'Whatsapp'];return db[_0x0948('0x54')][_0x0948('0x98')](function(_0x54a21a){var _0x442f2d=_['map'](_0x2c3adb,function(_0xfba336){var _0x276366={'attributes':['id',_0x0948('0x2e')]};return _0x4be1d0['get'+_0xfba336+_0x0948('0x76')](_0x276366)[_0x0948('0x2b')](function(_0x252da8){var _0x3fe0e7=_[_0x0948('0x34')](_0x252da8,function(_0x27c7af){return _0x27c7af[_0x0948('0x96')](_0x3d23f7,{'transaction':_0x54a21a})[_0x0948('0x2b')](function(){var _0x2aadaa=_[_0x0948('0x34')](_0x3d23f7,function(_0x2a0409){socket[_0x0948('0x87')](_0x0948('0x4f')+_0xfba336+'Queue:remove',{'UserId':Number(_0x2a0409),[_0xfba336+_0x0948('0x89')]:_0x27c7af['id']});if(_0xfba336!==_0x0948('0x83')){return;}return db[_0x0948('0x8e')][_0x0948('0x5b')]({'where':{'VoiceQueueId':_0x27c7af['id'],'UserId':_0x2a0409},'transaction':_0x54a21a});});return Promise[_0x0948('0x94')](_0x2aadaa);});});return Promise[_0x0948('0x94')](_0x3fe0e7);});});return Promise[_0x0948('0x94')](_0x442f2d)[_0x0948('0x2b')](function(){return _0x4be1d0['removeAgents'](_0x3d23f7,{'transaction':_0x54a21a});})['then'](function(){return db[_0x0948('0x6b')][_0x0948('0x6f')]({'where':{'teamId':_0x1cc63a}})[_0x0948('0x2b')](function(_0x1d2acf){if(_0x1d2acf){var _0x32c662=_[_0x0948('0x34')](_0x3d23f7,function(_0x572835){db[_0x0948('0x6c')][_0x0948('0x5b')]({'where':{'UserId':_0x572835,'VoicePrefixId':_0x1d2acf[_0x0948('0x6d')]}});});return Promise[_0x0948('0x94')](_0x32c662);}});});});}})[_0x0948('0x2b')](respondWithStatusCode(_0x1ae8f3,null))['catch'](handleError(_0x1ae8f3,null));};exports[_0x0948('0x99')]=function(_0x18df17,_0x3e60c1,_0x2a7309){var _0x2536c2={};var _0x4852ce={};var _0x336550;var _0x1e3fde;return db[_0x0948('0x40')][_0x0948('0x6f')]({'where':{'id':_0x18df17[_0x0948('0x45')]['id']}})[_0x0948('0x2b')](handleEntityNotFound(_0x3e60c1,null))[_0x0948('0x2b')](function(_0x22fc14){if(_0x22fc14){_0x336550=_0x22fc14;_0x4852ce[_0x0948('0x33')]=_[_0x0948('0x9a')](db['User']['rawAttributes']);_0x4852ce[_0x0948('0x35')]=_[_0x0948('0x9a')](_0x18df17[_0x0948('0x35')]);_0x4852ce[_0x0948('0x36')]=_[_0x0948('0x37')](_0x4852ce['model'],_0x4852ce[_0x0948('0x35')]);_0x2536c2['attributes']=_[_0x0948('0x37')](_0x4852ce[_0x0948('0x33')],qs[_0x0948('0x46')](_0x18df17[_0x0948('0x35')][_0x0948('0x46')]));_0x2536c2['attributes']=_0x2536c2[_0x0948('0x38')][_0x0948('0x39')]?_0x2536c2['attributes']:_0x4852ce[_0x0948('0x33')];_0x2536c2[_0x0948('0x3a')]=qs['sort'](_0x18df17['query'][_0x0948('0x3b')]);_0x2536c2[_0x0948('0x3c')]=qs[_0x0948('0x36')](_[_0x0948('0x3d')](_0x18df17[_0x0948('0x35')],_0x4852ce[_0x0948('0x36')]));if(_0x18df17[_0x0948('0x35')][_0x0948('0x3f')]){_0x2536c2[_0x0948('0x3c')]=_[_0x0948('0x48')](_0x2536c2[_0x0948('0x3c')],{'$or':_['map'](_0x2536c2[_0x0948('0x38')],function(_0x46a135){var _0x11594d={};_0x11594d[_0x46a135]={'$like':'%'+_0x18df17['query'][_0x0948('0x3f')]+'%'};return _0x11594d;})});}_0x2536c2=_['merge']({},_0x2536c2,_0x18df17[_0x0948('0x49')]);return _0x336550[_0x0948('0x99')](_0x2536c2);}})[_0x0948('0x2b')](function(_0x2cb57d){if(_0x2cb57d){_0x1e3fde=_0x2cb57d[_0x0948('0x39')];if(!_0x18df17[_0x0948('0x35')][_0x0948('0x9b')](_0x0948('0x9c'))){_0x2536c2[_0x0948('0x25')]=qs[_0x0948('0x25')](_0x18df17[_0x0948('0x35')]['limit']);_0x2536c2[_0x0948('0x23')]=qs['offset'](_0x18df17[_0x0948('0x35')][_0x0948('0x23')]);}return _0x336550[_0x0948('0x99')](_0x2536c2);}})['then'](function(_0xc0b013){if(_0xc0b013){return _0xc0b013?{'count':_0x1e3fde,'rows':_0xc0b013}:null;}})[_0x0948('0x2b')](respondWithResult(_0x3e60c1,null))[_0x0948('0x43')](handleError(_0x3e60c1,null));};
\ No newline at end of file
index cd82276..2d6979a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1589=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x1d9be8,_0xd78fba){var _0x4b2e49=function(_0x1c8768){while(--_0x1c8768){_0x1d9be8['push'](_0x1d9be8['shift']());}};_0x4b2e49(++_0xd78fba);}(_0x1589,0x9c));var _0x9158=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x1589[_0x3bab09];return _0x164376;};'use strict';var EventEmitter=require(_0x9158('0x0'));var Team=require(_0x9158('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x9158('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9158('0x3'),'afterDestroy':_0x9158('0x4')};function emitEvent(_0xa9bb7f){return function(_0x241901,_0x3a326b,_0x473829){TeamEvents[_0x9158('0x5')](_0xa9bb7f+':'+_0x241901['id'],_0x241901);TeamEvents['emit'](_0xa9bb7f,_0x241901);_0x473829(null);};}for(var e in events){if(events[_0x9158('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x9158('0x7')]=TeamEvents;
\ No newline at end of file
+var _0x60ad=['hook','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x60ad,0x133));var _0xd60a=function(_0x6e7e94,_0x3b9414){_0x6e7e94=_0x6e7e94-0x0;var _0x1212e2=_0x60ad[_0x6e7e94];return _0x1212e2;};'use strict';var EventEmitter=require(_0xd60a('0x0'));var Team=require(_0xd60a('0x1'))['db'][_0xd60a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xd60a('0x3')](0x0);var events={'afterCreate':_0xd60a('0x4'),'afterUpdate':_0xd60a('0x5'),'afterDestroy':_0xd60a('0x6')};function emitEvent(_0x1add8b){return function(_0x257ef2,_0x5e0f93,_0x5e2481){TeamEvents[_0xd60a('0x7')](_0x1add8b+':'+_0x257ef2['id'],_0x257ef2);TeamEvents['emit'](_0x1add8b,_0x257ef2);_0x5e2481(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xd60a('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
index 5c7938d..5e8ca1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc75d=['teams','util','../../config/logger','api','bluebird','request-promise','path','./team.attributes','exports','define','Team'];(function(_0x4540f0,_0xe6dd95){var _0x52d1e6=function(_0x1641d1){while(--_0x1641d1){_0x4540f0['push'](_0x4540f0['shift']());}};_0x52d1e6(++_0xe6dd95);}(_0xc75d,0x156));var _0xdc75=function(_0x2f361b,_0x4c492e){_0x2f361b=_0x2f361b-0x0;var _0x111036=_0xc75d[_0x2f361b];return _0x111036;};'use strict';var _=require('lodash');var util=require(_0xdc75('0x0'));var logger=require(_0xdc75('0x1'))(_0xdc75('0x2'));var moment=require('moment');var BPromise=require(_0xdc75('0x3'));var rp=require(_0xdc75('0x4'));var fs=require('fs');var path=require(_0xdc75('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdc75('0x6'));module[_0xdc75('0x7')]=function(_0x289faf,_0x34ee63){return _0x289faf[_0xdc75('0x8')](_0xdc75('0x9'),attributes,{'tableName':_0xdc75('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8aca=['./team.attributes','define','Team','teams','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2710d4,_0x5097c9){var _0x396ee8=function(_0x2802f2){while(--_0x2802f2){_0x2710d4['push'](_0x2710d4['shift']());}};_0x396ee8(++_0x5097c9);}(_0x8aca,0x100));var _0xa8ac=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8aca[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xa8ac('0x0'));var util=require('util');var logger=require(_0xa8ac('0x1'))(_0xa8ac('0x2'));var moment=require(_0xa8ac('0x3'));var BPromise=require(_0xa8ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8ac('0x5'));var rimraf=require(_0xa8ac('0x6'));var config=require(_0xa8ac('0x7'));var attributes=require(_0xa8ac('0x8'));module['exports']=function(_0x1248c5,_0x2ee54d){return _0x1248c5[_0xa8ac('0x9')](_0xa8ac('0xa'),attributes,{'tableName':_0xa8ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f6d3dfa..b42ea0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46cf=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x292a5f,_0x538c48){var _0x135b28=function(_0xb220c3){while(--_0xb220c3){_0x292a5f['push'](_0x292a5f['shift']());}};_0x135b28(++_0x538c48);}(_0x46cf,0x17e));var _0xf46c=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x46cf[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0xf46c('0x0'));var util=require(_0xf46c('0x1'));var moment=require(_0xf46c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf46c('0x3'));var fs=require('fs');var Redis=require(_0xf46c('0x4'));var db=require(_0xf46c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf46c('0x6'));var jayson=require(_0xf46c('0x7'));var client=jayson[_0xf46c('0x8')]['http']({'port':0x232a});config[_0xf46c('0x9')]=_[_0xf46c('0xa')](config[_0xf46c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf46c('0xb'))(new Redis(config[_0xf46c('0x9')]));require(_0xf46c('0xc'))[_0xf46c('0xd')](socket);function respondWithRpcPromise(_0x544ce6,_0x22e950,_0x1d022a){return new BPromise(function(_0x2a6151,_0x38490d){return client[_0xf46c('0xe')](_0x544ce6,_0x1d022a)[_0xf46c('0xf')](function(_0x4aad62){logger[_0xf46c('0x10')](_0xf46c('0x11'),_0x22e950,_0xf46c('0x12'));logger[_0xf46c('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0x22e950,_0xf46c('0x12'),JSON[_0xf46c('0x14')](_0x4aad62));if(_0x4aad62[_0xf46c('0x15')]){if(_0x4aad62[_0xf46c('0x15')][_0xf46c('0x16')]===0x1f4){logger[_0xf46c('0x15')](_0xf46c('0x11'),_0x22e950,_0x4aad62[_0xf46c('0x15')]['message']);return _0x38490d(_0x4aad62[_0xf46c('0x15')][_0xf46c('0x17')]);}logger[_0xf46c('0x15')]('Team,\x20%s,\x20%s',_0x22e950,_0x4aad62['error'][_0xf46c('0x17')]);return _0x2a6151(_0x4aad62[_0xf46c('0x15')]['message']);}else{logger[_0xf46c('0x10')](_0xf46c('0x11'),_0x22e950,_0xf46c('0x12'));_0x2a6151(_0x4aad62[_0xf46c('0x18')][_0xf46c('0x17')]);}})['catch'](function(_0x10ac12){logger[_0xf46c('0x15')](_0xf46c('0x11'),_0x22e950,_0x10ac12);_0x38490d(_0x10ac12);});});}
\ No newline at end of file
+var _0x4ff1=['request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','Team,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','then','info'];(function(_0x1fa7d8,_0x404a41){var _0x6a3ee5=function(_0x50b6fe){while(--_0x50b6fe){_0x1fa7d8['push'](_0x1fa7d8['shift']());}};_0x6a3ee5(++_0x404a41);}(_0x4ff1,0xf6));var _0x14ff=function(_0x63a69b,_0x296888){_0x63a69b=_0x63a69b-0x0;var _0x425fa1=_0x4ff1[_0x63a69b];return _0x425fa1;};'use strict';var _=require(_0x14ff('0x0'));var util=require('util');var moment=require(_0x14ff('0x1'));var BPromise=require(_0x14ff('0x2'));var rs=require(_0x14ff('0x3'));var fs=require('fs');var Redis=require(_0x14ff('0x4'));var db=require(_0x14ff('0x5'))['db'];var utils=require(_0x14ff('0x6'));var logger=require(_0x14ff('0x7'))(_0x14ff('0x8'));var config=require(_0x14ff('0x9'));var jayson=require(_0x14ff('0xa'));var client=jayson['client'][_0x14ff('0xb')]({'port':0x232a});config[_0x14ff('0xc')]=_['defaults'](config[_0x14ff('0xc')],{'host':_0x14ff('0xd'),'port':0x18eb});var socket=require(_0x14ff('0xe'))(new Redis(config[_0x14ff('0xc')]));require(_0x14ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x3431b6,_0x4c6ee2,_0x39f48b){return new BPromise(function(_0x3190c1,_0x306898){return client['request'](_0x3431b6,_0x39f48b)[_0x14ff('0x10')](function(_0x2e3de5){logger[_0x14ff('0x11')]('Team,\x20%s,\x20%s',_0x4c6ee2,_0x14ff('0x12'));logger[_0x14ff('0x13')](_0x14ff('0x14'),_0x4c6ee2,_0x14ff('0x12'),JSON['stringify'](_0x2e3de5));if(_0x2e3de5['error']){if(_0x2e3de5[_0x14ff('0x15')]['code']===0x1f4){logger[_0x14ff('0x15')](_0x14ff('0x16'),_0x4c6ee2,_0x2e3de5[_0x14ff('0x15')]['message']);return _0x306898(_0x2e3de5[_0x14ff('0x15')][_0x14ff('0x17')]);}logger[_0x14ff('0x15')](_0x14ff('0x16'),_0x4c6ee2,_0x2e3de5[_0x14ff('0x15')][_0x14ff('0x17')]);return _0x3190c1(_0x2e3de5['error']['message']);}else{logger[_0x14ff('0x11')](_0x14ff('0x16'),_0x4c6ee2,'request\x20sent');_0x3190c1(_0x2e3de5['result']['message']);}})['catch'](function(_0x24fbce){logger[_0x14ff('0x15')]('Team,\x20%s,\x20%s',_0x4c6ee2,_0x24fbce);_0x306898(_0x24fbce);});});}
\ No newline at end of file
index 76497e0..0608886 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33a5=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0x1cbcb2,_0x1237a3){var _0x41ac9f=function(_0xe32e6f){while(--_0xe32e6f){_0x1cbcb2['push'](_0x1cbcb2['shift']());}};_0x41ac9f(++_0x1237a3);}(_0x33a5,0x180));var _0x533a=function(_0x16ca5e,_0x3628db){_0x16ca5e=_0x16ca5e-0x0;var _0x3dc552=_0x33a5[_0x16ca5e];return _0x3dc552;};'use strict';var TeamEvents=require(_0x533a('0x0'));var events=[_0x533a('0x1'),_0x533a('0x2'),_0x533a('0x3')];function createListener(_0xa2fa85,_0x5a3747){return function(_0xba494c){_0x5a3747[_0x533a('0x4')](_0xa2fa85,_0xba494c);};}function removeListener(_0x1013cc,_0x185ec0){return function(){TeamEvents[_0x533a('0x5')](_0x1013cc,_0x185ec0);};}exports[_0x533a('0x6')]=function(_0x295a39){for(var _0x4bac39=0x0,_0x43a54c=events[_0x533a('0x7')];_0x4bac39<_0x43a54c;_0x4bac39++){var _0x493c0b=events[_0x4bac39];var _0x19e016=createListener(_0x533a('0x8')+_0x493c0b,_0x295a39);TeamEvents['on'](_0x493c0b,_0x19e016);}};
\ No newline at end of file
+var _0x237d=['save','remove','update','emit','removeListener','./team.events'];(function(_0x261bbf,_0x567f53){var _0x3434e5=function(_0x5c194c){while(--_0x5c194c){_0x261bbf['push'](_0x261bbf['shift']());}};_0x3434e5(++_0x567f53);}(_0x237d,0x1d9));var _0xd237=function(_0x2abb3b,_0x1308b1){_0x2abb3b=_0x2abb3b-0x0;var _0x543c74=_0x237d[_0x2abb3b];return _0x543c74;};'use strict';var TeamEvents=require(_0xd237('0x0'));var events=[_0xd237('0x1'),_0xd237('0x2'),_0xd237('0x3')];function createListener(_0x4d5e1c,_0x173f47){return function(_0x12d819){_0x173f47[_0xd237('0x4')](_0x4d5e1c,_0x12d819);};}function removeListener(_0x16967d,_0x1de407){return function(){TeamEvents[_0xd237('0x5')](_0x16967d,_0x1de407);};}exports['register']=function(_0x1dfaa5){for(var _0x37e6c0=0x0,_0x5ca6e7=events['length'];_0x37e6c0<_0x5ca6e7;_0x37e6c0++){var _0x5390d7=events[_0x37e6c0];var _0x1df838=createListener('team:'+_0x5390d7,_0x1dfaa5);TeamEvents['on'](_0x5390d7,_0x1df838);}};
\ No newline at end of file
index 4865e80..2a5ea10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6037=['INTEGER','sequelize','exports'];(function(_0x4a05fa,_0x431a4f){var _0x1e9085=function(_0x19565e){while(--_0x19565e){_0x4a05fa['push'](_0x4a05fa['shift']());}};_0x1e9085(++_0x431a4f);}(_0x6037,0xe2));var _0x7603=function(_0x58f55c,_0x3d4d38){_0x58f55c=_0x58f55c-0x0;var _0x5218fb=_0x6037[_0x58f55c];return _0x5218fb;};'use strict';var Sequelize=require(_0x7603('0x0'));module[_0x7603('0x1')]={'TeamId':{'type':Sequelize[_0x7603('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa663=['INTEGER','sequelize','exports'];(function(_0x5231c6,_0xe7d50e){var _0x209ad9=function(_0x40871c){while(--_0x40871c){_0x5231c6['push'](_0x5231c6['shift']());}};_0x209ad9(++_0xe7d50e);}(_0xa663,0xc7));var _0x3a66=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0xa663[_0x5ad771];return _0x5b5dce;};'use strict';var Sequelize=require(_0x3a66('0x0'));module[_0x3a66('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x3a66('0x2')]}};
\ No newline at end of file
index b42464f..2dbf18d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd757=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd757,0x1e5));var _0x7d75=function(_0x16eac9,_0x526bb4){_0x16eac9=_0x16eac9-0x0;var _0x1dbc3b=_0xd757[_0x16eac9];return _0x1dbc3b;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require(_0x7d75('0x2'))(_0x7d75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x4'));var fs=require('fs');var path=require(_0x7d75('0x5'));var rimraf=require('rimraf');var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x52bb43,_0x5d6128){return _0x52bb43[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8721=['bluebird','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger'];(function(_0x1f9ee0,_0x2152a2){var _0x4274b5=function(_0x4c72bd){while(--_0x4c72bd){_0x1f9ee0['push'](_0x1f9ee0['shift']());}};_0x4274b5(++_0x2152a2);}(_0x8721,0xd9));var _0x1872=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x8721[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0x1872('0x0'));var util=require(_0x1872('0x1'));var logger=require(_0x1872('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1872('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1872('0x4'));var attributes=require(_0x1872('0x5'));module[_0x1872('0x6')]=function(_0x47ca3a,_0x4befaf){return _0x47ca3a[_0x1872('0x7')](_0x1872('0x8'),attributes,{'tableName':_0x1872('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a1b0d4e..b63cef4 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(_0x255b0c,_0x369bf5){var _0x12e676=function(_0x3d442f){while(--_0x3d442f){_0x255b0c['push'](_0x255b0c['shift']());}};_0x12e676(++_0x369bf5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0xcb91[_0x25fa5c];return _0x1bade2;};'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(_0x178015,_0x4bcd41){var _0x5ef3c5=function(_0x17c930){while(--_0x17c930){_0x178015['push'](_0x178015['shift']());}};_0x5ef3c5(++_0x4bcd41);}(_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 513e15f..fc828b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92d7=['INTEGER','sequelize','exports'];(function(_0x59c07f,_0x175993){var _0x2f21cf=function(_0x1433df){while(--_0x1433df){_0x59c07f['push'](_0x59c07f['shift']());}};_0x2f21cf(++_0x175993);}(_0x92d7,0x79));var _0x792d=function(_0x2fe776,_0x188aa8){_0x2fe776=_0x2fe776-0x0;var _0x1e778a=_0x92d7[_0x2fe776];return _0x1e778a;};'use strict';var Sequelize=require(_0x792d('0x0'));module[_0x792d('0x1')]={'penalty':{'type':Sequelize[_0x792d('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe1bc=['exports','INTEGER'];(function(_0xd3b8cc,_0x58b6fe){var _0x3b2d31=function(_0x405031){while(--_0x405031){_0xd3b8cc['push'](_0xd3b8cc['shift']());}};_0x3b2d31(++_0x58b6fe);}(_0xe1bc,0xf4));var _0xce1b=function(_0x408fa0,_0x55b6a7){_0x408fa0=_0x408fa0-0x0;var _0x3235a2=_0xe1bc[_0x408fa0];return _0x3235a2;};'use strict';var Sequelize=require('sequelize');module[_0xce1b('0x0')]={'penalty':{'type':Sequelize[_0xce1b('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index fd3e58c..9c125f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4876=['../../config/environment','./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','../../config/logger','bluebird','path','rimraf'];(function(_0x1c8835,_0x22ce67){var _0x41a486=function(_0xd56a5){while(--_0xd56a5){_0x1c8835['push'](_0x1c8835['shift']());}};_0x41a486(++_0x22ce67);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6487('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6487('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6487('0x2'));var rimraf=require(_0x6487('0x3'));var config=require(_0x6487('0x4'));var attributes=require(_0x6487('0x5'));module['exports']=function(_0x23e50b,_0x856b1c){return _0x23e50b['define'](_0x6487('0x6'),attributes,{'tableName':_0x6487('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea89=['TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./teamVoiceQueue.attributes','exports','define'];(function(_0x3dea20,_0x1e8e02){var _0x47f0a7=function(_0x519bb9){while(--_0x519bb9){_0x3dea20['push'](_0x3dea20['shift']());}};_0x47f0a7(++_0x1e8e02);}(_0xea89,0x1e2));var _0x9ea8=function(_0x57160c,_0x3cf2c3){_0x57160c=_0x57160c-0x0;var _0x5682d8=_0xea89[_0x57160c];return _0x5682d8;};'use strict';var _=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var logger=require(_0x9ea8('0x2'))(_0x9ea8('0x3'));var moment=require(_0x9ea8('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ea8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ea8('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ea8('0x7'));module[_0x9ea8('0x8')]=function(_0x2c6e50,_0x184f38){return _0x2c6e50[_0x9ea8('0x9')](_0x9ea8('0xa'),attributes,{'tableName':_0x9ea8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f0f408b..3f5182e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bad=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf0548f,_0x1aee2b){var _0xcf9bb6=function(_0x457ffb){while(--_0x457ffb){_0xf0548f['push'](_0xf0548f['shift']());}};_0xcf9bb6(++_0x1aee2b);}(_0x8bad,0x124));var _0xd8ba=function(_0x5e3e88,_0x4e7d55){_0x5e3e88=_0x5e3e88-0x0;var _0x3ec1b9=_0x8bad[_0x5e3e88];return _0x3ec1b9;};'use strict';var _=require(_0xd8ba('0x0'));var util=require(_0xd8ba('0x1'));var moment=require(_0xd8ba('0x2'));var BPromise=require(_0xd8ba('0x3'));var rs=require(_0xd8ba('0x4'));var fs=require('fs');var Redis=require(_0xd8ba('0x5'));var db=require(_0xd8ba('0x6'))['db'];var utils=require(_0xd8ba('0x7'));var logger=require(_0xd8ba('0x8'))('rpc');var config=require(_0xd8ba('0x9'));var jayson=require(_0xd8ba('0xa'));var client=jayson[_0xd8ba('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b43ab,_0x161e81,_0x32d554){return new BPromise(function(_0x3a0d08,_0xb32586){return client[_0xd8ba('0xc')](_0x1b43ab,_0x32d554)['then'](function(_0x2624d6){logger[_0xd8ba('0xd')](_0xd8ba('0xe'),_0x161e81,_0xd8ba('0xf'));logger[_0xd8ba('0x10')](_0xd8ba('0x11'),_0x161e81,_0xd8ba('0xf'),JSON[_0xd8ba('0x12')](_0x2624d6));if(_0x2624d6[_0xd8ba('0x13')]){if(_0x2624d6[_0xd8ba('0x13')][_0xd8ba('0x14')]===0x1f4){logger['error'](_0xd8ba('0xe'),_0x161e81,_0x2624d6[_0xd8ba('0x13')]['message']);return _0xb32586(_0x2624d6[_0xd8ba('0x13')][_0xd8ba('0x15')]);}logger[_0xd8ba('0x13')](_0xd8ba('0xe'),_0x161e81,_0x2624d6[_0xd8ba('0x13')][_0xd8ba('0x15')]);return _0x3a0d08(_0x2624d6[_0xd8ba('0x13')][_0xd8ba('0x15')]);}else{logger[_0xd8ba('0xd')](_0xd8ba('0xe'),_0x161e81,_0xd8ba('0xf'));_0x3a0d08(_0x2624d6[_0xd8ba('0x16')][_0xd8ba('0x15')]);}})['catch'](function(_0x19ec66){logger[_0xd8ba('0x13')](_0xd8ba('0xe'),_0x161e81,_0x19ec66);_0xb32586(_0x19ec66);});});}
\ No newline at end of file
+var _0xfb92=['client','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x50424f,_0x50aa88){var _0xd5e2de=function(_0x31dc63){while(--_0x31dc63){_0x50424f['push'](_0x50424f['shift']());}};_0xd5e2de(++_0x50aa88);}(_0xfb92,0x1e3));var _0x2fb9=function(_0x32bc9b,_0xe08042){_0x32bc9b=_0x32bc9b-0x0;var _0x2ed308=_0xfb92[_0x32bc9b];return _0x2ed308;};'use strict';var _=require(_0x2fb9('0x0'));var util=require('util');var moment=require(_0x2fb9('0x1'));var BPromise=require(_0x2fb9('0x2'));var rs=require(_0x2fb9('0x3'));var fs=require('fs');var Redis=require(_0x2fb9('0x4'));var db=require(_0x2fb9('0x5'))['db'];var utils=require(_0x2fb9('0x6'));var logger=require(_0x2fb9('0x7'))(_0x2fb9('0x8'));var config=require(_0x2fb9('0x9'));var jayson=require(_0x2fb9('0xa'));var client=jayson[_0x2fb9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5087b2,_0x5399f7,_0x21a33b){return new BPromise(function(_0x24651f,_0x35057b){return client['request'](_0x5087b2,_0x21a33b)['then'](function(_0x44c896){logger[_0x2fb9('0xc')](_0x2fb9('0xd'),_0x5399f7,_0x2fb9('0xe'));logger['debug'](_0x2fb9('0xf'),_0x5399f7,'request\x20sent',JSON['stringify'](_0x44c896));if(_0x44c896['error']){if(_0x44c896[_0x2fb9('0x10')][_0x2fb9('0x11')]===0x1f4){logger[_0x2fb9('0x10')](_0x2fb9('0xd'),_0x5399f7,_0x44c896[_0x2fb9('0x10')][_0x2fb9('0x12')]);return _0x35057b(_0x44c896[_0x2fb9('0x10')][_0x2fb9('0x12')]);}logger[_0x2fb9('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5399f7,_0x44c896[_0x2fb9('0x10')][_0x2fb9('0x12')]);return _0x24651f(_0x44c896[_0x2fb9('0x10')]['message']);}else{logger[_0x2fb9('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5399f7,'request\x20sent');_0x24651f(_0x44c896['result'][_0x2fb9('0x12')]);}})['catch'](function(_0x511cb9){logger['error'](_0x2fb9('0xd'),_0x5399f7,_0x511cb9);_0x35057b(_0x511cb9);});});}
\ No newline at end of file
index cf487f0..acd404f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e2=['put','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x158c19,_0x48b615){var _0x50267e=function(_0x2f5daa){while(--_0x2f5daa){_0x158c19['push'](_0x158c19['shift']());}};_0x50267e(++_0x48b615);}(_0xb7e2,0x103));var _0x2b7e=function(_0x29888c,_0x48d24a){_0x29888c=_0x29888c-0x0;var _0x23eabd=_0xb7e2[_0x29888c];return _0x23eabd;};'use strict';var multer=require(_0x2b7e('0x0'));var util=require('util');var path=require(_0x2b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x2b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2b7e('0x4'));var config=require(_0x2b7e('0x5'));var controller=require(_0x2b7e('0x6'));router[_0x2b7e('0x7')]('/',auth[_0x2b7e('0x8')](),controller[_0x2b7e('0x9')]);router['get'](_0x2b7e('0xa'),auth[_0x2b7e('0x8')](),controller[_0x2b7e('0xb')]);router['post']('/',auth[_0x2b7e('0x8')](),controller[_0x2b7e('0xc')]);router[_0x2b7e('0xd')](_0x2b7e('0xa'),auth[_0x2b7e('0x8')](),controller['update']);router['delete'](_0x2b7e('0xa'),auth[_0x2b7e('0x8')](),controller[_0x2b7e('0xe')]);module[_0x2b7e('0xf')]=router;
\ No newline at end of file
+var _0x414f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','multer','path','connect-timeout','Router','fs-extra'];(function(_0xa2cd61,_0x5cee7a){var _0x16f0ed=function(_0xce30c8){while(--_0xce30c8){_0xa2cd61['push'](_0xa2cd61['shift']());}};_0x16f0ed(++_0x5cee7a);}(_0x414f,0x13f));var _0xf414=function(_0x4c00a3,_0x2d23e2){_0x4c00a3=_0x4c00a3-0x0;var _0x893854=_0x414f[_0x4c00a3];return _0x893854;};'use strict';var multer=require(_0xf414('0x0'));var util=require('util');var path=require(_0xf414('0x1'));var timeout=require(_0xf414('0x2'));var express=require('express');var router=express[_0xf414('0x3')]();var fs_extra=require(_0xf414('0x4'));var auth=require(_0xf414('0x5'));var interaction=require(_0xf414('0x6'));var config=require(_0xf414('0x7'));var controller=require(_0xf414('0x8'));router[_0xf414('0x9')]('/',auth['isAuthenticated'](),controller[_0xf414('0xa')]);router['get'](_0xf414('0xb'),auth[_0xf414('0xc')](),controller[_0xf414('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf414('0xe')]);router[_0xf414('0xf')](_0xf414('0xb'),auth[_0xf414('0xc')](),controller[_0xf414('0x10')]);router[_0xf414('0x11')](_0xf414('0xb'),auth[_0xf414('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1df6cce..eb875ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x475f=['STRING','TEXT','sequelize','exports'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x475f,0x66));var _0xf475=function(_0x2fa3ea,_0xfe31a5){_0x2fa3ea=_0x2fa3ea-0x0;var _0x36755d=_0x475f[_0x2fa3ea];return _0x36755d;};'use strict';var Sequelize=require(_0xf475('0x0'));module[_0xf475('0x1')]={'name':{'type':Sequelize[_0xf475('0x2')]},'description':{'type':Sequelize[_0xf475('0x2')]},'html':{'type':Sequelize[_0xf475('0x3')]}};
\ No newline at end of file
+var _0xe7b7=['TEXT','sequelize','exports','STRING'];(function(_0x2a90f2,_0x4dcd95){var _0x3799f3=function(_0x86472b){while(--_0x86472b){_0x2a90f2['push'](_0x2a90f2['shift']());}};_0x3799f3(++_0x4dcd95);}(_0xe7b7,0x1c9));var _0x7e7b=function(_0x575a40,_0x1ade64){_0x575a40=_0x575a40-0x0;var _0x3404a3=_0xe7b7[_0x575a40];return _0x3404a3;};'use strict';var Sequelize=require(_0x7e7b('0x0'));module[_0x7e7b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7e7b('0x2')]},'html':{'type':Sequelize[_0x7e7b('0x3')]}};
\ No newline at end of file
index 698a229..c7ee4ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cb7=['rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','lodash','crypto','desk.js','to-csv','querystring','../../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','apply','update','then','destroy','end','stack','name','send','index','map','Template','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll'];(function(_0xa087f5,_0x34fd10){var _0x4c8806=function(_0x4b1cfe){while(--_0x4b1cfe){_0xa087f5['push'](_0xa087f5['shift']());}};_0x4c8806(++_0x34fd10);}(_0x8cb7,0x103));var _0x78cb=function(_0x26efac,_0x21ab8a){_0x26efac=_0x26efac-0x0;var _0x8482e4=_0x8cb7[_0x26efac];return _0x8482e4;};'use strict';var emlformat=require(_0x78cb('0x0'));var rimraf=require(_0x78cb('0x1'));var zipdir=require(_0x78cb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x78cb('0x3'));var moment=require(_0x78cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x78cb('0x5'));var util=require(_0x78cb('0x6'));var path=require('path');var sox=require(_0x78cb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x78cb('0x8'));var squel=require('squel');var crypto=require(_0x78cb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x78cb('0xa'));var toCsv=require(_0x78cb('0xb'));var querystring=require(_0x78cb('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78cb('0xd'));var qs=require(_0x78cb('0xe'));var as=require(_0x78cb('0xf'));var hardwareService=require(_0x78cb('0x10'));var logger=require(_0x78cb('0x11'))(_0x78cb('0x12'));var utils=require(_0x78cb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x78cb('0x14'));var db=require(_0x78cb('0x15'))['db'];function respondWithStatusCode(_0x112061,_0x51a39f){_0x51a39f=_0x51a39f||0xcc;return function(_0x6d760f){if(_0x6d760f){return _0x112061[_0x78cb('0x16')](_0x51a39f);}return _0x112061['status'](_0x51a39f)['end']();};}function respondWithResult(_0x31dbaa,_0x482be5){_0x482be5=_0x482be5||0xc8;return function(_0x47b75c){if(_0x47b75c){return _0x31dbaa[_0x78cb('0x17')](_0x482be5)[_0x78cb('0x18')](_0x47b75c);}};}function respondWithFilteredResult(_0x1d6be5,_0x24d18e){return function(_0x1b245){if(_0x1b245){var _0x107a3f=typeof _0x24d18e[_0x78cb('0x19')]===_0x78cb('0x1a')&&typeof _0x24d18e[_0x78cb('0x1b')]===_0x78cb('0x1a');var _0x5d75f7=_0x1b245[_0x78cb('0x1c')];var _0x12c091=_0x107a3f?0x0:_0x24d18e[_0x78cb('0x19')];var _0x20c2a3=_0x107a3f?_0x1b245[_0x78cb('0x1c')]:_0x24d18e[_0x78cb('0x19')]+_0x24d18e[_0x78cb('0x1b')];var _0x3b14be;if(_0x20c2a3>=_0x5d75f7){_0x20c2a3=_0x5d75f7;_0x3b14be=0xc8;}else{_0x3b14be=0xce;}_0x1d6be5[_0x78cb('0x17')](_0x3b14be);return _0x1d6be5[_0x78cb('0x1d')]('Content-Range',_0x12c091+'-'+_0x20c2a3+'/'+_0x5d75f7)[_0x78cb('0x18')](_0x1b245);}return null;};}function patchUpdates(_0x1bcb17){return function(_0x12f194){try{jsonpatch[_0x78cb('0x1e')](_0x12f194,_0x1bcb17,!![]);}catch(_0x2bfd4f){return BPromise['reject'](_0x2bfd4f);}return _0x12f194['save']();};}function saveUpdates(_0x4b7627,_0x1bcf9b){return function(_0x161b98){if(_0x161b98){return _0x161b98[_0x78cb('0x1f')](_0x4b7627)[_0x78cb('0x20')](function(_0x2dbd51){return _0x2dbd51;});}return null;};}function removeEntity(_0x4c8208,_0x70bd80){return function(_0x84b3c3){if(_0x84b3c3){return _0x84b3c3[_0x78cb('0x21')]()[_0x78cb('0x20')](function(){var _0x1de4bd=_0x84b3c3['get']({'plain':!![]});var _0x2ef116='Templates';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ef116,'resourceId':_0x1de4bd['id']}})[_0x78cb('0x20')](function(){return _0x84b3c3;});})[_0x78cb('0x20')](function(){_0x4c8208[_0x78cb('0x17')](0xcc)[_0x78cb('0x22')]();});}};}function handleEntityNotFound(_0x2c4adc,_0x5b7f90){return function(_0x308c90){if(!_0x308c90){_0x2c4adc[_0x78cb('0x16')](0x194);}return _0x308c90;};}function handleError(_0x5d4289,_0x5b5f27){_0x5b5f27=_0x5b5f27||0x1f4;return function(_0x231541){logger['error'](_0x231541[_0x78cb('0x23')]);if(_0x231541[_0x78cb('0x24')]){delete _0x231541[_0x78cb('0x24')];}_0x5d4289[_0x78cb('0x17')](_0x5b5f27)[_0x78cb('0x25')](_0x231541);};}exports[_0x78cb('0x26')]=function(_0x5e2259,_0x5056cf){var _0x33919b={},_0x828eec={},_0x5000e8={'count':0x0,'rows':[]};var _0x13263a=_[_0x78cb('0x27')](db[_0x78cb('0x28')][_0x78cb('0x29')],function(_0x8781f2){return{'name':_0x8781f2['fieldName'],'type':_0x8781f2[_0x78cb('0x2a')][_0x78cb('0x2b')]};});_0x828eec['model']=_[_0x78cb('0x27')](_0x13263a,'name');_0x828eec['query']=_[_0x78cb('0x2c')](_0x5e2259[_0x78cb('0x2d')]);_0x828eec[_0x78cb('0x2e')]=_[_0x78cb('0x2f')](_0x828eec[_0x78cb('0x30')],_0x828eec[_0x78cb('0x2d')]);_0x33919b[_0x78cb('0x31')]=_['intersection'](_0x828eec[_0x78cb('0x30')],qs[_0x78cb('0x32')](_0x5e2259['query'][_0x78cb('0x32')]));_0x33919b[_0x78cb('0x31')]=_0x33919b[_0x78cb('0x31')][_0x78cb('0x33')]?_0x33919b[_0x78cb('0x31')]:_0x828eec['model'];if(!_0x5e2259[_0x78cb('0x2d')][_0x78cb('0x34')](_0x78cb('0x35'))){_0x33919b[_0x78cb('0x1b')]=qs['limit'](_0x5e2259[_0x78cb('0x2d')][_0x78cb('0x1b')]);_0x33919b['offset']=qs['offset'](_0x5e2259[_0x78cb('0x2d')][_0x78cb('0x19')]);}_0x33919b[_0x78cb('0x36')]=qs['sort'](_0x5e2259[_0x78cb('0x2d')][_0x78cb('0x37')]);_0x33919b['where']=qs[_0x78cb('0x2e')](_[_0x78cb('0x38')](_0x5e2259[_0x78cb('0x2d')],_0x828eec['filters']),_0x13263a);if(_0x5e2259[_0x78cb('0x2d')]['filter']){_0x33919b[_0x78cb('0x39')]=_['merge'](_0x33919b[_0x78cb('0x39')],{'$or':_['map'](_0x13263a,function(_0x58f4b0){if(_0x58f4b0[_0x78cb('0x2a')]!==_0x78cb('0x3a')){var _0x4e1c83={};_0x4e1c83[_0x58f4b0['name']]={'$like':'%'+_0x5e2259[_0x78cb('0x2d')][_0x78cb('0x3b')]+'%'};return _0x4e1c83;}})});}_0x33919b=_[_0x78cb('0x3c')]({},_0x33919b,_0x5e2259[_0x78cb('0x3d')]);var _0x137110={'where':_0x33919b[_0x78cb('0x39')]};return db['Template'][_0x78cb('0x1c')](_0x137110)['then'](function(_0x4558c3){_0x5000e8['count']=_0x4558c3;if(_0x5e2259['query'][_0x78cb('0x3e')]){_0x33919b[_0x78cb('0x3f')]=[{'all':!![]}];}return db['Template'][_0x78cb('0x40')](_0x33919b);})[_0x78cb('0x20')](function(_0x240593){_0x5000e8[_0x78cb('0x41')]=_0x240593;return _0x5000e8;})[_0x78cb('0x20')](respondWithFilteredResult(_0x5056cf,_0x33919b))[_0x78cb('0x42')](handleError(_0x5056cf,null));};exports[_0x78cb('0x43')]=function(_0x5ca581,_0x5327c2){var _0x2b684c={'raw':!![],'where':{'id':_0x5ca581[_0x78cb('0x44')]['id']}},_0xc269fe={};_0xc269fe[_0x78cb('0x30')]=_[_0x78cb('0x2c')](db[_0x78cb('0x28')]['rawAttributes']);_0xc269fe[_0x78cb('0x2d')]=_[_0x78cb('0x2c')](_0x5ca581[_0x78cb('0x2d')]);_0xc269fe[_0x78cb('0x2e')]=_[_0x78cb('0x2f')](_0xc269fe['model'],_0xc269fe[_0x78cb('0x2d')]);_0x2b684c[_0x78cb('0x31')]=_[_0x78cb('0x2f')](_0xc269fe['model'],qs['fields'](_0x5ca581[_0x78cb('0x2d')][_0x78cb('0x32')]));_0x2b684c[_0x78cb('0x31')]=_0x2b684c[_0x78cb('0x31')][_0x78cb('0x33')]?_0x2b684c[_0x78cb('0x31')]:_0xc269fe[_0x78cb('0x30')];if(_0x5ca581[_0x78cb('0x2d')][_0x78cb('0x3e')]){_0x2b684c[_0x78cb('0x3f')]=[{'all':!![]}];}_0x2b684c=_['merge']({},_0x2b684c,_0x5ca581[_0x78cb('0x3d')]);return db[_0x78cb('0x28')][_0x78cb('0x45')](_0x2b684c)[_0x78cb('0x20')](handleEntityNotFound(_0x5327c2,null))[_0x78cb('0x20')](respondWithResult(_0x5327c2,null))[_0x78cb('0x42')](handleError(_0x5327c2,null));};exports[_0x78cb('0x46')]=function(_0x47faa2,_0x203b76){return db[_0x78cb('0x28')][_0x78cb('0x46')](_0x47faa2[_0x78cb('0x47')],{})[_0x78cb('0x20')](function(_0x567662){var _0x466b7d=_0x47faa2[_0x78cb('0x48')][_0x78cb('0x49')]({'plain':!![]});if(!_0x466b7d)throw new Error(_0x78cb('0x4a'));if(_0x466b7d[_0x78cb('0x4b')]===_0x78cb('0x48')){var _0x3306d8=_0x567662[_0x78cb('0x49')]({'plain':!![]});var _0x10fdef=_0x78cb('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x10fdef,'userProfileId':_0x466b7d[_0x78cb('0x4d')]},'raw':!![]})['then'](function(_0x4c6f77){if(_0x4c6f77&&_0x4c6f77[_0x78cb('0x4e')]===0x0){return db[_0x78cb('0x4f')]['create']({'name':_0x3306d8[_0x78cb('0x24')],'resourceId':_0x3306d8['id'],'type':_0x4c6f77[_0x78cb('0x24')],'sectionId':_0x4c6f77['id']},{})['then'](function(){return _0x567662;});}else{return _0x567662;}})[_0x78cb('0x42')](function(_0x1e54ce){logger['error'](_0x78cb('0x50'),_0x1e54ce);throw _0x1e54ce;});}return _0x567662;})[_0x78cb('0x20')](respondWithResult(_0x203b76,0xc9))[_0x78cb('0x42')](handleError(_0x203b76,null));};exports[_0x78cb('0x1f')]=function(_0x261fd6,_0x52f4bb){if(_0x261fd6[_0x78cb('0x47')]['id']){delete _0x261fd6[_0x78cb('0x47')]['id'];}return db[_0x78cb('0x28')][_0x78cb('0x45')]({'where':{'id':_0x261fd6[_0x78cb('0x44')]['id']}})[_0x78cb('0x20')](handleEntityNotFound(_0x52f4bb,null))[_0x78cb('0x20')](saveUpdates(_0x261fd6[_0x78cb('0x47')],null))[_0x78cb('0x20')](respondWithResult(_0x52f4bb,null))[_0x78cb('0x42')](handleError(_0x52f4bb,null));};exports[_0x78cb('0x21')]=function(_0x3faff7,_0x46576d){return db[_0x78cb('0x28')][_0x78cb('0x45')]({'where':{'id':_0x3faff7['params']['id']}})[_0x78cb('0x20')](handleEntityNotFound(_0x46576d,null))[_0x78cb('0x20')](removeEntity(_0x46576d,null))[_0x78cb('0x42')](handleError(_0x46576d,null));};
\ No newline at end of file
+var _0xb897=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','Templates','UserProfileResource','then','error','name','send','index','map','Template','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','rows','catch','params','rawAttributes','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x301593,_0x14d1df){var _0x2efb3f=function(_0x59c569){while(--_0x59c569){_0x301593['push'](_0x301593['shift']());}};_0x2efb3f(++_0x14d1df);}(_0xb897,0xfe));var _0x7b89=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xb897[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0x7b89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b89('0x1'));var jsonpatch=require(_0x7b89('0x2'));var rp=require(_0x7b89('0x3'));var moment=require('moment');var BPromise=require(_0x7b89('0x4'));var Mustache=require(_0x7b89('0x5'));var util=require(_0x7b89('0x6'));var path=require(_0x7b89('0x7'));var sox=require(_0x7b89('0x8'));var csv=require(_0x7b89('0x9'));var ejs=require(_0x7b89('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b89('0xb'));var squel=require(_0x7b89('0xc'));var crypto=require(_0x7b89('0xd'));var jsforce=require(_0x7b89('0xe'));var deskjs=require(_0x7b89('0xf'));var toCsv=require(_0x7b89('0x9'));var querystring=require(_0x7b89('0x10'));var Papa=require(_0x7b89('0x11'));var Redis=require('ioredis');var authService=require(_0x7b89('0x12'));var qs=require(_0x7b89('0x13'));var as=require(_0x7b89('0x14'));var hardwareService=require(_0x7b89('0x15'));var logger=require(_0x7b89('0x16'))(_0x7b89('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b89('0x18'));var db=require(_0x7b89('0x19'))['db'];function respondWithStatusCode(_0x247b62,_0x41fa4d){_0x41fa4d=_0x41fa4d||0xcc;return function(_0x17865d){if(_0x17865d){return _0x247b62['sendStatus'](_0x41fa4d);}return _0x247b62[_0x7b89('0x1a')](_0x41fa4d)[_0x7b89('0x1b')]();};}function respondWithResult(_0x24bbd3,_0x4fe754){_0x4fe754=_0x4fe754||0xc8;return function(_0x1c0381){if(_0x1c0381){return _0x24bbd3[_0x7b89('0x1a')](_0x4fe754)[_0x7b89('0x1c')](_0x1c0381);}};}function respondWithFilteredResult(_0x38b58a,_0x4db766){return function(_0x1bb61d){if(_0x1bb61d){var _0x366c24=typeof _0x4db766[_0x7b89('0x1d')]==='undefined'&&typeof _0x4db766[_0x7b89('0x1e')]===_0x7b89('0x1f');var _0x50c278=_0x1bb61d[_0x7b89('0x20')];var _0x1b4906=_0x366c24?0x0:_0x4db766[_0x7b89('0x1d')];var _0x58b57e=_0x366c24?_0x1bb61d['count']:_0x4db766[_0x7b89('0x1d')]+_0x4db766[_0x7b89('0x1e')];var _0x4fdb3a;if(_0x58b57e>=_0x50c278){_0x58b57e=_0x50c278;_0x4fdb3a=0xc8;}else{_0x4fdb3a=0xce;}_0x38b58a[_0x7b89('0x1a')](_0x4fdb3a);return _0x38b58a[_0x7b89('0x21')](_0x7b89('0x22'),_0x1b4906+'-'+_0x58b57e+'/'+_0x50c278)[_0x7b89('0x1c')](_0x1bb61d);}return null;};}function patchUpdates(_0x65b5d7){return function(_0x2ab979){try{jsonpatch[_0x7b89('0x23')](_0x2ab979,_0x65b5d7,!![]);}catch(_0x5e58d3){return BPromise[_0x7b89('0x24')](_0x5e58d3);}return _0x2ab979[_0x7b89('0x25')]();};}function saveUpdates(_0x4a4c04,_0x55b5b6){return function(_0x36d34b){if(_0x36d34b){return _0x36d34b[_0x7b89('0x26')](_0x4a4c04)['then'](function(_0x3028c6){return _0x3028c6;});}return null;};}function removeEntity(_0x59cc34,_0x24b740){return function(_0x1da0a0){if(_0x1da0a0){return _0x1da0a0[_0x7b89('0x27')]()['then'](function(){var _0x268f55=_0x1da0a0[_0x7b89('0x28')]({'plain':!![]});var _0x4455b6=_0x7b89('0x29');return db[_0x7b89('0x2a')][_0x7b89('0x27')]({'where':{'type':_0x4455b6,'resourceId':_0x268f55['id']}})[_0x7b89('0x2b')](function(){return _0x1da0a0;});})[_0x7b89('0x2b')](function(){_0x59cc34[_0x7b89('0x1a')](0xcc)[_0x7b89('0x1b')]();});}};}function handleEntityNotFound(_0x3d7609,_0xd5b0ce){return function(_0x11788a){if(!_0x11788a){_0x3d7609['sendStatus'](0x194);}return _0x11788a;};}function handleError(_0x7fb88e,_0x1a3be1){_0x1a3be1=_0x1a3be1||0x1f4;return function(_0x2ede9c){logger[_0x7b89('0x2c')](_0x2ede9c['stack']);if(_0x2ede9c[_0x7b89('0x2d')]){delete _0x2ede9c[_0x7b89('0x2d')];}_0x7fb88e[_0x7b89('0x1a')](_0x1a3be1)[_0x7b89('0x2e')](_0x2ede9c);};}exports[_0x7b89('0x2f')]=function(_0x40462d,_0x13f943){var _0x198f17={},_0x6c316e={},_0x3dbda6={'count':0x0,'rows':[]};var _0x1537da=_[_0x7b89('0x30')](db[_0x7b89('0x31')]['rawAttributes'],function(_0x1e5c64){return{'name':_0x1e5c64[_0x7b89('0x32')],'type':_0x1e5c64['type'][_0x7b89('0x33')]};});_0x6c316e[_0x7b89('0x34')]=_[_0x7b89('0x30')](_0x1537da,_0x7b89('0x2d'));_0x6c316e['query']=_[_0x7b89('0x35')](_0x40462d[_0x7b89('0x36')]);_0x6c316e[_0x7b89('0x37')]=_['intersection'](_0x6c316e[_0x7b89('0x34')],_0x6c316e['query']);_0x198f17[_0x7b89('0x38')]=_['intersection'](_0x6c316e['model'],qs['fields'](_0x40462d[_0x7b89('0x36')][_0x7b89('0x39')]));_0x198f17[_0x7b89('0x38')]=_0x198f17[_0x7b89('0x38')][_0x7b89('0x3a')]?_0x198f17[_0x7b89('0x38')]:_0x6c316e[_0x7b89('0x34')];if(!_0x40462d['query'][_0x7b89('0x3b')]('nolimit')){_0x198f17[_0x7b89('0x1e')]=qs[_0x7b89('0x1e')](_0x40462d[_0x7b89('0x36')][_0x7b89('0x1e')]);_0x198f17[_0x7b89('0x1d')]=qs[_0x7b89('0x1d')](_0x40462d[_0x7b89('0x36')][_0x7b89('0x1d')]);}_0x198f17[_0x7b89('0x3c')]=qs[_0x7b89('0x3d')](_0x40462d['query'][_0x7b89('0x3d')]);_0x198f17[_0x7b89('0x3e')]=qs[_0x7b89('0x37')](_['pick'](_0x40462d[_0x7b89('0x36')],_0x6c316e[_0x7b89('0x37')]),_0x1537da);if(_0x40462d[_0x7b89('0x36')][_0x7b89('0x3f')]){_0x198f17['where']=_[_0x7b89('0x40')](_0x198f17[_0x7b89('0x3e')],{'$or':_[_0x7b89('0x30')](_0x1537da,function(_0x4c0be0){if(_0x4c0be0[_0x7b89('0x41')]!==_0x7b89('0x42')){var _0x5371b3={};_0x5371b3[_0x4c0be0['name']]={'$like':'%'+_0x40462d['query'][_0x7b89('0x3f')]+'%'};return _0x5371b3;}})});}_0x198f17=_[_0x7b89('0x40')]({},_0x198f17,_0x40462d[_0x7b89('0x43')]);var _0x20c2e2={'where':_0x198f17['where']};return db[_0x7b89('0x31')][_0x7b89('0x20')](_0x20c2e2)[_0x7b89('0x2b')](function(_0xb72dc0){_0x3dbda6[_0x7b89('0x20')]=_0xb72dc0;if(_0x40462d[_0x7b89('0x36')]['includeAll']){_0x198f17['include']=[{'all':!![]}];}return db[_0x7b89('0x31')]['findAll'](_0x198f17);})[_0x7b89('0x2b')](function(_0x2a7fba){_0x3dbda6[_0x7b89('0x44')]=_0x2a7fba;return _0x3dbda6;})['then'](respondWithFilteredResult(_0x13f943,_0x198f17))[_0x7b89('0x45')](handleError(_0x13f943,null));};exports['show']=function(_0x39e631,_0x1f4efe){var _0xdef5df={'raw':!![],'where':{'id':_0x39e631[_0x7b89('0x46')]['id']}},_0x1abe14={};_0x1abe14['model']=_[_0x7b89('0x35')](db['Template'][_0x7b89('0x47')]);_0x1abe14[_0x7b89('0x36')]=_[_0x7b89('0x35')](_0x39e631[_0x7b89('0x36')]);_0x1abe14[_0x7b89('0x37')]=_[_0x7b89('0x48')](_0x1abe14[_0x7b89('0x34')],_0x1abe14[_0x7b89('0x36')]);_0xdef5df['attributes']=_[_0x7b89('0x48')](_0x1abe14[_0x7b89('0x34')],qs[_0x7b89('0x39')](_0x39e631[_0x7b89('0x36')]['fields']));_0xdef5df['attributes']=_0xdef5df[_0x7b89('0x38')][_0x7b89('0x3a')]?_0xdef5df[_0x7b89('0x38')]:_0x1abe14['model'];if(_0x39e631[_0x7b89('0x36')]['includeAll']){_0xdef5df['include']=[{'all':!![]}];}_0xdef5df=_[_0x7b89('0x40')]({},_0xdef5df,_0x39e631[_0x7b89('0x43')]);return db[_0x7b89('0x31')][_0x7b89('0x49')](_0xdef5df)[_0x7b89('0x2b')](handleEntityNotFound(_0x1f4efe,null))[_0x7b89('0x2b')](respondWithResult(_0x1f4efe,null))['catch'](handleError(_0x1f4efe,null));};exports[_0x7b89('0x4a')]=function(_0x2d34dc,_0xaacee3){return db['Template']['create'](_0x2d34dc[_0x7b89('0x4b')],{})['then'](function(_0x406564){var _0x44b82c=_0x2d34dc[_0x7b89('0x4c')]['get']({'plain':!![]});if(!_0x44b82c)throw new Error(_0x7b89('0x4d'));if(_0x44b82c[_0x7b89('0x4e')]===_0x7b89('0x4c')){var _0x143516=_0x406564['get']({'plain':!![]});var _0x52edc6=_0x7b89('0x29');return db[_0x7b89('0x4f')]['find']({'where':{'name':_0x52edc6,'userProfileId':_0x44b82c[_0x7b89('0x50')]},'raw':!![]})[_0x7b89('0x2b')](function(_0xa0aa2a){if(_0xa0aa2a&&_0xa0aa2a[_0x7b89('0x51')]===0x0){return db[_0x7b89('0x2a')][_0x7b89('0x4a')]({'name':_0x143516[_0x7b89('0x2d')],'resourceId':_0x143516['id'],'type':_0xa0aa2a[_0x7b89('0x2d')],'sectionId':_0xa0aa2a['id']},{})[_0x7b89('0x2b')](function(){return _0x406564;});}else{return _0x406564;}})['catch'](function(_0xeae356){logger[_0x7b89('0x2c')](_0x7b89('0x52'),_0xeae356);throw _0xeae356;});}return _0x406564;})[_0x7b89('0x2b')](respondWithResult(_0xaacee3,0xc9))['catch'](handleError(_0xaacee3,null));};exports[_0x7b89('0x26')]=function(_0x49fe93,_0x3bde48){if(_0x49fe93[_0x7b89('0x4b')]['id']){delete _0x49fe93['body']['id'];}return db[_0x7b89('0x31')]['find']({'where':{'id':_0x49fe93['params']['id']}})['then'](handleEntityNotFound(_0x3bde48,null))[_0x7b89('0x2b')](saveUpdates(_0x49fe93[_0x7b89('0x4b')],null))[_0x7b89('0x2b')](respondWithResult(_0x3bde48,null))['catch'](handleError(_0x3bde48,null));};exports[_0x7b89('0x27')]=function(_0xb374ef,_0x22b6d5){return db[_0x7b89('0x31')]['find']({'where':{'id':_0xb374ef[_0x7b89('0x46')]['id']}})[_0x7b89('0x2b')](handleEntityNotFound(_0x22b6d5,null))[_0x7b89('0x2b')](removeEntity(_0x22b6d5,null))[_0x7b89('0x45')](handleError(_0x22b6d5,null));};
\ No newline at end of file
index 3857ebe..7f800e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6144=['request-promise','path','rimraf','./template.attributes','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird'];(function(_0x59008b,_0x75ea97){var _0x20359c=function(_0x3e3199){while(--_0x3e3199){_0x59008b['push'](_0x59008b['shift']());}};_0x20359c(++_0x75ea97);}(_0x6144,0x14b));var _0x4614=function(_0x252f86,_0x581f72){_0x252f86=_0x252f86-0x0;var _0x3e2fc1=_0x6144[_0x252f86];return _0x3e2fc1;};'use strict';var _=require(_0x4614('0x0'));var util=require('util');var logger=require(_0x4614('0x1'))(_0x4614('0x2'));var moment=require(_0x4614('0x3'));var BPromise=require(_0x4614('0x4'));var rp=require(_0x4614('0x5'));var fs=require('fs');var path=require(_0x4614('0x6'));var rimraf=require(_0x4614('0x7'));var config=require('../../config/environment');var attributes=require(_0x4614('0x8'));module['exports']=function(_0xbec9c7,_0x1c52b7){return _0xbec9c7[_0x4614('0x9')](_0x4614('0xa'),attributes,{'tableName':_0x4614('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7595=['tools_templates','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','define','Template'];(function(_0x189371,_0x41008e){var _0xd76c39=function(_0x1cbb20){while(--_0x1cbb20){_0x189371['push'](_0x189371['shift']());}};_0xd76c39(++_0x41008e);}(_0x7595,0x121));var _0x5759=function(_0x241e61,_0x51e5ea){_0x241e61=_0x241e61-0x0;var _0x409de4=_0x7595[_0x241e61];return _0x409de4;};'use strict';var _=require(_0x5759('0x0'));var util=require(_0x5759('0x1'));var logger=require('../../config/logger')(_0x5759('0x2'));var moment=require(_0x5759('0x3'));var BPromise=require('bluebird');var rp=require(_0x5759('0x4'));var fs=require('fs');var path=require(_0x5759('0x5'));var rimraf=require(_0x5759('0x6'));var config=require(_0x5759('0x7'));var attributes=require(_0x5759('0x8'));module['exports']=function(_0x3792a2,_0x445add){return _0x3792a2[_0x5759('0x9')](_0x5759('0xa'),attributes,{'tableName':_0x5759('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aeec7d4..79b7860 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f39=['result','catch','Template','options','raw','where','attributes','limit','include','map','model','then','GetTemplate','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message'];(function(_0x4c8309,_0x5d7657){var _0x2ceb44=function(_0x436911){while(--_0x436911){_0x4c8309['push'](_0x4c8309['shift']());}};_0x2ceb44(++_0x5d7657);}(_0x5f39,0x6a));var _0x95f3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5f39[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x95f3('0x0'));var moment=require(_0x95f3('0x1'));var BPromise=require(_0x95f3('0x2'));var rs=require(_0x95f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x95f3('0x5'))(_0x95f3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x95f3('0x7')][_0x95f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x514c04,_0x236f6d,_0x58dd7d){return new BPromise(function(_0x28792a,_0x333666){return client['request'](_0x514c04,_0x58dd7d)['then'](function(_0xc79df4){logger[_0x95f3('0x9')]('Template,\x20%s,\x20%s',_0x236f6d,_0x95f3('0xa'));logger[_0x95f3('0xb')](_0x95f3('0xc'),_0x236f6d,'request\x20sent',JSON[_0x95f3('0xd')](_0xc79df4));if(_0xc79df4[_0x95f3('0xe')]){if(_0xc79df4[_0x95f3('0xe')][_0x95f3('0xf')]===0x1f4){logger[_0x95f3('0xe')](_0x95f3('0x10'),_0x236f6d,_0xc79df4[_0x95f3('0xe')][_0x95f3('0x11')]);return _0x333666(_0xc79df4['error'][_0x95f3('0x11')]);}logger[_0x95f3('0xe')](_0x95f3('0x10'),_0x236f6d,_0xc79df4[_0x95f3('0xe')][_0x95f3('0x11')]);return _0x28792a(_0xc79df4[_0x95f3('0xe')][_0x95f3('0x11')]);}else{logger[_0x95f3('0x9')](_0x95f3('0x10'),_0x236f6d,_0x95f3('0xa'));_0x28792a(_0xc79df4[_0x95f3('0x12')][_0x95f3('0x11')]);}})[_0x95f3('0x13')](function(_0xe8919d){logger[_0x95f3('0xe')](_0x95f3('0x10'),_0x236f6d,_0xe8919d);_0x333666(_0xe8919d);});});}exports['GetTemplate']=function(_0x317815){var _0x44bbcc=this;return new Promise(function(_0x43435f,_0x59e18a){return db[_0x95f3('0x14')]['findAll']({'raw':_0x317815[_0x95f3('0x15')]?_0x317815['options'][_0x95f3('0x16')]===undefined?!![]:![]:!![],'where':_0x317815[_0x95f3('0x15')]?_0x317815['options'][_0x95f3('0x17')]||null:null,'attributes':_0x317815[_0x95f3('0x15')]?_0x317815[_0x95f3('0x15')][_0x95f3('0x18')]||null:null,'limit':_0x317815[_0x95f3('0x15')]?_0x317815[_0x95f3('0x15')][_0x95f3('0x19')]||null:null,'include':_0x317815[_0x95f3('0x15')]?_0x317815[_0x95f3('0x15')][_0x95f3('0x1a')]?_[_0x95f3('0x1b')](_0x317815[_0x95f3('0x15')][_0x95f3('0x1a')],function(_0x8b22ae){return{'model':db[_0x8b22ae[_0x95f3('0x1c')]],'as':_0x8b22ae['as'],'attributes':_0x8b22ae['attributes'],'include':_0x8b22ae[_0x95f3('0x1a')]?_[_0x95f3('0x1b')](_0x8b22ae['include'],function(_0x50c79c){return{'model':db[_0x50c79c[_0x95f3('0x1c')]],'as':_0x50c79c['as'],'attributes':_0x50c79c['attributes'],'include':_0x50c79c['include']?_[_0x95f3('0x1b')](_0x50c79c['include'],function(_0x54bde4){return{'model':db[_0x54bde4[_0x95f3('0x1c')]],'as':_0x54bde4['as'],'attributes':_0x54bde4[_0x95f3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x95f3('0x1d')](function(_0x367424){logger[_0x95f3('0x9')](_0x95f3('0x1e'),_0x317815);logger['debug'](_0x95f3('0x1e'),_0x317815,JSON[_0x95f3('0xd')](_0x367424));_0x43435f(_0x367424);})[_0x95f3('0x13')](function(_0x586ccd){logger['error'](_0x95f3('0x1e'),_0x586ccd['message'],_0x317815);_0x59e18a(_0x44bbcc[_0x95f3('0xe')](0x1f4,_0x586ccd[_0x95f3('0x11')]));});});};
\ No newline at end of file
+var _0xf5fd=['error','message','result','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf5fd,0xe0));var _0xdf5f=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xf5fd[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0xdf5f('0x0'));var util=require('util');var moment=require(_0xdf5f('0x1'));var BPromise=require('bluebird');var rs=require(_0xdf5f('0x2'));var fs=require('fs');var Redis=require(_0xdf5f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf5f('0x4'));var logger=require('../../config/logger')(_0xdf5f('0x5'));var config=require('../../config/environment');var jayson=require(_0xdf5f('0x6'));var client=jayson[_0xdf5f('0x7')][_0xdf5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a4f39,_0x98b947,_0x3846e3){return new BPromise(function(_0x3f35e5,_0x380ff0){return client['request'](_0x1a4f39,_0x3846e3)[_0xdf5f('0x9')](function(_0x2937eb){logger[_0xdf5f('0xa')](_0xdf5f('0xb'),_0x98b947,_0xdf5f('0xc'));logger[_0xdf5f('0xd')](_0xdf5f('0xe'),_0x98b947,_0xdf5f('0xc'),JSON[_0xdf5f('0xf')](_0x2937eb));if(_0x2937eb[_0xdf5f('0x10')]){if(_0x2937eb[_0xdf5f('0x10')]['code']===0x1f4){logger['error'](_0xdf5f('0xb'),_0x98b947,_0x2937eb[_0xdf5f('0x10')]['message']);return _0x380ff0(_0x2937eb[_0xdf5f('0x10')][_0xdf5f('0x11')]);}logger['error'](_0xdf5f('0xb'),_0x98b947,_0x2937eb[_0xdf5f('0x10')]['message']);return _0x3f35e5(_0x2937eb[_0xdf5f('0x10')][_0xdf5f('0x11')]);}else{logger[_0xdf5f('0xa')]('Template,\x20%s,\x20%s',_0x98b947,_0xdf5f('0xc'));_0x3f35e5(_0x2937eb[_0xdf5f('0x12')][_0xdf5f('0x11')]);}})['catch'](function(_0x4f3991){logger[_0xdf5f('0x10')](_0xdf5f('0xb'),_0x98b947,_0x4f3991);_0x380ff0(_0x4f3991);});});}exports[_0xdf5f('0x13')]=function(_0x28cb38){var _0x30281e=this;return new Promise(function(_0xf22982,_0x3dd5a0){return db[_0xdf5f('0x14')][_0xdf5f('0x15')]({'raw':_0x28cb38[_0xdf5f('0x16')]?_0x28cb38['options'][_0xdf5f('0x17')]===undefined?!![]:![]:!![],'where':_0x28cb38[_0xdf5f('0x16')]?_0x28cb38['options']['where']||null:null,'attributes':_0x28cb38[_0xdf5f('0x16')]?_0x28cb38[_0xdf5f('0x16')][_0xdf5f('0x18')]||null:null,'limit':_0x28cb38[_0xdf5f('0x16')]?_0x28cb38[_0xdf5f('0x16')][_0xdf5f('0x19')]||null:null,'include':_0x28cb38['options']?_0x28cb38[_0xdf5f('0x16')][_0xdf5f('0x1a')]?_['map'](_0x28cb38[_0xdf5f('0x16')]['include'],function(_0x38ef20){return{'model':db[_0x38ef20['model']],'as':_0x38ef20['as'],'attributes':_0x38ef20['attributes'],'include':_0x38ef20[_0xdf5f('0x1a')]?_[_0xdf5f('0x1b')](_0x38ef20[_0xdf5f('0x1a')],function(_0x5b31a3){return{'model':db[_0x5b31a3[_0xdf5f('0x1c')]],'as':_0x5b31a3['as'],'attributes':_0x5b31a3['attributes'],'include':_0x5b31a3[_0xdf5f('0x1a')]?_['map'](_0x5b31a3['include'],function(_0x54ae10){return{'model':db[_0x54ae10[_0xdf5f('0x1c')]],'as':_0x54ae10['as'],'attributes':_0x54ae10[_0xdf5f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f5d4c){logger[_0xdf5f('0xa')]('GetTemplate',_0x28cb38);logger[_0xdf5f('0xd')](_0xdf5f('0x13'),_0x28cb38,JSON[_0xdf5f('0xf')](_0x3f5d4c));_0xf22982(_0x3f5d4c);})[_0xdf5f('0x1d')](function(_0x3a88c6){logger[_0xdf5f('0x10')]('GetTemplate',_0x3a88c6['message'],_0x28cb38);_0x3dd5a0(_0x30281e[_0xdf5f('0x10')](0x1f4,_0x3a88c6[_0xdf5f('0x11')]));});});};
\ No newline at end of file
index c072763..6d2d2be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a84=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','/:id/all_conditions','getAllConditions','getAnyConditions','getActions','addAllCondition','post','/:id/any_conditions','addAnyCondition','addAction','put'];(function(_0x234db0,_0x14fe54){var _0x368723=function(_0x1bb6e1){while(--_0x1bb6e1){_0x234db0['push'](_0x234db0['shift']());}};_0x368723(++_0x14fe54);}(_0x2a84,0x170));var _0x42a8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2a84[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x42a8('0x0'));var util=require(_0x42a8('0x1'));var path=require('path');var timeout=require(_0x42a8('0x2'));var express=require(_0x42a8('0x3'));var router=express[_0x42a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x42a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42a8('0x6'));var controller=require(_0x42a8('0x7'));router[_0x42a8('0x8')]('/',auth['isAuthenticated'](),controller[_0x42a8('0x9')]);router['get'](_0x42a8('0xa'),auth[_0x42a8('0xb')](),controller['show']);router[_0x42a8('0x8')](_0x42a8('0xc'),auth['isAuthenticated'](),controller[_0x42a8('0xd')]);router[_0x42a8('0x8')]('/:id/any_conditions',auth[_0x42a8('0xb')](),controller[_0x42a8('0xe')]);router[_0x42a8('0x8')]('/:id/actions',auth['isAuthenticated'](),controller[_0x42a8('0xf')]);router['post']('/',auth[_0x42a8('0xb')](),controller['create']);router['post'](_0x42a8('0xc'),auth[_0x42a8('0xb')](),controller[_0x42a8('0x10')]);router[_0x42a8('0x11')](_0x42a8('0x12'),auth[_0x42a8('0xb')](),controller[_0x42a8('0x13')]);router[_0x42a8('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x42a8('0x14')]);router[_0x42a8('0x15')](_0x42a8('0xa'),auth['isAuthenticated'](),controller[_0x42a8('0x16')]);router[_0x42a8('0x17')](_0x42a8('0xa'),auth[_0x42a8('0xb')](),controller[_0x42a8('0x18')]);module[_0x42a8('0x19')]=router;
\ No newline at end of file
+var _0xae3f=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','put','/:id','delete'];(function(_0xa68a32,_0x54036d){var _0x1e4b16=function(_0x4e68c9){while(--_0x4e68c9){_0xa68a32['push'](_0xa68a32['shift']());}};_0x1e4b16(++_0x54036d);}(_0xae3f,0x136));var _0xfae3=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xae3f[_0x46e363];return _0x3fb059;};'use strict';var multer=require('multer');var util=require(_0xfae3('0x0'));var path=require(_0xfae3('0x1'));var timeout=require(_0xfae3('0x2'));var express=require(_0xfae3('0x3'));var router=express[_0xfae3('0x4')]();var fs_extra=require(_0xfae3('0x5'));var auth=require(_0xfae3('0x6'));var interaction=require(_0xfae3('0x7'));var config=require(_0xfae3('0x8'));var controller=require(_0xfae3('0x9'));router[_0xfae3('0xa')]('/',auth[_0xfae3('0xb')](),controller[_0xfae3('0xc')]);router[_0xfae3('0xa')]('/:id',auth[_0xfae3('0xb')](),controller[_0xfae3('0xd')]);router[_0xfae3('0xa')](_0xfae3('0xe'),auth[_0xfae3('0xb')](),controller[_0xfae3('0xf')]);router['get'](_0xfae3('0x10'),auth[_0xfae3('0xb')](),controller[_0xfae3('0x11')]);router[_0xfae3('0xa')](_0xfae3('0x12'),auth[_0xfae3('0xb')](),controller[_0xfae3('0x13')]);router[_0xfae3('0x14')]('/',auth[_0xfae3('0xb')](),controller[_0xfae3('0x15')]);router[_0xfae3('0x14')](_0xfae3('0xe'),auth[_0xfae3('0xb')](),controller['addAllCondition']);router['post'](_0xfae3('0x10'),auth[_0xfae3('0xb')](),controller[_0xfae3('0x16')]);router[_0xfae3('0x14')](_0xfae3('0x12'),auth['isAuthenticated'](),controller['addAction']);router[_0xfae3('0x17')](_0xfae3('0x18'),auth[_0xfae3('0xb')](),controller['update']);router[_0xfae3('0x19')](_0xfae3('0x18'),auth['isAuthenticated'](),controller[_0xfae3('0x1a')]);module[_0xfae3('0x1b')]=router;
\ No newline at end of file
index d1c6d8e..c255258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe208=['sequelize','exports','STRING','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe208,0xa8));var _0x8e20=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xe208[_0x47a349];return _0x18ab75;};'use strict';var Sequelize=require(_0x8e20('0x0'));module[_0x8e20('0x1')]={'name':{'type':Sequelize[_0x8e20('0x2')]},'channel':{'type':Sequelize[_0x8e20('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x8e20('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x81e6=['STRING','BOOLEAN','exports'];(function(_0x3a0f87,_0x449ec5){var _0x155c60=function(_0x4dbe7c){while(--_0x4dbe7c){_0x3a0f87['push'](_0x3a0f87['shift']());}};_0x155c60(++_0x449ec5);}(_0x81e6,0x10a));var _0x681e=function(_0x354594,_0x2a4b90){_0x354594=_0x354594-0x0;var _0x4a5943=_0x81e6[_0x354594];return _0x4a5943;};'use strict';var Sequelize=require('sequelize');module[_0x681e('0x0')]={'name':{'type':Sequelize[_0x681e('0x1')]},'channel':{'type':Sequelize[_0x681e('0x1')]},'description':{'type':Sequelize[_0x681e('0x1')]},'status':{'type':Sequelize[_0x681e('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 9377745..389cefc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeaa7=['create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','TriggerAllId','addAnyCondition','getAllConditions','findOne','Condition','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','save','then','destroy','get','UserProfileResource','error','name','send','index','Trigger','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','keys','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','userProfileId','autoAssociation'];(function(_0x1d70a8,_0x23bbe7){var _0x44e198=function(_0x4874e7){while(--_0x4874e7){_0x1d70a8['push'](_0x1d70a8['shift']());}};_0x44e198(++_0x23bbe7);}(_0xeaa7,0x18f));var _0x7eaa=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0xeaa7[_0xa9a245];return _0x2d0eaa;};'use strict';var emlformat=require(_0x7eaa('0x0'));var rimraf=require(_0x7eaa('0x1'));var zipdir=require(_0x7eaa('0x2'));var jsonpatch=require(_0x7eaa('0x3'));var rp=require(_0x7eaa('0x4'));var moment=require(_0x7eaa('0x5'));var BPromise=require(_0x7eaa('0x6'));var Mustache=require(_0x7eaa('0x7'));var util=require(_0x7eaa('0x8'));var path=require(_0x7eaa('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7eaa('0xa'));var fs=require('fs');var fs_extra=require(_0x7eaa('0xb'));var _=require(_0x7eaa('0xc'));var squel=require('squel');var crypto=require(_0x7eaa('0xd'));var jsforce=require(_0x7eaa('0xe'));var deskjs=require(_0x7eaa('0xf'));var toCsv=require(_0x7eaa('0x10'));var querystring=require(_0x7eaa('0x11'));var Papa=require('papaparse');var Redis=require(_0x7eaa('0x12'));var authService=require(_0x7eaa('0x13'));var qs=require(_0x7eaa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7eaa('0x15'));var logger=require('../../config/logger')(_0x7eaa('0x16'));var utils=require(_0x7eaa('0x17'));var config=require(_0x7eaa('0x18'));var licenseUtil=require(_0x7eaa('0x19'));var db=require(_0x7eaa('0x1a'))['db'];function respondWithStatusCode(_0x3754e4,_0x253d38){_0x253d38=_0x253d38||0xcc;return function(_0x287133){if(_0x287133){return _0x3754e4[_0x7eaa('0x1b')](_0x253d38);}return _0x3754e4['status'](_0x253d38)[_0x7eaa('0x1c')]();};}function respondWithResult(_0x4c2f1d,_0x39149e){_0x39149e=_0x39149e||0xc8;return function(_0xbf5d76){if(_0xbf5d76){return _0x4c2f1d[_0x7eaa('0x1d')](_0x39149e)[_0x7eaa('0x1e')](_0xbf5d76);}};}function respondWithFilteredResult(_0x65a897,_0x3eb8d3){return function(_0x52076b){if(_0x52076b){var _0x2ee8c5=typeof _0x3eb8d3[_0x7eaa('0x1f')]===_0x7eaa('0x20')&&typeof _0x3eb8d3[_0x7eaa('0x21')]===_0x7eaa('0x20');var _0x306cb5=_0x52076b['count'];var _0x556d4a=_0x2ee8c5?0x0:_0x3eb8d3[_0x7eaa('0x1f')];var _0x3b1127=_0x2ee8c5?_0x52076b['count']:_0x3eb8d3[_0x7eaa('0x1f')]+_0x3eb8d3[_0x7eaa('0x21')];var _0x2db23a;if(_0x3b1127>=_0x306cb5){_0x3b1127=_0x306cb5;_0x2db23a=0xc8;}else{_0x2db23a=0xce;}_0x65a897[_0x7eaa('0x1d')](_0x2db23a);return _0x65a897['set'](_0x7eaa('0x22'),_0x556d4a+'-'+_0x3b1127+'/'+_0x306cb5)[_0x7eaa('0x1e')](_0x52076b);}return null;};}function patchUpdates(_0x5b5ada){return function(_0x246643){try{jsonpatch['apply'](_0x246643,_0x5b5ada,!![]);}catch(_0x54fe7f){return BPromise['reject'](_0x54fe7f);}return _0x246643[_0x7eaa('0x23')]();};}function saveUpdates(_0x31d3c1,_0xcd191d){return function(_0x5995ff){if(_0x5995ff){return _0x5995ff['update'](_0x31d3c1)[_0x7eaa('0x24')](function(_0xc6ca82){return _0xc6ca82;});}return null;};}function removeEntity(_0x2a1f7b,_0x54f3d4){return function(_0x1dff95){if(_0x1dff95){return _0x1dff95[_0x7eaa('0x25')]()[_0x7eaa('0x24')](function(){var _0x25a587=_0x1dff95[_0x7eaa('0x26')]({'plain':!![]});var _0x573bc1='Triggers';return db[_0x7eaa('0x27')][_0x7eaa('0x25')]({'where':{'type':_0x573bc1,'resourceId':_0x25a587['id']}})[_0x7eaa('0x24')](function(){return _0x1dff95;});})['then'](function(){_0x2a1f7b[_0x7eaa('0x1d')](0xcc)[_0x7eaa('0x1c')]();});}};}function handleEntityNotFound(_0x4db4ab,_0x464acd){return function(_0x227685){if(!_0x227685){_0x4db4ab[_0x7eaa('0x1b')](0x194);}return _0x227685;};}function handleError(_0x1ba15c,_0x23280d){_0x23280d=_0x23280d||0x1f4;return function(_0x479a36){logger[_0x7eaa('0x28')](_0x479a36['stack']);if(_0x479a36[_0x7eaa('0x29')]){delete _0x479a36['name'];}_0x1ba15c[_0x7eaa('0x1d')](_0x23280d)[_0x7eaa('0x2a')](_0x479a36);};}exports[_0x7eaa('0x2b')]=function(_0x31b4ae,_0x15670d){var _0x38070c={},_0x26d32a={},_0x2d422a={'count':0x0,'rows':[]};var _0x311c8d=_['map'](db[_0x7eaa('0x2c')][_0x7eaa('0x2d')],function(_0x2804a9){return{'name':_0x2804a9['fieldName'],'type':_0x2804a9[_0x7eaa('0x2e')][_0x7eaa('0x2f')]};});_0x26d32a[_0x7eaa('0x30')]=_[_0x7eaa('0x31')](_0x311c8d,'name');_0x26d32a[_0x7eaa('0x32')]=_['keys'](_0x31b4ae[_0x7eaa('0x32')]);_0x26d32a[_0x7eaa('0x33')]=_[_0x7eaa('0x34')](_0x26d32a[_0x7eaa('0x30')],_0x26d32a[_0x7eaa('0x32')]);_0x38070c[_0x7eaa('0x35')]=_[_0x7eaa('0x34')](_0x26d32a[_0x7eaa('0x30')],qs[_0x7eaa('0x36')](_0x31b4ae[_0x7eaa('0x32')][_0x7eaa('0x36')]));_0x38070c['attributes']=_0x38070c['attributes'][_0x7eaa('0x37')]?_0x38070c[_0x7eaa('0x35')]:_0x26d32a[_0x7eaa('0x30')];if(!_0x31b4ae['query'][_0x7eaa('0x38')](_0x7eaa('0x39'))){_0x38070c[_0x7eaa('0x21')]=qs[_0x7eaa('0x21')](_0x31b4ae[_0x7eaa('0x32')][_0x7eaa('0x21')]);_0x38070c[_0x7eaa('0x1f')]=qs[_0x7eaa('0x1f')](_0x31b4ae[_0x7eaa('0x32')][_0x7eaa('0x1f')]);}_0x38070c[_0x7eaa('0x3a')]=qs[_0x7eaa('0x3b')](_0x31b4ae[_0x7eaa('0x32')][_0x7eaa('0x3b')]);_0x38070c[_0x7eaa('0x3c')]=qs['filters'](_[_0x7eaa('0x3d')](_0x31b4ae['query'],_0x26d32a[_0x7eaa('0x33')]),_0x311c8d);if(_0x31b4ae[_0x7eaa('0x32')][_0x7eaa('0x3e')]){_0x38070c['where']=_[_0x7eaa('0x3f')](_0x38070c[_0x7eaa('0x3c')],{'$or':_[_0x7eaa('0x31')](_0x311c8d,function(_0x53b780){if(_0x53b780[_0x7eaa('0x2e')]!==_0x7eaa('0x40')){var _0x5dcfd2={};_0x5dcfd2[_0x53b780[_0x7eaa('0x29')]]={'$like':'%'+_0x31b4ae[_0x7eaa('0x32')][_0x7eaa('0x3e')]+'%'};return _0x5dcfd2;}})});}_0x38070c=_['merge']({},_0x38070c,_0x31b4ae[_0x7eaa('0x41')]);var _0x4e1d2b={'where':_0x38070c[_0x7eaa('0x3c')]};return db[_0x7eaa('0x2c')]['count'](_0x4e1d2b)['then'](function(_0x444a08){_0x2d422a[_0x7eaa('0x42')]=_0x444a08;if(_0x31b4ae['query'][_0x7eaa('0x43')]){_0x38070c['include']=[{'all':!![]}];}return db[_0x7eaa('0x2c')][_0x7eaa('0x44')](_0x38070c);})[_0x7eaa('0x24')](function(_0x10c7d1){_0x2d422a[_0x7eaa('0x45')]=_0x10c7d1;return _0x2d422a;})[_0x7eaa('0x24')](respondWithFilteredResult(_0x15670d,_0x38070c))[_0x7eaa('0x46')](handleError(_0x15670d,null));};exports[_0x7eaa('0x47')]=function(_0x4c7298,_0x26a477){var _0x22d17e={'raw':![],'where':{'id':_0x4c7298['params']['id']}},_0x48b75b={};_0x48b75b[_0x7eaa('0x30')]=_[_0x7eaa('0x48')](db[_0x7eaa('0x2c')][_0x7eaa('0x2d')]);_0x48b75b[_0x7eaa('0x32')]=_['keys'](_0x4c7298[_0x7eaa('0x32')]);_0x48b75b[_0x7eaa('0x33')]=_['intersection'](_0x48b75b[_0x7eaa('0x30')],_0x48b75b['query']);_0x22d17e[_0x7eaa('0x35')]=_['intersection'](_0x48b75b['model'],qs[_0x7eaa('0x36')](_0x4c7298['query']['fields']));_0x22d17e[_0x7eaa('0x35')]=_0x22d17e[_0x7eaa('0x35')][_0x7eaa('0x37')]?_0x22d17e[_0x7eaa('0x35')]:_0x48b75b['model'];if(_0x4c7298[_0x7eaa('0x32')][_0x7eaa('0x43')]){_0x22d17e['include']=[{'all':!![]}];}_0x22d17e=_[_0x7eaa('0x3f')]({},_0x22d17e,_0x4c7298[_0x7eaa('0x41')]);return db[_0x7eaa('0x2c')][_0x7eaa('0x49')](_0x22d17e)[_0x7eaa('0x24')](handleEntityNotFound(_0x26a477,null))[_0x7eaa('0x24')](respondWithResult(_0x26a477,null))[_0x7eaa('0x46')](handleError(_0x26a477,null));};exports['create']=function(_0x19982d,_0x2cbaa3){return db['Trigger']['create'](_0x19982d[_0x7eaa('0x4a')],{})[_0x7eaa('0x24')](function(_0x4f2a29){var _0x394c96=_0x19982d[_0x7eaa('0x4b')][_0x7eaa('0x26')]({'plain':!![]});if(!_0x394c96)throw new Error(_0x7eaa('0x4c'));if(_0x394c96[_0x7eaa('0x4d')]===_0x7eaa('0x4b')){var _0x3f1964=_0x4f2a29[_0x7eaa('0x26')]({'plain':!![]});var _0x1eb9d5=_0x7eaa('0x4e');return db['UserProfileSection'][_0x7eaa('0x49')]({'where':{'name':_0x1eb9d5,'userProfileId':_0x394c96[_0x7eaa('0x4f')]},'raw':!![]})[_0x7eaa('0x24')](function(_0x3ee942){if(_0x3ee942&&_0x3ee942[_0x7eaa('0x50')]===0x0){return db['UserProfileResource'][_0x7eaa('0x51')]({'name':_0x3f1964['name'],'resourceId':_0x3f1964['id'],'type':_0x3ee942['name'],'sectionId':_0x3ee942['id']},{})['then'](function(){return _0x4f2a29;});}else{return _0x4f2a29;}})[_0x7eaa('0x46')](function(_0x3506f3){logger['error'](_0x7eaa('0x52'),_0x3506f3);throw _0x3506f3;});}return _0x4f2a29;})[_0x7eaa('0x24')](respondWithResult(_0x2cbaa3,0xc9))[_0x7eaa('0x46')](handleError(_0x2cbaa3,null));};exports[_0x7eaa('0x53')]=function(_0x3c417e,_0x1f7cd6){if(_0x3c417e[_0x7eaa('0x4a')]['id']){delete _0x3c417e[_0x7eaa('0x4a')]['id'];}return db[_0x7eaa('0x2c')][_0x7eaa('0x49')]({'where':{'id':_0x3c417e[_0x7eaa('0x54')]['id']}})['then'](handleEntityNotFound(_0x1f7cd6,null))[_0x7eaa('0x24')](saveUpdates(_0x3c417e[_0x7eaa('0x4a')],null))['then'](respondWithResult(_0x1f7cd6,null))[_0x7eaa('0x46')](handleError(_0x1f7cd6,null));};exports[_0x7eaa('0x25')]=function(_0xf32cab,_0x1fddb6){return db['Trigger'][_0x7eaa('0x49')]({'where':{'id':_0xf32cab[_0x7eaa('0x54')]['id']}})['then'](handleEntityNotFound(_0x1fddb6,null))[_0x7eaa('0x24')](removeEntity(_0x1fddb6,null))[_0x7eaa('0x46')](handleError(_0x1fddb6,null));};exports[_0x7eaa('0x55')]=function(_0x2a4406,_0x1c79ed,_0x30b433){if(_0x2a4406[_0x7eaa('0x4a')]['id']){delete _0x2a4406[_0x7eaa('0x4a')]['id'];}return db[_0x7eaa('0x2c')]['find']({'where':{'id':_0x2a4406[_0x7eaa('0x54')]['id']}})[_0x7eaa('0x24')](handleEntityNotFound(_0x1c79ed,null))[_0x7eaa('0x24')](function(_0x42be2c){if(_0x42be2c){_0x2a4406[_0x7eaa('0x4a')][_0x7eaa('0x56')]=_0x42be2c['id'];return db['Condition']['create'](_0x2a4406['body']);}})[_0x7eaa('0x24')](respondWithResult(_0x1c79ed,null))[_0x7eaa('0x46')](handleError(_0x1c79ed,null));};exports[_0x7eaa('0x57')]=function(_0x43fec7,_0x3623d0,_0x48ea50){if(_0x43fec7[_0x7eaa('0x4a')]['id']){delete _0x43fec7[_0x7eaa('0x4a')]['id'];}return db['Trigger'][_0x7eaa('0x49')]({'where':{'id':_0x43fec7[_0x7eaa('0x54')]['id']}})[_0x7eaa('0x24')](handleEntityNotFound(_0x3623d0,null))['then'](function(_0x39ab79){if(_0x39ab79){_0x43fec7[_0x7eaa('0x4a')]['TriggerAnyId']=_0x39ab79['id'];return db['Condition']['create'](_0x43fec7[_0x7eaa('0x4a')]);}})[_0x7eaa('0x24')](respondWithResult(_0x3623d0,null))['catch'](handleError(_0x3623d0,null));};exports[_0x7eaa('0x58')]=function(_0x175e22,_0x5878ca,_0x4e5fd8){var _0x5cba77={};var _0x3731ff={};var _0x31b3e7;var _0x161258;return db['Trigger'][_0x7eaa('0x59')]({'where':{'id':_0x175e22[_0x7eaa('0x54')]['id']}})['then'](handleEntityNotFound(_0x5878ca,null))[_0x7eaa('0x24')](function(_0x49093f){if(_0x49093f){_0x31b3e7=_0x49093f;_0x3731ff[_0x7eaa('0x30')]=_['keys'](db[_0x7eaa('0x5a')][_0x7eaa('0x2d')]);_0x3731ff['query']=_[_0x7eaa('0x48')](_0x175e22[_0x7eaa('0x32')]);_0x3731ff[_0x7eaa('0x33')]=_[_0x7eaa('0x34')](_0x3731ff['model'],_0x3731ff[_0x7eaa('0x32')]);_0x5cba77[_0x7eaa('0x35')]=_[_0x7eaa('0x34')](_0x3731ff[_0x7eaa('0x30')],qs[_0x7eaa('0x36')](_0x175e22[_0x7eaa('0x32')][_0x7eaa('0x36')]));_0x5cba77['attributes']=_0x5cba77[_0x7eaa('0x35')][_0x7eaa('0x37')]?_0x5cba77[_0x7eaa('0x35')]:_0x3731ff[_0x7eaa('0x30')];_0x5cba77[_0x7eaa('0x3a')]=qs[_0x7eaa('0x3b')](_0x175e22[_0x7eaa('0x32')][_0x7eaa('0x3b')]);_0x5cba77['where']=qs['filters'](_[_0x7eaa('0x3d')](_0x175e22[_0x7eaa('0x32')],_0x3731ff['filters']));if(_0x175e22[_0x7eaa('0x32')][_0x7eaa('0x3e')]){_0x5cba77['where']=_[_0x7eaa('0x3f')](_0x5cba77[_0x7eaa('0x3c')],{'$or':_[_0x7eaa('0x31')](_0x5cba77['attributes'],function(_0x3003b7){var _0xb86f89={};_0xb86f89[_0x3003b7]={'$like':'%'+_0x175e22['query'][_0x7eaa('0x3e')]+'%'};return _0xb86f89;})});}_0x5cba77=_[_0x7eaa('0x3f')]({},_0x5cba77,_0x175e22['options']);return _0x31b3e7[_0x7eaa('0x58')](_0x5cba77);}})[_0x7eaa('0x24')](function(_0x4a0995){if(_0x4a0995){_0x161258=_0x4a0995[_0x7eaa('0x37')];if(!_0x175e22[_0x7eaa('0x32')][_0x7eaa('0x38')](_0x7eaa('0x39'))){_0x5cba77[_0x7eaa('0x21')]=qs['limit'](_0x175e22[_0x7eaa('0x32')][_0x7eaa('0x21')]);_0x5cba77[_0x7eaa('0x1f')]=qs[_0x7eaa('0x1f')](_0x175e22[_0x7eaa('0x32')]['offset']);}return _0x31b3e7['getAllConditions'](_0x5cba77);}})[_0x7eaa('0x24')](function(_0xb22389){if(_0xb22389){return _0xb22389?{'count':_0x161258,'rows':_0xb22389}:null;}})[_0x7eaa('0x24')](respondWithResult(_0x5878ca,null))[_0x7eaa('0x46')](handleError(_0x5878ca,null));};exports[_0x7eaa('0x5b')]=function(_0x87d7f3,_0x471f56,_0x4675e9){var _0x267342={};var _0x230e80={};var _0x1247fa;var _0x20c5b1;return db[_0x7eaa('0x2c')][_0x7eaa('0x59')]({'where':{'id':_0x87d7f3['params']['id']}})['then'](handleEntityNotFound(_0x471f56,null))[_0x7eaa('0x24')](function(_0xa63240){if(_0xa63240){_0x1247fa=_0xa63240;_0x230e80['model']=_[_0x7eaa('0x48')](db[_0x7eaa('0x5a')][_0x7eaa('0x2d')]);_0x230e80[_0x7eaa('0x32')]=_[_0x7eaa('0x48')](_0x87d7f3['query']);_0x230e80[_0x7eaa('0x33')]=_[_0x7eaa('0x34')](_0x230e80[_0x7eaa('0x30')],_0x230e80['query']);_0x267342[_0x7eaa('0x35')]=_[_0x7eaa('0x34')](_0x230e80[_0x7eaa('0x30')],qs[_0x7eaa('0x36')](_0x87d7f3[_0x7eaa('0x32')][_0x7eaa('0x36')]));_0x267342['attributes']=_0x267342[_0x7eaa('0x35')][_0x7eaa('0x37')]?_0x267342[_0x7eaa('0x35')]:_0x230e80[_0x7eaa('0x30')];_0x267342[_0x7eaa('0x3a')]=qs[_0x7eaa('0x3b')](_0x87d7f3[_0x7eaa('0x32')][_0x7eaa('0x3b')]);_0x267342['where']=qs['filters'](_[_0x7eaa('0x3d')](_0x87d7f3['query'],_0x230e80[_0x7eaa('0x33')]));if(_0x87d7f3[_0x7eaa('0x32')]['filter']){_0x267342[_0x7eaa('0x3c')]=_[_0x7eaa('0x3f')](_0x267342['where'],{'$or':_[_0x7eaa('0x31')](_0x267342[_0x7eaa('0x35')],function(_0x1a5b5f){var _0x11c258={};_0x11c258[_0x1a5b5f]={'$like':'%'+_0x87d7f3['query']['filter']+'%'};return _0x11c258;})});}_0x267342=_[_0x7eaa('0x3f')]({},_0x267342,_0x87d7f3['options']);return _0x1247fa[_0x7eaa('0x5b')](_0x267342);}})['then'](function(_0x119f98){if(_0x119f98){_0x20c5b1=_0x119f98[_0x7eaa('0x37')];if(!_0x87d7f3[_0x7eaa('0x32')][_0x7eaa('0x38')](_0x7eaa('0x39'))){_0x267342[_0x7eaa('0x21')]=qs['limit'](_0x87d7f3[_0x7eaa('0x32')][_0x7eaa('0x21')]);_0x267342[_0x7eaa('0x1f')]=qs[_0x7eaa('0x1f')](_0x87d7f3[_0x7eaa('0x32')]['offset']);}return _0x1247fa[_0x7eaa('0x5b')](_0x267342);}})[_0x7eaa('0x24')](function(_0x235e3c){if(_0x235e3c){return _0x235e3c?{'count':_0x20c5b1,'rows':_0x235e3c}:null;}})['then'](respondWithResult(_0x471f56,null))[_0x7eaa('0x46')](handleError(_0x471f56,null));};exports[_0x7eaa('0x5c')]=function(_0x4ee831,_0x53b5fb,_0x18af64){if(_0x4ee831[_0x7eaa('0x4a')]['id']){delete _0x4ee831[_0x7eaa('0x4a')]['id'];}return db['Trigger'][_0x7eaa('0x49')]({'where':{'id':_0x4ee831['params']['id']}})[_0x7eaa('0x24')](handleEntityNotFound(_0x53b5fb,null))[_0x7eaa('0x24')](function(_0x51ee6b){if(_0x51ee6b){_0x4ee831[_0x7eaa('0x4a')][_0x7eaa('0x5d')]=_0x51ee6b['id'];return db[_0x7eaa('0x5e')][_0x7eaa('0x51')](_0x4ee831[_0x7eaa('0x4a')]);}})[_0x7eaa('0x24')](respondWithResult(_0x53b5fb,null))[_0x7eaa('0x46')](handleError(_0x53b5fb,null));};exports[_0x7eaa('0x5f')]=function(_0x589206,_0x170dff,_0x39c527){var _0x426d2e={};var _0x13e924={};var _0x3410e7;var _0x3c63b0;return db[_0x7eaa('0x2c')][_0x7eaa('0x59')]({'where':{'id':_0x589206['params']['id']}})[_0x7eaa('0x24')](handleEntityNotFound(_0x170dff,null))['then'](function(_0xe409e7){if(_0xe409e7){_0x3410e7=_0xe409e7;_0x13e924[_0x7eaa('0x30')]=_[_0x7eaa('0x48')](db[_0x7eaa('0x5e')][_0x7eaa('0x2d')]);_0x13e924['query']=_[_0x7eaa('0x48')](_0x589206[_0x7eaa('0x32')]);_0x13e924[_0x7eaa('0x33')]=_[_0x7eaa('0x34')](_0x13e924['model'],_0x13e924[_0x7eaa('0x32')]);_0x426d2e['attributes']=_[_0x7eaa('0x34')](_0x13e924['model'],qs[_0x7eaa('0x36')](_0x589206['query'][_0x7eaa('0x36')]));_0x426d2e['attributes']=_0x426d2e['attributes'][_0x7eaa('0x37')]?_0x426d2e['attributes']:_0x13e924[_0x7eaa('0x30')];_0x426d2e[_0x7eaa('0x3a')]=qs[_0x7eaa('0x3b')](_0x589206['query'][_0x7eaa('0x3b')]);_0x426d2e[_0x7eaa('0x3c')]=qs[_0x7eaa('0x33')](_[_0x7eaa('0x3d')](_0x589206[_0x7eaa('0x32')],_0x13e924[_0x7eaa('0x33')]));if(_0x589206[_0x7eaa('0x32')][_0x7eaa('0x3e')]){_0x426d2e[_0x7eaa('0x3c')]=_['merge'](_0x426d2e['where'],{'$or':_[_0x7eaa('0x31')](_0x426d2e[_0x7eaa('0x35')],function(_0x362880){var _0x3cc4a9={};_0x3cc4a9[_0x362880]={'$like':'%'+_0x589206['query']['filter']+'%'};return _0x3cc4a9;})});}_0x426d2e=_[_0x7eaa('0x3f')]({},_0x426d2e,_0x589206[_0x7eaa('0x41')]);return _0x3410e7[_0x7eaa('0x5f')](_0x426d2e);}})['then'](function(_0x3c155e){if(_0x3c155e){_0x3c63b0=_0x3c155e[_0x7eaa('0x37')];if(!_0x589206[_0x7eaa('0x32')][_0x7eaa('0x38')](_0x7eaa('0x39'))){_0x426d2e['limit']=qs['limit'](_0x589206[_0x7eaa('0x32')][_0x7eaa('0x21')]);_0x426d2e[_0x7eaa('0x1f')]=qs[_0x7eaa('0x1f')](_0x589206['query'][_0x7eaa('0x1f')]);}return _0x3410e7[_0x7eaa('0x5f')](_0x426d2e);}})[_0x7eaa('0x24')](function(_0x2dd8a8){if(_0x2dd8a8){return _0x2dd8a8?{'count':_0x3c63b0,'rows':_0x2dd8a8}:null;}})[_0x7eaa('0x24')](respondWithResult(_0x170dff,null))[_0x7eaa('0x46')](handleError(_0x170dff,null));};
\ No newline at end of file
+var _0x5fc7=['where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','length','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','userProfileId','autoAssociation','UserProfileResource','body','find','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','hasOwnProperty','nolimit','getAnyConditions','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x5fc7,0x141));var _0x75fc=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x5fc7[_0x819464];return _0x49dcc0;};'use strict';var emlformat=require(_0x75fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x75fc('0x1'));var jsonpatch=require(_0x75fc('0x2'));var rp=require(_0x75fc('0x3'));var moment=require(_0x75fc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x75fc('0x5'));var path=require(_0x75fc('0x6'));var sox=require(_0x75fc('0x7'));var csv=require(_0x75fc('0x8'));var ejs=require(_0x75fc('0x9'));var fs=require('fs');var fs_extra=require(_0x75fc('0xa'));var _=require(_0x75fc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x75fc('0xc'));var deskjs=require(_0x75fc('0xd'));var toCsv=require(_0x75fc('0x8'));var querystring=require(_0x75fc('0xe'));var Papa=require(_0x75fc('0xf'));var Redis=require('ioredis');var authService=require(_0x75fc('0x10'));var qs=require(_0x75fc('0x11'));var as=require(_0x75fc('0x12'));var hardwareService=require(_0x75fc('0x13'));var logger=require(_0x75fc('0x14'))(_0x75fc('0x15'));var utils=require(_0x75fc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x75fc('0x17'));var db=require(_0x75fc('0x18'))['db'];function respondWithStatusCode(_0x4d6af9,_0xcb1843){_0xcb1843=_0xcb1843||0xcc;return function(_0x108efd){if(_0x108efd){return _0x4d6af9['sendStatus'](_0xcb1843);}return _0x4d6af9[_0x75fc('0x19')](_0xcb1843)['end']();};}function respondWithResult(_0x2d1947,_0x1e51ec){_0x1e51ec=_0x1e51ec||0xc8;return function(_0x2bf248){if(_0x2bf248){return _0x2d1947[_0x75fc('0x19')](_0x1e51ec)[_0x75fc('0x1a')](_0x2bf248);}};}function respondWithFilteredResult(_0x288c47,_0x47516c){return function(_0x10c292){if(_0x10c292){var _0x5eab43=typeof _0x47516c[_0x75fc('0x1b')]===_0x75fc('0x1c')&&typeof _0x47516c[_0x75fc('0x1d')]===_0x75fc('0x1c');var _0x57f0fb=_0x10c292[_0x75fc('0x1e')];var _0xd7a7d2=_0x5eab43?0x0:_0x47516c[_0x75fc('0x1b')];var _0x3e196d=_0x5eab43?_0x10c292['count']:_0x47516c[_0x75fc('0x1b')]+_0x47516c[_0x75fc('0x1d')];var _0x51c6a9;if(_0x3e196d>=_0x57f0fb){_0x3e196d=_0x57f0fb;_0x51c6a9=0xc8;}else{_0x51c6a9=0xce;}_0x288c47[_0x75fc('0x19')](_0x51c6a9);return _0x288c47[_0x75fc('0x1f')](_0x75fc('0x20'),_0xd7a7d2+'-'+_0x3e196d+'/'+_0x57f0fb)[_0x75fc('0x1a')](_0x10c292);}return null;};}function patchUpdates(_0x5bb375){return function(_0x3c0d6b){try{jsonpatch[_0x75fc('0x21')](_0x3c0d6b,_0x5bb375,!![]);}catch(_0x7d5431){return BPromise[_0x75fc('0x22')](_0x7d5431);}return _0x3c0d6b[_0x75fc('0x23')]();};}function saveUpdates(_0x5519b8,_0x3daa51){return function(_0x3c9b1c){if(_0x3c9b1c){return _0x3c9b1c[_0x75fc('0x24')](_0x5519b8)[_0x75fc('0x25')](function(_0x3cdfc5){return _0x3cdfc5;});}return null;};}function removeEntity(_0x399628,_0x348771){return function(_0x2ffcba){if(_0x2ffcba){return _0x2ffcba[_0x75fc('0x26')]()[_0x75fc('0x25')](function(){var _0x399b80=_0x2ffcba['get']({'plain':!![]});var _0x234253='Triggers';return db['UserProfileResource'][_0x75fc('0x26')]({'where':{'type':_0x234253,'resourceId':_0x399b80['id']}})['then'](function(){return _0x2ffcba;});})['then'](function(){_0x399628[_0x75fc('0x19')](0xcc)[_0x75fc('0x27')]();});}};}function handleEntityNotFound(_0x26b2d3,_0x14643c){return function(_0x3ef293){if(!_0x3ef293){_0x26b2d3[_0x75fc('0x28')](0x194);}return _0x3ef293;};}function handleError(_0x242858,_0x546363){_0x546363=_0x546363||0x1f4;return function(_0x1cf7eb){logger[_0x75fc('0x29')](_0x1cf7eb['stack']);if(_0x1cf7eb[_0x75fc('0x2a')]){delete _0x1cf7eb[_0x75fc('0x2a')];}_0x242858[_0x75fc('0x19')](_0x546363)['send'](_0x1cf7eb);};}exports[_0x75fc('0x2b')]=function(_0x5d577e,_0x588ea4){var _0x159118={},_0x54db12={},_0x2df2cd={'count':0x0,'rows':[]};var _0x413fd2=_[_0x75fc('0x2c')](db[_0x75fc('0x2d')][_0x75fc('0x2e')],function(_0x578f09){return{'name':_0x578f09[_0x75fc('0x2f')],'type':_0x578f09[_0x75fc('0x30')][_0x75fc('0x31')]};});_0x54db12[_0x75fc('0x32')]=_[_0x75fc('0x2c')](_0x413fd2,_0x75fc('0x2a'));_0x54db12[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x5d577e[_0x75fc('0x33')]);_0x54db12[_0x75fc('0x35')]=_[_0x75fc('0x36')](_0x54db12[_0x75fc('0x32')],_0x54db12['query']);_0x159118['attributes']=_['intersection'](_0x54db12[_0x75fc('0x32')],qs[_0x75fc('0x37')](_0x5d577e['query'][_0x75fc('0x37')]));_0x159118[_0x75fc('0x38')]=_0x159118[_0x75fc('0x38')]['length']?_0x159118[_0x75fc('0x38')]:_0x54db12[_0x75fc('0x32')];if(!_0x5d577e['query']['hasOwnProperty']('nolimit')){_0x159118[_0x75fc('0x1d')]=qs[_0x75fc('0x1d')](_0x5d577e['query'][_0x75fc('0x1d')]);_0x159118['offset']=qs['offset'](_0x5d577e['query']['offset']);}_0x159118[_0x75fc('0x39')]=qs[_0x75fc('0x3a')](_0x5d577e[_0x75fc('0x33')]['sort']);_0x159118[_0x75fc('0x3b')]=qs[_0x75fc('0x35')](_[_0x75fc('0x3c')](_0x5d577e[_0x75fc('0x33')],_0x54db12[_0x75fc('0x35')]),_0x413fd2);if(_0x5d577e[_0x75fc('0x33')]['filter']){_0x159118['where']=_[_0x75fc('0x3d')](_0x159118[_0x75fc('0x3b')],{'$or':_[_0x75fc('0x2c')](_0x413fd2,function(_0x3329e0){if(_0x3329e0[_0x75fc('0x30')]!==_0x75fc('0x3e')){var _0x5921f9={};_0x5921f9[_0x3329e0[_0x75fc('0x2a')]]={'$like':'%'+_0x5d577e['query'][_0x75fc('0x3f')]+'%'};return _0x5921f9;}})});}_0x159118=_[_0x75fc('0x3d')]({},_0x159118,_0x5d577e[_0x75fc('0x40')]);var _0x19b1d6={'where':_0x159118[_0x75fc('0x3b')]};return db[_0x75fc('0x2d')][_0x75fc('0x1e')](_0x19b1d6)[_0x75fc('0x25')](function(_0x1d8b0c){_0x2df2cd[_0x75fc('0x1e')]=_0x1d8b0c;if(_0x5d577e[_0x75fc('0x33')][_0x75fc('0x41')]){_0x159118[_0x75fc('0x42')]=[{'all':!![]}];}return db[_0x75fc('0x2d')][_0x75fc('0x43')](_0x159118);})[_0x75fc('0x25')](function(_0x3c1f2e){_0x2df2cd['rows']=_0x3c1f2e;return _0x2df2cd;})[_0x75fc('0x25')](respondWithFilteredResult(_0x588ea4,_0x159118))['catch'](handleError(_0x588ea4,null));};exports[_0x75fc('0x44')]=function(_0x5f0d94,_0x2ac8bc){var _0x348ed6={'raw':![],'where':{'id':_0x5f0d94[_0x75fc('0x45')]['id']}},_0x396ad5={};_0x396ad5[_0x75fc('0x32')]=_[_0x75fc('0x34')](db['Trigger'][_0x75fc('0x2e')]);_0x396ad5[_0x75fc('0x33')]=_['keys'](_0x5f0d94['query']);_0x396ad5[_0x75fc('0x35')]=_['intersection'](_0x396ad5[_0x75fc('0x32')],_0x396ad5[_0x75fc('0x33')]);_0x348ed6['attributes']=_[_0x75fc('0x36')](_0x396ad5[_0x75fc('0x32')],qs['fields'](_0x5f0d94[_0x75fc('0x33')][_0x75fc('0x37')]));_0x348ed6[_0x75fc('0x38')]=_0x348ed6[_0x75fc('0x38')][_0x75fc('0x46')]?_0x348ed6[_0x75fc('0x38')]:_0x396ad5['model'];if(_0x5f0d94[_0x75fc('0x33')][_0x75fc('0x41')]){_0x348ed6['include']=[{'all':!![]}];}_0x348ed6=_[_0x75fc('0x3d')]({},_0x348ed6,_0x5f0d94[_0x75fc('0x40')]);return db[_0x75fc('0x2d')]['find'](_0x348ed6)['then'](handleEntityNotFound(_0x2ac8bc,null))[_0x75fc('0x25')](respondWithResult(_0x2ac8bc,null))[_0x75fc('0x47')](handleError(_0x2ac8bc,null));};exports[_0x75fc('0x48')]=function(_0x24d776,_0x33bb06){return db[_0x75fc('0x2d')][_0x75fc('0x48')](_0x24d776['body'],{})[_0x75fc('0x25')](function(_0x2be8fd){var _0x5ed46d=_0x24d776[_0x75fc('0x49')][_0x75fc('0x4a')]({'plain':!![]});if(!_0x5ed46d)throw new Error(_0x75fc('0x4b'));if(_0x5ed46d[_0x75fc('0x4c')]===_0x75fc('0x49')){var _0x416f42=_0x2be8fd[_0x75fc('0x4a')]({'plain':!![]});var _0x2e4487=_0x75fc('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x2e4487,'userProfileId':_0x5ed46d[_0x75fc('0x4e')]},'raw':!![]})[_0x75fc('0x25')](function(_0x2e9f54){if(_0x2e9f54&&_0x2e9f54[_0x75fc('0x4f')]===0x0){return db[_0x75fc('0x50')][_0x75fc('0x48')]({'name':_0x416f42[_0x75fc('0x2a')],'resourceId':_0x416f42['id'],'type':_0x2e9f54['name'],'sectionId':_0x2e9f54['id']},{})[_0x75fc('0x25')](function(){return _0x2be8fd;});}else{return _0x2be8fd;}})['catch'](function(_0x287bef){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x287bef);throw _0x287bef;});}return _0x2be8fd;})['then'](respondWithResult(_0x33bb06,0xc9))[_0x75fc('0x47')](handleError(_0x33bb06,null));};exports[_0x75fc('0x24')]=function(_0x40e30a,_0x1b9a33){if(_0x40e30a[_0x75fc('0x51')]['id']){delete _0x40e30a['body']['id'];}return db['Trigger'][_0x75fc('0x52')]({'where':{'id':_0x40e30a[_0x75fc('0x45')]['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x1b9a33,null))[_0x75fc('0x25')](saveUpdates(_0x40e30a[_0x75fc('0x51')],null))[_0x75fc('0x25')](respondWithResult(_0x1b9a33,null))[_0x75fc('0x47')](handleError(_0x1b9a33,null));};exports['destroy']=function(_0x62a5bf,_0x271875){return db[_0x75fc('0x2d')][_0x75fc('0x52')]({'where':{'id':_0x62a5bf[_0x75fc('0x45')]['id']}})['then'](handleEntityNotFound(_0x271875,null))[_0x75fc('0x25')](removeEntity(_0x271875,null))[_0x75fc('0x47')](handleError(_0x271875,null));};exports[_0x75fc('0x53')]=function(_0x55904d,_0x44c057,_0xf96464){if(_0x55904d[_0x75fc('0x51')]['id']){delete _0x55904d[_0x75fc('0x51')]['id'];}return db[_0x75fc('0x2d')][_0x75fc('0x52')]({'where':{'id':_0x55904d[_0x75fc('0x45')]['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x44c057,null))[_0x75fc('0x25')](function(_0xef495){if(_0xef495){_0x55904d['body'][_0x75fc('0x54')]=_0xef495['id'];return db[_0x75fc('0x55')][_0x75fc('0x48')](_0x55904d[_0x75fc('0x51')]);}})[_0x75fc('0x25')](respondWithResult(_0x44c057,null))['catch'](handleError(_0x44c057,null));};exports[_0x75fc('0x56')]=function(_0x2bcfff,_0x48a6dd,_0xffe3e9){if(_0x2bcfff['body']['id']){delete _0x2bcfff[_0x75fc('0x51')]['id'];}return db[_0x75fc('0x2d')]['find']({'where':{'id':_0x2bcfff['params']['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x48a6dd,null))['then'](function(_0x1b7afc){if(_0x1b7afc){_0x2bcfff[_0x75fc('0x51')][_0x75fc('0x57')]=_0x1b7afc['id'];return db['Condition'][_0x75fc('0x48')](_0x2bcfff[_0x75fc('0x51')]);}})['then'](respondWithResult(_0x48a6dd,null))[_0x75fc('0x47')](handleError(_0x48a6dd,null));};exports[_0x75fc('0x58')]=function(_0x2ee124,_0x4454d5,_0x5f147d){var _0x54457c={};var _0xba6a3f={};var _0x29b5fc;var _0x20e3eb;return db[_0x75fc('0x2d')]['findOne']({'where':{'id':_0x2ee124['params']['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x4454d5,null))['then'](function(_0x3279dd){if(_0x3279dd){_0x29b5fc=_0x3279dd;_0xba6a3f[_0x75fc('0x32')]=_[_0x75fc('0x34')](db[_0x75fc('0x55')]['rawAttributes']);_0xba6a3f[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x2ee124['query']);_0xba6a3f['filters']=_['intersection'](_0xba6a3f[_0x75fc('0x32')],_0xba6a3f[_0x75fc('0x33')]);_0x54457c[_0x75fc('0x38')]=_[_0x75fc('0x36')](_0xba6a3f[_0x75fc('0x32')],qs[_0x75fc('0x37')](_0x2ee124[_0x75fc('0x33')][_0x75fc('0x37')]));_0x54457c['attributes']=_0x54457c[_0x75fc('0x38')][_0x75fc('0x46')]?_0x54457c['attributes']:_0xba6a3f[_0x75fc('0x32')];_0x54457c[_0x75fc('0x39')]=qs[_0x75fc('0x3a')](_0x2ee124['query']['sort']);_0x54457c[_0x75fc('0x3b')]=qs[_0x75fc('0x35')](_[_0x75fc('0x3c')](_0x2ee124['query'],_0xba6a3f[_0x75fc('0x35')]));if(_0x2ee124[_0x75fc('0x33')][_0x75fc('0x3f')]){_0x54457c[_0x75fc('0x3b')]=_[_0x75fc('0x3d')](_0x54457c[_0x75fc('0x3b')],{'$or':_[_0x75fc('0x2c')](_0x54457c['attributes'],function(_0x31b4d1){var _0x337cc1={};_0x337cc1[_0x31b4d1]={'$like':'%'+_0x2ee124[_0x75fc('0x33')][_0x75fc('0x3f')]+'%'};return _0x337cc1;})});}_0x54457c=_['merge']({},_0x54457c,_0x2ee124[_0x75fc('0x40')]);return _0x29b5fc['getAllConditions'](_0x54457c);}})[_0x75fc('0x25')](function(_0x187de2){if(_0x187de2){_0x20e3eb=_0x187de2['length'];if(!_0x2ee124[_0x75fc('0x33')][_0x75fc('0x59')]('nolimit')){_0x54457c[_0x75fc('0x1d')]=qs['limit'](_0x2ee124[_0x75fc('0x33')][_0x75fc('0x1d')]);_0x54457c[_0x75fc('0x1b')]=qs[_0x75fc('0x1b')](_0x2ee124['query'][_0x75fc('0x1b')]);}return _0x29b5fc[_0x75fc('0x58')](_0x54457c);}})['then'](function(_0x104b13){if(_0x104b13){return _0x104b13?{'count':_0x20e3eb,'rows':_0x104b13}:null;}})[_0x75fc('0x25')](respondWithResult(_0x4454d5,null))[_0x75fc('0x47')](handleError(_0x4454d5,null));};exports['getAnyConditions']=function(_0x139536,_0x136b3f,_0x56af03){var _0x395175={};var _0x3716d5={};var _0x233e2c;var _0x522ea1;return db[_0x75fc('0x2d')]['findOne']({'where':{'id':_0x139536['params']['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x136b3f,null))['then'](function(_0x23ef99){if(_0x23ef99){_0x233e2c=_0x23ef99;_0x3716d5[_0x75fc('0x32')]=_[_0x75fc('0x34')](db[_0x75fc('0x55')][_0x75fc('0x2e')]);_0x3716d5[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x139536[_0x75fc('0x33')]);_0x3716d5[_0x75fc('0x35')]=_[_0x75fc('0x36')](_0x3716d5['model'],_0x3716d5[_0x75fc('0x33')]);_0x395175[_0x75fc('0x38')]=_[_0x75fc('0x36')](_0x3716d5['model'],qs[_0x75fc('0x37')](_0x139536['query'][_0x75fc('0x37')]));_0x395175[_0x75fc('0x38')]=_0x395175[_0x75fc('0x38')][_0x75fc('0x46')]?_0x395175[_0x75fc('0x38')]:_0x3716d5[_0x75fc('0x32')];_0x395175[_0x75fc('0x39')]=qs['sort'](_0x139536['query']['sort']);_0x395175[_0x75fc('0x3b')]=qs['filters'](_[_0x75fc('0x3c')](_0x139536['query'],_0x3716d5[_0x75fc('0x35')]));if(_0x139536['query']['filter']){_0x395175['where']=_[_0x75fc('0x3d')](_0x395175[_0x75fc('0x3b')],{'$or':_[_0x75fc('0x2c')](_0x395175[_0x75fc('0x38')],function(_0xa0185){var _0x59cca8={};_0x59cca8[_0xa0185]={'$like':'%'+_0x139536[_0x75fc('0x33')][_0x75fc('0x3f')]+'%'};return _0x59cca8;})});}_0x395175=_[_0x75fc('0x3d')]({},_0x395175,_0x139536['options']);return _0x233e2c['getAnyConditions'](_0x395175);}})[_0x75fc('0x25')](function(_0x1e07ad){if(_0x1e07ad){_0x522ea1=_0x1e07ad[_0x75fc('0x46')];if(!_0x139536[_0x75fc('0x33')][_0x75fc('0x59')](_0x75fc('0x5a'))){_0x395175[_0x75fc('0x1d')]=qs[_0x75fc('0x1d')](_0x139536[_0x75fc('0x33')][_0x75fc('0x1d')]);_0x395175['offset']=qs[_0x75fc('0x1b')](_0x139536[_0x75fc('0x33')][_0x75fc('0x1b')]);}return _0x233e2c[_0x75fc('0x5b')](_0x395175);}})[_0x75fc('0x25')](function(_0x12c45a){if(_0x12c45a){return _0x12c45a?{'count':_0x522ea1,'rows':_0x12c45a}:null;}})[_0x75fc('0x25')](respondWithResult(_0x136b3f,null))[_0x75fc('0x47')](handleError(_0x136b3f,null));};exports['addAction']=function(_0x364382,_0x114c60,_0x4c41d2){if(_0x364382[_0x75fc('0x51')]['id']){delete _0x364382[_0x75fc('0x51')]['id'];}return db[_0x75fc('0x2d')][_0x75fc('0x52')]({'where':{'id':_0x364382['params']['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x114c60,null))[_0x75fc('0x25')](function(_0x4cc1d0){if(_0x4cc1d0){_0x364382[_0x75fc('0x51')][_0x75fc('0x5c')]=_0x4cc1d0['id'];return db[_0x75fc('0x5d')][_0x75fc('0x48')](_0x364382[_0x75fc('0x51')]);}})[_0x75fc('0x25')](respondWithResult(_0x114c60,null))[_0x75fc('0x47')](handleError(_0x114c60,null));};exports[_0x75fc('0x5e')]=function(_0x25da4f,_0x904ae8,_0x4e8a06){var _0x1cea29={};var _0x1a5026={};var _0x5a7116;var _0x326d0e;return db[_0x75fc('0x2d')]['findOne']({'where':{'id':_0x25da4f[_0x75fc('0x45')]['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x904ae8,null))[_0x75fc('0x25')](function(_0x1ac5ee){if(_0x1ac5ee){_0x5a7116=_0x1ac5ee;_0x1a5026['model']=_[_0x75fc('0x34')](db[_0x75fc('0x5d')][_0x75fc('0x2e')]);_0x1a5026[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x25da4f['query']);_0x1a5026[_0x75fc('0x35')]=_[_0x75fc('0x36')](_0x1a5026[_0x75fc('0x32')],_0x1a5026[_0x75fc('0x33')]);_0x1cea29[_0x75fc('0x38')]=_[_0x75fc('0x36')](_0x1a5026[_0x75fc('0x32')],qs['fields'](_0x25da4f[_0x75fc('0x33')]['fields']));_0x1cea29[_0x75fc('0x38')]=_0x1cea29['attributes'][_0x75fc('0x46')]?_0x1cea29[_0x75fc('0x38')]:_0x1a5026[_0x75fc('0x32')];_0x1cea29[_0x75fc('0x39')]=qs[_0x75fc('0x3a')](_0x25da4f[_0x75fc('0x33')]['sort']);_0x1cea29['where']=qs[_0x75fc('0x35')](_[_0x75fc('0x3c')](_0x25da4f['query'],_0x1a5026[_0x75fc('0x35')]));if(_0x25da4f[_0x75fc('0x33')][_0x75fc('0x3f')]){_0x1cea29[_0x75fc('0x3b')]=_[_0x75fc('0x3d')](_0x1cea29['where'],{'$or':_[_0x75fc('0x2c')](_0x1cea29['attributes'],function(_0x165b64){var _0x279469={};_0x279469[_0x165b64]={'$like':'%'+_0x25da4f[_0x75fc('0x33')][_0x75fc('0x3f')]+'%'};return _0x279469;})});}_0x1cea29=_[_0x75fc('0x3d')]({},_0x1cea29,_0x25da4f[_0x75fc('0x40')]);return _0x5a7116[_0x75fc('0x5e')](_0x1cea29);}})[_0x75fc('0x25')](function(_0x36fe1a){if(_0x36fe1a){_0x326d0e=_0x36fe1a[_0x75fc('0x46')];if(!_0x25da4f[_0x75fc('0x33')][_0x75fc('0x59')]('nolimit')){_0x1cea29['limit']=qs[_0x75fc('0x1d')](_0x25da4f[_0x75fc('0x33')][_0x75fc('0x1d')]);_0x1cea29[_0x75fc('0x1b')]=qs[_0x75fc('0x1b')](_0x25da4f[_0x75fc('0x33')][_0x75fc('0x1b')]);}return _0x5a7116[_0x75fc('0x5e')](_0x1cea29);}})['then'](function(_0x40e413){if(_0x40e413){return _0x40e413?{'count':_0x326d0e,'rows':_0x40e413}:null;}})[_0x75fc('0x25')](respondWithResult(_0x904ae8,null))[_0x75fc('0x47')](handleError(_0x904ae8,null));};
\ No newline at end of file
index 21c6d81..edfccb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cd6=['path','./trigger.attributes','exports','define','tools_triggers','lodash','util','api','moment','request-promise'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x0cd6,0x113));var _0x60cd=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x0cd6[_0x55ff3e];return _0x2709eb;};'use strict';var _=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var logger=require('../../config/logger')(_0x60cd('0x2'));var moment=require(_0x60cd('0x3'));var BPromise=require('bluebird');var rp=require(_0x60cd('0x4'));var fs=require('fs');var path=require(_0x60cd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x60cd('0x6'));module[_0x60cd('0x7')]=function(_0x22f155,_0x4e3293){return _0x22f155[_0x60cd('0x8')]('Trigger',attributes,{'tableName':_0x60cd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd7b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','util'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xfd7b[_0x2ff238];return _0x204a56;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var logger=require(_0xbfd7('0x1'))(_0xbfd7('0x2'));var moment=require(_0xbfd7('0x3'));var BPromise=require(_0xbfd7('0x4'));var rp=require(_0xbfd7('0x5'));var fs=require('fs');var path=require(_0xbfd7('0x6'));var rimraf=require(_0xbfd7('0x7'));var config=require(_0xbfd7('0x8'));var attributes=require(_0xbfd7('0x9'));module[_0xbfd7('0xa')]=function(_0x2ad158,_0x639dd4){return _0x2ad158['define'](_0xbfd7('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 544cf41..de739ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38eb=['request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetTrigger','Trigger','options','where','attributes','limit','include','model','map','then','ShowTrigger','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s'];(function(_0x3853f1,_0x906877){var _0x36055f=function(_0x17681c){while(--_0x17681c){_0x3853f1['push'](_0x3853f1['shift']());}};_0x36055f(++_0x906877);}(_0x38eb,0x12b));var _0xb38e=function(_0x4ffad2,_0x5eccdd){_0x4ffad2=_0x4ffad2-0x0;var _0x225968=_0x38eb[_0x4ffad2];return _0x225968;};'use strict';var _=require(_0xb38e('0x0'));var util=require(_0xb38e('0x1'));var moment=require(_0xb38e('0x2'));var BPromise=require(_0xb38e('0x3'));var rs=require(_0xb38e('0x4'));var fs=require('fs');var Redis=require(_0xb38e('0x5'));var db=require(_0xb38e('0x6'))['db'];var utils=require(_0xb38e('0x7'));var logger=require('../../config/logger')(_0xb38e('0x8'));var config=require(_0xb38e('0x9'));var jayson=require(_0xb38e('0xa'));var client=jayson[_0xb38e('0xb')][_0xb38e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d088d,_0x3ea021,_0x431b6b){return new BPromise(function(_0x13795a,_0x271d90){return client[_0xb38e('0xd')](_0x4d088d,_0x431b6b)['then'](function(_0x14530a){logger[_0xb38e('0xe')](_0xb38e('0xf'),_0x3ea021,_0xb38e('0x10'));logger['debug'](_0xb38e('0x11'),_0x3ea021,'request\x20sent',JSON[_0xb38e('0x12')](_0x14530a));if(_0x14530a[_0xb38e('0x13')]){if(_0x14530a[_0xb38e('0x13')]['code']===0x1f4){logger[_0xb38e('0x13')](_0xb38e('0xf'),_0x3ea021,_0x14530a[_0xb38e('0x13')][_0xb38e('0x14')]);return _0x271d90(_0x14530a['error'][_0xb38e('0x14')]);}logger[_0xb38e('0x13')](_0xb38e('0xf'),_0x3ea021,_0x14530a[_0xb38e('0x13')][_0xb38e('0x14')]);return _0x13795a(_0x14530a[_0xb38e('0x13')][_0xb38e('0x14')]);}else{logger[_0xb38e('0xe')]('Trigger,\x20%s,\x20%s',_0x3ea021,'request\x20sent');_0x13795a(_0x14530a['result'][_0xb38e('0x14')]);}})[_0xb38e('0x15')](function(_0x528bec){logger[_0xb38e('0x13')](_0xb38e('0xf'),_0x3ea021,_0x528bec);_0x271d90(_0x528bec);});});}exports[_0xb38e('0x16')]=function(_0x5a64d1){var _0x2e7f9e=this;return new Promise(function(_0x530d06,_0x27a56e){return db[_0xb38e('0x17')]['findAll']({'raw':_0x5a64d1['options']?_0x5a64d1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a64d1[_0xb38e('0x18')]?_0x5a64d1[_0xb38e('0x18')][_0xb38e('0x19')]||null:null,'attributes':_0x5a64d1[_0xb38e('0x18')]?_0x5a64d1[_0xb38e('0x18')][_0xb38e('0x1a')]||null:null,'limit':_0x5a64d1[_0xb38e('0x18')]?_0x5a64d1[_0xb38e('0x18')][_0xb38e('0x1b')]||null:null,'include':_0x5a64d1['options']?_0x5a64d1[_0xb38e('0x18')][_0xb38e('0x1c')]?_['map'](_0x5a64d1['options'][_0xb38e('0x1c')],function(_0x4bdedf){return{'model':db[_0x4bdedf[_0xb38e('0x1d')]],'as':_0x4bdedf['as'],'attributes':_0x4bdedf[_0xb38e('0x1a')],'include':_0x4bdedf[_0xb38e('0x1c')]?_[_0xb38e('0x1e')](_0x4bdedf[_0xb38e('0x1c')],function(_0x17816f){return{'model':db[_0x17816f[_0xb38e('0x1d')]],'as':_0x17816f['as'],'attributes':_0x17816f['attributes'],'include':_0x17816f[_0xb38e('0x1c')]?_['map'](_0x17816f[_0xb38e('0x1c')],function(_0x4d50a9){return{'model':db[_0x4d50a9['model']],'as':_0x4d50a9['as'],'attributes':_0x4d50a9[_0xb38e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb38e('0x1f')](function(_0x52b94f){logger['info'](_0xb38e('0x16'),_0x5a64d1);logger['debug']('GetTrigger',_0x5a64d1,JSON['stringify'](_0x52b94f));_0x530d06(_0x52b94f);})[_0xb38e('0x15')](function(_0x49bb20){logger[_0xb38e('0x13')]('GetTrigger',_0x49bb20[_0xb38e('0x14')],_0x5a64d1);_0x27a56e(_0x2e7f9e[_0xb38e('0x13')](0x1f4,_0x49bb20[_0xb38e('0x14')]));});});};exports[_0xb38e('0x20')]=function(_0xa4fa4f){var _0x1d2218=this;return new Promise(function(_0x167793,_0x572773){return db[_0xb38e('0x17')][_0xb38e('0x21')]({'raw':_0xa4fa4f[_0xb38e('0x18')]?_0xa4fa4f['options'][_0xb38e('0x22')]===undefined?!![]:![]:!![],'where':_0xa4fa4f[_0xb38e('0x18')]?_0xa4fa4f['options'][_0xb38e('0x19')]||null:null,'attributes':_0xa4fa4f[_0xb38e('0x18')]?_0xa4fa4f[_0xb38e('0x18')][_0xb38e('0x1a')]||null:null,'include':_0xa4fa4f['options']?_0xa4fa4f[_0xb38e('0x18')]['include']?_[_0xb38e('0x1e')](_0xa4fa4f[_0xb38e('0x18')][_0xb38e('0x1c')],function(_0x24c874){return{'model':db[_0x24c874[_0xb38e('0x1d')]],'as':_0x24c874['as'],'attributes':_0x24c874['attributes'],'include':_0x24c874[_0xb38e('0x1c')]?_[_0xb38e('0x1e')](_0x24c874[_0xb38e('0x1c')],function(_0xaee7db){return{'model':db[_0xaee7db[_0xb38e('0x1d')]],'as':_0xaee7db['as'],'attributes':_0xaee7db['attributes'],'include':_0xaee7db[_0xb38e('0x1c')]?_[_0xb38e('0x1e')](_0xaee7db[_0xb38e('0x1c')],function(_0x1f93d7){return{'model':db[_0x1f93d7[_0xb38e('0x1d')]],'as':_0x1f93d7['as'],'attributes':_0x1f93d7[_0xb38e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb38e('0x1f')](function(_0x4f31b5){logger[_0xb38e('0xe')]('ShowTrigger',_0xa4fa4f);logger['debug'](_0xb38e('0x20'),_0xa4fa4f,JSON[_0xb38e('0x12')](_0x4f31b5));_0x167793(_0x4f31b5);})[_0xb38e('0x15')](function(_0x56c4c2){logger[_0xb38e('0x13')]('ShowTrigger',_0x56c4c2[_0xb38e('0x14')],_0xa4fa4f);_0x572773(_0x1d2218[_0xb38e('0x13')](0x1f4,_0x56c4c2[_0xb38e('0x14')]));});});};
\ No newline at end of file
+var _0xf9ee=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','options','where','attributes','include','map','model','catch','ShowTrigger','find','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x334ec3,_0x1eaf31){var _0x4ca002=function(_0x5ef717){while(--_0x5ef717){_0x334ec3['push'](_0x334ec3['shift']());}};_0x4ca002(++_0x1eaf31);}(_0xf9ee,0x1c2));var _0xef9e=function(_0x2fba43,_0x4dc6b1){_0x2fba43=_0x2fba43-0x0;var _0x4a9480=_0xf9ee[_0x2fba43];return _0x4a9480;};'use strict';var _=require(_0xef9e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xef9e('0x1'));var fs=require('fs');var Redis=require(_0xef9e('0x2'));var db=require(_0xef9e('0x3'))['db'];var utils=require(_0xef9e('0x4'));var logger=require(_0xef9e('0x5'))(_0xef9e('0x6'));var config=require('../../config/environment');var jayson=require(_0xef9e('0x7'));var client=jayson['client'][_0xef9e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20d2aa,_0x4eb102,_0x54e5d0){return new BPromise(function(_0xa21ef1,_0x285c63){return client[_0xef9e('0x9')](_0x20d2aa,_0x54e5d0)[_0xef9e('0xa')](function(_0x4d2c82){logger[_0xef9e('0xb')]('Trigger,\x20%s,\x20%s',_0x4eb102,_0xef9e('0xc'));logger[_0xef9e('0xd')](_0xef9e('0xe'),_0x4eb102,_0xef9e('0xc'),JSON[_0xef9e('0xf')](_0x4d2c82));if(_0x4d2c82[_0xef9e('0x10')]){if(_0x4d2c82[_0xef9e('0x10')][_0xef9e('0x11')]===0x1f4){logger[_0xef9e('0x10')](_0xef9e('0x12'),_0x4eb102,_0x4d2c82[_0xef9e('0x10')][_0xef9e('0x13')]);return _0x285c63(_0x4d2c82[_0xef9e('0x10')]['message']);}logger['error'](_0xef9e('0x12'),_0x4eb102,_0x4d2c82[_0xef9e('0x10')][_0xef9e('0x13')]);return _0xa21ef1(_0x4d2c82[_0xef9e('0x10')][_0xef9e('0x13')]);}else{logger[_0xef9e('0xb')](_0xef9e('0x12'),_0x4eb102,'request\x20sent');_0xa21ef1(_0x4d2c82[_0xef9e('0x14')]['message']);}})['catch'](function(_0x1b544b){logger[_0xef9e('0x10')](_0xef9e('0x12'),_0x4eb102,_0x1b544b);_0x285c63(_0x1b544b);});});}exports[_0xef9e('0x15')]=function(_0xa1a551){var _0x58a964=this;return new Promise(function(_0x3a5da4,_0x7872db){return db[_0xef9e('0x16')]['findAll']({'raw':_0xa1a551['options']?_0xa1a551[_0xef9e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa1a551[_0xef9e('0x17')]?_0xa1a551[_0xef9e('0x17')][_0xef9e('0x18')]||null:null,'attributes':_0xa1a551[_0xef9e('0x17')]?_0xa1a551[_0xef9e('0x17')][_0xef9e('0x19')]||null:null,'limit':_0xa1a551['options']?_0xa1a551[_0xef9e('0x17')]['limit']||null:null,'include':_0xa1a551[_0xef9e('0x17')]?_0xa1a551[_0xef9e('0x17')][_0xef9e('0x1a')]?_[_0xef9e('0x1b')](_0xa1a551[_0xef9e('0x17')][_0xef9e('0x1a')],function(_0x1ce8f6){return{'model':db[_0x1ce8f6['model']],'as':_0x1ce8f6['as'],'attributes':_0x1ce8f6[_0xef9e('0x19')],'include':_0x1ce8f6[_0xef9e('0x1a')]?_[_0xef9e('0x1b')](_0x1ce8f6['include'],function(_0x5226b5){return{'model':db[_0x5226b5[_0xef9e('0x1c')]],'as':_0x5226b5['as'],'attributes':_0x5226b5[_0xef9e('0x19')],'include':_0x5226b5[_0xef9e('0x1a')]?_['map'](_0x5226b5[_0xef9e('0x1a')],function(_0x23de0b){return{'model':db[_0x23de0b[_0xef9e('0x1c')]],'as':_0x23de0b['as'],'attributes':_0x23de0b[_0xef9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xef9e('0xa')](function(_0x3bc84d){logger[_0xef9e('0xb')](_0xef9e('0x15'),_0xa1a551);logger[_0xef9e('0xd')](_0xef9e('0x15'),_0xa1a551,JSON[_0xef9e('0xf')](_0x3bc84d));_0x3a5da4(_0x3bc84d);})[_0xef9e('0x1d')](function(_0x6a74d){logger[_0xef9e('0x10')](_0xef9e('0x15'),_0x6a74d[_0xef9e('0x13')],_0xa1a551);_0x7872db(_0x58a964[_0xef9e('0x10')](0x1f4,_0x6a74d[_0xef9e('0x13')]));});});};exports[_0xef9e('0x1e')]=function(_0x4a611e){var _0x459f79=this;return new Promise(function(_0x5ea09f,_0x24c633){return db[_0xef9e('0x16')][_0xef9e('0x1f')]({'raw':_0x4a611e[_0xef9e('0x17')]?_0x4a611e[_0xef9e('0x17')][_0xef9e('0x20')]===undefined?!![]:![]:!![],'where':_0x4a611e[_0xef9e('0x17')]?_0x4a611e[_0xef9e('0x17')][_0xef9e('0x18')]||null:null,'attributes':_0x4a611e[_0xef9e('0x17')]?_0x4a611e[_0xef9e('0x17')]['attributes']||null:null,'include':_0x4a611e[_0xef9e('0x17')]?_0x4a611e[_0xef9e('0x17')][_0xef9e('0x1a')]?_['map'](_0x4a611e[_0xef9e('0x17')][_0xef9e('0x1a')],function(_0x2fe7de){return{'model':db[_0x2fe7de['model']],'as':_0x2fe7de['as'],'attributes':_0x2fe7de[_0xef9e('0x19')],'include':_0x2fe7de[_0xef9e('0x1a')]?_[_0xef9e('0x1b')](_0x2fe7de[_0xef9e('0x1a')],function(_0x162b9f){return{'model':db[_0x162b9f[_0xef9e('0x1c')]],'as':_0x162b9f['as'],'attributes':_0x162b9f['attributes'],'include':_0x162b9f[_0xef9e('0x1a')]?_['map'](_0x162b9f['include'],function(_0x44e768){return{'model':db[_0x44e768[_0xef9e('0x1c')]],'as':_0x44e768['as'],'attributes':_0x44e768[_0xef9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af1dd){logger[_0xef9e('0xb')]('ShowTrigger',_0x4a611e);logger[_0xef9e('0xd')](_0xef9e('0x1e'),_0x4a611e,JSON[_0xef9e('0xf')](_0x4af1dd));_0x5ea09f(_0x4af1dd);})[_0xef9e('0x1d')](function(_0x5184f8){logger[_0xef9e('0x10')](_0xef9e('0x1e'),_0x5184f8[_0xef9e('0x13')],_0x4a611e);_0x24c633(_0x459f79['error'](0x1f4,_0x5184f8[_0xef9e('0x13')]));});});};
\ No newline at end of file
index 2380da4..b72d8aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e2=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','create','update','delete','destroy','util','path'];(function(_0x125782,_0x44b3d0){var _0x3a23cb=function(_0x4d0a00){while(--_0x4d0a00){_0x125782['push'](_0x125782['shift']());}};_0x3a23cb(++_0x44b3d0);}(_0xf2e2,0x1d9));var _0x2f2e=function(_0x583166,_0x4880ac){_0x583166=_0x583166-0x0;var _0x9cd83a=_0xf2e2[_0x583166];return _0x9cd83a;};'use strict';var multer=require('multer');var util=require(_0x2f2e('0x0'));var path=require(_0x2f2e('0x1'));var timeout=require('connect-timeout');var express=require(_0x2f2e('0x2'));var router=express['Router']();var fs_extra=require(_0x2f2e('0x3'));var auth=require(_0x2f2e('0x4'));var interaction=require(_0x2f2e('0x5'));var config=require(_0x2f2e('0x6'));var controller=require(_0x2f2e('0x7'));router['get']('/',auth[_0x2f2e('0x8')](),controller[_0x2f2e('0x9')]);router[_0x2f2e('0xa')](_0x2f2e('0xb'),auth[_0x2f2e('0x8')](),controller[_0x2f2e('0xc')]);router[_0x2f2e('0xd')](_0x2f2e('0xe'),auth[_0x2f2e('0x8')](),controller['clone']);router[_0x2f2e('0xd')]('/',auth[_0x2f2e('0x8')](),controller[_0x2f2e('0xf')]);router['put'](_0x2f2e('0xb'),auth['isAuthenticated'](),controller[_0x2f2e('0x10')]);router[_0x2f2e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2f2e('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xd3ab=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','clone','put','update'];(function(_0x4a7c20,_0x2bcda5){var _0x4c86fd=function(_0x5f1ea3){while(--_0x5f1ea3){_0x4a7c20['push'](_0x4a7c20['shift']());}};_0x4c86fd(++_0x2bcda5);}(_0xd3ab,0xe7));var _0xbd3a=function(_0x439824,_0x56bb00){_0x439824=_0x439824-0x0;var _0x358bf8=_0xd3ab[_0x439824];return _0x358bf8;};'use strict';var multer=require(_0xbd3a('0x0'));var util=require('util');var path=require(_0xbd3a('0x1'));var timeout=require(_0xbd3a('0x2'));var express=require(_0xbd3a('0x3'));var router=express[_0xbd3a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbd3a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd3a('0x6'));var controller=require(_0xbd3a('0x7'));router['get']('/',auth[_0xbd3a('0x8')](),controller[_0xbd3a('0x9')]);router[_0xbd3a('0xa')](_0xbd3a('0xb'),auth[_0xbd3a('0x8')](),controller[_0xbd3a('0xc')]);router['post']('/:id/clone',auth[_0xbd3a('0x8')](),controller[_0xbd3a('0xd')]);router['post']('/',auth[_0xbd3a('0x8')](),controller['create']);router[_0xbd3a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xbd3a('0xf')]);router[_0xbd3a('0x10')]('/:id',auth[_0xbd3a('0x8')](),controller[_0xbd3a('0x11')]);module[_0xbd3a('0x12')]=router;
\ No newline at end of file
index 8dec9c7..af682c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x116a=['from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','STRING','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','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]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','passive','actpass','dynamic','update','update,nonat','BOOLEAN','exports','name','friend'];(function(_0x151dee,_0x3f620f){var _0x36879b=function(_0x5a7c23){while(--_0x5a7c23){_0x151dee['push'](_0x151dee['shift']());}};_0x36879b(++_0x3f620f);}(_0x116a,0x1b6));var _0xa116=function(_0x4cb211,_0x29b1e5){_0x4cb211=_0x4cb211-0x0;var _0x14e652=_0x116a[_0x4cb211];return _0x14e652;};'use strict';var Sequelize=require('sequelize');module[_0xa116('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa116('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xa116('0x2'),'user','peer'),'allowNull':![],'defaultValue':_0xa116('0x2')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa116('0x3')},'callingpres':{'type':Sequelize['ENUM'](_0xa116('0x4'),_0xa116('0x5'),_0xa116('0x6'),'ALLOWED',_0xa116('0x7'),_0xa116('0x8'),_0xa116('0x9'),'PROHIB')},'deny':{'type':Sequelize[_0xa116('0xa')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xa116('0xa')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xa116('0xa')]},'transport':{'type':Sequelize[_0xa116('0xa')],'defaultValue':'udp','set':function(_0x55c881){this[_0xa116('0xb')](_0xa116('0xc'),_0x55c881?_0x55c881[_0xa116('0xd')](','):null);},'get':function(){return this[_0xa116('0xe')]('transport')?this[_0xa116('0xe')](_0xa116('0xc'))[_0xa116('0xf')](','):null;},'comment':_0xa116('0x10')},'dtmfmode':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x12'),_0xa116('0x13'),_0xa116('0x14'),_0xa116('0x15'),_0xa116('0x16')),'defaultValue':_0xa116('0x12')},'directmedia':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no',_0xa116('0x18'),'update',_0xa116('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa116('0xa')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xa116('0xa')],'defaultValue':_0xa116('0x1a'),'set':function(_0x212de2){this[_0xa116('0xb')]('nat',_0x212de2?_0x212de2[_0xa116('0xd')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xa116('0xe')]('nat')[_0xa116('0xf')](','):null;},'comment':_0xa116('0x1b')},'callgroup':{'type':Sequelize[_0xa116('0xa')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xa116('0xa')]},'namedpickupgroup':{'type':Sequelize[_0xa116('0xa')]},'language':{'type':Sequelize[_0xa116('0xa')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa116('0xa')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa116('0xa')],'defaultValue':_0xa116('0x1c')},'allow':{'type':Sequelize[_0xa116('0xa')],'allowNull':![],'defaultValue':_0xa116('0x1d'),'set':function(_0x5812be){this['setDataValue']('allow',_0x5812be?_0x5812be['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xa116('0xe')](_0xa116('0x1e'))?this[_0xa116('0xe')](_0xa116('0x1e'))['split'](';'):null;},'comment':_0xa116('0x1f')},'autoframing':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x18b603){this[_0xa116('0xb')]('insecure',_0x18b603?_0x18b603[_0xa116('0xd')](','):null);},'get':function(){return this[_0xa116('0xe')](_0xa116('0x20'))?this[_0xa116('0xe')](_0xa116('0x20'))[_0xa116('0xf')](','):null;},'comment':_0xa116('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0xa116('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no',_0xa116('0x22'))},'promiscredir':{'type':Sequelize['ENUM'](_0xa116('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xa116('0x11')]('yes','no')},'accountcode':{'type':Sequelize[_0xa116('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa116('0xa')],'defaultValue':_0xa116('0x24')},'amaflags':{'type':Sequelize[_0xa116('0xa')]},'callcounter':{'type':Sequelize[_0xa116('0x11')]('yes','no'),'defaultValue':_0xa116('0x17')},'busylevel':{'type':Sequelize[_0xa116('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xa116('0xa')]},'template':{'type':Sequelize[_0xa116('0xa')]},'videosupport':{'type':Sequelize[_0xa116('0x11')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'mailbox':{'type':Sequelize[_0xa116('0xa')]},'session_timers':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x25'),_0xa116('0x26'),_0xa116('0x27'))},'session_expires':{'type':Sequelize[_0xa116('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xa116('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xa116('0x28'),_0xa116('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xa116('0xa')]},'fromdomain':{'type':Sequelize[_0xa116('0xa')]},'fromuser':{'type':Sequelize[_0xa116('0xa')]},'port':{'type':Sequelize[_0xa116('0x23')](0x5)},'qualify':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no'),'defaultValue':_0xa116('0x17')},'keepalive':{'type':Sequelize[_0xa116('0x23')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xa116('0xa')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa116('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa116('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa116('0xa')]},'callbackextension':{'type':Sequelize[_0xa116('0xa')]},'timert1':{'type':Sequelize[_0xa116('0x23')](0xb)},'timerb':{'type':Sequelize[_0xa116('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xa116('0x23')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xa116('0xa')]},'contactacl':{'type':Sequelize[_0xa116('0xa')]},'unsolicited_mailbox':{'type':Sequelize[_0xa116('0xa')]},'use_q850_reason':{'type':Sequelize[_0xa116('0xa')]},'maxforwards':{'type':Sequelize[_0xa116('0x23')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xa116('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xa116('0x17'),'no')},'icesupport':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xa116('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xa116('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa116('0xa')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xa116('0xa')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xa116('0x11')]('active',_0xa116('0x2b'),_0xa116('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa116('0xa')]},'usereqphone':{'type':Sequelize['ENUM'](_0xa116('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa116('0xa')]},'recordofffeature':{'type':Sequelize[_0xa116('0xa')]},'call_limit':{'type':Sequelize[_0xa116('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no')},'vmexten':{'type':Sequelize[_0xa116('0xa')]},'mohinterpret':{'type':Sequelize[_0xa116('0xa')]},'mohsuggest':{'type':Sequelize[_0xa116('0xa')]},'parkinglot':{'type':Sequelize[_0xa116('0xa')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa116('0xa')],'defaultValue':_0xa116('0x2d')},'canreinvite':{'type':Sequelize[_0xa116('0x11')](_0xa116('0x17'),'no',_0xa116('0x18'),_0xa116('0x2e'),_0xa116('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xa116('0xa')]},'otherFields':{'type':Sequelize[_0xa116('0xa')]},'active':{'type':Sequelize[_0xa116('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa116('0xa')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xe039=['never','INTEGER','accept','refuse','originate','pai','fingerprint','active','passive','actpass','dynamic','BOOLEAN','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','split','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\x22alaw\x22]','port,invite','insecure'];(function(_0x81edcc,_0x288b9d){var _0x6dc6b3=function(_0x1688ff){while(--_0x1688ff){_0x81edcc['push'](_0x81edcc['shift']());}};_0x6dc6b3(++_0x288b9d);}(_0xe039,0x171));var _0x9e03=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xe039[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require('sequelize');module[_0x9e03('0x0')]={'name':{'type':Sequelize[_0x9e03('0x1')],'allowNull':![],'unique':_0x9e03('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x4'),_0x9e03('0x5'),_0x9e03('0x6')),'allowNull':![],'defaultValue':_0x9e03('0x4')},'context':{'type':Sequelize[_0x9e03('0x1')],'allowNull':![],'defaultValue':_0x9e03('0x7')},'callingpres':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x8'),_0x9e03('0x9'),_0x9e03('0xa'),_0x9e03('0xb'),_0x9e03('0xc'),_0x9e03('0xd'),_0x9e03('0xe'),_0x9e03('0xf'))},'deny':{'type':Sequelize[_0x9e03('0x1')]},'permit':{'type':Sequelize[_0x9e03('0x1')]},'secret':{'type':Sequelize[_0x9e03('0x1')]},'md5secret':{'type':Sequelize[_0x9e03('0x1')]},'remotesecret':{'type':Sequelize[_0x9e03('0x1')]},'transport':{'type':Sequelize[_0x9e03('0x1')],'defaultValue':_0x9e03('0x10'),'set':function(_0x2d1252){this[_0x9e03('0x11')]('transport',_0x2d1252?_0x2d1252[_0x9e03('0x12')](','):null);},'get':function(){return this[_0x9e03('0x13')](_0x9e03('0x14'))?this[_0x9e03('0x13')](_0x9e03('0x14'))['split'](','):null;},'comment':_0x9e03('0x15')},'dtmfmode':{'type':Sequelize['ENUM'](_0x9e03('0x16'),_0x9e03('0x17'),_0x9e03('0x18'),_0x9e03('0x19'),_0x9e03('0x1a')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no',_0x9e03('0x1c'),_0x9e03('0x1d'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9e03('0x1')]},'directmediadeny':{'type':Sequelize[_0x9e03('0x1')]},'nat':{'type':Sequelize[_0x9e03('0x1')],'defaultValue':_0x9e03('0x1e'),'set':function(_0x167a6a){this[_0x9e03('0x11')](_0x9e03('0x1f'),_0x167a6a?_0x167a6a[_0x9e03('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x9e03('0x1f'))?this[_0x9e03('0x13')](_0x9e03('0x1f'))[_0x9e03('0x20')](','):null;},'comment':_0x9e03('0x21')},'callgroup':{'type':Sequelize[_0x9e03('0x1')]},'namedcallgroup':{'type':Sequelize[_0x9e03('0x1')]},'pickupgroup':{'type':Sequelize[_0x9e03('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x9e03('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9e03('0x22'),'set':function(_0x8244c5){this[_0x9e03('0x11')](_0x9e03('0x23'),_0x8244c5?_0x8244c5['join'](';'):_0x9e03('0x22'));},'get':function(){return this[_0x9e03('0x13')]('allow')?this[_0x9e03('0x13')]('allow')[_0x9e03('0x20')](';'):null;},'comment':_0x9e03('0x24')},'autoframing':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x9e03('0x25'),'set':function(_0x19ff84){this[_0x9e03('0x11')]('insecure',_0x19ff84?_0x19ff84['join'](','):null);},'get':function(){return this['getDataValue'](_0x9e03('0x26'))?this['getDataValue']('insecure')[_0x9e03('0x20')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x9e03('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no',_0x9e03('0x27'))},'promiscredir':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x9e03('0x28')](0xb)},'setvar':{'type':Sequelize[_0x9e03('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9e03('0x1')]},'callcounter':{'type':Sequelize[_0x9e03('0x3')]('yes','no'),'defaultValue':_0x9e03('0x1b')},'busylevel':{'type':Sequelize[_0x9e03('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9e03('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x9e03('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9e03('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9e03('0x3')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x29'),_0x9e03('0x2a'),_0x9e03('0x2b'))},'session_expires':{'type':Sequelize[_0x9e03('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x9e03('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x9e03('0x3')]('uac','uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x9e03('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x9e03('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9e03('0x28')](0x5)},'qualify':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no'),'defaultValue':_0x9e03('0x1b')},'keepalive':{'type':Sequelize[_0x9e03('0x28')](0xb)},'defaultip':{'type':Sequelize[_0x9e03('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x9e03('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9e03('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x9e03('0x3')]('yes','no',_0x9e03('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9e03('0x1')]},'callbackextension':{'type':Sequelize[_0x9e03('0x1')]},'timert1':{'type':Sequelize[_0x9e03('0x28')](0xb)},'timerb':{'type':Sequelize[_0x9e03('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x9e03('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x9e03('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x9e03('0x1')]},'use_q850_reason':{'type':Sequelize[_0x9e03('0x1')]},'maxforwards':{'type':Sequelize[_0x9e03('0x28')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no',_0x9e03('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x9e03('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9e03('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x9e03('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x9e03('0x2e'),_0x9e03('0x2f'),_0x9e03('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9e03('0x1')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9e03('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x9e03('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x9e03('0x1')]},'mohinterpret':{'type':Sequelize[_0x9e03('0x1')]},'mohsuggest':{'type':Sequelize[_0x9e03('0x1')]},'parkinglot':{'type':Sequelize[_0x9e03('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9e03('0x1')],'defaultValue':_0x9e03('0x31')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x9e03('0x1c'),_0x9e03('0x1d'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9e03('0x1')]},'otherFields':{'type':Sequelize[_0x9e03('0x1')]},'active':{'type':Sequelize[_0x9e03('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9e03('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index d1c6aa7..1c0af80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x4b0cff,_0x4504eb){var _0x57db15=function(_0x3b7962){while(--_0x3b7962){_0x4b0cff['push'](_0x4b0cff['shift']());}};_0x57db15(++_0x4504eb);}(_0xe14d,0x1ee));var _0xde14=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xe14d[_0x2fc012];return _0x2891f9;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,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(_0x40659a,_0xed5f45){var _0x44a44a=function(_0x193f9a){while(--_0x193f9a){_0x40659a['push'](_0x40659a['shift']());}};_0x44a44a(++_0xed5f45);}(_0x425d,0x1e0));var _0xd425=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0x425d[_0x1857c6];return _0x51011c;};'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 1eeec7a..1aa835d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x630b=['util','path','rimraf','../../config/environment','exports','define','Trunk','tools_trunks','lodash'];(function(_0x5806ef,_0x360ac4){var _0x1c90f8=function(_0x2c6486){while(--_0x2c6486){_0x5806ef['push'](_0x5806ef['shift']());}};_0x1c90f8(++_0x360ac4);}(_0x630b,0x10d));var _0xb630=function(_0x4e5314,_0x226429){_0x4e5314=_0x4e5314-0x0;var _0x133d36=_0x630b[_0x4e5314];return _0x133d36;};'use strict';var _=require(_0xb630('0x0'));var util=require(_0xb630('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb630('0x2'));var rimraf=require(_0xb630('0x3'));var config=require(_0xb630('0x4'));var attributes=require('./trunk.attributes');module[_0xb630('0x5')]=function(_0x4374ab,_0x47c720){return _0x4374ab[_0xb630('0x6')](_0xb630('0x7'),attributes,{'tableName':_0xb630('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x211b=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x2861fd,_0x45a1e6){var _0x443ecb=function(_0x1ebd2e){while(--_0x1ebd2e){_0x2861fd['push'](_0x2861fd['shift']());}};_0x443ecb(++_0x45a1e6);}(_0x211b,0x144));var _0xb211=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x211b[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xb211('0x0'));var util=require(_0xb211('0x1'));var logger=require(_0xb211('0x2'))(_0xb211('0x3'));var moment=require('moment');var BPromise=require(_0xb211('0x4'));var rp=require(_0xb211('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb211('0x6'));var config=require('../../config/environment');var attributes=require(_0xb211('0x7'));module[_0xb211('0x8')]=function(_0x384887,_0x26ce98){return _0x384887[_0xb211('0x9')](_0xb211('0xa'),attributes,{'tableName':_0xb211('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 87aa401..aea4a57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x118e=['ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','Trunk','options','where','attributes','limit','include','map','model','GetTrunk','catch','raw'];(function(_0xf9d3ff,_0x40989c){var _0x235b79=function(_0x444bfa){while(--_0x444bfa){_0xf9d3ff['push'](_0xf9d3ff['shift']());}};_0x235b79(++_0x40989c);}(_0x118e,0xcd));var _0xe118=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x118e[_0x1d04b5];return _0x161342;};'use strict';var _=require(_0xe118('0x0'));var util=require(_0xe118('0x1'));var moment=require(_0xe118('0x2'));var BPromise=require(_0xe118('0x3'));var rs=require(_0xe118('0x4'));var fs=require('fs');var Redis=require(_0xe118('0x5'));var db=require(_0xe118('0x6'))['db'];var utils=require(_0xe118('0x7'));var logger=require(_0xe118('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe118('0x9')][_0xe118('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a022e,_0xe9e61,_0x21c3a9){return new BPromise(function(_0x4b4c4a,_0x2e736e){return client[_0xe118('0xb')](_0x2a022e,_0x21c3a9)[_0xe118('0xc')](function(_0x289fa6){logger['info'](_0xe118('0xd'),_0xe9e61,_0xe118('0xe'));logger[_0xe118('0xf')](_0xe118('0x10'),_0xe9e61,_0xe118('0xe'),JSON[_0xe118('0x11')](_0x289fa6));if(_0x289fa6[_0xe118('0x12')]){if(_0x289fa6['error']['code']===0x1f4){logger['error'](_0xe118('0xd'),_0xe9e61,_0x289fa6[_0xe118('0x12')]['message']);return _0x2e736e(_0x289fa6[_0xe118('0x12')]['message']);}logger[_0xe118('0x12')](_0xe118('0xd'),_0xe9e61,_0x289fa6['error'][_0xe118('0x13')]);return _0x4b4c4a(_0x289fa6['error'][_0xe118('0x13')]);}else{logger[_0xe118('0x14')](_0xe118('0xd'),_0xe9e61,_0xe118('0xe'));_0x4b4c4a(_0x289fa6[_0xe118('0x15')][_0xe118('0x13')]);}})['catch'](function(_0x18aeac){logger['error'](_0xe118('0xd'),_0xe9e61,_0x18aeac);_0x2e736e(_0x18aeac);});});}exports['GetTrunk']=function(_0x3b49f2){var _0x13473c=this;return new Promise(function(_0x1f190d,_0x1ea60b){return db[_0xe118('0x16')]['findAll']({'raw':_0x3b49f2['options']?_0x3b49f2[_0xe118('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3b49f2[_0xe118('0x17')]?_0x3b49f2[_0xe118('0x17')][_0xe118('0x18')]||null:null,'attributes':_0x3b49f2['options']?_0x3b49f2[_0xe118('0x17')][_0xe118('0x19')]||null:null,'limit':_0x3b49f2['options']?_0x3b49f2[_0xe118('0x17')][_0xe118('0x1a')]||null:null,'include':_0x3b49f2[_0xe118('0x17')]?_0x3b49f2[_0xe118('0x17')][_0xe118('0x1b')]?_[_0xe118('0x1c')](_0x3b49f2['options'][_0xe118('0x1b')],function(_0x36741a){return{'model':db[_0x36741a[_0xe118('0x1d')]],'as':_0x36741a['as'],'attributes':_0x36741a[_0xe118('0x19')],'include':_0x36741a[_0xe118('0x1b')]?_['map'](_0x36741a[_0xe118('0x1b')],function(_0x476c1d){return{'model':db[_0x476c1d[_0xe118('0x1d')]],'as':_0x476c1d['as'],'attributes':_0x476c1d[_0xe118('0x19')],'include':_0x476c1d['include']?_['map'](_0x476c1d[_0xe118('0x1b')],function(_0x249648){return{'model':db[_0x249648['model']],'as':_0x249648['as'],'attributes':_0x249648['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x23fc10){logger['info'](_0xe118('0x1e'),_0x3b49f2);logger[_0xe118('0xf')](_0xe118('0x1e'),_0x3b49f2,JSON[_0xe118('0x11')](_0x23fc10));_0x1f190d(_0x23fc10);})[_0xe118('0x1f')](function(_0x1d3634){logger[_0xe118('0x12')](_0xe118('0x1e'),_0x1d3634['message'],_0x3b49f2);_0x1ea60b(_0x13473c[_0xe118('0x12')](0x1f4,_0x1d3634['message']));});});};exports['ShowTrunk']=function(_0x47323a){var _0x49cbd6=this;return new Promise(function(_0x3b7184,_0xe91355){return db[_0xe118('0x16')]['find']({'raw':_0x47323a[_0xe118('0x17')]?_0x47323a[_0xe118('0x17')][_0xe118('0x20')]===undefined?!![]:![]:!![],'where':_0x47323a[_0xe118('0x17')]?_0x47323a[_0xe118('0x17')][_0xe118('0x18')]||null:null,'attributes':_0x47323a[_0xe118('0x17')]?_0x47323a[_0xe118('0x17')][_0xe118('0x19')]||null:null,'include':_0x47323a[_0xe118('0x17')]?_0x47323a['options']['include']?_[_0xe118('0x1c')](_0x47323a['options'][_0xe118('0x1b')],function(_0x15494a){return{'model':db[_0x15494a[_0xe118('0x1d')]],'as':_0x15494a['as'],'attributes':_0x15494a[_0xe118('0x19')],'include':_0x15494a['include']?_[_0xe118('0x1c')](_0x15494a[_0xe118('0x1b')],function(_0x137674){return{'model':db[_0x137674['model']],'as':_0x137674['as'],'attributes':_0x137674['attributes'],'include':_0x137674[_0xe118('0x1b')]?_[_0xe118('0x1c')](_0x137674['include'],function(_0x5f08a3){return{'model':db[_0x5f08a3[_0xe118('0x1d')]],'as':_0x5f08a3['as'],'attributes':_0x5f08a3[_0xe118('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe118('0xc')](function(_0xdc815c){logger[_0xe118('0x14')](_0xe118('0x21'),_0x47323a);logger['debug'](_0xe118('0x21'),_0x47323a,JSON[_0xe118('0x11')](_0xdc815c));_0x3b7184(_0xdc815c);})[_0xe118('0x1f')](function(_0x1307b8){logger[_0xe118('0x12')](_0xe118('0x21'),_0x1307b8['message'],_0x47323a);_0xe91355(_0x49cbd6['error'](0x1f4,_0x1307b8[_0xe118('0x13')]));});});};
\ No newline at end of file
+var _0x1750=['options','raw','where','attributes','limit','include','map','model','then','GetTrunk','ShowTrunk','Trunk','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x1750,0xbb));var _0x0175=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1750[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0175('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0175('0x1'));var rs=require(_0x0175('0x2'));var fs=require('fs');var Redis=require(_0x0175('0x3'));var db=require(_0x0175('0x4'))['db'];var utils=require(_0x0175('0x5'));var logger=require(_0x0175('0x6'))(_0x0175('0x7'));var config=require(_0x0175('0x8'));var jayson=require(_0x0175('0x9'));var client=jayson[_0x0175('0xa')][_0x0175('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe15,_0x32c41a,_0x57c1a8){return new BPromise(function(_0x37c961,_0x49f802){return client['request'](_0x49fe15,_0x57c1a8)['then'](function(_0x38fd90){logger[_0x0175('0xc')](_0x0175('0xd'),_0x32c41a,_0x0175('0xe'));logger[_0x0175('0xf')](_0x0175('0x10'),_0x32c41a,_0x0175('0xe'),JSON[_0x0175('0x11')](_0x38fd90));if(_0x38fd90[_0x0175('0x12')]){if(_0x38fd90[_0x0175('0x12')]['code']===0x1f4){logger[_0x0175('0x12')]('Trunk,\x20%s,\x20%s',_0x32c41a,_0x38fd90[_0x0175('0x12')][_0x0175('0x13')]);return _0x49f802(_0x38fd90[_0x0175('0x12')][_0x0175('0x13')]);}logger[_0x0175('0x12')]('Trunk,\x20%s,\x20%s',_0x32c41a,_0x38fd90[_0x0175('0x12')][_0x0175('0x13')]);return _0x37c961(_0x38fd90[_0x0175('0x12')][_0x0175('0x13')]);}else{logger[_0x0175('0xc')](_0x0175('0xd'),_0x32c41a,'request\x20sent');_0x37c961(_0x38fd90[_0x0175('0x14')][_0x0175('0x13')]);}})[_0x0175('0x15')](function(_0x414a14){logger['error'](_0x0175('0xd'),_0x32c41a,_0x414a14);_0x49f802(_0x414a14);});});}exports['GetTrunk']=function(_0x42320a){var _0x3ebbd7=this;return new Promise(function(_0x4f274a,_0x202a19){return db['Trunk'][_0x0175('0x16')]({'raw':_0x42320a[_0x0175('0x17')]?_0x42320a[_0x0175('0x17')][_0x0175('0x18')]===undefined?!![]:![]:!![],'where':_0x42320a[_0x0175('0x17')]?_0x42320a[_0x0175('0x17')][_0x0175('0x19')]||null:null,'attributes':_0x42320a['options']?_0x42320a[_0x0175('0x17')][_0x0175('0x1a')]||null:null,'limit':_0x42320a[_0x0175('0x17')]?_0x42320a[_0x0175('0x17')][_0x0175('0x1b')]||null:null,'include':_0x42320a['options']?_0x42320a[_0x0175('0x17')][_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x42320a[_0x0175('0x17')][_0x0175('0x1c')],function(_0x55113b){return{'model':db[_0x55113b[_0x0175('0x1e')]],'as':_0x55113b['as'],'attributes':_0x55113b[_0x0175('0x1a')],'include':_0x55113b[_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x55113b[_0x0175('0x1c')],function(_0x2a7ee9){return{'model':db[_0x2a7ee9[_0x0175('0x1e')]],'as':_0x2a7ee9['as'],'attributes':_0x2a7ee9[_0x0175('0x1a')],'include':_0x2a7ee9[_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x2a7ee9[_0x0175('0x1c')],function(_0x1ebba0){return{'model':db[_0x1ebba0['model']],'as':_0x1ebba0['as'],'attributes':_0x1ebba0[_0x0175('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0175('0x1f')](function(_0x376b37){logger['info']('GetTrunk',_0x42320a);logger[_0x0175('0xf')](_0x0175('0x20'),_0x42320a,JSON[_0x0175('0x11')](_0x376b37));_0x4f274a(_0x376b37);})[_0x0175('0x15')](function(_0x3eff86){logger['error'](_0x0175('0x20'),_0x3eff86['message'],_0x42320a);_0x202a19(_0x3ebbd7[_0x0175('0x12')](0x1f4,_0x3eff86[_0x0175('0x13')]));});});};exports[_0x0175('0x21')]=function(_0x406416){var _0x3de7f0=this;return new Promise(function(_0x31bff5,_0xa47c56){return db[_0x0175('0x22')]['find']({'raw':_0x406416['options']?_0x406416['options'][_0x0175('0x18')]===undefined?!![]:![]:!![],'where':_0x406416[_0x0175('0x17')]?_0x406416[_0x0175('0x17')]['where']||null:null,'attributes':_0x406416[_0x0175('0x17')]?_0x406416['options']['attributes']||null:null,'include':_0x406416[_0x0175('0x17')]?_0x406416[_0x0175('0x17')][_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x406416[_0x0175('0x17')][_0x0175('0x1c')],function(_0xbacdc2){return{'model':db[_0xbacdc2[_0x0175('0x1e')]],'as':_0xbacdc2['as'],'attributes':_0xbacdc2[_0x0175('0x1a')],'include':_0xbacdc2[_0x0175('0x1c')]?_[_0x0175('0x1d')](_0xbacdc2[_0x0175('0x1c')],function(_0x3aafdf){return{'model':db[_0x3aafdf[_0x0175('0x1e')]],'as':_0x3aafdf['as'],'attributes':_0x3aafdf[_0x0175('0x1a')],'include':_0x3aafdf[_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x3aafdf['include'],function(_0x55648f){return{'model':db[_0x55648f[_0x0175('0x1e')]],'as':_0x55648f['as'],'attributes':_0x55648f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0175('0x1f')](function(_0x5efa80){logger['info'](_0x0175('0x21'),_0x406416);logger[_0x0175('0xf')]('ShowTrunk',_0x406416,JSON['stringify'](_0x5efa80));_0x31bff5(_0x5efa80);})['catch'](function(_0x269492){logger['error']('ShowTrunk',_0x269492[_0x0175('0x13')],_0x406416);_0xa47c56(_0x3de7f0[_0x0175('0x12')](0x1f4,_0x269492[_0x0175('0x13')]));});});};
\ No newline at end of file
index b836bc7..3881393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1ab=['getVoiceQueuesRt','/:id/groups','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','/:id/agents','getAgents','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','getScheduledCalls','/:id/api_key','addContacts','post','/create_many','bulkCreate','/:id/queues','diskStorage','join','root','format','%s-%s','now','originalname','single','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/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/square_projects','addSquareProjects','createApiKey','put','update','/:id/password','delete','destroy','removeChatInteractions','removeMailInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues'];(function(_0x59c165,_0x29de7b){var _0x19628f=function(_0x37f2b4){while(--_0x37f2b4){_0x59c165['push'](_0x59c165['shift']());}};_0x19628f(++_0x29de7b);}(_0xf1ab,0x19d));var _0xbf1a=function(_0x4b3488,_0x257f7c){_0x4b3488=_0x4b3488-0x0;var _0x2ebc25=_0xf1ab[_0x4b3488];return _0x2ebc25;};'use strict';var multer=require(_0xbf1a('0x0'));var util=require(_0xbf1a('0x1'));var path=require(_0xbf1a('0x2'));var timeout=require(_0xbf1a('0x3'));var express=require('express');var router=express[_0xbf1a('0x4')]();var fs_extra=require(_0xbf1a('0x5'));var auth=require(_0xbf1a('0x6'));var interaction=require(_0xbf1a('0x7'));var config=require(_0xbf1a('0x8'));var controller=require('./user.controller');router['get']('/',auth[_0xbf1a('0x9')](),controller[_0xbf1a('0xa')]);router[_0xbf1a('0xb')]('/describe',auth[_0xbf1a('0x9')](),controller[_0xbf1a('0xc')]);router[_0xbf1a('0xb')]('/whoami',auth[_0xbf1a('0x9')](),controller['whoami']);router[_0xbf1a('0xb')](_0xbf1a('0xd'),auth['isAuthenticated'](),controller[_0xbf1a('0xe')]);router[_0xbf1a('0xb')](_0xbf1a('0xf'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x10')]);router['get']('/:id/avatar',controller[_0xbf1a('0x11')]);router[_0xbf1a('0xb')](_0xbf1a('0x12'),auth['isAuthenticated'](),controller[_0xbf1a('0x13')]);router[_0xbf1a('0xb')](_0xbf1a('0x14'),auth['isAuthenticated'](),controller[_0xbf1a('0x15')]);router[_0xbf1a('0xb')]('/:id/queues',auth['isAuthenticated'](),controller[_0xbf1a('0x16')]);router[_0xbf1a('0xb')]('/:id/queues_rt',auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x17')]);router[_0xbf1a('0xb')](_0xbf1a('0x18'),auth[_0xbf1a('0x9')](),controller['getGroups']);router['get']('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0xbf1a('0xb')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xbf1a('0x19')]);router['get'](_0xbf1a('0x1a'),auth['isAuthenticated'](),controller[_0xbf1a('0x1b')]);router[_0xbf1a('0xb')](_0xbf1a('0x1c'),auth['isAuthenticated'](),controller[_0xbf1a('0x1d')]);router[_0xbf1a('0xb')](_0xbf1a('0x1e'),auth[_0xbf1a('0x9')](),controller['getMailInteractions']);router['get'](_0xbf1a('0x1f'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x20')]);router[_0xbf1a('0xb')]('/:id/fax/interactions',auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x21')]);router[_0xbf1a('0xb')](_0xbf1a('0x22'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x23')]);router[_0xbf1a('0xb')](_0xbf1a('0x24'),auth['isAuthenticated'](),controller['getTeams']);router[_0xbf1a('0xb')]('/:id/lists',auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x25')]);router[_0xbf1a('0xb')](_0xbf1a('0x26'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x27')]);router[_0xbf1a('0xb')]('/:id/prefixes',auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0xbf1a('0xb')](_0xbf1a('0x28'),auth[_0xbf1a('0x9')](),controller['getFaxAccounts']);router[_0xbf1a('0xb')](_0xbf1a('0x29'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x2a')]);router['get'](_0xbf1a('0x2b'),auth['isAuthenticated'](),controller[_0xbf1a('0x2c')]);router[_0xbf1a('0xb')](_0xbf1a('0x2d'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0xbf1a('0xb')](_0xbf1a('0x2e'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x2f')]);router[_0xbf1a('0xb')](_0xbf1a('0x30'),auth['isAuthenticated'](),controller[_0xbf1a('0x31')]);router[_0xbf1a('0xb')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xbf1a('0x32')]);router['get']('/:id/scheduled_calls',auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x33')]);router[_0xbf1a('0xb')](_0xbf1a('0x34'),auth[_0xbf1a('0x9')](),controller['getApiKey']);router['post'](_0xbf1a('0x14'),auth['isAuthenticated'](),controller[_0xbf1a('0x35')]);router[_0xbf1a('0x36')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf1a('0x36')](_0xbf1a('0x37'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x38')]);router[_0xbf1a('0x36')](_0xbf1a('0x39'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0xbf1a('0x3a')]({'destination':function(_0x27a29b,_0xf131ea,_0xd9915a){_0xd9915a(null,path[_0xbf1a('0x3b')](config[_0xbf1a('0x3c')],'server/files/images/'));},'filename':function(_0x165152,_0x2e1c18,_0x4fad5b){_0x4fad5b(null,util[_0xbf1a('0x3d')](_0xbf1a('0x3e'),Date[_0xbf1a('0x3f')](),_0x2e1c18[_0xbf1a('0x40')]));}})});router['post']('/:id/avatar',upload[_0xbf1a('0x41')](_0xbf1a('0x42')),controller[_0xbf1a('0x43')]);router[_0xbf1a('0x36')](_0xbf1a('0x44'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x45')]);router[_0xbf1a('0x36')](_0xbf1a('0x46'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x47')]);router[_0xbf1a('0x36')](_0xbf1a('0x48'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x49')]);router[_0xbf1a('0x36')](_0xbf1a('0x4a'),auth['isAuthenticated'](),controller['unpause']);router[_0xbf1a('0x36')](_0xbf1a('0x24'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x4b')]);router[_0xbf1a('0x36')](_0xbf1a('0x4c'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x4d')]);router['post'](_0xbf1a('0x4e'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x4f')]);router[_0xbf1a('0x36')](_0xbf1a('0x50'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x51')]);router[_0xbf1a('0x36')](_0xbf1a('0x52'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x53')]);router[_0xbf1a('0x36')](_0xbf1a('0x54'),auth['isAuthenticated'](),controller[_0xbf1a('0x55')]);router[_0xbf1a('0x36')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0xbf1a('0x36')](_0xbf1a('0x28'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x56')]);router[_0xbf1a('0x36')](_0xbf1a('0x29'),auth['isAuthenticated'](),controller[_0xbf1a('0x57')]);router['post'](_0xbf1a('0x2b'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x58')]);router['post'](_0xbf1a('0x2d'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x59')]);router[_0xbf1a('0x36')]('/:id/chat_websites',auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x5a')]);router[_0xbf1a('0x36')](_0xbf1a('0x30'),auth[_0xbf1a('0x9')](),controller['addWhatsappAccounts']);router[_0xbf1a('0x36')](_0xbf1a('0x5b'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x5c')]);router[_0xbf1a('0x36')]('/:id/api_key',auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x5d')]);router[_0xbf1a('0x5e')](_0xbf1a('0xf'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x5f')]);router[_0xbf1a('0x5e')](_0xbf1a('0x60'),auth[_0xbf1a('0x9')](),controller['changePassword']);router[_0xbf1a('0x61')](_0xbf1a('0x39'),auth['isAuthenticated'](),controller['removeQueues']);router[_0xbf1a('0x61')]('/:id/teams',auth[_0xbf1a('0x9')](),controller['removeTeams']);router['delete'](_0xbf1a('0xf'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x62')]);router['delete'](_0xbf1a('0x4c'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x63')]);router[_0xbf1a('0x61')](_0xbf1a('0x4e'),auth['isAuthenticated'](),controller[_0xbf1a('0x64')]);router[_0xbf1a('0x61')](_0xbf1a('0x50'),auth[_0xbf1a('0x9')](),controller['removeFaxInteractions']);router[_0xbf1a('0x61')](_0xbf1a('0x52'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0xbf1a('0x61')](_0xbf1a('0x54'),auth['isAuthenticated'](),controller[_0xbf1a('0x65')]);router[_0xbf1a('0x61')](_0xbf1a('0x66'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x67')]);router[_0xbf1a('0x61')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xbf1a('0x61')](_0xbf1a('0x29'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x68')]);router[_0xbf1a('0x61')](_0xbf1a('0x2b'),auth['isAuthenticated'](),controller[_0xbf1a('0x69')]);router['delete'](_0xbf1a('0x2d'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router['delete']('/:id/chat_websites',auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xbf1a('0x61')](_0xbf1a('0x30'),auth['isAuthenticated'](),controller[_0xbf1a('0x6a')]);router[_0xbf1a('0x61')]('/:id/square_projects',auth[_0xbf1a('0x9')](),controller['removeSquareProjects']);router['delete'](_0xbf1a('0x34'),auth[_0xbf1a('0x9')](),controller[_0xbf1a('0x6b')]);module[_0xbf1a('0x6c')]=router;
\ No newline at end of file
+var _0xb580=['addSmsAccounts','addWhatsappAccounts','addSquareProjects','/:id/api_key','update','put','delete','removeQueues','/:id','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','Router','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/prefixes','/:id/fax_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','now','originalname','file','addAvatar','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xb580,0x1cf));var _0x0b58=function(_0x71e052,_0x35434c){_0x71e052=_0x71e052-0x0;var _0x13e2c5=_0xb580[_0x71e052];return _0x13e2c5;};'use strict';var multer=require(_0x0b58('0x0'));var util=require(_0x0b58('0x1'));var path=require(_0x0b58('0x2'));var timeout=require(_0x0b58('0x3'));var express=require('express');var router=express[_0x0b58('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0b58('0x5'));var config=require('../../config/environment');var controller=require(_0x0b58('0x6'));router[_0x0b58('0x7')]('/',auth[_0x0b58('0x8')](),controller[_0x0b58('0x9')]);router[_0x0b58('0x7')](_0x0b58('0xa'),auth[_0x0b58('0x8')](),controller[_0x0b58('0xb')]);router[_0x0b58('0x7')](_0x0b58('0xc'),auth[_0x0b58('0x8')](),controller['whoami']);router['get'](_0x0b58('0xd'),auth['isAuthenticated'](),controller[_0x0b58('0xe')]);router[_0x0b58('0x7')]('/:id',auth[_0x0b58('0x8')](),controller[_0x0b58('0xf')]);router[_0x0b58('0x7')](_0x0b58('0x10'),controller[_0x0b58('0x11')]);router['get'](_0x0b58('0x12'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x13')]);router['get'](_0x0b58('0x14'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x15')]);router[_0x0b58('0x7')](_0x0b58('0x16'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x17')]);router[_0x0b58('0x7')]('/:id/queues_rt',auth[_0x0b58('0x8')](),controller[_0x0b58('0x18')]);router['get'](_0x0b58('0x19'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x1a')]);router[_0x0b58('0x7')](_0x0b58('0x1b'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x1c')]);router['get']('/:id/screen_recordings',auth[_0x0b58('0x8')](),controller[_0x0b58('0x1d')]);router[_0x0b58('0x7')](_0x0b58('0x1e'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x1f')]);router[_0x0b58('0x7')](_0x0b58('0x20'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x21')]);router[_0x0b58('0x7')]('/:id/mail/interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x22')]);router[_0x0b58('0x7')]('/:id/sms/interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x23')]);router[_0x0b58('0x7')]('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x0b58('0x7')](_0x0b58('0x24'),auth['isAuthenticated'](),controller[_0x0b58('0x25')]);router[_0x0b58('0x7')](_0x0b58('0x26'),auth['isAuthenticated'](),controller[_0x0b58('0x27')]);router[_0x0b58('0x7')](_0x0b58('0x28'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x29')]);router[_0x0b58('0x7')]('/:id/agents',auth[_0x0b58('0x8')](),controller['getAgents']);router[_0x0b58('0x7')](_0x0b58('0x2a'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router['get'](_0x0b58('0x2b'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x0b58('0x7')]('/:id/mail_accounts',auth[_0x0b58('0x8')](),controller[_0x0b58('0x2c')]);router[_0x0b58('0x7')](_0x0b58('0x2d'),auth[_0x0b58('0x8')](),controller['getOpenchannelAccounts']);router[_0x0b58('0x7')](_0x0b58('0x2e'),auth[_0x0b58('0x8')](),controller['getSmsAccounts']);router[_0x0b58('0x7')](_0x0b58('0x2f'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x30')]);router[_0x0b58('0x7')](_0x0b58('0x31'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x0b58('0x7')]('/:id/square_projects',auth[_0x0b58('0x8')](),controller[_0x0b58('0x32')]);router[_0x0b58('0x7')](_0x0b58('0x33'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x34')]);router[_0x0b58('0x7')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x0b58('0x35')]);router['post'](_0x0b58('0x14'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x36')]);router[_0x0b58('0x37')]('/',auth[_0x0b58('0x8')](),controller[_0x0b58('0x38')]);router[_0x0b58('0x37')]('/create_many',auth[_0x0b58('0x8')](),controller[_0x0b58('0x39')]);router['post']('/:id/queues',auth[_0x0b58('0x8')](),controller[_0x0b58('0x3a')]);var upload=multer({'storage':multer[_0x0b58('0x3b')]({'destination':function(_0x36e056,_0x2e7185,_0x13189d){_0x13189d(null,path[_0x0b58('0x3c')](config[_0x0b58('0x3d')],_0x0b58('0x3e')));},'filename':function(_0x2a1c50,_0x5ce2a7,_0xd41e6e){_0xd41e6e(null,util[_0x0b58('0x3f')]('%s-%s',Date[_0x0b58('0x40')](),_0x5ce2a7[_0x0b58('0x41')]));}})});router[_0x0b58('0x37')](_0x0b58('0x10'),upload['single'](_0x0b58('0x42')),controller[_0x0b58('0x43')]);router[_0x0b58('0x37')]('/:id/login',auth[_0x0b58('0x8')](),controller[_0x0b58('0x44')]);router['post'](_0x0b58('0x45'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x46')]);router[_0x0b58('0x37')]('/:id/pause',auth['isAuthenticated'](),controller[_0x0b58('0x47')]);router[_0x0b58('0x37')](_0x0b58('0x48'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x49')]);router[_0x0b58('0x37')](_0x0b58('0x26'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x4a')]);router[_0x0b58('0x37')](_0x0b58('0x4b'),auth[_0x0b58('0x8')](),controller['addChatInteractions']);router[_0x0b58('0x37')](_0x0b58('0x4c'),auth[_0x0b58('0x8')](),controller['addMailInteractions']);router[_0x0b58('0x37')]('/:id/fax_interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x4d')]);router[_0x0b58('0x37')](_0x0b58('0x4e'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x4f')]);router[_0x0b58('0x37')](_0x0b58('0x50'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x51')]);router[_0x0b58('0x37')](_0x0b58('0x52'),auth[_0x0b58('0x8')](),controller['addWhatsappInteractions']);router[_0x0b58('0x37')](_0x0b58('0x2b'),auth['isAuthenticated'](),controller[_0x0b58('0x53')]);router[_0x0b58('0x37')](_0x0b58('0x54'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x55')]);router['post'](_0x0b58('0x2d'),auth['isAuthenticated'](),controller[_0x0b58('0x56')]);router[_0x0b58('0x37')](_0x0b58('0x2e'),auth['isAuthenticated'](),controller[_0x0b58('0x57')]);router[_0x0b58('0x37')](_0x0b58('0x2f'),auth[_0x0b58('0x8')](),controller['addChatWebsites']);router[_0x0b58('0x37')](_0x0b58('0x31'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x58')]);router[_0x0b58('0x37')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x0b58('0x59')]);router[_0x0b58('0x37')](_0x0b58('0x5a'),auth[_0x0b58('0x8')](),controller['createApiKey']);router['put']('/:id',auth[_0x0b58('0x8')](),controller[_0x0b58('0x5b')]);router[_0x0b58('0x5c')]('/:id/password',auth['isAuthenticated'](),controller['changePassword']);router[_0x0b58('0x5d')](_0x0b58('0x16'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x5e')]);router[_0x0b58('0x5d')]('/:id/teams',auth[_0x0b58('0x8')](),controller['removeTeams']);router[_0x0b58('0x5d')](_0x0b58('0x5f'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x60')]);router[_0x0b58('0x5d')]('/:id/chat_interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x61')]);router[_0x0b58('0x5d')](_0x0b58('0x4c'),auth['isAuthenticated'](),controller[_0x0b58('0x62')]);router[_0x0b58('0x5d')]('/:id/fax_interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x63')]);router['delete']('/:id/sms_interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x64')]);router[_0x0b58('0x5d')](_0x0b58('0x50'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x65')]);router[_0x0b58('0x5d')](_0x0b58('0x52'),auth['isAuthenticated'](),controller[_0x0b58('0x66')]);router[_0x0b58('0x5d')](_0x0b58('0x2b'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x67')]);router[_0x0b58('0x5d')](_0x0b58('0x54'),auth['isAuthenticated'](),controller[_0x0b58('0x68')]);router[_0x0b58('0x5d')](_0x0b58('0x2d'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x69')]);router['delete'](_0x0b58('0x2e'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x6a')]);router[_0x0b58('0x5d')](_0x0b58('0x2f'),auth[_0x0b58('0x8')](),controller['removeChatWebsites']);router[_0x0b58('0x5d')](_0x0b58('0x31'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x6b')]);router[_0x0b58('0x5d')]('/:id/square_projects',auth[_0x0b58('0x8')](),controller[_0x0b58('0x6c')]);router['delete']('/:id/api_key',auth[_0x0b58('0x8')](),controller[_0x0b58('0x6d')]);module['exports']=router;
\ No newline at end of file
index 1fd5bd8..7fd85a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18b2=['update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','active','actpass','nonat','update,nonat','DATE','TEXT','showWebBar','isArray','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','friend','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','join','split','rfc2833','info','shortinfo','inband','auto'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x18b2,0x85));var _0x218b=function(_0x1bf526,_0x507c17){_0x1bf526=_0x1bf526-0x0;var _0x5b1978=_0x18b2[_0x1bf526];return _0x5b1978;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x218b('0x0'));var util=require(_0x218b('0x1'));var _=require(_0x218b('0x2'));module['exports']={'name':{'type':Sequelize[_0x218b('0x3')],'allowNull':![],'unique':_0x218b('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3f15c3){this[_0x218b('0x5')](_0x218b('0x4'),_0x3f15c3);this[_0x218b('0x5')](_0x218b('0x6'),_0x3f15c3);},'comment':_0x218b('0x7')},'fullname':{'type':Sequelize[_0x218b('0x3')],'allowNull':![],'set':function(_0x6bf41c){this[_0x218b('0x5')](_0x218b('0x8'),_0x6bf41c);this[_0x218b('0x5')](_0x218b('0x9'),util[_0x218b('0xa')]('\x22%s\x22\x20<%s>',_0x6bf41c,this[_0x218b('0xb')](_0x218b('0xc'))));}},'alias':{'type':Sequelize[_0x218b('0x3')]},'email':{'type':Sequelize[_0x218b('0x3')],'allowNull':![],'unique':_0x218b('0xd'),'validate':{'isEmail':!![]},'set':function(_0x4ee68f){if(_0x4ee68f){this[_0x218b('0x5')]('email',_0x4ee68f[_0x218b('0xe')]());}}},'role':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x10'),'user',_0x218b('0x11'),_0x218b('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x218b('0x3')],'defaultValue':_0x218b('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x218b('0xc'),'set':function(_0xa45378){this[_0x218b('0x5')](_0x218b('0xc'),_0xa45378);this[_0x218b('0x5')](_0x218b('0x14'),_0xa45378);this[_0x218b('0x5')](_0x218b('0x9'),util[_0x218b('0xa')](_0x218b('0x15'),this[_0x218b('0xb')](_0x218b('0x8')),_0xa45378));}},'salt':{'type':Sequelize[_0x218b('0x3')]},'phone':{'type':Sequelize[_0x218b('0x3')]},'mobile':{'type':Sequelize[_0x218b('0x3')]},'address':{'type':Sequelize[_0x218b('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x218b('0x3')]},'city':{'type':Sequelize[_0x218b('0x3')]},'country':{'type':Sequelize[_0x218b('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x218b('0x3')],'defaultValue':_0x218b('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x218b('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x218b('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x218b('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x218b('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x218b('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x218b('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x19'),'user','peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x218b('0x1a'),_0x218b('0x1b'),_0x218b('0x1c'),_0x218b('0x1d'),_0x218b('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x5a70e8){this['setDataValue'](_0x218b('0x1f'),_0x5a70e8?_0x5a70e8[_0x218b('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x218b('0x1f'))?this[_0x218b('0xb')](_0x218b('0x1f'))[_0x218b('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x22'),_0x218b('0x23'),_0x218b('0x24'),_0x218b('0x25'),_0x218b('0x26')),'allowNull':!![],'defaultValue':_0x218b('0x22')},'directmedia':{'type':Sequelize[_0x218b('0xf')]('yes','no','nonat',_0x218b('0x27'),_0x218b('0x28')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x218b('0x2a'),'set':function(_0x5d99e0){this['setDataValue'](_0x218b('0x2b'),_0x5d99e0?_0x5d99e0[_0x218b('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x218b('0x2b'))?this[_0x218b('0xb')]('nat')['split'](','):null;},'comment':_0x218b('0x2c')},'callgroup':{'type':Sequelize[_0x218b('0x3')]},'namedcallgroup':{'type':Sequelize[_0x218b('0x3')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x218b('0x3')]},'language':{'type':Sequelize[_0x218b('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x218b('0x3')],'allowNull':![],'defaultValue':_0x218b('0x2d')},'allow':{'type':Sequelize[_0x218b('0x3')],'allowNull':![],'defaultValue':_0x218b('0x2e'),'set':function(_0x21b296){this[_0x218b('0x5')](_0x218b('0x2f'),_0x21b296?_0x21b296[_0x218b('0x20')](';'):_0x218b('0x2e'));},'get':function(){return this[_0x218b('0xb')](_0x218b('0x2f'))?this['getDataValue'](_0x218b('0x2f'))[_0x218b('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x4d907e){this[_0x218b('0x5')](_0x218b('0x30'),_0x4d907e?_0x4d907e[_0x218b('0x20')](','):null);},'get':function(){return this[_0x218b('0xb')](_0x218b('0x30'))?this['getDataValue'](_0x218b('0x30'))[_0x218b('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x218b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![],'defaultValue':_0x218b('0x31')},'amaflags':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![],'defaultValue':_0x218b('0x29')},'busylevel':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x218b('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x218b('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x218b('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x32'),_0x218b('0x33'),_0x218b('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x218b('0x35'),_0x218b('0x36')),'allowNull':!![],'defaultValue':_0x218b('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![],'defaultValue':_0x218b('0x29')},'keepalive':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x218b('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x218b('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x218b('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x218b('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x218b('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x218b('0x38'),'passive',_0x218b('0x39')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x218b('0xf')](_0x218b('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x218b('0xf')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x218b('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x218b('0xf')]('yes','no',_0x218b('0x3a'),_0x218b('0x27'),_0x218b('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x218b('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x218b('0x3c')]},'passwordResetAt':{'type':Sequelize[_0x218b('0x3c')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x218b('0x3d')]},'showWebBar':{'type':Sequelize[_0x218b('0x18')],'defaultValue':0x0,'set':function(_0x1c8d67){this[_0x218b('0x5')](_0x218b('0x3e'),_0x1c8d67);var _0x22a372=this['get']({'plain':!![]});switch(_0x1c8d67){case 0x0:case 0x1:var _0x3b7855=_0x22a372[_0x218b('0x1f')]?_[_0x218b('0x3f')](_0x22a372[_0x218b('0x1f')])?_0x22a372[_0x218b('0x1f')][_0x218b('0x20')]():_0x22a372['transport']:_0x218b('0x40');if(_0x3b7855==='wss'){_0x3b7855=_0x218b('0x40');}this[_0x218b('0x5')](_0x218b('0x1f'),_0x3b7855);this[_0x218b('0x5')](_0x218b('0x41'),'no');this[_0x218b('0x5')](_0x218b('0x42'),null);this[_0x218b('0x5')](_0x218b('0x43'),null);this[_0x218b('0x5')](_0x218b('0x44'),null);this[_0x218b('0x5')](_0x218b('0x45'),null);this['setDataValue'](_0x218b('0x46'),null);this[_0x218b('0x5')](_0x218b('0x47'),null);this['setDataValue'](_0x218b('0x48'),null);this[_0x218b('0x5')](_0x218b('0x49'),null);this['setDataValue'](_0x218b('0x4a'),'no');break;case 0x2:this[_0x218b('0x5')]('transport','wss');this['setDataValue'](_0x218b('0x41'),_0x218b('0x29'));this[_0x218b('0x5')]('avpf',_0x218b('0x29'));this[_0x218b('0x5')](_0x218b('0x43'),_0x218b('0x29'));this['setDataValue']('icesupport',_0x218b('0x29'));this[_0x218b('0x5')](_0x218b('0x45'),_0x218b('0x29'));this[_0x218b('0x5')]('dtlsverify','no');this[_0x218b('0x5')](_0x218b('0x47'),_0x218b('0x39'));this['setDataValue']('dtlscertfile',_0x22a372['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x218b('0x5')]('dtlsprivatekey',_0x22a372[_0x218b('0x49')]||'/etc/pki/tls/private/motion.key');this[_0x218b('0x5')](_0x218b('0x4a'),_0x218b('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0x218b('0x3d')],'set':function(_0x2c3570){this[_0x218b('0x5')](_0x218b('0x4b'),_0x2c3570?_0x2c3570['join'](','):[]);},'get':function(){return this['getDataValue'](_0x218b('0x4b'))?_[_0x218b('0x4c')](this[_0x218b('0xb')](_0x218b('0x4b'))['split'](','),function(_0x201854){return parseInt(_0x201854,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x218b('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x218b('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x218b('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x218b('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x218b('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x218b('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x218b('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x218b('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x218b('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x218b('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x218b('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x218b('0x4d')],'get':function(){return this[_0x218b('0xb')](_0x218b('0x4e'))?this[_0x218b('0xb')](_0x218b('0x4e')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x218b('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x218b('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![],'set':function(_0x570ff5){if(typeof _0x570ff5===_0x218b('0x4f')){var _0x1188d8=_0x570ff5==='1'?!![]:_0x570ff5==='0'?![]:_0x570ff5===_0x218b('0x50')?!![]:_0x570ff5===_0x218b('0x51')?![]:![];this[_0x218b('0x5')](_0x218b('0x52'),_0x1188d8);}else{this['setDataValue'](_0x218b('0x52'),_0x570ff5);}}},'blocked':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![],'set':function(_0x2fed9b){this['setDataValue'](_0x218b('0x53'),_0x2fed9b);if(_0x2fed9b===!![]){this[_0x218b('0x5')](_0x218b('0x54'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x218b('0x3c')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x218b('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x218b('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x218b('0x18')](0x5)[_0x218b('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x218b('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x218b('0x16')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2e88=['PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','always','accept','originate','uac','fingerprint','certificate','active','passive','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED'];(function(_0x21bc6d,_0x36b1d4){var _0x3d24bb=function(_0x3e83e8){while(--_0x3e83e8){_0x21bc6d['push'](_0x21bc6d['shift']());}};_0x3d24bb(++_0x36b1d4);}(_0x2e88,0x95));var _0x82e8=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x2e88[_0x4a29a9];return _0x386570;};'use strict';var Sequelize=require(_0x82e8('0x0'));var moment=require(_0x82e8('0x1'));var util=require(_0x82e8('0x2'));var _=require(_0x82e8('0x3'));module[_0x82e8('0x4')]={'name':{'type':Sequelize[_0x82e8('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x40c9c5){this[_0x82e8('0x6')]('name',_0x40c9c5);this[_0x82e8('0x6')](_0x82e8('0x7'),_0x40c9c5);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x82e8('0x5')],'allowNull':![],'set':function(_0x1e2496){this[_0x82e8('0x6')](_0x82e8('0x8'),_0x1e2496);this[_0x82e8('0x6')](_0x82e8('0x9'),util[_0x82e8('0xa')](_0x82e8('0xb'),_0x1e2496,this[_0x82e8('0xc')](_0x82e8('0xd'))));}},'alias':{'type':Sequelize[_0x82e8('0x5')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x82e8('0xe'),'validate':{'isEmail':!![]},'set':function(_0x24f4a1){if(_0x24f4a1){this[_0x82e8('0x6')](_0x82e8('0xe'),_0x24f4a1[_0x82e8('0xf')]());}}},'role':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x11'),'user',_0x82e8('0x12'),_0x82e8('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x82e8('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x82e8('0x5')],'defaultValue':_0x82e8('0x14')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x82e8('0xd'),'set':function(_0x2c9569){this[_0x82e8('0x6')](_0x82e8('0xd'),_0x2c9569);this['setDataValue'](_0x82e8('0x15'),_0x2c9569);this[_0x82e8('0x6')](_0x82e8('0x9'),util[_0x82e8('0xa')](_0x82e8('0xb'),this['getDataValue'](_0x82e8('0x8')),_0x2c9569));}},'salt':{'type':Sequelize[_0x82e8('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x82e8('0x5')]},'address':{'type':Sequelize[_0x82e8('0x5')]},'zipcode':{'type':Sequelize[_0x82e8('0x5')]},'userpic':{'type':Sequelize[_0x82e8('0x5')]},'city':{'type':Sequelize[_0x82e8('0x5')]},'country':{'type':Sequelize[_0x82e8('0x5')]},'online':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x82e8('0x17')},'lastPauseAt':{'type':Sequelize[_0x82e8('0x18')]},'chatCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'defaultValue':_0x82e8('0x1a')},'ipaddr':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x82e8('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x1b'),_0x82e8('0x1c'),_0x82e8('0x1d')),'allowNull':!![],'defaultValue':_0x82e8('0x1b')},'context':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'defaultValue':_0x82e8('0x1e')},'callingpres':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x1f'),_0x82e8('0x20'),_0x82e8('0x21'),'ALLOWED',_0x82e8('0x22'),_0x82e8('0x23'),_0x82e8('0x24'),_0x82e8('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'defaultValue':_0x82e8('0x26'),'set':function(_0x579308){this[_0x82e8('0x6')](_0x82e8('0x27'),_0x579308?_0x579308[_0x82e8('0x28')](','):null);},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x27'))?this[_0x82e8('0xc')](_0x82e8('0x27'))[_0x82e8('0x29')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x82e8('0x10')]('rfc2833',_0x82e8('0x2a'),_0x82e8('0x2b'),'inband','auto'),'allowNull':!![],'defaultValue':_0x82e8('0x2c')},'directmedia':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no',_0x82e8('0x2e'),_0x82e8('0x2f'),_0x82e8('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'defaultValue':_0x82e8('0x31'),'set':function(_0x22c86b){this[_0x82e8('0x6')]('nat',_0x22c86b?_0x22c86b[_0x82e8('0x28')](','):null);},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x32'))?this['getDataValue'](_0x82e8('0x32'))[_0x82e8('0x29')](','):null;},'comment':_0x82e8('0x33')},'callgroup':{'type':Sequelize[_0x82e8('0x5')]},'namedcallgroup':{'type':Sequelize[_0x82e8('0x5')]},'pickupgroup':{'type':Sequelize[_0x82e8('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x82e8('0x5')]},'language':{'type':Sequelize[_0x82e8('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x82e8('0x5')]},'disallow':{'type':Sequelize[_0x82e8('0x5')],'allowNull':![],'defaultValue':_0x82e8('0x34')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82e8('0x35'),'set':function(_0x3f379d){this[_0x82e8('0x6')](_0x82e8('0x36'),_0x3f379d?_0x3f379d[_0x82e8('0x28')](';'):_0x82e8('0x35'));},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x36'))?this[_0x82e8('0xc')](_0x82e8('0x36'))[_0x82e8('0x29')](';'):null;},'comment':_0x82e8('0x37')},'autoframing':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'set':function(_0x4fba12){this[_0x82e8('0x6')]('insecure',_0x4fba12?_0x4fba12[_0x82e8('0x28')](','):null);},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x38'))?this[_0x82e8('0xc')](_0x82e8('0x38'))[_0x82e8('0x29')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no',_0x82e8('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no',_0x82e8('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x82e8('0x3b'),'refuse',_0x82e8('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x82e8('0x3d'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x82e8('0x10')]('yes','no',_0x82e8('0x3e'),_0x82e8('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x82e8('0x40'),_0x82e8('0x41'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x82e8('0x10')]('yes','no',_0x82e8('0x2e'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x82e8('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x82e8('0x18')]},'passwordResetAt':{'type':Sequelize[_0x82e8('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0,'set':function(_0x238782){this[_0x82e8('0x6')](_0x82e8('0x42'),_0x238782);var _0x31c307=this[_0x82e8('0x43')]({'plain':!![]});switch(_0x238782){case 0x0:case 0x1:var _0x28e78e=_0x31c307[_0x82e8('0x27')]?_[_0x82e8('0x44')](_0x31c307[_0x82e8('0x27')])?_0x31c307[_0x82e8('0x27')][_0x82e8('0x28')]():_0x31c307[_0x82e8('0x27')]:_0x82e8('0x26');if(_0x28e78e===_0x82e8('0x45')){_0x28e78e=_0x82e8('0x26');}this['setDataValue'](_0x82e8('0x27'),_0x28e78e);this[_0x82e8('0x6')](_0x82e8('0x46'),'no');this[_0x82e8('0x6')](_0x82e8('0x47'),null);this[_0x82e8('0x6')](_0x82e8('0x48'),null);this[_0x82e8('0x6')](_0x82e8('0x49'),null);this[_0x82e8('0x6')](_0x82e8('0x4a'),null);this['setDataValue'](_0x82e8('0x4b'),null);this[_0x82e8('0x6')](_0x82e8('0x4c'),null);this[_0x82e8('0x6')](_0x82e8('0x4d'),null);this[_0x82e8('0x6')](_0x82e8('0x4e'),null);this[_0x82e8('0x6')](_0x82e8('0x4f'),'no');break;case 0x2:this[_0x82e8('0x6')](_0x82e8('0x27'),_0x82e8('0x45'));this[_0x82e8('0x6')](_0x82e8('0x46'),_0x82e8('0x2d'));this[_0x82e8('0x6')](_0x82e8('0x47'),'yes');this[_0x82e8('0x6')](_0x82e8('0x48'),_0x82e8('0x2d'));this[_0x82e8('0x6')](_0x82e8('0x49'),_0x82e8('0x2d'));this[_0x82e8('0x6')]('dtlsenable',_0x82e8('0x2d'));this[_0x82e8('0x6')]('dtlsverify','no');this['setDataValue'](_0x82e8('0x4c'),'actpass');this['setDataValue'](_0x82e8('0x4d'),_0x31c307[_0x82e8('0x4d')]||'/etc/pki/tls/certs/motion.crt');this[_0x82e8('0x6')]('dtlsprivatekey',_0x31c307[_0x82e8('0x4e')]||'/etc/pki/tls/private/motion.key');this[_0x82e8('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x82e8('0x50')],'set':function(_0x56e35c){this[_0x82e8('0x6')](_0x82e8('0x51'),_0x56e35c?_0x56e35c[_0x82e8('0x28')](','):[]);},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x51'))?_[_0x82e8('0x52')](this[_0x82e8('0xc')](_0x82e8('0x51'))[_0x82e8('0x29')](','),function(_0x414a37){return parseInt(_0x414a37,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x82e8('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x82e8('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x82e8('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x82e8('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x82e8('0x53')],'get':function(){return this['getDataValue'](_0x82e8('0x54'))?this[_0x82e8('0xc')](_0x82e8('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![],'set':function(_0x4a8da3){if(typeof _0x4a8da3===_0x82e8('0x55')){var _0x36d2df=_0x4a8da3==='1'?!![]:_0x4a8da3==='0'?![]:_0x4a8da3===_0x82e8('0x56')?!![]:_0x4a8da3===_0x82e8('0x57')?![]:![];this[_0x82e8('0x6')](_0x82e8('0x58'),_0x36d2df);}else{this[_0x82e8('0x6')]('screenrecording',_0x4a8da3);}}},'blocked':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![],'set':function(_0x27fd4a){this[_0x82e8('0x6')](_0x82e8('0x59'),_0x27fd4a);if(_0x27fd4a===!![]){this[_0x82e8('0x6')]('blockedAt',moment());this['setDataValue'](_0x82e8('0x5a'),0x0);}else{this[_0x82e8('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x82e8('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x82e8('0x19')](0x5)[_0x82e8('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index bec14d4..1c06b19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','firstName','lastName','phone','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','flatten','lower','col','toString','desc','orderBy','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unavailable','voiceStatus','busy','charAt','toUpperCase','slice','select','field','ui.','InteractionId','ui.UserId\x20=\x20?','moment','path','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','./user.socket','redis','client','http','request','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','info','sendStatus','end','status','json','limit','undefined','offset','set','Content-Range','update','destroy','then','get','role','admin','Users','user','Agents','agent','Telephones','ignore','value','includes','find','name','UserProfileResource','stack','send','User','rawAttributes','map','fieldName','type','key','filter','getOptions','where','count','includeAll','include','attributes','push','findAll','rows','query','openTabs','true','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','show','params','model','differenceBy','keys','password','salt','filters','intersection','fields','options','body','describe','addContacts','omit','ids','Setting','findById','securePassword','max','isNil','min_internal','internal','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)','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','permissions','101','102','103','113','110','106','107','108','109','100','111','114','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','each','telephone','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','Unknown\x20channel','add','toLowerCase','Queues','spread','QueueId','emit','capitalize','Queue:save','voice','format','UserVoiceQueueRt','upsert','removeQueues','channel','isValidChannel','isArray','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','sort','pick','merge','hasOwnProperty','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','order','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:forcelogout','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','concat','resolve','logout','MemberReport','pause','QueuePause','DEFAULT\x20PAUSE','chatPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','unpause','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','getMailQueues','Sms','getWhatsappQueues','Whatsapp','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','Chat','getSmsQueues','getFaxQueues','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove'];(function(_0x246dd5,_0x514b86){var _0xaffcba=function(_0x4eea48){while(--_0x4eea48){_0x246dd5['push'](_0x246dd5['shift']());}};_0xaffcba(++_0x514b86);}(_0x0295,0x1f0));var _0x5029=function(_0x12711a,_0x455f94){_0x12711a=_0x12711a-0x0;var _0x175027=_0x0295[_0x12711a];return _0x175027;};'use strict';var moment=require(_0x5029('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x5029('0x1'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var jayson=require(_0x5029('0x2'));var Redis=require(_0x5029('0x3'));var authService=require(_0x5029('0x4'));var qs=require(_0x5029('0x5'));var logger=require(_0x5029('0x6'))(_0x5029('0x7'));var utils=require(_0x5029('0x8'));var config=require(_0x5029('0x9'));var licenseUtil=require(_0x5029('0xa'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5029('0xb'))['register'](socket);config[_0x5029('0xc')]=_['defaults'](config[_0x5029('0xc')],{'host':'localhost','port':0x18eb});var client=jayson[_0x5029('0xd')][_0x5029('0xe')]({'port':0x232a});var values;function respondWithRpcPromise(_0x12834c,_0x52fa95,_0x3f4c48,_0xbf61f){return new BPromise(function(_0x3fe6d1,_0x4f295e){var _0x3bc005=_0xbf61f||client;return _0x3bc005[_0x5029('0xf')](_0x12834c,_0x3f4c48)['then'](function(_0x4fa22d){logger['info']('User,\x20%s,\x20%s',_0x52fa95,_0x5029('0x10'));logger[_0x5029('0x11')](_0x5029('0x12'),_0x52fa95,_0x5029('0x10'),JSON[_0x5029('0x13')](_0x4fa22d));if(_0x4fa22d[_0x5029('0x14')]){if(_0x4fa22d[_0x5029('0x14')][_0x5029('0x15')]===0x1f4){logger[_0x5029('0x14')](_0x5029('0x16'),_0x52fa95,_0x4fa22d[_0x5029('0x14')][_0x5029('0x17')]);return _0x4f295e(_0x4fa22d[_0x5029('0x14')][_0x5029('0x17')]);}logger[_0x5029('0x14')]('User,\x20%s,\x20%s',_0x52fa95,_0x4fa22d[_0x5029('0x14')][_0x5029('0x17')]);return _0x3fe6d1(_0x4fa22d[_0x5029('0x14')][_0x5029('0x17')]);}else{logger[_0x5029('0x18')](_0x5029('0x16'),_0x52fa95,_0x5029('0x10'));_0x3fe6d1(_0x4fa22d['result'][_0x5029('0x17')]);}})['catch'](function(_0x16485c){logger[_0x5029('0x14')](_0x5029('0x16'),_0x52fa95,_0x16485c);_0x4f295e(_0x16485c);});});}function respondWithStatusCode(_0x3cf0fb,_0x4b5854){_0x4b5854=_0x4b5854||0xcc;return function(_0x47ecca){if(_0x47ecca){return _0x3cf0fb[_0x5029('0x19')](_0x4b5854);}return _0x3cf0fb['status'](_0x4b5854)[_0x5029('0x1a')]();};}function respondWithResult(_0x853a34,_0x1eb228){_0x1eb228=_0x1eb228||0xc8;return function(_0x2bbbcb){if(_0x2bbbcb){return _0x853a34[_0x5029('0x1b')](_0x1eb228)[_0x5029('0x1c')](_0x2bbbcb);}};}function respondWithFilteredResult(_0x125c26,_0x356dac){return function(_0x3e857d){if(_0x3e857d){var _0x4ceaae=typeof _0x356dac['offset']==='undefined'&&typeof _0x356dac[_0x5029('0x1d')]===_0x5029('0x1e');var _0x51093c=_0x3e857d['count'];var _0x181da0=_0x4ceaae?0x0:_0x356dac[_0x5029('0x1f')];var _0x36d810=_0x4ceaae?_0x3e857d['count']:_0x356dac[_0x5029('0x1f')]+_0x356dac[_0x5029('0x1d')];var _0x5e45c4;if(_0x36d810>=_0x51093c){_0x36d810=_0x51093c;_0x5e45c4=0xc8;}else{_0x5e45c4=0xce;}_0x125c26[_0x5029('0x1b')](_0x5e45c4);return _0x125c26[_0x5029('0x20')](_0x5029('0x21'),_0x181da0+'-'+_0x36d810+'/'+_0x51093c)['json'](_0x3e857d);}return null;};}function saveUpdates(_0x32da06){return function(_0x251f99){if(_0x251f99){return _0x251f99[_0x5029('0x22')](_0x32da06)['then'](function(_0x2cedf6){return _0x2cedf6;});}return null;};}function removeEntity(_0x2bb398){return function(_0x4cc16a){if(_0x4cc16a){return _0x4cc16a[_0x5029('0x23')]()[_0x5029('0x24')](function(){var _0x4434ff=_0x4cc16a[_0x5029('0x25')]({'plain':!![]});if(_0x4434ff[_0x5029('0x26')]===_0x5029('0x27'))return;var _0x44255a=[{'name':_0x5029('0x28'),'value':_0x5029('0x29'),'ignore':!![]},{'name':_0x5029('0x2a'),'value':_0x5029('0x2b'),'ignore':![]},{'name':_0x5029('0x2c'),'value':'telephone','ignore':![]}];var _0x11ae38=_(_0x44255a)['filter'](_0x5029('0x2d'))['map']('value')[_0x5029('0x2e')]();if(_[_0x5029('0x2f')](_0x11ae38,_0x4434ff[_0x5029('0x26')])){return;}var _0x4b7330=_[_0x5029('0x30')](_0x44255a,[_0x5029('0x2e'),_0x4434ff[_0x5029('0x26')]])[_0x5029('0x31')];return db[_0x5029('0x32')][_0x5029('0x23')]({'where':{'type':_0x4b7330,'resourceId':_0x4434ff['id']}})[_0x5029('0x24')](function(){return _0x4cc16a;});})[_0x5029('0x24')](function(){_0x2bb398[_0x5029('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db45c){return function(_0xa4a432){if(!_0xa4a432){_0x1db45c[_0x5029('0x19')](0x194);}return _0xa4a432;};}function handleError(_0x1b3817,_0x5ecd00){_0x5ecd00=_0x5ecd00||0x1f4;return function(_0x184b8d){logger[_0x5029('0x14')](_0x184b8d[_0x5029('0x33')]);if(_0x184b8d['name']){delete _0x184b8d['name'];}_0x1b3817[_0x5029('0x1b')](_0x5ecd00)[_0x5029('0x34')](_0x184b8d);};}exports['index']=function(_0x57784c,_0x9656f2){var _0x157969={},_0x270d66={'count':0x0,'rows':[]};var _0x3210cb=_(db[_0x5029('0x35')][_0x5029('0x36')])[_0x5029('0x37')](function(_0x2f13b1){return{'name':_0x2f13b1[_0x5029('0x38')],'type':_0x2f13b1[_0x5029('0x39')][_0x5029('0x3a')]};})[_0x5029('0x3b')](function(_0x46314a){return!_[_0x5029('0x2f')](['password','salt'],_0x46314a[_0x5029('0x31')]);})[_0x5029('0x2e')]();_0x157969=qs[_0x5029('0x3c')](_0x3210cb,_0x57784c);var _0x48c9eb={'where':_0x157969[_0x5029('0x3d')]};return db[_0x5029('0x35')]['count'](_0x48c9eb)[_0x5029('0x24')](function(_0x4c3e11){_0x270d66[_0x5029('0x3e')]=_0x4c3e11;if(_0x57784c['query'][_0x5029('0x3f')]){_0x157969[_0x5029('0x40')]=[{'all':!![]}];}if(!_[_0x5029('0x2f')](_0x157969[_0x5029('0x41')],'id')){_0x157969[_0x5029('0x41')][_0x5029('0x42')]('id');}return db[_0x5029('0x35')][_0x5029('0x43')](_0x157969);})[_0x5029('0x24')](function(_0x5a3e4d){_0x270d66[_0x5029('0x44')]=_0x5a3e4d;if(_0x57784c[_0x5029('0x45')][_0x5029('0x46')]===_0x5029('0x47')){var _0x3525bc=[];for(var _0x11ac2e=0x0;_0x11ac2e<_0x270d66['rows'][_0x5029('0x48')];_0x11ac2e++){_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x49'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc['push'](get_open_tabs(_0x5029('0x4b'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4c'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x270d66['rows'][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x270d66[_0x5029('0x44')][_0x11ac2e]['dataValues']));_0x3525bc['push'](get_open_tabs(_0x5029('0x4f'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));}return BPromise[_0x5029('0x50')](_0x3525bc)[_0x5029('0x24')](function(_0x3dfc08){return _0x270d66;});}else{return _0x270d66;}})[_0x5029('0x24')](respondWithFilteredResult(_0x9656f2,_0x157969))[_0x5029('0x51')](handleError(_0x9656f2,null));};exports[_0x5029('0x52')]=function(_0x2790e4,_0x2c2e0e){var _0x39370b={'raw':![],'where':{'id':_0x2790e4[_0x5029('0x53')]['id']}},_0x449ef5={};_0x449ef5[_0x5029('0x54')]=_[_0x5029('0x55')](_[_0x5029('0x56')](db[_0x5029('0x35')][_0x5029('0x36')]),[_0x5029('0x57'),_0x5029('0x58')]);_0x449ef5['query']=_[_0x5029('0x56')](_0x2790e4['query']);_0x449ef5[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x449ef5['model'],_0x449ef5['query']);_0x39370b[_0x5029('0x41')]=_['intersection'](_0x449ef5['model'],qs[_0x5029('0x5b')](_0x2790e4[_0x5029('0x45')][_0x5029('0x5b')]));_0x39370b['attributes']=_0x39370b['attributes'][_0x5029('0x48')]?_0x39370b[_0x5029('0x41')]:_0x449ef5['model'];if(_0x2790e4[_0x5029('0x45')]['includeAll']){_0x39370b[_0x5029('0x40')]=[{'all':!![]}];}_0x39370b=_['merge']({},_0x39370b,_0x2790e4[_0x5029('0x5c')]);if(!_[_0x5029('0x2f')](_0x39370b[_0x5029('0x41')],'id')){_0x39370b[_0x5029('0x41')][_0x5029('0x42')]('id');}return db[_0x5029('0x35')][_0x5029('0x30')](_0x39370b)[_0x5029('0x24')](handleEntityNotFound(_0x2c2e0e,null))['then'](function(_0x1df044){var _0x5dd466=[];values=_0x1df044;if(_0x2790e4[_0x5029('0x45')][_0x5029('0x46')]==='true'){_0x5dd466[_0x5029('0x42')](get_open_tabs('chat',_0x1df044['dataValues']));_0x5dd466['push'](get_open_tabs(_0x5029('0x4b'),_0x1df044['dataValues']));_0x5dd466[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x1df044[_0x5029('0x4a')]));_0x5dd466['push'](get_open_tabs(_0x5029('0x4f'),_0x1df044['dataValues']));_0x5dd466['push'](get_open_tabs(_0x5029('0x4c'),_0x1df044[_0x5029('0x4a')]));_0x5dd466[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x1df044[_0x5029('0x4a')]));return BPromise['all'](_0x5dd466);}else{return values;}})[_0x5029('0x24')](function(_0x124634){return values;})[_0x5029('0x24')](respondWithResult(_0x2c2e0e,null))[_0x5029('0x51')](handleError(_0x2c2e0e,null));};exports['update']=function(_0x33812b,_0xfffc0d){if(_0x33812b['body']['id']){delete _0x33812b['body']['id'];}delete _0x33812b[_0x5029('0x5d')][_0x5029('0x26')];return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x33812b['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0xfffc0d,null))[_0x5029('0x24')](saveUpdates(_0x33812b[_0x5029('0x5d')],null))[_0x5029('0x24')](respondWithResult(_0xfffc0d,null))[_0x5029('0x51')](handleError(_0xfffc0d,null));};exports[_0x5029('0x5e')]=function(_0x59a718,_0x560324){return db[_0x5029('0x35')][_0x5029('0x5e')]()[_0x5029('0x24')](respondWithResult(_0x560324,null))['catch'](handleError(_0x560324,null));};exports[_0x5029('0x5f')]=function(_0x2d439a,_0x105638){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x2d439a['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x105638,null))[_0x5029('0x24')](function(_0x11637e){if(_0x11637e){return _0x11637e['addContacts'](_0x2d439a[_0x5029('0x5d')]['ids'],_[_0x5029('0x60')](_0x2d439a['body'],[_0x5029('0x61'),'id'])||{});}})[_0x5029('0x24')](respondWithResult(_0x105638,null))[_0x5029('0x51')](handleError(_0x105638,null));};function validateUser(_0x2f5301){return new BPromise(function(_0x1d2a67,_0x2ab5cf){if(_0x2f5301['internal'])return _0x1d2a67(_0x2f5301);return db[_0x5029('0x62')][_0x5029('0x63')](0x1)[_0x5029('0x24')](function(_0x151562){if(_0x151562[_0x5029('0x64')])authService['validatePasswordPattern'](_0x2f5301[_0x5029('0x57')]);db['User'][_0x5029('0x65')]('internal')[_0x5029('0x24')](function(_0x512392){if(_[_0x5029('0x66')](_0x512392)){_0x2f5301['internal']=_0x151562['min_internal']||0x1;return;}if(_[_0x5029('0x66')](_0x151562['min_internal'])||_0x151562[_0x5029('0x67')]===_0x512392){_0x2f5301[_0x5029('0x68')]=_0x512392+0x1;return;}if(_0x151562[_0x5029('0x67')]>_0x512392){_0x2f5301['internal']=_0x151562[_0x5029('0x67')];return;}return db['sequelize'][_0x5029('0x45')](_0x5029('0x69'),{'type':db[_0x5029('0x6a')][_0x5029('0x6b')][_0x5029('0x6c')]})['then'](function(_0x409034){if(_0x409034&&_0x409034[_0x5029('0x48')]){for(var _0x5890ac=0x0,_0x6500bb=_0x409034[_0x5029('0x48')];_0x5890ac<_0x6500bb&&_[_0x5029('0x66')](_0x2f5301[_0x5029('0x68')]);_0x5890ac++){if(_0x151562[_0x5029('0x67')]<=_0x409034[_0x5890ac][_0x5029('0x6d')]){_0x2f5301['internal']=_0x409034[_0x5890ac]['from'];}else if(_0x151562[_0x5029('0x67')]>_0x409034[_0x5890ac]['from']&&_0x151562[_0x5029('0x67')]<=_0x409034[_0x5890ac]['to']){_0x2f5301[_0x5029('0x68')]=_0x151562['min_internal'];}}}if(_[_0x5029('0x66')](_0x2f5301['internal'])){_0x2f5301['internal']=_0x512392+0x1;}return _0x1d2a67(_0x2f5301);});});})[_0x5029('0x51')](function(_0x340db9){_0x2ab5cf(_0x340db9);});});}function updateUser(_0x3aa169){return new BPromise(function(_0x3efc4b,_0x57874c){try{if(_0x3aa169[_0x5029('0x6e')]){_0x3aa169[_0x5029('0x6f')]=_0x3aa169['internal'];_0x3aa169[_0x5029('0x70')]={'mailbox':_0x3aa169[_0x5029('0x68')],'password':_0x3aa169['password'],'fullname':_0x3aa169['fullname'],'email':_0x3aa169['email']};}if(_0x3aa169[_0x5029('0x26')]===_0x5029('0x2b')){if(!_0x3aa169[_0x5029('0x71')])_0x3aa169[_0x5029('0x71')]=[_0x5029('0x72'),_0x5029('0x73'),_0x5029('0x74'),_0x5029('0x75'),_0x5029('0x76'),'104','105',_0x5029('0x77'),_0x5029('0x78'),_0x5029('0x79'),_0x5029('0x7a'),_0x5029('0x7b'),_0x5029('0x7c'),_0x5029('0x7d'),'115'];}_0x3efc4b(_0x3aa169);}catch(_0x31a1fd){_0x57874c(_0x31a1fd);}});}exports[_0x5029('0x7e')]=function(_0xc1be70,_0x4b61a6){if(_0xc1be70[_0x5029('0x29')][_0x5029('0x26')]===_0x5029('0x2b'))throw new Error('Unauthorized');if(_0xc1be70[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x29')&&_0xc1be70['user'][_0x5029('0x26')]!==_0x5029('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xc1be70[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x27')&&_0xc1be70[_0x5029('0x29')][_0x5029('0x26')]!=='admin'){throw new Error(_0x5029('0x7f'));}return licenseUtil[_0x5029('0x80')]([_0xc1be70[_0x5029('0x5d')]])[_0x5029('0x24')](function(){return validateUser(_0xc1be70[_0x5029('0x5d')]);})['then'](function(_0x455464){return updateUser(_0x455464)[_0x5029('0x24')](function(_0x344203){if(_0x344203['role']===_0x5029('0x27')){_0x344203[_0x5029('0x81')]=_0xc1be70[_0x5029('0x29')][_0x5029('0x81')];delete _0x344203[_0x5029('0x82')];}return _0x344203;});})[_0x5029('0x24')](function(_0x1e075c){return db['User'][_0x5029('0x7e')](_0x1e075c,{'include':[{'model':db[_0x5029('0x70')],'as':_0x5029('0x70')}]});})[_0x5029('0x24')](function(_0x2dcfee){if(_0xc1be70['body'][_0x5029('0x26')]===_0x5029('0x29'))return _0x2dcfee;if(_0xc1be70[_0x5029('0x29')]['role']!==_0x5029('0x29'))return _0x2dcfee;return db[_0x5029('0x83')]['find']({'where':{'name':_0x2dcfee['role']==='agent'?_0x5029('0x2a'):_0x5029('0x2c'),'userProfileId':_0xc1be70[_0x5029('0x29')][_0x5029('0x82')]},'raw':!![]})[_0x5029('0x24')](function(_0x4c742f){if(!_0x4c742f||_0x4c742f[_0x5029('0x84')]!=0x0)return _0x2dcfee;return db[_0x5029('0x32')][_0x5029('0x7e')]({'name':_0x2dcfee['name'],'resourceId':_0x2dcfee['id'],'type':_0x4c742f['name'],'sectionId':_0x4c742f['id']},{})[_0x5029('0x24')](function(){return _0x2dcfee;});})[_0x5029('0x51')](function(_0x1eb1ff){logger[_0x5029('0x14')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1eb1ff);throw _0x1eb1ff;});})[_0x5029('0x24')](respondWithResult(_0x4b61a6,0xc9))[_0x5029('0x51')](handleError(_0x4b61a6,null));};exports[_0x5029('0x85')]=function(_0x3295ba,_0x49f6b8){var _0xcc5fcf=_0x3295ba[_0x5029('0x5d')];var _0xe4b730=[];if(_0x3295ba['user'][_0x5029('0x26')]==='agent')throw new Error('Unauthorized');if(_[_0x5029('0x86')](_0xcc5fcf,['role',_0x5029('0x29')])&&_0x3295ba[_0x5029('0x29')][_0x5029('0x26')]!==_0x5029('0x27')){throw new Error(_0x5029('0x87'));}if(_[_0x5029('0x86')](_0xcc5fcf,[_0x5029('0x26'),_0x5029('0x27')])&&_0x3295ba['user']['role']!==_0x5029('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0xcc5fcf)[_0x5029('0x24')](function(){return validateUser(_0xcc5fcf[0x0]);})['then'](function(){for(var _0x4b25ed=0x1;_0x4b25ed<_0xcc5fcf[_0x5029('0x48')];_0x4b25ed++){var _0xb8da0b=_0xcc5fcf[_0x4b25ed-0x1][_0x5029('0x68')];if(!_0xcc5fcf[_0x4b25ed][_0x5029('0x68')])_0xcc5fcf[_0x4b25ed][_0x5029('0x68')]=_0xb8da0b+0x1;_0xe4b730['push'](validateUser(_0xcc5fcf[_0x4b25ed]));}return BPromise[_0x5029('0x50')](_0xe4b730);})[_0x5029('0x24')](function(){_0xe4b730=[];for(var _0x7c87a2=0x0;_0x7c87a2<_0xcc5fcf['length'];_0x7c87a2++){_0xe4b730[_0x5029('0x42')](updateUser(_0xcc5fcf[_0x7c87a2]));}return BPromise[_0x5029('0x50')](_0xe4b730);})[_0x5029('0x24')](function(){return BPromise[_0x5029('0x88')](_0xcc5fcf,function(_0x3867a1){return db['User']['create'](_0x3867a1,{'include':[{'model':db[_0x5029('0x70')],'as':_0x5029('0x70')}]})['then'](function(_0x43fa13){_0x3867a1['id']=_0x43fa13['id'];return _0x3867a1;});});})[_0x5029('0x24')](function(_0x3d0d7a){if(_0x3295ba[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x29'))return _0x3d0d7a;if(_0x3295ba[_0x5029('0x29')][_0x5029('0x26')]!=='user')return _0x3d0d7a;var _0x523bee=_[_0x5029('0x86')](_0x3d0d7a,function(_0x57b4e7){return _0x57b4e7[_0x5029('0x26')]==='agent'||_0x57b4e7[_0x5029('0x26')]===_0x5029('0x89');});if(!_0x523bee)return _0x3d0d7a;return db[_0x5029('0x83')]['findAll']({'where':{'name':{'$or':[_0x5029('0x2a'),_0x5029('0x2c')]},'userProfileId':_0x3295ba[_0x5029('0x29')]['userProfileId']},'raw':!![]})[_0x5029('0x24')](function(_0x362a08){if(_[_0x5029('0x8a')](_0x362a08)||!_[_0x5029('0x86')](_0x362a08,[_0x5029('0x84'),0x0]))return _0x3d0d7a;_0xe4b730=[];var _0x2899e6=_(_0x362a08)[_0x5029('0x37')](function(_0x32779f){if(_0x32779f[_0x5029('0x84')]===0x1)return;return _0x32779f[_0x5029('0x31')]===_0x5029('0x2a')?_0x5029('0x2b'):_0x5029('0x89');})[_0x5029('0x8b')]()[_0x5029('0x2e')]();for(var _0x15435d=0x0;_0x15435d<_0x3d0d7a[_0x5029('0x48')];_0x15435d++){if(!_[_0x5029('0x2f')](_0x2899e6,_0x3d0d7a[_0x15435d]['role']))return;var _0x7007a0=_0x3d0d7a[_0x15435d][_0x5029('0x26')]===_0x5029('0x2b')?_0x5029('0x2a'):_0x5029('0x2c');_0xe4b730['push'](db[_0x5029('0x32')][_0x5029('0x7e')]({'name':_0x3d0d7a[_0x15435d][_0x5029('0x31')],'resourceId':_0x3d0d7a[_0x15435d]['id'],'type':_0x7007a0,'sectionId':_[_0x5029('0x30')](_0x362a08,[_0x5029('0x31'),_0x7007a0])['id']},{}));}return BPromise['all'](_0xe4b730);});})[_0x5029('0x24')](respondWithResult(_0x49f6b8,0xc9))[_0x5029('0x51')](handleError(_0x49f6b8,null));};exports[_0x5029('0x8c')]=function(_0x139971,_0x3c601c){if(_0x139971['body']['id']){delete _0x139971[_0x5029('0x5d')]['id'];}return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x139971[_0x5029('0x53')]['id']}})[_0x5029('0x24')](function(_0x12cfe5){if(!_0x12cfe5)return null;if(_0x12cfe5['id']===_0x139971[_0x5029('0x29')]['id']){if(!_0x139971[_0x5029('0x5d')]['oldPassword']||!_0x139971['body'][_0x5029('0x8d')]){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0x90'));}if(!_0x12cfe5[_0x5029('0x91')](_0x139971['body'][_0x5029('0x92')])){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x93'));}if(_0x139971[_0x5029('0x5d')][_0x5029('0x92')]===_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x94'));}}else if(_0x139971['user'][_0x5029('0x26')]===_0x5029('0x27')){if(!_0x139971['body'][_0x5029('0x8d')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x139971['user'][_0x5029('0x26')]==='user'){if(!_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x95'));}if(_0x12cfe5['role']!==_0x5029('0x2b')){throw new db[(_0x5029('0x8e'))]['ValidationError'](_0x5029('0x96'));}}else{throw new db[(_0x5029('0x8e'))]['ValidationError'](_0x5029('0x96'));}return _0x12cfe5;})[_0x5029('0x24')](handleEntityNotFound(_0x3c601c,null))[_0x5029('0x24')](function(_0x24c55f){return db[_0x5029('0x62')][_0x5029('0x97')]({'attributes':['id','securePassword',_0x5029('0x98'),'passwordHistoryLimit']})[_0x5029('0x24')](function(_0x271d63){if(_0x271d63[_0x5029('0x64')])authService[_0x5029('0x99')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]);if(!_0x271d63[_0x5029('0x98')]||!_0x24c55f[_0x5029('0x9a')])return _0x24c55f;authService[_0x5029('0x9b')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],_0x24c55f[_0x5029('0x9a')],_0x271d63[_0x5029('0x9c')]);return _0x24c55f;})[_0x5029('0x24')](saveUpdates({'password':_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],'passwordResetAt':_0x139971['user']['id']==_0x139971[_0x5029('0x53')]['id']?moment():null,'previousPasswords':authService[_0x5029('0x9d')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],_0x24c55f[_0x5029('0x9a')])},null));})[_0x5029('0x24')](respondWithResult(_0x3c601c,null))['catch'](handleError(_0x3c601c,null));};exports[_0x5029('0x9e')]=function(_0x41108f,_0x137559){var _0x36dabf=_0x41108f[_0x5029('0x5d')]['channel'];return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x41108f[_0x5029('0x53')]['id']},'attributes':['id',_0x5029('0x31'),_0x5029('0x26'),_0x5029('0x9f'),_0x5029('0xa0'),_0x5029('0xa1'),_0x5029('0xa2')]})[_0x5029('0x24')](handleEntityNotFound(_0x137559,null))['then'](function(_0xb26cc0){if(_0xb26cc0){if(!utils['isValidChannel'](_0x36dabf)){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0xa3'));}return _0xb26cc0[_0x5029('0xa4')+_['capitalize'](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xa6')](_0x41108f['body'][_0x5029('0x61')],{'penalty':_0x41108f[_0x5029('0x5d')]['penalty']||0x0})[_0x5029('0xa7')](function(_0x14d53c){for(var _0x5b290f=0x0;_0x5b290f<_0x41108f['body'][_0x5029('0x61')]['length'];_0x5b290f+=0x1){var _0x512082={'UserId':Number(_0x41108f[_0x5029('0x53')]['id'])};_0x512082[_['capitalize'](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xa8')]=Number(_0x41108f['body'][_0x5029('0x61')][_0x5b290f]);socket[_0x5029('0xa9')]('user'+_[_0x5029('0xaa')](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xab'),_0x512082);}return _0x14d53c;})['then'](function(){if(_0x36dabf===_0x5029('0xac')){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x41108f[_0x5029('0x5d')][_0x5029('0x61')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x5029('0x24')](function(_0x44e198){var _0x5aa480=_0xb26cc0[_0x5029('0x25')]({'plain':!![]});var _0x294ddc=[];if(_0x36dabf==='voice'&&_0x5aa480['role']===_0x5029('0x2b')&&_0x5aa480[_0x5029('0x9f')]){for(var _0x587f24=0x0;_0x587f24<_0x44e198['length'];_0x587f24+=0x1){_0x294ddc['push']({'membername':_0x5aa480[_0x5029('0x31')],'UserId':_0x5aa480['id'],'queue_name':_0x44e198[_0x587f24][_0x5029('0x31')],'VoiceQueueId':_0x44e198[_0x587f24]['id'],'interface':_[_0x5029('0x66')](_0x5aa480['interface'])?util[_0x5029('0xad')]('SIP/%s',_0x5aa480[_0x5029('0x31')]):_0x5aa480['interface'],'paused':_0x5aa480['voicePause']||![],'penalty':_0x41108f['body']['penalty']||0x0});}return BPromise[_0x5029('0x88')](_0x294ddc,function(_0x1f8811){return db[_0x5029('0xae')][_0x5029('0xaf')](_0x1f8811);});}return _0xb26cc0;});}})[_0x5029('0x24')](respondWithStatusCode(_0x137559,null))['catch'](handleError(_0x137559,null));};exports[_0x5029('0xb0')]=function(_0x7258ac,_0x31e03c){var _0x42b5eb;return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x7258ac['params']['id']},'attributes':['id',_0x5029('0x31'),_0x5029('0x26')]})[_0x5029('0x24')](handleEntityNotFound(_0x31e03c,null))['then'](function(_0x5a4988){if(_0x5a4988){_0x42b5eb=_0x5a4988;if(!_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]||!utils[_0x5029('0xb2')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')])){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0xa3'));}return _0x5a4988['remove'+_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]['toLowerCase']())+_0x5029('0xa6')](_0x7258ac['query'][_0x5029('0x61')]);}})[_0x5029('0x24')](function(_0x100ae3){if(_[_0x5029('0xb3')](_0x7258ac[_0x5029('0x45')][_0x5029('0x61')])){for(var _0xcf928a=0x0;_0xcf928a<_0x7258ac[_0x5029('0x45')]['ids']['length'];_0xcf928a+=0x1){var _0x1cf583={'UserId':Number(_0x7258ac[_0x5029('0x53')]['id'])};_0x1cf583[_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')][_0x5029('0xa5')]())+'QueueId']=Number(_0x7258ac[_0x5029('0x45')][_0x5029('0x61')][_0xcf928a]);socket[_0x5029('0xa9')](_0x5029('0x29')+_[_0x5029('0xaa')](_0x7258ac['query'][_0x5029('0xb1')][_0x5029('0xa5')]())+_0x5029('0xb4'),_0x1cf583);}}else{var _0x1cf583={'UserId':Number(_0x7258ac[_0x5029('0x53')]['id'])};_0x1cf583[_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')][_0x5029('0xa5')]())+_0x5029('0xa8')]=Number(_0x7258ac[_0x5029('0x45')][_0x5029('0x61')]);socket[_0x5029('0xa9')]('user'+_['capitalize'](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]['toLowerCase']())+_0x5029('0xb4'),_0x1cf583);}return _0x100ae3;})[_0x5029('0x24')](function(){if(_0x7258ac['query'][_0x5029('0xb1')]===_0x5029('0xac')){return db[_0x5029('0xae')]['destroy']({'where':{'UserId':_0x7258ac[_0x5029('0x53')]['id'],'VoiceQueueId':_0x7258ac[_0x5029('0x45')]['ids']},'individualHooks':!![]})[_0x5029('0x24')](function(){return _0x42b5eb;});}return _0x42b5eb;})['then'](respondWithStatusCode(_0x31e03c,null))['catch'](handleError(_0x31e03c,null));};exports[_0x5029('0xb5')]=function(_0x548735,_0x3c22c5){_0x548735[_0x5029('0x5d')][_0x5029('0xb6')]=_0x548735['file'][_0x5029('0xb7')];return db['User']['find']({'where':{'id':_0x548735[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c22c5,null))[_0x5029('0x24')](saveUpdates(_0x548735[_0x5029('0x5d')],null))[_0x5029('0x24')](respondWithResult(_0x3c22c5,null))['catch'](handleError(_0x3c22c5,null));};exports[_0x5029('0xb8')]=function(_0x1caa56,_0xfea081){var _0x1415df=path[_0x5029('0xb9')](config[_0x5029('0xba')],'server/files/images/logos/default_profile.png');return db['User'][_0x5029('0x30')]({'where':{'id':_0x1caa56[_0x5029('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x5029('0x24')](handleEntityNotFound(_0xfea081,null))['then'](function(_0x4d4ae3){if(_0x4d4ae3){if(_[_0x5029('0x66')](_0x4d4ae3[_0x5029('0xb6')])){return _0xfea081[_0x5029('0xbb')](_0x1415df);}else{if(!fs[_0x5029('0xbc')](path[_0x5029('0xb9')](config[_0x5029('0xba')],_0x5029('0xbd'),_0x4d4ae3[_0x5029('0xb6')]))){return _0xfea081[_0x5029('0xbb')](_0x1415df);}return _0xfea081[_0x5029('0xbb')](path[_0x5029('0xb9')](config[_0x5029('0xba')],_0x5029('0xbd'),_0x4d4ae3[_0x5029('0xb6')]));}}})[_0x5029('0x51')](handleError(_0xfea081,null));};exports[_0x5029('0xbe')]=function(_0x14c4fe,_0x77cbcf){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x14c4fe[_0x5029('0x53')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x77cbcf,null))[_0x5029('0x24')](function(_0x4390cf){var _0x32270e=[];values=_0x4390cf['dataValues'];_0x32270e[_0x5029('0x42')](get_open_tabs('chat',_0x4390cf['dataValues']));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4b'),_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs('whatsapp',_0x4390cf[_0x5029('0x4a')]));_0x32270e['push'](get_open_tabs('fax',_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x4390cf[_0x5029('0x4a')]));return BPromise[_0x5029('0x50')](_0x32270e);})['then'](function(_0x58564f){var _0x53a135=[];if(_0x58564f){for(var _0x4595b5=0x0;_0x4595b5<values['ChatOpenTabs']['length'];_0x4595b5++){var _0x12d6f1=values[_0x5029('0xbf')][_0x4595b5];_0x53a135[_0x5029('0x42')]({'channel':_0x5029('0xc0'),'id':_0x12d6f1['id'],'createdAt':_0x12d6f1[_0x5029('0xc1')]});}for(var _0x4595b5=0x0;_0x4595b5<values[_0x5029('0xc2')]['length'];_0x4595b5++){var _0x12d6f1=values[_0x5029('0xc2')][_0x4595b5];_0x53a135['push']({'channel':_0x5029('0xc3'),'id':_0x12d6f1['id'],'createdAt':_0x12d6f1[_0x5029('0xc1')]});}for(var _0x4595b5=0x0;_0x4595b5<values['OpenchannelOpenTabs'][_0x5029('0x48')];_0x4595b5++){var _0x12d6f1=values[_0x5029('0xc4')][_0x4595b5];_0x53a135['push']({'channel':'OPENCHANNEL','id':_0x12d6f1['id'],'createdAt':_0x12d6f1['createdAt']});}for(var _0x4595b5=0x0;_0x4595b5<values[_0x5029('0xc5')][_0x5029('0x48')];_0x4595b5++){var _0x12d6f1=values['MailOpenTabs'][_0x4595b5];_0x53a135['push']({'channel':'MAIL','id':_0x12d6f1['id'],'createdAt':_0x12d6f1[_0x5029('0xc1')]});}for(var _0x4595b5=0x0;_0x4595b5<values['SmsOpenTabs'][_0x5029('0x48')];_0x4595b5++){var _0x12d6f1=values['SmsOpenTabs'][_0x4595b5];_0x53a135[_0x5029('0x42')]({'channel':_0x5029('0xc6'),'id':_0x12d6f1['id'],'createdAt':_0x12d6f1[_0x5029('0xc1')]});}for(var _0x4595b5=0x0;_0x4595b5<values[_0x5029('0xc7')][_0x5029('0x48')];_0x4595b5++){var _0x12d6f1=values[_0x5029('0xc7')][_0x4595b5];_0x53a135[_0x5029('0x42')]({'channel':'WHATSAPP','id':_0x12d6f1['id'],'createdAt':_0x12d6f1[_0x5029('0xc1')]});}var _0x45aab6={'count':_0x53a135[_0x5029('0x48')],'rows':_0x53a135};return _0x45aab6;}else return null;})[_0x5029('0x24')](respondWithResult(_0x77cbcf,null))[_0x5029('0x51')](handleError(_0x77cbcf,null));};exports[_0x5029('0xc8')]=function(_0xe35b61,_0x32c365){var _0x4f8884={};var _0x2e5925={};var _0x5e2547;var _0x4fbec5;return db[_0x5029('0x35')]['findOne']({'where':{'id':_0xe35b61[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x32c365,null))[_0x5029('0x24')](function(_0x5aa9b1){if(_0x5aa9b1){_0x5e2547=_0x5aa9b1;_0x2e5925[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0xc9')]['rawAttributes']);_0x2e5925[_0x5029('0x45')]=_[_0x5029('0x56')](_0xe35b61[_0x5029('0x45')]);_0x2e5925[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x2e5925[_0x5029('0x54')],_0x2e5925[_0x5029('0x45')]);_0x4f8884['attributes']=_[_0x5029('0x5a')](_0x2e5925['model'],qs[_0x5029('0x5b')](_0xe35b61[_0x5029('0x45')][_0x5029('0x5b')]));_0x4f8884[_0x5029('0x41')]=_0x4f8884['attributes'][_0x5029('0x48')]?_0x4f8884[_0x5029('0x41')]:_0x2e5925['model'];_0x4f8884['order']=qs[_0x5029('0xca')](_0xe35b61[_0x5029('0x45')][_0x5029('0xca')]);_0x4f8884[_0x5029('0x3d')]=qs['filters'](_[_0x5029('0xcb')](_0xe35b61[_0x5029('0x45')],_0x2e5925['filters']));if(_0xe35b61[_0x5029('0x45')][_0x5029('0x3b')]){_0x4f8884['where']=_[_0x5029('0xcc')](_0x4f8884['where'],{'$or':_[_0x5029('0x37')](_0x4f8884[_0x5029('0x41')],function(_0x3bd9d1){var _0xa9b2ae={};_0xa9b2ae[_0x3bd9d1]={'$like':'%'+_0xe35b61['query'][_0x5029('0x3b')]+'%'};return _0xa9b2ae;})});}_0x4f8884=_['merge']({},_0x4f8884,_0xe35b61[_0x5029('0x5c')]);return _0x5e2547['getContacts'](_0x4f8884);}})['then'](function(_0x22a76e){if(_0x22a76e){_0x4fbec5=_0x22a76e[_0x5029('0x48')];if(_0xe35b61['query'][_0x5029('0xcd')](_0x5029('0x3f'))){_0x4f8884['include']=[{'model':db['CmList'],'as':_0x5029('0xce'),'required':![]},{'model':db[_0x5029('0xcf')],'as':_0x5029('0xd0'),'attributes':['id',_0x5029('0x31'),_0x5029('0xd1')],'where':_0xe35b61['query'][_0x5029('0xd2')]?{'id':_0xe35b61[_0x5029('0x45')]['tag']}:undefined,'required':_0xe35b61['query']['tag']?!![]:![]}];}if(!_0xe35b61[_0x5029('0x45')]['hasOwnProperty'](_0x5029('0xd3'))){_0x4f8884[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0xe35b61[_0x5029('0x45')][_0x5029('0x1d')]);_0x4f8884[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0xe35b61['query'][_0x5029('0x1f')]);}return _0x5e2547[_0x5029('0xc8')](_0x4f8884);}})[_0x5029('0x24')](function(_0x554c10){if(_0x554c10){return _0x554c10?{'count':_0x4fbec5,'rows':_0x554c10}:null;}})['then'](respondWithResult(_0x32c365,null))[_0x5029('0x51')](handleError(_0x32c365,null));};exports[_0x5029('0xd4')]=function(_0x5587ba,_0x4b8e30){var _0x51323c;var _0x380547;var _0x523b0d={};var _0x57d3af;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x5587ba['params']['id']},'attributes':['id','name',_0x5029('0x26')]})[_0x5029('0x24')](handleEntityNotFound(_0x4b8e30,null))[_0x5029('0x24')](function(_0x49dab7){if(!utils['isValidChannel'](_0x5587ba['query'][_0x5029('0xb1')])){throw new db['Sequelize'][(_0x5029('0x8f'))]('Unknown\x20channel');}_0x51323c=_0x49dab7;var _0x5a4676={};_0x5a4676[_0x5029('0x54')]=_[_0x5029('0x56')](db[_[_0x5029('0xaa')](_0x5587ba[_0x5029('0x45')][_0x5029('0xb1')])+'Queue'][_0x5029('0x36')]);_0x5a4676[_0x5029('0x45')]=_[_0x5029('0x56')](_0x5587ba[_0x5029('0x45')]);_0x5a4676[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x5a4676['model'],_0x5a4676[_0x5029('0x45')]);_0x523b0d[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x5a4676['model'],qs['fields'](_0x5587ba[_0x5029('0x45')][_0x5029('0x5b')]));_0x523b0d[_0x5029('0x41')]=_0x523b0d[_0x5029('0x41')][_0x5029('0x48')]?_0x523b0d[_0x5029('0x41')]:_0x5a4676[_0x5029('0x54')];_0x523b0d['order']=qs['sort'](_0x5587ba[_0x5029('0x45')][_0x5029('0xca')]);_0x523b0d[_0x5029('0x3d')]=qs[_0x5029('0x59')](_['pick'](_0x5587ba[_0x5029('0x45')],_0x5a4676[_0x5029('0x59')]));if(_0x5587ba[_0x5029('0x45')]['filter']){_0x523b0d[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x523b0d[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x523b0d[_0x5029('0x41')],function(_0x101c57){var _0x419117={};_0x419117[_0x101c57]={'$like':'%'+_0x5587ba[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x419117;})});}_0x523b0d=_[_0x5029('0xcc')]({},_0x523b0d,_0x5587ba[_0x5029('0x5c')]);switch(_0x51323c[_0x5029('0x26')]){case _0x5029('0x27'):return db[_[_0x5029('0xaa')](_0x5587ba[_0x5029('0x45')][_0x5029('0xb1')])+_0x5029('0xd5')]['findAll'](_0x523b0d);case _0x5029('0x29'):case _0x5029('0x2b'):return _0x51323c[_0x5029('0x25')+_[_0x5029('0xaa')](_0x5587ba[_0x5029('0x45')][_0x5029('0xb1')])+_0x5029('0xa6')](_0x523b0d);default:throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0xd6'));}})[_0x5029('0x24')](function(_0x2d4951){_0x57d3af=_0x2d4951[_0x5029('0x48')];if(!_0x5587ba[_0x5029('0x45')]['hasOwnProperty'](_0x5029('0xd3'))){_0x523b0d['limit']=qs[_0x5029('0x1d')](_0x5587ba[_0x5029('0x45')][_0x5029('0x1d')]);_0x523b0d[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x5587ba['query'][_0x5029('0x1f')]);}switch(_0x51323c[_0x5029('0x26')]){case'admin':return db[_[_0x5029('0xaa')](_0x5587ba['query'][_0x5029('0xb1')])+_0x5029('0xd5')][_0x5029('0x43')](_0x523b0d);case _0x5029('0x29'):case _0x5029('0x2b'):return _0x51323c[_0x5029('0x25')+_[_0x5029('0xaa')](_0x5587ba['query']['channel'])+_0x5029('0xa6')](_0x523b0d);}})[_0x5029('0x24')](function(_0xd0c6c8){return{'count':_0x57d3af,'rows':_0xd0c6c8};})['then'](respondWithResult(_0x4b8e30,null))[_0x5029('0x51')](handleError(_0x4b8e30,null));};exports[_0x5029('0xd7')]=function(_0x289804,_0xe2da6b){var _0x468e19={};var _0x2ec859={};var _0x3686cb;var _0x20d898;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x289804['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0xe2da6b,null))[_0x5029('0x24')](function(_0x893286){if(_0x893286){_0x3686cb=_0x893286;_0x2ec859[_0x5029('0x54')]=_['keys'](db[_0x5029('0xae')][_0x5029('0x36')]);_0x2ec859[_0x5029('0x45')]=_[_0x5029('0x56')](_0x289804[_0x5029('0x45')]);_0x2ec859[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x2ec859[_0x5029('0x54')],_0x2ec859['query']);_0x468e19[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x2ec859[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x289804[_0x5029('0x45')]['fields']));_0x468e19[_0x5029('0x41')]=_0x468e19[_0x5029('0x41')][_0x5029('0x48')]?_0x468e19['attributes']:_0x2ec859[_0x5029('0x54')];_0x468e19[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x289804['query'][_0x5029('0xca')]);_0x468e19[_0x5029('0x3d')]=qs[_0x5029('0x59')](_['pick'](_0x289804[_0x5029('0x45')],_0x2ec859[_0x5029('0x59')]));if(_0x289804[_0x5029('0x45')][_0x5029('0x3b')]){_0x468e19['where']=_[_0x5029('0xcc')](_0x468e19[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x468e19[_0x5029('0x41')],function(_0x4dbd18){var _0x32c962={};_0x32c962[_0x4dbd18]={'$like':'%'+_0x289804['query'][_0x5029('0x3b')]+'%'};return _0x32c962;})});}_0x468e19=_['merge']({},_0x468e19,_0x289804[_0x5029('0x5c')]);return _0x3686cb[_0x5029('0xd7')](_0x468e19);}})['then'](function(_0x11f7bb){if(_0x11f7bb){_0x20d898=_0x11f7bb[_0x5029('0x48')];if(!_0x289804[_0x5029('0x45')]['hasOwnProperty'](_0x5029('0xd3'))){_0x468e19[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x289804[_0x5029('0x45')]['limit']);_0x468e19[_0x5029('0x1f')]=qs['offset'](_0x289804[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x3686cb[_0x5029('0xd7')](_0x468e19);}})[_0x5029('0x24')](function(_0xf0172){if(_0xf0172){return _0xf0172?{'count':_0x20d898,'rows':_0xf0172}:null;}})[_0x5029('0x24')](respondWithResult(_0xe2da6b,null))['catch'](handleError(_0xe2da6b,null));};exports[_0x5029('0xd9')]=function(_0x4db994,_0x5950c0){var _0x109f97={};var _0x28df16={};var _0x591d04;var _0x3ff77f;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x4db994['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x5950c0,null))['then'](function(_0x220eab){if(_0x220eab){_0x591d04=_0x220eab;_0x28df16[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0xda')][_0x5029('0x36')]);_0x28df16['query']=_[_0x5029('0x56')](_0x4db994['query']);_0x28df16[_0x5029('0x59')]=_['intersection'](_0x28df16['model'],_0x28df16[_0x5029('0x45')]);_0x109f97[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x28df16[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x4db994[_0x5029('0x45')][_0x5029('0x5b')]));_0x109f97[_0x5029('0x41')]=_0x109f97[_0x5029('0x41')][_0x5029('0x48')]?_0x109f97[_0x5029('0x41')]:_0x28df16[_0x5029('0x54')];_0x109f97[_0x5029('0xd8')]=qs['sort'](_0x4db994[_0x5029('0x45')][_0x5029('0xca')]);_0x109f97[_0x5029('0x3d')]=qs['filters'](_[_0x5029('0xcb')](_0x4db994['query'],_0x28df16[_0x5029('0x59')]));if(_0x4db994[_0x5029('0x45')]['filter']){_0x109f97['where']=_[_0x5029('0xcc')](_0x109f97[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x109f97[_0x5029('0x41')],function(_0x39d89d){var _0x823925={};_0x823925[_0x39d89d]={'$like':'%'+_0x4db994['query']['filter']+'%'};return _0x823925;})});}_0x109f97=_[_0x5029('0xcc')]({},_0x109f97,_0x4db994[_0x5029('0x5c')]);return _0x591d04[_0x5029('0xd9')](_0x109f97);}})[_0x5029('0x24')](function(_0x5e55aa){if(_0x5e55aa){_0x3ff77f=_0x5e55aa[_0x5029('0x48')];if(!_0x4db994[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0x109f97[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x4db994[_0x5029('0x45')][_0x5029('0x1d')]);_0x109f97[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x4db994[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x591d04['getGroups'](_0x109f97);}})['then'](function(_0x407575){if(_0x407575){return _0x407575?{'count':_0x3ff77f,'rows':_0x407575}:null;}})['then'](respondWithResult(_0x5950c0,null))[_0x5029('0x51')](handleError(_0x5950c0,null));};exports['getRecordings']=function(_0x18e6ed,_0x22e25e){var _0x39aada={'raw':!![],'where':{}};var _0x7fc06d={};var _0x215709={'count':0x0,'rows':[]};return db[_0x5029('0x35')]['findOne']({'where':{'id':_0x18e6ed[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x22e25e,null))[_0x5029('0x24')](function(_0x47d239){if(_0x47d239){_0x7fc06d['model']=_[_0x5029('0x56')](db[_0x5029('0xdb')][_0x5029('0x36')]);_0x7fc06d['query']=_['keys'](_0x18e6ed['query']);_0x7fc06d[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x7fc06d[_0x5029('0x54')],_0x7fc06d[_0x5029('0x45')]);_0x39aada[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x7fc06d['model'],qs[_0x5029('0x5b')](_0x18e6ed[_0x5029('0x45')]['fields']));_0x39aada[_0x5029('0x41')]=_0x39aada['attributes'][_0x5029('0x48')]?_0x39aada[_0x5029('0x41')]:_0x7fc06d['model'];if(!_0x18e6ed[_0x5029('0x45')]['hasOwnProperty'](_0x5029('0xd3'))){_0x39aada[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x18e6ed[_0x5029('0x45')][_0x5029('0x1d')]);_0x39aada[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x18e6ed[_0x5029('0x45')][_0x5029('0x1f')]);}_0x39aada[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x18e6ed[_0x5029('0x45')][_0x5029('0xca')]);_0x39aada[_0x5029('0x3d')]=qs[_0x5029('0x59')](_['pick'](_0x18e6ed[_0x5029('0x45')],_0x7fc06d[_0x5029('0x59')]));_0x39aada[_0x5029('0x3d')][_0x5029('0xdc')]=_0x47d239['id'];if(_0x18e6ed[_0x5029('0x45')][_0x5029('0x3b')]){_0x39aada['where']=_[_0x5029('0xcc')](_0x39aada[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x39aada['attributes'],function(_0x350286){var _0x4afb16={};_0x4afb16[_0x350286]={'$like':'%'+_0x18e6ed[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x4afb16;})});}_0x39aada=_['merge']({},_0x39aada,_0x18e6ed[_0x5029('0x5c')]);return db[_0x5029('0xdb')]['count']({'where':_0x39aada[_0x5029('0x3d')]})['then'](function(_0x4de9a6){_0x215709[_0x5029('0x3e')]=_0x4de9a6;if(_0x18e6ed['query'][_0x5029('0x3f')]){_0x39aada[_0x5029('0x40')]=[{'all':!![]}];}return db['VoiceRecording'][_0x5029('0x43')](_0x39aada);})[_0x5029('0x24')](function(_0x20514a){_0x215709[_0x5029('0x44')]=_0x20514a;return _0x215709;});}})[_0x5029('0x24')](respondWithFilteredResult(_0x22e25e,_0x39aada))['catch'](handleError(_0x22e25e,null));};exports[_0x5029('0xdd')]=function(_0x262544,_0x5dc3ab){var _0x5b81c8={'raw':!![],'where':{}};var _0x55534e={};var _0x3c23b3={'count':0x0,'rows':[]};return db['User'][_0x5029('0x97')]({'where':{'id':_0x262544[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x5dc3ab,null))[_0x5029('0x24')](function(_0x40cf13){if(_0x40cf13){_0x55534e[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0xde')][_0x5029('0x36')]);_0x55534e[_0x5029('0x45')]=_['keys'](_0x262544[_0x5029('0x45')]);_0x55534e[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x55534e[_0x5029('0x54')],_0x55534e['query']);_0x5b81c8[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x55534e[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x262544['query']['fields']));_0x5b81c8['attributes']=_0x5b81c8[_0x5029('0x41')][_0x5029('0x48')]?_0x5b81c8['attributes']:_0x55534e[_0x5029('0x54')];if(!_0x262544[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0x5b81c8[_0x5029('0x1d')]=qs['limit'](_0x262544[_0x5029('0x45')][_0x5029('0x1d')]);_0x5b81c8[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x262544[_0x5029('0x45')][_0x5029('0x1f')]);}_0x5b81c8[_0x5029('0xd8')]=qs['sort'](_0x262544['query'][_0x5029('0xca')]);_0x5b81c8['where']=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x262544[_0x5029('0x45')],_0x55534e[_0x5029('0x59')]));_0x5b81c8[_0x5029('0x3d')][_0x5029('0xdc')]=_0x40cf13['id'];if(_0x262544[_0x5029('0x45')][_0x5029('0x3b')]){_0x5b81c8[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x5b81c8[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x5b81c8[_0x5029('0x41')],function(_0x5348b7){var _0x5cb86d={};_0x5cb86d[_0x5348b7]={'$like':'%'+_0x262544[_0x5029('0x45')]['filter']+'%'};return _0x5cb86d;})});}_0x5b81c8=_[_0x5029('0xcc')]({},_0x5b81c8,_0x262544[_0x5029('0x5c')]);return db[_0x5029('0xde')][_0x5029('0x3e')]({'where':_0x5b81c8[_0x5029('0x3d')]})[_0x5029('0x24')](function(_0x2badbc){_0x3c23b3['count']=_0x2badbc;if(_0x262544[_0x5029('0x45')][_0x5029('0x3f')]){_0x5b81c8[_0x5029('0x40')]=[{'all':!![]}];}return db[_0x5029('0xde')][_0x5029('0x43')](_0x5b81c8);})[_0x5029('0x24')](function(_0x42977e){_0x3c23b3[_0x5029('0x44')]=_0x42977e;return _0x3c23b3;});}})[_0x5029('0x24')](respondWithFilteredResult(_0x5dc3ab,_0x5b81c8))[_0x5029('0x51')](handleError(_0x5dc3ab,null));};exports['getChatInteractions']=function(_0x11ddb9,_0x5b57ac){var _0x10e10a={};var _0x1cc467={};var _0x5478ff;var _0x375bdb;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x11ddb9[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x5b57ac,null))['then'](function(_0x4234ec){if(_0x4234ec){_0x5478ff=_0x4234ec;_0x1cc467[_0x5029('0x54')]=_[_0x5029('0x56')](db['ChatInteraction'][_0x5029('0x36')]);_0x1cc467['query']=_[_0x5029('0x56')](_0x11ddb9[_0x5029('0x45')]);_0x1cc467['filters']=_['intersection'](_0x1cc467[_0x5029('0x54')],_0x1cc467[_0x5029('0x45')]);_0x10e10a[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x1cc467[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x11ddb9['query'][_0x5029('0x5b')]));_0x10e10a['attributes']=_0x10e10a[_0x5029('0x41')][_0x5029('0x48')]?_0x10e10a[_0x5029('0x41')]:_0x1cc467[_0x5029('0x54')];_0x10e10a[_0x5029('0xd8')]=qs['sort'](_0x11ddb9[_0x5029('0x45')][_0x5029('0xca')]);_0x10e10a[_0x5029('0x3d')]=qs[_0x5029('0x59')](_['pick'](_0x11ddb9[_0x5029('0x45')],_0x1cc467[_0x5029('0x59')]));if(_0x11ddb9[_0x5029('0x45')][_0x5029('0x3b')]){_0x10e10a[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x10e10a[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x10e10a[_0x5029('0x41')],function(_0x4336ee){var _0x4e1226={};_0x4e1226[_0x4336ee]={'$like':'%'+_0x11ddb9[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x4e1226;})});}_0x10e10a=_[_0x5029('0xcc')]({},_0x10e10a,_0x11ddb9[_0x5029('0x5c')]);return _0x5478ff['getChatInteractions'](_0x10e10a);}})['then'](function(_0x4e9717){if(_0x4e9717){_0x375bdb=_0x4e9717['length'];if(!_0x11ddb9['query'][_0x5029('0xcd')]('nolimit')){_0x10e10a[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x11ddb9[_0x5029('0x45')][_0x5029('0x1d')]);_0x10e10a['offset']=qs[_0x5029('0x1f')](_0x11ddb9['query'][_0x5029('0x1f')]);}return _0x5478ff['getChatInteractions'](_0x10e10a);}})['then'](function(_0x385023){if(_0x385023){return _0x385023?{'count':_0x375bdb,'rows':_0x385023}:null;}})[_0x5029('0x24')](respondWithResult(_0x5b57ac,null))[_0x5029('0x51')](handleError(_0x5b57ac,null));};exports['getOpenchannelInteractions']=function(_0xb1dfff,_0x3ff67c){var _0x5580c5={};var _0x1e93ce={};var _0x5bd96c;var _0x5e0fc1;return db['User']['findOne']({'where':{'id':_0xb1dfff[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x3ff67c,null))['then'](function(_0x541f2b){if(_0x541f2b){_0x5bd96c=_0x541f2b;_0x1e93ce[_0x5029('0x54')]=_[_0x5029('0x56')](db['OpenchannelInteraction'][_0x5029('0x36')]);_0x1e93ce[_0x5029('0x45')]=_[_0x5029('0x56')](_0xb1dfff['query']);_0x1e93ce[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x1e93ce['model'],_0x1e93ce[_0x5029('0x45')]);_0x5580c5[_0x5029('0x41')]=_['intersection'](_0x1e93ce[_0x5029('0x54')],qs[_0x5029('0x5b')](_0xb1dfff['query'][_0x5029('0x5b')]));_0x5580c5['attributes']=_0x5580c5[_0x5029('0x41')][_0x5029('0x48')]?_0x5580c5['attributes']:_0x1e93ce[_0x5029('0x54')];_0x5580c5[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0xb1dfff[_0x5029('0x45')][_0x5029('0xca')]);_0x5580c5[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0xb1dfff[_0x5029('0x45')],_0x1e93ce[_0x5029('0x59')]));if(_0xb1dfff[_0x5029('0x45')]['filter']){_0x5580c5['where']=_[_0x5029('0xcc')](_0x5580c5[_0x5029('0x3d')],{'$or':_['map'](_0x5580c5[_0x5029('0x41')],function(_0x32283b){var _0x3fdd39={};_0x3fdd39[_0x32283b]={'$like':'%'+_0xb1dfff[_0x5029('0x45')]['filter']+'%'};return _0x3fdd39;})});}_0x5580c5=_[_0x5029('0xcc')]({},_0x5580c5,_0xb1dfff['options']);return _0x5bd96c[_0x5029('0xdf')](_0x5580c5);}})[_0x5029('0x24')](function(_0x3109d4){if(_0x3109d4){_0x5e0fc1=_0x3109d4['length'];if(!_0xb1dfff['query'][_0x5029('0xcd')](_0x5029('0xd3'))){_0x5580c5[_0x5029('0x1d')]=qs['limit'](_0xb1dfff['query']['limit']);_0x5580c5[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0xb1dfff['query'][_0x5029('0x1f')]);}return _0x5bd96c[_0x5029('0xdf')](_0x5580c5);}})[_0x5029('0x24')](function(_0x10b070){if(_0x10b070){return _0x10b070?{'count':_0x5e0fc1,'rows':_0x10b070}:null;}})[_0x5029('0x24')](respondWithResult(_0x3ff67c,null))[_0x5029('0x51')](handleError(_0x3ff67c,null));};exports[_0x5029('0xe0')]=function(_0x365843,_0x15a160){var _0x106986={'raw':!![],'where':{}};var _0x555c7a={};var _0x1e889f={'count':0x0,'rows':[]};return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x365843['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x15a160,null))[_0x5029('0x24')](function(_0x4ca35f){if(_0x4ca35f){_0x555c7a[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0xe1')][_0x5029('0x36')]);_0x555c7a['query']=_[_0x5029('0x56')](_0x365843[_0x5029('0x45')]);_0x555c7a['filters']=_[_0x5029('0x5a')](_0x555c7a[_0x5029('0x54')],_0x555c7a[_0x5029('0x45')]);_0x106986['attributes']=_['intersection'](_0x555c7a[_0x5029('0x54')],qs['fields'](_0x365843['query'][_0x5029('0x5b')]));_0x106986['attributes']=_0x106986['attributes'][_0x5029('0x48')]?_0x106986['attributes']:_0x555c7a[_0x5029('0x54')];if(!_0x365843['query'][_0x5029('0xcd')](_0x5029('0xd3'))){_0x106986[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x365843[_0x5029('0x45')][_0x5029('0x1d')]);_0x106986[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x365843[_0x5029('0x45')]['offset']);}_0x106986[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x365843[_0x5029('0x45')][_0x5029('0xca')]);_0x106986['where']=qs[_0x5029('0x59')](_['pick'](_0x365843[_0x5029('0x45')],_0x555c7a[_0x5029('0x59')]));_0x106986['where'][_0x5029('0xdc')]=_0x4ca35f['id'];if(_0x365843[_0x5029('0x45')][_0x5029('0x3b')]){_0x106986['where']=_[_0x5029('0xcc')](_0x106986['where'],{'$or':_[_0x5029('0x37')](_0x106986['attributes'],function(_0x2eb177){var _0x6abbbe={};_0x6abbbe[_0x2eb177]={'$like':'%'+_0x365843[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x6abbbe;})});}_0x106986=_[_0x5029('0xcc')]({},_0x106986,_0x365843[_0x5029('0x5c')]);return db[_0x5029('0xe1')]['count']({'where':_0x106986['where']})[_0x5029('0x24')](function(_0x59c6ff){_0x1e889f[_0x5029('0x3e')]=_0x59c6ff;if(_0x365843[_0x5029('0x45')][_0x5029('0x3f')]){_0x106986[_0x5029('0x40')]=[{'all':!![]}];}return db['MailInteraction'][_0x5029('0x43')](_0x106986);})[_0x5029('0x24')](function(_0x339f1f){_0x1e889f['rows']=_0x339f1f;return _0x1e889f;});}})[_0x5029('0x24')](respondWithFilteredResult(_0x15a160,_0x106986))[_0x5029('0x51')](handleError(_0x15a160,null));};exports[_0x5029('0xe2')]=function(_0x31711b,_0xe113a2){var _0x1b7c98={};var _0x320cd2={};var _0x2b9a2f;var _0x479800;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x31711b[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0xe113a2,null))[_0x5029('0x24')](function(_0x558729){if(_0x558729){_0x2b9a2f=_0x558729;_0x320cd2[_0x5029('0x54')]=_['keys'](db['SmsInteraction'][_0x5029('0x36')]);_0x320cd2['query']=_[_0x5029('0x56')](_0x31711b['query']);_0x320cd2[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x320cd2['model'],_0x320cd2[_0x5029('0x45')]);_0x1b7c98['attributes']=_['intersection'](_0x320cd2[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x31711b[_0x5029('0x45')][_0x5029('0x5b')]));_0x1b7c98['attributes']=_0x1b7c98['attributes'][_0x5029('0x48')]?_0x1b7c98['attributes']:_0x320cd2['model'];_0x1b7c98[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x31711b[_0x5029('0x45')][_0x5029('0xca')]);_0x1b7c98[_0x5029('0x3d')]=qs[_0x5029('0x59')](_['pick'](_0x31711b[_0x5029('0x45')],_0x320cd2[_0x5029('0x59')]));if(_0x31711b['query'][_0x5029('0x3b')]){_0x1b7c98['where']=_[_0x5029('0xcc')](_0x1b7c98[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x1b7c98[_0x5029('0x41')],function(_0x18ac30){var _0x353062={};_0x353062[_0x18ac30]={'$like':'%'+_0x31711b[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x353062;})});}_0x1b7c98=_[_0x5029('0xcc')]({},_0x1b7c98,_0x31711b[_0x5029('0x5c')]);return _0x2b9a2f['getSmsInteractions'](_0x1b7c98);}})['then'](function(_0x18ec73){if(_0x18ec73){_0x479800=_0x18ec73[_0x5029('0x48')];if(!_0x31711b[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0x1b7c98[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x31711b[_0x5029('0x45')][_0x5029('0x1d')]);_0x1b7c98[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x31711b[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x2b9a2f[_0x5029('0xe2')](_0x1b7c98);}})[_0x5029('0x24')](function(_0x43d6a2){if(_0x43d6a2){return _0x43d6a2?{'count':_0x479800,'rows':_0x43d6a2}:null;}})[_0x5029('0x24')](respondWithResult(_0xe113a2,null))['catch'](handleError(_0xe113a2,null));};exports[_0x5029('0xe3')]=function(_0x489890,_0x5031e0){var _0x598333={};var _0x5744f0={};var _0x2baecc;var _0x4c7d96;return db['User']['findOne']({'where':{'id':_0x489890[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x5031e0,null))[_0x5029('0x24')](function(_0x241d8c){if(_0x241d8c){_0x2baecc=_0x241d8c;_0x5744f0[_0x5029('0x54')]=_['keys'](db['FaxInteraction'][_0x5029('0x36')]);_0x5744f0['query']=_['keys'](_0x489890['query']);_0x5744f0[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x5744f0[_0x5029('0x54')],_0x5744f0[_0x5029('0x45')]);_0x598333['attributes']=_[_0x5029('0x5a')](_0x5744f0[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x489890[_0x5029('0x45')][_0x5029('0x5b')]));_0x598333[_0x5029('0x41')]=_0x598333[_0x5029('0x41')][_0x5029('0x48')]?_0x598333[_0x5029('0x41')]:_0x5744f0[_0x5029('0x54')];_0x598333['order']=qs[_0x5029('0xca')](_0x489890[_0x5029('0x45')][_0x5029('0xca')]);_0x598333[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x489890[_0x5029('0x45')],_0x5744f0['filters']));if(_0x489890[_0x5029('0x45')][_0x5029('0x3b')]){_0x598333[_0x5029('0x3d')]=_['merge'](_0x598333[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x598333[_0x5029('0x41')],function(_0x385bae){var _0x326ddd={};_0x326ddd[_0x385bae]={'$like':'%'+_0x489890['query'][_0x5029('0x3b')]+'%'};return _0x326ddd;})});}_0x598333=_[_0x5029('0xcc')]({},_0x598333,_0x489890['options']);return _0x2baecc['getFaxInteractions'](_0x598333);}})[_0x5029('0x24')](function(_0x4c78df){if(_0x4c78df){_0x4c7d96=_0x4c78df[_0x5029('0x48')];if(!_0x489890[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0x598333[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x489890[_0x5029('0x45')][_0x5029('0x1d')]);_0x598333['offset']=qs[_0x5029('0x1f')](_0x489890[_0x5029('0x45')]['offset']);}return _0x2baecc[_0x5029('0xe3')](_0x598333);}})[_0x5029('0x24')](function(_0x5ec3c0){if(_0x5ec3c0){return _0x5ec3c0?{'count':_0x4c7d96,'rows':_0x5ec3c0}:null;}})[_0x5029('0x24')](respondWithResult(_0x5031e0,null))[_0x5029('0x51')](handleError(_0x5031e0,null));};exports['getWhatsappInteractions']=function(_0x374f81,_0x39ec7d){var _0x3bb77b={};var _0x56981e={};var _0x6b1d2c;var _0x16ce38;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x374f81[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x39ec7d,null))[_0x5029('0x24')](function(_0x31414d){if(_0x31414d){_0x6b1d2c=_0x31414d;_0x56981e[_0x5029('0x54')]=_[_0x5029('0x56')](db['WhatsappInteraction'][_0x5029('0x36')]);_0x56981e[_0x5029('0x45')]=_[_0x5029('0x56')](_0x374f81['query']);_0x56981e['filters']=_[_0x5029('0x5a')](_0x56981e[_0x5029('0x54')],_0x56981e[_0x5029('0x45')]);_0x3bb77b[_0x5029('0x41')]=_['intersection'](_0x56981e[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x374f81[_0x5029('0x45')][_0x5029('0x5b')]));_0x3bb77b[_0x5029('0x41')]=_0x3bb77b['attributes']['length']?_0x3bb77b[_0x5029('0x41')]:_0x56981e[_0x5029('0x54')];_0x3bb77b[_0x5029('0xd8')]=qs['sort'](_0x374f81[_0x5029('0x45')][_0x5029('0xca')]);_0x3bb77b['where']=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x374f81[_0x5029('0x45')],_0x56981e['filters']));if(_0x374f81[_0x5029('0x45')]['filter']){_0x3bb77b[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x3bb77b[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x3bb77b[_0x5029('0x41')],function(_0x2abf25){var _0x1300e3={};_0x1300e3[_0x2abf25]={'$like':'%'+_0x374f81['query'][_0x5029('0x3b')]+'%'};return _0x1300e3;})});}_0x3bb77b=_[_0x5029('0xcc')]({},_0x3bb77b,_0x374f81['options']);return _0x6b1d2c[_0x5029('0xe4')](_0x3bb77b);}})[_0x5029('0x24')](function(_0x10e5ef){if(_0x10e5ef){_0x16ce38=_0x10e5ef[_0x5029('0x48')];if(!_0x374f81['query'][_0x5029('0xcd')](_0x5029('0xd3'))){_0x3bb77b[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x374f81[_0x5029('0x45')][_0x5029('0x1d')]);_0x3bb77b[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x374f81[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x6b1d2c[_0x5029('0xe4')](_0x3bb77b);}})[_0x5029('0x24')](function(_0x20f174){if(_0x20f174){return _0x20f174?{'count':_0x16ce38,'rows':_0x20f174}:null;}})[_0x5029('0x24')](respondWithResult(_0x39ec7d,null))['catch'](handleError(_0x39ec7d,null));};exports[_0x5029('0xe5')]=function(_0x2d310f,_0x1db8ad,_0x56e65c){var _0x1ce839;var _0x5a6611;var _0x1e2906;var _0x3e3c77=!_[_0x5029('0x66')](_0x2d310f[_0x5029('0x53')]['id'])?_0x2d310f[_0x5029('0x53')]['id']:!_[_0x5029('0x66')](_0x2d310f['user']['id'])?_0x2d310f[_0x5029('0x29')]['id']:null;return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x3e3c77,'role':{'$or':[_0x5029('0x27'),_0x5029('0x29'),_0x5029('0x2b')]}},'attributes':['id','name','phone','mobile',_0x5029('0x26'),_0x5029('0x68'),'loginInPause']})[_0x5029('0x24')](function(_0x312bac){if(_0x312bac){if(_0x312bac['role']===_0x5029('0x2b')){_0x1ce839=_0x312bac;if(_0x2d310f[_0x5029('0x5d')][_0x5029('0xa2')]){_0x1e2906=util[_0x5029('0xad')](_0x5029('0xe6'),_0x1ce839[_0x2d310f[_0x5029('0x5d')][_0x5029('0xa2')]]);}else if(_0x2d310f[_0x5029('0x5d')][_0x5029('0xe7')]){_0x1e2906=util[_0x5029('0xad')]('SIP/%s',_0x2d310f[_0x5029('0x5d')][_0x5029('0xe7')]);}else{_0x1e2906=util[_0x5029('0xad')](_0x5029('0xe8'),_0x1ce839[_0x5029('0x31')]);}socket['to'](util['format']('user:%s',_0x1ce839['name']))['emit'](_0x5029('0xe9'),{'user':{'id':_0x1ce839['id'],'name':_0x1ce839[_0x5029('0x31')]},'ip':_0x2d310f['headers']['x-forwarded-for']||_0x2d310f[_0x5029('0xea')]['remoteAddress']||_0x2d310f[_0x5029('0xeb')][_0x5029('0xec')]||_0x2d310f[_0x5029('0xea')][_0x5029('0xeb')][_0x5029('0xec')]});return db[_0x5029('0xae')][_0x5029('0x23')]({'where':{'membername':_0x1ce839[_0x5029('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0x5029('0x8e'))]['ValidationError'](_0x5029('0xed'));}})[_0x5029('0x24')](function(){if(_0x1ce839){return _0x1ce839[_0x5029('0xee')]({'raw':!![]});}})[_0x5029('0x24')](function(_0x458941){if(_0x1ce839){var _0xaf0cb7=[];if(_0x458941){_0x5a6611=_0x458941;if(_0x5a6611[_0x5029('0x48')]){for(var _0x4789c1=0x0;_0x4789c1<_0x5a6611[_0x5029('0x48')];_0x4789c1++){_0xaf0cb7[_0x5029('0x42')]({'membername':_0x1ce839[_0x5029('0x31')],'UserId':_0x1ce839['id'],'queue_name':_0x5a6611[_0x4789c1][_0x5029('0x31')],'VoiceQueueId':_0x5a6611[_0x4789c1]['id'],'interface':_0x1e2906,'paused':_0x1ce839[_0x5029('0xa0')]||![],'penalty':_0x5a6611[_0x4789c1][_0x5029('0xef')]||0x0});}return BPromise[_0x5029('0x88')](_0xaf0cb7,function(_0x28eca6){return db[_0x5029('0xae')][_0x5029('0xaf')](_0x28eca6);});}}}})[_0x5029('0x24')](function(){if(_0x1ce839){return db['MemberReport'][_0x5029('0x43')]({'where':{'membername':_0x1ce839[_0x5029('0x31')],'exitAt':null}});}})[_0x5029('0x24')](function(_0x483394){if(_0x1ce839){var _0x36ad66=[];_0x483394['forEach'](function(_0x347847){_0x36ad66[_0x5029('0x42')](_0x347847[_0x5029('0x22')]({'exitAt':moment()[_0x5029('0xad')](_0x5029('0xf0'))}));});return BPromise[_0x5029('0x50')](_0x36ad66);}})[_0x5029('0x24')](function(){if(_0x1ce839){var _0x2f0d6e=[];var _0x981afd=[];var _0xc1666=utils[_0x5029('0xf1')]();var _0x5712fc={'membername':_0x1ce839['name'],'interface':_0x1e2906,'enterAt':moment()[_0x5029('0xad')](_0x5029('0xf0')),'role':_0x1ce839['role'],'internal':_0x1ce839[_0x5029('0x68')]};_0xc1666[_0x5029('0xf2')](function(_0x597eb5){_0x2f0d6e[_0x5029('0x42')](_['merge']({'channel':_0x597eb5,'type':_0x5029('0xf3'),'data1':_0x2d310f[_0x5029('0x5d')][_0x5029('0xf4')],'data2':_0x1e2906},_0x5712fc));if(_0x1ce839['loginInPause']){_0x981afd[_0x5029('0x42')](_['merge']({'channel':_0x597eb5,'type':_0x5029('0xf5'),'data1':_0x5029('0xf6')},_0x5712fc));}});return db['MemberReport']['bulkCreate'](_0x2f0d6e[_0x5029('0xf7')](_0x981afd),{'individualHooks':!![]});}})[_0x5029('0x24')](function(){if(_0x1ce839){return _0x1ce839[_0x5029('0x22')]({'online':!![],'lastLoginAt':moment()['format'](_0x5029('0xf0')),'voicePause':_0x1ce839['loginInPause']||![],'mailPause':_0x1ce839['loginInPause']||![],'chatPause':_0x1ce839[_0x5029('0xa0')]||![],'faxPause':_0x1ce839['loginInPause']||![],'smsPause':_0x1ce839[_0x5029('0xa0')]||![],'openchannelPause':_0x1ce839[_0x5029('0xa0')]||![],'whatsappPause':_0x1ce839['loginInPause']||![],'pauseType':_0x1ce839[_0x5029('0xa0')]?_0x5029('0xf6'):null,'interface':_0x1e2906,'lastPauseAt':moment()[_0x5029('0xad')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x44d629){if(_0x2d310f['isMiddleware']){return _0x56e65c();}else{return BPromise[_0x5029('0xf8')](_0x44d629)[_0x5029('0x24')](respondWithResult(_0x1db8ad,null));}})[_0x5029('0x51')](handleError(_0x1db8ad,null));};exports[_0x5029('0xf9')]=function(_0x3d1c5a,_0xb8c738){var _0x146799;return db['User'][_0x5029('0x30')]({'where':{'id':_0x3d1c5a['params']['id'],'role':_0x5029('0x2b')},'attributes':['id',_0x5029('0x31'),_0x5029('0x26')]})[_0x5029('0x24')](handleEntityNotFound(_0xb8c738,null))['then'](function(_0x77e1e5){if(_0x77e1e5){_0x146799=_0x77e1e5;return db['UserVoiceQueueRt'][_0x5029('0x23')]({'where':{'membername':_0x146799[_0x5029('0x31')]},'individualHooks':!![]});}})['then'](function(){return db[_0x5029('0xfa')]['findAll']({'where':{'membername':_0x146799[_0x5029('0x31')],'exitAt':null}});})['then'](function(_0x5b815d){var _0xfabacf=[];_0x5b815d['forEach'](function(_0x2f757c){_0xfabacf['push'](_0x2f757c[_0x5029('0x22')]({'exitAt':moment()[_0x5029('0xad')](_0x5029('0xf0'))}));});return BPromise[_0x5029('0x50')](_0xfabacf);})[_0x5029('0x24')](function(){return _0x146799['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5029('0x24')](respondWithResult(_0xb8c738,null))[_0x5029('0x51')](handleError(_0xb8c738,null));};exports[_0x5029('0xfb')]=function(_0x22c384,_0x5290a2){var _0x23d220;return db[_0x5029('0xae')]['update']({'paused':0x1},{'where':{'UserId':_0x22c384[_0x5029('0x53')]['id']},'individualHooks':!![]})[_0x5029('0x24')](function(){return db[_0x5029('0x35')]['find']({'where':{'id':_0x22c384[_0x5029('0x53')]['id'],'role':'agent'},'attributes':['id',_0x5029('0x31'),'role','internal','interface']});})['then'](handleEntityNotFound(_0x5290a2,null))['then'](function(_0x435040){if(_0x435040){_0x23d220=_0x435040;return respondWithRpcPromise(_0x5029('0xfc'),_0x5029('0xfb'),{'id':_0x23d220['id'],'name':_0x23d220[_0x5029('0x31')],'pause':!![]});}})[_0x5029('0x24')](function(){if(_0x23d220){return db[_0x5029('0xfa')][_0x5029('0x43')]({'where':{'membername':_0x23d220[_0x5029('0x31')],'type':_0x5029('0xf5'),'exitAt':null}});}})['then'](function(_0x117eca){if(_0x117eca[_0x5029('0x48')]){var _0x2b5240=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4b2b96=0x0,_0x125378=_0x117eca[_0x5029('0x48')];_0x4b2b96<_0x125378;_0x4b2b96++){_0x117eca[_0x4b2b96]['updateAttributes']({'exitAt':_0x2b5240});}}})['then'](function(){var _0xc2a22c=[];var _0x297cdb=utils['getChannels']();_0x297cdb[_0x5029('0xf2')](function(_0x3912bb){_0xc2a22c[_0x5029('0x42')]({'channel':_0x3912bb,'membername':_0x23d220[_0x5029('0x31')],'interface':_['isNil'](_0x23d220[_0x5029('0xa2')])?util[_0x5029('0xad')](_0x5029('0xe8'),_0x23d220[_0x5029('0x31')]):_0x23d220['interface'],'type':_0x5029('0xf5'),'enterAt':moment()[_0x5029('0xad')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x22c384['body'][_0x5029('0x39')]||'DEFAULT\x20PAUSE','role':_0x23d220[_0x5029('0x26')],'internal':_0x23d220[_0x5029('0x68')]});});return db[_0x5029('0xfa')]['bulkCreate'](_0xc2a22c,{'individualHooks':!![]});})[_0x5029('0x24')](function(){return _0x23d220[_0x5029('0x22')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x22c384[_0x5029('0x5d')][_0x5029('0x39')]||_0x5029('0xfd'),'lastPauseAt':moment()['format'](_0x5029('0xf0'))});})[_0x5029('0x24')](respondWithResult(_0x5290a2,null))[_0x5029('0x51')](handleError(_0x5290a2,null));};exports['unpause']=function(_0x1a7d17,_0x5ad745){var _0x3c4f4b;return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x1a7d17[_0x5029('0x53')]['id']},'attributes':['id',_0x5029('0x31'),'role',_0x5029('0xa1'),'mailPause',_0x5029('0xfe'),'faxPause',_0x5029('0xff'),_0x5029('0x100'),_0x5029('0x101'),'pauseType',_0x5029('0x102')]})[_0x5029('0x24')](handleEntityNotFound(_0x5ad745,null))[_0x5029('0x24')](function(_0xecd93c){if(_0xecd93c){_0x3c4f4b=_0xecd93c;if(_0x1a7d17[_0x5029('0x5d')]['channel']&&!utils[_0x5029('0xb2')](_0x1a7d17['body'][_0x5029('0xb1')])){throw new db[(_0x5029('0x8e'))]['ValidationError'](_0x5029('0xa3'));}switch(_0x1a7d17[_0x5029('0x5d')]['channel']){case _0x5029('0xac'):return respondWithRpcPromise(_0x5029('0xfc'),_0x5029('0x103'),{'id':_0x3c4f4b['id'],'name':_0x3c4f4b[_0x5029('0x31')],'pause':![]})[_0x5029('0x24')](function(){return db['UserVoiceQueueRt'][_0x5029('0x22')]({'paused':0x0},{'where':{'UserId':_0x3c4f4b['id']},'individualHooks':!![]});})[_0x5029('0x24')](function(){return db[_0x5029('0xfa')]['find']({'where':{'channel':_0x1a7d17[_0x5029('0x5d')]['channel'],'membername':_0x3c4f4b[_0x5029('0x31')],'type':_0x5029('0xf5'),'exitAt':null}});})['then'](function(_0x124746){if(_0x124746){return _0x124746['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5029('0x104')},{'individualHooks':!![]});}return null;})[_0x5029('0x24')](function(){return _0x3c4f4b[_0x5029('0x22')]({'voicePause':![]});});case'mail':case _0x5029('0x49'):case _0x5029('0x4c'):case'sms':case _0x5029('0x4f'):case'openchannel':return db[_0x5029('0xfa')][_0x5029('0x30')]({'where':{'channel':_0x1a7d17[_0x5029('0x5d')][_0x5029('0xb1')],'membername':_0x3c4f4b[_0x5029('0x31')],'type':_0x5029('0xf5'),'exitAt':null}})[_0x5029('0x24')](function(_0x2add77){if(_0x2add77){return _0x2add77[_0x5029('0x22')]({'exitAt':moment()['format'](_0x5029('0xf0')),'data2':_0x5029('0x104')},{'individualHooks':!![]});}return null;})[_0x5029('0x24')](function(){var _0x23303c={};_['set'](_0x23303c,util[_0x5029('0xad')](_0x5029('0x105'),_0x1a7d17[_0x5029('0x5d')][_0x5029('0xb1')],_0x5029('0x106')),![]);return _0x3c4f4b[_0x5029('0x22')](_0x23303c);});default:return respondWithRpcPromise('QueuePause',_0x5029('0x103'),{'id':_0x3c4f4b['id'],'name':_0x3c4f4b[_0x5029('0x31')],'pause':![]})[_0x5029('0x24')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x3c4f4b['id']}});})[_0x5029('0x24')](function(){return db['MemberReport'][_0x5029('0x43')]({'where':{'membername':_0x3c4f4b[_0x5029('0x31')],'type':'PAUSE','exitAt':null}});})[_0x5029('0x24')](function(_0x26ceaf){var _0x2342ad=[];_0x26ceaf['forEach'](function(_0x2c85a1){_0x2342ad['push'](_0x2c85a1[_0x5029('0x22')]({'exitAt':moment()['format'](_0x5029('0xf0')),'data2':_0x5029('0x104')}));});return BPromise['all'](_0x2342ad);})[_0x5029('0x24')](function(){return _0x3c4f4b[_0x5029('0x22')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x5029('0x24')](respondWithResult(_0x5ad745,null))[_0x5029('0x51')](handleError(_0x5ad745,null));};exports[_0x5029('0x107')]=function(_0x58a245,_0x1e005c){var _0x52fa6d={};var _0x12220d={};var _0x53c776;var _0x111231;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x58a245[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x1e005c,null))[_0x5029('0x24')](function(_0x35df2a){if(_0x35df2a){_0x53c776=_0x35df2a;_0x12220d['model']=_[_0x5029('0x56')](db[_0x5029('0x108')][_0x5029('0x36')]);_0x12220d[_0x5029('0x45')]=_[_0x5029('0x56')](_0x58a245['query']);_0x12220d[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x12220d[_0x5029('0x54')],_0x12220d['query']);_0x52fa6d['attributes']=_[_0x5029('0x5a')](_0x12220d['model'],qs['fields'](_0x58a245[_0x5029('0x45')][_0x5029('0x5b')]));_0x52fa6d[_0x5029('0x41')]=_0x52fa6d[_0x5029('0x41')][_0x5029('0x48')]?_0x52fa6d[_0x5029('0x41')]:_0x12220d[_0x5029('0x54')];_0x52fa6d[_0x5029('0xd8')]=qs['sort'](_0x58a245[_0x5029('0x45')][_0x5029('0xca')]);_0x52fa6d[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x58a245['query'],_0x12220d[_0x5029('0x59')]));if(_0x58a245[_0x5029('0x45')][_0x5029('0x3b')]){_0x52fa6d[_0x5029('0x3d')]=_['merge'](_0x52fa6d[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x52fa6d[_0x5029('0x41')],function(_0x5e378f){var _0x5f470b={};_0x5f470b[_0x5e378f]={'$like':'%'+_0x58a245[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x5f470b;})});}_0x52fa6d=_['merge']({},_0x52fa6d,_0x58a245['options']);return _0x53c776['getTeams'](_0x52fa6d);}})['then'](function(_0x21f5e9){if(_0x21f5e9){_0x111231=_0x21f5e9[_0x5029('0x48')];if(!_0x58a245[_0x5029('0x45')][_0x5029('0xcd')]('nolimit')){_0x52fa6d['limit']=qs[_0x5029('0x1d')](_0x58a245['query'][_0x5029('0x1d')]);_0x52fa6d[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x58a245[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x53c776[_0x5029('0x107')](_0x52fa6d);}})[_0x5029('0x24')](function(_0xfd8dab){if(_0xfd8dab){return _0xfd8dab?{'count':_0x111231,'rows':_0xfd8dab}:null;}})[_0x5029('0x24')](respondWithResult(_0x1e005c,null))[_0x5029('0x51')](handleError(_0x1e005c,null));};exports[_0x5029('0x109')]=function(_0x1128d0,_0x3c8bee){return db[_0x5029('0x35')]['find']({'where':{'id':_0x1128d0['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x3c8bee,null))[_0x5029('0x24')](function(_0x42ce91){if(_0x42ce91){var _0x439bea=_0x42ce91[_0x5029('0x25')]({'plain':!![]});return _0x42ce91[_0x5029('0x109')](_0x1128d0[_0x5029('0x5d')][_0x5029('0x61')],_['omit'](_0x1128d0[_0x5029('0x5d')],[_0x5029('0x61'),'id'])||{})[_0x5029('0x24')](function(){for(var _0x36b19b=0x0;_0x36b19b<_0x1128d0[_0x5029('0x5d')][_0x5029('0x61')][_0x5029('0x48')];_0x36b19b++){var _0x18dce5=[];var _0x64cd43={};db[_0x5029('0x108')][_0x5029('0x97')]({'where':{'id':_0x1128d0['body'][_0x5029('0x61')][_0x36b19b]}})[_0x5029('0x24')](function(_0x1e9246){_0x64cd43=_0x1e9246['dataValues'];_0x18dce5[_0x5029('0x42')](_0x1e9246[_0x5029('0xee')]()[_0x5029('0x24')](function(_0x3cb9eb){for(var _0x93d27d=0x0;_0x93d27d<_0x3cb9eb[_0x5029('0x48')];_0x93d27d++){_0x3cb9eb[_0x93d27d][_0x5029('0x10a')](_0x5029('0xb1'),_0x5029('0x10b'));}return _0x3cb9eb;}));_0x18dce5[_0x5029('0x42')](_0x1e9246[_0x5029('0x10c')]()[_0x5029('0x24')](function(_0x4cacd5){for(var _0x529a0b=0x0;_0x529a0b<_0x4cacd5['length'];_0x529a0b++){_0x4cacd5[_0x529a0b][_0x5029('0x10a')](_0x5029('0xb1'),'Chat');}return _0x4cacd5;}));_0x18dce5[_0x5029('0x42')](_0x1e9246[_0x5029('0x10d')]()[_0x5029('0x24')](function(_0x2c3f57){for(var _0x537747=0x0;_0x537747<_0x2c3f57['length'];_0x537747++){_0x2c3f57[_0x537747][_0x5029('0x10a')](_0x5029('0xb1'),'Mail');}return _0x2c3f57;}));_0x18dce5['push'](_0x1e9246['getSmsQueues']()[_0x5029('0x24')](function(_0x296b73){for(var _0x12cb30=0x0;_0x12cb30<_0x296b73[_0x5029('0x48')];_0x12cb30++){_0x296b73[_0x12cb30]['setDataValue'](_0x5029('0xb1'),_0x5029('0x10e'));}return _0x296b73;}));_0x18dce5['push'](_0x1e9246[_0x5029('0x10f')]()['then'](function(_0xdf3a1e){for(var _0x58ce17=0x0;_0x58ce17<_0xdf3a1e[_0x5029('0x48')];_0x58ce17++){_0xdf3a1e[_0x58ce17]['setDataValue']('channel',_0x5029('0x110'));}return _0xdf3a1e;}));_0x18dce5[_0x5029('0x42')](_0x1e9246['getFaxQueues']()[_0x5029('0x24')](function(_0x51f253){for(var _0x566ae3=0x0;_0x566ae3<_0x51f253[_0x5029('0x48')];_0x566ae3++){_0x51f253[_0x566ae3][_0x5029('0x10a')](_0x5029('0xb1'),_0x5029('0x111'));}return _0x51f253;}));_0x18dce5[_0x5029('0x42')](_0x1e9246[_0x5029('0x112')]()[_0x5029('0x24')](function(_0x6f39a3){for(var _0x1c1d3a=0x0;_0x1c1d3a<_0x6f39a3[_0x5029('0x48')];_0x1c1d3a++){_0x6f39a3[_0x1c1d3a]['setDataValue'](_0x5029('0xb1'),_0x5029('0x113'));}return _0x6f39a3;}));return BPromise['all'](_0x18dce5);})[_0x5029('0x24')](function(_0x56ff58){var _0x452c5c=_['flatten'](_0x56ff58);_0x18dce5=[];return db[_0x5029('0x6a')][_0x5029('0x114')](function(_0xb8a9f1){for(var _0x2783d3=0x0;_0x2783d3<_0x452c5c[_0x5029('0x48')];_0x2783d3++){_0x18dce5[_0x5029('0x42')](_0x452c5c[_0x2783d3][_0x5029('0x115')](_0x439bea['id']),{'transaction':_0xb8a9f1});}return BPromise[_0x5029('0x50')](_0x18dce5)['then'](function(){if(_0x439bea['online']){return BPromise[_0x5029('0x88')](_[_0x5029('0x3b')](_0x452c5c,function(_0x1da776){return _0x1da776[_0x5029('0x116')](_0x5029('0xb1'))==='Voice';}),function(_0x58aa33){return db[_0x5029('0xae')][_0x5029('0xaf')]({'membername':_0x439bea['name'],'UserId':_0x439bea['id'],'queue_name':_0x58aa33[_0x5029('0x31')],'VoiceQueueId':_0x58aa33['id'],'interface':_[_0x5029('0x66')](_0x439bea[_0x5029('0xa2')])?util[_0x5029('0xad')]('SIP/%s',_0x439bea[_0x5029('0x31')]):_0x439bea[_0x5029('0xa2')],'paused':_0x439bea[_0x5029('0xa1')]||![],'penalty':_0x439bea['penalty']},{'transaction':_0xb8a9f1});});}else{return;}})['then'](function(){for(var _0x243a12=0x0;_0x243a12<_0x452c5c['length'];_0x243a12++){var _0x5326b9=_0x452c5c[_0x243a12]['getDataValue'](_0x5029('0xb1'));var _0x439a5d=_0x5326b9+_0x5029('0xa8');socket[_0x5029('0xa9')]('user'+_0x5326b9+_0x5029('0xab'),{'UserId':_0x439bea['id'],['queueField']:_0x452c5c[_0x243a12]['id']});}});});})[_0x5029('0x24')](function(){db['TeamVoicePrefix'][_0x5029('0x97')]({'where':{'teamId':_0x64cd43['id']}})['then'](function(_0x520894){if(_0x520894){db[_0x5029('0x117')][_0x5029('0x7e')]({'UserId':_0x1128d0[_0x5029('0x53')]['id'],'VoicePrefixId':_0x520894[_0x5029('0x118')]});}});});}});}})['then'](respondWithStatusCode(_0x3c8bee,null))[_0x5029('0x51')](handleError(_0x3c8bee,null));};exports[_0x5029('0x119')]=function(_0x4e4b1c,_0x3692e2){return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x4e4b1c[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x3692e2,null))[_0x5029('0x24')](function(_0x3c8256){if(_0x3c8256){var _0x5dc43e=_0x3c8256[_0x5029('0x25')]({'plain':!![]});var _0x2dd794=_0x4e4b1c[_0x5029('0x45')][_0x5029('0x61')];return _0x3c8256[_0x5029('0x119')](_0x2dd794)['then'](function(){for(var _0x2cba80=0x0;_0x2cba80<_0x2dd794[_0x5029('0x48')];_0x2cba80++){var _0x2b97cf=[];var _0x2d957a={};db[_0x5029('0x108')][_0x5029('0x97')]({'where':{'id':_0x2dd794[_0x2cba80]}})[_0x5029('0x24')](function(_0x11b1d3){_0x2d957a=_0x11b1d3[_0x5029('0x4a')];_0x2b97cf['push'](_0x11b1d3[_0x5029('0xee')]()['then'](function(_0x561bf6){for(var _0x32ae88=0x0;_0x32ae88<_0x561bf6[_0x5029('0x48')];_0x32ae88++){_0x561bf6[_0x32ae88][_0x5029('0x10a')]('channel',_0x5029('0x10b'));}return _0x561bf6;}));_0x2b97cf[_0x5029('0x42')](_0x11b1d3[_0x5029('0x10c')]()[_0x5029('0x24')](function(_0x157350){for(var _0x2a206b=0x0;_0x2a206b<_0x157350[_0x5029('0x48')];_0x2a206b++){_0x157350[_0x2a206b][_0x5029('0x10a')](_0x5029('0xb1'),_0x5029('0x11a'));}return _0x157350;}));_0x2b97cf[_0x5029('0x42')](_0x11b1d3[_0x5029('0x10d')]()[_0x5029('0x24')](function(_0x560549){for(var _0x471b44=0x0;_0x471b44<_0x560549[_0x5029('0x48')];_0x471b44++){_0x560549[_0x471b44]['setDataValue'](_0x5029('0xb1'),'Mail');}return _0x560549;}));_0x2b97cf[_0x5029('0x42')](_0x11b1d3[_0x5029('0x11b')]()['then'](function(_0x1eddba){for(var _0x407e9a=0x0;_0x407e9a<_0x1eddba['length'];_0x407e9a++){_0x1eddba[_0x407e9a][_0x5029('0x10a')](_0x5029('0xb1'),_0x5029('0x10e'));}return _0x1eddba;}));_0x2b97cf['push'](_0x11b1d3[_0x5029('0x10f')]()[_0x5029('0x24')](function(_0x4d6dd1){for(var _0x6407db=0x0;_0x6407db<_0x4d6dd1[_0x5029('0x48')];_0x6407db++){_0x4d6dd1[_0x6407db][_0x5029('0x10a')](_0x5029('0xb1'),'Whatsapp');}return _0x4d6dd1;}));_0x2b97cf[_0x5029('0x42')](_0x11b1d3[_0x5029('0x11c')]()[_0x5029('0x24')](function(_0x109f2e){for(var _0x41975a=0x0;_0x41975a<_0x109f2e[_0x5029('0x48')];_0x41975a++){_0x109f2e[_0x41975a][_0x5029('0x10a')](_0x5029('0xb1'),'Fax');}return _0x109f2e;}));_0x2b97cf[_0x5029('0x42')](_0x11b1d3[_0x5029('0x112')]()[_0x5029('0x24')](function(_0x3249fc){for(var _0x11c867=0x0;_0x11c867<_0x3249fc[_0x5029('0x48')];_0x11c867++){_0x3249fc[_0x11c867]['setDataValue'](_0x5029('0xb1'),'Openchannel');}return _0x3249fc;}));return BPromise[_0x5029('0x50')](_0x2b97cf);})[_0x5029('0x24')](function(_0x154758){var _0x5e709c=_['flatten'](_0x154758);_0x2b97cf=[];return db[_0x5029('0x6a')]['transaction'](function(_0x1d437e){for(var _0x4e1099=0x0;_0x4e1099<_0x5e709c[_0x5029('0x48')];_0x4e1099++){_0x2b97cf[_0x5029('0x42')](_0x5e709c[_0x4e1099][_0x5029('0x11d')](_0x5dc43e['id']),{'transaction':_0x1d437e});}return BPromise[_0x5029('0x50')](_0x2b97cf)['then'](function(){if(_0x5dc43e[_0x5029('0x9f')]){return BPromise[_0x5029('0x88')](_[_0x5029('0x3b')](_0x5e709c,function(_0x297abd){return _0x297abd[_0x5029('0x116')](_0x5029('0xb1'))===_0x5029('0x10b');}),function(_0x55d4e4){return db[_0x5029('0xae')]['destroy']({'where':{'VoiceQueueId':_0x55d4e4['id'],'UserId':_0x5dc43e['id']},'transaction':_0x1d437e});});}else{return;}})[_0x5029('0x24')](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x2d957a['id']}})[_0x5029('0x24')](function(_0x4190f1){if(_0x4190f1){return db[_0x5029('0x117')][_0x5029('0x23')]({'where':{'UserId':_0x5dc43e['id'],'VoicePrefixId':_0x4190f1[_0x5029('0x4a')]['VoicePrefixId']}});}});})[_0x5029('0x24')](function(){for(var _0x3daa78=0x0;_0x3daa78<_0x5e709c['length'];_0x3daa78++){var _0x19cf83=_0x5e709c[_0x3daa78][_0x5029('0x116')](_0x5029('0xb1'));var _0x138355=_0x19cf83+_0x5029('0xa8');socket['emit'](_0x5029('0x29')+_0x19cf83+_0x5029('0xb4'),{'UserId':_0x5dc43e['id'],['queueField']:_0x5e709c[_0x3daa78]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x3692e2,null))[_0x5029('0x51')](handleError(_0x3692e2,null));};exports[_0x5029('0x11e')]=function(_0x60c871,_0x1b7c3f){var _0x1b0e02={};var _0x58d7d9={};var _0x46727d;var _0x27394a;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x60c871[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x1b7c3f,null))[_0x5029('0x24')](function(_0x76aff2){if(_0x76aff2){_0x46727d=_0x76aff2;_0x58d7d9[_0x5029('0x54')]=_[_0x5029('0x56')](db['CmList'][_0x5029('0x36')]);_0x58d7d9['query']=_[_0x5029('0x56')](_0x60c871['query']);_0x58d7d9[_0x5029('0x59')]=_['intersection'](_0x58d7d9[_0x5029('0x54')],_0x58d7d9[_0x5029('0x45')]);_0x1b0e02[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x58d7d9[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x60c871[_0x5029('0x45')][_0x5029('0x5b')]));_0x1b0e02[_0x5029('0x41')]=_0x1b0e02[_0x5029('0x41')][_0x5029('0x48')]?_0x1b0e02[_0x5029('0x41')]:_0x58d7d9[_0x5029('0x54')];_0x1b0e02['order']=qs[_0x5029('0xca')](_0x60c871[_0x5029('0x45')][_0x5029('0xca')]);_0x1b0e02[_0x5029('0x3d')]=qs[_0x5029('0x59')](_['pick'](_0x60c871[_0x5029('0x45')],_0x58d7d9['filters']));if(_0x60c871[_0x5029('0x45')][_0x5029('0x3b')]){_0x1b0e02[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x1b0e02[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x1b0e02['attributes'],function(_0x535e2b){var _0x4d4e03={};_0x4d4e03[_0x535e2b]={'$like':'%'+_0x60c871[_0x5029('0x45')]['filter']+'%'};return _0x4d4e03;})});}_0x1b0e02=_[_0x5029('0xcc')]({},_0x1b0e02,_0x60c871[_0x5029('0x5c')]);return _0x46727d[_0x5029('0x11e')](_0x1b0e02);}})[_0x5029('0x24')](function(_0xfa541){if(_0xfa541){_0x27394a=_0xfa541[_0x5029('0x48')];if(!_0x60c871[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0x1b0e02['limit']=qs[_0x5029('0x1d')](_0x60c871[_0x5029('0x45')]['limit']);_0x1b0e02[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x60c871['query']['offset']);}return _0x46727d[_0x5029('0x11e')](_0x1b0e02);}})[_0x5029('0x24')](function(_0x77ec5d){if(_0x77ec5d){return _0x77ec5d?{'count':_0x27394a,'rows':_0x77ec5d}:null;}})[_0x5029('0x24')](respondWithResult(_0x1b7c3f,null))[_0x5029('0x51')](handleError(_0x1b7c3f,null));};exports[_0x5029('0x11f')]=function(_0x3381c7,_0x46bf62){var _0x35e271={};var _0x11ac5b={};var _0xacf936;var _0x4475d5;return db['User'][_0x5029('0x97')]({'where':{'id':_0x3381c7[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x46bf62,null))['then'](function(_0x154b64){if(_0x154b64){_0xacf936=_0x154b64;_0x11ac5b['model']=_[_0x5029('0x56')](db[_0x5029('0x35')][_0x5029('0x36')]);_0x11ac5b[_0x5029('0x45')]=_['keys'](_0x3381c7[_0x5029('0x45')]);_0x11ac5b['filters']=_['intersection'](_0x11ac5b['model'],_0x11ac5b['query']);_0x35e271[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x11ac5b[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x3381c7['query']['fields']));_0x35e271[_0x5029('0x41')]=_0x35e271[_0x5029('0x41')]['length']?_0x35e271['attributes']:_0x11ac5b[_0x5029('0x54')];_0x35e271[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x3381c7[_0x5029('0x45')][_0x5029('0xca')]);_0x35e271[_0x5029('0x3d')]=qs[_0x5029('0x59')](_['pick'](_0x3381c7[_0x5029('0x45')],_0x11ac5b[_0x5029('0x59')]));if(_0x3381c7[_0x5029('0x45')][_0x5029('0x3b')]){_0x35e271[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x35e271['where'],{'$or':_['map'](_0x35e271['attributes'],function(_0x314d16){var _0x26f068={};_0x26f068[_0x314d16]={'$like':'%'+_0x3381c7['query'][_0x5029('0x3b')]+'%'};return _0x26f068;})});}_0x35e271['model']=db[_0x5029('0x35')];_0x35e271['as']=_0x5029('0x2a');_0x35e271=_[_0x5029('0xcc')]({},_0x35e271,_0x3381c7[_0x5029('0x5c')]);return _0xacf936[_0x5029('0xee')]({'include':[_0x35e271]});}})[_0x5029('0x24')](function(_0x17a77e){if(_0x17a77e){var _0x589f95={},_0x37b9ce=[],_0x222400=0x0;for(var _0xcf112a=0x0;_0xcf112a<_0x17a77e[_0x5029('0x48')];_0xcf112a+=0x1){for(var _0x4e79bb=0x0,_0x488b21;_0x4e79bb<_0x17a77e[_0xcf112a]['Agents'][_0x5029('0x48')];_0x4e79bb+=0x1){_0x488b21=_0x17a77e[_0xcf112a][_0x5029('0x2a')][_0x4e79bb][_0x5029('0x25')]({'plain':!![]});_0x589f95[_0x488b21['id']]=_0x488b21;}}_0x589f95=_[_0x5029('0x120')](_0x589f95);for(var _0x1119bf=qs[_0x5029('0x1f')](_0x3381c7[_0x5029('0x45')][_0x5029('0x1f')]);_0x1119bf<_0x589f95[_0x5029('0x48')]&&_0x37b9ce[_0x5029('0x48')]<qs[_0x5029('0x1d')](_0x3381c7[_0x5029('0x45')][_0x5029('0x1d')]);_0x1119bf+=0x1){if(_0x589f95[_0x1119bf]){_0x37b9ce[_0x5029('0x42')](_0x589f95[_0x1119bf]);}}return{'count':_0x589f95[_0x5029('0x48')],'rows':_0x37b9ce};}})[_0x5029('0x24')](respondWithResult(_0x46bf62,null))[_0x5029('0x51')](handleError(_0x46bf62,null));};exports[_0x5029('0x23')]=function(_0x24632c,_0x2ed1bb){if(_0x24632c[_0x5029('0x29')]['id']==_0x24632c['params']['id']){return _0x2ed1bb[_0x5029('0x1b')](0x1f4)['send']({'message':_0x5029('0x121')});}return db['User'][_0x5029('0x30')]({'where':{'id':_0x24632c[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x2ed1bb,null))[_0x5029('0x24')](removeEntity(_0x2ed1bb,null))[_0x5029('0x51')](handleError(_0x2ed1bb,null));};exports[_0x5029('0x122')]=function(_0xa87ee1,_0x4916e2){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0xa87ee1[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x4916e2,null))['then'](function(_0x1906b1){if(_0x1906b1){return _0x1906b1[_0x5029('0x122')](_0xa87ee1[_0x5029('0x5d')][_0x5029('0x61')],_['omit'](_0xa87ee1[_0x5029('0x5d')],[_0x5029('0x61'),'id'])||{})[_0x5029('0xa7')](function(){for(var _0x3242cf=0x0;_0x3242cf<_0xa87ee1[_0x5029('0x5d')]['ids'][_0x5029('0x48')];_0x3242cf+=0x1){socket['emit'](_0x5029('0x123'),{'ChatInteractionId':Number(_0xa87ee1['body'][_0x5029('0x61')][_0x3242cf]),'UserId':Number(_0xa87ee1[_0x5029('0x53')]['id'])});}return _0xa87ee1[_0x5029('0x5d')][_0x5029('0x61')];});}})[_0x5029('0x24')](respondWithResult(_0x4916e2,null))[_0x5029('0x51')](handleError(_0x4916e2,null));};exports[_0x5029('0x124')]=function(_0x5dd456,_0x7d14bd){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x5dd456['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x7d14bd,null))[_0x5029('0x24')](function(_0x3969d9){if(_0x3969d9){return _0x3969d9[_0x5029('0x124')](_0x5dd456[_0x5029('0x45')][_0x5029('0x61')])[_0x5029('0x24')](function(){if(_[_0x5029('0xb3')](_0x5dd456[_0x5029('0x45')]['ids'])){for(var _0x300058=0x0;_0x300058<_0x5dd456[_0x5029('0x45')]['ids'][_0x5029('0x48')];_0x300058+=0x1){socket[_0x5029('0xa9')](_0x5029('0x125'),{'ChatInteractionId':Number(_0x5dd456['query'][_0x5029('0x61')][_0x300058]),'UserId':Number(_0x5dd456[_0x5029('0x53')]['id'])});}}else{socket[_0x5029('0xa9')](_0x5029('0x125'),{'ChatInteractionId':Number(_0x5dd456[_0x5029('0x45')][_0x5029('0x61')]),'UserId':Number(_0x5dd456[_0x5029('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x7d14bd,null))['catch'](handleError(_0x7d14bd,null));};exports['addMailInteractions']=function(_0x37b640,_0x2c7ce3){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x37b640[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x2c7ce3,null))[_0x5029('0x24')](function(_0x32d168){if(_0x32d168){return _0x32d168[_0x5029('0x126')](_0x37b640[_0x5029('0x5d')][_0x5029('0x61')],_[_0x5029('0x60')](_0x37b640[_0x5029('0x5d')],[_0x5029('0x61'),'id'])||{})[_0x5029('0xa7')](function(){for(var _0x25b7e5=0x0;_0x25b7e5<_0x37b640['body'][_0x5029('0x61')][_0x5029('0x48')];_0x25b7e5+=0x1){socket['emit'](_0x5029('0x127'),{'MailInteractionId':Number(_0x37b640['body']['ids'][_0x25b7e5]),'UserId':Number(_0x37b640[_0x5029('0x53')]['id'])});}return _0x37b640['body'][_0x5029('0x61')];});}})[_0x5029('0x24')](respondWithResult(_0x2c7ce3,null))[_0x5029('0x51')](handleError(_0x2c7ce3,null));};exports['removeMailInteractions']=function(_0x5012be,_0x312989){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x5012be[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x312989,null))[_0x5029('0x24')](function(_0x44a703){if(_0x44a703){return _0x44a703[_0x5029('0x128')](_0x5012be['query'][_0x5029('0x61')])[_0x5029('0x24')](function(){if(_[_0x5029('0xb3')](_0x5012be[_0x5029('0x45')][_0x5029('0x61')])){for(var _0x42c57a=0x0;_0x42c57a<_0x5012be[_0x5029('0x45')]['ids'][_0x5029('0x48')];_0x42c57a+=0x1){socket[_0x5029('0xa9')](_0x5029('0x129'),{'MailInteractionId':Number(_0x5012be[_0x5029('0x45')]['ids'][_0x42c57a]),'UserId':Number(_0x5012be[_0x5029('0x53')]['id'])});}}else{socket['emit'](_0x5029('0x129'),{'MailInteractionId':Number(_0x5012be[_0x5029('0x45')][_0x5029('0x61')]),'UserId':Number(_0x5012be[_0x5029('0x53')]['id'])});}});}})[_0x5029('0x24')](respondWithStatusCode(_0x312989,null))[_0x5029('0x51')](handleError(_0x312989,null));};exports[_0x5029('0x12a')]=function(_0x408338,_0x42d820){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x408338[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x42d820,null))[_0x5029('0x24')](function(_0x2ba44c){if(_0x2ba44c){return _0x2ba44c[_0x5029('0x12a')](_0x408338[_0x5029('0x5d')][_0x5029('0x61')],_[_0x5029('0x60')](_0x408338['body'],[_0x5029('0x61'),'id'])||{})[_0x5029('0xa7')](function(){for(var _0x23ee58=0x0;_0x23ee58<_0x408338[_0x5029('0x5d')][_0x5029('0x61')][_0x5029('0x48')];_0x23ee58+=0x1){socket[_0x5029('0xa9')](_0x5029('0x12b'),{'FaxInteractionId':Number(_0x408338[_0x5029('0x5d')]['ids'][_0x23ee58]),'UserId':Number(_0x408338[_0x5029('0x53')]['id'])});}return _0x408338['body'][_0x5029('0x61')];});}})[_0x5029('0x24')](respondWithResult(_0x42d820,null))[_0x5029('0x51')](handleError(_0x42d820,null));};exports[_0x5029('0x12c')]=function(_0x515f61,_0x1f892a){return db['User'][_0x5029('0x30')]({'where':{'id':_0x515f61[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x1f892a,null))[_0x5029('0x24')](function(_0xabf4ba){if(_0xabf4ba){return _0xabf4ba['removeFaxInteractions'](_0x515f61[_0x5029('0x45')]['ids'])['then'](function(){if(_[_0x5029('0xb3')](_0x515f61[_0x5029('0x45')][_0x5029('0x61')])){for(var _0x50b46f=0x0;_0x50b46f<_0x515f61['query']['ids']['length'];_0x50b46f+=0x1){socket[_0x5029('0xa9')](_0x5029('0x12d'),{'FaxInteractionId':Number(_0x515f61['query'][_0x5029('0x61')][_0x50b46f]),'UserId':Number(_0x515f61['params']['id'])});}}else{socket[_0x5029('0xa9')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x515f61['query'][_0x5029('0x61')]),'UserId':Number(_0x515f61[_0x5029('0x53')]['id'])});}});}})[_0x5029('0x24')](respondWithStatusCode(_0x1f892a,null))[_0x5029('0x51')](handleError(_0x1f892a,null));};exports[_0x5029('0x12e')]=function(_0x1df915,_0x281a0f){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x1df915['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x281a0f,null))['then'](function(_0x80303b){if(_0x80303b){return _0x80303b['addSmsInteractions'](_0x1df915['body'][_0x5029('0x61')],_[_0x5029('0x60')](_0x1df915[_0x5029('0x5d')],['ids','id'])||{})[_0x5029('0xa7')](function(){for(var _0x5320b5=0x0;_0x5320b5<_0x1df915[_0x5029('0x5d')][_0x5029('0x61')][_0x5029('0x48')];_0x5320b5+=0x1){socket[_0x5029('0xa9')](_0x5029('0x12f'),{'SmsInteractionId':Number(_0x1df915[_0x5029('0x5d')]['ids'][_0x5320b5]),'UserId':Number(_0x1df915[_0x5029('0x53')]['id'])});}return _0x1df915['body'][_0x5029('0x61')];});}})[_0x5029('0x24')](respondWithResult(_0x281a0f,null))[_0x5029('0x51')](handleError(_0x281a0f,null));};exports['removeSmsInteractions']=function(_0x388edb,_0x1046f0){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x388edb[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x1046f0,null))[_0x5029('0x24')](function(_0x1c1d8b){if(_0x1c1d8b){return _0x1c1d8b[_0x5029('0x130')](_0x388edb[_0x5029('0x45')][_0x5029('0x61')])[_0x5029('0x24')](function(){if(_[_0x5029('0xb3')](_0x388edb[_0x5029('0x45')][_0x5029('0x61')])){for(var _0x4feed8=0x0;_0x4feed8<_0x388edb['query'][_0x5029('0x61')][_0x5029('0x48')];_0x4feed8+=0x1){socket[_0x5029('0xa9')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x388edb[_0x5029('0x45')]['ids'][_0x4feed8]),'UserId':Number(_0x388edb[_0x5029('0x53')]['id'])});}}else{socket[_0x5029('0xa9')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x388edb[_0x5029('0x45')][_0x5029('0x61')]),'UserId':Number(_0x388edb['params']['id'])});}});}})[_0x5029('0x24')](respondWithStatusCode(_0x1046f0,null))['catch'](handleError(_0x1046f0,null));};exports['addOpenchannelInteractions']=function(_0x19d06d,_0x8cefe5){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x19d06d[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x8cefe5,null))[_0x5029('0x24')](function(_0x8d23f2){if(_0x8d23f2){return _0x8d23f2[_0x5029('0x131')](_0x19d06d[_0x5029('0x5d')][_0x5029('0x61')],_['omit'](_0x19d06d[_0x5029('0x5d')],['ids','id'])||{})[_0x5029('0xa7')](function(){for(var _0x4c71d0=0x0;_0x4c71d0<_0x19d06d[_0x5029('0x5d')][_0x5029('0x61')][_0x5029('0x48')];_0x4c71d0+=0x1){socket['emit'](_0x5029('0x132'),{'OpenchannelInteractionId':Number(_0x19d06d['body'][_0x5029('0x61')][_0x4c71d0]),'UserId':Number(_0x19d06d[_0x5029('0x53')]['id'])});}return _0x19d06d[_0x5029('0x5d')][_0x5029('0x61')];});}})[_0x5029('0x24')](respondWithResult(_0x8cefe5,null))[_0x5029('0x51')](handleError(_0x8cefe5,null));};exports[_0x5029('0x133')]=function(_0x203c69,_0x19eb01){return db['User'][_0x5029('0x30')]({'where':{'id':_0x203c69[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x19eb01,null))[_0x5029('0x24')](function(_0x2ae46d){if(_0x2ae46d){return _0x2ae46d[_0x5029('0x133')](_0x203c69[_0x5029('0x45')]['ids'])[_0x5029('0x24')](function(){if(_['isArray'](_0x203c69[_0x5029('0x45')][_0x5029('0x61')])){for(var _0x524b2f=0x0;_0x524b2f<_0x203c69[_0x5029('0x45')][_0x5029('0x61')][_0x5029('0x48')];_0x524b2f+=0x1){socket[_0x5029('0xa9')](_0x5029('0x134'),{'OpenchannelInteractionId':Number(_0x203c69[_0x5029('0x45')][_0x5029('0x61')][_0x524b2f]),'UserId':Number(_0x203c69[_0x5029('0x53')]['id'])});}}else{socket[_0x5029('0xa9')](_0x5029('0x134'),{'OpenchannelInteractionId':Number(_0x203c69[_0x5029('0x45')][_0x5029('0x61')]),'UserId':Number(_0x203c69[_0x5029('0x53')]['id'])});}});}})[_0x5029('0x24')](respondWithStatusCode(_0x19eb01,null))[_0x5029('0x51')](handleError(_0x19eb01,null));};exports['addWhatsappInteractions']=function(_0x102d93,_0x26534f){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x102d93['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x26534f,null))['then'](function(_0x9f1acc){if(_0x9f1acc){return _0x9f1acc['addWhatsappInteractions'](_0x102d93[_0x5029('0x5d')][_0x5029('0x61')],_[_0x5029('0x60')](_0x102d93[_0x5029('0x5d')],['ids','id'])||{})[_0x5029('0xa7')](function(){for(var _0x1589d3=0x0;_0x1589d3<_0x102d93[_0x5029('0x5d')][_0x5029('0x61')][_0x5029('0x48')];_0x1589d3+=0x1){socket[_0x5029('0xa9')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0x102d93[_0x5029('0x5d')][_0x5029('0x61')][_0x1589d3]),'UserId':Number(_0x102d93[_0x5029('0x53')]['id'])});}return _0x102d93[_0x5029('0x5d')]['ids'];});}})[_0x5029('0x24')](respondWithResult(_0x26534f,null))[_0x5029('0x51')](handleError(_0x26534f,null));};exports['removeWhatsappInteractions']=function(_0x210a21,_0x30e123){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x210a21[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x30e123,null))[_0x5029('0x24')](function(_0xc16283){if(_0xc16283){return _0xc16283[_0x5029('0x135')](_0x210a21[_0x5029('0x45')]['ids']);}})[_0x5029('0x24')](respondWithStatusCode(_0x30e123,null))['catch'](handleError(_0x30e123,null));};exports[_0x5029('0x136')]=function(_0xf2c2a6,_0x3ddfd4){var _0x66b1be={};var _0x1af209={};var _0x2b6385;var _0x3bfe38;return db[_0x5029('0x35')]['findOne']({'where':{'id':_0xf2c2a6[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x3ddfd4,null))[_0x5029('0x24')](function(_0x5e2c03){if(_0x5e2c03){_0x2b6385=_0x5e2c03;_0x1af209[_0x5029('0x54')]=_[_0x5029('0x56')](db['VoicePrefix'][_0x5029('0x36')]);_0x1af209['query']=_[_0x5029('0x56')](_0xf2c2a6[_0x5029('0x45')]);_0x1af209[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x1af209[_0x5029('0x54')],_0x1af209[_0x5029('0x45')]);_0x66b1be[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x1af209[_0x5029('0x54')],qs[_0x5029('0x5b')](_0xf2c2a6['query'][_0x5029('0x5b')]));_0x66b1be['attributes']=_0x66b1be[_0x5029('0x41')]['length']?_0x66b1be[_0x5029('0x41')]:_0x1af209[_0x5029('0x54')];_0x66b1be[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0xf2c2a6[_0x5029('0x45')]['sort']);_0x66b1be[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0xf2c2a6[_0x5029('0x45')],_0x1af209[_0x5029('0x59')]));if(_0xf2c2a6[_0x5029('0x45')][_0x5029('0x3b')]){_0x66b1be[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x66b1be['where'],{'$or':_[_0x5029('0x37')](_0x66b1be[_0x5029('0x41')],function(_0x435f50){var _0x156611={};_0x156611[_0x435f50]={'$like':'%'+_0xf2c2a6['query'][_0x5029('0x3b')]+'%'};return _0x156611;})});}_0x66b1be=_['merge']({},_0x66b1be,_0xf2c2a6[_0x5029('0x5c')]);return _0x2b6385[_0x5029('0x136')](_0x66b1be);}})[_0x5029('0x24')](function(_0x5ccd20){if(_0x5ccd20){_0x3bfe38=_0x5ccd20[_0x5029('0x48')];if(!_0xf2c2a6[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0x66b1be['limit']=qs['limit'](_0xf2c2a6[_0x5029('0x45')]['limit']);_0x66b1be[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0xf2c2a6[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x2b6385[_0x5029('0x136')](_0x66b1be);}})[_0x5029('0x24')](function(_0x270064){if(_0x270064){return _0x270064?{'count':_0x3bfe38,'rows':_0x270064}:null;}})[_0x5029('0x24')](respondWithResult(_0x3ddfd4,null))['catch'](handleError(_0x3ddfd4,null));};exports[_0x5029('0x137')]=function(_0x37bb61,_0x5f2f1d){var _0x36bee0={};var _0x312943={};var _0x5b3f21;var _0x36e033;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x37bb61['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x5f2f1d,null))[_0x5029('0x24')](function(_0x4b21d7){if(_0x4b21d7){_0x5b3f21=_0x4b21d7;_0x312943['model']=_['keys'](db[_0x5029('0x138')]['rawAttributes']);_0x312943[_0x5029('0x45')]=_['keys'](_0x37bb61['query']);_0x312943['filters']=_[_0x5029('0x5a')](_0x312943['model'],_0x312943[_0x5029('0x45')]);_0x36bee0[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x312943[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x37bb61['query'][_0x5029('0x5b')]));_0x36bee0['attributes']=_0x36bee0[_0x5029('0x41')][_0x5029('0x48')]?_0x36bee0['attributes']:_0x312943[_0x5029('0x54')];_0x36bee0['order']=qs[_0x5029('0xca')](_0x37bb61[_0x5029('0x45')][_0x5029('0xca')]);_0x36bee0[_0x5029('0x3d')]=qs['filters'](_[_0x5029('0xcb')](_0x37bb61['query'],_0x312943[_0x5029('0x59')]));if(_0x37bb61[_0x5029('0x45')][_0x5029('0x3b')]){_0x36bee0['where']=_[_0x5029('0xcc')](_0x36bee0[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x36bee0[_0x5029('0x41')],function(_0x36bc03){var _0x4eef9c={};_0x4eef9c[_0x36bc03]={'$like':'%'+_0x37bb61[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x4eef9c;})});}_0x36bee0=_[_0x5029('0xcc')]({},_0x36bee0,_0x37bb61['options']);return _0x5b3f21[_0x5029('0x137')](_0x36bee0);}})[_0x5029('0x24')](function(_0x397e2b){if(_0x397e2b){_0x36e033=_0x397e2b['length'];if(!_0x37bb61['query']['hasOwnProperty'](_0x5029('0xd3'))){_0x36bee0['limit']=qs[_0x5029('0x1d')](_0x37bb61[_0x5029('0x45')][_0x5029('0x1d')]);_0x36bee0[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x37bb61['query'][_0x5029('0x1f')]);}return _0x5b3f21[_0x5029('0x137')](_0x36bee0);}})[_0x5029('0x24')](function(_0x14074d){if(_0x14074d){return _0x14074d?{'count':_0x36e033,'rows':_0x14074d}:null;}})[_0x5029('0x24')](respondWithResult(_0x5f2f1d,null))['catch'](handleError(_0x5f2f1d,null));};exports['addFaxAccounts']=function(_0x1d3ae2,_0x53a358){return db['User']['find']({'where':{'id':_0x1d3ae2[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x53a358,null))['then'](function(_0x40e75c){if(_0x40e75c){return _0x40e75c[_0x5029('0x139')](_0x1d3ae2[_0x5029('0x5d')][_0x5029('0x61')],_[_0x5029('0x60')](_0x1d3ae2['body'],[_0x5029('0x61'),'id'])||{});}})[_0x5029('0x24')](respondWithResult(_0x53a358,null))[_0x5029('0x51')](handleError(_0x53a358,null));};exports[_0x5029('0x13a')]=function(_0x3298a1,_0x20767d){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x3298a1[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x20767d,null))[_0x5029('0x24')](function(_0x6a37b4){if(_0x6a37b4){return _0x6a37b4['removeFaxAccounts'](_0x3298a1[_0x5029('0x45')][_0x5029('0x61')]);}})[_0x5029('0x24')](respondWithStatusCode(_0x20767d,null))[_0x5029('0x51')](handleError(_0x20767d,null));};exports[_0x5029('0x13b')]=function(_0x474c77,_0x3b3811){var _0xae2e78={};var _0x57217c={};var _0x59babf;var _0x380a3c;return db['User'][_0x5029('0x97')]({'where':{'id':_0x474c77['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x3b3811,null))[_0x5029('0x24')](function(_0x4fb805){if(_0x4fb805){_0x59babf=_0x4fb805;_0x57217c[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0x13c')][_0x5029('0x36')]);_0x57217c[_0x5029('0x45')]=_[_0x5029('0x56')](_0x474c77['query']);_0x57217c[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x57217c[_0x5029('0x54')],_0x57217c[_0x5029('0x45')]);_0xae2e78[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x57217c['model'],qs['fields'](_0x474c77[_0x5029('0x45')][_0x5029('0x5b')]));_0xae2e78[_0x5029('0x41')]=_0xae2e78[_0x5029('0x41')][_0x5029('0x48')]?_0xae2e78['attributes']:_0x57217c[_0x5029('0x54')];_0xae2e78[_0x5029('0xd8')]=qs['sort'](_0x474c77[_0x5029('0x45')]['sort']);_0xae2e78[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x474c77[_0x5029('0x45')],_0x57217c[_0x5029('0x59')]));if(_0x474c77[_0x5029('0x45')]['filter']){_0xae2e78['where']=_[_0x5029('0xcc')](_0xae2e78[_0x5029('0x3d')],{'$or':_['map'](_0xae2e78['attributes'],function(_0x22881f){var _0x39a50e={};_0x39a50e[_0x22881f]={'$like':'%'+_0x474c77[_0x5029('0x45')]['filter']+'%'};return _0x39a50e;})});}_0xae2e78=_['merge']({},_0xae2e78,_0x474c77[_0x5029('0x5c')]);return _0x59babf[_0x5029('0x13b')](_0xae2e78);}})[_0x5029('0x24')](function(_0xe06cc4){if(_0xe06cc4){_0x380a3c=_0xe06cc4[_0x5029('0x48')];if(!_0x474c77[_0x5029('0x45')][_0x5029('0xcd')]('nolimit')){_0xae2e78[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x474c77[_0x5029('0x45')][_0x5029('0x1d')]);_0xae2e78[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x474c77[_0x5029('0x45')]['offset']);}return _0x59babf[_0x5029('0x13b')](_0xae2e78);}})[_0x5029('0x24')](function(_0x2f89b0){if(_0x2f89b0){return _0x2f89b0?{'count':_0x380a3c,'rows':_0x2f89b0}:null;}})['then'](respondWithResult(_0x3b3811,null))[_0x5029('0x51')](handleError(_0x3b3811,null));};exports['addMailAccounts']=function(_0x59fbdd,_0x1dd189){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x59fbdd[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x1dd189,null))[_0x5029('0x24')](function(_0x5cc81d){if(_0x5cc81d){return _0x5cc81d['addMailAccounts'](_0x59fbdd['body'][_0x5029('0x61')],_[_0x5029('0x60')](_0x59fbdd[_0x5029('0x5d')],['ids','id'])||{});}})[_0x5029('0x24')](respondWithResult(_0x1dd189,null))[_0x5029('0x51')](handleError(_0x1dd189,null));};exports[_0x5029('0x13d')]=function(_0x20bbe8,_0x356c91){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x20bbe8[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x356c91,null))[_0x5029('0x24')](function(_0x439011){if(_0x439011){return _0x439011[_0x5029('0x13d')](_0x20bbe8['query'][_0x5029('0x61')]);}})[_0x5029('0x24')](respondWithStatusCode(_0x356c91,null))[_0x5029('0x51')](handleError(_0x356c91,null));};exports[_0x5029('0x13e')]=function(_0x2a901f,_0x57937c){var _0x150d2d={};var _0x4baa8c={};var _0x5ac29a;var _0x21acf9;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x2a901f[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x57937c,null))[_0x5029('0x24')](function(_0x3cac25){if(_0x3cac25){_0x5ac29a=_0x3cac25;_0x4baa8c[_0x5029('0x54')]=_[_0x5029('0x56')](db['OpenchannelAccount']['rawAttributes']);_0x4baa8c['query']=_['keys'](_0x2a901f[_0x5029('0x45')]);_0x4baa8c['filters']=_[_0x5029('0x5a')](_0x4baa8c['model'],_0x4baa8c[_0x5029('0x45')]);_0x150d2d[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x4baa8c[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x2a901f['query'][_0x5029('0x5b')]));_0x150d2d[_0x5029('0x41')]=_0x150d2d[_0x5029('0x41')][_0x5029('0x48')]?_0x150d2d[_0x5029('0x41')]:_0x4baa8c[_0x5029('0x54')];_0x150d2d['order']=qs[_0x5029('0xca')](_0x2a901f['query'][_0x5029('0xca')]);_0x150d2d[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x2a901f[_0x5029('0x45')],_0x4baa8c[_0x5029('0x59')]));if(_0x2a901f[_0x5029('0x45')][_0x5029('0x3b')]){_0x150d2d['where']=_[_0x5029('0xcc')](_0x150d2d[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x150d2d['attributes'],function(_0x147f05){var _0x52f1a6={};_0x52f1a6[_0x147f05]={'$like':'%'+_0x2a901f['query'][_0x5029('0x3b')]+'%'};return _0x52f1a6;})});}_0x150d2d=_[_0x5029('0xcc')]({},_0x150d2d,_0x2a901f[_0x5029('0x5c')]);return _0x5ac29a[_0x5029('0x13e')](_0x150d2d);}})[_0x5029('0x24')](function(_0x9a6d3b){if(_0x9a6d3b){_0x21acf9=_0x9a6d3b[_0x5029('0x48')];if(!_0x2a901f[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0x150d2d['limit']=qs[_0x5029('0x1d')](_0x2a901f[_0x5029('0x45')]['limit']);_0x150d2d[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x2a901f[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x5ac29a[_0x5029('0x13e')](_0x150d2d);}})[_0x5029('0x24')](function(_0x14a9c1){if(_0x14a9c1){return _0x14a9c1?{'count':_0x21acf9,'rows':_0x14a9c1}:null;}})[_0x5029('0x24')](respondWithResult(_0x57937c,null))['catch'](handleError(_0x57937c,null));};exports[_0x5029('0x13f')]=function(_0x5003c2,_0x45d073){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x5003c2[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x45d073,null))[_0x5029('0x24')](function(_0x1e95e0){if(_0x1e95e0){return _0x1e95e0[_0x5029('0x13f')](_0x5003c2[_0x5029('0x5d')]['ids'],_[_0x5029('0x60')](_0x5003c2[_0x5029('0x5d')],[_0x5029('0x61'),'id'])||{});}})[_0x5029('0x24')](respondWithResult(_0x45d073,null))[_0x5029('0x51')](handleError(_0x45d073,null));};exports[_0x5029('0x140')]=function(_0x2138cd,_0x44c78b){return db['User'][_0x5029('0x30')]({'where':{'id':_0x2138cd['params']['id']}})['then'](handleEntityNotFound(_0x44c78b,null))[_0x5029('0x24')](function(_0x457f0e){if(_0x457f0e){return _0x457f0e[_0x5029('0x140')](_0x2138cd['query']['ids']);}})[_0x5029('0x24')](respondWithStatusCode(_0x44c78b,null))[_0x5029('0x51')](handleError(_0x44c78b,null));};exports['getSmsAccounts']=function(_0x3fc907,_0x47c5c5){var _0xfcb7b1={};var _0x1f226f={};var _0x37e022;var _0x446d1f;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x3fc907['params']['id']}})['then'](handleEntityNotFound(_0x47c5c5,null))[_0x5029('0x24')](function(_0xa31f86){if(_0xa31f86){_0x37e022=_0xa31f86;_0x1f226f[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0x141')][_0x5029('0x36')]);_0x1f226f[_0x5029('0x45')]=_[_0x5029('0x56')](_0x3fc907[_0x5029('0x45')]);_0x1f226f[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x1f226f[_0x5029('0x54')],_0x1f226f[_0x5029('0x45')]);_0xfcb7b1[_0x5029('0x41')]=_['intersection'](_0x1f226f[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x3fc907[_0x5029('0x45')]['fields']));_0xfcb7b1[_0x5029('0x41')]=_0xfcb7b1[_0x5029('0x41')]['length']?_0xfcb7b1[_0x5029('0x41')]:_0x1f226f[_0x5029('0x54')];_0xfcb7b1[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x3fc907[_0x5029('0x45')][_0x5029('0xca')]);_0xfcb7b1[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x3fc907[_0x5029('0x45')],_0x1f226f[_0x5029('0x59')]));if(_0x3fc907[_0x5029('0x45')][_0x5029('0x3b')]){_0xfcb7b1[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0xfcb7b1[_0x5029('0x3d')],{'$or':_['map'](_0xfcb7b1['attributes'],function(_0x3c42fd){var _0x3e1422={};_0x3e1422[_0x3c42fd]={'$like':'%'+_0x3fc907[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x3e1422;})});}_0xfcb7b1=_[_0x5029('0xcc')]({},_0xfcb7b1,_0x3fc907[_0x5029('0x5c')]);return _0x37e022[_0x5029('0x142')](_0xfcb7b1);}})['then'](function(_0x3c4deb){if(_0x3c4deb){_0x446d1f=_0x3c4deb['length'];if(!_0x3fc907[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0xfcb7b1['limit']=qs[_0x5029('0x1d')](_0x3fc907[_0x5029('0x45')][_0x5029('0x1d')]);_0xfcb7b1['offset']=qs[_0x5029('0x1f')](_0x3fc907['query'][_0x5029('0x1f')]);}return _0x37e022[_0x5029('0x142')](_0xfcb7b1);}})[_0x5029('0x24')](function(_0x45c446){if(_0x45c446){return _0x45c446?{'count':_0x446d1f,'rows':_0x45c446}:null;}})['then'](respondWithResult(_0x47c5c5,null))[_0x5029('0x51')](handleError(_0x47c5c5,null));};exports[_0x5029('0x143')]=function(_0x576dca,_0xdc0ce1){return db['User'][_0x5029('0x30')]({'where':{'id':_0x576dca[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0xdc0ce1,null))['then'](function(_0x5514be){if(_0x5514be){return _0x5514be[_0x5029('0x143')](_0x576dca[_0x5029('0x5d')][_0x5029('0x61')],_[_0x5029('0x60')](_0x576dca[_0x5029('0x5d')],[_0x5029('0x61'),'id'])||{});}})[_0x5029('0x24')](respondWithResult(_0xdc0ce1,null))['catch'](handleError(_0xdc0ce1,null));};exports[_0x5029('0x144')]=function(_0x40d968,_0x529a20){return db[_0x5029('0x35')]['find']({'where':{'id':_0x40d968[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x529a20,null))[_0x5029('0x24')](function(_0x396cad){if(_0x396cad){return _0x396cad[_0x5029('0x144')](_0x40d968[_0x5029('0x45')][_0x5029('0x61')]);}})[_0x5029('0x24')](respondWithStatusCode(_0x529a20,null))['catch'](handleError(_0x529a20,null));};exports[_0x5029('0x145')]=function(_0x184db4,_0xca7afb){var _0x590a03={};var _0x701225={};var _0x405ea9;var _0x30a623;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x184db4[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0xca7afb,null))[_0x5029('0x24')](function(_0x2b7715){if(_0x2b7715){_0x405ea9=_0x2b7715;_0x701225[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0x146')][_0x5029('0x36')]);_0x701225[_0x5029('0x45')]=_['keys'](_0x184db4[_0x5029('0x45')]);_0x701225['filters']=_[_0x5029('0x5a')](_0x701225[_0x5029('0x54')],_0x701225[_0x5029('0x45')]);_0x590a03['attributes']=_['intersection'](_0x701225[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x184db4['query'][_0x5029('0x5b')]));_0x590a03[_0x5029('0x41')]=_0x590a03[_0x5029('0x41')][_0x5029('0x48')]?_0x590a03[_0x5029('0x41')]:_0x701225['model'];_0x590a03[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x184db4[_0x5029('0x45')]['sort']);_0x590a03[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x184db4[_0x5029('0x45')],_0x701225['filters']));if(_0x184db4[_0x5029('0x45')][_0x5029('0x3b')]){_0x590a03[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x590a03[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x590a03['attributes'],function(_0x331489){var _0x294589={};_0x294589[_0x331489]={'$like':'%'+_0x184db4[_0x5029('0x45')]['filter']+'%'};return _0x294589;})});}_0x590a03=_[_0x5029('0xcc')]({},_0x590a03,_0x184db4[_0x5029('0x5c')]);return _0x405ea9[_0x5029('0x145')](_0x590a03);}})[_0x5029('0x24')](function(_0x5cf2be){if(_0x5cf2be){_0x30a623=_0x5cf2be[_0x5029('0x48')];if(!_0x184db4[_0x5029('0x45')][_0x5029('0xcd')](_0x5029('0xd3'))){_0x590a03[_0x5029('0x1d')]=qs['limit'](_0x184db4[_0x5029('0x45')][_0x5029('0x1d')]);_0x590a03[_0x5029('0x1f')]=qs['offset'](_0x184db4[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x405ea9[_0x5029('0x145')](_0x590a03);}})[_0x5029('0x24')](function(_0x52b4f9){if(_0x52b4f9){return _0x52b4f9?{'count':_0x30a623,'rows':_0x52b4f9}:null;}})[_0x5029('0x24')](respondWithResult(_0xca7afb,null))['catch'](handleError(_0xca7afb,null));};exports[_0x5029('0x147')]=function(_0x36fdaf,_0x3952d8){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x36fdaf[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x3952d8,null))[_0x5029('0x24')](function(_0x2a0a92){if(_0x2a0a92){return _0x2a0a92[_0x5029('0x147')](_0x36fdaf[_0x5029('0x5d')][_0x5029('0x61')],_[_0x5029('0x60')](_0x36fdaf[_0x5029('0x5d')],['ids','id'])||{});}})[_0x5029('0x24')](respondWithResult(_0x3952d8,null))[_0x5029('0x51')](handleError(_0x3952d8,null));};exports[_0x5029('0x148')]=function(_0x5bff6b,_0x337164){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x5bff6b[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x337164,null))[_0x5029('0x24')](function(_0x124ed8){if(_0x124ed8){return _0x124ed8[_0x5029('0x148')](_0x5bff6b['query'][_0x5029('0x61')]);}})[_0x5029('0x24')](respondWithStatusCode(_0x337164,null))[_0x5029('0x51')](handleError(_0x337164,null));};exports[_0x5029('0x149')]=function(_0x17bd16,_0x1fe901){var _0x1dc3b2={};var _0x28f17b={};var _0x376847;var _0x4b0f33;return db['User']['findOne']({'where':{'id':_0x17bd16[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x1fe901,null))[_0x5029('0x24')](function(_0x23f13d){if(_0x23f13d){_0x376847=_0x23f13d;_0x28f17b[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0x14a')][_0x5029('0x36')]);_0x28f17b[_0x5029('0x45')]=_['keys'](_0x17bd16[_0x5029('0x45')]);_0x28f17b['filters']=_[_0x5029('0x5a')](_0x28f17b[_0x5029('0x54')],_0x28f17b[_0x5029('0x45')]);_0x1dc3b2[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x28f17b['model'],qs['fields'](_0x17bd16[_0x5029('0x45')][_0x5029('0x5b')]));_0x1dc3b2[_0x5029('0x41')]=_0x1dc3b2[_0x5029('0x41')][_0x5029('0x48')]?_0x1dc3b2[_0x5029('0x41')]:_0x28f17b[_0x5029('0x54')];_0x1dc3b2[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x17bd16[_0x5029('0x45')][_0x5029('0xca')]);_0x1dc3b2[_0x5029('0x3d')]=qs[_0x5029('0x59')](_[_0x5029('0xcb')](_0x17bd16['query'],_0x28f17b['filters']));if(_0x17bd16[_0x5029('0x45')]['filter']){_0x1dc3b2[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x1dc3b2[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x1dc3b2[_0x5029('0x41')],function(_0x3a198f){var _0x15cd7c={};_0x15cd7c[_0x3a198f]={'$like':'%'+_0x17bd16[_0x5029('0x45')]['filter']+'%'};return _0x15cd7c;})});}_0x1dc3b2=_['merge']({},_0x1dc3b2,_0x17bd16['options']);return _0x376847['getWhatsappAccounts'](_0x1dc3b2);}})[_0x5029('0x24')](function(_0x553c98){if(_0x553c98){_0x4b0f33=_0x553c98[_0x5029('0x48')];if(!_0x17bd16[_0x5029('0x45')]['hasOwnProperty'](_0x5029('0xd3'))){_0x1dc3b2[_0x5029('0x1d')]=qs['limit'](_0x17bd16[_0x5029('0x45')][_0x5029('0x1d')]);_0x1dc3b2['offset']=qs[_0x5029('0x1f')](_0x17bd16[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x376847['getWhatsappAccounts'](_0x1dc3b2);}})['then'](function(_0x4606c6){if(_0x4606c6){return _0x4606c6?{'count':_0x4b0f33,'rows':_0x4606c6}:null;}})[_0x5029('0x24')](respondWithResult(_0x1fe901,null))[_0x5029('0x51')](handleError(_0x1fe901,null));};exports['addWhatsappAccounts']=function(_0x304a15,_0x1996eb){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x304a15[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x1996eb,null))[_0x5029('0x24')](function(_0x3a5c39){if(_0x3a5c39){return _0x3a5c39['addWhatsappAccounts'](_0x304a15[_0x5029('0x5d')][_0x5029('0x61')],_[_0x5029('0x60')](_0x304a15[_0x5029('0x5d')],[_0x5029('0x61'),'id'])||{});}})['then'](respondWithResult(_0x1996eb,null))['catch'](handleError(_0x1996eb,null));};exports[_0x5029('0x14b')]=function(_0x35239c,_0xf1b5da){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x35239c[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0xf1b5da,null))['then'](function(_0x34e994){if(_0x34e994){return _0x34e994['removeWhatsappAccounts'](_0x35239c['query'][_0x5029('0x61')]);}})[_0x5029('0x24')](respondWithStatusCode(_0xf1b5da,null))[_0x5029('0x51')](handleError(_0xf1b5da,null));};exports['getSquareProjects']=function(_0x119bb3,_0x33b674){var _0x4767da={};var _0x120f32={};var _0x36de36;var _0x341db5;return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x119bb3[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x33b674,null))[_0x5029('0x24')](function(_0x801214){if(_0x801214){_0x36de36=_0x801214;_0x120f32[_0x5029('0x54')]=_[_0x5029('0x56')](db[_0x5029('0x14c')][_0x5029('0x36')]);_0x120f32[_0x5029('0x45')]=_[_0x5029('0x56')](_0x119bb3[_0x5029('0x45')]);_0x120f32[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x120f32[_0x5029('0x54')],_0x120f32[_0x5029('0x45')]);_0x4767da[_0x5029('0x41')]=_[_0x5029('0x5a')](_0x120f32['model'],qs[_0x5029('0x5b')](_0x119bb3['query']['fields']));_0x4767da[_0x5029('0x41')]=_0x4767da['attributes']['length']?_0x4767da[_0x5029('0x41')]:_0x120f32[_0x5029('0x54')];_0x4767da[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x119bb3[_0x5029('0x45')][_0x5029('0xca')]);_0x4767da['where']=qs['filters'](_['pick'](_0x119bb3['query'],_0x120f32[_0x5029('0x59')]));if(_0x119bb3[_0x5029('0x45')][_0x5029('0x3b')]){_0x4767da[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x4767da[_0x5029('0x3d')],{'$or':_['map'](_0x4767da[_0x5029('0x41')],function(_0xde78c){var _0x58d307={};_0x58d307[_0xde78c]={'$like':'%'+_0x119bb3[_0x5029('0x45')][_0x5029('0x3b')]+'%'};return _0x58d307;})});}_0x4767da=_[_0x5029('0xcc')]({},_0x4767da,_0x119bb3[_0x5029('0x5c')]);return _0x36de36[_0x5029('0x14d')](_0x4767da);}})[_0x5029('0x24')](function(_0x6e6074){if(_0x6e6074){_0x341db5=_0x6e6074['length'];if(!_0x119bb3[_0x5029('0x45')]['hasOwnProperty'](_0x5029('0xd3'))){_0x4767da[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x119bb3['query'][_0x5029('0x1d')]);_0x4767da[_0x5029('0x1f')]=qs[_0x5029('0x1f')](_0x119bb3[_0x5029('0x45')][_0x5029('0x1f')]);}return _0x36de36['getSquareProjects'](_0x4767da);}})['then'](function(_0x287a9f){if(_0x287a9f){return _0x287a9f?{'count':_0x341db5,'rows':_0x287a9f}:null;}})[_0x5029('0x24')](respondWithResult(_0x33b674,null))[_0x5029('0x51')](handleError(_0x33b674,null));};exports['addSquareProjects']=function(_0x94eda1,_0x3914cd){return db[_0x5029('0x35')]['find']({'where':{'id':_0x94eda1[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x3914cd,null))[_0x5029('0x24')](function(_0x643d0f){if(_0x643d0f){return _0x643d0f[_0x5029('0x14e')](_0x94eda1[_0x5029('0x5d')][_0x5029('0x61')],_[_0x5029('0x60')](_0x94eda1[_0x5029('0x5d')],[_0x5029('0x61'),'id'])||{});}})[_0x5029('0x24')](respondWithResult(_0x3914cd,null))[_0x5029('0x51')](handleError(_0x3914cd,null));};exports['removeSquareProjects']=function(_0xfb38ec,_0x34d377){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0xfb38ec['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x34d377,null))[_0x5029('0x24')](function(_0x33266b){if(_0x33266b){return _0x33266b[_0x5029('0x14f')](_0xfb38ec[_0x5029('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x34d377,null))[_0x5029('0x51')](handleError(_0x34d377,null));};exports[_0x5029('0x150')]=function(_0x538e5d,_0x155449){var _0x38f61b={},_0xf8c335={},_0x5bbea9={'count':0x0,'rows':[]};var _0x3b60b0=db[_0x5029('0x151')]['rawAttributes'];_0xf8c335[_0x5029('0x54')]=_[_0x5029('0x56')](_0x3b60b0);_0xf8c335[_0x5029('0x45')]=_['keys'](_0x538e5d['query']);_0xf8c335['filters']=_[_0x5029('0x5a')](_0xf8c335['model'],_0xf8c335['query']);_0xf8c335[_0x5029('0x59')]=_[_0x5029('0xf7')](_0xf8c335[_0x5029('0x59')],[_0x5029('0x152'),_0x5029('0x153'),_0x5029('0x154'),'$gte',_0x5029('0x155'),_0x5029('0x156'),_0x5029('0x157'),_0x5029('0x158'),_0x5029('0x159'),_0x5029('0x15a'),'$notBetween',_0x5029('0x15b'),_0x5029('0x15c'),_0x5029('0x15d'),_0x5029('0x15e'),_0x5029('0x15f'),_0x5029('0x160'),_0x5029('0x15d'),_0x5029('0x161'),'$contains',_0x5029('0x162'),_0x5029('0x163')]);_0x38f61b[_0x5029('0x41')]=_[_0x5029('0x5a')](_0xf8c335[_0x5029('0x54')],qs[_0x5029('0x5b')](_0x538e5d['query'][_0x5029('0x5b')]));_0x38f61b[_0x5029('0x41')]=_0x38f61b[_0x5029('0x41')]['length']?_0x38f61b['attributes']:_0xf8c335['model'];if(!_0x538e5d[_0x5029('0x45')][_0x5029('0xcd')]('nolimit')){_0x38f61b[_0x5029('0x1d')]=qs['limit'](_0x538e5d[_0x5029('0x45')][_0x5029('0x1d')]);_0x38f61b[_0x5029('0x1f')]=qs['offset'](_0x538e5d['query']['offset']);}_0x38f61b[_0x5029('0xd8')]=qs[_0x5029('0xca')](_0x538e5d[_0x5029('0x45')]['sort']);_0x38f61b[_0x5029('0x3d')]=qs[_0x5029('0x59')](_['pick'](_0x538e5d[_0x5029('0x45')],_0xf8c335['filters']));if(_0x538e5d[_0x5029('0x45')][_0x5029('0x3b')]){_0x38f61b[_0x5029('0x3d')]=_[_0x5029('0xcc')](_0x38f61b[_0x5029('0x3d')],{'$or':_[_0x5029('0x37')](_0x38f61b[_0x5029('0x41')],function(_0x3d7d1e){var _0x54d5d4={};_0x54d5d4[_0x3d7d1e]={'$like':'%'+_0x538e5d[_0x5029('0x45')]['filter']+'%'};return _0x54d5d4;})});}_0x38f61b[_0x5029('0x3d')]={'$and':[_0x38f61b[_0x5029('0x3d')],{'$or':[{'UserId':_0x538e5d[_0x5029('0x53')]['id']},{'OwnerId':_0x538e5d[_0x5029('0x53')]['id']}]}]};_0x38f61b=_[_0x5029('0xcc')]({},_0x38f61b,_0x538e5d[_0x5029('0x5c')]);var _0xc768f2={'where':_0x38f61b[_0x5029('0x3d')]};return db[_0x5029('0x151')][_0x5029('0x3e')](_0xc768f2)['then'](function(_0x1d37a4){_0x5bbea9[_0x5029('0x3e')]=_0x1d37a4;if(_0x538e5d[_0x5029('0x45')][_0x5029('0x3f')]){_0x38f61b[_0x5029('0x40')]=[{'attributes':['id',_0x5029('0x164'),_0x5029('0x165'),_0x5029('0x166')],'model':db['CmContact'],'as':_0x5029('0x167')},{'attributes':['id',_0x5029('0x31'),_0x5029('0x168')],'model':db[_0x5029('0x169')],'as':_0x5029('0xd5')}];}return db[_0x5029('0x151')][_0x5029('0x43')](_0x38f61b);})['then'](function(_0x4e9d77){_0x5bbea9['rows']=_0x4e9d77;return _0x5bbea9;})[_0x5029('0x24')](respondWithFilteredResult(_0x155449,_0x38f61b))[_0x5029('0x51')](handleError(_0x155449,null));};exports[_0x5029('0x16a')]=function(_0x74d296,_0x5bdecb){if(!_[_0x5029('0x66')](_0x74d296[_0x5029('0x29')]['id'])&&(_0x74d296['user'][_0x5029('0x26')]==_0x5029('0x27')||_0x74d296[_0x5029('0x29')]['role']==_0x5029('0x29'))){return db[_0x5029('0x35')][_0x5029('0x97')]({'where':{'id':_0x74d296[_0x5029('0x53')]['id']},'raw':!![]})[_0x5029('0x24')](function(_0x104e96){return authService[_0x5029('0x16b')](_0x104e96);})['then'](function(_0x2b436c){if(_0x2b436c){return _0x5bdecb[_0x5029('0x1b')](0xc8)[_0x5029('0x1c')]({'api_key':_0x2b436c[_0x5029('0x16c')]});}else{return _0x5bdecb[_0x5029('0x1b')](0xcc)[_0x5029('0x1c')]({'message':_0x5029('0x16d')});}})['catch'](handleError(_0x5bdecb,0x193));}else{return _0x5bdecb[_0x5029('0x1b')](0x191)[_0x5029('0x1c')]({'message':_0x5029('0x16e')});}};exports[_0x5029('0x16f')]=function(_0x549be6,_0xeb508a){if(!_[_0x5029('0x66')](_0x549be6[_0x5029('0x29')]['id'])&&(_0x549be6[_0x5029('0x29')]['role']==_0x5029('0x27')||_0x549be6[_0x5029('0x29')]['role']==_0x5029('0x29'))){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x549be6[_0x5029('0x53')]['id']}})[_0x5029('0x24')](function(_0x17ce5c){return authService[_0x5029('0x170')](_0x17ce5c);})[_0x5029('0x24')](function(_0x2382d6){return db[_0x5029('0x35')][_0x5029('0x22')]({'apiKeyIat':_0x2382d6[_0x5029('0x171')],'apiKeyNonce':_0x2382d6[_0x5029('0x172')]},{'where':{'id':_0x549be6['params']['id']}})[_0x5029('0x24')](function(){return _0xeb508a[_0x5029('0x1b')](0xc8)[_0x5029('0x1c')]({'api_key':_0x2382d6['token']});});})[_0x5029('0x51')](handleError(_0xeb508a,0x193));}else{return _0xeb508a[_0x5029('0x1b')](0x191)[_0x5029('0x1c')]({'message':_0x5029('0x16e')});}};exports['removeApiKey']=function(_0x79003a,_0x340280){if(!_[_0x5029('0x66')](_0x79003a[_0x5029('0x29')]['id'])&&(_0x79003a['user'][_0x5029('0x26')]==_0x5029('0x27')||_0x79003a[_0x5029('0x29')][_0x5029('0x26')]==_0x5029('0x29'))){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x79003a[_0x5029('0x53')]['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x340280,null))[_0x5029('0x24')](function(_0x4be181){if(_0x4be181&&_0x4be181[_0x5029('0x173')]&&_0x4be181[_0x5029('0x174')])return _0x4be181;else throw{'message':_0x5029('0x175')};})[_0x5029('0x24')](function(_0x1f1048){return db[_0x5029('0x35')][_0x5029('0x22')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x79003a['params']['id']}});})[_0x5029('0x24')](respondWithStatusCode(_0x340280,0xc8))[_0x5029('0x51')](handleError(_0x340280,0x193));}else{return _0x340280['status'](0x191)[_0x5029('0x1c')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x5029('0x176')]=function(_0x2bad01,_0x6c4394){var _0x223b69=_0x2bad01[_0x5029('0x29')][_0x5029('0x25')]({'plain':!![]});if(!_0x223b69){return _0x6c4394['status'](0x191)[_0x5029('0x34')](_0x5029('0x177'));}else{return _0x6c4394[_0x5029('0x1b')](0xc8)['json'](_0x223b69);}};exports[_0x5029('0x178')]=function(_0x11c5bc,_0x39dd27){var _0x4dac20={'offset':0x0},_0xcfc6c={'count':0x0,'rows':[]};Promise[_0x5029('0xf8')]()[_0x5029('0x24')](function(){if(!_0x11c5bc[_0x5029('0x45')][_0x5029('0x3b')]&&!_0x11c5bc['query'][_0x5029('0x179')]&&!_0x11c5bc[_0x5029('0x45')][_0x5029('0x17a')])return[];return Promise[_0x5029('0xf8')]()[_0x5029('0x24')](function(){var _0x5a306f=[];if(!_[_0x5029('0x8a')](_0x11c5bc[_0x5029('0x45')][_0x5029('0x179')])){_0x5a306f[_0x5029('0x42')](db[_0x5029('0x108')][_0x5029('0x43')]({'attributes':['id',_0x5029('0x31')],'where':{'id':_0x11c5bc[_0x5029('0x45')][_0x5029('0x179')]}}));}if(!_[_0x5029('0x8a')](_0x11c5bc[_0x5029('0x45')][_0x5029('0x17a')])){_0x5a306f[_0x5029('0x42')](db[_0x5029('0x169')][_0x5029('0x43')]({'attributes':['id',_0x5029('0x31')],'type':'inbound','where':{'id':_0x11c5bc[_0x5029('0x45')][_0x5029('0x17a')]}}));}return Promise['all'](_0x5a306f);})['then'](function(_0x12387a){var _0x103838=_[_0x5029('0x17b')](_0x12387a)[_0x5029('0x37')](function(_0x31f71a){return _0x31f71a['getAgents']({'attributes':['id',_0x5029('0x31'),_0x5029('0x68'),'online'],'raw':!![]});});return Promise['all'](_0x103838);})['then'](function(_0x2b54c9){var _0x3211f9=_[_0x5029('0x17b')](_0x2b54c9);if(!_0x11c5bc['query']['filter'])return _0x3211f9;if(_[_0x5029('0x8a')](_0x3211f9)){return db['User'][_0x5029('0x43')]({'attributes':['id','name',_0x5029('0x68'),_0x5029('0x9f')],'where':{'role':_0x5029('0x2b'),'$or':[db[_0x5029('0x6a')][_0x5029('0x3d')](db[_0x5029('0x6a')]['fn'](_0x5029('0x17c'),db[_0x5029('0x6a')][_0x5029('0x17d')](_0x5029('0x31'))),{'$like':'%'+_0x11c5bc[_0x5029('0x45')]['filter'][_0x5029('0xa5')]()+'%'}),{'internal':{'$like':'%'+_0x11c5bc[_0x5029('0x45')][_0x5029('0x3b')]+'%'}}]},'raw':!![]});}else{return _(_0x3211f9)[_0x5029('0x17b')]()[_0x5029('0x3b')](function(_0x4aea47){return _0x4aea47['name'][_0x5029('0xa5')]()['includes'](_0x11c5bc['query'][_0x5029('0x3b')][_0x5029('0xa5')]())||_0x4aea47['internal'][_0x5029('0x17e')]()[_0x5029('0x2f')](_0x11c5bc[_0x5029('0x45')]['filter']);})['value']();}})[_0x5029('0x24')](function(_0x2e72aa){var _0x286562=_0x5029('0x31');var _0x3acc96='asc';if(_0x11c5bc['query']['sort']){var _0x3acc96=_0x11c5bc[_0x5029('0x45')][_0x5029('0xca')][0x0]==='-'?_0x5029('0x17f'):'asc';var _0x286562=_0x3acc96==='asc'?_0x11c5bc['query'][_0x5029('0xca')]:_0x11c5bc[_0x5029('0x45')][_0x5029('0xca')]['substring'](0x1);}return _(_0x2e72aa)['uniqBy']('id')[_0x5029('0x180')]([function(_0x1e4219){return _0x286562==='name'?_0x1e4219[_0x286562][_0x5029('0xa5')]():_0x1e4219[_0x286562];}],[_0x3acc96])[_0x5029('0x37')](function(_0x5a4238){return _[_0x5029('0xcb')](_0x5a4238,['id',_0x5029('0x31'),_0x5029('0x68'),_0x5029('0x9f')]);})[_0x5029('0x2e')]();})[_0x5029('0x24')](function(_0x335c7e){return client[_0x5029('0xf')](_0x5029('0x2a'),_0x11c5bc)[_0x5029('0x24')](function(_0xb159ff){if(_0xb159ff['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x49f101=_0xb159ff[_0x5029('0x181')];var _0x1708cd=jayson[_0x5029('0xd')][_0x5029('0xe')]({'port':0x232c});return _0x1708cd[_0x5029('0xf')](_0x5029('0x2a'),_0x11c5bc)[_0x5029('0x24')](function(_0x587b7a){if(_0x587b7a['error'])throw new Error(_0x5029('0x182'));var _0x11ea63=_0x587b7a[_0x5029('0x181')];return _['merge']({},_0x11ea63,_0x49f101);});})[_0x5029('0x24')](function(_0x24ab84){return _[_0x5029('0x37')](_0x335c7e,function(_0x551cf3){var _0x2184a5=_[_0x5029('0x30')](_0x24ab84[_0x5029('0x44')],['id',_0x551cf3['id']]);if(!_0x2184a5||!_0x551cf3['online']){_0x551cf3['status']=_0x5029('0x183');}else if(_0x2184a5['voicePause']){_0x551cf3[_0x5029('0x1b')]=_0x5029('0xfb');}else{_0x551cf3[_0x5029('0x1b')]=_[_0x5029('0x2f')](['idle','unknown',_0x5029('0x184'),'ringing',null,undefined],_0x2184a5[_0x5029('0x185')])?_0x5029('0x9f'):_0x5029('0x186');}return _0x551cf3;});});});})[_0x5029('0x24')](function(_0x518061){if(!_0x11c5bc[_0x5029('0x45')]['hasOwnProperty'](_0x5029('0xd3'))){_0x4dac20[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x11c5bc[_0x5029('0x45')][_0x5029('0x1d')]||0xa);_0x4dac20['offset']=qs[_0x5029('0x1f')](_0x11c5bc[_0x5029('0x45')]['offset']);}_0xcfc6c['count']=_0x518061[_0x5029('0x48')];_0xcfc6c['rows']=_0x4dac20['limit']?_0x518061['slice'](_0x4dac20[_0x5029('0x1f')],_0x4dac20[_0x5029('0x1f')]+_0x4dac20[_0x5029('0x1d')]):_0x518061;return _0xcfc6c;})[_0x5029('0x24')](respondWithFilteredResult(_0x39dd27,_0x4dac20))[_0x5029('0x51')](handleError(_0x39dd27,null));};function get_open_tabs(_0x40d828,_0x2a9aa8){var _0x597f46=_0x40d828[_0x5029('0x187')](0x0)[_0x5029('0x188')]()+_0x40d828[_0x5029('0x189')](0x1);var _0x59baf7={'type':db[_0x5029('0x8e')][_0x5029('0x6b')]['SELECT'],'raw':!![]};return new BPromise(function(_0x2234dc,_0x2766fb){var _0x16b988=squel[_0x5029('0x18a')]()[_0x5029('0x18b')](_0x5029('0x18c')+_0x597f46+_0x5029('0x18d'),'id')['field']('ui.createdAt')[_0x5029('0x6d')]('user_has_'+_0x40d828+'_interactions','ui')[_0x5029('0x3d')](_0x5029('0x18e'),_0x2a9aa8['id']);return db[_0x5029('0x6a')][_0x5029('0x45')](_0x16b988['toString'](),_0x59baf7)[_0x5029('0x24')](function(_0x3128a5){_0x2a9aa8[_0x597f46+'OpenTabs']=_0x3128a5;_0x2234dc(_0x3128a5);})['catch'](function(_0x3bc22d){_0x2766fb(_0x3bc22d);});});};
\ No newline at end of file
+var _0xd117=['register','defaults','localhost','http','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','json','offset','limit','count','set','update','get','Users','Agents','agent','Telephones','map','value','includes','role','destroy','stack','name','send','index','rawAttributes','fieldName','key','filter','salt','where','User','query','include','attributes','push','rows','openTabs','true','chat','dataValues','sms','whatsapp','all','params','model','differenceBy','keys','password','filters','intersection','fields','includeAll','merge','options','find','openchannel','mail','body','describe','addContacts','omit','ids','internal','Setting','findById','securePassword','max','isNil','min_internal','sequelize','QueryTypes','SELECT','length','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','103','104','105','106','107','108','100','114','115','create','user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','bulkCreate','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','each','telephone','isEmpty','some','compact','UserProfileResource','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','findAll','format','UserVoiceQueueRt','upsert','isValidChannel','Unknown\x20channel','remove','Queue:remove','addAvatar','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','fax','ChatOpenTabs','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','order','sort','pick','CmList','Tag','color','tag','Queue','Unknown\x20role','hasOwnProperty','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','concat','logout','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','Pause','getTeams','Team','addTeams','Voice','setDataValue','Chat','getMailQueues','getSmsQueues','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','VoicePrefixId','removeTeams','getChatQueues','Mail','removeAgent','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$eq','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','lastName','Contact','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','token','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','resolve','teams','queues','VoiceQueue','inbound','flatten','lower','col','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','ringing','busy','slice','toUpperCase','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./user.socket'];(function(_0x52b56c,_0x3f700e){var _0x391621=function(_0x210dee){while(--_0x210dee){_0x52b56c['push'](_0x52b56c['shift']());}};_0x391621(++_0x3f700e);}(_0xd117,0x182));var _0x7d11=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xd117[_0x11005e];return _0x29338f;};'use strict';var moment=require(_0x7d11('0x0'));var BPromise=require(_0x7d11('0x1'));var util=require(_0x7d11('0x2'));var path=require(_0x7d11('0x3'));var fs=require('fs');var _=require(_0x7d11('0x4'));var squel=require(_0x7d11('0x5'));var jayson=require(_0x7d11('0x6'));var Redis=require(_0x7d11('0x7'));var authService=require(_0x7d11('0x8'));var qs=require(_0x7d11('0x9'));var logger=require(_0x7d11('0xa'))(_0x7d11('0xb'));var utils=require(_0x7d11('0xc'));var config=require(_0x7d11('0xd'));var licenseUtil=require(_0x7d11('0xe'));var db=require(_0x7d11('0xf'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x7d11('0x10')]));require(_0x7d11('0x11'))[_0x7d11('0x12')](socket);config['redis']=_[_0x7d11('0x13')](config[_0x7d11('0x10')],{'host':_0x7d11('0x14'),'port':0x18eb});var client=jayson['client'][_0x7d11('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x48b0f1,_0x58a6fd,_0xb15984,_0x5c6d5d){return new BPromise(function(_0x4a8668,_0xc52a95){var _0x48f576=_0x5c6d5d||client;return _0x48f576[_0x7d11('0x16')](_0x48b0f1,_0xb15984)[_0x7d11('0x17')](function(_0x5ee572){logger[_0x7d11('0x18')](_0x7d11('0x19'),_0x58a6fd,'request\x20sent');logger[_0x7d11('0x1a')](_0x7d11('0x1b'),_0x58a6fd,_0x7d11('0x1c'),JSON[_0x7d11('0x1d')](_0x5ee572));if(_0x5ee572[_0x7d11('0x1e')]){if(_0x5ee572[_0x7d11('0x1e')][_0x7d11('0x1f')]===0x1f4){logger[_0x7d11('0x1e')]('User,\x20%s,\x20%s',_0x58a6fd,_0x5ee572[_0x7d11('0x1e')][_0x7d11('0x20')]);return _0xc52a95(_0x5ee572[_0x7d11('0x1e')][_0x7d11('0x20')]);}logger[_0x7d11('0x1e')]('User,\x20%s,\x20%s',_0x58a6fd,_0x5ee572[_0x7d11('0x1e')][_0x7d11('0x20')]);return _0x4a8668(_0x5ee572['error']['message']);}else{logger[_0x7d11('0x18')]('User,\x20%s,\x20%s',_0x58a6fd,_0x7d11('0x1c'));_0x4a8668(_0x5ee572['result'][_0x7d11('0x20')]);}})[_0x7d11('0x21')](function(_0x328f8e){logger[_0x7d11('0x1e')](_0x7d11('0x19'),_0x58a6fd,_0x328f8e);_0xc52a95(_0x328f8e);});});}function respondWithStatusCode(_0x117bb9,_0x4297f8){_0x4297f8=_0x4297f8||0xcc;return function(_0x3d2574){if(_0x3d2574){return _0x117bb9['sendStatus'](_0x4297f8);}return _0x117bb9[_0x7d11('0x22')](_0x4297f8)['end']();};}function respondWithResult(_0x58455b,_0x5c3898){_0x5c3898=_0x5c3898||0xc8;return function(_0x27a818){if(_0x27a818){return _0x58455b[_0x7d11('0x22')](_0x5c3898)[_0x7d11('0x23')](_0x27a818);}};}function respondWithFilteredResult(_0x1a7853,_0x355d14){return function(_0xd938df){if(_0xd938df){var _0x282e5c=typeof _0x355d14[_0x7d11('0x24')]==='undefined'&&typeof _0x355d14[_0x7d11('0x25')]==='undefined';var _0x4bfa76=_0xd938df['count'];var _0x3ba092=_0x282e5c?0x0:_0x355d14['offset'];var _0x180e1e=_0x282e5c?_0xd938df[_0x7d11('0x26')]:_0x355d14[_0x7d11('0x24')]+_0x355d14['limit'];var _0x46f76a;if(_0x180e1e>=_0x4bfa76){_0x180e1e=_0x4bfa76;_0x46f76a=0xc8;}else{_0x46f76a=0xce;}_0x1a7853[_0x7d11('0x22')](_0x46f76a);return _0x1a7853[_0x7d11('0x27')]('Content-Range',_0x3ba092+'-'+_0x180e1e+'/'+_0x4bfa76)[_0x7d11('0x23')](_0xd938df);}return null;};}function saveUpdates(_0x35a789){return function(_0x18c049){if(_0x18c049){return _0x18c049[_0x7d11('0x28')](_0x35a789)['then'](function(_0x1a7745){return _0x1a7745;});}return null;};}function removeEntity(_0x512f7f){return function(_0x1bc218){if(_0x1bc218){return _0x1bc218['destroy']()[_0x7d11('0x17')](function(){var _0xba4e80=_0x1bc218[_0x7d11('0x29')]({'plain':!![]});if(_0xba4e80['role']==='admin')return;var _0x8e0a53=[{'name':_0x7d11('0x2a'),'value':'user','ignore':!![]},{'name':_0x7d11('0x2b'),'value':_0x7d11('0x2c'),'ignore':![]},{'name':_0x7d11('0x2d'),'value':'telephone','ignore':![]}];var _0x9c6609=_(_0x8e0a53)['filter']('ignore')[_0x7d11('0x2e')]('value')[_0x7d11('0x2f')]();if(_[_0x7d11('0x30')](_0x9c6609,_0xba4e80[_0x7d11('0x31')])){return;}var _0x35b997=_['find'](_0x8e0a53,[_0x7d11('0x2f'),_0xba4e80[_0x7d11('0x31')]])['name'];return db['UserProfileResource'][_0x7d11('0x32')]({'where':{'type':_0x35b997,'resourceId':_0xba4e80['id']}})[_0x7d11('0x17')](function(){return _0x1bc218;});})['then'](function(){_0x512f7f[_0x7d11('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c0113){return function(_0x1286d6){if(!_0x1286d6){_0x5c0113['sendStatus'](0x194);}return _0x1286d6;};}function handleError(_0x4e53be,_0x3414cd){_0x3414cd=_0x3414cd||0x1f4;return function(_0x30e2fa){logger[_0x7d11('0x1e')](_0x30e2fa[_0x7d11('0x33')]);if(_0x30e2fa[_0x7d11('0x34')]){delete _0x30e2fa[_0x7d11('0x34')];}_0x4e53be[_0x7d11('0x22')](_0x3414cd)[_0x7d11('0x35')](_0x30e2fa);};}exports[_0x7d11('0x36')]=function(_0x16cf5d,_0x1a9f18){var _0x779731={},_0x5d2305={'count':0x0,'rows':[]};var _0x157731=_(db['User'][_0x7d11('0x37')])[_0x7d11('0x2e')](function(_0x36be62){return{'name':_0x36be62[_0x7d11('0x38')],'type':_0x36be62['type'][_0x7d11('0x39')]};})[_0x7d11('0x3a')](function(_0x19284){return!_[_0x7d11('0x30')](['password',_0x7d11('0x3b')],_0x19284['name']);})[_0x7d11('0x2f')]();_0x779731=qs['getOptions'](_0x157731,_0x16cf5d);var _0xede1cc={'where':_0x779731[_0x7d11('0x3c')]};return db[_0x7d11('0x3d')][_0x7d11('0x26')](_0xede1cc)['then'](function(_0x57b827){_0x5d2305[_0x7d11('0x26')]=_0x57b827;if(_0x16cf5d[_0x7d11('0x3e')]['includeAll']){_0x779731[_0x7d11('0x3f')]=[{'all':!![]}];}if(!_[_0x7d11('0x30')](_0x779731[_0x7d11('0x40')],'id')){_0x779731[_0x7d11('0x40')][_0x7d11('0x41')]('id');}return db[_0x7d11('0x3d')]['findAll'](_0x779731);})[_0x7d11('0x17')](function(_0x5cf6a6){_0x5d2305[_0x7d11('0x42')]=_0x5cf6a6;if(_0x16cf5d[_0x7d11('0x3e')][_0x7d11('0x43')]===_0x7d11('0x44')){var _0x2a0c2f=[];for(var _0x29da73=0x0;_0x29da73<_0x5d2305['rows']['length'];_0x29da73++){_0x2a0c2f['push'](get_open_tabs(_0x7d11('0x45'),_0x5d2305[_0x7d11('0x42')][_0x29da73][_0x7d11('0x46')]));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x47'),_0x5d2305['rows'][_0x29da73][_0x7d11('0x46')]));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs('fax',_0x5d2305[_0x7d11('0x42')][_0x29da73][_0x7d11('0x46')]));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs('mail',_0x5d2305[_0x7d11('0x42')][_0x29da73][_0x7d11('0x46')]));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs('openchannel',_0x5d2305[_0x7d11('0x42')][_0x29da73]['dataValues']));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x48'),_0x5d2305[_0x7d11('0x42')][_0x29da73][_0x7d11('0x46')]));}return BPromise[_0x7d11('0x49')](_0x2a0c2f)[_0x7d11('0x17')](function(_0x161213){return _0x5d2305;});}else{return _0x5d2305;}})[_0x7d11('0x17')](respondWithFilteredResult(_0x1a9f18,_0x779731))[_0x7d11('0x21')](handleError(_0x1a9f18,null));};exports['show']=function(_0x50d458,_0x49a21c){var _0x10c0e9={'raw':![],'where':{'id':_0x50d458[_0x7d11('0x4a')]['id']}},_0x1e5bb5={};_0x1e5bb5[_0x7d11('0x4b')]=_[_0x7d11('0x4c')](_[_0x7d11('0x4d')](db[_0x7d11('0x3d')][_0x7d11('0x37')]),[_0x7d11('0x4e'),_0x7d11('0x3b')]);_0x1e5bb5[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x50d458['query']);_0x1e5bb5[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x1e5bb5[_0x7d11('0x4b')],_0x1e5bb5['query']);_0x10c0e9['attributes']=_[_0x7d11('0x50')](_0x1e5bb5[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x50d458['query']['fields']));_0x10c0e9[_0x7d11('0x40')]=_0x10c0e9[_0x7d11('0x40')]['length']?_0x10c0e9[_0x7d11('0x40')]:_0x1e5bb5[_0x7d11('0x4b')];if(_0x50d458[_0x7d11('0x3e')][_0x7d11('0x52')]){_0x10c0e9['include']=[{'all':!![]}];}_0x10c0e9=_[_0x7d11('0x53')]({},_0x10c0e9,_0x50d458[_0x7d11('0x54')]);if(!_[_0x7d11('0x30')](_0x10c0e9['attributes'],'id')){_0x10c0e9['attributes'][_0x7d11('0x41')]('id');}return db[_0x7d11('0x3d')][_0x7d11('0x55')](_0x10c0e9)[_0x7d11('0x17')](handleEntityNotFound(_0x49a21c,null))[_0x7d11('0x17')](function(_0x4c7d7a){var _0x46a8e1=[];values=_0x4c7d7a;if(_0x50d458[_0x7d11('0x3e')][_0x7d11('0x43')]===_0x7d11('0x44')){_0x46a8e1['push'](get_open_tabs('chat',_0x4c7d7a[_0x7d11('0x46')]));_0x46a8e1[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x47'),_0x4c7d7a[_0x7d11('0x46')]));_0x46a8e1[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x56'),_0x4c7d7a[_0x7d11('0x46')]));_0x46a8e1[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x48'),_0x4c7d7a[_0x7d11('0x46')]));_0x46a8e1['push'](get_open_tabs('fax',_0x4c7d7a['dataValues']));_0x46a8e1[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x57'),_0x4c7d7a[_0x7d11('0x46')]));return BPromise['all'](_0x46a8e1);}else{return values;}})[_0x7d11('0x17')](function(_0x222375){return values;})[_0x7d11('0x17')](respondWithResult(_0x49a21c,null))[_0x7d11('0x21')](handleError(_0x49a21c,null));};exports[_0x7d11('0x28')]=function(_0x178a3a,_0x505573){if(_0x178a3a[_0x7d11('0x58')]['id']){delete _0x178a3a[_0x7d11('0x58')]['id'];}delete _0x178a3a[_0x7d11('0x58')]['role'];return db['User']['find']({'where':{'id':_0x178a3a['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x505573,null))['then'](saveUpdates(_0x178a3a['body'],null))['then'](respondWithResult(_0x505573,null))[_0x7d11('0x21')](handleError(_0x505573,null));};exports[_0x7d11('0x59')]=function(_0x1072f1,_0x407f2c){return db[_0x7d11('0x3d')][_0x7d11('0x59')]()['then'](respondWithResult(_0x407f2c,null))[_0x7d11('0x21')](handleError(_0x407f2c,null));};exports['addContacts']=function(_0x34aab4,_0x49f904){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x34aab4['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x49f904,null))[_0x7d11('0x17')](function(_0x2581d5){if(_0x2581d5){return _0x2581d5[_0x7d11('0x5a')](_0x34aab4['body']['ids'],_[_0x7d11('0x5b')](_0x34aab4[_0x7d11('0x58')],[_0x7d11('0x5c'),'id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x49f904,null))[_0x7d11('0x21')](handleError(_0x49f904,null));};function validateUser(_0x492183){return new BPromise(function(_0x2b9ba0,_0x5ad800){if(_0x492183[_0x7d11('0x5d')])return _0x2b9ba0(_0x492183);return db[_0x7d11('0x5e')][_0x7d11('0x5f')](0x1)[_0x7d11('0x17')](function(_0x4df2da){if(_0x4df2da[_0x7d11('0x60')])authService['validatePasswordPattern'](_0x492183[_0x7d11('0x4e')]);db[_0x7d11('0x3d')][_0x7d11('0x61')](_0x7d11('0x5d'))[_0x7d11('0x17')](function(_0x776b20){if(_[_0x7d11('0x62')](_0x776b20)){_0x492183[_0x7d11('0x5d')]=_0x4df2da[_0x7d11('0x63')]||0x1;return;}if(_[_0x7d11('0x62')](_0x4df2da[_0x7d11('0x63')])||_0x4df2da[_0x7d11('0x63')]===_0x776b20){_0x492183[_0x7d11('0x5d')]=_0x776b20+0x1;return;}if(_0x4df2da[_0x7d11('0x63')]>_0x776b20){_0x492183['internal']=_0x4df2da[_0x7d11('0x63')];return;}return db['sequelize'][_0x7d11('0x3e')]('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[_0x7d11('0x64')][_0x7d11('0x65')][_0x7d11('0x66')]})[_0x7d11('0x17')](function(_0x4aac67){if(_0x4aac67&&_0x4aac67['length']){for(var _0x1351ee=0x0,_0x15938b=_0x4aac67[_0x7d11('0x67')];_0x1351ee<_0x15938b&&_['isNil'](_0x492183[_0x7d11('0x5d')]);_0x1351ee++){if(_0x4df2da[_0x7d11('0x63')]<=_0x4aac67[_0x1351ee][_0x7d11('0x68')]){_0x492183[_0x7d11('0x5d')]=_0x4aac67[_0x1351ee][_0x7d11('0x68')];}else if(_0x4df2da[_0x7d11('0x63')]>_0x4aac67[_0x1351ee]['from']&&_0x4df2da[_0x7d11('0x63')]<=_0x4aac67[_0x1351ee]['to']){_0x492183['internal']=_0x4df2da[_0x7d11('0x63')];}}}if(_['isNil'](_0x492183['internal'])){_0x492183[_0x7d11('0x5d')]=_0x776b20+0x1;}return _0x2b9ba0(_0x492183);});});})[_0x7d11('0x21')](function(_0xeed31b){_0x5ad800(_0xeed31b);});});}function updateUser(_0x14ee15){return new BPromise(function(_0x119da7,_0x2da548){try{if(_0x14ee15[_0x7d11('0x69')]){_0x14ee15[_0x7d11('0x6a')]=_0x14ee15[_0x7d11('0x5d')];_0x14ee15[_0x7d11('0x6b')]={'mailbox':_0x14ee15[_0x7d11('0x5d')],'password':_0x14ee15['password'],'fullname':_0x14ee15[_0x7d11('0x6c')],'email':_0x14ee15['email']};}if(_0x14ee15[_0x7d11('0x31')]===_0x7d11('0x2c')){if(!_0x14ee15[_0x7d11('0x6d')])_0x14ee15[_0x7d11('0x6d')]=[_0x7d11('0x6e'),_0x7d11('0x6f'),_0x7d11('0x70'),'113','110',_0x7d11('0x71'),_0x7d11('0x72'),_0x7d11('0x73'),_0x7d11('0x74'),_0x7d11('0x75'),'109',_0x7d11('0x76'),'111',_0x7d11('0x77'),_0x7d11('0x78')];}_0x119da7(_0x14ee15);}catch(_0x1bddb4){_0x2da548(_0x1bddb4);}});}exports[_0x7d11('0x79')]=function(_0x1b5e35,_0x1c02c8){if(_0x1b5e35[_0x7d11('0x7a')][_0x7d11('0x31')]==='agent')throw new Error('Unauthorized');if(_0x1b5e35[_0x7d11('0x58')][_0x7d11('0x31')]===_0x7d11('0x7a')&&_0x1b5e35['user']['role']!==_0x7d11('0x7b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x1b5e35[_0x7d11('0x58')][_0x7d11('0x31')]===_0x7d11('0x7b')&&_0x1b5e35[_0x7d11('0x7a')]['role']!==_0x7d11('0x7b')){throw new Error(_0x7d11('0x7c'));}return licenseUtil[_0x7d11('0x7d')]([_0x1b5e35[_0x7d11('0x58')]])[_0x7d11('0x17')](function(){return validateUser(_0x1b5e35[_0x7d11('0x58')]);})[_0x7d11('0x17')](function(_0x1b719a){return updateUser(_0x1b719a)['then'](function(_0x41f989){if(_0x41f989[_0x7d11('0x31')]===_0x7d11('0x7b')){_0x41f989[_0x7d11('0x7e')]=_0x1b5e35[_0x7d11('0x7a')]['settingsEnabled'];delete _0x41f989[_0x7d11('0x7f')];}return _0x41f989;});})[_0x7d11('0x17')](function(_0xa4d2ad){return db[_0x7d11('0x3d')][_0x7d11('0x79')](_0xa4d2ad,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x1fdae2){if(_0x1b5e35['body'][_0x7d11('0x31')]==='user')return _0x1fdae2;if(_0x1b5e35['user'][_0x7d11('0x31')]!==_0x7d11('0x7a'))return _0x1fdae2;return db[_0x7d11('0x80')][_0x7d11('0x55')]({'where':{'name':_0x1fdae2[_0x7d11('0x31')]===_0x7d11('0x2c')?_0x7d11('0x2b'):_0x7d11('0x2d'),'userProfileId':_0x1b5e35[_0x7d11('0x7a')][_0x7d11('0x7f')]},'raw':!![]})['then'](function(_0xfdfcb7){if(!_0xfdfcb7||_0xfdfcb7[_0x7d11('0x81')]!=0x0)return _0x1fdae2;return db['UserProfileResource'][_0x7d11('0x79')]({'name':_0x1fdae2[_0x7d11('0x34')],'resourceId':_0x1fdae2['id'],'type':_0xfdfcb7[_0x7d11('0x34')],'sectionId':_0xfdfcb7['id']},{})[_0x7d11('0x17')](function(){return _0x1fdae2;});})['catch'](function(_0x573fa9){logger[_0x7d11('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x573fa9);throw _0x573fa9;});})[_0x7d11('0x17')](respondWithResult(_0x1c02c8,0xc9))[_0x7d11('0x21')](handleError(_0x1c02c8,null));};exports[_0x7d11('0x82')]=function(_0x13ccd5,_0x1565d9){var _0x269f3f=_0x13ccd5[_0x7d11('0x58')];var _0x596228=[];if(_0x13ccd5[_0x7d11('0x7a')][_0x7d11('0x31')]===_0x7d11('0x2c'))throw new Error(_0x7d11('0x83'));if(_['some'](_0x269f3f,[_0x7d11('0x31'),_0x7d11('0x7a')])&&_0x13ccd5['user'][_0x7d11('0x31')]!==_0x7d11('0x7b')){throw new Error(_0x7d11('0x84'));}if(_['some'](_0x269f3f,[_0x7d11('0x31'),_0x7d11('0x7b')])&&_0x13ccd5['user'][_0x7d11('0x31')]!==_0x7d11('0x7b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x7d11('0x7d')](_0x269f3f)['then'](function(){return validateUser(_0x269f3f[0x0]);})['then'](function(){for(var _0x4ba3f6=0x1;_0x4ba3f6<_0x269f3f['length'];_0x4ba3f6++){var _0x526e65=_0x269f3f[_0x4ba3f6-0x1][_0x7d11('0x5d')];if(!_0x269f3f[_0x4ba3f6][_0x7d11('0x5d')])_0x269f3f[_0x4ba3f6][_0x7d11('0x5d')]=_0x526e65+0x1;_0x596228[_0x7d11('0x41')](validateUser(_0x269f3f[_0x4ba3f6]));}return BPromise[_0x7d11('0x49')](_0x596228);})[_0x7d11('0x17')](function(){_0x596228=[];for(var _0x1a2df6=0x0;_0x1a2df6<_0x269f3f[_0x7d11('0x67')];_0x1a2df6++){_0x596228[_0x7d11('0x41')](updateUser(_0x269f3f[_0x1a2df6]));}return BPromise['all'](_0x596228);})['then'](function(){return BPromise[_0x7d11('0x85')](_0x269f3f,function(_0x158e0f){return db['User']['create'](_0x158e0f,{'include':[{'model':db[_0x7d11('0x6b')],'as':_0x7d11('0x6b')}]})[_0x7d11('0x17')](function(_0x391d7){_0x158e0f['id']=_0x391d7['id'];return _0x158e0f;});});})['then'](function(_0x542596){if(_0x13ccd5['body'][_0x7d11('0x31')]===_0x7d11('0x7a'))return _0x542596;if(_0x13ccd5[_0x7d11('0x7a')]['role']!==_0x7d11('0x7a'))return _0x542596;var _0x238cfd=_['some'](_0x542596,function(_0x4aafef){return _0x4aafef[_0x7d11('0x31')]==='agent'||_0x4aafef['role']===_0x7d11('0x86');});if(!_0x238cfd)return _0x542596;return db[_0x7d11('0x80')]['findAll']({'where':{'name':{'$or':['Agents',_0x7d11('0x2d')]},'userProfileId':_0x13ccd5[_0x7d11('0x7a')][_0x7d11('0x7f')]},'raw':!![]})[_0x7d11('0x17')](function(_0x4af02c){if(_[_0x7d11('0x87')](_0x4af02c)||!_[_0x7d11('0x88')](_0x4af02c,[_0x7d11('0x81'),0x0]))return _0x542596;_0x596228=[];var _0x83416b=_(_0x4af02c)['map'](function(_0xdd679a){if(_0xdd679a[_0x7d11('0x81')]===0x1)return;return _0xdd679a[_0x7d11('0x34')]==='Agents'?_0x7d11('0x2c'):'telephone';})[_0x7d11('0x89')]()['value']();for(var _0x1a0e19=0x0;_0x1a0e19<_0x542596[_0x7d11('0x67')];_0x1a0e19++){if(!_[_0x7d11('0x30')](_0x83416b,_0x542596[_0x1a0e19][_0x7d11('0x31')]))return;var _0x38094f=_0x542596[_0x1a0e19][_0x7d11('0x31')]==='agent'?'Agents':_0x7d11('0x2d');_0x596228[_0x7d11('0x41')](db[_0x7d11('0x8a')][_0x7d11('0x79')]({'name':_0x542596[_0x1a0e19]['name'],'resourceId':_0x542596[_0x1a0e19]['id'],'type':_0x38094f,'sectionId':_[_0x7d11('0x55')](_0x4af02c,[_0x7d11('0x34'),_0x38094f])['id']},{}));}return BPromise[_0x7d11('0x49')](_0x596228);});})[_0x7d11('0x17')](respondWithResult(_0x1565d9,0xc9))['catch'](handleError(_0x1565d9,null));};exports[_0x7d11('0x8b')]=function(_0x2bac2a,_0x3aad38){if(_0x2bac2a[_0x7d11('0x58')]['id']){delete _0x2bac2a[_0x7d11('0x58')]['id'];}return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x2bac2a[_0x7d11('0x4a')]['id']}})['then'](function(_0xe03909){if(!_0xe03909)return null;if(_0xe03909['id']===_0x2bac2a['user']['id']){if(!_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8c')]||!_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')]){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0x90'));}if(!_0xe03909[_0x7d11('0x91')](_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8c')])){throw new db['Sequelize'][(_0x7d11('0x8f'))]('Wrong\x20credentials');}if(_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8c')]===_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')]){throw new db[(_0x7d11('0x8e'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x2bac2a[_0x7d11('0x7a')][_0x7d11('0x31')]==='admin'){if(!_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')]){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0x92'));}}else if(_0x2bac2a['user']['role']==='user'){if(!_0x2bac2a['body'][_0x7d11('0x8d')]){throw new db[(_0x7d11('0x8e'))]['ValidationError'](_0x7d11('0x92'));}if(_0xe03909[_0x7d11('0x31')]!==_0x7d11('0x2c')){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0x83'));}}else{throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))]('Unauthorized');}return _0xe03909;})[_0x7d11('0x17')](handleEntityNotFound(_0x3aad38,null))[_0x7d11('0x17')](function(_0x54fd6a){return db[_0x7d11('0x5e')][_0x7d11('0x93')]({'attributes':['id',_0x7d11('0x60'),_0x7d11('0x94'),_0x7d11('0x95')]})[_0x7d11('0x17')](function(_0x1b8ad6){if(_0x1b8ad6[_0x7d11('0x60')])authService[_0x7d11('0x96')](_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')]);if(!_0x1b8ad6[_0x7d11('0x94')]||!_0x54fd6a['previousPasswords'])return _0x54fd6a;authService['validatePasswordHistory'](_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')],_0x54fd6a[_0x7d11('0x97')],_0x1b8ad6['passwordHistoryLimit']);return _0x54fd6a;})[_0x7d11('0x17')](saveUpdates({'password':_0x2bac2a['body'][_0x7d11('0x8d')],'passwordResetAt':_0x2bac2a[_0x7d11('0x7a')]['id']==_0x2bac2a[_0x7d11('0x4a')]['id']?moment():null,'previousPasswords':authService[_0x7d11('0x98')](_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')],_0x54fd6a[_0x7d11('0x97')])},null));})[_0x7d11('0x17')](respondWithResult(_0x3aad38,null))[_0x7d11('0x21')](handleError(_0x3aad38,null));};exports[_0x7d11('0x99')]=function(_0x358178,_0x460c72){var _0x2c3a17=_0x358178[_0x7d11('0x58')][_0x7d11('0x9a')];return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x358178[_0x7d11('0x4a')]['id']},'attributes':['id','name','role',_0x7d11('0x9b'),_0x7d11('0x9c'),_0x7d11('0x9d'),_0x7d11('0x9e')]})[_0x7d11('0x17')](handleEntityNotFound(_0x460c72,null))['then'](function(_0x59d543){if(_0x59d543){if(!utils['isValidChannel'](_0x2c3a17)){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x59d543[_0x7d11('0x9f')+_[_0x7d11('0xa0')](_0x2c3a17[_0x7d11('0xa1')]())+_0x7d11('0xa2')](_0x358178[_0x7d11('0x58')][_0x7d11('0x5c')],{'penalty':_0x358178[_0x7d11('0x58')][_0x7d11('0xa3')]||0x0})[_0x7d11('0xa4')](function(_0x1570be){for(var _0x4135f7=0x0;_0x4135f7<_0x358178[_0x7d11('0x58')][_0x7d11('0x5c')]['length'];_0x4135f7+=0x1){var _0x51b469={'UserId':Number(_0x358178['params']['id'])};_0x51b469[_['capitalize'](_0x2c3a17['toLowerCase']())+_0x7d11('0xa5')]=Number(_0x358178[_0x7d11('0x58')][_0x7d11('0x5c')][_0x4135f7]);socket[_0x7d11('0xa6')](_0x7d11('0x7a')+_[_0x7d11('0xa0')](_0x2c3a17[_0x7d11('0xa1')]())+_0x7d11('0xa7'),_0x51b469);}return _0x1570be;})[_0x7d11('0x17')](function(){if(_0x2c3a17===_0x7d11('0xa8')){return db['VoiceQueue'][_0x7d11('0xa9')]({'where':{'id':_0x358178[_0x7d11('0x58')][_0x7d11('0x5c')]||[]},'raw':!![],'attributes':['id',_0x7d11('0x34')]});}})[_0x7d11('0x17')](function(_0x43a20c){var _0x53887c=_0x59d543[_0x7d11('0x29')]({'plain':!![]});var _0x25c8e4=[];if(_0x2c3a17===_0x7d11('0xa8')&&_0x53887c[_0x7d11('0x31')]==='agent'&&_0x53887c[_0x7d11('0x9b')]){for(var _0xbdc907=0x0;_0xbdc907<_0x43a20c['length'];_0xbdc907+=0x1){_0x25c8e4[_0x7d11('0x41')]({'membername':_0x53887c[_0x7d11('0x34')],'UserId':_0x53887c['id'],'queue_name':_0x43a20c[_0xbdc907][_0x7d11('0x34')],'VoiceQueueId':_0x43a20c[_0xbdc907]['id'],'interface':_['isNil'](_0x53887c[_0x7d11('0x9e')])?util[_0x7d11('0xaa')]('SIP/%s',_0x53887c[_0x7d11('0x34')]):_0x53887c[_0x7d11('0x9e')],'paused':_0x53887c[_0x7d11('0x9d')]||![],'penalty':_0x358178[_0x7d11('0x58')]['penalty']||0x0});}return BPromise['each'](_0x25c8e4,function(_0x83a280){return db[_0x7d11('0xab')][_0x7d11('0xac')](_0x83a280);});}return _0x59d543;});}})[_0x7d11('0x17')](respondWithStatusCode(_0x460c72,null))[_0x7d11('0x21')](handleError(_0x460c72,null));};exports['removeQueues']=function(_0x462e6b,_0x1398e8){var _0x45f8e0;return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x462e6b[_0x7d11('0x4a')]['id']},'attributes':['id',_0x7d11('0x34'),_0x7d11('0x31')]})['then'](handleEntityNotFound(_0x1398e8,null))[_0x7d11('0x17')](function(_0x3fb52a){if(_0x3fb52a){_0x45f8e0=_0x3fb52a;if(!_0x462e6b[_0x7d11('0x3e')]['channel']||!utils[_0x7d11('0xad')](_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x9a')])){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0xae'));}return _0x3fb52a[_0x7d11('0xaf')+_['capitalize'](_0x462e6b[_0x7d11('0x3e')]['channel'][_0x7d11('0xa1')]())+_0x7d11('0xa2')](_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x5c')]);}})['then'](function(_0x2e4eac){if(_['isArray'](_0x462e6b['query'][_0x7d11('0x5c')])){for(var _0x1ebd24=0x0;_0x1ebd24<_0x462e6b['query'][_0x7d11('0x5c')]['length'];_0x1ebd24+=0x1){var _0x451e24={'UserId':Number(_0x462e6b['params']['id'])};_0x451e24[_['capitalize'](_0x462e6b[_0x7d11('0x3e')]['channel'][_0x7d11('0xa1')]())+_0x7d11('0xa5')]=Number(_0x462e6b['query'][_0x7d11('0x5c')][_0x1ebd24]);socket['emit']('user'+_[_0x7d11('0xa0')](_0x462e6b['query']['channel']['toLowerCase']())+_0x7d11('0xb0'),_0x451e24);}}else{var _0x451e24={'UserId':Number(_0x462e6b[_0x7d11('0x4a')]['id'])};_0x451e24[_[_0x7d11('0xa0')](_0x462e6b[_0x7d11('0x3e')]['channel'][_0x7d11('0xa1')]())+_0x7d11('0xa5')]=Number(_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x5c')]);socket[_0x7d11('0xa6')](_0x7d11('0x7a')+_['capitalize'](_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x9a')][_0x7d11('0xa1')]())+_0x7d11('0xb0'),_0x451e24);}return _0x2e4eac;})[_0x7d11('0x17')](function(){if(_0x462e6b[_0x7d11('0x3e')]['channel']===_0x7d11('0xa8')){return db[_0x7d11('0xab')][_0x7d11('0x32')]({'where':{'UserId':_0x462e6b['params']['id'],'VoiceQueueId':_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x5c')]},'individualHooks':!![]})[_0x7d11('0x17')](function(){return _0x45f8e0;});}return _0x45f8e0;})['then'](respondWithStatusCode(_0x1398e8,null))[_0x7d11('0x21')](handleError(_0x1398e8,null));};exports[_0x7d11('0xb1')]=function(_0x945c35,_0xd55b9b){_0x945c35[_0x7d11('0x58')]['userpic']=_0x945c35[_0x7d11('0xb2')][_0x7d11('0xb3')];return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x945c35[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0xd55b9b,null))['then'](saveUpdates(_0x945c35[_0x7d11('0x58')],null))[_0x7d11('0x17')](respondWithResult(_0xd55b9b,null))[_0x7d11('0x21')](handleError(_0xd55b9b,null));};exports[_0x7d11('0xb4')]=function(_0x388028,_0x3e8c11){var _0x3aceef=path[_0x7d11('0xb5')](config[_0x7d11('0xb6')],_0x7d11('0xb7'));return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x388028['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x3e8c11,null))[_0x7d11('0x17')](function(_0x2ff073){if(_0x2ff073){if(_[_0x7d11('0x62')](_0x2ff073[_0x7d11('0xb8')])){return _0x3e8c11[_0x7d11('0xb9')](_0x3aceef);}else{if(!fs[_0x7d11('0xba')](path[_0x7d11('0xb5')](config[_0x7d11('0xb6')],_0x7d11('0xbb'),_0x2ff073['userpic']))){return _0x3e8c11[_0x7d11('0xb9')](_0x3aceef);}return _0x3e8c11[_0x7d11('0xb9')](path[_0x7d11('0xb5')](config['root'],_0x7d11('0xbb'),_0x2ff073[_0x7d11('0xb8')]));}}})[_0x7d11('0x21')](handleError(_0x3e8c11,null));};exports[_0x7d11('0xbc')]=function(_0x39c200,_0x250b96){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x39c200['params']['id']},'attributes':['id']})[_0x7d11('0x17')](handleEntityNotFound(_0x250b96,null))[_0x7d11('0x17')](function(_0x248f58){var _0x1b65aa=[];values=_0x248f58[_0x7d11('0x46')];_0x1b65aa['push'](get_open_tabs('chat',_0x248f58['dataValues']));_0x1b65aa[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x47'),_0x248f58[_0x7d11('0x46')]));_0x1b65aa[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x56'),_0x248f58['dataValues']));_0x1b65aa[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x48'),_0x248f58['dataValues']));_0x1b65aa[_0x7d11('0x41')](get_open_tabs(_0x7d11('0xbd'),_0x248f58[_0x7d11('0x46')]));_0x1b65aa[_0x7d11('0x41')](get_open_tabs('mail',_0x248f58['dataValues']));return BPromise[_0x7d11('0x49')](_0x1b65aa);})['then'](function(_0x10890c){var _0x58e579=[];if(_0x10890c){for(var _0x3604e7=0x0;_0x3604e7<values[_0x7d11('0xbe')][_0x7d11('0x67')];_0x3604e7++){var _0x5a874d=values[_0x7d11('0xbe')][_0x3604e7];_0x58e579[_0x7d11('0x41')]({'channel':'CHAT','id':_0x5a874d['id'],'createdAt':_0x5a874d[_0x7d11('0xbf')]});}for(var _0x3604e7=0x0;_0x3604e7<values[_0x7d11('0xc0')]['length'];_0x3604e7++){var _0x5a874d=values[_0x7d11('0xc0')][_0x3604e7];_0x58e579[_0x7d11('0x41')]({'channel':'FAX','id':_0x5a874d['id'],'createdAt':_0x5a874d[_0x7d11('0xbf')]});}for(var _0x3604e7=0x0;_0x3604e7<values[_0x7d11('0xc1')]['length'];_0x3604e7++){var _0x5a874d=values[_0x7d11('0xc1')][_0x3604e7];_0x58e579[_0x7d11('0x41')]({'channel':_0x7d11('0xc2'),'id':_0x5a874d['id'],'createdAt':_0x5a874d[_0x7d11('0xbf')]});}for(var _0x3604e7=0x0;_0x3604e7<values[_0x7d11('0xc3')][_0x7d11('0x67')];_0x3604e7++){var _0x5a874d=values[_0x7d11('0xc3')][_0x3604e7];_0x58e579[_0x7d11('0x41')]({'channel':'MAIL','id':_0x5a874d['id'],'createdAt':_0x5a874d[_0x7d11('0xbf')]});}for(var _0x3604e7=0x0;_0x3604e7<values[_0x7d11('0xc4')]['length'];_0x3604e7++){var _0x5a874d=values[_0x7d11('0xc4')][_0x3604e7];_0x58e579[_0x7d11('0x41')]({'channel':_0x7d11('0xc5'),'id':_0x5a874d['id'],'createdAt':_0x5a874d['createdAt']});}for(var _0x3604e7=0x0;_0x3604e7<values[_0x7d11('0xc6')][_0x7d11('0x67')];_0x3604e7++){var _0x5a874d=values[_0x7d11('0xc6')][_0x3604e7];_0x58e579[_0x7d11('0x41')]({'channel':'WHATSAPP','id':_0x5a874d['id'],'createdAt':_0x5a874d[_0x7d11('0xbf')]});}var _0xb18b16={'count':_0x58e579[_0x7d11('0x67')],'rows':_0x58e579};return _0xb18b16;}else return null;})['then'](respondWithResult(_0x250b96,null))[_0x7d11('0x21')](handleError(_0x250b96,null));};exports[_0x7d11('0xc7')]=function(_0x5848ff,_0x2144ab){var _0x521f9d={};var _0x3ac2d5={};var _0xb38bfb;var _0x245d54;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x5848ff['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x2144ab,null))[_0x7d11('0x17')](function(_0x37f98e){if(_0x37f98e){_0xb38bfb=_0x37f98e;_0x3ac2d5[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0xc8')]['rawAttributes']);_0x3ac2d5[_0x7d11('0x3e')]=_['keys'](_0x5848ff[_0x7d11('0x3e')]);_0x3ac2d5[_0x7d11('0x4f')]=_['intersection'](_0x3ac2d5[_0x7d11('0x4b')],_0x3ac2d5[_0x7d11('0x3e')]);_0x521f9d[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x3ac2d5[_0x7d11('0x4b')],qs['fields'](_0x5848ff['query'][_0x7d11('0x51')]));_0x521f9d[_0x7d11('0x40')]=_0x521f9d[_0x7d11('0x40')]['length']?_0x521f9d[_0x7d11('0x40')]:_0x3ac2d5[_0x7d11('0x4b')];_0x521f9d[_0x7d11('0xc9')]=qs['sort'](_0x5848ff[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x521f9d[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x5848ff[_0x7d11('0x3e')],_0x3ac2d5[_0x7d11('0x4f')]));if(_0x5848ff[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x521f9d['where']=_[_0x7d11('0x53')](_0x521f9d['where'],{'$or':_[_0x7d11('0x2e')](_0x521f9d[_0x7d11('0x40')],function(_0x5684ba){var _0x432e9d={};_0x432e9d[_0x5684ba]={'$like':'%'+_0x5848ff[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x432e9d;})});}_0x521f9d=_['merge']({},_0x521f9d,_0x5848ff[_0x7d11('0x54')]);return _0xb38bfb['getContacts'](_0x521f9d);}})[_0x7d11('0x17')](function(_0x53d69d){if(_0x53d69d){_0x245d54=_0x53d69d[_0x7d11('0x67')];if(_0x5848ff[_0x7d11('0x3e')]['hasOwnProperty']('includeAll')){_0x521f9d[_0x7d11('0x3f')]=[{'model':db[_0x7d11('0xcc')],'as':'List','required':![]},{'model':db[_0x7d11('0xcd')],'as':'Tags','attributes':['id',_0x7d11('0x34'),_0x7d11('0xce')],'where':_0x5848ff[_0x7d11('0x3e')][_0x7d11('0xcf')]?{'id':_0x5848ff[_0x7d11('0x3e')]['tag']}:undefined,'required':_0x5848ff[_0x7d11('0x3e')]['tag']?!![]:![]}];}if(!_0x5848ff[_0x7d11('0x3e')]['hasOwnProperty']('nolimit')){_0x521f9d['limit']=qs[_0x7d11('0x25')](_0x5848ff[_0x7d11('0x3e')]['limit']);_0x521f9d[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x5848ff['query'][_0x7d11('0x24')]);}return _0xb38bfb[_0x7d11('0xc7')](_0x521f9d);}})[_0x7d11('0x17')](function(_0x2ab6a3){if(_0x2ab6a3){return _0x2ab6a3?{'count':_0x245d54,'rows':_0x2ab6a3}:null;}})[_0x7d11('0x17')](respondWithResult(_0x2144ab,null))[_0x7d11('0x21')](handleError(_0x2144ab,null));};exports['getQueues']=function(_0x5963bb,_0x51d906){var _0xfe7f82;var _0x8e85bd;var _0x10b004={};var _0x2f1356;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x5963bb[_0x7d11('0x4a')]['id']},'attributes':['id',_0x7d11('0x34'),_0x7d11('0x31')]})[_0x7d11('0x17')](handleEntityNotFound(_0x51d906,null))['then'](function(_0x47e47c){if(!utils[_0x7d11('0xad')](_0x5963bb[_0x7d11('0x3e')][_0x7d11('0x9a')])){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))]('Unknown\x20channel');}_0xfe7f82=_0x47e47c;var _0x377a01={};_0x377a01['model']=_[_0x7d11('0x4d')](db[_['capitalize'](_0x5963bb[_0x7d11('0x3e')][_0x7d11('0x9a')])+'Queue']['rawAttributes']);_0x377a01[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x5963bb[_0x7d11('0x3e')]);_0x377a01[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x377a01[_0x7d11('0x4b')],_0x377a01[_0x7d11('0x3e')]);_0x10b004[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x377a01[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x5963bb[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x10b004['attributes']=_0x10b004[_0x7d11('0x40')][_0x7d11('0x67')]?_0x10b004['attributes']:_0x377a01['model'];_0x10b004[_0x7d11('0xc9')]=qs['sort'](_0x5963bb[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x10b004[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x5963bb['query'],_0x377a01['filters']));if(_0x5963bb['query'][_0x7d11('0x3a')]){_0x10b004['where']=_['merge'](_0x10b004['where'],{'$or':_['map'](_0x10b004['attributes'],function(_0x28f7f2){var _0x35b86e={};_0x35b86e[_0x28f7f2]={'$like':'%'+_0x5963bb['query'][_0x7d11('0x3a')]+'%'};return _0x35b86e;})});}_0x10b004=_[_0x7d11('0x53')]({},_0x10b004,_0x5963bb[_0x7d11('0x54')]);switch(_0xfe7f82['role']){case _0x7d11('0x7b'):return db[_[_0x7d11('0xa0')](_0x5963bb[_0x7d11('0x3e')][_0x7d11('0x9a')])+_0x7d11('0xd0')][_0x7d11('0xa9')](_0x10b004);case _0x7d11('0x7a'):case _0x7d11('0x2c'):return _0xfe7f82['get'+_[_0x7d11('0xa0')](_0x5963bb['query']['channel'])+'Queues'](_0x10b004);default:throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0xd1'));}})[_0x7d11('0x17')](function(_0x431b62){_0x2f1356=_0x431b62[_0x7d11('0x67')];if(!_0x5963bb['query'][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x10b004[_0x7d11('0x25')]=qs['limit'](_0x5963bb[_0x7d11('0x3e')]['limit']);_0x10b004[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x5963bb[_0x7d11('0x3e')][_0x7d11('0x24')]);}switch(_0xfe7f82[_0x7d11('0x31')]){case _0x7d11('0x7b'):return db[_[_0x7d11('0xa0')](_0x5963bb[_0x7d11('0x3e')][_0x7d11('0x9a')])+_0x7d11('0xd0')][_0x7d11('0xa9')](_0x10b004);case _0x7d11('0x7a'):case _0x7d11('0x2c'):return _0xfe7f82[_0x7d11('0x29')+_[_0x7d11('0xa0')](_0x5963bb[_0x7d11('0x3e')][_0x7d11('0x9a')])+'Queues'](_0x10b004);}})['then'](function(_0x524e19){return{'count':_0x2f1356,'rows':_0x524e19};})[_0x7d11('0x17')](respondWithResult(_0x51d906,null))['catch'](handleError(_0x51d906,null));};exports[_0x7d11('0xd4')]=function(_0x18b99e,_0x982918){var _0x35ac11={};var _0x5e8e90={};var _0x1aa93e;var _0xdec32d;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x18b99e[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x982918,null))[_0x7d11('0x17')](function(_0x51b7ff){if(_0x51b7ff){_0x1aa93e=_0x51b7ff;_0x5e8e90[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0xab')][_0x7d11('0x37')]);_0x5e8e90['query']=_[_0x7d11('0x4d')](_0x18b99e[_0x7d11('0x3e')]);_0x5e8e90['filters']=_['intersection'](_0x5e8e90['model'],_0x5e8e90[_0x7d11('0x3e')]);_0x35ac11[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x5e8e90[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x18b99e['query']['fields']));_0x35ac11[_0x7d11('0x40')]=_0x35ac11[_0x7d11('0x40')][_0x7d11('0x67')]?_0x35ac11[_0x7d11('0x40')]:_0x5e8e90[_0x7d11('0x4b')];_0x35ac11[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x18b99e[_0x7d11('0x3e')]['sort']);_0x35ac11[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x18b99e[_0x7d11('0x3e')],_0x5e8e90[_0x7d11('0x4f')]));if(_0x18b99e[_0x7d11('0x3e')]['filter']){_0x35ac11[_0x7d11('0x3c')]=_['merge'](_0x35ac11[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x35ac11['attributes'],function(_0x53153f){var _0x467e2a={};_0x467e2a[_0x53153f]={'$like':'%'+_0x18b99e['query'][_0x7d11('0x3a')]+'%'};return _0x467e2a;})});}_0x35ac11=_[_0x7d11('0x53')]({},_0x35ac11,_0x18b99e[_0x7d11('0x54')]);return _0x1aa93e[_0x7d11('0xd4')](_0x35ac11);}})['then'](function(_0x1144e3){if(_0x1144e3){_0xdec32d=_0x1144e3[_0x7d11('0x67')];if(!_0x18b99e[_0x7d11('0x3e')][_0x7d11('0xd2')]('nolimit')){_0x35ac11[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x18b99e[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x35ac11[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x18b99e['query']['offset']);}return _0x1aa93e[_0x7d11('0xd4')](_0x35ac11);}})[_0x7d11('0x17')](function(_0x2f4f99){if(_0x2f4f99){return _0x2f4f99?{'count':_0xdec32d,'rows':_0x2f4f99}:null;}})[_0x7d11('0x17')](respondWithResult(_0x982918,null))['catch'](handleError(_0x982918,null));};exports[_0x7d11('0xd5')]=function(_0x440d2a,_0x51366c){var _0x2adb09={};var _0x136ca4={};var _0xf8c1aa;var _0x36e276;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x440d2a['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x51366c,null))[_0x7d11('0x17')](function(_0x63f937){if(_0x63f937){_0xf8c1aa=_0x63f937;_0x136ca4[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db['ChatGroup']['rawAttributes']);_0x136ca4['query']=_[_0x7d11('0x4d')](_0x440d2a[_0x7d11('0x3e')]);_0x136ca4[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x136ca4[_0x7d11('0x4b')],_0x136ca4[_0x7d11('0x3e')]);_0x2adb09[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x136ca4[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x440d2a['query'][_0x7d11('0x51')]));_0x2adb09[_0x7d11('0x40')]=_0x2adb09[_0x7d11('0x40')][_0x7d11('0x67')]?_0x2adb09[_0x7d11('0x40')]:_0x136ca4[_0x7d11('0x4b')];_0x2adb09[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x440d2a[_0x7d11('0x3e')]['sort']);_0x2adb09['where']=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x440d2a[_0x7d11('0x3e')],_0x136ca4['filters']));if(_0x440d2a[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x2adb09[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x2adb09['where'],{'$or':_[_0x7d11('0x2e')](_0x2adb09['attributes'],function(_0x8539e1){var _0x29fe79={};_0x29fe79[_0x8539e1]={'$like':'%'+_0x440d2a[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x29fe79;})});}_0x2adb09=_[_0x7d11('0x53')]({},_0x2adb09,_0x440d2a[_0x7d11('0x54')]);return _0xf8c1aa[_0x7d11('0xd5')](_0x2adb09);}})[_0x7d11('0x17')](function(_0x2b3d53){if(_0x2b3d53){_0x36e276=_0x2b3d53[_0x7d11('0x67')];if(!_0x440d2a[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x2adb09[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x440d2a[_0x7d11('0x3e')]['limit']);_0x2adb09[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x440d2a['query'][_0x7d11('0x24')]);}return _0xf8c1aa['getGroups'](_0x2adb09);}})[_0x7d11('0x17')](function(_0xc5ecd){if(_0xc5ecd){return _0xc5ecd?{'count':_0x36e276,'rows':_0xc5ecd}:null;}})[_0x7d11('0x17')](respondWithResult(_0x51366c,null))['catch'](handleError(_0x51366c,null));};exports[_0x7d11('0xd6')]=function(_0x138ec0,_0x5c49d6){var _0x3db4f0={'raw':!![],'where':{}};var _0x44bb53={};var _0x3b71a4={'count':0x0,'rows':[]};return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x138ec0[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c49d6,null))['then'](function(_0x5cf06a){if(_0x5cf06a){_0x44bb53[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0xd7')]['rawAttributes']);_0x44bb53[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x138ec0[_0x7d11('0x3e')]);_0x44bb53[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x44bb53['model'],_0x44bb53[_0x7d11('0x3e')]);_0x3db4f0[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x44bb53[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x138ec0['query'][_0x7d11('0x51')]));_0x3db4f0[_0x7d11('0x40')]=_0x3db4f0[_0x7d11('0x40')][_0x7d11('0x67')]?_0x3db4f0[_0x7d11('0x40')]:_0x44bb53[_0x7d11('0x4b')];if(!_0x138ec0[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x3db4f0[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x138ec0[_0x7d11('0x3e')]['limit']);_0x3db4f0[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x138ec0[_0x7d11('0x3e')][_0x7d11('0x24')]);}_0x3db4f0[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x138ec0[_0x7d11('0x3e')]['sort']);_0x3db4f0[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x138ec0[_0x7d11('0x3e')],_0x44bb53[_0x7d11('0x4f')]));_0x3db4f0['where'][_0x7d11('0xd8')]=_0x5cf06a['id'];if(_0x138ec0[_0x7d11('0x3e')]['filter']){_0x3db4f0['where']=_['merge'](_0x3db4f0['where'],{'$or':_[_0x7d11('0x2e')](_0x3db4f0[_0x7d11('0x40')],function(_0x326e68){var _0x325891={};_0x325891[_0x326e68]={'$like':'%'+_0x138ec0[_0x7d11('0x3e')]['filter']+'%'};return _0x325891;})});}_0x3db4f0=_['merge']({},_0x3db4f0,_0x138ec0[_0x7d11('0x54')]);return db[_0x7d11('0xd7')]['count']({'where':_0x3db4f0[_0x7d11('0x3c')]})[_0x7d11('0x17')](function(_0x72b251){_0x3b71a4[_0x7d11('0x26')]=_0x72b251;if(_0x138ec0[_0x7d11('0x3e')][_0x7d11('0x52')]){_0x3db4f0[_0x7d11('0x3f')]=[{'all':!![]}];}return db[_0x7d11('0xd7')][_0x7d11('0xa9')](_0x3db4f0);})['then'](function(_0x4e233c){_0x3b71a4[_0x7d11('0x42')]=_0x4e233c;return _0x3b71a4;});}})['then'](respondWithFilteredResult(_0x5c49d6,_0x3db4f0))['catch'](handleError(_0x5c49d6,null));};exports['getScreenRecordings']=function(_0x2f0be4,_0x413789){var _0x270601={'raw':!![],'where':{}};var _0x1f3f5f={};var _0x14be1e={'count':0x0,'rows':[]};return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x2f0be4[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x413789,null))[_0x7d11('0x17')](function(_0x2380d1){if(_0x2380d1){_0x1f3f5f['model']=_[_0x7d11('0x4d')](db[_0x7d11('0xd9')][_0x7d11('0x37')]);_0x1f3f5f[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x2f0be4[_0x7d11('0x3e')]);_0x1f3f5f[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x1f3f5f[_0x7d11('0x4b')],_0x1f3f5f['query']);_0x270601[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x1f3f5f[_0x7d11('0x4b')],qs['fields'](_0x2f0be4[_0x7d11('0x3e')]['fields']));_0x270601['attributes']=_0x270601[_0x7d11('0x40')][_0x7d11('0x67')]?_0x270601['attributes']:_0x1f3f5f[_0x7d11('0x4b')];if(!_0x2f0be4[_0x7d11('0x3e')][_0x7d11('0xd2')]('nolimit')){_0x270601[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x2f0be4[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x270601[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x2f0be4[_0x7d11('0x3e')][_0x7d11('0x24')]);}_0x270601[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x2f0be4[_0x7d11('0x3e')]['sort']);_0x270601['where']=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x2f0be4['query'],_0x1f3f5f[_0x7d11('0x4f')]));_0x270601[_0x7d11('0x3c')][_0x7d11('0xd8')]=_0x2380d1['id'];if(_0x2f0be4[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x270601['where']=_[_0x7d11('0x53')](_0x270601[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x270601[_0x7d11('0x40')],function(_0x5693e7){var _0x2c1aa5={};_0x2c1aa5[_0x5693e7]={'$like':'%'+_0x2f0be4[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x2c1aa5;})});}_0x270601=_['merge']({},_0x270601,_0x2f0be4[_0x7d11('0x54')]);return db['ScreenRecording'][_0x7d11('0x26')]({'where':_0x270601[_0x7d11('0x3c')]})[_0x7d11('0x17')](function(_0x1d16a0){_0x14be1e[_0x7d11('0x26')]=_0x1d16a0;if(_0x2f0be4[_0x7d11('0x3e')][_0x7d11('0x52')]){_0x270601[_0x7d11('0x3f')]=[{'all':!![]}];}return db[_0x7d11('0xd9')][_0x7d11('0xa9')](_0x270601);})[_0x7d11('0x17')](function(_0x5657d4){_0x14be1e['rows']=_0x5657d4;return _0x14be1e;});}})[_0x7d11('0x17')](respondWithFilteredResult(_0x413789,_0x270601))[_0x7d11('0x21')](handleError(_0x413789,null));};exports[_0x7d11('0xda')]=function(_0x41c9e6,_0x38f3f6){var _0x3bbc8e={};var _0x3e89a3={};var _0x28f57a;var _0x201438;return db['User'][_0x7d11('0x93')]({'where':{'id':_0x41c9e6[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x38f3f6,null))[_0x7d11('0x17')](function(_0x5ede52){if(_0x5ede52){_0x28f57a=_0x5ede52;_0x3e89a3['model']=_[_0x7d11('0x4d')](db[_0x7d11('0xdb')][_0x7d11('0x37')]);_0x3e89a3[_0x7d11('0x3e')]=_['keys'](_0x41c9e6[_0x7d11('0x3e')]);_0x3e89a3[_0x7d11('0x4f')]=_['intersection'](_0x3e89a3[_0x7d11('0x4b')],_0x3e89a3[_0x7d11('0x3e')]);_0x3bbc8e[_0x7d11('0x40')]=_['intersection'](_0x3e89a3[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x41c9e6[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x3bbc8e[_0x7d11('0x40')]=_0x3bbc8e['attributes']['length']?_0x3bbc8e['attributes']:_0x3e89a3['model'];_0x3bbc8e[_0x7d11('0xc9')]=qs['sort'](_0x41c9e6[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x3bbc8e[_0x7d11('0x3c')]=qs['filters'](_[_0x7d11('0xcb')](_0x41c9e6[_0x7d11('0x3e')],_0x3e89a3[_0x7d11('0x4f')]));if(_0x41c9e6[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x3bbc8e[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x3bbc8e['where'],{'$or':_[_0x7d11('0x2e')](_0x3bbc8e[_0x7d11('0x40')],function(_0x6c75bb){var _0x563fd8={};_0x563fd8[_0x6c75bb]={'$like':'%'+_0x41c9e6[_0x7d11('0x3e')]['filter']+'%'};return _0x563fd8;})});}_0x3bbc8e=_[_0x7d11('0x53')]({},_0x3bbc8e,_0x41c9e6[_0x7d11('0x54')]);return _0x28f57a[_0x7d11('0xda')](_0x3bbc8e);}})[_0x7d11('0x17')](function(_0xc29f0b){if(_0xc29f0b){_0x201438=_0xc29f0b['length'];if(!_0x41c9e6[_0x7d11('0x3e')][_0x7d11('0xd2')]('nolimit')){_0x3bbc8e[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x41c9e6[_0x7d11('0x3e')]['limit']);_0x3bbc8e[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x41c9e6[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x28f57a[_0x7d11('0xda')](_0x3bbc8e);}})[_0x7d11('0x17')](function(_0x59e27c){if(_0x59e27c){return _0x59e27c?{'count':_0x201438,'rows':_0x59e27c}:null;}})['then'](respondWithResult(_0x38f3f6,null))['catch'](handleError(_0x38f3f6,null));};exports['getOpenchannelInteractions']=function(_0x393f5d,_0x47df63){var _0x17bebd={};var _0x3e4a9a={};var _0x31fc1d;var _0x105505;return db['User'][_0x7d11('0x93')]({'where':{'id':_0x393f5d[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x47df63,null))['then'](function(_0x4425ee){if(_0x4425ee){_0x31fc1d=_0x4425ee;_0x3e4a9a[_0x7d11('0x4b')]=_['keys'](db[_0x7d11('0xdc')][_0x7d11('0x37')]);_0x3e4a9a[_0x7d11('0x3e')]=_['keys'](_0x393f5d[_0x7d11('0x3e')]);_0x3e4a9a['filters']=_[_0x7d11('0x50')](_0x3e4a9a[_0x7d11('0x4b')],_0x3e4a9a[_0x7d11('0x3e')]);_0x17bebd[_0x7d11('0x40')]=_['intersection'](_0x3e4a9a[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x393f5d['query'][_0x7d11('0x51')]));_0x17bebd[_0x7d11('0x40')]=_0x17bebd['attributes']['length']?_0x17bebd[_0x7d11('0x40')]:_0x3e4a9a[_0x7d11('0x4b')];_0x17bebd['order']=qs[_0x7d11('0xca')](_0x393f5d[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x17bebd[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x393f5d['query'],_0x3e4a9a[_0x7d11('0x4f')]));if(_0x393f5d['query']['filter']){_0x17bebd[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x17bebd[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x17bebd[_0x7d11('0x40')],function(_0x39b36f){var _0x51e243={};_0x51e243[_0x39b36f]={'$like':'%'+_0x393f5d['query'][_0x7d11('0x3a')]+'%'};return _0x51e243;})});}_0x17bebd=_[_0x7d11('0x53')]({},_0x17bebd,_0x393f5d[_0x7d11('0x54')]);return _0x31fc1d['getOpenchannelInteractions'](_0x17bebd);}})['then'](function(_0x4a2ae6){if(_0x4a2ae6){_0x105505=_0x4a2ae6['length'];if(!_0x393f5d[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x17bebd['limit']=qs[_0x7d11('0x25')](_0x393f5d[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x17bebd[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x393f5d[_0x7d11('0x3e')]['offset']);}return _0x31fc1d['getOpenchannelInteractions'](_0x17bebd);}})[_0x7d11('0x17')](function(_0x4ce5e1){if(_0x4ce5e1){return _0x4ce5e1?{'count':_0x105505,'rows':_0x4ce5e1}:null;}})[_0x7d11('0x17')](respondWithResult(_0x47df63,null))[_0x7d11('0x21')](handleError(_0x47df63,null));};exports['getMailInteractions']=function(_0x4c308e,_0x14324d){var _0x45563b={'raw':!![],'where':{}};var _0x4e41ae={};var _0x378198={'count':0x0,'rows':[]};return db[_0x7d11('0x3d')]['findOne']({'where':{'id':_0x4c308e[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x14324d,null))[_0x7d11('0x17')](function(_0x3d3578){if(_0x3d3578){_0x4e41ae[_0x7d11('0x4b')]=_['keys'](db[_0x7d11('0xdd')]['rawAttributes']);_0x4e41ae[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x4c308e['query']);_0x4e41ae[_0x7d11('0x4f')]=_['intersection'](_0x4e41ae[_0x7d11('0x4b')],_0x4e41ae[_0x7d11('0x3e')]);_0x45563b[_0x7d11('0x40')]=_['intersection'](_0x4e41ae[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x4c308e['query'][_0x7d11('0x51')]));_0x45563b[_0x7d11('0x40')]=_0x45563b[_0x7d11('0x40')][_0x7d11('0x67')]?_0x45563b[_0x7d11('0x40')]:_0x4e41ae[_0x7d11('0x4b')];if(!_0x4c308e[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x45563b[_0x7d11('0x25')]=qs['limit'](_0x4c308e[_0x7d11('0x3e')]['limit']);_0x45563b[_0x7d11('0x24')]=qs['offset'](_0x4c308e[_0x7d11('0x3e')]['offset']);}_0x45563b['order']=qs[_0x7d11('0xca')](_0x4c308e[_0x7d11('0x3e')]['sort']);_0x45563b['where']=qs[_0x7d11('0x4f')](_['pick'](_0x4c308e[_0x7d11('0x3e')],_0x4e41ae[_0x7d11('0x4f')]));_0x45563b['where'][_0x7d11('0xd8')]=_0x3d3578['id'];if(_0x4c308e[_0x7d11('0x3e')]['filter']){_0x45563b[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x45563b['where'],{'$or':_['map'](_0x45563b[_0x7d11('0x40')],function(_0xaea921){var _0x1fc08d={};_0x1fc08d[_0xaea921]={'$like':'%'+_0x4c308e[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x1fc08d;})});}_0x45563b=_[_0x7d11('0x53')]({},_0x45563b,_0x4c308e[_0x7d11('0x54')]);return db[_0x7d11('0xdd')][_0x7d11('0x26')]({'where':_0x45563b[_0x7d11('0x3c')]})[_0x7d11('0x17')](function(_0x30ae40){_0x378198[_0x7d11('0x26')]=_0x30ae40;if(_0x4c308e[_0x7d11('0x3e')][_0x7d11('0x52')]){_0x45563b['include']=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x45563b);})[_0x7d11('0x17')](function(_0x84a36c){_0x378198[_0x7d11('0x42')]=_0x84a36c;return _0x378198;});}})[_0x7d11('0x17')](respondWithFilteredResult(_0x14324d,_0x45563b))[_0x7d11('0x21')](handleError(_0x14324d,null));};exports['getSmsInteractions']=function(_0x41fa2d,_0x4f0c55){var _0x59c963={};var _0x59fc44={};var _0x451d5f;var _0x4f3d15;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x41fa2d['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x4f0c55,null))['then'](function(_0x3b06c7){if(_0x3b06c7){_0x451d5f=_0x3b06c7;_0x59fc44[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0xde')]['rawAttributes']);_0x59fc44['query']=_[_0x7d11('0x4d')](_0x41fa2d[_0x7d11('0x3e')]);_0x59fc44['filters']=_['intersection'](_0x59fc44[_0x7d11('0x4b')],_0x59fc44[_0x7d11('0x3e')]);_0x59c963[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x59fc44[_0x7d11('0x4b')],qs['fields'](_0x41fa2d[_0x7d11('0x3e')]['fields']));_0x59c963['attributes']=_0x59c963[_0x7d11('0x40')][_0x7d11('0x67')]?_0x59c963[_0x7d11('0x40')]:_0x59fc44[_0x7d11('0x4b')];_0x59c963[_0x7d11('0xc9')]=qs['sort'](_0x41fa2d[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x59c963['where']=qs[_0x7d11('0x4f')](_['pick'](_0x41fa2d['query'],_0x59fc44[_0x7d11('0x4f')]));if(_0x41fa2d[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x59c963[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x59c963[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x59c963[_0x7d11('0x40')],function(_0x1186d5){var _0x343770={};_0x343770[_0x1186d5]={'$like':'%'+_0x41fa2d[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x343770;})});}_0x59c963=_[_0x7d11('0x53')]({},_0x59c963,_0x41fa2d['options']);return _0x451d5f[_0x7d11('0xdf')](_0x59c963);}})[_0x7d11('0x17')](function(_0x1863da){if(_0x1863da){_0x4f3d15=_0x1863da[_0x7d11('0x67')];if(!_0x41fa2d[_0x7d11('0x3e')][_0x7d11('0xd2')]('nolimit')){_0x59c963[_0x7d11('0x25')]=qs['limit'](_0x41fa2d['query']['limit']);_0x59c963[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x41fa2d[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x451d5f['getSmsInteractions'](_0x59c963);}})[_0x7d11('0x17')](function(_0x1283ac){if(_0x1283ac){return _0x1283ac?{'count':_0x4f3d15,'rows':_0x1283ac}:null;}})['then'](respondWithResult(_0x4f0c55,null))[_0x7d11('0x21')](handleError(_0x4f0c55,null));};exports['getFaxInteractions']=function(_0x4919b0,_0x336b8a){var _0x3ef715={};var _0x1a7d26={};var _0x59e999;var _0x4cf497;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x4919b0[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x336b8a,null))[_0x7d11('0x17')](function(_0xa11529){if(_0xa11529){_0x59e999=_0xa11529;_0x1a7d26[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db['FaxInteraction']['rawAttributes']);_0x1a7d26['query']=_[_0x7d11('0x4d')](_0x4919b0['query']);_0x1a7d26[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x1a7d26[_0x7d11('0x4b')],_0x1a7d26[_0x7d11('0x3e')]);_0x3ef715[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x1a7d26[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x4919b0[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x3ef715[_0x7d11('0x40')]=_0x3ef715[_0x7d11('0x40')][_0x7d11('0x67')]?_0x3ef715['attributes']:_0x1a7d26['model'];_0x3ef715[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x4919b0[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x3ef715[_0x7d11('0x3c')]=qs['filters'](_[_0x7d11('0xcb')](_0x4919b0['query'],_0x1a7d26['filters']));if(_0x4919b0[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x3ef715[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x3ef715[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x3ef715[_0x7d11('0x40')],function(_0xcfb6fe){var _0x500f0d={};_0x500f0d[_0xcfb6fe]={'$like':'%'+_0x4919b0[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x500f0d;})});}_0x3ef715=_['merge']({},_0x3ef715,_0x4919b0['options']);return _0x59e999[_0x7d11('0xe0')](_0x3ef715);}})['then'](function(_0x17e432){if(_0x17e432){_0x4cf497=_0x17e432[_0x7d11('0x67')];if(!_0x4919b0[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x3ef715[_0x7d11('0x25')]=qs['limit'](_0x4919b0[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x3ef715['offset']=qs[_0x7d11('0x24')](_0x4919b0[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x59e999[_0x7d11('0xe0')](_0x3ef715);}})['then'](function(_0x5bd4b2){if(_0x5bd4b2){return _0x5bd4b2?{'count':_0x4cf497,'rows':_0x5bd4b2}:null;}})[_0x7d11('0x17')](respondWithResult(_0x336b8a,null))[_0x7d11('0x21')](handleError(_0x336b8a,null));};exports['getWhatsappInteractions']=function(_0x3ed236,_0x27bf1c){var _0x3c1708={};var _0xc779c={};var _0x3892e7;var _0xf075eb;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x3ed236[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x27bf1c,null))[_0x7d11('0x17')](function(_0x530abf){if(_0x530abf){_0x3892e7=_0x530abf;_0xc779c['model']=_[_0x7d11('0x4d')](db[_0x7d11('0xe1')]['rawAttributes']);_0xc779c[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x3ed236['query']);_0xc779c['filters']=_['intersection'](_0xc779c[_0x7d11('0x4b')],_0xc779c[_0x7d11('0x3e')]);_0x3c1708[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0xc779c[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x3ed236[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x3c1708[_0x7d11('0x40')]=_0x3c1708['attributes'][_0x7d11('0x67')]?_0x3c1708['attributes']:_0xc779c[_0x7d11('0x4b')];_0x3c1708['order']=qs['sort'](_0x3ed236[_0x7d11('0x3e')]['sort']);_0x3c1708[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x3ed236[_0x7d11('0x3e')],_0xc779c[_0x7d11('0x4f')]));if(_0x3ed236['query']['filter']){_0x3c1708['where']=_[_0x7d11('0x53')](_0x3c1708[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x3c1708[_0x7d11('0x40')],function(_0x383128){var _0x4f187a={};_0x4f187a[_0x383128]={'$like':'%'+_0x3ed236[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x4f187a;})});}_0x3c1708=_[_0x7d11('0x53')]({},_0x3c1708,_0x3ed236['options']);return _0x3892e7[_0x7d11('0xe2')](_0x3c1708);}})['then'](function(_0x343fb1){if(_0x343fb1){_0xf075eb=_0x343fb1['length'];if(!_0x3ed236['query'][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x3c1708[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x3ed236['query'][_0x7d11('0x25')]);_0x3c1708[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x3ed236[_0x7d11('0x3e')]['offset']);}return _0x3892e7[_0x7d11('0xe2')](_0x3c1708);}})[_0x7d11('0x17')](function(_0x30daf2){if(_0x30daf2){return _0x30daf2?{'count':_0xf075eb,'rows':_0x30daf2}:null;}})[_0x7d11('0x17')](respondWithResult(_0x27bf1c,null))[_0x7d11('0x21')](handleError(_0x27bf1c,null));};exports[_0x7d11('0xe3')]=function(_0x3b174c,_0x22e272,_0x54b8fd){var _0x4474db;var _0x50f12f;var _0x2858d1;var _0xccb1cb=!_[_0x7d11('0x62')](_0x3b174c['params']['id'])?_0x3b174c[_0x7d11('0x4a')]['id']:!_[_0x7d11('0x62')](_0x3b174c[_0x7d11('0x7a')]['id'])?_0x3b174c[_0x7d11('0x7a')]['id']:null;return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0xccb1cb,'role':{'$or':[_0x7d11('0x7b'),'user','agent']}},'attributes':['id','name',_0x7d11('0xe4'),_0x7d11('0xe5'),_0x7d11('0x31'),'internal',_0x7d11('0x9c')]})[_0x7d11('0x17')](function(_0x256c9f){if(_0x256c9f){if(_0x256c9f[_0x7d11('0x31')]===_0x7d11('0x2c')){_0x4474db=_0x256c9f;if(_0x3b174c[_0x7d11('0x58')][_0x7d11('0x9e')]){_0x2858d1=util[_0x7d11('0xaa')](_0x7d11('0xe6'),_0x4474db[_0x3b174c['body'][_0x7d11('0x9e')]]);}else if(_0x3b174c[_0x7d11('0x58')]['intrf']){_0x2858d1=util[_0x7d11('0xaa')](_0x7d11('0xe7'),_0x3b174c['body']['intrf']);}else{_0x2858d1=util['format'](_0x7d11('0xe7'),_0x4474db[_0x7d11('0x34')]);}socket['to'](util[_0x7d11('0xaa')](_0x7d11('0xe8'),_0x4474db[_0x7d11('0x34')]))['emit'](_0x7d11('0xe9'),{'user':{'id':_0x4474db['id'],'name':_0x4474db[_0x7d11('0x34')]},'ip':_0x3b174c[_0x7d11('0xea')][_0x7d11('0xeb')]||_0x3b174c[_0x7d11('0xec')][_0x7d11('0xed')]||_0x3b174c[_0x7d11('0xee')][_0x7d11('0xed')]||_0x3b174c[_0x7d11('0xec')][_0x7d11('0xee')][_0x7d11('0xed')]});return db[_0x7d11('0xab')]['destroy']({'where':{'membername':_0x4474db[_0x7d11('0x34')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x7d11('0x8f'))](_0x7d11('0xef'));}})['then'](function(){if(_0x4474db){return _0x4474db[_0x7d11('0xf0')]({'raw':!![]});}})['then'](function(_0x2efee7){if(_0x4474db){var _0x18ea43=[];if(_0x2efee7){_0x50f12f=_0x2efee7;if(_0x50f12f[_0x7d11('0x67')]){for(var _0x550b75=0x0;_0x550b75<_0x50f12f['length'];_0x550b75++){_0x18ea43[_0x7d11('0x41')]({'membername':_0x4474db[_0x7d11('0x34')],'UserId':_0x4474db['id'],'queue_name':_0x50f12f[_0x550b75][_0x7d11('0x34')],'VoiceQueueId':_0x50f12f[_0x550b75]['id'],'interface':_0x2858d1,'paused':_0x4474db[_0x7d11('0x9c')]||![],'penalty':_0x50f12f[_0x550b75][_0x7d11('0xf1')]||0x0});}return BPromise[_0x7d11('0x85')](_0x18ea43,function(_0x31fc47){return db[_0x7d11('0xab')][_0x7d11('0xac')](_0x31fc47);});}}}})[_0x7d11('0x17')](function(){if(_0x4474db){return db[_0x7d11('0xf2')][_0x7d11('0xa9')]({'where':{'membername':_0x4474db['name'],'exitAt':null}});}})[_0x7d11('0x17')](function(_0x25a98f){if(_0x4474db){var _0x19e912=[];_0x25a98f[_0x7d11('0xf3')](function(_0xb088a5){_0x19e912[_0x7d11('0x41')](_0xb088a5[_0x7d11('0x28')]({'exitAt':moment()[_0x7d11('0xaa')](_0x7d11('0xf4'))}));});return BPromise['all'](_0x19e912);}})[_0x7d11('0x17')](function(){if(_0x4474db){var _0x10ade5=[];var _0x2716b2=[];var _0x2372f4=utils[_0x7d11('0xf5')]();var _0x48b835={'membername':_0x4474db[_0x7d11('0x34')],'interface':_0x2858d1,'enterAt':moment()[_0x7d11('0xaa')](_0x7d11('0xf4')),'role':_0x4474db[_0x7d11('0x31')],'internal':_0x4474db[_0x7d11('0x5d')]};_0x2372f4[_0x7d11('0xf3')](function(_0xbbe9ff){_0x10ade5[_0x7d11('0x41')](_[_0x7d11('0x53')]({'channel':_0xbbe9ff,'type':_0x7d11('0xf6'),'data1':_0x3b174c['body']['device'],'data2':_0x2858d1},_0x48b835));if(_0x4474db[_0x7d11('0x9c')]){_0x2716b2[_0x7d11('0x41')](_[_0x7d11('0x53')]({'channel':_0xbbe9ff,'type':_0x7d11('0xf7'),'data1':_0x7d11('0xf8')},_0x48b835));}});return db[_0x7d11('0xf2')][_0x7d11('0x82')](_0x10ade5[_0x7d11('0xf9')](_0x2716b2),{'individualHooks':!![]});}})[_0x7d11('0x17')](function(){if(_0x4474db){return _0x4474db[_0x7d11('0x28')]({'online':!![],'lastLoginAt':moment()[_0x7d11('0xaa')](_0x7d11('0xf4')),'voicePause':_0x4474db[_0x7d11('0x9c')]||![],'mailPause':_0x4474db['loginInPause']||![],'chatPause':_0x4474db[_0x7d11('0x9c')]||![],'faxPause':_0x4474db[_0x7d11('0x9c')]||![],'smsPause':_0x4474db[_0x7d11('0x9c')]||![],'openchannelPause':_0x4474db[_0x7d11('0x9c')]||![],'whatsappPause':_0x4474db[_0x7d11('0x9c')]||![],'pauseType':_0x4474db['loginInPause']?_0x7d11('0xf8'):null,'interface':_0x2858d1,'lastPauseAt':moment()[_0x7d11('0xaa')](_0x7d11('0xf4'))});}})[_0x7d11('0x17')](function(_0x28f57c){if(_0x3b174c['isMiddleware']){return _0x54b8fd();}else{return BPromise['resolve'](_0x28f57c)['then'](respondWithResult(_0x22e272,null));}})[_0x7d11('0x21')](handleError(_0x22e272,null));};exports[_0x7d11('0xfa')]=function(_0x2a758d,_0x39ccce){var _0xc20eb0;return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x2a758d[_0x7d11('0x4a')]['id'],'role':_0x7d11('0x2c')},'attributes':['id',_0x7d11('0x34'),'role']})['then'](handleEntityNotFound(_0x39ccce,null))[_0x7d11('0x17')](function(_0x46ca1a){if(_0x46ca1a){_0xc20eb0=_0x46ca1a;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xc20eb0[_0x7d11('0x34')]},'individualHooks':!![]});}})[_0x7d11('0x17')](function(){return db[_0x7d11('0xf2')][_0x7d11('0xa9')]({'where':{'membername':_0xc20eb0['name'],'exitAt':null}});})[_0x7d11('0x17')](function(_0x1ae537){var _0x149c4d=[];_0x1ae537['forEach'](function(_0x2b724d){_0x149c4d[_0x7d11('0x41')](_0x2b724d[_0x7d11('0x28')]({'exitAt':moment()['format'](_0x7d11('0xf4'))}));});return BPromise[_0x7d11('0x49')](_0x149c4d);})[_0x7d11('0x17')](function(){return _0xc20eb0[_0x7d11('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x7d11('0x17')](respondWithResult(_0x39ccce,null))[_0x7d11('0x21')](handleError(_0x39ccce,null));};exports[_0x7d11('0xfb')]=function(_0x3731c9,_0x430101){var _0x5cacd1;return db[_0x7d11('0xab')][_0x7d11('0x28')]({'paused':0x1},{'where':{'UserId':_0x3731c9['params']['id']},'individualHooks':!![]})[_0x7d11('0x17')](function(){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x3731c9['params']['id'],'role':_0x7d11('0x2c')},'attributes':['id',_0x7d11('0x34'),_0x7d11('0x31'),_0x7d11('0x5d'),_0x7d11('0x9e')]});})[_0x7d11('0x17')](handleEntityNotFound(_0x430101,null))[_0x7d11('0x17')](function(_0x31b965){if(_0x31b965){_0x5cacd1=_0x31b965;return respondWithRpcPromise(_0x7d11('0xfc'),'pause',{'id':_0x5cacd1['id'],'name':_0x5cacd1[_0x7d11('0x34')],'pause':!![]});}})['then'](function(){if(_0x5cacd1){return db[_0x7d11('0xf2')]['findAll']({'where':{'membername':_0x5cacd1[_0x7d11('0x34')],'type':_0x7d11('0xf7'),'exitAt':null}});}})[_0x7d11('0x17')](function(_0x1becbf){if(_0x1becbf[_0x7d11('0x67')]){var _0x41fc03=moment()['format'](_0x7d11('0xf4'));for(var _0x589d62=0x0,_0x28f51e=_0x1becbf[_0x7d11('0x67')];_0x589d62<_0x28f51e;_0x589d62++){_0x1becbf[_0x589d62][_0x7d11('0xfd')]({'exitAt':_0x41fc03});}}})[_0x7d11('0x17')](function(){var _0x221a38=[];var _0x4a67cf=utils[_0x7d11('0xf5')]();_0x4a67cf[_0x7d11('0xf3')](function(_0x58d755){_0x221a38[_0x7d11('0x41')]({'channel':_0x58d755,'membername':_0x5cacd1[_0x7d11('0x34')],'interface':_[_0x7d11('0x62')](_0x5cacd1[_0x7d11('0x9e')])?util['format']('SIP/%s',_0x5cacd1[_0x7d11('0x34')]):_0x5cacd1['interface'],'type':_0x7d11('0xf7'),'enterAt':moment()[_0x7d11('0xaa')](_0x7d11('0xf4')),'data1':_0x3731c9[_0x7d11('0x58')][_0x7d11('0xfe')]||_0x7d11('0xff'),'role':_0x5cacd1['role'],'internal':_0x5cacd1[_0x7d11('0x5d')]});});return db['MemberReport'][_0x7d11('0x82')](_0x221a38,{'individualHooks':!![]});})['then'](function(){return _0x5cacd1[_0x7d11('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3731c9[_0x7d11('0x58')][_0x7d11('0xfe')]||_0x7d11('0xff'),'lastPauseAt':moment()[_0x7d11('0xaa')](_0x7d11('0xf4'))});})['then'](respondWithResult(_0x430101,null))['catch'](handleError(_0x430101,null));};exports[_0x7d11('0x100')]=function(_0x3e2626,_0x5e4623){var _0x32b7a3;return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x3e2626[_0x7d11('0x4a')]['id']},'attributes':['id','name',_0x7d11('0x31'),'voicePause','mailPause',_0x7d11('0x101'),_0x7d11('0x102'),_0x7d11('0x103'),_0x7d11('0x104'),_0x7d11('0x105'),_0x7d11('0x106'),_0x7d11('0x107')]})[_0x7d11('0x17')](handleEntityNotFound(_0x5e4623,null))[_0x7d11('0x17')](function(_0x296493){if(_0x296493){_0x32b7a3=_0x296493;if(_0x3e2626[_0x7d11('0x58')][_0x7d11('0x9a')]&&!utils['isValidChannel'](_0x3e2626['body']['channel'])){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0xae'));}switch(_0x3e2626[_0x7d11('0x58')][_0x7d11('0x9a')]){case _0x7d11('0xa8'):return respondWithRpcPromise(_0x7d11('0xfc'),_0x7d11('0x100'),{'id':_0x32b7a3['id'],'name':_0x32b7a3[_0x7d11('0x34')],'pause':![]})[_0x7d11('0x17')](function(){return db[_0x7d11('0xab')][_0x7d11('0x28')]({'paused':0x0},{'where':{'UserId':_0x32b7a3['id']},'individualHooks':!![]});})[_0x7d11('0x17')](function(){return db[_0x7d11('0xf2')][_0x7d11('0x55')]({'where':{'channel':_0x3e2626['body'][_0x7d11('0x9a')],'membername':_0x32b7a3[_0x7d11('0x34')],'type':_0x7d11('0xf7'),'exitAt':null}});})[_0x7d11('0x17')](function(_0x5c203f){if(_0x5c203f){return _0x5c203f['update']({'exitAt':moment()[_0x7d11('0xaa')](_0x7d11('0xf4')),'data2':_0x7d11('0x108')},{'individualHooks':!![]});}return null;})[_0x7d11('0x17')](function(){return _0x32b7a3['update']({'voicePause':![]});});case _0x7d11('0x57'):case _0x7d11('0x45'):case _0x7d11('0xbd'):case _0x7d11('0x47'):case _0x7d11('0x48'):case'openchannel':return db[_0x7d11('0xf2')][_0x7d11('0x55')]({'where':{'channel':_0x3e2626['body']['channel'],'membername':_0x32b7a3[_0x7d11('0x34')],'type':_0x7d11('0xf7'),'exitAt':null}})[_0x7d11('0x17')](function(_0x21f5bd){if(_0x21f5bd){return _0x21f5bd[_0x7d11('0x28')]({'exitAt':moment()[_0x7d11('0xaa')](_0x7d11('0xf4')),'data2':_0x7d11('0x108')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x47a05c={};_[_0x7d11('0x27')](_0x47a05c,util[_0x7d11('0xaa')]('%s%s',_0x3e2626[_0x7d11('0x58')][_0x7d11('0x9a')],_0x7d11('0x109')),![]);return _0x32b7a3['update'](_0x47a05c);});default:return respondWithRpcPromise('QueuePause',_0x7d11('0x100'),{'id':_0x32b7a3['id'],'name':_0x32b7a3[_0x7d11('0x34')],'pause':![]})[_0x7d11('0x17')](function(){return db['UserVoiceQueueRt'][_0x7d11('0x28')]({'paused':0x0},{'where':{'UserId':_0x32b7a3['id']}});})['then'](function(){return db[_0x7d11('0xf2')][_0x7d11('0xa9')]({'where':{'membername':_0x32b7a3[_0x7d11('0x34')],'type':_0x7d11('0xf7'),'exitAt':null}});})[_0x7d11('0x17')](function(_0x7f9c3a){var _0x1bb3ff=[];_0x7f9c3a[_0x7d11('0xf3')](function(_0xdf70e3){_0x1bb3ff[_0x7d11('0x41')](_0xdf70e3[_0x7d11('0x28')]({'exitAt':moment()['format'](_0x7d11('0xf4')),'data2':_0x7d11('0x108')}));});return BPromise[_0x7d11('0x49')](_0x1bb3ff);})[_0x7d11('0x17')](function(){return _0x32b7a3['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x7d11('0x17')](respondWithResult(_0x5e4623,null))[_0x7d11('0x21')](handleError(_0x5e4623,null));};exports[_0x7d11('0x10a')]=function(_0x327ea2,_0x553989){var _0x32fa82={};var _0x53b5c7={};var _0xc0d483;var _0x36d524;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x327ea2['params']['id']}})['then'](handleEntityNotFound(_0x553989,null))[_0x7d11('0x17')](function(_0x415591){if(_0x415591){_0xc0d483=_0x415591;_0x53b5c7['model']=_[_0x7d11('0x4d')](db[_0x7d11('0x10b')][_0x7d11('0x37')]);_0x53b5c7[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x327ea2[_0x7d11('0x3e')]);_0x53b5c7[_0x7d11('0x4f')]=_['intersection'](_0x53b5c7['model'],_0x53b5c7[_0x7d11('0x3e')]);_0x32fa82[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x53b5c7['model'],qs['fields'](_0x327ea2[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x32fa82['attributes']=_0x32fa82[_0x7d11('0x40')][_0x7d11('0x67')]?_0x32fa82[_0x7d11('0x40')]:_0x53b5c7['model'];_0x32fa82['order']=qs[_0x7d11('0xca')](_0x327ea2[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x32fa82[_0x7d11('0x3c')]=qs['filters'](_[_0x7d11('0xcb')](_0x327ea2[_0x7d11('0x3e')],_0x53b5c7[_0x7d11('0x4f')]));if(_0x327ea2['query']['filter']){_0x32fa82[_0x7d11('0x3c')]=_['merge'](_0x32fa82['where'],{'$or':_[_0x7d11('0x2e')](_0x32fa82[_0x7d11('0x40')],function(_0x4299b1){var _0x3b335f={};_0x3b335f[_0x4299b1]={'$like':'%'+_0x327ea2[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x3b335f;})});}_0x32fa82=_[_0x7d11('0x53')]({},_0x32fa82,_0x327ea2[_0x7d11('0x54')]);return _0xc0d483[_0x7d11('0x10a')](_0x32fa82);}})[_0x7d11('0x17')](function(_0x15d8f9){if(_0x15d8f9){_0x36d524=_0x15d8f9[_0x7d11('0x67')];if(!_0x327ea2[_0x7d11('0x3e')][_0x7d11('0xd2')]('nolimit')){_0x32fa82['limit']=qs[_0x7d11('0x25')](_0x327ea2[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x32fa82[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x327ea2[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0xc0d483['getTeams'](_0x32fa82);}})[_0x7d11('0x17')](function(_0x18cb54){if(_0x18cb54){return _0x18cb54?{'count':_0x36d524,'rows':_0x18cb54}:null;}})[_0x7d11('0x17')](respondWithResult(_0x553989,null))[_0x7d11('0x21')](handleError(_0x553989,null));};exports[_0x7d11('0x10c')]=function(_0x3bbe29,_0x3c2778){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x3bbe29['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x3c2778,null))[_0x7d11('0x17')](function(_0x5b6ce1){if(_0x5b6ce1){var _0x5eb30f=_0x5b6ce1[_0x7d11('0x29')]({'plain':!![]});return _0x5b6ce1[_0x7d11('0x10c')](_0x3bbe29[_0x7d11('0x58')][_0x7d11('0x5c')],_[_0x7d11('0x5b')](_0x3bbe29['body'],['ids','id'])||{})[_0x7d11('0x17')](function(){for(var _0x23dfdf=0x0;_0x23dfdf<_0x3bbe29[_0x7d11('0x58')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x23dfdf++){var _0x1d5254=[];var _0x33f769={};db[_0x7d11('0x10b')][_0x7d11('0x93')]({'where':{'id':_0x3bbe29[_0x7d11('0x58')][_0x7d11('0x5c')][_0x23dfdf]}})[_0x7d11('0x17')](function(_0xe8d105){_0x33f769=_0xe8d105['dataValues'];_0x1d5254[_0x7d11('0x41')](_0xe8d105[_0x7d11('0xf0')]()[_0x7d11('0x17')](function(_0x170562){for(var _0x15e427=0x0;_0x15e427<_0x170562[_0x7d11('0x67')];_0x15e427++){_0x170562[_0x15e427]['setDataValue'](_0x7d11('0x9a'),_0x7d11('0x10d'));}return _0x170562;}));_0x1d5254[_0x7d11('0x41')](_0xe8d105['getChatQueues']()[_0x7d11('0x17')](function(_0xdd4a0b){for(var _0x46ba30=0x0;_0x46ba30<_0xdd4a0b[_0x7d11('0x67')];_0x46ba30++){_0xdd4a0b[_0x46ba30][_0x7d11('0x10e')](_0x7d11('0x9a'),_0x7d11('0x10f'));}return _0xdd4a0b;}));_0x1d5254[_0x7d11('0x41')](_0xe8d105[_0x7d11('0x110')]()['then'](function(_0x15eca5){for(var _0x16b7bc=0x0;_0x16b7bc<_0x15eca5[_0x7d11('0x67')];_0x16b7bc++){_0x15eca5[_0x16b7bc][_0x7d11('0x10e')](_0x7d11('0x9a'),'Mail');}return _0x15eca5;}));_0x1d5254[_0x7d11('0x41')](_0xe8d105[_0x7d11('0x111')]()[_0x7d11('0x17')](function(_0x37bc5e){for(var _0x16acbd=0x0;_0x16acbd<_0x37bc5e[_0x7d11('0x67')];_0x16acbd++){_0x37bc5e[_0x16acbd][_0x7d11('0x10e')](_0x7d11('0x9a'),'Sms');}return _0x37bc5e;}));_0x1d5254[_0x7d11('0x41')](_0xe8d105[_0x7d11('0x112')]()[_0x7d11('0x17')](function(_0x36cb9a){for(var _0x19333c=0x0;_0x19333c<_0x36cb9a[_0x7d11('0x67')];_0x19333c++){_0x36cb9a[_0x19333c][_0x7d11('0x10e')](_0x7d11('0x9a'),_0x7d11('0x113'));}return _0x36cb9a;}));_0x1d5254[_0x7d11('0x41')](_0xe8d105[_0x7d11('0x114')]()[_0x7d11('0x17')](function(_0x31414a){for(var _0x533dc7=0x0;_0x533dc7<_0x31414a[_0x7d11('0x67')];_0x533dc7++){_0x31414a[_0x533dc7]['setDataValue'](_0x7d11('0x9a'),_0x7d11('0x115'));}return _0x31414a;}));_0x1d5254[_0x7d11('0x41')](_0xe8d105[_0x7d11('0x116')]()[_0x7d11('0x17')](function(_0x428706){for(var _0x6181c1=0x0;_0x6181c1<_0x428706[_0x7d11('0x67')];_0x6181c1++){_0x428706[_0x6181c1]['setDataValue'](_0x7d11('0x9a'),_0x7d11('0x117'));}return _0x428706;}));return BPromise['all'](_0x1d5254);})[_0x7d11('0x17')](function(_0x272e7c){var _0x4f669f=_['flatten'](_0x272e7c);_0x1d5254=[];return db[_0x7d11('0x64')][_0x7d11('0x118')](function(_0x17b0fc){for(var _0x299ec5=0x0;_0x299ec5<_0x4f669f['length'];_0x299ec5++){_0x1d5254[_0x7d11('0x41')](_0x4f669f[_0x299ec5][_0x7d11('0x119')](_0x5eb30f['id']),{'transaction':_0x17b0fc});}return BPromise[_0x7d11('0x49')](_0x1d5254)['then'](function(){if(_0x5eb30f[_0x7d11('0x9b')]){return BPromise[_0x7d11('0x85')](_[_0x7d11('0x3a')](_0x4f669f,function(_0x8f6f15){return _0x8f6f15[_0x7d11('0x11a')](_0x7d11('0x9a'))===_0x7d11('0x10d');}),function(_0x430394){return db[_0x7d11('0xab')][_0x7d11('0xac')]({'membername':_0x5eb30f[_0x7d11('0x34')],'UserId':_0x5eb30f['id'],'queue_name':_0x430394[_0x7d11('0x34')],'VoiceQueueId':_0x430394['id'],'interface':_[_0x7d11('0x62')](_0x5eb30f['interface'])?util['format'](_0x7d11('0xe7'),_0x5eb30f[_0x7d11('0x34')]):_0x5eb30f[_0x7d11('0x9e')],'paused':_0x5eb30f[_0x7d11('0x9d')]||![],'penalty':_0x5eb30f[_0x7d11('0xa3')]},{'transaction':_0x17b0fc});});}else{return;}})[_0x7d11('0x17')](function(){for(var _0x490583=0x0;_0x490583<_0x4f669f[_0x7d11('0x67')];_0x490583++){var _0x3910cd=_0x4f669f[_0x490583][_0x7d11('0x11a')](_0x7d11('0x9a'));var _0x4e9755=_0x3910cd+_0x7d11('0xa5');socket['emit'](_0x7d11('0x7a')+_0x3910cd+_0x7d11('0xa7'),{'UserId':_0x5eb30f['id'],['queueField']:_0x4f669f[_0x490583]['id']});}});});})[_0x7d11('0x17')](function(){db['TeamVoicePrefix'][_0x7d11('0x93')]({'where':{'teamId':_0x33f769['id']}})['then'](function(_0xe46e40){if(_0xe46e40){db['UserVoicePrefix'][_0x7d11('0x79')]({'UserId':_0x3bbe29['params']['id'],'VoicePrefixId':_0xe46e40[_0x7d11('0x11b')]});}});});}});}})[_0x7d11('0x17')](respondWithStatusCode(_0x3c2778,null))[_0x7d11('0x21')](handleError(_0x3c2778,null));};exports[_0x7d11('0x11c')]=function(_0x334107,_0x3d3199){return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x334107[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x3d3199,null))[_0x7d11('0x17')](function(_0x550555){if(_0x550555){var _0x31350c=_0x550555[_0x7d11('0x29')]({'plain':!![]});var _0x485e30=_0x334107['query']['ids'];return _0x550555[_0x7d11('0x11c')](_0x485e30)[_0x7d11('0x17')](function(){for(var _0x33dacc=0x0;_0x33dacc<_0x485e30[_0x7d11('0x67')];_0x33dacc++){var _0x5b4e90=[];var _0x47317d={};db['Team'][_0x7d11('0x93')]({'where':{'id':_0x485e30[_0x33dacc]}})[_0x7d11('0x17')](function(_0x4556f5){_0x47317d=_0x4556f5['dataValues'];_0x5b4e90[_0x7d11('0x41')](_0x4556f5['getVoiceQueues']()[_0x7d11('0x17')](function(_0x60b79a){for(var _0x15cc89=0x0;_0x15cc89<_0x60b79a['length'];_0x15cc89++){_0x60b79a[_0x15cc89][_0x7d11('0x10e')](_0x7d11('0x9a'),_0x7d11('0x10d'));}return _0x60b79a;}));_0x5b4e90[_0x7d11('0x41')](_0x4556f5[_0x7d11('0x11d')]()[_0x7d11('0x17')](function(_0x3ac0db){for(var _0x23fb6c=0x0;_0x23fb6c<_0x3ac0db['length'];_0x23fb6c++){_0x3ac0db[_0x23fb6c]['setDataValue']('channel',_0x7d11('0x10f'));}return _0x3ac0db;}));_0x5b4e90[_0x7d11('0x41')](_0x4556f5['getMailQueues']()[_0x7d11('0x17')](function(_0x75dd25){for(var _0x1bce9f=0x0;_0x1bce9f<_0x75dd25[_0x7d11('0x67')];_0x1bce9f++){_0x75dd25[_0x1bce9f][_0x7d11('0x10e')]('channel',_0x7d11('0x11e'));}return _0x75dd25;}));_0x5b4e90[_0x7d11('0x41')](_0x4556f5[_0x7d11('0x111')]()['then'](function(_0x209ff3){for(var _0x86caf0=0x0;_0x86caf0<_0x209ff3[_0x7d11('0x67')];_0x86caf0++){_0x209ff3[_0x86caf0][_0x7d11('0x10e')]('channel','Sms');}return _0x209ff3;}));_0x5b4e90[_0x7d11('0x41')](_0x4556f5[_0x7d11('0x112')]()['then'](function(_0x281b63){for(var _0x3996a3=0x0;_0x3996a3<_0x281b63[_0x7d11('0x67')];_0x3996a3++){_0x281b63[_0x3996a3]['setDataValue']('channel',_0x7d11('0x113'));}return _0x281b63;}));_0x5b4e90[_0x7d11('0x41')](_0x4556f5['getFaxQueues']()['then'](function(_0x58f031){for(var _0x10a59d=0x0;_0x10a59d<_0x58f031[_0x7d11('0x67')];_0x10a59d++){_0x58f031[_0x10a59d][_0x7d11('0x10e')]('channel',_0x7d11('0x115'));}return _0x58f031;}));_0x5b4e90[_0x7d11('0x41')](_0x4556f5[_0x7d11('0x116')]()['then'](function(_0x44d1b3){for(var _0x487733=0x0;_0x487733<_0x44d1b3[_0x7d11('0x67')];_0x487733++){_0x44d1b3[_0x487733]['setDataValue'](_0x7d11('0x9a'),_0x7d11('0x117'));}return _0x44d1b3;}));return BPromise[_0x7d11('0x49')](_0x5b4e90);})[_0x7d11('0x17')](function(_0x51088b){var _0x1f419c=_['flatten'](_0x51088b);_0x5b4e90=[];return db['sequelize'][_0x7d11('0x118')](function(_0x1cf1de){for(var _0x39fbb6=0x0;_0x39fbb6<_0x1f419c['length'];_0x39fbb6++){_0x5b4e90[_0x7d11('0x41')](_0x1f419c[_0x39fbb6][_0x7d11('0x11f')](_0x31350c['id']),{'transaction':_0x1cf1de});}return BPromise[_0x7d11('0x49')](_0x5b4e90)['then'](function(){if(_0x31350c['online']){return BPromise['each'](_[_0x7d11('0x3a')](_0x1f419c,function(_0x3b4330){return _0x3b4330[_0x7d11('0x11a')](_0x7d11('0x9a'))===_0x7d11('0x10d');}),function(_0x237fab){return db[_0x7d11('0xab')][_0x7d11('0x32')]({'where':{'VoiceQueueId':_0x237fab['id'],'UserId':_0x31350c['id']},'transaction':_0x1cf1de});});}else{return;}})[_0x7d11('0x17')](function(){db['TeamVoicePrefix'][_0x7d11('0x93')]({'where':{'teamId':_0x47317d['id']}})[_0x7d11('0x17')](function(_0x16863f){if(_0x16863f){return db['UserVoicePrefix'][_0x7d11('0x32')]({'where':{'UserId':_0x31350c['id'],'VoicePrefixId':_0x16863f[_0x7d11('0x46')][_0x7d11('0x11b')]}});}});})['then'](function(){for(var _0x41c8f7=0x0;_0x41c8f7<_0x1f419c['length'];_0x41c8f7++){var _0x1b4917=_0x1f419c[_0x41c8f7][_0x7d11('0x11a')](_0x7d11('0x9a'));var _0x190412=_0x1b4917+_0x7d11('0xa5');socket['emit'](_0x7d11('0x7a')+_0x1b4917+_0x7d11('0xb0'),{'UserId':_0x31350c['id'],['queueField']:_0x1f419c[_0x41c8f7]['id']});}});});});}});}})[_0x7d11('0x17')](respondWithStatusCode(_0x3d3199,null))[_0x7d11('0x21')](handleError(_0x3d3199,null));};exports[_0x7d11('0x120')]=function(_0x41c7ab,_0x3382b7){var _0x8d5cc7={};var _0x31db54={};var _0x3ec1de;var _0x311d15;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x41c7ab[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x3382b7,null))[_0x7d11('0x17')](function(_0x3ed311){if(_0x3ed311){_0x3ec1de=_0x3ed311;_0x31db54[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db['CmList'][_0x7d11('0x37')]);_0x31db54[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x41c7ab[_0x7d11('0x3e')]);_0x31db54[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x31db54[_0x7d11('0x4b')],_0x31db54['query']);_0x8d5cc7[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x31db54[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x41c7ab[_0x7d11('0x3e')]['fields']));_0x8d5cc7['attributes']=_0x8d5cc7[_0x7d11('0x40')][_0x7d11('0x67')]?_0x8d5cc7[_0x7d11('0x40')]:_0x31db54['model'];_0x8d5cc7[_0x7d11('0xc9')]=qs['sort'](_0x41c7ab[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x8d5cc7[_0x7d11('0x3c')]=qs['filters'](_[_0x7d11('0xcb')](_0x41c7ab[_0x7d11('0x3e')],_0x31db54[_0x7d11('0x4f')]));if(_0x41c7ab['query'][_0x7d11('0x3a')]){_0x8d5cc7['where']=_[_0x7d11('0x53')](_0x8d5cc7['where'],{'$or':_[_0x7d11('0x2e')](_0x8d5cc7['attributes'],function(_0x45249b){var _0x4f51a3={};_0x4f51a3[_0x45249b]={'$like':'%'+_0x41c7ab[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x4f51a3;})});}_0x8d5cc7=_['merge']({},_0x8d5cc7,_0x41c7ab[_0x7d11('0x54')]);return _0x3ec1de[_0x7d11('0x120')](_0x8d5cc7);}})[_0x7d11('0x17')](function(_0x9f1034){if(_0x9f1034){_0x311d15=_0x9f1034[_0x7d11('0x67')];if(!_0x41c7ab[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x8d5cc7[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x41c7ab['query']['limit']);_0x8d5cc7['offset']=qs[_0x7d11('0x24')](_0x41c7ab[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x3ec1de['getLists'](_0x8d5cc7);}})[_0x7d11('0x17')](function(_0x11b625){if(_0x11b625){return _0x11b625?{'count':_0x311d15,'rows':_0x11b625}:null;}})[_0x7d11('0x17')](respondWithResult(_0x3382b7,null))[_0x7d11('0x21')](handleError(_0x3382b7,null));};exports[_0x7d11('0x121')]=function(_0x107dd4,_0x1412fe){var _0x2e55ec={};var _0x523668={};var _0x5719f7;var _0x2cfe43;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x107dd4[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x1412fe,null))[_0x7d11('0x17')](function(_0x2e8264){if(_0x2e8264){_0x5719f7=_0x2e8264;_0x523668[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0x3d')][_0x7d11('0x37')]);_0x523668[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x107dd4[_0x7d11('0x3e')]);_0x523668['filters']=_[_0x7d11('0x50')](_0x523668[_0x7d11('0x4b')],_0x523668[_0x7d11('0x3e')]);_0x2e55ec[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x523668[_0x7d11('0x4b')],qs['fields'](_0x107dd4[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x2e55ec[_0x7d11('0x40')]=_0x2e55ec[_0x7d11('0x40')]['length']?_0x2e55ec[_0x7d11('0x40')]:_0x523668['model'];_0x2e55ec[_0x7d11('0xc9')]=qs['sort'](_0x107dd4[_0x7d11('0x3e')]['sort']);_0x2e55ec[_0x7d11('0x3c')]=qs['filters'](_[_0x7d11('0xcb')](_0x107dd4['query'],_0x523668[_0x7d11('0x4f')]));if(_0x107dd4[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x2e55ec[_0x7d11('0x3c')]=_['merge'](_0x2e55ec[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x2e55ec['attributes'],function(_0x45420d){var _0x315d6c={};_0x315d6c[_0x45420d]={'$like':'%'+_0x107dd4[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x315d6c;})});}_0x2e55ec['model']=db['User'];_0x2e55ec['as']=_0x7d11('0x2b');_0x2e55ec=_[_0x7d11('0x53')]({},_0x2e55ec,_0x107dd4['options']);return _0x5719f7[_0x7d11('0xf0')]({'include':[_0x2e55ec]});}})['then'](function(_0xb2c541){if(_0xb2c541){var _0x2a86fd={},_0x509a44=[],_0x52e72f=0x0;for(var _0x1d4ea8=0x0;_0x1d4ea8<_0xb2c541[_0x7d11('0x67')];_0x1d4ea8+=0x1){for(var _0x16d9c5=0x0,_0x8b4bf9;_0x16d9c5<_0xb2c541[_0x1d4ea8][_0x7d11('0x2b')][_0x7d11('0x67')];_0x16d9c5+=0x1){_0x8b4bf9=_0xb2c541[_0x1d4ea8][_0x7d11('0x2b')][_0x16d9c5]['get']({'plain':!![]});_0x2a86fd[_0x8b4bf9['id']]=_0x8b4bf9;}}_0x2a86fd=_[_0x7d11('0x122')](_0x2a86fd);for(var _0x4867ec=qs[_0x7d11('0x24')](_0x107dd4[_0x7d11('0x3e')][_0x7d11('0x24')]);_0x4867ec<_0x2a86fd[_0x7d11('0x67')]&&_0x509a44[_0x7d11('0x67')]<qs[_0x7d11('0x25')](_0x107dd4[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x4867ec+=0x1){if(_0x2a86fd[_0x4867ec]){_0x509a44[_0x7d11('0x41')](_0x2a86fd[_0x4867ec]);}}return{'count':_0x2a86fd[_0x7d11('0x67')],'rows':_0x509a44};}})[_0x7d11('0x17')](respondWithResult(_0x1412fe,null))['catch'](handleError(_0x1412fe,null));};exports[_0x7d11('0x32')]=function(_0x3650b1,_0x3077e9){if(_0x3650b1[_0x7d11('0x7a')]['id']==_0x3650b1[_0x7d11('0x4a')]['id']){return _0x3077e9[_0x7d11('0x22')](0x1f4)[_0x7d11('0x35')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x3650b1['params']['id']}})['then'](handleEntityNotFound(_0x3077e9,null))[_0x7d11('0x17')](removeEntity(_0x3077e9,null))[_0x7d11('0x21')](handleError(_0x3077e9,null));};exports[_0x7d11('0x123')]=function(_0x36a505,_0x57c561){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x36a505[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57c561,null))[_0x7d11('0x17')](function(_0x4ddc1a){if(_0x4ddc1a){return _0x4ddc1a['addChatInteractions'](_0x36a505[_0x7d11('0x58')][_0x7d11('0x5c')],_[_0x7d11('0x5b')](_0x36a505[_0x7d11('0x58')],['ids','id'])||{})[_0x7d11('0xa4')](function(){for(var _0xf44328=0x0;_0xf44328<_0x36a505[_0x7d11('0x58')][_0x7d11('0x5c')][_0x7d11('0x67')];_0xf44328+=0x1){socket[_0x7d11('0xa6')](_0x7d11('0x124'),{'ChatInteractionId':Number(_0x36a505[_0x7d11('0x58')][_0x7d11('0x5c')][_0xf44328]),'UserId':Number(_0x36a505[_0x7d11('0x4a')]['id'])});}return _0x36a505['body'][_0x7d11('0x5c')];});}})[_0x7d11('0x17')](respondWithResult(_0x57c561,null))[_0x7d11('0x21')](handleError(_0x57c561,null));};exports[_0x7d11('0x125')]=function(_0x1a115e,_0x16d3fa){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x1a115e['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x16d3fa,null))[_0x7d11('0x17')](function(_0xe24178){if(_0xe24178){return _0xe24178[_0x7d11('0x125')](_0x1a115e['query'][_0x7d11('0x5c')])[_0x7d11('0x17')](function(){if(_[_0x7d11('0x126')](_0x1a115e[_0x7d11('0x3e')]['ids'])){for(var _0x11bf7b=0x0;_0x11bf7b<_0x1a115e[_0x7d11('0x3e')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x11bf7b+=0x1){socket[_0x7d11('0xa6')](_0x7d11('0x127'),{'ChatInteractionId':Number(_0x1a115e[_0x7d11('0x3e')][_0x7d11('0x5c')][_0x11bf7b]),'UserId':Number(_0x1a115e[_0x7d11('0x4a')]['id'])});}}else{socket[_0x7d11('0xa6')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1a115e[_0x7d11('0x3e')][_0x7d11('0x5c')]),'UserId':Number(_0x1a115e[_0x7d11('0x4a')]['id'])});}});}})[_0x7d11('0x17')](respondWithStatusCode(_0x16d3fa,null))[_0x7d11('0x21')](handleError(_0x16d3fa,null));};exports['addMailInteractions']=function(_0x45e584,_0x536121){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x45e584[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x536121,null))[_0x7d11('0x17')](function(_0x5ec9d8){if(_0x5ec9d8){return _0x5ec9d8[_0x7d11('0x128')](_0x45e584[_0x7d11('0x58')]['ids'],_[_0x7d11('0x5b')](_0x45e584[_0x7d11('0x58')],[_0x7d11('0x5c'),'id'])||{})[_0x7d11('0xa4')](function(){for(var _0x2abee2=0x0;_0x2abee2<_0x45e584[_0x7d11('0x58')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x2abee2+=0x1){socket['emit']('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x45e584[_0x7d11('0x58')]['ids'][_0x2abee2]),'UserId':Number(_0x45e584[_0x7d11('0x4a')]['id'])});}return _0x45e584['body'][_0x7d11('0x5c')];});}})['then'](respondWithResult(_0x536121,null))[_0x7d11('0x21')](handleError(_0x536121,null));};exports[_0x7d11('0x129')]=function(_0x49efb1,_0x401acc){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x49efb1[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x401acc,null))[_0x7d11('0x17')](function(_0x2a2ccd){if(_0x2a2ccd){return _0x2a2ccd[_0x7d11('0x129')](_0x49efb1[_0x7d11('0x3e')][_0x7d11('0x5c')])[_0x7d11('0x17')](function(){if(_[_0x7d11('0x126')](_0x49efb1[_0x7d11('0x3e')][_0x7d11('0x5c')])){for(var _0xe134b2=0x0;_0xe134b2<_0x49efb1[_0x7d11('0x3e')][_0x7d11('0x5c')][_0x7d11('0x67')];_0xe134b2+=0x1){socket[_0x7d11('0xa6')](_0x7d11('0x12a'),{'MailInteractionId':Number(_0x49efb1['query'][_0x7d11('0x5c')][_0xe134b2]),'UserId':Number(_0x49efb1[_0x7d11('0x4a')]['id'])});}}else{socket[_0x7d11('0xa6')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x49efb1[_0x7d11('0x3e')]['ids']),'UserId':Number(_0x49efb1[_0x7d11('0x4a')]['id'])});}});}})[_0x7d11('0x17')](respondWithStatusCode(_0x401acc,null))[_0x7d11('0x21')](handleError(_0x401acc,null));};exports['addFaxInteractions']=function(_0x56a7e7,_0xc0996a){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x56a7e7['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0xc0996a,null))[_0x7d11('0x17')](function(_0x235e2c){if(_0x235e2c){return _0x235e2c['addFaxInteractions'](_0x56a7e7[_0x7d11('0x58')][_0x7d11('0x5c')],_[_0x7d11('0x5b')](_0x56a7e7['body'],['ids','id'])||{})['spread'](function(){for(var _0x3776bb=0x0;_0x3776bb<_0x56a7e7[_0x7d11('0x58')][_0x7d11('0x5c')]['length'];_0x3776bb+=0x1){socket[_0x7d11('0xa6')](_0x7d11('0x12b'),{'FaxInteractionId':Number(_0x56a7e7['body']['ids'][_0x3776bb]),'UserId':Number(_0x56a7e7[_0x7d11('0x4a')]['id'])});}return _0x56a7e7[_0x7d11('0x58')][_0x7d11('0x5c')];});}})['then'](respondWithResult(_0xc0996a,null))['catch'](handleError(_0xc0996a,null));};exports[_0x7d11('0x12c')]=function(_0x38e802,_0x4abe64){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x38e802[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x4abe64,null))[_0x7d11('0x17')](function(_0x2cc88c){if(_0x2cc88c){return _0x2cc88c['removeFaxInteractions'](_0x38e802[_0x7d11('0x3e')]['ids'])[_0x7d11('0x17')](function(){if(_[_0x7d11('0x126')](_0x38e802[_0x7d11('0x3e')]['ids'])){for(var _0x666675=0x0;_0x666675<_0x38e802[_0x7d11('0x3e')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x666675+=0x1){socket[_0x7d11('0xa6')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x38e802[_0x7d11('0x3e')]['ids'][_0x666675]),'UserId':Number(_0x38e802[_0x7d11('0x4a')]['id'])});}}else{socket[_0x7d11('0xa6')](_0x7d11('0x12d'),{'FaxInteractionId':Number(_0x38e802['query']['ids']),'UserId':Number(_0x38e802['params']['id'])});}});}})[_0x7d11('0x17')](respondWithStatusCode(_0x4abe64,null))[_0x7d11('0x21')](handleError(_0x4abe64,null));};exports[_0x7d11('0x12e')]=function(_0x105803,_0x14a1f3){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x105803[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x14a1f3,null))[_0x7d11('0x17')](function(_0x466648){if(_0x466648){return _0x466648[_0x7d11('0x12e')](_0x105803[_0x7d11('0x58')][_0x7d11('0x5c')],_['omit'](_0x105803['body'],[_0x7d11('0x5c'),'id'])||{})[_0x7d11('0xa4')](function(){for(var _0x460376=0x0;_0x460376<_0x105803[_0x7d11('0x58')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x460376+=0x1){socket['emit'](_0x7d11('0x12f'),{'SmsInteractionId':Number(_0x105803['body'][_0x7d11('0x5c')][_0x460376]),'UserId':Number(_0x105803[_0x7d11('0x4a')]['id'])});}return _0x105803[_0x7d11('0x58')]['ids'];});}})['then'](respondWithResult(_0x14a1f3,null))[_0x7d11('0x21')](handleError(_0x14a1f3,null));};exports[_0x7d11('0x130')]=function(_0x3e5678,_0x3ec3e5){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x3e5678[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x3ec3e5,null))[_0x7d11('0x17')](function(_0x46524e){if(_0x46524e){return _0x46524e[_0x7d11('0x130')](_0x3e5678['query'][_0x7d11('0x5c')])[_0x7d11('0x17')](function(){if(_[_0x7d11('0x126')](_0x3e5678[_0x7d11('0x3e')][_0x7d11('0x5c')])){for(var _0x2d4735=0x0;_0x2d4735<_0x3e5678[_0x7d11('0x3e')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x2d4735+=0x1){socket[_0x7d11('0xa6')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x3e5678['query'][_0x7d11('0x5c')][_0x2d4735]),'UserId':Number(_0x3e5678[_0x7d11('0x4a')]['id'])});}}else{socket[_0x7d11('0xa6')](_0x7d11('0x131'),{'SmsInteractionId':Number(_0x3e5678[_0x7d11('0x3e')][_0x7d11('0x5c')]),'UserId':Number(_0x3e5678[_0x7d11('0x4a')]['id'])});}});}})[_0x7d11('0x17')](respondWithStatusCode(_0x3ec3e5,null))['catch'](handleError(_0x3ec3e5,null));};exports[_0x7d11('0x132')]=function(_0x2ccd79,_0x2738ce){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x2ccd79[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x2738ce,null))['then'](function(_0x29705e){if(_0x29705e){return _0x29705e['addOpenchannelInteractions'](_0x2ccd79['body'][_0x7d11('0x5c')],_['omit'](_0x2ccd79[_0x7d11('0x58')],[_0x7d11('0x5c'),'id'])||{})[_0x7d11('0xa4')](function(){for(var _0x3a0055=0x0;_0x3a0055<_0x2ccd79[_0x7d11('0x58')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x3a0055+=0x1){socket[_0x7d11('0xa6')](_0x7d11('0x133'),{'OpenchannelInteractionId':Number(_0x2ccd79[_0x7d11('0x58')][_0x7d11('0x5c')][_0x3a0055]),'UserId':Number(_0x2ccd79[_0x7d11('0x4a')]['id'])});}return _0x2ccd79[_0x7d11('0x58')][_0x7d11('0x5c')];});}})[_0x7d11('0x17')](respondWithResult(_0x2738ce,null))['catch'](handleError(_0x2738ce,null));};exports['removeOpenchannelInteractions']=function(_0x4af281,_0x1ceaba){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x4af281[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x1ceaba,null))[_0x7d11('0x17')](function(_0x5c4670){if(_0x5c4670){return _0x5c4670['removeOpenchannelInteractions'](_0x4af281['query'][_0x7d11('0x5c')])[_0x7d11('0x17')](function(){if(_[_0x7d11('0x126')](_0x4af281['query'][_0x7d11('0x5c')])){for(var _0x38dabd=0x0;_0x38dabd<_0x4af281[_0x7d11('0x3e')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x38dabd+=0x1){socket[_0x7d11('0xa6')](_0x7d11('0x134'),{'OpenchannelInteractionId':Number(_0x4af281[_0x7d11('0x3e')][_0x7d11('0x5c')][_0x38dabd]),'UserId':Number(_0x4af281[_0x7d11('0x4a')]['id'])});}}else{socket[_0x7d11('0xa6')](_0x7d11('0x134'),{'OpenchannelInteractionId':Number(_0x4af281['query'][_0x7d11('0x5c')]),'UserId':Number(_0x4af281[_0x7d11('0x4a')]['id'])});}});}})[_0x7d11('0x17')](respondWithStatusCode(_0x1ceaba,null))[_0x7d11('0x21')](handleError(_0x1ceaba,null));};exports[_0x7d11('0x135')]=function(_0x45f8bf,_0x5f518e){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x45f8bf[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x5f518e,null))[_0x7d11('0x17')](function(_0x33b807){if(_0x33b807){return _0x33b807[_0x7d11('0x135')](_0x45f8bf['body'][_0x7d11('0x5c')],_[_0x7d11('0x5b')](_0x45f8bf[_0x7d11('0x58')],[_0x7d11('0x5c'),'id'])||{})[_0x7d11('0xa4')](function(){for(var _0x35aafc=0x0;_0x35aafc<_0x45f8bf[_0x7d11('0x58')][_0x7d11('0x5c')][_0x7d11('0x67')];_0x35aafc+=0x1){socket[_0x7d11('0xa6')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0x45f8bf['body'][_0x7d11('0x5c')][_0x35aafc]),'UserId':Number(_0x45f8bf['params']['id'])});}return _0x45f8bf[_0x7d11('0x58')]['ids'];});}})[_0x7d11('0x17')](respondWithResult(_0x5f518e,null))[_0x7d11('0x21')](handleError(_0x5f518e,null));};exports['removeWhatsappInteractions']=function(_0x24061e,_0x24a384){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x24061e[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x24a384,null))['then'](function(_0x3cf4c1){if(_0x3cf4c1){return _0x3cf4c1['removeWhatsappInteractions'](_0x24061e[_0x7d11('0x3e')][_0x7d11('0x5c')]);}})[_0x7d11('0x17')](respondWithStatusCode(_0x24a384,null))[_0x7d11('0x21')](handleError(_0x24a384,null));};exports['getVoicePrefixes']=function(_0x250dd4,_0x25d91a){var _0x175e7d={};var _0x83f9d={};var _0x1e9dbd;var _0x4e6a39;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x250dd4[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x25d91a,null))['then'](function(_0xe1c7b9){if(_0xe1c7b9){_0x1e9dbd=_0xe1c7b9;_0x83f9d['model']=_[_0x7d11('0x4d')](db[_0x7d11('0x136')][_0x7d11('0x37')]);_0x83f9d[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x250dd4[_0x7d11('0x3e')]);_0x83f9d[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x83f9d[_0x7d11('0x4b')],_0x83f9d[_0x7d11('0x3e')]);_0x175e7d[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x83f9d['model'],qs['fields'](_0x250dd4[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x175e7d[_0x7d11('0x40')]=_0x175e7d['attributes'][_0x7d11('0x67')]?_0x175e7d[_0x7d11('0x40')]:_0x83f9d[_0x7d11('0x4b')];_0x175e7d['order']=qs['sort'](_0x250dd4['query'][_0x7d11('0xca')]);_0x175e7d[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x250dd4[_0x7d11('0x3e')],_0x83f9d[_0x7d11('0x4f')]));if(_0x250dd4[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x175e7d[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x175e7d[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x175e7d[_0x7d11('0x40')],function(_0x442b0c){var _0x1580f9={};_0x1580f9[_0x442b0c]={'$like':'%'+_0x250dd4['query']['filter']+'%'};return _0x1580f9;})});}_0x175e7d=_[_0x7d11('0x53')]({},_0x175e7d,_0x250dd4[_0x7d11('0x54')]);return _0x1e9dbd[_0x7d11('0x137')](_0x175e7d);}})[_0x7d11('0x17')](function(_0x1da10f){if(_0x1da10f){_0x4e6a39=_0x1da10f[_0x7d11('0x67')];if(!_0x250dd4['query'][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x175e7d[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x250dd4['query'][_0x7d11('0x25')]);_0x175e7d[_0x7d11('0x24')]=qs['offset'](_0x250dd4['query']['offset']);}return _0x1e9dbd[_0x7d11('0x137')](_0x175e7d);}})['then'](function(_0x2893bd){if(_0x2893bd){return _0x2893bd?{'count':_0x4e6a39,'rows':_0x2893bd}:null;}})[_0x7d11('0x17')](respondWithResult(_0x25d91a,null))[_0x7d11('0x21')](handleError(_0x25d91a,null));};exports[_0x7d11('0x138')]=function(_0x545dc6,_0x405b2c){var _0x1140c4={};var _0x3fbbaa={};var _0xc0bc4a;var _0x5ce914;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x545dc6[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x405b2c,null))[_0x7d11('0x17')](function(_0x2a9228){if(_0x2a9228){_0xc0bc4a=_0x2a9228;_0x3fbbaa[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db['FaxAccount'][_0x7d11('0x37')]);_0x3fbbaa[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x545dc6[_0x7d11('0x3e')]);_0x3fbbaa['filters']=_[_0x7d11('0x50')](_0x3fbbaa[_0x7d11('0x4b')],_0x3fbbaa[_0x7d11('0x3e')]);_0x1140c4[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x3fbbaa[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x545dc6['query'][_0x7d11('0x51')]));_0x1140c4[_0x7d11('0x40')]=_0x1140c4['attributes'][_0x7d11('0x67')]?_0x1140c4[_0x7d11('0x40')]:_0x3fbbaa[_0x7d11('0x4b')];_0x1140c4['order']=qs[_0x7d11('0xca')](_0x545dc6[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x1140c4['where']=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x545dc6[_0x7d11('0x3e')],_0x3fbbaa['filters']));if(_0x545dc6[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x1140c4[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x1140c4[_0x7d11('0x3c')],{'$or':_['map'](_0x1140c4['attributes'],function(_0x5a0a02){var _0x152d8d={};_0x152d8d[_0x5a0a02]={'$like':'%'+_0x545dc6[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x152d8d;})});}_0x1140c4=_[_0x7d11('0x53')]({},_0x1140c4,_0x545dc6[_0x7d11('0x54')]);return _0xc0bc4a[_0x7d11('0x138')](_0x1140c4);}})[_0x7d11('0x17')](function(_0xdde88a){if(_0xdde88a){_0x5ce914=_0xdde88a[_0x7d11('0x67')];if(!_0x545dc6[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x1140c4[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x545dc6[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x1140c4[_0x7d11('0x24')]=qs['offset'](_0x545dc6['query']['offset']);}return _0xc0bc4a[_0x7d11('0x138')](_0x1140c4);}})[_0x7d11('0x17')](function(_0x104657){if(_0x104657){return _0x104657?{'count':_0x5ce914,'rows':_0x104657}:null;}})[_0x7d11('0x17')](respondWithResult(_0x405b2c,null))[_0x7d11('0x21')](handleError(_0x405b2c,null));};exports[_0x7d11('0x139')]=function(_0xae6e51,_0x24ab36){return db['User'][_0x7d11('0x55')]({'where':{'id':_0xae6e51[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x24ab36,null))[_0x7d11('0x17')](function(_0x23c94f){if(_0x23c94f){return _0x23c94f[_0x7d11('0x139')](_0xae6e51['body']['ids'],_[_0x7d11('0x5b')](_0xae6e51[_0x7d11('0x58')],[_0x7d11('0x5c'),'id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x24ab36,null))[_0x7d11('0x21')](handleError(_0x24ab36,null));};exports[_0x7d11('0x13a')]=function(_0x1e3e28,_0x4c54a7){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x1e3e28['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x4c54a7,null))[_0x7d11('0x17')](function(_0x5b3a83){if(_0x5b3a83){return _0x5b3a83['removeFaxAccounts'](_0x1e3e28[_0x7d11('0x3e')]['ids']);}})[_0x7d11('0x17')](respondWithStatusCode(_0x4c54a7,null))[_0x7d11('0x21')](handleError(_0x4c54a7,null));};exports[_0x7d11('0x13b')]=function(_0x53745d,_0x539634){var _0x592ea7={};var _0x6f4c87={};var _0x307a99;var _0x48fe9c;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x53745d[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x539634,null))[_0x7d11('0x17')](function(_0x3a4454){if(_0x3a4454){_0x307a99=_0x3a4454;_0x6f4c87['model']=_['keys'](db[_0x7d11('0x13c')][_0x7d11('0x37')]);_0x6f4c87[_0x7d11('0x3e')]=_['keys'](_0x53745d[_0x7d11('0x3e')]);_0x6f4c87[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x6f4c87['model'],_0x6f4c87[_0x7d11('0x3e')]);_0x592ea7[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x6f4c87['model'],qs[_0x7d11('0x51')](_0x53745d[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x592ea7[_0x7d11('0x40')]=_0x592ea7[_0x7d11('0x40')]['length']?_0x592ea7[_0x7d11('0x40')]:_0x6f4c87[_0x7d11('0x4b')];_0x592ea7[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x53745d[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x592ea7[_0x7d11('0x3c')]=qs['filters'](_[_0x7d11('0xcb')](_0x53745d['query'],_0x6f4c87[_0x7d11('0x4f')]));if(_0x53745d['query']['filter']){_0x592ea7[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x592ea7[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x592ea7[_0x7d11('0x40')],function(_0x109848){var _0x11a19c={};_0x11a19c[_0x109848]={'$like':'%'+_0x53745d[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x11a19c;})});}_0x592ea7=_[_0x7d11('0x53')]({},_0x592ea7,_0x53745d[_0x7d11('0x54')]);return _0x307a99['getMailAccounts'](_0x592ea7);}})[_0x7d11('0x17')](function(_0x4c3e58){if(_0x4c3e58){_0x48fe9c=_0x4c3e58[_0x7d11('0x67')];if(!_0x53745d[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x592ea7[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x53745d[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x592ea7[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x53745d[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x307a99[_0x7d11('0x13b')](_0x592ea7);}})[_0x7d11('0x17')](function(_0x2a8075){if(_0x2a8075){return _0x2a8075?{'count':_0x48fe9c,'rows':_0x2a8075}:null;}})[_0x7d11('0x17')](respondWithResult(_0x539634,null))['catch'](handleError(_0x539634,null));};exports['addMailAccounts']=function(_0x575799,_0x3be473){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x575799[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x3be473,null))[_0x7d11('0x17')](function(_0x3a0b2e){if(_0x3a0b2e){return _0x3a0b2e[_0x7d11('0x13d')](_0x575799[_0x7d11('0x58')][_0x7d11('0x5c')],_[_0x7d11('0x5b')](_0x575799[_0x7d11('0x58')],['ids','id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x3be473,null))[_0x7d11('0x21')](handleError(_0x3be473,null));};exports[_0x7d11('0x13e')]=function(_0x472979,_0x4793a2){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x472979[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x4793a2,null))[_0x7d11('0x17')](function(_0xee1631){if(_0xee1631){return _0xee1631[_0x7d11('0x13e')](_0x472979[_0x7d11('0x3e')][_0x7d11('0x5c')]);}})[_0x7d11('0x17')](respondWithStatusCode(_0x4793a2,null))[_0x7d11('0x21')](handleError(_0x4793a2,null));};exports[_0x7d11('0x13f')]=function(_0x298ac2,_0x217dbe){var _0x177566={};var _0xdb70dc={};var _0x12fd77;var _0x29278f;return db[_0x7d11('0x3d')]['findOne']({'where':{'id':_0x298ac2[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x217dbe,null))[_0x7d11('0x17')](function(_0x53f190){if(_0x53f190){_0x12fd77=_0x53f190;_0xdb70dc[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0x140')][_0x7d11('0x37')]);_0xdb70dc[_0x7d11('0x3e')]=_['keys'](_0x298ac2[_0x7d11('0x3e')]);_0xdb70dc[_0x7d11('0x4f')]=_['intersection'](_0xdb70dc[_0x7d11('0x4b')],_0xdb70dc[_0x7d11('0x3e')]);_0x177566[_0x7d11('0x40')]=_['intersection'](_0xdb70dc[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x298ac2[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x177566[_0x7d11('0x40')]=_0x177566[_0x7d11('0x40')][_0x7d11('0x67')]?_0x177566[_0x7d11('0x40')]:_0xdb70dc['model'];_0x177566[_0x7d11('0xc9')]=qs['sort'](_0x298ac2[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x177566[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_['pick'](_0x298ac2['query'],_0xdb70dc['filters']));if(_0x298ac2[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x177566[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x177566['where'],{'$or':_[_0x7d11('0x2e')](_0x177566[_0x7d11('0x40')],function(_0x1d45a2){var _0x220de0={};_0x220de0[_0x1d45a2]={'$like':'%'+_0x298ac2[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x220de0;})});}_0x177566=_['merge']({},_0x177566,_0x298ac2['options']);return _0x12fd77[_0x7d11('0x13f')](_0x177566);}})[_0x7d11('0x17')](function(_0x57010b){if(_0x57010b){_0x29278f=_0x57010b[_0x7d11('0x67')];if(!_0x298ac2[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x177566[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x298ac2['query'][_0x7d11('0x25')]);_0x177566[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x298ac2['query'][_0x7d11('0x24')]);}return _0x12fd77[_0x7d11('0x13f')](_0x177566);}})[_0x7d11('0x17')](function(_0x140f77){if(_0x140f77){return _0x140f77?{'count':_0x29278f,'rows':_0x140f77}:null;}})[_0x7d11('0x17')](respondWithResult(_0x217dbe,null))['catch'](handleError(_0x217dbe,null));};exports[_0x7d11('0x141')]=function(_0x46555b,_0x4878e8){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x46555b['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x4878e8,null))[_0x7d11('0x17')](function(_0x472814){if(_0x472814){return _0x472814[_0x7d11('0x141')](_0x46555b[_0x7d11('0x58')]['ids'],_[_0x7d11('0x5b')](_0x46555b[_0x7d11('0x58')],['ids','id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x4878e8,null))[_0x7d11('0x21')](handleError(_0x4878e8,null));};exports[_0x7d11('0x142')]=function(_0x8995aa,_0x2ad2d1){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x8995aa[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ad2d1,null))[_0x7d11('0x17')](function(_0x47bb27){if(_0x47bb27){return _0x47bb27['removeOpenchannelAccounts'](_0x8995aa[_0x7d11('0x3e')][_0x7d11('0x5c')]);}})[_0x7d11('0x17')](respondWithStatusCode(_0x2ad2d1,null))[_0x7d11('0x21')](handleError(_0x2ad2d1,null));};exports[_0x7d11('0x143')]=function(_0x4fdccf,_0x501d66){var _0x12a1d1={};var _0x1bb09f={};var _0x41bef6;var _0x1dbee2;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x4fdccf[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x501d66,null))[_0x7d11('0x17')](function(_0x3d15e7){if(_0x3d15e7){_0x41bef6=_0x3d15e7;_0x1bb09f[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0x144')]['rawAttributes']);_0x1bb09f[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x4fdccf[_0x7d11('0x3e')]);_0x1bb09f['filters']=_['intersection'](_0x1bb09f[_0x7d11('0x4b')],_0x1bb09f[_0x7d11('0x3e')]);_0x12a1d1[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x1bb09f[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x4fdccf['query']['fields']));_0x12a1d1[_0x7d11('0x40')]=_0x12a1d1['attributes'][_0x7d11('0x67')]?_0x12a1d1['attributes']:_0x1bb09f[_0x7d11('0x4b')];_0x12a1d1[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x4fdccf[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x12a1d1[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x4fdccf[_0x7d11('0x3e')],_0x1bb09f[_0x7d11('0x4f')]));if(_0x4fdccf[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x12a1d1[_0x7d11('0x3c')]=_['merge'](_0x12a1d1[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x12a1d1['attributes'],function(_0x42e4cb){var _0x1faadd={};_0x1faadd[_0x42e4cb]={'$like':'%'+_0x4fdccf[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x1faadd;})});}_0x12a1d1=_[_0x7d11('0x53')]({},_0x12a1d1,_0x4fdccf['options']);return _0x41bef6[_0x7d11('0x143')](_0x12a1d1);}})[_0x7d11('0x17')](function(_0x14237e){if(_0x14237e){_0x1dbee2=_0x14237e[_0x7d11('0x67')];if(!_0x4fdccf[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x12a1d1[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x4fdccf[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x12a1d1[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x4fdccf[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x41bef6[_0x7d11('0x143')](_0x12a1d1);}})[_0x7d11('0x17')](function(_0x315980){if(_0x315980){return _0x315980?{'count':_0x1dbee2,'rows':_0x315980}:null;}})[_0x7d11('0x17')](respondWithResult(_0x501d66,null))[_0x7d11('0x21')](handleError(_0x501d66,null));};exports['addSmsAccounts']=function(_0x400e2d,_0x275996){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x400e2d[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x275996,null))[_0x7d11('0x17')](function(_0x383a07){if(_0x383a07){return _0x383a07['addSmsAccounts'](_0x400e2d['body'][_0x7d11('0x5c')],_[_0x7d11('0x5b')](_0x400e2d[_0x7d11('0x58')],[_0x7d11('0x5c'),'id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x275996,null))[_0x7d11('0x21')](handleError(_0x275996,null));};exports['removeSmsAccounts']=function(_0x29f189,_0xd0b10a){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x29f189['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0xd0b10a,null))['then'](function(_0x448f3a){if(_0x448f3a){return _0x448f3a[_0x7d11('0x145')](_0x29f189['query'][_0x7d11('0x5c')]);}})['then'](respondWithStatusCode(_0xd0b10a,null))[_0x7d11('0x21')](handleError(_0xd0b10a,null));};exports['getChatWebsites']=function(_0x16604d,_0x3f273a){var _0x88006f={};var _0x589874={};var _0x429416;var _0x233d16;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x16604d[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x3f273a,null))[_0x7d11('0x17')](function(_0x3f666){if(_0x3f666){_0x429416=_0x3f666;_0x589874[_0x7d11('0x4b')]=_['keys'](db[_0x7d11('0x146')][_0x7d11('0x37')]);_0x589874[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x16604d['query']);_0x589874[_0x7d11('0x4f')]=_['intersection'](_0x589874['model'],_0x589874[_0x7d11('0x3e')]);_0x88006f[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x589874['model'],qs['fields'](_0x16604d[_0x7d11('0x3e')]['fields']));_0x88006f[_0x7d11('0x40')]=_0x88006f[_0x7d11('0x40')]['length']?_0x88006f[_0x7d11('0x40')]:_0x589874[_0x7d11('0x4b')];_0x88006f[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x16604d[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x88006f[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x16604d['query'],_0x589874[_0x7d11('0x4f')]));if(_0x16604d[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x88006f[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x88006f['where'],{'$or':_[_0x7d11('0x2e')](_0x88006f[_0x7d11('0x40')],function(_0x12b9af){var _0x4b17f3={};_0x4b17f3[_0x12b9af]={'$like':'%'+_0x16604d[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x4b17f3;})});}_0x88006f=_[_0x7d11('0x53')]({},_0x88006f,_0x16604d[_0x7d11('0x54')]);return _0x429416['getChatWebsites'](_0x88006f);}})[_0x7d11('0x17')](function(_0x41431f){if(_0x41431f){_0x233d16=_0x41431f[_0x7d11('0x67')];if(!_0x16604d[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x88006f[_0x7d11('0x25')]=qs['limit'](_0x16604d[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x88006f[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x16604d[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x429416[_0x7d11('0x147')](_0x88006f);}})[_0x7d11('0x17')](function(_0x19c880){if(_0x19c880){return _0x19c880?{'count':_0x233d16,'rows':_0x19c880}:null;}})[_0x7d11('0x17')](respondWithResult(_0x3f273a,null))[_0x7d11('0x21')](handleError(_0x3f273a,null));};exports['addChatWebsites']=function(_0x2c5a17,_0x2768f1){return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x2c5a17[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2768f1,null))['then'](function(_0x501349){if(_0x501349){return _0x501349[_0x7d11('0x148')](_0x2c5a17[_0x7d11('0x58')][_0x7d11('0x5c')],_['omit'](_0x2c5a17[_0x7d11('0x58')],['ids','id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x2768f1,null))[_0x7d11('0x21')](handleError(_0x2768f1,null));};exports['removeChatWebsites']=function(_0x279bc6,_0x2e9ace){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x279bc6[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x2e9ace,null))[_0x7d11('0x17')](function(_0x3a4fbe){if(_0x3a4fbe){return _0x3a4fbe[_0x7d11('0x149')](_0x279bc6['query']['ids']);}})['then'](respondWithStatusCode(_0x2e9ace,null))[_0x7d11('0x21')](handleError(_0x2e9ace,null));};exports['getWhatsappAccounts']=function(_0x5891e5,_0x267556){var _0x19a06c={};var _0x2b1b2e={};var _0x3b8ebd;var _0xbc3562;return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x5891e5[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x267556,null))[_0x7d11('0x17')](function(_0x9c7593){if(_0x9c7593){_0x3b8ebd=_0x9c7593;_0x2b1b2e[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0x14a')]['rawAttributes']);_0x2b1b2e[_0x7d11('0x3e')]=_['keys'](_0x5891e5['query']);_0x2b1b2e[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x2b1b2e[_0x7d11('0x4b')],_0x2b1b2e[_0x7d11('0x3e')]);_0x19a06c[_0x7d11('0x40')]=_['intersection'](_0x2b1b2e[_0x7d11('0x4b')],qs['fields'](_0x5891e5[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x19a06c['attributes']=_0x19a06c[_0x7d11('0x40')][_0x7d11('0x67')]?_0x19a06c[_0x7d11('0x40')]:_0x2b1b2e[_0x7d11('0x4b')];_0x19a06c[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x5891e5[_0x7d11('0x3e')]['sort']);_0x19a06c[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x5891e5['query'],_0x2b1b2e[_0x7d11('0x4f')]));if(_0x5891e5[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x19a06c[_0x7d11('0x3c')]=_[_0x7d11('0x53')](_0x19a06c[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x19a06c[_0x7d11('0x40')],function(_0x505a99){var _0x5642d0={};_0x5642d0[_0x505a99]={'$like':'%'+_0x5891e5['query'][_0x7d11('0x3a')]+'%'};return _0x5642d0;})});}_0x19a06c=_[_0x7d11('0x53')]({},_0x19a06c,_0x5891e5['options']);return _0x3b8ebd[_0x7d11('0x14b')](_0x19a06c);}})[_0x7d11('0x17')](function(_0x3a424a){if(_0x3a424a){_0xbc3562=_0x3a424a[_0x7d11('0x67')];if(!_0x5891e5['query'][_0x7d11('0xd2')]('nolimit')){_0x19a06c[_0x7d11('0x25')]=qs['limit'](_0x5891e5[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x19a06c[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x5891e5[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x3b8ebd[_0x7d11('0x14b')](_0x19a06c);}})['then'](function(_0x69d195){if(_0x69d195){return _0x69d195?{'count':_0xbc3562,'rows':_0x69d195}:null;}})[_0x7d11('0x17')](respondWithResult(_0x267556,null))[_0x7d11('0x21')](handleError(_0x267556,null));};exports[_0x7d11('0x14c')]=function(_0x404cf4,_0x3da1ea){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x404cf4[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x3da1ea,null))[_0x7d11('0x17')](function(_0x5bc3c0){if(_0x5bc3c0){return _0x5bc3c0[_0x7d11('0x14c')](_0x404cf4[_0x7d11('0x58')][_0x7d11('0x5c')],_[_0x7d11('0x5b')](_0x404cf4['body'],[_0x7d11('0x5c'),'id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x3da1ea,null))['catch'](handleError(_0x3da1ea,null));};exports[_0x7d11('0x14d')]=function(_0x513209,_0x27f079){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x513209['params']['id']}})['then'](handleEntityNotFound(_0x27f079,null))[_0x7d11('0x17')](function(_0x2f53fe){if(_0x2f53fe){return _0x2f53fe[_0x7d11('0x14d')](_0x513209[_0x7d11('0x3e')][_0x7d11('0x5c')]);}})[_0x7d11('0x17')](respondWithStatusCode(_0x27f079,null))['catch'](handleError(_0x27f079,null));};exports['getSquareProjects']=function(_0x570bf9,_0x33356b){var _0x1662aa={};var _0x14d138={};var _0x217cb8;var _0x65d9ca;return db['User']['findOne']({'where':{'id':_0x570bf9[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x33356b,null))[_0x7d11('0x17')](function(_0x30330d){if(_0x30330d){_0x217cb8=_0x30330d;_0x14d138[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](db[_0x7d11('0x14e')][_0x7d11('0x37')]);_0x14d138[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x570bf9[_0x7d11('0x3e')]);_0x14d138[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x14d138['model'],_0x14d138['query']);_0x1662aa[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x14d138[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x570bf9['query']['fields']));_0x1662aa[_0x7d11('0x40')]=_0x1662aa[_0x7d11('0x40')][_0x7d11('0x67')]?_0x1662aa[_0x7d11('0x40')]:_0x14d138[_0x7d11('0x4b')];_0x1662aa[_0x7d11('0xc9')]=qs[_0x7d11('0xca')](_0x570bf9[_0x7d11('0x3e')][_0x7d11('0xca')]);_0x1662aa[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x570bf9[_0x7d11('0x3e')],_0x14d138[_0x7d11('0x4f')]));if(_0x570bf9[_0x7d11('0x3e')]['filter']){_0x1662aa[_0x7d11('0x3c')]=_['merge'](_0x1662aa[_0x7d11('0x3c')],{'$or':_['map'](_0x1662aa[_0x7d11('0x40')],function(_0x3a657c){var _0x5a25b6={};_0x5a25b6[_0x3a657c]={'$like':'%'+_0x570bf9[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x5a25b6;})});}_0x1662aa=_[_0x7d11('0x53')]({},_0x1662aa,_0x570bf9[_0x7d11('0x54')]);return _0x217cb8[_0x7d11('0x14f')](_0x1662aa);}})[_0x7d11('0x17')](function(_0x5caa62){if(_0x5caa62){_0x65d9ca=_0x5caa62[_0x7d11('0x67')];if(!_0x570bf9[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x1662aa['limit']=qs[_0x7d11('0x25')](_0x570bf9[_0x7d11('0x3e')][_0x7d11('0x25')]);_0x1662aa[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x570bf9[_0x7d11('0x3e')][_0x7d11('0x24')]);}return _0x217cb8['getSquareProjects'](_0x1662aa);}})[_0x7d11('0x17')](function(_0x182462){if(_0x182462){return _0x182462?{'count':_0x65d9ca,'rows':_0x182462}:null;}})['then'](respondWithResult(_0x33356b,null))[_0x7d11('0x21')](handleError(_0x33356b,null));};exports[_0x7d11('0x150')]=function(_0x53b3a5,_0x5d6bfa){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x53b3a5[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x5d6bfa,null))[_0x7d11('0x17')](function(_0x3245c0){if(_0x3245c0){return _0x3245c0[_0x7d11('0x150')](_0x53b3a5['body'][_0x7d11('0x5c')],_[_0x7d11('0x5b')](_0x53b3a5[_0x7d11('0x58')],[_0x7d11('0x5c'),'id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x5d6bfa,null))[_0x7d11('0x21')](handleError(_0x5d6bfa,null));};exports[_0x7d11('0x151')]=function(_0xe342ae,_0x1f891c){return db['User']['find']({'where':{'id':_0xe342ae[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x1f891c,null))['then'](function(_0x432fc3){if(_0x432fc3){return _0x432fc3[_0x7d11('0x151')](_0xe342ae[_0x7d11('0x3e')]['ids']);}})[_0x7d11('0x17')](respondWithStatusCode(_0x1f891c,null))[_0x7d11('0x21')](handleError(_0x1f891c,null));};exports[_0x7d11('0x152')]=function(_0x1ab5f9,_0x5279e5){var _0x4c94b0={},_0x9d61b9={},_0x87786e={'count':0x0,'rows':[]};var _0x5b47b3=db[_0x7d11('0x153')]['rawAttributes'];_0x9d61b9[_0x7d11('0x4b')]=_[_0x7d11('0x4d')](_0x5b47b3);_0x9d61b9[_0x7d11('0x3e')]=_['keys'](_0x1ab5f9['query']);_0x9d61b9[_0x7d11('0x4f')]=_['intersection'](_0x9d61b9[_0x7d11('0x4b')],_0x9d61b9['query']);_0x9d61b9[_0x7d11('0x4f')]=_['concat'](_0x9d61b9[_0x7d11('0x4f')],[_0x7d11('0x154'),_0x7d11('0x155'),_0x7d11('0x156'),_0x7d11('0x157'),_0x7d11('0x158'),_0x7d11('0x159'),'$ne',_0x7d11('0x15a'),'$not','$between','$notBetween',_0x7d11('0x15b'),_0x7d11('0x15c'),_0x7d11('0x15d'),_0x7d11('0x15e'),_0x7d11('0x15f'),_0x7d11('0x160'),'$like',_0x7d11('0x161'),_0x7d11('0x162'),_0x7d11('0x163'),_0x7d11('0x164')]);_0x4c94b0[_0x7d11('0x40')]=_[_0x7d11('0x50')](_0x9d61b9[_0x7d11('0x4b')],qs['fields'](_0x1ab5f9[_0x7d11('0x3e')][_0x7d11('0x51')]));_0x4c94b0[_0x7d11('0x40')]=_0x4c94b0[_0x7d11('0x40')]['length']?_0x4c94b0[_0x7d11('0x40')]:_0x9d61b9[_0x7d11('0x4b')];if(!_0x1ab5f9[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x4c94b0[_0x7d11('0x25')]=qs['limit'](_0x1ab5f9['query'][_0x7d11('0x25')]);_0x4c94b0['offset']=qs[_0x7d11('0x24')](_0x1ab5f9[_0x7d11('0x3e')][_0x7d11('0x24')]);}_0x4c94b0[_0x7d11('0xc9')]=qs['sort'](_0x1ab5f9[_0x7d11('0x3e')]['sort']);_0x4c94b0[_0x7d11('0x3c')]=qs[_0x7d11('0x4f')](_[_0x7d11('0xcb')](_0x1ab5f9[_0x7d11('0x3e')],_0x9d61b9[_0x7d11('0x4f')]));if(_0x1ab5f9[_0x7d11('0x3e')][_0x7d11('0x3a')]){_0x4c94b0[_0x7d11('0x3c')]=_['merge'](_0x4c94b0[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2e')](_0x4c94b0['attributes'],function(_0x4adad8){var _0x320785={};_0x320785[_0x4adad8]={'$like':'%'+_0x1ab5f9[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'};return _0x320785;})});}_0x4c94b0[_0x7d11('0x3c')]={'$and':[_0x4c94b0['where'],{'$or':[{'UserId':_0x1ab5f9[_0x7d11('0x4a')]['id']},{'OwnerId':_0x1ab5f9[_0x7d11('0x4a')]['id']}]}]};_0x4c94b0=_['merge']({},_0x4c94b0,_0x1ab5f9[_0x7d11('0x54')]);var _0x8687b7={'where':_0x4c94b0[_0x7d11('0x3c')]};return db[_0x7d11('0x153')][_0x7d11('0x26')](_0x8687b7)[_0x7d11('0x17')](function(_0x65b634){_0x87786e[_0x7d11('0x26')]=_0x65b634;if(_0x1ab5f9[_0x7d11('0x3e')][_0x7d11('0x52')]){_0x4c94b0[_0x7d11('0x3f')]=[{'attributes':['id','firstName',_0x7d11('0x165'),_0x7d11('0xe4')],'model':db[_0x7d11('0xc8')],'as':_0x7d11('0x166')},{'attributes':['id',_0x7d11('0x34'),'dialActive'],'model':db['VoiceQueue'],'as':'Queue'}];}return db['CmHopper'][_0x7d11('0xa9')](_0x4c94b0);})[_0x7d11('0x17')](function(_0x4f7188){_0x87786e[_0x7d11('0x42')]=_0x4f7188;return _0x87786e;})['then'](respondWithFilteredResult(_0x5279e5,_0x4c94b0))[_0x7d11('0x21')](handleError(_0x5279e5,null));};exports[_0x7d11('0x167')]=function(_0x1d1897,_0x40ca77){if(!_[_0x7d11('0x62')](_0x1d1897[_0x7d11('0x7a')]['id'])&&(_0x1d1897[_0x7d11('0x7a')][_0x7d11('0x31')]==_0x7d11('0x7b')||_0x1d1897[_0x7d11('0x7a')][_0x7d11('0x31')]==_0x7d11('0x7a'))){return db[_0x7d11('0x3d')][_0x7d11('0x93')]({'where':{'id':_0x1d1897[_0x7d11('0x4a')]['id']},'raw':!![]})[_0x7d11('0x17')](function(_0x209804){return authService[_0x7d11('0x168')](_0x209804);})[_0x7d11('0x17')](function(_0x4539f7){if(_0x4539f7){return _0x40ca77[_0x7d11('0x22')](0xc8)[_0x7d11('0x23')]({'api_key':_0x4539f7['token']});}else{return _0x40ca77[_0x7d11('0x22')](0xcc)[_0x7d11('0x23')]({'message':_0x7d11('0x169')});}})[_0x7d11('0x21')](handleError(_0x40ca77,0x193));}else{return _0x40ca77['status'](0x191)[_0x7d11('0x23')]({'message':_0x7d11('0x16a')});}};exports[_0x7d11('0x16b')]=function(_0x261135,_0x5a1a47){if(!_[_0x7d11('0x62')](_0x261135[_0x7d11('0x7a')]['id'])&&(_0x261135[_0x7d11('0x7a')]['role']==_0x7d11('0x7b')||_0x261135['user'][_0x7d11('0x31')]==_0x7d11('0x7a'))){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x261135[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](function(_0x288854){return authService['generateApiKey'](_0x288854);})['then'](function(_0x50a2cc){return db['User']['update']({'apiKeyIat':_0x50a2cc[_0x7d11('0x16c')],'apiKeyNonce':_0x50a2cc[_0x7d11('0x16d')]},{'where':{'id':_0x261135[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](function(){return _0x5a1a47[_0x7d11('0x22')](0xc8)[_0x7d11('0x23')]({'api_key':_0x50a2cc[_0x7d11('0x16e')]});});})['catch'](handleError(_0x5a1a47,0x193));}else{return _0x5a1a47[_0x7d11('0x22')](0x191)[_0x7d11('0x23')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x7d11('0x16f')]=function(_0x262308,_0x248c51){if(!_['isNil'](_0x262308[_0x7d11('0x7a')]['id'])&&(_0x262308[_0x7d11('0x7a')][_0x7d11('0x31')]==_0x7d11('0x7b')||_0x262308[_0x7d11('0x7a')][_0x7d11('0x31')]==_0x7d11('0x7a'))){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x262308[_0x7d11('0x4a')]['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x248c51,null))[_0x7d11('0x17')](function(_0x2280e5){if(_0x2280e5&&_0x2280e5['apiKeyNonce']&&_0x2280e5[_0x7d11('0x170')])return _0x2280e5;else throw{'message':_0x7d11('0x171')};})[_0x7d11('0x17')](function(_0x5ac76d){return db['User'][_0x7d11('0x28')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x262308['params']['id']}});})[_0x7d11('0x17')](respondWithStatusCode(_0x248c51,0xc8))[_0x7d11('0x21')](handleError(_0x248c51,0x193));}else{return _0x248c51[_0x7d11('0x22')](0x191)[_0x7d11('0x23')]({'message':_0x7d11('0x16a')});}};exports[_0x7d11('0x172')]=function(_0x4b2fec,_0xd82924){var _0x45baf2=_0x4b2fec[_0x7d11('0x7a')][_0x7d11('0x29')]({'plain':!![]});if(!_0x45baf2){return _0xd82924[_0x7d11('0x22')](0x191)[_0x7d11('0x35')](_0x7d11('0x173'));}else{return _0xd82924[_0x7d11('0x22')](0xc8)[_0x7d11('0x23')](_0x45baf2);}};exports[_0x7d11('0x174')]=function(_0x12673f,_0x42d19c){var _0x55b3c0={'offset':0x0},_0x2c7e66={'count':0x0,'rows':[]};Promise[_0x7d11('0x175')]()[_0x7d11('0x17')](function(){if(!_0x12673f[_0x7d11('0x3e')][_0x7d11('0x3a')]&&!_0x12673f['query'][_0x7d11('0x176')]&&!_0x12673f['query'][_0x7d11('0x177')])return[];return Promise['resolve']()[_0x7d11('0x17')](function(){var _0x201d41=[];if(!_[_0x7d11('0x87')](_0x12673f[_0x7d11('0x3e')][_0x7d11('0x176')])){_0x201d41[_0x7d11('0x41')](db['Team'][_0x7d11('0xa9')]({'attributes':['id',_0x7d11('0x34')],'where':{'id':_0x12673f[_0x7d11('0x3e')][_0x7d11('0x176')]}}));}if(!_['isEmpty'](_0x12673f[_0x7d11('0x3e')][_0x7d11('0x177')])){_0x201d41[_0x7d11('0x41')](db[_0x7d11('0x178')][_0x7d11('0xa9')]({'attributes':['id',_0x7d11('0x34')],'type':_0x7d11('0x179'),'where':{'id':_0x12673f[_0x7d11('0x3e')][_0x7d11('0x177')]}}));}return Promise[_0x7d11('0x49')](_0x201d41);})[_0x7d11('0x17')](function(_0x2e7d09){var _0x4bb0b9=_[_0x7d11('0x17a')](_0x2e7d09)[_0x7d11('0x2e')](function(_0x172904){return _0x172904[_0x7d11('0x121')]({'attributes':['id',_0x7d11('0x34'),'internal',_0x7d11('0x9b')],'raw':!![]});});return Promise[_0x7d11('0x49')](_0x4bb0b9);})[_0x7d11('0x17')](function(_0x4ea074){var _0x556b16=_['flatten'](_0x4ea074);if(!_0x12673f['query']['filter'])return _0x556b16;if(_[_0x7d11('0x87')](_0x556b16)){return db[_0x7d11('0x3d')]['findAll']({'attributes':['id','name',_0x7d11('0x5d'),_0x7d11('0x9b')],'where':{'role':_0x7d11('0x2c'),'$or':[db[_0x7d11('0x64')][_0x7d11('0x3c')](db['sequelize']['fn'](_0x7d11('0x17b'),db['sequelize'][_0x7d11('0x17c')](_0x7d11('0x34'))),{'$like':'%'+_0x12673f[_0x7d11('0x3e')][_0x7d11('0x3a')][_0x7d11('0xa1')]()+'%'}),{'internal':{'$like':'%'+_0x12673f[_0x7d11('0x3e')][_0x7d11('0x3a')]+'%'}}]},'raw':!![]});}else{return _(_0x556b16)[_0x7d11('0x17a')]()[_0x7d11('0x3a')](function(_0x48712b){return _0x48712b['name'][_0x7d11('0xa1')]()[_0x7d11('0x30')](_0x12673f['query'][_0x7d11('0x3a')]['toLowerCase']())||_0x48712b['internal']['toString']()['includes'](_0x12673f[_0x7d11('0x3e')]['filter']);})['value']();}})[_0x7d11('0x17')](function(_0x51ed6e){var _0x1b7ffe=_0x7d11('0x34');var _0x560746=_0x7d11('0x17d');if(_0x12673f[_0x7d11('0x3e')][_0x7d11('0xca')]){var _0x560746=_0x12673f['query'][_0x7d11('0xca')][0x0]==='-'?_0x7d11('0x17e'):_0x7d11('0x17d');var _0x1b7ffe=_0x560746===_0x7d11('0x17d')?_0x12673f['query'][_0x7d11('0xca')]:_0x12673f[_0x7d11('0x3e')][_0x7d11('0xca')]['substring'](0x1);}return _(_0x51ed6e)[_0x7d11('0x17f')]('id')[_0x7d11('0x180')]([function(_0xa72867){return _0x1b7ffe===_0x7d11('0x34')?_0xa72867[_0x1b7ffe]['toLowerCase']():_0xa72867[_0x1b7ffe];}],[_0x560746])['map'](function(_0x3b00c8){return _[_0x7d11('0xcb')](_0x3b00c8,['id',_0x7d11('0x34'),'internal',_0x7d11('0x9b')]);})[_0x7d11('0x2f')]();})[_0x7d11('0x17')](function(_0x41c798){return client[_0x7d11('0x16')](_0x7d11('0x2b'),_0x12673f)[_0x7d11('0x17')](function(_0xfe99b){if(_0xfe99b[_0x7d11('0x1e')])throw new Error(_0x7d11('0x181'));var _0x54f8ff=_0xfe99b[_0x7d11('0x182')];var _0x28ad74=jayson['client'][_0x7d11('0x15')]({'port':0x232c});return _0x28ad74[_0x7d11('0x16')](_0x7d11('0x2b'),_0x12673f)[_0x7d11('0x17')](function(_0x18af68){if(_0x18af68[_0x7d11('0x1e')])throw new Error(_0x7d11('0x183'));var _0x40c814=_0x18af68['result'];return _[_0x7d11('0x53')]({},_0x40c814,_0x54f8ff);});})[_0x7d11('0x17')](function(_0x516006){return _['map'](_0x41c798,function(_0x50b601){var _0x1df6a0=_[_0x7d11('0x55')](_0x516006[_0x7d11('0x42')],['id',_0x50b601['id']]);if(!_0x1df6a0||!_0x50b601[_0x7d11('0x9b')]){_0x50b601[_0x7d11('0x22')]=_0x7d11('0x184');}else if(_0x1df6a0[_0x7d11('0x9d')]){_0x50b601[_0x7d11('0x22')]=_0x7d11('0xfb');}else{_0x50b601[_0x7d11('0x22')]=_['includes']([_0x7d11('0x185'),_0x7d11('0x186'),'unavailable',_0x7d11('0x187'),null,undefined],_0x1df6a0['voiceStatus'])?_0x7d11('0x9b'):_0x7d11('0x188');}return _0x50b601;});});});})[_0x7d11('0x17')](function(_0x1956c1){if(!_0x12673f[_0x7d11('0x3e')][_0x7d11('0xd2')](_0x7d11('0xd3'))){_0x55b3c0[_0x7d11('0x25')]=qs[_0x7d11('0x25')](_0x12673f['query'][_0x7d11('0x25')]||0xa);_0x55b3c0[_0x7d11('0x24')]=qs[_0x7d11('0x24')](_0x12673f[_0x7d11('0x3e')]['offset']);}_0x2c7e66[_0x7d11('0x26')]=_0x1956c1[_0x7d11('0x67')];_0x2c7e66['rows']=_0x55b3c0['limit']?_0x1956c1[_0x7d11('0x189')](_0x55b3c0[_0x7d11('0x24')],_0x55b3c0[_0x7d11('0x24')]+_0x55b3c0[_0x7d11('0x25')]):_0x1956c1;return _0x2c7e66;})[_0x7d11('0x17')](respondWithFilteredResult(_0x42d19c,_0x55b3c0))[_0x7d11('0x21')](handleError(_0x42d19c,null));};function get_open_tabs(_0x5e4a19,_0x2c24f8){var _0x17b694=_0x5e4a19['charAt'](0x0)[_0x7d11('0x18a')]()+_0x5e4a19['slice'](0x1);var _0x2ef923={'type':db[_0x7d11('0x8e')][_0x7d11('0x65')][_0x7d11('0x66')],'raw':!![]};return new BPromise(function(_0x121399,_0x469eaa){var _0x4839f8=squel[_0x7d11('0x18b')]()[_0x7d11('0x18c')](_0x7d11('0x18d')+_0x17b694+_0x7d11('0x18e'),'id')[_0x7d11('0x18c')]('ui.createdAt')[_0x7d11('0x68')](_0x7d11('0x18f')+_0x5e4a19+_0x7d11('0x190'),'ui')[_0x7d11('0x3c')](_0x7d11('0x191'),_0x2c24f8['id']);return db[_0x7d11('0x64')][_0x7d11('0x3e')](_0x4839f8[_0x7d11('0x192')](),_0x2ef923)[_0x7d11('0x17')](function(_0x35e0a6){_0x2c24f8[_0x17b694+_0x7d11('0x193')]=_0x35e0a6;_0x121399(_0x35e0a6);})[_0x7d11('0x21')](function(_0x4a67af){_0x469eaa(_0x4a67af);});});};
\ No newline at end of file
index 67da97c..0c33325 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2711=['events','User','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x41851b,_0x516539){var _0x6aa729=function(_0x124e8d){while(--_0x124e8d){_0x41851b['push'](_0x41851b['shift']());}};_0x6aa729(++_0x516539);}(_0x2711,0x10a));var _0x1271=function(_0x380736,_0x54f136){_0x380736=_0x380736-0x0;var _0x57e499=_0x2711[_0x380736];return _0x57e499;};'use strict';var EventEmitter=require(_0x1271('0x0'));var User=require('../../mysqldb')['db'][_0x1271('0x1')];var UserEvents=new EventEmitter();UserEvents[_0x1271('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19eb81){return function(_0x30922d,_0x20562a,_0x3f059b){UserEvents[_0x1271('0x3')](_0x19eb81+':'+_0x30922d['id'],_0x30922d);UserEvents[_0x1271('0x3')](_0x19eb81,_0x30922d);_0x3f059b(null);};}for(var e in events){if(events[_0x1271('0x4')](e)){var event=events[e];User[_0x1271('0x5')](e,emitEvent(event));}}module[_0x1271('0x6')]=UserEvents;
\ No newline at end of file
+var _0x0e81=['hasOwnProperty','exports','events','../../mysqldb','User','setMaxListeners','emit'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x0e81,0x72));var _0x10e8=function(_0x59ef3d,_0x5c7aee){_0x59ef3d=_0x59ef3d-0x0;var _0x585558=_0x0e81[_0x59ef3d];return _0x585558;};'use strict';var EventEmitter=require(_0x10e8('0x0'));var User=require(_0x10e8('0x1'))['db'][_0x10e8('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x10e8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x544c87){return function(_0x346761,_0x366c2b,_0x5d68b1){UserEvents[_0x10e8('0x4')](_0x544c87+':'+_0x346761['id'],_0x346761);UserEvents['emit'](_0x544c87,_0x346761);_0x5d68b1(null);};}for(var e in events){if(events[_0x10e8('0x5')](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0x10e8('0x6')]=UserEvents;
\ No newline at end of file
index 200079c..cf4d82a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ea2=['SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','exports','models','define','utf8','utf8_bin','userProfileId','undefined','resolve','find','privacyEnabled','updatePassword','changed','updateMd5Password','VoiceExtension','bulkCreate','context','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password','md5secret',':asterisk:','bluebird','crypto','md5','lodash','./user.attributes','google','length','%s%s','prefix','merge','CDR(type)=%s','chanspy','record','push','MixMonitor','format','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','WAV','from-sip','system','Set','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s'];(function(_0x274e60,_0x1dfabe){var _0x5465cf=function(_0x3abc49){while(--_0x3abc49){_0x274e60['push'](_0x274e60['shift']());}};_0x5465cf(++_0x1dfabe);}(_0x1ea2,0x10b));var _0x21ea=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x1ea2[_0x24f31b];return _0x488401;};'use strict';var BPromise=require(_0x21ea('0x0'));var crypto=require(_0x21ea('0x1'));var util=require('util');var md5=require(_0x21ea('0x2'));var _=require(_0x21ea('0x3'));var attributes=require(_0x21ea('0x4'));var authTypes=[_0x21ea('0x5')];var validatePresenceOf=function(_0x45708e){return _0x45708e&&_0x45708e[_0x21ea('0x6')];};var getChanSpyApplications=function(_0x1c735e,_0x31a327,_0x5af687){var _0x6f6d04={'context':_0x1c735e['context']||'from-sip','type':'system','isApp':![],'UserId':_0x1c735e['id']};var _0x45b945=[];for(var _0x4255a6=0x0,_0x5f1bce=0x1;_0x4255a6<_0x5af687[_0x21ea('0x6')];_0x4255a6++,_0x5f1bce=0x1){var _0x4949a0={'exten':util['format'](_0x21ea('0x7'),_0x5af687[_0x4255a6][_0x21ea('0x8')],_0x31a327),'ChanSpyId':_0x5af687[_0x4255a6]['id']};_0x45b945['push'](_[_0x21ea('0x9')]({'app':'Set','appdata':util['format'](_0x21ea('0xa'),_0x21ea('0xb')),'priority':_0x5f1bce++},_0x6f6d04,_0x4949a0));if(_0x5af687[_0x4255a6][_0x21ea('0xc')]){_0x45b945[_0x21ea('0xd')](_[_0x21ea('0x9')]({'app':_0x21ea('0xe'),'appdata':util[_0x21ea('0xf')]('${UNIQUEID}.%s,a',_0x5af687[_0x4255a6][_0x21ea('0x10')]),'priority':_0x5f1bce++},_0x6f6d04,_0x4949a0));}if(_0x5af687[_0x4255a6]['auth']){_0x45b945[_0x21ea('0xd')](_['merge']({'app':_0x21ea('0x11'),'appdata':_0x5af687[_0x4255a6][_0x21ea('0x12')],'priority':_0x5f1bce++},_0x6f6d04,_0x4949a0));}_0x45b945['push'](_[_0x21ea('0x9')]({'app':_0x21ea('0x13'),'appdata':util['format'](_0x21ea('0x14'),_0x1c735e[_0x21ea('0x15')],_0x5af687[_0x4255a6][_0x21ea('0x16')]?_0x5af687[_0x4255a6][_0x21ea('0x16')][_0x21ea('0x17')](''):''),'priority':_0x5f1bce++},_0x6f6d04,_0x4949a0));if(_0x5af687[_0x4255a6][_0x21ea('0xc')]){_0x45b945['push'](_[_0x21ea('0x9')]({'app':_0x21ea('0x18'),'priority':_0x5f1bce++},_0x6f6d04,_0x4949a0));}}return _0x45b945;};var getUserApplications=function(_0x48ab08,_0x264dc4){var _0x24660e=['wav',_0x21ea('0x19'),'gsm'];var _0x2cf8b4={'context':_0x48ab08['context']||_0x21ea('0x1a'),'exten':_0x264dc4,'type':_0x21ea('0x1b'),'isApp':![],'UserId':_0x48ab08['id']};var _0x508c68=[{'app':_0x21ea('0x1c'),'appdata':_0x21ea('0x1d')}];if(_0x48ab08[_0x21ea('0x1e')]&&_['includes'](_0x24660e,_0x48ab08[_0x21ea('0x1e')])){_0x508c68[_0x21ea('0xd')]({'app':_0x21ea('0x1c'),'appdata':_0x21ea('0x1f')});_0x508c68[_0x21ea('0xd')]({'app':_0x21ea('0x1c'),'appdata':util[_0x21ea('0xf')](_0x21ea('0x20'),_0x48ab08[_0x21ea('0x1e')])});_0x508c68[_0x21ea('0xd')]({'app':'Dial','appdata':util['format'](_0x21ea('0x21'),_0x48ab08['name'])});}else{_0x508c68[_0x21ea('0xd')]({'app':'Dial','appdata':util[_0x21ea('0xf')](_0x21ea('0x22'),_0x48ab08[_0x21ea('0x15')])});}_0x508c68[_0x21ea('0xd')]({'app':_0x21ea('0x23')});for(var _0x38237f=0x0;_0x38237f<_0x508c68[_0x21ea('0x6')];_0x38237f++){_0x508c68[_0x38237f]['priority']=_0x38237f+0x1;_0x508c68[_0x38237f]=_[_0x21ea('0x24')](_0x508c68[_0x38237f],_0x2cf8b4);}return _0x508c68;};var getChanSpyPromise=function(_0xf1c355,_0x1941bc){return new BPromise(function(_0x23ecc1,_0x1f2498){return _0xf1c355[_0x21ea('0x25')][_0x21ea('0x26')]()[_0x21ea('0x27')](function(_0x5a5442){if(_0x5a5442){var _0x36f5c6=getChanSpyApplications(_0x1941bc,_0x1941bc[_0x21ea('0x28')],_0x5a5442);if(_0x1941bc['internal']!=_0x1941bc[_0x21ea('0x15')]){_0x36f5c6=_0x36f5c6[_0x21ea('0x29')](getChanSpyApplications(_0x1941bc,_0x1941bc['name'],_0x5a5442));}return _0x23ecc1(_0x36f5c6);}return _0x23ecc1([]);})[_0x21ea('0x2a')](function(_0x2bb364){_0x1f2498(_0x2bb364);});});};module[_0x21ea('0x2b')]=function(_0x5115a5,_0x4265b1){var _0x45fe83=_0x5115a5[_0x21ea('0x2c')];return _0x5115a5[_0x21ea('0x2d')]('User',attributes,{'tableName':'users','charset':_0x21ea('0x2e'),'collate':_0x21ea('0x2f'),'hooks':{'beforeCreate':function(_0x587686,_0x25b22b,_0x3dd0d1){var _0x7f840c=typeof _0x587686[_0x21ea('0x30')]===_0x21ea('0x31')?BPromise[_0x21ea('0x32')](null):_0x45fe83['UserProfile'][_0x21ea('0x33')]({'where':{'id':_0x587686[_0x21ea('0x30')]}});_0x7f840c[_0x21ea('0x27')](function(_0x2f456d){if(_0x2f456d){_0x587686[_0x21ea('0x34')]=_0x2f456d[_0x21ea('0x34')];}})['then'](function(){_0x587686['updateMd5Password']();_0x587686[_0x21ea('0x35')](_0x3dd0d1);})[_0x21ea('0x2a')](function(_0x2af347){_0x3dd0d1(_0x2af347);});},'beforeUpdate':function(_0x445ad8,_0x44f825,_0x414482){Promise[_0x21ea('0x32')]()[_0x21ea('0x27')](function(){if(_0x445ad8[_0x21ea('0x36')](_0x21ea('0x30'))===![])return;return _0x45fe83['UserProfile'][_0x21ea('0x33')]({'where':{'id':_0x445ad8['userProfileId']}})['then'](function(_0x2dd01b){if(_0x2dd01b)_0x445ad8[_0x21ea('0x34')]=_0x2dd01b[_0x21ea('0x34')];return;});})['then'](function(){if(_0x445ad8[_0x21ea('0x36')](_0x21ea('0x12'))){_0x445ad8[_0x21ea('0x37')]();return _0x445ad8['updatePassword'](_0x414482);}_0x414482();})[_0x21ea('0x2a')](function(_0x501606){_0x414482(_0x501606);});},'afterCreate':function(_0x3ac3fe,_0x5a0875,_0x1254de){var _0x39ed7e=getUserApplications(_0x3ac3fe,_0x3ac3fe['internal']);if(_0x3ac3fe[_0x21ea('0x28')]!=_0x3ac3fe[_0x21ea('0x15')]){_0x39ed7e=_0x39ed7e[_0x21ea('0x29')](getUserApplications(_0x3ac3fe,_0x3ac3fe[_0x21ea('0x15')]));}return _0x45fe83[_0x21ea('0x38')]['bulkCreate'](_0x39ed7e)[_0x21ea('0x27')](function(){if(_0x3ac3fe['chanspy']){return getChanSpyPromise(_0x45fe83,_0x3ac3fe);}})['then'](function(_0x26669e){if(_0x26669e&&_0x26669e['length']){return _0x45fe83[_0x21ea('0x38')][_0x21ea('0x39')](_0x26669e);}})[_0x21ea('0x27')](function(){_0x1254de();})[_0x21ea('0x2a')](function(_0x539055){_0x1254de(_0x539055);});},'afterUpdate':function(_0xe0a3a0,_0x1011e7,_0x4fd0c0){return BPromise[_0x21ea('0x32')]()['then'](function(){if(_0xe0a3a0[_0x21ea('0x36')]('chanspy')||_0xe0a3a0[_0x21ea('0x36')](_0x21ea('0x3a'))){return _0x45fe83['VoiceExtension'][_0x21ea('0x3b')]({'where':{'UserId':_0xe0a3a0['id'],'type':_0x21ea('0x1b'),'ChanSpyId':{'$ne':null}}})[_0x21ea('0x27')](function(){if(_0xe0a3a0[_0x21ea('0xb')]){return getChanSpyPromise(_0x45fe83,_0xe0a3a0)[_0x21ea('0x27')](function(_0x5b254c){if(_0x5b254c&&_0x5b254c['length']){return _0x45fe83[_0x21ea('0x38')][_0x21ea('0x39')](_0x5b254c);}});}});}})[_0x21ea('0x27')](function(){if(_0xe0a3a0[_0x21ea('0x36')](_0x21ea('0x1e'))||_0xe0a3a0[_0x21ea('0x36')](_0x21ea('0x3a'))){return _0x45fe83[_0x21ea('0x38')]['destroy']({'where':{'UserId':_0xe0a3a0['id'],'type':_0x21ea('0x1b'),'ChanSpyId':null}})[_0x21ea('0x27')](function(){var _0x4a6f9d=getUserApplications(_0xe0a3a0,_0xe0a3a0[_0x21ea('0x28')]);if(_0xe0a3a0['internal']!=_0xe0a3a0[_0x21ea('0x15')]){_0x4a6f9d=_0x4a6f9d[_0x21ea('0x29')](getUserApplications(_0xe0a3a0,_0xe0a3a0['name']));}return _0x45fe83[_0x21ea('0x38')][_0x21ea('0x39')](_0x4a6f9d);});}})['then'](function(){_0x4fd0c0();})[_0x21ea('0x2a')](function(_0x2abcf9){_0x4fd0c0(_0x2abcf9);});},'afterDestroy':function(_0x50af56,_0x2b73b6){return _0x45fe83[_0x21ea('0x38')]['destroy']({'where':{'UserId':_0x50af56['id'],'type':_0x21ea('0x1b')}});}},'instanceMethods':{'authenticate':function(_0x5e9d17,_0x49d412){if(!_0x49d412){return this[_0x21ea('0x12')]===this['encryptPassword'](_0x5e9d17);}var _0x5ac4c7=this;this[_0x21ea('0x3c')](_0x5e9d17,function(_0x4e1991,_0x505f2a){if(_0x4e1991){_0x49d412(_0x4e1991);}if(_0x5ac4c7[_0x21ea('0x12')]===_0x505f2a){_0x49d412(null,!![]);}else{_0x49d412(null,![]);}});},'makeSalt':function(_0x5e5849,_0x2689a0){var _0x186fd9=0x10;if(typeof arguments[0x0]===_0x21ea('0x3d')){_0x2689a0=arguments[0x0];_0x5e5849=_0x186fd9;}else if(typeof arguments[0x1]===_0x21ea('0x3d')){_0x2689a0=arguments[0x1];}else{throw new Error(_0x21ea('0x3e'));}if(!_0x5e5849){_0x5e5849=_0x186fd9;}return crypto[_0x21ea('0x3f')](_0x5e5849,function(_0x2099f4,_0x5b2cd3){if(_0x2099f4){_0x2689a0(_0x2099f4);}return _0x2689a0(null,_0x5b2cd3[_0x21ea('0x40')](_0x21ea('0x41')));});},'encryptPassword':function(_0x257d92,_0xd933bc){if(!_0x257d92||!this[_0x21ea('0x42')]){return _0xd933bc?_0xd933bc(null):null;}var _0x2119bc=0x2710;var _0x312143=0x40;var _0x27d123=new Buffer(this[_0x21ea('0x42')],_0x21ea('0x41'));if(!_0xd933bc){return crypto[_0x21ea('0x43')](_0x257d92,_0x27d123,_0x2119bc,_0x312143,_0x21ea('0x44'))[_0x21ea('0x40')](_0x21ea('0x41'));}return crypto[_0x21ea('0x45')](_0x257d92,_0x27d123,_0x2119bc,_0x312143,'sha1',function(_0x2d213d,_0x40bcd0){if(_0x2d213d){_0xd933bc(_0x2d213d);}return _0xd933bc(null,_0x40bcd0[_0x21ea('0x40')]('base64'));});},'updatePassword':function(_0x3a0754){if(!this['password']){return _0x3a0754(null);}if(!validatePresenceOf(this[_0x21ea('0x12')])&&authTypes[_0x21ea('0x46')](this[_0x21ea('0x47')])===-0x1){_0x3a0754(new Error(_0x21ea('0x48')));}var _0x2f3176=this;this['makeSalt'](function(_0x1c6f99,_0x3b86f4){if(_0x1c6f99){return _0x3a0754(_0x1c6f99);}_0x2f3176[_0x21ea('0x42')]=_0x3b86f4;_0x2f3176[_0x21ea('0x3c')](_0x2f3176[_0x21ea('0x12')],function(_0x1b57d5,_0x41b11b){if(_0x1b57d5){_0x3a0754(_0x1b57d5);}_0x2f3176[_0x21ea('0x12')]=_0x41b11b;_0x3a0754(null);});});},'updateMd5Password':function(){this[_0x21ea('0x49')]=md5(this[_0x21ea('0x15')]+_0x21ea('0x4a')+this[_0x21ea('0x12')]);return this['md5secret'];}}});};
\ No newline at end of file
+var _0xab51=['./user.attributes','context','from-sip','system','length','format','%s%s','prefix','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','push','SIP/%s,%s','name','options','join','StopMixMonitor','wav','WAV','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','internal','concat','catch','models','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','find','then','privacyEnabled','updateMd5Password','changed','password','updatePassword','VoiceExtension','bulkCreate','destroy','encryptPassword','function','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','md5secret',':asterisk:','crypto','util','lodash'];(function(_0x257fc5,_0x33de03){var _0x3703d8=function(_0x29fde0){while(--_0x29fde0){_0x257fc5['push'](_0x257fc5['shift']());}};_0x3703d8(++_0x33de03);}(_0xab51,0x85));var _0x1ab5=function(_0x59a352,_0x4eca78){_0x59a352=_0x59a352-0x0;var _0x465c0b=_0xab51[_0x59a352];return _0x465c0b;};'use strict';var BPromise=require('bluebird');var crypto=require(_0x1ab5('0x0'));var util=require(_0x1ab5('0x1'));var md5=require('md5');var _=require(_0x1ab5('0x2'));var attributes=require(_0x1ab5('0x3'));var authTypes=['google'];var validatePresenceOf=function(_0x1a8ca8){return _0x1a8ca8&&_0x1a8ca8['length'];};var getChanSpyApplications=function(_0x52fd54,_0x52e64f,_0x2cf271){var _0x301fa5={'context':_0x52fd54[_0x1ab5('0x4')]||_0x1ab5('0x5'),'type':_0x1ab5('0x6'),'isApp':![],'UserId':_0x52fd54['id']};var _0x92a5b9=[];for(var _0x3b5909=0x0,_0x4a6c2c=0x1;_0x3b5909<_0x2cf271[_0x1ab5('0x7')];_0x3b5909++,_0x4a6c2c=0x1){var _0x5d93a3={'exten':util[_0x1ab5('0x8')](_0x1ab5('0x9'),_0x2cf271[_0x3b5909][_0x1ab5('0xa')],_0x52e64f),'ChanSpyId':_0x2cf271[_0x3b5909]['id']};_0x92a5b9['push'](_[_0x1ab5('0xb')]({'app':_0x1ab5('0xc'),'appdata':util[_0x1ab5('0x8')](_0x1ab5('0xd'),_0x1ab5('0xe')),'priority':_0x4a6c2c++},_0x301fa5,_0x5d93a3));if(_0x2cf271[_0x3b5909][_0x1ab5('0xf')]){_0x92a5b9['push'](_[_0x1ab5('0xb')]({'app':_0x1ab5('0x10'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x2cf271[_0x3b5909][_0x1ab5('0x11')]),'priority':_0x4a6c2c++},_0x301fa5,_0x5d93a3));}if(_0x2cf271[_0x3b5909]['auth']){_0x92a5b9[_0x1ab5('0x12')](_[_0x1ab5('0xb')]({'app':'Authenticate','appdata':_0x2cf271[_0x3b5909]['password'],'priority':_0x4a6c2c++},_0x301fa5,_0x5d93a3));}_0x92a5b9[_0x1ab5('0x12')](_['merge']({'app':'ChanSpy','appdata':util[_0x1ab5('0x8')](_0x1ab5('0x13'),_0x52fd54[_0x1ab5('0x14')],_0x2cf271[_0x3b5909][_0x1ab5('0x15')]?_0x2cf271[_0x3b5909][_0x1ab5('0x15')][_0x1ab5('0x16')](''):''),'priority':_0x4a6c2c++},_0x301fa5,_0x5d93a3));if(_0x2cf271[_0x3b5909][_0x1ab5('0xf')]){_0x92a5b9[_0x1ab5('0x12')](_[_0x1ab5('0xb')]({'app':_0x1ab5('0x17'),'priority':_0x4a6c2c++},_0x301fa5,_0x5d93a3));}}return _0x92a5b9;};var getUserApplications=function(_0x514f30,_0x25c864){var _0x14b0e7=[_0x1ab5('0x18'),_0x1ab5('0x19'),'gsm'];var _0x33a39d={'context':_0x514f30[_0x1ab5('0x4')]||_0x1ab5('0x5'),'exten':_0x25c864,'type':_0x1ab5('0x6'),'isApp':![],'UserId':_0x514f30['id']};var _0x44855=[{'app':_0x1ab5('0xc'),'appdata':_0x1ab5('0x1a')}];if(_0x514f30[_0x1ab5('0x1b')]&&_['includes'](_0x14b0e7,_0x514f30[_0x1ab5('0x1b')])){_0x44855[_0x1ab5('0x12')]({'app':_0x1ab5('0xc'),'appdata':_0x1ab5('0x1c')});_0x44855['push']({'app':_0x1ab5('0xc'),'appdata':util[_0x1ab5('0x8')](_0x1ab5('0x1d'),_0x514f30[_0x1ab5('0x1b')])});_0x44855[_0x1ab5('0x12')]({'app':_0x1ab5('0x1e'),'appdata':util[_0x1ab5('0x8')](_0x1ab5('0x1f'),_0x514f30['name'])});}else{_0x44855[_0x1ab5('0x12')]({'app':_0x1ab5('0x1e'),'appdata':util[_0x1ab5('0x8')](_0x1ab5('0x20'),_0x514f30[_0x1ab5('0x14')])});}_0x44855[_0x1ab5('0x12')]({'app':_0x1ab5('0x21')});for(var _0xd81bf2=0x0;_0xd81bf2<_0x44855[_0x1ab5('0x7')];_0xd81bf2++){_0x44855[_0xd81bf2][_0x1ab5('0x22')]=_0xd81bf2+0x1;_0x44855[_0xd81bf2]=_[_0x1ab5('0x23')](_0x44855[_0xd81bf2],_0x33a39d);}return _0x44855;};var getChanSpyPromise=function(_0x1c745e,_0x21a657){return new BPromise(function(_0x3fe5ac,_0x3ec162){return _0x1c745e[_0x1ab5('0x24')][_0x1ab5('0x25')]()['then'](function(_0x4758b0){if(_0x4758b0){var _0x18319e=getChanSpyApplications(_0x21a657,_0x21a657[_0x1ab5('0x26')],_0x4758b0);if(_0x21a657['internal']!=_0x21a657['name']){_0x18319e=_0x18319e[_0x1ab5('0x27')](getChanSpyApplications(_0x21a657,_0x21a657[_0x1ab5('0x14')],_0x4758b0));}return _0x3fe5ac(_0x18319e);}return _0x3fe5ac([]);})[_0x1ab5('0x28')](function(_0x2dc062){_0x3ec162(_0x2dc062);});});};module['exports']=function(_0x35aeb8,_0x4f260f){var _0x4dee83=_0x35aeb8[_0x1ab5('0x29')];return _0x35aeb8['define']('User',attributes,{'tableName':'users','charset':_0x1ab5('0x2a'),'collate':_0x1ab5('0x2b'),'hooks':{'beforeCreate':function(_0x58aad7,_0x578233,_0x42c882){var _0x39beb4=typeof _0x58aad7[_0x1ab5('0x2c')]===_0x1ab5('0x2d')?BPromise[_0x1ab5('0x2e')](null):_0x4dee83[_0x1ab5('0x2f')][_0x1ab5('0x30')]({'where':{'id':_0x58aad7[_0x1ab5('0x2c')]}});_0x39beb4[_0x1ab5('0x31')](function(_0x40bb07){if(_0x40bb07){_0x58aad7['privacyEnabled']=_0x40bb07[_0x1ab5('0x32')];}})[_0x1ab5('0x31')](function(){_0x58aad7[_0x1ab5('0x33')]();_0x58aad7['updatePassword'](_0x42c882);})[_0x1ab5('0x28')](function(_0x50f78e){_0x42c882(_0x50f78e);});},'beforeUpdate':function(_0x328715,_0x52d3da,_0x1a3c41){Promise['resolve']()[_0x1ab5('0x31')](function(){if(_0x328715[_0x1ab5('0x34')](_0x1ab5('0x2c'))===![])return;return _0x4dee83['UserProfile'][_0x1ab5('0x30')]({'where':{'id':_0x328715[_0x1ab5('0x2c')]}})[_0x1ab5('0x31')](function(_0x10b74e){if(_0x10b74e)_0x328715[_0x1ab5('0x32')]=_0x10b74e[_0x1ab5('0x32')];return;});})[_0x1ab5('0x31')](function(){if(_0x328715[_0x1ab5('0x34')](_0x1ab5('0x35'))){_0x328715[_0x1ab5('0x33')]();return _0x328715[_0x1ab5('0x36')](_0x1a3c41);}_0x1a3c41();})[_0x1ab5('0x28')](function(_0x3adcf2){_0x1a3c41(_0x3adcf2);});},'afterCreate':function(_0x9d907e,_0x4936f2,_0x5aa1dc){var _0x5799a9=getUserApplications(_0x9d907e,_0x9d907e[_0x1ab5('0x26')]);if(_0x9d907e[_0x1ab5('0x26')]!=_0x9d907e[_0x1ab5('0x14')]){_0x5799a9=_0x5799a9[_0x1ab5('0x27')](getUserApplications(_0x9d907e,_0x9d907e['name']));}return _0x4dee83[_0x1ab5('0x37')][_0x1ab5('0x38')](_0x5799a9)[_0x1ab5('0x31')](function(){if(_0x9d907e[_0x1ab5('0xe')]){return getChanSpyPromise(_0x4dee83,_0x9d907e);}})[_0x1ab5('0x31')](function(_0x2d4978){if(_0x2d4978&&_0x2d4978[_0x1ab5('0x7')]){return _0x4dee83['VoiceExtension'][_0x1ab5('0x38')](_0x2d4978);}})['then'](function(){_0x5aa1dc();})['catch'](function(_0x2b5f17){_0x5aa1dc(_0x2b5f17);});},'afterUpdate':function(_0x55e2d6,_0x479adc,_0x4e06e3){return BPromise[_0x1ab5('0x2e')]()['then'](function(){if(_0x55e2d6[_0x1ab5('0x34')](_0x1ab5('0xe'))||_0x55e2d6[_0x1ab5('0x34')](_0x1ab5('0x4'))){return _0x4dee83[_0x1ab5('0x37')][_0x1ab5('0x39')]({'where':{'UserId':_0x55e2d6['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0x1ab5('0x31')](function(){if(_0x55e2d6['chanspy']){return getChanSpyPromise(_0x4dee83,_0x55e2d6)[_0x1ab5('0x31')](function(_0x39badc){if(_0x39badc&&_0x39badc['length']){return _0x4dee83[_0x1ab5('0x37')][_0x1ab5('0x38')](_0x39badc);}});}});}})[_0x1ab5('0x31')](function(){if(_0x55e2d6[_0x1ab5('0x34')]('extensionMonitor')||_0x55e2d6['changed']('context')){return _0x4dee83[_0x1ab5('0x37')]['destroy']({'where':{'UserId':_0x55e2d6['id'],'type':'system','ChanSpyId':null}})[_0x1ab5('0x31')](function(){var _0x32b479=getUserApplications(_0x55e2d6,_0x55e2d6[_0x1ab5('0x26')]);if(_0x55e2d6['internal']!=_0x55e2d6['name']){_0x32b479=_0x32b479[_0x1ab5('0x27')](getUserApplications(_0x55e2d6,_0x55e2d6['name']));}return _0x4dee83['VoiceExtension']['bulkCreate'](_0x32b479);});}})[_0x1ab5('0x31')](function(){_0x4e06e3();})[_0x1ab5('0x28')](function(_0x1f6fad){_0x4e06e3(_0x1f6fad);});},'afterDestroy':function(_0x149e65,_0x45e867){return _0x4dee83[_0x1ab5('0x37')][_0x1ab5('0x39')]({'where':{'UserId':_0x149e65['id'],'type':_0x1ab5('0x6')}});}},'instanceMethods':{'authenticate':function(_0x5860b6,_0x1cd955){if(!_0x1cd955){return this[_0x1ab5('0x35')]===this[_0x1ab5('0x3a')](_0x5860b6);}var _0x563120=this;this[_0x1ab5('0x3a')](_0x5860b6,function(_0x25df81,_0x35587f){if(_0x25df81){_0x1cd955(_0x25df81);}if(_0x563120[_0x1ab5('0x35')]===_0x35587f){_0x1cd955(null,!![]);}else{_0x1cd955(null,![]);}});},'makeSalt':function(_0x3b70fb,_0x464e1b){var _0x413305=0x10;if(typeof arguments[0x0]===_0x1ab5('0x3b')){_0x464e1b=arguments[0x0];_0x3b70fb=_0x413305;}else if(typeof arguments[0x1]===_0x1ab5('0x3b')){_0x464e1b=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x3b70fb){_0x3b70fb=_0x413305;}return crypto[_0x1ab5('0x3c')](_0x3b70fb,function(_0x42762e,_0x56f2ca){if(_0x42762e){_0x464e1b(_0x42762e);}return _0x464e1b(null,_0x56f2ca[_0x1ab5('0x3d')](_0x1ab5('0x3e')));});},'encryptPassword':function(_0x345c4c,_0x4466bb){if(!_0x345c4c||!this[_0x1ab5('0x3f')]){return _0x4466bb?_0x4466bb(null):null;}var _0x3253b1=0x2710;var _0x52fb86=0x40;var _0x5701af=new Buffer(this['salt'],'base64');if(!_0x4466bb){return crypto[_0x1ab5('0x40')](_0x345c4c,_0x5701af,_0x3253b1,_0x52fb86,'sha1')[_0x1ab5('0x3d')](_0x1ab5('0x3e'));}return crypto['pbkdf2'](_0x345c4c,_0x5701af,_0x3253b1,_0x52fb86,_0x1ab5('0x41'),function(_0x562a93,_0x5b71a3){if(_0x562a93){_0x4466bb(_0x562a93);}return _0x4466bb(null,_0x5b71a3['toString'](_0x1ab5('0x3e')));});},'updatePassword':function(_0x1dfcc4){if(!this[_0x1ab5('0x35')]){return _0x1dfcc4(null);}if(!validatePresenceOf(this['password'])&&authTypes['indexOf'](this['provider'])===-0x1){_0x1dfcc4(new Error('Invalid\x20password'));}var _0x2a85f7=this;this['makeSalt'](function(_0x37fc2a,_0x510168){if(_0x37fc2a){return _0x1dfcc4(_0x37fc2a);}_0x2a85f7[_0x1ab5('0x3f')]=_0x510168;_0x2a85f7[_0x1ab5('0x3a')](_0x2a85f7['password'],function(_0xc94d7c,_0xa89f15){if(_0xc94d7c){_0x1dfcc4(_0xc94d7c);}_0x2a85f7[_0x1ab5('0x35')]=_0xa89f15;_0x1dfcc4(null);});});},'updateMd5Password':function(){this[_0x1ab5('0x42')]=md5(this[_0x1ab5('0x14')]+_0x1ab5('0x43')+this[_0x1ab5('0x35')]);return this[_0x1ab5('0x42')];}}});};
\ No newline at end of file
index 53f0312..976fad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dce=['request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetUser','User','findAll','raw','options','where','include','map','model','attributes','stringify','ShowUser','find','PauseUser','name','role','internal','interface','UserVoiceQueueRt','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','update','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','system','mail','whatsapp','set','%s%s','Pause','forEach','push','LogoutUser','destroy','all','mobile','phone','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./user.socket','request','then','info','User,\x20%s,\x20%s'];(function(_0x12fc17,_0x5507fb){var _0x356b08=function(_0x1c54ab){while(--_0x1c54ab){_0x12fc17['push'](_0x12fc17['shift']());}};_0x356b08(++_0x5507fb);}(_0x2dce,0x1ba));var _0xe2dc=function(_0x5ae487,_0x563458){_0x5ae487=_0x5ae487-0x0;var _0x1be85b=_0x2dce[_0x5ae487];return _0x1be85b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe2dc('0x0'));var BPromise=require(_0xe2dc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2dc('0x2'));var db=require(_0xe2dc('0x3'))['db'];var utils=require(_0xe2dc('0x4'));var logger=require(_0xe2dc('0x5'))(_0xe2dc('0x6'));var config=require('../../config/environment');var jayson=require(_0xe2dc('0x7'));var client=jayson[_0xe2dc('0x8')][_0xe2dc('0x9')]({'port':0x232a});config[_0xe2dc('0xa')]=_[_0xe2dc('0xb')](config[_0xe2dc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe2dc('0xc'))(new Redis(config[_0xe2dc('0xa')]));require(_0xe2dc('0xd'))['register'](socket);function respondWithRpcPromise(_0x3b8083,_0x2611c4,_0x183dc4){return new BPromise(function(_0x4fc3be,_0x431d71){return client[_0xe2dc('0xe')](_0x3b8083,_0x183dc4)[_0xe2dc('0xf')](function(_0x4612f3){logger[_0xe2dc('0x10')](_0xe2dc('0x11'),_0x2611c4,_0xe2dc('0x12'));logger[_0xe2dc('0x13')](_0xe2dc('0x14'),_0x2611c4,_0xe2dc('0x12'),JSON['stringify'](_0x4612f3));if(_0x4612f3[_0xe2dc('0x15')]){if(_0x4612f3[_0xe2dc('0x15')][_0xe2dc('0x16')]===0x1f4){logger[_0xe2dc('0x15')]('User,\x20%s,\x20%s',_0x2611c4,_0x4612f3[_0xe2dc('0x15')][_0xe2dc('0x17')]);return _0x431d71(_0x4612f3[_0xe2dc('0x15')][_0xe2dc('0x17')]);}logger['error'](_0xe2dc('0x11'),_0x2611c4,_0x4612f3[_0xe2dc('0x15')][_0xe2dc('0x17')]);return _0x4fc3be(_0x4612f3[_0xe2dc('0x15')][_0xe2dc('0x17')]);}else{logger[_0xe2dc('0x10')]('User,\x20%s,\x20%s',_0x2611c4,_0xe2dc('0x12'));_0x4fc3be(_0x4612f3[_0xe2dc('0x18')][_0xe2dc('0x17')]);}})[_0xe2dc('0x19')](function(_0x490ad8){logger['error'](_0xe2dc('0x11'),_0x2611c4,_0x490ad8);_0x431d71(_0x490ad8);});});}exports[_0xe2dc('0x1a')]=function(_0x22584d){var _0x197e9d=this;return new Promise(function(_0x283070,_0x4328c3){return db[_0xe2dc('0x1b')][_0xe2dc('0x1c')]({'raw':_0x22584d['options']?_0x22584d['options'][_0xe2dc('0x1d')]===undefined?!![]:![]:!![],'where':_0x22584d['options']?_0x22584d[_0xe2dc('0x1e')][_0xe2dc('0x1f')]||null:null,'attributes':_0x22584d[_0xe2dc('0x1e')]?_0x22584d[_0xe2dc('0x1e')]['attributes']||null:null,'limit':_0x22584d[_0xe2dc('0x1e')]?_0x22584d[_0xe2dc('0x1e')]['limit']||null:null,'include':_0x22584d['options']?_0x22584d[_0xe2dc('0x1e')][_0xe2dc('0x20')]?_[_0xe2dc('0x21')](_0x22584d[_0xe2dc('0x1e')]['include'],function(_0xb96ec1){return{'model':db[_0xb96ec1[_0xe2dc('0x22')]],'as':_0xb96ec1['as'],'attributes':_0xb96ec1[_0xe2dc('0x23')],'include':_0xb96ec1['include']?_[_0xe2dc('0x21')](_0xb96ec1[_0xe2dc('0x20')],function(_0x50741b){return{'model':db[_0x50741b['model']],'as':_0x50741b['as'],'attributes':_0x50741b['attributes'],'include':_0x50741b[_0xe2dc('0x20')]?_[_0xe2dc('0x21')](_0x50741b['include'],function(_0x4e9493){return{'model':db[_0x4e9493[_0xe2dc('0x22')]],'as':_0x4e9493['as'],'attributes':_0x4e9493[_0xe2dc('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe2dc('0xf')](function(_0x5faef9){logger[_0xe2dc('0x10')](_0xe2dc('0x1a'),_0x22584d);logger['debug']('GetUser',_0x22584d,JSON[_0xe2dc('0x24')](_0x5faef9));_0x283070(_0x5faef9);})[_0xe2dc('0x19')](function(_0x4b6c25){logger['error'](_0xe2dc('0x1a'),_0x4b6c25['message'],_0x22584d);_0x4328c3(_0x197e9d['error'](0x1f4,_0x4b6c25[_0xe2dc('0x17')]));});});};exports[_0xe2dc('0x25')]=function(_0x215259){var _0x5b6911=this;return new Promise(function(_0x4dc406,_0x2cb17a){return db[_0xe2dc('0x1b')][_0xe2dc('0x26')]({'raw':_0x215259['options']?_0x215259[_0xe2dc('0x1e')][_0xe2dc('0x1d')]===undefined?!![]:![]:!![],'where':_0x215259[_0xe2dc('0x1e')]?_0x215259[_0xe2dc('0x1e')][_0xe2dc('0x1f')]||null:null,'attributes':_0x215259[_0xe2dc('0x1e')]?_0x215259[_0xe2dc('0x1e')][_0xe2dc('0x23')]||null:null,'include':_0x215259[_0xe2dc('0x1e')]?_0x215259[_0xe2dc('0x1e')][_0xe2dc('0x20')]?_[_0xe2dc('0x21')](_0x215259['options'][_0xe2dc('0x20')],function(_0x2b224b){return{'model':db[_0x2b224b['model']],'as':_0x2b224b['as'],'attributes':_0x2b224b[_0xe2dc('0x23')],'include':_0x2b224b['include']?_[_0xe2dc('0x21')](_0x2b224b[_0xe2dc('0x20')],function(_0x2b6fcd){return{'model':db[_0x2b6fcd[_0xe2dc('0x22')]],'as':_0x2b6fcd['as'],'attributes':_0x2b6fcd[_0xe2dc('0x23')],'include':_0x2b6fcd[_0xe2dc('0x20')]?_[_0xe2dc('0x21')](_0x2b6fcd[_0xe2dc('0x20')],function(_0x4efac5){return{'model':db[_0x4efac5[_0xe2dc('0x22')]],'as':_0x4efac5['as'],'attributes':_0x4efac5[_0xe2dc('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe2dc('0xf')](function(_0x5b725c){logger[_0xe2dc('0x10')]('ShowUser',_0x215259);logger[_0xe2dc('0x13')](_0xe2dc('0x25'),_0x215259,JSON[_0xe2dc('0x24')](_0x5b725c));_0x4dc406(_0x5b725c);})[_0xe2dc('0x19')](function(_0x191bd3){logger[_0xe2dc('0x15')]('ShowUser',_0x191bd3[_0xe2dc('0x17')],_0x215259);_0x2cb17a(_0x5b6911[_0xe2dc('0x15')](0x1f4,_0x191bd3[_0xe2dc('0x17')]));});});};exports[_0xe2dc('0x27')]=function(_0x49badf){var _0x43494e=this;return new Promise(function(_0x482dad,_0x33c902){var _0x11bc43;return db[_0xe2dc('0x1b')][_0xe2dc('0x26')]({'where':_0x49badf['options'][_0xe2dc('0x1f')]||{},'attributes':['id',_0xe2dc('0x28'),_0xe2dc('0x29'),_0xe2dc('0x2a'),_0xe2dc('0x2b')]})[_0xe2dc('0xf')](function(_0x1bc4ce){if(_0x1bc4ce){_0x11bc43=_0x1bc4ce;return db[_0xe2dc('0x2c')]['update']({'paused':0x1},{'where':{'UserId':_0x11bc43['id']},'individualHooks':!![]});}})[_0xe2dc('0xf')](function(){if(_0x11bc43){return db[_0xe2dc('0x2d')][_0xe2dc('0x1c')]({'where':{'membername':_0x11bc43[_0xe2dc('0x28')],'type':'PAUSE','exitAt':null}});}})[_0xe2dc('0xf')](function(_0x4a49f0){if(_0x11bc43){if(_0x4a49f0&&_0x4a49f0[_0xe2dc('0x2e')]){var _0x51ef96=moment()[_0xe2dc('0x2f')](_0xe2dc('0x30'));for(var _0x3b8c0f=0x0,_0x2e90fe=_0x4a49f0[_0xe2dc('0x2e')];_0x3b8c0f<_0x2e90fe;_0x3b8c0f++){_0x4a49f0[_0x3b8c0f][_0xe2dc('0x31')]({'exitAt':_0x51ef96});}}}})[_0xe2dc('0xf')](function(){if(_0x11bc43){var _0x4a9852=[];var _0x3eca58=utils[_0xe2dc('0x32')]();_0x3eca58['forEach'](function(_0x5ca2be){_0x4a9852['push']({'channel':_0x5ca2be,'membername':_0x11bc43['name'],'interface':_['isNil'](_0x11bc43['interface'])?util[_0xe2dc('0x2f')](_0xe2dc('0x33'),_0x11bc43[_0xe2dc('0x28')]):_0x11bc43['interface'],'type':_0xe2dc('0x34'),'enterAt':moment()['format'](_0xe2dc('0x30')),'data1':_0x49badf[_0xe2dc('0x35')][_0xe2dc('0x36')]||_0xe2dc('0x37'),'role':_0x11bc43['role'],'internal':_0x11bc43[_0xe2dc('0x2a')],'uniqueid':_0x49badf[_0xe2dc('0x35')][_0xe2dc('0x38')]||null});});return db[_0xe2dc('0x2d')][_0xe2dc('0x39')](_0x4a9852,{'individualHooks':!![]});}})[_0xe2dc('0xf')](function(){if(_0x11bc43){return _0x11bc43[_0xe2dc('0x3a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x49badf[_0xe2dc('0x35')][_0xe2dc('0x36')]||_0xe2dc('0x37'),'lastPauseAt':moment()[_0xe2dc('0x2f')](_0xe2dc('0x30'))});}})[_0xe2dc('0xf')](function(_0x58124f){_0x482dad(_0x58124f);})['catch'](function(_0x151ab8){_0x33c902(_0x43494e[_0xe2dc('0x15')](0x1f4,_0x151ab8['message']));});});};exports[_0xe2dc('0x3b')]=function(_0x3d2eb3){var _0x1a183b=this;return new Promise(function(_0x5a9d51,_0x39e8ea){var _0x28c09b;return db[_0xe2dc('0x1b')][_0xe2dc('0x3c')]({'where':_0x3d2eb3[_0xe2dc('0x1e')][_0xe2dc('0x1f')]||{},'attributes':['id',_0xe2dc('0x28')]})['then'](function(_0x4399de){if(_0x4399de){_0x28c09b=_0x4399de;if(_0x3d2eb3['body'][_0xe2dc('0x3d')]&&!utils[_0xe2dc('0x3e')](_0x3d2eb3[_0xe2dc('0x35')][_0xe2dc('0x3d')])){throw new Error(_0xe2dc('0x3f'));}switch(_0x3d2eb3['body'][_0xe2dc('0x3d')]){case'voice':return db[_0xe2dc('0x2c')][_0xe2dc('0x3a')]({'paused':0x0},{'where':{'UserId':_0x28c09b['id']}})[_0xe2dc('0xf')](function(){return db[_0xe2dc('0x2d')][_0xe2dc('0x26')]({'where':{'channel':_0x3d2eb3['body']['channel'],'membername':_0x28c09b[_0xe2dc('0x28')],'type':_0xe2dc('0x34'),'exitAt':null}});})[_0xe2dc('0xf')](function(_0x31d0ad){if(_0x31d0ad){return _0x31d0ad['update']({'exitAt':moment()[_0xe2dc('0x2f')](_0xe2dc('0x30')),'data2':_0xe2dc('0x40')},{'individualHooks':!![]});}return null;})[_0xe2dc('0xf')](function(){return _0x28c09b[_0xe2dc('0x3a')]({'voicePause':![]});});case _0xe2dc('0x41'):case'chat':case'fax':case'sms':case'openchannel':case _0xe2dc('0x42'):return db[_0xe2dc('0x2d')][_0xe2dc('0x26')]({'where':{'channel':_0x3d2eb3[_0xe2dc('0x35')][_0xe2dc('0x3d')],'membername':_0x28c09b[_0xe2dc('0x28')],'type':_0xe2dc('0x34'),'exitAt':null}})[_0xe2dc('0xf')](function(_0x1bb9e7){return _0x1bb9e7[_0xe2dc('0x3a')]({'exitAt':moment()[_0xe2dc('0x2f')](_0xe2dc('0x30')),'data2':_0xe2dc('0x40')},{'individualHooks':!![]});})[_0xe2dc('0xf')](function(){var _0x1cdb51={};_[_0xe2dc('0x43')](_0x1cdb51,util['format'](_0xe2dc('0x44'),_0x3d2eb3['body'][_0xe2dc('0x3d')],_0xe2dc('0x45')),![]);return _0x28c09b[_0xe2dc('0x3a')](_0x1cdb51);});default:return db[_0xe2dc('0x2c')][_0xe2dc('0x3a')]({'paused':0x0},{'where':{'UserId':_0x28c09b['id']}})[_0xe2dc('0xf')](function(){return db[_0xe2dc('0x2d')][_0xe2dc('0x1c')]({'where':{'membername':_0x28c09b[_0xe2dc('0x28')],'type':_0xe2dc('0x34'),'exitAt':null}});})['then'](function(_0x173ef3){var _0x2e4c12=[];_0x173ef3[_0xe2dc('0x46')](function(_0x58e3b6){_0x2e4c12[_0xe2dc('0x47')](_0x58e3b6[_0xe2dc('0x3a')]({'exitAt':moment()[_0xe2dc('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xe2dc('0x40')}));});return BPromise['all'](_0x2e4c12);})[_0xe2dc('0xf')](function(){return _0x28c09b[_0xe2dc('0x3a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xe2dc('0xf')](function(_0x1970cd){_0x5a9d51(_0x1970cd);})[_0xe2dc('0x19')](function(_0x209ce1){_0x39e8ea(_0x1a183b['error'](0x1f4,_0x209ce1[_0xe2dc('0x17')]));});});};exports[_0xe2dc('0x48')]=function(_0x4d306d){var _0x2d6ff5=this;return new Promise(function(_0x2b748a,_0x328178){var _0x52f4fa;return db[_0xe2dc('0x1b')]['findOne']({'where':_0x4d306d[_0xe2dc('0x1e')]['where']||{},'attributes':['id',_0xe2dc('0x28')]})['then'](function(_0x78f8cc){if(_0x78f8cc){_0x52f4fa=_0x78f8cc;return db[_0xe2dc('0x2c')][_0xe2dc('0x49')]({'where':{'membername':_0x52f4fa['name']},'individualHooks':!![]});}})[_0xe2dc('0xf')](function(){if(_0x52f4fa){return db[_0xe2dc('0x2d')][_0xe2dc('0x1c')]({'where':{'membername':_0x52f4fa[_0xe2dc('0x28')],'exitAt':null}});}})[_0xe2dc('0xf')](function(_0x34ec65){if(_0x52f4fa){if(_0x34ec65&&_0x34ec65[_0xe2dc('0x2e')]){var _0x12c1a4=[];_0x34ec65[_0xe2dc('0x46')](function(_0x36e409){_0x12c1a4[_0xe2dc('0x47')](_0x36e409['update']({'exitAt':moment()[_0xe2dc('0x2f')](_0xe2dc('0x30'))}));});return BPromise[_0xe2dc('0x4a')](_0x12c1a4);}}})['then'](function(){if(_0x52f4fa){return _0x52f4fa[_0xe2dc('0x3a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe2dc('0xf')](function(_0x1e6f15){_0x2b748a(_0x1e6f15);})[_0xe2dc('0x19')](function(_0x5c2226){_0x328178(_0x2d6ff5[_0xe2dc('0x15')](0x1f4,_0x5c2226[_0xe2dc('0x17')]));});});};exports['LoginUser']=function(_0xfde8a1){var _0x1872e1=this;return new Promise(function(_0x5ee243,_0x7ec6cf){var _0x257933;var _0x5f43a8;var _0x28f56e;var _0x3d8ba7;return db[_0xe2dc('0x1b')][_0xe2dc('0x3c')]({'where':_0xfde8a1[_0xe2dc('0x1e')]['where']||{},'attributes':['id','name','role',_0xe2dc('0x4b'),_0xe2dc('0x4c'),'internal','loginInPause',_0xe2dc('0x2b')]})[_0xe2dc('0xf')](function(_0x2a1b51){if(_0x2a1b51){_0x257933=_0x2a1b51;_0x3d8ba7=_0xfde8a1[_0xe2dc('0x35')]['interface']?_0xfde8a1[_0xe2dc('0x35')][_0xe2dc('0x2b')]:util[_0xe2dc('0x2f')](_0xe2dc('0x33'),_0x257933['name']);return db[_0xe2dc('0x1b')][_0xe2dc('0x4d')]({'where':{'role':_0xe2dc('0x4e'),'online':!![],'id':{'$ne':_0x257933['id']}}});}})[_0xe2dc('0xf')](function(_0x3021ce){if(_0x3021ce){_0x28f56e=_0x3021ce;return require(_0xe2dc('0x4f'))[_0xe2dc('0x50')]();}})[_0xe2dc('0xf')](function(_0x1ed8d8){if(_0x1ed8d8&&_0x1ed8d8['agents']&&_0x28f56e>=_0x1ed8d8[_0xe2dc('0x51')]){throw new Error(_0xe2dc('0x52'));}})[_0xe2dc('0xf')](function(){if(_0x257933){return db[_0xe2dc('0x2c')]['destroy']({'where':{'membername':_0x257933[_0xe2dc('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x257933){return _0x257933[_0xe2dc('0x53')]({'raw':!![]});}})[_0xe2dc('0xf')](function(_0x4126ce){if(_0x257933){if(_0x4126ce){var _0x7bda6b=[];_0x5f43a8=_0x4126ce;if(_0x5f43a8[_0xe2dc('0x2e')]){for(var _0x4bc4f0=0x0;_0x4bc4f0<_0x5f43a8[_0xe2dc('0x2e')];_0x4bc4f0++){_0x7bda6b[_0xe2dc('0x47')](db[_0xe2dc('0x2c')][_0xe2dc('0x54')]({'membername':_0x257933[_0xe2dc('0x28')],'UserId':_0x257933['id'],'queue_name':_0x5f43a8[_0x4bc4f0]['name'],'VoiceQueueId':_0x5f43a8[_0x4bc4f0]['id'],'interface':_0x3d8ba7,'paused':_0x257933[_0xe2dc('0x55')]||![],'penalty':_0x5f43a8[_0x4bc4f0][_0xe2dc('0x56')]||0x0}));}return BPromise[_0xe2dc('0x4a')](_0x7bda6b);}}}})[_0xe2dc('0xf')](function(){if(_0x257933){return db[_0xe2dc('0x2d')][_0xe2dc('0x1c')]({'where':{'membername':_0x257933[_0xe2dc('0x28')],'exitAt':null}});}})[_0xe2dc('0xf')](function(_0x3431cc){if(_0x257933){if(_0x3431cc&&_0x3431cc[_0xe2dc('0x2e')]){var _0x362c0b=[];_0x3431cc['forEach'](function(_0xbb4d01){_0x362c0b['push'](_0xbb4d01[_0xe2dc('0x3a')]({'exitAt':moment()[_0xe2dc('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xe2dc('0x4a')](_0x362c0b);}}})[_0xe2dc('0xf')](function(_0x588d02){if(_0x257933){var _0x3ec61f=[];var _0x37896b=[];var _0x3d40ad=utils[_0xe2dc('0x32')]();var _0xad49c9={'membername':_0x257933[_0xe2dc('0x28')],'interface':_0x3d8ba7,'enterAt':moment()[_0xe2dc('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x257933[_0xe2dc('0x29')],'internal':_0x257933['internal']};_0x3d40ad[_0xe2dc('0x46')](function(_0x51962b){_0x3ec61f[_0xe2dc('0x47')](_[_0xe2dc('0x57')]({'channel':_0x51962b,'type':_0xe2dc('0x58'),'data1':_0xe2dc('0x59'),'data2':_0x3d8ba7},_0xad49c9));if(_0x257933[_0xe2dc('0x55')]){_0x37896b[_0xe2dc('0x47')](_[_0xe2dc('0x57')]({'channel':_0x51962b,'type':_0xe2dc('0x34'),'data1':_0xe2dc('0x5a')},_0xad49c9));}});return db['MemberReport']['bulkCreate'](_0x3ec61f[_0xe2dc('0x5b')](_0x37896b),{'individualHooks':!![]});}})[_0xe2dc('0xf')](function(){if(_0x257933){return _0x257933[_0xe2dc('0x3a')]({'online':!![],'lastLoginAt':moment()[_0xe2dc('0x2f')](_0xe2dc('0x30')),'voicePause':_0x257933[_0xe2dc('0x55')]||![],'mailPause':_0x257933[_0xe2dc('0x55')]||![],'chatPause':_0x257933[_0xe2dc('0x55')]||![],'faxPause':_0x257933[_0xe2dc('0x55')]||![],'smsPause':_0x257933[_0xe2dc('0x55')]||![],'openchannelPause':_0x257933[_0xe2dc('0x55')]||![],'pauseType':_0x257933[_0xe2dc('0x55')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xe2dc('0x2f')](_0xe2dc('0x30')),'interface':_0x3d8ba7});}})['then'](function(_0x224e38){_0x5ee243(_0x224e38);})[_0xe2dc('0x19')](function(_0x1484ff){_0x7ec6cf(_0x1872e1[_0xe2dc('0x15')](0x1f4,_0x1484ff[_0xe2dc('0x17')]));});});};
\ No newline at end of file
+var _0x3496=['upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','LOGININPAUSE','concat','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./user.socket','then','info','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','findAll','options','where','attributes','limit','include','model','map','debug','ShowUser','User','find','raw','PauseUser','name','role','internal','interface','update','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','push','format','SIP/%s','body','type','MemberReport','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','chat','fax','sms','openchannel','whatsapp','set','Pause','forEach','all','LogoutUser','destroy','mobile','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x3496,0x115));var _0x6349=function(_0x3500ca,_0x544006){_0x3500ca=_0x3500ca-0x0;var _0x25d35c=_0x3496[_0x3500ca];return _0x25d35c;};'use strict';var _=require(_0x6349('0x0'));var util=require(_0x6349('0x1'));var moment=require('moment');var BPromise=require(_0x6349('0x2'));var rs=require(_0x6349('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6349('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6349('0x5'));var config=require(_0x6349('0x6'));var jayson=require(_0x6349('0x7'));var client=jayson[_0x6349('0x8')]['http']({'port':0x232a});config['redis']=_[_0x6349('0x9')](config[_0x6349('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6349('0xb'))(new Redis(config[_0x6349('0xa')]));require(_0x6349('0xc'))['register'](socket);function respondWithRpcPromise(_0x3c73b0,_0x5653a1,_0x1c22e2){return new BPromise(function(_0x303ad7,_0x193601){return client['request'](_0x3c73b0,_0x1c22e2)[_0x6349('0xd')](function(_0x3a40f0){logger[_0x6349('0xe')]('User,\x20%s,\x20%s',_0x5653a1,_0x6349('0xf'));logger['debug'](_0x6349('0x10'),_0x5653a1,_0x6349('0xf'),JSON[_0x6349('0x11')](_0x3a40f0));if(_0x3a40f0[_0x6349('0x12')]){if(_0x3a40f0['error'][_0x6349('0x13')]===0x1f4){logger[_0x6349('0x12')](_0x6349('0x14'),_0x5653a1,_0x3a40f0[_0x6349('0x12')]['message']);return _0x193601(_0x3a40f0[_0x6349('0x12')][_0x6349('0x15')]);}logger[_0x6349('0x12')]('User,\x20%s,\x20%s',_0x5653a1,_0x3a40f0[_0x6349('0x12')][_0x6349('0x15')]);return _0x303ad7(_0x3a40f0[_0x6349('0x12')][_0x6349('0x15')]);}else{logger[_0x6349('0xe')](_0x6349('0x14'),_0x5653a1,_0x6349('0xf'));_0x303ad7(_0x3a40f0[_0x6349('0x16')][_0x6349('0x15')]);}})[_0x6349('0x17')](function(_0x401497){logger[_0x6349('0x12')](_0x6349('0x14'),_0x5653a1,_0x401497);_0x193601(_0x401497);});});}exports[_0x6349('0x18')]=function(_0x305869){var _0x32c0d3=this;return new Promise(function(_0x234e05,_0xe0ddec){return db['User'][_0x6349('0x19')]({'raw':_0x305869[_0x6349('0x1a')]?_0x305869[_0x6349('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x305869[_0x6349('0x1a')]?_0x305869[_0x6349('0x1a')][_0x6349('0x1b')]||null:null,'attributes':_0x305869[_0x6349('0x1a')]?_0x305869[_0x6349('0x1a')][_0x6349('0x1c')]||null:null,'limit':_0x305869['options']?_0x305869[_0x6349('0x1a')][_0x6349('0x1d')]||null:null,'include':_0x305869[_0x6349('0x1a')]?_0x305869['options'][_0x6349('0x1e')]?_['map'](_0x305869[_0x6349('0x1a')][_0x6349('0x1e')],function(_0x59d499){return{'model':db[_0x59d499[_0x6349('0x1f')]],'as':_0x59d499['as'],'attributes':_0x59d499['attributes'],'include':_0x59d499[_0x6349('0x1e')]?_[_0x6349('0x20')](_0x59d499[_0x6349('0x1e')],function(_0x1bd25f){return{'model':db[_0x1bd25f[_0x6349('0x1f')]],'as':_0x1bd25f['as'],'attributes':_0x1bd25f[_0x6349('0x1c')],'include':_0x1bd25f[_0x6349('0x1e')]?_[_0x6349('0x20')](_0x1bd25f['include'],function(_0x159d44){return{'model':db[_0x159d44[_0x6349('0x1f')]],'as':_0x159d44['as'],'attributes':_0x159d44[_0x6349('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6349('0xd')](function(_0x528bf0){logger['info'](_0x6349('0x18'),_0x305869);logger[_0x6349('0x21')](_0x6349('0x18'),_0x305869,JSON[_0x6349('0x11')](_0x528bf0));_0x234e05(_0x528bf0);})[_0x6349('0x17')](function(_0x574dbc){logger[_0x6349('0x12')](_0x6349('0x18'),_0x574dbc[_0x6349('0x15')],_0x305869);_0xe0ddec(_0x32c0d3[_0x6349('0x12')](0x1f4,_0x574dbc[_0x6349('0x15')]));});});};exports[_0x6349('0x22')]=function(_0x4ce8b3){var _0x378e04=this;return new Promise(function(_0xffea4,_0x40dd9a){return db[_0x6349('0x23')][_0x6349('0x24')]({'raw':_0x4ce8b3[_0x6349('0x1a')]?_0x4ce8b3[_0x6349('0x1a')][_0x6349('0x25')]===undefined?!![]:![]:!![],'where':_0x4ce8b3[_0x6349('0x1a')]?_0x4ce8b3[_0x6349('0x1a')][_0x6349('0x1b')]||null:null,'attributes':_0x4ce8b3[_0x6349('0x1a')]?_0x4ce8b3['options'][_0x6349('0x1c')]||null:null,'include':_0x4ce8b3[_0x6349('0x1a')]?_0x4ce8b3[_0x6349('0x1a')][_0x6349('0x1e')]?_[_0x6349('0x20')](_0x4ce8b3[_0x6349('0x1a')][_0x6349('0x1e')],function(_0x103496){return{'model':db[_0x103496[_0x6349('0x1f')]],'as':_0x103496['as'],'attributes':_0x103496[_0x6349('0x1c')],'include':_0x103496[_0x6349('0x1e')]?_[_0x6349('0x20')](_0x103496['include'],function(_0x202ce8){return{'model':db[_0x202ce8[_0x6349('0x1f')]],'as':_0x202ce8['as'],'attributes':_0x202ce8['attributes'],'include':_0x202ce8[_0x6349('0x1e')]?_['map'](_0x202ce8[_0x6349('0x1e')],function(_0x5b0c56){return{'model':db[_0x5b0c56['model']],'as':_0x5b0c56['as'],'attributes':_0x5b0c56[_0x6349('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6349('0xd')](function(_0x403320){logger[_0x6349('0xe')](_0x6349('0x22'),_0x4ce8b3);logger[_0x6349('0x21')](_0x6349('0x22'),_0x4ce8b3,JSON[_0x6349('0x11')](_0x403320));_0xffea4(_0x403320);})[_0x6349('0x17')](function(_0x1c5c49){logger[_0x6349('0x12')](_0x6349('0x22'),_0x1c5c49[_0x6349('0x15')],_0x4ce8b3);_0x40dd9a(_0x378e04['error'](0x1f4,_0x1c5c49[_0x6349('0x15')]));});});};exports[_0x6349('0x26')]=function(_0x3a9b73){var _0x52aad9=this;return new Promise(function(_0x11408e,_0x36bf36){var _0x3574fb;return db['User']['find']({'where':_0x3a9b73[_0x6349('0x1a')][_0x6349('0x1b')]||{},'attributes':['id',_0x6349('0x27'),_0x6349('0x28'),_0x6349('0x29'),_0x6349('0x2a')]})['then'](function(_0xb0e27b){if(_0xb0e27b){_0x3574fb=_0xb0e27b;return db['UserVoiceQueueRt'][_0x6349('0x2b')]({'paused':0x1},{'where':{'UserId':_0x3574fb['id']},'individualHooks':!![]});}})[_0x6349('0xd')](function(){if(_0x3574fb){return db['MemberReport'][_0x6349('0x19')]({'where':{'membername':_0x3574fb[_0x6349('0x27')],'type':_0x6349('0x2c'),'exitAt':null}});}})[_0x6349('0xd')](function(_0x3885de){if(_0x3574fb){if(_0x3885de&&_0x3885de[_0x6349('0x2d')]){var _0x2954ac=moment()['format'](_0x6349('0x2e'));for(var _0x48fbbe=0x0,_0x56d718=_0x3885de['length'];_0x48fbbe<_0x56d718;_0x48fbbe++){_0x3885de[_0x48fbbe][_0x6349('0x2f')]({'exitAt':_0x2954ac});}}}})[_0x6349('0xd')](function(){if(_0x3574fb){var _0x100de4=[];var _0x2eb9da=utils['getChannels']();_0x2eb9da['forEach'](function(_0x5ab68f){_0x100de4[_0x6349('0x30')]({'channel':_0x5ab68f,'membername':_0x3574fb['name'],'interface':_['isNil'](_0x3574fb[_0x6349('0x2a')])?util[_0x6349('0x31')](_0x6349('0x32'),_0x3574fb[_0x6349('0x27')]):_0x3574fb[_0x6349('0x2a')],'type':'PAUSE','enterAt':moment()[_0x6349('0x31')](_0x6349('0x2e')),'data1':_0x3a9b73[_0x6349('0x33')][_0x6349('0x34')]||'DEFAULT\x20PAUSE','role':_0x3574fb[_0x6349('0x28')],'internal':_0x3574fb[_0x6349('0x29')],'uniqueid':_0x3a9b73[_0x6349('0x33')]['uniqueid']||null});});return db[_0x6349('0x35')][_0x6349('0x36')](_0x100de4,{'individualHooks':!![]});}})['then'](function(){if(_0x3574fb){return _0x3574fb[_0x6349('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3a9b73[_0x6349('0x33')][_0x6349('0x34')]||_0x6349('0x37'),'lastPauseAt':moment()['format'](_0x6349('0x2e'))});}})[_0x6349('0xd')](function(_0x416bfb){_0x11408e(_0x416bfb);})[_0x6349('0x17')](function(_0x140f1b){_0x36bf36(_0x52aad9[_0x6349('0x12')](0x1f4,_0x140f1b['message']));});});};exports[_0x6349('0x38')]=function(_0xd4342d){var _0xe0fc87=this;return new Promise(function(_0x5a5e3f,_0x43cd7d){var _0x5cdbdd;return db[_0x6349('0x23')][_0x6349('0x39')]({'where':_0xd4342d[_0x6349('0x1a')][_0x6349('0x1b')]||{},'attributes':['id',_0x6349('0x27')]})[_0x6349('0xd')](function(_0x1ef742){if(_0x1ef742){_0x5cdbdd=_0x1ef742;if(_0xd4342d[_0x6349('0x33')][_0x6349('0x3a')]&&!utils[_0x6349('0x3b')](_0xd4342d[_0x6349('0x33')]['channel'])){throw new Error(_0x6349('0x3c'));}switch(_0xd4342d[_0x6349('0x33')]['channel']){case _0x6349('0x3d'):return db[_0x6349('0x3e')]['update']({'paused':0x0},{'where':{'UserId':_0x5cdbdd['id']}})[_0x6349('0xd')](function(){return db[_0x6349('0x35')][_0x6349('0x24')]({'where':{'channel':_0xd4342d[_0x6349('0x33')][_0x6349('0x3a')],'membername':_0x5cdbdd[_0x6349('0x27')],'type':_0x6349('0x2c'),'exitAt':null}});})[_0x6349('0xd')](function(_0x1704de){if(_0x1704de){return _0x1704de[_0x6349('0x2b')]({'exitAt':moment()['format'](_0x6349('0x2e')),'data2':_0x6349('0x3f')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x5cdbdd[_0x6349('0x2b')]({'voicePause':![]});});case'mail':case _0x6349('0x40'):case _0x6349('0x41'):case _0x6349('0x42'):case _0x6349('0x43'):case _0x6349('0x44'):return db[_0x6349('0x35')][_0x6349('0x24')]({'where':{'channel':_0xd4342d[_0x6349('0x33')][_0x6349('0x3a')],'membername':_0x5cdbdd[_0x6349('0x27')],'type':'PAUSE','exitAt':null}})['then'](function(_0x49cd51){return _0x49cd51[_0x6349('0x2b')]({'exitAt':moment()[_0x6349('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6349('0x3f')},{'individualHooks':!![]});})[_0x6349('0xd')](function(){var _0x57dff9={};_[_0x6349('0x45')](_0x57dff9,util[_0x6349('0x31')]('%s%s',_0xd4342d[_0x6349('0x33')][_0x6349('0x3a')],_0x6349('0x46')),![]);return _0x5cdbdd['update'](_0x57dff9);});default:return db[_0x6349('0x3e')][_0x6349('0x2b')]({'paused':0x0},{'where':{'UserId':_0x5cdbdd['id']}})['then'](function(){return db[_0x6349('0x35')]['findAll']({'where':{'membername':_0x5cdbdd[_0x6349('0x27')],'type':_0x6349('0x2c'),'exitAt':null}});})[_0x6349('0xd')](function(_0x2717a8){var _0x49639d=[];_0x2717a8[_0x6349('0x47')](function(_0x4b32f5){_0x49639d[_0x6349('0x30')](_0x4b32f5['update']({'exitAt':moment()[_0x6349('0x31')](_0x6349('0x2e')),'data2':'system'}));});return BPromise[_0x6349('0x48')](_0x49639d);})[_0x6349('0xd')](function(){return _0x5cdbdd['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x6349('0xd')](function(_0x1c2198){_0x5a5e3f(_0x1c2198);})[_0x6349('0x17')](function(_0x353588){_0x43cd7d(_0xe0fc87[_0x6349('0x12')](0x1f4,_0x353588[_0x6349('0x15')]));});});};exports[_0x6349('0x49')]=function(_0x28d451){var _0x48e860=this;return new Promise(function(_0x1e533b,_0x1f5363){var _0x373890;return db[_0x6349('0x23')][_0x6349('0x39')]({'where':_0x28d451['options']['where']||{},'attributes':['id',_0x6349('0x27')]})[_0x6349('0xd')](function(_0x1a95dd){if(_0x1a95dd){_0x373890=_0x1a95dd;return db[_0x6349('0x3e')][_0x6349('0x4a')]({'where':{'membername':_0x373890[_0x6349('0x27')]},'individualHooks':!![]});}})[_0x6349('0xd')](function(){if(_0x373890){return db['MemberReport'][_0x6349('0x19')]({'where':{'membername':_0x373890['name'],'exitAt':null}});}})[_0x6349('0xd')](function(_0x378805){if(_0x373890){if(_0x378805&&_0x378805[_0x6349('0x2d')]){var _0x56b758=[];_0x378805[_0x6349('0x47')](function(_0x46dcb7){_0x56b758[_0x6349('0x30')](_0x46dcb7[_0x6349('0x2b')]({'exitAt':moment()[_0x6349('0x31')](_0x6349('0x2e'))}));});return BPromise[_0x6349('0x48')](_0x56b758);}}})[_0x6349('0xd')](function(){if(_0x373890){return _0x373890['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6349('0xd')](function(_0x4ad0ff){_0x1e533b(_0x4ad0ff);})[_0x6349('0x17')](function(_0x491158){_0x1f5363(_0x48e860[_0x6349('0x12')](0x1f4,_0x491158[_0x6349('0x15')]));});});};exports['LoginUser']=function(_0x3ede97){var _0x149c81=this;return new Promise(function(_0x4e7aff,_0x1304ec){var _0x48693b;var _0x459033;var _0x27a36a;var _0x1ac4db;return db['User'][_0x6349('0x39')]({'where':_0x3ede97[_0x6349('0x1a')]['where']||{},'attributes':['id',_0x6349('0x27'),_0x6349('0x28'),_0x6349('0x4b'),_0x6349('0x4c'),_0x6349('0x29'),_0x6349('0x4d'),_0x6349('0x2a')]})[_0x6349('0xd')](function(_0x9dbf98){if(_0x9dbf98){_0x48693b=_0x9dbf98;_0x1ac4db=_0x3ede97['body'][_0x6349('0x2a')]?_0x3ede97['body'][_0x6349('0x2a')]:util[_0x6349('0x31')](_0x6349('0x32'),_0x48693b[_0x6349('0x27')]);return db[_0x6349('0x23')][_0x6349('0x4e')]({'where':{'role':_0x6349('0x4f'),'online':!![],'id':{'$ne':_0x48693b['id']}}});}})[_0x6349('0xd')](function(_0x4e562d){if(_0x4e562d){_0x27a36a=_0x4e562d;return require(_0x6349('0x50'))['getLicense']();}})[_0x6349('0xd')](function(_0xb14357){if(_0xb14357&&_0xb14357['agents']&&_0x27a36a>=_0xb14357[_0x6349('0x51')]){throw new Error(_0x6349('0x52'));}})[_0x6349('0xd')](function(){if(_0x48693b){return db[_0x6349('0x3e')][_0x6349('0x4a')]({'where':{'membername':_0x48693b[_0x6349('0x27')]},'individualHooks':!![]});}})[_0x6349('0xd')](function(){if(_0x48693b){return _0x48693b['getVoiceQueues']({'raw':!![]});}})[_0x6349('0xd')](function(_0x16d8dd){if(_0x48693b){if(_0x16d8dd){var _0x563f2c=[];_0x459033=_0x16d8dd;if(_0x459033[_0x6349('0x2d')]){for(var _0x4b98fb=0x0;_0x4b98fb<_0x459033[_0x6349('0x2d')];_0x4b98fb++){_0x563f2c['push'](db['UserVoiceQueueRt'][_0x6349('0x53')]({'membername':_0x48693b[_0x6349('0x27')],'UserId':_0x48693b['id'],'queue_name':_0x459033[_0x4b98fb][_0x6349('0x27')],'VoiceQueueId':_0x459033[_0x4b98fb]['id'],'interface':_0x1ac4db,'paused':_0x48693b[_0x6349('0x4d')]||![],'penalty':_0x459033[_0x4b98fb][_0x6349('0x54')]||0x0}));}return BPromise[_0x6349('0x48')](_0x563f2c);}}}})[_0x6349('0xd')](function(){if(_0x48693b){return db[_0x6349('0x35')][_0x6349('0x19')]({'where':{'membername':_0x48693b[_0x6349('0x27')],'exitAt':null}});}})[_0x6349('0xd')](function(_0x1f9548){if(_0x48693b){if(_0x1f9548&&_0x1f9548['length']){var _0x3d3184=[];_0x1f9548[_0x6349('0x47')](function(_0x4927d8){_0x3d3184[_0x6349('0x30')](_0x4927d8[_0x6349('0x2b')]({'exitAt':moment()['format'](_0x6349('0x2e'))}));});return BPromise[_0x6349('0x48')](_0x3d3184);}}})[_0x6349('0xd')](function(_0x373232){if(_0x48693b){var _0x50d5e3=[];var _0x22ea82=[];var _0x2283b7=utils[_0x6349('0x55')]();var _0x4cb860={'membername':_0x48693b['name'],'interface':_0x1ac4db,'enterAt':moment()[_0x6349('0x31')](_0x6349('0x2e')),'role':_0x48693b[_0x6349('0x28')],'internal':_0x48693b['internal']};_0x2283b7['forEach'](function(_0x308018){_0x50d5e3[_0x6349('0x30')](_[_0x6349('0x56')]({'channel':_0x308018,'type':_0x6349('0x57'),'data1':'callysquare','data2':_0x1ac4db},_0x4cb860));if(_0x48693b[_0x6349('0x4d')]){_0x22ea82['push'](_['merge']({'channel':_0x308018,'type':_0x6349('0x2c'),'data1':_0x6349('0x58')},_0x4cb860));}});return db['MemberReport'][_0x6349('0x36')](_0x50d5e3[_0x6349('0x59')](_0x22ea82),{'individualHooks':!![]});}})['then'](function(){if(_0x48693b){return _0x48693b['update']({'online':!![],'lastLoginAt':moment()['format'](_0x6349('0x2e')),'voicePause':_0x48693b[_0x6349('0x4d')]||![],'mailPause':_0x48693b[_0x6349('0x4d')]||![],'chatPause':_0x48693b[_0x6349('0x4d')]||![],'faxPause':_0x48693b[_0x6349('0x4d')]||![],'smsPause':_0x48693b[_0x6349('0x4d')]||![],'openchannelPause':_0x48693b[_0x6349('0x4d')]||![],'pauseType':_0x48693b[_0x6349('0x4d')]?_0x6349('0x58'):null,'lastPauseAt':moment()[_0x6349('0x31')](_0x6349('0x2e')),'interface':_0x1ac4db});}})[_0x6349('0xd')](function(_0xb1fca){_0x4e7aff(_0xb1fca);})[_0x6349('0x17')](function(_0x4ae0ab){_0x1304ec(_0x149c81[_0x6349('0x12')](0x1f4,_0x4ae0ab[_0x6349('0x15')]));});});};
\ No newline at end of file
index 2b34ea1..b126c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa945=['removeListener','./user.events','emit'];(function(_0x12e1b5,_0x36af79){var _0x584d0c=function(_0x4820f6){while(--_0x4820f6){_0x12e1b5['push'](_0x12e1b5['shift']());}};_0x584d0c(++_0x36af79);}(_0xa945,0x97));var _0x5a94=function(_0x567b8,_0x3d8f53){_0x567b8=_0x567b8-0x0;var _0x413273=_0xa945[_0x567b8];return _0x413273;};'use strict';var UserEvents=require(_0x5a94('0x0'));var events=['save','remove','update'];function createListener(_0xc606fc,_0x2ae334){return function(_0x13b59c){_0x2ae334[_0x5a94('0x1')](_0xc606fc,_0x13b59c);};}function removeListener(_0x26362a,_0x35d760){return function(){UserEvents[_0x5a94('0x2')](_0x26362a,_0x35d760);};}exports['register']=function(_0x165b95){for(var _0x23606f=0x0,_0x316fdd=events['length'];_0x23606f<_0x316fdd;_0x23606f++){var _0x5ca05b=events[_0x23606f];var _0x528fd0=createListener('user:'+_0x5ca05b,_0x165b95);UserEvents['on'](_0x5ca05b,_0x528fd0);}};
\ No newline at end of file
+var _0xffca=['update','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x1ef230,_0x34f0c8){var _0x239c06=function(_0x3c9c69){while(--_0x3c9c69){_0x1ef230['push'](_0x1ef230['shift']());}};_0x239c06(++_0x34f0c8);}(_0xffca,0xee));var _0xaffc=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xffca[_0x1d1779];return _0x2377e9;};'use strict';var UserEvents=require(_0xaffc('0x0'));var events=[_0xaffc('0x1'),'remove',_0xaffc('0x2')];function createListener(_0x2a7bc8,_0x2dcc2d){return function(_0x303cdd){_0x2dcc2d[_0xaffc('0x3')](_0x2a7bc8,_0x303cdd);};}function removeListener(_0x45964d,_0x288582){return function(){UserEvents[_0xaffc('0x4')](_0x45964d,_0x288582);};}exports[_0xaffc('0x5')]=function(_0xc34b){for(var _0x171bbe=0x0,_0x1ff058=events[_0xaffc('0x6')];_0x171bbe<_0x1ff058;_0x171bbe++){var _0x3d950a=events[_0x171bbe];var _0x1759d6=createListener(_0xaffc('0x7')+_0x3d950a,_0xc34b);UserEvents['on'](_0x3d950a,_0x1759d6);}};
\ No newline at end of file
index 1a1cfe8..175800c 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(_0x2fb4bc,_0xf351ce){var _0x451b56=function(_0x4e66d2){while(--_0x4e66d2){_0x2fb4bc['push'](_0x2fb4bc['shift']());}};_0x451b56(++_0xf351ce);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x218bd4,_0x4827c4){var _0x510c95=function(_0x57b4fb){while(--_0x57b4fb){_0x218bd4['push'](_0x218bd4['shift']());}};_0x510c95(++_0x4827c4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0xcb91[_0x1f27df];return _0x286ee2;};'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 57210f5..f6d975f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ac1=['INTEGER'];(function(_0x1e32a6,_0x144908){var _0x5b9c13=function(_0x2b7653){while(--_0x2b7653){_0x1e32a6['push'](_0x1e32a6['shift']());}};_0x5b9c13(++_0x144908);}(_0x0ac1,0x167));var _0x10ac=function(_0x3d5a66,_0x3bcd8d){_0x3d5a66=_0x3d5a66-0x0;var _0x4d6216=_0x0ac1[_0x3d5a66];return _0x4d6216;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x10ac('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x85e7=['INTEGER','sequelize'];(function(_0x21e615,_0x5de4b1){var _0x2f08f7=function(_0x27f595){while(--_0x27f595){_0x21e615['push'](_0x21e615['shift']());}};_0x2f08f7(++_0x5de4b1);}(_0x85e7,0xad));var _0x785e=function(_0x3a1fef,_0xd04dca){_0x3a1fef=_0x3a1fef-0x0;var _0x20265a=_0x85e7[_0x3a1fef];return _0x20265a;};'use strict';var Sequelize=require(_0x785e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x785e('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 3601d4b..35fb428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16fb=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x16bc21,_0x52fe32){var _0xf41fe0=function(_0x5ec49f){while(--_0x5ec49f){_0x16bc21['push'](_0x16bc21['shift']());}};_0xf41fe0(++_0x52fe32);}(_0x16fb,0x116));var _0xb16f=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0x16fb[_0x2e41e2];return _0x2844d6;};'use strict';var _=require(_0xb16f('0x0'));var util=require(_0xb16f('0x1'));var logger=require(_0xb16f('0x2'))('api');var moment=require(_0xb16f('0x3'));var BPromise=require(_0xb16f('0x4'));var rp=require(_0xb16f('0x5'));var fs=require('fs');var path=require(_0xb16f('0x6'));var rimraf=require('rimraf');var config=require(_0xb16f('0x7'));var attributes=require(_0xb16f('0x8'));module[_0xb16f('0x9')]=function(_0x359c1e,_0x3056a3){return _0x359c1e[_0xb16f('0xa')](_0xb16f('0xb'),attributes,{'tableName':_0xb16f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2bf=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x3a68dc,_0x516ece){var _0x90087b=function(_0x50891a){while(--_0x50891a){_0x3a68dc['push'](_0x3a68dc['shift']());}};_0x90087b(++_0x516ece);}(_0xb2bf,0x6a));var _0xfb2b=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb2bf[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0xfb2b('0x0'));var util=require(_0xfb2b('0x1'));var logger=require(_0xfb2b('0x2'))(_0xfb2b('0x3'));var moment=require(_0xfb2b('0x4'));var BPromise=require(_0xfb2b('0x5'));var rp=require(_0xfb2b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb2b('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb2b('0x8'));module['exports']=function(_0x4167dc,_0x468678){return _0x4167dc[_0xfb2b('0x9')](_0xfb2b('0xa'),attributes,{'tableName':_0xfb2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a827cce..4594d11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd2f=['request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http'];(function(_0x8dedd8,_0x245349){var _0x5f21e2=function(_0x10fc93){while(--_0x10fc93){_0x8dedd8['push'](_0x8dedd8['shift']());}};_0x5f21e2(++_0x245349);}(_0xfd2f,0x120));var _0xffd2=function(_0x5cd20a,_0x4d7260){_0x5cd20a=_0x5cd20a-0x0;var _0x25217f=_0xfd2f[_0x5cd20a];return _0x25217f;};'use strict';var _=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var moment=require(_0xffd2('0x2'));var BPromise=require(_0xffd2('0x3'));var rs=require(_0xffd2('0x4'));var fs=require('fs');var Redis=require(_0xffd2('0x5'));var db=require(_0xffd2('0x6'))['db'];var utils=require(_0xffd2('0x7'));var logger=require(_0xffd2('0x8'))(_0xffd2('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xffd2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x277ed5,_0x2d0246,_0x479ee5){return new BPromise(function(_0x4cbcf3,_0x3eb9e5){return client[_0xffd2('0xb')](_0x277ed5,_0x479ee5)[_0xffd2('0xc')](function(_0x6fe71e){logger[_0xffd2('0xd')](_0xffd2('0xe'),_0x2d0246,'request\x20sent');logger[_0xffd2('0xf')](_0xffd2('0x10'),_0x2d0246,_0xffd2('0x11'),JSON[_0xffd2('0x12')](_0x6fe71e));if(_0x6fe71e[_0xffd2('0x13')]){if(_0x6fe71e['error'][_0xffd2('0x14')]===0x1f4){logger['error'](_0xffd2('0xe'),_0x2d0246,_0x6fe71e[_0xffd2('0x13')]['message']);return _0x3eb9e5(_0x6fe71e[_0xffd2('0x13')][_0xffd2('0x15')]);}logger[_0xffd2('0x13')](_0xffd2('0xe'),_0x2d0246,_0x6fe71e[_0xffd2('0x13')][_0xffd2('0x15')]);return _0x4cbcf3(_0x6fe71e[_0xffd2('0x13')][_0xffd2('0x15')]);}else{logger[_0xffd2('0xd')](_0xffd2('0xe'),_0x2d0246,_0xffd2('0x11'));_0x4cbcf3(_0x6fe71e['result'][_0xffd2('0x15')]);}})[_0xffd2('0x16')](function(_0x17d723){logger[_0xffd2('0x13')](_0xffd2('0xe'),_0x2d0246,_0x17d723);_0x3eb9e5(_0x17d723);});});}
\ No newline at end of file
+var _0x6518=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x6518,0xd3));var _0x8651=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x6518[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require('lodash');var util=require(_0x8651('0x0'));var moment=require(_0x8651('0x1'));var BPromise=require(_0x8651('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8651('0x3'));var db=require(_0x8651('0x4'))['db'];var utils=require(_0x8651('0x5'));var logger=require(_0x8651('0x6'))(_0x8651('0x7'));var config=require('../../config/environment');var jayson=require(_0x8651('0x8'));var client=jayson[_0x8651('0x9')][_0x8651('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e9a8,_0x2ad776,_0x253c4c){return new BPromise(function(_0x31016a,_0x17a356){return client[_0x8651('0xb')](_0x19e9a8,_0x253c4c)[_0x8651('0xc')](function(_0x25060d){logger[_0x8651('0xd')](_0x8651('0xe'),_0x2ad776,_0x8651('0xf'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2ad776,_0x8651('0xf'),JSON[_0x8651('0x10')](_0x25060d));if(_0x25060d[_0x8651('0x11')]){if(_0x25060d['error'][_0x8651('0x12')]===0x1f4){logger[_0x8651('0x11')](_0x8651('0xe'),_0x2ad776,_0x25060d[_0x8651('0x11')][_0x8651('0x13')]);return _0x17a356(_0x25060d[_0x8651('0x11')]['message']);}logger[_0x8651('0x11')](_0x8651('0xe'),_0x2ad776,_0x25060d[_0x8651('0x11')][_0x8651('0x13')]);return _0x31016a(_0x25060d[_0x8651('0x11')]['message']);}else{logger[_0x8651('0xd')](_0x8651('0xe'),_0x2ad776,'request\x20sent');_0x31016a(_0x25060d['result'][_0x8651('0x13')]);}})[_0x8651('0x14')](function(_0x286fd1){logger[_0x8651('0x11')](_0x8651('0xe'),_0x2ad776,_0x286fd1);_0x17a356(_0x286fd1);});});}
\ No newline at end of file
index 0161ced..ab2f163 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(_0x1d3d53,_0x28a33d){var _0x179cf6=function(_0x3e8ea7){while(--_0x3e8ea7){_0x1d3d53['push'](_0x1d3d53['shift']());}};_0x179cf6(++_0x28a33d);}(_0xe706,0xa3));var _0x6e70=function(_0x1ff414,_0x12c95d){_0x1ff414=_0x1ff414-0x0;var _0x52c0fa=_0xe706[_0x1ff414];return _0x52c0fa;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4ccdd9,_0x4f24fe){var _0x69441b=function(_0x140acd){while(--_0x140acd){_0x4ccdd9['push'](_0x4ccdd9['shift']());}};_0x69441b(++_0x4f24fe);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0xcb91[_0x25a42a];return _0x1129b1;};'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 7f6d3c3..f40fe7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33cd=['STRING','INTEGER'];(function(_0x1078ca,_0x39e3dc){var _0x138914=function(_0x334d01){while(--_0x334d01){_0x1078ca['push'](_0x1078ca['shift']());}};_0x138914(++_0x39e3dc);}(_0x33cd,0x185));var _0xd33c=function(_0x992275,_0x5b544c){_0x992275=_0x992275-0x0;var _0x1922d0=_0x33cd[_0x992275];return _0x1922d0;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xd33c('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd33c('0x1')]}};
\ No newline at end of file
+var _0x4662=['exports','INTEGER','STRING','sequelize'];(function(_0x4aee32,_0x20d7a8){var _0x23dd47=function(_0x8042b9){while(--_0x8042b9){_0x4aee32['push'](_0x4aee32['shift']());}};_0x23dd47(++_0x20d7a8);}(_0x4662,0x1e7));var _0x2466=function(_0x1e0c63,_0x17f775){_0x1e0c63=_0x1e0c63-0x0;var _0xe5331e=_0x4662[_0x1e0c63];return _0xe5331e;};'use strict';var Sequelize=require(_0x2466('0x0'));module[_0x2466('0x1')]={'penalty':{'type':Sequelize[_0x2466('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2466('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2466('0x3')]}};
\ No newline at end of file
index ae546c8..e9c412b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00d8=['UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define'];(function(_0x3f502a,_0x3e42c4){var _0x545a8f=function(_0x3087cc){while(--_0x3087cc){_0x3f502a['push'](_0x3f502a['shift']());}};_0x545a8f(++_0x3e42c4);}(_0x00d8,0x6a));var _0x800d=function(_0x4dd44d,_0x4373de){_0x4dd44d=_0x4dd44d-0x0;var _0x5889b9=_0x00d8[_0x4dd44d];return _0x5889b9;};'use strict';var _=require('lodash');var util=require(_0x800d('0x0'));var logger=require(_0x800d('0x1'))(_0x800d('0x2'));var moment=require(_0x800d('0x3'));var BPromise=require(_0x800d('0x4'));var rp=require(_0x800d('0x5'));var fs=require('fs');var path=require(_0x800d('0x6'));var rimraf=require(_0x800d('0x7'));var config=require(_0x800d('0x8'));var attributes=require(_0x800d('0x9'));module['exports']=function(_0x2fa83f,_0x555f0b){return _0x2fa83f[_0x800d('0xa')](_0x800d('0xb'),attributes,{'tableName':_0x800d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c7d=['user_has_fax_queues','lodash','../../config/logger','moment','bluebird','request-promise','./userFaxQueue.attributes','exports'];(function(_0x13e766,_0x322ff3){var _0x419c8b=function(_0x326601){while(--_0x326601){_0x13e766['push'](_0x13e766['shift']());}};_0x419c8b(++_0x322ff3);}(_0x8c7d,0x1e9));var _0xd8c7=function(_0x149505,_0x39caa9){_0x149505=_0x149505-0x0;var _0x335ab7=_0x8c7d[_0x149505];return _0x335ab7;};'use strict';var _=require(_0xd8c7('0x0'));var util=require('util');var logger=require(_0xd8c7('0x1'))('api');var moment=require(_0xd8c7('0x2'));var BPromise=require(_0xd8c7('0x3'));var rp=require(_0xd8c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd8c7('0x5'));module[_0xd8c7('0x6')]=function(_0x2cc331,_0x48e375){return _0x2cc331['define']('UserFaxQueue',attributes,{'tableName':_0xd8c7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 99ccfcf..0dc4ef8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d6b=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s','result'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x7d6b,0xe7));var _0xb7d6=function(_0x5e4f31,_0x5c7b6e){_0x5e4f31=_0x5e4f31-0x0;var _0x236095=_0x7d6b[_0x5e4f31];return _0x236095;};'use strict';var _=require(_0xb7d6('0x0'));var util=require('util');var moment=require(_0xb7d6('0x1'));var BPromise=require(_0xb7d6('0x2'));var rs=require(_0xb7d6('0x3'));var fs=require('fs');var Redis=require(_0xb7d6('0x4'));var db=require(_0xb7d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7d6('0x6'))(_0xb7d6('0x7'));var config=require(_0xb7d6('0x8'));var jayson=require(_0xb7d6('0x9'));var client=jayson[_0xb7d6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x413e34,_0x33d9e3,_0x5df707){return new BPromise(function(_0x19378d,_0x51e54e){return client[_0xb7d6('0xb')](_0x413e34,_0x5df707)[_0xb7d6('0xc')](function(_0xd911e2){logger[_0xb7d6('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x33d9e3,'request\x20sent');logger['debug'](_0xb7d6('0xe'),_0x33d9e3,_0xb7d6('0xf'),JSON[_0xb7d6('0x10')](_0xd911e2));if(_0xd911e2[_0xb7d6('0x11')]){if(_0xd911e2[_0xb7d6('0x11')][_0xb7d6('0x12')]===0x1f4){logger[_0xb7d6('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x33d9e3,_0xd911e2[_0xb7d6('0x11')][_0xb7d6('0x13')]);return _0x51e54e(_0xd911e2[_0xb7d6('0x11')][_0xb7d6('0x13')]);}logger[_0xb7d6('0x11')](_0xb7d6('0x14'),_0x33d9e3,_0xd911e2[_0xb7d6('0x11')][_0xb7d6('0x13')]);return _0x19378d(_0xd911e2[_0xb7d6('0x11')][_0xb7d6('0x13')]);}else{logger[_0xb7d6('0xd')](_0xb7d6('0x14'),_0x33d9e3,'request\x20sent');_0x19378d(_0xd911e2[_0xb7d6('0x15')][_0xb7d6('0x13')]);}})[_0xb7d6('0x16')](function(_0x42c5a7){logger[_0xb7d6('0x11')](_0xb7d6('0x14'),_0x33d9e3,_0x42c5a7);_0x51e54e(_0x42c5a7);});});}
\ No newline at end of file
+var _0x5408=['UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2f516a,_0xc079de){var _0x27afb2=function(_0x44b5e5){while(--_0x44b5e5){_0x2f516a['push'](_0x2f516a['shift']());}};_0x27afb2(++_0xc079de);}(_0x5408,0x1a7));var _0x8540=function(_0x3855fd,_0x26003f){_0x3855fd=_0x3855fd-0x0;var _0x226a53=_0x5408[_0x3855fd];return _0x226a53;};'use strict';var _=require(_0x8540('0x0'));var util=require(_0x8540('0x1'));var moment=require(_0x8540('0x2'));var BPromise=require(_0x8540('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8540('0x4'))['db'];var utils=require(_0x8540('0x5'));var logger=require(_0x8540('0x6'))(_0x8540('0x7'));var config=require(_0x8540('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8540('0x9')][_0x8540('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30b447,_0x590947,_0x5c226b){return new BPromise(function(_0x3c5c84,_0x515d70){return client[_0x8540('0xb')](_0x30b447,_0x5c226b)[_0x8540('0xc')](function(_0xaa706e){logger[_0x8540('0xd')](_0x8540('0xe'),_0x590947,'request\x20sent');logger['debug'](_0x8540('0xf'),_0x590947,_0x8540('0x10'),JSON[_0x8540('0x11')](_0xaa706e));if(_0xaa706e[_0x8540('0x12')]){if(_0xaa706e['error'][_0x8540('0x13')]===0x1f4){logger['error'](_0x8540('0xe'),_0x590947,_0xaa706e['error']['message']);return _0x515d70(_0xaa706e[_0x8540('0x12')]['message']);}logger[_0x8540('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x590947,_0xaa706e['error'][_0x8540('0x14')]);return _0x3c5c84(_0xaa706e[_0x8540('0x12')][_0x8540('0x14')]);}else{logger['info'](_0x8540('0xe'),_0x590947,_0x8540('0x10'));_0x3c5c84(_0xaa706e[_0x8540('0x15')][_0x8540('0x14')]);}})[_0x8540('0x16')](function(_0x4b0c16){logger[_0x8540('0x12')](_0x8540('0xe'),_0x590947,_0x4b0c16);_0x515d70(_0x4b0c16);});});}
\ No newline at end of file
index a0e7db1..cceef1d 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(_0x29f7cb,_0x69f735){var _0x54780f=function(_0x238e25){while(--_0x238e25){_0x29f7cb['push'](_0x29f7cb['shift']());}};_0x54780f(++_0x69f735);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xd14582,_0x2db904){var _0x2c9d0e=function(_0x3d2056){while(--_0x3d2056){_0xd14582['push'](_0xd14582['shift']());}};_0x2c9d0e(++_0x2db904);}(_0xedd9,0xfc));var _0x9edd=function(_0x4d1cd7,_0x19dd0f){_0x4d1cd7=_0x4d1cd7-0x0;var _0x43465f=_0xedd9[_0x4d1cd7];return _0x43465f;};'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 b805c63..70a391b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1c=['exports','sequelize'];(function(_0x3c6dfd,_0x2faf33){var _0x5d4df7=function(_0x26c558){while(--_0x26c558){_0x3c6dfd['push'](_0x3c6dfd['shift']());}};_0x5d4df7(++_0x2faf33);}(_0xed1c,0x7f));var _0xced1=function(_0x2d91d4,_0xfb5d5){_0x2d91d4=_0x2d91d4-0x0;var _0x2d820c=_0xed1c[_0x2d91d4];return _0x2d820c;};'use strict';var Sequelize=require(_0xced1('0x0'));module[_0xced1('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2316=['sequelize','exports','INTEGER'];(function(_0x571bb5,_0x328877){var _0x518c26=function(_0x397d95){while(--_0x397d95){_0x571bb5['push'](_0x571bb5['shift']());}};_0x518c26(++_0x328877);}(_0x2316,0xa8));var _0x6231=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x2316[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x6231('0x0'));module[_0x6231('0x1')]={'penalty':{'type':Sequelize[_0x6231('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 0ef4cbe..bbfeb25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e75=['define','UserMailQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x493b4e,_0x37993e){var _0x3c7a7b=function(_0x4cd8d9){while(--_0x4cd8d9){_0x493b4e['push'](_0x493b4e['shift']());}};_0x3c7a7b(++_0x37993e);}(_0x7e75,0x1d6));var _0x57e7=function(_0x4f10b9,_0x54140b){_0x4f10b9=_0x4f10b9-0x0;var _0x1ae0ee=_0x7e75[_0x4f10b9];return _0x1ae0ee;};'use strict';var _=require(_0x57e7('0x0'));var util=require('util');var logger=require(_0x57e7('0x1'))(_0x57e7('0x2'));var moment=require(_0x57e7('0x3'));var BPromise=require(_0x57e7('0x4'));var rp=require(_0x57e7('0x5'));var fs=require('fs');var path=require(_0x57e7('0x6'));var rimraf=require('rimraf');var config=require(_0x57e7('0x7'));var attributes=require(_0x57e7('0x8'));module[_0x57e7('0x9')]=function(_0x44e047,_0x5c9670){return _0x44e047[_0x57e7('0xa')](_0x57e7('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7484=['define','UserMailQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x4e053d,_0x5bf868){var _0x5bfad7=function(_0x16057e){while(--_0x16057e){_0x4e053d['push'](_0x4e053d['shift']());}};_0x5bfad7(++_0x5bf868);}(_0x7484,0x77));var _0x4748=function(_0x2853dd,_0x36df3b){_0x2853dd=_0x2853dd-0x0;var _0x420394=_0x7484[_0x2853dd];return _0x420394;};'use strict';var _=require(_0x4748('0x0'));var util=require(_0x4748('0x1'));var logger=require('../../config/logger')(_0x4748('0x2'));var moment=require(_0x4748('0x3'));var BPromise=require(_0x4748('0x4'));var rp=require(_0x4748('0x5'));var fs=require('fs');var path=require(_0x4748('0x6'));var rimraf=require(_0x4748('0x7'));var config=require(_0x4748('0x8'));var attributes=require(_0x4748('0x9'));module[_0x4748('0xa')]=function(_0xe47cd9,_0x319698){return _0xe47cd9[_0x4748('0xb')](_0x4748('0xc'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9698798..1627af3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x3b4f09,_0x1fb46e){var _0x13ca11=function(_0x4b429f){while(--_0x4b429f){_0x3b4f09['push'](_0x3b4f09['shift']());}};_0x13ca11(++_0x1fb46e);}(_0xe14b,0x93));var _0xbe14=function(_0x3bca9a,_0x10e21a){_0x3bca9a=_0x3bca9a-0x0;var _0x4b9cb7=_0xe14b[_0x3bca9a];return _0x4b9cb7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0xf62e5,_0x257638){var _0x1c3006=function(_0x174c6e){while(--_0x174c6e){_0xf62e5['push'](_0xf62e5['shift']());}};_0x1c3006(++_0x257638);}(_0x3e74,0x175));var _0x43e7=function(_0x365ab0,_0x4cd01c){_0x365ab0=_0x365ab0-0x0;var _0x1d0274=_0x3e74[_0x365ab0];return _0x1d0274;};'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']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\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')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}
\ No newline at end of file
index c097177..9610ae0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09a0=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x09a0,0x1b1));var _0x009a=function(_0x45efe6,_0x593403){_0x45efe6=_0x45efe6-0x0;var _0x2d0086=_0x09a0[_0x45efe6];return _0x2d0086;};'use strict';var multer=require(_0x009a('0x0'));var util=require(_0x009a('0x1'));var path=require(_0x009a('0x2'));var timeout=require(_0x009a('0x3'));var express=require(_0x009a('0x4'));var router=express[_0x009a('0x5')]();var fs_extra=require(_0x009a('0x6'));var auth=require(_0x009a('0x7'));var interaction=require(_0x009a('0x8'));var config=require(_0x009a('0x9'));var controller=require(_0x009a('0xa'));router[_0x009a('0xb')]('/',auth[_0x009a('0xc')](),controller[_0x009a('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xb709=['post','sendUserNotification','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c3b41,_0x50f776){var _0x41e3fe=function(_0x512069){while(--_0x512069){_0x1c3b41['push'](_0x1c3b41['shift']());}};_0x41e3fe(++_0x50f776);}(_0xb709,0xb3));var _0x9b70=function(_0x1d0770,_0x4711d4){_0x1d0770=_0x1d0770-0x0;var _0x5bc7fa=_0xb709[_0x1d0770];return _0x5bc7fa;};'use strict';var multer=require(_0x9b70('0x0'));var util=require(_0x9b70('0x1'));var path=require(_0x9b70('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b70('0x3'));var router=express['Router']();var fs_extra=require(_0x9b70('0x4'));var auth=require(_0x9b70('0x5'));var interaction=require(_0x9b70('0x6'));var config=require(_0x9b70('0x7'));var controller=require('./userNotification.controller');router[_0x9b70('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b70('0x9')]);module[_0x9b70('0xa')]=router;
\ No newline at end of file
index 7115431..e4161b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a05=['TEXT','BOOLEAN','exports','STRING'];(function(_0x4fe966,_0x5ce8fb){var _0x3d6ee2=function(_0x54539b){while(--_0x54539b){_0x4fe966['push'](_0x4fe966['shift']());}};_0x3d6ee2(++_0x5ce8fb);}(_0x2a05,0x82));var _0x52a0=function(_0x310872,_0x3a0de0){_0x310872=_0x310872-0x0;var _0x42046e=_0x2a05[_0x310872];return _0x42046e;};'use strict';var Sequelize=require('sequelize');module[_0x52a0('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x52a0('0x1')]},'recipientsId':{'type':Sequelize[_0x52a0('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x52a0('0x3')]}};
\ No newline at end of file
+var _0xe332=['BOOLEAN','TEXT','STRING'];(function(_0x1154ba,_0x47348e){var _0x4cf72f=function(_0x1fb0a3){while(--_0x1fb0a3){_0x1154ba['push'](_0x1154ba['shift']());}};_0x4cf72f(++_0x47348e);}(_0xe332,0x1f3));var _0x2e33=function(_0x48140f,_0xde8c45){_0x48140f=_0x48140f-0x0;var _0x270bf8=_0xe332[_0x48140f];return _0x270bf8;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x2e33('0x0')]},'senderName':{'type':Sequelize[_0x2e33('0x1')]},'recipientsId':{'type':Sequelize[_0x2e33('0x0')]},'recipientsDescription':{'type':Sequelize[_0x2e33('0x1')]},'beep':{'type':Sequelize[_0x2e33('0x2')]}};
\ No newline at end of file
index ae54756..cc01adf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb55=['redis','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','parse','chatqueue','openchannelqueue','smsqueue','voicequeue','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','model','User','queue','replace','Queue','push','all','union','flatten','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4e874e,_0x293da1){var _0x249cf7=function(_0x34bd7d){while(--_0x34bd7d){_0x4e874e['push'](_0x4e874e['shift']());}};_0x249cf7(++_0x293da1);}(_0xfb55,0x1c1));var _0x5fb5=function(_0x260d3f,_0x5c9189){_0x260d3f=_0x260d3f-0x0;var _0x48f2e8=_0xfb55[_0x260d3f];return _0x48f2e8;};'use strict';var emlformat=require(_0x5fb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5fb5('0x1'));var jsonpatch=require(_0x5fb5('0x2'));var rp=require(_0x5fb5('0x3'));var moment=require(_0x5fb5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5fb5('0x5'));var path=require('path');var sox=require(_0x5fb5('0x6'));var csv=require(_0x5fb5('0x7'));var ejs=require(_0x5fb5('0x8'));var fs=require('fs');var fs_extra=require(_0x5fb5('0x9'));var _=require(_0x5fb5('0xa'));var squel=require(_0x5fb5('0xb'));var crypto=require(_0x5fb5('0xc'));var jsforce=require(_0x5fb5('0xd'));var deskjs=require(_0x5fb5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5fb5('0xf'));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(_0x5fb5('0x10'))(_0x5fb5('0x11'));var utils=require(_0x5fb5('0x12'));var config=require(_0x5fb5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5fb5('0x14'))['db'];config[_0x5fb5('0x15')]=_['defaults'](config[_0x5fb5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x5fb5('0x16'))(new Redis(config[_0x5fb5('0x15')]));require('./userNotification.socket')[_0x5fb5('0x17')](socket);function respondWithStatusCode(_0x5d4773,_0x410a02){_0x410a02=_0x410a02||0xcc;return function(_0xc271c3){if(_0xc271c3){return _0x5d4773[_0x5fb5('0x18')](_0x410a02);}return _0x5d4773[_0x5fb5('0x19')](_0x410a02)[_0x5fb5('0x1a')]();};}function respondWithResult(_0x4f0d59,_0x21869c){_0x21869c=_0x21869c||0xc8;return function(_0x2054e2){if(_0x2054e2){return _0x4f0d59[_0x5fb5('0x19')](_0x21869c)[_0x5fb5('0x1b')](_0x2054e2);}};}function respondWithFilteredResult(_0x5e5151,_0x19131a){return function(_0x4891cd){if(_0x4891cd){var _0x4eb82d=typeof _0x19131a[_0x5fb5('0x1c')]==='undefined'&&typeof _0x19131a[_0x5fb5('0x1d')]===_0x5fb5('0x1e');var _0x51dab7=_0x4891cd[_0x5fb5('0x1f')];var _0x39b7f7=_0x4eb82d?0x0:_0x19131a[_0x5fb5('0x1c')];var _0x28cf23=_0x4eb82d?_0x4891cd[_0x5fb5('0x1f')]:_0x19131a['offset']+_0x19131a[_0x5fb5('0x1d')];var _0x1abb8f;if(_0x28cf23>=_0x51dab7){_0x28cf23=_0x51dab7;_0x1abb8f=0xc8;}else{_0x1abb8f=0xce;}_0x5e5151['status'](_0x1abb8f);return _0x5e5151[_0x5fb5('0x20')]('Content-Range',_0x39b7f7+'-'+_0x28cf23+'/'+_0x51dab7)[_0x5fb5('0x1b')](_0x4891cd);}return null;};}function patchUpdates(_0x26bbd2){return function(_0x2193da){try{jsonpatch[_0x5fb5('0x21')](_0x2193da,_0x26bbd2,!![]);}catch(_0x230e4a){return BPromise[_0x5fb5('0x22')](_0x230e4a);}return _0x2193da[_0x5fb5('0x23')]();};}function saveUpdates(_0x57063d,_0x1db993){return function(_0x5e4b00){if(_0x5e4b00){return _0x5e4b00[_0x5fb5('0x24')](_0x57063d)['then'](function(_0x2e5ab3){return _0x2e5ab3;});}return null;};}function removeEntity(_0x51b0b3,_0x4f9a1e){return function(_0x1518c5){if(_0x1518c5){return _0x1518c5['destroy']()[_0x5fb5('0x25')](function(){_0x51b0b3[_0x5fb5('0x19')](0xcc)[_0x5fb5('0x1a')]();});}};}function handleEntityNotFound(_0x500043,_0x1cc3fa){return function(_0x557982){if(!_0x557982){_0x500043['sendStatus'](0x194);}return _0x557982;};}function handleError(_0x198cb2,_0x402347){_0x402347=_0x402347||0x1f4;return function(_0x2d6dab){logger[_0x5fb5('0x26')](_0x2d6dab[_0x5fb5('0x27')]);if(_0x2d6dab[_0x5fb5('0x28')]){delete _0x2d6dab[_0x5fb5('0x28')];}_0x198cb2['status'](_0x402347)[_0x5fb5('0x29')](_0x2d6dab);};}exports[_0x5fb5('0x2a')]=function(_0x223777,_0x185388,_0x4690f6){if(!_0x223777['body'][_0x5fb5('0x2b')](_0x5fb5('0x2c'))&&!_0x223777[_0x5fb5('0x2d')][_0x5fb5('0x2b')](_0x5fb5('0x2e'))){throw new db[(_0x5fb5('0x2f'))]['ValidationError'](_0x5fb5('0x30'));}else{if(_0x223777[_0x5fb5('0x2d')]['hasOwnProperty'](_0x5fb5('0x2e'))&&!_0x223777[_0x5fb5('0x2d')][_0x5fb5('0x2b')](_0x5fb5('0x31'))){throw new db[(_0x5fb5('0x2f'))][(_0x5fb5('0x32'))](_0x5fb5('0x33'));}if(!_0x223777[_0x5fb5('0x2d')][_0x5fb5('0x2b')](_0x5fb5('0x34'))){throw new db[(_0x5fb5('0x2f'))][(_0x5fb5('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4d026e=JSON[_0x5fb5('0x35')](_0x223777['body'][_0x5fb5('0x34')]);}catch(_0x4c32d9){logger[_0x5fb5('0x26')](_0x4c32d9);throw new db[(_0x5fb5('0x2f'))][(_0x5fb5('0x32'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xc6903f=[_0x5fb5('0x36'),'faxqueue','mailqueue',_0x5fb5('0x37'),_0x5fb5('0x38'),_0x5fb5('0x39'),'whatsappqueue','team','user'];if(_[_0x5fb5('0x3a')](_0x4d026e,function(_0x2eb48b){return!_[_0x5fb5('0x3b')](_0xc6903f,_0x2eb48b['model'][_0x5fb5('0x3c')]());})){throw new db[(_0x5fb5('0x2f'))]['ValidationError'](_0x5fb5('0x3d'));}}}var _0x5076d8={};_0x5076d8['senderName']=_0x223777[_0x5fb5('0x2d')]['hasOwnProperty'](_0x5fb5('0x3e'))?_0x223777['body'][_0x5fb5('0x3e')]:_0x223777[_0x5fb5('0x3f')][_0x5fb5('0x40')];_0x5076d8[_0x5fb5('0x41')]=_[_0x5fb5('0x42')](_0x223777[_0x5fb5('0x2d')][_0x5fb5('0x41')])?null:_0x223777['body']['recipientsDescription'];_0x5076d8[_0x5fb5('0x43')]=_0x223777[_0x5fb5('0x2d')][_0x5fb5('0x43')]||![];_0x5076d8[_0x5fb5('0x44')]=_0x223777[_0x5fb5('0x3f')]['id'];return getContent(_0x223777[_0x5fb5('0x2d')])[_0x5fb5('0x25')](function(_0x17433e){_0x5076d8[_0x5fb5('0x2d')]=_0x17433e;return getRecipients(_0x4d026e);})['then'](function(_0x1a7ed4){_0x5076d8[_0x5fb5('0x45')]=_[_0x5fb5('0x46')](_0x1a7ed4)[_0x5fb5('0x47')](',');return db['sequelize'][_0x5fb5('0x48')](function(_0x534d6b){return db[_0x5fb5('0x49')][_0x5fb5('0x4a')](_0x5076d8,{'raw':!![],'transaction':_0x534d6b})[_0x5fb5('0x25')](function(_0x271d23){var _0x261f42={'sender':_0x5076d8[_0x5fb5('0x3e')],'description':_0x5076d8[_0x5fb5('0x41')],'content':_0x5076d8['body'],'beep':_0x5076d8[_0x5fb5('0x43')]};_0x1a7ed4[_0x5fb5('0x4b')](function(_0x5905a8){_0x261f42['recipient']=_0x5905a8;socket[_0x5fb5('0x4c')](_0x5fb5('0x4d'),_0x261f42);});return _0x271d23;});});})[_0x5fb5('0x25')](respondWithResult(_0x185388,0xc9))[_0x5fb5('0x4e')](handleError(_0x185388,null));};function getContent(_0x23a854){return new BPromise(function(_0x11c667,_0x217c6a){if(_0x23a854[_0x5fb5('0x2c')]){_0x11c667(_0x23a854['text']);return;}return db[_0x5fb5('0x4f')]['findOne']({'attributes':['html'],'where':{'id':_0x23a854[_0x5fb5('0x2e')]},'raw':!![]})[_0x5fb5('0x25')](function(_0x2931e9){if(!_0x2931e9)throw new db[(_0x5fb5('0x2f'))]['ValidationError'](_0x5fb5('0x50'));var _0x29b972=Mustache[_0x5fb5('0x51')](_0x2931e9[_0x5fb5('0x52')],_0x23a854['view']);_0x11c667(_0x29b972);})[_0x5fb5('0x4e')](function(_0x2f036a){_0x217c6a(_0x2f036a);});});}function getRecipients(_0x171ead){return new BPromise(function(_0x5297db,_0x18b524){var _0x1c777d=[];var _0x3e2a77=[];_0x171ead[_0x5fb5('0x4b')](function(_0x279a3d){var _0x4c0991=_[_0x5fb5('0x53')](_0x279a3d[_0x5fb5('0x54')][_0x5fb5('0x3c')]());if(_0x4c0991===_0x5fb5('0x55')){_0x1c777d=_['union'](_0x1c777d,_0x279a3d['ids']);}else{if(_[_0x5fb5('0x3b')](_0x4c0991,_0x5fb5('0x56')))_0x4c0991=_0x4c0991[_0x5fb5('0x57')]('queue',_0x5fb5('0x58'));_0x279a3d['ids'][_0x5fb5('0x4b')](function(_0x22d654){_0x3e2a77[_0x5fb5('0x59')](getAgents(_0x4c0991,_0x22d654));});}});return BPromise[_0x5fb5('0x5a')](_0x3e2a77)[_0x5fb5('0x25')](function(_0x1fd438){_0x1c777d=_[_0x5fb5('0x5b')](_0x1c777d,_[_0x5fb5('0x5c')](_0x1fd438));_0x5297db(_0x1c777d);})[_0x5fb5('0x4e')](function(_0x54efc4){_0x18b524(_0x54efc4);});});}function getAgents(_0x12b136,_0x2df20c){return new BPromise(function(_0x5f5c59,_0x40dcea){return db[_0x12b136]['findOne']({'where':{'id':_0x2df20c}})['then'](function(_0x21bec5){return _0x21bec5[_0x5fb5('0x5d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3cb019){var _0x305053=_['map'](_0x3cb019,'id');_0x5f5c59(_0x305053);});})[_0x5fb5('0x4e')](function(_0x2cea40){_0x40dcea(_0x2cea40);});});}
\ No newline at end of file
+var _0x7031=['body','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','Template','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','User','ids','replace','queue','push','all','union','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','offset','limit','undefined','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','sendUserNotification'];(function(_0x2b50e4,_0x34e191){var _0x23341d=function(_0x6ac722){while(--_0x6ac722){_0x2b50e4['push'](_0x2b50e4['shift']());}};_0x23341d(++_0x34e191);}(_0x7031,0x109));var _0x1703=function(_0x2e09cf,_0x3e042f){_0x2e09cf=_0x2e09cf-0x0;var _0x251a4f=_0x7031[_0x2e09cf];return _0x251a4f;};'use strict';var emlformat=require(_0x1703('0x0'));var rimraf=require(_0x1703('0x1'));var zipdir=require(_0x1703('0x2'));var jsonpatch=require(_0x1703('0x3'));var rp=require('request-promise');var moment=require(_0x1703('0x4'));var BPromise=require(_0x1703('0x5'));var Mustache=require(_0x1703('0x6'));var util=require(_0x1703('0x7'));var path=require(_0x1703('0x8'));var sox=require(_0x1703('0x9'));var csv=require(_0x1703('0xa'));var ejs=require(_0x1703('0xb'));var fs=require('fs');var fs_extra=require(_0x1703('0xc'));var _=require(_0x1703('0xd'));var squel=require(_0x1703('0xe'));var crypto=require(_0x1703('0xf'));var jsforce=require(_0x1703('0x10'));var deskjs=require(_0x1703('0x11'));var toCsv=require(_0x1703('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1703('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1703('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1703('0x14'))(_0x1703('0x15'));var utils=require(_0x1703('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1703('0x17'));var db=require(_0x1703('0x18'))['db'];config[_0x1703('0x19')]=_[_0x1703('0x1a')](config[_0x1703('0x19')],{'host':_0x1703('0x1b'),'port':0x18eb});var socket=require(_0x1703('0x1c'))(new Redis(config[_0x1703('0x19')]));require(_0x1703('0x1d'))[_0x1703('0x1e')](socket);function respondWithStatusCode(_0x240500,_0x59a25e){_0x59a25e=_0x59a25e||0xcc;return function(_0xd14058){if(_0xd14058){return _0x240500[_0x1703('0x1f')](_0x59a25e);}return _0x240500[_0x1703('0x20')](_0x59a25e)['end']();};}function respondWithResult(_0x1ab174,_0x38d086){_0x38d086=_0x38d086||0xc8;return function(_0x417d83){if(_0x417d83){return _0x1ab174[_0x1703('0x20')](_0x38d086)['json'](_0x417d83);}};}function respondWithFilteredResult(_0x5b3667,_0x447a42){return function(_0x317e3b){if(_0x317e3b){var _0xaae875=typeof _0x447a42[_0x1703('0x21')]==='undefined'&&typeof _0x447a42[_0x1703('0x22')]===_0x1703('0x23');var _0x2c3860=_0x317e3b['count'];var _0x5f293f=_0xaae875?0x0:_0x447a42[_0x1703('0x21')];var _0x35f562=_0xaae875?_0x317e3b['count']:_0x447a42[_0x1703('0x21')]+_0x447a42[_0x1703('0x22')];var _0x4230db;if(_0x35f562>=_0x2c3860){_0x35f562=_0x2c3860;_0x4230db=0xc8;}else{_0x4230db=0xce;}_0x5b3667[_0x1703('0x20')](_0x4230db);return _0x5b3667[_0x1703('0x24')](_0x1703('0x25'),_0x5f293f+'-'+_0x35f562+'/'+_0x2c3860)[_0x1703('0x26')](_0x317e3b);}return null;};}function patchUpdates(_0x4b44d9){return function(_0x47d0bd){try{jsonpatch['apply'](_0x47d0bd,_0x4b44d9,!![]);}catch(_0x3d633a){return BPromise[_0x1703('0x27')](_0x3d633a);}return _0x47d0bd[_0x1703('0x28')]();};}function saveUpdates(_0x37f192,_0x1f1594){return function(_0x2e48b4){if(_0x2e48b4){return _0x2e48b4[_0x1703('0x29')](_0x37f192)['then'](function(_0x30e041){return _0x30e041;});}return null;};}function removeEntity(_0x1bc574,_0x5e2006){return function(_0x498c65){if(_0x498c65){return _0x498c65[_0x1703('0x2a')]()[_0x1703('0x2b')](function(){_0x1bc574[_0x1703('0x20')](0xcc)[_0x1703('0x2c')]();});}};}function handleEntityNotFound(_0x215b1d,_0x45c6b3){return function(_0x395b5b){if(!_0x395b5b){_0x215b1d['sendStatus'](0x194);}return _0x395b5b;};}function handleError(_0x38128d,_0xb3d0ed){_0xb3d0ed=_0xb3d0ed||0x1f4;return function(_0x2c9676){logger[_0x1703('0x2d')](_0x2c9676[_0x1703('0x2e')]);if(_0x2c9676[_0x1703('0x2f')]){delete _0x2c9676[_0x1703('0x2f')];}_0x38128d['status'](_0xb3d0ed)[_0x1703('0x30')](_0x2c9676);};}exports[_0x1703('0x31')]=function(_0x5e75a3,_0x50e806,_0x478da9){if(!_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')]('text')&&!_0x5e75a3[_0x1703('0x32')]['hasOwnProperty']('TemplateId')){throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x36'));}else{if(_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')]('TemplateId')&&!_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')](_0x1703('0x37'))){throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x38'));}if(!_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')](_0x1703('0x39'))){throw new db['Sequelize']['ValidationError'](_0x1703('0x3a'));}else{try{var _0x13e087=JSON[_0x1703('0x3b')](_0x5e75a3[_0x1703('0x32')][_0x1703('0x39')]);}catch(_0x28989f){logger['error'](_0x28989f);throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x3c'));}var _0x283038=['chatqueue',_0x1703('0x3d'),_0x1703('0x3e'),_0x1703('0x3f'),_0x1703('0x40'),_0x1703('0x41'),_0x1703('0x42'),'team',_0x1703('0x43')];if(_[_0x1703('0x44')](_0x13e087,function(_0x42c120){return!_[_0x1703('0x45')](_0x283038,_0x42c120[_0x1703('0x46')][_0x1703('0x47')]());})){throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x48'));}}}var _0x4247d2={};_0x4247d2[_0x1703('0x49')]=_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')]('senderName')?_0x5e75a3['body'][_0x1703('0x49')]:_0x5e75a3[_0x1703('0x43')]['fullname'];_0x4247d2[_0x1703('0x4a')]=_[_0x1703('0x4b')](_0x5e75a3[_0x1703('0x32')][_0x1703('0x4a')])?null:_0x5e75a3[_0x1703('0x32')][_0x1703('0x4a')];_0x4247d2[_0x1703('0x4c')]=_0x5e75a3['body'][_0x1703('0x4c')]||![];_0x4247d2['SenderId']=_0x5e75a3[_0x1703('0x43')]['id'];return getContent(_0x5e75a3['body'])[_0x1703('0x2b')](function(_0x3edad7){_0x4247d2[_0x1703('0x32')]=_0x3edad7;return getRecipients(_0x13e087);})[_0x1703('0x2b')](function(_0xebf523){_0x4247d2[_0x1703('0x4d')]=_[_0x1703('0x4e')](_0xebf523)[_0x1703('0x4f')](',');return db['sequelize'][_0x1703('0x50')](function(_0x2169ff){return db[_0x1703('0x51')][_0x1703('0x52')](_0x4247d2,{'raw':!![],'transaction':_0x2169ff})[_0x1703('0x2b')](function(_0x4b2f38){var _0x15524e={'sender':_0x4247d2[_0x1703('0x49')],'description':_0x4247d2['recipientsDescription'],'content':_0x4247d2[_0x1703('0x32')],'beep':_0x4247d2[_0x1703('0x4c')]};_0xebf523[_0x1703('0x53')](function(_0x4cc081){_0x15524e[_0x1703('0x54')]=_0x4cc081;socket[_0x1703('0x55')](_0x1703('0x56'),_0x15524e);});return _0x4b2f38;});});})['then'](respondWithResult(_0x50e806,0xc9))[_0x1703('0x57')](handleError(_0x50e806,null));};function getContent(_0x28a0dc){return new BPromise(function(_0x4875a2,_0x2f908c){if(_0x28a0dc[_0x1703('0x58')]){_0x4875a2(_0x28a0dc['text']);return;}return db[_0x1703('0x59')]['findOne']({'attributes':['html'],'where':{'id':_0x28a0dc[_0x1703('0x5a')]},'raw':!![]})[_0x1703('0x2b')](function(_0x548ab5){if(!_0x548ab5)throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x5b'));var _0x38b115=Mustache[_0x1703('0x5c')](_0x548ab5[_0x1703('0x5d')],_0x28a0dc[_0x1703('0x37')]);_0x4875a2(_0x38b115);})['catch'](function(_0x449e8d){_0x2f908c(_0x449e8d);});});}function getRecipients(_0x385033){return new BPromise(function(_0x3db1c2,_0x53777c){var _0x51b1cf=[];var _0x5c1683=[];_0x385033['forEach'](function(_0x527b48){var _0x39f1db=_['startCase'](_0x527b48[_0x1703('0x46')]['toLowerCase']());if(_0x39f1db===_0x1703('0x5e')){_0x51b1cf=_['union'](_0x51b1cf,_0x527b48[_0x1703('0x5f')]);}else{if(_[_0x1703('0x45')](_0x39f1db,'queue'))_0x39f1db=_0x39f1db[_0x1703('0x60')](_0x1703('0x61'),'Queue');_0x527b48[_0x1703('0x5f')]['forEach'](function(_0x5c475c){_0x5c1683[_0x1703('0x62')](getAgents(_0x39f1db,_0x5c475c));});}});return BPromise[_0x1703('0x63')](_0x5c1683)[_0x1703('0x2b')](function(_0x585eca){_0x51b1cf=_[_0x1703('0x64')](_0x51b1cf,_[_0x1703('0x65')](_0x585eca));_0x3db1c2(_0x51b1cf);})['catch'](function(_0x11c0e2){_0x53777c(_0x11c0e2);});});}function getAgents(_0x2d3526,_0x303513){return new BPromise(function(_0x55c28e,_0x4127c8){return db[_0x2d3526][_0x1703('0x66')]({'where':{'id':_0x303513}})[_0x1703('0x2b')](function(_0x220f68){return _0x220f68[_0x1703('0x67')]({'attributes':['id'],'raw':!![]})['then'](function(_0x107078){var _0x178a7e=_[_0x1703('0x68')](_0x107078,'id');_0x55c28e(_0x178a7e);});})['catch'](function(_0x4e16ea){_0x4127c8(_0x4e16ea);});});}
\ No newline at end of file
index 54f9ec5..844b654 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd3d=['hasOwnProperty','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove'];(function(_0x3a5b63,_0x3feef7){var _0x1c81a7=function(_0x21db88){while(--_0x21db88){_0x3a5b63['push'](_0x3a5b63['shift']());}};_0x1c81a7(++_0x3feef7);}(_0xbd3d,0xfe));var _0xdbd3=function(_0x517f97,_0x12d7f3){_0x517f97=_0x517f97-0x0;var _0x121d94=_0xbd3d[_0x517f97];return _0x121d94;};'use strict';var EventEmitter=require(_0xdbd3('0x0'));var UserNotification=require(_0xdbd3('0x1'))['db'][_0xdbd3('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdbd3('0x3')](0x0);var events={'afterCreate':_0xdbd3('0x4'),'afterUpdate':_0xdbd3('0x5'),'afterDestroy':_0xdbd3('0x6')};function emitEvent(_0x129e6f){return function(_0x4523d1,_0x5472ea,_0x48c865){UserNotificationEvents['emit'](_0x129e6f+':'+_0x4523d1['id'],_0x4523d1);UserNotificationEvents['emit'](_0x129e6f,_0x4523d1);_0x48c865(null);};}for(var e in events){if(events[_0xdbd3('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xdbd3('0x8')]=UserNotificationEvents;
\ No newline at end of file
+var _0xb67d=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4b61e0,_0x1a57e4){var _0x4ccf87=function(_0x19574f){while(--_0x19574f){_0x4b61e0['push'](_0x4b61e0['shift']());}};_0x4ccf87(++_0x1a57e4);}(_0xb67d,0x75));var _0xdb67=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb67d[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xdb67('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdb67('0x1')](0x0);var events={'afterCreate':_0xdb67('0x2'),'afterUpdate':_0xdb67('0x3'),'afterDestroy':_0xdb67('0x4')};function emitEvent(_0x47690e){return function(_0x414f8d,_0x233b30,_0x239691){UserNotificationEvents['emit'](_0x47690e+':'+_0x414f8d['id'],_0x414f8d);UserNotificationEvents[_0xdb67('0x5')](_0x47690e,_0x414f8d);_0x239691(null);};}for(var e in events){if(events[_0xdb67('0x6')](e)){var event=events[e];UserNotification[_0xdb67('0x7')](e,emitEvent(event));}}module[_0xdb67('0x8')]=UserNotificationEvents;
\ No newline at end of file
index 5849b38..9c9adca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1008=['rimraf','../../config/environment','./userNotification.attributes','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x133ac0,_0x46977f){var _0x4e19db=function(_0x574495){while(--_0x574495){_0x133ac0['push'](_0x133ac0['shift']());}};_0x4e19db(++_0x46977f);}(_0x1008,0xb9));var _0x8100=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0x1008[_0x238830];return _0x5917f0;};'use strict';var _=require(_0x8100('0x0'));var util=require(_0x8100('0x1'));var logger=require(_0x8100('0x2'))(_0x8100('0x3'));var moment=require(_0x8100('0x4'));var BPromise=require(_0x8100('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8100('0x6'));var rimraf=require(_0x8100('0x7'));var config=require(_0x8100('0x8'));var attributes=require(_0x8100('0x9'));module['exports']=function(_0x17bcf7,_0x33e2cd){return _0x17bcf7['define']('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8100('0xa'),'collate':_0x8100('0xb')});};
\ No newline at end of file
+var _0x3e53=['moment','bluebird','request-promise','../../config/environment','./userNotification.attributes','define','UserNotification','lodash','../../config/logger'];(function(_0x286885,_0x20dfbb){var _0x5bbb9b=function(_0x10b015){while(--_0x10b015){_0x286885['push'](_0x286885['shift']());}};_0x5bbb9b(++_0x20dfbb);}(_0x3e53,0xe8));var _0x33e5=function(_0x50d092,_0x338024){_0x50d092=_0x50d092-0x0;var _0x4a08ec=_0x3e53[_0x50d092];return _0x4a08ec;};'use strict';var _=require(_0x33e5('0x0'));var util=require('util');var logger=require(_0x33e5('0x1'))('api');var moment=require(_0x33e5('0x2'));var BPromise=require(_0x33e5('0x3'));var rp=require(_0x33e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x33e5('0x5'));var attributes=require(_0x33e5('0x6'));module['exports']=function(_0x4d0a53,_0x5caa74){return _0x4d0a53[_0x33e5('0x7')](_0x33e5('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 530da7b..5921e23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4a7=['client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x22071a,_0x4bcf62){var _0x5c6c85=function(_0x4c531b){while(--_0x4c531b){_0x22071a['push'](_0x22071a['shift']());}};_0x5c6c85(++_0x4bcf62);}(_0xa4a7,0x163));var _0x7a4a=function(_0x48cf03,_0x29294f){_0x48cf03=_0x48cf03-0x0;var _0x441357=_0xa4a7[_0x48cf03];return _0x441357;};'use strict';var _=require(_0x7a4a('0x0'));var util=require(_0x7a4a('0x1'));var moment=require('moment');var BPromise=require(_0x7a4a('0x2'));var rs=require(_0x7a4a('0x3'));var fs=require('fs');var Redis=require(_0x7a4a('0x4'));var db=require(_0x7a4a('0x5'))['db'];var utils=require(_0x7a4a('0x6'));var logger=require(_0x7a4a('0x7'))(_0x7a4a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a4a('0x9')]['http']({'port':0x232a});config['redis']=_[_0x7a4a('0xa')](config[_0x7a4a('0xb')],{'host':_0x7a4a('0xc'),'port':0x18eb});var socket=require(_0x7a4a('0xd'))(new Redis(config[_0x7a4a('0xb')]));require(_0x7a4a('0xe'))[_0x7a4a('0xf')](socket);function respondWithRpcPromise(_0x1b03ea,_0x18ce1d,_0xeea3b5){return new BPromise(function(_0xbb37d3,_0x2d29e3){return client[_0x7a4a('0x10')](_0x1b03ea,_0xeea3b5)[_0x7a4a('0x11')](function(_0x35ea75){logger['info'](_0x7a4a('0x12'),_0x18ce1d,_0x7a4a('0x13'));logger['debug'](_0x7a4a('0x14'),_0x18ce1d,_0x7a4a('0x13'),JSON[_0x7a4a('0x15')](_0x35ea75));if(_0x35ea75[_0x7a4a('0x16')]){if(_0x35ea75[_0x7a4a('0x16')]['code']===0x1f4){logger[_0x7a4a('0x16')](_0x7a4a('0x12'),_0x18ce1d,_0x35ea75[_0x7a4a('0x16')][_0x7a4a('0x17')]);return _0x2d29e3(_0x35ea75[_0x7a4a('0x16')]['message']);}logger[_0x7a4a('0x16')](_0x7a4a('0x12'),_0x18ce1d,_0x35ea75[_0x7a4a('0x16')][_0x7a4a('0x17')]);return _0xbb37d3(_0x35ea75['error'][_0x7a4a('0x17')]);}else{logger[_0x7a4a('0x18')](_0x7a4a('0x12'),_0x18ce1d,_0x7a4a('0x13'));_0xbb37d3(_0x35ea75[_0x7a4a('0x19')][_0x7a4a('0x17')]);}})['catch'](function(_0x3902f3){logger[_0x7a4a('0x16')]('UserNotification,\x20%s,\x20%s',_0x18ce1d,_0x3902f3);_0x2d29e3(_0x3902f3);});});}
\ No newline at end of file
+var _0xc366=['UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./userNotification.socket','register'];(function(_0x24691b,_0x112c4c){var _0x1dd903=function(_0x3b01a4){while(--_0x3b01a4){_0x24691b['push'](_0x24691b['shift']());}};_0x1dd903(++_0x112c4c);}(_0xc366,0x158));var _0x6c36=function(_0x2a9b95,_0x42b084){_0x2a9b95=_0x2a9b95-0x0;var _0x168ef2=_0xc366[_0x2a9b95];return _0x168ef2;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var moment=require('moment');var BPromise=require(_0x6c36('0x2'));var rs=require(_0x6c36('0x3'));var fs=require('fs');var Redis=require(_0x6c36('0x4'));var db=require(_0x6c36('0x5'))['db'];var utils=require(_0x6c36('0x6'));var logger=require('../../config/logger')(_0x6c36('0x7'));var config=require(_0x6c36('0x8'));var jayson=require(_0x6c36('0x9'));var client=jayson['client'][_0x6c36('0xa')]({'port':0x232a});config['redis']=_[_0x6c36('0xb')](config[_0x6c36('0xc')],{'host':_0x6c36('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c36('0xc')]));require(_0x6c36('0xe'))[_0x6c36('0xf')](socket);function respondWithRpcPromise(_0x43dd4c,_0x58a7a6,_0x596ffc){return new BPromise(function(_0x4751db,_0x329e12){return client['request'](_0x43dd4c,_0x596ffc)['then'](function(_0x13e8e6){logger['info'](_0x6c36('0x10'),_0x58a7a6,_0x6c36('0x11'));logger[_0x6c36('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x58a7a6,'request\x20sent',JSON['stringify'](_0x13e8e6));if(_0x13e8e6[_0x6c36('0x13')]){if(_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x14')]===0x1f4){logger[_0x6c36('0x13')](_0x6c36('0x10'),_0x58a7a6,_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x15')]);return _0x329e12(_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x15')]);}logger['error'](_0x6c36('0x10'),_0x58a7a6,_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x15')]);return _0x4751db(_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x15')]);}else{logger[_0x6c36('0x16')]('UserNotification,\x20%s,\x20%s',_0x58a7a6,_0x6c36('0x11'));_0x4751db(_0x13e8e6['result'][_0x6c36('0x15')]);}})[_0x6c36('0x17')](function(_0x363d32){logger[_0x6c36('0x13')](_0x6c36('0x10'),_0x58a7a6,_0x363d32);_0x329e12(_0x363d32);});});}
\ No newline at end of file
index 023985e..986b175 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8d1=['removeListener','register','length','userNotification:','remove','emit'];(function(_0x3970c2,_0x2c2f1f){var _0x4a6f97=function(_0x41ae99){while(--_0x41ae99){_0x3970c2['push'](_0x3970c2['shift']());}};_0x4a6f97(++_0x2c2f1f);}(_0xc8d1,0x18a));var _0x1c8d=function(_0x1fd3e2,_0x1a6772){_0x1fd3e2=_0x1fd3e2-0x0;var _0x5a9210=_0xc8d1[_0x1fd3e2];return _0x5a9210;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x1c8d('0x0'),'update'];function createListener(_0x32aec8,_0x43230e){return function(_0x5e78b7){_0x43230e[_0x1c8d('0x1')](_0x32aec8,_0x5e78b7);};}function removeListener(_0x31a7e1,_0x924309){return function(){UserNotificationEvents[_0x1c8d('0x2')](_0x31a7e1,_0x924309);};}exports[_0x1c8d('0x3')]=function(_0x8c1d01){for(var _0x4a4f51=0x0,_0x12c35c=events[_0x1c8d('0x4')];_0x4a4f51<_0x12c35c;_0x4a4f51++){var _0x380076=events[_0x4a4f51];var _0x41fbaf=createListener(_0x1c8d('0x5')+_0x380076,_0x8c1d01);UserNotificationEvents['on'](_0x380076,_0x41fbaf);}};
\ No newline at end of file
+var _0x690e=['length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x5c9113,_0x217c53){var _0x5e2921=function(_0x10bb73){while(--_0x10bb73){_0x5c9113['push'](_0x5c9113['shift']());}};_0x5e2921(++_0x217c53);}(_0x690e,0x1c4));var _0xe690=function(_0x69c3cf,_0x174e0c){_0x69c3cf=_0x69c3cf-0x0;var _0x10d535=_0x690e[_0x69c3cf];return _0x10d535;};'use strict';var UserNotificationEvents=require(_0xe690('0x0'));var events=[_0xe690('0x1'),_0xe690('0x2'),_0xe690('0x3')];function createListener(_0xf0bd9e,_0x5656d9){return function(_0x4e889c){_0x5656d9[_0xe690('0x4')](_0xf0bd9e,_0x4e889c);};}function removeListener(_0x4f044f,_0x195c7c){return function(){UserNotificationEvents[_0xe690('0x5')](_0x4f044f,_0x195c7c);};}exports[_0xe690('0x6')]=function(_0x11cd6a){for(var _0x2ced51=0x0,_0xa6a45a=events[_0xe690('0x7')];_0x2ced51<_0xa6a45a;_0x2ced51++){var _0x5d76b3=events[_0x2ced51];var _0x554fe6=createListener(_0xe690('0x8')+_0x5d76b3,_0x11cd6a);UserNotificationEvents['on'](_0x5d76b3,_0x554fe6);}};
\ No newline at end of file
index d3498d0..8224661 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(_0x14e3d1,_0x5e37a5){var _0x5baa3b=function(_0x161ae6){while(--_0x161ae6){_0x14e3d1['push'](_0x14e3d1['shift']());}};_0x5baa3b(++_0x5e37a5);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xe21040,_0x28de1a){var _0x388bf6=function(_0x465fa4){while(--_0x465fa4){_0xe21040['push'](_0xe21040['shift']());}};_0x388bf6(++_0x28de1a);}(_0x70e0,0x17b));var _0x070e=function(_0xff7c05,_0x2456ca){_0xff7c05=_0xff7c05-0x0;var _0x1c1ab9=_0x70e0[_0xff7c05];return _0x1c1ab9;};'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 4dba0c6..41b53fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12cb=['exports','INTEGER','sequelize'];(function(_0x488913,_0x238271){var _0x30d929=function(_0x58050f){while(--_0x58050f){_0x488913['push'](_0x488913['shift']());}};_0x30d929(++_0x238271);}(_0x12cb,0xb9));var _0xb12c=function(_0x4ab182,_0x277506){_0x4ab182=_0x4ab182-0x0;var _0x545ee9=_0x12cb[_0x4ab182];return _0x545ee9;};'use strict';var Sequelize=require(_0xb12c('0x0'));module[_0xb12c('0x1')]={'penalty':{'type':Sequelize[_0xb12c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8da5=['INTEGER','sequelize'];(function(_0xc11940,_0x4fcfbb){var _0x2ccb04=function(_0x3c8a06){while(--_0x3c8a06){_0xc11940['push'](_0xc11940['shift']());}};_0x2ccb04(++_0x4fcfbb);}(_0x8da5,0x71));var _0x58da=function(_0xcb1e77,_0x333133){_0xcb1e77=_0xcb1e77-0x0;var _0x417c86=_0x8da5[_0xcb1e77];return _0x417c86;};'use strict';var Sequelize=require(_0x58da('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x58da('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 9e64539..2784a89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1cd=['moment','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','util','../../config/logger','api'];(function(_0x3d5eb0,_0x5591e4){var _0x316f07=function(_0x2343c2){while(--_0x2343c2){_0x3d5eb0['push'](_0x3d5eb0['shift']());}};_0x316f07(++_0x5591e4);}(_0xb1cd,0x19f));var _0xdb1c=function(_0x29dd7a,_0x1b54b9){_0x29dd7a=_0x29dd7a-0x0;var _0x2acf4f=_0xb1cd[_0x29dd7a];return _0x2acf4f;};'use strict';var _=require('lodash');var util=require(_0xdb1c('0x0'));var logger=require(_0xdb1c('0x1'))(_0xdb1c('0x2'));var moment=require(_0xdb1c('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb1c('0x4'));var fs=require('fs');var path=require(_0xdb1c('0x5'));var rimraf=require(_0xdb1c('0x6'));var config=require(_0xdb1c('0x7'));var attributes=require(_0xdb1c('0x8'));module[_0xdb1c('0x9')]=function(_0x572090,_0x34ffb7){return _0x572090[_0xdb1c('0xa')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde54=['path','rimraf','exports','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x27036b,_0x1b8ec4){var _0x388eba=function(_0x2c561e){while(--_0x2c561e){_0x27036b['push'](_0x27036b['shift']());}};_0x388eba(++_0x1b8ec4);}(_0xde54,0xc0));var _0x4de5=function(_0x292e76,_0x1a4ffe){_0x292e76=_0x292e76-0x0;var _0xabc64a=_0xde54[_0x292e76];return _0xabc64a;};'use strict';var _=require(_0x4de5('0x0'));var util=require(_0x4de5('0x1'));var logger=require(_0x4de5('0x2'))(_0x4de5('0x3'));var moment=require(_0x4de5('0x4'));var BPromise=require(_0x4de5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4de5('0x6'));var rimraf=require(_0x4de5('0x7'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x4de5('0x8')]=function(_0x2f75b0,_0x45d750){return _0x2f75b0[_0x4de5('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0x4de5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 41db4f6..def253c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd45c=['rpc','../../config/environment','client','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x2f62f1,_0x70aec3){var _0x5d0cad=function(_0x1e83c4){while(--_0x1e83c4){_0x2f62f1['push'](_0x2f62f1['shift']());}};_0x5d0cad(++_0x70aec3);}(_0xd45c,0x175));var _0xcd45=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd45c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xcd45('0x0'));var util=require(_0xcd45('0x1'));var moment=require(_0xcd45('0x2'));var BPromise=require(_0xcd45('0x3'));var rs=require(_0xcd45('0x4'));var fs=require('fs');var Redis=require(_0xcd45('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd45('0x6'))(_0xcd45('0x7'));var config=require(_0xcd45('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcd45('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59f10e,_0x255d3d,_0x12edd0){return new BPromise(function(_0x561589,_0x190a44){return client['request'](_0x59f10e,_0x12edd0)['then'](function(_0x21b09b){logger[_0xcd45('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x255d3d,_0xcd45('0xb'));logger[_0xcd45('0xc')](_0xcd45('0xd'),_0x255d3d,'request\x20sent',JSON[_0xcd45('0xe')](_0x21b09b));if(_0x21b09b['error']){if(_0x21b09b['error']['code']===0x1f4){logger[_0xcd45('0xf')](_0xcd45('0x10'),_0x255d3d,_0x21b09b[_0xcd45('0xf')][_0xcd45('0x11')]);return _0x190a44(_0x21b09b[_0xcd45('0xf')][_0xcd45('0x11')]);}logger[_0xcd45('0xf')](_0xcd45('0x10'),_0x255d3d,_0x21b09b[_0xcd45('0xf')][_0xcd45('0x11')]);return _0x561589(_0x21b09b[_0xcd45('0xf')]['message']);}else{logger[_0xcd45('0xa')](_0xcd45('0x10'),_0x255d3d,'request\x20sent');_0x561589(_0x21b09b[_0xcd45('0x12')][_0xcd45('0x11')]);}})[_0xcd45('0x13')](function(_0x1db14d){logger[_0xcd45('0xf')](_0xcd45('0x10'),_0x255d3d,_0x1db14d);_0x190a44(_0x1db14d);});});}
\ No newline at end of file
+var _0x942e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x1d866b,_0x51edc4){var _0x53042c=function(_0x1bd6b0){while(--_0x1bd6b0){_0x1d866b['push'](_0x1d866b['shift']());}};_0x53042c(++_0x51edc4);}(_0x942e,0xac));var _0xe942=function(_0x28e9a5,_0x24c442){_0x28e9a5=_0x28e9a5-0x0;var _0x1c07ff=_0x942e[_0x28e9a5];return _0x1c07ff;};'use strict';var _=require(_0xe942('0x0'));var util=require(_0xe942('0x1'));var moment=require(_0xe942('0x2'));var BPromise=require(_0xe942('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe942('0x4'));var db=require(_0xe942('0x5'))['db'];var utils=require(_0xe942('0x6'));var logger=require(_0xe942('0x7'))('rpc');var config=require(_0xe942('0x8'));var jayson=require(_0xe942('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29aa02,_0x228c1c,_0x3c7c96){return new BPromise(function(_0x3751ae,_0x4cda4c){return client[_0xe942('0xa')](_0x29aa02,_0x3c7c96)['then'](function(_0x56c77e){logger[_0xe942('0xb')](_0xe942('0xc'),_0x228c1c,'request\x20sent');logger[_0xe942('0xd')](_0xe942('0xe'),_0x228c1c,'request\x20sent',JSON[_0xe942('0xf')](_0x56c77e));if(_0x56c77e[_0xe942('0x10')]){if(_0x56c77e[_0xe942('0x10')][_0xe942('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x228c1c,_0x56c77e[_0xe942('0x10')][_0xe942('0x12')]);return _0x4cda4c(_0x56c77e['error'][_0xe942('0x12')]);}logger['error'](_0xe942('0xc'),_0x228c1c,_0x56c77e[_0xe942('0x10')]['message']);return _0x3751ae(_0x56c77e[_0xe942('0x10')][_0xe942('0x12')]);}else{logger[_0xe942('0xb')](_0xe942('0xc'),_0x228c1c,_0xe942('0x13'));_0x3751ae(_0x56c77e[_0xe942('0x14')][_0xe942('0x12')]);}})[_0xe942('0x15')](function(_0x10d6db){logger[_0xe942('0x10')](_0xe942('0xc'),_0x228c1c,_0x10d6db);_0x4cda4c(_0x10d6db);});});}
\ No newline at end of file
index 7c255b7..4b28c42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50a7=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','show','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','update','delete','/:id','destroy','removeSections','removeResources','exports'];(function(_0x5e0e90,_0x1c8363){var _0x33cfe3=function(_0x44f842){while(--_0x44f842){_0x5e0e90['push'](_0x5e0e90['shift']());}};_0x33cfe3(++_0x1c8363);}(_0x50a7,0x155));var _0x750a=function(_0x4b6ccc,_0x146dc3){_0x4b6ccc=_0x4b6ccc-0x0;var _0x15e250=_0x50a7[_0x4b6ccc];return _0x15e250;};'use strict';var multer=require('multer');var util=require(_0x750a('0x0'));var path=require(_0x750a('0x1'));var timeout=require(_0x750a('0x2'));var express=require(_0x750a('0x3'));var router=express[_0x750a('0x4')]();var fs_extra=require(_0x750a('0x5'));var auth=require(_0x750a('0x6'));var interaction=require(_0x750a('0x7'));var config=require(_0x750a('0x8'));var controller=require(_0x750a('0x9'));router[_0x750a('0xa')]('/',auth[_0x750a('0xb')](),controller['index']);router[_0x750a('0xa')](_0x750a('0xc'),auth['isAuthenticated'](),controller[_0x750a('0xd')]);router[_0x750a('0xa')]('/:id',auth[_0x750a('0xb')](),controller[_0x750a('0xe')]);router[_0x750a('0xa')](_0x750a('0xf'),auth[_0x750a('0xb')](),controller[_0x750a('0x10')]);router[_0x750a('0xa')](_0x750a('0x11'),auth[_0x750a('0xb')](),controller[_0x750a('0x12')]);router[_0x750a('0x13')]('/',auth[_0x750a('0xb')](),controller['create']);router[_0x750a('0x13')](_0x750a('0x14'),auth[_0x750a('0xb')](),controller[_0x750a('0x15')]);router['post'](_0x750a('0xf'),auth[_0x750a('0xb')](),controller[_0x750a('0x16')]);router[_0x750a('0x13')](_0x750a('0x11'),auth[_0x750a('0xb')](),controller[_0x750a('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x750a('0x18')]);router[_0x750a('0x19')](_0x750a('0x1a'),auth[_0x750a('0xb')](),controller[_0x750a('0x1b')]);router[_0x750a('0x19')](_0x750a('0xf'),auth[_0x750a('0xb')](),controller[_0x750a('0x1c')]);router[_0x750a('0x19')](_0x750a('0x11'),auth[_0x750a('0xb')](),controller[_0x750a('0x1d')]);module[_0x750a('0x1e')]=router;
\ No newline at end of file
+var _0xee14=['post','create','/:id/clone','clone','/:id/sections','addResources','put','destroy','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getSections','/:id/resources','getResources'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xee14,0x166));var _0x4ee1=function(_0x3dc269,_0x48a7d5){_0x3dc269=_0x3dc269-0x0;var _0x4e9df7=_0xee14[_0x3dc269];return _0x4e9df7;};'use strict';var multer=require(_0x4ee1('0x0'));var util=require('util');var path=require(_0x4ee1('0x1'));var timeout=require(_0x4ee1('0x2'));var express=require(_0x4ee1('0x3'));var router=express[_0x4ee1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4ee1('0x9')]);router[_0x4ee1('0xa')](_0x4ee1('0xb'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xa')](_0x4ee1('0xe'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0xa')]('/:id/sections',auth['isAuthenticated'](),controller[_0x4ee1('0x10')]);router[_0x4ee1('0xa')](_0x4ee1('0x11'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x12')]);router[_0x4ee1('0x13')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x14')]);router['post'](_0x4ee1('0x15'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x16')]);router['post'](_0x4ee1('0x17'),auth[_0x4ee1('0xc')](),controller['addSections']);router['post'](_0x4ee1('0x11'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x18')]);router[_0x4ee1('0x19')](_0x4ee1('0xe'),auth[_0x4ee1('0xc')](),controller['update']);router['delete']('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x1a')]);router[_0x4ee1('0x1b')](_0x4ee1('0x17'),auth[_0x4ee1('0xc')](),controller['removeSections']);router[_0x4ee1('0x1b')](_0x4ee1('0x11'),auth[_0x4ee1('0xc')](),controller['removeResources']);module[_0x4ee1('0x1c')]=router;
\ No newline at end of file
index 1e92561..53e1532 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d0=['setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0xf658fc,_0x15b0e3){var _0x243668=function(_0x528c9b){while(--_0x528c9b){_0xf658fc['push'](_0xf658fc['shift']());}};_0x243668(++_0x15b0e3);}(_0xc6d0,0x165));var _0x0c6d=function(_0x136cb6,_0x8d0a39){_0x136cb6=_0x136cb6-0x0;var _0x2e9540=_0xc6d0[_0x136cb6];return _0x2e9540;};'use strict';var Sequelize=require(_0x0c6d('0x0'));module[_0x0c6d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x0c6d('0x2')],'set':function(_0xf6331d){this[_0x0c6d('0x3')](_0x0c6d('0x4'),_0xf6331d?_0xf6331d[_0x0c6d('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x0c6d('0x4'))?this[_0x0c6d('0x6')](_0x0c6d('0x4'))[_0x0c6d('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0c6d('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x0c6d('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x0c6d('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x0c6d('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x0c6d('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0c6d('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x0c6d('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0c6d('0x8')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe349=['crudPermissions','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x121213,_0x4aef44){var _0x730a11=function(_0x39f7ec){while(--_0x39f7ec){_0x121213['push'](_0x121213['shift']());}};_0x730a11(++_0x4aef44);}(_0xe349,0x1b4));var _0x9e34=function(_0xd2e2ab,_0x2440cf){_0xd2e2ab=_0xd2e2ab-0x0;var _0x1703a2=_0xe349[_0xd2e2ab];return _0x1703a2;};'use strict';var Sequelize=require('sequelize');module[_0x9e34('0x0')]={'name':{'type':Sequelize[_0x9e34('0x1')],'allowNull':![],'unique':_0x9e34('0x2')},'crudPermissions':{'type':Sequelize[_0x9e34('0x1')],'set':function(_0x2d9de5){this[_0x9e34('0x3')](_0x9e34('0x4'),_0x2d9de5?_0x2d9de5['join'](''):[]);},'get':function(){return this[_0x9e34('0x5')]('crudPermissions')?this[_0x9e34('0x5')](_0x9e34('0x4'))[_0x9e34('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9e34('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]}};
\ No newline at end of file
index 04ba904..75f6c26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5c9=['bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','name','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','clone','createdAt','updatedAt','crudPermissions','sequelize','transaction','get','each','autoAssociation','UserProfileResource','omit','sectionId','userProfileId','Resources','describe','UserProfileSection','push','removeSections','ids','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xa5c9,0x143));var _0x9a5c=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xa5c9[_0x39cf70];return _0x580424;};'use strict';var emlformat=require(_0x9a5c('0x0'));var rimraf=require(_0x9a5c('0x1'));var zipdir=require(_0x9a5c('0x2'));var jsonpatch=require(_0x9a5c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9a5c('0x4'));var Mustache=require(_0x9a5c('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9a5c('0x6'));var ejs=require(_0x9a5c('0x7'));var fs=require('fs');var fs_extra=require(_0x9a5c('0x8'));var _=require(_0x9a5c('0x9'));var squel=require('squel');var crypto=require(_0x9a5c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9a5c('0xb'));var toCsv=require(_0x9a5c('0x6'));var querystring=require('querystring');var Papa=require(_0x9a5c('0xc'));var Redis=require(_0x9a5c('0xd'));var authService=require(_0x9a5c('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a5c('0xf'));var logger=require(_0x9a5c('0x10'))(_0x9a5c('0x11'));var utils=require(_0x9a5c('0x12'));var config=require(_0x9a5c('0x13'));var licenseUtil=require(_0x9a5c('0x14'));var db=require(_0x9a5c('0x15'))['db'];config[_0x9a5c('0x16')]=_[_0x9a5c('0x17')](config[_0x9a5c('0x16')],{'host':_0x9a5c('0x18'),'port':0x18eb});var socket=require(_0x9a5c('0x19'))(new Redis(config['redis']));require(_0x9a5c('0x1a'))[_0x9a5c('0x1b')](socket);function respondWithStatusCode(_0x2b1cef,_0x4fdcdc){_0x4fdcdc=_0x4fdcdc||0xcc;return function(_0x320725){if(_0x320725){return _0x2b1cef[_0x9a5c('0x1c')](_0x4fdcdc);}return _0x2b1cef['status'](_0x4fdcdc)[_0x9a5c('0x1d')]();};}function respondWithResult(_0x5ef98e,_0x350bd5){_0x350bd5=_0x350bd5||0xc8;return function(_0x507a12){if(_0x507a12){return _0x5ef98e[_0x9a5c('0x1e')](_0x350bd5)[_0x9a5c('0x1f')](_0x507a12);}};}function respondWithFilteredResult(_0x59e410,_0x2d509f){return function(_0x3f06b6){if(_0x3f06b6){var _0x39fbea=typeof _0x2d509f['offset']===_0x9a5c('0x20')&&typeof _0x2d509f[_0x9a5c('0x21')]===_0x9a5c('0x20');var _0x5e2bd3=_0x3f06b6[_0x9a5c('0x22')];var _0x1a7152=_0x39fbea?0x0:_0x2d509f['offset'];var _0x165c0f=_0x39fbea?_0x3f06b6[_0x9a5c('0x22')]:_0x2d509f[_0x9a5c('0x23')]+_0x2d509f['limit'];var _0xf121cd;if(_0x165c0f>=_0x5e2bd3){_0x165c0f=_0x5e2bd3;_0xf121cd=0xc8;}else{_0xf121cd=0xce;}_0x59e410[_0x9a5c('0x1e')](_0xf121cd);return _0x59e410['set'](_0x9a5c('0x24'),_0x1a7152+'-'+_0x165c0f+'/'+_0x5e2bd3)[_0x9a5c('0x1f')](_0x3f06b6);}return null;};}function patchUpdates(_0x5659b4){return function(_0x4b3d64){try{jsonpatch[_0x9a5c('0x25')](_0x4b3d64,_0x5659b4,!![]);}catch(_0x214b65){return BPromise['reject'](_0x214b65);}return _0x4b3d64[_0x9a5c('0x26')]();};}function saveUpdates(_0x3f7d13,_0x163985){return function(_0x21413e){if(_0x21413e){return _0x21413e[_0x9a5c('0x27')](_0x3f7d13)[_0x9a5c('0x28')](function(_0x47a13a){return _0x47a13a;});}return null;};}function removeEntity(_0x538e65,_0x34c636){return function(_0x263a19){if(_0x263a19){return _0x263a19[_0x9a5c('0x29')]()[_0x9a5c('0x28')](function(){_0x538e65['status'](0xcc)[_0x9a5c('0x1d')]();});}};}function handleEntityNotFound(_0x24789d,_0x3b5d9c){return function(_0x4119f7){if(!_0x4119f7){_0x24789d[_0x9a5c('0x1c')](0x194);}return _0x4119f7;};}function handleError(_0x442f85,_0xf88f6b){_0xf88f6b=_0xf88f6b||0x1f4;return function(_0x4146c9){logger[_0x9a5c('0x2a')](_0x4146c9['stack']);if(_0x4146c9[_0x9a5c('0x2b')]){delete _0x4146c9['name'];}_0x442f85['status'](_0xf88f6b)['send'](_0x4146c9);};}exports[_0x9a5c('0x2c')]=function(_0x190943,_0x214953){var _0xb966ad={},_0x2f9161={},_0x35d472={'count':0x0,'rows':[]};var _0x56dcce=_[_0x9a5c('0x2d')](db[_0x9a5c('0x2e')][_0x9a5c('0x2f')],function(_0x539c07){return{'name':_0x539c07[_0x9a5c('0x30')],'type':_0x539c07[_0x9a5c('0x31')][_0x9a5c('0x32')]};});_0x2f9161[_0x9a5c('0x33')]=_['map'](_0x56dcce,_0x9a5c('0x2b'));_0x2f9161['query']=_[_0x9a5c('0x34')](_0x190943['query']);_0x2f9161[_0x9a5c('0x35')]=_[_0x9a5c('0x36')](_0x2f9161[_0x9a5c('0x33')],_0x2f9161[_0x9a5c('0x37')]);_0xb966ad[_0x9a5c('0x38')]=_[_0x9a5c('0x36')](_0x2f9161['model'],qs[_0x9a5c('0x39')](_0x190943[_0x9a5c('0x37')][_0x9a5c('0x39')]));_0xb966ad[_0x9a5c('0x38')]=_0xb966ad['attributes'][_0x9a5c('0x3a')]?_0xb966ad[_0x9a5c('0x38')]:_0x2f9161['model'];if(!_0x190943[_0x9a5c('0x37')][_0x9a5c('0x3b')]('nolimit')){_0xb966ad[_0x9a5c('0x21')]=qs['limit'](_0x190943[_0x9a5c('0x37')][_0x9a5c('0x21')]);_0xb966ad[_0x9a5c('0x23')]=qs[_0x9a5c('0x23')](_0x190943[_0x9a5c('0x37')]['offset']);}_0xb966ad['order']=qs['sort'](_0x190943['query'][_0x9a5c('0x3c')]);_0xb966ad[_0x9a5c('0x3d')]=qs[_0x9a5c('0x35')](_[_0x9a5c('0x3e')](_0x190943[_0x9a5c('0x37')],_0x2f9161[_0x9a5c('0x35')]),_0x56dcce);if(_0x190943[_0x9a5c('0x37')][_0x9a5c('0x3f')]){_0xb966ad[_0x9a5c('0x3d')]=_[_0x9a5c('0x40')](_0xb966ad[_0x9a5c('0x3d')],{'$or':_['map'](_0x56dcce,function(_0x23d852){if(_0x23d852[_0x9a5c('0x31')]!==_0x9a5c('0x41')){var _0x1f9e8d={};_0x1f9e8d[_0x23d852['name']]={'$like':'%'+_0x190943[_0x9a5c('0x37')][_0x9a5c('0x3f')]+'%'};return _0x1f9e8d;}})});}_0xb966ad=_['merge']({},_0xb966ad,_0x190943[_0x9a5c('0x42')]);var _0x185061={'where':_0xb966ad[_0x9a5c('0x3d')]};return db[_0x9a5c('0x2e')][_0x9a5c('0x22')](_0x185061)[_0x9a5c('0x28')](function(_0xd61373){_0x35d472[_0x9a5c('0x22')]=_0xd61373;if(_0x190943[_0x9a5c('0x37')][_0x9a5c('0x43')]){_0xb966ad['include']=[{'all':!![]}];}return db['UserProfile'][_0x9a5c('0x44')](_0xb966ad);})[_0x9a5c('0x28')](function(_0x4097a6){_0x35d472[_0x9a5c('0x45')]=_0x4097a6;return _0x35d472;})[_0x9a5c('0x28')](respondWithFilteredResult(_0x214953,_0xb966ad))[_0x9a5c('0x46')](handleError(_0x214953,null));};exports[_0x9a5c('0x47')]=function(_0x1018f2,_0x28775c){var _0x38c031={'raw':![],'where':{'id':_0x1018f2[_0x9a5c('0x48')]['id']}},_0x718265={};_0x718265['model']=_['keys'](db[_0x9a5c('0x2e')][_0x9a5c('0x2f')]);_0x718265['query']=_[_0x9a5c('0x34')](_0x1018f2[_0x9a5c('0x37')]);_0x718265['filters']=_['intersection'](_0x718265['model'],_0x718265[_0x9a5c('0x37')]);_0x38c031['attributes']=_[_0x9a5c('0x36')](_0x718265[_0x9a5c('0x33')],qs['fields'](_0x1018f2[_0x9a5c('0x37')][_0x9a5c('0x39')]));_0x38c031['attributes']=_0x38c031[_0x9a5c('0x38')][_0x9a5c('0x3a')]?_0x38c031['attributes']:_0x718265['model'];if(_0x1018f2[_0x9a5c('0x37')][_0x9a5c('0x43')]){_0x38c031[_0x9a5c('0x49')]=[{'all':!![]}];}_0x38c031=_['merge']({},_0x38c031,_0x1018f2[_0x9a5c('0x42')]);return db[_0x9a5c('0x2e')][_0x9a5c('0x4a')](_0x38c031)[_0x9a5c('0x28')](handleEntityNotFound(_0x28775c,null))['then'](respondWithResult(_0x28775c,null))[_0x9a5c('0x46')](handleError(_0x28775c,null));};exports[_0x9a5c('0x4b')]=function(_0x5880ab,_0x28a097){return db[_0x9a5c('0x2e')][_0x9a5c('0x4b')](_0x5880ab[_0x9a5c('0x4c')],{})[_0x9a5c('0x28')](respondWithResult(_0x28a097,0xc9))[_0x9a5c('0x46')](handleError(_0x28a097,null));};exports[_0x9a5c('0x4d')]=function(_0x5e0297,_0x2782c4){var _0x57f53a={'where':{'id':_0x5e0297['params']['id']}},_0x199ee1={};_0x199ee1[_0x9a5c('0x33')]=_[_0x9a5c('0x34')](db['UserProfile'][_0x9a5c('0x2f')]);_0x57f53a['attributes']=_['intersection'](_0x199ee1[_0x9a5c('0x33')],qs[_0x9a5c('0x39')](_0x5e0297[_0x9a5c('0x37')]['fields']));_0x57f53a[_0x9a5c('0x38')]=_0x57f53a[_0x9a5c('0x38')][_0x9a5c('0x3a')]?_0x57f53a[_0x9a5c('0x38')]:_0x199ee1[_0x9a5c('0x33')];if(_0x5e0297[_0x9a5c('0x37')][_0x9a5c('0x43')]){_0x57f53a[_0x9a5c('0x49')]=[{'all':!![]}];}_0x57f53a=_[_0x9a5c('0x40')]({},_0x57f53a,_0x5e0297[_0x9a5c('0x42')]);return db['UserProfile']['find'](_0x57f53a)[_0x9a5c('0x28')](handleEntityNotFound(_0x2782c4,null))[_0x9a5c('0x28')](function(_0x29a024){if(_0x29a024){var _0x783c4f=_0x29a024['get']({'plain':!![]});_0x783c4f=qs['omit'](_0x783c4f,['id',_0x9a5c('0x4e'),_0x9a5c('0x4f'),_0x9a5c('0x50')]);_0x5e0297[_0x9a5c('0x4c')]=_['omit'](_0x5e0297[_0x9a5c('0x4c')],['id',_0x9a5c('0x4e'),'updatedAt']);return db[_0x9a5c('0x51')][_0x9a5c('0x52')](function(_0x472f20){return db[_0x9a5c('0x2e')]['create'](_['merge'](_0x783c4f,_0x5e0297['body']),{'include':_0x5e0297[_0x9a5c('0x37')][_0x9a5c('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x472f20})['then'](function(_0x40b041){var _0x19024a=_0x40b041[_0x9a5c('0x53')]({'plain':!![]});return db['UserProfileSection'][_0x9a5c('0x44')]({'where':{'userProfileId':_0x5e0297[_0x9a5c('0x48')]['id']},'raw':!![]})[_0x9a5c('0x28')](function(_0x2170ac){if(_0x2170ac){return BPromise[_0x9a5c('0x54')](_0x2170ac,function(_0x1f9873){return new BPromise(function(_0x522ccc,_0x1fd30b){if(_0x1f9873[_0x9a5c('0x55')]===null||_0x1f9873[_0x9a5c('0x55')]===0x1)_0x522ccc(null);return db[_0x9a5c('0x56')][_0x9a5c('0x44')]({'where':{'sectionId':_0x1f9873['id']},'raw':!![]})[_0x9a5c('0x28')](function(_0x54e7ec){var _0x757886=_[_0x9a5c('0x2d')](_0x54e7ec,function(_0x2c1990){return qs[_0x9a5c('0x57')](_0x2c1990,['id','createdAt',_0x9a5c('0x4f'),_0x9a5c('0x58')]);});_0x522ccc(_0x757886);})[_0x9a5c('0x46')](function(_0x1dce3a){_0x1fd30b(_0x1dce3a);});})[_0x9a5c('0x28')](function(_0x5d9cd2){var _0x80e8c4=qs[_0x9a5c('0x57')](_0x1f9873,['id',_0x9a5c('0x4e'),_0x9a5c('0x4f')]);_0x80e8c4[_0x9a5c('0x59')]=_0x19024a['id'];if(_0x5d9cd2)_0x80e8c4[_0x9a5c('0x5a')]=_0x5d9cd2;return _0x80e8c4;})[_0x9a5c('0x28')](function(_0x1b02aa){return db['UserProfileSection'][_0x9a5c('0x4b')](_0x1b02aa,{'include':[{'model':db[_0x9a5c('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x472f20});});})[_0x9a5c('0x28')](function(){return _0x19024a;});}});});});}})['then'](respondWithResult(_0x2782c4,0xc9))[_0x9a5c('0x46')](handleError(_0x2782c4,null));};exports['update']=function(_0x55e123,_0x4514d0){if(_0x55e123['body']['id']){delete _0x55e123[_0x9a5c('0x4c')]['id'];}return db[_0x9a5c('0x2e')][_0x9a5c('0x4a')]({'where':{'id':_0x55e123[_0x9a5c('0x48')]['id']}})[_0x9a5c('0x28')](handleEntityNotFound(_0x4514d0,null))[_0x9a5c('0x28')](saveUpdates(_0x55e123[_0x9a5c('0x4c')],null))[_0x9a5c('0x28')](respondWithResult(_0x4514d0,null))[_0x9a5c('0x46')](handleError(_0x4514d0,null));};exports[_0x9a5c('0x29')]=function(_0x1dee94,_0x5af981){return db['UserProfile'][_0x9a5c('0x4a')]({'where':{'id':_0x1dee94[_0x9a5c('0x48')]['id']}})[_0x9a5c('0x28')](handleEntityNotFound(_0x5af981,null))[_0x9a5c('0x28')](removeEntity(_0x5af981,null))[_0x9a5c('0x46')](handleError(_0x5af981,null));};exports[_0x9a5c('0x5b')]=function(_0x3f6cf9,_0x339b53){return db[_0x9a5c('0x2e')][_0x9a5c('0x5b')]()[_0x9a5c('0x28')](respondWithResult(_0x339b53,null))[_0x9a5c('0x46')](handleError(_0x339b53,null));};exports['addSections']=function(_0x4619c8,_0x30d517){var _0x49b782=_0x4619c8[_0x9a5c('0x4c')];return db['UserProfile'][_0x9a5c('0x4a')]({'where':{'id':_0x4619c8[_0x9a5c('0x48')]['id']}})[_0x9a5c('0x28')](handleEntityNotFound(_0x30d517,null))[_0x9a5c('0x28')](function(_0x4433f7){if(_0x4433f7){return db['sequelize'][_0x9a5c('0x52')](function(_0x203b2f){return db[_0x9a5c('0x5c')][_0x9a5c('0x29')]({'where':{'userProfileId':_0x4619c8[_0x9a5c('0x48')]['id'],'sectionId':_[_0x9a5c('0x2d')](_0x49b782,function(_0x49fcc8){return _0x49fcc8[_0x9a5c('0x58')];})},'transaction':_0x203b2f})[_0x9a5c('0x28')](function(){var _0x1b26fe=_['map'](_0x49b782,function(_0x255dc3){_0x255dc3['userProfileId']=_0x4619c8[_0x9a5c('0x48')]['id'];return _0x255dc3;});var _0x56eae2=[];return BPromise[_0x9a5c('0x54')](_0x1b26fe,function(_0x508ef5){return db[_0x9a5c('0x5c')][_0x9a5c('0x4b')](_0x508ef5,{'include':[{'model':db['UserProfileResource'],'as':_0x9a5c('0x5a')}],'raw':!![],'transaction':_0x203b2f})[_0x9a5c('0x28')](function(_0x4b7cd6){_0x56eae2[_0x9a5c('0x5d')](_0x4b7cd6[_0x9a5c('0x53')]({'plain':!![]}));});})['then'](function(){return _0x56eae2;});});});}})[_0x9a5c('0x28')](function(_0x49a949){return _0x49a949;})[_0x9a5c('0x28')](respondWithResult(_0x30d517,null))[_0x9a5c('0x46')](handleError(_0x30d517,null));};exports[_0x9a5c('0x5e')]=function(_0xd6c540,_0x35f68c){var _0x2d8452;return db[_0x9a5c('0x2e')][_0x9a5c('0x4a')]({'where':{'id':_0xd6c540[_0x9a5c('0x48')]['id']},'attributes':['id',_0x9a5c('0x2b')]})['then'](handleEntityNotFound(_0x35f68c,null))[_0x9a5c('0x28')](function(_0x1b5e41){if(_0x1b5e41){_0x2d8452=_0x1b5e41;return db[_0x9a5c('0x5c')][_0x9a5c('0x29')]({'where':{'userProfileId':_0xd6c540[_0x9a5c('0x48')]['id'],'sectionId':_0xd6c540[_0x9a5c('0x37')][_0x9a5c('0x5f')]}});}})[_0x9a5c('0x28')](function(){return _0x2d8452;})[_0x9a5c('0x28')](respondWithStatusCode(_0x35f68c,null))['catch'](handleError(_0x35f68c,null));};exports['getSections']=function(_0xeabe02,_0x487ee3){var _0x49cce7=[];var _0x40f20c=[];return db[_0x9a5c('0x5c')][_0x9a5c('0x44')]({'where':{'userProfileId':_0xeabe02[_0x9a5c('0x48')]['id']},'raw':!![]})[_0x9a5c('0x28')](function(_0x3ad1b1){_0x49cce7=_[_0x9a5c('0x3f')](_0x3ad1b1,function(_0x210368){return _0x210368[_0x9a5c('0x60')]===0x1||_[_0x9a5c('0x61')]([0x3eb,0x709],_0x210368['sectionId']);});if(!_['isEmpty'](_0x49cce7)){return _[_0x9a5c('0x2d')](_0x49cce7,function(_0x10dfa3){return _0x10dfa3[_0x9a5c('0x58')];});}else{return;}})['then'](function(_0xbbdd16){if(_0xbbdd16)_0x40f20c=_0xbbdd16;if(_[_0x9a5c('0x61')](_0x40f20c,0x64)){var _0x4aeeb3=_[_0x9a5c('0x4a')](_0x49cce7,{'sectionId':0x64});return hasDefaultDashboard(_0x4aeeb3)['then'](function(_0x2f8897){return _[_0x9a5c('0x2d')](_0x49cce7,function(_0x4aba18){if(_0x4aba18[_0x9a5c('0x58')]===0x64){_0x4aba18[_0x9a5c('0x62')]=_0x2f8897;}return _0x4aba18;});});}else{return;}})[_0x9a5c('0x28')](function(_0x262496){if(_0x262496)_0x49cce7=_0x262496;if(_['includes'](_0x40f20c,0x3eb)){var _0x21f783=_[_0x9a5c('0x4a')](_0x49cce7,{'sectionId':0x3eb});return getCustomDashboards(_0x21f783)[_0x9a5c('0x28')](function(_0x4a0f9d){return _['map'](_0x49cce7,function(_0x2a849f){if(_0x21f783['enabled']){if(_0x2a849f['sectionId']===0x3eb){_0x2a849f['subsections']=_0x4a0f9d;}}else{if(_0x2a849f[_0x9a5c('0x58')]===0x64){_0x2a849f[_0x9a5c('0x62')]=_0x4a0f9d;}}return _0x2a849f;});});}else{return;}})[_0x9a5c('0x28')](function(_0x1b89f6){if(_0x1b89f6)_0x49cce7=_0x1b89f6;if(_[_0x9a5c('0x61')](_0x40f20c,0x709)){var _0x3d51e3=_[_0x9a5c('0x4a')](_0x49cce7,{'sectionId':0x709});return getPlugins(_0x3d51e3)[_0x9a5c('0x28')](function(_0x199917){if(_0x3d51e3[_0x9a5c('0x60')]){return _['map'](_0x49cce7,function(_0xa6f2){if(_0xa6f2[_0x9a5c('0x58')]===0x709){_0xa6f2[_0x9a5c('0x62')]=_0x199917;}return _0xa6f2;});}else{var _0x5224af={'sectionId':0x76c,'enabled':0x1,'subsections':_0x199917};var _0x56b648=_[_0x9a5c('0x2d')](_0x49cce7);_0x56b648[_0x9a5c('0x5d')](_0x5224af);return _0x56b648;}});}else{return;}})[_0x9a5c('0x28')](function(_0x3eaa00){if(_0x3eaa00)_0x49cce7=_0x3eaa00;return _[_0x9a5c('0x3f')](_0x49cce7,[_0x9a5c('0x60'),0x1]);})[_0x9a5c('0x28')](respondWithResult(_0x487ee3,null))[_0x9a5c('0x46')](handleError(_0x487ee3,null));};function hasDefaultDashboard(_0x1f5737){var _0x511e77=[0x65];return new BPromise(function(_0x38175a,_0x97f9f){try{if(_0x1f5737['autoAssociation']){_0x38175a(_0x511e77);}else{return db[_0x9a5c('0x56')][_0x9a5c('0x63')]({'where':{'sectionId':_0x1f5737['id']},'raw':!![]})[_0x9a5c('0x28')](function(_0x56b3e5){_0x56b3e5?_0x38175a(_0x511e77):_0x38175a();});}}catch(_0x47da45){_0x97f9f(_0x47da45);}});}function getCustomDashboards(_0x321590){var _0x5c7993=[];return new BPromise(function(_0x272501,_0x1dba44){try{if(_0x321590['autoAssociation']){return db[_0x9a5c('0x64')][_0x9a5c('0x44')]({'raw':!![]})[_0x9a5c('0x28')](function(_0x215fab){_0x215fab[_0x9a5c('0x65')](function(_0x36b74f){_0x5c7993['push'](_0x36b74f['id']+0x1869f);});_0x272501(_0x5c7993);});}else{return db['UserProfileResource'][_0x9a5c('0x44')]({'where':{'sectionId':_0x321590['id']},'raw':!![]})[_0x9a5c('0x28')](function(_0x537a96){_0x537a96[_0x9a5c('0x65')](function(_0x2ff2d0){_0x5c7993[_0x9a5c('0x5d')](_0x2ff2d0[_0x9a5c('0x66')]+0x1869f);});_0x272501(_0x5c7993);});}}catch(_0x1049e9){_0x1dba44(_0x1049e9);}});}function getPlugins(_0x8c5ebc){var _0x4a756d=[];return new BPromise(function(_0x4e903a,_0x4ba7ed){try{if(_0x8c5ebc[_0x9a5c('0x55')]){return db['Plugin'][_0x9a5c('0x44')]({'raw':!![]})[_0x9a5c('0x28')](function(_0x1555b3){_0x1555b3[_0x9a5c('0x65')](function(_0x2813f7){_0x4a756d[_0x9a5c('0x5d')](_0x2813f7['id']+0x15b38);});_0x4e903a(_0x4a756d);});}else{return db[_0x9a5c('0x56')][_0x9a5c('0x44')]({'where':{'sectionId':_0x8c5ebc['id']},'raw':!![]})[_0x9a5c('0x28')](function(_0x8f1bfc){_0x8f1bfc[_0x9a5c('0x65')](function(_0x381690){_0x4a756d[_0x9a5c('0x5d')](_0x381690['resourceId']+0x15b38);});_0x4e903a(_0x4a756d);});}}catch(_0x1776b3){_0x4ba7ed(_0x1776b3);}});}exports['addResources']=function(_0x44dd06,_0x5e1221){return db['UserProfile'][_0x9a5c('0x4a')]({'where':{'id':_0x44dd06[_0x9a5c('0x48')]['id']}})[_0x9a5c('0x28')](handleEntityNotFound(_0x5e1221,null))[_0x9a5c('0x28')](function(_0x35752f){if(_0x35752f){return db[_0x9a5c('0x51')][_0x9a5c('0x52')](function(_0x253e15){return db[_0x9a5c('0x5c')][_0x9a5c('0x44')]({'where':{'userProfileId':_0x44dd06[_0x9a5c('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x9a5c('0x28')](function(_0x7fdc21){if(_0x7fdc21){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x44dd06[_0x9a5c('0x48')]['id'],'id':_[_0x9a5c('0x2d')](_0x7fdc21,function(_0x21aa15){return _0x21aa15['id'];})},'transaction':_0x253e15});}})[_0x9a5c('0x28')](function(_0x5372b6){var _0x10bd98=_[_0x9a5c('0x2d')](_0x44dd06[_0x9a5c('0x4c')],function(_0x23eee1){_0x23eee1['userProfileId']=_0x44dd06[_0x9a5c('0x48')]['id'];return _0x23eee1;});return db[_0x9a5c('0x5c')][_0x9a5c('0x67')](_0x10bd98,{'raw':!![],'transaction':_0x253e15});})[_0x9a5c('0x28')](function(_0x404257){var _0x1dcbe2=_['filter'](_[_0x9a5c('0x2d')](_0x404257,function(_0x441607){return _0x441607[_0x9a5c('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0x1dcbe2){return db[_0x9a5c('0x5c')][_0x9a5c('0x44')]({'where':{'userProfileId':_0x44dd06[_0x9a5c('0x48')]['id'],'sectionId':_[_0x9a5c('0x2d')](_0x1dcbe2,function(_0x1d0d18){return _0x1d0d18[_0x9a5c('0x58')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x9a5c('0x28')](function(_0x22624c){var _0xfa7f52=_[_0x9a5c('0x2d')](_0x44dd06[_0x9a5c('0x4c')],function(_0x56616c){_0x56616c['userProfileId']=_0x44dd06[_0x9a5c('0x48')]['id'];return _0x56616c;});return db[_0x9a5c('0x56')]['bulkCreate'](_0xfa7f52,{'raw':!![],'transaction':_0x253e15});});}})[_0x9a5c('0x46')](handleError(_0x5e1221,null));});}})[_0x9a5c('0x28')](function(_0x463cd6){var _0x32925d=_['map'](_0x463cd6,function(_0x276e3e){return _0x276e3e[_0x9a5c('0x53')]({'plain':!![]});});})['then'](respondWithResult(_0x5e1221,null))[_0x9a5c('0x46')](handleError(_0x5e1221,null));};exports[_0x9a5c('0x68')]=function(_0x2a43c0,_0x59303c,_0x34c541){return db[_0x9a5c('0x2e')][_0x9a5c('0x4a')]({'where':{'id':_0x2a43c0[_0x9a5c('0x48')]['id']}})['then'](handleEntityNotFound(_0x59303c,null))['then'](function(_0x1064b0){if(_0x1064b0){return _0x1064b0[_0x9a5c('0x68')](_0x2a43c0[_0x9a5c('0x37')]['ids']);}})[_0x9a5c('0x28')](respondWithStatusCode(_0x59303c,null))[_0x9a5c('0x46')](handleError(_0x59303c,null));};exports[_0x9a5c('0x69')]=function(_0x2fbd89,_0x49d864){var _0x4720f0={};if(!_0x2fbd89[_0x9a5c('0x37')][_0x9a5c('0x6a')])throw new Error(_0x9a5c('0x6b'));if(!_0x2fbd89[_0x9a5c('0x37')]['hasOwnProperty']('nolimit')){_0x4720f0[_0x9a5c('0x21')]=qs['limit'](_0x2fbd89[_0x9a5c('0x37')][_0x9a5c('0x21')]);_0x4720f0[_0x9a5c('0x23')]=qs[_0x9a5c('0x23')](_0x2fbd89[_0x9a5c('0x37')][_0x9a5c('0x23')]);}return db['UserProfile'][_0x9a5c('0x4a')]({'where':{'id':_0x2fbd89[_0x9a5c('0x48')]['id']}})[_0x9a5c('0x28')](function(_0x3fa7c6){if(!_0x3fa7c6)throw new Error(_0x9a5c('0x6c')+_0x2fbd89[_0x9a5c('0x48')]['id']);return db[_0x9a5c('0x2e')]['getResources'](_0x2fbd89);})[_0x9a5c('0x28')](respondWithFilteredResult(_0x49d864,_0x4720f0))[_0x9a5c('0x46')](handleError(_0x49d864,null));};
\ No newline at end of file
+var _0xf954=['params','create','body','clone','find','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','destroy','describe','sectionId','push','removeSections','ids','enabled','includes','isEmpty','subsections','findOne','Dashboard','resourceId','Plugin','forEach','addResources','bulkCreate','getResources','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x26448d,_0x3230af){var _0x37cc01=function(_0x4ca3d0){while(--_0x4ca3d0){_0x26448d['push'](_0x26448d['shift']());}};_0x37cc01(++_0x3230af);}(_0xf954,0x10e));var _0x4f95=function(_0x289531,_0x1180e5){_0x289531=_0x289531-0x0;var _0x2e7019=_0xf954[_0x289531];return _0x2e7019;};'use strict';var emlformat=require(_0x4f95('0x0'));var rimraf=require(_0x4f95('0x1'));var zipdir=require(_0x4f95('0x2'));var jsonpatch=require(_0x4f95('0x3'));var rp=require(_0x4f95('0x4'));var moment=require(_0x4f95('0x5'));var BPromise=require(_0x4f95('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f95('0x7'));var sox=require(_0x4f95('0x8'));var csv=require(_0x4f95('0x9'));var ejs=require(_0x4f95('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f95('0xb'));var squel=require(_0x4f95('0xc'));var crypto=require(_0x4f95('0xd'));var jsforce=require(_0x4f95('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4f95('0xf'));var Papa=require(_0x4f95('0x10'));var Redis=require(_0x4f95('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f95('0x12'));var logger=require(_0x4f95('0x13'))(_0x4f95('0x14'));var utils=require(_0x4f95('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4f95('0x16'));var db=require(_0x4f95('0x17'))['db'];config[_0x4f95('0x18')]=_[_0x4f95('0x19')](config[_0x4f95('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f95('0x1a'))(new Redis(config[_0x4f95('0x18')]));require(_0x4f95('0x1b'))[_0x4f95('0x1c')](socket);function respondWithStatusCode(_0x56d995,_0x397de4){_0x397de4=_0x397de4||0xcc;return function(_0x315a9f){if(_0x315a9f){return _0x56d995[_0x4f95('0x1d')](_0x397de4);}return _0x56d995['status'](_0x397de4)[_0x4f95('0x1e')]();};}function respondWithResult(_0x451dc2,_0x1d9bd1){_0x1d9bd1=_0x1d9bd1||0xc8;return function(_0x12d95e){if(_0x12d95e){return _0x451dc2[_0x4f95('0x1f')](_0x1d9bd1)[_0x4f95('0x20')](_0x12d95e);}};}function respondWithFilteredResult(_0x2aa444,_0x25f9ca){return function(_0x235c03){if(_0x235c03){var _0x3a3508=typeof _0x25f9ca['offset']===_0x4f95('0x21')&&typeof _0x25f9ca[_0x4f95('0x22')]===_0x4f95('0x21');var _0x2d2595=_0x235c03[_0x4f95('0x23')];var _0x351427=_0x3a3508?0x0:_0x25f9ca[_0x4f95('0x24')];var _0x3586c0=_0x3a3508?_0x235c03[_0x4f95('0x23')]:_0x25f9ca['offset']+_0x25f9ca[_0x4f95('0x22')];var _0xf70461;if(_0x3586c0>=_0x2d2595){_0x3586c0=_0x2d2595;_0xf70461=0xc8;}else{_0xf70461=0xce;}_0x2aa444[_0x4f95('0x1f')](_0xf70461);return _0x2aa444[_0x4f95('0x25')](_0x4f95('0x26'),_0x351427+'-'+_0x3586c0+'/'+_0x2d2595)[_0x4f95('0x20')](_0x235c03);}return null;};}function patchUpdates(_0xe49db2){return function(_0x2e3872){try{jsonpatch[_0x4f95('0x27')](_0x2e3872,_0xe49db2,!![]);}catch(_0x10cab5){return BPromise[_0x4f95('0x28')](_0x10cab5);}return _0x2e3872[_0x4f95('0x29')]();};}function saveUpdates(_0x1e675c,_0x4f9e55){return function(_0x11992a){if(_0x11992a){return _0x11992a[_0x4f95('0x2a')](_0x1e675c)[_0x4f95('0x2b')](function(_0x34a4de){return _0x34a4de;});}return null;};}function removeEntity(_0x3875fe,_0x14ba9f){return function(_0x303f65){if(_0x303f65){return _0x303f65['destroy']()[_0x4f95('0x2b')](function(){_0x3875fe['status'](0xcc)[_0x4f95('0x1e')]();});}};}function handleEntityNotFound(_0x2036ee,_0x224a0a){return function(_0x1079fd){if(!_0x1079fd){_0x2036ee[_0x4f95('0x1d')](0x194);}return _0x1079fd;};}function handleError(_0x4993da,_0x2cb1bb){_0x2cb1bb=_0x2cb1bb||0x1f4;return function(_0x2dc278){logger[_0x4f95('0x2c')](_0x2dc278[_0x4f95('0x2d')]);if(_0x2dc278[_0x4f95('0x2e')]){delete _0x2dc278[_0x4f95('0x2e')];}_0x4993da[_0x4f95('0x1f')](_0x2cb1bb)[_0x4f95('0x2f')](_0x2dc278);};}exports['index']=function(_0x5d9c7a,_0x5ea525){var _0x4cb67d={},_0x5515b4={},_0x40d115={'count':0x0,'rows':[]};var _0xc3837a=_[_0x4f95('0x30')](db[_0x4f95('0x31')][_0x4f95('0x32')],function(_0x3bff09){return{'name':_0x3bff09[_0x4f95('0x33')],'type':_0x3bff09[_0x4f95('0x34')]['key']};});_0x5515b4[_0x4f95('0x35')]=_[_0x4f95('0x30')](_0xc3837a,_0x4f95('0x2e'));_0x5515b4[_0x4f95('0x36')]=_[_0x4f95('0x37')](_0x5d9c7a[_0x4f95('0x36')]);_0x5515b4[_0x4f95('0x38')]=_[_0x4f95('0x39')](_0x5515b4['model'],_0x5515b4[_0x4f95('0x36')]);_0x4cb67d[_0x4f95('0x3a')]=_[_0x4f95('0x39')](_0x5515b4[_0x4f95('0x35')],qs[_0x4f95('0x3b')](_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x3b')]));_0x4cb67d[_0x4f95('0x3a')]=_0x4cb67d[_0x4f95('0x3a')][_0x4f95('0x3c')]?_0x4cb67d[_0x4f95('0x3a')]:_0x5515b4[_0x4f95('0x35')];if(!_0x5d9c7a[_0x4f95('0x36')]['hasOwnProperty']('nolimit')){_0x4cb67d[_0x4f95('0x22')]=qs[_0x4f95('0x22')](_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x22')]);_0x4cb67d[_0x4f95('0x24')]=qs['offset'](_0x5d9c7a['query'][_0x4f95('0x24')]);}_0x4cb67d[_0x4f95('0x3d')]=qs[_0x4f95('0x3e')](_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x3e')]);_0x4cb67d[_0x4f95('0x3f')]=qs['filters'](_[_0x4f95('0x40')](_0x5d9c7a[_0x4f95('0x36')],_0x5515b4[_0x4f95('0x38')]),_0xc3837a);if(_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x41')]){_0x4cb67d[_0x4f95('0x3f')]=_[_0x4f95('0x42')](_0x4cb67d['where'],{'$or':_['map'](_0xc3837a,function(_0x5af4ab){if(_0x5af4ab['type']!==_0x4f95('0x43')){var _0x3a1650={};_0x3a1650[_0x5af4ab['name']]={'$like':'%'+_0x5d9c7a['query']['filter']+'%'};return _0x3a1650;}})});}_0x4cb67d=_[_0x4f95('0x42')]({},_0x4cb67d,_0x5d9c7a[_0x4f95('0x44')]);var _0x2f79a8={'where':_0x4cb67d[_0x4f95('0x3f')]};return db[_0x4f95('0x31')]['count'](_0x2f79a8)[_0x4f95('0x2b')](function(_0x2af149){_0x40d115[_0x4f95('0x23')]=_0x2af149;if(_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x45')]){_0x4cb67d[_0x4f95('0x46')]=[{'all':!![]}];}return db[_0x4f95('0x31')][_0x4f95('0x47')](_0x4cb67d);})[_0x4f95('0x2b')](function(_0x572606){_0x40d115[_0x4f95('0x48')]=_0x572606;return _0x40d115;})[_0x4f95('0x2b')](respondWithFilteredResult(_0x5ea525,_0x4cb67d))[_0x4f95('0x49')](handleError(_0x5ea525,null));};exports[_0x4f95('0x4a')]=function(_0x3510c9,_0x56a578){var _0x5541c7={'raw':![],'where':{'id':_0x3510c9[_0x4f95('0x4b')]['id']}},_0x55ff83={};_0x55ff83[_0x4f95('0x35')]=_[_0x4f95('0x37')](db['UserProfile']['rawAttributes']);_0x55ff83[_0x4f95('0x36')]=_[_0x4f95('0x37')](_0x3510c9[_0x4f95('0x36')]);_0x55ff83['filters']=_[_0x4f95('0x39')](_0x55ff83[_0x4f95('0x35')],_0x55ff83['query']);_0x5541c7['attributes']=_[_0x4f95('0x39')](_0x55ff83[_0x4f95('0x35')],qs[_0x4f95('0x3b')](_0x3510c9[_0x4f95('0x36')][_0x4f95('0x3b')]));_0x5541c7[_0x4f95('0x3a')]=_0x5541c7[_0x4f95('0x3a')][_0x4f95('0x3c')]?_0x5541c7[_0x4f95('0x3a')]:_0x55ff83[_0x4f95('0x35')];if(_0x3510c9[_0x4f95('0x36')]['includeAll']){_0x5541c7[_0x4f95('0x46')]=[{'all':!![]}];}_0x5541c7=_[_0x4f95('0x42')]({},_0x5541c7,_0x3510c9[_0x4f95('0x44')]);return db[_0x4f95('0x31')]['find'](_0x5541c7)[_0x4f95('0x2b')](handleEntityNotFound(_0x56a578,null))[_0x4f95('0x2b')](respondWithResult(_0x56a578,null))[_0x4f95('0x49')](handleError(_0x56a578,null));};exports[_0x4f95('0x4c')]=function(_0x3b66b8,_0x43c97b){return db['UserProfile'][_0x4f95('0x4c')](_0x3b66b8[_0x4f95('0x4d')],{})[_0x4f95('0x2b')](respondWithResult(_0x43c97b,0xc9))[_0x4f95('0x49')](handleError(_0x43c97b,null));};exports[_0x4f95('0x4e')]=function(_0x3c57ab,_0x3ea1bf){var _0x59a820={'where':{'id':_0x3c57ab['params']['id']}},_0x107c7a={};_0x107c7a[_0x4f95('0x35')]=_[_0x4f95('0x37')](db[_0x4f95('0x31')]['rawAttributes']);_0x59a820['attributes']=_[_0x4f95('0x39')](_0x107c7a['model'],qs[_0x4f95('0x3b')](_0x3c57ab[_0x4f95('0x36')][_0x4f95('0x3b')]));_0x59a820[_0x4f95('0x3a')]=_0x59a820[_0x4f95('0x3a')]['length']?_0x59a820[_0x4f95('0x3a')]:_0x107c7a['model'];if(_0x3c57ab[_0x4f95('0x36')][_0x4f95('0x45')]){_0x59a820[_0x4f95('0x46')]=[{'all':!![]}];}_0x59a820=_[_0x4f95('0x42')]({},_0x59a820,_0x3c57ab[_0x4f95('0x44')]);return db[_0x4f95('0x31')][_0x4f95('0x4f')](_0x59a820)[_0x4f95('0x2b')](handleEntityNotFound(_0x3ea1bf,null))[_0x4f95('0x2b')](function(_0x22bef4){if(_0x22bef4){var _0x4be724=_0x22bef4[_0x4f95('0x50')]({'plain':!![]});_0x4be724=qs[_0x4f95('0x51')](_0x4be724,['id','createdAt',_0x4f95('0x52'),_0x4f95('0x53')]);_0x3c57ab[_0x4f95('0x4d')]=_[_0x4f95('0x51')](_0x3c57ab[_0x4f95('0x4d')],['id',_0x4f95('0x54'),_0x4f95('0x52')]);return db[_0x4f95('0x55')][_0x4f95('0x56')](function(_0x346b55){return db[_0x4f95('0x31')][_0x4f95('0x4c')](_[_0x4f95('0x42')](_0x4be724,_0x3c57ab['body']),{'include':_0x3c57ab[_0x4f95('0x36')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x346b55})[_0x4f95('0x2b')](function(_0x25847e){var _0x370c84=_0x25847e[_0x4f95('0x50')]({'plain':!![]});return db[_0x4f95('0x57')][_0x4f95('0x47')]({'where':{'userProfileId':_0x3c57ab[_0x4f95('0x4b')]['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x3289a8){if(_0x3289a8){return BPromise[_0x4f95('0x58')](_0x3289a8,function(_0x55fff3){return new BPromise(function(_0x20cc1d,_0x266089){if(_0x55fff3[_0x4f95('0x59')]===null||_0x55fff3[_0x4f95('0x59')]===0x1)_0x20cc1d(null);return db[_0x4f95('0x5a')]['findAll']({'where':{'sectionId':_0x55fff3['id']},'raw':!![]})['then'](function(_0x4527de){var _0x1c1611=_[_0x4f95('0x30')](_0x4527de,function(_0x49208c){return qs[_0x4f95('0x51')](_0x49208c,['id',_0x4f95('0x54'),_0x4f95('0x52'),'sectionId']);});_0x20cc1d(_0x1c1611);})['catch'](function(_0x52c8ec){_0x266089(_0x52c8ec);});})[_0x4f95('0x2b')](function(_0x3767cb){var _0x180178=qs[_0x4f95('0x51')](_0x55fff3,['id',_0x4f95('0x54'),_0x4f95('0x52')]);_0x180178[_0x4f95('0x5b')]=_0x370c84['id'];if(_0x3767cb)_0x180178[_0x4f95('0x5c')]=_0x3767cb;return _0x180178;})[_0x4f95('0x2b')](function(_0x115015){return db[_0x4f95('0x57')]['create'](_0x115015,{'include':[{'model':db['UserProfileResource'],'as':_0x4f95('0x5c')}],'raw':!![],'transaction':_0x346b55});});})[_0x4f95('0x2b')](function(){return _0x370c84;});}});});});}})['then'](respondWithResult(_0x3ea1bf,0xc9))[_0x4f95('0x49')](handleError(_0x3ea1bf,null));};exports[_0x4f95('0x2a')]=function(_0x3d976d,_0xc01bc8){if(_0x3d976d[_0x4f95('0x4d')]['id']){delete _0x3d976d['body']['id'];}return db[_0x4f95('0x31')][_0x4f95('0x4f')]({'where':{'id':_0x3d976d[_0x4f95('0x4b')]['id']}})[_0x4f95('0x2b')](handleEntityNotFound(_0xc01bc8,null))['then'](saveUpdates(_0x3d976d['body'],null))[_0x4f95('0x2b')](respondWithResult(_0xc01bc8,null))[_0x4f95('0x49')](handleError(_0xc01bc8,null));};exports[_0x4f95('0x5d')]=function(_0x3f640f,_0x1e8506){return db[_0x4f95('0x31')][_0x4f95('0x4f')]({'where':{'id':_0x3f640f[_0x4f95('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e8506,null))[_0x4f95('0x2b')](removeEntity(_0x1e8506,null))[_0x4f95('0x49')](handleError(_0x1e8506,null));};exports[_0x4f95('0x5e')]=function(_0x1bf4e1,_0x1b9946){return db['UserProfile']['describe']()['then'](respondWithResult(_0x1b9946,null))['catch'](handleError(_0x1b9946,null));};exports['addSections']=function(_0xcfbebc,_0x1f5c00){var _0x4b139e=_0xcfbebc['body'];return db[_0x4f95('0x31')]['find']({'where':{'id':_0xcfbebc['params']['id']}})['then'](handleEntityNotFound(_0x1f5c00,null))['then'](function(_0x371bbf){if(_0x371bbf){return db[_0x4f95('0x55')]['transaction'](function(_0x45f6e7){return db['UserProfileSection'][_0x4f95('0x5d')]({'where':{'userProfileId':_0xcfbebc[_0x4f95('0x4b')]['id'],'sectionId':_[_0x4f95('0x30')](_0x4b139e,function(_0x5cc2d7){return _0x5cc2d7[_0x4f95('0x5f')];})},'transaction':_0x45f6e7})[_0x4f95('0x2b')](function(){var _0xc4ae77=_[_0x4f95('0x30')](_0x4b139e,function(_0x3a1ebf){_0x3a1ebf[_0x4f95('0x5b')]=_0xcfbebc[_0x4f95('0x4b')]['id'];return _0x3a1ebf;});var _0x585a9b=[];return BPromise['each'](_0xc4ae77,function(_0x53b774){return db[_0x4f95('0x57')][_0x4f95('0x4c')](_0x53b774,{'include':[{'model':db[_0x4f95('0x5a')],'as':_0x4f95('0x5c')}],'raw':!![],'transaction':_0x45f6e7})['then'](function(_0x7abfa2){_0x585a9b[_0x4f95('0x60')](_0x7abfa2[_0x4f95('0x50')]({'plain':!![]}));});})[_0x4f95('0x2b')](function(){return _0x585a9b;});});});}})[_0x4f95('0x2b')](function(_0xb7b493){return _0xb7b493;})['then'](respondWithResult(_0x1f5c00,null))['catch'](handleError(_0x1f5c00,null));};exports[_0x4f95('0x61')]=function(_0x2955b7,_0xe451af){var _0x1a7ccc;return db[_0x4f95('0x31')][_0x4f95('0x4f')]({'where':{'id':_0x2955b7['params']['id']},'attributes':['id',_0x4f95('0x2e')]})[_0x4f95('0x2b')](handleEntityNotFound(_0xe451af,null))['then'](function(_0x408629){if(_0x408629){_0x1a7ccc=_0x408629;return db[_0x4f95('0x57')][_0x4f95('0x5d')]({'where':{'userProfileId':_0x2955b7[_0x4f95('0x4b')]['id'],'sectionId':_0x2955b7[_0x4f95('0x36')][_0x4f95('0x62')]}});}})[_0x4f95('0x2b')](function(){return _0x1a7ccc;})[_0x4f95('0x2b')](respondWithStatusCode(_0xe451af,null))[_0x4f95('0x49')](handleError(_0xe451af,null));};exports['getSections']=function(_0x56bd85,_0x47ad28){var _0x471163=[];var _0x1da1d3=[];return db['UserProfileSection'][_0x4f95('0x47')]({'where':{'userProfileId':_0x56bd85[_0x4f95('0x4b')]['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x69d16){_0x471163=_[_0x4f95('0x41')](_0x69d16,function(_0x4473fd){return _0x4473fd[_0x4f95('0x63')]===0x1||_[_0x4f95('0x64')]([0x3eb,0x709],_0x4473fd[_0x4f95('0x5f')]);});if(!_[_0x4f95('0x65')](_0x471163)){return _[_0x4f95('0x30')](_0x471163,function(_0x2f936a){return _0x2f936a[_0x4f95('0x5f')];});}else{return;}})['then'](function(_0x28229e){if(_0x28229e)_0x1da1d3=_0x28229e;if(_[_0x4f95('0x64')](_0x1da1d3,0x64)){var _0x54d3be=_[_0x4f95('0x4f')](_0x471163,{'sectionId':0x64});return hasDefaultDashboard(_0x54d3be)['then'](function(_0x4035ad){return _[_0x4f95('0x30')](_0x471163,function(_0x350d7b){if(_0x350d7b[_0x4f95('0x5f')]===0x64){_0x350d7b['subsections']=_0x4035ad;}return _0x350d7b;});});}else{return;}})['then'](function(_0x49935e){if(_0x49935e)_0x471163=_0x49935e;if(_[_0x4f95('0x64')](_0x1da1d3,0x3eb)){var _0x36b893=_[_0x4f95('0x4f')](_0x471163,{'sectionId':0x3eb});return getCustomDashboards(_0x36b893)[_0x4f95('0x2b')](function(_0x2b0cbb){return _[_0x4f95('0x30')](_0x471163,function(_0x4db100){if(_0x36b893[_0x4f95('0x63')]){if(_0x4db100[_0x4f95('0x5f')]===0x3eb){_0x4db100['subsections']=_0x2b0cbb;}}else{if(_0x4db100[_0x4f95('0x5f')]===0x64){_0x4db100[_0x4f95('0x66')]=_0x2b0cbb;}}return _0x4db100;});});}else{return;}})[_0x4f95('0x2b')](function(_0x1f93d7){if(_0x1f93d7)_0x471163=_0x1f93d7;if(_[_0x4f95('0x64')](_0x1da1d3,0x709)){var _0x5abe95=_['find'](_0x471163,{'sectionId':0x709});return getPlugins(_0x5abe95)['then'](function(_0x2c3a60){if(_0x5abe95[_0x4f95('0x63')]){return _['map'](_0x471163,function(_0x519949){if(_0x519949[_0x4f95('0x5f')]===0x709){_0x519949['subsections']=_0x2c3a60;}return _0x519949;});}else{var _0x4d1490={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2c3a60};var _0x42af2=_[_0x4f95('0x30')](_0x471163);_0x42af2[_0x4f95('0x60')](_0x4d1490);return _0x42af2;}});}else{return;}})[_0x4f95('0x2b')](function(_0x24050e){if(_0x24050e)_0x471163=_0x24050e;return _[_0x4f95('0x41')](_0x471163,[_0x4f95('0x63'),0x1]);})[_0x4f95('0x2b')](respondWithResult(_0x47ad28,null))[_0x4f95('0x49')](handleError(_0x47ad28,null));};function hasDefaultDashboard(_0xffc205){var _0x4ac12b=[0x65];return new BPromise(function(_0x58d8a5,_0x48663a){try{if(_0xffc205[_0x4f95('0x59')]){_0x58d8a5(_0x4ac12b);}else{return db['UserProfileResource'][_0x4f95('0x67')]({'where':{'sectionId':_0xffc205['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x4ef439){_0x4ef439?_0x58d8a5(_0x4ac12b):_0x58d8a5();});}}catch(_0x22ea3b){_0x48663a(_0x22ea3b);}});}function getCustomDashboards(_0x4a8c00){var _0x1b07a5=[];return new BPromise(function(_0x462cd5,_0x24a78b){try{if(_0x4a8c00[_0x4f95('0x59')]){return db[_0x4f95('0x68')][_0x4f95('0x47')]({'raw':!![]})[_0x4f95('0x2b')](function(_0x26b78a){_0x26b78a['forEach'](function(_0x8b666a){_0x1b07a5[_0x4f95('0x60')](_0x8b666a['id']+0x1869f);});_0x462cd5(_0x1b07a5);});}else{return db[_0x4f95('0x5a')]['findAll']({'where':{'sectionId':_0x4a8c00['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x4d91ef){_0x4d91ef['forEach'](function(_0x181015){_0x1b07a5['push'](_0x181015[_0x4f95('0x69')]+0x1869f);});_0x462cd5(_0x1b07a5);});}}catch(_0x5d67ae){_0x24a78b(_0x5d67ae);}});}function getPlugins(_0x43503f){var _0x30c926=[];return new BPromise(function(_0x15e7d7,_0x3528bc){try{if(_0x43503f[_0x4f95('0x59')]){return db[_0x4f95('0x6a')][_0x4f95('0x47')]({'raw':!![]})[_0x4f95('0x2b')](function(_0x3b417d){_0x3b417d[_0x4f95('0x6b')](function(_0x1167d2){_0x30c926['push'](_0x1167d2['id']+0x15b38);});_0x15e7d7(_0x30c926);});}else{return db[_0x4f95('0x5a')][_0x4f95('0x47')]({'where':{'sectionId':_0x43503f['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x2fbe2a){_0x2fbe2a[_0x4f95('0x6b')](function(_0x2efc96){_0x30c926[_0x4f95('0x60')](_0x2efc96[_0x4f95('0x69')]+0x15b38);});_0x15e7d7(_0x30c926);});}}catch(_0x18dd5c){_0x3528bc(_0x18dd5c);}});}exports[_0x4f95('0x6c')]=function(_0x5687ad,_0x1d05e8){return db['UserProfile'][_0x4f95('0x4f')]({'where':{'id':_0x5687ad['params']['id']}})['then'](handleEntityNotFound(_0x1d05e8,null))[_0x4f95('0x2b')](function(_0x76b2c1){if(_0x76b2c1){return db['sequelize'][_0x4f95('0x56')](function(_0x261808){return db[_0x4f95('0x57')][_0x4f95('0x47')]({'where':{'userProfileId':_0x5687ad[_0x4f95('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0x4f95('0x2b')](function(_0xf2350d){if(_0xf2350d){return db[_0x4f95('0x57')][_0x4f95('0x5d')]({'where':{'userProfileId':_0x5687ad[_0x4f95('0x4b')]['id'],'id':_[_0x4f95('0x30')](_0xf2350d,function(_0x147634){return _0x147634['id'];})},'transaction':_0x261808});}})[_0x4f95('0x2b')](function(_0x56a0cb){var _0x42e01a=_['map'](_0x5687ad[_0x4f95('0x4d')],function(_0x476617){_0x476617['userProfileId']=_0x5687ad['params']['id'];return _0x476617;});return db[_0x4f95('0x57')]['bulkCreate'](_0x42e01a,{'raw':!![],'transaction':_0x261808});})[_0x4f95('0x2b')](function(_0x269bc6){var _0x35880c=_[_0x4f95('0x41')](_['map'](_0x269bc6,function(_0x3bbf9c){return _0x3bbf9c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x35880c){return db[_0x4f95('0x57')][_0x4f95('0x47')]({'where':{'userProfileId':_0x5687ad['params']['id'],'sectionId':_[_0x4f95('0x30')](_0x35880c,function(_0x4b1b7d){return _0x4b1b7d['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x4f95('0x2b')](function(_0x267d5e){var _0x55a6e4=_[_0x4f95('0x30')](_0x5687ad['body'],function(_0x1d6769){_0x1d6769[_0x4f95('0x5b')]=_0x5687ad[_0x4f95('0x4b')]['id'];return _0x1d6769;});return db[_0x4f95('0x5a')][_0x4f95('0x6d')](_0x55a6e4,{'raw':!![],'transaction':_0x261808});});}})['catch'](handleError(_0x1d05e8,null));});}})[_0x4f95('0x2b')](function(_0x1af1f8){var _0x43cd86=_[_0x4f95('0x30')](_0x1af1f8,function(_0x1d67bb){return _0x1d67bb[_0x4f95('0x50')]({'plain':!![]});});})[_0x4f95('0x2b')](respondWithResult(_0x1d05e8,null))[_0x4f95('0x49')](handleError(_0x1d05e8,null));};exports['removeResources']=function(_0x2145d1,_0x4add4f,_0x55c846){return db[_0x4f95('0x31')][_0x4f95('0x4f')]({'where':{'id':_0x2145d1[_0x4f95('0x4b')]['id']}})[_0x4f95('0x2b')](handleEntityNotFound(_0x4add4f,null))[_0x4f95('0x2b')](function(_0x331b82){if(_0x331b82){return _0x331b82['removeResources'](_0x2145d1[_0x4f95('0x36')][_0x4f95('0x62')]);}})[_0x4f95('0x2b')](respondWithStatusCode(_0x4add4f,null))['catch'](handleError(_0x4add4f,null));};exports[_0x4f95('0x6e')]=function(_0x422ad4,_0xbad018){var _0x3c0156={};if(!_0x422ad4[_0x4f95('0x36')]['section'])throw new Error(_0x4f95('0x6f'));if(!_0x422ad4[_0x4f95('0x36')][_0x4f95('0x70')](_0x4f95('0x71'))){_0x3c0156[_0x4f95('0x22')]=qs[_0x4f95('0x22')](_0x422ad4[_0x4f95('0x36')]['limit']);_0x3c0156[_0x4f95('0x24')]=qs[_0x4f95('0x24')](_0x422ad4[_0x4f95('0x36')][_0x4f95('0x24')]);}return db['UserProfile'][_0x4f95('0x4f')]({'where':{'id':_0x422ad4[_0x4f95('0x4b')]['id']}})[_0x4f95('0x2b')](function(_0x2ca0f7){if(!_0x2ca0f7)throw new Error(_0x4f95('0x72')+_0x422ad4[_0x4f95('0x4b')]['id']);return db[_0x4f95('0x31')][_0x4f95('0x6e')](_0x422ad4);})[_0x4f95('0x2b')](respondWithFilteredResult(_0xbad018,_0x3c0156))['catch'](handleError(_0xbad018,null));};
\ No newline at end of file
index 96003c8..71bf51f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1574=['UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1d03f9,_0x2f06ab){var _0x329bb1=function(_0x1e0b5c){while(--_0x1e0b5c){_0x1d03f9['push'](_0x1d03f9['shift']());}};_0x329bb1(++_0x2f06ab);}(_0x1574,0x148));var _0x4157=function(_0x25256b,_0x1878d0){_0x25256b=_0x25256b-0x0;var _0xfdcad8=_0x1574[_0x25256b];return _0xfdcad8;};'use strict';var EventEmitter=require(_0x4157('0x0'));var UserProfile=require(_0x4157('0x1'))['db'][_0x4157('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4157('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4157('0x4'),'afterDestroy':_0x4157('0x5')};function emitEvent(_0xab8757){return function(_0x1759d6,_0x2f0766,_0x1c528e){UserProfileEvents[_0x4157('0x6')](_0xab8757+':'+_0x1759d6['id'],_0x1759d6);UserProfileEvents[_0x4157('0x6')](_0xab8757,_0x1759d6);_0x1c528e(null);};}for(var e in events){if(events[_0x4157('0x7')](e)){var event=events[e];UserProfile[_0x4157('0x8')](e,emitEvent(event));}}module[_0x4157('0x9')]=UserProfileEvents;
\ No newline at end of file
+var _0xb2ad=['hasOwnProperty','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x5cfaf5,_0x1c4530){var _0x30468e=function(_0x4b97ed){while(--_0x4b97ed){_0x5cfaf5['push'](_0x5cfaf5['shift']());}};_0x30468e(++_0x1c4530);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x37c841,_0x3820d9){_0x37c841=_0x37c841-0x0;var _0x585ae6=_0xb2ad[_0x37c841];return _0x585ae6;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xdb2a('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xdb2a('0x1')](0x0);var events={'afterCreate':_0xdb2a('0x2'),'afterUpdate':_0xdb2a('0x3'),'afterDestroy':_0xdb2a('0x4')};function emitEvent(_0xf8768){return function(_0x505753,_0x244b13,_0x23ada5){UserProfileEvents[_0xdb2a('0x5')](_0xf8768+':'+_0x505753['id'],_0x505753);UserProfileEvents[_0xdb2a('0x5')](_0xf8768,_0x505753);_0x23ada5(null);};}for(var e in events){if(events[_0xdb2a('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 4b256b6..91bdc4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa456=['Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','queuecampaigns','users','telephones','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Template','Trigger','trunks','Trunk','Variable','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','ui.createdAt','from','_interactions','where','sequelize','query','OpenTabs','define','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','keys','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filters','merge','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','Tag','Tags','color','ThroughTags','tag','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','then','associatedResources','map','catch','model','findAll','name','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','companies','CmCompany','CmCustomField','chatqueues','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording'];(function(_0x1c2ed9,_0x35548b){var _0x4ff71c=function(_0x2248c0){while(--_0x2248c0){_0x1c2ed9['push'](_0x1c2ed9['shift']());}};_0x4ff71c(++_0x35548b);}(_0xa456,0x142));var _0x6a45=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa456[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6a45('0x0'));var attributes=require(_0x6a45('0x1'));var qs=require(_0x6a45('0x2'));var squel=require(_0x6a45('0x3'));module['exports']=function(_0x3bfbe6){var _0x206f6b=_0x3bfbe6[_0x6a45('0x4')];function _0x500c72(_0x1f0701,_0x40acad){return new Promise(function(_0x1e5882,_0x14da6b){if(!_0x40acad)return _0x1e5882(null);var _0x4dfbfa=_0x40acad[_0x6a45('0x5')]?{[_0x40acad[_0x6a45('0x5')][_0x6a45('0x6')]]:_0x40acad[_0x6a45('0x5')][_0x6a45('0x7')]}:undefined;return _0x206f6b[_0x1f0701]['findAll']({'where':_0x4dfbfa,'raw':!![]})[_0x6a45('0x8')](function(_0x517040){_0x40acad[_0x6a45('0x9')]=_[_0x6a45('0xa')](_0x517040,'id');_0x1e5882(_0x40acad);})[_0x6a45('0xb')](function(_0x147679){_0x14da6b(_0x147679);});});}function _0x1249e4(_0x4ff9ae,_0x553a67){return new Promise(function(_0xe62823,_0x465b59){var _0x4b7f6d=_0x4ff9ae['filter']?{[_0x4ff9ae['filter'][_0x6a45('0x6')]]:_0x4ff9ae[_0x6a45('0x5')][_0x6a45('0x7')]}:undefined;return _0x206f6b[_0x4ff9ae[_0x6a45('0xc')]][_0x6a45('0xd')]({'where':_0x4b7f6d,'raw':!![]})['then'](function(_0x563c3b){_0x553a67[_0x6a45('0x9')]=_[_0x6a45('0xa')](_0x563c3b,function(_0x48fe0c){return _0x48fe0c[_0x6a45('0xe')];});_0xe62823(_0x553a67);})[_0x6a45('0xb')](function(_0x3fab82){_0x465b59(_0x3fab82);});});}function _0x13adc0(_0x548634,_0x54507b,_0x49023f){if(!_0x54507b)return Promise[_0x6a45('0xf')](null);return new Promise(function(_0x391f81,_0x360b7f){return _0x206f6b['UserProfileResource'][_0x6a45('0xd')]({'where':{'sectionId':_0x54507b['id']},'raw':!![]})[_0x6a45('0x8')](function(_0x3439c8){if(_0x548634['field']&&_0x548634['field']!=='id'){_0x54507b['associatedResources']=_[_0x6a45('0xa')](_0x3439c8,function(_0x2ed1e5){return _0x2ed1e5[_0x548634['field']];});}else{if(_0x49023f===_0x6a45('0x10')){_0x54507b[_0x6a45('0x9')]=_['map'](_0x3439c8,function(_0x4f7110){return{'id':_0x4f7110[_0x6a45('0x11')],'type':_0x4f7110[_0x6a45('0x12')]};});}else{_0x54507b[_0x6a45('0x9')]=_[_0x6a45('0xa')](_0x3439c8,function(_0x487666){return _0x487666['resourceId'];});}}_0x391f81(_0x54507b);})[_0x6a45('0xb')](function(_0x59af4b){_0x360b7f(_0x59af4b);});});}function _0x11290c(_0x22373c,_0x25a380){var _0x3ad898={'parentSections':[]};switch(_0x22373c[_0x6a45('0x13')]()){case _0x6a45('0x14'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x16');break;case _0x6a45('0x17'):_0x3ad898[_0x6a45('0x15')]='SquareOdbc';break;case _0x6a45('0x18'):_0x3ad898['childModel']=_0x6a45('0x19');_0x3ad898[_0x6a45('0x1a')]=[{'name':_0x6a45('0x1b'),'field':_0x6a45('0xe'),'foreignKey':_0x6a45('0x1c')}];break;case'projects':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x1d');break;case _0x6a45('0x1e'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x1f');_0x3ad898[_0x6a45('0x1a')]=[{'name':_0x6a45('0x20'),'field':'id','foreignKey':_0x6a45('0x21')}];break;case'lists':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x22');break;case _0x6a45('0x23'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x24');break;case'globalcustomfields':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x25');break;case _0x6a45('0x26'):_0x3ad898[_0x6a45('0x15')]='ChatQueue';break;case'chatwebsites':_0x3ad898[_0x6a45('0x15')]='ChatWebsite';break;case _0x6a45('0x27'):_0x3ad898['childModel']=_0x6a45('0x28');break;case _0x6a45('0x29'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x2a');break;case _0x6a45('0x2b'):case _0x6a45('0x2c'):case _0x6a45('0x2d'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x2e');break;case _0x6a45('0x2f'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x30');break;case _0x6a45('0x31'):_0x3ad898['childModel']=_0x6a45('0x32');break;case'voicerecordings':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x33');_0x3ad898[_0x6a45('0x1a')]=[{'name':_0x6a45('0x34'),'field':_0x6a45('0xe'),'foreignKey':_0x6a45('0x35'),'model':'User','filter':{'field':_0x6a45('0x36'),'value':[_0x6a45('0x37')]}},{'name':_0x6a45('0x38'),'field':_0x6a45('0xe'),'foreignKey':_0x6a45('0x35'),'model':_0x6a45('0x39'),'filter':{'field':'role','value':[_0x6a45('0x3a')]}},{'name':_0x6a45('0x3b'),'field':'name','foreignKey':_0x6a45('0x3c'),'model':_0x6a45('0x3d'),'filter':{'field':_0x6a45('0x12'),'value':[_0x6a45('0x3e')]}},{'name':_0x6a45('0x3f'),'field':'name','foreignKey':_0x6a45('0x3c'),'model':_0x6a45('0x3d'),'filter':{'field':_0x6a45('0x12'),'value':[_0x6a45('0x40')]}}];break;case _0x6a45('0x41'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x42');break;case'chanspies':_0x3ad898[_0x6a45('0x15')]='VoiceChanSpy';break;case _0x6a45('0x43'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x44');break;case _0x6a45('0x45'):_0x3ad898['childModel']='Campaign';break;case _0x6a45('0x46'):_0x3ad898[_0x6a45('0x15')]='MailQueue';break;case _0x6a45('0x47'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x48');break;case _0x6a45('0x49'):_0x3ad898['childModel']='MailSubstatus';break;case'openchannelqueues':_0x3ad898['childModel']=_0x6a45('0x4a');break;case _0x6a45('0x4b'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x4c');break;case _0x6a45('0x4d'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x4e');break;case _0x6a45('0x4f'):_0x3ad898['childModel']=_0x6a45('0x50');break;case'whatsappqueues':_0x3ad898['childModel']=_0x6a45('0x51');break;case _0x6a45('0x52'):_0x3ad898['childModel']=_0x6a45('0x53');break;case'teams':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x54');break;case _0x6a45('0x55'):case _0x6a45('0x56'):_0x3ad898['childModel']=_0x6a45('0x3d');if(_0x25a380){_0x3ad898[_0x6a45('0x1a')]=[{'name':_0x6a45('0x3b')},{'name':_0x6a45('0x3f')}];}break;case _0x6a45('0x57'):case'agents':case _0x6a45('0x58'):_0x3ad898['childModel']=_0x6a45('0x39');if(_0x25a380){_0x3ad898[_0x6a45('0x1a')]=[{'name':'Users','filter':{'field':_0x6a45('0x36'),'value':[_0x6a45('0x59'),_0x6a45('0x5a')]},'ignore':!![]},{'name':_0x6a45('0x34')},{'name':'Telephones'}];}break;case _0x6a45('0x5b'):_0x3ad898['childModel']=_0x6a45('0x5c');break;case'salesforceaccounts':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x5d');break;case _0x6a45('0x5e'):_0x3ad898[_0x6a45('0x15')]='FreshdeskAccount';break;case _0x6a45('0x5f'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x60');break;case _0x6a45('0x61'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x62');break;case _0x6a45('0x63'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x64');break;case _0x6a45('0x65'):_0x3ad898['childModel']=_0x6a45('0x39');break;case _0x6a45('0x66'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x67');break;case'dispositions':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x68');break;case _0x6a45('0x69'):_0x3ad898['childModel']='Dashboard';break;case'intervals':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x6a');break;case _0x6a45('0x6b'):_0x3ad898[_0x6a45('0x15')]='Pause';break;case _0x6a45('0x6c'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x6d');break;case _0x6a45('0x6e'):_0x3ad898['childModel']=_0x6a45('0x6f');break;case _0x6a45('0x70'):_0x3ad898[_0x6a45('0x15')]='Tag';break;case'templates':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x71');break;case'triggers':_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x72');break;case _0x6a45('0x73'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x74');break;case'variables':_0x3ad898['childModel']=_0x6a45('0x75');break;case'plugins':_0x3ad898['childModel']='Plugin';break;case _0x6a45('0x76'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x10');_0x3ad898[_0x6a45('0x1a')]=[{'name':'Reports','field':'id','foreignKey':_0x6a45('0x77')}];break;case _0x6a45('0x78'):_0x3ad898[_0x6a45('0x15')]=_0x6a45('0x79');break;}return _0x3ad898;}function _0x4c9a93(_0x239c37,_0x504ccf){var _0x1461d3=_0x239c37[_0x6a45('0x7a')](0x0)[_0x6a45('0x7b')]()+_0x239c37[_0x6a45('0x7c')](0x1);var _0x25bbc4={'type':_0x206f6b[_0x6a45('0x7d')][_0x6a45('0x7e')][_0x6a45('0x7f')],'raw':!![]};return new Promise(function(_0x141546,_0x4a6f4c){var _0x13c9d9=squel[_0x6a45('0x80')]()[_0x6a45('0x6')]('ui.'+_0x1461d3+_0x6a45('0x81'),'id')['field'](_0x6a45('0x82'))[_0x6a45('0x83')]('user_has_'+_0x239c37+_0x6a45('0x84'),'ui')[_0x6a45('0x85')]('ui.UserId\x20=\x20?',_0x504ccf['id']);return _0x206f6b[_0x6a45('0x86')][_0x6a45('0x87')](_0x13c9d9['toString'](),_0x25bbc4)['then'](function(_0x26c53c){_0x504ccf[_0x1461d3+_0x6a45('0x88')]=_0x26c53c;_0x141546(_0x26c53c);})[_0x6a45('0xb')](function(_0x30128d){_0x4a6f4c(_0x30128d);});});}return _0x3bfbe6[_0x6a45('0x89')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x7fc1b2){var _0x5faae8={'raw':![],'where':{}};var _0x50248a={};var _0x475479={'count':0x0,'rows':[]};var _0x29cd12=_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0x8a')];var _0x4f20e2=_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0x8b')]||![];var _0x3388f1=_0x11290c(_0x29cd12,_0x4f20e2);if(!_0x3388f1[_0x6a45('0x15')])throw new Error(_0x6a45('0x8c')+_0x29cd12+'\x27');var _0x353eae=[{'name':_0x29cd12}];if(!_[_0x6a45('0x8d')](_0x3388f1[_0x6a45('0x1a')]))_0x353eae=_0x3388f1[_0x6a45('0x1a')];var _0x6f0ed7=[];for(var _0x403711=0x0;_0x403711<_0x353eae[_0x6a45('0x8e')];_0x403711++){_0x6f0ed7[_0x6a45('0x8f')](_0x206f6b[_0x6a45('0x90')][_0x6a45('0x91')]({'where':{'userProfileId':_0x7fc1b2[_0x6a45('0x92')]['id'],'name':_0x353eae[_0x403711][_0x6a45('0xe')]},'raw':!![]}));}return Promise[_0x6a45('0x93')](_0x6f0ed7)['then'](function(_0x323ac2){var _0x4e24b0=_[_0x6a45('0x5')](_0x323ac2,function(_0x57316d){return _0x57316d?_0x57316d:undefined;});var _0x332666=_[_0x6a45('0x5')](_0x353eae,[_0x6a45('0x94'),!![]]);var _0x9d8810=_[_0x6a45('0x8d')](_0x4e24b0)&&_[_0x6a45('0x8d')](_0x332666)?null:_[_0x6a45('0x95')](_0x332666,_0x4e24b0);if(!_0x9d8810)return null;var _0x42c67a=[];for(var _0x113784=0x0;_0x113784<_0x9d8810['length'];_0x113784++){var _0x13baf6=_['find'](_0x353eae,function(_0x763420){return _0x9d8810[_0x113784]?_0x763420[_0x6a45('0xe')]===_0x9d8810[_0x113784][_0x6a45('0xe')]:null;});if(_0x13baf6){if(_0x9d8810[_0x113784]['ignore']){_0x42c67a[_0x6a45('0x8f')](_0x500c72(_0x3388f1[_0x6a45('0x15')],_0x9d8810[_0x113784]));}else{if(!_0x9d8810[_0x113784][_0x6a45('0x96')]){_0x42c67a[_0x6a45('0x8f')](_0x13adc0(_0x13baf6,_0x9d8810[_0x113784],_0x3388f1[_0x6a45('0x15')]));}else{if(_0x13baf6[_0x6a45('0xc')]){_0x42c67a[_0x6a45('0x8f')](_0x1249e4(_0x13baf6,_0x9d8810[_0x113784]));}}}}}return Promise['all'](_0x42c67a);})['then'](function(_0x8327cd){var _0x30a802=_0x8327cd;var _0x67e87f=null;if(_0x30a802){_0x67e87f=_0x30a802[_0x6a45('0x8e')]===0x1?_0x30a802[0x0]:null;}if(!_0x67e87f&&!_0x30a802)return _0x475479;var _0x77d0aa=_0x206f6b[_0x3388f1[_0x6a45('0x15')]]['rawAttributes'];_0x50248a[_0x6a45('0xc')]=_[_0x6a45('0x97')](_0x77d0aa);_0x50248a['query']=_[_0x6a45('0x97')](_0x7fc1b2['query']);_0x50248a['filters']=_['intersection'](_0x50248a[_0x6a45('0xc')],_0x50248a[_0x6a45('0x87')]);_0x5faae8[_0x6a45('0x98')]=_['intersection'](_0x50248a[_0x6a45('0xc')],qs[_0x6a45('0x99')](_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0x99')]));_0x5faae8[_0x6a45('0x98')]=_0x5faae8[_0x6a45('0x98')][_0x6a45('0x8e')]?_0x5faae8['attributes']:_0x50248a['model'];if(!_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0x9a')](_0x6a45('0x9b'))){_0x5faae8[_0x6a45('0x9c')]=qs[_0x6a45('0x9c')](_0x7fc1b2['query'][_0x6a45('0x9c')]);_0x5faae8[_0x6a45('0x9d')]=qs[_0x6a45('0x9d')](_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0x9d')]);}_0x5faae8[_0x6a45('0x9e')]=qs[_0x6a45('0x9f')](_0x7fc1b2['query'][_0x6a45('0x9f')]);_0x5faae8[_0x6a45('0x85')]=qs['filters'](_[_0x6a45('0xa0')](_0x7fc1b2[_0x6a45('0x87')],_0x50248a[_0x6a45('0xa1')]));if(_0x7fc1b2[_0x6a45('0x87')]['filter']){_0x5faae8[_0x6a45('0x85')]=_[_0x6a45('0xa2')](_0x5faae8['where'],{'$or':_[_0x6a45('0xa')](_0x77d0aa,function(_0x5b99ec){if(_0x5b99ec[_0x6a45('0x12')]['key']!==_0x6a45('0xa3')){var _0x38e379={};_0x38e379[_0x5b99ec[_0x6a45('0x6')]]={'$like':'%'+_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0x5')]+'%'};return _0x38e379;}})});}var _0x59349e=[];var _0x8b1a91=null;var _0x3189b7={};if(_0x67e87f){_0x8b1a91=_[_0x6a45('0x91')](_0x353eae,[_0x6a45('0xe'),_0x67e87f['name']]);if(_0x8b1a91[_0x6a45('0x6')]){_0x3189b7={};if(_0x3388f1[_0x6a45('0x15')]===_0x6a45('0x10')){_0x3189b7[_0x8b1a91['foreignKey']]=_['map'](_0x67e87f[_0x6a45('0x9')],'id');}else{_0x3189b7[_0x8b1a91['foreignKey']]=_0x67e87f[_0x6a45('0x9')];}_0x59349e[_0x6a45('0x8f')](_0x3189b7);}else{_0x5faae8[_0x6a45('0x85')]['id']=_0x67e87f['associatedResources'];}}else{for(var _0x5470c7=0x0;_0x5470c7<_0x30a802['length'];_0x5470c7++){_0x8b1a91=_[_0x6a45('0x91')](_0x353eae,[_0x6a45('0xe'),_0x30a802[_0x5470c7][_0x6a45('0xe')]]);if(_0x8b1a91[_0x6a45('0x6')]){_0x3189b7={};_0x3189b7[_0x8b1a91[_0x6a45('0xa4')]]=_0x30a802[_0x5470c7]['associatedResources'];_0x59349e[_0x6a45('0x8f')](_0x3189b7);}else{if(!_0x5faae8['where']['id'])_0x5faae8['where']['id']=[];_0x30a802[_0x5470c7][_0x6a45('0x9')][_0x6a45('0xa5')](function(_0x272cc2){_0x5faae8[_0x6a45('0x85')]['id']['push'](_0x272cc2);});}}}if(!_[_0x6a45('0x8d')](_0x59349e)){_0x5faae8['where']=_[_0x6a45('0xa2')](_0x5faae8[_0x6a45('0x85')],{'$and':{'$or':_0x59349e}});}_0x5faae8=_[_0x6a45('0xa2')]({},_0x5faae8,_0x7fc1b2[_0x6a45('0xa6')]);if(_0x67e87f&&!_0x67e87f[_0x6a45('0x96')]&&_0x3388f1[_0x6a45('0x15')]===_0x6a45('0x10')){if(_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0xa7')]){_0x5faae8[_0x6a45('0xa8')]=[{'all':!![]}];}return _0x206f6b[_0x3388f1[_0x6a45('0x15')]][_0x6a45('0xd')](_0x5faae8)[_0x6a45('0x8')](function(_0x520063){var _0x57b43b=[];_0x520063[_0x6a45('0xa5')](function(_0x5204ec){var _0x1acb5a;switch(_0x5204ec[_0x6a45('0xa9')]){case _0x6a45('0xaa'):_0x1acb5a=_[_0x6a45('0x91')](_0x67e87f[_0x6a45('0x9')],function(_0x186e57){return _0x186e57['id']===_0x5204ec[_0x6a45('0x77')]&&_0x186e57[_0x6a45('0x12')]==='DefaultReports';});break;case _0x6a45('0xab'):_0x1acb5a=_['find'](_0x67e87f['associatedResources'],function(_0x4cf559){return _0x4cf559['id']===_0x5204ec[_0x6a45('0x77')]&&_0x4cf559[_0x6a45('0x12')]===_0x6a45('0xac');});break;}if(_0x1acb5a)_0x57b43b[_0x6a45('0x8f')](_0x5204ec);});_0x475479[_0x6a45('0xad')]=_0x57b43b['length'];_0x475479[_0x6a45('0xae')]=_0x57b43b;return _0x475479;});}else{return _0x206f6b[_0x3388f1[_0x6a45('0x15')]][_0x6a45('0xad')]({'where':_0x5faae8[_0x6a45('0x85')]})[_0x6a45('0x8')](function(_0x637030){_0x475479[_0x6a45('0xad')]=_0x637030;if(_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0xa7')]){if(_0x3388f1['childModel']==='CmContact'){_0x5faae8['include']=[{'model':_0x206f6b[_0x6a45('0xaf')],'as':_0x6a45('0xb0'),'attributes':['id',_0x6a45('0xe'),_0x6a45('0xb1')],'required':_0x7fc1b2['query']['tag']?!![]:![]},{'model':_0x206f6b['Tag'],'as':_0x6a45('0xb2'),'attributes':['id','name','color'],'through':_0x7fc1b2['query'][_0x6a45('0xb3')]?{'attributes':[],'where':{'TagId':_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0xb3')]||undefined}}:{},'required':_0x7fc1b2[_0x6a45('0x87')][_0x6a45('0xb3')]?!![]:![]}];}else{_0x5faae8['include']=[{'all':!![]}];}}return _0x206f6b[_0x3388f1[_0x6a45('0x15')]]['findAll'](_0x5faae8);})[_0x6a45('0x8')](function(_0x1a5207){_0x475479[_0x6a45('0xae')]=_0x1a5207;if(_0x29cd12===_0x6a45('0x34')&&_0x7fc1b2[_0x6a45('0x87')]['openTabs']==='true'){var _0x5adfdb=[];for(var _0x46d79d=0x0;_0x46d79d<_0x475479[_0x6a45('0xae')][_0x6a45('0x8e')];_0x46d79d++){_0x5adfdb[_0x6a45('0x8f')](_0x4c9a93(_0x6a45('0xb4'),_0x475479[_0x6a45('0xae')][_0x46d79d][_0x6a45('0xb5')]));_0x5adfdb[_0x6a45('0x8f')](_0x4c9a93(_0x6a45('0xb6'),_0x475479['rows'][_0x46d79d][_0x6a45('0xb5')]));_0x5adfdb[_0x6a45('0x8f')](_0x4c9a93(_0x6a45('0xb7'),_0x475479['rows'][_0x46d79d][_0x6a45('0xb5')]));_0x5adfdb['push'](_0x4c9a93(_0x6a45('0xb8'),_0x475479[_0x6a45('0xae')][_0x46d79d][_0x6a45('0xb5')]));_0x5adfdb[_0x6a45('0x8f')](_0x4c9a93(_0x6a45('0xb9'),_0x475479['rows'][_0x46d79d][_0x6a45('0xb5')]));_0x5adfdb['push'](_0x4c9a93(_0x6a45('0xba'),_0x475479[_0x6a45('0xae')][_0x46d79d][_0x6a45('0xb5')]));}return Promise[_0x6a45('0x93')](_0x5adfdb)[_0x6a45('0x8')](function(){return _0x475479;});}return _0x475479;});}});}}});};
\ No newline at end of file
+var _0x187d=['chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','membername','Telephones','User','telephone','queue','type','inbound','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','VoiceQueue','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','trunks','Trunk','Variable','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','all','union','ignore','push','rawAttributes','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','autoAssociation','include','reportType','DefaultReports','custom','count','rows','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','name','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','SquareProject','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue'];(function(_0x1f591d,_0x3e63d5){var _0x4b1d3b=function(_0x312a89){while(--_0x312a89){_0x1f591d['push'](_0x1f591d['shift']());}};_0x4b1d3b(++_0x3e63d5);}(_0x187d,0x93));var _0xd187=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x187d[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xd187('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xd187('0x1'));var squel=require(_0xd187('0x2'));module[_0xd187('0x3')]=function(_0x1cb41f){var _0x18498b=_0x1cb41f[_0xd187('0x4')];function _0x58622a(_0x28fa0b,_0x163807){return new Promise(function(_0x4ebc8d,_0x1d2533){if(!_0x163807)return _0x4ebc8d(null);var _0x58ee7=_0x163807[_0xd187('0x5')]?{[_0x163807[_0xd187('0x5')][_0xd187('0x6')]]:_0x163807[_0xd187('0x5')][_0xd187('0x7')]}:undefined;return _0x18498b[_0x28fa0b][_0xd187('0x8')]({'where':_0x58ee7,'raw':!![]})['then'](function(_0x342539){_0x163807[_0xd187('0x9')]=_[_0xd187('0xa')](_0x342539,'id');_0x4ebc8d(_0x163807);})[_0xd187('0xb')](function(_0x33ca45){_0x1d2533(_0x33ca45);});});}function _0x2a61a4(_0x59c194,_0x10d467){return new Promise(function(_0x412ccf,_0x18237b){var _0x5e6180=_0x59c194[_0xd187('0x5')]?{[_0x59c194[_0xd187('0x5')][_0xd187('0x6')]]:_0x59c194['filter'][_0xd187('0x7')]}:undefined;return _0x18498b[_0x59c194[_0xd187('0xc')]][_0xd187('0x8')]({'where':_0x5e6180,'raw':!![]})[_0xd187('0xd')](function(_0x517b25){_0x10d467[_0xd187('0x9')]=_[_0xd187('0xa')](_0x517b25,function(_0x45ab10){return _0x45ab10[_0xd187('0xe')];});_0x412ccf(_0x10d467);})['catch'](function(_0x245d3e){_0x18237b(_0x245d3e);});});}function _0x52a208(_0x5cf218,_0x40ed84,_0x5a4986){if(!_0x40ed84)return Promise['resolve'](null);return new Promise(function(_0x207b36,_0x2b3290){return _0x18498b[_0xd187('0xf')][_0xd187('0x8')]({'where':{'sectionId':_0x40ed84['id']},'raw':!![]})[_0xd187('0xd')](function(_0x253a7e){if(_0x5cf218[_0xd187('0x6')]&&_0x5cf218[_0xd187('0x6')]!=='id'){_0x40ed84[_0xd187('0x9')]=_[_0xd187('0xa')](_0x253a7e,function(_0x170d5c){return _0x170d5c[_0x5cf218[_0xd187('0x6')]];});}else{if(_0x5a4986===_0xd187('0x10')){_0x40ed84['associatedResources']=_[_0xd187('0xa')](_0x253a7e,function(_0x81b988){return{'id':_0x81b988[_0xd187('0x11')],'type':_0x81b988['type']};});}else{_0x40ed84['associatedResources']=_['map'](_0x253a7e,function(_0x435d94){return _0x435d94[_0xd187('0x11')];});}}_0x207b36(_0x40ed84);})[_0xd187('0xb')](function(_0x4f62c8){_0x2b3290(_0x4f62c8);});});}function _0x2c07c8(_0x57186b,_0x145771){var _0x5a7a23={'parentSections':[]};switch(_0x57186b[_0xd187('0x12')]()){case'squareprojects':_0x5a7a23['childModel']=_0xd187('0x13');break;case'odbc':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x15');break;case'squarerecordings':_0x5a7a23['childModel']=_0xd187('0x16');_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x18'),'field':_0xd187('0xe'),'foreignKey':'projectName'}];break;case _0xd187('0x19'):_0x5a7a23[_0xd187('0x14')]='JscriptyProject';break;case _0xd187('0x1a'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1b');_0x5a7a23['parentSections']=[{'name':_0xd187('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xd187('0x1d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1e');break;case _0xd187('0x1f'):_0x5a7a23['childModel']=_0xd187('0x20');break;case _0xd187('0x21'):_0x5a7a23['childModel']='CmCustomField';break;case _0xd187('0x22'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x23');break;case _0xd187('0x24'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x25');break;case _0xd187('0x26'):_0x5a7a23[_0xd187('0x14')]='FaxQueue';break;case _0xd187('0x27'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x28');break;case'inboundroutes':case _0xd187('0x29'):case'outboundroutes':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2a');break;case _0xd187('0x2b'):_0x5a7a23['childModel']='VoiceContext';break;case _0xd187('0x2c'):_0x5a7a23[_0xd187('0x14')]='VoiceMail';break;case _0xd187('0x2d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2e');_0x5a7a23['parentSections']=[{'name':'Agents','field':_0xd187('0xe'),'foreignKey':_0xd187('0x2f'),'model':'User','filter':{'field':'role','value':['agent']}},{'name':_0xd187('0x30'),'field':'name','foreignKey':_0xd187('0x2f'),'model':_0xd187('0x31'),'filter':{'field':'role','value':[_0xd187('0x32')]}},{'name':'VoiceQueues','field':_0xd187('0xe'),'foreignKey':_0xd187('0x33'),'model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x35')]}},{'name':'QueueCampaigns','field':_0xd187('0xe'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x36')]}}];break;case _0xd187('0x37'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x38');break;case'chanspies':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x39');break;case _0xd187('0x3a'):_0x5a7a23['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x5a7a23['childModel']=_0xd187('0x3b');break;case _0xd187('0x3c'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3d');break;case _0xd187('0x3e'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3f');break;case _0xd187('0x40'):_0x5a7a23['childModel']=_0xd187('0x41');break;case _0xd187('0x42'):_0x5a7a23[_0xd187('0x14')]='OpenchannelQueue';break;case _0xd187('0x43'):_0x5a7a23['childModel']=_0xd187('0x44');break;case _0xd187('0x45'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x46');break;case _0xd187('0x47'):_0x5a7a23['childModel']=_0xd187('0x48');break;case _0xd187('0x49'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4a');break;case'whatsappaccounts':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4b');break;case'teams':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4c');break;case'voicequeues':case'queuecampaigns':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4d');if(_0x145771){_0x5a7a23['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xd187('0x4e'):case _0xd187('0x4f'):case _0xd187('0x50'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x31');if(_0x145771){_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x51'),'filter':{'field':'role','value':[_0xd187('0x52'),_0xd187('0x53')]},'ignore':!![]},{'name':_0xd187('0x54')},{'name':_0xd187('0x30')}];}break;case _0xd187('0x55'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x56');break;case _0xd187('0x57'):_0x5a7a23['childModel']=_0xd187('0x58');break;case _0xd187('0x59'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x5a');break;case _0xd187('0x5b'):_0x5a7a23['childModel']=_0xd187('0x5c');break;case _0xd187('0x5d'):_0x5a7a23['childModel']=_0xd187('0x5e');break;case _0xd187('0x5f'):_0x5a7a23['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x5a7a23['childModel']=_0xd187('0x31');break;case _0xd187('0x60'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x61');break;case _0xd187('0x62'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x63');break;case'customdashboards':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x64');break;case _0xd187('0x65'):_0x5a7a23[_0xd187('0x14')]='Interval';break;case _0xd187('0x66'):_0x5a7a23['childModel']='Pause';break;case _0xd187('0x67'):_0x5a7a23['childModel']=_0xd187('0x68');break;case _0xd187('0x69'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6a');break;case _0xd187('0x6b'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6c');break;case _0xd187('0x6d'):_0x5a7a23[_0xd187('0x14')]='Template';break;case _0xd187('0x6e'):_0x5a7a23[_0xd187('0x14')]='Trigger';break;case _0xd187('0x6f'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x70');break;case'variables':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x71');break;case'plugins':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x72');break;case'extractedreports':_0x5a7a23[_0xd187('0x14')]='AnalyticExtractedReport';_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x73'),'field':'id','foreignKey':_0xd187('0x74')}];break;case _0xd187('0x75'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x76');break;}return _0x5a7a23;}function _0x1675d9(_0x4eddd5,_0xcef6ca){var _0x298b46=_0x4eddd5[_0xd187('0x77')](0x0)['toUpperCase']()+_0x4eddd5[_0xd187('0x78')](0x1);var _0x23428f={'type':_0x18498b[_0xd187('0x79')][_0xd187('0x7a')][_0xd187('0x7b')],'raw':!![]};return new Promise(function(_0x2c4f4d,_0x10ebf4){var _0x202f73=squel[_0xd187('0x7c')]()[_0xd187('0x6')](_0xd187('0x7d')+_0x298b46+_0xd187('0x7e'),'id')[_0xd187('0x6')](_0xd187('0x7f'))[_0xd187('0x80')](_0xd187('0x81')+_0x4eddd5+_0xd187('0x82'),'ui')[_0xd187('0x83')](_0xd187('0x84'),_0xcef6ca['id']);return _0x18498b[_0xd187('0x85')]['query'](_0x202f73[_0xd187('0x86')](),_0x23428f)['then'](function(_0x13d118){_0xcef6ca[_0x298b46+_0xd187('0x87')]=_0x13d118;_0x2c4f4d(_0x13d118);})[_0xd187('0xb')](function(_0x4225e6){_0x10ebf4(_0x4225e6);});});}return _0x1cb41f['define'](_0xd187('0x88'),attributes,{'tableName':_0xd187('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4f89a6){var _0x509815={'raw':![],'where':{}};var _0x3613ee={};var _0x2c2a62={'count':0x0,'rows':[]};var _0x2870ad=_0x4f89a6[_0xd187('0x8a')]['section'];var _0x2c1df4=_0x4f89a6['query'][_0xd187('0x8b')]||![];var _0x2f6a72=_0x2c07c8(_0x2870ad,_0x2c1df4);if(!_0x2f6a72[_0xd187('0x14')])throw new Error(_0xd187('0x8c')+_0x2870ad+'\x27');var _0x57cad7=[{'name':_0x2870ad}];if(!_[_0xd187('0x8d')](_0x2f6a72[_0xd187('0x17')]))_0x57cad7=_0x2f6a72[_0xd187('0x17')];var _0x9e82c=[];for(var _0x151f3c=0x0;_0x151f3c<_0x57cad7['length'];_0x151f3c++){_0x9e82c['push'](_0x18498b[_0xd187('0x8e')][_0xd187('0x8f')]({'where':{'userProfileId':_0x4f89a6[_0xd187('0x90')]['id'],'name':_0x57cad7[_0x151f3c][_0xd187('0xe')]},'raw':!![]}));}return Promise[_0xd187('0x91')](_0x9e82c)[_0xd187('0xd')](function(_0x2dccff){var _0x1291cc=_[_0xd187('0x5')](_0x2dccff,function(_0x3765b0){return _0x3765b0?_0x3765b0:undefined;});var _0x379e89=_[_0xd187('0x5')](_0x57cad7,['ignore',!![]]);var _0x35df1e=_[_0xd187('0x8d')](_0x1291cc)&&_['isEmpty'](_0x379e89)?null:_[_0xd187('0x92')](_0x379e89,_0x1291cc);if(!_0x35df1e)return null;var _0x1a9979=[];for(var _0x4bec3e=0x0;_0x4bec3e<_0x35df1e['length'];_0x4bec3e++){var _0x32ba2a=_[_0xd187('0x8f')](_0x57cad7,function(_0x2ac56f){return _0x35df1e[_0x4bec3e]?_0x2ac56f[_0xd187('0xe')]===_0x35df1e[_0x4bec3e]['name']:null;});if(_0x32ba2a){if(_0x35df1e[_0x4bec3e][_0xd187('0x93')]){_0x1a9979[_0xd187('0x94')](_0x58622a(_0x2f6a72['childModel'],_0x35df1e[_0x4bec3e]));}else{if(!_0x35df1e[_0x4bec3e]['autoAssociation']){_0x1a9979[_0xd187('0x94')](_0x52a208(_0x32ba2a,_0x35df1e[_0x4bec3e],_0x2f6a72['childModel']));}else{if(_0x32ba2a[_0xd187('0xc')]){_0x1a9979[_0xd187('0x94')](_0x2a61a4(_0x32ba2a,_0x35df1e[_0x4bec3e]));}}}}}return Promise['all'](_0x1a9979);})[_0xd187('0xd')](function(_0x570c1c){var _0x317bc3=_0x570c1c;var _0x4f2875=null;if(_0x317bc3){_0x4f2875=_0x317bc3['length']===0x1?_0x317bc3[0x0]:null;}if(!_0x4f2875&&!_0x317bc3)return _0x2c2a62;var _0x4a1988=_0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x95')];_0x3613ee[_0xd187('0xc')]=_[_0xd187('0x96')](_0x4a1988);_0x3613ee[_0xd187('0x8a')]=_[_0xd187('0x96')](_0x4f89a6[_0xd187('0x8a')]);_0x3613ee[_0xd187('0x97')]=_['intersection'](_0x3613ee[_0xd187('0xc')],_0x3613ee[_0xd187('0x8a')]);_0x509815[_0xd187('0x98')]=_['intersection'](_0x3613ee[_0xd187('0xc')],qs[_0xd187('0x99')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0x99')]));_0x509815['attributes']=_0x509815[_0xd187('0x98')][_0xd187('0x9a')]?_0x509815['attributes']:_0x3613ee[_0xd187('0xc')];if(!_0x4f89a6[_0xd187('0x8a')][_0xd187('0x9b')](_0xd187('0x9c'))){_0x509815['limit']=qs[_0xd187('0x9d')](_0x4f89a6[_0xd187('0x8a')]['limit']);_0x509815[_0xd187('0x9e')]=qs['offset'](_0x4f89a6['query']['offset']);}_0x509815[_0xd187('0x9f')]=qs[_0xd187('0xa0')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0xa0')]);_0x509815[_0xd187('0x83')]=qs[_0xd187('0x97')](_['pick'](_0x4f89a6[_0xd187('0x8a')],_0x3613ee[_0xd187('0x97')]));if(_0x4f89a6['query']['filter']){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$or':_[_0xd187('0xa')](_0x4a1988,function(_0x3fe450){if(_0x3fe450[_0xd187('0x34')]['key']!==_0xd187('0xa2')){var _0x134cc2={};_0x134cc2[_0x3fe450[_0xd187('0x6')]]={'$like':'%'+_0x4f89a6[_0xd187('0x8a')][_0xd187('0x5')]+'%'};return _0x134cc2;}})});}var _0x2879ff=[];var _0x1982cd=null;var _0x1e58d4={};if(_0x4f2875){_0x1982cd=_[_0xd187('0x8f')](_0x57cad7,[_0xd187('0xe'),_0x4f2875[_0xd187('0xe')]]);if(_0x1982cd[_0xd187('0x6')]){_0x1e58d4={};if(_0x2f6a72['childModel']==='AnalyticExtractedReport'){_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_[_0xd187('0xa')](_0x4f2875[_0xd187('0x9')],'id');}else{_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x4f2875[_0xd187('0x9')];}_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{_0x509815['where']['id']=_0x4f2875[_0xd187('0x9')];}}else{for(var _0x5541ef=0x0;_0x5541ef<_0x317bc3[_0xd187('0x9a')];_0x5541ef++){_0x1982cd=_['find'](_0x57cad7,['name',_0x317bc3[_0x5541ef][_0xd187('0xe')]]);if(_0x1982cd['field']){_0x1e58d4={};_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x317bc3[_0x5541ef][_0xd187('0x9')];_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{if(!_0x509815[_0xd187('0x83')]['id'])_0x509815[_0xd187('0x83')]['id']=[];_0x317bc3[_0x5541ef][_0xd187('0x9')][_0xd187('0xa4')](function(_0x37fd5a){_0x509815[_0xd187('0x83')]['id'][_0xd187('0x94')](_0x37fd5a);});}}}if(!_[_0xd187('0x8d')](_0x2879ff)){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$and':{'$or':_0x2879ff}});}_0x509815=_[_0xd187('0xa1')]({},_0x509815,_0x4f89a6['options']);if(_0x4f2875&&!_0x4f2875[_0xd187('0xa5')]&&_0x2f6a72[_0xd187('0x14')]===_0xd187('0x10')){if(_0x4f89a6[_0xd187('0x8a')]['includeAll']){_0x509815[_0xd187('0xa6')]=[{'all':!![]}];}return _0x18498b[_0x2f6a72[_0xd187('0x14')]]['findAll'](_0x509815)['then'](function(_0x20b680){var _0x3c993a=[];_0x20b680[_0xd187('0xa4')](function(_0x435fe8){var _0x371869;switch(_0x435fe8[_0xd187('0xa7')]){case'default':_0x371869=_[_0xd187('0x8f')](_0x4f2875[_0xd187('0x9')],function(_0x5b7870){return _0x5b7870['id']===_0x435fe8[_0xd187('0x74')]&&_0x5b7870[_0xd187('0x34')]===_0xd187('0xa8');});break;case _0xd187('0xa9'):_0x371869=_['find'](_0x4f2875['associatedResources'],function(_0x18d48d){return _0x18d48d['id']===_0x435fe8[_0xd187('0x74')]&&_0x18d48d[_0xd187('0x34')]==='CustomReports';});break;}if(_0x371869)_0x3c993a[_0xd187('0x94')](_0x435fe8);});_0x2c2a62[_0xd187('0xaa')]=_0x3c993a[_0xd187('0x9a')];_0x2c2a62[_0xd187('0xab')]=_0x3c993a;return _0x2c2a62;});}else{return _0x18498b[_0x2f6a72['childModel']][_0xd187('0xaa')]({'where':_0x509815['where']})['then'](function(_0x4a9310){_0x2c2a62['count']=_0x4a9310;if(_0x4f89a6['query']['includeAll']){if(_0x2f6a72['childModel']===_0xd187('0x1b')){_0x509815[_0xd187('0xa6')]=[{'model':_0x18498b['Tag'],'as':_0xd187('0xac'),'attributes':['id',_0xd187('0xe'),_0xd187('0xad')],'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]},{'model':_0x18498b['Tag'],'as':_0xd187('0xaf'),'attributes':['id','name',_0xd187('0xad')],'through':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?{'attributes':[],'where':{'TagId':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]||undefined}}:{},'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]}];}else{_0x509815['include']=[{'all':!![]}];}}return _0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x8')](_0x509815);})['then'](function(_0x2afb14){_0x2c2a62[_0xd187('0xab')]=_0x2afb14;if(_0x2870ad==='Agents'&&_0x4f89a6[_0xd187('0x8a')][_0xd187('0xb0')]===_0xd187('0xb1')){var _0x45b522=[];for(var _0x78604d=0x0;_0x78604d<_0x2c2a62[_0xd187('0xab')][_0xd187('0x9a')];_0x78604d++){_0x45b522[_0xd187('0x94')](_0x1675d9('chat',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb3'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9('fax',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9(_0xd187('0xb4'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb5'),_0x2c2a62[_0xd187('0xab')][_0x78604d]['dataValues']));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb6'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));}return Promise[_0xd187('0x91')](_0x45b522)[_0xd187('0xd')](function(){return _0x2c2a62;});}return _0x2c2a62;});}});}}});};
\ No newline at end of file
index bd84989..b0f6cc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaee6=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x3524be,_0x31c273){var _0xa068b5=function(_0x9f45dd){while(--_0x9f45dd){_0x3524be['push'](_0x3524be['shift']());}};_0xa068b5(++_0x31c273);}(_0xaee6,0x187));var _0x6aee=function(_0x2ada65,_0x44323c){_0x2ada65=_0x2ada65-0x0;var _0x3217fa=_0xaee6[_0x2ada65];return _0x3217fa;};'use strict';var _=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var moment=require(_0x6aee('0x2'));var BPromise=require(_0x6aee('0x3'));var rs=require(_0x6aee('0x4'));var fs=require('fs');var Redis=require(_0x6aee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6aee('0x6'));var logger=require(_0x6aee('0x7'))(_0x6aee('0x8'));var config=require('../../config/environment');var jayson=require(_0x6aee('0x9'));var client=jayson[_0x6aee('0xa')][_0x6aee('0xb')]({'port':0x232a});config[_0x6aee('0xc')]=_[_0x6aee('0xd')](config[_0x6aee('0xc')],{'host':_0x6aee('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6aee('0xf'))['register'](socket);function respondWithRpcPromise(_0x27a179,_0x2552ec,_0x1f81fa){return new BPromise(function(_0x57e596,_0xd99e94){return client[_0x6aee('0x10')](_0x27a179,_0x1f81fa)[_0x6aee('0x11')](function(_0x1092d9){logger['info'](_0x6aee('0x12'),_0x2552ec,'request\x20sent');logger[_0x6aee('0x13')](_0x6aee('0x14'),_0x2552ec,_0x6aee('0x15'),JSON[_0x6aee('0x16')](_0x1092d9));if(_0x1092d9[_0x6aee('0x17')]){if(_0x1092d9['error'][_0x6aee('0x18')]===0x1f4){logger[_0x6aee('0x17')]('UserProfile,\x20%s,\x20%s',_0x2552ec,_0x1092d9['error'][_0x6aee('0x19')]);return _0xd99e94(_0x1092d9[_0x6aee('0x17')][_0x6aee('0x19')]);}logger[_0x6aee('0x17')](_0x6aee('0x12'),_0x2552ec,_0x1092d9[_0x6aee('0x17')][_0x6aee('0x19')]);return _0x57e596(_0x1092d9[_0x6aee('0x17')]['message']);}else{logger[_0x6aee('0x1a')](_0x6aee('0x12'),_0x2552ec,'request\x20sent');_0x57e596(_0x1092d9[_0x6aee('0x1b')][_0x6aee('0x19')]);}})['catch'](function(_0x1848a9){logger[_0x6aee('0x17')](_0x6aee('0x12'),_0x2552ec,_0x1848a9);_0xd99e94(_0x1848a9);});});}
\ No newline at end of file
+var _0xa24d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./userProfile.socket','register','request','UserProfile,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa24d,0x1c1));var _0xda24=function(_0x22b2df,_0x59214b){_0x22b2df=_0x22b2df-0x0;var _0x3ddde7=_0xa24d[_0x22b2df];return _0x3ddde7;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));var BPromise=require(_0xda24('0x3'));var rs=require(_0xda24('0x4'));var fs=require('fs');var Redis=require(_0xda24('0x5'));var db=require(_0xda24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xda24('0x7'))(_0xda24('0x8'));var config=require(_0xda24('0x9'));var jayson=require(_0xda24('0xa'));var client=jayson['client'][_0xda24('0xb')]({'port':0x232a});config[_0xda24('0xc')]=_['defaults'](config[_0xda24('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xda24('0xd'))(new Redis(config[_0xda24('0xc')]));require(_0xda24('0xe'))[_0xda24('0xf')](socket);function respondWithRpcPromise(_0x54f108,_0x243fc8,_0x3374a7){return new BPromise(function(_0x22776c,_0x3a508b){return client[_0xda24('0x10')](_0x54f108,_0x3374a7)['then'](function(_0x32c867){logger['info'](_0xda24('0x11'),_0x243fc8,_0xda24('0x12'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x243fc8,_0xda24('0x12'),JSON[_0xda24('0x13')](_0x32c867));if(_0x32c867[_0xda24('0x14')]){if(_0x32c867[_0xda24('0x14')]['code']===0x1f4){logger[_0xda24('0x14')]('UserProfile,\x20%s,\x20%s',_0x243fc8,_0x32c867[_0xda24('0x14')][_0xda24('0x15')]);return _0x3a508b(_0x32c867['error']['message']);}logger[_0xda24('0x14')](_0xda24('0x11'),_0x243fc8,_0x32c867[_0xda24('0x14')][_0xda24('0x15')]);return _0x22776c(_0x32c867[_0xda24('0x14')][_0xda24('0x15')]);}else{logger[_0xda24('0x16')](_0xda24('0x11'),_0x243fc8,_0xda24('0x12'));_0x22776c(_0x32c867['result'][_0xda24('0x15')]);}})[_0xda24('0x17')](function(_0x52b393){logger[_0xda24('0x14')]('UserProfile,\x20%s,\x20%s',_0x243fc8,_0x52b393);_0x3a508b(_0x52b393);});});}
\ No newline at end of file
index 0400449..7418b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a94=['update','emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove'];(function(_0x8e4b05,_0x22653f){var _0x3e1701=function(_0x171d5e){while(--_0x171d5e){_0x8e4b05['push'](_0x8e4b05['shift']());}};_0x3e1701(++_0x22653f);}(_0x1a94,0x1da));var _0x41a9=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x1a94[_0x1cfa0d];return _0xe33279;};'use strict';var UserProfileEvents=require(_0x41a9('0x0'));var events=[_0x41a9('0x1'),_0x41a9('0x2'),_0x41a9('0x3')];function createListener(_0x4d98d4,_0x52b17f){return function(_0x206c2c){_0x52b17f[_0x41a9('0x4')](_0x4d98d4,_0x206c2c);};}function removeListener(_0x572e8c,_0x1da539){return function(){UserProfileEvents[_0x41a9('0x5')](_0x572e8c,_0x1da539);};}exports[_0x41a9('0x6')]=function(_0x30152c){for(var _0xd2f2d7=0x0,_0x5ed880=events[_0x41a9('0x7')];_0xd2f2d7<_0x5ed880;_0xd2f2d7++){var _0x44f840=events[_0xd2f2d7];var _0x420ad0=createListener(_0x41a9('0x8')+_0x44f840,_0x30152c);UserProfileEvents['on'](_0x44f840,_0x420ad0);}};
\ No newline at end of file
+var _0x5ef8=['emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x5ef8,0x176));var _0x85ef=function(_0x137f8f,_0x412ec2){_0x137f8f=_0x137f8f-0x0;var _0x35056e=_0x5ef8[_0x137f8f];return _0x35056e;};'use strict';var UserProfileEvents=require(_0x85ef('0x0'));var events=[_0x85ef('0x1'),_0x85ef('0x2'),_0x85ef('0x3')];function createListener(_0x1a8ec8,_0x4e3dea){return function(_0x49e812){_0x4e3dea[_0x85ef('0x4')](_0x1a8ec8,_0x49e812);};}function removeListener(_0x5909d6,_0x741d92){return function(){UserProfileEvents[_0x85ef('0x5')](_0x5909d6,_0x741d92);};}exports[_0x85ef('0x6')]=function(_0x2479e8){for(var _0x45e4c7=0x0,_0x6745f1=events[_0x85ef('0x7')];_0x45e4c7<_0x6745f1;_0x45e4c7++){var _0x3ad724=events[_0x45e4c7];var _0x4ac2db=createListener(_0x85ef('0x8')+_0x3ad724,_0x2479e8);UserProfileEvents['on'](_0x3ad724,_0x4ac2db);}};
\ No newline at end of file
index f97141f..da26349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe100=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','destroy','exports'];(function(_0x20e375,_0xdc0dde){var _0x55ac5d=function(_0x4a9b96){while(--_0x4a9b96){_0x20e375['push'](_0x20e375['shift']());}};_0x55ac5d(++_0xdc0dde);}(_0xe100,0x1a2));var _0x0e10=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe100[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0e10('0x0'));var util=require(_0x0e10('0x1'));var path=require(_0x0e10('0x2'));var timeout=require(_0x0e10('0x3'));var express=require(_0x0e10('0x4'));var router=express['Router']();var fs_extra=require(_0x0e10('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0e10('0x6'));var config=require(_0x0e10('0x7'));var controller=require('./userProfileResource.controller');router[_0x0e10('0x8')]('/',auth[_0x0e10('0x9')](),controller[_0x0e10('0xa')]);router[_0x0e10('0x8')](_0x0e10('0xb'),auth['isAuthenticated'](),controller[_0x0e10('0xc')]);router[_0x0e10('0x8')](_0x0e10('0xd'),auth[_0x0e10('0x9')](),controller[_0x0e10('0xe')]);router[_0x0e10('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0e10('0x10')](_0x0e10('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0e10('0xd'),auth[_0x0e10('0x9')](),controller[_0x0e10('0x11')]);module[_0x0e10('0x12')]=router;
\ No newline at end of file
+var _0x7453=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','destroy','multer','connect-timeout','Router'];(function(_0x4afc2c,_0x336a88){var _0x164084=function(_0x14b783){while(--_0x14b783){_0x4afc2c['push'](_0x4afc2c['shift']());}};_0x164084(++_0x336a88);}(_0x7453,0x1e3));var _0x3745=function(_0x5cc255,_0x345bd7){_0x5cc255=_0x5cc255-0x0;var _0x417e36=_0x7453[_0x5cc255];return _0x417e36;};'use strict';var multer=require(_0x3745('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3745('0x1'));var express=require('express');var router=express[_0x3745('0x2')]();var fs_extra=require(_0x3745('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3745('0x4'));var config=require(_0x3745('0x5'));var controller=require(_0x3745('0x6'));router[_0x3745('0x7')]('/',auth[_0x3745('0x8')](),controller[_0x3745('0x9')]);router[_0x3745('0x7')](_0x3745('0xa'),auth[_0x3745('0x8')](),controller[_0x3745('0xb')]);router[_0x3745('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3745('0xc')]);router['post']('/',auth[_0x3745('0x8')](),controller[_0x3745('0xd')]);router[_0x3745('0xe')](_0x3745('0xf'),auth[_0x3745('0x8')](),controller[_0x3745('0x10')]);router['delete'](_0x3745('0xf'),auth[_0x3745('0x8')](),controller[_0x3745('0x11')]);module['exports']=router;
\ No newline at end of file
index 08cfa00..e23582d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfae3=['INTEGER','STRING','sequelize','exports'];(function(_0x4094f1,_0x3b16c6){var _0x40b88c=function(_0x1fdb23){while(--_0x1fdb23){_0x4094f1['push'](_0x4094f1['shift']());}};_0x40b88c(++_0x3b16c6);}(_0xfae3,0x19a));var _0x3fae=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0xfae3[_0x16db8b];return _0x5ba017;};'use strict';var Sequelize=require(_0x3fae('0x0'));module[_0x3fae('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3fae('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3fae('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0xe821=['exports','STRING','sequelize'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xe821,0xd7));var _0x1e82=function(_0x2ca57d,_0x4eabd9){_0x2ca57d=_0x2ca57d-0x0;var _0xe99fdf=_0xe821[_0x2ca57d];return _0xe99fdf;};'use strict';var Sequelize=require(_0x1e82('0x0'));module[_0x1e82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x1e82('0x2')],'allowNull':![]}};
\ No newline at end of file
index c2b292a..dd4bb07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x41322b,_0x3021b5){var _0x2af862=function(_0x1691e4){while(--_0x1691e4){_0x41322b['push'](_0x41322b['shift']());}};_0x2af862(++_0x3021b5);}(_0x524e,0x15e));var _0xe524=function(_0x10112c,_0x4dd140){_0x10112c=_0x10112c-0x0;var _0x25e536=_0x524e[_0x10112c];return _0x25e536;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['UserProfileResource'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['UserProfileResource'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['UserProfileResource'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));};
\ No newline at end of file
+var _0x6343=['VIRTUAL','options','UserProfileResource','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x6343,0x168));var _0x3634=function(_0x56500f,_0x3f35bd){_0x56500f=_0x56500f-0x0;var _0x357f57=_0x6343[_0x56500f];return _0x357f57;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['UserProfileResource'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['UserProfileResource'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));};
\ No newline at end of file
index 7006e4c..96a9a9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dfe=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','sectionId','lodash','util'];(function(_0x4b8e98,_0x6cb034){var _0x3577b2=function(_0x3d6f95){while(--_0x3d6f95){_0x4b8e98['push'](_0x4b8e98['shift']());}};_0x3577b2(++_0x6cb034);}(_0x4dfe,0x148));var _0xe4df=function(_0x1b919d,_0x20a8e3){_0x1b919d=_0x1b919d-0x0;var _0x4b5131=_0x4dfe[_0x1b919d];return _0x4b5131;};'use strict';var _=require(_0xe4df('0x0'));var util=require(_0xe4df('0x1'));var logger=require(_0xe4df('0x2'))('api');var moment=require(_0xe4df('0x3'));var BPromise=require(_0xe4df('0x4'));var rp=require(_0xe4df('0x5'));var fs=require('fs');var path=require(_0xe4df('0x6'));var rimraf=require(_0xe4df('0x7'));var config=require(_0xe4df('0x8'));var attributes=require(_0xe4df('0x9'));module[_0xe4df('0xa')]=function(_0x304ad5,_0x573b5e){return _0x304ad5[_0xe4df('0xb')](_0xe4df('0xc'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xe4df('0xd'),'fields':['resourceId',_0xe4df('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbe1=['path','rimraf','../../config/environment','./userProfileResource.attributes','exports','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','bluebird','request-promise'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xdbe1,0xed));var _0x1dbe=function(_0x4fcd48,_0x125ff3){_0x4fcd48=_0x4fcd48-0x0;var _0x18005d=_0xdbe1[_0x4fcd48];return _0x18005d;};'use strict';var _=require(_0x1dbe('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1dbe('0x1'));var rp=require(_0x1dbe('0x2'));var fs=require('fs');var path=require(_0x1dbe('0x3'));var rimraf=require(_0x1dbe('0x4'));var config=require(_0x1dbe('0x5'));var attributes=require(_0x1dbe('0x6'));module[_0x1dbe('0x7')]=function(_0x361c83,_0x3c62f7){return _0x361c83['define']('UserProfileResource',attributes,{'tableName':_0x1dbe('0x8'),'paranoid':![],'indexes':[{'name':_0x1dbe('0x9'),'fields':[_0x1dbe('0xa'),_0x1dbe('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index e7e8859..139a563 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a8e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','randomstring','ioredis'];(function(_0xef679d,_0x2ee19f){var _0x579b91=function(_0x9fa1ba){while(--_0x9fa1ba){_0xef679d['push'](_0xef679d['shift']());}};_0x579b91(++_0x2ee19f);}(_0x3a8e,0x1b1));var _0xe3a8=function(_0x2c7f80,_0x5da68e){_0x2c7f80=_0x2c7f80-0x0;var _0x413d06=_0x3a8e[_0x2c7f80];return _0x413d06;};'use strict';var _=require(_0xe3a8('0x0'));var util=require(_0xe3a8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe3a8('0x2'));var fs=require('fs');var Redis=require(_0xe3a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3a8('0x4'));var logger=require(_0xe3a8('0x5'))(_0xe3a8('0x6'));var config=require(_0xe3a8('0x7'));var jayson=require(_0xe3a8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10fbcb,_0x4e7dcd,_0x27b547){return new BPromise(function(_0x313ea0,_0x2e3890){return client[_0xe3a8('0x9')](_0x10fbcb,_0x27b547)[_0xe3a8('0xa')](function(_0x3b323c){logger[_0xe3a8('0xb')](_0xe3a8('0xc'),_0x4e7dcd,_0xe3a8('0xd'));logger[_0xe3a8('0xe')](_0xe3a8('0xf'),_0x4e7dcd,_0xe3a8('0xd'),JSON['stringify'](_0x3b323c));if(_0x3b323c[_0xe3a8('0x10')]){if(_0x3b323c[_0xe3a8('0x10')]['code']===0x1f4){logger[_0xe3a8('0x10')](_0xe3a8('0xc'),_0x4e7dcd,_0x3b323c[_0xe3a8('0x10')]['message']);return _0x2e3890(_0x3b323c[_0xe3a8('0x10')][_0xe3a8('0x11')]);}logger[_0xe3a8('0x10')](_0xe3a8('0xc'),_0x4e7dcd,_0x3b323c['error'][_0xe3a8('0x11')]);return _0x313ea0(_0x3b323c[_0xe3a8('0x10')][_0xe3a8('0x11')]);}else{logger[_0xe3a8('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x4e7dcd,_0xe3a8('0xd'));_0x313ea0(_0x3b323c['result'][_0xe3a8('0x11')]);}})[_0xe3a8('0x12')](function(_0x4e0fc5){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x4e7dcd,_0x4e0fc5);_0x2e3890(_0x4e0fc5);});});}
\ No newline at end of file
+var _0x1b5c=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x1b5c,0x105));var _0xc1b5=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x1b5c[_0x34e752];return _0x7c6347;};'use strict';var _=require('lodash');var util=require(_0xc1b5('0x0'));var moment=require(_0xc1b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xc1b5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1b5('0x3'))['db'];var utils=require(_0xc1b5('0x4'));var logger=require(_0xc1b5('0x5'))(_0xc1b5('0x6'));var config=require(_0xc1b5('0x7'));var jayson=require(_0xc1b5('0x8'));var client=jayson[_0xc1b5('0x9')][_0xc1b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8fb495,_0x3f77dd,_0x32a25d){return new BPromise(function(_0x33b41b,_0x43c98e){return client[_0xc1b5('0xb')](_0x8fb495,_0x32a25d)[_0xc1b5('0xc')](function(_0x3f862b){logger[_0xc1b5('0xd')](_0xc1b5('0xe'),_0x3f77dd,_0xc1b5('0xf'));logger[_0xc1b5('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3f77dd,_0xc1b5('0xf'),JSON[_0xc1b5('0x11')](_0x3f862b));if(_0x3f862b['error']){if(_0x3f862b[_0xc1b5('0x12')][_0xc1b5('0x13')]===0x1f4){logger[_0xc1b5('0x12')](_0xc1b5('0xe'),_0x3f77dd,_0x3f862b['error'][_0xc1b5('0x14')]);return _0x43c98e(_0x3f862b['error'][_0xc1b5('0x14')]);}logger[_0xc1b5('0x12')](_0xc1b5('0xe'),_0x3f77dd,_0x3f862b['error'][_0xc1b5('0x14')]);return _0x33b41b(_0x3f862b[_0xc1b5('0x12')][_0xc1b5('0x14')]);}else{logger['info'](_0xc1b5('0xe'),_0x3f77dd,'request\x20sent');_0x33b41b(_0x3f862b[_0xc1b5('0x15')][_0xc1b5('0x14')]);}})[_0xc1b5('0x16')](function(_0x2f48d3){logger[_0xc1b5('0x12')](_0xc1b5('0xe'),_0x3f77dd,_0x2f48d3);_0x43c98e(_0x2f48d3);});});}
\ No newline at end of file
index 913c47a..52cc8bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf23b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x4bf4a1,_0xaf7845){var _0x588de8=function(_0x12e036){while(--_0x12e036){_0x4bf4a1['push'](_0x4bf4a1['shift']());}};_0x588de8(++_0xaf7845);}(_0xf23b,0x1bf));var _0xbf23=function(_0x1d73da,_0x44729d){_0x1d73da=_0x1d73da-0x0;var _0x4677ea=_0xf23b[_0x1d73da];return _0x4677ea;};'use strict';var multer=require(_0xbf23('0x0'));var util=require(_0xbf23('0x1'));var path=require(_0xbf23('0x2'));var timeout=require(_0xbf23('0x3'));var express=require(_0xbf23('0x4'));var router=express[_0xbf23('0x5')]();var fs_extra=require(_0xbf23('0x6'));var auth=require(_0xbf23('0x7'));var interaction=require(_0xbf23('0x8'));var config=require(_0xbf23('0x9'));var controller=require(_0xbf23('0xa'));router[_0xbf23('0xb')]('/',auth[_0xbf23('0xc')](),controller[_0xbf23('0xd')]);router[_0xbf23('0xb')](_0xbf23('0xe'),auth['isAuthenticated'](),controller[_0xbf23('0xf')]);router[_0xbf23('0xb')]('/:id',auth[_0xbf23('0xc')](),controller[_0xbf23('0x10')]);router[_0xbf23('0x11')]('/',auth[_0xbf23('0xc')](),controller[_0xbf23('0x12')]);router[_0xbf23('0x13')](_0xbf23('0x14'),auth['isAuthenticated'](),controller[_0xbf23('0x15')]);router[_0xbf23('0x16')](_0xbf23('0x14'),auth[_0xbf23('0xc')](),controller[_0xbf23('0x17')]);module[_0xbf23('0x18')]=router;
\ No newline at end of file
+var _0x0824=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0824,0x160));var _0x4082=function(_0x5c0598,_0x46fd74){_0x5c0598=_0x5c0598-0x0;var _0x2ba2cb=_0x0824[_0x5c0598];return _0x2ba2cb;};'use strict';var multer=require(_0x4082('0x0'));var util=require(_0x4082('0x1'));var path=require(_0x4082('0x2'));var timeout=require(_0x4082('0x3'));var express=require(_0x4082('0x4'));var router=express['Router']();var fs_extra=require(_0x4082('0x5'));var auth=require(_0x4082('0x6'));var interaction=require(_0x4082('0x7'));var config=require(_0x4082('0x8'));var controller=require('./userProfileSection.controller');router[_0x4082('0x9')]('/',auth[_0x4082('0xa')](),controller['index']);router[_0x4082('0x9')](_0x4082('0xb'),auth[_0x4082('0xa')](),controller[_0x4082('0xc')]);router['get']('/:id',auth[_0x4082('0xa')](),controller[_0x4082('0xd')]);router[_0x4082('0xe')]('/',auth['isAuthenticated'](),controller[_0x4082('0xf')]);router[_0x4082('0x10')](_0x4082('0x11'),auth['isAuthenticated'](),controller[_0x4082('0x12')]);router[_0x4082('0x13')](_0x4082('0x11'),auth[_0x4082('0xa')](),controller[_0x4082('0x14')]);module[_0x4082('0x15')]=router;
\ No newline at end of file
index 0d3ee7d..7ae0228 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93e9=['crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x26fb37,_0x4ee737){var _0x3591d3=function(_0x50a562){while(--_0x50a562){_0x26fb37['push'](_0x26fb37['shift']());}};_0x3591d3(++_0x4ee737);}(_0x93e9,0xcc));var _0x993e=function(_0x22123d,_0x45ae06){_0x22123d=_0x22123d-0x0;var _0xeabce1=_0x93e9[_0x22123d];return _0xeabce1;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x993e('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x993e('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x993e('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x55f739){this[_0x993e('0x5')](_0x993e('0x6'),_0x55f739?_0x55f739[_0x993e('0x7')](''):[]);},'get':function(){return this[_0x993e('0x8')](_0x993e('0x6'))?this[_0x993e('0x8')](_0x993e('0x6'))[_0x993e('0x9')](''):[];}}};
\ No newline at end of file
+var _0x97c1=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x1da32d,_0x231aea){var _0x26e82f=function(_0x5e155c){while(--_0x5e155c){_0x1da32d['push'](_0x1da32d['shift']());}};_0x26e82f(++_0x231aea);}(_0x97c1,0xdf));var _0x197c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x97c1[_0x21a9d9];return _0x46adce;};'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
index 5a191c5..deb00f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e64=['findAll','rows','catch','show','params','model','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','includeAll','include'];(function(_0x277226,_0x766331){var _0x5a7542=function(_0x676f0f){while(--_0x676f0f){_0x277226['push'](_0x277226['shift']());}};_0x5a7542(++_0x766331);}(_0x9e64,0x17d));var _0x49e6=function(_0x22d1c1,_0x54226a){_0x22d1c1=_0x22d1c1-0x0;var _0x35e13b=_0x9e64[_0x22d1c1];return _0x35e13b;};'use strict';var emlformat=require(_0x49e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49e6('0x1'));var jsonpatch=require(_0x49e6('0x2'));var rp=require(_0x49e6('0x3'));var moment=require(_0x49e6('0x4'));var BPromise=require(_0x49e6('0x5'));var Mustache=require(_0x49e6('0x6'));var util=require(_0x49e6('0x7'));var path=require('path');var sox=require(_0x49e6('0x8'));var csv=require('to-csv');var ejs=require(_0x49e6('0x9'));var fs=require('fs');var fs_extra=require(_0x49e6('0xa'));var _=require(_0x49e6('0xb'));var squel=require(_0x49e6('0xc'));var crypto=require(_0x49e6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x49e6('0xe'));var toCsv=require(_0x49e6('0xf'));var querystring=require(_0x49e6('0x10'));var Papa=require('papaparse');var Redis=require(_0x49e6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x49e6('0x12'));var as=require(_0x49e6('0x13'));var hardwareService=require(_0x49e6('0x14'));var logger=require(_0x49e6('0x15'))(_0x49e6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49e6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f2355,_0x540340){_0x540340=_0x540340||0xcc;return function(_0x318670){if(_0x318670){return _0x1f2355[_0x49e6('0x18')](_0x540340);}return _0x1f2355['status'](_0x540340)['end']();};}function respondWithResult(_0x32e783,_0x33822b){_0x33822b=_0x33822b||0xc8;return function(_0x5df2a6){if(_0x5df2a6){return _0x32e783[_0x49e6('0x19')](_0x33822b)[_0x49e6('0x1a')](_0x5df2a6);}};}function respondWithFilteredResult(_0x178f86,_0x48cf93){return function(_0x3647ad){if(_0x3647ad){var _0x23d3ef=typeof _0x48cf93[_0x49e6('0x1b')]===_0x49e6('0x1c')&&typeof _0x48cf93['limit']==='undefined';var _0x545ff6=_0x3647ad['count'];var _0x5928a5=_0x23d3ef?0x0:_0x48cf93[_0x49e6('0x1b')];var _0x4ef307=_0x23d3ef?_0x3647ad[_0x49e6('0x1d')]:_0x48cf93[_0x49e6('0x1b')]+_0x48cf93[_0x49e6('0x1e')];var _0x1504a5;if(_0x4ef307>=_0x545ff6){_0x4ef307=_0x545ff6;_0x1504a5=0xc8;}else{_0x1504a5=0xce;}_0x178f86['status'](_0x1504a5);return _0x178f86[_0x49e6('0x1f')](_0x49e6('0x20'),_0x5928a5+'-'+_0x4ef307+'/'+_0x545ff6)['json'](_0x3647ad);}return null;};}function patchUpdates(_0x3028e1){return function(_0x3aa090){try{jsonpatch[_0x49e6('0x21')](_0x3aa090,_0x3028e1,!![]);}catch(_0x1c27de){return BPromise[_0x49e6('0x22')](_0x1c27de);}return _0x3aa090['save']();};}function saveUpdates(_0x39a736,_0x20e41c){return function(_0x397ac9){if(_0x397ac9){return _0x397ac9[_0x49e6('0x23')](_0x39a736)[_0x49e6('0x24')](function(_0x4fe8bc){return _0x4fe8bc;});}return null;};}function removeEntity(_0x24e3a1,_0x55aaa5){return function(_0x13cc3c){if(_0x13cc3c){return _0x13cc3c['destroy']()[_0x49e6('0x24')](function(){_0x24e3a1[_0x49e6('0x19')](0xcc)[_0x49e6('0x25')]();});}};}function handleEntityNotFound(_0xd49ee1,_0x2c6edd){return function(_0x22180a){if(!_0x22180a){_0xd49ee1[_0x49e6('0x18')](0x194);}return _0x22180a;};}function handleError(_0x183392,_0x508c61){_0x508c61=_0x508c61||0x1f4;return function(_0x33ba57){logger[_0x49e6('0x26')](_0x33ba57[_0x49e6('0x27')]);if(_0x33ba57[_0x49e6('0x28')]){delete _0x33ba57['name'];}_0x183392[_0x49e6('0x19')](_0x508c61)[_0x49e6('0x29')](_0x33ba57);};}exports[_0x49e6('0x2a')]=function(_0x267ffe,_0x29dc68){var _0x5da3d1={},_0x17990c={},_0x3ac1a1={'count':0x0,'rows':[]};var _0x5ed717=_[_0x49e6('0x2b')](db[_0x49e6('0x2c')][_0x49e6('0x2d')],function(_0x2fa217){return{'name':_0x2fa217[_0x49e6('0x2e')],'type':_0x2fa217['type'][_0x49e6('0x2f')]};});_0x17990c['model']=_[_0x49e6('0x2b')](_0x5ed717,_0x49e6('0x28'));_0x17990c[_0x49e6('0x30')]=_[_0x49e6('0x31')](_0x267ffe[_0x49e6('0x30')]);_0x17990c[_0x49e6('0x32')]=_[_0x49e6('0x33')](_0x17990c['model'],_0x17990c['query']);_0x5da3d1[_0x49e6('0x34')]=_[_0x49e6('0x33')](_0x17990c['model'],qs[_0x49e6('0x35')](_0x267ffe[_0x49e6('0x30')][_0x49e6('0x35')]));_0x5da3d1['attributes']=_0x5da3d1[_0x49e6('0x34')][_0x49e6('0x36')]?_0x5da3d1[_0x49e6('0x34')]:_0x17990c['model'];if(!_0x267ffe[_0x49e6('0x30')]['hasOwnProperty']('nolimit')){_0x5da3d1[_0x49e6('0x1e')]=qs['limit'](_0x267ffe['query'][_0x49e6('0x1e')]);_0x5da3d1[_0x49e6('0x1b')]=qs[_0x49e6('0x1b')](_0x267ffe[_0x49e6('0x30')][_0x49e6('0x1b')]);}_0x5da3d1['order']=qs['sort'](_0x267ffe['query'][_0x49e6('0x37')]);_0x5da3d1[_0x49e6('0x38')]=qs[_0x49e6('0x32')](_['pick'](_0x267ffe[_0x49e6('0x30')],_0x17990c[_0x49e6('0x32')]),_0x5ed717);if(_0x267ffe[_0x49e6('0x30')][_0x49e6('0x39')]){_0x5da3d1[_0x49e6('0x38')]=_[_0x49e6('0x3a')](_0x5da3d1[_0x49e6('0x38')],{'$or':_[_0x49e6('0x2b')](_0x5ed717,function(_0xbb0354){if(_0xbb0354[_0x49e6('0x3b')]!==_0x49e6('0x3c')){var _0x4d16a2={};_0x4d16a2[_0xbb0354[_0x49e6('0x28')]]={'$like':'%'+_0x267ffe[_0x49e6('0x30')]['filter']+'%'};return _0x4d16a2;}})});}_0x5da3d1=_[_0x49e6('0x3a')]({},_0x5da3d1,_0x267ffe['options']);var _0x27aac6={'where':_0x5da3d1[_0x49e6('0x38')]};return db[_0x49e6('0x2c')][_0x49e6('0x1d')](_0x27aac6)[_0x49e6('0x24')](function(_0x4aa9e9){_0x3ac1a1[_0x49e6('0x1d')]=_0x4aa9e9;if(_0x267ffe['query'][_0x49e6('0x3d')]){_0x5da3d1[_0x49e6('0x3e')]=[{'all':!![]}];}return db[_0x49e6('0x2c')][_0x49e6('0x3f')](_0x5da3d1);})[_0x49e6('0x24')](function(_0x1d073f){_0x3ac1a1[_0x49e6('0x40')]=_0x1d073f;return _0x3ac1a1;})[_0x49e6('0x24')](respondWithFilteredResult(_0x29dc68,_0x5da3d1))[_0x49e6('0x41')](handleError(_0x29dc68,null));};exports[_0x49e6('0x42')]=function(_0x532632,_0x295df6){var _0xad8e21={'raw':![],'where':{'id':_0x532632[_0x49e6('0x43')]['id']}},_0x581654={};_0x581654['model']=_[_0x49e6('0x31')](db[_0x49e6('0x2c')][_0x49e6('0x2d')]);_0x581654[_0x49e6('0x30')]=_[_0x49e6('0x31')](_0x532632[_0x49e6('0x30')]);_0x581654[_0x49e6('0x32')]=_['intersection'](_0x581654[_0x49e6('0x44')],_0x581654[_0x49e6('0x30')]);_0xad8e21[_0x49e6('0x34')]=_[_0x49e6('0x33')](_0x581654[_0x49e6('0x44')],qs['fields'](_0x532632[_0x49e6('0x30')]['fields']));_0xad8e21[_0x49e6('0x34')]=_0xad8e21['attributes'][_0x49e6('0x36')]?_0xad8e21[_0x49e6('0x34')]:_0x581654[_0x49e6('0x44')];if(_0x532632[_0x49e6('0x30')][_0x49e6('0x3d')]){_0xad8e21[_0x49e6('0x3e')]=[{'all':!![]}];}_0xad8e21=_[_0x49e6('0x3a')]({},_0xad8e21,_0x532632[_0x49e6('0x45')]);return db['UserProfileSection']['find'](_0xad8e21)[_0x49e6('0x24')](handleEntityNotFound(_0x295df6,null))[_0x49e6('0x24')](respondWithResult(_0x295df6,null))[_0x49e6('0x41')](handleError(_0x295df6,null));};exports[_0x49e6('0x46')]=function(_0x2c70ff,_0x17f091){return db[_0x49e6('0x2c')][_0x49e6('0x46')](_0x2c70ff[_0x49e6('0x47')],{})[_0x49e6('0x24')](respondWithResult(_0x17f091,0xc9))[_0x49e6('0x41')](handleError(_0x17f091,null));};exports[_0x49e6('0x23')]=function(_0x4b31c8,_0x3257a2){if(_0x4b31c8[_0x49e6('0x47')]['id']){delete _0x4b31c8['body']['id'];}return db[_0x49e6('0x2c')][_0x49e6('0x48')]({'where':{'id':_0x4b31c8['params']['id']}})['then'](handleEntityNotFound(_0x3257a2,null))['then'](saveUpdates(_0x4b31c8[_0x49e6('0x47')],null))[_0x49e6('0x24')](respondWithResult(_0x3257a2,null))[_0x49e6('0x41')](handleError(_0x3257a2,null));};exports['destroy']=function(_0x5d36d4,_0x5acce1){return db[_0x49e6('0x2c')][_0x49e6('0x48')]({'where':{'id':_0x5d36d4[_0x49e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x5acce1,null))[_0x49e6('0x24')](removeEntity(_0x5acce1,null))[_0x49e6('0x41')](handleError(_0x5acce1,null));};exports[_0x49e6('0x49')]=function(_0xc241e3,_0x58408e){return db[_0x49e6('0x2c')]['describe']()['then'](respondWithResult(_0x58408e,null))['catch'](handleError(_0x58408e,null));};
\ No newline at end of file
+var _0xbe60=['catch','find','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','stack','send','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','show','params','create','body'];(function(_0x12e4c7,_0x849a6){var _0x299805=function(_0x26c863){while(--_0x26c863){_0x12e4c7['push'](_0x12e4c7['shift']());}};_0x299805(++_0x849a6);}(_0xbe60,0xd6));var _0x0be6=function(_0x17dab3,_0x3bab88){_0x17dab3=_0x17dab3-0x0;var _0x192c74=_0xbe60[_0x17dab3];return _0x192c74;};'use strict';var emlformat=require(_0x0be6('0x0'));var rimraf=require(_0x0be6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0be6('0x2'));var rp=require('request-promise');var moment=require(_0x0be6('0x3'));var BPromise=require(_0x0be6('0x4'));var Mustache=require(_0x0be6('0x5'));var util=require(_0x0be6('0x6'));var path=require(_0x0be6('0x7'));var sox=require(_0x0be6('0x8'));var csv=require(_0x0be6('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(_0x0be6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0be6('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0be6('0xc'));var Papa=require(_0x0be6('0xd'));var Redis=require('ioredis');var authService=require(_0x0be6('0xe'));var qs=require(_0x0be6('0xf'));var as=require(_0x0be6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0be6('0x11'))(_0x0be6('0x12'));var utils=require(_0x0be6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c9322,_0x104876){_0x104876=_0x104876||0xcc;return function(_0x84e489){if(_0x84e489){return _0x3c9322[_0x0be6('0x14')](_0x104876);}return _0x3c9322[_0x0be6('0x15')](_0x104876)[_0x0be6('0x16')]();};}function respondWithResult(_0x24d576,_0x2efd12){_0x2efd12=_0x2efd12||0xc8;return function(_0xba1f50){if(_0xba1f50){return _0x24d576['status'](_0x2efd12)[_0x0be6('0x17')](_0xba1f50);}};}function respondWithFilteredResult(_0x31469c,_0xdf597){return function(_0x4df642){if(_0x4df642){var _0xb04ad0=typeof _0xdf597[_0x0be6('0x18')]==='undefined'&&typeof _0xdf597[_0x0be6('0x19')]===_0x0be6('0x1a');var _0xe3e551=_0x4df642[_0x0be6('0x1b')];var _0x15bee6=_0xb04ad0?0x0:_0xdf597[_0x0be6('0x18')];var _0x38b737=_0xb04ad0?_0x4df642['count']:_0xdf597[_0x0be6('0x18')]+_0xdf597['limit'];var _0x492ad7;if(_0x38b737>=_0xe3e551){_0x38b737=_0xe3e551;_0x492ad7=0xc8;}else{_0x492ad7=0xce;}_0x31469c[_0x0be6('0x15')](_0x492ad7);return _0x31469c[_0x0be6('0x1c')](_0x0be6('0x1d'),_0x15bee6+'-'+_0x38b737+'/'+_0xe3e551)[_0x0be6('0x17')](_0x4df642);}return null;};}function patchUpdates(_0xc9dbd5){return function(_0x9d928b){try{jsonpatch[_0x0be6('0x1e')](_0x9d928b,_0xc9dbd5,!![]);}catch(_0x2833ea){return BPromise[_0x0be6('0x1f')](_0x2833ea);}return _0x9d928b['save']();};}function saveUpdates(_0x78b1ff,_0x30e37a){return function(_0x2bca92){if(_0x2bca92){return _0x2bca92['update'](_0x78b1ff)[_0x0be6('0x20')](function(_0x281de0){return _0x281de0;});}return null;};}function removeEntity(_0x556674,_0x26eebf){return function(_0x24ccbd){if(_0x24ccbd){return _0x24ccbd['destroy']()[_0x0be6('0x20')](function(){_0x556674['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42fd27,_0x5c9a80){return function(_0x402262){if(!_0x402262){_0x42fd27['sendStatus'](0x194);}return _0x402262;};}function handleError(_0x33f9fc,_0x5f443c){_0x5f443c=_0x5f443c||0x1f4;return function(_0x5de113){logger['error'](_0x5de113[_0x0be6('0x21')]);if(_0x5de113['name']){delete _0x5de113['name'];}_0x33f9fc[_0x0be6('0x15')](_0x5f443c)[_0x0be6('0x22')](_0x5de113);};}exports[_0x0be6('0x23')]=function(_0xe3e239,_0x5d4eb8){var _0xad94e3={},_0x2bd8e1={},_0x289a10={'count':0x0,'rows':[]};var _0x1b289b=_[_0x0be6('0x24')](db[_0x0be6('0x25')][_0x0be6('0x26')],function(_0x50d88f){return{'name':_0x50d88f['fieldName'],'type':_0x50d88f[_0x0be6('0x27')][_0x0be6('0x28')]};});_0x2bd8e1[_0x0be6('0x29')]=_[_0x0be6('0x24')](_0x1b289b,'name');_0x2bd8e1[_0x0be6('0x2a')]=_[_0x0be6('0x2b')](_0xe3e239[_0x0be6('0x2a')]);_0x2bd8e1[_0x0be6('0x2c')]=_[_0x0be6('0x2d')](_0x2bd8e1[_0x0be6('0x29')],_0x2bd8e1[_0x0be6('0x2a')]);_0xad94e3[_0x0be6('0x2e')]=_[_0x0be6('0x2d')](_0x2bd8e1['model'],qs[_0x0be6('0x2f')](_0xe3e239[_0x0be6('0x2a')]['fields']));_0xad94e3[_0x0be6('0x2e')]=_0xad94e3[_0x0be6('0x2e')][_0x0be6('0x30')]?_0xad94e3[_0x0be6('0x2e')]:_0x2bd8e1[_0x0be6('0x29')];if(!_0xe3e239['query'][_0x0be6('0x31')](_0x0be6('0x32'))){_0xad94e3[_0x0be6('0x19')]=qs[_0x0be6('0x19')](_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x19')]);_0xad94e3[_0x0be6('0x18')]=qs[_0x0be6('0x18')](_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x18')]);}_0xad94e3['order']=qs[_0x0be6('0x33')](_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x33')]);_0xad94e3[_0x0be6('0x34')]=qs[_0x0be6('0x2c')](_[_0x0be6('0x35')](_0xe3e239[_0x0be6('0x2a')],_0x2bd8e1[_0x0be6('0x2c')]),_0x1b289b);if(_0xe3e239[_0x0be6('0x2a')]['filter']){_0xad94e3[_0x0be6('0x34')]=_['merge'](_0xad94e3[_0x0be6('0x34')],{'$or':_[_0x0be6('0x24')](_0x1b289b,function(_0x23874f){if(_0x23874f[_0x0be6('0x27')]!==_0x0be6('0x36')){var _0x18187c={};_0x18187c[_0x23874f[_0x0be6('0x37')]]={'$like':'%'+_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x38')]+'%'};return _0x18187c;}})});}_0xad94e3=_['merge']({},_0xad94e3,_0xe3e239[_0x0be6('0x39')]);var _0x2a6986={'where':_0xad94e3['where']};return db['UserProfileSection'][_0x0be6('0x1b')](_0x2a6986)[_0x0be6('0x20')](function(_0x43ca93){_0x289a10['count']=_0x43ca93;if(_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x3a')]){_0xad94e3[_0x0be6('0x3b')]=[{'all':!![]}];}return db[_0x0be6('0x25')][_0x0be6('0x3c')](_0xad94e3);})[_0x0be6('0x20')](function(_0xca2a60){_0x289a10[_0x0be6('0x3d')]=_0xca2a60;return _0x289a10;})['then'](respondWithFilteredResult(_0x5d4eb8,_0xad94e3))['catch'](handleError(_0x5d4eb8,null));};exports[_0x0be6('0x3e')]=function(_0x3b204e,_0xf75184){var _0xf23d0b={'raw':![],'where':{'id':_0x3b204e[_0x0be6('0x3f')]['id']}},_0x269a65={};_0x269a65[_0x0be6('0x29')]=_[_0x0be6('0x2b')](db[_0x0be6('0x25')][_0x0be6('0x26')]);_0x269a65['query']=_[_0x0be6('0x2b')](_0x3b204e[_0x0be6('0x2a')]);_0x269a65[_0x0be6('0x2c')]=_['intersection'](_0x269a65[_0x0be6('0x29')],_0x269a65['query']);_0xf23d0b['attributes']=_[_0x0be6('0x2d')](_0x269a65['model'],qs[_0x0be6('0x2f')](_0x3b204e['query'][_0x0be6('0x2f')]));_0xf23d0b[_0x0be6('0x2e')]=_0xf23d0b[_0x0be6('0x2e')][_0x0be6('0x30')]?_0xf23d0b[_0x0be6('0x2e')]:_0x269a65[_0x0be6('0x29')];if(_0x3b204e['query']['includeAll']){_0xf23d0b['include']=[{'all':!![]}];}_0xf23d0b=_['merge']({},_0xf23d0b,_0x3b204e['options']);return db[_0x0be6('0x25')]['find'](_0xf23d0b)[_0x0be6('0x20')](handleEntityNotFound(_0xf75184,null))[_0x0be6('0x20')](respondWithResult(_0xf75184,null))['catch'](handleError(_0xf75184,null));};exports[_0x0be6('0x40')]=function(_0x5aa141,_0x50e6b8){return db[_0x0be6('0x25')]['create'](_0x5aa141[_0x0be6('0x41')],{})[_0x0be6('0x20')](respondWithResult(_0x50e6b8,0xc9))[_0x0be6('0x42')](handleError(_0x50e6b8,null));};exports['update']=function(_0x4781db,_0x2bff7a){if(_0x4781db[_0x0be6('0x41')]['id']){delete _0x4781db[_0x0be6('0x41')]['id'];}return db[_0x0be6('0x25')][_0x0be6('0x43')]({'where':{'id':_0x4781db['params']['id']}})['then'](handleEntityNotFound(_0x2bff7a,null))[_0x0be6('0x20')](saveUpdates(_0x4781db['body'],null))[_0x0be6('0x20')](respondWithResult(_0x2bff7a,null))['catch'](handleError(_0x2bff7a,null));};exports[_0x0be6('0x44')]=function(_0x6878cd,_0x1c07e6){return db['UserProfileSection'][_0x0be6('0x43')]({'where':{'id':_0x6878cd['params']['id']}})[_0x0be6('0x20')](handleEntityNotFound(_0x1c07e6,null))['then'](removeEntity(_0x1c07e6,null))[_0x0be6('0x42')](handleError(_0x1c07e6,null));};exports[_0x0be6('0x45')]=function(_0x1d13d5,_0xfef7ed){return db[_0x0be6('0x25')][_0x0be6('0x45')]()[_0x0be6('0x20')](respondWithResult(_0xfef7ed,null))[_0x0be6('0x42')](handleError(_0xfef7ed,null));};
\ No newline at end of file
index a6442bc..206aa2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd668=['api','moment','bluebird','request-promise','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','../../config/logger'];(function(_0x3efda9,_0x1b88e5){var _0x26f5ae=function(_0x35099d){while(--_0x35099d){_0x3efda9['push'](_0x3efda9['shift']());}};_0x26f5ae(++_0x1b88e5);}(_0xd668,0x18e));var _0x8d66=function(_0x47d91e,_0x3e5da9){_0x47d91e=_0x47d91e-0x0;var _0x1be66b=_0xd668[_0x47d91e];return _0x1be66b;};'use strict';var _=require(_0x8d66('0x0'));var util=require('util');var logger=require(_0x8d66('0x1'))(_0x8d66('0x2'));var moment=require(_0x8d66('0x3'));var BPromise=require(_0x8d66('0x4'));var rp=require(_0x8d66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x1f9189,_0x23f62d){return _0x1f9189['define'](_0x8d66('0x6'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x8d66('0x7'),'fields':[_0x8d66('0x8'),_0x8d66('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb0e=['request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x29a134,_0x194c27){var _0x136398=function(_0x1def82){while(--_0x1def82){_0x29a134['push'](_0x29a134['shift']());}};_0x136398(++_0x194c27);}(_0xbb0e,0xfa));var _0xebb0=function(_0x243b40,_0x23989d){_0x243b40=_0x243b40-0x0;var _0x621fa8=_0xbb0e[_0x243b40];return _0x621fa8;};'use strict';var _=require(_0xebb0('0x0'));var util=require(_0xebb0('0x1'));var logger=require(_0xebb0('0x2'))('api');var moment=require(_0xebb0('0x3'));var BPromise=require(_0xebb0('0x4'));var rp=require(_0xebb0('0x5'));var fs=require('fs');var path=require(_0xebb0('0x6'));var rimraf=require(_0xebb0('0x7'));var config=require(_0xebb0('0x8'));var attributes=require(_0xebb0('0x9'));module[_0xebb0('0xa')]=function(_0x5b2dd0,_0x28ba8a){return _0x5b2dd0[_0xebb0('0xb')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xebb0('0xc'),'fields':[_0xebb0('0xd'),_0xebb0('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index ae10a2f..43aaf14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x747f=['randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0x747f,0x8a));var _0xf747=function(_0x183948,_0x30b087){_0x183948=_0x183948-0x0;var _0x459847=_0x747f[_0x183948];return _0x459847;};'use strict';var _=require(_0xf747('0x0'));var util=require(_0xf747('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf747('0x2'));var fs=require('fs');var Redis=require(_0xf747('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf747('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf747('0x5'));var jayson=require(_0xf747('0x6'));var client=jayson[_0xf747('0x7')][_0xf747('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58592e,_0x5908eb,_0x165c15){return new BPromise(function(_0x6a2c56,_0x171d61){return client['request'](_0x58592e,_0x165c15)['then'](function(_0x29c408){logger[_0xf747('0x9')]('UserProfileSection,\x20%s,\x20%s',_0x5908eb,'request\x20sent');logger[_0xf747('0xa')](_0xf747('0xb'),_0x5908eb,_0xf747('0xc'),JSON[_0xf747('0xd')](_0x29c408));if(_0x29c408[_0xf747('0xe')]){if(_0x29c408[_0xf747('0xe')][_0xf747('0xf')]===0x1f4){logger[_0xf747('0xe')](_0xf747('0x10'),_0x5908eb,_0x29c408['error']['message']);return _0x171d61(_0x29c408['error']['message']);}logger[_0xf747('0xe')](_0xf747('0x10'),_0x5908eb,_0x29c408[_0xf747('0xe')]['message']);return _0x6a2c56(_0x29c408[_0xf747('0xe')][_0xf747('0x11')]);}else{logger[_0xf747('0x9')](_0xf747('0x10'),_0x5908eb,_0xf747('0xc'));_0x6a2c56(_0x29c408[_0xf747('0x12')][_0xf747('0x11')]);}})[_0xf747('0x13')](function(_0x5873f1){logger['error'](_0xf747('0x10'),_0x5908eb,_0x5873f1);_0x171d61(_0x5873f1);});});}
\ No newline at end of file
+var _0xfe5e=['client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x9bbbcb,_0x181ae6){var _0x444240=function(_0x39abf8){while(--_0x39abf8){_0x9bbbcb['push'](_0x9bbbcb['shift']());}};_0x444240(++_0x181ae6);}(_0xfe5e,0x176));var _0xefe5=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0xfe5e[_0x1a89a1];return _0x3d5b46;};'use strict';var _=require('lodash');var util=require(_0xefe5('0x0'));var moment=require('moment');var BPromise=require(_0xefe5('0x1'));var rs=require(_0xefe5('0x2'));var fs=require('fs');var Redis=require(_0xefe5('0x3'));var db=require(_0xefe5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xefe5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xefe5('0x6')][_0xefe5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4254e7,_0x59a38d,_0xa3f10d){return new BPromise(function(_0x3489ec,_0x1e62e0){return client[_0xefe5('0x8')](_0x4254e7,_0xa3f10d)[_0xefe5('0x9')](function(_0x18e139){logger[_0xefe5('0xa')](_0xefe5('0xb'),_0x59a38d,_0xefe5('0xc'));logger[_0xefe5('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x59a38d,'request\x20sent',JSON[_0xefe5('0xe')](_0x18e139));if(_0x18e139['error']){if(_0x18e139[_0xefe5('0xf')][_0xefe5('0x10')]===0x1f4){logger[_0xefe5('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x59a38d,_0x18e139['error'][_0xefe5('0x11')]);return _0x1e62e0(_0x18e139['error'][_0xefe5('0x11')]);}logger[_0xefe5('0xf')](_0xefe5('0xb'),_0x59a38d,_0x18e139[_0xefe5('0xf')][_0xefe5('0x11')]);return _0x3489ec(_0x18e139[_0xefe5('0xf')]['message']);}else{logger[_0xefe5('0xa')](_0xefe5('0xb'),_0x59a38d,_0xefe5('0xc'));_0x3489ec(_0x18e139[_0xefe5('0x12')]['message']);}})[_0xefe5('0x13')](function(_0x1975fa){logger[_0xefe5('0xf')](_0xefe5('0xb'),_0x59a38d,_0x1975fa);_0x1e62e0(_0x1975fa);});});}
\ No newline at end of file
index 754551b..4151745 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(_0x430587,_0x16123a){var _0x421989=function(_0x190ac8){while(--_0x190ac8){_0x430587['push'](_0x430587['shift']());}};_0x421989(++_0x16123a);}(_0xe706,0xa3));var _0x6e70=function(_0x19fa2e,_0x15755b){_0x19fa2e=_0x19fa2e-0x0;var _0x2118ec=_0xe706[_0x19fa2e];return _0x2118ec;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3504f7,_0x16a32c){var _0x4afb61=function(_0x44f455){while(--_0x44f455){_0x3504f7['push'](_0x3504f7['shift']());}};_0x4afb61(++_0x16a32c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0xcb91[_0x156a0d];return _0x98a9ba;};'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 78f638c..cf1671f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ec=['sequelize','exports','INTEGER'];(function(_0x24d279,_0x27556f){var _0x5075be=function(_0x2650bd){while(--_0x2650bd){_0x24d279['push'](_0x24d279['shift']());}};_0x5075be(++_0x27556f);}(_0x77ec,0x1ec));var _0xc77e=function(_0x94b9a2,_0x6cddeb){_0x94b9a2=_0x94b9a2-0x0;var _0x2df146=_0x77ec[_0x94b9a2];return _0x2df146;};'use strict';var Sequelize=require(_0xc77e('0x0'));module[_0xc77e('0x1')]={'penalty':{'type':Sequelize[_0xc77e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc57c=['INTEGER','sequelize'];(function(_0x4fe221,_0x2b805c){var _0x513eb3=function(_0x2f5a8d){while(--_0x2f5a8d){_0x4fe221['push'](_0x4fe221['shift']());}};_0x513eb3(++_0x2b805c);}(_0xc57c,0x9f));var _0xcc57=function(_0x3babec,_0x4d1223){_0x3babec=_0x3babec-0x0;var _0x395125=_0xc57c[_0x3babec];return _0x395125;};'use strict';var Sequelize=require(_0xcc57('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcc57('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index cf3da50..5b6892b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f5=['define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x2633c7,_0x4db8b3){var _0xbb644=function(_0x3b63e0){while(--_0x3b63e0){_0x2633c7['push'](_0x2633c7['shift']());}};_0xbb644(++_0x4db8b3);}(_0x13f5,0xc3));var _0x513f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x13f5[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x513f('0x0'));var util=require(_0x513f('0x1'));var logger=require(_0x513f('0x2'))(_0x513f('0x3'));var moment=require('moment');var BPromise=require(_0x513f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x513f('0x5'));var config=require(_0x513f('0x6'));var attributes=require(_0x513f('0x7'));module[_0x513f('0x8')]=function(_0x8d019b,_0x579681){return _0x8d019b[_0x513f('0x9')](_0x513f('0xa'),attributes,{'tableName':_0x513f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','UserSmsQueue','user_has_sms_queues'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9206,0x176));var _0x6920=function(_0x16ad96,_0x51849c){_0x16ad96=_0x16ad96-0x0;var _0xca0aaa=_0x9206[_0x16ad96];return _0xca0aaa;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8271176..bfa5cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe472=['stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1e4133,_0x152a3c){var _0x5c5e01=function(_0xb26b50){while(--_0xb26b50){_0x1e4133['push'](_0x1e4133['shift']());}};_0x5c5e01(++_0x152a3c);}(_0xe472,0x98));var _0x2e47=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe472[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2e47('0x0'));var BPromise=require(_0x2e47('0x1'));var rs=require(_0x2e47('0x2'));var fs=require('fs');var Redis=require(_0x2e47('0x3'));var db=require(_0x2e47('0x4'))['db'];var utils=require(_0x2e47('0x5'));var logger=require('../../config/logger')(_0x2e47('0x6'));var config=require(_0x2e47('0x7'));var jayson=require(_0x2e47('0x8'));var client=jayson[_0x2e47('0x9')][_0x2e47('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xceaddc,_0xed24e1,_0x5e839e){return new BPromise(function(_0x2729a3,_0x597c10){return client[_0x2e47('0xb')](_0xceaddc,_0x5e839e)[_0x2e47('0xc')](function(_0x2bee1e){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0xed24e1,_0x2e47('0xd'));logger[_0x2e47('0xe')](_0x2e47('0xf'),_0xed24e1,_0x2e47('0xd'),JSON[_0x2e47('0x10')](_0x2bee1e));if(_0x2bee1e[_0x2e47('0x11')]){if(_0x2bee1e[_0x2e47('0x11')][_0x2e47('0x12')]===0x1f4){logger[_0x2e47('0x11')](_0x2e47('0x13'),_0xed24e1,_0x2bee1e[_0x2e47('0x11')][_0x2e47('0x14')]);return _0x597c10(_0x2bee1e[_0x2e47('0x11')][_0x2e47('0x14')]);}logger[_0x2e47('0x11')](_0x2e47('0x13'),_0xed24e1,_0x2bee1e[_0x2e47('0x11')][_0x2e47('0x14')]);return _0x2729a3(_0x2bee1e['error'][_0x2e47('0x14')]);}else{logger[_0x2e47('0x15')](_0x2e47('0x13'),_0xed24e1,_0x2e47('0xd'));_0x2729a3(_0x2bee1e[_0x2e47('0x16')][_0x2e47('0x14')]);}})[_0x2e47('0x17')](function(_0x2b86fa){logger[_0x2e47('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xed24e1,_0x2b86fa);_0x597c10(_0x2b86fa);});});}
\ No newline at end of file
+var _0xf09b=['code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3724d7,_0x21491d){var _0x3557e7=function(_0x317a18){while(--_0x317a18){_0x3724d7['push'](_0x3724d7['shift']());}};_0x3557e7(++_0x21491d);}(_0xf09b,0x144));var _0xbf09=function(_0x16d47e,_0x2ec993){_0x16d47e=_0x16d47e-0x0;var _0x46a14a=_0xf09b[_0x16d47e];return _0x46a14a;};'use strict';var _=require(_0xbf09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbf09('0x1'));var fs=require('fs');var Redis=require(_0xbf09('0x2'));var db=require(_0xbf09('0x3'))['db'];var utils=require(_0xbf09('0x4'));var logger=require(_0xbf09('0x5'))(_0xbf09('0x6'));var config=require(_0xbf09('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbf09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x354994,_0x35bce1,_0x44873d){return new BPromise(function(_0x3f997d,_0x4e59ad){return client[_0xbf09('0x9')](_0x354994,_0x44873d)['then'](function(_0xfae478){logger[_0xbf09('0xa')](_0xbf09('0xb'),_0x35bce1,_0xbf09('0xc'));logger[_0xbf09('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x35bce1,_0xbf09('0xc'),JSON[_0xbf09('0xe')](_0xfae478));if(_0xfae478[_0xbf09('0xf')]){if(_0xfae478[_0xbf09('0xf')][_0xbf09('0x10')]===0x1f4){logger[_0xbf09('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x35bce1,_0xfae478[_0xbf09('0xf')][_0xbf09('0x11')]);return _0x4e59ad(_0xfae478[_0xbf09('0xf')][_0xbf09('0x11')]);}logger['error'](_0xbf09('0xb'),_0x35bce1,_0xfae478[_0xbf09('0xf')][_0xbf09('0x11')]);return _0x3f997d(_0xfae478[_0xbf09('0xf')][_0xbf09('0x11')]);}else{logger[_0xbf09('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x35bce1,_0xbf09('0xc'));_0x3f997d(_0xfae478[_0xbf09('0x12')][_0xbf09('0x11')]);}})[_0xbf09('0x13')](function(_0x1431df){logger[_0xbf09('0xf')](_0xbf09('0xb'),_0x35bce1,_0x1431df);_0x4e59ad(_0x1431df);});});}
\ No newline at end of file
index 2f516fd..6bb9ba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x577d=['sequelize','exports','INTEGER'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x577d,0x177));var _0xd577=function(_0x1b1e21,_0x44fc6a){_0x1b1e21=_0x1b1e21-0x0;var _0x573cf3=_0x577d[_0x1b1e21];return _0x573cf3;};'use strict';var Sequelize=require(_0xd577('0x0'));module[_0xd577('0x1')]={'UserId':{'type':Sequelize[_0xd577('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd577('0x2')]}};
\ No newline at end of file
+var _0xe9dc=['exports'];(function(_0x34ab11,_0x310543){var _0x28d563=function(_0x572390){while(--_0x572390){_0x34ab11['push'](_0x34ab11['shift']());}};_0x28d563(++_0x310543);}(_0xe9dc,0xcb));var _0xce9d=function(_0x1b8faa,_0x57a8ae){_0x1b8faa=_0x1b8faa-0x0;var _0x4afb97=_0xe9dc[_0x1b8faa];return _0x4afb97;};'use strict';var Sequelize=require('sequelize');module[_0xce9d('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index adaec5b..7834d8c 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(_0xecd48e,_0x4f6669){var _0x2c969e=function(_0x88a2fb){while(--_0x88a2fb){_0xecd48e['push'](_0xecd48e['shift']());}};_0x2c969e(++_0x4f6669);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x592ace,_0x5dbc0e){var _0x1a4334=function(_0x15ba5c){while(--_0x15ba5c){_0x592ace['push'](_0x592ace['shift']());}};_0x1a4334(++_0x5dbc0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 8b5028d..ab9b95c 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(_0x53056c,_0x1d56a9){var _0x5cec88=function(_0x2ad06b){while(--_0x2ad06b){_0x53056c['push'](_0x53056c['shift']());}};_0x5cec88(++_0x1d56a9);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2449cb,_0x33c174){var _0x1f48a0=function(_0x3c0f12){while(--_0x3c0f12){_0x2449cb['push'](_0x2449cb['shift']());}};_0x1f48a0(++_0x33c174);}(_0x70e0,0x17b));var _0x070e=function(_0x15d97b,_0x34014d){_0x15d97b=_0x15d97b-0x0;var _0x39f9f5=_0x70e0[_0x15d97b];return _0x39f9f5;};'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 6590d6b..1f27d3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5590=['sequelize','exports','INTEGER'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5590,0x11a));var _0x0559=function(_0xf8ea71,_0x1e4fd3){_0xf8ea71=_0xf8ea71-0x0;var _0x14e970=_0x5590[_0xf8ea71];return _0x14e970;};'use strict';var Sequelize=require(_0x0559('0x0'));module[_0x0559('0x1')]={'penalty':{'type':Sequelize[_0x0559('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd5ec=['INTEGER','sequelize','exports'];(function(_0x4ca2b5,_0x539411){var _0x542dc8=function(_0x128bd9){while(--_0x128bd9){_0x4ca2b5['push'](_0x4ca2b5['shift']());}};_0x542dc8(++_0x539411);}(_0xd5ec,0xb8));var _0xcd5e=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xd5ec[_0x4cbf20];return _0x582ae4;};'use strict';var Sequelize=require(_0xcd5e('0x0'));module[_0xcd5e('0x1')]={'penalty':{'type':Sequelize[_0xcd5e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 3affa3b..d029f10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e1=['UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4e1,0xc6));var _0x1b4e=function(_0x31b856,_0x2ff726){_0x31b856=_0x31b856-0x0;var _0x5139ad=_0xb4e1[_0x31b856];return _0x5139ad;};'use strict';var _=require(_0x1b4e('0x0'));var util=require(_0x1b4e('0x1'));var logger=require(_0x1b4e('0x2'))(_0x1b4e('0x3'));var moment=require(_0x1b4e('0x4'));var BPromise=require('bluebird');var rp=require(_0x1b4e('0x5'));var fs=require('fs');var path=require(_0x1b4e('0x6'));var rimraf=require(_0x1b4e('0x7'));var config=require(_0x1b4e('0x8'));var attributes=require(_0x1b4e('0x9'));module[_0x1b4e('0xa')]=function(_0x3c26d1,_0x1a8602){return _0x3c26d1[_0x1b4e('0xb')](_0x1b4e('0xc'),attributes,{'tableName':_0x1b4e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x68d0=['./userVoiceQueue.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x68d0,0x175));var _0x068d=function(_0x24bfd4,_0x263061){_0x24bfd4=_0x24bfd4-0x0;var _0x235252=_0x68d0[_0x24bfd4];return _0x235252;};'use strict';var _=require(_0x068d('0x0'));var util=require('util');var logger=require(_0x068d('0x1'))(_0x068d('0x2'));var moment=require(_0x068d('0x3'));var BPromise=require('bluebird');var rp=require(_0x068d('0x4'));var fs=require('fs');var path=require(_0x068d('0x5'));var rimraf=require('rimraf');var config=require(_0x068d('0x6'));var attributes=require(_0x068d('0x7'));module[_0x068d('0x8')]=function(_0x53778e,_0x1a05d0){return _0x53778e[_0x068d('0x9')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ad6d497..cd677b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2a9=['message','info','request\x20sent','result','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0xf2a9,0x100));var _0x9f2a=function(_0x2bd6de,_0x247413){_0x2bd6de=_0x2bd6de-0x0;var _0x1cbdfd=_0xf2a9[_0x2bd6de];return _0x1cbdfd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9f2a('0x0'));var BPromise=require('bluebird');var rs=require(_0x9f2a('0x1'));var fs=require('fs');var Redis=require(_0x9f2a('0x2'));var db=require(_0x9f2a('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9f2a('0x4'));var config=require(_0x9f2a('0x5'));var jayson=require(_0x9f2a('0x6'));var client=jayson[_0x9f2a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb2445d,_0x4a825a,_0x17bdcb){return new BPromise(function(_0x2b19bc,_0x12cf90){return client['request'](_0xb2445d,_0x17bdcb)[_0x9f2a('0x8')](function(_0x51af51){logger['info'](_0x9f2a('0x9'),_0x4a825a,'request\x20sent');logger[_0x9f2a('0xa')](_0x9f2a('0xb'),_0x4a825a,'request\x20sent',JSON['stringify'](_0x51af51));if(_0x51af51['error']){if(_0x51af51['error'][_0x9f2a('0xc')]===0x1f4){logger[_0x9f2a('0xd')](_0x9f2a('0x9'),_0x4a825a,_0x51af51['error'][_0x9f2a('0xe')]);return _0x12cf90(_0x51af51[_0x9f2a('0xd')][_0x9f2a('0xe')]);}logger[_0x9f2a('0xd')](_0x9f2a('0x9'),_0x4a825a,_0x51af51[_0x9f2a('0xd')][_0x9f2a('0xe')]);return _0x2b19bc(_0x51af51[_0x9f2a('0xd')][_0x9f2a('0xe')]);}else{logger[_0x9f2a('0xf')](_0x9f2a('0x9'),_0x4a825a,_0x9f2a('0x10'));_0x2b19bc(_0x51af51[_0x9f2a('0x11')]['message']);}})['catch'](function(_0x19ed0d){logger['error'](_0x9f2a('0x9'),_0x4a825a,_0x19ed0d);_0x12cf90(_0x19ed0d);});});}
\ No newline at end of file
+var _0x5df4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x2338e0,_0x2dd331){var _0x4b6b3a=function(_0x1e22ba){while(--_0x1e22ba){_0x2338e0['push'](_0x2338e0['shift']());}};_0x4b6b3a(++_0x2dd331);}(_0x5df4,0x11f));var _0x45df=function(_0x3dd907,_0x3c7e3d){_0x3dd907=_0x3dd907-0x0;var _0x5f3bf8=_0x5df4[_0x3dd907];return _0x5f3bf8;};'use strict';var _=require(_0x45df('0x0'));var util=require(_0x45df('0x1'));var moment=require(_0x45df('0x2'));var BPromise=require(_0x45df('0x3'));var rs=require(_0x45df('0x4'));var fs=require('fs');var Redis=require(_0x45df('0x5'));var db=require(_0x45df('0x6'))['db'];var utils=require(_0x45df('0x7'));var logger=require('../../config/logger')(_0x45df('0x8'));var config=require(_0x45df('0x9'));var jayson=require(_0x45df('0xa'));var client=jayson[_0x45df('0xb')][_0x45df('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15060f,_0x454f4a,_0x1cd0af){return new BPromise(function(_0x40661d,_0x139a1d){return client[_0x45df('0xd')](_0x15060f,_0x1cd0af)[_0x45df('0xe')](function(_0x28ef27){logger[_0x45df('0xf')](_0x45df('0x10'),_0x454f4a,_0x45df('0x11'));logger[_0x45df('0x12')](_0x45df('0x13'),_0x454f4a,_0x45df('0x11'),JSON[_0x45df('0x14')](_0x28ef27));if(_0x28ef27[_0x45df('0x15')]){if(_0x28ef27['error'][_0x45df('0x16')]===0x1f4){logger[_0x45df('0x15')](_0x45df('0x10'),_0x454f4a,_0x28ef27[_0x45df('0x15')][_0x45df('0x17')]);return _0x139a1d(_0x28ef27[_0x45df('0x15')][_0x45df('0x17')]);}logger[_0x45df('0x15')](_0x45df('0x10'),_0x454f4a,_0x28ef27['error'][_0x45df('0x17')]);return _0x40661d(_0x28ef27['error'][_0x45df('0x17')]);}else{logger[_0x45df('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x454f4a,_0x45df('0x11'));_0x40661d(_0x28ef27['result'][_0x45df('0x17')]);}})['catch'](function(_0x5591ec){logger[_0x45df('0x15')]('UserVoiceQueue,\x20%s,\x20%s',_0x454f4a,_0x5591ec);_0x139a1d(_0x5591ec);});});}
\ No newline at end of file
index 9db062c..7a5fc11 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(_0x29a8dd,_0x5bb150){var _0xe4855f=function(_0x55b898){while(--_0x55b898){_0x29a8dd['push'](_0x29a8dd['shift']());}};_0xe4855f(++_0x5bb150);}(_0xe706,0xa3));var _0x6e70=function(_0x20f4af,_0x4163e6){_0x20f4af=_0x20f4af-0x0;var _0x20b7ed=_0xe706[_0x20f4af];return _0x20b7ed;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4851ff,_0x1c9a8d){var _0x26773b=function(_0x26c33e){while(--_0x26c33e){_0x4851ff['push'](_0x4851ff['shift']());}};_0x26773b(++_0x1c9a8d);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'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
index f2d4371..c097014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc87c=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xc87c,0x1d3));var _0xcc87=function(_0x34d612,_0x24fe9b){_0x34d612=_0x34d612-0x0;var _0x2f8f2f=_0xc87c[_0x34d612];return _0x2f8f2f;};'use strict';var Sequelize=require(_0xcc87('0x0'));module[_0xcc87('0x1')]={'uniqueid':{'type':Sequelize[_0xcc87('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xcc87('0x3')},'membername':{'type':Sequelize[_0xcc87('0x4')],'allowNull':![],'comment':_0xcc87('0x3')},'UserId':{'type':Sequelize[_0xcc87('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xcc87('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xcc87('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcc87('0x5'),'comment':_0xcc87('0x3')},'penalty':{'type':Sequelize[_0xcc87('0x2')](0xb),'defaultValue':0x0,'comment':_0xcc87('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xcc87('0x3')}};
\ No newline at end of file
+var _0xde4e=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1e86b5,_0x42143c){var _0x5a8538=function(_0x28d23a){while(--_0x28d23a){_0x1e86b5['push'](_0x1e86b5['shift']());}};_0x5a8538(++_0x42143c);}(_0xde4e,0x1ec));var _0xede4=function(_0x447413,_0x1835da){_0x447413=_0x447413-0x0;var _0x3247a9=_0xde4e[_0x447413];return _0x3247a9;};'use strict';var Sequelize=require(_0xede4('0x0'));module[_0xede4('0x1')]={'uniqueid':{'type':Sequelize[_0xede4('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xede4('0x3')},'membername':{'type':Sequelize[_0xede4('0x4')],'allowNull':![],'comment':_0xede4('0x3')},'UserId':{'type':Sequelize[_0xede4('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xede4('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xede4('0x3')},'VoiceQueueId':{'type':Sequelize[_0xede4('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xede4('0x4')],'allowNull':![],'unique':_0xede4('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xede4('0x2')](0xb),'defaultValue':0x0,'comment':_0xede4('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xede4('0x3')}};
\ No newline at end of file
index badf340..b6b6743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e0d=['hasOwnProperty','hook','events','UserVoiceQueueRt','setMaxListeners','update','remove','emit'];(function(_0x2855ba,_0x2dd613){var _0x59d096=function(_0x129538){while(--_0x129538){_0x2855ba['push'](_0x2855ba['shift']());}};_0x59d096(++_0x2dd613);}(_0x7e0d,0x1a2));var _0xd7e0=function(_0x557116,_0x2ae8c8){_0x557116=_0x557116-0x0;var _0x2cc50b=_0x7e0d[_0x557116];return _0x2cc50b;};'use strict';var EventEmitter=require(_0xd7e0('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xd7e0('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd7e0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd7e0('0x3'),'afterDestroy':_0xd7e0('0x4')};function emitEvent(_0x48b7d1){return function(_0x1f2c18,_0x553d17,_0x22d585){UserVoiceQueueRtEvents[_0xd7e0('0x5')](_0x48b7d1+':'+_0x1f2c18['id'],_0x1f2c18);UserVoiceQueueRtEvents[_0xd7e0('0x5')](_0x48b7d1,_0x1f2c18);_0x22d585(null);};}for(var e in events){if(events[_0xd7e0('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xd7e0('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x69e3=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x260a35,_0x2f7c1c){var _0x10ba0a=function(_0x1bddb2){while(--_0x1bddb2){_0x260a35['push'](_0x260a35['shift']());}};_0x10ba0a(++_0x2f7c1c);}(_0x69e3,0x9b));var _0x369e=function(_0x267280,_0x447862){_0x267280=_0x267280-0x0;var _0x1015ef=_0x69e3[_0x267280];return _0x1015ef;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x369e('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x369e('0x1')](0x0);var events={'afterCreate':_0x369e('0x2'),'afterUpdate':_0x369e('0x3'),'afterDestroy':_0x369e('0x4')};function emitEvent(_0x4f6951){return function(_0x180097,_0x1e65e4,_0x4acaa4){UserVoiceQueueRtEvents[_0x369e('0x5')](_0x4f6951+':'+_0x180097['id'],_0x180097);UserVoiceQueueRtEvents[_0x369e('0x5')](_0x4f6951,_0x180097);_0x4acaa4(null);};}for(var e in events){if(events[_0x369e('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x369e('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 6e885dd..c00b099 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c28=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0xb4cc12,_0x41436e){var _0x8593b5=function(_0x13b840){while(--_0x13b840){_0xb4cc12['push'](_0xb4cc12['shift']());}};_0x8593b5(++_0x41436e);}(_0x7c28,0x1f1));var _0x87c2=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7c28[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x87c2('0x0'));var util=require(_0x87c2('0x1'));var logger=require(_0x87c2('0x2'))(_0x87c2('0x3'));var moment=require(_0x87c2('0x4'));var BPromise=require('bluebird');var rp=require(_0x87c2('0x5'));var fs=require('fs');var path=require(_0x87c2('0x6'));var rimraf=require(_0x87c2('0x7'));var config=require(_0x87c2('0x8'));var attributes=require(_0x87c2('0x9'));module[_0x87c2('0xa')]=function(_0x13bc9e,_0x2fcefc){return _0x13bc9e[_0x87c2('0xb')](_0x87c2('0xc'),attributes,{'tableName':_0x87c2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa293=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','util','api','moment','bluebird'];(function(_0x41db4d,_0xad6d70){var _0x17047b=function(_0x287fbd){while(--_0x287fbd){_0x41db4d['push'](_0x41db4d['shift']());}};_0x17047b(++_0xad6d70);}(_0xa293,0x1f0));var _0x3a29=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xa293[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x3a29('0x0'));var logger=require('../../config/logger')(_0x3a29('0x1'));var moment=require(_0x3a29('0x2'));var BPromise=require(_0x3a29('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3a29('0x4'));var config=require(_0x3a29('0x5'));var attributes=require(_0x3a29('0x6'));module[_0x3a29('0x7')]=function(_0x15dde3,_0x45b218){return _0x15dde3['define'](_0x3a29('0x8'),attributes,{'tableName':_0x3a29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index de0e5bb..1efe8c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf458=['stringify','code','error','message','catch','options','raw','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s'];(function(_0x5ead1c,_0x3d2b26){var _0x2a3f4f=function(_0x27cdd6){while(--_0x27cdd6){_0x5ead1c['push'](_0x5ead1c['shift']());}};_0x2a3f4f(++_0x3d2b26);}(_0xf458,0x175));var _0x8f45=function(_0x48a0cd,_0x50c3cd){_0x48a0cd=_0x48a0cd-0x0;var _0x123c59=_0xf458[_0x48a0cd];return _0x123c59;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8f45('0x0'));var BPromise=require(_0x8f45('0x1'));var rs=require(_0x8f45('0x2'));var fs=require('fs');var Redis=require(_0x8f45('0x3'));var db=require(_0x8f45('0x4'))['db'];var utils=require(_0x8f45('0x5'));var logger=require(_0x8f45('0x6'))(_0x8f45('0x7'));var config=require(_0x8f45('0x8'));var jayson=require(_0x8f45('0x9'));var client=jayson[_0x8f45('0xa')]['http']({'port':0x232a});config[_0x8f45('0xb')]=_[_0x8f45('0xc')](config[_0x8f45('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8f45('0xd'))(new Redis(config[_0x8f45('0xb')]));require(_0x8f45('0xe'))[_0x8f45('0xf')](socket);function respondWithRpcPromise(_0x410799,_0x3a9e86,_0x28b7d9){return new BPromise(function(_0x46bc7f,_0x4662cb){return client[_0x8f45('0x10')](_0x410799,_0x28b7d9)[_0x8f45('0x11')](function(_0x375b59){logger[_0x8f45('0x12')](_0x8f45('0x13'),_0x3a9e86,_0x8f45('0x14'));logger[_0x8f45('0x15')](_0x8f45('0x16'),_0x3a9e86,'request\x20sent',JSON[_0x8f45('0x17')](_0x375b59));if(_0x375b59['error']){if(_0x375b59['error'][_0x8f45('0x18')]===0x1f4){logger[_0x8f45('0x19')](_0x8f45('0x13'),_0x3a9e86,_0x375b59[_0x8f45('0x19')]['message']);return _0x4662cb(_0x375b59[_0x8f45('0x19')][_0x8f45('0x1a')]);}logger[_0x8f45('0x19')](_0x8f45('0x13'),_0x3a9e86,_0x375b59[_0x8f45('0x19')]['message']);return _0x46bc7f(_0x375b59['error'][_0x8f45('0x1a')]);}else{logger[_0x8f45('0x12')](_0x8f45('0x13'),_0x3a9e86,_0x8f45('0x14'));_0x46bc7f(_0x375b59['result'][_0x8f45('0x1a')]);}})[_0x8f45('0x1b')](function(_0x3396a1){logger[_0x8f45('0x19')](_0x8f45('0x13'),_0x3a9e86,_0x3396a1);_0x4662cb(_0x3396a1);});});}exports['GetVoiceQueueRtPauses']=function(_0x302264){var _0x4a2073=this;return new Promise(function(_0x5b2e76,_0x56a984){return db['UserVoiceQueueRt']['findAll']({'raw':_0x302264[_0x8f45('0x1c')]?_0x302264[_0x8f45('0x1c')][_0x8f45('0x1d')]===undefined?!![]:![]:!![],'where':_0x302264[_0x8f45('0x1c')]?_0x302264[_0x8f45('0x1c')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x8f45('0x1e'),db[_0x8f45('0x1f')]['fn']('IF',db[_0x8f45('0x1f')][_0x8f45('0x20')](_0x8f45('0x21')))),_0x8f45('0x22')]]})[_0x8f45('0x11')](function(_0x34cb14){logger[_0x8f45('0x12')](_0x8f45('0x23'),_0x302264);logger[_0x8f45('0x15')](_0x8f45('0x23'),_0x302264,JSON[_0x8f45('0x17')](_0x34cb14));_0x5b2e76(_0x34cb14);})[_0x8f45('0x1b')](function(_0x10f4b9){logger[_0x8f45('0x19')]('GetVoiceQueueRtPauses',_0x10f4b9['message'],_0x302264);_0x56a984(_0x4a2073[_0x8f45('0x19')](0x1f4,_0x10f4b9[_0x8f45('0x1a')]));});});};
\ No newline at end of file
+var _0x3873=['client','redis','defaults','localhost','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3caa00,_0x294435){var _0x3d478f=function(_0x1e7879){while(--_0x1e7879){_0x3caa00['push'](_0x3caa00['shift']());}};_0x3d478f(++_0x294435);}(_0x3873,0xc9));var _0x3387=function(_0x41aa5a,_0x2dbf0f){_0x41aa5a=_0x41aa5a-0x0;var _0x2e37a4=_0x3873[_0x41aa5a];return _0x2e37a4;};'use strict';var _=require(_0x3387('0x0'));var util=require(_0x3387('0x1'));var moment=require(_0x3387('0x2'));var BPromise=require(_0x3387('0x3'));var rs=require(_0x3387('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3387('0x5'))['db'];var utils=require(_0x3387('0x6'));var logger=require(_0x3387('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3387('0x8'));var client=jayson[_0x3387('0x9')]['http']({'port':0x232a});config[_0x3387('0xa')]=_[_0x3387('0xb')](config[_0x3387('0xa')],{'host':_0x3387('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3387('0xa')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x3f803d,_0x5a22c7,_0x4167eb){return new BPromise(function(_0x2b531d,_0x566761){return client['request'](_0x3f803d,_0x4167eb)[_0x3387('0xd')](function(_0x20a55a){logger['info'](_0x3387('0xe'),_0x5a22c7,_0x3387('0xf'));logger[_0x3387('0x10')](_0x3387('0x11'),_0x5a22c7,'request\x20sent',JSON[_0x3387('0x12')](_0x20a55a));if(_0x20a55a[_0x3387('0x13')]){if(_0x20a55a[_0x3387('0x13')][_0x3387('0x14')]===0x1f4){logger['error'](_0x3387('0xe'),_0x5a22c7,_0x20a55a[_0x3387('0x13')][_0x3387('0x15')]);return _0x566761(_0x20a55a['error'][_0x3387('0x15')]);}logger['error'](_0x3387('0xe'),_0x5a22c7,_0x20a55a['error']['message']);return _0x2b531d(_0x20a55a[_0x3387('0x13')]['message']);}else{logger[_0x3387('0x16')](_0x3387('0xe'),_0x5a22c7,'request\x20sent');_0x2b531d(_0x20a55a[_0x3387('0x17')][_0x3387('0x15')]);}})['catch'](function(_0x642521){logger[_0x3387('0x13')](_0x3387('0xe'),_0x5a22c7,_0x642521);_0x566761(_0x642521);});});}exports[_0x3387('0x18')]=function(_0x4efff9){var _0x1987c3=this;return new Promise(function(_0x1b97cb,_0x2decd6){return db[_0x3387('0x19')][_0x3387('0x1a')]({'raw':_0x4efff9[_0x3387('0x1b')]?_0x4efff9[_0x3387('0x1b')][_0x3387('0x1c')]===undefined?!![]:![]:!![],'where':_0x4efff9[_0x3387('0x1b')]?_0x4efff9[_0x3387('0x1b')][_0x3387('0x1d')]||null:null,'attributes':[[db[_0x3387('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3387('0x1e')][_0x3387('0x1f')](_0x3387('0x20')))),_0x3387('0x21')]]})[_0x3387('0xd')](function(_0x3dd8da){logger[_0x3387('0x16')](_0x3387('0x18'),_0x4efff9);logger[_0x3387('0x10')](_0x3387('0x18'),_0x4efff9,JSON['stringify'](_0x3dd8da));_0x1b97cb(_0x3dd8da);})[_0x3387('0x22')](function(_0x518a85){logger[_0x3387('0x13')](_0x3387('0x18'),_0x518a85[_0x3387('0x15')],_0x4efff9);_0x2decd6(_0x1987c3[_0x3387('0x13')](0x1f4,_0x518a85['message']));});});};
\ No newline at end of file
index a065d0f..b880eac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a83=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x5ad3ef,_0x507884){var _0x7caf3=function(_0x66aa6d){while(--_0x66aa6d){_0x5ad3ef['push'](_0x5ad3ef['shift']());}};_0x7caf3(++_0x507884);}(_0x6a83,0xd2));var _0x36a8=function(_0x568a4c,_0x5c706b){_0x568a4c=_0x568a4c-0x0;var _0x5240fa=_0x6a83[_0x568a4c];return _0x5240fa;};'use strict';var UserVoiceQueueRtEvents=require(_0x36a8('0x0'));var events=[_0x36a8('0x1'),_0x36a8('0x2'),_0x36a8('0x3')];function createListener(_0x125ca1,_0x367db7){return function(_0x1f59f3){_0x367db7[_0x36a8('0x4')](_0x125ca1,_0x1f59f3);};}function removeListener(_0x11a47c,_0x35767b){return function(){UserVoiceQueueRtEvents[_0x36a8('0x5')](_0x11a47c,_0x35767b);};}exports[_0x36a8('0x6')]=function(_0x360b47){for(var _0x60d79a=0x0,_0x2a0ba3=events[_0x36a8('0x7')];_0x60d79a<_0x2a0ba3;_0x60d79a++){var _0x31b8d3=events[_0x60d79a];var _0xf312a6=createListener(_0x36a8('0x8')+_0x31b8d3,_0x360b47);UserVoiceQueueRtEvents['on'](_0x31b8d3,_0xf312a6);}};
\ No newline at end of file
+var _0x5a2a=['removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x4940bf,_0x23f29e){var _0x2d7d57=function(_0x50a867){while(--_0x50a867){_0x4940bf['push'](_0x4940bf['shift']());}};_0x2d7d57(++_0x23f29e);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x136e3f,_0x100db1){_0x136e3f=_0x136e3f-0x0;var _0x52f8ab=_0x5a2a[_0x136e3f];return _0x52f8ab;};'use strict';var UserVoiceQueueRtEvents=require(_0xa5a2('0x0'));var events=[_0xa5a2('0x1'),_0xa5a2('0x2'),_0xa5a2('0x3')];function createListener(_0x5d3456,_0x525e94){return function(_0x48308f){_0x525e94[_0xa5a2('0x4')](_0x5d3456,_0x48308f);};}function removeListener(_0x2cf196,_0x479d0a){return function(){UserVoiceQueueRtEvents[_0xa5a2('0x5')](_0x2cf196,_0x479d0a);};}exports[_0xa5a2('0x6')]=function(_0x2e97d3){for(var _0x55728b=0x0,_0x179722=events['length'];_0x55728b<_0x179722;_0x55728b++){var _0x38a5fe=events[_0x55728b];var _0x97f75c=createListener(_0xa5a2('0x7')+_0x38a5fe,_0x2e97d3);UserVoiceQueueRtEvents['on'](_0x38a5fe,_0x97f75c);}};
\ No newline at end of file
index 9035578..24975be 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(_0x4caeeb,_0x6a0e13){var _0x1302a8=function(_0x6e0adb){while(--_0x6e0adb){_0x4caeeb['push'](_0x4caeeb['shift']());}};_0x1302a8(++_0x6a0e13);}(_0xe706,0xa3));var _0x6e70=function(_0x307049,_0x1e9968){_0x307049=_0x307049-0x0;var _0x2d3015=_0xe706[_0x307049];return _0x2d3015;};'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(_0x40d296,_0x37eb65){var _0xf9a9f1=function(_0x52930d){while(--_0x52930d){_0x40d296['push'](_0x40d296['shift']());}};_0xf9a9f1(++_0x37eb65);}(_0xe706,0xa3));var _0x6e70=function(_0x517724,_0x51e5c0){_0x517724=_0x517724-0x0;var _0x4c73a5=_0xe706[_0x517724];return _0x4c73a5;};'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 06d07e2..72dc0ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5e=['INTEGER'];(function(_0x400fe1,_0x3d579c){var _0x368abe=function(_0x3de01c){while(--_0x3de01c){_0x400fe1['push'](_0x400fe1['shift']());}};_0x368abe(++_0x3d579c);}(_0xee5e,0x181));var _0xeee5=function(_0x5921c7,_0x501ffa){_0x5921c7=_0x5921c7-0x0;var _0x141bfa=_0xee5e[_0x5921c7];return _0x141bfa;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xeee5('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xedcb=['INTEGER','exports'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xedcb,0x1eb));var _0xbedc=function(_0x19d6c1,_0x154e43){_0x19d6c1=_0x19d6c1-0x0;var _0x216ff7=_0xedcb[_0x19d6c1];return _0x216ff7;};'use strict';var Sequelize=require('sequelize');module[_0xbedc('0x0')]={'penalty':{'type':Sequelize[_0xbedc('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 6a22382..779e26e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x723a=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x4a97a9,_0x52552b){var _0x43fb99=function(_0x5e775f){while(--_0x5e775f){_0x4a97a9['push'](_0x4a97a9['shift']());}};_0x43fb99(++_0x52552b);}(_0x723a,0x160));var _0xa723=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x723a[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xa723('0x0'));var util=require(_0xa723('0x1'));var logger=require(_0xa723('0x2'))('api');var moment=require(_0xa723('0x3'));var BPromise=require(_0xa723('0x4'));var rp=require(_0xa723('0x5'));var fs=require('fs');var path=require(_0xa723('0x6'));var rimraf=require(_0xa723('0x7'));var config=require(_0xa723('0x8'));var attributes=require(_0xa723('0x9'));module[_0xa723('0xa')]=function(_0x11b0a4,_0x973325){return _0x11b0a4[_0xa723('0xb')](_0xa723('0xc'),attributes,{'tableName':_0xa723('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3363=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api'];(function(_0x1efb37,_0x36569f){var _0x154cb0=function(_0x575ea4){while(--_0x575ea4){_0x1efb37['push'](_0x1efb37['shift']());}};_0x154cb0(++_0x36569f);}(_0x3363,0x115));var _0x3336=function(_0x44a57e,_0x320cad){_0x44a57e=_0x44a57e-0x0;var _0x8632f=_0x3363[_0x44a57e];return _0x8632f;};'use strict';var _=require('lodash');var util=require(_0x3336('0x0'));var logger=require(_0x3336('0x1'))(_0x3336('0x2'));var moment=require(_0x3336('0x3'));var BPromise=require(_0x3336('0x4'));var rp=require(_0x3336('0x5'));var fs=require('fs');var path=require(_0x3336('0x6'));var rimraf=require(_0x3336('0x7'));var config=require(_0x3336('0x8'));var attributes=require(_0x3336('0x9'));module[_0x3336('0xa')]=function(_0x261075,_0x3694d8){return _0x261075[_0x3336('0xb')](_0x3336('0xc'),attributes,{'tableName':_0x3336('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa9a30b..76ad5eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e98=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message'];(function(_0x5f00c7,_0x17470a){var _0x5bde7c=function(_0x41262d){while(--_0x41262d){_0x5f00c7['push'](_0x5f00c7['shift']());}};_0x5bde7c(++_0x17470a);}(_0x5e98,0x15b));var _0x85e9=function(_0x2010e7,_0x3e15ae){_0x2010e7=_0x2010e7-0x0;var _0x1a93d5=_0x5e98[_0x2010e7];return _0x1a93d5;};'use strict';var _=require(_0x85e9('0x0'));var util=require(_0x85e9('0x1'));var moment=require(_0x85e9('0x2'));var BPromise=require(_0x85e9('0x3'));var rs=require(_0x85e9('0x4'));var fs=require('fs');var Redis=require(_0x85e9('0x5'));var db=require(_0x85e9('0x6'))['db'];var utils=require(_0x85e9('0x7'));var logger=require(_0x85e9('0x8'))(_0x85e9('0x9'));var config=require('../../config/environment');var jayson=require(_0x85e9('0xa'));var client=jayson[_0x85e9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5465dc,_0x191b8c,_0x1d720f){return new BPromise(function(_0x5d9dda,_0x54fb13){return client[_0x85e9('0xc')](_0x5465dc,_0x1d720f)[_0x85e9('0xd')](function(_0x1ebf6f){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x191b8c,_0x85e9('0xe'));logger[_0x85e9('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x191b8c,_0x85e9('0xe'),JSON[_0x85e9('0x10')](_0x1ebf6f));if(_0x1ebf6f[_0x85e9('0x11')]){if(_0x1ebf6f[_0x85e9('0x11')][_0x85e9('0x12')]===0x1f4){logger[_0x85e9('0x11')](_0x85e9('0x13'),_0x191b8c,_0x1ebf6f['error'][_0x85e9('0x14')]);return _0x54fb13(_0x1ebf6f[_0x85e9('0x11')][_0x85e9('0x14')]);}logger[_0x85e9('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x191b8c,_0x1ebf6f[_0x85e9('0x11')]['message']);return _0x5d9dda(_0x1ebf6f[_0x85e9('0x11')]['message']);}else{logger[_0x85e9('0x15')](_0x85e9('0x13'),_0x191b8c,_0x85e9('0xe'));_0x5d9dda(_0x1ebf6f['result'][_0x85e9('0x14')]);}})[_0x85e9('0x16')](function(_0x2964f6){logger[_0x85e9('0x11')](_0x85e9('0x13'),_0x191b8c,_0x2964f6);_0x54fb13(_0x2964f6);});});}
\ No newline at end of file
+var _0x5d54=['../../config/logger','rpc','../../config/environment','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','moment','ioredis','../../config/utils'];(function(_0x5c72f5,_0x3fbd86){var _0x4b35cb=function(_0x2104c6){while(--_0x2104c6){_0x5c72f5['push'](_0x5c72f5['shift']());}};_0x4b35cb(++_0x3fbd86);}(_0x5d54,0x1be));var _0x45d5=function(_0x206eec,_0x1d4bbf){_0x206eec=_0x206eec-0x0;var _0x2f7e08=_0x5d54[_0x206eec];return _0x2f7e08;};'use strict';var _=require(_0x45d5('0x0'));var util=require('util');var moment=require(_0x45d5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45d5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x45d5('0x3'));var logger=require(_0x45d5('0x4'))(_0x45d5('0x5'));var config=require(_0x45d5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x45d5('0x7')][_0x45d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48a9b7,_0x5d4cf5,_0x31773d){return new BPromise(function(_0x1d425e,_0x25a20c){return client['request'](_0x48a9b7,_0x31773d)[_0x45d5('0x9')](function(_0x2a218f){logger[_0x45d5('0xa')](_0x45d5('0xb'),_0x5d4cf5,_0x45d5('0xc'));logger[_0x45d5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5d4cf5,_0x45d5('0xc'),JSON[_0x45d5('0xe')](_0x2a218f));if(_0x2a218f['error']){if(_0x2a218f[_0x45d5('0xf')]['code']===0x1f4){logger[_0x45d5('0xf')](_0x45d5('0xb'),_0x5d4cf5,_0x2a218f[_0x45d5('0xf')][_0x45d5('0x10')]);return _0x25a20c(_0x2a218f[_0x45d5('0xf')][_0x45d5('0x10')]);}logger[_0x45d5('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5d4cf5,_0x2a218f[_0x45d5('0xf')][_0x45d5('0x10')]);return _0x1d425e(_0x2a218f['error'][_0x45d5('0x10')]);}else{logger[_0x45d5('0xa')](_0x45d5('0xb'),_0x5d4cf5,_0x45d5('0xc'));_0x1d425e(_0x2a218f['result'][_0x45d5('0x10')]);}})[_0x45d5('0x11')](function(_0x3ceb08){logger['error'](_0x45d5('0xb'),_0x5d4cf5,_0x3ceb08);_0x25a20c(_0x3ceb08);});});}
\ No newline at end of file
index 21487fd..0035bd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf14b=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x316e26,_0x31d550){var _0xfd0bd6=function(_0x3cbdee){while(--_0x3cbdee){_0x316e26['push'](_0x316e26['shift']());}};_0xfd0bd6(++_0x31d550);}(_0xf14b,0xdd));var _0xbf14=function(_0x404c43,_0xb03e08){_0x404c43=_0x404c43-0x0;var _0x13aa4e=_0xf14b[_0x404c43];return _0x13aa4e;};'use strict';var multer=require(_0xbf14('0x0'));var util=require(_0xbf14('0x1'));var path=require(_0xbf14('0x2'));var timeout=require(_0xbf14('0x3'));var express=require(_0xbf14('0x4'));var router=express[_0xbf14('0x5')]();var fs_extra=require(_0xbf14('0x6'));var auth=require(_0xbf14('0x7'));var interaction=require(_0xbf14('0x8'));var config=require(_0xbf14('0x9'));var controller=require('./variable.controller');router[_0xbf14('0xa')]('/',auth[_0xbf14('0xb')](),controller[_0xbf14('0xc')]);router[_0xbf14('0xa')](_0xbf14('0xd'),auth[_0xbf14('0xb')](),controller[_0xbf14('0xe')]);router['post']('/',auth[_0xbf14('0xb')](),controller[_0xbf14('0xf')]);router[_0xbf14('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbf14('0x11')]);router[_0xbf14('0x12')](_0xbf14('0xd'),auth[_0xbf14('0xb')](),controller[_0xbf14('0x13')]);module[_0xbf14('0x14')]=router;
\ No newline at end of file
+var _0x279d=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x279d,0x1d8));var _0xd279=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x279d[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require(_0xd279('0x0'));var util=require(_0xd279('0x1'));var path=require(_0xd279('0x2'));var timeout=require(_0xd279('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd279('0x4'));var auth=require(_0xd279('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd279('0x6'));var controller=require(_0xd279('0x7'));router[_0xd279('0x8')]('/',auth[_0xd279('0x9')](),controller[_0xd279('0xa')]);router[_0xd279('0x8')](_0xd279('0xb'),auth['isAuthenticated'](),controller[_0xd279('0xc')]);router[_0xd279('0xd')]('/',auth[_0xd279('0x9')](),controller[_0xd279('0xe')]);router[_0xd279('0xf')](_0xd279('0xb'),auth[_0xd279('0x9')](),controller[_0xd279('0x10')]);router[_0xd279('0x11')](_0xd279('0xb'),auth[_0xd279('0x9')](),controller['destroy']);module[_0xd279('0x12')]=router;
\ No newline at end of file
index ff98813..2dc2b36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd06e=['name','exports'];(function(_0x2ca0cf,_0x2f56c3){var _0x12e852=function(_0x3ac096){while(--_0x3ac096){_0x2ca0cf['push'](_0x2ca0cf['shift']());}};_0x12e852(++_0x2f56c3);}(_0xd06e,0x129));var _0xed06=function(_0x3da07d,_0xa8b638){_0x3da07d=_0x3da07d-0x0;var _0x1998b1=_0xd06e[_0x3da07d];return _0x1998b1;};'use strict';var Sequelize=require('sequelize');module[_0xed06('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xed06('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5dbc=['STRING','name','sequelize'];(function(_0x393ae3,_0x279c90){var _0x355bf1=function(_0x54624c){while(--_0x54624c){_0x393ae3['push'](_0x393ae3['shift']());}};_0x355bf1(++_0x279c90);}(_0x5dbc,0x16a));var _0xc5db=function(_0x47f057,_0x2cc340){_0x47f057=_0x47f057-0x0;var _0xa4173d=_0x5dbc[_0x47f057];return _0xa4173d;};'use strict';var Sequelize=require(_0xc5db('0x0'));module['exports']={'name':{'type':Sequelize[_0xc5db('0x1')],'unique':_0xc5db('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc5db('0x1')]}};
\ No newline at end of file
index 575553f..35fc5ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89e2=['moment','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','then','get','Variables','UserProfileResource','destroy','error','stack','name','send','map','Variable','fieldName','type','key','query','keys','filters','intersection','model','length','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','fields','includeAll','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4fcb37,_0x1d3054){var _0x41733d=function(_0x43814a){while(--_0x43814a){_0x4fcb37['push'](_0x4fcb37['shift']());}};_0x41733d(++_0x1d3054);}(_0x89e2,0xe8));var _0x289e=function(_0x22e37e,_0x297674){_0x22e37e=_0x22e37e-0x0;var _0xa67fa6=_0x89e2[_0x22e37e];return _0xa67fa6;};'use strict';var emlformat=require(_0x289e('0x0'));var rimraf=require(_0x289e('0x1'));var zipdir=require(_0x289e('0x2'));var jsonpatch=require(_0x289e('0x3'));var rp=require(_0x289e('0x4'));var moment=require(_0x289e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x289e('0x6'));var path=require(_0x289e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x289e('0x8'));var fs=require('fs');var fs_extra=require(_0x289e('0x9'));var _=require(_0x289e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x289e('0xb'));var deskjs=require(_0x289e('0xc'));var toCsv=require(_0x289e('0xd'));var querystring=require(_0x289e('0xe'));var Papa=require(_0x289e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x289e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x289e('0x11'));var logger=require(_0x289e('0x12'))(_0x289e('0x13'));var utils=require(_0x289e('0x14'));var config=require(_0x289e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x289e('0x16'))['db'];function respondWithStatusCode(_0x11a2e6,_0xc07d35){_0xc07d35=_0xc07d35||0xcc;return function(_0x5c8178){if(_0x5c8178){return _0x11a2e6[_0x289e('0x17')](_0xc07d35);}return _0x11a2e6[_0x289e('0x18')](_0xc07d35)[_0x289e('0x19')]();};}function respondWithResult(_0x2e72d7,_0x53dffc){_0x53dffc=_0x53dffc||0xc8;return function(_0x46baee){if(_0x46baee){return _0x2e72d7[_0x289e('0x18')](_0x53dffc)['json'](_0x46baee);}};}function respondWithFilteredResult(_0x5007a1,_0x376d3e){return function(_0xdb8531){if(_0xdb8531){var _0xd85bbd=typeof _0x376d3e['offset']===_0x289e('0x1a')&&typeof _0x376d3e[_0x289e('0x1b')]==='undefined';var _0x45e568=_0xdb8531[_0x289e('0x1c')];var _0x18ef2e=_0xd85bbd?0x0:_0x376d3e[_0x289e('0x1d')];var _0x59fc75=_0xd85bbd?_0xdb8531[_0x289e('0x1c')]:_0x376d3e[_0x289e('0x1d')]+_0x376d3e[_0x289e('0x1b')];var _0x2e657c;if(_0x59fc75>=_0x45e568){_0x59fc75=_0x45e568;_0x2e657c=0xc8;}else{_0x2e657c=0xce;}_0x5007a1[_0x289e('0x18')](_0x2e657c);return _0x5007a1[_0x289e('0x1e')](_0x289e('0x1f'),_0x18ef2e+'-'+_0x59fc75+'/'+_0x45e568)[_0x289e('0x20')](_0xdb8531);}return null;};}function patchUpdates(_0x4e1676){return function(_0x4c8dd7){try{jsonpatch['apply'](_0x4c8dd7,_0x4e1676,!![]);}catch(_0x3a976b){return BPromise['reject'](_0x3a976b);}return _0x4c8dd7[_0x289e('0x21')]();};}function saveUpdates(_0x524d4c,_0x9d4b5f){return function(_0xc41e83){if(_0xc41e83){return _0xc41e83[_0x289e('0x22')](_0x524d4c)[_0x289e('0x23')](function(_0x22a9ae){return _0x22a9ae;});}return null;};}function removeEntity(_0x437b75,_0xfbd4de){return function(_0x2bfd8d){if(_0x2bfd8d){return _0x2bfd8d['destroy']()[_0x289e('0x23')](function(){var _0x10b9de=_0x2bfd8d[_0x289e('0x24')]({'plain':!![]});var _0x3af525=_0x289e('0x25');return db[_0x289e('0x26')][_0x289e('0x27')]({'where':{'type':_0x3af525,'resourceId':_0x10b9de['id']}})[_0x289e('0x23')](function(){return _0x2bfd8d;});})[_0x289e('0x23')](function(){_0x437b75[_0x289e('0x18')](0xcc)[_0x289e('0x19')]();});}};}function handleEntityNotFound(_0x424b8b,_0x54922c){return function(_0x37618d){if(!_0x37618d){_0x424b8b[_0x289e('0x17')](0x194);}return _0x37618d;};}function handleError(_0x39acb8,_0x3de348){_0x3de348=_0x3de348||0x1f4;return function(_0xa57f9f){logger[_0x289e('0x28')](_0xa57f9f[_0x289e('0x29')]);if(_0xa57f9f[_0x289e('0x2a')]){delete _0xa57f9f[_0x289e('0x2a')];}_0x39acb8[_0x289e('0x18')](_0x3de348)[_0x289e('0x2b')](_0xa57f9f);};}exports['index']=function(_0x36ab0b,_0x477f08){var _0x101062={},_0x33cacf={},_0x5f58e7={'count':0x0,'rows':[]};var _0xb5f8fd=_[_0x289e('0x2c')](db[_0x289e('0x2d')]['rawAttributes'],function(_0x443a76){return{'name':_0x443a76[_0x289e('0x2e')],'type':_0x443a76[_0x289e('0x2f')][_0x289e('0x30')]};});_0x33cacf['model']=_['map'](_0xb5f8fd,_0x289e('0x2a'));_0x33cacf[_0x289e('0x31')]=_[_0x289e('0x32')](_0x36ab0b[_0x289e('0x31')]);_0x33cacf[_0x289e('0x33')]=_[_0x289e('0x34')](_0x33cacf[_0x289e('0x35')],_0x33cacf['query']);_0x101062['attributes']=_[_0x289e('0x34')](_0x33cacf[_0x289e('0x35')],qs['fields'](_0x36ab0b['query']['fields']));_0x101062['attributes']=_0x101062['attributes'][_0x289e('0x36')]?_0x101062[_0x289e('0x37')]:_0x33cacf['model'];if(!_0x36ab0b['query']['hasOwnProperty']('nolimit')){_0x101062[_0x289e('0x1b')]=qs['limit'](_0x36ab0b[_0x289e('0x31')][_0x289e('0x1b')]);_0x101062[_0x289e('0x1d')]=qs[_0x289e('0x1d')](_0x36ab0b[_0x289e('0x31')][_0x289e('0x1d')]);}_0x101062[_0x289e('0x38')]=qs['sort'](_0x36ab0b['query'][_0x289e('0x39')]);_0x101062[_0x289e('0x3a')]=qs[_0x289e('0x33')](_[_0x289e('0x3b')](_0x36ab0b[_0x289e('0x31')],_0x33cacf['filters']),_0xb5f8fd);if(_0x36ab0b['query'][_0x289e('0x3c')]){_0x101062[_0x289e('0x3a')]=_[_0x289e('0x3d')](_0x101062['where'],{'$or':_[_0x289e('0x2c')](_0xb5f8fd,function(_0x5ca386){if(_0x5ca386[_0x289e('0x2f')]!==_0x289e('0x3e')){var _0x15bef9={};_0x15bef9[_0x5ca386[_0x289e('0x2a')]]={'$like':'%'+_0x36ab0b[_0x289e('0x31')]['filter']+'%'};return _0x15bef9;}})});}_0x101062=_['merge']({},_0x101062,_0x36ab0b[_0x289e('0x3f')]);var _0x8a24de={'where':_0x101062[_0x289e('0x3a')]};return db[_0x289e('0x2d')][_0x289e('0x1c')](_0x8a24de)[_0x289e('0x23')](function(_0x306cc3){_0x5f58e7[_0x289e('0x1c')]=_0x306cc3;if(_0x36ab0b[_0x289e('0x31')]['includeAll']){_0x101062[_0x289e('0x40')]=[{'all':!![]}];}return db['Variable'][_0x289e('0x41')](_0x101062);})[_0x289e('0x23')](function(_0x4c0b2b){_0x5f58e7[_0x289e('0x42')]=_0x4c0b2b;return _0x5f58e7;})[_0x289e('0x23')](respondWithFilteredResult(_0x477f08,_0x101062))[_0x289e('0x43')](handleError(_0x477f08,null));};exports['show']=function(_0x56cae4,_0x37e011){var _0x482aac={'raw':!![],'where':{'id':_0x56cae4[_0x289e('0x44')]['id']}},_0x570f1b={};_0x570f1b[_0x289e('0x35')]=_[_0x289e('0x32')](db[_0x289e('0x2d')][_0x289e('0x45')]);_0x570f1b['query']=_[_0x289e('0x32')](_0x56cae4[_0x289e('0x31')]);_0x570f1b[_0x289e('0x33')]=_['intersection'](_0x570f1b[_0x289e('0x35')],_0x570f1b[_0x289e('0x31')]);_0x482aac[_0x289e('0x37')]=_[_0x289e('0x34')](_0x570f1b[_0x289e('0x35')],qs[_0x289e('0x46')](_0x56cae4[_0x289e('0x31')]['fields']));_0x482aac[_0x289e('0x37')]=_0x482aac['attributes'][_0x289e('0x36')]?_0x482aac[_0x289e('0x37')]:_0x570f1b[_0x289e('0x35')];if(_0x56cae4['query'][_0x289e('0x47')]){_0x482aac[_0x289e('0x40')]=[{'all':!![]}];}_0x482aac=_[_0x289e('0x3d')]({},_0x482aac,_0x56cae4['options']);return db['Variable'][_0x289e('0x48')](_0x482aac)[_0x289e('0x23')](handleEntityNotFound(_0x37e011,null))[_0x289e('0x23')](respondWithResult(_0x37e011,null))[_0x289e('0x43')](handleError(_0x37e011,null));};exports['create']=function(_0x362e72,_0x2b7fd6){return db[_0x289e('0x2d')]['create'](_0x362e72['body'],{})[_0x289e('0x23')](function(_0x5addf6){var _0x21a870=_0x362e72[_0x289e('0x49')][_0x289e('0x24')]({'plain':!![]});if(!_0x21a870)throw new Error(_0x289e('0x4a'));if(_0x21a870[_0x289e('0x4b')]===_0x289e('0x49')){var _0x2b5227=_0x5addf6['get']({'plain':!![]});var _0x505b2d=_0x289e('0x25');return db[_0x289e('0x4c')][_0x289e('0x48')]({'where':{'name':_0x505b2d,'userProfileId':_0x21a870['userProfileId']},'raw':!![]})[_0x289e('0x23')](function(_0x10fdcc){if(_0x10fdcc&&_0x10fdcc['autoAssociation']===0x0){return db[_0x289e('0x26')]['create']({'name':_0x2b5227[_0x289e('0x2a')],'resourceId':_0x2b5227['id'],'type':_0x10fdcc['name'],'sectionId':_0x10fdcc['id']},{})['then'](function(){return _0x5addf6;});}else{return _0x5addf6;}})[_0x289e('0x43')](function(_0x53f8ec){logger[_0x289e('0x28')](_0x289e('0x4d'),_0x53f8ec);throw _0x53f8ec;});}return _0x5addf6;})[_0x289e('0x23')](respondWithResult(_0x2b7fd6,0xc9))[_0x289e('0x43')](handleError(_0x2b7fd6,null));};exports[_0x289e('0x22')]=function(_0xbc149b,_0x587670){if(_0xbc149b[_0x289e('0x4e')]['id']){delete _0xbc149b[_0x289e('0x4e')]['id'];}return db[_0x289e('0x2d')][_0x289e('0x48')]({'where':{'id':_0xbc149b[_0x289e('0x44')]['id']}})[_0x289e('0x23')](handleEntityNotFound(_0x587670,null))[_0x289e('0x23')](saveUpdates(_0xbc149b['body'],null))['then'](respondWithResult(_0x587670,null))[_0x289e('0x43')](handleError(_0x587670,null));};exports[_0x289e('0x27')]=function(_0x53a07d,_0x186421){return db[_0x289e('0x2d')]['find']({'where':{'id':_0x53a07d['params']['id']}})[_0x289e('0x23')](handleEntityNotFound(_0x186421,null))[_0x289e('0x23')](removeEntity(_0x186421,null))[_0x289e('0x43')](handleError(_0x186421,null));};
\ No newline at end of file
+var _0x562d=['show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','save','update','destroy','get','Variables','UserProfileResource','then','error','stack','name','send','index','map','Variable','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','include','rows','catch'];(function(_0xf5fbb7,_0xdb7f69){var _0x330d55=function(_0x45fd85){while(--_0x45fd85){_0xf5fbb7['push'](_0xf5fbb7['shift']());}};_0x330d55(++_0xdb7f69);}(_0x562d,0xb3));var _0xd562=function(_0x27f538,_0x1756e1){_0x27f538=_0x27f538-0x0;var _0xb2dd39=_0x562d[_0x27f538];return _0xb2dd39;};'use strict';var emlformat=require(_0xd562('0x0'));var rimraf=require(_0xd562('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd562('0x2'));var rp=require(_0xd562('0x3'));var moment=require('moment');var BPromise=require(_0xd562('0x4'));var Mustache=require(_0xd562('0x5'));var util=require(_0xd562('0x6'));var path=require(_0xd562('0x7'));var sox=require(_0xd562('0x8'));var csv=require(_0xd562('0x9'));var ejs=require(_0xd562('0xa'));var fs=require('fs');var fs_extra=require(_0xd562('0xb'));var _=require('lodash');var squel=require(_0xd562('0xc'));var crypto=require(_0xd562('0xd'));var jsforce=require(_0xd562('0xe'));var deskjs=require(_0xd562('0xf'));var toCsv=require(_0xd562('0x9'));var querystring=require(_0xd562('0x10'));var Papa=require(_0xd562('0x11'));var Redis=require(_0xd562('0x12'));var authService=require(_0xd562('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd562('0x14'));var hardwareService=require(_0xd562('0x15'));var logger=require(_0xd562('0x16'))(_0xd562('0x17'));var utils=require(_0xd562('0x18'));var config=require(_0xd562('0x19'));var licenseUtil=require(_0xd562('0x1a'));var db=require(_0xd562('0x1b'))['db'];function respondWithStatusCode(_0x4f9110,_0x16d03f){_0x16d03f=_0x16d03f||0xcc;return function(_0x497a96){if(_0x497a96){return _0x4f9110[_0xd562('0x1c')](_0x16d03f);}return _0x4f9110['status'](_0x16d03f)[_0xd562('0x1d')]();};}function respondWithResult(_0x2946a1,_0x5315b0){_0x5315b0=_0x5315b0||0xc8;return function(_0x128683){if(_0x128683){return _0x2946a1[_0xd562('0x1e')](_0x5315b0)[_0xd562('0x1f')](_0x128683);}};}function respondWithFilteredResult(_0x362357,_0x3b8f3c){return function(_0xed6631){if(_0xed6631){var _0x4f4536=typeof _0x3b8f3c['offset']===_0xd562('0x20')&&typeof _0x3b8f3c['limit']===_0xd562('0x20');var _0x2b2824=_0xed6631[_0xd562('0x21')];var _0x18167d=_0x4f4536?0x0:_0x3b8f3c[_0xd562('0x22')];var _0x3c118e=_0x4f4536?_0xed6631['count']:_0x3b8f3c[_0xd562('0x22')]+_0x3b8f3c[_0xd562('0x23')];var _0x5357c4;if(_0x3c118e>=_0x2b2824){_0x3c118e=_0x2b2824;_0x5357c4=0xc8;}else{_0x5357c4=0xce;}_0x362357[_0xd562('0x1e')](_0x5357c4);return _0x362357[_0xd562('0x24')](_0xd562('0x25'),_0x18167d+'-'+_0x3c118e+'/'+_0x2b2824)[_0xd562('0x1f')](_0xed6631);}return null;};}function patchUpdates(_0x23aaf8){return function(_0x46a9f4){try{jsonpatch['apply'](_0x46a9f4,_0x23aaf8,!![]);}catch(_0x5bc17f){return BPromise['reject'](_0x5bc17f);}return _0x46a9f4[_0xd562('0x26')]();};}function saveUpdates(_0x25bd76,_0x23c828){return function(_0x3b5a08){if(_0x3b5a08){return _0x3b5a08[_0xd562('0x27')](_0x25bd76)['then'](function(_0x29854d){return _0x29854d;});}return null;};}function removeEntity(_0x26075a,_0x4cd64d){return function(_0x25d3e4){if(_0x25d3e4){return _0x25d3e4[_0xd562('0x28')]()['then'](function(){var _0x3922cd=_0x25d3e4[_0xd562('0x29')]({'plain':!![]});var _0x4f8811=_0xd562('0x2a');return db[_0xd562('0x2b')][_0xd562('0x28')]({'where':{'type':_0x4f8811,'resourceId':_0x3922cd['id']}})[_0xd562('0x2c')](function(){return _0x25d3e4;});})[_0xd562('0x2c')](function(){_0x26075a[_0xd562('0x1e')](0xcc)[_0xd562('0x1d')]();});}};}function handleEntityNotFound(_0x2982fb,_0x430d19){return function(_0x2ed18c){if(!_0x2ed18c){_0x2982fb[_0xd562('0x1c')](0x194);}return _0x2ed18c;};}function handleError(_0x126fa9,_0x2cc1e7){_0x2cc1e7=_0x2cc1e7||0x1f4;return function(_0x44a855){logger[_0xd562('0x2d')](_0x44a855[_0xd562('0x2e')]);if(_0x44a855[_0xd562('0x2f')]){delete _0x44a855[_0xd562('0x2f')];}_0x126fa9[_0xd562('0x1e')](_0x2cc1e7)[_0xd562('0x30')](_0x44a855);};}exports[_0xd562('0x31')]=function(_0x5ae9a0,_0x11e96a){var _0x323b3a={},_0xc0b953={},_0x4f72b3={'count':0x0,'rows':[]};var _0x4af343=_[_0xd562('0x32')](db[_0xd562('0x33')][_0xd562('0x34')],function(_0x3591b2){return{'name':_0x3591b2['fieldName'],'type':_0x3591b2[_0xd562('0x35')]['key']};});_0xc0b953[_0xd562('0x36')]=_[_0xd562('0x32')](_0x4af343,_0xd562('0x2f'));_0xc0b953[_0xd562('0x37')]=_[_0xd562('0x38')](_0x5ae9a0[_0xd562('0x37')]);_0xc0b953[_0xd562('0x39')]=_[_0xd562('0x3a')](_0xc0b953[_0xd562('0x36')],_0xc0b953[_0xd562('0x37')]);_0x323b3a['attributes']=_['intersection'](_0xc0b953[_0xd562('0x36')],qs[_0xd562('0x3b')](_0x5ae9a0['query'][_0xd562('0x3b')]));_0x323b3a[_0xd562('0x3c')]=_0x323b3a[_0xd562('0x3c')][_0xd562('0x3d')]?_0x323b3a[_0xd562('0x3c')]:_0xc0b953[_0xd562('0x36')];if(!_0x5ae9a0[_0xd562('0x37')][_0xd562('0x3e')](_0xd562('0x3f'))){_0x323b3a['limit']=qs[_0xd562('0x23')](_0x5ae9a0[_0xd562('0x37')]['limit']);_0x323b3a['offset']=qs[_0xd562('0x22')](_0x5ae9a0[_0xd562('0x37')][_0xd562('0x22')]);}_0x323b3a['order']=qs[_0xd562('0x40')](_0x5ae9a0[_0xd562('0x37')][_0xd562('0x40')]);_0x323b3a[_0xd562('0x41')]=qs[_0xd562('0x39')](_['pick'](_0x5ae9a0['query'],_0xc0b953[_0xd562('0x39')]),_0x4af343);if(_0x5ae9a0[_0xd562('0x37')][_0xd562('0x42')]){_0x323b3a['where']=_['merge'](_0x323b3a[_0xd562('0x41')],{'$or':_[_0xd562('0x32')](_0x4af343,function(_0x3548c0){if(_0x3548c0[_0xd562('0x35')]!==_0xd562('0x43')){var _0xb823f7={};_0xb823f7[_0x3548c0[_0xd562('0x2f')]]={'$like':'%'+_0x5ae9a0['query'][_0xd562('0x42')]+'%'};return _0xb823f7;}})});}_0x323b3a=_[_0xd562('0x44')]({},_0x323b3a,_0x5ae9a0[_0xd562('0x45')]);var _0x45fca1={'where':_0x323b3a['where']};return db[_0xd562('0x33')]['count'](_0x45fca1)[_0xd562('0x2c')](function(_0x493b4e){_0x4f72b3['count']=_0x493b4e;if(_0x5ae9a0[_0xd562('0x37')]['includeAll']){_0x323b3a[_0xd562('0x46')]=[{'all':!![]}];}return db[_0xd562('0x33')]['findAll'](_0x323b3a);})['then'](function(_0x518a25){_0x4f72b3[_0xd562('0x47')]=_0x518a25;return _0x4f72b3;})[_0xd562('0x2c')](respondWithFilteredResult(_0x11e96a,_0x323b3a))[_0xd562('0x48')](handleError(_0x11e96a,null));};exports[_0xd562('0x49')]=function(_0x2ca3ec,_0x57fb4a){var _0x40c34a={'raw':!![],'where':{'id':_0x2ca3ec['params']['id']}},_0x341387={};_0x341387[_0xd562('0x36')]=_['keys'](db[_0xd562('0x33')][_0xd562('0x34')]);_0x341387['query']=_[_0xd562('0x38')](_0x2ca3ec[_0xd562('0x37')]);_0x341387[_0xd562('0x39')]=_[_0xd562('0x3a')](_0x341387[_0xd562('0x36')],_0x341387[_0xd562('0x37')]);_0x40c34a['attributes']=_['intersection'](_0x341387[_0xd562('0x36')],qs[_0xd562('0x3b')](_0x2ca3ec[_0xd562('0x37')][_0xd562('0x3b')]));_0x40c34a[_0xd562('0x3c')]=_0x40c34a['attributes'][_0xd562('0x3d')]?_0x40c34a[_0xd562('0x3c')]:_0x341387[_0xd562('0x36')];if(_0x2ca3ec[_0xd562('0x37')][_0xd562('0x4a')]){_0x40c34a[_0xd562('0x46')]=[{'all':!![]}];}_0x40c34a=_[_0xd562('0x44')]({},_0x40c34a,_0x2ca3ec['options']);return db[_0xd562('0x33')][_0xd562('0x4b')](_0x40c34a)['then'](handleEntityNotFound(_0x57fb4a,null))[_0xd562('0x2c')](respondWithResult(_0x57fb4a,null))[_0xd562('0x48')](handleError(_0x57fb4a,null));};exports[_0xd562('0x4c')]=function(_0x1a2ab4,_0x371b7f){return db[_0xd562('0x33')]['create'](_0x1a2ab4[_0xd562('0x4d')],{})[_0xd562('0x2c')](function(_0x4fd35d){var _0x43b787=_0x1a2ab4['user'][_0xd562('0x29')]({'plain':!![]});if(!_0x43b787)throw new Error(_0xd562('0x4e'));if(_0x43b787[_0xd562('0x4f')]===_0xd562('0x50')){var _0x59a03b=_0x4fd35d['get']({'plain':!![]});var _0x24cc8a=_0xd562('0x2a');return db[_0xd562('0x51')][_0xd562('0x4b')]({'where':{'name':_0x24cc8a,'userProfileId':_0x43b787[_0xd562('0x52')]},'raw':!![]})['then'](function(_0x52fa17){if(_0x52fa17&&_0x52fa17['autoAssociation']===0x0){return db['UserProfileResource'][_0xd562('0x4c')]({'name':_0x59a03b[_0xd562('0x2f')],'resourceId':_0x59a03b['id'],'type':_0x52fa17[_0xd562('0x2f')],'sectionId':_0x52fa17['id']},{})[_0xd562('0x2c')](function(){return _0x4fd35d;});}else{return _0x4fd35d;}})[_0xd562('0x48')](function(_0x31f9e5){logger[_0xd562('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31f9e5);throw _0x31f9e5;});}return _0x4fd35d;})[_0xd562('0x2c')](respondWithResult(_0x371b7f,0xc9))[_0xd562('0x48')](handleError(_0x371b7f,null));};exports[_0xd562('0x27')]=function(_0x20fce8,_0x26ee74){if(_0x20fce8[_0xd562('0x4d')]['id']){delete _0x20fce8['body']['id'];}return db['Variable'][_0xd562('0x4b')]({'where':{'id':_0x20fce8['params']['id']}})[_0xd562('0x2c')](handleEntityNotFound(_0x26ee74,null))[_0xd562('0x2c')](saveUpdates(_0x20fce8[_0xd562('0x4d')],null))[_0xd562('0x2c')](respondWithResult(_0x26ee74,null))[_0xd562('0x48')](handleError(_0x26ee74,null));};exports[_0xd562('0x28')]=function(_0x2b9122,_0x2c0f01){return db[_0xd562('0x33')][_0xd562('0x4b')]({'where':{'id':_0x2b9122[_0xd562('0x53')]['id']}})[_0xd562('0x2c')](handleEntityNotFound(_0x2c0f01,null))[_0xd562('0x2c')](removeEntity(_0x2c0f01,null))[_0xd562('0x48')](handleError(_0x2c0f01,null));};
\ No newline at end of file
index 99c521f..f1da36d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x699b=['util','api','moment','bluebird','path','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x392c3a,_0x53f7ff){var _0x46df92=function(_0x21f50c){while(--_0x21f50c){_0x392c3a['push'](_0x392c3a['shift']());}};_0x46df92(++_0x53f7ff);}(_0x699b,0x8f));var _0xb699=function(_0x5dfdc4,_0x2f1fe1){_0x5dfdc4=_0x5dfdc4-0x0;var _0x41228d=_0x699b[_0x5dfdc4];return _0x41228d;};'use strict';var _=require(_0xb699('0x0'));var util=require(_0xb699('0x1'));var logger=require('../../config/logger')(_0xb699('0x2'));var moment=require(_0xb699('0x3'));var BPromise=require(_0xb699('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb699('0x5'));var rimraf=require('rimraf');var config=require(_0xb699('0x6'));var attributes=require(_0xb699('0x7'));module[_0xb699('0x8')]=function(_0x41494b,_0x7c5f90){return _0x41494b[_0xb699('0x9')](_0xb699('0xa'),attributes,{'tableName':_0xb699('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd01c=['./variable.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x39ddd0,_0x530c16){var _0x39dd96=function(_0x1b7d66){while(--_0x1b7d66){_0x39ddd0['push'](_0x39ddd0['shift']());}};_0x39dd96(++_0x530c16);}(_0xd01c,0x19d));var _0xcd01=function(_0x3a2a77,_0x46d419){_0x3a2a77=_0x3a2a77-0x0;var _0x486a19=_0xd01c[_0x3a2a77];return _0x486a19;};'use strict';var _=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var logger=require(_0xcd01('0x2'))(_0xcd01('0x3'));var moment=require(_0xcd01('0x4'));var BPromise=require(_0xcd01('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcd01('0x6'));var config=require('../../config/environment');var attributes=require(_0xcd01('0x7'));module[_0xcd01('0x8')]=function(_0x1ce208,_0x25d7a8){return _0x1ce208[_0xcd01('0x9')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 27ee876..3136cd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x9fd42f,_0x57080f){var _0x11f7b6=function(_0xaacd91){while(--_0xaacd91){_0x9fd42f['push'](_0x9fd42f['shift']());}};_0x11f7b6(++_0x57080f);}(_0x7217,0x19e));var _0x7721=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7217[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});};
\ No newline at end of file
+var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xa41a,0x6b));var _0xaa41=function(_0xd04a1d,_0x636ea2){_0xd04a1d=_0xd04a1d-0x0;var _0xd609fa=_0xa41a[_0xd04a1d];return _0xd609fa;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});};
\ No newline at end of file
index 3cdb232..a1cf10b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf98e=['get','/fetch','canUpdate','fetch','/reset','isAuthenticated','/pull','pull','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','index'];(function(_0x5d6482,_0x1c9b00){var _0x32e681=function(_0x398459){while(--_0x398459){_0x5d6482['push'](_0x5d6482['shift']());}};_0x32e681(++_0x1c9b00);}(_0xf98e,0xeb));var _0xef98=function(_0x2c1583,_0x206c27){_0x2c1583=_0x2c1583-0x0;var _0x2f5beb=_0xf98e[_0x2c1583];return _0x2f5beb;};'use strict';var express=require(_0xef98('0x0'));var router=express[_0xef98('0x1')]();var auth=require(_0xef98('0x2'));var controller=require(_0xef98('0x3'));router['get']('/',controller[_0xef98('0x4')]);router[_0xef98('0x5')](_0xef98('0x6'),auth['isAuthenticated'](),auth[_0xef98('0x7')](),controller[_0xef98('0x8')]);router[_0xef98('0x5')](_0xef98('0x9'),auth[_0xef98('0xa')](),auth[_0xef98('0x7')](),controller['reset']);router['get'](_0xef98('0xb'),auth['isAuthenticated'](),auth[_0xef98('0x7')](),controller[_0xef98('0xc')]);router[_0xef98('0x5')]('/restart',auth[_0xef98('0xa')](),controller['restart']);router[_0xef98('0x5')](_0xef98('0xd'),controller[_0xef98('0xe')]);module[_0xef98('0xf')]=router;
\ No newline at end of file
+var _0xbfe7=['express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/pull','pull','restart','/migrations','migrations','exports'];(function(_0x389057,_0x3e56c9){var _0x7cdee=function(_0x4321bb){while(--_0x4321bb){_0x389057['push'](_0x389057['shift']());}};_0x7cdee(++_0x3e56c9);}(_0xbfe7,0xb4));var _0x7bfe=function(_0x37d393,_0x2e9ec1){_0x37d393=_0x37d393-0x0;var _0x3e614a=_0xbfe7[_0x37d393];return _0x3e614a;};'use strict';var express=require(_0x7bfe('0x0'));var router=express[_0x7bfe('0x1')]();var auth=require(_0x7bfe('0x2'));var controller=require(_0x7bfe('0x3'));router[_0x7bfe('0x4')]('/',controller['index']);router[_0x7bfe('0x4')](_0x7bfe('0x5'),auth[_0x7bfe('0x6')](),auth[_0x7bfe('0x7')](),controller[_0x7bfe('0x8')]);router['get']('/reset',auth[_0x7bfe('0x6')](),auth[_0x7bfe('0x7')](),controller['reset']);router[_0x7bfe('0x4')](_0x7bfe('0x9'),auth[_0x7bfe('0x6')](),auth[_0x7bfe('0x7')](),controller[_0x7bfe('0xa')]);router[_0x7bfe('0x4')]('/restart',auth[_0x7bfe('0x6')](),controller[_0x7bfe('0xb')]);router['get'](_0x7bfe('0xc'),controller[_0x7bfe('0xd')]);module[_0x7bfe('0xe')]=router;
\ No newline at end of file
index 1bfa4e9..3173f46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5579=['tags','2.0.0','status','json','fetch','origin','master','error','reset','FETCH_HEAD','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','Migration','sequelize','getQueryInterface','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','version','compare-versions','exec','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest'];(function(_0x3ada49,_0x2b1330){var _0x1723c1=function(_0x43e8df){while(--_0x43e8df){_0x3ada49['push'](_0x3ada49['shift']());}};_0x1723c1(++_0x2b1330);}(_0x5579,0x135));var _0x9557=function(_0x5b599b,_0x5b7f8f){_0x5b599b=_0x5b599b-0x0;var _0x819f25=_0x5579[_0x5b599b];return _0x819f25;};'use strict';var Umzug=require('umzug');var path=require(_0x9557('0x0'));var fs=require('fs');var _=require(_0x9557('0x1'));var pkginfo=require('pkginfo')(module,_0x9557('0x2'));var compareVersions=require(_0x9557('0x3'));var exec=require('child_process')[_0x9557('0x4')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x9557('0x5'));var logger=require(_0x9557('0x6'))('update');var git=require(_0x9557('0x7'))(config[_0x9557('0x8')]);exports[_0x9557('0x9')]=function(_0xead28f,_0x2e0d55){var _0x196faa={'current':module[_0x9557('0xa')][_0x9557('0x2')],'phonebar':0x2};if(_0xead28f[_0x9557('0xb')]&&_0xead28f[_0x9557('0xb')][_0x9557('0xc')]){return git['fetch']()[_0x9557('0xd')](function(_0x3805f7,_0x505d06){_0x196faa[_0x9557('0xc')]=(_0x3805f7?module[_0x9557('0xa')]['version']:_0x505d06[_0x9557('0xc')])||_0x9557('0xe');return _0x2e0d55[_0x9557('0xf')](0xc8)[_0x9557('0x10')](_0x196faa);});}else{return _0x2e0d55[_0x9557('0xf')](0xc8)['json'](_0x196faa);}};exports['fetch']=function(_0x3172f9,_0x8be75a){return git[_0x9557('0x11')]([_0x9557('0x12'),_0x9557('0x13')],function(_0xa5e22b){if(_0xa5e22b){logger[_0x9557('0x14')](_0xa5e22b);return _0x8be75a[_0x9557('0xf')](0x1f4)['json'](_0xa5e22b);}logger['info']('git\x20fetch');return _0x8be75a['status'](0xc8)[_0x9557('0x10')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x9557('0x15')]=function(_0x14accb,_0x86c6ac){return git[_0x9557('0x15')](['--hard',_0x9557('0x16')],function(_0x5ba56f){if(_0x5ba56f){logger[_0x9557('0x14')](_0x5ba56f);return _0x86c6ac['status'](0x1f4)[_0x9557('0x10')](_0x5ba56f);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x86c6ac[_0x9557('0xf')](0xc8)[_0x9557('0x10')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x1f1aa9,_0x290459){exec(_0x9557('0x17'),function(_0x4c2606,_0xb58417,_0x2c493d){logger[_0x9557('0x18')](_0xb58417);logger['info'](_0x2c493d);if(_0x4c2606){logger[_0x9557('0x14')](_0x4c2606);return _0x290459[_0x9557('0xf')](0x1f4)[_0x9557('0x10')](_0x4c2606);}return _0x290459['status'](0xc8)[_0x9557('0x10')]({'output':_0xb58417});});};exports[_0x9557('0x19')]=function(_0x9210dc,_0x48314c){return pm2[_0x9557('0x19')](_0x9557('0x1a'))[_0x9557('0x1b')](function(_0x3d6024){logger[_0x9557('0x18')](_0x9557('0x1c'),_0x3d6024);return _0x48314c[_0x9557('0xf')](0xc8)['json']({'output':_0x9557('0x1d')});})[_0x9557('0x1e')](function(_0x2c1c18){logger[_0x9557('0x14')](_0x2c1c18);return _0x48314c[_0x9557('0xf')](0x1f4)[_0x9557('0x10')](_0x2c1c18);});};exports[_0x9557('0x1f')]=function(_0x49a9ab,_0x3194bd){var _0x2f3eab=fs[_0x9557('0x20')](path[_0x9557('0x21')](config[_0x9557('0x8')],_0x9557('0x22'),_0x9557('0x1f')));var _0x4b0883=[];for(var _0x392617=0x0;_0x392617<_0x2f3eab[_0x9557('0x23')];_0x392617++){var _0x30c07f=_0x2f3eab[_0x392617][_0x9557('0x24')](_0x9557('0x25'),'');if(compareVersions(module[_0x9557('0xa')][_0x9557('0x2')],_0x30c07f)===-0x1){_0x4b0883['push'](_0x30c07f);}}if(_0x4b0883['length']){var _0x44ff2e=_0x4b0883['sort'](compareVersions);var _0x39863d=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x9557('0x26')],'modelName':_0x9557('0x26'),'columnName':_0x9557('0x2')},'migrations':{'params':[db[_0x9557('0x27')][_0x9557('0x28')](),db['sequelize']['constructor'],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['join'](config['root'],_0x9557('0x22'),_0x9557('0x1f')),'pattern':/\.js$/}});_0x39863d['up']({'migrations':_[_0x9557('0x29')](_0x44ff2e,function(_0x4e7d87){return _0x4e7d87+_0x9557('0x25');})})[_0x9557('0x1b')](function(){return _0x3194bd[_0x9557('0xf')](0xc8)['json']({'output':_0x9557('0x2a')+module[_0x9557('0xa')][_0x9557('0x2')]+'\x20to\x20'+_[_0x9557('0x2b')](_0x44ff2e),'migrations':_[_0x9557('0x21')](_0x44ff2e)});})[_0x9557('0x1e')](function(_0x2f0821){if(_0x2f0821 instanceof db['sequelize'][_0x9557('0x2c')]){return _0x3194bd[_0x9557('0xf')](0xc8)[_0x9557('0x10')]({'output':_0x9557('0x2d')});}else{return _0x3194bd[_0x9557('0xf')](0x1f4)['json'](_0x2f0821);}});}else{return _0x3194bd[_0x9557('0xf')](0xc8)[_0x9557('0x10')]({'output':_0x9557('0x2d')});}};
\ No newline at end of file
+var _0x12b3=['map','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','latest','fetch','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_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','readdirSync','length','.js','push','Migration','getQueryInterface','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x12b3,0x1b6));var _0x312b=function(_0xb3bbc8,_0x2a3635){_0xb3bbc8=_0xb3bbc8-0x0;var _0x3254b7=_0x12b3[_0xb3bbc8];return _0x3254b7;};'use strict';var Umzug=require('umzug');var path=require(_0x312b('0x0'));var fs=require('fs');var _=require(_0x312b('0x1'));var pkginfo=require(_0x312b('0x2'))(module,_0x312b('0x3'));var compareVersions=require(_0x312b('0x4'));var exec=require(_0x312b('0x5'))['exec'];var db=require(_0x312b('0x6'))['db'];var config=require(_0x312b('0x7'));var pm2=require(_0x312b('0x8'));var logger=require(_0x312b('0x9'))('update');var git=require(_0x312b('0xa'))(config[_0x312b('0xb')]);exports['index']=function(_0x18a451,_0x29af7b){var _0x1e10c8={'current':module[_0x312b('0xc')][_0x312b('0x3')],'phonebar':0x2};if(_0x18a451[_0x312b('0xd')]&&_0x18a451[_0x312b('0xd')][_0x312b('0xe')]){return git[_0x312b('0xf')]()['tags'](function(_0x241061,_0x4e6ac9){_0x1e10c8[_0x312b('0xe')]=(_0x241061?module[_0x312b('0xc')][_0x312b('0x3')]:_0x4e6ac9[_0x312b('0xe')])||_0x312b('0x10');return _0x29af7b[_0x312b('0x11')](0xc8)['json'](_0x1e10c8);});}else{return _0x29af7b[_0x312b('0x11')](0xc8)[_0x312b('0x12')](_0x1e10c8);}};exports[_0x312b('0xf')]=function(_0x30ed48,_0x591884){return git[_0x312b('0xf')]([_0x312b('0x13'),_0x312b('0x14')],function(_0x563186){if(_0x563186){logger[_0x312b('0x15')](_0x563186);return _0x591884[_0x312b('0x11')](0x1f4)[_0x312b('0x12')](_0x563186);}logger[_0x312b('0x16')](_0x312b('0x17'));return _0x591884[_0x312b('0x11')](0xc8)['json']({'output':_0x312b('0x18')});});};exports['reset']=function(_0x5e91ac,_0x5e3010){return git[_0x312b('0x19')]([_0x312b('0x1a'),_0x312b('0x1b')],function(_0x281c20){if(_0x281c20){logger[_0x312b('0x15')](_0x281c20);return _0x5e3010[_0x312b('0x11')](0x1f4)['json'](_0x281c20);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5e3010['status'](0xc8)['json']({'output':_0x312b('0x1c')});});};exports[_0x312b('0x1d')]=function(_0x11f8fa,_0x5d7b11){exec(_0x312b('0x1e'),function(_0x32149e,_0x133444,_0x32c434){logger[_0x312b('0x16')](_0x133444);logger['info'](_0x32c434);if(_0x32149e){logger[_0x312b('0x15')](_0x32149e);return _0x5d7b11['status'](0x1f4)[_0x312b('0x12')](_0x32149e);}return _0x5d7b11[_0x312b('0x11')](0xc8)[_0x312b('0x12')]({'output':_0x133444});});};exports[_0x312b('0x1f')]=function(_0xe50042,_0x4913aa){return pm2[_0x312b('0x1f')](_0x312b('0x20'))[_0x312b('0x21')](function(_0x11479b){logger[_0x312b('0x16')](_0x312b('0x22'),_0x11479b);return _0x4913aa[_0x312b('0x11')](0xc8)[_0x312b('0x12')]({'output':_0x312b('0x23')});})['catch'](function(_0x5d09a0){logger[_0x312b('0x15')](_0x5d09a0);return _0x4913aa[_0x312b('0x11')](0x1f4)[_0x312b('0x12')](_0x5d09a0);});};exports[_0x312b('0x24')]=function(_0x4c2f46,_0x331ae4){var _0x3c249a=fs[_0x312b('0x25')](path['join'](config['root'],'server',_0x312b('0x24')));var _0x138d4a=[];for(var _0x3d413=0x0;_0x3d413<_0x3c249a[_0x312b('0x26')];_0x3d413++){var _0x23804c=_0x3c249a[_0x3d413]['replace'](_0x312b('0x27'),'');if(compareVersions(module[_0x312b('0xc')][_0x312b('0x3')],_0x23804c)===-0x1){_0x138d4a[_0x312b('0x28')](_0x23804c);}}if(_0x138d4a[_0x312b('0x26')]){var _0x54c2f1=_0x138d4a['sort'](compareVersions);var _0x1f285b=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x312b('0x29')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db['sequelize'][_0x312b('0x2a')](),db[_0x312b('0x2b')][_0x312b('0x2c')],function(){throw new Error(_0x312b('0x2d'));}],'path':path[_0x312b('0x2e')](config[_0x312b('0xb')],_0x312b('0x2f'),_0x312b('0x24')),'pattern':/\.js$/}});_0x1f285b['up']({'migrations':_[_0x312b('0x30')](_0x54c2f1,function(_0x3ef51e){return _0x3ef51e+_0x312b('0x27');})})['then'](function(){return _0x331ae4[_0x312b('0x11')](0xc8)[_0x312b('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x312b('0xc')][_0x312b('0x3')]+_0x312b('0x31')+_[_0x312b('0x32')](_0x54c2f1),'migrations':_[_0x312b('0x2e')](_0x54c2f1)});})[_0x312b('0x33')](function(_0x4fba91){if(_0x4fba91 instanceof db[_0x312b('0x2b')][_0x312b('0x34')]){return _0x331ae4['status'](0xc8)[_0x312b('0x12')]({'output':_0x312b('0x35')});}else{return _0x331ae4['status'](0x1f4)[_0x312b('0x12')](_0x4fba91);}});}else{return _0x331ae4['status'](0xc8)[_0x312b('0x12')]({'output':_0x312b('0x35')});}};
\ No newline at end of file
index 2755a37..dfa235e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cfd=['exports','util','express','Router','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','/:id','post','create','put','destroy'];(function(_0xea81a1,_0xb28e9e){var _0x2cd030=function(_0x3f8ea5){while(--_0x3f8ea5){_0xea81a1['push'](_0xea81a1['shift']());}};_0x2cd030(++_0xb28e9e);}(_0x0cfd,0x11e));var _0xd0cf=function(_0x3dfdd0,_0x125ee0){_0x3dfdd0=_0x3dfdd0-0x0;var _0x39857e=_0x0cfd[_0x3dfdd0];return _0x39857e;};'use strict';var multer=require('multer');var util=require(_0xd0cf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd0cf('0x1'));var router=express[_0xd0cf('0x2')]();var fs_extra=require(_0xd0cf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd0cf('0x4'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xd0cf('0x5')]('/',auth['isAuthenticated'](),controller[_0xd0cf('0x6')]);router['get'](_0xd0cf('0x7'),auth[_0xd0cf('0x8')](),controller['describe']);router[_0xd0cf('0x5')](_0xd0cf('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xd0cf('0xa')]('/',auth[_0xd0cf('0x8')](),controller[_0xd0cf('0xb')]);router[_0xd0cf('0xc')](_0xd0cf('0x9'),auth[_0xd0cf('0x8')](),controller['update']);router['delete'](_0xd0cf('0x9'),auth[_0xd0cf('0x8')](),controller[_0xd0cf('0xd')]);module[_0xd0cf('0xe')]=router;
\ No newline at end of file
+var _0x5435=['post','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x5435,0x9d));var _0x5543=function(_0x3addcd,_0x34fec3){_0x3addcd=_0x3addcd-0x0;var _0x388b0c=_0x5435[_0x3addcd];return _0x388b0c;};'use strict';var multer=require('multer');var util=require(_0x5543('0x0'));var path=require('path');var timeout=require(_0x5543('0x1'));var express=require(_0x5543('0x2'));var router=express[_0x5543('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5543('0x4'));var interaction=require(_0x5543('0x5'));var config=require(_0x5543('0x6'));var controller=require(_0x5543('0x7'));router[_0x5543('0x8')]('/',auth['isAuthenticated'](),controller[_0x5543('0x9')]);router[_0x5543('0x8')](_0x5543('0xa'),auth['isAuthenticated'](),controller[_0x5543('0xb')]);router['get'](_0x5543('0xc'),auth[_0x5543('0xd')](),controller['show']);router[_0x5543('0xe')]('/',auth[_0x5543('0xd')](),controller[_0x5543('0xf')]);router[_0x5543('0x10')]('/:id',auth[_0x5543('0xd')](),controller['update']);router[_0x5543('0x11')](_0x5543('0xc'),auth[_0x5543('0xd')](),controller['destroy']);module[_0x5543('0x12')]=router;
\ No newline at end of file
index 0a0a7a4..0cb767e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7275=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x3072af,_0x3676cc){var _0x42ab12=function(_0x7ee16d){while(--_0x7ee16d){_0x3072af['push'](_0x3072af['shift']());}};_0x42ab12(++_0x3676cc);}(_0x7275,0x143));var _0x5727=function(_0x39cb92,_0x226cde){_0x39cb92=_0x39cb92-0x0;var _0x1c392b=_0x7275[_0x39cb92];return _0x1c392b;};'use strict';var Sequelize=require(_0x5727('0x0'));module[_0x5727('0x1')]={'type':{'type':Sequelize[_0x5727('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5727('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5727('0x2')]},'interface':{'type':Sequelize[_0x5727('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x5727('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5727('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x5727('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x5727('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5727('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5727('0x4')]},'reason':{'type':Sequelize[_0x5727('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5727('0x2')]},'channelstate':{'type':Sequelize[_0x5727('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5727('0x2')]},'connectedlinename':{'type':Sequelize[_0x5727('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5727('0x2')]},'context':{'type':Sequelize[_0x5727('0x2')]},'exten':{'type':Sequelize[_0x5727('0x2')]},'priority':{'type':Sequelize[_0x5727('0x2')]},'destchannel':{'type':Sequelize[_0x5727('0x2')]},'destchannelstate':{'type':Sequelize[_0x5727('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x5727('0x2')]},'destcalleridname':{'type':Sequelize[_0x5727('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5727('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5727('0x2')]},'destlanguage':{'type':Sequelize[_0x5727('0x2')]},'destaccountcode':{'type':Sequelize[_0x5727('0x2')]},'destcontext':{'type':Sequelize[_0x5727('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5727('0x2')]},'destuniqueid':{'type':Sequelize[_0x5727('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x5727('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x5727('0x2')]},'transfer':{'type':Sequelize[_0x5727('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5727('0x2')],'comment':_0x5727('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x5727('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8ed7=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x8ed7,0x8b));var _0x78ed=function(_0x512c4b,_0x1ae2b7){_0x512c4b=_0x512c4b-0x0;var _0x1211c2=_0x8ed7[_0x512c4b];return _0x1211c2;};'use strict';var Sequelize=require('sequelize');module[_0x78ed('0x0')]={'type':{'type':Sequelize[_0x78ed('0x1')]},'uniqueid':{'type':Sequelize[_0x78ed('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x78ed('0x1')]},'interface':{'type':Sequelize[_0x78ed('0x1')]},'membername':{'type':Sequelize[_0x78ed('0x1')]},'agentcalledAt':{'type':Sequelize[_0x78ed('0x2')]},'agentconnectAt':{'type':Sequelize[_0x78ed('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x78ed('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x78ed('0x2')]},'agentdumpAt':{'type':Sequelize[_0x78ed('0x2')]},'holdtime':{'type':Sequelize[_0x78ed('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x78ed('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x78ed('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x78ed('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x78ed('0x1')]},'channelstate':{'type':Sequelize[_0x78ed('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x78ed('0x1')]},'connectedlinename':{'type':Sequelize[_0x78ed('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x78ed('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x78ed('0x1')]},'priority':{'type':Sequelize[_0x78ed('0x1')]},'destchannel':{'type':Sequelize[_0x78ed('0x1')]},'destchannelstate':{'type':Sequelize[_0x78ed('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x78ed('0x1')]},'destcalleridnum':{'type':Sequelize[_0x78ed('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x78ed('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x78ed('0x1')]},'destuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x78ed('0x1')]},'transfer':{'type':Sequelize[_0x78ed('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x78ed('0x1')],'comment':_0x78ed('0x5')},'transferexten':{'type':Sequelize[_0x78ed('0x1')]},'transferuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'agententerreason':{'type':Sequelize[_0x78ed('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index fdbf47e..bc1f3c3 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(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 79d9599..65fc996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0faf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','destuniqueid','lodash','../../config/logger'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x0faf,0x132));var _0xf0fa=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0x0faf[_0x466e57];return _0x34df42;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var logger=require(_0xf0fa('0x1'))(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var BPromise=require(_0xf0fa('0x4'));var rp=require(_0xf0fa('0x5'));var fs=require('fs');var path=require(_0xf0fa('0x6'));var rimraf=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var attributes=require(_0xf0fa('0x9'));module['exports']=function(_0x3637a3,_0x44ffa0){return _0x3637a3[_0xf0fa('0xa')](_0xf0fa('0xb'),attributes,{'tableName':_0xf0fa('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xf0fa('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xeedf=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','report_agent','destuniqueid'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0xeedf,0x12c));var _0xfeed=function(_0x2d12b3,_0x217abc){_0x2d12b3=_0x2d12b3-0x0;var _0x2880c5=_0xeedf[_0x2d12b3];return _0x2880c5;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))('api');var moment=require(_0xfeed('0x3'));var BPromise=require('bluebird');var rp=require(_0xfeed('0x4'));var fs=require('fs');var path=require(_0xfeed('0x5'));var rimraf=require(_0xfeed('0x6'));var config=require(_0xfeed('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0xfeed('0x8')]=function(_0x2c211d,_0x5df4fe){return _0x2c211d[_0xfeed('0x9')]('VoiceAgentReport',attributes,{'tableName':_0xfeed('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xfeed('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index dbe6d0f..ffa87f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b33=['info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateVoiceAgentReport','create','body','options','VoiceAgentReport','raw','where','attributes','limit','debug','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x1b33,0x1a6));var _0x31b3=function(_0x41caac,_0x50c421){_0x41caac=_0x41caac-0x0;var _0x28d2ba=_0x1b33[_0x41caac];return _0x28d2ba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x31b3('0x0'));var BPromise=require(_0x31b3('0x1'));var rs=require(_0x31b3('0x2'));var fs=require('fs');var Redis=require(_0x31b3('0x3'));var db=require(_0x31b3('0x4'))['db'];var utils=require(_0x31b3('0x5'));var logger=require(_0x31b3('0x6'))(_0x31b3('0x7'));var config=require(_0x31b3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x31b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a21d1,_0x1d6f57,_0x186cde){return new BPromise(function(_0x56e6da,_0x5a4308){return client[_0x31b3('0xa')](_0x3a21d1,_0x186cde)[_0x31b3('0xb')](function(_0x26fe45){logger[_0x31b3('0xc')](_0x31b3('0xd'),_0x1d6f57,_0x31b3('0xe'));logger['debug'](_0x31b3('0xf'),_0x1d6f57,_0x31b3('0xe'),JSON['stringify'](_0x26fe45));if(_0x26fe45[_0x31b3('0x10')]){if(_0x26fe45[_0x31b3('0x10')][_0x31b3('0x11')]===0x1f4){logger[_0x31b3('0x10')](_0x31b3('0xd'),_0x1d6f57,_0x26fe45[_0x31b3('0x10')][_0x31b3('0x12')]);return _0x5a4308(_0x26fe45['error'][_0x31b3('0x12')]);}logger[_0x31b3('0x10')](_0x31b3('0xd'),_0x1d6f57,_0x26fe45[_0x31b3('0x10')][_0x31b3('0x12')]);return _0x56e6da(_0x26fe45[_0x31b3('0x10')][_0x31b3('0x12')]);}else{logger[_0x31b3('0xc')](_0x31b3('0xd'),_0x1d6f57,'request\x20sent');_0x56e6da(_0x26fe45[_0x31b3('0x13')][_0x31b3('0x12')]);}})['catch'](function(_0xced36e){logger[_0x31b3('0x10')](_0x31b3('0xd'),_0x1d6f57,_0xced36e);_0x5a4308(_0xced36e);});});}exports[_0x31b3('0x14')]=function(_0x2a42ba){var _0x2221cf=this;return new Promise(function(_0x4c4675,_0x1076ba){return db['VoiceAgentReport'][_0x31b3('0x15')](_0x2a42ba[_0x31b3('0x16')],{'raw':_0x2a42ba['options']?_0x2a42ba[_0x31b3('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5b517b){logger[_0x31b3('0xc')](_0x31b3('0x14'),_0x2a42ba);logger['debug'](_0x31b3('0x14'),_0x2a42ba,JSON['stringify'](_0x5b517b));_0x4c4675(_0x5b517b);})['catch'](function(_0x357377){logger[_0x31b3('0x10')](_0x31b3('0x14'),_0x357377['message'],_0x2a42ba);_0x1076ba(_0x2221cf[_0x31b3('0x10')](0x1f4,_0x357377['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x1f8220){var _0x527b92=this;return new Promise(function(_0x36d949,_0x1bc93e){return db[_0x31b3('0x18')]['update'](_0x1f8220[_0x31b3('0x16')],{'raw':_0x1f8220[_0x31b3('0x17')]?_0x1f8220[_0x31b3('0x17')][_0x31b3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f8220['options']?_0x1f8220[_0x31b3('0x17')][_0x31b3('0x1a')]||null:null,'attributes':_0x1f8220[_0x31b3('0x17')]?_0x1f8220[_0x31b3('0x17')][_0x31b3('0x1b')]||null:null,'limit':_0x1f8220[_0x31b3('0x17')]?_0x1f8220[_0x31b3('0x17')][_0x31b3('0x1c')]||null:null})['then'](function(_0x5efda5){logger['info']('UpdateVoiceAgentReport',_0x1f8220);logger[_0x31b3('0x1d')]('UpdateVoiceAgentReport',_0x1f8220,JSON[_0x31b3('0x1e')](_0x5efda5));_0x36d949(_0x5efda5);})['catch'](function(_0x41df3a){logger[_0x31b3('0x10')]('UpdateVoiceAgentReport',_0x41df3a[_0x31b3('0x12')],_0x1f8220);_0x1bc93e(_0x527b92[_0x31b3('0x10')](0x1f4,_0x41df3a[_0x31b3('0x12')]));});});};
\ No newline at end of file
+var _0x9c29=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateVoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x9c29,0x12a));var _0x99c2=function(_0x478541,_0xb68256){_0x478541=_0x478541-0x0;var _0x5b0b05=_0x9c29[_0x478541];return _0x5b0b05;};'use strict';var _=require(_0x99c2('0x0'));var util=require(_0x99c2('0x1'));var moment=require(_0x99c2('0x2'));var BPromise=require('bluebird');var rs=require(_0x99c2('0x3'));var fs=require('fs');var Redis=require(_0x99c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x99c2('0x5'))(_0x99c2('0x6'));var config=require(_0x99c2('0x7'));var jayson=require(_0x99c2('0x8'));var client=jayson[_0x99c2('0x9')][_0x99c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42698c,_0x492d17,_0x48dc07){return new BPromise(function(_0x52d601,_0x413ace){return client['request'](_0x42698c,_0x48dc07)[_0x99c2('0xb')](function(_0x1270e0){logger['info'](_0x99c2('0xc'),_0x492d17,_0x99c2('0xd'));logger[_0x99c2('0xe')](_0x99c2('0xf'),_0x492d17,_0x99c2('0xd'),JSON['stringify'](_0x1270e0));if(_0x1270e0[_0x99c2('0x10')]){if(_0x1270e0[_0x99c2('0x10')]['code']===0x1f4){logger[_0x99c2('0x10')](_0x99c2('0xc'),_0x492d17,_0x1270e0[_0x99c2('0x10')][_0x99c2('0x11')]);return _0x413ace(_0x1270e0[_0x99c2('0x10')][_0x99c2('0x11')]);}logger[_0x99c2('0x10')](_0x99c2('0xc'),_0x492d17,_0x1270e0[_0x99c2('0x10')][_0x99c2('0x11')]);return _0x52d601(_0x1270e0[_0x99c2('0x10')][_0x99c2('0x11')]);}else{logger[_0x99c2('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x492d17,_0x99c2('0xd'));_0x52d601(_0x1270e0[_0x99c2('0x13')][_0x99c2('0x11')]);}})[_0x99c2('0x14')](function(_0x277804){logger[_0x99c2('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x492d17,_0x277804);_0x413ace(_0x277804);});});}exports[_0x99c2('0x15')]=function(_0x594b16){var _0x1b7a5e=this;return new Promise(function(_0x291154,_0x486c1c){return db['VoiceAgentReport'][_0x99c2('0x16')](_0x594b16[_0x99c2('0x17')],{'raw':_0x594b16[_0x99c2('0x18')]?_0x594b16['options'][_0x99c2('0x19')]===undefined?!![]:![]:!![]})[_0x99c2('0xb')](function(_0x257e8e){logger[_0x99c2('0x12')]('CreateVoiceAgentReport',_0x594b16);logger[_0x99c2('0xe')](_0x99c2('0x15'),_0x594b16,JSON[_0x99c2('0x1a')](_0x257e8e));_0x291154(_0x257e8e);})[_0x99c2('0x14')](function(_0x27771e){logger[_0x99c2('0x10')](_0x99c2('0x15'),_0x27771e[_0x99c2('0x11')],_0x594b16);_0x486c1c(_0x1b7a5e[_0x99c2('0x10')](0x1f4,_0x27771e['message']));});});};exports[_0x99c2('0x1b')]=function(_0x5e92bd){var _0x1c4bc2=this;return new Promise(function(_0xf2e1ad,_0x77fb52){return db['VoiceAgentReport']['update'](_0x5e92bd[_0x99c2('0x17')],{'raw':_0x5e92bd[_0x99c2('0x18')]?_0x5e92bd[_0x99c2('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e92bd['options']?_0x5e92bd[_0x99c2('0x18')][_0x99c2('0x1c')]||null:null,'attributes':_0x5e92bd['options']?_0x5e92bd[_0x99c2('0x18')][_0x99c2('0x1d')]||null:null,'limit':_0x5e92bd[_0x99c2('0x18')]?_0x5e92bd['options'][_0x99c2('0x1e')]||null:null})[_0x99c2('0xb')](function(_0x17da37){logger[_0x99c2('0x12')](_0x99c2('0x1b'),_0x5e92bd);logger[_0x99c2('0xe')](_0x99c2('0x1b'),_0x5e92bd,JSON[_0x99c2('0x1a')](_0x17da37));_0xf2e1ad(_0x17da37);})[_0x99c2('0x14')](function(_0xce0d8a){logger['error'](_0x99c2('0x1b'),_0xce0d8a[_0x99c2('0x11')],_0x5e92bd);_0x77fb52(_0x1c4bc2[_0x99c2('0x10')](0x1f4,_0xce0d8a[_0x99c2('0x11')]));});});};
\ No newline at end of file
index 7cc5de4..22d82c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6334=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xb375e0,_0x55bc61){var _0xd0f945=function(_0x14da2e){while(--_0x14da2e){_0xb375e0['push'](_0xb375e0['shift']());}};_0xd0f945(++_0x55bc61);}(_0x6334,0x119));var _0x4633=function(_0x289330,_0x54f85a){_0x289330=_0x289330-0x0;var _0x22d2d0=_0x6334[_0x289330];return _0x22d2d0;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4633('0x6'));var interaction=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var controller=require(_0x4633('0x9'));router[_0x4633('0xa')]('/',auth[_0x4633('0xb')](),controller[_0x4633('0xc')]);router['get'](_0x4633('0xd'),auth['isAuthenticated'](),controller[_0x4633('0xe')]);router[_0x4633('0xa')]('/:id',auth[_0x4633('0xb')](),controller[_0x4633('0xf')]);router[_0x4633('0x10')]('/',auth['isAuthenticated'](),controller[_0x4633('0x11')]);router[_0x4633('0x12')]('/:id',auth[_0x4633('0xb')](),controller[_0x4633('0x13')]);router[_0x4633('0x14')](_0x4633('0x15'),auth['isAuthenticated'](),controller[_0x4633('0x16')]);module[_0x4633('0x17')]=router;
\ No newline at end of file
+var _0xcd59=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x5724cb,_0x3e07a1){var _0x52a188=function(_0x3971ab){while(--_0x3971ab){_0x5724cb['push'](_0x5724cb['shift']());}};_0x52a188(++_0x3e07a1);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4f8100,_0x928620){_0x4f8100=_0x4f8100-0x0;var _0x360262=_0xcd59[_0x4f8100];return _0x360262;};'use strict';var multer=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var path=require(_0x9cd5('0x2'));var timeout=require(_0x9cd5('0x3'));var express=require(_0x9cd5('0x4'));var router=express[_0x9cd5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9cd5('0x6'));var interaction=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var controller=require(_0x9cd5('0x9'));router[_0x9cd5('0xa')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xc')]);router[_0x9cd5('0xa')](_0x9cd5('0xd'),auth[_0x9cd5('0xb')](),controller['describe']);router[_0x9cd5('0xa')](_0x9cd5('0xe'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xf')]);router[_0x9cd5('0x10')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x11')]);router[_0x9cd5('0x12')]('/:id',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x13')]);router[_0x9cd5('0x14')](_0x9cd5('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9cd5('0x15')]=router;
\ No newline at end of file
index c40869d..5a0f15a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3719=['INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound','outbound-fax','dialer','DATE'];(function(_0x387e6b,_0x33f285){var _0x18f7d7=function(_0xf87c37){while(--_0xf87c37){_0x387e6b['push'](_0x387e6b['shift']());}};_0x18f7d7(++_0x33f285);}(_0x3719,0x123));var _0x9371=function(_0x15e4bb,_0x3b63dd){_0x15e4bb=_0x15e4bb-0x0;var _0x5cc791=_0x3719[_0x15e4bb];return _0x5cc791;};'use strict';var Sequelize=require(_0x9371('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9371('0x1')]},'type':{'type':Sequelize[_0x9371('0x2')](_0x9371('0x3'),_0x9371('0x4'),_0x9371('0x5'),'inbound-fax',_0x9371('0x6'),_0x9371('0x7'))},'tag':{'type':Sequelize[_0x9371('0x1')]},'accountcode':{'type':Sequelize[_0x9371('0x1')]},'source':{'type':Sequelize[_0x9371('0x1')]},'destination':{'type':Sequelize[_0x9371('0x1')]},'destinationcontext':{'type':Sequelize[_0x9371('0x1')]},'callerid':{'type':Sequelize[_0x9371('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x9371('0x1')]},'lastapplication':{'type':Sequelize[_0x9371('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x9371('0x8')]},'answertime':{'type':Sequelize[_0x9371('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x9371('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9371('0x1')]},'amaflags':{'type':Sequelize[_0x9371('0x1')]},'userfield':{'type':Sequelize[_0x9371('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x9371('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x9371('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x9371('0x1')]},'routeid':{'type':Sequelize[_0x9371('0x9')]},'sipcallid':{'type':Sequelize[_0x9371('0x1')]}};
\ No newline at end of file
+var _0x3746=['ENUM','internal','outbound','dialer','STRING','DATE','INTEGER','sequelize','exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x3746,0xa9));var _0x6374=function(_0x14ec38,_0x561a3f){_0x14ec38=_0x14ec38-0x0;var _0x56b283=_0x3746[_0x14ec38];return _0x56b283;};'use strict';var Sequelize=require(_0x6374('0x0'));module[_0x6374('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6374('0x2')]('inbound',_0x6374('0x3'),_0x6374('0x4'),'inbound-fax','outbound-fax',_0x6374('0x5'))},'tag':{'type':Sequelize[_0x6374('0x6')]},'accountcode':{'type':Sequelize[_0x6374('0x6')]},'source':{'type':Sequelize[_0x6374('0x6')]},'destination':{'type':Sequelize[_0x6374('0x6')]},'destinationcontext':{'type':Sequelize[_0x6374('0x6')]},'callerid':{'type':Sequelize[_0x6374('0x6')]},'channel':{'type':Sequelize[_0x6374('0x6')]},'destinationchannel':{'type':Sequelize[_0x6374('0x6')]},'lastapplication':{'type':Sequelize[_0x6374('0x6')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x6374('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6374('0x7')]},'endtime':{'type':Sequelize[_0x6374('0x7')]},'duration':{'type':Sequelize[_0x6374('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6374('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6374('0x6')]},'amaflags':{'type':Sequelize[_0x6374('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x6374('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x6374('0x6')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6374('0x6')]},'prefix':{'type':Sequelize[_0x6374('0x6')]},'routeid':{'type':Sequelize[_0x6374('0x8')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1a7eac0..a2e24d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','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','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0xdbb6cb,_0x3b8fda){var _0x476b50=function(_0x470ebb){while(--_0x470ebb){_0xdbb6cb['push'](_0xdbb6cb['shift']());}};_0x476b50(++_0x3b8fda);}(_0xadb5,0xad));var _0x5adb=function(_0x1c8911,_0x5cda3d){_0x1c8911=_0x1c8911-0x0;var _0x2d6028=_0xadb5[_0x1c8911];return _0x2d6028;};'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['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));};
\ No newline at end of file
+var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x2ef3,0xba));var _0x32ef=function(_0x348868,_0x2a3efd){_0x348868=_0x348868-0x0;var _0x1bc539=_0x2ef3[_0x348868];return _0x1bc539;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));};
\ No newline at end of file
index ec30294..2dcc8ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0434=['api','moment','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','lodash','util','../../config/logger'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x0434,0x1ad));var _0x4043=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0x0434[_0x2e53e1];return _0x3a23de;};'use strict';var _=require(_0x4043('0x0'));var util=require(_0x4043('0x1'));var logger=require(_0x4043('0x2'))(_0x4043('0x3'));var moment=require(_0x4043('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4043('0x5'));var rimraf=require(_0x4043('0x6'));var config=require(_0x4043('0x7'));var attributes=require(_0x4043('0x8'));module[_0x4043('0x9')]=function(_0x1dba57,_0x58fca7){return _0x1dba57[_0x4043('0xa')](_0x4043('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ca7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ca7,0x9b));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78ca('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x78ca('0x1'));var BPromise=require(_0x78ca('0x2'));var rp=require(_0x78ca('0x3'));var fs=require('fs');var path=require(_0x78ca('0x4'));var rimraf=require(_0x78ca('0x5'));var config=require(_0x78ca('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x78ca('0x7')]=function(_0x348764,_0xb3b329){return _0x348764[_0x78ca('0x8')](_0x78ca('0x9'),attributes,{'tableName':_0x78ca('0xa'),'paranoid':![],'indexes':[{'fields':[_0x78ca('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index d6eb14f..d57c20b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaf2=['VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','where','limit','include','map','attributes','model','VoiceCallReport','CreateVoiceCallReport','UpdateVoiceCallReport','debug','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0xfaf2,0x1ad));var _0x2faf=function(_0x8b9786,_0x3b849b){_0x8b9786=_0x8b9786-0x0;var _0x327fb8=_0xfaf2[_0x8b9786];return _0x327fb8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2faf('0x0'));var BPromise=require(_0x2faf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2faf('0x2'));var db=require(_0x2faf('0x3'))['db'];var utils=require(_0x2faf('0x4'));var logger=require(_0x2faf('0x5'))(_0x2faf('0x6'));var config=require(_0x2faf('0x7'));var jayson=require(_0x2faf('0x8'));var client=jayson[_0x2faf('0x9')][_0x2faf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a375f,_0x562a5c,_0x5a0816){return new BPromise(function(_0x32976f,_0x4e21de){return client[_0x2faf('0xb')](_0x1a375f,_0x5a0816)[_0x2faf('0xc')](function(_0x14ce63){logger[_0x2faf('0xd')](_0x2faf('0xe'),_0x562a5c,'request\x20sent');logger['debug'](_0x2faf('0xf'),_0x562a5c,_0x2faf('0x10'),JSON[_0x2faf('0x11')](_0x14ce63));if(_0x14ce63[_0x2faf('0x12')]){if(_0x14ce63[_0x2faf('0x12')][_0x2faf('0x13')]===0x1f4){logger[_0x2faf('0x12')](_0x2faf('0xe'),_0x562a5c,_0x14ce63[_0x2faf('0x12')]['message']);return _0x4e21de(_0x14ce63[_0x2faf('0x12')][_0x2faf('0x14')]);}logger[_0x2faf('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x562a5c,_0x14ce63[_0x2faf('0x12')][_0x2faf('0x14')]);return _0x32976f(_0x14ce63['error'][_0x2faf('0x14')]);}else{logger[_0x2faf('0xd')](_0x2faf('0xe'),_0x562a5c,_0x2faf('0x10'));_0x32976f(_0x14ce63[_0x2faf('0x15')][_0x2faf('0x14')]);}})[_0x2faf('0x16')](function(_0x5ccfa5){logger[_0x2faf('0x12')](_0x2faf('0xe'),_0x562a5c,_0x5ccfa5);_0x4e21de(_0x5ccfa5);});});}exports[_0x2faf('0x17')]=function(_0x1ad8df){var _0x36fd2c=this;return new Promise(function(_0x28d8c4,_0x1cd0e3){return db['VoiceCallReport'][_0x2faf('0x18')]({'raw':_0x1ad8df[_0x2faf('0x19')]?_0x1ad8df[_0x2faf('0x19')][_0x2faf('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ad8df['options']?_0x1ad8df[_0x2faf('0x19')][_0x2faf('0x1b')]||null:null,'attributes':_0x1ad8df[_0x2faf('0x19')]?_0x1ad8df[_0x2faf('0x19')]['attributes']||null:null,'limit':_0x1ad8df['options']?_0x1ad8df['options'][_0x2faf('0x1c')]||null:null,'include':_0x1ad8df[_0x2faf('0x19')]?_0x1ad8df['options'][_0x2faf('0x1d')]?_[_0x2faf('0x1e')](_0x1ad8df[_0x2faf('0x19')][_0x2faf('0x1d')],function(_0x28025a){return{'model':db[_0x28025a['model']],'as':_0x28025a['as'],'attributes':_0x28025a[_0x2faf('0x1f')],'include':_0x28025a[_0x2faf('0x1d')]?_[_0x2faf('0x1e')](_0x28025a['include'],function(_0x12eec4){return{'model':db[_0x12eec4[_0x2faf('0x20')]],'as':_0x12eec4['as'],'attributes':_0x12eec4[_0x2faf('0x1f')],'include':_0x12eec4[_0x2faf('0x1d')]?_['map'](_0x12eec4[_0x2faf('0x1d')],function(_0x1b7d9c){return{'model':db[_0x1b7d9c[_0x2faf('0x20')]],'as':_0x1b7d9c['as'],'attributes':_0x1b7d9c[_0x2faf('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2faf('0xc')](function(_0x430df5){logger[_0x2faf('0xd')](_0x2faf('0x17'),_0x1ad8df);logger['debug'](_0x2faf('0x17'),_0x1ad8df,JSON[_0x2faf('0x11')](_0x430df5));_0x28d8c4(_0x430df5);})[_0x2faf('0x16')](function(_0x409ff0){logger['error']('GetVoiceCallReport',_0x409ff0[_0x2faf('0x14')],_0x1ad8df);_0x1cd0e3(_0x36fd2c[_0x2faf('0x12')](0x1f4,_0x409ff0[_0x2faf('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x12c13a){var _0x1acd06=this;return new Promise(function(_0x5589ff,_0x2d59df){return db[_0x2faf('0x21')]['create'](_0x12c13a['body'],{'raw':_0x12c13a['options']?_0x12c13a['options'][_0x2faf('0x1a')]===undefined?!![]:![]:!![]})[_0x2faf('0xc')](function(_0x3e9371){logger[_0x2faf('0xd')]('CreateVoiceCallReport',_0x12c13a);logger['debug'](_0x2faf('0x22'),_0x12c13a,JSON[_0x2faf('0x11')](_0x3e9371));_0x5589ff(_0x3e9371);})[_0x2faf('0x16')](function(_0x8495a6){logger['error']('CreateVoiceCallReport',_0x8495a6[_0x2faf('0x14')],_0x12c13a);_0x2d59df(_0x1acd06[_0x2faf('0x12')](0x1f4,_0x8495a6[_0x2faf('0x14')]));});});};exports[_0x2faf('0x23')]=function(_0x21cc2e){var _0x45a705=this;return new Promise(function(_0x521bdd,_0x5e4c0c){return db['VoiceCallReport']['update'](_0x21cc2e['body'],{'raw':_0x21cc2e[_0x2faf('0x19')]?_0x21cc2e[_0x2faf('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21cc2e[_0x2faf('0x19')]?_0x21cc2e[_0x2faf('0x19')][_0x2faf('0x1b')]||null:null,'attributes':_0x21cc2e[_0x2faf('0x19')]?_0x21cc2e[_0x2faf('0x19')]['attributes']||null:null,'limit':_0x21cc2e[_0x2faf('0x19')]?_0x21cc2e[_0x2faf('0x19')][_0x2faf('0x1c')]||null:null})[_0x2faf('0xc')](function(_0xfc7fd4){logger['info'](_0x2faf('0x23'),_0x21cc2e);logger[_0x2faf('0x24')](_0x2faf('0x23'),_0x21cc2e,JSON[_0x2faf('0x11')](_0xfc7fd4));_0x521bdd(_0xfc7fd4);})[_0x2faf('0x16')](function(_0x141c0e){logger[_0x2faf('0x12')](_0x2faf('0x23'),_0x141c0e['message'],_0x21cc2e);_0x5e4c0c(_0x45a705['error'](0x1f4,_0x141c0e[_0x2faf('0x14')]));});});};
\ No newline at end of file
+var _0xf9cc=['model','GetVoiceCallReport','catch','create','CreateVoiceCallReport','debug','stringify','UpdateVoiceCallReport','VoiceCallReport','update','limit','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','findAll','options','raw','where','attributes','include','map'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf9cc,0xa0));var _0xcf9c=function(_0x9c9f71,_0x260003){_0x9c9f71=_0x9c9f71-0x0;var _0x36ce9c=_0xf9cc[_0x9c9f71];return _0x36ce9c;};'use strict';var _=require('lodash');var util=require(_0xcf9c('0x0'));var moment=require(_0xcf9c('0x1'));var BPromise=require(_0xcf9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf9c('0x3'));var db=require(_0xcf9c('0x4'))['db'];var utils=require(_0xcf9c('0x5'));var logger=require('../../config/logger')(_0xcf9c('0x6'));var config=require(_0xcf9c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf9c('0x8')][_0xcf9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba292,_0x5e995c,_0x303f1d){return new BPromise(function(_0x405821,_0x203c58){return client[_0xcf9c('0xa')](_0x2ba292,_0x303f1d)['then'](function(_0x9f1ada){logger[_0xcf9c('0xb')](_0xcf9c('0xc'),_0x5e995c,_0xcf9c('0xd'));logger['debug'](_0xcf9c('0xe'),_0x5e995c,'request\x20sent',JSON['stringify'](_0x9f1ada));if(_0x9f1ada['error']){if(_0x9f1ada[_0xcf9c('0xf')][_0xcf9c('0x10')]===0x1f4){logger[_0xcf9c('0xf')](_0xcf9c('0xc'),_0x5e995c,_0x9f1ada[_0xcf9c('0xf')][_0xcf9c('0x11')]);return _0x203c58(_0x9f1ada['error']['message']);}logger[_0xcf9c('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x5e995c,_0x9f1ada[_0xcf9c('0xf')][_0xcf9c('0x11')]);return _0x405821(_0x9f1ada[_0xcf9c('0xf')][_0xcf9c('0x11')]);}else{logger[_0xcf9c('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x5e995c,_0xcf9c('0xd'));_0x405821(_0x9f1ada['result']['message']);}})['catch'](function(_0x177446){logger[_0xcf9c('0xf')](_0xcf9c('0xc'),_0x5e995c,_0x177446);_0x203c58(_0x177446);});});}exports['GetVoiceCallReport']=function(_0x45c1be){var _0x3fa1fe=this;return new Promise(function(_0x34ea30,_0x49b391){return db['VoiceCallReport'][_0xcf9c('0x12')]({'raw':_0x45c1be[_0xcf9c('0x13')]?_0x45c1be['options'][_0xcf9c('0x14')]===undefined?!![]:![]:!![],'where':_0x45c1be[_0xcf9c('0x13')]?_0x45c1be[_0xcf9c('0x13')][_0xcf9c('0x15')]||null:null,'attributes':_0x45c1be['options']?_0x45c1be[_0xcf9c('0x13')][_0xcf9c('0x16')]||null:null,'limit':_0x45c1be['options']?_0x45c1be[_0xcf9c('0x13')]['limit']||null:null,'include':_0x45c1be[_0xcf9c('0x13')]?_0x45c1be[_0xcf9c('0x13')][_0xcf9c('0x17')]?_[_0xcf9c('0x18')](_0x45c1be[_0xcf9c('0x13')][_0xcf9c('0x17')],function(_0x1c1479){return{'model':db[_0x1c1479['model']],'as':_0x1c1479['as'],'attributes':_0x1c1479[_0xcf9c('0x16')],'include':_0x1c1479[_0xcf9c('0x17')]?_[_0xcf9c('0x18')](_0x1c1479[_0xcf9c('0x17')],function(_0xe954c8){return{'model':db[_0xe954c8[_0xcf9c('0x19')]],'as':_0xe954c8['as'],'attributes':_0xe954c8[_0xcf9c('0x16')],'include':_0xe954c8[_0xcf9c('0x17')]?_[_0xcf9c('0x18')](_0xe954c8['include'],function(_0x49e9e8){return{'model':db[_0x49e9e8[_0xcf9c('0x19')]],'as':_0x49e9e8['as'],'attributes':_0x49e9e8[_0xcf9c('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3902b2){logger[_0xcf9c('0xb')](_0xcf9c('0x1a'),_0x45c1be);logger['debug'](_0xcf9c('0x1a'),_0x45c1be,JSON['stringify'](_0x3902b2));_0x34ea30(_0x3902b2);})[_0xcf9c('0x1b')](function(_0x5cb012){logger[_0xcf9c('0xf')]('GetVoiceCallReport',_0x5cb012[_0xcf9c('0x11')],_0x45c1be);_0x49b391(_0x3fa1fe[_0xcf9c('0xf')](0x1f4,_0x5cb012[_0xcf9c('0x11')]));});});};exports['CreateVoiceCallReport']=function(_0x2a3537){var _0x2a3e29=this;return new Promise(function(_0x47a2f6,_0x4f2d84){return db['VoiceCallReport'][_0xcf9c('0x1c')](_0x2a3537['body'],{'raw':_0x2a3537[_0xcf9c('0x13')]?_0x2a3537[_0xcf9c('0x13')][_0xcf9c('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x90142b){logger[_0xcf9c('0xb')](_0xcf9c('0x1d'),_0x2a3537);logger[_0xcf9c('0x1e')]('CreateVoiceCallReport',_0x2a3537,JSON[_0xcf9c('0x1f')](_0x90142b));_0x47a2f6(_0x90142b);})[_0xcf9c('0x1b')](function(_0x3f4b39){logger[_0xcf9c('0xf')](_0xcf9c('0x1d'),_0x3f4b39[_0xcf9c('0x11')],_0x2a3537);_0x4f2d84(_0x2a3e29[_0xcf9c('0xf')](0x1f4,_0x3f4b39['message']));});});};exports[_0xcf9c('0x20')]=function(_0xcf3d9e){var _0x7e9f90=this;return new Promise(function(_0xa16f8f,_0x3b463b){return db[_0xcf9c('0x21')][_0xcf9c('0x22')](_0xcf3d9e['body'],{'raw':_0xcf3d9e['options']?_0xcf3d9e[_0xcf9c('0x13')][_0xcf9c('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcf3d9e[_0xcf9c('0x13')]?_0xcf3d9e[_0xcf9c('0x13')][_0xcf9c('0x15')]||null:null,'attributes':_0xcf3d9e[_0xcf9c('0x13')]?_0xcf3d9e[_0xcf9c('0x13')][_0xcf9c('0x16')]||null:null,'limit':_0xcf3d9e[_0xcf9c('0x13')]?_0xcf3d9e[_0xcf9c('0x13')][_0xcf9c('0x23')]||null:null})[_0xcf9c('0x24')](function(_0xa4d91d){logger[_0xcf9c('0xb')]('UpdateVoiceCallReport',_0xcf3d9e);logger[_0xcf9c('0x1e')](_0xcf9c('0x20'),_0xcf3d9e,JSON[_0xcf9c('0x1f')](_0xa4d91d));_0xa16f8f(_0xa4d91d);})[_0xcf9c('0x1b')](function(_0x57f163){logger[_0xcf9c('0xf')](_0xcf9c('0x20'),_0x57f163['message'],_0xcf3d9e);_0x3b463b(_0x7e9f90[_0xcf9c('0xf')](0x1f4,_0x57f163[_0xcf9c('0x11')]));});});};
\ No newline at end of file
index 1089af7..de9108d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a93=['isAuthenticated','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','create','put','/:id','update'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x7a93,0x143));var _0x37a9=function(_0x31abcb,_0x1b479d){_0x31abcb=_0x31abcb-0x0;var _0x8965ff=_0x7a93[_0x31abcb];return _0x8965ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x37a9('0x0'));var timeout=require(_0x37a9('0x1'));var express=require(_0x37a9('0x2'));var router=express[_0x37a9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x37a9('0x4'));var config=require(_0x37a9('0x5'));var controller=require(_0x37a9('0x6'));router[_0x37a9('0x7')]('/',auth['isAuthenticated'](),controller[_0x37a9('0x8')]);router[_0x37a9('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x37a9('0x9')]);router[_0x37a9('0xa')](_0x37a9('0xb'),auth['isAuthenticated'](),controller[_0x37a9('0xc')]);router['delete']('/:id',auth[_0x37a9('0xd')](),controller[_0x37a9('0xe')]);module[_0x37a9('0xf')]=router;
\ No newline at end of file
+var _0xf008=['put','/:id','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated'];(function(_0xc5caf7,_0xc6d31b){var _0x509351=function(_0x531902){while(--_0x531902){_0xc5caf7['push'](_0xc5caf7['shift']());}};_0x509351(++_0xc6d31b);}(_0xf008,0xc9));var _0x8f00=function(_0x31fbfb,_0x43fc1e){_0x31fbfb=_0x31fbfb-0x0;var _0x2e3697=_0xf008[_0x31fbfb];return _0x2e3697;};'use strict';var multer=require('multer');var util=require(_0x8f00('0x0'));var path=require(_0x8f00('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f00('0x2'));var router=express['Router']();var fs_extra=require(_0x8f00('0x3'));var auth=require(_0x8f00('0x4'));var interaction=require(_0x8f00('0x5'));var config=require('../../config/environment');var controller=require(_0x8f00('0x6'));router[_0x8f00('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x8f00('0x8')](),controller['show']);router['post']('/',auth[_0x8f00('0x8')](),controller['create']);router[_0x8f00('0x9')](_0x8f00('0xa'),auth[_0x8f00('0x8')](),controller[_0x8f00('0xb')]);router[_0x8f00('0xc')](_0x8f00('0xa'),auth[_0x8f00('0x8')](),controller[_0x8f00('0xd')]);module['exports']=router;
\ No newline at end of file
index cb0de9b..4e54e98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbda=['setDataValue','join','getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x469ebe,_0x1cd398){var _0x27bf73=function(_0x228470){while(--_0x228470){_0x469ebe['push'](_0x469ebe['shift']());}};_0x27bf73(++_0x1cd398);}(_0xfbda,0x1aa));var _0xafbd=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xfbda[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0xafbd('0x0'));module[_0xafbd('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xafbd('0x2')],'unique':_0xafbd('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xafbd('0x2')],'set':function(_0x3af787){this[_0xafbd('0x4')]('options',_0x3af787?_0x3af787[_0xafbd('0x5')](''):[]);},'get':function(){return this[_0xafbd('0x6')](_0xafbd('0x7'))?this[_0xafbd('0x6')](_0xafbd('0x7'))[_0xafbd('0x8')](''):[];}},'auth':{'type':Sequelize[_0xafbd('0x9')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xafbd('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xafbd('0x2')]},'description':{'type':Sequelize[_0xafbd('0x2')]}};
\ No newline at end of file
+var _0xfbb2=['setDataValue','options','split','BOOLEAN','sequelize','exports','STRING'];(function(_0xdd0f4b,_0x5e40d7){var _0x2c4621=function(_0x3bfdf6){while(--_0x3bfdf6){_0xdd0f4b['push'](_0xdd0f4b['shift']());}};_0x2c4621(++_0x5e40d7);}(_0xfbb2,0x9e));var _0x2fbb=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xfbb2[_0xabfec4];return _0x7bafa2;};'use strict';var Sequelize=require(_0x2fbb('0x0'));module[_0x2fbb('0x1')]={'name':{'type':Sequelize[_0x2fbb('0x2')]},'prefix':{'type':Sequelize[_0x2fbb('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x2fbb('0x2')],'set':function(_0xc2a02a){this[_0x2fbb('0x3')](_0x2fbb('0x4'),_0xc2a02a?_0xc2a02a['join'](''):[]);},'get':function(){return this['getDataValue']('options')?this['getDataValue']('options')[_0x2fbb('0x5')](''):[];}},'auth':{'type':Sequelize[_0x2fbb('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x2fbb('0x2')]},'record':{'type':Sequelize[_0x2fbb('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2fbb('0x2')]},'description':{'type':Sequelize[_0x2fbb('0x2')]}};
\ No newline at end of file
index 8093583..eaf7e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e61=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','error','name','index','map','VoiceChanSpy','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','eml-format','rimraf','zip-dir','moment','bluebird','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','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x58a125,_0x4fe83f){var _0xd2a931=function(_0x1659ef){while(--_0x1659ef){_0x58a125['push'](_0x58a125['shift']());}};_0xd2a931(++_0x4fe83f);}(_0x4e61,0x8c));var _0x14e6=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0x4e61[_0x193ddf];return _0x5bc6df;};'use strict';var emlformat=require(_0x14e6('0x0'));var rimraf=require(_0x14e6('0x1'));var zipdir=require(_0x14e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14e6('0x3'));var BPromise=require(_0x14e6('0x4'));var Mustache=require(_0x14e6('0x5'));var util=require(_0x14e6('0x6'));var path=require(_0x14e6('0x7'));var sox=require(_0x14e6('0x8'));var csv=require(_0x14e6('0x9'));var ejs=require(_0x14e6('0xa'));var fs=require('fs');var fs_extra=require(_0x14e6('0xb'));var _=require(_0x14e6('0xc'));var squel=require(_0x14e6('0xd'));var crypto=require(_0x14e6('0xe'));var jsforce=require(_0x14e6('0xf'));var deskjs=require(_0x14e6('0x10'));var toCsv=require(_0x14e6('0x9'));var querystring=require(_0x14e6('0x11'));var Papa=require(_0x14e6('0x12'));var Redis=require(_0x14e6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x14e6('0x14'));var as=require(_0x14e6('0x15'));var hardwareService=require(_0x14e6('0x16'));var logger=require(_0x14e6('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x14e6('0x18'))['db'];function respondWithStatusCode(_0x5de0ea,_0x5a1ced){_0x5a1ced=_0x5a1ced||0xcc;return function(_0x128e45){if(_0x128e45){return _0x5de0ea[_0x14e6('0x19')](_0x5a1ced);}return _0x5de0ea[_0x14e6('0x1a')](_0x5a1ced)['end']();};}function respondWithResult(_0x3ea571,_0x23b860){_0x23b860=_0x23b860||0xc8;return function(_0xc8ead5){if(_0xc8ead5){return _0x3ea571[_0x14e6('0x1a')](_0x23b860)[_0x14e6('0x1b')](_0xc8ead5);}};}function respondWithFilteredResult(_0x5dba20,_0x36738d){return function(_0x353910){if(_0x353910){var _0x753064=typeof _0x36738d[_0x14e6('0x1c')]===_0x14e6('0x1d')&&typeof _0x36738d['limit']===_0x14e6('0x1d');var _0x48160f=_0x353910['count'];var _0x4f40b0=_0x753064?0x0:_0x36738d[_0x14e6('0x1c')];var _0x16b937=_0x753064?_0x353910[_0x14e6('0x1e')]:_0x36738d[_0x14e6('0x1c')]+_0x36738d['limit'];var _0x52693c;if(_0x16b937>=_0x48160f){_0x16b937=_0x48160f;_0x52693c=0xc8;}else{_0x52693c=0xce;}_0x5dba20[_0x14e6('0x1a')](_0x52693c);return _0x5dba20[_0x14e6('0x1f')](_0x14e6('0x20'),_0x4f40b0+'-'+_0x16b937+'/'+_0x48160f)[_0x14e6('0x1b')](_0x353910);}return null;};}function patchUpdates(_0x28f75f){return function(_0x2b8d5c){try{jsonpatch[_0x14e6('0x21')](_0x2b8d5c,_0x28f75f,!![]);}catch(_0x1add5e){return BPromise[_0x14e6('0x22')](_0x1add5e);}return _0x2b8d5c[_0x14e6('0x23')]();};}function saveUpdates(_0x20ea17,_0x4400e0){return function(_0x244bc7){if(_0x244bc7){return _0x244bc7[_0x14e6('0x24')](_0x20ea17)[_0x14e6('0x25')](function(_0x3aedac){return _0x3aedac;});}return null;};}function removeEntity(_0xacdf42,_0x129e50){return function(_0x320c2b){if(_0x320c2b){return _0x320c2b[_0x14e6('0x26')]()[_0x14e6('0x25')](function(){var _0x4a5084=_0x320c2b[_0x14e6('0x27')]({'plain':!![]});var _0x2a3807=_0x14e6('0x28');return db[_0x14e6('0x29')][_0x14e6('0x26')]({'where':{'type':_0x2a3807,'resourceId':_0x4a5084['id']}})[_0x14e6('0x25')](function(){return _0x320c2b;});})[_0x14e6('0x25')](function(){_0xacdf42['status'](0xcc)[_0x14e6('0x2a')]();});}};}function handleEntityNotFound(_0x503174,_0x593980){return function(_0x57a504){if(!_0x57a504){_0x503174[_0x14e6('0x19')](0x194);}return _0x57a504;};}function handleError(_0x52e725,_0x31f5d7){_0x31f5d7=_0x31f5d7||0x1f4;return function(_0x1aef5d){logger[_0x14e6('0x2b')](_0x1aef5d['stack']);if(_0x1aef5d[_0x14e6('0x2c')]){delete _0x1aef5d[_0x14e6('0x2c')];}_0x52e725[_0x14e6('0x1a')](_0x31f5d7)['send'](_0x1aef5d);};}exports[_0x14e6('0x2d')]=function(_0x1e718a,_0x305105){var _0x46863c={},_0x59ae27={},_0x1290b4={'count':0x0,'rows':[]};var _0x4e1ba8=_[_0x14e6('0x2e')](db[_0x14e6('0x2f')]['rawAttributes'],function(_0x45bbb0){return{'name':_0x45bbb0[_0x14e6('0x30')],'type':_0x45bbb0[_0x14e6('0x31')][_0x14e6('0x32')]};});_0x59ae27['model']=_[_0x14e6('0x2e')](_0x4e1ba8,_0x14e6('0x2c'));_0x59ae27[_0x14e6('0x33')]=_[_0x14e6('0x34')](_0x1e718a[_0x14e6('0x33')]);_0x59ae27[_0x14e6('0x35')]=_[_0x14e6('0x36')](_0x59ae27['model'],_0x59ae27[_0x14e6('0x33')]);_0x46863c[_0x14e6('0x37')]=_[_0x14e6('0x36')](_0x59ae27[_0x14e6('0x38')],qs['fields'](_0x1e718a[_0x14e6('0x33')][_0x14e6('0x39')]));_0x46863c[_0x14e6('0x37')]=_0x46863c[_0x14e6('0x37')][_0x14e6('0x3a')]?_0x46863c[_0x14e6('0x37')]:_0x59ae27[_0x14e6('0x38')];if(!_0x1e718a[_0x14e6('0x33')][_0x14e6('0x3b')](_0x14e6('0x3c'))){_0x46863c[_0x14e6('0x3d')]=qs[_0x14e6('0x3d')](_0x1e718a['query'][_0x14e6('0x3d')]);_0x46863c[_0x14e6('0x1c')]=qs[_0x14e6('0x1c')](_0x1e718a[_0x14e6('0x33')][_0x14e6('0x1c')]);}_0x46863c[_0x14e6('0x3e')]=qs[_0x14e6('0x3f')](_0x1e718a[_0x14e6('0x33')][_0x14e6('0x3f')]);_0x46863c[_0x14e6('0x40')]=qs[_0x14e6('0x35')](_[_0x14e6('0x41')](_0x1e718a[_0x14e6('0x33')],_0x59ae27[_0x14e6('0x35')]),_0x4e1ba8);if(_0x1e718a[_0x14e6('0x33')][_0x14e6('0x42')]){_0x46863c[_0x14e6('0x40')]=_['merge'](_0x46863c[_0x14e6('0x40')],{'$or':_['map'](_0x4e1ba8,function(_0x3b1cc9){if(_0x3b1cc9[_0x14e6('0x31')]!==_0x14e6('0x43')){var _0xfe149b={};_0xfe149b[_0x3b1cc9['name']]={'$like':'%'+_0x1e718a[_0x14e6('0x33')][_0x14e6('0x42')]+'%'};return _0xfe149b;}})});}_0x46863c=_['merge']({},_0x46863c,_0x1e718a[_0x14e6('0x44')]);var _0xd5cec0={'where':_0x46863c[_0x14e6('0x40')]};return db[_0x14e6('0x2f')][_0x14e6('0x1e')](_0xd5cec0)['then'](function(_0x477069){_0x1290b4[_0x14e6('0x1e')]=_0x477069;if(_0x1e718a['query'][_0x14e6('0x45')]){_0x46863c[_0x14e6('0x46')]=[{'all':!![]}];}return db[_0x14e6('0x2f')]['findAll'](_0x46863c);})['then'](function(_0x3a7637){_0x1290b4[_0x14e6('0x47')]=_0x3a7637;return _0x1290b4;})[_0x14e6('0x25')](respondWithFilteredResult(_0x305105,_0x46863c))[_0x14e6('0x48')](handleError(_0x305105,null));};exports[_0x14e6('0x49')]=function(_0x5ce1fd,_0x565ed0){var _0x4abc07={'raw':![],'where':{'id':_0x5ce1fd[_0x14e6('0x4a')]['id']}},_0x449078={};_0x449078[_0x14e6('0x38')]=_[_0x14e6('0x34')](db[_0x14e6('0x2f')][_0x14e6('0x4b')]);_0x449078[_0x14e6('0x33')]=_[_0x14e6('0x34')](_0x5ce1fd[_0x14e6('0x33')]);_0x449078[_0x14e6('0x35')]=_['intersection'](_0x449078[_0x14e6('0x38')],_0x449078[_0x14e6('0x33')]);_0x4abc07['attributes']=_[_0x14e6('0x36')](_0x449078[_0x14e6('0x38')],qs['fields'](_0x5ce1fd[_0x14e6('0x33')][_0x14e6('0x39')]));_0x4abc07[_0x14e6('0x37')]=_0x4abc07['attributes']['length']?_0x4abc07[_0x14e6('0x37')]:_0x449078[_0x14e6('0x38')];if(_0x5ce1fd[_0x14e6('0x33')][_0x14e6('0x45')]){_0x4abc07['include']=[{'all':!![]}];}_0x4abc07=_[_0x14e6('0x4c')]({},_0x4abc07,_0x5ce1fd[_0x14e6('0x44')]);return db[_0x14e6('0x2f')]['find'](_0x4abc07)[_0x14e6('0x25')](handleEntityNotFound(_0x565ed0,null))[_0x14e6('0x25')](respondWithResult(_0x565ed0,null))[_0x14e6('0x48')](handleError(_0x565ed0,null));};exports[_0x14e6('0x4d')]=function(_0x4b26f5,_0x726c0c){return db['VoiceChanSpy']['create'](_0x4b26f5[_0x14e6('0x4e')],{})[_0x14e6('0x25')](function(_0x46023f){var _0xf7e7ee=_0x4b26f5[_0x14e6('0x4f')][_0x14e6('0x27')]({'plain':!![]});if(!_0xf7e7ee)throw new Error(_0x14e6('0x50'));if(_0xf7e7ee[_0x14e6('0x51')]===_0x14e6('0x4f')){var _0x2ccd96=_0x46023f['get']({'plain':!![]});var _0x4bfb39='ChanSpies';return db[_0x14e6('0x52')][_0x14e6('0x53')]({'where':{'name':_0x4bfb39,'userProfileId':_0xf7e7ee['userProfileId']},'raw':!![]})['then'](function(_0x31cb98){if(_0x31cb98&&_0x31cb98[_0x14e6('0x54')]===0x0){return db[_0x14e6('0x29')][_0x14e6('0x4d')]({'name':_0x2ccd96[_0x14e6('0x2c')],'resourceId':_0x2ccd96['id'],'type':_0x31cb98['name'],'sectionId':_0x31cb98['id']},{})[_0x14e6('0x25')](function(){return _0x46023f;});}else{return _0x46023f;}})[_0x14e6('0x48')](function(_0x3dd00d){logger[_0x14e6('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dd00d);throw _0x3dd00d;});}return _0x46023f;})['then'](respondWithResult(_0x726c0c,0xc9))[_0x14e6('0x48')](handleError(_0x726c0c,null));};exports[_0x14e6('0x24')]=function(_0x4a844e,_0x1f0ea9){if(_0x4a844e['body']['id']){delete _0x4a844e[_0x14e6('0x4e')]['id'];}return db[_0x14e6('0x2f')]['find']({'where':{'id':_0x4a844e[_0x14e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f0ea9,null))[_0x14e6('0x25')](saveUpdates(_0x4a844e['body'],null))['then'](respondWithResult(_0x1f0ea9,null))[_0x14e6('0x48')](handleError(_0x1f0ea9,null));};exports[_0x14e6('0x26')]=function(_0x4317b1,_0x5c89b1){return db[_0x14e6('0x2f')][_0x14e6('0x53')]({'where':{'id':_0x4317b1['params']['id']}})['then'](handleEntityNotFound(_0x5c89b1,null))[_0x14e6('0x25')](removeEntity(_0x5c89b1,null))['catch'](handleError(_0x5c89b1,null));};
\ No newline at end of file
+var _0x593e=['UserProfileResource','error','name','send','index','map','VoiceChanSpy','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','ChanSpies'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x593e,0xcb));var _0xe593=function(_0x38da50,_0x39a07f){_0x38da50=_0x38da50-0x0;var _0x32d1d3=_0x593e[_0x38da50];return _0x32d1d3;};'use strict';var emlformat=require(_0xe593('0x0'));var rimraf=require(_0xe593('0x1'));var zipdir=require(_0xe593('0x2'));var jsonpatch=require(_0xe593('0x3'));var rp=require(_0xe593('0x4'));var moment=require(_0xe593('0x5'));var BPromise=require(_0xe593('0x6'));var Mustache=require(_0xe593('0x7'));var util=require('util');var path=require(_0xe593('0x8'));var sox=require(_0xe593('0x9'));var csv=require(_0xe593('0xa'));var ejs=require(_0xe593('0xb'));var fs=require('fs');var fs_extra=require(_0xe593('0xc'));var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var licenseUtil=require(_0xe593('0x1a'));var db=require(_0xe593('0x1b'))['db'];function respondWithStatusCode(_0x8ee313,_0x31dad0){_0x31dad0=_0x31dad0||0xcc;return function(_0x24c9fd){if(_0x24c9fd){return _0x8ee313[_0xe593('0x1c')](_0x31dad0);}return _0x8ee313[_0xe593('0x1d')](_0x31dad0)[_0xe593('0x1e')]();};}function respondWithResult(_0x499819,_0x2907e4){_0x2907e4=_0x2907e4||0xc8;return function(_0x1de391){if(_0x1de391){return _0x499819['status'](_0x2907e4)[_0xe593('0x1f')](_0x1de391);}};}function respondWithFilteredResult(_0x44837b,_0x5d4c6a){return function(_0x2ae9b6){if(_0x2ae9b6){var _0x40416c=typeof _0x5d4c6a[_0xe593('0x20')]===_0xe593('0x21')&&typeof _0x5d4c6a[_0xe593('0x22')]===_0xe593('0x21');var _0x48f3b4=_0x2ae9b6[_0xe593('0x23')];var _0x470d07=_0x40416c?0x0:_0x5d4c6a['offset'];var _0xd1020e=_0x40416c?_0x2ae9b6[_0xe593('0x23')]:_0x5d4c6a['offset']+_0x5d4c6a[_0xe593('0x22')];var _0x3dba1b;if(_0xd1020e>=_0x48f3b4){_0xd1020e=_0x48f3b4;_0x3dba1b=0xc8;}else{_0x3dba1b=0xce;}_0x44837b[_0xe593('0x1d')](_0x3dba1b);return _0x44837b[_0xe593('0x24')](_0xe593('0x25'),_0x470d07+'-'+_0xd1020e+'/'+_0x48f3b4)[_0xe593('0x1f')](_0x2ae9b6);}return null;};}function patchUpdates(_0x3d2a51){return function(_0x4ea53f){try{jsonpatch['apply'](_0x4ea53f,_0x3d2a51,!![]);}catch(_0x1634d4){return BPromise['reject'](_0x1634d4);}return _0x4ea53f['save']();};}function saveUpdates(_0x1bb8e8,_0x3c65b5){return function(_0x57379d){if(_0x57379d){return _0x57379d[_0xe593('0x26')](_0x1bb8e8)['then'](function(_0x1672bf){return _0x1672bf;});}return null;};}function removeEntity(_0x2c191f,_0x185cea){return function(_0x44d997){if(_0x44d997){return _0x44d997[_0xe593('0x27')]()[_0xe593('0x28')](function(){var _0x20a098=_0x44d997[_0xe593('0x29')]({'plain':!![]});var _0x4fc483=_0xe593('0x2a');return db[_0xe593('0x2b')]['destroy']({'where':{'type':_0x4fc483,'resourceId':_0x20a098['id']}})['then'](function(){return _0x44d997;});})[_0xe593('0x28')](function(){_0x2c191f[_0xe593('0x1d')](0xcc)[_0xe593('0x1e')]();});}};}function handleEntityNotFound(_0x43699d,_0x3b66bc){return function(_0x27a3d2){if(!_0x27a3d2){_0x43699d['sendStatus'](0x194);}return _0x27a3d2;};}function handleError(_0x350e2b,_0x54e5e2){_0x54e5e2=_0x54e5e2||0x1f4;return function(_0x1dacf6){logger[_0xe593('0x2c')](_0x1dacf6['stack']);if(_0x1dacf6[_0xe593('0x2d')]){delete _0x1dacf6['name'];}_0x350e2b[_0xe593('0x1d')](_0x54e5e2)[_0xe593('0x2e')](_0x1dacf6);};}exports[_0xe593('0x2f')]=function(_0x501e54,_0x1ae8d9){var _0x13f44={},_0x3066ed={},_0x338222={'count':0x0,'rows':[]};var _0x2588be=_[_0xe593('0x30')](db[_0xe593('0x31')]['rawAttributes'],function(_0x4098a9){return{'name':_0x4098a9[_0xe593('0x32')],'type':_0x4098a9['type'][_0xe593('0x33')]};});_0x3066ed['model']=_[_0xe593('0x30')](_0x2588be,_0xe593('0x2d'));_0x3066ed[_0xe593('0x34')]=_[_0xe593('0x35')](_0x501e54[_0xe593('0x34')]);_0x3066ed[_0xe593('0x36')]=_[_0xe593('0x37')](_0x3066ed[_0xe593('0x38')],_0x3066ed[_0xe593('0x34')]);_0x13f44[_0xe593('0x39')]=_['intersection'](_0x3066ed[_0xe593('0x38')],qs[_0xe593('0x3a')](_0x501e54[_0xe593('0x34')]['fields']));_0x13f44['attributes']=_0x13f44[_0xe593('0x39')]['length']?_0x13f44[_0xe593('0x39')]:_0x3066ed[_0xe593('0x38')];if(!_0x501e54[_0xe593('0x34')][_0xe593('0x3b')](_0xe593('0x3c'))){_0x13f44[_0xe593('0x22')]=qs[_0xe593('0x22')](_0x501e54['query']['limit']);_0x13f44[_0xe593('0x20')]=qs['offset'](_0x501e54[_0xe593('0x34')]['offset']);}_0x13f44[_0xe593('0x3d')]=qs['sort'](_0x501e54['query'][_0xe593('0x3e')]);_0x13f44[_0xe593('0x3f')]=qs[_0xe593('0x36')](_['pick'](_0x501e54['query'],_0x3066ed['filters']),_0x2588be);if(_0x501e54[_0xe593('0x34')]['filter']){_0x13f44[_0xe593('0x3f')]=_[_0xe593('0x40')](_0x13f44[_0xe593('0x3f')],{'$or':_[_0xe593('0x30')](_0x2588be,function(_0x50249e){if(_0x50249e[_0xe593('0x41')]!=='VIRTUAL'){var _0x36c08e={};_0x36c08e[_0x50249e['name']]={'$like':'%'+_0x501e54['query']['filter']+'%'};return _0x36c08e;}})});}_0x13f44=_[_0xe593('0x40')]({},_0x13f44,_0x501e54['options']);var _0x3addf0={'where':_0x13f44[_0xe593('0x3f')]};return db[_0xe593('0x31')]['count'](_0x3addf0)[_0xe593('0x28')](function(_0x3f9784){_0x338222[_0xe593('0x23')]=_0x3f9784;if(_0x501e54[_0xe593('0x34')][_0xe593('0x42')]){_0x13f44[_0xe593('0x43')]=[{'all':!![]}];}return db[_0xe593('0x31')][_0xe593('0x44')](_0x13f44);})['then'](function(_0x211065){_0x338222[_0xe593('0x45')]=_0x211065;return _0x338222;})[_0xe593('0x28')](respondWithFilteredResult(_0x1ae8d9,_0x13f44))[_0xe593('0x46')](handleError(_0x1ae8d9,null));};exports[_0xe593('0x47')]=function(_0x4d3018,_0x4a9a5f){var _0x3fd874={'raw':![],'where':{'id':_0x4d3018[_0xe593('0x48')]['id']}},_0x380429={};_0x380429['model']=_[_0xe593('0x35')](db[_0xe593('0x31')]['rawAttributes']);_0x380429['query']=_[_0xe593('0x35')](_0x4d3018[_0xe593('0x34')]);_0x380429[_0xe593('0x36')]=_['intersection'](_0x380429[_0xe593('0x38')],_0x380429[_0xe593('0x34')]);_0x3fd874[_0xe593('0x39')]=_[_0xe593('0x37')](_0x380429['model'],qs['fields'](_0x4d3018['query']['fields']));_0x3fd874[_0xe593('0x39')]=_0x3fd874['attributes'][_0xe593('0x49')]?_0x3fd874[_0xe593('0x39')]:_0x380429[_0xe593('0x38')];if(_0x4d3018[_0xe593('0x34')][_0xe593('0x42')]){_0x3fd874[_0xe593('0x43')]=[{'all':!![]}];}_0x3fd874=_[_0xe593('0x40')]({},_0x3fd874,_0x4d3018[_0xe593('0x4a')]);return db['VoiceChanSpy'][_0xe593('0x4b')](_0x3fd874)[_0xe593('0x28')](handleEntityNotFound(_0x4a9a5f,null))[_0xe593('0x28')](respondWithResult(_0x4a9a5f,null))['catch'](handleError(_0x4a9a5f,null));};exports[_0xe593('0x4c')]=function(_0x5dfdb1,_0x39ec9e){return db[_0xe593('0x31')][_0xe593('0x4c')](_0x5dfdb1['body'],{})['then'](function(_0x7431a3){var _0x45beb1=_0x5dfdb1['user']['get']({'plain':!![]});if(!_0x45beb1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45beb1['role']==='user'){var _0x383645=_0x7431a3[_0xe593('0x29')]({'plain':!![]});var _0x1ed8b5=_0xe593('0x2a');return db[_0xe593('0x4d')][_0xe593('0x4b')]({'where':{'name':_0x1ed8b5,'userProfileId':_0x45beb1[_0xe593('0x4e')]},'raw':!![]})[_0xe593('0x28')](function(_0x355ad8){if(_0x355ad8&&_0x355ad8[_0xe593('0x4f')]===0x0){return db[_0xe593('0x2b')][_0xe593('0x4c')]({'name':_0x383645[_0xe593('0x2d')],'resourceId':_0x383645['id'],'type':_0x355ad8[_0xe593('0x2d')],'sectionId':_0x355ad8['id']},{})[_0xe593('0x28')](function(){return _0x7431a3;});}else{return _0x7431a3;}})[_0xe593('0x46')](function(_0x5d60c3){logger[_0xe593('0x2c')](_0xe593('0x50'),_0x5d60c3);throw _0x5d60c3;});}return _0x7431a3;})[_0xe593('0x28')](respondWithResult(_0x39ec9e,0xc9))[_0xe593('0x46')](handleError(_0x39ec9e,null));};exports[_0xe593('0x26')]=function(_0x8130b2,_0x363643){if(_0x8130b2[_0xe593('0x51')]['id']){delete _0x8130b2[_0xe593('0x51')]['id'];}return db[_0xe593('0x31')][_0xe593('0x4b')]({'where':{'id':_0x8130b2[_0xe593('0x48')]['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x363643,null))[_0xe593('0x28')](saveUpdates(_0x8130b2[_0xe593('0x51')],null))['then'](respondWithResult(_0x363643,null))[_0xe593('0x46')](handleError(_0x363643,null));};exports[_0xe593('0x27')]=function(_0x142d0f,_0x24d061){return db[_0xe593('0x31')]['find']({'where':{'id':_0x142d0f['params']['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x24d061,null))[_0xe593('0x28')](removeEntity(_0x24d061,null))[_0xe593('0x46')](handleError(_0x24d061,null));};
\ No newline at end of file
index 13d016b..69b45c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59a4=['util','bluebird','context','from-sip','format','%s%s','prefix','push','merge','CDR(type)=%s','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','options','record','StopMixMonitor','length','internal','name','concat','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash'];(function(_0xd89e41,_0x516cac){var _0x5651cf=function(_0x41a83f){while(--_0x41a83f){_0xd89e41['push'](_0xd89e41['shift']());}};_0x5651cf(++_0x516cac);}(_0x59a4,0x14c));var _0x459a=function(_0x4fd6d5,_0x5161e3){_0x4fd6d5=_0x4fd6d5-0x0;var _0x34ada6=_0x59a4[_0x4fd6d5];return _0x34ada6;};'use strict';var _=require(_0x459a('0x0'));var util=require(_0x459a('0x1'));var BPromise=require(_0x459a('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3bb0ab,_0xbb099a,_0x6de06){var _0x45d116=0x1;var _0x3d87f4=[];var _0x35601e={'context':_0xbb099a[_0x459a('0x3')]||_0x459a('0x4'),'exten':util[_0x459a('0x5')](_0x459a('0x6'),_0x3bb0ab[_0x459a('0x7')],_0x6de06),'type':'system','isApp':![],'ChanSpyId':_0x3bb0ab['id'],'UserId':_0xbb099a['id']};_0x3d87f4[_0x459a('0x8')](_[_0x459a('0x9')]({'app':'Set','appdata':util['format'](_0x459a('0xa'),'chanspy'),'priority':_0x45d116++},_0x35601e));if(_0x3bb0ab['record']){_0x3d87f4[_0x459a('0x8')](_['merge']({'app':_0x459a('0xb'),'appdata':util[_0x459a('0x5')](_0x459a('0xc'),_0x3bb0ab[_0x459a('0xd')]),'priority':_0x45d116++},_0x35601e));}if(_0x3bb0ab['auth']){_0x3d87f4[_0x459a('0x8')](_[_0x459a('0x9')]({'app':_0x459a('0xe'),'appdata':_0x3bb0ab['password'],'priority':_0x45d116++},_0x35601e));}_0x3d87f4[_0x459a('0x8')](_[_0x459a('0x9')]({'app':_0x459a('0xf'),'appdata':util[_0x459a('0x5')](_0x459a('0x10'),_0xbb099a['name'],_0x3bb0ab[_0x459a('0x11')]?_0x3bb0ab[_0x459a('0x11')]['join'](''):''),'priority':_0x45d116++},_0x35601e));if(_0x3bb0ab[_0x459a('0x12')]){_0x3d87f4[_0x459a('0x8')](_[_0x459a('0x9')]({'app':_0x459a('0x13'),'priority':_0x45d116++},_0x35601e));}return _0x3d87f4;};var getChanSpyApplications=function(_0x3bc9ef,_0x5d7519){var _0x5dd54c=[];for(var _0x5994c2=0x0,_0x8353c1=0x1;_0x5994c2<_0x5d7519[_0x459a('0x14')];_0x5994c2++,_0x8353c1=0x1){_0x5dd54c=_0x5dd54c['concat'](getUserApplications(_0x3bc9ef,_0x5d7519[_0x5994c2],_0x5d7519[_0x5994c2][_0x459a('0x15')]));if(_0x5d7519[_0x5994c2][_0x459a('0x15')]!=_0x5d7519[_0x5994c2][_0x459a('0x16')]){_0x5dd54c=_0x5dd54c[_0x459a('0x17')](getUserApplications(_0x3bc9ef,_0x5d7519[_0x5994c2],_0x5d7519[_0x5994c2]['name']));}}return _0x5dd54c;};var getChanSpyPromise=function(_0x1707ba,_0xacd8d3){return new BPromise(function(_0x446896,_0x187a81){return _0x1707ba[_0x459a('0x18')][_0x459a('0x19')]({'attributes':['id',_0x459a('0x16'),_0x459a('0x15')],'where':{'role':_0x459a('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0xf3e6e8){if(_0xf3e6e8){return _0x446896(getChanSpyApplications(_0xacd8d3,_0xf3e6e8));}return _0x446896([]);})[_0x459a('0x1b')](function(_0x32e1bb){_0x187a81(_0x32e1bb);});});};module[_0x459a('0x1c')]=function(_0x4a4d96,_0x37934f){var _0x3eb252=_0x4a4d96[_0x459a('0x1d')];return _0x4a4d96[_0x459a('0x1e')](_0x459a('0x1f'),attributes,{'tableName':_0x459a('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58f1d1,_0x32741f,_0x461fd9){return getChanSpyPromise(_0x3eb252,_0x58f1d1)[_0x459a('0x21')](function(_0x108842){if(_0x108842&&_0x108842[_0x459a('0x14')]){return _0x3eb252[_0x459a('0x22')][_0x459a('0x23')](_0x108842);}})[_0x459a('0x21')](function(){_0x461fd9();})['catch'](function(_0x1470d1){_0x461fd9(_0x1470d1);});},'afterUpdate':function(_0x5a3673,_0x1cce5a,_0xc5637a){return _0x3eb252['VoiceExtension'][_0x459a('0x24')]({'where':{'ChanSpyId':_0x5a3673['id']}})['then'](function(){return getChanSpyPromise(_0x3eb252,_0x5a3673);})['then'](function(_0x4d33b3){if(_0x4d33b3&&_0x4d33b3['length']){return _0x3eb252[_0x459a('0x22')][_0x459a('0x23')](_0x4d33b3);}})[_0x459a('0x21')](function(){_0xc5637a();})[_0x459a('0x1b')](function(_0x5787aa){_0xc5637a(_0x5787aa);});},'afterDestroy':function(_0x24e23e,_0x2ea088,_0x448740){return _0x3eb252[_0x459a('0x22')][_0x459a('0x24')]({'where':{'ChanSpyId':_0x24e23e['id']}})[_0x459a('0x21')](function(){_0x448740();})[_0x459a('0x1b')](function(_0x4aca94){_0x448740(_0x4aca94);});}}});};
\ No newline at end of file
+var _0x9e20=['then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','context','from-sip','format','%s%s','merge','Set','CDR(type)=%s','MixMonitor','recordingFormat','auth','push','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent'];(function(_0xddbc7c,_0x31b191){var _0x25da11=function(_0x3f10cf){while(--_0x3f10cf){_0xddbc7c['push'](_0xddbc7c['shift']());}};_0x25da11(++_0x31b191);}(_0x9e20,0x1ea));var _0x09e2=function(_0x328648,_0x2bfd47){_0x328648=_0x328648-0x0;var _0x1a9bbe=_0x9e20[_0x328648];return _0x1a9bbe;};'use strict';var _=require(_0x09e2('0x0'));var util=require(_0x09e2('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x515f4f,_0x2eca2f,_0xb405eb){var _0x4ff4c5=0x1;var _0x255ab5=[];var _0xb661bb={'context':_0x2eca2f[_0x09e2('0x2')]||_0x09e2('0x3'),'exten':util[_0x09e2('0x4')](_0x09e2('0x5'),_0x515f4f['prefix'],_0xb405eb),'type':'system','isApp':![],'ChanSpyId':_0x515f4f['id'],'UserId':_0x2eca2f['id']};_0x255ab5['push'](_[_0x09e2('0x6')]({'app':_0x09e2('0x7'),'appdata':util['format'](_0x09e2('0x8'),'chanspy'),'priority':_0x4ff4c5++},_0xb661bb));if(_0x515f4f['record']){_0x255ab5['push'](_[_0x09e2('0x6')]({'app':_0x09e2('0x9'),'appdata':util[_0x09e2('0x4')]('${UNIQUEID}.%s,a',_0x515f4f[_0x09e2('0xa')]),'priority':_0x4ff4c5++},_0xb661bb));}if(_0x515f4f[_0x09e2('0xb')]){_0x255ab5[_0x09e2('0xc')](_[_0x09e2('0x6')]({'app':_0x09e2('0xd'),'appdata':_0x515f4f[_0x09e2('0xe')],'priority':_0x4ff4c5++},_0xb661bb));}_0x255ab5[_0x09e2('0xc')](_['merge']({'app':_0x09e2('0xf'),'appdata':util[_0x09e2('0x4')](_0x09e2('0x10'),_0x2eca2f[_0x09e2('0x11')],_0x515f4f['options']?_0x515f4f[_0x09e2('0x12')][_0x09e2('0x13')](''):''),'priority':_0x4ff4c5++},_0xb661bb));if(_0x515f4f[_0x09e2('0x14')]){_0x255ab5[_0x09e2('0xc')](_[_0x09e2('0x6')]({'app':_0x09e2('0x15'),'priority':_0x4ff4c5++},_0xb661bb));}return _0x255ab5;};var getChanSpyApplications=function(_0xa5d172,_0x390e63){var _0x2501b6=[];for(var _0xdb9238=0x0,_0x51320d=0x1;_0xdb9238<_0x390e63[_0x09e2('0x16')];_0xdb9238++,_0x51320d=0x1){_0x2501b6=_0x2501b6[_0x09e2('0x17')](getUserApplications(_0xa5d172,_0x390e63[_0xdb9238],_0x390e63[_0xdb9238][_0x09e2('0x18')]));if(_0x390e63[_0xdb9238][_0x09e2('0x18')]!=_0x390e63[_0xdb9238]['name']){_0x2501b6=_0x2501b6[_0x09e2('0x17')](getUserApplications(_0xa5d172,_0x390e63[_0xdb9238],_0x390e63[_0xdb9238][_0x09e2('0x11')]));}}return _0x2501b6;};var getChanSpyPromise=function(_0x38fbb0,_0x1f40ba){return new BPromise(function(_0x3fb30,_0x310f3e){return _0x38fbb0[_0x09e2('0x19')][_0x09e2('0x1a')]({'attributes':['id',_0x09e2('0x11'),_0x09e2('0x18')],'where':{'role':_0x09e2('0x1b'),'chanspy':!![]},'raw':!![]})[_0x09e2('0x1c')](function(_0x5253c9){if(_0x5253c9){return _0x3fb30(getChanSpyApplications(_0x1f40ba,_0x5253c9));}return _0x3fb30([]);})[_0x09e2('0x1d')](function(_0x1836f2){_0x310f3e(_0x1836f2);});});};module[_0x09e2('0x1e')]=function(_0x3a9f8b,_0x9bc2b4){var _0x4dde78=_0x3a9f8b[_0x09e2('0x1f')];return _0x3a9f8b[_0x09e2('0x20')](_0x09e2('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e4db1,_0x38569a,_0x4b9740){return getChanSpyPromise(_0x4dde78,_0x1e4db1)[_0x09e2('0x1c')](function(_0x44c1e5){if(_0x44c1e5&&_0x44c1e5[_0x09e2('0x16')]){return _0x4dde78[_0x09e2('0x22')][_0x09e2('0x23')](_0x44c1e5);}})[_0x09e2('0x1c')](function(){_0x4b9740();})[_0x09e2('0x1d')](function(_0x1f93e8){_0x4b9740(_0x1f93e8);});},'afterUpdate':function(_0x2c1fb2,_0x2367e4,_0x1a0e7b){return _0x4dde78[_0x09e2('0x22')][_0x09e2('0x24')]({'where':{'ChanSpyId':_0x2c1fb2['id']}})[_0x09e2('0x1c')](function(){return getChanSpyPromise(_0x4dde78,_0x2c1fb2);})[_0x09e2('0x1c')](function(_0x1efaa5){if(_0x1efaa5&&_0x1efaa5[_0x09e2('0x16')]){return _0x4dde78[_0x09e2('0x22')][_0x09e2('0x23')](_0x1efaa5);}})['then'](function(){_0x1a0e7b();})[_0x09e2('0x1d')](function(_0x3817a6){_0x1a0e7b(_0x3817a6);});},'afterDestroy':function(_0x9732e1,_0x4e9d9a,_0x1b8c07){return _0x4dde78[_0x09e2('0x22')][_0x09e2('0x24')]({'where':{'ChanSpyId':_0x9732e1['id']}})[_0x09e2('0x1c')](function(){_0x1b8c07();})[_0x09e2('0x1d')](function(_0x30037c){_0x1b8c07(_0x30037c);});}}});};
\ No newline at end of file
index 719d3f8..df53165 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x404286,_0xcad17a){var _0xc4423a=function(_0xe8283e){while(--_0xe8283e){_0x404286['push'](_0x404286['shift']());}};_0xc4423a(++_0xcad17a);}(_0x750a,0x140));var _0xa750=function(_0xfab439,_0x2a4f87){_0xfab439=_0xfab439-0x0;var _0x4dc112=_0x750a[_0xfab439];return _0x4dc112;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}
\ No newline at end of file
+var _0xda65=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x51ff5e,_0x3838b5){var _0x80c916=function(_0x37ef19){while(--_0x37ef19){_0x51ff5e['push'](_0x51ff5e['shift']());}};_0x80c916(++_0x3838b5);}(_0xda65,0x1d0));var _0x5da6=function(_0x50712e,_0x1dae91){_0x50712e=_0x50712e-0x0;var _0x558e54=_0xda65[_0x50712e];return _0x558e54;};'use strict';var _=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var moment=require(_0x5da6('0x2'));var BPromise=require('bluebird');var rs=require(_0x5da6('0x3'));var fs=require('fs');var Redis=require(_0x5da6('0x4'));var db=require(_0x5da6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5da6('0x6'));var config=require(_0x5da6('0x7'));var jayson=require(_0x5da6('0x8'));var client=jayson[_0x5da6('0x9')][_0x5da6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51924c,_0x35aff9,_0x4a7040){return new BPromise(function(_0x55108e,_0x40722c){return client['request'](_0x51924c,_0x4a7040)[_0x5da6('0xb')](function(_0x20cb14){logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));logger[_0x5da6('0xf')](_0x5da6('0x10'),_0x35aff9,_0x5da6('0xe'),JSON['stringify'](_0x20cb14));if(_0x20cb14[_0x5da6('0x11')]){if(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x12')]===0x1f4){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x40722c(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}logger['error'](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x55108e(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}else{logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));_0x55108e(_0x20cb14[_0x5da6('0x14')][_0x5da6('0x13')]);}})['catch'](function(_0x5207e5){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x5207e5);_0x40722c(_0x5207e5);});});}
\ No newline at end of file
index a2e1efb..1409a2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9f4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','/:id','update','delete'];(function(_0x2442dd,_0x269ded){var _0x9d4594=function(_0x4964ff){while(--_0x4964ff){_0x2442dd['push'](_0x2442dd['shift']());}};_0x9d4594(++_0x269ded);}(_0xb9f4,0x145));var _0x4b9f=function(_0x362407,_0x14a7f5){_0x362407=_0x362407-0x0;var _0x566d3f=_0xb9f4[_0x362407];return _0x566d3f;};'use strict';var multer=require(_0x4b9f('0x0'));var util=require(_0x4b9f('0x1'));var path=require(_0x4b9f('0x2'));var timeout=require(_0x4b9f('0x3'));var express=require(_0x4b9f('0x4'));var router=express[_0x4b9f('0x5')]();var fs_extra=require(_0x4b9f('0x6'));var auth=require(_0x4b9f('0x7'));var interaction=require(_0x4b9f('0x8'));var config=require(_0x4b9f('0x9'));var controller=require(_0x4b9f('0xa'));router[_0x4b9f('0xb')]('/',auth['isAuthenticated'](),controller[_0x4b9f('0xc')]);router[_0x4b9f('0xb')]('/:id',auth[_0x4b9f('0xd')](),controller['show']);router['post']('/',auth[_0x4b9f('0xd')](),controller['create']);router['put'](_0x4b9f('0xe'),auth['isAuthenticated'](),controller[_0x4b9f('0xf')]);router[_0x4b9f('0x10')](_0x4b9f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4b9f('0x11')]=router;
\ No newline at end of file
+var _0xc7f8=['isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0xc7f8,0x184));var _0x8c7f=function(_0x38e319,_0x4416be){_0x38e319=_0x38e319-0x0;var _0xce9889=_0xc7f8[_0x38e319];return _0xce9889;};'use strict';var multer=require(_0x8c7f('0x0'));var util=require(_0x8c7f('0x1'));var path=require(_0x8c7f('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c7f('0x3'));var router=express[_0x8c7f('0x4')]();var fs_extra=require(_0x8c7f('0x5'));var auth=require(_0x8c7f('0x6'));var interaction=require(_0x8c7f('0x7'));var config=require(_0x8c7f('0x8'));var controller=require(_0x8c7f('0x9'));router[_0x8c7f('0xa')]('/',auth[_0x8c7f('0xb')](),controller['index']);router[_0x8c7f('0xa')]('/:id',auth[_0x8c7f('0xb')](),controller[_0x8c7f('0xc')]);router[_0x8c7f('0xd')]('/',auth[_0x8c7f('0xb')](),controller[_0x8c7f('0xe')]);router[_0x8c7f('0xf')]('/:id',auth[_0x8c7f('0xb')](),controller[_0x8c7f('0x10')]);router[_0x8c7f('0x11')](_0x8c7f('0x12'),auth[_0x8c7f('0xb')](),controller[_0x8c7f('0x13')]);module[_0x8c7f('0x14')]=router;
\ No newline at end of file
index ed2842c..b64e106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77fa=['sequelize','STRING'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x77fa,0x1ee));var _0xa77f=function(_0x2884f7,_0x33fdcc){_0x2884f7=_0x2884f7-0x0;var _0x5b726a=_0x77fa[_0x2884f7];return _0x5b726a;};'use strict';var Sequelize=require(_0xa77f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa77f('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xa77f('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7b14=['BOOLEAN','sequelize','STRING','name'];(function(_0x239110,_0x5160b1){var _0x1c1e7c=function(_0xeb1264){while(--_0xeb1264){_0x239110['push'](_0x239110['shift']());}};_0x1c1e7c(++_0x5160b1);}(_0x7b14,0x1b5));var _0x47b1=function(_0x2d519b,_0x2ba15b){_0x2d519b=_0x2d519b-0x0;var _0x5948ae=_0x7b14[_0x2d519b];return _0x5948ae;};'use strict';var Sequelize=require(_0x47b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x47b1('0x1')],'unique':_0x47b1('0x2')},'description':{'type':Sequelize[_0x47b1('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x47b1('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 0ccbc99..3dd44d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5961=['utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','name','index','map','VoiceContext','type','model','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','intersection','include','find','create','body','readFileSync','join','root','server/files/templates/context.ejs'];(function(_0x283344,_0x303bb7){var _0x1047fd=function(_0x20d066){while(--_0x20d066){_0x283344['push'](_0x283344['shift']());}};_0x1047fd(++_0x303bb7);}(_0x5961,0x6f));var _0x1596=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0x5961[_0x74745d];return _0x174ab3;};'use strict';var emlformat=require(_0x1596('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1596('0x1'));var rp=require(_0x1596('0x2'));var moment=require('moment');var BPromise=require(_0x1596('0x3'));var Mustache=require(_0x1596('0x4'));var util=require(_0x1596('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1596('0x6'));var fs=require('fs');var fs_extra=require(_0x1596('0x7'));var _=require(_0x1596('0x8'));var squel=require(_0x1596('0x9'));var crypto=require(_0x1596('0xa'));var jsforce=require(_0x1596('0xb'));var deskjs=require(_0x1596('0xc'));var toCsv=require(_0x1596('0xd'));var querystring=require(_0x1596('0xe'));var Papa=require(_0x1596('0xf'));var Redis=require(_0x1596('0x10'));var authService=require(_0x1596('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1596('0x12'));var hardwareService=require(_0x1596('0x13'));var logger=require(_0x1596('0x14'))(_0x1596('0x15'));var utils=require('../../config/utils');var config=require(_0x1596('0x16'));var licenseUtil=require(_0x1596('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1596('0x18'));var client=jayson['client'][_0x1596('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x30efd0,_0x2aa01e,_0x5602ff,_0x47c879){return new BPromise(function(_0x5ae247,_0x1bb3db){var _0x1fd329=_0x47c879||client;return _0x1fd329[_0x1596('0x1a')](_0x30efd0,_0x5602ff)[_0x1596('0x1b')](function(_0x596d11){logger[_0x1596('0x1c')](_0x1596('0x1d'),_0x2aa01e,_0x1596('0x1e'));logger[_0x1596('0x1f')](_0x1596('0x20'),_0x2aa01e,'request\x20sent',JSON[_0x1596('0x21')](_0x596d11));if(_0x596d11[_0x1596('0x22')]){if(_0x596d11[_0x1596('0x22')][_0x1596('0x23')]===0x1f4){logger[_0x1596('0x22')]('VoiceContext,\x20%s,\x20%s',_0x2aa01e,_0x596d11[_0x1596('0x22')][_0x1596('0x24')]);return _0x1bb3db(_0x596d11['error'][_0x1596('0x24')]);}logger[_0x1596('0x22')](_0x1596('0x1d'),_0x2aa01e,_0x596d11[_0x1596('0x22')][_0x1596('0x24')]);return _0x5ae247(_0x596d11['error']['message']);}else{logger[_0x1596('0x1c')](_0x1596('0x1d'),_0x2aa01e,_0x1596('0x1e'));_0x5ae247(_0x596d11[_0x1596('0x25')]['message']);}})[_0x1596('0x26')](function(_0x229f74){logger[_0x1596('0x22')](_0x1596('0x1d'),_0x2aa01e,_0x229f74);_0x1bb3db(_0x229f74);});});}function respondWithStatusCode(_0x43e2c6,_0x2012c9){_0x2012c9=_0x2012c9||0xcc;return function(_0xef5dda){if(_0xef5dda){return _0x43e2c6[_0x1596('0x27')](_0x2012c9);}return _0x43e2c6['status'](_0x2012c9)[_0x1596('0x28')]();};}function respondWithResult(_0x28616a,_0x23c393){_0x23c393=_0x23c393||0xc8;return function(_0x3a19cf){if(_0x3a19cf){return _0x28616a[_0x1596('0x29')](_0x23c393)[_0x1596('0x2a')](_0x3a19cf);}};}function respondWithFilteredResult(_0x2d460b,_0x412404){return function(_0x5d9d77){if(_0x5d9d77){var _0x555134=typeof _0x412404['offset']===_0x1596('0x2b')&&typeof _0x412404[_0x1596('0x2c')]==='undefined';var _0x4e1489=_0x5d9d77[_0x1596('0x2d')];var _0x1564cd=_0x555134?0x0:_0x412404[_0x1596('0x2e')];var _0x1bd66a=_0x555134?_0x5d9d77[_0x1596('0x2d')]:_0x412404[_0x1596('0x2e')]+_0x412404[_0x1596('0x2c')];var _0x1d112c;if(_0x1bd66a>=_0x4e1489){_0x1bd66a=_0x4e1489;_0x1d112c=0xc8;}else{_0x1d112c=0xce;}_0x2d460b[_0x1596('0x29')](_0x1d112c);return _0x2d460b[_0x1596('0x2f')](_0x1596('0x30'),_0x1564cd+'-'+_0x1bd66a+'/'+_0x4e1489)[_0x1596('0x2a')](_0x5d9d77);}return null;};}function patchUpdates(_0x36bee5){return function(_0x59e0f0){try{jsonpatch[_0x1596('0x31')](_0x59e0f0,_0x36bee5,!![]);}catch(_0x4793b1){return BPromise[_0x1596('0x32')](_0x4793b1);}return _0x59e0f0[_0x1596('0x33')]();};}function saveUpdates(_0x3bc6c8,_0x257aae){return function(_0xff62c7){if(_0xff62c7){return _0xff62c7[_0x1596('0x34')](_0x3bc6c8)[_0x1596('0x1b')](function(_0x3228f7){return _0x3228f7;});}return null;};}function removeEntity(_0x47d1d0,_0x3aa13c){return function(_0xbc7b78){if(_0xbc7b78){return _0xbc7b78[_0x1596('0x35')]()[_0x1596('0x1b')](function(){var _0x1dced1=_0xbc7b78[_0x1596('0x36')]({'plain':!![]});var _0x47f5ad=_0x1596('0x37');return db[_0x1596('0x38')][_0x1596('0x35')]({'where':{'type':_0x47f5ad,'resourceId':_0x1dced1['id']}})[_0x1596('0x1b')](function(){return _0xbc7b78;});})['then'](function(){_0x47d1d0['status'](0xcc)[_0x1596('0x28')]();});}};}function handleEntityNotFound(_0x59bb19,_0x158296){return function(_0x140e00){if(!_0x140e00){_0x59bb19['sendStatus'](0x194);}return _0x140e00;};}function handleError(_0x148c7d,_0x3bd418){_0x3bd418=_0x3bd418||0x1f4;return function(_0x49f087){logger['error'](_0x49f087['stack']);if(_0x49f087[_0x1596('0x39')]){delete _0x49f087[_0x1596('0x39')];}_0x148c7d[_0x1596('0x29')](_0x3bd418)['send'](_0x49f087);};}exports[_0x1596('0x3a')]=function(_0x2ae2ff,_0x415b5f){var _0x421dba={},_0x27d963={},_0x2ab672={'count':0x0,'rows':[]};var _0x222a41=_[_0x1596('0x3b')](db[_0x1596('0x3c')]['rawAttributes'],function(_0x587687){return{'name':_0x587687['fieldName'],'type':_0x587687[_0x1596('0x3d')]['key']};});_0x27d963[_0x1596('0x3e')]=_[_0x1596('0x3b')](_0x222a41,_0x1596('0x39'));_0x27d963[_0x1596('0x3f')]=_['keys'](_0x2ae2ff['query']);_0x27d963[_0x1596('0x40')]=_['intersection'](_0x27d963['model'],_0x27d963['query']);_0x421dba[_0x1596('0x41')]=_['intersection'](_0x27d963[_0x1596('0x3e')],qs[_0x1596('0x42')](_0x2ae2ff[_0x1596('0x3f')][_0x1596('0x42')]));_0x421dba[_0x1596('0x41')]=_0x421dba['attributes'][_0x1596('0x43')]?_0x421dba[_0x1596('0x41')]:_0x27d963[_0x1596('0x3e')];if(!_0x2ae2ff[_0x1596('0x3f')]['hasOwnProperty'](_0x1596('0x44'))){_0x421dba[_0x1596('0x2c')]=qs[_0x1596('0x2c')](_0x2ae2ff[_0x1596('0x3f')][_0x1596('0x2c')]);_0x421dba[_0x1596('0x2e')]=qs[_0x1596('0x2e')](_0x2ae2ff['query'][_0x1596('0x2e')]);}_0x421dba[_0x1596('0x45')]=qs['sort'](_0x2ae2ff['query'][_0x1596('0x46')]);_0x421dba[_0x1596('0x47')]=qs[_0x1596('0x40')](_['pick'](_0x2ae2ff[_0x1596('0x3f')],_0x27d963[_0x1596('0x40')]),_0x222a41);if(_0x2ae2ff['query'][_0x1596('0x48')]){_0x421dba[_0x1596('0x47')]=_[_0x1596('0x49')](_0x421dba[_0x1596('0x47')],{'$or':_[_0x1596('0x3b')](_0x222a41,function(_0x3ee56b){if(_0x3ee56b[_0x1596('0x3d')]!==_0x1596('0x4a')){var _0x1a2ae7={};_0x1a2ae7[_0x3ee56b[_0x1596('0x39')]]={'$like':'%'+_0x2ae2ff['query'][_0x1596('0x48')]+'%'};return _0x1a2ae7;}})});}_0x421dba=_[_0x1596('0x49')]({},_0x421dba,_0x2ae2ff[_0x1596('0x4b')]);var _0x4e7f9f={'where':_0x421dba['where']};return db['VoiceContext']['count'](_0x4e7f9f)[_0x1596('0x1b')](function(_0x30ca67){_0x2ab672['count']=_0x30ca67;if(_0x2ae2ff[_0x1596('0x3f')][_0x1596('0x4c')]){_0x421dba['include']=[{'all':!![]}];}return db['VoiceContext'][_0x1596('0x4d')](_0x421dba);})['then'](function(_0x277f73){_0x2ab672[_0x1596('0x4e')]=_0x277f73;return _0x2ab672;})[_0x1596('0x1b')](respondWithFilteredResult(_0x415b5f,_0x421dba))[_0x1596('0x26')](handleError(_0x415b5f,null));};exports[_0x1596('0x4f')]=function(_0xd13327,_0x5ae536){var _0x53f644={'raw':![],'where':{'id':_0xd13327[_0x1596('0x50')]['id']}},_0x31fdfa={};_0x31fdfa[_0x1596('0x3e')]=_[_0x1596('0x51')](db[_0x1596('0x3c')]['rawAttributes']);_0x31fdfa[_0x1596('0x3f')]=_[_0x1596('0x51')](_0xd13327[_0x1596('0x3f')]);_0x31fdfa['filters']=_[_0x1596('0x52')](_0x31fdfa[_0x1596('0x3e')],_0x31fdfa[_0x1596('0x3f')]);_0x53f644[_0x1596('0x41')]=_['intersection'](_0x31fdfa['model'],qs['fields'](_0xd13327['query']['fields']));_0x53f644[_0x1596('0x41')]=_0x53f644[_0x1596('0x41')][_0x1596('0x43')]?_0x53f644[_0x1596('0x41')]:_0x31fdfa[_0x1596('0x3e')];if(_0xd13327['query'][_0x1596('0x4c')]){_0x53f644[_0x1596('0x53')]=[{'all':!![]}];}_0x53f644=_['merge']({},_0x53f644,_0xd13327[_0x1596('0x4b')]);return db[_0x1596('0x3c')][_0x1596('0x54')](_0x53f644)[_0x1596('0x1b')](handleEntityNotFound(_0x5ae536,null))['then'](respondWithResult(_0x5ae536,null))[_0x1596('0x26')](handleError(_0x5ae536,null));};exports['create']=function(_0x3fd328,_0x2c5a0e,_0x462712){var _0x13bcbf;return db[_0x1596('0x3c')][_0x1596('0x55')](_0x3fd328[_0x1596('0x56')],{'raw':!![]})[_0x1596('0x1b')](function(_0x3c02fe){_0x13bcbf=_0x3c02fe;return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x26407d){var _0x22130f=fs[_0x1596('0x57')](path[_0x1596('0x58')](config[_0x1596('0x59')],_0x1596('0x5a')),_0x1596('0x5b'));var _0x53e154=ejs['render'](_0x22130f,{'contexts':_0x26407d||[]});fs[_0x1596('0x5c')](_0x1596('0x5d'),_0x53e154);})[_0x1596('0x1b')](function(){return respondWithRpcPromise(_0x1596('0x5e'),_0x1596('0x55'),{'module':_0x1596('0x5f')});})['then'](function(){var _0x8f7ea6=_0x3fd328[_0x1596('0x60')][_0x1596('0x36')]({'plain':!![]});if(!_0x8f7ea6)throw new Error(_0x1596('0x61'));if(_0x8f7ea6['role']===_0x1596('0x60')){var _0x8e9461=_0x13bcbf[_0x1596('0x36')]({'plain':!![]});return db[_0x1596('0x62')][_0x1596('0x54')]({'where':{'name':_0x1596('0x37'),'userProfileId':_0x8f7ea6['userProfileId']},'raw':!![]})[_0x1596('0x1b')](function(_0x534f9d){if(_0x534f9d&&_0x534f9d[_0x1596('0x63')]===0x0){return db['UserProfileResource'][_0x1596('0x55')]({'name':_0x8e9461[_0x1596('0x39')],'resourceId':_0x8e9461['id'],'type':_0x534f9d[_0x1596('0x39')],'sectionId':_0x534f9d['id']},{})[_0x1596('0x1b')](function(){return _0x13bcbf;});}else{return _0x13bcbf;}})[_0x1596('0x26')](function(_0x4ae320){logger[_0x1596('0x22')](_0x1596('0x64'),_0x4ae320);throw _0x4ae320;});}return _0x13bcbf;})[_0x1596('0x1b')](respondWithResult(_0x2c5a0e,0xc9))[_0x1596('0x26')](handleError(_0x2c5a0e,null));};exports[_0x1596('0x34')]=function(_0x20ff3c,_0x17ce59,_0x577fef){var _0x1500ea;return db[_0x1596('0x3c')][_0x1596('0x54')]({'where':{'id':_0x20ff3c[_0x1596('0x50')]['id']}})[_0x1596('0x1b')](handleEntityNotFound(_0x17ce59,null))['then'](saveUpdates(_0x20ff3c[_0x1596('0x56')],null))[_0x1596('0x1b')](function(_0x52c6f8){if(_0x52c6f8){_0x1500ea=_0x52c6f8;return db[_0x1596('0x3c')][_0x1596('0x4d')]({'raw':!![]});}})[_0x1596('0x1b')](function(_0x523ad0){var _0x1d4d11=fs['readFileSync'](path[_0x1596('0x58')](config['root'],_0x1596('0x5a')),_0x1596('0x5b'));var _0xbe17ad=ejs['render'](_0x1d4d11,{'contexts':_0x523ad0||[]});fs[_0x1596('0x5c')](_0x1596('0x5d'),_0xbe17ad);})[_0x1596('0x1b')](function(){return respondWithRpcPromise(_0x1596('0x5e'),_0x1596('0x34'),{'module':_0x1596('0x5f')});})['then'](function(){return _0x1500ea;})[_0x1596('0x1b')](respondWithResult(_0x17ce59,null))[_0x1596('0x26')](handleError(_0x17ce59,null));};exports['destroy']=function(_0x5b492c,_0x2764c1,_0x376d5b){var _0x5a5c79;return db[_0x1596('0x3c')][_0x1596('0x54')]({'where':{'id':_0x5b492c[_0x1596('0x50')]['id']}})[_0x1596('0x1b')](handleEntityNotFound(_0x2764c1,null))[_0x1596('0x1b')](removeEntity(_0x2764c1,null))[_0x1596('0x1b')](function(){return db['VoiceContext'][_0x1596('0x4d')]({'raw':!![]});})['then'](function(_0x13e64a){var _0x2acfa9=fs['readFileSync'](path[_0x1596('0x58')](config[_0x1596('0x59')],_0x1596('0x5a')),_0x1596('0x5b'));var _0x1903a6=ejs['render'](_0x2acfa9,{'contexts':_0x13e64a});fs[_0x1596('0x5c')](_0x1596('0x5d'),_0x1903a6);return respondWithRpcPromise(_0x1596('0x5e'),'destroy',{'module':_0x1596('0x5f')});})['catch'](handleError(_0x2764c1,null));};
\ No newline at end of file
+var _0x8fb6=['render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','join','writeFileSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','reject','save','get','Contexts','UserProfileResource','destroy','name','send','index','VoiceContext','rawAttributes','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','create','root','server/files/templates/context.ejs','utf8'];(function(_0x2409cb,_0x219fb1){var _0x1682d7=function(_0x481a50){while(--_0x481a50){_0x2409cb['push'](_0x2409cb['shift']());}};_0x1682d7(++_0x219fb1);}(_0x8fb6,0x76));var _0x68fb=function(_0x1f7f9f,_0x330b00){_0x1f7f9f=_0x1f7f9f-0x0;var _0x5d999f=_0x8fb6[_0x1f7f9f];return _0x5d999f;};'use strict';var emlformat=require(_0x68fb('0x0'));var rimraf=require(_0x68fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x68fb('0x2'));var rp=require(_0x68fb('0x3'));var moment=require('moment');var BPromise=require(_0x68fb('0x4'));var Mustache=require(_0x68fb('0x5'));var util=require(_0x68fb('0x6'));var path=require(_0x68fb('0x7'));var sox=require(_0x68fb('0x8'));var csv=require('to-csv');var ejs=require(_0x68fb('0x9'));var fs=require('fs');var fs_extra=require(_0x68fb('0xa'));var _=require(_0x68fb('0xb'));var squel=require('squel');var crypto=require(_0x68fb('0xc'));var jsforce=require(_0x68fb('0xd'));var deskjs=require(_0x68fb('0xe'));var toCsv=require(_0x68fb('0xf'));var querystring=require('querystring');var Papa=require(_0x68fb('0x10'));var Redis=require(_0x68fb('0x11'));var authService=require(_0x68fb('0x12'));var qs=require(_0x68fb('0x13'));var as=require(_0x68fb('0x14'));var hardwareService=require(_0x68fb('0x15'));var logger=require('../../config/logger')(_0x68fb('0x16'));var utils=require(_0x68fb('0x17'));var config=require(_0x68fb('0x18'));var licenseUtil=require(_0x68fb('0x19'));var db=require(_0x68fb('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x68fb('0x1b')][_0x68fb('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x206050,_0x7b174f,_0x439c85,_0x37a539){return new BPromise(function(_0x2611a4,_0x32c877){var _0xa82cd4=_0x37a539||client;return _0xa82cd4[_0x68fb('0x1d')](_0x206050,_0x439c85)[_0x68fb('0x1e')](function(_0x5b0484){logger[_0x68fb('0x1f')](_0x68fb('0x20'),_0x7b174f,_0x68fb('0x21'));logger[_0x68fb('0x22')](_0x68fb('0x23'),_0x7b174f,_0x68fb('0x21'),JSON[_0x68fb('0x24')](_0x5b0484));if(_0x5b0484['error']){if(_0x5b0484[_0x68fb('0x25')][_0x68fb('0x26')]===0x1f4){logger[_0x68fb('0x25')](_0x68fb('0x20'),_0x7b174f,_0x5b0484['error'][_0x68fb('0x27')]);return _0x32c877(_0x5b0484[_0x68fb('0x25')][_0x68fb('0x27')]);}logger[_0x68fb('0x25')](_0x68fb('0x20'),_0x7b174f,_0x5b0484[_0x68fb('0x25')][_0x68fb('0x27')]);return _0x2611a4(_0x5b0484[_0x68fb('0x25')][_0x68fb('0x27')]);}else{logger[_0x68fb('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x7b174f,'request\x20sent');_0x2611a4(_0x5b0484[_0x68fb('0x28')][_0x68fb('0x27')]);}})[_0x68fb('0x29')](function(_0x35be7c){logger[_0x68fb('0x25')]('VoiceContext,\x20%s,\x20%s',_0x7b174f,_0x35be7c);_0x32c877(_0x35be7c);});});}function respondWithStatusCode(_0x59a303,_0x8dbbeb){_0x8dbbeb=_0x8dbbeb||0xcc;return function(_0xa8f414){if(_0xa8f414){return _0x59a303[_0x68fb('0x2a')](_0x8dbbeb);}return _0x59a303['status'](_0x8dbbeb)[_0x68fb('0x2b')]();};}function respondWithResult(_0xc0f811,_0x520aab){_0x520aab=_0x520aab||0xc8;return function(_0x134d4d){if(_0x134d4d){return _0xc0f811['status'](_0x520aab)[_0x68fb('0x2c')](_0x134d4d);}};}function respondWithFilteredResult(_0x6f8771,_0x548de9){return function(_0x33db9b){if(_0x33db9b){var _0x5bbe9d=typeof _0x548de9[_0x68fb('0x2d')]===_0x68fb('0x2e')&&typeof _0x548de9['limit']===_0x68fb('0x2e');var _0x31e3b0=_0x33db9b[_0x68fb('0x2f')];var _0x26197c=_0x5bbe9d?0x0:_0x548de9[_0x68fb('0x2d')];var _0x5ec3b7=_0x5bbe9d?_0x33db9b['count']:_0x548de9[_0x68fb('0x2d')]+_0x548de9['limit'];var _0x254d6c;if(_0x5ec3b7>=_0x31e3b0){_0x5ec3b7=_0x31e3b0;_0x254d6c=0xc8;}else{_0x254d6c=0xce;}_0x6f8771[_0x68fb('0x30')](_0x254d6c);return _0x6f8771[_0x68fb('0x31')](_0x68fb('0x32'),_0x26197c+'-'+_0x5ec3b7+'/'+_0x31e3b0)[_0x68fb('0x2c')](_0x33db9b);}return null;};}function patchUpdates(_0x427a16){return function(_0x247da7){try{jsonpatch['apply'](_0x247da7,_0x427a16,!![]);}catch(_0x3b9532){return BPromise[_0x68fb('0x33')](_0x3b9532);}return _0x247da7[_0x68fb('0x34')]();};}function saveUpdates(_0x29f35f,_0x52eb0c){return function(_0x3d9102){if(_0x3d9102){return _0x3d9102['update'](_0x29f35f)[_0x68fb('0x1e')](function(_0x48b9b7){return _0x48b9b7;});}return null;};}function removeEntity(_0x169a5b,_0xc9f53c){return function(_0x382825){if(_0x382825){return _0x382825['destroy']()[_0x68fb('0x1e')](function(){var _0x3bc017=_0x382825[_0x68fb('0x35')]({'plain':!![]});var _0x205e8e=_0x68fb('0x36');return db[_0x68fb('0x37')][_0x68fb('0x38')]({'where':{'type':_0x205e8e,'resourceId':_0x3bc017['id']}})[_0x68fb('0x1e')](function(){return _0x382825;});})[_0x68fb('0x1e')](function(){_0x169a5b[_0x68fb('0x30')](0xcc)[_0x68fb('0x2b')]();});}};}function handleEntityNotFound(_0x1bb79f,_0x36fddd){return function(_0x418098){if(!_0x418098){_0x1bb79f['sendStatus'](0x194);}return _0x418098;};}function handleError(_0x2bc1af,_0x50d4cd){_0x50d4cd=_0x50d4cd||0x1f4;return function(_0x156c27){logger[_0x68fb('0x25')](_0x156c27['stack']);if(_0x156c27[_0x68fb('0x39')]){delete _0x156c27[_0x68fb('0x39')];}_0x2bc1af[_0x68fb('0x30')](_0x50d4cd)[_0x68fb('0x3a')](_0x156c27);};}exports[_0x68fb('0x3b')]=function(_0x48519c,_0x26bce9){var _0x11d302={},_0x37664f={},_0xe0521d={'count':0x0,'rows':[]};var _0x7741cf=_['map'](db[_0x68fb('0x3c')][_0x68fb('0x3d')],function(_0x342e87){return{'name':_0x342e87['fieldName'],'type':_0x342e87[_0x68fb('0x3e')]['key']};});_0x37664f['model']=_[_0x68fb('0x3f')](_0x7741cf,_0x68fb('0x39'));_0x37664f[_0x68fb('0x40')]=_[_0x68fb('0x41')](_0x48519c[_0x68fb('0x40')]);_0x37664f[_0x68fb('0x42')]=_['intersection'](_0x37664f[_0x68fb('0x43')],_0x37664f[_0x68fb('0x40')]);_0x11d302[_0x68fb('0x44')]=_[_0x68fb('0x45')](_0x37664f[_0x68fb('0x43')],qs['fields'](_0x48519c[_0x68fb('0x40')][_0x68fb('0x46')]));_0x11d302['attributes']=_0x11d302[_0x68fb('0x44')][_0x68fb('0x47')]?_0x11d302['attributes']:_0x37664f['model'];if(!_0x48519c[_0x68fb('0x40')][_0x68fb('0x48')](_0x68fb('0x49'))){_0x11d302['limit']=qs['limit'](_0x48519c[_0x68fb('0x40')]['limit']);_0x11d302[_0x68fb('0x2d')]=qs[_0x68fb('0x2d')](_0x48519c[_0x68fb('0x40')][_0x68fb('0x2d')]);}_0x11d302[_0x68fb('0x4a')]=qs['sort'](_0x48519c[_0x68fb('0x40')][_0x68fb('0x4b')]);_0x11d302[_0x68fb('0x4c')]=qs[_0x68fb('0x42')](_[_0x68fb('0x4d')](_0x48519c[_0x68fb('0x40')],_0x37664f['filters']),_0x7741cf);if(_0x48519c[_0x68fb('0x40')][_0x68fb('0x4e')]){_0x11d302['where']=_[_0x68fb('0x4f')](_0x11d302[_0x68fb('0x4c')],{'$or':_['map'](_0x7741cf,function(_0x52b219){if(_0x52b219[_0x68fb('0x3e')]!==_0x68fb('0x50')){var _0x557d58={};_0x557d58[_0x52b219[_0x68fb('0x39')]]={'$like':'%'+_0x48519c['query'][_0x68fb('0x4e')]+'%'};return _0x557d58;}})});}_0x11d302=_[_0x68fb('0x4f')]({},_0x11d302,_0x48519c[_0x68fb('0x51')]);var _0x430b50={'where':_0x11d302['where']};return db[_0x68fb('0x3c')][_0x68fb('0x2f')](_0x430b50)[_0x68fb('0x1e')](function(_0x57e759){_0xe0521d['count']=_0x57e759;if(_0x48519c[_0x68fb('0x40')][_0x68fb('0x52')]){_0x11d302['include']=[{'all':!![]}];}return db['VoiceContext'][_0x68fb('0x53')](_0x11d302);})['then'](function(_0x232615){_0xe0521d[_0x68fb('0x54')]=_0x232615;return _0xe0521d;})[_0x68fb('0x1e')](respondWithFilteredResult(_0x26bce9,_0x11d302))[_0x68fb('0x29')](handleError(_0x26bce9,null));};exports[_0x68fb('0x55')]=function(_0x40fbf5,_0x5545a5){var _0x317c20={'raw':![],'where':{'id':_0x40fbf5[_0x68fb('0x56')]['id']}},_0xe436ce={};_0xe436ce[_0x68fb('0x43')]=_[_0x68fb('0x41')](db[_0x68fb('0x3c')]['rawAttributes']);_0xe436ce[_0x68fb('0x40')]=_[_0x68fb('0x41')](_0x40fbf5[_0x68fb('0x40')]);_0xe436ce[_0x68fb('0x42')]=_[_0x68fb('0x45')](_0xe436ce['model'],_0xe436ce[_0x68fb('0x40')]);_0x317c20[_0x68fb('0x44')]=_[_0x68fb('0x45')](_0xe436ce[_0x68fb('0x43')],qs[_0x68fb('0x46')](_0x40fbf5[_0x68fb('0x40')]['fields']));_0x317c20['attributes']=_0x317c20['attributes'][_0x68fb('0x47')]?_0x317c20[_0x68fb('0x44')]:_0xe436ce[_0x68fb('0x43')];if(_0x40fbf5[_0x68fb('0x40')][_0x68fb('0x52')]){_0x317c20['include']=[{'all':!![]}];}_0x317c20=_[_0x68fb('0x4f')]({},_0x317c20,_0x40fbf5[_0x68fb('0x51')]);return db[_0x68fb('0x3c')][_0x68fb('0x57')](_0x317c20)[_0x68fb('0x1e')](handleEntityNotFound(_0x5545a5,null))['then'](respondWithResult(_0x5545a5,null))[_0x68fb('0x29')](handleError(_0x5545a5,null));};exports[_0x68fb('0x58')]=function(_0x3690b8,_0x101cf8,_0x52aee1){var _0x40ca20;return db['VoiceContext'][_0x68fb('0x58')](_0x3690b8['body'],{'raw':!![]})[_0x68fb('0x1e')](function(_0x445612){_0x40ca20=_0x445612;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x68fb('0x1e')](function(_0x1076c0){var _0x4532a0=fs['readFileSync'](path['join'](config[_0x68fb('0x59')],_0x68fb('0x5a')),_0x68fb('0x5b'));var _0x513fd4=ejs[_0x68fb('0x5c')](_0x4532a0,{'contexts':_0x1076c0||[]});fs['writeFileSync'](_0x68fb('0x5d'),_0x513fd4);})[_0x68fb('0x1e')](function(){return respondWithRpcPromise(_0x68fb('0x5e'),'create',{'module':_0x68fb('0x5f')});})[_0x68fb('0x1e')](function(){var _0x3dacfa=_0x3690b8['user']['get']({'plain':!![]});if(!_0x3dacfa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3dacfa[_0x68fb('0x60')]===_0x68fb('0x61')){var _0x5bf450=_0x40ca20[_0x68fb('0x35')]({'plain':!![]});return db[_0x68fb('0x62')][_0x68fb('0x57')]({'where':{'name':_0x68fb('0x36'),'userProfileId':_0x3dacfa[_0x68fb('0x63')]},'raw':!![]})['then'](function(_0x12eaac){if(_0x12eaac&&_0x12eaac[_0x68fb('0x64')]===0x0){return db['UserProfileResource'][_0x68fb('0x58')]({'name':_0x5bf450[_0x68fb('0x39')],'resourceId':_0x5bf450['id'],'type':_0x12eaac[_0x68fb('0x39')],'sectionId':_0x12eaac['id']},{})[_0x68fb('0x1e')](function(){return _0x40ca20;});}else{return _0x40ca20;}})[_0x68fb('0x29')](function(_0x2791ab){logger[_0x68fb('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2791ab);throw _0x2791ab;});}return _0x40ca20;})['then'](respondWithResult(_0x101cf8,0xc9))[_0x68fb('0x29')](handleError(_0x101cf8,null));};exports[_0x68fb('0x65')]=function(_0x1d1aa7,_0x5540b4,_0x27ffcc){var _0x3e3345;return db[_0x68fb('0x3c')]['find']({'where':{'id':_0x1d1aa7[_0x68fb('0x56')]['id']}})['then'](handleEntityNotFound(_0x5540b4,null))['then'](saveUpdates(_0x1d1aa7[_0x68fb('0x66')],null))[_0x68fb('0x1e')](function(_0xf5476e){if(_0xf5476e){_0x3e3345=_0xf5476e;return db[_0x68fb('0x3c')]['findAll']({'raw':!![]});}})['then'](function(_0x1cc54b){var _0x58a77d=fs['readFileSync'](path['join'](config[_0x68fb('0x59')],_0x68fb('0x5a')),'utf8');var _0x93f14d=ejs[_0x68fb('0x5c')](_0x58a77d,{'contexts':_0x1cc54b||[]});fs['writeFileSync'](_0x68fb('0x5d'),_0x93f14d);})[_0x68fb('0x1e')](function(){return respondWithRpcPromise(_0x68fb('0x5e'),_0x68fb('0x65'),{'module':_0x68fb('0x5f')});})[_0x68fb('0x1e')](function(){return _0x3e3345;})[_0x68fb('0x1e')](respondWithResult(_0x5540b4,null))[_0x68fb('0x29')](handleError(_0x5540b4,null));};exports[_0x68fb('0x38')]=function(_0x3a40fd,_0x103251,_0x161d85){var _0x538945;return db[_0x68fb('0x3c')][_0x68fb('0x57')]({'where':{'id':_0x3a40fd[_0x68fb('0x56')]['id']}})['then'](handleEntityNotFound(_0x103251,null))[_0x68fb('0x1e')](removeEntity(_0x103251,null))[_0x68fb('0x1e')](function(){return db['VoiceContext'][_0x68fb('0x53')]({'raw':!![]});})[_0x68fb('0x1e')](function(_0x1d0eff){var _0x36168a=fs['readFileSync'](path[_0x68fb('0x67')](config[_0x68fb('0x59')],'server/files/templates/context.ejs'),_0x68fb('0x5b'));var _0x2e687a=ejs[_0x68fb('0x5c')](_0x36168a,{'contexts':_0x1d0eff});fs[_0x68fb('0x68')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2e687a);return respondWithRpcPromise(_0x68fb('0x5e'),_0x68fb('0x38'),{'module':_0x68fb('0x5f')});})[_0x68fb('0x29')](handleError(_0x103251,null));};
\ No newline at end of file
index 64f87e8..c520ea8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6ce=['../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2ef3fc,_0x10de2c){var _0x200d57=function(_0x7131c8){while(--_0x7131c8){_0x2ef3fc['push'](_0x2ef3fc['shift']());}};_0x200d57(++_0x10de2c);}(_0xf6ce,0x14a));var _0xef6c=function(_0x6a1508,_0x49285c){_0x6a1508=_0x6a1508-0x0;var _0x2a8af8=_0xf6ce[_0x6a1508];return _0x2a8af8;};'use strict';var _=require(_0xef6c('0x0'));var util=require(_0xef6c('0x1'));var logger=require(_0xef6c('0x2'))(_0xef6c('0x3'));var moment=require(_0xef6c('0x4'));var BPromise=require(_0xef6c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef6c('0x6'));var rimraf=require(_0xef6c('0x7'));var config=require(_0xef6c('0x8'));var attributes=require('./voiceContext.attributes');module[_0xef6c('0x9')]=function(_0x2de572,_0x2cf8d8){return _0x2de572[_0xef6c('0xa')](_0xef6c('0xb'),attributes,{'tableName':_0xef6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ba7=['bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2ba7,0xe9));var _0x72ba=function(_0x36ad89,_0x524fde){_0x36ad89=_0x36ad89-0x0;var _0x2af7d4=_0x2ba7[_0x36ad89];return _0x2af7d4;};'use strict';var _=require(_0x72ba('0x0'));var util=require(_0x72ba('0x1'));var logger=require(_0x72ba('0x2'))(_0x72ba('0x3'));var moment=require(_0x72ba('0x4'));var BPromise=require(_0x72ba('0x5'));var rp=require(_0x72ba('0x6'));var fs=require('fs');var path=require(_0x72ba('0x7'));var rimraf=require(_0x72ba('0x8'));var config=require('../../config/environment');var attributes=require(_0x72ba('0x9'));module[_0x72ba('0xa')]=function(_0x234a34,_0x47e97d){return _0x234a34[_0x72ba('0xb')](_0x72ba('0xc'),attributes,{'tableName':_0x72ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea6884b..2776bd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4628=['jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x54a28a,_0x1ba1fe){var _0x3da1f1=function(_0x7231b5){while(--_0x7231b5){_0x54a28a['push'](_0x54a28a['shift']());}};_0x3da1f1(++_0x1ba1fe);}(_0x4628,0xd3));var _0x8462=function(_0x4d6659,_0x5eff88){_0x4d6659=_0x4d6659-0x0;var _0x2c4287=_0x4628[_0x4d6659];return _0x2c4287;};'use strict';var _=require(_0x8462('0x0'));var util=require(_0x8462('0x1'));var moment=require('moment');var BPromise=require(_0x8462('0x2'));var rs=require(_0x8462('0x3'));var fs=require('fs');var Redis=require(_0x8462('0x4'));var db=require(_0x8462('0x5'))['db'];var utils=require(_0x8462('0x6'));var logger=require('../../config/logger')(_0x8462('0x7'));var config=require(_0x8462('0x8'));var jayson=require(_0x8462('0x9'));var client=jayson[_0x8462('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12dad7,_0x4b92a7,_0x162bea){return new BPromise(function(_0x4b987a,_0x314c4c){return client[_0x8462('0xb')](_0x12dad7,_0x162bea)['then'](function(_0x58ec31){logger[_0x8462('0xc')](_0x8462('0xd'),_0x4b92a7,_0x8462('0xe'));logger[_0x8462('0xf')](_0x8462('0x10'),_0x4b92a7,_0x8462('0xe'),JSON['stringify'](_0x58ec31));if(_0x58ec31[_0x8462('0x11')]){if(_0x58ec31[_0x8462('0x11')]['code']===0x1f4){logger[_0x8462('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4b92a7,_0x58ec31['error']['message']);return _0x314c4c(_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);}logger[_0x8462('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4b92a7,_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);return _0x4b987a(_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);}else{logger['info'](_0x8462('0xd'),_0x4b92a7,_0x8462('0xe'));_0x4b987a(_0x58ec31['result'][_0x8462('0x12')]);}})[_0x8462('0x13')](function(_0xabd292){logger[_0x8462('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4b92a7,_0xabd292);_0x314c4c(_0xabd292);});});}
\ No newline at end of file
+var _0x23a3=['stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x27e7f6,_0xb9d675){var _0x50eff6=function(_0x354fa6){while(--_0x354fa6){_0x27e7f6['push'](_0x27e7f6['shift']());}};_0x50eff6(++_0xb9d675);}(_0x23a3,0x131));var _0x323a=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x23a3[_0x1b5aea];return _0x51cae9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x323a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x323a('0x1'));var db=require(_0x323a('0x2'))['db'];var utils=require(_0x323a('0x3'));var logger=require(_0x323a('0x4'))(_0x323a('0x5'));var config=require(_0x323a('0x6'));var jayson=require(_0x323a('0x7'));var client=jayson[_0x323a('0x8')][_0x323a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad5a,_0x3452d3,_0x3544bd){return new BPromise(function(_0x568996,_0x385a54){return client[_0x323a('0xa')](_0x50ad5a,_0x3544bd)[_0x323a('0xb')](function(_0x4a74bd){logger[_0x323a('0xc')](_0x323a('0xd'),_0x3452d3,_0x323a('0xe'));logger[_0x323a('0xf')](_0x323a('0x10'),_0x3452d3,_0x323a('0xe'),JSON[_0x323a('0x11')](_0x4a74bd));if(_0x4a74bd[_0x323a('0x12')]){if(_0x4a74bd[_0x323a('0x12')][_0x323a('0x13')]===0x1f4){logger[_0x323a('0x12')](_0x323a('0xd'),_0x3452d3,_0x4a74bd[_0x323a('0x12')][_0x323a('0x14')]);return _0x385a54(_0x4a74bd['error'][_0x323a('0x14')]);}logger['error'](_0x323a('0xd'),_0x3452d3,_0x4a74bd['error']['message']);return _0x568996(_0x4a74bd[_0x323a('0x12')]['message']);}else{logger[_0x323a('0xc')]('VoiceContext,\x20%s,\x20%s',_0x3452d3,_0x323a('0xe'));_0x568996(_0x4a74bd[_0x323a('0x15')]['message']);}})[_0x323a('0x16')](function(_0x32674f){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3452d3,_0x32674f);_0x385a54(_0x32674f);});});}
\ No newline at end of file
index d6abd3b..b2835de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8134=['/describe','isAuthenticated','describe','show','post','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index'];(function(_0x4888a3,_0x3fa072){var _0x3d870d=function(_0x3a6e87){while(--_0x3a6e87){_0x4888a3['push'](_0x4888a3['shift']());}};_0x3d870d(++_0x3fa072);}(_0x8134,0xf6));var _0x4813=function(_0x3f70e2,_0x17ac41){_0x3f70e2=_0x3f70e2-0x0;var _0x5e2762=_0x8134[_0x3f70e2];return _0x5e2762;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4813('0x0'));var timeout=require(_0x4813('0x1'));var express=require(_0x4813('0x2'));var router=express[_0x4813('0x3')]();var fs_extra=require(_0x4813('0x4'));var auth=require(_0x4813('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4813('0x6'));var controller=require('./voiceDialReport.controller');router[_0x4813('0x7')]('/',auth['isAuthenticated'](),controller[_0x4813('0x8')]);router[_0x4813('0x7')](_0x4813('0x9'),auth[_0x4813('0xa')](),controller[_0x4813('0xb')]);router[_0x4813('0x7')]('/:id',auth[_0x4813('0xa')](),controller[_0x4813('0xc')]);router[_0x4813('0xd')]('/',auth[_0x4813('0xa')](),controller['create']);router['put'](_0x4813('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x4813('0xf')](_0x4813('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4813('0x10')]=router;
\ No newline at end of file
+var _0xe032=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x37a3e8,_0x3bbccb){var _0x3fa03c=function(_0x38e819){while(--_0x38e819){_0x37a3e8['push'](_0x37a3e8['shift']());}};_0x3fa03c(++_0x3bbccb);}(_0xe032,0x175));var _0x2e03=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0xe032[_0x37a9d7];return _0x1343d3;};'use strict';var multer=require(_0x2e03('0x0'));var util=require(_0x2e03('0x1'));var path=require(_0x2e03('0x2'));var timeout=require(_0x2e03('0x3'));var express=require(_0x2e03('0x4'));var router=express[_0x2e03('0x5')]();var fs_extra=require(_0x2e03('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2e03('0x7'));var config=require('../../config/environment');var controller=require(_0x2e03('0x8'));router['get']('/',auth[_0x2e03('0x9')](),controller[_0x2e03('0xa')]);router[_0x2e03('0xb')](_0x2e03('0xc'),auth[_0x2e03('0x9')](),controller[_0x2e03('0xd')]);router[_0x2e03('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2e03('0xe')]);router[_0x2e03('0xf')]('/',auth[_0x2e03('0x9')](),controller[_0x2e03('0x10')]);router[_0x2e03('0x11')](_0x2e03('0x12'),auth[_0x2e03('0x9')](),controller[_0x2e03('0x13')]);router['delete']('/:id',auth[_0x2e03('0x9')](),controller[_0x2e03('0x14')]);module[_0x2e03('0x15')]=router;
\ No newline at end of file
index f2b24c2..86ad4b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x32b4f5,_0x178872){var _0x4569f6=function(_0xcded6c){while(--_0xcded6c){_0x32b4f5['push'](_0x32b4f5['shift']());}};_0x4569f6(++_0x178872);}(_0x24ca,0x1bc));var _0xa24c=function(_0x54d52,_0x2473ba){_0x54d52=_0x54d52-0x0;var _0x968345=_0x24ca[_0x54d52];return _0x968345;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
+var _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x48b528,_0x367191){var _0x3bff6a=function(_0xcc3b2e){while(--_0xcc3b2e){_0x48b528['push'](_0x48b528['shift']());}};_0x3bff6a(++_0x367191);}(_0x9a19,0x114));var _0x99a1=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9a19[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}};
\ No newline at end of file
index 160710c..835517f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b68=['options','VoiceDialReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x15ce78,_0x3a0506){var _0x254406=function(_0x31bd44){while(--_0x31bd44){_0x15ce78['push'](_0x15ce78['shift']());}};_0x254406(++_0x3a0506);}(_0x8b68,0x1e0));var _0x88b6=function(_0x218628,_0x3b236e){_0x218628=_0x218628-0x0;var _0xa7055e=_0x8b68[_0x218628];return _0xa7055e;};'use strict';var emlformat=require(_0x88b6('0x0'));var rimraf=require(_0x88b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88b6('0x2'));var rp=require(_0x88b6('0x3'));var moment=require(_0x88b6('0x4'));var BPromise=require(_0x88b6('0x5'));var Mustache=require(_0x88b6('0x6'));var util=require(_0x88b6('0x7'));var path=require(_0x88b6('0x8'));var sox=require('sox');var csv=require(_0x88b6('0x9'));var ejs=require(_0x88b6('0xa'));var fs=require('fs');var fs_extra=require(_0x88b6('0xb'));var _=require(_0x88b6('0xc'));var squel=require(_0x88b6('0xd'));var crypto=require('crypto');var jsforce=require(_0x88b6('0xe'));var deskjs=require(_0x88b6('0xf'));var toCsv=require(_0x88b6('0x9'));var querystring=require(_0x88b6('0x10'));var Papa=require(_0x88b6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x88b6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x88b6('0x13'));var logger=require(_0x88b6('0x14'))(_0x88b6('0x15'));var utils=require(_0x88b6('0x16'));var config=require(_0x88b6('0x17'));var licenseUtil=require(_0x88b6('0x18'));var db=require(_0x88b6('0x19'))['db'];function respondWithStatusCode(_0x2effd9,_0x454e71){_0x454e71=_0x454e71||0xcc;return function(_0xf40d7b){if(_0xf40d7b){return _0x2effd9[_0x88b6('0x1a')](_0x454e71);}return _0x2effd9['status'](_0x454e71)[_0x88b6('0x1b')]();};}function respondWithResult(_0x9ce25f,_0x3ee948){_0x3ee948=_0x3ee948||0xc8;return function(_0xe7ce22){if(_0xe7ce22){return _0x9ce25f[_0x88b6('0x1c')](_0x3ee948)[_0x88b6('0x1d')](_0xe7ce22);}};}function respondWithFilteredResult(_0x2425b1,_0x8a6324){return function(_0x1f3652){if(_0x1f3652){var _0x3f505f=typeof _0x8a6324[_0x88b6('0x1e')]===_0x88b6('0x1f')&&typeof _0x8a6324[_0x88b6('0x20')]==='undefined';var _0x19933f=_0x1f3652[_0x88b6('0x21')];var _0x332739=_0x3f505f?0x0:_0x8a6324['offset'];var _0x29e52c=_0x3f505f?_0x1f3652[_0x88b6('0x21')]:_0x8a6324['offset']+_0x8a6324[_0x88b6('0x20')];var _0x214b16;if(_0x29e52c>=_0x19933f){_0x29e52c=_0x19933f;_0x214b16=0xc8;}else{_0x214b16=0xce;}_0x2425b1['status'](_0x214b16);return _0x2425b1[_0x88b6('0x22')](_0x88b6('0x23'),_0x332739+'-'+_0x29e52c+'/'+_0x19933f)[_0x88b6('0x1d')](_0x1f3652);}return null;};}function patchUpdates(_0x334fca){return function(_0x41d380){try{jsonpatch[_0x88b6('0x24')](_0x41d380,_0x334fca,!![]);}catch(_0x5436da){return BPromise[_0x88b6('0x25')](_0x5436da);}return _0x41d380[_0x88b6('0x26')]();};}function saveUpdates(_0x17be6e,_0x418a38){return function(_0x56f3e1){if(_0x56f3e1){return _0x56f3e1[_0x88b6('0x27')](_0x17be6e)['then'](function(_0x473a7a){return _0x473a7a;});}return null;};}function removeEntity(_0x112589,_0x177f04){return function(_0x39855f){if(_0x39855f){return _0x39855f[_0x88b6('0x28')]()[_0x88b6('0x29')](function(){_0x112589[_0x88b6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6b3826,_0x43f001){return function(_0x158731){if(!_0x158731){_0x6b3826['sendStatus'](0x194);}return _0x158731;};}function handleError(_0x3862b3,_0x165012){_0x165012=_0x165012||0x1f4;return function(_0x3fbc2b){logger['error'](_0x3fbc2b[_0x88b6('0x2a')]);if(_0x3fbc2b['name']){delete _0x3fbc2b[_0x88b6('0x2b')];}_0x3862b3[_0x88b6('0x1c')](_0x165012)[_0x88b6('0x2c')](_0x3fbc2b);};}exports[_0x88b6('0x2d')]=function(_0xda34fc,_0x8f4bd4){var _0x5ec1e2={},_0x442d93={},_0x565049={'count':0x0,'rows':[]};var _0x552c44=_[_0x88b6('0x2e')](db['VoiceDialReport'][_0x88b6('0x2f')],function(_0x2d2ab5){return{'name':_0x2d2ab5[_0x88b6('0x30')],'type':_0x2d2ab5[_0x88b6('0x31')]['key']};});_0x442d93[_0x88b6('0x32')]=_['map'](_0x552c44,_0x88b6('0x2b'));_0x442d93['query']=_['keys'](_0xda34fc[_0x88b6('0x33')]);_0x442d93[_0x88b6('0x34')]=_[_0x88b6('0x35')](_0x442d93[_0x88b6('0x32')],_0x442d93[_0x88b6('0x33')]);_0x5ec1e2[_0x88b6('0x36')]=_[_0x88b6('0x35')](_0x442d93[_0x88b6('0x32')],qs[_0x88b6('0x37')](_0xda34fc[_0x88b6('0x33')]['fields']));_0x5ec1e2['attributes']=_0x5ec1e2[_0x88b6('0x36')][_0x88b6('0x38')]?_0x5ec1e2[_0x88b6('0x36')]:_0x442d93[_0x88b6('0x32')];if(!_0xda34fc[_0x88b6('0x33')][_0x88b6('0x39')](_0x88b6('0x3a'))){_0x5ec1e2['limit']=qs['limit'](_0xda34fc['query']['limit']);_0x5ec1e2[_0x88b6('0x1e')]=qs[_0x88b6('0x1e')](_0xda34fc['query'][_0x88b6('0x1e')]);}_0x5ec1e2[_0x88b6('0x3b')]=qs[_0x88b6('0x3c')](_0xda34fc[_0x88b6('0x33')][_0x88b6('0x3c')]);_0x5ec1e2[_0x88b6('0x3d')]=qs[_0x88b6('0x34')](_[_0x88b6('0x3e')](_0xda34fc[_0x88b6('0x33')],_0x442d93[_0x88b6('0x34')]),_0x552c44);if(_0xda34fc[_0x88b6('0x33')][_0x88b6('0x3f')]){_0x5ec1e2[_0x88b6('0x3d')]=_[_0x88b6('0x40')](_0x5ec1e2[_0x88b6('0x3d')],{'$or':_[_0x88b6('0x2e')](_0x552c44,function(_0x2bbbe9){if(_0x2bbbe9[_0x88b6('0x31')]!==_0x88b6('0x41')){var _0x1e86db={};_0x1e86db[_0x2bbbe9[_0x88b6('0x2b')]]={'$like':'%'+_0xda34fc[_0x88b6('0x33')][_0x88b6('0x3f')]+'%'};return _0x1e86db;}})});}_0x5ec1e2=_[_0x88b6('0x40')]({},_0x5ec1e2,_0xda34fc[_0x88b6('0x42')]);var _0x701edc={'where':_0x5ec1e2[_0x88b6('0x3d')]};return db[_0x88b6('0x43')][_0x88b6('0x21')](_0x701edc)[_0x88b6('0x29')](function(_0x406e11){_0x565049['count']=_0x406e11;if(_0xda34fc[_0x88b6('0x33')][_0x88b6('0x44')]){_0x5ec1e2[_0x88b6('0x45')]=[{'all':!![]}];}return db[_0x88b6('0x43')][_0x88b6('0x46')](_0x5ec1e2);})['then'](function(_0x36c122){_0x565049[_0x88b6('0x47')]=_0x36c122;return _0x565049;})['then'](respondWithFilteredResult(_0x8f4bd4,_0x5ec1e2))[_0x88b6('0x48')](handleError(_0x8f4bd4,null));};exports['show']=function(_0x3fe9de,_0x23f035){var _0x28c69e={'raw':!![],'where':{'id':_0x3fe9de[_0x88b6('0x49')]['id']}},_0x4f3442={};_0x4f3442[_0x88b6('0x32')]=_['keys'](db[_0x88b6('0x43')][_0x88b6('0x2f')]);_0x4f3442[_0x88b6('0x33')]=_['keys'](_0x3fe9de[_0x88b6('0x33')]);_0x4f3442[_0x88b6('0x34')]=_['intersection'](_0x4f3442['model'],_0x4f3442[_0x88b6('0x33')]);_0x28c69e[_0x88b6('0x36')]=_[_0x88b6('0x35')](_0x4f3442[_0x88b6('0x32')],qs[_0x88b6('0x37')](_0x3fe9de['query'][_0x88b6('0x37')]));_0x28c69e[_0x88b6('0x36')]=_0x28c69e['attributes'][_0x88b6('0x38')]?_0x28c69e[_0x88b6('0x36')]:_0x4f3442[_0x88b6('0x32')];if(_0x3fe9de[_0x88b6('0x33')][_0x88b6('0x44')]){_0x28c69e['include']=[{'all':!![]}];}_0x28c69e=_[_0x88b6('0x40')]({},_0x28c69e,_0x3fe9de[_0x88b6('0x42')]);return db[_0x88b6('0x43')][_0x88b6('0x4a')](_0x28c69e)[_0x88b6('0x29')](handleEntityNotFound(_0x23f035,null))['then'](respondWithResult(_0x23f035,null))[_0x88b6('0x48')](handleError(_0x23f035,null));};exports[_0x88b6('0x4b')]=function(_0x2290af,_0x48bffe){return db[_0x88b6('0x43')][_0x88b6('0x4b')](_0x2290af[_0x88b6('0x4c')],{})[_0x88b6('0x29')](respondWithResult(_0x48bffe,0xc9))[_0x88b6('0x48')](handleError(_0x48bffe,null));};exports[_0x88b6('0x27')]=function(_0x317b9b,_0x2caa4e){if(_0x317b9b[_0x88b6('0x4c')]['id']){delete _0x317b9b[_0x88b6('0x4c')]['id'];}return db['VoiceDialReport'][_0x88b6('0x4a')]({'where':{'id':_0x317b9b['params']['id']}})['then'](handleEntityNotFound(_0x2caa4e,null))['then'](saveUpdates(_0x317b9b[_0x88b6('0x4c')],null))[_0x88b6('0x29')](respondWithResult(_0x2caa4e,null))[_0x88b6('0x48')](handleError(_0x2caa4e,null));};exports[_0x88b6('0x28')]=function(_0x245499,_0x9f20fe){return db[_0x88b6('0x43')][_0x88b6('0x4a')]({'where':{'id':_0x245499['params']['id']}})[_0x88b6('0x29')](handleEntityNotFound(_0x9f20fe,null))['then'](removeEntity(_0x9f20fe,null))['catch'](handleError(_0x9f20fe,null));};exports['describe']=function(_0x4bd524,_0x5db290){return db['VoiceDialReport'][_0x88b6('0x4d')]()[_0x88b6('0x29')](respondWithResult(_0x5db290,null))['catch'](handleError(_0x5db290,null));};
\ No newline at end of file
+var _0xff97=['offset','undefined','limit','count','set','apply','reject','then','destroy','end','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','filters','pick','filter','where','merge','options','rows','catch','params','length','includeAll','find','create','body','update','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0xff97,0x73));var _0x7ff9=function(_0xd2e160,_0x3f3f48){_0xd2e160=_0xd2e160-0x0;var _0x557fb6=_0xff97[_0xd2e160];return _0x557fb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ff9('0x0'));var zipdir=require(_0x7ff9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ff9('0x2'));var moment=require('moment');var BPromise=require(_0x7ff9('0x3'));var Mustache=require(_0x7ff9('0x4'));var util=require(_0x7ff9('0x5'));var path=require(_0x7ff9('0x6'));var sox=require('sox');var csv=require(_0x7ff9('0x7'));var ejs=require(_0x7ff9('0x8'));var fs=require('fs');var fs_extra=require(_0x7ff9('0x9'));var _=require(_0x7ff9('0xa'));var squel=require(_0x7ff9('0xb'));var crypto=require(_0x7ff9('0xc'));var jsforce=require(_0x7ff9('0xd'));var deskjs=require(_0x7ff9('0xe'));var toCsv=require(_0x7ff9('0x7'));var querystring=require(_0x7ff9('0xf'));var Papa=require(_0x7ff9('0x10'));var Redis=require('ioredis');var authService=require(_0x7ff9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ff9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7ff9('0x13'));var config=require(_0x7ff9('0x14'));var licenseUtil=require(_0x7ff9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x485d81,_0x3eba60){_0x3eba60=_0x3eba60||0xcc;return function(_0x567887){if(_0x567887){return _0x485d81[_0x7ff9('0x16')](_0x3eba60);}return _0x485d81[_0x7ff9('0x17')](_0x3eba60)['end']();};}function respondWithResult(_0x16b067,_0x1f5ff2){_0x1f5ff2=_0x1f5ff2||0xc8;return function(_0x3433e1){if(_0x3433e1){return _0x16b067[_0x7ff9('0x17')](_0x1f5ff2)[_0x7ff9('0x18')](_0x3433e1);}};}function respondWithFilteredResult(_0x1888f8,_0x409fbb){return function(_0xdd2583){if(_0xdd2583){var _0x4b9fc0=typeof _0x409fbb[_0x7ff9('0x19')]===_0x7ff9('0x1a')&&typeof _0x409fbb[_0x7ff9('0x1b')]===_0x7ff9('0x1a');var _0x433e21=_0xdd2583[_0x7ff9('0x1c')];var _0x327952=_0x4b9fc0?0x0:_0x409fbb['offset'];var _0x5cc922=_0x4b9fc0?_0xdd2583[_0x7ff9('0x1c')]:_0x409fbb['offset']+_0x409fbb[_0x7ff9('0x1b')];var _0x5604f0;if(_0x5cc922>=_0x433e21){_0x5cc922=_0x433e21;_0x5604f0=0xc8;}else{_0x5604f0=0xce;}_0x1888f8[_0x7ff9('0x17')](_0x5604f0);return _0x1888f8[_0x7ff9('0x1d')]('Content-Range',_0x327952+'-'+_0x5cc922+'/'+_0x433e21)[_0x7ff9('0x18')](_0xdd2583);}return null;};}function patchUpdates(_0x5e9998){return function(_0x17f4df){try{jsonpatch[_0x7ff9('0x1e')](_0x17f4df,_0x5e9998,!![]);}catch(_0x39509e){return BPromise[_0x7ff9('0x1f')](_0x39509e);}return _0x17f4df['save']();};}function saveUpdates(_0x7e795b,_0x45d81b){return function(_0x4a6805){if(_0x4a6805){return _0x4a6805['update'](_0x7e795b)[_0x7ff9('0x20')](function(_0x19850d){return _0x19850d;});}return null;};}function removeEntity(_0x251809,_0x389931){return function(_0x37f78e){if(_0x37f78e){return _0x37f78e[_0x7ff9('0x21')]()['then'](function(){_0x251809['status'](0xcc)[_0x7ff9('0x22')]();});}};}function handleEntityNotFound(_0x44593c,_0x1e8531){return function(_0x57eb1f){if(!_0x57eb1f){_0x44593c[_0x7ff9('0x16')](0x194);}return _0x57eb1f;};}function handleError(_0x5a117d,_0x563db2){_0x563db2=_0x563db2||0x1f4;return function(_0x47fc09){logger[_0x7ff9('0x23')](_0x47fc09[_0x7ff9('0x24')]);if(_0x47fc09['name']){delete _0x47fc09[_0x7ff9('0x25')];}_0x5a117d[_0x7ff9('0x17')](_0x563db2)[_0x7ff9('0x26')](_0x47fc09);};}exports[_0x7ff9('0x27')]=function(_0x337652,_0x3e8efb){var _0x18a2b9={},_0xcdcf1={},_0x3711c4={'count':0x0,'rows':[]};var _0x25fd2d=_[_0x7ff9('0x28')](db[_0x7ff9('0x29')][_0x7ff9('0x2a')],function(_0x1242bf){return{'name':_0x1242bf[_0x7ff9('0x2b')],'type':_0x1242bf[_0x7ff9('0x2c')][_0x7ff9('0x2d')]};});_0xcdcf1[_0x7ff9('0x2e')]=_[_0x7ff9('0x28')](_0x25fd2d,'name');_0xcdcf1[_0x7ff9('0x2f')]=_[_0x7ff9('0x30')](_0x337652[_0x7ff9('0x2f')]);_0xcdcf1['filters']=_['intersection'](_0xcdcf1['model'],_0xcdcf1['query']);_0x18a2b9[_0x7ff9('0x31')]=_[_0x7ff9('0x32')](_0xcdcf1[_0x7ff9('0x2e')],qs[_0x7ff9('0x33')](_0x337652['query'][_0x7ff9('0x33')]));_0x18a2b9[_0x7ff9('0x31')]=_0x18a2b9[_0x7ff9('0x31')]['length']?_0x18a2b9[_0x7ff9('0x31')]:_0xcdcf1['model'];if(!_0x337652[_0x7ff9('0x2f')][_0x7ff9('0x34')]('nolimit')){_0x18a2b9[_0x7ff9('0x1b')]=qs[_0x7ff9('0x1b')](_0x337652[_0x7ff9('0x2f')][_0x7ff9('0x1b')]);_0x18a2b9[_0x7ff9('0x19')]=qs[_0x7ff9('0x19')](_0x337652['query'][_0x7ff9('0x19')]);}_0x18a2b9['order']=qs[_0x7ff9('0x35')](_0x337652['query']['sort']);_0x18a2b9['where']=qs[_0x7ff9('0x36')](_[_0x7ff9('0x37')](_0x337652[_0x7ff9('0x2f')],_0xcdcf1[_0x7ff9('0x36')]),_0x25fd2d);if(_0x337652['query'][_0x7ff9('0x38')]){_0x18a2b9[_0x7ff9('0x39')]=_[_0x7ff9('0x3a')](_0x18a2b9['where'],{'$or':_[_0x7ff9('0x28')](_0x25fd2d,function(_0x456395){if(_0x456395['type']!=='VIRTUAL'){var _0x4f651f={};_0x4f651f[_0x456395[_0x7ff9('0x25')]]={'$like':'%'+_0x337652[_0x7ff9('0x2f')][_0x7ff9('0x38')]+'%'};return _0x4f651f;}})});}_0x18a2b9=_[_0x7ff9('0x3a')]({},_0x18a2b9,_0x337652[_0x7ff9('0x3b')]);var _0x3c2b8e={'where':_0x18a2b9[_0x7ff9('0x39')]};return db[_0x7ff9('0x29')]['count'](_0x3c2b8e)[_0x7ff9('0x20')](function(_0x2a16d0){_0x3711c4[_0x7ff9('0x1c')]=_0x2a16d0;if(_0x337652[_0x7ff9('0x2f')]['includeAll']){_0x18a2b9['include']=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x18a2b9);})[_0x7ff9('0x20')](function(_0x27ee36){_0x3711c4[_0x7ff9('0x3c')]=_0x27ee36;return _0x3711c4;})[_0x7ff9('0x20')](respondWithFilteredResult(_0x3e8efb,_0x18a2b9))[_0x7ff9('0x3d')](handleError(_0x3e8efb,null));};exports['show']=function(_0x11219d,_0x31c5be){var _0x3d76ae={'raw':!![],'where':{'id':_0x11219d[_0x7ff9('0x3e')]['id']}},_0xb7218={};_0xb7218[_0x7ff9('0x2e')]=_[_0x7ff9('0x30')](db['VoiceDialReport'][_0x7ff9('0x2a')]);_0xb7218[_0x7ff9('0x2f')]=_['keys'](_0x11219d[_0x7ff9('0x2f')]);_0xb7218[_0x7ff9('0x36')]=_[_0x7ff9('0x32')](_0xb7218[_0x7ff9('0x2e')],_0xb7218[_0x7ff9('0x2f')]);_0x3d76ae[_0x7ff9('0x31')]=_['intersection'](_0xb7218[_0x7ff9('0x2e')],qs[_0x7ff9('0x33')](_0x11219d[_0x7ff9('0x2f')]['fields']));_0x3d76ae[_0x7ff9('0x31')]=_0x3d76ae[_0x7ff9('0x31')][_0x7ff9('0x3f')]?_0x3d76ae[_0x7ff9('0x31')]:_0xb7218[_0x7ff9('0x2e')];if(_0x11219d[_0x7ff9('0x2f')][_0x7ff9('0x40')]){_0x3d76ae['include']=[{'all':!![]}];}_0x3d76ae=_['merge']({},_0x3d76ae,_0x11219d[_0x7ff9('0x3b')]);return db[_0x7ff9('0x29')][_0x7ff9('0x41')](_0x3d76ae)[_0x7ff9('0x20')](handleEntityNotFound(_0x31c5be,null))[_0x7ff9('0x20')](respondWithResult(_0x31c5be,null))[_0x7ff9('0x3d')](handleError(_0x31c5be,null));};exports[_0x7ff9('0x42')]=function(_0x36c04f,_0x4c801e){return db['VoiceDialReport'][_0x7ff9('0x42')](_0x36c04f[_0x7ff9('0x43')],{})['then'](respondWithResult(_0x4c801e,0xc9))['catch'](handleError(_0x4c801e,null));};exports[_0x7ff9('0x44')]=function(_0x42d442,_0x215c4c){if(_0x42d442[_0x7ff9('0x43')]['id']){delete _0x42d442[_0x7ff9('0x43')]['id'];}return db['VoiceDialReport'][_0x7ff9('0x41')]({'where':{'id':_0x42d442[_0x7ff9('0x3e')]['id']}})[_0x7ff9('0x20')](handleEntityNotFound(_0x215c4c,null))[_0x7ff9('0x20')](saveUpdates(_0x42d442[_0x7ff9('0x43')],null))[_0x7ff9('0x20')](respondWithResult(_0x215c4c,null))[_0x7ff9('0x3d')](handleError(_0x215c4c,null));};exports[_0x7ff9('0x21')]=function(_0x4be436,_0x348f22){return db['VoiceDialReport'][_0x7ff9('0x41')]({'where':{'id':_0x4be436[_0x7ff9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x348f22,null))['then'](removeEntity(_0x348f22,null))[_0x7ff9('0x3d')](handleError(_0x348f22,null));};exports[_0x7ff9('0x45')]=function(_0x519b33,_0x361447){return db[_0x7ff9('0x29')][_0x7ff9('0x45')]()['then'](respondWithResult(_0x361447,null))['catch'](handleError(_0x361447,null));};
\ No newline at end of file
index d95df85..6857a28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb066=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','util','../../config/logger','bluebird','request-promise','path'];(function(_0x354e2d,_0xa627af){var _0x465475=function(_0x245135){while(--_0x245135){_0x354e2d['push'](_0x354e2d['shift']());}};_0x465475(++_0xa627af);}(_0xb066,0x1c9));var _0x6b06=function(_0x4bc5c1,_0x328ea5){_0x4bc5c1=_0x4bc5c1-0x0;var _0x4f94a9=_0xb066[_0x4bc5c1];return _0x4f94a9;};'use strict';var _=require('lodash');var util=require(_0x6b06('0x0'));var logger=require(_0x6b06('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6b06('0x2'));var rp=require(_0x6b06('0x3'));var fs=require('fs');var path=require(_0x6b06('0x4'));var rimraf=require(_0x6b06('0x5'));var config=require(_0x6b06('0x6'));var attributes=require(_0x6b06('0x7'));module[_0x6b06('0x8')]=function(_0xa85096,_0x1e303d){return _0xa85096[_0x6b06('0x9')]('VoiceDialReport',attributes,{'tableName':_0x6b06('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd85=['util','../../config/logger','api','bluebird','path','rimraf','./voiceDialReport.attributes','exports','define','report_dial'];(function(_0xc1fcfb,_0x23ef7c){var _0x17acdb=function(_0x5ed6ed){while(--_0x5ed6ed){_0xc1fcfb['push'](_0xc1fcfb['shift']());}};_0x17acdb(++_0x23ef7c);}(_0xbd85,0x1f4));var _0x5bd8=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xbd85[_0x1b6311];return _0x25aab6;};'use strict';var _=require('lodash');var util=require(_0x5bd8('0x0'));var logger=require(_0x5bd8('0x1'))(_0x5bd8('0x2'));var moment=require('moment');var BPromise=require(_0x5bd8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bd8('0x4'));var rimraf=require(_0x5bd8('0x5'));var config=require('../../config/environment');var attributes=require(_0x5bd8('0x6'));module[_0x5bd8('0x7')]=function(_0x991c18,_0x7a809d){return _0x991c18[_0x5bd8('0x8')]('VoiceDialReport',attributes,{'tableName':_0x5bd8('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index f41a2ab..d927b7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63be=['request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0x63be,0x1ae));var _0xe63b=function(_0x150535,_0x793677){_0x150535=_0x150535-0x0;var _0x170189=_0x63be[_0x150535];return _0x170189;};'use strict';var _=require(_0xe63b('0x0'));var util=require('util');var moment=require(_0xe63b('0x1'));var BPromise=require(_0xe63b('0x2'));var rs=require(_0xe63b('0x3'));var fs=require('fs');var Redis=require(_0xe63b('0x4'));var db=require(_0xe63b('0x5'))['db'];var utils=require(_0xe63b('0x6'));var logger=require(_0xe63b('0x7'))(_0xe63b('0x8'));var config=require(_0xe63b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe63b('0xa')][_0xe63b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e4992,_0x3ab7e1,_0x79be89){return new BPromise(function(_0xd8c865,_0x1e7781){return client[_0xe63b('0xc')](_0x4e4992,_0x79be89)[_0xe63b('0xd')](function(_0x87bdf3){logger['info'](_0xe63b('0xe'),_0x3ab7e1,_0xe63b('0xf'));logger[_0xe63b('0x10')](_0xe63b('0x11'),_0x3ab7e1,_0xe63b('0xf'),JSON[_0xe63b('0x12')](_0x87bdf3));if(_0x87bdf3[_0xe63b('0x13')]){if(_0x87bdf3['error'][_0xe63b('0x14')]===0x1f4){logger[_0xe63b('0x13')](_0xe63b('0xe'),_0x3ab7e1,_0x87bdf3['error'][_0xe63b('0x15')]);return _0x1e7781(_0x87bdf3[_0xe63b('0x13')]['message']);}logger[_0xe63b('0x13')](_0xe63b('0xe'),_0x3ab7e1,_0x87bdf3[_0xe63b('0x13')][_0xe63b('0x15')]);return _0xd8c865(_0x87bdf3['error'][_0xe63b('0x15')]);}else{logger[_0xe63b('0x16')](_0xe63b('0xe'),_0x3ab7e1,_0xe63b('0xf'));_0xd8c865(_0x87bdf3[_0xe63b('0x17')]['message']);}})[_0xe63b('0x18')](function(_0x396e8e){logger[_0xe63b('0x13')](_0xe63b('0xe'),_0x3ab7e1,_0x396e8e);_0x1e7781(_0x396e8e);});});}exports[_0xe63b('0x19')]=function(_0x4b22fb){var _0x23c1ce=this;return new Promise(function(_0x2b1b26,_0x52ebe2){return db[_0xe63b('0x1a')][_0xe63b('0x1b')](_0x4b22fb[_0xe63b('0x1c')],{'raw':_0x4b22fb['options']?_0x4b22fb[_0xe63b('0x1d')][_0xe63b('0x1e')]===undefined?!![]:![]:!![]})[_0xe63b('0xd')](function(_0x208e46){logger[_0xe63b('0x16')](_0xe63b('0x19'),_0x4b22fb);logger['debug'](_0xe63b('0x19'),_0x4b22fb,JSON['stringify'](_0x208e46));_0x2b1b26(_0x208e46);})[_0xe63b('0x18')](function(_0x4dca45){logger['error'](_0xe63b('0x19'),_0x4dca45['message'],_0x4b22fb);_0x52ebe2(_0x23c1ce[_0xe63b('0x13')](0x1f4,_0x4dca45[_0xe63b('0x15')]));});});};exports[_0xe63b('0x1f')]=function(_0x445246){var _0x1a519d=this;return new Promise(function(_0x3d830e,_0x4ffb25){return db[_0xe63b('0x1a')][_0xe63b('0x20')](_0x445246[_0xe63b('0x1c')],{'raw':_0x445246['options']?_0x445246['options'][_0xe63b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x445246['options']?_0x445246[_0xe63b('0x1d')]['where']||null:null,'attributes':_0x445246['options']?_0x445246['options']['attributes']||null:null,'limit':_0x445246[_0xe63b('0x1d')]?_0x445246[_0xe63b('0x1d')][_0xe63b('0x21')]||null:null})[_0xe63b('0xd')](function(_0x519f57){logger[_0xe63b('0x16')](_0xe63b('0x1f'),_0x445246);logger[_0xe63b('0x10')](_0xe63b('0x1f'),_0x445246,JSON['stringify'](_0x519f57));_0x3d830e(_0x519f57);})[_0xe63b('0x18')](function(_0x3a8115){logger[_0xe63b('0x13')](_0xe63b('0x1f'),_0x3a8115[_0xe63b('0x15')],_0x445246);_0x4ffb25(_0x1a519d[_0xe63b('0x13')](0x1f4,_0x3a8115['message']));});});};
\ No newline at end of file
+var _0xb178=['raw','where','limit','UpdateVoiceDialReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','then','update'];(function(_0x1b34d1,_0x1d7bab){var _0x3a5449=function(_0x182023){while(--_0x182023){_0x1b34d1['push'](_0x1b34d1['shift']());}};_0x3a5449(++_0x1d7bab);}(_0xb178,0xd6));var _0x8b17=function(_0x35b76f,_0x324c48){_0x35b76f=_0x35b76f-0x0;var _0x582906=_0xb178[_0x35b76f];return _0x582906;};'use strict';var _=require(_0x8b17('0x0'));var util=require('util');var moment=require(_0x8b17('0x1'));var BPromise=require(_0x8b17('0x2'));var rs=require(_0x8b17('0x3'));var fs=require('fs');var Redis=require(_0x8b17('0x4'));var db=require(_0x8b17('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8b17('0x6'));var config=require('../../config/environment');var jayson=require(_0x8b17('0x7'));var client=jayson['client'][_0x8b17('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x210327,_0x245e59,_0x21f69e){return new BPromise(function(_0x20381c,_0x1d5220){return client['request'](_0x210327,_0x21f69e)['then'](function(_0x35db7c){logger[_0x8b17('0x9')](_0x8b17('0xa'),_0x245e59,_0x8b17('0xb'));logger[_0x8b17('0xc')](_0x8b17('0xd'),_0x245e59,_0x8b17('0xb'),JSON[_0x8b17('0xe')](_0x35db7c));if(_0x35db7c[_0x8b17('0xf')]){if(_0x35db7c[_0x8b17('0xf')][_0x8b17('0x10')]===0x1f4){logger['error'](_0x8b17('0xa'),_0x245e59,_0x35db7c[_0x8b17('0xf')]['message']);return _0x1d5220(_0x35db7c['error'][_0x8b17('0x11')]);}logger[_0x8b17('0xf')](_0x8b17('0xa'),_0x245e59,_0x35db7c[_0x8b17('0xf')]['message']);return _0x20381c(_0x35db7c[_0x8b17('0xf')][_0x8b17('0x11')]);}else{logger[_0x8b17('0x9')](_0x8b17('0xa'),_0x245e59,_0x8b17('0xb'));_0x20381c(_0x35db7c[_0x8b17('0x12')][_0x8b17('0x11')]);}})[_0x8b17('0x13')](function(_0x35340c){logger['error'](_0x8b17('0xa'),_0x245e59,_0x35340c);_0x1d5220(_0x35340c);});});}exports[_0x8b17('0x14')]=function(_0x2f8377){var _0x100457=this;return new Promise(function(_0x2550b2,_0x28f5bf){return db[_0x8b17('0x15')]['create'](_0x2f8377[_0x8b17('0x16')],{'raw':_0x2f8377[_0x8b17('0x17')]?_0x2f8377['options']['raw']===undefined?!![]:![]:!![]})[_0x8b17('0x18')](function(_0x287a5e){logger[_0x8b17('0x9')](_0x8b17('0x14'),_0x2f8377);logger[_0x8b17('0xc')](_0x8b17('0x14'),_0x2f8377,JSON[_0x8b17('0xe')](_0x287a5e));_0x2550b2(_0x287a5e);})[_0x8b17('0x13')](function(_0x265b2b){logger[_0x8b17('0xf')](_0x8b17('0x14'),_0x265b2b['message'],_0x2f8377);_0x28f5bf(_0x100457['error'](0x1f4,_0x265b2b[_0x8b17('0x11')]));});});};exports['UpdateVoiceDialReport']=function(_0x5955a5){var _0x88effe=this;return new Promise(function(_0xfc391d,_0x2d86d2){return db[_0x8b17('0x15')][_0x8b17('0x19')](_0x5955a5[_0x8b17('0x16')],{'raw':_0x5955a5[_0x8b17('0x17')]?_0x5955a5[_0x8b17('0x17')][_0x8b17('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5955a5[_0x8b17('0x17')]?_0x5955a5[_0x8b17('0x17')][_0x8b17('0x1b')]||null:null,'attributes':_0x5955a5[_0x8b17('0x17')]?_0x5955a5[_0x8b17('0x17')]['attributes']||null:null,'limit':_0x5955a5[_0x8b17('0x17')]?_0x5955a5[_0x8b17('0x17')][_0x8b17('0x1c')]||null:null})[_0x8b17('0x18')](function(_0x4b2275){logger[_0x8b17('0x9')](_0x8b17('0x1d'),_0x5955a5);logger[_0x8b17('0xc')](_0x8b17('0x1d'),_0x5955a5,JSON[_0x8b17('0xe')](_0x4b2275));_0xfc391d(_0x4b2275);})[_0x8b17('0x13')](function(_0x355fc3){logger['error']('UpdateVoiceDialReport',_0x355fc3[_0x8b17('0x11')],_0x5955a5);_0x2d86d2(_0x88effe['error'](0x1f4,_0x355fc3[_0x8b17('0x11')]));});});};
\ No newline at end of file
index 4bc896c..a940898 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xada8=['post','/:id/applications','addApplications','update','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xada8,0x1f4));var _0x8ada=function(_0xdac6bc,_0x213c06){_0xdac6bc=_0xdac6bc-0x0;var _0x18feea=_0xada8[_0xdac6bc];return _0x18feea;};'use strict';var multer=require(_0x8ada('0x0'));var util=require(_0x8ada('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8ada('0x2'));var router=express[_0x8ada('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8ada('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8ada('0x5'));var controller=require(_0x8ada('0x6'));router[_0x8ada('0x7')]('/',auth[_0x8ada('0x8')](),controller[_0x8ada('0x9')]);router[_0x8ada('0x7')](_0x8ada('0xa'),auth[_0x8ada('0x8')](),controller[_0x8ada('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8ada('0xc')]);router[_0x8ada('0xd')](_0x8ada('0xe'),auth[_0x8ada('0x8')](),controller[_0x8ada('0xf')]);router['put'](_0x8ada('0xa'),auth[_0x8ada('0x8')](),controller[_0x8ada('0x10')]);router[_0x8ada('0x11')](_0x8ada('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x8ada('0x12')]=router;
\ No newline at end of file
+var _0x6885=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','destroy','exports','path'];(function(_0x442037,_0x582475){var _0x38aecb=function(_0x9b75e4){while(--_0x9b75e4){_0x442037['push'](_0x442037['shift']());}};_0x38aecb(++_0x582475);}(_0x6885,0xdb));var _0x5688=function(_0x152560,_0x230d98){_0x152560=_0x152560-0x0;var _0x59126e=_0x6885[_0x152560];return _0x59126e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5688('0x0'));var timeout=require(_0x5688('0x1'));var express=require(_0x5688('0x2'));var router=express[_0x5688('0x3')]();var fs_extra=require(_0x5688('0x4'));var auth=require(_0x5688('0x5'));var interaction=require(_0x5688('0x6'));var config=require(_0x5688('0x7'));var controller=require(_0x5688('0x8'));router[_0x5688('0x9')]('/',auth[_0x5688('0xa')](),controller[_0x5688('0xb')]);router[_0x5688('0x9')](_0x5688('0xc'),auth[_0x5688('0xa')](),controller[_0x5688('0xd')]);router[_0x5688('0xe')]('/',auth[_0x5688('0xa')](),controller[_0x5688('0xf')]);router['post'](_0x5688('0x10'),auth[_0x5688('0xa')](),controller[_0x5688('0x11')]);router[_0x5688('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5688('0x13')]);router['delete']('/:id',auth[_0x5688('0xa')](),controller[_0x5688('0x14')]);module[_0x5688('0x15')]=router;
\ No newline at end of file
index de93189..5726dfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccb0=['exten','exports','STRING','compositeIndex','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','wav','BOOLEAN','VIRTUAL','getDataValue'];(function(_0x151fcf,_0x2e0651){var _0x2be18=function(_0x1f77cc){while(--_0x1f77cc){_0x151fcf['push'](_0x151fcf['shift']());}};_0x2be18(++_0x2e0651);}(_0xccb0,0x121));var _0x0ccb=function(_0x5c8348,_0x41fc88){_0x5c8348=_0x5c8348-0x0;var _0x27de6f=_0xccb0[_0x5c8348];return _0x27de6f;};'use strict';var Sequelize=require('sequelize');module[_0x0ccb('0x0')]={'context':{'type':Sequelize[_0x0ccb('0x1')],'allowNull':![],'unique':_0x0ccb('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0ccb('0x2')},'priority':{'type':Sequelize[_0x0ccb('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x0ccb('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0ccb('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0ccb('0x3')](_0x0ccb('0x4'),_0x0ccb('0x5'),'internal',_0x0ccb('0x6'),_0x0ccb('0x7'),_0x0ccb('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x0ccb('0x1')]},'interval':{'type':Sequelize[_0x0ccb('0x1')],'allowNull':![],'defaultValue':_0x0ccb('0x9')},'IntervalId':{'type':Sequelize[_0x0ccb('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0ccb('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0ccb('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0ccb('0xa')]},'recordingFormat':{'type':Sequelize[_0x0ccb('0x1')],'defaultValue':_0x0ccb('0xb')},'answer':{'type':Sequelize[_0x0ccb('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0ccb('0xd')],'get':function(_0x4ddd75){return this[_0x0ccb('0xe')](_0x0ccb('0xf'));}},'alias':{'type':Sequelize[_0x0ccb('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x9167=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any'];(function(_0x20c539,_0x3bbfc2){var _0x343ec1=function(_0x24d88f){while(--_0x24d88f){_0x20c539['push'](_0x20c539['shift']());}};_0x343ec1(++_0x3bbfc2);}(_0x9167,0xc4));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7916('0x0'));module[_0x7916('0x1')]={'context':{'type':Sequelize[_0x7916('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7916('0x3')},'priority':{'type':Sequelize[_0x7916('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7916('0x2')],'allowNull':![],'defaultValue':_0x7916('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7916('0x5')](_0x7916('0x6'),_0x7916('0x7'),_0x7916('0x8'),_0x7916('0x9'),_0x7916('0xa'),_0x7916('0xb'),_0x7916('0xc')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7916('0x2')],'allowNull':![],'defaultValue':_0x7916('0xd')},'IntervalId':{'type':Sequelize[_0x7916('0xe')]},'isApp':{'type':Sequelize[_0x7916('0xf')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7916('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7916('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x7916('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7916('0xe')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x7916('0xf')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7916('0x10')],'get':function(_0x5a037d){return this[_0x7916('0x11')](_0x7916('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 20469e4..0ab2f19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a47=['findAndCountAll','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','socket.io-emitter','./voiceExtension.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','find','type','UserProfileResource','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','include','VoiceExtension','rows','params','keys','includeAll','catch','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','VoiceExtensionId','isApp','createRouting'];(function(_0x2d4b66,_0xe2eeb1){var _0x43f8c9=function(_0x1426c9){while(--_0x1426c9){_0x2d4b66['push'](_0x2d4b66['shift']());}};_0x43f8c9(++_0xe2eeb1);}(_0x4a47,0xb5));var _0x74a4=function(_0x35268e,_0x4acfd1){_0x35268e=_0x35268e-0x0;var _0x28ba11=_0x4a47[_0x35268e];return _0x28ba11;};'use strict';var _=require(_0x74a4('0x0'));var Redis=require(_0x74a4('0x1'));var qs=require(_0x74a4('0x2'));var logger=require(_0x74a4('0x3'))(_0x74a4('0x4'));var config=require('../../config/environment');var db=require(_0x74a4('0x5'))['db'];config['redis']=_[_0x74a4('0x6')](config[_0x74a4('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x74a4('0x8'))(new Redis(config[_0x74a4('0x7')]));require(_0x74a4('0x9'))['register'](socket);function respondWithStatusCode(_0x41ef5a,_0x55e8a1){_0x55e8a1=_0x55e8a1||0xcc;return function(_0x3122ba){if(_0x3122ba){return _0x41ef5a['sendStatus'](_0x55e8a1);}return _0x41ef5a[_0x74a4('0xa')](_0x55e8a1)[_0x74a4('0xb')]();};}function respondWithResult(_0x19f82b,_0x17c01f){_0x17c01f=_0x17c01f||0xc8;return function(_0x56a17a){if(_0x56a17a){return _0x19f82b[_0x74a4('0xa')](_0x17c01f)[_0x74a4('0xc')](_0x56a17a);}};}function respondWithFilteredResult(_0x316f53,_0x3fca30){return function(_0x526bd7){if(_0x526bd7){var _0x379351=typeof _0x3fca30[_0x74a4('0xd')]===_0x74a4('0xe')&&typeof _0x3fca30['limit']==='undefined';var _0x43ffb8=_0x526bd7[_0x74a4('0xf')];var _0x46d788=_0x379351?0x0:_0x3fca30[_0x74a4('0xd')];var _0x37d92f=_0x379351?_0x526bd7[_0x74a4('0xf')]:_0x3fca30[_0x74a4('0xd')]+_0x3fca30[_0x74a4('0x10')];var _0x39e2b4;if(_0x37d92f>=_0x43ffb8){_0x37d92f=_0x43ffb8;_0x39e2b4=0xc8;}else{_0x39e2b4=0xce;}_0x316f53[_0x74a4('0xa')](_0x39e2b4);return _0x316f53[_0x74a4('0x11')](_0x74a4('0x12'),_0x46d788+'-'+_0x37d92f+'/'+_0x43ffb8)[_0x74a4('0xc')](_0x526bd7);}return null;};}function removeEntity(_0x3c9fc9){return function(_0x3d9b8c){if(_0x3d9b8c){return _0x3d9b8c[_0x74a4('0x13')]()['then'](function(){var _0x1f6338=_0x3d9b8c[_0x74a4('0x14')]({'plain':!![]});var _0x327562=[{'name':_0x74a4('0x15'),'value':'inbound','ignore':![]},{'name':_0x74a4('0x16'),'value':_0x74a4('0x17'),'ignore':![]},{'name':_0x74a4('0x18'),'value':_0x74a4('0x19'),'ignore':![]}];var _0x49bfd7=_(_0x327562)[_0x74a4('0x1a')](_0x74a4('0x1b'))['map'](_0x74a4('0x1c'))[_0x74a4('0x1c')]();if(_['includes'](_0x49bfd7,_0x1f6338['type'])){return;}var _0x1da998=_[_0x74a4('0x1d')](_0x327562,[_0x74a4('0x1c'),_0x1f6338[_0x74a4('0x1e')]])['name'];return db[_0x74a4('0x1f')]['destroy']({'where':{'type':_0x1da998,'resourceId':_0x1f6338['id']}})['then'](function(){return _0x3d9b8c;});})[_0x74a4('0x20')](function(){_0x3c9fc9[_0x74a4('0xa')](0xcc)[_0x74a4('0xb')]();});}};}function handleEntityNotFound(_0x5c3362){return function(_0x22f0fa){if(!_0x22f0fa){_0x5c3362[_0x74a4('0x21')](0x194);}return _0x22f0fa;};}function handleError(_0x47c200,_0x1179f0){_0x1179f0=_0x1179f0||0x1f4;return function(_0x258a42){logger['error'](_0x258a42[_0x74a4('0x22')]);if(_0x258a42[_0x74a4('0x23')]){delete _0x258a42[_0x74a4('0x23')];}_0x47c200['status'](_0x1179f0)[_0x74a4('0x24')](_0x258a42);};}exports[_0x74a4('0x25')]=function(_0x1510fd,_0x18f30a){var _0xe933f6={},_0x1703be={},_0x5a0cb5={'count':0x0,'rows':[]};var _0x52df4d=_[_0x74a4('0x26')](db['VoiceExtension'][_0x74a4('0x27')],function(_0x4a4a3d){return{'name':_0x4a4a3d[_0x74a4('0x28')],'type':_0x4a4a3d['type']['key']};});_0x1703be[_0x74a4('0x29')]=_[_0x74a4('0x26')](_0x52df4d,_0x74a4('0x23'));_0x1703be['query']=_['keys'](_0x1510fd['query']);_0x1703be['filters']=_['intersection'](_0x1703be['model'],_0x1703be[_0x74a4('0x2a')]);_0xe933f6['attributes']=_[_0x74a4('0x2b')](_0x1703be[_0x74a4('0x29')],qs[_0x74a4('0x2c')](_0x1510fd['query'][_0x74a4('0x2c')]));_0xe933f6[_0x74a4('0x2d')]=_0xe933f6[_0x74a4('0x2d')][_0x74a4('0x2e')]?_0xe933f6[_0x74a4('0x2d')]:_0x1703be[_0x74a4('0x29')];if(!_0x1510fd[_0x74a4('0x2a')][_0x74a4('0x2f')]('nolimit')){_0xe933f6[_0x74a4('0x10')]=qs[_0x74a4('0x10')](_0x1510fd['query'][_0x74a4('0x10')]);_0xe933f6['offset']=qs['offset'](_0x1510fd[_0x74a4('0x2a')][_0x74a4('0xd')]);}_0xe933f6[_0x74a4('0x30')]=qs[_0x74a4('0x31')](_0x1510fd[_0x74a4('0x2a')][_0x74a4('0x31')]);_0xe933f6[_0x74a4('0x32')]=qs[_0x74a4('0x33')](_[_0x74a4('0x34')](_0x1510fd['query'],_0x1703be[_0x74a4('0x33')]),_0x52df4d);if(_0x1510fd[_0x74a4('0x2a')][_0x74a4('0x1a')]){_0xe933f6[_0x74a4('0x32')]=_[_0x74a4('0x35')](_0xe933f6['where'],{'$or':_[_0x74a4('0x26')](_0x52df4d,function(_0x211492){if(_0x211492['type']!==_0x74a4('0x36')){var _0x43f44d={};_0x43f44d[_0x211492[_0x74a4('0x23')]]={'$like':'%'+_0x1510fd[_0x74a4('0x2a')][_0x74a4('0x1a')]+'%'};return _0x43f44d;}})});}_0xe933f6=_[_0x74a4('0x35')]({},_0xe933f6,_0x1510fd['options']);var _0x46dcc2={'where':_0xe933f6[_0x74a4('0x32')]};return db['VoiceExtension'][_0x74a4('0xf')](_0x46dcc2)[_0x74a4('0x20')](function(_0x1e9bad){_0x5a0cb5[_0x74a4('0xf')]=_0x1e9bad;if(_0x1510fd[_0x74a4('0x2a')]['includeAll']){_0xe933f6[_0x74a4('0x37')]=[{'all':!![]}];}return db[_0x74a4('0x38')]['findAll'](_0xe933f6);})[_0x74a4('0x20')](function(_0x204955){_0x5a0cb5[_0x74a4('0x39')]=_0x204955;return _0x5a0cb5;})[_0x74a4('0x20')](respondWithFilteredResult(_0x18f30a,_0xe933f6))['catch'](handleError(_0x18f30a,null));};exports['show']=function(_0x450296,_0x58e56b){var _0x4bfa7a={'raw':![],'where':{'id':_0x450296[_0x74a4('0x3a')]['id']}},_0x2aec0c={};_0x2aec0c[_0x74a4('0x29')]=_['keys'](db[_0x74a4('0x38')][_0x74a4('0x27')]);_0x2aec0c['query']=_[_0x74a4('0x3b')](_0x450296[_0x74a4('0x2a')]);_0x2aec0c[_0x74a4('0x33')]=_[_0x74a4('0x2b')](_0x2aec0c['model'],_0x2aec0c[_0x74a4('0x2a')]);_0x4bfa7a[_0x74a4('0x2d')]=_['intersection'](_0x2aec0c[_0x74a4('0x29')],qs[_0x74a4('0x2c')](_0x450296[_0x74a4('0x2a')][_0x74a4('0x2c')]));_0x4bfa7a[_0x74a4('0x2d')]=_0x4bfa7a[_0x74a4('0x2d')][_0x74a4('0x2e')]?_0x4bfa7a[_0x74a4('0x2d')]:_0x2aec0c[_0x74a4('0x29')];if(_0x450296[_0x74a4('0x2a')][_0x74a4('0x3c')]){_0x4bfa7a['include']=[{'all':!![]}];}_0x4bfa7a=_[_0x74a4('0x35')]({},_0x4bfa7a,_0x450296['options']);return db[_0x74a4('0x38')][_0x74a4('0x1d')](_0x4bfa7a)[_0x74a4('0x20')](handleEntityNotFound(_0x58e56b,null))['then'](respondWithResult(_0x58e56b,null))[_0x74a4('0x3d')](handleError(_0x58e56b,null));};exports[_0x74a4('0x13')]=function(_0x5ad270,_0x1b64a9){return db[_0x74a4('0x38')][_0x74a4('0x1d')]({'where':{'id':_0x5ad270[_0x74a4('0x3a')]['id']}})[_0x74a4('0x20')](handleEntityNotFound(_0x1b64a9,null))['then'](removeEntity(_0x1b64a9,null))['catch'](handleError(_0x1b64a9,null));};exports['create']=function(_0x91e5db,_0x10111a){if(_0x91e5db[_0x74a4('0x3e')]['type']===_0x74a4('0x17')&&!_[_0x74a4('0x3f')](_0x91e5db[_0x74a4('0x3e')][_0x74a4('0x40')],'_')){_0x91e5db['body'][_0x74a4('0x40')]='_'[_0x74a4('0x41')](_0x91e5db['body']['exten']);}return db[_0x74a4('0x38')][_0x74a4('0x42')](_0x91e5db['body'],{'raw':![]})[_0x74a4('0x20')](function(_0x44df66){var _0x4feab2=_0x91e5db[_0x74a4('0x43')][_0x74a4('0x14')]({'plain':!![]});if(!_0x4feab2)throw new Error(_0x74a4('0x44'));if(_0x4feab2[_0x74a4('0x45')]===_0x74a4('0x43')){var _0x4578dd=_0x44df66[_0x74a4('0x14')]({'plain':!![]});var _0x466993=[{'name':_0x74a4('0x15'),'value':_0x74a4('0x46')},{'name':_0x74a4('0x16'),'value':_0x74a4('0x17')},{'name':_0x74a4('0x18'),'value':_0x74a4('0x19')}];var _0x5d3ead=_[_0x74a4('0x1d')](_0x466993,['value',_0x4578dd[_0x74a4('0x1e')]])[_0x74a4('0x23')];return db[_0x74a4('0x47')][_0x74a4('0x1d')]({'where':{'name':_0x5d3ead,'userProfileId':_0x4feab2[_0x74a4('0x48')]},'raw':!![]})[_0x74a4('0x20')](function(_0x316402){if(_0x316402&&_0x316402[_0x74a4('0x49')]===0x0){return db['UserProfileResource'][_0x74a4('0x42')]({'name':_0x4578dd[_0x74a4('0x23')],'resourceId':_0x4578dd['id'],'type':_0x316402['name'],'sectionId':_0x316402['id']},{})[_0x74a4('0x20')](function(){return _0x44df66;});}else{return _0x44df66;}})['catch'](function(_0x3c3c46){logger[_0x74a4('0x4a')](_0x74a4('0x4b'),_0x3c3c46);throw _0x3c3c46;});}return _0x44df66;})[_0x74a4('0x20')](respondWithResult(_0x10111a,0xc9))[_0x74a4('0x3d')](handleError(_0x10111a,null));};exports[_0x74a4('0x4c')]=function(_0x387571,_0x597857){if(_0x387571[_0x74a4('0x3e')]['id']){delete _0x387571[_0x74a4('0x3e')]['id'];}return db[_0x74a4('0x38')][_0x74a4('0x1d')]({'where':{'id':_0x387571[_0x74a4('0x3a')]['id']}})['then'](handleEntityNotFound(_0x597857,null))['then'](function(_0x5c4115){if(_0x5c4115){return db['VoiceExtension'][_0x74a4('0x4c')](_[_0x74a4('0x34')](_0x387571[_0x74a4('0x3e')],[_0x74a4('0x40'),_0x74a4('0x4d'),_0x74a4('0x4e'),_0x74a4('0x4f'),_0x74a4('0x50'),_0x74a4('0x51'),_0x74a4('0x52')]),{'where':{'context':_0x5c4115[_0x74a4('0x4d')],'exten':_0x5c4115[_0x74a4('0x40')]},'individualHooks':!![]})[_0x74a4('0x20')](function(_0xc27550){return _0xc27550;});}return null;})['then'](respondWithStatusCode(_0x597857,null))[_0x74a4('0x3d')](handleError(_0x597857,null));};exports[_0x74a4('0x53')]=function(_0x4977f1,_0x52f5fb){return db[_0x74a4('0x38')]['findOne']({'where':{'id':_0x4977f1[_0x74a4('0x3a')]['id']}})[_0x74a4('0x20')](function(_0x41d5db){if(_0x41d5db){return db[_0x74a4('0x54')][_0x74a4('0x55')](function(_0x568f5d){return db['VoiceExtension'][_0x74a4('0x13')]({'where':{'VoiceExtensionId':_0x4977f1['params']['id']},'transaction':_0x568f5d})[_0x74a4('0x20')](function(){var _0x57ffbe=_[_0x74a4('0x26')](_0x4977f1[_0x74a4('0x3e')],function(_0x316f26){_0x316f26[_0x74a4('0x56')]=_0x4977f1[_0x74a4('0x3a')]['id'];_0x316f26[_0x74a4('0x57')]=!![];return _0x316f26;});return _0x41d5db[_0x74a4('0x58')](_0x57ffbe);})[_0x74a4('0x20')](function(_0x54b89b){console['log']('LOG\x20~\x20.then\x20~\x20routing',_0x54b89b);return db['VoiceExtension']['bulkCreate'](_0x54b89b,{'transaction':_0x568f5d});});})['then'](function(){return db[_0x74a4('0x38')][_0x74a4('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4977f1[_0x74a4('0x3a')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x74a4('0x20')](respondWithResult(_0x52f5fb,null))[_0x74a4('0x3d')](handleError(_0x52f5fb,null));};
\ No newline at end of file
+var _0xa396=['defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','json','offset','undefined','count','set','Content-Range','destroy','then','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','map','value','includes','find','type','name','sendStatus','error','stack','send','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','VIRTUAL','options','VoiceExtension','include','findAll','rows','catch','show','params','includeAll','merge','create','startsWith','body','exten','get','role','user','InternalRoutes','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','alias','addApplications','findOne','transaction','VoiceExtensionId','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','api','../../mysqldb','redis'];(function(_0x51897a,_0x4f77fb){var _0x236bc5=function(_0x593cc7){while(--_0x593cc7){_0x51897a['push'](_0x51897a['shift']());}};_0x236bc5(++_0x4f77fb);}(_0xa396,0xaa));var _0x6a39=function(_0x32c219,_0x3859e3){_0x32c219=_0x32c219-0x0;var _0x542d54=_0xa396[_0x32c219];return _0x542d54;};'use strict';var _=require(_0x6a39('0x0'));var Redis=require(_0x6a39('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x6a39('0x2'))(_0x6a39('0x3'));var config=require('../../config/environment');var db=require(_0x6a39('0x4'))['db'];config[_0x6a39('0x5')]=_[_0x6a39('0x6')](config[_0x6a39('0x5')],{'host':_0x6a39('0x7'),'port':0x18eb});var socket=require(_0x6a39('0x8'))(new Redis(config[_0x6a39('0x5')]));require(_0x6a39('0x9'))[_0x6a39('0xa')](socket);function respondWithStatusCode(_0x29249c,_0x4c9f8b){_0x4c9f8b=_0x4c9f8b||0xcc;return function(_0x4dad0c){if(_0x4dad0c){return _0x29249c['sendStatus'](_0x4c9f8b);}return _0x29249c[_0x6a39('0xb')](_0x4c9f8b)['end']();};}function respondWithResult(_0x38dfc3,_0x55ba02){_0x55ba02=_0x55ba02||0xc8;return function(_0x240ee1){if(_0x240ee1){return _0x38dfc3[_0x6a39('0xb')](_0x55ba02)[_0x6a39('0xc')](_0x240ee1);}};}function respondWithFilteredResult(_0x3573f4,_0x25a490){return function(_0x5b15a6){if(_0x5b15a6){var _0xa3d980=typeof _0x25a490[_0x6a39('0xd')]===_0x6a39('0xe')&&typeof _0x25a490['limit']===_0x6a39('0xe');var _0xc1a409=_0x5b15a6[_0x6a39('0xf')];var _0x5c24eb=_0xa3d980?0x0:_0x25a490[_0x6a39('0xd')];var _0xc7aabf=_0xa3d980?_0x5b15a6[_0x6a39('0xf')]:_0x25a490[_0x6a39('0xd')]+_0x25a490['limit'];var _0x5ca881;if(_0xc7aabf>=_0xc1a409){_0xc7aabf=_0xc1a409;_0x5ca881=0xc8;}else{_0x5ca881=0xce;}_0x3573f4[_0x6a39('0xb')](_0x5ca881);return _0x3573f4[_0x6a39('0x10')](_0x6a39('0x11'),_0x5c24eb+'-'+_0xc7aabf+'/'+_0xc1a409)[_0x6a39('0xc')](_0x5b15a6);}return null;};}function removeEntity(_0x7858e6){return function(_0x5679a3){if(_0x5679a3){return _0x5679a3[_0x6a39('0x12')]()[_0x6a39('0x13')](function(){var _0xfd9cfe=_0x5679a3['get']({'plain':!![]});var _0x2fd778=[{'name':_0x6a39('0x14'),'value':_0x6a39('0x15'),'ignore':![]},{'name':_0x6a39('0x16'),'value':_0x6a39('0x17'),'ignore':![]},{'name':'InternalRoutes','value':_0x6a39('0x18'),'ignore':![]}];var _0x2d9814=_(_0x2fd778)[_0x6a39('0x19')]('ignore')[_0x6a39('0x1a')](_0x6a39('0x1b'))[_0x6a39('0x1b')]();if(_[_0x6a39('0x1c')](_0x2d9814,_0xfd9cfe['type'])){return;}var _0x178ec5=_[_0x6a39('0x1d')](_0x2fd778,[_0x6a39('0x1b'),_0xfd9cfe[_0x6a39('0x1e')]])[_0x6a39('0x1f')];return db['UserProfileResource'][_0x6a39('0x12')]({'where':{'type':_0x178ec5,'resourceId':_0xfd9cfe['id']}})[_0x6a39('0x13')](function(){return _0x5679a3;});})[_0x6a39('0x13')](function(){_0x7858e6[_0x6a39('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf8e8c6){return function(_0x2bdd43){if(!_0x2bdd43){_0xf8e8c6[_0x6a39('0x20')](0x194);}return _0x2bdd43;};}function handleError(_0x547b71,_0x2ee905){_0x2ee905=_0x2ee905||0x1f4;return function(_0x54cdc5){logger[_0x6a39('0x21')](_0x54cdc5[_0x6a39('0x22')]);if(_0x54cdc5[_0x6a39('0x1f')]){delete _0x54cdc5[_0x6a39('0x1f')];}_0x547b71['status'](_0x2ee905)[_0x6a39('0x23')](_0x54cdc5);};}exports['index']=function(_0x4fa917,_0x1ed95e){var _0xb0970f={},_0x21c536={},_0x88f576={'count':0x0,'rows':[]};var _0x368c31=_['map'](db['VoiceExtension'][_0x6a39('0x24')],function(_0x42a04c){return{'name':_0x42a04c[_0x6a39('0x25')],'type':_0x42a04c[_0x6a39('0x1e')][_0x6a39('0x26')]};});_0x21c536[_0x6a39('0x27')]=_[_0x6a39('0x1a')](_0x368c31,_0x6a39('0x1f'));_0x21c536[_0x6a39('0x28')]=_[_0x6a39('0x29')](_0x4fa917[_0x6a39('0x28')]);_0x21c536[_0x6a39('0x2a')]=_[_0x6a39('0x2b')](_0x21c536['model'],_0x21c536[_0x6a39('0x28')]);_0xb0970f['attributes']=_['intersection'](_0x21c536[_0x6a39('0x27')],qs[_0x6a39('0x2c')](_0x4fa917['query'][_0x6a39('0x2c')]));_0xb0970f['attributes']=_0xb0970f[_0x6a39('0x2d')][_0x6a39('0x2e')]?_0xb0970f[_0x6a39('0x2d')]:_0x21c536['model'];if(!_0x4fa917[_0x6a39('0x28')][_0x6a39('0x2f')](_0x6a39('0x30'))){_0xb0970f[_0x6a39('0x31')]=qs[_0x6a39('0x31')](_0x4fa917[_0x6a39('0x28')][_0x6a39('0x31')]);_0xb0970f[_0x6a39('0xd')]=qs[_0x6a39('0xd')](_0x4fa917[_0x6a39('0x28')][_0x6a39('0xd')]);}_0xb0970f[_0x6a39('0x32')]=qs[_0x6a39('0x33')](_0x4fa917[_0x6a39('0x28')][_0x6a39('0x33')]);_0xb0970f['where']=qs[_0x6a39('0x2a')](_[_0x6a39('0x34')](_0x4fa917[_0x6a39('0x28')],_0x21c536[_0x6a39('0x2a')]),_0x368c31);if(_0x4fa917[_0x6a39('0x28')][_0x6a39('0x19')]){_0xb0970f['where']=_['merge'](_0xb0970f['where'],{'$or':_[_0x6a39('0x1a')](_0x368c31,function(_0x5e054f){if(_0x5e054f[_0x6a39('0x1e')]!==_0x6a39('0x35')){var _0x5a0e69={};_0x5a0e69[_0x5e054f[_0x6a39('0x1f')]]={'$like':'%'+_0x4fa917[_0x6a39('0x28')][_0x6a39('0x19')]+'%'};return _0x5a0e69;}})});}_0xb0970f=_['merge']({},_0xb0970f,_0x4fa917[_0x6a39('0x36')]);var _0x447675={'where':_0xb0970f['where']};return db[_0x6a39('0x37')]['count'](_0x447675)[_0x6a39('0x13')](function(_0x26dbf6){_0x88f576[_0x6a39('0xf')]=_0x26dbf6;if(_0x4fa917['query']['includeAll']){_0xb0970f[_0x6a39('0x38')]=[{'all':!![]}];}return db[_0x6a39('0x37')][_0x6a39('0x39')](_0xb0970f);})['then'](function(_0x31c51a){_0x88f576[_0x6a39('0x3a')]=_0x31c51a;return _0x88f576;})['then'](respondWithFilteredResult(_0x1ed95e,_0xb0970f))[_0x6a39('0x3b')](handleError(_0x1ed95e,null));};exports[_0x6a39('0x3c')]=function(_0x30bf23,_0x434ecb){var _0x405bb8={'raw':![],'where':{'id':_0x30bf23[_0x6a39('0x3d')]['id']}},_0x3c0514={};_0x3c0514[_0x6a39('0x27')]=_[_0x6a39('0x29')](db[_0x6a39('0x37')][_0x6a39('0x24')]);_0x3c0514['query']=_[_0x6a39('0x29')](_0x30bf23['query']);_0x3c0514[_0x6a39('0x2a')]=_[_0x6a39('0x2b')](_0x3c0514[_0x6a39('0x27')],_0x3c0514[_0x6a39('0x28')]);_0x405bb8['attributes']=_[_0x6a39('0x2b')](_0x3c0514[_0x6a39('0x27')],qs['fields'](_0x30bf23['query'][_0x6a39('0x2c')]));_0x405bb8[_0x6a39('0x2d')]=_0x405bb8[_0x6a39('0x2d')][_0x6a39('0x2e')]?_0x405bb8[_0x6a39('0x2d')]:_0x3c0514['model'];if(_0x30bf23['query'][_0x6a39('0x3e')]){_0x405bb8[_0x6a39('0x38')]=[{'all':!![]}];}_0x405bb8=_[_0x6a39('0x3f')]({},_0x405bb8,_0x30bf23['options']);return db['VoiceExtension'][_0x6a39('0x1d')](_0x405bb8)[_0x6a39('0x13')](handleEntityNotFound(_0x434ecb,null))['then'](respondWithResult(_0x434ecb,null))[_0x6a39('0x3b')](handleError(_0x434ecb,null));};exports[_0x6a39('0x12')]=function(_0x3be58f,_0xaaa8e5){return db[_0x6a39('0x37')][_0x6a39('0x1d')]({'where':{'id':_0x3be58f['params']['id']}})[_0x6a39('0x13')](handleEntityNotFound(_0xaaa8e5,null))[_0x6a39('0x13')](removeEntity(_0xaaa8e5,null))[_0x6a39('0x3b')](handleError(_0xaaa8e5,null));};exports[_0x6a39('0x40')]=function(_0x4e3d20,_0x289fd8){if(_0x4e3d20['body']['type']==='outbound'&&!_[_0x6a39('0x41')](_0x4e3d20[_0x6a39('0x42')][_0x6a39('0x43')],'_')){_0x4e3d20[_0x6a39('0x42')]['exten']='_'['concat'](_0x4e3d20['body'][_0x6a39('0x43')]);}return db[_0x6a39('0x37')][_0x6a39('0x40')](_0x4e3d20['body'],{'raw':![]})['then'](function(_0x41ff57){var _0x52e69c=_0x4e3d20['user'][_0x6a39('0x44')]({'plain':!![]});if(!_0x52e69c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52e69c[_0x6a39('0x45')]===_0x6a39('0x46')){var _0x5c2f11=_0x41ff57[_0x6a39('0x44')]({'plain':!![]});var _0x1c3618=[{'name':_0x6a39('0x14'),'value':_0x6a39('0x15')},{'name':'OutboundRoutes','value':_0x6a39('0x17')},{'name':_0x6a39('0x47'),'value':_0x6a39('0x18')}];var _0x5b27e0=_[_0x6a39('0x1d')](_0x1c3618,[_0x6a39('0x1b'),_0x5c2f11[_0x6a39('0x1e')]])[_0x6a39('0x1f')];return db[_0x6a39('0x48')][_0x6a39('0x1d')]({'where':{'name':_0x5b27e0,'userProfileId':_0x52e69c[_0x6a39('0x49')]},'raw':!![]})[_0x6a39('0x13')](function(_0x161dd6){if(_0x161dd6&&_0x161dd6['autoAssociation']===0x0){return db[_0x6a39('0x4a')]['create']({'name':_0x5c2f11[_0x6a39('0x1f')],'resourceId':_0x5c2f11['id'],'type':_0x161dd6['name'],'sectionId':_0x161dd6['id']},{})['then'](function(){return _0x41ff57;});}else{return _0x41ff57;}})[_0x6a39('0x3b')](function(_0x4d52e7){logger[_0x6a39('0x21')](_0x6a39('0x4b'),_0x4d52e7);throw _0x4d52e7;});}return _0x41ff57;})[_0x6a39('0x13')](respondWithResult(_0x289fd8,0xc9))[_0x6a39('0x3b')](handleError(_0x289fd8,null));};exports['update']=function(_0x5a8525,_0x428789){if(_0x5a8525[_0x6a39('0x42')]['id']){delete _0x5a8525[_0x6a39('0x42')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x5a8525['params']['id']}})[_0x6a39('0x13')](handleEntityNotFound(_0x428789,null))[_0x6a39('0x13')](function(_0x25cb2a){if(_0x25cb2a){return db['VoiceExtension'][_0x6a39('0x4c')](_[_0x6a39('0x34')](_0x5a8525[_0x6a39('0x42')],['exten',_0x6a39('0x4d'),_0x6a39('0x4e'),'recordingFormat',_0x6a39('0x4f'),'mandatoryDisposition',_0x6a39('0x50')]),{'where':{'context':_0x25cb2a[_0x6a39('0x4d')],'exten':_0x25cb2a[_0x6a39('0x43')]},'individualHooks':!![]})['then'](function(_0x52c80f){return _0x52c80f;});}return null;})['then'](respondWithStatusCode(_0x428789,null))[_0x6a39('0x3b')](handleError(_0x428789,null));};exports[_0x6a39('0x51')]=function(_0x2b265e,_0x498400){return db[_0x6a39('0x37')][_0x6a39('0x52')]({'where':{'id':_0x2b265e[_0x6a39('0x3d')]['id']}})[_0x6a39('0x13')](function(_0x539eae){if(_0x539eae){return db['sequelize'][_0x6a39('0x53')](function(_0x7411ca){return db[_0x6a39('0x37')][_0x6a39('0x12')]({'where':{'VoiceExtensionId':_0x2b265e[_0x6a39('0x3d')]['id']},'transaction':_0x7411ca})['then'](function(){var _0x242cc9=_['map'](_0x2b265e[_0x6a39('0x42')],function(_0x19bc63){_0x19bc63[_0x6a39('0x54')]=_0x2b265e[_0x6a39('0x3d')]['id'];_0x19bc63['isApp']=!![];return _0x19bc63;});return _0x539eae['createRouting'](_0x242cc9);})[_0x6a39('0x13')](function(_0x10f31e){console['log'](_0x6a39('0x55'),_0x10f31e);return db[_0x6a39('0x37')][_0x6a39('0x56')](_0x10f31e,{'transaction':_0x7411ca});});})[_0x6a39('0x13')](function(){return db[_0x6a39('0x37')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x2b265e['params']['id']},'order':_0x6a39('0x57')});});}})[_0x6a39('0x13')](respondWithResult(_0x498400,null))[_0x6a39('0x3b')](handleError(_0x498400,null));};
\ No newline at end of file
index 79afd13..369af7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ba2=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x4cfe05,_0x31d187){var _0x3a7ac3=function(_0x404daf){while(--_0x404daf){_0x4cfe05['push'](_0x4cfe05['shift']());}};_0x3a7ac3(++_0x31d187);}(_0x5ba2,0xcf));var _0x25ba=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x5ba2[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require(_0x25ba('0x0'));var VoiceExtension=require(_0x25ba('0x1'))['db'][_0x25ba('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x25ba('0x3')](0x0);var events={'afterCreate':_0x25ba('0x4'),'afterUpdate':'update','afterDestroy':_0x25ba('0x5')};function emitEvent(_0x3015f5){return function(_0x23552d,_0xc6a04,_0x3eefae){VoiceExtensionEvents[_0x25ba('0x6')](_0x3015f5+':'+_0x23552d['id'],_0x23552d);VoiceExtensionEvents[_0x25ba('0x6')](_0x3015f5,_0x23552d);_0x3eefae(null);};}for(var e in events){if(events[_0x25ba('0x7')](e)){var event=events[e];VoiceExtension[_0x25ba('0x8')](e,emitEvent(event));}}module[_0x25ba('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x0ee1=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x15e634,_0x28558e){var _0x4d5d95=function(_0x5c3a6f){while(--_0x5c3a6f){_0x15e634['push'](_0x15e634['shift']());}};_0x4d5d95(++_0x28558e);}(_0x0ee1,0x1da));var _0x10ee=function(_0x6fbc80,_0x355ace){_0x6fbc80=_0x6fbc80-0x0;var _0x57c2ff=_0x0ee1[_0x6fbc80];return _0x57c2ff;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x10ee('0x0'))['db'][_0x10ee('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x10ee('0x2')](0x0);var events={'afterCreate':_0x10ee('0x3'),'afterUpdate':'update','afterDestroy':_0x10ee('0x4')};function emitEvent(_0x45ea26){return function(_0x4d7d92,_0x32598d,_0x31e063){VoiceExtensionEvents[_0x10ee('0x5')](_0x45ea26+':'+_0x4d7d92['id'],_0x4d7d92);VoiceExtensionEvents[_0x10ee('0x5')](_0x45ea26,_0x4d7d92);_0x31e063(null);};}for(var e in events){if(events[_0x10ee('0x6')](e)){var event=events[e];VoiceExtension[_0x10ee('0x7')](e,emitEvent(event));}}module[_0x10ee('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
index f3f239b..7749292 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cf4=['url','split','length','name','param','prefix','phone','SIP','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','then','intervals','IntervalId','map','toLowerCase','tag','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','voice_extensions','get','lodash','type','Set','CDR(type)=','context','exten','NoOp','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cf4,0xbf));var _0x41cf=function(_0x63a798,_0x158ea9){_0x63a798=_0x63a798-0x0;var _0x34d5f2=_0x1cf4[_0x63a798];return _0x34d5f2;};'use strict';var _=require(_0x41cf('0x0'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x2f4577){var _0x2cb80b=_0x2f4577['models'];function _0x9eb159(_0x2308e9){var _0x446a26=0x2;var _0x32902d=[{'type':_0x2308e9[_0x41cf('0x1')],'app':_0x41cf('0x2'),'appdata':_0x41cf('0x3')+_0x2308e9[_0x41cf('0x1')],'context':_0x2308e9[_0x41cf('0x4')],'exten':_0x2308e9[_0x41cf('0x5')],'priority':_0x446a26++,'VoiceExtensionId':_0x2308e9['id']},{'type':_0x2308e9[_0x41cf('0x1')],'app':_0x2308e9['alias']?_0x41cf('0x2'):_0x41cf('0x6'),'appdata':_0x2308e9[_0x41cf('0x7')]?'CDR(routeAlias)='+_0x2308e9[_0x41cf('0x7')]:_0x41cf('0x8'),'context':_0x2308e9[_0x41cf('0x4')],'exten':_0x2308e9[_0x41cf('0x5')],'priority':_0x446a26++,'VoiceExtensionId':_0x2308e9['id']}];if(_0x2308e9[_0x41cf('0x1')]===_0x41cf('0x9')){_0x32902d[_0x41cf('0xa')]({'type':_0x41cf('0x9'),'app':_0x41cf('0x2'),'appdata':_0x41cf('0xb')+_0x2308e9['id'],'context':_0x2308e9[_0x41cf('0x4')],'exten':_0x2308e9[_0x41cf('0x5')],'priority':_0x446a26++,'VoiceExtensionId':_0x2308e9['id']});}_0x32902d[_0x41cf('0xa')]({'type':_0x2308e9['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2308e9[_0x41cf('0x4')],'exten':_0x2308e9['exten'],'priority':_0x446a26++,'VoiceExtensionId':_0x2308e9['id']},{'type':_0x2308e9[_0x41cf('0x1')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2308e9[_0x41cf('0x4')],'exten':_0x2308e9['exten'],'priority':_0x446a26++,'VoiceExtensionId':_0x2308e9['id']},{'type':_0x2308e9[_0x41cf('0x1')],'app':_0x41cf('0x2'),'appdata':_0x41cf('0xc'),'context':_0x2308e9['context'],'exten':_0x2308e9[_0x41cf('0x5')],'priority':_0x446a26++,'VoiceExtensionId':_0x2308e9['id']});return _0x32902d;}function _0x23962d(_0x58a8a2){var _0x3b121b=0x2;var _0x17e6f9=[{'type':'outbound','app':'Set','appdata':'CDR(type)=outbound','context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':_0x41cf('0xd'),'app':_0x58a8a2[_0x41cf('0x7')]?'Set':_0x41cf('0x6'),'appdata':_0x58a8a2[_0x41cf('0x7')]?_0x41cf('0xe')+_0x58a8a2['alias']:_0x41cf('0x8'),'context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':_0x41cf('0xd'),'app':'Set','appdata':_0x41cf('0xf')+(_0x58a8a2[_0x41cf('0x10')]?_0x41cf('0x11')+_0x58a8a2[_0x41cf('0x10')]+'}':_0x41cf('0x12')),'context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':'outbound','app':'Set','appdata':_0x41cf('0xb')+_0x58a8a2['id'],'context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':'outbound','app':_0x41cf('0x13'),'appdata':_0x41cf('0x14')+(_0x3b121b+0x2)+'):Goto('+(_0x3b121b+0x1)+')','context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':'outbound','app':_0x41cf('0x2'),'appdata':_0x58a8a2[_0x41cf('0x10')]?_0x41cf('0x15')+_0x58a8a2['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2['exten'],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':_0x41cf('0xd'),'app':_0x41cf('0x2'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x58a8a2['context'],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':_0x41cf('0xd'),'app':_0x41cf('0x2'),'appdata':_0x41cf('0x16'),'context':_0x58a8a2['context'],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':'outbound','app':_0x41cf('0x2'),'appdata':'MONITOR_OPTIONS=ab','context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':_0x41cf('0xd'),'app':_0x41cf('0x2'),'appdata':_0x41cf('0x17')+_0x58a8a2['id'],'context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']}];if(_0x58a8a2[_0x41cf('0x18')](_0x41cf('0x19'))&&_0x58a8a2[_0x41cf('0x19')]!==_0x41cf('0x1a')){_0x17e6f9[_0x41cf('0xa')]({'type':_0x41cf('0xd'),'app':_0x41cf('0x2'),'appdata':_0x41cf('0x1b'),'context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']},{'type':_0x41cf('0xd'),'app':'Set','appdata':_0x41cf('0x1c')+_0x58a8a2['recordingFormat']||'wav','context':_0x58a8a2[_0x41cf('0x4')],'exten':_0x58a8a2[_0x41cf('0x5')],'priority':_0x3b121b++,'VoiceExtensionId':_0x58a8a2['id']});}return _0x17e6f9;}function _0x27a4fc(_0x4f7591,_0x4a887b){var _0x15dd98=[{'name':_0x41cf('0x1d'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x41cf('0x1e'),'param':0x2},{'name':_0x41cf('0x1f'),'param':0x3}];var _0xd161b7={};var _0x77ccf5=_0x4a887b[_0x41cf('0x20')](',');var _0x54fb11=[];for(var _0x35e3b7=0x0;_0x35e3b7<_0x15dd98[_0x41cf('0x21')];_0x35e3b7++){switch(_0x15dd98[_0x35e3b7][_0x41cf('0x22')]){case'trunk':_0xd161b7[_0x41cf('0x1d')]=_0x77ccf5[_0x15dd98[_0x35e3b7][_0x41cf('0x23')]][_0x41cf('0x20')]('/')[0x1];_0xd161b7['phone']=_0x77ccf5[_0x15dd98[_0x35e3b7][_0x41cf('0x23')]][_0x41cf('0x20')]('/')[0x2];_0xd161b7[_0x41cf('0x24')]=_0xd161b7['phone']?_0xd161b7['phone'][_0x41cf('0x20')]('$')[0x0]:undefined;_0xd161b7[_0x41cf('0x25')]=_0x4f7591['cutdigits']?(_0xd161b7[_0x41cf('0x24')]||'')+_0x41cf('0x11')+_0x4f7591[_0x41cf('0x10')]+'}':(_0xd161b7[_0x41cf('0x24')]||'')+_0x41cf('0x12');_0x54fb11[_0x15dd98[_0x35e3b7]['param']]=[_0x41cf('0x26'),_0xd161b7[_0x41cf('0x1d')],_0xd161b7[_0x41cf('0x25')]]['join']('/');break;case'options':_0xd161b7['options']=_0x77ccf5[_0x15dd98[_0x35e3b7][_0x41cf('0x23')]];if(_0x4f7591[_0x41cf('0x19')]!==_0x41cf('0x1a')){if(_0xd161b7[_0x41cf('0x1e')][_0x41cf('0x27')](_0x41cf('0x28'))<0x0){_0xd161b7['options']+='U(xcally-mixmonitor-context)';}}else{_0xd161b7['options']=_0xd161b7[_0x41cf('0x1e')][_0x41cf('0x29')]('U(xcally-mixmonitor-context)','');}_0x54fb11[_0x15dd98[_0x35e3b7][_0x41cf('0x23')]]=_0xd161b7[_0x41cf('0x1e')];break;default:_0x54fb11[_0x15dd98[_0x35e3b7][_0x41cf('0x23')]]=_0x77ccf5[_0x15dd98[_0x35e3b7][_0x41cf('0x23')]];}}return _0x54fb11['join'](',');}function _0x17275d(_0x580ab7,_0x239d0a,_0x239ba9){return new Promise(function(_0x3d6f13,_0x2cc075){var _0x3d6042=[];if(_['isEmpty'](_0x239d0a))return _0x3d6f13(_0x3d6042);_0x2cb80b[_0x41cf('0x2a')][_0x41cf('0x2b')]({'attributes':['id',_0x41cf('0x2c'),'IntervalId'],'raw':!![]})[_0x41cf('0x2d')](function(_0x4ef147){for(var _0x136d5a=0x0,_0x1df384=0x0;_0x136d5a<_0x239d0a[_0x41cf('0x21')];_0x136d5a++,_0x1df384=0x0){var _0x3d389b=_0x239d0a[_0x136d5a];var _0x217592=[];var _0x4e2fbd=[];delete _0x3d389b['id'];if(_0x3d389b[_0x41cf('0x2c')]!=='*,*,*,*'){_0x3d389b[_0x41cf('0x2e')]=[_0x3d389b[_0x41cf('0x2c')]];}else{_0x3d389b['intervals']=_0x3d389b[_0x41cf('0x2f')]?_[_0x41cf('0x30')](_['filter'](_0x4ef147,{'IntervalId':_0x3d389b[_0x41cf('0x2f')]}),_0x41cf('0x2c')):[];}_0x3d389b[_0x41cf('0x4')]=_0x580ab7[_0x41cf('0x4')];_0x3d389b[_0x41cf('0x5')]=_0x580ab7[_0x41cf('0x5')];if(_0x3d389b[_0x41cf('0x1')])_0x3d389b[_0x41cf('0x1')]=_0x3d389b[_0x41cf('0x1')][_0x41cf('0x31')]();if(_0x580ab7[_0x41cf('0x1')]===_0x41cf('0xd')){if(_0x3d389b[_0x41cf('0x18')](_0x41cf('0x32'))&&_0x3d389b[_0x41cf('0x32')]&&_0x3d389b[_0x41cf('0x32')]!=='--'){_0x217592[_0x41cf('0xa')]({'type':_0x3d389b[_0x41cf('0x1')][_0x41cf('0x31')](),'app':_0x41cf('0x2'),'appdata':'CDR(tag)='+_0x3d389b[_0x41cf('0x32')],'context':_0x580ab7[_0x41cf('0x4')],'exten':_0x580ab7[_0x41cf('0x5')],'priority':_0x3d389b[_0x41cf('0x2e')][_0x41cf('0x21')]+_0x239ba9+_0x1df384++,'VoiceExtensionId':_0x580ab7['id']});}_0x217592['push']({'type':_0x3d389b['type'][_0x41cf('0x31')](),'app':_0x41cf('0x13'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3d389b['callerID']?'Set(CALLERID(all)='+_0x3d389b[_0x41cf('0x33')]+')':_0x41cf('0x34')),'context':_0x580ab7['context'],'exten':_0x580ab7[_0x41cf('0x5')],'priority':_0x3d389b['intervals']['length']+_0x239ba9+_0x1df384++,'VoiceExtensionId':_0x580ab7['id']});}else{if(_0x3d389b[_0x41cf('0x18')](_0x41cf('0x35'))){if([_0x41cf('0x36'),_0x41cf('0x37')][_0x41cf('0x38')](_0x3d389b['app'][_0x41cf('0x31')]())&&_0x3d389b[_0x41cf('0x39')]!==_0x41cf('0x3a')){if(_0x3d389b[_0x41cf('0x35')]){_0x217592[_0x41cf('0xa')]({'type':_0x3d389b['type'][_0x41cf('0x31')](),'app':_0x41cf('0x13'),'appdata':_0x41cf('0x3b'),'context':_0x580ab7[_0x41cf('0x4')],'exten':_0x580ab7[_0x41cf('0x5')],'priority':_0x3d389b[_0x41cf('0x2e')]['length']+_0x239ba9+_0x1df384++,'VoiceExtensionId':_0x580ab7['id']});_0x217592[_0x41cf('0xa')]({'type':_0x3d389b[_0x41cf('0x1')][_0x41cf('0x31')](),'app':'Set','appdata':_0x41cf('0x3c'),'context':_0x580ab7['context'],'exten':_0x580ab7['exten'],'priority':_0x3d389b['intervals']['length']+_0x239ba9+_0x1df384++,'VoiceExtensionId':_0x580ab7['id']});}else{_0x217592[_0x41cf('0xa')]({'type':_0x3d389b['type'][_0x41cf('0x31')](),'app':_0x41cf('0x13'),'appdata':_0x41cf('0x3d'),'context':_0x580ab7[_0x41cf('0x4')],'exten':_0x580ab7[_0x41cf('0x5')],'priority':_0x3d389b[_0x41cf('0x2e')][_0x41cf('0x21')]+_0x239ba9+_0x1df384++,'VoiceExtensionId':_0x580ab7['id']});_0x217592[_0x41cf('0xa')]({'type':_0x3d389b['type'][_0x41cf('0x31')](),'app':_0x41cf('0x2'),'appdata':_0x41cf('0x3e'),'context':_0x580ab7[_0x41cf('0x4')],'exten':_0x580ab7['exten'],'priority':_0x3d389b[_0x41cf('0x2e')][_0x41cf('0x21')]+_0x239ba9+_0x1df384++,'VoiceExtensionId':_0x580ab7['id']});}}}}for(var _0x4e69dd=0x0;_0x4e69dd<_0x3d389b[_0x41cf('0x2e')][_0x41cf('0x21')];_0x4e69dd++){var _0x452f67=_0x239ba9+_0x3d389b['intervals'][_0x41cf('0x21')];var _0x41c633=_0x4e69dd===_0x3d389b[_0x41cf('0x2e')][_0x41cf('0x21')]-0x1?_0x239ba9+_0x217592[_0x41cf('0x21')]+_0x4e2fbd[_0x41cf('0x21')]+0x2:_0x239ba9+_0x4e69dd+0x1;_0x217592[_0x41cf('0x3f')](_0x4e69dd,0x0,{'type':_0x580ab7[_0x41cf('0x1')],'app':_0x41cf('0x40'),'appdata':_0x3d389b['intervals'][_0x4e69dd]+'?'+_0x580ab7['context']+_0x41cf('0x41')+_0x452f67+':'+_0x580ab7[_0x41cf('0x4')]+',${EXTEN},'+_0x41c633,'exten':_0x580ab7[_0x41cf('0x5')],'context':_0x580ab7[_0x41cf('0x4')],'priority':_0x239ba9+_0x4e69dd,'VoiceExtensionId':_0x580ab7['id']});}if(_0x3d389b[_0x41cf('0x39')]===_0x41cf('0x42'))_0x3d389b[_0x41cf('0x43')]=_0x27a4fc(_0x580ab7,_0x3d389b['appdata']);_0x3d389b[_0x41cf('0x44')]=_0x217592[_0x41cf('0x21')]?_[_0x41cf('0x45')](_0x217592)['priority']+0x1:_0x239ba9;_0x3d6042=_[_0x41cf('0x46')](_0x3d6042,_0x217592,[_0x3d389b],_0x4e2fbd);_0x239ba9=_[_0x41cf('0x45')](_0x3d6042)[_0x41cf('0x44')]+0x1;}return _0x3d6f13(_0x3d6042);})[_0x41cf('0x47')](function(_0x4994b1){_0x2cc075(_0x4994b1);});});}return _0x2f4577['define']('VoiceExtension',attributes,{'tableName':_0x41cf('0x48'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x66789b){var _0x42394b=this[_0x41cf('0x49')]({'plain':!![]});var _0xa55866=_0x42394b['type']===_0x41cf('0xd')?_0x23962d(_0x42394b):_0x9eb159(_0x42394b);return _0x17275d(_0x42394b,_0x66789b,_[_0x41cf('0x45')](_0xa55866)[_0x41cf('0x44')]+0x1)[_0x41cf('0x2d')](function(_0x13000a){var _0x3f1b24=_['concat'](_0xa55866,_0x13000a);_0x3f1b24[_0x41cf('0xa')]({'type':_0x42394b['type'],'app':'Hangup','exten':_0x42394b[_0x41cf('0x5')],'context':_0x42394b[_0x41cf('0x4')],'priority':_['last'](_0x3f1b24)['priority']+0x1,'VoiceExtensionId':_0x42394b['id']});return _0x3f1b24;});}}});};
\ No newline at end of file
+var _0xf006=['catch','define','VoiceExtension','voice_extensions','then','Hangup','exports','models','type','Set','CDR(type)=','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','options','url','split','length','name','param','prefix','phone','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','findAll','interval','IntervalId','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','ExecIf','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','concat'];(function(_0x5834d1,_0x233219){var _0x3daeab=function(_0x20512e){while(--_0x20512e){_0x5834d1['push'](_0x5834d1['shift']());}};_0x3daeab(++_0x233219);}(_0xf006,0x146));var _0x6f00=function(_0x19d50f,_0x5e0451){_0x19d50f=_0x19d50f-0x0;var _0x7decd2=_0xf006[_0x19d50f];return _0x7decd2;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x6f00('0x0')]=function(_0x281499){var _0x5914f3=_0x281499[_0x6f00('0x1')];function _0x4e9dbc(_0x1c7a9e){var _0x4f4466=0x2;var _0x5039fb=[{'type':_0x1c7a9e[_0x6f00('0x2')],'app':_0x6f00('0x3'),'appdata':_0x6f00('0x4')+_0x1c7a9e['type'],'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e['exten'],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']},{'type':_0x1c7a9e[_0x6f00('0x2')],'app':_0x1c7a9e[_0x6f00('0x6')]?_0x6f00('0x3'):_0x6f00('0x7'),'appdata':_0x1c7a9e[_0x6f00('0x6')]?_0x6f00('0x8')+_0x1c7a9e[_0x6f00('0x6')]:_0x6f00('0x9'),'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e[_0x6f00('0xa')],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']}];if(_0x1c7a9e[_0x6f00('0x2')]===_0x6f00('0xb')){_0x5039fb[_0x6f00('0xc')]({'type':'inbound','app':_0x6f00('0x3'),'appdata':_0x6f00('0xd')+_0x1c7a9e['id'],'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e[_0x6f00('0xa')],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']});}_0x5039fb[_0x6f00('0xc')]({'type':_0x1c7a9e['type'],'app':_0x6f00('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e['exten'],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']},{'type':_0x1c7a9e[_0x6f00('0x2')],'app':_0x6f00('0x3'),'appdata':_0x6f00('0xe'),'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e[_0x6f00('0xa')],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']},{'type':_0x1c7a9e[_0x6f00('0x2')],'app':_0x6f00('0x3'),'appdata':_0x6f00('0xf'),'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e['exten'],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']});return _0x5039fb;}function _0x14b15d(_0x5085f0){var _0x534275=0x2;var _0x7c047e=[{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':_0x6f00('0x11'),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x5085f0[_0x6f00('0x6')]?_0x6f00('0x3'):_0x6f00('0x7'),'appdata':_0x5085f0[_0x6f00('0x6')]?_0x6f00('0x8')+_0x5085f0['alias']:'No\x20alias\x20set','context':_0x5085f0['context'],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':'CDR(destination)='+(_0x5085f0[_0x6f00('0x12')]?_0x6f00('0x13')+_0x5085f0[_0x6f00('0x12')]+'}':_0x6f00('0x14')),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':'CDR(routeid)='+_0x5085f0['id'],'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':'ExecIf','appdata':_0x6f00('0x15')+(_0x534275+0x2)+'):Goto('+(_0x534275+0x1)+')','context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0['exten'],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':_0x5085f0[_0x6f00('0x12')]?_0x6f00('0x16')+_0x5085f0[_0x6f00('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':_0x6f00('0x17'),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':_0x6f00('0xe'),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5085f0['context'],'exten':_0x5085f0['exten'],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':'outbound','app':'Set','appdata':'outboundrouteid='+_0x5085f0['id'],'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0['exten'],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']}];if(_0x5085f0[_0x6f00('0x18')](_0x6f00('0x19'))&&_0x5085f0[_0x6f00('0x19')]!==_0x6f00('0x1a')){_0x7c047e[_0x6f00('0xc')]({'type':_0x6f00('0x10'),'app':'Set','appdata':_0x6f00('0x1b'),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5085f0['recordingFormat']||'wav','context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']});}return _0x7c047e;}function _0x456dab(_0x27ebb4,_0xbece){var _0x521e1e=[{'name':_0x6f00('0x1c'),'param':0x0},{'name':_0x6f00('0x1d'),'param':0x1},{'name':_0x6f00('0x1e'),'param':0x2},{'name':_0x6f00('0x1f'),'param':0x3}];var _0x3865ab={};var _0x493190=_0xbece[_0x6f00('0x20')](',');var _0x52936d=[];for(var _0x28e436=0x0;_0x28e436<_0x521e1e[_0x6f00('0x21')];_0x28e436++){switch(_0x521e1e[_0x28e436][_0x6f00('0x22')]){case'trunk':_0x3865ab[_0x6f00('0x1c')]=_0x493190[_0x521e1e[_0x28e436][_0x6f00('0x23')]][_0x6f00('0x20')]('/')[0x1];_0x3865ab['phone']=_0x493190[_0x521e1e[_0x28e436][_0x6f00('0x23')]]['split']('/')[0x2];_0x3865ab[_0x6f00('0x24')]=_0x3865ab['phone']?_0x3865ab[_0x6f00('0x25')][_0x6f00('0x20')]('$')[0x0]:undefined;_0x3865ab[_0x6f00('0x25')]=_0x27ebb4[_0x6f00('0x12')]?(_0x3865ab['prefix']||'')+_0x6f00('0x13')+_0x27ebb4['cutdigits']+'}':(_0x3865ab[_0x6f00('0x24')]||'')+'${EXTEN}';_0x52936d[_0x521e1e[_0x28e436][_0x6f00('0x23')]]=[_0x6f00('0x26'),_0x3865ab[_0x6f00('0x1c')],_0x3865ab[_0x6f00('0x25')]]['join']('/');break;case'options':_0x3865ab[_0x6f00('0x1e')]=_0x493190[_0x521e1e[_0x28e436]['param']];if(_0x27ebb4[_0x6f00('0x19')]!==_0x6f00('0x1a')){if(_0x3865ab['options'][_0x6f00('0x27')]('U(xcally-mixmonitor-context)')<0x0){_0x3865ab['options']+=_0x6f00('0x28');}}else{_0x3865ab[_0x6f00('0x1e')]=_0x3865ab[_0x6f00('0x1e')][_0x6f00('0x29')]('U(xcally-mixmonitor-context)','');}_0x52936d[_0x521e1e[_0x28e436][_0x6f00('0x23')]]=_0x3865ab[_0x6f00('0x1e')];break;default:_0x52936d[_0x521e1e[_0x28e436][_0x6f00('0x23')]]=_0x493190[_0x521e1e[_0x28e436][_0x6f00('0x23')]];}}return _0x52936d[_0x6f00('0x2a')](',');}function _0x1059e9(_0x555082,_0x752ea3,_0x17257e){return new Promise(function(_0x8d4dde,_0x1c8b81){var _0x303a32=[];if(_[_0x6f00('0x2b')](_0x752ea3))return _0x8d4dde(_0x303a32);_0x5914f3['Interval'][_0x6f00('0x2c')]({'attributes':['id',_0x6f00('0x2d'),_0x6f00('0x2e')],'raw':!![]})['then'](function(_0x2e6cc6){for(var _0x4f1be9=0x0,_0x9e3308=0x0;_0x4f1be9<_0x752ea3[_0x6f00('0x21')];_0x4f1be9++,_0x9e3308=0x0){var _0x49de34=_0x752ea3[_0x4f1be9];var _0x107158=[];var _0x4d74e5=[];delete _0x49de34['id'];if(_0x49de34[_0x6f00('0x2d')]!==_0x6f00('0x2f')){_0x49de34[_0x6f00('0x30')]=[_0x49de34[_0x6f00('0x2d')]];}else{_0x49de34['intervals']=_0x49de34[_0x6f00('0x2e')]?_['map'](_[_0x6f00('0x31')](_0x2e6cc6,{'IntervalId':_0x49de34['IntervalId']}),_0x6f00('0x2d')):[];}_0x49de34[_0x6f00('0x5')]=_0x555082[_0x6f00('0x5')];_0x49de34[_0x6f00('0xa')]=_0x555082[_0x6f00('0xa')];if(_0x49de34[_0x6f00('0x2')])_0x49de34[_0x6f00('0x2')]=_0x49de34[_0x6f00('0x2')]['toLowerCase']();if(_0x555082[_0x6f00('0x2')]==='outbound'){if(_0x49de34[_0x6f00('0x18')](_0x6f00('0x32'))&&_0x49de34[_0x6f00('0x32')]&&_0x49de34['tag']!=='--'){_0x107158['push']({'type':_0x49de34[_0x6f00('0x2')][_0x6f00('0x33')](),'app':'Set','appdata':_0x6f00('0x34')+_0x49de34['tag'],'context':_0x555082[_0x6f00('0x5')],'exten':_0x555082['exten'],'priority':_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});}_0x107158['push']({'type':_0x49de34['type'][_0x6f00('0x33')](),'app':_0x6f00('0x35'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x49de34[_0x6f00('0x36')]?'Set(CALLERID(all)='+_0x49de34[_0x6f00('0x36')]+')':_0x6f00('0x37')),'context':_0x555082[_0x6f00('0x5')],'exten':_0x555082[_0x6f00('0xa')],'priority':_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});}else{if(_0x49de34[_0x6f00('0x18')](_0x6f00('0x38'))){if([_0x6f00('0x39'),_0x6f00('0x3a')][_0x6f00('0x3b')](_0x49de34[_0x6f00('0x3c')][_0x6f00('0x33')]())&&_0x49de34[_0x6f00('0x3d')]!==_0x6f00('0x3e')){if(_0x49de34[_0x6f00('0x38')]){_0x107158[_0x6f00('0xc')]({'type':_0x49de34[_0x6f00('0x2')][_0x6f00('0x33')](),'app':_0x6f00('0x35'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x555082['context'],'exten':_0x555082[_0x6f00('0xa')],'priority':_0x49de34['intervals'][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});_0x107158[_0x6f00('0xc')]({'type':_0x49de34['type'][_0x6f00('0x33')](),'app':_0x6f00('0x3'),'appdata':_0x6f00('0x3f'),'context':_0x555082['context'],'exten':_0x555082[_0x6f00('0xa')],'priority':_0x49de34['intervals'][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});}else{_0x107158[_0x6f00('0xc')]({'type':_0x49de34['type'][_0x6f00('0x33')](),'app':_0x6f00('0x35'),'appdata':_0x6f00('0x40'),'context':_0x555082[_0x6f00('0x5')],'exten':_0x555082[_0x6f00('0xa')],'priority':_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});_0x107158['push']({'type':_0x49de34['type']['toLowerCase'](),'app':'Set','appdata':_0x6f00('0x41'),'context':_0x555082[_0x6f00('0x5')],'exten':_0x555082['exten'],'priority':_0x49de34['intervals'][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});}}}}for(var _0x3e6d45=0x0;_0x3e6d45<_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')];_0x3e6d45++){var _0x53aed1=_0x17257e+_0x49de34[_0x6f00('0x30')]['length'];var _0x54530a=_0x3e6d45===_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')]-0x1?_0x17257e+_0x107158[_0x6f00('0x21')]+_0x4d74e5[_0x6f00('0x21')]+0x2:_0x17257e+_0x3e6d45+0x1;_0x107158[_0x6f00('0x42')](_0x3e6d45,0x0,{'type':_0x555082['type'],'app':_0x6f00('0x43'),'appdata':_0x49de34[_0x6f00('0x30')][_0x3e6d45]+'?'+_0x555082[_0x6f00('0x5')]+_0x6f00('0x44')+_0x53aed1+':'+_0x555082['context']+',${EXTEN},'+_0x54530a,'exten':_0x555082[_0x6f00('0xa')],'context':_0x555082['context'],'priority':_0x17257e+_0x3e6d45,'VoiceExtensionId':_0x555082['id']});}if(_0x49de34[_0x6f00('0x3d')]===_0x6f00('0x45'))_0x49de34[_0x6f00('0x46')]=_0x456dab(_0x555082,_0x49de34[_0x6f00('0x46')]);_0x49de34['priority']=_0x107158['length']?_[_0x6f00('0x47')](_0x107158)[_0x6f00('0x48')]+0x1:_0x17257e;_0x303a32=_[_0x6f00('0x49')](_0x303a32,_0x107158,[_0x49de34],_0x4d74e5);_0x17257e=_[_0x6f00('0x47')](_0x303a32)['priority']+0x1;}return _0x8d4dde(_0x303a32);})[_0x6f00('0x4a')](function(_0x37af94){_0x1c8b81(_0x37af94);});});}return _0x281499[_0x6f00('0x4b')](_0x6f00('0x4c'),attributes,{'tableName':_0x6f00('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5c7a47){var _0x4ac796=this['get']({'plain':!![]});var _0x1e4ae3=_0x4ac796[_0x6f00('0x2')]==='outbound'?_0x14b15d(_0x4ac796):_0x4e9dbc(_0x4ac796);return _0x1059e9(_0x4ac796,_0x5c7a47,_['last'](_0x1e4ae3)[_0x6f00('0x48')]+0x1)[_0x6f00('0x4e')](function(_0x5a1685){var _0x4c9286=_[_0x6f00('0x49')](_0x1e4ae3,_0x5a1685);_0x4c9286[_0x6f00('0xc')]({'type':_0x4ac796[_0x6f00('0x2')],'app':_0x6f00('0x4f'),'exten':_0x4ac796[_0x6f00('0xa')],'context':_0x4ac796[_0x6f00('0x5')],'priority':_[_0x6f00('0x47')](_0x4c9286)[_0x6f00('0x48')]+0x1,'VoiceExtensionId':_0x4ac796['id']});return _0x4c9286;});}}});};
\ No newline at end of file
index 031a2b6..459e7b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab86=['attributes','limit','include','map','model','stringify','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where'];(function(_0xc11a56,_0x379d5e){var _0x5938fc=function(_0x2bfd44){while(--_0x2bfd44){_0xc11a56['push'](_0xc11a56['shift']());}};_0x5938fc(++_0x379d5e);}(_0xab86,0x13e));var _0x6ab8=function(_0x888c1e,_0x386e0e){_0x888c1e=_0x888c1e-0x0;var _0x375229=_0xab86[_0x888c1e];return _0x375229;};'use strict';var _=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var moment=require(_0x6ab8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ab8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ab8('0x4'));var logger=require('../../config/logger')(_0x6ab8('0x5'));var config=require(_0x6ab8('0x6'));var jayson=require(_0x6ab8('0x7'));var client=jayson[_0x6ab8('0x8')][_0x6ab8('0x9')]({'port':0x232a});config[_0x6ab8('0xa')]=_[_0x6ab8('0xb')](config[_0x6ab8('0xa')],{'host':_0x6ab8('0xc'),'port':0x18eb});var socket=require(_0x6ab8('0xd'))(new Redis(config[_0x6ab8('0xa')]));require(_0x6ab8('0xe'))[_0x6ab8('0xf')](socket);function respondWithRpcPromise(_0x5127eb,_0x5ea6e6,_0x383594){return new BPromise(function(_0x5b7732,_0x18d3a3){return client[_0x6ab8('0x10')](_0x5127eb,_0x383594)[_0x6ab8('0x11')](function(_0x52d636){logger[_0x6ab8('0x12')](_0x6ab8('0x13'),_0x5ea6e6,'request\x20sent');logger[_0x6ab8('0x14')](_0x6ab8('0x15'),_0x5ea6e6,_0x6ab8('0x16'),JSON['stringify'](_0x52d636));if(_0x52d636[_0x6ab8('0x17')]){if(_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x18')]===0x1f4){logger[_0x6ab8('0x17')](_0x6ab8('0x13'),_0x5ea6e6,_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);return _0x18d3a3(_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);}logger['error'](_0x6ab8('0x13'),_0x5ea6e6,_0x52d636[_0x6ab8('0x17')][_0x6ab8('0x19')]);return _0x5b7732(_0x52d636['error'][_0x6ab8('0x19')]);}else{logger[_0x6ab8('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x5ea6e6,'request\x20sent');_0x5b7732(_0x52d636[_0x6ab8('0x1a')]['message']);}})[_0x6ab8('0x1b')](function(_0x292b36){logger[_0x6ab8('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x5ea6e6,_0x292b36);_0x18d3a3(_0x292b36);});});}exports[_0x6ab8('0x1c')]=function(_0x3de5b3){var _0x2d2a80=this;return new Promise(function(_0x312183,_0x5227c6){return db[_0x6ab8('0x1d')][_0x6ab8('0x1e')]({'raw':_0x3de5b3['options']?_0x3de5b3['options']['raw']===undefined?!![]:![]:!![],'where':_0x3de5b3[_0x6ab8('0x1f')]?_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x20')]||null:null,'attributes':_0x3de5b3['options']?_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x21')]||null:null,'limit':_0x3de5b3['options']?_0x3de5b3['options'][_0x6ab8('0x22')]||null:null,'include':_0x3de5b3[_0x6ab8('0x1f')]?_0x3de5b3['options'][_0x6ab8('0x23')]?_[_0x6ab8('0x24')](_0x3de5b3[_0x6ab8('0x1f')][_0x6ab8('0x23')],function(_0x3ddaeb){return{'model':db[_0x3ddaeb[_0x6ab8('0x25')]],'as':_0x3ddaeb['as'],'attributes':_0x3ddaeb[_0x6ab8('0x21')],'include':_0x3ddaeb[_0x6ab8('0x23')]?_['map'](_0x3ddaeb['include'],function(_0x334e21){return{'model':db[_0x334e21['model']],'as':_0x334e21['as'],'attributes':_0x334e21[_0x6ab8('0x21')],'include':_0x334e21[_0x6ab8('0x23')]?_[_0x6ab8('0x24')](_0x334e21['include'],function(_0x525687){return{'model':db[_0x525687['model']],'as':_0x525687['as'],'attributes':_0x525687[_0x6ab8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6ab8('0x11')](function(_0x3723a7){logger[_0x6ab8('0x12')](_0x6ab8('0x1c'),_0x3de5b3);logger[_0x6ab8('0x14')](_0x6ab8('0x1c'),_0x3de5b3,JSON[_0x6ab8('0x26')](_0x3723a7));_0x312183(_0x3723a7);})[_0x6ab8('0x1b')](function(_0x1f6dbc){logger[_0x6ab8('0x17')](_0x6ab8('0x1c'),_0x1f6dbc[_0x6ab8('0x19')],_0x3de5b3);_0x5227c6(_0x2d2a80['error'](0x1f4,_0x1f6dbc['message']));});});};
\ No newline at end of file
+var _0xdcf6=['request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','limit','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','localhost','redis','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s'];(function(_0x36bf6b,_0x5dd433){var _0x20db61=function(_0x39267c){while(--_0x39267c){_0x36bf6b['push'](_0x36bf6b['shift']());}};_0x20db61(++_0x5dd433);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x40ff3b,_0x238af7){_0x40ff3b=_0x40ff3b-0x0;var _0x3ccf4f=_0xdcf6[_0x40ff3b];return _0x3ccf4f;};'use strict';var _=require('lodash');var util=require(_0x6dcf('0x0'));var moment=require(_0x6dcf('0x1'));var BPromise=require(_0x6dcf('0x2'));var rs=require(_0x6dcf('0x3'));var fs=require('fs');var Redis=require(_0x6dcf('0x4'));var db=require(_0x6dcf('0x5'))['db'];var utils=require(_0x6dcf('0x6'));var logger=require('../../config/logger')(_0x6dcf('0x7'));var config=require(_0x6dcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6dcf('0x9')][_0x6dcf('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6dcf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dcf('0xc')]));require(_0x6dcf('0xd'))[_0x6dcf('0xe')](socket);function respondWithRpcPromise(_0x4eda69,_0x527a65,_0x5b65a7){return new BPromise(function(_0x443c93,_0x23f052){return client[_0x6dcf('0xf')](_0x4eda69,_0x5b65a7)['then'](function(_0x23fce1){logger[_0x6dcf('0x10')](_0x6dcf('0x11'),_0x527a65,_0x6dcf('0x12'));logger[_0x6dcf('0x13')](_0x6dcf('0x14'),_0x527a65,_0x6dcf('0x12'),JSON[_0x6dcf('0x15')](_0x23fce1));if(_0x23fce1[_0x6dcf('0x16')]){if(_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x17')]===0x1f4){logger[_0x6dcf('0x16')](_0x6dcf('0x11'),_0x527a65,_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);return _0x23f052(_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);}logger['error'](_0x6dcf('0x11'),_0x527a65,_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);return _0x443c93(_0x23fce1['error'][_0x6dcf('0x18')]);}else{logger[_0x6dcf('0x10')](_0x6dcf('0x11'),_0x527a65,_0x6dcf('0x12'));_0x443c93(_0x23fce1[_0x6dcf('0x19')][_0x6dcf('0x18')]);}})[_0x6dcf('0x1a')](function(_0x2b5cd4){logger['error'](_0x6dcf('0x11'),_0x527a65,_0x2b5cd4);_0x23f052(_0x2b5cd4);});});}exports[_0x6dcf('0x1b')]=function(_0x35c30b){var _0x2d2169=this;return new Promise(function(_0x3c9cbb,_0x200994){return db[_0x6dcf('0x1c')]['findAll']({'raw':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b['options'][_0x6dcf('0x1e')]===undefined?!![]:![]:!![],'where':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x1f')]||null:null,'attributes':_0x35c30b['options']?_0x35c30b['options'][_0x6dcf('0x20')]||null:null,'limit':_0x35c30b['options']?_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x21')]||null:null,'include':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b[_0x6dcf('0x1d')]['include']?_[_0x6dcf('0x22')](_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x23')],function(_0x124853){return{'model':db[_0x124853['model']],'as':_0x124853['as'],'attributes':_0x124853[_0x6dcf('0x20')],'include':_0x124853[_0x6dcf('0x23')]?_[_0x6dcf('0x22')](_0x124853[_0x6dcf('0x23')],function(_0x16e8c4){return{'model':db[_0x16e8c4[_0x6dcf('0x24')]],'as':_0x16e8c4['as'],'attributes':_0x16e8c4[_0x6dcf('0x20')],'include':_0x16e8c4[_0x6dcf('0x23')]?_[_0x6dcf('0x22')](_0x16e8c4[_0x6dcf('0x23')],function(_0x2f9558){return{'model':db[_0x2f9558[_0x6dcf('0x24')]],'as':_0x2f9558['as'],'attributes':_0x2f9558['attributes']};}):[]};}):[]};}):[]:[]})[_0x6dcf('0x25')](function(_0x1d3b73){logger['info']('GetVoiceExtension',_0x35c30b);logger['debug']('GetVoiceExtension',_0x35c30b,JSON[_0x6dcf('0x15')](_0x1d3b73));_0x3c9cbb(_0x1d3b73);})[_0x6dcf('0x1a')](function(_0x4c106c){logger[_0x6dcf('0x16')](_0x6dcf('0x1b'),_0x4c106c[_0x6dcf('0x18')],_0x35c30b);_0x200994(_0x2d2169[_0x6dcf('0x16')](0x1f4,_0x4c106c['message']));});});};
\ No newline at end of file
index 88b874c..76cdab6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['length','voiceExtension:','remove','update','emit','removeListener','register'];(function(_0x4612ce,_0x3b3199){var _0x586836=function(_0x5686f6){while(--_0x5686f6){_0x4612ce['push'](_0x4612ce['shift']());}};_0x586836(++_0x3b3199);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4359fa,_0x4d5f23){_0x4359fa=_0x4359fa-0x0;var _0x3df26d=_0x7fbe[_0x4359fa];return _0x3df26d;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0xe7fb('0x0'),_0xe7fb('0x1')];function createListener(_0x294c21,_0x1703d5){return function(_0x517d3a){_0x1703d5[_0xe7fb('0x2')](_0x294c21,_0x517d3a);};}function removeListener(_0x11d2c4,_0x4524ff){return function(){VoiceExtensionEvents[_0xe7fb('0x3')](_0x11d2c4,_0x4524ff);};}exports[_0xe7fb('0x4')]=function(_0x290172){for(var _0x12d1b0=0x0,_0x24cd67=events[_0xe7fb('0x5')];_0x12d1b0<_0x24cd67;_0x12d1b0++){var _0x5ad75b=events[_0x12d1b0];var _0x213ebc=createListener(_0xe7fb('0x6')+_0x5ad75b,_0x290172);VoiceExtensionEvents['on'](_0x5ad75b,_0x213ebc);}};
\ No newline at end of file
+var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x5053c6,_0x4fe813){var _0x8f3e43=function(_0x1ef077){while(--_0x1ef077){_0x5053c6['push'](_0x5053c6['shift']());}};_0x8f3e43(++_0x4fe813);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}};
\ No newline at end of file
index 76e6fe5..8eeae9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7278=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x25d396,_0xaf3e1c){var _0x4cadd7=function(_0x553141){while(--_0x553141){_0x25d396['push'](_0x25d396['shift']());}};_0x4cadd7(++_0xaf3e1c);}(_0x7278,0x161));var _0x8727=function(_0x5134ec,_0x2cc35f){_0x5134ec=_0x5134ec-0x0;var _0x573c8b=_0x7278[_0x5134ec];return _0x573c8b;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x8727('0xe')]('/',auth[_0x8727('0xb')](),controller[_0x8727('0xf')]);router[_0x8727('0x10')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0x11')]);router[_0x8727('0x12')]('/:id',auth[_0x8727('0xb')](),controller[_0x8727('0x13')]);module[_0x8727('0x14')]=router;
\ No newline at end of file
+var _0x2675=['post','create','update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show'];(function(_0x295ba5,_0x19f6b0){var _0x317758=function(_0x1bc144){while(--_0x1bc144){_0x295ba5['push'](_0x295ba5['shift']());}};_0x317758(++_0x19f6b0);}(_0x2675,0x75));var _0x5267=function(_0x2794a1,_0x50a460){_0x2794a1=_0x2794a1-0x0;var _0x5c4963=_0x2675[_0x2794a1];return _0x5c4963;};'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/messages',auth[_0x5267('0x7')](),controller['getMessages']);router[_0x5267('0xb')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xc')]);router['put'](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xd')]);router['delete'](_0x5267('0x9'),auth[_0x5267('0x7')](),controller[_0x5267('0xe')]);module[_0x5267('0xf')]=router;
\ No newline at end of file
index 6e796b0..451365c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09c2=['ENUM','yes','TIMESTAMP','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','trim','central'];(function(_0x425dd0,_0x2070d8){var _0x5ecde7=function(_0x4ed7da){while(--_0x4ed7da){_0x425dd0['push'](_0x425dd0['shift']());}};_0x5ecde7(++_0x2070d8);}(_0x09c2,0x1e2));var _0x209c=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0x09c2[_0x4eec9b];return _0x2e3849;};'use strict';var Sequelize=require(_0x209c('0x0'));module[_0x209c('0x1')]={'customer_id':{'type':Sequelize[_0x209c('0x2')]},'context':{'type':Sequelize[_0x209c('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x209c('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x209c('0x2')]},'email':{'type':Sequelize[_0x209c('0x2')],'validate':{'isEmail':!![]},'set':function(_0xd70e0a){this[_0x209c('0x4')](_0x209c('0x5'),typeof _0xd70e0a==='string'&&_0xd70e0a['trim']()?_0xd70e0a[_0x209c('0x6')]():null);}},'pager':{'type':Sequelize[_0x209c('0x2')]},'tz':{'type':Sequelize[_0x209c('0x2')],'defaultValue':_0x209c('0x7')},'attach':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':_0x209c('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':_0x209c('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x209c('0x2')]},'callback':{'type':Sequelize[_0x209c('0x2')]},'review':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x209c('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x209c('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x209c('0x8')](_0x209c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x209c('0x9'),'allowNull':![]},'stamp':{'type':_0x209c('0xa')},'emailsubject':{'type':Sequelize[_0x209c('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x209c('0xb'))+_0x209c('0xc')+this['getDataValue'](_0x209c('0xd'));}}};
\ No newline at end of file
+var _0x088c=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x088c,0x6e));var _0xc088=function(_0x392b80,_0xc38876){_0x392b80=_0x392b80-0x0;var _0x4aeec6=_0x088c[_0x392b80];return _0x4aeec6;};'use strict';var Sequelize=require(_0xc088('0x0'));module[_0xc088('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc088('0x2')],'defaultValue':_0xc088('0x3'),'unique':_0xc088('0x4')},'mailbox':{'type':Sequelize[_0xc088('0x2')],'defaultValue':'','allowNull':![],'unique':_0xc088('0x4')},'password':{'type':Sequelize[_0xc088('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc088('0x2')],'validate':{'isEmail':!![]},'set':function(_0x18250e){this[_0xc088('0x5')](_0xc088('0x6'),typeof _0x18250e===_0xc088('0x7')&&_0x18250e[_0xc088('0x8')]()?_0x18250e['trim']():null);}},'pager':{'type':Sequelize[_0xc088('0x2')]},'tz':{'type':Sequelize[_0xc088('0x2')],'defaultValue':_0xc088('0x9')},'attach':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':_0xc088('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xc088('0xb'),'no'),'defaultValue':_0xc088('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc088('0x2')]},'callback':{'type':Sequelize[_0xc088('0x2')]},'review':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc088('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':_0xc088('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':_0xc088('0xb'),'allowNull':![]},'stamp':{'type':_0xc088('0xd')},'emailsubject':{'type':Sequelize[_0xc088('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xc088('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc088('0xf')],'get':function(){return this[_0xc088('0x10')](_0xc088('0x11'))+_0xc088('0x12')+this[_0xc088('0x10')](_0xc088('0x13'));}}};
\ No newline at end of file
index efe8bd5..62105ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','catch','show','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','nolimit','filter','mailbox','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','get','Voicemails','end','error','name','send','index','map','VoiceMail'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xb688,0xcf));var _0x8b68=function(_0x185d1d,_0x1b4cca){_0x185d1d=_0x185d1d-0x0;var _0x41f78b=_0xb688[_0x185d1d];return _0x41f78b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x1965cf,_0x2f3af4){_0x2f3af4=_0x2f3af4||0xcc;return function(_0xaa8725){if(_0xaa8725){return _0x1965cf[_0x8b68('0x1b')](_0x2f3af4);}return _0x1965cf[_0x8b68('0x1c')](_0x2f3af4)['end']();};}function respondWithResult(_0xb2df35,_0x509033){_0x509033=_0x509033||0xc8;return function(_0x5e3c66){if(_0x5e3c66){return _0xb2df35[_0x8b68('0x1c')](_0x509033)[_0x8b68('0x1d')](_0x5e3c66);}};}function respondWithFilteredResult(_0x27d717,_0x5d3468){return function(_0x5c8d0e){if(_0x5c8d0e){var _0x23bd52=typeof _0x5d3468['offset']===_0x8b68('0x1e')&&typeof _0x5d3468[_0x8b68('0x1f')]===_0x8b68('0x1e');var _0x10c9c6=_0x5c8d0e['count'];var _0xd17693=_0x23bd52?0x0:_0x5d3468[_0x8b68('0x20')];var _0x4a68c7=_0x23bd52?_0x5c8d0e[_0x8b68('0x21')]:_0x5d3468[_0x8b68('0x20')]+_0x5d3468[_0x8b68('0x1f')];var _0x17f321;if(_0x4a68c7>=_0x10c9c6){_0x4a68c7=_0x10c9c6;_0x17f321=0xc8;}else{_0x17f321=0xce;}_0x27d717[_0x8b68('0x1c')](_0x17f321);return _0x27d717['set'](_0x8b68('0x22'),_0xd17693+'-'+_0x4a68c7+'/'+_0x10c9c6)[_0x8b68('0x1d')](_0x5c8d0e);}return null;};}function patchUpdates(_0x59e9b1){return function(_0x1a9788){try{jsonpatch[_0x8b68('0x23')](_0x1a9788,_0x59e9b1,!![]);}catch(_0x1dbc1d){return BPromise['reject'](_0x1dbc1d);}return _0x1a9788['save']();};}function saveUpdates(_0x23edc1,_0x59cb26){return function(_0x332202){if(_0x332202){return _0x332202[_0x8b68('0x24')](_0x23edc1)[_0x8b68('0x25')](function(_0x21ecca){return _0x21ecca;});}return null;};}function removeEntity(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(_0x59bb8a){return _0x59bb8a[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){var _0x4ca77d=_0x59bb8a[_0x8b68('0x27')]({'plain':!![]});var _0x3cf8d2=_0x8b68('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3cf8d2,'resourceId':_0x4ca77d['id']}})['then'](function(){return _0x59bb8a;});})[_0x8b68('0x25')](function(){_0x32ddc5[_0x8b68('0x1c')](0xcc)[_0x8b68('0x29')]();});}};}function handleEntityNotFound(_0x583476,_0x3311c7){return function(_0x53aaa2){if(!_0x53aaa2){_0x583476['sendStatus'](0x194);}return _0x53aaa2;};}function handleError(_0x3865ea,_0x59b3ce){_0x59b3ce=_0x59b3ce||0x1f4;return function(_0x26cad7){logger[_0x8b68('0x2a')](_0x26cad7['stack']);if(_0x26cad7['name']){delete _0x26cad7[_0x8b68('0x2b')];}_0x3865ea[_0x8b68('0x1c')](_0x59b3ce)[_0x8b68('0x2c')](_0x26cad7);};}exports[_0x8b68('0x2d')]=function(_0x210926,_0x2ad2df){var _0x460c37={},_0x5b7ed1={},_0x3b6d1b={'count':0x0,'rows':[]};var _0x50a1e9=_[_0x8b68('0x2e')](db[_0x8b68('0x2f')]['rawAttributes'],function(_0x216aa6){return{'name':_0x216aa6[_0x8b68('0x30')],'type':_0x216aa6[_0x8b68('0x31')]['key']};});_0x5b7ed1['model']=_[_0x8b68('0x2e')](_0x50a1e9,_0x8b68('0x2b'));_0x5b7ed1[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x210926[_0x8b68('0x32')]);_0x5b7ed1[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],_0x5b7ed1[_0x8b68('0x32')]);_0x460c37[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x210926[_0x8b68('0x32')][_0x8b68('0x38')]));_0x460c37[_0x8b68('0x37')]=_0x460c37[_0x8b68('0x37')][_0x8b68('0x39')]?_0x460c37[_0x8b68('0x37')]:_0x5b7ed1[_0x8b68('0x36')];if(!_0x210926[_0x8b68('0x32')][_0x8b68('0x3a')]('nolimit')){_0x460c37['limit']=qs[_0x8b68('0x1f')](_0x210926[_0x8b68('0x32')][_0x8b68('0x1f')]);_0x460c37[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x210926[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x460c37[_0x8b68('0x3b')]=qs['sort'](_0x210926[_0x8b68('0x32')][_0x8b68('0x3c')]);_0x460c37[_0x8b68('0x3d')]=qs[_0x8b68('0x34')](_[_0x8b68('0x3e')](_0x210926[_0x8b68('0x32')],_0x5b7ed1[_0x8b68('0x34')]),_0x50a1e9);if(_0x210926[_0x8b68('0x32')]['filter']){_0x460c37[_0x8b68('0x3d')]=_[_0x8b68('0x3f')](_0x460c37[_0x8b68('0x3d')],{'$or':_[_0x8b68('0x2e')](_0x50a1e9,function(_0x3ecc60){if(_0x3ecc60[_0x8b68('0x31')]!==_0x8b68('0x40')){var _0x50a9c6={};_0x50a9c6[_0x3ecc60[_0x8b68('0x2b')]]={'$like':'%'+_0x210926[_0x8b68('0x32')]['filter']+'%'};return _0x50a9c6;}})});}_0x460c37=_[_0x8b68('0x3f')]({},_0x460c37,_0x210926[_0x8b68('0x41')]);var _0x50b2f1={'where':_0x460c37['where']};return db['VoiceMail']['count'](_0x50b2f1)[_0x8b68('0x25')](function(_0x23d24a){_0x3b6d1b['count']=_0x23d24a;if(_0x210926[_0x8b68('0x32')]['includeAll']){_0x460c37[_0x8b68('0x42')]=[{'all':!![]}];}return db[_0x8b68('0x2f')]['findAll'](_0x460c37);})[_0x8b68('0x25')](function(_0x5ae345){_0x3b6d1b['rows']=_0x5ae345;return _0x3b6d1b;})['then'](respondWithFilteredResult(_0x2ad2df,_0x460c37))[_0x8b68('0x43')](handleError(_0x2ad2df,null));};exports[_0x8b68('0x44')]=function(_0x3ba80e,_0xa70f60){var _0x50e425={'raw':!![],'where':{'id':_0x3ba80e['params']['id']}},_0x20162a={};_0x20162a[_0x8b68('0x36')]=_[_0x8b68('0x33')](db['VoiceMail'][_0x8b68('0x45')]);_0x20162a[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3ba80e[_0x8b68('0x32')]);_0x20162a['filters']=_[_0x8b68('0x35')](_0x20162a[_0x8b68('0x36')],_0x20162a[_0x8b68('0x32')]);_0x50e425[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x20162a[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x3ba80e[_0x8b68('0x32')][_0x8b68('0x38')]));_0x50e425[_0x8b68('0x37')]=_0x50e425[_0x8b68('0x37')][_0x8b68('0x39')]?_0x50e425[_0x8b68('0x37')]:_0x20162a[_0x8b68('0x36')];if(_0x3ba80e[_0x8b68('0x32')][_0x8b68('0x46')]){_0x50e425['include']=[{'all':!![]}];}_0x50e425=_[_0x8b68('0x3f')]({},_0x50e425,_0x3ba80e[_0x8b68('0x41')]);return db['VoiceMail'][_0x8b68('0x47')](_0x50e425)['then'](handleEntityNotFound(_0xa70f60,null))['then'](respondWithResult(_0xa70f60,null))['catch'](handleError(_0xa70f60,null));};exports[_0x8b68('0x48')]=function(_0x35874b,_0x34047c){return db[_0x8b68('0x2f')]['create'](_0x35874b['body'],{})[_0x8b68('0x25')](function(_0x163fd5){var _0x1e900f=_0x35874b['user'][_0x8b68('0x27')]({'plain':!![]});if(!_0x1e900f)throw new Error(_0x8b68('0x49'));if(_0x1e900f['role']===_0x8b68('0x4a')){var _0xacac82=_0x163fd5['get']({'plain':!![]});var _0x18a9ae=_0x8b68('0x28');return db['UserProfileSection'][_0x8b68('0x47')]({'where':{'name':_0x18a9ae,'userProfileId':_0x1e900f[_0x8b68('0x4b')]},'raw':!![]})['then'](function(_0x543d74){if(_0x543d74&&_0x543d74['autoAssociation']===0x0){return db[_0x8b68('0x4c')][_0x8b68('0x48')]({'name':_0xacac82[_0x8b68('0x2b')],'resourceId':_0xacac82['id'],'type':_0x543d74[_0x8b68('0x2b')],'sectionId':_0x543d74['id']},{})['then'](function(){return _0x163fd5;});}else{return _0x163fd5;}})['catch'](function(_0x4492fd){logger[_0x8b68('0x2a')](_0x8b68('0x4d'),_0x4492fd);throw _0x4492fd;});}return _0x163fd5;})['then'](respondWithResult(_0x34047c,0xc9))[_0x8b68('0x43')](handleError(_0x34047c,null));};exports[_0x8b68('0x24')]=function(_0x3f9d34,_0x4dda69){if(_0x3f9d34[_0x8b68('0x4e')]['id']){delete _0x3f9d34['body']['id'];}return db[_0x8b68('0x2f')][_0x8b68('0x47')]({'where':{'id':_0x3f9d34['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x4dda69,null))[_0x8b68('0x25')](saveUpdates(_0x3f9d34[_0x8b68('0x4e')],null))[_0x8b68('0x25')](respondWithResult(_0x4dda69,null))[_0x8b68('0x43')](handleError(_0x4dda69,null));};exports['destroy']=function(_0x241166,_0x3f3e43){return db[_0x8b68('0x2f')][_0x8b68('0x47')]({'where':{'id':_0x241166[_0x8b68('0x4f')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x3f3e43,null))[_0x8b68('0x25')](removeEntity(_0x3f3e43,null))[_0x8b68('0x43')](handleError(_0x3f3e43,null));};exports['getMessages']=function(_0x3f423e,_0x1a85da,_0x1e8694){return db[_0x8b68('0x2f')][_0x8b68('0x50')]({'where':{'id':_0x3f423e[_0x8b68('0x4f')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x1a85da,null))[_0x8b68('0x25')](function(_0x6d63cb){var _0x271dbe;var _0x368c86={},_0x42871e={};_0x42871e[_0x8b68('0x36')]=_[_0x8b68('0x33')](db[_0x8b68('0x51')][_0x8b68('0x45')]);_0x42871e[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3f423e[_0x8b68('0x32')]);_0x42871e[_0x8b68('0x34')]=_['intersection'](_0x42871e[_0x8b68('0x36')],_0x42871e['query']);_0x368c86['attributes']=_[_0x8b68('0x35')](_0x42871e['model'],qs[_0x8b68('0x38')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x38')]));_0x368c86['attributes']=_0x368c86[_0x8b68('0x37')][_0x8b68('0x39')]?_0x368c86[_0x8b68('0x37')]:_0x42871e[_0x8b68('0x36')];if(!_0x3f423e[_0x8b68('0x32')][_0x8b68('0x3a')](_0x8b68('0x52'))){_0x368c86['limit']=qs['limit'](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x1f')]);_0x368c86[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x368c86[_0x8b68('0x3b')]=qs[_0x8b68('0x3c')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x3c')]);_0x368c86[_0x8b68('0x3d')]=qs[_0x8b68('0x34')](_[_0x8b68('0x3e')](_0x3f423e[_0x8b68('0x32')],_0x42871e[_0x8b68('0x34')]));if(_0x3f423e[_0x8b68('0x32')][_0x8b68('0x53')]){_0x368c86[_0x8b68('0x3d')]=_['merge'](_0x368c86['where'],{'$or':_[_0x8b68('0x2e')](_0x368c86[_0x8b68('0x37')],function(_0x5bd581){var _0x48d57a={};_0x48d57a[_0x5bd581]={'$like':'%'+_0x3f423e['query'][_0x8b68('0x53')]+'%'};return _0x48d57a;})});}_0x368c86[_0x8b68('0x3d')]=_[_0x8b68('0x3f')](_0x368c86[_0x8b68('0x3d')],{'mailboxuser':_0x6d63cb[_0x8b68('0x54')]});_0x368c86=_['merge']({},_0x368c86,_0x3f423e[_0x8b68('0x41')]);return db[_0x8b68('0x51')]['findAndCountAll'](_0x368c86)[_0x8b68('0x25')](respondWithFilteredResult(_0x1a85da,_0x368c86));})['catch'](handleError(_0x1a85da,null));};
\ No newline at end of file
+var _0x5ec6=['map','VoiceMail','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','hasOwnProperty','order','sort','pick','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','index'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x5ec6,0x7f));var _0x65ec=function(_0x28c512,_0x392d69){_0x28c512=_0x28c512-0x0;var _0x5d39d0=_0x5ec6[_0x28c512];return _0x5d39d0;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];function respondWithStatusCode(_0x53d62b,_0x3e52c8){_0x3e52c8=_0x3e52c8||0xcc;return function(_0x2af7d6){if(_0x2af7d6){return _0x53d62b[_0x65ec('0x15')](_0x3e52c8);}return _0x53d62b[_0x65ec('0x16')](_0x3e52c8)[_0x65ec('0x17')]();};}function respondWithResult(_0x434e20,_0x344724){_0x344724=_0x344724||0xc8;return function(_0x3edbfd){if(_0x3edbfd){return _0x434e20['status'](_0x344724)[_0x65ec('0x18')](_0x3edbfd);}};}function respondWithFilteredResult(_0x3ed6f7,_0x35d06b){return function(_0x4bbe88){if(_0x4bbe88){var _0x5a0442=typeof _0x35d06b[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x35d06b[_0x65ec('0x1b')]==='undefined';var _0x25dae7=_0x4bbe88[_0x65ec('0x1c')];var _0x1254f8=_0x5a0442?0x0:_0x35d06b[_0x65ec('0x19')];var _0x29ebc4=_0x5a0442?_0x4bbe88[_0x65ec('0x1c')]:_0x35d06b[_0x65ec('0x19')]+_0x35d06b[_0x65ec('0x1b')];var _0x2127e2;if(_0x29ebc4>=_0x25dae7){_0x29ebc4=_0x25dae7;_0x2127e2=0xc8;}else{_0x2127e2=0xce;}_0x3ed6f7[_0x65ec('0x16')](_0x2127e2);return _0x3ed6f7[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x1254f8+'-'+_0x29ebc4+'/'+_0x25dae7)[_0x65ec('0x18')](_0x4bbe88);}return null;};}function patchUpdates(_0x1467ac){return function(_0x3804a4){try{jsonpatch[_0x65ec('0x1f')](_0x3804a4,_0x1467ac,!![]);}catch(_0x15d4eb){return BPromise[_0x65ec('0x20')](_0x15d4eb);}return _0x3804a4[_0x65ec('0x21')]();};}function saveUpdates(_0x4ff93c,_0x170703){return function(_0x297fba){if(_0x297fba){return _0x297fba[_0x65ec('0x22')](_0x4ff93c)[_0x65ec('0x23')](function(_0x1d60fb){return _0x1d60fb;});}return null;};}function removeEntity(_0x163e55,_0x47288d){return function(_0x58239f){if(_0x58239f){return _0x58239f[_0x65ec('0x24')]()[_0x65ec('0x23')](function(){var _0x13ac27=_0x58239f[_0x65ec('0x25')]({'plain':!![]});var _0x288e66=_0x65ec('0x26');return db[_0x65ec('0x27')][_0x65ec('0x24')]({'where':{'type':_0x288e66,'resourceId':_0x13ac27['id']}})[_0x65ec('0x23')](function(){return _0x58239f;});})['then'](function(){_0x163e55[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x251831,_0x23b1a3){return function(_0x4de451){if(!_0x4de451){_0x251831[_0x65ec('0x15')](0x194);}return _0x4de451;};}function handleError(_0x588fe4,_0x37489f){_0x37489f=_0x37489f||0x1f4;return function(_0x1ada47){logger[_0x65ec('0x28')](_0x1ada47[_0x65ec('0x29')]);if(_0x1ada47[_0x65ec('0x2a')]){delete _0x1ada47[_0x65ec('0x2a')];}_0x588fe4[_0x65ec('0x16')](_0x37489f)[_0x65ec('0x2b')](_0x1ada47);};}exports[_0x65ec('0x2c')]=function(_0xeec5d4,_0x3c97e2){var _0x4b435c={},_0x50d81f={},_0x1d2e24={'count':0x0,'rows':[]};var _0x5084af=_[_0x65ec('0x2d')](db[_0x65ec('0x2e')]['rawAttributes'],function(_0x1dd1c0){return{'name':_0x1dd1c0[_0x65ec('0x2f')],'type':_0x1dd1c0[_0x65ec('0x30')][_0x65ec('0x31')]};});_0x50d81f['model']=_[_0x65ec('0x2d')](_0x5084af,_0x65ec('0x2a'));_0x50d81f[_0x65ec('0x32')]=_[_0x65ec('0x33')](_0xeec5d4[_0x65ec('0x32')]);_0x50d81f[_0x65ec('0x34')]=_[_0x65ec('0x35')](_0x50d81f[_0x65ec('0x36')],_0x50d81f[_0x65ec('0x32')]);_0x4b435c[_0x65ec('0x37')]=_['intersection'](_0x50d81f[_0x65ec('0x36')],qs[_0x65ec('0x38')](_0xeec5d4['query'][_0x65ec('0x38')]));_0x4b435c[_0x65ec('0x37')]=_0x4b435c[_0x65ec('0x37')][_0x65ec('0x39')]?_0x4b435c[_0x65ec('0x37')]:_0x50d81f[_0x65ec('0x36')];if(!_0xeec5d4[_0x65ec('0x32')]['hasOwnProperty'](_0x65ec('0x3a'))){_0x4b435c[_0x65ec('0x1b')]=qs[_0x65ec('0x1b')](_0xeec5d4[_0x65ec('0x32')]['limit']);_0x4b435c[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0xeec5d4[_0x65ec('0x32')][_0x65ec('0x19')]);}_0x4b435c['order']=qs['sort'](_0xeec5d4[_0x65ec('0x32')]['sort']);_0x4b435c[_0x65ec('0x3b')]=qs[_0x65ec('0x34')](_['pick'](_0xeec5d4[_0x65ec('0x32')],_0x50d81f[_0x65ec('0x34')]),_0x5084af);if(_0xeec5d4[_0x65ec('0x32')][_0x65ec('0x3c')]){_0x4b435c[_0x65ec('0x3b')]=_[_0x65ec('0x3d')](_0x4b435c[_0x65ec('0x3b')],{'$or':_[_0x65ec('0x2d')](_0x5084af,function(_0x470bb3){if(_0x470bb3[_0x65ec('0x30')]!==_0x65ec('0x3e')){var _0x5cdb0f={};_0x5cdb0f[_0x470bb3[_0x65ec('0x2a')]]={'$like':'%'+_0xeec5d4['query'][_0x65ec('0x3c')]+'%'};return _0x5cdb0f;}})});}_0x4b435c=_[_0x65ec('0x3d')]({},_0x4b435c,_0xeec5d4[_0x65ec('0x3f')]);var _0x1bfc44={'where':_0x4b435c[_0x65ec('0x3b')]};return db[_0x65ec('0x2e')]['count'](_0x1bfc44)[_0x65ec('0x23')](function(_0x4ba7df){_0x1d2e24['count']=_0x4ba7df;if(_0xeec5d4[_0x65ec('0x32')][_0x65ec('0x40')]){_0x4b435c[_0x65ec('0x41')]=[{'all':!![]}];}return db[_0x65ec('0x2e')][_0x65ec('0x42')](_0x4b435c);})['then'](function(_0x4843ca){_0x1d2e24[_0x65ec('0x43')]=_0x4843ca;return _0x1d2e24;})[_0x65ec('0x23')](respondWithFilteredResult(_0x3c97e2,_0x4b435c))[_0x65ec('0x44')](handleError(_0x3c97e2,null));};exports[_0x65ec('0x45')]=function(_0x11edd1,_0x55642b){var _0x5c8bfd={'raw':!![],'where':{'id':_0x11edd1[_0x65ec('0x46')]['id']}},_0x38d1fe={};_0x38d1fe[_0x65ec('0x36')]=_[_0x65ec('0x33')](db[_0x65ec('0x2e')][_0x65ec('0x47')]);_0x38d1fe[_0x65ec('0x32')]=_['keys'](_0x11edd1[_0x65ec('0x32')]);_0x38d1fe[_0x65ec('0x34')]=_[_0x65ec('0x35')](_0x38d1fe['model'],_0x38d1fe[_0x65ec('0x32')]);_0x5c8bfd[_0x65ec('0x37')]=_['intersection'](_0x38d1fe[_0x65ec('0x36')],qs[_0x65ec('0x38')](_0x11edd1[_0x65ec('0x32')][_0x65ec('0x38')]));_0x5c8bfd[_0x65ec('0x37')]=_0x5c8bfd['attributes'][_0x65ec('0x39')]?_0x5c8bfd[_0x65ec('0x37')]:_0x38d1fe[_0x65ec('0x36')];if(_0x11edd1[_0x65ec('0x32')]['includeAll']){_0x5c8bfd[_0x65ec('0x41')]=[{'all':!![]}];}_0x5c8bfd=_['merge']({},_0x5c8bfd,_0x11edd1[_0x65ec('0x3f')]);return db[_0x65ec('0x2e')][_0x65ec('0x48')](_0x5c8bfd)['then'](handleEntityNotFound(_0x55642b,null))['then'](respondWithResult(_0x55642b,null))[_0x65ec('0x44')](handleError(_0x55642b,null));};exports[_0x65ec('0x49')]=function(_0xf5419,_0x2111af){return db[_0x65ec('0x2e')][_0x65ec('0x49')](_0xf5419[_0x65ec('0x4a')],{})[_0x65ec('0x23')](function(_0x590b5a){var _0x646e97=_0xf5419[_0x65ec('0x4b')][_0x65ec('0x25')]({'plain':!![]});if(!_0x646e97)throw new Error(_0x65ec('0x4c'));if(_0x646e97[_0x65ec('0x4d')]===_0x65ec('0x4b')){var _0x14eaef=_0x590b5a[_0x65ec('0x25')]({'plain':!![]});var _0x5eb6d3=_0x65ec('0x26');return db[_0x65ec('0x4e')]['find']({'where':{'name':_0x5eb6d3,'userProfileId':_0x646e97[_0x65ec('0x4f')]},'raw':!![]})[_0x65ec('0x23')](function(_0x3e963d){if(_0x3e963d&&_0x3e963d['autoAssociation']===0x0){return db[_0x65ec('0x27')][_0x65ec('0x49')]({'name':_0x14eaef[_0x65ec('0x2a')],'resourceId':_0x14eaef['id'],'type':_0x3e963d['name'],'sectionId':_0x3e963d['id']},{})[_0x65ec('0x23')](function(){return _0x590b5a;});}else{return _0x590b5a;}})['catch'](function(_0x4c9905){logger[_0x65ec('0x28')](_0x65ec('0x50'),_0x4c9905);throw _0x4c9905;});}return _0x590b5a;})[_0x65ec('0x23')](respondWithResult(_0x2111af,0xc9))['catch'](handleError(_0x2111af,null));};exports[_0x65ec('0x22')]=function(_0x28a686,_0x29f88){if(_0x28a686[_0x65ec('0x4a')]['id']){delete _0x28a686[_0x65ec('0x4a')]['id'];}return db[_0x65ec('0x2e')][_0x65ec('0x48')]({'where':{'id':_0x28a686[_0x65ec('0x46')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x29f88,null))['then'](saveUpdates(_0x28a686['body'],null))[_0x65ec('0x23')](respondWithResult(_0x29f88,null))['catch'](handleError(_0x29f88,null));};exports[_0x65ec('0x24')]=function(_0x592838,_0x347336){return db[_0x65ec('0x2e')][_0x65ec('0x48')]({'where':{'id':_0x592838[_0x65ec('0x46')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x347336,null))[_0x65ec('0x23')](removeEntity(_0x347336,null))[_0x65ec('0x44')](handleError(_0x347336,null));};exports['getMessages']=function(_0x2c7657,_0x474bc0,_0x1b5356){return db[_0x65ec('0x2e')][_0x65ec('0x51')]({'where':{'id':_0x2c7657['params']['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x474bc0,null))[_0x65ec('0x23')](function(_0xb85e9a){var _0x411d72;var _0x44fbba={},_0x3f2fd3={};_0x3f2fd3[_0x65ec('0x36')]=_[_0x65ec('0x33')](db['VoiceMailMessage'][_0x65ec('0x47')]);_0x3f2fd3[_0x65ec('0x32')]=_[_0x65ec('0x33')](_0x2c7657[_0x65ec('0x32')]);_0x3f2fd3[_0x65ec('0x34')]=_[_0x65ec('0x35')](_0x3f2fd3[_0x65ec('0x36')],_0x3f2fd3['query']);_0x44fbba['attributes']=_[_0x65ec('0x35')](_0x3f2fd3['model'],qs[_0x65ec('0x38')](_0x2c7657[_0x65ec('0x32')]['fields']));_0x44fbba[_0x65ec('0x37')]=_0x44fbba[_0x65ec('0x37')][_0x65ec('0x39')]?_0x44fbba[_0x65ec('0x37')]:_0x3f2fd3[_0x65ec('0x36')];if(!_0x2c7657[_0x65ec('0x32')][_0x65ec('0x52')]('nolimit')){_0x44fbba['limit']=qs[_0x65ec('0x1b')](_0x2c7657[_0x65ec('0x32')][_0x65ec('0x1b')]);_0x44fbba['offset']=qs[_0x65ec('0x19')](_0x2c7657[_0x65ec('0x32')][_0x65ec('0x19')]);}_0x44fbba[_0x65ec('0x53')]=qs[_0x65ec('0x54')](_0x2c7657[_0x65ec('0x32')][_0x65ec('0x54')]);_0x44fbba['where']=qs[_0x65ec('0x34')](_[_0x65ec('0x55')](_0x2c7657[_0x65ec('0x32')],_0x3f2fd3[_0x65ec('0x34')]));if(_0x2c7657[_0x65ec('0x32')][_0x65ec('0x3c')]){_0x44fbba[_0x65ec('0x3b')]=_[_0x65ec('0x3d')](_0x44fbba[_0x65ec('0x3b')],{'$or':_['map'](_0x44fbba['attributes'],function(_0x41d28d){var _0x484f5a={};_0x484f5a[_0x41d28d]={'$like':'%'+_0x2c7657['query'][_0x65ec('0x3c')]+'%'};return _0x484f5a;})});}_0x44fbba[_0x65ec('0x3b')]=_[_0x65ec('0x3d')](_0x44fbba['where'],{'mailboxuser':_0xb85e9a['mailbox']});_0x44fbba=_[_0x65ec('0x3d')]({},_0x44fbba,_0x2c7657['options']);return db['VoiceMailMessage']['findAndCountAll'](_0x44fbba)[_0x65ec('0x23')](respondWithFilteredResult(_0x474bc0,_0x44fbba));})['catch'](handleError(_0x474bc0,null));};
\ No newline at end of file
index f716340..c47d25e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a5f=['../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2a81a9,_0x2a3a0d){var _0x360b65=function(_0x1b0ace){while(--_0x1b0ace){_0x2a81a9['push'](_0x2a81a9['shift']());}};_0x360b65(++_0x2a3a0d);}(_0x7a5f,0xc7));var _0xf7a5=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0x7a5f[_0x2e3dfc];return _0x4b1245;};'use strict';var _=require(_0xf7a5('0x0'));var util=require(_0xf7a5('0x1'));var logger=require(_0xf7a5('0x2'))(_0xf7a5('0x3'));var moment=require(_0xf7a5('0x4'));var BPromise=require(_0xf7a5('0x5'));var rp=require(_0xf7a5('0x6'));var fs=require('fs');var path=require(_0xf7a5('0x7'));var rimraf=require(_0xf7a5('0x8'));var config=require(_0xf7a5('0x9'));var attributes=require('./voiceMail.attributes');module[_0xf7a5('0xa')]=function(_0x21ef55,_0x1f2d2b){return _0x21ef55[_0xf7a5('0xb')](_0xf7a5('0xc'),attributes,{'tableName':_0xf7a5('0xd'),'paranoid':![],'indexes':[{'name':_0xf7a5('0xe'),'fields':['mailbox',_0xf7a5('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc882=['moment','bluebird','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','context','lodash','util','../../config/logger'];(function(_0x299e86,_0x4fef4c){var _0x75a094=function(_0x19a43a){while(--_0x19a43a){_0x299e86['push'](_0x299e86['shift']());}};_0x75a094(++_0x4fef4c);}(_0xc882,0x1d1));var _0x2c88=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc882[_0x20a584];return _0x4b41a8;};'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(_0x2c88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c88('0x5'));var config=require(_0x2c88('0x6'));var attributes=require(_0x2c88('0x7'));module[_0x2c88('0x8')]=function(_0x140688,_0x47dbfc){return _0x140688['define'](_0x2c88('0x9'),attributes,{'tableName':_0x2c88('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x2c88('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index dc65f19..3693633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2379=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x348b07,_0x389183){var _0x2507f4=function(_0x540980){while(--_0x540980){_0x348b07['push'](_0x348b07['shift']());}};_0x2507f4(++_0x389183);}(_0x2379,0x1b0));var _0x9237=function(_0x59bbb7,_0x5c8df0){_0x59bbb7=_0x59bbb7-0x0;var _0x48006d=_0x2379[_0x59bbb7];return _0x48006d;};'use strict';var _=require(_0x9237('0x0'));var util=require(_0x9237('0x1'));var moment=require(_0x9237('0x2'));var BPromise=require(_0x9237('0x3'));var rs=require(_0x9237('0x4'));var fs=require('fs');var Redis=require(_0x9237('0x5'));var db=require(_0x9237('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9237('0x7'))(_0x9237('0x8'));var config=require(_0x9237('0x9'));var jayson=require(_0x9237('0xa'));var client=jayson[_0x9237('0xb')][_0x9237('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c1035,_0x2937fb,_0x231378){return new BPromise(function(_0x31aaa5,_0x4427da){return client[_0x9237('0xd')](_0x2c1035,_0x231378)[_0x9237('0xe')](function(_0x33be92){logger[_0x9237('0xf')](_0x9237('0x10'),_0x2937fb,_0x9237('0x11'));logger[_0x9237('0x12')](_0x9237('0x13'),_0x2937fb,_0x9237('0x11'),JSON[_0x9237('0x14')](_0x33be92));if(_0x33be92[_0x9237('0x15')]){if(_0x33be92['error'][_0x9237('0x16')]===0x1f4){logger[_0x9237('0x15')]('VoiceMail,\x20%s,\x20%s',_0x2937fb,_0x33be92[_0x9237('0x15')]['message']);return _0x4427da(_0x33be92[_0x9237('0x15')][_0x9237('0x17')]);}logger['error'](_0x9237('0x10'),_0x2937fb,_0x33be92['error']['message']);return _0x31aaa5(_0x33be92[_0x9237('0x15')][_0x9237('0x17')]);}else{logger['info'](_0x9237('0x10'),_0x2937fb,_0x9237('0x11'));_0x31aaa5(_0x33be92[_0x9237('0x18')]['message']);}})['catch'](function(_0x301d76){logger[_0x9237('0x15')]('VoiceMail,\x20%s,\x20%s',_0x2937fb,_0x301d76);_0x4427da(_0x301d76);});});}
\ No newline at end of file
+var _0x4c79=['info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x52f975,_0x305404){var _0x1b15a3=function(_0x5e9a63){while(--_0x5e9a63){_0x52f975['push'](_0x52f975['shift']());}};_0x1b15a3(++_0x305404);}(_0x4c79,0x153));var _0x94c7=function(_0x2a4f19,_0x2e4e36){_0x2a4f19=_0x2a4f19-0x0;var _0x5eeefe=_0x4c79[_0x2a4f19];return _0x5eeefe;};'use strict';var _=require(_0x94c7('0x0'));var util=require(_0x94c7('0x1'));var moment=require(_0x94c7('0x2'));var BPromise=require(_0x94c7('0x3'));var rs=require(_0x94c7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94c7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x94c7('0x6'))(_0x94c7('0x7'));var config=require('../../config/environment');var jayson=require(_0x94c7('0x8'));var client=jayson[_0x94c7('0x9')][_0x94c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ab503,_0x5d32a5,_0x4a549d){return new BPromise(function(_0x52ffbf,_0x3ac7dd){return client[_0x94c7('0xb')](_0x5ab503,_0x4a549d)[_0x94c7('0xc')](function(_0x5185d9){logger[_0x94c7('0xd')](_0x94c7('0xe'),_0x5d32a5,_0x94c7('0xf'));logger[_0x94c7('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x5d32a5,_0x94c7('0xf'),JSON[_0x94c7('0x11')](_0x5185d9));if(_0x5185d9[_0x94c7('0x12')]){if(_0x5185d9[_0x94c7('0x12')][_0x94c7('0x13')]===0x1f4){logger['error'](_0x94c7('0xe'),_0x5d32a5,_0x5185d9[_0x94c7('0x12')]['message']);return _0x3ac7dd(_0x5185d9[_0x94c7('0x12')][_0x94c7('0x14')]);}logger[_0x94c7('0x12')](_0x94c7('0xe'),_0x5d32a5,_0x5185d9['error']['message']);return _0x52ffbf(_0x5185d9[_0x94c7('0x12')][_0x94c7('0x14')]);}else{logger['info'](_0x94c7('0xe'),_0x5d32a5,_0x94c7('0xf'));_0x52ffbf(_0x5185d9[_0x94c7('0x15')][_0x94c7('0x14')]);}})['catch'](function(_0xa13b06){logger[_0x94c7('0x12')]('VoiceMail,\x20%s,\x20%s',_0x5d32a5,_0xa13b06);_0x3ac7dd(_0xa13b06);});});}
\ No newline at end of file
index 678ddc6..f182cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e4d=['download','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download'];(function(_0x45007f,_0x2e1e65){var _0x2e9278=function(_0x566ec8){while(--_0x566ec8){_0x45007f['push'](_0x45007f['shift']());}};_0x2e9278(++_0x2e1e65);}(_0x7e4d,0x195));var _0xd7e4=function(_0x125a68,_0x4ec80c){_0x125a68=_0x125a68-0x0;var _0x5ba500=_0x7e4d[_0x125a68];return _0x5ba500;};'use strict';var multer=require(_0xd7e4('0x0'));var util=require(_0xd7e4('0x1'));var path=require(_0xd7e4('0x2'));var timeout=require(_0xd7e4('0x3'));var express=require(_0xd7e4('0x4'));var router=express[_0xd7e4('0x5')]();var fs_extra=require(_0xd7e4('0x6'));var auth=require(_0xd7e4('0x7'));var interaction=require(_0xd7e4('0x8'));var config=require('../../config/environment');var controller=require(_0xd7e4('0x9'));router[_0xd7e4('0xa')]('/',auth[_0xd7e4('0xb')](),controller[_0xd7e4('0xc')]);router[_0xd7e4('0xa')](_0xd7e4('0xd'),auth[_0xd7e4('0xb')](),controller['show']);router[_0xd7e4('0xa')](_0xd7e4('0xe'),auth[_0xd7e4('0xb')](),controller[_0xd7e4('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd7e4('0x10')]('/:id',auth[_0xd7e4('0xb')](),controller['update']);router[_0xd7e4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd7e4('0x12')]);module[_0xd7e4('0x13')]=router;
\ No newline at end of file
+var _0xd4cd=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd4cd,0xa4));var _0xdd4c=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0xd4cd[_0x5400a1];return _0x4006c7;};'use strict';var multer=require(_0xdd4c('0x0'));var util=require(_0xdd4c('0x1'));var path=require(_0xdd4c('0x2'));var timeout=require(_0xdd4c('0x3'));var express=require(_0xdd4c('0x4'));var router=express[_0xdd4c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdd4c('0x6'));var interaction=require(_0xdd4c('0x7'));var config=require('../../config/environment');var controller=require(_0xdd4c('0x8'));router[_0xdd4c('0x9')]('/',auth[_0xdd4c('0xa')](),controller[_0xdd4c('0xb')]);router[_0xdd4c('0x9')](_0xdd4c('0xc'),auth['isAuthenticated'](),controller[_0xdd4c('0xd')]);router[_0xdd4c('0x9')](_0xdd4c('0xe'),auth['isAuthenticated'](),controller[_0xdd4c('0xf')]);router[_0xdd4c('0x10')]('/',auth[_0xdd4c('0xa')](),controller[_0xdd4c('0x11')]);router['put'](_0xdd4c('0xc'),auth[_0xdd4c('0xa')](),controller[_0xdd4c('0x12')]);router[_0xdd4c('0x13')](_0xdd4c('0xc'),auth[_0xdd4c('0xa')](),controller['destroy']);module[_0xdd4c('0x14')]=router;
\ No newline at end of file
index fc32cf3..6efc04c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2739=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x53f04f,_0x2cbf42){var _0xa1705b=function(_0xa26b19){while(--_0xa26b19){_0x53f04f['push'](_0x53f04f['shift']());}};_0xa1705b(++_0x2cbf42);}(_0x2739,0x66));var _0x9273=function(_0x4aa7d3,_0x1d9eee){_0x4aa7d3=_0x4aa7d3-0x0;var _0x113b1d=_0x2739[_0x4aa7d3];return _0x113b1d;};'use strict';var Sequelize=require(_0x9273('0x0'));module[_0x9273('0x1')]={'name':{'type':Sequelize[_0x9273('0x2')],'get':function(_0x2c8c48){return this[_0x9273('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x9273('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x9273('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x9273('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x9273('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x9273('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9273('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9273('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x9273('0x6')](_0x9273('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x9273('0x5')],'defaultValue':''},'stamp':{'type':_0x9273('0x8'),'defaultValue':Sequelize[_0x9273('0x9')](_0x9273('0xa'))}};
\ No newline at end of file
+var _0x2f06=['STRING','BLOB','TIMESTAMP','literal','sequelize','VIRTUAL','INTEGER'];(function(_0x4a7bbe,_0x28129e){var _0x29ac9a=function(_0x354f85){while(--_0x354f85){_0x4a7bbe['push'](_0x4a7bbe['shift']());}};_0x29ac9a(++_0x28129e);}(_0x2f06,0x19a));var _0x62f0=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2f06[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x62f0('0x0'));module['exports']={'name':{'type':Sequelize[_0x62f0('0x1')],'get':function(_0x455c06){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x62f0('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x62f0('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'stamp':{'type':_0x62f0('0x5'),'defaultValue':Sequelize[_0x62f0('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 7ae71b9..66303e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae13=['sox','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/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','stack','name','send','index','map','VoiceMailMessage','fieldName','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','update','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','request-promise','moment','bluebird','mustache','util'];(function(_0x34f1f3,_0x1af1f6){var _0x22775c=function(_0x46984a){while(--_0x46984a){_0x34f1f3['push'](_0x34f1f3['shift']());}};_0x22775c(++_0x1af1f6);}(_0xae13,0xa3));var _0x3ae1=function(_0x1d1568,_0x2490e2){_0x1d1568=_0x1d1568-0x0;var _0xbe31ec=_0xae13[_0x1d1568];return _0xbe31ec;};'use strict';var emlformat=require(_0x3ae1('0x0'));var rimraf=require(_0x3ae1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3ae1('0x2'));var moment=require(_0x3ae1('0x3'));var BPromise=require(_0x3ae1('0x4'));var Mustache=require(_0x3ae1('0x5'));var util=require(_0x3ae1('0x6'));var path=require('path');var sox=require(_0x3ae1('0x7'));var csv=require('to-csv');var ejs=require(_0x3ae1('0x8'));var fs=require('fs');var fs_extra=require(_0x3ae1('0x9'));var _=require(_0x3ae1('0xa'));var squel=require(_0x3ae1('0xb'));var crypto=require(_0x3ae1('0xc'));var jsforce=require(_0x3ae1('0xd'));var deskjs=require(_0x3ae1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3ae1('0xf'));var Redis=require(_0x3ae1('0x10'));var authService=require(_0x3ae1('0x11'));var qs=require(_0x3ae1('0x12'));var as=require(_0x3ae1('0x13'));var hardwareService=require(_0x3ae1('0x14'));var logger=require('../../config/logger')(_0x3ae1('0x15'));var utils=require('../../config/utils');var config=require(_0x3ae1('0x16'));var licenseUtil=require(_0x3ae1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x560e14,_0x692981){_0x692981=_0x692981||0xcc;return function(_0x1306b0){if(_0x1306b0){return _0x560e14[_0x3ae1('0x18')](_0x692981);}return _0x560e14[_0x3ae1('0x19')](_0x692981)[_0x3ae1('0x1a')]();};}function respondWithResult(_0x3652f9,_0x515994){_0x515994=_0x515994||0xc8;return function(_0x516813){if(_0x516813){return _0x3652f9['status'](_0x515994)['json'](_0x516813);}};}function respondWithFilteredResult(_0x47fc02,_0x115565){return function(_0x117200){if(_0x117200){var _0x3d950e=typeof _0x115565[_0x3ae1('0x1b')]===_0x3ae1('0x1c')&&typeof _0x115565[_0x3ae1('0x1d')]===_0x3ae1('0x1c');var _0x552048=_0x117200['count'];var _0x384e77=_0x3d950e?0x0:_0x115565[_0x3ae1('0x1b')];var _0x1a9761=_0x3d950e?_0x117200[_0x3ae1('0x1e')]:_0x115565[_0x3ae1('0x1b')]+_0x115565[_0x3ae1('0x1d')];var _0x2a252f;if(_0x1a9761>=_0x552048){_0x1a9761=_0x552048;_0x2a252f=0xc8;}else{_0x2a252f=0xce;}_0x47fc02[_0x3ae1('0x19')](_0x2a252f);return _0x47fc02['set'](_0x3ae1('0x1f'),_0x384e77+'-'+_0x1a9761+'/'+_0x552048)[_0x3ae1('0x20')](_0x117200);}return null;};}function patchUpdates(_0x3dcddf){return function(_0xd3b31e){try{jsonpatch[_0x3ae1('0x21')](_0xd3b31e,_0x3dcddf,!![]);}catch(_0x22233e){return BPromise[_0x3ae1('0x22')](_0x22233e);}return _0xd3b31e['save']();};}function saveUpdates(_0x18e57f,_0xbcac84){return function(_0x57ed52){if(_0x57ed52){return _0x57ed52['update'](_0x18e57f)[_0x3ae1('0x23')](function(_0x242e82){return _0x242e82;});}return null;};}function removeEntity(_0xa8304f,_0x4ae8a9){return function(_0x11a89e){if(_0x11a89e){return _0x11a89e['destroy']()[_0x3ae1('0x23')](function(){_0xa8304f[_0x3ae1('0x19')](0xcc)[_0x3ae1('0x1a')]();});}};}function handleEntityNotFound(_0x29baec,_0x334dcb){return function(_0x5339c4){if(!_0x5339c4){_0x29baec[_0x3ae1('0x18')](0x194);}return _0x5339c4;};}function handleError(_0x17aa58,_0xc2812f){_0xc2812f=_0xc2812f||0x1f4;return function(_0x5696b2){logger['error'](_0x5696b2[_0x3ae1('0x24')]);if(_0x5696b2[_0x3ae1('0x25')]){delete _0x5696b2['name'];}_0x17aa58[_0x3ae1('0x19')](_0xc2812f)[_0x3ae1('0x26')](_0x5696b2);};}exports[_0x3ae1('0x27')]=function(_0x2c4b76,_0x9f2ddc){var _0x57ca31={},_0x43be99={},_0x2d97ea={'count':0x0,'rows':[]};var _0x1100eb=_[_0x3ae1('0x28')](db[_0x3ae1('0x29')]['rawAttributes'],function(_0xfa7c15){return{'name':_0xfa7c15[_0x3ae1('0x2a')],'type':_0xfa7c15['type'][_0x3ae1('0x2b')]};});_0x43be99[_0x3ae1('0x2c')]=_[_0x3ae1('0x2d')](_[_0x3ae1('0x28')](_0x1100eb,'name'),[_0x3ae1('0x25')]);_0x43be99[_0x3ae1('0x2e')]=_['keys'](_0x2c4b76[_0x3ae1('0x2e')]);_0x43be99[_0x3ae1('0x2f')]=_[_0x3ae1('0x30')](_0x43be99[_0x3ae1('0x2c')],_0x43be99['query']);_0x57ca31[_0x3ae1('0x31')]=_[_0x3ae1('0x30')](_0x43be99[_0x3ae1('0x2c')],qs[_0x3ae1('0x32')](_0x2c4b76['query'][_0x3ae1('0x32')]));_0x57ca31[_0x3ae1('0x31')]=_0x57ca31[_0x3ae1('0x31')][_0x3ae1('0x33')]?_0x57ca31[_0x3ae1('0x31')]:_0x43be99['model'];if(!_0x2c4b76[_0x3ae1('0x2e')][_0x3ae1('0x34')](_0x3ae1('0x35'))){_0x57ca31[_0x3ae1('0x1d')]=qs[_0x3ae1('0x1d')](_0x2c4b76['query'][_0x3ae1('0x1d')]);_0x57ca31['offset']=qs[_0x3ae1('0x1b')](_0x2c4b76[_0x3ae1('0x2e')][_0x3ae1('0x1b')]);}_0x57ca31[_0x3ae1('0x36')]=qs[_0x3ae1('0x37')](_0x2c4b76[_0x3ae1('0x2e')][_0x3ae1('0x37')]);_0x57ca31[_0x3ae1('0x38')]=qs[_0x3ae1('0x2f')](_['pick'](_0x2c4b76[_0x3ae1('0x2e')],_0x43be99['filters']),_0x1100eb);if(_0x2c4b76[_0x3ae1('0x2e')][_0x3ae1('0x39')]){_0x57ca31[_0x3ae1('0x38')]=_[_0x3ae1('0x3a')](_0x57ca31[_0x3ae1('0x38')],{'$or':_['map'](_0x1100eb,function(_0x3ecd9c){if(_0x3ecd9c[_0x3ae1('0x3b')]!=='VIRTUAL'){var _0xef2235={};_0xef2235[_0x3ecd9c['name']]={'$like':'%'+_0x2c4b76[_0x3ae1('0x2e')]['filter']+'%'};return _0xef2235;}})});}_0x57ca31=_[_0x3ae1('0x3a')]({},_0x57ca31,_0x2c4b76[_0x3ae1('0x3c')]);var _0x3404a={'where':_0x57ca31[_0x3ae1('0x38')]};return db['VoiceMailMessage'][_0x3ae1('0x1e')](_0x3404a)[_0x3ae1('0x23')](function(_0x3a4926){_0x2d97ea['count']=_0x3a4926;if(_0x2c4b76['query'][_0x3ae1('0x3d')]){_0x57ca31['include']=[{'all':!![]}];}return db[_0x3ae1('0x29')][_0x3ae1('0x3e')](_0x57ca31);})[_0x3ae1('0x23')](function(_0x44c24a){_0x2d97ea[_0x3ae1('0x3f')]=_0x44c24a;return _0x2d97ea;})[_0x3ae1('0x23')](respondWithFilteredResult(_0x9f2ddc,_0x57ca31))[_0x3ae1('0x40')](handleError(_0x9f2ddc,null));};exports[_0x3ae1('0x41')]=function(_0x3f3ebd,_0xa828b8){var _0x903d1f={'raw':!![],'where':{'id':_0x3f3ebd[_0x3ae1('0x42')]['id']}},_0x262814={};_0x262814[_0x3ae1('0x2c')]=_[_0x3ae1('0x43')](db[_0x3ae1('0x29')][_0x3ae1('0x44')]);_0x262814[_0x3ae1('0x2e')]=_['keys'](_0x3f3ebd[_0x3ae1('0x2e')]);_0x262814[_0x3ae1('0x2f')]=_[_0x3ae1('0x30')](_0x262814[_0x3ae1('0x2c')],_0x262814[_0x3ae1('0x2e')]);_0x903d1f['attributes']=_[_0x3ae1('0x30')](_0x262814[_0x3ae1('0x2c')],qs[_0x3ae1('0x32')](_0x3f3ebd[_0x3ae1('0x2e')][_0x3ae1('0x32')]));_0x903d1f[_0x3ae1('0x31')]=_0x903d1f[_0x3ae1('0x31')][_0x3ae1('0x33')]?_0x903d1f[_0x3ae1('0x31')]:_0x262814[_0x3ae1('0x2c')];if(_0x3f3ebd[_0x3ae1('0x2e')][_0x3ae1('0x3d')]){_0x903d1f[_0x3ae1('0x45')]=[{'all':!![]}];}_0x903d1f=_[_0x3ae1('0x3a')]({},_0x903d1f,_0x3f3ebd['options']);return db[_0x3ae1('0x29')][_0x3ae1('0x46')](_0x903d1f)[_0x3ae1('0x23')](handleEntityNotFound(_0xa828b8,null))['then'](respondWithResult(_0xa828b8,null))[_0x3ae1('0x40')](handleError(_0xa828b8,null));};exports[_0x3ae1('0x47')]=function(_0x4df2bc,_0xde7b12){return db[_0x3ae1('0x29')][_0x3ae1('0x47')](_0x4df2bc[_0x3ae1('0x48')],{})[_0x3ae1('0x23')](respondWithResult(_0xde7b12,0xc9))[_0x3ae1('0x40')](handleError(_0xde7b12,null));};exports[_0x3ae1('0x49')]=function(_0x35f2ff,_0x36edf){if(_0x35f2ff[_0x3ae1('0x48')]['id']){delete _0x35f2ff['body']['id'];}return db[_0x3ae1('0x29')]['find']({'where':{'id':_0x35f2ff['params']['id']}})[_0x3ae1('0x23')](handleEntityNotFound(_0x36edf,null))[_0x3ae1('0x23')](saveUpdates(_0x35f2ff[_0x3ae1('0x48')],null))[_0x3ae1('0x23')](respondWithResult(_0x36edf,null))[_0x3ae1('0x40')](handleError(_0x36edf,null));};exports['destroy']=function(_0x5a14d7,_0x19e71b){return db['VoiceMailMessage'][_0x3ae1('0x46')]({'where':{'id':_0x5a14d7[_0x3ae1('0x42')]['id']}})[_0x3ae1('0x23')](handleEntityNotFound(_0x19e71b,null))[_0x3ae1('0x23')](removeEntity(_0x19e71b,null))[_0x3ae1('0x40')](handleError(_0x19e71b,null));};exports['download']=function(_0x33de75,_0x28dccd,_0xf61469){return db[_0x3ae1('0x29')][_0x3ae1('0x46')]({'where':{'id':_0x33de75[_0x3ae1('0x42')]['id']},'attributes':['id',_0x3ae1('0x4a'),_0x3ae1('0x4b')]})['then'](handleEntityNotFound(_0x28dccd,null))[_0x3ae1('0x23')](function(_0x27c992){if(_0x27c992){if(!_0x27c992[_0x3ae1('0x4a')]){throw new db[(_0x3ae1('0x4c'))][(_0x3ae1('0x4d'))](_0x3ae1('0x4e'));}var _0x36f9ce={'Content-Type':_0x3ae1('0x4f'),'Content-Disposition':_0x3ae1('0x50')};if(_0x27c992['msg_id']){_0x36f9ce[_0x3ae1('0x51')]=_0x3ae1('0x52')+_0x27c992[_0x3ae1('0x4b')]+_0x3ae1('0x53');}_0x28dccd[_0x3ae1('0x54')](_0x36f9ce);return _0x28dccd[_0x3ae1('0x26')](new Buffer(_0x27c992[_0x3ae1('0x4a')]));}})[_0x3ae1('0x40')](handleError(_0x28dccd,null));};
\ No newline at end of file
+var _0x36bc=['attachment;\x20filename=\x22','.wav\x22','recording','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','sendStatus','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','download','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition'];(function(_0x18690e,_0x3d2ae2){var _0x1ab666=function(_0x553b4e){while(--_0x553b4e){_0x18690e['push'](_0x18690e['shift']());}};_0x1ab666(++_0x3d2ae2);}(_0x36bc,0x102));var _0xc36b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x36bc[_0x433a86];return _0x23000c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc36b('0x0'));var zipdir=require(_0xc36b('0x1'));var jsonpatch=require(_0xc36b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc36b('0x3'));var Mustache=require(_0xc36b('0x4'));var util=require(_0xc36b('0x5'));var path=require(_0xc36b('0x6'));var sox=require('sox');var csv=require(_0xc36b('0x7'));var ejs=require(_0xc36b('0x8'));var fs=require('fs');var fs_extra=require(_0xc36b('0x9'));var _=require('lodash');var squel=require(_0xc36b('0xa'));var crypto=require('crypto');var jsforce=require(_0xc36b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc36b('0x7'));var querystring=require(_0xc36b('0xc'));var Papa=require(_0xc36b('0xd'));var Redis=require(_0xc36b('0xe'));var authService=require(_0xc36b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc36b('0x10'));var hardwareService=require(_0xc36b('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xc36b('0x12'));var config=require(_0xc36b('0x13'));var licenseUtil=require(_0xc36b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496da8,_0x2a0c60){_0x2a0c60=_0x2a0c60||0xcc;return function(_0x2118d6){if(_0x2118d6){return _0x496da8['sendStatus'](_0x2a0c60);}return _0x496da8[_0xc36b('0x15')](_0x2a0c60)[_0xc36b('0x16')]();};}function respondWithResult(_0x33385,_0xecffbe){_0xecffbe=_0xecffbe||0xc8;return function(_0x3cfd64){if(_0x3cfd64){return _0x33385['status'](_0xecffbe)[_0xc36b('0x17')](_0x3cfd64);}};}function respondWithFilteredResult(_0x40eee3,_0x548edd){return function(_0x45bee3){if(_0x45bee3){var _0x47b019=typeof _0x548edd[_0xc36b('0x18')]==='undefined'&&typeof _0x548edd[_0xc36b('0x19')]===_0xc36b('0x1a');var _0x3c7ec9=_0x45bee3[_0xc36b('0x1b')];var _0x299233=_0x47b019?0x0:_0x548edd[_0xc36b('0x18')];var _0x1a5048=_0x47b019?_0x45bee3[_0xc36b('0x1b')]:_0x548edd['offset']+_0x548edd[_0xc36b('0x19')];var _0x57cfda;if(_0x1a5048>=_0x3c7ec9){_0x1a5048=_0x3c7ec9;_0x57cfda=0xc8;}else{_0x57cfda=0xce;}_0x40eee3[_0xc36b('0x15')](_0x57cfda);return _0x40eee3[_0xc36b('0x1c')](_0xc36b('0x1d'),_0x299233+'-'+_0x1a5048+'/'+_0x3c7ec9)[_0xc36b('0x17')](_0x45bee3);}return null;};}function patchUpdates(_0x214aa4){return function(_0x5f4690){try{jsonpatch['apply'](_0x5f4690,_0x214aa4,!![]);}catch(_0x4b56c5){return BPromise['reject'](_0x4b56c5);}return _0x5f4690[_0xc36b('0x1e')]();};}function saveUpdates(_0x30337c,_0x26e93f){return function(_0x25a758){if(_0x25a758){return _0x25a758[_0xc36b('0x1f')](_0x30337c)[_0xc36b('0x20')](function(_0x226949){return _0x226949;});}return null;};}function removeEntity(_0x1f46f0,_0x430121){return function(_0x32990f){if(_0x32990f){return _0x32990f[_0xc36b('0x21')]()[_0xc36b('0x20')](function(){_0x1f46f0[_0xc36b('0x15')](0xcc)[_0xc36b('0x16')]();});}};}function handleEntityNotFound(_0x3e7197,_0x1035ba){return function(_0x198a80){if(!_0x198a80){_0x3e7197[_0xc36b('0x22')](0x194);}return _0x198a80;};}function handleError(_0x4378e3,_0x24d176){_0x24d176=_0x24d176||0x1f4;return function(_0x28a599){logger[_0xc36b('0x23')](_0x28a599['stack']);if(_0x28a599[_0xc36b('0x24')]){delete _0x28a599['name'];}_0x4378e3[_0xc36b('0x15')](_0x24d176)[_0xc36b('0x25')](_0x28a599);};}exports[_0xc36b('0x26')]=function(_0x32c2db,_0x50fa07){var _0x7fb464={},_0xa98d86={},_0x4afb7b={'count':0x0,'rows':[]};var _0x43a04d=_[_0xc36b('0x27')](db[_0xc36b('0x28')][_0xc36b('0x29')],function(_0x53e3e7){return{'name':_0x53e3e7[_0xc36b('0x2a')],'type':_0x53e3e7[_0xc36b('0x2b')][_0xc36b('0x2c')]};});_0xa98d86[_0xc36b('0x2d')]=_[_0xc36b('0x2e')](_[_0xc36b('0x27')](_0x43a04d,_0xc36b('0x24')),['name']);_0xa98d86[_0xc36b('0x2f')]=_[_0xc36b('0x30')](_0x32c2db[_0xc36b('0x2f')]);_0xa98d86[_0xc36b('0x31')]=_[_0xc36b('0x32')](_0xa98d86['model'],_0xa98d86[_0xc36b('0x2f')]);_0x7fb464[_0xc36b('0x33')]=_['intersection'](_0xa98d86['model'],qs[_0xc36b('0x34')](_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x34')]));_0x7fb464[_0xc36b('0x33')]=_0x7fb464[_0xc36b('0x33')]['length']?_0x7fb464['attributes']:_0xa98d86[_0xc36b('0x2d')];if(!_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x35')](_0xc36b('0x36'))){_0x7fb464['limit']=qs[_0xc36b('0x19')](_0x32c2db[_0xc36b('0x2f')]['limit']);_0x7fb464[_0xc36b('0x18')]=qs[_0xc36b('0x18')](_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x18')]);}_0x7fb464[_0xc36b('0x37')]=qs[_0xc36b('0x38')](_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x38')]);_0x7fb464[_0xc36b('0x39')]=qs[_0xc36b('0x31')](_[_0xc36b('0x3a')](_0x32c2db['query'],_0xa98d86[_0xc36b('0x31')]),_0x43a04d);if(_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x3b')]){_0x7fb464[_0xc36b('0x39')]=_[_0xc36b('0x3c')](_0x7fb464[_0xc36b('0x39')],{'$or':_[_0xc36b('0x27')](_0x43a04d,function(_0x22ca45){if(_0x22ca45['type']!==_0xc36b('0x3d')){var _0x5cf1a6={};_0x5cf1a6[_0x22ca45['name']]={'$like':'%'+_0x32c2db['query'][_0xc36b('0x3b')]+'%'};return _0x5cf1a6;}})});}_0x7fb464=_[_0xc36b('0x3c')]({},_0x7fb464,_0x32c2db[_0xc36b('0x3e')]);var _0x43eff1={'where':_0x7fb464[_0xc36b('0x39')]};return db['VoiceMailMessage'][_0xc36b('0x1b')](_0x43eff1)[_0xc36b('0x20')](function(_0x129b98){_0x4afb7b[_0xc36b('0x1b')]=_0x129b98;if(_0x32c2db['query'][_0xc36b('0x3f')]){_0x7fb464[_0xc36b('0x40')]=[{'all':!![]}];}return db[_0xc36b('0x28')][_0xc36b('0x41')](_0x7fb464);})['then'](function(_0x12b9f5){_0x4afb7b[_0xc36b('0x42')]=_0x12b9f5;return _0x4afb7b;})[_0xc36b('0x20')](respondWithFilteredResult(_0x50fa07,_0x7fb464))[_0xc36b('0x43')](handleError(_0x50fa07,null));};exports[_0xc36b('0x44')]=function(_0xf24dd0,_0x154bc7){var _0x21fbca={'raw':!![],'where':{'id':_0xf24dd0['params']['id']}},_0x5edcc9={};_0x5edcc9[_0xc36b('0x2d')]=_['keys'](db[_0xc36b('0x28')][_0xc36b('0x29')]);_0x5edcc9[_0xc36b('0x2f')]=_[_0xc36b('0x30')](_0xf24dd0[_0xc36b('0x2f')]);_0x5edcc9[_0xc36b('0x31')]=_['intersection'](_0x5edcc9[_0xc36b('0x2d')],_0x5edcc9['query']);_0x21fbca[_0xc36b('0x33')]=_[_0xc36b('0x32')](_0x5edcc9[_0xc36b('0x2d')],qs[_0xc36b('0x34')](_0xf24dd0[_0xc36b('0x2f')]['fields']));_0x21fbca['attributes']=_0x21fbca[_0xc36b('0x33')][_0xc36b('0x45')]?_0x21fbca['attributes']:_0x5edcc9[_0xc36b('0x2d')];if(_0xf24dd0[_0xc36b('0x2f')]['includeAll']){_0x21fbca['include']=[{'all':!![]}];}_0x21fbca=_[_0xc36b('0x3c')]({},_0x21fbca,_0xf24dd0[_0xc36b('0x3e')]);return db['VoiceMailMessage']['find'](_0x21fbca)[_0xc36b('0x20')](handleEntityNotFound(_0x154bc7,null))[_0xc36b('0x20')](respondWithResult(_0x154bc7,null))['catch'](handleError(_0x154bc7,null));};exports[_0xc36b('0x46')]=function(_0x79a02b,_0x3be462){return db[_0xc36b('0x28')][_0xc36b('0x46')](_0x79a02b['body'],{})[_0xc36b('0x20')](respondWithResult(_0x3be462,0xc9))[_0xc36b('0x43')](handleError(_0x3be462,null));};exports[_0xc36b('0x1f')]=function(_0x45a115,_0x3ac047){if(_0x45a115[_0xc36b('0x47')]['id']){delete _0x45a115[_0xc36b('0x47')]['id'];}return db[_0xc36b('0x28')][_0xc36b('0x48')]({'where':{'id':_0x45a115[_0xc36b('0x49')]['id']}})[_0xc36b('0x20')](handleEntityNotFound(_0x3ac047,null))['then'](saveUpdates(_0x45a115['body'],null))[_0xc36b('0x20')](respondWithResult(_0x3ac047,null))['catch'](handleError(_0x3ac047,null));};exports[_0xc36b('0x21')]=function(_0xc83a0f,_0x2d8879){return db[_0xc36b('0x28')][_0xc36b('0x48')]({'where':{'id':_0xc83a0f[_0xc36b('0x49')]['id']}})[_0xc36b('0x20')](handleEntityNotFound(_0x2d8879,null))[_0xc36b('0x20')](removeEntity(_0x2d8879,null))[_0xc36b('0x43')](handleError(_0x2d8879,null));};exports[_0xc36b('0x4a')]=function(_0x5946ef,_0x3ca286,_0x376386){return db[_0xc36b('0x28')]['find']({'where':{'id':_0x5946ef[_0xc36b('0x49')]['id']},'attributes':['id','recording',_0xc36b('0x4b')]})[_0xc36b('0x20')](handleEntityNotFound(_0x3ca286,null))[_0xc36b('0x20')](function(_0x1dc139){if(_0x1dc139){if(!_0x1dc139['recording']){throw new db[(_0xc36b('0x4c'))][(_0xc36b('0x4d'))](_0xc36b('0x4e'));}var _0x33f507={'Content-Type':_0xc36b('0x4f'),'Content-Disposition':_0xc36b('0x50')};if(_0x1dc139[_0xc36b('0x4b')]){_0x33f507[_0xc36b('0x51')]=_0xc36b('0x52')+_0x1dc139[_0xc36b('0x4b')]+_0xc36b('0x53');}_0x3ca286[_0xc36b('0x1c')](_0x33f507);return _0x3ca286[_0xc36b('0x25')](new Buffer(_0x1dc139[_0xc36b('0x54')]));}})[_0xc36b('0x43')](handleError(_0x3ca286,null));};
\ No newline at end of file
index 3d5a4a8..5defd37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ad6=['request-promise','path','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','api','bluebird'];(function(_0x343e89,_0x4183df){var _0x48c93a=function(_0x4abfe7){while(--_0x4abfe7){_0x343e89['push'](_0x343e89['shift']());}};_0x48c93a(++_0x4183df);}(_0x8ad6,0x104));var _0x68ad=function(_0x4fd09f,_0x2ee9a6){_0x4fd09f=_0x4fd09f-0x0;var _0x1969ad=_0x8ad6[_0x4fd09f];return _0x1969ad;};'use strict';var _=require(_0x68ad('0x0'));var util=require(_0x68ad('0x1'));var logger=require('../../config/logger')(_0x68ad('0x2'));var moment=require('moment');var BPromise=require(_0x68ad('0x3'));var rp=require(_0x68ad('0x4'));var fs=require('fs');var path=require(_0x68ad('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x68ad('0x6'));module[_0x68ad('0x7')]=function(_0x2acc85,_0x45e65d){return _0x2acc85[_0x68ad('0x8')](_0x68ad('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x68ad('0xa'),'fields':[_0x68ad('0xa')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x0ac1=['api','moment','bluebird','request-promise','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ac1,0x167));var _0x10ac=function(_0x562a05,_0x12c841){_0x562a05=_0x562a05-0x0;var _0x28ceb5=_0x0ac1[_0x562a05];return _0x28ceb5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x10ac('0x0'))(_0x10ac('0x1'));var moment=require(_0x10ac('0x2'));var BPromise=require(_0x10ac('0x3'));var rp=require(_0x10ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x10ac('0x5'));var attributes=require(_0x10ac('0x6'));module[_0x10ac('0x7')]=function(_0x36847b,_0x5bffb1){return _0x36847b[_0x10ac('0x8')](_0x10ac('0x9'),attributes,{'tableName':_0x10ac('0xa'),'paranoid':![],'indexes':[{'name':_0x10ac('0xb'),'fields':[_0x10ac('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index a20d22e..82a4d3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c10=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x3c10,0x135));var _0x03c1=function(_0xde9378,_0x221ed6){_0xde9378=_0xde9378-0x0;var _0x29d898=_0x3c10[_0xde9378];return _0x29d898;};'use strict';var _=require(_0x03c1('0x0'));var util=require(_0x03c1('0x1'));var moment=require(_0x03c1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03c1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x03c1('0x4'))('rpc');var config=require(_0x03c1('0x5'));var jayson=require(_0x03c1('0x6'));var client=jayson[_0x03c1('0x7')][_0x03c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37cf89,_0x5464a8,_0x434d85){return new BPromise(function(_0x40c711,_0x39f8a6){return client[_0x03c1('0x9')](_0x37cf89,_0x434d85)[_0x03c1('0xa')](function(_0x497a1e){logger[_0x03c1('0xb')](_0x03c1('0xc'),_0x5464a8,_0x03c1('0xd'));logger['debug'](_0x03c1('0xe'),_0x5464a8,_0x03c1('0xd'),JSON[_0x03c1('0xf')](_0x497a1e));if(_0x497a1e[_0x03c1('0x10')]){if(_0x497a1e['error']['code']===0x1f4){logger[_0x03c1('0x10')](_0x03c1('0xc'),_0x5464a8,_0x497a1e[_0x03c1('0x10')][_0x03c1('0x11')]);return _0x39f8a6(_0x497a1e[_0x03c1('0x10')][_0x03c1('0x11')]);}logger[_0x03c1('0x10')](_0x03c1('0xc'),_0x5464a8,_0x497a1e['error'][_0x03c1('0x11')]);return _0x40c711(_0x497a1e[_0x03c1('0x10')]['message']);}else{logger['info'](_0x03c1('0xc'),_0x5464a8,'request\x20sent');_0x40c711(_0x497a1e['result']['message']);}})[_0x03c1('0x12')](function(_0x43ef81){logger[_0x03c1('0x10')](_0x03c1('0xc'),_0x5464a8,_0x43ef81);_0x39f8a6(_0x43ef81);});});}
\ No newline at end of file
+var _0x02b0=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x3db644,_0x507cf7){var _0x122443=function(_0x4423ee){while(--_0x4423ee){_0x3db644['push'](_0x3db644['shift']());}};_0x122443(++_0x507cf7);}(_0x02b0,0x78));var _0x002b=function(_0x43265b,_0x2eeb96){_0x43265b=_0x43265b-0x0;var _0xdc3c7b=_0x02b0[_0x43265b];return _0xdc3c7b;};'use strict';var _=require('lodash');var util=require(_0x002b('0x0'));var moment=require(_0x002b('0x1'));var BPromise=require('bluebird');var rs=require(_0x002b('0x2'));var fs=require('fs');var Redis=require(_0x002b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x002b('0x4'));var logger=require(_0x002b('0x5'))('rpc');var config=require(_0x002b('0x6'));var jayson=require(_0x002b('0x7'));var client=jayson[_0x002b('0x8')][_0x002b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25b39b,_0x356c29,_0x489856){return new BPromise(function(_0x2e5f09,_0x15789c){return client[_0x002b('0xa')](_0x25b39b,_0x489856)[_0x002b('0xb')](function(_0x449ac4){logger['info'](_0x002b('0xc'),_0x356c29,_0x002b('0xd'));logger[_0x002b('0xe')](_0x002b('0xf'),_0x356c29,_0x002b('0xd'),JSON['stringify'](_0x449ac4));if(_0x449ac4[_0x002b('0x10')]){if(_0x449ac4[_0x002b('0x10')][_0x002b('0x11')]===0x1f4){logger[_0x002b('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x356c29,_0x449ac4[_0x002b('0x10')]['message']);return _0x15789c(_0x449ac4[_0x002b('0x10')][_0x002b('0x12')]);}logger[_0x002b('0x10')](_0x002b('0xc'),_0x356c29,_0x449ac4[_0x002b('0x10')][_0x002b('0x12')]);return _0x2e5f09(_0x449ac4['error'][_0x002b('0x12')]);}else{logger[_0x002b('0x13')](_0x002b('0xc'),_0x356c29,_0x002b('0xd'));_0x2e5f09(_0x449ac4['result'][_0x002b('0x12')]);}})['catch'](function(_0x5e2eb9){logger[_0x002b('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x356c29,_0x5e2eb9);_0x15789c(_0x5e2eb9);});});}
\ No newline at end of file
index e39d261..4d7f4a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x695d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','multer'];(function(_0x476114,_0x5eef52){var _0x5c3fa3=function(_0x47e6e2){while(--_0x47e6e2){_0x476114['push'](_0x476114['shift']());}};_0x5c3fa3(++_0x5eef52);}(_0x695d,0x103));var _0xd695=function(_0x569f5f,_0x1c6c5c){_0x569f5f=_0x569f5f-0x0;var _0x3e8e2e=_0x695d[_0x569f5f];return _0x3e8e2e;};'use strict';var multer=require(_0xd695('0x0'));var util=require('util');var path=require(_0xd695('0x1'));var timeout=require(_0xd695('0x2'));var express=require(_0xd695('0x3'));var router=express[_0xd695('0x4')]();var fs_extra=require(_0xd695('0x5'));var auth=require(_0xd695('0x6'));var interaction=require(_0xd695('0x7'));var config=require(_0xd695('0x8'));var controller=require(_0xd695('0x9'));router[_0xd695('0xa')]('/',auth['isAuthenticated'](),controller[_0xd695('0xb')]);router['get'](_0xd695('0xc'),auth[_0xd695('0xd')](),controller[_0xd695('0xe')]);router[_0xd695('0xa')](_0xd695('0xf'),auth[_0xd695('0xd')](),controller[_0xd695('0x10')]);router[_0xd695('0x11')]('/',auth[_0xd695('0xd')](),controller[_0xd695('0x12')]);router[_0xd695('0x11')]('/:id/sounds',auth[_0xd695('0xd')](),controller[_0xd695('0x13')]);router[_0xd695('0x14')](_0xd695('0xc'),auth[_0xd695('0xd')](),controller[_0xd695('0x15')]);router[_0xd695('0x16')]('/:id',auth[_0xd695('0xd')](),controller[_0xd695('0x17')]);router['delete'](_0xd695('0x18'),auth['isAuthenticated'](),controller['removeSound']);module[_0xd695('0x19')]=router;
\ No newline at end of file
+var _0x77d7=['get','isAuthenticated','/:id','getSounds','post','create','/:id/sounds','addSound','update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller'];(function(_0x29fd7b,_0x160cdc){var _0x1ed0c5=function(_0x311363){while(--_0x311363){_0x29fd7b['push'](_0x29fd7b['shift']());}};_0x1ed0c5(++_0x160cdc);}(_0x77d7,0x1f0));var _0x777d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x77d7[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x777d('0x0'));var util=require(_0x777d('0x1'));var path=require(_0x777d('0x2'));var timeout=require(_0x777d('0x3'));var express=require(_0x777d('0x4'));var router=express[_0x777d('0x5')]();var fs_extra=require(_0x777d('0x6'));var auth=require(_0x777d('0x7'));var interaction=require(_0x777d('0x8'));var config=require('../../config/environment');var controller=require(_0x777d('0x9'));router[_0x777d('0xa')]('/',auth[_0x777d('0xb')](),controller['index']);router[_0x777d('0xa')](_0x777d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x777d('0xa')]('/:id/sounds',auth[_0x777d('0xb')](),controller[_0x777d('0xd')]);router[_0x777d('0xe')]('/',auth['isAuthenticated'](),controller[_0x777d('0xf')]);router[_0x777d('0xe')](_0x777d('0x10'),auth[_0x777d('0xb')](),controller[_0x777d('0x11')]);router['put']('/:id',auth[_0x777d('0xb')](),controller[_0x777d('0x12')]);router[_0x777d('0x13')]('/:id',auth[_0x777d('0xb')](),controller[_0x777d('0x14')]);router[_0x777d('0x13')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x777d('0x15')]);module[_0x777d('0x16')]=router;
\ No newline at end of file
index e9c9ba5..3103037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bbf=['mp3','files','TIMESTAMP','sequelize','STRING','name','custom','mp3nb','quietmp3nb','quietmp3'];(function(_0x3dfdca,_0x437134){var _0x50eb07=function(_0x3ce1af){while(--_0x3ce1af){_0x3dfdca['push'](_0x3dfdca['shift']());}};_0x50eb07(++_0x437134);}(_0x9bbf,0x1cf));var _0xf9bb=function(_0x3ef5da,_0x20d571){_0x3ef5da=_0x3ef5da-0x0;var _0x16ea3a=_0x9bbf[_0x3ef5da];return _0x16ea3a;};'use strict';var Sequelize=require(_0xf9bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xf9bb('0x1')],'allowNull':![],'unique':_0xf9bb('0x2')},'mode':{'type':Sequelize['ENUM'](_0xf9bb('0x3'),'files',_0xf9bb('0x4'),_0xf9bb('0x5'),_0xf9bb('0x6'),_0xf9bb('0x7')),'allowNull':!![],'defaultValue':_0xf9bb('0x8')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xf9bb('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf9bb('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xf9bb('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb99d=['STRING','name','ENUM','custom','files','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb99d,0xc5));var _0xdb99=function(_0x46b2bd,_0x84a2bb){_0x46b2bd=_0x46b2bd-0x0;var _0x232dab=_0xb99d[_0x46b2bd];return _0x232dab;};'use strict';var Sequelize=require(_0xdb99('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb99('0x1')],'allowNull':![],'unique':_0xdb99('0x2')},'mode':{'type':Sequelize[_0xdb99('0x3')](_0xdb99('0x4'),'files','mp3nb','quietmp3nb','quietmp3','mp3'),'allowNull':!![],'defaultValue':_0xdb99('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xdb99('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xdb99('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xdb99('0x1')],'allowNull':!![],'defaultValue':_0xdb99('0x6')},'format':{'type':Sequelize[_0xdb99('0x1')],'allowNull':!![]},'stamp':{'type':_0xdb99('0x7')},'defaultEntry':{'type':Sequelize[_0xdb99('0x8')],'defaultValue':0x0}};
\ No newline at end of file
index 6d43dd1..67c4262 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf261=['Content-Range','apply','reject','update','destroy','then','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','body','create','sequelize','mode','files','join','root','server/files/moh','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','format','%s.%s','basename','extname','symlinkSync','removeSound','findOne','id2','getSounds','order','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set'];(function(_0x22df00,_0x35d945){var _0x471f1e=function(_0x411694){while(--_0x411694){_0x22df00['push'](_0x22df00['shift']());}};_0x471f1e(++_0x35d945);}(_0xf261,0x1b0));var _0x1f26=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf261[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x1f26('0x0'));var rimraf=require(_0x1f26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f26('0x2'));var rp=require(_0x1f26('0x3'));var moment=require(_0x1f26('0x4'));var BPromise=require(_0x1f26('0x5'));var Mustache=require(_0x1f26('0x6'));var util=require(_0x1f26('0x7'));var path=require(_0x1f26('0x8'));var sox=require(_0x1f26('0x9'));var csv=require(_0x1f26('0xa'));var ejs=require(_0x1f26('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f26('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1f26('0xd'));var toCsv=require(_0x1f26('0xa'));var querystring=require(_0x1f26('0xe'));var Papa=require(_0x1f26('0xf'));var Redis=require(_0x1f26('0x10'));var authService=require(_0x1f26('0x11'));var qs=require(_0x1f26('0x12'));var as=require(_0x1f26('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f26('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1f26('0x15'));var licenseUtil=require(_0x1f26('0x16'));var db=require(_0x1f26('0x17'))['db'];function respondWithStatusCode(_0xe06bfc,_0x3ef6c7){_0x3ef6c7=_0x3ef6c7||0xcc;return function(_0x3b20ae){if(_0x3b20ae){return _0xe06bfc['sendStatus'](_0x3ef6c7);}return _0xe06bfc[_0x1f26('0x18')](_0x3ef6c7)[_0x1f26('0x19')]();};}function respondWithResult(_0x20cbc0,_0x5c961a){_0x5c961a=_0x5c961a||0xc8;return function(_0x15e461){if(_0x15e461){return _0x20cbc0['status'](_0x5c961a)[_0x1f26('0x1a')](_0x15e461);}};}function respondWithFilteredResult(_0x1d2938,_0x3f506b){return function(_0x5092b5){if(_0x5092b5){var _0x2360b5=typeof _0x3f506b[_0x1f26('0x1b')]==='undefined'&&typeof _0x3f506b[_0x1f26('0x1c')]===_0x1f26('0x1d');var _0x56e3e1=_0x5092b5[_0x1f26('0x1e')];var _0xc85a27=_0x2360b5?0x0:_0x3f506b[_0x1f26('0x1b')];var _0x44e898=_0x2360b5?_0x5092b5[_0x1f26('0x1e')]:_0x3f506b['offset']+_0x3f506b[_0x1f26('0x1c')];var _0x5533dc;if(_0x44e898>=_0x56e3e1){_0x44e898=_0x56e3e1;_0x5533dc=0xc8;}else{_0x5533dc=0xce;}_0x1d2938[_0x1f26('0x18')](_0x5533dc);return _0x1d2938[_0x1f26('0x1f')](_0x1f26('0x20'),_0xc85a27+'-'+_0x44e898+'/'+_0x56e3e1)[_0x1f26('0x1a')](_0x5092b5);}return null;};}function patchUpdates(_0x5aa228){return function(_0x35098a){try{jsonpatch[_0x1f26('0x21')](_0x35098a,_0x5aa228,!![]);}catch(_0x22ad05){return BPromise[_0x1f26('0x22')](_0x22ad05);}return _0x35098a['save']();};}function saveUpdates(_0x3b0e28,_0x1ad037){return function(_0x130f77){if(_0x130f77){return _0x130f77[_0x1f26('0x23')](_0x3b0e28)['then'](function(_0x52e09b){return _0x52e09b;});}return null;};}function removeEntity(_0x24b97b,_0x4c0f46){return function(_0x1d6766){if(_0x1d6766){return _0x1d6766[_0x1f26('0x24')]()[_0x1f26('0x25')](function(){var _0x580d9a=_0x1d6766[_0x1f26('0x26')]({'plain':!![]});var _0x440e8=_0x1f26('0x27');return db[_0x1f26('0x28')]['destroy']({'where':{'type':_0x440e8,'resourceId':_0x580d9a['id']}})[_0x1f26('0x25')](function(){return _0x1d6766;});})[_0x1f26('0x25')](function(){_0x24b97b[_0x1f26('0x18')](0xcc)[_0x1f26('0x19')]();});}};}function handleEntityNotFound(_0x35eff4,_0xfc1041){return function(_0x3a7ef0){if(!_0x3a7ef0){_0x35eff4[_0x1f26('0x29')](0x194);}return _0x3a7ef0;};}function handleError(_0xfd31f7,_0xeef494){_0xeef494=_0xeef494||0x1f4;return function(_0x5b8b7b){logger[_0x1f26('0x2a')](_0x5b8b7b[_0x1f26('0x2b')]);if(_0x5b8b7b[_0x1f26('0x2c')]){delete _0x5b8b7b['name'];}_0xfd31f7[_0x1f26('0x18')](_0xeef494)[_0x1f26('0x2d')](_0x5b8b7b);};}exports[_0x1f26('0x2e')]=function(_0x48ea5d,_0x4f864f){var _0x150579={},_0x2b9474={},_0x1a78f3={'count':0x0,'rows':[]};var _0x5d0d32=_['map'](db[_0x1f26('0x2f')][_0x1f26('0x30')],function(_0x535599){return{'name':_0x535599[_0x1f26('0x31')],'type':_0x535599[_0x1f26('0x32')][_0x1f26('0x33')]};});_0x2b9474[_0x1f26('0x34')]=_[_0x1f26('0x35')](_0x5d0d32,'name');_0x2b9474['query']=_[_0x1f26('0x36')](_0x48ea5d['query']);_0x2b9474[_0x1f26('0x37')]=_['intersection'](_0x2b9474[_0x1f26('0x34')],_0x2b9474[_0x1f26('0x38')]);_0x150579['attributes']=_[_0x1f26('0x39')](_0x2b9474['model'],qs[_0x1f26('0x3a')](_0x48ea5d[_0x1f26('0x38')][_0x1f26('0x3a')]));_0x150579[_0x1f26('0x3b')]=_0x150579[_0x1f26('0x3b')][_0x1f26('0x3c')]?_0x150579['attributes']:_0x2b9474['model'];if(!_0x48ea5d[_0x1f26('0x38')][_0x1f26('0x3d')]('nolimit')){_0x150579[_0x1f26('0x1c')]=qs[_0x1f26('0x1c')](_0x48ea5d[_0x1f26('0x38')][_0x1f26('0x1c')]);_0x150579[_0x1f26('0x1b')]=qs[_0x1f26('0x1b')](_0x48ea5d[_0x1f26('0x38')][_0x1f26('0x1b')]);}_0x150579['order']=qs['sort'](_0x48ea5d[_0x1f26('0x38')][_0x1f26('0x3e')]);delete _0x48ea5d['query'][_0x1f26('0x3e')];_0x150579[_0x1f26('0x3f')]=qs['filters'](_[_0x1f26('0x40')](_0x48ea5d['query'],_0x2b9474[_0x1f26('0x37')]),_0x5d0d32);if(_0x48ea5d[_0x1f26('0x38')][_0x1f26('0x41')]){_0x150579['where']=_[_0x1f26('0x42')](_0x150579[_0x1f26('0x3f')],{'$or':_['map'](_0x5d0d32,function(_0xe7746e){if(_0xe7746e['type']!==_0x1f26('0x43')){var _0xd13c97={};_0xd13c97[_0xe7746e['name']]={'$like':'%'+_0x48ea5d[_0x1f26('0x38')]['filter']+'%'};return _0xd13c97;}})});}_0x150579=_['merge']({},_0x150579,_0x48ea5d[_0x1f26('0x44')]);var _0x5ec540={'where':_0x150579[_0x1f26('0x3f')]};return db[_0x1f26('0x2f')]['count'](_0x5ec540)[_0x1f26('0x25')](function(_0xee497f){_0x1a78f3['count']=_0xee497f;if(_0x48ea5d[_0x1f26('0x38')]['includeAll']){_0x150579[_0x1f26('0x45')]=[{'all':!![]}];}return db[_0x1f26('0x2f')]['findAll'](_0x150579);})[_0x1f26('0x25')](function(_0x3f6c7d){_0x1a78f3[_0x1f26('0x46')]=_0x3f6c7d;return _0x1a78f3;})[_0x1f26('0x25')](respondWithFilteredResult(_0x4f864f,_0x150579))[_0x1f26('0x47')](handleError(_0x4f864f,null));};exports[_0x1f26('0x48')]=function(_0x3e4fb5,_0x5b3f47){var _0x4d54a9={'raw':![],'where':{'id':_0x3e4fb5[_0x1f26('0x49')]['id']}},_0x2017be={};_0x2017be[_0x1f26('0x34')]=_[_0x1f26('0x36')](db[_0x1f26('0x2f')]['rawAttributes']);_0x2017be[_0x1f26('0x38')]=_[_0x1f26('0x36')](_0x3e4fb5[_0x1f26('0x38')]);_0x2017be[_0x1f26('0x37')]=_[_0x1f26('0x39')](_0x2017be[_0x1f26('0x34')],_0x2017be['query']);_0x4d54a9['attributes']=_['intersection'](_0x2017be['model'],qs[_0x1f26('0x3a')](_0x3e4fb5[_0x1f26('0x38')][_0x1f26('0x3a')]));_0x4d54a9[_0x1f26('0x3b')]=_0x4d54a9[_0x1f26('0x3b')]['length']?_0x4d54a9['attributes']:_0x2017be[_0x1f26('0x34')];if(_0x3e4fb5[_0x1f26('0x38')][_0x1f26('0x4a')]){_0x4d54a9[_0x1f26('0x45')]=[{'all':!![]}];}_0x4d54a9=_[_0x1f26('0x42')]({},_0x4d54a9,_0x3e4fb5[_0x1f26('0x44')]);return db['VoiceMusicOnHold'][_0x1f26('0x4b')](_0x4d54a9)['then'](handleEntityNotFound(_0x5b3f47,null))[_0x1f26('0x25')](respondWithResult(_0x5b3f47,null))[_0x1f26('0x47')](handleError(_0x5b3f47,null));};exports['update']=function(_0x4e4689,_0x39c54a){if(_0x4e4689['body']['id']){delete _0x4e4689[_0x1f26('0x4c')]['id'];}return db[_0x1f26('0x2f')][_0x1f26('0x4b')]({'where':{'id':_0x4e4689[_0x1f26('0x49')]['id']}})[_0x1f26('0x25')](handleEntityNotFound(_0x39c54a,null))[_0x1f26('0x25')](saveUpdates(_0x4e4689['body'],null))['then'](respondWithResult(_0x39c54a,null))[_0x1f26('0x47')](handleError(_0x39c54a,null));};exports[_0x1f26('0x4d')]=function(_0x1a1837,_0x1db0cb,_0x3a5c1f){return db[_0x1f26('0x4e')]['transaction'](function(_0x20553e){if(_0x1a1837['body'][_0x1f26('0x4f')]===_0x1f26('0x50')){_0x1a1837[_0x1f26('0x4c')]['directory']=path[_0x1f26('0x51')](config[_0x1f26('0x52')],_0x1f26('0x53'),_0x1a1837['body'][_0x1f26('0x2c')]);}return db[_0x1f26('0x2f')][_0x1f26('0x4d')](_0x1a1837[_0x1f26('0x4c')],{'transaction':_0x20553e})[_0x1f26('0x25')](function(_0x1ed6ed){if(_0x1a1837[_0x1f26('0x4c')][_0x1f26('0x4f')]===_0x1f26('0x50')){fs[_0x1f26('0x54')](_0x1ed6ed[_0x1f26('0x55')],parseInt(_0x1f26('0x56'),0x8));}var _0x229bd5=_0x1a1837[_0x1f26('0x57')][_0x1f26('0x26')]({'plain':!![]});if(!_0x229bd5)throw new Error(_0x1f26('0x58'));if(_0x229bd5[_0x1f26('0x59')]===_0x1f26('0x57')){var _0x3e3589=_0x1ed6ed[_0x1f26('0x26')]({'plain':!![]});return db[_0x1f26('0x5a')]['find']({'where':{'name':_0x1f26('0x27'),'userProfileId':_0x229bd5[_0x1f26('0x5b')]},'raw':!![]})[_0x1f26('0x25')](function(_0x29b643){if(_0x29b643&&_0x29b643[_0x1f26('0x5c')]===0x0){return db[_0x1f26('0x28')][_0x1f26('0x4d')]({'name':_0x3e3589[_0x1f26('0x2c')],'resourceId':_0x3e3589['id'],'type':_0x29b643['name'],'sectionId':_0x29b643['id']},{})[_0x1f26('0x25')](function(){return _0x1ed6ed;});}else{return _0x1ed6ed;}})['catch'](function(_0x2f70b9){logger[_0x1f26('0x2a')](_0x1f26('0x5d'),_0x2f70b9);});}return _0x1ed6ed;});})[_0x1f26('0x25')](respondWithResult(_0x1db0cb,0xc9))[_0x1f26('0x47')](handleError(_0x1db0cb,null));};exports['destroy']=function(_0x1e4d6b,_0xfe359e,_0x49b70d){var _0x1175c7;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x1e4d6b['params']['id']}})[_0x1f26('0x25')](function(_0x6a4529){if(_0x6a4529){return db[_0x1f26('0x4e')][_0x1f26('0x5e')](function(_0x2f6028){return _0x6a4529[_0x1f26('0x24')]({'transaction':_0x2f6028,'raw':!![]})[_0x1f26('0x25')](function(_0x964696){if(_0x964696['directory']){fs['readdirSync'](_0x964696[_0x1f26('0x55')])[_0x1f26('0x5f')](function(_0x352a38){fs['unlinkSync'](path[_0x1f26('0x51')](_0x964696[_0x1f26('0x55')],_0x352a38));});fs[_0x1f26('0x60')](_0x964696['directory']);}return _0x964696;});})[_0x1f26('0x47')](function(_0x3f2605){throw new db[(_0x1f26('0x61'))][(_0x1f26('0x62'))](_0x3f2605[_0x1f26('0x63')]);});}})[_0x1f26('0x25')](handleEntityNotFound(_0xfe359e,null))[_0x1f26('0x25')](removeEntity(_0xfe359e,null))[_0x1f26('0x47')](handleError(_0xfe359e,null));};exports[_0x1f26('0x64')]=function(_0x2759d4,_0x1fa33f,_0x310af8){return db[_0x1f26('0x4e')]['transaction'](function(_0x36afa5){var _0x459986;return db['VoiceMusicOnHold'][_0x1f26('0x4b')]({'where':{'id':_0x2759d4['params']['id']}})[_0x1f26('0x25')](function(_0x5dd5d5){if(_0x5dd5d5){_0x459986=_0x5dd5d5;return _0x5dd5d5[_0x1f26('0x64')](_0x2759d4[_0x1f26('0x4c')]['id'],{'transaction':_0x36afa5});}})['then'](function(_0x324ec9){if(_0x324ec9){return db[_0x1f26('0x65')]['findOne']({'where':{'id':_0x2759d4['body']['id']},'attributes':['id',_0x1f26('0x2c'),_0x1f26('0x66'),_0x1f26('0x67'),_0x1f26('0x68')],'raw':!![]});}})['then'](function(_0x5ea3da){if(_0x5ea3da){var _0x4ef177=path[_0x1f26('0x51')](config[_0x1f26('0x52')],'server/files/sounds/converted',util[_0x1f26('0x69')](_0x1f26('0x6a'),path[_0x1f26('0x6b')](_0x5ea3da[_0x1f26('0x66')],path[_0x1f26('0x6c')](_0x5ea3da[_0x1f26('0x66')])),_0x5ea3da[_0x1f26('0x67')]));var _0x594270=path[_0x1f26('0x51')](config[_0x1f26('0x52')],_0x1f26('0x53'),_0x459986['name'],util[_0x1f26('0x69')]('%s.%s',_0x5ea3da[_0x1f26('0x2c')],_0x5ea3da[_0x1f26('0x67')]));fs[_0x1f26('0x6d')](_0x4ef177,_0x594270);return _0x5ea3da;}})[_0x1f26('0x47')](function(_0x40b492){throw new db[(_0x1f26('0x61'))]['ValidationError'](_0x40b492[_0x1f26('0x63')]);});})[_0x1f26('0x25')](handleEntityNotFound(_0x1fa33f,null))['then'](respondWithResult(_0x1fa33f,0xc9))[_0x1f26('0x47')](handleError(_0x1fa33f,null));};exports[_0x1f26('0x6e')]=function(_0x31051b,_0x583aa1,_0x14b08f){return db[_0x1f26('0x4e')][_0x1f26('0x5e')](function(_0x35bb56){var _0x1ddf39;return db[_0x1f26('0x2f')][_0x1f26('0x6f')]({'where':{'id':_0x31051b[_0x1f26('0x49')]['id']}})[_0x1f26('0x25')](handleEntityNotFound(_0x583aa1,null))[_0x1f26('0x25')](function(_0x1283c0){if(_0x1283c0){_0x1ddf39=_0x1283c0;return _0x1283c0[_0x1f26('0x6e')](_0x31051b['params'][_0x1f26('0x70')]);}})[_0x1f26('0x25')](function(_0x415bc4){if(_0x415bc4){return db[_0x1f26('0x65')]['findOne']({'where':{'id':_0x31051b[_0x1f26('0x49')][_0x1f26('0x70')]},'attributes':['id','name',_0x1f26('0x66'),_0x1f26('0x67'),_0x1f26('0x68')],'raw':!![]});}})[_0x1f26('0x25')](function(_0x5ad5b6){if(_0x5ad5b6){fs['unlinkSync'](path[_0x1f26('0x51')](_0x1ddf39[_0x1f26('0x55')],util[_0x1f26('0x69')](_0x1f26('0x6a'),_0x5ad5b6['name'],_0x5ad5b6[_0x1f26('0x67')])));return _0x5ad5b6;}})[_0x1f26('0x47')](function(_0xdeea11){throw new db[(_0x1f26('0x61'))]['ValidationError'](_0xdeea11[_0x1f26('0x63')]);});})[_0x1f26('0x25')](handleEntityNotFound(_0x583aa1,null))[_0x1f26('0x25')](respondWithStatusCode(_0x583aa1,0xcc))[_0x1f26('0x47')](handleError(_0x583aa1,null));};exports[_0x1f26('0x71')]=function(_0x3c7004,_0x42ae64,_0x5dd900){var _0x660f4={};var _0x2f271c={};var _0x1414e1;var _0x102d15;return db['VoiceMusicOnHold'][_0x1f26('0x6f')]({'where':{'id':_0x3c7004[_0x1f26('0x49')]['id']}})[_0x1f26('0x25')](handleEntityNotFound(_0x42ae64,null))[_0x1f26('0x25')](function(_0x30cd03){if(_0x30cd03){_0x1414e1=_0x30cd03;_0x2f271c[_0x1f26('0x34')]=_[_0x1f26('0x36')](db['Sound'][_0x1f26('0x30')]);_0x2f271c[_0x1f26('0x38')]=_[_0x1f26('0x36')](_0x3c7004[_0x1f26('0x38')]);_0x2f271c[_0x1f26('0x37')]=_[_0x1f26('0x39')](_0x2f271c[_0x1f26('0x34')],_0x2f271c['query']);_0x660f4[_0x1f26('0x3b')]=_['intersection'](_0x2f271c[_0x1f26('0x34')],qs[_0x1f26('0x3a')](_0x3c7004[_0x1f26('0x38')]['fields']));_0x660f4['attributes']=_0x660f4[_0x1f26('0x3b')][_0x1f26('0x3c')]?_0x660f4[_0x1f26('0x3b')]:_0x2f271c['model'];_0x660f4[_0x1f26('0x72')]=qs['sort'](_0x3c7004['query'][_0x1f26('0x3e')]);_0x660f4[_0x1f26('0x3f')]=qs[_0x1f26('0x37')](_[_0x1f26('0x40')](_0x3c7004[_0x1f26('0x38')],_0x2f271c['filters']));if(_0x3c7004[_0x1f26('0x38')]['filter']){_0x660f4[_0x1f26('0x3f')]=_[_0x1f26('0x42')](_0x660f4[_0x1f26('0x3f')],{'$or':_[_0x1f26('0x35')](_0x660f4[_0x1f26('0x3b')],function(_0x5dc59f){var _0x4db61b={};_0x4db61b[_0x5dc59f]={'$like':'%'+_0x3c7004[_0x1f26('0x38')][_0x1f26('0x41')]+'%'};return _0x4db61b;})});}_0x660f4=_['merge']({},_0x660f4,_0x3c7004[_0x1f26('0x44')]);return _0x1414e1['getSounds'](_0x660f4);}})[_0x1f26('0x25')](function(_0x5099fb){if(_0x5099fb){_0x102d15=_0x5099fb[_0x1f26('0x3c')];if(!_0x3c7004[_0x1f26('0x38')][_0x1f26('0x3d')](_0x1f26('0x73'))){_0x660f4[_0x1f26('0x1c')]=qs[_0x1f26('0x1c')](_0x3c7004[_0x1f26('0x38')]['limit']);_0x660f4[_0x1f26('0x1b')]=qs[_0x1f26('0x1b')](_0x3c7004[_0x1f26('0x38')][_0x1f26('0x1b')]);}return _0x1414e1[_0x1f26('0x71')](_0x660f4);}})['then'](function(_0x2d9fbe){if(_0x2d9fbe){return _0x2d9fbe?{'count':_0x102d15,'rows':_0x2d9fbe}:null;}})[_0x1f26('0x25')](respondWithResult(_0x42ae64,null))[_0x1f26('0x47')](handleError(_0x42ae64,null));};
\ No newline at end of file
+var _0xaa11=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','extname','format','symlinkSync','removeSound','findOne','id2','getSounds','order','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','update','then','destroy','UserProfileResource','end','error','stack','name','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','rows','show','params','find','catch','body','create','transaction','mode','files','directory','root','server/files/moh','mkdirSync','0777','user'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xaa11,0x1db));var _0x1aa1=function(_0xbfc7c0,_0xdc38ce){_0xbfc7c0=_0xbfc7c0-0x0;var _0x180870=_0xaa11[_0xbfc7c0];return _0x180870;};'use strict';var emlformat=require(_0x1aa1('0x0'));var rimraf=require(_0x1aa1('0x1'));var zipdir=require(_0x1aa1('0x2'));var jsonpatch=require(_0x1aa1('0x3'));var rp=require(_0x1aa1('0x4'));var moment=require('moment');var BPromise=require(_0x1aa1('0x5'));var Mustache=require(_0x1aa1('0x6'));var util=require(_0x1aa1('0x7'));var path=require(_0x1aa1('0x8'));var sox=require(_0x1aa1('0x9'));var csv=require(_0x1aa1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1aa1('0xb'));var _=require(_0x1aa1('0xc'));var squel=require('squel');var crypto=require(_0x1aa1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1aa1('0xe'));var toCsv=require(_0x1aa1('0xa'));var querystring=require(_0x1aa1('0xf'));var Papa=require(_0x1aa1('0x10'));var Redis=require('ioredis');var authService=require(_0x1aa1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1aa1('0x12'));var logger=require(_0x1aa1('0x13'))(_0x1aa1('0x14'));var utils=require(_0x1aa1('0x15'));var config=require(_0x1aa1('0x16'));var licenseUtil=require(_0x1aa1('0x17'));var db=require(_0x1aa1('0x18'))['db'];function respondWithStatusCode(_0x3a0253,_0x4f37b5){_0x4f37b5=_0x4f37b5||0xcc;return function(_0x1945a4){if(_0x1945a4){return _0x3a0253[_0x1aa1('0x19')](_0x4f37b5);}return _0x3a0253[_0x1aa1('0x1a')](_0x4f37b5)['end']();};}function respondWithResult(_0x2e8d4e,_0x4b785d){_0x4b785d=_0x4b785d||0xc8;return function(_0x367ed1){if(_0x367ed1){return _0x2e8d4e[_0x1aa1('0x1a')](_0x4b785d)[_0x1aa1('0x1b')](_0x367ed1);}};}function respondWithFilteredResult(_0x40bdd2,_0x295873){return function(_0x5ea8be){if(_0x5ea8be){var _0x54e1a0=typeof _0x295873[_0x1aa1('0x1c')]===_0x1aa1('0x1d')&&typeof _0x295873[_0x1aa1('0x1e')]===_0x1aa1('0x1d');var _0x44c369=_0x5ea8be[_0x1aa1('0x1f')];var _0x3dfc82=_0x54e1a0?0x0:_0x295873[_0x1aa1('0x1c')];var _0x281a54=_0x54e1a0?_0x5ea8be['count']:_0x295873[_0x1aa1('0x1c')]+_0x295873[_0x1aa1('0x1e')];var _0x484cba;if(_0x281a54>=_0x44c369){_0x281a54=_0x44c369;_0x484cba=0xc8;}else{_0x484cba=0xce;}_0x40bdd2[_0x1aa1('0x1a')](_0x484cba);return _0x40bdd2['set']('Content-Range',_0x3dfc82+'-'+_0x281a54+'/'+_0x44c369)[_0x1aa1('0x1b')](_0x5ea8be);}return null;};}function patchUpdates(_0x3c9fbc){return function(_0xf01b30){try{jsonpatch['apply'](_0xf01b30,_0x3c9fbc,!![]);}catch(_0x239894){return BPromise[_0x1aa1('0x20')](_0x239894);}return _0xf01b30['save']();};}function saveUpdates(_0x55ca67,_0x426e36){return function(_0x16912f){if(_0x16912f){return _0x16912f[_0x1aa1('0x21')](_0x55ca67)[_0x1aa1('0x22')](function(_0x3c98ab){return _0x3c98ab;});}return null;};}function removeEntity(_0x1390f3,_0x4ad556){return function(_0x3e47bc){if(_0x3e47bc){return _0x3e47bc[_0x1aa1('0x23')]()[_0x1aa1('0x22')](function(){var _0x46fddb=_0x3e47bc['get']({'plain':!![]});var _0x482981='MusicOnHolds';return db[_0x1aa1('0x24')][_0x1aa1('0x23')]({'where':{'type':_0x482981,'resourceId':_0x46fddb['id']}})['then'](function(){return _0x3e47bc;});})['then'](function(){_0x1390f3[_0x1aa1('0x1a')](0xcc)[_0x1aa1('0x25')]();});}};}function handleEntityNotFound(_0x4a77c3,_0x362c7b){return function(_0x481c20){if(!_0x481c20){_0x4a77c3[_0x1aa1('0x19')](0x194);}return _0x481c20;};}function handleError(_0x30d77,_0x3570d3){_0x3570d3=_0x3570d3||0x1f4;return function(_0x563f76){logger[_0x1aa1('0x26')](_0x563f76[_0x1aa1('0x27')]);if(_0x563f76[_0x1aa1('0x28')]){delete _0x563f76[_0x1aa1('0x28')];}_0x30d77[_0x1aa1('0x1a')](_0x3570d3)['send'](_0x563f76);};}exports['index']=function(_0xbf0722,_0x3518aa){var _0x5bff11={},_0x53eb42={},_0x44a20a={'count':0x0,'rows':[]};var _0x34cb54=_['map'](db[_0x1aa1('0x29')][_0x1aa1('0x2a')],function(_0x5d9694){return{'name':_0x5d9694[_0x1aa1('0x2b')],'type':_0x5d9694[_0x1aa1('0x2c')][_0x1aa1('0x2d')]};});_0x53eb42[_0x1aa1('0x2e')]=_[_0x1aa1('0x2f')](_0x34cb54,'name');_0x53eb42[_0x1aa1('0x30')]=_[_0x1aa1('0x31')](_0xbf0722[_0x1aa1('0x30')]);_0x53eb42[_0x1aa1('0x32')]=_[_0x1aa1('0x33')](_0x53eb42[_0x1aa1('0x2e')],_0x53eb42[_0x1aa1('0x30')]);_0x5bff11['attributes']=_[_0x1aa1('0x33')](_0x53eb42[_0x1aa1('0x2e')],qs[_0x1aa1('0x34')](_0xbf0722[_0x1aa1('0x30')]['fields']));_0x5bff11['attributes']=_0x5bff11[_0x1aa1('0x35')][_0x1aa1('0x36')]?_0x5bff11[_0x1aa1('0x35')]:_0x53eb42[_0x1aa1('0x2e')];if(!_0xbf0722[_0x1aa1('0x30')][_0x1aa1('0x37')](_0x1aa1('0x38'))){_0x5bff11[_0x1aa1('0x1e')]=qs[_0x1aa1('0x1e')](_0xbf0722['query'][_0x1aa1('0x1e')]);_0x5bff11[_0x1aa1('0x1c')]=qs['offset'](_0xbf0722[_0x1aa1('0x30')][_0x1aa1('0x1c')]);}_0x5bff11['order']=qs[_0x1aa1('0x39')](_0xbf0722['query']['sort']);delete _0xbf0722[_0x1aa1('0x30')][_0x1aa1('0x39')];_0x5bff11[_0x1aa1('0x3a')]=qs['filters'](_[_0x1aa1('0x3b')](_0xbf0722[_0x1aa1('0x30')],_0x53eb42['filters']),_0x34cb54);if(_0xbf0722[_0x1aa1('0x30')]['filter']){_0x5bff11[_0x1aa1('0x3a')]=_['merge'](_0x5bff11[_0x1aa1('0x3a')],{'$or':_[_0x1aa1('0x2f')](_0x34cb54,function(_0x40e997){if(_0x40e997['type']!=='VIRTUAL'){var _0x3ffaa7={};_0x3ffaa7[_0x40e997[_0x1aa1('0x28')]]={'$like':'%'+_0xbf0722[_0x1aa1('0x30')]['filter']+'%'};return _0x3ffaa7;}})});}_0x5bff11=_[_0x1aa1('0x3c')]({},_0x5bff11,_0xbf0722[_0x1aa1('0x3d')]);var _0x24dde8={'where':_0x5bff11['where']};return db[_0x1aa1('0x29')][_0x1aa1('0x1f')](_0x24dde8)[_0x1aa1('0x22')](function(_0x104170){_0x44a20a[_0x1aa1('0x1f')]=_0x104170;if(_0xbf0722[_0x1aa1('0x30')][_0x1aa1('0x3e')]){_0x5bff11[_0x1aa1('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x5bff11);})[_0x1aa1('0x22')](function(_0x15065b){_0x44a20a[_0x1aa1('0x40')]=_0x15065b;return _0x44a20a;})[_0x1aa1('0x22')](respondWithFilteredResult(_0x3518aa,_0x5bff11))['catch'](handleError(_0x3518aa,null));};exports[_0x1aa1('0x41')]=function(_0x54008d,_0x59ce68){var _0x1edc36={'raw':![],'where':{'id':_0x54008d[_0x1aa1('0x42')]['id']}},_0x3a6a9e={};_0x3a6a9e[_0x1aa1('0x2e')]=_[_0x1aa1('0x31')](db[_0x1aa1('0x29')][_0x1aa1('0x2a')]);_0x3a6a9e['query']=_['keys'](_0x54008d[_0x1aa1('0x30')]);_0x3a6a9e['filters']=_[_0x1aa1('0x33')](_0x3a6a9e[_0x1aa1('0x2e')],_0x3a6a9e['query']);_0x1edc36[_0x1aa1('0x35')]=_['intersection'](_0x3a6a9e[_0x1aa1('0x2e')],qs[_0x1aa1('0x34')](_0x54008d[_0x1aa1('0x30')][_0x1aa1('0x34')]));_0x1edc36['attributes']=_0x1edc36[_0x1aa1('0x35')][_0x1aa1('0x36')]?_0x1edc36['attributes']:_0x3a6a9e[_0x1aa1('0x2e')];if(_0x54008d[_0x1aa1('0x30')][_0x1aa1('0x3e')]){_0x1edc36[_0x1aa1('0x3f')]=[{'all':!![]}];}_0x1edc36=_[_0x1aa1('0x3c')]({},_0x1edc36,_0x54008d['options']);return db[_0x1aa1('0x29')][_0x1aa1('0x43')](_0x1edc36)[_0x1aa1('0x22')](handleEntityNotFound(_0x59ce68,null))[_0x1aa1('0x22')](respondWithResult(_0x59ce68,null))[_0x1aa1('0x44')](handleError(_0x59ce68,null));};exports[_0x1aa1('0x21')]=function(_0x35d1a1,_0x2a4a5a){if(_0x35d1a1['body']['id']){delete _0x35d1a1[_0x1aa1('0x45')]['id'];}return db['VoiceMusicOnHold'][_0x1aa1('0x43')]({'where':{'id':_0x35d1a1[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](handleEntityNotFound(_0x2a4a5a,null))[_0x1aa1('0x22')](saveUpdates(_0x35d1a1[_0x1aa1('0x45')],null))[_0x1aa1('0x22')](respondWithResult(_0x2a4a5a,null))['catch'](handleError(_0x2a4a5a,null));};exports[_0x1aa1('0x46')]=function(_0x3320a2,_0x304bf7,_0x5b2c61){return db['sequelize'][_0x1aa1('0x47')](function(_0x34a5f5){if(_0x3320a2[_0x1aa1('0x45')][_0x1aa1('0x48')]===_0x1aa1('0x49')){_0x3320a2[_0x1aa1('0x45')][_0x1aa1('0x4a')]=path['join'](config[_0x1aa1('0x4b')],_0x1aa1('0x4c'),_0x3320a2[_0x1aa1('0x45')]['name']);}return db[_0x1aa1('0x29')][_0x1aa1('0x46')](_0x3320a2['body'],{'transaction':_0x34a5f5})[_0x1aa1('0x22')](function(_0x197fbe){if(_0x3320a2[_0x1aa1('0x45')][_0x1aa1('0x48')]==='files'){fs[_0x1aa1('0x4d')](_0x197fbe['directory'],parseInt(_0x1aa1('0x4e'),0x8));}var _0x1b7721=_0x3320a2[_0x1aa1('0x4f')][_0x1aa1('0x50')]({'plain':!![]});if(!_0x1b7721)throw new Error(_0x1aa1('0x51'));if(_0x1b7721[_0x1aa1('0x52')]===_0x1aa1('0x4f')){var _0x2500ab=_0x197fbe[_0x1aa1('0x50')]({'plain':!![]});return db['UserProfileSection'][_0x1aa1('0x43')]({'where':{'name':_0x1aa1('0x53'),'userProfileId':_0x1b7721[_0x1aa1('0x54')]},'raw':!![]})[_0x1aa1('0x22')](function(_0x1fdaa3){if(_0x1fdaa3&&_0x1fdaa3['autoAssociation']===0x0){return db[_0x1aa1('0x24')][_0x1aa1('0x46')]({'name':_0x2500ab[_0x1aa1('0x28')],'resourceId':_0x2500ab['id'],'type':_0x1fdaa3[_0x1aa1('0x28')],'sectionId':_0x1fdaa3['id']},{})['then'](function(){return _0x197fbe;});}else{return _0x197fbe;}})[_0x1aa1('0x44')](function(_0x1f8354){logger[_0x1aa1('0x26')](_0x1aa1('0x55'),_0x1f8354);});}return _0x197fbe;});})[_0x1aa1('0x22')](respondWithResult(_0x304bf7,0xc9))[_0x1aa1('0x44')](handleError(_0x304bf7,null));};exports['destroy']=function(_0x173600,_0x3f3a4c,_0xef35f3){var _0x43ce9c;return db[_0x1aa1('0x29')][_0x1aa1('0x43')]({'where':{'id':_0x173600[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](function(_0x1e4aee){if(_0x1e4aee){return db[_0x1aa1('0x56')][_0x1aa1('0x47')](function(_0x358d1a){return _0x1e4aee[_0x1aa1('0x23')]({'transaction':_0x358d1a,'raw':!![]})[_0x1aa1('0x22')](function(_0x2686af){if(_0x2686af[_0x1aa1('0x4a')]){fs[_0x1aa1('0x57')](_0x2686af[_0x1aa1('0x4a')])[_0x1aa1('0x58')](function(_0x390ecf){fs[_0x1aa1('0x59')](path[_0x1aa1('0x5a')](_0x2686af['directory'],_0x390ecf));});fs[_0x1aa1('0x5b')](_0x2686af['directory']);}return _0x2686af;});})[_0x1aa1('0x44')](function(_0x2e47a8){throw new db[(_0x1aa1('0x5c'))][(_0x1aa1('0x5d'))](_0x2e47a8[_0x1aa1('0x5e')]);});}})[_0x1aa1('0x22')](handleEntityNotFound(_0x3f3a4c,null))[_0x1aa1('0x22')](removeEntity(_0x3f3a4c,null))[_0x1aa1('0x44')](handleError(_0x3f3a4c,null));};exports[_0x1aa1('0x5f')]=function(_0x14a038,_0x4ef6b6,_0x5a3d33){return db[_0x1aa1('0x56')]['transaction'](function(_0x355f33){var _0xc397da;return db[_0x1aa1('0x29')]['find']({'where':{'id':_0x14a038[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](function(_0x1d69e5){if(_0x1d69e5){_0xc397da=_0x1d69e5;return _0x1d69e5[_0x1aa1('0x5f')](_0x14a038[_0x1aa1('0x45')]['id'],{'transaction':_0x355f33});}})[_0x1aa1('0x22')](function(_0x35f0cf){if(_0x35f0cf){return db[_0x1aa1('0x60')]['findOne']({'where':{'id':_0x14a038[_0x1aa1('0x45')]['id']},'attributes':['id',_0x1aa1('0x28'),_0x1aa1('0x61'),_0x1aa1('0x62'),_0x1aa1('0x63')],'raw':!![]});}})[_0x1aa1('0x22')](function(_0x38a161){if(_0x38a161){var _0x10310c=path[_0x1aa1('0x5a')](config[_0x1aa1('0x4b')],_0x1aa1('0x64'),util['format'](_0x1aa1('0x65'),path['basename'](_0x38a161[_0x1aa1('0x61')],path[_0x1aa1('0x66')](_0x38a161[_0x1aa1('0x61')])),_0x38a161[_0x1aa1('0x62')]));var _0x38aa7e=path[_0x1aa1('0x5a')](config['root'],_0x1aa1('0x4c'),_0xc397da[_0x1aa1('0x28')],util[_0x1aa1('0x67')](_0x1aa1('0x65'),_0x38a161[_0x1aa1('0x28')],_0x38a161[_0x1aa1('0x62')]));fs[_0x1aa1('0x68')](_0x10310c,_0x38aa7e);return _0x38a161;}})[_0x1aa1('0x44')](function(_0x2def81){throw new db[(_0x1aa1('0x5c'))][(_0x1aa1('0x5d'))](_0x2def81['message']);});})[_0x1aa1('0x22')](handleEntityNotFound(_0x4ef6b6,null))[_0x1aa1('0x22')](respondWithResult(_0x4ef6b6,0xc9))[_0x1aa1('0x44')](handleError(_0x4ef6b6,null));};exports[_0x1aa1('0x69')]=function(_0x433019,_0x358382,_0x5bae90){return db['sequelize'][_0x1aa1('0x47')](function(_0x53986b){var _0xb36b4d;return db[_0x1aa1('0x29')][_0x1aa1('0x6a')]({'where':{'id':_0x433019[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](handleEntityNotFound(_0x358382,null))['then'](function(_0x46c22a){if(_0x46c22a){_0xb36b4d=_0x46c22a;return _0x46c22a['removeSound'](_0x433019[_0x1aa1('0x42')][_0x1aa1('0x6b')]);}})[_0x1aa1('0x22')](function(_0x5c5ee3){if(_0x5c5ee3){return db['Sound'][_0x1aa1('0x6a')]({'where':{'id':_0x433019[_0x1aa1('0x42')]['id2']},'attributes':['id','name','save_name',_0x1aa1('0x62'),_0x1aa1('0x63')],'raw':!![]});}})['then'](function(_0x3a88a2){if(_0x3a88a2){fs[_0x1aa1('0x59')](path[_0x1aa1('0x5a')](_0xb36b4d[_0x1aa1('0x4a')],util['format'](_0x1aa1('0x65'),_0x3a88a2[_0x1aa1('0x28')],_0x3a88a2['converted_format'])));return _0x3a88a2;}})[_0x1aa1('0x44')](function(_0x123358){throw new db[(_0x1aa1('0x5c'))][(_0x1aa1('0x5d'))](_0x123358[_0x1aa1('0x5e')]);});})[_0x1aa1('0x22')](handleEntityNotFound(_0x358382,null))[_0x1aa1('0x22')](respondWithStatusCode(_0x358382,0xcc))[_0x1aa1('0x44')](handleError(_0x358382,null));};exports[_0x1aa1('0x6c')]=function(_0x43c58b,_0xaf1e8b,_0x1d04de){var _0x4789ba={};var _0x49303c={};var _0x4fb24d;var _0x42950c;return db[_0x1aa1('0x29')][_0x1aa1('0x6a')]({'where':{'id':_0x43c58b[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](handleEntityNotFound(_0xaf1e8b,null))[_0x1aa1('0x22')](function(_0x41686c){if(_0x41686c){_0x4fb24d=_0x41686c;_0x49303c['model']=_[_0x1aa1('0x31')](db[_0x1aa1('0x60')]['rawAttributes']);_0x49303c[_0x1aa1('0x30')]=_[_0x1aa1('0x31')](_0x43c58b[_0x1aa1('0x30')]);_0x49303c[_0x1aa1('0x32')]=_[_0x1aa1('0x33')](_0x49303c[_0x1aa1('0x2e')],_0x49303c[_0x1aa1('0x30')]);_0x4789ba[_0x1aa1('0x35')]=_[_0x1aa1('0x33')](_0x49303c[_0x1aa1('0x2e')],qs['fields'](_0x43c58b[_0x1aa1('0x30')]['fields']));_0x4789ba[_0x1aa1('0x35')]=_0x4789ba['attributes']['length']?_0x4789ba[_0x1aa1('0x35')]:_0x49303c[_0x1aa1('0x2e')];_0x4789ba[_0x1aa1('0x6d')]=qs['sort'](_0x43c58b['query']['sort']);_0x4789ba[_0x1aa1('0x3a')]=qs[_0x1aa1('0x32')](_[_0x1aa1('0x3b')](_0x43c58b[_0x1aa1('0x30')],_0x49303c['filters']));if(_0x43c58b[_0x1aa1('0x30')][_0x1aa1('0x6e')]){_0x4789ba['where']=_[_0x1aa1('0x3c')](_0x4789ba[_0x1aa1('0x3a')],{'$or':_[_0x1aa1('0x2f')](_0x4789ba[_0x1aa1('0x35')],function(_0x260e13){var _0x2c2ac7={};_0x2c2ac7[_0x260e13]={'$like':'%'+_0x43c58b[_0x1aa1('0x30')]['filter']+'%'};return _0x2c2ac7;})});}_0x4789ba=_[_0x1aa1('0x3c')]({},_0x4789ba,_0x43c58b[_0x1aa1('0x3d')]);return _0x4fb24d[_0x1aa1('0x6c')](_0x4789ba);}})['then'](function(_0xa90087){if(_0xa90087){_0x42950c=_0xa90087[_0x1aa1('0x36')];if(!_0x43c58b['query']['hasOwnProperty'](_0x1aa1('0x38'))){_0x4789ba[_0x1aa1('0x1e')]=qs[_0x1aa1('0x1e')](_0x43c58b[_0x1aa1('0x30')][_0x1aa1('0x1e')]);_0x4789ba['offset']=qs[_0x1aa1('0x1c')](_0x43c58b[_0x1aa1('0x30')][_0x1aa1('0x1c')]);}return _0x4fb24d[_0x1aa1('0x6c')](_0x4789ba);}})[_0x1aa1('0x22')](function(_0x373dcc){if(_0x373dcc){return _0x373dcc?{'count':_0x42950c,'rows':_0x373dcc}:null;}})['then'](respondWithResult(_0xaf1e8b,null))[_0x1aa1('0x44')](handleError(_0xaf1e8b,null));};
\ No newline at end of file
index c9dba8e..b245429 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d50=['define','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x1d4b04,_0x24d309){var _0x67d764=function(_0x11d40a){while(--_0x11d40a){_0x1d4b04['push'](_0x1d4b04['shift']());}};_0x67d764(++_0x24d309);}(_0x7d50,0x146));var _0x07d5=function(_0x1f9c99,_0x9666ef){_0x1f9c99=_0x1f9c99-0x0;var _0x3f89ec=_0x7d50[_0x1f9c99];return _0x3f89ec;};'use strict';var _=require(_0x07d5('0x0'));var util=require(_0x07d5('0x1'));var logger=require(_0x07d5('0x2'))(_0x07d5('0x3'));var moment=require(_0x07d5('0x4'));var BPromise=require(_0x07d5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07d5('0x6'));var rimraf=require(_0x07d5('0x7'));var config=require(_0x07d5('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x07d5('0x9')]=function(_0x44f18b,_0x56724c){return _0x44f18b[_0x07d5('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x07d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3bd1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0xa92c7c,_0xee1c51){var _0x5ba7e7=function(_0x5d7cd2){while(--_0x5d7cd2){_0xa92c7c['push'](_0xa92c7c['shift']());}};_0x5ba7e7(++_0xee1c51);}(_0x3bd1,0xc2));var _0x13bd=function(_0x34c8d0,_0x3347f3){_0x34c8d0=_0x34c8d0-0x0;var _0x1da282=_0x3bd1[_0x34c8d0];return _0x1da282;};'use strict';var _=require(_0x13bd('0x0'));var util=require(_0x13bd('0x1'));var logger=require(_0x13bd('0x2'))(_0x13bd('0x3'));var moment=require(_0x13bd('0x4'));var BPromise=require(_0x13bd('0x5'));var rp=require(_0x13bd('0x6'));var fs=require('fs');var path=require(_0x13bd('0x7'));var rimraf=require(_0x13bd('0x8'));var config=require(_0x13bd('0x9'));var attributes=require(_0x13bd('0xa'));module[_0x13bd('0xb')]=function(_0x1b09f8,_0x3ceeb6){return _0x1b09f8['define'](_0x13bd('0xc'),attributes,{'tableName':_0x13bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4051af3..b9e1818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x1c85d2,_0x55d998){var _0x12a371=function(_0x1619bf){while(--_0x1619bf){_0x1c85d2['push'](_0x1c85d2['shift']());}};_0x12a371(++_0x55d998);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'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
+var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x294aef,_0x378f98){var _0x4d235d=function(_0x105d6c){while(--_0x105d6c){_0x294aef['push'](_0x294aef['shift']());}};_0x4d235d(++_0x378f98);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a5e3c,_0x2f7543){_0x3a5e3c=_0x3a5e3c-0x0;var _0x5cb998=_0xedd9[_0x3a5e3c];return _0x5cb998;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
index 08a38ef..ec25c77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d97=['./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','show','/:id/users','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','/:id','destroy','removeTeams','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2d97,0x1f1));var _0x72d9=function(_0x531bec,_0x5730cb){_0x531bec=_0x531bec-0x0;var _0x44c89b=_0x2d97[_0x531bec];return _0x44c89b;};'use strict';var multer=require('multer');var util=require(_0x72d9('0x0'));var path=require('path');var timeout=require(_0x72d9('0x1'));var express=require(_0x72d9('0x2'));var router=express['Router']();var fs_extra=require(_0x72d9('0x3'));var auth=require(_0x72d9('0x4'));var interaction=require(_0x72d9('0x5'));var config=require(_0x72d9('0x6'));var controller=require(_0x72d9('0x7'));router[_0x72d9('0x8')]('/',auth['isAuthenticated'](),controller[_0x72d9('0x9')]);router[_0x72d9('0x8')](_0x72d9('0xa'),auth[_0x72d9('0xb')](),controller[_0x72d9('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x72d9('0xd')]);router['get'](_0x72d9('0xe'),auth[_0x72d9('0xb')](),controller['getAgents']);router[_0x72d9('0x8')](_0x72d9('0xf'),auth[_0x72d9('0xb')](),controller[_0x72d9('0x10')]);router[_0x72d9('0x11')]('/',auth[_0x72d9('0xb')](),controller[_0x72d9('0x12')]);router['post'](_0x72d9('0xe'),auth['isAuthenticated'](),controller[_0x72d9('0x13')]);router[_0x72d9('0x11')](_0x72d9('0xf'),auth['isAuthenticated'](),controller[_0x72d9('0x14')]);router[_0x72d9('0x15')]('/:id',auth[_0x72d9('0xb')](),controller[_0x72d9('0x16')]);router[_0x72d9('0x17')](_0x72d9('0x18'),auth[_0x72d9('0xb')](),controller[_0x72d9('0x19')]);router[_0x72d9('0x17')]('/:id/users',auth[_0x72d9('0xb')](),controller['removeAgents']);router[_0x72d9('0x17')](_0x72d9('0xf'),auth[_0x72d9('0xb')](),controller[_0x72d9('0x1a')]);module[_0x72d9('0x1b')]=router;
\ No newline at end of file
+var _0xf0a2=['path','connect-timeout','express','fs-extra','../../components/auth/service','./voicePrefix.controller','isAuthenticated','get','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','addAgents','addTeams','put','update','delete','removeAgents','removeTeams','multer','util'];(function(_0x2de77c,_0x570143){var _0x434551=function(_0x1e6376){while(--_0x1e6376){_0x2de77c['push'](_0x2de77c['shift']());}};_0x434551(++_0x570143);}(_0xf0a2,0x1ca));var _0x2f0a=function(_0x5273ab,_0x209b87){_0x5273ab=_0x5273ab-0x0;var _0x544dfb=_0xf0a2[_0x5273ab];return _0x544dfb;};'use strict';var multer=require(_0x2f0a('0x0'));var util=require(_0x2f0a('0x1'));var path=require(_0x2f0a('0x2'));var timeout=require(_0x2f0a('0x3'));var express=require(_0x2f0a('0x4'));var router=express['Router']();var fs_extra=require(_0x2f0a('0x5'));var auth=require(_0x2f0a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f0a('0x7'));router['get']('/',auth[_0x2f0a('0x8')](),controller['index']);router[_0x2f0a('0x9')]('/describe',auth[_0x2f0a('0x8')](),controller['describe']);router[_0x2f0a('0x9')](_0x2f0a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x2f0a('0x9')](_0x2f0a('0xb'),auth[_0x2f0a('0x8')](),controller[_0x2f0a('0xc')]);router[_0x2f0a('0x9')](_0x2f0a('0xd'),auth[_0x2f0a('0x8')](),controller[_0x2f0a('0xe')]);router['post']('/',auth[_0x2f0a('0x8')](),controller['create']);router[_0x2f0a('0xf')]('/:id/users',auth[_0x2f0a('0x8')](),controller[_0x2f0a('0x10')]);router['post'](_0x2f0a('0xd'),auth['isAuthenticated'](),controller[_0x2f0a('0x11')]);router[_0x2f0a('0x12')](_0x2f0a('0xa'),auth[_0x2f0a('0x8')](),controller[_0x2f0a('0x13')]);router[_0x2f0a('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2f0a('0x14')]('/:id/users',auth[_0x2f0a('0x8')](),controller[_0x2f0a('0x15')]);router[_0x2f0a('0x14')](_0x2f0a('0xd'),auth[_0x2f0a('0x8')](),controller[_0x2f0a('0x16')]);module['exports']=router;
\ No newline at end of file
index 5f3660e..f06cf48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe399=['INTEGER','sequelize','exports','STRING','name','system-'];(function(_0x3aa7e4,_0x408468){var _0x570578=function(_0x273a1b){while(--_0x273a1b){_0x3aa7e4['push'](_0x3aa7e4['shift']());}};_0x570578(++_0x408468);}(_0xe399,0x9d));var _0x9e39=function(_0x404708,_0x4854f6){_0x404708=_0x404708-0x0;var _0x23fcb8=_0xe399[_0x404708];return _0x23fcb8;};'use strict';var Sequelize=require(_0x9e39('0x0'));module[_0x9e39('0x1')]={'name':{'type':Sequelize[_0x9e39('0x2')],'allowNull':![],'unique':_0x9e39('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5236b7){return _0x9e39('0x4')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x9e39('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x9e39('0x5')]}};
\ No newline at end of file
+var _0xad1f=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','exports'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0xad1f,0x1e9));var _0xfad1=function(_0xba7416,_0x4cad85){_0xba7416=_0xba7416-0x0;var _0xaf6274=_0xad1f[_0xba7416];return _0xaf6274;};'use strict';var Sequelize=require('sequelize');module[_0xfad1('0x0')]={'name':{'type':Sequelize[_0xfad1('0x1')],'allowNull':![],'unique':_0xfad1('0x2')},'prefix':{'type':Sequelize[_0xfad1('0x3')],'get':function(_0x2f5581){return _0xfad1('0x4')+this[_0xfad1('0x5')](_0xfad1('0x2'))+'-';}},'description':{'type':Sequelize[_0xfad1('0x1')]},'callerIdAll':{'type':Sequelize[_0xfad1('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xfad1('0x6')]}};
\ No newline at end of file
index d22a209..53947d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93e9=['VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','${EXTEN:','length','charAt','body','system-','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','options','addTeams','Agents','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','compact','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','catch','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','appdata','prefix','NoOp'];(function(_0x2d18f8,_0x1da382){var _0x57c2dd=function(_0x399952){while(--_0x399952){_0x2d18f8['push'](_0x2d18f8['shift']());}};_0x57c2dd(++_0x1da382);}(_0x93e9,0xcc));var _0x993e=function(_0x5137cb,_0x5f54f4){_0x5137cb=_0x5137cb-0x0;var _0x1ee70d=_0x93e9[_0x5137cb];return _0x1ee70d;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];config['redis']=_['defaults'](config[_0x993e('0x19')],{'host':_0x993e('0x1a'),'port':0x18eb});var socket=require(_0x993e('0x1b'))(new Redis(config[_0x993e('0x19')]));require(_0x993e('0x1c'))[_0x993e('0x1d')](socket);function respondWithStatusCode(_0x34ddda,_0x20f32a){_0x20f32a=_0x20f32a||0xcc;return function(_0x2a184b){if(_0x2a184b){return _0x34ddda[_0x993e('0x1e')](_0x20f32a);}return _0x34ddda[_0x993e('0x1f')](_0x20f32a)[_0x993e('0x20')]();};}function respondWithResult(_0x3df0e7,_0x125322){_0x125322=_0x125322||0xc8;return function(_0x1f267f){if(_0x1f267f){return _0x3df0e7[_0x993e('0x1f')](_0x125322)[_0x993e('0x21')](_0x1f267f);}};}function respondWithFilteredResult(_0x526e06,_0x22f7cc){return function(_0x1acd21){if(_0x1acd21){var _0x3cc2b9=typeof _0x22f7cc[_0x993e('0x22')]===_0x993e('0x23')&&typeof _0x22f7cc[_0x993e('0x24')]==='undefined';var _0x11cd41=_0x1acd21[_0x993e('0x25')];var _0x1eaf57=_0x3cc2b9?0x0:_0x22f7cc[_0x993e('0x22')];var _0x130a8a=_0x3cc2b9?_0x1acd21[_0x993e('0x25')]:_0x22f7cc[_0x993e('0x22')]+_0x22f7cc[_0x993e('0x24')];var _0x4bbe9c;if(_0x130a8a>=_0x11cd41){_0x130a8a=_0x11cd41;_0x4bbe9c=0xc8;}else{_0x4bbe9c=0xce;}_0x526e06[_0x993e('0x1f')](_0x4bbe9c);return _0x526e06['set'](_0x993e('0x26'),_0x1eaf57+'-'+_0x130a8a+'/'+_0x11cd41)[_0x993e('0x21')](_0x1acd21);}return null;};}function patchUpdates(_0x32b09e){return function(_0x5ba2a1){try{jsonpatch[_0x993e('0x27')](_0x5ba2a1,_0x32b09e,!![]);}catch(_0x13db4e){return BPromise[_0x993e('0x28')](_0x13db4e);}return _0x5ba2a1[_0x993e('0x29')]();};}function saveUpdates(_0x3b45ef,_0x328d22){return function(_0xa1c83e){if(_0xa1c83e){return _0xa1c83e[_0x993e('0x2a')](_0x3b45ef)[_0x993e('0x2b')](function(_0x18f6ac){return _0x18f6ac;});}return null;};}function removeEntity(_0x3fe099,_0x3603fa){return function(_0x4fe471){if(_0x4fe471){return _0x4fe471[_0x993e('0x2c')]()[_0x993e('0x2b')](function(){var _0x52b727=_0x4fe471[_0x993e('0x2d')]({'plain':!![]});var _0x4f5cc1=_0x993e('0x2e');return db[_0x993e('0x2f')][_0x993e('0x2c')]({'where':{'type':_0x4f5cc1,'resourceId':_0x52b727['id']}})[_0x993e('0x2b')](function(){return _0x4fe471;});})['then'](function(){_0x3fe099['status'](0xcc)[_0x993e('0x20')]();});}};}function handleEntityNotFound(_0x466d63,_0x4a4f00){return function(_0x223af0){if(!_0x223af0){_0x466d63[_0x993e('0x1e')](0x194);}return _0x223af0;};}function handleError(_0x248354,_0x4c5ee3){_0x4c5ee3=_0x4c5ee3||0x1f4;return function(_0x2495b7){logger[_0x993e('0x30')](_0x2495b7[_0x993e('0x31')]);if(_0x2495b7[_0x993e('0x32')]){delete _0x2495b7[_0x993e('0x32')];}_0x248354['status'](_0x4c5ee3)[_0x993e('0x33')](_0x2495b7);};}exports['index']=function(_0x782298,_0x5ba163){var _0x1da357={},_0x567ed4={},_0x3b9c3c={'count':0x0,'rows':[]};var _0x2ce5d5=_[_0x993e('0x34')](db[_0x993e('0x35')][_0x993e('0x36')],function(_0x360e2d){return{'name':_0x360e2d['fieldName'],'type':_0x360e2d[_0x993e('0x37')]['key']};});_0x567ed4['model']=_[_0x993e('0x34')](_0x2ce5d5,'name');_0x567ed4[_0x993e('0x38')]=_[_0x993e('0x39')](_0x782298[_0x993e('0x38')]);_0x567ed4[_0x993e('0x3a')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],_0x567ed4[_0x993e('0x38')]);_0x1da357[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x782298[_0x993e('0x38')][_0x993e('0x3e')]));_0x1da357[_0x993e('0x3d')]=_0x1da357[_0x993e('0x3d')]['length']?_0x1da357[_0x993e('0x3d')]:_0x567ed4[_0x993e('0x3c')];if(!_0x782298[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1da357[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x782298[_0x993e('0x38')][_0x993e('0x24')]);_0x1da357['offset']=qs[_0x993e('0x22')](_0x782298['query'][_0x993e('0x22')]);}_0x1da357[_0x993e('0x41')]=qs[_0x993e('0x42')](_0x782298[_0x993e('0x38')][_0x993e('0x42')]);_0x1da357[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x782298['query'],_0x567ed4[_0x993e('0x3a')]),_0x2ce5d5);if(_0x782298['query'][_0x993e('0x45')]){_0x1da357['where']=_[_0x993e('0x46')](_0x1da357[_0x993e('0x43')],{'$or':_[_0x993e('0x34')](_0x2ce5d5,function(_0x1f1327){if(_0x1f1327[_0x993e('0x37')]!==_0x993e('0x47')){var _0xb728cf={};_0xb728cf[_0x1f1327[_0x993e('0x32')]]={'$like':'%'+_0x782298['query'][_0x993e('0x45')]+'%'};return _0xb728cf;}})});}_0x1da357=_['merge']({},_0x1da357,_0x782298['options']);var _0x1a2712={'where':_0x1da357[_0x993e('0x43')]};return db[_0x993e('0x35')]['count'](_0x1a2712)[_0x993e('0x2b')](function(_0x40719d){_0x3b9c3c[_0x993e('0x25')]=_0x40719d;if(_0x782298['query']['includeAll']){_0x1da357['include']=[{'all':!![]}];}return db[_0x993e('0x35')][_0x993e('0x48')](_0x1da357);})[_0x993e('0x2b')](function(_0x539c9d){_0x3b9c3c[_0x993e('0x49')]=_0x539c9d;return _0x3b9c3c;})[_0x993e('0x2b')](respondWithFilteredResult(_0x5ba163,_0x1da357))['catch'](handleError(_0x5ba163,null));};exports[_0x993e('0x4a')]=function(_0x5f7563,_0x5074a6){var _0x258795={'raw':![],'where':{'id':_0x5f7563[_0x993e('0x4b')]['id']}},_0x576ea={};_0x576ea['model']=_['keys'](db['VoicePrefix'][_0x993e('0x36')]);_0x576ea[_0x993e('0x38')]=_[_0x993e('0x39')](_0x5f7563[_0x993e('0x38')]);_0x576ea['filters']=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],_0x576ea[_0x993e('0x38')]);_0x258795[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],qs['fields'](_0x5f7563['query'][_0x993e('0x3e')]));_0x258795[_0x993e('0x3d')]=_0x258795['attributes']['length']?_0x258795[_0x993e('0x3d')]:_0x576ea[_0x993e('0x3c')];if(_0x5f7563[_0x993e('0x38')][_0x993e('0x4c')]){_0x258795[_0x993e('0x4d')]=[{'all':!![]}];}_0x258795=_[_0x993e('0x46')]({},_0x258795,_0x5f7563['options']);return db[_0x993e('0x35')]['find'](_0x258795)[_0x993e('0x2b')](handleEntityNotFound(_0x5074a6,null))[_0x993e('0x2b')](respondWithResult(_0x5074a6,null))[_0x993e('0x4e')](handleError(_0x5074a6,null));};exports[_0x993e('0x2c')]=function(_0x2cba37,_0x276b99){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x2cba37['params']['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x276b99,null))[_0x993e('0x2b')](removeEntity(_0x276b99,null))[_0x993e('0x4e')](handleError(_0x276b99,null));};exports['describe']=function(_0x355912,_0x53c1e9){return db[_0x993e('0x35')][_0x993e('0x50')]()['then'](respondWithResult(_0x53c1e9,null))[_0x993e('0x4e')](handleError(_0x53c1e9,null));};exports[_0x993e('0x51')]=function(_0x579c43,_0x3809ef){var _0x207e27;return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x2e368e){return db['VoicePrefix']['create'](_0x579c43['body'],{'transaction':_0x2e368e})[_0x993e('0x2b')](function(_0x29f8a5){_0x207e27=_0x29f8a5[_0x993e('0x2d')]({'plain':!![]});return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x207e27[_0x993e('0x55')]},'raw':!![]})['then'](function(_0x3a897d){return createVoicePrefixExtensions(_0x207e27,_0x3a897d,_0x2e368e);});});})[_0x993e('0x2b')](function(){var _0x15c8ed=_0x579c43['user'][_0x993e('0x2d')]({'plain':!![]});if(!_0x15c8ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c8ed['role']===_0x993e('0x56')){var _0x37d7b1=_0x207e27;return db['UserProfileSection'][_0x993e('0x4f')]({'where':{'name':'VoicePrefixes','userProfileId':_0x15c8ed[_0x993e('0x57')]},'raw':!![]})[_0x993e('0x2b')](function(_0x4a0dbd){if(_0x4a0dbd&&_0x4a0dbd['autoAssociation']===0x0){return db[_0x993e('0x2f')][_0x993e('0x51')]({'name':_0x37d7b1[_0x993e('0x32')],'resourceId':_0x37d7b1['id'],'type':_0x4a0dbd[_0x993e('0x32')],'sectionId':_0x4a0dbd['id']},{})[_0x993e('0x2b')](function(){return _0x207e27;});}else{return _0x207e27;}})[_0x993e('0x4e')](function(_0x4f9225){logger[_0x993e('0x30')](_0x993e('0x58'),_0x4f9225);throw _0x4f9225;});}return _0x207e27;})['then'](respondWithResult(_0x3809ef,null))[_0x993e('0x4e')](handleError(_0x3809ef,null));};function Extension(_0x473e00,_0x1b2113,_0x5ebaec,_0x426341){this[_0x993e('0x59')]=_0x993e('0x5a');this['exten']=_0x473e00;this[_0x993e('0x5b')]=_0x5ebaec;this[_0x993e('0x37')]=_0x993e('0x5c');this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x1b2113;this[_0x993e('0x5d')]=_0x426341;}function createVoicePrefixExtensions(_0x98d16c,_0x3a3d29,_0x411484){return new BPromise(function(_0xc62106,_0x55a347){var _0x18367f=new Extension(formatPrefixName(_0x98d16c[_0x993e('0x5e')]),0x1,_0x993e('0x5f'),'Voice\x20Prefix');_0x18367f[_0x993e('0x60')]=_0x98d16c['id'];return db[_0x993e('0x54')][_0x993e('0x51')](_0x18367f,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x5e4ab1){var _0x54417b=_0x5e4ab1[_0x993e('0x2d')]({'plain':!![]});var _0x51cec9=_['map'](addVoicePrefixExtensions(_0x98d16c,_0x3a3d29),function(_0x17c7f7){_0x17c7f7[_0x993e('0x55')]=_0x54417b['id'];_0x17c7f7[_0x993e('0x60')]=_0x98d16c['id'];return _0x17c7f7;});return db[_0x993e('0x54')][_0x993e('0x61')](_0x51cec9,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x211204){if(!_0x211204){return _0x55a347(_0x993e('0x62'));}else{return _0xc62106(_0x211204);}})[_0x993e('0x4e')](function(_0x113395){return _0x55a347(_0x113395);});});;});};function addVoicePrefixExtensions(_0x300a93,_0x44def2){var _0x2ddc16=[];var _0x609430=formatPrefixName(_0x300a93[_0x993e('0x5e')]);_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x2,'Set',_0x993e('0x64')+_0x300a93[_0x993e('0x32')]));if(_0x300a93['callerIdAll']){_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'Set',_0x993e('0x65')+_0x300a93[_0x993e('0x66')]));}else{_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'NoOp',_0x993e('0x67')));}_0x2ddc16['push'](new Extension(_0x609430,0x4,'goto',_0x44def2[_0x993e('0x59')]+','+_0x993e('0x68')+(0x8+_0x300a93[_0x993e('0x32')][_0x993e('0x69')])+'}'+','+0x1));return _0x2ddc16;}function formatPrefixName(_0x2a243a){var _0x5194de='_';for(var _0x120d51=0x0;_0x120d51<_0x2a243a[_0x993e('0x69')];_0x120d51++){if(_0x2a243a[_0x993e('0x6a')](_0x120d51)=='-'){_0x5194de+=_0x2a243a['charAt'](_0x120d51);}else{_0x5194de+='['+_0x2a243a[_0x993e('0x6a')](_0x120d51)+']';}}_0x5194de+='.';return _0x5194de;}exports['update']=function(_0x1ab10e,_0x6ef96,_0x42288d){var _0x5afba1=_0x1ab10e[_0x993e('0x6b')];_0x5afba1[_0x993e('0x5e')]=_0x993e('0x6c')+_0x5afba1[_0x993e('0x32')]+'-';return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x108cad){return db[_0x993e('0x35')][_0x993e('0x2a')](_0x5afba1,{'where':{'id':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db['VoiceExtension'][_0x993e('0x2c')]({'where':{'VoicePrefixId':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x5afba1[_0x993e('0x55')]},'raw':!![]})[_0x993e('0x2b')](function(_0x282c53){return createVoicePrefixExtensions(_0x5afba1,_0x282c53,_0x108cad);});});});})[_0x993e('0x2b')](function(){return db['VoicePrefix']['findById'](_0x5afba1['id']);})[_0x993e('0x2b')](respondWithResult(_0x6ef96,null))['catch'](handleError(_0x6ef96,null));};exports[_0x993e('0x6d')]=function(_0x444da6,_0x2ce913,_0x49788e){return db[_0x993e('0x35')]['find']({'where':{'id':_0x444da6[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x2ce913,null))[_0x993e('0x2b')](function(_0x40768a){if(_0x40768a){return _0x40768a[_0x993e('0x6d')](_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')],_[_0x993e('0x6f')](_0x444da6['body'],['ids','id'])||{})[_0x993e('0x70')](function(_0x5a70ff){for(var _0x2fb182=0x0;_0x2fb182<_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x993e('0x69')];_0x2fb182+=0x1){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':Number(_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x2fb182]),'VoicePrefixId':Number(_0x444da6[_0x993e('0x4b')]['id'])});}return _0x5a70ff;});}})[_0x993e('0x2b')](respondWithResult(_0x2ce913,null))['catch'](handleError(_0x2ce913,null));};exports[_0x993e('0x73')]=function(_0x14347f,_0x4a0002,_0x4742d9){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x14347f[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x4a0002,null))[_0x993e('0x2b')](function(_0x4157b6){if(_0x4157b6){return _0x4157b6[_0x993e('0x73')](_0x14347f[_0x993e('0x38')]['ids'])[_0x993e('0x2b')](function(){if(_[_0x993e('0x74')](_0x14347f[_0x993e('0x38')][_0x993e('0x6e')])){for(var _0x53ce16=0x0;_0x53ce16<_0x14347f['query'][_0x993e('0x6e')]['length'];_0x53ce16+=0x1){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')][_0x53ce16]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}}else{socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a0002,null))[_0x993e('0x4e')](handleError(_0x4a0002,null));};exports[_0x993e('0x76')]=function(_0x3abd3a,_0x278c2a,_0x3f6347){var _0x1a3967={};var _0x1079e7={};var _0x5c634a;var _0x47c3b6;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x3abd3a[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x278c2a,null))[_0x993e('0x2b')](function(_0x53b0c8){if(_0x53b0c8){_0x5c634a=_0x53b0c8;_0x1079e7['model']=_['keys'](db[_0x993e('0x78')][_0x993e('0x36')]);_0x1079e7[_0x993e('0x38')]=_[_0x993e('0x39')](_0x3abd3a[_0x993e('0x38')]);_0x1079e7['filters']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],_0x1079e7[_0x993e('0x38')]);_0x1a3967['attributes']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x3e')]));_0x1a3967[_0x993e('0x3d')]=_0x1a3967['attributes'][_0x993e('0x69')]?_0x1a3967['attributes']:_0x1079e7['model'];_0x1a3967['order']=qs['sort'](_0x3abd3a[_0x993e('0x38')][_0x993e('0x42')]);_0x1a3967[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x3abd3a[_0x993e('0x38')],_0x1079e7[_0x993e('0x3a')]));if(_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]){_0x1a3967['where']=_[_0x993e('0x46')](_0x1a3967['where'],{'$or':_[_0x993e('0x34')](_0x1a3967[_0x993e('0x3d')],function(_0x3e7793){var _0x65c6f0={};_0x65c6f0[_0x3e7793]={'$like':'%'+_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x65c6f0;})});}_0x1a3967=_[_0x993e('0x46')]({},_0x1a3967,_0x3abd3a['options']);return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})[_0x993e('0x2b')](function(_0x285c93){if(_0x285c93){_0x47c3b6=_0x285c93['length'];if(!_0x3abd3a[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1a3967['limit']=qs[_0x993e('0x24')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x24')]);_0x1a3967[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x22')]);}return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})['then'](function(_0x412d21){if(_0x412d21){return _0x412d21?{'count':_0x47c3b6,'rows':_0x412d21}:null;}})['then'](respondWithResult(_0x278c2a,null))[_0x993e('0x4e')](handleError(_0x278c2a,null));};exports[_0x993e('0x79')]=function(_0x4d6d94,_0x505f28,_0x4e2ccf){var _0x4506cb={};var _0x31e947={};var _0x7800d4;var _0x4e1fcf;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x4d6d94[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x505f28,null))['then'](function(_0xc35545){if(_0xc35545){_0x7800d4=_0xc35545;_0x31e947['model']=_[_0x993e('0x39')](db['Team']['rawAttributes']);_0x31e947[_0x993e('0x38')]=_[_0x993e('0x39')](_0x4d6d94[_0x993e('0x38')]);_0x31e947[_0x993e('0x3a')]=_['intersection'](_0x31e947['model'],_0x31e947['query']);_0x4506cb[_0x993e('0x3d')]=_['intersection'](_0x31e947[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x3e')]));_0x4506cb[_0x993e('0x3d')]=_0x4506cb['attributes'][_0x993e('0x69')]?_0x4506cb[_0x993e('0x3d')]:_0x31e947['model'];_0x4506cb[_0x993e('0x41')]=qs['sort'](_0x4d6d94[_0x993e('0x38')][_0x993e('0x42')]);_0x4506cb[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x4d6d94[_0x993e('0x38')],_0x31e947[_0x993e('0x3a')]));if(_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]){_0x4506cb['where']=_[_0x993e('0x46')](_0x4506cb['where'],{'$or':_[_0x993e('0x34')](_0x4506cb[_0x993e('0x3d')],function(_0x50dd66){var _0x48acd5={};_0x48acd5[_0x50dd66]={'$like':'%'+_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x48acd5;})});}_0x4506cb=_['merge']({},_0x4506cb,_0x4d6d94[_0x993e('0x7a')]);return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0xc56e5a){if(_0xc56e5a){_0x4e1fcf=_0xc56e5a['length'];if(!_0x4d6d94[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x4506cb[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x4d6d94['query'][_0x993e('0x24')]);_0x4506cb[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x22')]);}return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0x5d2b00){if(_0x5d2b00){return _0x5d2b00?{'count':_0x4e1fcf,'rows':_0x5d2b00}:null;}})[_0x993e('0x2b')](respondWithResult(_0x505f28,null))['catch'](handleError(_0x505f28,null));};exports[_0x993e('0x7b')]=function(_0x8dc65,_0x4a5755,_0x43b5c5){var _0x4d53d1=_0x8dc65['body'][_0x993e('0x6e')];var _0x371be2;return db['Team'][_0x993e('0x48')]({'where':{'id':_0x4d53d1},'attributes':['id'],'include':[{'model':db[_0x993e('0x78')],'as':_0x993e('0x7c'),'attributes':['id',_0x993e('0x32'),'online',_0x993e('0x7d'),'interface'],'raw':!![]}]})[_0x993e('0x2b')](function(_0x5c9960){if(_0x5c9960){_0x371be2=_0x5c9960;var _0x4286a0=_[_0x993e('0x7e')](_0x5c9960,function(_0x2540e4){var _0x56a23a=_0x2540e4['get']({'plain':!![]});return _0x56a23a[_0x993e('0x7c')];});return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x8dc65[_0x993e('0x4b')]['id']}})['then'](function(_0x37409f){return db['sequelize'][_0x993e('0x53')](function(_0xa16043){return _0x37409f[_0x993e('0x7b')](_0x4d53d1,{'transaction':_0xa16043})['then'](function(){return BPromise[_0x993e('0x7f')](_0x371be2,function(_0x30f7a3){return db[_0x993e('0x80')][_0x993e('0x81')]({'TeamId':_0x30f7a3['id'],'VoicePrefixId':_0x8dc65[_0x993e('0x4b')]['id']},{'transaction':_0xa16043});});})[_0x993e('0x2b')](function(){return BPromise[_0x993e('0x7f')](_0x4286a0,function(_0x3e61d2){return db[_0x993e('0x82')]['findOrCreate']({'where':{'UserId':_0x3e61d2['id'],'VoicePrefixId':_0x8dc65['params']['id']},'transaction':_0xa16043});});})['then'](function(){_0x4286a0[_0x993e('0x83')](function(_0x47c230){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':_0x47c230['id'],'VoicePrefixId':_0x37409f['id']});});});});});}})[_0x993e('0x2b')](respondWithStatusCode(_0x4a5755,null))[_0x993e('0x4e')](handleError(_0x4a5755,null));};exports['removeTeams']=function(_0x548dfb,_0x123dcd,_0x4e7340){return db[_0x993e('0x84')][_0x993e('0x48')]({'where':{'id':_0x548dfb[_0x993e('0x38')][_0x993e('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x993e('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x123dcd,null))['then'](function(_0x242374){var _0x1a3779=_[_0x993e('0x34')](_0x242374,'id');var _0x366809=[];var _0x11ba3a=[];var _0x1b2ca0=squel[_0x993e('0x85')]();_0x1b2ca0[_0x993e('0x86')](_0x993e('0x87'))[_0x993e('0x88')](_0x993e('0x89'),'tq')[_0x993e('0x8a')]('user_has_teams','ut',_0x993e('0x8b'))[_0x993e('0x43')](_0x993e('0x8c'),_0x548dfb[_0x993e('0x4b')]['id']);for(var _0x23ecf0=0x0;_0x23ecf0<_0x242374[_0x993e('0x69')];_0x23ecf0+=0x1){let _0x2fcfaa=_0x242374[_0x23ecf0];for(var _0x5303c9=0x0;_0x5303c9<_0x2fcfaa[_0x993e('0x7c')]['length'];_0x5303c9+=0x1){let _0x5d5dc8=_0x2fcfaa[_0x993e('0x7c')][_0x5303c9];var _0x102393=_0x1b2ca0[_0x993e('0x8d')]();_0x102393['where'](_0x993e('0x8e'),_0x5d5dc8['id']);_0x11ba3a[_0x993e('0x63')](db[_0x993e('0x52')][_0x993e('0x38')](_0x102393[_0x993e('0x8f')](),{'type':db[_0x993e('0x52')][_0x993e('0x90')]['SELECT']})[_0x993e('0x2b')](function(_0x6ee3c0){if(_0x6ee3c0['length']===0x1){return _0x5d5dc8['id'];}else{var _0x58fee1=_[_0x993e('0x91')](_[_0x993e('0x34')](_0x6ee3c0,_0x993e('0x92')),function(_0x2f0669){return _[_0x993e('0x93')](_0x1a3779,_0x2f0669);});if(_0x58fee1){return _0x5d5dc8['id'];}}}));}}return BPromise['all'](_0x11ba3a)[_0x993e('0x2b')](function(_0x3725b5){_0x366809=_(_0x366809)['union'](_0x3725b5)[_0x993e('0x94')]()['value']();return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x548dfb['params']['id']}})[_0x993e('0x2b')](function(_0x5ee2e0){return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x289772){return _0x5ee2e0['removeTeams'](_0x548dfb['query'][_0x993e('0x6e')],{'transaction':_0x289772})[_0x993e('0x2b')](function(){if(!_[_0x993e('0x95')](_0x366809)){return _0x5ee2e0[_0x993e('0x73')](_0x366809,{'transaction':_0x289772});}})[_0x993e('0x2b')](function(){_0x366809[_0x993e('0x83')](function(_0x366f8f){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':_0x366f8f,'VoicePrefixId':_0x5ee2e0['id']});});});});});});})['then'](respondWithStatusCode(_0x123dcd,null))[_0x993e('0x4e')](handleError(_0x123dcd,null));};
\ No newline at end of file
+var _0x4e2e=['from','team_has_voice_prefixes','join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','findAll','rows','show','params','include','options','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','getTeams','addTeams','Team','online','interface','Agents','each','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId'];(function(_0x3fa29a,_0x218173){var _0x4486d8=function(_0x4670e2){while(--_0x4670e2){_0x3fa29a['push'](_0x3fa29a['shift']());}};_0x4486d8(++_0x218173);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3f84f4,_0x40cb2c){_0x3f84f4=_0x3f84f4-0x0;var _0x5079c7=_0x4e2e[_0x3f84f4];return _0x5079c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require('mustache');var util=require(_0xe4e2('0x6'));var path=require(_0xe4e2('0x7'));var sox=require(_0xe4e2('0x8'));var csv=require(_0xe4e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x9'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require(_0xe4e2('0x12'));var qs=require(_0xe4e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e2('0x19'))['db'];config[_0xe4e2('0x1a')]=_[_0xe4e2('0x1b')](config[_0xe4e2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4e2('0x1c'))(new Redis(config[_0xe4e2('0x1a')]));require(_0xe4e2('0x1d'))[_0xe4e2('0x1e')](socket);function respondWithStatusCode(_0x202486,_0x50678d){_0x50678d=_0x50678d||0xcc;return function(_0x58e012){if(_0x58e012){return _0x202486[_0xe4e2('0x1f')](_0x50678d);}return _0x202486[_0xe4e2('0x20')](_0x50678d)[_0xe4e2('0x21')]();};}function respondWithResult(_0x28ee12,_0x217ea5){_0x217ea5=_0x217ea5||0xc8;return function(_0x54107a){if(_0x54107a){return _0x28ee12[_0xe4e2('0x20')](_0x217ea5)[_0xe4e2('0x22')](_0x54107a);}};}function respondWithFilteredResult(_0x340935,_0x4fe2f2){return function(_0x196f16){if(_0x196f16){var _0x54c80b=typeof _0x4fe2f2[_0xe4e2('0x23')]===_0xe4e2('0x24')&&typeof _0x4fe2f2[_0xe4e2('0x25')]===_0xe4e2('0x24');var _0x3dfbdf=_0x196f16[_0xe4e2('0x26')];var _0x339d00=_0x54c80b?0x0:_0x4fe2f2[_0xe4e2('0x23')];var _0x4769dd=_0x54c80b?_0x196f16[_0xe4e2('0x26')]:_0x4fe2f2['offset']+_0x4fe2f2[_0xe4e2('0x25')];var _0x2e7ecd;if(_0x4769dd>=_0x3dfbdf){_0x4769dd=_0x3dfbdf;_0x2e7ecd=0xc8;}else{_0x2e7ecd=0xce;}_0x340935[_0xe4e2('0x20')](_0x2e7ecd);return _0x340935[_0xe4e2('0x27')](_0xe4e2('0x28'),_0x339d00+'-'+_0x4769dd+'/'+_0x3dfbdf)[_0xe4e2('0x22')](_0x196f16);}return null;};}function patchUpdates(_0x16f14b){return function(_0x51c67e){try{jsonpatch[_0xe4e2('0x29')](_0x51c67e,_0x16f14b,!![]);}catch(_0x2ab435){return BPromise[_0xe4e2('0x2a')](_0x2ab435);}return _0x51c67e['save']();};}function saveUpdates(_0x353030,_0x12ad33){return function(_0x598fa3){if(_0x598fa3){return _0x598fa3[_0xe4e2('0x2b')](_0x353030)[_0xe4e2('0x2c')](function(_0x29143c){return _0x29143c;});}return null;};}function removeEntity(_0x3f5265,_0x249b7e){return function(_0x5887c9){if(_0x5887c9){return _0x5887c9[_0xe4e2('0x2d')]()[_0xe4e2('0x2c')](function(){var _0x1f6d1f=_0x5887c9['get']({'plain':!![]});var _0x3a31b8=_0xe4e2('0x2e');return db[_0xe4e2('0x2f')]['destroy']({'where':{'type':_0x3a31b8,'resourceId':_0x1f6d1f['id']}})[_0xe4e2('0x2c')](function(){return _0x5887c9;});})['then'](function(){_0x3f5265[_0xe4e2('0x20')](0xcc)[_0xe4e2('0x21')]();});}};}function handleEntityNotFound(_0x52c849,_0x46926a){return function(_0x18e2e5){if(!_0x18e2e5){_0x52c849[_0xe4e2('0x1f')](0x194);}return _0x18e2e5;};}function handleError(_0x41500b,_0x1f7bcc){_0x1f7bcc=_0x1f7bcc||0x1f4;return function(_0x4d33de){logger['error'](_0x4d33de[_0xe4e2('0x30')]);if(_0x4d33de[_0xe4e2('0x31')]){delete _0x4d33de[_0xe4e2('0x31')];}_0x41500b[_0xe4e2('0x20')](_0x1f7bcc)[_0xe4e2('0x32')](_0x4d33de);};}exports[_0xe4e2('0x33')]=function(_0x1c7f9a,_0x40569e){var _0x37dec8={},_0x59eb={},_0x1c87b0={'count':0x0,'rows':[]};var _0x3fb693=_['map'](db[_0xe4e2('0x34')][_0xe4e2('0x35')],function(_0xe0846a){return{'name':_0xe0846a[_0xe4e2('0x36')],'type':_0xe0846a[_0xe4e2('0x37')][_0xe4e2('0x38')]};});_0x59eb['model']=_[_0xe4e2('0x39')](_0x3fb693,_0xe4e2('0x31'));_0x59eb[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x1c7f9a[_0xe4e2('0x3a')]);_0x59eb[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x59eb[_0xe4e2('0x3e')],_0x59eb[_0xe4e2('0x3a')]);_0x37dec8[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x59eb['model'],qs[_0xe4e2('0x40')](_0x1c7f9a['query'][_0xe4e2('0x40')]));_0x37dec8[_0xe4e2('0x3f')]=_0x37dec8['attributes'][_0xe4e2('0x41')]?_0x37dec8[_0xe4e2('0x3f')]:_0x59eb[_0xe4e2('0x3e')];if(!_0x1c7f9a[_0xe4e2('0x3a')]['hasOwnProperty'](_0xe4e2('0x42'))){_0x37dec8['limit']=qs[_0xe4e2('0x25')](_0x1c7f9a['query'][_0xe4e2('0x25')]);_0x37dec8[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x1c7f9a['query'][_0xe4e2('0x23')]);}_0x37dec8[_0xe4e2('0x43')]=qs['sort'](_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x37dec8[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x1c7f9a[_0xe4e2('0x3a')],_0x59eb[_0xe4e2('0x3c')]),_0x3fb693);if(_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x37dec8['where']=_['merge'](_0x37dec8[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x3fb693,function(_0x5d05a4){if(_0x5d05a4[_0xe4e2('0x37')]!=='VIRTUAL'){var _0x4d8a2d={};_0x4d8a2d[_0x5d05a4[_0xe4e2('0x31')]]={'$like':'%'+_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x4d8a2d;}})});}_0x37dec8=_[_0xe4e2('0x48')]({},_0x37dec8,_0x1c7f9a['options']);var _0x45e88c={'where':_0x37dec8[_0xe4e2('0x45')]};return db[_0xe4e2('0x34')]['count'](_0x45e88c)[_0xe4e2('0x2c')](function(_0x4789cf){_0x1c87b0[_0xe4e2('0x26')]=_0x4789cf;if(_0x1c7f9a[_0xe4e2('0x3a')]['includeAll']){_0x37dec8['include']=[{'all':!![]}];}return db[_0xe4e2('0x34')][_0xe4e2('0x49')](_0x37dec8);})[_0xe4e2('0x2c')](function(_0x5c29c3){_0x1c87b0[_0xe4e2('0x4a')]=_0x5c29c3;return _0x1c87b0;})[_0xe4e2('0x2c')](respondWithFilteredResult(_0x40569e,_0x37dec8))['catch'](handleError(_0x40569e,null));};exports[_0xe4e2('0x4b')]=function(_0x3d55f9,_0x1538bd){var _0x17f30f={'raw':![],'where':{'id':_0x3d55f9[_0xe4e2('0x4c')]['id']}},_0x4ed88f={};_0x4ed88f[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db['VoicePrefix'][_0xe4e2('0x35')]);_0x4ed88f[_0xe4e2('0x3a')]=_['keys'](_0x3d55f9['query']);_0x4ed88f[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x4ed88f[_0xe4e2('0x3e')],_0x4ed88f['query']);_0x17f30f[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x4ed88f[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x3d55f9['query'][_0xe4e2('0x40')]));_0x17f30f[_0xe4e2('0x3f')]=_0x17f30f[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x17f30f['attributes']:_0x4ed88f[_0xe4e2('0x3e')];if(_0x3d55f9[_0xe4e2('0x3a')]['includeAll']){_0x17f30f[_0xe4e2('0x4d')]=[{'all':!![]}];}_0x17f30f=_[_0xe4e2('0x48')]({},_0x17f30f,_0x3d55f9[_0xe4e2('0x4e')]);return db['VoicePrefix'][_0xe4e2('0x4f')](_0x17f30f)[_0xe4e2('0x2c')](handleEntityNotFound(_0x1538bd,null))[_0xe4e2('0x2c')](respondWithResult(_0x1538bd,null))['catch'](handleError(_0x1538bd,null));};exports['destroy']=function(_0xccf95e,_0x4c6253){return db[_0xe4e2('0x34')]['find']({'where':{'id':_0xccf95e[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x4c6253,null))[_0xe4e2('0x2c')](removeEntity(_0x4c6253,null))['catch'](handleError(_0x4c6253,null));};exports[_0xe4e2('0x50')]=function(_0x504496,_0x11bd63){return db[_0xe4e2('0x34')]['describe']()[_0xe4e2('0x2c')](respondWithResult(_0x11bd63,null))['catch'](handleError(_0x11bd63,null));};exports[_0xe4e2('0x51')]=function(_0xf0885,_0x53d31d){var _0x297186;return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x3e540d){return db[_0xe4e2('0x34')][_0xe4e2('0x51')](_0xf0885[_0xe4e2('0x54')],{'transaction':_0x3e540d})[_0xe4e2('0x2c')](function(_0x382d1b){_0x297186=_0x382d1b['get']({'plain':!![]});return db[_0xe4e2('0x55')][_0xe4e2('0x4f')]({'where':{'id':_0x297186[_0xe4e2('0x56')]},'raw':!![]})[_0xe4e2('0x2c')](function(_0x2b0885){return createVoicePrefixExtensions(_0x297186,_0x2b0885,_0x3e540d);});});})[_0xe4e2('0x2c')](function(){var _0x1e2012=_0xf0885[_0xe4e2('0x57')][_0xe4e2('0x58')]({'plain':!![]});if(!_0x1e2012)throw new Error(_0xe4e2('0x59'));if(_0x1e2012[_0xe4e2('0x5a')]==='user'){var _0x17a350=_0x297186;return db[_0xe4e2('0x5b')][_0xe4e2('0x4f')]({'where':{'name':_0xe4e2('0x2e'),'userProfileId':_0x1e2012['userProfileId']},'raw':!![]})[_0xe4e2('0x2c')](function(_0x1250a2){if(_0x1250a2&&_0x1250a2['autoAssociation']===0x0){return db[_0xe4e2('0x2f')][_0xe4e2('0x51')]({'name':_0x17a350[_0xe4e2('0x31')],'resourceId':_0x17a350['id'],'type':_0x1250a2[_0xe4e2('0x31')],'sectionId':_0x1250a2['id']},{})['then'](function(){return _0x297186;});}else{return _0x297186;}})[_0xe4e2('0x5c')](function(_0x5c9d88){logger[_0xe4e2('0x5d')](_0xe4e2('0x5e'),_0x5c9d88);throw _0x5c9d88;});}return _0x297186;})[_0xe4e2('0x2c')](respondWithResult(_0x53d31d,null))[_0xe4e2('0x5c')](handleError(_0x53d31d,null));};function Extension(_0x2cc813,_0x26ab38,_0x467cec,_0x33c5f4){this[_0xe4e2('0x5f')]=_0xe4e2('0x60');this[_0xe4e2('0x61')]=_0x2cc813;this[_0xe4e2('0x62')]=_0x467cec;this['type']=_0xe4e2('0x63');this['description']='Voice\x20Prefix\x20Extension';this[_0xe4e2('0x64')]=_0x26ab38;this[_0xe4e2('0x65')]=_0x33c5f4;}function createVoicePrefixExtensions(_0xa27bd1,_0x5e4e16,_0x477acd){return new BPromise(function(_0x4b6dfc,_0xb9e975){var _0x9ba757=new Extension(formatPrefixName(_0xa27bd1['prefix']),0x1,_0xe4e2('0x66'),_0xe4e2('0x67'));_0x9ba757['VoicePrefixId']=_0xa27bd1['id'];return db[_0xe4e2('0x55')][_0xe4e2('0x51')](_0x9ba757,{'transaction':_0x477acd})['then'](function(_0x476533){var _0x2ad558=_0x476533[_0xe4e2('0x58')]({'plain':!![]});var _0x3f7be9=_['map'](addVoicePrefixExtensions(_0xa27bd1,_0x5e4e16),function(_0x22640a){_0x22640a[_0xe4e2('0x56')]=_0x2ad558['id'];_0x22640a[_0xe4e2('0x68')]=_0xa27bd1['id'];return _0x22640a;});return db[_0xe4e2('0x55')][_0xe4e2('0x69')](_0x3f7be9,{'transaction':_0x477acd})[_0xe4e2('0x2c')](function(_0x1ef7f8){if(!_0x1ef7f8){return _0xb9e975(_0xe4e2('0x6a'));}else{return _0x4b6dfc(_0x1ef7f8);}})[_0xe4e2('0x5c')](function(_0x593635){return _0xb9e975(_0x593635);});});;});};function addVoicePrefixExtensions(_0x59b1c0,_0x5cd517){var _0x39f59c=[];var _0x17d904=formatPrefixName(_0x59b1c0[_0xe4e2('0x6b')]);_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x2,_0xe4e2('0x6d'),_0xe4e2('0x6e')+_0x59b1c0[_0xe4e2('0x31')]));if(_0x59b1c0['callerIdAll']){_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x3,_0xe4e2('0x6d'),_0xe4e2('0x6f')+_0x59b1c0[_0xe4e2('0x70')]));}else{_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x3,_0xe4e2('0x66'),_0xe4e2('0x71')));}_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x4,_0xe4e2('0x72'),_0x5cd517[_0xe4e2('0x5f')]+','+_0xe4e2('0x73')+(0x8+_0x59b1c0[_0xe4e2('0x31')][_0xe4e2('0x41')])+'}'+','+0x1));return _0x39f59c;}function formatPrefixName(_0x2ad8d1){var _0x3dde87='_';for(var _0x51d58d=0x0;_0x51d58d<_0x2ad8d1[_0xe4e2('0x41')];_0x51d58d++){if(_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d)=='-'){_0x3dde87+=_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d);}else{_0x3dde87+='['+_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d)+']';}}_0x3dde87+='.';return _0x3dde87;}exports[_0xe4e2('0x2b')]=function(_0x26f90d,_0x26b31a,_0x3f40f8){var _0x134eec=_0x26f90d[_0xe4e2('0x54')];_0x134eec['prefix']=_0xe4e2('0x75')+_0x134eec[_0xe4e2('0x31')]+'-';return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x24859b){return db[_0xe4e2('0x34')][_0xe4e2('0x2b')](_0x134eec,{'where':{'id':_0x134eec['id']},'transaction':_0x24859b})[_0xe4e2('0x2c')](function(){return db['VoiceExtension'][_0xe4e2('0x2d')]({'where':{'VoicePrefixId':_0x134eec['id']},'transaction':_0x24859b})[_0xe4e2('0x2c')](function(){return db[_0xe4e2('0x55')][_0xe4e2('0x4f')]({'where':{'id':_0x134eec[_0xe4e2('0x56')]},'raw':!![]})[_0xe4e2('0x2c')](function(_0x22f79e){return createVoicePrefixExtensions(_0x134eec,_0x22f79e,_0x24859b);});});});})[_0xe4e2('0x2c')](function(){return db[_0xe4e2('0x34')][_0xe4e2('0x76')](_0x134eec['id']);})['then'](respondWithResult(_0x26b31a,null))[_0xe4e2('0x5c')](handleError(_0x26b31a,null));};exports[_0xe4e2('0x77')]=function(_0x4da351,_0x2017d,_0x2cada0){return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x4da351[_0xe4e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2017d,null))[_0xe4e2('0x2c')](function(_0x1447ee){if(_0x1447ee){return _0x1447ee[_0xe4e2('0x77')](_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')],_[_0xe4e2('0x79')](_0x4da351[_0xe4e2('0x54')],[_0xe4e2('0x78'),'id'])||{})['spread'](function(_0xbdd6b4){for(var _0x386253=0x0;_0x386253<_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')][_0xe4e2('0x41')];_0x386253+=0x1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7b'),{'UserId':Number(_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')][_0x386253]),'VoicePrefixId':Number(_0x4da351['params']['id'])});}return _0xbdd6b4;});}})[_0xe4e2('0x2c')](respondWithResult(_0x2017d,null))[_0xe4e2('0x5c')](handleError(_0x2017d,null));};exports[_0xe4e2('0x7c')]=function(_0x40fa3c,_0x420559,_0x28368a){return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x40fa3c[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x420559,null))[_0xe4e2('0x2c')](function(_0x150c1a){if(_0x150c1a){return _0x150c1a[_0xe4e2('0x7c')](_0x40fa3c['query'][_0xe4e2('0x78')])['then'](function(){if(_[_0xe4e2('0x7d')](_0x40fa3c[_0xe4e2('0x3a')]['ids'])){for(var _0x326762=0x0;_0x326762<_0x40fa3c[_0xe4e2('0x3a')][_0xe4e2('0x78')][_0xe4e2('0x41')];_0x326762+=0x1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7e'),{'UserId':Number(_0x40fa3c[_0xe4e2('0x3a')]['ids'][_0x326762]),'VoicePrefixId':Number(_0x40fa3c[_0xe4e2('0x4c')]['id'])});}}else{socket[_0xe4e2('0x7a')]('userVoicePrefix:remove',{'UserId':Number(_0x40fa3c['query'][_0xe4e2('0x78')]),'VoicePrefixId':Number(_0x40fa3c[_0xe4e2('0x4c')]['id'])});}});}})[_0xe4e2('0x2c')](respondWithStatusCode(_0x420559,null))['catch'](handleError(_0x420559,null));};exports[_0xe4e2('0x7f')]=function(_0x5b0948,_0x3b45c3,_0x406c7e){var _0x5dfe42={};var _0x2783f7={};var _0x94e5e1;var _0x45ecb8;return db[_0xe4e2('0x34')][_0xe4e2('0x80')]({'where':{'id':_0x5b0948[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x3b45c3,null))[_0xe4e2('0x2c')](function(_0x3687d5){if(_0x3687d5){_0x94e5e1=_0x3687d5;_0x2783f7[_0xe4e2('0x3e')]=_['keys'](db[_0xe4e2('0x81')][_0xe4e2('0x35')]);_0x2783f7['query']=_[_0xe4e2('0x3b')](_0x5b0948['query']);_0x2783f7[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x2783f7[_0xe4e2('0x3e')],_0x2783f7[_0xe4e2('0x3a')]);_0x5dfe42['attributes']=_[_0xe4e2('0x3d')](_0x2783f7[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x40')]));_0x5dfe42[_0xe4e2('0x3f')]=_0x5dfe42[_0xe4e2('0x3f')]['length']?_0x5dfe42['attributes']:_0x2783f7[_0xe4e2('0x3e')];_0x5dfe42[_0xe4e2('0x43')]=qs[_0xe4e2('0x44')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x5dfe42[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x5b0948[_0xe4e2('0x3a')],_0x2783f7[_0xe4e2('0x3c')]));if(_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x5dfe42[_0xe4e2('0x45')]=_[_0xe4e2('0x48')](_0x5dfe42[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x5dfe42[_0xe4e2('0x3f')],function(_0x1b630a){var _0x1930b9={};_0x1930b9[_0x1b630a]={'$like':'%'+_0x5b0948['query'][_0xe4e2('0x47')]+'%'};return _0x1930b9;})});}_0x5dfe42=_[_0xe4e2('0x48')]({},_0x5dfe42,_0x5b0948[_0xe4e2('0x4e')]);return _0x94e5e1['getAgents'](_0x5dfe42);}})['then'](function(_0xf31c76){if(_0xf31c76){_0x45ecb8=_0xf31c76['length'];if(!_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x82')](_0xe4e2('0x42'))){_0x5dfe42[_0xe4e2('0x25')]=qs[_0xe4e2('0x25')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x25')]);_0x5dfe42[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x5b0948['query'][_0xe4e2('0x23')]);}return _0x94e5e1[_0xe4e2('0x7f')](_0x5dfe42);}})['then'](function(_0x4ab01e){if(_0x4ab01e){return _0x4ab01e?{'count':_0x45ecb8,'rows':_0x4ab01e}:null;}})[_0xe4e2('0x2c')](respondWithResult(_0x3b45c3,null))[_0xe4e2('0x5c')](handleError(_0x3b45c3,null));};exports[_0xe4e2('0x83')]=function(_0x10c166,_0x11707e,_0x11a6f4){var _0x38675b={};var _0x39fcac={};var _0x272ebb;var _0x2558c2;return db['VoicePrefix'][_0xe4e2('0x80')]({'where':{'id':_0x10c166[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x11707e,null))[_0xe4e2('0x2c')](function(_0x46d566){if(_0x46d566){_0x272ebb=_0x46d566;_0x39fcac[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db['Team'][_0xe4e2('0x35')]);_0x39fcac[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x10c166[_0xe4e2('0x3a')]);_0x39fcac[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x39fcac[_0xe4e2('0x3e')],_0x39fcac[_0xe4e2('0x3a')]);_0x38675b[_0xe4e2('0x3f')]=_['intersection'](_0x39fcac[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x10c166[_0xe4e2('0x3a')]['fields']));_0x38675b[_0xe4e2('0x3f')]=_0x38675b[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x38675b[_0xe4e2('0x3f')]:_0x39fcac[_0xe4e2('0x3e')];_0x38675b[_0xe4e2('0x43')]=qs['sort'](_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x38675b[_0xe4e2('0x45')]=qs['filters'](_[_0xe4e2('0x46')](_0x10c166[_0xe4e2('0x3a')],_0x39fcac[_0xe4e2('0x3c')]));if(_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x38675b[_0xe4e2('0x45')]=_[_0xe4e2('0x48')](_0x38675b[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x38675b[_0xe4e2('0x3f')],function(_0x3266a4){var _0x282545={};_0x282545[_0x3266a4]={'$like':'%'+_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x282545;})});}_0x38675b=_[_0xe4e2('0x48')]({},_0x38675b,_0x10c166['options']);return _0x272ebb['getTeams'](_0x38675b);}})[_0xe4e2('0x2c')](function(_0x4d730e){if(_0x4d730e){_0x2558c2=_0x4d730e['length'];if(!_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x82')](_0xe4e2('0x42'))){_0x38675b[_0xe4e2('0x25')]=qs['limit'](_0x10c166[_0xe4e2('0x3a')]['limit']);_0x38675b['offset']=qs[_0xe4e2('0x23')](_0x10c166['query'][_0xe4e2('0x23')]);}return _0x272ebb[_0xe4e2('0x83')](_0x38675b);}})[_0xe4e2('0x2c')](function(_0x4e6552){if(_0x4e6552){return _0x4e6552?{'count':_0x2558c2,'rows':_0x4e6552}:null;}})[_0xe4e2('0x2c')](respondWithResult(_0x11707e,null))[_0xe4e2('0x5c')](handleError(_0x11707e,null));};exports[_0xe4e2('0x84')]=function(_0x5e9fc3,_0x240089,_0x1b94e9){var _0x126eeb=_0x5e9fc3[_0xe4e2('0x54')]['ids'];var _0x35c2d4;return db[_0xe4e2('0x85')][_0xe4e2('0x49')]({'where':{'id':_0x126eeb},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe4e2('0x31'),_0xe4e2('0x86'),'voicePause',_0xe4e2('0x87')],'raw':!![]}]})['then'](function(_0x47186a){if(_0x47186a){_0x35c2d4=_0x47186a;var _0x3fa1eb=_['flatMap'](_0x47186a,function(_0x3a8a2f){var _0x4e722d=_0x3a8a2f[_0xe4e2('0x58')]({'plain':!![]});return _0x4e722d[_0xe4e2('0x88')];});return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x5e9fc3[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](function(_0x50b129){return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x45431c){return _0x50b129['addTeams'](_0x126eeb,{'transaction':_0x45431c})[_0xe4e2('0x2c')](function(){return BPromise[_0xe4e2('0x89')](_0x35c2d4,function(_0x19f368){return db['TeamVoicePrefix'][_0xe4e2('0x8a')]({'TeamId':_0x19f368['id'],'VoicePrefixId':_0x5e9fc3[_0xe4e2('0x4c')]['id']},{'transaction':_0x45431c});});})[_0xe4e2('0x2c')](function(){return BPromise['each'](_0x3fa1eb,function(_0x151d22){return db[_0xe4e2('0x8b')][_0xe4e2('0x8c')]({'where':{'UserId':_0x151d22['id'],'VoicePrefixId':_0x5e9fc3[_0xe4e2('0x4c')]['id']},'transaction':_0x45431c});});})[_0xe4e2('0x2c')](function(){_0x3fa1eb[_0xe4e2('0x8d')](function(_0x19405d){socket[_0xe4e2('0x7a')](_0xe4e2('0x7b'),{'UserId':_0x19405d['id'],'VoicePrefixId':_0x50b129['id']});});});});});}})[_0xe4e2('0x2c')](respondWithStatusCode(_0x240089,null))[_0xe4e2('0x5c')](handleError(_0x240089,null));};exports[_0xe4e2('0x8e')]=function(_0x515f57,_0x28b119,_0x373c88){return db[_0xe4e2('0x85')][_0xe4e2('0x49')]({'where':{'id':_0x515f57[_0xe4e2('0x3a')][_0xe4e2('0x78')]},'attributes':['id'],'include':[{'model':db[_0xe4e2('0x81')],'as':_0xe4e2('0x88'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x28b119,null))[_0xe4e2('0x2c')](function(_0x21fa74){var _0x273236=_[_0xe4e2('0x39')](_0x21fa74,'id');var _0x278ad0=[];var _0x416ebe=[];var _0xfb32dd=squel[_0xe4e2('0x8f')]();_0xfb32dd[_0xe4e2('0x90')](_0xe4e2('0x91'))[_0xe4e2('0x92')](_0xe4e2('0x93'),'tq')[_0xe4e2('0x94')](_0xe4e2('0x95'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x515f57[_0xe4e2('0x4c')]['id']);for(var _0x1060d9=0x0;_0x1060d9<_0x21fa74['length'];_0x1060d9+=0x1){let _0x3ca7ef=_0x21fa74[_0x1060d9];for(var _0x49dc91=0x0;_0x49dc91<_0x3ca7ef[_0xe4e2('0x88')][_0xe4e2('0x41')];_0x49dc91+=0x1){let _0x3cea27=_0x3ca7ef[_0xe4e2('0x88')][_0x49dc91];var _0x17b696=_0xfb32dd[_0xe4e2('0x96')]();_0x17b696['where'](_0xe4e2('0x97'),_0x3cea27['id']);_0x416ebe['push'](db[_0xe4e2('0x52')][_0xe4e2('0x3a')](_0x17b696[_0xe4e2('0x98')](),{'type':db[_0xe4e2('0x52')][_0xe4e2('0x99')][_0xe4e2('0x9a')]})[_0xe4e2('0x2c')](function(_0x55182e){if(_0x55182e['length']===0x1){return _0x3cea27['id'];}else{var _0x35d3da=_['every'](_['map'](_0x55182e,_0xe4e2('0x9b')),function(_0x2ab2d8){return _[_0xe4e2('0x9c')](_0x273236,_0x2ab2d8);});if(_0x35d3da){return _0x3cea27['id'];}}}));}}return BPromise[_0xe4e2('0x9d')](_0x416ebe)[_0xe4e2('0x2c')](function(_0x10a6c5){_0x278ad0=_(_0x278ad0)[_0xe4e2('0x9e')](_0x10a6c5)[_0xe4e2('0x9f')]()['value']();return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x515f57[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](function(_0x45ee82){return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x181f47){return _0x45ee82[_0xe4e2('0x8e')](_0x515f57[_0xe4e2('0x3a')][_0xe4e2('0x78')],{'transaction':_0x181f47})['then'](function(){if(!_[_0xe4e2('0xa0')](_0x278ad0)){return _0x45ee82[_0xe4e2('0x7c')](_0x278ad0,{'transaction':_0x181f47});}})[_0xe4e2('0x2c')](function(){_0x278ad0['forEach'](function(_0x3dabd1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7e'),{'UserId':_0x3dabd1,'VoicePrefixId':_0x45ee82['id']});});});});});});})[_0xe4e2('0x2c')](respondWithStatusCode(_0x28b119,null))[_0xe4e2('0x5c')](handleError(_0x28b119,null));};
\ No newline at end of file
index 9118f21..3b05875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5995=['VoicePrefix','setMaxListeners','save','update','hook','exports','../../mysqldb'];(function(_0x29969b,_0x2982c4){var _0x16bdad=function(_0x4ad3b5){while(--_0x4ad3b5){_0x29969b['push'](_0x29969b['shift']());}};_0x16bdad(++_0x2982c4);}(_0x5995,0x1e9));var _0x5599=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5995[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x5599('0x0'))['db'][_0x5599('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x5599('0x2')](0x0);var events={'afterCreate':_0x5599('0x3'),'afterUpdate':_0x5599('0x4'),'afterDestroy':'remove'};function emitEvent(_0xec39cf){return function(_0x1b87f9,_0x4eadf0,_0x29db3c){VoicePrefixEvents['emit'](_0xec39cf+':'+_0x1b87f9['id'],_0x1b87f9);VoicePrefixEvents['emit'](_0xec39cf,_0x1b87f9);_0x29db3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x5599('0x5')](e,emitEvent(event));}}module[_0x5599('0x6')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x3d67=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x27e335,_0x270468){var _0x53c8b7=function(_0x35926d){while(--_0x35926d){_0x27e335['push'](_0x27e335['shift']());}};_0x53c8b7(++_0x270468);}(_0x3d67,0x71));var _0x73d6=function(_0x4cbc28,_0x5d30b4){_0x4cbc28=_0x4cbc28-0x0;var _0x7cf5ff=_0x3d67[_0x4cbc28];return _0x7cf5ff;};'use strict';var EventEmitter=require(_0x73d6('0x0'));var VoicePrefix=require(_0x73d6('0x1'))['db'][_0x73d6('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x73d6('0x3')](0x0);var events={'afterCreate':_0x73d6('0x4'),'afterUpdate':_0x73d6('0x5'),'afterDestroy':_0x73d6('0x6')};function emitEvent(_0x308ad6){return function(_0x43f1da,_0x4e9ded,_0x1dee56){VoicePrefixEvents[_0x73d6('0x7')](_0x308ad6+':'+_0x43f1da['id'],_0x43f1da);VoicePrefixEvents[_0x73d6('0x7')](_0x308ad6,_0x43f1da);_0x1dee56(null);};}for(var e in events){if(events[_0x73d6('0x8')](e)){var event=events[e];VoicePrefix[_0x73d6('0x9')](e,emitEvent(event));}}module[_0x73d6('0xa')]=VoicePrefixEvents;
\ No newline at end of file
index 730f714..54522e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea1e=['./voicePrefix.attributes','define','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x29d0d8,_0x9069eb){var _0xbfbaf0=function(_0x2c428b){while(--_0x2c428b){_0x29d0d8['push'](_0x29d0d8['shift']());}};_0xbfbaf0(++_0x9069eb);}(_0xea1e,0x6b));var _0xeea1=function(_0x51402e,_0x1a8564){_0x51402e=_0x51402e-0x0;var _0x31dc9c=_0xea1e[_0x51402e];return _0x31dc9c;};'use strict';var _=require(_0xeea1('0x0'));var util=require(_0xeea1('0x1'));var logger=require(_0xeea1('0x2'))(_0xeea1('0x3'));var moment=require(_0xeea1('0x4'));var BPromise=require(_0xeea1('0x5'));var rp=require(_0xeea1('0x6'));var fs=require('fs');var path=require(_0xeea1('0x7'));var rimraf=require(_0xeea1('0x8'));var config=require(_0xeea1('0x9'));var attributes=require(_0xeea1('0xa'));module['exports']=function(_0x4c8bc5,_0x7ab014){return _0x4c8bc5[_0xeea1('0xb')]('VoicePrefix',attributes,{'tableName':_0xeea1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4847=['request-promise','path','rimraf','../../config/environment','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird'];(function(_0x2ea0b3,_0x62dcd8){var _0x4c535d=function(_0x18c132){while(--_0x18c132){_0x2ea0b3['push'](_0x2ea0b3['shift']());}};_0x4c535d(++_0x62dcd8);}(_0x4847,0x7d));var _0x7484=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x4847[_0x3a6efd];return _0x487b9a;};'use strict';var _=require('lodash');var util=require(_0x7484('0x0'));var logger=require(_0x7484('0x1'))(_0x7484('0x2'));var moment=require(_0x7484('0x3'));var BPromise=require(_0x7484('0x4'));var rp=require(_0x7484('0x5'));var fs=require('fs');var path=require(_0x7484('0x6'));var rimraf=require(_0x7484('0x7'));var config=require(_0x7484('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x7484('0x9')]=function(_0x3aeda9,_0x48726b){return _0x3aeda9[_0x7484('0xa')](_0x7484('0xb'),attributes,{'tableName':_0x7484('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 465f641..1797956 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fc2=['client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment'];(function(_0x2ad487,_0x30a2e7){var _0x2ca8f5=function(_0x49ecaf){while(--_0x49ecaf){_0x2ad487['push'](_0x2ad487['shift']());}};_0x2ca8f5(++_0x30a2e7);}(_0x6fc2,0x117));var _0x26fc=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6fc2[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x26fc('0x0'));var util=require(_0x26fc('0x1'));var moment=require(_0x26fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x26fc('0x3'));var fs=require('fs');var Redis=require(_0x26fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x26fc('0x5'));var config=require(_0x26fc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x26fc('0x7')][_0x26fc('0x8')]({'port':0x232a});config[_0x26fc('0x9')]=_[_0x26fc('0xa')](config['redis'],{'host':_0x26fc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x26fc('0xc'))[_0x26fc('0xd')](socket);function respondWithRpcPromise(_0x3402c4,_0x500159,_0x42ea7b){return new BPromise(function(_0xe22d78,_0x23171d){return client[_0x26fc('0xe')](_0x3402c4,_0x42ea7b)[_0x26fc('0xf')](function(_0x1832de){logger[_0x26fc('0x10')](_0x26fc('0x11'),_0x500159,_0x26fc('0x12'));logger[_0x26fc('0x13')](_0x26fc('0x14'),_0x500159,_0x26fc('0x12'),JSON[_0x26fc('0x15')](_0x1832de));if(_0x1832de[_0x26fc('0x16')]){if(_0x1832de[_0x26fc('0x16')][_0x26fc('0x17')]===0x1f4){logger['error'](_0x26fc('0x11'),_0x500159,_0x1832de[_0x26fc('0x16')][_0x26fc('0x18')]);return _0x23171d(_0x1832de[_0x26fc('0x16')][_0x26fc('0x18')]);}logger[_0x26fc('0x16')](_0x26fc('0x11'),_0x500159,_0x1832de[_0x26fc('0x16')][_0x26fc('0x18')]);return _0xe22d78(_0x1832de['error'][_0x26fc('0x18')]);}else{logger['info'](_0x26fc('0x11'),_0x500159,_0x26fc('0x12'));_0xe22d78(_0x1832de[_0x26fc('0x19')][_0x26fc('0x18')]);}})['catch'](function(_0x463117){logger[_0x26fc('0x16')](_0x26fc('0x11'),_0x500159,_0x463117);_0x23171d(_0x463117);});});}
\ No newline at end of file
+var _0xd2f5=['socket.io-emitter','./voicePrefix.socket','request','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x3de882,_0x3c87b7){var _0x9cf690=function(_0x279639){while(--_0x279639){_0x3de882['push'](_0x3de882['shift']());}};_0x9cf690(++_0x3c87b7);}(_0xd2f5,0x144));var _0x5d2f=function(_0x48a8de,_0x1a8962){_0x48a8de=_0x48a8de-0x0;var _0x1ea331=_0xd2f5[_0x48a8de];return _0x1ea331;};'use strict';var _=require(_0x5d2f('0x0'));var util=require('util');var moment=require(_0x5d2f('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d2f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d2f('0x3'))['db'];var utils=require(_0x5d2f('0x4'));var logger=require(_0x5d2f('0x5'))(_0x5d2f('0x6'));var config=require(_0x5d2f('0x7'));var jayson=require(_0x5d2f('0x8'));var client=jayson[_0x5d2f('0x9')][_0x5d2f('0xa')]({'port':0x232a});config['redis']=_[_0x5d2f('0xb')](config[_0x5d2f('0xc')],{'host':_0x5d2f('0xd'),'port':0x18eb});var socket=require(_0x5d2f('0xe'))(new Redis(config[_0x5d2f('0xc')]));require(_0x5d2f('0xf'))['register'](socket);function respondWithRpcPromise(_0x305434,_0xcd29b4,_0x4e24af){return new BPromise(function(_0x90b987,_0xd738c6){return client[_0x5d2f('0x10')](_0x305434,_0x4e24af)['then'](function(_0x39b43b){logger[_0x5d2f('0x11')](_0x5d2f('0x12'),_0xcd29b4,'request\x20sent');logger['debug'](_0x5d2f('0x13'),_0xcd29b4,'request\x20sent',JSON[_0x5d2f('0x14')](_0x39b43b));if(_0x39b43b[_0x5d2f('0x15')]){if(_0x39b43b['error'][_0x5d2f('0x16')]===0x1f4){logger['error'](_0x5d2f('0x12'),_0xcd29b4,_0x39b43b[_0x5d2f('0x15')][_0x5d2f('0x17')]);return _0xd738c6(_0x39b43b['error'][_0x5d2f('0x17')]);}logger[_0x5d2f('0x15')](_0x5d2f('0x12'),_0xcd29b4,_0x39b43b[_0x5d2f('0x15')][_0x5d2f('0x17')]);return _0x90b987(_0x39b43b['error'][_0x5d2f('0x17')]);}else{logger[_0x5d2f('0x11')](_0x5d2f('0x12'),_0xcd29b4,_0x5d2f('0x18'));_0x90b987(_0x39b43b['result'][_0x5d2f('0x17')]);}})[_0x5d2f('0x19')](function(_0x36ddf1){logger[_0x5d2f('0x15')](_0x5d2f('0x12'),_0xcd29b4,_0x36ddf1);_0xd738c6(_0x36ddf1);});});}
\ No newline at end of file
index d619d7b..2a80a91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9f9=['./voicePrefix.events','remove','update','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9f9,0x174));var _0x9e9f=function(_0x5b3440,_0x55da74){_0x5b3440=_0x5b3440-0x0;var _0x2f9cc7=_0xe9f9[_0x5b3440];return _0x2f9cc7;};'use strict';var VoicePrefixEvents=require(_0x9e9f('0x0'));var events=['save',_0x9e9f('0x1'),_0x9e9f('0x2')];function createListener(_0x24e489,_0x439590){return function(_0x15d8d0){_0x439590['emit'](_0x24e489,_0x15d8d0);};}function removeListener(_0x2020b3,_0x47f4c7){return function(){VoicePrefixEvents[_0x9e9f('0x3')](_0x2020b3,_0x47f4c7);};}exports[_0x9e9f('0x4')]=function(_0x549ea5){for(var _0x32da7a=0x0,_0x54f87c=events[_0x9e9f('0x5')];_0x32da7a<_0x54f87c;_0x32da7a++){var _0x661886=events[_0x32da7a];var _0x10d43b=createListener('voicePrefix:'+_0x661886,_0x549ea5);VoicePrefixEvents['on'](_0x661886,_0x10d43b);}};
\ No newline at end of file
+var _0x6594=['register','voicePrefix:','emit'];(function(_0x4d488d,_0x4016fb){var _0x11ba44=function(_0x42f5d9){while(--_0x42f5d9){_0x4d488d['push'](_0x4d488d['shift']());}};_0x11ba44(++_0x4016fb);}(_0x6594,0xcb));var _0x4659=function(_0x3a1bcd,_0x244041){_0x3a1bcd=_0x3a1bcd-0x0;var _0x57422c=_0x6594[_0x3a1bcd];return _0x57422c;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save','remove','update'];function createListener(_0x309638,_0xda9ca2){return function(_0x365816){_0xda9ca2[_0x4659('0x0')](_0x309638,_0x365816);};}function removeListener(_0x2fa78c,_0x4eedfc){return function(){VoicePrefixEvents['removeListener'](_0x2fa78c,_0x4eedfc);};}exports[_0x4659('0x1')]=function(_0x2f59ce){for(var _0x246729=0x0,_0x45d2e8=events['length'];_0x246729<_0x45d2e8;_0x246729++){var _0x3adf40=events[_0x246729];var _0x39b740=createListener(_0x4659('0x2')+_0x3adf40,_0x2f59ce);VoicePrefixEvents['on'](_0x3adf40,_0x39b740);}};
\ No newline at end of file
index 6c42690..219600c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8011=['./voiceQueue.controller','index','get','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','create','post','addTeams','addAgents','/:id/lists','addBlackLists','put','/:id','update','destroy','delete','removeAgents','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x72de8b,_0x161b46){var _0x33b93e=function(_0x38e161){while(--_0x38e161){_0x72de8b['push'](_0x72de8b['shift']());}};_0x33b93e(++_0x161b46);}(_0x8011,0x1ee));var _0x1801=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x8011[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x1801('0x0'));var util=require(_0x1801('0x1'));var path=require(_0x1801('0x2'));var timeout=require(_0x1801('0x3'));var express=require(_0x1801('0x4'));var router=express[_0x1801('0x5')]();var fs_extra=require(_0x1801('0x6'));var auth=require(_0x1801('0x7'));var interaction=require(_0x1801('0x8'));var config=require(_0x1801('0x9'));var controller=require(_0x1801('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x1801('0xb')]);router[_0x1801('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1801('0xd')]);router['get'](_0x1801('0xe'),auth[_0x1801('0xf')](),controller[_0x1801('0x10')]);router[_0x1801('0xc')](_0x1801('0x11'),auth[_0x1801('0xf')](),controller['getHopperHistories']);router['get']('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x1801('0x12')]);router[_0x1801('0xc')](_0x1801('0x13'),auth[_0x1801('0xf')](),controller['getHopperBlacks']);router[_0x1801('0xc')](_0x1801('0x14'),auth[_0x1801('0xf')](),controller[_0x1801('0x15')]);router[_0x1801('0xc')](_0x1801('0x16'),auth[_0x1801('0xf')](),controller[_0x1801('0x17')]);router[_0x1801('0xc')](_0x1801('0x18'),auth['isAuthenticated'](),controller[_0x1801('0x19')]);router[_0x1801('0xc')]('/:id/lists',auth[_0x1801('0xf')](),controller[_0x1801('0x1a')]);router[_0x1801('0xc')](_0x1801('0x1b'),auth[_0x1801('0xf')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x1801('0x1c')]);router[_0x1801('0x1d')]('/:id/clone',auth[_0x1801('0xf')](),controller['clone']);router['post'](_0x1801('0x14'),auth[_0x1801('0xf')](),controller[_0x1801('0x1e')]);router[_0x1801('0x1d')](_0x1801('0x16'),auth[_0x1801('0xf')](),controller[_0x1801('0x1f')]);router[_0x1801('0x1d')](_0x1801('0x20'),auth[_0x1801('0xf')](),controller['addLists']);router[_0x1801('0x1d')](_0x1801('0x1b'),auth[_0x1801('0xf')](),controller[_0x1801('0x21')]);router[_0x1801('0x22')](_0x1801('0x23'),auth[_0x1801('0xf')](),controller[_0x1801('0x24')]);router['delete'](_0x1801('0x23'),auth[_0x1801('0xf')](),controller[_0x1801('0x25')]);router['delete'](_0x1801('0x14'),auth[_0x1801('0xf')](),controller['removeTeams']);router[_0x1801('0x26')]('/:id/users',auth[_0x1801('0xf')](),controller[_0x1801('0x27')]);router[_0x1801('0x26')](_0x1801('0x20'),auth[_0x1801('0xf')](),controller['removeLists']);router[_0x1801('0x26')](_0x1801('0x1b'),auth[_0x1801('0xf')](),controller[_0x1801('0x28')]);module[_0x1801('0x29')]=router;
\ No newline at end of file
+var _0x277d=['addTeams','addAgents','addLists','addBlackLists','/:id','delete','destroy','removeTeams','removeAgents','/:id/lists','removeBlackLists','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueue.controller','index','isAuthenticated','/:id/hoppers','getHoppers','get','/:id/hopper_finals','/:id/hopper_black','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','post','/:id/clone','clone'];(function(_0x766a14,_0x59152d){var _0x3507ab=function(_0x2ff8da){while(--_0x2ff8da){_0x766a14['push'](_0x766a14['shift']());}};_0x3507ab(++_0x59152d);}(_0x277d,0xe9));var _0xd277=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x277d[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require(_0xd277('0x0'));var path=require(_0xd277('0x1'));var timeout=require('connect-timeout');var express=require(_0xd277('0x2'));var router=express[_0xd277('0x3')]();var fs_extra=require(_0xd277('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd277('0x5'));var config=require(_0xd277('0x6'));var controller=require(_0xd277('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd277('0x8')]);router['get']('/:id',auth[_0xd277('0x9')](),controller['show']);router['get'](_0xd277('0xa'),auth[_0xd277('0x9')](),controller[_0xd277('0xb')]);router[_0xd277('0xc')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0xd277('0xd'),auth[_0xd277('0x9')](),controller['getHopperFinals']);router[_0xd277('0xc')](_0xd277('0xe'),auth[_0xd277('0x9')](),controller['getHopperBlacks']);router[_0xd277('0xc')](_0xd277('0xf'),auth['isAuthenticated'](),controller[_0xd277('0x10')]);router[_0xd277('0xc')](_0xd277('0x11'),auth[_0xd277('0x9')](),controller[_0xd277('0x12')]);router[_0xd277('0xc')](_0xd277('0x13'),auth[_0xd277('0x9')](),controller[_0xd277('0x14')]);router['get']('/:id/lists',auth[_0xd277('0x9')](),controller[_0xd277('0x15')]);router[_0xd277('0xc')](_0xd277('0x16'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xd277('0x17')]('/',auth[_0xd277('0x9')](),controller['create']);router[_0xd277('0x17')](_0xd277('0x18'),auth[_0xd277('0x9')](),controller[_0xd277('0x19')]);router[_0xd277('0x17')](_0xd277('0xf'),auth[_0xd277('0x9')](),controller[_0xd277('0x1a')]);router[_0xd277('0x17')](_0xd277('0x11'),auth[_0xd277('0x9')](),controller[_0xd277('0x1b')]);router[_0xd277('0x17')]('/:id/lists',auth[_0xd277('0x9')](),controller[_0xd277('0x1c')]);router[_0xd277('0x17')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd277('0x1d')]);router['put'](_0xd277('0x1e'),auth[_0xd277('0x9')](),controller['update']);router[_0xd277('0x1f')](_0xd277('0x1e'),auth[_0xd277('0x9')](),controller[_0xd277('0x20')]);router[_0xd277('0x1f')](_0xd277('0xf'),auth[_0xd277('0x9')](),controller[_0xd277('0x21')]);router[_0xd277('0x1f')](_0xd277('0x11'),auth['isAuthenticated'](),controller[_0xd277('0x22')]);router[_0xd277('0x1f')](_0xd277('0x23'),auth[_0xd277('0x9')](),controller['removeLists']);router[_0xd277('0x1f')](_0xd277('0x16'),auth['isAuthenticated'](),controller[_0xd277('0x24')]);module['exports']=router;
\ No newline at end of file
index e798b8f..cd8e8ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd20=['FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','exports','ENUM','inbound','default','STRING','ringall','leastrecent','rrmemory','linear','wrandom','rrordered','setDataValue','type','getDataValue','dialMethod','strategy','booked','progressive','predictive','power','INTEGER','yes','once','periodic_announce','join','joinempty','split','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfd20,0x66));var _0x0fd2=function(_0x1832a0,_0x4ac21c){_0x1832a0=_0x1832a0-0x0;var _0x4fed96=_0xfd20[_0x1832a0];return _0x4fed96;};'use strict';var Sequelize=require('sequelize');module[_0x0fd2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x2'),'outbound'),'allowNull':![],'defaultValue':_0x0fd2('0x2')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x0fd2('0x3')},'announce':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0fd2('0x1')]('rr',_0x0fd2('0x5'),_0x0fd2('0x6'),'fewestcalls','random',_0x0fd2('0x7'),_0x0fd2('0x8'),_0x0fd2('0x9'),_0x0fd2('0xa')),'allowNull':![],'defaultValue':_0x0fd2('0x5'),'set':function(_0x195948){this[_0x0fd2('0xb')]('strategy',_0x195948?_0x195948:_0x0fd2('0x7'));},'get':function(){var _0x343e7a=this['getDataValue'](_0x0fd2('0xc'));var _0x56dfa2=this[_0x0fd2('0xd')](_0x0fd2('0xe'));var _0x42ea5c=this[_0x0fd2('0xd')](_0x0fd2('0xf'));if(_0x343e7a===_0x0fd2('0x2')){return _0x42ea5c;}if(_0x56dfa2===_0x0fd2('0x10')&&_0x42ea5c===_0x0fd2('0x7')||_0x56dfa2==='booked'&&_0x42ea5c==='roundrobin'){return _0x42ea5c;}if(_0x56dfa2===_0x0fd2('0x11')||_0x56dfa2===_0x0fd2('0x12')||_0x56dfa2===_0x0fd2('0x13')){return _0x42ea5c;}return null;}},'servicelevel':{'type':Sequelize[_0x0fd2('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0fd2('0x14')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0fd2('0x4')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0fd2('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x0fd2('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0fd2('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x0fd2('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0fd2('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0fd2('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0fd2('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x15'),'no'),'defaultValue':_0x0fd2('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x0fd2('0x15'),'no',_0x0fd2('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x0fd2('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0fd2('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0fd2('0x4')]},'queue_youarenext':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0fd2('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0fd2('0x4')]},'queue_quantity1':{'type':Sequelize[_0x0fd2('0x4')]},'queue_quantity2':{'type':Sequelize[_0x0fd2('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x0fd2('0x4')]},'queue_less_than':{'type':Sequelize[_0x0fd2('0x4')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x370047){this[_0x0fd2('0xb')](_0x0fd2('0x17'),_0x370047?_0x370047[_0x0fd2('0x18')](','):[]);},'get':function(){return this[_0x0fd2('0xd')](_0x0fd2('0x17'))?this[_0x0fd2('0xd')](_0x0fd2('0x17'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':'yes','set':function(_0x568ac0){this[_0x0fd2('0xb')]('joinempty',_0x568ac0?_0x568ac0[_0x0fd2('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0x0fd2('0x19'))?this['getDataValue']('joinempty')[_0x0fd2('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':'no','set':function(_0x3a5c95){this['setDataValue']('leavewhenempty',_0x3a5c95?_0x3a5c95[_0x0fd2('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0x0fd2('0x1b'))?this[_0x0fd2('0xd')](_0x0fd2('0x1b'))[_0x0fd2('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0fd2('0x1')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0fd2('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0fd2('0x1')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0fd2('0x4')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x529404){this[_0x0fd2('0xb')](_0x0fd2('0x1c'),_0x529404);if(_0x529404){if(this[_0x0fd2('0xd')](_0x0fd2('0x1d'))<0x2){this[_0x0fd2('0xb')](_0x0fd2('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0fd2('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0fd2('0x1e')],'defaultValue':0x0,'comment':_0x0fd2('0x1f')},'dialMethod':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x20'),_0x0fd2('0x11'),_0x0fd2('0x13'),_0x0fd2('0x12'),_0x0fd2('0x10')),'defaultValue':_0x0fd2('0x11'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x0fd2('0x14')](0x4)[_0x0fd2('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0fd2('0x22')},'dialLimitQueue':{'type':Sequelize[_0x0fd2('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0fd2('0x23')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0fd2('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0fd2('0x24')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x0fd2('0x25'),_0x0fd2('0x26')),'defaultValue':_0x0fd2('0x26'),'comment':_0x0fd2('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0fd2('0x28')](0x2)[_0x0fd2('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0fd2('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0fd2('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0fd2('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0fd2('0x21')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0fd2('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x0fd2('0x2b'),'comment':_0x0fd2('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0fd2('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0fd2('0x4')],'comment':_0x0fd2('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0fd2('0x14')](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0fd2('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0fd2('0x14')](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0fd2('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0fd2('0x31')},'dialTimezone':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x0fd2('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0fd2('0x32'),_0x0fd2('0x33'),'onlyIfOpen'),'defaultValue':_0x0fd2('0x32')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0fd2('0x14')](0x9)[_0x0fd2('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0fd2('0x34')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0fd2('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0fd2('0x35')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0fd2('0x14')](0x9)[_0x0fd2('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0fd2('0x14')](0x9)[_0x0fd2('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0fd2('0x36')},'dialAMDMinWordLength':{'type':Sequelize[_0x0fd2('0x14')](0x9)[_0x0fd2('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0fd2('0x37')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0fd2('0x14')](0x9)[_0x0fd2('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0fd2('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0fd2('0x14')](0x9)[_0x0fd2('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0fd2('0x14')](0x5)[_0x0fd2('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0fd2('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0fd2('0x39')},'dialRecallMeTimeout':{'type':Sequelize[_0x0fd2('0x14')](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0fd2('0x3a')},'dialRecallInQueue':{'type':Sequelize[_0x0fd2('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0fd2('0x1')](_0x0fd2('0x3b'),_0x0fd2('0x3c')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x0fd2('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0fd2('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0fd2('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0fd2('0x3d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0fd2('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0fd2('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0fd2('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0fd2('0x14')](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0fd2('0x40')},'dialDropMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0fd2('0x41')},'dialDropRetryFrequency':{'type':Sequelize[_0x0fd2('0x14')](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0fd2('0x14')](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0fd2('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0fd2('0x43')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0fd2('0x14')](0x3)[_0x0fd2('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0fd2('0x44')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0fd2('0x14')](0x5)[_0x0fd2('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0fd2('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0fd2('0x14')],'allowNull':!![],'comment':_0x0fd2('0x46')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x574ff7){if(!_0x574ff7)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x0fd2('0xb')]('mandatoryDisposition',_0x574ff7);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0fd2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0fd2('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0x09f4=['FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','inbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','predictive','power','INTEGER','yes','once','join','periodic_announce','joinempty','split','leavewhenempty','acw','wrapuptime','preview','progressive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x09f4,0x1a5));var _0x409f=function(_0x18801d,_0x3fee8e){_0x18801d=_0x18801d-0x0;var _0x3e98e0=_0x09f4[_0x18801d];return _0x3e98e0;};'use strict';var Sequelize=require('sequelize');module[_0x409f('0x0')]={'name':{'type':Sequelize[_0x409f('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x409f('0x3')},'musiconhold':{'type':Sequelize[_0x409f('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x409f('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x409f('0x2')]('rr',_0x409f('0x4'),_0x409f('0x5'),_0x409f('0x6'),_0x409f('0x7'),_0x409f('0x8'),_0x409f('0x9'),_0x409f('0xa'),_0x409f('0xb')),'allowNull':![],'defaultValue':_0x409f('0x4'),'set':function(_0xc1b11c){this[_0x409f('0xc')](_0x409f('0xd'),_0xc1b11c?_0xc1b11c:_0x409f('0x8'));},'get':function(){var _0x18fb4f=this[_0x409f('0xe')](_0x409f('0xf'));var _0x3e8d0b=this[_0x409f('0xe')](_0x409f('0x10'));var _0x51cc41=this['getDataValue'](_0x409f('0xd'));if(_0x18fb4f===_0x409f('0x3')){return _0x51cc41;}if(_0x3e8d0b===_0x409f('0x11')&&_0x51cc41===_0x409f('0x8')||_0x3e8d0b===_0x409f('0x11')&&_0x51cc41==='roundrobin'){return _0x51cc41;}if(_0x3e8d0b==='progressive'||_0x3e8d0b===_0x409f('0x12')||_0x3e8d0b===_0x409f('0x13')){return _0x51cc41;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x409f('0x14')](0xb)},'timeout':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x409f('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x409f('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x409f('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x409f('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x409f('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x409f('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':_0x409f('0x15')},'announce_holdtime':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no',_0x409f('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x409f('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x409f('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x409f('0x1')]},'queue_youarenext':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x409f('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x409f('0x1')]},'queue_quantity1':{'type':Sequelize[_0x409f('0x1')]},'queue_quantity2':{'type':Sequelize[_0x409f('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1cb172){this[_0x409f('0xc')]('periodic_announce',_0x1cb172?_0x1cb172[_0x409f('0x17')](','):[]);},'get':function(){return this[_0x409f('0xe')]('periodic_announce')?this[_0x409f('0xe')](_0x409f('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x409f('0x1')],'defaultValue':_0x409f('0x15'),'set':function(_0x50a99d){this[_0x409f('0xc')]('joinempty',_0x50a99d?_0x50a99d[_0x409f('0x17')](','):undefined);},'get':function(){return this[_0x409f('0xe')](_0x409f('0x19'))?this[_0x409f('0xe')](_0x409f('0x19'))[_0x409f('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x409f('0x1')],'defaultValue':'no','set':function(_0x4db384){this['setDataValue'](_0x409f('0x1b'),_0x4db384?_0x4db384[_0x409f('0x17')](','):undefined);},'get':function(){return this[_0x409f('0xe')](_0x409f('0x1b'))?this[_0x409f('0xe')](_0x409f('0x1b'))[_0x409f('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x409f('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x409f('0x2')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x409f('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x409f('0x1')]},'description':{'type':Sequelize[_0x409f('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x40c8d3){this[_0x409f('0xc')](_0x409f('0x1c'),_0x40c8d3);if(_0x40c8d3){if(this[_0x409f('0xe')](_0x409f('0x1d'))<0x2){this[_0x409f('0xc')](_0x409f('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x1e'),_0x409f('0x1f'),'power','predictive',_0x409f('0x11')),'defaultValue':_0x409f('0x1f'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x409f('0x14')](0x4)[_0x409f('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x409f('0x21')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x409f('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x409f('0x22')},'dialPowerLevel':{'type':Sequelize[_0x409f('0x23')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x409f('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x25'),'dropRate'),'defaultValue':'dropRate','comment':_0x409f('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x409f('0x23')](0x2)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x409f('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x409f('0x28')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x409f('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x29')},'dialQueueOptions':{'type':Sequelize[_0x409f('0x1')],'defaultValue':_0x409f('0x2a'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x409f('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x409f('0x2b')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'defaultValue':0x3,'comment':_0x409f('0x2e')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x409f('0x1')],'defaultValue':_0x409f('0x30')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x409f('0x31'),_0x409f('0x32'),_0x409f('0x33')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x409f('0x34')],'defaultValue':0x0,'comment':_0x409f('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x409f('0x14')](0x9)[_0x409f('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x409f('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x409f('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x409f('0x20')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x409f('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x409f('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x409f('0x14')](0x9)[_0x409f('0x20')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x409f('0x14')](0x9)[_0x409f('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x409f('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x409f('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x409f('0x39')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x409f('0x14')](0x9)[_0x409f('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x409f('0x3a')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x409f('0x20')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x409f('0x3b')},'dialRecallInQueue':{'type':Sequelize[_0x409f('0x34')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x409f('0x2')]('DESC',_0x409f('0x3c')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x409f('0x1')],'comment':_0x409f('0x2b')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x409f('0x34')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x409f('0x34')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x409f('0x3d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x409f('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x40')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x41')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x42')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x409f('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x43')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x44')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x409f('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x409f('0x34')],'defaultValue':![],'comment':_0x409f('0x49'),'set':function(_0x3763cc){if(!_0x3763cc)this[_0x409f('0xc')](_0x409f('0x4a'),null);this[_0x409f('0xc')](_0x409f('0x4b'),_0x3763cc);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index d3b5afa..f412db8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cc2=['Agents','online','voicePause','interface','forEach','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','penalty','emit','removeTeams','ids','select','field','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','every','includes','all','compact','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','destroy','sendStatus','error','stack','name','send','index','VoiceQueue','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','params','findOne','pick','VoiceQueueId','CmHopper','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User'];(function(_0x221eae,_0x2a3fa6){var _0x86f9f3=function(_0x59b699){while(--_0x59b699){_0x221eae['push'](_0x221eae['shift']());}};_0x86f9f3(++_0x2a3fa6);}(_0x0cc2,0xf5));var _0x20cc=function(_0x27dced,_0x1f294e){_0x27dced=_0x27dced-0x0;var _0xcb128c=_0x0cc2[_0x27dced];return _0xcb128c;};'use strict';var emlformat=require(_0x20cc('0x0'));var rimraf=require(_0x20cc('0x1'));var zipdir=require(_0x20cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20cc('0x3'));var moment=require(_0x20cc('0x4'));var BPromise=require(_0x20cc('0x5'));var Mustache=require(_0x20cc('0x6'));var util=require(_0x20cc('0x7'));var path=require('path');var sox=require(_0x20cc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20cc('0x9'));var _=require('lodash');var squel=require(_0x20cc('0xa'));var crypto=require(_0x20cc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20cc('0xc'));var querystring=require(_0x20cc('0xd'));var Papa=require('papaparse');var Redis=require(_0x20cc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x20cc('0xf'));var hardwareService=require(_0x20cc('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x20cc('0x11'));var config=require(_0x20cc('0x12'));var licenseUtil=require(_0x20cc('0x13'));var db=require(_0x20cc('0x14'))['db'];config[_0x20cc('0x15')]=_[_0x20cc('0x16')](config[_0x20cc('0x15')],{'host':_0x20cc('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20cc('0x15')]));require(_0x20cc('0x18'))['register'](socket);function respondWithStatusCode(_0x9814de,_0x3143a9){_0x3143a9=_0x3143a9||0xcc;return function(_0x411648){if(_0x411648){return _0x9814de['sendStatus'](_0x3143a9);}return _0x9814de['status'](_0x3143a9)[_0x20cc('0x19')]();};}function respondWithResult(_0x3fa2e8,_0x29d26f){_0x29d26f=_0x29d26f||0xc8;return function(_0x522166){if(_0x522166){return _0x3fa2e8[_0x20cc('0x1a')](_0x29d26f)[_0x20cc('0x1b')](_0x522166);}};}function respondWithFilteredResult(_0x4174db,_0x8a1b8b){return function(_0x336ac1){if(_0x336ac1){var _0x321e35=typeof _0x8a1b8b['offset']===_0x20cc('0x1c')&&typeof _0x8a1b8b[_0x20cc('0x1d')]===_0x20cc('0x1c');var _0x471f3e=_0x336ac1[_0x20cc('0x1e')];var _0x5ea30f=_0x321e35?0x0:_0x8a1b8b[_0x20cc('0x1f')];var _0x17d6c6=_0x321e35?_0x336ac1[_0x20cc('0x1e')]:_0x8a1b8b[_0x20cc('0x1f')]+_0x8a1b8b['limit'];var _0x1dcc9f;if(_0x17d6c6>=_0x471f3e){_0x17d6c6=_0x471f3e;_0x1dcc9f=0xc8;}else{_0x1dcc9f=0xce;}_0x4174db[_0x20cc('0x1a')](_0x1dcc9f);return _0x4174db[_0x20cc('0x20')](_0x20cc('0x21'),_0x5ea30f+'-'+_0x17d6c6+'/'+_0x471f3e)[_0x20cc('0x1b')](_0x336ac1);}return null;};}function patchUpdates(_0x1e7107){return function(_0x531556){try{jsonpatch[_0x20cc('0x22')](_0x531556,_0x1e7107,!![]);}catch(_0x39b275){return BPromise['reject'](_0x39b275);}return _0x531556[_0x20cc('0x23')]();};}function saveUpdates(_0x52f8fe,_0x59f519){return function(_0x2835e6){if(_0x2835e6){return _0x2835e6[_0x20cc('0x24')](_0x52f8fe)[_0x20cc('0x25')](function(_0x69850b){return _0x69850b;});}return null;};}function removeEntity(_0x50cf80,_0x122771){return function(_0x1bcdec){if(_0x1bcdec){return _0x1bcdec['destroy']()[_0x20cc('0x25')](function(){var _0x2197a6=_0x1bcdec[_0x20cc('0x26')]({'plain':!![]});var _0x2afe14=[{'name':_0x20cc('0x27'),'value':_0x20cc('0x28'),'ignore':![]},{'name':_0x20cc('0x29'),'value':_0x20cc('0x2a'),'ignore':![]}];var _0x3e7b80=_(_0x2afe14)[_0x20cc('0x2b')](_0x20cc('0x2c'))['map']('value')[_0x20cc('0x2d')]();if(_['includes'](_0x3e7b80,_0x2197a6['type'])){return;}var _0x3d8d39=_['find'](_0x2afe14,[_0x20cc('0x2d'),_0x2197a6['type']])['name'];return db['UserProfileResource'][_0x20cc('0x2e')]({'where':{'type':_0x3d8d39,'resourceId':_0x2197a6['id']}})['then'](function(){return _0x1bcdec;});})[_0x20cc('0x25')](function(){_0x50cf80[_0x20cc('0x1a')](0xcc)[_0x20cc('0x19')]();});}};}function handleEntityNotFound(_0x2ea1d8,_0x4b47c5){return function(_0x39baba){if(!_0x39baba){_0x2ea1d8[_0x20cc('0x2f')](0x194);}return _0x39baba;};}function handleError(_0x504c98,_0x2ee223){_0x2ee223=_0x2ee223||0x1f4;return function(_0x2f46ab){logger[_0x20cc('0x30')](_0x2f46ab[_0x20cc('0x31')]);if(_0x2f46ab[_0x20cc('0x32')]){delete _0x2f46ab[_0x20cc('0x32')];}_0x504c98['status'](_0x2ee223)[_0x20cc('0x33')](_0x2f46ab);};}exports[_0x20cc('0x34')]=function(_0x48f339,_0x2513a8){var _0xad92b3={},_0x39143c={},_0x431c58={'count':0x0,'rows':[]};var _0x18ca61=_['map'](db[_0x20cc('0x35')]['rawAttributes'],function(_0x969aca){return{'name':_0x969aca[_0x20cc('0x36')],'type':_0x969aca[_0x20cc('0x37')][_0x20cc('0x38')]};});_0x39143c[_0x20cc('0x39')]=_['map'](_0x18ca61,_0x20cc('0x32'));_0x39143c[_0x20cc('0x3a')]=_[_0x20cc('0x3b')](_0x48f339[_0x20cc('0x3a')]);_0x39143c[_0x20cc('0x3c')]=_[_0x20cc('0x3d')](_0x39143c['model'],_0x39143c['query']);_0xad92b3['attributes']=_[_0x20cc('0x3d')](_0x39143c[_0x20cc('0x39')],qs[_0x20cc('0x3e')](_0x48f339[_0x20cc('0x3a')][_0x20cc('0x3e')]));_0xad92b3[_0x20cc('0x3f')]=_0xad92b3['attributes'][_0x20cc('0x40')]?_0xad92b3[_0x20cc('0x3f')]:_0x39143c['model'];if(!_0x48f339[_0x20cc('0x3a')][_0x20cc('0x41')](_0x20cc('0x42'))){_0xad92b3['limit']=qs[_0x20cc('0x1d')](_0x48f339[_0x20cc('0x3a')][_0x20cc('0x1d')]);_0xad92b3[_0x20cc('0x1f')]=qs[_0x20cc('0x1f')](_0x48f339[_0x20cc('0x3a')][_0x20cc('0x1f')]);}_0xad92b3['order']=qs[_0x20cc('0x43')](_0x48f339['query'][_0x20cc('0x43')]);_0xad92b3['where']=qs[_0x20cc('0x3c')](_['pick'](_0x48f339[_0x20cc('0x3a')],_0x39143c[_0x20cc('0x3c')]),_0x18ca61);if(_0x48f339[_0x20cc('0x3a')]['filter']){_0xad92b3[_0x20cc('0x44')]=_[_0x20cc('0x45')](_0xad92b3[_0x20cc('0x44')],{'$or':_[_0x20cc('0x46')](_0x18ca61,function(_0x2782ac){if(_0x2782ac[_0x20cc('0x37')]!==_0x20cc('0x47')){var _0x684c29={};_0x684c29[_0x2782ac[_0x20cc('0x32')]]={'$like':'%'+_0x48f339['query'][_0x20cc('0x2b')]+'%'};return _0x684c29;}})});}_0xad92b3=_['merge']({},_0xad92b3,_0x48f339[_0x20cc('0x48')]);var _0x54a438={'where':_0xad92b3['where']};return db[_0x20cc('0x35')][_0x20cc('0x1e')](_0x54a438)['then'](function(_0x5e49a3){_0x431c58['count']=_0x5e49a3;if(_0x48f339['query']['includeAll']){_0xad92b3[_0x20cc('0x49')]=[{'all':!![]}];}return db[_0x20cc('0x35')][_0x20cc('0x4a')](_0xad92b3);})[_0x20cc('0x25')](function(_0xa46375){_0x431c58[_0x20cc('0x4b')]=_0xa46375;return _0x431c58;})[_0x20cc('0x25')](respondWithFilteredResult(_0x2513a8,_0xad92b3))[_0x20cc('0x4c')](handleError(_0x2513a8,null));};exports[_0x20cc('0x4d')]=function(_0x2abb7b,_0x2cbcaf){var _0x59198d={'raw':![],'where':{'id':_0x2abb7b['params']['id']}},_0x3f8082={};_0x3f8082['model']=_[_0x20cc('0x3b')](db[_0x20cc('0x35')][_0x20cc('0x4e')]);_0x3f8082[_0x20cc('0x3a')]=_[_0x20cc('0x3b')](_0x2abb7b[_0x20cc('0x3a')]);_0x3f8082['filters']=_[_0x20cc('0x3d')](_0x3f8082[_0x20cc('0x39')],_0x3f8082['query']);_0x59198d['attributes']=_['intersection'](_0x3f8082[_0x20cc('0x39')],qs[_0x20cc('0x3e')](_0x2abb7b[_0x20cc('0x3a')][_0x20cc('0x3e')]));_0x59198d['attributes']=_0x59198d[_0x20cc('0x3f')][_0x20cc('0x40')]?_0x59198d['attributes']:_0x3f8082[_0x20cc('0x39')];if(_0x2abb7b[_0x20cc('0x3a')][_0x20cc('0x4f')]){_0x59198d[_0x20cc('0x49')]=[{'all':!![]}];}_0x59198d=_[_0x20cc('0x45')]({},_0x59198d,_0x2abb7b['options']);return db[_0x20cc('0x35')][_0x20cc('0x50')](_0x59198d)[_0x20cc('0x25')](handleEntityNotFound(_0x2cbcaf,null))[_0x20cc('0x25')](respondWithResult(_0x2cbcaf,null))[_0x20cc('0x4c')](handleError(_0x2cbcaf,null));};exports[_0x20cc('0x51')]=function(_0x1632fc,_0x404763){return db[_0x20cc('0x35')][_0x20cc('0x51')](_0x1632fc[_0x20cc('0x52')],{})[_0x20cc('0x25')](function(_0x2c0336){var _0x2f6b9d=_0x1632fc[_0x20cc('0x53')]['get']({'plain':!![]});if(!_0x2f6b9d)throw new Error(_0x20cc('0x54'));if(_0x2f6b9d[_0x20cc('0x55')]==='user'){var _0x3bf74e=_0x2c0336[_0x20cc('0x26')]({'plain':!![]});var _0x589be1=[{'name':_0x20cc('0x27'),'value':_0x20cc('0x28')},{'name':_0x20cc('0x29'),'value':'outbound'}];var _0x5c48d1=_[_0x20cc('0x50')](_0x589be1,[_0x20cc('0x2d'),_0x3bf74e['type']])['name'];return db[_0x20cc('0x56')]['find']({'where':{'name':_0x5c48d1,'userProfileId':_0x2f6b9d[_0x20cc('0x57')]},'raw':!![]})['then'](function(_0x47ce30){if(_0x47ce30&&_0x47ce30[_0x20cc('0x58')]===0x0){return db[_0x20cc('0x59')]['create']({'name':_0x3bf74e[_0x20cc('0x32')],'resourceId':_0x3bf74e['id'],'type':_0x47ce30[_0x20cc('0x32')],'sectionId':_0x47ce30['id']},{})[_0x20cc('0x25')](function(){return _0x2c0336;});}else{return _0x2c0336;}})[_0x20cc('0x4c')](function(_0x16d5f6){logger['error'](_0x20cc('0x5a'),_0x16d5f6);throw _0x16d5f6;});}return _0x2c0336;})[_0x20cc('0x25')](respondWithResult(_0x404763,0xc9))[_0x20cc('0x4c')](handleError(_0x404763,null));};exports[_0x20cc('0x5b')]=function(_0xe0b89d,_0x619f6b){var _0x5017af={'where':{'id':_0xe0b89d['params']['id']}},_0x3140d8={};_0x3140d8[_0x20cc('0x39')]=_[_0x20cc('0x3b')](db[_0x20cc('0x35')][_0x20cc('0x4e')]);_0x5017af[_0x20cc('0x3f')]=_[_0x20cc('0x3d')](_0x3140d8['model'],qs[_0x20cc('0x3e')](_0xe0b89d['query']['fields']));_0x5017af[_0x20cc('0x3f')]=_0x5017af[_0x20cc('0x3f')][_0x20cc('0x40')]?_0x5017af['attributes']:_0x3140d8['model'];if(_0xe0b89d[_0x20cc('0x3a')][_0x20cc('0x4f')]){_0x5017af[_0x20cc('0x49')]=[{'all':!![]}];}_0x5017af=_[_0x20cc('0x45')]({},_0x5017af,_0xe0b89d['options']);return db[_0x20cc('0x35')][_0x20cc('0x50')](_0x5017af)[_0x20cc('0x25')](handleEntityNotFound(_0x619f6b,null))[_0x20cc('0x25')](function(_0x452308){if(_0x452308){var _0x464d39=_0x452308[_0x20cc('0x26')]({'plain':!![]});_0x464d39=qs['omit'](_0x464d39,['id',_0x20cc('0x5c'),_0x20cc('0x5d')]);_0xe0b89d[_0x20cc('0x52')]=_[_0x20cc('0x5e')](_0xe0b89d[_0x20cc('0x52')],['id',_0x20cc('0x5c'),_0x20cc('0x5d')]);return db['VoiceQueue']['create'](_[_0x20cc('0x45')](_0x464d39,_0xe0b89d[_0x20cc('0x52')]),{'include':_0xe0b89d[_0x20cc('0x3a')][_0x20cc('0x4f')]?[{'all':!![]}]:undefined})[_0x20cc('0x25')](function(_0x2014b3){var _0x40aebf=_0xe0b89d['user']['get']({'plain':!![]});if(!_0x40aebf)throw new Error(_0x20cc('0x54'));if(_0x40aebf['role']===_0x20cc('0x53')){var _0x3417fb=_0x2014b3[_0x20cc('0x26')]({'plain':!![]});var _0x5cd9a7=[{'name':'VoiceQueues','value':_0x20cc('0x28')},{'name':_0x20cc('0x29'),'value':_0x20cc('0x2a')}];var _0x285cd8=_[_0x20cc('0x50')](_0x5cd9a7,[_0x20cc('0x2d'),_0x3417fb[_0x20cc('0x37')]])[_0x20cc('0x32')];return db[_0x20cc('0x56')][_0x20cc('0x50')]({'where':{'name':_0x285cd8,'userProfileId':_0x40aebf['userProfileId']},'raw':!![]})['then'](function(_0x245612){if(_0x245612&&_0x245612[_0x20cc('0x58')]===0x0){return db['UserProfileResource'][_0x20cc('0x51')]({'name':_0x3417fb[_0x20cc('0x32')],'resourceId':_0x3417fb['id'],'type':_0x245612['name'],'sectionId':_0x245612['id']},{})[_0x20cc('0x25')](function(){return _0x2014b3;});}else{return _0x2014b3;}})['catch'](function(_0x16ed88){logger[_0x20cc('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16ed88);throw _0x16ed88;});}return _0x2014b3;});}})['then'](respondWithResult(_0x619f6b,0xc9))[_0x20cc('0x4c')](handleError(_0x619f6b,null));};exports[_0x20cc('0x24')]=function(_0x134245,_0x2f0f77){if(_0x134245['body']['id']){delete _0x134245[_0x20cc('0x52')]['id'];}return db[_0x20cc('0x35')]['find']({'where':{'id':_0x134245[_0x20cc('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2f0f77,null))[_0x20cc('0x25')](saveUpdates(_0x134245['body'],null))[_0x20cc('0x25')](respondWithResult(_0x2f0f77,null))[_0x20cc('0x4c')](handleError(_0x2f0f77,null));};exports[_0x20cc('0x2e')]=function(_0x58d269,_0x480980){return db[_0x20cc('0x35')][_0x20cc('0x50')]({'where':{'id':_0x58d269[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x480980,null))[_0x20cc('0x25')](removeEntity(_0x480980,null))[_0x20cc('0x4c')](handleError(_0x480980,null));};exports['getHoppers']=function(_0x4a4b18,_0x5667ce,_0x143d1c){var _0x3603c9={'raw':![],'where':{}};var _0x453760={};var _0x414ba8={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x20cc('0x60')]({'where':{'id':_0x4a4b18[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x5667ce,null))[_0x20cc('0x25')](function(_0x56f4ae){if(_0x56f4ae){_0x453760[_0x20cc('0x39')]=_[_0x20cc('0x3b')](db['CmHopper']['rawAttributes']);_0x453760[_0x20cc('0x3a')]=_[_0x20cc('0x3b')](_0x4a4b18['query']);_0x453760[_0x20cc('0x3c')]=_[_0x20cc('0x3d')](_0x453760[_0x20cc('0x39')],_0x453760[_0x20cc('0x3a')]);_0x3603c9['attributes']=_[_0x20cc('0x3d')](_0x453760[_0x20cc('0x39')],qs['fields'](_0x4a4b18['query'][_0x20cc('0x3e')]));_0x3603c9[_0x20cc('0x3f')]=_0x3603c9[_0x20cc('0x3f')][_0x20cc('0x40')]?_0x3603c9[_0x20cc('0x3f')]:_0x453760['model'];if(!_0x4a4b18[_0x20cc('0x3a')][_0x20cc('0x41')](_0x20cc('0x42'))){_0x3603c9[_0x20cc('0x1d')]=qs[_0x20cc('0x1d')](_0x4a4b18['query'][_0x20cc('0x1d')]);_0x3603c9['offset']=qs[_0x20cc('0x1f')](_0x4a4b18[_0x20cc('0x3a')]['offset']);}_0x3603c9['order']=qs[_0x20cc('0x43')](_0x4a4b18['query'][_0x20cc('0x43')]);_0x3603c9['where']=qs[_0x20cc('0x3c')](_[_0x20cc('0x61')](_0x4a4b18[_0x20cc('0x3a')],_0x453760[_0x20cc('0x3c')]));_0x3603c9[_0x20cc('0x44')][_0x20cc('0x62')]=_0x56f4ae['id'];if(_0x4a4b18[_0x20cc('0x3a')]['filter']){_0x3603c9['where']=_[_0x20cc('0x45')](_0x3603c9[_0x20cc('0x44')],{'$or':_[_0x20cc('0x46')](_0x3603c9['attributes'],function(_0x434b0c){var _0x771132={};_0x771132[_0x434b0c]={'$like':'%'+_0x4a4b18['query'][_0x20cc('0x2b')]+'%'};return _0x771132;})});}_0x3603c9=_['merge']({},_0x3603c9,_0x4a4b18['options']);return db[_0x20cc('0x63')][_0x20cc('0x1e')]({'where':_0x3603c9[_0x20cc('0x44')]})[_0x20cc('0x25')](function(_0x18207d){_0x414ba8[_0x20cc('0x1e')]=_0x18207d;if(_0x4a4b18['query'][_0x20cc('0x4f')]){_0x3603c9[_0x20cc('0x49')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3603c9);})[_0x20cc('0x25')](function(_0x242962){_0x414ba8['rows']=_0x242962;return _0x414ba8;});}})[_0x20cc('0x25')](respondWithFilteredResult(_0x5667ce,_0x3603c9))[_0x20cc('0x4c')](handleError(_0x5667ce,null));};exports['getHopperHistories']=function(_0x32718a,_0x176045,_0x4ba960){var _0x51258c={'raw':!![],'where':{}};var _0x49939a={};var _0x15dc6c={'count':0x0,'rows':[]};return db[_0x20cc('0x35')][_0x20cc('0x60')]({'where':{'id':_0x32718a[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x176045,null))[_0x20cc('0x25')](function(_0x27e0a5){if(_0x27e0a5){_0x49939a[_0x20cc('0x39')]=_[_0x20cc('0x3b')](db[_0x20cc('0x64')]['rawAttributes']);_0x49939a['query']=_[_0x20cc('0x3b')](_0x32718a[_0x20cc('0x3a')]);_0x49939a['filters']=_[_0x20cc('0x3d')](_0x49939a['model'],_0x49939a[_0x20cc('0x3a')]);_0x51258c[_0x20cc('0x3f')]=_[_0x20cc('0x3d')](_0x49939a[_0x20cc('0x39')],qs[_0x20cc('0x3e')](_0x32718a[_0x20cc('0x3a')][_0x20cc('0x3e')]));_0x51258c['attributes']=_0x51258c[_0x20cc('0x3f')][_0x20cc('0x40')]?_0x51258c[_0x20cc('0x3f')]:_0x49939a[_0x20cc('0x39')];if(!_0x32718a[_0x20cc('0x3a')][_0x20cc('0x41')](_0x20cc('0x42'))){_0x51258c[_0x20cc('0x1d')]=qs[_0x20cc('0x1d')](_0x32718a['query'][_0x20cc('0x1d')]);_0x51258c['offset']=qs[_0x20cc('0x1f')](_0x32718a[_0x20cc('0x3a')][_0x20cc('0x1f')]);}_0x51258c[_0x20cc('0x65')]=qs[_0x20cc('0x43')](_0x32718a[_0x20cc('0x3a')][_0x20cc('0x43')]);_0x51258c[_0x20cc('0x44')]=qs[_0x20cc('0x3c')](_[_0x20cc('0x61')](_0x32718a[_0x20cc('0x3a')],_0x49939a['filters']));_0x51258c[_0x20cc('0x44')][_0x20cc('0x62')]=_0x27e0a5['id'];if(_0x32718a[_0x20cc('0x3a')][_0x20cc('0x2b')]){_0x51258c[_0x20cc('0x44')]=_[_0x20cc('0x45')](_0x51258c[_0x20cc('0x44')],{'$or':_[_0x20cc('0x46')](_0x51258c[_0x20cc('0x3f')],function(_0x103e12){var _0x30d2a5={};_0x30d2a5[_0x103e12]={'$like':'%'+_0x32718a['query']['filter']+'%'};return _0x30d2a5;})});}_0x51258c=_[_0x20cc('0x45')]({},_0x51258c,_0x32718a[_0x20cc('0x48')]);return db[_0x20cc('0x64')][_0x20cc('0x1e')]({'where':_0x51258c['where']})[_0x20cc('0x25')](function(_0x55cd9d){_0x15dc6c['count']=_0x55cd9d;if(_0x32718a[_0x20cc('0x3a')][_0x20cc('0x4f')]){_0x51258c[_0x20cc('0x49')]=[{'all':!![]}];}return db[_0x20cc('0x64')][_0x20cc('0x4a')](_0x51258c);})[_0x20cc('0x25')](function(_0x5b0055){_0x15dc6c[_0x20cc('0x4b')]=_0x5b0055;return _0x15dc6c;});}})['then'](respondWithFilteredResult(_0x176045,_0x51258c))['catch'](handleError(_0x176045,null));};exports[_0x20cc('0x66')]=function(_0x156e4e,_0x18359e,_0x1e034c){var _0xf4c23b={'raw':!![],'where':{}};var _0xf6bd1={};var _0x375f86={'count':0x0,'rows':[]};return db[_0x20cc('0x35')][_0x20cc('0x60')]({'where':{'id':_0x156e4e[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x18359e,null))['then'](function(_0x342920){if(_0x342920){_0xf6bd1['model']=_['keys'](db['CmHopperFinal'][_0x20cc('0x4e')]);_0xf6bd1[_0x20cc('0x3a')]=_['keys'](_0x156e4e[_0x20cc('0x3a')]);_0xf6bd1[_0x20cc('0x3c')]=_[_0x20cc('0x3d')](_0xf6bd1[_0x20cc('0x39')],_0xf6bd1[_0x20cc('0x3a')]);_0xf4c23b[_0x20cc('0x3f')]=_['intersection'](_0xf6bd1['model'],qs[_0x20cc('0x3e')](_0x156e4e[_0x20cc('0x3a')]['fields']));_0xf4c23b[_0x20cc('0x3f')]=_0xf4c23b[_0x20cc('0x3f')][_0x20cc('0x40')]?_0xf4c23b[_0x20cc('0x3f')]:_0xf6bd1[_0x20cc('0x39')];if(!_0x156e4e[_0x20cc('0x3a')][_0x20cc('0x41')](_0x20cc('0x42'))){_0xf4c23b[_0x20cc('0x1d')]=qs[_0x20cc('0x1d')](_0x156e4e[_0x20cc('0x3a')]['limit']);_0xf4c23b['offset']=qs[_0x20cc('0x1f')](_0x156e4e[_0x20cc('0x3a')][_0x20cc('0x1f')]);}_0xf4c23b['order']=qs['sort'](_0x156e4e[_0x20cc('0x3a')]['sort']);_0xf4c23b['where']=qs[_0x20cc('0x3c')](_[_0x20cc('0x61')](_0x156e4e[_0x20cc('0x3a')],_0xf6bd1['filters']));_0xf4c23b[_0x20cc('0x44')][_0x20cc('0x62')]=_0x342920['id'];if(_0x156e4e['query']['filter']){_0xf4c23b[_0x20cc('0x44')]=_['merge'](_0xf4c23b[_0x20cc('0x44')],{'$or':_['map'](_0xf4c23b['attributes'],function(_0x2c14a3){var _0x2d2254={};_0x2d2254[_0x2c14a3]={'$like':'%'+_0x156e4e[_0x20cc('0x3a')][_0x20cc('0x2b')]+'%'};return _0x2d2254;})});}_0xf4c23b=_[_0x20cc('0x45')]({},_0xf4c23b,_0x156e4e[_0x20cc('0x48')]);return db[_0x20cc('0x67')][_0x20cc('0x1e')]({'where':_0xf4c23b[_0x20cc('0x44')]})['then'](function(_0x27fc0d){_0x375f86[_0x20cc('0x1e')]=_0x27fc0d;if(_0x156e4e[_0x20cc('0x3a')][_0x20cc('0x4f')]){_0xf4c23b['include']=[{'all':!![]}];}return db[_0x20cc('0x67')][_0x20cc('0x4a')](_0xf4c23b);})['then'](function(_0xf374a3){_0x375f86[_0x20cc('0x4b')]=_0xf374a3;return _0x375f86;});}})[_0x20cc('0x25')](respondWithFilteredResult(_0x18359e,_0xf4c23b))[_0x20cc('0x4c')](handleError(_0x18359e,null));};exports[_0x20cc('0x68')]=function(_0x4d1ade,_0x3cd4f2,_0x4e2ecc){var _0x28c441={'raw':!![],'where':{}};var _0x2f4647={};var _0x290602={'count':0x0,'rows':[]};return db[_0x20cc('0x35')][_0x20cc('0x60')]({'where':{'id':_0x4d1ade[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x3cd4f2,null))[_0x20cc('0x25')](function(_0x3a8ba9){if(_0x3a8ba9){_0x2f4647[_0x20cc('0x39')]=_[_0x20cc('0x3b')](db[_0x20cc('0x69')][_0x20cc('0x4e')]);_0x2f4647[_0x20cc('0x3a')]=_['keys'](_0x4d1ade[_0x20cc('0x3a')]);_0x2f4647[_0x20cc('0x3c')]=_[_0x20cc('0x3d')](_0x2f4647[_0x20cc('0x39')],_0x2f4647[_0x20cc('0x3a')]);_0x28c441['attributes']=_[_0x20cc('0x3d')](_0x2f4647[_0x20cc('0x39')],qs[_0x20cc('0x3e')](_0x4d1ade[_0x20cc('0x3a')][_0x20cc('0x3e')]));_0x28c441[_0x20cc('0x3f')]=_0x28c441['attributes'][_0x20cc('0x40')]?_0x28c441[_0x20cc('0x3f')]:_0x2f4647[_0x20cc('0x39')];if(!_0x4d1ade[_0x20cc('0x3a')][_0x20cc('0x41')](_0x20cc('0x42'))){_0x28c441[_0x20cc('0x1d')]=qs[_0x20cc('0x1d')](_0x4d1ade[_0x20cc('0x3a')]['limit']);_0x28c441['offset']=qs['offset'](_0x4d1ade[_0x20cc('0x3a')][_0x20cc('0x1f')]);}_0x28c441[_0x20cc('0x65')]=qs[_0x20cc('0x43')](_0x4d1ade['query'][_0x20cc('0x43')]);_0x28c441[_0x20cc('0x44')]=qs['filters'](_[_0x20cc('0x61')](_0x4d1ade[_0x20cc('0x3a')],_0x2f4647[_0x20cc('0x3c')]));_0x28c441['where'][_0x20cc('0x62')]=_0x3a8ba9['id'];if(_0x4d1ade[_0x20cc('0x3a')]['filter']){_0x28c441[_0x20cc('0x44')]=_[_0x20cc('0x45')](_0x28c441[_0x20cc('0x44')],{'$or':_[_0x20cc('0x46')](_0x28c441[_0x20cc('0x3f')],function(_0x1106d6){var _0x38a5f3={};_0x38a5f3[_0x1106d6]={'$like':'%'+_0x4d1ade['query'][_0x20cc('0x2b')]+'%'};return _0x38a5f3;})});}_0x28c441=_[_0x20cc('0x45')]({},_0x28c441,_0x4d1ade[_0x20cc('0x48')]);return db['CmHopperBlack'][_0x20cc('0x1e')]({'where':_0x28c441[_0x20cc('0x44')]})[_0x20cc('0x25')](function(_0x2ef9bc){_0x290602['count']=_0x2ef9bc;if(_0x4d1ade[_0x20cc('0x3a')]['includeAll']){_0x28c441['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x28c441);})['then'](function(_0x5a2568){_0x290602[_0x20cc('0x4b')]=_0x5a2568;return _0x290602;});}})[_0x20cc('0x25')](respondWithFilteredResult(_0x3cd4f2,_0x28c441))[_0x20cc('0x4c')](handleError(_0x3cd4f2,null));};exports[_0x20cc('0x6a')]=function(_0x21f779,_0x57bb29,_0x2c77fa){var _0x2e7005={};var _0x25cba3={};var _0x44275d;var _0x23e4f9;return db[_0x20cc('0x35')][_0x20cc('0x60')]({'where':{'id':_0x21f779[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x57bb29,null))[_0x20cc('0x25')](function(_0x18812f){if(_0x18812f){_0x44275d=_0x18812f;_0x25cba3[_0x20cc('0x39')]=_[_0x20cc('0x3b')](db[_0x20cc('0x6b')][_0x20cc('0x4e')]);_0x25cba3[_0x20cc('0x3a')]=_['keys'](_0x21f779[_0x20cc('0x3a')]);_0x25cba3[_0x20cc('0x3c')]=_['intersection'](_0x25cba3[_0x20cc('0x39')],_0x25cba3['query']);_0x2e7005[_0x20cc('0x3f')]=_[_0x20cc('0x3d')](_0x25cba3['model'],qs[_0x20cc('0x3e')](_0x21f779[_0x20cc('0x3a')][_0x20cc('0x3e')]));_0x2e7005[_0x20cc('0x3f')]=_0x2e7005['attributes'][_0x20cc('0x40')]?_0x2e7005['attributes']:_0x25cba3[_0x20cc('0x39')];_0x2e7005[_0x20cc('0x65')]=qs[_0x20cc('0x43')](_0x21f779[_0x20cc('0x3a')]['sort']);_0x2e7005[_0x20cc('0x44')]=qs['filters'](_[_0x20cc('0x61')](_0x21f779['query'],_0x25cba3[_0x20cc('0x3c')]));if(_0x21f779['query'][_0x20cc('0x2b')]){_0x2e7005[_0x20cc('0x44')]=_[_0x20cc('0x45')](_0x2e7005[_0x20cc('0x44')],{'$or':_[_0x20cc('0x46')](_0x2e7005['attributes'],function(_0x93f6fb){var _0x2b49b9={};_0x2b49b9[_0x93f6fb]={'$like':'%'+_0x21f779[_0x20cc('0x3a')]['filter']+'%'};return _0x2b49b9;})});}_0x2e7005=_[_0x20cc('0x45')]({},_0x2e7005,_0x21f779[_0x20cc('0x48')]);return _0x44275d[_0x20cc('0x6a')](_0x2e7005);}})[_0x20cc('0x25')](function(_0x57b65d){if(_0x57b65d){_0x23e4f9=_0x57b65d['length'];if(!_0x21f779[_0x20cc('0x3a')]['hasOwnProperty'](_0x20cc('0x42'))){_0x2e7005[_0x20cc('0x1d')]=qs[_0x20cc('0x1d')](_0x21f779['query'][_0x20cc('0x1d')]);_0x2e7005[_0x20cc('0x1f')]=qs['offset'](_0x21f779['query']['offset']);}return _0x44275d['getTeams'](_0x2e7005);}})['then'](function(_0x4ecc27){if(_0x4ecc27){return _0x4ecc27?{'count':_0x23e4f9,'rows':_0x4ecc27}:null;}})[_0x20cc('0x25')](respondWithResult(_0x57bb29,null))[_0x20cc('0x4c')](handleError(_0x57bb29,null));};exports[_0x20cc('0x6c')]=function(_0x3ae0d2,_0x37545a,_0x173503){var _0x4ad530=_0x3ae0d2[_0x20cc('0x52')][_0x20cc('0x6d')];var _0x4ce745=_[_0x20cc('0x46')](_0x4ad530,'id');return db['Team'][_0x20cc('0x4a')]({'where':{'id':_0x4ce745},'attributes':['id'],'include':[{'model':db[_0x20cc('0x6e')],'as':_0x20cc('0x6f'),'attributes':['id',_0x20cc('0x32'),_0x20cc('0x70'),_0x20cc('0x71'),_0x20cc('0x72')],'raw':!![]}]})[_0x20cc('0x25')](function(_0x3deb6d){if(_0x3deb6d){var _0x3eb086=_['flatMap'](_0x3deb6d,function(_0x330bb4){var _0x30f378=_0x330bb4[_0x20cc('0x26')]({'plain':!![]});_0x30f378[_0x20cc('0x6f')][_0x20cc('0x73')](function(_0x3e26c7){_0x3e26c7['penalty']=_[_0x20cc('0x50')](_0x4ad530,{'id':_0x30f378['id']})['penalty'];});return _0x30f378[_0x20cc('0x6f')];});return db['VoiceQueue']['find']({'where':{'id':_0x3ae0d2['params']['id']}})[_0x20cc('0x25')](function(_0x3aca53){return db['sequelize'][_0x20cc('0x74')](function(_0x2ae94a){return _0x3aca53[_0x20cc('0x6c')](_0x4ce745,{'transaction':_0x2ae94a})[_0x20cc('0x25')](function(){return BPromise[_0x20cc('0x75')](_0x4ad530,function(_0x2dc5f9){return db[_0x20cc('0x76')][_0x20cc('0x77')]({'TeamId':_0x2dc5f9['id'],'VoiceQueueId':_0x3ae0d2['params']['id'],'penalty':_0x2dc5f9['penalty']},{'transaction':_0x2ae94a});});})[_0x20cc('0x25')](function(){return BPromise[_0x20cc('0x75')](_0x3eb086,function(_0x10d372){return db[_0x20cc('0x78')][_0x20cc('0x79')]({'where':{'UserId':_0x10d372['id'],'VoiceQueueId':_0x3ae0d2[_0x20cc('0x5f')]['id']},'defaults':{'penalty':_0x10d372['penalty']},'transaction':_0x2ae94a});});})[_0x20cc('0x25')](function(){return BPromise[_0x20cc('0x75')](_[_0x20cc('0x2b')](_0x3eb086,{'online':!![]}),function(_0x4e899b){return db[_0x20cc('0x7a')]['upsert']({'membername':_0x4e899b['name'],'UserId':_0x4e899b['id'],'queue_name':_0x3aca53[_0x20cc('0x32')],'VoiceQueueId':_0x3aca53['id'],'interface':_[_0x20cc('0x7b')](_0x4e899b[_0x20cc('0x72')])?util[_0x20cc('0x7c')]('SIP/%s',_0x4e899b[_0x20cc('0x32')]):_0x4e899b[_0x20cc('0x72')],'paused':_0x4e899b[_0x20cc('0x71')]||![],'penalty':_0x4e899b[_0x20cc('0x7d')]},{'transaction':_0x2ae94a});});})[_0x20cc('0x25')](function(){_0x3eb086['forEach'](function(_0x293779){socket[_0x20cc('0x7e')]('userVoiceQueue:save',{'UserId':_0x293779['id'],'VoiceQueueId':_0x3aca53['id']});});});});});}})[_0x20cc('0x25')](respondWithStatusCode(_0x37545a,null))[_0x20cc('0x4c')](handleError(_0x37545a,null));};exports[_0x20cc('0x7f')]=function(_0x3a20ae,_0x6fc869,_0x32e435){return db['Team'][_0x20cc('0x4a')]({'where':{'id':_0x3a20ae[_0x20cc('0x3a')][_0x20cc('0x80')]},'attributes':['id'],'include':[{'model':db[_0x20cc('0x6e')],'as':_0x20cc('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x20cc('0x25')](handleEntityNotFound(_0x6fc869,null))[_0x20cc('0x25')](function(_0x29007b){var _0x5c9f68=_[_0x20cc('0x46')](_0x29007b,'id');var _0x22adb0=[];var _0x38cc83=[];var _0x12ed83=squel[_0x20cc('0x81')]();_0x12ed83[_0x20cc('0x82')]('tq.TeamId')['from'](_0x20cc('0x83'),'tq')['join'](_0x20cc('0x84'),'ut',_0x20cc('0x85'))[_0x20cc('0x44')](_0x20cc('0x86'),_0x3a20ae['params']['id']);for(var _0x1bf869=0x0;_0x1bf869<_0x29007b[_0x20cc('0x40')];_0x1bf869+=0x1){let _0x26068b=_0x29007b[_0x1bf869];for(var _0x2b2d56=0x0;_0x2b2d56<_0x26068b[_0x20cc('0x6f')][_0x20cc('0x40')];_0x2b2d56+=0x1){let _0x118829=_0x26068b[_0x20cc('0x6f')][_0x2b2d56];var _0x9c7a69=_0x12ed83[_0x20cc('0x5b')]();_0x9c7a69[_0x20cc('0x44')]('ut.UserId\x20=\x20?',_0x118829['id']);_0x38cc83[_0x20cc('0x87')](db[_0x20cc('0x88')][_0x20cc('0x3a')](_0x9c7a69[_0x20cc('0x89')](),{'type':db[_0x20cc('0x88')][_0x20cc('0x8a')]['SELECT']})[_0x20cc('0x25')](function(_0x55475b){if(_0x55475b[_0x20cc('0x40')]===0x1){return _0x118829['id'];}else{var _0x162a5a=_[_0x20cc('0x8b')](_[_0x20cc('0x46')](_0x55475b,'TeamId'),function(_0x5b2888){return _[_0x20cc('0x8c')](_0x5c9f68,_0x5b2888);});if(_0x162a5a){return _0x118829['id'];}}}));}}return BPromise[_0x20cc('0x8d')](_0x38cc83)[_0x20cc('0x25')](function(_0x13c9a4){_0x22adb0=_(_0x22adb0)['union'](_0x13c9a4)[_0x20cc('0x8e')]()[_0x20cc('0x2d')]();return db[_0x20cc('0x35')][_0x20cc('0x50')]({'where':{'id':_0x3a20ae[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](function(_0x209b46){return db[_0x20cc('0x88')][_0x20cc('0x74')](function(_0x488188){return _0x209b46[_0x20cc('0x7f')](_0x3a20ae[_0x20cc('0x3a')][_0x20cc('0x80')],{'transaction':_0x488188})[_0x20cc('0x25')](function(){if(!_[_0x20cc('0x8f')](_0x22adb0)){return _0x209b46[_0x20cc('0x90')](_0x22adb0,{'transaction':_0x488188})[_0x20cc('0x25')](function(){return db[_0x20cc('0x7a')][_0x20cc('0x2e')]({'where':{'VoiceQueueId':_0x3a20ae['params']['id'],'UserId':_0x22adb0},'transaction':_0x488188});});}})[_0x20cc('0x25')](function(){_0x22adb0[_0x20cc('0x73')](function(_0x484295){socket['emit']('userVoiceQueue:remove',{'UserId':_0x484295,'VoiceQueueId':_0x209b46['id']});});});});});});})[_0x20cc('0x25')](respondWithStatusCode(_0x6fc869,null))['catch'](handleError(_0x6fc869,null));};exports[_0x20cc('0x91')]=function(_0x2b2680,_0x1c3537,_0x1aeddd){var _0x404176,_0x4ada59;return db[_0x20cc('0x35')][_0x20cc('0x50')]({'where':{'id':_0x2b2680[_0x20cc('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1c3537,null))[_0x20cc('0x25')](function(_0x333101){if(_0x333101){_0x4ada59=_0x333101;return _0x333101['addAgents'](_0x2b2680[_0x20cc('0x52')][_0x20cc('0x80')],_[_0x20cc('0x5e')](_0x2b2680['body'],[_0x20cc('0x80'),'id'])||{})[_0x20cc('0x92')](function(_0xea414d){for(var _0x28f612=0x0;_0x28f612<_0x2b2680['body'][_0x20cc('0x80')][_0x20cc('0x40')];_0x28f612+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x2b2680[_0x20cc('0x52')][_0x20cc('0x80')][_0x28f612]),'VoiceQueueId':Number(_0x2b2680[_0x20cc('0x5f')]['id'])});}return _0xea414d;});}})['then'](function(_0x541be1){_0x404176=_0x541be1||[];if(_0x4ada59){return db['User']['findAll']({'where':{'id':_0x2b2680[_0x20cc('0x52')]['ids']},'attributes':['id',_0x20cc('0x32'),_0x20cc('0x70'),_0x20cc('0x71'),'interface'],'raw':!![]});}})[_0x20cc('0x25')](function(_0x5120b8){if(!_[_0x20cc('0x8f')](_0x5120b8)){var _0x267f39=[];for(var _0x2b786a=0x0;_0x2b786a<_0x5120b8[_0x20cc('0x40')];_0x2b786a++){if(_0x5120b8[_0x2b786a]['online']){_0x267f39['push'](db['UserVoiceQueueRt'][_0x20cc('0x77')]({'membername':_0x5120b8[_0x2b786a][_0x20cc('0x32')],'UserId':_0x5120b8[_0x2b786a]['id'],'queue_name':_0x4ada59['name'],'VoiceQueueId':_0x4ada59['id'],'interface':_[_0x20cc('0x7b')](_0x5120b8[_0x2b786a][_0x20cc('0x72')])?util[_0x20cc('0x7c')]('SIP/%s',_0x5120b8[_0x2b786a][_0x20cc('0x32')]):_0x5120b8[_0x2b786a][_0x20cc('0x72')],'paused':_0x5120b8[_0x2b786a][_0x20cc('0x71')]||![],'penalty':_0x2b2680['body'][_0x20cc('0x7d')]||0x0}));}}return BPromise[_0x20cc('0x8d')](_0x267f39);}})['then'](function(){return _0x404176;})['then'](respondWithResult(_0x1c3537,null))['catch'](handleError(_0x1c3537,null));};exports['removeAgents']=function(_0x205c2e,_0x3c38f0,_0x2269e7){return db[_0x20cc('0x35')][_0x20cc('0x50')]({'where':{'id':_0x205c2e[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x3c38f0,null))[_0x20cc('0x25')](function(_0x194cbe){if(_0x194cbe){return _0x194cbe[_0x20cc('0x90')](_0x205c2e['query'][_0x20cc('0x80')])['then'](function(){if(_['isArray'](_0x205c2e[_0x20cc('0x3a')][_0x20cc('0x80')])){for(var _0x59f2a0=0x0;_0x59f2a0<_0x205c2e[_0x20cc('0x3a')]['ids'][_0x20cc('0x40')];_0x59f2a0+=0x1){socket[_0x20cc('0x7e')](_0x20cc('0x93'),{'UserId':Number(_0x205c2e[_0x20cc('0x3a')][_0x20cc('0x80')][_0x59f2a0]),'VoiceQueueId':Number(_0x205c2e['params']['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x205c2e[_0x20cc('0x3a')][_0x20cc('0x80')]),'VoiceQueueId':Number(_0x205c2e[_0x20cc('0x5f')]['id'])});}});}})[_0x20cc('0x25')](function(_0xcf8b88){return db[_0x20cc('0x7a')][_0x20cc('0x2e')]({'where':{'VoiceQueueId':_0x205c2e[_0x20cc('0x5f')]['id'],'UserId':_0x205c2e['query']['ids']}})['then'](function(){return _0xcf8b88;});})['then'](respondWithStatusCode(_0x3c38f0,null))[_0x20cc('0x4c')](handleError(_0x3c38f0,null));};exports[_0x20cc('0x94')]=function(_0x368778,_0x248430,_0x3c8238){var _0x2956f6={};var _0x13b216={};var _0x27e8b7;var _0x49ffa1;return db[_0x20cc('0x35')][_0x20cc('0x60')]({'where':{'id':_0x368778[_0x20cc('0x5f')]['id']}})['then'](handleEntityNotFound(_0x248430,null))[_0x20cc('0x25')](function(_0x911244){if(_0x911244){_0x27e8b7=_0x911244;_0x13b216[_0x20cc('0x39')]=_[_0x20cc('0x3b')](db[_0x20cc('0x6e')][_0x20cc('0x4e')]);_0x13b216[_0x20cc('0x3a')]=_['keys'](_0x368778[_0x20cc('0x3a')]);_0x13b216[_0x20cc('0x3c')]=_[_0x20cc('0x3d')](_0x13b216[_0x20cc('0x39')],_0x13b216[_0x20cc('0x3a')]);_0x2956f6[_0x20cc('0x3f')]=_[_0x20cc('0x3d')](_0x13b216[_0x20cc('0x39')],qs['fields'](_0x368778['query'][_0x20cc('0x3e')]));_0x2956f6[_0x20cc('0x3f')]=_0x2956f6[_0x20cc('0x3f')][_0x20cc('0x40')]?_0x2956f6['attributes']:_0x13b216[_0x20cc('0x39')];_0x2956f6[_0x20cc('0x65')]=qs['sort'](_0x368778[_0x20cc('0x3a')][_0x20cc('0x43')]);_0x2956f6[_0x20cc('0x44')]=qs[_0x20cc('0x3c')](_['pick'](_0x368778[_0x20cc('0x3a')],_0x13b216[_0x20cc('0x3c')]));if(_0x368778[_0x20cc('0x3a')]['filter']){_0x2956f6[_0x20cc('0x44')]=_[_0x20cc('0x45')](_0x2956f6[_0x20cc('0x44')],{'$or':_[_0x20cc('0x46')](_0x2956f6[_0x20cc('0x3f')],function(_0x518431){var _0x2794a4={};_0x2794a4[_0x518431]={'$like':'%'+_0x368778[_0x20cc('0x3a')]['filter']+'%'};return _0x2794a4;})});}_0x2956f6=_[_0x20cc('0x45')]({},_0x2956f6,_0x368778[_0x20cc('0x48')]);return _0x27e8b7[_0x20cc('0x94')](_0x2956f6);}})[_0x20cc('0x25')](function(_0xc7d13e){if(_0xc7d13e){_0x49ffa1=_0xc7d13e[_0x20cc('0x40')];if(!_0x368778[_0x20cc('0x3a')]['hasOwnProperty'](_0x20cc('0x42'))){_0x2956f6['limit']=qs['limit'](_0x368778[_0x20cc('0x3a')][_0x20cc('0x1d')]);_0x2956f6[_0x20cc('0x1f')]=qs[_0x20cc('0x1f')](_0x368778[_0x20cc('0x3a')][_0x20cc('0x1f')]);}return _0x27e8b7['getAgents'](_0x2956f6);}})[_0x20cc('0x25')](function(_0xdc6feb){if(_0xdc6feb){return _0xdc6feb?{'count':_0x49ffa1,'rows':_0xdc6feb}:null;}})[_0x20cc('0x25')](respondWithResult(_0x248430,null))['catch'](handleError(_0x248430,null));};exports['getMembers']=function(_0x48545d,_0x40db34,_0x116b38){var _0x32a588={};var _0x39c623={};var _0x217ab3;var _0x109849;return db[_0x20cc('0x35')][_0x20cc('0x60')]({'where':{'id':_0x48545d[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x40db34,null))[_0x20cc('0x25')](function(_0x568d1b){if(_0x568d1b){_0x217ab3=_0x568d1b;_0x39c623[_0x20cc('0x39')]=_[_0x20cc('0x3b')](db[_0x20cc('0x7a')][_0x20cc('0x4e')]);_0x39c623[_0x20cc('0x3a')]=_[_0x20cc('0x3b')](_0x48545d[_0x20cc('0x3a')]);_0x39c623[_0x20cc('0x3c')]=_[_0x20cc('0x3d')](_0x39c623['model'],_0x39c623[_0x20cc('0x3a')]);_0x32a588[_0x20cc('0x3f')]=_[_0x20cc('0x3d')](_0x39c623[_0x20cc('0x39')],qs['fields'](_0x48545d[_0x20cc('0x3a')][_0x20cc('0x3e')]));_0x32a588[_0x20cc('0x3f')]=_0x32a588[_0x20cc('0x3f')][_0x20cc('0x40')]?_0x32a588[_0x20cc('0x3f')]:_0x39c623[_0x20cc('0x39')];_0x32a588['order']=qs[_0x20cc('0x43')](_0x48545d[_0x20cc('0x3a')][_0x20cc('0x43')]);_0x32a588[_0x20cc('0x44')]=qs[_0x20cc('0x3c')](_[_0x20cc('0x61')](_0x48545d[_0x20cc('0x3a')],_0x39c623[_0x20cc('0x3c')]));if(_0x48545d[_0x20cc('0x3a')][_0x20cc('0x2b')]){_0x32a588[_0x20cc('0x44')]=_[_0x20cc('0x45')](_0x32a588[_0x20cc('0x44')],{'$or':_[_0x20cc('0x46')](_0x32a588[_0x20cc('0x3f')],function(_0x533500){var _0x2b6ca7={};_0x2b6ca7[_0x533500]={'$like':'%'+_0x48545d['query'][_0x20cc('0x2b')]+'%'};return _0x2b6ca7;})});}_0x32a588=_['merge']({},_0x32a588,_0x48545d[_0x20cc('0x48')]);return _0x217ab3[_0x20cc('0x95')](_0x32a588);}})[_0x20cc('0x25')](function(_0x27e6ee){if(_0x27e6ee){_0x109849=_0x27e6ee['length'];if(!_0x48545d[_0x20cc('0x3a')][_0x20cc('0x41')]('nolimit')){_0x32a588[_0x20cc('0x1d')]=qs['limit'](_0x48545d[_0x20cc('0x3a')]['limit']);_0x32a588['offset']=qs[_0x20cc('0x1f')](_0x48545d['query']['offset']);}return _0x217ab3[_0x20cc('0x95')](_0x32a588);}})[_0x20cc('0x25')](function(_0x1cb709){return _0x1cb709?{'count':_0x109849,'rows':_0x1cb709}:null;})[_0x20cc('0x25')](respondWithResult(_0x40db34,null))['catch'](handleError(_0x40db34,null));};exports[_0x20cc('0x96')]=function(_0x1ae2bb,_0x4616ec,_0x2b1ff8){var _0xd3ac76={};var _0x46c615={};var _0xeb9658;var _0x4a6af0;return db['VoiceQueue'][_0x20cc('0x60')]({'where':{'id':_0x1ae2bb[_0x20cc('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4616ec,null))['then'](function(_0x4b1e83){if(_0x4b1e83){_0xeb9658=_0x4b1e83;_0x46c615[_0x20cc('0x39')]=_[_0x20cc('0x3b')](db[_0x20cc('0x97')][_0x20cc('0x4e')]);_0x46c615[_0x20cc('0x3a')]=_[_0x20cc('0x3b')](_0x1ae2bb[_0x20cc('0x3a')]);_0x46c615[_0x20cc('0x3c')]=_['intersection'](_0x46c615[_0x20cc('0x39')],_0x46c615['query']);_0xd3ac76[_0x20cc('0x3f')]=_[_0x20cc('0x3d')](_0x46c615[_0x20cc('0x39')],qs[_0x20cc('0x3e')](_0x1ae2bb['query'][_0x20cc('0x3e')]));_0xd3ac76[_0x20cc('0x3f')]=_0xd3ac76[_0x20cc('0x3f')][_0x20cc('0x40')]?_0xd3ac76[_0x20cc('0x3f')]:_0x46c615[_0x20cc('0x39')];_0xd3ac76['order']=qs['sort'](_0x1ae2bb['query'][_0x20cc('0x43')]);_0xd3ac76['where']=qs[_0x20cc('0x3c')](_[_0x20cc('0x61')](_0x1ae2bb[_0x20cc('0x3a')],_0x46c615[_0x20cc('0x3c')]));if(_0x1ae2bb[_0x20cc('0x3a')]['filter']){_0xd3ac76[_0x20cc('0x44')]=_[_0x20cc('0x45')](_0xd3ac76['where'],{'$or':_[_0x20cc('0x46')](_0xd3ac76['attributes'],function(_0x3ecc7f){var _0x2c44f6={};_0x2c44f6[_0x3ecc7f]={'$like':'%'+_0x1ae2bb['query']['filter']+'%'};return _0x2c44f6;})});}_0xd3ac76=_[_0x20cc('0x45')]({},_0xd3ac76,_0x1ae2bb['options']);return _0xeb9658[_0x20cc('0x96')](_0xd3ac76);}})['then'](function(_0x305aca){if(_0x305aca){_0x4a6af0=_0x305aca['length'];if(!_0x1ae2bb[_0x20cc('0x3a')]['hasOwnProperty'](_0x20cc('0x42'))){_0xd3ac76['limit']=qs['limit'](_0x1ae2bb[_0x20cc('0x3a')][_0x20cc('0x1d')]);_0xd3ac76[_0x20cc('0x1f')]=qs[_0x20cc('0x1f')](_0x1ae2bb[_0x20cc('0x3a')]['offset']);}return _0xeb9658[_0x20cc('0x96')](_0xd3ac76);}})[_0x20cc('0x25')](function(_0x2ca242){if(_0x2ca242){return _0x2ca242?{'count':_0x4a6af0,'rows':_0x2ca242}:null;}})[_0x20cc('0x25')](respondWithResult(_0x4616ec,null))[_0x20cc('0x4c')](handleError(_0x4616ec,null));};exports['addLists']=function(_0x5a90d2,_0x4fd8ed,_0x2b1b61){var _0x23d823,_0xef40c7;return db[_0x20cc('0x35')][_0x20cc('0x50')]({'where':{'id':_0x5a90d2['params']['id']}})['then'](handleEntityNotFound(_0x4fd8ed,null))[_0x20cc('0x25')](function(_0xe5856e){if(_0xe5856e){_0xef40c7=_0xe5856e;return _0xe5856e['addLists'](_0x5a90d2['body']['ids'],_['omit'](_0x5a90d2[_0x20cc('0x52')],[_0x20cc('0x80'),'id'])||{});}return null;})['spread'](function(_0x5db7ee){var _0x3f2eb5;_0x23d823=_0x5db7ee||[];var _0x5c1781=[];if(_0x5db7ee){for(var _0x39b168=0x0;_0x39b168<_0x5db7ee[_0x20cc('0x40')];_0x39b168+=0x1){var _0x24a839=_0x5db7ee[_0x39b168][_0x20cc('0x26')]({'plain':!![]});_0xef40c7[_0x20cc('0x98')]=_0x5a90d2[_0x20cc('0x52')][_0x20cc('0x98')]?_0x5a90d2[_0x20cc('0x52')][_0x20cc('0x98')]:_0xef40c7[_0x20cc('0x98')];switch(_0xef40c7[_0x20cc('0x98')]){case'always':_0x3f2eb5=squel[_0x20cc('0x99')]()[_0x20cc('0x9a')](_0x20cc('0x9b'))[_0x20cc('0x9c')]([_0x20cc('0x9d'),_0x20cc('0x9e'),_0x20cc('0x9f'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0x20cc('0x81')]()[_0x20cc('0x82')](_0x20cc('0x9d'),_0x20cc('0x9d'))[_0x20cc('0x82')](_0x20cc('0xa0'),_0x20cc('0x9e'))[_0x20cc('0x82')]('id',_0x20cc('0x9f'))['field'](_0x24a839[_0x20cc('0xa1')][_0x20cc('0x89')](),_0x20cc('0xa2'))[_0x20cc('0x82')](_0x5a90d2[_0x20cc('0x5f')]['id']['toString'](),_0x20cc('0x62'))['field'](_0x20cc('0xa0'),'createdAt')['field'](_0x20cc('0xa0'),_0x20cc('0x5d'))['from'](_0x20cc('0xa3'))[_0x20cc('0x44')](_0x20cc('0xa4'))['where'](_0x20cc('0xa5'),_0x24a839[_0x20cc('0xa1')][_0x20cc('0x89')]())['where'](_0x20cc('0xa6'))[_0x20cc('0x44')](_0x20cc('0xa7'),squel[_0x20cc('0x81')]()[_0x20cc('0x82')](_0x20cc('0xa8'))[_0x20cc('0xa9')](_0x20cc('0xaa'))[_0x20cc('0x44')]('VoiceQueueId\x20=\x20?',_0x5a90d2[_0x20cc('0x5f')]['id'][_0x20cc('0x89')]()))[_0x20cc('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x20cc('0x81')]()[_0x20cc('0x82')](_0x20cc('0xab'))[_0x20cc('0xa9')]('cm_hopper')[_0x20cc('0x44')]('VoiceQueueId\x20=\x20?',_0x5a90d2[_0x20cc('0x5f')]['id'][_0x20cc('0x89')]())))[_0x20cc('0x89')]();break;case _0x20cc('0xac'):_0x3f2eb5=squel[_0x20cc('0x99')]()[_0x20cc('0x9a')](_0x20cc('0x9b'))[_0x20cc('0x9c')]([_0x20cc('0x9d'),'scheduledAt','ContactId',_0x20cc('0xa2'),_0x20cc('0x62'),_0x20cc('0x5c'),_0x20cc('0x5d')],squel[_0x20cc('0x81')]()[_0x20cc('0x82')](_0x20cc('0x9d'),_0x20cc('0x9d'))['field'](_0x20cc('0xa0'),_0x20cc('0x9e'))[_0x20cc('0x82')]('id',_0x20cc('0x9f'))[_0x20cc('0x82')](_0x24a839['CmListId'][_0x20cc('0x89')](),'ListId')[_0x20cc('0x82')](_0x5a90d2['params']['id'][_0x20cc('0x89')](),_0x20cc('0x62'))[_0x20cc('0x82')](_0x20cc('0xa0'),'createdAt')[_0x20cc('0x82')](_0x20cc('0xa0'),_0x20cc('0x5d'))['from']('cm_contacts')[_0x20cc('0x44')](_0x20cc('0xa4'))[_0x20cc('0x44')](_0x20cc('0xa5'),_0x24a839[_0x20cc('0xa1')][_0x20cc('0x89')]())[_0x20cc('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x20cc('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x20cc('0x81')]()[_0x20cc('0x82')](_0x20cc('0xab'))[_0x20cc('0xa9')]('cm_hopper')['where'](_0x20cc('0x86'),_0x5a90d2[_0x20cc('0x5f')]['id']['toString']())))['toString']();break;default:_0x3f2eb5=squel[_0x20cc('0x99')]()[_0x20cc('0x9a')](_0x20cc('0x9b'))[_0x20cc('0x9c')]([_0x20cc('0x9d'),_0x20cc('0x9e'),_0x20cc('0x9f'),'ListId',_0x20cc('0x62'),_0x20cc('0x5c'),_0x20cc('0x5d')],squel['select']()['field'](_0x20cc('0x9d'),_0x20cc('0x9d'))['field'](_0x20cc('0xa0'),_0x20cc('0x9e'))['field']('id',_0x20cc('0x9f'))[_0x20cc('0x82')](_0x24a839[_0x20cc('0xa1')][_0x20cc('0x89')](),'ListId')[_0x20cc('0x82')](_0x5a90d2['params']['id'][_0x20cc('0x89')](),_0x20cc('0x62'))[_0x20cc('0x82')](_0x20cc('0xa0'),_0x20cc('0x5c'))[_0x20cc('0x82')](_0x20cc('0xa0'),_0x20cc('0x5d'))[_0x20cc('0xa9')](_0x20cc('0xa3'))[_0x20cc('0x44')](_0x20cc('0xa4'))[_0x20cc('0x44')](_0x20cc('0xa5'),_0x24a839[_0x20cc('0xa1')][_0x20cc('0x89')]())[_0x20cc('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0x20cc('0x89')]();}_0x5c1781[_0x20cc('0x87')](db[_0x20cc('0x88')][_0x20cc('0x3a')](_0x3f2eb5));}return BPromise['all'](_0x5c1781);}})[_0x20cc('0x25')](function(){return _0x23d823;})['then'](respondWithResult(_0x4fd8ed,null))['catch'](handleError(_0x4fd8ed,null));};exports[_0x20cc('0xad')]=function(_0x5f4b5a,_0x2e0825,_0x40143f){return db[_0x20cc('0x35')]['find']({'where':{'id':_0x5f4b5a[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x2e0825,null))[_0x20cc('0x25')](function(_0x261e5a){if(_0x261e5a){return _0x261e5a[_0x20cc('0xad')](_0x5f4b5a[_0x20cc('0x3a')][_0x20cc('0x80')]);}})[_0x20cc('0x25')](function(_0x218f09){if(_0x218f09){return db[_0x20cc('0x63')][_0x20cc('0x2e')]({'where':{'ListId':_0x5f4b5a['query']['ids'],'VoiceQueueId':_0x5f4b5a[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](function(){return _0x218f09;});}})[_0x20cc('0x25')](respondWithStatusCode(_0x2e0825,null))[_0x20cc('0x4c')](handleError(_0x2e0825,null));};exports[_0x20cc('0xae')]=function(_0x3620b2,_0x518819,_0x2a7a8f){var _0x1c8b43={};var _0x3e7530={};var _0x5cc7a0;var _0x1e5beb;return db[_0x20cc('0x35')][_0x20cc('0x60')]({'where':{'id':_0x3620b2['params']['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x518819,null))['then'](function(_0x38b7a0){if(_0x38b7a0){_0x5cc7a0=_0x38b7a0;_0x3e7530[_0x20cc('0x39')]=_['keys'](db['CmList']['rawAttributes']);_0x3e7530[_0x20cc('0x3a')]=_['keys'](_0x3620b2['query']);_0x3e7530['filters']=_[_0x20cc('0x3d')](_0x3e7530[_0x20cc('0x39')],_0x3e7530[_0x20cc('0x3a')]);_0x1c8b43[_0x20cc('0x3f')]=_['intersection'](_0x3e7530[_0x20cc('0x39')],qs[_0x20cc('0x3e')](_0x3620b2[_0x20cc('0x3a')][_0x20cc('0x3e')]));_0x1c8b43[_0x20cc('0x3f')]=_0x1c8b43[_0x20cc('0x3f')][_0x20cc('0x40')]?_0x1c8b43[_0x20cc('0x3f')]:_0x3e7530[_0x20cc('0x39')];_0x1c8b43['order']=qs[_0x20cc('0x43')](_0x3620b2[_0x20cc('0x3a')][_0x20cc('0x43')]);_0x1c8b43[_0x20cc('0x44')]=qs[_0x20cc('0x3c')](_[_0x20cc('0x61')](_0x3620b2[_0x20cc('0x3a')],_0x3e7530[_0x20cc('0x3c')]));if(_0x3620b2[_0x20cc('0x3a')][_0x20cc('0x2b')]){_0x1c8b43[_0x20cc('0x44')]=_[_0x20cc('0x45')](_0x1c8b43['where'],{'$or':_[_0x20cc('0x46')](_0x1c8b43[_0x20cc('0x3f')],function(_0x59acb3){var _0x278aad={};_0x278aad[_0x59acb3]={'$like':'%'+_0x3620b2[_0x20cc('0x3a')]['filter']+'%'};return _0x278aad;})});}_0x1c8b43=_[_0x20cc('0x45')]({},_0x1c8b43,_0x3620b2[_0x20cc('0x48')]);return _0x5cc7a0[_0x20cc('0xae')](_0x1c8b43);}})[_0x20cc('0x25')](function(_0xf8de34){if(_0xf8de34){_0x1e5beb=_0xf8de34[_0x20cc('0x40')];if(!_0x3620b2['query'][_0x20cc('0x41')](_0x20cc('0x42'))){_0x1c8b43[_0x20cc('0x1d')]=qs[_0x20cc('0x1d')](_0x3620b2['query'][_0x20cc('0x1d')]);_0x1c8b43['offset']=qs[_0x20cc('0x1f')](_0x3620b2['query'][_0x20cc('0x1f')]);}return _0x5cc7a0[_0x20cc('0xae')](_0x1c8b43);}})['then'](function(_0x28eb90){if(_0x28eb90){return _0x28eb90?{'count':_0x1e5beb,'rows':_0x28eb90}:null;}})[_0x20cc('0x25')](respondWithResult(_0x518819,null))[_0x20cc('0x4c')](handleError(_0x518819,null));};exports[_0x20cc('0xaf')]=function(_0x5203f4,_0x512f58,_0x27ecc5){var _0x26817f,_0x211c75;return db['VoiceQueue']['find']({'where':{'id':_0x5203f4[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](handleEntityNotFound(_0x512f58,null))['then'](function(_0x51428b){if(_0x51428b){_0x211c75=_0x51428b;return _0x51428b[_0x20cc('0xaf')](_0x5203f4[_0x20cc('0x52')][_0x20cc('0x80')],_[_0x20cc('0x5e')](_0x5203f4[_0x20cc('0x52')],[_0x20cc('0x80'),'id'])||{});}return null;})[_0x20cc('0x92')](function(_0x267f9c){var _0x378fd4;_0x26817f=_0x267f9c||[];var _0xa9e30=[];if(_0x267f9c){for(var _0x44891f=0x0;_0x44891f<_0x267f9c[_0x20cc('0x40')];_0x44891f+=0x1){var _0x1ee438=_0x267f9c[_0x44891f]['get']({'plain':!![]});_0x378fd4=squel[_0x20cc('0x99')]()[_0x20cc('0x9a')](_0x20cc('0xb0'))[_0x20cc('0x9c')](['phone',_0x20cc('0x9f'),_0x20cc('0xa2'),_0x20cc('0x62'),_0x20cc('0x5c'),_0x20cc('0x5d')],squel[_0x20cc('0x81')]()['field'](_0x20cc('0x9d'),_0x20cc('0x9d'))[_0x20cc('0x82')]('id','ContactId')[_0x20cc('0x82')](_0x1ee438[_0x20cc('0xa1')][_0x20cc('0x89')](),_0x20cc('0xa2'))['field'](_0x5203f4[_0x20cc('0x5f')]['id'][_0x20cc('0x89')](),_0x20cc('0x62'))[_0x20cc('0x82')](_0x20cc('0xa0'),_0x20cc('0x5c'))[_0x20cc('0x82')](_0x20cc('0xa0'),'updatedAt')[_0x20cc('0xa9')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x20cc('0xa5'),_0x1ee438[_0x20cc('0xa1')][_0x20cc('0x89')]())['where'](_0x20cc('0xa6')))[_0x20cc('0x89')]();_0xa9e30[_0x20cc('0x87')](db[_0x20cc('0x88')][_0x20cc('0x3a')](_0x378fd4));}return BPromise['all'](_0xa9e30);}})[_0x20cc('0x25')](function(){return _0x26817f;})[_0x20cc('0x25')](respondWithResult(_0x512f58,null))['catch'](handleError(_0x512f58,null));};exports[_0x20cc('0xb1')]=function(_0x1fde07,_0x225c5b,_0x5db8ce){return db[_0x20cc('0x35')][_0x20cc('0x50')]({'where':{'id':_0x1fde07[_0x20cc('0x5f')]['id']}})['then'](handleEntityNotFound(_0x225c5b,null))[_0x20cc('0x25')](function(_0x5c1afb){if(_0x5c1afb){return _0x5c1afb['removeBlackLists'](_0x1fde07[_0x20cc('0x3a')][_0x20cc('0x80')]);}})[_0x20cc('0x25')](function(_0x2ce0af){if(_0x2ce0af){return db[_0x20cc('0x69')][_0x20cc('0x2e')]({'where':{'ListId':_0x1fde07[_0x20cc('0x3a')][_0x20cc('0x80')],'VoiceQueueId':_0x1fde07[_0x20cc('0x5f')]['id']}})[_0x20cc('0x25')](function(){return _0x2ce0af;});}})[_0x20cc('0x25')](respondWithStatusCode(_0x225c5b,null))[_0x20cc('0x4c')](handleError(_0x225c5b,null));};
\ No newline at end of file
+var _0x708f=['rows','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','length','omit','createdAt','updatedAt','error','params','findOne','CmHopper','VoiceQueueId','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','isNil','interface','format','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','every','TeamId','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','push','SIP/%s','isArray','UserVoiceQueueRt','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','CmListId','ListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','stack','send','index','VoiceQueue','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x47cbcf,_0xa4013a){var _0x473d4c=function(_0x3257ef){while(--_0x3257ef){_0x47cbcf['push'](_0x47cbcf['shift']());}};_0x473d4c(++_0xa4013a);}(_0x708f,0x1d6));var _0xf708=function(_0x368ebf,_0x33111b){_0x368ebf=_0x368ebf-0x0;var _0x3cea0a=_0x708f[_0x368ebf];return _0x3cea0a;};'use strict';var emlformat=require(_0xf708('0x0'));var rimraf=require(_0xf708('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf708('0x2'));var BPromise=require(_0xf708('0x3'));var Mustache=require(_0xf708('0x4'));var util=require('util');var path=require(_0xf708('0x5'));var sox=require('sox');var csv=require(_0xf708('0x6'));var ejs=require(_0xf708('0x7'));var fs=require('fs');var fs_extra=require(_0xf708('0x8'));var _=require(_0xf708('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf708('0xa'));var deskjs=require(_0xf708('0xb'));var toCsv=require(_0xf708('0x6'));var querystring=require(_0xf708('0xc'));var Papa=require(_0xf708('0xd'));var Redis=require(_0xf708('0xe'));var authService=require(_0xf708('0xf'));var qs=require(_0xf708('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf708('0x11'));var logger=require(_0xf708('0x12'))('api');var utils=require(_0xf708('0x13'));var config=require(_0xf708('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf708('0x15'))['db'];config[_0xf708('0x16')]=_[_0xf708('0x17')](config[_0xf708('0x16')],{'host':_0xf708('0x18'),'port':0x18eb});var socket=require(_0xf708('0x19'))(new Redis(config[_0xf708('0x16')]));require(_0xf708('0x1a'))[_0xf708('0x1b')](socket);function respondWithStatusCode(_0x55f1ff,_0x2d7b0e){_0x2d7b0e=_0x2d7b0e||0xcc;return function(_0x457f7d){if(_0x457f7d){return _0x55f1ff[_0xf708('0x1c')](_0x2d7b0e);}return _0x55f1ff[_0xf708('0x1d')](_0x2d7b0e)[_0xf708('0x1e')]();};}function respondWithResult(_0xbf0431,_0x5d0949){_0x5d0949=_0x5d0949||0xc8;return function(_0x1ff261){if(_0x1ff261){return _0xbf0431[_0xf708('0x1d')](_0x5d0949)[_0xf708('0x1f')](_0x1ff261);}};}function respondWithFilteredResult(_0x3807e9,_0x13c3fc){return function(_0x69461d){if(_0x69461d){var _0x49aaa4=typeof _0x13c3fc[_0xf708('0x20')]===_0xf708('0x21')&&typeof _0x13c3fc[_0xf708('0x22')]==='undefined';var _0x2840fe=_0x69461d[_0xf708('0x23')];var _0x5d0f83=_0x49aaa4?0x0:_0x13c3fc['offset'];var _0x55089a=_0x49aaa4?_0x69461d[_0xf708('0x23')]:_0x13c3fc[_0xf708('0x20')]+_0x13c3fc['limit'];var _0x3b09a2;if(_0x55089a>=_0x2840fe){_0x55089a=_0x2840fe;_0x3b09a2=0xc8;}else{_0x3b09a2=0xce;}_0x3807e9['status'](_0x3b09a2);return _0x3807e9[_0xf708('0x24')](_0xf708('0x25'),_0x5d0f83+'-'+_0x55089a+'/'+_0x2840fe)[_0xf708('0x1f')](_0x69461d);}return null;};}function patchUpdates(_0x4b6916){return function(_0x492f9f){try{jsonpatch['apply'](_0x492f9f,_0x4b6916,!![]);}catch(_0x321c8b){return BPromise[_0xf708('0x26')](_0x321c8b);}return _0x492f9f['save']();};}function saveUpdates(_0x44f78c,_0x283216){return function(_0x16d0c8){if(_0x16d0c8){return _0x16d0c8['update'](_0x44f78c)[_0xf708('0x27')](function(_0xf160d6){return _0xf160d6;});}return null;};}function removeEntity(_0x55eed9,_0x291aee){return function(_0x3f143d){if(_0x3f143d){return _0x3f143d[_0xf708('0x28')]()[_0xf708('0x27')](function(){var _0x3b10f1=_0x3f143d[_0xf708('0x29')]({'plain':!![]});var _0x2c7349=[{'name':_0xf708('0x2a'),'value':_0xf708('0x2b'),'ignore':![]},{'name':_0xf708('0x2c'),'value':_0xf708('0x2d'),'ignore':![]}];var _0x282da2=_(_0x2c7349)[_0xf708('0x2e')](_0xf708('0x2f'))[_0xf708('0x30')](_0xf708('0x31'))['value']();if(_[_0xf708('0x32')](_0x282da2,_0x3b10f1[_0xf708('0x33')])){return;}var _0x56916c=_[_0xf708('0x34')](_0x2c7349,[_0xf708('0x31'),_0x3b10f1[_0xf708('0x33')]])[_0xf708('0x35')];return db[_0xf708('0x36')][_0xf708('0x28')]({'where':{'type':_0x56916c,'resourceId':_0x3b10f1['id']}})[_0xf708('0x27')](function(){return _0x3f143d;});})[_0xf708('0x27')](function(){_0x55eed9[_0xf708('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5419cd,_0xd55052){return function(_0x36dad7){if(!_0x36dad7){_0x5419cd[_0xf708('0x1c')](0x194);}return _0x36dad7;};}function handleError(_0x506988,_0x19e0cc){_0x19e0cc=_0x19e0cc||0x1f4;return function(_0x17be58){logger['error'](_0x17be58[_0xf708('0x37')]);if(_0x17be58['name']){delete _0x17be58[_0xf708('0x35')];}_0x506988[_0xf708('0x1d')](_0x19e0cc)[_0xf708('0x38')](_0x17be58);};}exports[_0xf708('0x39')]=function(_0x7a478c,_0x489953){var _0x3fa16d={},_0x7e8c8d={},_0x38d496={'count':0x0,'rows':[]};var _0x4efbe3=_[_0xf708('0x30')](db[_0xf708('0x3a')]['rawAttributes'],function(_0x4261c){return{'name':_0x4261c[_0xf708('0x3b')],'type':_0x4261c[_0xf708('0x33')]['key']};});_0x7e8c8d[_0xf708('0x3c')]=_[_0xf708('0x30')](_0x4efbe3,_0xf708('0x35'));_0x7e8c8d[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x7a478c[_0xf708('0x3d')]);_0x7e8c8d['filters']=_[_0xf708('0x3f')](_0x7e8c8d[_0xf708('0x3c')],_0x7e8c8d[_0xf708('0x3d')]);_0x3fa16d[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x7e8c8d[_0xf708('0x3c')],qs['fields'](_0x7a478c[_0xf708('0x3d')][_0xf708('0x41')]));_0x3fa16d[_0xf708('0x40')]=_0x3fa16d[_0xf708('0x40')]['length']?_0x3fa16d[_0xf708('0x40')]:_0x7e8c8d[_0xf708('0x3c')];if(!_0x7a478c[_0xf708('0x3d')][_0xf708('0x42')](_0xf708('0x43'))){_0x3fa16d[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x7a478c[_0xf708('0x3d')][_0xf708('0x22')]);_0x3fa16d['offset']=qs['offset'](_0x7a478c[_0xf708('0x3d')][_0xf708('0x20')]);}_0x3fa16d[_0xf708('0x44')]=qs['sort'](_0x7a478c[_0xf708('0x3d')][_0xf708('0x45')]);_0x3fa16d[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x7a478c[_0xf708('0x3d')],_0x7e8c8d[_0xf708('0x47')]),_0x4efbe3);if(_0x7a478c['query'][_0xf708('0x2e')]){_0x3fa16d[_0xf708('0x46')]=_[_0xf708('0x49')](_0x3fa16d[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x4efbe3,function(_0x2dd901){if(_0x2dd901['type']!==_0xf708('0x4a')){var _0x5ca611={};_0x5ca611[_0x2dd901[_0xf708('0x35')]]={'$like':'%'+_0x7a478c[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x5ca611;}})});}_0x3fa16d=_[_0xf708('0x49')]({},_0x3fa16d,_0x7a478c[_0xf708('0x4b')]);var _0xebd130={'where':_0x3fa16d[_0xf708('0x46')]};return db[_0xf708('0x3a')][_0xf708('0x23')](_0xebd130)[_0xf708('0x27')](function(_0x3c6372){_0x38d496[_0xf708('0x23')]=_0x3c6372;if(_0x7a478c[_0xf708('0x3d')][_0xf708('0x4c')]){_0x3fa16d[_0xf708('0x4d')]=[{'all':!![]}];}return db['VoiceQueue'][_0xf708('0x4e')](_0x3fa16d);})[_0xf708('0x27')](function(_0x1fdb2b){_0x38d496[_0xf708('0x4f')]=_0x1fdb2b;return _0x38d496;})[_0xf708('0x27')](respondWithFilteredResult(_0x489953,_0x3fa16d))['catch'](handleError(_0x489953,null));};exports['show']=function(_0x5aa69d,_0x3f1a85){var _0x13ec36={'raw':![],'where':{'id':_0x5aa69d['params']['id']}},_0x3ebcdf={};_0x3ebcdf[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x3a')][_0xf708('0x50')]);_0x3ebcdf['query']=_[_0xf708('0x3e')](_0x5aa69d[_0xf708('0x3d')]);_0x3ebcdf[_0xf708('0x47')]=_['intersection'](_0x3ebcdf['model'],_0x3ebcdf[_0xf708('0x3d')]);_0x13ec36[_0xf708('0x40')]=_['intersection'](_0x3ebcdf[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x5aa69d[_0xf708('0x3d')][_0xf708('0x41')]));_0x13ec36[_0xf708('0x40')]=_0x13ec36[_0xf708('0x40')]['length']?_0x13ec36[_0xf708('0x40')]:_0x3ebcdf[_0xf708('0x3c')];if(_0x5aa69d[_0xf708('0x3d')][_0xf708('0x4c')]){_0x13ec36[_0xf708('0x4d')]=[{'all':!![]}];}_0x13ec36=_[_0xf708('0x49')]({},_0x13ec36,_0x5aa69d[_0xf708('0x4b')]);return db[_0xf708('0x3a')]['find'](_0x13ec36)['then'](handleEntityNotFound(_0x3f1a85,null))[_0xf708('0x27')](respondWithResult(_0x3f1a85,null))[_0xf708('0x51')](handleError(_0x3f1a85,null));};exports[_0xf708('0x52')]=function(_0x43ddfc,_0x407762){return db[_0xf708('0x3a')][_0xf708('0x52')](_0x43ddfc[_0xf708('0x53')],{})[_0xf708('0x27')](function(_0x4a2500){var _0x74e3ae=_0x43ddfc[_0xf708('0x54')][_0xf708('0x29')]({'plain':!![]});if(!_0x74e3ae)throw new Error(_0xf708('0x55'));if(_0x74e3ae[_0xf708('0x56')]===_0xf708('0x54')){var _0x2cee0b=_0x4a2500[_0xf708('0x29')]({'plain':!![]});var _0x4631f5=[{'name':_0xf708('0x2a'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xf708('0x2d')}];var _0x4a7273=_[_0xf708('0x34')](_0x4631f5,[_0xf708('0x31'),_0x2cee0b[_0xf708('0x33')]])[_0xf708('0x35')];return db[_0xf708('0x57')][_0xf708('0x34')]({'where':{'name':_0x4a7273,'userProfileId':_0x74e3ae[_0xf708('0x58')]},'raw':!![]})[_0xf708('0x27')](function(_0x31de3f){if(_0x31de3f&&_0x31de3f[_0xf708('0x59')]===0x0){return db[_0xf708('0x36')][_0xf708('0x52')]({'name':_0x2cee0b['name'],'resourceId':_0x2cee0b['id'],'type':_0x31de3f[_0xf708('0x35')],'sectionId':_0x31de3f['id']},{})[_0xf708('0x27')](function(){return _0x4a2500;});}else{return _0x4a2500;}})[_0xf708('0x51')](function(_0xe9b451){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe9b451);throw _0xe9b451;});}return _0x4a2500;})[_0xf708('0x27')](respondWithResult(_0x407762,0xc9))[_0xf708('0x51')](handleError(_0x407762,null));};exports['clone']=function(_0x46daf7,_0x4d5fb3){var _0xcf6c68={'where':{'id':_0x46daf7['params']['id']}},_0x1a5950={};_0x1a5950[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x3a')][_0xf708('0x50')]);_0xcf6c68[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x1a5950[_0xf708('0x3c')],qs['fields'](_0x46daf7[_0xf708('0x3d')][_0xf708('0x41')]));_0xcf6c68[_0xf708('0x40')]=_0xcf6c68[_0xf708('0x40')][_0xf708('0x5a')]?_0xcf6c68['attributes']:_0x1a5950['model'];if(_0x46daf7[_0xf708('0x3d')][_0xf708('0x4c')]){_0xcf6c68['include']=[{'all':!![]}];}_0xcf6c68=_[_0xf708('0x49')]({},_0xcf6c68,_0x46daf7['options']);return db[_0xf708('0x3a')]['find'](_0xcf6c68)['then'](handleEntityNotFound(_0x4d5fb3,null))[_0xf708('0x27')](function(_0x237f0d){if(_0x237f0d){var _0x3ae330=_0x237f0d['get']({'plain':!![]});_0x3ae330=qs[_0xf708('0x5b')](_0x3ae330,['id','createdAt','updatedAt']);_0x46daf7[_0xf708('0x53')]=_[_0xf708('0x5b')](_0x46daf7[_0xf708('0x53')],['id',_0xf708('0x5c'),_0xf708('0x5d')]);return db['VoiceQueue'][_0xf708('0x52')](_['merge'](_0x3ae330,_0x46daf7['body']),{'include':_0x46daf7[_0xf708('0x3d')][_0xf708('0x4c')]?[{'all':!![]}]:undefined})[_0xf708('0x27')](function(_0x42d85f){var _0x52cb37=_0x46daf7[_0xf708('0x54')][_0xf708('0x29')]({'plain':!![]});if(!_0x52cb37)throw new Error(_0xf708('0x55'));if(_0x52cb37[_0xf708('0x56')]==='user'){var _0x4ec44a=_0x42d85f[_0xf708('0x29')]({'plain':!![]});var _0x4434bd=[{'name':_0xf708('0x2a'),'value':_0xf708('0x2b')},{'name':_0xf708('0x2c'),'value':_0xf708('0x2d')}];var _0xacb012=_[_0xf708('0x34')](_0x4434bd,[_0xf708('0x31'),_0x4ec44a[_0xf708('0x33')]])[_0xf708('0x35')];return db[_0xf708('0x57')][_0xf708('0x34')]({'where':{'name':_0xacb012,'userProfileId':_0x52cb37[_0xf708('0x58')]},'raw':!![]})[_0xf708('0x27')](function(_0x5c36e0){if(_0x5c36e0&&_0x5c36e0[_0xf708('0x59')]===0x0){return db[_0xf708('0x36')]['create']({'name':_0x4ec44a['name'],'resourceId':_0x4ec44a['id'],'type':_0x5c36e0[_0xf708('0x35')],'sectionId':_0x5c36e0['id']},{})[_0xf708('0x27')](function(){return _0x42d85f;});}else{return _0x42d85f;}})[_0xf708('0x51')](function(_0x173f59){logger[_0xf708('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x173f59);throw _0x173f59;});}return _0x42d85f;});}})[_0xf708('0x27')](respondWithResult(_0x4d5fb3,0xc9))[_0xf708('0x51')](handleError(_0x4d5fb3,null));};exports['update']=function(_0x1399a5,_0x65339){if(_0x1399a5[_0xf708('0x53')]['id']){delete _0x1399a5[_0xf708('0x53')]['id'];}return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x1399a5[_0xf708('0x5f')]['id']}})['then'](handleEntityNotFound(_0x65339,null))[_0xf708('0x27')](saveUpdates(_0x1399a5[_0xf708('0x53')],null))['then'](respondWithResult(_0x65339,null))['catch'](handleError(_0x65339,null));};exports[_0xf708('0x28')]=function(_0x4a4c85,_0x26c73d){return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x4a4c85['params']['id']}})['then'](handleEntityNotFound(_0x26c73d,null))['then'](removeEntity(_0x26c73d,null))['catch'](handleError(_0x26c73d,null));};exports['getHoppers']=function(_0x515801,_0x4442c9,_0x1d19af){var _0x13277d={'raw':![],'where':{}};var _0x1d9eeb={};var _0x408bda={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xf708('0x60')]({'where':{'id':_0x515801['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x4442c9,null))[_0xf708('0x27')](function(_0x590212){if(_0x590212){_0x1d9eeb[_0xf708('0x3c')]=_['keys'](db[_0xf708('0x61')][_0xf708('0x50')]);_0x1d9eeb[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x515801[_0xf708('0x3d')]);_0x1d9eeb[_0xf708('0x47')]=_['intersection'](_0x1d9eeb['model'],_0x1d9eeb['query']);_0x13277d['attributes']=_[_0xf708('0x3f')](_0x1d9eeb[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x515801[_0xf708('0x3d')]['fields']));_0x13277d[_0xf708('0x40')]=_0x13277d[_0xf708('0x40')][_0xf708('0x5a')]?_0x13277d[_0xf708('0x40')]:_0x1d9eeb[_0xf708('0x3c')];if(!_0x515801[_0xf708('0x3d')][_0xf708('0x42')](_0xf708('0x43'))){_0x13277d[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x515801[_0xf708('0x3d')][_0xf708('0x22')]);_0x13277d[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x515801[_0xf708('0x3d')]['offset']);}_0x13277d[_0xf708('0x44')]=qs[_0xf708('0x45')](_0x515801[_0xf708('0x3d')][_0xf708('0x45')]);_0x13277d[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x515801['query'],_0x1d9eeb[_0xf708('0x47')]));_0x13277d['where'][_0xf708('0x62')]=_0x590212['id'];if(_0x515801['query'][_0xf708('0x2e')]){_0x13277d[_0xf708('0x46')]=_[_0xf708('0x49')](_0x13277d[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x13277d[_0xf708('0x40')],function(_0x353728){var _0x28eb0f={};_0x28eb0f[_0x353728]={'$like':'%'+_0x515801[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x28eb0f;})});}_0x13277d=_[_0xf708('0x49')]({},_0x13277d,_0x515801[_0xf708('0x4b')]);return db[_0xf708('0x61')]['count']({'where':_0x13277d['where']})[_0xf708('0x27')](function(_0x25eb8d){_0x408bda[_0xf708('0x23')]=_0x25eb8d;if(_0x515801[_0xf708('0x3d')]['includeAll']){_0x13277d[_0xf708('0x4d')]=[{'all':!![]}];}return db[_0xf708('0x61')][_0xf708('0x4e')](_0x13277d);})[_0xf708('0x27')](function(_0x5c134d){_0x408bda[_0xf708('0x4f')]=_0x5c134d;return _0x408bda;});}})[_0xf708('0x27')](respondWithFilteredResult(_0x4442c9,_0x13277d))[_0xf708('0x51')](handleError(_0x4442c9,null));};exports['getHopperHistories']=function(_0x27b2e3,_0x2bd8a6,_0x57edb5){var _0x7c9df3={'raw':!![],'where':{}};var _0xe167fe={};var _0x5345b0={'count':0x0,'rows':[]};return db[_0xf708('0x3a')][_0xf708('0x60')]({'where':{'id':_0x27b2e3['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x2bd8a6,null))[_0xf708('0x27')](function(_0x4aee8e){if(_0x4aee8e){_0xe167fe[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x63')]['rawAttributes']);_0xe167fe[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x27b2e3[_0xf708('0x3d')]);_0xe167fe[_0xf708('0x47')]=_[_0xf708('0x3f')](_0xe167fe[_0xf708('0x3c')],_0xe167fe[_0xf708('0x3d')]);_0x7c9df3[_0xf708('0x40')]=_[_0xf708('0x3f')](_0xe167fe[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x27b2e3[_0xf708('0x3d')]['fields']));_0x7c9df3[_0xf708('0x40')]=_0x7c9df3[_0xf708('0x40')][_0xf708('0x5a')]?_0x7c9df3[_0xf708('0x40')]:_0xe167fe[_0xf708('0x3c')];if(!_0x27b2e3[_0xf708('0x3d')][_0xf708('0x42')]('nolimit')){_0x7c9df3['limit']=qs[_0xf708('0x22')](_0x27b2e3[_0xf708('0x3d')][_0xf708('0x22')]);_0x7c9df3[_0xf708('0x20')]=qs['offset'](_0x27b2e3[_0xf708('0x3d')]['offset']);}_0x7c9df3[_0xf708('0x44')]=qs['sort'](_0x27b2e3[_0xf708('0x3d')][_0xf708('0x45')]);_0x7c9df3[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x27b2e3[_0xf708('0x3d')],_0xe167fe['filters']));_0x7c9df3[_0xf708('0x46')][_0xf708('0x62')]=_0x4aee8e['id'];if(_0x27b2e3['query'][_0xf708('0x2e')]){_0x7c9df3[_0xf708('0x46')]=_['merge'](_0x7c9df3[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x7c9df3[_0xf708('0x40')],function(_0x92d961){var _0x302b9b={};_0x302b9b[_0x92d961]={'$like':'%'+_0x27b2e3['query'][_0xf708('0x2e')]+'%'};return _0x302b9b;})});}_0x7c9df3=_[_0xf708('0x49')]({},_0x7c9df3,_0x27b2e3[_0xf708('0x4b')]);return db[_0xf708('0x63')]['count']({'where':_0x7c9df3[_0xf708('0x46')]})[_0xf708('0x27')](function(_0x1dadd1){_0x5345b0[_0xf708('0x23')]=_0x1dadd1;if(_0x27b2e3[_0xf708('0x3d')]['includeAll']){_0x7c9df3['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xf708('0x4e')](_0x7c9df3);})['then'](function(_0x3f3055){_0x5345b0[_0xf708('0x4f')]=_0x3f3055;return _0x5345b0;});}})[_0xf708('0x27')](respondWithFilteredResult(_0x2bd8a6,_0x7c9df3))[_0xf708('0x51')](handleError(_0x2bd8a6,null));};exports['getHopperFinals']=function(_0xbb6045,_0x18931a,_0x13ea5a){var _0x422d95={'raw':!![],'where':{}};var _0x406602={};var _0x2f5ca5={'count':0x0,'rows':[]};return db[_0xf708('0x3a')]['findOne']({'where':{'id':_0xbb6045[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x18931a,null))['then'](function(_0x22f641){if(_0x22f641){_0x406602[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x64')][_0xf708('0x50')]);_0x406602['query']=_[_0xf708('0x3e')](_0xbb6045[_0xf708('0x3d')]);_0x406602['filters']=_['intersection'](_0x406602['model'],_0x406602[_0xf708('0x3d')]);_0x422d95[_0xf708('0x40')]=_['intersection'](_0x406602[_0xf708('0x3c')],qs[_0xf708('0x41')](_0xbb6045[_0xf708('0x3d')][_0xf708('0x41')]));_0x422d95[_0xf708('0x40')]=_0x422d95[_0xf708('0x40')][_0xf708('0x5a')]?_0x422d95['attributes']:_0x406602[_0xf708('0x3c')];if(!_0xbb6045[_0xf708('0x3d')]['hasOwnProperty'](_0xf708('0x43'))){_0x422d95[_0xf708('0x22')]=qs[_0xf708('0x22')](_0xbb6045['query']['limit']);_0x422d95[_0xf708('0x20')]=qs[_0xf708('0x20')](_0xbb6045[_0xf708('0x3d')][_0xf708('0x20')]);}_0x422d95[_0xf708('0x44')]=qs[_0xf708('0x45')](_0xbb6045[_0xf708('0x3d')][_0xf708('0x45')]);_0x422d95['where']=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0xbb6045[_0xf708('0x3d')],_0x406602[_0xf708('0x47')]));_0x422d95[_0xf708('0x46')][_0xf708('0x62')]=_0x22f641['id'];if(_0xbb6045['query'][_0xf708('0x2e')]){_0x422d95[_0xf708('0x46')]=_[_0xf708('0x49')](_0x422d95[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x422d95[_0xf708('0x40')],function(_0x2ea08d){var _0x395cb9={};_0x395cb9[_0x2ea08d]={'$like':'%'+_0xbb6045[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x395cb9;})});}_0x422d95=_['merge']({},_0x422d95,_0xbb6045[_0xf708('0x4b')]);return db[_0xf708('0x64')][_0xf708('0x23')]({'where':_0x422d95[_0xf708('0x46')]})['then'](function(_0x371c65){_0x2f5ca5[_0xf708('0x23')]=_0x371c65;if(_0xbb6045[_0xf708('0x3d')][_0xf708('0x4c')]){_0x422d95[_0xf708('0x4d')]=[{'all':!![]}];}return db[_0xf708('0x64')][_0xf708('0x4e')](_0x422d95);})[_0xf708('0x27')](function(_0x5dcd40){_0x2f5ca5['rows']=_0x5dcd40;return _0x2f5ca5;});}})['then'](respondWithFilteredResult(_0x18931a,_0x422d95))[_0xf708('0x51')](handleError(_0x18931a,null));};exports['getHopperBlacks']=function(_0x21e1a8,_0x34061c,_0x14653a){var _0x2625ee={'raw':!![],'where':{}};var _0x577539={};var _0x2432dc={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xf708('0x60')]({'where':{'id':_0x21e1a8[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x34061c,null))['then'](function(_0xdd8b94){if(_0xdd8b94){_0x577539['model']=_[_0xf708('0x3e')](db[_0xf708('0x65')][_0xf708('0x50')]);_0x577539['query']=_['keys'](_0x21e1a8['query']);_0x577539[_0xf708('0x47')]=_[_0xf708('0x3f')](_0x577539[_0xf708('0x3c')],_0x577539[_0xf708('0x3d')]);_0x2625ee[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x577539[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x21e1a8['query'][_0xf708('0x41')]));_0x2625ee[_0xf708('0x40')]=_0x2625ee[_0xf708('0x40')][_0xf708('0x5a')]?_0x2625ee[_0xf708('0x40')]:_0x577539['model'];if(!_0x21e1a8['query']['hasOwnProperty'](_0xf708('0x43'))){_0x2625ee[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x21e1a8[_0xf708('0x3d')]['limit']);_0x2625ee[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x21e1a8[_0xf708('0x3d')][_0xf708('0x20')]);}_0x2625ee[_0xf708('0x44')]=qs[_0xf708('0x45')](_0x21e1a8[_0xf708('0x3d')][_0xf708('0x45')]);_0x2625ee['where']=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x21e1a8[_0xf708('0x3d')],_0x577539['filters']));_0x2625ee[_0xf708('0x46')][_0xf708('0x62')]=_0xdd8b94['id'];if(_0x21e1a8['query'][_0xf708('0x2e')]){_0x2625ee[_0xf708('0x46')]=_[_0xf708('0x49')](_0x2625ee['where'],{'$or':_[_0xf708('0x30')](_0x2625ee[_0xf708('0x40')],function(_0x4bd43e){var _0x291769={};_0x291769[_0x4bd43e]={'$like':'%'+_0x21e1a8[_0xf708('0x3d')]['filter']+'%'};return _0x291769;})});}_0x2625ee=_[_0xf708('0x49')]({},_0x2625ee,_0x21e1a8[_0xf708('0x4b')]);return db['CmHopperBlack'][_0xf708('0x23')]({'where':_0x2625ee[_0xf708('0x46')]})[_0xf708('0x27')](function(_0x254a31){_0x2432dc[_0xf708('0x23')]=_0x254a31;if(_0x21e1a8[_0xf708('0x3d')][_0xf708('0x4c')]){_0x2625ee[_0xf708('0x4d')]=[{'all':!![]}];}return db[_0xf708('0x65')][_0xf708('0x4e')](_0x2625ee);})[_0xf708('0x27')](function(_0x15810b){_0x2432dc[_0xf708('0x4f')]=_0x15810b;return _0x2432dc;});}})[_0xf708('0x27')](respondWithFilteredResult(_0x34061c,_0x2625ee))[_0xf708('0x51')](handleError(_0x34061c,null));};exports[_0xf708('0x66')]=function(_0x4166a0,_0x4d4fab,_0x633606){var _0x5de34c={};var _0x52ce0a={};var _0x474b7f;var _0x16327f;return db[_0xf708('0x3a')][_0xf708('0x60')]({'where':{'id':_0x4166a0[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x4d4fab,null))[_0xf708('0x27')](function(_0x46088a){if(_0x46088a){_0x474b7f=_0x46088a;_0x52ce0a[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x67')][_0xf708('0x50')]);_0x52ce0a[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x4166a0[_0xf708('0x3d')]);_0x52ce0a[_0xf708('0x47')]=_[_0xf708('0x3f')](_0x52ce0a['model'],_0x52ce0a['query']);_0x5de34c['attributes']=_[_0xf708('0x3f')](_0x52ce0a[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x4166a0[_0xf708('0x3d')][_0xf708('0x41')]));_0x5de34c['attributes']=_0x5de34c[_0xf708('0x40')][_0xf708('0x5a')]?_0x5de34c[_0xf708('0x40')]:_0x52ce0a[_0xf708('0x3c')];_0x5de34c[_0xf708('0x44')]=qs[_0xf708('0x45')](_0x4166a0[_0xf708('0x3d')][_0xf708('0x45')]);_0x5de34c[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x4166a0[_0xf708('0x3d')],_0x52ce0a['filters']));if(_0x4166a0[_0xf708('0x3d')][_0xf708('0x2e')]){_0x5de34c[_0xf708('0x46')]=_[_0xf708('0x49')](_0x5de34c['where'],{'$or':_[_0xf708('0x30')](_0x5de34c[_0xf708('0x40')],function(_0x4cd50f){var _0x28d0a3={};_0x28d0a3[_0x4cd50f]={'$like':'%'+_0x4166a0[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x28d0a3;})});}_0x5de34c=_[_0xf708('0x49')]({},_0x5de34c,_0x4166a0[_0xf708('0x4b')]);return _0x474b7f['getTeams'](_0x5de34c);}})[_0xf708('0x27')](function(_0x51d26c){if(_0x51d26c){_0x16327f=_0x51d26c['length'];if(!_0x4166a0[_0xf708('0x3d')]['hasOwnProperty'](_0xf708('0x43'))){_0x5de34c['limit']=qs[_0xf708('0x22')](_0x4166a0[_0xf708('0x3d')][_0xf708('0x22')]);_0x5de34c[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x4166a0[_0xf708('0x3d')]['offset']);}return _0x474b7f[_0xf708('0x66')](_0x5de34c);}})[_0xf708('0x27')](function(_0x492f49){if(_0x492f49){return _0x492f49?{'count':_0x16327f,'rows':_0x492f49}:null;}})[_0xf708('0x27')](respondWithResult(_0x4d4fab,null))[_0xf708('0x51')](handleError(_0x4d4fab,null));};exports[_0xf708('0x68')]=function(_0x2bf410,_0x34f306,_0x47cc73){var _0x5f4aac=_0x2bf410[_0xf708('0x53')][_0xf708('0x69')];var _0x513299=_['map'](_0x5f4aac,'id');return db[_0xf708('0x67')]['findAll']({'where':{'id':_0x513299},'attributes':['id'],'include':[{'model':db[_0xf708('0x6a')],'as':_0xf708('0x6b'),'attributes':['id','name',_0xf708('0x6c'),_0xf708('0x6d'),'interface'],'raw':!![]}]})[_0xf708('0x27')](function(_0x381118){if(_0x381118){var _0x36f1a1=_[_0xf708('0x6e')](_0x381118,function(_0x308f3e){var _0x25d432=_0x308f3e[_0xf708('0x29')]({'plain':!![]});_0x25d432[_0xf708('0x6b')][_0xf708('0x6f')](function(_0x6a6ef9){_0x6a6ef9[_0xf708('0x70')]=_[_0xf708('0x34')](_0x5f4aac,{'id':_0x25d432['id']})['penalty'];});return _0x25d432[_0xf708('0x6b')];});return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x2bf410[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](function(_0x3912f9){return db['sequelize'][_0xf708('0x71')](function(_0x5a2c3d){return _0x3912f9[_0xf708('0x68')](_0x513299,{'transaction':_0x5a2c3d})[_0xf708('0x27')](function(){return BPromise['each'](_0x5f4aac,function(_0xfac805){return db[_0xf708('0x72')][_0xf708('0x73')]({'TeamId':_0xfac805['id'],'VoiceQueueId':_0x2bf410[_0xf708('0x5f')]['id'],'penalty':_0xfac805['penalty']},{'transaction':_0x5a2c3d});});})['then'](function(){return BPromise[_0xf708('0x74')](_0x36f1a1,function(_0x5ed14b){return db[_0xf708('0x75')][_0xf708('0x76')]({'where':{'UserId':_0x5ed14b['id'],'VoiceQueueId':_0x2bf410['params']['id']},'defaults':{'penalty':_0x5ed14b[_0xf708('0x70')]},'transaction':_0x5a2c3d});});})['then'](function(){return BPromise[_0xf708('0x74')](_[_0xf708('0x2e')](_0x36f1a1,{'online':!![]}),function(_0x123842){return db['UserVoiceQueueRt'][_0xf708('0x73')]({'membername':_0x123842['name'],'UserId':_0x123842['id'],'queue_name':_0x3912f9[_0xf708('0x35')],'VoiceQueueId':_0x3912f9['id'],'interface':_[_0xf708('0x77')](_0x123842[_0xf708('0x78')])?util[_0xf708('0x79')]('SIP/%s',_0x123842[_0xf708('0x35')]):_0x123842[_0xf708('0x78')],'paused':_0x123842[_0xf708('0x6d')]||![],'penalty':_0x123842[_0xf708('0x70')]},{'transaction':_0x5a2c3d});});})[_0xf708('0x27')](function(){_0x36f1a1[_0xf708('0x6f')](function(_0x4e17c6){socket[_0xf708('0x7a')](_0xf708('0x7b'),{'UserId':_0x4e17c6['id'],'VoiceQueueId':_0x3912f9['id']});});});});});}})[_0xf708('0x27')](respondWithStatusCode(_0x34f306,null))[_0xf708('0x51')](handleError(_0x34f306,null));};exports[_0xf708('0x7c')]=function(_0x3953a4,_0x38587f,_0x543787){return db[_0xf708('0x67')]['findAll']({'where':{'id':_0x3953a4[_0xf708('0x3d')][_0xf708('0x7d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf708('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xf708('0x27')](handleEntityNotFound(_0x38587f,null))['then'](function(_0xc15d4){var _0x5cdfef=_[_0xf708('0x30')](_0xc15d4,'id');var _0x17dcbe=[];var _0x3c3531=[];var _0x339115=squel[_0xf708('0x7e')]();_0x339115[_0xf708('0x7f')](_0xf708('0x80'))[_0xf708('0x81')](_0xf708('0x82'),'tq')[_0xf708('0x83')](_0xf708('0x84'),'ut',_0xf708('0x85'))[_0xf708('0x46')](_0xf708('0x86'),_0x3953a4[_0xf708('0x5f')]['id']);for(var _0x54327a=0x0;_0x54327a<_0xc15d4[_0xf708('0x5a')];_0x54327a+=0x1){let _0x21faa4=_0xc15d4[_0x54327a];for(var _0x3c92de=0x0;_0x3c92de<_0x21faa4[_0xf708('0x6b')][_0xf708('0x5a')];_0x3c92de+=0x1){let _0x30f554=_0x21faa4['Agents'][_0x3c92de];var _0x567136=_0x339115[_0xf708('0x87')]();_0x567136['where'](_0xf708('0x88'),_0x30f554['id']);_0x3c3531['push'](db[_0xf708('0x89')][_0xf708('0x3d')](_0x567136[_0xf708('0x8a')](),{'type':db[_0xf708('0x89')]['QueryTypes']['SELECT']})[_0xf708('0x27')](function(_0x42c359){if(_0x42c359[_0xf708('0x5a')]===0x1){return _0x30f554['id'];}else{var _0x263e04=_[_0xf708('0x8b')](_['map'](_0x42c359,_0xf708('0x8c')),function(_0x41f423){return _[_0xf708('0x32')](_0x5cdfef,_0x41f423);});if(_0x263e04){return _0x30f554['id'];}}}));}}return BPromise[_0xf708('0x8d')](_0x3c3531)['then'](function(_0x4d8828){_0x17dcbe=_(_0x17dcbe)[_0xf708('0x8e')](_0x4d8828)[_0xf708('0x8f')]()[_0xf708('0x31')]();return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x3953a4['params']['id']}})[_0xf708('0x27')](function(_0x1dffea){return db['sequelize'][_0xf708('0x71')](function(_0x25d108){return _0x1dffea[_0xf708('0x7c')](_0x3953a4[_0xf708('0x3d')][_0xf708('0x7d')],{'transaction':_0x25d108})[_0xf708('0x27')](function(){if(!_[_0xf708('0x90')](_0x17dcbe)){return _0x1dffea[_0xf708('0x91')](_0x17dcbe,{'transaction':_0x25d108})['then'](function(){return db['UserVoiceQueueRt'][_0xf708('0x28')]({'where':{'VoiceQueueId':_0x3953a4[_0xf708('0x5f')]['id'],'UserId':_0x17dcbe},'transaction':_0x25d108});});}})[_0xf708('0x27')](function(){_0x17dcbe[_0xf708('0x6f')](function(_0x39d643){socket[_0xf708('0x7a')](_0xf708('0x92'),{'UserId':_0x39d643,'VoiceQueueId':_0x1dffea['id']});});});});});});})[_0xf708('0x27')](respondWithStatusCode(_0x38587f,null))[_0xf708('0x51')](handleError(_0x38587f,null));};exports[_0xf708('0x93')]=function(_0x1094eb,_0x35aee5,_0x156e27){var _0x40bfa9,_0x3606fa;return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x1094eb['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x35aee5,null))[_0xf708('0x27')](function(_0x38cf80){if(_0x38cf80){_0x3606fa=_0x38cf80;return _0x38cf80[_0xf708('0x93')](_0x1094eb[_0xf708('0x53')][_0xf708('0x7d')],_[_0xf708('0x5b')](_0x1094eb[_0xf708('0x53')],['ids','id'])||{})['spread'](function(_0x56bb2b){for(var _0x35883b=0x0;_0x35883b<_0x1094eb[_0xf708('0x53')][_0xf708('0x7d')]['length'];_0x35883b+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x1094eb[_0xf708('0x53')][_0xf708('0x7d')][_0x35883b]),'VoiceQueueId':Number(_0x1094eb[_0xf708('0x5f')]['id'])});}return _0x56bb2b;});}})[_0xf708('0x27')](function(_0x505788){_0x40bfa9=_0x505788||[];if(_0x3606fa){return db['User'][_0xf708('0x4e')]({'where':{'id':_0x1094eb[_0xf708('0x53')][_0xf708('0x7d')]},'attributes':['id',_0xf708('0x35'),'online',_0xf708('0x6d'),_0xf708('0x78')],'raw':!![]});}})[_0xf708('0x27')](function(_0x1a0a7e){if(!_[_0xf708('0x90')](_0x1a0a7e)){var _0x631221=[];for(var _0x52e7c1=0x0;_0x52e7c1<_0x1a0a7e[_0xf708('0x5a')];_0x52e7c1++){if(_0x1a0a7e[_0x52e7c1][_0xf708('0x6c')]){_0x631221[_0xf708('0x94')](db['UserVoiceQueueRt'][_0xf708('0x73')]({'membername':_0x1a0a7e[_0x52e7c1]['name'],'UserId':_0x1a0a7e[_0x52e7c1]['id'],'queue_name':_0x3606fa['name'],'VoiceQueueId':_0x3606fa['id'],'interface':_[_0xf708('0x77')](_0x1a0a7e[_0x52e7c1][_0xf708('0x78')])?util['format'](_0xf708('0x95'),_0x1a0a7e[_0x52e7c1][_0xf708('0x35')]):_0x1a0a7e[_0x52e7c1]['interface'],'paused':_0x1a0a7e[_0x52e7c1]['voicePause']||![],'penalty':_0x1094eb[_0xf708('0x53')][_0xf708('0x70')]||0x0}));}}return BPromise['all'](_0x631221);}})[_0xf708('0x27')](function(){return _0x40bfa9;})[_0xf708('0x27')](respondWithResult(_0x35aee5,null))[_0xf708('0x51')](handleError(_0x35aee5,null));};exports['removeAgents']=function(_0x34ccd5,_0x1c3f7e,_0x5e9540){return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x34ccd5[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x1c3f7e,null))[_0xf708('0x27')](function(_0x4e9fbb){if(_0x4e9fbb){return _0x4e9fbb[_0xf708('0x91')](_0x34ccd5['query'][_0xf708('0x7d')])['then'](function(){if(_[_0xf708('0x96')](_0x34ccd5[_0xf708('0x3d')]['ids'])){for(var _0x57d05a=0x0;_0x57d05a<_0x34ccd5['query'][_0xf708('0x7d')]['length'];_0x57d05a+=0x1){socket[_0xf708('0x7a')](_0xf708('0x92'),{'UserId':Number(_0x34ccd5['query'][_0xf708('0x7d')][_0x57d05a]),'VoiceQueueId':Number(_0x34ccd5['params']['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x34ccd5[_0xf708('0x3d')][_0xf708('0x7d')]),'VoiceQueueId':Number(_0x34ccd5[_0xf708('0x5f')]['id'])});}});}})[_0xf708('0x27')](function(_0x21738e){return db[_0xf708('0x97')]['destroy']({'where':{'VoiceQueueId':_0x34ccd5['params']['id'],'UserId':_0x34ccd5[_0xf708('0x3d')][_0xf708('0x7d')]}})[_0xf708('0x27')](function(){return _0x21738e;});})['then'](respondWithStatusCode(_0x1c3f7e,null))[_0xf708('0x51')](handleError(_0x1c3f7e,null));};exports[_0xf708('0x98')]=function(_0x2eac88,_0xd73ef,_0x490b16){var _0xa42b8e={};var _0x5e95c1={};var _0x2f4520;var _0x454ed0;return db[_0xf708('0x3a')][_0xf708('0x60')]({'where':{'id':_0x2eac88[_0xf708('0x5f')]['id']}})['then'](handleEntityNotFound(_0xd73ef,null))[_0xf708('0x27')](function(_0x33ea9e){if(_0x33ea9e){_0x2f4520=_0x33ea9e;_0x5e95c1['model']=_[_0xf708('0x3e')](db['User'][_0xf708('0x50')]);_0x5e95c1[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x2eac88['query']);_0x5e95c1['filters']=_[_0xf708('0x3f')](_0x5e95c1['model'],_0x5e95c1['query']);_0xa42b8e['attributes']=_[_0xf708('0x3f')](_0x5e95c1[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x2eac88[_0xf708('0x3d')][_0xf708('0x41')]));_0xa42b8e[_0xf708('0x40')]=_0xa42b8e[_0xf708('0x40')]['length']?_0xa42b8e[_0xf708('0x40')]:_0x5e95c1['model'];_0xa42b8e[_0xf708('0x44')]=qs['sort'](_0x2eac88[_0xf708('0x3d')]['sort']);_0xa42b8e[_0xf708('0x46')]=qs['filters'](_[_0xf708('0x48')](_0x2eac88['query'],_0x5e95c1[_0xf708('0x47')]));if(_0x2eac88[_0xf708('0x3d')][_0xf708('0x2e')]){_0xa42b8e['where']=_[_0xf708('0x49')](_0xa42b8e['where'],{'$or':_[_0xf708('0x30')](_0xa42b8e[_0xf708('0x40')],function(_0x525139){var _0x3ed3d5={};_0x3ed3d5[_0x525139]={'$like':'%'+_0x2eac88['query']['filter']+'%'};return _0x3ed3d5;})});}_0xa42b8e=_[_0xf708('0x49')]({},_0xa42b8e,_0x2eac88[_0xf708('0x4b')]);return _0x2f4520['getAgents'](_0xa42b8e);}})[_0xf708('0x27')](function(_0x3cb14c){if(_0x3cb14c){_0x454ed0=_0x3cb14c['length'];if(!_0x2eac88['query'][_0xf708('0x42')](_0xf708('0x43'))){_0xa42b8e[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x2eac88[_0xf708('0x3d')][_0xf708('0x22')]);_0xa42b8e[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x2eac88[_0xf708('0x3d')][_0xf708('0x20')]);}return _0x2f4520[_0xf708('0x98')](_0xa42b8e);}})[_0xf708('0x27')](function(_0x4331a9){if(_0x4331a9){return _0x4331a9?{'count':_0x454ed0,'rows':_0x4331a9}:null;}})['then'](respondWithResult(_0xd73ef,null))[_0xf708('0x51')](handleError(_0xd73ef,null));};exports[_0xf708('0x99')]=function(_0x474d36,_0x36be75,_0x3cf4f5){var _0x4c155f={};var _0x630157={};var _0x1e7335;var _0x240ee1;return db['VoiceQueue'][_0xf708('0x60')]({'where':{'id':_0x474d36[_0xf708('0x5f')]['id']}})['then'](handleEntityNotFound(_0x36be75,null))[_0xf708('0x27')](function(_0x237ba2){if(_0x237ba2){_0x1e7335=_0x237ba2;_0x630157[_0xf708('0x3c')]=_['keys'](db['UserVoiceQueueRt'][_0xf708('0x50')]);_0x630157[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x474d36['query']);_0x630157[_0xf708('0x47')]=_[_0xf708('0x3f')](_0x630157[_0xf708('0x3c')],_0x630157[_0xf708('0x3d')]);_0x4c155f[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x630157[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x474d36[_0xf708('0x3d')]['fields']));_0x4c155f['attributes']=_0x4c155f[_0xf708('0x40')]['length']?_0x4c155f['attributes']:_0x630157[_0xf708('0x3c')];_0x4c155f[_0xf708('0x44')]=qs[_0xf708('0x45')](_0x474d36['query'][_0xf708('0x45')]);_0x4c155f[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x474d36[_0xf708('0x3d')],_0x630157[_0xf708('0x47')]));if(_0x474d36[_0xf708('0x3d')]['filter']){_0x4c155f['where']=_['merge'](_0x4c155f[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x4c155f['attributes'],function(_0x594abd){var _0x464d3b={};_0x464d3b[_0x594abd]={'$like':'%'+_0x474d36[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x464d3b;})});}_0x4c155f=_[_0xf708('0x49')]({},_0x4c155f,_0x474d36[_0xf708('0x4b')]);return _0x1e7335[_0xf708('0x99')](_0x4c155f);}})['then'](function(_0x37ffe1){if(_0x37ffe1){_0x240ee1=_0x37ffe1[_0xf708('0x5a')];if(!_0x474d36[_0xf708('0x3d')]['hasOwnProperty'](_0xf708('0x43'))){_0x4c155f[_0xf708('0x22')]=qs['limit'](_0x474d36[_0xf708('0x3d')][_0xf708('0x22')]);_0x4c155f['offset']=qs[_0xf708('0x20')](_0x474d36['query'][_0xf708('0x20')]);}return _0x1e7335[_0xf708('0x99')](_0x4c155f);}})[_0xf708('0x27')](function(_0x505866){return _0x505866?{'count':_0x240ee1,'rows':_0x505866}:null;})[_0xf708('0x27')](respondWithResult(_0x36be75,null))[_0xf708('0x51')](handleError(_0x36be75,null));};exports[_0xf708('0x9a')]=function(_0x5871d3,_0x440e1b,_0x4df80e){var _0xe8da9a={};var _0x2cdba3={};var _0x15f8fe;var _0xebcc5;return db[_0xf708('0x3a')][_0xf708('0x60')]({'where':{'id':_0x5871d3[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x440e1b,null))[_0xf708('0x27')](function(_0x514b66){if(_0x514b66){_0x15f8fe=_0x514b66;_0x2cdba3[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x9b')][_0xf708('0x50')]);_0x2cdba3['query']=_['keys'](_0x5871d3[_0xf708('0x3d')]);_0x2cdba3['filters']=_['intersection'](_0x2cdba3['model'],_0x2cdba3[_0xf708('0x3d')]);_0xe8da9a[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x2cdba3[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x5871d3[_0xf708('0x3d')][_0xf708('0x41')]));_0xe8da9a[_0xf708('0x40')]=_0xe8da9a[_0xf708('0x40')]['length']?_0xe8da9a[_0xf708('0x40')]:_0x2cdba3['model'];_0xe8da9a[_0xf708('0x44')]=qs['sort'](_0x5871d3['query'][_0xf708('0x45')]);_0xe8da9a[_0xf708('0x46')]=qs[_0xf708('0x47')](_['pick'](_0x5871d3[_0xf708('0x3d')],_0x2cdba3[_0xf708('0x47')]));if(_0x5871d3[_0xf708('0x3d')]['filter']){_0xe8da9a[_0xf708('0x46')]=_[_0xf708('0x49')](_0xe8da9a[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0xe8da9a[_0xf708('0x40')],function(_0x50f7ac){var _0x36ccdc={};_0x36ccdc[_0x50f7ac]={'$like':'%'+_0x5871d3[_0xf708('0x3d')]['filter']+'%'};return _0x36ccdc;})});}_0xe8da9a=_['merge']({},_0xe8da9a,_0x5871d3[_0xf708('0x4b')]);return _0x15f8fe[_0xf708('0x9a')](_0xe8da9a);}})[_0xf708('0x27')](function(_0x33cd49){if(_0x33cd49){_0xebcc5=_0x33cd49[_0xf708('0x5a')];if(!_0x5871d3['query']['hasOwnProperty']('nolimit')){_0xe8da9a['limit']=qs[_0xf708('0x22')](_0x5871d3[_0xf708('0x3d')][_0xf708('0x22')]);_0xe8da9a[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x5871d3[_0xf708('0x3d')][_0xf708('0x20')]);}return _0x15f8fe[_0xf708('0x9a')](_0xe8da9a);}})[_0xf708('0x27')](function(_0x59d4b0){if(_0x59d4b0){return _0x59d4b0?{'count':_0xebcc5,'rows':_0x59d4b0}:null;}})['then'](respondWithResult(_0x440e1b,null))[_0xf708('0x51')](handleError(_0x440e1b,null));};exports[_0xf708('0x9c')]=function(_0x4f8e79,_0x1a61cd,_0x10143c){var _0x1f3f60,_0x4dfe51;return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x4f8e79['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x1a61cd,null))[_0xf708('0x27')](function(_0x3d61a6){if(_0x3d61a6){_0x4dfe51=_0x3d61a6;return _0x3d61a6['addLists'](_0x4f8e79['body']['ids'],_[_0xf708('0x5b')](_0x4f8e79['body'],['ids','id'])||{});}return null;})[_0xf708('0x9d')](function(_0x2be40c){var _0x68f2d1;_0x1f3f60=_0x2be40c||[];var _0x20660a=[];if(_0x2be40c){for(var _0x2017b5=0x0;_0x2017b5<_0x2be40c[_0xf708('0x5a')];_0x2017b5+=0x1){var _0x44ab19=_0x2be40c[_0x2017b5][_0xf708('0x29')]({'plain':!![]});_0x4dfe51[_0xf708('0x9e')]=_0x4f8e79[_0xf708('0x53')][_0xf708('0x9e')]?_0x4f8e79[_0xf708('0x53')][_0xf708('0x9e')]:_0x4dfe51['dialCheckDuplicateType'];switch(_0x4dfe51['dialCheckDuplicateType']){case _0xf708('0x9f'):_0x68f2d1=squel[_0xf708('0xa0')]()[_0xf708('0xa1')](_0xf708('0xa2'))[_0xf708('0xa3')]([_0xf708('0xa4'),_0xf708('0xa5'),_0xf708('0xa6'),'ListId',_0xf708('0x62'),_0xf708('0x5c'),'updatedAt'],squel['select']()[_0xf708('0x7f')](_0xf708('0xa4'),_0xf708('0xa4'))[_0xf708('0x7f')]('NOW()',_0xf708('0xa5'))[_0xf708('0x7f')]('id',_0xf708('0xa6'))['field'](_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')](),_0xf708('0xa8'))[_0xf708('0x7f')](_0x4f8e79[_0xf708('0x5f')]['id'][_0xf708('0x8a')](),'VoiceQueueId')[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0x5c'))[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0x5d'))[_0xf708('0x81')](_0xf708('0xaa'))['where'](_0xf708('0xab'))['where'](_0xf708('0xac'),_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')]())['where'](_0xf708('0xad'))[_0xf708('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf708('0x7e')]()[_0xf708('0x7f')](_0xf708('0xae'))[_0xf708('0x81')]('cm_hopper_final')[_0xf708('0x46')]('VoiceQueueId\x20=\x20?',_0x4f8e79['params']['id'][_0xf708('0x8a')]()))[_0xf708('0x46')](_0xf708('0xaf'),squel['select']()['field'](_0xf708('0xb0'))[_0xf708('0x81')](_0xf708('0xa2'))[_0xf708('0x46')](_0xf708('0x86'),_0x4f8e79[_0xf708('0x5f')]['id'][_0xf708('0x8a')]())))[_0xf708('0x8a')]();break;case _0xf708('0xb1'):_0x68f2d1=squel[_0xf708('0xa0')]()[_0xf708('0xa1')]('cm_hopper')[_0xf708('0xa3')]([_0xf708('0xa4'),_0xf708('0xa5'),_0xf708('0xa6'),_0xf708('0xa8'),_0xf708('0x62'),_0xf708('0x5c'),'updatedAt'],squel['select']()[_0xf708('0x7f')](_0xf708('0xa4'),_0xf708('0xa4'))['field'](_0xf708('0xa9'),_0xf708('0xa5'))['field']('id',_0xf708('0xa6'))[_0xf708('0x7f')](_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')](),_0xf708('0xa8'))['field'](_0x4f8e79[_0xf708('0x5f')]['id'][_0xf708('0x8a')](),_0xf708('0x62'))[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0x5c'))[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0x5d'))[_0xf708('0x81')](_0xf708('0xaa'))[_0xf708('0x46')](_0xf708('0xab'))[_0xf708('0x46')](_0xf708('0xac'),_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')]())[_0xf708('0x46')](_0xf708('0xad'))[_0xf708('0x46')](_0xf708('0xaf'),squel[_0xf708('0x7e')]()[_0xf708('0x7f')]('COALESCE(phone,\x27\x27)')['from'](_0xf708('0xa2'))[_0xf708('0x46')](_0xf708('0x86'),_0x4f8e79['params']['id'][_0xf708('0x8a')]())))['toString']();break;default:_0x68f2d1=squel[_0xf708('0xa0')]()[_0xf708('0xa1')]('cm_hopper')[_0xf708('0xa3')]([_0xf708('0xa4'),_0xf708('0xa5'),'ContactId',_0xf708('0xa8'),_0xf708('0x62'),'createdAt',_0xf708('0x5d')],squel[_0xf708('0x7e')]()['field'](_0xf708('0xa4'),'phone')[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0xa5'))[_0xf708('0x7f')]('id',_0xf708('0xa6'))[_0xf708('0x7f')](_0x44ab19['CmListId'][_0xf708('0x8a')](),_0xf708('0xa8'))['field'](_0x4f8e79[_0xf708('0x5f')]['id'][_0xf708('0x8a')](),_0xf708('0x62'))['field'](_0xf708('0xa9'),_0xf708('0x5c'))[_0xf708('0x7f')]('NOW()',_0xf708('0x5d'))[_0xf708('0x81')](_0xf708('0xaa'))[_0xf708('0x46')](_0xf708('0xab'))[_0xf708('0x46')](_0xf708('0xac'),_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')]())[_0xf708('0x46')](_0xf708('0xad')))[_0xf708('0x8a')]();}_0x20660a['push'](db['sequelize'][_0xf708('0x3d')](_0x68f2d1));}return BPromise[_0xf708('0x8d')](_0x20660a);}})[_0xf708('0x27')](function(){return _0x1f3f60;})['then'](respondWithResult(_0x1a61cd,null))[_0xf708('0x51')](handleError(_0x1a61cd,null));};exports[_0xf708('0xb2')]=function(_0x272b6d,_0x24d35c,_0x36759f){return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x272b6d['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x24d35c,null))[_0xf708('0x27')](function(_0x35c2ea){if(_0x35c2ea){return _0x35c2ea[_0xf708('0xb2')](_0x272b6d[_0xf708('0x3d')][_0xf708('0x7d')]);}})[_0xf708('0x27')](function(_0x497b1a){if(_0x497b1a){return db[_0xf708('0x61')][_0xf708('0x28')]({'where':{'ListId':_0x272b6d[_0xf708('0x3d')][_0xf708('0x7d')],'VoiceQueueId':_0x272b6d['params']['id']}})[_0xf708('0x27')](function(){return _0x497b1a;});}})[_0xf708('0x27')](respondWithStatusCode(_0x24d35c,null))[_0xf708('0x51')](handleError(_0x24d35c,null));};exports[_0xf708('0xb3')]=function(_0x56ee44,_0x42fcab,_0x41579e){var _0x11cde7={};var _0x42c996={};var _0x18921c;var _0x38544d;return db['VoiceQueue'][_0xf708('0x60')]({'where':{'id':_0x56ee44[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x42fcab,null))['then'](function(_0x44d3c4){if(_0x44d3c4){_0x18921c=_0x44d3c4;_0x42c996[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x9b')][_0xf708('0x50')]);_0x42c996['query']=_[_0xf708('0x3e')](_0x56ee44[_0xf708('0x3d')]);_0x42c996[_0xf708('0x47')]=_['intersection'](_0x42c996[_0xf708('0x3c')],_0x42c996[_0xf708('0x3d')]);_0x11cde7['attributes']=_[_0xf708('0x3f')](_0x42c996[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x56ee44[_0xf708('0x3d')][_0xf708('0x41')]));_0x11cde7[_0xf708('0x40')]=_0x11cde7['attributes'][_0xf708('0x5a')]?_0x11cde7[_0xf708('0x40')]:_0x42c996[_0xf708('0x3c')];_0x11cde7[_0xf708('0x44')]=qs['sort'](_0x56ee44[_0xf708('0x3d')][_0xf708('0x45')]);_0x11cde7[_0xf708('0x46')]=qs[_0xf708('0x47')](_['pick'](_0x56ee44[_0xf708('0x3d')],_0x42c996['filters']));if(_0x56ee44[_0xf708('0x3d')][_0xf708('0x2e')]){_0x11cde7[_0xf708('0x46')]=_[_0xf708('0x49')](_0x11cde7[_0xf708('0x46')],{'$or':_['map'](_0x11cde7['attributes'],function(_0x31793d){var _0x12a6e5={};_0x12a6e5[_0x31793d]={'$like':'%'+_0x56ee44[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x12a6e5;})});}_0x11cde7=_[_0xf708('0x49')]({},_0x11cde7,_0x56ee44[_0xf708('0x4b')]);return _0x18921c[_0xf708('0xb3')](_0x11cde7);}})[_0xf708('0x27')](function(_0x18f3a4){if(_0x18f3a4){_0x38544d=_0x18f3a4[_0xf708('0x5a')];if(!_0x56ee44['query'][_0xf708('0x42')](_0xf708('0x43'))){_0x11cde7[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x56ee44[_0xf708('0x3d')][_0xf708('0x22')]);_0x11cde7[_0xf708('0x20')]=qs['offset'](_0x56ee44[_0xf708('0x3d')][_0xf708('0x20')]);}return _0x18921c[_0xf708('0xb3')](_0x11cde7);}})[_0xf708('0x27')](function(_0x264e49){if(_0x264e49){return _0x264e49?{'count':_0x38544d,'rows':_0x264e49}:null;}})[_0xf708('0x27')](respondWithResult(_0x42fcab,null))[_0xf708('0x51')](handleError(_0x42fcab,null));};exports[_0xf708('0xb4')]=function(_0x138666,_0x71ce65,_0xc3861f){var _0x48f6e1,_0x19d04d;return db[_0xf708('0x3a')]['find']({'where':{'id':_0x138666[_0xf708('0x5f')]['id']}})['then'](handleEntityNotFound(_0x71ce65,null))[_0xf708('0x27')](function(_0x2c37d1){if(_0x2c37d1){_0x19d04d=_0x2c37d1;return _0x2c37d1[_0xf708('0xb4')](_0x138666[_0xf708('0x53')]['ids'],_[_0xf708('0x5b')](_0x138666['body'],['ids','id'])||{});}return null;})['spread'](function(_0x173fd7){var _0x49cb13;_0x48f6e1=_0x173fd7||[];var _0x50b73c=[];if(_0x173fd7){for(var _0x29ff22=0x0;_0x29ff22<_0x173fd7['length'];_0x29ff22+=0x1){var _0x51f48a=_0x173fd7[_0x29ff22][_0xf708('0x29')]({'plain':!![]});_0x49cb13=squel[_0xf708('0xa0')]()[_0xf708('0xa1')](_0xf708('0xb5'))['fromQuery']([_0xf708('0xa4'),'ContactId',_0xf708('0xa8'),_0xf708('0x62'),_0xf708('0x5c'),_0xf708('0x5d')],squel[_0xf708('0x7e')]()['field'](_0xf708('0xa4'),_0xf708('0xa4'))['field']('id',_0xf708('0xa6'))[_0xf708('0x7f')](_0x51f48a['CmListId'][_0xf708('0x8a')](),_0xf708('0xa8'))[_0xf708('0x7f')](_0x138666[_0xf708('0x5f')]['id'][_0xf708('0x8a')](),_0xf708('0x62'))['field'](_0xf708('0xa9'),'createdAt')['field']('NOW()',_0xf708('0x5d'))['from'](_0xf708('0xaa'))[_0xf708('0x46')]('deletedAt\x20IS\x20NULL')[_0xf708('0x46')](_0xf708('0xac'),_0x51f48a[_0xf708('0xa7')][_0xf708('0x8a')]())['where'](_0xf708('0xad')))['toString']();_0x50b73c['push'](db['sequelize'][_0xf708('0x3d')](_0x49cb13));}return BPromise[_0xf708('0x8d')](_0x50b73c);}})[_0xf708('0x27')](function(){return _0x48f6e1;})[_0xf708('0x27')](respondWithResult(_0x71ce65,null))[_0xf708('0x51')](handleError(_0x71ce65,null));};exports[_0xf708('0xb6')]=function(_0x4e9a48,_0x5afd64,_0x39ea28){return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x4e9a48[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x5afd64,null))[_0xf708('0x27')](function(_0x5aa934){if(_0x5aa934){return _0x5aa934[_0xf708('0xb6')](_0x4e9a48[_0xf708('0x3d')]['ids']);}})[_0xf708('0x27')](function(_0x47388b){if(_0x47388b){return db[_0xf708('0x65')][_0xf708('0x28')]({'where':{'ListId':_0x4e9a48[_0xf708('0x3d')]['ids'],'VoiceQueueId':_0x4e9a48['params']['id']}})[_0xf708('0x27')](function(){return _0x47388b;});}})['then'](respondWithStatusCode(_0x5afd64,null))[_0xf708('0x51')](handleError(_0x5afd64,null));};
\ No newline at end of file
index 9e8f7fb..a15084b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff80=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x121f61,_0x5174fc){var _0x393306=function(_0xc9dfde){while(--_0xc9dfde){_0x121f61['push'](_0x121f61['shift']());}};_0x393306(++_0x5174fc);}(_0xff80,0xcb));var _0x0ff8=function(_0xaf0aa4,_0xff7931){_0xaf0aa4=_0xaf0aa4-0x0;var _0x2c13c9=_0xff80[_0xaf0aa4];return _0x2c13c9;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x0ff8('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0ff8('0x1')](0x0);var events={'afterCreate':_0x0ff8('0x2'),'afterUpdate':'update','afterDestroy':_0x0ff8('0x3')};function emitEvent(_0x1995bb){return function(_0x15e740,_0x4a24ef,_0x2897fa){VoiceQueueEvents[_0x0ff8('0x4')](_0x1995bb+':'+_0x15e740['id'],_0x15e740);VoiceQueueEvents['emit'](_0x1995bb,_0x15e740);_0x2897fa(null);};}for(var e in events){if(events[_0x0ff8('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x0ff8('0x6')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xbb7e=['hook','exports','events','../../mysqldb','setMaxListeners','emit','hasOwnProperty'];(function(_0xd661e4,_0x237bf5){var _0x16b961=function(_0x122132){while(--_0x122132){_0xd661e4['push'](_0xd661e4['shift']());}};_0x16b961(++_0x237bf5);}(_0xbb7e,0xc6));var _0xebb7=function(_0x4e682a,_0x53ad1a){_0x4e682a=_0x4e682a-0x0;var _0x24fbbc=_0xbb7e[_0x4e682a];return _0x24fbbc;};'use strict';var EventEmitter=require(_0xebb7('0x0'));var VoiceQueue=require(_0xebb7('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xebb7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f713a){return function(_0x6b8197,_0x87ae6,_0x277b48){VoiceQueueEvents[_0xebb7('0x3')](_0x1f713a+':'+_0x6b8197['id'],_0x6b8197);VoiceQueueEvents['emit'](_0x1f713a,_0x6b8197);_0x277b48(null);};}for(var e in events){if(events[_0xebb7('0x4')](e)){var event=events[e];VoiceQueue[_0xebb7('0x5')](e,emitEvent(event));}}module[_0xebb7('0x6')]=VoiceQueueEvents;
\ No newline at end of file
index 550649b..ead2a2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x5bcaeb,_0x1ab89c){var _0x30ebad=function(_0x2345b0){while(--_0x2345b0){_0x5bcaeb['push'](_0x5bcaeb['shift']());}};_0x30ebad(++_0x1ab89c);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0xa8c257,_0x10d28c){var _0xa9c0d2=function(_0x285229){while(--_0x285229){_0xa8c257['push'](_0xa8c257['shift']());}};_0xa9c0d2(++_0x10d28c);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 64d4ea9..a114b43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x614d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','debug','ShowVoiceQueue','lodash'];(function(_0x4eef56,_0x3ad39b){var _0x349d4a=function(_0x4f264e){while(--_0x4f264e){_0x4eef56['push'](_0x4eef56['shift']());}};_0x349d4a(++_0x3ad39b);}(_0x614d,0x1e0));var _0xd614=function(_0x1297dc,_0x3720b5){_0x1297dc=_0x1297dc-0x0;var _0x4c7a70=_0x614d[_0x1297dc];return _0x4c7a70;};'use strict';var _=require(_0xd614('0x0'));var util=require(_0xd614('0x1'));var moment=require(_0xd614('0x2'));var BPromise=require(_0xd614('0x3'));var rs=require(_0xd614('0x4'));var fs=require('fs');var Redis=require(_0xd614('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd614('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd614('0x7'));var client=jayson[_0xd614('0x8')]['http']({'port':0x232a});config[_0xd614('0x9')]=_[_0xd614('0xa')](config[_0xd614('0x9')],{'host':_0xd614('0xb'),'port':0x18eb});var socket=require(_0xd614('0xc'))(new Redis(config[_0xd614('0x9')]));require(_0xd614('0xd'))['register'](socket);function respondWithRpcPromise(_0x2c0786,_0x11d587,_0x194f11){return new BPromise(function(_0x2dfec1,_0x26b2f2){return client[_0xd614('0xe')](_0x2c0786,_0x194f11)[_0xd614('0xf')](function(_0x1c5e24){logger[_0xd614('0x10')](_0xd614('0x11'),_0x11d587,_0xd614('0x12'));logger['debug'](_0xd614('0x13'),_0x11d587,_0xd614('0x12'),JSON[_0xd614('0x14')](_0x1c5e24));if(_0x1c5e24['error']){if(_0x1c5e24['error']['code']===0x1f4){logger[_0xd614('0x15')](_0xd614('0x11'),_0x11d587,_0x1c5e24[_0xd614('0x15')][_0xd614('0x16')]);return _0x26b2f2(_0x1c5e24[_0xd614('0x15')][_0xd614('0x16')]);}logger['error'](_0xd614('0x11'),_0x11d587,_0x1c5e24[_0xd614('0x15')]['message']);return _0x2dfec1(_0x1c5e24[_0xd614('0x15')][_0xd614('0x16')]);}else{logger[_0xd614('0x10')](_0xd614('0x11'),_0x11d587,'request\x20sent');_0x2dfec1(_0x1c5e24[_0xd614('0x17')][_0xd614('0x16')]);}})[_0xd614('0x18')](function(_0x196f01){logger['error'](_0xd614('0x11'),_0x11d587,_0x196f01);_0x26b2f2(_0x196f01);});});}exports[_0xd614('0x19')]=function(_0x389960){var _0x4b6cd2=this;return new Promise(function(_0x3c320f,_0x1c3aec){return db[_0xd614('0x1a')][_0xd614('0x1b')]({'raw':_0x389960[_0xd614('0x1c')]?_0x389960[_0xd614('0x1c')][_0xd614('0x1d')]===undefined?!![]:![]:!![],'where':_0x389960[_0xd614('0x1c')]?_0x389960['options'][_0xd614('0x1e')]||null:null,'attributes':_0x389960[_0xd614('0x1c')]?_0x389960[_0xd614('0x1c')][_0xd614('0x1f')]||null:null,'limit':_0x389960[_0xd614('0x1c')]?_0x389960['options']['limit']||null:null,'include':_0x389960['options']?_0x389960[_0xd614('0x1c')][_0xd614('0x20')]?_[_0xd614('0x21')](_0x389960['options']['include'],function(_0x47ce7c){return{'model':db[_0x47ce7c[_0xd614('0x22')]],'as':_0x47ce7c['as'],'attributes':_0x47ce7c['attributes'],'include':_0x47ce7c[_0xd614('0x20')]?_[_0xd614('0x21')](_0x47ce7c[_0xd614('0x20')],function(_0x3f00d0){return{'model':db[_0x3f00d0[_0xd614('0x22')]],'as':_0x3f00d0['as'],'attributes':_0x3f00d0[_0xd614('0x1f')],'include':_0x3f00d0[_0xd614('0x20')]?_[_0xd614('0x21')](_0x3f00d0[_0xd614('0x20')],function(_0x4812aa){return{'model':db[_0x4812aa[_0xd614('0x22')]],'as':_0x4812aa['as'],'attributes':_0x4812aa[_0xd614('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd614('0xf')](function(_0x292d52){logger[_0xd614('0x10')]('GetVoiceQueue',_0x389960);logger[_0xd614('0x23')]('GetVoiceQueue',_0x389960,JSON[_0xd614('0x14')](_0x292d52));_0x3c320f(_0x292d52);})[_0xd614('0x18')](function(_0x3c8323){logger[_0xd614('0x15')](_0xd614('0x19'),_0x3c8323[_0xd614('0x16')],_0x389960);_0x1c3aec(_0x4b6cd2['error'](0x1f4,_0x3c8323[_0xd614('0x16')]));});});};exports[_0xd614('0x24')]=function(_0xb3e912){var _0x5aef0a=this;return new Promise(function(_0x109ced,_0x46c250){return db[_0xd614('0x1a')]['find']({'raw':_0xb3e912[_0xd614('0x1c')]?_0xb3e912[_0xd614('0x1c')][_0xd614('0x1d')]===undefined?!![]:![]:!![],'where':_0xb3e912['options']?_0xb3e912['options']['where']||null:null,'attributes':_0xb3e912['options']?_0xb3e912['options'][_0xd614('0x1f')]||null:null,'include':_0xb3e912['options']?_0xb3e912[_0xd614('0x1c')]['include']?_[_0xd614('0x21')](_0xb3e912['options']['include'],function(_0x112a5b){return{'model':db[_0x112a5b['model']],'as':_0x112a5b['as'],'attributes':_0x112a5b[_0xd614('0x1f')],'include':_0x112a5b['include']?_[_0xd614('0x21')](_0x112a5b[_0xd614('0x20')],function(_0x27bcea){return{'model':db[_0x27bcea[_0xd614('0x22')]],'as':_0x27bcea['as'],'attributes':_0x27bcea[_0xd614('0x1f')],'include':_0x27bcea[_0xd614('0x20')]?_['map'](_0x27bcea[_0xd614('0x20')],function(_0x2d2b84){return{'model':db[_0x2d2b84[_0xd614('0x22')]],'as':_0x2d2b84['as'],'attributes':_0x2d2b84[_0xd614('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x305b96){logger[_0xd614('0x10')](_0xd614('0x24'),_0xb3e912);logger['debug'](_0xd614('0x24'),_0xb3e912,JSON[_0xd614('0x14')](_0x305b96));_0x109ced(_0x305b96);})[_0xd614('0x18')](function(_0x16e759){logger[_0xd614('0x15')]('ShowVoiceQueue',_0x16e759['message'],_0xb3e912);_0x46c250(_0x5aef0a[_0xd614('0x15')](0x1f4,_0x16e759[_0xd614('0x16')]));});});};
\ No newline at end of file
+var _0xd7f4=['ShowVoiceQueue','where','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','register','request','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','info','result','catch','GetVoiceQueue','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x12d05f,_0x521393){var _0x5bf7a6=function(_0x526639){while(--_0x526639){_0x12d05f['push'](_0x12d05f['shift']());}};_0x5bf7a6(++_0x521393);}(_0xd7f4,0xb2));var _0x4d7f=function(_0x3ac5f1,_0x1c10e1){_0x3ac5f1=_0x3ac5f1-0x0;var _0x274b87=_0xd7f4[_0x3ac5f1];return _0x274b87;};'use strict';var _=require(_0x4d7f('0x0'));var util=require(_0x4d7f('0x1'));var moment=require(_0x4d7f('0x2'));var BPromise=require(_0x4d7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d7f('0x4'));var logger=require(_0x4d7f('0x5'))(_0x4d7f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4d7f('0x7')]({'port':0x232a});config[_0x4d7f('0x8')]=_[_0x4d7f('0x9')](config[_0x4d7f('0x8')],{'host':_0x4d7f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d7f('0x8')]));require('./voiceQueue.socket')[_0x4d7f('0xb')](socket);function respondWithRpcPromise(_0x5bb01f,_0x39522b,_0x1f9eee){return new BPromise(function(_0x30e921,_0x5520ee){return client[_0x4d7f('0xc')](_0x5bb01f,_0x1f9eee)['then'](function(_0x797e50){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x39522b,_0x4d7f('0xd'));logger[_0x4d7f('0xe')](_0x4d7f('0xf'),_0x39522b,_0x4d7f('0xd'),JSON[_0x4d7f('0x10')](_0x797e50));if(_0x797e50[_0x4d7f('0x11')]){if(_0x797e50[_0x4d7f('0x11')]['code']===0x1f4){logger[_0x4d7f('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x39522b,_0x797e50[_0x4d7f('0x11')]['message']);return _0x5520ee(_0x797e50[_0x4d7f('0x11')][_0x4d7f('0x12')]);}logger[_0x4d7f('0x11')](_0x4d7f('0x13'),_0x39522b,_0x797e50[_0x4d7f('0x11')][_0x4d7f('0x12')]);return _0x30e921(_0x797e50[_0x4d7f('0x11')][_0x4d7f('0x12')]);}else{logger[_0x4d7f('0x14')](_0x4d7f('0x13'),_0x39522b,'request\x20sent');_0x30e921(_0x797e50[_0x4d7f('0x15')][_0x4d7f('0x12')]);}})[_0x4d7f('0x16')](function(_0x1aa230){logger[_0x4d7f('0x11')](_0x4d7f('0x13'),_0x39522b,_0x1aa230);_0x5520ee(_0x1aa230);});});}exports[_0x4d7f('0x17')]=function(_0x4b8ffa){var _0x44288c=this;return new Promise(function(_0x3e8591,_0x18f216){return db['VoiceQueue'][_0x4d7f('0x18')]({'raw':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa[_0x4d7f('0x19')][_0x4d7f('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa[_0x4d7f('0x19')]['where']||null:null,'attributes':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa[_0x4d7f('0x19')][_0x4d7f('0x1b')]||null:null,'limit':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa[_0x4d7f('0x19')][_0x4d7f('0x1c')]||null:null,'include':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa['options'][_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x4b8ffa[_0x4d7f('0x19')]['include'],function(_0x565908){return{'model':db[_0x565908[_0x4d7f('0x1f')]],'as':_0x565908['as'],'attributes':_0x565908[_0x4d7f('0x1b')],'include':_0x565908[_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x565908[_0x4d7f('0x1d')],function(_0x99376c){return{'model':db[_0x99376c[_0x4d7f('0x1f')]],'as':_0x99376c['as'],'attributes':_0x99376c[_0x4d7f('0x1b')],'include':_0x99376c[_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x99376c[_0x4d7f('0x1d')],function(_0x212939){return{'model':db[_0x212939[_0x4d7f('0x1f')]],'as':_0x212939['as'],'attributes':_0x212939['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x218b53){logger[_0x4d7f('0x14')]('GetVoiceQueue',_0x4b8ffa);logger[_0x4d7f('0xe')]('GetVoiceQueue',_0x4b8ffa,JSON[_0x4d7f('0x10')](_0x218b53));_0x3e8591(_0x218b53);})['catch'](function(_0x59b74c){logger['error']('GetVoiceQueue',_0x59b74c[_0x4d7f('0x12')],_0x4b8ffa);_0x18f216(_0x44288c[_0x4d7f('0x11')](0x1f4,_0x59b74c[_0x4d7f('0x12')]));});});};exports[_0x4d7f('0x20')]=function(_0x3c49da){var _0x2f605b=this;return new Promise(function(_0x1eeac2,_0x4d5c23){return db['VoiceQueue']['find']({'raw':_0x3c49da[_0x4d7f('0x19')]?_0x3c49da[_0x4d7f('0x19')][_0x4d7f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c49da[_0x4d7f('0x19')]?_0x3c49da['options'][_0x4d7f('0x21')]||null:null,'attributes':_0x3c49da['options']?_0x3c49da['options'][_0x4d7f('0x1b')]||null:null,'include':_0x3c49da[_0x4d7f('0x19')]?_0x3c49da[_0x4d7f('0x19')][_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x3c49da[_0x4d7f('0x19')][_0x4d7f('0x1d')],function(_0x3a0d53){return{'model':db[_0x3a0d53[_0x4d7f('0x1f')]],'as':_0x3a0d53['as'],'attributes':_0x3a0d53[_0x4d7f('0x1b')],'include':_0x3a0d53[_0x4d7f('0x1d')]?_['map'](_0x3a0d53[_0x4d7f('0x1d')],function(_0x565242){return{'model':db[_0x565242[_0x4d7f('0x1f')]],'as':_0x565242['as'],'attributes':_0x565242['attributes'],'include':_0x565242[_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x565242[_0x4d7f('0x1d')],function(_0x376bd0){return{'model':db[_0x376bd0['model']],'as':_0x376bd0['as'],'attributes':_0x376bd0['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d7f('0x22')](function(_0x491082){logger[_0x4d7f('0x14')](_0x4d7f('0x20'),_0x3c49da);logger[_0x4d7f('0xe')]('ShowVoiceQueue',_0x3c49da,JSON[_0x4d7f('0x10')](_0x491082));_0x1eeac2(_0x491082);})[_0x4d7f('0x16')](function(_0x4ae94b){logger[_0x4d7f('0x11')]('ShowVoiceQueue',_0x4ae94b[_0x4d7f('0x12')],_0x3c49da);_0x4d5c23(_0x2f605b[_0x4d7f('0x11')](0x1f4,_0x4ae94b['message']));});});};
\ No newline at end of file
index cf5bdcf..694fdef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f0a=['update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f0a,0xc3));var _0xa7f0=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7f0a[_0x3ff085];return _0x2b68c3;};'use strict';var VoiceQueueEvents=require(_0xa7f0('0x0'));var events=['save','remove',_0xa7f0('0x1')];function createListener(_0x59441f,_0x19addd){return function(_0x476068){_0x19addd[_0xa7f0('0x2')](_0x59441f,_0x476068);};}function removeListener(_0x272929,_0x1574af){return function(){VoiceQueueEvents[_0xa7f0('0x3')](_0x272929,_0x1574af);};}exports[_0xa7f0('0x4')]=function(_0x1e037f){for(var _0x509075=0x0,_0x2bd5aa=events[_0xa7f0('0x5')];_0x509075<_0x2bd5aa;_0x509075++){var _0x10ae3f=events[_0x509075];var _0x5c514d=createListener(_0xa7f0('0x6')+_0x10ae3f,_0x1e037f);VoiceQueueEvents['on'](_0x10ae3f,_0x5c514d);}};
\ No newline at end of file
+var _0xeee3=['save','remove','update','register','voiceQueue:','./voiceQueue.events'];(function(_0x472042,_0x27ac38){var _0x3c79e0=function(_0x11300b){while(--_0x11300b){_0x472042['push'](_0x472042['shift']());}};_0x3c79e0(++_0x27ac38);}(_0xeee3,0x161));var _0x3eee=function(_0x488081,_0x5659d1){_0x488081=_0x488081-0x0;var _0x3fc040=_0xeee3[_0x488081];return _0x3fc040;};'use strict';var VoiceQueueEvents=require(_0x3eee('0x0'));var events=[_0x3eee('0x1'),_0x3eee('0x2'),_0x3eee('0x3')];function createListener(_0x3d614c,_0xe73645){return function(_0x575bb9){_0xe73645['emit'](_0x3d614c,_0x575bb9);};}function removeListener(_0x6861c3,_0x180cbe){return function(){VoiceQueueEvents['removeListener'](_0x6861c3,_0x180cbe);};}exports[_0x3eee('0x4')]=function(_0x80b52f){for(var _0x34aecd=0x0,_0x2d87f9=events['length'];_0x34aecd<_0x2d87f9;_0x34aecd++){var _0x27e5d1=events[_0x34aecd];var _0x12bbda=createListener(_0x3eee('0x5')+_0x27e5d1,_0x80b52f);VoiceQueueEvents['on'](_0x27e5d1,_0x12bbda);}};
\ No newline at end of file
index ce13e60..8edcb14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aa2=['isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3aa2,0xac));var _0x23aa=function(_0x1bc42d,_0x1b8a92){_0x1bc42d=_0x1bc42d-0x0;var _0x2a4351=_0x3aa2[_0x1bc42d];return _0x2a4351;};'use strict';var multer=require('multer');var util=require(_0x23aa('0x0'));var path=require(_0x23aa('0x1'));var timeout=require('connect-timeout');var express=require(_0x23aa('0x2'));var router=express[_0x23aa('0x3')]();var fs_extra=require(_0x23aa('0x4'));var auth=require(_0x23aa('0x5'));var interaction=require(_0x23aa('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x23aa('0x7')]('/',auth[_0x23aa('0x8')](),controller[_0x23aa('0x9')]);router[_0x23aa('0x7')](_0x23aa('0xa'),auth[_0x23aa('0x8')](),controller[_0x23aa('0xb')]);router[_0x23aa('0x7')](_0x23aa('0xc'),auth['isAuthenticated'](),controller[_0x23aa('0xd')]);router[_0x23aa('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x23aa('0xe')]);router[_0x23aa('0xf')]('/',auth['isAuthenticated'](),controller[_0x23aa('0x10')]);router[_0x23aa('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x23aa('0x12')]);router['delete']('/:id',auth[_0x23aa('0x8')](),controller[_0x23aa('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xf255=['getVoiceQueuesReport','/:id','post','create','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index'];(function(_0x1d05a3,_0x125a86){var _0x48d934=function(_0x44f447){while(--_0x44f447){_0x1d05a3['push'](_0x1d05a3['shift']());}};_0x48d934(++_0x125a86);}(_0xf255,0xfb));var _0x5f25=function(_0x903ca9,_0x2fbc2a){_0x903ca9=_0x903ca9-0x0;var _0x370719=_0xf255[_0x903ca9];return _0x370719;};'use strict';var multer=require(_0x5f25('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f25('0x1')]();var fs_extra=require(_0x5f25('0x2'));var auth=require(_0x5f25('0x3'));var interaction=require(_0x5f25('0x4'));var config=require(_0x5f25('0x5'));var controller=require(_0x5f25('0x6'));router[_0x5f25('0x7')]('/',auth[_0x5f25('0x8')](),controller[_0x5f25('0x9')]);router['get'](_0x5f25('0xa'),auth[_0x5f25('0x8')](),controller[_0x5f25('0xb')]);router[_0x5f25('0x7')](_0x5f25('0xc'),auth['isAuthenticated'](),controller[_0x5f25('0xd')]);router[_0x5f25('0x7')](_0x5f25('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x5f25('0xf')]('/',auth[_0x5f25('0x8')](),controller[_0x5f25('0x10')]);router[_0x5f25('0x11')](_0x5f25('0xe'),auth[_0x5f25('0x8')](),controller[_0x5f25('0x12')]);router[_0x5f25('0x13')](_0x5f25('0xe'),auth['isAuthenticated'](),controller[_0x5f25('0x14')]);module[_0x5f25('0x15')]=router;
\ No newline at end of file
index 4786cbb..fa4c909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7016=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment'];(function(_0x87823d,_0x312f8d){var _0x462647=function(_0x381017){while(--_0x381017){_0x87823d['push'](_0x87823d['shift']());}};_0x462647(++_0x312f8d);}(_0x7016,0x8f));var _0x6701=function(_0x4eabe7,_0x56cac2){_0x4eabe7=_0x4eabe7-0x0;var _0x4ea291=_0x7016[_0x4eabe7];return _0x4ea291;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6701('0x0'));module[_0x6701('0x1')]={'type':{'type':Sequelize[_0x6701('0x2')]},'uniqueid':{'type':Sequelize[_0x6701('0x2')]},'calleridnum':{'type':Sequelize[_0x6701('0x2')]},'calleridname':{'type':Sequelize[_0x6701('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x6701('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x6701('0x3')],'set':function(_0xb90bb4){var _0x573783=moment(_0xb90bb4);var _0x5c7328=moment(this[_0x6701('0x4')](_0x6701('0x5')))[_0x6701('0x6')](_0x6701('0x7'));var _0x36875f=_0x573783[_0x6701('0x8')](_0x5c7328,_0x6701('0x9'));this[_0x6701('0xa')](_0x6701('0xb'),_0xb90bb4);this[_0x6701('0xa')](_0x6701('0xc'),_0x36875f||null);}},'position':{'type':Sequelize[_0x6701('0xd')]},'count':{'type':Sequelize[_0x6701('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x6701('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6701('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x6701('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6701('0x3')]},'queuecallerexit':{'type':Sequelize[_0x6701('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x6701('0x2')],'comment':_0x6701('0xf')},'originalposition':{'type':Sequelize[_0x6701('0xd')]},'channel':{'type':Sequelize[_0x6701('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6701('0x2')]},'connectedlinename':{'type':Sequelize[_0x6701('0x2')]},'accountcode':{'type':Sequelize[_0x6701('0x2')]},'context':{'type':Sequelize[_0x6701('0x2')]},'exten':{'type':Sequelize[_0x6701('0x2')]},'priority':{'type':Sequelize[_0x6701('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6701('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6701('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x6701('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x6701('0x2')]},'disposition':{'type':Sequelize[_0x6701('0x2')]},'secondDisposition':{'type':Sequelize[_0x6701('0x2')]},'thirdDisposition':{'type':Sequelize[_0x6701('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x20ed=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','holdtime','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20ed,0x161));var _0xd20e=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x20ed[_0x39e84d];return _0x1991bc;};'use strict';var Sequelize=require(_0xd20e('0x0'));var moment=require('moment');module[_0xd20e('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd20e('0x2')]},'calleridnum':{'type':Sequelize[_0xd20e('0x2')]},'calleridname':{'type':Sequelize[_0xd20e('0x2')]},'queue':{'type':Sequelize[_0xd20e('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xd20e('0x3')],'set':function(_0x58a9d8){var _0x386ddc=moment(_0x58a9d8);var _0x4347ea=moment(this[_0xd20e('0x4')]('queuecallerjoinAt'))['format'](_0xd20e('0x5'));var _0x36a52c=_0x386ddc[_0xd20e('0x6')](_0x4347ea,_0xd20e('0x7'));this['setDataValue']('queuecallerleaveAt',_0x58a9d8);this['setDataValue'](_0xd20e('0x8'),_0x36a52c||null);}},'position':{'type':Sequelize[_0xd20e('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xd20e('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xd20e('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd20e('0x3')]},'queuecallerexit':{'type':Sequelize[_0xd20e('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xd20e('0xb')},'originalposition':{'type':Sequelize[_0xd20e('0x9')]},'channel':{'type':Sequelize[_0xd20e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd20e('0x2')]},'accountcode':{'type':Sequelize[_0xd20e('0x2')]},'context':{'type':Sequelize[_0xd20e('0x2')]},'exten':{'type':Sequelize[_0xd20e('0x2')]},'priority':{'type':Sequelize[_0xd20e('0x2')]},'holdtime':{'type':Sequelize[_0xd20e('0x9')]},'mohtime':{'type':Sequelize[_0xd20e('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd20e('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd20e('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd20e('0x2')],'comment':_0xd20e('0xc')},'transferexten':{'type':Sequelize[_0xd20e('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd20e('0x2')]},'disposition':{'type':Sequelize[_0xd20e('0x2')]},'secondDisposition':{'type':Sequelize[_0xd20e('0x2')]},'thirdDisposition':{'type':Sequelize[_0xd20e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xd20e('0x9')],'defaultValue':0x0}};
\ No newline at end of file
index 83ba2da..3973a18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe867=['reject','update','then','end','error','stack','name','send','index','map','VoiceQueueReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','create','body','find','destroy','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply'];(function(_0x2e9280,_0x44d032){var _0x17f9e5=function(_0x4c915){while(--_0x4c915){_0x2e9280['push'](_0x2e9280['shift']());}};_0x17f9e5(++_0x44d032);}(_0xe867,0x82));var _0x7e86=function(_0x37fc53,_0x1d6f0c){_0x37fc53=_0x37fc53-0x0;var _0x2a1401=_0xe867[_0x37fc53];return _0x2a1401;};'use strict';var emlformat=require(_0x7e86('0x0'));var rimraf=require(_0x7e86('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e86('0x2'));var rp=require(_0x7e86('0x3'));var moment=require('moment');var BPromise=require(_0x7e86('0x4'));var Mustache=require(_0x7e86('0x5'));var util=require(_0x7e86('0x6'));var path=require(_0x7e86('0x7'));var sox=require(_0x7e86('0x8'));var csv=require(_0x7e86('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e86('0xa'));var _=require(_0x7e86('0xb'));var squel=require(_0x7e86('0xc'));var crypto=require('crypto');var jsforce=require(_0x7e86('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7e86('0x9'));var querystring=require(_0x7e86('0xe'));var Papa=require(_0x7e86('0xf'));var Redis=require(_0x7e86('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7e86('0x11'));var as=require(_0x7e86('0x12'));var hardwareService=require(_0x7e86('0x13'));var logger=require(_0x7e86('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7e86('0x15'));var licenseUtil=require(_0x7e86('0x16'));var db=require(_0x7e86('0x17'))['db'];config['redis']=_['defaults'](config[_0x7e86('0x18')],{'host':_0x7e86('0x19'),'port':0x18eb});var socket=require(_0x7e86('0x1a'))(new Redis(config[_0x7e86('0x18')]));require(_0x7e86('0x1b'))['register'](socket);function respondWithStatusCode(_0x4253bb,_0x2cafc6){_0x2cafc6=_0x2cafc6||0xcc;return function(_0x513c6a){if(_0x513c6a){return _0x4253bb[_0x7e86('0x1c')](_0x2cafc6);}return _0x4253bb[_0x7e86('0x1d')](_0x2cafc6)['end']();};}function respondWithResult(_0x330142,_0xace71c){_0xace71c=_0xace71c||0xc8;return function(_0x3dc6b0){if(_0x3dc6b0){return _0x330142[_0x7e86('0x1d')](_0xace71c)['json'](_0x3dc6b0);}};}function respondWithFilteredResult(_0x2d1aca,_0x1a7f48){return function(_0x50b623){if(_0x50b623){var _0x3aa799=typeof _0x1a7f48[_0x7e86('0x1e')]===_0x7e86('0x1f')&&typeof _0x1a7f48['limit']===_0x7e86('0x1f');var _0xd09379=_0x50b623[_0x7e86('0x20')];var _0x193eb0=_0x3aa799?0x0:_0x1a7f48[_0x7e86('0x1e')];var _0x34d19b=_0x3aa799?_0x50b623['count']:_0x1a7f48[_0x7e86('0x1e')]+_0x1a7f48[_0x7e86('0x21')];var _0x7e6471;if(_0x34d19b>=_0xd09379){_0x34d19b=_0xd09379;_0x7e6471=0xc8;}else{_0x7e6471=0xce;}_0x2d1aca[_0x7e86('0x1d')](_0x7e6471);return _0x2d1aca[_0x7e86('0x22')](_0x7e86('0x23'),_0x193eb0+'-'+_0x34d19b+'/'+_0xd09379)[_0x7e86('0x24')](_0x50b623);}return null;};}function patchUpdates(_0x270ce6){return function(_0x5200b2){try{jsonpatch[_0x7e86('0x25')](_0x5200b2,_0x270ce6,!![]);}catch(_0x497b94){return BPromise[_0x7e86('0x26')](_0x497b94);}return _0x5200b2['save']();};}function saveUpdates(_0x302820,_0x3f9bff){return function(_0x1b7b6b){if(_0x1b7b6b){return _0x1b7b6b[_0x7e86('0x27')](_0x302820)[_0x7e86('0x28')](function(_0x152934){return _0x152934;});}return null;};}function removeEntity(_0x1c59b9,_0x340ad3){return function(_0x1edd9d){if(_0x1edd9d){return _0x1edd9d['destroy']()[_0x7e86('0x28')](function(){_0x1c59b9[_0x7e86('0x1d')](0xcc)[_0x7e86('0x29')]();});}};}function handleEntityNotFound(_0x669929,_0x40a0d0){return function(_0x48f95a){if(!_0x48f95a){_0x669929['sendStatus'](0x194);}return _0x48f95a;};}function handleError(_0x36c1fc,_0x3f1f16){_0x3f1f16=_0x3f1f16||0x1f4;return function(_0x30242b){logger[_0x7e86('0x2a')](_0x30242b[_0x7e86('0x2b')]);if(_0x30242b[_0x7e86('0x2c')]){delete _0x30242b['name'];}_0x36c1fc[_0x7e86('0x1d')](_0x3f1f16)[_0x7e86('0x2d')](_0x30242b);};}exports[_0x7e86('0x2e')]=function(_0x4ab570,_0xebbdb1){var _0x7640dd={},_0x3f48be={},_0x35132a={'count':0x0,'rows':[]};var _0x23fff5=_[_0x7e86('0x2f')](db[_0x7e86('0x30')]['rawAttributes'],function(_0x4d9ce1){return{'name':_0x4d9ce1[_0x7e86('0x31')],'type':_0x4d9ce1[_0x7e86('0x32')][_0x7e86('0x33')]};});_0x3f48be['model']=_[_0x7e86('0x2f')](_0x23fff5,'name');_0x3f48be[_0x7e86('0x34')]=_[_0x7e86('0x35')](_0x4ab570[_0x7e86('0x34')]);_0x3f48be[_0x7e86('0x36')]=_[_0x7e86('0x37')](_0x3f48be['model'],_0x3f48be[_0x7e86('0x34')]);_0x7640dd[_0x7e86('0x38')]=_[_0x7e86('0x37')](_0x3f48be[_0x7e86('0x39')],qs['fields'](_0x4ab570['query']['fields']));_0x7640dd[_0x7e86('0x38')]=_0x7640dd[_0x7e86('0x38')][_0x7e86('0x3a')]?_0x7640dd['attributes']:_0x3f48be[_0x7e86('0x39')];if(!_0x4ab570[_0x7e86('0x34')][_0x7e86('0x3b')](_0x7e86('0x3c'))){_0x7640dd[_0x7e86('0x21')]=qs['limit'](_0x4ab570[_0x7e86('0x34')][_0x7e86('0x21')]);_0x7640dd[_0x7e86('0x1e')]=qs['offset'](_0x4ab570[_0x7e86('0x34')][_0x7e86('0x1e')]);}_0x7640dd[_0x7e86('0x3d')]=qs[_0x7e86('0x3e')](_0x4ab570[_0x7e86('0x34')][_0x7e86('0x3e')]);_0x7640dd[_0x7e86('0x3f')]=qs['filters'](_[_0x7e86('0x40')](_0x4ab570[_0x7e86('0x34')],_0x3f48be[_0x7e86('0x36')]),_0x23fff5);if(_0x4ab570[_0x7e86('0x34')][_0x7e86('0x41')]){_0x7640dd[_0x7e86('0x3f')]=_[_0x7e86('0x42')](_0x7640dd[_0x7e86('0x3f')],{'$or':_[_0x7e86('0x2f')](_0x23fff5,function(_0x197814){if(_0x197814[_0x7e86('0x32')]!==_0x7e86('0x43')){var _0x384ee7={};_0x384ee7[_0x197814[_0x7e86('0x2c')]]={'$like':'%'+_0x4ab570[_0x7e86('0x34')][_0x7e86('0x41')]+'%'};return _0x384ee7;}})});}_0x7640dd=_[_0x7e86('0x42')]({},_0x7640dd,_0x4ab570[_0x7e86('0x44')]);var _0x4d159e={'where':_0x7640dd[_0x7e86('0x3f')]};return db[_0x7e86('0x30')][_0x7e86('0x20')](_0x4d159e)[_0x7e86('0x28')](function(_0x447e4a){_0x35132a[_0x7e86('0x20')]=_0x447e4a;if(_0x4ab570[_0x7e86('0x34')][_0x7e86('0x45')]){_0x7640dd[_0x7e86('0x46')]=[{'all':!![]}];}return db[_0x7e86('0x30')][_0x7e86('0x47')](_0x7640dd);})[_0x7e86('0x28')](function(_0xac2a54){_0x35132a[_0x7e86('0x48')]=_0xac2a54;return _0x35132a;})['then'](respondWithFilteredResult(_0xebbdb1,_0x7640dd))[_0x7e86('0x49')](handleError(_0xebbdb1,null));};exports[_0x7e86('0x4a')]=function(_0x348f48,_0x4b76e3){var _0x1f974={'raw':![],'where':{'id':_0x348f48[_0x7e86('0x4b')]['id']}},_0x48fdda={};_0x48fdda[_0x7e86('0x39')]=_[_0x7e86('0x35')](db[_0x7e86('0x30')][_0x7e86('0x4c')]);_0x48fdda['query']=_[_0x7e86('0x35')](_0x348f48['query']);_0x48fdda[_0x7e86('0x36')]=_['intersection'](_0x48fdda[_0x7e86('0x39')],_0x48fdda[_0x7e86('0x34')]);_0x1f974[_0x7e86('0x38')]=_['intersection'](_0x48fdda[_0x7e86('0x39')],qs[_0x7e86('0x4d')](_0x348f48['query'][_0x7e86('0x4d')]));_0x1f974[_0x7e86('0x38')]=_0x1f974[_0x7e86('0x38')][_0x7e86('0x3a')]?_0x1f974[_0x7e86('0x38')]:_0x48fdda[_0x7e86('0x39')];if(_0x348f48[_0x7e86('0x34')][_0x7e86('0x45')]){_0x1f974[_0x7e86('0x46')]=[{'all':!![]}];}_0x1f974=_[_0x7e86('0x42')]({},_0x1f974,_0x348f48[_0x7e86('0x44')]);return db['VoiceQueueReport']['find'](_0x1f974)[_0x7e86('0x28')](handleEntityNotFound(_0x4b76e3,null))[_0x7e86('0x28')](respondWithResult(_0x4b76e3,null))[_0x7e86('0x49')](handleError(_0x4b76e3,null));};exports[_0x7e86('0x4e')]=function(_0x2d9b4f,_0x151838){return db[_0x7e86('0x30')][_0x7e86('0x4e')](_0x2d9b4f[_0x7e86('0x4f')],{})[_0x7e86('0x28')](respondWithResult(_0x151838,0xc9))['catch'](handleError(_0x151838,null));};exports[_0x7e86('0x27')]=function(_0x3179ec,_0x238d39){if(_0x3179ec['body']['id']){delete _0x3179ec[_0x7e86('0x4f')]['id'];}return db['VoiceQueueReport'][_0x7e86('0x50')]({'where':{'id':_0x3179ec[_0x7e86('0x4b')]['id']}})[_0x7e86('0x28')](handleEntityNotFound(_0x238d39,null))['then'](saveUpdates(_0x3179ec[_0x7e86('0x4f')],null))[_0x7e86('0x28')](respondWithResult(_0x238d39,null))[_0x7e86('0x49')](handleError(_0x238d39,null));};exports[_0x7e86('0x51')]=function(_0x13845a,_0x4d167f){return db[_0x7e86('0x30')][_0x7e86('0x50')]({'where':{'id':_0x13845a['params']['id']}})[_0x7e86('0x28')](handleEntityNotFound(_0x4d167f,null))[_0x7e86('0x28')](removeEntity(_0x4d167f,null))[_0x7e86('0x49')](handleError(_0x4d167f,null));};exports[_0x7e86('0x52')]=function(_0x4e5d4d,_0x51acfe){return db['VoiceQueueReport'][_0x7e86('0x52')]()[_0x7e86('0x28')](respondWithResult(_0x51acfe,null))[_0x7e86('0x49')](handleError(_0x51acfe,null));};exports[_0x7e86('0x53')]=function(_0x4166da,_0x458b97){var _0x2dd649={},_0x4def87={},_0x4f6543={'count':0x0,'rows':[]};_0x4def87[_0x7e86('0x39')]=_[_0x7e86('0x35')](db[_0x7e86('0x30')][_0x7e86('0x4c')]);_0x4def87[_0x7e86('0x34')]=_[_0x7e86('0x35')](_0x4166da[_0x7e86('0x34')]);_0x4def87[_0x7e86('0x36')]=_[_0x7e86('0x37')](_0x4def87[_0x7e86('0x39')],_0x4def87[_0x7e86('0x34')]);_0x2dd649[_0x7e86('0x38')]=_[_0x7e86('0x37')](_0x4def87[_0x7e86('0x39')],qs['fields'](_0x4166da[_0x7e86('0x34')]['fields']));_0x2dd649[_0x7e86('0x38')]=_0x2dd649[_0x7e86('0x38')][_0x7e86('0x3a')]?_0x2dd649[_0x7e86('0x38')]:_0x4def87[_0x7e86('0x39')];if(!_0x4166da['query'][_0x7e86('0x3b')](_0x7e86('0x3c'))){_0x2dd649['limit']=qs['limit'](_0x4166da[_0x7e86('0x34')][_0x7e86('0x21')]);_0x2dd649[_0x7e86('0x1e')]=qs[_0x7e86('0x1e')](_0x4166da['query'][_0x7e86('0x1e')]);}_0x2dd649[_0x7e86('0x3d')]=qs[_0x7e86('0x3e')](_0x4166da[_0x7e86('0x34')][_0x7e86('0x3e')]);_0x2dd649[_0x7e86('0x3f')]=qs[_0x7e86('0x36')](_[_0x7e86('0x40')](_0x4166da[_0x7e86('0x34')],_0x4def87['filters']));if(_0x4166da[_0x7e86('0x34')]['filter']){_0x2dd649['where']=_[_0x7e86('0x42')](_0x2dd649[_0x7e86('0x3f')],{'$or':_['map'](_0x2dd649[_0x7e86('0x38')],function(_0x58e297){var _0x247fa7={};_0x247fa7[_0x58e297]={'$like':'%'+_0x4166da['query'][_0x7e86('0x41')]+'%'};return _0x247fa7;})});}_0x2dd649=_[_0x7e86('0x42')]({},_0x2dd649,_0x4166da[_0x7e86('0x44')]);var _0x235082={'where':_0x2dd649[_0x7e86('0x3f')]};return db[_0x7e86('0x30')]['count'](_0x235082)['then'](function(_0x257b8e){_0x4f6543[_0x7e86('0x20')]=_0x257b8e;if(_0x4166da[_0x7e86('0x34')][_0x7e86('0x45')]){_0x2dd649['include']=[{'all':!![]}];}return db[_0x7e86('0x30')][_0x7e86('0x47')](_0x2dd649);})[_0x7e86('0x28')](function(_0x3283e6){_0x4f6543[_0x7e86('0x48')]=_0x3283e6;return _0x4f6543;})[_0x7e86('0x28')](respondWithFilteredResult(_0x458b97,_0x2dd649,_0x7e86('0x53')))[_0x7e86('0x49')](handleError(_0x458b97,null,_0x7e86('0x53')));};
\ No newline at end of file
+var _0x9376=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','count','include','rows','catch','keys','intersection','includeAll','find','create','body','params','describe','getVoiceQueuesReport','order','merge','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0x9376,0x197));var _0x6937=function(_0x104aa7,_0x316bfa){_0x104aa7=_0x104aa7-0x0;var _0x1af707=_0x9376[_0x104aa7];return _0x1af707;};'use strict';var emlformat=require(_0x6937('0x0'));var rimraf=require(_0x6937('0x1'));var zipdir=require(_0x6937('0x2'));var jsonpatch=require(_0x6937('0x3'));var rp=require(_0x6937('0x4'));var moment=require(_0x6937('0x5'));var BPromise=require(_0x6937('0x6'));var Mustache=require(_0x6937('0x7'));var util=require(_0x6937('0x8'));var path=require('path');var sox=require(_0x6937('0x9'));var csv=require(_0x6937('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6937('0xb'));var _=require(_0x6937('0xc'));var squel=require(_0x6937('0xd'));var crypto=require(_0x6937('0xe'));var jsforce=require(_0x6937('0xf'));var deskjs=require(_0x6937('0x10'));var toCsv=require(_0x6937('0xa'));var querystring=require('querystring');var Papa=require(_0x6937('0x11'));var Redis=require(_0x6937('0x12'));var authService=require(_0x6937('0x13'));var qs=require(_0x6937('0x14'));var as=require(_0x6937('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6937('0x16'))(_0x6937('0x17'));var utils=require('../../config/utils');var config=require(_0x6937('0x18'));var licenseUtil=require(_0x6937('0x19'));var db=require('../../mysqldb')['db'];config[_0x6937('0x1a')]=_['defaults'](config[_0x6937('0x1a')],{'host':_0x6937('0x1b'),'port':0x18eb});var socket=require(_0x6937('0x1c'))(new Redis(config[_0x6937('0x1a')]));require(_0x6937('0x1d'))[_0x6937('0x1e')](socket);function respondWithStatusCode(_0x5788ca,_0x813ccc){_0x813ccc=_0x813ccc||0xcc;return function(_0x814aa7){if(_0x814aa7){return _0x5788ca[_0x6937('0x1f')](_0x813ccc);}return _0x5788ca[_0x6937('0x20')](_0x813ccc)['end']();};}function respondWithResult(_0x1201f5,_0x6d6582){_0x6d6582=_0x6d6582||0xc8;return function(_0x2debc8){if(_0x2debc8){return _0x1201f5[_0x6937('0x20')](_0x6d6582)['json'](_0x2debc8);}};}function respondWithFilteredResult(_0x232d6e,_0x46f814){return function(_0x1ce1d2){if(_0x1ce1d2){var _0x179b41=typeof _0x46f814[_0x6937('0x21')]===_0x6937('0x22')&&typeof _0x46f814['limit']===_0x6937('0x22');var _0x2eb40a=_0x1ce1d2['count'];var _0x2a2d44=_0x179b41?0x0:_0x46f814[_0x6937('0x21')];var _0x1970b2=_0x179b41?_0x1ce1d2['count']:_0x46f814[_0x6937('0x21')]+_0x46f814[_0x6937('0x23')];var _0x11a7d2;if(_0x1970b2>=_0x2eb40a){_0x1970b2=_0x2eb40a;_0x11a7d2=0xc8;}else{_0x11a7d2=0xce;}_0x232d6e[_0x6937('0x20')](_0x11a7d2);return _0x232d6e[_0x6937('0x24')](_0x6937('0x25'),_0x2a2d44+'-'+_0x1970b2+'/'+_0x2eb40a)[_0x6937('0x26')](_0x1ce1d2);}return null;};}function patchUpdates(_0x522f7d){return function(_0x4e58c4){try{jsonpatch[_0x6937('0x27')](_0x4e58c4,_0x522f7d,!![]);}catch(_0x105020){return BPromise[_0x6937('0x28')](_0x105020);}return _0x4e58c4[_0x6937('0x29')]();};}function saveUpdates(_0x170f7b,_0x1597ee){return function(_0x4dca2e){if(_0x4dca2e){return _0x4dca2e[_0x6937('0x2a')](_0x170f7b)[_0x6937('0x2b')](function(_0x2ebd4a){return _0x2ebd4a;});}return null;};}function removeEntity(_0x1d7d14,_0x55acd1){return function(_0xe8ace9){if(_0xe8ace9){return _0xe8ace9[_0x6937('0x2c')]()[_0x6937('0x2b')](function(){_0x1d7d14[_0x6937('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e912,_0x418256){return function(_0x59b88){if(!_0x59b88){_0x28e912['sendStatus'](0x194);}return _0x59b88;};}function handleError(_0x5de95e,_0x59226a){_0x59226a=_0x59226a||0x1f4;return function(_0x261f68){logger[_0x6937('0x2d')](_0x261f68['stack']);if(_0x261f68['name']){delete _0x261f68[_0x6937('0x2e')];}_0x5de95e[_0x6937('0x20')](_0x59226a)[_0x6937('0x2f')](_0x261f68);};}exports[_0x6937('0x30')]=function(_0x367557,_0x48d262){var _0x582ff3={},_0x1f8aff={},_0x694901={'count':0x0,'rows':[]};var _0x555ff4=_[_0x6937('0x31')](db[_0x6937('0x32')][_0x6937('0x33')],function(_0x33fbed){return{'name':_0x33fbed['fieldName'],'type':_0x33fbed[_0x6937('0x34')][_0x6937('0x35')]};});_0x1f8aff[_0x6937('0x36')]=_[_0x6937('0x31')](_0x555ff4,'name');_0x1f8aff[_0x6937('0x37')]=_['keys'](_0x367557[_0x6937('0x37')]);_0x1f8aff[_0x6937('0x38')]=_['intersection'](_0x1f8aff['model'],_0x1f8aff[_0x6937('0x37')]);_0x582ff3[_0x6937('0x39')]=_['intersection'](_0x1f8aff[_0x6937('0x36')],qs[_0x6937('0x3a')](_0x367557[_0x6937('0x37')][_0x6937('0x3a')]));_0x582ff3['attributes']=_0x582ff3['attributes'][_0x6937('0x3b')]?_0x582ff3[_0x6937('0x39')]:_0x1f8aff['model'];if(!_0x367557[_0x6937('0x37')][_0x6937('0x3c')](_0x6937('0x3d'))){_0x582ff3[_0x6937('0x23')]=qs['limit'](_0x367557['query'][_0x6937('0x23')]);_0x582ff3['offset']=qs[_0x6937('0x21')](_0x367557['query'][_0x6937('0x21')]);}_0x582ff3['order']=qs[_0x6937('0x3e')](_0x367557['query'][_0x6937('0x3e')]);_0x582ff3['where']=qs['filters'](_[_0x6937('0x3f')](_0x367557['query'],_0x1f8aff[_0x6937('0x38')]),_0x555ff4);if(_0x367557[_0x6937('0x37')][_0x6937('0x40')]){_0x582ff3[_0x6937('0x41')]=_['merge'](_0x582ff3[_0x6937('0x41')],{'$or':_[_0x6937('0x31')](_0x555ff4,function(_0x3f4312){if(_0x3f4312[_0x6937('0x34')]!==_0x6937('0x42')){var _0x31019d={};_0x31019d[_0x3f4312['name']]={'$like':'%'+_0x367557[_0x6937('0x37')]['filter']+'%'};return _0x31019d;}})});}_0x582ff3=_['merge']({},_0x582ff3,_0x367557[_0x6937('0x43')]);var _0x593cac={'where':_0x582ff3[_0x6937('0x41')]};return db[_0x6937('0x32')][_0x6937('0x44')](_0x593cac)[_0x6937('0x2b')](function(_0x3bfd59){_0x694901['count']=_0x3bfd59;if(_0x367557['query']['includeAll']){_0x582ff3[_0x6937('0x45')]=[{'all':!![]}];}return db[_0x6937('0x32')]['findAll'](_0x582ff3);})['then'](function(_0x46ee75){_0x694901[_0x6937('0x46')]=_0x46ee75;return _0x694901;})['then'](respondWithFilteredResult(_0x48d262,_0x582ff3))[_0x6937('0x47')](handleError(_0x48d262,null));};exports['show']=function(_0x5e40a6,_0x488b8f){var _0x34a414={'raw':![],'where':{'id':_0x5e40a6['params']['id']}},_0x44fbc9={};_0x44fbc9[_0x6937('0x36')]=_[_0x6937('0x48')](db['VoiceQueueReport'][_0x6937('0x33')]);_0x44fbc9[_0x6937('0x37')]=_[_0x6937('0x48')](_0x5e40a6[_0x6937('0x37')]);_0x44fbc9[_0x6937('0x38')]=_[_0x6937('0x49')](_0x44fbc9[_0x6937('0x36')],_0x44fbc9[_0x6937('0x37')]);_0x34a414['attributes']=_[_0x6937('0x49')](_0x44fbc9['model'],qs['fields'](_0x5e40a6['query']['fields']));_0x34a414[_0x6937('0x39')]=_0x34a414[_0x6937('0x39')]['length']?_0x34a414[_0x6937('0x39')]:_0x44fbc9[_0x6937('0x36')];if(_0x5e40a6[_0x6937('0x37')][_0x6937('0x4a')]){_0x34a414[_0x6937('0x45')]=[{'all':!![]}];}_0x34a414=_['merge']({},_0x34a414,_0x5e40a6['options']);return db['VoiceQueueReport'][_0x6937('0x4b')](_0x34a414)['then'](handleEntityNotFound(_0x488b8f,null))[_0x6937('0x2b')](respondWithResult(_0x488b8f,null))[_0x6937('0x47')](handleError(_0x488b8f,null));};exports[_0x6937('0x4c')]=function(_0x1ec857,_0x3f712d){return db[_0x6937('0x32')][_0x6937('0x4c')](_0x1ec857[_0x6937('0x4d')],{})[_0x6937('0x2b')](respondWithResult(_0x3f712d,0xc9))[_0x6937('0x47')](handleError(_0x3f712d,null));};exports[_0x6937('0x2a')]=function(_0xacdf1c,_0x19e381){if(_0xacdf1c[_0x6937('0x4d')]['id']){delete _0xacdf1c[_0x6937('0x4d')]['id'];}return db[_0x6937('0x32')][_0x6937('0x4b')]({'where':{'id':_0xacdf1c['params']['id']}})[_0x6937('0x2b')](handleEntityNotFound(_0x19e381,null))[_0x6937('0x2b')](saveUpdates(_0xacdf1c[_0x6937('0x4d')],null))['then'](respondWithResult(_0x19e381,null))[_0x6937('0x47')](handleError(_0x19e381,null));};exports[_0x6937('0x2c')]=function(_0x5533ae,_0x4bfaa0){return db[_0x6937('0x32')][_0x6937('0x4b')]({'where':{'id':_0x5533ae[_0x6937('0x4e')]['id']}})[_0x6937('0x2b')](handleEntityNotFound(_0x4bfaa0,null))[_0x6937('0x2b')](removeEntity(_0x4bfaa0,null))[_0x6937('0x47')](handleError(_0x4bfaa0,null));};exports['describe']=function(_0x375eb3,_0x342317){return db[_0x6937('0x32')][_0x6937('0x4f')]()['then'](respondWithResult(_0x342317,null))[_0x6937('0x47')](handleError(_0x342317,null));};exports[_0x6937('0x50')]=function(_0x33bb9b,_0x3ed247){var _0x2ffabb={},_0x5126ad={},_0x5462da={'count':0x0,'rows':[]};_0x5126ad[_0x6937('0x36')]=_['keys'](db['VoiceQueueReport'][_0x6937('0x33')]);_0x5126ad[_0x6937('0x37')]=_[_0x6937('0x48')](_0x33bb9b[_0x6937('0x37')]);_0x5126ad[_0x6937('0x38')]=_['intersection'](_0x5126ad[_0x6937('0x36')],_0x5126ad[_0x6937('0x37')]);_0x2ffabb['attributes']=_['intersection'](_0x5126ad['model'],qs['fields'](_0x33bb9b[_0x6937('0x37')][_0x6937('0x3a')]));_0x2ffabb['attributes']=_0x2ffabb[_0x6937('0x39')][_0x6937('0x3b')]?_0x2ffabb[_0x6937('0x39')]:_0x5126ad[_0x6937('0x36')];if(!_0x33bb9b['query'][_0x6937('0x3c')](_0x6937('0x3d'))){_0x2ffabb['limit']=qs[_0x6937('0x23')](_0x33bb9b['query'][_0x6937('0x23')]);_0x2ffabb['offset']=qs[_0x6937('0x21')](_0x33bb9b['query'][_0x6937('0x21')]);}_0x2ffabb[_0x6937('0x51')]=qs['sort'](_0x33bb9b['query']['sort']);_0x2ffabb[_0x6937('0x41')]=qs['filters'](_['pick'](_0x33bb9b['query'],_0x5126ad[_0x6937('0x38')]));if(_0x33bb9b[_0x6937('0x37')][_0x6937('0x40')]){_0x2ffabb[_0x6937('0x41')]=_[_0x6937('0x52')](_0x2ffabb[_0x6937('0x41')],{'$or':_[_0x6937('0x31')](_0x2ffabb['attributes'],function(_0x71373a){var _0x43620c={};_0x43620c[_0x71373a]={'$like':'%'+_0x33bb9b[_0x6937('0x37')][_0x6937('0x40')]+'%'};return _0x43620c;})});}_0x2ffabb=_[_0x6937('0x52')]({},_0x2ffabb,_0x33bb9b[_0x6937('0x43')]);var _0x41ad13={'where':_0x2ffabb[_0x6937('0x41')]};return db[_0x6937('0x32')][_0x6937('0x44')](_0x41ad13)[_0x6937('0x2b')](function(_0x290baf){_0x5462da[_0x6937('0x44')]=_0x290baf;if(_0x33bb9b[_0x6937('0x37')][_0x6937('0x4a')]){_0x2ffabb[_0x6937('0x45')]=[{'all':!![]}];}return db[_0x6937('0x32')][_0x6937('0x53')](_0x2ffabb);})[_0x6937('0x2b')](function(_0x167175){_0x5462da['rows']=_0x167175;return _0x5462da;})[_0x6937('0x2b')](respondWithFilteredResult(_0x3ed247,_0x2ffabb,_0x6937('0x50')))[_0x6937('0x47')](handleError(_0x3ed247,null,_0x6937('0x50')));};
\ No newline at end of file
index db7e8de..96f45c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd102=['hook','exports','VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x71328c,_0x5dc236){var _0x231a53=function(_0x1d9e27){while(--_0x1d9e27){_0x71328c['push'](_0x71328c['shift']());}};_0x231a53(++_0x5dc236);}(_0xd102,0x6a));var _0x2d10=function(_0x481f1d,_0x3c80c1){_0x481f1d=_0x481f1d-0x0;var _0x5e283=_0xd102[_0x481f1d];return _0x5e283;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x2d10('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2d10('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2d10('0x2'),'afterDestroy':_0x2d10('0x3')};function emitEvent(_0xfc4346){return function(_0x9a76b4,_0x37ba06,_0x4f4e25){VoiceQueueReportEvents['emit'](_0xfc4346+':'+_0x9a76b4['id'],_0x9a76b4);VoiceQueueReportEvents[_0x2d10('0x4')](_0xfc4346,_0x9a76b4);_0x4f4e25(null);};}for(var e in events){if(events[_0x2d10('0x5')](e)){var event=events[e];VoiceQueueReport[_0x2d10('0x6')](e,emitEvent(event));}}module[_0x2d10('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x33f4=['save','update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x33f4,0xf5));var _0x433f=function(_0x20b94c,_0x2f57e7){_0x20b94c=_0x20b94c-0x0;var _0x1e1265=_0x33f4[_0x20b94c];return _0x1e1265;};'use strict';var EventEmitter=require(_0x433f('0x0'));var VoiceQueueReport=require(_0x433f('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x433f('0x2')](0x0);var events={'afterCreate':_0x433f('0x3'),'afterUpdate':_0x433f('0x4'),'afterDestroy':_0x433f('0x5')};function emitEvent(_0x28a782){return function(_0x2522c3,_0x3cbb2b,_0x17c508){VoiceQueueReportEvents['emit'](_0x28a782+':'+_0x2522c3['id'],_0x2522c3);VoiceQueueReportEvents[_0x433f('0x6')](_0x28a782,_0x2522c3);_0x17c508(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x433f('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index e4237d4..2096375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0671=['calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x0671,0x119));var _0x1067=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x0671[_0x19b84f];return _0x18067b;};'use strict';var _=require(_0x1067('0x0'));var util=require(_0x1067('0x1'));var logger=require(_0x1067('0x2'))(_0x1067('0x3'));var moment=require(_0x1067('0x4'));var BPromise=require(_0x1067('0x5'));var rp=require(_0x1067('0x6'));var fs=require('fs');var path=require(_0x1067('0x7'));var rimraf=require(_0x1067('0x8'));var config=require(_0x1067('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x1067('0xa')]=function(_0x508f86,_0x2dcb80){return _0x508f86[_0x1067('0xb')](_0x1067('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x1067('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3a4=['../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4c79aa,_0x456fcd){var _0x28e73a=function(_0x2f9084){while(--_0x2f9084){_0x4c79aa['push'](_0x4c79aa['shift']());}};_0x28e73a(++_0x456fcd);}(_0xa3a4,0x1ca));var _0x4a3a=function(_0x307abd,_0x2f0da8){_0x307abd=_0x307abd-0x0;var _0x44ccd8=_0xa3a4[_0x307abd];return _0x44ccd8;};'use strict';var _=require(_0x4a3a('0x0'));var util=require('util');var logger=require(_0x4a3a('0x1'))(_0x4a3a('0x2'));var moment=require(_0x4a3a('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a3a('0x4'));var fs=require('fs');var path=require(_0x4a3a('0x5'));var rimraf=require(_0x4a3a('0x6'));var config=require(_0x4a3a('0x7'));var attributes=require(_0x4a3a('0x8'));module[_0x4a3a('0x9')]=function(_0x533ba4,_0x17b122){return _0x533ba4[_0x4a3a('0xa')](_0x4a3a('0xb'),attributes,{'tableName':_0x4a3a('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4a3a('0xd')]},{'fields':[_0x4a3a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index a501620..292c4ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11f2=['body','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','http','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','VoiceQueueReport','findAll','where','options','limit','include','map','model','attributes','GetVoiceQueueReport','raw','CreateVoiceQueueReport','UpdateVoiceQueueReport'];(function(_0x52d864,_0x5427e8){var _0x1019d5=function(_0x2cd852){while(--_0x2cd852){_0x52d864['push'](_0x52d864['shift']());}};_0x1019d5(++_0x5427e8);}(_0x11f2,0x73));var _0x211f=function(_0x442729,_0x54663a){_0x442729=_0x442729-0x0;var _0x5177f4=_0x11f2[_0x442729];return _0x5177f4;};'use strict';var _=require('lodash');var util=require(_0x211f('0x0'));var moment=require(_0x211f('0x1'));var BPromise=require(_0x211f('0x2'));var rs=require(_0x211f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x211f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x211f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x211f('0x6')]({'port':0x232a});config[_0x211f('0x7')]=_[_0x211f('0x8')](config['redis'],{'host':_0x211f('0x9'),'port':0x18eb});var socket=require(_0x211f('0xa'))(new Redis(config[_0x211f('0x7')]));require(_0x211f('0xb'))['register'](socket);function respondWithRpcPromise(_0x11bcb6,_0x54df37,_0x39478e){return new BPromise(function(_0x1399e2,_0x2f2314){return client[_0x211f('0xc')](_0x11bcb6,_0x39478e)[_0x211f('0xd')](function(_0x319d33){logger[_0x211f('0xe')](_0x211f('0xf'),_0x54df37,'request\x20sent');logger[_0x211f('0x10')](_0x211f('0x11'),_0x54df37,_0x211f('0x12'),JSON[_0x211f('0x13')](_0x319d33));if(_0x319d33['error']){if(_0x319d33[_0x211f('0x14')][_0x211f('0x15')]===0x1f4){logger[_0x211f('0x14')](_0x211f('0xf'),_0x54df37,_0x319d33[_0x211f('0x14')][_0x211f('0x16')]);return _0x2f2314(_0x319d33[_0x211f('0x14')][_0x211f('0x16')]);}logger[_0x211f('0x14')](_0x211f('0xf'),_0x54df37,_0x319d33[_0x211f('0x14')]['message']);return _0x1399e2(_0x319d33['error'][_0x211f('0x16')]);}else{logger[_0x211f('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x54df37,_0x211f('0x12'));_0x1399e2(_0x319d33['result'][_0x211f('0x16')]);}})[_0x211f('0x17')](function(_0x19d9b1){logger[_0x211f('0x14')](_0x211f('0xf'),_0x54df37,_0x19d9b1);_0x2f2314(_0x19d9b1);});});}exports['GetVoiceQueueReport']=function(_0x2e1d41){var _0x283128=this;return new Promise(function(_0x392c9b,_0x167786){return db[_0x211f('0x18')][_0x211f('0x19')]({'raw':_0x2e1d41['options']?_0x2e1d41['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e1d41['options']?_0x2e1d41['options'][_0x211f('0x1a')]||null:null,'attributes':_0x2e1d41[_0x211f('0x1b')]?_0x2e1d41[_0x211f('0x1b')]['attributes']||null:null,'limit':_0x2e1d41['options']?_0x2e1d41[_0x211f('0x1b')][_0x211f('0x1c')]||null:null,'include':_0x2e1d41[_0x211f('0x1b')]?_0x2e1d41['options'][_0x211f('0x1d')]?_[_0x211f('0x1e')](_0x2e1d41['options']['include'],function(_0x3495af){return{'model':db[_0x3495af[_0x211f('0x1f')]],'as':_0x3495af['as'],'attributes':_0x3495af[_0x211f('0x20')],'include':_0x3495af[_0x211f('0x1d')]?_[_0x211f('0x1e')](_0x3495af['include'],function(_0x5b7f81){return{'model':db[_0x5b7f81[_0x211f('0x1f')]],'as':_0x5b7f81['as'],'attributes':_0x5b7f81[_0x211f('0x20')],'include':_0x5b7f81[_0x211f('0x1d')]?_[_0x211f('0x1e')](_0x5b7f81[_0x211f('0x1d')],function(_0x162698){return{'model':db[_0x162698[_0x211f('0x1f')]],'as':_0x162698['as'],'attributes':_0x162698[_0x211f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27c44f){logger[_0x211f('0xe')](_0x211f('0x21'),_0x2e1d41);logger[_0x211f('0x10')]('GetVoiceQueueReport',_0x2e1d41,JSON['stringify'](_0x27c44f));_0x392c9b(_0x27c44f);})['catch'](function(_0x1e701d){logger['error'](_0x211f('0x21'),_0x1e701d[_0x211f('0x16')],_0x2e1d41);_0x167786(_0x283128[_0x211f('0x14')](0x1f4,_0x1e701d['message']));});});};exports['CreateVoiceQueueReport']=function(_0x567f7c){var _0xa59645=this;return new Promise(function(_0x505b8f,_0x5b6e1c){return db[_0x211f('0x18')]['create'](_0x567f7c['body'],{'raw':_0x567f7c['options']?_0x567f7c[_0x211f('0x1b')][_0x211f('0x22')]===undefined?!![]:![]:!![]})[_0x211f('0xd')](function(_0x42d93f){logger['info']('CreateVoiceQueueReport',_0x567f7c);logger[_0x211f('0x10')](_0x211f('0x23'),_0x567f7c,JSON['stringify'](_0x42d93f));_0x505b8f(_0x42d93f);})[_0x211f('0x17')](function(_0x17ae32){logger['error'](_0x211f('0x23'),_0x17ae32['message'],_0x567f7c);_0x5b6e1c(_0xa59645[_0x211f('0x14')](0x1f4,_0x17ae32[_0x211f('0x16')]));});});};exports[_0x211f('0x24')]=function(_0x37e189){var _0x2fbf7c=this;return new Promise(function(_0x504034,_0x52d04c){return db[_0x211f('0x18')]['update'](_0x37e189[_0x211f('0x25')],{'raw':_0x37e189[_0x211f('0x1b')]?_0x37e189[_0x211f('0x1b')][_0x211f('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37e189['options']?_0x37e189[_0x211f('0x1b')][_0x211f('0x1a')]||null:null,'attributes':_0x37e189[_0x211f('0x1b')]?_0x37e189[_0x211f('0x1b')][_0x211f('0x20')]||null:null,'limit':_0x37e189[_0x211f('0x1b')]?_0x37e189[_0x211f('0x1b')][_0x211f('0x1c')]||null:null})[_0x211f('0xd')](function(_0x347361){logger['info'](_0x211f('0x24'),_0x37e189);logger[_0x211f('0x10')](_0x211f('0x24'),_0x37e189,JSON[_0x211f('0x13')](_0x347361));_0x504034(_0x347361);})[_0x211f('0x17')](function(_0x5b0c34){logger['error']('UpdateVoiceQueueReport',_0x5b0c34[_0x211f('0x16')],_0x37e189);_0x52d04c(_0x2fbf7c['error'](0x1f4,_0x5b0c34[_0x211f('0x16')]));});});};
\ No newline at end of file
+var _0xc5e3=['attributes','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','stringify','UpdateVoiceQueueReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model'];(function(_0x502773,_0xe55d92){var _0x568f34=function(_0x44a7f9){while(--_0x44a7f9){_0x502773['push'](_0x502773['shift']());}};_0x568f34(++_0xe55d92);}(_0xc5e3,0x13d));var _0x3c5e=function(_0x3c1123,_0x3967a7){_0x3c1123=_0x3c1123-0x0;var _0x5dc1d9=_0xc5e3[_0x3c1123];return _0x5dc1d9;};'use strict';var _=require(_0x3c5e('0x0'));var util=require(_0x3c5e('0x1'));var moment=require('moment');var BPromise=require(_0x3c5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c5e('0x3'));var db=require(_0x3c5e('0x4'))['db'];var utils=require(_0x3c5e('0x5'));var logger=require(_0x3c5e('0x6'))(_0x3c5e('0x7'));var config=require(_0x3c5e('0x8'));var jayson=require(_0x3c5e('0x9'));var client=jayson[_0x3c5e('0xa')][_0x3c5e('0xb')]({'port':0x232a});config['redis']=_[_0x3c5e('0xc')](config[_0x3c5e('0xd')],{'host':_0x3c5e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c5e('0xd')]));require(_0x3c5e('0xf'))['register'](socket);function respondWithRpcPromise(_0x2da410,_0x182186,_0x3c266a){return new BPromise(function(_0x5975e2,_0x150bfd){return client[_0x3c5e('0x10')](_0x2da410,_0x3c266a)[_0x3c5e('0x11')](function(_0x4e7ce5){logger[_0x3c5e('0x12')](_0x3c5e('0x13'),_0x182186,_0x3c5e('0x14'));logger[_0x3c5e('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x182186,_0x3c5e('0x14'),JSON['stringify'](_0x4e7ce5));if(_0x4e7ce5[_0x3c5e('0x16')]){if(_0x4e7ce5[_0x3c5e('0x16')][_0x3c5e('0x17')]===0x1f4){logger['error'](_0x3c5e('0x13'),_0x182186,_0x4e7ce5[_0x3c5e('0x16')][_0x3c5e('0x18')]);return _0x150bfd(_0x4e7ce5['error'][_0x3c5e('0x18')]);}logger[_0x3c5e('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x182186,_0x4e7ce5[_0x3c5e('0x16')][_0x3c5e('0x18')]);return _0x5975e2(_0x4e7ce5[_0x3c5e('0x16')]['message']);}else{logger[_0x3c5e('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x182186,_0x3c5e('0x14'));_0x5975e2(_0x4e7ce5[_0x3c5e('0x19')][_0x3c5e('0x18')]);}})['catch'](function(_0x24f023){logger[_0x3c5e('0x16')](_0x3c5e('0x13'),_0x182186,_0x24f023);_0x150bfd(_0x24f023);});});}exports['GetVoiceQueueReport']=function(_0x3aae5d){var _0x1d4e2c=this;return new Promise(function(_0x265ab0,_0x1b0a98){return db[_0x3c5e('0x1a')][_0x3c5e('0x1b')]({'raw':_0x3aae5d[_0x3c5e('0x1c')]?_0x3aae5d['options'][_0x3c5e('0x1d')]===undefined?!![]:![]:!![],'where':_0x3aae5d[_0x3c5e('0x1c')]?_0x3aae5d['options'][_0x3c5e('0x1e')]||null:null,'attributes':_0x3aae5d[_0x3c5e('0x1c')]?_0x3aae5d[_0x3c5e('0x1c')]['attributes']||null:null,'limit':_0x3aae5d['options']?_0x3aae5d[_0x3c5e('0x1c')][_0x3c5e('0x1f')]||null:null,'include':_0x3aae5d[_0x3c5e('0x1c')]?_0x3aae5d[_0x3c5e('0x1c')][_0x3c5e('0x20')]?_[_0x3c5e('0x21')](_0x3aae5d[_0x3c5e('0x1c')][_0x3c5e('0x20')],function(_0x2a1e29){return{'model':db[_0x2a1e29[_0x3c5e('0x22')]],'as':_0x2a1e29['as'],'attributes':_0x2a1e29[_0x3c5e('0x23')],'include':_0x2a1e29[_0x3c5e('0x20')]?_['map'](_0x2a1e29[_0x3c5e('0x20')],function(_0x2672da){return{'model':db[_0x2672da[_0x3c5e('0x22')]],'as':_0x2672da['as'],'attributes':_0x2672da[_0x3c5e('0x23')],'include':_0x2672da[_0x3c5e('0x20')]?_[_0x3c5e('0x21')](_0x2672da['include'],function(_0x43ca1a){return{'model':db[_0x43ca1a[_0x3c5e('0x22')]],'as':_0x43ca1a['as'],'attributes':_0x43ca1a['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c5e('0x11')](function(_0x7c16de){logger[_0x3c5e('0x12')](_0x3c5e('0x24'),_0x3aae5d);logger[_0x3c5e('0x15')](_0x3c5e('0x24'),_0x3aae5d,JSON['stringify'](_0x7c16de));_0x265ab0(_0x7c16de);})[_0x3c5e('0x25')](function(_0x538c22){logger[_0x3c5e('0x16')](_0x3c5e('0x24'),_0x538c22[_0x3c5e('0x18')],_0x3aae5d);_0x1b0a98(_0x1d4e2c[_0x3c5e('0x16')](0x1f4,_0x538c22[_0x3c5e('0x18')]));});});};exports[_0x3c5e('0x26')]=function(_0xb965eb){var _0x142392=this;return new Promise(function(_0x270e78,_0x43ec31){return db[_0x3c5e('0x1a')][_0x3c5e('0x27')](_0xb965eb[_0x3c5e('0x28')],{'raw':_0xb965eb[_0x3c5e('0x1c')]?_0xb965eb['options'][_0x3c5e('0x1d')]===undefined?!![]:![]:!![]})[_0x3c5e('0x11')](function(_0x32f77a){logger[_0x3c5e('0x12')](_0x3c5e('0x26'),_0xb965eb);logger[_0x3c5e('0x15')](_0x3c5e('0x26'),_0xb965eb,JSON[_0x3c5e('0x29')](_0x32f77a));_0x270e78(_0x32f77a);})[_0x3c5e('0x25')](function(_0x2ce8eb){logger['error']('CreateVoiceQueueReport',_0x2ce8eb['message'],_0xb965eb);_0x43ec31(_0x142392[_0x3c5e('0x16')](0x1f4,_0x2ce8eb[_0x3c5e('0x18')]));});});};exports[_0x3c5e('0x2a')]=function(_0x566385){var _0xff7fff=this;return new Promise(function(_0x327b3b,_0x3d8057){return db['VoiceQueueReport'][_0x3c5e('0x2b')](_0x566385['body'],{'raw':_0x566385[_0x3c5e('0x1c')]?_0x566385[_0x3c5e('0x1c')][_0x3c5e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x566385[_0x3c5e('0x1c')]?_0x566385[_0x3c5e('0x1c')][_0x3c5e('0x1e')]||null:null,'attributes':_0x566385[_0x3c5e('0x1c')]?_0x566385[_0x3c5e('0x1c')][_0x3c5e('0x23')]||null:null,'limit':_0x566385[_0x3c5e('0x1c')]?_0x566385[_0x3c5e('0x1c')]['limit']||null:null})[_0x3c5e('0x11')](function(_0x2e9d6e){logger[_0x3c5e('0x12')](_0x3c5e('0x2a'),_0x566385);logger['debug'](_0x3c5e('0x2a'),_0x566385,JSON[_0x3c5e('0x29')](_0x2e9d6e));_0x327b3b(_0x2e9d6e);})[_0x3c5e('0x25')](function(_0x527ff3){logger[_0x3c5e('0x16')]('UpdateVoiceQueueReport',_0x527ff3[_0x3c5e('0x18')],_0x566385);_0x3d8057(_0xff7fff[_0x3c5e('0x16')](0x1f4,_0x527ff3[_0x3c5e('0x18')]));});});};
\ No newline at end of file
index 86caa54..b1fc7bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57cf=['emit','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x2fd633,_0x2536c8){var _0x1482bc=function(_0x205f5b){while(--_0x205f5b){_0x2fd633['push'](_0x2fd633['shift']());}};_0x1482bc(++_0x2536c8);}(_0x57cf,0x11b));var _0xf57c=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x57cf[_0x46f3f8];return _0xbc57cd;};'use strict';var VoiceQueueReportEvents=require(_0xf57c('0x0'));var events=[_0xf57c('0x1'),_0xf57c('0x2'),_0xf57c('0x3')];function createListener(_0x41d1fd,_0x446db1){return function(_0x42e107){_0x446db1[_0xf57c('0x4')](_0x41d1fd,_0x42e107);};}function removeListener(_0x41391c,_0x16d54f){return function(){VoiceQueueReportEvents['removeListener'](_0x41391c,_0x16d54f);};}exports[_0xf57c('0x5')]=function(_0x4a5d1d){for(var _0x12b00f=0x0,_0x5816f5=events['length'];_0x12b00f<_0x5816f5;_0x12b00f++){var _0x21a69d=events[_0x12b00f];var _0x4867f6=createListener(_0xf57c('0x6')+_0x21a69d,_0x4a5d1d);VoiceQueueReportEvents['on'](_0x21a69d,_0x4867f6);}};
\ No newline at end of file
+var _0xd07b=['emit','removeListener','register','length','./voiceQueueReport.events','save','remove','update'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xd07b,0xfc));var _0xbd07=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd07b[_0x397e5f];return _0x5302b8;};'use strict';var VoiceQueueReportEvents=require(_0xbd07('0x0'));var events=[_0xbd07('0x1'),_0xbd07('0x2'),_0xbd07('0x3')];function createListener(_0xf244b2,_0x33e157){return function(_0x57b88a){_0x33e157[_0xbd07('0x4')](_0xf244b2,_0x57b88a);};}function removeListener(_0x4976c5,_0x419f4c){return function(){VoiceQueueReportEvents[_0xbd07('0x5')](_0x4976c5,_0x419f4c);};}exports[_0xbd07('0x6')]=function(_0x3d6684){for(var _0x465b53=0x0,_0x1e8f9c=events[_0xbd07('0x7')];_0x465b53<_0x1e8f9c;_0x465b53++){var _0x1de79b=events[_0x465b53];var _0x5caa9b=createListener('voiceQueueReport:'+_0x1de79b,_0x3d6684);VoiceQueueReportEvents['on'](_0x1de79b,_0x5caa9b);}};
\ No newline at end of file
index ee340c8..386b2f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5541=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','post','/:id','destroy','exports','multer','util'];(function(_0xd11fb9,_0x361873){var _0x339047=function(_0x2ead58){while(--_0x2ead58){_0xd11fb9['push'](_0xd11fb9['shift']());}};_0x339047(++_0x361873);}(_0x5541,0x184));var _0x1554=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x5541[_0x229d7e];return _0xa78280;};'use strict';var multer=require(_0x1554('0x0'));var util=require(_0x1554('0x1'));var path=require(_0x1554('0x2'));var timeout=require(_0x1554('0x3'));var express=require('express');var router=express[_0x1554('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1554('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1554('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0x1554('0x7')]('/',auth[_0x1554('0x8')](),controller['index']);router[_0x1554('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1554('0x9')]('/',auth[_0x1554('0x8')](),controller['create']);router['put'](_0x1554('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1554('0xa'),auth[_0x1554('0x8')](),controller[_0x1554('0xb')]);module[_0x1554('0xc')]=router;
\ No newline at end of file
+var _0x75f0=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x75f0,0x196));var _0x075f=function(_0x2b9630,_0x394f14){_0x2b9630=_0x2b9630-0x0;var _0x5cb3ba=_0x75f0[_0x2b9630];return _0x5cb3ba;};'use strict';var multer=require(_0x075f('0x0'));var util=require(_0x075f('0x1'));var path=require(_0x075f('0x2'));var timeout=require(_0x075f('0x3'));var express=require(_0x075f('0x4'));var router=express[_0x075f('0x5')]();var fs_extra=require(_0x075f('0x6'));var auth=require(_0x075f('0x7'));var interaction=require(_0x075f('0x8'));var config=require('../../config/environment');var controller=require(_0x075f('0x9'));router[_0x075f('0xa')]('/',auth[_0x075f('0xb')](),controller['index']);router['get'](_0x075f('0xc'),auth['isAuthenticated'](),controller[_0x075f('0xd')]);router[_0x075f('0xe')]('/',auth['isAuthenticated'](),controller[_0x075f('0xf')]);router[_0x075f('0x10')](_0x075f('0xc'),auth[_0x075f('0xb')](),controller[_0x075f('0x11')]);router['delete']('/:id',auth[_0x075f('0xb')](),controller[_0x075f('0x12')]);module[_0x075f('0x13')]=router;
\ No newline at end of file
index a779098..8f7808c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7fe=['sequelize','moment','exports','STRING','DATE','format'];(function(_0x195d31,_0x4a94d9){var _0x1f9684=function(_0x4df1c0){while(--_0x4df1c0){_0x195d31['push'](_0x195d31['shift']());}};_0x1f9684(++_0x4a94d9);}(_0xf7fe,0x192));var _0xef7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf7fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xef7f('0x0'));var moment=require(_0xef7f('0x1'));module[_0xef7f('0x2')]={'time':{'type':Sequelize[_0xef7f('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xef7f('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xef7f('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xef7f('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xef7f('0x4')],'allowNull':![],'defaultValue':moment()[_0xef7f('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0x4667=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING','DATE','format'];(function(_0x1dc442,_0x2d24ff){var _0x44d13d=function(_0x524e30){while(--_0x524e30){_0x1dc442['push'](_0x1dc442['shift']());}};_0x44d13d(++_0x2d24ff);}(_0x4667,0x10f));var _0x7466=function(_0x5baadf,_0x1bb942){_0x5baadf=_0x5baadf-0x0;var _0x3cd985=_0x4667[_0x5baadf];return _0x3cd985;};'use strict';var Sequelize=require(_0x7466('0x0'));var moment=require(_0x7466('0x1'));module['exports']={'time':{'type':Sequelize[_0x7466('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7466('0x3')],'allowNull':![],'defaultValue':moment()[_0x7466('0x4')](_0x7466('0x5'))}};
\ No newline at end of file
index 0ab0970..db54b6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecd8=['length','include','options','create','catch','body','params','destroy','find','rimraf','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','VoiceQueuesLog','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','rawAttributes'];(function(_0x2030b7,_0x53bb13){var _0xfb350d=function(_0x277a7f){while(--_0x277a7f){_0x2030b7['push'](_0x2030b7['shift']());}};_0xfb350d(++_0x53bb13);}(_0xecd8,0x18f));var _0x8ecd=function(_0x118759,_0x5a9042){_0x118759=_0x118759-0x0;var _0x5d513a=_0xecd8[_0x118759];return _0x5d513a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ecd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ecd('0x1'));var rp=require(_0x8ecd('0x2'));var moment=require(_0x8ecd('0x3'));var BPromise=require(_0x8ecd('0x4'));var Mustache=require(_0x8ecd('0x5'));var util=require(_0x8ecd('0x6'));var path=require('path');var sox=require(_0x8ecd('0x7'));var csv=require(_0x8ecd('0x8'));var ejs=require(_0x8ecd('0x9'));var fs=require('fs');var fs_extra=require(_0x8ecd('0xa'));var _=require(_0x8ecd('0xb'));var squel=require(_0x8ecd('0xc'));var crypto=require('crypto');var jsforce=require(_0x8ecd('0xd'));var deskjs=require(_0x8ecd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8ecd('0xf'));var Papa=require(_0x8ecd('0x10'));var Redis=require(_0x8ecd('0x11'));var authService=require(_0x8ecd('0x12'));var qs=require(_0x8ecd('0x13'));var as=require(_0x8ecd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ecd('0x15'))('api');var utils=require(_0x8ecd('0x16'));var config=require(_0x8ecd('0x17'));var licenseUtil=require(_0x8ecd('0x18'));var db=require(_0x8ecd('0x19'))['db'];function respondWithStatusCode(_0x5931d4,_0x19d74e){_0x19d74e=_0x19d74e||0xcc;return function(_0x2324d6){if(_0x2324d6){return _0x5931d4[_0x8ecd('0x1a')](_0x19d74e);}return _0x5931d4[_0x8ecd('0x1b')](_0x19d74e)[_0x8ecd('0x1c')]();};}function respondWithResult(_0x1a3f1d,_0x4e272d){_0x4e272d=_0x4e272d||0xc8;return function(_0x4206ce){if(_0x4206ce){return _0x1a3f1d['status'](_0x4e272d)['json'](_0x4206ce);}};}function respondWithFilteredResult(_0x21bdb4,_0x537e93){return function(_0x31afd4){if(_0x31afd4){var _0x35d67f=typeof _0x537e93[_0x8ecd('0x1d')]==='undefined'&&typeof _0x537e93[_0x8ecd('0x1e')]===_0x8ecd('0x1f');var _0x624a8=_0x31afd4[_0x8ecd('0x20')];var _0x63a18f=_0x35d67f?0x0:_0x537e93[_0x8ecd('0x1d')];var _0x348398=_0x35d67f?_0x31afd4['count']:_0x537e93[_0x8ecd('0x1d')]+_0x537e93['limit'];var _0x5bfa03;if(_0x348398>=_0x624a8){_0x348398=_0x624a8;_0x5bfa03=0xc8;}else{_0x5bfa03=0xce;}_0x21bdb4[_0x8ecd('0x1b')](_0x5bfa03);return _0x21bdb4[_0x8ecd('0x21')](_0x8ecd('0x22'),_0x63a18f+'-'+_0x348398+'/'+_0x624a8)['json'](_0x31afd4);}return null;};}function patchUpdates(_0x529c35){return function(_0x38516e){try{jsonpatch[_0x8ecd('0x23')](_0x38516e,_0x529c35,!![]);}catch(_0x2c7bfc){return BPromise[_0x8ecd('0x24')](_0x2c7bfc);}return _0x38516e[_0x8ecd('0x25')]();};}function saveUpdates(_0x10905e,_0x25abac){return function(_0x5967e1){if(_0x5967e1){return _0x5967e1['update'](_0x10905e)[_0x8ecd('0x26')](function(_0x4ce4f8){return _0x4ce4f8;});}return null;};}function removeEntity(_0x3201ca,_0x18df27){return function(_0x1f94be){if(_0x1f94be){return _0x1f94be['destroy']()[_0x8ecd('0x26')](function(){_0x3201ca[_0x8ecd('0x1b')](0xcc)[_0x8ecd('0x1c')]();});}};}function handleEntityNotFound(_0x5e8671,_0x4b20ac){return function(_0x306fc8){if(!_0x306fc8){_0x5e8671[_0x8ecd('0x1a')](0x194);}return _0x306fc8;};}function handleError(_0x1a21cb,_0x2e9195){_0x2e9195=_0x2e9195||0x1f4;return function(_0x90820d){logger[_0x8ecd('0x27')](_0x90820d[_0x8ecd('0x28')]);if(_0x90820d['name']){delete _0x90820d[_0x8ecd('0x29')];}_0x1a21cb[_0x8ecd('0x1b')](_0x2e9195)[_0x8ecd('0x2a')](_0x90820d);};}exports[_0x8ecd('0x2b')]=function(_0x53229b,_0x4f928f){var _0x2637f9={},_0x3814fa={},_0x544964={'count':0x0,'rows':[]};var _0x1060ec=_['map'](db[_0x8ecd('0x2c')]['rawAttributes'],function(_0x2185a2){return{'name':_0x2185a2[_0x8ecd('0x2d')],'type':_0x2185a2[_0x8ecd('0x2e')][_0x8ecd('0x2f')]};});_0x3814fa[_0x8ecd('0x30')]=_[_0x8ecd('0x31')](_0x1060ec,_0x8ecd('0x29'));_0x3814fa[_0x8ecd('0x32')]=_[_0x8ecd('0x33')](_0x53229b[_0x8ecd('0x32')]);_0x3814fa[_0x8ecd('0x34')]=_[_0x8ecd('0x35')](_0x3814fa[_0x8ecd('0x30')],_0x3814fa[_0x8ecd('0x32')]);_0x2637f9[_0x8ecd('0x36')]=_[_0x8ecd('0x35')](_0x3814fa[_0x8ecd('0x30')],qs['fields'](_0x53229b['query'][_0x8ecd('0x37')]));_0x2637f9[_0x8ecd('0x36')]=_0x2637f9['attributes']['length']?_0x2637f9[_0x8ecd('0x36')]:_0x3814fa[_0x8ecd('0x30')];if(!_0x53229b[_0x8ecd('0x32')][_0x8ecd('0x38')](_0x8ecd('0x39'))){_0x2637f9[_0x8ecd('0x1e')]=qs[_0x8ecd('0x1e')](_0x53229b['query'][_0x8ecd('0x1e')]);_0x2637f9[_0x8ecd('0x1d')]=qs['offset'](_0x53229b[_0x8ecd('0x32')][_0x8ecd('0x1d')]);}_0x2637f9['order']=qs[_0x8ecd('0x3a')](_0x53229b[_0x8ecd('0x32')][_0x8ecd('0x3a')]);_0x2637f9[_0x8ecd('0x3b')]=qs[_0x8ecd('0x34')](_[_0x8ecd('0x3c')](_0x53229b[_0x8ecd('0x32')],_0x3814fa['filters']),_0x1060ec);if(_0x53229b[_0x8ecd('0x32')][_0x8ecd('0x3d')]){_0x2637f9['where']=_[_0x8ecd('0x3e')](_0x2637f9[_0x8ecd('0x3b')],{'$or':_[_0x8ecd('0x31')](_0x1060ec,function(_0x1e96cf){if(_0x1e96cf[_0x8ecd('0x2e')]!==_0x8ecd('0x3f')){var _0xd28a90={};_0xd28a90[_0x1e96cf['name']]={'$like':'%'+_0x53229b[_0x8ecd('0x32')]['filter']+'%'};return _0xd28a90;}})});}_0x2637f9=_['merge']({},_0x2637f9,_0x53229b['options']);var _0x3b6996={'where':_0x2637f9[_0x8ecd('0x3b')]};return db[_0x8ecd('0x2c')][_0x8ecd('0x20')](_0x3b6996)[_0x8ecd('0x26')](function(_0xaee391){_0x544964[_0x8ecd('0x20')]=_0xaee391;if(_0x53229b['query'][_0x8ecd('0x40')]){_0x2637f9['include']=[{'all':!![]}];}return db[_0x8ecd('0x2c')][_0x8ecd('0x41')](_0x2637f9);})[_0x8ecd('0x26')](function(_0x11895f){_0x544964[_0x8ecd('0x42')]=_0x11895f;return _0x544964;})[_0x8ecd('0x26')](respondWithFilteredResult(_0x4f928f,_0x2637f9))['catch'](handleError(_0x4f928f,null));};exports[_0x8ecd('0x43')]=function(_0x5bbdb0,_0x221c62){var _0x5ede00={'raw':!![],'where':{'id':_0x5bbdb0['params']['id']}},_0x942137={};_0x942137[_0x8ecd('0x30')]=_[_0x8ecd('0x33')](db[_0x8ecd('0x2c')][_0x8ecd('0x44')]);_0x942137[_0x8ecd('0x32')]=_[_0x8ecd('0x33')](_0x5bbdb0['query']);_0x942137['filters']=_[_0x8ecd('0x35')](_0x942137[_0x8ecd('0x30')],_0x942137[_0x8ecd('0x32')]);_0x5ede00['attributes']=_[_0x8ecd('0x35')](_0x942137['model'],qs[_0x8ecd('0x37')](_0x5bbdb0[_0x8ecd('0x32')][_0x8ecd('0x37')]));_0x5ede00[_0x8ecd('0x36')]=_0x5ede00[_0x8ecd('0x36')][_0x8ecd('0x45')]?_0x5ede00[_0x8ecd('0x36')]:_0x942137[_0x8ecd('0x30')];if(_0x5bbdb0[_0x8ecd('0x32')]['includeAll']){_0x5ede00[_0x8ecd('0x46')]=[{'all':!![]}];}_0x5ede00=_[_0x8ecd('0x3e')]({},_0x5ede00,_0x5bbdb0[_0x8ecd('0x47')]);return db[_0x8ecd('0x2c')]['find'](_0x5ede00)[_0x8ecd('0x26')](handleEntityNotFound(_0x221c62,null))[_0x8ecd('0x26')](respondWithResult(_0x221c62,null))['catch'](handleError(_0x221c62,null));};exports[_0x8ecd('0x48')]=function(_0x25351c,_0x436e7a){return db[_0x8ecd('0x2c')][_0x8ecd('0x48')](_0x25351c['body'],{})[_0x8ecd('0x26')](respondWithResult(_0x436e7a,0xc9))[_0x8ecd('0x49')](handleError(_0x436e7a,null));};exports['update']=function(_0x276ea4,_0x1ec13c){if(_0x276ea4['body']['id']){delete _0x276ea4[_0x8ecd('0x4a')]['id'];}return db[_0x8ecd('0x2c')]['find']({'where':{'id':_0x276ea4[_0x8ecd('0x4b')]['id']}})[_0x8ecd('0x26')](handleEntityNotFound(_0x1ec13c,null))[_0x8ecd('0x26')](saveUpdates(_0x276ea4[_0x8ecd('0x4a')],null))[_0x8ecd('0x26')](respondWithResult(_0x1ec13c,null))[_0x8ecd('0x49')](handleError(_0x1ec13c,null));};exports[_0x8ecd('0x4c')]=function(_0x29a5a9,_0x446afc){return db[_0x8ecd('0x2c')][_0x8ecd('0x4d')]({'where':{'id':_0x29a5a9[_0x8ecd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x446afc,null))['then'](removeEntity(_0x446afc,null))['catch'](handleError(_0x446afc,null));};
\ No newline at end of file
+var _0xfc59=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create'];(function(_0x4636b7,_0x548559){var _0x203107=function(_0x337dfc){while(--_0x337dfc){_0x4636b7['push'](_0x4636b7['shift']());}};_0x203107(++_0x548559);}(_0xfc59,0x91));var _0x9fc5=function(_0x2d0319,_0x5892b9){_0x2d0319=_0x2d0319-0x0;var _0x6224d0=_0xfc59[_0x2d0319];return _0x6224d0;};'use strict';var emlformat=require(_0x9fc5('0x0'));var rimraf=require(_0x9fc5('0x1'));var zipdir=require(_0x9fc5('0x2'));var jsonpatch=require(_0x9fc5('0x3'));var rp=require(_0x9fc5('0x4'));var moment=require(_0x9fc5('0x5'));var BPromise=require(_0x9fc5('0x6'));var Mustache=require(_0x9fc5('0x7'));var util=require(_0x9fc5('0x8'));var path=require('path');var sox=require(_0x9fc5('0x9'));var csv=require('to-csv');var ejs=require(_0x9fc5('0xa'));var fs=require('fs');var fs_extra=require(_0x9fc5('0xb'));var _=require('lodash');var squel=require(_0x9fc5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9fc5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9fc5('0xe'));var Papa=require(_0x9fc5('0xf'));var Redis=require(_0x9fc5('0x10'));var authService=require(_0x9fc5('0x11'));var qs=require(_0x9fc5('0x12'));var as=require(_0x9fc5('0x13'));var hardwareService=require(_0x9fc5('0x14'));var logger=require(_0x9fc5('0x15'))(_0x9fc5('0x16'));var utils=require('../../config/utils');var config=require(_0x9fc5('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x552896,_0x214de2){_0x214de2=_0x214de2||0xcc;return function(_0xa79626){if(_0xa79626){return _0x552896['sendStatus'](_0x214de2);}return _0x552896['status'](_0x214de2)[_0x9fc5('0x18')]();};}function respondWithResult(_0x420f14,_0x436004){_0x436004=_0x436004||0xc8;return function(_0x11b81b){if(_0x11b81b){return _0x420f14[_0x9fc5('0x19')](_0x436004)[_0x9fc5('0x1a')](_0x11b81b);}};}function respondWithFilteredResult(_0x1f561d,_0x2f568c){return function(_0x5ec025){if(_0x5ec025){var _0x156b1e=typeof _0x2f568c[_0x9fc5('0x1b')]===_0x9fc5('0x1c')&&typeof _0x2f568c[_0x9fc5('0x1d')]===_0x9fc5('0x1c');var _0x29b0c2=_0x5ec025[_0x9fc5('0x1e')];var _0x539191=_0x156b1e?0x0:_0x2f568c['offset'];var _0x31f1d2=_0x156b1e?_0x5ec025['count']:_0x2f568c[_0x9fc5('0x1b')]+_0x2f568c['limit'];var _0x2e3c85;if(_0x31f1d2>=_0x29b0c2){_0x31f1d2=_0x29b0c2;_0x2e3c85=0xc8;}else{_0x2e3c85=0xce;}_0x1f561d['status'](_0x2e3c85);return _0x1f561d[_0x9fc5('0x1f')](_0x9fc5('0x20'),_0x539191+'-'+_0x31f1d2+'/'+_0x29b0c2)[_0x9fc5('0x1a')](_0x5ec025);}return null;};}function patchUpdates(_0x565551){return function(_0x353c02){try{jsonpatch[_0x9fc5('0x21')](_0x353c02,_0x565551,!![]);}catch(_0x402c39){return BPromise['reject'](_0x402c39);}return _0x353c02[_0x9fc5('0x22')]();};}function saveUpdates(_0x392dd1,_0x299ab1){return function(_0xd53c55){if(_0xd53c55){return _0xd53c55[_0x9fc5('0x23')](_0x392dd1)[_0x9fc5('0x24')](function(_0xe32bcf){return _0xe32bcf;});}return null;};}function removeEntity(_0x48271c,_0x5c55a8){return function(_0x36709a){if(_0x36709a){return _0x36709a[_0x9fc5('0x25')]()[_0x9fc5('0x24')](function(){_0x48271c[_0x9fc5('0x19')](0xcc)[_0x9fc5('0x18')]();});}};}function handleEntityNotFound(_0x3af850,_0x1cf9d4){return function(_0x17c157){if(!_0x17c157){_0x3af850[_0x9fc5('0x26')](0x194);}return _0x17c157;};}function handleError(_0x2c572d,_0x1ba166){_0x1ba166=_0x1ba166||0x1f4;return function(_0x73266b){logger[_0x9fc5('0x27')](_0x73266b[_0x9fc5('0x28')]);if(_0x73266b['name']){delete _0x73266b[_0x9fc5('0x29')];}_0x2c572d[_0x9fc5('0x19')](_0x1ba166)['send'](_0x73266b);};}exports[_0x9fc5('0x2a')]=function(_0x53891d,_0xa89750){var _0x41042c={},_0x46c9f5={},_0x47f0bf={'count':0x0,'rows':[]};var _0x28dd63=_[_0x9fc5('0x2b')](db[_0x9fc5('0x2c')][_0x9fc5('0x2d')],function(_0x6c46ee){return{'name':_0x6c46ee[_0x9fc5('0x2e')],'type':_0x6c46ee[_0x9fc5('0x2f')]['key']};});_0x46c9f5[_0x9fc5('0x30')]=_[_0x9fc5('0x2b')](_0x28dd63,'name');_0x46c9f5[_0x9fc5('0x31')]=_[_0x9fc5('0x32')](_0x53891d[_0x9fc5('0x31')]);_0x46c9f5[_0x9fc5('0x33')]=_[_0x9fc5('0x34')](_0x46c9f5[_0x9fc5('0x30')],_0x46c9f5[_0x9fc5('0x31')]);_0x41042c['attributes']=_[_0x9fc5('0x34')](_0x46c9f5[_0x9fc5('0x30')],qs[_0x9fc5('0x35')](_0x53891d['query'][_0x9fc5('0x35')]));_0x41042c[_0x9fc5('0x36')]=_0x41042c[_0x9fc5('0x36')]['length']?_0x41042c[_0x9fc5('0x36')]:_0x46c9f5[_0x9fc5('0x30')];if(!_0x53891d[_0x9fc5('0x31')]['hasOwnProperty']('nolimit')){_0x41042c[_0x9fc5('0x1d')]=qs['limit'](_0x53891d['query']['limit']);_0x41042c[_0x9fc5('0x1b')]=qs[_0x9fc5('0x1b')](_0x53891d['query']['offset']);}_0x41042c['order']=qs[_0x9fc5('0x37')](_0x53891d[_0x9fc5('0x31')][_0x9fc5('0x37')]);_0x41042c[_0x9fc5('0x38')]=qs[_0x9fc5('0x33')](_[_0x9fc5('0x39')](_0x53891d[_0x9fc5('0x31')],_0x46c9f5[_0x9fc5('0x33')]),_0x28dd63);if(_0x53891d[_0x9fc5('0x31')][_0x9fc5('0x3a')]){_0x41042c['where']=_[_0x9fc5('0x3b')](_0x41042c[_0x9fc5('0x38')],{'$or':_['map'](_0x28dd63,function(_0x2486c6){if(_0x2486c6[_0x9fc5('0x2f')]!==_0x9fc5('0x3c')){var _0x4a6361={};_0x4a6361[_0x2486c6[_0x9fc5('0x29')]]={'$like':'%'+_0x53891d[_0x9fc5('0x31')][_0x9fc5('0x3a')]+'%'};return _0x4a6361;}})});}_0x41042c=_['merge']({},_0x41042c,_0x53891d[_0x9fc5('0x3d')]);var _0x342a88={'where':_0x41042c[_0x9fc5('0x38')]};return db[_0x9fc5('0x2c')][_0x9fc5('0x1e')](_0x342a88)[_0x9fc5('0x24')](function(_0xdf8051){_0x47f0bf[_0x9fc5('0x1e')]=_0xdf8051;if(_0x53891d[_0x9fc5('0x31')][_0x9fc5('0x3e')]){_0x41042c['include']=[{'all':!![]}];}return db[_0x9fc5('0x2c')][_0x9fc5('0x3f')](_0x41042c);})['then'](function(_0x473db5){_0x47f0bf[_0x9fc5('0x40')]=_0x473db5;return _0x47f0bf;})[_0x9fc5('0x24')](respondWithFilteredResult(_0xa89750,_0x41042c))[_0x9fc5('0x41')](handleError(_0xa89750,null));};exports['show']=function(_0x38b0b1,_0x40f621){var _0x3eaa65={'raw':!![],'where':{'id':_0x38b0b1[_0x9fc5('0x42')]['id']}},_0xad1e4a={};_0xad1e4a[_0x9fc5('0x30')]=_['keys'](db['VoiceQueuesLog'][_0x9fc5('0x2d')]);_0xad1e4a[_0x9fc5('0x31')]=_['keys'](_0x38b0b1[_0x9fc5('0x31')]);_0xad1e4a['filters']=_['intersection'](_0xad1e4a[_0x9fc5('0x30')],_0xad1e4a[_0x9fc5('0x31')]);_0x3eaa65[_0x9fc5('0x36')]=_[_0x9fc5('0x34')](_0xad1e4a['model'],qs[_0x9fc5('0x35')](_0x38b0b1['query'][_0x9fc5('0x35')]));_0x3eaa65['attributes']=_0x3eaa65['attributes'][_0x9fc5('0x43')]?_0x3eaa65[_0x9fc5('0x36')]:_0xad1e4a[_0x9fc5('0x30')];if(_0x38b0b1[_0x9fc5('0x31')][_0x9fc5('0x3e')]){_0x3eaa65[_0x9fc5('0x44')]=[{'all':!![]}];}_0x3eaa65=_['merge']({},_0x3eaa65,_0x38b0b1[_0x9fc5('0x3d')]);return db['VoiceQueuesLog'][_0x9fc5('0x45')](_0x3eaa65)[_0x9fc5('0x24')](handleEntityNotFound(_0x40f621,null))[_0x9fc5('0x24')](respondWithResult(_0x40f621,null))[_0x9fc5('0x41')](handleError(_0x40f621,null));};exports[_0x9fc5('0x46')]=function(_0x1f5956,_0x49fb2f){return db[_0x9fc5('0x2c')]['create'](_0x1f5956[_0x9fc5('0x47')],{})[_0x9fc5('0x24')](respondWithResult(_0x49fb2f,0xc9))['catch'](handleError(_0x49fb2f,null));};exports[_0x9fc5('0x23')]=function(_0x48c03f,_0x1150d2){if(_0x48c03f[_0x9fc5('0x47')]['id']){delete _0x48c03f[_0x9fc5('0x47')]['id'];}return db[_0x9fc5('0x2c')]['find']({'where':{'id':_0x48c03f[_0x9fc5('0x42')]['id']}})[_0x9fc5('0x24')](handleEntityNotFound(_0x1150d2,null))[_0x9fc5('0x24')](saveUpdates(_0x48c03f['body'],null))[_0x9fc5('0x24')](respondWithResult(_0x1150d2,null))[_0x9fc5('0x41')](handleError(_0x1150d2,null));};exports['destroy']=function(_0x2b6c2b,_0x491b3d){return db['VoiceQueuesLog']['find']({'where':{'id':_0x2b6c2b[_0x9fc5('0x42')]['id']}})[_0x9fc5('0x24')](handleEntityNotFound(_0x491b3d,null))[_0x9fc5('0x24')](removeEntity(_0x491b3d,null))[_0x9fc5('0x41')](handleError(_0x491b3d,null));};
\ No newline at end of file
index 3fe67a6..824edc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1cd=['exports','define','VoiceQueuesLog','event_dtm','event','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x19f8ee,_0x3e08c2){var _0x3b68f2=function(_0x1f0f13){while(--_0x1f0f13){_0x19f8ee['push'](_0x19f8ee['shift']());}};_0x3b68f2(++_0x3e08c2);}(_0xc1cd,0x1e6));var _0xdc1c=function(_0x34803e,_0x25e2b1){_0x34803e=_0x34803e-0x0;var _0x790c91=_0xc1cd[_0x34803e];return _0x790c91;};'use strict';var _=require(_0xdc1c('0x0'));var util=require(_0xdc1c('0x1'));var logger=require(_0xdc1c('0x2'))(_0xdc1c('0x3'));var moment=require('moment');var BPromise=require(_0xdc1c('0x4'));var rp=require(_0xdc1c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc1c('0x6'));var config=require(_0xdc1c('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0xdc1c('0x8')]=function(_0x230aa,_0x2b3f05){return _0x230aa[_0xdc1c('0x9')](_0xdc1c('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xdc1c('0xb'),'fields':[_0xdc1c('0xc'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
+var _0xb268=['moment','bluebird','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','event_dtm','event','dtm','lodash','util','../../config/logger','api'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0xb268,0x114));var _0x8b26=function(_0x1f7714,_0x3f200e){_0x1f7714=_0x1f7714-0x0;var _0x2051d5=_0xb268[_0x1f7714];return _0x2051d5;};'use strict';var _=require(_0x8b26('0x0'));var util=require(_0x8b26('0x1'));var logger=require(_0x8b26('0x2'))(_0x8b26('0x3'));var moment=require(_0x8b26('0x4'));var BPromise=require(_0x8b26('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8b26('0x6'));var config=require(_0x8b26('0x7'));var attributes=require(_0x8b26('0x8'));module[_0x8b26('0x9')]=function(_0x2b0249,_0x4fb7d6){return _0x2b0249[_0x8b26('0xa')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x8b26('0xb'),'fields':[_0x8b26('0xc'),_0x8b26('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index be57630..5f788c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b1c=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x18dd84,_0x5f2ba0){var _0x5e740c=function(_0x388c69){while(--_0x388c69){_0x18dd84['push'](_0x18dd84['shift']());}};_0x5e740c(++_0x5f2ba0);}(_0x6b1c,0xf3));var _0xc6b1=function(_0x2ac95f,_0x14b261){_0x2ac95f=_0x2ac95f-0x0;var _0x3d826d=_0x6b1c[_0x2ac95f];return _0x3d826d;};'use strict';var _=require(_0xc6b1('0x0'));var util=require('util');var moment=require(_0xc6b1('0x1'));var BPromise=require(_0xc6b1('0x2'));var rs=require(_0xc6b1('0x3'));var fs=require('fs');var Redis=require(_0xc6b1('0x4'));var db=require(_0xc6b1('0x5'))['db'];var utils=require(_0xc6b1('0x6'));var logger=require('../../config/logger')(_0xc6b1('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6b1('0x8'));var client=jayson[_0xc6b1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f8295,_0x1de8b5,_0x362814){return new BPromise(function(_0x1e0dfb,_0x4f6509){return client[_0xc6b1('0xa')](_0x1f8295,_0x362814)[_0xc6b1('0xb')](function(_0x5a8dac){logger['info'](_0xc6b1('0xc'),_0x1de8b5,_0xc6b1('0xd'));logger[_0xc6b1('0xe')](_0xc6b1('0xf'),_0x1de8b5,_0xc6b1('0xd'),JSON[_0xc6b1('0x10')](_0x5a8dac));if(_0x5a8dac['error']){if(_0x5a8dac[_0xc6b1('0x11')][_0xc6b1('0x12')]===0x1f4){logger[_0xc6b1('0x11')](_0xc6b1('0xc'),_0x1de8b5,_0x5a8dac[_0xc6b1('0x11')]['message']);return _0x4f6509(_0x5a8dac[_0xc6b1('0x11')][_0xc6b1('0x13')]);}logger[_0xc6b1('0x11')](_0xc6b1('0xc'),_0x1de8b5,_0x5a8dac['error']['message']);return _0x1e0dfb(_0x5a8dac[_0xc6b1('0x11')][_0xc6b1('0x13')]);}else{logger[_0xc6b1('0x14')](_0xc6b1('0xc'),_0x1de8b5,_0xc6b1('0xd'));_0x1e0dfb(_0x5a8dac[_0xc6b1('0x15')]['message']);}})['catch'](function(_0xaed550){logger[_0xc6b1('0x11')](_0xc6b1('0xc'),_0x1de8b5,_0xaed550);_0x4f6509(_0xaed550);});});}
\ No newline at end of file
+var _0xa1e8=['http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xfa7f22,_0x251ebd){var _0x37850f=function(_0x2847bb){while(--_0x2847bb){_0xfa7f22['push'](_0xfa7f22['shift']());}};_0x37850f(++_0x251ebd);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x523a67,_0x11ea07){_0x523a67=_0x523a67-0x0;var _0x3e5b9d=_0xa1e8[_0x523a67];return _0x3e5b9d;};'use strict';var _=require(_0x8a1e('0x0'));var util=require('util');var moment=require(_0x8a1e('0x1'));var BPromise=require(_0x8a1e('0x2'));var rs=require(_0x8a1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a1e('0x5'))(_0x8a1e('0x6'));var config=require(_0x8a1e('0x7'));var jayson=require(_0x8a1e('0x8'));var client=jayson['client'][_0x8a1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1463b3,_0xeaba17,_0x238e9e){return new BPromise(function(_0x483e06,_0x14f902){return client[_0x8a1e('0xa')](_0x1463b3,_0x238e9e)[_0x8a1e('0xb')](function(_0x537de3){logger[_0x8a1e('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0xeaba17,_0x8a1e('0xd'));logger[_0x8a1e('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0xeaba17,'request\x20sent',JSON[_0x8a1e('0xf')](_0x537de3));if(_0x537de3[_0x8a1e('0x10')]){if(_0x537de3[_0x8a1e('0x10')][_0x8a1e('0x11')]===0x1f4){logger[_0x8a1e('0x10')](_0x8a1e('0x12'),_0xeaba17,_0x537de3[_0x8a1e('0x10')]['message']);return _0x14f902(_0x537de3[_0x8a1e('0x10')][_0x8a1e('0x13')]);}logger[_0x8a1e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0xeaba17,_0x537de3[_0x8a1e('0x10')][_0x8a1e('0x13')]);return _0x483e06(_0x537de3[_0x8a1e('0x10')]['message']);}else{logger[_0x8a1e('0xc')](_0x8a1e('0x12'),_0xeaba17,_0x8a1e('0xd'));_0x483e06(_0x537de3['result']['message']);}})['catch'](function(_0x3d7dc0){logger[_0x8a1e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0xeaba17,_0x3d7dc0);_0x14f902(_0x3d7dc0);});});}
\ No newline at end of file
index a77742b..89a88f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3067=['downloadTranscribe','create','post','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','/:id/download','/:id/transcribe'];(function(_0x55eb1c,_0x259e25){var _0x48d24f=function(_0x55085b){while(--_0x55085b){_0x55eb1c['push'](_0x55eb1c['shift']());}};_0x48d24f(++_0x259e25);}(_0x3067,0xe1));var _0x7306=function(_0x242787,_0x7456a6){_0x242787=_0x242787-0x0;var _0x2aeca5=_0x3067[_0x242787];return _0x2aeca5;};'use strict';var multer=require(_0x7306('0x0'));var util=require(_0x7306('0x1'));var path=require(_0x7306('0x2'));var timeout=require('connect-timeout');var express=require(_0x7306('0x3'));var router=express[_0x7306('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7306('0x5'));var interaction=require(_0x7306('0x6'));var config=require(_0x7306('0x7'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x7306('0x8')](),controller[_0x7306('0x9')]);router[_0x7306('0xa')](_0x7306('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7306('0xa')]('/:id',auth[_0x7306('0x8')](),controller[_0x7306('0xc')]);router['get'](_0x7306('0xd'),auth[_0x7306('0x8')](),controller['download']);router[_0x7306('0xa')]('/:id/downloads',controller['downloads']);router['get'](_0x7306('0xe'),auth[_0x7306('0x8')](),controller[_0x7306('0xf')]);router['post']('/',auth[_0x7306('0x8')](),controller[_0x7306('0x10')]);router[_0x7306('0x11')](_0x7306('0xe'),auth[_0x7306('0x8')](),controller['runTranscribe']);router[_0x7306('0x12')]('/:id',auth[_0x7306('0x8')](),controller[_0x7306('0x13')]);router[_0x7306('0x14')](_0x7306('0x15'),auth[_0x7306('0x8')](),controller[_0x7306('0x16')]);module[_0x7306('0x17')]=router;
\ No newline at end of file
+var _0x01bc=['show','download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x01bc,0xc2));var _0xc01b=function(_0x23e09e,_0x259472){_0x23e09e=_0x23e09e-0x0;var _0x323e66=_0x01bc[_0x23e09e];return _0x323e66;};'use strict';var multer=require('multer');var util=require(_0xc01b('0x0'));var path=require(_0xc01b('0x1'));var timeout=require(_0xc01b('0x2'));var express=require(_0xc01b('0x3'));var router=express[_0xc01b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc01b('0x5'));var interaction=require(_0xc01b('0x6'));var config=require(_0xc01b('0x7'));var controller=require('./voiceRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc01b('0x8')]);router[_0xc01b('0x9')](_0xc01b('0xa'),auth[_0xc01b('0xb')](),controller[_0xc01b('0xc')]);router['get'](_0xc01b('0xd'),auth[_0xc01b('0xb')](),controller[_0xc01b('0xe')]);router[_0xc01b('0x9')]('/:id/download',auth[_0xc01b('0xb')](),controller[_0xc01b('0xf')]);router[_0xc01b('0x9')](_0xc01b('0x10'),controller['downloads']);router[_0xc01b('0x9')](_0xc01b('0x11'),auth['isAuthenticated'](),controller[_0xc01b('0x12')]);router['post']('/',auth[_0xc01b('0xb')](),controller[_0xc01b('0x13')]);router[_0xc01b('0x14')](_0xc01b('0x11'),auth[_0xc01b('0xb')](),controller[_0xc01b('0x15')]);router[_0xc01b('0x16')](_0xc01b('0xd'),auth[_0xc01b('0xb')](),controller[_0xc01b('0x17')]);router[_0xc01b('0x18')](_0xc01b('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc01b('0x19')]=router;
\ No newline at end of file
index 3e296f1..87e903f 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(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 15e005f..127e937 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe6d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','limit','count','Content-Range','update','destroy','then','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','differenceBy','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','MD5','sequelize','col','token','$and','push','format','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis'];(function(_0x408a4b,_0x408a47){var _0x1b7f5b=function(_0x184eed){while(--_0x184eed){_0x408a4b['push'](_0x408a4b['shift']());}};_0x1b7f5b(++_0x408a47);}(_0xfe6d,0x119));var _0xdfe6=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0xfe6d[_0x72a33d];return _0x2621d5;};'use strict';var emlformat=require(_0xdfe6('0x0'));var rimraf=require(_0xdfe6('0x1'));var zipdir=require(_0xdfe6('0x2'));var jsonpatch=require(_0xdfe6('0x3'));var rp=require(_0xdfe6('0x4'));var moment=require(_0xdfe6('0x5'));var BPromise=require(_0xdfe6('0x6'));var Mustache=require(_0xdfe6('0x7'));var util=require('util');var path=require('path');var sox=require(_0xdfe6('0x8'));var csv=require(_0xdfe6('0x9'));var ejs=require(_0xdfe6('0xa'));var fs=require('fs');var fs_extra=require(_0xdfe6('0xb'));var _=require(_0xdfe6('0xc'));var squel=require(_0xdfe6('0xd'));var crypto=require(_0xdfe6('0xe'));var jsforce=require(_0xdfe6('0xf'));var deskjs=require(_0xdfe6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xdfe6('0x11'));var Papa=require(_0xdfe6('0x12'));var AWS=require('aws-sdk');var uuidv4=require(_0xdfe6('0x13'));var Redis=require(_0xdfe6('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdfe6('0x15'));var as=require(_0xdfe6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfe6('0x17'))(_0xdfe6('0x18'));var utils=require(_0xdfe6('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x227cd9,_0x13b5d4){_0x13b5d4=_0x13b5d4||0xcc;return function(_0x54f9f0){if(_0x54f9f0){return _0x227cd9[_0xdfe6('0x1a')](_0x13b5d4);}return _0x227cd9[_0xdfe6('0x1b')](_0x13b5d4)[_0xdfe6('0x1c')]();};}function respondWithResult(_0xb32dab,_0x3f50f8){_0x3f50f8=_0x3f50f8||0xc8;return function(_0x3b5047){if(_0x3b5047){return _0xb32dab[_0xdfe6('0x1b')](_0x3f50f8)['json'](_0x3b5047);}};}function respondWithFilteredResult(_0x417282,_0x2da2ed){return function(_0x528222){if(_0x528222){var _0x23892d=typeof _0x2da2ed[_0xdfe6('0x1d')]===_0xdfe6('0x1e')&&typeof _0x2da2ed[_0xdfe6('0x1f')]===_0xdfe6('0x1e');var _0x1070a3=_0x528222[_0xdfe6('0x20')];var _0x9cc4d=_0x23892d?0x0:_0x2da2ed[_0xdfe6('0x1d')];var _0x2ecc69=_0x23892d?_0x528222['count']:_0x2da2ed[_0xdfe6('0x1d')]+_0x2da2ed[_0xdfe6('0x1f')];var _0x49de5f;if(_0x2ecc69>=_0x1070a3){_0x2ecc69=_0x1070a3;_0x49de5f=0xc8;}else{_0x49de5f=0xce;}_0x417282['status'](_0x49de5f);return _0x417282['set'](_0xdfe6('0x21'),_0x9cc4d+'-'+_0x2ecc69+'/'+_0x1070a3)['json'](_0x528222);}return null;};}function patchUpdates(_0x1f48f1){return function(_0x5ec31e){try{jsonpatch['apply'](_0x5ec31e,_0x1f48f1,!![]);}catch(_0x1a1b6e){return BPromise['reject'](_0x1a1b6e);}return _0x5ec31e['save']();};}function saveUpdates(_0x38d8f9,_0x37c450){return function(_0xebf3ff){if(_0xebf3ff){return _0xebf3ff[_0xdfe6('0x22')](_0x38d8f9)['then'](function(_0x2c51c5){return _0x2c51c5;});}return null;};}function removeEntity(_0x11e771,_0x206dce){return function(_0x5756ef){if(_0x5756ef){return _0x5756ef[_0xdfe6('0x23')]()[_0xdfe6('0x24')](function(){_0x11e771[_0xdfe6('0x1b')](0xcc)[_0xdfe6('0x1c')]();});}};}function handleEntityNotFound(_0x25b0c8,_0x57758a){return function(_0x20c17){if(!_0x20c17){_0x25b0c8['sendStatus'](0x194);}return _0x20c17;};}function handleError(_0x1885b5,_0x57c3fc){_0x57c3fc=_0x57c3fc||0x1f4;return function(_0x431c09){logger[_0xdfe6('0x25')](_0x431c09[_0xdfe6('0x26')]);if(_0x431c09['name']){delete _0x431c09[_0xdfe6('0x27')];}_0x1885b5[_0xdfe6('0x1b')](_0x57c3fc)[_0xdfe6('0x28')](_0x431c09);};}exports[_0xdfe6('0x29')]=function(_0x55e7bf,_0x31c6e1){var _0x1a48ff={},_0x46f606={},_0x57b8d6={'count':0x0,'rows':[]};var _0x36a398=_[_0xdfe6('0x2a')](db[_0xdfe6('0x2b')][_0xdfe6('0x2c')],function(_0x185931){return{'name':_0x185931[_0xdfe6('0x2d')],'type':_0x185931['type']['key']};});_0x46f606['model']=_[_0xdfe6('0x2e')](_[_0xdfe6('0x2a')](_0x36a398,_0xdfe6('0x27')),['format']);_0x46f606[_0xdfe6('0x2f')]=_[_0xdfe6('0x30')](_0x55e7bf[_0xdfe6('0x2f')]);_0x46f606[_0xdfe6('0x31')]=_[_0xdfe6('0x32')](_0x46f606['model'],_0x46f606[_0xdfe6('0x2f')]);_0x1a48ff['attributes']=_['intersection'](_0x46f606[_0xdfe6('0x33')],qs[_0xdfe6('0x34')](_0x55e7bf[_0xdfe6('0x2f')]['fields']));_0x1a48ff[_0xdfe6('0x35')]=_0x1a48ff[_0xdfe6('0x35')][_0xdfe6('0x36')]?_0x1a48ff['attributes']:_0x46f606['model'];if(!_0x55e7bf[_0xdfe6('0x2f')][_0xdfe6('0x37')](_0xdfe6('0x38'))){_0x1a48ff[_0xdfe6('0x1f')]=qs[_0xdfe6('0x1f')](_0x55e7bf[_0xdfe6('0x2f')][_0xdfe6('0x1f')]);_0x1a48ff[_0xdfe6('0x1d')]=qs[_0xdfe6('0x1d')](_0x55e7bf['query'][_0xdfe6('0x1d')]);}_0x1a48ff[_0xdfe6('0x39')]=qs['sort'](_0x55e7bf[_0xdfe6('0x2f')][_0xdfe6('0x3a')]);_0x1a48ff['where']=qs[_0xdfe6('0x31')](_[_0xdfe6('0x3b')](_0x55e7bf[_0xdfe6('0x2f')],_0x46f606[_0xdfe6('0x31')]),_0x36a398);if(_0x55e7bf['query'][_0xdfe6('0x3c')]){_0x1a48ff[_0xdfe6('0x3d')]=_[_0xdfe6('0x3e')](_0x1a48ff[_0xdfe6('0x3d')],{'$or':_[_0xdfe6('0x2a')](_0x36a398,function(_0x5d3349){if(_0x5d3349[_0xdfe6('0x3f')]!==_0xdfe6('0x40')){var _0x517126={};_0x517126[_0x5d3349[_0xdfe6('0x27')]]={'$like':'%'+_0x55e7bf[_0xdfe6('0x2f')][_0xdfe6('0x3c')]+'%'};return _0x517126;}})});}_0x1a48ff=_[_0xdfe6('0x3e')]({},_0x1a48ff,_0x55e7bf[_0xdfe6('0x41')]);var _0x46c256={'where':_0x1a48ff[_0xdfe6('0x3d')]};return db[_0xdfe6('0x2b')][_0xdfe6('0x20')](_0x46c256)['then'](function(_0x4949dd){_0x57b8d6['count']=_0x4949dd;if(_0x55e7bf[_0xdfe6('0x2f')][_0xdfe6('0x42')]){_0x1a48ff[_0xdfe6('0x43')]=[{'all':!![]}];}return db[_0xdfe6('0x2b')][_0xdfe6('0x44')](_0x1a48ff);})[_0xdfe6('0x24')](function(_0x29af04){_0x57b8d6[_0xdfe6('0x45')]=_0x29af04;return _0x57b8d6;})['then'](respondWithFilteredResult(_0x31c6e1,_0x1a48ff))[_0xdfe6('0x46')](handleError(_0x31c6e1,null));};exports[_0xdfe6('0x47')]=function(_0x4e2598,_0x3c1b81){var _0x35dcd2={'raw':![],'where':{'id':_0x4e2598[_0xdfe6('0x48')]['id']}},_0xde85e9={};_0xde85e9['model']=_[_0xdfe6('0x30')](db[_0xdfe6('0x2b')]['rawAttributes']);_0xde85e9['query']=_[_0xdfe6('0x30')](_0x4e2598['query']);_0xde85e9[_0xdfe6('0x31')]=_[_0xdfe6('0x32')](_0xde85e9[_0xdfe6('0x33')],_0xde85e9['query']);_0x35dcd2[_0xdfe6('0x35')]=_[_0xdfe6('0x32')](_0xde85e9[_0xdfe6('0x33')],qs['fields'](_0x4e2598[_0xdfe6('0x2f')]['fields']));_0x35dcd2[_0xdfe6('0x35')]=_0x35dcd2[_0xdfe6('0x35')][_0xdfe6('0x36')]?_0x35dcd2['attributes']:_0xde85e9[_0xdfe6('0x33')];if(_0x4e2598['query'][_0xdfe6('0x42')]){_0x35dcd2[_0xdfe6('0x43')]=[{'all':!![]}];}_0x35dcd2=_[_0xdfe6('0x3e')]({},_0x35dcd2,_0x4e2598[_0xdfe6('0x41')]);return db[_0xdfe6('0x2b')]['find'](_0x35dcd2)[_0xdfe6('0x24')](handleEntityNotFound(_0x3c1b81,null))[_0xdfe6('0x24')](respondWithResult(_0x3c1b81,null))['catch'](handleError(_0x3c1b81,null));};exports['create']=function(_0x2acd2c,_0x2965c4){return db[_0xdfe6('0x2b')][_0xdfe6('0x49')](_0x2acd2c[_0xdfe6('0x4a')],{})['then'](respondWithResult(_0x2965c4,0xc9))[_0xdfe6('0x46')](handleError(_0x2965c4,null));};exports[_0xdfe6('0x22')]=function(_0x33541f,_0x12485a){if(_0x33541f[_0xdfe6('0x4a')]['id']){delete _0x33541f['body']['id'];}return db[_0xdfe6('0x2b')][_0xdfe6('0x4b')]({'where':{'id':_0x33541f[_0xdfe6('0x48')]['id']}})[_0xdfe6('0x24')](handleEntityNotFound(_0x12485a,null))[_0xdfe6('0x24')](saveUpdates(_0x33541f['body'],null))[_0xdfe6('0x24')](respondWithResult(_0x12485a,null))['catch'](handleError(_0x12485a,null));};exports['describe']=function(_0x7808d1,_0x39d3e1){return db['VoiceRecording']['describe']()[_0xdfe6('0x24')](respondWithResult(_0x39d3e1,null))[_0xdfe6('0x46')](handleError(_0x39d3e1,null));};exports['download']=function(_0x5521ad,_0x241415,_0x17432a){var _0x52446e=require(_0xdfe6('0x4c'));var _0xab6fef=![];var _0xa86a2b={};if(_0x5521ad['query'][_0xdfe6('0x3f')]&&_0x5521ad['query'][_0xdfe6('0x3f')]===_0xdfe6('0x4d')){_0xa86a2b[_0xdfe6('0x4d')]=_0x5521ad[_0xdfe6('0x48')]['id'];}else{_0xa86a2b['id']=_0x5521ad['params']['id'];}return db['VoiceRecording'][_0xdfe6('0x4b')]({'where':_0xa86a2b,'attributes':['id',_0xdfe6('0x4e')],'raw':!![]})[_0xdfe6('0x24')](handleEntityNotFound(_0x241415,null))['then'](function(_0x4839ca){if(_0x4839ca){var _0x49c562=_0x4839ca[_0xdfe6('0x4e')];var _0x11feb3=util['format'](_0xdfe6('0x4f'),_0x49c562);if(fs[_0xdfe6('0x50')](_0x11feb3)){_0xab6fef=!![];return _0x52446e[_0xdfe6('0x51')](_0x11feb3,_0x49c562,config[_0xdfe6('0x52')]['recording'])[_0xdfe6('0x24')](function(){return _0x4839ca;});}return _0x4839ca;}})[_0xdfe6('0x24')](function(_0x33e892){if(_0x33e892){var _0x44fa7c=_0x33e892[_0xdfe6('0x4e')];if(!fs[_0xdfe6('0x50')](_0x44fa7c)){throw new db[(_0xdfe6('0x53'))][(_0xdfe6('0x54'))](_0xdfe6('0x55'));}if(_0x33e892[_0xdfe6('0x56')]){return _0x241415[_0xdfe6('0x57')](_0x44fa7c,_0x33e892[_0xdfe6('0x56')]+path[_0xdfe6('0x58')](_0x44fa7c),function(){if(_0xab6fef){fs[_0xdfe6('0x59')](_0x44fa7c);}});}else{return _0x241415['download'](_0x44fa7c,function(_0x5396fc){if(_0xab6fef){fs[_0xdfe6('0x59')](_0x44fa7c);}});}}})[_0xdfe6('0x46')](function(_0x454733){if(_0x454733[_0xdfe6('0x5a')]===_0xdfe6('0x55')){_0x241415[_0xdfe6('0x1b')](0x194)[_0xdfe6('0x28')](_0xdfe6('0x5b'));}else{return handleError(_0x241415,null);}});};exports['downloads']=function(_0x4fc25e,_0x36fc3c,_0x6a38c8){var _0x5e2059=require(_0xdfe6('0x4c'));var _0x198ec0=![];var _0x2857f4={'$and':[db['sequelize'][_0xdfe6('0x3d')](db['sequelize']['fn'](_0xdfe6('0x5c'),db[_0xdfe6('0x5d')][_0xdfe6('0x5e')](_0xdfe6('0x4d'))),_0x4fc25e[_0xdfe6('0x2f')][_0xdfe6('0x5f')])]};if(_0x4fc25e[_0xdfe6('0x2f')][_0xdfe6('0x3f')]&&_0x4fc25e['query']['type']===_0xdfe6('0x4d')){_0x2857f4[_0xdfe6('0x60')][_0xdfe6('0x61')]({'uniqueid':_0x4fc25e[_0xdfe6('0x48')]['id']});}else{_0x2857f4[_0xdfe6('0x60')][_0xdfe6('0x61')]({'id':_0x4fc25e[_0xdfe6('0x48')]['id']});}return db[_0xdfe6('0x2b')][_0xdfe6('0x4b')]({'where':_0x2857f4,'attributes':['id',_0xdfe6('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x36fc3c,null))[_0xdfe6('0x24')](function(_0x44adb8){if(_0x44adb8){var _0x36f573=util[_0xdfe6('0x62')](_0xdfe6('0x4f'),_0x44adb8[_0xdfe6('0x4e')]);if(fs[_0xdfe6('0x50')](_0x36f573)){_0x198ec0=!![];return _0x5e2059[_0xdfe6('0x51')](_0x36f573,_0x44adb8['value'],config[_0xdfe6('0x52')]['recording'])[_0xdfe6('0x24')](function(){return _0x44adb8;});}return _0x44adb8;}})[_0xdfe6('0x24')](function(_0x5a3766){if(_0x5a3766){if(!fs['existsSync'](_0x5a3766[_0xdfe6('0x4e')])){throw new db[(_0xdfe6('0x53'))][(_0xdfe6('0x54'))](_0xdfe6('0x55'));}if(_0x5a3766[_0xdfe6('0x56')]){return _0x36fc3c[_0xdfe6('0x57')](_0x5a3766['value'],_0x5a3766['filename']+path[_0xdfe6('0x58')](_0x5a3766[_0xdfe6('0x4e')]),function(){if(_0x198ec0){fs['unlink'](_0x5a3766[_0xdfe6('0x4e')]);}});}else{return _0x36fc3c[_0xdfe6('0x57')](_0x5a3766[_0xdfe6('0x4e')],function(_0x2167a0){if(_0x198ec0){fs['unlink'](_0x5a3766['value']);}});}}})[_0xdfe6('0x46')](handleError(_0x36fc3c,null));};exports[_0xdfe6('0x23')]=function(_0x40269c,_0x4ccc24){return db[_0xdfe6('0x2b')]['find']({'where':{'id':_0x40269c['params']['id']}})['then'](function(_0x2b232e){if(_[_0xdfe6('0x63')](_0x2b232e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2b232e;})['then'](function(_0x186aef){var _0xe8dd78=_0x186aef[_0xdfe6('0x4e')];logger[_0xdfe6('0x64')](_0xdfe6('0x65'),_0xe8dd78);if(!_['isNil'](_0x186aef[_0xdfe6('0x4e')])&&fs[_0xdfe6('0x50')](_0xe8dd78)){logger['info'](_0xdfe6('0x66')+_0xe8dd78+_0xdfe6('0x67'));fs[_0xdfe6('0x68')](_0xe8dd78);}_0xe8dd78=_0xe8dd78+_0xdfe6('0x69');if(!_['isNil'](_0x186aef[_0xdfe6('0x4e')])&&fs[_0xdfe6('0x50')](_0xe8dd78)){logger['info'](_0xdfe6('0x66')+_0xe8dd78+_0xdfe6('0x67'));fs[_0xdfe6('0x68')](_0xe8dd78);}return _0x186aef;})[_0xdfe6('0x24')](function(_0x2c3b10){if(!_0x2c3b10)throw new InternalError();return _0x2c3b10[_0xdfe6('0x23')]();})[_0xdfe6('0x24')](function(){_0x4ccc24[_0xdfe6('0x1b')](0xcc)['end']();})[_0xdfe6('0x46')](handleError(_0x4ccc24,null));};function getBucketslist(_0x1147d5,_0x1befb8,_0x2a3f2a){return new Promise(function(_0x36cad0,_0xcb43ee){var _0x1cde8d=new AWS['S3']({'accessKeyId':_0x1befb8,'secretAccessKey':_0x1147d5,'region':_0x2a3f2a});_0x1cde8d[_0xdfe6('0x6a')]({},function(_0x57d772,_0x48c891){if(_0x57d772){return _0xcb43ee(_0x57d772);}else{return _0x36cad0(_0x48c891);}});});}function createBucket(_0x4b3dd2,_0x5a4bc8,_0x38fc18,_0x314c9a){return new Promise(function(_0x59cc80,_0xa64815){var _0x450571=new AWS['S3']({'accessKeyId':_0x5a4bc8,'secretAccessKey':_0x4b3dd2,'region':_0x38fc18});_0x450571[_0xdfe6('0x6b')]({'Bucket':_0x314c9a},function(_0x185b65,_0x4b87ad){if(_0x185b65){return _0xa64815(_0x185b65);}else{return _0x59cc80(_0x4b87ad);}});});}function uploadFile(_0x836d1d,_0x136ee3,_0x138ab6,_0x1216c3,_0x55bed2,_0x2ef227){return new Promise(function(_0x1be796,_0x117f8f){var _0x5c1919=new AWS['S3']({'accessKeyId':_0x136ee3,'secretAccessKey':_0x836d1d,'region':_0x138ab6});_0x5c1919[_0xdfe6('0x6c')]({'Bucket':_0x1216c3,'Key':_0x55bed2,'Body':_0x2ef227},function(_0x3461c8,_0x40caab){if(_0x3461c8){return _0x117f8f(_0x3461c8);}else{return _0x1be796(_0x40caab);}});});}function startTranscribe(_0x11d36a,_0x3cbd3e,_0x5390ca,_0x1e3d54,_0x322703,_0x5a5500){return new Promise(function(_0x10e3a2,_0x86ce28){var _0x2abe3b=new AWS[(_0xdfe6('0x6d'))]({'accessKeyId':_0x3cbd3e,'secretAccessKey':_0x11d36a,'region':_0x5390ca});_0x2abe3b[_0xdfe6('0x6e')]({'TranscriptionJobName':_0x1e3d54,'LanguageCode':_0x322703,'Media':{'MediaFileUri':_0x5a5500}},function(_0x359ad8,_0x4588e9){if(_0x359ad8){return _0x86ce28(_0x359ad8);}else{return _0x10e3a2(_0x4588e9);}});});}function transcribe(_0x3413fb,_0x1a33b8,_0x55ada4,_0x575dcc,_0x3c554d,_0x23be57,_0x5ce07d){return new Promise(function(_0x2fe0be,_0x3039e4){var _0x41c029={};logger[_0xdfe6('0x64')](util[_0xdfe6('0x62')](_0xdfe6('0x6f'),_0x3413fb,_0x3c554d));return uploadFile(_0x1a33b8,_0x55ada4,_0x575dcc,_0x3c554d,path['basename'](_0x23be57),fs[_0xdfe6('0x70')](_0x23be57))[_0xdfe6('0x24')](function(_0x53f5c5){logger[_0xdfe6('0x64')](util[_0xdfe6('0x62')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x3413fb,_0x3c554d,_0x53f5c5['Location']));_0x41c029[_0xdfe6('0x71')]=_0x53f5c5['Bucket'];_0x41c029[_0xdfe6('0x72')]=_0x53f5c5['Location'];logger[_0xdfe6('0x64')](util[_0xdfe6('0x62')](_0xdfe6('0x73'),_0x3413fb));return startTranscribe(_0x1a33b8,_0x55ada4,_0x575dcc,uuidv4(),_0x5ce07d,_0x53f5c5[_0xdfe6('0x74')]);})[_0xdfe6('0x24')](function(_0x15a1d7){logger[_0xdfe6('0x64')](util[_0xdfe6('0x62')](_0xdfe6('0x75'),_0x3413fb,_0x15a1d7[_0xdfe6('0x76')][_0xdfe6('0x77')]));_0x41c029['transcribeName']=_0x15a1d7['TranscriptionJob']['TranscriptionJobName'];_0x41c029['transcribeStatus']=_0x15a1d7['TranscriptionJob'][_0xdfe6('0x78')];return _0x2fe0be(_0x41c029);})[_0xdfe6('0x46')](function(_0x910c0f){return _0x3039e4(_0x910c0f);});});}exports[_0xdfe6('0x79')]=function(_0xf9a04e,_0x3ffc43,_0x1cf172){var _0x3a0615;var _0x38ad27;var _0x47940a;var _0x1fb856=require(_0xdfe6('0x4c'));return db[_0xdfe6('0x2b')][_0xdfe6('0x7a')]({'where':{'id':_0xf9a04e[_0xdfe6('0x48')]['id']}})[_0xdfe6('0x24')](function(_0x3040cb){if(_0x3040cb){var _0x5645c1=util[_0xdfe6('0x62')](_0xdfe6('0x4f'),_0x3040cb['value']);if(fs[_0xdfe6('0x50')](_0x5645c1)){cypher=!![];return _0x1fb856[_0xdfe6('0x51')](_0x5645c1,_0x3040cb[_0xdfe6('0x4e')],config[_0xdfe6('0x52')][_0xdfe6('0x7b')])[_0xdfe6('0x24')](function(){return _0x3040cb;});}return _0x3040cb;}})[_0xdfe6('0x24')](function(_0x2b9b0b){if(!_0x2b9b0b){throw new db['Sequelize'][(_0xdfe6('0x54'))](_0xdfe6('0x7c'));}_0x38ad27=_0x2b9b0b;return db['Setting'][_0xdfe6('0x7a')]({'where':{'id':0x1}});})[_0xdfe6('0x24')](handleEntityNotFound(_0x3ffc43,null))[_0xdfe6('0x24')](function(_0x20368e){if(_0x20368e){_0x3a0615=_0x20368e;if(!_0x3a0615['transcribe']||!_0x3a0615[_0xdfe6('0x7d')]||!_0x3a0615[_0xdfe6('0x7e')]||!_0x3a0615[_0xdfe6('0x7f')]||!_0x3a0615['bucket']){throw new db['Sequelize'][(_0xdfe6('0x54'))](_0xdfe6('0x80'));}if(_0xf9a04e['body'][_0xdfe6('0x81')]&&(!_0x3a0615[_0xdfe6('0x82')]||!_0x3a0615[_0xdfe6('0x83')]||!_0x3a0615[_0xdfe6('0x84')]||!_0x3a0615[_0xdfe6('0x7f')]||!_0x3a0615[_0xdfe6('0x71')])){throw new db[(_0xdfe6('0x53'))][(_0xdfe6('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xdfe6('0x85')][_0xdfe6('0x7a')]({'where':{'id':_0x3a0615[_0xdfe6('0x7d')]}});}})[_0xdfe6('0x24')](function(_0x1db75d){if(!_0x1db75d){throw new db['Sequelize'][(_0xdfe6('0x54'))](_0xdfe6('0x86'));}if(!_0x1db75d[_0xdfe6('0x87')]||!_0x1db75d[_0xdfe6('0x88')]){throw new db[(_0xdfe6('0x53'))][(_0xdfe6('0x54'))](_0xdfe6('0x89'));}_0x47940a=_0x1db75d;return getBucketslist(_0x47940a[_0xdfe6('0x87')],_0x47940a[_0xdfe6('0x88')],_0x3a0615[_0xdfe6('0x7e')]);})[_0xdfe6('0x24')](function(_0x3b7af5){if(_0x3b7af5&&_0x3b7af5[_0xdfe6('0x8a')]){var _0x4aea2c=_[_0xdfe6('0x4b')](_0x3b7af5[_0xdfe6('0x8a')],function(_0x3348ec){return _0x3348ec['Name']===_0x3a0615[_0xdfe6('0x71')];});if(!_0x4aea2c){logger['info'](util['format'](_0xdfe6('0x8b'),_0xf9a04e[_0xdfe6('0x48')]['id'],_0x3a0615[_0xdfe6('0x71')]));return createBucket(_0x47940a[_0xdfe6('0x87')],_0x47940a[_0xdfe6('0x88')],_0x3a0615[_0xdfe6('0x7e')],_0x3a0615['bucket']);}logger['info'](util[_0xdfe6('0x62')](_0xdfe6('0x8c'),_0xf9a04e['params']['id'],_0x3a0615[_0xdfe6('0x71')]));return;}})[_0xdfe6('0x24')](function(_0xc0c763){if(_0x38ad27[_0xdfe6('0x8d')]==='NEW'){return transcribe(_0xf9a04e[_0xdfe6('0x48')]['id'],_0x47940a['data1'],_0x47940a[_0xdfe6('0x88')],_0x3a0615[_0xdfe6('0x7e')],_0x3a0615[_0xdfe6('0x71')],_0x38ad27[_0xdfe6('0x4e')],_0x3a0615['language']);}else{logger[_0xdfe6('0x64')](util[_0xdfe6('0x62')](_0xdfe6('0x8e'),_0xf9a04e['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xdfe6('0x24')](function(_0x17f5d6){if(_0x17f5d6){_0x17f5d6[_0xdfe6('0x8f')]=_0xf9a04e[_0xdfe6('0x4a')][_0xdfe6('0x81')];return _0x38ad27[_0xdfe6('0x90')](_0x17f5d6);}})[_0xdfe6('0x24')](respondWithResult(_0x3ffc43,null))[_0xdfe6('0x46')](handleError(_0x3ffc43,null));};function writeFile(_0x3011cd,_0x270efb){return new Promise(function(_0x1af46b,_0xe89f30){fs[_0xdfe6('0x91')](_0x270efb,_0x3011cd,function(_0x20e327,_0x21a96d){if(_0x20e327){return _0xe89f30(_0x20e327);}else{return _0x1af46b(_0x21a96d);}});});}exports['downloadTranscribe']=function(_0x33eb93,_0x9dff68,_0x9c0d7a){return db['VoiceRecording']['findOne']({'where':{'id':_0x33eb93[_0xdfe6('0x48')]['id']}})[_0xdfe6('0x24')](handleEntityNotFound(_0x9dff68))['then'](function(_0x49ba0c){if(_0x49ba0c&&_0x49ba0c[_0xdfe6('0x92')]){var _0x24831f=_0x49ba0c[_0xdfe6('0x92')];var _0x40dde9=config[_0xdfe6('0x93')]+_0xdfe6('0x94')+_0x49ba0c['id']+_0xdfe6('0x95');if(fs[_0xdfe6('0x50')](_0x40dde9)){return _0x40dde9;}return writeFile(_0x24831f,_0x40dde9)[_0xdfe6('0x24')](function(){return _0x40dde9;});}else{throw new db['Sequelize']['ValidationError'](_0xdfe6('0x96'));}})[_0xdfe6('0x24')](function(_0x4fec64){return _0x9dff68['download'](_0x4fec64);})['catch'](handleError(_0x9dff68));};
\ No newline at end of file
+var _0x91a8=['downloadTranscribe','fileText','root','.txt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','stack','name','send','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','format','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','downloads','sequelize','MD5','col','$and','push','secrets','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','createBucket','upload','[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','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile'];(function(_0x3a67a2,_0x2d118a){var _0x140acb=function(_0x191765){while(--_0x191765){_0x3a67a2['push'](_0x3a67a2['shift']());}};_0x140acb(++_0x2d118a);}(_0x91a8,0x9f));var _0x891a=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x91a8[_0x220dbb];return _0x2b77de;};'use strict';var emlformat=require(_0x891a('0x0'));var rimraf=require(_0x891a('0x1'));var zipdir=require(_0x891a('0x2'));var jsonpatch=require(_0x891a('0x3'));var rp=require('request-promise');var moment=require(_0x891a('0x4'));var BPromise=require(_0x891a('0x5'));var Mustache=require(_0x891a('0x6'));var util=require(_0x891a('0x7'));var path=require(_0x891a('0x8'));var sox=require(_0x891a('0x9'));var csv=require(_0x891a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x891a('0xb'));var _=require(_0x891a('0xc'));var squel=require('squel');var crypto=require(_0x891a('0xd'));var jsforce=require(_0x891a('0xe'));var deskjs=require(_0x891a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x891a('0x10'));var Papa=require(_0x891a('0x11'));var AWS=require(_0x891a('0x12'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x891a('0x13'));var qs=require(_0x891a('0x14'));var as=require(_0x891a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x891a('0x16'))(_0x891a('0x17'));var utils=require(_0x891a('0x18'));var config=require(_0x891a('0x19'));var licenseUtil=require(_0x891a('0x1a'));var db=require(_0x891a('0x1b'))['db'];function respondWithStatusCode(_0x26cac6,_0x4b6457){_0x4b6457=_0x4b6457||0xcc;return function(_0x1fc4e1){if(_0x1fc4e1){return _0x26cac6['sendStatus'](_0x4b6457);}return _0x26cac6[_0x891a('0x1c')](_0x4b6457)['end']();};}function respondWithResult(_0x1b372d,_0x427db5){_0x427db5=_0x427db5||0xc8;return function(_0xaff657){if(_0xaff657){return _0x1b372d[_0x891a('0x1c')](_0x427db5)[_0x891a('0x1d')](_0xaff657);}};}function respondWithFilteredResult(_0x49abdb,_0x1eccd9){return function(_0x1b5a28){if(_0x1b5a28){var _0x4913de=typeof _0x1eccd9[_0x891a('0x1e')]==='undefined'&&typeof _0x1eccd9[_0x891a('0x1f')]===_0x891a('0x20');var _0x1e13e8=_0x1b5a28[_0x891a('0x21')];var _0x54a0f3=_0x4913de?0x0:_0x1eccd9[_0x891a('0x1e')];var _0x329a83=_0x4913de?_0x1b5a28['count']:_0x1eccd9[_0x891a('0x1e')]+_0x1eccd9['limit'];var _0x25e21c;if(_0x329a83>=_0x1e13e8){_0x329a83=_0x1e13e8;_0x25e21c=0xc8;}else{_0x25e21c=0xce;}_0x49abdb[_0x891a('0x1c')](_0x25e21c);return _0x49abdb[_0x891a('0x22')](_0x891a('0x23'),_0x54a0f3+'-'+_0x329a83+'/'+_0x1e13e8)[_0x891a('0x1d')](_0x1b5a28);}return null;};}function patchUpdates(_0x1acd88){return function(_0x20c15a){try{jsonpatch[_0x891a('0x24')](_0x20c15a,_0x1acd88,!![]);}catch(_0x59e6b2){return BPromise[_0x891a('0x25')](_0x59e6b2);}return _0x20c15a['save']();};}function saveUpdates(_0xd1302a,_0x4adad3){return function(_0x1c7188){if(_0x1c7188){return _0x1c7188[_0x891a('0x26')](_0xd1302a)[_0x891a('0x27')](function(_0x2bf6d4){return _0x2bf6d4;});}return null;};}function removeEntity(_0x15c251,_0x548315){return function(_0x2a6d6a){if(_0x2a6d6a){return _0x2a6d6a[_0x891a('0x28')]()[_0x891a('0x27')](function(){_0x15c251[_0x891a('0x1c')](0xcc)[_0x891a('0x29')]();});}};}function handleEntityNotFound(_0x51f4c6,_0x4102ab){return function(_0x2c6f24){if(!_0x2c6f24){_0x51f4c6[_0x891a('0x2a')](0x194);}return _0x2c6f24;};}function handleError(_0x33b455,_0x25c5c6){_0x25c5c6=_0x25c5c6||0x1f4;return function(_0x420d95){logger['error'](_0x420d95[_0x891a('0x2b')]);if(_0x420d95[_0x891a('0x2c')]){delete _0x420d95['name'];}_0x33b455[_0x891a('0x1c')](_0x25c5c6)[_0x891a('0x2d')](_0x420d95);};}exports['index']=function(_0x42e785,_0x2d1469){var _0x3d8738={},_0x16d957={},_0x2a3955={'count':0x0,'rows':[]};var _0x3b844a=_['map'](db[_0x891a('0x2e')][_0x891a('0x2f')],function(_0x4993a1){return{'name':_0x4993a1[_0x891a('0x30')],'type':_0x4993a1[_0x891a('0x31')][_0x891a('0x32')]};});_0x16d957[_0x891a('0x33')]=_[_0x891a('0x34')](_[_0x891a('0x35')](_0x3b844a,_0x891a('0x2c')),[_0x891a('0x36')]);_0x16d957[_0x891a('0x37')]=_[_0x891a('0x38')](_0x42e785[_0x891a('0x37')]);_0x16d957[_0x891a('0x39')]=_[_0x891a('0x3a')](_0x16d957[_0x891a('0x33')],_0x16d957[_0x891a('0x37')]);_0x3d8738['attributes']=_[_0x891a('0x3a')](_0x16d957['model'],qs[_0x891a('0x3b')](_0x42e785['query'][_0x891a('0x3b')]));_0x3d8738['attributes']=_0x3d8738['attributes'][_0x891a('0x3c')]?_0x3d8738[_0x891a('0x3d')]:_0x16d957[_0x891a('0x33')];if(!_0x42e785[_0x891a('0x37')][_0x891a('0x3e')](_0x891a('0x3f'))){_0x3d8738[_0x891a('0x1f')]=qs['limit'](_0x42e785[_0x891a('0x37')][_0x891a('0x1f')]);_0x3d8738[_0x891a('0x1e')]=qs[_0x891a('0x1e')](_0x42e785[_0x891a('0x37')][_0x891a('0x1e')]);}_0x3d8738[_0x891a('0x40')]=qs['sort'](_0x42e785[_0x891a('0x37')][_0x891a('0x41')]);_0x3d8738['where']=qs[_0x891a('0x39')](_['pick'](_0x42e785[_0x891a('0x37')],_0x16d957[_0x891a('0x39')]),_0x3b844a);if(_0x42e785[_0x891a('0x37')][_0x891a('0x42')]){_0x3d8738[_0x891a('0x43')]=_['merge'](_0x3d8738[_0x891a('0x43')],{'$or':_[_0x891a('0x35')](_0x3b844a,function(_0x2d7810){if(_0x2d7810[_0x891a('0x31')]!==_0x891a('0x44')){var _0x21b552={};_0x21b552[_0x2d7810['name']]={'$like':'%'+_0x42e785['query']['filter']+'%'};return _0x21b552;}})});}_0x3d8738=_['merge']({},_0x3d8738,_0x42e785[_0x891a('0x45')]);var _0x4cf090={'where':_0x3d8738[_0x891a('0x43')]};return db['VoiceRecording'][_0x891a('0x21')](_0x4cf090)[_0x891a('0x27')](function(_0x332799){_0x2a3955[_0x891a('0x21')]=_0x332799;if(_0x42e785[_0x891a('0x37')][_0x891a('0x46')]){_0x3d8738['include']=[{'all':!![]}];}return db[_0x891a('0x2e')][_0x891a('0x47')](_0x3d8738);})[_0x891a('0x27')](function(_0x7e96af){_0x2a3955['rows']=_0x7e96af;return _0x2a3955;})[_0x891a('0x27')](respondWithFilteredResult(_0x2d1469,_0x3d8738))[_0x891a('0x48')](handleError(_0x2d1469,null));};exports[_0x891a('0x49')]=function(_0x1fbddf,_0x5cbe2b){var _0x36ad6a={'raw':![],'where':{'id':_0x1fbddf[_0x891a('0x4a')]['id']}},_0x6a91b5={};_0x6a91b5[_0x891a('0x33')]=_[_0x891a('0x38')](db[_0x891a('0x2e')][_0x891a('0x2f')]);_0x6a91b5[_0x891a('0x37')]=_[_0x891a('0x38')](_0x1fbddf[_0x891a('0x37')]);_0x6a91b5[_0x891a('0x39')]=_[_0x891a('0x3a')](_0x6a91b5[_0x891a('0x33')],_0x6a91b5[_0x891a('0x37')]);_0x36ad6a[_0x891a('0x3d')]=_['intersection'](_0x6a91b5[_0x891a('0x33')],qs[_0x891a('0x3b')](_0x1fbddf[_0x891a('0x37')]['fields']));_0x36ad6a[_0x891a('0x3d')]=_0x36ad6a['attributes']['length']?_0x36ad6a[_0x891a('0x3d')]:_0x6a91b5[_0x891a('0x33')];if(_0x1fbddf[_0x891a('0x37')][_0x891a('0x46')]){_0x36ad6a[_0x891a('0x4b')]=[{'all':!![]}];}_0x36ad6a=_['merge']({},_0x36ad6a,_0x1fbddf[_0x891a('0x45')]);return db[_0x891a('0x2e')][_0x891a('0x4c')](_0x36ad6a)['then'](handleEntityNotFound(_0x5cbe2b,null))[_0x891a('0x27')](respondWithResult(_0x5cbe2b,null))[_0x891a('0x48')](handleError(_0x5cbe2b,null));};exports[_0x891a('0x4d')]=function(_0x4fbb31,_0xa2bce7){return db[_0x891a('0x2e')]['create'](_0x4fbb31[_0x891a('0x4e')],{})[_0x891a('0x27')](respondWithResult(_0xa2bce7,0xc9))[_0x891a('0x48')](handleError(_0xa2bce7,null));};exports[_0x891a('0x26')]=function(_0x230b1e,_0x582251){if(_0x230b1e[_0x891a('0x4e')]['id']){delete _0x230b1e[_0x891a('0x4e')]['id'];}return db[_0x891a('0x2e')][_0x891a('0x4c')]({'where':{'id':_0x230b1e[_0x891a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582251,null))[_0x891a('0x27')](saveUpdates(_0x230b1e[_0x891a('0x4e')],null))['then'](respondWithResult(_0x582251,null))[_0x891a('0x48')](handleError(_0x582251,null));};exports[_0x891a('0x4f')]=function(_0x18255e,_0x1146dd){return db['VoiceRecording']['describe']()['then'](respondWithResult(_0x1146dd,null))[_0x891a('0x48')](handleError(_0x1146dd,null));};exports['download']=function(_0x42f112,_0x5d8292,_0x2b4a96){var _0x55ee2f=require(_0x891a('0x50'));var _0x5aaeb6=![];var _0x3fe795={};if(_0x42f112[_0x891a('0x37')][_0x891a('0x31')]&&_0x42f112[_0x891a('0x37')][_0x891a('0x31')]===_0x891a('0x51')){_0x3fe795[_0x891a('0x51')]=_0x42f112[_0x891a('0x4a')]['id'];}else{_0x3fe795['id']=_0x42f112[_0x891a('0x4a')]['id'];}return db['VoiceRecording'][_0x891a('0x4c')]({'where':_0x3fe795,'attributes':['id',_0x891a('0x52')],'raw':!![]})[_0x891a('0x27')](handleEntityNotFound(_0x5d8292,null))[_0x891a('0x27')](function(_0x6c9d02){if(_0x6c9d02){var _0x548c14=_0x6c9d02['value'];var _0x5acecd=util[_0x891a('0x36')](_0x891a('0x53'),_0x548c14);if(fs[_0x891a('0x54')](_0x5acecd)){_0x5aaeb6=!![];return _0x55ee2f[_0x891a('0x55')](_0x5acecd,_0x548c14,config['secrets'][_0x891a('0x56')])['then'](function(){return _0x6c9d02;});}return _0x6c9d02;}})[_0x891a('0x27')](function(_0x49f500){if(_0x49f500){var _0x4153ad=_0x49f500[_0x891a('0x52')];if(!fs[_0x891a('0x54')](_0x4153ad)){throw new db[(_0x891a('0x57'))][(_0x891a('0x58'))](_0x891a('0x59'));}if(_0x49f500[_0x891a('0x5a')]){return _0x5d8292[_0x891a('0x5b')](_0x4153ad,_0x49f500['filename']+path[_0x891a('0x5c')](_0x4153ad),function(){if(_0x5aaeb6){fs[_0x891a('0x5d')](_0x4153ad);}});}else{return _0x5d8292['download'](_0x4153ad,function(_0x13e7e8){if(_0x5aaeb6){fs[_0x891a('0x5d')](_0x4153ad);}});}}})[_0x891a('0x48')](function(_0x3607ad){if(_0x3607ad[_0x891a('0x5e')]===_0x891a('0x59')){_0x5d8292[_0x891a('0x1c')](0x194)[_0x891a('0x2d')]('Not\x20found');}else{return handleError(_0x5d8292,null);}});};exports[_0x891a('0x5f')]=function(_0x1c83fa,_0x1ac0a2,_0x545ce9){var _0x16eb16=require(_0x891a('0x50'));var _0x49ec7e=![];var _0x5c47f7={'$and':[db[_0x891a('0x60')][_0x891a('0x43')](db[_0x891a('0x60')]['fn'](_0x891a('0x61'),db['sequelize'][_0x891a('0x62')]('uniqueid')),_0x1c83fa[_0x891a('0x37')]['token'])]};if(_0x1c83fa[_0x891a('0x37')][_0x891a('0x31')]&&_0x1c83fa[_0x891a('0x37')][_0x891a('0x31')]===_0x891a('0x51')){_0x5c47f7[_0x891a('0x63')][_0x891a('0x64')]({'uniqueid':_0x1c83fa[_0x891a('0x4a')]['id']});}else{_0x5c47f7[_0x891a('0x63')][_0x891a('0x64')]({'id':_0x1c83fa[_0x891a('0x4a')]['id']});}return db[_0x891a('0x2e')][_0x891a('0x4c')]({'where':_0x5c47f7,'attributes':['id',_0x891a('0x52')],'raw':!![]})[_0x891a('0x27')](handleEntityNotFound(_0x1ac0a2,null))[_0x891a('0x27')](function(_0x4c38f1){if(_0x4c38f1){var _0x34436a=util[_0x891a('0x36')](_0x891a('0x53'),_0x4c38f1[_0x891a('0x52')]);if(fs[_0x891a('0x54')](_0x34436a)){_0x49ec7e=!![];return _0x16eb16[_0x891a('0x55')](_0x34436a,_0x4c38f1[_0x891a('0x52')],config[_0x891a('0x65')]['recording'])['then'](function(){return _0x4c38f1;});}return _0x4c38f1;}})[_0x891a('0x27')](function(_0x110a7f){if(_0x110a7f){if(!fs[_0x891a('0x54')](_0x110a7f[_0x891a('0x52')])){throw new db[(_0x891a('0x57'))][(_0x891a('0x58'))](_0x891a('0x59'));}if(_0x110a7f[_0x891a('0x5a')]){return _0x1ac0a2[_0x891a('0x5b')](_0x110a7f[_0x891a('0x52')],_0x110a7f[_0x891a('0x5a')]+path[_0x891a('0x5c')](_0x110a7f[_0x891a('0x52')]),function(){if(_0x49ec7e){fs[_0x891a('0x5d')](_0x110a7f[_0x891a('0x52')]);}});}else{return _0x1ac0a2['download'](_0x110a7f['value'],function(_0x2aae19){if(_0x49ec7e){fs[_0x891a('0x5d')](_0x110a7f[_0x891a('0x52')]);}});}}})[_0x891a('0x48')](handleError(_0x1ac0a2,null));};exports['destroy']=function(_0x510eb,_0x1249aa){return db[_0x891a('0x2e')]['find']({'where':{'id':_0x510eb[_0x891a('0x4a')]['id']}})[_0x891a('0x27')](function(_0x356188){if(_[_0x891a('0x66')](_0x356188)){throw new ReferenceError(_0x891a('0x67'));}return _0x356188;})['then'](function(_0x44259e){var _0x2e638=_0x44259e['value'];logger[_0x891a('0x68')](_0x891a('0x69'),_0x2e638);if(!_['isNil'](_0x44259e[_0x891a('0x52')])&&fs[_0x891a('0x54')](_0x2e638)){logger['info'](_0x891a('0x6a')+_0x2e638+_0x891a('0x6b'));fs['unlinkSync'](_0x2e638);}_0x2e638=_0x2e638+_0x891a('0x6c');if(!_[_0x891a('0x66')](_0x44259e[_0x891a('0x52')])&&fs[_0x891a('0x54')](_0x2e638)){logger[_0x891a('0x68')]('File:\x20\x22'+_0x2e638+_0x891a('0x6b'));fs['unlinkSync'](_0x2e638);}return _0x44259e;})[_0x891a('0x27')](function(_0x77371c){if(!_0x77371c)throw new InternalError();return _0x77371c[_0x891a('0x28')]();})['then'](function(){_0x1249aa[_0x891a('0x1c')](0xcc)[_0x891a('0x29')]();})['catch'](handleError(_0x1249aa,null));};function getBucketslist(_0x2fbea5,_0x201a8c,_0x22e56e){return new Promise(function(_0x16417b,_0x4067b9){var _0x5ddcf8=new AWS['S3']({'accessKeyId':_0x201a8c,'secretAccessKey':_0x2fbea5,'region':_0x22e56e});_0x5ddcf8['listBuckets']({},function(_0x5bc7f1,_0x152a6c){if(_0x5bc7f1){return _0x4067b9(_0x5bc7f1);}else{return _0x16417b(_0x152a6c);}});});}function createBucket(_0x4b2b2c,_0x2db4ec,_0x1cbe3d,_0x106cdb){return new Promise(function(_0x3f5592,_0x2a8eb1){var _0x49f2d4=new AWS['S3']({'accessKeyId':_0x2db4ec,'secretAccessKey':_0x4b2b2c,'region':_0x1cbe3d});_0x49f2d4[_0x891a('0x6d')]({'Bucket':_0x106cdb},function(_0x166f95,_0x8af82c){if(_0x166f95){return _0x2a8eb1(_0x166f95);}else{return _0x3f5592(_0x8af82c);}});});}function uploadFile(_0x3f2d42,_0x51a779,_0x4b80ba,_0x455557,_0x361b76,_0xa0602a){return new Promise(function(_0xd0d312,_0xa3279f){var _0x2d02f1=new AWS['S3']({'accessKeyId':_0x51a779,'secretAccessKey':_0x3f2d42,'region':_0x4b80ba});_0x2d02f1[_0x891a('0x6e')]({'Bucket':_0x455557,'Key':_0x361b76,'Body':_0xa0602a},function(_0x77f720,_0x2cb5d7){if(_0x77f720){return _0xa3279f(_0x77f720);}else{return _0xd0d312(_0x2cb5d7);}});});}function startTranscribe(_0x133c03,_0x158697,_0x221c09,_0x2776e1,_0x40d870,_0x275a79){return new Promise(function(_0x2bcc86,_0xc9277){var _0x20926a=new AWS['TranscribeService']({'accessKeyId':_0x158697,'secretAccessKey':_0x133c03,'region':_0x221c09});_0x20926a['startTranscriptionJob']({'TranscriptionJobName':_0x2776e1,'LanguageCode':_0x40d870,'Media':{'MediaFileUri':_0x275a79}},function(_0x5631e0,_0x288e63){if(_0x5631e0){return _0xc9277(_0x5631e0);}else{return _0x2bcc86(_0x288e63);}});});}function transcribe(_0x5ec59e,_0x51e427,_0x3e4c02,_0x4b0476,_0xffd5c3,_0xedac24,_0xbcee62){return new Promise(function(_0x46e58f,_0x41d68d){var _0x20b6ab={};logger['info'](util['format'](_0x891a('0x6f'),_0x5ec59e,_0xffd5c3));return uploadFile(_0x51e427,_0x3e4c02,_0x4b0476,_0xffd5c3,path[_0x891a('0x70')](_0xedac24),fs[_0x891a('0x71')](_0xedac24))[_0x891a('0x27')](function(_0x4d738b){logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x72'),_0x5ec59e,_0xffd5c3,_0x4d738b[_0x891a('0x73')]));_0x20b6ab[_0x891a('0x74')]=_0x4d738b['Bucket'];_0x20b6ab[_0x891a('0x75')]=_0x4d738b[_0x891a('0x73')];logger[_0x891a('0x68')](util['format'](_0x891a('0x76'),_0x5ec59e));return startTranscribe(_0x51e427,_0x3e4c02,_0x4b0476,uuidv4(),_0xbcee62,_0x4d738b['Location']);})['then'](function(_0x3c85ed){logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x77'),_0x5ec59e,_0x3c85ed[_0x891a('0x78')][_0x891a('0x79')]));_0x20b6ab[_0x891a('0x7a')]=_0x3c85ed['TranscriptionJob'][_0x891a('0x79')];_0x20b6ab['transcribeStatus']=_0x3c85ed[_0x891a('0x78')][_0x891a('0x7b')];return _0x46e58f(_0x20b6ab);})['catch'](function(_0x1972ef){return _0x41d68d(_0x1972ef);});});}exports[_0x891a('0x7c')]=function(_0x13ca2c,_0x458ed1,_0x584c3b){var _0x4707b7;var _0x1e0bb4;var _0xd18397;var _0x31ccac=require(_0x891a('0x50'));return db[_0x891a('0x2e')][_0x891a('0x7d')]({'where':{'id':_0x13ca2c[_0x891a('0x4a')]['id']}})['then'](function(_0x426714){if(_0x426714){var _0x5472e0=util[_0x891a('0x36')](_0x891a('0x53'),_0x426714['value']);if(fs[_0x891a('0x54')](_0x5472e0)){cypher=!![];return _0x31ccac['decryptFile'](_0x5472e0,_0x426714[_0x891a('0x52')],config['secrets'][_0x891a('0x56')])[_0x891a('0x27')](function(){return _0x426714;});}return _0x426714;}})['then'](function(_0x49a4e5){if(!_0x49a4e5){throw new db[(_0x891a('0x57'))][(_0x891a('0x58'))]('Voice\x20Recording\x20not\x20found');}_0x1e0bb4=_0x49a4e5;return db[_0x891a('0x7e')][_0x891a('0x7d')]({'where':{'id':0x1}});})[_0x891a('0x27')](handleEntityNotFound(_0x458ed1,null))['then'](function(_0x36483c){if(_0x36483c){_0x4707b7=_0x36483c;if(!_0x4707b7[_0x891a('0x7f')]||!_0x4707b7[_0x891a('0x80')]||!_0x4707b7['transcribeRegion']||!_0x4707b7[_0x891a('0x81')]||!_0x4707b7[_0x891a('0x74')]){throw new db[(_0x891a('0x57'))][(_0x891a('0x58'))](_0x891a('0x82'));}if(_0x13ca2c[_0x891a('0x4e')][_0x891a('0x83')]&&(!_0x4707b7[_0x891a('0x84')]||!_0x4707b7[_0x891a('0x85')]||!_0x4707b7[_0x891a('0x86')]||!_0x4707b7[_0x891a('0x81')]||!_0x4707b7[_0x891a('0x74')])){throw new db[(_0x891a('0x57'))]['ValidationError'](_0x891a('0x87'));}return db[_0x891a('0x88')]['findOne']({'where':{'id':_0x4707b7[_0x891a('0x80')]}});}})[_0x891a('0x27')](function(_0x2bfdbd){if(!_0x2bfdbd){throw new db[(_0x891a('0x57'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x2bfdbd[_0x891a('0x89')]||!_0x2bfdbd['data2']){throw new db[(_0x891a('0x57'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0xd18397=_0x2bfdbd;return getBucketslist(_0xd18397[_0x891a('0x89')],_0xd18397[_0x891a('0x8a')],_0x4707b7[_0x891a('0x8b')]);})['then'](function(_0x56fdfc){if(_0x56fdfc&&_0x56fdfc[_0x891a('0x8c')]){var _0x49eaac=_[_0x891a('0x4c')](_0x56fdfc[_0x891a('0x8c')],function(_0x31800c){return _0x31800c[_0x891a('0x8d')]===_0x4707b7[_0x891a('0x74')];});if(!_0x49eaac){logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x8e'),_0x13ca2c[_0x891a('0x4a')]['id'],_0x4707b7[_0x891a('0x74')]));return createBucket(_0xd18397[_0x891a('0x89')],_0xd18397[_0x891a('0x8a')],_0x4707b7[_0x891a('0x8b')],_0x4707b7[_0x891a('0x74')]);}logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x8f'),_0x13ca2c[_0x891a('0x4a')]['id'],_0x4707b7[_0x891a('0x74')]));return;}})['then'](function(_0x5c9dba){if(_0x1e0bb4[_0x891a('0x90')]===_0x891a('0x91')){return transcribe(_0x13ca2c['params']['id'],_0xd18397[_0x891a('0x89')],_0xd18397['data2'],_0x4707b7['transcribeRegion'],_0x4707b7[_0x891a('0x74')],_0x1e0bb4[_0x891a('0x52')],_0x4707b7[_0x891a('0x81')]);}else{logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x92'),_0x13ca2c[_0x891a('0x4a')]['id']));return{'transcribeStatus':_0x891a('0x93')};}})[_0x891a('0x27')](function(_0x3eaf62){if(_0x3eaf62){_0x3eaf62[_0x891a('0x94')]=_0x13ca2c[_0x891a('0x4e')][_0x891a('0x83')];return _0x1e0bb4[_0x891a('0x95')](_0x3eaf62);}})[_0x891a('0x27')](respondWithResult(_0x458ed1,null))[_0x891a('0x48')](handleError(_0x458ed1,null));};function writeFile(_0x120650,_0x13c842){return new Promise(function(_0x336520,_0x28a8bb){fs[_0x891a('0x96')](_0x13c842,_0x120650,function(_0x2bf144,_0x1860e0){if(_0x2bf144){return _0x28a8bb(_0x2bf144);}else{return _0x336520(_0x1860e0);}});});}exports[_0x891a('0x97')]=function(_0x416673,_0xbb34,_0x4ac386){return db[_0x891a('0x2e')][_0x891a('0x7d')]({'where':{'id':_0x416673[_0x891a('0x4a')]['id']}})[_0x891a('0x27')](handleEntityNotFound(_0xbb34))[_0x891a('0x27')](function(_0x1c58d3){if(_0x1c58d3&&_0x1c58d3[_0x891a('0x98')]){var _0x28852b=_0x1c58d3[_0x891a('0x98')];var _0x598ec6=config[_0x891a('0x99')]+'/server/files/transcribes/transcribe_'+_0x1c58d3['id']+_0x891a('0x9a');if(fs[_0x891a('0x54')](_0x598ec6)){return _0x598ec6;}return writeFile(_0x28852b,_0x598ec6)['then'](function(){return _0x598ec6;});}else{throw new db['Sequelize']['ValidationError']('Transcript\x20not\x20available');}})[_0x891a('0x27')](function(_0x284d9b){return _0xbb34[_0x891a('0x5b')](_0x284d9b);})[_0x891a('0x48')](handleError(_0xbb34));};
\ No newline at end of file
index e3f40d4..2757332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x756f=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x24bf8d,_0x1f1a74){var _0x275b6f=function(_0x40c2d5){while(--_0x40c2d5){_0x24bf8d['push'](_0x24bf8d['shift']());}};_0x275b6f(++_0x1f1a74);}(_0x756f,0x137));var _0xf756=function(_0x23c1d1,_0x1d66a7){_0x23c1d1=_0x23c1d1-0x0;var _0x44f853=_0x756f[_0x23c1d1];return _0x44f853;};'use strict';var _=require(_0xf756('0x0'));var util=require(_0xf756('0x1'));var logger=require(_0xf756('0x2'))(_0xf756('0x3'));var moment=require('moment');var BPromise=require(_0xf756('0x4'));var rp=require(_0xf756('0x5'));var fs=require('fs');var path=require(_0xf756('0x6'));var rimraf=require(_0xf756('0x7'));var config=require(_0xf756('0x8'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x1863b3,_0x4e82f0){return _0x1863b3[_0xf756('0x9')](_0xf756('0xa'),attributes,{'tableName':_0xf756('0xb'),'paranoid':![],'indexes':[{'name':_0xf756('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x39cd=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','util'];(function(_0x4d0416,_0x400341){var _0x5f3fa3=function(_0x53fa5c){while(--_0x53fa5c){_0x4d0416['push'](_0x4d0416['shift']());}};_0x5f3fa3(++_0x400341);}(_0x39cd,0x11c));var _0xd39c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x39cd[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd39c('0x0'));var util=require(_0xd39c('0x1'));var logger=require('../../config/logger')(_0xd39c('0x2'));var moment=require(_0xd39c('0x3'));var BPromise=require(_0xd39c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd39c('0x5'));var rimraf=require(_0xd39c('0x6'));var config=require(_0xd39c('0x7'));var attributes=require(_0xd39c('0x8'));module[_0xd39c('0x9')]=function(_0x293f9b,_0x6d6a1e){return _0x293f9b['define'](_0xd39c('0xa'),attributes,{'tableName':_0xd39c('0xb'),'paranoid':![],'indexes':[{'name':_0xd39c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 7222090..c8751b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf55=['create','value','format','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','info','result','catch','UpdateVoiceRecording','update','options','raw','attributes','limit','debug','stringify','CreateVoiceRecording','findOne','callRecordingEncryption'];(function(_0xba7e5,_0x343246){var _0x2258ec=function(_0x4976c8){while(--_0x4976c8){_0xba7e5['push'](_0xba7e5['shift']());}};_0x2258ec(++_0x343246);}(_0xdf55,0x83));var _0x5df5=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0xdf55[_0x1fa841];return _0x384b67;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});}exports[_0x5df5('0x16')]=function(_0xb7e1c2){var _0x44f700=this;return new Promise(function(_0x215d59,_0x4b499d){return db['VoiceRecording'][_0x5df5('0x17')](_0xb7e1c2['body'],{'raw':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')]['where']||null:null,'attributes':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1a')]||null:null,'limit':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1b')]||null:null})['then'](function(_0x2e99a1){logger[_0x5df5('0x13')](_0x5df5('0x16'),_0xb7e1c2);logger[_0x5df5('0x1c')]('UpdateVoiceRecording',_0xb7e1c2,JSON[_0x5df5('0x1d')](_0x2e99a1));_0x215d59(_0x2e99a1);})[_0x5df5('0x15')](function(_0x395f3e){logger['error']('UpdateVoiceRecording',_0x395f3e['message'],_0xb7e1c2);_0x4b499d(_0x44f700[_0x5df5('0xf')](0x1f4,_0x395f3e[_0x5df5('0x12')]));});});};exports[_0x5df5('0x1e')]=function(_0xa7f4b3){var _0x1baf52=this;return new Promise(function(_0x1fd83c,_0x210d20){var _0x28723e=require('../../components/encryptor');var _0x18bb61;return db['Setting'][_0x5df5('0x1f')]({'attributes':['id',_0x5df5('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3854d0){_0x18bb61=_0x3854d0;return db['VoiceRecording'][_0x5df5('0x21')](_0xa7f4b3['body']);})[_0x5df5('0xc')](function(_0x4afe36){if(_0x18bb61[_0x5df5('0x20')]&&fs['existsSync'](_0x4afe36[_0x5df5('0x22')])){var _0x47bebb=util[_0x5df5('0x23')]('%s.cypher',_0x4afe36[_0x5df5('0x22')]);return _0x28723e[_0x5df5('0x24')](_0x4afe36[_0x5df5('0x22')],_0x47bebb,config[_0x5df5('0x25')][_0x5df5('0x26')])[_0x5df5('0xc')](function(){fs[_0x5df5('0x27')](_0x4afe36['value']);logger['info'](_0x5df5('0x28'));return _0x4afe36;});}return _0x4afe36;})[_0x5df5('0xc')](function(_0x3bbd2b){logger[_0x5df5('0x13')](_0x5df5('0x1e'),_0xa7f4b3);logger[_0x5df5('0x1c')]('CreateVoiceRecording',_0xa7f4b3,JSON[_0x5df5('0x1d')](_0x3bbd2b));_0x1fd83c(_0x3bbd2b);})[_0x5df5('0x15')](function(_0x2f1001){logger[_0x5df5('0xf')]('CreateVoiceRecording',_0x2f1001[_0x5df5('0x12')],_0xa7f4b3);_0x210d20(_0x1baf52['error'](0x1f4,_0x2f1001[_0x5df5('0x12')]));});});};
\ No newline at end of file
+var _0xe2fe=['options','raw','where','attributes','limit','debug','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','recording','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','UpdateVoiceRecording','VoiceRecording','update','body'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}exports[_0xee2f('0x12')]=function(_0x502eb6){var _0x550da7=this;return new Promise(function(_0x40b5bc,_0x5a5078){return db[_0xee2f('0x13')][_0xee2f('0x14')](_0x502eb6[_0xee2f('0x15')],{'raw':_0x502eb6['options']?_0x502eb6[_0xee2f('0x16')][_0xee2f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x502eb6[_0xee2f('0x16')]?_0x502eb6[_0xee2f('0x16')][_0xee2f('0x18')]||null:null,'attributes':_0x502eb6['options']?_0x502eb6['options'][_0xee2f('0x19')]||null:null,'limit':_0x502eb6[_0xee2f('0x16')]?_0x502eb6[_0xee2f('0x16')][_0xee2f('0x1a')]||null:null})[_0xee2f('0xa')](function(_0xf278cc){logger[_0xee2f('0xb')]('UpdateVoiceRecording',_0x502eb6);logger[_0xee2f('0x1b')](_0xee2f('0x12'),_0x502eb6,JSON[_0xee2f('0xd')](_0xf278cc));_0x40b5bc(_0xf278cc);})[_0xee2f('0x1c')](function(_0x820101){logger[_0xee2f('0xe')](_0xee2f('0x12'),_0x820101[_0xee2f('0xf')],_0x502eb6);_0x5a5078(_0x550da7[_0xee2f('0xe')](0x1f4,_0x820101[_0xee2f('0xf')]));});});};exports[_0xee2f('0x1d')]=function(_0x168adc){var _0x1c8454=this;return new Promise(function(_0x45c4a0,_0x53f6ed){var _0x4ef690=require('../../components/encryptor');var _0x18bdbb;return db[_0xee2f('0x1e')][_0xee2f('0x1f')]({'attributes':['id',_0xee2f('0x20')],'where':{'id':0x1},'raw':!![]})[_0xee2f('0xa')](function(_0x3737fd){_0x18bdbb=_0x3737fd;return db['VoiceRecording'][_0xee2f('0x21')](_0x168adc['body']);})[_0xee2f('0xa')](function(_0x180429){if(_0x18bdbb[_0xee2f('0x20')]&&fs[_0xee2f('0x22')](_0x180429[_0xee2f('0x23')])){var _0x47d5a6=util[_0xee2f('0x24')](_0xee2f('0x25'),_0x180429['value']);return _0x4ef690['encryptFile'](_0x180429[_0xee2f('0x23')],_0x47d5a6,config['secrets'][_0xee2f('0x26')])[_0xee2f('0xa')](function(){fs['unlink'](_0x180429[_0xee2f('0x23')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x180429;});}return _0x180429;})['then'](function(_0x3f1fe8){logger[_0xee2f('0xb')]('CreateVoiceRecording',_0x168adc);logger[_0xee2f('0x1b')](_0xee2f('0x1d'),_0x168adc,JSON[_0xee2f('0xd')](_0x3f1fe8));_0x45c4a0(_0x3f1fe8);})[_0xee2f('0x1c')](function(_0x1c3a01){logger['error'](_0xee2f('0x1d'),_0x1c3a01['message'],_0x168adc);_0x53f6ed(_0x1c8454[_0xee2f('0xe')](0x1f4,_0x1c3a01[_0xee2f('0xf')]));});});};
\ No newline at end of file
index feba0df..519fda0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25b9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25b9,0x173));var _0x925b=function(_0x4bbd94,_0x4803c6){_0x4bbd94=_0x4bbd94-0x0;var _0x226ebe=_0x25b9[_0x4bbd94];return _0x226ebe;};'use strict';var multer=require(_0x925b('0x0'));var util=require(_0x925b('0x1'));var path=require(_0x925b('0x2'));var timeout=require(_0x925b('0x3'));var express=require(_0x925b('0x4'));var router=express[_0x925b('0x5')]();var fs_extra=require(_0x925b('0x6'));var auth=require(_0x925b('0x7'));var interaction=require(_0x925b('0x8'));var config=require(_0x925b('0x9'));var controller=require(_0x925b('0xa'));router[_0x925b('0xb')]('/',auth[_0x925b('0xc')](),controller[_0x925b('0xd')]);router[_0x925b('0xb')]('/describe',auth[_0x925b('0xc')](),controller['describe']);router[_0x925b('0xb')](_0x925b('0xe'),auth[_0x925b('0xc')](),controller[_0x925b('0xf')]);router[_0x925b('0x10')]('/',auth[_0x925b('0xc')](),controller[_0x925b('0x11')]);router['put'](_0x925b('0xe'),auth[_0x925b('0xc')](),controller['update']);router[_0x925b('0x12')](_0x925b('0xe'),auth[_0x925b('0xc')](),controller[_0x925b('0x13')]);module[_0x925b('0x14')]=router;
\ No newline at end of file
+var _0xc86c=['isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x235563,_0x260ece){var _0x219be0=function(_0xef2469){while(--_0xef2469){_0x235563['push'](_0x235563['shift']());}};_0x219be0(++_0x260ece);}(_0xc86c,0x107));var _0xcc86=function(_0x9ac37d,_0xc8697b){_0x9ac37d=_0x9ac37d-0x0;var _0x1d1834=_0xc86c[_0x9ac37d];return _0x1d1834;};'use strict';var multer=require(_0xcc86('0x0'));var util=require('util');var path=require(_0xcc86('0x1'));var timeout=require(_0xcc86('0x2'));var express=require('express');var router=express[_0xcc86('0x3')]();var fs_extra=require(_0xcc86('0x4'));var auth=require(_0xcc86('0x5'));var interaction=require(_0xcc86('0x6'));var config=require(_0xcc86('0x7'));var controller=require(_0xcc86('0x8'));router[_0xcc86('0x9')]('/',auth[_0xcc86('0xa')](),controller[_0xcc86('0xb')]);router[_0xcc86('0x9')](_0xcc86('0xc'),auth[_0xcc86('0xa')](),controller[_0xcc86('0xd')]);router['get']('/:id',auth[_0xcc86('0xa')](),controller[_0xcc86('0xe')]);router[_0xcc86('0xf')]('/',auth[_0xcc86('0xa')](),controller['create']);router[_0xcc86('0x10')](_0xcc86('0x11'),auth[_0xcc86('0xa')](),controller[_0xcc86('0x12')]);router[_0xcc86('0x13')]('/:id',auth[_0xcc86('0xa')](),controller[_0xcc86('0x14')]);module['exports']=router;
\ No newline at end of file
index 66ecc45..904bab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7127=['attended','STRING','exports','ENUM'];(function(_0x36633f,_0x26e83d){var _0x480eb0=function(_0x2e4919){while(--_0x2e4919){_0x36633f['push'](_0x36633f['shift']());}};_0x480eb0(++_0x26e83d);}(_0x7127,0x146));var _0x7712=function(_0x40cc9f,_0x105496){_0x40cc9f=_0x40cc9f-0x0;var _0x5895c9=_0x7127[_0x40cc9f];return _0x5895c9;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x7712('0x0')]={'type':{'type':Sequelize[_0x7712('0x1')]('blind',_0x7712('0x2'))},'result':{'type':Sequelize[_0x7712('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x7712('0x3')]},'transferercalleridname':{'type':Sequelize[_0x7712('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x7712('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x7712('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x7712('0x3')]},'transferercontext':{'type':Sequelize[_0x7712('0x3')]},'transfererexten':{'type':Sequelize[_0x7712('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x7712('0x3')]},'transfereechannel':{'type':Sequelize[_0x7712('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x7712('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x7712('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7712('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x7712('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x7712('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x7712('0x1')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd4fa=['blind','attended','STRING','sequelize','exports','ENUM'];(function(_0x2810a2,_0x56dd2b){var _0x26e1fb=function(_0x53222c){while(--_0x53222c){_0x2810a2['push'](_0x2810a2['shift']());}};_0x26e1fb(++_0x56dd2b);}(_0xd4fa,0xff));var _0xad4f=function(_0x5544e1,_0x32afaf){_0x5544e1=_0x5544e1-0x0;var _0x233c4c=_0xd4fa[_0x5544e1];return _0x233c4c;};'use strict';var Sequelize=require(_0xad4f('0x0'));var moment=require('moment');module[_0xad4f('0x1')]={'type':{'type':Sequelize[_0xad4f('0x2')](_0xad4f('0x3'),_0xad4f('0x4'))},'result':{'type':Sequelize[_0xad4f('0x5')]},'transfererchannel':{'type':Sequelize[_0xad4f('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xad4f('0x5')]},'transferercalleridname':{'type':Sequelize[_0xad4f('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xad4f('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xad4f('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xad4f('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xad4f('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xad4f('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xad4f('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xad4f('0x5')]},'transfereecontext':{'type':Sequelize[_0xad4f('0x5')]},'transfereeexten':{'type':Sequelize[_0xad4f('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0xad4f('0x5')]},'extension':{'type':Sequelize[_0xad4f('0x5')]}};
\ No newline at end of file
index 62afb1f..bffbb9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc3=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x4f60b1,_0xf09956){var _0x17b645=function(_0x5e2e46){while(--_0x5e2e46){_0x4f60b1['push'](_0x4f60b1['shift']());}};_0x17b645(++_0xf09956);}(_0x4fc3,0x111));var _0x34fc=function(_0x2b0bb5,_0xfaad18){_0x2b0bb5=_0x2b0bb5-0x0;var _0x379c5d=_0x4fc3[_0x2b0bb5];return _0x379c5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34fc('0x0'));var zipdir=require(_0x34fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x34fc('0x2'));var moment=require('moment');var BPromise=require(_0x34fc('0x3'));var Mustache=require('mustache');var util=require(_0x34fc('0x4'));var path=require(_0x34fc('0x5'));var sox=require(_0x34fc('0x6'));var csv=require(_0x34fc('0x7'));var ejs=require(_0x34fc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34fc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x34fc('0xa'));var deskjs=require(_0x34fc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x34fc('0xc'));var Papa=require(_0x34fc('0xd'));var Redis=require(_0x34fc('0xe'));var authService=require(_0x34fc('0xf'));var qs=require(_0x34fc('0x10'));var as=require(_0x34fc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x34fc('0x12'))(_0x34fc('0x13'));var utils=require(_0x34fc('0x14'));var config=require(_0x34fc('0x15'));var licenseUtil=require(_0x34fc('0x16'));var db=require(_0x34fc('0x17'))['db'];function respondWithStatusCode(_0x50eefe,_0xce0332){_0xce0332=_0xce0332||0xcc;return function(_0x4652ac){if(_0x4652ac){return _0x50eefe[_0x34fc('0x18')](_0xce0332);}return _0x50eefe['status'](_0xce0332)['end']();};}function respondWithResult(_0x1aa26a,_0xf3a073){_0xf3a073=_0xf3a073||0xc8;return function(_0x2ff4ca){if(_0x2ff4ca){return _0x1aa26a['status'](_0xf3a073)[_0x34fc('0x19')](_0x2ff4ca);}};}function respondWithFilteredResult(_0x115ec0,_0x48ecaa){return function(_0x59bb79){if(_0x59bb79){var _0x5bcb48=typeof _0x48ecaa[_0x34fc('0x1a')]===_0x34fc('0x1b')&&typeof _0x48ecaa[_0x34fc('0x1c')]==='undefined';var _0x2439fc=_0x59bb79['count'];var _0x1a7449=_0x5bcb48?0x0:_0x48ecaa[_0x34fc('0x1a')];var _0x32a281=_0x5bcb48?_0x59bb79[_0x34fc('0x1d')]:_0x48ecaa[_0x34fc('0x1a')]+_0x48ecaa[_0x34fc('0x1c')];var _0x5378a3;if(_0x32a281>=_0x2439fc){_0x32a281=_0x2439fc;_0x5378a3=0xc8;}else{_0x5378a3=0xce;}_0x115ec0[_0x34fc('0x1e')](_0x5378a3);return _0x115ec0[_0x34fc('0x1f')](_0x34fc('0x20'),_0x1a7449+'-'+_0x32a281+'/'+_0x2439fc)['json'](_0x59bb79);}return null;};}function patchUpdates(_0x1d01dc){return function(_0x4e3eb6){try{jsonpatch[_0x34fc('0x21')](_0x4e3eb6,_0x1d01dc,!![]);}catch(_0x3528b5){return BPromise[_0x34fc('0x22')](_0x3528b5);}return _0x4e3eb6[_0x34fc('0x23')]();};}function saveUpdates(_0x4df994,_0x1935b5){return function(_0x4bfbc0){if(_0x4bfbc0){return _0x4bfbc0[_0x34fc('0x24')](_0x4df994)[_0x34fc('0x25')](function(_0x30fa23){return _0x30fa23;});}return null;};}function removeEntity(_0x3c8eb7,_0xaf8238){return function(_0x165575){if(_0x165575){return _0x165575[_0x34fc('0x26')]()['then'](function(){_0x3c8eb7[_0x34fc('0x1e')](0xcc)[_0x34fc('0x27')]();});}};}function handleEntityNotFound(_0x52c5de,_0x535029){return function(_0x31eb55){if(!_0x31eb55){_0x52c5de[_0x34fc('0x18')](0x194);}return _0x31eb55;};}function handleError(_0x437cb4,_0x21e410){_0x21e410=_0x21e410||0x1f4;return function(_0x4a25aa){logger[_0x34fc('0x28')](_0x4a25aa[_0x34fc('0x29')]);if(_0x4a25aa[_0x34fc('0x2a')]){delete _0x4a25aa[_0x34fc('0x2a')];}_0x437cb4[_0x34fc('0x1e')](_0x21e410)['send'](_0x4a25aa);};}exports['index']=function(_0x1b195f,_0x202799){var _0x1b1133={},_0x1448a7={},_0x3b753e={'count':0x0,'rows':[]};var _0x345280=_[_0x34fc('0x2b')](db['VoiceTransferReport'][_0x34fc('0x2c')],function(_0x50ad6d){return{'name':_0x50ad6d[_0x34fc('0x2d')],'type':_0x50ad6d['type'][_0x34fc('0x2e')]};});_0x1448a7[_0x34fc('0x2f')]=_['map'](_0x345280,_0x34fc('0x2a'));_0x1448a7[_0x34fc('0x30')]=_[_0x34fc('0x31')](_0x1b195f['query']);_0x1448a7[_0x34fc('0x32')]=_['intersection'](_0x1448a7['model'],_0x1448a7['query']);_0x1b1133[_0x34fc('0x33')]=_['intersection'](_0x1448a7[_0x34fc('0x2f')],qs[_0x34fc('0x34')](_0x1b195f[_0x34fc('0x30')][_0x34fc('0x34')]));_0x1b1133['attributes']=_0x1b1133[_0x34fc('0x33')][_0x34fc('0x35')]?_0x1b1133[_0x34fc('0x33')]:_0x1448a7[_0x34fc('0x2f')];if(!_0x1b195f[_0x34fc('0x30')]['hasOwnProperty']('nolimit')){_0x1b1133['limit']=qs[_0x34fc('0x1c')](_0x1b195f[_0x34fc('0x30')][_0x34fc('0x1c')]);_0x1b1133[_0x34fc('0x1a')]=qs[_0x34fc('0x1a')](_0x1b195f[_0x34fc('0x30')][_0x34fc('0x1a')]);}_0x1b1133['order']=qs[_0x34fc('0x36')](_0x1b195f[_0x34fc('0x30')][_0x34fc('0x36')]);_0x1b1133[_0x34fc('0x37')]=qs['filters'](_['pick'](_0x1b195f['query'],_0x1448a7['filters']),_0x345280);if(_0x1b195f['query'][_0x34fc('0x38')]){_0x1b1133[_0x34fc('0x37')]=_[_0x34fc('0x39')](_0x1b1133[_0x34fc('0x37')],{'$or':_[_0x34fc('0x2b')](_0x345280,function(_0x598d86){if(_0x598d86[_0x34fc('0x3a')]!==_0x34fc('0x3b')){var _0x5d0672={};_0x5d0672[_0x598d86['name']]={'$like':'%'+_0x1b195f['query']['filter']+'%'};return _0x5d0672;}})});}_0x1b1133=_['merge']({},_0x1b1133,_0x1b195f[_0x34fc('0x3c')]);var _0x5dd62a={'where':_0x1b1133[_0x34fc('0x37')]};return db[_0x34fc('0x3d')][_0x34fc('0x1d')](_0x5dd62a)['then'](function(_0x1c3778){_0x3b753e[_0x34fc('0x1d')]=_0x1c3778;if(_0x1b195f[_0x34fc('0x30')][_0x34fc('0x3e')]){_0x1b1133[_0x34fc('0x3f')]=[{'all':!![]}];}return db[_0x34fc('0x3d')][_0x34fc('0x40')](_0x1b1133);})['then'](function(_0x40664c){_0x3b753e[_0x34fc('0x41')]=_0x40664c;return _0x3b753e;})[_0x34fc('0x25')](respondWithFilteredResult(_0x202799,_0x1b1133))[_0x34fc('0x42')](handleError(_0x202799,null));};exports['show']=function(_0x5526e8,_0x4054cb){var _0x277892={'raw':!![],'where':{'id':_0x5526e8[_0x34fc('0x43')]['id']}},_0x36c43b={};_0x36c43b[_0x34fc('0x2f')]=_[_0x34fc('0x31')](db[_0x34fc('0x3d')]['rawAttributes']);_0x36c43b[_0x34fc('0x30')]=_[_0x34fc('0x31')](_0x5526e8[_0x34fc('0x30')]);_0x36c43b[_0x34fc('0x32')]=_[_0x34fc('0x44')](_0x36c43b['model'],_0x36c43b['query']);_0x277892[_0x34fc('0x33')]=_[_0x34fc('0x44')](_0x36c43b[_0x34fc('0x2f')],qs[_0x34fc('0x34')](_0x5526e8[_0x34fc('0x30')][_0x34fc('0x34')]));_0x277892[_0x34fc('0x33')]=_0x277892['attributes'][_0x34fc('0x35')]?_0x277892[_0x34fc('0x33')]:_0x36c43b['model'];if(_0x5526e8['query'][_0x34fc('0x3e')]){_0x277892[_0x34fc('0x3f')]=[{'all':!![]}];}_0x277892=_['merge']({},_0x277892,_0x5526e8[_0x34fc('0x3c')]);return db['VoiceTransferReport'][_0x34fc('0x45')](_0x277892)[_0x34fc('0x25')](handleEntityNotFound(_0x4054cb,null))[_0x34fc('0x25')](respondWithResult(_0x4054cb,null))[_0x34fc('0x42')](handleError(_0x4054cb,null));};exports['create']=function(_0x166534,_0x57d5d2){return db[_0x34fc('0x3d')][_0x34fc('0x46')](_0x166534[_0x34fc('0x47')],{})[_0x34fc('0x25')](respondWithResult(_0x57d5d2,0xc9))[_0x34fc('0x42')](handleError(_0x57d5d2,null));};exports[_0x34fc('0x24')]=function(_0xdd6018,_0x263c07){if(_0xdd6018[_0x34fc('0x47')]['id']){delete _0xdd6018[_0x34fc('0x47')]['id'];}return db[_0x34fc('0x3d')]['find']({'where':{'id':_0xdd6018[_0x34fc('0x43')]['id']}})[_0x34fc('0x25')](handleEntityNotFound(_0x263c07,null))[_0x34fc('0x25')](saveUpdates(_0xdd6018[_0x34fc('0x47')],null))[_0x34fc('0x25')](respondWithResult(_0x263c07,null))[_0x34fc('0x42')](handleError(_0x263c07,null));};exports[_0x34fc('0x26')]=function(_0x93402e,_0x5e65b1){return db['VoiceTransferReport'][_0x34fc('0x45')]({'where':{'id':_0x93402e['params']['id']}})[_0x34fc('0x25')](handleEntityNotFound(_0x5e65b1,null))['then'](removeEntity(_0x5e65b1,null))[_0x34fc('0x42')](handleError(_0x5e65b1,null));};exports[_0x34fc('0x48')]=function(_0xe6df95,_0x583f96){return db['VoiceTransferReport']['describe']()[_0x34fc('0x25')](respondWithResult(_0x583f96,null))['catch'](handleError(_0x583f96,null));};
\ No newline at end of file
+var _0xe7da=['then','destroy','end','error','stack','name','map','VoiceTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save'];(function(_0x1e9199,_0x7f37d4){var _0x43d9f1=function(_0xded14f){while(--_0xded14f){_0x1e9199['push'](_0x1e9199['shift']());}};_0x43d9f1(++_0x7f37d4);}(_0xe7da,0x160));var _0xae7d=function(_0x4db496,_0x3d874d){_0x4db496=_0x4db496-0x0;var _0x9a21ea=_0xe7da[_0x4db496];return _0x9a21ea;};'use strict';var emlformat=require(_0xae7d('0x0'));var rimraf=require(_0xae7d('0x1'));var zipdir=require(_0xae7d('0x2'));var jsonpatch=require(_0xae7d('0x3'));var rp=require(_0xae7d('0x4'));var moment=require('moment');var BPromise=require(_0xae7d('0x5'));var Mustache=require(_0xae7d('0x6'));var util=require('util');var path=require(_0xae7d('0x7'));var sox=require('sox');var csv=require(_0xae7d('0x8'));var ejs=require(_0xae7d('0x9'));var fs=require('fs');var fs_extra=require(_0xae7d('0xa'));var _=require(_0xae7d('0xb'));var squel=require(_0xae7d('0xc'));var crypto=require(_0xae7d('0xd'));var jsforce=require(_0xae7d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xae7d('0x8'));var querystring=require(_0xae7d('0xf'));var Papa=require(_0xae7d('0x10'));var Redis=require(_0xae7d('0x11'));var authService=require(_0xae7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xae7d('0x13'));var hardwareService=require(_0xae7d('0x14'));var logger=require(_0xae7d('0x15'))(_0xae7d('0x16'));var utils=require('../../config/utils');var config=require(_0xae7d('0x17'));var licenseUtil=require(_0xae7d('0x18'));var db=require(_0xae7d('0x19'))['db'];function respondWithStatusCode(_0x49d965,_0x5b013c){_0x5b013c=_0x5b013c||0xcc;return function(_0xda58c8){if(_0xda58c8){return _0x49d965[_0xae7d('0x1a')](_0x5b013c);}return _0x49d965[_0xae7d('0x1b')](_0x5b013c)['end']();};}function respondWithResult(_0x5e9ed7,_0x134f83){_0x134f83=_0x134f83||0xc8;return function(_0x5f3fa7){if(_0x5f3fa7){return _0x5e9ed7[_0xae7d('0x1b')](_0x134f83)[_0xae7d('0x1c')](_0x5f3fa7);}};}function respondWithFilteredResult(_0x4ae32a,_0x58b43e){return function(_0x1fc011){if(_0x1fc011){var _0x5f24d1=typeof _0x58b43e['offset']==='undefined'&&typeof _0x58b43e[_0xae7d('0x1d')]===_0xae7d('0x1e');var _0x4facca=_0x1fc011[_0xae7d('0x1f')];var _0x1928dd=_0x5f24d1?0x0:_0x58b43e[_0xae7d('0x20')];var _0x1d2982=_0x5f24d1?_0x1fc011[_0xae7d('0x1f')]:_0x58b43e[_0xae7d('0x20')]+_0x58b43e['limit'];var _0x431e5d;if(_0x1d2982>=_0x4facca){_0x1d2982=_0x4facca;_0x431e5d=0xc8;}else{_0x431e5d=0xce;}_0x4ae32a[_0xae7d('0x1b')](_0x431e5d);return _0x4ae32a[_0xae7d('0x21')](_0xae7d('0x22'),_0x1928dd+'-'+_0x1d2982+'/'+_0x4facca)[_0xae7d('0x1c')](_0x1fc011);}return null;};}function patchUpdates(_0x21d0f2){return function(_0x4bf23a){try{jsonpatch[_0xae7d('0x23')](_0x4bf23a,_0x21d0f2,!![]);}catch(_0x266db7){return BPromise[_0xae7d('0x24')](_0x266db7);}return _0x4bf23a[_0xae7d('0x25')]();};}function saveUpdates(_0xeb1f3,_0x355709){return function(_0x58d787){if(_0x58d787){return _0x58d787['update'](_0xeb1f3)[_0xae7d('0x26')](function(_0x502de7){return _0x502de7;});}return null;};}function removeEntity(_0x4fd191,_0x551c0a){return function(_0x54ef73){if(_0x54ef73){return _0x54ef73[_0xae7d('0x27')]()[_0xae7d('0x26')](function(){_0x4fd191[_0xae7d('0x1b')](0xcc)[_0xae7d('0x28')]();});}};}function handleEntityNotFound(_0x45698c,_0x13c7d6){return function(_0x1ee64f){if(!_0x1ee64f){_0x45698c[_0xae7d('0x1a')](0x194);}return _0x1ee64f;};}function handleError(_0x5edecf,_0x3dc3c3){_0x3dc3c3=_0x3dc3c3||0x1f4;return function(_0x1b07ef){logger[_0xae7d('0x29')](_0x1b07ef[_0xae7d('0x2a')]);if(_0x1b07ef['name']){delete _0x1b07ef[_0xae7d('0x2b')];}_0x5edecf[_0xae7d('0x1b')](_0x3dc3c3)['send'](_0x1b07ef);};}exports['index']=function(_0x365bb5,_0x23cbc7){var _0x39b670={},_0x43c1ae={},_0x34e3e4={'count':0x0,'rows':[]};var _0x118b2a=_[_0xae7d('0x2c')](db[_0xae7d('0x2d')]['rawAttributes'],function(_0x167486){return{'name':_0x167486[_0xae7d('0x2e')],'type':_0x167486[_0xae7d('0x2f')]['key']};});_0x43c1ae[_0xae7d('0x30')]=_[_0xae7d('0x2c')](_0x118b2a,_0xae7d('0x2b'));_0x43c1ae[_0xae7d('0x31')]=_[_0xae7d('0x32')](_0x365bb5[_0xae7d('0x31')]);_0x43c1ae[_0xae7d('0x33')]=_[_0xae7d('0x34')](_0x43c1ae[_0xae7d('0x30')],_0x43c1ae[_0xae7d('0x31')]);_0x39b670[_0xae7d('0x35')]=_[_0xae7d('0x34')](_0x43c1ae[_0xae7d('0x30')],qs['fields'](_0x365bb5[_0xae7d('0x31')]['fields']));_0x39b670[_0xae7d('0x35')]=_0x39b670[_0xae7d('0x35')]['length']?_0x39b670[_0xae7d('0x35')]:_0x43c1ae[_0xae7d('0x30')];if(!_0x365bb5[_0xae7d('0x31')][_0xae7d('0x36')](_0xae7d('0x37'))){_0x39b670['limit']=qs['limit'](_0x365bb5[_0xae7d('0x31')][_0xae7d('0x1d')]);_0x39b670[_0xae7d('0x20')]=qs[_0xae7d('0x20')](_0x365bb5[_0xae7d('0x31')][_0xae7d('0x20')]);}_0x39b670[_0xae7d('0x38')]=qs[_0xae7d('0x39')](_0x365bb5['query'][_0xae7d('0x39')]);_0x39b670[_0xae7d('0x3a')]=qs['filters'](_[_0xae7d('0x3b')](_0x365bb5[_0xae7d('0x31')],_0x43c1ae[_0xae7d('0x33')]),_0x118b2a);if(_0x365bb5[_0xae7d('0x31')][_0xae7d('0x3c')]){_0x39b670['where']=_[_0xae7d('0x3d')](_0x39b670[_0xae7d('0x3a')],{'$or':_[_0xae7d('0x2c')](_0x118b2a,function(_0x469aa5){if(_0x469aa5['type']!==_0xae7d('0x3e')){var _0x4682c8={};_0x4682c8[_0x469aa5[_0xae7d('0x2b')]]={'$like':'%'+_0x365bb5[_0xae7d('0x31')][_0xae7d('0x3c')]+'%'};return _0x4682c8;}})});}_0x39b670=_[_0xae7d('0x3d')]({},_0x39b670,_0x365bb5[_0xae7d('0x3f')]);var _0x260948={'where':_0x39b670['where']};return db[_0xae7d('0x2d')][_0xae7d('0x1f')](_0x260948)[_0xae7d('0x26')](function(_0x3af09b){_0x34e3e4[_0xae7d('0x1f')]=_0x3af09b;if(_0x365bb5[_0xae7d('0x31')][_0xae7d('0x40')]){_0x39b670[_0xae7d('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xae7d('0x42')](_0x39b670);})[_0xae7d('0x26')](function(_0x4d5568){_0x34e3e4[_0xae7d('0x43')]=_0x4d5568;return _0x34e3e4;})['then'](respondWithFilteredResult(_0x23cbc7,_0x39b670))[_0xae7d('0x44')](handleError(_0x23cbc7,null));};exports[_0xae7d('0x45')]=function(_0x283b8b,_0x4ced89){var _0x47f5cd={'raw':!![],'where':{'id':_0x283b8b[_0xae7d('0x46')]['id']}},_0xe48309={};_0xe48309[_0xae7d('0x30')]=_['keys'](db[_0xae7d('0x2d')][_0xae7d('0x47')]);_0xe48309[_0xae7d('0x31')]=_[_0xae7d('0x32')](_0x283b8b['query']);_0xe48309[_0xae7d('0x33')]=_[_0xae7d('0x34')](_0xe48309[_0xae7d('0x30')],_0xe48309[_0xae7d('0x31')]);_0x47f5cd[_0xae7d('0x35')]=_['intersection'](_0xe48309[_0xae7d('0x30')],qs[_0xae7d('0x48')](_0x283b8b[_0xae7d('0x31')][_0xae7d('0x48')]));_0x47f5cd[_0xae7d('0x35')]=_0x47f5cd[_0xae7d('0x35')]['length']?_0x47f5cd['attributes']:_0xe48309['model'];if(_0x283b8b[_0xae7d('0x31')]['includeAll']){_0x47f5cd[_0xae7d('0x41')]=[{'all':!![]}];}_0x47f5cd=_['merge']({},_0x47f5cd,_0x283b8b[_0xae7d('0x3f')]);return db[_0xae7d('0x2d')][_0xae7d('0x49')](_0x47f5cd)[_0xae7d('0x26')](handleEntityNotFound(_0x4ced89,null))['then'](respondWithResult(_0x4ced89,null))[_0xae7d('0x44')](handleError(_0x4ced89,null));};exports[_0xae7d('0x4a')]=function(_0x4dc9a4,_0x2da204){return db['VoiceTransferReport'][_0xae7d('0x4a')](_0x4dc9a4[_0xae7d('0x4b')],{})[_0xae7d('0x26')](respondWithResult(_0x2da204,0xc9))[_0xae7d('0x44')](handleError(_0x2da204,null));};exports[_0xae7d('0x4c')]=function(_0xf536fb,_0x2a01bc){if(_0xf536fb[_0xae7d('0x4b')]['id']){delete _0xf536fb[_0xae7d('0x4b')]['id'];}return db[_0xae7d('0x2d')][_0xae7d('0x49')]({'where':{'id':_0xf536fb['params']['id']}})[_0xae7d('0x26')](handleEntityNotFound(_0x2a01bc,null))[_0xae7d('0x26')](saveUpdates(_0xf536fb[_0xae7d('0x4b')],null))['then'](respondWithResult(_0x2a01bc,null))[_0xae7d('0x44')](handleError(_0x2a01bc,null));};exports[_0xae7d('0x27')]=function(_0x3babe8,_0x8a55bb){return db[_0xae7d('0x2d')][_0xae7d('0x49')]({'where':{'id':_0x3babe8['params']['id']}})[_0xae7d('0x26')](handleEntityNotFound(_0x8a55bb,null))[_0xae7d('0x26')](removeEntity(_0x8a55bb,null))[_0xae7d('0x44')](handleError(_0x8a55bb,null));};exports['describe']=function(_0x5e6286,_0x1c862b){return db[_0xae7d('0x2d')][_0xae7d('0x4d')]()['then'](respondWithResult(_0x1c862b,null))[_0xae7d('0x44')](handleError(_0x1c862b,null));};
\ No newline at end of file
index d12e978..b910676 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd66a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0xa549cc,_0x1478fb){var _0x1c02e7=function(_0x1b67fe){while(--_0x1b67fe){_0xa549cc['push'](_0xa549cc['shift']());}};_0x1c02e7(++_0x1478fb);}(_0xd66a,0x108));var _0xad66=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0xd66a[_0xcd0918];return _0x250704;};'use strict';var _=require(_0xad66('0x0'));var util=require(_0xad66('0x1'));var logger=require(_0xad66('0x2'))('api');var moment=require(_0xad66('0x3'));var BPromise=require(_0xad66('0x4'));var rp=require(_0xad66('0x5'));var fs=require('fs');var path=require(_0xad66('0x6'));var rimraf=require(_0xad66('0x7'));var config=require(_0xad66('0x8'));var attributes=require(_0xad66('0x9'));module[_0xad66('0xa')]=function(_0x265e1f,_0x291a55){return _0x265e1f[_0xad66('0xb')](_0xad66('0xc'),attributes,{'tableName':_0xad66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4c6=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','moment','bluebird'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf4c6,0x19e));var _0x6f4c=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xf4c6[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x6f4c('0x0'));var util=require(_0x6f4c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6f4c('0x2'));var BPromise=require(_0x6f4c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f4c('0x4'));var rimraf=require(_0x6f4c('0x5'));var config=require(_0x6f4c('0x6'));var attributes=require(_0x6f4c('0x7'));module[_0x6f4c('0x8')]=function(_0x9aa5a1,_0x44da47){return _0x9aa5a1['define'](_0x6f4c('0x9'),attributes,{'tableName':_0x6f4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 478710e..22c450d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13a2=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','catch','lodash','util','moment'];(function(_0x234aeb,_0x163c36){var _0x2f4165=function(_0x3b0bb5){while(--_0x3b0bb5){_0x234aeb['push'](_0x234aeb['shift']());}};_0x2f4165(++_0x163c36);}(_0x13a2,0x89));var _0x213a=function(_0x208d46,_0x3721ee){_0x208d46=_0x208d46-0x0;var _0x498f19=_0x13a2[_0x208d46];return _0x498f19;};'use strict';var _=require(_0x213a('0x0'));var util=require(_0x213a('0x1'));var moment=require(_0x213a('0x2'));var BPromise=require('bluebird');var rs=require(_0x213a('0x3'));var fs=require('fs');var Redis=require(_0x213a('0x4'));var db=require(_0x213a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x213a('0x6'))(_0x213a('0x7'));var config=require('../../config/environment');var jayson=require(_0x213a('0x8'));var client=jayson[_0x213a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x569717,_0x2b43ed,_0xec181f){return new BPromise(function(_0x238a90,_0x3501b6){return client[_0x213a('0xa')](_0x569717,_0xec181f)[_0x213a('0xb')](function(_0x4c4d38){logger['info'](_0x213a('0xc'),_0x2b43ed,_0x213a('0xd'));logger[_0x213a('0xe')](_0x213a('0xf'),_0x2b43ed,_0x213a('0xd'),JSON[_0x213a('0x10')](_0x4c4d38));if(_0x4c4d38[_0x213a('0x11')]){if(_0x4c4d38[_0x213a('0x11')][_0x213a('0x12')]===0x1f4){logger[_0x213a('0x11')](_0x213a('0xc'),_0x2b43ed,_0x4c4d38['error'][_0x213a('0x13')]);return _0x3501b6(_0x4c4d38[_0x213a('0x11')][_0x213a('0x13')]);}logger[_0x213a('0x11')](_0x213a('0xc'),_0x2b43ed,_0x4c4d38[_0x213a('0x11')]['message']);return _0x238a90(_0x4c4d38[_0x213a('0x11')][_0x213a('0x13')]);}else{logger[_0x213a('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x2b43ed,_0x213a('0xd'));_0x238a90(_0x4c4d38[_0x213a('0x15')][_0x213a('0x13')]);}})['catch'](function(_0x2c803b){logger['error'](_0x213a('0xc'),_0x2b43ed,_0x2c803b);_0x3501b6(_0x2c803b);});});}exports[_0x213a('0x16')]=function(_0x2d488c){var _0x4c2d1b=this;return new Promise(function(_0x14d2b0,_0x1efb6a){return db[_0x213a('0x17')][_0x213a('0x18')](_0x2d488c[_0x213a('0x19')],{'raw':_0x2d488c[_0x213a('0x1a')]?_0x2d488c[_0x213a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x213a('0xb')](function(_0x550cdb){logger[_0x213a('0x14')]('CreateVoiceTransferReport',_0x2d488c);logger[_0x213a('0xe')](_0x213a('0x16'),_0x2d488c,JSON[_0x213a('0x10')](_0x550cdb));_0x14d2b0(_0x550cdb);})[_0x213a('0x1b')](function(_0x389824){logger[_0x213a('0x11')](_0x213a('0x16'),_0x389824[_0x213a('0x13')],_0x2d488c);_0x1efb6a(_0x4c2d1b['error'](0x1f4,_0x389824['message']));});});};
\ No newline at end of file
+var _0x77c1=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceTransferReport','body','options','raw','CreateVoiceTransferReport','lodash','moment'];(function(_0x254733,_0x3f060d){var _0x18d025=function(_0x4409bd){while(--_0x4409bd){_0x254733['push'](_0x254733['shift']());}};_0x18d025(++_0x3f060d);}(_0x77c1,0x1c9));var _0x177c=function(_0x38b018,_0x331eb3){_0x38b018=_0x38b018-0x0;var _0x8eb524=_0x77c1[_0x38b018];return _0x8eb524;};'use strict';var _=require(_0x177c('0x0'));var util=require('util');var moment=require(_0x177c('0x1'));var BPromise=require('bluebird');var rs=require(_0x177c('0x2'));var fs=require('fs');var Redis=require(_0x177c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x177c('0x4'));var logger=require(_0x177c('0x5'))(_0x177c('0x6'));var config=require(_0x177c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x177c('0x8')][_0x177c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b578e,_0x202ef3,_0x119f3a){return new BPromise(function(_0x98cd0e,_0x305b32){return client[_0x177c('0xa')](_0x3b578e,_0x119f3a)[_0x177c('0xb')](function(_0x14a89d){logger[_0x177c('0xc')](_0x177c('0xd'),_0x202ef3,'request\x20sent');logger[_0x177c('0xe')](_0x177c('0xf'),_0x202ef3,_0x177c('0x10'),JSON[_0x177c('0x11')](_0x14a89d));if(_0x14a89d[_0x177c('0x12')]){if(_0x14a89d['error'][_0x177c('0x13')]===0x1f4){logger[_0x177c('0x12')](_0x177c('0xd'),_0x202ef3,_0x14a89d[_0x177c('0x12')][_0x177c('0x14')]);return _0x305b32(_0x14a89d[_0x177c('0x12')][_0x177c('0x14')]);}logger[_0x177c('0x12')](_0x177c('0xd'),_0x202ef3,_0x14a89d['error'][_0x177c('0x14')]);return _0x98cd0e(_0x14a89d[_0x177c('0x12')]['message']);}else{logger[_0x177c('0xc')](_0x177c('0xd'),_0x202ef3,_0x177c('0x10'));_0x98cd0e(_0x14a89d[_0x177c('0x15')][_0x177c('0x14')]);}})['catch'](function(_0x658aba){logger[_0x177c('0x12')](_0x177c('0xd'),_0x202ef3,_0x658aba);_0x305b32(_0x658aba);});});}exports['CreateVoiceTransferReport']=function(_0xac580a){var _0x363647=this;return new Promise(function(_0x42f291,_0x4120b5){return db[_0x177c('0x16')]['create'](_0xac580a[_0x177c('0x17')],{'raw':_0xac580a[_0x177c('0x18')]?_0xac580a['options'][_0x177c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x506ba4){logger['info'](_0x177c('0x1a'),_0xac580a);logger['debug']('CreateVoiceTransferReport',_0xac580a,JSON[_0x177c('0x11')](_0x506ba4));_0x42f291(_0x506ba4);})['catch'](function(_0x5e8e0a){logger[_0x177c('0x12')](_0x177c('0x1a'),_0x5e8e0a[_0x177c('0x14')],_0xac580a);_0x4120b5(_0x363647['error'](0x1f4,_0x5e8e0a[_0x177c('0x14')]));});});};
\ No newline at end of file
index b9ed8ec..33f02e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eea=['Router','../../components/auth/service','./webbar.controller','post','/originate','canUpdate','originate','isAuthenticated','/answer','answer','/hold','hold','/unhold','/calls','express'];(function(_0x376885,_0x1eeeea){var _0x54ae0b=function(_0x29553c){while(--_0x29553c){_0x376885['push'](_0x376885['shift']());}};_0x54ae0b(++_0x1eeeea);}(_0x3eea,0x158));var _0xa3ee=function(_0x50f591,_0x3d64fa){_0x50f591=_0x50f591-0x0;var _0x369b48=_0x3eea[_0x50f591];return _0x369b48;};'use strict';var express=require(_0xa3ee('0x0'));var router=express[_0xa3ee('0x1')]();var auth=require(_0xa3ee('0x2'));var controller=require(_0xa3ee('0x3'));router[_0xa3ee('0x4')](_0xa3ee('0x5'),auth['isAuthenticated'](),auth[_0xa3ee('0x6')](),controller[_0xa3ee('0x7')]);router[_0xa3ee('0x4')]('/hangup',auth[_0xa3ee('0x8')](),auth[_0xa3ee('0x6')](),controller['hangup']);router[_0xa3ee('0x4')](_0xa3ee('0x9'),auth[_0xa3ee('0x8')](),auth[_0xa3ee('0x6')](),controller[_0xa3ee('0xa')]);router[_0xa3ee('0x4')](_0xa3ee('0xb'),auth['isAuthenticated'](),auth[_0xa3ee('0x6')](),controller[_0xa3ee('0xc')]);router['post'](_0xa3ee('0xd'),auth[_0xa3ee('0x8')](),auth['canUpdate'](),controller['unhold']);router[_0xa3ee('0x4')](_0xa3ee('0xe'),auth[_0xa3ee('0x8')](),auth[_0xa3ee('0x6')](),controller['calls']);router[_0xa3ee('0x4')]('/transfer',auth[_0xa3ee('0x8')](),auth[_0xa3ee('0x6')](),controller['transfer']);module['exports']=router;
\ No newline at end of file
+var _0x99cf=['originate','hangup','/answer','answer','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','canUpdate'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x99cf,0x89));var _0xf99c=function(_0x51860c,_0x336545){_0x51860c=_0x51860c-0x0;var _0x575168=_0x99cf[_0x51860c];return _0x575168;};'use strict';var express=require(_0xf99c('0x0'));var router=express[_0xf99c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xf99c('0x2'));router[_0xf99c('0x3')](_0xf99c('0x4'),auth[_0xf99c('0x5')](),auth[_0xf99c('0x6')](),controller[_0xf99c('0x7')]);router[_0xf99c('0x3')]('/hangup',auth[_0xf99c('0x5')](),auth[_0xf99c('0x6')](),controller[_0xf99c('0x8')]);router[_0xf99c('0x3')](_0xf99c('0x9'),auth['isAuthenticated'](),auth[_0xf99c('0x6')](),controller[_0xf99c('0xa')]);router['post'](_0xf99c('0xb'),auth['isAuthenticated'](),auth[_0xf99c('0x6')](),controller['hold']);router[_0xf99c('0x3')](_0xf99c('0xc'),auth[_0xf99c('0x5')](),auth[_0xf99c('0x6')](),controller[_0xf99c('0xd')]);router[_0xf99c('0x3')](_0xf99c('0xe'),auth[_0xf99c('0x5')](),auth[_0xf99c('0x6')](),controller['calls']);router[_0xf99c('0x3')](_0xf99c('0xf'),auth[_0xf99c('0x5')](),auth['canUpdate'](),controller[_0xf99c('0x10')]);module[_0xf99c('0x11')]=router;
\ No newline at end of file
index 0882a0b..7d022ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fdb=['conference\x20fired:','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','redis','localhost','socket.io-emitter','userId\x20is\x20required','string','callNumber\x20is\x20required','number','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','send','name','status','NotFound','then','code','message','result','catch','agent','VoiceChannels','all','filter','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','body','validate','length','json','userId','callNumber','callerId','entityFound:','format','webbar:originate','originate\x20executed!','hangup','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','rows','conference'];(function(_0x3f7de5,_0x4b5ac4){var _0x264630=function(_0x3f868f){while(--_0x3f868f){_0x3f7de5['push'](_0x3f7de5['shift']());}};_0x264630(++_0x4b5ac4);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x1d15da,_0x4a5f08){_0x1d15da=_0x1d15da-0x0;var _0x3ebafc=_0x4fdb[_0x1d15da];return _0x3ebafc;};'use strict';var path=require(_0xb4fd('0x0'));var fs=require('fs');var _=require(_0xb4fd('0x1'));var db=require(_0xb4fd('0x2'))['db'];var config=require(_0xb4fd('0x3'));var util=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var jayson=require(_0xb4fd('0x6'));var amiClient=jayson[_0xb4fd('0x7')][_0xb4fd('0x8')]({'port':0x232a});var logger=require('../../config/logger')(_0xb4fd('0x9'));var Redis=require('ioredis');config[_0xb4fd('0xa')]=_['defaults'](config['redis'],{'host':_0xb4fd('0xb'),'port':0x18eb});var io=require(_0xb4fd('0xc'))(new Redis(config[_0xb4fd('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb4fd('0xd')]},'callNumber':{'type':_0xb4fd('0xe'),'required':[!![],_0xb4fd('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xb4fd('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xb4fd('0x10'),'required':[!![],_0xb4fd('0xd')]},'sessionId':{'type':_0xb4fd('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xb4fd('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb4fd('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xb4fd('0x10'),'required':[!![],_0xb4fd('0xd')]},'sessionId':{'type':_0xb4fd('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xb4fd('0xe'),'required':[!![],_0xb4fd('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xb4fd('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb4fd('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xb4fd('0x10'),'required':[!![],_0xb4fd('0xd')]},'sessionId':{'type':_0xb4fd('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xb4fd('0x10'),'required':[!![],_0xb4fd('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xb4fd('0x10'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x2076d5,_0x12401d,_0x2e92b5){logger[_0xb4fd('0x12')](_0x2076d5,_0x12401d,JSON[_0xb4fd('0x13')](_0x2e92b5));io['to'](_0x2076d5)[_0xb4fd('0x14')](_0x12401d,_0x2e92b5);}function handleError(_0x1d0812){return function(_0x44f0f0){console[_0xb4fd('0x15')](_0xb4fd('0x16'),_0x44f0f0,_0x44f0f0 instanceof RangeError);logger[_0xb4fd('0x17')](_0x44f0f0['stack']);if(_0x44f0f0 instanceof RangeError){if(_0x44f0f0['name']){delete _0x44f0f0['name'];}_0x1d0812['status'](0x194)[_0xb4fd('0x18')](_0x44f0f0);}else{if(_0x44f0f0[_0xb4fd('0x19')]){delete _0x44f0f0[_0xb4fd('0x19')];}_0x1d0812[_0xb4fd('0x1a')](0x1f4)[_0xb4fd('0x18')](_0x44f0f0);}};}function checkError(){return function(_0x2adfbd){if(!_0x2adfbd){throw new RangeError(_0xb4fd('0x1b'));}return _0x2adfbd;};}function respondWithRpcPromise(_0x4ffaf1,_0x51ac94){return new BPromise(function(_0x216307,_0x25bb7d){var _0x157fc2=amiClient;return _0x157fc2['request'](_0x4ffaf1,_0x51ac94)[_0xb4fd('0x1c')](function(_0x49d42c){if(_0x49d42c[_0xb4fd('0x17')]){if(_0x49d42c['error'][_0xb4fd('0x1d')]===0x1f4){return _0x25bb7d(_0x49d42c[_0xb4fd('0x17')][_0xb4fd('0x1e')]);}return _0x216307(_0x49d42c[_0xb4fd('0x17')][_0xb4fd('0x1e')]);}else{_0x216307(_0x49d42c[_0xb4fd('0x1f')]);}})[_0xb4fd('0x20')](function(_0x3498ad){_0x25bb7d(_0x3498ad);});});}function getAgent(_0x526fb2){return db['User']['findOne']({'where':{'id':_0x526fb2,'role':_0xb4fd('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x3617b2,_0x5e9d2b){return new BPromise(function(_0x5738c2,_0x282fe4){var _0x7c5313=respondWithRpcPromise(_0xb4fd('0x22'));var _0x4a057d=getAgent(_0x3617b2);Promise[_0xb4fd('0x23')]([_0x7c5313,_0x4a057d])[_0xb4fd('0x1c')](function(_0x68776){var _0x1a653b=_0x68776[0x0];var _0x5d5606=_0x68776[0x1];var _0xd72bc3=_[_0xb4fd('0x24')](_0x1a653b['rows'],function(_0x3e5060){return _0x3e5060[_0xb4fd('0x25')]==_0x5d5606['id']&&_0x3e5060[_0xb4fd('0x26')]==_0x5e9d2b;});if(_0xd72bc3['length']==0x1){_0x5738c2(_0x5d5606);}else{_0x282fe4(new RangeError(_0xb4fd('0x27')+_0x5e9d2b+_0xb4fd('0x28')));}});});}exports[_0xb4fd('0x29')]=function(_0x4d51bb,_0x55eed3){logger['info']('originate\x20fired:',_0x4d51bb[_0xb4fd('0x2a')]);var _0xf5e2c4=originateValidation[_0xb4fd('0x2b')](_0x4d51bb[_0xb4fd('0x2a')]);if(_0xf5e2c4[_0xb4fd('0x2c')]>0x0){return _0x55eed3[_0xb4fd('0x1a')](0x190)[_0xb4fd('0x2d')](_0xf5e2c4);}var _0x1a0457=_0x4d51bb[_0xb4fd('0x2a')][_0xb4fd('0x2e')];var _0x3f7688=_0x4d51bb[_0xb4fd('0x2a')][_0xb4fd('0x2f')];var _0x1db787=_0x4d51bb[_0xb4fd('0x2a')][_0xb4fd('0x30')];var _0x373b2e=_0x4d51bb[_0xb4fd('0x2a')]['callbackUrl'];return getAgent(_0x1a0457)['then'](function(_0x930751){logger[_0xb4fd('0x12')](_0xb4fd('0x31'),_0x930751[_0xb4fd('0x19')]);emit(util[_0xb4fd('0x32')]('user:%s',_0x930751[_0xb4fd('0x19')]),_0xb4fd('0x33'),{'callNumber':_0x3f7688,'callerId':_0x1db787,'callbackUrl':_0x373b2e});return _0x55eed3[_0xb4fd('0x1a')](0xc8)[_0xb4fd('0x2d')]({'error':![],'message':_0xb4fd('0x34')});})['catch'](handleError(_0x55eed3));};exports[_0xb4fd('0x35')]=function(_0x5c1b1a,_0xcda359){logger[_0xb4fd('0x12')]('hangup\x20fired:',_0x5c1b1a['body']);var _0xd598a2=hangupValidation[_0xb4fd('0x2b')](_0x5c1b1a[_0xb4fd('0x2a')]);if(_0xd598a2[_0xb4fd('0x2c')]>0x0){return _0xcda359[_0xb4fd('0x1a')](0x190)[_0xb4fd('0x2d')](_0xd598a2);}var _0x478cf3=_0x5c1b1a[_0xb4fd('0x2a')][_0xb4fd('0x2e')];var _0x597810=_0x5c1b1a[_0xb4fd('0x2a')][_0xb4fd('0x26')];return getAgent(_0x478cf3)[_0xb4fd('0x1c')](function(_0x39e607){logger['info'](_0xb4fd('0x31'),_0x39e607[_0xb4fd('0x19')]);emit(util[_0xb4fd('0x32')](_0xb4fd('0x36'),_0x39e607[_0xb4fd('0x19')]),_0xb4fd('0x37'),{'sessionId':_0x597810});return _0xcda359['status'](0xc8)[_0xb4fd('0x2d')]({'error':![],'message':_0xb4fd('0x38')});})['catch'](handleError(_0xcda359));};exports[_0xb4fd('0x39')]=function(_0x24dab1,_0x1d1a43){logger[_0xb4fd('0x12')](_0xb4fd('0x3a'),_0x24dab1['body']);var _0x244e9d=answerValidation[_0xb4fd('0x2b')](_0x24dab1[_0xb4fd('0x2a')]);if(_0x244e9d['length']>0x0){return _0x1d1a43[_0xb4fd('0x1a')](0x190)['json'](_0x244e9d);}var _0x3c1ffa=_0x24dab1[_0xb4fd('0x2a')]['userId'];var _0x563366=_0x24dab1['body'][_0xb4fd('0x26')];return getAgent(_0x3c1ffa)[_0xb4fd('0x1c')](function(_0x23c67f){logger['info'](_0xb4fd('0x31'),_0x23c67f[_0xb4fd('0x19')]);emit(util[_0xb4fd('0x32')](_0xb4fd('0x36'),_0x23c67f[_0xb4fd('0x19')]),_0xb4fd('0x3b'),{'sessionId':_0x563366});return _0x1d1a43[_0xb4fd('0x1a')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0xb4fd('0x20')](handleError(_0x1d1a43));};exports[_0xb4fd('0x3c')]=function(_0x74a4d4,_0x148181){logger['info'](_0xb4fd('0x3d'),_0x74a4d4['body']);var _0x4d5d04=holdValidation[_0xb4fd('0x2b')](_0x74a4d4[_0xb4fd('0x2a')]);if(_0x4d5d04['length']>0x0){return _0x148181[_0xb4fd('0x1a')](0x190)[_0xb4fd('0x2d')](_0x4d5d04);}var _0x4b7fa0=_0x74a4d4[_0xb4fd('0x2a')][_0xb4fd('0x2e')];var _0x3b6014=_0x74a4d4['body']['sessionId'];return getAgent(_0x4b7fa0)[_0xb4fd('0x1c')](function(_0x1b5f2d){logger[_0xb4fd('0x12')](_0xb4fd('0x31'),_0x1b5f2d['name']);emit(util[_0xb4fd('0x32')](_0xb4fd('0x36'),_0x1b5f2d['name']),_0xb4fd('0x3e'),{'sessionId':_0x3b6014});return _0x148181[_0xb4fd('0x1a')](0xc8)[_0xb4fd('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0xb4fd('0x20')](handleError(_0x148181));};exports[_0xb4fd('0x3f')]=function(_0x4ff60b,_0x47054f){logger['info']('unhold\x20fired:',_0x4ff60b[_0xb4fd('0x2a')]);var _0x1acdaf=unholdValidation[_0xb4fd('0x2b')](_0x4ff60b[_0xb4fd('0x2a')]);if(_0x1acdaf[_0xb4fd('0x2c')]>0x0){return _0x47054f[_0xb4fd('0x1a')](0x190)[_0xb4fd('0x2d')](_0x1acdaf);}var _0x315524=_0x4ff60b[_0xb4fd('0x2a')][_0xb4fd('0x2e')];var _0x77625b=_0x4ff60b[_0xb4fd('0x2a')][_0xb4fd('0x26')];return getAgent(_0x315524)[_0xb4fd('0x1c')](function(_0xbf4686){logger['info']('entityFound:',_0xbf4686[_0xb4fd('0x19')]);emit(util[_0xb4fd('0x32')](_0xb4fd('0x36'),_0xbf4686[_0xb4fd('0x19')]),_0xb4fd('0x40'),{'sessionId':_0x77625b});return _0x47054f['status'](0xc8)['json']({'error':![],'message':_0xb4fd('0x41')});})[_0xb4fd('0x20')](handleError(_0x47054f));};exports['calls']=function(_0x534f46,_0x5e28a8){logger[_0xb4fd('0x12')](_0xb4fd('0x42'),_0x5e28a8[_0xb4fd('0x2a')]);var _0xfdc372=callsValidation['validate'](_0x534f46['body']);if(_0xfdc372[_0xb4fd('0x2c')]>0x0){return _0x5e28a8[_0xb4fd('0x1a')](0x190)[_0xb4fd('0x2d')](_0xfdc372);}var _0x4c2f50=_0x534f46[_0xb4fd('0x2a')][_0xb4fd('0x2e')];var _0x135d0f=respondWithRpcPromise(_0xb4fd('0x22'));var _0x566b7c=getAgent(_0x4c2f50);return Promise[_0xb4fd('0x23')]([_0x135d0f,_0x566b7c])[_0xb4fd('0x1c')](function(_0x5758ae){var _0x340ef2=_0x5758ae[0x0];var _0x49efc4=_0x5758ae[0x1];var _0x3b8b71=_['filter'](_0x340ef2[_0xb4fd('0x43')],function(_0x2d80fa){return _0x2d80fa[_0xb4fd('0x25')]==_0x49efc4['id'];});return _0x5e28a8[_0xb4fd('0x1a')](0xc8)[_0xb4fd('0x2d')]({'count':_0x3b8b71[_0xb4fd('0x2c')],'rows':_0x3b8b71});})[_0xb4fd('0x20')](handleError(_0x5e28a8));};exports[_0xb4fd('0x44')]=function(_0x7021cf,_0x1e19e3){logger[_0xb4fd('0x12')](_0xb4fd('0x45'),_0x7021cf[_0xb4fd('0x2a')]);var _0x454acd=conferenceValidation['validate'](_0x7021cf[_0xb4fd('0x2a')]);if(_0x454acd['length']>0x0){return _0x1e19e3[_0xb4fd('0x1a')](0x190)['json'](_0x454acd);}var _0x244f91=_0x7021cf[_0xb4fd('0x2a')][_0xb4fd('0x2e')];return getAgent(_0x244f91)[_0xb4fd('0x1c')](function(_0x58f430){logger['info'](_0xb4fd('0x31'),_0x58f430['name']);emit(util[_0xb4fd('0x32')](_0xb4fd('0x36'),_0x58f430[_0xb4fd('0x19')]),'webbar:conference');return _0x1e19e3[_0xb4fd('0x1a')](0xc8)['json']({'error':![],'message':_0xb4fd('0x46')});})[_0xb4fd('0x20')](handleError(_0x1e19e3));};exports[_0xb4fd('0x47')]=function(_0x2fe519,_0x521ff6){logger[_0xb4fd('0x12')]('transfer\x20fired:',_0x2fe519[_0xb4fd('0x2a')]);var _0x3c573a=transferValidation[_0xb4fd('0x2b')](_0x2fe519['body']);if(_0x3c573a['length']>0x0){return _0x521ff6['status'](0x190)[_0xb4fd('0x2d')](_0x3c573a);}var _0x5ce30c=_0x2fe519[_0xb4fd('0x2a')]['userId'];var _0x210a0f=_0x2fe519[_0xb4fd('0x2a')][_0xb4fd('0x26')];var _0x16a3e0=_0x2fe519['body'][_0xb4fd('0x48')];return getAgent(_0x5ce30c)[_0xb4fd('0x1c')](function(_0x5b4ebe){logger[_0xb4fd('0x12')](_0xb4fd('0x31'),_0x5b4ebe['name']);emit(util[_0xb4fd('0x32')](_0xb4fd('0x36'),_0x5b4ebe['name']),_0xb4fd('0x49'),{'sessionId':_0x210a0f,'transferNumber':_0x16a3e0});return _0x521ff6[_0xb4fd('0x1a')](0xc8)[_0xb4fd('0x2d')]({'error':![],'message':_0xb4fd('0x4a')});})[_0xb4fd('0x20')](handleError(_0x521ff6));};
\ No newline at end of file
+var _0x55e0=['NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','json','originate\x20executed!','hangup\x20fired:','userId','format','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send'];(function(_0x395f4a,_0x53aec1){var _0x5a3a86=function(_0x3afd21){while(--_0x3afd21){_0x395f4a['push'](_0x395f4a['shift']());}};_0x5a3a86(++_0x53aec1);}(_0x55e0,0xdc));var _0x055e=function(_0x4fa804,_0x595aec){_0x4fa804=_0x4fa804-0x0;var _0x335b27=_0x55e0[_0x4fa804];return _0x335b27;};'use strict';var path=require(_0x055e('0x0'));var fs=require('fs');var _=require(_0x055e('0x1'));var db=require(_0x055e('0x2'))['db'];var config=require(_0x055e('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x055e('0x4'));var amiClient=jayson[_0x055e('0x5')][_0x055e('0x6')]({'port':0x232a});var logger=require(_0x055e('0x7'))(_0x055e('0x8'));var Redis=require(_0x055e('0x9'));config['redis']=_['defaults'](config[_0x055e('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x055e('0xb'))(new Redis(config[_0x055e('0xa')]));var Schema=require(_0x055e('0xc'));var originateValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'callNumber':{'type':'string','required':[!![],_0x055e('0xf')]},'callerId':{'type':_0x055e('0x10')},'callbackUrl':{'type':_0x055e('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x055e('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':_0x055e('0x10'),'required':[!![],_0x055e('0x11')]},'transferNumber':{'type':_0x055e('0x10'),'required':[!![],_0x055e('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x055e('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':_0x055e('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]}});function emit(_0x111cdb,_0x599533,_0x3f2d0e){logger[_0x055e('0x13')](_0x111cdb,_0x599533,JSON[_0x055e('0x14')](_0x3f2d0e));io['to'](_0x111cdb)[_0x055e('0x15')](_0x599533,_0x3f2d0e);}function handleError(_0x2cc84e){return function(_0x4c85dd){console[_0x055e('0x16')](_0x055e('0x17'),_0x4c85dd,_0x4c85dd instanceof RangeError);logger[_0x055e('0x18')](_0x4c85dd[_0x055e('0x19')]);if(_0x4c85dd instanceof RangeError){if(_0x4c85dd['name']){delete _0x4c85dd[_0x055e('0x1a')];}_0x2cc84e[_0x055e('0x1b')](0x194)['send'](_0x4c85dd);}else{if(_0x4c85dd[_0x055e('0x1a')]){delete _0x4c85dd[_0x055e('0x1a')];}_0x2cc84e[_0x055e('0x1b')](0x1f4)[_0x055e('0x1c')](_0x4c85dd);}};}function checkError(){return function(_0x4280cf){if(!_0x4280cf){throw new RangeError(_0x055e('0x1d'));}return _0x4280cf;};}function respondWithRpcPromise(_0x53b766,_0x31c355){return new BPromise(function(_0x2f0346,_0x211594){var _0x5930ff=amiClient;return _0x5930ff[_0x055e('0x1e')](_0x53b766,_0x31c355)[_0x055e('0x1f')](function(_0x32c64e){if(_0x32c64e[_0x055e('0x18')]){if(_0x32c64e['error'][_0x055e('0x20')]===0x1f4){return _0x211594(_0x32c64e['error'][_0x055e('0x21')]);}return _0x2f0346(_0x32c64e[_0x055e('0x18')][_0x055e('0x21')]);}else{_0x2f0346(_0x32c64e[_0x055e('0x22')]);}})[_0x055e('0x23')](function(_0x4c653c){_0x211594(_0x4c653c);});});}function getAgent(_0x58caf9){return db[_0x055e('0x24')][_0x055e('0x25')]({'where':{'id':_0x58caf9,'role':_0x055e('0x26')}})['then'](checkError());}function getAgentCheckSession(_0x408e38,_0x29078a){return new BPromise(function(_0x42f2df,_0x2ef064){var _0x59539d=respondWithRpcPromise(_0x055e('0x27'));var _0x5958ef=getAgent(_0x408e38);Promise[_0x055e('0x28')]([_0x59539d,_0x5958ef])[_0x055e('0x1f')](function(_0x23a506){var _0x7822db=_0x23a506[0x0];var _0x1610f1=_0x23a506[0x1];var _0x5c0e76=_[_0x055e('0x29')](_0x7822db[_0x055e('0x2a')],function(_0x293062){return _0x293062[_0x055e('0x2b')]==_0x1610f1['id']&&_0x293062[_0x055e('0x2c')]==_0x29078a;});if(_0x5c0e76[_0x055e('0x2d')]==0x1){_0x42f2df(_0x1610f1);}else{_0x2ef064(new RangeError(_0x055e('0x2e')+_0x29078a+_0x055e('0x2f')));}});});}exports['originate']=function(_0x26d1c2,_0x43ec84){logger['info'](_0x055e('0x30'),_0x26d1c2[_0x055e('0x31')]);var _0x524344=originateValidation[_0x055e('0xc')](_0x26d1c2[_0x055e('0x31')]);if(_0x524344[_0x055e('0x2d')]>0x0){return _0x43ec84['status'](0x190)['json'](_0x524344);}var _0x25d19d=_0x26d1c2['body']['userId'];var _0x55a1ee=_0x26d1c2[_0x055e('0x31')][_0x055e('0x32')];var _0x35c6cf=_0x26d1c2[_0x055e('0x31')][_0x055e('0x33')];var _0x16a4fa=_0x26d1c2[_0x055e('0x31')][_0x055e('0x34')];return getAgent(_0x25d19d)[_0x055e('0x1f')](function(_0x2f60fa){logger[_0x055e('0x13')](_0x055e('0x35'),_0x2f60fa['name']);emit(util['format'](_0x055e('0x36'),_0x2f60fa[_0x055e('0x1a')]),_0x055e('0x37'),{'callNumber':_0x55a1ee,'callerId':_0x35c6cf,'callbackUrl':_0x16a4fa});return _0x43ec84[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x39')});})[_0x055e('0x23')](handleError(_0x43ec84));};exports['hangup']=function(_0x18b88e,_0x265fed){logger[_0x055e('0x13')](_0x055e('0x3a'),_0x18b88e[_0x055e('0x31')]);var _0x585b8a=hangupValidation[_0x055e('0xc')](_0x18b88e[_0x055e('0x31')]);if(_0x585b8a['length']>0x0){return _0x265fed[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x585b8a);}var _0x4a97ab=_0x18b88e[_0x055e('0x31')][_0x055e('0x3b')];var _0x4e424b=_0x18b88e[_0x055e('0x31')][_0x055e('0x2c')];return getAgent(_0x4a97ab)['then'](function(_0x1012a4){logger[_0x055e('0x13')](_0x055e('0x35'),_0x1012a4['name']);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x1012a4['name']),_0x055e('0x3d'),{'sessionId':_0x4e424b});return _0x265fed[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':'hangup\x20executed!'});})[_0x055e('0x23')](handleError(_0x265fed));};exports[_0x055e('0x3e')]=function(_0x176a2d,_0x4fa534){logger['info'](_0x055e('0x3f'),_0x176a2d[_0x055e('0x31')]);var _0x4ff19e=answerValidation[_0x055e('0xc')](_0x176a2d['body']);if(_0x4ff19e[_0x055e('0x2d')]>0x0){return _0x4fa534['status'](0x190)[_0x055e('0x38')](_0x4ff19e);}var _0x31c57a=_0x176a2d[_0x055e('0x31')]['userId'];var _0x57483c=_0x176a2d[_0x055e('0x31')][_0x055e('0x2c')];return getAgent(_0x31c57a)[_0x055e('0x1f')](function(_0x445d74){logger['info']('entityFound:',_0x445d74[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')]('user:%s',_0x445d74[_0x055e('0x1a')]),_0x055e('0x40'),{'sessionId':_0x57483c});return _0x4fa534[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x41')});})[_0x055e('0x23')](handleError(_0x4fa534));};exports['hold']=function(_0x297edd,_0x118a0e){logger['info'](_0x055e('0x42'),_0x297edd[_0x055e('0x31')]);var _0x341c46=holdValidation[_0x055e('0xc')](_0x297edd[_0x055e('0x31')]);if(_0x341c46[_0x055e('0x2d')]>0x0){return _0x118a0e[_0x055e('0x1b')](0x190)['json'](_0x341c46);}var _0x35b2c6=_0x297edd['body'][_0x055e('0x3b')];var _0xed7611=_0x297edd[_0x055e('0x31')]['sessionId'];return getAgent(_0x35b2c6)['then'](function(_0x45845e){logger[_0x055e('0x13')](_0x055e('0x35'),_0x45845e[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x45845e[_0x055e('0x1a')]),_0x055e('0x43'),{'sessionId':_0xed7611});return _0x118a0e[_0x055e('0x1b')](0xc8)['json']({'error':![],'message':_0x055e('0x44')});})[_0x055e('0x23')](handleError(_0x118a0e));};exports[_0x055e('0x45')]=function(_0x17695b,_0x335415){logger['info'](_0x055e('0x46'),_0x17695b[_0x055e('0x31')]);var _0x3e7fa6=unholdValidation['validate'](_0x17695b[_0x055e('0x31')]);if(_0x3e7fa6['length']>0x0){return _0x335415[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x3e7fa6);}var _0x49129a=_0x17695b[_0x055e('0x31')][_0x055e('0x3b')];var _0x3e6329=_0x17695b['body']['sessionId'];return getAgent(_0x49129a)[_0x055e('0x1f')](function(_0x413778){logger[_0x055e('0x13')](_0x055e('0x35'),_0x413778[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x413778[_0x055e('0x1a')]),_0x055e('0x47'),{'sessionId':_0x3e6329});return _0x335415[_0x055e('0x1b')](0xc8)['json']({'error':![],'message':_0x055e('0x48')});})[_0x055e('0x23')](handleError(_0x335415));};exports[_0x055e('0x49')]=function(_0x200b53,_0x57a9e4){logger[_0x055e('0x13')](_0x055e('0x4a'),_0x57a9e4[_0x055e('0x31')]);var _0x3eb1a1=callsValidation['validate'](_0x200b53['body']);if(_0x3eb1a1[_0x055e('0x2d')]>0x0){return _0x57a9e4[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x3eb1a1);}var _0x2fbb1c=_0x200b53[_0x055e('0x31')][_0x055e('0x3b')];var _0x3876d0=respondWithRpcPromise(_0x055e('0x27'));var _0x56db9c=getAgent(_0x2fbb1c);return Promise['all']([_0x3876d0,_0x56db9c])[_0x055e('0x1f')](function(_0x33592d){var _0x5240d5=_0x33592d[0x0];var _0x143e8c=_0x33592d[0x1];var _0x16dd1e=_[_0x055e('0x29')](_0x5240d5[_0x055e('0x2a')],function(_0x50aa1f){return _0x50aa1f[_0x055e('0x2b')]==_0x143e8c['id'];});return _0x57a9e4[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'count':_0x16dd1e[_0x055e('0x2d')],'rows':_0x16dd1e});})[_0x055e('0x23')](handleError(_0x57a9e4));};exports[_0x055e('0x4b')]=function(_0x2075db,_0x31935b){logger['info'](_0x055e('0x4c'),_0x2075db[_0x055e('0x31')]);var _0x5bd8f0=conferenceValidation[_0x055e('0xc')](_0x2075db[_0x055e('0x31')]);if(_0x5bd8f0[_0x055e('0x2d')]>0x0){return _0x31935b[_0x055e('0x1b')](0x190)['json'](_0x5bd8f0);}var _0x8b7e45=_0x2075db[_0x055e('0x31')][_0x055e('0x3b')];return getAgent(_0x8b7e45)['then'](function(_0x329d46){logger[_0x055e('0x13')](_0x055e('0x35'),_0x329d46[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')]('user:%s',_0x329d46[_0x055e('0x1a')]),_0x055e('0x4d'));return _0x31935b[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x4e')});})['catch'](handleError(_0x31935b));};exports[_0x055e('0x4f')]=function(_0x34c805,_0x107b88){logger['info'](_0x055e('0x50'),_0x34c805[_0x055e('0x31')]);var _0x3ecc65=transferValidation[_0x055e('0xc')](_0x34c805[_0x055e('0x31')]);if(_0x3ecc65['length']>0x0){return _0x107b88[_0x055e('0x1b')](0x190)['json'](_0x3ecc65);}var _0x24ac0c=_0x34c805[_0x055e('0x31')]['userId'];var _0x3137bb=_0x34c805[_0x055e('0x31')][_0x055e('0x2c')];var _0x2bdf06=_0x34c805['body']['transferNumber'];return getAgent(_0x24ac0c)[_0x055e('0x1f')](function(_0x5e4f42){logger[_0x055e('0x13')](_0x055e('0x35'),_0x5e4f42[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x5e4f42[_0x055e('0x1a')]),_0x055e('0x51'),{'sessionId':_0x3137bb,'transferNumber':_0x2bdf06});return _0x107b88[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x52')});})['catch'](handleError(_0x107b88));};
\ No newline at end of file
index 914551a..0216448 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','notify','put','update','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x50e7e0,_0x5affce){var _0x1a0307=function(_0x32d343){while(--_0x32d343){_0x50e7e0['push'](_0x50e7e0['shift']());}};_0x1a0307(++_0x5affce);}(_0x7880,0x1f4));var _0x0788=function(_0x3ad5e8,_0x49cd96){_0x3ad5e8=_0x3ad5e8-0x0;var _0xdd51a4=_0x7880[_0x3ad5e8];return _0xdd51a4;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['get'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x11')]);router[_0x0788('0x9')](_0x0788('0x12'),auth['isAuthenticated'](),controller[_0x0788('0x13')]);router[_0x0788('0x9')](_0x0788('0x14'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);router[_0x0788('0x9')](_0x0788('0x16'),auth['isAuthenticated'](),controller[_0x0788('0x17')]);router[_0x0788('0x18')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0x19')]);router['post'](_0x0788('0x10'),auth['isAuthenticated'](),controller[_0x0788('0x1a')]);router[_0x0788('0x18')](_0x0788('0x12'),auth[_0x0788('0xa')](),controller[_0x0788('0x1b')]);router[_0x0788('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x0788('0x1c')]);router[_0x0788('0x18')]('/:id/applications',auth[_0x0788('0xa')](),controller[_0x0788('0x1d')]);router[_0x0788('0x18')]('/:id/notify',controller[_0x0788('0x1e')]);router[_0x0788('0x18')]('/:id/send',auth[_0x0788('0xa')](),controller['send']);router[_0x0788('0x1f')]('/:id',auth[_0x0788('0xa')](),controller[_0x0788('0x20')]);router[_0x0788('0x21')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['destroy']);router['delete'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x22')]);router[_0x0788('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0788('0x23')]);router[_0x0788('0x21')](_0x0788('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0788('0x24')]=router;
\ No newline at end of file
+var _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x47c5,0x165));var _0x547c=function(_0x14df7f,_0x12da2c){_0x14df7f=_0x14df7f-0x0;var _0x36ee87=_0x47c5[_0x14df7f];return _0x36ee87;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router;
\ No newline at end of file
index 3720d1b..b847b71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf44=['mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports','STRING','name','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x360515,_0x5bb856){var _0x199b37=function(_0x1da3d8){while(--_0x1da3d8){_0x360515['push'](_0x360515['shift']());}};_0x199b37(++_0x5bb856);}(_0xcf44,0x12e));var _0x4cf4=function(_0x5e1081,_0x345f08){_0x5e1081=_0x5e1081-0x0;var _0x243b56=_0xcf44[_0x5e1081];return _0x243b56;};'use strict';var Sequelize=require(_0x4cf4('0x0'));var rs=require(_0x4cf4('0x1'));module[_0x4cf4('0x2')]={'name':{'type':Sequelize[_0x4cf4('0x3')],'unique':_0x4cf4('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x4cf4('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4cf4('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x4cf4('0x3')]},'type':{'type':Sequelize[_0x4cf4('0x5')](_0x4cf4('0x6'),_0x4cf4('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x4cf4('0x3')]},'authToken':{'type':Sequelize[_0x4cf4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x4cf4('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4cf4('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x4cf4('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4cf4('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4cf4('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4cf4('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4cf4('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4cf4('0xa')],'comment':_0x4cf4('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x4cf4('0x9')],'defaultValue':![],'comment':_0x4cf4('0xc'),'set':function(_0x1c8fab){if(!_0x1c8fab){this['setDataValue'](_0x4cf4('0xd'),null);}this[_0x4cf4('0xe')]('mandatoryDisposition',_0x1c8fab);}},'description':{'type':Sequelize[_0x4cf4('0x3')]}};
\ No newline at end of file
+var _0xc946=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x580d96,_0x2d9db1){var _0x4dece4=function(_0x1aea15){while(--_0x1aea15){_0x580d96['push'](_0x580d96['shift']());}};_0x4dece4(++_0x2d9db1);}(_0xc946,0x7b));var _0x6c94=function(_0x93fc54,_0xfa543f){_0x93fc54=_0x93fc54-0x0;var _0x54d6a4=_0xc946[_0x93fc54];return _0x54d6a4;};'use strict';var Sequelize=require(_0x6c94('0x0'));var rs=require(_0x6c94('0x1'));module[_0x6c94('0x2')]={'name':{'type':Sequelize[_0x6c94('0x3')],'unique':_0x6c94('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x6c94('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6c94('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x6c94('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6c94('0x5')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0x6c94('0x3')]},'baseUrl':{'type':Sequelize[_0x6c94('0x3')]},'authToken':{'type':Sequelize[_0x6c94('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6c94('0x6');}},'notificationSound':{'type':Sequelize[_0x6c94('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6c94('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6c94('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6c94('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6c94('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6c94('0x8')],'comment':_0x6c94('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6c94('0xa'),'set':function(_0x366bfc){if(!_0x366bfc){this['setDataValue'](_0x6c94('0xb'),null);}this['setDataValue'](_0x6c94('0xc'),_0x366bfc);}},'description':{'type':Sequelize[_0x6c94('0x3')]}};
\ No newline at end of file
index 09bb464..aabcbcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6566=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','client','http','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','autoAssociation','describe','addDisposition','getDispositions','findOne','WhatsappAccountId','Disposition','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','bulkCreate','WhatsappApplication','findAndCountAll','priority','getApplications','notify','AC\x20WhatsappAccount\x20notify','whatsapp','account','applications','asc','Applications','Sequelize','ValidationError','AC\x20sinch\x20attributes:%s','AC\x20sinch\x20req.body:%s','difference','createdAt','updatedAt','ListId','mobile','AC\x20sinch\x20routing.body:%s','AC\x20sinch\x20contactFields:%s','twilio','from','From','replace','whatsapp:','Body','messageId','sinch','AC\x20sinch\x20req.body\x202:%s','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','defaults','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6566,0x17a));var _0x6656=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x6566[_0xbe40ad];return _0x50fac9;};'use strict';var emlformat=require(_0x6656('0x0'));var rimraf=require(_0x6656('0x1'));var zipdir=require(_0x6656('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6656('0x3'));var moment=require('moment');var BPromise=require(_0x6656('0x4'));var Mustache=require(_0x6656('0x5'));var util=require('util');var path=require(_0x6656('0x6'));var sox=require(_0x6656('0x7'));var csv=require(_0x6656('0x8'));var ejs=require(_0x6656('0x9'));var fs=require('fs');var fs_extra=require(_0x6656('0xa'));var _=require(_0x6656('0xb'));var squel=require(_0x6656('0xc'));var crypto=require('crypto');var jsforce=require(_0x6656('0xd'));var deskjs=require(_0x6656('0xe'));var toCsv=require(_0x6656('0x8'));var querystring=require(_0x6656('0xf'));var Papa=require(_0x6656('0x10'));var Redis=require(_0x6656('0x11'));var authService=require(_0x6656('0x12'));var qs=require(_0x6656('0x13'));var as=require(_0x6656('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6656('0x15'));var config=require(_0x6656('0x16'));var licenseUtil=require(_0x6656('0x17'));var db=require(_0x6656('0x18'))['db'];config['redis']=_['defaults'](config[_0x6656('0x19')],{'host':_0x6656('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6656('0x19')]));require('./whatsappAccount.socket')[_0x6656('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6656('0x1c')][_0x6656('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x356685,_0x1b5032,_0x390e4d,_0x2ea4bb){return new BPromise(function(_0x22b5b8,_0x3310f3){var _0x25315b=_0x2ea4bb||client;return _0x25315b['request'](_0x356685,_0x390e4d)['then'](function(_0x52690b){logger[_0x6656('0x1e')](_0x6656('0x1f'),_0x1b5032,_0x6656('0x20'));logger[_0x6656('0x21')](_0x6656('0x22'),_0x1b5032,_0x6656('0x20'),JSON[_0x6656('0x23')](_0x52690b));if(_0x52690b[_0x6656('0x24')]){if(_0x52690b[_0x6656('0x24')][_0x6656('0x25')]===0x1f4){logger[_0x6656('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x1b5032,_0x52690b['error'][_0x6656('0x26')]);return _0x3310f3(_0x52690b[_0x6656('0x24')][_0x6656('0x26')]);}logger[_0x6656('0x24')](_0x6656('0x1f'),_0x1b5032,_0x52690b[_0x6656('0x24')][_0x6656('0x26')]);return _0x22b5b8(_0x52690b[_0x6656('0x24')][_0x6656('0x26')]);}else{logger[_0x6656('0x1e')]('WhatsappAccount,\x20%s,\x20%s',_0x1b5032,'request\x20sent');_0x22b5b8(_0x52690b[_0x6656('0x27')][_0x6656('0x26')]);}})[_0x6656('0x28')](function(_0x2f86c7){logger['error'](_0x6656('0x1f'),_0x1b5032,_0x2f86c7);_0x3310f3(_0x2f86c7);});});}function respondWithStatusCode(_0x6081d8,_0x5e8a74){_0x5e8a74=_0x5e8a74||0xcc;return function(_0x4f2305){if(_0x4f2305){return _0x6081d8['sendStatus'](_0x5e8a74);}return _0x6081d8[_0x6656('0x29')](_0x5e8a74)[_0x6656('0x2a')]();};}function respondWithResult(_0x7e56b8,_0xce1c31){_0xce1c31=_0xce1c31||0xc8;return function(_0x342d1a){if(_0x342d1a){return _0x7e56b8[_0x6656('0x29')](_0xce1c31)[_0x6656('0x2b')](_0x342d1a);}};}function respondWithFilteredResult(_0x34758e,_0x1fdd4e){return function(_0x1c95dc){if(_0x1c95dc){var _0x16fef5=typeof _0x1fdd4e[_0x6656('0x2c')]===_0x6656('0x2d')&&typeof _0x1fdd4e[_0x6656('0x2e')]===_0x6656('0x2d');var _0x27a883=_0x1c95dc[_0x6656('0x2f')];var _0x5824eb=_0x16fef5?0x0:_0x1fdd4e[_0x6656('0x2c')];var _0x5a7213=_0x16fef5?_0x1c95dc[_0x6656('0x2f')]:_0x1fdd4e[_0x6656('0x2c')]+_0x1fdd4e[_0x6656('0x2e')];var _0x4da229;if(_0x5a7213>=_0x27a883){_0x5a7213=_0x27a883;_0x4da229=0xc8;}else{_0x4da229=0xce;}_0x34758e[_0x6656('0x29')](_0x4da229);return _0x34758e[_0x6656('0x30')](_0x6656('0x31'),_0x5824eb+'-'+_0x5a7213+'/'+_0x27a883)['json'](_0x1c95dc);}return null;};}function patchUpdates(_0x1c21ce){return function(_0xf4bd5e){try{jsonpatch[_0x6656('0x32')](_0xf4bd5e,_0x1c21ce,!![]);}catch(_0x4b09eb){return BPromise[_0x6656('0x33')](_0x4b09eb);}return _0xf4bd5e[_0x6656('0x34')]();};}function saveUpdates(_0x12f8f4,_0x43ba63){return function(_0x56cb20){if(_0x56cb20){return _0x56cb20[_0x6656('0x35')](_0x12f8f4)[_0x6656('0x36')](function(_0x173b59){return _0x173b59;});}return null;};}function removeEntity(_0x2bb00b,_0x262ef0){return function(_0x48e50){if(_0x48e50){return _0x48e50[_0x6656('0x37')]()[_0x6656('0x36')](function(){var _0x83f1b4=_0x48e50[_0x6656('0x38')]({'plain':!![]});var _0x23d099='WhatsappAccounts';return db[_0x6656('0x39')][_0x6656('0x37')]({'where':{'type':_0x23d099,'resourceId':_0x83f1b4['id']}})[_0x6656('0x36')](function(){return _0x48e50;});})[_0x6656('0x36')](function(){_0x2bb00b['status'](0xcc)[_0x6656('0x2a')]();});}};}function handleEntityNotFound(_0x2dac45,_0x1a9290){return function(_0x5a16b5){if(!_0x5a16b5){_0x2dac45['sendStatus'](0x194);}return _0x5a16b5;};}function handleError(_0x1435e7,_0x32e70a){_0x32e70a=_0x32e70a||0x1f4;return function(_0x26849c){logger['error'](_0x26849c[_0x6656('0x3a')]);if(_0x26849c[_0x6656('0x3b')]){delete _0x26849c[_0x6656('0x3b')];}_0x1435e7['status'](_0x32e70a)[_0x6656('0x3c')](_0x26849c);};}exports[_0x6656('0x3d')]=function(_0x3f3d85,_0xf076b3){var _0x4cf691={'include':[{'model':db[_0x6656('0x3e')],'as':_0x6656('0x3f')}]},_0x5dab60={},_0x489520={'count':0x0,'rows':[]};var _0x376aef=_[_0x6656('0x40')](db[_0x6656('0x41')][_0x6656('0x42')],function(_0x173d92){return{'name':_0x173d92[_0x6656('0x43')],'type':_0x173d92[_0x6656('0x44')][_0x6656('0x45')]};});_0x5dab60[_0x6656('0x46')]=_[_0x6656('0x40')](_0x376aef,_0x6656('0x3b'));_0x5dab60['query']=_[_0x6656('0x47')](_0x3f3d85[_0x6656('0x48')]);_0x5dab60[_0x6656('0x49')]=_[_0x6656('0x4a')](_0x5dab60[_0x6656('0x46')],_0x5dab60[_0x6656('0x48')]);_0x4cf691[_0x6656('0x4b')]=_['intersection'](_0x5dab60['model'],qs[_0x6656('0x4c')](_0x3f3d85[_0x6656('0x48')][_0x6656('0x4c')]));_0x4cf691[_0x6656('0x4b')]=_0x4cf691['attributes'][_0x6656('0x4d')]?_0x4cf691[_0x6656('0x4b')]:_0x5dab60[_0x6656('0x46')];if(!_0x3f3d85['query'][_0x6656('0x4e')](_0x6656('0x4f'))){_0x4cf691['limit']=qs[_0x6656('0x2e')](_0x3f3d85['query'][_0x6656('0x2e')]);_0x4cf691[_0x6656('0x2c')]=qs[_0x6656('0x2c')](_0x3f3d85[_0x6656('0x48')]['offset']);}_0x4cf691[_0x6656('0x50')]=qs[_0x6656('0x51')](_0x3f3d85[_0x6656('0x48')]['sort']);_0x4cf691[_0x6656('0x52')]=qs[_0x6656('0x49')](_[_0x6656('0x53')](_0x3f3d85[_0x6656('0x48')],_0x5dab60[_0x6656('0x49')]),_0x376aef);if(_0x3f3d85[_0x6656('0x48')][_0x6656('0x54')]){_0x4cf691['where']=_[_0x6656('0x55')](_0x4cf691[_0x6656('0x52')],{'$or':_['map'](_0x376aef,function(_0x3e5773){if(_0x3e5773['type']!==_0x6656('0x56')){var _0x5c90de={};_0x5c90de[_0x3e5773[_0x6656('0x3b')]]={'$like':'%'+_0x3f3d85[_0x6656('0x48')]['filter']+'%'};return _0x5c90de;}})});}_0x4cf691=_[_0x6656('0x55')]({},_0x4cf691,_0x3f3d85[_0x6656('0x57')]);var _0x903a25={'where':_0x4cf691['where']};return db[_0x6656('0x41')][_0x6656('0x2f')](_0x903a25)[_0x6656('0x36')](function(_0x53a1dd){_0x489520['count']=_0x53a1dd;if(_0x3f3d85[_0x6656('0x48')][_0x6656('0x58')]){_0x4cf691[_0x6656('0x59')]=[{'all':!![]}];}return db[_0x6656('0x41')][_0x6656('0x5a')](_0x4cf691);})[_0x6656('0x36')](function(_0x22333a){_0x489520['rows']=_0x22333a;return _0x489520;})[_0x6656('0x36')](respondWithFilteredResult(_0xf076b3,_0x4cf691))[_0x6656('0x28')](handleError(_0xf076b3,null));};exports[_0x6656('0x5b')]=function(_0x25ff09,_0x138bb9){var _0x11afe6={'raw':![],'where':{'id':_0x25ff09[_0x6656('0x5c')]['id']},'include':[{'model':db[_0x6656('0x3e')],'as':_0x6656('0x3f')}]},_0x386a04={};_0x386a04[_0x6656('0x46')]=_[_0x6656('0x47')](db[_0x6656('0x41')][_0x6656('0x42')]);_0x386a04[_0x6656('0x48')]=_[_0x6656('0x47')](_0x25ff09['query']);_0x386a04[_0x6656('0x49')]=_[_0x6656('0x4a')](_0x386a04[_0x6656('0x46')],_0x386a04[_0x6656('0x48')]);_0x11afe6[_0x6656('0x4b')]=_[_0x6656('0x4a')](_0x386a04[_0x6656('0x46')],qs[_0x6656('0x4c')](_0x25ff09['query']['fields']));_0x11afe6['attributes']=_0x11afe6['attributes']['length']?_0x11afe6[_0x6656('0x4b')]:_0x386a04[_0x6656('0x46')];if(_0x25ff09[_0x6656('0x48')]['includeAll']){_0x11afe6[_0x6656('0x59')]=[{'all':!![]}];}_0x11afe6=_[_0x6656('0x55')]({},_0x11afe6,_0x25ff09[_0x6656('0x57')]);return db[_0x6656('0x41')][_0x6656('0x5d')](_0x11afe6)[_0x6656('0x36')](handleEntityNotFound(_0x138bb9,null))['then'](respondWithResult(_0x138bb9,null))[_0x6656('0x28')](handleError(_0x138bb9,null));};exports[_0x6656('0x5e')]=function(_0x375157,_0x378aef){return db[_0x6656('0x41')][_0x6656('0x5e')](_0x375157[_0x6656('0x5f')],{})['then'](function(_0x423d9c){var _0x1ddf54=_0x375157[_0x6656('0x60')][_0x6656('0x38')]({'plain':!![]});if(!_0x1ddf54)throw new Error(_0x6656('0x61'));if(_0x1ddf54[_0x6656('0x62')]==='user'){var _0x34f999=_0x423d9c[_0x6656('0x38')]({'plain':!![]});var _0x15b0b6=_0x6656('0x63');return db['UserProfileSection']['find']({'where':{'name':_0x15b0b6,'userProfileId':_0x1ddf54['userProfileId']},'raw':!![]})[_0x6656('0x36')](function(_0x4e85de){if(_0x4e85de&&_0x4e85de[_0x6656('0x64')]===0x0){return db['UserProfileResource'][_0x6656('0x5e')]({'name':_0x34f999['name'],'resourceId':_0x34f999['id'],'type':_0x4e85de[_0x6656('0x3b')],'sectionId':_0x4e85de['id']},{})[_0x6656('0x36')](function(){return _0x423d9c;});}else{return _0x423d9c;}})[_0x6656('0x28')](function(_0x2c379e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c379e);throw _0x2c379e;});}return _0x423d9c;})[_0x6656('0x36')](respondWithResult(_0x378aef,0xc9))[_0x6656('0x28')](handleError(_0x378aef,null));};exports[_0x6656('0x35')]=function(_0x57a2a9,_0x38a3f1){if(_0x57a2a9['body']['id']){delete _0x57a2a9[_0x6656('0x5f')]['id'];}return db[_0x6656('0x41')][_0x6656('0x5d')]({'where':{'id':_0x57a2a9['params']['id']},'include':[{'model':db[_0x6656('0x3e')],'as':_0x6656('0x3f')}]})['then'](handleEntityNotFound(_0x38a3f1,null))[_0x6656('0x36')](saveUpdates(_0x57a2a9['body'],null))[_0x6656('0x36')](respondWithResult(_0x38a3f1,null))[_0x6656('0x28')](handleError(_0x38a3f1,null));};exports[_0x6656('0x37')]=function(_0x29ab2e,_0x4a60c3){return db[_0x6656('0x41')][_0x6656('0x5d')]({'where':{'id':_0x29ab2e[_0x6656('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4a60c3,null))['then'](removeEntity(_0x4a60c3,null))[_0x6656('0x28')](handleError(_0x4a60c3,null));};exports[_0x6656('0x65')]=function(_0x42bbea,_0x50c422){return db[_0x6656('0x41')]['describe']()[_0x6656('0x36')](respondWithResult(_0x50c422,null))['catch'](handleError(_0x50c422,null));};exports[_0x6656('0x66')]=function(_0x44c53f,_0x15e1cd,_0x5a5aed){if(_0x44c53f[_0x6656('0x5f')]['id']){delete _0x44c53f[_0x6656('0x5f')]['id'];}return db[_0x6656('0x41')][_0x6656('0x5d')]({'where':{'id':_0x44c53f[_0x6656('0x5c')]['id']}})['then'](handleEntityNotFound(_0x15e1cd,null))[_0x6656('0x36')](function(_0x1b105c){if(_0x1b105c){_0x44c53f[_0x6656('0x5f')]['WhatsappAccountId']=_0x1b105c['id'];return db['Disposition'][_0x6656('0x5e')](_0x44c53f['body']);}})['then'](respondWithResult(_0x15e1cd,null))[_0x6656('0x28')](handleError(_0x15e1cd,null));};exports[_0x6656('0x67')]=function(_0x49d31a,_0xe2e065,_0x42d1b2){var _0x31f957={'raw':![],'where':{}};var _0x10c960={};var _0x523dd0={'count':0x0,'rows':[]};return db[_0x6656('0x41')][_0x6656('0x68')]({'where':{'id':_0x49d31a[_0x6656('0x5c')]['id']}})[_0x6656('0x36')](handleEntityNotFound(_0xe2e065,null))[_0x6656('0x36')](function(_0x1a199b){if(_0x1a199b){_0x10c960[_0x6656('0x46')]=_[_0x6656('0x47')](db['Disposition'][_0x6656('0x42')]);_0x10c960[_0x6656('0x48')]=_['keys'](_0x49d31a[_0x6656('0x48')]);_0x10c960[_0x6656('0x49')]=_['intersection'](_0x10c960['model'],_0x10c960[_0x6656('0x48')]);_0x31f957['attributes']=_[_0x6656('0x4a')](_0x10c960[_0x6656('0x46')],qs[_0x6656('0x4c')](_0x49d31a[_0x6656('0x48')][_0x6656('0x4c')]));_0x31f957[_0x6656('0x4b')]=_0x31f957[_0x6656('0x4b')]['length']?_0x31f957[_0x6656('0x4b')]:_0x10c960[_0x6656('0x46')];if(!_0x49d31a['query'][_0x6656('0x4e')](_0x6656('0x4f'))){_0x31f957['limit']=qs[_0x6656('0x2e')](_0x49d31a[_0x6656('0x48')][_0x6656('0x2e')]);_0x31f957[_0x6656('0x2c')]=qs['offset'](_0x49d31a[_0x6656('0x48')][_0x6656('0x2c')]);}_0x31f957[_0x6656('0x50')]=qs['sort'](_0x49d31a[_0x6656('0x48')][_0x6656('0x51')]);_0x31f957[_0x6656('0x52')]=qs['filters'](_[_0x6656('0x53')](_0x49d31a['query'],_0x10c960[_0x6656('0x49')]));_0x31f957['where'][_0x6656('0x69')]=_0x1a199b['id'];if(_0x49d31a[_0x6656('0x48')][_0x6656('0x54')]){_0x31f957[_0x6656('0x52')]=_[_0x6656('0x55')](_0x31f957[_0x6656('0x52')],{'$or':_[_0x6656('0x40')](_0x31f957[_0x6656('0x4b')],function(_0x12ac99){var _0x5e2636={};_0x5e2636[_0x12ac99]={'$like':'%'+_0x49d31a['query']['filter']+'%'};return _0x5e2636;})});}_0x31f957=_[_0x6656('0x55')]({},_0x31f957,_0x49d31a[_0x6656('0x57')]);return db[_0x6656('0x6a')][_0x6656('0x2f')]({'where':_0x31f957[_0x6656('0x52')]})['then'](function(_0x334aec){_0x523dd0[_0x6656('0x2f')]=_0x334aec;if(_0x49d31a['query']['includeAll']){_0x31f957['include']=[{'all':!![]}];}return db[_0x6656('0x6a')][_0x6656('0x5a')](_0x31f957);})[_0x6656('0x36')](function(_0x1346cc){_0x523dd0[_0x6656('0x6b')]=_0x1346cc;return _0x523dd0;});}})['then'](respondWithFilteredResult(_0xe2e065,_0x31f957))[_0x6656('0x28')](handleError(_0xe2e065,null));};exports[_0x6656('0x6c')]=function(_0x67758,_0x1ab2d8,_0x27b89f){return db[_0x6656('0x41')][_0x6656('0x5d')]({'where':{'id':_0x67758[_0x6656('0x5c')]['id']}})[_0x6656('0x36')](handleEntityNotFound(_0x1ab2d8,null))[_0x6656('0x36')](function(_0x463388){if(_0x463388){return _0x463388['removeDispositions'](_0x67758[_0x6656('0x48')][_0x6656('0x6d')]);}})[_0x6656('0x36')](respondWithStatusCode(_0x1ab2d8,null))[_0x6656('0x28')](handleError(_0x1ab2d8,null));};exports[_0x6656('0x6e')]=function(_0x273ff3,_0x48ce28,_0x456c1c){if(_0x273ff3[_0x6656('0x5f')]['id']){delete _0x273ff3[_0x6656('0x5f')]['id'];}return db[_0x6656('0x41')][_0x6656('0x5d')]({'where':{'id':_0x273ff3[_0x6656('0x5c')]['id']}})[_0x6656('0x36')](handleEntityNotFound(_0x48ce28,null))['then'](function(_0x12e16){if(_0x12e16){_0x273ff3['body'][_0x6656('0x69')]=_0x12e16['id'];return db['CannedAnswer']['create'](_0x273ff3[_0x6656('0x5f')]);}})[_0x6656('0x36')](respondWithResult(_0x48ce28,null))['catch'](handleError(_0x48ce28,null));};exports[_0x6656('0x6f')]=function(_0x1a6a0a,_0x4a731c,_0x14d8e2){var _0x3c8552={'raw':![],'where':{}};var _0x51e8e1={};var _0x140c9d={'count':0x0,'rows':[]};return db[_0x6656('0x41')][_0x6656('0x68')]({'where':{'id':_0x1a6a0a['params']['id']}})[_0x6656('0x36')](handleEntityNotFound(_0x4a731c,null))['then'](function(_0x1b65b3){if(_0x1b65b3){_0x51e8e1[_0x6656('0x46')]=_[_0x6656('0x47')](db[_0x6656('0x70')][_0x6656('0x42')]);_0x51e8e1[_0x6656('0x48')]=_[_0x6656('0x47')](_0x1a6a0a[_0x6656('0x48')]);_0x51e8e1[_0x6656('0x49')]=_['intersection'](_0x51e8e1[_0x6656('0x46')],_0x51e8e1[_0x6656('0x48')]);_0x3c8552['attributes']=_[_0x6656('0x4a')](_0x51e8e1['model'],qs[_0x6656('0x4c')](_0x1a6a0a[_0x6656('0x48')][_0x6656('0x4c')]));_0x3c8552[_0x6656('0x4b')]=_0x3c8552['attributes'][_0x6656('0x4d')]?_0x3c8552['attributes']:_0x51e8e1[_0x6656('0x46')];if(!_0x1a6a0a[_0x6656('0x48')][_0x6656('0x4e')](_0x6656('0x4f'))){_0x3c8552['limit']=qs['limit'](_0x1a6a0a[_0x6656('0x48')][_0x6656('0x2e')]);_0x3c8552[_0x6656('0x2c')]=qs[_0x6656('0x2c')](_0x1a6a0a['query'][_0x6656('0x2c')]);}_0x3c8552[_0x6656('0x50')]=qs[_0x6656('0x51')](_0x1a6a0a['query']['sort']);_0x3c8552[_0x6656('0x52')]=qs['filters'](_[_0x6656('0x53')](_0x1a6a0a[_0x6656('0x48')],_0x51e8e1['filters']));_0x3c8552[_0x6656('0x52')]['WhatsappAccountId']=_0x1b65b3['id'];if(_0x1a6a0a[_0x6656('0x48')]['filter']){_0x3c8552[_0x6656('0x52')]=_['merge'](_0x3c8552[_0x6656('0x52')],{'$or':_[_0x6656('0x40')](_0x3c8552['attributes'],function(_0x7f1438){var _0x3c4fae={};_0x3c4fae[_0x7f1438]={'$like':'%'+_0x1a6a0a[_0x6656('0x48')][_0x6656('0x54')]+'%'};return _0x3c4fae;})});}_0x3c8552=_['merge']({},_0x3c8552,_0x1a6a0a[_0x6656('0x57')]);return db[_0x6656('0x70')]['count']({'where':_0x3c8552[_0x6656('0x52')]})['then'](function(_0xbb092d){_0x140c9d['count']=_0xbb092d;if(_0x1a6a0a[_0x6656('0x48')][_0x6656('0x58')]){_0x3c8552[_0x6656('0x59')]=[{'all':!![]}];}return db[_0x6656('0x70')][_0x6656('0x5a')](_0x3c8552);})['then'](function(_0x511f85){_0x140c9d['rows']=_0x511f85;return _0x140c9d;});}})[_0x6656('0x36')](respondWithFilteredResult(_0x4a731c,_0x3c8552))[_0x6656('0x28')](handleError(_0x4a731c,null));};exports[_0x6656('0x71')]=function(_0x271930,_0x41cc69,_0x3ce2ba){return db[_0x6656('0x41')][_0x6656('0x5d')]({'where':{'id':_0x271930[_0x6656('0x5c')]['id']}})[_0x6656('0x36')](handleEntityNotFound(_0x41cc69,null))[_0x6656('0x36')](function(_0xf7a5d7){if(_0xf7a5d7){return _0xf7a5d7['removeAnswers'](_0x271930['query']['ids']);}})[_0x6656('0x36')](respondWithStatusCode(_0x41cc69,null))[_0x6656('0x28')](handleError(_0x41cc69,null));};exports['addAgents']=function(_0x58a42c,_0x418a5a,_0x32543c){return db[_0x6656('0x41')][_0x6656('0x5d')]({'where':{'id':_0x58a42c['params']['id']}})[_0x6656('0x36')](handleEntityNotFound(_0x418a5a,null))['then'](function(_0x3c687e){if(_0x3c687e){return _0x3c687e['addAgents'](_0x58a42c[_0x6656('0x5f')][_0x6656('0x6d')],_[_0x6656('0x72')](_0x58a42c[_0x6656('0x5f')],[_0x6656('0x6d'),'id'])||{})['spread'](function(_0x369cf8){for(var _0x562ef8=0x0;_0x562ef8<_0x58a42c['body']['ids'][_0x6656('0x4d')];_0x562ef8+=0x1){socket[_0x6656('0x73')](_0x6656('0x74'),{'UserId':Number(_0x58a42c[_0x6656('0x5f')][_0x6656('0x6d')][_0x562ef8]),'WhatsappAccountId':Number(_0x58a42c[_0x6656('0x5c')]['id'])});}return _0x369cf8;});}})[_0x6656('0x36')](respondWithResult(_0x418a5a,null))[_0x6656('0x28')](handleError(_0x418a5a,null));};exports[_0x6656('0x75')]=function(_0x2567ea,_0x3b9e8e,_0x4a7da1){return db[_0x6656('0x41')][_0x6656('0x5d')]({'where':{'id':_0x2567ea[_0x6656('0x5c')]['id']}})[_0x6656('0x36')](handleEntityNotFound(_0x3b9e8e,null))['then'](function(_0x3b6c38){if(_0x3b6c38){return _0x3b6c38[_0x6656('0x75')](_0x2567ea[_0x6656('0x48')]['ids'])[_0x6656('0x36')](function(){if(_[_0x6656('0x76')](_0x2567ea[_0x6656('0x48')][_0x6656('0x6d')])){for(var _0x4dadc7=0x0;_0x4dadc7<_0x2567ea[_0x6656('0x48')][_0x6656('0x6d')][_0x6656('0x4d')];_0x4dadc7+=0x1){socket[_0x6656('0x73')](_0x6656('0x77'),{'UserId':Number(_0x2567ea[_0x6656('0x48')][_0x6656('0x6d')][_0x4dadc7]),'WhatsappAccountId':Number(_0x2567ea['params']['id'])});}}else{socket[_0x6656('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x2567ea[_0x6656('0x48')][_0x6656('0x6d')]),'WhatsappAccountId':Number(_0x2567ea[_0x6656('0x5c')]['id'])});}});}})[_0x6656('0x36')](respondWithStatusCode(_0x3b9e8e,null))[_0x6656('0x28')](handleError(_0x3b9e8e,null));};exports['getAgents']=function(_0x553e3b,_0x198773,_0x366fc0){var _0xfbea32={};var _0x41bb6d={};var _0x35c13b;var _0x3458f2;return db[_0x6656('0x41')]['findOne']({'where':{'id':_0x553e3b[_0x6656('0x5c')]['id']}})['then'](handleEntityNotFound(_0x198773,null))[_0x6656('0x36')](function(_0x2a20ab){if(_0x2a20ab){_0x35c13b=_0x2a20ab;_0x41bb6d['model']=_[_0x6656('0x47')](db[_0x6656('0x78')][_0x6656('0x42')]);_0x41bb6d['query']=_[_0x6656('0x47')](_0x553e3b[_0x6656('0x48')]);_0x41bb6d[_0x6656('0x49')]=_[_0x6656('0x4a')](_0x41bb6d[_0x6656('0x46')],_0x41bb6d[_0x6656('0x48')]);_0xfbea32[_0x6656('0x4b')]=_[_0x6656('0x4a')](_0x41bb6d[_0x6656('0x46')],qs[_0x6656('0x4c')](_0x553e3b['query'][_0x6656('0x4c')]));_0xfbea32['attributes']=_0xfbea32[_0x6656('0x4b')]['length']?_0xfbea32[_0x6656('0x4b')]:_0x41bb6d[_0x6656('0x46')];_0xfbea32[_0x6656('0x50')]=qs[_0x6656('0x51')](_0x553e3b['query'][_0x6656('0x51')]);_0xfbea32[_0x6656('0x52')]=qs[_0x6656('0x49')](_[_0x6656('0x53')](_0x553e3b[_0x6656('0x48')],_0x41bb6d[_0x6656('0x49')]));if(_0x553e3b['query']['filter']){_0xfbea32[_0x6656('0x52')]=_[_0x6656('0x55')](_0xfbea32['where'],{'$or':_[_0x6656('0x40')](_0xfbea32[_0x6656('0x4b')],function(_0x3242b4){var _0x57e047={};_0x57e047[_0x3242b4]={'$like':'%'+_0x553e3b[_0x6656('0x48')][_0x6656('0x54')]+'%'};return _0x57e047;})});}_0xfbea32=_['merge']({},_0xfbea32,_0x553e3b['options']);return _0x35c13b[_0x6656('0x79')](_0xfbea32);}})[_0x6656('0x36')](function(_0x3e45d6){if(_0x3e45d6){_0x3458f2=_0x3e45d6[_0x6656('0x4d')];if(!_0x553e3b[_0x6656('0x48')][_0x6656('0x4e')](_0x6656('0x4f'))){_0xfbea32[_0x6656('0x2e')]=qs[_0x6656('0x2e')](_0x553e3b[_0x6656('0x48')][_0x6656('0x2e')]);_0xfbea32[_0x6656('0x2c')]=qs['offset'](_0x553e3b[_0x6656('0x48')][_0x6656('0x2c')]);}return _0x35c13b[_0x6656('0x79')](_0xfbea32);}})[_0x6656('0x36')](function(_0x15ab0f){if(_0x15ab0f){return _0x15ab0f?{'count':_0x3458f2,'rows':_0x15ab0f}:null;}})[_0x6656('0x36')](respondWithResult(_0x198773,null))[_0x6656('0x28')](handleError(_0x198773,null));};exports[_0x6656('0x7a')]=function(_0x133120,_0x229e61,_0x43b54c){return db[_0x6656('0x41')][_0x6656('0x68')]({'where':{'id':_0x133120[_0x6656('0x5c')]['id']}})['then'](handleEntityNotFound(_0x229e61,null))['then'](function(_0x46b5c6){if(_0x46b5c6){return db[_0x6656('0x7b')]['transaction'](function(_0x2f60e6){return db['WhatsappApplication'][_0x6656('0x37')]({'where':{'WhatsappAccountId':_0x133120['params']['id']},'transaction':_0x2f60e6})[_0x6656('0x36')](function(_0x3a0e94){var _0x4edcb2=_['map'](_0x133120[_0x6656('0x5f')],function(_0x2eb8e6){_0x2eb8e6[_0x6656('0x69')]=_0x133120[_0x6656('0x5c')]['id'];return _0x2eb8e6;});return db['WhatsappApplication'][_0x6656('0x7c')](_0x4edcb2,{'transaction':_0x2f60e6});});})[_0x6656('0x36')](function(){return db[_0x6656('0x7d')][_0x6656('0x7e')]({'where':{'WhatsappAccountId':_0x133120[_0x6656('0x5c')]['id']},'order':_0x6656('0x7f')});});}})[_0x6656('0x36')](respondWithResult(_0x229e61,null))[_0x6656('0x28')](handleError(_0x229e61,null));};exports[_0x6656('0x80')]=function(_0x4277d4,_0x1467b8,_0x111195){var _0x1be954={};var _0x4ca63a={};var _0x3338b5;var _0x302758;return db['WhatsappAccount'][_0x6656('0x68')]({'where':{'id':_0x4277d4[_0x6656('0x5c')]['id']}})[_0x6656('0x36')](handleEntityNotFound(_0x1467b8,null))['then'](function(_0x34b206){if(_0x34b206){_0x3338b5=_0x34b206;_0x4ca63a[_0x6656('0x46')]=_[_0x6656('0x47')](db[_0x6656('0x7d')][_0x6656('0x42')]);_0x4ca63a[_0x6656('0x48')]=_[_0x6656('0x47')](_0x4277d4['query']);_0x4ca63a[_0x6656('0x49')]=_[_0x6656('0x4a')](_0x4ca63a[_0x6656('0x46')],_0x4ca63a['query']);_0x1be954[_0x6656('0x4b')]=_[_0x6656('0x4a')](_0x4ca63a[_0x6656('0x46')],qs[_0x6656('0x4c')](_0x4277d4[_0x6656('0x48')][_0x6656('0x4c')]));_0x1be954[_0x6656('0x4b')]=_0x1be954['attributes'][_0x6656('0x4d')]?_0x1be954['attributes']:_0x4ca63a[_0x6656('0x46')];_0x1be954['order']=qs['sort'](_0x4277d4[_0x6656('0x48')][_0x6656('0x51')]);_0x1be954[_0x6656('0x52')]=qs[_0x6656('0x49')](_['pick'](_0x4277d4[_0x6656('0x48')],_0x4ca63a[_0x6656('0x49')]));if(_0x4277d4['query']['filter']){_0x1be954[_0x6656('0x52')]=_[_0x6656('0x55')](_0x1be954[_0x6656('0x52')],{'$or':_[_0x6656('0x40')](_0x1be954[_0x6656('0x4b')],function(_0x16aab1){var _0x4ea5f2={};_0x4ea5f2[_0x16aab1]={'$like':'%'+_0x4277d4['query'][_0x6656('0x54')]+'%'};return _0x4ea5f2;})});}_0x1be954=_[_0x6656('0x55')]({},_0x1be954,_0x4277d4[_0x6656('0x57')]);return _0x3338b5[_0x6656('0x80')](_0x1be954);}})['then'](function(_0x1115e3){if(_0x1115e3){_0x302758=_0x1115e3['length'];if(!_0x4277d4[_0x6656('0x48')]['hasOwnProperty'](_0x6656('0x4f'))){_0x1be954[_0x6656('0x2e')]=qs[_0x6656('0x2e')](_0x4277d4[_0x6656('0x48')][_0x6656('0x2e')]);_0x1be954['offset']=qs['offset'](_0x4277d4[_0x6656('0x48')][_0x6656('0x2c')]);}return _0x3338b5[_0x6656('0x80')](_0x1be954);}})[_0x6656('0x36')](function(_0x1178da){if(_0x1178da){return _0x1178da?{'count':_0x302758,'rows':_0x1178da}:null;}})[_0x6656('0x36')](respondWithResult(_0x1467b8,null))['catch'](handleError(_0x1467b8,null));};exports[_0x6656('0x81')]=function(_0xf28a98,_0x595848,_0x4fc27c){logger[_0x6656('0x1e')](_0x6656('0x82'));logger[_0x6656('0x1e')]('AC\x20WhatsappAccount\x20req.body:%s',JSON[_0x6656('0x23')](_0xf28a98[_0x6656('0x5f')]));var _0x5ee456={'channel':_0x6656('0x83')};var _0x369c9f=[];var _0x5c622a=[];var _0x59a178={};return db['WhatsappAccount'][_0x6656('0x5d')]({'where':{'id':_0xf28a98[_0x6656('0x5c')]['id']},'include':[{'model':db[_0x6656('0x7d')],'as':'Applications'}]})[_0x6656('0x36')](handleEntityNotFound(_0x595848,null))[_0x6656('0x36')](function(_0x1f40b8){_0x5ee456[_0x6656('0x84')]=_0x1f40b8;_0x5ee456[_0x6656('0x85')]=_['orderBy'](_0x1f40b8['Applications'],[_0x6656('0x7f')],[_0x6656('0x86')]);if(_0x5ee456['account'][_0x6656('0x87')]){delete _0x5ee456[_0x6656('0x84')][_0x6656('0x87')];}return db['CmContact'][_0x6656('0x65')]();})[_0x6656('0x36')](function(_0x2f4b89){if(!_0x2f4b89){throw new db[(_0x6656('0x88'))][(_0x6656('0x89'))]('no\x20available\x20attributes');}logger[_0x6656('0x1e')](_0x6656('0x8a'),JSON[_0x6656('0x23')](_0x2f4b89));logger[_0x6656('0x1e')](_0x6656('0x8b'),JSON[_0x6656('0x23')](_0xf28a98[_0x6656('0x5f')]));_0x369c9f=_[_0x6656('0x8c')](_[_0x6656('0x47')](_0x2f4b89),[_0x6656('0x8d'),_0x6656('0x8e')]);_0x5c622a=_[_0x6656('0x8c')](_[_0x6656('0x47')](_0x2f4b89),[_0x6656('0x8d'),_0x6656('0x8e'),'CompanyId',_0x6656('0x8f')]);_0x5ee456[_0x6656('0x5f')]={'mapKey':_0x6656('0x90')};logger['info']('AC\x20sinch\x20routing.account.type:%s',JSON['stringify'](_0x5ee456[_0x6656('0x84')][_0x6656('0x44')]));logger[_0x6656('0x1e')](_0x6656('0x91'),JSON[_0x6656('0x23')](_0x5ee456[_0x6656('0x5f')]));logger[_0x6656('0x1e')](_0x6656('0x92'),_0x369c9f);logger[_0x6656('0x1e')]('AC\x20sinch\x20contactKeys:%s',_0x5c622a);if(_0x5ee456[_0x6656('0x84')]['type']&&_0x5ee456[_0x6656('0x84')][_0x6656('0x44')]===_0x6656('0x93')){_0x5ee456['body'][_0x6656('0x94')]=_0xf28a98[_0x6656('0x5f')][_0x6656('0x95')][_0x6656('0x96')](_0x6656('0x97'),'');_0x5ee456[_0x6656('0x5f')][_0x6656('0x5f')]=_0xf28a98[_0x6656('0x5f')][_0x6656('0x98')];_0x5ee456[_0x6656('0x5f')][_0x6656('0x99')]=_0xf28a98[_0x6656('0x5f')]['MessageSid'];}if(_0x5ee456[_0x6656('0x84')][_0x6656('0x44')]&&_0x5ee456[_0x6656('0x84')]['type']===_0x6656('0x9a')){logger[_0x6656('0x1e')](_0x6656('0x9b'),JSON[_0x6656('0x23')](_0xf28a98[_0x6656('0x5f')]));_0x5ee456[_0x6656('0x5f')][_0x6656('0x94')]=_0xf28a98[_0x6656('0x5f')][_0x6656('0x9c')][0x0]['from'];_0x5ee456['body'][_0x6656('0x5f')]=_0xf28a98[_0x6656('0x5f')][_0x6656('0x9c')][0x0][_0x6656('0x26')]['body'];_0x5ee456['body']['messageId']=_0xf28a98[_0x6656('0x5f')][_0x6656('0x9c')][0x0]['message_id'];}if(_0x5ee456[_0x6656('0x5f')]['id']){delete _0x5ee456[_0x6656('0x5f')]['id'];}if(_[_0x6656('0x9d')](_0x5ee456[_0x6656('0x5f')]['from'])){throw new db['Sequelize']['ValidationError'](_0x6656('0x9e'));}if(_[_0x6656('0x9d')](_0x5ee456[_0x6656('0x5f')][_0x6656('0x5f')])||_0x5ee456[_0x6656('0x5f')][_0x6656('0x5f')]===''){throw new db['Sequelize'][(_0x6656('0x89'))](_0x6656('0x9f'));}if(_[_0x6656('0x9d')](_0x5ee456[_0x6656('0x5f')][_0x6656('0xa0')])){throw new db[(_0x6656('0x88'))][(_0x6656('0x89'))](_0x6656('0xa1')+_0x5c622a);}if(!_[_0x6656('0xa2')](_0x5c622a,_0x5ee456[_0x6656('0x5f')][_0x6656('0xa0')])){throw new db[(_0x6656('0x88'))]['ValidationError'](_0x6656('0xa3')+_0x5c622a);}_0x59a178[_0x5ee456[_0x6656('0x5f')][_0x6656('0xa0')]]=_0x5ee456['body']['from'];return db[_0x6656('0xa4')][_0x6656('0x5d')]({'where':{'id':_0x5ee456['account']['ListId']},'include':[{'model':db[_0x6656('0xa5')],'as':_0x6656('0xa6'),'where':_0x59a178,'limit':0x1,'order':[[_0x6656('0x8e'),_0x6656('0xa7')]]}]});})[_0x6656('0x36')](handleEntityNotFound(_0x595848,null))[_0x6656('0x36')](function(_0x298b94){if(_0x298b94){_0x5ee456['list']=_['omit'](_0x298b94,[_0x6656('0xa6')]);if(_0x298b94[_0x6656('0xa6')]['length']){return _0x298b94[_0x6656('0xa6')][0x0];}var _0x3f761c=_[_0x6656('0xa8')](_0x5ee456[_0x6656('0x5f')],{'firstName':_0x5ee456[_0x6656('0x5f')][_0x6656('0x94')],'ListId':_0x298b94['id']});_0x3f761c[_0x5ee456['body'][_0x6656('0xa0')]]=_0x5ee456['body'][_0x6656('0x94')];return db[_0x6656('0xa5')][_0x6656('0x5e')](_0x3f761c,{'fields':_0x369c9f,'raw':!![]});}})[_0x6656('0x36')](handleEntityNotFound(_0x595848,null))[_0x6656('0x36')](function(_0x485591){if(_0x485591){_0x5ee456[_0x6656('0xa9')]=_0x485591;var _0x3ed89e={'ContactId':_0x485591['id'],'phone':_0x5ee456[_0x6656('0x5f')][_0x6656('0x94')],'WhatsappAccountId':_0xf28a98[_0x6656('0x5c')]['id']};var _0x2b85ee={'ContactId':_0x485591['id'],'WhatsappAccountId':_0xf28a98['params']['id'],'closed':![]};return db[_0x6656('0xaa')][_0x6656('0x5d')]({'where':_0x2b85ee})[_0x6656('0x36')](function(_0x4fc447){if(_0x4fc447){return[_0x4fc447,![]];}return db[_0x6656('0xaa')][_0x6656('0x5e')](_0x3ed89e)[_0x6656('0x36')](function(_0x14d72a){return[_0x14d72a,!![]];});});}})['spread'](function(_0x169787,_0xa058ea){_0x5ee456['interaction']=_0x169787[_0x6656('0x38')]({'plain':!![]});_0x5ee456[_0x6656('0xab')][_0x6656('0xac')]=![];if(_0xa058ea){if(_0x5ee456[_0x6656('0x84')][_0x6656('0xad')]){_0x5ee456[_0x6656('0x85')][_0x6656('0xae')]({'id':0x0,'priority':_0x5ee456[_0x6656('0x85')][_0x6656('0x4d')]+0x1,'app':_0x6656('0xaf'),'appdata':_0x6656('0xb0'),'interval':_0x6656('0xb1')});}_0x5ee456['interaction'][_0x6656('0xac')]=!![];}return db[_0x6656('0xb2')]['create']({'phone':_0x5ee456['body'][_0x6656('0x94')],'messageId':_0x5ee456['body']['messageId'],'body':_0x5ee456['body'][_0x6656('0x5f')],'WhatsappAccountId':_0xf28a98['params']['id'],'WhatsappInteractionId':_0x169787['id'],'direction':'in','ContactId':_0x169787[_0x6656('0xb3')],'AttachmentId':_0x5ee456[_0x6656('0x5f')][_0x6656('0xb4')]});})[_0x6656('0x36')](function(_0x46a949){_0x5ee456[_0x6656('0x26')]=_0x46a949;if(_0x5ee456['interaction'][_0x6656('0xb5')]){return db['User'][_0x6656('0x5d')]({'attributes':['id',_0x6656('0x3b')],'where':{'id':_0x5ee456[_0x6656('0xab')][_0x6656('0xb5')]}})[_0x6656('0x36')](function(_0x452d70){if(_0x452d70){_0x5ee456[_0x6656('0x85')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6656('0xb6'),'appdata':_0x452d70['name']+','+(_0x5ee456[_0x6656('0x84')][_0x6656('0xb7')]||0xa),'interval':_0x6656('0xb1')});}return respondWithRpcPromise(_0x6656('0xb8'),_0x6656('0xb9'),_0x5ee456);});}return respondWithRpcPromise(_0x6656('0xb8'),'startRouting',_0x5ee456);})[_0x6656('0x36')](function(_0x2773f3){if(_0x2773f3){var _0x143501=0xc8;var _0x43ef22=_0x6656('0xba');logger[_0x6656('0x1e')](_0x6656('0x22'),_0x43ef22,_0x143501,'entity\x20found');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x43ef22,_0x143501,_0x6656('0xbb'),JSON['stringify'](_0x2773f3));if(_0x5ee456[_0x6656('0x84')][_0x6656('0x44')]===_0x6656('0x93')){return _0x595848[_0x6656('0x29')](_0x143501)[_0x6656('0x30')](_0x6656('0xbc'),_0x6656('0xbd'))[_0x6656('0x3c')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x595848[_0x6656('0x29')](_0x143501)[_0x6656('0x2b')](_0x2773f3);}}})['catch'](handleError(_0x595848,null));};exports['send']=function(_0x2cae73,_0x2c08a7,_0x3997e0){var _0x4c0656,_0x3e130c,_0xcb8563;if(_[_0x6656('0x9d')](_0x2cae73[_0x6656('0x5f')]['body'])||_0x2cae73[_0x6656('0x5f')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6656('0x9d')](_0x2cae73[_0x6656('0x5f')]['to'])){throw new db['Sequelize'][(_0x6656('0x89'))](_0x6656('0xbe'));}_0x4c0656=_0x2cae73[_0x6656('0x5f')]['to'];return db['WhatsappAccount'][_0x6656('0x5d')]({'where':{'id':_0x2cae73['params']['id']},'include':[{'model':db['CmList'],'as':_0x6656('0xbf'),'include':[{'model':db[_0x6656('0xa5')],'as':'Contacts','where':{'mobile':_0x4c0656},'limit':0x1,'order':[['updatedAt',_0x6656('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x2c08a7,null))[_0x6656('0x36')](function(_0x2bf711){if(_0x2bf711&&_0x2bf711['List']){_0x3e130c=_0x2bf711[_0x6656('0x38')]({'plain':!![]});if(_0x3e130c[_0x6656('0xbf')]&&_0x3e130c['List'][_0x6656('0xa6')][_0x6656('0x4d')]){return _0x3e130c[_0x6656('0xbf')]['Contacts'][0x0];}return db[_0x6656('0xa5')][_0x6656('0x5e')](_[_0x6656('0xa8')](_0x2cae73[_0x6656('0x5f')],{'firstName':_0x4c0656,'mobile':_0x4c0656,'phone':_0x4c0656,'ListId':_0x3e130c['ListId']}));}})[_0x6656('0x36')](handleEntityNotFound(_0x2c08a7,null))[_0x6656('0x36')](function(_0xa5aece){if(_0xa5aece){_0xcb8563=_0xa5aece;return db[_0x6656('0xaa')][_0x6656('0x5d')]({'where':{'ContactId':_0xcb8563['id'],'closed':![],'WhatsappAccountId':_0x3e130c['id']}})[_0x6656('0x36')](function(_0x3e8ca3){if(_0x3e8ca3){return[_0x3e8ca3,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x2cae73['user']['id'],'ContactId':_0xcb8563['id'],'WhatsappAccountId':_0x3e130c['id'],'phone':_0x4c0656,'firstMsgDirection':_0x6656('0xc0'),'Messages':[_['merge'](_0x2cae73[_0x6656('0x5f')],{'read':![],'body':_0x2cae73[_0x6656('0x5f')][_0x6656('0x5f')],'phone':_0x4c0656,'WhatsappAccountId':_0x3e130c['id'],'UserId':_0x2cae73[_0x6656('0x60')]['id'],'ContactId':_0xcb8563['id']})]},{'include':[{'model':db[_0x6656('0xb2')],'as':_0x6656('0xc1')}]})['then'](function(_0x3b7ab6){return[_0x3b7ab6,!![]];});});}})[_0x6656('0xc2')](function(_0x47a36b,_0x9c57da){if(_0x9c57da){return _0x47a36b;}return db['WhatsappMessage'][_0x6656('0x5e')](_[_0x6656('0x55')](_0x2cae73[_0x6656('0x5f')],{'read':![],'body':_0x2cae73[_0x6656('0x5f')][_0x6656('0x5f')],'phone':_0x4c0656,'WhatsappAccountId':_0x3e130c['id'],'WhatsappInteractionId':_0x47a36b['id'],'UserId':_0x2cae73[_0x6656('0x60')]['id'],'ContactId':_0xcb8563['id']}))['then'](function(_0x172e5a){_0x47a36b[_0x6656('0xc3')][_0x6656('0xc1')]=[];_0x47a36b['dataValues'][_0x6656('0xc1')][_0x6656('0xae')](_0x172e5a[_0x6656('0xc3')]);return _0x47a36b;});})[_0x6656('0x36')](respondWithResult(_0x2c08a7,null))['catch'](handleError(_0x2c08a7,null));};
\ No newline at end of file
+var _0x0f94=['whatsapp:','Body','MessageSid','sinch','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','omit','defaults','contact','WhatsappInteraction','interaction','created','push','close','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','json','to\x20is\x20mandatory','List','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','jayson/promise','client','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','removeAnswers','addAgents','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','AC\x20WhatsappAccount\x20notify','Applications','applications','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','AC\x20sinch\x20attributes:%s','stringify','difference','createdAt','updatedAt','CompanyId','ListId','mobile','AC\x20sinch\x20contactKeys:%s','from','replace'];(function(_0x5eb009,_0x56d2f4){var _0x38b580=function(_0xca3fe6){while(--_0xca3fe6){_0x5eb009['push'](_0x5eb009['shift']());}};_0x38b580(++_0x56d2f4);}(_0x0f94,0x1ad));var _0x40f9=function(_0x469bbf,_0x559555){_0x469bbf=_0x469bbf-0x0;var _0x4f7b25=_0x0f94[_0x469bbf];return _0x4f7b25;};'use strict';var emlformat=require(_0x40f9('0x0'));var rimraf=require(_0x40f9('0x1'));var zipdir=require(_0x40f9('0x2'));var jsonpatch=require(_0x40f9('0x3'));var rp=require(_0x40f9('0x4'));var moment=require(_0x40f9('0x5'));var BPromise=require(_0x40f9('0x6'));var Mustache=require(_0x40f9('0x7'));var util=require(_0x40f9('0x8'));var path=require(_0x40f9('0x9'));var sox=require(_0x40f9('0xa'));var csv=require('to-csv');var ejs=require(_0x40f9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x40f9('0xc'));var squel=require(_0x40f9('0xd'));var crypto=require('crypto');var jsforce=require(_0x40f9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x40f9('0xf'));var Papa=require(_0x40f9('0x10'));var Redis=require(_0x40f9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x40f9('0x12'));var hardwareService=require(_0x40f9('0x13'));var logger=require('../../config/logger')(_0x40f9('0x14'));var utils=require('../../config/utils');var config=require(_0x40f9('0x15'));var licenseUtil=require(_0x40f9('0x16'));var db=require('../../mysqldb')['db'];config[_0x40f9('0x17')]=_['defaults'](config[_0x40f9('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x40f9('0x18'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x40f9('0x19'));var client=jayson[_0x40f9('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5c5cfe,_0x57266a,_0x36f7b8,_0x59a941){return new BPromise(function(_0x4d93b6,_0x48e286){var _0x155867=_0x59a941||client;return _0x155867[_0x40f9('0x1b')](_0x5c5cfe,_0x36f7b8)[_0x40f9('0x1c')](function(_0x37631a){logger[_0x40f9('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x57266a,'request\x20sent');logger[_0x40f9('0x1e')](_0x40f9('0x1f'),_0x57266a,'request\x20sent',JSON['stringify'](_0x37631a));if(_0x37631a[_0x40f9('0x20')]){if(_0x37631a['error'][_0x40f9('0x21')]===0x1f4){logger[_0x40f9('0x20')](_0x40f9('0x22'),_0x57266a,_0x37631a[_0x40f9('0x20')][_0x40f9('0x23')]);return _0x48e286(_0x37631a['error']['message']);}logger['error'](_0x40f9('0x22'),_0x57266a,_0x37631a[_0x40f9('0x20')]['message']);return _0x4d93b6(_0x37631a[_0x40f9('0x20')][_0x40f9('0x23')]);}else{logger[_0x40f9('0x1d')](_0x40f9('0x22'),_0x57266a,_0x40f9('0x24'));_0x4d93b6(_0x37631a[_0x40f9('0x25')][_0x40f9('0x23')]);}})[_0x40f9('0x26')](function(_0x19cf93){logger[_0x40f9('0x20')](_0x40f9('0x22'),_0x57266a,_0x19cf93);_0x48e286(_0x19cf93);});});}function respondWithStatusCode(_0x2eb08e,_0x176899){_0x176899=_0x176899||0xcc;return function(_0x295666){if(_0x295666){return _0x2eb08e[_0x40f9('0x27')](_0x176899);}return _0x2eb08e[_0x40f9('0x28')](_0x176899)[_0x40f9('0x29')]();};}function respondWithResult(_0xd8bb1d,_0x4ec988){_0x4ec988=_0x4ec988||0xc8;return function(_0x34b6cf){if(_0x34b6cf){return _0xd8bb1d[_0x40f9('0x28')](_0x4ec988)['json'](_0x34b6cf);}};}function respondWithFilteredResult(_0x3330c2,_0x459176){return function(_0x495826){if(_0x495826){var _0x4e87b0=typeof _0x459176['offset']===_0x40f9('0x2a')&&typeof _0x459176[_0x40f9('0x2b')]===_0x40f9('0x2a');var _0x59faa0=_0x495826[_0x40f9('0x2c')];var _0x5cb4c7=_0x4e87b0?0x0:_0x459176[_0x40f9('0x2d')];var _0x56c7b8=_0x4e87b0?_0x495826[_0x40f9('0x2c')]:_0x459176[_0x40f9('0x2d')]+_0x459176[_0x40f9('0x2b')];var _0x3b2c48;if(_0x56c7b8>=_0x59faa0){_0x56c7b8=_0x59faa0;_0x3b2c48=0xc8;}else{_0x3b2c48=0xce;}_0x3330c2['status'](_0x3b2c48);return _0x3330c2[_0x40f9('0x2e')](_0x40f9('0x2f'),_0x5cb4c7+'-'+_0x56c7b8+'/'+_0x59faa0)['json'](_0x495826);}return null;};}function patchUpdates(_0x3a828e){return function(_0x5cf121){try{jsonpatch['apply'](_0x5cf121,_0x3a828e,!![]);}catch(_0x446d24){return BPromise[_0x40f9('0x30')](_0x446d24);}return _0x5cf121[_0x40f9('0x31')]();};}function saveUpdates(_0xa9b392,_0x5b5dee){return function(_0x44c3c5){if(_0x44c3c5){return _0x44c3c5['update'](_0xa9b392)[_0x40f9('0x1c')](function(_0x3912c5){return _0x3912c5;});}return null;};}function removeEntity(_0x231e31,_0x217310){return function(_0x336dc4){if(_0x336dc4){return _0x336dc4['destroy']()[_0x40f9('0x1c')](function(){var _0x3785f7=_0x336dc4['get']({'plain':!![]});var _0x30f4a8=_0x40f9('0x32');return db[_0x40f9('0x33')][_0x40f9('0x34')]({'where':{'type':_0x30f4a8,'resourceId':_0x3785f7['id']}})[_0x40f9('0x1c')](function(){return _0x336dc4;});})[_0x40f9('0x1c')](function(){_0x231e31[_0x40f9('0x28')](0xcc)[_0x40f9('0x29')]();});}};}function handleEntityNotFound(_0x535ba4,_0x3312aa){return function(_0x230022){if(!_0x230022){_0x535ba4[_0x40f9('0x27')](0x194);}return _0x230022;};}function handleError(_0x5601a3,_0x331ee7){_0x331ee7=_0x331ee7||0x1f4;return function(_0x2932ec){logger[_0x40f9('0x20')](_0x2932ec[_0x40f9('0x35')]);if(_0x2932ec[_0x40f9('0x36')]){delete _0x2932ec[_0x40f9('0x36')];}_0x5601a3[_0x40f9('0x28')](_0x331ee7)[_0x40f9('0x37')](_0x2932ec);};}exports['index']=function(_0x27ba33,_0x114bef){var _0x5fa542={'include':[{'model':db[_0x40f9('0x38')],'as':_0x40f9('0x39')}]},_0x4fad1e={},_0x1e1813={'count':0x0,'rows':[]};var _0x53cfb9=_[_0x40f9('0x3a')](db[_0x40f9('0x3b')]['rawAttributes'],function(_0x7205cb){return{'name':_0x7205cb[_0x40f9('0x3c')],'type':_0x7205cb['type'][_0x40f9('0x3d')]};});_0x4fad1e[_0x40f9('0x3e')]=_['map'](_0x53cfb9,_0x40f9('0x36'));_0x4fad1e['query']=_[_0x40f9('0x3f')](_0x27ba33[_0x40f9('0x40')]);_0x4fad1e[_0x40f9('0x41')]=_[_0x40f9('0x42')](_0x4fad1e['model'],_0x4fad1e[_0x40f9('0x40')]);_0x5fa542['attributes']=_['intersection'](_0x4fad1e[_0x40f9('0x3e')],qs[_0x40f9('0x43')](_0x27ba33[_0x40f9('0x40')][_0x40f9('0x43')]));_0x5fa542[_0x40f9('0x44')]=_0x5fa542['attributes'][_0x40f9('0x45')]?_0x5fa542[_0x40f9('0x44')]:_0x4fad1e['model'];if(!_0x27ba33[_0x40f9('0x40')][_0x40f9('0x46')](_0x40f9('0x47'))){_0x5fa542[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x27ba33[_0x40f9('0x40')]['limit']);_0x5fa542[_0x40f9('0x2d')]=qs['offset'](_0x27ba33['query'][_0x40f9('0x2d')]);}_0x5fa542[_0x40f9('0x48')]=qs[_0x40f9('0x49')](_0x27ba33[_0x40f9('0x40')][_0x40f9('0x49')]);_0x5fa542[_0x40f9('0x4a')]=qs[_0x40f9('0x41')](_[_0x40f9('0x4b')](_0x27ba33['query'],_0x4fad1e[_0x40f9('0x41')]),_0x53cfb9);if(_0x27ba33[_0x40f9('0x40')][_0x40f9('0x4c')]){_0x5fa542['where']=_[_0x40f9('0x4d')](_0x5fa542[_0x40f9('0x4a')],{'$or':_['map'](_0x53cfb9,function(_0x177148){if(_0x177148[_0x40f9('0x4e')]!==_0x40f9('0x4f')){var _0x462154={};_0x462154[_0x177148[_0x40f9('0x36')]]={'$like':'%'+_0x27ba33[_0x40f9('0x40')][_0x40f9('0x4c')]+'%'};return _0x462154;}})});}_0x5fa542=_[_0x40f9('0x4d')]({},_0x5fa542,_0x27ba33[_0x40f9('0x50')]);var _0x5814e8={'where':_0x5fa542[_0x40f9('0x4a')]};return db[_0x40f9('0x3b')][_0x40f9('0x2c')](_0x5814e8)[_0x40f9('0x1c')](function(_0x2ce921){_0x1e1813[_0x40f9('0x2c')]=_0x2ce921;if(_0x27ba33[_0x40f9('0x40')][_0x40f9('0x51')]){_0x5fa542[_0x40f9('0x52')]=[{'all':!![]}];}return db[_0x40f9('0x3b')][_0x40f9('0x53')](_0x5fa542);})[_0x40f9('0x1c')](function(_0x205c08){_0x1e1813['rows']=_0x205c08;return _0x1e1813;})[_0x40f9('0x1c')](respondWithFilteredResult(_0x114bef,_0x5fa542))[_0x40f9('0x26')](handleError(_0x114bef,null));};exports[_0x40f9('0x54')]=function(_0x4fd66a,_0x1c6974){var _0x2fa649={'raw':![],'where':{'id':_0x4fd66a[_0x40f9('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x40f9('0x39')}]},_0x3a3b55={};_0x3a3b55[_0x40f9('0x3e')]=_[_0x40f9('0x3f')](db[_0x40f9('0x3b')]['rawAttributes']);_0x3a3b55[_0x40f9('0x40')]=_[_0x40f9('0x3f')](_0x4fd66a[_0x40f9('0x40')]);_0x3a3b55[_0x40f9('0x41')]=_[_0x40f9('0x42')](_0x3a3b55[_0x40f9('0x3e')],_0x3a3b55['query']);_0x2fa649[_0x40f9('0x44')]=_[_0x40f9('0x42')](_0x3a3b55[_0x40f9('0x3e')],qs[_0x40f9('0x43')](_0x4fd66a[_0x40f9('0x40')]['fields']));_0x2fa649[_0x40f9('0x44')]=_0x2fa649['attributes']['length']?_0x2fa649['attributes']:_0x3a3b55['model'];if(_0x4fd66a[_0x40f9('0x40')][_0x40f9('0x51')]){_0x2fa649[_0x40f9('0x52')]=[{'all':!![]}];}_0x2fa649=_[_0x40f9('0x4d')]({},_0x2fa649,_0x4fd66a['options']);return db[_0x40f9('0x3b')][_0x40f9('0x56')](_0x2fa649)['then'](handleEntityNotFound(_0x1c6974,null))[_0x40f9('0x1c')](respondWithResult(_0x1c6974,null))[_0x40f9('0x26')](handleError(_0x1c6974,null));};exports[_0x40f9('0x57')]=function(_0x4e30cb,_0x418f93){return db[_0x40f9('0x3b')][_0x40f9('0x57')](_0x4e30cb['body'],{})[_0x40f9('0x1c')](function(_0x65a517){var _0x789eff=_0x4e30cb['user'][_0x40f9('0x58')]({'plain':!![]});if(!_0x789eff)throw new Error(_0x40f9('0x59'));if(_0x789eff[_0x40f9('0x5a')]===_0x40f9('0x5b')){var _0x2c91c1=_0x65a517[_0x40f9('0x58')]({'plain':!![]});var _0x53e388=_0x40f9('0x32');return db[_0x40f9('0x5c')][_0x40f9('0x56')]({'where':{'name':_0x53e388,'userProfileId':_0x789eff[_0x40f9('0x5d')]},'raw':!![]})[_0x40f9('0x1c')](function(_0x5d2aa7){if(_0x5d2aa7&&_0x5d2aa7[_0x40f9('0x5e')]===0x0){return db[_0x40f9('0x33')]['create']({'name':_0x2c91c1[_0x40f9('0x36')],'resourceId':_0x2c91c1['id'],'type':_0x5d2aa7[_0x40f9('0x36')],'sectionId':_0x5d2aa7['id']},{})[_0x40f9('0x1c')](function(){return _0x65a517;});}else{return _0x65a517;}})[_0x40f9('0x26')](function(_0x51b479){logger[_0x40f9('0x20')](_0x40f9('0x5f'),_0x51b479);throw _0x51b479;});}return _0x65a517;})[_0x40f9('0x1c')](respondWithResult(_0x418f93,0xc9))[_0x40f9('0x26')](handleError(_0x418f93,null));};exports[_0x40f9('0x60')]=function(_0x5bc1b8,_0x2cbdc3){if(_0x5bc1b8['body']['id']){delete _0x5bc1b8['body']['id'];}return db['WhatsappAccount'][_0x40f9('0x56')]({'where':{'id':_0x5bc1b8[_0x40f9('0x55')]['id']},'include':[{'model':db[_0x40f9('0x38')],'as':'mandatoryDispositionPause'}]})[_0x40f9('0x1c')](handleEntityNotFound(_0x2cbdc3,null))[_0x40f9('0x1c')](saveUpdates(_0x5bc1b8[_0x40f9('0x61')],null))[_0x40f9('0x1c')](respondWithResult(_0x2cbdc3,null))['catch'](handleError(_0x2cbdc3,null));};exports[_0x40f9('0x34')]=function(_0x3fde21,_0x2bff38){return db['WhatsappAccount'][_0x40f9('0x56')]({'where':{'id':_0x3fde21['params']['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x2bff38,null))[_0x40f9('0x1c')](removeEntity(_0x2bff38,null))[_0x40f9('0x26')](handleError(_0x2bff38,null));};exports[_0x40f9('0x62')]=function(_0xa487b4,_0x3b2274){return db['WhatsappAccount'][_0x40f9('0x62')]()[_0x40f9('0x1c')](respondWithResult(_0x3b2274,null))[_0x40f9('0x26')](handleError(_0x3b2274,null));};exports[_0x40f9('0x63')]=function(_0x379dcc,_0x2864b8,_0x393ac3){if(_0x379dcc[_0x40f9('0x61')]['id']){delete _0x379dcc[_0x40f9('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x379dcc['params']['id']}})['then'](handleEntityNotFound(_0x2864b8,null))['then'](function(_0x38911e){if(_0x38911e){_0x379dcc[_0x40f9('0x61')][_0x40f9('0x64')]=_0x38911e['id'];return db['Disposition'][_0x40f9('0x57')](_0x379dcc[_0x40f9('0x61')]);}})[_0x40f9('0x1c')](respondWithResult(_0x2864b8,null))[_0x40f9('0x26')](handleError(_0x2864b8,null));};exports[_0x40f9('0x65')]=function(_0x22f91c,_0xf1de49,_0x3762d3){var _0x17acc6={'raw':![],'where':{}};var _0x3cc2f3={};var _0x45ae2c={'count':0x0,'rows':[]};return db[_0x40f9('0x3b')][_0x40f9('0x66')]({'where':{'id':_0x22f91c['params']['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0xf1de49,null))[_0x40f9('0x1c')](function(_0x5bdfc8){if(_0x5bdfc8){_0x3cc2f3[_0x40f9('0x3e')]=_[_0x40f9('0x3f')](db[_0x40f9('0x67')]['rawAttributes']);_0x3cc2f3['query']=_[_0x40f9('0x3f')](_0x22f91c[_0x40f9('0x40')]);_0x3cc2f3[_0x40f9('0x41')]=_[_0x40f9('0x42')](_0x3cc2f3[_0x40f9('0x3e')],_0x3cc2f3[_0x40f9('0x40')]);_0x17acc6[_0x40f9('0x44')]=_[_0x40f9('0x42')](_0x3cc2f3[_0x40f9('0x3e')],qs[_0x40f9('0x43')](_0x22f91c['query'][_0x40f9('0x43')]));_0x17acc6[_0x40f9('0x44')]=_0x17acc6[_0x40f9('0x44')][_0x40f9('0x45')]?_0x17acc6[_0x40f9('0x44')]:_0x3cc2f3[_0x40f9('0x3e')];if(!_0x22f91c[_0x40f9('0x40')][_0x40f9('0x46')](_0x40f9('0x47'))){_0x17acc6[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x22f91c['query'][_0x40f9('0x2b')]);_0x17acc6[_0x40f9('0x2d')]=qs['offset'](_0x22f91c[_0x40f9('0x40')][_0x40f9('0x2d')]);}_0x17acc6[_0x40f9('0x48')]=qs['sort'](_0x22f91c['query'][_0x40f9('0x49')]);_0x17acc6['where']=qs['filters'](_[_0x40f9('0x4b')](_0x22f91c[_0x40f9('0x40')],_0x3cc2f3['filters']));_0x17acc6['where'][_0x40f9('0x64')]=_0x5bdfc8['id'];if(_0x22f91c[_0x40f9('0x40')][_0x40f9('0x4c')]){_0x17acc6[_0x40f9('0x4a')]=_['merge'](_0x17acc6[_0x40f9('0x4a')],{'$or':_[_0x40f9('0x3a')](_0x17acc6[_0x40f9('0x44')],function(_0x2fab08){var _0x4db98d={};_0x4db98d[_0x2fab08]={'$like':'%'+_0x22f91c[_0x40f9('0x40')][_0x40f9('0x4c')]+'%'};return _0x4db98d;})});}_0x17acc6=_['merge']({},_0x17acc6,_0x22f91c['options']);return db[_0x40f9('0x67')][_0x40f9('0x2c')]({'where':_0x17acc6[_0x40f9('0x4a')]})[_0x40f9('0x1c')](function(_0x367198){_0x45ae2c['count']=_0x367198;if(_0x22f91c[_0x40f9('0x40')]['includeAll']){_0x17acc6[_0x40f9('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x40f9('0x53')](_0x17acc6);})[_0x40f9('0x1c')](function(_0x332f77){_0x45ae2c[_0x40f9('0x68')]=_0x332f77;return _0x45ae2c;});}})[_0x40f9('0x1c')](respondWithFilteredResult(_0xf1de49,_0x17acc6))['catch'](handleError(_0xf1de49,null));};exports[_0x40f9('0x69')]=function(_0x1f6ac6,_0x369757,_0xfcdf8d){return db['WhatsappAccount'][_0x40f9('0x56')]({'where':{'id':_0x1f6ac6[_0x40f9('0x55')]['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x369757,null))['then'](function(_0x4ce358){if(_0x4ce358){return _0x4ce358[_0x40f9('0x69')](_0x1f6ac6[_0x40f9('0x40')][_0x40f9('0x6a')]);}})[_0x40f9('0x1c')](respondWithStatusCode(_0x369757,null))[_0x40f9('0x26')](handleError(_0x369757,null));};exports[_0x40f9('0x6b')]=function(_0x361ca3,_0x2775ff,_0x2b00a4){if(_0x361ca3['body']['id']){delete _0x361ca3[_0x40f9('0x61')]['id'];}return db[_0x40f9('0x3b')][_0x40f9('0x56')]({'where':{'id':_0x361ca3['params']['id']}})['then'](handleEntityNotFound(_0x2775ff,null))['then'](function(_0x203e64){if(_0x203e64){_0x361ca3[_0x40f9('0x61')][_0x40f9('0x64')]=_0x203e64['id'];return db[_0x40f9('0x6c')][_0x40f9('0x57')](_0x361ca3[_0x40f9('0x61')]);}})['then'](respondWithResult(_0x2775ff,null))[_0x40f9('0x26')](handleError(_0x2775ff,null));};exports[_0x40f9('0x6d')]=function(_0x4a8324,_0x4995e9,_0x70a20e){var _0x4fb70a={'raw':![],'where':{}};var _0x5d5855={};var _0x4bb47f={'count':0x0,'rows':[]};return db[_0x40f9('0x3b')]['findOne']({'where':{'id':_0x4a8324[_0x40f9('0x55')]['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x4995e9,null))[_0x40f9('0x1c')](function(_0x29c173){if(_0x29c173){_0x5d5855[_0x40f9('0x3e')]=_['keys'](db[_0x40f9('0x6c')][_0x40f9('0x6e')]);_0x5d5855[_0x40f9('0x40')]=_[_0x40f9('0x3f')](_0x4a8324[_0x40f9('0x40')]);_0x5d5855['filters']=_[_0x40f9('0x42')](_0x5d5855[_0x40f9('0x3e')],_0x5d5855[_0x40f9('0x40')]);_0x4fb70a[_0x40f9('0x44')]=_['intersection'](_0x5d5855['model'],qs[_0x40f9('0x43')](_0x4a8324[_0x40f9('0x40')]['fields']));_0x4fb70a['attributes']=_0x4fb70a[_0x40f9('0x44')][_0x40f9('0x45')]?_0x4fb70a[_0x40f9('0x44')]:_0x5d5855[_0x40f9('0x3e')];if(!_0x4a8324['query'][_0x40f9('0x46')](_0x40f9('0x47'))){_0x4fb70a[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x4a8324[_0x40f9('0x40')][_0x40f9('0x2b')]);_0x4fb70a[_0x40f9('0x2d')]=qs[_0x40f9('0x2d')](_0x4a8324[_0x40f9('0x40')][_0x40f9('0x2d')]);}_0x4fb70a[_0x40f9('0x48')]=qs[_0x40f9('0x49')](_0x4a8324['query'][_0x40f9('0x49')]);_0x4fb70a[_0x40f9('0x4a')]=qs[_0x40f9('0x41')](_[_0x40f9('0x4b')](_0x4a8324[_0x40f9('0x40')],_0x5d5855[_0x40f9('0x41')]));_0x4fb70a[_0x40f9('0x4a')][_0x40f9('0x64')]=_0x29c173['id'];if(_0x4a8324[_0x40f9('0x40')][_0x40f9('0x4c')]){_0x4fb70a[_0x40f9('0x4a')]=_[_0x40f9('0x4d')](_0x4fb70a[_0x40f9('0x4a')],{'$or':_[_0x40f9('0x3a')](_0x4fb70a[_0x40f9('0x44')],function(_0x58614b){var _0x551440={};_0x551440[_0x58614b]={'$like':'%'+_0x4a8324['query'][_0x40f9('0x4c')]+'%'};return _0x551440;})});}_0x4fb70a=_[_0x40f9('0x4d')]({},_0x4fb70a,_0x4a8324['options']);return db[_0x40f9('0x6c')][_0x40f9('0x2c')]({'where':_0x4fb70a[_0x40f9('0x4a')]})['then'](function(_0x355eb9){_0x4bb47f['count']=_0x355eb9;if(_0x4a8324[_0x40f9('0x40')]['includeAll']){_0x4fb70a[_0x40f9('0x52')]=[{'all':!![]}];}return db[_0x40f9('0x6c')][_0x40f9('0x53')](_0x4fb70a);})[_0x40f9('0x1c')](function(_0x3fbc2a){_0x4bb47f[_0x40f9('0x68')]=_0x3fbc2a;return _0x4bb47f;});}})[_0x40f9('0x1c')](respondWithFilteredResult(_0x4995e9,_0x4fb70a))['catch'](handleError(_0x4995e9,null));};exports[_0x40f9('0x6f')]=function(_0x21ff88,_0x44df5b,_0x550900){return db[_0x40f9('0x3b')][_0x40f9('0x56')]({'where':{'id':_0x21ff88['params']['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x44df5b,null))[_0x40f9('0x1c')](function(_0x474a45){if(_0x474a45){return _0x474a45[_0x40f9('0x6f')](_0x21ff88[_0x40f9('0x40')]['ids']);}})[_0x40f9('0x1c')](respondWithStatusCode(_0x44df5b,null))[_0x40f9('0x26')](handleError(_0x44df5b,null));};exports[_0x40f9('0x70')]=function(_0x4db736,_0x2368e1,_0x1f9ef5){return db[_0x40f9('0x3b')][_0x40f9('0x56')]({'where':{'id':_0x4db736[_0x40f9('0x55')]['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x2368e1,null))[_0x40f9('0x1c')](function(_0x20ce6b){if(_0x20ce6b){return _0x20ce6b[_0x40f9('0x70')](_0x4db736[_0x40f9('0x61')][_0x40f9('0x6a')],_['omit'](_0x4db736[_0x40f9('0x61')],['ids','id'])||{})[_0x40f9('0x71')](function(_0x2442c1){for(var _0x254aca=0x0;_0x254aca<_0x4db736[_0x40f9('0x61')][_0x40f9('0x6a')][_0x40f9('0x45')];_0x254aca+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x4db736[_0x40f9('0x61')][_0x40f9('0x6a')][_0x254aca]),'WhatsappAccountId':Number(_0x4db736[_0x40f9('0x55')]['id'])});}return _0x2442c1;});}})['then'](respondWithResult(_0x2368e1,null))['catch'](handleError(_0x2368e1,null));};exports[_0x40f9('0x72')]=function(_0x4f61dd,_0x1135d1,_0x242c60){return db[_0x40f9('0x3b')]['find']({'where':{'id':_0x4f61dd['params']['id']}})['then'](handleEntityNotFound(_0x1135d1,null))[_0x40f9('0x1c')](function(_0x2800af){if(_0x2800af){return _0x2800af[_0x40f9('0x72')](_0x4f61dd[_0x40f9('0x40')]['ids'])['then'](function(){if(_[_0x40f9('0x73')](_0x4f61dd['query'][_0x40f9('0x6a')])){for(var _0x3c976b=0x0;_0x3c976b<_0x4f61dd['query'][_0x40f9('0x6a')][_0x40f9('0x45')];_0x3c976b+=0x1){socket[_0x40f9('0x74')](_0x40f9('0x75'),{'UserId':Number(_0x4f61dd[_0x40f9('0x40')][_0x40f9('0x6a')][_0x3c976b]),'WhatsappAccountId':Number(_0x4f61dd['params']['id'])});}}else{socket[_0x40f9('0x74')](_0x40f9('0x75'),{'UserId':Number(_0x4f61dd['query']['ids']),'WhatsappAccountId':Number(_0x4f61dd[_0x40f9('0x55')]['id'])});}});}})[_0x40f9('0x1c')](respondWithStatusCode(_0x1135d1,null))[_0x40f9('0x26')](handleError(_0x1135d1,null));};exports[_0x40f9('0x76')]=function(_0x51af77,_0x142dd1,_0xa20109){var _0x307a44={};var _0x4ac486={};var _0x3a71bd;var _0x492039;return db[_0x40f9('0x3b')][_0x40f9('0x66')]({'where':{'id':_0x51af77['params']['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x142dd1,null))[_0x40f9('0x1c')](function(_0x31333a){if(_0x31333a){_0x3a71bd=_0x31333a;_0x4ac486['model']=_[_0x40f9('0x3f')](db['User'][_0x40f9('0x6e')]);_0x4ac486['query']=_[_0x40f9('0x3f')](_0x51af77['query']);_0x4ac486[_0x40f9('0x41')]=_['intersection'](_0x4ac486[_0x40f9('0x3e')],_0x4ac486['query']);_0x307a44['attributes']=_[_0x40f9('0x42')](_0x4ac486[_0x40f9('0x3e')],qs[_0x40f9('0x43')](_0x51af77[_0x40f9('0x40')][_0x40f9('0x43')]));_0x307a44[_0x40f9('0x44')]=_0x307a44[_0x40f9('0x44')]['length']?_0x307a44[_0x40f9('0x44')]:_0x4ac486['model'];_0x307a44['order']=qs[_0x40f9('0x49')](_0x51af77['query'][_0x40f9('0x49')]);_0x307a44[_0x40f9('0x4a')]=qs['filters'](_['pick'](_0x51af77[_0x40f9('0x40')],_0x4ac486[_0x40f9('0x41')]));if(_0x51af77['query'][_0x40f9('0x4c')]){_0x307a44[_0x40f9('0x4a')]=_[_0x40f9('0x4d')](_0x307a44[_0x40f9('0x4a')],{'$or':_[_0x40f9('0x3a')](_0x307a44[_0x40f9('0x44')],function(_0x266a76){var _0x28cc51={};_0x28cc51[_0x266a76]={'$like':'%'+_0x51af77[_0x40f9('0x40')][_0x40f9('0x4c')]+'%'};return _0x28cc51;})});}_0x307a44=_[_0x40f9('0x4d')]({},_0x307a44,_0x51af77[_0x40f9('0x50')]);return _0x3a71bd[_0x40f9('0x76')](_0x307a44);}})['then'](function(_0x452c78){if(_0x452c78){_0x492039=_0x452c78[_0x40f9('0x45')];if(!_0x51af77[_0x40f9('0x40')][_0x40f9('0x46')]('nolimit')){_0x307a44[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x51af77[_0x40f9('0x40')][_0x40f9('0x2b')]);_0x307a44[_0x40f9('0x2d')]=qs[_0x40f9('0x2d')](_0x51af77[_0x40f9('0x40')]['offset']);}return _0x3a71bd['getAgents'](_0x307a44);}})[_0x40f9('0x1c')](function(_0x1f4ae6){if(_0x1f4ae6){return _0x1f4ae6?{'count':_0x492039,'rows':_0x1f4ae6}:null;}})['then'](respondWithResult(_0x142dd1,null))[_0x40f9('0x26')](handleError(_0x142dd1,null));};exports['addApplications']=function(_0x42807a,_0x418ad2,_0x3630a5){return db['WhatsappAccount'][_0x40f9('0x66')]({'where':{'id':_0x42807a[_0x40f9('0x55')]['id']}})['then'](handleEntityNotFound(_0x418ad2,null))['then'](function(_0x3a9291){if(_0x3a9291){return db[_0x40f9('0x77')][_0x40f9('0x78')](function(_0x2ea6c5){return db['WhatsappApplication'][_0x40f9('0x34')]({'where':{'WhatsappAccountId':_0x42807a[_0x40f9('0x55')]['id']},'transaction':_0x2ea6c5})[_0x40f9('0x1c')](function(_0x5274cc){var _0xe5844e=_[_0x40f9('0x3a')](_0x42807a[_0x40f9('0x61')],function(_0x4e992e){_0x4e992e[_0x40f9('0x64')]=_0x42807a['params']['id'];return _0x4e992e;});return db[_0x40f9('0x79')][_0x40f9('0x7a')](_0xe5844e,{'transaction':_0x2ea6c5});});})[_0x40f9('0x1c')](function(){return db[_0x40f9('0x79')][_0x40f9('0x7b')]({'where':{'WhatsappAccountId':_0x42807a[_0x40f9('0x55')]['id']},'order':_0x40f9('0x7c')});});}})[_0x40f9('0x1c')](respondWithResult(_0x418ad2,null))['catch'](handleError(_0x418ad2,null));};exports[_0x40f9('0x7d')]=function(_0x1c4ba6,_0x523099,_0x53293f){var _0x222703={};var _0xf34085={};var _0x5e6930;var _0x56e944;return db[_0x40f9('0x3b')][_0x40f9('0x66')]({'where':{'id':_0x1c4ba6[_0x40f9('0x55')]['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x523099,null))[_0x40f9('0x1c')](function(_0x4f28a9){if(_0x4f28a9){_0x5e6930=_0x4f28a9;_0xf34085[_0x40f9('0x3e')]=_[_0x40f9('0x3f')](db[_0x40f9('0x79')]['rawAttributes']);_0xf34085[_0x40f9('0x40')]=_[_0x40f9('0x3f')](_0x1c4ba6[_0x40f9('0x40')]);_0xf34085[_0x40f9('0x41')]=_['intersection'](_0xf34085[_0x40f9('0x3e')],_0xf34085[_0x40f9('0x40')]);_0x222703[_0x40f9('0x44')]=_[_0x40f9('0x42')](_0xf34085['model'],qs[_0x40f9('0x43')](_0x1c4ba6['query'][_0x40f9('0x43')]));_0x222703['attributes']=_0x222703['attributes']['length']?_0x222703['attributes']:_0xf34085['model'];_0x222703[_0x40f9('0x48')]=qs[_0x40f9('0x49')](_0x1c4ba6[_0x40f9('0x40')]['sort']);_0x222703[_0x40f9('0x4a')]=qs[_0x40f9('0x41')](_['pick'](_0x1c4ba6[_0x40f9('0x40')],_0xf34085['filters']));if(_0x1c4ba6['query'][_0x40f9('0x4c')]){_0x222703[_0x40f9('0x4a')]=_[_0x40f9('0x4d')](_0x222703[_0x40f9('0x4a')],{'$or':_[_0x40f9('0x3a')](_0x222703[_0x40f9('0x44')],function(_0x7702ed){var _0x103599={};_0x103599[_0x7702ed]={'$like':'%'+_0x1c4ba6[_0x40f9('0x40')][_0x40f9('0x4c')]+'%'};return _0x103599;})});}_0x222703=_[_0x40f9('0x4d')]({},_0x222703,_0x1c4ba6[_0x40f9('0x50')]);return _0x5e6930[_0x40f9('0x7d')](_0x222703);}})[_0x40f9('0x1c')](function(_0xdff97c){if(_0xdff97c){_0x56e944=_0xdff97c[_0x40f9('0x45')];if(!_0x1c4ba6[_0x40f9('0x40')][_0x40f9('0x46')]('nolimit')){_0x222703[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x1c4ba6[_0x40f9('0x40')][_0x40f9('0x2b')]);_0x222703['offset']=qs[_0x40f9('0x2d')](_0x1c4ba6[_0x40f9('0x40')][_0x40f9('0x2d')]);}return _0x5e6930[_0x40f9('0x7d')](_0x222703);}})[_0x40f9('0x1c')](function(_0x144f2f){if(_0x144f2f){return _0x144f2f?{'count':_0x56e944,'rows':_0x144f2f}:null;}})[_0x40f9('0x1c')](respondWithResult(_0x523099,null))['catch'](handleError(_0x523099,null));};exports[_0x40f9('0x7e')]=function(_0x3e07ed,_0x1dc35,_0x5f2d42){logger[_0x40f9('0x1d')](_0x40f9('0x7f'));logger[_0x40f9('0x1d')]('AC\x20WhatsappAccount\x20req.body:%s',JSON['stringify'](_0x3e07ed['body']));var _0x3c8fe8={'channel':'whatsapp'};var _0x192388=[];var _0x5a735c=[];var _0x220c85={};return db[_0x40f9('0x3b')]['find']({'where':{'id':_0x3e07ed[_0x40f9('0x55')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x40f9('0x80')}]})[_0x40f9('0x1c')](handleEntityNotFound(_0x1dc35,null))[_0x40f9('0x1c')](function(_0x532120){_0x3c8fe8['account']=_0x532120;_0x3c8fe8[_0x40f9('0x81')]=_['orderBy'](_0x532120[_0x40f9('0x80')],[_0x40f9('0x7c')],[_0x40f9('0x82')]);if(_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x80')]){delete _0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x80')];}return db[_0x40f9('0x84')]['describe']();})['then'](function(_0x3b1591){if(!_0x3b1591){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x87'));}logger[_0x40f9('0x1d')](_0x40f9('0x88'),JSON['stringify'](_0x3b1591));logger['info']('AC\x20sinch\x20req.body:%s',JSON[_0x40f9('0x89')](_0x3e07ed[_0x40f9('0x61')]));_0x192388=_[_0x40f9('0x8a')](_[_0x40f9('0x3f')](_0x3b1591),[_0x40f9('0x8b'),_0x40f9('0x8c')]);_0x5a735c=_[_0x40f9('0x8a')](_[_0x40f9('0x3f')](_0x3b1591),[_0x40f9('0x8b'),_0x40f9('0x8c'),_0x40f9('0x8d'),_0x40f9('0x8e')]);_0x3c8fe8[_0x40f9('0x61')]={'mapKey':_0x40f9('0x8f')};logger[_0x40f9('0x1d')]('AC\x20sinch\x20routing.account.type:%s',JSON[_0x40f9('0x89')](_0x3c8fe8[_0x40f9('0x83')]['type']));logger[_0x40f9('0x1d')]('AC\x20sinch\x20routing.body:%s',JSON[_0x40f9('0x89')](_0x3c8fe8[_0x40f9('0x61')]));logger[_0x40f9('0x1d')]('AC\x20sinch\x20contactFields:%s',_0x192388);logger[_0x40f9('0x1d')](_0x40f9('0x90'),_0x5a735c);if(_0x3c8fe8['account'][_0x40f9('0x4e')]&&_0x3c8fe8['account'][_0x40f9('0x4e')]==='twilio'){_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')]=_0x3e07ed[_0x40f9('0x61')]['From'][_0x40f9('0x92')](_0x40f9('0x93'),'');_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x61')]=_0x3e07ed['body'][_0x40f9('0x94')];_0x3c8fe8[_0x40f9('0x61')]['messageId']=_0x3e07ed[_0x40f9('0x61')][_0x40f9('0x95')];}if(_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x4e')]&&_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x4e')]===_0x40f9('0x96')){logger[_0x40f9('0x1d')]('AC\x20sinch\x20req.body\x202:%s',JSON[_0x40f9('0x89')](_0x3e07ed[_0x40f9('0x61')]));_0x3c8fe8['body'][_0x40f9('0x91')]=_0x3e07ed[_0x40f9('0x61')][_0x40f9('0x97')][0x0][_0x40f9('0x91')];_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x61')]=_0x3e07ed['body'][_0x40f9('0x97')][0x0][_0x40f9('0x23')][_0x40f9('0x61')];_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x98')]=_0x3e07ed[_0x40f9('0x61')][_0x40f9('0x97')][0x0]['message_id'];}if(_0x3c8fe8['body']['id']){delete _0x3c8fe8[_0x40f9('0x61')]['id'];}if(_[_0x40f9('0x99')](_0x3c8fe8['body'][_0x40f9('0x91')])){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x9a'));}if(_[_0x40f9('0x99')](_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x61')])||_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x61')]===''){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x9b'));}if(_['isNil'](_0x3c8fe8[_0x40f9('0x61')]['mapKey'])){throw new db['Sequelize'][(_0x40f9('0x86'))](_0x40f9('0x9c')+_0x5a735c);}if(!_[_0x40f9('0x9d')](_0x5a735c,_0x3c8fe8[_0x40f9('0x61')]['mapKey'])){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x9e')+_0x5a735c);}_0x220c85[_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x9f')]]=_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')];return db[_0x40f9('0xa0')][_0x40f9('0x56')]({'where':{'id':_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x8e')]},'include':[{'model':db[_0x40f9('0x84')],'as':_0x40f9('0xa1'),'where':_0x220c85,'limit':0x1,'order':[[_0x40f9('0x8c'),_0x40f9('0xa2')]]}]});})['then'](handleEntityNotFound(_0x1dc35,null))['then'](function(_0x47efac){if(_0x47efac){_0x3c8fe8[_0x40f9('0xa3')]=_[_0x40f9('0xa4')](_0x47efac,[_0x40f9('0xa1')]);if(_0x47efac[_0x40f9('0xa1')][_0x40f9('0x45')]){return _0x47efac[_0x40f9('0xa1')][0x0];}var _0x21031d=_[_0x40f9('0xa5')](_0x3c8fe8['body'],{'firstName':_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')],'ListId':_0x47efac['id']});_0x21031d[_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x9f')]]=_0x3c8fe8[_0x40f9('0x61')]['from'];return db['CmContact'][_0x40f9('0x57')](_0x21031d,{'fields':_0x192388,'raw':!![]});}})[_0x40f9('0x1c')](handleEntityNotFound(_0x1dc35,null))[_0x40f9('0x1c')](function(_0x286cc0){if(_0x286cc0){_0x3c8fe8[_0x40f9('0xa6')]=_0x286cc0;var _0x53b293={'ContactId':_0x286cc0['id'],'phone':_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')],'WhatsappAccountId':_0x3e07ed[_0x40f9('0x55')]['id']};var _0x12830c={'ContactId':_0x286cc0['id'],'WhatsappAccountId':_0x3e07ed['params']['id'],'closed':![]};return db[_0x40f9('0xa7')][_0x40f9('0x56')]({'where':_0x12830c})[_0x40f9('0x1c')](function(_0x53cddf){if(_0x53cddf){return[_0x53cddf,![]];}return db[_0x40f9('0xa7')][_0x40f9('0x57')](_0x53b293)['then'](function(_0x548cad){return[_0x548cad,!![]];});});}})['spread'](function(_0x1d9425,_0x237551){_0x3c8fe8[_0x40f9('0xa8')]=_0x1d9425['get']({'plain':!![]});_0x3c8fe8[_0x40f9('0xa8')][_0x40f9('0xa9')]=![];if(_0x237551){if(_0x3c8fe8[_0x40f9('0x83')]['autoclose']){_0x3c8fe8[_0x40f9('0x81')][_0x40f9('0xaa')]({'id':0x0,'priority':_0x3c8fe8['applications'][_0x40f9('0x45')]+0x1,'app':_0x40f9('0xab'),'appdata':'unmanaged','interval':_0x40f9('0xac')});}_0x3c8fe8[_0x40f9('0xa8')]['created']=!![];}return db[_0x40f9('0xad')][_0x40f9('0x57')]({'phone':_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')],'messageId':_0x3c8fe8['body']['messageId'],'body':_0x3c8fe8[_0x40f9('0x61')]['body'],'WhatsappAccountId':_0x3e07ed[_0x40f9('0x55')]['id'],'WhatsappInteractionId':_0x1d9425['id'],'direction':'in','ContactId':_0x1d9425[_0x40f9('0xae')],'AttachmentId':_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0xaf')]});})['then'](function(_0x50a7a7){_0x3c8fe8[_0x40f9('0x23')]=_0x50a7a7;if(_0x3c8fe8[_0x40f9('0xa8')]['UserId']){return db[_0x40f9('0xb0')][_0x40f9('0x56')]({'attributes':['id',_0x40f9('0x36')],'where':{'id':_0x3c8fe8['interaction'][_0x40f9('0xb1')]}})[_0x40f9('0x1c')](function(_0x2a5ff9){if(_0x2a5ff9){_0x3c8fe8[_0x40f9('0x81')][_0x40f9('0xb2')]({'id':0x0,'priority':0x0,'app':_0x40f9('0xb3'),'appdata':_0x2a5ff9[_0x40f9('0x36')]+','+(_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0xb4')]||0xa),'interval':_0x40f9('0xac')});}return respondWithRpcPromise(_0x40f9('0xb5'),'startRouting',_0x3c8fe8);});}return respondWithRpcPromise(_0x40f9('0xb5'),'startRouting',_0x3c8fe8);})[_0x40f9('0x1c')](function(_0x282f7a){if(_0x282f7a){var _0x3863be=0xc8;var _0x3f0bc0='receiveMessage';logger['info'](_0x40f9('0x1f'),_0x3f0bc0,_0x3863be,_0x40f9('0xb6'));logger[_0x40f9('0x1e')](_0x40f9('0xb7'),_0x3f0bc0,_0x3863be,'entity\x20found',JSON[_0x40f9('0x89')](_0x282f7a));if(_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x4e')]===_0x40f9('0xb8')){return _0x1dc35['status'](_0x3863be)[_0x40f9('0x2e')](_0x40f9('0xb9'),'text/xml')[_0x40f9('0x37')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x1dc35[_0x40f9('0x28')](_0x3863be)[_0x40f9('0xba')](_0x282f7a);}}})[_0x40f9('0x26')](handleError(_0x1dc35,null));};exports[_0x40f9('0x37')]=function(_0x410750,_0x4fc461,_0x38c9c1){var _0x553cb3,_0x52b987,_0x54d857;if(_[_0x40f9('0x99')](_0x410750['body']['body'])||_0x410750[_0x40f9('0x61')][_0x40f9('0x61')]===''){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x9b'));}if(_[_0x40f9('0x99')](_0x410750[_0x40f9('0x61')]['to'])){throw new db['Sequelize']['ValidationError'](_0x40f9('0xbb'));}_0x553cb3=_0x410750[_0x40f9('0x61')]['to'];return db[_0x40f9('0x3b')][_0x40f9('0x56')]({'where':{'id':_0x410750[_0x40f9('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x40f9('0xbc'),'include':[{'model':db[_0x40f9('0x84')],'as':_0x40f9('0xa1'),'where':{'mobile':_0x553cb3},'limit':0x1,'order':[[_0x40f9('0x8c'),_0x40f9('0xa2')]]}]}]})[_0x40f9('0x1c')](handleEntityNotFound(_0x4fc461,null))[_0x40f9('0x1c')](function(_0x4fe281){if(_0x4fe281&&_0x4fe281[_0x40f9('0xbc')]){_0x52b987=_0x4fe281[_0x40f9('0x58')]({'plain':!![]});if(_0x52b987[_0x40f9('0xbc')]&&_0x52b987['List']['Contacts'][_0x40f9('0x45')]){return _0x52b987[_0x40f9('0xbc')][_0x40f9('0xa1')][0x0];}return db[_0x40f9('0x84')][_0x40f9('0x57')](_[_0x40f9('0xa5')](_0x410750[_0x40f9('0x61')],{'firstName':_0x553cb3,'mobile':_0x553cb3,'phone':_0x553cb3,'ListId':_0x52b987['ListId']}));}})[_0x40f9('0x1c')](handleEntityNotFound(_0x4fc461,null))[_0x40f9('0x1c')](function(_0x57f443){if(_0x57f443){_0x54d857=_0x57f443;return db[_0x40f9('0xa7')][_0x40f9('0x56')]({'where':{'ContactId':_0x54d857['id'],'closed':![],'WhatsappAccountId':_0x52b987['id']}})['then'](function(_0x1a9c4a){if(_0x1a9c4a){return[_0x1a9c4a,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x410750['user']['id'],'ContactId':_0x54d857['id'],'WhatsappAccountId':_0x52b987['id'],'phone':_0x553cb3,'firstMsgDirection':_0x40f9('0xbd'),'Messages':[_[_0x40f9('0x4d')](_0x410750[_0x40f9('0x61')],{'read':![],'body':_0x410750[_0x40f9('0x61')][_0x40f9('0x61')],'phone':_0x553cb3,'WhatsappAccountId':_0x52b987['id'],'UserId':_0x410750[_0x40f9('0x5b')]['id'],'ContactId':_0x54d857['id']})]},{'include':[{'model':db[_0x40f9('0xad')],'as':'Messages'}]})[_0x40f9('0x1c')](function(_0x499ee2){return[_0x499ee2,!![]];});});}})[_0x40f9('0x71')](function(_0x27432e,_0x2f0938){if(_0x2f0938){return _0x27432e;}return db['WhatsappMessage']['create'](_[_0x40f9('0x4d')](_0x410750[_0x40f9('0x61')],{'read':![],'body':_0x410750[_0x40f9('0x61')][_0x40f9('0x61')],'phone':_0x553cb3,'WhatsappAccountId':_0x52b987['id'],'WhatsappInteractionId':_0x27432e['id'],'UserId':_0x410750['user']['id'],'ContactId':_0x54d857['id']}))[_0x40f9('0x1c')](function(_0x5a0e95){_0x27432e[_0x40f9('0xbe')][_0x40f9('0xbf')]=[];_0x27432e[_0x40f9('0xbe')]['Messages']['push'](_0x5a0e95[_0x40f9('0xbe')]);return _0x27432e;});})['then'](respondWithResult(_0x4fc461,null))[_0x40f9('0x26')](handleError(_0x4fc461,null));};
\ No newline at end of file
index 72b24ab..ee0c99b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bd1=['emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x5fc6ff,_0x54805d){var _0x517b4e=function(_0x285da0){while(--_0x285da0){_0x5fc6ff['push'](_0x5fc6ff['shift']());}};_0x517b4e(++_0x54805d);}(_0x9bd1,0x143));var _0x19bd=function(_0x2ffe77,_0x565f39){_0x2ffe77=_0x2ffe77-0x0;var _0x22c03c=_0x9bd1[_0x2ffe77];return _0x22c03c;};'use strict';var EventEmitter=require(_0x19bd('0x0'));var WhatsappAccount=require(_0x19bd('0x1'))['db'][_0x19bd('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x19bd('0x3')](0x0);var events={'afterCreate':_0x19bd('0x4'),'afterUpdate':_0x19bd('0x5'),'afterDestroy':_0x19bd('0x6')};function emitEvent(_0x2e7462){return function(_0x4a391d,_0x1495bc,_0x1142e6){WhatsappAccountEvents[_0x19bd('0x7')](_0x2e7462+':'+_0x4a391d['id'],_0x4a391d);WhatsappAccountEvents[_0x19bd('0x7')](_0x2e7462,_0x4a391d);_0x1142e6(null);};}for(var e in events){if(events[_0x19bd('0x8')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x19bd('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x0290=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hook','exports'];(function(_0x2bd517,_0x129985){var _0xd052f7=function(_0x157997){while(--_0x157997){_0x2bd517['push'](_0x2bd517['shift']());}};_0xd052f7(++_0x129985);}(_0x0290,0x1cb));var _0x0029=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0290[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x0029('0x0'));var WhatsappAccount=require(_0x0029('0x1'))['db'][_0x0029('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0029('0x3')](0x0);var events={'afterCreate':_0x0029('0x4'),'afterUpdate':_0x0029('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2d589d){return function(_0x3e5123,_0x5a1444,_0x55a683){WhatsappAccountEvents[_0x0029('0x6')](_0x2d589d+':'+_0x3e5123['id'],_0x3e5123);WhatsappAccountEvents[_0x0029('0x6')](_0x2d589d,_0x3e5123);_0x55a683(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x0029('0x7')](e,emitEvent(event));}}module[_0x0029('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
index a6619e4..213d335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e5d=['request-promise','path','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','bluebird'];(function(_0x1ac5fb,_0x355a75){var _0x211ea7=function(_0x23e5e2){while(--_0x23e5e2){_0x1ac5fb['push'](_0x1ac5fb['shift']());}};_0x211ea7(++_0x355a75);}(_0x8e5d,0xa1));var _0xd8e5=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0x8e5d[_0x2984d0];return _0x2885f2;};'use strict';var _=require(_0xd8e5('0x0'));var util=require(_0xd8e5('0x1'));var logger=require('../../config/logger')(_0xd8e5('0x2'));var moment=require('moment');var BPromise=require(_0xd8e5('0x3'));var rp=require(_0xd8e5('0x4'));var fs=require('fs');var path=require(_0xd8e5('0x5'));var rimraf=require('rimraf');var config=require(_0xd8e5('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xd8e5('0x7')]=function(_0x5c44fb,_0x42f832){return _0x5c44fb[_0xd8e5('0x8')](_0xd8e5('0x9'),attributes,{'tableName':_0xd8e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5559=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','whatsapp_accounts'];(function(_0x336e33,_0x527fa3){var _0x6c333a=function(_0x48dabd){while(--_0x48dabd){_0x336e33['push'](_0x336e33['shift']());}};_0x6c333a(++_0x527fa3);}(_0x5559,0x1ce));var _0x9555=function(_0x37d189,_0x5d1385){_0x37d189=_0x37d189-0x0;var _0x1b06ca=_0x5559[_0x37d189];return _0x1b06ca;};'use strict';var _=require(_0x9555('0x0'));var util=require(_0x9555('0x1'));var logger=require(_0x9555('0x2'))(_0x9555('0x3'));var moment=require(_0x9555('0x4'));var BPromise=require(_0x9555('0x5'));var rp=require(_0x9555('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9555('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x9555('0x8')]=function(_0xe30fc6,_0x18fbe9){return _0xe30fc6[_0x9555('0x9')]('WhatsappAccount',attributes,{'tableName':_0x9555('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b78f100..32eefa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5529=['WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','ShowWhatsappAccount','options','raw','where','include','map','model','attributes','stringify','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','defaults','redis','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x427e77,_0x1a5345){var _0xafe228=function(_0x59811e){while(--_0x59811e){_0x427e77['push'](_0x427e77['shift']());}};_0xafe228(++_0x1a5345);}(_0x5529,0xc8));var _0x9552=function(_0x4ac40a,_0x4bb8f7){_0x4ac40a=_0x4ac40a-0x0;var _0x5d75ef=_0x5529[_0x4ac40a];return _0x5d75ef;};'use strict';var _=require(_0x9552('0x0'));var util=require(_0x9552('0x1'));var moment=require(_0x9552('0x2'));var BPromise=require(_0x9552('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9552('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9552('0x5'))(_0x9552('0x6'));var config=require(_0x9552('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9552('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9552('0x9')]));require('./whatsappAccount.socket')[_0x9552('0xa')](socket);function respondWithRpcPromise(_0x13d96f,_0x5e93a4,_0x3cb8ae){return new BPromise(function(_0x9d961b,_0x13848b){return client[_0x9552('0xb')](_0x13d96f,_0x3cb8ae)[_0x9552('0xc')](function(_0x42607a){logger[_0x9552('0xd')](_0x9552('0xe'),_0x5e93a4,_0x9552('0xf'));logger[_0x9552('0x10')](_0x9552('0x11'),_0x5e93a4,_0x9552('0xf'),JSON['stringify'](_0x42607a));if(_0x42607a[_0x9552('0x12')]){if(_0x42607a[_0x9552('0x12')]['code']===0x1f4){logger[_0x9552('0x12')](_0x9552('0xe'),_0x5e93a4,_0x42607a['error'][_0x9552('0x13')]);return _0x13848b(_0x42607a[_0x9552('0x12')][_0x9552('0x13')]);}logger[_0x9552('0x12')](_0x9552('0xe'),_0x5e93a4,_0x42607a[_0x9552('0x12')][_0x9552('0x13')]);return _0x9d961b(_0x42607a[_0x9552('0x12')]['message']);}else{logger[_0x9552('0xd')](_0x9552('0xe'),_0x5e93a4,_0x9552('0xf'));_0x9d961b(_0x42607a[_0x9552('0x14')][_0x9552('0x13')]);}})['catch'](function(_0x110e24){logger[_0x9552('0x12')](_0x9552('0xe'),_0x5e93a4,_0x110e24);_0x13848b(_0x110e24);});});}exports[_0x9552('0x15')]=function(_0x3aa93c){var _0x53a586=this;return new Promise(function(_0x43e8e2,_0x4548c7){return db['WhatsappAccount']['find']({'raw':_0x3aa93c[_0x9552('0x16')]?_0x3aa93c[_0x9552('0x16')][_0x9552('0x17')]===undefined?!![]:![]:!![],'where':_0x3aa93c[_0x9552('0x16')]?_0x3aa93c[_0x9552('0x16')][_0x9552('0x18')]||null:null,'attributes':_0x3aa93c[_0x9552('0x16')]?_0x3aa93c[_0x9552('0x16')]['attributes']||null:null,'include':_0x3aa93c['options']?_0x3aa93c[_0x9552('0x16')][_0x9552('0x19')]?_[_0x9552('0x1a')](_0x3aa93c[_0x9552('0x16')][_0x9552('0x19')],function(_0x152e03){return{'model':db[_0x152e03[_0x9552('0x1b')]],'as':_0x152e03['as'],'attributes':_0x152e03[_0x9552('0x1c')],'include':_0x152e03['include']?_[_0x9552('0x1a')](_0x152e03[_0x9552('0x19')],function(_0xa1d8f3){return{'model':db[_0xa1d8f3[_0x9552('0x1b')]],'as':_0xa1d8f3['as'],'attributes':_0xa1d8f3['attributes'],'include':_0xa1d8f3['include']?_['map'](_0xa1d8f3[_0x9552('0x19')],function(_0xc29a04){return{'model':db[_0xc29a04['model']],'as':_0xc29a04['as'],'attributes':_0xc29a04[_0x9552('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9552('0xc')](function(_0x355195){logger[_0x9552('0xd')]('ShowWhatsappAccount',_0x3aa93c);logger[_0x9552('0x10')](_0x9552('0x15'),_0x3aa93c,JSON[_0x9552('0x1d')](_0x355195));_0x43e8e2(_0x355195);})[_0x9552('0x1e')](function(_0x3d3725){logger[_0x9552('0x12')]('ShowWhatsappAccount',_0x3d3725[_0x9552('0x13')],_0x3aa93c);_0x4548c7(_0x53a586[_0x9552('0x12')](0x1f4,_0x3d3725['message']));});});};
\ No newline at end of file
+var _0x4b68=['register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','WhatsappAccount','find','options','raw','attributes','map','model','include','ShowWhatsappAccount','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappAccount.socket'];(function(_0x5b60f2,_0x487b46){var _0x2b618b=function(_0x5ebc09){while(--_0x5ebc09){_0x5b60f2['push'](_0x5b60f2['shift']());}};_0x2b618b(++_0x487b46);}(_0x4b68,0xc8));var _0x84b6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4b68[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x84b6('0x0'));var moment=require(_0x84b6('0x1'));var BPromise=require(_0x84b6('0x2'));var rs=require(_0x84b6('0x3'));var fs=require('fs');var Redis=require(_0x84b6('0x4'));var db=require(_0x84b6('0x5'))['db'];var utils=require(_0x84b6('0x6'));var logger=require(_0x84b6('0x7'))(_0x84b6('0x8'));var config=require(_0x84b6('0x9'));var jayson=require(_0x84b6('0xa'));var client=jayson['client'][_0x84b6('0xb')]({'port':0x232a});config[_0x84b6('0xc')]=_[_0x84b6('0xd')](config[_0x84b6('0xc')],{'host':_0x84b6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84b6('0xc')]));require(_0x84b6('0xf'))[_0x84b6('0x10')](socket);function respondWithRpcPromise(_0x3a29d3,_0x302588,_0x5370df){return new BPromise(function(_0x37b2e2,_0x80bb80){return client[_0x84b6('0x11')](_0x3a29d3,_0x5370df)[_0x84b6('0x12')](function(_0x4b77ac){logger[_0x84b6('0x13')](_0x84b6('0x14'),_0x302588,_0x84b6('0x15'));logger[_0x84b6('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x302588,_0x84b6('0x15'),JSON['stringify'](_0x4b77ac));if(_0x4b77ac[_0x84b6('0x17')]){if(_0x4b77ac[_0x84b6('0x17')]['code']===0x1f4){logger['error'](_0x84b6('0x14'),_0x302588,_0x4b77ac[_0x84b6('0x17')]['message']);return _0x80bb80(_0x4b77ac[_0x84b6('0x17')][_0x84b6('0x18')]);}logger[_0x84b6('0x17')](_0x84b6('0x14'),_0x302588,_0x4b77ac[_0x84b6('0x17')][_0x84b6('0x18')]);return _0x37b2e2(_0x4b77ac[_0x84b6('0x17')][_0x84b6('0x18')]);}else{logger[_0x84b6('0x13')](_0x84b6('0x14'),_0x302588,_0x84b6('0x15'));_0x37b2e2(_0x4b77ac['result']['message']);}})['catch'](function(_0x47b95f){logger[_0x84b6('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x302588,_0x47b95f);_0x80bb80(_0x47b95f);});});}exports['ShowWhatsappAccount']=function(_0x2e1a09){var _0x429615=this;return new Promise(function(_0x33c861,_0x3144e8){return db[_0x84b6('0x19')][_0x84b6('0x1a')]({'raw':_0x2e1a09[_0x84b6('0x1b')]?_0x2e1a09[_0x84b6('0x1b')][_0x84b6('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e1a09[_0x84b6('0x1b')]?_0x2e1a09[_0x84b6('0x1b')]['where']||null:null,'attributes':_0x2e1a09[_0x84b6('0x1b')]?_0x2e1a09[_0x84b6('0x1b')][_0x84b6('0x1d')]||null:null,'include':_0x2e1a09[_0x84b6('0x1b')]?_0x2e1a09[_0x84b6('0x1b')]['include']?_[_0x84b6('0x1e')](_0x2e1a09[_0x84b6('0x1b')]['include'],function(_0x3ec572){return{'model':db[_0x3ec572[_0x84b6('0x1f')]],'as':_0x3ec572['as'],'attributes':_0x3ec572[_0x84b6('0x1d')],'include':_0x3ec572[_0x84b6('0x20')]?_['map'](_0x3ec572[_0x84b6('0x20')],function(_0x3a382b){return{'model':db[_0x3a382b[_0x84b6('0x1f')]],'as':_0x3a382b['as'],'attributes':_0x3a382b[_0x84b6('0x1d')],'include':_0x3a382b['include']?_[_0x84b6('0x1e')](_0x3a382b[_0x84b6('0x20')],function(_0x59b6d4){return{'model':db[_0x59b6d4['model']],'as':_0x59b6d4['as'],'attributes':_0x59b6d4[_0x84b6('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51aede){logger[_0x84b6('0x13')](_0x84b6('0x21'),_0x2e1a09);logger[_0x84b6('0x16')](_0x84b6('0x21'),_0x2e1a09,JSON[_0x84b6('0x22')](_0x51aede));_0x33c861(_0x51aede);})[_0x84b6('0x23')](function(_0x5cadd2){logger[_0x84b6('0x17')]('ShowWhatsappAccount',_0x5cadd2[_0x84b6('0x18')],_0x2e1a09);_0x3144e8(_0x429615[_0x84b6('0x17')](0x1f4,_0x5cadd2[_0x84b6('0x18')]));});});};
\ No newline at end of file
index e87fa3b..bdb1dad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a86=['length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x415856,_0x2e75e2){var _0x4929d1=function(_0x339d25){while(--_0x339d25){_0x415856['push'](_0x415856['shift']());}};_0x4929d1(++_0x2e75e2);}(_0x8a86,0x122));var _0x68a8=function(_0x634cd,_0x5b70ba){_0x634cd=_0x634cd-0x0;var _0x1d0f39=_0x8a86[_0x634cd];return _0x1d0f39;};'use strict';var WhatsappAccountEvents=require(_0x68a8('0x0'));var events=[_0x68a8('0x1'),_0x68a8('0x2'),_0x68a8('0x3')];function createListener(_0x5b86e5,_0x3aeefc){return function(_0x4ada37){_0x3aeefc[_0x68a8('0x4')](_0x5b86e5,_0x4ada37);};}function removeListener(_0x154cc1,_0x5e1ace){return function(){WhatsappAccountEvents[_0x68a8('0x5')](_0x154cc1,_0x5e1ace);};}exports[_0x68a8('0x6')]=function(_0x44fd29){for(var _0x235c0a=0x0,_0x35345a=events[_0x68a8('0x7')];_0x235c0a<_0x35345a;_0x235c0a++){var _0x31fcdb=events[_0x235c0a];var _0x47e1ba=createListener(_0x68a8('0x8')+_0x31fcdb,_0x44fd29);WhatsappAccountEvents['on'](_0x31fcdb,_0x47e1ba);}};
\ No newline at end of file
+var _0x86c9=['./whatsappAccount.events','remove','update','emit','removeListener','register','length','whatsappAccount:'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x86c9,0x1e8));var _0x986c=function(_0x12b0b9,_0x2e780e){_0x12b0b9=_0x12b0b9-0x0;var _0x34a5f5=_0x86c9[_0x12b0b9];return _0x34a5f5;};'use strict';var WhatsappAccountEvents=require(_0x986c('0x0'));var events=['save',_0x986c('0x1'),_0x986c('0x2')];function createListener(_0x24c350,_0x39061d){return function(_0x313d73){_0x39061d[_0x986c('0x3')](_0x24c350,_0x313d73);};}function removeListener(_0x265b55,_0x3a145d){return function(){WhatsappAccountEvents[_0x986c('0x4')](_0x265b55,_0x3a145d);};}exports[_0x986c('0x5')]=function(_0x3e086b){for(var _0x19e534=0x0,_0x115c8d=events[_0x986c('0x6')];_0x19e534<_0x115c8d;_0x19e534++){var _0x156a08=events[_0x19e534];var _0x5d7bea=createListener(_0x986c('0x7')+_0x156a08,_0x3e086b);WhatsappAccountEvents['on'](_0x156a08,_0x5d7bea);}};
\ No newline at end of file
index 1fd954b..87ef091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb03=['create','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xdb03,0x18a));var _0x3db0=function(_0x15c57d,_0x2970ad){_0x15c57d=_0x15c57d-0x0;var _0x54aa65=_0xdb03[_0x15c57d];return _0x54aa65;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3db0('0x0'));var timeout=require(_0x3db0('0x1'));var express=require('express');var router=express[_0x3db0('0x2')]();var fs_extra=require(_0x3db0('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3db0('0x4'));var controller=require('./whatsappApplication.controller');router[_0x3db0('0x5')]('/',auth[_0x3db0('0x6')](),controller[_0x3db0('0x7')]);router['get'](_0x3db0('0x8'),auth[_0x3db0('0x6')](),controller[_0x3db0('0x9')]);router[_0x3db0('0xa')]('/',auth[_0x3db0('0x6')](),controller[_0x3db0('0xb')]);router['put'](_0x3db0('0x8'),auth[_0x3db0('0x6')](),controller[_0x3db0('0xc')]);router['delete']('/:id',auth[_0x3db0('0x6')](),controller[_0x3db0('0xd')]);module[_0x3db0('0xe')]=router;
\ No newline at end of file
+var _0x4f54=['./whatsappApplication.controller','index','get','/:id','post','isAuthenticated','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1da017,_0x1600ef){var _0x13bb16=function(_0x2ab5a8){while(--_0x2ab5a8){_0x1da017['push'](_0x1da017['shift']());}};_0x13bb16(++_0x1600ef);}(_0x4f54,0x10e));var _0x44f5=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4f54[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x44f5('0x0'));var util=require(_0x44f5('0x1'));var path=require(_0x44f5('0x2'));var timeout=require(_0x44f5('0x3'));var express=require(_0x44f5('0x4'));var router=express[_0x44f5('0x5')]();var fs_extra=require(_0x44f5('0x6'));var auth=require(_0x44f5('0x7'));var interaction=require(_0x44f5('0x8'));var config=require(_0x44f5('0x9'));var controller=require(_0x44f5('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x44f5('0xb')]);router[_0x44f5('0xc')](_0x44f5('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x44f5('0xe')]('/',auth[_0x44f5('0xf')](),controller['create']);router[_0x44f5('0x10')]('/:id',auth[_0x44f5('0xf')](),controller['update']);router[_0x44f5('0x11')](_0x44f5('0xd'),auth[_0x44f5('0xf')](),controller[_0x44f5('0x12')]);module[_0x44f5('0x13')]=router;
\ No newline at end of file
index d105819..7d6be85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc669=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x53b1e7,_0xfaa5bf){var _0x23efb6=function(_0x3e9f20){while(--_0x3e9f20){_0x53b1e7['push'](_0x53b1e7['shift']());}};_0x23efb6(++_0xfaa5bf);}(_0xc669,0x191));var _0x9c66=function(_0x367bb7,_0x3ab086){_0x367bb7=_0x367bb7-0x0;var _0x447969=_0xc669[_0x367bb7];return _0x447969;};'use strict';var Sequelize=require(_0x9c66('0x0'));module[_0x9c66('0x1')]={'priority':{'type':Sequelize[_0x9c66('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9c66('0x3')],'allowNull':![],'defaultValue':_0x9c66('0x4')},'appdata':{'type':Sequelize[_0x9c66('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9c66('0x3')],'defaultValue':_0x9c66('0x6')}};
\ No newline at end of file
+var _0xb82d=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x4faa06,_0x2cd369){var _0x5b808a=function(_0x244764){while(--_0x244764){_0x4faa06['push'](_0x4faa06['shift']());}};_0x5b808a(++_0x2cd369);}(_0xb82d,0xc8));var _0xdb82=function(_0x22149c,_0x13c8ab){_0x22149c=_0x22149c-0x0;var _0x15f67c=_0xb82d[_0x22149c];return _0x15f67c;};'use strict';var Sequelize=require(_0xdb82('0x0'));module['exports']={'priority':{'type':Sequelize[_0xdb82('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdb82('0x2')],'allowNull':![],'defaultValue':_0xdb82('0x3')},'appdata':{'type':Sequelize[_0xdb82('0x4')]()},'description':{'type':Sequelize[_0xdb82('0x2')]},'interval':{'type':Sequelize[_0xdb82('0x2')],'defaultValue':_0xdb82('0x5')}};
\ No newline at end of file
index aa2e8d4..c05f7b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eba=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','end','error','stack','name','send','index','rawAttributes','type','key','map','keys','filters','query','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','show','length','find','catch','create','body','update','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x1eb6a2,_0x2c281f){var _0x576816=function(_0x1efcc7){while(--_0x1efcc7){_0x1eb6a2['push'](_0x1eb6a2['shift']());}};_0x576816(++_0x2c281f);}(_0x2eba,0xc7));var _0xa2eb=function(_0x1b9fd5,_0x36d364){_0x1b9fd5=_0x1b9fd5-0x0;var _0x2cc320=_0x2eba[_0x1b9fd5];return _0x2cc320;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2eb('0x0'));var zipdir=require(_0xa2eb('0x1'));var jsonpatch=require(_0xa2eb('0x2'));var rp=require(_0xa2eb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa2eb('0x4'));var util=require('util');var path=require(_0xa2eb('0x5'));var sox=require(_0xa2eb('0x6'));var csv=require(_0xa2eb('0x7'));var ejs=require(_0xa2eb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2eb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xa2eb('0xa'));var toCsv=require(_0xa2eb('0x7'));var querystring=require(_0xa2eb('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa2eb('0xc'));var qs=require(_0xa2eb('0xd'));var as=require(_0xa2eb('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2eb('0xf'))(_0xa2eb('0x10'));var utils=require('../../config/utils');var config=require(_0xa2eb('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2eb('0x12'))['db'];function respondWithStatusCode(_0x2f67ab,_0x5e492a){_0x5e492a=_0x5e492a||0xcc;return function(_0xfebbb4){if(_0xfebbb4){return _0x2f67ab[_0xa2eb('0x13')](_0x5e492a);}return _0x2f67ab[_0xa2eb('0x14')](_0x5e492a)['end']();};}function respondWithResult(_0x41af8c,_0x2c1cba){_0x2c1cba=_0x2c1cba||0xc8;return function(_0x2e2426){if(_0x2e2426){return _0x41af8c[_0xa2eb('0x14')](_0x2c1cba)[_0xa2eb('0x15')](_0x2e2426);}};}function respondWithFilteredResult(_0x282d37,_0x34aa65){return function(_0x2a5b1f){if(_0x2a5b1f){var _0x1b6cb4=typeof _0x34aa65[_0xa2eb('0x16')]===_0xa2eb('0x17')&&typeof _0x34aa65[_0xa2eb('0x18')]==='undefined';var _0x556ca0=_0x2a5b1f[_0xa2eb('0x19')];var _0xa74836=_0x1b6cb4?0x0:_0x34aa65[_0xa2eb('0x16')];var _0xe1c088=_0x1b6cb4?_0x2a5b1f[_0xa2eb('0x19')]:_0x34aa65[_0xa2eb('0x16')]+_0x34aa65[_0xa2eb('0x18')];var _0x5836ee;if(_0xe1c088>=_0x556ca0){_0xe1c088=_0x556ca0;_0x5836ee=0xc8;}else{_0x5836ee=0xce;}_0x282d37[_0xa2eb('0x14')](_0x5836ee);return _0x282d37[_0xa2eb('0x1a')](_0xa2eb('0x1b'),_0xa74836+'-'+_0xe1c088+'/'+_0x556ca0)[_0xa2eb('0x15')](_0x2a5b1f);}return null;};}function patchUpdates(_0x148a75){return function(_0x4acc20){try{jsonpatch['apply'](_0x4acc20,_0x148a75,!![]);}catch(_0x6a54b8){return BPromise[_0xa2eb('0x1c')](_0x6a54b8);}return _0x4acc20['save']();};}function saveUpdates(_0x28aec8,_0x1c93cf){return function(_0x5b65e8){if(_0x5b65e8){return _0x5b65e8['update'](_0x28aec8)[_0xa2eb('0x1d')](function(_0x14a329){return _0x14a329;});}return null;};}function removeEntity(_0x15ee1e,_0x1a95f6){return function(_0x2d74f3){if(_0x2d74f3){return _0x2d74f3['destroy']()[_0xa2eb('0x1d')](function(){_0x15ee1e[_0xa2eb('0x14')](0xcc)[_0xa2eb('0x1e')]();});}};}function handleEntityNotFound(_0x15ca14,_0x1f66b8){return function(_0x2dc275){if(!_0x2dc275){_0x15ca14['sendStatus'](0x194);}return _0x2dc275;};}function handleError(_0x2f386c,_0x5a9f59){_0x5a9f59=_0x5a9f59||0x1f4;return function(_0x16ef8c){logger[_0xa2eb('0x1f')](_0x16ef8c[_0xa2eb('0x20')]);if(_0x16ef8c[_0xa2eb('0x21')]){delete _0x16ef8c[_0xa2eb('0x21')];}_0x2f386c['status'](_0x5a9f59)[_0xa2eb('0x22')](_0x16ef8c);};}exports[_0xa2eb('0x23')]=function(_0x21a785,_0x2dea48){var _0x2e6c00={},_0x245658={},_0x35fc83={'count':0x0,'rows':[]};var _0x5f201b=_['map'](db['WhatsappApplication'][_0xa2eb('0x24')],function(_0x2a4535){return{'name':_0x2a4535['fieldName'],'type':_0x2a4535[_0xa2eb('0x25')][_0xa2eb('0x26')]};});_0x245658['model']=_[_0xa2eb('0x27')](_0x5f201b,'name');_0x245658['query']=_[_0xa2eb('0x28')](_0x21a785['query']);_0x245658[_0xa2eb('0x29')]=_['intersection'](_0x245658['model'],_0x245658[_0xa2eb('0x2a')]);_0x2e6c00[_0xa2eb('0x2b')]=_[_0xa2eb('0x2c')](_0x245658[_0xa2eb('0x2d')],qs[_0xa2eb('0x2e')](_0x21a785[_0xa2eb('0x2a')][_0xa2eb('0x2e')]));_0x2e6c00[_0xa2eb('0x2b')]=_0x2e6c00[_0xa2eb('0x2b')]['length']?_0x2e6c00[_0xa2eb('0x2b')]:_0x245658[_0xa2eb('0x2d')];if(!_0x21a785[_0xa2eb('0x2a')][_0xa2eb('0x2f')](_0xa2eb('0x30'))){_0x2e6c00[_0xa2eb('0x18')]=qs[_0xa2eb('0x18')](_0x21a785[_0xa2eb('0x2a')][_0xa2eb('0x18')]);_0x2e6c00['offset']=qs[_0xa2eb('0x16')](_0x21a785[_0xa2eb('0x2a')]['offset']);}_0x2e6c00[_0xa2eb('0x31')]=qs[_0xa2eb('0x32')](_0x21a785[_0xa2eb('0x2a')][_0xa2eb('0x32')]);_0x2e6c00['where']=qs[_0xa2eb('0x29')](_[_0xa2eb('0x33')](_0x21a785[_0xa2eb('0x2a')],_0x245658[_0xa2eb('0x29')]),_0x5f201b);if(_0x21a785[_0xa2eb('0x2a')][_0xa2eb('0x34')]){_0x2e6c00[_0xa2eb('0x35')]=_[_0xa2eb('0x36')](_0x2e6c00[_0xa2eb('0x35')],{'$or':_[_0xa2eb('0x27')](_0x5f201b,function(_0x203406){if(_0x203406[_0xa2eb('0x25')]!==_0xa2eb('0x37')){var _0x24087b={};_0x24087b[_0x203406['name']]={'$like':'%'+_0x21a785['query']['filter']+'%'};return _0x24087b;}})});}_0x2e6c00=_[_0xa2eb('0x36')]({},_0x2e6c00,_0x21a785[_0xa2eb('0x38')]);var _0x88efee={'where':_0x2e6c00[_0xa2eb('0x35')]};return db[_0xa2eb('0x39')][_0xa2eb('0x19')](_0x88efee)['then'](function(_0x2108fa){_0x35fc83['count']=_0x2108fa;if(_0x21a785[_0xa2eb('0x2a')][_0xa2eb('0x3a')]){_0x2e6c00[_0xa2eb('0x3b')]=[{'all':!![]}];}return db[_0xa2eb('0x39')][_0xa2eb('0x3c')](_0x2e6c00);})['then'](function(_0xc3d571){_0x35fc83[_0xa2eb('0x3d')]=_0xc3d571;return _0x35fc83;})['then'](respondWithFilteredResult(_0x2dea48,_0x2e6c00))['catch'](handleError(_0x2dea48,null));};exports[_0xa2eb('0x3e')]=function(_0x347107,_0x18f4e8){var _0x4043d5={'raw':!![],'where':{'id':_0x347107['params']['id']}},_0x4e738e={};_0x4e738e[_0xa2eb('0x2d')]=_[_0xa2eb('0x28')](db['WhatsappApplication'][_0xa2eb('0x24')]);_0x4e738e['query']=_['keys'](_0x347107[_0xa2eb('0x2a')]);_0x4e738e[_0xa2eb('0x29')]=_[_0xa2eb('0x2c')](_0x4e738e[_0xa2eb('0x2d')],_0x4e738e['query']);_0x4043d5[_0xa2eb('0x2b')]=_['intersection'](_0x4e738e[_0xa2eb('0x2d')],qs[_0xa2eb('0x2e')](_0x347107[_0xa2eb('0x2a')][_0xa2eb('0x2e')]));_0x4043d5[_0xa2eb('0x2b')]=_0x4043d5[_0xa2eb('0x2b')][_0xa2eb('0x3f')]?_0x4043d5[_0xa2eb('0x2b')]:_0x4e738e['model'];if(_0x347107['query']['includeAll']){_0x4043d5['include']=[{'all':!![]}];}_0x4043d5=_['merge']({},_0x4043d5,_0x347107[_0xa2eb('0x38')]);return db[_0xa2eb('0x39')][_0xa2eb('0x40')](_0x4043d5)[_0xa2eb('0x1d')](handleEntityNotFound(_0x18f4e8,null))[_0xa2eb('0x1d')](respondWithResult(_0x18f4e8,null))[_0xa2eb('0x41')](handleError(_0x18f4e8,null));};exports[_0xa2eb('0x42')]=function(_0x17e076,_0x3b10f9){return db['WhatsappApplication']['create'](_0x17e076[_0xa2eb('0x43')],{})[_0xa2eb('0x1d')](respondWithResult(_0x3b10f9,0xc9))['catch'](handleError(_0x3b10f9,null));};exports[_0xa2eb('0x44')]=function(_0x18d8b5,_0x3eef82){if(_0x18d8b5[_0xa2eb('0x43')]['id']){delete _0x18d8b5['body']['id'];}return db[_0xa2eb('0x39')][_0xa2eb('0x40')]({'where':{'id':_0x18d8b5[_0xa2eb('0x45')]['id']}})[_0xa2eb('0x1d')](handleEntityNotFound(_0x3eef82,null))[_0xa2eb('0x1d')](saveUpdates(_0x18d8b5['body'],null))['then'](respondWithResult(_0x3eef82,null))[_0xa2eb('0x41')](handleError(_0x3eef82,null));};exports[_0xa2eb('0x46')]=function(_0x476c5f,_0x45a178){return db[_0xa2eb('0x39')][_0xa2eb('0x40')]({'where':{'id':_0x476c5f['params']['id']}})[_0xa2eb('0x1d')](handleEntityNotFound(_0x45a178,null))[_0xa2eb('0x1d')](removeEntity(_0x45a178,null))[_0xa2eb('0x41')](handleError(_0x45a178,null));};
\ No newline at end of file
+var _0xe1d7=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','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','limit','undefined','count','Content-Range','apply','then','destroy','error','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order'];(function(_0x46116f,_0x1b23bf){var _0x52f627=function(_0x18b5ac){while(--_0x18b5ac){_0x46116f['push'](_0x46116f['shift']());}};_0x52f627(++_0x1b23bf);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x5e6116,_0x4bae08){_0x5e6116=_0x5e6116-0x0;var _0x29bf86=_0xe1d7[_0x5e6116];return _0x29bf86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e1d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7e1d('0x1'));var BPromise=require(_0x7e1d('0x2'));var Mustache=require(_0x7e1d('0x3'));var util=require('util');var path=require(_0x7e1d('0x4'));var sox=require(_0x7e1d('0x5'));var csv=require(_0x7e1d('0x6'));var ejs=require(_0x7e1d('0x7'));var fs=require('fs');var fs_extra=require(_0x7e1d('0x8'));var _=require('lodash');var squel=require(_0x7e1d('0x9'));var crypto=require(_0x7e1d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7e1d('0xb'));var toCsv=require(_0x7e1d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7e1d('0xc'));var authService=require(_0x7e1d('0xd'));var qs=require(_0x7e1d('0xe'));var as=require(_0x7e1d('0xf'));var hardwareService=require(_0x7e1d('0x10'));var logger=require(_0x7e1d('0x11'))(_0x7e1d('0x12'));var utils=require('../../config/utils');var config=require(_0x7e1d('0x13'));var licenseUtil=require(_0x7e1d('0x14'));var db=require(_0x7e1d('0x15'))['db'];function respondWithStatusCode(_0x3a2fd3,_0x4af431){_0x4af431=_0x4af431||0xcc;return function(_0x4543ee){if(_0x4543ee){return _0x3a2fd3[_0x7e1d('0x16')](_0x4af431);}return _0x3a2fd3[_0x7e1d('0x17')](_0x4af431)['end']();};}function respondWithResult(_0x3c9812,_0x41746d){_0x41746d=_0x41746d||0xc8;return function(_0x5cafde){if(_0x5cafde){return _0x3c9812['status'](_0x41746d)[_0x7e1d('0x18')](_0x5cafde);}};}function respondWithFilteredResult(_0x3f4760,_0x1c8d51){return function(_0x55539a){if(_0x55539a){var _0x25f214=typeof _0x1c8d51[_0x7e1d('0x19')]==='undefined'&&typeof _0x1c8d51[_0x7e1d('0x1a')]===_0x7e1d('0x1b');var _0x3eb945=_0x55539a[_0x7e1d('0x1c')];var _0x5a9abe=_0x25f214?0x0:_0x1c8d51[_0x7e1d('0x19')];var _0x1b40ac=_0x25f214?_0x55539a[_0x7e1d('0x1c')]:_0x1c8d51[_0x7e1d('0x19')]+_0x1c8d51[_0x7e1d('0x1a')];var _0x3671d3;if(_0x1b40ac>=_0x3eb945){_0x1b40ac=_0x3eb945;_0x3671d3=0xc8;}else{_0x3671d3=0xce;}_0x3f4760[_0x7e1d('0x17')](_0x3671d3);return _0x3f4760['set'](_0x7e1d('0x1d'),_0x5a9abe+'-'+_0x1b40ac+'/'+_0x3eb945)[_0x7e1d('0x18')](_0x55539a);}return null;};}function patchUpdates(_0x1c2ab1){return function(_0x3d21ec){try{jsonpatch[_0x7e1d('0x1e')](_0x3d21ec,_0x1c2ab1,!![]);}catch(_0x5480fe){return BPromise['reject'](_0x5480fe);}return _0x3d21ec['save']();};}function saveUpdates(_0x383d28,_0x3dddc3){return function(_0x30229f){if(_0x30229f){return _0x30229f['update'](_0x383d28)[_0x7e1d('0x1f')](function(_0x56653f){return _0x56653f;});}return null;};}function removeEntity(_0xabef60,_0x1ae0b6){return function(_0xcc5980){if(_0xcc5980){return _0xcc5980[_0x7e1d('0x20')]()[_0x7e1d('0x1f')](function(){_0xabef60[_0x7e1d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fd926,_0x45473a){return function(_0x12ba7f){if(!_0x12ba7f){_0x1fd926[_0x7e1d('0x16')](0x194);}return _0x12ba7f;};}function handleError(_0x21fb23,_0x3ba80b){_0x3ba80b=_0x3ba80b||0x1f4;return function(_0x22569b){logger[_0x7e1d('0x21')](_0x22569b['stack']);if(_0x22569b[_0x7e1d('0x22')]){delete _0x22569b[_0x7e1d('0x22')];}_0x21fb23['status'](_0x3ba80b)[_0x7e1d('0x23')](_0x22569b);};}exports[_0x7e1d('0x24')]=function(_0x4ebce1,_0x1b5236){var _0x2f11f4={},_0x1b6ba2={},_0x430191={'count':0x0,'rows':[]};var _0x1a4c75=_[_0x7e1d('0x25')](db[_0x7e1d('0x26')][_0x7e1d('0x27')],function(_0x12ad82){return{'name':_0x12ad82[_0x7e1d('0x28')],'type':_0x12ad82['type'][_0x7e1d('0x29')]};});_0x1b6ba2[_0x7e1d('0x2a')]=_[_0x7e1d('0x25')](_0x1a4c75,_0x7e1d('0x22'));_0x1b6ba2[_0x7e1d('0x2b')]=_[_0x7e1d('0x2c')](_0x4ebce1[_0x7e1d('0x2b')]);_0x1b6ba2[_0x7e1d('0x2d')]=_[_0x7e1d('0x2e')](_0x1b6ba2['model'],_0x1b6ba2['query']);_0x2f11f4[_0x7e1d('0x2f')]=_[_0x7e1d('0x2e')](_0x1b6ba2[_0x7e1d('0x2a')],qs[_0x7e1d('0x30')](_0x4ebce1['query'][_0x7e1d('0x30')]));_0x2f11f4['attributes']=_0x2f11f4[_0x7e1d('0x2f')]['length']?_0x2f11f4[_0x7e1d('0x2f')]:_0x1b6ba2[_0x7e1d('0x2a')];if(!_0x4ebce1[_0x7e1d('0x2b')]['hasOwnProperty'](_0x7e1d('0x31'))){_0x2f11f4[_0x7e1d('0x1a')]=qs['limit'](_0x4ebce1['query']['limit']);_0x2f11f4[_0x7e1d('0x19')]=qs[_0x7e1d('0x19')](_0x4ebce1[_0x7e1d('0x2b')][_0x7e1d('0x19')]);}_0x2f11f4[_0x7e1d('0x32')]=qs['sort'](_0x4ebce1['query'][_0x7e1d('0x33')]);_0x2f11f4[_0x7e1d('0x34')]=qs['filters'](_[_0x7e1d('0x35')](_0x4ebce1[_0x7e1d('0x2b')],_0x1b6ba2[_0x7e1d('0x2d')]),_0x1a4c75);if(_0x4ebce1[_0x7e1d('0x2b')][_0x7e1d('0x36')]){_0x2f11f4['where']=_[_0x7e1d('0x37')](_0x2f11f4['where'],{'$or':_[_0x7e1d('0x25')](_0x1a4c75,function(_0x31f7ee){if(_0x31f7ee['type']!==_0x7e1d('0x38')){var _0x48e996={};_0x48e996[_0x31f7ee[_0x7e1d('0x22')]]={'$like':'%'+_0x4ebce1[_0x7e1d('0x2b')][_0x7e1d('0x36')]+'%'};return _0x48e996;}})});}_0x2f11f4=_[_0x7e1d('0x37')]({},_0x2f11f4,_0x4ebce1[_0x7e1d('0x39')]);var _0x226a10={'where':_0x2f11f4[_0x7e1d('0x34')]};return db['WhatsappApplication'][_0x7e1d('0x1c')](_0x226a10)[_0x7e1d('0x1f')](function(_0x2aeca9){_0x430191[_0x7e1d('0x1c')]=_0x2aeca9;if(_0x4ebce1[_0x7e1d('0x2b')][_0x7e1d('0x3a')]){_0x2f11f4[_0x7e1d('0x3b')]=[{'all':!![]}];}return db[_0x7e1d('0x26')][_0x7e1d('0x3c')](_0x2f11f4);})[_0x7e1d('0x1f')](function(_0x5dd3f6){_0x430191[_0x7e1d('0x3d')]=_0x5dd3f6;return _0x430191;})[_0x7e1d('0x1f')](respondWithFilteredResult(_0x1b5236,_0x2f11f4))[_0x7e1d('0x3e')](handleError(_0x1b5236,null));};exports[_0x7e1d('0x3f')]=function(_0x189302,_0x224081){var _0x27e64a={'raw':!![],'where':{'id':_0x189302['params']['id']}},_0x5959={};_0x5959[_0x7e1d('0x2a')]=_[_0x7e1d('0x2c')](db[_0x7e1d('0x26')][_0x7e1d('0x27')]);_0x5959[_0x7e1d('0x2b')]=_['keys'](_0x189302[_0x7e1d('0x2b')]);_0x5959[_0x7e1d('0x2d')]=_[_0x7e1d('0x2e')](_0x5959['model'],_0x5959['query']);_0x27e64a[_0x7e1d('0x2f')]=_['intersection'](_0x5959[_0x7e1d('0x2a')],qs[_0x7e1d('0x30')](_0x189302['query'][_0x7e1d('0x30')]));_0x27e64a[_0x7e1d('0x2f')]=_0x27e64a[_0x7e1d('0x2f')]['length']?_0x27e64a[_0x7e1d('0x2f')]:_0x5959['model'];if(_0x189302[_0x7e1d('0x2b')][_0x7e1d('0x3a')]){_0x27e64a[_0x7e1d('0x3b')]=[{'all':!![]}];}_0x27e64a=_[_0x7e1d('0x37')]({},_0x27e64a,_0x189302[_0x7e1d('0x39')]);return db['WhatsappApplication'][_0x7e1d('0x40')](_0x27e64a)[_0x7e1d('0x1f')](handleEntityNotFound(_0x224081,null))['then'](respondWithResult(_0x224081,null))[_0x7e1d('0x3e')](handleError(_0x224081,null));};exports[_0x7e1d('0x41')]=function(_0x1a68ac,_0x47d273){return db['WhatsappApplication'][_0x7e1d('0x41')](_0x1a68ac[_0x7e1d('0x42')],{})[_0x7e1d('0x1f')](respondWithResult(_0x47d273,0xc9))[_0x7e1d('0x3e')](handleError(_0x47d273,null));};exports['update']=function(_0x395b11,_0x2a107a){if(_0x395b11[_0x7e1d('0x42')]['id']){delete _0x395b11['body']['id'];}return db[_0x7e1d('0x26')][_0x7e1d('0x40')]({'where':{'id':_0x395b11['params']['id']}})[_0x7e1d('0x1f')](handleEntityNotFound(_0x2a107a,null))[_0x7e1d('0x1f')](saveUpdates(_0x395b11[_0x7e1d('0x42')],null))[_0x7e1d('0x1f')](respondWithResult(_0x2a107a,null))['catch'](handleError(_0x2a107a,null));};exports['destroy']=function(_0x4178fa,_0x1db7e8){return db[_0x7e1d('0x26')]['find']({'where':{'id':_0x4178fa[_0x7e1d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1db7e8,null))['then'](removeEntity(_0x1db7e8,null))[_0x7e1d('0x3e')](handleError(_0x1db7e8,null));};
\ No newline at end of file
index 58617ef..04272f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x861c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x3e3e12,_0x1baf63){var _0x8f1b6c=function(_0x36d4e6){while(--_0x36d4e6){_0x3e3e12['push'](_0x3e3e12['shift']());}};_0x8f1b6c(++_0x1baf63);}(_0x861c,0xdb));var _0xc861=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x861c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var logger=require(_0xc861('0x2'))(_0xc861('0x3'));var moment=require(_0xc861('0x4'));var BPromise=require(_0xc861('0x5'));var rp=require(_0xc861('0x6'));var fs=require('fs');var path=require(_0xc861('0x7'));var rimraf=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var attributes=require(_0xc861('0xa'));module[_0xc861('0xb')]=function(_0x562f12,_0xc3b5fd){return _0x562f12[_0xc861('0xc')](_0xc861('0xd'),attributes,{'tableName':_0xc861('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc861('0xf'),'collate':_0xc861('0x10')});};
\ No newline at end of file
+var _0xed95=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0xed95,0xb9));var _0x5ed9=function(_0x18f201,_0x553c59){_0x18f201=_0x18f201-0x0;var _0x32e61d=_0xed95[_0x18f201];return _0x32e61d;};'use strict';var _=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var logger=require(_0x5ed9('0x2'))(_0x5ed9('0x3'));var moment=require(_0x5ed9('0x4'));var BPromise=require(_0x5ed9('0x5'));var rp=require(_0x5ed9('0x6'));var fs=require('fs');var path=require(_0x5ed9('0x7'));var rimraf=require(_0x5ed9('0x8'));var config=require(_0x5ed9('0x9'));var attributes=require(_0x5ed9('0xa'));module[_0x5ed9('0xb')]=function(_0x52a57d,_0x48efa8){return _0x52a57d[_0x5ed9('0xc')](_0x5ed9('0xd'),attributes,{'tableName':_0x5ed9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ed9('0xf'),'collate':_0x5ed9('0x10')});};
\ No newline at end of file
index 4e53219..2f067d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e9=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0x99e9,0xb4));var _0x999e=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x99e9[_0x324fe8];return _0x4a1cd9;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});}
\ No newline at end of file
+var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','WhatsappApplication,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x567df6,_0x2f9650){var _0x107c10=function(_0x582502){while(--_0x582502){_0x567df6['push'](_0x567df6['shift']());}};_0x107c10(++_0x2f9650);}(_0x3e74,0x175));var _0x43e7=function(_0xe54437,_0x32a556){_0xe54437=_0xe54437-0x0;var _0x4251f2=_0x3e74[_0xe54437];return _0x4251f2;};'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']('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}
\ No newline at end of file
index 9f9905e..20997ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90b5=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x2b0d0e,_0x315d5f){var _0x4a028c=function(_0x4442a6){while(--_0x4442a6){_0x2b0d0e['push'](_0x2b0d0e['shift']());}};_0x4a028c(++_0x315d5f);}(_0x90b5,0x139));var _0x590b=function(_0x4bf0de,_0x5d04c0){_0x4bf0de=_0x4bf0de-0x0;var _0xb77cf9=_0x90b5[_0x4bf0de];return _0xb77cf9;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./whatsappInteraction.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0x7')](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0x7')](_0x590b('0xe'),auth['isAuthenticated'](),controller[_0x590b('0xf')]);router[_0x590b('0x7')]('/:id/download',auth[_0x590b('0x8')](),controller['download']);router[_0x590b('0x10')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x11')]);router[_0x590b('0x10')]('/:id/messages',auth[_0x590b('0x8')](),controller[_0x590b('0x12')]);router[_0x590b('0x10')](_0x590b('0x13'),auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),_0x590b('0x16')),controller[_0x590b('0x17')]);router[_0x590b('0x18')](_0x590b('0xc'),auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),_0x590b('0x19')),controller['update']);router[_0x590b('0x1a')]('/:id',auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x590b('0x1a')]('/:id/tags',auth[_0x590b('0x8')](),controller[_0x590b('0x1b')]);module[_0x590b('0x1c')]=router;
\ No newline at end of file
+var _0x0689=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags'];(function(_0x10e5b6,_0x532f06){var _0x15d153=function(_0x33a2c0){while(--_0x33a2c0){_0x10e5b6['push'](_0x10e5b6['shift']());}};_0x15d153(++_0x532f06);}(_0x0689,0x161));var _0x9068=function(_0x5103a4,_0x4b7f5c){_0x5103a4=_0x5103a4-0x0;var _0x4f99e0=_0x0689[_0x5103a4];return _0x4f99e0;};'use strict';var multer=require('multer');var util=require(_0x9068('0x0'));var path=require('path');var timeout=require(_0x9068('0x1'));var express=require(_0x9068('0x2'));var router=express[_0x9068('0x3')]();var fs_extra=require(_0x9068('0x4'));var auth=require(_0x9068('0x5'));var interaction=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var controller=require(_0x9068('0x8'));router[_0x9068('0x9')]('/',auth[_0x9068('0xa')](),controller['index']);router[_0x9068('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9068('0xb')]);router[_0x9068('0x9')](_0x9068('0xc'),auth[_0x9068('0xa')](),controller[_0x9068('0xd')]);router[_0x9068('0x9')](_0x9068('0xe'),auth[_0x9068('0xa')](),controller[_0x9068('0xf')]);router['get'](_0x9068('0x10'),auth[_0x9068('0xa')](),controller[_0x9068('0x11')]);router[_0x9068('0x12')]('/',auth['isAuthenticated'](),controller[_0x9068('0x13')]);router[_0x9068('0x12')](_0x9068('0xe'),auth['isAuthenticated'](),controller[_0x9068('0x14')]);router[_0x9068('0x12')](_0x9068('0x15'),auth['isAuthenticated'](),interaction[_0x9068('0x16')](_0x9068('0x17'),'whatsappinteraction:addtags'),controller[_0x9068('0x18')]);router[_0x9068('0x19')]('/:id',auth[_0x9068('0xa')](),interaction[_0x9068('0x16')](_0x9068('0x17'),_0x9068('0x1a')),controller['update']);router[_0x9068('0x1b')](_0x9068('0xc'),auth[_0x9068('0xa')](),interaction[_0x9068('0x16')](_0x9068('0x17'),_0x9068('0x1c')),controller[_0x9068('0x1d')]);router[_0x9068('0x1b')](_0x9068('0x15'),auth['isAuthenticated'](),controller[_0x9068('0x1e')]);module[_0x9068('0x1f')]=router;
\ No newline at end of file
index d4d9d7d..9425658 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['moment','exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x21cf81,_0x416845){var _0x34be20=function(_0x1279a6){while(--_0x1279a6){_0x21cf81['push'](_0x21cf81['shift']());}};_0x34be20(++_0x416845);}(_0xf494,0x1c6));var _0x4f49=function(_0xf28a76,_0x2bb5b1){_0xf28a76=_0xf28a76-0x0;var _0x4354a5=_0xf494[_0xf28a76];return _0x4354a5;};'use strict';var Sequelize=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));module[_0x4f49('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4f49('0x3')]},'disposition':{'type':Sequelize[_0x4f49('0x4')]},'secondDisposition':{'type':Sequelize[_0x4f49('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4f49('0x4')]},'note':{'type':Sequelize[_0x4f49('0x4')]},'phone':{'type':Sequelize[_0x4f49('0x4')]},'read1stAt':{'type':Sequelize[_0x4f49('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4f49('0x5')]('in',_0x4f49('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4f49('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4f49('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x806b=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x5a19b9,_0x3bc9af){var _0x56abbc=function(_0x1f6643){while(--_0x1f6643){_0x5a19b9['push'](_0x5a19b9['shift']());}};_0x56abbc(++_0x3bc9af);}(_0x806b,0x163));var _0xb806=function(_0x2ff8ee,_0x5c0f64){_0x2ff8ee=_0x2ff8ee-0x0;var _0x1fd634=_0x806b[_0x2ff8ee];return _0x1fd634;};'use strict';var Sequelize=require(_0xb806('0x0'));var moment=require(_0xb806('0x1'));module[_0xb806('0x2')]={'closed':{'type':Sequelize[_0xb806('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb806('0x4')]},'disposition':{'type':Sequelize[_0xb806('0x5')]},'secondDisposition':{'type':Sequelize[_0xb806('0x5')]},'thirdDisposition':{'type':Sequelize[_0xb806('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb806('0x5')]},'read1stAt':{'type':Sequelize[_0xb806('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb806('0x6')]('in',_0xb806('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb806('0x6')]('in',_0xb806('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 590a9c4..cec13f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb088=['body','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','clone','i.id','contactName','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','WhatsappInteractionId','all','rows','show','includeAll','include','create','params','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','sort','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','direction','secret','WhatsappAccount','Account','mkdirSync','Whatsapp','Owner','N.A.','closed','closedAt','basename','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','Tags','TagIds','split','forEach','push','catch','index','map','WhatsappInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','select','field','color','tools_tags','ui.WhatsappInteractionId','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','value','start','Tag','union','User','$substring','UserId'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0xb088,0x7b));var _0x8b08=function(_0x17c6e0,_0x587421){_0x17c6e0=_0x17c6e0-0x0;var _0x27e9a1=_0xb088[_0x17c6e0];return _0x27e9a1;};'use strict';var emlformat=require(_0x8b08('0x0'));var rimraf=require(_0x8b08('0x1'));var zipdir=require(_0x8b08('0x2'));var jsonpatch=require(_0x8b08('0x3'));var rp=require(_0x8b08('0x4'));var moment=require('moment');var BPromise=require(_0x8b08('0x5'));var Mustache=require('mustache');var util=require(_0x8b08('0x6'));var path=require(_0x8b08('0x7'));var sox=require(_0x8b08('0x8'));var csv=require(_0x8b08('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b08('0xa'));var _=require(_0x8b08('0xb'));var squel=require(_0x8b08('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b08('0xd'));var deskjs=require(_0x8b08('0xe'));var toCsv=require(_0x8b08('0x9'));var querystring=require(_0x8b08('0xf'));var Papa=require(_0x8b08('0x10'));var Redis=require(_0x8b08('0x11'));var authService=require(_0x8b08('0x12'));var qs=require(_0x8b08('0x13'));var as=require(_0x8b08('0x14'));var pdf=require(_0x8b08('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b08('0x16'))(_0x8b08('0x17'));var utils=require(_0x8b08('0x18'));var config=require(_0x8b08('0x19'));var licenseUtil=require(_0x8b08('0x1a'));var db=require(_0x8b08('0x1b'))['db'];config[_0x8b08('0x1c')]=_[_0x8b08('0x1d')](config[_0x8b08('0x1c')],{'host':_0x8b08('0x1e'),'port':0x18eb});var socket=require(_0x8b08('0x1f'))(new Redis(config['redis']));require(_0x8b08('0x20'))['register'](socket);function respondWithStatusCode(_0x538287,_0x4dc09a){_0x4dc09a=_0x4dc09a||0xcc;return function(_0x5ef3a6){if(_0x5ef3a6){return _0x538287[_0x8b08('0x21')](_0x4dc09a);}return _0x538287['status'](_0x4dc09a)[_0x8b08('0x22')]();};}function respondWithResult(_0x522caf,_0x5668dd){_0x5668dd=_0x5668dd||0xc8;return function(_0x1d6499){if(_0x1d6499){return _0x522caf['status'](_0x5668dd)[_0x8b08('0x23')](_0x1d6499);}};}function respondWithFilteredResult(_0x3744f8,_0x3812a5){return function(_0x16ebb3){if(_0x16ebb3){var _0x5b0351=typeof _0x3812a5[_0x8b08('0x24')]===_0x8b08('0x25')&&typeof _0x3812a5['limit']===_0x8b08('0x25');var _0x5c5413=_0x16ebb3[_0x8b08('0x26')];var _0x2ec1d1=_0x5b0351?0x0:_0x3812a5[_0x8b08('0x24')];var _0x379428=_0x5b0351?_0x16ebb3[_0x8b08('0x26')]:_0x3812a5[_0x8b08('0x24')]+_0x3812a5[_0x8b08('0x27')];var _0x46ef4c;if(_0x379428>=_0x5c5413){_0x379428=_0x5c5413;_0x46ef4c=0xc8;}else{_0x46ef4c=0xce;}_0x3744f8[_0x8b08('0x28')](_0x46ef4c);return _0x3744f8[_0x8b08('0x29')](_0x8b08('0x2a'),_0x2ec1d1+'-'+_0x379428+'/'+_0x5c5413)[_0x8b08('0x23')](_0x16ebb3);}return null;};}function patchUpdates(_0x2a77d4){return function(_0x2e2dea){try{jsonpatch[_0x8b08('0x2b')](_0x2e2dea,_0x2a77d4,!![]);}catch(_0x4bca5e){return BPromise[_0x8b08('0x2c')](_0x4bca5e);}return _0x2e2dea[_0x8b08('0x2d')]();};}function saveUpdates(_0x1e59ab,_0x3b040f){return function(_0x5165b8){if(_0x5165b8){return _0x5165b8[_0x8b08('0x2e')](_0x1e59ab)[_0x8b08('0x2f')](function(_0x582c6c){return _0x582c6c;});}return null;};}function removeEntity(_0x2ceae8,_0x2ec6fe){return function(_0x1832a4){if(_0x1832a4){return _0x1832a4[_0x8b08('0x30')]()['then'](function(){_0x2ceae8[_0x8b08('0x28')](0xcc)[_0x8b08('0x22')]();});}};}function handleEntityNotFound(_0xf02e04,_0x4f2c36){return function(_0x32b00e){if(!_0x32b00e){_0xf02e04['sendStatus'](0x194);}return _0x32b00e;};}function handleError(_0xe50e73,_0x3fd67a){_0x3fd67a=_0x3fd67a||0x1f4;return function(_0x6738ab){logger[_0x8b08('0x31')](_0x6738ab[_0x8b08('0x32')]);if(_0x6738ab[_0x8b08('0x33')]){delete _0x6738ab[_0x8b08('0x33')];}_0xe50e73[_0x8b08('0x28')](_0x3fd67a)[_0x8b08('0x34')](_0x6738ab);};}function getInteractionUsers(_0x37f593,_0x15a209){return new BPromise(function(_0x5c88b8,_0x3ead3c){try{if(_0x15a209[_0x37f593['id']]){_0x37f593[_0x8b08('0x35')]=_['map'](_0x15a209[_0x37f593['id']],function(_0x3b9434){return{'id':_0x3b9434['id'],'fullname':_0x3b9434['fullname']};});}}catch(_0x17789e){_0x3ead3c(_0x17789e);}_0x5c88b8(_0x37f593);});}function getInteractionTags(_0xa84c05,_0x2f3e45){return new BPromise(function(_0x11bf4f,_0x376acb){try{if(_0xa84c05['TagIds']){_0xa84c05[_0x8b08('0x36')]=[];_0xa84c05[_0x8b08('0x37')][_0x8b08('0x38')](',')[_0x8b08('0x39')](function(_0x996624){_0xa84c05['Tags'][_0x8b08('0x3a')](_0x2f3e45[_0x996624]);});}delete _0xa84c05[_0x8b08('0x37')];}catch(_0x56be6a){_0x376acb(_0x56be6a);}_0x11bf4f(_0xa84c05);});}function updateWhatsappInteraction(_0x4d9f30,_0x5da4ce,_0x4fa96c){return new BPromise(function(_0x14da46,_0xff57a9){return getInteractionUsers(_0x4d9f30,_0x4fa96c)['then'](function(_0x32f006){return getInteractionTags(_0x32f006,_0x5da4ce);})[_0x8b08('0x2f')](function(_0x2db54b){_0x14da46(_0x2db54b);})[_0x8b08('0x3b')](function(_0x51552b){_0xff57a9(_0x51552b);});});}exports[_0x8b08('0x3c')]=function(_0x50fd64,_0x36c45c){var _0x51b474={},_0x2f84f0={},_0x59bde1={'count':0x0,'rows':[]};var _0x4f55f2=_[_0x8b08('0x3d')](db[_0x8b08('0x3e')]['rawAttributes'],function(_0x52eb8b){return{'name':_0x52eb8b[_0x8b08('0x3f')],'type':_0x52eb8b['type'][_0x8b08('0x40')]};});_0x2f84f0[_0x8b08('0x41')]=_[_0x8b08('0x3d')](_0x4f55f2,'name');_0x2f84f0[_0x8b08('0x42')]=_[_0x8b08('0x43')](_0x50fd64[_0x8b08('0x42')]);_0x2f84f0['filters']=_[_0x8b08('0x44')](_0x2f84f0[_0x8b08('0x41')],_0x2f84f0[_0x8b08('0x42')]);_0x51b474[_0x8b08('0x45')]=_[_0x8b08('0x44')](_0x2f84f0[_0x8b08('0x41')],qs[_0x8b08('0x46')](_0x50fd64[_0x8b08('0x42')][_0x8b08('0x46')]));_0x51b474['attributes']=_0x51b474[_0x8b08('0x45')][_0x8b08('0x47')]?_0x51b474[_0x8b08('0x45')]:_0x2f84f0['model'];if(!_0x50fd64[_0x8b08('0x42')][_0x8b08('0x48')](_0x8b08('0x49'))){_0x51b474['limit']=qs[_0x8b08('0x27')](_0x50fd64['query']['limit']);_0x51b474[_0x8b08('0x24')]=qs[_0x8b08('0x24')](_0x50fd64[_0x8b08('0x42')][_0x8b08('0x24')]);}_0x51b474[_0x8b08('0x4a')]=qs['sort'](_0x50fd64['query']['sort']);_0x51b474[_0x8b08('0x4b')]=qs[_0x8b08('0x4c')](_[_0x8b08('0x4d')](_0x50fd64[_0x8b08('0x42')],_0x2f84f0[_0x8b08('0x4c')]),_0x4f55f2);var _0x20cef2=[];var _0x4185f9=squel[_0x8b08('0x4e')]()[_0x8b08('0x4f')]('id')[_0x8b08('0x4f')](_0x8b08('0x33'))[_0x8b08('0x4f')](_0x8b08('0x50'))['from'](_0x8b08('0x51'));var _0x1e8fe7=squel['select']()['field']('u.id')[_0x8b08('0x4f')]('u.fullname')['field'](_0x8b08('0x52'))[_0x8b08('0x53')](_0x8b08('0x54'),'ui')[_0x8b08('0x55')](_0x8b08('0x56'),'u',_0x8b08('0x57'));var _0x671306=squel[_0x8b08('0x4e')]()[_0x8b08('0x53')](_0x8b08('0x58'),'i')[_0x8b08('0x55')]('cm_contacts','c',_0x8b08('0x59'))['left_join'](_0x8b08('0x56'),'o',_0x8b08('0x5a'))[_0x8b08('0x55')](_0x8b08('0x5b'),'a',_0x8b08('0x5c'))[_0x8b08('0x55')](_0x8b08('0x5d'),'me',_0x8b08('0x5e'))[_0x8b08('0x55')](_0x8b08('0x5f'),'it',_0x8b08('0x60'))[_0x8b08('0x55')]('tools_tags','t',_0x8b08('0x61'));var _0x9f94f5=squel['expr']();var _0x338e3f=[];var _0x3a44eb=squel[_0x8b08('0x62')]();var _0x53e77b;if(_0x50fd64[_0x8b08('0x42')][_0x8b08('0x63')]){_0x53e77b=as['parseSearch'](_0x50fd64[_0x8b08('0x42')][_0x8b08('0x63')]);var _0x24e153=_0x53e77b[_0x8b08('0x64')];for(var _0x3de0d5=0x0;_0x3de0d5<_0x53e77b[_0x8b08('0x65')]['length'];_0x3de0d5++){var _0x2462bf=_0x53e77b['conditions'][_0x3de0d5];var _0x58242b='i';var _0x767a67=_[_0x8b08('0x66')](_0x4f55f2,[_0x8b08('0x33'),_0x2462bf['field']]);if(!_0x767a67){switch(_0x2462bf[_0x8b08('0x4f')]){case _0x8b08('0x67'):if(_0x2462bf['value']==0x1){_0x671306[_0x8b08('0x68')]('`'+_0x2462bf[_0x8b08('0x4f')]+_0x8b08('0x69'));}else{_0x671306[_0x8b08('0x68')]('`'+_0x2462bf[_0x8b08('0x4f')]+'`\x20>\x200');}break;case _0x8b08('0x6a'):if(_0x2462bf[_0x8b08('0x6b')]==='$substring'){if(_0x2462bf['value'][_0x8b08('0x38')]('\x20')['length']>0x1){_0x9f94f5[_0x24e153]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8b08('0x6c')](_0x2462bf['value']),null);}else{var _0x5763da='%'+_0x2462bf['value']+'%';_0x9f94f5[_0x24e153](_0x8b08('0x6d'),_0x5763da,_0x5763da,_0x5763da);}}else{_0x767a67=_[_0x8b08('0x66')](_0x4f55f2,['name','ContactId']);_0x2462bf[_0x8b08('0x4f')]=_0x8b08('0x6e');_0x1d0db2=as[_0x8b08('0x6f')](_0x58242b,_0x767a67[_0x8b08('0x70')],_0x2462bf);_0x9f94f5[_0x24e153](_0x1d0db2[_0x8b08('0x71')],_0x1d0db2[_0x8b08('0x72')][_0x8b08('0x73')],_0x1d0db2[_0x8b08('0x72')][_0x8b08('0x22')]);}break;case _0x8b08('0x74'):var _0x4a94f4=_0x2462bf[_0x8b08('0x72')]['split'](',')[_0x8b08('0x3d')](function(_0x16abcf){return Number(_0x16abcf);});_0x4a94f4['forEach'](function(_0x68380b){_0x3a44eb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x68380b+',%');});_0x338e3f=_[_0x8b08('0x75')](_0x338e3f,_0x4a94f4);break;case _0x8b08('0x76'):if(_0x2462bf[_0x8b08('0x6b')]===_0x8b08('0x77')){_0x9f94f5[_0x24e153]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2462bf['value']+'%',null);}else{_0x767a67=_[_0x8b08('0x66')](_0x4f55f2,[_0x8b08('0x33'),_0x8b08('0x78')]);_0x2462bf['field']='UserId';_0x1d0db2=as['buildExpression'](_0x58242b,_0x767a67[_0x8b08('0x70')],_0x2462bf);_0x9f94f5[_0x24e153](_0x1d0db2[_0x8b08('0x71')],_0x1d0db2[_0x8b08('0x72')][_0x8b08('0x73')],_0x1d0db2['value'][_0x8b08('0x22')]);}break;case _0x8b08('0x79'):_0x1d0db2=as[_0x8b08('0x6f')]('me',null,_0x2462bf);_0x9f94f5[_0x24e153](_0x1d0db2['text'],_0x1d0db2[_0x8b08('0x72')][_0x8b08('0x73')],_0x1d0db2[_0x8b08('0x72')][_0x8b08('0x22')]);break;}}else{var _0x1d0db2=as[_0x8b08('0x6f')](_0x58242b,_0x767a67['type'],_0x2462bf);_0x9f94f5[_0x24e153](_0x1d0db2['text'],_0x1d0db2[_0x8b08('0x72')][_0x8b08('0x73')],_0x1d0db2[_0x8b08('0x72')][_0x8b08('0x22')]);}}}else{var _0x414d91=_(_0x50fd64['query'])[_0x8b08('0x43')]()[_0x8b08('0x3d')](function(_0x430206){return _[_0x8b08('0x7a')](_0x4f55f2,['name',_0x430206])?_0x430206:undefined;})['compact']()[_0x8b08('0x72')]();if(!_[_0x8b08('0x7b')](_0x414d91)){_0x414d91[_0x8b08('0x39')](function(_0x288d1f){if(_0x288d1f===_0x8b08('0x7c')){_0x671306[_0x8b08('0x4b')](_0x8b08('0x7d'),[][_0x8b08('0x7e')](_0x50fd64[_0x8b08('0x42')][_0x288d1f]));}else if(_0x288d1f===_0x8b08('0x7f')){var _0x63fdb0=JSON[_0x8b08('0x80')](_0x50fd64[_0x8b08('0x42')][_0x288d1f])['$gte'];var _0x20c0a0=JSON['parse'](_0x50fd64[_0x8b08('0x42')][_0x288d1f])[_0x8b08('0x81')];_0x671306[_0x8b08('0x4b')](_0x8b08('0x82'),_0x63fdb0,_0x20c0a0);}else{if(_0x50fd64[_0x8b08('0x42')][_0x288d1f]===_0x8b08('0x83')){_0x671306[_0x8b08('0x4b')]('i.'+_0x288d1f+'\x20IS\x20NULL');}else{_0x671306[_0x8b08('0x4b')]('i.'+_0x288d1f+_0x8b08('0x84'),_0x50fd64[_0x8b08('0x42')][_0x288d1f]);}}});}if(_0x50fd64[_0x8b08('0x42')][_0x8b08('0x85')]){if(_0x50fd64[_0x8b08('0x42')][_0x8b08('0x85')]==0x1){_0x671306['having'](_0x8b08('0x86'));}else{_0x671306['having'](_0x8b08('0x87'));}}if(_0x50fd64[_0x8b08('0x42')][_0x8b08('0x88')]){_0x338e3f=_['isArray'](_0x50fd64['query'][_0x8b08('0x88')])?_0x50fd64[_0x8b08('0x42')][_0x8b08('0x88')]:new Array(_0x50fd64[_0x8b08('0x42')][_0x8b08('0x88')]);_0x338e3f[_0x8b08('0x39')](function(_0x2443b0){_0x3a44eb['or'](_0x8b08('0x89'),'%,'+_0x2443b0+',%');});}if(_0x50fd64['query'][_0x8b08('0x8a')]){var _0x5c40a6=_0x50fd64[_0x8b08('0x42')][_0x8b08('0x8a')][_0x8b08('0x8b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8b08('0x8c')](_0x5c40a6)){_0x9f94f5['or'](_0x8b08('0x8d'),_0x5c40a6+'%')['or'](_0x8b08('0x8e'),_0x5c40a6+'%');}else{_0x9f94f5['or'](_0x8b08('0x8f'),qs[_0x8b08('0x6c')](_0x5c40a6))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5c40a6+'%');}}}_0x671306[_0x8b08('0x4b')](_0x9f94f5);_0x671306['group']('i.id');var _0x5eb4a6={'type':db[_0x8b08('0x90')][_0x8b08('0x91')][_0x8b08('0x92')],'raw':!![]};var _0x1e6def=_0x671306[_0x8b08('0x93')]();_0x1e6def['field'](_0x8b08('0x94'));_0x1e6def['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8b08('0x67'));if(_0x51b474[_0x8b08('0x4a')]){_0x51b474['order']['forEach'](function(_0xc8bc13){var _0x3f81ed=_0xc8bc13[0x0]===_0x8b08('0x95')?_0xc8bc13[0x0]:'i.'+_0xc8bc13[0x0];_0x671306[_0x8b08('0x4a')](_0x3f81ed,_0xc8bc13[0x1]==='DESC'?![]:!![]);});}if(!_[_0x8b08('0x7b')](_0x338e3f)){_0x671306['having'](_0x3a44eb);_0x1e6def['where']('t.id\x20IN\x20?',_0x338e3f);}BPromise[_0x8b08('0x96')]()[_0x8b08('0x2f')](function(){if(!_0x53e77b){if(_0x50fd64[_0x8b08('0x42')][_0x8b08('0x7c')])return;_0x1e6def['where'](_0x8b08('0x97'));_0x671306[_0x8b08('0x4b')](_0x8b08('0x97'));return;}if(_0x50fd64[_0x8b08('0x98')][_0x8b08('0x99')]!==_0x8b08('0x9a'))return;return _0x50fd64['user'][_0x8b08('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4f721e){if(_['isEmpty'](_0x4f721e)){_0x1e6def[_0x8b08('0x4b')](_0x8b08('0x9c'));_0x671306['where'](_0x8b08('0x9c'));}else{_0x1e6def[_0x8b08('0x4b')](_0x8b08('0x7d'),_[_0x8b08('0x3d')](_0x4f721e,'id'));_0x671306[_0x8b08('0x4b')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x4f721e,'id'));}});})['then'](function(){if(_0x50fd64['user'][_0x8b08('0x99')]===_0x8b08('0x9a')&&!_0x53e77b&&!_0x50fd64[_0x8b08('0x42')][_0x8b08('0x7c')])return[];return db[_0x8b08('0x9d')][_0x8b08('0x42')](_0x1e6def[_0x8b08('0x9e')](),_0x5eb4a6);})[_0x8b08('0x2f')](function(_0x2581ab){_0x59bde1[_0x8b08('0x26')]=_0x2581ab[_0x8b08('0x47')];if(_0x59bde1[_0x8b08('0x26')]===0x0)return[];return db[_0x8b08('0x9d')]['query'](_0x4185f9[_0x8b08('0x9e')](),_0x5eb4a6)[_0x8b08('0x2f')](function(_0xb50418){_0x20cef2=_[_0x8b08('0x9f')](_0xb50418,'id');_0x5eb4a6=_[_0x8b08('0xa0')](_0x5eb4a6,{'model':db[_0x8b08('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50fd64[_0x8b08('0x42')][_0x8b08('0x46')]){_0x51b474[_0x8b08('0x45')][_0x8b08('0x39')](function(_0x29cbb3){_0x671306[_0x8b08('0x4f')]('i.'+_0x29cbb3);});}else{_0x671306[_0x8b08('0x4f')](_0x8b08('0xa1'),_0x8b08('0x67'));_0x671306[_0x8b08('0x4f')](_0x8b08('0xa2'),_0x8b08('0xa3'));_0x671306['field'](_0x8b08('0xa4'),_0x8b08('0xa5'));_0x671306[_0x8b08('0x4f')]('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',_0x8b08('0x95'));_0x671306[_0x8b08('0x4f')](_0x8b08('0xa6'));_0x671306['field']('c.firstName','Contact.firstName');_0x671306[_0x8b08('0x4f')](_0x8b08('0xa7'),_0x8b08('0xa8'));_0x671306[_0x8b08('0x4f')](_0x8b08('0xa9'),_0x8b08('0xaa'));_0x671306[_0x8b08('0x4f')](_0x8b08('0xab'),_0x8b08('0xac'));_0x671306[_0x8b08('0x4f')](_0x8b08('0xad'),_0x8b08('0xae'));_0x671306[_0x8b08('0x4f')](_0x8b08('0xaf'),_0x8b08('0xb0'));_0x671306[_0x8b08('0x4f')]('o.fullname',_0x8b08('0xb1'));_0x671306['field'](_0x8b08('0xb2'),_0x8b08('0xb3'));_0x671306[_0x8b08('0x4f')](_0x8b08('0xb4'),_0x8b08('0x37'));}if(_0x51b474[_0x8b08('0x27')])_0x671306[_0x8b08('0x27')](_0x51b474[_0x8b08('0x27')]);if(_0x51b474[_0x8b08('0x24')])_0x671306[_0x8b08('0x24')](_0x51b474[_0x8b08('0x24')]);return db[_0x8b08('0x9d')][_0x8b08('0x42')](_0x671306[_0x8b08('0x9e')](),_0x5eb4a6);})[_0x8b08('0x2f')](function(_0x225c00){if(_0x225c00['length']>0x0)_0x1e8fe7[_0x8b08('0x4b')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x8b08('0x3d')](_0x225c00,'id'));return db[_0x8b08('0x9d')]['query'](_0x1e8fe7[_0x8b08('0x9e')](),_0x5eb4a6)['then'](function(_0x94e410){var _0x3837e5=_['groupBy'](_0x94e410,_0x8b08('0xb5'));var _0x31b983=[];_0x225c00[_0x8b08('0x39')](function(_0x6f4219){_0x31b983[_0x8b08('0x3a')](updateWhatsappInteraction(_0x6f4219,_0x20cef2,_0x3837e5));});return BPromise[_0x8b08('0xb6')](_0x31b983);});});})[_0x8b08('0x2f')](function(_0x218d66){_0x59bde1[_0x8b08('0xb7')]=_0x218d66;return _0x59bde1;})[_0x8b08('0x2f')](respondWithFilteredResult(_0x36c45c,_0x51b474))['catch'](handleError(_0x36c45c,null));};exports[_0x8b08('0xb8')]=function(_0xc8b63a,_0x3ce12f){var _0x41d3fc={'raw':![],'where':{'id':_0xc8b63a['params']['id']}},_0x45bdf4={};_0x45bdf4['model']=_[_0x8b08('0x43')](db['WhatsappInteraction']['rawAttributes']);_0x45bdf4['query']=_['keys'](_0xc8b63a[_0x8b08('0x42')]);_0x45bdf4['filters']=_[_0x8b08('0x44')](_0x45bdf4[_0x8b08('0x41')],_0x45bdf4['query']);_0x41d3fc[_0x8b08('0x45')]=_[_0x8b08('0x44')](_0x45bdf4['model'],qs['fields'](_0xc8b63a[_0x8b08('0x42')][_0x8b08('0x46')]));_0x41d3fc['attributes']=_0x41d3fc[_0x8b08('0x45')][_0x8b08('0x47')]?_0x41d3fc[_0x8b08('0x45')]:_0x45bdf4[_0x8b08('0x41')];if(_0xc8b63a[_0x8b08('0x42')][_0x8b08('0xb9')]){_0x41d3fc[_0x8b08('0xba')]=[{'all':!![]}];}_0x41d3fc=_[_0x8b08('0xa0')]({},_0x41d3fc,_0xc8b63a['options']);return db[_0x8b08('0x3e')]['find'](_0x41d3fc)['then'](handleEntityNotFound(_0x3ce12f,null))[_0x8b08('0x2f')](respondWithResult(_0x3ce12f,null))[_0x8b08('0x3b')](handleError(_0x3ce12f,null));};exports['create']=function(_0x3ce534,_0x2ee06a){return db[_0x8b08('0x3e')][_0x8b08('0xbb')](_0x3ce534[_0x8b08('0x79')],{})[_0x8b08('0x2f')](respondWithResult(_0x2ee06a,0xc9))['catch'](handleError(_0x2ee06a,null));};exports[_0x8b08('0x2e')]=function(_0xbc467a,_0x5566f2){if(_0xbc467a[_0x8b08('0x79')]['id']){delete _0xbc467a[_0x8b08('0x79')]['id'];}return db['WhatsappInteraction'][_0x8b08('0x66')]({'where':{'id':_0xbc467a[_0x8b08('0xbc')]['id']}})[_0x8b08('0x2f')](handleEntityNotFound(_0x5566f2,null))[_0x8b08('0x2f')](saveUpdates(_0xbc467a[_0x8b08('0x79')],null))[_0x8b08('0x2f')](respondWithResult(_0x5566f2,null))['catch'](handleError(_0x5566f2,null));};exports[_0x8b08('0x30')]=function(_0x1aae48,_0x4f454b){return db[_0x8b08('0x3e')][_0x8b08('0x66')]({'where':{'id':_0x1aae48[_0x8b08('0xbc')]['id']}})[_0x8b08('0x2f')](handleEntityNotFound(_0x4f454b,null))['then'](removeEntity(_0x4f454b,null))[_0x8b08('0x3b')](handleError(_0x4f454b,null));};exports[_0x8b08('0xbd')]=function(_0x46631c,_0x2ea9c5){return db['WhatsappInteraction'][_0x8b08('0xbd')]()[_0x8b08('0x2f')](respondWithResult(_0x2ea9c5,null))[_0x8b08('0x3b')](handleError(_0x2ea9c5,null));};exports[_0x8b08('0xbe')]=function(_0x1d4ff7,_0x5172d0,_0x2452a6){return db['WhatsappMessage'][_0x8b08('0x66')]({'where':{'id':_0x1d4ff7[_0x8b08('0xbc')]['id']}})[_0x8b08('0x2f')](handleEntityNotFound(_0x5172d0,null))[_0x8b08('0x2f')](function(_0x21364c){if(_0x21364c){return _0x21364c[_0x8b08('0xbe')](_0x1d4ff7[_0x8b08('0x79')][_0x8b08('0xbf')],_[_0x8b08('0xc0')](_0x1d4ff7[_0x8b08('0x79')],[_0x8b08('0xbf'),'id'])||{});}})[_0x8b08('0x2f')](respondWithResult(_0x5172d0,null))['catch'](handleError(_0x5172d0,null));};exports[_0x8b08('0xc1')]=function(_0x3f6fe7,_0x22fa9,_0x505a51){var _0x512f3e={'raw':![],'where':{}};var _0x572fee={};var _0x29769e={'count':0x0,'rows':[]};return db[_0x8b08('0x3e')][_0x8b08('0xc2')]({'where':{'id':_0x3f6fe7[_0x8b08('0xbc')]['id']}})['then'](handleEntityNotFound(_0x22fa9,null))[_0x8b08('0x2f')](function(_0x4440fc){if(_0x4440fc){_0x572fee[_0x8b08('0x41')]=_['keys'](db[_0x8b08('0xc3')]['rawAttributes']);_0x572fee[_0x8b08('0x42')]=_[_0x8b08('0x43')](_0x3f6fe7[_0x8b08('0x42')]);_0x572fee[_0x8b08('0x4c')]=_[_0x8b08('0x44')](_0x572fee['model'],_0x572fee[_0x8b08('0x42')]);_0x512f3e[_0x8b08('0x45')]=_['intersection'](_0x572fee[_0x8b08('0x41')],qs[_0x8b08('0x46')](_0x3f6fe7['query'][_0x8b08('0x46')]));_0x512f3e['attributes']=_0x512f3e[_0x8b08('0x45')][_0x8b08('0x47')]?_0x512f3e[_0x8b08('0x45')]:_0x572fee[_0x8b08('0x41')];if(!_0x3f6fe7['query']['hasOwnProperty'](_0x8b08('0x49'))){_0x512f3e['limit']=qs[_0x8b08('0x27')](_0x3f6fe7[_0x8b08('0x42')][_0x8b08('0x27')]);_0x512f3e[_0x8b08('0x24')]=qs[_0x8b08('0x24')](_0x3f6fe7[_0x8b08('0x42')][_0x8b08('0x24')]);}_0x512f3e[_0x8b08('0x4a')]=qs[_0x8b08('0xc4')](_0x3f6fe7[_0x8b08('0x42')][_0x8b08('0xc4')]);_0x512f3e[_0x8b08('0x4b')]=qs[_0x8b08('0x4c')](_[_0x8b08('0x4d')](_0x3f6fe7['query'],_0x572fee[_0x8b08('0x4c')]));_0x512f3e[_0x8b08('0x4b')][_0x8b08('0xb5')]=_0x4440fc['id'];if(_0x3f6fe7[_0x8b08('0x42')][_0x8b08('0x8a')]){_0x512f3e[_0x8b08('0x4b')]=_['merge'](_0x512f3e[_0x8b08('0x4b')],{'$or':_[_0x8b08('0x3d')](_0x512f3e[_0x8b08('0x45')],function(_0x477190){var _0x22c2f1={};_0x22c2f1[_0x477190]={'$like':'%'+_0x3f6fe7['query'][_0x8b08('0x8a')]+'%'};return _0x22c2f1;})});}if(_0x3f6fe7[_0x8b08('0x42')][_0x8b08('0xc5')]){var _0x37ba83=_0x3f6fe7[_0x8b08('0x42')][_0x8b08('0xc5')][_0x8b08('0x38')](',');var _0x56c6c9={};_0x56c6c9[_0x37ba83[0x0]]={'$gte':moment(_0x37ba83[0x1])[_0x8b08('0xc6')](_0x8b08('0xc7'))};_0x512f3e[_0x8b08('0x4b')]=_[_0x8b08('0xa0')](_0x512f3e[_0x8b08('0x4b')],_0x56c6c9);}_0x512f3e=_[_0x8b08('0xa0')]({},_0x512f3e,_0x3f6fe7[_0x8b08('0xc8')]);return db['WhatsappMessage']['count']({'where':_0x512f3e['where']})[_0x8b08('0x2f')](function(_0x272f17){_0x29769e[_0x8b08('0x26')]=_0x272f17;if(_0x3f6fe7['query']['includeAll']){_0x512f3e[_0x8b08('0xba')]=[{'all':!![]}];}return db[_0x8b08('0xc3')][_0x8b08('0xc9')](_0x512f3e);})['then'](function(_0x4288aa){_0x29769e['rows']=_0x4288aa;return _0x29769e;});}})[_0x8b08('0x2f')](respondWithFilteredResult(_0x22fa9,_0x512f3e))[_0x8b08('0x3b')](handleError(_0x22fa9,null));};exports[_0x8b08('0xca')]=function(_0x12adcb,_0x535e42,_0x109e5c){return db['WhatsappInteraction'][_0x8b08('0x66')]({'where':{'id':_0x12adcb[_0x8b08('0xbc')]['id']}})[_0x8b08('0x2f')](handleEntityNotFound(_0x535e42,null))[_0x8b08('0x2f')](function(_0x36253f){if(_0x36253f){return _0x36253f[_0x8b08('0xcb')](_0x12adcb[_0x8b08('0x79')][_0x8b08('0xbf')],_[_0x8b08('0xc0')](_0x12adcb[_0x8b08('0x79')],[_0x8b08('0xbf'),'id'])||{})[_0x8b08('0xcc')](function(){return db[_0x8b08('0x74')][_0x8b08('0xc9')]({'attributes':['id',_0x8b08('0x33'),_0x8b08('0x50')],'where':{'id':_0x12adcb[_0x8b08('0x79')][_0x8b08('0xbf')]}});})[_0x8b08('0x2f')](function(_0x3d89e0){socket[_0x8b08('0xcd')]('whatsappInteractionTags:save',{'id':Number(_0x12adcb[_0x8b08('0xbc')]['id']),'tags':_0x3d89e0||[]});return{'id':Number(_0x12adcb[_0x8b08('0xbc')]['id']),'tags':_0x3d89e0||[]};});}})[_0x8b08('0x2f')](respondWithResult(_0x535e42,null))[_0x8b08('0x3b')](handleError(_0x535e42,null));};exports[_0x8b08('0xce')]=function(_0x3e8c3c,_0x5635a8,_0x5584ea){return db[_0x8b08('0x3e')][_0x8b08('0x66')]({'where':{'id':_0x3e8c3c[_0x8b08('0xbc')]['id']}})[_0x8b08('0x2f')](handleEntityNotFound(_0x5635a8,null))['then'](function(_0x356d44){if(_0x356d44){return _0x356d44[_0x8b08('0xce')](_0x3e8c3c[_0x8b08('0x42')]['ids']);}})[_0x8b08('0x2f')](respondWithStatusCode(_0x5635a8,null))[_0x8b08('0x3b')](handleError(_0x5635a8,null));};exports[_0x8b08('0xcf')]=function(_0x14a6f9,_0x45a851){var _0x53968d=moment()[_0x8b08('0xd0')]()[_0x8b08('0x9e')]();var _0x30f46a=path[_0x8b08('0xd1')](config[_0x8b08('0xd2')],_0x8b08('0xd3'),_0x8b08('0xd4'),_0x8b08('0xd5'));var _0x5313d8=path[_0x8b08('0xd1')](config[_0x8b08('0xd2')],_0x8b08('0xd3'),_0x8b08('0xd4'),_0x8b08('0xd6'));var _0xa5bd09=path[_0x8b08('0xd1')](_0x30f46a,_0x53968d);var _0x277b0e=util[_0x8b08('0xc6')](_0x8b08('0xd7'),_0x14a6f9[_0x8b08('0xbc')]['id'],_0x53968d);var _0x52e695=path[_0x8b08('0xd1')](_0x30f46a,_0x277b0e);var _0x189e62=[];_0x189e62['push']({'model':db[_0x8b08('0x76')],'as':'User','attributes':['id',_0x8b08('0xd8')],'raw':!![]});_0x189e62[_0x8b08('0x3a')]({'model':db[_0x8b08('0xd9')],'as':_0x8b08('0x6a'),'attributes':['id',_0x8b08('0xda'),_0x8b08('0xdb')],'raw':!![]});if(_0x14a6f9[_0x8b08('0x42')][_0x8b08('0xd6')]){_0x189e62[_0x8b08('0x3a')]({'model':db['Attachment'],'as':_0x8b08('0xdc'),'raw':!![]});}var _0x5349fe=[{'model':db[_0x8b08('0xc3')],'as':'Messages','attributes':['id','body',_0x8b08('0x7f'),_0x8b08('0xdd'),_0x8b08('0xde'),_0x8b08('0x85')],'include':_0x189e62}];_0x5349fe[_0x8b08('0x3a')]({'model':db[_0x8b08('0xdf')],'as':_0x8b08('0xe0'),'attributes':['id',_0x8b08('0x33')]});_0x5349fe[_0x8b08('0x3a')]({'model':db[_0x8b08('0x76')],'as':'Owner','attributes':['id',_0x8b08('0xd8')]});return db['WhatsappInteraction'][_0x8b08('0x66')]({'where':{'id':_0x14a6f9[_0x8b08('0xbc')]['id']},'include':_0x5349fe})[_0x8b08('0x2f')](handleEntityNotFound(_0x45a851,null))[_0x8b08('0x2f')](function(_0x76e25b){if(_0x76e25b){var _0x2dc19a=_0x76e25b['get']({'plain':!![]});fs[_0x8b08('0xe1')](_0xa5bd09);var _0x3e4fd5={'channel':_0x8b08('0xe2'),'account':_0x2dc19a[_0x8b08('0xe0')]['name'],'agent':_0x2dc19a[_0x8b08('0xe3')]?_0x2dc19a[_0x8b08('0xe3')][_0x8b08('0xd8')]:_0x8b08('0xe4'),'createdAt':moment(_0x2dc19a['createdAt'])[_0x8b08('0xc6')](_0x8b08('0xc7'))['toString'](),'closedAt':_0x2dc19a[_0x8b08('0xe5')]?moment(_0x2dc19a[_0x8b08('0xe6')])[_0x8b08('0xc6')](_0x8b08('0xc7'))[_0x8b08('0x9e')]():'','disposition':_0x2dc19a['disposition'],'messages':_(_0x2dc19a['Messages'])[_0x8b08('0x8a')]({'secret':![]})[_0x8b08('0x3d')](function(_0x2cf7f9){if(_0x2cf7f9['Attachment']){var _0x2ce1ce=path['join'](_0x5313d8,_0x2cf7f9[_0x8b08('0xdc')][_0x8b08('0xe7')]);if(fs['existsSync'](_0x2ce1ce)){fs[_0x8b08('0xe8')](_0x2ce1ce)[_0x8b08('0xe9')](fs['createWriteStream'](path[_0x8b08('0xd1')](_0xa5bd09,_0x2cf7f9[_0x8b08('0xdc')]['basename'])));}}return{'date':moment(_0x2cf7f9[_0x8b08('0x7f')])[_0x8b08('0xc6')](_0x8b08('0xc7'))[_0x8b08('0x9e')](),'sender':_0x2cf7f9[_0x8b08('0xdd')]===_0x8b08('0xea')?_0x2cf7f9[_0x8b08('0x76')]?_0x2cf7f9[_0x8b08('0x76')][_0x8b08('0xd8')]:_0x8b08('0xeb'):_0x2cf7f9[_0x8b08('0x6a')][_0x8b08('0xda')]+(_0x2cf7f9[_0x8b08('0x6a')][_0x8b08('0xdb')]?'\x20'+_0x2cf7f9[_0x8b08('0x6a')]['lastName']:''),'body':_0x2cf7f9['Attachment']?_0x2cf7f9[_0x8b08('0xdc')]['basename']:_0x2cf7f9[_0x8b08('0x79')],'direction':_0x2cf7f9[_0x8b08('0xdd')]===_0x8b08('0xea')?'A':'C','secret':_0x2cf7f9[_0x8b08('0xde')],'read':_0x2cf7f9['read'],'attachment':_0x2cf7f9[_0x8b08('0xdc')]};})[_0x8b08('0x72')]()};return ejs[_0x8b08('0xec')](path[_0x8b08('0xd1')](config['root'],_0x8b08('0xd3'),_0x8b08('0xed'),_0x8b08('0xee')),{'interaction':_0x3e4fd5})['then'](function(_0x11ac37){var _0x40467a=path[_0x8b08('0xd1')](_0xa5bd09,_0x8b08('0xef')+_0x2dc19a['id']+'-'+_0x53968d+_0x8b08('0xf0'));var _0x4accea={'path':_0x40467a,'channel':'Whatsapp','interactionId':_0x2dc19a['id']};return pdf[_0x8b08('0xf1')](_0x11ac37,_0x4accea);})[_0x8b08('0x2f')](function(){return new BPromise(function(_0x286e8f,_0x4a06d8){zipdir(_0xa5bd09,{'saveTo':_0x52e695},function(_0x4e963b,_0xd6adbe){if(_0x4e963b)return _0x4a06d8(_0x4e963b);return _0x286e8f(_0xd6adbe);});})['then'](function(){return new BPromise(function(_0x40fbd9,_0x5ef78b){rimraf(_0xa5bd09,function(_0x2844ac){if(_0x2844ac)_0x5ef78b(_0x2844ac);return _0x40fbd9();});});})[_0x8b08('0x2f')](function(){return _0x45a851[_0x8b08('0xcf')](_0x52e695,_0x277b0e,function(_0x4622a8){if(_0x4622a8){console['log'](_0x8b08('0xf2'),_0x4622a8);}else{fs[_0x8b08('0xf3')](_0x52e695);}});});});}else{return _0x45a851['sendStatus'](0xc8);}})[_0x8b08('0x3b')](handleError(_0x45a851,null));};
\ No newline at end of file
+var _0x9879=['c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','merge','fields','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.email','Contact.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','params','includeAll','options','create','catch','update','destroy','describe','WhatsappMessage','addMessage','ids','omit','nolimit','format','findAll','rows','addTags','setTags','spread','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','lastName','Attachment','direction','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','existsSync','createWriteStream','basename','out','System','secret','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','then','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','sort','where','pick','filters','select','field','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','u.id\x20=\x20ui.UserId','left_join'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0x9879,0x98));var _0x9987=function(_0x3feb80,_0x3dea4f){_0x3feb80=_0x3feb80-0x0;var _0x3f7ec7=_0x9879[_0x3feb80];return _0x3f7ec7;};'use strict';var emlformat=require(_0x9987('0x0'));var rimraf=require(_0x9987('0x1'));var zipdir=require(_0x9987('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9987('0x3'));var moment=require('moment');var BPromise=require(_0x9987('0x4'));var Mustache=require(_0x9987('0x5'));var util=require(_0x9987('0x6'));var path=require(_0x9987('0x7'));var sox=require(_0x9987('0x8'));var csv=require(_0x9987('0x9'));var ejs=require(_0x9987('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9987('0xb'));var squel=require('squel');var crypto=require(_0x9987('0xc'));var jsforce=require(_0x9987('0xd'));var deskjs=require(_0x9987('0xe'));var toCsv=require(_0x9987('0x9'));var querystring=require(_0x9987('0xf'));var Papa=require(_0x9987('0x10'));var Redis=require(_0x9987('0x11'));var authService=require(_0x9987('0x12'));var qs=require(_0x9987('0x13'));var as=require(_0x9987('0x14'));var pdf=require(_0x9987('0x15'));var hardwareService=require(_0x9987('0x16'));var logger=require(_0x9987('0x17'))(_0x9987('0x18'));var utils=require(_0x9987('0x19'));var config=require(_0x9987('0x1a'));var licenseUtil=require(_0x9987('0x1b'));var db=require(_0x9987('0x1c'))['db'];config['redis']=_[_0x9987('0x1d')](config[_0x9987('0x1e')],{'host':_0x9987('0x1f'),'port':0x18eb});var socket=require(_0x9987('0x20'))(new Redis(config[_0x9987('0x1e')]));require('./whatsappInteraction.socket')[_0x9987('0x21')](socket);function respondWithStatusCode(_0x4a4b61,_0x29a899){_0x29a899=_0x29a899||0xcc;return function(_0x467ed2){if(_0x467ed2){return _0x4a4b61[_0x9987('0x22')](_0x29a899);}return _0x4a4b61[_0x9987('0x23')](_0x29a899)[_0x9987('0x24')]();};}function respondWithResult(_0x414375,_0x11a64f){_0x11a64f=_0x11a64f||0xc8;return function(_0x3eefd0){if(_0x3eefd0){return _0x414375[_0x9987('0x23')](_0x11a64f)[_0x9987('0x25')](_0x3eefd0);}};}function respondWithFilteredResult(_0x390ff8,_0x3dfb48){return function(_0x46a28f){if(_0x46a28f){var _0x4f7360=typeof _0x3dfb48['offset']===_0x9987('0x26')&&typeof _0x3dfb48[_0x9987('0x27')]===_0x9987('0x26');var _0x446fb2=_0x46a28f['count'];var _0x217e1e=_0x4f7360?0x0:_0x3dfb48[_0x9987('0x28')];var _0x43379d=_0x4f7360?_0x46a28f[_0x9987('0x29')]:_0x3dfb48['offset']+_0x3dfb48['limit'];var _0x4e1356;if(_0x43379d>=_0x446fb2){_0x43379d=_0x446fb2;_0x4e1356=0xc8;}else{_0x4e1356=0xce;}_0x390ff8[_0x9987('0x23')](_0x4e1356);return _0x390ff8[_0x9987('0x2a')]('Content-Range',_0x217e1e+'-'+_0x43379d+'/'+_0x446fb2)[_0x9987('0x25')](_0x46a28f);}return null;};}function patchUpdates(_0x539f27){return function(_0x3b8fc8){try{jsonpatch[_0x9987('0x2b')](_0x3b8fc8,_0x539f27,!![]);}catch(_0x194d1a){return BPromise[_0x9987('0x2c')](_0x194d1a);}return _0x3b8fc8[_0x9987('0x2d')]();};}function saveUpdates(_0x2c867c,_0x384262){return function(_0x4c8b95){if(_0x4c8b95){return _0x4c8b95['update'](_0x2c867c)[_0x9987('0x2e')](function(_0x4094f2){return _0x4094f2;});}return null;};}function removeEntity(_0x1a79ab,_0x468ae1){return function(_0x230402){if(_0x230402){return _0x230402['destroy']()[_0x9987('0x2e')](function(){_0x1a79ab[_0x9987('0x23')](0xcc)[_0x9987('0x24')]();});}};}function handleEntityNotFound(_0x384ad,_0xa77fba){return function(_0x56e0a8){if(!_0x56e0a8){_0x384ad[_0x9987('0x22')](0x194);}return _0x56e0a8;};}function handleError(_0x528276,_0x5ce1d6){_0x5ce1d6=_0x5ce1d6||0x1f4;return function(_0x2c6b11){logger['error'](_0x2c6b11[_0x9987('0x2f')]);if(_0x2c6b11[_0x9987('0x30')]){delete _0x2c6b11[_0x9987('0x30')];}_0x528276['status'](_0x5ce1d6)['send'](_0x2c6b11);};}function getInteractionUsers(_0x5165b9,_0x506ab2){return new BPromise(function(_0x164fc6,_0xf09b1a){try{if(_0x506ab2[_0x5165b9['id']]){_0x5165b9[_0x9987('0x31')]=_[_0x9987('0x32')](_0x506ab2[_0x5165b9['id']],function(_0x96ccb){return{'id':_0x96ccb['id'],'fullname':_0x96ccb[_0x9987('0x33')]};});}}catch(_0x50915e){_0xf09b1a(_0x50915e);}_0x164fc6(_0x5165b9);});}function getInteractionTags(_0x22a28e,_0x312faa){return new BPromise(function(_0x590dfc,_0xfe9795){try{if(_0x22a28e[_0x9987('0x34')]){_0x22a28e[_0x9987('0x35')]=[];_0x22a28e[_0x9987('0x34')][_0x9987('0x36')](',')[_0x9987('0x37')](function(_0x314510){_0x22a28e[_0x9987('0x35')][_0x9987('0x38')](_0x312faa[_0x314510]);});}delete _0x22a28e[_0x9987('0x34')];}catch(_0x3a044d){_0xfe9795(_0x3a044d);}_0x590dfc(_0x22a28e);});}function updateWhatsappInteraction(_0x2b854f,_0x55496f,_0x3c38c8){return new BPromise(function(_0x4e6416,_0x4948fc){return getInteractionUsers(_0x2b854f,_0x3c38c8)['then'](function(_0x4f04e0){return getInteractionTags(_0x4f04e0,_0x55496f);})[_0x9987('0x2e')](function(_0x3074af){_0x4e6416(_0x3074af);})['catch'](function(_0x4910be){_0x4948fc(_0x4910be);});});}exports['index']=function(_0x49c461,_0x4a162f){var _0x3e7476={},_0x357d6c={},_0xc35e5e={'count':0x0,'rows':[]};var _0x19aa56=_[_0x9987('0x32')](db[_0x9987('0x39')][_0x9987('0x3a')],function(_0x2bcdd0){return{'name':_0x2bcdd0[_0x9987('0x3b')],'type':_0x2bcdd0[_0x9987('0x3c')][_0x9987('0x3d')]};});_0x357d6c[_0x9987('0x3e')]=_['map'](_0x19aa56,'name');_0x357d6c['query']=_[_0x9987('0x3f')](_0x49c461[_0x9987('0x40')]);_0x357d6c['filters']=_[_0x9987('0x41')](_0x357d6c[_0x9987('0x3e')],_0x357d6c['query']);_0x3e7476[_0x9987('0x42')]=_[_0x9987('0x41')](_0x357d6c[_0x9987('0x3e')],qs['fields'](_0x49c461[_0x9987('0x40')]['fields']));_0x3e7476[_0x9987('0x42')]=_0x3e7476[_0x9987('0x42')][_0x9987('0x43')]?_0x3e7476['attributes']:_0x357d6c[_0x9987('0x3e')];if(!_0x49c461['query'][_0x9987('0x44')]('nolimit')){_0x3e7476[_0x9987('0x27')]=qs[_0x9987('0x27')](_0x49c461[_0x9987('0x40')][_0x9987('0x27')]);_0x3e7476[_0x9987('0x28')]=qs[_0x9987('0x28')](_0x49c461[_0x9987('0x40')][_0x9987('0x28')]);}_0x3e7476['order']=qs[_0x9987('0x45')](_0x49c461[_0x9987('0x40')][_0x9987('0x45')]);_0x3e7476[_0x9987('0x46')]=qs['filters'](_[_0x9987('0x47')](_0x49c461[_0x9987('0x40')],_0x357d6c[_0x9987('0x48')]),_0x19aa56);var _0x44ccfa=[];var _0x1edf6b=squel[_0x9987('0x49')]()[_0x9987('0x4a')]('id')[_0x9987('0x4a')]('name')[_0x9987('0x4a')](_0x9987('0x4b'))[_0x9987('0x4c')](_0x9987('0x4d'));var _0x109a00=squel[_0x9987('0x49')]()[_0x9987('0x4a')]('u.id')[_0x9987('0x4a')](_0x9987('0x4e'))[_0x9987('0x4a')](_0x9987('0x4f'))[_0x9987('0x4c')]('user_has_whatsapp_interactions','ui')['left_join']('users','u',_0x9987('0x50'));var _0x34b82c=squel[_0x9987('0x49')]()['from']('whatsapp_interactions','i')[_0x9987('0x51')]('cm_contacts','c',_0x9987('0x52'))['left_join'](_0x9987('0x53'),'o','o.id\x20=\x20i.UserId')[_0x9987('0x51')](_0x9987('0x54'),'a',_0x9987('0x55'))['left_join']('whatsapp_messages','me',_0x9987('0x56'))['left_join'](_0x9987('0x57'),'it',_0x9987('0x58'))[_0x9987('0x51')]('tools_tags','t',_0x9987('0x59'));var _0xd9a59c=squel['expr']();var _0x3799d5=[];var _0x38d594=squel[_0x9987('0x5a')]();var _0x2a9e64;if(_0x49c461[_0x9987('0x40')][_0x9987('0x5b')]){_0x2a9e64=as[_0x9987('0x5c')](_0x49c461['query'][_0x9987('0x5b')]);var _0x24ac6f=_0x2a9e64[_0x9987('0x5d')];for(var _0x11bd0e=0x0;_0x11bd0e<_0x2a9e64[_0x9987('0x5e')]['length'];_0x11bd0e++){var _0x4a7f1d=_0x2a9e64[_0x9987('0x5e')][_0x11bd0e];var _0x32013b='i';var _0x44344f=_[_0x9987('0x5f')](_0x19aa56,[_0x9987('0x30'),_0x4a7f1d[_0x9987('0x4a')]]);if(!_0x44344f){switch(_0x4a7f1d[_0x9987('0x4a')]){case'unreadMessages':if(_0x4a7f1d[_0x9987('0x60')]==0x1){_0x34b82c['having']('`'+_0x4a7f1d[_0x9987('0x4a')]+_0x9987('0x61'));}else{_0x34b82c[_0x9987('0x62')]('`'+_0x4a7f1d['field']+_0x9987('0x63'));}break;case _0x9987('0x64'):if(_0x4a7f1d[_0x9987('0x65')]===_0x9987('0x66')){if(_0x4a7f1d[_0x9987('0x60')][_0x9987('0x36')]('\x20')['length']>0x1){_0xd9a59c[_0x24ac6f](_0x9987('0x67'),qs[_0x9987('0x68')](_0x4a7f1d[_0x9987('0x60')]),null);}else{var _0x51ef56='%'+_0x4a7f1d[_0x9987('0x60')]+'%';_0xd9a59c[_0x24ac6f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x51ef56,_0x51ef56,_0x51ef56);}}else{_0x44344f=_[_0x9987('0x5f')](_0x19aa56,['name',_0x9987('0x69')]);_0x4a7f1d[_0x9987('0x4a')]='ContactId';_0x57acc2=as['buildExpression'](_0x32013b,_0x44344f[_0x9987('0x3c')],_0x4a7f1d);_0xd9a59c[_0x24ac6f](_0x57acc2['text'],_0x57acc2[_0x9987('0x60')][_0x9987('0x6a')],_0x57acc2['value']['end']);}break;case _0x9987('0x6b'):var _0x5d99a6=_0x4a7f1d[_0x9987('0x60')][_0x9987('0x36')](',')['map'](function(_0x187daf){return Number(_0x187daf);});_0x5d99a6[_0x9987('0x37')](function(_0x56f0fb){_0x38d594['or'](_0x9987('0x6c'),'%,'+_0x56f0fb+',%');});_0x3799d5=_['union'](_0x3799d5,_0x5d99a6);break;case'User':if(_0x4a7f1d['operator']===_0x9987('0x66')){_0xd9a59c[_0x24ac6f](_0x9987('0x6d'),'%'+_0x4a7f1d[_0x9987('0x60')]+'%',null);}else{_0x44344f=_[_0x9987('0x5f')](_0x19aa56,[_0x9987('0x30'),'UserId']);_0x4a7f1d[_0x9987('0x4a')]=_0x9987('0x6e');_0x57acc2=as[_0x9987('0x6f')](_0x32013b,_0x44344f[_0x9987('0x3c')],_0x4a7f1d);_0xd9a59c[_0x24ac6f](_0x57acc2[_0x9987('0x70')],_0x57acc2[_0x9987('0x60')][_0x9987('0x6a')],_0x57acc2[_0x9987('0x60')][_0x9987('0x24')]);}break;case _0x9987('0x71'):_0x57acc2=as[_0x9987('0x6f')]('me',null,_0x4a7f1d);_0xd9a59c[_0x24ac6f](_0x57acc2[_0x9987('0x70')],_0x57acc2['value'][_0x9987('0x6a')],_0x57acc2['value']['end']);break;}}else{var _0x57acc2=as[_0x9987('0x6f')](_0x32013b,_0x44344f[_0x9987('0x3c')],_0x4a7f1d);_0xd9a59c[_0x24ac6f](_0x57acc2['text'],_0x57acc2[_0x9987('0x60')][_0x9987('0x6a')],_0x57acc2[_0x9987('0x60')][_0x9987('0x24')]);}}}else{var _0x357f3b=_(_0x49c461[_0x9987('0x40')])[_0x9987('0x3f')]()[_0x9987('0x32')](function(_0x58dce1){return _[_0x9987('0x72')](_0x19aa56,['name',_0x58dce1])?_0x58dce1:undefined;})[_0x9987('0x73')]()[_0x9987('0x60')]();if(!_[_0x9987('0x74')](_0x357f3b)){_0x357f3b[_0x9987('0x37')](function(_0x263dd8){if(_0x263dd8===_0x9987('0x75')){_0x34b82c[_0x9987('0x46')](_0x9987('0x76'),[][_0x9987('0x77')](_0x49c461[_0x9987('0x40')][_0x263dd8]));}else if(_0x263dd8===_0x9987('0x78')){var _0x274951=JSON[_0x9987('0x79')](_0x49c461[_0x9987('0x40')][_0x263dd8])[_0x9987('0x7a')];var _0x424197=JSON[_0x9987('0x79')](_0x49c461[_0x9987('0x40')][_0x263dd8])[_0x9987('0x7b')];_0x34b82c[_0x9987('0x46')](_0x9987('0x7c'),_0x274951,_0x424197);}else{if(_0x49c461['query'][_0x263dd8]===_0x9987('0x7d')){_0x34b82c['where']('i.'+_0x263dd8+_0x9987('0x7e'));}else{_0x34b82c[_0x9987('0x46')]('i.'+_0x263dd8+_0x9987('0x7f'),_0x49c461['query'][_0x263dd8]);}}});}if(_0x49c461[_0x9987('0x40')]['read']){if(_0x49c461['query'][_0x9987('0x80')]==0x1){_0x34b82c[_0x9987('0x62')](_0x9987('0x81'));}else{_0x34b82c[_0x9987('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x49c461[_0x9987('0x40')]['tag']){_0x3799d5=_['isArray'](_0x49c461['query']['tag'])?_0x49c461[_0x9987('0x40')][_0x9987('0x82')]:new Array(_0x49c461[_0x9987('0x40')][_0x9987('0x82')]);_0x3799d5[_0x9987('0x37')](function(_0x32d29e){_0x38d594['or'](_0x9987('0x6c'),'%,'+_0x32d29e+',%');});}if(_0x49c461[_0x9987('0x40')][_0x9987('0x83')]){var _0x168c24=_0x49c461[_0x9987('0x40')]['filter'][_0x9987('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9987('0x85')](_0x168c24)){_0xd9a59c['or']('i.id\x20LIKE\x20?',_0x168c24+'%')['or'](_0x9987('0x86'),_0x168c24+'%');}else{_0xd9a59c['or'](_0x9987('0x87'),qs[_0x9987('0x68')](_0x168c24))['or'](_0x9987('0x88'),_0x168c24+'%');}}}_0x34b82c['where'](_0xd9a59c);_0x34b82c[_0x9987('0x89')]('i.id');var _0x5b021b={'type':db[_0x9987('0x8a')]['QueryTypes'][_0x9987('0x8b')],'raw':!![]};var _0xbb4839=_0x34b82c[_0x9987('0x8c')]();_0xbb4839[_0x9987('0x4a')](_0x9987('0x8d'));_0xbb4839[_0x9987('0x4a')](_0x9987('0x8e'),_0x9987('0x8f'));if(_0x3e7476[_0x9987('0x90')]){_0x3e7476[_0x9987('0x90')][_0x9987('0x37')](function(_0x7a5a45){var _0x3dd963=_0x7a5a45[0x0]===_0x9987('0x91')?_0x7a5a45[0x0]:'i.'+_0x7a5a45[0x0];_0x34b82c['order'](_0x3dd963,_0x7a5a45[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9987('0x74')](_0x3799d5)){_0x34b82c['having'](_0x38d594);_0xbb4839[_0x9987('0x46')](_0x9987('0x92'),_0x3799d5);}BPromise['resolve']()['then'](function(){if(!_0x2a9e64){if(_0x49c461[_0x9987('0x40')][_0x9987('0x75')])return;_0xbb4839['where'](_0x9987('0x93'));_0x34b82c[_0x9987('0x46')](_0x9987('0x93'));return;}if(_0x49c461['user'][_0x9987('0x94')]!==_0x9987('0x95'))return;return _0x49c461['user'][_0x9987('0x96')]({'attributes':['id'],'raw':!![]})[_0x9987('0x2e')](function(_0x104581){if(_[_0x9987('0x74')](_0x104581)){_0xbb4839['where'](_0x9987('0x97'));_0x34b82c['where'](_0x9987('0x97'));}else{_0xbb4839[_0x9987('0x46')]('i.WhatsappAccountId\x20IN\x20?',_[_0x9987('0x32')](_0x104581,'id'));_0x34b82c[_0x9987('0x46')](_0x9987('0x76'),_[_0x9987('0x32')](_0x104581,'id'));}});})[_0x9987('0x2e')](function(){if(_0x49c461[_0x9987('0x98')]['role']==='agent'&&!_0x2a9e64&&!_0x49c461[_0x9987('0x40')][_0x9987('0x75')])return[];return db[_0x9987('0x99')]['query'](_0xbb4839[_0x9987('0x9a')](),_0x5b021b);})[_0x9987('0x2e')](function(_0x2c9bc5){_0xc35e5e['count']=_0x2c9bc5[_0x9987('0x43')];if(_0xc35e5e['count']===0x0)return[];return db[_0x9987('0x99')]['query'](_0x1edf6b['toString'](),_0x5b021b)['then'](function(_0x262a4d){_0x44ccfa=_[_0x9987('0x9b')](_0x262a4d,'id');_0x5b021b=_[_0x9987('0x9c')](_0x5b021b,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49c461['query'][_0x9987('0x9d')]){_0x3e7476[_0x9987('0x42')][_0x9987('0x37')](function(_0x10978f){_0x34b82c[_0x9987('0x4a')]('i.'+_0x10978f);});}else{_0x34b82c[_0x9987('0x4a')](_0x9987('0x8e'),'unreadMessages');_0x34b82c[_0x9987('0x4a')](_0x9987('0x9e'),_0x9987('0x9f'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xa0'),_0x9987('0xa1'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xa2'),_0x9987('0x91'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xa3'));_0x34b82c['field'](_0x9987('0xa4'),_0x9987('0xa5'));_0x34b82c[_0x9987('0x4a')]('c.lastName','Contact.lastName');_0x34b82c[_0x9987('0x4a')](_0x9987('0xa6'),_0x9987('0xa7'));_0x34b82c[_0x9987('0x4a')]('c.phone',_0x9987('0xa8'));_0x34b82c['field']('c.mobile','Contact.mobile');_0x34b82c[_0x9987('0x4a')](_0x9987('0xa9'),_0x9987('0xaa'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xab'),_0x9987('0xac'));_0x34b82c['field'](_0x9987('0xad'),_0x9987('0xae'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xaf'),_0x9987('0x34'));}if(_0x3e7476[_0x9987('0x27')])_0x34b82c[_0x9987('0x27')](_0x3e7476[_0x9987('0x27')]);if(_0x3e7476[_0x9987('0x28')])_0x34b82c['offset'](_0x3e7476[_0x9987('0x28')]);return db[_0x9987('0x99')][_0x9987('0x40')](_0x34b82c[_0x9987('0x9a')](),_0x5b021b);})[_0x9987('0x2e')](function(_0x8f46ce){if(_0x8f46ce['length']>0x0)_0x109a00[_0x9987('0x46')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x8f46ce,'id'));return db[_0x9987('0x99')][_0x9987('0x40')](_0x109a00[_0x9987('0x9a')](),_0x5b021b)[_0x9987('0x2e')](function(_0x186c55){var _0x47b580=_[_0x9987('0xb0')](_0x186c55,_0x9987('0xb1'));var _0x108ec3=[];_0x8f46ce[_0x9987('0x37')](function(_0x5ec2d0){_0x108ec3[_0x9987('0x38')](updateWhatsappInteraction(_0x5ec2d0,_0x44ccfa,_0x47b580));});return BPromise['all'](_0x108ec3);});});})[_0x9987('0x2e')](function(_0x3f5b13){_0xc35e5e['rows']=_0x3f5b13;return _0xc35e5e;})['then'](respondWithFilteredResult(_0x4a162f,_0x3e7476))['catch'](handleError(_0x4a162f,null));};exports['show']=function(_0x5e5bca,_0x4f9d75){var _0x21620b={'raw':![],'where':{'id':_0x5e5bca[_0x9987('0xb2')]['id']}},_0x111dfb={};_0x111dfb[_0x9987('0x3e')]=_[_0x9987('0x3f')](db['WhatsappInteraction'][_0x9987('0x3a')]);_0x111dfb['query']=_[_0x9987('0x3f')](_0x5e5bca[_0x9987('0x40')]);_0x111dfb['filters']=_[_0x9987('0x41')](_0x111dfb[_0x9987('0x3e')],_0x111dfb[_0x9987('0x40')]);_0x21620b['attributes']=_[_0x9987('0x41')](_0x111dfb[_0x9987('0x3e')],qs[_0x9987('0x9d')](_0x5e5bca[_0x9987('0x40')][_0x9987('0x9d')]));_0x21620b[_0x9987('0x42')]=_0x21620b[_0x9987('0x42')][_0x9987('0x43')]?_0x21620b[_0x9987('0x42')]:_0x111dfb['model'];if(_0x5e5bca['query'][_0x9987('0xb3')]){_0x21620b['include']=[{'all':!![]}];}_0x21620b=_['merge']({},_0x21620b,_0x5e5bca[_0x9987('0xb4')]);return db['WhatsappInteraction'][_0x9987('0x5f')](_0x21620b)[_0x9987('0x2e')](handleEntityNotFound(_0x4f9d75,null))['then'](respondWithResult(_0x4f9d75,null))['catch'](handleError(_0x4f9d75,null));};exports[_0x9987('0xb5')]=function(_0x5a270b,_0x6c40f){return db[_0x9987('0x39')][_0x9987('0xb5')](_0x5a270b[_0x9987('0x71')],{})[_0x9987('0x2e')](respondWithResult(_0x6c40f,0xc9))[_0x9987('0xb6')](handleError(_0x6c40f,null));};exports[_0x9987('0xb7')]=function(_0xfbf4e4,_0x1e2195){if(_0xfbf4e4[_0x9987('0x71')]['id']){delete _0xfbf4e4[_0x9987('0x71')]['id'];}return db[_0x9987('0x39')][_0x9987('0x5f')]({'where':{'id':_0xfbf4e4[_0x9987('0xb2')]['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x1e2195,null))[_0x9987('0x2e')](saveUpdates(_0xfbf4e4['body'],null))[_0x9987('0x2e')](respondWithResult(_0x1e2195,null))[_0x9987('0xb6')](handleError(_0x1e2195,null));};exports[_0x9987('0xb8')]=function(_0x42123e,_0x535dcf){return db[_0x9987('0x39')]['find']({'where':{'id':_0x42123e['params']['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x535dcf,null))['then'](removeEntity(_0x535dcf,null))[_0x9987('0xb6')](handleError(_0x535dcf,null));};exports[_0x9987('0xb9')]=function(_0x4885fd,_0x2a2a71){return db[_0x9987('0x39')][_0x9987('0xb9')]()['then'](respondWithResult(_0x2a2a71,null))[_0x9987('0xb6')](handleError(_0x2a2a71,null));};exports['addMessage']=function(_0x4260ba,_0x543113,_0x401094){return db[_0x9987('0xba')][_0x9987('0x5f')]({'where':{'id':_0x4260ba[_0x9987('0xb2')]['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x543113,null))['then'](function(_0x178f6a){if(_0x178f6a){return _0x178f6a[_0x9987('0xbb')](_0x4260ba['body'][_0x9987('0xbc')],_[_0x9987('0xbd')](_0x4260ba[_0x9987('0x71')],[_0x9987('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x543113,null))['catch'](handleError(_0x543113,null));};exports['getMessages']=function(_0x59ca7a,_0x23457c,_0x159438){var _0xea0df5={'raw':![],'where':{}};var _0x417580={};var _0x313415={'count':0x0,'rows':[]};return db[_0x9987('0x39')]['findOne']({'where':{'id':_0x59ca7a['params']['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x23457c,null))[_0x9987('0x2e')](function(_0x39f0ac){if(_0x39f0ac){_0x417580[_0x9987('0x3e')]=_[_0x9987('0x3f')](db[_0x9987('0xba')]['rawAttributes']);_0x417580['query']=_[_0x9987('0x3f')](_0x59ca7a['query']);_0x417580[_0x9987('0x48')]=_['intersection'](_0x417580['model'],_0x417580[_0x9987('0x40')]);_0xea0df5[_0x9987('0x42')]=_['intersection'](_0x417580['model'],qs[_0x9987('0x9d')](_0x59ca7a[_0x9987('0x40')][_0x9987('0x9d')]));_0xea0df5[_0x9987('0x42')]=_0xea0df5[_0x9987('0x42')]['length']?_0xea0df5[_0x9987('0x42')]:_0x417580[_0x9987('0x3e')];if(!_0x59ca7a[_0x9987('0x40')][_0x9987('0x44')](_0x9987('0xbe'))){_0xea0df5[_0x9987('0x27')]=qs['limit'](_0x59ca7a[_0x9987('0x40')]['limit']);_0xea0df5['offset']=qs[_0x9987('0x28')](_0x59ca7a[_0x9987('0x40')][_0x9987('0x28')]);}_0xea0df5['order']=qs[_0x9987('0x45')](_0x59ca7a[_0x9987('0x40')][_0x9987('0x45')]);_0xea0df5[_0x9987('0x46')]=qs[_0x9987('0x48')](_[_0x9987('0x47')](_0x59ca7a[_0x9987('0x40')],_0x417580[_0x9987('0x48')]));_0xea0df5[_0x9987('0x46')][_0x9987('0xb1')]=_0x39f0ac['id'];if(_0x59ca7a['query'][_0x9987('0x83')]){_0xea0df5[_0x9987('0x46')]=_['merge'](_0xea0df5['where'],{'$or':_['map'](_0xea0df5[_0x9987('0x42')],function(_0x537b59){var _0x1dd61e={};_0x1dd61e[_0x537b59]={'$like':'%'+_0x59ca7a[_0x9987('0x40')]['filter']+'%'};return _0x1dd61e;})});}if(_0x59ca7a[_0x9987('0x40')][_0x9987('0x7a')]){var _0x5a2e62=_0x59ca7a[_0x9987('0x40')]['$gte'][_0x9987('0x36')](',');var _0x4f1de0={};_0x4f1de0[_0x5a2e62[0x0]]={'$gte':moment(_0x5a2e62[0x1])[_0x9987('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')};_0xea0df5[_0x9987('0x46')]=_[_0x9987('0x9c')](_0xea0df5[_0x9987('0x46')],_0x4f1de0);}_0xea0df5=_['merge']({},_0xea0df5,_0x59ca7a[_0x9987('0xb4')]);return db[_0x9987('0xba')][_0x9987('0x29')]({'where':_0xea0df5[_0x9987('0x46')]})['then'](function(_0x2fa1f5){_0x313415[_0x9987('0x29')]=_0x2fa1f5;if(_0x59ca7a[_0x9987('0x40')][_0x9987('0xb3')]){_0xea0df5['include']=[{'all':!![]}];}return db[_0x9987('0xba')][_0x9987('0xc0')](_0xea0df5);})[_0x9987('0x2e')](function(_0x57cc84){_0x313415[_0x9987('0xc1')]=_0x57cc84;return _0x313415;});}})[_0x9987('0x2e')](respondWithFilteredResult(_0x23457c,_0xea0df5))[_0x9987('0xb6')](handleError(_0x23457c,null));};exports[_0x9987('0xc2')]=function(_0x3a3b77,_0x287f88,_0x3cd0f2){return db[_0x9987('0x39')][_0x9987('0x5f')]({'where':{'id':_0x3a3b77[_0x9987('0xb2')]['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x287f88,null))[_0x9987('0x2e')](function(_0x562126){if(_0x562126){return _0x562126[_0x9987('0xc3')](_0x3a3b77[_0x9987('0x71')]['ids'],_[_0x9987('0xbd')](_0x3a3b77[_0x9987('0x71')],[_0x9987('0xbc'),'id'])||{})[_0x9987('0xc4')](function(){return db['Tag'][_0x9987('0xc0')]({'attributes':['id','name',_0x9987('0x4b')],'where':{'id':_0x3a3b77['body']['ids']}});})[_0x9987('0x2e')](function(_0x2d7f34){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x3a3b77[_0x9987('0xb2')]['id']),'tags':_0x2d7f34||[]});return{'id':Number(_0x3a3b77[_0x9987('0xb2')]['id']),'tags':_0x2d7f34||[]};});}})[_0x9987('0x2e')](respondWithResult(_0x287f88,null))[_0x9987('0xb6')](handleError(_0x287f88,null));};exports['removeTags']=function(_0x28ce3d,_0x3b8a9e,_0x123006){return db[_0x9987('0x39')][_0x9987('0x5f')]({'where':{'id':_0x28ce3d[_0x9987('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3b8a9e,null))[_0x9987('0x2e')](function(_0x880086){if(_0x880086){return _0x880086['removeTags'](_0x28ce3d[_0x9987('0x40')]['ids']);}})[_0x9987('0x2e')](respondWithStatusCode(_0x3b8a9e,null))[_0x9987('0xb6')](handleError(_0x3b8a9e,null));};exports['download']=function(_0x58e8d2,_0x4d9b0e){var _0xc6068b=moment()[_0x9987('0xc5')]()[_0x9987('0x9a')]();var _0x4be83a=path[_0x9987('0xc6')](config[_0x9987('0xc7')],_0x9987('0xc8'),_0x9987('0xc9'),_0x9987('0xca'));var _0x4fa756=path['join'](config['root'],_0x9987('0xc8'),_0x9987('0xc9'),_0x9987('0xcb'));var _0x5d0614=path[_0x9987('0xc6')](_0x4be83a,_0xc6068b);var _0x4151de=util[_0x9987('0xbf')](_0x9987('0xcc'),_0x58e8d2['params']['id'],_0xc6068b);var _0x151afd=path['join'](_0x4be83a,_0x4151de);var _0x1eb138=[];_0x1eb138[_0x9987('0x38')]({'model':db[_0x9987('0xcd')],'as':_0x9987('0xcd'),'attributes':['id',_0x9987('0x33')],'raw':!![]});_0x1eb138[_0x9987('0x38')]({'model':db[_0x9987('0xce')],'as':_0x9987('0x64'),'attributes':['id','firstName',_0x9987('0xcf')],'raw':!![]});if(_0x58e8d2[_0x9987('0x40')][_0x9987('0xcb')]){_0x1eb138['push']({'model':db[_0x9987('0xd0')],'as':_0x9987('0xd0'),'raw':!![]});}var _0x2066e7=[{'model':db[_0x9987('0xba')],'as':'Messages','attributes':['id',_0x9987('0x71'),_0x9987('0x78'),_0x9987('0xd1'),'secret',_0x9987('0x80')],'include':_0x1eb138}];_0x2066e7[_0x9987('0x38')]({'model':db[_0x9987('0xd2')],'as':_0x9987('0xd3'),'attributes':['id','name']});_0x2066e7[_0x9987('0x38')]({'model':db[_0x9987('0xcd')],'as':_0x9987('0xd4'),'attributes':['id',_0x9987('0x33')]});return db['WhatsappInteraction'][_0x9987('0x5f')]({'where':{'id':_0x58e8d2[_0x9987('0xb2')]['id']},'include':_0x2066e7})[_0x9987('0x2e')](handleEntityNotFound(_0x4d9b0e,null))[_0x9987('0x2e')](function(_0x5147a6){if(_0x5147a6){var _0x1ff000=_0x5147a6['get']({'plain':!![]});fs[_0x9987('0xd5')](_0x5d0614);var _0x4ad868={'channel':_0x9987('0xd6'),'account':_0x1ff000['Account'][_0x9987('0x30')],'agent':_0x1ff000[_0x9987('0xd4')]?_0x1ff000[_0x9987('0xd4')]['fullname']:_0x9987('0xd7'),'createdAt':moment(_0x1ff000[_0x9987('0x78')])[_0x9987('0xbf')](_0x9987('0xd8'))['toString'](),'closedAt':_0x1ff000[_0x9987('0xd9')]?moment(_0x1ff000[_0x9987('0xda')])[_0x9987('0xbf')](_0x9987('0xd8'))[_0x9987('0x9a')]():'','disposition':_0x1ff000[_0x9987('0xdb')],'messages':_(_0x1ff000['Messages'])[_0x9987('0x83')]({'secret':![]})[_0x9987('0x32')](function(_0x10d066){if(_0x10d066[_0x9987('0xd0')]){var _0x117b1a=path[_0x9987('0xc6')](_0x4fa756,_0x10d066[_0x9987('0xd0')]['basename']);if(fs[_0x9987('0xdc')](_0x117b1a)){fs['createReadStream'](_0x117b1a)['pipe'](fs[_0x9987('0xdd')](path[_0x9987('0xc6')](_0x5d0614,_0x10d066[_0x9987('0xd0')][_0x9987('0xde')])));}}return{'date':moment(_0x10d066['createdAt'])[_0x9987('0xbf')](_0x9987('0xd8'))['toString'](),'sender':_0x10d066[_0x9987('0xd1')]===_0x9987('0xdf')?_0x10d066['User']?_0x10d066['User']['fullname']:_0x9987('0xe0'):_0x10d066[_0x9987('0x64')]['firstName']+(_0x10d066[_0x9987('0x64')][_0x9987('0xcf')]?'\x20'+_0x10d066[_0x9987('0x64')]['lastName']:''),'body':_0x10d066[_0x9987('0xd0')]?_0x10d066[_0x9987('0xd0')][_0x9987('0xde')]:_0x10d066[_0x9987('0x71')],'direction':_0x10d066[_0x9987('0xd1')]==='out'?'A':'C','secret':_0x10d066[_0x9987('0xe1')],'read':_0x10d066[_0x9987('0x80')],'attachment':_0x10d066[_0x9987('0xd0')]};})[_0x9987('0x60')]()};return ejs[_0x9987('0xe2')](path['join'](config[_0x9987('0xc7')],_0x9987('0xc8'),'views',_0x9987('0xe3')),{'interaction':_0x4ad868})[_0x9987('0x2e')](function(_0x5ba94d){var _0x311b93=path['join'](_0x5d0614,_0x9987('0xe4')+_0x1ff000['id']+'-'+_0xc6068b+'.pdf');var _0x31794c={'path':_0x311b93,'channel':_0x9987('0xd6'),'interactionId':_0x1ff000['id']};return pdf[_0x9987('0xe5')](_0x5ba94d,_0x31794c);})[_0x9987('0x2e')](function(){return new BPromise(function(_0x471a5a,_0x547a17){zipdir(_0x5d0614,{'saveTo':_0x151afd},function(_0x467911,_0x4e73ca){if(_0x467911)return _0x547a17(_0x467911);return _0x471a5a(_0x4e73ca);});})[_0x9987('0x2e')](function(){return new BPromise(function(_0x373b2c,_0x291c51){rimraf(_0x5d0614,function(_0x521804){if(_0x521804)_0x291c51(_0x521804);return _0x373b2c();});});})[_0x9987('0x2e')](function(){return _0x4d9b0e[_0x9987('0xe6')](_0x151afd,_0x4151de,function(_0x4b3cd6){if(_0x4b3cd6){console[_0x9987('0xe7')](_0x9987('0xe8'),_0x4b3cd6);}else{fs[_0x9987('0xe9')](_0x151afd);}});});});}else{return _0x4d9b0e[_0x9987('0x22')](0xc8);}})[_0x9987('0xb6')](handleError(_0x4d9b0e,null));};
\ No newline at end of file
index b5b43f0..4a8d263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3402=['Users','map','findAll','unreadMessages','emit','hook','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','update','remove','then','setDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3402,0x1f0));var _0x2340=function(_0xc6e1ee,_0x456b49){_0xc6e1ee=_0xc6e1ee-0x0;var _0x522c2f=_0x3402[_0xc6e1ee];return _0x522c2f;};'use strict';var EventEmitter=require(_0x2340('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x2340('0x1')];var WhatsappMessage=require(_0x2340('0x2'))['db'][_0x2340('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2340('0x4'),'afterDestroy':_0x2340('0x5')};function emitEvent(_0x87db7f){return function(_0x2bd178,_0x2f2ebd,_0x5dc7e6){_0x2bd178['getUsers']({'attributes':['id'],'raw':!![]})[_0x2340('0x6')](function(_0x1deef4){_0x2bd178[_0x2340('0x7')](_0x2340('0x8'),_0x1deef4[_0x2340('0x9')](function(_0x4c38c7){return{'id':_0x4c38c7['id']};}));return WhatsappMessage[_0x2340('0xa')]({'where':{'WhatsappInteractionId':_0x2bd178['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2340('0x6')](function(_0x2f9e27){_0x2bd178[_0x2340('0x7')](_0x2340('0xb'),_0x2f9e27['length']);WhatsappInteractionEvents[_0x2340('0xc')](_0x87db7f+':'+_0x2bd178['id'],_0x2bd178);WhatsappInteractionEvents[_0x2340('0xc')](_0x87db7f,_0x2bd178);_0x5dc7e6(null);})['catch'](_0x5dc7e6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x2340('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xbc4a=['exports','events','../../mysqldb','WhatsappInteraction','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x52a76c,_0x56752c){var _0x1c95d8=function(_0x301a2f){while(--_0x301a2f){_0x52a76c['push'](_0x52a76c['shift']());}};_0x1c95d8(++_0x56752c);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x3e4abc,_0x529ca4){_0x3e4abc=_0x3e4abc-0x0;var _0x1eb45b=_0xbc4a[_0x3e4abc];return _0x1eb45b;};'use strict';var EventEmitter=require(_0xabc4('0x0'));var WhatsappInteraction=require(_0xabc4('0x1'))['db'][_0xabc4('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xabc4('0x3')};function emitEvent(_0x4e84f9){return function(_0x437731,_0x430fdd,_0x282a1e){_0x437731[_0xabc4('0x4')]({'attributes':['id'],'raw':!![]})[_0xabc4('0x5')](function(_0x1a33c4){_0x437731[_0xabc4('0x6')](_0xabc4('0x7'),_0x1a33c4[_0xabc4('0x8')](function(_0xfd0e7d){return{'id':_0xfd0e7d['id']};}));return WhatsappMessage[_0xabc4('0x9')]({'where':{'WhatsappInteractionId':_0x437731['id'],'direction':'in','read':![]},'raw':!![]});})[_0xabc4('0x5')](function(_0x4067e1){_0x437731[_0xabc4('0x6')](_0xabc4('0xa'),_0x4067e1[_0xabc4('0xb')]);WhatsappInteractionEvents[_0xabc4('0xc')](_0x4e84f9+':'+_0x437731['id'],_0x437731);WhatsappInteractionEvents[_0xabc4('0xc')](_0x4e84f9,_0x437731);_0x282a1e(null);})[_0xabc4('0xd')](_0x282a1e(null));};}for(var e in events){if(events[_0xabc4('0xe')](e)){var event=events[e];WhatsappInteraction[_0xabc4('0xf')](e,emitEvent(event));}}module[_0xabc4('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
index a26bd03..26d57fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22fb=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x22fb,0x18f));var _0xb22f=function(_0xb917d0,_0x1872fc){_0xb917d0=_0xb917d0-0x0;var _0x3572e2=_0x22fb[_0xb917d0];return _0x3572e2;};'use strict';var _=require(_0xb22f('0x0'));var util=require(_0xb22f('0x1'));var logger=require(_0xb22f('0x2'))('api');var moment=require(_0xb22f('0x3'));var BPromise=require(_0xb22f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb22f('0x5'));var rimraf=require(_0xb22f('0x6'));var config=require(_0xb22f('0x7'));var attributes=require(_0xb22f('0x8'));module[_0xb22f('0x9')]=function(_0x179f8a,_0x3485cd){return _0x179f8a['define'](_0xb22f('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5465c5,_0x37d0ca,_0x8ff9ab){if(_0x5465c5['changed'](_0xb22f('0xb'))){_0x5465c5[_0xb22f('0xc')]=moment()[_0xb22f('0xd')](_0xb22f('0xe'));}_0x8ff9ab(null,_0x5465c5);}}});};
\ No newline at end of file
+var _0x0630=['changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','whatsapp_interactions'];(function(_0x15caa5,_0x206c67){var _0x1200c7=function(_0x209813){while(--_0x209813){_0x15caa5['push'](_0x15caa5['shift']());}};_0x1200c7(++_0x206c67);}(_0x0630,0x9d));var _0x0063=function(_0xbbf92c,_0x2c91f9){_0xbbf92c=_0xbbf92c-0x0;var _0x42f989=_0x0630[_0xbbf92c];return _0x42f989;};'use strict';var _=require(_0x0063('0x0'));var util=require(_0x0063('0x1'));var logger=require(_0x0063('0x2'))(_0x0063('0x3'));var moment=require(_0x0063('0x4'));var BPromise=require(_0x0063('0x5'));var rp=require(_0x0063('0x6'));var fs=require('fs');var path=require(_0x0063('0x7'));var rimraf=require(_0x0063('0x8'));var config=require('../../config/environment');var attributes=require(_0x0063('0x9'));module[_0x0063('0xa')]=function(_0x1f16ba,_0x1237ed){return _0x1f16ba[_0x0063('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x0063('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x400cd1,_0x2b7c6e,_0x5e8b11){if(_0x400cd1[_0x0063('0xd')](_0x0063('0xe'))){_0x400cd1[_0x0063('0xf')]=moment()[_0x0063('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5e8b11(null,_0x400cd1);}}});};
\ No newline at end of file
index f194a34..ed1209a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e88=['jayson/promise','client','redis','defaults','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappInteraction','update','body','options','raw','where','attributes','UpdateWhatsappInteraction','debug','AddTagsToWhatsappInteraction','find','then','addTags','omit','ids','spread','AddTags','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x546a15,_0x2ef742){var _0x539417=function(_0x18cad6){while(--_0x18cad6){_0x546a15['push'](_0x546a15['shift']());}};_0x539417(++_0x2ef742);}(_0x0e88,0x104));var _0x80e8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0e88[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x80e8('0x0'));var util=require(_0x80e8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80e8('0x2'))['db'];var utils=require(_0x80e8('0x3'));var logger=require(_0x80e8('0x4'))(_0x80e8('0x5'));var config=require('../../config/environment');var jayson=require(_0x80e8('0x6'));var client=jayson[_0x80e8('0x7')]['http']({'port':0x232a});config[_0x80e8('0x8')]=_[_0x80e8('0x9')](config[_0x80e8('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80e8('0x8')]));require('./whatsappInteraction.socket')[_0x80e8('0xa')](socket);function respondWithRpcPromise(_0x50f220,_0x1e4e40,_0x134f33){return new BPromise(function(_0x47ec2f,_0x4b7e20){return client[_0x80e8('0xb')](_0x50f220,_0x134f33)['then'](function(_0x5c1ee0){logger[_0x80e8('0xc')](_0x80e8('0xd'),_0x1e4e40,_0x80e8('0xe'));logger['debug'](_0x80e8('0xf'),_0x1e4e40,'request\x20sent',JSON[_0x80e8('0x10')](_0x5c1ee0));if(_0x5c1ee0['error']){if(_0x5c1ee0[_0x80e8('0x11')][_0x80e8('0x12')]===0x1f4){logger['error'](_0x80e8('0xd'),_0x1e4e40,_0x5c1ee0['error'][_0x80e8('0x13')]);return _0x4b7e20(_0x5c1ee0[_0x80e8('0x11')][_0x80e8('0x13')]);}logger[_0x80e8('0x11')](_0x80e8('0xd'),_0x1e4e40,_0x5c1ee0['error']['message']);return _0x47ec2f(_0x5c1ee0[_0x80e8('0x11')]['message']);}else{logger[_0x80e8('0xc')](_0x80e8('0xd'),_0x1e4e40,_0x80e8('0xe'));_0x47ec2f(_0x5c1ee0[_0x80e8('0x14')][_0x80e8('0x13')]);}})['catch'](function(_0x5ad2b0){logger[_0x80e8('0x11')](_0x80e8('0xd'),_0x1e4e40,_0x5ad2b0);_0x4b7e20(_0x5ad2b0);});});}exports['UpdateWhatsappInteraction']=function(_0x34dcbd){var _0x32c9e7=this;return new Promise(function(_0x41fccb,_0x2f6382){return db[_0x80e8('0x15')][_0x80e8('0x16')](_0x34dcbd[_0x80e8('0x17')],{'raw':_0x34dcbd[_0x80e8('0x18')]?_0x34dcbd[_0x80e8('0x18')][_0x80e8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34dcbd[_0x80e8('0x18')]?_0x34dcbd[_0x80e8('0x18')][_0x80e8('0x1a')]||null:null,'attributes':_0x34dcbd['options']?_0x34dcbd[_0x80e8('0x18')][_0x80e8('0x1b')]||null:null,'limit':_0x34dcbd[_0x80e8('0x18')]?_0x34dcbd[_0x80e8('0x18')]['limit']||null:null})['then'](function(_0x37eb01){logger[_0x80e8('0xc')](_0x80e8('0x1c'),_0x34dcbd);logger[_0x80e8('0x1d')](_0x80e8('0x1c'),_0x34dcbd,JSON[_0x80e8('0x10')](_0x37eb01));_0x41fccb(_0x37eb01);})['catch'](function(_0xe4af02){logger['error'](_0x80e8('0x1c'),_0xe4af02[_0x80e8('0x13')],_0x34dcbd);_0x2f6382(_0x32c9e7['error'](0x1f4,_0xe4af02[_0x80e8('0x13')]));});});};exports[_0x80e8('0x1e')]=function(_0x2cd916){return new Promise(function(_0x3fd8f7,_0x550242){return db[_0x80e8('0x15')][_0x80e8('0x1f')]({'where':_0x2cd916[_0x80e8('0x18')]?_0x2cd916[_0x80e8('0x18')][_0x80e8('0x1a')]||null:null})[_0x80e8('0x20')](function(_0xbb2fb3){if(_0xbb2fb3){return _0xbb2fb3[_0x80e8('0x21')](_0x2cd916[_0x80e8('0x17')]['ids'],_[_0x80e8('0x22')](_0x2cd916['body'],[_0x80e8('0x23'),'id'])||{});}})[_0x80e8('0x24')](function(_0x2536ca){logger[_0x80e8('0xc')](_0x80e8('0x25'),_0x2cd916);logger[_0x80e8('0x1d')]('AddTags',_0x2cd916,JSON['stringify'](_0x2536ca));_0x3fd8f7(_0x2536ca);})['catch'](function(_0x5528eb){logger['error'](_0x80e8('0x25'),_0x5528eb[_0x80e8('0x13')],_0x2cd916);_0x550242(_this['error'](0x1f4,_0x5528eb[_0x80e8('0x13')]));});});};
\ No newline at end of file
+var _0xfdee=['then','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find'];(function(_0x3f2390,_0x218e3c){var _0x5f14be=function(_0x56d907){while(--_0x56d907){_0x3f2390['push'](_0x3f2390['shift']());}};_0x5f14be(++_0x218e3c);}(_0xfdee,0xe0));var _0xefde=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0xfdee[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0xefde('0x0'));var util=require(_0xefde('0x1'));var moment=require(_0xefde('0x2'));var BPromise=require(_0xefde('0x3'));var rs=require(_0xefde('0x4'));var fs=require('fs');var Redis=require(_0xefde('0x5'));var db=require(_0xefde('0x6'))['db'];var utils=require(_0xefde('0x7'));var logger=require(_0xefde('0x8'))(_0xefde('0x9'));var config=require(_0xefde('0xa'));var jayson=require(_0xefde('0xb'));var client=jayson[_0xefde('0xc')][_0xefde('0xd')]({'port':0x232a});config[_0xefde('0xe')]=_[_0xefde('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xefde('0x10'))(new Redis(config[_0xefde('0xe')]));require(_0xefde('0x11'))[_0xefde('0x12')](socket);function respondWithRpcPromise(_0x45937a,_0x28080f,_0x219abe){return new BPromise(function(_0x316b5f,_0x43a3b4){return client['request'](_0x45937a,_0x219abe)['then'](function(_0x32df34){logger[_0xefde('0x13')](_0xefde('0x14'),_0x28080f,_0xefde('0x15'));logger[_0xefde('0x16')](_0xefde('0x17'),_0x28080f,_0xefde('0x15'),JSON[_0xefde('0x18')](_0x32df34));if(_0x32df34[_0xefde('0x19')]){if(_0x32df34['error'][_0xefde('0x1a')]===0x1f4){logger['error'](_0xefde('0x14'),_0x28080f,_0x32df34[_0xefde('0x19')][_0xefde('0x1b')]);return _0x43a3b4(_0x32df34[_0xefde('0x19')]['message']);}logger['error'](_0xefde('0x14'),_0x28080f,_0x32df34['error'][_0xefde('0x1b')]);return _0x316b5f(_0x32df34['error'][_0xefde('0x1b')]);}else{logger[_0xefde('0x13')](_0xefde('0x14'),_0x28080f,_0xefde('0x15'));_0x316b5f(_0x32df34[_0xefde('0x1c')][_0xefde('0x1b')]);}})[_0xefde('0x1d')](function(_0x1ec39e){logger[_0xefde('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x28080f,_0x1ec39e);_0x43a3b4(_0x1ec39e);});});}exports[_0xefde('0x1e')]=function(_0x5087cf){var _0x480c5a=this;return new Promise(function(_0x1a4bf6,_0x4bd375){return db[_0xefde('0x1f')]['update'](_0x5087cf[_0xefde('0x20')],{'raw':_0x5087cf[_0xefde('0x21')]?_0x5087cf[_0xefde('0x21')][_0xefde('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5087cf[_0xefde('0x21')]?_0x5087cf['options'][_0xefde('0x23')]||null:null,'attributes':_0x5087cf['options']?_0x5087cf['options'][_0xefde('0x24')]||null:null,'limit':_0x5087cf['options']?_0x5087cf[_0xefde('0x21')][_0xefde('0x25')]||null:null})['then'](function(_0x15d13f){logger[_0xefde('0x13')](_0xefde('0x1e'),_0x5087cf);logger[_0xefde('0x16')](_0xefde('0x1e'),_0x5087cf,JSON['stringify'](_0x15d13f));_0x1a4bf6(_0x15d13f);})['catch'](function(_0x4d986b){logger[_0xefde('0x19')](_0xefde('0x1e'),_0x4d986b[_0xefde('0x1b')],_0x5087cf);_0x4bd375(_0x480c5a[_0xefde('0x19')](0x1f4,_0x4d986b[_0xefde('0x1b')]));});});};exports[_0xefde('0x26')]=function(_0xad7430){return new Promise(function(_0x527861,_0x2caaec){return db[_0xefde('0x1f')][_0xefde('0x27')]({'where':_0xad7430[_0xefde('0x21')]?_0xad7430['options'][_0xefde('0x23')]||null:null})[_0xefde('0x28')](function(_0x102838){if(_0x102838){return _0x102838['addTags'](_0xad7430['body'][_0xefde('0x29')],_[_0xefde('0x2a')](_0xad7430[_0xefde('0x20')],[_0xefde('0x29'),'id'])||{});}})['spread'](function(_0x18e4d3){logger['info']('AddTags',_0xad7430);logger['debug'](_0xefde('0x2b'),_0xad7430,JSON['stringify'](_0x18e4d3));_0x527861(_0x18e4d3);})['catch'](function(_0x2a7434){logger[_0xefde('0x19')]('AddTags',_0x2a7434[_0xefde('0x1b')],_0xad7430);_0x2caaec(_this['error'](0x1f4,_0x2a7434[_0xefde('0x1b')]));});});};
\ No newline at end of file
index fd5232e..584f2f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63bf=['register','update'];(function(_0x4f8c48,_0x559fff){var _0x556716=function(_0x3dc0f6){while(--_0x3dc0f6){_0x4f8c48['push'](_0x4f8c48['shift']());}};_0x556716(++_0x559fff);}(_0x63bf,0xcd));var _0xf63b=function(_0x412af2,_0x178fa3){_0x412af2=_0x412af2-0x0;var _0x6e4a0e=_0x63bf[_0x412af2];return _0x6e4a0e;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0xf63b('0x0')];function createListener(_0x2f18c1,_0xef1c71){return function(_0x138ae0){_0xef1c71['emit'](_0x2f18c1,_0x138ae0);};}function removeListener(_0x5b9aa3,_0x1ba533){return function(){WhatsappInteractionEvents['removeListener'](_0x5b9aa3,_0x1ba533);};}exports[_0xf63b('0x1')]=function(_0x2f0f52){for(var _0x4f84c0=0x0,_0x2089ac=events['length'];_0x4f84c0<_0x2089ac;_0x4f84c0++){var _0xb01ad8=events[_0x4f84c0];var _0x531c3f=createListener('whatsappInteraction:'+_0xb01ad8,_0x2f0f52);WhatsappInteractionEvents['on'](_0xb01ad8,_0x531c3f);}};
\ No newline at end of file
+var _0xe2b9=['removeListener','register','length','./whatsappInteraction.events','save','remove','update'];(function(_0xc298ad,_0xea4dc2){var _0x11b2e6=function(_0xe2314f){while(--_0xe2314f){_0xc298ad['push'](_0xc298ad['shift']());}};_0x11b2e6(++_0xea4dc2);}(_0xe2b9,0xdc));var _0x9e2b=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xe2b9[_0x36f47c];return _0x296c55;};'use strict';var WhatsappInteractionEvents=require(_0x9e2b('0x0'));var events=[_0x9e2b('0x1'),_0x9e2b('0x2'),_0x9e2b('0x3')];function createListener(_0x4a47a2,_0x19832a){return function(_0x79dc1e){_0x19832a['emit'](_0x4a47a2,_0x79dc1e);};}function removeListener(_0x3a3fe7,_0x31e6d6){return function(){WhatsappInteractionEvents[_0x9e2b('0x4')](_0x3a3fe7,_0x31e6d6);};}exports[_0x9e2b('0x5')]=function(_0x373320){for(var _0x5da6d2=0x0,_0x36d14e=events[_0x9e2b('0x6')];_0x5da6d2<_0x36d14e;_0x5da6d2++){var _0x65dca2=events[_0x5da6d2];var _0x392a98=createListener('whatsappInteraction:'+_0x65dca2,_0x373320);WhatsappInteractionEvents['on'](_0x65dca2,_0x392a98);}};
\ No newline at end of file
index a724648..91e49d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3a1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','whatsapp','whatsappmessage:create','create','post','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0xa3a1,0x91));var _0x1a3a=function(_0x1306ea,_0x5ba51e){_0x1306ea=_0x1306ea-0x0;var _0xfdded6=_0xa3a1[_0x1306ea];return _0xfdded6;};'use strict';var multer=require(_0x1a3a('0x0'));var util=require(_0x1a3a('0x1'));var path=require('path');var timeout=require(_0x1a3a('0x2'));var express=require(_0x1a3a('0x3'));var router=express[_0x1a3a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a3a('0x5'));var interaction=require(_0x1a3a('0x6'));var config=require(_0x1a3a('0x7'));var controller=require(_0x1a3a('0x8'));router[_0x1a3a('0x9')]('/',auth[_0x1a3a('0xa')](),controller[_0x1a3a('0xb')]);router[_0x1a3a('0x9')](_0x1a3a('0xc'),auth['isAuthenticated'](),controller[_0x1a3a('0xd')]);router[_0x1a3a('0x9')](_0x1a3a('0xe'),auth['isAuthenticated'](),controller[_0x1a3a('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x1a3a('0x10')](_0x1a3a('0x11'),_0x1a3a('0x12')),controller[_0x1a3a('0x13')]);router[_0x1a3a('0x14')]('/:id/status',controller[_0x1a3a('0x15')]);router[_0x1a3a('0x16')](_0x1a3a('0xe'),auth[_0x1a3a('0xa')](),controller['update']);router['put'](_0x1a3a('0x17'),auth[_0x1a3a('0xa')](),controller[_0x1a3a('0x18')]);router[_0x1a3a('0x16')](_0x1a3a('0x19'),auth[_0x1a3a('0xa')](),controller[_0x1a3a('0x1a')]);router[_0x1a3a('0x1b')](_0x1a3a('0xe'),auth[_0x1a3a('0xa')](),controller[_0x1a3a('0x1c')]);module[_0x1a3a('0x1d')]=router;
\ No newline at end of file
+var _0x9533=['/describe','/:id','post','whatsappmessage:create','create','/:id/status','status','put','/:id/accept','accept','reject','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1e15ea,_0x15ff8d){var _0x277c0b=function(_0x2fbc86){while(--_0x2fbc86){_0x1e15ea['push'](_0x1e15ea['shift']());}};_0x277c0b(++_0x15ff8d);}(_0x9533,0xe8));var _0x3953=function(_0x3e76f9,_0x5711b4){_0x3e76f9=_0x3e76f9-0x0;var _0x6b51bd=_0x9533[_0x3e76f9];return _0x6b51bd;};'use strict';var multer=require(_0x3953('0x0'));var util=require(_0x3953('0x1'));var path=require(_0x3953('0x2'));var timeout=require(_0x3953('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3953('0x4'));var auth=require(_0x3953('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3953('0x6'));var controller=require('./whatsappMessage.controller');router[_0x3953('0x7')]('/',auth[_0x3953('0x8')](),controller[_0x3953('0x9')]);router[_0x3953('0x7')](_0x3953('0xa'),auth[_0x3953('0x8')](),controller['describe']);router[_0x3953('0x7')](_0x3953('0xb'),auth[_0x3953('0x8')](),controller['show']);router[_0x3953('0xc')]('/',auth[_0x3953('0x8')](),interaction['tracked']('whatsapp',_0x3953('0xd')),controller[_0x3953('0xe')]);router[_0x3953('0xc')](_0x3953('0xf'),controller[_0x3953('0x10')]);router[_0x3953('0x11')]('/:id',auth[_0x3953('0x8')](),controller['update']);router[_0x3953('0x11')](_0x3953('0x12'),auth[_0x3953('0x8')](),controller[_0x3953('0x13')]);router['put']('/:id/reject',auth[_0x3953('0x8')](),controller[_0x3953('0x14')]);router[_0x3953('0x15')](_0x3953('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 589a0c2..881ae14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x877f=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3754b5,_0x19ac16){var _0x2a31b4=function(_0x3af3de){while(--_0x3af3de){_0x3754b5['push'](_0x3754b5['shift']());}};_0x2a31b4(++_0x19ac16);}(_0x877f,0x12d));var _0xf877=function(_0x311904,_0x382836){_0x311904=_0x311904-0x0;var _0x52cf2c=_0x877f[_0x311904];return _0x52cf2c;};'use strict';var Sequelize=require(_0xf877('0x0'));module[_0xf877('0x1')]={'body':{'type':Sequelize[_0xf877('0x2')](_0xf877('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf877('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf877('0x5')]('in',_0xf877('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xf877('0x7')]},'readAt':{'type':Sequelize[_0xf877('0x8')]},'secret':{'type':Sequelize[_0xf877('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf877('0x7')]},'providerResponse':{'type':Sequelize[_0xf877('0x2')]}};
\ No newline at end of file
+var _0xe68b=['medium','BOOLEAN','out','STRING','sequelize','exports','TEXT'];(function(_0x41cfc3,_0x126ba5){var _0x231fd1=function(_0x20c883){while(--_0x20c883){_0x41cfc3['push'](_0x41cfc3['shift']());}};_0x231fd1(++_0x126ba5);}(_0xe68b,0x6d));var _0xbe68=function(_0x236980,_0x1ab39f){_0x236980=_0x236980-0x0;var _0x521aab=_0xe68b[_0x236980];return _0x521aab;};'use strict';var Sequelize=require(_0xbe68('0x0'));module[_0xbe68('0x1')]={'body':{'type':Sequelize[_0xbe68('0x2')](_0xbe68('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe68('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe68('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbe68('0x6')](0xbe)},'phone':{'type':Sequelize[_0xbe68('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xbe68('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbe68('0x6')]},'providerResponse':{'type':Sequelize[_0xbe68('0x2')]}};
\ No newline at end of file
index 6b208a3..3d29db0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea70=['message','WhatsappMessage,\x20%s,\x20%s','info','result','sendStatus','end','status','json','offset','limit','undefined','count','reject','save','update','destroy','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','body','find','whatsapp-interactions','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','WhatsappInteraction','WhatsappInteractionId','UserId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','internal','manual','format','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','RejectMessage','SELECT','email','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','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','redis','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0xea70,0x175));var _0x0ea7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xea70[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0ea7('0x0'));var rimraf=require(_0x0ea7('0x1'));var zipdir=require(_0x0ea7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ea7('0x3'));var moment=require('moment');var BPromise=require(_0x0ea7('0x4'));var Mustache=require('mustache');var util=require(_0x0ea7('0x5'));var path=require(_0x0ea7('0x6'));var sox=require(_0x0ea7('0x7'));var csv=require(_0x0ea7('0x8'));var ejs=require(_0x0ea7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ea7('0xa'));var squel=require(_0x0ea7('0xb'));var crypto=require('crypto');var jsforce=require(_0x0ea7('0xc'));var deskjs=require(_0x0ea7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0ea7('0xe'));var Papa=require(_0x0ea7('0xf'));var Redis=require(_0x0ea7('0x10'));var authService=require(_0x0ea7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0ea7('0x12'));var hardwareService=require(_0x0ea7('0x13'));var logger=require(_0x0ea7('0x14'))(_0x0ea7('0x15'));var utils=require(_0x0ea7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0ea7('0x17'));var db=require(_0x0ea7('0x18'))['db'];config[_0x0ea7('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0ea7('0x1a'))(new Redis(config[_0x0ea7('0x19')]));require(_0x0ea7('0x1b'))[_0x0ea7('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0ea7('0x1d')][_0x0ea7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xa6b67f,_0x548dad,_0x5da7aa,_0x23609c){return new BPromise(function(_0x2aa4e9,_0x2f1850){var _0x22fae2=_0x23609c||client;return _0x22fae2[_0x0ea7('0x1f')](_0xa6b67f,_0x5da7aa)[_0x0ea7('0x20')](function(_0x1b1cb5){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x548dad,_0x0ea7('0x21'));logger[_0x0ea7('0x22')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x548dad,_0x0ea7('0x21'),JSON[_0x0ea7('0x23')](_0x1b1cb5));if(_0x1b1cb5[_0x0ea7('0x24')]){if(_0x1b1cb5[_0x0ea7('0x24')][_0x0ea7('0x25')]===0x1f4){logger[_0x0ea7('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x548dad,_0x1b1cb5[_0x0ea7('0x24')][_0x0ea7('0x26')]);return _0x2f1850(_0x1b1cb5[_0x0ea7('0x24')][_0x0ea7('0x26')]);}logger[_0x0ea7('0x24')](_0x0ea7('0x27'),_0x548dad,_0x1b1cb5[_0x0ea7('0x24')][_0x0ea7('0x26')]);return _0x2aa4e9(_0x1b1cb5['error'][_0x0ea7('0x26')]);}else{logger[_0x0ea7('0x28')](_0x0ea7('0x27'),_0x548dad,'request\x20sent');_0x2aa4e9(_0x1b1cb5[_0x0ea7('0x29')][_0x0ea7('0x26')]);}})['catch'](function(_0x3ba808){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x548dad,_0x3ba808);_0x2f1850(_0x3ba808);});});}function respondWithStatusCode(_0x5a6a6d,_0x32b956){_0x32b956=_0x32b956||0xcc;return function(_0x36ff0a){if(_0x36ff0a){return _0x5a6a6d[_0x0ea7('0x2a')](_0x32b956);}return _0x5a6a6d['status'](_0x32b956)[_0x0ea7('0x2b')]();};}function respondWithResult(_0x375c37,_0x608119){_0x608119=_0x608119||0xc8;return function(_0x1e598c){if(_0x1e598c){return _0x375c37[_0x0ea7('0x2c')](_0x608119)[_0x0ea7('0x2d')](_0x1e598c);}};}function respondWithFilteredResult(_0x247c8c,_0x3fe1e3){return function(_0x4b6c47){if(_0x4b6c47){var _0x27e9fd=typeof _0x3fe1e3[_0x0ea7('0x2e')]==='undefined'&&typeof _0x3fe1e3[_0x0ea7('0x2f')]===_0x0ea7('0x30');var _0x2fa27f=_0x4b6c47[_0x0ea7('0x31')];var _0x30f015=_0x27e9fd?0x0:_0x3fe1e3['offset'];var _0x145caa=_0x27e9fd?_0x4b6c47[_0x0ea7('0x31')]:_0x3fe1e3[_0x0ea7('0x2e')]+_0x3fe1e3[_0x0ea7('0x2f')];var _0x374618;if(_0x145caa>=_0x2fa27f){_0x145caa=_0x2fa27f;_0x374618=0xc8;}else{_0x374618=0xce;}_0x247c8c[_0x0ea7('0x2c')](_0x374618);return _0x247c8c['set']('Content-Range',_0x30f015+'-'+_0x145caa+'/'+_0x2fa27f)[_0x0ea7('0x2d')](_0x4b6c47);}return null;};}function patchUpdates(_0x407a15){return function(_0x3d0aa2){try{jsonpatch['apply'](_0x3d0aa2,_0x407a15,!![]);}catch(_0x4ffe41){return BPromise[_0x0ea7('0x32')](_0x4ffe41);}return _0x3d0aa2[_0x0ea7('0x33')]();};}function saveUpdates(_0x4259ca,_0x5c5f64){return function(_0x5da05c){if(_0x5da05c){return _0x5da05c[_0x0ea7('0x34')](_0x4259ca)[_0x0ea7('0x20')](function(_0x3840db){return _0x3840db;});}return null;};}function removeEntity(_0x10b40c,_0x57152e){return function(_0x1e3d86){if(_0x1e3d86){return _0x1e3d86[_0x0ea7('0x35')]()['then'](function(){_0x10b40c[_0x0ea7('0x2c')](0xcc)[_0x0ea7('0x2b')]();});}};}function handleEntityNotFound(_0x15552e,_0x3f5959){return function(_0x4e9920){if(!_0x4e9920){_0x15552e[_0x0ea7('0x2a')](0x194);}return _0x4e9920;};}function handleError(_0x12377e,_0x4bc878){_0x4bc878=_0x4bc878||0x1f4;return function(_0x467364){logger[_0x0ea7('0x24')](_0x467364[_0x0ea7('0x36')]);if(_0x467364[_0x0ea7('0x37')]){delete _0x467364[_0x0ea7('0x37')];}_0x12377e['status'](_0x4bc878)[_0x0ea7('0x38')](_0x467364);};}exports[_0x0ea7('0x39')]=function(_0xed39d2,_0x13b7d3){var _0x4f6399={},_0x4a9e1e={},_0x435379={'count':0x0,'rows':[]};var _0x145647=_['map'](db[_0x0ea7('0x3a')][_0x0ea7('0x3b')],function(_0x295708){return{'name':_0x295708[_0x0ea7('0x3c')],'type':_0x295708[_0x0ea7('0x3d')][_0x0ea7('0x3e')]};});_0x4a9e1e[_0x0ea7('0x3f')]=_[_0x0ea7('0x40')](_0x145647,_0x0ea7('0x37'));_0x4a9e1e[_0x0ea7('0x41')]=_['keys'](_0xed39d2[_0x0ea7('0x41')]);_0x4a9e1e[_0x0ea7('0x42')]=_['intersection'](_0x4a9e1e[_0x0ea7('0x3f')],_0x4a9e1e[_0x0ea7('0x41')]);_0x4f6399['attributes']=_[_0x0ea7('0x43')](_0x4a9e1e['model'],qs[_0x0ea7('0x44')](_0xed39d2[_0x0ea7('0x41')]['fields']));_0x4f6399['attributes']=_0x4f6399[_0x0ea7('0x45')]['length']?_0x4f6399[_0x0ea7('0x45')]:_0x4a9e1e[_0x0ea7('0x3f')];if(!_0xed39d2[_0x0ea7('0x41')][_0x0ea7('0x46')](_0x0ea7('0x47'))){_0x4f6399[_0x0ea7('0x2f')]=qs[_0x0ea7('0x2f')](_0xed39d2[_0x0ea7('0x41')][_0x0ea7('0x2f')]);_0x4f6399[_0x0ea7('0x2e')]=qs['offset'](_0xed39d2[_0x0ea7('0x41')][_0x0ea7('0x2e')]);}_0x4f6399[_0x0ea7('0x48')]=qs[_0x0ea7('0x49')](_0xed39d2[_0x0ea7('0x41')][_0x0ea7('0x49')]);_0x4f6399[_0x0ea7('0x4a')]=qs[_0x0ea7('0x42')](_['pick'](_0xed39d2[_0x0ea7('0x41')],_0x4a9e1e['filters']),_0x145647);if(_0xed39d2[_0x0ea7('0x41')][_0x0ea7('0x4b')]){_0x4f6399[_0x0ea7('0x4a')]=_['merge'](_0x4f6399[_0x0ea7('0x4a')],{'$or':_['map'](_0x145647,function(_0x205634){if(_0x205634['type']!==_0x0ea7('0x4c')){var _0x457a09={};_0x457a09[_0x205634['name']]={'$like':'%'+_0xed39d2[_0x0ea7('0x41')][_0x0ea7('0x4b')]+'%'};return _0x457a09;}})});}_0x4f6399=_[_0x0ea7('0x4d')]({},_0x4f6399,_0xed39d2['options']);var _0x439a65={'where':_0x4f6399[_0x0ea7('0x4a')]};return db[_0x0ea7('0x3a')][_0x0ea7('0x31')](_0x439a65)[_0x0ea7('0x20')](function(_0x3c09b8){_0x435379['count']=_0x3c09b8;if(_0xed39d2['query'][_0x0ea7('0x4e')]){_0x4f6399[_0x0ea7('0x4f')]=[{'all':!![]}];}return db[_0x0ea7('0x3a')][_0x0ea7('0x50')](_0x4f6399);})['then'](function(_0x23bf39){_0x435379[_0x0ea7('0x51')]=_0x23bf39;return _0x435379;})[_0x0ea7('0x20')](respondWithFilteredResult(_0x13b7d3,_0x4f6399))[_0x0ea7('0x52')](handleError(_0x13b7d3,null));};exports[_0x0ea7('0x53')]=function(_0x355202,_0xc62a25){var _0x1f76bd={'raw':!![],'where':{'id':_0x355202[_0x0ea7('0x54')]['id']}},_0x598fab={};_0x598fab[_0x0ea7('0x3f')]=_[_0x0ea7('0x55')](db[_0x0ea7('0x3a')][_0x0ea7('0x3b')]);_0x598fab[_0x0ea7('0x41')]=_[_0x0ea7('0x55')](_0x355202[_0x0ea7('0x41')]);_0x598fab[_0x0ea7('0x42')]=_['intersection'](_0x598fab[_0x0ea7('0x3f')],_0x598fab['query']);_0x1f76bd[_0x0ea7('0x45')]=_[_0x0ea7('0x43')](_0x598fab[_0x0ea7('0x3f')],qs[_0x0ea7('0x44')](_0x355202[_0x0ea7('0x41')][_0x0ea7('0x44')]));_0x1f76bd['attributes']=_0x1f76bd[_0x0ea7('0x45')][_0x0ea7('0x56')]?_0x1f76bd[_0x0ea7('0x45')]:_0x598fab[_0x0ea7('0x3f')];if(_0x355202[_0x0ea7('0x41')]['includeAll']){_0x1f76bd[_0x0ea7('0x4f')]=[{'all':!![]}];}_0x1f76bd=_['merge']({},_0x1f76bd,_0x355202[_0x0ea7('0x57')]);return db[_0x0ea7('0x3a')]['find'](_0x1f76bd)[_0x0ea7('0x20')](handleEntityNotFound(_0xc62a25,null))[_0x0ea7('0x20')](respondWithResult(_0xc62a25,null))['catch'](handleError(_0xc62a25,null));};exports['create']=function(_0xc2e4bc,_0x12a1d4){return db[_0x0ea7('0x3a')][_0x0ea7('0x58')](_0xc2e4bc[_0x0ea7('0x59')],{})['then'](respondWithResult(_0x12a1d4,0xc9))[_0x0ea7('0x52')](handleError(_0x12a1d4,null));};exports[_0x0ea7('0x34')]=function(_0x2e4363,_0xf9c719){if(_0x2e4363[_0x0ea7('0x59')]['id']){delete _0x2e4363['body']['id'];}return db['WhatsappMessage'][_0x0ea7('0x5a')]({'where':{'id':_0x2e4363[_0x0ea7('0x54')]['id']}})['then'](handleEntityNotFound(_0xf9c719,null))['then'](saveUpdates(_0x2e4363[_0x0ea7('0x59')],null))[_0x0ea7('0x20')](respondWithResult(_0xf9c719,null))[_0x0ea7('0x52')](handleError(_0xf9c719,null));};exports[_0x0ea7('0x35')]=function(_0x4cf3d3,_0x45451b){return db[_0x0ea7('0x3a')][_0x0ea7('0x5a')]({'where':{'id':_0x4cf3d3[_0x0ea7('0x54')]['id']}})[_0x0ea7('0x20')](handleEntityNotFound(_0x45451b,null))['then'](removeEntity(_0x45451b,null))['catch'](handleError(_0x45451b,null));};exports['describe']=function(_0x5958b5,_0x4f0ff8){return db[_0x0ea7('0x3a')]['describe']()[_0x0ea7('0x20')](respondWithResult(_0x4f0ff8,null))[_0x0ea7('0x52')](handleError(_0x4f0ff8,null));};var interaction_log=require(_0x0ea7('0x14'))(_0x0ea7('0x5b'));exports['accept']=function(_0x2e93d6,_0x5b4e10,_0x20af83){var _0x45a5b9={'agent':{},'channel':_0x0ea7('0x5c')};if(_0x2e93d6['body']['id']){delete _0x2e93d6[_0x0ea7('0x59')]['id'];}_0x2e93d6['body'][_0x0ea7('0x5d')]=!![];_0x2e93d6[_0x0ea7('0x59')][_0x0ea7('0x5e')]=moment()['format'](_0x0ea7('0x5f'));_0x2e93d6[_0x0ea7('0x59')]['UserId']=_0x2e93d6[_0x0ea7('0x59')]['UserId']||_0x2e93d6[_0x0ea7('0x60')]['id'];_0x45a5b9[_0x0ea7('0x61')]['id']=_0x2e93d6[_0x0ea7('0x59')]['UserId'];return db[_0x0ea7('0x3a')][_0x0ea7('0x5a')]({'where':{'id':_0x2e93d6['params']['id'],'UserId':null}})[_0x0ea7('0x20')](handleEntityNotFound(_0x5b4e10,null))[_0x0ea7('0x20')](saveUpdates(_0x2e93d6[_0x0ea7('0x59')],null))[_0x0ea7('0x20')](function(_0xe87a0a){if(_0xe87a0a){_0x45a5b9[_0x0ea7('0x26')]=_0xe87a0a[_0x0ea7('0x62')]({'plain':!![]});return db[_0x0ea7('0x63')][_0x0ea7('0x5a')]({'where':{'id':_0xe87a0a[_0x0ea7('0x64')]}});}return null;})[_0x0ea7('0x20')](handleEntityNotFound(_0x5b4e10,null))[_0x0ea7('0x20')](function(_0x18e8d7){if(_0x18e8d7){return _0x18e8d7['update']({'UserId':_0x2e93d6[_0x0ea7('0x59')][_0x0ea7('0x65')],'read1stAt':_[_0x0ea7('0x66')](_0x18e8d7['read1stAt'])?moment()['format'](_0x0ea7('0x5f')):undefined});}return null;})['then'](function(_0x18875c){if(_0x18875c){_0x45a5b9[_0x0ea7('0x67')]=_0x18875c[_0x0ea7('0x62')]({'plain':!![]});interaction_log[_0x0ea7('0x28')](_0x0ea7('0x68'),_0x2e93d6[_0x0ea7('0x60')]['id'],_0x2e93d6[_0x0ea7('0x60')][_0x0ea7('0x37')],_0x2e93d6[_0x0ea7('0x60')][_0x0ea7('0x69')],_0x45a5b9['interaction']['id'],_0x2e93d6[_0x0ea7('0x59')]?JSON[_0x0ea7('0x23')](_0x2e93d6[_0x0ea7('0x59')]):'null');return respondWithRpcPromise(_0x0ea7('0x6a'),_0x0ea7('0x6b'),_0x45a5b9);}return null;})['then'](function(_0x5809c4){var _0x444357=_0x0ea7('0x6c')+_0x5809c4[_0x0ea7('0x26')][_0x0ea7('0x6d')];return db[_0x0ea7('0x6e')]['query'](_0x444357,{'type':db[_0x0ea7('0x6f')][_0x0ea7('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x109386){return _0x109386;});})[_0x0ea7('0x20')](function(_0x9e2036){if(_0x9e2036){_0x45a5b9['message']['contact']=_0x9e2036[0x0];if(!_0x2e93d6[_0x0ea7('0x59')][_0x0ea7('0x65')])return;return db[_0x0ea7('0x71')]['find']({'where':{'id':_0x2e93d6['body']['UserId'],'role':_0x0ea7('0x61')},'attributes':['id','name',_0x0ea7('0x72'),'email',_0x0ea7('0x73')],'raw':!![]});}return null;})[_0x0ea7('0x20')](function(_0x1b46d5){if(!_0x1b46d5)return null;_0x45a5b9[_0x0ea7('0x26')][_0x0ea7('0x61')]=_0x1b46d5;return _0x45a5b9;})[_0x0ea7('0x20')](function(_0x516c4b){if(_0x516c4b){if(_0x2e93d6[_0x0ea7('0x59')][_0x0ea7('0x74')]){_0x45a5b9[_0x0ea7('0x26')]['interface']=util[_0x0ea7('0x75')](_0x0ea7('0x76'),_0x2e93d6['user'][_0x0ea7('0x37')]);_0x45a5b9[_0x0ea7('0x26')][_0x0ea7('0x77')]=_0x45a5b9[_0x0ea7('0x77')];_0x45a5b9[_0x0ea7('0x26')][_0x0ea7('0x78')]=_0x45a5b9['channel'];_0x45a5b9[_0x0ea7('0x26')][_0x0ea7('0x79')]=_0x0ea7('0x7a');return respondWithRpcPromise(_0x0ea7('0x7b'),_0x0ea7('0x7b'),{'event':_0x0ea7('0x7c'),'message':_0x45a5b9[_0x0ea7('0x26')]},client9002)[_0x0ea7('0x20')](function(){return _0x45a5b9;});}return _0x45a5b9;}return null;})[_0x0ea7('0x20')](respondWithResult(_0x5b4e10,null))['catch'](handleError(_0x5b4e10,null));};var interaction_log=require(_0x0ea7('0x14'))('whatsapp-interactions');exports[_0x0ea7('0x32')]=function(_0x2564a0,_0x375dbb,_0x2cdef8){var _0xb6a59={'agent':{},'channel':_0x0ea7('0x5c')};if(_0x2564a0[_0x0ea7('0x59')]['id']){delete _0x2564a0[_0x0ea7('0x59')]['id'];}_0x2564a0['body'][_0x0ea7('0x65')]=_0x2564a0[_0x0ea7('0x59')][_0x0ea7('0x65')]||_0x2564a0[_0x0ea7('0x60')]['id'];_0xb6a59['agent']['id']=_0x2564a0[_0x0ea7('0x59')][_0x0ea7('0x65')];return db[_0x0ea7('0x3a')][_0x0ea7('0x5a')]({'where':{'id':_0x2564a0[_0x0ea7('0x54')]['id'],'UserId':null}})[_0x0ea7('0x20')](handleEntityNotFound(_0x375dbb,null))[_0x0ea7('0x20')](function(_0x258d4c){if(_0x258d4c){_0xb6a59[_0x0ea7('0x26')]=_0x258d4c[_0x0ea7('0x62')]({'plain':!![]});return db[_0x0ea7('0x63')][_0x0ea7('0x5a')]({'where':{'id':_0x258d4c[_0x0ea7('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x375dbb,null))[_0x0ea7('0x20')](function(_0x563d54){if(_0x563d54){_0xb6a59[_0x0ea7('0x67')]=_0x563d54[_0x0ea7('0x62')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2564a0['user']['id'],_0x2564a0[_0x0ea7('0x60')]['name'],_0x2564a0[_0x0ea7('0x60')][_0x0ea7('0x69')],_0xb6a59[_0x0ea7('0x67')]['id'],_0x2564a0[_0x0ea7('0x59')]?JSON[_0x0ea7('0x23')](_0x2564a0[_0x0ea7('0x59')]):'null');return respondWithRpcPromise(_0x0ea7('0x7d'),'rejectMessage',_0xb6a59);}return null;})[_0x0ea7('0x20')](function(_0x16e82c){var _0x2b014d=_0x0ea7('0x6c')+_0x16e82c[_0x0ea7('0x26')][_0x0ea7('0x6d')];return db['sequelize'][_0x0ea7('0x41')](_0x2b014d,{'type':db[_0x0ea7('0x6f')][_0x0ea7('0x70')][_0x0ea7('0x7e')],'raw':!![]})[_0x0ea7('0x20')](function(_0x31aaa3){return _0x31aaa3;});})[_0x0ea7('0x20')](function(_0x5c9b1a){if(_0x5c9b1a){_0xb6a59['message']['contact']=_0x5c9b1a[0x0];if(!_0x2564a0[_0x0ea7('0x59')][_0x0ea7('0x65')])return;return db[_0x0ea7('0x71')][_0x0ea7('0x5a')]({'where':{'id':_0x2564a0['body'][_0x0ea7('0x65')],'role':_0x0ea7('0x61')},'attributes':['id',_0x0ea7('0x37'),'fullname',_0x0ea7('0x7f'),_0x0ea7('0x73')],'raw':!![]});}return null;})['then'](function(_0x89e9ab){if(!_0x89e9ab)return null;_0xb6a59[_0x0ea7('0x26')]['agent']=_0x89e9ab;return _0xb6a59;})[_0x0ea7('0x20')](function(_0x592ca3){if(_0x592ca3){_0x592ca3[_0x0ea7('0x26')][_0x0ea7('0x80')]=util[_0x0ea7('0x75')](_0x0ea7('0x76'),_0x2564a0['user'][_0x0ea7('0x37')]);_0x592ca3[_0x0ea7('0x26')][_0x0ea7('0x77')]=_0xb6a59[_0x0ea7('0x77')];_0x592ca3['message'][_0x0ea7('0x78')]=_0xb6a59['channel'];_0x592ca3['message'][_0x0ea7('0x79')]=_0x0ea7('0x32');respondWithRpcPromise(_0x0ea7('0x7b'),'EventManager',{'event':_0x0ea7('0x81'),'message':_0x592ca3[_0x0ea7('0x26')]},client9002);return _0xb6a59;}return null;})[_0x0ea7('0x20')](respondWithResult(_0x375dbb,null))[_0x0ea7('0x52')](handleError(_0x375dbb,null));};exports[_0x0ea7('0x2c')]=function(_0x2bca2f,_0x239cbf,_0x44bd39){if(_0x2bca2f[_0x0ea7('0x59')]['id']){delete _0x2bca2f[_0x0ea7('0x59')]['id'];}var _0x52f713;return db['WhatsappMessage']['find']({'where':{'id':_0x2bca2f[_0x0ea7('0x54')]['id']}})[_0x0ea7('0x20')](handleEntityNotFound(_0x239cbf,null))[_0x0ea7('0x20')](function(_0x1c6214){if(_0x1c6214){_0x52f713=_0x1c6214;return db[_0x0ea7('0x82')]['find']({'where':{'id':_0x1c6214[_0x0ea7('0x83')]}});}})[_0x0ea7('0x20')](handleEntityNotFound(_0x239cbf,null))[_0x0ea7('0x20')](function(_0x2ec6f9){if(_0x2ec6f9){logger[_0x0ea7('0x22')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x0ea7('0x2c'),_0x0ea7('0x84'),_0x2ec6f9[_0x0ea7('0x3d')],util[_0x0ea7('0x85')](_0x2bca2f['body'],{'showHidden':![],'depth':null}));switch(_0x2ec6f9[_0x0ea7('0x3d')]){case _0x0ea7('0x86'):if(_0x2bca2f['body']['MessageSid']&&_0x2bca2f[_0x0ea7('0x59')]['MessageSid']===_0x52f713['messageId']&&_0x2bca2f[_0x0ea7('0x59')][_0x0ea7('0x87')]&&_0x2bca2f[_0x0ea7('0x59')][_0x0ea7('0x87')]===_0x0ea7('0x5d')){return _0x52f713[_0x0ea7('0x34')]({'read':!![]});}else{logger[_0x0ea7('0x24')](_0x0ea7('0x88'),_0x0ea7('0x2c'),_0x0ea7('0x86'),util[_0x0ea7('0x85')](_0x2bca2f[_0x0ea7('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x52f713;}})[_0x0ea7('0x20')](respondWithResult(_0x239cbf,null))[_0x0ea7('0x52')](handleError(_0x239cbf,null));};
\ No newline at end of file
+var _0xa884=['api','../../config/utils','../../config/environment','defaults','redis','localhost','./whatsappMessage.socket','register','http','client','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','name','index','WhatsappMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','fields','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','manual','SIP/%s','channel','EventManager','WhatsappInteraction','rejectMessage','contact','User','motionChannel','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x347678,_0x9ddec4){var _0x3b08cc=function(_0x513dbe){while(--_0x513dbe){_0x347678['push'](_0x347678['shift']());}};_0x3b08cc(++_0x9ddec4);}(_0xa884,0x182));var _0x4a88=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0xa884[_0x2df1f2];return _0x38652b;};'use strict';var emlformat=require(_0x4a88('0x0'));var rimraf=require(_0x4a88('0x1'));var zipdir=require(_0x4a88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a88('0x3'));var moment=require(_0x4a88('0x4'));var BPromise=require(_0x4a88('0x5'));var Mustache=require(_0x4a88('0x6'));var util=require(_0x4a88('0x7'));var path=require(_0x4a88('0x8'));var sox=require('sox');var csv=require(_0x4a88('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a88('0xa'));var squel=require('squel');var crypto=require(_0x4a88('0xb'));var jsforce=require(_0x4a88('0xc'));var deskjs=require(_0x4a88('0xd'));var toCsv=require(_0x4a88('0x9'));var querystring=require(_0x4a88('0xe'));var Papa=require(_0x4a88('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4a88('0x10'));var as=require(_0x4a88('0x11'));var hardwareService=require(_0x4a88('0x12'));var logger=require('../../config/logger')(_0x4a88('0x13'));var utils=require(_0x4a88('0x14'));var config=require(_0x4a88('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x4a88('0x16')](config[_0x4a88('0x17')],{'host':_0x4a88('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a88('0x17')]));require(_0x4a88('0x19'))[_0x4a88('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4a88('0x1b')]({'port':0x232c});var client9002=jayson[_0x4a88('0x1c')][_0x4a88('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x28e54d,_0x4220f6,_0x5569b4,_0x4a8ab1){return new BPromise(function(_0x20f84a,_0x5cb531){var _0x2927da=_0x4a8ab1||client;return _0x2927da[_0x4a88('0x1d')](_0x28e54d,_0x5569b4)[_0x4a88('0x1e')](function(_0x1551e4){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4220f6,_0x4a88('0x1f'));logger[_0x4a88('0x20')](_0x4a88('0x21'),_0x4220f6,_0x4a88('0x1f'),JSON[_0x4a88('0x22')](_0x1551e4));if(_0x1551e4[_0x4a88('0x23')]){if(_0x1551e4[_0x4a88('0x23')][_0x4a88('0x24')]===0x1f4){logger['error'](_0x4a88('0x25'),_0x4220f6,_0x1551e4[_0x4a88('0x23')][_0x4a88('0x26')]);return _0x5cb531(_0x1551e4['error'][_0x4a88('0x26')]);}logger[_0x4a88('0x23')](_0x4a88('0x25'),_0x4220f6,_0x1551e4['error'][_0x4a88('0x26')]);return _0x20f84a(_0x1551e4[_0x4a88('0x23')][_0x4a88('0x26')]);}else{logger['info'](_0x4a88('0x25'),_0x4220f6,_0x4a88('0x1f'));_0x20f84a(_0x1551e4[_0x4a88('0x27')][_0x4a88('0x26')]);}})[_0x4a88('0x28')](function(_0x5b2d60){logger[_0x4a88('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x4220f6,_0x5b2d60);_0x5cb531(_0x5b2d60);});});}function respondWithStatusCode(_0x19de19,_0x39d24c){_0x39d24c=_0x39d24c||0xcc;return function(_0x16beaf){if(_0x16beaf){return _0x19de19[_0x4a88('0x29')](_0x39d24c);}return _0x19de19['status'](_0x39d24c)['end']();};}function respondWithResult(_0x4ed8b9,_0x45d550){_0x45d550=_0x45d550||0xc8;return function(_0x302f5d){if(_0x302f5d){return _0x4ed8b9[_0x4a88('0x2a')](_0x45d550)[_0x4a88('0x2b')](_0x302f5d);}};}function respondWithFilteredResult(_0x3d8d63,_0x107822){return function(_0x15a072){if(_0x15a072){var _0x1127d5=typeof _0x107822['offset']==='undefined'&&typeof _0x107822[_0x4a88('0x2c')]===_0x4a88('0x2d');var _0x1e5f12=_0x15a072[_0x4a88('0x2e')];var _0xb46a8=_0x1127d5?0x0:_0x107822[_0x4a88('0x2f')];var _0x4df88f=_0x1127d5?_0x15a072[_0x4a88('0x2e')]:_0x107822[_0x4a88('0x2f')]+_0x107822['limit'];var _0x390380;if(_0x4df88f>=_0x1e5f12){_0x4df88f=_0x1e5f12;_0x390380=0xc8;}else{_0x390380=0xce;}_0x3d8d63[_0x4a88('0x2a')](_0x390380);return _0x3d8d63[_0x4a88('0x30')](_0x4a88('0x31'),_0xb46a8+'-'+_0x4df88f+'/'+_0x1e5f12)[_0x4a88('0x2b')](_0x15a072);}return null;};}function patchUpdates(_0xf025cc){return function(_0x138ff4){try{jsonpatch[_0x4a88('0x32')](_0x138ff4,_0xf025cc,!![]);}catch(_0x44a6ee){return BPromise[_0x4a88('0x33')](_0x44a6ee);}return _0x138ff4['save']();};}function saveUpdates(_0x533a13,_0x2b26d1){return function(_0x278047){if(_0x278047){return _0x278047[_0x4a88('0x34')](_0x533a13)[_0x4a88('0x1e')](function(_0x34e820){return _0x34e820;});}return null;};}function removeEntity(_0xfe97bf,_0x2056ff){return function(_0xa70d84){if(_0xa70d84){return _0xa70d84[_0x4a88('0x35')]()[_0x4a88('0x1e')](function(){_0xfe97bf[_0x4a88('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5e65,_0x3538a9){return function(_0x4a2536){if(!_0x4a2536){_0x3c5e65[_0x4a88('0x29')](0x194);}return _0x4a2536;};}function handleError(_0x5b1eea,_0x596740){_0x596740=_0x596740||0x1f4;return function(_0x4fec81){logger[_0x4a88('0x23')](_0x4fec81['stack']);if(_0x4fec81[_0x4a88('0x36')]){delete _0x4fec81['name'];}_0x5b1eea[_0x4a88('0x2a')](_0x596740)['send'](_0x4fec81);};}exports[_0x4a88('0x37')]=function(_0x44efe5,_0x33e5bb){var _0x58ab80={},_0x5e5db9={},_0x501b19={'count':0x0,'rows':[]};var _0x5aa691=_['map'](db[_0x4a88('0x38')][_0x4a88('0x39')],function(_0x2d4d34){return{'name':_0x2d4d34['fieldName'],'type':_0x2d4d34[_0x4a88('0x3a')][_0x4a88('0x3b')]};});_0x5e5db9[_0x4a88('0x3c')]=_[_0x4a88('0x3d')](_0x5aa691,_0x4a88('0x36'));_0x5e5db9[_0x4a88('0x3e')]=_[_0x4a88('0x3f')](_0x44efe5['query']);_0x5e5db9[_0x4a88('0x40')]=_[_0x4a88('0x41')](_0x5e5db9[_0x4a88('0x3c')],_0x5e5db9['query']);_0x58ab80[_0x4a88('0x42')]=_[_0x4a88('0x41')](_0x5e5db9[_0x4a88('0x3c')],qs['fields'](_0x44efe5[_0x4a88('0x3e')]['fields']));_0x58ab80[_0x4a88('0x42')]=_0x58ab80[_0x4a88('0x42')][_0x4a88('0x43')]?_0x58ab80[_0x4a88('0x42')]:_0x5e5db9[_0x4a88('0x3c')];if(!_0x44efe5[_0x4a88('0x3e')][_0x4a88('0x44')](_0x4a88('0x45'))){_0x58ab80[_0x4a88('0x2c')]=qs[_0x4a88('0x2c')](_0x44efe5['query'][_0x4a88('0x2c')]);_0x58ab80['offset']=qs[_0x4a88('0x2f')](_0x44efe5['query'][_0x4a88('0x2f')]);}_0x58ab80[_0x4a88('0x46')]=qs[_0x4a88('0x47')](_0x44efe5[_0x4a88('0x3e')][_0x4a88('0x47')]);_0x58ab80[_0x4a88('0x48')]=qs[_0x4a88('0x40')](_[_0x4a88('0x49')](_0x44efe5[_0x4a88('0x3e')],_0x5e5db9[_0x4a88('0x40')]),_0x5aa691);if(_0x44efe5[_0x4a88('0x3e')][_0x4a88('0x4a')]){_0x58ab80['where']=_[_0x4a88('0x4b')](_0x58ab80[_0x4a88('0x48')],{'$or':_[_0x4a88('0x3d')](_0x5aa691,function(_0xd4f649){if(_0xd4f649['type']!==_0x4a88('0x4c')){var _0x39ff03={};_0x39ff03[_0xd4f649[_0x4a88('0x36')]]={'$like':'%'+_0x44efe5[_0x4a88('0x3e')]['filter']+'%'};return _0x39ff03;}})});}_0x58ab80=_[_0x4a88('0x4b')]({},_0x58ab80,_0x44efe5[_0x4a88('0x4d')]);var _0xe7b2a4={'where':_0x58ab80[_0x4a88('0x48')]};return db[_0x4a88('0x38')][_0x4a88('0x2e')](_0xe7b2a4)[_0x4a88('0x1e')](function(_0x236258){_0x501b19[_0x4a88('0x2e')]=_0x236258;if(_0x44efe5[_0x4a88('0x3e')][_0x4a88('0x4e')]){_0x58ab80[_0x4a88('0x4f')]=[{'all':!![]}];}return db[_0x4a88('0x38')][_0x4a88('0x50')](_0x58ab80);})['then'](function(_0x135421){_0x501b19[_0x4a88('0x51')]=_0x135421;return _0x501b19;})[_0x4a88('0x1e')](respondWithFilteredResult(_0x33e5bb,_0x58ab80))['catch'](handleError(_0x33e5bb,null));};exports['show']=function(_0x3a894d,_0x11f45b){var _0xae7bab={'raw':!![],'where':{'id':_0x3a894d[_0x4a88('0x52')]['id']}},_0x485153={};_0x485153[_0x4a88('0x3c')]=_[_0x4a88('0x3f')](db[_0x4a88('0x38')][_0x4a88('0x39')]);_0x485153['query']=_['keys'](_0x3a894d[_0x4a88('0x3e')]);_0x485153[_0x4a88('0x40')]=_[_0x4a88('0x41')](_0x485153[_0x4a88('0x3c')],_0x485153['query']);_0xae7bab['attributes']=_[_0x4a88('0x41')](_0x485153['model'],qs[_0x4a88('0x53')](_0x3a894d[_0x4a88('0x3e')][_0x4a88('0x53')]));_0xae7bab['attributes']=_0xae7bab[_0x4a88('0x42')][_0x4a88('0x43')]?_0xae7bab['attributes']:_0x485153['model'];if(_0x3a894d[_0x4a88('0x3e')][_0x4a88('0x4e')]){_0xae7bab[_0x4a88('0x4f')]=[{'all':!![]}];}_0xae7bab=_[_0x4a88('0x4b')]({},_0xae7bab,_0x3a894d[_0x4a88('0x4d')]);return db[_0x4a88('0x38')][_0x4a88('0x54')](_0xae7bab)[_0x4a88('0x1e')](handleEntityNotFound(_0x11f45b,null))[_0x4a88('0x1e')](respondWithResult(_0x11f45b,null))['catch'](handleError(_0x11f45b,null));};exports[_0x4a88('0x55')]=function(_0x517412,_0x20ceca){return db[_0x4a88('0x38')][_0x4a88('0x55')](_0x517412[_0x4a88('0x56')],{})['then'](respondWithResult(_0x20ceca,0xc9))['catch'](handleError(_0x20ceca,null));};exports['update']=function(_0x8938d7,_0x58cd3b){if(_0x8938d7[_0x4a88('0x56')]['id']){delete _0x8938d7[_0x4a88('0x56')]['id'];}return db[_0x4a88('0x38')]['find']({'where':{'id':_0x8938d7[_0x4a88('0x52')]['id']}})['then'](handleEntityNotFound(_0x58cd3b,null))[_0x4a88('0x1e')](saveUpdates(_0x8938d7['body'],null))['then'](respondWithResult(_0x58cd3b,null))[_0x4a88('0x28')](handleError(_0x58cd3b,null));};exports[_0x4a88('0x35')]=function(_0xe01e4,_0x150c7f){return db[_0x4a88('0x38')][_0x4a88('0x54')]({'where':{'id':_0xe01e4['params']['id']}})[_0x4a88('0x1e')](handleEntityNotFound(_0x150c7f,null))['then'](removeEntity(_0x150c7f,null))[_0x4a88('0x28')](handleError(_0x150c7f,null));};exports['describe']=function(_0x1d5678,_0x5ac164){return db['WhatsappMessage'][_0x4a88('0x57')]()[_0x4a88('0x1e')](respondWithResult(_0x5ac164,null))[_0x4a88('0x28')](handleError(_0x5ac164,null));};var interaction_log=require(_0x4a88('0x58'))(_0x4a88('0x59'));exports[_0x4a88('0x5a')]=function(_0x4578ad,_0x1d7a53,_0x3da596){var _0x1073f9={'agent':{},'channel':_0x4a88('0x5b')};if(_0x4578ad[_0x4a88('0x56')]['id']){delete _0x4578ad[_0x4a88('0x56')]['id'];}_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5c')]=!![];_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5d')]=moment()[_0x4a88('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5f')]=_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5f')]||_0x4578ad[_0x4a88('0x60')]['id'];_0x1073f9[_0x4a88('0x61')]['id']=_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5f')];return db[_0x4a88('0x38')]['find']({'where':{'id':_0x4578ad['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d7a53,null))['then'](saveUpdates(_0x4578ad[_0x4a88('0x56')],null))[_0x4a88('0x1e')](function(_0x263764){if(_0x263764){_0x1073f9[_0x4a88('0x26')]=_0x263764[_0x4a88('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x4a88('0x54')]({'where':{'id':_0x263764[_0x4a88('0x63')]}});}return null;})[_0x4a88('0x1e')](handleEntityNotFound(_0x1d7a53,null))[_0x4a88('0x1e')](function(_0x3f4ba7){if(_0x3f4ba7){return _0x3f4ba7[_0x4a88('0x34')]({'UserId':_0x4578ad[_0x4a88('0x56')]['UserId'],'read1stAt':_[_0x4a88('0x64')](_0x3f4ba7[_0x4a88('0x65')])?moment()['format'](_0x4a88('0x66')):undefined});}return null;})[_0x4a88('0x1e')](function(_0x4f5006){if(_0x4f5006){_0x1073f9[_0x4a88('0x67')]=_0x4f5006[_0x4a88('0x62')]({'plain':!![]});interaction_log[_0x4a88('0x68')](_0x4a88('0x69'),_0x4578ad[_0x4a88('0x60')]['id'],_0x4578ad[_0x4a88('0x60')]['name'],_0x4578ad[_0x4a88('0x60')]['role'],_0x1073f9[_0x4a88('0x67')]['id'],_0x4578ad['body']?JSON['stringify'](_0x4578ad[_0x4a88('0x56')]):_0x4a88('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x4a88('0x6b'),_0x1073f9);}return null;})[_0x4a88('0x1e')](function(_0x50ea2c){var _0x40a1d5=_0x4a88('0x6c')+_0x50ea2c[_0x4a88('0x26')][_0x4a88('0x6d')];return db[_0x4a88('0x6e')][_0x4a88('0x3e')](_0x40a1d5,{'type':db['Sequelize'][_0x4a88('0x6f')][_0x4a88('0x70')],'raw':!![]})[_0x4a88('0x1e')](function(_0x67d5d8){return _0x67d5d8;});})[_0x4a88('0x1e')](function(_0x1d9777){if(_0x1d9777){_0x1073f9[_0x4a88('0x26')]['contact']=_0x1d9777[0x0];if(!_0x4578ad[_0x4a88('0x56')]['UserId'])return;return db['User'][_0x4a88('0x54')]({'where':{'id':_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5f')],'role':_0x4a88('0x61')},'attributes':['id','name',_0x4a88('0x71'),_0x4a88('0x72'),_0x4a88('0x73')],'raw':!![]});}return null;})['then'](function(_0x5583d0){if(!_0x5583d0)return null;_0x1073f9[_0x4a88('0x26')][_0x4a88('0x61')]=_0x5583d0;return _0x1073f9;})['then'](function(_0x286767){if(_0x286767){if(_0x4578ad['body'][_0x4a88('0x74')]){_0x1073f9[_0x4a88('0x26')]['interface']=util[_0x4a88('0x5e')](_0x4a88('0x75'),_0x4578ad[_0x4a88('0x60')][_0x4a88('0x36')]);_0x1073f9[_0x4a88('0x26')][_0x4a88('0x76')]=_0x1073f9[_0x4a88('0x76')];_0x1073f9[_0x4a88('0x26')]['motionChannel']=_0x1073f9['channel'];_0x1073f9[_0x4a88('0x26')]['event']=_0x4a88('0x5a');return respondWithRpcPromise(_0x4a88('0x77'),_0x4a88('0x77'),{'event':'acceptmessage','message':_0x1073f9[_0x4a88('0x26')]},client9002)['then'](function(){return _0x1073f9;});}return _0x1073f9;}return null;})[_0x4a88('0x1e')](respondWithResult(_0x1d7a53,null))['catch'](handleError(_0x1d7a53,null));};var interaction_log=require(_0x4a88('0x58'))('whatsapp-interactions');exports['reject']=function(_0x1b4e91,_0x5579d0,_0x269dc4){var _0x460f5a={'agent':{},'channel':_0x4a88('0x5b')};if(_0x1b4e91[_0x4a88('0x56')]['id']){delete _0x1b4e91[_0x4a88('0x56')]['id'];}_0x1b4e91['body'][_0x4a88('0x5f')]=_0x1b4e91[_0x4a88('0x56')]['UserId']||_0x1b4e91[_0x4a88('0x60')]['id'];_0x460f5a[_0x4a88('0x61')]['id']=_0x1b4e91[_0x4a88('0x56')][_0x4a88('0x5f')];return db[_0x4a88('0x38')][_0x4a88('0x54')]({'where':{'id':_0x1b4e91[_0x4a88('0x52')]['id'],'UserId':null}})[_0x4a88('0x1e')](handleEntityNotFound(_0x5579d0,null))[_0x4a88('0x1e')](function(_0x449cbe){if(_0x449cbe){_0x460f5a[_0x4a88('0x26')]=_0x449cbe[_0x4a88('0x62')]({'plain':!![]});return db[_0x4a88('0x78')][_0x4a88('0x54')]({'where':{'id':_0x449cbe[_0x4a88('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x5579d0,null))[_0x4a88('0x1e')](function(_0x442cbc){if(_0x442cbc){_0x460f5a[_0x4a88('0x67')]=_0x442cbc[_0x4a88('0x62')]({'plain':!![]});interaction_log[_0x4a88('0x68')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b4e91[_0x4a88('0x60')]['id'],_0x1b4e91['user']['name'],_0x1b4e91[_0x4a88('0x60')]['role'],_0x460f5a[_0x4a88('0x67')]['id'],_0x1b4e91[_0x4a88('0x56')]?JSON['stringify'](_0x1b4e91['body']):_0x4a88('0x6a'));return respondWithRpcPromise('RejectMessage',_0x4a88('0x79'),_0x460f5a);}return null;})['then'](function(_0x46a2e6){var _0x44941e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46a2e6['message'][_0x4a88('0x6d')];return db[_0x4a88('0x6e')][_0x4a88('0x3e')](_0x44941e,{'type':db['Sequelize'][_0x4a88('0x6f')][_0x4a88('0x70')],'raw':!![]})[_0x4a88('0x1e')](function(_0xa65766){return _0xa65766;});})['then'](function(_0x2fff10){if(_0x2fff10){_0x460f5a[_0x4a88('0x26')][_0x4a88('0x7a')]=_0x2fff10[0x0];if(!_0x1b4e91[_0x4a88('0x56')][_0x4a88('0x5f')])return;return db[_0x4a88('0x7b')][_0x4a88('0x54')]({'where':{'id':_0x1b4e91['body'][_0x4a88('0x5f')],'role':_0x4a88('0x61')},'attributes':['id','name',_0x4a88('0x71'),_0x4a88('0x72'),_0x4a88('0x73')],'raw':!![]});}return null;})[_0x4a88('0x1e')](function(_0x2f4155){if(!_0x2f4155)return null;_0x460f5a[_0x4a88('0x26')]['agent']=_0x2f4155;return _0x460f5a;})[_0x4a88('0x1e')](function(_0x54319a){if(_0x54319a){_0x54319a[_0x4a88('0x26')]['interface']=util[_0x4a88('0x5e')]('SIP/%s',_0x1b4e91[_0x4a88('0x60')][_0x4a88('0x36')]);_0x54319a['message'][_0x4a88('0x76')]=_0x460f5a['channel'];_0x54319a['message'][_0x4a88('0x7c')]=_0x460f5a[_0x4a88('0x76')];_0x54319a[_0x4a88('0x26')]['event']=_0x4a88('0x33');respondWithRpcPromise('EventManager',_0x4a88('0x77'),{'event':'rejectmessage','message':_0x54319a[_0x4a88('0x26')]},client9002);return _0x460f5a;}return null;})['then'](respondWithResult(_0x5579d0,null))[_0x4a88('0x28')](handleError(_0x5579d0,null));};exports[_0x4a88('0x2a')]=function(_0x4198b1,_0xfe612b,_0x1ee4dc){if(_0x4198b1[_0x4a88('0x56')]['id']){delete _0x4198b1[_0x4a88('0x56')]['id'];}var _0x46fc2d;return db[_0x4a88('0x38')]['find']({'where':{'id':_0x4198b1[_0x4a88('0x52')]['id']}})[_0x4a88('0x1e')](handleEntityNotFound(_0xfe612b,null))[_0x4a88('0x1e')](function(_0x1781ae){if(_0x1781ae){_0x46fc2d=_0x1781ae;return db[_0x4a88('0x7d')][_0x4a88('0x54')]({'where':{'id':_0x1781ae[_0x4a88('0x7e')]}});}})[_0x4a88('0x1e')](handleEntityNotFound(_0xfe612b,null))['then'](function(_0x4ec0f6){if(_0x4ec0f6){logger['debug'](_0x4a88('0x7f'),_0x4a88('0x2a'),_0x4a88('0x80'),_0x4ec0f6[_0x4a88('0x3a')],util[_0x4a88('0x81')](_0x4198b1[_0x4a88('0x56')],{'showHidden':![],'depth':null}));switch(_0x4ec0f6[_0x4a88('0x3a')]){case _0x4a88('0x82'):if(_0x4198b1['body']['MessageSid']&&_0x4198b1[_0x4a88('0x56')][_0x4a88('0x83')]===_0x46fc2d[_0x4a88('0x84')]&&_0x4198b1[_0x4a88('0x56')][_0x4a88('0x85')]&&_0x4198b1['body'][_0x4a88('0x85')]==='read'){return _0x46fc2d[_0x4a88('0x34')]({'read':!![]});}else{logger[_0x4a88('0x23')](_0x4a88('0x86'),_0x4a88('0x2a'),'twilio',util[_0x4a88('0x81')](_0x4198b1[_0x4a88('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x46fc2d;}})[_0x4a88('0x1e')](respondWithResult(_0xfe612b,null))[_0x4a88('0x28')](handleError(_0xfe612b,null));};
\ No newline at end of file
index e54050f..ae4343d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f3a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x15bb86,_0x1be87b){var _0xdadb9d=function(_0x20db70){while(--_0x20db70){_0x15bb86['push'](_0x15bb86['shift']());}};_0xdadb9d(++_0x1be87b);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x38f396,_0x4f302d){_0x38f396=_0x38f396-0x0;var _0x1b21c5=_0x2f3a[_0x38f396];return _0x1b21c5;};'use strict';var EventEmitter=require(_0xa2f3('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xa2f3('0x1')](0x0);var events={'afterCreate':_0xa2f3('0x2'),'afterUpdate':_0xa2f3('0x3'),'afterDestroy':_0xa2f3('0x4')};function emitEvent(_0x17ec7a){return function(_0xdf4c17,_0x50ef95,_0x78edcd){WhatsappMessageEvents['emit'](_0x17ec7a+':'+_0xdf4c17['id'],_0xdf4c17);WhatsappMessageEvents[_0xa2f3('0x5')](_0x17ec7a,_0xdf4c17);_0x78edcd(null);};}for(var e in events){if(events[_0xa2f3('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0xa25c=['WhatsappMessage','setMaxListeners','save','update','remove','hasOwnProperty','exports','../../mysqldb'];(function(_0x2bfed5,_0x15657a){var _0x5e788b=function(_0x6601a8){while(--_0x6601a8){_0x2bfed5['push'](_0x2bfed5['shift']());}};_0x5e788b(++_0x15657a);}(_0xa25c,0x13f));var _0xca25=function(_0x19faae,_0x5697bc){_0x19faae=_0x19faae-0x0;var _0x363543=_0xa25c[_0x19faae];return _0x363543;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xca25('0x0'))['db'][_0xca25('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xca25('0x2')](0x0);var events={'afterCreate':_0xca25('0x3'),'afterUpdate':_0xca25('0x4'),'afterDestroy':_0xca25('0x5')};function emitEvent(_0x2cc2d6){return function(_0x336741,_0x498b8e,_0x41d208){WhatsappMessageEvents['emit'](_0x2cc2d6+':'+_0x336741['id'],_0x336741);WhatsappMessageEvents['emit'](_0x2cc2d6,_0x336741);_0x41d208(null);};}for(var e in events){if(events[_0xca25('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xca25('0x7')]=WhatsappMessageEvents;
\ No newline at end of file
index db30f17..b4accb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4295=['update','createdAt','catch','secret','WhatsappAccount','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','log','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','body','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','then'];(function(_0x338b4b,_0x32f251){var _0x53112e=function(_0x4ab8a3){while(--_0x4ab8a3){_0x338b4b['push'](_0x338b4b['shift']());}};_0x53112e(++_0x32f251);}(_0x4295,0xc3));var _0x5429=function(_0x2cce72,_0x432665){_0x2cce72=_0x2cce72-0x0;var _0xe78e46=_0x4295[_0x2cce72];return _0xe78e46;};'use strict';var _=require(_0x5429('0x0'));var util=require('util');var logger=require(_0x5429('0x1'))(_0x5429('0x2'));var moment=require(_0x5429('0x3'));var BPromise=require('bluebird');var rp=require(_0x5429('0x4'));var fetch=require(_0x5429('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5429('0x6'));var config=require(_0x5429('0x7'));var attributes=require(_0x5429('0x8'));module['exports']=function(_0x24cd12,_0x5d9893){return _0x24cd12[_0x5429('0x9')](_0x5429('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x5429('0xb'),'fields':[_0x5429('0xb')]},{'name':'fti_whatsapp_messages','fields':[_0x5429('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x263778,_0x481ffd,_0x31fde7){var _0x7dc883=_0x24cd12[_0x5429('0xd')];var _0x1bb6b4=_0x263778[_0x5429('0xe')]({'plain':!![]});if(_0x1bb6b4[_0x5429('0xf')]['toLowerCase']()==='in'||_0x1bb6b4[_0x5429('0xf')][_0x5429('0x10')]()===_0x5429('0x11')&&!_0x1bb6b4['secret']&&!_[_0x5429('0x12')](_0x1bb6b4['UserId'])){_0x7dc883[_0x5429('0x13')]['findOne']({'where':{'id':_0x1bb6b4['WhatsappInteractionId']}})[_0x5429('0x14')](function(_0x338281){if(_0x338281){_0x338281[_0x5429('0x15')]({'lastMsgAt':_0x1bb6b4[_0x5429('0x16')],'lastMsgDirection':_0x1bb6b4[_0x5429('0xf')][_0x5429('0x10')]()});}})[_0x5429('0x17')](function(_0x48f684){console['error'](_0x48f684);});}if(_0x1bb6b4[_0x5429('0xf')]===_0x5429('0x11')&&!_0x1bb6b4[_0x5429('0x18')]){var _0x2b3325;_0x7dc883[_0x5429('0x19')]['find']({'where':{'id':_0x1bb6b4['WhatsappAccountId']},'raw':!![]})[_0x5429('0x14')](function(_0x4675f2){_0x2b3325=_0x4675f2;if(_0x2b3325&&_0x2b3325['type']){switch(_0x2b3325[_0x5429('0x1a')]){case'twilio':var _0x5e40f4=require(_0x5429('0x1b'));if(_0x2b3325[_0x5429('0x1c')]&&_0x2b3325['authToken']&&_0x2b3325['phone']){var _0xad8056=new _0x5e40f4(_0x2b3325[_0x5429('0x1c')],_0x2b3325[_0x5429('0x1d')]);_0xad8056[_0x5429('0x1e')][_0x5429('0x1f')]({'body':_0x1bb6b4['body'],'to':_0x5429('0x20')+_0x1bb6b4[_0x5429('0x21')],'from':_0x5429('0x20')+_0x2b3325['phone'],'statusCallback':_0x2b3325[_0x5429('0x22')]+'/api/whatsapp/messages/'+_0x1bb6b4['id']+_0x5429('0x23')+_0x2b3325[_0x5429('0x24')]})[_0x5429('0x14')](function(_0x2949c0){if(_0x2949c0[_0x5429('0x25')]){return _0x263778[_0x5429('0x15')]({'messageId':_0x2949c0[_0x5429('0x25')]});}})[_0x5429('0x17')](function(_0x51b7c5){logger[_0x5429('0x26')](_0x5429('0x27'),_0x5429('0x28'),_0x5429('0x1b'),util[_0x5429('0x29')](_0x51b7c5,{'showHidden':![],'depth':null}));});}else{logger[_0x5429('0x26')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5429('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x5429('0x2a'):var _0x597a56=_0x2b3325[_0x5429('0x1c')];var _0x210278=_0x2b3325['authToken'];var _0x53b2ca=_0x2b3325[_0x5429('0x2b')]+_0x5429('0x2c')+_0x597a56+_0x5429('0x2d');var _0xeb0962={'to':[_0x1bb6b4[_0x5429('0x21')]],'message':{'type':_0x5429('0x2e'),'text':_0x1bb6b4['body']}};var _0x4ea5f8={'method':_0x5429('0x2f'),'uri':_0x53b2ca,'headers':{'Authorization':_0x5429('0x30')+_0x210278,'Content-Type':'application/json'},'body':_0xeb0962,'json':!![]};rp(_0x4ea5f8)[_0x5429('0x14')](function(_0x490552){console['log']('LOG\x20~\x20~\x20SEND',_0x490552);if(_0x490552['statuses'][0x0]['message_id']){return _0x263778[_0x5429('0x15')]({'messageId':_0x490552[_0x5429('0x31')][0x0][_0x5429('0x32')]});}})['catch'](function(_0x52fcd6){console[_0x5429('0x33')](_0x52fcd6);});break;}}})['finally'](function(){_0x31fde7();});}else{_0x31fde7();}}},'charset':_0x5429('0x34'),'collate':_0x5429('0x35')});};
\ No newline at end of file
+var _0x5b1c=['lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','FULLTEXT','models','get','toLowerCase','direction','out','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','secret','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','log','LOG\x20~\x20~\x20SEND','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x283d09,_0x5be1bd){var _0x2cb198=function(_0x28a1df){while(--_0x28a1df){_0x283d09['push'](_0x283d09['shift']());}};_0x2cb198(++_0x5be1bd);}(_0x5b1c,0x1b9));var _0xc5b1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5b1c[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xc5b1('0x0'));var util=require('util');var logger=require(_0xc5b1('0x1'))(_0xc5b1('0x2'));var moment=require(_0xc5b1('0x3'));var BPromise=require(_0xc5b1('0x4'));var rp=require(_0xc5b1('0x5'));var fetch=require(_0xc5b1('0x6'));var fs=require('fs');var path=require(_0xc5b1('0x7'));var rimraf=require(_0xc5b1('0x8'));var config=require(_0xc5b1('0x9'));var attributes=require(_0xc5b1('0xa'));module[_0xc5b1('0xb')]=function(_0x3dfe6b,_0x30d974){return _0x3dfe6b[_0xc5b1('0xc')](_0xc5b1('0xd'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xc5b1('0xe'),'fields':[_0xc5b1('0xe')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0xc5b1('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4674a8,_0x3365d5,_0x408c10){var _0x1d17da=_0x3dfe6b[_0xc5b1('0x10')];var _0x4e6b1a=_0x4674a8[_0xc5b1('0x11')]({'plain':!![]});if(_0x4e6b1a['direction'][_0xc5b1('0x12')]()==='in'||_0x4e6b1a[_0xc5b1('0x13')][_0xc5b1('0x12')]()===_0xc5b1('0x14')&&!_0x4e6b1a['secret']&&!_['isNil'](_0x4e6b1a[_0xc5b1('0x15')])){_0x1d17da[_0xc5b1('0x16')][_0xc5b1('0x17')]({'where':{'id':_0x4e6b1a[_0xc5b1('0x18')]}})[_0xc5b1('0x19')](function(_0x3ebe62){if(_0x3ebe62){_0x3ebe62[_0xc5b1('0x1a')]({'lastMsgAt':_0x4e6b1a[_0xc5b1('0x1b')],'lastMsgDirection':_0x4e6b1a[_0xc5b1('0x13')]['toLowerCase']()});}})['catch'](function(_0x14e0a9){console['error'](_0x14e0a9);});}if(_0x4e6b1a[_0xc5b1('0x13')]===_0xc5b1('0x14')&&!_0x4e6b1a[_0xc5b1('0x1c')]){var _0x16ba14;_0x1d17da['WhatsappAccount'][_0xc5b1('0x1d')]({'where':{'id':_0x4e6b1a[_0xc5b1('0x1e')]},'raw':!![]})[_0xc5b1('0x19')](function(_0xb58df6){_0x16ba14=_0xb58df6;if(_0x16ba14&&_0x16ba14[_0xc5b1('0x1f')]){switch(_0x16ba14['type']){case'twilio':var _0x426ec8=require(_0xc5b1('0x20'));if(_0x16ba14[_0xc5b1('0x21')]&&_0x16ba14['authToken']&&_0x16ba14[_0xc5b1('0x22')]){var _0x4f4c54=new _0x426ec8(_0x16ba14[_0xc5b1('0x21')],_0x16ba14[_0xc5b1('0x23')]);_0x4f4c54[_0xc5b1('0x24')][_0xc5b1('0x25')]({'body':_0x4e6b1a[_0xc5b1('0x26')],'to':_0xc5b1('0x27')+_0x4e6b1a[_0xc5b1('0x22')],'from':_0xc5b1('0x27')+_0x16ba14[_0xc5b1('0x22')],'statusCallback':_0x16ba14[_0xc5b1('0x28')]+_0xc5b1('0x29')+_0x4e6b1a['id']+_0xc5b1('0x2a')+_0x16ba14['token']})['then'](function(_0xb4bd4c){if(_0xb4bd4c[_0xc5b1('0x2b')]){return _0x4674a8['update']({'messageId':_0xb4bd4c[_0xc5b1('0x2b')]});}})[_0xc5b1('0x2c')](function(_0x29d52a){logger['error'](_0xc5b1('0x2d'),_0xc5b1('0x2e'),_0xc5b1('0x20'),util[_0xc5b1('0x2f')](_0x29d52a,{'showHidden':![],'depth':null}));});}else{logger[_0xc5b1('0x30')](_0xc5b1('0x2d'),_0xc5b1('0x2e'),_0xc5b1('0x20'),_0xc5b1('0x31'));}break;case _0xc5b1('0x32'):var _0x1fc4fa=_0x16ba14[_0xc5b1('0x21')];var _0x125b53=_0x16ba14[_0xc5b1('0x23')];var _0x10f07c=_0x16ba14[_0xc5b1('0x33')]+_0xc5b1('0x34')+_0x1fc4fa+_0xc5b1('0x35');var _0x3f4ae0={'to':[_0x4e6b1a[_0xc5b1('0x22')]],'message':{'type':_0xc5b1('0x36'),'text':_0x4e6b1a[_0xc5b1('0x26')]}};var _0x1c19d2={'method':'POST','uri':_0x10f07c,'headers':{'Authorization':_0xc5b1('0x37')+_0x125b53,'Content-Type':'application/json'},'body':_0x3f4ae0,'json':!![]};rp(_0x1c19d2)[_0xc5b1('0x19')](function(_0x30a782){console[_0xc5b1('0x38')](_0xc5b1('0x39'),_0x30a782);if(_0x30a782[_0xc5b1('0x3a')][0x0][_0xc5b1('0x3b')]){return _0x4674a8[_0xc5b1('0x1a')]({'messageId':_0x30a782[_0xc5b1('0x3a')][0x0][_0xc5b1('0x3b')]});}})[_0xc5b1('0x2c')](function(_0x40cf6b){console[_0xc5b1('0x38')](_0x40cf6b);});break;}}})[_0xc5b1('0x3c')](function(){_0x408c10();});}else{_0x408c10();}}},'charset':_0xc5b1('0x3d'),'collate':_0xc5b1('0x3e')});};
\ No newline at end of file
index 8d4e452..25e11a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e6=['WhatsappMessage','create','body','options','then','CreateWhatsappMessage','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x37fbbc,_0xb7338a){var _0x48e4fe=function(_0x14a128){while(--_0x14a128){_0x37fbbc['push'](_0x37fbbc['shift']());}};_0x48e4fe(++_0xb7338a);}(_0x70e6,0x1a7));var _0x670e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x70e6[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x670e('0x0'));var util=require('util');var moment=require(_0x670e('0x1'));var BPromise=require('bluebird');var rs=require(_0x670e('0x2'));var fs=require('fs');var Redis=require(_0x670e('0x3'));var db=require(_0x670e('0x4'))['db'];var utils=require(_0x670e('0x5'));var logger=require(_0x670e('0x6'))('rpc');var config=require(_0x670e('0x7'));var jayson=require(_0x670e('0x8'));var client=jayson[_0x670e('0x9')][_0x670e('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x670e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x670e('0xc'))(new Redis(config[_0x670e('0xb')]));require('./whatsappMessage.socket')[_0x670e('0xd')](socket);function respondWithRpcPromise(_0x4079ac,_0xcd3c3b,_0x46e7af){return new BPromise(function(_0x338acb,_0x9d2884){return client[_0x670e('0xe')](_0x4079ac,_0x46e7af)['then'](function(_0xab041b){logger[_0x670e('0xf')](_0x670e('0x10'),_0xcd3c3b,_0x670e('0x11'));logger[_0x670e('0x12')](_0x670e('0x13'),_0xcd3c3b,'request\x20sent',JSON[_0x670e('0x14')](_0xab041b));if(_0xab041b[_0x670e('0x15')]){if(_0xab041b[_0x670e('0x15')][_0x670e('0x16')]===0x1f4){logger[_0x670e('0x15')](_0x670e('0x10'),_0xcd3c3b,_0xab041b['error'][_0x670e('0x17')]);return _0x9d2884(_0xab041b[_0x670e('0x15')][_0x670e('0x17')]);}logger[_0x670e('0x15')](_0x670e('0x10'),_0xcd3c3b,_0xab041b['error'][_0x670e('0x17')]);return _0x338acb(_0xab041b[_0x670e('0x15')][_0x670e('0x17')]);}else{logger[_0x670e('0xf')](_0x670e('0x10'),_0xcd3c3b,_0x670e('0x11'));_0x338acb(_0xab041b[_0x670e('0x18')][_0x670e('0x17')]);}})['catch'](function(_0x2e0cab){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0xcd3c3b,_0x2e0cab);_0x9d2884(_0x2e0cab);});});}exports['CreateWhatsappMessage']=function(_0x195ee9){var _0x4e2a91=this;return new Promise(function(_0x24d4b3,_0x464beb){return db[_0x670e('0x19')][_0x670e('0x1a')](_0x195ee9[_0x670e('0x1b')],{'raw':_0x195ee9[_0x670e('0x1c')]?_0x195ee9[_0x670e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x670e('0x1d')](function(_0x55e54a){logger[_0x670e('0xf')](_0x670e('0x1e'),_0x195ee9);logger['debug']('CreateWhatsappMessage',_0x195ee9,JSON[_0x670e('0x14')](_0x55e54a));_0x24d4b3(_0x55e54a);})[_0x670e('0x1f')](function(_0x4d8cd1){logger['error'](_0x670e('0x1e'),_0x4d8cd1['message'],_0x195ee9);_0x464beb(_0x4e2a91['error'](0x1f4,_0x4d8cd1[_0x670e('0x17')]));});});};
\ No newline at end of file
+var _0xaf3a=['debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x26e756,_0xfcbd56){var _0x55b6cf=function(_0x1c0a8c){while(--_0x1c0a8c){_0x26e756['push'](_0x26e756['shift']());}};_0x55b6cf(++_0xfcbd56);}(_0xaf3a,0x155));var _0xaaf3=function(_0x18fe54,_0xff789){_0x18fe54=_0x18fe54-0x0;var _0xccb1ee=_0xaf3a[_0x18fe54];return _0xccb1ee;};'use strict';var _=require(_0xaaf3('0x0'));var util=require(_0xaaf3('0x1'));var moment=require(_0xaaf3('0x2'));var BPromise=require(_0xaaf3('0x3'));var rs=require(_0xaaf3('0x4'));var fs=require('fs');var Redis=require(_0xaaf3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaaf3('0x6'));var config=require(_0xaaf3('0x7'));var jayson=require(_0xaaf3('0x8'));var client=jayson[_0xaaf3('0x9')]['http']({'port':0x232a});config['redis']=_[_0xaaf3('0xa')](config[_0xaaf3('0xb')],{'host':_0xaaf3('0xc'),'port':0x18eb});var socket=require(_0xaaf3('0xd'))(new Redis(config[_0xaaf3('0xb')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x138e90,_0x273aaf,_0x2299c6){return new BPromise(function(_0x5aec94,_0x5b00ff){return client[_0xaaf3('0xe')](_0x138e90,_0x2299c6)[_0xaaf3('0xf')](function(_0x2262d7){logger[_0xaaf3('0x10')](_0xaaf3('0x11'),_0x273aaf,_0xaaf3('0x12'));logger[_0xaaf3('0x13')](_0xaaf3('0x14'),_0x273aaf,_0xaaf3('0x12'),JSON['stringify'](_0x2262d7));if(_0x2262d7[_0xaaf3('0x15')]){if(_0x2262d7[_0xaaf3('0x15')]['code']===0x1f4){logger[_0xaaf3('0x15')](_0xaaf3('0x11'),_0x273aaf,_0x2262d7[_0xaaf3('0x15')][_0xaaf3('0x16')]);return _0x5b00ff(_0x2262d7[_0xaaf3('0x15')][_0xaaf3('0x16')]);}logger['error'](_0xaaf3('0x11'),_0x273aaf,_0x2262d7['error'][_0xaaf3('0x16')]);return _0x5aec94(_0x2262d7[_0xaaf3('0x15')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x273aaf,_0xaaf3('0x12'));_0x5aec94(_0x2262d7['result'][_0xaaf3('0x16')]);}})[_0xaaf3('0x17')](function(_0x183386){logger[_0xaaf3('0x15')](_0xaaf3('0x11'),_0x273aaf,_0x183386);_0x5b00ff(_0x183386);});});}exports[_0xaaf3('0x18')]=function(_0x13412d){var _0x1ae107=this;return new Promise(function(_0x2692fe,_0x5012fc){return db[_0xaaf3('0x19')][_0xaaf3('0x1a')](_0x13412d[_0xaaf3('0x1b')],{'raw':_0x13412d[_0xaaf3('0x1c')]?_0x13412d['options'][_0xaaf3('0x1d')]===undefined?!![]:![]:!![]})[_0xaaf3('0xf')](function(_0x53fc62){logger[_0xaaf3('0x10')](_0xaaf3('0x18'),_0x13412d);logger['debug'](_0xaaf3('0x18'),_0x13412d,JSON['stringify'](_0x53fc62));_0x2692fe(_0x53fc62);})[_0xaaf3('0x17')](function(_0x4c7b18){logger['error'](_0xaaf3('0x18'),_0x4c7b18[_0xaaf3('0x16')],_0x13412d);_0x5012fc(_0x1ae107[_0xaaf3('0x15')](0x1f4,_0x4c7b18[_0xaaf3('0x16')]));});});};
\ No newline at end of file
index 9c3c630..24668f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cef=['emit','removeListener','register','length','./whatsappMessage.events','save','update'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x1cef,0x14d));var _0xf1ce=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0x1cef[_0xd02def];return _0x2e8374;};'use strict';var WhatsappMessageEvents=require(_0xf1ce('0x0'));var events=[_0xf1ce('0x1'),'remove',_0xf1ce('0x2')];function createListener(_0x2c1cd4,_0x3a0498){return function(_0x7e0616){_0x3a0498[_0xf1ce('0x3')](_0x2c1cd4,_0x7e0616);};}function removeListener(_0x13c992,_0x381824){return function(){WhatsappMessageEvents[_0xf1ce('0x4')](_0x13c992,_0x381824);};}exports[_0xf1ce('0x5')]=function(_0x3bb3dc){for(var _0x2c41ce=0x0,_0x24944b=events[_0xf1ce('0x6')];_0x2c41ce<_0x24944b;_0x2c41ce++){var _0x9999e5=events[_0x2c41ce];var _0x37fb8e=createListener('whatsappMessage:'+_0x9999e5,_0x3bb3dc);WhatsappMessageEvents['on'](_0x9999e5,_0x37fb8e);}};
\ No newline at end of file
+var _0x6fa1=['removeListener','register','length','./whatsappMessage.events','save','remove','update','emit'];(function(_0x442305,_0x2cf8be){var _0x189423=function(_0x35bfe2){while(--_0x35bfe2){_0x442305['push'](_0x442305['shift']());}};_0x189423(++_0x2cf8be);}(_0x6fa1,0x1bb));var _0x16fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6fa1[_0xa464c9];return _0x3d73c4;};'use strict';var WhatsappMessageEvents=require(_0x16fa('0x0'));var events=[_0x16fa('0x1'),_0x16fa('0x2'),_0x16fa('0x3')];function createListener(_0x198979,_0xcfded0){return function(_0x5bb4c6){_0xcfded0[_0x16fa('0x4')](_0x198979,_0x5bb4c6);};}function removeListener(_0x15bd93,_0x36ffcb){return function(){WhatsappMessageEvents[_0x16fa('0x5')](_0x15bd93,_0x36ffcb);};}exports[_0x16fa('0x6')]=function(_0xedceb5){for(var _0x314476=0x0,_0x120d19=events[_0x16fa('0x7')];_0x314476<_0x120d19;_0x314476++){var _0x584e4d=events[_0x314476];var _0x208757=createListener('whatsappMessage:'+_0x584e4d,_0xedceb5);WhatsappMessageEvents['on'](_0x584e4d,_0x208757);}};
\ No newline at end of file
index 57ffe47..5aea3d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07dc=['/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0xb6b85f,_0x253d0c){var _0xf305d=function(_0x31b59d){while(--_0x31b59d){_0xb6b85f['push'](_0xb6b85f['shift']());}};_0xf305d(++_0x253d0c);}(_0x07dc,0x7a));var _0xc07d=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x07dc[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xc07d('0x0'));var util=require(_0xc07d('0x1'));var path=require(_0xc07d('0x2'));var timeout=require('connect-timeout');var express=require(_0xc07d('0x3'));var router=express[_0xc07d('0x4')]();var fs_extra=require(_0xc07d('0x5'));var auth=require(_0xc07d('0x6'));var interaction=require(_0xc07d('0x7'));var config=require('../../config/environment');var controller=require(_0xc07d('0x8'));router[_0xc07d('0x9')]('/',auth['isAuthenticated'](),controller[_0xc07d('0xa')]);router[_0xc07d('0x9')]('/describe',auth[_0xc07d('0xb')](),controller[_0xc07d('0xc')]);router[_0xc07d('0x9')](_0xc07d('0xd'),auth[_0xc07d('0xb')](),controller[_0xc07d('0xe')]);router['get'](_0xc07d('0xf'),auth[_0xc07d('0xb')](),controller[_0xc07d('0x10')]);router[_0xc07d('0x9')](_0xc07d('0x11'),auth[_0xc07d('0xb')](),controller['getTeams']);router[_0xc07d('0x9')](_0xc07d('0x12'),auth[_0xc07d('0xb')](),controller[_0xc07d('0x13')]);router[_0xc07d('0x14')]('/',auth[_0xc07d('0xb')](),controller[_0xc07d('0x15')]);router[_0xc07d('0x14')]('/:id/teams',auth[_0xc07d('0xb')](),controller['addTeams']);router[_0xc07d('0x14')]('/:id/users',auth[_0xc07d('0xb')](),controller[_0xc07d('0x16')]);router[_0xc07d('0x17')](_0xc07d('0xd'),auth['isAuthenticated'](),controller[_0xc07d('0x18')]);router[_0xc07d('0x19')](_0xc07d('0xd'),auth[_0xc07d('0xb')](),controller[_0xc07d('0x1a')]);router['delete'](_0xc07d('0x11'),auth['isAuthenticated'](),controller[_0xc07d('0x1b')]);router[_0xc07d('0x19')](_0xc07d('0x12'),auth[_0xc07d('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x1600=['isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','put','destroy','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1600,0x1df));var _0x0160=function(_0x25caca,_0x518cea){_0x25caca=_0x25caca-0x0;var _0xad560e=_0x1600[_0x25caca];return _0xad560e;};'use strict';var multer=require(_0x0160('0x0'));var util=require(_0x0160('0x1'));var path=require(_0x0160('0x2'));var timeout=require(_0x0160('0x3'));var express=require(_0x0160('0x4'));var router=express[_0x0160('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0160('0x6'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0x0160('0x7')](),controller[_0x0160('0x8')]);router['get'](_0x0160('0x9'),auth[_0x0160('0x7')](),controller[_0x0160('0xa')]);router[_0x0160('0xb')](_0x0160('0xc'),auth[_0x0160('0x7')](),controller[_0x0160('0xd')]);router[_0x0160('0xb')](_0x0160('0xe'),auth['isAuthenticated'](),controller[_0x0160('0xf')]);router[_0x0160('0xb')](_0x0160('0x10'),auth[_0x0160('0x7')](),controller[_0x0160('0x11')]);router[_0x0160('0xb')](_0x0160('0x12'),auth[_0x0160('0x7')](),controller['getAgents']);router['post']('/',auth[_0x0160('0x7')](),controller[_0x0160('0x13')]);router[_0x0160('0x14')](_0x0160('0x10'),auth['isAuthenticated'](),controller[_0x0160('0x15')]);router['post'](_0x0160('0x12'),auth[_0x0160('0x7')](),controller['addAgents']);router[_0x0160('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0160('0xc'),auth[_0x0160('0x7')](),controller[_0x0160('0x17')]);router[_0x0160('0x18')](_0x0160('0x10'),auth['isAuthenticated'](),controller[_0x0160('0x19')]);router[_0x0160('0x18')](_0x0160('0x12'),auth['isAuthenticated'](),controller[_0x0160('0x1a')]);module['exports']=router;
\ No newline at end of file
index bebcd1c..a796112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2557=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2557,0x11e));var _0x7255=function(_0x2a8a84,_0x46040d){_0x2a8a84=_0x2a8a84-0x0;var _0x3e1e27=_0x2557[_0x2a8a84];return _0x3e1e27;};'use strict';var Sequelize=require(_0x7255('0x0'));module['exports']={'name':{'type':Sequelize[_0x7255('0x1')],'unique':_0x7255('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7255('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7255('0x4')](_0x7255('0x5'),_0x7255('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0a9a=['roundrobin','STRING','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x44c340,_0x575719){var _0x2cd080=function(_0x1109ea){while(--_0x1109ea){_0x44c340['push'](_0x44c340['shift']());}};_0x2cd080(++_0x575719);}(_0x0a9a,0x183));var _0xa0a9=function(_0x98269e,_0x5ad539){_0x98269e=_0x98269e-0x0;var _0x1a48cc=_0x0a9a[_0x98269e];return _0x1a48cc;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa0a9('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa0a9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa0a9('0x3')](_0xa0a9('0x4'),'beepall',_0xa0a9('0x5'))},'description':{'type':Sequelize[_0xa0a9('0x6')]}};
\ No newline at end of file
index 4fbb900..662e009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddbc=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','WhatsappQueue','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','params','describe','getMembers','findOne','UserWhatsappQueue','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','emit','ids','select','field','tq.TeamId','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','request-promise','bluebird','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/logger','api','../../config/environment','../../config/license/util','redis','localhost','register','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xddbc,0x6a));var _0xcddb=function(_0x1b4a02,_0xc27b22){_0x1b4a02=_0x1b4a02-0x0;var _0x4b003d=_0xddbc[_0x1b4a02];return _0x4b003d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcddb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcddb('0x1'));var moment=require('moment');var BPromise=require(_0xcddb('0x2'));var Mustache=require(_0xcddb('0x3'));var util=require('util');var path=require(_0xcddb('0x4'));var sox=require(_0xcddb('0x5'));var csv=require(_0xcddb('0x6'));var ejs=require(_0xcddb('0x7'));var fs=require('fs');var fs_extra=require(_0xcddb('0x8'));var _=require('lodash');var squel=require(_0xcddb('0x9'));var crypto=require(_0xcddb('0xa'));var jsforce=require(_0xcddb('0xb'));var deskjs=require(_0xcddb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcddb('0xd'));var Papa=require(_0xcddb('0xe'));var Redis=require(_0xcddb('0xf'));var authService=require(_0xcddb('0x10'));var qs=require(_0xcddb('0x11'));var as=require(_0xcddb('0x12'));var hardwareService=require(_0xcddb('0x13'));var logger=require(_0xcddb('0x14'))(_0xcddb('0x15'));var utils=require('../../config/utils');var config=require(_0xcddb('0x16'));var licenseUtil=require(_0xcddb('0x17'));var db=require('../../mysqldb')['db'];config[_0xcddb('0x18')]=_['defaults'](config[_0xcddb('0x18')],{'host':_0xcddb('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcddb('0x18')]));require('./whatsappQueue.socket')[_0xcddb('0x1a')](socket);function respondWithStatusCode(_0x83b46d,_0x46e9ac){_0x46e9ac=_0x46e9ac||0xcc;return function(_0x43d461){if(_0x43d461){return _0x83b46d[_0xcddb('0x1b')](_0x46e9ac);}return _0x83b46d[_0xcddb('0x1c')](_0x46e9ac)[_0xcddb('0x1d')]();};}function respondWithResult(_0x2a45a4,_0x144b3c){_0x144b3c=_0x144b3c||0xc8;return function(_0x1a143d){if(_0x1a143d){return _0x2a45a4[_0xcddb('0x1c')](_0x144b3c)[_0xcddb('0x1e')](_0x1a143d);}};}function respondWithFilteredResult(_0x2957b4,_0x15d726){return function(_0x233d7b){if(_0x233d7b){var _0x4994c1=typeof _0x15d726[_0xcddb('0x1f')]===_0xcddb('0x20')&&typeof _0x15d726[_0xcddb('0x21')]===_0xcddb('0x20');var _0x369c20=_0x233d7b['count'];var _0x492ac6=_0x4994c1?0x0:_0x15d726[_0xcddb('0x1f')];var _0x4403ff=_0x4994c1?_0x233d7b[_0xcddb('0x22')]:_0x15d726[_0xcddb('0x1f')]+_0x15d726['limit'];var _0x11e8d2;if(_0x4403ff>=_0x369c20){_0x4403ff=_0x369c20;_0x11e8d2=0xc8;}else{_0x11e8d2=0xce;}_0x2957b4[_0xcddb('0x1c')](_0x11e8d2);return _0x2957b4[_0xcddb('0x23')](_0xcddb('0x24'),_0x492ac6+'-'+_0x4403ff+'/'+_0x369c20)[_0xcddb('0x1e')](_0x233d7b);}return null;};}function patchUpdates(_0x324597){return function(_0xfbc915){try{jsonpatch[_0xcddb('0x25')](_0xfbc915,_0x324597,!![]);}catch(_0x1a2f6d){return BPromise[_0xcddb('0x26')](_0x1a2f6d);}return _0xfbc915[_0xcddb('0x27')]();};}function saveUpdates(_0x1bf122,_0x2c2180){return function(_0x537b06){if(_0x537b06){return _0x537b06['update'](_0x1bf122)[_0xcddb('0x28')](function(_0x1581a3){return _0x1581a3;});}return null;};}function removeEntity(_0x3947ac,_0x5dcf8e){return function(_0x26018c){if(_0x26018c){return _0x26018c[_0xcddb('0x29')]()[_0xcddb('0x28')](function(){var _0x23964f=_0x26018c[_0xcddb('0x2a')]({'plain':!![]});var _0x11a062=_0xcddb('0x2b');return db[_0xcddb('0x2c')]['destroy']({'where':{'type':_0x11a062,'resourceId':_0x23964f['id']}})[_0xcddb('0x28')](function(){return _0x26018c;});})[_0xcddb('0x28')](function(){_0x3947ac[_0xcddb('0x1c')](0xcc)[_0xcddb('0x1d')]();});}};}function handleEntityNotFound(_0x22e0e7,_0x621190){return function(_0x1c1b7a){if(!_0x1c1b7a){_0x22e0e7[_0xcddb('0x1b')](0x194);}return _0x1c1b7a;};}function handleError(_0x5810e3,_0x52cd85){_0x52cd85=_0x52cd85||0x1f4;return function(_0x362a87){logger['error'](_0x362a87[_0xcddb('0x2d')]);if(_0x362a87['name']){delete _0x362a87[_0xcddb('0x2e')];}_0x5810e3[_0xcddb('0x1c')](_0x52cd85)['send'](_0x362a87);};}exports['index']=function(_0x38661c,_0x5a40f7){var _0x328c1c={},_0x375c27={},_0xefa552={'count':0x0,'rows':[]};var _0x42cd37=_['map'](db['WhatsappQueue'][_0xcddb('0x2f')],function(_0x5604be){return{'name':_0x5604be['fieldName'],'type':_0x5604be[_0xcddb('0x30')][_0xcddb('0x31')]};});_0x375c27['model']=_[_0xcddb('0x32')](_0x42cd37,_0xcddb('0x2e'));_0x375c27[_0xcddb('0x33')]=_[_0xcddb('0x34')](_0x38661c[_0xcddb('0x33')]);_0x375c27[_0xcddb('0x35')]=_[_0xcddb('0x36')](_0x375c27['model'],_0x375c27[_0xcddb('0x33')]);_0x328c1c[_0xcddb('0x37')]=_['intersection'](_0x375c27[_0xcddb('0x38')],qs[_0xcddb('0x39')](_0x38661c[_0xcddb('0x33')]['fields']));_0x328c1c['attributes']=_0x328c1c[_0xcddb('0x37')][_0xcddb('0x3a')]?_0x328c1c[_0xcddb('0x37')]:_0x375c27[_0xcddb('0x38')];if(!_0x38661c[_0xcddb('0x33')][_0xcddb('0x3b')](_0xcddb('0x3c'))){_0x328c1c[_0xcddb('0x21')]=qs[_0xcddb('0x21')](_0x38661c[_0xcddb('0x33')][_0xcddb('0x21')]);_0x328c1c['offset']=qs[_0xcddb('0x1f')](_0x38661c[_0xcddb('0x33')][_0xcddb('0x1f')]);}_0x328c1c[_0xcddb('0x3d')]=qs['sort'](_0x38661c[_0xcddb('0x33')][_0xcddb('0x3e')]);_0x328c1c[_0xcddb('0x3f')]=qs[_0xcddb('0x35')](_[_0xcddb('0x40')](_0x38661c[_0xcddb('0x33')],_0x375c27[_0xcddb('0x35')]),_0x42cd37);if(_0x38661c['query'][_0xcddb('0x41')]){_0x328c1c[_0xcddb('0x3f')]=_[_0xcddb('0x42')](_0x328c1c[_0xcddb('0x3f')],{'$or':_[_0xcddb('0x32')](_0x42cd37,function(_0x3fd6a6){if(_0x3fd6a6[_0xcddb('0x30')]!=='VIRTUAL'){var _0x149a7c={};_0x149a7c[_0x3fd6a6[_0xcddb('0x2e')]]={'$like':'%'+_0x38661c[_0xcddb('0x33')][_0xcddb('0x41')]+'%'};return _0x149a7c;}})});}_0x328c1c=_[_0xcddb('0x42')]({},_0x328c1c,_0x38661c[_0xcddb('0x43')]);var _0x1b6a1d={'where':_0x328c1c[_0xcddb('0x3f')]};return db[_0xcddb('0x44')][_0xcddb('0x22')](_0x1b6a1d)['then'](function(_0x1a34f1){_0xefa552[_0xcddb('0x22')]=_0x1a34f1;if(_0x38661c[_0xcddb('0x33')][_0xcddb('0x45')]){_0x328c1c[_0xcddb('0x46')]=[{'all':!![]}];}return db[_0xcddb('0x44')]['findAll'](_0x328c1c);})[_0xcddb('0x28')](function(_0x2dd926){_0xefa552[_0xcddb('0x47')]=_0x2dd926;return _0xefa552;})[_0xcddb('0x28')](respondWithFilteredResult(_0x5a40f7,_0x328c1c))[_0xcddb('0x48')](handleError(_0x5a40f7,null));};exports[_0xcddb('0x49')]=function(_0x1ff81b,_0x285b54){var _0x4b4939={'raw':!![],'where':{'id':_0x1ff81b['params']['id']}},_0xf1cb2b={};_0xf1cb2b[_0xcddb('0x38')]=_[_0xcddb('0x34')](db[_0xcddb('0x44')][_0xcddb('0x2f')]);_0xf1cb2b[_0xcddb('0x33')]=_[_0xcddb('0x34')](_0x1ff81b[_0xcddb('0x33')]);_0xf1cb2b[_0xcddb('0x35')]=_[_0xcddb('0x36')](_0xf1cb2b[_0xcddb('0x38')],_0xf1cb2b['query']);_0x4b4939[_0xcddb('0x37')]=_[_0xcddb('0x36')](_0xf1cb2b[_0xcddb('0x38')],qs[_0xcddb('0x39')](_0x1ff81b[_0xcddb('0x33')]['fields']));_0x4b4939[_0xcddb('0x37')]=_0x4b4939[_0xcddb('0x37')][_0xcddb('0x3a')]?_0x4b4939[_0xcddb('0x37')]:_0xf1cb2b[_0xcddb('0x38')];if(_0x1ff81b[_0xcddb('0x33')]['includeAll']){_0x4b4939['include']=[{'all':!![]}];}_0x4b4939=_[_0xcddb('0x42')]({},_0x4b4939,_0x1ff81b[_0xcddb('0x43')]);return db[_0xcddb('0x44')][_0xcddb('0x4a')](_0x4b4939)[_0xcddb('0x28')](handleEntityNotFound(_0x285b54,null))[_0xcddb('0x28')](respondWithResult(_0x285b54,null))['catch'](handleError(_0x285b54,null));};exports[_0xcddb('0x4b')]=function(_0x27496d,_0x4f642d){return db[_0xcddb('0x44')][_0xcddb('0x4b')](_0x27496d[_0xcddb('0x4c')],{})[_0xcddb('0x28')](function(_0x44294a){var _0x2c3048=_0x27496d[_0xcddb('0x4d')]['get']({'plain':!![]});if(!_0x2c3048)throw new Error(_0xcddb('0x4e'));if(_0x2c3048[_0xcddb('0x4f')]===_0xcddb('0x4d')){var _0x4902cb=_0x44294a[_0xcddb('0x2a')]({'plain':!![]});var _0xf2653d=_0xcddb('0x2b');return db[_0xcddb('0x50')]['find']({'where':{'name':_0xf2653d,'userProfileId':_0x2c3048[_0xcddb('0x51')]},'raw':!![]})[_0xcddb('0x28')](function(_0x55a127){if(_0x55a127&&_0x55a127['autoAssociation']===0x0){return db['UserProfileResource'][_0xcddb('0x4b')]({'name':_0x4902cb[_0xcddb('0x2e')],'resourceId':_0x4902cb['id'],'type':_0x55a127['name'],'sectionId':_0x55a127['id']},{})[_0xcddb('0x28')](function(){return _0x44294a;});}else{return _0x44294a;}})[_0xcddb('0x48')](function(_0x4f2693){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2693);throw _0x4f2693;});}return _0x44294a;})[_0xcddb('0x28')](respondWithResult(_0x4f642d,0xc9))['catch'](handleError(_0x4f642d,null));};exports[_0xcddb('0x52')]=function(_0x4c64f4,_0x398e31){if(_0x4c64f4['body']['id']){delete _0x4c64f4[_0xcddb('0x4c')]['id'];}return db[_0xcddb('0x44')][_0xcddb('0x4a')]({'where':{'id':_0x4c64f4[_0xcddb('0x53')]['id']}})['then'](handleEntityNotFound(_0x398e31,null))[_0xcddb('0x28')](saveUpdates(_0x4c64f4['body'],null))[_0xcddb('0x28')](respondWithResult(_0x398e31,null))[_0xcddb('0x48')](handleError(_0x398e31,null));};exports[_0xcddb('0x29')]=function(_0x21eca2,_0x94e865){return db['WhatsappQueue']['find']({'where':{'id':_0x21eca2[_0xcddb('0x53')]['id']}})['then'](handleEntityNotFound(_0x94e865,null))[_0xcddb('0x28')](removeEntity(_0x94e865,null))['catch'](handleError(_0x94e865,null));};exports[_0xcddb('0x54')]=function(_0x461f09,_0x488628){return db[_0xcddb('0x44')][_0xcddb('0x54')]()[_0xcddb('0x28')](respondWithResult(_0x488628,null))[_0xcddb('0x48')](handleError(_0x488628,null));};exports[_0xcddb('0x55')]=function(_0x24caf2,_0xc68d64,_0x4e3b24){var _0x13428f={'raw':!![],'where':{}},_0x2532be={},_0x3def45;return db[_0xcddb('0x44')][_0xcddb('0x56')]({'where':{'id':_0x24caf2[_0xcddb('0x53')]['id']}})[_0xcddb('0x28')](handleEntityNotFound(_0xc68d64,null))[_0xcddb('0x28')](function(_0x1a258e){if(_0x1a258e){_0x3def45=_0x1a258e[_0xcddb('0x2a')]({'plain':!![]});_0x2532be['model']=_[_0xcddb('0x34')](db[_0xcddb('0x57')][_0xcddb('0x2f')]);_0x2532be['query']=_[_0xcddb('0x34')](_0x24caf2[_0xcddb('0x33')]);_0x2532be['filters']=_[_0xcddb('0x36')](_0x2532be[_0xcddb('0x38')],_0x2532be['query']);_0x13428f[_0xcddb('0x37')]=_['intersection'](_0x2532be['model'],qs[_0xcddb('0x39')](_0x24caf2[_0xcddb('0x33')]['fields']));_0x13428f[_0xcddb('0x37')]=_0x13428f['attributes'][_0xcddb('0x3a')]?_0x13428f[_0xcddb('0x37')]:_0x2532be[_0xcddb('0x38')];if(!_0x24caf2[_0xcddb('0x33')][_0xcddb('0x3b')](_0xcddb('0x3c'))){_0x13428f[_0xcddb('0x21')]=qs[_0xcddb('0x21')](_0x24caf2[_0xcddb('0x33')]['limit']);_0x13428f[_0xcddb('0x1f')]=qs['offset'](_0x24caf2[_0xcddb('0x33')][_0xcddb('0x1f')]);}_0x13428f[_0xcddb('0x3d')]=qs['sort'](_0x24caf2['query']['sort']);_0x13428f[_0xcddb('0x3f')]=qs[_0xcddb('0x35')](_['pick'](_0x24caf2[_0xcddb('0x33')],_0x2532be[_0xcddb('0x35')]));_0x13428f[_0xcddb('0x3f')]['WhatsappQueueId']=_0x1a258e['id'];if(_0x24caf2['query']['filter']){_0x13428f['where']=_[_0xcddb('0x42')](_0x13428f[_0xcddb('0x3f')],{'$or':_['map'](_0x13428f[_0xcddb('0x37')],function(_0x5f81f4){var _0x2e4b94={};_0x2e4b94[_0x5f81f4]={'$like':'%'+_0x24caf2[_0xcddb('0x33')][_0xcddb('0x41')]+'%'};return _0x2e4b94;})});}_0x13428f=_[_0xcddb('0x42')]({},_0x13428f,_0x24caf2[_0xcddb('0x43')]);return db['UserWhatsappQueue'][_0xcddb('0x58')](_0x13428f);}})['then'](function(_0x2202e3){if(_0x2202e3){return db[_0xcddb('0x59')][_0xcddb('0x5a')]({'where':{'id':_[_0xcddb('0x32')](_0x2202e3,_0xcddb('0x5b')),'role':_0xcddb('0x5c')},'attributes':['id',_0xcddb('0x2e'),'whatsappPause',_0xcddb('0x5d'),_0xcddb('0x5e')]});}})[_0xcddb('0x28')](function(_0x208b4c){if(_0x208b4c){return{'count':_0x208b4c[_0xcddb('0x22')],'rows':_[_0xcddb('0x32')](_0x208b4c['rows'],function(_0x3dabea){return{'membername':_0x3dabea[_0xcddb('0x2e')],'UserId':_0x3dabea['id'],'queue_name':_0x3def45[_0xcddb('0x2e')],'WhatsappQueueId':_0x3def45['id'],'interface':util[_0xcddb('0x5f')]('%s/%s',_0xcddb('0x60'),_0x3dabea[_0xcddb('0x2e')]),'penalty':0x0,'paused':_0x3dabea['whatsappPause'],'createdAt':_0x3dabea[_0xcddb('0x5e')],'updatedAt':_0x3dabea['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xcddb('0x28')](respondWithFilteredResult(_0xc68d64,_0x13428f))[_0xcddb('0x48')](handleError(_0xc68d64,null));};exports[_0xcddb('0x61')]=function(_0x5a2ba7,_0x4a6055,_0x40b39c){var _0x5c4a22={};var _0x4a3cda={};var _0x19441f;var _0x49417b;return db[_0xcddb('0x44')][_0xcddb('0x56')]({'where':{'id':_0x5a2ba7['params']['id']}})[_0xcddb('0x28')](handleEntityNotFound(_0x4a6055,null))['then'](function(_0x345d36){if(_0x345d36){_0x19441f=_0x345d36;_0x4a3cda[_0xcddb('0x38')]=_[_0xcddb('0x34')](db[_0xcddb('0x62')][_0xcddb('0x2f')]);_0x4a3cda[_0xcddb('0x33')]=_[_0xcddb('0x34')](_0x5a2ba7[_0xcddb('0x33')]);_0x4a3cda['filters']=_[_0xcddb('0x36')](_0x4a3cda['model'],_0x4a3cda[_0xcddb('0x33')]);_0x5c4a22[_0xcddb('0x37')]=_[_0xcddb('0x36')](_0x4a3cda[_0xcddb('0x38')],qs[_0xcddb('0x39')](_0x5a2ba7[_0xcddb('0x33')][_0xcddb('0x39')]));_0x5c4a22[_0xcddb('0x37')]=_0x5c4a22['attributes'][_0xcddb('0x3a')]?_0x5c4a22['attributes']:_0x4a3cda['model'];_0x5c4a22['order']=qs[_0xcddb('0x3e')](_0x5a2ba7[_0xcddb('0x33')][_0xcddb('0x3e')]);_0x5c4a22[_0xcddb('0x3f')]=qs[_0xcddb('0x35')](_[_0xcddb('0x40')](_0x5a2ba7['query'],_0x4a3cda[_0xcddb('0x35')]));if(_0x5a2ba7[_0xcddb('0x33')][_0xcddb('0x41')]){_0x5c4a22[_0xcddb('0x3f')]=_[_0xcddb('0x42')](_0x5c4a22[_0xcddb('0x3f')],{'$or':_[_0xcddb('0x32')](_0x5c4a22[_0xcddb('0x37')],function(_0x42ceff){var _0x396034={};_0x396034[_0x42ceff]={'$like':'%'+_0x5a2ba7[_0xcddb('0x33')][_0xcddb('0x41')]+'%'};return _0x396034;})});}_0x5c4a22=_[_0xcddb('0x42')]({},_0x5c4a22,_0x5a2ba7[_0xcddb('0x43')]);return _0x19441f[_0xcddb('0x61')](_0x5c4a22);}})[_0xcddb('0x28')](function(_0x30e64c){if(_0x30e64c){_0x49417b=_0x30e64c[_0xcddb('0x3a')];if(!_0x5a2ba7[_0xcddb('0x33')][_0xcddb('0x3b')](_0xcddb('0x3c'))){_0x5c4a22[_0xcddb('0x21')]=qs[_0xcddb('0x21')](_0x5a2ba7['query'][_0xcddb('0x21')]);_0x5c4a22['offset']=qs[_0xcddb('0x1f')](_0x5a2ba7['query'][_0xcddb('0x1f')]);}return _0x19441f['getTeams'](_0x5c4a22);}})[_0xcddb('0x28')](function(_0xe7a639){if(_0xe7a639){return _0xe7a639?{'count':_0x49417b,'rows':_0xe7a639}:null;}})[_0xcddb('0x28')](respondWithResult(_0x4a6055,null))['catch'](handleError(_0x4a6055,null));};exports[_0xcddb('0x63')]=function(_0x4aadb8,_0x55bce4,_0x17d69f){var _0x1f6561=_0x4aadb8[_0xcddb('0x4c')]['ids'];return db['Team'][_0xcddb('0x58')]({'where':{'id':_0x1f6561},'attributes':['id'],'include':[{'model':db[_0xcddb('0x59')],'as':_0xcddb('0x64'),'attributes':['id',_0xcddb('0x2e'),_0xcddb('0x65'),'voicePause',_0xcddb('0x66')],'raw':!![]}]})[_0xcddb('0x28')](function(_0x576aa6){if(_0x576aa6){var _0x38ae3a=_['flatMap'](_0x576aa6,function(_0x23ff53){var _0x3ec37e=_0x23ff53[_0xcddb('0x2a')]({'plain':!![]});return _0x3ec37e[_0xcddb('0x64')];});return db['WhatsappQueue']['find']({'where':{'id':_0x4aadb8[_0xcddb('0x53')]['id']}})[_0xcddb('0x28')](function(_0xd4c592){return db[_0xcddb('0x67')][_0xcddb('0x68')](function(_0x575857){return _0xd4c592['addTeams'](_0x1f6561,{'transaction':_0x575857})['then'](function(){return BPromise[_0xcddb('0x69')](_0x38ae3a,function(_0x1bdc50){return db['UserWhatsappQueue'][_0xcddb('0x6a')]({'where':{'UserId':_0x1bdc50['id'],'WhatsappQueueId':_0x4aadb8[_0xcddb('0x53')]['id']},'transaction':_0x575857});});})[_0xcddb('0x28')](function(){_0x38ae3a[_0xcddb('0x6b')](function(_0x23fbc0){socket[_0xcddb('0x6c')]('userWhatsappQueue:save',{'UserId':_0x23fbc0['id'],'WhatsappQueueId':_0xd4c592['id']});});});});});}})['then'](respondWithStatusCode(_0x55bce4,null))[_0xcddb('0x48')](handleError(_0x55bce4,null));};exports['removeTeams']=function(_0x482326,_0x5f0b75,_0x4b5801){return db[_0xcddb('0x62')][_0xcddb('0x58')]({'where':{'id':_0x482326['query'][_0xcddb('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xcddb('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xcddb('0x28')](handleEntityNotFound(_0x5f0b75,null))[_0xcddb('0x28')](function(_0x1747df){var _0x5491c1=_[_0xcddb('0x32')](_0x1747df,'id');var _0x1f04b0=[];var _0x4d8973=[];var _0xa69457=squel[_0xcddb('0x6e')]();_0xa69457[_0xcddb('0x6f')](_0xcddb('0x70'))[_0xcddb('0x71')]('team_has_whatsapp_queues','tq')[_0xcddb('0x72')](_0xcddb('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xcddb('0x3f')]('WhatsappQueueId\x20=\x20?',_0x482326['params']['id']);for(var _0x3d7d2b=0x0;_0x3d7d2b<_0x1747df[_0xcddb('0x3a')];_0x3d7d2b+=0x1){let _0x4cafa0=_0x1747df[_0x3d7d2b];for(var _0x52687d=0x0;_0x52687d<_0x4cafa0['Agents']['length'];_0x52687d+=0x1){let _0xc5f469=_0x4cafa0[_0xcddb('0x64')][_0x52687d];var _0x750c9=_0xa69457[_0xcddb('0x74')]();_0x750c9[_0xcddb('0x3f')](_0xcddb('0x75'),_0xc5f469['id']);_0x4d8973[_0xcddb('0x76')](db['sequelize'][_0xcddb('0x33')](_0x750c9[_0xcddb('0x77')](),{'type':db[_0xcddb('0x67')][_0xcddb('0x78')][_0xcddb('0x79')]})['then'](function(_0x273c87){if(_0x273c87[_0xcddb('0x3a')]===0x1){return _0xc5f469['id'];}else{var _0x6335f0=_[_0xcddb('0x7a')](_[_0xcddb('0x32')](_0x273c87,'TeamId'),function(_0x3b6a94){return _[_0xcddb('0x7b')](_0x5491c1,_0x3b6a94);});if(_0x6335f0){return _0xc5f469['id'];}}}));}}return BPromise['all'](_0x4d8973)['then'](function(_0x10c094){_0x1f04b0=_(_0x1f04b0)[_0xcddb('0x7c')](_0x10c094)[_0xcddb('0x7d')]()[_0xcddb('0x7e')]();return db[_0xcddb('0x44')][_0xcddb('0x4a')]({'where':{'id':_0x482326['params']['id']}})[_0xcddb('0x28')](function(_0x4861e8){return db[_0xcddb('0x67')][_0xcddb('0x68')](function(_0x4941a1){return _0x4861e8[_0xcddb('0x7f')](_0x482326[_0xcddb('0x33')]['ids'],{'transaction':_0x4941a1})[_0xcddb('0x28')](function(){if(!_[_0xcddb('0x80')](_0x1f04b0)){return _0x4861e8[_0xcddb('0x81')](_0x1f04b0,{'transaction':_0x4941a1});}})[_0xcddb('0x28')](function(){_0x1f04b0[_0xcddb('0x6b')](function(_0x4ce0c4){socket[_0xcddb('0x6c')](_0xcddb('0x82'),{'UserId':_0x4ce0c4,'WhatsappQueueId':_0x4861e8['id']});});});});});});})[_0xcddb('0x28')](respondWithStatusCode(_0x5f0b75,null))['catch'](handleError(_0x5f0b75,null));};exports[_0xcddb('0x83')]=function(_0x2b31a8,_0x5da0fe,_0x4798f9){return db[_0xcddb('0x44')][_0xcddb('0x4a')]({'where':{'id':_0x2b31a8[_0xcddb('0x53')]['id']}})[_0xcddb('0x28')](handleEntityNotFound(_0x5da0fe,null))[_0xcddb('0x28')](function(_0x1d60cb){if(_0x1d60cb){return _0x1d60cb['addAgents'](_0x2b31a8[_0xcddb('0x4c')][_0xcddb('0x6d')],_[_0xcddb('0x84')](_0x2b31a8['body'],['ids','id'])||{})[_0xcddb('0x85')](function(_0x2132db){for(var _0x302426=0x0;_0x302426<_0x2b31a8['body'][_0xcddb('0x6d')][_0xcddb('0x3a')];_0x302426+=0x1){socket[_0xcddb('0x6c')]('userWhatsappQueue:save',{'UserId':Number(_0x2b31a8['body'][_0xcddb('0x6d')][_0x302426]),'WhatsappQueueId':Number(_0x2b31a8[_0xcddb('0x53')]['id'])});}return _0x2132db;});}})[_0xcddb('0x28')](respondWithResult(_0x5da0fe,null))['catch'](handleError(_0x5da0fe,null));};exports[_0xcddb('0x81')]=function(_0x30c478,_0x51fa65,_0x4cb217){return db[_0xcddb('0x44')][_0xcddb('0x4a')]({'where':{'id':_0x30c478[_0xcddb('0x53')]['id']}})[_0xcddb('0x28')](handleEntityNotFound(_0x51fa65,null))[_0xcddb('0x28')](function(_0xf2b31c){if(_0xf2b31c){return _0xf2b31c['removeAgents'](_0x30c478['query'][_0xcddb('0x6d')])[_0xcddb('0x28')](function(){if(_[_0xcddb('0x86')](_0x30c478[_0xcddb('0x33')][_0xcddb('0x6d')])){for(var _0x5812dd=0x0;_0x5812dd<_0x30c478[_0xcddb('0x33')][_0xcddb('0x6d')][_0xcddb('0x3a')];_0x5812dd+=0x1){socket[_0xcddb('0x6c')](_0xcddb('0x82'),{'UserId':Number(_0x30c478[_0xcddb('0x33')][_0xcddb('0x6d')][_0x5812dd]),'WhatsappQueueId':Number(_0x30c478[_0xcddb('0x53')]['id'])});}}else{socket[_0xcddb('0x6c')](_0xcddb('0x82'),{'UserId':Number(_0x30c478[_0xcddb('0x33')][_0xcddb('0x6d')]),'WhatsappQueueId':Number(_0x30c478[_0xcddb('0x53')]['id'])});}});}})[_0xcddb('0x28')](respondWithStatusCode(_0x51fa65,null))[_0xcddb('0x48')](handleError(_0x51fa65,null));};exports[_0xcddb('0x87')]=function(_0x1a42d1,_0x5c0c2d,_0x4fc6a8){var _0x226761={};var _0x1dd8de={};var _0x47d3f0;var _0x5557b4;return db[_0xcddb('0x44')][_0xcddb('0x56')]({'where':{'id':_0x1a42d1[_0xcddb('0x53')]['id']}})[_0xcddb('0x28')](handleEntityNotFound(_0x5c0c2d,null))[_0xcddb('0x28')](function(_0x3e6fe6){if(_0x3e6fe6){_0x47d3f0=_0x3e6fe6;_0x1dd8de['model']=_[_0xcddb('0x34')](db['User'][_0xcddb('0x2f')]);_0x1dd8de[_0xcddb('0x33')]=_[_0xcddb('0x34')](_0x1a42d1[_0xcddb('0x33')]);_0x1dd8de[_0xcddb('0x35')]=_['intersection'](_0x1dd8de[_0xcddb('0x38')],_0x1dd8de[_0xcddb('0x33')]);_0x226761['attributes']=_[_0xcddb('0x36')](_0x1dd8de[_0xcddb('0x38')],qs['fields'](_0x1a42d1[_0xcddb('0x33')][_0xcddb('0x39')]));_0x226761[_0xcddb('0x37')]=_0x226761[_0xcddb('0x37')][_0xcddb('0x3a')]?_0x226761[_0xcddb('0x37')]:_0x1dd8de['model'];_0x226761[_0xcddb('0x3d')]=qs[_0xcddb('0x3e')](_0x1a42d1[_0xcddb('0x33')][_0xcddb('0x3e')]);_0x226761[_0xcddb('0x3f')]=qs[_0xcddb('0x35')](_['pick'](_0x1a42d1[_0xcddb('0x33')],_0x1dd8de[_0xcddb('0x35')]));if(_0x1a42d1[_0xcddb('0x33')]['filter']){_0x226761['where']=_['merge'](_0x226761[_0xcddb('0x3f')],{'$or':_[_0xcddb('0x32')](_0x226761['attributes'],function(_0x510e52){var _0x2ca84b={};_0x2ca84b[_0x510e52]={'$like':'%'+_0x1a42d1[_0xcddb('0x33')]['filter']+'%'};return _0x2ca84b;})});}_0x226761=_[_0xcddb('0x42')]({},_0x226761,_0x1a42d1[_0xcddb('0x43')]);return _0x47d3f0[_0xcddb('0x87')](_0x226761);}})['then'](function(_0x217d40){if(_0x217d40){_0x5557b4=_0x217d40[_0xcddb('0x3a')];if(!_0x1a42d1[_0xcddb('0x33')]['hasOwnProperty'](_0xcddb('0x3c'))){_0x226761['limit']=qs['limit'](_0x1a42d1['query'][_0xcddb('0x21')]);_0x226761['offset']=qs[_0xcddb('0x1f')](_0x1a42d1[_0xcddb('0x33')]['offset']);}return _0x47d3f0[_0xcddb('0x87')](_0x226761);}})[_0xcddb('0x28')](function(_0x34aa0a){if(_0x34aa0a){return _0x34aa0a?{'count':_0x5557b4,'rows':_0x34aa0a}:null;}})[_0xcddb('0x28')](respondWithResult(_0x5c0c2d,null))[_0xcddb('0x48')](handleError(_0x5c0c2d,null));};
\ No newline at end of file
+var _0x033d=['flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','spread','userWhatsappQueue:remove','getAgents','findOne','nolimit','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','get','WhatsappQueues','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','UserWhatsappQueue','pick','WhatsappQueueId','findAndCountAll','UserId','whatsappPause','createdAt','format','updatedAt','getTeams','Team','ids','User','Agents','voicePause','interface'];(function(_0x88bc4d,_0x29aa32){var _0x1a2740=function(_0x2432a9){while(--_0x2432a9){_0x88bc4d['push'](_0x88bc4d['shift']());}};_0x1a2740(++_0x29aa32);}(_0x033d,0x1c3));var _0xd033=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x033d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd033('0x0'));var jsonpatch=require(_0xd033('0x1'));var rp=require(_0xd033('0x2'));var moment=require('moment');var BPromise=require(_0xd033('0x3'));var Mustache=require(_0xd033('0x4'));var util=require(_0xd033('0x5'));var path=require(_0xd033('0x6'));var sox=require('sox');var csv=require(_0xd033('0x7'));var ejs=require(_0xd033('0x8'));var fs=require('fs');var fs_extra=require(_0xd033('0x9'));var _=require(_0xd033('0xa'));var squel=require(_0xd033('0xb'));var crypto=require(_0xd033('0xc'));var jsforce=require(_0xd033('0xd'));var deskjs=require(_0xd033('0xe'));var toCsv=require(_0xd033('0x7'));var querystring=require(_0xd033('0xf'));var Papa=require(_0xd033('0x10'));var Redis=require('ioredis');var authService=require(_0xd033('0x11'));var qs=require(_0xd033('0x12'));var as=require(_0xd033('0x13'));var hardwareService=require(_0xd033('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd033('0x15'));var config=require(_0xd033('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd033('0x17'))['db'];config[_0xd033('0x18')]=_[_0xd033('0x19')](config['redis'],{'host':_0xd033('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xd033('0x1b')](socket);function respondWithStatusCode(_0x5cf78c,_0x4c6bed){_0x4c6bed=_0x4c6bed||0xcc;return function(_0x1ef14c){if(_0x1ef14c){return _0x5cf78c[_0xd033('0x1c')](_0x4c6bed);}return _0x5cf78c[_0xd033('0x1d')](_0x4c6bed)['end']();};}function respondWithResult(_0x449bcd,_0x1b4b48){_0x1b4b48=_0x1b4b48||0xc8;return function(_0x33435a){if(_0x33435a){return _0x449bcd[_0xd033('0x1d')](_0x1b4b48)['json'](_0x33435a);}};}function respondWithFilteredResult(_0x135c5d,_0x2b572d){return function(_0x4b52ea){if(_0x4b52ea){var _0x20e850=typeof _0x2b572d['offset']==='undefined'&&typeof _0x2b572d['limit']===_0xd033('0x1e');var _0x16f29c=_0x4b52ea[_0xd033('0x1f')];var _0x4d8d7d=_0x20e850?0x0:_0x2b572d[_0xd033('0x20')];var _0x40babe=_0x20e850?_0x4b52ea[_0xd033('0x1f')]:_0x2b572d[_0xd033('0x20')]+_0x2b572d[_0xd033('0x21')];var _0x390a67;if(_0x40babe>=_0x16f29c){_0x40babe=_0x16f29c;_0x390a67=0xc8;}else{_0x390a67=0xce;}_0x135c5d[_0xd033('0x1d')](_0x390a67);return _0x135c5d['set'](_0xd033('0x22'),_0x4d8d7d+'-'+_0x40babe+'/'+_0x16f29c)[_0xd033('0x23')](_0x4b52ea);}return null;};}function patchUpdates(_0x4bc9e7){return function(_0x426d86){try{jsonpatch[_0xd033('0x24')](_0x426d86,_0x4bc9e7,!![]);}catch(_0x27844d){return BPromise[_0xd033('0x25')](_0x27844d);}return _0x426d86[_0xd033('0x26')]();};}function saveUpdates(_0x16f5c5,_0x1cf622){return function(_0x299a30){if(_0x299a30){return _0x299a30['update'](_0x16f5c5)[_0xd033('0x27')](function(_0x3de312){return _0x3de312;});}return null;};}function removeEntity(_0x5660c3,_0x2211cb){return function(_0x56f9d8){if(_0x56f9d8){return _0x56f9d8[_0xd033('0x28')]()['then'](function(){var _0x57c1ac=_0x56f9d8[_0xd033('0x29')]({'plain':!![]});var _0x310339=_0xd033('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x310339,'resourceId':_0x57c1ac['id']}})[_0xd033('0x27')](function(){return _0x56f9d8;});})[_0xd033('0x27')](function(){_0x5660c3[_0xd033('0x1d')](0xcc)[_0xd033('0x2b')]();});}};}function handleEntityNotFound(_0x3af488,_0x19ceaf){return function(_0x67d6e2){if(!_0x67d6e2){_0x3af488[_0xd033('0x1c')](0x194);}return _0x67d6e2;};}function handleError(_0x4bdbd0,_0x3e98d9){_0x3e98d9=_0x3e98d9||0x1f4;return function(_0x37efe4){logger[_0xd033('0x2c')](_0x37efe4[_0xd033('0x2d')]);if(_0x37efe4[_0xd033('0x2e')]){delete _0x37efe4[_0xd033('0x2e')];}_0x4bdbd0[_0xd033('0x1d')](_0x3e98d9)[_0xd033('0x2f')](_0x37efe4);};}exports[_0xd033('0x30')]=function(_0x341b4a,_0x31dce4){var _0x26b944={},_0x4b6172={},_0x497a46={'count':0x0,'rows':[]};var _0x272ea4=_[_0xd033('0x31')](db[_0xd033('0x32')][_0xd033('0x33')],function(_0x291763){return{'name':_0x291763[_0xd033('0x34')],'type':_0x291763[_0xd033('0x35')][_0xd033('0x36')]};});_0x4b6172['model']=_[_0xd033('0x31')](_0x272ea4,_0xd033('0x2e'));_0x4b6172[_0xd033('0x37')]=_[_0xd033('0x38')](_0x341b4a[_0xd033('0x37')]);_0x4b6172[_0xd033('0x39')]=_[_0xd033('0x3a')](_0x4b6172[_0xd033('0x3b')],_0x4b6172[_0xd033('0x37')]);_0x26b944['attributes']=_['intersection'](_0x4b6172[_0xd033('0x3b')],qs[_0xd033('0x3c')](_0x341b4a[_0xd033('0x37')]['fields']));_0x26b944[_0xd033('0x3d')]=_0x26b944['attributes'][_0xd033('0x3e')]?_0x26b944['attributes']:_0x4b6172[_0xd033('0x3b')];if(!_0x341b4a[_0xd033('0x37')][_0xd033('0x3f')]('nolimit')){_0x26b944[_0xd033('0x21')]=qs[_0xd033('0x21')](_0x341b4a[_0xd033('0x37')][_0xd033('0x21')]);_0x26b944[_0xd033('0x20')]=qs['offset'](_0x341b4a[_0xd033('0x37')]['offset']);}_0x26b944[_0xd033('0x40')]=qs[_0xd033('0x41')](_0x341b4a[_0xd033('0x37')][_0xd033('0x41')]);_0x26b944['where']=qs[_0xd033('0x39')](_['pick'](_0x341b4a[_0xd033('0x37')],_0x4b6172['filters']),_0x272ea4);if(_0x341b4a[_0xd033('0x37')][_0xd033('0x42')]){_0x26b944[_0xd033('0x43')]=_[_0xd033('0x44')](_0x26b944[_0xd033('0x43')],{'$or':_[_0xd033('0x31')](_0x272ea4,function(_0x5f58ba){if(_0x5f58ba['type']!=='VIRTUAL'){var _0x390d13={};_0x390d13[_0x5f58ba[_0xd033('0x2e')]]={'$like':'%'+_0x341b4a[_0xd033('0x37')][_0xd033('0x42')]+'%'};return _0x390d13;}})});}_0x26b944=_[_0xd033('0x44')]({},_0x26b944,_0x341b4a['options']);var _0x3aae11={'where':_0x26b944[_0xd033('0x43')]};return db['WhatsappQueue'][_0xd033('0x1f')](_0x3aae11)[_0xd033('0x27')](function(_0x7cccad){_0x497a46[_0xd033('0x1f')]=_0x7cccad;if(_0x341b4a[_0xd033('0x37')][_0xd033('0x45')]){_0x26b944[_0xd033('0x46')]=[{'all':!![]}];}return db[_0xd033('0x32')][_0xd033('0x47')](_0x26b944);})[_0xd033('0x27')](function(_0x2d236e){_0x497a46[_0xd033('0x48')]=_0x2d236e;return _0x497a46;})[_0xd033('0x27')](respondWithFilteredResult(_0x31dce4,_0x26b944))[_0xd033('0x49')](handleError(_0x31dce4,null));};exports[_0xd033('0x4a')]=function(_0x23cd29,_0x14a1ed){var _0x342564={'raw':!![],'where':{'id':_0x23cd29['params']['id']}},_0x4b0c46={};_0x4b0c46[_0xd033('0x3b')]=_[_0xd033('0x38')](db[_0xd033('0x32')][_0xd033('0x33')]);_0x4b0c46[_0xd033('0x37')]=_[_0xd033('0x38')](_0x23cd29['query']);_0x4b0c46[_0xd033('0x39')]=_[_0xd033('0x3a')](_0x4b0c46[_0xd033('0x3b')],_0x4b0c46['query']);_0x342564[_0xd033('0x3d')]=_['intersection'](_0x4b0c46['model'],qs[_0xd033('0x3c')](_0x23cd29[_0xd033('0x37')][_0xd033('0x3c')]));_0x342564[_0xd033('0x3d')]=_0x342564['attributes']['length']?_0x342564[_0xd033('0x3d')]:_0x4b0c46[_0xd033('0x3b')];if(_0x23cd29[_0xd033('0x37')][_0xd033('0x45')]){_0x342564[_0xd033('0x46')]=[{'all':!![]}];}_0x342564=_[_0xd033('0x44')]({},_0x342564,_0x23cd29[_0xd033('0x4b')]);return db[_0xd033('0x32')][_0xd033('0x4c')](_0x342564)['then'](handleEntityNotFound(_0x14a1ed,null))[_0xd033('0x27')](respondWithResult(_0x14a1ed,null))[_0xd033('0x49')](handleError(_0x14a1ed,null));};exports['create']=function(_0x40496b,_0x47265a){return db[_0xd033('0x32')][_0xd033('0x4d')](_0x40496b[_0xd033('0x4e')],{})['then'](function(_0x1fcf10){var _0x3e8bbd=_0x40496b[_0xd033('0x4f')][_0xd033('0x29')]({'plain':!![]});if(!_0x3e8bbd)throw new Error(_0xd033('0x50'));if(_0x3e8bbd[_0xd033('0x51')]===_0xd033('0x4f')){var _0x5409ff=_0x1fcf10[_0xd033('0x29')]({'plain':!![]});var _0x4a3fc6='WhatsappQueues';return db['UserProfileSection'][_0xd033('0x4c')]({'where':{'name':_0x4a3fc6,'userProfileId':_0x3e8bbd[_0xd033('0x52')]},'raw':!![]})[_0xd033('0x27')](function(_0x2d7176){if(_0x2d7176&&_0x2d7176[_0xd033('0x53')]===0x0){return db[_0xd033('0x54')][_0xd033('0x4d')]({'name':_0x5409ff[_0xd033('0x2e')],'resourceId':_0x5409ff['id'],'type':_0x2d7176[_0xd033('0x2e')],'sectionId':_0x2d7176['id']},{})[_0xd033('0x27')](function(){return _0x1fcf10;});}else{return _0x1fcf10;}})[_0xd033('0x49')](function(_0x477314){logger[_0xd033('0x2c')](_0xd033('0x55'),_0x477314);throw _0x477314;});}return _0x1fcf10;})[_0xd033('0x27')](respondWithResult(_0x47265a,0xc9))[_0xd033('0x49')](handleError(_0x47265a,null));};exports[_0xd033('0x56')]=function(_0x33e357,_0xff88a1){if(_0x33e357[_0xd033('0x4e')]['id']){delete _0x33e357[_0xd033('0x4e')]['id'];}return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x33e357[_0xd033('0x57')]['id']}})[_0xd033('0x27')](handleEntityNotFound(_0xff88a1,null))[_0xd033('0x27')](saveUpdates(_0x33e357[_0xd033('0x4e')],null))[_0xd033('0x27')](respondWithResult(_0xff88a1,null))[_0xd033('0x49')](handleError(_0xff88a1,null));};exports['destroy']=function(_0x3e1803,_0x179216){return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x3e1803[_0xd033('0x57')]['id']}})['then'](handleEntityNotFound(_0x179216,null))[_0xd033('0x27')](removeEntity(_0x179216,null))[_0xd033('0x49')](handleError(_0x179216,null));};exports[_0xd033('0x58')]=function(_0x1e54df,_0x3f361a){return db[_0xd033('0x32')][_0xd033('0x58')]()[_0xd033('0x27')](respondWithResult(_0x3f361a,null))[_0xd033('0x49')](handleError(_0x3f361a,null));};exports['getMembers']=function(_0x587900,_0x5baf5c,_0x513844){var _0xf97459={'raw':!![],'where':{}},_0x117893={},_0x4114bf;return db[_0xd033('0x32')]['findOne']({'where':{'id':_0x587900[_0xd033('0x57')]['id']}})[_0xd033('0x27')](handleEntityNotFound(_0x5baf5c,null))[_0xd033('0x27')](function(_0x30a495){if(_0x30a495){_0x4114bf=_0x30a495[_0xd033('0x29')]({'plain':!![]});_0x117893[_0xd033('0x3b')]=_[_0xd033('0x38')](db[_0xd033('0x59')]['rawAttributes']);_0x117893['query']=_[_0xd033('0x38')](_0x587900[_0xd033('0x37')]);_0x117893[_0xd033('0x39')]=_['intersection'](_0x117893['model'],_0x117893[_0xd033('0x37')]);_0xf97459[_0xd033('0x3d')]=_[_0xd033('0x3a')](_0x117893['model'],qs['fields'](_0x587900[_0xd033('0x37')][_0xd033('0x3c')]));_0xf97459['attributes']=_0xf97459[_0xd033('0x3d')][_0xd033('0x3e')]?_0xf97459[_0xd033('0x3d')]:_0x117893[_0xd033('0x3b')];if(!_0x587900[_0xd033('0x37')][_0xd033('0x3f')]('nolimit')){_0xf97459[_0xd033('0x21')]=qs[_0xd033('0x21')](_0x587900[_0xd033('0x37')][_0xd033('0x21')]);_0xf97459[_0xd033('0x20')]=qs[_0xd033('0x20')](_0x587900[_0xd033('0x37')][_0xd033('0x20')]);}_0xf97459[_0xd033('0x40')]=qs[_0xd033('0x41')](_0x587900[_0xd033('0x37')][_0xd033('0x41')]);_0xf97459['where']=qs[_0xd033('0x39')](_[_0xd033('0x5a')](_0x587900[_0xd033('0x37')],_0x117893['filters']));_0xf97459[_0xd033('0x43')][_0xd033('0x5b')]=_0x30a495['id'];if(_0x587900['query'][_0xd033('0x42')]){_0xf97459[_0xd033('0x43')]=_[_0xd033('0x44')](_0xf97459[_0xd033('0x43')],{'$or':_[_0xd033('0x31')](_0xf97459[_0xd033('0x3d')],function(_0x34f1a5){var _0x3855ae={};_0x3855ae[_0x34f1a5]={'$like':'%'+_0x587900['query'][_0xd033('0x42')]+'%'};return _0x3855ae;})});}_0xf97459=_[_0xd033('0x44')]({},_0xf97459,_0x587900[_0xd033('0x4b')]);return db[_0xd033('0x59')][_0xd033('0x47')](_0xf97459);}})[_0xd033('0x27')](function(_0x2d0e36){if(_0x2d0e36){return db['User'][_0xd033('0x5c')]({'where':{'id':_[_0xd033('0x31')](_0x2d0e36,_0xd033('0x5d')),'role':'agent'},'attributes':['id',_0xd033('0x2e'),_0xd033('0x5e'),'updatedAt',_0xd033('0x5f')]});}})['then'](function(_0x257872){if(_0x257872){return{'count':_0x257872['count'],'rows':_[_0xd033('0x31')](_0x257872[_0xd033('0x48')],function(_0x1952b7){return{'membername':_0x1952b7['name'],'UserId':_0x1952b7['id'],'queue_name':_0x4114bf[_0xd033('0x2e')],'WhatsappQueueId':_0x4114bf['id'],'interface':util[_0xd033('0x60')]('%s/%s','SIP',_0x1952b7['name']),'penalty':0x0,'paused':_0x1952b7[_0xd033('0x5e')],'createdAt':_0x1952b7[_0xd033('0x5f')],'updatedAt':_0x1952b7[_0xd033('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd033('0x27')](respondWithFilteredResult(_0x5baf5c,_0xf97459))[_0xd033('0x49')](handleError(_0x5baf5c,null));};exports[_0xd033('0x62')]=function(_0x59796d,_0x11f33b,_0x47db23){var _0x210d0e={};var _0x3f6482={};var _0x2886ab;var _0x4cae2a;return db[_0xd033('0x32')]['findOne']({'where':{'id':_0x59796d['params']['id']}})['then'](handleEntityNotFound(_0x11f33b,null))['then'](function(_0x1a481f){if(_0x1a481f){_0x2886ab=_0x1a481f;_0x3f6482[_0xd033('0x3b')]=_['keys'](db[_0xd033('0x63')][_0xd033('0x33')]);_0x3f6482[_0xd033('0x37')]=_[_0xd033('0x38')](_0x59796d['query']);_0x3f6482[_0xd033('0x39')]=_['intersection'](_0x3f6482[_0xd033('0x3b')],_0x3f6482['query']);_0x210d0e[_0xd033('0x3d')]=_['intersection'](_0x3f6482[_0xd033('0x3b')],qs[_0xd033('0x3c')](_0x59796d['query'][_0xd033('0x3c')]));_0x210d0e['attributes']=_0x210d0e[_0xd033('0x3d')]['length']?_0x210d0e[_0xd033('0x3d')]:_0x3f6482[_0xd033('0x3b')];_0x210d0e['order']=qs['sort'](_0x59796d['query']['sort']);_0x210d0e['where']=qs[_0xd033('0x39')](_['pick'](_0x59796d['query'],_0x3f6482['filters']));if(_0x59796d[_0xd033('0x37')][_0xd033('0x42')]){_0x210d0e[_0xd033('0x43')]=_[_0xd033('0x44')](_0x210d0e[_0xd033('0x43')],{'$or':_[_0xd033('0x31')](_0x210d0e['attributes'],function(_0x17cfc6){var _0x214917={};_0x214917[_0x17cfc6]={'$like':'%'+_0x59796d[_0xd033('0x37')][_0xd033('0x42')]+'%'};return _0x214917;})});}_0x210d0e=_[_0xd033('0x44')]({},_0x210d0e,_0x59796d[_0xd033('0x4b')]);return _0x2886ab[_0xd033('0x62')](_0x210d0e);}})['then'](function(_0x46ff2b){if(_0x46ff2b){_0x4cae2a=_0x46ff2b[_0xd033('0x3e')];if(!_0x59796d[_0xd033('0x37')]['hasOwnProperty']('nolimit')){_0x210d0e[_0xd033('0x21')]=qs['limit'](_0x59796d[_0xd033('0x37')][_0xd033('0x21')]);_0x210d0e[_0xd033('0x20')]=qs['offset'](_0x59796d[_0xd033('0x37')][_0xd033('0x20')]);}return _0x2886ab['getTeams'](_0x210d0e);}})[_0xd033('0x27')](function(_0x1042be){if(_0x1042be){return _0x1042be?{'count':_0x4cae2a,'rows':_0x1042be}:null;}})[_0xd033('0x27')](respondWithResult(_0x11f33b,null))[_0xd033('0x49')](handleError(_0x11f33b,null));};exports['addTeams']=function(_0x5dba22,_0x476c9e,_0x4cbf89){var _0x23af5f=_0x5dba22[_0xd033('0x4e')][_0xd033('0x64')];return db['Team'][_0xd033('0x47')]({'where':{'id':_0x23af5f},'attributes':['id'],'include':[{'model':db[_0xd033('0x65')],'as':_0xd033('0x66'),'attributes':['id',_0xd033('0x2e'),'online',_0xd033('0x67'),_0xd033('0x68')],'raw':!![]}]})['then'](function(_0x5045d3){if(_0x5045d3){var _0x94a76f=_[_0xd033('0x69')](_0x5045d3,function(_0x544bea){var _0x3a6c9d=_0x544bea[_0xd033('0x29')]({'plain':!![]});return _0x3a6c9d[_0xd033('0x66')];});return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x5dba22[_0xd033('0x57')]['id']}})[_0xd033('0x27')](function(_0x28f2a1){return db[_0xd033('0x6a')][_0xd033('0x6b')](function(_0x481ce7){return _0x28f2a1[_0xd033('0x6c')](_0x23af5f,{'transaction':_0x481ce7})['then'](function(){return BPromise['each'](_0x94a76f,function(_0xd2e52c){return db[_0xd033('0x59')][_0xd033('0x6d')]({'where':{'UserId':_0xd2e52c['id'],'WhatsappQueueId':_0x5dba22['params']['id']},'transaction':_0x481ce7});});})[_0xd033('0x27')](function(){_0x94a76f[_0xd033('0x6e')](function(_0x17952d){socket['emit'](_0xd033('0x6f'),{'UserId':_0x17952d['id'],'WhatsappQueueId':_0x28f2a1['id']});});});});});}})['then'](respondWithStatusCode(_0x476c9e,null))[_0xd033('0x49')](handleError(_0x476c9e,null));};exports[_0xd033('0x70')]=function(_0x3c3a56,_0x4688dc,_0x4ec8d4){return db[_0xd033('0x63')][_0xd033('0x47')]({'where':{'id':_0x3c3a56[_0xd033('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd033('0x65')],'as':_0xd033('0x66'),'attributes':['id'],'raw':!![]}]})[_0xd033('0x27')](handleEntityNotFound(_0x4688dc,null))[_0xd033('0x27')](function(_0x58de7c){var _0x2dadcf=_['map'](_0x58de7c,'id');var _0x5b06ba=[];var _0x2290ca=[];var _0x559e16=squel[_0xd033('0x71')]();_0x559e16[_0xd033('0x72')]('tq.TeamId')['from']('team_has_whatsapp_queues','tq')[_0xd033('0x73')](_0xd033('0x74'),'ut',_0xd033('0x75'))[_0xd033('0x43')](_0xd033('0x76'),_0x3c3a56[_0xd033('0x57')]['id']);for(var _0x26386f=0x0;_0x26386f<_0x58de7c['length'];_0x26386f+=0x1){let _0x1521a7=_0x58de7c[_0x26386f];for(var _0x4a0b3f=0x0;_0x4a0b3f<_0x1521a7['Agents'][_0xd033('0x3e')];_0x4a0b3f+=0x1){let _0x268e08=_0x1521a7[_0xd033('0x66')][_0x4a0b3f];var _0x10f2ca=_0x559e16[_0xd033('0x77')]();_0x10f2ca['where']('ut.UserId\x20=\x20?',_0x268e08['id']);_0x2290ca[_0xd033('0x78')](db[_0xd033('0x6a')][_0xd033('0x37')](_0x10f2ca['toString'](),{'type':db[_0xd033('0x6a')][_0xd033('0x79')][_0xd033('0x7a')]})['then'](function(_0xabd447){if(_0xabd447[_0xd033('0x3e')]===0x1){return _0x268e08['id'];}else{var _0x1155b7=_[_0xd033('0x7b')](_['map'](_0xabd447,_0xd033('0x7c')),function(_0x1c2965){return _[_0xd033('0x7d')](_0x2dadcf,_0x1c2965);});if(_0x1155b7){return _0x268e08['id'];}}}));}}return BPromise[_0xd033('0x7e')](_0x2290ca)[_0xd033('0x27')](function(_0x504fd7){_0x5b06ba=_(_0x5b06ba)[_0xd033('0x7f')](_0x504fd7)[_0xd033('0x80')]()[_0xd033('0x81')]();return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x3c3a56[_0xd033('0x57')]['id']}})['then'](function(_0x196c37){return db['sequelize'][_0xd033('0x6b')](function(_0x20175a){return _0x196c37[_0xd033('0x70')](_0x3c3a56[_0xd033('0x37')][_0xd033('0x64')],{'transaction':_0x20175a})['then'](function(){if(!_[_0xd033('0x82')](_0x5b06ba)){return _0x196c37[_0xd033('0x83')](_0x5b06ba,{'transaction':_0x20175a});}})['then'](function(){_0x5b06ba[_0xd033('0x6e')](function(_0x3cb819){socket[_0xd033('0x84')]('userWhatsappQueue:remove',{'UserId':_0x3cb819,'WhatsappQueueId':_0x196c37['id']});});});});});});})[_0xd033('0x27')](respondWithStatusCode(_0x4688dc,null))[_0xd033('0x49')](handleError(_0x4688dc,null));};exports['addAgents']=function(_0x45c661,_0xd9b066,_0x743f4a){return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x45c661[_0xd033('0x57')]['id']}})[_0xd033('0x27')](handleEntityNotFound(_0xd9b066,null))[_0xd033('0x27')](function(_0x54ff07){if(_0x54ff07){return _0x54ff07[_0xd033('0x85')](_0x45c661['body'][_0xd033('0x64')],_['omit'](_0x45c661[_0xd033('0x4e')],['ids','id'])||{})[_0xd033('0x86')](function(_0x3a67fc){for(var _0x26d7b1=0x0;_0x26d7b1<_0x45c661[_0xd033('0x4e')][_0xd033('0x64')][_0xd033('0x3e')];_0x26d7b1+=0x1){socket[_0xd033('0x84')]('userWhatsappQueue:save',{'UserId':Number(_0x45c661['body'][_0xd033('0x64')][_0x26d7b1]),'WhatsappQueueId':Number(_0x45c661[_0xd033('0x57')]['id'])});}return _0x3a67fc;});}})['then'](respondWithResult(_0xd9b066,null))[_0xd033('0x49')](handleError(_0xd9b066,null));};exports['removeAgents']=function(_0x5ac379,_0x43d4a7,_0x62b2f1){return db[_0xd033('0x32')]['find']({'where':{'id':_0x5ac379[_0xd033('0x57')]['id']}})[_0xd033('0x27')](handleEntityNotFound(_0x43d4a7,null))[_0xd033('0x27')](function(_0x2db1c9){if(_0x2db1c9){return _0x2db1c9[_0xd033('0x83')](_0x5ac379['query'][_0xd033('0x64')])[_0xd033('0x27')](function(){if(_['isArray'](_0x5ac379[_0xd033('0x37')][_0xd033('0x64')])){for(var _0x10c214=0x0;_0x10c214<_0x5ac379[_0xd033('0x37')][_0xd033('0x64')][_0xd033('0x3e')];_0x10c214+=0x1){socket[_0xd033('0x84')](_0xd033('0x87'),{'UserId':Number(_0x5ac379['query'][_0xd033('0x64')][_0x10c214]),'WhatsappQueueId':Number(_0x5ac379['params']['id'])});}}else{socket[_0xd033('0x84')]('userWhatsappQueue:remove',{'UserId':Number(_0x5ac379[_0xd033('0x37')][_0xd033('0x64')]),'WhatsappQueueId':Number(_0x5ac379['params']['id'])});}});}})[_0xd033('0x27')](respondWithStatusCode(_0x43d4a7,null))[_0xd033('0x49')](handleError(_0x43d4a7,null));};exports[_0xd033('0x88')]=function(_0x328bfd,_0x5056b4,_0x5f2f3b){var _0x504dff={};var _0xb5deb1={};var _0x4f6e10;var _0x2cfe82;return db[_0xd033('0x32')][_0xd033('0x89')]({'where':{'id':_0x328bfd[_0xd033('0x57')]['id']}})['then'](handleEntityNotFound(_0x5056b4,null))['then'](function(_0x2c6f0b){if(_0x2c6f0b){_0x4f6e10=_0x2c6f0b;_0xb5deb1['model']=_['keys'](db[_0xd033('0x65')][_0xd033('0x33')]);_0xb5deb1[_0xd033('0x37')]=_[_0xd033('0x38')](_0x328bfd[_0xd033('0x37')]);_0xb5deb1[_0xd033('0x39')]=_[_0xd033('0x3a')](_0xb5deb1[_0xd033('0x3b')],_0xb5deb1[_0xd033('0x37')]);_0x504dff[_0xd033('0x3d')]=_[_0xd033('0x3a')](_0xb5deb1['model'],qs['fields'](_0x328bfd[_0xd033('0x37')][_0xd033('0x3c')]));_0x504dff[_0xd033('0x3d')]=_0x504dff[_0xd033('0x3d')][_0xd033('0x3e')]?_0x504dff[_0xd033('0x3d')]:_0xb5deb1['model'];_0x504dff[_0xd033('0x40')]=qs[_0xd033('0x41')](_0x328bfd[_0xd033('0x37')][_0xd033('0x41')]);_0x504dff[_0xd033('0x43')]=qs[_0xd033('0x39')](_[_0xd033('0x5a')](_0x328bfd[_0xd033('0x37')],_0xb5deb1[_0xd033('0x39')]));if(_0x328bfd[_0xd033('0x37')][_0xd033('0x42')]){_0x504dff[_0xd033('0x43')]=_['merge'](_0x504dff[_0xd033('0x43')],{'$or':_[_0xd033('0x31')](_0x504dff['attributes'],function(_0x1ead0e){var _0x1121c0={};_0x1121c0[_0x1ead0e]={'$like':'%'+_0x328bfd[_0xd033('0x37')][_0xd033('0x42')]+'%'};return _0x1121c0;})});}_0x504dff=_[_0xd033('0x44')]({},_0x504dff,_0x328bfd['options']);return _0x4f6e10[_0xd033('0x88')](_0x504dff);}})[_0xd033('0x27')](function(_0x183961){if(_0x183961){_0x2cfe82=_0x183961[_0xd033('0x3e')];if(!_0x328bfd['query'][_0xd033('0x3f')](_0xd033('0x8a'))){_0x504dff[_0xd033('0x21')]=qs['limit'](_0x328bfd['query']['limit']);_0x504dff[_0xd033('0x20')]=qs[_0xd033('0x20')](_0x328bfd[_0xd033('0x37')][_0xd033('0x20')]);}return _0x4f6e10[_0xd033('0x88')](_0x504dff);}})[_0xd033('0x27')](function(_0x181d27){if(_0x181d27){return _0x181d27?{'count':_0x2cfe82,'rows':_0x181d27}:null;}})[_0xd033('0x27')](respondWithResult(_0x5056b4,null))['catch'](handleError(_0x5056b4,null));};
\ No newline at end of file
index 4ffc8eb..2d2f517 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc168=['save','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x4b9e47,_0x813d6d){var _0x4630ed=function(_0x38e60f){while(--_0x38e60f){_0x4b9e47['push'](_0x4b9e47['shift']());}};_0x4630ed(++_0x813d6d);}(_0xc168,0x99));var _0x8c16=function(_0x1f940a,_0x11e9ee){_0x1f940a=_0x1f940a-0x0;var _0x57ed43=_0xc168[_0x1f940a];return _0x57ed43;};'use strict';var EventEmitter=require(_0x8c16('0x0'));var WhatsappQueue=require(_0x8c16('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8c16('0x2')](0x0);var events={'afterCreate':_0x8c16('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d9232){return function(_0xe0a054,_0x11042c,_0x2345e3){WhatsappQueueEvents['emit'](_0x3d9232+':'+_0xe0a054['id'],_0xe0a054);WhatsappQueueEvents[_0x8c16('0x4')](_0x3d9232,_0xe0a054);_0x2345e3(null);};}for(var e in events){if(events[_0x8c16('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0x2943=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0x2943,0x17d));var _0x3294=function(_0x5df59f,_0xf11a72){_0x5df59f=_0x5df59f-0x0;var _0x190e3b=_0x2943[_0x5df59f];return _0x190e3b;};'use strict';var EventEmitter=require(_0x3294('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3294('0x1')](0x0);var events={'afterCreate':_0x3294('0x2'),'afterUpdate':_0x3294('0x3'),'afterDestroy':_0x3294('0x4')};function emitEvent(_0x160dab){return function(_0x2945f6,_0x4661e8,_0xb63708){WhatsappQueueEvents[_0x3294('0x5')](_0x160dab+':'+_0x2945f6['id'],_0x2945f6);WhatsappQueueEvents[_0x3294('0x5')](_0x160dab,_0x2945f6);_0xb63708(null);};}for(var e in events){if(events[_0x3294('0x6')](e)){var event=events[e];WhatsappQueue[_0x3294('0x7')](e,emitEvent(event));}}module[_0x3294('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
index 8b70702..d43ef4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeeae=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xeeae,0x14a));var _0xeeea=function(_0x3ce53b,_0x30bbcc){_0x3ce53b=_0x3ce53b-0x0;var _0x7fa584=_0xeeae[_0x3ce53b];return _0x7fa584;};'use strict';var _=require('lodash');var util=require(_0xeeea('0x0'));var logger=require(_0xeeea('0x1'))(_0xeeea('0x2'));var moment=require(_0xeeea('0x3'));var BPromise=require(_0xeeea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeeea('0x5'));var rimraf=require(_0xeeea('0x6'));var config=require(_0xeeea('0x7'));var attributes=require(_0xeeea('0x8'));module['exports']=function(_0x18fbd7,_0x3799ed){return _0x18fbd7[_0xeeea('0x9')](_0xeeea('0xa'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2631=['whatsapp_queues','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue'];(function(_0x43bc7f,_0x541ed7){var _0x2c8c7b=function(_0x4a9704){while(--_0x4a9704){_0x43bc7f['push'](_0x43bc7f['shift']());}};_0x2c8c7b(++_0x541ed7);}(_0x2631,0x1ed));var _0x1263=function(_0x13c126,_0xe31995){_0x13c126=_0x13c126-0x0;var _0x106010=_0x2631[_0x13c126];return _0x106010;};'use strict';var _=require(_0x1263('0x0'));var util=require(_0x1263('0x1'));var logger=require('../../config/logger')(_0x1263('0x2'));var moment=require(_0x1263('0x3'));var BPromise=require('bluebird');var rp=require(_0x1263('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1263('0x5'));var config=require(_0x1263('0x6'));var attributes=require(_0x1263('0x7'));module[_0x1263('0x8')]=function(_0x1fd9d6,_0x53beae){return _0x1fd9d6[_0x1263('0x9')](_0x1263('0xa'),attributes,{'tableName':_0x1263('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 587782a..71a407f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4613=['limit','include','map','model','then','ShowWhatsappQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','findAll','options','attributes'];(function(_0x1d2d64,_0x2d61fa){var _0x1846d6=function(_0x3d2880){while(--_0x3d2880){_0x1d2d64['push'](_0x1d2d64['shift']());}};_0x1846d6(++_0x2d61fa);}(_0x4613,0x19d));var _0x3461=function(_0x505d68,_0x2bd0b5){_0x505d68=_0x505d68-0x0;var _0x84384c=_0x4613[_0x505d68];return _0x84384c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3461('0x0'));var BPromise=require(_0x3461('0x1'));var rs=require(_0x3461('0x2'));var fs=require('fs');var Redis=require(_0x3461('0x3'));var db=require(_0x3461('0x4'))['db'];var utils=require(_0x3461('0x5'));var logger=require('../../config/logger')(_0x3461('0x6'));var config=require(_0x3461('0x7'));var jayson=require(_0x3461('0x8'));var client=jayson[_0x3461('0x9')][_0x3461('0xa')]({'port':0x232a});config[_0x3461('0xb')]=_[_0x3461('0xc')](config[_0x3461('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3461('0xd'))(new Redis(config[_0x3461('0xb')]));require(_0x3461('0xe'))['register'](socket);function respondWithRpcPromise(_0x4181d1,_0x46a449,_0xf214c){return new BPromise(function(_0x49bbcd,_0x503011){return client[_0x3461('0xf')](_0x4181d1,_0xf214c)['then'](function(_0xeb1cb1){logger[_0x3461('0x10')](_0x3461('0x11'),_0x46a449,_0x3461('0x12'));logger[_0x3461('0x13')](_0x3461('0x14'),_0x46a449,_0x3461('0x12'),JSON[_0x3461('0x15')](_0xeb1cb1));if(_0xeb1cb1['error']){if(_0xeb1cb1[_0x3461('0x16')][_0x3461('0x17')]===0x1f4){logger['error'](_0x3461('0x11'),_0x46a449,_0xeb1cb1[_0x3461('0x16')][_0x3461('0x18')]);return _0x503011(_0xeb1cb1[_0x3461('0x16')][_0x3461('0x18')]);}logger['error'](_0x3461('0x11'),_0x46a449,_0xeb1cb1[_0x3461('0x16')][_0x3461('0x18')]);return _0x49bbcd(_0xeb1cb1['error']['message']);}else{logger[_0x3461('0x10')](_0x3461('0x11'),_0x46a449,_0x3461('0x12'));_0x49bbcd(_0xeb1cb1[_0x3461('0x19')][_0x3461('0x18')]);}})[_0x3461('0x1a')](function(_0x597152){logger[_0x3461('0x16')](_0x3461('0x11'),_0x46a449,_0x597152);_0x503011(_0x597152);});});}exports[_0x3461('0x1b')]=function(_0x243ba0){var _0x44353b=this;return new Promise(function(_0x2e6d66,_0x20c4a4){return db['WhatsappQueue'][_0x3461('0x1c')]({'raw':_0x243ba0[_0x3461('0x1d')]?_0x243ba0[_0x3461('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x243ba0[_0x3461('0x1d')]?_0x243ba0[_0x3461('0x1d')]['where']||null:null,'attributes':_0x243ba0[_0x3461('0x1d')]?_0x243ba0[_0x3461('0x1d')][_0x3461('0x1e')]||null:null,'limit':_0x243ba0[_0x3461('0x1d')]?_0x243ba0[_0x3461('0x1d')][_0x3461('0x1f')]||null:null,'include':_0x243ba0[_0x3461('0x1d')]?_0x243ba0[_0x3461('0x1d')][_0x3461('0x20')]?_[_0x3461('0x21')](_0x243ba0[_0x3461('0x1d')][_0x3461('0x20')],function(_0x4b51e4){return{'model':db[_0x4b51e4[_0x3461('0x22')]],'as':_0x4b51e4['as'],'attributes':_0x4b51e4['attributes'],'include':_0x4b51e4['include']?_[_0x3461('0x21')](_0x4b51e4['include'],function(_0x3acce0){return{'model':db[_0x3acce0['model']],'as':_0x3acce0['as'],'attributes':_0x3acce0[_0x3461('0x1e')],'include':_0x3acce0[_0x3461('0x20')]?_[_0x3461('0x21')](_0x3acce0['include'],function(_0xffec5f){return{'model':db[_0xffec5f[_0x3461('0x22')]],'as':_0xffec5f['as'],'attributes':_0xffec5f[_0x3461('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3461('0x23')](function(_0x5aae21){logger[_0x3461('0x10')]('GetWhatsappQueue',_0x243ba0);logger[_0x3461('0x13')](_0x3461('0x1b'),_0x243ba0,JSON[_0x3461('0x15')](_0x5aae21));_0x2e6d66(_0x5aae21);})[_0x3461('0x1a')](function(_0x44c06a){logger[_0x3461('0x16')]('GetWhatsappQueue',_0x44c06a[_0x3461('0x18')],_0x243ba0);_0x20c4a4(_0x44353b[_0x3461('0x16')](0x1f4,_0x44c06a[_0x3461('0x18')]));});});};exports['ShowWhatsappQueue']=function(_0x462dcc){var _0x7f6073=this;return new Promise(function(_0xb04178,_0x35df4d){return db['WhatsappQueue']['find']({'raw':_0x462dcc[_0x3461('0x1d')]?_0x462dcc[_0x3461('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x462dcc[_0x3461('0x1d')]?_0x462dcc[_0x3461('0x1d')]['where']||null:null,'attributes':_0x462dcc[_0x3461('0x1d')]?_0x462dcc[_0x3461('0x1d')][_0x3461('0x1e')]||null:null,'include':_0x462dcc[_0x3461('0x1d')]?_0x462dcc[_0x3461('0x1d')][_0x3461('0x20')]?_['map'](_0x462dcc[_0x3461('0x1d')]['include'],function(_0x4d1f65){return{'model':db[_0x4d1f65[_0x3461('0x22')]],'as':_0x4d1f65['as'],'attributes':_0x4d1f65[_0x3461('0x1e')],'include':_0x4d1f65[_0x3461('0x20')]?_['map'](_0x4d1f65['include'],function(_0x584c5e){return{'model':db[_0x584c5e[_0x3461('0x22')]],'as':_0x584c5e['as'],'attributes':_0x584c5e[_0x3461('0x1e')],'include':_0x584c5e[_0x3461('0x20')]?_['map'](_0x584c5e[_0x3461('0x20')],function(_0x117ab2){return{'model':db[_0x117ab2['model']],'as':_0x117ab2['as'],'attributes':_0x117ab2[_0x3461('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3461('0x23')](function(_0x3f2b70){logger[_0x3461('0x10')]('ShowWhatsappQueue',_0x462dcc);logger[_0x3461('0x13')](_0x3461('0x24'),_0x462dcc,JSON[_0x3461('0x15')](_0x3f2b70));_0xb04178(_0x3f2b70);})[_0x3461('0x1a')](function(_0x2bf3ce){logger[_0x3461('0x16')](_0x3461('0x24'),_0x2bf3ce[_0x3461('0x18')],_0x462dcc);_0x35df4d(_0x7f6073[_0x3461('0x16')](0x1f4,_0x2bf3ce['message']));});});};
\ No newline at end of file
+var _0xaaed=['raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappQueue,\x20%s,\x20%s','result','catch','findAll','options','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','find'];(function(_0x5413a4,_0x53d031){var _0x547ac2=function(_0x2b48c2){while(--_0x2b48c2){_0x5413a4['push'](_0x5413a4['shift']());}};_0x547ac2(++_0x53d031);}(_0xaaed,0x19b));var _0xdaae=function(_0x294542,_0x5605a7){_0x294542=_0x294542-0x0;var _0x1af437=_0xaaed[_0x294542];return _0x1af437;};'use strict';var _=require(_0xdaae('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdaae('0x1'));var rs=require(_0xdaae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaae('0x3'))['db'];var utils=require(_0xdaae('0x4'));var logger=require(_0xdaae('0x5'))(_0xdaae('0x6'));var config=require(_0xdaae('0x7'));var jayson=require(_0xdaae('0x8'));var client=jayson[_0xdaae('0x9')]['http']({'port':0x232a});config[_0xdaae('0xa')]=_[_0xdaae('0xb')](config[_0xdaae('0xa')],{'host':_0xdaae('0xc'),'port':0x18eb});var socket=require(_0xdaae('0xd'))(new Redis(config[_0xdaae('0xa')]));require(_0xdaae('0xe'))[_0xdaae('0xf')](socket);function respondWithRpcPromise(_0x51abb1,_0x5e83ba,_0x146d08){return new BPromise(function(_0xbfb421,_0x306749){return client[_0xdaae('0x10')](_0x51abb1,_0x146d08)[_0xdaae('0x11')](function(_0x38394d){logger[_0xdaae('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x5e83ba,_0xdaae('0x13'));logger[_0xdaae('0x14')](_0xdaae('0x15'),_0x5e83ba,'request\x20sent',JSON[_0xdaae('0x16')](_0x38394d));if(_0x38394d[_0xdaae('0x17')]){if(_0x38394d[_0xdaae('0x17')]['code']===0x1f4){logger[_0xdaae('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x5e83ba,_0x38394d[_0xdaae('0x17')][_0xdaae('0x18')]);return _0x306749(_0x38394d[_0xdaae('0x17')][_0xdaae('0x18')]);}logger[_0xdaae('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x5e83ba,_0x38394d[_0xdaae('0x17')][_0xdaae('0x18')]);return _0xbfb421(_0x38394d[_0xdaae('0x17')]['message']);}else{logger['info'](_0xdaae('0x19'),_0x5e83ba,_0xdaae('0x13'));_0xbfb421(_0x38394d[_0xdaae('0x1a')]['message']);}})[_0xdaae('0x1b')](function(_0x4081a8){logger[_0xdaae('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x5e83ba,_0x4081a8);_0x306749(_0x4081a8);});});}exports['GetWhatsappQueue']=function(_0x2f17c4){var _0x411753=this;return new Promise(function(_0x464d85,_0x28e066){return db['WhatsappQueue'][_0xdaae('0x1c')]({'raw':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')][_0xdaae('0x1e')]||null:null,'attributes':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')][_0xdaae('0x1f')]||null:null,'limit':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')][_0xdaae('0x20')]||null:null,'include':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')][_0xdaae('0x21')]?_[_0xdaae('0x22')](_0x2f17c4['options'][_0xdaae('0x21')],function(_0x39ed09){return{'model':db[_0x39ed09['model']],'as':_0x39ed09['as'],'attributes':_0x39ed09['attributes'],'include':_0x39ed09[_0xdaae('0x21')]?_['map'](_0x39ed09[_0xdaae('0x21')],function(_0x25cd68){return{'model':db[_0x25cd68['model']],'as':_0x25cd68['as'],'attributes':_0x25cd68[_0xdaae('0x1f')],'include':_0x25cd68[_0xdaae('0x21')]?_['map'](_0x25cd68[_0xdaae('0x21')],function(_0x5eac11){return{'model':db[_0x5eac11[_0xdaae('0x23')]],'as':_0x5eac11['as'],'attributes':_0x5eac11[_0xdaae('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdaae('0x11')](function(_0x49a7ed){logger[_0xdaae('0x12')](_0xdaae('0x24'),_0x2f17c4);logger['debug']('GetWhatsappQueue',_0x2f17c4,JSON[_0xdaae('0x16')](_0x49a7ed));_0x464d85(_0x49a7ed);})[_0xdaae('0x1b')](function(_0x5dea0f){logger[_0xdaae('0x17')](_0xdaae('0x24'),_0x5dea0f[_0xdaae('0x18')],_0x2f17c4);_0x28e066(_0x411753[_0xdaae('0x17')](0x1f4,_0x5dea0f[_0xdaae('0x18')]));});});};exports[_0xdaae('0x25')]=function(_0x46a111){var _0x523d80=this;return new Promise(function(_0x47ce7c,_0x2a4775){return db[_0xdaae('0x26')][_0xdaae('0x27')]({'raw':_0x46a111[_0xdaae('0x1d')]?_0x46a111[_0xdaae('0x1d')][_0xdaae('0x28')]===undefined?!![]:![]:!![],'where':_0x46a111[_0xdaae('0x1d')]?_0x46a111[_0xdaae('0x1d')][_0xdaae('0x1e')]||null:null,'attributes':_0x46a111[_0xdaae('0x1d')]?_0x46a111['options']['attributes']||null:null,'include':_0x46a111[_0xdaae('0x1d')]?_0x46a111[_0xdaae('0x1d')]['include']?_['map'](_0x46a111[_0xdaae('0x1d')][_0xdaae('0x21')],function(_0x407231){return{'model':db[_0x407231[_0xdaae('0x23')]],'as':_0x407231['as'],'attributes':_0x407231[_0xdaae('0x1f')],'include':_0x407231[_0xdaae('0x21')]?_[_0xdaae('0x22')](_0x407231[_0xdaae('0x21')],function(_0x4a1642){return{'model':db[_0x4a1642[_0xdaae('0x23')]],'as':_0x4a1642['as'],'attributes':_0x4a1642[_0xdaae('0x1f')],'include':_0x4a1642['include']?_[_0xdaae('0x22')](_0x4a1642['include'],function(_0x52a3b0){return{'model':db[_0x52a3b0[_0xdaae('0x23')]],'as':_0x52a3b0['as'],'attributes':_0x52a3b0['attributes']};}):[]};}):[]};}):[]:[]})[_0xdaae('0x11')](function(_0x2b3cbe){logger['info'](_0xdaae('0x25'),_0x46a111);logger[_0xdaae('0x14')]('ShowWhatsappQueue',_0x46a111,JSON[_0xdaae('0x16')](_0x2b3cbe));_0x47ce7c(_0x2b3cbe);})[_0xdaae('0x1b')](function(_0x460434){logger[_0xdaae('0x17')](_0xdaae('0x25'),_0x460434[_0xdaae('0x18')],_0x46a111);_0x2a4775(_0x523d80[_0xdaae('0x17')](0x1f4,_0x460434[_0xdaae('0x18')]));});});};
\ No newline at end of file
index 8e9f320..896fc86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bb4=['./whatsappQueue.events','save','remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8bb4,0x1b9));var _0x48bb=function(_0x487d38,_0x2a7f23){_0x487d38=_0x487d38-0x0;var _0x51c8ab=_0x8bb4[_0x487d38];return _0x51c8ab;};'use strict';var WhatsappQueueEvents=require(_0x48bb('0x0'));var events=[_0x48bb('0x1'),_0x48bb('0x2'),_0x48bb('0x3')];function createListener(_0x3ea5c7,_0x5dba28){return function(_0x4e0f6d){_0x5dba28[_0x48bb('0x4')](_0x3ea5c7,_0x4e0f6d);};}function removeListener(_0x5b019d,_0x45db31){return function(){WhatsappQueueEvents[_0x48bb('0x5')](_0x5b019d,_0x45db31);};}exports[_0x48bb('0x6')]=function(_0x391de3){for(var _0x1849e0=0x0,_0x4cec34=events[_0x48bb('0x7')];_0x1849e0<_0x4cec34;_0x1849e0++){var _0x615650=events[_0x1849e0];var _0x5169bb=createListener(_0x48bb('0x8')+_0x615650,_0x391de3);WhatsappQueueEvents['on'](_0x615650,_0x5169bb);}};
\ No newline at end of file
+var _0x5f37=['whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener','register'];(function(_0x465b0c,_0x569d90){var _0x502ff0=function(_0x221757){while(--_0x221757){_0x465b0c['push'](_0x465b0c['shift']());}};_0x502ff0(++_0x569d90);}(_0x5f37,0x1cf));var _0x75f3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5f37[_0x2641f9];return _0x585741;};'use strict';var WhatsappQueueEvents=require(_0x75f3('0x0'));var events=[_0x75f3('0x1'),'remove',_0x75f3('0x2')];function createListener(_0x245534,_0x29b812){return function(_0x2fba84){_0x29b812[_0x75f3('0x3')](_0x245534,_0x2fba84);};}function removeListener(_0x1685ec,_0x2ac107){return function(){WhatsappQueueEvents[_0x75f3('0x4')](_0x1685ec,_0x2ac107);};}exports[_0x75f3('0x5')]=function(_0x102b15){for(var _0x46dcd2=0x0,_0x1eb1e7=events['length'];_0x46dcd2<_0x1eb1e7;_0x46dcd2++){var _0x34cf4a=events[_0x46dcd2];var _0x4f7233=createListener(_0x75f3('0x6')+_0x34cf4a,_0x102b15);WhatsappQueueEvents['on'](_0x34cf4a,_0x4f7233);}};
\ No newline at end of file
index 7aa37e0..453b7c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7041=['create','put','update','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x1b3ed9,_0x23c04){var _0x5a8e35=function(_0x3247d8){while(--_0x3247d8){_0x1b3ed9['push'](_0x1b3ed9['shift']());}};_0x5a8e35(++_0x23c04);}(_0x7041,0xb7));var _0x1704=function(_0x593699,_0xeb5988){_0x593699=_0x593699-0x0;var _0x1b7118=_0x7041[_0x593699];return _0x1b7118;};'use strict';var multer=require(_0x1704('0x0'));var util=require('util');var path=require(_0x1704('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1704('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1704('0x3'));var interaction=require(_0x1704('0x4'));var config=require(_0x1704('0x5'));var controller=require(_0x1704('0x6'));router[_0x1704('0x7')]('/',auth[_0x1704('0x8')](),controller['index']);router[_0x1704('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x1704('0x9')]);router[_0x1704('0x7')](_0x1704('0xa'),auth['isAuthenticated'](),controller[_0x1704('0xb')]);router['post']('/',auth[_0x1704('0x8')](),controller[_0x1704('0xc')]);router[_0x1704('0xd')](_0x1704('0xa'),auth[_0x1704('0x8')](),controller[_0x1704('0xe')]);router['delete'](_0x1704('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0dd9=['path','connect-timeout','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0dd9,0x14f));var _0x90dd=function(_0x424476,_0x5e2a30){_0x424476=_0x424476-0x0;var _0x1e5ab5=_0x0dd9[_0x424476];return _0x1e5ab5;};'use strict';var multer=require(_0x90dd('0x0'));var util=require('util');var path=require(_0x90dd('0x1'));var timeout=require(_0x90dd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x90dd('0x3'));var config=require('../../config/environment');var controller=require(_0x90dd('0x4'));router[_0x90dd('0x5')]('/',auth[_0x90dd('0x6')](),controller[_0x90dd('0x7')]);router[_0x90dd('0x5')]('/describe',auth[_0x90dd('0x6')](),controller[_0x90dd('0x8')]);router[_0x90dd('0x5')](_0x90dd('0x9'),auth[_0x90dd('0x6')](),controller[_0x90dd('0xa')]);router[_0x90dd('0xb')]('/',auth[_0x90dd('0x6')](),controller[_0x90dd('0xc')]);router[_0x90dd('0xd')](_0x90dd('0x9'),auth[_0x90dd('0x6')](),controller[_0x90dd('0xe')]);router['delete'](_0x90dd('0x9'),auth['isAuthenticated'](),controller[_0x90dd('0xf')]);module['exports']=router;
\ No newline at end of file
index e232ed5..f9381bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0xf4bfe9,_0x136b8a){var _0x45af53=function(_0x3b3b93){while(--_0x3b3b93){_0xf4bfe9['push'](_0xf4bfe9['shift']());}};_0x45af53(++_0x136b8a);}(_0x7a54,0x106));var _0x47a5=function(_0x5810c9,_0xb5d129){_0x5810c9=_0x5810c9-0x0;var _0x146d71=_0x7a54[_0x5810c9];return _0x146d71;};'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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x149bf0,_0x50654c){var _0x5c3302=function(_0x3a270f){while(--_0x3a270f){_0x149bf0['push'](_0x149bf0['shift']());}};_0x5c3302(++_0x50654c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
index 82954bd..e3b6624 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9354=['rows','show','keys','length','find','catch','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','offset','sort','filter','where','merge','type','options','includeAll','include','findAll'];(function(_0x2f1753,_0x458f6d){var _0x56a164=function(_0x1e36dd){while(--_0x1e36dd){_0x2f1753['push'](_0x2f1753['shift']());}};_0x56a164(++_0x458f6d);}(_0x9354,0x96));var _0x4935=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0x9354[_0x4d21ff];return _0x22b554;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x344e51,_0x1c37ba){return function(_0x3784f9){if(!_0x3784f9){_0x344e51[_0x4935('0x17')](0x194);}return _0x3784f9;};}function handleError(_0x2e1583,_0xf4abb2){_0xf4abb2=_0xf4abb2||0x1f4;return function(_0x1d08b5){logger[_0x4935('0x24')](_0x1d08b5[_0x4935('0x25')]);if(_0x1d08b5[_0x4935('0x26')]){delete _0x1d08b5[_0x4935('0x26')];}_0x2e1583['status'](_0xf4abb2)['send'](_0x1d08b5);};}exports['index']=function(_0x1fc218,_0x76ea7d){var _0x4f1163={},_0x3f0707={},_0x20755a={'count':0x0,'rows':[]};var _0x24a3b6=_[_0x4935('0x27')](db[_0x4935('0x28')][_0x4935('0x29')],function(_0x28afc2){return{'name':_0x28afc2[_0x4935('0x2a')],'type':_0x28afc2['type'][_0x4935('0x2b')]};});_0x3f0707[_0x4935('0x2c')]=_['map'](_0x24a3b6,'name');_0x3f0707[_0x4935('0x2d')]=_['keys'](_0x1fc218[_0x4935('0x2d')]);_0x3f0707[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x3f0707['model'],_0x3f0707['query']);_0x4f1163[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x3f0707['model'],qs[_0x4935('0x31')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x31')]));_0x4f1163[_0x4935('0x30')]=_0x4f1163[_0x4935('0x30')]['length']?_0x4f1163['attributes']:_0x3f0707[_0x4935('0x2c')];if(!_0x1fc218[_0x4935('0x2d')]['hasOwnProperty']('nolimit')){_0x4f1163[_0x4935('0x1c')]=qs['limit'](_0x1fc218[_0x4935('0x2d')][_0x4935('0x1c')]);_0x4f1163[_0x4935('0x32')]=qs[_0x4935('0x32')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x32')]);}_0x4f1163['order']=qs[_0x4935('0x33')](_0x1fc218['query'][_0x4935('0x33')]);_0x4f1163['where']=qs[_0x4935('0x2e')](_['pick'](_0x1fc218[_0x4935('0x2d')],_0x3f0707[_0x4935('0x2e')]),_0x24a3b6);if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x34')]){_0x4f1163[_0x4935('0x35')]=_[_0x4935('0x36')](_0x4f1163[_0x4935('0x35')],{'$or':_['map'](_0x24a3b6,function(_0x57e1ca){if(_0x57e1ca[_0x4935('0x37')]!=='VIRTUAL'){var _0x4e8b2e={};_0x4e8b2e[_0x57e1ca[_0x4935('0x26')]]={'$like':'%'+_0x1fc218['query'][_0x4935('0x34')]+'%'};return _0x4e8b2e;}})});}_0x4f1163=_[_0x4935('0x36')]({},_0x4f1163,_0x1fc218[_0x4935('0x38')]);var _0x99b7c5={'where':_0x4f1163[_0x4935('0x35')]};return db['WhatsappQueueReport']['count'](_0x99b7c5)[_0x4935('0x22')](function(_0x2be169){_0x20755a[_0x4935('0x1d')]=_0x2be169;if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x39')]){_0x4f1163[_0x4935('0x3a')]=[{'all':!![]}];}return db[_0x4935('0x28')][_0x4935('0x3b')](_0x4f1163);})['then'](function(_0x4e94f6){_0x20755a[_0x4935('0x3c')]=_0x4e94f6;return _0x20755a;})[_0x4935('0x22')](respondWithFilteredResult(_0x76ea7d,_0x4f1163))['catch'](handleError(_0x76ea7d,null));};exports[_0x4935('0x3d')]=function(_0x157950,_0x4706eb){var _0xe5c9f5={'raw':!![],'where':{'id':_0x157950['params']['id']}},_0x52ab0c={};_0x52ab0c[_0x4935('0x2c')]=_[_0x4935('0x3e')](db['WhatsappQueueReport'][_0x4935('0x29')]);_0x52ab0c[_0x4935('0x2d')]=_[_0x4935('0x3e')](_0x157950['query']);_0x52ab0c[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],_0x52ab0c[_0x4935('0x2d')]);_0xe5c9f5[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],qs[_0x4935('0x31')](_0x157950[_0x4935('0x2d')][_0x4935('0x31')]));_0xe5c9f5[_0x4935('0x30')]=_0xe5c9f5[_0x4935('0x30')][_0x4935('0x3f')]?_0xe5c9f5[_0x4935('0x30')]:_0x52ab0c[_0x4935('0x2c')];if(_0x157950[_0x4935('0x2d')][_0x4935('0x39')]){_0xe5c9f5[_0x4935('0x3a')]=[{'all':!![]}];}_0xe5c9f5=_['merge']({},_0xe5c9f5,_0x157950[_0x4935('0x38')]);return db['WhatsappQueueReport'][_0x4935('0x40')](_0xe5c9f5)[_0x4935('0x22')](handleEntityNotFound(_0x4706eb,null))[_0x4935('0x22')](respondWithResult(_0x4706eb,null))[_0x4935('0x41')](handleError(_0x4706eb,null));};exports['create']=function(_0x2a3404,_0x9c8bad){return db[_0x4935('0x28')][_0x4935('0x42')](_0x2a3404[_0x4935('0x43')],{})[_0x4935('0x22')](respondWithResult(_0x9c8bad,0xc9))[_0x4935('0x41')](handleError(_0x9c8bad,null));};exports[_0x4935('0x21')]=function(_0x29b932,_0x392cba){if(_0x29b932['body']['id']){delete _0x29b932[_0x4935('0x43')]['id'];}return db[_0x4935('0x28')]['find']({'where':{'id':_0x29b932[_0x4935('0x44')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x392cba,null))[_0x4935('0x22')](saveUpdates(_0x29b932[_0x4935('0x43')],null))[_0x4935('0x22')](respondWithResult(_0x392cba,null))[_0x4935('0x41')](handleError(_0x392cba,null));};exports[_0x4935('0x23')]=function(_0x471fb1,_0x4b9c70){return db[_0x4935('0x28')]['find']({'where':{'id':_0x471fb1['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4b9c70,null))[_0x4935('0x22')](removeEntity(_0x4b9c70,null))[_0x4935('0x41')](handleError(_0x4b9c70,null));};exports[_0x4935('0x45')]=function(_0x2dd30f,_0x487cf3){return db[_0x4935('0x28')][_0x4935('0x45')]()[_0x4935('0x22')](respondWithResult(_0x487cf3,null))[_0x4935('0x41')](handleError(_0x487cf3,null));};
\ No newline at end of file
+var _0x4024=['rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x4024,0x89));var _0x4402=function(_0x519b65,_0x54f8e3){_0x519b65=_0x519b65-0x0;var _0x131184=_0x4024[_0x519b65];return _0x131184;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){_0x258d10['status'](0xcc)[_0x4402('0x15')]();});}};}function handleEntityNotFound(_0x4e1c04,_0x3733cd){return function(_0x5ab28d){if(!_0x5ab28d){_0x4e1c04[_0x4402('0x13')](0x194);}return _0x5ab28d;};}function handleError(_0x211424,_0x5a43d0){_0x5a43d0=_0x5a43d0||0x1f4;return function(_0x15c19f){logger['error'](_0x15c19f['stack']);if(_0x15c19f[_0x4402('0x21')]){delete _0x15c19f[_0x4402('0x21')];}_0x211424[_0x4402('0x14')](_0x5a43d0)[_0x4402('0x22')](_0x15c19f);};}exports[_0x4402('0x23')]=function(_0x514e41,_0x41de44){var _0x52e625={},_0x71da2f={},_0x1e2340={'count':0x0,'rows':[]};var _0x42dd32=_['map'](db[_0x4402('0x24')][_0x4402('0x25')],function(_0x316239){return{'name':_0x316239[_0x4402('0x26')],'type':_0x316239[_0x4402('0x27')][_0x4402('0x28')]};});_0x71da2f[_0x4402('0x29')]=_[_0x4402('0x2a')](_0x42dd32,_0x4402('0x21'));_0x71da2f[_0x4402('0x2b')]=_[_0x4402('0x2c')](_0x514e41['query']);_0x71da2f[_0x4402('0x2d')]=_['intersection'](_0x71da2f[_0x4402('0x29')],_0x71da2f['query']);_0x52e625[_0x4402('0x2e')]=_[_0x4402('0x2f')](_0x71da2f[_0x4402('0x29')],qs[_0x4402('0x30')](_0x514e41[_0x4402('0x2b')]['fields']));_0x52e625[_0x4402('0x2e')]=_0x52e625[_0x4402('0x2e')][_0x4402('0x31')]?_0x52e625['attributes']:_0x71da2f[_0x4402('0x29')];if(!_0x514e41[_0x4402('0x2b')]['hasOwnProperty'](_0x4402('0x32'))){_0x52e625[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x514e41[_0x4402('0x2b')][_0x4402('0x19')]);_0x52e625[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x514e41[_0x4402('0x2b')][_0x4402('0x17')]);}_0x52e625['order']=qs[_0x4402('0x33')](_0x514e41[_0x4402('0x2b')][_0x4402('0x33')]);_0x52e625['where']=qs[_0x4402('0x2d')](_[_0x4402('0x34')](_0x514e41['query'],_0x71da2f['filters']),_0x42dd32);if(_0x514e41[_0x4402('0x2b')][_0x4402('0x35')]){_0x52e625[_0x4402('0x36')]=_[_0x4402('0x37')](_0x52e625['where'],{'$or':_['map'](_0x42dd32,function(_0x4b0672){if(_0x4b0672[_0x4402('0x27')]!==_0x4402('0x38')){var _0xcbfa06={};_0xcbfa06[_0x4b0672[_0x4402('0x21')]]={'$like':'%'+_0x514e41['query'][_0x4402('0x35')]+'%'};return _0xcbfa06;}})});}_0x52e625=_[_0x4402('0x37')]({},_0x52e625,_0x514e41[_0x4402('0x39')]);var _0x57843d={'where':_0x52e625[_0x4402('0x36')]};return db['WhatsappQueueReport'][_0x4402('0x1a')](_0x57843d)[_0x4402('0x1f')](function(_0x5c74b1){_0x1e2340[_0x4402('0x1a')]=_0x5c74b1;if(_0x514e41['query'][_0x4402('0x3a')]){_0x52e625[_0x4402('0x3b')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x4402('0x3c')](_0x52e625);})[_0x4402('0x1f')](function(_0x250f09){_0x1e2340[_0x4402('0x3d')]=_0x250f09;return _0x1e2340;})['then'](respondWithFilteredResult(_0x41de44,_0x52e625))['catch'](handleError(_0x41de44,null));};exports[_0x4402('0x3e')]=function(_0x47a3a3,_0x3a589b){var _0x2a6d78={'raw':!![],'where':{'id':_0x47a3a3[_0x4402('0x3f')]['id']}},_0xb9cf85={};_0xb9cf85[_0x4402('0x29')]=_[_0x4402('0x2c')](db[_0x4402('0x24')][_0x4402('0x25')]);_0xb9cf85[_0x4402('0x2b')]=_[_0x4402('0x2c')](_0x47a3a3['query']);_0xb9cf85[_0x4402('0x2d')]=_[_0x4402('0x2f')](_0xb9cf85['model'],_0xb9cf85[_0x4402('0x2b')]);_0x2a6d78[_0x4402('0x2e')]=_['intersection'](_0xb9cf85[_0x4402('0x29')],qs[_0x4402('0x30')](_0x47a3a3[_0x4402('0x2b')][_0x4402('0x30')]));_0x2a6d78[_0x4402('0x2e')]=_0x2a6d78['attributes'][_0x4402('0x31')]?_0x2a6d78[_0x4402('0x2e')]:_0xb9cf85[_0x4402('0x29')];if(_0x47a3a3[_0x4402('0x2b')][_0x4402('0x3a')]){_0x2a6d78[_0x4402('0x3b')]=[{'all':!![]}];}_0x2a6d78=_[_0x4402('0x37')]({},_0x2a6d78,_0x47a3a3[_0x4402('0x39')]);return db[_0x4402('0x24')][_0x4402('0x40')](_0x2a6d78)[_0x4402('0x1f')](handleEntityNotFound(_0x3a589b,null))['then'](respondWithResult(_0x3a589b,null))[_0x4402('0x41')](handleError(_0x3a589b,null));};exports['create']=function(_0xc45af6,_0x34ce00){return db['WhatsappQueueReport'][_0x4402('0x42')](_0xc45af6[_0x4402('0x43')],{})[_0x4402('0x1f')](respondWithResult(_0x34ce00,0xc9))[_0x4402('0x41')](handleError(_0x34ce00,null));};exports[_0x4402('0x1e')]=function(_0x2503eb,_0x5b094b){if(_0x2503eb[_0x4402('0x43')]['id']){delete _0x2503eb[_0x4402('0x43')]['id'];}return db[_0x4402('0x24')][_0x4402('0x40')]({'where':{'id':_0x2503eb[_0x4402('0x3f')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x5b094b,null))[_0x4402('0x1f')](saveUpdates(_0x2503eb[_0x4402('0x43')],null))[_0x4402('0x1f')](respondWithResult(_0x5b094b,null))['catch'](handleError(_0x5b094b,null));};exports['destroy']=function(_0x5ab12b,_0x4c2d2e){return db[_0x4402('0x24')][_0x4402('0x40')]({'where':{'id':_0x5ab12b[_0x4402('0x3f')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x4c2d2e,null))['then'](removeEntity(_0x4c2d2e,null))[_0x4402('0x41')](handleError(_0x4c2d2e,null));};exports[_0x4402('0x44')]=function(_0x203b33,_0x2a4ea7){return db[_0x4402('0x24')][_0x4402('0x44')]()[_0x4402('0x1f')](respondWithResult(_0x2a4ea7,null))['catch'](handleError(_0x2a4ea7,null));};
\ No newline at end of file
index 39bfd17..a39a6cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a64=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0xa825a3,_0x294848){var _0x1383b2=function(_0x1469c8){while(--_0x1469c8){_0xa825a3['push'](_0xa825a3['shift']());}};_0x1383b2(++_0x294848);}(_0x0a64,0xb1));var _0x40a6=function(_0x91c9d6,_0x4bfa45){_0x91c9d6=_0x91c9d6-0x0;var _0x13de68=_0x0a64[_0x91c9d6];return _0x13de68;};'use strict';var _=require(_0x40a6('0x0'));var util=require(_0x40a6('0x1'));var logger=require(_0x40a6('0x2'))(_0x40a6('0x3'));var moment=require(_0x40a6('0x4'));var BPromise=require(_0x40a6('0x5'));var rp=require(_0x40a6('0x6'));var fs=require('fs');var path=require(_0x40a6('0x7'));var rimraf=require(_0x40a6('0x8'));var config=require(_0x40a6('0x9'));var attributes=require(_0x40a6('0xa'));module['exports']=function(_0x2c3aa0,_0x23f64a){return _0x2c3aa0[_0x40a6('0xb')](_0x40a6('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x40a6('0xd'),'fields':[_0x40a6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2313=['uniqueid','lodash','util','api','bluebird','request-promise','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2313,0x109));var _0x3231=function(_0x335307,_0x2ed107){_0x335307=_0x335307-0x0;var _0x32394d=_0x2313[_0x335307];return _0x32394d;};'use strict';var _=require(_0x3231('0x0'));var util=require(_0x3231('0x1'));var logger=require('../../config/logger')(_0x3231('0x2'));var moment=require('moment');var BPromise=require(_0x3231('0x3'));var rp=require(_0x3231('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3231('0x5'));var attributes=require(_0x3231('0x6'));module['exports']=function(_0x184adc,_0x54c0d8){return _0x184adc[_0x3231('0x7')](_0x3231('0x8'),attributes,{'tableName':_0x3231('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3231('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index c2ed8db..f61b98e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8c7=['message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','update','raw','UpdateWhatsappQueueReport','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','WhatsappQueueReport,\x20%s,\x20%s'];(function(_0xc812a0,_0x37a9d3){var _0x14f339=function(_0x12e92d){while(--_0x12e92d){_0xc812a0['push'](_0xc812a0['shift']());}};_0x14f339(++_0x37a9d3);}(_0xf8c7,0xc7));var _0x7f8c=function(_0x337765,_0x507704){_0x337765=_0x337765-0x0;var _0x2ace46=_0xf8c7[_0x337765];return _0x2ace46;};'use strict';var _=require('lodash');var util=require(_0x7f8c('0x0'));var moment=require('moment');var BPromise=require(_0x7f8c('0x1'));var rs=require(_0x7f8c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f8c('0x3'))['db'];var utils=require(_0x7f8c('0x4'));var logger=require('../../config/logger')(_0x7f8c('0x5'));var config=require('../../config/environment');var jayson=require(_0x7f8c('0x6'));var client=jayson[_0x7f8c('0x7')][_0x7f8c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3847e9,_0x43b438,_0x1521bf){return new BPromise(function(_0x32bfb9,_0x4638b2){return client[_0x7f8c('0x9')](_0x3847e9,_0x1521bf)[_0x7f8c('0xa')](function(_0x4fba9f){logger[_0x7f8c('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x43b438,_0x7f8c('0xc'));logger[_0x7f8c('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x43b438,_0x7f8c('0xc'),JSON[_0x7f8c('0xe')](_0x4fba9f));if(_0x4fba9f['error']){if(_0x4fba9f[_0x7f8c('0xf')]['code']===0x1f4){logger[_0x7f8c('0xf')](_0x7f8c('0x10'),_0x43b438,_0x4fba9f[_0x7f8c('0xf')]['message']);return _0x4638b2(_0x4fba9f[_0x7f8c('0xf')]['message']);}logger[_0x7f8c('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x43b438,_0x4fba9f[_0x7f8c('0xf')][_0x7f8c('0x11')]);return _0x32bfb9(_0x4fba9f[_0x7f8c('0xf')][_0x7f8c('0x11')]);}else{logger['info'](_0x7f8c('0x10'),_0x43b438,'request\x20sent');_0x32bfb9(_0x4fba9f[_0x7f8c('0x12')][_0x7f8c('0x11')]);}})[_0x7f8c('0x13')](function(_0x4f9254){logger['error'](_0x7f8c('0x10'),_0x43b438,_0x4f9254);_0x4638b2(_0x4f9254);});});}exports[_0x7f8c('0x14')]=function(_0x22488d){var _0x1e5f89=this;return new Promise(function(_0x12f3fe,_0x431191){return db[_0x7f8c('0x15')]['create'](_0x22488d[_0x7f8c('0x16')],{'raw':_0x22488d[_0x7f8c('0x17')]?_0x22488d[_0x7f8c('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x25300f){logger[_0x7f8c('0xb')](_0x7f8c('0x14'),_0x22488d);logger['debug'](_0x7f8c('0x14'),_0x22488d,JSON[_0x7f8c('0xe')](_0x25300f));_0x12f3fe(_0x25300f);})[_0x7f8c('0x13')](function(_0x1d8f7d){logger[_0x7f8c('0xf')](_0x7f8c('0x14'),_0x1d8f7d[_0x7f8c('0x11')],_0x22488d);_0x431191(_0x1e5f89[_0x7f8c('0xf')](0x1f4,_0x1d8f7d[_0x7f8c('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x4f1230){var _0x1bf849=this;return new Promise(function(_0x3fd280,_0x497e16){return db[_0x7f8c('0x15')][_0x7f8c('0x18')](_0x4f1230[_0x7f8c('0x16')],{'raw':_0x4f1230['options']?_0x4f1230['options'][_0x7f8c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f1230['options']?_0x4f1230[_0x7f8c('0x17')]['where']||null:null,'attributes':_0x4f1230['options']?_0x4f1230['options']['attributes']||null:null,'limit':_0x4f1230[_0x7f8c('0x17')]?_0x4f1230[_0x7f8c('0x17')]['limit']||null:null})[_0x7f8c('0xa')](function(_0x410789){logger[_0x7f8c('0xb')](_0x7f8c('0x1a'),_0x4f1230);logger[_0x7f8c('0xd')](_0x7f8c('0x1a'),_0x4f1230,JSON['stringify'](_0x410789));_0x3fd280(_0x410789);})['catch'](function(_0x147971){logger['error'](_0x7f8c('0x1a'),_0x147971['message'],_0x4f1230);_0x497e16(_0x1bf849[_0x7f8c('0xf')](0x1f4,_0x147971[_0x7f8c('0x11')]));});});};
\ No newline at end of file
+var _0xa336=['../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','debug','UpdateWhatsappQueueReport','update','body','where','attributes','limit','stringify','moment','bluebird','randomstring','ioredis'];(function(_0x4ac6a3,_0x59939a){var _0x317ceb=function(_0xebd516){while(--_0xebd516){_0x4ac6a3['push'](_0x4ac6a3['shift']());}};_0x317ceb(++_0x59939a);}(_0xa336,0x18f));var _0x6a33=function(_0x4cd9c6,_0x766862){_0x4cd9c6=_0x4cd9c6-0x0;var _0x53a566=_0xa336[_0x4cd9c6];return _0x53a566;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a33('0x0'));var BPromise=require(_0x6a33('0x1'));var rs=require(_0x6a33('0x2'));var fs=require('fs');var Redis=require(_0x6a33('0x3'));var db=require(_0x6a33('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a33('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6a33('0x6'));var client=jayson[_0x6a33('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d0e4a,_0x3ff94a,_0x1a9cd7){return new BPromise(function(_0x412912,_0x3abb0f){return client[_0x6a33('0x8')](_0x5d0e4a,_0x1a9cd7)[_0x6a33('0x9')](function(_0x373ef6){logger[_0x6a33('0xa')](_0x6a33('0xb'),_0x3ff94a,_0x6a33('0xc'));logger['debug'](_0x6a33('0xd'),_0x3ff94a,_0x6a33('0xc'),JSON['stringify'](_0x373ef6));if(_0x373ef6[_0x6a33('0xe')]){if(_0x373ef6['error'][_0x6a33('0xf')]===0x1f4){logger['error'](_0x6a33('0xb'),_0x3ff94a,_0x373ef6[_0x6a33('0xe')]['message']);return _0x3abb0f(_0x373ef6['error'][_0x6a33('0x10')]);}logger[_0x6a33('0xe')](_0x6a33('0xb'),_0x3ff94a,_0x373ef6['error']['message']);return _0x412912(_0x373ef6['error']['message']);}else{logger[_0x6a33('0xa')](_0x6a33('0xb'),_0x3ff94a,_0x6a33('0xc'));_0x412912(_0x373ef6['result'][_0x6a33('0x10')]);}})[_0x6a33('0x11')](function(_0x10b998){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x3ff94a,_0x10b998);_0x3abb0f(_0x10b998);});});}exports[_0x6a33('0x12')]=function(_0x214e46){var _0x5917ac=this;return new Promise(function(_0x287fcb,_0x4c3afc){return db[_0x6a33('0x13')][_0x6a33('0x14')](_0x214e46['body'],{'raw':_0x214e46['options']?_0x214e46[_0x6a33('0x15')][_0x6a33('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5b8b34){logger[_0x6a33('0xa')]('CreateWhatsappQueueReport',_0x214e46);logger[_0x6a33('0x17')](_0x6a33('0x12'),_0x214e46,JSON['stringify'](_0x5b8b34));_0x287fcb(_0x5b8b34);})[_0x6a33('0x11')](function(_0x1c5af0){logger[_0x6a33('0xe')](_0x6a33('0x12'),_0x1c5af0['message'],_0x214e46);_0x4c3afc(_0x5917ac[_0x6a33('0xe')](0x1f4,_0x1c5af0[_0x6a33('0x10')]));});});};exports[_0x6a33('0x18')]=function(_0x3a6d17){var _0x504e05=this;return new Promise(function(_0x5dd5e6,_0xd637f3){return db[_0x6a33('0x13')][_0x6a33('0x19')](_0x3a6d17[_0x6a33('0x1a')],{'raw':_0x3a6d17[_0x6a33('0x15')]?_0x3a6d17[_0x6a33('0x15')][_0x6a33('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a6d17['options']?_0x3a6d17['options'][_0x6a33('0x1b')]||null:null,'attributes':_0x3a6d17[_0x6a33('0x15')]?_0x3a6d17['options'][_0x6a33('0x1c')]||null:null,'limit':_0x3a6d17[_0x6a33('0x15')]?_0x3a6d17[_0x6a33('0x15')][_0x6a33('0x1d')]||null:null})['then'](function(_0x5ceb13){logger['info']('UpdateWhatsappQueueReport',_0x3a6d17);logger[_0x6a33('0x17')](_0x6a33('0x18'),_0x3a6d17,JSON[_0x6a33('0x1e')](_0x5ceb13));_0x5dd5e6(_0x5ceb13);})['catch'](function(_0x8d3fd2){logger['error'](_0x6a33('0x18'),_0x8d3fd2['message'],_0x3a6d17);_0xd637f3(_0x504e05[_0x6a33('0xe')](0x1f4,_0x8d3fd2['message']));});});};
\ No newline at end of file
index e7644bb..46e6eca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe45e=['put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xe45e,0x1cc));var _0xee45=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xe45e[_0x19b3f9];return _0x18c3f6;};'use strict';var multer=require('multer');var util=require(_0xee45('0x0'));var path=require(_0xee45('0x1'));var timeout=require(_0xee45('0x2'));var express=require('express');var router=express[_0xee45('0x3')]();var fs_extra=require(_0xee45('0x4'));var auth=require(_0xee45('0x5'));var interaction=require(_0xee45('0x6'));var config=require(_0xee45('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xee45('0x8')]('/',auth[_0xee45('0x9')](),controller[_0xee45('0xa')]);router[_0xee45('0x8')]('/describe',auth[_0xee45('0x9')](),controller[_0xee45('0xb')]);router[_0xee45('0x8')](_0xee45('0xc'),auth['isAuthenticated'](),controller[_0xee45('0xd')]);router[_0xee45('0xe')]('/',auth[_0xee45('0x9')](),controller['create']);router[_0xee45('0xf')](_0xee45('0xc'),auth[_0xee45('0x9')](),controller[_0xee45('0x10')]);router[_0xee45('0x11')]('/:id',auth[_0xee45('0x9')](),controller['destroy']);module[_0xee45('0x12')]=router;
\ No newline at end of file
+var _0xf61d=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x17a13a,_0x1c34d7){var _0x47f771=function(_0x2a1900){while(--_0x2a1900){_0x17a13a['push'](_0x17a13a['shift']());}};_0x47f771(++_0x1c34d7);}(_0xf61d,0x70));var _0xdf61=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0xf61d[_0x24697b];return _0x585b99;};'use strict';var multer=require(_0xdf61('0x0'));var util=require(_0xdf61('0x1'));var path=require(_0xdf61('0x2'));var timeout=require(_0xdf61('0x3'));var express=require(_0xdf61('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdf61('0x5'));var interaction=require(_0xdf61('0x6'));var config=require(_0xdf61('0x7'));var controller=require(_0xdf61('0x8'));router[_0xdf61('0x9')]('/',auth[_0xdf61('0xa')](),controller[_0xdf61('0xb')]);router['get'](_0xdf61('0xc'),auth[_0xdf61('0xa')](),controller[_0xdf61('0xd')]);router['get'](_0xdf61('0xe'),auth[_0xdf61('0xa')](),controller[_0xdf61('0xf')]);router[_0xdf61('0x10')]('/',auth[_0xdf61('0xa')](),controller[_0xdf61('0x11')]);router[_0xdf61('0x12')](_0xdf61('0xe'),auth[_0xdf61('0xa')](),controller[_0xdf61('0x13')]);router[_0xdf61('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xdf61('0x15')]);module[_0xdf61('0x16')]=router;
\ No newline at end of file
index 0c67903..f183fda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d05=['STRING','ENUM','account','DATE','sequelize','exports'];(function(_0xf7974d,_0xbab05e){var _0xb831ea=function(_0x5857cb){while(--_0x5857cb){_0xf7974d['push'](_0xf7974d['shift']());}};_0xb831ea(++_0xbab05e);}(_0x8d05,0xe8));var _0x58d0=function(_0x6b65a,_0xc8eda1){_0x6b65a=_0x6b65a-0x0;var _0x27deeb=_0x8d05[_0x6b65a];return _0x27deeb;};'use strict';var Sequelize=require(_0x58d0('0x0'));module[_0x58d0('0x1')]={'uniqueid':{'type':Sequelize[_0x58d0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x58d0('0x3')](_0x58d0('0x4'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x58d0('0x5')]}};
\ No newline at end of file
+var _0x8d62=['agent','queue','DATE','exports','STRING','ENUM','account'];(function(_0x10b7d7,_0x1c17d0){var _0x504b28=function(_0x2c943a){while(--_0x2c943a){_0x10b7d7['push'](_0x10b7d7['shift']());}};_0x504b28(++_0x1c17d0);}(_0x8d62,0xf8));var _0x28d6=function(_0x5d08db,_0x2d7d3d){_0x5d08db=_0x5d08db-0x0;var _0x3d1307=_0x8d62[_0x5d08db];return _0x3d1307;};'use strict';var Sequelize=require('sequelize');module[_0x28d6('0x0')]={'uniqueid':{'type':Sequelize[_0x28d6('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x28d6('0x2')](_0x28d6('0x3'),_0x28d6('0x4'),_0x28d6('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x28d6('0x6')]}};
\ No newline at end of file
index d0ff822..3fa4652 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceef=['sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x2b17e7,_0x4bdb5e){var _0x29eea8=function(_0x14bb07){while(--_0x14bb07){_0x2b17e7['push'](_0x2b17e7['shift']());}};_0x29eea8(++_0x4bdb5e);}(_0xceef,0xf6));var _0xfcee=function(_0x146907,_0x541dcb){_0x146907=_0x146907-0x0;var _0x47e370=_0xceef[_0x146907];return _0x47e370;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfcee('0x0'));var jsonpatch=require(_0xfcee('0x1'));var rp=require('request-promise');var moment=require(_0xfcee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfcee('0x3'));var util=require(_0xfcee('0x4'));var path=require('path');var sox=require(_0xfcee('0x5'));var csv=require(_0xfcee('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcee('0x7'));var squel=require(_0xfcee('0x8'));var crypto=require(_0xfcee('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfcee('0x6'));var querystring=require(_0xfcee('0xa'));var Papa=require(_0xfcee('0xb'));var Redis=require(_0xfcee('0xc'));var authService=require(_0xfcee('0xd'));var qs=require(_0xfcee('0xe'));var as=require(_0xfcee('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcee('0x10'))(_0xfcee('0x11'));var utils=require(_0xfcee('0x12'));var config=require(_0xfcee('0x13'));var licenseUtil=require(_0xfcee('0x14'));var db=require(_0xfcee('0x15'))['db'];function respondWithStatusCode(_0x153f5f,_0x40d95f){_0x40d95f=_0x40d95f||0xcc;return function(_0xd889ef){if(_0xd889ef){return _0x153f5f['sendStatus'](_0x40d95f);}return _0x153f5f[_0xfcee('0x16')](_0x40d95f)[_0xfcee('0x17')]();};}function respondWithResult(_0x57a336,_0x49f23b){_0x49f23b=_0x49f23b||0xc8;return function(_0x260897){if(_0x260897){return _0x57a336[_0xfcee('0x16')](_0x49f23b)[_0xfcee('0x18')](_0x260897);}};}function respondWithFilteredResult(_0x856738,_0x264bed){return function(_0x2dded0){if(_0x2dded0){var _0x486334=typeof _0x264bed[_0xfcee('0x19')]===_0xfcee('0x1a')&&typeof _0x264bed[_0xfcee('0x1b')]==='undefined';var _0x12a9b6=_0x2dded0[_0xfcee('0x1c')];var _0x45c690=_0x486334?0x0:_0x264bed['offset'];var _0x37fa9c=_0x486334?_0x2dded0[_0xfcee('0x1c')]:_0x264bed[_0xfcee('0x19')]+_0x264bed[_0xfcee('0x1b')];var _0x50ae0e;if(_0x37fa9c>=_0x12a9b6){_0x37fa9c=_0x12a9b6;_0x50ae0e=0xc8;}else{_0x50ae0e=0xce;}_0x856738['status'](_0x50ae0e);return _0x856738[_0xfcee('0x1d')](_0xfcee('0x1e'),_0x45c690+'-'+_0x37fa9c+'/'+_0x12a9b6)[_0xfcee('0x18')](_0x2dded0);}return null;};}function patchUpdates(_0xa1c368){return function(_0xe3d469){try{jsonpatch[_0xfcee('0x1f')](_0xe3d469,_0xa1c368,!![]);}catch(_0x13d08d){return BPromise['reject'](_0x13d08d);}return _0xe3d469[_0xfcee('0x20')]();};}function saveUpdates(_0x513690,_0x5d8b52){return function(_0x1c9556){if(_0x1c9556){return _0x1c9556[_0xfcee('0x21')](_0x513690)[_0xfcee('0x22')](function(_0xaef3e6){return _0xaef3e6;});}return null;};}function removeEntity(_0x4fb8cb,_0x463df4){return function(_0x17694f){if(_0x17694f){return _0x17694f[_0xfcee('0x23')]()[_0xfcee('0x22')](function(){_0x4fb8cb[_0xfcee('0x16')](0xcc)[_0xfcee('0x17')]();});}};}function handleEntityNotFound(_0x475a48,_0x15acda){return function(_0x37d46){if(!_0x37d46){_0x475a48[_0xfcee('0x24')](0x194);}return _0x37d46;};}function handleError(_0x4f18c2,_0x4ffe57){_0x4ffe57=_0x4ffe57||0x1f4;return function(_0x56c9f7){logger[_0xfcee('0x25')](_0x56c9f7[_0xfcee('0x26')]);if(_0x56c9f7[_0xfcee('0x27')]){delete _0x56c9f7[_0xfcee('0x27')];}_0x4f18c2[_0xfcee('0x16')](_0x4ffe57)[_0xfcee('0x28')](_0x56c9f7);};}exports[_0xfcee('0x29')]=function(_0x3a2ae2,_0x2869ee){var _0x59eb7e={},_0x2dc32={},_0x366e2f={'count':0x0,'rows':[]};var _0x4723ab=_[_0xfcee('0x2a')](db[_0xfcee('0x2b')][_0xfcee('0x2c')],function(_0x16536e){return{'name':_0x16536e['fieldName'],'type':_0x16536e[_0xfcee('0x2d')][_0xfcee('0x2e')]};});_0x2dc32[_0xfcee('0x2f')]=_[_0xfcee('0x2a')](_0x4723ab,_0xfcee('0x27'));_0x2dc32[_0xfcee('0x30')]=_[_0xfcee('0x31')](_0x3a2ae2[_0xfcee('0x30')]);_0x2dc32[_0xfcee('0x32')]=_[_0xfcee('0x33')](_0x2dc32['model'],_0x2dc32[_0xfcee('0x30')]);_0x59eb7e['attributes']=_[_0xfcee('0x33')](_0x2dc32[_0xfcee('0x2f')],qs[_0xfcee('0x34')](_0x3a2ae2['query']['fields']));_0x59eb7e[_0xfcee('0x35')]=_0x59eb7e['attributes'][_0xfcee('0x36')]?_0x59eb7e[_0xfcee('0x35')]:_0x2dc32[_0xfcee('0x2f')];if(!_0x3a2ae2[_0xfcee('0x30')][_0xfcee('0x37')](_0xfcee('0x38'))){_0x59eb7e[_0xfcee('0x1b')]=qs['limit'](_0x3a2ae2['query'][_0xfcee('0x1b')]);_0x59eb7e['offset']=qs[_0xfcee('0x19')](_0x3a2ae2[_0xfcee('0x30')][_0xfcee('0x19')]);}_0x59eb7e[_0xfcee('0x39')]=qs[_0xfcee('0x3a')](_0x3a2ae2['query']['sort']);_0x59eb7e[_0xfcee('0x3b')]=qs[_0xfcee('0x32')](_[_0xfcee('0x3c')](_0x3a2ae2[_0xfcee('0x30')],_0x2dc32[_0xfcee('0x32')]),_0x4723ab);if(_0x3a2ae2[_0xfcee('0x30')][_0xfcee('0x3d')]){_0x59eb7e['where']=_['merge'](_0x59eb7e[_0xfcee('0x3b')],{'$or':_[_0xfcee('0x2a')](_0x4723ab,function(_0x5798b3){if(_0x5798b3['type']!==_0xfcee('0x3e')){var _0x357c50={};_0x357c50[_0x5798b3[_0xfcee('0x27')]]={'$like':'%'+_0x3a2ae2[_0xfcee('0x30')][_0xfcee('0x3d')]+'%'};return _0x357c50;}})});}_0x59eb7e=_[_0xfcee('0x3f')]({},_0x59eb7e,_0x3a2ae2['options']);var _0x185c57={'where':_0x59eb7e[_0xfcee('0x3b')]};return db[_0xfcee('0x2b')][_0xfcee('0x1c')](_0x185c57)[_0xfcee('0x22')](function(_0xd1bd5){_0x366e2f['count']=_0xd1bd5;if(_0x3a2ae2['query'][_0xfcee('0x40')]){_0x59eb7e[_0xfcee('0x41')]=[{'all':!![]}];}return db[_0xfcee('0x2b')][_0xfcee('0x42')](_0x59eb7e);})['then'](function(_0x28f786){_0x366e2f[_0xfcee('0x43')]=_0x28f786;return _0x366e2f;})[_0xfcee('0x22')](respondWithFilteredResult(_0x2869ee,_0x59eb7e))[_0xfcee('0x44')](handleError(_0x2869ee,null));};exports[_0xfcee('0x45')]=function(_0x2bbba6,_0x4f3c5d){var _0x3ba3d1={'raw':!![],'where':{'id':_0x2bbba6['params']['id']}},_0x474ed9={};_0x474ed9[_0xfcee('0x2f')]=_[_0xfcee('0x31')](db[_0xfcee('0x2b')]['rawAttributes']);_0x474ed9[_0xfcee('0x30')]=_[_0xfcee('0x31')](_0x2bbba6[_0xfcee('0x30')]);_0x474ed9['filters']=_[_0xfcee('0x33')](_0x474ed9[_0xfcee('0x2f')],_0x474ed9[_0xfcee('0x30')]);_0x3ba3d1[_0xfcee('0x35')]=_[_0xfcee('0x33')](_0x474ed9['model'],qs['fields'](_0x2bbba6[_0xfcee('0x30')]['fields']));_0x3ba3d1[_0xfcee('0x35')]=_0x3ba3d1['attributes'][_0xfcee('0x36')]?_0x3ba3d1[_0xfcee('0x35')]:_0x474ed9[_0xfcee('0x2f')];if(_0x2bbba6[_0xfcee('0x30')][_0xfcee('0x40')]){_0x3ba3d1['include']=[{'all':!![]}];}_0x3ba3d1=_[_0xfcee('0x3f')]({},_0x3ba3d1,_0x2bbba6[_0xfcee('0x46')]);return db['WhatsappTransferReport'][_0xfcee('0x47')](_0x3ba3d1)[_0xfcee('0x22')](handleEntityNotFound(_0x4f3c5d,null))[_0xfcee('0x22')](respondWithResult(_0x4f3c5d,null))[_0xfcee('0x44')](handleError(_0x4f3c5d,null));};exports['create']=function(_0x264a46,_0x59f52e){return db[_0xfcee('0x2b')][_0xfcee('0x48')](_0x264a46[_0xfcee('0x49')],{})['then'](respondWithResult(_0x59f52e,0xc9))[_0xfcee('0x44')](handleError(_0x59f52e,null));};exports['update']=function(_0x110e71,_0xbce801){if(_0x110e71[_0xfcee('0x49')]['id']){delete _0x110e71[_0xfcee('0x49')]['id'];}return db[_0xfcee('0x2b')]['find']({'where':{'id':_0x110e71[_0xfcee('0x4a')]['id']}})['then'](handleEntityNotFound(_0xbce801,null))[_0xfcee('0x22')](saveUpdates(_0x110e71['body'],null))['then'](respondWithResult(_0xbce801,null))[_0xfcee('0x44')](handleError(_0xbce801,null));};exports[_0xfcee('0x23')]=function(_0x42a2b6,_0xa45d96){return db['WhatsappTransferReport'][_0xfcee('0x47')]({'where':{'id':_0x42a2b6[_0xfcee('0x4a')]['id']}})[_0xfcee('0x22')](handleEntityNotFound(_0xa45d96,null))['then'](removeEntity(_0xa45d96,null))[_0xfcee('0x44')](handleError(_0xa45d96,null));};exports[_0xfcee('0x4b')]=function(_0x63622d,_0x2af5e0){return db[_0xfcee('0x2b')][_0xfcee('0x4b')]()[_0xfcee('0x22')](respondWithResult(_0x2af5e0,null))[_0xfcee('0x44')](handleError(_0x2af5e0,null));};
\ No newline at end of file
+var _0xe2d8=['bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','WhatsappTransferReport','type','key','query','filters','model','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x4358cb,_0x1f1c23){var _0x59a7e4=function(_0x5a1e15){while(--_0x5a1e15){_0x4358cb['push'](_0x4358cb['shift']());}};_0x59a7e4(++_0x1f1c23);}(_0xe2d8,0x11f));var _0x8e2d=function(_0x658305,_0x53aa13){_0x658305=_0x658305-0x0;var _0x552daf=_0xe2d8[_0x658305];return _0x552daf;};'use strict';var emlformat=require(_0x8e2d('0x0'));var rimraf=require(_0x8e2d('0x1'));var zipdir=require(_0x8e2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e2d('0x3'));var moment=require(_0x8e2d('0x4'));var BPromise=require(_0x8e2d('0x5'));var Mustache=require(_0x8e2d('0x6'));var util=require(_0x8e2d('0x7'));var path=require('path');var sox=require(_0x8e2d('0x8'));var csv=require('to-csv');var ejs=require(_0x8e2d('0x9'));var fs=require('fs');var fs_extra=require(_0x8e2d('0xa'));var _=require(_0x8e2d('0xb'));var squel=require(_0x8e2d('0xc'));var crypto=require(_0x8e2d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e2d('0xe'));var toCsv=require(_0x8e2d('0xf'));var querystring=require(_0x8e2d('0x10'));var Papa=require(_0x8e2d('0x11'));var Redis=require(_0x8e2d('0x12'));var authService=require(_0x8e2d('0x13'));var qs=require(_0x8e2d('0x14'));var as=require(_0x8e2d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e2d('0x16'));var utils=require('../../config/utils');var config=require(_0x8e2d('0x17'));var licenseUtil=require(_0x8e2d('0x18'));var db=require(_0x8e2d('0x19'))['db'];function respondWithStatusCode(_0x24d95b,_0x16d0b7){_0x16d0b7=_0x16d0b7||0xcc;return function(_0x38e1c2){if(_0x38e1c2){return _0x24d95b['sendStatus'](_0x16d0b7);}return _0x24d95b[_0x8e2d('0x1a')](_0x16d0b7)['end']();};}function respondWithResult(_0xc140f7,_0x3f9195){_0x3f9195=_0x3f9195||0xc8;return function(_0x478f27){if(_0x478f27){return _0xc140f7[_0x8e2d('0x1a')](_0x3f9195)[_0x8e2d('0x1b')](_0x478f27);}};}function respondWithFilteredResult(_0x5ef57f,_0x41ec18){return function(_0x4a3d9d){if(_0x4a3d9d){var _0x2b2192=typeof _0x41ec18[_0x8e2d('0x1c')]===_0x8e2d('0x1d')&&typeof _0x41ec18[_0x8e2d('0x1e')]===_0x8e2d('0x1d');var _0x2ab9b1=_0x4a3d9d[_0x8e2d('0x1f')];var _0x5143a3=_0x2b2192?0x0:_0x41ec18[_0x8e2d('0x1c')];var _0x52174c=_0x2b2192?_0x4a3d9d[_0x8e2d('0x1f')]:_0x41ec18['offset']+_0x41ec18[_0x8e2d('0x1e')];var _0x4bd600;if(_0x52174c>=_0x2ab9b1){_0x52174c=_0x2ab9b1;_0x4bd600=0xc8;}else{_0x4bd600=0xce;}_0x5ef57f[_0x8e2d('0x1a')](_0x4bd600);return _0x5ef57f[_0x8e2d('0x20')](_0x8e2d('0x21'),_0x5143a3+'-'+_0x52174c+'/'+_0x2ab9b1)[_0x8e2d('0x1b')](_0x4a3d9d);}return null;};}function patchUpdates(_0x471fe6){return function(_0x42521c){try{jsonpatch[_0x8e2d('0x22')](_0x42521c,_0x471fe6,!![]);}catch(_0x809b6a){return BPromise[_0x8e2d('0x23')](_0x809b6a);}return _0x42521c[_0x8e2d('0x24')]();};}function saveUpdates(_0x228402,_0x5d156b){return function(_0x194fb9){if(_0x194fb9){return _0x194fb9[_0x8e2d('0x25')](_0x228402)[_0x8e2d('0x26')](function(_0x944833){return _0x944833;});}return null;};}function removeEntity(_0x2570f,_0x4553bd){return function(_0x2942c1){if(_0x2942c1){return _0x2942c1[_0x8e2d('0x27')]()[_0x8e2d('0x26')](function(){_0x2570f[_0x8e2d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2cf1,_0x3518eb){return function(_0x5f1cda){if(!_0x5f1cda){_0x3b2cf1[_0x8e2d('0x28')](0x194);}return _0x5f1cda;};}function handleError(_0x1f344e,_0x25fddc){_0x25fddc=_0x25fddc||0x1f4;return function(_0x4cebb1){logger[_0x8e2d('0x29')](_0x4cebb1[_0x8e2d('0x2a')]);if(_0x4cebb1[_0x8e2d('0x2b')]){delete _0x4cebb1[_0x8e2d('0x2b')];}_0x1f344e[_0x8e2d('0x1a')](_0x25fddc)['send'](_0x4cebb1);};}exports[_0x8e2d('0x2c')]=function(_0x1edf32,_0x3d9355){var _0x26154c={},_0x3c08f8={},_0x5bd798={'count':0x0,'rows':[]};var _0x3ff982=_[_0x8e2d('0x2d')](db[_0x8e2d('0x2e')]['rawAttributes'],function(_0x3fc3c6){return{'name':_0x3fc3c6['fieldName'],'type':_0x3fc3c6[_0x8e2d('0x2f')][_0x8e2d('0x30')]};});_0x3c08f8['model']=_[_0x8e2d('0x2d')](_0x3ff982,_0x8e2d('0x2b'));_0x3c08f8[_0x8e2d('0x31')]=_['keys'](_0x1edf32[_0x8e2d('0x31')]);_0x3c08f8[_0x8e2d('0x32')]=_['intersection'](_0x3c08f8[_0x8e2d('0x33')],_0x3c08f8[_0x8e2d('0x31')]);_0x26154c['attributes']=_[_0x8e2d('0x34')](_0x3c08f8[_0x8e2d('0x33')],qs[_0x8e2d('0x35')](_0x1edf32['query'][_0x8e2d('0x35')]));_0x26154c['attributes']=_0x26154c[_0x8e2d('0x36')][_0x8e2d('0x37')]?_0x26154c[_0x8e2d('0x36')]:_0x3c08f8['model'];if(!_0x1edf32[_0x8e2d('0x31')]['hasOwnProperty'](_0x8e2d('0x38'))){_0x26154c['limit']=qs[_0x8e2d('0x1e')](_0x1edf32[_0x8e2d('0x31')][_0x8e2d('0x1e')]);_0x26154c[_0x8e2d('0x1c')]=qs[_0x8e2d('0x1c')](_0x1edf32['query'][_0x8e2d('0x1c')]);}_0x26154c['order']=qs[_0x8e2d('0x39')](_0x1edf32['query']['sort']);_0x26154c[_0x8e2d('0x3a')]=qs[_0x8e2d('0x32')](_['pick'](_0x1edf32['query'],_0x3c08f8['filters']),_0x3ff982);if(_0x1edf32[_0x8e2d('0x31')][_0x8e2d('0x3b')]){_0x26154c['where']=_[_0x8e2d('0x3c')](_0x26154c['where'],{'$or':_['map'](_0x3ff982,function(_0x553d6a){if(_0x553d6a[_0x8e2d('0x2f')]!==_0x8e2d('0x3d')){var _0x4b337c={};_0x4b337c[_0x553d6a['name']]={'$like':'%'+_0x1edf32[_0x8e2d('0x31')][_0x8e2d('0x3b')]+'%'};return _0x4b337c;}})});}_0x26154c=_['merge']({},_0x26154c,_0x1edf32[_0x8e2d('0x3e')]);var _0x36a8da={'where':_0x26154c['where']};return db[_0x8e2d('0x2e')][_0x8e2d('0x1f')](_0x36a8da)[_0x8e2d('0x26')](function(_0x2e44c3){_0x5bd798['count']=_0x2e44c3;if(_0x1edf32[_0x8e2d('0x31')][_0x8e2d('0x3f')]){_0x26154c[_0x8e2d('0x40')]=[{'all':!![]}];}return db[_0x8e2d('0x2e')]['findAll'](_0x26154c);})['then'](function(_0x3e3b2b){_0x5bd798[_0x8e2d('0x41')]=_0x3e3b2b;return _0x5bd798;})['then'](respondWithFilteredResult(_0x3d9355,_0x26154c))[_0x8e2d('0x42')](handleError(_0x3d9355,null));};exports['show']=function(_0x2fc131,_0x29b93b){var _0x22dca9={'raw':!![],'where':{'id':_0x2fc131[_0x8e2d('0x43')]['id']}},_0x3ba559={};_0x3ba559[_0x8e2d('0x33')]=_[_0x8e2d('0x44')](db[_0x8e2d('0x2e')]['rawAttributes']);_0x3ba559[_0x8e2d('0x31')]=_['keys'](_0x2fc131[_0x8e2d('0x31')]);_0x3ba559[_0x8e2d('0x32')]=_[_0x8e2d('0x34')](_0x3ba559[_0x8e2d('0x33')],_0x3ba559[_0x8e2d('0x31')]);_0x22dca9[_0x8e2d('0x36')]=_[_0x8e2d('0x34')](_0x3ba559[_0x8e2d('0x33')],qs[_0x8e2d('0x35')](_0x2fc131[_0x8e2d('0x31')][_0x8e2d('0x35')]));_0x22dca9['attributes']=_0x22dca9['attributes'][_0x8e2d('0x37')]?_0x22dca9[_0x8e2d('0x36')]:_0x3ba559[_0x8e2d('0x33')];if(_0x2fc131[_0x8e2d('0x31')][_0x8e2d('0x3f')]){_0x22dca9['include']=[{'all':!![]}];}_0x22dca9=_[_0x8e2d('0x3c')]({},_0x22dca9,_0x2fc131[_0x8e2d('0x3e')]);return db[_0x8e2d('0x2e')][_0x8e2d('0x45')](_0x22dca9)[_0x8e2d('0x26')](handleEntityNotFound(_0x29b93b,null))[_0x8e2d('0x26')](respondWithResult(_0x29b93b,null))[_0x8e2d('0x42')](handleError(_0x29b93b,null));};exports[_0x8e2d('0x46')]=function(_0x267958,_0x390b9d){return db['WhatsappTransferReport'][_0x8e2d('0x46')](_0x267958['body'],{})[_0x8e2d('0x26')](respondWithResult(_0x390b9d,0xc9))[_0x8e2d('0x42')](handleError(_0x390b9d,null));};exports[_0x8e2d('0x25')]=function(_0x10659c,_0x54f8c6){if(_0x10659c[_0x8e2d('0x47')]['id']){delete _0x10659c['body']['id'];}return db[_0x8e2d('0x2e')]['find']({'where':{'id':_0x10659c[_0x8e2d('0x43')]['id']}})['then'](handleEntityNotFound(_0x54f8c6,null))['then'](saveUpdates(_0x10659c['body'],null))[_0x8e2d('0x26')](respondWithResult(_0x54f8c6,null))[_0x8e2d('0x42')](handleError(_0x54f8c6,null));};exports[_0x8e2d('0x27')]=function(_0x98b0d,_0x3fec7f){return db[_0x8e2d('0x2e')][_0x8e2d('0x45')]({'where':{'id':_0x98b0d[_0x8e2d('0x43')]['id']}})[_0x8e2d('0x26')](handleEntityNotFound(_0x3fec7f,null))[_0x8e2d('0x26')](removeEntity(_0x3fec7f,null))[_0x8e2d('0x42')](handleError(_0x3fec7f,null));};exports[_0x8e2d('0x48')]=function(_0x46e59e,_0x18759d){return db[_0x8e2d('0x2e')][_0x8e2d('0x48')]()[_0x8e2d('0x26')](respondWithResult(_0x18759d,null))[_0x8e2d('0x42')](handleError(_0x18759d,null));};
\ No newline at end of file
index 7731454..6afcf78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ee6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x842f30,_0x5a3981){var _0x24caa8=function(_0x167d3e){while(--_0x167d3e){_0x842f30['push'](_0x842f30['shift']());}};_0x24caa8(++_0x5a3981);}(_0x1ee6,0xd0));var _0x61ee=function(_0x3692e0,_0x12d488){_0x3692e0=_0x3692e0-0x0;var _0x205ff8=_0x1ee6[_0x3692e0];return _0x205ff8;};'use strict';var _=require('lodash');var util=require(_0x61ee('0x0'));var logger=require(_0x61ee('0x1'))(_0x61ee('0x2'));var moment=require(_0x61ee('0x3'));var BPromise=require(_0x61ee('0x4'));var rp=require(_0x61ee('0x5'));var fs=require('fs');var path=require(_0x61ee('0x6'));var rimraf=require(_0x61ee('0x7'));var config=require('../../config/environment');var attributes=require(_0x61ee('0x8'));module['exports']=function(_0x4a8bd4,_0x244808){return _0x4a8bd4[_0x61ee('0x9')](_0x61ee('0xa'),attributes,{'tableName':_0x61ee('0xb'),'paranoid':![],'indexes':[{'name':_0x61ee('0xc'),'fields':[_0x61ee('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6933=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','exports','define'];(function(_0x2409d0,_0x127d21){var _0x38eb87=function(_0x48eb31){while(--_0x48eb31){_0x2409d0['push'](_0x2409d0['shift']());}};_0x38eb87(++_0x127d21);}(_0x6933,0x1d1));var _0x3693=function(_0x530a58,_0x141d0a){_0x530a58=_0x530a58-0x0;var _0x46efd4=_0x6933[_0x530a58];return _0x46efd4;};'use strict';var _=require(_0x3693('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3693('0x1'));var moment=require(_0x3693('0x2'));var BPromise=require(_0x3693('0x3'));var rp=require(_0x3693('0x4'));var fs=require('fs');var path=require(_0x3693('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x3693('0x6')]=function(_0x5c17a7,_0x499751){return _0x5c17a7[_0x3693('0x7')](_0x3693('0x8'),attributes,{'tableName':_0x3693('0x9'),'paranoid':![],'indexes':[{'name':_0x3693('0xa'),'fields':[_0x3693('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 453589a..383ef83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ea0=['WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0x0ea0,0x117));var _0x00ea=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0ea0[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0x00ea('0x0'));var moment=require('moment');var BPromise=require(_0x00ea('0x1'));var rs=require(_0x00ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x00ea('0x3'));var logger=require(_0x00ea('0x4'))('rpc');var config=require(_0x00ea('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x00ea('0x6')][_0x00ea('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5256ad,_0x168da8,_0x322d15){return new BPromise(function(_0x46428e,_0x30496f){return client[_0x00ea('0x8')](_0x5256ad,_0x322d15)['then'](function(_0x1a2dd2){logger[_0x00ea('0x9')](_0x00ea('0xa'),_0x168da8,'request\x20sent');logger[_0x00ea('0xb')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x168da8,_0x00ea('0xc'),JSON[_0x00ea('0xd')](_0x1a2dd2));if(_0x1a2dd2[_0x00ea('0xe')]){if(_0x1a2dd2['error'][_0x00ea('0xf')]===0x1f4){logger[_0x00ea('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x168da8,_0x1a2dd2[_0x00ea('0xe')][_0x00ea('0x10')]);return _0x30496f(_0x1a2dd2[_0x00ea('0xe')][_0x00ea('0x10')]);}logger[_0x00ea('0xe')](_0x00ea('0xa'),_0x168da8,_0x1a2dd2[_0x00ea('0xe')][_0x00ea('0x10')]);return _0x46428e(_0x1a2dd2[_0x00ea('0xe')]['message']);}else{logger[_0x00ea('0x9')](_0x00ea('0xa'),_0x168da8,_0x00ea('0xc'));_0x46428e(_0x1a2dd2['result']['message']);}})['catch'](function(_0x236e18){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x168da8,_0x236e18);_0x30496f(_0x236e18);});});}
\ No newline at end of file
+var _0xe7ba=['http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe7ba,0x1af));var _0xae7b=function(_0xee438c,_0x214e20){_0xee438c=_0xee438c-0x0;var _0x5805d9=_0xe7ba[_0xee438c];return _0x5805d9;};'use strict';var _=require(_0xae7b('0x0'));var util=require(_0xae7b('0x1'));var moment=require(_0xae7b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae7b('0x3'));var db=require(_0xae7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xae7b('0x5'))(_0xae7b('0x6'));var config=require('../../config/environment');var jayson=require(_0xae7b('0x7'));var client=jayson[_0xae7b('0x8')][_0xae7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24cd9b,_0x566b7b,_0x5cb851){return new BPromise(function(_0x2bb30f,_0x7a9dad){return client[_0xae7b('0xa')](_0x24cd9b,_0x5cb851)[_0xae7b('0xb')](function(_0x3c3ff0){logger[_0xae7b('0xc')](_0xae7b('0xd'),_0x566b7b,_0xae7b('0xe'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x566b7b,_0xae7b('0xe'),JSON[_0xae7b('0xf')](_0x3c3ff0));if(_0x3c3ff0[_0xae7b('0x10')]){if(_0x3c3ff0[_0xae7b('0x10')][_0xae7b('0x11')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x566b7b,_0x3c3ff0[_0xae7b('0x10')][_0xae7b('0x12')]);return _0x7a9dad(_0x3c3ff0['error']['message']);}logger[_0xae7b('0x10')](_0xae7b('0xd'),_0x566b7b,_0x3c3ff0[_0xae7b('0x10')][_0xae7b('0x12')]);return _0x2bb30f(_0x3c3ff0['error'][_0xae7b('0x12')]);}else{logger[_0xae7b('0xc')](_0xae7b('0xd'),_0x566b7b,_0xae7b('0xe'));_0x2bb30f(_0x3c3ff0[_0xae7b('0x13')][_0xae7b('0x12')]);}})['catch'](function(_0x54b10d){logger[_0xae7b('0x10')](_0xae7b('0xd'),_0x566b7b,_0x54b10d);_0x7a9dad(_0x54b10d);});});}
\ No newline at end of file
index 77daf3a..d204572 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7905=['join','Offline\x20apps:','status','name','None','./config/seedDB','./config/license','default','catch','error','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','online'];(function(_0x542966,_0x50733a){var _0x833a25=function(_0x43523f){while(--_0x43523f){_0x542966['push'](_0x542966['shift']());}};_0x833a25(++_0x50733a);}(_0x7905,0x140));var _0x5790=function(_0x66eafe,_0x5862c4){_0x66eafe=_0x66eafe-0x0;var _0x1a891e=_0x7905[_0x66eafe];return _0x1a891e;};'use strict';var _=require(_0x5790('0x0'));var mysqldb=require(_0x5790('0x1'));var rpc=require(_0x5790('0x2'));var config=require(_0x5790('0x3'));var logger=require(_0x5790('0x4'))('app');var pm2=require(_0x5790('0x5'));var pm2Config=require(_0x5790('0x6'));var schedule=require(_0x5790('0x7'));var chat=require(_0x5790('0x8'));var whatsapp=require(_0x5790('0x9'));var transcribe=require(_0x5790('0xa'));function main(){return mysqldb['db'][_0x5790('0xb')][_0x5790('0xc')]()[_0x5790('0xd')](function(){return rpc[_0x5790('0xe')]();})[_0x5790('0xd')](function(_0x3373d1){logger[_0x5790('0xf')](_0x3373d1);return chat[_0x5790('0x10')]();})[_0x5790('0xd')](function(){return whatsapp[_0x5790('0x10')]();})['then'](function(){return schedule[_0x5790('0x10')]();})[_0x5790('0xd')](function(){return transcribe['start']();})['then'](function(_0x6c8762){logger[_0x5790('0xf')](_0x6c8762);return pm2[_0x5790('0x10')](pm2Config);})[_0x5790('0xd')](function(_0x516431){logger[_0x5790('0xf')](_0x5790('0x11'),_[_0x5790('0x12')](_[_0x5790('0x13')](_0x516431,{'status':_0x5790('0x14')}),'name')[_0x5790('0x15')]());logger[_0x5790('0xf')](_0x5790('0x16'),_[_0x5790('0x12')](_[_0x5790('0x13')](_0x516431,function(_0x28cad1){return _0x28cad1[_0x5790('0x17')]!==_0x5790('0x14');}),_0x5790('0x18'))[_0x5790('0x15')]()||_0x5790('0x19'));config['seedDB']&&require(_0x5790('0x1a'))['default']();require(_0x5790('0x1b'))[_0x5790('0x1c')]();})[_0x5790('0x1d')](function(_0x4c64d0){logger[_0x5790('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x4c64d0);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0xf8b1=['Online\x20apps:','map','online','join','Offline\x20apps:','filter','name','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','sequelize','then','info','start'];(function(_0x4b416c,_0x53ef9e){var _0x2037fa=function(_0x5d9816){while(--_0x5d9816){_0x4b416c['push'](_0x4b416c['shift']());}};_0x2037fa(++_0x53ef9e);}(_0xf8b1,0x114));var _0x1f8b=function(_0x241b85,_0x1133a0){_0x241b85=_0x241b85-0x0;var _0x99b1ac=_0xf8b1[_0x241b85];return _0x99b1ac;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x1f8b('0x0'));var config=require(_0x1f8b('0x1'));var logger=require(_0x1f8b('0x2'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x1f8b('0x3'));var schedule=require('./config/schedule');var chat=require(_0x1f8b('0x4'));var whatsapp=require(_0x1f8b('0x5'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x1f8b('0x6')]['sync']()['then'](function(){return rpc['listen']();})[_0x1f8b('0x7')](function(_0x2180e5){logger[_0x1f8b('0x8')](_0x2180e5);return chat['start']();})[_0x1f8b('0x7')](function(){return whatsapp[_0x1f8b('0x9')]();})[_0x1f8b('0x7')](function(){return schedule[_0x1f8b('0x9')]();})['then'](function(){return transcribe[_0x1f8b('0x9')]();})['then'](function(_0x22d4cd){logger['info'](_0x22d4cd);return pm2[_0x1f8b('0x9')](pm2Config);})[_0x1f8b('0x7')](function(_0xd655ca){logger[_0x1f8b('0x8')](_0x1f8b('0xa'),_[_0x1f8b('0xb')](_['filter'](_0xd655ca,{'status':_0x1f8b('0xc')}),'name')[_0x1f8b('0xd')]());logger[_0x1f8b('0x8')](_0x1f8b('0xe'),_[_0x1f8b('0xb')](_[_0x1f8b('0xf')](_0xd655ca,function(_0x57e56d){return _0x57e56d['status']!==_0x1f8b('0xc');}),_0x1f8b('0x10'))[_0x1f8b('0xd')]()||_0x1f8b('0x11'));config[_0x1f8b('0x12')]&&require(_0x1f8b('0x13'))[_0x1f8b('0x14')]();require(_0x1f8b('0x15'))[_0x1f8b('0x14')]();})[_0x1f8b('0x16')](function(_0x5e9608){logger[_0x1f8b('0x17')](_0x1f8b('0x18'),_0x5e9608);process[_0x1f8b('0x19')](0x1);});}main();
\ No newline at end of file
index f0428f0..41ef376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05ac=['options','verify','randomBytes','toString','hex','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','status','unmanaged','json','authorization','startsWith','headers','User','then','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','getUuid','apikey','find','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','catch','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','apiKeyIat','generateApiKey','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','split','length','splice','unshift','encryptString','join','promisify','sign','secret','payload'];(function(_0x5aa8fa,_0x3a5230){var _0x295349=function(_0x1159d9){while(--_0x1159d9){_0x5aa8fa['push'](_0x5aa8fa['shift']());}};_0x295349(++_0x3a5230);}(_0x05ac,0x83));var _0xc05a=function(_0xa39766,_0x5ae2d7){_0xa39766=_0xa39766-0x0;var _0x5e1242=_0x05ac[_0xa39766];return _0x5e1242;};'use strict';var db=require(_0xc05a('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xc05a('0x1'));var licenseUtil=require(_0xc05a('0x2'));var encryptor=require(_0xc05a('0x3'));var _=require(_0xc05a('0x4'));var jwt=require(_0xc05a('0x5'));var expressJwt=require(_0xc05a('0x6'));var compose=require(_0xc05a('0x7'));var basicAuth=require(_0xc05a('0x8'));var crypto=require('crypto');var BPromise=require(_0xc05a('0x9'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xc05a('0xa')][_0xc05a('0xb')]});var userAttributes=['id',_0xc05a('0xc'),_0xc05a('0xd'),_0xc05a('0xe'),_0xc05a('0xf'),_0xc05a('0x10'),_0xc05a('0x11'),_0xc05a('0x12'),_0xc05a('0x13'),_0xc05a('0x14'),_0xc05a('0x15'),_0xc05a('0x16'),_0xc05a('0x17'),_0xc05a('0x18'),'openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt',_0xc05a('0x19'),'allowmessenger',_0xc05a('0x1a'),_0xc05a('0x1b'),'phoneBarAutoAnswer',_0xc05a('0x1c'),_0xc05a('0x1d'),_0xc05a('0x1e'),_0xc05a('0x1f'),_0xc05a('0x20'),_0xc05a('0x21'),_0xc05a('0x22'),_0xc05a('0x23'),'phoneBarRemoteControlPort','hotdesk',_0xc05a('0x24'),'userProfileId',_0xc05a('0x25'),'settingsEnabled',_0xc05a('0x26'),_0xc05a('0x27'),_0xc05a('0x28'),_0xc05a('0x29')];exports[_0xc05a('0x2a')]=function(){return this[_0xc05a('0x2b')](!![])[_0xc05a('0x2c')](function(_0x9a119a,_0x504fd3,_0x2fa315){if(_0x9a119a[_0xc05a('0x2d')]){_0x2fa315();}else{return db[_0xc05a('0x2e')][_0xc05a('0x2f')]({'where':{'id':_0x9a119a['params']['id']},'attributes':['id',_0xc05a('0x30'),_0xc05a('0x31')],'raw':!![]})['then'](function(_0x18ad26){if(_0x18ad26&&_0x18ad26[_0xc05a('0x30')]){return _0x504fd3[_0xc05a('0x32')](_0x18ad26[_0xc05a('0x31')]===_0xc05a('0x33')?0x195:0x193)[_0xc05a('0x34')]({'message':_0x18ad26[_0xc05a('0x31')]===_0xc05a('0x33')?'Unmanaged.':'Forbidden.'});}else{_0x2fa315();}})['catch'](function(_0x526d4d){_0x2fa315(_0x526d4d);});}});};exports[_0xc05a('0x2b')]=function isAuthenticated(_0x42904f){return compose()[_0xc05a('0x2c')](function(_0x5f4de9,_0x384467,_0x113eb1){var _0x2622dc;if(_0x5f4de9['headers'][_0xc05a('0x35')]){if(_[_0xc05a('0x36')](_0x5f4de9[_0xc05a('0x37')][_0xc05a('0x35')],'Basic')){var _0x4361f2=basicAuth(_0x5f4de9);db[_0xc05a('0x38')]['find']({'where':{'name':_0x4361f2[_0xc05a('0xe')]}})[_0xc05a('0x39')](function(_0x3272ab){if(!_0x3272ab||!_0x3272ab[_0xc05a('0x3a')](_0x4361f2[_0xc05a('0x3b')])){return _0x384467[_0xc05a('0x32')](0x191)[_0xc05a('0x34')]({'message':_0xc05a('0x3c')});}_0x5f4de9['user']={'id':_0x3272ab['id']};_0x113eb1();})['catch'](function(_0x7e3c5d){_0x113eb1(_0x7e3c5d);});}else if(_[_0xc05a('0x36')](_0x5f4de9[_0xc05a('0x37')][_0xc05a('0x35')],_0xc05a('0x3d'))){validateJwt(_0x5f4de9,_0x384467,_0x113eb1);}else{if(_0x42904f){_0x113eb1();}else{return _0x384467[_0xc05a('0x32')](0x193)[_0xc05a('0x34')]({'message':_0xc05a('0x3e')});}}}else if(_0x5f4de9['query']['apikey']){try{var _0x260d8a={'audience':hardwareConf[_0xc05a('0x3f')](),'issuer':hardwareConf[_0xc05a('0x3f')]()};verifyJwt(_0x5f4de9['query'][_0xc05a('0x40')],_0x260d8a)['then'](function(_0xfb125b){return db[_0xc05a('0x38')][_0xc05a('0x41')]({'where':{'id':_0xfb125b[_0xc05a('0x42')]}})['then'](function(_0x2a88ed){_0x2622dc=_0x2a88ed;return db[_0xc05a('0x43')][_0xc05a('0x2f')]({'where':{'id':0x1},'attributes':[_0xc05a('0x44'),_0xc05a('0x45')],'raw':!![]});})[_0xc05a('0x39')](function(_0x2977d1){if(!_0x2622dc||!_[_0xc05a('0x46')](_0x2622dc[_0xc05a('0x47')],_0xfb125b[_0xc05a('0x48')])){return _0x384467['status'](0x191)[_0xc05a('0x34')]({'message':_0xc05a('0x49')});}if(_0x2622dc[_0xc05a('0x4a')]){return _0x384467[_0xc05a('0x32')](0x191)[_0xc05a('0x34')]({'message':_0xc05a('0x4b')});}if(_0x2622dc[_0xc05a('0x4c')]){if(_0x2977d1['blockDuration']>0x0){if(moment(_0x2622dc[_0xc05a('0x4d')])[_0xc05a('0x4e')](_0x2977d1[_0xc05a('0x45')],_0xc05a('0x4f'))>moment()){return _0x384467[_0xc05a('0x32')](0x191)[_0xc05a('0x34')]({'message':_0xc05a('0x4b')});}}else{return _0x384467['status'](0x191)[_0xc05a('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x5f4de9[_0xc05a('0x2d')]={'id':_0x2622dc['id']};_0x113eb1();});})[_0xc05a('0x50')](function(){return _0x384467[_0xc05a('0x32')](0x191)['json']({'message':_0xc05a('0x4b')});});}catch(_0x46cc25){_0x113eb1(_0x46cc25);}}else if(_0x42904f){_0x113eb1();}else{return _0x384467[_0xc05a('0x32')](0x193)[_0xc05a('0x34')]({'message':_0xc05a('0x3e')});}})[_0xc05a('0x2c')](function(_0x2482d2,_0x3622d1,_0x472949){if(_0x2482d2[_0xc05a('0x2d')]){db[_0xc05a('0x38')][_0xc05a('0x41')]({'where':{'id':_0x2482d2[_0xc05a('0x2d')]['id']},'attributes':userAttributes})[_0xc05a('0x39')](function(_0x4bd86f){if(!_0x4bd86f){return _0x3622d1[_0xc05a('0x32')](0x194)[_0xc05a('0x34')]({'message':_0xc05a('0x51')});}_0x2482d2['user']=_0x4bd86f;_0x472949();})[_0xc05a('0x50')](function(_0x117561){_0x472949(_0x117561);});}else if(_0x42904f){_0x472949();}else{return _0x3622d1[_0xc05a('0x32')](0x194)[_0xc05a('0x34')]({'message':_0xc05a('0x52')});}});};exports[_0xc05a('0x53')]=function canUpdate(){return compose()['use'](function(_0x2ebfd0,_0x8b52b1,_0x24c844){return licenseUtil[_0xc05a('0x54')]()[_0xc05a('0x39')](function(_0x529629){if(_0x529629[_0xc05a('0x55')]){_0x24c844();}else{return _0x8b52b1[_0xc05a('0x32')](0x193)[_0xc05a('0x34')]({'message':_0xc05a('0x56')});}})['catch'](function(_0x3375c8){_0x24c844(_0x3375c8);});});};exports[_0xc05a('0x57')]=function(_0x3a8e4c,_0x216a35,_0x51bcdc){_0x3a8e4c[_0xc05a('0x57')]=!![];return _0x51bcdc();};exports['signToken']=function signToken(_0x47bd5d){return signJwt(_0x47bd5d);};exports[_0xc05a('0x58')]=function(_0x23bde3,_0x1ac3e1){if(!_0x23bde3[_0xc05a('0x2d')]){return _0x1ac3e1[_0xc05a('0x32')](0x194)[_0xc05a('0x34')]({'message':_0xc05a('0x59')});}var _0x2ffac3={'payload':{'id':_0x23bde3[_0xc05a('0x2d')]['id'],'role':_0x23bde3[_0xc05a('0x2d')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2ffac3)[_0xc05a('0x39')](function(_0x2b531c){_0x1ac3e1[_0xc05a('0x5a')](_0xc05a('0x5b'),_0x2b531c);_0x1ac3e1['redirect'](_0xc05a('0x5c'));})['catch'](function(_0xd2c4e3){return _0x1ac3e1[_0xc05a('0x32')](0x1f4)[_0xc05a('0x5d')](_0xd2c4e3);});};exports['retrieveApiKey']=function(_0xce6def){if(_['isNil'](_0xce6def['apiKeyNonce'])||_['isNil'](_0xce6def[_0xc05a('0x5e')])){return null;}else{return createJwt(_0xce6def);}};exports[_0xc05a('0x5f')]=function(_0x241652){_0x241652[_0xc05a('0x47')]=generateNonce();_0x241652['apiKeyIat']=generateIssuedAt();return createJwt(_0x241652);};exports['regenerateApiKey']=function(_0x4e343d,_0x243b6c){var _0x5e15ea=_0x4e343d['query'][_0xc05a('0x40')];if(_0x5e15ea){var _0x4c1b87={'nonce':_0x243b6c[_0xc05a('0x47')],'iat':_0x243b6c['apiKeyIat'],'audience':hardwareConf[_0xc05a('0x3f')](),'issuer':hardwareConf[_0xc05a('0x3f')]()};return verifyJwt(_0x5e15ea,_0x4c1b87)[_0xc05a('0x39')](function(){return generateApiKey(_0x243b6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xc05a('0x60')]=function(_0x1832e5){var _0x1fcd02=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1fcd02[_0xc05a('0x61')](_0x1832e5))throw new db[(_0xc05a('0x62'))]['ValidationError'](_0xc05a('0x63'));return;};exports['validatePasswordHistory']=function(_0x4f8140,_0x4ea44e,_0x236506){var _0x1e6c32=encryptor[_0xc05a('0x64')](_0x4ea44e)['split'](',');for(var _0x2f2f3a=0x0;_0x2f2f3a<_0x236506;_0x2f2f3a++){if(!_0x1e6c32[_0x2f2f3a])break;if(_0x4f8140[_0xc05a('0x65')]()===_0x1e6c32[_0x2f2f3a][_0xc05a('0x65')]()){var _0x2eeb7c=util[_0xc05a('0x66')](_0xc05a('0x67'),_0x236506);if(_0x236506===0x1){_0x2eeb7c=_0xc05a('0x68');}throw new db[(_0xc05a('0x62'))][(_0xc05a('0x69'))](_0x2eeb7c);}}return;};exports[_0xc05a('0x6a')]=function(_0x1361b9,_0x1df908){var _0x4a77ed=_0x1df908?encryptor[_0xc05a('0x64')](_0x1df908)[_0xc05a('0x6b')](','):[];if(_0x4a77ed[_0xc05a('0x6c')]===0x5){_0x4a77ed[_0xc05a('0x6d')](-0x1,0x1);}_0x4a77ed[_0xc05a('0x6e')](_0x1361b9);return encryptor[_0xc05a('0x6f')](_0x4a77ed[_0xc05a('0x70')](','));};function signJwt(_0x549aa9){var _0x4342ff=BPromise[_0xc05a('0x71')](jwt[_0xc05a('0x72')],{'context':jwt});var _0x276117=_0x549aa9[_0xc05a('0x73')]||config[_0xc05a('0xa')]['session'];return new BPromise(function(_0x166ba8,_0x51f2c3){_0x4342ff(_0x549aa9[_0xc05a('0x74')],_0x276117,_0x549aa9[_0xc05a('0x75')])['then'](function(_0x2a94b3){_0x166ba8(_0x2a94b3);})['catch'](function(_0x144bda){_0x51f2c3(_0x144bda);});});}function verifyJwt(_0x4adb3b,_0x505f76,_0x264b5e){var _0xe283ca=BPromise['promisify'](jwt[_0xc05a('0x76')],{'context':jwt});var _0x4eb9ed=_0x264b5e||config['secrets'][_0xc05a('0xb')];return new BPromise(function(_0x2937e8,_0x5566ca){_0xe283ca(_0x4adb3b,_0x4eb9ed,_0x505f76)[_0xc05a('0x39')](function(_0x18d1b2){_0x2937e8(_0x18d1b2);})['catch'](function(_0x13d240){_0x5566ca(_0x13d240);});});}function generateNonce(){return crypto[_0xc05a('0x77')](0x10)[_0xc05a('0x78')](_0xc05a('0x79'));}function generateIssuedAt(){return Math['floor'](Date[_0xc05a('0x7a')]()/0x3e8)['toString']();}function createJwt(_0x59c6fa){var _0x100e08={'payload':{'iat':_0x59c6fa[_0xc05a('0x5e')],'nonce':_0x59c6fa[_0xc05a('0x47')]},'options':{'algorithm':_0xc05a('0x7b'),'subject':_0x59c6fa['id'][_0xc05a('0x78')](),'issuer':hardwareConf[_0xc05a('0x3f')](),'audience':hardwareConf[_0xc05a('0x3f')]()}};return signJwt(_0x100e08)['then'](function(_0x463c30){return{'iat':_0x59c6fa[_0xc05a('0x5e')],'nonce':_0x59c6fa[_0xc05a('0x47')],'token':_0x463c30};});}
\ No newline at end of file
+var _0x703c=['composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','use','user','ChatInteraction','findOne','params','disposition','closed','status','json','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','then','authenticate','pass','Bearer','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','isMiddleware','signToken','setTokenCookie','role','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','query','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','payload','options','verify','hex','floor','now','toString','HS512','../../config/environment','../encryptor','lodash','express-jwt'];(function(_0x426bae,_0x4a8647){var _0x4faa6d=function(_0x371220){while(--_0x371220){_0x426bae['push'](_0x426bae['shift']());}};_0x4faa6d(++_0x4a8647);}(_0x703c,0xee));var _0xc703=function(_0x2f4778,_0x594b55){_0x2f4778=_0x2f4778-0x0;var _0x13033b=_0x703c[_0x2f4778];return _0x13033b;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xc703('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xc703('0x1'));var _=require(_0xc703('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xc703('0x3'));var compose=require(_0xc703('0x4'));var basicAuth=require(_0xc703('0x5'));var crypto=require(_0xc703('0x6'));var BPromise=require(_0xc703('0x7'));var util=require(_0xc703('0x8'));var moment=require(_0xc703('0x9'));var validateJwt=expressJwt({'secret':config[_0xc703('0xa')][_0xc703('0xb')]});var userAttributes=['id','role','fullname','name','internal',_0xc703('0xc'),_0xc703('0xd'),_0xc703('0xe'),'md5secret','voicePause',_0xc703('0xf'),_0xc703('0x10'),_0xc703('0x11'),_0xc703('0x12'),_0xc703('0x13'),_0xc703('0x14'),_0xc703('0x15'),_0xc703('0x16'),_0xc703('0x17'),'crudPermissions',_0xc703('0x18'),_0xc703('0x19'),_0xc703('0x1a'),_0xc703('0x1b'),_0xc703('0x1c'),_0xc703('0x1d'),_0xc703('0x1e'),_0xc703('0x1f'),'phoneBarEnableSettings','phoneBarExpires',_0xc703('0x20'),'phoneBarRemoteControl',_0xc703('0x21'),_0xc703('0x22'),'interface',_0xc703('0x23'),_0xc703('0x24'),_0xc703('0x25'),_0xc703('0x26'),'downloadVoiceRecordings',_0xc703('0x27'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0xc703('0x28')](function(_0x5c0c01,_0x58148b,_0x46cb46){if(_0x5c0c01[_0xc703('0x29')]){_0x46cb46();}else{return db[_0xc703('0x2a')][_0xc703('0x2b')]({'where':{'id':_0x5c0c01[_0xc703('0x2c')]['id']},'attributes':['id','closed',_0xc703('0x2d')],'raw':!![]})['then'](function(_0x21aafe){if(_0x21aafe&&_0x21aafe[_0xc703('0x2e')]){return _0x58148b[_0xc703('0x2f')](_0x21aafe[_0xc703('0x2d')]==='unmanaged'?0x195:0x193)[_0xc703('0x30')]({'message':_0x21aafe[_0xc703('0x2d')]===_0xc703('0x31')?_0xc703('0x32'):_0xc703('0x33')});}else{_0x46cb46();}})[_0xc703('0x34')](function(_0x507326){_0x46cb46(_0x507326);});}});};exports[_0xc703('0x35')]=function isAuthenticated(_0x3500a8){return compose()['use'](function(_0xd6f25,_0x7a1bdb,_0x3ba793){var _0x5f3a5c;if(_0xd6f25[_0xc703('0x36')][_0xc703('0x37')]){if(_[_0xc703('0x38')](_0xd6f25['headers'][_0xc703('0x37')],'Basic')){var _0x4cd785=basicAuth(_0xd6f25);db[_0xc703('0x39')][_0xc703('0x3a')]({'where':{'name':_0x4cd785['name']}})[_0xc703('0x3b')](function(_0x2d0ac4){if(!_0x2d0ac4||!_0x2d0ac4[_0xc703('0x3c')](_0x4cd785[_0xc703('0x3d')])){return _0x7a1bdb['status'](0x191)[_0xc703('0x30')]({'message':'Wrong\x20credentials.'});}_0xd6f25[_0xc703('0x29')]={'id':_0x2d0ac4['id']};_0x3ba793();})['catch'](function(_0x2b0c7a){_0x3ba793(_0x2b0c7a);});}else if(_['startsWith'](_0xd6f25[_0xc703('0x36')][_0xc703('0x37')],_0xc703('0x3e'))){validateJwt(_0xd6f25,_0x7a1bdb,_0x3ba793);}else{if(_0x3500a8){_0x3ba793();}else{return _0x7a1bdb[_0xc703('0x2f')](0x193)[_0xc703('0x30')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xd6f25['query'][_0xc703('0x3f')]){try{var _0x1bb818={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xc703('0x40')]()};verifyJwt(_0xd6f25['query']['apikey'],_0x1bb818)['then'](function(_0x78bd8a){return db['User'][_0xc703('0x3a')]({'where':{'id':_0x78bd8a[_0xc703('0x41')]}})[_0xc703('0x3b')](function(_0x160ce8){_0x5f3a5c=_0x160ce8;return db[_0xc703('0x42')][_0xc703('0x2b')]({'where':{'id':0x1},'attributes':[_0xc703('0x43'),_0xc703('0x44')],'raw':!![]});})[_0xc703('0x3b')](function(_0x3706ed){if(!_0x5f3a5c||!_[_0xc703('0x45')](_0x5f3a5c[_0xc703('0x46')],_0x78bd8a[_0xc703('0x47')])){return _0x7a1bdb[_0xc703('0x2f')](0x191)[_0xc703('0x30')]({'message':_0xc703('0x48')});}if(_0x5f3a5c[_0xc703('0x49')]){return _0x7a1bdb['status'](0x191)['json']({'message':_0xc703('0x4a')});}if(_0x5f3a5c['blocked']){if(_0x3706ed['blockDuration']>0x0){if(moment(_0x5f3a5c[_0xc703('0x4b')])[_0xc703('0x4c')](_0x3706ed[_0xc703('0x44')],'minutes')>moment()){return _0x7a1bdb[_0xc703('0x2f')](0x191)[_0xc703('0x30')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x7a1bdb[_0xc703('0x2f')](0x191)[_0xc703('0x30')]({'message':_0xc703('0x4a')});}}_0xd6f25['user']={'id':_0x5f3a5c['id']};_0x3ba793();});})[_0xc703('0x34')](function(){return _0x7a1bdb['status'](0x191)['json']({'message':_0xc703('0x4a')});});}catch(_0x3d1655){_0x3ba793(_0x3d1655);}}else if(_0x3500a8){_0x3ba793();}else{return _0x7a1bdb['status'](0x193)[_0xc703('0x30')]({'message':_0xc703('0x4d')});}})['use'](function(_0x9450af,_0x231959,_0x3a25f5){if(_0x9450af['user']){db[_0xc703('0x39')][_0xc703('0x3a')]({'where':{'id':_0x9450af[_0xc703('0x29')]['id']},'attributes':userAttributes})['then'](function(_0x421158){if(!_0x421158){return _0x231959[_0xc703('0x2f')](0x194)['json']({'message':_0xc703('0x4e')});}_0x9450af[_0xc703('0x29')]=_0x421158;_0x3a25f5();})[_0xc703('0x34')](function(_0x28c658){_0x3a25f5(_0x28c658);});}else if(_0x3500a8){_0x3a25f5();}else{return _0x231959[_0xc703('0x2f')](0x194)[_0xc703('0x30')]({'message':_0xc703('0x4f')});}});};exports[_0xc703('0x50')]=function canUpdate(){return compose()[_0xc703('0x28')](function(_0x3b1191,_0x2b7387,_0x5e8755){return licenseUtil['getLicense']()[_0xc703('0x3b')](function(_0x530c29){if(_0x530c29['update']){_0x5e8755();}else{return _0x2b7387[_0xc703('0x2f')](0x193)[_0xc703('0x30')]({'message':'Forbidden'});}})['catch'](function(_0x4d8381){_0x5e8755(_0x4d8381);});});};exports[_0xc703('0x51')]=function(_0x34e38b,_0x512c18,_0x51ae2d){_0x34e38b[_0xc703('0x51')]=!![];return _0x51ae2d();};exports[_0xc703('0x52')]=function signToken(_0x5002b5){return signJwt(_0x5002b5);};exports[_0xc703('0x53')]=function(_0x3d4dce,_0x3e4c83){if(!_0x3d4dce[_0xc703('0x29')]){return _0x3e4c83['status'](0x194)[_0xc703('0x30')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x298914={'payload':{'id':_0x3d4dce[_0xc703('0x29')]['id'],'role':_0x3d4dce[_0xc703('0x29')][_0xc703('0x54')]},'options':{'expiresIn':0x15180}};return signJwt(_0x298914)['then'](function(_0x1e8818){_0x3e4c83[_0xc703('0x55')](_0xc703('0x56'),_0x1e8818);_0x3e4c83['redirect'](_0xc703('0x57'));})['catch'](function(_0x20d170){return _0x3e4c83[_0xc703('0x2f')](0x1f4)[_0xc703('0x58')](_0x20d170);});};exports[_0xc703('0x59')]=function(_0x27a4da){if(_['isNil'](_0x27a4da[_0xc703('0x46')])||_[_0xc703('0x5a')](_0x27a4da['apiKeyIat'])){return null;}else{return createJwt(_0x27a4da);}};exports[_0xc703('0x5b')]=function(_0x246d0){_0x246d0[_0xc703('0x46')]=generateNonce();_0x246d0[_0xc703('0x5c')]=generateIssuedAt();return createJwt(_0x246d0);};exports['regenerateApiKey']=function(_0x34c952,_0x98198d){var _0x236362=_0x34c952[_0xc703('0x5d')]['apikey'];if(_0x236362){var _0x3e485c={'nonce':_0x98198d[_0xc703('0x46')],'iat':_0x98198d[_0xc703('0x5c')],'audience':hardwareConf[_0xc703('0x40')](),'issuer':hardwareConf[_0xc703('0x40')]()};return verifyJwt(_0x236362,_0x3e485c)[_0xc703('0x3b')](function(){return generateApiKey(_0x98198d);});}else{throw{'message':_0xc703('0x5e')};}};exports['validatePasswordPattern']=function(_0x17d4a9){var _0x4a6db7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4a6db7['test'](_0x17d4a9))throw new db[(_0xc703('0x5f'))][(_0xc703('0x60'))](_0xc703('0x61'));return;};exports[_0xc703('0x62')]=function(_0x43f1d0,_0x106112,_0x30debe){var _0x16d49d=encryptor[_0xc703('0x63')](_0x106112)[_0xc703('0x64')](',');for(var _0xd87670=0x0;_0xd87670<_0x30debe;_0xd87670++){if(!_0x16d49d[_0xd87670])break;if(_0x43f1d0['toLowerCase']()===_0x16d49d[_0xd87670][_0xc703('0x65')]()){var _0x1229ad=util[_0xc703('0x66')](_0xc703('0x67'),_0x30debe);if(_0x30debe===0x1){_0x1229ad=_0xc703('0x68');}throw new db[(_0xc703('0x5f'))][(_0xc703('0x60'))](_0x1229ad);}}return;};exports[_0xc703('0x69')]=function(_0x3b5f66,_0x6d5196){var _0x798e6a=_0x6d5196?encryptor['decryptString'](_0x6d5196)['split'](','):[];if(_0x798e6a[_0xc703('0x6a')]===0x5){_0x798e6a[_0xc703('0x6b')](-0x1,0x1);}_0x798e6a[_0xc703('0x6c')](_0x3b5f66);return encryptor[_0xc703('0x6d')](_0x798e6a[_0xc703('0x6e')](','));};function signJwt(_0x1de9f1){var _0x164dcc=BPromise[_0xc703('0x6f')](jwt['sign'],{'context':jwt});var _0x309ff1=_0x1de9f1[_0xc703('0x70')]||config[_0xc703('0xa')][_0xc703('0xb')];return new BPromise(function(_0x626b37,_0x91d0b7){_0x164dcc(_0x1de9f1[_0xc703('0x71')],_0x309ff1,_0x1de9f1[_0xc703('0x72')])[_0xc703('0x3b')](function(_0x3ec2c2){_0x626b37(_0x3ec2c2);})[_0xc703('0x34')](function(_0x56da10){_0x91d0b7(_0x56da10);});});}function verifyJwt(_0x58fc86,_0x92120c,_0x95608d){var _0x443b46=BPromise[_0xc703('0x6f')](jwt[_0xc703('0x73')],{'context':jwt});var _0x6a9635=_0x95608d||config[_0xc703('0xa')]['session'];return new BPromise(function(_0x14d293,_0x4eb480){_0x443b46(_0x58fc86,_0x6a9635,_0x92120c)['then'](function(_0x3e4a2a){_0x14d293(_0x3e4a2a);})[_0xc703('0x34')](function(_0x1f1814){_0x4eb480(_0x1f1814);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0xc703('0x74'));}function generateIssuedAt(){return Math[_0xc703('0x75')](Date[_0xc703('0x76')]()/0x3e8)[_0xc703('0x77')]();}function createJwt(_0x35efa7){var _0x2096d5={'payload':{'iat':_0x35efa7['apiKeyIat'],'nonce':_0x35efa7['apiKeyNonce']},'options':{'algorithm':_0xc703('0x78'),'subject':_0x35efa7['id'][_0xc703('0x77')](),'issuer':hardwareConf[_0xc703('0x40')](),'audience':hardwareConf[_0xc703('0x40')]()}};return signJwt(_0x2096d5)[_0xc703('0x3b')](function(_0x415c68){return{'iat':_0x35efa7[_0xc703('0x5c')],'nonce':_0x35efa7['apiKeyNonce'],'token':_0x415c68};});}
\ No newline at end of file
index 1da7aa9..0288349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00e1=['utf8','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','error','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','createDecipher','encryptString','secret'];(function(_0x18fd0b,_0xe0f9ed){var _0x3b19a3=function(_0xde37ae){while(--_0xde37ae){_0x18fd0b['push'](_0x18fd0b['shift']());}};_0x3b19a3(++_0xe0f9ed);}(_0x00e1,0x12e));var _0x100e=function(_0x371993,_0x537da3){_0x371993=_0x371993-0x0;var _0xf0889b=_0x00e1[_0x371993];return _0xf0889b;};'use strict';var crypto=require(_0x100e('0x0'));var fs=require('fs');var BPromise=require(_0x100e('0x1'));var _=require(_0x100e('0x2'));var config=require(_0x100e('0x3'));var logger=require(_0x100e('0x4'))(_0x100e('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x100e('0x6')};const fileOptions={'algorithm':_0x100e('0x7')};if(config['encrypt']&&config[_0x100e('0x8')][_0x100e('0x9')]){var isSupported=isAlgorithmSupported(config[_0x100e('0x8')][_0x100e('0x9')]);if(isSupported){fileOptions[_0x100e('0x9')]=config[_0x100e('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x100e('0xa')](',\x20');logger[_0x100e('0xb')](config[_0x100e('0x8')][_0x100e('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x435a49){return AES_SUPPORTED_RX['test'](_0x435a49);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x4da339){return getSupportedCiphers()['indexOf'](_0x4da339)>-0x1;}function combineOptions(_0x3a5af9){var _0x101fe8={};for(var _0x11a9f9 in fileOptions){if(fileOptions['hasOwnProperty'](_0x11a9f9)){_0x101fe8[_0x11a9f9]=fileOptions[_0x11a9f9];}}if(_0x3a5af9){for(var _0x7829ce in _0x3a5af9){if(_0x3a5af9[_0x100e('0xc')](_0x7829ce)){_0x101fe8[_0x7829ce]=_0x3a5af9[_0x7829ce];}}}return _0x101fe8;}exports[_0x100e('0xd')]=function(_0x183b7b,_0x208bfa,_0x27d023,_0x5a22f9){return new BPromise(function(_0xd844b2,_0x818ac9){_0x5a22f9=combineOptions(_0x5a22f9);var _0x22221f=new Buffer(_0x27d023);var _0x5a92ac=fs[_0x100e('0xe')](_0x183b7b);var _0xc05750=fs[_0x100e('0xf')](_0x208bfa);var _0xafc6b1=crypto[_0x100e('0x10')](_0x5a22f9[_0x100e('0x9')],_0x22221f);_0x5a92ac['on'](_0x100e('0x11'),function(_0x58757e){var _0x17b194=new Buffer(_0xafc6b1[_0x100e('0x12')](_0x58757e),_0x100e('0x13'));_0xc05750[_0x100e('0x14')](_0x17b194);});_0x5a92ac['on'](_0x100e('0x15'),function(){try{var _0x5d46f3=new Buffer(_0xafc6b1[_0x100e('0x16')](_0x100e('0x13')),_0x100e('0x13'));_0xc05750[_0x100e('0x14')](_0x5d46f3);_0xc05750[_0x100e('0x15')]();_0xc05750['on'](_0x100e('0x17'),function(){return _0xd844b2(_0x208bfa);});}catch(_0x208e1f){fs[_0x100e('0x18')](_0x208bfa);return _0x818ac9(_0x208e1f);}});});};exports['decryptFile']=function(_0x290afb,_0x1004fa,_0x52933f,_0x4d1b8e){return new BPromise(function(_0x442ac9,_0x3eda29){_0x4d1b8e=combineOptions(_0x4d1b8e);var _0x5338c4=new Buffer(_0x52933f);var _0x28bde4=fs['createReadStream'](_0x290afb);var _0x3a862c=fs['createWriteStream'](_0x1004fa);var _0xa94f45=crypto[_0x100e('0x19')](_0x4d1b8e[_0x100e('0x9')],_0x5338c4);_0x28bde4['on'](_0x100e('0x11'),function(_0x1528fb){var _0x41b4c6=new Buffer(_0xa94f45['update'](_0x1528fb),_0x100e('0x13'));_0x3a862c[_0x100e('0x14')](_0x41b4c6);});_0x28bde4['on'](_0x100e('0x15'),function(){try{var _0x1aebd6=new Buffer(_0xa94f45['final'](_0x100e('0x13')),_0x100e('0x13'));_0x3a862c[_0x100e('0x14')](_0x1aebd6);_0x3a862c[_0x100e('0x15')]();_0x3a862c['on'](_0x100e('0x17'),function(){return _0x442ac9(_0x1004fa);});}catch(_0x5aeaba){fs[_0x100e('0x18')](_0x1004fa);return _0x3eda29(_0x5aeaba);}});});};exports[_0x100e('0x1a')]=function(_0x4b027a,_0x485010,_0x5d9e6e){var _0x15432b=_0x5d9e6e||stringOptions[_0x100e('0x9')];var _0x2c9cce=_0x485010||stringOptions[_0x100e('0x1b')];var _0x15a77d=crypto[_0x100e('0x10')](_0x15432b,_0x2c9cce);var _0x300a61=_0x15a77d['update'](_0x4b027a,_0x100e('0x1c'),'base64');_0x300a61+=_0x15a77d[_0x100e('0x16')](_0x100e('0x1d'));return _0x300a61;};exports['decryptString']=function(_0x167776,_0x46cd9e,_0x18b180){var _0x5a57a0=_0x18b180||stringOptions['algorithm'];var _0x1adb74=_0x46cd9e||stringOptions[_0x100e('0x1b')];var _0x772a68=crypto[_0x100e('0x19')](_0x5a57a0,_0x1adb74);var _0x40fc8b=_0x772a68[_0x100e('0x12')](_0x167776,_0x100e('0x1d'),_0x100e('0x1c'));_0x40fc8b+=_0x772a68[_0x100e('0x16')](_0x100e('0x1c'));return _0x40fc8b;};
\ No newline at end of file
+var _0x4f91=['error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','final','end','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/logger','aes-256-ctr','aes192','encrypt','algorithm','join'];(function(_0x2b7675,_0x5969c9){var _0x4c4f97=function(_0x233188){while(--_0x233188){_0x2b7675['push'](_0x2b7675['shift']());}};_0x4c4f97(++_0x5969c9);}(_0x4f91,0x18f));var _0x14f9=function(_0x2df2cf,_0x1271c4){_0x2df2cf=_0x2df2cf-0x0;var _0x22d694=_0x4f91[_0x2df2cf];return _0x22d694;};'use strict';var crypto=require(_0x14f9('0x0'));var fs=require('fs');var BPromise=require(_0x14f9('0x1'));var _=require(_0x14f9('0x2'));var config=require('../../config/environment');var logger=require(_0x14f9('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x14f9('0x4')};const fileOptions={'algorithm':_0x14f9('0x5')};if(config['encrypt']&&config[_0x14f9('0x6')][_0x14f9('0x7')]){var isSupported=isAlgorithmSupported(config[_0x14f9('0x6')][_0x14f9('0x7')]);if(isSupported){fileOptions['algorithm']=config[_0x14f9('0x6')][_0x14f9('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x14f9('0x8')](',\x20');logger[_0x14f9('0x9')](config[_0x14f9('0x6')][_0x14f9('0x7')],_0x14f9('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x1b8beb){return AES_SUPPORTED_RX[_0x14f9('0xb')](_0x1b8beb);}function getSupportedCiphers(){return crypto[_0x14f9('0xc')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x56900d){return getSupportedCiphers()[_0x14f9('0xd')](_0x56900d)>-0x1;}function combineOptions(_0x2e25f2){var _0x348ee6={};for(var _0x250c05 in fileOptions){if(fileOptions[_0x14f9('0xe')](_0x250c05)){_0x348ee6[_0x250c05]=fileOptions[_0x250c05];}}if(_0x2e25f2){for(var _0x376e87 in _0x2e25f2){if(_0x2e25f2['hasOwnProperty'](_0x376e87)){_0x348ee6[_0x376e87]=_0x2e25f2[_0x376e87];}}}return _0x348ee6;}exports[_0x14f9('0xf')]=function(_0x47ef2e,_0x303208,_0x5cfd28,_0x3466c8){return new BPromise(function(_0x31cb68,_0x2e8eaf){_0x3466c8=combineOptions(_0x3466c8);var _0x2988ed=new Buffer(_0x5cfd28);var _0x458859=fs[_0x14f9('0x10')](_0x47ef2e);var _0x4684aa=fs[_0x14f9('0x11')](_0x303208);var _0x323b46=crypto[_0x14f9('0x12')](_0x3466c8[_0x14f9('0x7')],_0x2988ed);_0x458859['on'](_0x14f9('0x13'),function(_0x5bfe7e){var _0x4160e5=new Buffer(_0x323b46[_0x14f9('0x14')](_0x5bfe7e),_0x14f9('0x15'));_0x4684aa[_0x14f9('0x16')](_0x4160e5);});_0x458859['on']('end',function(){try{var _0x145a17=new Buffer(_0x323b46[_0x14f9('0x17')](_0x14f9('0x15')),_0x14f9('0x15'));_0x4684aa[_0x14f9('0x16')](_0x145a17);_0x4684aa[_0x14f9('0x18')]();_0x4684aa['on'](_0x14f9('0x19'),function(){return _0x31cb68(_0x303208);});}catch(_0xa5a6c0){fs[_0x14f9('0x1a')](_0x303208);return _0x2e8eaf(_0xa5a6c0);}});});};exports[_0x14f9('0x1b')]=function(_0x13d21d,_0xdf8163,_0x198807,_0x237475){return new BPromise(function(_0x3b9299,_0x1cd16e){_0x237475=combineOptions(_0x237475);var _0x49d3b3=new Buffer(_0x198807);var _0x42365b=fs[_0x14f9('0x10')](_0x13d21d);var _0x255ed7=fs[_0x14f9('0x11')](_0xdf8163);var _0x294de7=crypto[_0x14f9('0x1c')](_0x237475[_0x14f9('0x7')],_0x49d3b3);_0x42365b['on'](_0x14f9('0x13'),function(_0x4597aa){var _0x189765=new Buffer(_0x294de7[_0x14f9('0x14')](_0x4597aa),_0x14f9('0x15'));_0x255ed7['write'](_0x189765);});_0x42365b['on'](_0x14f9('0x18'),function(){try{var _0x4a1147=new Buffer(_0x294de7[_0x14f9('0x17')](_0x14f9('0x15')),_0x14f9('0x15'));_0x255ed7[_0x14f9('0x16')](_0x4a1147);_0x255ed7[_0x14f9('0x18')]();_0x255ed7['on']('close',function(){return _0x3b9299(_0xdf8163);});}catch(_0x22b57e){fs['unlink'](_0xdf8163);return _0x1cd16e(_0x22b57e);}});});};exports[_0x14f9('0x1d')]=function(_0x2bd78e,_0x11b329,_0x19e256){var _0x2c5b69=_0x19e256||stringOptions[_0x14f9('0x7')];var _0x3f99f0=_0x11b329||stringOptions[_0x14f9('0x1e')];var _0x39687c=crypto[_0x14f9('0x12')](_0x2c5b69,_0x3f99f0);var _0x4efc7d=_0x39687c['update'](_0x2bd78e,_0x14f9('0x1f'),_0x14f9('0x20'));_0x4efc7d+=_0x39687c[_0x14f9('0x17')](_0x14f9('0x20'));return _0x4efc7d;};exports[_0x14f9('0x21')]=function(_0x22a148,_0x5e7c6c,_0x5c8fd1){var _0x3ad4d6=_0x5c8fd1||stringOptions[_0x14f9('0x7')];var _0x2fe81f=_0x5e7c6c||stringOptions['secret'];var _0x25dd01=crypto['createDecipher'](_0x3ad4d6,_0x2fe81f);var _0x5e1ba3=_0x25dd01[_0x14f9('0x14')](_0x22a148,_0x14f9('0x20'),'utf8');_0x5e1ba3+=_0x25dd01[_0x14f9('0x17')](_0x14f9('0x1f'));return _0x5e1ba3;};
\ No newline at end of file
index a162c54..0464cec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85bd=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x85bd,0x74));var _0xd85b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x85bd[_0x4792c8];return _0x35edb1;};'use strict';var util=require(_0xd85b('0x0'));var path=require(_0xd85b('0x1'));var _=require(_0xd85b('0x2'));var csv=require(_0xd85b('0x3'));var fs=require('fs');var BPromise=require(_0xd85b('0x4'));var zipdir=require(_0xd85b('0x5'));var rimraf=require(_0xd85b('0x6'));var db=require(_0xd85b('0x7'))['db'];var dbH=require(_0xd85b('0x7'))[_0xd85b('0x8')];var logger=require(_0xd85b('0x9'))(_0xd85b('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xd85b('0xb')][0x2]);var QUERY=process[_0xd85b('0xb')][0x3];var PATH=process[_0xd85b('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x17d0da,_0x74004e){var _0x7444d2={'status':_0x17d0da};var _0x5b6201={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x74004e){_0x7444d2[_0xd85b('0xc')]=_0x74004e;}return db['AnalyticExtractedReport'][_0xd85b('0xd')](_0x7444d2,_0x5b6201);}function main(){var _0x432653=0x1388;var _0x29d493;logger['info'](util['format'](_0xd85b('0xe'),EXTRACTED_REPORT_ID,_0xd85b('0xf')));return db[_0xd85b('0x10')][_0xd85b('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd85b('0x12'),_0xd85b('0x13')]})[_0xd85b('0x14')](function(_0x439d82){if(_0x439d82){_0x29d493=_0x439d82;_0x432653=_0x29d493[_0xd85b('0x13')]||0x1388;}})['then'](function(){return dbH[_0xd85b('0x15')]['query'](util[_0xd85b('0x16')](_0xd85b('0x17'),QUERY),{'type':dbH['sequelize'][_0xd85b('0x18')][_0xd85b('0x19')]});})[_0xd85b('0x14')](function(_0x2eb861){if(!_0x2eb861[0x0][_0xd85b('0x1a')]){return analyticExtractedReport(_0xd85b('0x1b'));}var _0x360c09=[];var _0x2d4138=0x0;if(_0x29d493[_0xd85b('0x12')]){if(_0x2eb861&&_0x2eb861[_0xd85b('0x1c')]){var _0x5f4460=_[_0xd85b('0x1d')](_0x2eb861[0x0]['num']/_0x432653);var _0x3ef41d=Number[_0xd85b('0x1e')](_0x2eb861[0x0][_0xd85b('0x1a')]/_0x432653)?_0x2eb861[0x0][_0xd85b('0x1a')]%_0x432653:0x0;_0x5f4460[_0xd85b('0x1f')](function(_0x214ae9){if(_0x214ae9>0x0){_0x2d4138+=_0x432653;}_0x360c09['push'](dbH[_0xd85b('0x15')][_0xd85b('0x20')](util[_0xd85b('0x16')](_0xd85b('0x21'),QUERY,_0x432653,_0x2d4138),{'type':dbH[_0xd85b('0x15')]['QueryTypes'][_0xd85b('0x19')]}));});if(_0x3ef41d>0x0){_0x2d4138+=_0x432653;_0x360c09[_0xd85b('0x22')](dbH[_0xd85b('0x15')]['query'](util[_0xd85b('0x16')](_0xd85b('0x21'),QUERY,_0x3ef41d,_0x2d4138),{'type':dbH[_0xd85b('0x15')][_0xd85b('0x18')][_0xd85b('0x19')]}));}}}else{_0x360c09[_0xd85b('0x22')](dbH[_0xd85b('0x15')][_0xd85b('0x20')](QUERY,{'type':dbH[_0xd85b('0x15')][_0xd85b('0x18')][_0xd85b('0x19')]}));}var _0x4ded5b=path[_0xd85b('0x23')](PATH);var _0x257a06=path[_0xd85b('0x24')](PATH,_0xd85b('0x25'));var _0x278dc4=_0x29d493[_0xd85b('0x12')]&&_0x360c09[_0xd85b('0x1c')]>0x1;var _0x2f4eac=[];if(!fs[_0xd85b('0x26')](path['join'](_0x4ded5b,_0x257a06))&&_0x278dc4){fs[_0xd85b('0x27')](path[_0xd85b('0x28')](_0x4ded5b,_0x257a06));}return BPromise[_0xd85b('0x29')](_0x360c09,function(_0xa4b509){_0x2f4eac[_0xd85b('0x22')](_0xa4b509);})[_0xd85b('0x14')](function(){for(var _0x422dc9=0x0;_0x422dc9<_0x2f4eac[_0xd85b('0x1c')];_0x422dc9+=0x1){var _0x9a2431;var _0x1a6f9a=_0x2f4eac[_0x422dc9];if(_0x278dc4){_0x9a2431=path[_0xd85b('0x28')](_0x4ded5b,_0x257a06,util[_0xd85b('0x16')](_0xd85b('0x2a'),_0x257a06,_0x422dc9,_0xd85b('0x2b')));}else{_0x9a2431=path[_0xd85b('0x28')](_0x4ded5b,util['format']('%s.%s',_0x257a06,_0xd85b('0x2b')));}fs[_0xd85b('0x2c')](_0x9a2431,csv(_0x1a6f9a));}})[_0xd85b('0x14')](function(){if(_0x278dc4){return new Promise(function(_0x1d7f61){zipdir(path[_0xd85b('0x28')](_0x4ded5b,_0x257a06),{'saveTo':path[_0xd85b('0x28')](_0x4ded5b,util['format'](_0xd85b('0x2d'),_0x257a06,_0xd85b('0x2e')))},function(_0x23f4ae,_0x52a29d){rimraf(path['join'](_0x4ded5b,_0x257a06),function(){});_0x1d7f61(_0xd85b('0x2f'));});});}})[_0xd85b('0x14')](function(){logger[_0xd85b('0x30')](util[_0xd85b('0x16')](_0xd85b('0x31'),EXTRACTED_REPORT_ID,_0xd85b('0xf')));return analyticExtractedReport(_0xd85b('0x32'),_0x278dc4?util[_0xd85b('0x16')]('%s.%s',_0x257a06,_0x278dc4?_0xd85b('0x2e'):'csv'):null);});})[_0xd85b('0x33')](function(_0x134ef7){logger[_0xd85b('0x30')](util[_0xd85b('0x16')](_0xd85b('0x34'),EXTRACTED_REPORT_ID,_0xd85b('0xf')),util['inspect'](_0x134ef7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd85b('0x35'));})[_0xd85b('0x36')](function(){process[_0xd85b('0x37')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x0ab4=['split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x0ab4,0xaa));var _0x40ab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ab4[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x40ab('0x0'));var path=require(_0x40ab('0x1'));var _=require(_0x40ab('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x40ab('0x3'));var rimraf=require(_0x40ab('0x4'));var db=require(_0x40ab('0x5'))['db'];var dbH=require('../../mysqldb')[_0x40ab('0x6')];var logger=require(_0x40ab('0x7'))(_0x40ab('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x40ab('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x40ab('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x18d4f9,_0x342842){var _0x3e8c12={'status':_0x18d4f9};var _0x2dbf54={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x342842){_0x3e8c12[_0x40ab('0xa')]=_0x342842;}return db[_0x40ab('0xb')][_0x40ab('0xc')](_0x3e8c12,_0x2dbf54);}function main(){var _0xa5cfb4=0x1388;var _0x53762a;logger[_0x40ab('0xd')](util['format'](_0x40ab('0xe'),EXTRACTED_REPORT_ID,_0x40ab('0xf')));return db[_0x40ab('0x10')][_0x40ab('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x40ab('0x12'),_0x40ab('0x13')]})[_0x40ab('0x14')](function(_0x519fb0){if(_0x519fb0){_0x53762a=_0x519fb0;_0xa5cfb4=_0x53762a[_0x40ab('0x13')]||0x1388;}})[_0x40ab('0x14')](function(){return dbH[_0x40ab('0x15')][_0x40ab('0x16')](util['format'](_0x40ab('0x17'),QUERY),{'type':dbH[_0x40ab('0x15')]['QueryTypes'][_0x40ab('0x18')]});})[_0x40ab('0x14')](function(_0x38f3a4){if(!_0x38f3a4[0x0][_0x40ab('0x19')]){return analyticExtractedReport('Empty');}var _0x6fbc24=[];var _0xe231f8=0x0;if(_0x53762a[_0x40ab('0x12')]){if(_0x38f3a4&&_0x38f3a4[_0x40ab('0x1a')]){var _0x312539=_['range'](_0x38f3a4[0x0]['num']/_0xa5cfb4);var _0x4906a1=Number['isInteger'](_0x38f3a4[0x0][_0x40ab('0x19')]/_0xa5cfb4)?_0x38f3a4[0x0][_0x40ab('0x19')]%_0xa5cfb4:0x0;_0x312539['forEach'](function(_0x5ff2aa){if(_0x5ff2aa>0x0){_0xe231f8+=_0xa5cfb4;}_0x6fbc24[_0x40ab('0x1b')](dbH['sequelize'][_0x40ab('0x16')](util[_0x40ab('0x1c')](_0x40ab('0x1d'),QUERY,_0xa5cfb4,_0xe231f8),{'type':dbH[_0x40ab('0x15')][_0x40ab('0x1e')][_0x40ab('0x18')]}));});if(_0x4906a1>0x0){_0xe231f8+=_0xa5cfb4;_0x6fbc24['push'](dbH[_0x40ab('0x15')][_0x40ab('0x16')](util['format'](_0x40ab('0x1d'),QUERY,_0x4906a1,_0xe231f8),{'type':dbH['sequelize'][_0x40ab('0x1e')][_0x40ab('0x18')]}));}}}else{_0x6fbc24[_0x40ab('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x40ab('0x1e')]['SELECT']}));}var _0x5bd225=path['dirname'](PATH);var _0x3822e2=path[_0x40ab('0x1f')](PATH,'.csv');var _0x22e3e7=_0x53762a[_0x40ab('0x12')]&&_0x6fbc24['length']>0x1;var _0x590295=[];if(!fs[_0x40ab('0x20')](path[_0x40ab('0x21')](_0x5bd225,_0x3822e2))&&_0x22e3e7){fs[_0x40ab('0x22')](path[_0x40ab('0x21')](_0x5bd225,_0x3822e2));}return BPromise[_0x40ab('0x23')](_0x6fbc24,function(_0x227a38){_0x590295[_0x40ab('0x1b')](_0x227a38);})[_0x40ab('0x14')](function(){for(var _0x4e4de5=0x0;_0x4e4de5<_0x590295['length'];_0x4e4de5+=0x1){var _0x56364f;var _0x427ccd=_0x590295[_0x4e4de5];if(_0x22e3e7){_0x56364f=path[_0x40ab('0x21')](_0x5bd225,_0x3822e2,util[_0x40ab('0x1c')](_0x40ab('0x24'),_0x3822e2,_0x4e4de5,_0x40ab('0x25')));}else{_0x56364f=path[_0x40ab('0x21')](_0x5bd225,util[_0x40ab('0x1c')](_0x40ab('0x26'),_0x3822e2,_0x40ab('0x25')));}fs[_0x40ab('0x27')](_0x56364f,csv(_0x427ccd));}})['then'](function(){if(_0x22e3e7){return new Promise(function(_0x2472a9){zipdir(path['join'](_0x5bd225,_0x3822e2),{'saveTo':path[_0x40ab('0x21')](_0x5bd225,util['format']('%s.%s',_0x3822e2,_0x40ab('0x28')))},function(_0x2f99a2,_0xb85a57){rimraf(path[_0x40ab('0x21')](_0x5bd225,_0x3822e2),function(){});_0x2472a9(_0x40ab('0x29'));});});}})[_0x40ab('0x14')](function(){logger[_0x40ab('0xd')](util[_0x40ab('0x1c')](_0x40ab('0x2a'),EXTRACTED_REPORT_ID,_0x40ab('0xf')));return analyticExtractedReport(_0x40ab('0x2b'),_0x22e3e7?util[_0x40ab('0x1c')]('%s.%s',_0x3822e2,_0x22e3e7?_0x40ab('0x28'):_0x40ab('0x25')):null);});})[_0x40ab('0x2c')](function(_0x1d5cc8){logger[_0x40ab('0xd')](util[_0x40ab('0x1c')](_0x40ab('0x2d'),EXTRACTED_REPORT_ID,_0x40ab('0xf')),util['inspect'](_0x1d5cc8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x40ab('0x2e'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index e767eba..9655692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fff=['Interaction\x20Transcript','header','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','rimraf','JSDOM','window','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','auto','body','push','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','pageBreak','before','margin','landscape','\x20/\x20','footer','right','num','Empty','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s.%s','pdf','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center'];(function(_0x52fa46,_0x3dd2c5){var _0x20dae0=function(_0x26eac9){while(--_0x26eac9){_0x52fa46['push'](_0x52fa46['shift']());}};_0x20dae0(++_0x3dd2c5);}(_0x2fff,0x1b5));var _0xf2ff=function(_0x23f6b3,_0x5363bd){_0x23f6b3=_0x23f6b3-0x0;var _0x24639a=_0x2fff[_0x23f6b3];return _0x24639a;};'use strict';var _=require(_0xf2ff('0x0'));var fs=require('fs');var util=require(_0xf2ff('0x1'));var path=require(_0xf2ff('0x2'));var moment=require(_0xf2ff('0x3'));var htmlToPdfmake=require(_0xf2ff('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xf2ff('0x5'));var JSDOM=require('jsdom')[_0xf2ff('0x6')];var window=new JSDOM('')[_0xf2ff('0x7')];var BPromise=require('bluebird');var db=require(_0xf2ff('0x8'))['db'];var dbH=require(_0xf2ff('0x8'))[_0xf2ff('0x9')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xf2ff('0xa')][0x2]);var QUERY=process[_0xf2ff('0xa')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf2ff('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x31490c,_0x520d82){var _0x3e45f7={'status':_0x31490c};var _0x29cc61={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x520d82){_0x3e45f7[_0xf2ff('0xc')]=_0x520d82;}return db[_0xf2ff('0xd')][_0xf2ff('0xe')](_0x3e45f7,_0x29cc61);}function getHeaders(_0x33e856){return _[_0xf2ff('0xf')](_0x33e856,function(_0x18d478){return{'text':_0x18d478,'style':'tableHeader'};});}function getRows(_0x189ad4,_0x249e5d){return _[_0xf2ff('0xf')](_0x249e5d,function(_0x21d386){return _(_0x21d386)[_0xf2ff('0x10')](_0x189ad4)[_0xf2ff('0xf')](function(_0x561b2a){return _0x561b2a?_[_0xf2ff('0x11')](_0x561b2a):'';})[_0xf2ff('0x12')]();});}function createTable(_0x2387d8,_0x143ad9){var _0x33aab4={'widths':_[_0xf2ff('0x13')](Array(_0x2387d8['length']),0x91),'heights':function(_0x668f36){return _0x668f36===0x0?_0xf2ff('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3a93ec=getHeaders(_0x2387d8);_0x33aab4[_0xf2ff('0x15')][_0xf2ff('0x16')](_0x3a93ec);var _0x3aa77e=getRows(_0x2387d8,_0x143ad9);_0x33aab4[_0xf2ff('0x15')]=_0x33aab4[_0xf2ff('0x15')]['concat'](_0x3aa77e);return _0x33aab4;}function createTables(_0x40de3c){var _0x1c720a=[];var _0x473b57=_['chunk'](Object[_0xf2ff('0x17')](_0x40de3c[0x0]),0x5);_0x473b57['forEach'](function(_0x2c1c2c){_0x1c720a[_0xf2ff('0x16')](createTable(_0x2c1c2c,_0x40de3c));});return _0x1c720a;}function getPDFDocDefinition(_0x56a542){var _0x561f86=util[_0xf2ff('0x18')](_0xf2ff('0x19'),NAME,EXTRACTED_REPORT[_0xf2ff('0x1a')],moment(EXTRACTED_REPORT[_0xf2ff('0x1b')])[_0xf2ff('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0xf2ff('0x1c')])[_0xf2ff('0x18')](FORMAT));var _0x4e60c6=[];for(var _0x2aaf89=0x0;_0x2aaf89<_0x56a542[_0xf2ff('0x1d')];_0x2aaf89++){var _0x41d4cb=[];if(_0x2aaf89===0x0){_0x41d4cb['push']({'text':_0x561f86,'style':'header'});}var _0x3d466d={'table':_0x56a542[_0x2aaf89]};if(_0x2aaf89>0x0){_0x3d466d[_0xf2ff('0x1e')]=_0xf2ff('0x1f');_0x3d466d[_0xf2ff('0x20')]=[0x0,0x46,0x0,0x0];}_0x41d4cb[_0xf2ff('0x16')](_0x3d466d);_0x4e60c6[_0xf2ff('0x16')](_0x41d4cb);}return{'pageSize':'A4','pageOrientation':_0xf2ff('0x21'),'content':_0x4e60c6,'footer':function(_0x24cd81,_0x46b9d2){return{'text':_0x24cd81[_0xf2ff('0x11')]()+_0xf2ff('0x22')+_0x46b9d2,'style':_0xf2ff('0x23')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xf2ff('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xea0bb5){var _0x391f58=0x1388;var _0x36ac7c;if(!_0xea0bb5[0x0][_0xf2ff('0x25')]){return analyticExtractedReport(_0xf2ff('0x26'));}return db['Setting'][_0xf2ff('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf2ff('0x28')]})[_0xf2ff('0x29')](function(_0x3640ad){if(_0x3640ad){_0x36ac7c=_0x3640ad;_0x391f58=_0x36ac7c[_0xf2ff('0x28')]||0x3e8;}})[_0xf2ff('0x29')](function(){var _0x1e3db5=[];var _0x33d788=0x0;if(_0x36ac7c[_0xf2ff('0x2a')]){if(_0xea0bb5&&_0xea0bb5['length']){var _0x46f454=_[_0xf2ff('0x2b')](_0xea0bb5[0x0][_0xf2ff('0x25')]/_0x391f58);var _0x127a1f=Number[_0xf2ff('0x2c')](_0xea0bb5[0x0][_0xf2ff('0x25')]/_0x391f58)?_0xea0bb5[0x0][_0xf2ff('0x25')]%_0x391f58:0x0;_0x46f454['forEach'](function(_0x47db85){if(_0x47db85>0x0){_0x33d788+=_0x391f58;}_0x1e3db5['push'](dbH[_0xf2ff('0x2d')][_0xf2ff('0x2e')](util[_0xf2ff('0x18')](_0xf2ff('0x2f'),QUERY,_0x391f58,_0x33d788),{'type':dbH['sequelize'][_0xf2ff('0x30')][_0xf2ff('0x31')]}));});if(_0x127a1f>0x0){_0x33d788+=_0x391f58;_0x1e3db5[_0xf2ff('0x16')](dbH[_0xf2ff('0x2d')][_0xf2ff('0x2e')](util[_0xf2ff('0x18')](_0xf2ff('0x2f'),QUERY,_0x127a1f,_0x33d788),{'type':dbH[_0xf2ff('0x2d')][_0xf2ff('0x30')][_0xf2ff('0x31')]}));}}}else{_0x1e3db5[_0xf2ff('0x16')](dbH[_0xf2ff('0x2d')][_0xf2ff('0x2e')](QUERY,{'type':dbH[_0xf2ff('0x2d')][_0xf2ff('0x30')][_0xf2ff('0x31')]}));}var _0x5f066b=path['dirname'](PATH);var _0x2958ab=path['basename'](PATH,_0xf2ff('0x32'));var _0x363b81=_0x36ac7c['split']&&_0x1e3db5[_0xf2ff('0x1d')]>0x1;var _0x403934=[];if(!fs[_0xf2ff('0x33')](path[_0xf2ff('0x34')](_0x5f066b,_0x2958ab))&&_0x363b81){fs[_0xf2ff('0x35')](path[_0xf2ff('0x34')](_0x5f066b,_0x2958ab));}return BPromise['each'](_0x1e3db5,function(_0x54e34b){_0x403934['push'](_0x54e34b);})[_0xf2ff('0x29')](function(){var _0x3dc644=[];for(var _0x32e6f7=0x0;_0x32e6f7<_0x403934['length'];_0x32e6f7+=0x1){var _0x47e272=_0x403934[_0x32e6f7];var _0x1ccf87=createTables(_[_0xf2ff('0x36')](_0x47e272));var _0x1b1701;var _0x911949=getPDFDocDefinition(_0x1ccf87);var _0x1a6d94=getPDFPrinter();var _0x94e9ee=_0x1a6d94[_0xf2ff('0x37')](_0x911949);if(_0x363b81){_0x1b1701=path[_0xf2ff('0x34')](_0x5f066b,_0x2958ab,util['format']('%s%d.%s',_0x2958ab,_0x32e6f7,'pdf'));}else{_0x1b1701=path[_0xf2ff('0x34')](_0x5f066b,util['format'](_0xf2ff('0x38'),_0x2958ab,_0xf2ff('0x39')));}_0x3dc644[_0xf2ff('0x16')](writePDFDocument(_0x94e9ee,_0x1b1701));}return Promise['all'](_0x3dc644);})[_0xf2ff('0x29')](function(){if(_0x363b81){return new Promise(function(_0x2c17a0){zipdir(path[_0xf2ff('0x34')](_0x5f066b,_0x2958ab),{'saveTo':path['join'](_0x5f066b,util['format'](_0xf2ff('0x38'),_0x2958ab,_0xf2ff('0x3a')))},function(){rimraf(path['join'](_0x5f066b,_0x2958ab),function(){});_0x2c17a0(_0xf2ff('0x3b'));});});}})['then'](function(){if(!_0x363b81)return;rimraf(path[_0xf2ff('0x34')](_0x5f066b,_0x2958ab),function(){});})[_0xf2ff('0x29')](function(){logger[_0xf2ff('0x3c')](util[_0xf2ff('0x18')](_0xf2ff('0x3d'),EXTRACTED_REPORT_ID,_0xf2ff('0x3e')));return analyticExtractedReport('Completed',_0x363b81?util['format'](_0xf2ff('0x38'),_0x2958ab,_0x363b81?_0xf2ff('0x3a'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf2ff('0x3c')](util[_0xf2ff('0x18')](_0xf2ff('0x3f'),EXTRACTED_REPORT_ID,_0xf2ff('0x3e')));return db['AnalyticExtractedReport'][_0xf2ff('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf2ff('0x29')](function(_0x5d5c54){EXTRACTED_REPORT=_0x5d5c54;return dbH['sequelize']['query'](util[_0xf2ff('0x18')](_0xf2ff('0x41'),QUERY),{'type':dbH['sequelize'][_0xf2ff('0x30')][_0xf2ff('0x31')]});})['then'](extractReport)[_0xf2ff('0x42')](function(_0x32acb8){logger[_0xf2ff('0x3c')](util['format'](_0xf2ff('0x43'),EXTRACTED_REPORT_ID,_0xf2ff('0x3e')),util[_0xf2ff('0x44')](_0x32acb8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf2ff('0x45'));})['finally'](function(){process[_0xf2ff('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1aaff2=new PdfPrinter({'Arial':{'normal':__dirname+_0xf2ff('0x47'),'bold':__dirname+_0xf2ff('0x48'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x1aaff2;}function getPDFDocDefinitionFromHTML(_0x1f00b5,_0x582be2){var _0x25f6b7=util[_0xf2ff('0x18')](_0xf2ff('0x49'),_0x582be2[_0xf2ff('0x4a')],_0x582be2[_0xf2ff('0x4b')]);var _0x5285b8=moment()[_0xf2ff('0x18')](_0xf2ff('0x4c'))['toString']();var _0x3b0b18=htmlToPdfmake(_0x1f00b5,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3b0b18],'defaultStyle':{'font':_0xf2ff('0x4d')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf2ff('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf2ff('0x4e')}},'header':function(){return[{'text':_0xf2ff('0x4f'),'style':_0xf2ff('0x50')}];},'footer':function(_0x52a180,_0x44c687){return[{'text':util[_0xf2ff('0x18')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x25f6b7,_0x52a180,_0x44c687,_0x5285b8),'style':'footer'}];}};}function writePDFDocument(_0x391b36,_0x2ec672){return new Promise(function(_0x59fade,_0x30d77b){var _0x264905=_0x391b36[_0xf2ff('0x51')](fs[_0xf2ff('0x52')](_0x2ec672));_0x264905['on'](_0xf2ff('0x53'),function(){_0x59fade(_0xf2ff('0x53'));});_0x264905['on']('error',function(_0x1a925a){_0x30d77b(_0x1a925a);});_0x391b36[_0xf2ff('0x54')]();});}exports[_0xf2ff('0x55')]=function(_0x53f2c4,_0x582970){var _0x28b120=getPDFPrinter();var _0x2556b1=getPDFDocDefinitionFromHTML(_0x53f2c4,_0x582970);var _0x9ac488=_0x28b120[_0xf2ff('0x37')](_0x2556b1);return writePDFDocument(_0x9ac488,_0x582970[_0xf2ff('0x2')])[_0xf2ff('0x42')](function(_0x30f76b){throw _0x30f76b;});};
\ No newline at end of file
+var _0xf0ac=['info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','path','moment','pdfmake/src/printer','zip-dir','rimraf','JSDOM','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','fill','length','auto','push','body','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','num','Empty','Setting','find','split','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','then','flatten','createPdfKitDocument','pdf','all','%s.%s','zip','zip\x20finished'];(function(_0xf3d69e,_0x258179){var _0x440672=function(_0x1c7aee){while(--_0x1c7aee){_0xf3d69e['push'](_0xf3d69e['shift']());}};_0x440672(++_0x258179);}(_0xf0ac,0x72));var _0xcf0a=function(_0x331a73,_0x190154){_0x331a73=_0x331a73-0x0;var _0x20e304=_0xf0ac[_0x331a73];return _0x20e304;};'use strict';var _=require(_0xcf0a('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xcf0a('0x1'));var moment=require(_0xcf0a('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xcf0a('0x3'));var zipdir=require(_0xcf0a('0x4'));var rimraf=require(_0xcf0a('0x5'));var JSDOM=require('jsdom')[_0xcf0a('0x6')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcf0a('0x7')];var logger=require(_0xcf0a('0x8'))(_0xcf0a('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xcf0a('0xa')][0x2]);var QUERY=process[_0xcf0a('0xa')][0x3];var PATH=process[_0xcf0a('0xa')][0x4];var NAME=process[_0xcf0a('0xa')][0x5];var FORMAT=_0xcf0a('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ed569,_0x26552c){var _0x38c9f0={'status':_0x2ed569};var _0xd5dd76={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x26552c){_0x38c9f0[_0xcf0a('0xc')]=_0x26552c;}return db[_0xcf0a('0xd')][_0xcf0a('0xe')](_0x38c9f0,_0xd5dd76);}function getHeaders(_0x1939bf){return _[_0xcf0a('0xf')](_0x1939bf,function(_0x1e3c19){return{'text':_0x1e3c19,'style':_0xcf0a('0x10')};});}function getRows(_0x519186,_0x3999a6){return _['map'](_0x3999a6,function(_0x5046c0){return _(_0x5046c0)['pick'](_0x519186)['map'](function(_0x3032de){return _0x3032de?_[_0xcf0a('0x11')](_0x3032de):'';})['value']();});}function createTable(_0x28e842,_0x209abf){var _0x1317c6={'widths':_[_0xcf0a('0x12')](Array(_0x28e842[_0xcf0a('0x13')]),0x91),'heights':function(_0x5940fd){return _0x5940fd===0x0?_0xcf0a('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x37ab82=getHeaders(_0x28e842);_0x1317c6['body'][_0xcf0a('0x15')](_0x37ab82);var _0x5d3b2a=getRows(_0x28e842,_0x209abf);_0x1317c6['body']=_0x1317c6[_0xcf0a('0x16')][_0xcf0a('0x17')](_0x5d3b2a);return _0x1317c6;}function createTables(_0x5e4811){var _0x13bfec=[];var _0x387864=_[_0xcf0a('0x18')](Object['keys'](_0x5e4811[0x0]),0x5);_0x387864[_0xcf0a('0x19')](function(_0x39986a){_0x13bfec[_0xcf0a('0x15')](createTable(_0x39986a,_0x5e4811));});return _0x13bfec;}function getPDFDocDefinition(_0x2470c0){var _0xcd203f=util[_0xcf0a('0x1a')](_0xcf0a('0x1b'),NAME,EXTRACTED_REPORT[_0xcf0a('0x1c')],moment(EXTRACTED_REPORT[_0xcf0a('0x1d')])[_0xcf0a('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xcf0a('0x1a')](FORMAT));var _0x3b724=[];for(var _0x371d2a=0x0;_0x371d2a<_0x2470c0[_0xcf0a('0x13')];_0x371d2a++){var _0x2a7eb9=[];if(_0x371d2a===0x0){_0x2a7eb9[_0xcf0a('0x15')]({'text':_0xcd203f,'style':_0xcf0a('0x1e')});}var _0xde46a6={'table':_0x2470c0[_0x371d2a]};if(_0x371d2a>0x0){_0xde46a6[_0xcf0a('0x1f')]=_0xcf0a('0x20');_0xde46a6[_0xcf0a('0x21')]=[0x0,0x46,0x0,0x0];}_0x2a7eb9['push'](_0xde46a6);_0x3b724[_0xcf0a('0x15')](_0x2a7eb9);}return{'pageSize':'A4','pageOrientation':_0xcf0a('0x22'),'content':_0x3b724,'footer':function(_0x564003,_0x4b962b){return{'text':_0x564003[_0xcf0a('0x11')]()+_0xcf0a('0x23')+_0x4b962b,'style':'footer'};},'defaultStyle':{'font':_0xcf0a('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcf0a('0x25')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2f69cb){var _0x24c4d=0x1388;var _0x29a1d5;if(!_0x2f69cb[0x0][_0xcf0a('0x26')]){return analyticExtractedReport(_0xcf0a('0x27'));}return db[_0xcf0a('0x28')][_0xcf0a('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcf0a('0x2a'),'splitSizePdf']})['then'](function(_0x4a59b2){if(_0x4a59b2){_0x29a1d5=_0x4a59b2;_0x24c4d=_0x29a1d5['splitSizePdf']||0x3e8;}})['then'](function(){var _0x390263=[];var _0xe85b1c=0x0;if(_0x29a1d5[_0xcf0a('0x2a')]){if(_0x2f69cb&&_0x2f69cb[_0xcf0a('0x13')]){var _0x2dc219=_['range'](_0x2f69cb[0x0]['num']/_0x24c4d);var _0xac4542=Number[_0xcf0a('0x2b')](_0x2f69cb[0x0]['num']/_0x24c4d)?_0x2f69cb[0x0][_0xcf0a('0x26')]%_0x24c4d:0x0;_0x2dc219[_0xcf0a('0x19')](function(_0x49b55b){if(_0x49b55b>0x0){_0xe85b1c+=_0x24c4d;}_0x390263[_0xcf0a('0x15')](dbH[_0xcf0a('0x2c')][_0xcf0a('0x2d')](util['format'](_0xcf0a('0x2e'),QUERY,_0x24c4d,_0xe85b1c),{'type':dbH[_0xcf0a('0x2c')][_0xcf0a('0x2f')][_0xcf0a('0x30')]}));});if(_0xac4542>0x0){_0xe85b1c+=_0x24c4d;_0x390263[_0xcf0a('0x15')](dbH[_0xcf0a('0x2c')][_0xcf0a('0x2d')](util[_0xcf0a('0x1a')](_0xcf0a('0x2e'),QUERY,_0xac4542,_0xe85b1c),{'type':dbH['sequelize'][_0xcf0a('0x2f')][_0xcf0a('0x30')]}));}}}else{_0x390263[_0xcf0a('0x15')](dbH['sequelize'][_0xcf0a('0x2d')](QUERY,{'type':dbH[_0xcf0a('0x2c')][_0xcf0a('0x2f')][_0xcf0a('0x30')]}));}var _0x26b467=path[_0xcf0a('0x31')](PATH);var _0x426c0d=path[_0xcf0a('0x32')](PATH,_0xcf0a('0x33'));var _0x31c058=_0x29a1d5[_0xcf0a('0x2a')]&&_0x390263[_0xcf0a('0x13')]>0x1;var _0x4e9abf=[];if(!fs[_0xcf0a('0x34')](path['join'](_0x26b467,_0x426c0d))&&_0x31c058){fs[_0xcf0a('0x35')](path[_0xcf0a('0x36')](_0x26b467,_0x426c0d));}return BPromise[_0xcf0a('0x37')](_0x390263,function(_0x44de97){_0x4e9abf['push'](_0x44de97);})[_0xcf0a('0x38')](function(){var _0x447a91=[];for(var _0x45e6b6=0x0;_0x45e6b6<_0x4e9abf['length'];_0x45e6b6+=0x1){var _0x1fe080=_0x4e9abf[_0x45e6b6];var _0x5ae4f0=createTables(_[_0xcf0a('0x39')](_0x1fe080));var _0x188b32;var _0x5713da=getPDFDocDefinition(_0x5ae4f0);var _0x13b14f=getPDFPrinter();var _0x2f5efe=_0x13b14f[_0xcf0a('0x3a')](_0x5713da);if(_0x31c058){_0x188b32=path[_0xcf0a('0x36')](_0x26b467,_0x426c0d,util[_0xcf0a('0x1a')]('%s%d.%s',_0x426c0d,_0x45e6b6,'pdf'));}else{_0x188b32=path[_0xcf0a('0x36')](_0x26b467,util[_0xcf0a('0x1a')]('%s.%s',_0x426c0d,_0xcf0a('0x3b')));}_0x447a91[_0xcf0a('0x15')](writePDFDocument(_0x2f5efe,_0x188b32));}return Promise[_0xcf0a('0x3c')](_0x447a91);})[_0xcf0a('0x38')](function(){if(_0x31c058){return new Promise(function(_0x4066ed){zipdir(path[_0xcf0a('0x36')](_0x26b467,_0x426c0d),{'saveTo':path[_0xcf0a('0x36')](_0x26b467,util['format'](_0xcf0a('0x3d'),_0x426c0d,_0xcf0a('0x3e')))},function(){rimraf(path[_0xcf0a('0x36')](_0x26b467,_0x426c0d),function(){});_0x4066ed(_0xcf0a('0x3f'));});});}})[_0xcf0a('0x38')](function(){if(!_0x31c058)return;rimraf(path[_0xcf0a('0x36')](_0x26b467,_0x426c0d),function(){});})[_0xcf0a('0x38')](function(){logger[_0xcf0a('0x40')](util[_0xcf0a('0x1a')](_0xcf0a('0x41'),EXTRACTED_REPORT_ID,_0xcf0a('0x42')));return analyticExtractedReport(_0xcf0a('0x43'),_0x31c058?util[_0xcf0a('0x1a')](_0xcf0a('0x3d'),_0x426c0d,_0x31c058?_0xcf0a('0x3e'):_0xcf0a('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xcf0a('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcf0a('0x42')));return db[_0xcf0a('0xd')][_0xcf0a('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xcf0a('0x38')](function(_0x294ae8){EXTRACTED_REPORT=_0x294ae8;return dbH[_0xcf0a('0x2c')][_0xcf0a('0x2d')](util['format'](_0xcf0a('0x45'),QUERY),{'type':dbH['sequelize'][_0xcf0a('0x2f')]['SELECT']});})[_0xcf0a('0x38')](extractReport)[_0xcf0a('0x46')](function(_0x1c86fd){logger['info'](util['format'](_0xcf0a('0x47'),EXTRACTED_REPORT_ID,_0xcf0a('0x42')),util['inspect'](_0x1c86fd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcf0a('0x48'));})[_0xcf0a('0x49')](function(){process[_0xcf0a('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x23d005=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xcf0a('0x4b'),'italics':__dirname+_0xcf0a('0x4c'),'bolditalics':__dirname+_0xcf0a('0x4d')}});return _0x23d005;}function getPDFDocDefinitionFromHTML(_0x297f7e,_0x345347){var _0x1d7a82=util[_0xcf0a('0x1a')]('%s\x20#%d',_0x345347['channel'],_0x345347[_0xcf0a('0x4e')]);var _0x133f77=moment()[_0xcf0a('0x1a')]('YYYY-MM-DD')[_0xcf0a('0x11')]();var _0x4bf00d=htmlToPdfmake(_0x297f7e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4bf00d],'defaultStyle':{'font':_0xcf0a('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcf0a('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcf0a('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcf0a('0x4f')}},'header':function(){return[{'text':_0xcf0a('0x50'),'style':_0xcf0a('0x1e')}];},'footer':function(_0x5ed854,_0x55172a){return[{'text':util[_0xcf0a('0x1a')](_0xcf0a('0x51'),_0x1d7a82,_0x5ed854,_0x55172a,_0x133f77),'style':_0xcf0a('0x52')}];}};}function writePDFDocument(_0x17c15b,_0x7b9c49){return new Promise(function(_0x5cb1d8,_0x505385){var _0x23269a=_0x17c15b[_0xcf0a('0x53')](fs[_0xcf0a('0x54')](_0x7b9c49));_0x23269a['on']('finish',function(){_0x5cb1d8(_0xcf0a('0x55'));});_0x23269a['on'](_0xcf0a('0x56'),function(_0x359340){_0x505385(_0x359340);});_0x17c15b[_0xcf0a('0x57')]();});}exports[_0xcf0a('0x58')]=function(_0x8c3ac5,_0x27986f){var _0x3cfd73=getPDFPrinter();var _0xd0c30c=getPDFDocDefinitionFromHTML(_0x8c3ac5,_0x27986f);var _0xa7358=_0x3cfd73['createPdfKitDocument'](_0xd0c30c);return writePDFDocument(_0xa7358,_0x27986f[_0xcf0a('0x1')])[_0xcf0a('0x46')](function(_0x55dd04){throw _0x55dd04;});};
\ No newline at end of file
index d76bd6e..6b83e51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c6f=['length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','QueryTypes','dirname','basename','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','%s.%s','xlsx','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT','num','Empty'];(function(_0x3878d6,_0x599bc7){var _0x5d3199=function(_0x10af68){while(--_0x10af68){_0x3878d6['push'](_0x3878d6['shift']());}};_0x5d3199(++_0x599bc7);}(_0x9c6f,0x1a8));var _0xf9c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c6f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf9c6('0x0'));var path=require(_0xf9c6('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xf9c6('0x2'));var zipdir=require(_0xf9c6('0x3'));var rimraf=require(_0xf9c6('0x4'));var db=require(_0xf9c6('0x5'))['db'];var dbH=require('../../mysqldb')[_0xf9c6('0x6')];var logger=require(_0xf9c6('0x7'))(_0xf9c6('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xf9c6('0x9')][0x2]);var QUERY=process[_0xf9c6('0x9')][0x3];var PATH=process[_0xf9c6('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x16d48f,_0x5bd911){var _0x34b77f={'status':_0x16d48f};var _0x413e62={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5bd911){_0x34b77f[_0xf9c6('0xa')]=_0x5bd911;}return db[_0xf9c6('0xb')][_0xf9c6('0xc')](_0x34b77f,_0x413e62);}function main(){var _0x1212c1=0x1388;var _0xd4f16c;logger[_0xf9c6('0xd')](util[_0xf9c6('0xe')](_0xf9c6('0xf'),EXTRACTED_REPORT_ID,_0xf9c6('0x10')));return db[_0xf9c6('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf9c6('0x12'),_0xf9c6('0x13')]})[_0xf9c6('0x14')](function(_0x13998c){if(_0x13998c){_0xd4f16c=_0x13998c;_0x1212c1=_0xd4f16c[_0xf9c6('0x13')]||0x1388;}})[_0xf9c6('0x14')](function(){return dbH[_0xf9c6('0x15')][_0xf9c6('0x16')](util[_0xf9c6('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xf9c6('0x15')]['QueryTypes'][_0xf9c6('0x17')]});})[_0xf9c6('0x14')](function(_0x116663){if(!_0x116663[0x0][_0xf9c6('0x18')]){return analyticExtractedReport(_0xf9c6('0x19'));}var _0x468031=[];var _0x2d3213=0x0;if(_0xd4f16c[_0xf9c6('0x12')]){if(_0x116663&&_0x116663[_0xf9c6('0x1a')]){var _0x278305=_[_0xf9c6('0x1b')](_0x116663[0x0][_0xf9c6('0x18')]/_0x1212c1);var _0xf28260=Number[_0xf9c6('0x1c')](_0x116663[0x0][_0xf9c6('0x18')]/_0x1212c1)?_0x116663[0x0][_0xf9c6('0x18')]%_0x1212c1:0x0;_0x278305[_0xf9c6('0x1d')](function(_0x12cad6){if(_0x12cad6>0x0){_0x2d3213+=_0x1212c1;}_0x468031['push'](dbH['sequelize'][_0xf9c6('0x16')](util[_0xf9c6('0xe')](_0xf9c6('0x1e'),QUERY,_0x1212c1,_0x2d3213),{'type':dbH['sequelize']['QueryTypes'][_0xf9c6('0x17')]}));});if(_0xf28260>0x0){_0x2d3213+=_0x1212c1;_0x468031[_0xf9c6('0x1f')](dbH['sequelize'][_0xf9c6('0x16')](util[_0xf9c6('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xf28260,_0x2d3213),{'type':dbH['sequelize'][_0xf9c6('0x20')][_0xf9c6('0x17')]}));}}}else{_0x468031['push'](dbH[_0xf9c6('0x15')][_0xf9c6('0x16')](QUERY,{'type':dbH[_0xf9c6('0x15')][_0xf9c6('0x20')]['SELECT']}));}var _0x3dd516=path[_0xf9c6('0x21')](PATH);var _0x54db98=path[_0xf9c6('0x22')](PATH,_0xf9c6('0x23'));var _0x22214e=_0xd4f16c[_0xf9c6('0x12')]&&_0x468031[_0xf9c6('0x1a')]>0x1;var _0x5ce4e0=[];if(!fs[_0xf9c6('0x24')](path['join'](_0x3dd516,_0x54db98))&&_0x22214e){fs[_0xf9c6('0x25')](path[_0xf9c6('0x26')](_0x3dd516,_0x54db98));}return BPromise[_0xf9c6('0x27')](_0x468031,function(_0x236330){_0x5ce4e0[_0xf9c6('0x1f')](_0x236330);})[_0xf9c6('0x14')](function(){for(var _0x52adc5=0x0;_0x52adc5<_0x5ce4e0['length'];_0x52adc5+=0x1){var _0x3012d4;var _0x3b3ad8=_0x5ce4e0[_0x52adc5];if(_0x22214e){_0x3012d4=path['join'](_0x3dd516,_0x54db98,util[_0xf9c6('0xe')](_0xf9c6('0x28'),_0x54db98,_0x52adc5,'xlsx'));}else{_0x3012d4=path[_0xf9c6('0x26')](_0x3dd516,util[_0xf9c6('0xe')](_0xf9c6('0x29'),_0x54db98,_0xf9c6('0x2a')));}fs[_0xf9c6('0x2b')](_0x3012d4,json2xls(_0x3b3ad8),'binary');}})['then'](function(){if(_0x22214e){return new Promise(function(_0x51db70){zipdir(path['join'](_0x3dd516,_0x54db98),{'saveTo':path[_0xf9c6('0x26')](_0x3dd516,util['format']('%s.%s',_0x54db98,_0xf9c6('0x2c')))},function(_0x3dce40,_0x1ffab){rimraf(path[_0xf9c6('0x26')](_0x3dd516,_0x54db98),function(){});_0x51db70('zip\x20finished');});});}})[_0xf9c6('0x14')](function(){logger[_0xf9c6('0xd')](util[_0xf9c6('0xe')](_0xf9c6('0x2d'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x22214e?util['format']('%s.%s',_0x54db98,_0x22214e?'zip':'xlsx'):null);});})[_0xf9c6('0x2e')](function(_0x3c337d){logger[_0xf9c6('0xd')](util[_0xf9c6('0xe')](_0xf9c6('0x2f'),EXTRACTED_REPORT_ID,_0xf9c6('0x10')),util['inspect'](_0x3c337d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf9c6('0x30')](function(){process[_0xf9c6('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x4314=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','split','length','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','SELECT','basename','existsSync','join','mkdirSync','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','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','finally','exit','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x4314,0xe5));var _0x4431=function(_0x1a1b24,_0x2a2514){_0x1a1b24=_0x1a1b24-0x0;var _0x3ee752=_0x4314[_0x1a1b24];return _0x3ee752;};'use strict';var util=require('util');var path=require('path');var _=require(_0x4431('0x0'));var fs=require('fs');var json2xls=require(_0x4431('0x1'));var BPromise=require(_0x4431('0x2'));var zipdir=require(_0x4431('0x3'));var rimraf=require(_0x4431('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4431('0x5'))[_0x4431('0x6')];var logger=require(_0x4431('0x7'))(_0x4431('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x4431('0x9')][0x2]);var QUERY=process[_0x4431('0x9')][0x3];var PATH=process[_0x4431('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x108d9a,_0x339f8f){var _0x182dd1={'status':_0x108d9a};var _0xa623c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x339f8f){_0x182dd1[_0x4431('0xa')]=_0x339f8f;}return db['AnalyticExtractedReport'][_0x4431('0xb')](_0x182dd1,_0xa623c);}function main(){var _0x38bd7f=0x1388;var _0x2b4c1e;logger[_0x4431('0xc')](util[_0x4431('0xd')](_0x4431('0xe'),EXTRACTED_REPORT_ID,_0x4431('0xf')));return db[_0x4431('0x10')][_0x4431('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4431('0x12')]})[_0x4431('0x13')](function(_0x47cfe3){if(_0x47cfe3){_0x2b4c1e=_0x47cfe3;_0x38bd7f=_0x2b4c1e['splitSizeXlsx']||0x1388;}})[_0x4431('0x13')](function(){return dbH[_0x4431('0x14')][_0x4431('0x15')](util[_0x4431('0xd')](_0x4431('0x16'),QUERY),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']});})['then'](function(_0x2f3aa4){if(!_0x2f3aa4[0x0]['num']){return analyticExtractedReport(_0x4431('0x18'));}var _0x24b3a5=[];var _0x2111f5=0x0;if(_0x2b4c1e[_0x4431('0x19')]){if(_0x2f3aa4&&_0x2f3aa4[_0x4431('0x1a')]){var _0x3eab43=_[_0x4431('0x1b')](_0x2f3aa4[0x0][_0x4431('0x1c')]/_0x38bd7f);var _0x478822=Number[_0x4431('0x1d')](_0x2f3aa4[0x0][_0x4431('0x1c')]/_0x38bd7f)?_0x2f3aa4[0x0][_0x4431('0x1c')]%_0x38bd7f:0x0;_0x3eab43[_0x4431('0x1e')](function(_0x3e2266){if(_0x3e2266>0x0){_0x2111f5+=_0x38bd7f;}_0x24b3a5['push'](dbH[_0x4431('0x14')]['query'](util[_0x4431('0xd')](_0x4431('0x1f'),QUERY,_0x38bd7f,_0x2111f5),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']}));});if(_0x478822>0x0){_0x2111f5+=_0x38bd7f;_0x24b3a5[_0x4431('0x20')](dbH[_0x4431('0x14')][_0x4431('0x15')](util[_0x4431('0xd')](_0x4431('0x1f'),QUERY,_0x478822,_0x2111f5),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']}));}}}else{_0x24b3a5[_0x4431('0x20')](dbH[_0x4431('0x14')][_0x4431('0x15')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4431('0x21')]}));}var _0x51f025=path['dirname'](PATH);var _0x230e93=path[_0x4431('0x22')](PATH,'.xlsx');var _0x40c54e=_0x2b4c1e[_0x4431('0x19')]&&_0x24b3a5[_0x4431('0x1a')]>0x1;var _0x480f71=[];if(!fs[_0x4431('0x23')](path[_0x4431('0x24')](_0x51f025,_0x230e93))&&_0x40c54e){fs[_0x4431('0x25')](path[_0x4431('0x24')](_0x51f025,_0x230e93));}return BPromise['each'](_0x24b3a5,function(_0x3aff5b){_0x480f71[_0x4431('0x20')](_0x3aff5b);})['then'](function(){for(var _0x52a566=0x0;_0x52a566<_0x480f71[_0x4431('0x1a')];_0x52a566+=0x1){var _0x4ee429;var _0x42f280=_0x480f71[_0x52a566];if(_0x40c54e){_0x4ee429=path[_0x4431('0x24')](_0x51f025,_0x230e93,util[_0x4431('0xd')](_0x4431('0x26'),_0x230e93,_0x52a566,_0x4431('0x27')));}else{_0x4ee429=path['join'](_0x51f025,util[_0x4431('0xd')]('%s.%s',_0x230e93,_0x4431('0x27')));}fs['writeFileSync'](_0x4ee429,json2xls(_0x42f280),_0x4431('0x28'));}})[_0x4431('0x13')](function(){if(_0x40c54e){return new Promise(function(_0x137352){zipdir(path[_0x4431('0x24')](_0x51f025,_0x230e93),{'saveTo':path['join'](_0x51f025,util['format'](_0x4431('0x29'),_0x230e93,_0x4431('0x2a')))},function(_0x49aa23,_0x9a5f3e){rimraf(path['join'](_0x51f025,_0x230e93),function(){});_0x137352(_0x4431('0x2b'));});});}})['then'](function(){logger[_0x4431('0xc')](util['format'](_0x4431('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x40c54e?util[_0x4431('0xd')](_0x4431('0x29'),_0x230e93,_0x40c54e?_0x4431('0x2a'):_0x4431('0x27')):null);});})[_0x4431('0x2d')](function(_0x5befad){logger[_0x4431('0xc')](util[_0x4431('0xd')](_0x4431('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x4431('0x2f')](_0x5befad,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4431('0x30')](function(){process[_0x4431('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
index 5ba520b..8a95bd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe32e=['outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','length','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','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','filter','exten','playback','extensions','extension','push','type','Set','format','CDR(type)=%s','context','priority','inbound','CDR(routeid)=','VoiceExtensionId'];(function(_0x260ce2,_0x2e22b8){var _0x16b105=function(_0x260a06){while(--_0x260a06){_0x260ce2['push'](_0x260ce2['shift']());}};_0x16b105(++_0x2e22b8);}(_0xe32e,0x13f));var _0xee32=function(_0x2fd6cb,_0x54bbc4){_0x2fd6cb=_0x2fd6cb-0x0;var _0x3aa243=_0xe32e[_0x2fd6cb];return _0x3aa243;};'use strict';var _=require(_0xee32('0x0'));var util=require(_0xee32('0x1'));function rewrite(_0x336838,_0x2bb947){var _0xb76a9a=this;return _0x336838[_0xee32('0x2')][_0xee32('0x3')][_0xee32('0x4')]({'raw':!![]})[_0xee32('0x5')](function(_0x4797b4){_0xb76a9a[_0xee32('0x6')]=_0x4797b4;return _0x336838[_0xee32('0x2')][_0xee32('0x7')][_0xee32('0x4')]({'where':{'IntervalId':_0x2bb947[_0xee32('0x8')]},'raw':!![]});})['then'](function(_0x504bd5){return _0x336838[_0xee32('0x2')][_0xee32('0x7')][_0xee32('0x4')]({'where':{'exten':{'$in':_[_0xee32('0x9')](_[_0xee32('0xa')](_0x504bd5,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xee32('0x5')](function(_0x49f9fb){var _0x59ce88=_[_0xee32('0xb')](_0x49f9fb,{'priority':'1'});var _0x5d4ce7=_[_0xee32('0xb')](_0x49f9fb,{'isApp':0x1});var _0x46e91f=_['groupBy'](_0x5d4ce7,_0xee32('0xc'));var _0x42737c=['queue',_0xee32('0xd')];var _0x2771d8=[];var _0x11f66c=[];for(var _0x308f4e in _0x46e91f){if(_0x46e91f['hasOwnProperty'](_0x308f4e)){_0xb76a9a['priority']=0x2;_0xb76a9a[_0xee32('0xe')]=[];_0xb76a9a[_0xee32('0xf')]=_['find'](_0x59ce88,{'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')]});_0xb76a9a['extensions'][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':util[_0xee32('0x13')](_0xee32('0x14'),_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')]),'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0]['exten'],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0]['VoiceExtensionId']});if(_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')]===_0xee32('0x17')){_0xb76a9a[_0xee32('0xe')][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0]['type'],'app':'Set','appdata':_0xee32('0x18')+_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')],'context':_0x46e91f[_0x308f4e][0x0]['context'],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0]['VoiceExtensionId']});}else if(_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')]===_0xee32('0x1a')){if(_0xb76a9a[_0xee32('0xf')]){_0xb76a9a['extensions'][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':'Set','appdata':'CDR(destination)='+(_0xb76a9a[_0xee32('0xf')][_0xee32('0x1b')]?_0xee32('0x1c')+_0xb76a9a[_0xee32('0xf')]['cutdigits']+'}':_0xee32('0x1d')),'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')]});}_0xb76a9a['extensions']['push']({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':_0xee32('0x18')+_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')],'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')]});var _0x372510=_0xb76a9a[_0xee32('0x16')]++;_0xb76a9a[_0xee32('0xe')]['push']({'type':_0x46e91f[_0x308f4e][0x0]['type'],'app':_0xee32('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x372510+0x2)+_0xee32('0x1f')+(_0x372510+0x1)+')','context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0x372510,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')]});if(_0xb76a9a[_0xee32('0xf')]){_0xb76a9a[_0xee32('0xe')][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':'Set','appdata':_0xb76a9a[_0xee32('0xf')]['cutdigits']?_0xee32('0x20')+_0xb76a9a[_0xee32('0xf')][_0xee32('0x1b')]+'}':_0xee32('0x21'),'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0]['exten'],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')]});}_0xb76a9a['extensions'][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0]['type'],'app':_0xee32('0x12'),'appdata':_0xee32('0x22')+_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')],'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0]['exten'],'priority':_0xb76a9a['priority']++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0]['VoiceExtensionId']});if(_0xb76a9a['extension']&&_0xb76a9a['extension'][_0xee32('0x23')](_0xee32('0x24'))&&_0xb76a9a[_0xee32('0xf')][_0xee32('0x24')]!==_0xee32('0x25')){_0xb76a9a[_0xee32('0xe')][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0xb76a9a['priority']++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')]});_0xb76a9a['extensions'][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xb76a9a[_0xee32('0xf')][_0xee32('0x24')]||'wav','context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0]['VoiceExtensionId']});}}_0xb76a9a[_0xee32('0xe')]['push']({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':_0xee32('0x26'),'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0]['VoiceExtensionId']});_0xb76a9a[_0xee32('0xe')][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':'Set','appdata':_0xee32('0x27'),'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')]});_0xb76a9a[_0xee32('0xe')][_0xee32('0x10')]({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':_0xee32('0x28'),'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'priority':_0xb76a9a[_0xee32('0x16')]++,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0]['VoiceExtensionId']});for(var _0x4ecb14=0x0,_0x5263e1=0x0;_0x4ecb14<_0x46e91f[_0x308f4e]['length'];_0x4ecb14+=0x1,_0x5263e1=0x0){var _0x1542d1=_0x46e91f[_0x308f4e][_0x4ecb14];if(_0x1542d1[_0xee32('0x11')]){_0x1542d1[_0xee32('0x11')]=_0x1542d1[_0xee32('0x11')][_0xee32('0x29')]();}var _0x30b0a2=[];var _0xbbc76=[];delete _0x1542d1['id'];delete _0x1542d1[_0xee32('0x2a')];delete _0x1542d1[_0xee32('0x2b')];var _0x2bc66c=_0x1542d1['interval']!==_0xee32('0x2c')?[_0x1542d1[_0xee32('0x2d')]]:_0x1542d1['IntervalId']?_[_0xee32('0xa')](_[_0xee32('0xb')](_0xb76a9a[_0xee32('0x6')],{'IntervalId':_0x1542d1['IntervalId']}),_0xee32('0x2d')):[];if(_0x1542d1[_0xee32('0x23')](_0xee32('0x2e'))){if(_0x1542d1[_0xee32('0x2e')]&&_0x1542d1[_0xee32('0x2e')]!=='--'){_0x30b0a2[_0xee32('0x10')]({'type':_0x1542d1[_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':_0xee32('0x2f')+_0x1542d1['tag'],'context':_0x1542d1[_0xee32('0x15')],'exten':_0x1542d1['exten'],'priority':_0x2bc66c[_0xee32('0x30')]+_0xb76a9a[_0xee32('0x16')]+_0x5263e1++,'VoiceExtensionId':_0x1542d1[_0xee32('0x19')]});}}if(_0x1542d1[_0xee32('0x11')]==='outbound'&&_0x1542d1[_0xee32('0x23')](_0xee32('0x31'))){if(_0x1542d1['callerID']){_0x30b0a2[_0xee32('0x10')]({'type':_0x1542d1[_0xee32('0x11')],'app':_0xee32('0x1e'),'appdata':_0xee32('0x32')+_0x1542d1[_0xee32('0x31')]+')','context':_0x1542d1[_0xee32('0x15')],'exten':_0x1542d1[_0xee32('0xc')],'priority':_0x2bc66c[_0xee32('0x30')]+_0xb76a9a['priority']+_0x5263e1++,'VoiceExtensionId':_0x1542d1['VoiceExtensionId']});}else{_0x30b0a2['push']({'type':_0x1542d1[_0xee32('0x11')],'app':_0xee32('0x1e'),'appdata':_0xee32('0x33'),'context':_0x1542d1[_0xee32('0x15')],'exten':_0x1542d1[_0xee32('0xc')],'priority':_0x2bc66c[_0xee32('0x30')]+_0xb76a9a[_0xee32('0x16')]+_0x5263e1++,'VoiceExtensionId':_0x1542d1[_0xee32('0x19')]});}}if(_0x1542d1[_0xee32('0x23')](_0xee32('0x34'))){if(_0x42737c[_0xee32('0x35')](_0x1542d1[_0xee32('0x36')][_0xee32('0x29')]())>=0x0&&_0x1542d1['appType']!==_0xee32('0x37')){if(_0x1542d1[_0xee32('0x34')]){_0x30b0a2[_0xee32('0x10')]({'type':_0x1542d1[_0xee32('0x11')],'app':'ExecIf','appdata':_0xee32('0x38'),'context':_0x1542d1[_0xee32('0x15')],'exten':_0x1542d1[_0xee32('0xc')],'priority':_0x2bc66c[_0xee32('0x30')]+_0xb76a9a[_0xee32('0x16')]+_0x5263e1++,'VoiceExtensionId':_0x1542d1[_0xee32('0x19')]});_0x30b0a2['push']({'type':_0x1542d1[_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1542d1[_0xee32('0x15')],'exten':_0x1542d1['exten'],'priority':_0x2bc66c['length']+_0xb76a9a['priority']+_0x5263e1++,'VoiceExtensionId':_0x1542d1[_0xee32('0x19')]});}else{_0x30b0a2['push']({'type':_0x1542d1[_0xee32('0x11')],'app':_0xee32('0x1e'),'appdata':_0xee32('0x39'),'context':_0x1542d1[_0xee32('0x15')],'exten':_0x1542d1['exten'],'priority':_0x2bc66c[_0xee32('0x30')]+_0xb76a9a[_0xee32('0x16')]+_0x5263e1++,'VoiceExtensionId':_0x1542d1[_0xee32('0x19')]});_0x30b0a2[_0xee32('0x10')]({'type':_0x1542d1[_0xee32('0x11')],'app':_0xee32('0x12'),'appdata':_0xee32('0x3a'),'context':_0x1542d1[_0xee32('0x15')],'exten':_0x1542d1['exten'],'priority':_0x2bc66c[_0xee32('0x30')]+_0xb76a9a[_0xee32('0x16')]+_0x5263e1++,'VoiceExtensionId':_0x1542d1[_0xee32('0x19')]});}}}for(var _0x3cec68=0x0;_0x3cec68<_0x2bc66c[_0xee32('0x30')];_0x3cec68+=0x1){var _0x4f5943=_0xb76a9a[_0xee32('0x16')]+_0x2bc66c[_0xee32('0x30')];var _0x1aca80=_0x3cec68===_0x2bc66c[_0xee32('0x30')]-0x1?_0xb76a9a[_0xee32('0x16')]+_0x30b0a2[_0xee32('0x30')]+_0xbbc76[_0xee32('0x30')]+0x2:_0xb76a9a[_0xee32('0x16')]+_0x3cec68+0x1;_0x30b0a2[_0xee32('0x3b')](_0x3cec68,0x0,{'type':_0x1542d1[_0xee32('0x11')],'app':'GotoIfTime','appdata':_0x2bc66c[_0x3cec68]+'?'+_0x1542d1['context']+_0xee32('0x3c')+_0x4f5943+':'+_0x1542d1[_0xee32('0x15')]+_0xee32('0x3c')+_0x1aca80,'exten':_0x1542d1[_0xee32('0xc')],'context':_0x1542d1[_0xee32('0x15')],'priority':_0xb76a9a[_0xee32('0x16')]+_0x3cec68,'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0]['VoiceExtensionId']});}_0x1542d1[_0xee32('0x16')]=_0x30b0a2[_0xee32('0x30')]?_[_0xee32('0x3d')](_0x30b0a2)[_0xee32('0x16')]+0x1:_0xb76a9a['priority'];_0xb76a9a['priority']=(_0xbbc76[_0xee32('0x30')]?_[_0xee32('0x3d')](_0xbbc76)['priority']:_0x1542d1[_0xee32('0x16')])+0x1;_0xb76a9a[_0xee32('0xe')]=_[_0xee32('0x3e')](_0xb76a9a[_0xee32('0xe')],_0x30b0a2,[_0x1542d1],_0xbbc76);}_0xb76a9a[_0xee32('0xe')]['push']({'type':_0x46e91f[_0x308f4e][0x0][_0xee32('0x11')],'app':_0xee32('0x3f'),'exten':_0x46e91f[_0x308f4e][0x0][_0xee32('0xc')],'context':_0x46e91f[_0x308f4e][0x0][_0xee32('0x15')],'priority':_0xb76a9a[_0xee32('0x16')],'VoiceExtensionId':_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')]});_0x2771d8[_0xee32('0x10')](_0x46e91f[_0x308f4e][0x0][_0xee32('0x19')]);_0x11f66c=_[_0xee32('0x3e')](_0x11f66c,_0xb76a9a[_0xee32('0xe')]);}}return _0x336838[_0xee32('0x40')](function(_0x57287d){return _0x336838['models'][_0xee32('0x7')][_0xee32('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x2771d8}},'transaction':_0x57287d})[_0xee32('0x5')](function(_0x50ccb8){return _0x336838[_0xee32('0x2')]['VoiceExtension'][_0xee32('0x42')](_['sortBy'](_0x11f66c,_0xee32('0x16')),{'transaction':_0x57287d});});});})[_0xee32('0x43')](function(_0x116233){console['error'](_0x116233);});}exports[_0xee32('0x44')]=rewrite;
\ No newline at end of file
+var _0x2baa=['push','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extension','type','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','extensions'];(function(_0x22261a,_0x11efcb){var _0x15cb6a=function(_0x4e6bc3){while(--_0x4e6bc3){_0x22261a['push'](_0x22261a['shift']());}};_0x15cb6a(++_0x11efcb);}(_0x2baa,0x1bb));var _0xa2ba=function(_0xd4e2b3,_0x4f7dbe){_0xd4e2b3=_0xd4e2b3-0x0;var _0x47b134=_0x2baa[_0xd4e2b3];return _0x47b134;};'use strict';var _=require(_0xa2ba('0x0'));var util=require('util');function rewrite(_0xcaff50,_0x31db6a){var _0x4a9323=this;return _0xcaff50[_0xa2ba('0x1')][_0xa2ba('0x2')][_0xa2ba('0x3')]({'raw':!![]})[_0xa2ba('0x4')](function(_0x4441b8){_0x4a9323[_0xa2ba('0x5')]=_0x4441b8;return _0xcaff50['models'][_0xa2ba('0x6')][_0xa2ba('0x3')]({'where':{'IntervalId':_0x31db6a['IntervalId']},'raw':!![]});})['then'](function(_0x4b3daa){return _0xcaff50['models']['VoiceExtension'][_0xa2ba('0x3')]({'where':{'exten':{'$in':_[_0xa2ba('0x7')](_[_0xa2ba('0x8')](_0x4b3daa,_0xa2ba('0x9')))}},'order':[{'raw':_0xa2ba('0xa')}],'raw':!![]});})['then'](function(_0x3c70fe){var _0x22f36f=_['filter'](_0x3c70fe,{'priority':'1'});var _0x30a9c7=_[_0xa2ba('0xb')](_0x3c70fe,{'isApp':0x1});var _0x416a5b=_[_0xa2ba('0xc')](_0x30a9c7,_0xa2ba('0x9'));var _0x1b4a77=[_0xa2ba('0xd'),'playback'];var _0x5ba820=[];var _0x50588d=[];for(var _0x4a988d in _0x416a5b){if(_0x416a5b[_0xa2ba('0xe')](_0x4a988d)){_0x4a9323[_0xa2ba('0xf')]=0x2;_0x4a9323['extensions']=[];_0x4a9323[_0xa2ba('0x10')]=_['find'](_0x22f36f,{'exten':_0x416a5b[_0x4a988d][0x0]['exten']});_0x4a9323['extensions']['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':'Set','appdata':util['format'](_0xa2ba('0x12'),_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')]),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0]['exten'],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});if(_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')]===_0xa2ba('0x15')){_0x4a9323['extensions']['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x17')+_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId'],'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});}else if(_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')]===_0xa2ba('0x18')){if(_0x4a9323[_0xa2ba('0x10')]){_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':'Set','appdata':_0xa2ba('0x1b')+(_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0x1c')]?'${EXTEN:'+_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0x1c')]+'}':_0xa2ba('0x1d')),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});}_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x17')+_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')],'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});var _0x1ad7e3=_0x4a9323[_0xa2ba('0xf')]++;_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1ad7e3+0x2)+_0xa2ba('0x1f')+(_0x1ad7e3+0x1)+')','context':_0x416a5b[_0x4a988d][0x0]['context'],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x1ad7e3,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});if(_0x4a9323[_0xa2ba('0x10')]){_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0]['type'],'app':_0xa2ba('0x16'),'appdata':_0x4a9323[_0xa2ba('0x10')]['cutdigits']?_0xa2ba('0x20')+_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x416a5b[_0x4a988d][0x0]['context'],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});}_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0]['type'],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x21')+_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')],'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0]['exten'],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']});if(_0x4a9323['extension']&&_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0xe')](_0xa2ba('0x22'))&&_0x4a9323['extension']['recordingFormat']!=='none'){_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0]['type'],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x23')+_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0x22')]||_0xa2ba('0x24'),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323['priority']++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});}}_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x25'),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']});_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x416a5b[_0x4a988d][0x0]['context'],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});_0x4a9323['extensions']['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x26'),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0]['exten'],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']});for(var _0xa99ec8=0x0,_0x389134=0x0;_0xa99ec8<_0x416a5b[_0x4a988d][_0xa2ba('0x27')];_0xa99ec8+=0x1,_0x389134=0x0){var _0x3b52b7=_0x416a5b[_0x4a988d][_0xa99ec8];if(_0x3b52b7['type']){_0x3b52b7[_0xa2ba('0x11')]=_0x3b52b7[_0xa2ba('0x11')]['toLowerCase']();}var _0x11ea26=[];var _0x2489d8=[];delete _0x3b52b7['id'];delete _0x3b52b7['createdAt'];delete _0x3b52b7[_0xa2ba('0x28')];var _0x5b6976=_0x3b52b7[_0xa2ba('0x29')]!==_0xa2ba('0x2a')?[_0x3b52b7[_0xa2ba('0x29')]]:_0x3b52b7[_0xa2ba('0x2b')]?_[_0xa2ba('0x8')](_[_0xa2ba('0xb')](_0x4a9323['intervals'],{'IntervalId':_0x3b52b7[_0xa2ba('0x2b')]}),_0xa2ba('0x29')):[];if(_0x3b52b7[_0xa2ba('0xe')]('tag')){if(_0x3b52b7['tag']&&_0x3b52b7[_0xa2ba('0x2c')]!=='--'){_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7[_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x2d')+_0x3b52b7[_0xa2ba('0x2c')],'context':_0x3b52b7[_0xa2ba('0x13')],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});}}if(_0x3b52b7[_0xa2ba('0x11')]===_0xa2ba('0x18')&&_0x3b52b7['hasOwnProperty']('callerID')){if(_0x3b52b7[_0xa2ba('0x2e')]){_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':'ExecIf','appdata':_0xa2ba('0x2f')+_0x3b52b7[_0xa2ba('0x2e')]+')','context':_0x3b52b7[_0xa2ba('0x13')],'exten':_0x3b52b7['exten'],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7['VoiceExtensionId']});}else{_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':_0xa2ba('0x1e'),'appdata':_0xa2ba('0x30'),'context':_0x3b52b7['context'],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323['priority']+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});}}if(_0x3b52b7[_0xa2ba('0xe')](_0xa2ba('0x31'))){if(_0x1b4a77[_0xa2ba('0x32')](_0x3b52b7[_0xa2ba('0x33')]['toLowerCase']())>=0x0&&_0x3b52b7[_0xa2ba('0x34')]!==_0xa2ba('0x35')){if(_0x3b52b7[_0xa2ba('0x31')]){_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':_0xa2ba('0x1e'),'appdata':_0xa2ba('0x36'),'context':_0x3b52b7['context'],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x37'),'context':_0x3b52b7['context'],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});}else{_0x11ea26['push']({'type':_0x3b52b7[_0xa2ba('0x11')],'app':_0xa2ba('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3b52b7[_0xa2ba('0x13')],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7['VoiceExtensionId']});_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':'Set','appdata':_0xa2ba('0x38'),'context':_0x3b52b7[_0xa2ba('0x13')],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});}}}for(var _0x4f4c6f=0x0;_0x4f4c6f<_0x5b6976[_0xa2ba('0x27')];_0x4f4c6f+=0x1){var _0x3f6426=_0x4a9323[_0xa2ba('0xf')]+_0x5b6976['length'];var _0x14c4a=_0x4f4c6f===_0x5b6976[_0xa2ba('0x27')]-0x1?_0x4a9323['priority']+_0x11ea26[_0xa2ba('0x27')]+_0x2489d8[_0xa2ba('0x27')]+0x2:_0x4a9323[_0xa2ba('0xf')]+_0x4f4c6f+0x1;_0x11ea26[_0xa2ba('0x39')](_0x4f4c6f,0x0,{'type':_0x3b52b7[_0xa2ba('0x11')],'app':_0xa2ba('0x3a'),'appdata':_0x5b6976[_0x4f4c6f]+'?'+_0x3b52b7[_0xa2ba('0x13')]+_0xa2ba('0x3b')+_0x3f6426+':'+_0x3b52b7['context']+_0xa2ba('0x3b')+_0x14c4a,'exten':_0x3b52b7[_0xa2ba('0x9')],'context':_0x3b52b7[_0xa2ba('0x13')],'priority':_0x4a9323[_0xa2ba('0xf')]+_0x4f4c6f,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']});}_0x3b52b7['priority']=_0x11ea26[_0xa2ba('0x27')]?_['last'](_0x11ea26)[_0xa2ba('0xf')]+0x1:_0x4a9323['priority'];_0x4a9323['priority']=(_0x2489d8['length']?_[_0xa2ba('0x3c')](_0x2489d8)['priority']:_0x3b52b7[_0xa2ba('0xf')])+0x1;_0x4a9323[_0xa2ba('0x19')]=_['concat'](_0x4a9323[_0xa2ba('0x19')],_0x11ea26,[_0x3b52b7],_0x2489d8);}_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x3d'),'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'priority':_0x4a9323['priority'],'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});_0x5ba820[_0xa2ba('0x1a')](_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']);_0x50588d=_['concat'](_0x50588d,_0x4a9323[_0xa2ba('0x19')]);}}return _0xcaff50[_0xa2ba('0x3e')](function(_0x3dd868){return _0xcaff50[_0xa2ba('0x1')]['VoiceExtension'][_0xa2ba('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x5ba820}},'transaction':_0x3dd868})[_0xa2ba('0x4')](function(_0x35fb57){return _0xcaff50['models']['VoiceExtension'][_0xa2ba('0x40')](_[_0xa2ba('0x41')](_0x50588d,_0xa2ba('0xf')),{'transaction':_0x3dd868});});});})['catch'](function(_0x4cf0be){console['error'](_0x4cf0be);});}exports[_0xa2ba('0x42')]=rewrite;
\ No newline at end of file
index 8c45094..9cb90f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc10d=['into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','field','NOW()','toString','updatedAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','from','str','select','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','outbound','dialCheckDuplicateType','CmList','Lists','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','VoiceQueue','findAll','Campaign','always','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','undefined','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','insert'];(function(_0x7f5487,_0x4e2b21){var _0x517e4f=function(_0x376a25){while(--_0x376a25){_0x7f5487['push'](_0x7f5487['shift']());}};_0x517e4f(++_0x4e2b21);}(_0xc10d,0x115));var _0xdc10=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xc10d[_0x34021d];return _0x16597b;};'use strict';var BPromise=require(_0xdc10('0x0'));var util=require('util');var _=require(_0xdc10('0x1'));var fs=require('fs');var squel=require(_0xdc10('0x2'));var Papa=require(_0xdc10('0x3'));var Redis=require(_0xdc10('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xdc10('0x5'));var logger=require(_0xdc10('0x6'))(_0xdc10('0x7'));config[_0xdc10('0x8')]=_[_0xdc10('0x9')](config['redis'],{'host':_0xdc10('0xa'),'port':0x18eb});var socket=require(_0xdc10('0xb'))(new Redis(config[_0xdc10('0x8')]));require(_0xdc10('0xc'))['register'](socket);try{if(!process[_0xdc10('0xd')][0x2]||process['argv'][0x2]==='undefined'||process[_0xdc10('0xd')][0x2]===_0xdc10('0xe')){throw new Error(_0xdc10('0xf'));}var FILEPATH=process[_0xdc10('0xd')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]==='undefined'||process[_0xdc10('0xd')][0x3]===_0xdc10('0xe')||!process[_0xdc10('0xd')][0x4]||process[_0xdc10('0xd')][0x4]==='undefined'||process[_0xdc10('0xd')][0x4]===_0xdc10('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xdc10('0x10')](process[_0xdc10('0xd')][0x3][_0xdc10('0x11')](','),process[_0xdc10('0xd')][0x4][_0xdc10('0x11')](','));if(!process[_0xdc10('0xd')][0x5]||process[_0xdc10('0xd')][0x5]==='undefined'||process[_0xdc10('0xd')][0x5]===_0xdc10('0xe')){throw new Error(_0xdc10('0x12'));}var LISTID=process[_0xdc10('0xd')][0x5];var COMPANYID=process[_0xdc10('0xd')][0x6]&&process[_0xdc10('0xd')][0x6]!=='undefined'&&process[_0xdc10('0xd')][0x6]!==_0xdc10('0xe')?process[_0xdc10('0xd')][0x6]:null;var DUPLICATES=process[_0xdc10('0xd')][0x7]&&process[_0xdc10('0xd')][0x7]!==_0xdc10('0x13')&&process[_0xdc10('0xd')][0x7]!==_0xdc10('0xe')?process[_0xdc10('0xd')][0x7]:null;if(!process[_0xdc10('0xd')][0x8]||process[_0xdc10('0xd')][0x8]===_0xdc10('0x13')||process[_0xdc10('0xd')][0x8]===_0xdc10('0xe')){throw new Error(_0xdc10('0x14'));}var SOCKET_TIMESTAMP=process[_0xdc10('0xd')][0x8];}catch(_0x1a2210){logger[_0xdc10('0x15')](_0x1a2210);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(_0x2a9f69,_0xcae27c,_0x56d0b4,_0x5edb59){var _0x41bcd5={'message':_0xcae27c};_0x41bcd5[_0x2a9f69]=!![];if(_0x56d0b4){_0x41bcd5[_0xdc10('0x16')]=_0x56d0b4;}if(_0x5edb59){_0x41bcd5[_0xdc10('0x17')]=_0x5edb59;}return _0x41bcd5;}function isEmail(_0x117ffa){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x117ffa);}function checkRow(_0x12c517,_0x49ef4f,_0x31a57e){return new BPromise(function(_0x4377da,_0x303889){if(_[_0xdc10('0x18')](_0x12c517)){return _0x303889(handleCheckRowError(_0xdc10('0x15'),_0xdc10('0x19'),null,_0x31a57e));}if(_0x12c517[_0xdc10('0x1a')]&&_0x12c517[_0xdc10('0x1a')][_0xdc10('0x1b')]){var _0x5e15ce=_['map'](_0x12c517[_0xdc10('0x1a')],'message')[_0xdc10('0x1c')](';');return _0x303889(handleCheckRowError(_0xdc10('0x15'),_0x5e15ce,null,_0x31a57e));}var _0x7fa4b3={};for(var _0x5f8b1 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5f8b1)&&FIELDS[_0x5f8b1]){_0x7fa4b3[_0x5f8b1]=_0x12c517[_0xdc10('0x1d')][0x0][FIELDS[_0x5f8b1]]||_0x12c517['data'][0x0]['\ufeff'+FIELDS[_0x5f8b1]];}}if(!_0x7fa4b3[_0xdc10('0x1e')]){return _0x303889(handleCheckRowError(_0xdc10('0x15'),_0xdc10('0x1f'),null,_0x31a57e));}if(!_0x7fa4b3[_0xdc10('0x20')]){return _0x303889(handleCheckRowError('error',_0xdc10('0x21'),null,_0x31a57e));}if(_0x7fa4b3[_0xdc10('0x22')]){var _0x3f428c=moment(_0x7fa4b3['birthDate'],_0xdc10('0x23'));if(!_0x3f428c[_0xdc10('0x24')]()){return _0x303889(handleCheckRowError(_0xdc10('0x15'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x31a57e));}}if(_0x7fa4b3['email']){if(!isEmail(_0x7fa4b3[_0xdc10('0x25')])){return _0x303889(handleCheckRowError(_0xdc10('0x15'),_0xdc10('0x26'),null,_0x31a57e));}}_0x7fa4b3[_0xdc10('0x27')]=LISTID;_0x7fa4b3['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xdc10('0x1b')]&&_0x49ef4f){var _0x9ea229={};for(var _0x2e4ebf=0x0,_0x1af5b3=DUPLICATES['length'];_0x2e4ebf<_0x1af5b3;_0x2e4ebf+=0x1){_0x9ea229[DUPLICATES[_0x2e4ebf]]=_0x7fa4b3[DUPLICATES[_0x2e4ebf]];}var _0x5e9ce2=_[_0xdc10('0x28')](_0x49ef4f,_0x9ea229);if(_0x5e9ce2){return _0x303889(handleCheckRowError(_0xdc10('0x29'),_0xdc10('0x2a'),_0x5e9ce2,_0x31a57e));}}return db[_0xdc10('0x2b')]['create'](_0x7fa4b3,{'raw':!![],'hooks':![],'fields':_[_0xdc10('0x2c')](_0x7fa4b3)})[_0xdc10('0x2d')](function(_0x4cdd5e){if(DUPLICATES&&DUPLICATES[_0xdc10('0x1b')]&&_0x49ef4f){_0x49ef4f['push'](_[_0xdc10('0x2e')](_0x7fa4b3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4cdd5e['id'];return _0x4377da();})[_0xdc10('0x2f')](function(_0xec0846){return _0x303889(handleCheckRowError(_0xdc10('0x15'),_0xdc10('0x30')+(_0xec0846[_0xdc10('0x31')]||JSON[_0xdc10('0x32')](_0xec0846)),null,_0x31a57e));});});}function checkHopper(){function _0x21aa42(){return function(_0x3d2c27){logger[_0xdc10('0x15')](_0xdc10('0x33'),'checkHopper',util['inspect'](_0x3d2c27,{'showHidden':![],'depth':null}));};}var _0x18975f=function(_0x1f679b,_0x3f2275){var _0x1b5dc2=squel[_0xdc10('0x34')]()[_0xdc10('0x35')](_0xdc10('0x36'))[_0xdc10('0x37')](['phone',_0xdc10('0x38'),_0xdc10('0x39'),_0xdc10('0x27'),_0x3f2275,_0xdc10('0x3a'),'updatedAt'],squel['select']()[_0xdc10('0x3b')]('phone',_0xdc10('0x20'))[_0xdc10('0x3b')](_0xdc10('0x3c'),_0xdc10('0x38'))[_0xdc10('0x3b')]('id','ContactId')[_0xdc10('0x3b')](LISTID[_0xdc10('0x3d')](),'ListId')[_0xdc10('0x3b')](_0x1f679b['id'][_0xdc10('0x3d')](),_0x3f2275)[_0xdc10('0x3b')]('NOW()',_0xdc10('0x3a'))[_0xdc10('0x3b')]('NOW()',_0xdc10('0x3e'))['from'](_0xdc10('0x3f'))[_0xdc10('0x40')](_0xdc10('0x41'))[_0xdc10('0x40')](_0xdc10('0x42'),LISTID[_0xdc10('0x3d')]())[_0xdc10('0x40')](_0xdc10('0x43'))['where'](_0xdc10('0x44'),squel['select']()[_0xdc10('0x3b')](_0xdc10('0x20'))['from'](_0xdc10('0x36'))['where'](_0x3f2275+_0xdc10('0x45'),_0x1f679b['id'][_0xdc10('0x3d')]())))[_0xdc10('0x3d')]();return _0x1b5dc2;};var _0x3c67b8=function(_0xd44a10,_0x292427){var _0x47904c=squel[_0xdc10('0x34')]()['into'](_0xdc10('0x36'))[_0xdc10('0x37')]([_0xdc10('0x20'),_0xdc10('0x38'),_0xdc10('0x39'),'ListId',_0x292427,'createdAt','updatedAt'],squel['select']()[_0xdc10('0x3b')](_0xdc10('0x20'),'phone')[_0xdc10('0x3b')]('NOW()',_0xdc10('0x38'))['field']('id','ContactId')['field'](LISTID[_0xdc10('0x3d')](),_0xdc10('0x27'))[_0xdc10('0x3b')](_0xd44a10['id'][_0xdc10('0x3d')](),_0x292427)[_0xdc10('0x3b')](_0xdc10('0x3c'),_0xdc10('0x3a'))['field'](_0xdc10('0x3c'),_0xdc10('0x3e'))[_0xdc10('0x46')](_0xdc10('0x3f'))[_0xdc10('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0xdc10('0x42'),LISTID[_0xdc10('0x3d')]())[_0xdc10('0x40')]('id\x20IN\x20?',squel[_0xdc10('0x47')](hopperContacts))[_0xdc10('0x40')](_0xdc10('0x43'))[_0xdc10('0x40')](_0xdc10('0x44'),squel[_0xdc10('0x48')]()[_0xdc10('0x3b')](_0xdc10('0x49'))['from'](_0xdc10('0x4a'))['where'](_0x292427+_0xdc10('0x45'),_0xd44a10['id'][_0xdc10('0x3d')]()))['where'](_0xdc10('0x44'),squel[_0xdc10('0x48')]()[_0xdc10('0x3b')]('phone')[_0xdc10('0x46')]('cm_hopper')[_0xdc10('0x40')](_0x292427+_0xdc10('0x45'),_0xd44a10['id'][_0xdc10('0x3d')]())))['toString']();return _0x47904c;};function _0x41ea51(_0x87c9ae,_0x1fc8b0){var _0x101e4e=squel[_0xdc10('0x34')]()[_0xdc10('0x35')](_0xdc10('0x36'))[_0xdc10('0x37')]([_0xdc10('0x20'),_0xdc10('0x38'),_0xdc10('0x39'),'ListId',_0x1fc8b0,_0xdc10('0x3a'),_0xdc10('0x3e')],squel[_0xdc10('0x48')]()[_0xdc10('0x3b')](_0xdc10('0x20'),_0xdc10('0x20'))[_0xdc10('0x3b')]('NOW()',_0xdc10('0x38'))['field']('id',_0xdc10('0x39'))[_0xdc10('0x3b')](LISTID[_0xdc10('0x3d')](),_0xdc10('0x27'))[_0xdc10('0x3b')](_0x87c9ae['id'][_0xdc10('0x3d')](),_0x1fc8b0)[_0xdc10('0x3b')]('NOW()',_0xdc10('0x3a'))['field'](_0xdc10('0x3c'),_0xdc10('0x3e'))['from'](_0xdc10('0x3f'))['where']('deletedAt\x20IS\x20NULL')[_0xdc10('0x40')](_0xdc10('0x42'),LISTID['toString']())[_0xdc10('0x40')](_0xdc10('0x4b'),squel[_0xdc10('0x47')](hopperContacts))[_0xdc10('0x40')](_0xdc10('0x43')))[_0xdc10('0x3d')]();return _0x101e4e;}function _0x384f0a(_0x4c7ca0,_0x21fb9a){var _0x20421d=squel[_0xdc10('0x34')]()[_0xdc10('0x35')](_0xdc10('0x4c'))[_0xdc10('0x37')](['phone',_0xdc10('0x39'),_0xdc10('0x27'),_0x21fb9a,_0xdc10('0x3a'),_0xdc10('0x3e')],squel[_0xdc10('0x48')]()[_0xdc10('0x3b')](_0xdc10('0x20'),'phone')[_0xdc10('0x3b')]('id',_0xdc10('0x39'))[_0xdc10('0x3b')](LISTID['toString'](),_0xdc10('0x27'))[_0xdc10('0x3b')](_0x4c7ca0['id'][_0xdc10('0x3d')](),_0x21fb9a)[_0xdc10('0x3b')]('NOW()',_0xdc10('0x3a'))[_0xdc10('0x3b')](_0xdc10('0x3c'),_0xdc10('0x3e'))[_0xdc10('0x46')](_0xdc10('0x3f'))[_0xdc10('0x40')]('deletedAt\x20IS\x20NULL')[_0xdc10('0x40')]('ListId\x20=\x20?',LISTID[_0xdc10('0x3d')]())[_0xdc10('0x40')](_0xdc10('0x4b'),squel['str'](hopperContacts))['where'](_0xdc10('0x43')))[_0xdc10('0x3d')]();return _0x20421d;}return db['VoiceQueue']['findAll']({'where':{'type':_0xdc10('0x4d')},'attributes':['id',_0xdc10('0x4e')],'include':[{'model':db[_0xdc10('0x4f')],'as':_0xdc10('0x50'),'where':{'id':LISTID}}]})[_0xdc10('0x2d')](function(_0x21ef93){var _0x1a5848=[];if(_0x21ef93){var _0x14adfd;for(var _0x128f67=0x0,_0x41cddf;_0x128f67<_0x21ef93[_0xdc10('0x1b')];_0x128f67+=0x1){_0x41cddf=_0x21ef93[_0x128f67][_0xdc10('0x51')]({'plain':!![]});switch(_0x41cddf[_0xdc10('0x4e')]){case'always':_0x1a5848[_0xdc10('0x52')](db[_0xdc10('0x53')][_0xdc10('0x54')](_0x3c67b8(_0x41cddf,_0xdc10('0x55')))['then'](function(){})[_0xdc10('0x2f')](_0x21aa42()));break;case _0xdc10('0x56'):_0x1a5848[_0xdc10('0x52')](db[_0xdc10('0x53')][_0xdc10('0x54')](_0x18975f(_0x41cddf,_0xdc10('0x55')))['then'](function(){})[_0xdc10('0x2f')](_0x21aa42()));break;default:_0x1a5848['push'](db[_0xdc10('0x53')][_0xdc10('0x54')](_0x41ea51(_0x41cddf,_0xdc10('0x55')))[_0xdc10('0x2d')](function(){})[_0xdc10('0x2f')](_0x21aa42()));}}}return _0x1a5848;})[_0xdc10('0x57')]()['then'](function(){return db[_0xdc10('0x58')][_0xdc10('0x59')]({'where':{'type':_0xdc10('0x4d')},'attributes':['id'],'include':[{'model':db[_0xdc10('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xdc10('0x2d')](function(_0x1413ae){var _0x36ec99=[];if(_0x1413ae){var _0xd721a8;for(var _0x2944cc=0x0,_0x30942c;_0x2944cc<_0x1413ae['length'];_0x2944cc+=0x1){_0x30942c=_0x1413ae[_0x2944cc][_0xdc10('0x51')]({'plain':!![]});_0x36ec99[_0xdc10('0x52')](db[_0xdc10('0x53')][_0xdc10('0x54')](_0x384f0a(_0x30942c,_0xdc10('0x55')))[_0xdc10('0x2d')](function(){})[_0xdc10('0x2f')](_0x21aa42()));}}return _0x36ec99;})[_0xdc10('0x57')]();})[_0xdc10('0x2d')](function(){return db[_0xdc10('0x5a')][_0xdc10('0x59')]({'attributes':['id',_0xdc10('0x4e')],'include':[{'model':db[_0xdc10('0x4f')],'as':_0xdc10('0x50'),'where':{'id':LISTID}}]})[_0xdc10('0x2d')](function(_0x8bcc33){var _0x440854=[];if(_0x8bcc33){for(var _0x3e0177=0x0,_0x63a7ed;_0x3e0177<_0x8bcc33['length'];_0x3e0177+=0x1){_0x63a7ed=_0x8bcc33[_0x3e0177][_0xdc10('0x51')]({'plain':!![]});switch(_0x63a7ed[_0xdc10('0x4e')]){case _0xdc10('0x5b'):_0x440854[_0xdc10('0x52')](db[_0xdc10('0x53')][_0xdc10('0x54')](_0x3c67b8(_0x63a7ed,'CampaignId'))['then'](function(){})['catch'](_0x21aa42()));break;case _0xdc10('0x56'):_0x440854[_0xdc10('0x52')](db[_0xdc10('0x53')][_0xdc10('0x54')](_0x18975f(_0x63a7ed,'CampaignId'))[_0xdc10('0x2d')](function(){})[_0xdc10('0x2f')](_0x21aa42()));break;default:_0x440854['push'](db[_0xdc10('0x53')][_0xdc10('0x54')](_0x41ea51(_0x63a7ed,_0xdc10('0x5c')))[_0xdc10('0x2d')](function(){})[_0xdc10('0x2f')](_0x21aa42()));}}}return _0x440854;})[_0xdc10('0x57')]();})[_0xdc10('0x2d')](function(){return db['Campaign'][_0xdc10('0x59')]({'attributes':['id'],'include':[{'model':db[_0xdc10('0x4f')],'as':_0xdc10('0x5d'),'where':{'id':LISTID}}]})[_0xdc10('0x2d')](function(_0x4931f0){var _0x16c957=[];if(_0x4931f0){for(var _0x16254f=0x0,_0x2e4372;_0x16254f<_0x4931f0['length'];_0x16254f+=0x1){_0x2e4372=_0x4931f0[_0x16254f][_0xdc10('0x51')]({'plain':!![]});_0x16c957[_0xdc10('0x52')](db[_0xdc10('0x53')][_0xdc10('0x54')](_0x384f0a(_0x2e4372,_0xdc10('0x5c')))[_0xdc10('0x2d')](function(){})[_0xdc10('0x2f')](_0x21aa42()));}}return _0x16c957;})[_0xdc10('0x57')]();})[_0xdc10('0x2f')](function(_0x4700fd){logger[_0xdc10('0x15')](_0xdc10('0x5e'),'generalCheckHopper',_0x4700fd[_0xdc10('0x31')]);});}var processPromises=function(_0x2582cd){return BPromise['all'](promises)[_0xdc10('0x2d')](function(_0x4eda4f){})[_0xdc10('0x2f')](function(_0x1d284b){logger[_0xdc10('0x15')](_0xdc10('0x5f'),JSON['stringify'](_0x1d284b));})[_0xdc10('0x60')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2582cd){return _0x2582cd['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0xdc10('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xdc10('0x2d')](function(){socket[_0xdc10('0x61')](_0xdc10('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xdc10('0x63')](FILEPATH);}catch(_0x54fc5c){logger[_0xdc10('0x15')](_0xdc10('0x64'),JSON[_0xdc10('0x32')](_0x54fc5c));}finally{process[_0xdc10('0x65')](0x0);}});};process['on']('SIGINT',function(){logger[_0xdc10('0x66')](_0xdc10('0x67'));endCsv();});function main(){return BPromise[_0xdc10('0x68')]()[_0xdc10('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xdc10('0x59')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1567f4){var _0x249283=fs[_0xdc10('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xdc10('0x6a')](_0x249283,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5003f8,_0x4f80fe){total+=0x1;var _0x530b2e=total;promises[_0xdc10('0x52')](checkRow(_0x5003f8,_0x1567f4,_0x530b2e)[_0xdc10('0x2d')](function(){success+=0x1;})[_0xdc10('0x2f')](function(_0xe97678){if(_0xe97678[_0xdc10('0x15')]){errors+=0x1;delete _0xe97678[_0xdc10('0x15')];}else if(_0xe97678[_0xdc10('0x29')]){duplicates+=0x1;delete _0xe97678[_0xdc10('0x29')];}rows[_0xdc10('0x52')](_0xe97678);}));if(total%0xc8===0x0){_0x4f80fe['pause']();return processPromises(_0x4f80fe);}},'complete':function(){return processPromises()['then'](function(){logger[_0xdc10('0x66')](_0xdc10('0x6b'));endCsv();});},'error':function(_0xfba6ba,_0x3d0d0c){logger['info'](_0xdc10('0x6c'),JSON[_0xdc10('0x32')](_0xfba6ba));endCsv();}});})['catch'](function(_0x56a815){logger[_0xdc10('0x15')](_0xdc10('0x6d'),JSON[_0xdc10('0x32')](_0x56a815));});}main();
\ No newline at end of file
+var _0xd4f0=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','select','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black','str','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','catch','all','BlackLists','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','finally','contact:csv_','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','hasOwnProperty','firstName','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','message','stringify','cmContact','checkHopper','inspect','insert'];(function(_0x37ef63,_0x52d21b){var _0x410a2e=function(_0x5cc1f4){while(--_0x5cc1f4){_0x37ef63['push'](_0x37ef63['shift']());}};_0x410a2e(++_0x52d21b);}(_0xd4f0,0xa0));var _0x0d4f=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xd4f0[_0x330414];return _0x99dbff;};'use strict';var BPromise=require(_0x0d4f('0x0'));var util=require('util');var _=require(_0x0d4f('0x1'));var fs=require('fs');var squel=require(_0x0d4f('0x2'));var Papa=require('papaparse');var Redis=require(_0x0d4f('0x3'));var db=require(_0x0d4f('0x4'))['db'];var config=require(_0x0d4f('0x5'));var logger=require(_0x0d4f('0x6'))(_0x0d4f('0x7'));config[_0x0d4f('0x8')]=_[_0x0d4f('0x9')](config[_0x0d4f('0x8')],{'host':_0x0d4f('0xa'),'port':0x18eb});var socket=require(_0x0d4f('0xb'))(new Redis(config[_0x0d4f('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0x0d4f('0xc')](socket);try{if(!process[_0x0d4f('0xd')][0x2]||process[_0x0d4f('0xd')][0x2]==='undefined'||process[_0x0d4f('0xd')][0x2]===_0x0d4f('0xe')){throw new Error(_0x0d4f('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0x0d4f('0xd')][0x3]||process[_0x0d4f('0xd')][0x3]===_0x0d4f('0x10')||process[_0x0d4f('0xd')][0x3]===_0x0d4f('0xe')||!process[_0x0d4f('0xd')][0x4]||process[_0x0d4f('0xd')][0x4]===_0x0d4f('0x10')||process[_0x0d4f('0xd')][0x4]===_0x0d4f('0xe')){throw new Error(_0x0d4f('0x11'));}var FIELDS=_['zipObject'](process[_0x0d4f('0xd')][0x3]['split'](','),process['argv'][0x4][_0x0d4f('0x12')](','));if(!process['argv'][0x5]||process[_0x0d4f('0xd')][0x5]===_0x0d4f('0x10')||process[_0x0d4f('0xd')][0x5]==='null'){throw new Error(_0x0d4f('0x13'));}var LISTID=process[_0x0d4f('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0d4f('0xd')][0x6]!==_0x0d4f('0x10')&&process['argv'][0x6]!==_0x0d4f('0xe')?process[_0x0d4f('0xd')][0x6]:null;var DUPLICATES=process[_0x0d4f('0xd')][0x7]&&process[_0x0d4f('0xd')][0x7]!=='undefined'&&process[_0x0d4f('0xd')][0x7]!==_0x0d4f('0xe')?process[_0x0d4f('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x0d4f('0xd')][0x8]===_0x0d4f('0x10')||process[_0x0d4f('0xd')][0x8]===_0x0d4f('0xe')){throw new Error(_0x0d4f('0x14'));}var SOCKET_TIMESTAMP=process[_0x0d4f('0xd')][0x8];}catch(_0x37c7a4){logger[_0x0d4f('0x15')](_0x37c7a4);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(_0x25da9f,_0x515af5,_0x55f9b5,_0x1f5f9c){var _0x2575d2={'message':_0x515af5};_0x2575d2[_0x25da9f]=!![];if(_0x55f9b5){_0x2575d2[_0x0d4f('0x16')]=_0x55f9b5;}if(_0x1f5f9c){_0x2575d2[_0x0d4f('0x17')]=_0x1f5f9c;}return _0x2575d2;}function isEmail(_0x40aa8c){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))*$/[_0x0d4f('0x18')](_0x40aa8c);}function checkRow(_0x3b487f,_0x4e22af,_0x156e05){return new BPromise(function(_0x1d97c4,_0x15579c){if(_[_0x0d4f('0x19')](_0x3b487f)){return _0x15579c(handleCheckRowError('error',_0x0d4f('0x1a'),null,_0x156e05));}if(_0x3b487f['errors']&&_0x3b487f[_0x0d4f('0x1b')][_0x0d4f('0x1c')]){var _0x1c40d6=_['map'](_0x3b487f['errors'],'message')[_0x0d4f('0x1d')](';');return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),_0x1c40d6,null,_0x156e05));}var _0x55e4eb={};for(var _0x245bbd in FIELDS){if(FIELDS[_0x0d4f('0x1e')](_0x245bbd)&&FIELDS[_0x245bbd]){_0x55e4eb[_0x245bbd]=_0x3b487f['data'][0x0][FIELDS[_0x245bbd]]||_0x3b487f['data'][0x0]['\ufeff'+FIELDS[_0x245bbd]];}}if(!_0x55e4eb[_0x0d4f('0x1f')]){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),'firstName\x20not\x20specified!',null,_0x156e05));}if(!_0x55e4eb['phone']){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),_0x0d4f('0x20'),null,_0x156e05));}if(_0x55e4eb[_0x0d4f('0x21')]){var _0x7d4d38=moment(_0x55e4eb['birthDate'],'YYYY-MM-DD');if(!_0x7d4d38['isValid']()){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),_0x0d4f('0x22'),null,_0x156e05));}}if(_0x55e4eb[_0x0d4f('0x23')]){if(!isEmail(_0x55e4eb['email'])){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x156e05));}}_0x55e4eb['ListId']=LISTID;_0x55e4eb[_0x0d4f('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d4f('0x1c')]&&_0x4e22af){var _0x358c93={};for(var _0x51d624=0x0,_0x256b0e=DUPLICATES[_0x0d4f('0x1c')];_0x51d624<_0x256b0e;_0x51d624+=0x1){_0x358c93[DUPLICATES[_0x51d624]]=_0x55e4eb[DUPLICATES[_0x51d624]];}var _0x5d6002=_[_0x0d4f('0x25')](_0x4e22af,_0x358c93);if(_0x5d6002){return _0x15579c(handleCheckRowError(_0x0d4f('0x26'),_0x0d4f('0x27'),_0x5d6002,_0x156e05));}}return db[_0x0d4f('0x28')][_0x0d4f('0x29')](_0x55e4eb,{'raw':!![],'hooks':![],'fields':_['keys'](_0x55e4eb)})[_0x0d4f('0x2a')](function(_0x7ba4f6){if(DUPLICATES&&DUPLICATES[_0x0d4f('0x1c')]&&_0x4e22af){_0x4e22af[_0x0d4f('0x2b')](_['pick'](_0x55e4eb,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x7ba4f6['id'];return _0x1d97c4();})['catch'](function(_0x3822c7){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x3822c7[_0x0d4f('0x2c')]||JSON[_0x0d4f('0x2d')](_0x3822c7)),null,_0x156e05));});});}function checkHopper(){function _0x5582e7(){return function(_0x1e15e5){logger[_0x0d4f('0x15')](_0x0d4f('0x2e'),_0x0d4f('0x2f'),util[_0x0d4f('0x30')](_0x1e15e5,{'showHidden':![],'depth':null}));};}var _0x311cd2=function(_0xac522,_0xbdbb98){var _0x26eba8=squel[_0x0d4f('0x31')]()[_0x0d4f('0x32')](_0x0d4f('0x33'))[_0x0d4f('0x34')]([_0x0d4f('0x35'),_0x0d4f('0x36'),_0x0d4f('0x37'),_0x0d4f('0x38'),_0xbdbb98,_0x0d4f('0x39'),_0x0d4f('0x3a')],squel['select']()[_0x0d4f('0x3b')](_0x0d4f('0x35'),_0x0d4f('0x35'))[_0x0d4f('0x3b')]('NOW()',_0x0d4f('0x36'))['field']('id','ContactId')[_0x0d4f('0x3b')](LISTID['toString'](),_0x0d4f('0x38'))[_0x0d4f('0x3b')](_0xac522['id']['toString'](),_0xbdbb98)[_0x0d4f('0x3b')]('NOW()','createdAt')[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x3a'))[_0x0d4f('0x3d')](_0x0d4f('0x3e'))[_0x0d4f('0x3f')](_0x0d4f('0x40'))[_0x0d4f('0x3f')]('ListId\x20=\x20?',LISTID[_0x0d4f('0x41')]())[_0x0d4f('0x3f')](_0x0d4f('0x42'))[_0x0d4f('0x3f')](_0x0d4f('0x43'),squel['select']()[_0x0d4f('0x3b')](_0x0d4f('0x35'))['from'](_0x0d4f('0x33'))[_0x0d4f('0x3f')](_0xbdbb98+_0x0d4f('0x44'),_0xac522['id'][_0x0d4f('0x41')]())))[_0x0d4f('0x41')]();return _0x26eba8;};var _0x153471=function(_0x71d853,_0x727311){var _0x55a300=squel[_0x0d4f('0x31')]()[_0x0d4f('0x32')]('cm_hopper')[_0x0d4f('0x34')](['phone','scheduledAt',_0x0d4f('0x37'),'ListId',_0x727311,_0x0d4f('0x39'),'updatedAt'],squel[_0x0d4f('0x45')]()[_0x0d4f('0x3b')](_0x0d4f('0x35'),_0x0d4f('0x35'))[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x36'))[_0x0d4f('0x3b')]('id',_0x0d4f('0x37'))[_0x0d4f('0x3b')](LISTID[_0x0d4f('0x41')](),_0x0d4f('0x38'))[_0x0d4f('0x3b')](_0x71d853['id'][_0x0d4f('0x41')](),_0x727311)[_0x0d4f('0x3b')]('NOW()',_0x0d4f('0x39'))[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x3a'))[_0x0d4f('0x3d')](_0x0d4f('0x3e'))[_0x0d4f('0x3f')](_0x0d4f('0x40'))[_0x0d4f('0x3f')](_0x0d4f('0x46'),LISTID[_0x0d4f('0x41')]())[_0x0d4f('0x3f')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x0d4f('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x0d4f('0x43'),squel[_0x0d4f('0x45')]()[_0x0d4f('0x3b')]('calleridnum')['from']('cm_hopper_final')['where'](_0x727311+_0x0d4f('0x44'),_0x71d853['id']['toString']()))[_0x0d4f('0x3f')](_0x0d4f('0x43'),squel['select']()['field'](_0x0d4f('0x35'))[_0x0d4f('0x3d')](_0x0d4f('0x33'))['where'](_0x727311+_0x0d4f('0x44'),_0x71d853['id'][_0x0d4f('0x41')]())))[_0x0d4f('0x41')]();return _0x55a300;};function _0x3f75be(_0x5a0f25,_0x3ca778){var _0x5e34f6=squel[_0x0d4f('0x31')]()[_0x0d4f('0x32')](_0x0d4f('0x33'))[_0x0d4f('0x34')]([_0x0d4f('0x35'),_0x0d4f('0x36'),'ContactId','ListId',_0x3ca778,_0x0d4f('0x39'),_0x0d4f('0x3a')],squel[_0x0d4f('0x45')]()[_0x0d4f('0x3b')](_0x0d4f('0x35'),_0x0d4f('0x35'))[_0x0d4f('0x3b')]('NOW()',_0x0d4f('0x36'))['field']('id','ContactId')[_0x0d4f('0x3b')](LISTID[_0x0d4f('0x41')](),'ListId')['field'](_0x5a0f25['id'][_0x0d4f('0x41')](),_0x3ca778)[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x39'))[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x3a'))[_0x0d4f('0x3d')]('cm_contacts')[_0x0d4f('0x3f')]('deletedAt\x20IS\x20NULL')[_0x0d4f('0x3f')]('ListId\x20=\x20?',LISTID[_0x0d4f('0x41')]())[_0x0d4f('0x3f')](_0x0d4f('0x47'),squel['str'](hopperContacts))[_0x0d4f('0x3f')](_0x0d4f('0x42')))[_0x0d4f('0x41')]();return _0x5e34f6;}function _0x4224dc(_0x4f2c7b,_0x255c93){var _0x2109c2=squel['insert']()[_0x0d4f('0x32')](_0x0d4f('0x48'))[_0x0d4f('0x34')]([_0x0d4f('0x35'),_0x0d4f('0x37'),_0x0d4f('0x38'),_0x255c93,_0x0d4f('0x39'),'updatedAt'],squel[_0x0d4f('0x45')]()[_0x0d4f('0x3b')](_0x0d4f('0x35'),_0x0d4f('0x35'))[_0x0d4f('0x3b')]('id',_0x0d4f('0x37'))[_0x0d4f('0x3b')](LISTID[_0x0d4f('0x41')](),_0x0d4f('0x38'))[_0x0d4f('0x3b')](_0x4f2c7b['id']['toString'](),_0x255c93)['field']('NOW()',_0x0d4f('0x39'))[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x3a'))[_0x0d4f('0x3d')](_0x0d4f('0x3e'))[_0x0d4f('0x3f')](_0x0d4f('0x40'))['where'](_0x0d4f('0x46'),LISTID['toString']())[_0x0d4f('0x3f')]('id\x20IN\x20?',squel[_0x0d4f('0x49')](hopperContacts))[_0x0d4f('0x3f')](_0x0d4f('0x42')))[_0x0d4f('0x41')]();return _0x2109c2;}return db[_0x0d4f('0x4a')][_0x0d4f('0x4b')]({'where':{'type':_0x0d4f('0x4c')},'attributes':['id',_0x0d4f('0x4d')],'include':[{'model':db[_0x0d4f('0x4e')],'as':_0x0d4f('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x2991e1){var _0x4534c0=[];if(_0x2991e1){var _0x1d77d9;for(var _0x111fbb=0x0,_0x1ccf76;_0x111fbb<_0x2991e1['length'];_0x111fbb+=0x1){_0x1ccf76=_0x2991e1[_0x111fbb][_0x0d4f('0x50')]({'plain':!![]});switch(_0x1ccf76['dialCheckDuplicateType']){case _0x0d4f('0x51'):_0x4534c0[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x153471(_0x1ccf76,_0x0d4f('0x54')))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));break;case'onlyIfOpen':_0x4534c0['push'](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x311cd2(_0x1ccf76,_0x0d4f('0x54')))['then'](function(){})[_0x0d4f('0x55')](_0x5582e7()));break;default:_0x4534c0[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x3f75be(_0x1ccf76,_0x0d4f('0x54')))['then'](function(){})[_0x0d4f('0x55')](_0x5582e7()));}}}return _0x4534c0;})[_0x0d4f('0x56')]()[_0x0d4f('0x2a')](function(){return db[_0x0d4f('0x4a')][_0x0d4f('0x4b')]({'where':{'type':_0x0d4f('0x4c')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0d4f('0x57'),'where':{'id':LISTID}}]})[_0x0d4f('0x2a')](function(_0x2c4ca1){var _0xf5cbd3=[];if(_0x2c4ca1){var _0x132ef7;for(var _0x4cad6e=0x0,_0x695522;_0x4cad6e<_0x2c4ca1[_0x0d4f('0x1c')];_0x4cad6e+=0x1){_0x695522=_0x2c4ca1[_0x4cad6e]['get']({'plain':!![]});_0xf5cbd3[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x4224dc(_0x695522,_0x0d4f('0x54')))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));}}return _0xf5cbd3;})['all']();})['then'](function(){return db[_0x0d4f('0x58')][_0x0d4f('0x4b')]({'attributes':['id',_0x0d4f('0x4d')],'include':[{'model':db[_0x0d4f('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x0d4f('0x2a')](function(_0x194cd8){var _0x5f4ae4=[];if(_0x194cd8){for(var _0x4435bc=0x0,_0x509fbc;_0x4435bc<_0x194cd8['length'];_0x4435bc+=0x1){_0x509fbc=_0x194cd8[_0x4435bc][_0x0d4f('0x50')]({'plain':!![]});switch(_0x509fbc[_0x0d4f('0x4d')]){case _0x0d4f('0x51'):_0x5f4ae4[_0x0d4f('0x2b')](db[_0x0d4f('0x52')]['query'](_0x153471(_0x509fbc,_0x0d4f('0x59')))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));break;case _0x0d4f('0x5a'):_0x5f4ae4[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x311cd2(_0x509fbc,'CampaignId'))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));break;default:_0x5f4ae4['push'](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x3f75be(_0x509fbc,'CampaignId'))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));}}}return _0x5f4ae4;})['all']();})[_0x0d4f('0x2a')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x0d4f('0x4e')],'as':_0x0d4f('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x3e122b){var _0x251f57=[];if(_0x3e122b){for(var _0x3f0c45=0x0,_0x168b94;_0x3f0c45<_0x3e122b['length'];_0x3f0c45+=0x1){_0x168b94=_0x3e122b[_0x3f0c45][_0x0d4f('0x50')]({'plain':!![]});_0x251f57[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x4224dc(_0x168b94,'CampaignId'))['then'](function(){})[_0x0d4f('0x55')](_0x5582e7()));}}return _0x251f57;})[_0x0d4f('0x56')]();})[_0x0d4f('0x55')](function(_0x207014){logger[_0x0d4f('0x15')](_0x0d4f('0x5b'),'generalCheckHopper',_0x207014[_0x0d4f('0x2c')]);});}var processPromises=function(_0x26f33c){return BPromise[_0x0d4f('0x56')](promises)['then'](function(_0x15c343){})[_0x0d4f('0x55')](function(_0x2ab181){logger[_0x0d4f('0x15')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x2ab181));})[_0x0d4f('0x5c')](function(){socket['emit'](_0x0d4f('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x26f33c){return _0x26f33c['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x0d4f('0x5e')](_0x0d4f('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0d4f('0x5f')](FILEPATH);}catch(_0x2c6121){logger[_0x0d4f('0x15')](_0x0d4f('0x60'),JSON[_0x0d4f('0x2d')](_0x2c6121));}finally{process[_0x0d4f('0x61')](0x0);}});};process['on'](_0x0d4f('0x62'),function(){logger[_0x0d4f('0x63')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x0d4f('0x64')]()[_0x0d4f('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0d4f('0x12')](',');return db[_0x0d4f('0x28')][_0x0d4f('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x44f39a){var _0x30e893=fs[_0x0d4f('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d4f('0x66')](_0x30e893,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4b2a24,_0x2bd718){total+=0x1;var _0x2914da=total;promises[_0x0d4f('0x2b')](checkRow(_0x4b2a24,_0x44f39a,_0x2914da)[_0x0d4f('0x2a')](function(){success+=0x1;})['catch'](function(_0x21e82e){if(_0x21e82e['error']){errors+=0x1;delete _0x21e82e[_0x0d4f('0x15')];}else if(_0x21e82e[_0x0d4f('0x26')]){duplicates+=0x1;delete _0x21e82e[_0x0d4f('0x26')];}rows[_0x0d4f('0x2b')](_0x21e82e);}));if(total%0xc8===0x0){_0x2bd718['pause']();return processPromises(_0x2bd718);}},'complete':function(){return processPromises()[_0x0d4f('0x2a')](function(){logger[_0x0d4f('0x63')](_0x0d4f('0x67'));endCsv();});},'error':function(_0x2ab247,_0x2ab648){logger[_0x0d4f('0x63')](_0x0d4f('0x68'),JSON[_0x0d4f('0x2d')](_0x2ab247));endCsv();}});})[_0x0d4f('0x55')](function(_0x3adfde){logger[_0x0d4f('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0d4f('0x2d')](_0x3adfde));});}main();
\ No newline at end of file
index fda1db4..409e38b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf754=['campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','defaults','localhost','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','fromQuery','phone','ContactId','createdAt','updatedAt','priority','UserId','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_hopper','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','cm_hopper_black','ListId','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId','fields',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','exit','push','code','message','sequelize','query','spread','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','rows','errors','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','emit','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xf754,0x125));var _0x4f75=function(_0x32484f,_0x1e86df){_0x32484f=_0x32484f-0x0;var _0x6d7828=_0xf754[_0x32484f];return _0x6d7828;};'use strict';var fs=require('fs');var path=require(_0x4f75('0x0'));var _=require(_0x4f75('0x1'));var Papa=require(_0x4f75('0x2'));var util=require(_0x4f75('0x3'));var BPromise=require(_0x4f75('0x4'));var moment=require(_0x4f75('0x5'));var squel=require(_0x4f75('0x6'));var Redis=require(_0x4f75('0x7'));var db=require(_0x4f75('0x8'))['db'];var config=require(_0x4f75('0x9'));var logger=require('../../../config/logger')('import');config['redis']=_[_0x4f75('0xa')](config['redis'],{'host':_0x4f75('0xb'),'port':0x18eb});var socket=require(_0x4f75('0xc'))(new Redis(config[_0x4f75('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x4f75('0xe')](_0x4f75('0xf'));function isEmail(_0x5a75ae){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))*$/[_0x4f75('0x10')](_0x5a75ae);}function selectNotIn(_0x58e497,_0xd77aad,_0x264910,_0x5c4add,_0xc4be3){return squel[_0x4f75('0x11')]()[_0x4f75('0x12')]('phone')['from'](_0x5c4add)[_0x4f75('0x13')](_0xd77aad,null,_0xd77aad+_0x4f75('0x14')+_0x5c4add+'.'+_0x264910)[_0x4f75('0x15')](_0x5c4add+'.'+_0x264910+'\x20=\x20'+_0x58e497+'.'+_0x264910)[_0x4f75('0x15')](_0xd77aad+_0x4f75('0x16')+_0xc4be3[_0x4f75('0x13')]()+')');}function insertCmHopper(_0x284613,_0xbee423,_0x3b3108,_0x48ecbe,_0x52f35d){var _0xb7e626=[_0x4f75('0x17'),'cm_contacts.scheduledat',_0x4f75('0x18'),_0x4f75('0x19'),_0xbee423+'.'+_0x48ecbe,'cm_contacts.createdAt',_0x4f75('0x1a'),'cm_contacts.priority',_0x4f75('0x1b'),'\x22'+_0x52f35d+'\x22'];return squel[_0x4f75('0x1c')]()[_0x4f75('0x1d')]('cm_hopper')[_0x4f75('0x1e')]([_0x4f75('0x1f'),'scheduledat',_0x4f75('0x20'),'ListId',_0x48ecbe,_0x4f75('0x21'),_0x4f75('0x22'),_0x4f75('0x23'),_0x4f75('0x24'),'recallme'],squel['select']()['fields'](_0xb7e626)[_0x4f75('0x25')](_0xbee423)[_0x4f75('0x13')](_0x4f75('0x26'),null,_0x4f75('0x27')+_0xbee423+_0x4f75('0x28'))[_0x4f75('0x13')](_0x3b3108,null,_0x3b3108+_0x4f75('0x14')+_0xbee423+'.'+_0x48ecbe)['where'](_0xbee423+_0x4f75('0x29'),_0x284613)[_0x4f75('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xbee423,_0x3b3108,_0x48ecbe,_0x4f75('0x2a'),['\x22always\x22',_0x4f75('0x2b')]))['where'](_0x4f75('0x2c'),selectNotIn(_0xbee423,_0x3b3108,_0x48ecbe,_0x4f75('0x2a'),['\x22always\x22'])))[_0x4f75('0x2d')]();}function insertCmHopperBlack(_0xa8685c,_0x1c1a43,_0x129233,_0x42039d){var _0x4d2ad9=[_0x4f75('0x17'),_0x4f75('0x18'),_0x4f75('0x19'),_0x1c1a43+'.'+_0x42039d,_0x4f75('0x2e'),'cm_contacts.updatedAt'];return squel[_0x4f75('0x1c')]()[_0x4f75('0x1d')](_0x4f75('0x2f'))[_0x4f75('0x1e')]([_0x4f75('0x1f'),_0x4f75('0x20'),_0x4f75('0x30'),_0x42039d,_0x4f75('0x21'),_0x4f75('0x22')],squel['select']()['fields'](_0x4d2ad9)[_0x4f75('0x25')](_0x1c1a43)['join'](_0x4f75('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x1c1a43+_0x4f75('0x28'))[_0x4f75('0x13')](_0x129233,null,_0x129233+_0x4f75('0x14')+_0x1c1a43+'.'+_0x42039d)[_0x4f75('0x15')](_0x1c1a43+_0x4f75('0x29'),_0xa8685c)[_0x4f75('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x4f75('0x2c'),squel['select']()[_0x4f75('0x12')](_0x4f75('0x1f'))[_0x4f75('0x25')](_0x4f75('0x2f'))[_0x4f75('0x15')](_0x4f75('0x31'),_0xa8685c)[_0x4f75('0x15')](_0x42039d+_0x4f75('0x32'),_0x1c1a43+'.'+_0x42039d)))[_0x4f75('0x2d')]();}function insertCmContact(_0xf0b442,_0x528c64,_0x26c4aa,_0x49f705){var _0x1bf2b0=_['concat'](_[_0x4f75('0x33')](_0x49f705),['ListId',_0x4f75('0x34'),_0x4f75('0x21'),_0x4f75('0x22')]);return squel[_0x4f75('0x1c')]()[_0x4f75('0x1d')](_0x4f75('0x26'))[_0x4f75('0x1e')](_0x1bf2b0,squel[_0x4f75('0x11')]()[_0x4f75('0x35')](_0x1bf2b0)['from'](_0x528c64)[_0x4f75('0x15')]('('+_0x26c4aa['join'](',')+_0x4f75('0x36'),squel[_0x4f75('0x11')]()[_0x4f75('0x35')](_0x26c4aa)[_0x4f75('0x25')](_0x4f75('0x26'))[_0x4f75('0x15')](_0x4f75('0x31'),_0xf0b442)[_0x4f75('0x15')](_0x4f75('0x37')))[_0x4f75('0x15')](_0x4f75('0x38'),squel[_0x4f75('0x11')]()[_0x4f75('0x12')](_0x4f75('0x39'),_0x4f75('0x3a'))[_0x4f75('0x25')](_0x528c64)['group'](_0x26c4aa[_0x4f75('0x13')](','))))[_0x4f75('0x2d')]();}function handleStop(){logger[_0x4f75('0x3b')](_0x4f75('0x3c'));stopped=!![];}function handleUncaughtException(_0x46fa8f){logger[_0x4f75('0x3d')](_0x46fa8f['message']);process[_0x4f75('0x3e')](0x1);}function handleError(_0x471b67,_0xa76f58){stats['errors'][_0x4f75('0x3f')]({'name':_0xa76f58[_0x4f75('0x40')],'message':_0xa76f58[_0x4f75('0x41')],'row':_0x471b67});}function handleQuery(_0x28163c){logger[_0x4f75('0x3b')](_0x28163c);return db[_0x4f75('0x42')][_0x4f75('0x43')](_0x28163c)[_0x4f75('0x44')](function(_0x47cd3d){results[_0x4f75('0x3f')](_0x47cd3d);})['catch'](function(_0x43149b){logger[_0x4f75('0x3d')](_0x43149b[_0x4f75('0x41')]);});}function main(_0x330ac5,_0x280920,_0x29320c,_0x305e5f){logger['info'](_0x4f75('0x45'),_0x330ac5,JSON[_0x4f75('0x46')](_0x280920));process[_0x4f75('0x47')](_0x4f75('0x48'));var _0x39d523=_0x280920[_0x4f75('0x49')];var _0x344566=_0x280920[_0x4f75('0x4a')];var _0x4bdd98=path['join'](config['root'],_0x4f75('0x4b'),_0x344566+'.csv');var _0x3dfc05=_[_0x4f75('0x33')](_0x39d523)['join']();logger['info'](_0x4f75('0x4c'),_0x3dfc05);fs[_0x4f75('0x4d')](_0x4bdd98,_0x3dfc05+'\x0a');Papa[_0x4f75('0x4e')](fs[_0x4f75('0x4f')](_0x330ac5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2fd272,_0x45ded5){try{for(var _0x5e3b3c=0x0,_0x1c215d=[];_0x5e3b3c<_0x2fd272[_0x4f75('0x50')][_0x4f75('0x51')];_0x5e3b3c++){stats[_0x4f75('0x52')]+=0x1;if(_0x2fd272['errors'][_0x5e3b3c]){handleError(_0x2fd272['data'][_0x5e3b3c],_0x2fd272[_0x4f75('0x53')][_0x5e3b3c]);}else{var _0x55dd03=[];for(var _0x2fcbaf in _0x39d523){if(_0x39d523[_0x4f75('0x54')](_0x2fcbaf)){if(_0x2fd272[_0x4f75('0x50')][_0x5e3b3c][_0x39d523[_0x2fcbaf]]){var _0x4ce385=_[_0x4f75('0x55')](_0x2fd272[_0x4f75('0x50')][_0x5e3b3c][_0x39d523[_0x2fcbaf]][_0x4f75('0x56')](/"/g,'\x27'));switch(_0x2fcbaf){case _0x4f75('0x57'):var _0x2378e1=moment(_0x4ce385,_0x4f75('0xf'),!![]);if(_0x2378e1[_0x4f75('0x58')]()){_0x1c215d[_0x4f75('0x3f')]('\x22'+_0x4ce385+'\x22');}else{_0x55dd03['push'](_0x4f75('0x59'));}break;case _0x4f75('0x23'):var _0x2b6531=parseInt(_0x4ce385);_0x4ce385=_[_0x4f75('0x5a')](_0x2b6531)||_0x2b6531<0x0||_0x2b6531>0x4?_0x305e5f?0x3:0x2:_0x2b6531;_0x1c215d[_0x4f75('0x3f')]('\x22'+_0x4ce385+'\x22');break;case _0x4f75('0x24'):var _0x4b7cba=parseInt(_0x4ce385);if(_[_0x4f75('0x5b')](_0x4b7cba)&&_[_0x4f75('0x5c')](_0x29320c,_0x4b7cba)){_0x1c215d[_0x4f75('0x3f')]('\x22'+_0x4b7cba+'\x22');}else{_0x55dd03[_0x4f75('0x3f')](_0x4f75('0x5d'));}break;case _0x4f75('0x5e'):if(isEmail(_0x4ce385)){_0x1c215d[_0x4f75('0x3f')]('\x22'+_0x4ce385+'\x22');}else{_0x55dd03[_0x4f75('0x3f')](_0x4f75('0x5f'));}break;case _0x4f75('0x60'):var _0x3aabfa=moment(_0x4ce385,_0x4f75('0x61'),!![]);if(_0x3aabfa[_0x4f75('0x58')]()){_0x1c215d[_0x4f75('0x3f')]('\x22'+_0x4ce385+'\x22');}else{_0x55dd03[_0x4f75('0x3f')](_0x4f75('0x62'));}break;default:_0x1c215d[_0x4f75('0x3f')]('\x22'+_0x4ce385+'\x22');}}else{switch(_0x2fcbaf){case'firstName':case'phone':_0x55dd03[_0x4f75('0x3f')](_0x2fcbaf+'\x20not\x20specified');break;default:_0x1c215d[_0x4f75('0x3f')]('\x22\x22');}}}}if(_0x55dd03[_0x4f75('0x51')]){handleError(_0x2fd272[_0x4f75('0x50')][_0x5e3b3c],{'code':_0x4f75('0x63'),'message':_0x55dd03[_0x4f75('0x13')]()});}else{fs['appendFileSync'](_0x4bdd98,_0x1c215d[_0x4f75('0x13')]()+'\x0a');}_0x1c215d=[];}if(!(stats['rows']%0xc8)){socket[_0x4f75('0x64')]('contact:import:'+_0x344566,stats);stats['errors']=[];}}if(stopped){logger[_0x4f75('0x3b')](_0x4f75('0x65'));_0x45ded5[_0x4f75('0x66')]();}}catch(_0x1f685a){handleError(_0x2fd272[_0x4f75('0x50')][_0x5e3b3c],{'code':_0x4f75('0x67'),'message':_0x1f685a['message']});logger[_0x4f75('0x3d')](_0x4f75('0x68'),_0x1f685a[_0x4f75('0x41')]);}},'complete':function(){try{var _0x42c051=[];var _0x4b1887='cm_contacts';if(_0x280920['duplicates']&&_0x280920[_0x4f75('0x69')]['length']){_0x4b1887='cm_contacts_'+_0x344566;_0x42c051['push'](_0x4f75('0x6a')+_0x4b1887+_0x4f75('0x6b'));}var _0x5b9d75=util['format'](_0x4f75('0x6c'),_0x4bdd98,_0x4b1887,_0x3dfc05,_0x280920[_0x4f75('0x30')],_0x280920[_0x4f75('0x34')]||null,NOW,NOW);if(_[_0x4f75('0x6d')](_0x39d523['scheduledat'])){_0x5b9d75+=_0x4f75('0x6e');}_0x42c051[_0x4f75('0x3f')](_0x5b9d75);if(_0x280920[_0x4f75('0x69')]&&_0x280920[_0x4f75('0x69')][_0x4f75('0x51')]){_0x42c051[_0x4f75('0x3f')](insertCmContact(_0x280920[_0x4f75('0x30')],_0x4b1887,_0x280920[_0x4f75('0x69')],_0x39d523));_0x42c051[_0x4f75('0x3f')](_0x4f75('0x6f')+_0x4b1887+';');}_0x42c051[_0x4f75('0x3f')](insertCmHopper(_0x280920[_0x4f75('0x30')],_0x4f75('0x70'),_0x4f75('0x71'),_0x4f75('0x72'),_0x305e5f));_0x42c051[_0x4f75('0x3f')](insertCmHopperBlack(_0x280920[_0x4f75('0x30')],'voice_queues_has_cm_blacklists',_0x4f75('0x71'),_0x4f75('0x72')));_0x42c051[_0x4f75('0x3f')](insertCmHopper(_0x280920[_0x4f75('0x30')],_0x4f75('0x73'),_0x4f75('0x74'),'CampaignId',_0x305e5f));_0x42c051[_0x4f75('0x3f')](insertCmHopperBlack(_0x280920[_0x4f75('0x30')],_0x4f75('0x75'),_0x4f75('0x74'),_0x4f75('0x76')));BPromise['each'](_0x42c051,handleQuery)[_0x4f75('0x77')](function(_0x50eef1){stats[_0x4f75('0x78')]=!![];stats[_0x4f75('0x79')]=_0x280920['duplicates']&&_0x280920[_0x4f75('0x69')][_0x4f75('0x51')]?results[0x2][_0x4f75('0x79')]:results[0x0]['affectedRows'];socket['emit'](_0x4f75('0x7a')+_0x344566,stats);fs[_0x4f75('0x7b')](_0x330ac5);fs['unlink'](_0x4bdd98);process[_0x4f75('0x3e')](0x0);})['catch'](function(_0x3c5ff5){logger[_0x4f75('0x3d')](_0x3c5ff5['message']);process['exit'](0x1);});}catch(_0x29b868){logger['error'](_0x4f75('0x7c'),_0x29b868[_0x4f75('0x41')]);process[_0x4f75('0x3e')](0x1);}},'error':function(_0x4c227d,_0xdf65c2,_0x5cb7d4,_0x4ca455){throw new Error(_0x4ca455);}});}function validate(){if(process['argv']&&process[_0x4f75('0x7d')]['length']<0x4){throw new Error(_0x4f75('0x7e'));}var _0x2dc3c7=path[_0x4f75('0x13')](config[_0x4f75('0x7f')],'server/files/tmp',process['argv'][0x2]);if(!fs['existsSync'](_0x2dc3c7)){throw new Error(_0x4f75('0x80'));}var _0x3b1767={};try{_0x3b1767=JSON[_0x4f75('0x4e')](process[_0x4f75('0x7d')][0x3]);if(!_0x3b1767[_0x4f75('0x49')]){throw new Error(_0x4f75('0x81'));}if(!_0x3b1767[_0x4f75('0x49')][_0x4f75('0x1f')]){throw new Error(_0x4f75('0x82'));}if(!_0x3b1767[_0x4f75('0x49')][_0x4f75('0x83')]){throw new Error('firstName\x20is\x20mandatory');}var _0xc58883=0x0;if(_0x3b1767[_0x4f75('0x49')][_0x4f75('0x24')]){_0xc58883=0x1;}if(!_0x3b1767[_0x4f75('0x30')]){throw new Error(_0x4f75('0x84'));}}catch(_0xdc286c){throw new Error(_0x4f75('0x85'));}var _0x798b5b=[];try{_0x798b5b=_[_0x4f75('0x86')](JSON['parse'](process[_0x4f75('0x7d')][0x4]),'id');}catch(_0x12ffdc){logger['info'](_0x4f75('0x87'));}main(_0x2dc3c7,_0x3b1767,_0x798b5b,_0xc58883);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x9fd4=['campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','defaults','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ContactId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','insert','cm_hopper_black','updatedAt','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','toString','ListId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','query','spread','catch','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CompanyId',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_blacklists','VoiceQueueId'];(function(_0x42e4d7,_0x4bd202){var _0x346cd8=function(_0x36c0f6){while(--_0x36c0f6){_0x42e4d7['push'](_0x42e4d7['shift']());}};_0x346cd8(++_0x4bd202);}(_0x9fd4,0x125));var _0x49fd=function(_0x2377e3,_0x2c0352){_0x2377e3=_0x2377e3-0x0;var _0x2a6d1b=_0x9fd4[_0x2377e3];return _0x2a6d1b;};'use strict';var fs=require('fs');var path=require(_0x49fd('0x0'));var _=require(_0x49fd('0x1'));var Papa=require(_0x49fd('0x2'));var util=require('util');var BPromise=require(_0x49fd('0x3'));var moment=require(_0x49fd('0x4'));var squel=require(_0x49fd('0x5'));var Redis=require(_0x49fd('0x6'));var db=require(_0x49fd('0x7'))['db'];var config=require(_0x49fd('0x8'));var logger=require('../../../config/logger')(_0x49fd('0x9'));config['redis']=_[_0x49fd('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x49fd('0xb'))(new Redis(config[_0x49fd('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x49fd('0xd')](_0x49fd('0xe'));function isEmail(_0x59fdd2){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))*$/[_0x49fd('0xf')](_0x59fdd2);}function selectNotIn(_0x192d1e,_0x1c30ee,_0x944f6,_0x4b4b6b,_0x1c33d2){return squel[_0x49fd('0x10')]()[_0x49fd('0x11')](_0x49fd('0x12'))[_0x49fd('0x13')](_0x4b4b6b)['join'](_0x1c30ee,null,_0x1c30ee+_0x49fd('0x14')+_0x4b4b6b+'.'+_0x944f6)[_0x49fd('0x15')](_0x4b4b6b+'.'+_0x944f6+_0x49fd('0x16')+_0x192d1e+'.'+_0x944f6)[_0x49fd('0x15')](_0x1c30ee+_0x49fd('0x17')+_0x1c33d2[_0x49fd('0x18')]()+')');}function insertCmHopper(_0x24cd67,_0x363b7d,_0x2bbc9d,_0x1d232a,_0x1e107d){var _0x226be7=['cm_contacts.phone',_0x49fd('0x19'),'cm_contacts.id',_0x49fd('0x1a'),_0x363b7d+'.'+_0x1d232a,'cm_contacts.createdAt',_0x49fd('0x1b'),_0x49fd('0x1c'),_0x49fd('0x1d'),'\x22'+_0x1e107d+'\x22'];return squel['insert']()[_0x49fd('0x1e')]('cm_hopper')[_0x49fd('0x1f')]([_0x49fd('0x12'),_0x49fd('0x20'),_0x49fd('0x21'),'ListId',_0x1d232a,_0x49fd('0x22'),'updatedAt',_0x49fd('0x23'),_0x49fd('0x24'),_0x49fd('0x25')],squel[_0x49fd('0x10')]()[_0x49fd('0x26')](_0x226be7)[_0x49fd('0x13')](_0x363b7d)[_0x49fd('0x18')](_0x49fd('0x27'),null,_0x49fd('0x28')+_0x363b7d+_0x49fd('0x29'))[_0x49fd('0x18')](_0x2bbc9d,null,_0x2bbc9d+_0x49fd('0x14')+_0x363b7d+'.'+_0x1d232a)['where'](_0x363b7d+_0x49fd('0x2a'),_0x24cd67)[_0x49fd('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x49fd('0x15')](_0x49fd('0x2b'),selectNotIn(_0x363b7d,_0x2bbc9d,_0x1d232a,_0x49fd('0x2c'),[_0x49fd('0x2d'),_0x49fd('0x2e')]))['where'](_0x49fd('0x2b'),selectNotIn(_0x363b7d,_0x2bbc9d,_0x1d232a,_0x49fd('0x2c'),[_0x49fd('0x2d')])))['toString']();}function insertCmHopperBlack(_0x4be0fb,_0x225ed3,_0x3fccfe,_0x2c697f){var _0x2da240=[_0x49fd('0x2f'),_0x49fd('0x30'),_0x49fd('0x1a'),_0x225ed3+'.'+_0x2c697f,_0x49fd('0x31'),_0x49fd('0x1b')];return squel[_0x49fd('0x32')]()[_0x49fd('0x1e')](_0x49fd('0x33'))[_0x49fd('0x1f')]([_0x49fd('0x12'),_0x49fd('0x21'),'ListId',_0x2c697f,'createdAt',_0x49fd('0x34')],squel[_0x49fd('0x10')]()[_0x49fd('0x26')](_0x2da240)[_0x49fd('0x13')](_0x225ed3)[_0x49fd('0x18')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x225ed3+_0x49fd('0x29'))[_0x49fd('0x18')](_0x3fccfe,null,_0x3fccfe+_0x49fd('0x14')+_0x225ed3+'.'+_0x2c697f)[_0x49fd('0x15')](_0x225ed3+_0x49fd('0x2a'),_0x4be0fb)[_0x49fd('0x15')](_0x49fd('0x35'),NOW)[_0x49fd('0x15')](_0x49fd('0x2b'),squel['select']()['field'](_0x49fd('0x12'))[_0x49fd('0x13')](_0x49fd('0x33'))[_0x49fd('0x15')]('ListId\x20=\x20?',_0x4be0fb)[_0x49fd('0x15')](_0x2c697f+_0x49fd('0x36'),_0x225ed3+'.'+_0x2c697f)))[_0x49fd('0x37')]();}function insertCmContact(_0x487d1f,_0x481c91,_0x1babec,_0x1e3d4b){var _0x5a2778=_['concat'](_['keys'](_0x1e3d4b),[_0x49fd('0x38'),'CompanyId',_0x49fd('0x22'),_0x49fd('0x34')]);return squel['insert']()[_0x49fd('0x1e')](_0x49fd('0x27'))['fromQuery'](_0x5a2778,squel[_0x49fd('0x10')]()[_0x49fd('0x26')](_0x5a2778)['from'](_0x481c91)[_0x49fd('0x15')]('('+_0x1babec['join'](',')+_0x49fd('0x39'),squel[_0x49fd('0x10')]()[_0x49fd('0x26')](_0x1babec)[_0x49fd('0x13')](_0x49fd('0x27'))[_0x49fd('0x15')](_0x49fd('0x3a'),_0x487d1f)[_0x49fd('0x15')](_0x49fd('0x3b')))['where'](_0x49fd('0x3c'),squel['select']()[_0x49fd('0x11')](_0x49fd('0x3d'),_0x49fd('0x3e'))[_0x49fd('0x13')](_0x481c91)[_0x49fd('0x3f')](_0x1babec['join'](','))))[_0x49fd('0x37')]();}function handleStop(){logger[_0x49fd('0x40')](_0x49fd('0x41'));stopped=!![];}function handleUncaughtException(_0x57f2d4){logger[_0x49fd('0x42')](_0x57f2d4[_0x49fd('0x43')]);process[_0x49fd('0x44')](0x1);}function handleError(_0x5434b8,_0x3fe595){stats[_0x49fd('0x45')][_0x49fd('0x46')]({'name':_0x3fe595['code'],'message':_0x3fe595[_0x49fd('0x43')],'row':_0x5434b8});}function handleQuery(_0x31cea5){logger[_0x49fd('0x40')](_0x31cea5);return db['sequelize'][_0x49fd('0x47')](_0x31cea5)[_0x49fd('0x48')](function(_0x35b0c7){results['push'](_0x35b0c7);})[_0x49fd('0x49')](function(_0x290e15){logger[_0x49fd('0x42')](_0x290e15[_0x49fd('0x43')]);});}function main(_0xb25b74,_0x22fc37,_0x18cbd8,_0x102920){logger[_0x49fd('0x40')](_0x49fd('0x4a'),_0xb25b74,JSON[_0x49fd('0x4b')](_0x22fc37));process['send'](_0x49fd('0x4c'));var _0x5b5b5f=_0x22fc37[_0x49fd('0x4d')];var _0x2c33af=_0x22fc37[_0x49fd('0x4e')];var _0x2e0da6=path[_0x49fd('0x18')](config[_0x49fd('0x4f')],_0x49fd('0x50'),_0x2c33af+'.csv');var _0x1f1f18=_['keys'](_0x5b5b5f)[_0x49fd('0x18')]();logger[_0x49fd('0x40')](_0x49fd('0x51'),_0x1f1f18);fs[_0x49fd('0x52')](_0x2e0da6,_0x1f1f18+'\x0a');Papa['parse'](fs[_0x49fd('0x53')](_0xb25b74),{'header':!![],'skipEmptyLines':!![],'step':function(_0x52b5ec,_0x583b67){try{for(var _0x345134=0x0,_0x571fcf=[];_0x345134<_0x52b5ec[_0x49fd('0x54')][_0x49fd('0x55')];_0x345134++){stats[_0x49fd('0x56')]+=0x1;if(_0x52b5ec[_0x49fd('0x45')][_0x345134]){handleError(_0x52b5ec[_0x49fd('0x54')][_0x345134],_0x52b5ec[_0x49fd('0x45')][_0x345134]);}else{var _0x16b598=[];for(var _0x13ac3f in _0x5b5b5f){if(_0x5b5b5f[_0x49fd('0x57')](_0x13ac3f)){if(_0x52b5ec[_0x49fd('0x54')][_0x345134][_0x5b5b5f[_0x13ac3f]]){var _0x2e01d4=_['trim'](_0x52b5ec[_0x49fd('0x54')][_0x345134][_0x5b5b5f[_0x13ac3f]][_0x49fd('0x58')](/"/g,'\x27'));switch(_0x13ac3f){case _0x49fd('0x20'):var _0x3bda91=moment(_0x2e01d4,_0x49fd('0xe'),!![]);if(_0x3bda91[_0x49fd('0x59')]()){_0x571fcf[_0x49fd('0x46')]('\x22'+_0x2e01d4+'\x22');}else{_0x16b598['push'](_0x49fd('0x5a'));}break;case _0x49fd('0x23'):var _0x1211fc=parseInt(_0x2e01d4);_0x2e01d4=_[_0x49fd('0x5b')](_0x1211fc)||_0x1211fc<0x0||_0x1211fc>0x4?_0x102920?0x3:0x2:_0x1211fc;_0x571fcf['push']('\x22'+_0x2e01d4+'\x22');break;case _0x49fd('0x24'):var _0x451298=parseInt(_0x2e01d4);if(_[_0x49fd('0x5c')](_0x451298)&&_['includes'](_0x18cbd8,_0x451298)){_0x571fcf[_0x49fd('0x46')]('\x22'+_0x451298+'\x22');}else{_0x16b598[_0x49fd('0x46')](_0x49fd('0x5d'));}break;case'email':if(isEmail(_0x2e01d4)){_0x571fcf[_0x49fd('0x46')]('\x22'+_0x2e01d4+'\x22');}else{_0x16b598[_0x49fd('0x46')](_0x49fd('0x5e'));}break;case _0x49fd('0x5f'):var _0x509774=moment(_0x2e01d4,_0x49fd('0x60'),!![]);if(_0x509774['isValid']()){_0x571fcf['push']('\x22'+_0x2e01d4+'\x22');}else{_0x16b598[_0x49fd('0x46')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x571fcf[_0x49fd('0x46')]('\x22'+_0x2e01d4+'\x22');}}else{switch(_0x13ac3f){case _0x49fd('0x61'):case'phone':_0x16b598[_0x49fd('0x46')](_0x13ac3f+_0x49fd('0x62'));break;default:_0x571fcf[_0x49fd('0x46')]('\x22\x22');}}}}if(_0x16b598[_0x49fd('0x55')]){handleError(_0x52b5ec['data'][_0x345134],{'code':_0x49fd('0x63'),'message':_0x16b598[_0x49fd('0x18')]()});}else{fs[_0x49fd('0x64')](_0x2e0da6,_0x571fcf[_0x49fd('0x18')]()+'\x0a');}_0x571fcf=[];}if(!(stats['rows']%0xc8)){socket[_0x49fd('0x65')]('contact:import:'+_0x2c33af,stats);stats[_0x49fd('0x45')]=[];}}if(stopped){logger[_0x49fd('0x40')]('Abort\x20parser');_0x583b67['abort']();}}catch(_0x5e8fbf){handleError(_0x52b5ec['data'][_0x345134],{'code':_0x49fd('0x66'),'message':_0x5e8fbf[_0x49fd('0x43')]});logger[_0x49fd('0x42')](_0x49fd('0x67'),_0x5e8fbf[_0x49fd('0x43')]);}},'complete':function(){try{var _0x431758=[];var _0x15ddc4=_0x49fd('0x27');if(_0x22fc37[_0x49fd('0x68')]&&_0x22fc37[_0x49fd('0x68')]['length']){_0x15ddc4=_0x49fd('0x69')+_0x2c33af;_0x431758['push'](_0x49fd('0x6a')+_0x15ddc4+_0x49fd('0x6b'));}var _0x2afbc3=util[_0x49fd('0xd')]('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',_0x2e0da6,_0x15ddc4,_0x1f1f18,_0x22fc37[_0x49fd('0x38')],_0x22fc37[_0x49fd('0x6c')]||null,NOW,NOW);if(_['isNil'](_0x5b5b5f[_0x49fd('0x20')])){_0x2afbc3+=_0x49fd('0x6d');}_0x431758['push'](_0x2afbc3);if(_0x22fc37[_0x49fd('0x68')]&&_0x22fc37['duplicates'][_0x49fd('0x55')]){_0x431758[_0x49fd('0x46')](insertCmContact(_0x22fc37['ListId'],_0x15ddc4,_0x22fc37['duplicates'],_0x5b5b5f));_0x431758['push']('DROP\x20TABLE\x20'+_0x15ddc4+';');}_0x431758[_0x49fd('0x46')](insertCmHopper(_0x22fc37['ListId'],'voice_queues_has_cm_lists','voice_queues','VoiceQueueId',_0x102920));_0x431758['push'](insertCmHopperBlack(_0x22fc37[_0x49fd('0x38')],_0x49fd('0x6e'),'voice_queues',_0x49fd('0x6f')));_0x431758[_0x49fd('0x46')](insertCmHopper(_0x22fc37[_0x49fd('0x38')],_0x49fd('0x70'),_0x49fd('0x71'),_0x49fd('0x72'),_0x102920));_0x431758[_0x49fd('0x46')](insertCmHopperBlack(_0x22fc37['ListId'],_0x49fd('0x73'),'campaigns',_0x49fd('0x72')));BPromise[_0x49fd('0x74')](_0x431758,handleQuery)[_0x49fd('0x75')](function(_0x5d6f42){stats[_0x49fd('0x76')]=!![];stats[_0x49fd('0x77')]=_0x22fc37[_0x49fd('0x68')]&&_0x22fc37[_0x49fd('0x68')][_0x49fd('0x55')]?results[0x2][_0x49fd('0x77')]:results[0x0][_0x49fd('0x77')];socket['emit'](_0x49fd('0x78')+_0x2c33af,stats);fs[_0x49fd('0x79')](_0xb25b74);fs[_0x49fd('0x79')](_0x2e0da6);process[_0x49fd('0x44')](0x0);})[_0x49fd('0x49')](function(_0x3a4b2a){logger[_0x49fd('0x42')](_0x3a4b2a['message']);process[_0x49fd('0x44')](0x1);});}catch(_0x5cb11f){logger[_0x49fd('0x42')](_0x49fd('0x7a'),_0x5cb11f[_0x49fd('0x43')]);process[_0x49fd('0x44')](0x1);}},'error':function(_0x4d3178,_0x3341a1,_0x40380d,_0x280d25){throw new Error(_0x280d25);}});}function validate(){if(process['argv']&&process[_0x49fd('0x7b')][_0x49fd('0x55')]<0x4){throw new Error(_0x49fd('0x7c'));}var _0x4ac7dd=path[_0x49fd('0x18')](config[_0x49fd('0x4f')],'server/files/tmp',process[_0x49fd('0x7b')][0x2]);if(!fs[_0x49fd('0x7d')](_0x4ac7dd)){throw new Error(_0x49fd('0x7e'));}var _0x456c01={};try{_0x456c01=JSON['parse'](process[_0x49fd('0x7b')][0x3]);if(!_0x456c01[_0x49fd('0x4d')]){throw new Error(_0x49fd('0x7f'));}if(!_0x456c01[_0x49fd('0x4d')][_0x49fd('0x12')]){throw new Error(_0x49fd('0x80'));}if(!_0x456c01[_0x49fd('0x4d')][_0x49fd('0x61')]){throw new Error('firstName\x20is\x20mandatory');}var _0x497f9b=0x0;if(_0x456c01[_0x49fd('0x4d')]['UserId']){_0x497f9b=0x1;}if(!_0x456c01[_0x49fd('0x38')]){throw new Error(_0x49fd('0x81'));}}catch(_0x55bf78){throw new Error(_0x49fd('0x82'));}var _0x8f5a67=[];try{_0x8f5a67=_[_0x49fd('0x83')](JSON[_0x49fd('0x84')](process['argv'][0x4]),'id');}catch(_0x1d106b){logger[_0x49fd('0x40')]('No\x20agent\x20available');}main(_0x4ac7dd,_0x456c01,_0x8f5a67,_0x497f9b);}validate();process['on'](_0x49fd('0x85'),handleStop);process['on'](_0x49fd('0x86'),handleUncaughtException);
\ No newline at end of file
index 53fbe1b..254c48e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xace9=['agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','membername','UniqueId','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','outbound','string','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','calleridnum','Caller\x20Name','calleridname','destexten','Queue','uniqueid','Date','agentcalledAt','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete'];(function(_0x4ed383,_0x5cd212){var _0x135bf3=function(_0x3096e4){while(--_0x3096e4){_0x4ed383['push'](_0x4ed383['shift']());}};_0x135bf3(++_0x5cd212);}(_0xace9,0x1bc));var _0x9ace=function(_0x5f1d32,_0x47d03f){_0x5f1d32=_0x5f1d32-0x0;var _0x49145a=_0xace9[_0x5f1d32];return _0x49145a;};'use strict';exports[_0x9ace('0x0')]=function(_0xaef231,_0x4a8fec){var _0x2edcf9=[{'type':'string','content':_0x9ace('0x1'),'variableName':null}];switch(_0xaef231[_0x9ace('0x2')]()){case _0x9ace('0x3'):switch(_0x4a8fec[_0x9ace('0x2')]()){case _0x9ace('0x4'):_0x2edcf9[_0x9ace('0x5')]({'type':_0x9ace('0x6'),'content':'','variableName':_0x9ace('0x7')});_0x2edcf9[_0x9ace('0x5')]({'type':'variable','content':'','variableName':'calleridnum'});break;case _0x9ace('0x8'):_0x2edcf9['push']({'type':_0x9ace('0x9'),'content':_0x9ace('0xa'),'variableName':null});_0x2edcf9[_0x9ace('0x5')]({'type':_0x9ace('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x2edcf9;};exports[_0x9ace('0xb')]=function(_0x81868b,_0x4baab3){var _0x315d5f=[];switch(_0x81868b['toLowerCase']()){case _0x9ace('0x3'):switch(_0x4baab3[_0x9ace('0x2')]()){case _0x9ace('0x4'):_0x315d5f=[{'type':'string','content':_0x9ace('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x9ace('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x9ace('0x6'),'variableName':_0x9ace('0xe')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0xf'),'keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x10')},{'type':_0x9ace('0xd'),'content':'','key':'Call\x20To','keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x11')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x12'),'keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x7')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x13')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x14'),'keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x15')},{'type':_0x9ace('0x9'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x9ace('0xd'),'content':'','key':'Agent\x20Name','keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x16')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x17'),'keyType':_0x9ace('0x6'),'variableName':'destcalleridnum'},{'type':_0x9ace('0x9'),'content':_0x9ace('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x19'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x1a'),'keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x1b')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x1c'),'keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x1d')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x1e'),'keyType':_0x9ace('0x6'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0x9ace('0x1f'),'keyType':_0x9ace('0x6'),'variableName':_0x9ace('0x20')}];break;case'outbound':_0x315d5f=[{'type':_0x9ace('0x9'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x21'),'keyType':_0x9ace('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0x9ace('0x6'),'keyContent':'','variableName':_0x9ace('0x22')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x23'),'keyType':_0x9ace('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0x9ace('0x24')},{'type':_0x9ace('0x9'),'content':_0x9ace('0x18')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x25'),'keyType':_0x9ace('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x26'),'keyType':_0x9ace('0x6'),'keyContent':'','variableName':_0x9ace('0x27')},{'type':_0x9ace('0xd'),'content':'','key':_0x9ace('0x28'),'keyType':_0x9ace('0x6'),'keyContent':'','variableName':_0x9ace('0x29')},{'type':_0x9ace('0xd'),'content':'','key':'Billable\x20Time','keyType':_0x9ace('0x6'),'keyContent':'','variableName':_0x9ace('0x2a')}];break;}}return _0x315d5f;};
\ No newline at end of file
+var _0xde41=['agentcalledAt','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring'];(function(_0x51a968,_0x49fb19){var _0x4343ba=function(_0x452d7c){while(--_0x452d7c){_0x51a968['push'](_0x51a968['shift']());}};_0x4343ba(++_0x49fb19);}(_0xde41,0xf8));var _0x1de4=function(_0x1b6a98,_0x113326){_0x1b6a98=_0x1b6a98-0x0;var _0x29986a=_0xde41[_0x1b6a98];return _0x29986a;};'use strict';exports[_0x1de4('0x0')]=function(_0x18a835,_0x7dc4b1){var _0x3f3539=[{'type':_0x1de4('0x1'),'content':_0x1de4('0x2'),'variableName':null}];switch(_0x18a835['toLowerCase']()){case _0x1de4('0x3'):switch(_0x7dc4b1['toLowerCase']()){case _0x1de4('0x4'):_0x3f3539[_0x1de4('0x5')]({'type':_0x1de4('0x6'),'content':'','variableName':_0x1de4('0x7')});_0x3f3539[_0x1de4('0x5')]({'type':_0x1de4('0x6'),'content':'','variableName':_0x1de4('0x8')});break;case _0x1de4('0x9'):_0x3f3539[_0x1de4('0x5')]({'type':_0x1de4('0x1'),'content':_0x1de4('0xa'),'variableName':null});_0x3f3539[_0x1de4('0x5')]({'type':_0x1de4('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x3f3539;};exports[_0x1de4('0xb')]=function(_0x28da15,_0x48cd44){var _0x4dab1e=[];switch(_0x28da15[_0x1de4('0xc')]()){case _0x1de4('0x3'):switch(_0x48cd44[_0x1de4('0xc')]()){case _0x1de4('0x4'):_0x4dab1e=[{'type':_0x1de4('0x1'),'content':_0x1de4('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0xf'),'keyType':'variable','variableName':_0x1de4('0x8')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x10'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x11')},{'type':'keyValue','content':'','key':_0x1de4('0x12'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x13')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x14'),'keyType':'variable','variableName':_0x1de4('0x7')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x15'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x16')},{'type':_0x1de4('0xe'),'content':'','key':'Date','keyType':_0x1de4('0x6'),'variableName':'agentcalledAt'},{'type':_0x1de4('0x1'),'content':_0x1de4('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x1de4('0x18'),'keyType':_0x1de4('0x6'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x1de4('0x19'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x1de4('0x1'),'content':_0x1de4('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x1b'),'keyType':'variable','variableName':_0x1de4('0x1c')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x1d'),'keyType':_0x1de4('0x6'),'variableName':'agentconnectAt'},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x1e'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x1f')},{'type':'keyValue','content':'','key':_0x1de4('0x20'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x21')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x22'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x23')}];break;case _0x1de4('0x9'):_0x4dab1e=[{'type':_0x1de4('0x1'),'content':_0x1de4('0xd'),'variableName':null},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x24'),'keyType':_0x1de4('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':_0x1de4('0x25'),'keyType':_0x1de4('0x6'),'keyContent':'','variableName':_0x1de4('0x26')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x15'),'keyType':'variable','keyContent':'','variableName':_0x1de4('0x16')},{'type':_0x1de4('0xe'),'content':'','key':'Date','keyType':_0x1de4('0x6'),'keyContent':'','variableName':_0x1de4('0x27')},{'type':_0x1de4('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x28'),'keyType':_0x1de4('0x6'),'keyContent':'','variableName':_0x1de4('0x29')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x1de4('0x2b')},{'type':_0x1de4('0xe'),'content':'','key':'Duration','keyType':_0x1de4('0x6'),'keyContent':'','variableName':_0x1de4('0x2c')},{'type':'keyValue','content':'','key':_0x1de4('0x2d'),'keyType':_0x1de4('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x4dab1e;};
\ No newline at end of file
index e566e69..1aa90ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x718f=['user','clone','body','omit','html','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x718f,0x19a));var _0xf718=function(_0x5e31e2,_0x273090){_0x5e31e2=_0x5e31e2-0x0;var _0x294e2c=_0x718f[_0x5e31e2];return _0x294e2c;};'use strict';var _=require(_0xf718('0x0'));var db=require(_0xf718('0x1'))['db'];var loggers={'openchannel':require(_0xf718('0x2'))(_0xf718('0x3')),'mail':require('../../config/logger')(_0xf718('0x4')),'fax':require(_0xf718('0x2'))(_0xf718('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0xf718('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0xf718('0x6'))};function getInteractionId(_0x47a801,_0x127231,_0x5a142e){if(_0x47a801&&_0x47a801[_[_0xf718('0x7')](_0x5a142e)+_0xf718('0x8')]){return _0x47a801[_[_0xf718('0x7')](_0x5a142e)+'InteractionId'];}else if(_0x47a801&&_0x47a801['id']){return _0x47a801['id'];}else if(_0x127231&&_0x127231['id']){return _0x127231['id'];}else{return _0xf718('0x9');}}function log(_0x289173,_0x385aa2,_0x5833af,_0xcd6222,_0x21b388,_0x5da3c9){loggers[_0x21b388[_0xf718('0xa')]()][_0x289173](_0xf718('0xb'),_0x5da3c9[_0xf718('0xc')](),_0x385aa2?_0x385aa2['id']:null,_0x385aa2?_0x385aa2[_0xf718('0xd')]:null,_0x385aa2?_0x385aa2['role']:null,getInteractionId(_0x5833af,_0xcd6222,_0x21b388),_0x5833af?JSON[_0xf718('0xe')](_0x5833af):_0xf718('0xf'));}function updateUser(_0x18082c,_0x1979e2,_0x15eee4,_0x480057,_0x54cad9){db[_[_0xf718('0x7')](_0x480057)+_0xf718('0x10')][_0xf718('0x11')]({'where':{'id':getInteractionId(_0x1979e2,_0x15eee4,_0x480057)}})[_0xf718('0x12')](function(_0x311cd4){if(_0x311cd4){return _0x311cd4[_0xf718('0x13')]({'UserId':_0x18082c?_0x18082c['id']:null});}})['then'](function(_0x56d72b){if(_0x56d72b){log(_0xf718('0x14'),_0x18082c,_0x1979e2,_0x15eee4,_0x480057,_0x54cad9);}})[_0xf718('0x15')](function(){log(_0xf718('0x16'),_0x18082c,_0x1979e2,_0x15eee4,_0x480057,_0x54cad9);});}exports[_0xf718('0x17')]=function(_0x394d64,_0x4a4a70){return function(_0x260f46,_0x2832f4,_0x82a5b5){var _0x48c012=_0x260f46[_0xf718('0x18')];var _0x153aee={};var _0x41315d=_0x260f46['query'];if(_0x153aee){_0x153aee=_[_0xf718('0x19')](_0x260f46[_0xf718('0x1a')]);_0x153aee=_[_0xf718('0x1b')](_0x153aee,[_0xf718('0x1a'),_0xf718('0x1c'),_0xf718('0x1d'),'fax',_0xf718('0x1e')]);}updateUser(_0x48c012,_0x153aee,_0x41315d,_0x394d64,_0x4a4a70);_0x82a5b5(null);};};
\ No newline at end of file
+var _0xcaf3=['html','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','toLowerCase','toUpperCase','role','stringify','findOne','update','then','info','catch','error','tracked','user','query','clone','body','omit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcaf3,0xc5));var _0x3caf=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0xcaf3[_0x386b03];return _0xd3d524;};'use strict';var _=require(_0x3caf('0x0'));var db=require(_0x3caf('0x1'))['db'];var loggers={'openchannel':require(_0x3caf('0x2'))(_0x3caf('0x3')),'mail':require(_0x3caf('0x2'))(_0x3caf('0x4')),'fax':require(_0x3caf('0x2'))(_0x3caf('0x5')),'sms':require(_0x3caf('0x2'))(_0x3caf('0x6')),'chat':require(_0x3caf('0x2'))(_0x3caf('0x7')),'whatsapp':require(_0x3caf('0x2'))(_0x3caf('0x8'))};function getInteractionId(_0x1e90ba,_0x52a50b,_0x164f85){if(_0x1e90ba&&_0x1e90ba[_['upperFirst'](_0x164f85)+_0x3caf('0x9')]){return _0x1e90ba[_[_0x3caf('0xa')](_0x164f85)+_0x3caf('0x9')];}else if(_0x1e90ba&&_0x1e90ba['id']){return _0x1e90ba['id'];}else if(_0x52a50b&&_0x52a50b['id']){return _0x52a50b['id'];}else{return'unknown';}}function log(_0x1f826f,_0x3a3ec2,_0x3547d8,_0x37c69b,_0x2f6fb0,_0x5ad834){loggers[_0x2f6fb0[_0x3caf('0xb')]()][_0x1f826f]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5ad834[_0x3caf('0xc')](),_0x3a3ec2?_0x3a3ec2['id']:null,_0x3a3ec2?_0x3a3ec2['name']:null,_0x3a3ec2?_0x3a3ec2[_0x3caf('0xd')]:null,getInteractionId(_0x3547d8,_0x37c69b,_0x2f6fb0),_0x3547d8?JSON[_0x3caf('0xe')](_0x3547d8):'null');}function updateUser(_0x4bd4fe,_0x3e430e,_0x29ce7e,_0x11c9f4,_0x39de37){db[_[_0x3caf('0xa')](_0x11c9f4)+'Interaction'][_0x3caf('0xf')]({'where':{'id':getInteractionId(_0x3e430e,_0x29ce7e,_0x11c9f4)}})['then'](function(_0x43a6e5){if(_0x43a6e5){return _0x43a6e5[_0x3caf('0x10')]({'UserId':_0x4bd4fe?_0x4bd4fe['id']:null});}})[_0x3caf('0x11')](function(_0x4dec49){if(_0x4dec49){log(_0x3caf('0x12'),_0x4bd4fe,_0x3e430e,_0x29ce7e,_0x11c9f4,_0x39de37);}})[_0x3caf('0x13')](function(){log(_0x3caf('0x14'),_0x4bd4fe,_0x3e430e,_0x29ce7e,_0x11c9f4,_0x39de37);});}exports[_0x3caf('0x15')]=function(_0xb976c7,_0x6ae7f3){return function(_0xa1ccec,_0x292cff,_0x3f2c4e){var _0x520a44=_0xa1ccec[_0x3caf('0x16')];var _0x32b9d3={};var _0x103a70=_0xa1ccec[_0x3caf('0x17')];if(_0x32b9d3){_0x32b9d3=_[_0x3caf('0x18')](_0xa1ccec[_0x3caf('0x19')]);_0x32b9d3=_[_0x3caf('0x1a')](_0x32b9d3,[_0x3caf('0x19'),_0x3caf('0x1b'),'phone','fax','mobile']);}updateUser(_0x520a44,_0x32b9d3,_0x103a70,_0xb976c7,_0x6ae7f3);_0x3f2c4e(null);};};
\ No newline at end of file
index e912cab..970c188 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd11=['license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','user','isUserLimit','crypto','../../config/environment','data1'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0xdd11,0x18d));var _0x1dd1=function(_0x832803,_0x2b918e){_0x832803=_0x832803-0x0;var _0x159e77=_0xdd11[_0x832803];return _0x159e77;};'use strict';var crypto=require(_0x1dd1('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x1dd1('0x1'));function getValueFromLicense(_0x5d7b93,_0x40b070){if(_0x5d7b93&&_0x40b070){if(_0x40b070[_0x1dd1('0x2')]&&_0x40b070[_0x1dd1('0x3')]){var _0x401c7d=_0x40b070[_0x1dd1('0x2')];var _0x915f14=_0x40b070[_0x1dd1('0x3')];var _0x520825=_0x401c7d[_0x1dd1('0x4')]('-')[0x4];var _0x4d2ce0=_0x401c7d[_0x1dd1('0x4')]('-')[0x0];var _0x39360f=crypto[_0x1dd1('0x5')](_0x1dd1('0x6'),util[_0x1dd1('0x7')](_0x1dd1('0x8'),_0x520825,_0x401c7d,_0x4d2ce0));var _0xa8ac8b=_0x39360f[_0x1dd1('0x9')](_0x915f14,_0x1dd1('0xa'),_0x1dd1('0xb'));_0xa8ac8b+=_0x39360f[_0x1dd1('0xc')](_0x1dd1('0xb'));var _0xd0c3cf=JSON[_0x1dd1('0xd')](_0xa8ac8b);return _0xd0c3cf['hasOwnProperty'](_0x5d7b93)?_0xd0c3cf[_0x5d7b93]:null;}}return null;}function isLimit(_0x22b068,_0x23eaf1,_0x253c1d,_0x44b014){var _0x1472c2=_0x23eaf1;return compose()[_0x1dd1('0xe')](function(_0x4dc0d2,_0x575b5e,_0x4b3be9){return db[_0x1dd1('0xf')][_0x1dd1('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0xa3c2cc){var _0x588f9a=getValueFromLicense(_0x22b068,_0xa3c2cc);return _0x588f9a?_0x588f9a:_0x1472c2;})[_0x1dd1('0x11')](function(_0x61877d){_0x1472c2=_0x61877d;return _0x253c1d['count'](_0x44b014);})[_0x1dd1('0x11')](function(_0xe98a75){if(_0xe98a75>=_0x1472c2){return _0x575b5e[_0x1dd1('0x12')](0x193)[_0x1dd1('0x13')]({'message':util[_0x1dd1('0x7')](_0x1dd1('0x14'),_0x22b068)});}_0x4b3be9();})[_0x1dd1('0x15')](function(_0x42e328){_0x4b3be9(_0x42e328);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x1dd1('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x1dd1('0x17')}]}});}exports[_0x1dd1('0x18')]=isUserLimit;
\ No newline at end of file
+var _0xeb68=['license','split','createDecipher','aes-256-ctr','format','update','base64','final','parse','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','data1'];(function(_0x58cd59,_0x118d91){var _0x31bcfe=function(_0x2a7c1d){while(--_0x2a7c1d){_0x58cd59['push'](_0x58cd59['shift']());}};_0x31bcfe(++_0x118d91);}(_0xeb68,0x91));var _0x8eb6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xeb68[_0x2c91e9];return _0x13f0ff;};'use strict';var crypto=require(_0x8eb6('0x0'));var util=require(_0x8eb6('0x1'));var compose=require(_0x8eb6('0x2'));var db=require(_0x8eb6('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1c354f,_0x1c5a3b){if(_0x1c354f&&_0x1c5a3b){if(_0x1c5a3b[_0x8eb6('0x4')]&&_0x1c5a3b[_0x8eb6('0x5')]){var _0x513dde=_0x1c5a3b[_0x8eb6('0x4')];var _0x2feea0=_0x1c5a3b['license'];var _0x436c28=_0x513dde['split']('-')[0x4];var _0x493fe2=_0x513dde[_0x8eb6('0x6')]('-')[0x0];var _0x197375=crypto[_0x8eb6('0x7')](_0x8eb6('0x8'),util[_0x8eb6('0x9')]('%s:%s:%s',_0x436c28,_0x513dde,_0x493fe2));var _0x39ba50=_0x197375[_0x8eb6('0xa')](_0x2feea0,_0x8eb6('0xb'),'utf8');_0x39ba50+=_0x197375[_0x8eb6('0xc')]('utf8');var _0x7b6640=JSON[_0x8eb6('0xd')](_0x39ba50);return _0x7b6640['hasOwnProperty'](_0x1c354f)?_0x7b6640[_0x1c354f]:null;}}return null;}function isLimit(_0x1e1c01,_0x1ac8c4,_0x5a806a,_0x367ced){var _0x477f5f=_0x1ac8c4;return compose()['use'](function(_0x59541d,_0xa3ae1f,_0x5df270){return db[_0x8eb6('0xe')][_0x8eb6('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x8eb6('0x10')](function(_0x3af5cc){var _0x20fddd=getValueFromLicense(_0x1e1c01,_0x3af5cc);return _0x20fddd?_0x20fddd:_0x477f5f;})[_0x8eb6('0x10')](function(_0x4b3df5){_0x477f5f=_0x4b3df5;return _0x5a806a[_0x8eb6('0x11')](_0x367ced);})[_0x8eb6('0x10')](function(_0x1250ec){if(_0x1250ec>=_0x477f5f){return _0xa3ae1f[_0x8eb6('0x12')](0x193)['json']({'message':util[_0x8eb6('0x9')](_0x8eb6('0x13'),_0x1e1c01)});}_0x5df270();})[_0x8eb6('0x14')](function(_0x4cf5db){_0x5df270(_0x4cf5db);});});}function isUserLimit(){return isLimit(_0x8eb6('0x15'),0x1,db[_0x8eb6('0x16')],{'where':{'$or':[{'role':_0x8eb6('0x17')},{'role':_0x8eb6('0x18')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index b921e17..717d7f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacc3=['NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','$lt','<\x20?','$gt','>\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','$substring','DATE','utcOffset','hours','add','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','shift','match','forEach','filter','indexOf','map','conditions','push','buildExpression','operator','$eq','value','includes','$lte','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn'];(function(_0xb45c8d,_0x32a199){var _0x1780ea=function(_0x5aa5f0){while(--_0x5aa5f0){_0xb45c8d['push'](_0xb45c8d['shift']());}};_0x1780ea(++_0x32a199);}(_0xacc3,0x83));var _0x3acc=function(_0x19b120,_0x58b53d){_0x19b120=_0x19b120-0x0;var _0x50747e=_0xacc3[_0x19b120];return _0x50747e;};'use strict';var _=require('lodash');var moment=require(_0x3acc('0x0'));exports[_0x3acc('0x1')]=function(_0x3d5f4e){var _0x4f563f={'conditions':[]};_0x4f563f[_0x3acc('0x2')]=_[_0x3acc('0x3')](_0x3d5f4e,_0x3acc('0x4'))?'or':_0x3acc('0x5');var _0x281df0=_0x3d5f4e[_0x3acc('0x6')]('[$and]','')[_0x3acc('0x6')](_0x3acc('0x4'),'')[_0x3acc('0x7')]('||');for(var _0x53adaa=0x0;_0x53adaa<_0x281df0[_0x3acc('0x8')];_0x53adaa++){var _0xc81317=_0x281df0[_0x53adaa][_0x3acc('0x7')](':=');var _0x1ac819=_0xc81317[0x0];var _0xf47f81=_0xc81317[_0x3acc('0x9')](0x1);_0xf47f81['forEach'](function(_0x29ba3c){var _0x51612f=_0x29ba3c[_0x3acc('0x7')]('[')[_0x3acc('0xa')]();var _0x2ad01d=_0x29ba3c[_0x3acc('0xb')](/\[(.*?)\]/g);_0x2ad01d[_0x3acc('0xc')](function(_0x43e512){var _0x371e86=_0x43e512[_0x3acc('0x7')]('[')[_0x3acc('0xd')](function(_0x11c550){return _0x11c550[_0x3acc('0xe')](']')>-0x1;})[_0x3acc('0xf')](function(_0x273c62){return _0x273c62[_0x3acc('0x7')](']')[0x0];})[0x0];_0x4f563f[_0x3acc('0x10')][_0x3acc('0x11')]({'field':_0x1ac819,'operator':_0x51612f,'value':_0x371e86});});});}return _0x4f563f;};exports[_0x3acc('0x12')]=function(_0x905402,_0x4e219b,_0x4b3e28){var _0x439a02={};if(_0x4e219b==='DATE'){if(_0x4b3e28[_0x3acc('0x13')]===_0x3acc('0x14')){_0x4b3e28[_0x3acc('0x13')]='$between';_0x4b3e28[_0x3acc('0x15')]+=','+_0x4b3e28['value'];}else if(_[_0x3acc('0x16')](['$gt',_0x3acc('0x17')],_0x4b3e28[_0x3acc('0x13')])){_0x4b3e28[_0x3acc('0x15')]=moment(_0x4b3e28[_0x3acc('0x15')])['add'](0x1,'days')[_0x3acc('0x18')](_0x3acc('0x19'));}}if(_0x4b3e28[_0x3acc('0x1a')]){_0x4e219b=_0x4b3e28['castTo'];_0x439a02[_0x3acc('0x1b')]=_0x3acc('0x1c')+_0x905402+'.'+_0x4b3e28[_0x3acc('0x1d')]+_0x3acc('0x1e')+_0x4b3e28['castTo']+')\x20'+parseOperator(_0x4b3e28[_0x3acc('0x13')]);}else{_0x439a02[_0x3acc('0x1b')]=_0x905402+'.'+_0x4b3e28[_0x3acc('0x1d')]+'\x20'+parseOperator(_0x4b3e28['operator']);}if(_[_0x3acc('0x16')]([_0x3acc('0x1f'),'$notIn'],_0x4b3e28[_0x3acc('0x13')]))_0x439a02[_0x3acc('0x1b')]='('+_0x439a02[_0x3acc('0x1b')]+_0x3acc('0x20')+_0x905402+'.'+_0x4b3e28[_0x3acc('0x1d')]+_0x3acc('0x21');_0x439a02['value']=parseValue(_0x4e219b,_0x4b3e28[_0x3acc('0x13')],_0x4b3e28[_0x3acc('0x15')]);return _0x439a02;};function parseOperator(_0x496c04){var _0x461332;switch(_0x496c04){case _0x3acc('0x22'):_0x461332=_0x3acc('0x23');break;case _0x3acc('0x24'):_0x461332=_0x3acc('0x25');break;case _0x3acc('0x14'):_0x461332=_0x3acc('0x26');break;case _0x3acc('0x1f'):_0x461332=_0x3acc('0x27');break;case'$substring':case _0x3acc('0x28'):case _0x3acc('0x29'):_0x461332='LIKE\x20?';break;case _0x3acc('0x2a'):_0x461332=_0x3acc('0x2b');break;case _0x3acc('0x2c'):_0x461332=_0x3acc('0x2d');break;case _0x3acc('0x17'):_0x461332='<=\x20?';break;case'$gte':_0x461332='>=\x20?';break;case _0x3acc('0x2e'):_0x461332=_0x3acc('0x2f');break;}return _0x461332;}function parseValue(_0x5e02fb,_0x429a68,_0x2d0930){var _0x4b2971={'start':undefined,'end':undefined};switch(_0x429a68){case _0x3acc('0x22'):case _0x3acc('0x24'):_0x4b2971[_0x3acc('0x30')]=_0x2d0930[_0x3acc('0x7')](',');break;case _0x3acc('0x31'):_0x4b2971[_0x3acc('0x30')]='%'+_0x2d0930+'%';break;case _0x3acc('0x28'):_0x4b2971[_0x3acc('0x30')]=_0x2d0930+'%';break;case _0x3acc('0x29'):_0x4b2971[_0x3acc('0x30')]='%'+_0x2d0930;break;case'$between':var _0x4f0066=_0x2d0930[_0x3acc('0x7')](',');var _0x2d0930=_0x4f0066[_0x3acc('0xa')]();var _0x2d5a72=_0x4f0066['pop']();if(_0x5e02fb===_0x3acc('0x32')){_0x2d0930=moment(_0x2d0930)[_0x3acc('0x33')](0x0,!![])['format']();_0x2d5a72=moment(_0x2d5a72)[_0x3acc('0x33')](0x0,!![])['add'](0x17,_0x3acc('0x34'))[_0x3acc('0x35')](0x3b,_0x3acc('0x36'))[_0x3acc('0x35')](0x3b,_0x3acc('0x37'))[_0x3acc('0x18')]();}_0x4b2971={'start':_0x2d0930,'end':_0x2d5a72};break;default:_0x4b2971[_0x3acc('0x30')]=_0x2d0930;break;}return _0x4b2971;}
\ No newline at end of file
+var _0x187f=['match','filter','map','conditions','push','DATE','$eq','operator','$between','value','includes','$gt','$lte','format','castTo','text','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','LIKE\x20?','$lt','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','length','slice','forEach','split','shift'];(function(_0x18aa96,_0xe21f5b){var _0x4dc8a7=function(_0x2a0a29){while(--_0x2a0a29){_0x18aa96['push'](_0x18aa96['shift']());}};_0x4dc8a7(++_0xe21f5b);}(_0x187f,0xbf));var _0xf187=function(_0x4e8c70,_0x388a79){_0x4e8c70=_0x4e8c70-0x0;var _0x2ecb3f=_0x187f[_0x4e8c70];return _0x2ecb3f;};'use strict';var _=require(_0xf187('0x0'));var moment=require(_0xf187('0x1'));exports[_0xf187('0x2')]=function(_0x1977fe){var _0x2eddf2={'conditions':[]};_0x2eddf2[_0xf187('0x3')]=_[_0xf187('0x4')](_0x1977fe,_0xf187('0x5'))?'or':_0xf187('0x6');var _0x8f8c15=_0x1977fe[_0xf187('0x7')]('[$and]','')[_0xf187('0x7')](_0xf187('0x5'),'')['split']('||');for(var _0x22a47a=0x0;_0x22a47a<_0x8f8c15[_0xf187('0x8')];_0x22a47a++){var _0x5e5e1f=_0x8f8c15[_0x22a47a]['split'](':=');var _0x165881=_0x5e5e1f[0x0];var _0x5778ae=_0x5e5e1f[_0xf187('0x9')](0x1);_0x5778ae[_0xf187('0xa')](function(_0xd0238d){var _0x286728=_0xd0238d[_0xf187('0xb')]('[')[_0xf187('0xc')]();var _0x301028=_0xd0238d[_0xf187('0xd')](/\[(.*?)\]/g);_0x301028[_0xf187('0xa')](function(_0x1b08e5){var _0x11a103=_0x1b08e5[_0xf187('0xb')]('[')[_0xf187('0xe')](function(_0xd3974f){return _0xd3974f['indexOf'](']')>-0x1;})[_0xf187('0xf')](function(_0xed5518){return _0xed5518[_0xf187('0xb')](']')[0x0];})[0x0];_0x2eddf2[_0xf187('0x10')][_0xf187('0x11')]({'field':_0x165881,'operator':_0x286728,'value':_0x11a103});});});}return _0x2eddf2;};exports['buildExpression']=function(_0x5b70be,_0x2c9eda,_0x536d50){var _0x4a19a5={};if(_0x2c9eda===_0xf187('0x12')){if(_0x536d50['operator']===_0xf187('0x13')){_0x536d50[_0xf187('0x14')]=_0xf187('0x15');_0x536d50['value']+=','+_0x536d50[_0xf187('0x16')];}else if(_[_0xf187('0x17')]([_0xf187('0x18'),_0xf187('0x19')],_0x536d50[_0xf187('0x14')])){_0x536d50[_0xf187('0x16')]=moment(_0x536d50[_0xf187('0x16')])['add'](0x1,'days')[_0xf187('0x1a')]('YYYY-MM-DD');}}if(_0x536d50[_0xf187('0x1b')]){_0x2c9eda=_0x536d50[_0xf187('0x1b')];_0x4a19a5[_0xf187('0x1c')]='CAST('+_0x5b70be+'.'+_0x536d50[_0xf187('0x1d')]+'\x20AS\x20'+_0x536d50['castTo']+')\x20'+parseOperator(_0x536d50['operator']);}else{_0x4a19a5[_0xf187('0x1c')]=_0x5b70be+'.'+_0x536d50[_0xf187('0x1d')]+'\x20'+parseOperator(_0x536d50[_0xf187('0x14')]);}if(_['includes']([_0xf187('0x1e'),_0xf187('0x1f')],_0x536d50[_0xf187('0x14')]))_0x4a19a5[_0xf187('0x1c')]='('+_0x4a19a5[_0xf187('0x1c')]+_0xf187('0x20')+_0x5b70be+'.'+_0x536d50[_0xf187('0x1d')]+'\x20IS\x20NULL)';_0x4a19a5[_0xf187('0x16')]=parseValue(_0x2c9eda,_0x536d50[_0xf187('0x14')],_0x536d50[_0xf187('0x16')]);return _0x4a19a5;};function parseOperator(_0x1bb6e8){var _0x2e8124;switch(_0x1bb6e8){case _0xf187('0x21'):_0x2e8124=_0xf187('0x22');break;case _0xf187('0x1f'):_0x2e8124=_0xf187('0x23');break;case'$eq':_0x2e8124=_0xf187('0x24');break;case _0xf187('0x1e'):_0x2e8124=_0xf187('0x25');break;case'$substring':case _0xf187('0x26'):case'$endsWith':_0x2e8124=_0xf187('0x27');break;case _0xf187('0x28'):_0x2e8124='<\x20?';break;case'$gt':_0x2e8124=_0xf187('0x29');break;case'$lte':_0x2e8124='<=\x20?';break;case _0xf187('0x2a'):_0x2e8124=_0xf187('0x2b');break;case _0xf187('0x15'):_0x2e8124=_0xf187('0x2c');break;}return _0x2e8124;}function parseValue(_0x8bb9c1,_0x734494,_0x205869){var _0x4647f8={'start':undefined,'end':undefined};switch(_0x734494){case'$in':case'$notIn':_0x4647f8[_0xf187('0x2d')]=_0x205869['split'](',');break;case'$substring':_0x4647f8['start']='%'+_0x205869+'%';break;case _0xf187('0x26'):_0x4647f8[_0xf187('0x2d')]=_0x205869+'%';break;case'$endsWith':_0x4647f8[_0xf187('0x2d')]='%'+_0x205869;break;case _0xf187('0x15'):var _0x3d332b=_0x205869[_0xf187('0xb')](',');var _0x205869=_0x3d332b['shift']();var _0x246a1a=_0x3d332b['pop']();if(_0x8bb9c1==='DATE'){_0x205869=moment(_0x205869)['utcOffset'](0x0,!![])['format']();_0x246a1a=moment(_0x246a1a)[_0xf187('0x2e')](0x0,!![])[_0xf187('0x2f')](0x17,_0xf187('0x30'))[_0xf187('0x2f')](0x3b,_0xf187('0x31'))[_0xf187('0x2f')](0x3b,_0xf187('0x32'))['format']();}_0x4647f8={'start':_0x205869,'end':_0x246a1a};break;default:_0x4647f8[_0xf187('0x2d')]=_0x205869;break;}return _0x4647f8;}
\ No newline at end of file
index 679c405..08409e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ea3=['isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','name','uniqueid','split','limit','map','indexOf','cast','col','unsigned','priority','ASC','omit','isArray','length','isObject','isString','unset','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','filters','intersection','attributes','hasOwnProperty','nolimit','offset','order','sort','filter','merge','where','VIRTUAL','lower','options','lodash','sequelize','moment','keys','includes','parse','fields','isEmpty','find','type','DATE'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x7ea3,0xe5));var _0x37ea=function(_0x477598,_0x4dab5c){_0x477598=_0x477598-0x0;var _0x4c7ffb=_0x7ea3[_0x477598];return _0x4c7ffb;};'use strict';var _=require(_0x37ea('0x0'));var sequelize=require(_0x37ea('0x1'));var moment=require(_0x37ea('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x166498){var _0x3a777d=['ne'];try{var _0xd55bd8=JSON['parse'](_0x166498);var _0x5b6d99=Object[_0x37ea('0x3')](_0xd55bd8)[0x0];return _0x3a777d[_0x37ea('0x4')](_0x5b6d99);}catch(_0x208479){return![];}}function getOperatorValue(_0x32d8e4){var _0x4249cd=JSON[_0x37ea('0x5')](_0x32d8e4);var _0x3eab36=Object[_0x37ea('0x3')](_0x4249cd)[0x0];var _0x367677=_0x4249cd[_0x3eab36];return{['$'+_0x3eab36]:_0x367677};}exports[_0x37ea('0x6')]=function(_0x185bba){var _0x252b56=null;if(_0x185bba){_0x252b56=_0x185bba['split'](',');}return _0x252b56;};exports['filters']=function(_0x323eaa,_0x262ccb){var _0x4a37a0={};if(!_[_0x37ea('0x7')](_0x323eaa)){_['forOwn'](_0x323eaa,function(_0x1379cd,_0xf0e339){try{if(_0x262ccb){var _0x53751c=_[_0x37ea('0x8')](_0x262ccb,{'name':_0xf0e339})||{};if(hasSequelizeOperator(_0x1379cd)){_0x4a37a0[_0xf0e339]=getOperatorValue(_0x1379cd);}else if(_0x53751c[_0x37ea('0x9')]===_0x37ea('0xa')&&_[_0x37ea('0xb')](_0x1379cd)){var _0x43e3d3=JSON[_0x37ea('0x5')](_0x1379cd);var _0x5d0c9c={'$gte':moment(moment(_0x43e3d3[_0x37ea('0xc')])['format'](_0x37ea('0xd')))[_0x37ea('0xe')]()[_0x37ea('0xf')](),'$lte':moment(moment(_0x43e3d3[_0x37ea('0x10')])[_0x37ea('0xf')](_0x37ea('0xd')))[_0x37ea('0xe')]()['subtract'](0x1,'s')[_0x37ea('0xf')]()};_0x4a37a0[_0xf0e339]=_0x5d0c9c;}else if(_0x53751c[_0x37ea('0x11')]===_0x37ea('0x12')){_0x4a37a0[_0xf0e339]=_0x1379cd;}else{_0x4a37a0[_0xf0e339]=_['isArray'](_0x1379cd)?_0x1379cd:JSON[_0x37ea('0x5')](_0x1379cd);}}else{_0x4a37a0[_0xf0e339]=_['isArray'](_0x1379cd)?_0x1379cd:JSON[_0x37ea('0x5')](_0x1379cd);}}catch(_0x15dd76){_0x4a37a0[_0xf0e339]=_0x1379cd[_0x37ea('0x13')](',');}});}return _0x4a37a0;};exports[_0x37ea('0x14')]=function(_0x88566d){_0x88566d=parseInt(_0x88566d,0xa);if(!_0x88566d||_0x88566d<0x0){_0x88566d=LIMIT_VALUE;}return _0x88566d;};exports['offset']=function(_0x492c95){_0x492c95=parseInt(_0x492c95,0xa);if(!_0x492c95||_0x492c95<0x0){_0x492c95=0x0;}return _0x492c95;};exports['sort']=function(_0x4089a3){var _0x2d384e,_0x319b41=null;if(_0x4089a3){_0x2d384e=_0x4089a3[_0x37ea('0x13')](',');_0x319b41=_[_0x37ea('0x15')](_0x2d384e,function(_0x846612){if(_0x846612[_0x37ea('0x16')]('-')===0x0){return[_0x846612==='priority'?sequelize[_0x37ea('0x17')](sequelize[_0x37ea('0x18')]('priority'),_0x37ea('0x19')):_0x846612['substr'](0x1),'DESC'];}else{return[_0x846612===_0x37ea('0x1a')?sequelize[_0x37ea('0x17')](sequelize[_0x37ea('0x18')](_0x37ea('0x1a')),'unsigned'):_0x846612,_0x37ea('0x1b')];}});}return _0x319b41;};exports[_0x37ea('0x1c')]=function(_0x2f8346,_0x4ddf81){if(_[_0x37ea('0x7')](_0x2f8346)){return _0x2f8346;}if(_[_0x37ea('0x1d')](_0x2f8346)){for(var _0x23cbc5=0x0;_0x23cbc5<_0x2f8346[_0x37ea('0x1e')];_0x23cbc5+=0x1){_0x2f8346[_0x23cbc5]=this[_0x37ea('0x1c')](_0x2f8346[_0x23cbc5],_0x4ddf81);}return _0x2f8346;}if(!_[_0x37ea('0x1f')](_0x2f8346)){return _0x2f8346;}if(_[_0x37ea('0x20')](_0x4ddf81)){_0x4ddf81=[_0x4ddf81];}if(!_[_0x37ea('0x1d')](_0x4ddf81)){return _0x2f8346;}for(var _0x2c48d5=0x0;_0x2c48d5<_0x4ddf81['length'];_0x2c48d5+=0x1){_[_0x37ea('0x21')](_0x2f8346,_0x4ddf81[_0x2c48d5]);}for(var _0x30232e in _0x2f8346){if(_0x2f8346['hasOwnProperty'](_0x30232e)){_0x2f8346[_0x30232e]=this[_0x37ea('0x1c')](_0x2f8346[_0x30232e],_0x4ddf81);}}return _0x2f8346;};exports['isNumeric']=function(_0x1c8f76){return _0x1c8f76[_0x37ea('0x22')](RegExp(_0x37ea('0x23')))?!![]:![];};exports[_0x37ea('0x24')]=function(_0x332035){return _0x332035[_0x37ea('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x37ea('0x25')]=function(_0x53978a){var _0x9b97c6=[];_0x53978a[_0x37ea('0x13')](/[ ,]+/)[_0x37ea('0x26')](function(_0x1b4916){_0x1b4916=_0x1b4916[_0x37ea('0x27')](/([^:]")"+/g,'$1');_0x1b4916='+'+_0x1b4916+'*';if(_0x1b4916[_0x37ea('0x4')]('@'))_0x1b4916='\x22'+_0x1b4916+'\x22';_0x9b97c6[_0x37ea('0x28')](_0x1b4916);});return _0x9b97c6[_0x37ea('0x29')]('\x20');};exports[_0x37ea('0x2a')]=function(_0x5dc62b,_0x2cbccf,_0x2a7d64){var _0x1a65ee={},_0x5c533c={};if(_0x2cbccf['query'][_0x37ea('0x2b')]){_0x2cbccf['query']['id']=_0x2cbccf[_0x37ea('0x2c')]['$id'];delete _0x2cbccf[_0x37ea('0x2c')][_0x37ea('0x2b')];}_0x1a65ee[_0x37ea('0x2d')]=_[_0x37ea('0x15')](_0x5dc62b,_0x37ea('0x11'));_0x1a65ee[_0x37ea('0x2c')]=_[_0x37ea('0x3')](_0x2cbccf[_0x37ea('0x2c')]);_0x1a65ee[_0x37ea('0x2e')]=_[_0x37ea('0x2f')](_0x1a65ee[_0x37ea('0x2d')],_0x1a65ee[_0x37ea('0x2c')]);_0x5c533c[_0x37ea('0x30')]=_[_0x37ea('0x2f')](_0x1a65ee[_0x37ea('0x2d')],this[_0x37ea('0x6')](_0x2cbccf[_0x37ea('0x2c')][_0x37ea('0x6')]));_0x5c533c[_0x37ea('0x30')]=_0x5c533c['attributes'][_0x37ea('0x1e')]?_0x5c533c[_0x37ea('0x30')]:_0x1a65ee[_0x37ea('0x2d')];if(!_0x2cbccf[_0x37ea('0x2c')][_0x37ea('0x31')](_0x37ea('0x32'))){_0x5c533c[_0x37ea('0x14')]=this[_0x37ea('0x14')](_0x2cbccf['query'][_0x37ea('0x14')]);_0x5c533c['offset']=this[_0x37ea('0x33')](_0x2cbccf[_0x37ea('0x2c')][_0x37ea('0x33')]);}_0x5c533c[_0x37ea('0x34')]=this[_0x37ea('0x35')](_0x2cbccf[_0x37ea('0x2c')][_0x37ea('0x35')]);_0x5c533c['where']=this['filters'](_['pick'](_0x2cbccf[_0x37ea('0x2c')],_0x1a65ee[_0x37ea('0x2e')]),_0x5dc62b);if(_0x2cbccf[_0x37ea('0x2c')][_0x37ea('0x36')]){_0x5c533c['where']=_[_0x37ea('0x37')](_0x5c533c[_0x37ea('0x38')],{'$or':_[_0x37ea('0x15')](_0x5dc62b,function(_0x523edb){if(_0x523edb[_0x37ea('0x9')]!==_0x37ea('0x39')){if(_0x2a7d64){return sequelize[_0x37ea('0x38')](sequelize['fn']('lower',sequelize[_0x37ea('0x18')](_0x523edb[_0x37ea('0x11')])),{'$like':sequelize['fn'](_0x37ea('0x3a'),'%'+_0x2cbccf[_0x37ea('0x2c')][_0x37ea('0x36')]+'%')});}else{var _0x57531b={};_0x57531b[_0x523edb[_0x37ea('0x11')]]={'$like':'%'+_0x2cbccf[_0x37ea('0x2c')]['filter']+'%'};return _0x57531b;}}})});}_0x5c533c=_['merge']({},_0x5c533c,_0x2cbccf[_0x37ea('0x3b')]);return _0x5c533c;};
\ No newline at end of file
+var _0xd40f=['cast','col','priority','unsigned','substr','DESC','ASC','length','omit','isObject','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','includes','join','getOptions','query','$id','intersection','model','attributes','nolimit','offset','order','filter','where','VIRTUAL','lower','name','merge','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','isArray','limit','sort','map','indexOf'];(function(_0x574d9b,_0x2063da){var _0x31d2a5=function(_0x97ce4c){while(--_0x97ce4c){_0x574d9b['push'](_0x574d9b['shift']());}};_0x31d2a5(++_0x2063da);}(_0xd40f,0x111));var _0xfd40=function(_0x24bd79,_0x1752ae){_0x24bd79=_0x24bd79-0x0;var _0x137cb3=_0xd40f[_0x24bd79];return _0x137cb3;};'use strict';var _=require(_0xfd40('0x0'));var sequelize=require(_0xfd40('0x1'));var moment=require(_0xfd40('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3a0f92){var _0x2260b2=['ne'];try{var _0x5c16ff=JSON[_0xfd40('0x3')](_0x3a0f92);var _0x241117=Object['keys'](_0x5c16ff)[0x0];return _0x2260b2['includes'](_0x241117);}catch(_0x44c45a){return![];}}function getOperatorValue(_0x305763){var _0x496434=JSON[_0xfd40('0x3')](_0x305763);var _0x1cd3f7=Object[_0xfd40('0x4')](_0x496434)[0x0];var _0x31a4ca=_0x496434[_0x1cd3f7];return{['$'+_0x1cd3f7]:_0x31a4ca};}exports[_0xfd40('0x5')]=function(_0x8e0a6){var _0x2fd902=null;if(_0x8e0a6){_0x2fd902=_0x8e0a6[_0xfd40('0x6')](',');}return _0x2fd902;};exports[_0xfd40('0x7')]=function(_0x53ec1a,_0x3151a0){var _0x4018f3={};if(!_[_0xfd40('0x8')](_0x53ec1a)){_[_0xfd40('0x9')](_0x53ec1a,function(_0x162d7c,_0x46f77f){try{if(_0x3151a0){var _0x3c3d6f=_['find'](_0x3151a0,{'name':_0x46f77f})||{};if(hasSequelizeOperator(_0x162d7c)){_0x4018f3[_0x46f77f]=getOperatorValue(_0x162d7c);}else if(_0x3c3d6f[_0xfd40('0xa')]===_0xfd40('0xb')&&_[_0xfd40('0xc')](_0x162d7c)){var _0x59cbe9=JSON[_0xfd40('0x3')](_0x162d7c);var _0x128c2d={'$gte':moment(moment(_0x59cbe9[_0xfd40('0xd')])[_0xfd40('0xe')](_0xfd40('0xf')))['utc']()[_0xfd40('0xe')](),'$lte':moment(moment(_0x59cbe9['$lte'])['format'](_0xfd40('0xf')))[_0xfd40('0x10')]()['subtract'](0x1,'s')[_0xfd40('0xe')]()};_0x4018f3[_0x46f77f]=_0x128c2d;}else if(_0x3c3d6f['name']==='uniqueid'){_0x4018f3[_0x46f77f]=_0x162d7c;}else{_0x4018f3[_0x46f77f]=_['isArray'](_0x162d7c)?_0x162d7c:JSON[_0xfd40('0x3')](_0x162d7c);}}else{_0x4018f3[_0x46f77f]=_[_0xfd40('0x11')](_0x162d7c)?_0x162d7c:JSON['parse'](_0x162d7c);}}catch(_0x2836f3){_0x4018f3[_0x46f77f]=_0x162d7c['split'](',');}});}return _0x4018f3;};exports[_0xfd40('0x12')]=function(_0x55c135){_0x55c135=parseInt(_0x55c135,0xa);if(!_0x55c135||_0x55c135<0x0){_0x55c135=LIMIT_VALUE;}return _0x55c135;};exports['offset']=function(_0x3c2603){_0x3c2603=parseInt(_0x3c2603,0xa);if(!_0x3c2603||_0x3c2603<0x0){_0x3c2603=0x0;}return _0x3c2603;};exports[_0xfd40('0x13')]=function(_0x399993){var _0x5ceccd,_0x413992=null;if(_0x399993){_0x5ceccd=_0x399993[_0xfd40('0x6')](',');_0x413992=_[_0xfd40('0x14')](_0x5ceccd,function(_0x4d7a6d){if(_0x4d7a6d[_0xfd40('0x15')]('-')===0x0){return[_0x4d7a6d==='priority'?sequelize[_0xfd40('0x16')](sequelize[_0xfd40('0x17')](_0xfd40('0x18')),_0xfd40('0x19')):_0x4d7a6d[_0xfd40('0x1a')](0x1),_0xfd40('0x1b')];}else{return[_0x4d7a6d==='priority'?sequelize[_0xfd40('0x16')](sequelize[_0xfd40('0x17')](_0xfd40('0x18')),_0xfd40('0x19')):_0x4d7a6d,_0xfd40('0x1c')];}});}return _0x413992;};exports['omit']=function(_0x61c81d,_0x1fd1a9){if(_[_0xfd40('0x8')](_0x61c81d)){return _0x61c81d;}if(_[_0xfd40('0x11')](_0x61c81d)){for(var _0x51ebc6=0x0;_0x51ebc6<_0x61c81d[_0xfd40('0x1d')];_0x51ebc6+=0x1){_0x61c81d[_0x51ebc6]=this[_0xfd40('0x1e')](_0x61c81d[_0x51ebc6],_0x1fd1a9);}return _0x61c81d;}if(!_[_0xfd40('0x1f')](_0x61c81d)){return _0x61c81d;}if(_['isString'](_0x1fd1a9)){_0x1fd1a9=[_0x1fd1a9];}if(!_['isArray'](_0x1fd1a9)){return _0x61c81d;}for(var _0x3b71c1=0x0;_0x3b71c1<_0x1fd1a9[_0xfd40('0x1d')];_0x3b71c1+=0x1){_[_0xfd40('0x20')](_0x61c81d,_0x1fd1a9[_0x3b71c1]);}for(var _0x1fe8e9 in _0x61c81d){if(_0x61c81d[_0xfd40('0x21')](_0x1fe8e9)){_0x61c81d[_0x1fe8e9]=this[_0xfd40('0x1e')](_0x61c81d[_0x1fe8e9],_0x1fd1a9);}}return _0x61c81d;};exports[_0xfd40('0x22')]=function(_0x1f7001){return _0x1f7001['match'](RegExp(_0xfd40('0x23')))?!![]:![];};exports[_0xfd40('0x24')]=function(_0x35b0b4){return _0x35b0b4[_0xfd40('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xfd40('0x26')]=function(_0x2d9844){var _0x3249e8=[];_0x2d9844[_0xfd40('0x6')](/[ ,]+/)[_0xfd40('0x27')](function(_0x54db15){_0x54db15=_0x54db15[_0xfd40('0x28')](/([^:]")"+/g,'$1');_0x54db15='+'+_0x54db15+'*';if(_0x54db15[_0xfd40('0x29')]('@'))_0x54db15='\x22'+_0x54db15+'\x22';_0x3249e8['push'](_0x54db15);});return _0x3249e8[_0xfd40('0x2a')]('\x20');};exports[_0xfd40('0x2b')]=function(_0x3e3717,_0xede742,_0x5309a6){var _0x211ceb={},_0x107165={};if(_0xede742[_0xfd40('0x2c')][_0xfd40('0x2d')]){_0xede742[_0xfd40('0x2c')]['id']=_0xede742[_0xfd40('0x2c')]['$id'];delete _0xede742['query']['$id'];}_0x211ceb['model']=_[_0xfd40('0x14')](_0x3e3717,'name');_0x211ceb[_0xfd40('0x2c')]=_[_0xfd40('0x4')](_0xede742[_0xfd40('0x2c')]);_0x211ceb['filters']=_[_0xfd40('0x2e')](_0x211ceb[_0xfd40('0x2f')],_0x211ceb[_0xfd40('0x2c')]);_0x107165[_0xfd40('0x30')]=_['intersection'](_0x211ceb['model'],this['fields'](_0xede742['query'][_0xfd40('0x5')]));_0x107165['attributes']=_0x107165['attributes']['length']?_0x107165['attributes']:_0x211ceb[_0xfd40('0x2f')];if(!_0xede742['query'][_0xfd40('0x21')](_0xfd40('0x31'))){_0x107165[_0xfd40('0x12')]=this[_0xfd40('0x12')](_0xede742['query']['limit']);_0x107165[_0xfd40('0x32')]=this[_0xfd40('0x32')](_0xede742[_0xfd40('0x2c')][_0xfd40('0x32')]);}_0x107165[_0xfd40('0x33')]=this[_0xfd40('0x13')](_0xede742[_0xfd40('0x2c')]['sort']);_0x107165['where']=this['filters'](_['pick'](_0xede742[_0xfd40('0x2c')],_0x211ceb[_0xfd40('0x7')]),_0x3e3717);if(_0xede742['query'][_0xfd40('0x34')]){_0x107165[_0xfd40('0x35')]=_['merge'](_0x107165[_0xfd40('0x35')],{'$or':_[_0xfd40('0x14')](_0x3e3717,function(_0x23cbe1){if(_0x23cbe1[_0xfd40('0xa')]!==_0xfd40('0x36')){if(_0x5309a6){return sequelize['where'](sequelize['fn'](_0xfd40('0x37'),sequelize['col'](_0x23cbe1[_0xfd40('0x38')])),{'$like':sequelize['fn'](_0xfd40('0x37'),'%'+_0xede742[_0xfd40('0x2c')]['filter']+'%')});}else{var _0x1a102d={};_0x1a102d[_0x23cbe1[_0xfd40('0x38')]]={'$like':'%'+_0xede742['query'][_0xfd40('0x34')]+'%'};return _0x1a102d;}}})});}_0x107165=_[_0xfd40('0x39')]({},_0x107165,_0xede742[_0xfd40('0x3a')]);return _0x107165;};
\ No newline at end of file
index 1a1df7d..be311d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcd4=['passport','moment','./environment','default','get','production','appPath','join','root','development','test','set','client','json\x20replacer','toISOString','split','use','static','views','/server/views','engine','html','ejs','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0xdcd4,0x99));var _0x4dcd=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdcd4[_0x5b644e];return _0x49c6bf;};'use strict';var express=require(_0x4dcd('0x0'));var favicon=require(_0x4dcd('0x1'));var bodyParser=require(_0x4dcd('0x2'));var methodOverride=require(_0x4dcd('0x3'));var cookieParser=require(_0x4dcd('0x4'));var errorHandler=require(_0x4dcd('0x5'));var path=require(_0x4dcd('0x6'));var passport=require(_0x4dcd('0x7'));var cors=require('cors');var moment=require(_0x4dcd('0x8'));var config=require(_0x4dcd('0x9'));var db=require('../mysqldb')['db'];exports[_0x4dcd('0xa')]=function(_0x426d0d){var _0x3298d4=_0x426d0d[_0x4dcd('0xb')]('env');if(_0x3298d4===_0x4dcd('0xc')){_0x426d0d['set'](_0x4dcd('0xd'),path[_0x4dcd('0xe')](config[_0x4dcd('0xf')],'public'));}if(_0x3298d4===_0x4dcd('0x10')||_0x3298d4===_0x4dcd('0x11')){_0x426d0d[_0x4dcd('0x12')]('appPath',path[_0x4dcd('0xe')](config[_0x4dcd('0xf')],_0x4dcd('0x13')));_0x426d0d['use'](errorHandler());}_0x426d0d[_0x4dcd('0x12')](_0x4dcd('0x14'),function(_0x2a2cfa,_0xa23eb3){if(this[_0x2a2cfa]instanceof Date){_0xa23eb3=this[_0x2a2cfa][_0x4dcd('0x15')]()[_0x4dcd('0x16')]('.')[0x0]+'Z';}return _0xa23eb3;});_0x426d0d[_0x4dcd('0x17')](express[_0x4dcd('0x18')](_0x426d0d[_0x4dcd('0xb')](_0x4dcd('0xd'))));_0x426d0d['set'](_0x4dcd('0x19'),config[_0x4dcd('0xf')]+_0x4dcd('0x1a'));_0x426d0d[_0x4dcd('0x1b')](_0x4dcd('0x1c'),require(_0x4dcd('0x1d'))['renderFile']);_0x426d0d[_0x4dcd('0x12')]('view\x20engine','html');_0x426d0d[_0x4dcd('0x17')](bodyParser['urlencoded']({'limit':_0x4dcd('0x1e'),'extended':!![]}));_0x426d0d[_0x4dcd('0x17')](bodyParser['json']({'limit':_0x4dcd('0x1e')}));_0x426d0d[_0x4dcd('0x17')](cors());_0x426d0d[_0x4dcd('0x17')](methodOverride());_0x426d0d[_0x4dcd('0x17')](cookieParser());_0x426d0d['use'](passport[_0x4dcd('0x1f')]());};
\ No newline at end of file
+var _0x7360=['json\x20replacer','split','static','views','/server/views','engine','renderFile','view\x20engine','html','urlencoded','50mb','express','serve-favicon','method-override','cookie-parser','path','cors','moment','./environment','../mysqldb','default','get','env','set','appPath','join','root','public','development','use'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0x7360,0xa1));var _0x0736=function(_0x22a176,_0x1fa892){_0x22a176=_0x22a176-0x0;var _0x539b0f=_0x7360[_0x22a176];return _0x539b0f;};'use strict';var express=require(_0x0736('0x0'));var favicon=require(_0x0736('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x0736('0x2'));var cookieParser=require(_0x0736('0x3'));var errorHandler=require('errorhandler');var path=require(_0x0736('0x4'));var passport=require('passport');var cors=require(_0x0736('0x5'));var moment=require(_0x0736('0x6'));var config=require(_0x0736('0x7'));var db=require(_0x0736('0x8'))['db'];exports[_0x0736('0x9')]=function(_0x594988){var _0x368293=_0x594988[_0x0736('0xa')](_0x0736('0xb'));if(_0x368293==='production'){_0x594988[_0x0736('0xc')](_0x0736('0xd'),path[_0x0736('0xe')](config[_0x0736('0xf')],_0x0736('0x10')));}if(_0x368293===_0x0736('0x11')||_0x368293==='test'){_0x594988[_0x0736('0xc')](_0x0736('0xd'),path[_0x0736('0xe')](config[_0x0736('0xf')],'client'));_0x594988[_0x0736('0x12')](errorHandler());}_0x594988[_0x0736('0xc')](_0x0736('0x13'),function(_0xd931e6,_0x343f31){if(this[_0xd931e6]instanceof Date){_0x343f31=this[_0xd931e6]['toISOString']()[_0x0736('0x14')]('.')[0x0]+'Z';}return _0x343f31;});_0x594988[_0x0736('0x12')](express[_0x0736('0x15')](_0x594988['get'](_0x0736('0xd'))));_0x594988[_0x0736('0xc')](_0x0736('0x16'),config[_0x0736('0xf')]+_0x0736('0x17'));_0x594988[_0x0736('0x18')]('html',require('ejs')[_0x0736('0x19')]);_0x594988[_0x0736('0xc')](_0x0736('0x1a'),_0x0736('0x1b'));_0x594988[_0x0736('0x12')](bodyParser[_0x0736('0x1c')]({'limit':_0x0736('0x1d'),'extended':!![]}));_0x594988[_0x0736('0x12')](bodyParser['json']({'limit':'50mb'}));_0x594988[_0x0736('0x12')](cors());_0x594988[_0x0736('0x12')](methodOverride());_0x594988[_0x0736('0x12')](cookieParser());_0x594988[_0x0736('0x12')](passport['initialize']());};
\ No newline at end of file
index c17e322..8793037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69ed=['utf8','hostname','macAddress','md5','substring','child_process','execSync','../environment','orderBy','keys','length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','map','createHash','update','digest','hex','getUuid','test','licenseToken'];(function(_0x56b554,_0x211b56){var _0xd0ce6d=function(_0x5eac66){while(--_0x5eac66){_0x56b554['push'](_0x56b554['shift']());}};_0xd0ce6d(++_0x211b56);}(_0x69ed,0x1a9));var _0xd69e=function(_0x594ec5,_0x101a66){_0x594ec5=_0x594ec5-0x0;var _0x530c6f=_0x69ed[_0x594ec5];return _0x530c6f;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0xd69e('0x0'))[_0xd69e('0x1')];var config=require(_0xd69e('0x2'));function getInterfaces(){var _0x5d3916=[];var _0x2d5f3a=os['networkInterfaces']();var _0x775c37=_[_0xd69e('0x3')](_[_0xd69e('0x4')](_0x2d5f3a));for(var _0x47157a=0x0;_0x47157a<_0x775c37[_0xd69e('0x5')];_0x47157a++){var _0x17e829=_0x2d5f3a[_0x775c37[_0x47157a]]['filter'](function(_0x33df32){return _0x33df32[_0xd69e('0x6')]===_0xd69e('0x7')&&_0x33df32[_0xd69e('0x8')]===![];});_0x5d3916=_0x5d3916[_0xd69e('0x9')](_0x17e829);}return _0x5d3916;}function getFirstInterface(){var _0x2a8c6d=_[_0xd69e('0xa')](getInterfaces());return{'macAddress':_0x2a8c6d&&_0x2a8c6d[_0xd69e('0xb')]?_0x2a8c6d[_0xd69e('0xb')]:_0xd69e('0xc'),'ipAddress':_0x2a8c6d&&_0x2a8c6d['address']?_0x2a8c6d['address']:_0xd69e('0xd')};}exports[_0xd69e('0xe')]=getFirstInterface;function getCPUhash(){var _0x4cf0af=_[_0xd69e('0x3')](os['cpus']()[_0xd69e('0xf')](function(_0x40d7d4){return _0x40d7d4['model'];}))['join'](':');return crypto[_0xd69e('0x10')]('md5')[_0xd69e('0x11')](_0x4cf0af)[_0xd69e('0x12')](_0xd69e('0x13'));}exports[_0xd69e('0x14')]=function(){var _0x322882=os['platform']();var _0x11b42e=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x11b42e[_0xd69e('0x15')](config['licenseToken'])){return config[_0xd69e('0x16')];}else if(_0x322882==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xd69e('0x17')})['replace']('\x0d\x0a','');}else{var _0x5899a6=getFirstInterface();var _0xdc4580=getCPUhash();var _0x370136=_0xdc4580+'|'+os[_0xd69e('0x18')]()+'|'+_0x5899a6[_0xd69e('0x19')]+'|'+_0x5899a6['ipAddress'];var _0x24d262=crypto[_0xd69e('0x10')](_0xd69e('0x1a'))[_0xd69e('0x11')](_0x370136)[_0xd69e('0x12')](_0xd69e('0x13'));return _0x24d262[_0xd69e('0x1b')](0x0,0x8)+'-'+_0x24d262[_0xd69e('0x1b')](0x8,0xc)+'-'+_0x24d262[_0xd69e('0x1b')](0xc,0x10)+'-'+_0x24d262[_0xd69e('0x1b')](0x10,0x14)+'-'+_0x24d262[_0xd69e('0x1b')](0x14);}};
\ No newline at end of file
+var _0xb560=['../environment','keys','length','filter','internal','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','getUuid','platform','licenseToken','test','win32','replace','hostname','macAddress','ipAddress','hex','substring','bimedia-machine-uuid','child_process','execSync'];(function(_0x4b5325,_0x5bc67f){var _0x3d8fe5=function(_0x5c0b5e){while(--_0x5c0b5e){_0x4b5325['push'](_0x4b5325['shift']());}};_0x3d8fe5(++_0x5bc67f);}(_0xb560,0x152));var _0x0b56=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb560[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x0b56('0x0'));var exec=require(_0x0b56('0x1'))[_0x0b56('0x2')];var config=require(_0x0b56('0x3'));function getInterfaces(){var _0x1451c0=[];var _0x233dcd=os['networkInterfaces']();var _0x34ee88=_['orderBy'](_[_0x0b56('0x4')](_0x233dcd));for(var _0x959964=0x0;_0x959964<_0x34ee88[_0x0b56('0x5')];_0x959964++){var _0x2c5601=_0x233dcd[_0x34ee88[_0x959964]][_0x0b56('0x6')](function(_0x57fd9c){return _0x57fd9c['family']==='IPv4'&&_0x57fd9c[_0x0b56('0x7')]===![];});_0x1451c0=_0x1451c0['concat'](_0x2c5601);}return _0x1451c0;}function getFirstInterface(){var _0x3976b5=_['head'](getInterfaces());return{'macAddress':_0x3976b5&&_0x3976b5[_0x0b56('0x8')]?_0x3976b5[_0x0b56('0x8')]:_0x0b56('0x9'),'ipAddress':_0x3976b5&&_0x3976b5[_0x0b56('0xa')]?_0x3976b5[_0x0b56('0xa')]:'127.0.0.1'};}exports[_0x0b56('0xb')]=getFirstInterface;function getCPUhash(){var _0x7e1851=_['orderBy'](os[_0x0b56('0xc')]()[_0x0b56('0xd')](function(_0x10caca){return _0x10caca[_0x0b56('0xe')];}))[_0x0b56('0xf')](':');return crypto[_0x0b56('0x10')](_0x0b56('0x11'))[_0x0b56('0x12')](_0x7e1851)[_0x0b56('0x13')]('hex');}exports[_0x0b56('0x14')]=function(){var _0x87c907=os[_0x0b56('0x15')]();var _0x23edaf=/[0-9a-f-]{36}/;if(config[_0x0b56('0x16')]&&_0x23edaf[_0x0b56('0x17')](config[_0x0b56('0x16')])){return config[_0x0b56('0x16')];}else if(_0x87c907===_0x0b56('0x18')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x0b56('0x19')]('\x0d\x0a','');}else{var _0x2604f2=getFirstInterface();var _0x1a3154=getCPUhash();var _0x1733e5=_0x1a3154+'|'+os[_0x0b56('0x1a')]()+'|'+_0x2604f2[_0x0b56('0x1b')]+'|'+_0x2604f2[_0x0b56('0x1c')];var _0x43024f=crypto['createHash'](_0x0b56('0x11'))['update'](_0x1733e5)[_0x0b56('0x13')](_0x0b56('0x1d'));return _0x43024f['substring'](0x0,0x8)+'-'+_0x43024f['substring'](0x8,0xc)+'-'+_0x43024f[_0x0b56('0x1e')](0xc,0x10)+'-'+_0x43024f[_0x0b56('0x1e')](0x10,0x14)+'-'+_0x43024f[_0x0b56('0x1e')](0x14);}};
\ No newline at end of file
index a6382f9..0fd142b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc23c=['./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','version','GET','then','catch','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','spread','default','moment','request-promise','bluebird','pkginfo','../../components/encryptor'];(function(_0x4a0601,_0x44c481){var _0x2b018c=function(_0x49bfd8){while(--_0x49bfd8){_0x4a0601['push'](_0x4a0601['shift']());}};_0x2b018c(++_0x44c481);}(_0xc23c,0x19d));var _0xcc23=function(_0x36c777,_0x2616f2){_0x36c777=_0x36c777-0x0;var _0x8c2dc5=_0xc23c[_0x36c777];return _0x8c2dc5;};'use strict';var util=require('util');var moment=require(_0xcc23('0x0'));var rp=require(_0xcc23('0x1'));var BPromise=require(_0xcc23('0x2'));var pkginfo=require(_0xcc23('0x3'))(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0xcc23('0x4'));var hardware=require(_0xcc23('0x5'));var logger=require(_0xcc23('0x6'))(_0xcc23('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xd18f12){return new BPromise(function(_0x2dc23d,_0x32b685){var _0x469d1a=util[_0xcc23('0x8')](_0xcc23('0x9'),HOST,_0xd18f12,module[_0xcc23('0xa')][_0xcc23('0xb')]);if(oldToken){_0x469d1a=util[_0xcc23('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0xd18f12,module[_0xcc23('0xa')]['version'],oldToken);}var _0x3b3bf3={'uri':_0x469d1a,'method':_0xcc23('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3b3bf3)[_0xcc23('0xd')](function(_0x11112c){_0x2dc23d(_0x11112c);})[_0xcc23('0xe')](function(_0x3093b8){_0x32b685(_0x3093b8);});});}function manageLicense(_0x46dd69,_0x3bcab2){var _0x252fd3=_0x3bcab2[_0xcc23('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x252fd3['data1']!==_0x46dd69&&!_0x252fd3[_0xcc23('0x10')]){oldToken=_0x252fd3[_0xcc23('0x11')];}httpRequest(_0x46dd69)[_0xcc23('0xd')](function(_0x766006){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x766006[_0xcc23('0x12')]){isOldTokenSent=![];if(!_0x252fd3['license']&&_0x252fd3[_0xcc23('0x7')]!=_0x766006[_0xcc23('0x7')]||_0x252fd3[_0xcc23('0x7')]&&_0x252fd3['data2']){logger[_0xcc23('0x13')](_0xcc23('0x14'));}if(_0x252fd3[_0xcc23('0x7')]&&!_0x252fd3[_0xcc23('0x10')]&&_0x252fd3[_0xcc23('0x7')]!=_0x766006[_0xcc23('0x7')]){logger[_0xcc23('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x252fd3[_0xcc23('0x7')]&&!_0x252fd3[_0xcc23('0x10')]&&_0x252fd3[_0xcc23('0x7')]==_0x766006[_0xcc23('0x7')]){return _0x3bcab2;}return _0x3bcab2[_0xcc23('0x15')]({'data1':_0x46dd69,'data2':null,'license':_0x766006[_0xcc23('0x7')]});}else{if(_0x766006['license']||_0x252fd3[_0xcc23('0x7')]){if(!_0x252fd3['data2']){if(_0x252fd3[_0xcc23('0x11')]==_0x46dd69){GRAY_PERIOD_REASON=_0xcc23('0x16');logger[_0xcc23('0x13')](_0xcc23('0x17'));}else{GRAY_PERIOD_REASON=_0xcc23('0x18');logger[_0xcc23('0x13')](_0xcc23('0x19'),_0x252fd3[_0xcc23('0x11')],_0x46dd69);}logger[_0xcc23('0x13')](_0xcc23('0x1a'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xcc23('0x8')](_0xcc23('0x1b')));return _0x3bcab2[_0xcc23('0x15')]({'data2':encryptor[_0xcc23('0x1c')](moment()['format'](_0xcc23('0x1b')))});}else{if(moment()[_0xcc23('0x1d')](encryptor['decryptString'](_0x252fd3['data2']),_0xcc23('0x1e'))>DAYS){logger[_0xcc23('0x13')](_0xcc23('0x1f'),moment()[_0xcc23('0x8')](_0xcc23('0x1b')));isOldTokenSent=![];return _0x3bcab2[_0xcc23('0x15')]({'data1':_0x46dd69,'data2':null,'license':null});}}}else{if(_0x252fd3[_0xcc23('0x11')]!=_0x46dd69){logger[_0xcc23('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x252fd3['data1'],_0x46dd69);return _0x3bcab2[_0xcc23('0x15')]({'data1':_0x46dd69,'data2':null,'license':null});}}}return _0x3bcab2;})[_0xcc23('0xd')](function(_0x2b8b24){_0x3bcab2=_0x2b8b24;})[_0xcc23('0xe')](function(_0xd2ea41){logger[_0xcc23('0x20')](_0xd2ea41[_0xcc23('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xcc23('0x22')](),_0x3bcab2);},TIME);});}function defaultLicense(){var _0x10be33=hardware[_0xcc23('0x22')]();if(_0x10be33){return db[_0xcc23('0x23')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x10be33}})[_0xcc23('0x24')](function(_0x219f64,_0x4957ed){logger[_0xcc23('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x10be33);manageLicense(_0x10be33,_0x219f64);})[_0xcc23('0xe')](function(_0x3bab91){logger[_0xcc23('0x20')](_0x3bab91[_0xcc23('0x21')]);});}}exports[_0xcc23('0x25')]=defaultLicense;
\ No newline at end of file
+var _0xdd25=['../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','getUuid','License','findOrCreate','default','util','moment','bluebird','pkginfo','version','../../mysqldb'];(function(_0x21443b,_0x30392c){var _0x43b634=function(_0x4d39db){while(--_0x4d39db){_0x21443b['push'](_0x21443b['shift']());}};_0x43b634(++_0x30392c);}(_0xdd25,0xe8));var _0x5dd2=function(_0x4d74b5,_0x2b21a2){_0x4d74b5=_0x4d74b5-0x0;var _0x295d4b=_0xdd25[_0x4d74b5];return _0x295d4b;};'use strict';var util=require(_0x5dd2('0x0'));var moment=require(_0x5dd2('0x1'));var rp=require('request-promise');var BPromise=require(_0x5dd2('0x2'));var pkginfo=require(_0x5dd2('0x3'))(module,_0x5dd2('0x4'));var db=require(_0x5dd2('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0x5dd2('0x6'))('license');var HOST=_0x5dd2('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x52bb0e){return new BPromise(function(_0xb75ca3,_0x3cbfbd){var _0x356168=util[_0x5dd2('0x8')](_0x5dd2('0x9'),HOST,_0x52bb0e,module[_0x5dd2('0xa')][_0x5dd2('0x4')]);if(oldToken){_0x356168=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x52bb0e,module['exports'][_0x5dd2('0x4')],oldToken);}var _0x4e7a8b={'uri':_0x356168,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4e7a8b)[_0x5dd2('0xb')](function(_0x295275){_0xb75ca3(_0x295275);})[_0x5dd2('0xc')](function(_0x9fe7e7){_0x3cbfbd(_0x9fe7e7);});});}function manageLicense(_0x42f083,_0x3611e8){var _0x20f265=_0x3611e8[_0x5dd2('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x20f265[_0x5dd2('0xe')]!==_0x42f083&&!_0x20f265[_0x5dd2('0xf')]){oldToken=_0x20f265[_0x5dd2('0xe')];}httpRequest(_0x42f083)['then'](function(_0x3fa42c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3fa42c[_0x5dd2('0x10')]){isOldTokenSent=![];if(!_0x20f265['license']&&_0x20f265[_0x5dd2('0x11')]!=_0x3fa42c['license']||_0x20f265[_0x5dd2('0x11')]&&_0x20f265[_0x5dd2('0xf')]){logger[_0x5dd2('0x12')](_0x5dd2('0x13'));}if(_0x20f265[_0x5dd2('0x11')]&&!_0x20f265['data2']&&_0x20f265[_0x5dd2('0x11')]!=_0x3fa42c['license']){logger['info'](_0x5dd2('0x14'));}if(_0x20f265[_0x5dd2('0x11')]&&!_0x20f265[_0x5dd2('0xf')]&&_0x20f265['license']==_0x3fa42c[_0x5dd2('0x11')]){return _0x3611e8;}return _0x3611e8[_0x5dd2('0x15')]({'data1':_0x42f083,'data2':null,'license':_0x3fa42c['license']});}else{if(_0x3fa42c[_0x5dd2('0x11')]||_0x20f265[_0x5dd2('0x11')]){if(!_0x20f265[_0x5dd2('0xf')]){if(_0x20f265[_0x5dd2('0xe')]==_0x42f083){GRAY_PERIOD_REASON=_0x5dd2('0x16');logger[_0x5dd2('0x12')](_0x5dd2('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x20f265[_0x5dd2('0xe')],_0x42f083);}logger[_0x5dd2('0x12')](_0x5dd2('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x5dd2('0x19')));return _0x3611e8[_0x5dd2('0x15')]({'data2':encryptor[_0x5dd2('0x1a')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x5dd2('0x1b')](encryptor[_0x5dd2('0x1c')](_0x20f265[_0x5dd2('0xf')]),_0x5dd2('0x1d'))>DAYS){logger[_0x5dd2('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0x5dd2('0x8')](_0x5dd2('0x19')));isOldTokenSent=![];return _0x3611e8['update']({'data1':_0x42f083,'data2':null,'license':null});}}}else{if(_0x20f265['data1']!=_0x42f083){logger[_0x5dd2('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x20f265[_0x5dd2('0xe')],_0x42f083);return _0x3611e8[_0x5dd2('0x15')]({'data1':_0x42f083,'data2':null,'license':null});}}}return _0x3611e8;})[_0x5dd2('0xb')](function(_0x4e0638){_0x3611e8=_0x4e0638;})[_0x5dd2('0xc')](function(_0x289681){logger['error'](_0x289681['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x5dd2('0x1e')](),_0x3611e8);},TIME);});}function defaultLicense(){var _0x173e5d=hardware[_0x5dd2('0x1e')]();if(_0x173e5d){return db[_0x5dd2('0x1f')][_0x5dd2('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x173e5d}})['spread'](function(_0x551098,_0x53a3ce){logger[_0x5dd2('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x173e5d);manageLicense(_0x173e5d,_0x551098);})[_0x5dd2('0xc')](function(_0x4b2285){logger['error'](_0x4b2285['message']);});}}exports[_0x5dd2('0x21')]=defaultLicense;
\ No newline at end of file
index 70b6a7d..c3889ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b97=['catch','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','license','isEmpty','data2','split','format','%s:%s:%s','parse','demo','gray','deadline','days','grayReason','machineUuid','disabled','message','User','findAll','role','sequelize','col','count','admin','user','telephone','users','forEach'];(function(_0x2ecc68,_0x3694a8){var _0xc24394=function(_0x3c5602){while(--_0x3c5602){_0x2ecc68['push'](_0x2ecc68['shift']());}};_0xc24394(++_0x3694a8);}(_0x2b97,0x13f));var _0x72b9=function(_0xdec2f0,_0x1cf1c7){_0xdec2f0=_0xdec2f0-0x0;var _0x1d5c6e=_0x2b97[_0xdec2f0];return _0x1d5c6e;};'use strict';var util=require(_0x72b9('0x0'));var _=require(_0x72b9('0x1'));var moment=require(_0x72b9('0x2'));var BPromise=require(_0x72b9('0x3'));var hardware=require('./hardware');var encryptor=require(_0x72b9('0x4'));var db=require(_0x72b9('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x72b9('0x6'),'machineUuid':hardware[_0x72b9('0x7')](),'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':_0x72b9('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x270841){return new BPromise(function(_0x23dab8,_0x28c69c){return db[_0x72b9('0x9')][_0x72b9('0xa')](_[_0x72b9('0xb')](_0x270841,{'raw':!![],'where':{'id':0x1}}))[_0x72b9('0xc')](function(_0x1ccd39){return checkLicense(_0x1ccd39,null);})['then'](function(_0x338205){_0x23dab8(_0x338205);return;})['catch'](function(_0x4c7a72){_0x28c69c(_0x4c7a72);});});}function checkLicense(_0x3a0fb2,_0x5aa476){if(!_0x3a0fb2){demoLicense[_0x72b9('0xd')]=_0x3a0fb2[_0x72b9('0xe')];return demoLicense;}try{var _0xa72f62=_0x5aa476||_0x3a0fb2[_0x72b9('0xf')];if(_[_0x72b9('0x10')](_0xa72f62)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x357bfd=_0x3a0fb2[_0x72b9('0xe')];var _0x33ded3=_0x3a0fb2[_0x72b9('0x11')];var _0x164dd8=_0x357bfd[_0x72b9('0x12')]('-')[0x4];var _0xfea392=_0x357bfd[_0x72b9('0x12')]('-')[0x0];var _0x1b08b0=encryptor['decryptString'](_0xa72f62,util[_0x72b9('0x13')](_0x72b9('0x14'),_0x164dd8,_0x357bfd,_0xfea392));var _0x328949=JSON[_0x72b9('0x15')](_0x1b08b0);_0x328949[_0x72b9('0x16')]=![];_0x328949[_0x72b9('0xd')]=_0x357bfd;_0x328949['machineUuid']=hardware[_0x72b9('0x7')]();if(_0x33ded3){var _0x5dcfbe=encryptor['decryptString'](_0x33ded3);_0x328949[_0x72b9('0x17')]=_0x5dcfbe;_0x328949[_0x72b9('0x18')]=moment(_0x5dcfbe)['add'](0x7,_0x72b9('0x19'))[_0x72b9('0x13')]();_0x328949[_0x72b9('0x1a')]=_0x328949[_0x72b9('0xd')]!=_0x328949[_0x72b9('0x1b')]?'changed':_0x72b9('0x1c');}return _0x328949;}catch(_0x62074c){breakingLicense[_0x72b9('0xd')]=_0x3a0fb2[_0x72b9('0xe')];breakingLicense[_0x72b9('0x1d')]=_0x62074c[_0x72b9('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2fccd4,_0xe03907){getLicense()[_0x72b9('0xc')](function(_0x32cf36){return db[_0x72b9('0x1e')][_0x72b9('0x1f')]({'attributes':[_0x72b9('0x20'),[db['sequelize']['fn']('COUNT',db[_0x72b9('0x21')][_0x72b9('0x22')]('role')),_0x72b9('0x23')]],'group':_0x72b9('0x20'),'where':{'role':{'$or':[_0x72b9('0x24'),_0x72b9('0x25'),_0x72b9('0x26')]}},'raw':!![]})['then'](function(_0x1bde74){var _0x599805={'user':_0x32cf36[_0x72b9('0x27')]||0x0,'telephone':_0x32cf36['telephones']||0x0};_0x1bde74[_0x72b9('0x28')](function(_0x65e81e){var _0x118069=_0x65e81e['role']===_0x72b9('0x24')?_0x72b9('0x25'):_0x65e81e['role'];_0x599805[_0x118069]-=_0x65e81e[_0x72b9('0x23')];if(_0x599805[_0x118069]<0x0)_0x599805[_0x118069]=0x0;});_0x2fccd4(_0x599805);return;});})[_0x72b9('0x29')](function(_0xb0bc7a){_0xe03907(_0xb0bc7a);});});}function checkUserLimits(_0x42eccb){return new BPromise(function(_0x147a71,_0x2a1114){getLimits()['then'](function(_0x2e44cf){var _0x1663d8=_['pick'](_[_0x72b9('0x2a')](_0x42eccb,_0x72b9('0x20')),['admin','user','telephone']);var _0x746b38=(_0x1663d8[_0x72b9('0x24')]||0x0)+(_0x1663d8[_0x72b9('0x25')]||0x0);var _0x3110db=_0x1663d8[_0x72b9('0x26')]||0x0;if(_0x746b38>_0x2e44cf[_0x72b9('0x25')])return _0x2a1114(_0x72b9('0x2b'));if(_0x3110db>_0x2e44cf[_0x72b9('0x26')])return _0x2a1114('License\x20limit\x20reached\x20for\x20telephones');return _0x147a71();})[_0x72b9('0x29')](function(_0x1aada7){_0x2a1114(_0x1aada7);});});}module[_0x72b9('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x0c61=['disabled','message','User','findAll','role','COUNT','sequelize','admin','user','telephone','telephones','forEach','count','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','../../mysqldb','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0x0c61,0x17b));var _0x10c6=function(_0x322bef,_0x4890d4){_0x322bef=_0x322bef-0x0;var _0x229e60=_0x0c61[_0x322bef];return _0x229e60;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x10c6('0x0'));var BPromise=require(_0x10c6('0x1'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x10c6('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x10c6('0x3'),'machineUuid':hardware[_0x10c6('0x4')](),'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':_0x10c6('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5af73b){return new BPromise(function(_0x2d3d72,_0x32c6f0){return db[_0x10c6('0x6')][_0x10c6('0x7')](_[_0x10c6('0x8')](_0x5af73b,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5cc6e7){return checkLicense(_0x5cc6e7,null);})[_0x10c6('0x9')](function(_0x45c25f){_0x2d3d72(_0x45c25f);return;})['catch'](function(_0x3c1c9e){_0x32c6f0(_0x3c1c9e);});});}function checkLicense(_0x2c6dda,_0x5c5370){if(!_0x2c6dda){demoLicense[_0x10c6('0xa')]=_0x2c6dda[_0x10c6('0xb')];return demoLicense;}try{var _0x459c9a=_0x5c5370||_0x2c6dda[_0x10c6('0xc')];if(_[_0x10c6('0xd')](_0x459c9a)){throw new Error(_0x10c6('0xe'));}var _0x9cbc30=_0x2c6dda[_0x10c6('0xb')];var _0x339e33=_0x2c6dda['data2'];var _0x552109=_0x9cbc30[_0x10c6('0xf')]('-')[0x4];var _0x21cb1e=_0x9cbc30[_0x10c6('0xf')]('-')[0x0];var _0x5b060c=encryptor[_0x10c6('0x10')](_0x459c9a,util[_0x10c6('0x11')](_0x10c6('0x12'),_0x552109,_0x9cbc30,_0x21cb1e));var _0x5cb332=JSON[_0x10c6('0x13')](_0x5b060c);_0x5cb332[_0x10c6('0x14')]=![];_0x5cb332[_0x10c6('0xa')]=_0x9cbc30;_0x5cb332[_0x10c6('0x15')]=hardware[_0x10c6('0x4')]();if(_0x339e33){var _0x2d8551=encryptor['decryptString'](_0x339e33);_0x5cb332[_0x10c6('0x16')]=_0x2d8551;_0x5cb332[_0x10c6('0x17')]=moment(_0x2d8551)[_0x10c6('0x18')](0x7,_0x10c6('0x19'))[_0x10c6('0x11')]();_0x5cb332['grayReason']=_0x5cb332[_0x10c6('0xa')]!=_0x5cb332[_0x10c6('0x15')]?'changed':_0x10c6('0x1a');}return _0x5cb332;}catch(_0x2973ee){breakingLicense[_0x10c6('0xa')]=_0x2c6dda[_0x10c6('0xb')];breakingLicense[_0x10c6('0x1b')]=_0x2973ee[_0x10c6('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x27685c,_0x3ea328){getLicense()[_0x10c6('0x9')](function(_0x516a60){return db[_0x10c6('0x1c')][_0x10c6('0x1d')]({'attributes':[_0x10c6('0x1e'),[db['sequelize']['fn'](_0x10c6('0x1f'),db[_0x10c6('0x20')]['col']('role')),'count']],'group':_0x10c6('0x1e'),'where':{'role':{'$or':[_0x10c6('0x21'),_0x10c6('0x22'),_0x10c6('0x23')]}},'raw':!![]})[_0x10c6('0x9')](function(_0x36262d){var _0x386dc7={'user':_0x516a60['users']||0x0,'telephone':_0x516a60[_0x10c6('0x24')]||0x0};_0x36262d[_0x10c6('0x25')](function(_0x2147a4){var _0x29dc7b=_0x2147a4['role']==='admin'?'user':_0x2147a4['role'];_0x386dc7[_0x29dc7b]-=_0x2147a4[_0x10c6('0x26')];if(_0x386dc7[_0x29dc7b]<0x0)_0x386dc7[_0x29dc7b]=0x0;});_0x27685c(_0x386dc7);return;});})[_0x10c6('0x27')](function(_0x4297d4){_0x3ea328(_0x4297d4);});});}function checkUserLimits(_0x223c45){return new BPromise(function(_0x48aa09,_0x4a3265){getLimits()['then'](function(_0x5cb6cf){var _0x4eb44d=_[_0x10c6('0x28')](_[_0x10c6('0x29')](_0x223c45,_0x10c6('0x1e')),[_0x10c6('0x21'),_0x10c6('0x22'),_0x10c6('0x23')]);var _0x1cfb8e=(_0x4eb44d[_0x10c6('0x21')]||0x0)+(_0x4eb44d['user']||0x0);var _0x1c61f8=_0x4eb44d[_0x10c6('0x23')]||0x0;if(_0x1cfb8e>_0x5cb6cf['user'])return _0x4a3265(_0x10c6('0x2a'));if(_0x1c61f8>_0x5cb6cf[_0x10c6('0x23')])return _0x4a3265(_0x10c6('0x2b'));return _0x48aa09();})[_0x10c6('0x27')](function(_0x1374f5){_0x4a3265(_0x1374f5);});});}module[_0x10c6('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 26fa262..9b552d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x14408e,_0x5d025f){var _0x4c3981=function(_0x586ffc){while(--_0x586ffc){_0x14408e['push'](_0x14408e['shift']());}};_0x4c3981(++_0x5d025f);}(_0x14a0,0x8e));var _0x014a=function(_0x9f0a0b,_0x4185f7){_0x9f0a0b=_0x9f0a0b-0x0;var _0x15593d=_0x14a0[_0x9f0a0b];return _0x15593d;};'use strict';module['exports']={'DOMAIN':_0x014a('0x0'),'SESSION_SECRET':_0x014a('0x1'),'GOOGLE_ID':_0x014a('0x2'),'GOOGLE_SECRET':_0x014a('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0x065e=['secret','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x065e,0x1a7));var _0xe065=function(_0x481657,_0x3f66e4){_0x481657=_0x481657-0x0;var _0x2e5568=_0x065e[_0x481657];return _0x2e5568;};'use strict';module[_0xe065('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe065('0x1'),'DEBUG':''};
\ No newline at end of file
index 10636a2..73d7d7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa35a=['path','INFO','join','/var','log','xcally','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','level','toUpperCase','exports','Logger','transports','%s-%s','error','File','info','debugLevel','moment','winston','util'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0xa35a,0x99));var _0xaa35=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xa35a[_0x35885a];return _0xe86249;};'use strict';var moment=require(_0xaa35('0x0'));var winston=require(_0xaa35('0x1'));var util=require(_0xaa35('0x2'));var path=require(_0xaa35('0x3'));var debugLevel=_0xaa35('0x4');function filename(_0x159d5f,_0x4ce829){return path[_0xaa35('0x5')](_0xaa35('0x6'),_0xaa35('0x7'),_0xaa35('0x8'),util['format'](_0xaa35('0x9'),_0x159d5f,_0x4ce829));}function formatter(_0x3702b3,_0x4607f6){_0x4607f6[_0xaa35('0xa')]=_0x4607f6['message'][_0xaa35('0xb')](/@@{/g,_0xaa35('0xc'))[_0xaa35('0xb')](/}@@/g,_0xaa35('0xd'))[_0xaa35('0xb')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0xaa35('0xe'),moment()[_0xaa35('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4607f6[_0xaa35('0x10')][_0xaa35('0x11')](),_0x3702b3,_0x4607f6['message']);}module[_0xaa35('0x12')]=function(_0x160364){return new winston[(_0xaa35('0x13'))]({'transports':[new winston[(_0xaa35('0x14'))]['File']({'name':util[_0xaa35('0xf')](_0xaa35('0x15'),_0x160364,_0xaa35('0x16')),'filename':filename(_0x160364,_0xaa35('0x16')),'level':_0xaa35('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d0314){return formatter(_0x160364,_0x5d0314);}}),new winston[(_0xaa35('0x14'))][(_0xaa35('0x17'))]({'name':util[_0xaa35('0xf')](_0xaa35('0x15'),_0x160364,_0xaa35('0x18')),'filename':filename(_0x160364,'info'),'level':_0xaa35('0x18'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d66cc){return formatter(_0x160364,_0x5d66cc);}}),new winston[(_0xaa35('0x14'))]['Console']({'level':process['env'][_0xaa35('0x19')]||debugLevel,'json':![],'formatter':function(_0x5bfcb9){return formatter(_0x160364,_0x5bfcb9);}})]});};
\ No newline at end of file
+var _0x8b53=['File','error','info','debugLevel','moment','winston','util','join','/var','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','transports'];(function(_0x3675a1,_0x3f599a){var _0x29c14b=function(_0x586731){while(--_0x586731){_0x3675a1['push'](_0x3675a1['shift']());}};_0x29c14b(++_0x3f599a);}(_0x8b53,0xa4));var _0x38b5=function(_0x2fa24f,_0xdbc34d){_0x2fa24f=_0x2fa24f-0x0;var _0x37facf=_0x8b53[_0x2fa24f];return _0x37facf;};'use strict';var moment=require(_0x38b5('0x0'));var winston=require(_0x38b5('0x1'));var util=require(_0x38b5('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x13bd8a,_0x18d35c){return path[_0x38b5('0x3')](_0x38b5('0x4'),'log','xcally',util['format'](_0x38b5('0x5'),_0x13bd8a,_0x18d35c));}function formatter(_0x111ea6,_0x2b74f9){_0x2b74f9[_0x38b5('0x6')]=_0x2b74f9[_0x38b5('0x6')][_0x38b5('0x7')](/@@{/g,_0x38b5('0x8'))[_0x38b5('0x7')](/}@@/g,_0x38b5('0x9'))[_0x38b5('0x7')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x38b5('0xa')](_0x38b5('0xb'),moment()[_0x38b5('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),_0x2b74f9[_0x38b5('0xc')][_0x38b5('0xd')](),_0x111ea6,_0x2b74f9[_0x38b5('0x6')]);}module[_0x38b5('0xe')]=function(_0x44bbb6){return new winston['Logger']({'transports':[new winston[(_0x38b5('0xf'))][(_0x38b5('0x10'))]({'name':util['format']('%s-%s',_0x44bbb6,'error'),'filename':filename(_0x44bbb6,_0x38b5('0x11')),'level':_0x38b5('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb88343){return formatter(_0x44bbb6,_0xb88343);}}),new winston[(_0x38b5('0xf'))][(_0x38b5('0x10'))]({'name':util[_0x38b5('0xa')]('%s-%s',_0x44bbb6,_0x38b5('0x12')),'filename':filename(_0x44bbb6,_0x38b5('0x12')),'level':_0x38b5('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x25e8fe){return formatter(_0x44bbb6,_0x25e8fe);}}),new winston[(_0x38b5('0xf'))]['Console']({'level':process['env'][_0x38b5('0x13')]||debugLevel,'json':![],'formatter':function(_0x2ed33c){return formatter(_0x44bbb6,_0x2ed33c);}})]});};
\ No newline at end of file
index 65670a0..18e6a41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dd0=['../../services/routing/index.js','xdr','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing'];(function(_0xfc7adb,_0x2c0593){var _0x1d88bd=function(_0x344002){while(--_0x344002){_0xfc7adb['push'](_0xfc7adb['shift']());}};_0x1d88bd(++_0x2c0593);}(_0x4dd0,0x87));var _0x04dd=function(_0x539a19,_0x4971bc){_0x539a19=_0x539a19-0x0;var _0x5f3a91=_0x4dd0[_0x539a19];return _0x5f3a91;};'use strict';var path=require(_0x04dd('0x0'));var os=require('os');var config={'apps':[{'name':_0x04dd('0x1'),'script':path[_0x04dd('0x2')](__dirname,_0x04dd('0x3'))},{'name':_0x04dd('0x4'),'script':path[_0x04dd('0x2')](__dirname,_0x04dd('0x5'))},{'name':'agi','script':path[_0x04dd('0x2')](__dirname,_0x04dd('0x6'))},{'name':'email','script':path[_0x04dd('0x2')](__dirname,_0x04dd('0x7'))},{'name':_0x04dd('0x8'),'script':path[_0x04dd('0x2')](__dirname,_0x04dd('0x9'))},{'name':_0x04dd('0xa'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x04dd('0xb')]=config;
\ No newline at end of file
+var _0xfefc=['email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','join','../../services/express/index.js','../../services/ami/index.js','agi'];(function(_0x4ba437,_0x54a5a3){var _0x16993c=function(_0x3f00ae){while(--_0x3f00ae){_0x4ba437['push'](_0x4ba437['shift']());}};_0x16993c(++_0x54a5a3);}(_0xfefc,0x127));var _0xcfef=function(_0x70425c,_0x3cbc28){_0x70425c=_0x70425c-0x0;var _0x347cfa=_0xfefc[_0x70425c];return _0x347cfa;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xcfef('0x0'),'script':path[_0xcfef('0x1')](__dirname,_0xcfef('0x2'))},{'name':'ami','script':path[_0xcfef('0x1')](__dirname,_0xcfef('0x3'))},{'name':_0xcfef('0x4'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0xcfef('0x5'),'script':path[_0xcfef('0x1')](__dirname,_0xcfef('0x6'))},{'name':_0xcfef('0x7'),'script':path['join'](__dirname,_0xcfef('0x8'))},{'name':_0xcfef('0x9'),'script':path[_0xcfef('0x1')](__dirname,_0xcfef('0xa'))}]};module[_0xcfef('0xb')]=config;
\ No newline at end of file
index 34b16b8..db47c1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d5b=['then','restart','describe','delete','dump','pm2','bluebird','./config','connect','start','disconnect','stop'];(function(_0x4a6cc6,_0xdf5789){var _0x369abb=function(_0x1a73d0){while(--_0x1a73d0){_0x4a6cc6['push'](_0x4a6cc6['shift']());}};_0x369abb(++_0xdf5789);}(_0x4d5b,0xb9));var _0xb4d5=function(_0x4a03af,_0x7dae13){_0x4a03af=_0x4a03af-0x0;var _0x5b02ff=_0x4d5b[_0x4a03af];return _0x5b02ff;};'use strict';var pm2=require(_0xb4d5('0x0'));var BPromise=require(_0xb4d5('0x1'));var config=require(_0xb4d5('0x2'));function connect(){return new BPromise(function(_0xb86b91,_0x3d222d){return pm2[_0xb4d5('0x3')](function(_0x4d85d5){if(_0x4d85d5){return _0x3d222d(_0x4d85d5);}return _0xb86b91('connected');});});};exports[_0xb4d5('0x4')]=function(_0x152893){return connect()['then'](function(){return new BPromise(function(_0x371e56,_0x21709e){return pm2[_0xb4d5('0x4')](_0x152893,function(_0x1c794b,_0x271a22){if(_0x1c794b){return _0x21709e(_0x1c794b);}pm2[_0xb4d5('0x5')]();return _0x371e56(_0x271a22);});});});};exports[_0xb4d5('0x6')]=function(_0x13f119){return connect()[_0xb4d5('0x7')](function(){return new BPromise(function(_0x2fce01,_0x38971e){return pm2[_0xb4d5('0x6')](_0x13f119,function(_0x5e13e2,_0x7868cb){if(_0x5e13e2){return _0x38971e(_0x5e13e2);}pm2[_0xb4d5('0x5')]();return _0x2fce01(_0x7868cb);});});});};exports['restart']=function(_0x5c2e24){return connect()['then'](function(){return new BPromise(function(_0x1ef720,_0x49764c){return pm2[_0xb4d5('0x8')](_0x5c2e24,function(_0x340f56,_0x2b84bd){if(_0x340f56){return _0x49764c(_0x340f56);}pm2[_0xb4d5('0x5')]();return _0x1ef720(_0x2b84bd);});});});};exports['list']=function(){return connect()[_0xb4d5('0x7')](function(){return new BPromise(function(_0x153c70,_0xf199bd){return pm2['list'](function(_0x30f82b,_0x3b262d){if(_0x30f82b){return _0xf199bd(_0x30f82b);}pm2['disconnect']();return _0x153c70(_0x3b262d);});});});};exports[_0xb4d5('0x9')]=function(_0x2e74fc){return connect()[_0xb4d5('0x7')](function(){return new BPromise(function(_0x223669,_0x53372d){return pm2['describe'](_0x2e74fc,function(_0x4e6851,_0x4d9f62){if(_0x4e6851){return _0x53372d(_0x4e6851);}pm2['disconnect']();return _0x223669(_0x4d9f62);});});});};exports[_0xb4d5('0xa')]=function(_0x2ed324){return connect()[_0xb4d5('0x7')](function(){return new BPromise(function(_0x49d660,_0x58f228){return pm2[_0xb4d5('0xa')](_0x2ed324,function(_0x2a7a88,_0x297c61){if(_0x2a7a88){return _0x58f228(_0x2a7a88);}pm2[_0xb4d5('0x5')]();return _0x49d660(_0x297c61);});});});};exports[_0xb4d5('0xb')]=function(){return connect()[_0xb4d5('0x7')](function(){return new BPromise(function(_0x260683,_0x253022){return pm2[_0xb4d5('0xb')](function(_0x5e6944){if(_0x5e6944){return _0x253022(_0x5e6944);}return _0x260683('saved');});});});};
\ No newline at end of file
+var _0xf5e9=['list','describe','delete','dump','saved','pm2','./config','connected','start','then','stop','disconnect','restart'];(function(_0x1cb120,_0x11c645){var _0x537575=function(_0xd1d5ee){while(--_0xd1d5ee){_0x1cb120['push'](_0x1cb120['shift']());}};_0x537575(++_0x11c645);}(_0xf5e9,0x1e6));var _0x9f5e=function(_0x5b8608,_0x527731){_0x5b8608=_0x5b8608-0x0;var _0x3f8d3d=_0xf5e9[_0x5b8608];return _0x3f8d3d;};'use strict';var pm2=require(_0x9f5e('0x0'));var BPromise=require('bluebird');var config=require(_0x9f5e('0x1'));function connect(){return new BPromise(function(_0x3b87f5,_0x351767){return pm2['connect'](function(_0x2c0627){if(_0x2c0627){return _0x351767(_0x2c0627);}return _0x3b87f5(_0x9f5e('0x2'));});});};exports[_0x9f5e('0x3')]=function(_0x566533){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x1ab4d7,_0x5c6c9e){return pm2[_0x9f5e('0x3')](_0x566533,function(_0x2bb2ff,_0x470d07){if(_0x2bb2ff){return _0x5c6c9e(_0x2bb2ff);}pm2['disconnect']();return _0x1ab4d7(_0x470d07);});});});};exports[_0x9f5e('0x5')]=function(_0x15f344){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x53dcbe,_0x1ffc84){return pm2['stop'](_0x15f344,function(_0x3c2d4f,_0xabb469){if(_0x3c2d4f){return _0x1ffc84(_0x3c2d4f);}pm2[_0x9f5e('0x6')]();return _0x53dcbe(_0xabb469);});});});};exports[_0x9f5e('0x7')]=function(_0x329d25){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x3c2b9e,_0x5c5a3e){return pm2[_0x9f5e('0x7')](_0x329d25,function(_0x55de17,_0x2e4e3f){if(_0x55de17){return _0x5c5a3e(_0x55de17);}pm2['disconnect']();return _0x3c2b9e(_0x2e4e3f);});});});};exports[_0x9f5e('0x8')]=function(){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x20c855,_0x3d7aa9){return pm2[_0x9f5e('0x8')](function(_0x5ad87b,_0x59dbbb){if(_0x5ad87b){return _0x3d7aa9(_0x5ad87b);}pm2[_0x9f5e('0x6')]();return _0x20c855(_0x59dbbb);});});});};exports[_0x9f5e('0x9')]=function(_0x14627e){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x41fff5,_0x68a6cc){return pm2[_0x9f5e('0x9')](_0x14627e,function(_0x3f1baa,_0x44225b){if(_0x3f1baa){return _0x68a6cc(_0x3f1baa);}pm2[_0x9f5e('0x6')]();return _0x41fff5(_0x44225b);});});});};exports[_0x9f5e('0xa')]=function(_0x2c6ae5){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x329413,_0x368c1e){return pm2[_0x9f5e('0xa')](_0x2c6ae5,function(_0x3c79ad,_0xf57064){if(_0x3c79ad){return _0x368c1e(_0x3c79ad);}pm2[_0x9f5e('0x6')]();return _0x329413(_0xf57064);});});});};exports[_0x9f5e('0xb')]=function(){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x10eaed,_0xcd607c){return pm2[_0x9f5e('0xb')](function(_0x296d4d){if(_0x296d4d){return _0xcd607c(_0x296d4d);}return _0x10eaed(_0x9f5e('0xc'));});});});};
\ No newline at end of file
index 6003ae7..8715140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61a2=['start','util','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','length','[CHAT]\x20Interactions\x20to\x20close:','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x1439e6,_0x2634b8){var _0x1101a9=function(_0x591d44){while(--_0x591d44){_0x1439e6['push'](_0x1439e6['shift']());}};_0x1101a9(++_0x2634b8);}(_0x61a2,0x8d));var _0x261a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x61a2[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require(_0x261a('0x0'));var config=require('../../config/environment');var db=require(_0x261a('0x1'))['db'];var logger=require('../logger')(_0x261a('0x2'));config[_0x261a('0x3')]=_[_0x261a('0x4')](config[_0x261a('0x3')],{'host':_0x261a('0x5'),'port':0x18eb});var io=require(_0x261a('0x6'))(new Redis(config[_0x261a('0x3')]));function closeInteractions(){var _0x3e8a0e=0x0;var _0x44a24e=[];return db[_0x261a('0x7')][_0x261a('0x8')]({'raw':!![],'attributes':['id',_0x261a('0x9')],'where':{'id':0x1}})[_0x261a('0xa')](function(_0x27b361){_0x3e8a0e=_0x27b361['chatTimeout'];if(_0x3e8a0e){return db[_0x261a('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x261a('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x261a('0xd')](_0x27b361[_0x261a('0x9')],'minutes')}}});}else{return[];}})['then'](function(_0x587b55){if(_0x587b55&&_0x587b55[_0x261a('0xe')]){_0x44a24e=_['map'](_0x587b55||[],'id');logger['info'](_0x261a('0xf'),_0x44a24e[_0x261a('0x10')]());return db['ChatInteraction']['update']({'closeReason':'system','disposition':_0x261a('0x11'),'closed':!![],'closedAt':moment()[_0x261a('0x12')](_0x261a('0x13'))},{'where':{'id':_0x44a24e}});}})[_0x261a('0xa')](function(){if(_0x44a24e&&_0x44a24e[_0x261a('0xe')]){logger[_0x261a('0x14')](_0x261a('0x15'),_0x44a24e[_0x261a('0x10')]());for(var _0x46d022=0x0;_0x46d022<_0x44a24e[_0x261a('0xe')];_0x46d022++){io[_0x261a('0x16')](_0x261a('0x17'),{'id':_0x44a24e[_0x46d022],'closed':!![]});}}})[_0x261a('0x18')](function(_0x4d1da4){logger[_0x261a('0x19')](_0x261a('0x1a'),_0x4d1da4?util['inspect'](_0x4d1da4,{'showHidden':![],'depth':null}):'');});}exports[_0x261a('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x6037=['minutes','length','map','info','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','emit','catch','error','inspect','start','lodash','ioredis','util','../../mysqldb','redis','defaults','localhost','Setting','then','chatTimeout','subtract'];(function(_0x34f3d4,_0x5ae214){var _0x17f899=function(_0x14a5a2){while(--_0x14a5a2){_0x34f3d4['push'](_0x34f3d4['shift']());}};_0x17f899(++_0x5ae214);}(_0x6037,0x91));var _0x7603=function(_0x65eee,_0x5c7e7d){_0x65eee=_0x65eee-0x0;var _0x4da679=_0x6037[_0x65eee];return _0x4da679;};'use strict';var _=require(_0x7603('0x0'));var moment=require('moment');var Redis=require(_0x7603('0x1'));var util=require(_0x7603('0x2'));var config=require('../../config/environment');var db=require(_0x7603('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x7603('0x4')]=_[_0x7603('0x5')](config['redis'],{'host':_0x7603('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7603('0x4')]));function closeInteractions(){var _0x5b87d1=0x0;var _0x3ee0e2=[];return db[_0x7603('0x7')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x7603('0x8')](function(_0x45985a){_0x5b87d1=_0x45985a[_0x7603('0x9')];if(_0x5b87d1){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7603('0xa')](_0x45985a[_0x7603('0x9')],_0x7603('0xb'))}}});}else{return[];}})[_0x7603('0x8')](function(_0x2827fe){if(_0x2827fe&&_0x2827fe[_0x7603('0xc')]){_0x3ee0e2=_[_0x7603('0xd')](_0x2827fe||[],'id');logger[_0x7603('0xe')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3ee0e2[_0x7603('0xf')]());return db[_0x7603('0x10')][_0x7603('0x11')]({'closeReason':_0x7603('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x7603('0x13')](_0x7603('0x14'))},{'where':{'id':_0x3ee0e2}});}})[_0x7603('0x8')](function(){if(_0x3ee0e2&&_0x3ee0e2[_0x7603('0xc')]){logger[_0x7603('0xe')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3ee0e2[_0x7603('0xf')]());for(var _0x4868e1=0x0;_0x4868e1<_0x3ee0e2[_0x7603('0xc')];_0x4868e1++){io[_0x7603('0x15')]('chatInteraction:update',{'id':_0x3ee0e2[_0x4868e1],'closed':!![]});}}})[_0x7603('0x16')](function(_0xceb38f){logger[_0x7603('0x17')]('[CHAT]\x20Error\x20closing\x20interactions',_0xceb38f?util[_0x7603('0x18')](_0xceb38f,{'showHidden':![],'depth':null}):'');});}exports[_0x7603('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 90b15dc..53a9846 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6dd=['%s.%s','basename','extname','zip','join','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','cron','active','startAt','endAt','start','deleteJob','stop\x20cron','isBetween','update','util','lodash','moment','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','MailAccount','Smtp','service','host','port','secure','pass','\x22%s\x22\x20<%s>','name','user','bcc','format','subtractUnit','../../files/reports','savename'];(function(_0x2e1169,_0x54c4fe){var _0xcc4cb0=function(_0x541f81){while(--_0x541f81){_0x2e1169['push'](_0x2e1169['shift']());}};_0xcc4cb0(++_0x54c4fe);}(_0xc6dd,0xe4));var _0xdc6d=function(_0x129c34,_0x37a390){_0x129c34=_0x129c34-0x0;var _0x56cbd1=_0xc6dd[_0x129c34];return _0x56cbd1;};'use strict';var fs=require('fs');var util=require(_0xdc6d('0x0'));var path=require('path');var _=require(_0xdc6d('0x1'));var moment=require(_0xdc6d('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xdc6d('0x3'));var logger=require(_0xdc6d('0x4'))(_0xdc6d('0x5'));var db=require(_0xdc6d('0x6'))['db'];var analyticCustomReportController=require(_0xdc6d('0x7'));var analyticDefaultReportController=require(_0xdc6d('0x8'));var client=jayson[_0xdc6d('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x9dbeb2,_0x5d6bb2){return function(){logger[_0xdc6d('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x9dbeb2[_0xdc6d('0xb')]);var _0x3164d0=!![];var _0x3a27eb={'tls':{'rejectUnauthorized':![]}};if(_0x9dbeb2[_0xdc6d('0xc')][_0xdc6d('0xd')]['service']){_0x3a27eb['service']=_0x9dbeb2[_0xdc6d('0xc')][_0xdc6d('0xd')][_0xdc6d('0xe')];}else{_0x3a27eb['host']=_0x9dbeb2[_0xdc6d('0xc')][_0xdc6d('0xd')][_0xdc6d('0xf')];_0x3a27eb[_0xdc6d('0x10')]=_0x9dbeb2[_0xdc6d('0xc')]['Smtp']['port'];_0x3a27eb[_0xdc6d('0x11')]=_0x9dbeb2['MailAccount'][_0xdc6d('0xd')][_0xdc6d('0x11')];}if(_0x9dbeb2[_0xdc6d('0xc')][_0xdc6d('0xd')]['authentication']){_0x3a27eb['auth']={'user':_0x9dbeb2[_0xdc6d('0xc')][_0xdc6d('0xd')]['user'],'pass':_0x9dbeb2[_0xdc6d('0xc')][_0xdc6d('0xd')][_0xdc6d('0x12')]};}var _0x283b91={'account':_0x3a27eb,'message':{'from':util['format'](_0xdc6d('0x13'),_0x9dbeb2[_0xdc6d('0xc')][_0xdc6d('0x14')],_0x9dbeb2[_0xdc6d('0xc')][_0xdc6d('0xb')]||_0x9dbeb2['MailAccount'][_0xdc6d('0xd')][_0xdc6d('0x15')]),'to':_0x9dbeb2[_0xdc6d('0xb')],'cc':_0x9dbeb2['cc'],'bcc':_0x9dbeb2[_0xdc6d('0x16')],'subject':util[_0xdc6d('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x5d6bb2[_0xdc6d('0x14')],_0x9dbeb2['subtractNumber'],_0x9dbeb2[_0xdc6d('0x18')])}};var _0x32aab4=path['join'](__dirname,_0xdc6d('0x19'));var _0x8156c9=_0x5d6bb2[_0xdc6d('0x1a')];var _0x262f2d=util['format'](_0xdc6d('0x1b'),path[_0xdc6d('0x1c')](_0x5d6bb2[_0xdc6d('0x1a')],path[_0xdc6d('0x1d')](_0x5d6bb2['savename'])),_0xdc6d('0x1e'));var _0x14a42d=path[_0xdc6d('0x1f')](_0x32aab4,_0x8156c9);var _0x55ebef=path['join'](_0x32aab4,_0x262f2d);if(fs['existsSync'](_0x14a42d)){_0x5d6bb2[_0xdc6d('0x20')]=_0xdc6d('0x21');_0x283b91[_0xdc6d('0x22')]['attachments']=[{'filename':_0x8156c9,'path':_0x14a42d}];_0x283b91[_0xdc6d('0x22')][_0xdc6d('0x23')]=util[_0xdc6d('0x17')](_0xdc6d('0x24'),JSON[_0xdc6d('0x25')](_0x5d6bb2,null,0x2));}else if(fs[_0xdc6d('0x26')](_0x55ebef)){_0x5d6bb2[_0xdc6d('0x20')]=_0xdc6d('0x21');_0x283b91[_0xdc6d('0x22')][_0xdc6d('0x27')]=[{'filename':_0x262f2d,'path':_0x55ebef}];}else{_0x283b91[_0xdc6d('0x22')][_0xdc6d('0x23')]=_0xdc6d('0x28');if(!_0x9dbeb2['sendIfEmpty']){_0x3164d0=![];logger[_0xdc6d('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3164d0){return client[_0xdc6d('0x29')]('SendMail',_0x283b91)[_0xdc6d('0x2a')](function(_0x2f5b04){if(_0x2f5b04['error']){return logger[_0xdc6d('0x2b')](_0xdc6d('0x2c'),JSON[_0xdc6d('0x25')](_0x2f5b04));}return logger[_0xdc6d('0xa')](_0xdc6d('0x2d'));})['catch'](function(_0x7e5c78){return logger[_0xdc6d('0x2b')]('error\x20mail',JSON[_0xdc6d('0x25')](_0x7e5c78));});}};}function handleError(){return function(_0x152b7b){return logger[_0xdc6d('0x2b')](JSON[_0xdc6d('0x25')](_0x152b7b));};}function handleResult(_0x37a9ab){return function(_0x2471ed){logger[_0xdc6d('0xa')](_0xdc6d('0x2e'),JSON[_0xdc6d('0x25')](_0x2471ed));if(_0x37a9ab[_0xdc6d('0xc')]&&_0x37a9ab['MailAccount'][_0xdc6d('0xd')]&&!_[_0xdc6d('0x2f')](_0x37a9ab[_0xdc6d('0xb')])){setTimeout(handleSendEmail(_0x37a9ab,_0x2471ed),0x3c*0x3e8);}};}function handleJob(_0xaacf8e){return function(){try{if(_[_0xdc6d('0x2f')](_0xaacf8e['subtractNumber'])){return logger['info'](_0xdc6d('0x30'));}if(_[_0xdc6d('0x2f')](_0xaacf8e['subtractUnit'])){return logger[_0xdc6d('0xa')](_0xdc6d('0x31'));}var _0x4ec8fb={'startDate':moment()[_0xdc6d('0x32')](_0xaacf8e[_0xdc6d('0x33')],_0xaacf8e[_0xdc6d('0x18')])[_0xdc6d('0x17')](_0xdc6d('0x34')),'endDate':moment()[_0xdc6d('0x17')](_0xdc6d('0x34')),'type':'scheduled','output':_0xaacf8e[_0xdc6d('0x35')],'name':_0xaacf8e['name']};if(!_[_0xdc6d('0x2f')](_0xaacf8e['DefaultReportId'])){logger[_0xdc6d('0xa')](_0xdc6d('0x36'),_0xaacf8e[_0xdc6d('0x37')]);return analyticDefaultReportController[_0xdc6d('0x38')]({'id':_0xaacf8e['DefaultReportId']},_0x4ec8fb)[_0xdc6d('0x2a')](handleResult(_0xaacf8e))[_0xdc6d('0x39')](handleError());}if(!_[_0xdc6d('0x2f')](_0xaacf8e['CustomReportId'])){logger['info'](_0xdc6d('0x3a'),_0xaacf8e[_0xdc6d('0x3b')]);return analyticCustomReportController['runReport']({'id':_0xaacf8e['CustomReportId']},_0x4ec8fb)[_0xdc6d('0x2a')](handleResult(_0xaacf8e))['catch'](handleError());}}catch(_0x2db27f){logger[_0xdc6d('0x2b')](JSON['stringify'](_0x2db27f));}return logger[_0xdc6d('0xa')](_0xdc6d('0x3c'));};}function getJobs(_0xec7001){var _0xa5ed29={};if(_0xec7001){_0xa5ed29['id']=_0xec7001;}return db[_0xdc6d('0x3d')][_0xdc6d('0x3e')]({'where':_0xa5ed29,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0xdc6d('0xb')],'include':[{'model':db['MailServerOut'],'as':_0xdc6d('0xd')}]}]})[_0xdc6d('0x2a')](function(_0x152686){var _0x5a4afa=_[_0xdc6d('0x3f')](manager[_0xdc6d('0x40')]);var _0x330392=_[_0xdc6d('0x41')](_0x152686,function(_0x27ed49){return _0x27ed49['id']['toString']();});var _0x5b4435=_[_0xdc6d('0x42')](_0x152686,function(_0x53ea60){return _0x53ea60['id'][_0xdc6d('0x43')]();});var _0x2cda49=_0xec7001?_0x330392:_[_0xdc6d('0x44')](_0x330392,_0x5a4afa);var _0x20a3b0=_[_0xdc6d('0x45')](_0x330392,_0x5a4afa);var _0x7c2575=_['difference'](_0x5a4afa,_0x330392);var _0x5ac830;var _0x41916b;for(_0x5ac830=0x0;_0x5ac830<_0x7c2575[_0xdc6d('0x46')]&&!_0xec7001;_0x5ac830+=0x1){_0x41916b=_0x7c2575[_0x5ac830][_0xdc6d('0x43')]();if(manager[_0xdc6d('0x47')](_0x41916b)){manager[_0xdc6d('0x48')](_0x41916b);manager['deleteJob'](_0x41916b);logger[_0xdc6d('0xa')](_0xdc6d('0x49'),_0x41916b);}}logger[_0xdc6d('0xa')](_0xdc6d('0x4a'),JSON[_0xdc6d('0x25')](_0x2cda49));for(_0x5ac830=0x0;_0x5ac830<_0x2cda49['length'];_0x5ac830+=0x1){_0x41916b=_0x2cda49[_0x5ac830]['toString']();logger[_0xdc6d('0xa')](_0xdc6d('0x4b'),_0x41916b);if(_0xec7001){logger[_0xdc6d('0xa')]('my\x20id',_0xec7001);logger[_0xdc6d('0xa')](JSON[_0xdc6d('0x25')](_0x5b4435[_0x41916b]));BPromise['resolve']()['then'](handleJob(_0x5b4435[_0x41916b]));logger[_0xdc6d('0xa')]('run\x20job',_0x5b4435[_0x41916b]['name'],_0x5b4435[_0x41916b][_0xdc6d('0x4c')]);}else if(_0x5b4435[_0x41916b][_0xdc6d('0x4c')]&&_0x5b4435[_0x41916b][_0xdc6d('0x4d')]&&moment()['isBetween'](_0x5b4435[_0x41916b][_0xdc6d('0x4e')],_0x5b4435[_0x41916b][_0xdc6d('0x4f')])){manager['add'](_0x41916b,_0x5b4435[_0x41916b][_0xdc6d('0x4c')],handleJob(_0x5b4435[_0x41916b]));manager[_0xdc6d('0x50')](_0x41916b);logger[_0xdc6d('0xa')]('add\x20cron',_0x5b4435[_0x41916b][_0xdc6d('0x14')],_0x5b4435[_0x41916b]['cron']);}else if(manager[_0xdc6d('0x47')](_0x41916b)){manager[_0xdc6d('0x48')](_0x41916b);manager[_0xdc6d('0x51')](_0x41916b);logger[_0xdc6d('0xa')](_0xdc6d('0x52'),_0x5b4435[_0x41916b][_0xdc6d('0x14')],_0x5b4435[_0x41916b][_0xdc6d('0x4c')]);}}for(_0x5ac830=0x0,_0x41916b;_0x5ac830<_0x20a3b0[_0xdc6d('0x46')]&&!_0xec7001;_0x5ac830+=0x1){_0x41916b=_0x20a3b0[_0x5ac830][_0xdc6d('0x43')]();if(manager[_0xdc6d('0x47')](_0x41916b)){if(_0x5b4435[_0x41916b][_0xdc6d('0x4c')]&&_0x5b4435[_0x41916b]['active']&&moment()[_0xdc6d('0x53')](_0x5b4435[_0x41916b][_0xdc6d('0x4e')],_0x5b4435[_0x41916b][_0xdc6d('0x4f')])){manager[_0xdc6d('0x54')](_0x41916b,_0x5b4435[_0x41916b][_0xdc6d('0x4c')],handleJob(_0x5b4435[_0x41916b]));logger[_0xdc6d('0xa')]('update\x20cron',_0x5b4435[_0x41916b][_0xdc6d('0x14')],_0x5b4435[_0x41916b][_0xdc6d('0x4c')]);}else{manager[_0xdc6d('0x48')](_0x41916b);manager[_0xdc6d('0x51')](_0x41916b);logger[_0xdc6d('0xa')](_0xdc6d('0x52'),_0x5b4435[_0x41916b]['name'],_0x5b4435[_0x41916b][_0xdc6d('0x4c')]);}}}})[_0xdc6d('0x39')](function(_0x1fcb19){logger[_0xdc6d('0x2b')](JSON[_0xdc6d('0x25')](_0x1fcb19));});}exports['run']=function(_0xdb615c){return getJobs(_0xdb615c);};exports[_0xdc6d('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x0d55=['active','update','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','\x22%s\x22\x20<%s>','name','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','extname','existsSync','status','attachments','text','stringify','Sent','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','stop','deleteJob','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','start','exists','stop\x20cron'];(function(_0x256fa5,_0x5285e7){var _0x3bffcc=function(_0x21427d){while(--_0x21427d){_0x256fa5['push'](_0x256fa5['shift']());}};_0x3bffcc(++_0x5285e7);}(_0x0d55,0x16c));var _0x50d5=function(_0x45a263,_0x2c0be7){_0x45a263=_0x45a263-0x0;var _0x337fe2=_0x0d55[_0x45a263];return _0x337fe2;};'use strict';var fs=require('fs');var util=require(_0x50d5('0x0'));var path=require(_0x50d5('0x1'));var _=require(_0x50d5('0x2'));var moment=require('moment');var CronJobManager=require(_0x50d5('0x3'));var jayson=require(_0x50d5('0x4'));var BPromise=require(_0x50d5('0x5'));var logger=require(_0x50d5('0x6'))(_0x50d5('0x7'));var db=require(_0x50d5('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x50d5('0x9'));var client=jayson[_0x50d5('0xa')][_0x50d5('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f0bcb,_0x2a3134){return function(){logger[_0x50d5('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x2f0bcb[_0x50d5('0xd')]);var _0x149852=!![];var _0x5dd79d={'tls':{'rejectUnauthorized':![]}};if(_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')][_0x50d5('0x10')]){_0x5dd79d[_0x50d5('0x10')]=_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')][_0x50d5('0x10')];}else{_0x5dd79d[_0x50d5('0x11')]=_0x2f0bcb[_0x50d5('0xe')]['Smtp']['host'];_0x5dd79d[_0x50d5('0x12')]=_0x2f0bcb['MailAccount'][_0x50d5('0xf')][_0x50d5('0x12')];_0x5dd79d[_0x50d5('0x13')]=_0x2f0bcb[_0x50d5('0xe')]['Smtp']['secure'];}if(_0x2f0bcb['MailAccount'][_0x50d5('0xf')][_0x50d5('0x14')]){_0x5dd79d[_0x50d5('0x15')]={'user':_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')]['user'],'pass':_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')]['pass']};}var _0x3e5e8d={'account':_0x5dd79d,'message':{'from':util['format'](_0x50d5('0x16'),_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0x17')],_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xd')]||_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')][_0x50d5('0x18')]),'to':_0x2f0bcb[_0x50d5('0xd')],'cc':_0x2f0bcb['cc'],'bcc':_0x2f0bcb[_0x50d5('0x19')],'subject':util[_0x50d5('0x1a')](_0x50d5('0x1b'),_0x2a3134[_0x50d5('0x17')],_0x2f0bcb[_0x50d5('0x1c')],_0x2f0bcb[_0x50d5('0x1d')])}};var _0x51946b=path[_0x50d5('0x1e')](__dirname,_0x50d5('0x1f'));var _0x571351=_0x2a3134['savename'];var _0x1e5abc=util['format']('%s.%s',path[_0x50d5('0x20')](_0x2a3134[_0x50d5('0x21')],path[_0x50d5('0x22')](_0x2a3134[_0x50d5('0x21')])),'zip');var _0x3accf5=path[_0x50d5('0x1e')](_0x51946b,_0x571351);var _0x5508b8=path[_0x50d5('0x1e')](_0x51946b,_0x1e5abc);if(fs[_0x50d5('0x23')](_0x3accf5)){_0x2a3134[_0x50d5('0x24')]='Sent';_0x3e5e8d['message'][_0x50d5('0x25')]=[{'filename':_0x571351,'path':_0x3accf5}];_0x3e5e8d['message'][_0x50d5('0x26')]=util[_0x50d5('0x1a')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x50d5('0x27')](_0x2a3134,null,0x2));}else if(fs['existsSync'](_0x5508b8)){_0x2a3134[_0x50d5('0x24')]=_0x50d5('0x28');_0x3e5e8d[_0x50d5('0x29')]['attachments']=[{'filename':_0x1e5abc,'path':_0x5508b8}];}else{_0x3e5e8d[_0x50d5('0x29')][_0x50d5('0x26')]=_0x50d5('0x2a');if(!_0x2f0bcb[_0x50d5('0x2b')]){_0x149852=![];logger['info'](_0x50d5('0x2c'));}}if(_0x149852){return client['request']('SendMail',_0x3e5e8d)['then'](function(_0x2b447a){if(_0x2b447a[_0x50d5('0x2d')]){return logger[_0x50d5('0x2d')](_0x50d5('0x2e'),JSON[_0x50d5('0x27')](_0x2b447a));}return logger[_0x50d5('0xc')](_0x50d5('0x2f'));})[_0x50d5('0x30')](function(_0x2be77f){return logger[_0x50d5('0x2d')](_0x50d5('0x2e'),JSON[_0x50d5('0x27')](_0x2be77f));});}};}function handleError(){return function(_0x44412c){return logger[_0x50d5('0x2d')](JSON[_0x50d5('0x27')](_0x44412c));};}function handleResult(_0x3d36cf){return function(_0x25af97){logger['info'](_0x50d5('0x31'),JSON['stringify'](_0x25af97));if(_0x3d36cf[_0x50d5('0xe')]&&_0x3d36cf[_0x50d5('0xe')][_0x50d5('0xf')]&&!_[_0x50d5('0x32')](_0x3d36cf[_0x50d5('0xd')])){setTimeout(handleSendEmail(_0x3d36cf,_0x25af97),0x3c*0x3e8);}};}function handleJob(_0xf977b1){return function(){try{if(_[_0x50d5('0x32')](_0xf977b1[_0x50d5('0x1c')])){return logger[_0x50d5('0xc')](_0x50d5('0x33'));}if(_[_0x50d5('0x32')](_0xf977b1[_0x50d5('0x1d')])){return logger[_0x50d5('0xc')](_0x50d5('0x34'));}var _0x2175ba={'startDate':moment()[_0x50d5('0x35')](_0xf977b1[_0x50d5('0x1c')],_0xf977b1[_0x50d5('0x1d')])['format'](_0x50d5('0x36')),'endDate':moment()[_0x50d5('0x1a')](_0x50d5('0x36')),'type':_0x50d5('0x37'),'output':_0xf977b1[_0x50d5('0x38')],'name':_0xf977b1[_0x50d5('0x17')]};if(!_[_0x50d5('0x32')](_0xf977b1[_0x50d5('0x39')])){logger[_0x50d5('0xc')]('exec\x20defaul\x20report\x20id:%s',_0xf977b1[_0x50d5('0x39')]);return analyticDefaultReportController[_0x50d5('0x3a')]({'id':_0xf977b1[_0x50d5('0x39')]},_0x2175ba)[_0x50d5('0x3b')](handleResult(_0xf977b1))['catch'](handleError());}if(!_[_0x50d5('0x32')](_0xf977b1[_0x50d5('0x3c')])){logger['info'](_0x50d5('0x3d'),_0xf977b1[_0x50d5('0x3c')]);return analyticCustomReportController['runReport']({'id':_0xf977b1[_0x50d5('0x3c')]},_0x2175ba)[_0x50d5('0x3b')](handleResult(_0xf977b1))[_0x50d5('0x30')](handleError());}}catch(_0x13c942){logger[_0x50d5('0x2d')](JSON['stringify'](_0x13c942));}return logger['info'](_0x50d5('0x3e'));};}function getJobs(_0x4fd9ee){var _0x265451={};if(_0x4fd9ee){_0x265451['id']=_0x4fd9ee;}return db['Schedule'][_0x50d5('0x3f')]({'where':_0x265451,'include':[{'model':db[_0x50d5('0xe')],'attributes':['id',_0x50d5('0x17'),_0x50d5('0xd')],'include':[{'model':db[_0x50d5('0x40')],'as':_0x50d5('0xf')}]}]})['then'](function(_0x1bf381){var _0x37b547=_[_0x50d5('0x41')](manager[_0x50d5('0x42')]);var _0x34a1f4=_[_0x50d5('0x43')](_0x1bf381,function(_0xfa57ed){return _0xfa57ed['id']['toString']();});var _0x158831=_[_0x50d5('0x44')](_0x1bf381,function(_0x3f0cfd){return _0x3f0cfd['id'][_0x50d5('0x45')]();});var _0xf79291=_0x4fd9ee?_0x34a1f4:_[_0x50d5('0x46')](_0x34a1f4,_0x37b547);var _0x1e0c61=_[_0x50d5('0x47')](_0x34a1f4,_0x37b547);var _0x2868f2=_[_0x50d5('0x46')](_0x37b547,_0x34a1f4);var _0x5d6c11;var _0x4219ed;for(_0x5d6c11=0x0;_0x5d6c11<_0x2868f2[_0x50d5('0x48')]&&!_0x4fd9ee;_0x5d6c11+=0x1){_0x4219ed=_0x2868f2[_0x5d6c11][_0x50d5('0x45')]();if(manager['exists'](_0x4219ed)){manager[_0x50d5('0x49')](_0x4219ed);manager[_0x50d5('0x4a')](_0x4219ed);logger[_0x50d5('0xc')]('delete\x20cron',_0x4219ed);}}logger[_0x50d5('0xc')]('toRun',JSON['stringify'](_0xf79291));for(_0x5d6c11=0x0;_0x5d6c11<_0xf79291['length'];_0x5d6c11+=0x1){_0x4219ed=_0xf79291[_0x5d6c11]['toString']();logger[_0x50d5('0xc')](_0x50d5('0x4b'),_0x4219ed);if(_0x4fd9ee){logger[_0x50d5('0xc')](_0x50d5('0x4c'),_0x4fd9ee);logger[_0x50d5('0xc')](JSON['stringify'](_0x158831[_0x4219ed]));BPromise[_0x50d5('0x4d')]()[_0x50d5('0x3b')](handleJob(_0x158831[_0x4219ed]));logger[_0x50d5('0xc')](_0x50d5('0x4e'),_0x158831[_0x4219ed][_0x50d5('0x17')],_0x158831[_0x4219ed][_0x50d5('0x4f')]);}else if(_0x158831[_0x4219ed]['cron']&&_0x158831[_0x4219ed]['active']&&moment()[_0x50d5('0x50')](_0x158831[_0x4219ed][_0x50d5('0x51')],_0x158831[_0x4219ed][_0x50d5('0x52')])){manager['add'](_0x4219ed,_0x158831[_0x4219ed]['cron'],handleJob(_0x158831[_0x4219ed]));manager[_0x50d5('0x53')](_0x4219ed);logger[_0x50d5('0xc')]('add\x20cron',_0x158831[_0x4219ed]['name'],_0x158831[_0x4219ed][_0x50d5('0x4f')]);}else if(manager[_0x50d5('0x54')](_0x4219ed)){manager[_0x50d5('0x49')](_0x4219ed);manager[_0x50d5('0x4a')](_0x4219ed);logger['info'](_0x50d5('0x55'),_0x158831[_0x4219ed][_0x50d5('0x17')],_0x158831[_0x4219ed]['cron']);}}for(_0x5d6c11=0x0,_0x4219ed;_0x5d6c11<_0x1e0c61[_0x50d5('0x48')]&&!_0x4fd9ee;_0x5d6c11+=0x1){_0x4219ed=_0x1e0c61[_0x5d6c11][_0x50d5('0x45')]();if(manager[_0x50d5('0x54')](_0x4219ed)){if(_0x158831[_0x4219ed][_0x50d5('0x4f')]&&_0x158831[_0x4219ed][_0x50d5('0x56')]&&moment()[_0x50d5('0x50')](_0x158831[_0x4219ed]['startAt'],_0x158831[_0x4219ed]['endAt'])){manager[_0x50d5('0x57')](_0x4219ed,_0x158831[_0x4219ed][_0x50d5('0x4f')],handleJob(_0x158831[_0x4219ed]));logger[_0x50d5('0xc')](_0x50d5('0x58'),_0x158831[_0x4219ed][_0x50d5('0x17')],_0x158831[_0x4219ed]['cron']);}else{manager[_0x50d5('0x49')](_0x4219ed);manager[_0x50d5('0x4a')](_0x4219ed);logger['info'](_0x50d5('0x55'),_0x158831[_0x4219ed][_0x50d5('0x17')],_0x158831[_0x4219ed][_0x50d5('0x4f')]);}}}})['catch'](function(_0x25f47b){logger[_0x50d5('0x2d')](JSON[_0x50d5('0x27')](_0x25f47b));});}exports[_0x50d5('0x59')]=function(_0x53e18a){return getJobs(_0x53e18a);};exports[_0x50d5('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index a713376..f3e9537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1752=['update','FailureReason','resolve','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribe','transcribeAccountId','Cloud\x20Provider\x20not\x20available','forEach','push','all','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Cloud\x20Provider\x20not\x20configured','language','SentimentScore','Negative','Mixed','Neutral','FAILED'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0x1752,0xa5));var _0x2175=function(_0x1ecf45,_0x52a17e){_0x1ecf45=_0x1ecf45-0x0;var _0x741713=_0x1752[_0x1ecf45];return _0x741713;};var _=require('lodash');var AWS=require(_0x2175('0x0'));var rp=require(_0x2175('0x1'));var util=require(_0x2175('0x2'));var BPromise=require(_0x2175('0x3'));var db=require(_0x2175('0x4'))['db'];var logger=require(_0x2175('0x5'))('transcribe');function getTranscriptionJob(_0x1ee277,_0x22c167,_0x12b8d9,_0xe55453){return new Promise(function(_0x222868,_0x27ff0b){var _0x19ca87=new AWS[(_0x2175('0x6'))]({'accessKeyId':_0x22c167,'secretAccessKey':_0x1ee277,'region':_0x12b8d9});_0x19ca87[_0x2175('0x7')]({'TranscriptionJobName':_0xe55453},function(_0x672ff1,_0x516ccc){if(_0x672ff1){return _0x27ff0b(_0x672ff1);}else{return _0x222868(_0x516ccc);}});});}function sentiment(_0x4e818f,_0xa39599,_0x407a71,_0x455803,_0x77e3fa){return new Promise(function(_0x4be8c8,_0x5ad5ad){var _0x5717b0=new AWS[(_0x2175('0x8'))]({'accessKeyId':_0xa39599,'secretAccessKey':_0x4e818f,'region':_0x407a71});_0x5717b0['detectSentiment']({'Text':_0x455803,'LanguageCode':_0x77e3fa['substring'](0x0,0x2)},function(_0x510de5,_0x4fa5eb){if(_0x510de5){return _0x5ad5ad(_0x510de5);}else{return _0x4be8c8(_0x4fa5eb);}});});}function checkTranscribeJob(_0x453acd,_0x5bc446,_0x43be3c){var _0x393c02;return new BPromise(function(_0x49522e,_0x20477e){logger[_0x2175('0x9')](util[_0x2175('0xa')](_0x2175('0xb'),_0x453acd['id'],_0x453acd[_0x2175('0xc')]));return getTranscriptionJob(_0x43be3c[_0x2175('0xd')],_0x43be3c[_0x2175('0xe')],_0x5bc446[_0x2175('0xf')],_0x453acd['transcribeName'])['then'](function(_0x371b42){logger[_0x2175('0x9')](util[_0x2175('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x453acd['id'],_0x453acd['transcribeName'],_0x371b42['TranscriptionJob'][_0x2175('0x10')]));if(!_0x453acd[_0x2175('0x11')]){switch(_0x371b42['TranscriptionJob']['TranscriptionJobStatus']){case _0x2175('0x12'):var _0x3d6467={'transcribeStatus':_0x371b42[_0x2175('0x13')]['TranscriptionJobStatus'],'fileUri':_0x371b42[_0x2175('0x13')]['Transcript'][_0x2175('0x14')]};logger['info'](util[_0x2175('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x453acd['id']));return rp({'uri':_0x371b42['TranscriptionJob']['Transcript'][_0x2175('0x14')],'json':!![]})['then'](function(_0x28c4b8){logger[_0x2175('0x9')](util[_0x2175('0xa')](_0x2175('0x15'),_0x453acd['id']));if(_0x28c4b8&&_0x28c4b8[_0x2175('0x16')]&&_0x28c4b8[_0x2175('0x16')]['transcripts']&&_0x28c4b8[_0x2175('0x16')][_0x2175('0x17')][_0x2175('0x18')]){_0x3d6467[_0x2175('0x11')]='';for(var _0x495887=0x0;_0x495887<_0x28c4b8['results'][_0x2175('0x17')][_0x2175('0x18')];_0x495887++){_0x3d6467[_0x2175('0x11')]+=_0x28c4b8['results'][_0x2175('0x17')][_0x495887]['transcript']+'';}}return _0x453acd['update'](_0x3d6467);})[_0x2175('0x19')](function(){logger[_0x2175('0x9')](util[_0x2175('0xa')](_0x2175('0x1a'),_0x453acd['id']));if(!_0x453acd[_0x2175('0x1b')]){throw new db[(_0x2175('0x1c'))][(_0x2175('0x1d'))](_0x2175('0x1e'));}if(!_0x5bc446[_0x2175('0x1f')]||!_0x5bc446[_0x2175('0x20')]||!_0x5bc446[_0x2175('0x21')]||!_0x5bc446['language']||!_0x5bc446[_0x2175('0x22')]){throw new db[(_0x2175('0x1c'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3d6467[_0x2175('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x5bc446[_0x2175('0x20')]===_0x43be3c['id']){return _0x43be3c;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x2175('0x19')](function(_0x2811b6){if(!_0x2811b6){throw new db[(_0x2175('0x1c'))][(_0x2175('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2811b6[_0x2175('0xd')]||!_0x2811b6[_0x2175('0xe')]){throw new db['Sequelize'][(_0x2175('0x1d'))](_0x2175('0x23'));}_0x393c02=_0x2811b6;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x453acd['id']));return sentiment(_0x393c02['data1'],_0x393c02[_0x2175('0xe')],_0x5bc446[_0x2175('0x21')],_0x3d6467[_0x2175('0x11')],_0x5bc446[_0x2175('0x24')]);})[_0x2175('0x19')](function(_0x25cce5){logger[_0x2175('0x9')](util[_0x2175('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x453acd['id']));return _0x453acd['update']({'sentiment':_0x25cce5['Sentiment'],'sPositive':_0x25cce5['SentimentScore']['Positive'],'sNegative':_0x25cce5[_0x2175('0x25')][_0x2175('0x26')],'sMixed':_0x25cce5['SentimentScore'][_0x2175('0x27')],'sNeutral':_0x25cce5[_0x2175('0x25')][_0x2175('0x28')]});})[_0x2175('0x19')](function(){logger[_0x2175('0x9')](util[_0x2175('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x453acd['id']));_0x49522e();});case _0x2175('0x29'):return _0x453acd[_0x2175('0x2a')]({'transcribeStatus':_0x2175('0x29'),'failureReason':_0x371b42[_0x2175('0x13')][_0x2175('0x2b')]})[_0x2175('0x19')](function(){logger[_0x2175('0x9')](util[_0x2175('0xa')](_0x2175('0x1a'),_0x453acd['id']));_0x49522e();});default:logger[_0x2175('0x9')](util[_0x2175('0xa')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x453acd['id']));break;}}else{return BPromise[_0x2175('0x2c')]()[_0x2175('0x19')](function(){if(!_0x453acd[_0x2175('0x1b')]){throw new db['Sequelize']['ValidationError'](_0x2175('0x1e'));}if(!_0x5bc446['sentiment']||!_0x5bc446[_0x2175('0x20')]||!_0x5bc446[_0x2175('0x21')]||!_0x5bc446[_0x2175('0x24')]||!_0x5bc446['bucket']){throw new db['Sequelize'][(_0x2175('0x1d'))](_0x2175('0x2d'));}if(!_0x453acd['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x5bc446[_0x2175('0x20')]===_0x43be3c['id']){return _0x43be3c;}else{return db[_0x2175('0x2e')][_0x2175('0x2f')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x2175('0x19')](function(_0x4343f9){if(!_0x4343f9){throw new db[(_0x2175('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x4343f9[_0x2175('0xd')]||!_0x4343f9['data2']){throw new db[(_0x2175('0x1c'))][(_0x2175('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x393c02=_0x4343f9;logger['info'](util['format'](_0x2175('0x30'),_0x453acd['id']));return sentiment(_0x393c02['data1'],_0x393c02['data2'],_0x5bc446[_0x2175('0x21')],_0x453acd['fileText'],_0x5bc446[_0x2175('0x24')]);})[_0x2175('0x19')](function(_0x246e16){logger[_0x2175('0x9')](util[_0x2175('0xa')](_0x2175('0x31'),_0x453acd['id']));return _0x453acd['update']({'sentiment':_0x246e16[_0x2175('0x32')],'sPositive':_0x246e16[_0x2175('0x25')][_0x2175('0x33')],'sNegative':_0x246e16[_0x2175('0x25')][_0x2175('0x26')],'sMixed':_0x246e16[_0x2175('0x25')]['Mixed'],'sNeutral':_0x246e16[_0x2175('0x25')][_0x2175('0x28')],'transcribeStatus':_0x2175('0x12')});})['then'](function(){logger[_0x2175('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x453acd['id']));_0x49522e();});}})[_0x2175('0x34')](function(_0x2792c0){if(_0x2792c0){if(!_0x2792c0[_0x2175('0x35')]||_0x2792c0['name']!==_0x2175('0x36')){logger[_0x2175('0x37')](util[_0x2175('0xa')](_0x2175('0x38'),_0x453acd['id']),util[_0x2175('0x39')](_0x2792c0,{'showHidden':![],'depth':null}));}}_0x49522e();});});}function checkTranscribe(){var _0x5c1a8d;var _0x58ef93;var _0xdb0a97;return db[_0x2175('0x3a')][_0x2175('0x3b')]({'where':{'transcribeStatus':_0x2175('0x3c')}})[_0x2175('0x19')](function(_0x47b8ae){if(!_0x47b8ae||!_0x47b8ae[_0x2175('0x18')]){throw new db[(_0x2175('0x1c'))][(_0x2175('0x1d'))]('No\x20transcribe\x20job\x20to\x20check');}_0x5c1a8d=_0x47b8ae;return db['Setting'][_0x2175('0x2f')]({'where':{'id':0x1}});})['then'](function(_0x5af419){if(!_0x5af419){throw new db['Sequelize']['ValidationError'](_0x2175('0x3d'));}_0x58ef93=_0x5af419;if(!_0x58ef93[_0x2175('0x3e')]||!_0x58ef93['transcribeAccountId']||!_0x58ef93['transcribeRegion']||!_0x58ef93['language']||!_0x58ef93['bucket']){throw new db[(_0x2175('0x1c'))][(_0x2175('0x1d'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0x2175('0x2f')]({'where':{'id':_0x58ef93[_0x2175('0x3f')]}});})[_0x2175('0x19')](function(_0xce807c){if(!_0xce807c){throw new db[(_0x2175('0x1c'))]['ValidationError'](_0x2175('0x40'));}if(!_0xce807c['data1']||!_0xce807c[_0x2175('0xe')]){throw new db[(_0x2175('0x1c'))][(_0x2175('0x1d'))](_0x2175('0x23'));}_0xdb0a97=_0xce807c;var _0x1fc25a=[];_0x5c1a8d[_0x2175('0x41')](function(_0x197a88){_0x1fc25a[_0x2175('0x42')](checkTranscribeJob(_0x197a88,_0x58ef93,_0xdb0a97));});return BPromise[_0x2175('0x43')](_0x1fc25a);})[_0x2175('0x34')](function(_0x1f967d){if(_0x1f967d){if(!_0x1f967d[_0x2175('0x35')]||_0x1f967d[_0x2175('0x35')]!==_0x2175('0x36')){logger[_0x2175('0x37')](util['inspect'](_0x1f967d,{'showHidden':![],'depth':null}));}}});}exports[_0x2175('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0xf3aa=['sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','language','catch','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','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','SequelizeValidationError','lodash','aws-sdk','request-promise','util','../../mysqldb','TranscribeService','Comprehend','substring','format','data1','data2','transcribeName','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis'];(function(_0x2379c5,_0x605fe6){var _0x2c6e87=function(_0x200fef){while(--_0x200fef){_0x2379c5['push'](_0x2379c5['shift']());}};_0x2c6e87(++_0x605fe6);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x59cf41,_0x292757){_0x59cf41=_0x59cf41-0x0;var _0x3d7568=_0xf3aa[_0x59cf41];return _0x3d7568;};var _=require(_0xaf3a('0x0'));var AWS=require(_0xaf3a('0x1'));var rp=require(_0xaf3a('0x2'));var util=require(_0xaf3a('0x3'));var BPromise=require('bluebird');var db=require(_0xaf3a('0x4'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x33b1f6,_0x1e1199,_0x2f62d2,_0x41395c){return new Promise(function(_0x3050e3,_0x141196){var _0xb009f0=new AWS[(_0xaf3a('0x5'))]({'accessKeyId':_0x1e1199,'secretAccessKey':_0x33b1f6,'region':_0x2f62d2});_0xb009f0['getTranscriptionJob']({'TranscriptionJobName':_0x41395c},function(_0x4e5041,_0x3c304e){if(_0x4e5041){return _0x141196(_0x4e5041);}else{return _0x3050e3(_0x3c304e);}});});}function sentiment(_0x3d4bd8,_0x2bfc6f,_0x499643,_0x4a490f,_0x2aeea3){return new Promise(function(_0x1eadef,_0x7ba7b0){var _0x1fe67f=new AWS[(_0xaf3a('0x6'))]({'accessKeyId':_0x2bfc6f,'secretAccessKey':_0x3d4bd8,'region':_0x499643});_0x1fe67f['detectSentiment']({'Text':_0x4a490f,'LanguageCode':_0x2aeea3[_0xaf3a('0x7')](0x0,0x2)},function(_0x3550ed,_0x4bd80c){if(_0x3550ed){return _0x7ba7b0(_0x3550ed);}else{return _0x1eadef(_0x4bd80c);}});});}function checkTranscribeJob(_0x3f5a7f,_0xc980d1,_0x1948c2){var _0x5cd95e;return new BPromise(function(_0x1111f8,_0x4439f6){logger['info'](util[_0xaf3a('0x8')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3f5a7f['id'],_0x3f5a7f['transcribeName']));return getTranscriptionJob(_0x1948c2[_0xaf3a('0x9')],_0x1948c2[_0xaf3a('0xa')],_0xc980d1['transcribeRegion'],_0x3f5a7f[_0xaf3a('0xb')])[_0xaf3a('0xc')](function(_0x48bc54){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0xe'),_0x3f5a7f['id'],_0x3f5a7f[_0xaf3a('0xb')],_0x48bc54['TranscriptionJob'][_0xaf3a('0xf')]));if(!_0x3f5a7f[_0xaf3a('0x10')]){switch(_0x48bc54['TranscriptionJob']['TranscriptionJobStatus']){case _0xaf3a('0x11'):var _0x4858df={'transcribeStatus':_0x48bc54[_0xaf3a('0x12')][_0xaf3a('0xf')],'fileUri':_0x48bc54[_0xaf3a('0x12')][_0xaf3a('0x13')][_0xaf3a('0x14')]};logger['info'](util[_0xaf3a('0x8')](_0xaf3a('0x15'),_0x3f5a7f['id']));return rp({'uri':_0x48bc54[_0xaf3a('0x12')][_0xaf3a('0x13')][_0xaf3a('0x14')],'json':!![]})[_0xaf3a('0xc')](function(_0x8878e3){logger[_0xaf3a('0xd')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x3f5a7f['id']));if(_0x8878e3&&_0x8878e3[_0xaf3a('0x16')]&&_0x8878e3[_0xaf3a('0x16')][_0xaf3a('0x17')]&&_0x8878e3['results'][_0xaf3a('0x17')][_0xaf3a('0x18')]){_0x4858df['fileText']='';for(var _0x2d3972=0x0;_0x2d3972<_0x8878e3[_0xaf3a('0x16')][_0xaf3a('0x17')][_0xaf3a('0x18')];_0x2d3972++){_0x4858df[_0xaf3a('0x10')]+=_0x8878e3[_0xaf3a('0x16')][_0xaf3a('0x17')][_0x2d3972][_0xaf3a('0x19')]+'';}}return _0x3f5a7f['update'](_0x4858df);})['then'](function(){logger['info'](util[_0xaf3a('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3f5a7f['id']));if(!_0x3f5a7f[_0xaf3a('0x1a')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x1d'));}if(!_0xc980d1['sentiment']||!_0xc980d1[_0xaf3a('0x1e')]||!_0xc980d1['sentimentRegion']||!_0xc980d1['language']||!_0xc980d1[_0xaf3a('0x1f')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x20'));}if(!_0x4858df[_0xaf3a('0x10')]){throw new Error(_0xaf3a('0x21'));}if(_0xc980d1[_0xaf3a('0x1e')]===_0x1948c2['id']){return _0x1948c2;}else{return db[_0xaf3a('0x22')][_0xaf3a('0x23')]({'where':{'id':_settings[_0xaf3a('0x1e')]}});}})[_0xaf3a('0xc')](function(_0x151d98){if(!_0x151d98){throw new db[(_0xaf3a('0x1b'))]['ValidationError'](_0xaf3a('0x24'));}if(!_0x151d98[_0xaf3a('0x9')]||!_0x151d98['data2']){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x25'));}_0x5cd95e=_0x151d98;logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x26'),_0x3f5a7f['id']));return sentiment(_0x5cd95e[_0xaf3a('0x9')],_0x5cd95e[_0xaf3a('0xa')],_0xc980d1[_0xaf3a('0x27')],_0x4858df[_0xaf3a('0x10')],_0xc980d1['language']);})[_0xaf3a('0xc')](function(_0x124e72){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x28'),_0x3f5a7f['id']));return _0x3f5a7f[_0xaf3a('0x29')]({'sentiment':_0x124e72[_0xaf3a('0x2a')],'sPositive':_0x124e72[_0xaf3a('0x2b')][_0xaf3a('0x2c')],'sNegative':_0x124e72[_0xaf3a('0x2b')][_0xaf3a('0x2d')],'sMixed':_0x124e72[_0xaf3a('0x2b')]['Mixed'],'sNeutral':_0x124e72[_0xaf3a('0x2b')]['Neutral']});})[_0xaf3a('0xc')](function(){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x2e'),_0x3f5a7f['id']));_0x1111f8();});case _0xaf3a('0x2f'):return _0x3f5a7f[_0xaf3a('0x29')]({'transcribeStatus':_0xaf3a('0x2f'),'failureReason':_0x48bc54[_0xaf3a('0x12')][_0xaf3a('0x30')]})['then'](function(){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x2e'),_0x3f5a7f['id']));_0x1111f8();});default:logger[_0xaf3a('0xd')](util['format'](_0xaf3a('0x31'),_0x3f5a7f['id']));break;}}else{return BPromise[_0xaf3a('0x32')]()[_0xaf3a('0xc')](function(){if(!_0x3f5a7f[_0xaf3a('0x1a')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x1d'));}if(!_0xc980d1[_0xaf3a('0x33')]||!_0xc980d1['sentimentAccountId']||!_0xc980d1['sentimentRegion']||!_0xc980d1[_0xaf3a('0x34')]||!_0xc980d1['bucket']){throw new db['Sequelize'][(_0xaf3a('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3f5a7f[_0xaf3a('0x10')]){throw new Error(_0xaf3a('0x21'));}if(_0xc980d1[_0xaf3a('0x1e')]===_0x1948c2['id']){return _0x1948c2;}else{return db[_0xaf3a('0x22')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xaf3a('0xc')](function(_0x505333){if(!_0x505333){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x505333[_0xaf3a('0x9')]||!_0x505333[_0xaf3a('0xa')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x25'));}_0x5cd95e=_0x505333;logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x26'),_0x3f5a7f['id']));return sentiment(_0x5cd95e['data1'],_0x5cd95e[_0xaf3a('0xa')],_0xc980d1[_0xaf3a('0x27')],_0x3f5a7f['fileText'],_0xc980d1[_0xaf3a('0x34')]);})['then'](function(_0x2f4b33){logger['info'](util[_0xaf3a('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3f5a7f['id']));return _0x3f5a7f[_0xaf3a('0x29')]({'sentiment':_0x2f4b33[_0xaf3a('0x2a')],'sPositive':_0x2f4b33[_0xaf3a('0x2b')][_0xaf3a('0x2c')],'sNegative':_0x2f4b33[_0xaf3a('0x2b')][_0xaf3a('0x2d')],'sMixed':_0x2f4b33[_0xaf3a('0x2b')]['Mixed'],'sNeutral':_0x2f4b33['SentimentScore']['Neutral'],'transcribeStatus':_0xaf3a('0x11')});})['then'](function(){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3f5a7f['id']));_0x1111f8();});}})[_0xaf3a('0x35')](function(_0x2fa8c8){if(_0x2fa8c8){if(!_0x2fa8c8[_0xaf3a('0x36')]||_0x2fa8c8[_0xaf3a('0x36')]!=='SequelizeValidationError'){logger[_0xaf3a('0x37')](util[_0xaf3a('0x8')](_0xaf3a('0x38'),_0x3f5a7f['id']),util[_0xaf3a('0x39')](_0x2fa8c8,{'showHidden':![],'depth':null}));}}_0x1111f8();});});}function checkTranscribe(){var _0xc3551d;var _0x466d41;var _0x3616bf;return db[_0xaf3a('0x3a')][_0xaf3a('0x3b')]({'where':{'transcribeStatus':_0xaf3a('0x3c')}})[_0xaf3a('0xc')](function(_0x4705e3){if(!_0x4705e3||!_0x4705e3[_0xaf3a('0x18')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x3d'));}_0xc3551d=_0x4705e3;return db[_0xaf3a('0x3e')][_0xaf3a('0x23')]({'where':{'id':0x1}});})['then'](function(_0x10cb74){if(!_0x10cb74){throw new db[(_0xaf3a('0x1b'))]['ValidationError'](_0xaf3a('0x3f'));}_0x466d41=_0x10cb74;if(!_0x466d41['transcribe']||!_0x466d41[_0xaf3a('0x40')]||!_0x466d41[_0xaf3a('0x41')]||!_0x466d41[_0xaf3a('0x34')]||!_0x466d41[_0xaf3a('0x1f')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x42'));}return db[_0xaf3a('0x22')][_0xaf3a('0x23')]({'where':{'id':_0x466d41['transcribeAccountId']}});})[_0xaf3a('0xc')](function(_0x549502){if(!_0x549502){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x549502[_0xaf3a('0x9')]||!_0x549502[_0xaf3a('0xa')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x25'));}_0x3616bf=_0x549502;var _0x3351c3=[];_0xc3551d[_0xaf3a('0x43')](function(_0x3cb7e1){_0x3351c3[_0xaf3a('0x44')](checkTranscribeJob(_0x3cb7e1,_0x466d41,_0x3616bf));});return BPromise['all'](_0x3351c3);})['catch'](function(_0x48f63e){if(_0x48f63e){if(!_0x48f63e[_0xaf3a('0x36')]||_0x48f63e['name']!==_0xaf3a('0x45')){logger[_0xaf3a('0x37')](util[_0xaf3a('0x39')](_0x48f63e,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 24dbdc6..faa6342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3efd=['lastMsgAt','hours','then','info','[WHATSAPP]\x20Interactions\x20to\x20close:','system','YYYY-MM-DD\x20HH:mm:ss','length','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x5e7692,_0x1caa40){var _0x120367=function(_0x3dec6a){while(--_0x3dec6a){_0x5e7692['push'](_0x5e7692['shift']());}};_0x120367(++_0x1caa40);}(_0x3efd,0xcc));var _0xd3ef=function(_0x2ff1dd,_0x5f5694){_0x2ff1dd=_0x2ff1dd-0x0;var _0x545c4d=_0x3efd[_0x2ff1dd];return _0x545c4d;};'use strict';var _=require(_0xd3ef('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0xd3ef('0x1'));var config=require(_0xd3ef('0x2'));var db=require(_0xd3ef('0x3'))['db'];var logger=require(_0xd3ef('0x4'))(_0xd3ef('0x5'));config[_0xd3ef('0x6')]=_[_0xd3ef('0x7')](config[_0xd3ef('0x6')],{'host':_0xd3ef('0x8'),'port':0x18eb});var io=require(_0xd3ef('0x9'))(new Redis(config[_0xd3ef('0x6')]));function closeInteractions(){var _0x3610ac=[];return db[_0xd3ef('0xa')][_0xd3ef('0xb')]({'raw':!![],'attributes':['id',_0xd3ef('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xd3ef('0xd'))}}})[_0xd3ef('0xe')](function(_0x497992){if(_0x497992&&_0x497992['length']){_0x3610ac=_['map'](_0x497992||[],'id');logger[_0xd3ef('0xf')](_0xd3ef('0x10'),_0x3610ac['join']());return db[_0xd3ef('0xa')]['update']({'closeReason':_0xd3ef('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xd3ef('0x12'))},{'where':{'id':_0x3610ac}});}})[_0xd3ef('0xe')](function(){if(_0x3610ac&&_0x3610ac[_0xd3ef('0x13')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x3610ac['join']());for(var _0x446fcd=0x0;_0x446fcd<_0x3610ac['length'];_0x446fcd++){io[_0xd3ef('0x14')](_0xd3ef('0x15'),{'id':_0x3610ac[_0x446fcd],'closed':!![]});}}})[_0xd3ef('0x16')](function(_0x5178ca){logger[_0xd3ef('0x17')](_0xd3ef('0x18'),_0x5178ca?util[_0xd3ef('0x19')](_0x5178ca,{'showHidden':![],'depth':null}):'');});}exports[_0xd3ef('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x8c00=['whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c00,0x185));var _0x08c0=function(_0x2508fd,_0xa8375b){_0x2508fd=_0x2508fd-0x0;var _0x3ce952=_0x8c00[_0x2508fd];return _0x3ce952;};'use strict';var _=require(_0x08c0('0x0'));var moment=require(_0x08c0('0x1'));var Redis=require(_0x08c0('0x2'));var util=require(_0x08c0('0x3'));var config=require(_0x08c0('0x4'));var db=require(_0x08c0('0x5'))['db'];var logger=require(_0x08c0('0x6'))(_0x08c0('0x7'));config[_0x08c0('0x8')]=_[_0x08c0('0x9')](config['redis'],{'host':_0x08c0('0xa'),'port':0x18eb});var io=require(_0x08c0('0xb'))(new Redis(config['redis']));function closeInteractions(){var _0x1f29e3=[];return db[_0x08c0('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x08c0('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x08c0('0xe')](0x18,_0x08c0('0xf'))}}})[_0x08c0('0x10')](function(_0x185379){if(_0x185379&&_0x185379['length']){_0x1f29e3=_[_0x08c0('0x11')](_0x185379||[],'id');logger[_0x08c0('0x12')](_0x08c0('0x13'),_0x1f29e3[_0x08c0('0x14')]());return db[_0x08c0('0xc')][_0x08c0('0x15')]({'closeReason':_0x08c0('0x16'),'disposition':_0x08c0('0x17'),'closed':!![],'closedAt':moment()['format'](_0x08c0('0x18'))},{'where':{'id':_0x1f29e3}});}})[_0x08c0('0x10')](function(){if(_0x1f29e3&&_0x1f29e3[_0x08c0('0x19')]){logger['info'](_0x08c0('0x1a'),_0x1f29e3[_0x08c0('0x14')]());for(var _0x194c0f=0x0;_0x194c0f<_0x1f29e3['length'];_0x194c0f++){io['emit'](_0x08c0('0x1b'),{'id':_0x1f29e3[_0x194c0f],'closed':!![]});}}})[_0x08c0('0x1c')](function(_0x11177e){logger['error'](_0x08c0('0x1d'),_0x11177e?util[_0x08c0('0x1e')](_0x11177e,{'showHidden':![],'depth':null}):'');});}exports[_0x08c0('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 2993caa..aef3fc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c2a=['finished\x20populating','hopper1','hopper2','catch','util','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x7c2a,0xee));var _0xa7c2=function(_0x214ba0,_0x90a254){_0x214ba0=_0x214ba0-0x0;var _0x2a7fb9=_0x7c2a[_0x214ba0];return _0x2a7fb9;};'use strict';var util=require(_0xa7c2('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xa7c2('0x1')+i,'lastName':_0xa7c2('0x2')+i,'phone':0xf879fb460+i,'email':_0xa7c2('0x3')+i+_0xa7c2('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa7c2('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xa7c2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa7c2('0x6')](),'updatedAt':Date[_0xa7c2('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xa7c2('0x1')+i,'lastName':_0xa7c2('0x2')+i,'phone':0xf879fb460+i,'email':_0xa7c2('0x3')+i+_0xa7c2('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xa7c2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa7c2('0x6')](),'updatedAt':Date['now']()});}db[_0xa7c2('0x7')][_0xa7c2('0x8')]({'where':{}})[_0xa7c2('0x9')](function(){return db[_0xa7c2('0x7')][_0xa7c2('0xa')](contacts);})[_0xa7c2('0x9')](function(){console[_0xa7c2('0xb')]('finished\x20populating',_0xa7c2('0xc'));return db[_0xa7c2('0xd')][_0xa7c2('0x8')]({'where':{}});})[_0xa7c2('0x9')](function(){return db[_0xa7c2('0xd')][_0xa7c2('0xa')](hopper);})['then'](function(){console[_0xa7c2('0xb')](_0xa7c2('0xe'),_0xa7c2('0xf'));return db[_0xa7c2('0x7')][_0xa7c2('0xa')](contacts2);})[_0xa7c2('0x9')](function(){console[_0xa7c2('0xb')](_0xa7c2('0xe'),'contacts2');return db[_0xa7c2('0xd')]['bulkCreate'](hopper2);})[_0xa7c2('0x9')](function(){console[_0xa7c2('0xb')]('finished\x20populating',_0xa7c2('0x10'));})[_0xa7c2('0x11')](function(_0x48f311){console[_0xa7c2('0xb')](_0x48f311);});
\ No newline at end of file
+var _0xeee7=['log','hopper1','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate','then','finished\x20populating','contacts1','CmHopper'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeee7,0x136));var _0x7eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7eee('0x0'));var db=require(_0x7eee('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7eee('0x2')]({'id':i,'firstName':_0x7eee('0x3')+i,'lastName':_0x7eee('0x4')+i,'phone':0xf879fb460+i,'email':_0x7eee('0x5')+i+_0x7eee('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7eee('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7eee('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7eee('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7eee('0x2')]({'id':i,'firstName':_0x7eee('0x3')+i,'lastName':_0x7eee('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7eee('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7eee('0x7')](),'updatedAt':Date[_0x7eee('0x7')]()});}db[_0x7eee('0x8')]['destroy']({'where':{}})['then'](function(){return db[_0x7eee('0x8')][_0x7eee('0x9')](contacts);})[_0x7eee('0xa')](function(){console['log'](_0x7eee('0xb'),_0x7eee('0xc'));return db[_0x7eee('0xd')]['destroy']({'where':{}});})[_0x7eee('0xa')](function(){return db['CmHopper'][_0x7eee('0x9')](hopper);})[_0x7eee('0xa')](function(){console[_0x7eee('0xe')](_0x7eee('0xb'),_0x7eee('0xf'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console[_0x7eee('0xe')](_0x7eee('0xb'),_0x7eee('0x10'));return db[_0x7eee('0xd')][_0x7eee('0x9')](hopper2);})['then'](function(){console[_0x7eee('0xe')]('finished\x20populating','hopper2');})[_0x7eee('0x11')](function(_0x325067){console['log'](_0x325067);});
\ No newline at end of file
index 0bd5c55..803853b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca6b=['all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xca6b,0x13f));var _0xbca6=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xca6b[_0xf50820];return _0x2a9b10;};'use strict';var util=require(_0xbca6('0x0'));var db=require(_0xbca6('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbca6('0x2')]({'name':util[_0xbca6('0x3')](_0xbca6('0x4'),_0xbca6('0x5'),i),'fullname':util[_0xbca6('0x3')](_0xbca6('0x4'),_0xbca6('0x5'),i),'email':util[_0xbca6('0x3')](_0xbca6('0x6'),'agent',i),'role':_0xbca6('0x5'),'password':_0xbca6('0x7'),'internal':0xfa0+i,'type':_0xbca6('0x8'),'transport':[_0xbca6('0x9'),'ws',_0xbca6('0xa')],'disallow':[_0xbca6('0xb')],'allow':[_0xbca6('0xc')],'defaultuser':util[_0xbca6('0x3')](_0xbca6('0x4'),_0xbca6('0x5'),i),'encryption':_0xbca6('0xd'),'avpf':'yes','force_avp':_0xbca6('0xd'),'icesupport':_0xbca6('0xd'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xbca6('0xe'),'dtlssetup':'actpass','callerid':util[_0xbca6('0x3')](_0xbca6('0xf'),util[_0xbca6('0x3')]('%s%s','agent',i),0xfa0+i)});}db[_0xbca6('0x10')][_0xbca6('0x11')](users)[_0xbca6('0x12')](function(){console[_0xbca6('0x13')](_0xbca6('0x14'));})[_0xbca6('0x15')](function(_0x30d7e5){console[_0xbca6('0x13')](_0x30d7e5);});
\ No newline at end of file
+var _0x819d=['yes','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','ulaw'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x819d,0x94));var _0xd819=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x819d[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xd819('0x0'));var db=require(_0xd819('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd819('0x2')]({'name':util[_0xd819('0x3')](_0xd819('0x4'),_0xd819('0x5'),i),'fullname':util[_0xd819('0x3')]('%s%s',_0xd819('0x5'),i),'email':util[_0xd819('0x3')](_0xd819('0x6'),_0xd819('0x5'),i),'role':_0xd819('0x5'),'password':_0xd819('0x7'),'internal':0xfa0+i,'type':_0xd819('0x8'),'transport':[_0xd819('0x9'),'ws',_0xd819('0xa')],'disallow':['all'],'allow':[_0xd819('0xb')],'defaultuser':util['format'](_0xd819('0x4'),_0xd819('0x5'),i),'encryption':_0xd819('0xc'),'avpf':'yes','force_avp':_0xd819('0xc'),'icesupport':_0xd819('0xc'),'dtlsenable':_0xd819('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xd819('0xd'),'dtlssetup':_0xd819('0xe'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0xd819('0x3')](_0xd819('0x4'),_0xd819('0x5'),i),0xfa0+i)});}db['User'][_0xd819('0xf')](users)[_0xd819('0x10')](function(){console['log'](_0xd819('0x11'));})[_0xd819('0x12')](function(_0x1c1bc9){console[_0xd819('0x13')](_0x1c1bc9);});
\ No newline at end of file
index bcf3b7f..9f370b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6ce=['WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','ChatQueue','WhatsappQueue','Trunks','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction'];(function(_0x2115ca,_0x28b47c){var _0x2469f6=function(_0x2322aa){while(--_0x2322aa){_0x2115ca['push'](_0x2115ca['shift']());}};_0x2469f6(++_0x28b47c);}(_0xa6ce,0x15e));var _0xea6c=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xa6ce[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var BPromise=require(_0xea6c('0x1'));var db=require(_0xea6c('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xea6c('0x3')],'include':[{'as':_0xea6c('0x4'),'model':db['User'],'attributes':['id','name',_0xea6c('0x5')],'raw':!![],'where':{'role':_0xea6c('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xea6c('0x3')],'where':{'role':_0xea6c('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xea6c('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xea6c('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xea6c('0x3'),_0xea6c('0x8')],'where':{'type':_0xea6c('0x9')}};function getAssociatedResources(_0x202528,_0x29b813,_0x227f1c){return db[_0xea6c('0xa')][_0xea6c('0xb')]({'where':{'name':_0x202528,'userProfileId':_0x29b813},'raw':!![]})[_0xea6c('0xc')](function(_0x3b70a4){if(_0x3b70a4){if(_0x3b70a4[_0xea6c('0xd')]){switch(_0x202528){case _0xea6c('0xe'):case _0xea6c('0xf'):case _0xea6c('0x10'):case'SmsQueues':case _0xea6c('0x11'):case _0xea6c('0x12'):case _0xea6c('0x13'):return db[_0x227f1c]['findAll'](queryQueues);case _0xea6c('0x14'):return db[_0x227f1c][_0xea6c('0x15')](queryTelephones);case'Trunks':return db[_0x227f1c][_0xea6c('0x15')](queryTrunks);case _0xea6c('0x16'):return db[_0x227f1c][_0xea6c('0x15')](queryCampaigns);}}else{return db[_0xea6c('0x17')][_0xea6c('0x15')]({'attributes':[_0xea6c('0x18')],'where':{'sectionId':_0x3b70a4['id']},'raw':!![]})['then'](function(_0x43cf5b){if(_0x43cf5b){var _0x4f9c92={'where':{'id':_[_0xea6c('0x19')](_0x43cf5b,_0xea6c('0x18'))},'raw':!![]};switch(_0x227f1c){case _0xea6c('0x1a'):_0x4f9c92[_0xea6c('0x1b')][_0xea6c('0x5')]='telephone';break;case _0xea6c('0x1c'):_0x4f9c92[_0xea6c('0x1b')][_0xea6c('0x8')]=_0xea6c('0x9');break;}return db[_0x227f1c][_0xea6c('0x15')](_0x4f9c92);}else{return[];}});}}else{return[];}})[_0xea6c('0xc')](function(_0x43a03a){return _0x43a03a;});}function joinOrLeaveQueues(_0x2238bd,_0x14eec5,_0x16a6dd,_0x52a322){_0x2238bd[_0x14eec5](util[_0xea6c('0x1d')]('%s:queue:%s',_0x16a6dd,_0x52a322[_0xea6c('0x3')]));if(_0x52a322['Agents']){for(var _0x204e07=0x0;_0x204e07<_0x52a322[_0xea6c('0x4')][_0xea6c('0x1e')];_0x204e07+=0x1){_0x2238bd[_0x14eec5](util['format'](_0xea6c('0x1f'),_0x52a322[_0xea6c('0x4')][_0x204e07]['name']));}}}function joinOrLeave(_0x4f5b00,_0x3b3737,_0x53d94c){var _0x540406;if(_0x4f5b00[_0xea6c('0x20')][_0xea6c('0x21')]['id']){db[_0xea6c('0x1a')][_0xea6c('0x22')]({'attributes':['id',_0xea6c('0x3'),'role',_0xea6c('0x23')],'where':{'id':_0x4f5b00['handshake']['query']['id']},'include':[{'model':db[_0xea6c('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xea6c('0x25')],'as':_0xea6c('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xea6c('0x27')],'as':_0xea6c('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xea6c('0x29')],'as':_0xea6c('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xea6c('0x2b')],'as':_0xea6c('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0xea6c('0x2d')],'as':_0xea6c('0x2e'),'attributes':['id'],'raw':!![]}]})[_0xea6c('0xc')](function(_0x22e059){if(_0x22e059){_0x540406=_0x22e059;_0x4f5b00[_0x3b3737](util['format'](_0xea6c('0x1f'),_0x22e059[_0xea6c('0x3')]));var _0x4941fc=[];switch(_0x22e059['role']){case'admin':_0x4f5b00[_0x3b3737](_0xea6c('0x2f'));_0x4f5b00[_0x3b3737](_0xea6c('0x30'));if(queryQueues[_0xea6c('0x31')](_0xea6c('0x32'))){delete queryQueues[_0xea6c('0x32')];}_0x4941fc[_0xea6c('0x33')](db[_0xea6c('0x34')][_0xea6c('0x15')](queryQueues));_0x4941fc[_0xea6c('0x33')](db['ChatQueue'][_0xea6c('0x15')](queryQueues));_0x4941fc[_0xea6c('0x33')](db[_0xea6c('0x35')][_0xea6c('0x15')](queryQueues));_0x4941fc[_0xea6c('0x33')](db[_0xea6c('0x36')]['findAll'](queryQueues));_0x4941fc[_0xea6c('0x33')](db[_0xea6c('0x37')]['findAll'](queryQueues));_0x4941fc[_0xea6c('0x33')](db[_0xea6c('0x38')][_0xea6c('0x15')](queryQueues));_0x4941fc['push'](db['WhatsappQueue']['findAll'](queryQueues));_0x4941fc['push'](db['User'][_0xea6c('0x15')](queryTelephones));_0x4941fc[_0xea6c('0x33')](db[_0xea6c('0x39')][_0xea6c('0x15')](queryTrunks));_0x4941fc['push'](db[_0xea6c('0x1c')][_0xea6c('0x15')](queryCampaigns));_0x4941fc[_0xea6c('0x33')](db['User'][_0xea6c('0x15')](queryAgents));break;case _0xea6c('0x3a'):_0x4f5b00[_0x3b3737]('voice:inbound');_0x4f5b00[_0x3b3737](_0xea6c('0x30'));_0x4941fc[_0xea6c('0x33')](getAssociatedResources(_0xea6c('0xe'),_0x22e059[_0xea6c('0x23')],_0xea6c('0x34')));_0x4941fc[_0xea6c('0x33')](getAssociatedResources(_0xea6c('0xf'),_0x22e059[_0xea6c('0x23')],_0xea6c('0x3b')));_0x4941fc[_0xea6c('0x33')](getAssociatedResources(_0xea6c('0x10'),_0x22e059[_0xea6c('0x23')],'FaxQueue'));_0x4941fc[_0xea6c('0x33')](getAssociatedResources('SmsQueues',_0x22e059[_0xea6c('0x23')],_0xea6c('0x36')));_0x4941fc[_0xea6c('0x33')](getAssociatedResources(_0xea6c('0x11'),_0x22e059[_0xea6c('0x23')],'MailQueue'));_0x4941fc[_0xea6c('0x33')](getAssociatedResources(_0xea6c('0x12'),_0x22e059[_0xea6c('0x23')],'OpenchannelQueue'));_0x4941fc['push'](getAssociatedResources(_0xea6c('0x13'),_0x22e059['userProfileId'],_0xea6c('0x3c')));_0x4941fc[_0xea6c('0x33')](getAssociatedResources(_0xea6c('0x14'),_0x22e059[_0xea6c('0x23')],'User'));_0x4941fc[_0xea6c('0x33')](getAssociatedResources(_0xea6c('0x3d'),_0x22e059[_0xea6c('0x23')],'Trunk'));_0x4941fc[_0xea6c('0x33')](getAssociatedResources('IvrCampaigns',_0x22e059[_0xea6c('0x23')],_0xea6c('0x1c')));_0x4941fc['push'](db[_0xea6c('0x1a')][_0xea6c('0x15')](queryAgents));break;case _0xea6c('0x6'):_0x4f5b00[_0x3b3737](_0xea6c('0x2f'));_0x4f5b00[_0x3b3737](_0xea6c('0x30'));_0x4941fc[_0xea6c('0x33')](_0x22e059['getVoiceQueues']({'attributes':['id',_0xea6c('0x3')]}));_0x4941fc[_0xea6c('0x33')](_0x22e059[_0xea6c('0x3e')]({'attributes':['id',_0xea6c('0x3')]}));_0x4941fc[_0xea6c('0x33')](_0x22e059[_0xea6c('0x3f')]({'attributes':['id',_0xea6c('0x3')]}));_0x4941fc[_0xea6c('0x33')](_0x22e059[_0xea6c('0x40')]({'attributes':['id',_0xea6c('0x3')]}));_0x4941fc[_0xea6c('0x33')](_0x22e059[_0xea6c('0x41')]({'attributes':['id',_0xea6c('0x3')]}));_0x4941fc[_0xea6c('0x33')](_0x22e059['getOpenchannelQueues']({'attributes':['id',_0xea6c('0x3')]}));_0x4941fc[_0xea6c('0x33')](_0x22e059['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0xea6c('0x42')](_0x4941fc);}})[_0xea6c('0xc')](function(_0x44b399){if(_0x44b399&&_0x44b399[_0xea6c('0x1e')]){for(var _0x3931f5=0x0;_0x3931f5<_0x44b399[_0xea6c('0x1e')];_0x3931f5+=0x1){for(var _0x6e093b=0x0;_0x6e093b<_0x44b399[_0x3931f5][_0xea6c('0x1e')];_0x6e093b+=0x1){switch(_0x3931f5){case 0x0:joinOrLeaveQueues(_0x4f5b00,_0x3b3737,_0xea6c('0x43'),_0x44b399[_0x3931f5][_0x6e093b]);break;case 0x1:joinOrLeaveQueues(_0x4f5b00,_0x3b3737,_0xea6c('0x44'),_0x44b399[_0x3931f5][_0x6e093b]);break;case 0x2:joinOrLeaveQueues(_0x4f5b00,_0x3b3737,'fax',_0x44b399[_0x3931f5][_0x6e093b]);break;case 0x3:joinOrLeaveQueues(_0x4f5b00,_0x3b3737,'sms',_0x44b399[_0x3931f5][_0x6e093b]);break;case 0x4:joinOrLeaveQueues(_0x4f5b00,_0x3b3737,_0xea6c('0x45'),_0x44b399[_0x3931f5][_0x6e093b]);break;case 0x5:joinOrLeaveQueues(_0x4f5b00,_0x3b3737,_0xea6c('0x46'),_0x44b399[_0x3931f5][_0x6e093b]);break;case 0x6:joinOrLeaveQueues(_0x4f5b00,_0x3b3737,_0xea6c('0x47'),_0x44b399[_0x3931f5][_0x6e093b]);break;case 0x7:if(_0x540406['role']!==_0xea6c('0x6'))_0x4f5b00[_0x3b3737](util['format'](_0xea6c('0x48'),_0x44b399[_0x3931f5][_0x6e093b][_0xea6c('0x3')]));break;case 0x8:if(_0x540406[_0xea6c('0x5')]!=='agent')_0x4f5b00[_0x3b3737](util[_0xea6c('0x1d')]('trunk:%s',_0x44b399[_0x3931f5][_0x6e093b][_0xea6c('0x3')]));break;case 0x9:if(_0x540406[_0xea6c('0x5')]!==_0xea6c('0x6'))_0x4f5b00[_0x3b3737](util[_0xea6c('0x1d')](_0xea6c('0x49'),_0x44b399[_0x3931f5][_0x6e093b][_0xea6c('0x8')],_0x44b399[_0x3931f5][_0x6e093b][_0xea6c('0x3')]));break;case 0xa:_0x4f5b00[_0x3b3737](util[_0xea6c('0x1d')](_0xea6c('0x1f'),_0x44b399[_0x3931f5][_0x6e093b][_0xea6c('0x3')]));break;}}}}})[_0xea6c('0xc')](function(){if(_0x3b3737===_0xea6c('0x4a')){var _0x3fd5e6=_[_0xea6c('0x19')](_0x540406[_0xea6c('0x4b')],'id');return _0x540406[_0xea6c('0x4c')](_0x3fd5e6)[_0xea6c('0xc')](function(){for(var _0x1e37aa=0x0;_0x1e37aa<_0x3fd5e6[_0xea6c('0x1e')];_0x1e37aa+=0x1){_0x53d94c[_0xea6c('0x4d')](_0xea6c('0x4e'),{'ChatInteractionId':Number(_0x3fd5e6[_0x1e37aa]),'UserId':Number(_0x540406['id'])});}});}})['then'](function(){if(_0x3b3737===_0xea6c('0x4a')){var _0x2b1616=_[_0xea6c('0x19')](_0x540406[_0xea6c('0x26')],'id');return _0x540406[_0xea6c('0x4f')](_0x2b1616)[_0xea6c('0xc')](function(){for(var _0x55c652=0x0;_0x55c652<_0x2b1616[_0xea6c('0x1e')];_0x55c652+=0x1){_0x53d94c[_0xea6c('0x4d')](_0xea6c('0x50'),{'MailInteractionId':Number(_0x2b1616[_0x55c652]),'UserId':Number(_0x540406['id'])});}});}})[_0xea6c('0xc')](function(){if(_0x3b3737===_0xea6c('0x4a')){var _0x280164=_['map'](_0x540406[_0xea6c('0x28')],'id');return _0x540406['removeFaxInteractions'](_0x280164)[_0xea6c('0xc')](function(){for(var _0x222d79=0x0;_0x222d79<_0x280164['length'];_0x222d79+=0x1){_0x53d94c[_0xea6c('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x280164[_0x222d79]),'UserId':Number(_0x540406['id'])});}});}})['then'](function(){if(_0x3b3737===_0xea6c('0x4a')){var _0x1d0bec=_[_0xea6c('0x19')](_0x540406[_0xea6c('0x2a')],'id');return _0x540406[_0xea6c('0x51')](_0x1d0bec)[_0xea6c('0xc')](function(){for(var _0x1b2c36=0x0;_0x1b2c36<_0x1d0bec[_0xea6c('0x1e')];_0x1b2c36+=0x1){_0x53d94c['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x1d0bec[_0x1b2c36]),'UserId':Number(_0x540406['id'])});}});}})['then'](function(){if(_0x3b3737===_0xea6c('0x4a')){var _0x26557b=_[_0xea6c('0x19')](_0x540406[_0xea6c('0x2c')],'id');return _0x540406[_0xea6c('0x52')](_0x26557b)[_0xea6c('0xc')](function(){for(var _0x5e6646=0x0;_0x5e6646<_0x26557b[_0xea6c('0x1e')];_0x5e6646+=0x1){_0x53d94c[_0xea6c('0x4d')](_0xea6c('0x53'),{'OpenchannelInteractionId':Number(_0x26557b[_0x5e6646]),'UserId':Number(_0x540406['id'])});}});}})[_0xea6c('0xc')](function(){if(_0x3b3737==='leave'){var _0x214711=_[_0xea6c('0x19')](_0x540406['WhatsappInteractions'],'id');return _0x540406['removeWhatsappInteractions'](_0x214711)[_0xea6c('0xc')](function(){for(var _0x240660=0x0;_0x240660<_0x214711[_0xea6c('0x1e')];_0x240660+=0x1){_0x53d94c[_0xea6c('0x4d')](_0xea6c('0x54'),{'WhatsappInteractionId':Number(_0x214711[_0x240660]),'UserId':Number(_0x540406['id'])});}});}})[_0xea6c('0x55')](function(_0x27b7d5){_0x4f5b00[_0xea6c('0x56')](_0x27b7d5);});}}function onDisconnect(_0x1a5fa9,_0x1edf1a){joinOrLeave(_0x1a5fa9,_0xea6c('0x4a'),_0x1edf1a);}function onConnect(_0x3de4bb){joinOrLeave(_0x3de4bb,_0xea6c('0x57'));}exports[_0xea6c('0x58')]=function(_0x55c8ce){_0x55c8ce['on'](_0xea6c('0x59'),function(_0x2dab44){_0x2dab44['setMaxListeners'](0x0);_0x2dab44[_0xea6c('0x5a')]=_0x2dab44['request'][_0xea6c('0x59')]['remoteAddress']+':'+_0x2dab44[_0xea6c('0x5b')]['connection'][_0xea6c('0x5c')];_0x2dab44[_0xea6c('0x5d')]=new Date();_0x2dab44['log']=function(_0x3b2a34){console['log'](_0xea6c('0x5e')+_0x2dab44[_0xea6c('0x5f')]['name']+'['+_0x2dab44[_0xea6c('0x5a')]+']',_0x3b2a34);};_0x2dab44['on'](_0xea6c('0x60'),function(){onDisconnect(_0x2dab44,_0x55c8ce);_0x2dab44[_0xea6c('0x56')](_0xea6c('0x61'));});onConnect(_0x2dab44);_0x2dab44['log'](_0xea6c('0x62'));});};
\ No newline at end of file
+var _0x4f00=['Agents','User','agent','telephone','name','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','Campaign','where','type','format','%s:queue:%s','length','handshake','query','find','role','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','userProfileId','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','emit','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment'];(function(_0x1aae1b,_0xc8943f){var _0x15e8e0=function(_0x887dfa){while(--_0x887dfa){_0x1aae1b['push'](_0x1aae1b['shift']());}};_0x15e8e0(++_0xc8943f);}(_0x4f00,0x1ea));var _0x04f0=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x4f00[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x04f0('0x0'));var util=require(_0x04f0('0x1'));var BPromise=require(_0x04f0('0x2'));var db=require(_0x04f0('0x3'))['db'];var config=require(_0x04f0('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x04f0('0x5'),'model':db[_0x04f0('0x6')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x04f0('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x04f0('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x04f0('0x9')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x04f0('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x04f0('0x9'),'type'],'where':{'type':_0x04f0('0xa')}};function getAssociatedResources(_0x5d4335,_0x15de72,_0x1db999){return db[_0x04f0('0xb')][_0x04f0('0xc')]({'where':{'name':_0x5d4335,'userProfileId':_0x15de72},'raw':!![]})[_0x04f0('0xd')](function(_0x139b3d){if(_0x139b3d){if(_0x139b3d[_0x04f0('0xe')]){switch(_0x5d4335){case'VoiceQueues':case _0x04f0('0xf'):case _0x04f0('0x10'):case _0x04f0('0x11'):case _0x04f0('0x12'):case _0x04f0('0x13'):case _0x04f0('0x14'):return db[_0x1db999][_0x04f0('0x15')](queryQueues);case _0x04f0('0x16'):return db[_0x1db999]['findAll'](queryTelephones);case _0x04f0('0x17'):return db[_0x1db999][_0x04f0('0x15')](queryTrunks);case _0x04f0('0x18'):return db[_0x1db999][_0x04f0('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0x04f0('0x15')]({'attributes':[_0x04f0('0x19')],'where':{'sectionId':_0x139b3d['id']},'raw':!![]})[_0x04f0('0xd')](function(_0x1b7f23){if(_0x1b7f23){var _0xb69d29={'where':{'id':_[_0x04f0('0x1a')](_0x1b7f23,_0x04f0('0x19'))},'raw':!![]};switch(_0x1db999){case _0x04f0('0x6'):_0xb69d29['where']['role']=_0x04f0('0x8');break;case _0x04f0('0x1b'):_0xb69d29[_0x04f0('0x1c')][_0x04f0('0x1d')]=_0x04f0('0xa');break;}return db[_0x1db999][_0x04f0('0x15')](_0xb69d29);}else{return[];}});}}else{return[];}})[_0x04f0('0xd')](function(_0x43cd57){return _0x43cd57;});}function joinOrLeaveQueues(_0x507899,_0x43e831,_0x5c6ce6,_0x12f2a7){_0x507899[_0x43e831](util[_0x04f0('0x1e')](_0x04f0('0x1f'),_0x5c6ce6,_0x12f2a7['name']));if(_0x12f2a7[_0x04f0('0x5')]){for(var _0x4cb7fb=0x0;_0x4cb7fb<_0x12f2a7[_0x04f0('0x5')][_0x04f0('0x20')];_0x4cb7fb+=0x1){_0x507899[_0x43e831](util[_0x04f0('0x1e')]('user:%s',_0x12f2a7[_0x04f0('0x5')][_0x4cb7fb][_0x04f0('0x9')]));}}}function joinOrLeave(_0x2a398c,_0x3e054e,_0x1a6232){var _0x49d265;if(_0x2a398c[_0x04f0('0x21')][_0x04f0('0x22')]['id']){db[_0x04f0('0x6')][_0x04f0('0x23')]({'attributes':['id',_0x04f0('0x9'),_0x04f0('0x24'),'userProfileId'],'where':{'id':_0x2a398c['handshake'][_0x04f0('0x22')]['id']},'include':[{'model':db[_0x04f0('0x25')],'as':_0x04f0('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x04f0('0x27')],'as':_0x04f0('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x04f0('0x29')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x04f0('0x2a')],'as':_0x04f0('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x04f0('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x04f0('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x04f0('0xd')](function(_0x27a618){if(_0x27a618){_0x49d265=_0x27a618;_0x2a398c[_0x3e054e](util[_0x04f0('0x1e')](_0x04f0('0x2e'),_0x27a618['name']));var _0x571978=[];switch(_0x27a618[_0x04f0('0x24')]){case _0x04f0('0x2f'):_0x2a398c[_0x3e054e](_0x04f0('0x30'));_0x2a398c[_0x3e054e](_0x04f0('0x31'));if(queryQueues['hasOwnProperty'](_0x04f0('0x32'))){delete queryQueues[_0x04f0('0x32')];}_0x571978[_0x04f0('0x33')](db[_0x04f0('0x34')][_0x04f0('0x15')](queryQueues));_0x571978['push'](db['ChatQueue']['findAll'](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x35')][_0x04f0('0x15')](queryQueues));_0x571978['push'](db[_0x04f0('0x36')][_0x04f0('0x15')](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x37')][_0x04f0('0x15')](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x38')][_0x04f0('0x15')](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x39')][_0x04f0('0x15')](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x6')][_0x04f0('0x15')](queryTelephones));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x3a')][_0x04f0('0x15')](queryTrunks));_0x571978[_0x04f0('0x33')](db['Campaign'][_0x04f0('0x15')](queryCampaigns));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x6')][_0x04f0('0x15')](queryAgents));break;case _0x04f0('0x3b'):_0x2a398c[_0x3e054e]('voice:inbound');_0x2a398c[_0x3e054e](_0x04f0('0x31'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x3c'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x34')));_0x571978['push'](getAssociatedResources(_0x04f0('0xf'),_0x27a618[_0x04f0('0x3d')],'ChatQueue'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x10'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x35')));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x11'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x36')));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x12'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x37')));_0x571978['push'](getAssociatedResources(_0x04f0('0x13'),_0x27a618[_0x04f0('0x3d')],'OpenchannelQueue'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x14'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x39')));_0x571978['push'](getAssociatedResources(_0x04f0('0x16'),_0x27a618[_0x04f0('0x3d')],'User'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x17'),_0x27a618['userProfileId'],'Trunk'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x18'),_0x27a618[_0x04f0('0x3d')],'Campaign'));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x6')][_0x04f0('0x15')](queryAgents));break;case _0x04f0('0x7'):_0x2a398c[_0x3e054e](_0x04f0('0x30'));_0x2a398c[_0x3e054e](_0x04f0('0x31'));_0x571978[_0x04f0('0x33')](_0x27a618[_0x04f0('0x3e')]({'attributes':['id',_0x04f0('0x9')]}));_0x571978['push'](_0x27a618['getChatQueues']({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618[_0x04f0('0x3f')]({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618[_0x04f0('0x40')]({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618['getMailQueues']({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618[_0x04f0('0x41')]({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x04f0('0x42')](_0x571978);}})[_0x04f0('0xd')](function(_0x404b1a){if(_0x404b1a&&_0x404b1a[_0x04f0('0x20')]){for(var _0x349921=0x0;_0x349921<_0x404b1a[_0x04f0('0x20')];_0x349921+=0x1){for(var _0x570638=0x0;_0x570638<_0x404b1a[_0x349921]['length'];_0x570638+=0x1){switch(_0x349921){case 0x0:joinOrLeaveQueues(_0x2a398c,_0x3e054e,'voice',_0x404b1a[_0x349921][_0x570638]);break;case 0x1:joinOrLeaveQueues(_0x2a398c,_0x3e054e,'chat',_0x404b1a[_0x349921][_0x570638]);break;case 0x2:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x43'),_0x404b1a[_0x349921][_0x570638]);break;case 0x3:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x44'),_0x404b1a[_0x349921][_0x570638]);break;case 0x4:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x45'),_0x404b1a[_0x349921][_0x570638]);break;case 0x5:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x46'),_0x404b1a[_0x349921][_0x570638]);break;case 0x6:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x47'),_0x404b1a[_0x349921][_0x570638]);break;case 0x7:if(_0x49d265[_0x04f0('0x24')]!=='agent')_0x2a398c[_0x3e054e](util[_0x04f0('0x1e')](_0x04f0('0x48'),_0x404b1a[_0x349921][_0x570638]['name']));break;case 0x8:if(_0x49d265[_0x04f0('0x24')]!==_0x04f0('0x7'))_0x2a398c[_0x3e054e](util['format'](_0x04f0('0x49'),_0x404b1a[_0x349921][_0x570638][_0x04f0('0x9')]));break;case 0x9:if(_0x49d265['role']!==_0x04f0('0x7'))_0x2a398c[_0x3e054e](util['format'](_0x04f0('0x4a'),_0x404b1a[_0x349921][_0x570638][_0x04f0('0x1d')],_0x404b1a[_0x349921][_0x570638][_0x04f0('0x9')]));break;case 0xa:_0x2a398c[_0x3e054e](util[_0x04f0('0x1e')](_0x04f0('0x2e'),_0x404b1a[_0x349921][_0x570638][_0x04f0('0x9')]));break;}}}}})['then'](function(){if(_0x3e054e==='leave'){var _0x9062dd=_['map'](_0x49d265[_0x04f0('0x26')],'id');return _0x49d265['removeChatInteractions'](_0x9062dd)[_0x04f0('0xd')](function(){for(var _0x5bfd13=0x0;_0x5bfd13<_0x9062dd['length'];_0x5bfd13+=0x1){_0x1a6232['emit'](_0x04f0('0x4b'),{'ChatInteractionId':Number(_0x9062dd[_0x5bfd13]),'UserId':Number(_0x49d265['id'])});}});}})[_0x04f0('0xd')](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x1b5123=_['map'](_0x49d265[_0x04f0('0x28')],'id');return _0x49d265[_0x04f0('0x4d')](_0x1b5123)[_0x04f0('0xd')](function(){for(var _0x3f2f46=0x0;_0x3f2f46<_0x1b5123[_0x04f0('0x20')];_0x3f2f46+=0x1){_0x1a6232['emit'](_0x04f0('0x4e'),{'MailInteractionId':Number(_0x1b5123[_0x3f2f46]),'UserId':Number(_0x49d265['id'])});}});}})['then'](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x158bd3=_['map'](_0x49d265[_0x04f0('0x4f')],'id');return _0x49d265['removeFaxInteractions'](_0x158bd3)[_0x04f0('0xd')](function(){for(var _0x3d97e4=0x0;_0x3d97e4<_0x158bd3[_0x04f0('0x20')];_0x3d97e4+=0x1){_0x1a6232[_0x04f0('0x50')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x158bd3[_0x3d97e4]),'UserId':Number(_0x49d265['id'])});}});}})[_0x04f0('0xd')](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x162c9e=_[_0x04f0('0x1a')](_0x49d265[_0x04f0('0x2b')],'id');return _0x49d265['removeSmsInteractions'](_0x162c9e)[_0x04f0('0xd')](function(){for(var _0x17c259=0x0;_0x17c259<_0x162c9e['length'];_0x17c259+=0x1){_0x1a6232[_0x04f0('0x50')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x162c9e[_0x17c259]),'UserId':Number(_0x49d265['id'])});}});}})[_0x04f0('0xd')](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x35864d=_[_0x04f0('0x1a')](_0x49d265[_0x04f0('0x2c')],'id');return _0x49d265[_0x04f0('0x51')](_0x35864d)[_0x04f0('0xd')](function(){for(var _0x872c54=0x0;_0x872c54<_0x35864d[_0x04f0('0x20')];_0x872c54+=0x1){_0x1a6232['emit'](_0x04f0('0x52'),{'OpenchannelInteractionId':Number(_0x35864d[_0x872c54]),'UserId':Number(_0x49d265['id'])});}});}})['then'](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x59b203=_[_0x04f0('0x1a')](_0x49d265['WhatsappInteractions'],'id');return _0x49d265[_0x04f0('0x53')](_0x59b203)['then'](function(){for(var _0x18ded1=0x0;_0x18ded1<_0x59b203[_0x04f0('0x20')];_0x18ded1+=0x1){_0x1a6232['emit'](_0x04f0('0x54'),{'WhatsappInteractionId':Number(_0x59b203[_0x18ded1]),'UserId':Number(_0x49d265['id'])});}});}})[_0x04f0('0x55')](function(_0x4c7ffa){_0x2a398c[_0x04f0('0x56')](_0x4c7ffa);});}}function onDisconnect(_0x37bff0,_0x2e9d7e){joinOrLeave(_0x37bff0,_0x04f0('0x4c'),_0x2e9d7e);}function onConnect(_0x3ce4c6){joinOrLeave(_0x3ce4c6,_0x04f0('0x57'));}exports[_0x04f0('0x58')]=function(_0x1792fd){_0x1792fd['on'](_0x04f0('0x59'),function(_0xb2781){_0xb2781[_0x04f0('0x5a')](0x0);_0xb2781[_0x04f0('0x5b')]=_0xb2781[_0x04f0('0x5c')][_0x04f0('0x59')][_0x04f0('0x5d')]+':'+_0xb2781[_0x04f0('0x5c')][_0x04f0('0x59')][_0x04f0('0x5e')];_0xb2781[_0x04f0('0x5f')]=new Date();_0xb2781[_0x04f0('0x56')]=function(_0x3b90fd){console[_0x04f0('0x56')]('SocketIO\x20'+_0xb2781[_0x04f0('0x60')][_0x04f0('0x9')]+'['+_0xb2781[_0x04f0('0x5b')]+']',_0x3b90fd);};_0xb2781['on']('disconnect',function(){onDisconnect(_0xb2781,_0x1792fd);_0xb2781['log'](_0x04f0('0x61'));});onConnect(_0xb2781);_0xb2781['log'](_0x04f0('0x62'));});};
\ No newline at end of file
index 4379f79..e4c5a90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eb0=['SIP/%s','incomingmessage','outgoingmessage','opened','contact','changed','closed','substatus','User','find','agent','default','hasOwnProperty','model','hook','toLowerCase','condition','jayson/promise','../logger','triggers','lodash','client','Chat','ChatInteraction','newinteraction','closedinteraction','newmessage','Sms','SmsInteraction','afterUpdate','SmsMessage','afterCreate','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','then','UserId','name','fullname','email','internal','interface'];(function(_0x191469,_0x2808d2){var _0x22d752=function(_0x3767f3){while(--_0x3767f3){_0x191469['push'](_0x191469['shift']());}};_0x22d752(++_0x2808d2);}(_0x9eb0,0x1a3));var _0x09eb=function(_0x42e210,_0xe78847){_0x42e210=_0x42e210-0x0;var _0x4734b4=_0x9eb0[_0x42e210];return _0x4734b4;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0x09eb('0x0'));var logger=require(_0x09eb('0x1'))(_0x09eb('0x2'));var _=require(_0x09eb('0x3'));var client=jayson[_0x09eb('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0x09eb('0x5'),'model':_0x09eb('0x6'),'event':'afterCreate','condition':_0x09eb('0x7'),'callback':afterCreate},{'channel':_0x09eb('0x5'),'model':'ChatInteraction','event':'afterUpdate','condition':_0x09eb('0x8'),'callback':afterUpdate},{'channel':_0x09eb('0x5'),'model':'ChatMessage','event':'afterCreate','condition':_0x09eb('0x9'),'callback':afterCreateMessage},{'channel':_0x09eb('0xa'),'model':_0x09eb('0xb'),'event':'afterCreate','condition':_0x09eb('0x7'),'callback':afterCreate},{'channel':_0x09eb('0xa'),'model':_0x09eb('0xb'),'event':_0x09eb('0xc'),'condition':_0x09eb('0x8'),'callback':afterUpdate},{'channel':_0x09eb('0xa'),'model':_0x09eb('0xd'),'event':_0x09eb('0xe'),'condition':_0x09eb('0x9'),'callback':afterCreateMessage},{'channel':_0x09eb('0xf'),'model':_0x09eb('0x10'),'event':_0x09eb('0xe'),'condition':_0x09eb('0x7'),'callback':afterCreate},{'channel':_0x09eb('0xf'),'model':_0x09eb('0x10'),'event':_0x09eb('0xc'),'condition':_0x09eb('0x8'),'callback':afterUpdate},{'channel':_0x09eb('0xf'),'model':_0x09eb('0x11'),'event':_0x09eb('0xe'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x09eb('0x12'),'model':_0x09eb('0x13'),'event':_0x09eb('0xe'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x09eb('0x12'),'model':'FaxInteraction','event':_0x09eb('0xc'),'condition':_0x09eb('0x8'),'callback':afterUpdate},{'channel':_0x09eb('0x12'),'model':_0x09eb('0x14'),'event':_0x09eb('0xe'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x09eb('0x15'),'model':'MailInteraction','event':_0x09eb('0xe'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x09eb('0x15'),'model':'MailInteraction','event':_0x09eb('0xc'),'condition':_0x09eb('0x8'),'callback':afterUpdate},{'channel':_0x09eb('0x15'),'model':_0x09eb('0x16'),'event':_0x09eb('0xe'),'condition':_0x09eb('0x9'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x09eb('0x17'),'event':'afterCreate','condition':_0x09eb('0x7'),'callback':afterCreate},{'channel':_0x09eb('0x18'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x09eb('0x8'),'callback':afterUpdate},{'channel':_0x09eb('0x18'),'model':_0x09eb('0x19'),'event':_0x09eb('0xe'),'condition':_0x09eb('0x9'),'callback':afterCreateMessage}];function request(_0x433088){return client['request'](_0x09eb('0x1a'),_0x433088)['then'](function(_0x499a85){logger[_0x09eb('0x1b')](_0x09eb('0x1c'),_0x09eb('0x1a'),_0x499a85);if(_0x499a85['error']){if(_0x499a85[_0x09eb('0x1d')][_0x09eb('0x1e')]===0x1f4){logger[_0x09eb('0x1d')]('Trigger,\x20%s','EventManager',_0x499a85['error']);}}})[_0x09eb('0x1f')](function(_0xaf893){logger[_0x09eb('0x1d')]('Trigger,\x20%s',_0x09eb('0x1a'),_0xaf893);});}function afterCreateMessage(_0x2f650d,_0x30fe1f){return function(_0x19f7e7,_0x32d10a){_0x19f7e7=_0x19f7e7[_0x09eb('0x20')]({'plain':!![]});_0x19f7e7[_0x09eb('0x21')]=_0x2f650d;_0x19f7e7[_0x09eb('0x22')]=_0x2f650d;_0x19f7e7[_0x09eb('0x23')]=_0x19f7e7['direction'];var _0x2866e3=_0x09eb('0x24')+_0x19f7e7[_0x09eb('0x25')];return db[_0x09eb('0x26')][_0x09eb('0x27')](_0x2866e3,{'type':db[_0x09eb('0x28')][_0x09eb('0x29')][_0x09eb('0x2a')],'raw':!![]})[_0x09eb('0x2b')](function(_0x377fa8){return _0x377fa8;})['then'](function(_0x3e268c){if(_0x3e268c){_0x19f7e7['contact']=_0x3e268c[0x0];}if(_0x19f7e7[_0x09eb('0x2c')]){return db['User']['find']({'where':{'id':_0x19f7e7['UserId']},'attributes':['id',_0x09eb('0x2d'),_0x09eb('0x2e'),_0x09eb('0x2f'),_0x09eb('0x30')],'raw':!![]})[_0x09eb('0x2b')](function(_0x1952ab){_0x19f7e7[_0x09eb('0x31')]=util['format'](_0x09eb('0x32'),_0x1952ab['name']);_0x19f7e7[_0x09eb('0x21')]=_0x2f650d;_0x19f7e7['agent']=_0x1952ab;return request({'event':_0x09eb('0x33'),'message':_0x19f7e7});})[_0x09eb('0x1f')](function(_0x11b2a6){console[_0x09eb('0x1d')](_0x11b2a6);});}else{return request({'event':_0x09eb('0x34'),'message':_0x19f7e7});}});};}function afterCreate(_0x32318d,_0x2fe3f6){return function(_0x40e84e,_0x5e3626){_0x40e84e=_0x40e84e[_0x09eb('0x20')]({'plain':!![]});_0x40e84e[_0x09eb('0x21')]=_0x32318d;_0x40e84e['motionChannel']=_0x32318d;_0x40e84e[_0x09eb('0x23')]=_0x09eb('0x35');var _0x4f6466='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x40e84e['ContactId'];return db[_0x09eb('0x26')][_0x09eb('0x27')](_0x4f6466,{'type':db[_0x09eb('0x28')][_0x09eb('0x29')]['SELECT'],'raw':!![]})['then'](function(_0x194439){return _0x194439;})[_0x09eb('0x2b')](function(_0x4b8c1c){if(_0x4b8c1c){_0x40e84e[_0x09eb('0x36')]=_0x4b8c1c[0x0];}return request({'event':_0x2fe3f6,'message':_0x40e84e});});};}function afterUpdate(_0x1f85a5){return function(_0xea3c92){var _0x23eb94=_0xea3c92[_0x09eb('0x37')]('closed')&&_0xea3c92[_0x09eb('0x38')];var _0x47ca9b=_0xea3c92[_0x09eb('0x37')](_0x09eb('0x39'));if(_0x23eb94||_0x47ca9b){var _0x46abee=_0x23eb94?_0x09eb('0x8'):_0x09eb('0x39');var _0x1ee3f9=_0xea3c92[_0x09eb('0x20')]({'plain':!![]});_0x1ee3f9[_0x09eb('0x21')]=_0x1f85a5;_0x1ee3f9[_0x09eb('0x22')]=_0x1f85a5;_0x1ee3f9[_0x09eb('0x23')]=_0x23eb94?_0x09eb('0x38'):_0x09eb('0x39');var _0x1524f1=_0x09eb('0x24')+_0x1ee3f9[_0x09eb('0x25')];return db[_0x09eb('0x26')]['query'](_0x1524f1,{'type':db['Sequelize'][_0x09eb('0x29')][_0x09eb('0x2a')],'raw':!![]})[_0x09eb('0x2b')](function(_0x5caa05){if(_0x5caa05){_0x1ee3f9[_0x09eb('0x36')]=_0x5caa05[0x0];}if(_0x1ee3f9[_0x09eb('0x2c')]){return db[_0x09eb('0x3a')][_0x09eb('0x3b')]({'where':{'id':_0x1ee3f9[_0x09eb('0x2c')]},'attributes':['id',_0x09eb('0x2d'),_0x09eb('0x2e'),_0x09eb('0x2f'),'internal'],'raw':!![]})['then'](function(_0x51d678){_0x1ee3f9['interface']=util['format']('SIP/%s',_0x51d678[_0x09eb('0x2d')]);_0x1ee3f9[_0x09eb('0x3c')]=_0x51d678;return request({'event':_0x46abee,'message':_0x1ee3f9});})['catch'](function(_0xaa31e2){console[_0x09eb('0x1d')](_0xaa31e2);});}else{return request({'event':_0x46abee,'message':_0x1ee3f9});}});}};}exports[_0x09eb('0x3d')]=function(){for(var _0x3789ba=0x0;_0x3789ba<triggers['length'];_0x3789ba+=0x1){if(db[_0x09eb('0x3e')](triggers[_0x3789ba][_0x09eb('0x3f')])){db[triggers[_0x3789ba][_0x09eb('0x3f')]][_0x09eb('0x40')](triggers[_0x3789ba][_0x09eb('0x23')],triggers[_0x3789ba]['callback'](triggers[_0x3789ba][_0x09eb('0x21')][_0x09eb('0x41')](),triggers[_0x3789ba][_0x09eb('0x42')]));}}};
\ No newline at end of file
+var _0xfa40=['Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','UserId','User','find','name','email','internal','format','SIP/%s','agent','incomingmessage','outgoingmessage','motionChannel','opened','Sequelize','QueryTypes','SELECT','changed','closed','substatus','ContactId','contact','interface','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','../logger','lodash','client','http','Chat','afterCreate','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','newinteraction'];(function(_0x360beb,_0x5bd3bd){var _0xcb4721=function(_0x3af94d){while(--_0x3af94d){_0x360beb['push'](_0x360beb['shift']());}};_0xcb4721(++_0x5bd3bd);}(_0xfa40,0x81));var _0x0fa4=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xfa40[_0x152121];return _0x592a85;};'use strict';var util=require('util');var db=require(_0x0fa4('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x0fa4('0x1'))('triggers');var _=require(_0x0fa4('0x2'));var client=jayson[_0x0fa4('0x3')][_0x0fa4('0x4')]({'port':0x232a});var triggers=[{'channel':_0x0fa4('0x5'),'model':'ChatInteraction','event':_0x0fa4('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0fa4('0x5'),'model':_0x0fa4('0x7'),'event':_0x0fa4('0x8'),'condition':_0x0fa4('0x9'),'callback':afterUpdate},{'channel':_0x0fa4('0x5'),'model':_0x0fa4('0xa'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xb'),'callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':_0x0fa4('0x6'),'condition':_0x0fa4('0xc'),'callback':afterCreate},{'channel':_0x0fa4('0xd'),'model':_0x0fa4('0xe'),'event':_0x0fa4('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0fa4('0xd'),'model':_0x0fa4('0xf'),'event':_0x0fa4('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0fa4('0x10'),'model':_0x0fa4('0x11'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xc'),'callback':afterCreate},{'channel':_0x0fa4('0x10'),'model':_0x0fa4('0x11'),'event':_0x0fa4('0x8'),'condition':_0x0fa4('0x9'),'callback':afterUpdate},{'channel':_0x0fa4('0x10'),'model':_0x0fa4('0x12'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x0fa4('0x6'),'condition':_0x0fa4('0xc'),'callback':afterCreate},{'channel':_0x0fa4('0x13'),'model':_0x0fa4('0x14'),'event':_0x0fa4('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x0fa4('0x15'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x0fa4('0x16'),'event':'afterCreate','condition':_0x0fa4('0xc'),'callback':afterCreate},{'channel':_0x0fa4('0x17'),'model':_0x0fa4('0x16'),'event':_0x0fa4('0x8'),'condition':_0x0fa4('0x9'),'callback':afterUpdate},{'channel':_0x0fa4('0x17'),'model':_0x0fa4('0x18'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x0fa4('0x19'),'event':_0x0fa4('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0fa4('0x1a'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x0fa4('0x9'),'callback':afterUpdate},{'channel':_0x0fa4('0x1a'),'model':_0x0fa4('0x1b'),'event':_0x0fa4('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x8afc3c){return client['request'](_0x0fa4('0x1c'),_0x8afc3c)[_0x0fa4('0x1d')](function(_0x5cb34b){logger[_0x0fa4('0x1e')](_0x0fa4('0x1f'),'EventManager',_0x5cb34b);if(_0x5cb34b[_0x0fa4('0x20')]){if(_0x5cb34b[_0x0fa4('0x20')][_0x0fa4('0x21')]===0x1f4){logger[_0x0fa4('0x20')](_0x0fa4('0x1f'),_0x0fa4('0x1c'),_0x5cb34b[_0x0fa4('0x20')]);}}})[_0x0fa4('0x22')](function(_0x4ca932){logger[_0x0fa4('0x20')](_0x0fa4('0x1f'),_0x0fa4('0x1c'),_0x4ca932);});}function afterCreateMessage(_0xf54e19,_0x1e49eb){return function(_0x2f14f5,_0x2da82c){_0x2f14f5=_0x2f14f5[_0x0fa4('0x23')]({'plain':!![]});_0x2f14f5[_0x0fa4('0x24')]=_0xf54e19;_0x2f14f5['motionChannel']=_0xf54e19;_0x2f14f5[_0x0fa4('0x25')]=_0x2f14f5[_0x0fa4('0x26')];var _0x3ab480=_0x0fa4('0x27')+_0x2f14f5['ContactId'];return db[_0x0fa4('0x28')][_0x0fa4('0x29')](_0x3ab480,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0fa4('0x1d')](function(_0x204925){return _0x204925;})[_0x0fa4('0x1d')](function(_0x4461cc){if(_0x4461cc){_0x2f14f5['contact']=_0x4461cc[0x0];}if(_0x2f14f5[_0x0fa4('0x2a')]){return db[_0x0fa4('0x2b')][_0x0fa4('0x2c')]({'where':{'id':_0x2f14f5[_0x0fa4('0x2a')]},'attributes':['id',_0x0fa4('0x2d'),'fullname',_0x0fa4('0x2e'),_0x0fa4('0x2f')],'raw':!![]})[_0x0fa4('0x1d')](function(_0x61b47f){_0x2f14f5['interface']=util[_0x0fa4('0x30')](_0x0fa4('0x31'),_0x61b47f['name']);_0x2f14f5[_0x0fa4('0x24')]=_0xf54e19;_0x2f14f5[_0x0fa4('0x32')]=_0x61b47f;return request({'event':_0x0fa4('0x33'),'message':_0x2f14f5});})['catch'](function(_0xe6af4b){console['error'](_0xe6af4b);});}else{return request({'event':_0x0fa4('0x34'),'message':_0x2f14f5});}});};}function afterCreate(_0x1c0c8d,_0x562ad1){return function(_0x390702,_0x5ef0f4){_0x390702=_0x390702['get']({'plain':!![]});_0x390702[_0x0fa4('0x24')]=_0x1c0c8d;_0x390702[_0x0fa4('0x35')]=_0x1c0c8d;_0x390702['event']=_0x0fa4('0x36');var _0x5a604f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x390702['ContactId'];return db['sequelize'][_0x0fa4('0x29')](_0x5a604f,{'type':db[_0x0fa4('0x37')][_0x0fa4('0x38')][_0x0fa4('0x39')],'raw':!![]})[_0x0fa4('0x1d')](function(_0x1b3a2a){return _0x1b3a2a;})['then'](function(_0x31a7bf){if(_0x31a7bf){_0x390702['contact']=_0x31a7bf[0x0];}return request({'event':_0x562ad1,'message':_0x390702});});};}function afterUpdate(_0x574795){return function(_0x1ab504){var _0x42a738=_0x1ab504[_0x0fa4('0x3a')](_0x0fa4('0x3b'))&&_0x1ab504[_0x0fa4('0x3b')];var _0x135251=_0x1ab504['changed'](_0x0fa4('0x3c'));if(_0x42a738||_0x135251){var _0xd99135=_0x42a738?_0x0fa4('0x9'):_0x0fa4('0x3c');var _0x4d10e1=_0x1ab504[_0x0fa4('0x23')]({'plain':!![]});_0x4d10e1[_0x0fa4('0x24')]=_0x574795;_0x4d10e1[_0x0fa4('0x35')]=_0x574795;_0x4d10e1[_0x0fa4('0x25')]=_0x42a738?_0x0fa4('0x3b'):_0x0fa4('0x3c');var _0x3982a2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d10e1[_0x0fa4('0x3d')];return db[_0x0fa4('0x28')][_0x0fa4('0x29')](_0x3982a2,{'type':db[_0x0fa4('0x37')][_0x0fa4('0x38')]['SELECT'],'raw':!![]})['then'](function(_0x183241){if(_0x183241){_0x4d10e1[_0x0fa4('0x3e')]=_0x183241[0x0];}if(_0x4d10e1[_0x0fa4('0x2a')]){return db[_0x0fa4('0x2b')][_0x0fa4('0x2c')]({'where':{'id':_0x4d10e1[_0x0fa4('0x2a')]},'attributes':['id',_0x0fa4('0x2d'),'fullname',_0x0fa4('0x2e'),_0x0fa4('0x2f')],'raw':!![]})[_0x0fa4('0x1d')](function(_0x1a8f6c){_0x4d10e1[_0x0fa4('0x3f')]=util['format'](_0x0fa4('0x31'),_0x1a8f6c[_0x0fa4('0x2d')]);_0x4d10e1[_0x0fa4('0x32')]=_0x1a8f6c;return request({'event':_0xd99135,'message':_0x4d10e1});})[_0x0fa4('0x22')](function(_0x3f238f){console[_0x0fa4('0x20')](_0x3f238f);});}else{return request({'event':_0xd99135,'message':_0x4d10e1});}});}};}exports[_0x0fa4('0x40')]=function(){for(var _0x426dbe=0x0;_0x426dbe<triggers['length'];_0x426dbe+=0x1){if(db[_0x0fa4('0x41')](triggers[_0x426dbe][_0x0fa4('0x42')])){db[triggers[_0x426dbe][_0x0fa4('0x42')]][_0x0fa4('0x43')](triggers[_0x426dbe][_0x0fa4('0x25')],triggers[_0x426dbe][_0x0fa4('0x44')](triggers[_0x426dbe][_0x0fa4('0x24')][_0x0fa4('0x45')](),triggers[_0x426dbe][_0x0fa4('0x46')]));}}};
\ No newline at end of file
index 132944e..20042c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1166=['voice','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util'];(function(_0x483ebd,_0x518149){var _0x337843=function(_0x5ef04a){while(--_0x5ef04a){_0x483ebd['push'](_0x483ebd['shift']());}};_0x337843(++_0x518149);}(_0x1166,0xc4));var _0x6116=function(_0x5a690b,_0x1c6a55){_0x5a690b=_0x5a690b-0x0;var _0x3312d9=_0x1166[_0x5a690b];return _0x3312d9;};'use strict';var _=require(_0x6116('0x0'));var BPromise=require(_0x6116('0x1'));var db=require(_0x6116('0x2'))['db'];var util=require(_0x6116('0x3'));var channels=[_0x6116('0x4'),'mail',_0x6116('0x5'),_0x6116('0x6'),_0x6116('0x7'),_0x6116('0x8'),_0x6116('0x9')];exports[_0x6116('0xa')]=function(){return channels;};exports[_0x6116('0xb')]=function(_0x48829e){_0x48829e=_0x48829e[_0x6116('0xc')]();return _[_0x6116('0xd')](channels,_0x48829e);};exports['clearBlockUser']=function(_0xc64b29,_0x2e63fb,_0x319471,_0x19b799){var _0x757760={'loginAttempts':_0x2e63fb,'blocked':_0x319471};if(!_[_0x6116('0xe')](_0x19b799)){_0x757760[_0x6116('0xf')]=_0x19b799;}return _0xc64b29[_0x6116('0x10')](_0x757760);};exports[_0x6116('0x11')]=function(_0x1a3001){return new BPromise(function(_0x542622,_0x4e754d){var _0x1882a5=0x0;if(_0x1a3001[_0x6116('0x12')]!==_0x6116('0x13')){_0x542622(_0x1a3001);}db['User'][_0x6116('0x14')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1a3001['id']}}})[_0x6116('0x15')](function(_0xc6113b){_0x1882a5=_0xc6113b;return util[_0x6116('0x11')]();})[_0x6116('0x15')](function(_0x4e4d2c){if(_0x4e4d2c&&_0x4e4d2c[_0x6116('0x16')]&&_0x1882a5>=_0x4e4d2c[_0x6116('0x16')]){throw Error(_0x6116('0x17'));}_0x542622(_0x1a3001);})[_0x6116('0x18')](function(_0x42784c){_0x4e754d(_0x42784c);});});};
\ No newline at end of file
+var _0xbbf4=['includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','role','agent','getLicense','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','mail','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase'];(function(_0x2ab626,_0x4b0be4){var _0x55b333=function(_0x3f14d5){while(--_0x3f14d5){_0x2ab626['push'](_0x2ab626['shift']());}};_0x55b333(++_0x4b0be4);}(_0xbbf4,0x138));var _0x4bbf=function(_0x81764f,_0x2412f1){_0x81764f=_0x81764f-0x0;var _0xa36c1b=_0xbbf4[_0x81764f];return _0xa36c1b;};'use strict';var _=require(_0x4bbf('0x0'));var BPromise=require(_0x4bbf('0x1'));var db=require(_0x4bbf('0x2'))['db'];var util=require(_0x4bbf('0x3'));var channels=['voice',_0x4bbf('0x4'),_0x4bbf('0x5'),_0x4bbf('0x6'),_0x4bbf('0x7'),_0x4bbf('0x8'),_0x4bbf('0x9')];exports[_0x4bbf('0xa')]=function(){return channels;};exports[_0x4bbf('0xb')]=function(_0x2410af){_0x2410af=_0x2410af[_0x4bbf('0xc')]();return _[_0x4bbf('0xd')](channels,_0x2410af);};exports[_0x4bbf('0xe')]=function(_0x2ac04b,_0x3e8508,_0x3935ba,_0x32719f){var _0x4f4a1e={'loginAttempts':_0x3e8508,'blocked':_0x3935ba};if(!_[_0x4bbf('0xf')](_0x32719f)){_0x4f4a1e[_0x4bbf('0x10')]=_0x32719f;}return _0x2ac04b[_0x4bbf('0x11')](_0x4f4a1e);};exports['getLicense']=function(_0xad97f3){return new BPromise(function(_0x254dd8,_0x2204c6){var _0x7c0d40=0x0;if(_0xad97f3[_0x4bbf('0x12')]!=='agent'){_0x254dd8(_0xad97f3);}db['User']['count']({'where':{'role':_0x4bbf('0x13'),'online':!![],'id':{'$ne':_0xad97f3['id']}}})['then'](function(_0x1d38ef){_0x7c0d40=_0x1d38ef;return util[_0x4bbf('0x14')]();})[_0x4bbf('0x15')](function(_0x3407e4){if(_0x3407e4&&_0x3407e4['agents']&&_0x7c0d40>=_0x3407e4[_0x4bbf('0x16')]){throw Error(_0x4bbf('0x17'));}_0x254dd8(_0xad97f3);})[_0x4bbf('0x18')](function(_0x365a9c){_0x2204c6(_0x365a9c);});});};
\ No newline at end of file
index 7860440..419f456 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e01=['exports','render','status','json','send'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x8e01,0x1f4));var _0x18e0=function(_0x2eea26,_0x48559e){_0x2eea26=_0x2eea26-0x0;var _0x2daf27=_0x8e01[_0x2eea26];return _0x2daf27;};'use strict';module[_0x18e0('0x0')][0x194]=function pageNotFound(_0x1b4f2a,_0x5d4060){var _0xbdffc3='404';var _0xb1b8ab=0x194;var _0x18d62f={'status':_0xb1b8ab};_0x5d4060['status'](_0x18d62f['status']);_0x5d4060[_0x18e0('0x1')](_0xbdffc3,{},function(_0x458767,_0x26b876){if(_0x458767){return _0x5d4060[_0x18e0('0x2')](_0x18d62f['status'])[_0x18e0('0x3')](_0x18d62f);}_0x5d4060[_0x18e0('0x4')](_0x26b876);});};
\ No newline at end of file
+var _0xaf33=['exports','status','render','json'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xaf33,0x12c));var _0x3af3=function(_0x185fae,_0x32ba5a){_0x185fae=_0x185fae-0x0;var _0x1e0c34=_0xaf33[_0x185fae];return _0x1e0c34;};'use strict';module[_0x3af3('0x0')][0x194]=function pageNotFound(_0x31ed94,_0x31d117){var _0x15220c='404';var _0xf4097c=0x194;var _0x1d8c1b={'status':_0xf4097c};_0x31d117[_0x3af3('0x1')](_0x1d8c1b[_0x3af3('0x1')]);_0x31d117[_0x3af3('0x2')](_0x15220c,{},function(_0x285f25,_0xdb6f00){if(_0x285f25){return _0x31d117[_0x3af3('0x1')](_0x1d8c1b[_0x3af3('0x1')])[_0x3af3('0x3')](_0x1d8c1b);}_0x31d117['send'](_0xdb6f00);});};
\ No newline at end of file
index 56a8d10..1e787b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','CmHopperFinal','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','WhatsappInteractions','UserNotification','belongsTo','userProfileId','belongsToMany','ChatGroup','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','SquareProjects','SpiedAgents','ChanSpyId','VoiceExtension','VoiceMusicOnHold','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','VoiceMail','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','Applications','List','ListId','TemplateId','mandatoryDispositionPauseId','Team','team_has_mail_queues','MailInteractionId','Account','Contact','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachment','Attachments','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','Tag','TagId','Items','FaxAccountId','Exntensions','FaxQueue','fax_interaction_has_tags','FaxInteractionId','AttachmentId','SmsAccountId','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelMessage','Interaction','OpenchannelQueueId','ChatProactiveAction','ProactiveActions','ChatApplication','ChatMessage','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Hoppers','Company','CompanyId','cm_contact_has_tags','Queue','CampaignId','OwnerId','OneAll','Any','AutomationAnyId','Actions','ParentId','ChatApplications','FaxApplications','DefaultReportId','Mohs','sms_interaction_has_tags','whatsapp_interaction_has_tags','AllCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','AnalyticDefaultReport','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','AccountId','SalesforceField','Subjects','SubjectId','DescriptionId','Subject','Description','Descriptions','FieldId','Field','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','FromId','ToId','user_has_square_projects','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','SquareProjectId','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','Extensions','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','database','options','username','User','../api/user/user.model','VoiceChanSpy','import','VoiceContext','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserChatQueue','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','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/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareMessage','../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','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue'];(function(_0x37dbed,_0x2c0938){var _0x55c0f2=function(_0x3992c4){while(--_0x3992c4){_0x37dbed['push'](_0x37dbed['shift']());}};_0x55c0f2(++_0x2c0938);}(_0xf4eb,0xec));var _0xbf4e=function(_0x24afb9,_0x408a2b){_0x24afb9=_0x24afb9-0x0;var _0x479418=_0xf4eb[_0x24afb9];return _0x479418;};'use strict';var config=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz['determine']();config[_0xbf4e('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0xbf4e('0x2'),'username':_0xbf4e('0x3'),'password':_0xbf4e('0x4'),'options':{'host':_0xbf4e('0x5'),'port':0xcea,'dialect':_0xbf4e('0x6'),'dialectOptions':{'charset':_0xbf4e('0x7')},'logging':![],'timezone':timezone[_0xbf4e('0x8')](),'define':{'charset':'utf8','collate':_0xbf4e('0x9')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0xbf4e('0xa')],{'database':_0xbf4e('0x2'),'username':_0xbf4e('0x3'),'password':_0xbf4e('0x4'),'options':{'host':_0xbf4e('0x5'),'port':0xcea,'dialect':_0xbf4e('0x6'),'dialectOptions':{'charset':_0xbf4e('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xbf4e('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xbf4e('0xb')],config[_0xbf4e('0x1')]['username'],config[_0xbf4e('0x1')]['password'],config['sequelize'][_0xbf4e('0xc')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbf4e('0xa')][_0xbf4e('0xb')],config[_0xbf4e('0xa')][_0xbf4e('0xd')],config[_0xbf4e('0xa')]['password'],config['sequelizeHistory'][_0xbf4e('0xc')])};db[_0xbf4e('0xe')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xf'));db[_0xbf4e('0x10')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xbf4e('0x12')]=db['sequelize']['import']('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x13'));db['VoiceMusicOnHold']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x14'));db[_0xbf4e('0x15')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x16'));db[_0xbf4e('0x17')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x18'));db[_0xbf4e('0x19')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x1a'));db['VoiceMail']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x1b'));db[_0xbf4e('0x1c')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x1d'));db[_0xbf4e('0x1e')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x1f'));db['VoiceDialReport']=db['sequelize'][_0xbf4e('0x11')]('../api/voiceDialReport/voiceDialReport.model');db[_0xbf4e('0x20')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x21'));db['VoiceQueueReport']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x22'));db['MemberReport']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x23'));db[_0xbf4e('0x24')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x25'));db[_0xbf4e('0x26')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x27'));db[_0xbf4e('0x28')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x29'));db['UserVoiceQueue']=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xbf4e('0x2a')]=db['sequelize'][_0xbf4e('0x11')]('../api/userChatQueue/userChatQueue.model');db[_0xbf4e('0x2b')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/userMailQueue/userMailQueue.model');db[_0xbf4e('0x2c')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x2d'));db[_0xbf4e('0x2e')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x2f'));db[_0xbf4e('0x30')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x31'));db['UserWhatsappQueue']=db['sequelize']['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xbf4e('0x32')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x33'));db[_0xbf4e('0x34')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x35'));db[_0xbf4e('0x36')]=db['sequelize']['import'](_0xbf4e('0x37'));db[_0xbf4e('0x38')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x39'));db['MailSubstatus']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x3a'));db[_0xbf4e('0x3b')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x3c'));db[_0xbf4e('0x3d')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x3e'));db[_0xbf4e('0x3f')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x40'));db[_0xbf4e('0x41')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x42'));db[_0xbf4e('0x43')]=db['sequelize']['import'](_0xbf4e('0x44'));db[_0xbf4e('0x45')]=db['sequelize']['import'](_0xbf4e('0x46'));db[_0xbf4e('0x47')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x48'));db[_0xbf4e('0x49')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x4a'));db['FaxInteraction']=db['sequelize']['import']('../api/faxInteraction/faxInteraction.model');db[_0xbf4e('0x4b')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x4c'));db['FaxQueue']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x4d'));db[_0xbf4e('0x4e')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/faxQueueReport/faxQueueReport.model');db[_0xbf4e('0x4f')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x50'));db[_0xbf4e('0x51')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x52'));db['SmsInteraction']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x53'));db[_0xbf4e('0x54')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x55'));db[_0xbf4e('0x56')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x57'));db[_0xbf4e('0x58')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x59'));db[_0xbf4e('0x5a')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x5b'));db[_0xbf4e('0x5c')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x5d'));db['OpenchannelMessage']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x5e'));db['OpenchannelQueue']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x5f'));db[_0xbf4e('0x60')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x61'));db[_0xbf4e('0x62')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x63'));db['ChatApplication']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x64'));db[_0xbf4e('0x65')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x66'));db['ChatMessage']=db['sequelize'][_0xbf4e('0x11')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x67'));db[_0xbf4e('0x68')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x69'));db['ChatGroup']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x6a'));db['ChatProactiveAction']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x6b'));db[_0xbf4e('0x6c')]=db[_0xbf4e('0x1')]['import']('../api/cmCompany/cmCompany.model');db['CmContact']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x6d'));db['CmHopper']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x6e'));db[_0xbf4e('0x6f')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x70'));db['CmHopperFinal']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x71'));db['CmHopperHistory']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x72'));db[_0xbf4e('0x73')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x74'));db[_0xbf4e('0x75')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x76'));db[_0xbf4e('0x77')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x78'));db[_0xbf4e('0x79')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x7a'));db['CannedAnswer']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x7b'));db[_0xbf4e('0x7c')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x7d'));db[_0xbf4e('0x7e')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x7f'));db[_0xbf4e('0x80')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/interval/interval.model');db[_0xbf4e('0x81')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x82'));db[_0xbf4e('0x83')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x84'));db['VoiceQueuesLog']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x85'));db[_0xbf4e('0x86')]=db['sequelize'][_0xbf4e('0x11')]('../api/schedule/schedule.model');db['Sound']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x87'));db['Tag']=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/tag/tag.model');db[_0xbf4e('0x88')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x89'));db[_0xbf4e('0x8a')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x8b'));db[_0xbf4e('0x8c')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x8d'));db[_0xbf4e('0x8e')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x8f'));db[_0xbf4e('0x90')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x91'));db[_0xbf4e('0x92')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x93'));db['AnalyticDefaultReport']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x94'));db[_0xbf4e('0x95')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x96'));db['AnalyticMetric']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x97'));db['AnalyticFieldReport']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x98'));db['AnalyticTreeReport']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x99'));db[_0xbf4e('0x9a')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x9b'));db['SalesforceConfiguration']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x9c'));db['SalesforceField']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x9d'));db[_0xbf4e('0x9e')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x9f'));db[_0xbf4e('0xa0')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xa1'));db[_0xbf4e('0xa2')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xa3'));db[_0xbf4e('0xa4')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xa5'));db['DeskConfiguration']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xa6'));db[_0xbf4e('0xa7')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xa8'));db[_0xbf4e('0xa9')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xaa'));db[_0xbf4e('0xab')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xac'));db[_0xbf4e('0xad')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xae'));db[_0xbf4e('0xaf')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xb0'));db[_0xbf4e('0xb1')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xb2'));db['ZendeskField']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xb3'));db[_0xbf4e('0xb4')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xb5'));db[_0xbf4e('0xb6')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xb7'));db[_0xbf4e('0xb8')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xb9'));db[_0xbf4e('0xba')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xbb'));db[_0xbf4e('0xbc')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xbd'));db[_0xbf4e('0xbe')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xbf'));db[_0xbf4e('0xc0')]=db['sequelize']['import'](_0xbf4e('0xc1'));db[_0xbf4e('0xc2')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xc3'));db[_0xbf4e('0xc4')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xc5'));db[_0xbf4e('0xc6')]=db[_0xbf4e('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xbf4e('0xc7')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xbf4e('0xc8')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xbf4e('0xc9')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xca'));db[_0xbf4e('0xcb')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xcc'));db[_0xbf4e('0xcd')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xbf4e('0x8e')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x8f'));db[_0xbf4e('0xce')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xcf'));db[_0xbf4e('0xd0')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xd1'));db[_0xbf4e('0xd2')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xd3'));db[_0xbf4e('0xd4')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xbf4e('0xd5')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xd6'));db[_0xbf4e('0xd7')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xd8'));db[_0xbf4e('0xd9')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/smsQueueReport/smsQueueReport.model');db[_0xbf4e('0xda')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xdb'));db[_0xbf4e('0xdc')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xdd'));db[_0xbf4e('0xde')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xdf'));db[_0xbf4e('0xe0')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/setting/setting.model');db['SquareOdbc']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xe1'));db[_0xbf4e('0xe2')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xe3'));db['SquareRecording']=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/squareRecording/squareRecording.model');db[_0xbf4e('0xe4')]=db['sequelize'][_0xbf4e('0x11')]('../api/squareMessage/squareMessage.model');db['Team']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xe5'));db['License']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xe6'));db[_0xbf4e('0xe7')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xe8'));db[_0xbf4e('0xe9')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xea'));db['Attachment']=db['sequelize']['import'](_0xbf4e('0xeb'));db[_0xbf4e('0xec')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xed'));db[_0xbf4e('0xee')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xef'));db[_0xbf4e('0xf0')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xf1'));db[_0xbf4e('0xf2')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xf3'));db[_0xbf4e('0xf4')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xf5'));db[_0xbf4e('0xf6')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xf7'));db['CmList']=db['sequelize'][_0xbf4e('0x11')]('../api/cmList/cmList.model');db[_0xbf4e('0xf8')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xf9'));db[_0xbf4e('0xfa')]=db['sequelize']['import'](_0xbf4e('0xfb'));db[_0xbf4e('0xfc')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xfd'));db['UserProfileResource']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xfe'));db['UserNotification']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xff'));db['WhatsappAccount']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x100'));db[_0xbf4e('0x101')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x102'));db[_0xbf4e('0x103')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x104'));db[_0xbf4e('0x105')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x106'));db['WhatsappQueueReport']=db['sequelize']['import'](_0xbf4e('0x107'));db['WhatsappTransferReport']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x108'));db[_0xbf4e('0x109')]=db['sequelize']['import']('../api/whatsappQueue/whatsappQueue.model');db[_0xbf4e('0x10a')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x10b'));db[_0xbf4e('0x10c')]=db[_0xbf4e('0x1')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xbf4e('0x10d')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x10e'));db[_0xbf4e('0x10f')]=db['sequelize']['import'](_0xbf4e('0x110'));db[_0xbf4e('0xe')][_0xbf4e('0x111')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')]['hasMany'](db[_0xbf4e('0x17')],{'as':_0xbf4e('0x114'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x28')],{'as':_0xbf4e('0x116'),'foreignKey':'UserId'});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x117')],{'as':_0xbf4e('0x118'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')]['hasMany'](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x11a'),'foreignKey':'UserId'});db['User'][_0xbf4e('0x115')](db['ReportAgentPreview'],{'as':_0xbf4e('0x73'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x5c')],{'as':_0xbf4e('0x11b'),'foreignKey':_0xbf4e('0x113')});db['User']['hasMany'](db['ChatInteraction'],{'as':_0xbf4e('0x11c'),'foreignKey':'UserId'});db[_0xbf4e('0xe')]['hasMany'](db['SmsInteraction'],{'as':_0xbf4e('0x11d'),'foreignKey':'UserId'});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x11e')],{'as':_0xbf4e('0x11f'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x103')],{'as':_0xbf4e('0x120'),'foreignKey':_0xbf4e('0x113')});db['User']['hasMany'](db[_0xbf4e('0x121')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0xbf4e('0xe')][_0xbf4e('0x122')](db[_0xbf4e('0xfa')],{'as':_0xbf4e('0xfa'),'foreignKey':_0xbf4e('0x123')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x125')],{'as':'Groups','through':_0xbf4e('0x126')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x128'),'through':_0xbf4e('0x129')});db[_0xbf4e('0xe')]['belongsToMany'](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x12b'),'through':_0xbf4e('0x12c')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db['Team'],{'through':_0xbf4e('0x12d')});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x3b')],{'as':_0xbf4e('0x12e'),'through':'user_has_mail_interactions'});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x65')],{'as':_0xbf4e('0x11c'),'through':_0xbf4e('0x12f')});db['User'][_0xbf4e('0x124')](db['FaxInteraction'],{'as':_0xbf4e('0x11f'),'through':_0xbf4e('0x130')});db[_0xbf4e('0xe')]['belongsToMany'](db[_0xbf4e('0x131')],{'as':_0xbf4e('0x11d'),'through':_0xbf4e('0x132')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db['OpenchannelInteraction'],{'as':_0xbf4e('0x11b'),'through':'user_has_openchannel_interactions'});db['User'][_0xbf4e('0x124')](db['WhatsappInteraction'],{'as':_0xbf4e('0x120'),'through':_0xbf4e('0x133')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x15')],{'as':_0xbf4e('0x134'),'through':_0xbf4e('0x135'),'required':![]});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0xf8')],{'as':_0xbf4e('0x136'),'through':_0xbf4e('0x10f'),'required':![]});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x38')],{'as':_0xbf4e('0x137'),'through':_0xbf4e('0x2b'),'required':![]});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x68')],{'as':_0xbf4e('0x138'),'through':_0xbf4e('0x2a'),'required':![],'hooks':!![]});db[_0xbf4e('0xe')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db['User']['belongsToMany'](db[_0xbf4e('0x56')],{'as':_0xbf4e('0x139'),'through':_0xbf4e('0x2e'),'required':![]});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x13a')],{'as':_0xbf4e('0x13b'),'through':_0xbf4e('0x30'),'required':![]});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x109')],{'as':_0xbf4e('0x13c'),'through':_0xbf4e('0x13d'),'required':![]});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x12a')],{'through':'cm_user_has_lists'});db['User'][_0xbf4e('0x124')](db['ChatWebsite'],{'as':_0xbf4e('0x13e'),'through':'user_has_chat_websites'});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x47')],{'as':'FaxAccounts','through':_0xbf4e('0x13f')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x36')],{'as':'MailAccounts','through':_0xbf4e('0x140')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x58')],{'as':_0xbf4e('0x141'),'through':_0xbf4e('0x142')});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x4f')],{'as':_0xbf4e('0x143'),'through':_0xbf4e('0x144')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x145')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db['SquareProject'],{'as':_0xbf4e('0x146'),'through':'user_has_square_projects'});db[_0xbf4e('0x10')]['hasMany'](db['VoiceExtension'],{'as':_0xbf4e('0x147'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x148')});db[_0xbf4e('0x12')][_0xbf4e('0x115')](db['VoiceExtension'],{'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x149')][_0xbf4e('0x115')](db[_0xbf4e('0x149')],{'as':'Applications','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x14a')][_0xbf4e('0x124')](db[_0xbf4e('0x14b')],{'as':_0xbf4e('0x14c'),'through':_0xbf4e('0x14d')});db[_0xbf4e('0x15')][_0xbf4e('0x115')](db[_0xbf4e('0x28')],{'as':_0xbf4e('0x14e'),'foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')]['hasMany'](db[_0xbf4e('0x150')],{'as':'Hoppers','foreignKey':_0xbf4e('0x14f')});db['VoiceQueue']['hasMany'](db[_0xbf4e('0x117')],{'as':'HopperFinals','foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')]['hasMany'](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x151'),'foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')][_0xbf4e('0x115')](db[_0xbf4e('0x73')],{'as':'ReportAgentPreview','foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')][_0xbf4e('0x115')](db[_0xbf4e('0x6f')],{'as':_0xbf4e('0x152'),'foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')][_0xbf4e('0x115')](db['JscriptySessionReport'],{'as':_0xbf4e('0x153'),'foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')][_0xbf4e('0x122')](db[_0xbf4e('0x24')],{'as':_0xbf4e('0x24'),'foreignKey':_0xbf4e('0x154')});db['VoiceQueue']['belongsTo'](db[_0xbf4e('0x24')],{'as':_0xbf4e('0x155'),'foreignKey':_0xbf4e('0x156')});db['VoiceQueue'][_0xbf4e('0x122')](db[_0xbf4e('0x80')],{'as':'Interval','foreignKey':_0xbf4e('0x157')});db['VoiceQueue'][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':_0xbf4e('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbf4e('0x15')][_0xbf4e('0x124')](db[_0xbf4e('0x12a')],{'as':'Lists','through':_0xbf4e('0x159')});db[_0xbf4e('0x15')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x135')});db[_0xbf4e('0x15')][_0xbf4e('0x124')](db['Team'],{'as':_0xbf4e('0x15b'),'through':_0xbf4e('0x10c')});db[_0xbf4e('0x15')][_0xbf4e('0x124')](db[_0xbf4e('0x12a')],{'as':'BlackLists','through':_0xbf4e('0x15c')});db[_0xbf4e('0x17')]['belongsTo'](db['User'],{'as':_0xbf4e('0xe'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x19')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0xe'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x15d')][_0xbf4e('0x115')](db[_0xbf4e('0x1c')],{'as':_0xbf4e('0x15e'),'onDelete':'cascade','foreignKey':_0xbf4e('0x15f'),'sourceKey':_0xbf4e('0x160')});db[_0xbf4e('0x1c')]['belongsTo'](db[_0xbf4e('0x15d')],{'foreignKey':_0xbf4e('0x15f'),'targetKey':'mailbox'});db[_0xbf4e('0x1e')][_0xbf4e('0x115')](db[_0xbf4e('0x161')],{'as':'QueueCalls','foreignKey':_0xbf4e('0x162'),'constraints':![]});db[_0xbf4e('0x1e')][_0xbf4e('0x115')](db[_0xbf4e('0x20')],{'as':_0xbf4e('0x163'),'foreignKey':_0xbf4e('0x162'),'constraints':![]});db[_0xbf4e('0x1e')]['belongsTo'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0xe'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x1e')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':'Contact','foreignKey':'ContactId'});db[_0xbf4e('0x32')][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'as':_0xbf4e('0x36'),'foreignKey':_0xbf4e('0x164')});db[_0xbf4e('0x34')][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'as':'MailAccount','foreignKey':_0xbf4e('0x164')});db['MailAccount'][_0xbf4e('0x111')](db['MailServerIn'],{'as':_0xbf4e('0x165'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x36')][_0xbf4e('0x111')](db[_0xbf4e('0x34')],{'as':_0xbf4e('0x166'),'onDelete':'cascade'});db[_0xbf4e('0x36')]['hasMany'](db[_0xbf4e('0x7c')],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x164'),'onDelete':'cascade'});db[_0xbf4e('0x36')][_0xbf4e('0x115')](db[_0xbf4e('0x168')],{'as':_0xbf4e('0x169'),'foreignKey':_0xbf4e('0x164')});db['MailAccount'][_0xbf4e('0x115')](db[_0xbf4e('0x3d')],{'as':_0xbf4e('0x15e'),'foreignKey':'MailAccountId'});db[_0xbf4e('0x36')][_0xbf4e('0x115')](db[_0xbf4e('0x3b')],{'as':_0xbf4e('0x16a')});db[_0xbf4e('0x36')][_0xbf4e('0x115')](db[_0xbf4e('0x3f')],{'as':_0xbf4e('0x16b')});db[_0xbf4e('0x36')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x36')][_0xbf4e('0x122')](db[_0xbf4e('0x88')],{'as':_0xbf4e('0x88'),'foreignKey':_0xbf4e('0x16e')});db[_0xbf4e('0x36')]['belongsTo'](db[_0xbf4e('0x81')],{'as':_0xbf4e('0x158'),'foreignKey':_0xbf4e('0x16f')});db[_0xbf4e('0x36')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':'user_has_mail_accounts'});db['MailQueue'][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x2b')});db[_0xbf4e('0x38')][_0xbf4e('0x124')](db[_0xbf4e('0x170')],{'through':_0xbf4e('0x171'),'as':_0xbf4e('0x15b')});db[_0xbf4e('0x3b')]['hasMany'](db[_0xbf4e('0x3d')],{'as':_0xbf4e('0x15e'),'onDelete':'cascade','foreignKey':_0xbf4e('0x172')});db[_0xbf4e('0x3b')][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'as':_0xbf4e('0x173'),'foreignKey':'MailAccountId'});db[_0xbf4e('0x3b')]['belongsTo'](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x3b')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x176'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x3b')][_0xbf4e('0x124')](db['Tag'],{'through':_0xbf4e('0x177'),'as':_0xbf4e('0x178')});db[_0xbf4e('0x3b')][_0xbf4e('0x124')](db['Tag'],{'through':_0xbf4e('0x177'),'as':_0xbf4e('0x179')});db[_0xbf4e('0x3b')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x17b'),'foreignKey':_0xbf4e('0x172')});db[_0xbf4e('0x3d')]['hasMany'](db[_0xbf4e('0x17c')],{'as':_0xbf4e('0x17d'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x3d')][_0xbf4e('0x122')](db['User'],{'as':_0xbf4e('0xe')});db[_0xbf4e('0x3d')]['belongsTo'](db['CmContact'],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0x174')});db[_0xbf4e('0x3d')][_0xbf4e('0x122')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0xbf4e('0x172')});db['MailMessage'][_0xbf4e('0x122')](db['MailAccount'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x164')});db[_0xbf4e('0x3d')][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'as':'ChatWebsite','foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x3d')][_0xbf4e('0x122')](db['ChatOfflineMessage'],{'as':_0xbf4e('0x17f'),'foreignKey':_0xbf4e('0x180')});db[_0xbf4e('0x3f')]['belongsTo'](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x3f')][_0xbf4e('0x122')](db[_0xbf4e('0x38')],{'onDelete':_0xbf4e('0x181')});db['MailApplication'][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x3f')][_0xbf4e('0x122')](db['Interval'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x157')});db['MailApplication']['belongsTo'](db[_0xbf4e('0x182')],{'onDelete':'restrict','foreignKey':_0xbf4e('0x183')});db[_0xbf4e('0x41')]['belongsTo'](db[_0xbf4e('0x36')],{});db[_0xbf4e('0x41')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db['MailQueueReport'][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db['MailQueueReport'][_0xbf4e('0x122')](db['MailInteraction'],{});db[_0xbf4e('0x41')][_0xbf4e('0x122')](db[_0xbf4e('0x3d')],{});db[_0xbf4e('0x41')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{});db[_0xbf4e('0x41')][_0xbf4e('0x122')](db['MailQueue'],{});db[_0xbf4e('0x43')][_0xbf4e('0x115')](db[_0xbf4e('0x45')],{'as':_0xbf4e('0x184'),'onDelete':'cascade'});db['FaxAccount'][_0xbf4e('0x115')](db[_0xbf4e('0x7c')],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x185'),'onDelete':'cascade'});db['FaxAccount'][_0xbf4e('0x115')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xbf4e('0x185')});db[_0xbf4e('0x47')][_0xbf4e('0x115')](db[_0xbf4e('0x11e')],{'as':'Interactions'});db['FaxAccount'][_0xbf4e('0x115')](db['FaxApplication'],{'as':'Applications'});db[_0xbf4e('0x47')][_0xbf4e('0x115')](db[_0xbf4e('0x149')],{'as':_0xbf4e('0x186'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x47')][_0xbf4e('0x115')](db[_0xbf4e('0x4b')],{'as':'Messages'});db[_0xbf4e('0x47')][_0xbf4e('0x122')](db[_0xbf4e('0x24')],{'as':_0xbf4e('0x24')});db['FaxAccount'][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':'ListId'});db[_0xbf4e('0x47')][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xbf4e('0x16f')});db[_0xbf4e('0x47')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Agents','through':_0xbf4e('0x13f')});db[_0xbf4e('0x49')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x181')});db['FaxApplication'][_0xbf4e('0x122')](db[_0xbf4e('0x187')],{'onDelete':'restrict'});db[_0xbf4e('0x49')][_0xbf4e('0x122')](db[_0xbf4e('0x47')],{'onDelete':_0xbf4e('0x181')});db['FaxApplication'][_0xbf4e('0x122')](db['Tag'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x183')});db[_0xbf4e('0x11e')]['hasMany'](db['FaxMessage'],{'as':_0xbf4e('0x15e'),'onDelete':_0xbf4e('0x112'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xbf4e('0x122')](db[_0xbf4e('0x47')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x185')});db['FaxInteraction'][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':'Contact','foreignKey':_0xbf4e('0x175')});db['FaxInteraction']['belongsTo'](db['User'],{'as':_0xbf4e('0x176'),'foreignKey':'UserId'});db['FaxInteraction'][_0xbf4e('0x124')](db['Tag'],{'through':_0xbf4e('0x188'),'as':_0xbf4e('0x178')});db[_0xbf4e('0x11e')]['belongsToMany'](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x188'),'as':_0xbf4e('0x179')});db[_0xbf4e('0x11e')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0xbf4e('0x189')});db['FaxMessage'][_0xbf4e('0x122')](db['User'],{'onDelete':'cascade','as':_0xbf4e('0xe')});db['FaxMessage'][_0xbf4e('0x122')](db['FaxInteraction'],{'as':'Interaction','foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'onDelete':'cascade','as':_0xbf4e('0x174')});db[_0xbf4e('0x4b')][_0xbf4e('0x122')](db['Attachment'],{'as':_0xbf4e('0x17c'),'foreignKey':_0xbf4e('0x18a')});db[_0xbf4e('0x4b')]['belongsTo'](db[_0xbf4e('0x47')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x185')});db['FaxQueue'][_0xbf4e('0x124')](db['User'],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x2c')});db[_0xbf4e('0x187')][_0xbf4e('0x124')](db['Team'],{'through':'team_has_fax_queues','as':_0xbf4e('0x15b')});db[_0xbf4e('0x4e')]['belongsTo'](db[_0xbf4e('0x47')],{});db[_0xbf4e('0x4e')]['belongsTo'](db[_0xbf4e('0x12a')],{'as':'List','foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x4e')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x4e')][_0xbf4e('0x122')](db[_0xbf4e('0x11e')],{});db[_0xbf4e('0x4e')][_0xbf4e('0x122')](db[_0xbf4e('0x4b')],{});db[_0xbf4e('0x4e')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{});db[_0xbf4e('0x4e')]['belongsTo'](db['FaxQueue'],{});db[_0xbf4e('0x4f')][_0xbf4e('0x115')](db['Disposition'],{'as':_0xbf4e('0x167'),'foreignKey':'SmsAccountId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x4f')]['hasMany'](db['CannedAnswer'],{'as':_0xbf4e('0x169'),'foreignKey':_0xbf4e('0x18b')});db[_0xbf4e('0x4f')]['hasMany'](db[_0xbf4e('0x54')],{'as':_0xbf4e('0x15e'),'foreignKey':_0xbf4e('0x18b')});db['SmsAccount'][_0xbf4e('0x115')](db['SmsInteraction'],{'as':_0xbf4e('0x16a')});db[_0xbf4e('0x4f')]['hasMany'](db[_0xbf4e('0x51')],{'as':_0xbf4e('0x16b')});db[_0xbf4e('0x4f')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':'List','foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x4f')][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':_0xbf4e('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbf4e('0x4f')][_0xbf4e('0x124')](db['User'],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x144')});db[_0xbf4e('0x51')][_0xbf4e('0x122')](db['User'],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x51')][_0xbf4e('0x122')](db['SmsQueue'],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x51')][_0xbf4e('0x122')](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication'][_0xbf4e('0x122')](db[_0xbf4e('0x80')],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x157')});db['SmsApplication'][_0xbf4e('0x122')](db['Tag'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x183')});db['SmsInteraction'][_0xbf4e('0x115')](db[_0xbf4e('0x54')],{'as':_0xbf4e('0x15e'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x18c')});db[_0xbf4e('0x131')][_0xbf4e('0x122')](db[_0xbf4e('0x4f')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x18b')});db['SmsInteraction']['belongsTo'](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x131')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x176'),'foreignKey':_0xbf4e('0x113')});db['SmsInteraction'][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':'sms_interaction_has_tags','as':_0xbf4e('0x178')});db[_0xbf4e('0x131')][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':'sms_interaction_has_tags','as':_0xbf4e('0x179')});db[_0xbf4e('0x131')][_0xbf4e('0x124')](db['User'],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x132'),'foreignKey':_0xbf4e('0x18c')});db[_0xbf4e('0x54')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0xe')});db[_0xbf4e('0x54')][_0xbf4e('0x122')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db['SmsMessage'][_0xbf4e('0x122')](db[_0xbf4e('0x131')],{'onDelete':_0xbf4e('0x112'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0xbf4e('0x54')][_0xbf4e('0x122')](db[_0xbf4e('0x4f')],{'as':_0xbf4e('0x173'),'foreignKey':'SmsAccountId'});db[_0xbf4e('0x56')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Agents','through':_0xbf4e('0x2e'),'foreignKey':_0xbf4e('0x18d')});db[_0xbf4e('0x56')][_0xbf4e('0x124')](db[_0xbf4e('0x170')],{'through':'team_has_sms_queues','as':_0xbf4e('0x15b')});db[_0xbf4e('0x58')][_0xbf4e('0x115')](db[_0xbf4e('0x7c')],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x58')][_0xbf4e('0x115')](db[_0xbf4e('0x168')],{'as':_0xbf4e('0x169'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xbf4e('0x115')](db[_0xbf4e('0x5c')],{'as':_0xbf4e('0x16a'),'foreignKey':_0xbf4e('0x18e')});db[_0xbf4e('0x58')][_0xbf4e('0x115')](db['OpenchannelMessage'],{'as':_0xbf4e('0x15e'),'foreignKey':_0xbf4e('0x18e')});db['OpenchannelAccount']['hasMany'](db['OpenchannelApplication'],{'as':_0xbf4e('0x16b'),'foreignKey':_0xbf4e('0x18e')});db[_0xbf4e('0x58')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':'List','foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x58')][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xbf4e('0x16f')});db['OpenchannelAccount'][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x142')});db[_0xbf4e('0x5a')]['belongsTo'](db['User'],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x5a')][_0xbf4e('0x122')](db[_0xbf4e('0x13a')],{'onDelete':_0xbf4e('0x181'),'foreignKey':'OpenchannelQueueId'});db[_0xbf4e('0x5a')][_0xbf4e('0x122')](db[_0xbf4e('0x58')],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x18e')});db[_0xbf4e('0x5a')][_0xbf4e('0x122')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x5a')]['belongsTo'](db[_0xbf4e('0x182')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xbf4e('0x5c')][_0xbf4e('0x115')](db['OpenchannelMessage'],{'as':_0xbf4e('0x15e'),'onDelete':'cascade','foreignKey':_0xbf4e('0x18f')});db[_0xbf4e('0x5c')][_0xbf4e('0x122')](db['OpenchannelAccount'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x18e')});db[_0xbf4e('0x5c')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':'ContactId'});db[_0xbf4e('0x5c')]['belongsTo'](db[_0xbf4e('0xe')],{'as':'Owner','foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x5c')][_0xbf4e('0x124')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0xbf4e('0x5c')]['belongsToMany'](db['Tag'],{'through':_0xbf4e('0x190'),'as':_0xbf4e('0x179')});db[_0xbf4e('0x5c')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Users','through':_0xbf4e('0x191'),'foreignKey':_0xbf4e('0x18f')});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0xe')});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0x174')});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db['OpenchannelInteraction'],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0x193'),'foreignKey':'OpenchannelInteractionId'});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db[_0xbf4e('0x17c')],{'as':_0xbf4e('0x17c'),'foreignKey':_0xbf4e('0x18a')});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db[_0xbf4e('0x58')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue']['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x30'),'foreignKey':_0xbf4e('0x194')});db[_0xbf4e('0x13a')][_0xbf4e('0x124')](db[_0xbf4e('0x170')],{'through':'team_has_openchannel_queues','as':_0xbf4e('0x15b')});db['ChatWebsite'][_0xbf4e('0x115')](db[_0xbf4e('0x7c')],{'as':'Dispositions','foreignKey':_0xbf4e('0x17e'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x60')][_0xbf4e('0x115')](db[_0xbf4e('0x168')],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0xbf4e('0x60')][_0xbf4e('0x115')](db[_0xbf4e('0x195')],{'as':_0xbf4e('0x196')});db[_0xbf4e('0x60')]['hasMany'](db['ChatInteraction'],{'as':_0xbf4e('0x16a')});db[_0xbf4e('0x60')][_0xbf4e('0x115')](db[_0xbf4e('0x197')],{'as':_0xbf4e('0x16b')});db['ChatWebsite'][_0xbf4e('0x115')](db[_0xbf4e('0x198')],{'as':_0xbf4e('0x15e')});db['ChatWebsite'][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x60')][_0xbf4e('0x122')](db[_0xbf4e('0x80')],{'as':'Interval','foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x60')][_0xbf4e('0x122')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xbf4e('0x164')});db[_0xbf4e('0x60')][_0xbf4e('0x122')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xbf4e('0x16f')});db[_0xbf4e('0x60')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':'user_has_chat_websites'});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db[_0xbf4e('0x58')],{});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db['CmList'],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db['CmContact'],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x62')]['belongsTo'](db[_0xbf4e('0x5c')],{});db[_0xbf4e('0x62')]['belongsTo'](db[_0xbf4e('0x192')],{});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db['OpenchannelQueue'],{});db[_0xbf4e('0x197')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x199'),'foreignKey':_0xbf4e('0x113'),'onDelete':'restrict'});db[_0xbf4e('0x197')][_0xbf4e('0x122')](db['ChatQueue'],{'as':'Queue','foreignKey':_0xbf4e('0x19a'),'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x197')][_0xbf4e('0x122')](db['ChatWebsite'],{'as':_0xbf4e('0x19b'),'foreignKey':_0xbf4e('0x17e'),'onDelete':_0xbf4e('0x181')});db['ChatApplication']['belongsTo'](db[_0xbf4e('0x182')],{'onDelete':'restrict','foreignKey':_0xbf4e('0x183')});db[_0xbf4e('0x65')][_0xbf4e('0x115')](db[_0xbf4e('0x198')],{'as':_0xbf4e('0x15e'),'onDelete':'cascade','foreignKey':_0xbf4e('0x19c')});db[_0xbf4e('0x65')][_0xbf4e('0x122')](db['ChatWebsite'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x65')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x65')]['belongsTo'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x176'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x65')]['belongsToMany'](db[_0xbf4e('0x182')],{'through':'chat_interaction_has_tags','as':_0xbf4e('0x178')});db[_0xbf4e('0x65')][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x19d'),'as':'ThroughTags'});db[_0xbf4e('0x65')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x12f'),'foreignKey':'ChatInteractionId'});db[_0xbf4e('0x198')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'onDelete':'cascade','as':_0xbf4e('0xe')});db['ChatMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x198')][_0xbf4e('0x122')](db['ChatInteraction'],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0x193'),'foreignKey':'ChatInteractionId'});db[_0xbf4e('0x198')]['belongsTo'](db[_0xbf4e('0x17c')],{'as':_0xbf4e('0x17c'),'foreignKey':_0xbf4e('0x18a')});db[_0xbf4e('0x198')][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'as':'Account','foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x17f')][_0xbf4e('0x115')](db['Attachment'],{'as':_0xbf4e('0x17d'),'foreignKey':_0xbf4e('0x180'),'onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x17f')]['belongsTo'](db[_0xbf4e('0x127')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x17f')][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x68')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Agents','through':_0xbf4e('0x2a'),'hooks':!![]});db[_0xbf4e('0x68')][_0xbf4e('0x124')](db[_0xbf4e('0x170')],{'through':_0xbf4e('0x19e'),'as':'Teams'});db[_0xbf4e('0x125')]['hasMany'](db[_0xbf4e('0xd2')],{'as':_0xbf4e('0x15e'),'foreignKey':_0xbf4e('0x19f'),'onDelete':'cascade'});db['ChatGroup'][_0xbf4e('0x124')](db['User'],{'as':'Members','through':_0xbf4e('0x126')});db['ChatProactiveAction'][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'as':_0xbf4e('0x19b'),'foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x6c')][_0xbf4e('0x115')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x128'),'foreignKey':'CompanyId'});db['CmContact'][_0xbf4e('0x115')](db[_0xbf4e('0x150')],{'as':_0xbf4e('0x1a0'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x127')][_0xbf4e('0x115')](db[_0xbf4e('0x117')],{'as':_0xbf4e('0x118'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x127')][_0xbf4e('0x115')](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x151'),'foreignKey':_0xbf4e('0x175')});db['CmContact'][_0xbf4e('0x115')](db[_0xbf4e('0x73')],{'as':_0xbf4e('0x73'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x127')]['hasMany'](db[_0xbf4e('0xd7')],{'as':_0xbf4e('0x153'),'foreignKey':'ContactId'});db[_0xbf4e('0x127')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xbf4e('0x11b'),'foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x181')});db['CmContact'][_0xbf4e('0x115')](db[_0xbf4e('0x65')],{'as':'ChatInteractions','foreignKey':_0xbf4e('0x175'),'onDelete':'restrict'});db[_0xbf4e('0x127')][_0xbf4e('0x115')](db[_0xbf4e('0x131')],{'as':_0xbf4e('0x11d'),'foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x181')});db['CmContact'][_0xbf4e('0x115')](db[_0xbf4e('0x11e')],{'as':_0xbf4e('0x11f'),'foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x127')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x181')});db['CmContact'][_0xbf4e('0x122')](db['CmCompany'],{'as':_0xbf4e('0x1a1'),'foreignKey':_0xbf4e('0x1a2')});db[_0xbf4e('0x127')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x127')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x129')});db[_0xbf4e('0x127')][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'as':_0xbf4e('0x178'),'through':'cm_contact_has_tags'});db[_0xbf4e('0x127')][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x1a3'),'as':'ThroughTags'});db['CmHopper']['belongsTo'](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':'ContactId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x150')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':'ListId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x150')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x199'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x150')][_0xbf4e('0x122')](db[_0xbf4e('0x15')],{'as':_0xbf4e('0x1a4'),'foreignKey':'VoiceQueueId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x150')]['belongsTo'](db[_0xbf4e('0xe7')],{'as':_0xbf4e('0xe7'),'foreignKey':_0xbf4e('0x1a5'),'onDelete':_0xbf4e('0x112')});db['CmHopper'][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x176'),'foreignKey':_0xbf4e('0x1a6')});db[_0xbf4e('0x6f')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x112')});db['CmHopperBlack'][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x6f')][_0xbf4e('0x122')](db[_0xbf4e('0x15')],{'as':_0xbf4e('0x1a4'),'foreignKey':_0xbf4e('0x14f'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x6f')][_0xbf4e('0x122')](db[_0xbf4e('0xe7')],{'as':_0xbf4e('0xe7'),'foreignKey':_0xbf4e('0x1a5'),'onDelete':_0xbf4e('0x112')});db['Automation']['hasMany'](db['Condition'],{'as':{'plural':'All','singular':_0xbf4e('0x1a7')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xbf4e('0x79')]['hasMany'](db[_0xbf4e('0x7e')],{'as':{'plural':_0xbf4e('0x1a8'),'singular':'OneAny'},'foreignKey':_0xbf4e('0x1a9'),'onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x79')][_0xbf4e('0x115')](db[_0xbf4e('0x77')],{'as':_0xbf4e('0x1aa'),'foreignKey':'AutomationId','onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x7c')][_0xbf4e('0x115')](db[_0xbf4e('0x7c')],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x1ab'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db['Interval'],{'as':'Intervals','foreignKey':_0xbf4e('0x157'),'onDelete':_0xbf4e('0x112'),'hooks':!![],'required':![]});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db[_0xbf4e('0x149')],{'as':'Extensions','foreignKey':_0xbf4e('0x157'),'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db['ChatApplication'],{'as':_0xbf4e('0x1ac'),'foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x80')]['hasMany'](db[_0xbf4e('0x49')],{'as':_0xbf4e('0x1ad'),'foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db[_0xbf4e('0x51')],{'as':'SmsApplications','foreignKey':_0xbf4e('0x157')});db['Schedule'][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{});db['Schedule'][_0xbf4e('0x122')](db['AnalyticDefaultReport'],{'foreignKey':_0xbf4e('0x1ae')});db['Schedule'][_0xbf4e('0x122')](db[_0xbf4e('0x92')],{'foreignKey':'CustomReportId'});db['Sound'][_0xbf4e('0x124')](db[_0xbf4e('0x14a')],{'as':_0xbf4e('0x1af'),'through':_0xbf4e('0x14d'),'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db[_0xbf4e('0x127')],{'through':_0xbf4e('0x1a3')});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db['ChatInteraction'],{'through':_0xbf4e('0x19d')});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db[_0xbf4e('0x131')],{'through':_0xbf4e('0x1b0')});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db[_0xbf4e('0x11e')],{'through':_0xbf4e('0x188')});db['Tag'][_0xbf4e('0x124')](db['OpenchannelInteraction'],{'through':_0xbf4e('0x190')});db['Tag'][_0xbf4e('0x124')](db[_0xbf4e('0x103')],{'through':_0xbf4e('0x1b1')});db[_0xbf4e('0x8a')][_0xbf4e('0x115')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0xbf4e('0x1b2')},'foreignKey':'TriggerAllId','onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x8a')][_0xbf4e('0x115')](db[_0xbf4e('0x7e')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xbf4e('0x1b3'),'onDelete':_0xbf4e('0x112'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xbf4e('0x77')],{'as':'Actions','foreignKey':_0xbf4e('0x1b4'),'onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x92')][_0xbf4e('0x115')](db[_0xbf4e('0x1b5')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xbf4e('0x1b7')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1ae')});db[_0xbf4e('0x1b8')][_0xbf4e('0x115')](db[_0xbf4e('0x1b5')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xbf4e('0x1b9')});db[_0xbf4e('0x1b5')]['belongsTo'](db[_0xbf4e('0x1b8')],{'foreignKey':_0xbf4e('0x1b9')});db[_0xbf4e('0x9a')][_0xbf4e('0x115')](db[_0xbf4e('0x1ba')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0x1ba')][_0xbf4e('0x115')](db[_0xbf4e('0x1bd')],{'as':_0xbf4e('0x1be'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0x1ba')][_0xbf4e('0x115')](db[_0xbf4e('0x1bd')],{'as':'Descriptions','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0x1ba')][_0xbf4e('0x115')](db[_0xbf4e('0x1bd')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0xbf4e('0x122')](db[_0xbf4e('0x9a')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0xbf4e('0x115')](db['SalesforceField'],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db['SalesforceField'][_0xbf4e('0x115')](db['SalesforceField'],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0x1bd')]['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':'FieldId'});db[_0xbf4e('0x1bd')][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':'Variable','foreignKey':'VariableId'});db[_0xbf4e('0x9e')][_0xbf4e('0x115')](db['SugarcrmConfiguration'],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xa0')][_0xbf4e('0x115')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xa0')][_0xbf4e('0x115')](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1c3'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xa0')][_0xbf4e('0x115')](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1b6'),'onDelete':'cascade','foreignKey':_0xbf4e('0x1c4')});db['SugarcrmConfiguration'][_0xbf4e('0x122')](db['SugarcrmAccount'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xa2')][_0xbf4e('0x115')](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xa2')]['hasMany'](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1c2'),'foreignKey':'DescriptionId'});db[_0xbf4e('0xa2')][_0xbf4e('0x115')](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1c5'),'foreignKey':'FieldId'});db[_0xbf4e('0xa2')]['belongsTo'](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xa4')][_0xbf4e('0x115')](db[_0xbf4e('0x1c7')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':'AccountId'});db[_0xbf4e('0x1c7')][_0xbf4e('0x115')](db['DeskField'],{'as':_0xbf4e('0x1be'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0x1c7')]['hasMany'](db[_0xbf4e('0xa7')],{'as':_0xbf4e('0x1c3'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xbf4e('0x1c7')][_0xbf4e('0x115')](db[_0xbf4e('0xa7')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0x1c7')][_0xbf4e('0x122')](db[_0xbf4e('0xa4')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db['DeskConfiguration']['belongsToMany'](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x1c8')});db[_0xbf4e('0xa7')][_0xbf4e('0x115')](db[_0xbf4e('0xa7')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xa7')]['hasMany'](db[_0xbf4e('0xa7')],{'as':_0xbf4e('0x1c2'),'foreignKey':'DescriptionId'});db[_0xbf4e('0xa7')][_0xbf4e('0x115')](db[_0xbf4e('0xa7')],{'as':'Field','foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xa7')]['belongsTo'](db[_0xbf4e('0x8c')],{'as':'Variable','foreignKey':_0xbf4e('0x1c6')});db['ZohoAccount'][_0xbf4e('0x115')](db['ZohoConfiguration'],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xab')][_0xbf4e('0x115')](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1be'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xab')][_0xbf4e('0x115')](db['ZohoField'],{'as':_0xbf4e('0x1c3'),'onDelete':'cascade','foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xab')]['hasMany'](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0xbf4e('0x122')](db['ZohoAccount'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xad')][_0xbf4e('0x115')](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db['ZohoField']['hasMany'](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xad')][_0xbf4e('0x115')](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1c5'),'foreignKey':'FieldId'});db['ZohoField'][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xaf')][_0xbf4e('0x115')](db[_0xbf4e('0xb1')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xb1')][_0xbf4e('0x115')](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1be'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xb1')][_0xbf4e('0x115')](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1c3'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xb1')][_0xbf4e('0x115')](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1b6'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xb1')]['belongsTo'](db[_0xbf4e('0xaf')],{'as':'Account','foreignKey':_0xbf4e('0x1bc')});db['ZendeskConfiguration'][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x1ca')});db[_0xbf4e('0x1c9')]['hasMany'](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1c1'),'foreignKey':'SubjectId'});db[_0xbf4e('0x1c9')]['hasMany'](db[_0xbf4e('0x1c9')],{'as':'Description','foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0x1c9')]['hasMany'](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1c5'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0x1c9')][_0xbf4e('0x122')](db['Variable'],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xb4')]['hasMany'](db[_0xbf4e('0xb6')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db['FreshdeskConfiguration'][_0xbf4e('0x115')](db['FreshdeskField'],{'as':_0xbf4e('0x1be'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xb6')]['hasMany'](db[_0xbf4e('0xb8')],{'as':'Descriptions','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c0')});db['FreshdeskConfiguration'][_0xbf4e('0x115')](db[_0xbf4e('0xb8')],{'as':'Fields','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xb6')]['belongsTo'](db[_0xbf4e('0xb4')],{'as':_0xbf4e('0x173'),'foreignKey':'AccountId'});db[_0xbf4e('0xb6')]['belongsToMany'](db[_0xbf4e('0x182')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0xbf4e('0x115')](db[_0xbf4e('0xb8')],{'as':'Subject','foreignKey':_0xbf4e('0x1bf')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xb8')][_0xbf4e('0x115')](db[_0xbf4e('0xb8')],{'as':_0xbf4e('0x1c5'),'foreignKey':_0xbf4e('0x1c4')});db['FreshdeskField'][_0xbf4e('0x122')](db['Variable'],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xba')][_0xbf4e('0x115')](db[_0xbf4e('0xbc')],{'as':'Configurations','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xbc')][_0xbf4e('0x115')](db[_0xbf4e('0xbe')],{'as':_0xbf4e('0x1be'),'foreignKey':'SubjectId'});db[_0xbf4e('0xbc')]['hasMany'](db[_0xbf4e('0xbe')],{'as':_0xbf4e('0x1c3'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xbc')]['hasMany'](db[_0xbf4e('0xbe')],{'as':_0xbf4e('0x1b6'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xbc')]['belongsTo'](db[_0xbf4e('0xba')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db['VtigerField']['hasMany'](db[_0xbf4e('0xbe')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xbe')][_0xbf4e('0x115')](db['VtigerField'],{'as':_0xbf4e('0x1c2'),'foreignKey':'DescriptionId'});db[_0xbf4e('0xbe')][_0xbf4e('0x115')](db[_0xbf4e('0xbe')],{'as':'Field','foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xbe')][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xc0')][_0xbf4e('0x115')](db[_0xbf4e('0xc2')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xc2')]['hasMany'](db['ServicenowField'],{'as':_0xbf4e('0x1be'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xc2')]['hasMany'](db[_0xbf4e('0xc4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xbf4e('0x115')](db[_0xbf4e('0xc4')],{'as':_0xbf4e('0x1b6'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xc2')][_0xbf4e('0x122')](db[_0xbf4e('0xc0')],{'as':'Account','foreignKey':'AccountId'});db['ServicenowField'][_0xbf4e('0x115')](db['ServicenowField'],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xc4')][_0xbf4e('0x115')](db[_0xbf4e('0xc4')],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db['ServicenowField']['hasMany'](db[_0xbf4e('0xc4')],{'as':'Field','foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xc4')][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xc6')][_0xbf4e('0x115')](db['Dynamics365Configuration'],{'as':_0xbf4e('0x1bb'),'onDelete':'cascade','foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xc7')][_0xbf4e('0x115')](db[_0xbf4e('0xc8')],{'as':'Subjects','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db['Dynamics365Configuration'][_0xbf4e('0x115')](db[_0xbf4e('0xc8')],{'as':'Descriptions','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xc7')]['hasMany'](db[_0xbf4e('0xc8')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':'FieldId'});db[_0xbf4e('0xc7')][_0xbf4e('0x122')](db[_0xbf4e('0xc6')],{'as':_0xbf4e('0x173'),'foreignKey':'AccountId'});db[_0xbf4e('0xc8')]['hasMany'](db[_0xbf4e('0xc8')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db['Dynamics365Field']['hasMany'](db[_0xbf4e('0xc8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xbf4e('0xc8')][_0xbf4e('0x115')](db['Dynamics365Field'],{'as':_0xbf4e('0x1c5'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xc9')][_0xbf4e('0x115')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db['FreshsalesConfiguration'][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':'Subjects','foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xcb')][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':_0xbf4e('0x1c3'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xcb')][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':_0xbf4e('0x1b6'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xcb')]['belongsTo'](db[_0xbf4e('0xc9')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db['FreshsalesField'][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xbf4e('0xcd')][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xcd')][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':_0xbf4e('0x1c5'),'foreignKey':'FieldId'});db[_0xbf4e('0xcd')]['belongsTo'](db['Variable'],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xd0')]['belongsTo'](db['ChatWebsite'],{});db[_0xbf4e('0xd0')][_0xbf4e('0x122')](db['CmList'],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0xd0')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db['ChatQueueReport'][_0xbf4e('0x122')](db['ChatInteraction'],{});db[_0xbf4e('0xd0')][_0xbf4e('0x122')](db[_0xbf4e('0x198')],{});db[_0xbf4e('0xd0')]['belongsTo'](db[_0xbf4e('0xe')],{});db[_0xbf4e('0xd0')][_0xbf4e('0x122')](db['ChatQueue'],{});db['ChatInternalMessage']['belongsTo'](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1cb')});db[_0xbf4e('0xd2')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1cc')});db[_0xbf4e('0xd7')][_0xbf4e('0x115')](db[_0xbf4e('0xd5')],{'foreignKey':'SessionId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0xd7')][_0xbf4e('0x115')](db[_0xbf4e('0xd4')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xbf4e('0xd9')]['belongsTo'](db['SmsAccount'],{});db[_0xbf4e('0xd9')]['belongsTo'](db['CmList'],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0xd9')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0xd9')]['belongsTo'](db[_0xbf4e('0x131')],{});db[_0xbf4e('0xd9')][_0xbf4e('0x122')](db[_0xbf4e('0x54')],{});db[_0xbf4e('0xd9')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{});db[_0xbf4e('0xd9')][_0xbf4e('0x122')](db[_0xbf4e('0x56')],{});db[_0xbf4e('0xde')][_0xbf4e('0x115')](db[_0xbf4e('0xd7')],{'foreignKey':'ProjectId'});db[_0xbf4e('0xde')][_0xbf4e('0x115')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xbf4e('0xde')][_0xbf4e('0x115')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db['SquareProject'][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Users','through':_0xbf4e('0x1cd')});db[_0xbf4e('0x170')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x12d')});db[_0xbf4e('0x170')]['belongsToMany'](db['VoiceQueue'],{'through':_0xbf4e('0x10c'),'as':_0xbf4e('0x134')});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x38')],{'through':_0xbf4e('0x171'),'as':'MailQueues'});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x68')],{'through':_0xbf4e('0x19e'),'as':_0xbf4e('0x138')});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x187')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xbf4e('0x170')]['belongsToMany'](db[_0xbf4e('0x56')],{'through':_0xbf4e('0x1ce'),'as':_0xbf4e('0x139')});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x13a')],{'through':_0xbf4e('0x1cf'),'as':_0xbf4e('0x13b')});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x109')],{'through':_0xbf4e('0x1d0'),'as':_0xbf4e('0x13c')});db[_0xbf4e('0x170')]['belongsToMany'](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0xbf4e('0x136')});db[_0xbf4e('0xe7')][_0xbf4e('0x115')](db['CmHopper'],{'as':_0xbf4e('0x1a0'),'foreignKey':_0xbf4e('0x1a5')});db[_0xbf4e('0xe7')][_0xbf4e('0x115')](db[_0xbf4e('0x117')],{'as':_0xbf4e('0x118'),'foreignKey':_0xbf4e('0x1a5')});db['Campaign'][_0xbf4e('0x115')](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x151'),'foreignKey':'CampaignId'});db[_0xbf4e('0xe7')][_0xbf4e('0x115')](db[_0xbf4e('0x6f')],{'as':_0xbf4e('0x152'),'foreignKey':_0xbf4e('0x1a5')});db['Campaign'][_0xbf4e('0x122')](db[_0xbf4e('0x24')],{'as':'Trunk','foreignKey':_0xbf4e('0x154')});db[_0xbf4e('0xe7')][_0xbf4e('0x122')](db[_0xbf4e('0x24')],{'as':_0xbf4e('0x155'),'foreignKey':'TrunkBackupId'});db[_0xbf4e('0xe7')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0xe7')][_0xbf4e('0x122')](db[_0xbf4e('0xe2')],{'as':_0xbf4e('0xe2'),'foreignKey':_0xbf4e('0x1d1')});db[_0xbf4e('0xe7')][_0xbf4e('0x124')](db[_0xbf4e('0x12a')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xbf4e('0xe7')]['belongsToMany'](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x1d2'),'through':_0xbf4e('0x1d3')});db[_0xbf4e('0x17c')][_0xbf4e('0x122')](db[_0xbf4e('0x17f')],{'as':_0xbf4e('0x17f'),'foreignKey':_0xbf4e('0x180')});db['MailTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0x3d')],{});db[_0xbf4e('0xee')]['belongsTo'](db[_0xbf4e('0x3b')],{});db[_0xbf4e('0xee')][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'foreignKey':_0xbf4e('0x1d4'),'as':_0xbf4e('0x1d5')});db['MailTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':_0xbf4e('0x1d7')});db[_0xbf4e('0xee')]['belongsTo'](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d8'),'as':_0xbf4e('0x1d9')});db[_0xbf4e('0xee')][_0xbf4e('0x122')](db[_0xbf4e('0x38')],{'foreignKey':_0xbf4e('0x1da'),'as':'ToQueue'});db['MailTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'foreignKey':_0xbf4e('0x1db'),'as':'ToAccount'});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0x198')],{});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0x65')],{});db[_0xbf4e('0xf0')]['belongsTo'](db[_0xbf4e('0x60')],{'foreignKey':_0xbf4e('0x1dc'),'as':'FromAccount'});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':_0xbf4e('0x1d7')});db['ChatTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d8'),'as':'ToAgent'});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0x68')],{'foreignKey':_0xbf4e('0x1dd'),'as':_0xbf4e('0x1de')});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'foreignKey':_0xbf4e('0x1df'),'as':_0xbf4e('0x1e0')});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db[_0xbf4e('0x4b')],{});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db[_0xbf4e('0x11e')],{});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db[_0xbf4e('0x47')],{'foreignKey':_0xbf4e('0x1e1'),'as':'FromAccount'});db[_0xbf4e('0xf2')]['belongsTo'](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':_0xbf4e('0x1d7')});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d8'),'as':_0xbf4e('0x1d9')});db[_0xbf4e('0xf2')]['belongsTo'](db[_0xbf4e('0x187')],{'foreignKey':_0xbf4e('0x1e2'),'as':_0xbf4e('0x1de')});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db['FaxAccount'],{'foreignKey':_0xbf4e('0x1e3'),'as':_0xbf4e('0x1e0')});db[_0xbf4e('0xf4')][_0xbf4e('0x122')](db['OpenchannelMessage'],{});db[_0xbf4e('0xf4')]['belongsTo'](db[_0xbf4e('0x5c')],{});db['OpenchannelTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0x58')],{'foreignKey':_0xbf4e('0x1e4'),'as':'FromAccount'});db[_0xbf4e('0xf4')][_0xbf4e('0x122')](db['User'],{'foreignKey':_0xbf4e('0x1d6'),'as':'FromAgent'});db[_0xbf4e('0xf4')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d8'),'as':_0xbf4e('0x1d9')});db['OpenchannelTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0x13a')],{'foreignKey':'ToOpenchannelQueueId','as':_0xbf4e('0x1de')});db[_0xbf4e('0xf4')][_0xbf4e('0x122')](db['OpenchannelAccount'],{'foreignKey':_0xbf4e('0x1e5'),'as':_0xbf4e('0x1e0')});db[_0xbf4e('0xf6')]['belongsTo'](db[_0xbf4e('0x54')],{});db[_0xbf4e('0xf6')]['belongsTo'](db[_0xbf4e('0x131')],{});db[_0xbf4e('0xf6')][_0xbf4e('0x122')](db[_0xbf4e('0x4f')],{'foreignKey':_0xbf4e('0x1e6'),'as':'FromAccount'});db[_0xbf4e('0xf6')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':'FromAgent'});db['SmsTransferReport'][_0xbf4e('0x122')](db['User'],{'foreignKey':_0xbf4e('0x1d8'),'as':_0xbf4e('0x1d9')});db[_0xbf4e('0xf6')][_0xbf4e('0x122')](db[_0xbf4e('0x56')],{'foreignKey':'ToSmsQueueId','as':_0xbf4e('0x1de')});db[_0xbf4e('0xf6')][_0xbf4e('0x122')](db[_0xbf4e('0x4f')],{'foreignKey':_0xbf4e('0x1e7'),'as':'ToAccount'});db[_0xbf4e('0x12a')]['hasMany'](db[_0xbf4e('0x7c')],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x16d'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db['CmCustomField'],{'as':_0xbf4e('0x1e8'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x128'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db[_0xbf4e('0x117')],{'as':_0xbf4e('0x118'),'foreignKey':'ListId'});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x11a'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db[_0xbf4e('0x73')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xbf4e('0x12a')][_0xbf4e('0x124')](db[_0xbf4e('0x15')],{'as':_0xbf4e('0x1e9'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x12c')});db[_0xbf4e('0xf8')][_0xbf4e('0x115')](db['VoiceExtension'],{'as':_0xbf4e('0x1ea'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0xf8')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x10f')});db['VoicePrefix']['belongsToMany'](db['Team'],{'through':'TeamVoicePrefix','as':'Teams'});db['UserProfile'][_0xbf4e('0x115')](db['User'],{'as':'Users','foreignKey':_0xbf4e('0x123')});db[_0xbf4e('0xfa')][_0xbf4e('0x115')](db[_0xbf4e('0xfc')],{'as':_0xbf4e('0x1eb'),'foreignKey':_0xbf4e('0x123'),'onDelete':'cascade'});db[_0xbf4e('0xfc')][_0xbf4e('0x115')](db[_0xbf4e('0x1ec')],{'as':_0xbf4e('0x1ed'),'foreignKey':_0xbf4e('0x1ee'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x145')]['hasMany'](db['Disposition'],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x1ef'),'onDelete':'cascade'});db[_0xbf4e('0x145')][_0xbf4e('0x115')](db[_0xbf4e('0x168')],{'as':_0xbf4e('0x169'),'foreignKey':_0xbf4e('0x1ef')});db[_0xbf4e('0x145')]['hasMany'](db[_0xbf4e('0x105')],{'as':_0xbf4e('0x15e'),'foreignKey':_0xbf4e('0x1ef')});db[_0xbf4e('0x145')][_0xbf4e('0x115')](db[_0xbf4e('0x103')],{'as':_0xbf4e('0x16a')});db['WhatsappAccount'][_0xbf4e('0x115')](db[_0xbf4e('0x101')],{'as':_0xbf4e('0x16b')});db[_0xbf4e('0x145')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x145')][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':_0xbf4e('0x158'),'foreignKey':_0xbf4e('0x16f')});db[_0xbf4e('0x145')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0xbf4e('0x101')][_0xbf4e('0x122')](db['User'],{'onDelete':'restrict'});db[_0xbf4e('0x101')][_0xbf4e('0x122')](db[_0xbf4e('0x109')],{'onDelete':_0xbf4e('0x181')});db['WhatsappApplication'][_0xbf4e('0x122')](db['WhatsappAccount'],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x101')]['belongsTo'](db['Interval'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x101')][_0xbf4e('0x122')](db['Tag'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x183')});db['WhatsappInteraction'][_0xbf4e('0x115')](db['WhatsappMessage'],{'as':_0xbf4e('0x15e'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1f0')});db[_0xbf4e('0x103')][_0xbf4e('0x122')](db[_0xbf4e('0x145')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1ef')});db[_0xbf4e('0x103')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':'Contact','foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x103')][_0xbf4e('0x122')](db['User'],{'as':_0xbf4e('0x176'),'foreignKey':'UserId'});db['WhatsappInteraction']['belongsToMany'](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x1b1'),'as':_0xbf4e('0x178')});db[_0xbf4e('0x103')]['belongsToMany'](db['Tag'],{'through':_0xbf4e('0x1b1'),'as':_0xbf4e('0x179')});db[_0xbf4e('0x103')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x133'),'foreignKey':_0xbf4e('0x1f0')});db[_0xbf4e('0x105')][_0xbf4e('0x122')](db['User'],{'as':_0xbf4e('0xe')});db[_0xbf4e('0x105')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'onDelete':_0xbf4e('0x112'),'as':'Contact'});db[_0xbf4e('0x105')][_0xbf4e('0x122')](db[_0xbf4e('0x103')],{'onDelete':'cascade','as':_0xbf4e('0x193'),'foreignKey':'WhatsappInteractionId'});db[_0xbf4e('0x105')][_0xbf4e('0x122')](db[_0xbf4e('0x145')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1ef')});db[_0xbf4e('0x1f1')][_0xbf4e('0x122')](db[_0xbf4e('0x145')],{});db[_0xbf4e('0x1f1')][_0xbf4e('0x122')](db['CmList'],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x1f1')][_0xbf4e('0x122')](db['CmContact'],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x1f1')][_0xbf4e('0x122')](db[_0xbf4e('0x103')],{});db['WhatsappQueueReport'][_0xbf4e('0x122')](db[_0xbf4e('0x109')],{});db[_0xbf4e('0x1f1')]['belongsTo'](db[_0xbf4e('0x105')],{});db[_0xbf4e('0x1f1')]['belongsTo'](db[_0xbf4e('0xe')],{});db[_0xbf4e('0x1f2')]['belongsTo'](db[_0xbf4e('0x105')],{});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db['WhatsappInteraction'],{});db[_0xbf4e('0x1f2')]['belongsTo'](db[_0xbf4e('0x145')],{'foreignKey':'FromWhatsappAccountId','as':_0xbf4e('0x1d5')});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db[_0xbf4e('0x145')],{'foreignKey':_0xbf4e('0x1f3'),'as':_0xbf4e('0x1e0')});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db[_0xbf4e('0x109')],{'foreignKey':_0xbf4e('0x1f4'),'as':_0xbf4e('0x1de')});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':'FromAgent'});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':'ToUserId','as':_0xbf4e('0x1d9')});db[_0xbf4e('0x109')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x13d'),'foreignKey':_0xbf4e('0x1f5')});db['WhatsappQueue']['belongsToMany'](db['Team'],{'through':'team_has_whatsapp_queues','as':_0xbf4e('0x15b')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+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(_0x4f027d,_0x3f9587){var _0xc46890=function(_0x27d06c){while(--_0x27d06c){_0x4f027d['push'](_0x4f027d['shift']());}};_0xc46890(++_0x3f9587);}(_0xa75b,0x170));var _0xba75=function(_0x54d4e5,_0x3bde35){_0x54d4e5=_0x54d4e5-0x0;var _0x17ac55=_0xa75b[_0x54d4e5];return _0x17ac55;};'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
index d2e181e..ced3198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3923=['/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/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/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/cloudProvider','./api/realtime','/api/auth/local','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','/www','join','/demo','/snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','username','password','apiKey','firstName','street','phone','mobile','fax','clientId','clientSecret','securityToken','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','secretaccesskey','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','api','./safe-template','safeTemplate','default','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','use','logger','%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','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/faxAccount','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/tags','./api/tag','/api/templates','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/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/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount'];(function(_0x4dda8e,_0xe91ab7){var _0x1563c7=function(_0x552266){while(--_0x552266){_0x4dda8e['push'](_0x4dda8e['shift']());}};_0x1563c7(++_0xe91ab7);}(_0x3923,0x1e0));var _0x3392=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3923[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x3392('0x0'));var path=require(_0x3392('0x1'));var express=require(_0x3392('0x2'));var ewinston=require(_0x3392('0x3'));var util=require('util');var errors=require(_0x3392('0x4'));var config=require(_0x3392('0x5'));var logger=require(_0x3392('0x6'))(_0x3392('0x7'));var authLogger=require(_0x3392('0x6'))('auth');var safeTemplate=require(_0x3392('0x8'))[_0x3392('0x9')];exports[_0x3392('0xa')]=function(_0x25e80a){_0x25e80a['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x8044fb,_0x3fc57e){var _0x3e7951=_0x3392('0xb');if(!_[_0x3392('0xc')](_0x8044fb['body'])){_0x3e7951+=_0x3392('0xd');var _0x430e62=_0x8044fb[_0x3392('0xe')];maskSensitiveData(_0x430e62);}return safeTemplate(util[_0x3392('0xf')](_0x3e7951,_0x8044fb[_0x3392('0x10')],_0x8044fb[_0x3392('0x11')][_0x3392('0x12')]?_0x8044fb['headers'][_0x3392('0x12')]:_0x8044fb['connection'][_0x3392('0x13')]||_0x8044fb['ip'],_0x8044fb[_0x3392('0x14')],_0x3fc57e[_0x3392('0x15')],_0x3fc57e[_0x3392('0x16')],_0x8044fb['user']?_0x8044fb[_0x3392('0x17')]['id']:null,_0x8044fb[_0x3392('0x17')]?_0x8044fb[_0x3392('0x17')][_0x3392('0x18')]:null,_0x8044fb['user']?_0x8044fb['user'][_0x3392('0x19')]:null,_0x430e62?util[_0x3392('0x1a')](_0x430e62,![],null):''));}}));_0x25e80a[_0x3392('0x1b')](ewinston[_0x3392('0x1c')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1bc17d,_0x1c6c5c){var _0xa009de=_0x3392('0x1d');if(_0x1bc17d['body']&&_0x1bc17d[_0x3392('0xe')][_0x3392('0x1e')]&&_0x1bc17d[_0x3392('0xe')][_0x3392('0x1f')]){_0xa009de=_0x3392('0x20');}return util[_0x3392('0xf')](_0xa009de,_0x1bc17d[_0x3392('0x10')],_0x1bc17d[_0x3392('0x11')][_0x3392('0x12')]?_0x1bc17d[_0x3392('0x11')][_0x3392('0x12')]:_0x1bc17d[_0x3392('0x21')][_0x3392('0x13')]||_0x1bc17d['ip'],_0x1bc17d['url'],_0x1c6c5c[_0x3392('0x15')],_0x1c6c5c[_0x3392('0x16')],_0x1bc17d[_0x3392('0x17')]?_0x1bc17d['user']['id']:null,_0x1bc17d[_0x3392('0x17')]?_0x1bc17d[_0x3392('0x17')][_0x3392('0x18')]:null,_0x1bc17d[_0x3392('0x17')]?_0x1bc17d[_0x3392('0x17')][_0x3392('0x19')]:null,_0x1bc17d['body']&&_0x1bc17d[_0x3392('0xe')][_0x3392('0x1e')]?_0x1bc17d['body'][_0x3392('0x1e')]:_0x3392('0x22'),_0x1bc17d[_0x3392('0xe')]&&_0x1bc17d[_0x3392('0xe')]['agent_id']?_0x1bc17d[_0x3392('0xe')][_0x3392('0x1f')]:'',_0x1bc17d[_0x3392('0xe')]&&_0x1bc17d[_0x3392('0xe')][_0x3392('0x23')]?_0x1bc17d['body']['agent_name']:'');},'ignoreRoute':function(_0x4ce618){var _0x5c8bbc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5c8bbc['test'](_0x4ce618[_0x3392('0x14')]);}}));_0x25e80a[_0x3392('0x1b')](_0x3392('0x24'),require(_0x3392('0x25')));_0x25e80a['use'](_0x3392('0x26'),require(_0x3392('0x27')));_0x25e80a[_0x3392('0x1b')]('/api/voice/contexts',require(_0x3392('0x28')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x29'),require(_0x3392('0x2a')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x2b'),require(_0x3392('0x2c')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x2d'),require('./api/voiceQueue'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x2e'),require(_0x3392('0x2f')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x30'),require(_0x3392('0x31')));_0x25e80a[_0x3392('0x1b')]('/api/voice/mails',require(_0x3392('0x32')));_0x25e80a[_0x3392('0x1b')]('/api/voice/mails/messages',require(_0x3392('0x33')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x34'),require(_0x3392('0x35')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x36'),require(_0x3392('0x37')));_0x25e80a[_0x3392('0x1b')]('/api/voice/agents/reports',require(_0x3392('0x38')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x39'),require(_0x3392('0x3a')));_0x25e80a['use']('/api/members/reports',require(_0x3392('0x3b')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x3c'),require(_0x3392('0x3d')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x3e'),require(_0x3392('0x3f')));_0x25e80a[_0x3392('0x1b')]('/api/mail/out_servers',require(_0x3392('0x40')));_0x25e80a['use']('/api/mail/accounts',require(_0x3392('0x41')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x42'),require(_0x3392('0x43')));_0x25e80a['use']('/api/mail/substatuses',require(_0x3392('0x44')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x45'),require(_0x3392('0x46')));_0x25e80a['use']('/api/mail/messages',require('./api/mailMessage'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x47'),require(_0x3392('0x48')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x49'),require(_0x3392('0x4a')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x4b'),require('./api/dashboard'));_0x25e80a[_0x3392('0x1b')]('/api/dashboards/items',require('./api/dashboardItem'));_0x25e80a[_0x3392('0x1b')]('/api/fax/accounts',require(_0x3392('0x4c')));_0x25e80a['use']('/api/fax/applications',require(_0x3392('0x4d')));_0x25e80a[_0x3392('0x1b')]('/api/fax/interactions',require(_0x3392('0x4e')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x4f'),require(_0x3392('0x50')));_0x25e80a['use'](_0x3392('0x51'),require('./api/faxQueue'));_0x25e80a['use'](_0x3392('0x52'),require('./api/faxQueueReport'));_0x25e80a[_0x3392('0x1b')]('/api/sms/accounts',require('./api/smsAccount'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x53'),require('./api/smsApplication'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x54'),require(_0x3392('0x55')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x56'),require(_0x3392('0x57')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x58'),require(_0x3392('0x59')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x5a'),require('./api/openchannelAccount'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x5b'),require('./api/openchannelApplication'));_0x25e80a['use'](_0x3392('0x5c'),require(_0x3392('0x5d')));_0x25e80a['use'](_0x3392('0x5e'),require('./api/openchannelMessage'));_0x25e80a['use']('/api/openchannel/queues',require('./api/openchannelQueue'));_0x25e80a['use'](_0x3392('0x5f'),require(_0x3392('0x60')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x61'),require(_0x3392('0x62')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x63'),require(_0x3392('0x64')));_0x25e80a[_0x3392('0x1b')]('/api/chat/interactions',require('./api/chatInteraction'));_0x25e80a[_0x3392('0x1b')]('/api/chat/messages',require(_0x3392('0x65')));_0x25e80a['use'](_0x3392('0x66'),require(_0x3392('0x67')));_0x25e80a['use'](_0x3392('0x68'),require(_0x3392('0x69')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x6a'),require('./api/chatGroup'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x6b'),require(_0x3392('0x6c')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x6d'),require(_0x3392('0x6e')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x6f'),require(_0x3392('0x70')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x71'),require(_0x3392('0x72')));_0x25e80a[_0x3392('0x1b')]('/api/cm/hopper_black',require(_0x3392('0x73')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x74'),require(_0x3392('0x75')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x76'),require('./api/cmHopperHistory'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x77'),require(_0x3392('0x78')));_0x25e80a[_0x3392('0x1b')]('/api/actions',require(_0x3392('0x79')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x7a'),require(_0x3392('0x7b')));_0x25e80a[_0x3392('0x1b')]('/api/canned_answers',require(_0x3392('0x7c')));_0x25e80a['use'](_0x3392('0x7d'),require('./api/disposition'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x7e'),require(_0x3392('0x7f')));_0x25e80a['use'](_0x3392('0x80'),require(_0x3392('0x81')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x82'),require(_0x3392('0x83')));_0x25e80a['use'](_0x3392('0x84'),require(_0x3392('0x85')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x86'),require('./api/voiceQueuesLog'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x87'),require(_0x3392('0x88')));_0x25e80a[_0x3392('0x1b')]('/api/sounds',require('./api/sound'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x89'),require(_0x3392('0x8a')));_0x25e80a['use'](_0x3392('0x8b'),require('./api/template'));_0x25e80a[_0x3392('0x1b')]('/api/triggers',require(_0x3392('0x8c')));_0x25e80a['use']('/api/variables',require(_0x3392('0x8d')));_0x25e80a['use'](_0x3392('0x8e'),require(_0x3392('0x8f')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x90'),require(_0x3392('0x91')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x92'),require(_0x3392('0x93')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x94'),require(_0x3392('0x95')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x96'),require(_0x3392('0x97')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x98'),require(_0x3392('0x99')));_0x25e80a[_0x3392('0x1b')]('/api/analytics/field_reports',require(_0x3392('0x9a')));_0x25e80a['use'](_0x3392('0x9b'),require(_0x3392('0x9c')));_0x25e80a['use'](_0x3392('0x9d'),require(_0x3392('0x9e')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x9f'),require(_0x3392('0xa0')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xa1'),require(_0x3392('0xa2')));_0x25e80a[_0x3392('0x1b')]('/api/integrations/sugarcrm/accounts',require(_0x3392('0xa3')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xa4'),require(_0x3392('0xa5')));_0x25e80a['use'](_0x3392('0xa6'),require(_0x3392('0xa7')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xa8'),require(_0x3392('0xa9')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xaa'),require(_0x3392('0xab')));_0x25e80a[_0x3392('0x1b')]('/api/integrations/desk/fields',require(_0x3392('0xac')));_0x25e80a['use']('/api/integrations/zoho/accounts',require(_0x3392('0xad')));_0x25e80a['use']('/api/integrations/zoho/configurations',require(_0x3392('0xae')));_0x25e80a['use'](_0x3392('0xaf'),require('./api/intZohoField'));_0x25e80a[_0x3392('0x1b')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x25e80a[_0x3392('0x1b')](_0x3392('0xb0'),require(_0x3392('0xb1')));_0x25e80a['use'](_0x3392('0xb2'),require(_0x3392('0xb3')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xb4'),require(_0x3392('0xb5')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xb6'),require('./api/intFreshdeskConfiguration'));_0x25e80a['use'](_0x3392('0xb7'),require('./api/intFreshdeskField'));_0x25e80a[_0x3392('0x1b')](_0x3392('0xb8'),require(_0x3392('0xb9')));_0x25e80a['use'](_0x3392('0xba'),require(_0x3392('0xbb')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xbc'),require(_0x3392('0xbd')));_0x25e80a[_0x3392('0x1b')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x25e80a[_0x3392('0x1b')](_0x3392('0xbe'),require(_0x3392('0xbf')));_0x25e80a['use'](_0x3392('0xc0'),require(_0x3392('0xc1')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xc2'),require('./api/intDynamics365Account'));_0x25e80a['use']('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x25e80a[_0x3392('0x1b')](_0x3392('0xc3'),require(_0x3392('0xc4')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xc5'),require(_0x3392('0xc6')));_0x25e80a[_0x3392('0x1b')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x25e80a['use']('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x25e80a[_0x3392('0x1b')](_0x3392('0xc7'),require(_0x3392('0xc8')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xc9'),require(_0x3392('0xca')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xcb'),require(_0x3392('0xcc')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xcd'),require('./api/jscriptyAnswerReport'));_0x25e80a[_0x3392('0x1b')](_0x3392('0xce'),require('./api/jscriptyQuestionReport'));_0x25e80a['use'](_0x3392('0xcf'),require(_0x3392('0xd0')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xd1'),require(_0x3392('0xd2')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xd3'),require(_0x3392('0xd4')));_0x25e80a['use'](_0x3392('0xd5'),require(_0x3392('0xd6')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xd7'),require('./api/jscriptyProject'));_0x25e80a[_0x3392('0x1b')](_0x3392('0xd8'),require(_0x3392('0xd9')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xda'),require(_0x3392('0xdb')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xdc'),require(_0x3392('0xdd')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xde'),require(_0x3392('0xdf')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xe0'),require(_0x3392('0xe1')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xe2'),require(_0x3392('0xe3')));_0x25e80a['use']('/api/license',require('./api/license'));_0x25e80a[_0x3392('0x1b')](_0x3392('0xe4'),require(_0x3392('0xe5')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xe6'),require(_0x3392('0xe7')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xe8'),require(_0x3392('0xe9')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xea'),require(_0x3392('0xeb')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xec'),require(_0x3392('0xed')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xee'),require(_0x3392('0xef')));_0x25e80a['use']('/api/fax/reports/transfer',require(_0x3392('0xf0')));_0x25e80a[_0x3392('0x1b')]('/api/openchannel/reports/transfer',require(_0x3392('0xf1')));_0x25e80a['use'](_0x3392('0xf2'),require(_0x3392('0xf3')));_0x25e80a['use'](_0x3392('0xf4'),require(_0x3392('0xf5')));_0x25e80a[_0x3392('0x1b')]('/api/voice/prefixes',require(_0x3392('0xf6')));_0x25e80a['use'](_0x3392('0xf7'),require(_0x3392('0xf8')));_0x25e80a[_0x3392('0x1b')]('/api/userProfile/sections',require(_0x3392('0xf9')));_0x25e80a['use'](_0x3392('0xfa'),require(_0x3392('0xfb')));_0x25e80a[_0x3392('0x1b')](_0x3392('0xfc'),require(_0x3392('0xfd')));_0x25e80a['use'](_0x3392('0xfe'),require(_0x3392('0xff')));_0x25e80a['use']('/api/whatsapp/applications',require(_0x3392('0x100')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x101'),require('./api/whatsappInteraction'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x102'),require('./api/whatsappMessage'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x103'),require(_0x3392('0x104')));_0x25e80a['use'](_0x3392('0x105'),require(_0x3392('0x106')));_0x25e80a['use']('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x25e80a['use']('/api/cloudProviders',require(_0x3392('0x107')));_0x25e80a[_0x3392('0x1b')]('/api/realtime',require(_0x3392('0x108')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x109'),require('./api/authLocal'));_0x25e80a[_0x3392('0x1b')]('/api/auth/google',require('./api/authGoogle'));_0x25e80a[_0x3392('0x1b')](_0x3392('0x10a'),require(_0x3392('0x10b')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x10c'),require(_0x3392('0x10d')));_0x25e80a[_0x3392('0x1b')]('/api/version',require(_0x3392('0x10e')));_0x25e80a['use'](_0x3392('0x10f'),require(_0x3392('0x110')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x111'),require(_0x3392('0x112')));_0x25e80a['use'](_0x3392('0x113'),require(_0x3392('0x114')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x115'),express[_0x3392('0x116')](path['join'](config[_0x3392('0x117')],'/apidoc')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x118'),express['static'](path[_0x3392('0x119')](config[_0x3392('0x117')],_0x3392('0x118'))));_0x25e80a[_0x3392('0x1b')](_0x3392('0x11a'),express[_0x3392('0x116')](path[_0x3392('0x119')](config[_0x3392('0x117')],_0x3392('0x11a'))));_0x25e80a[_0x3392('0x1b')](_0x3392('0x11b'),express[_0x3392('0x116')](path[_0x3392('0x119')](config[_0x3392('0x117')],'snippet','3.0.0')));_0x25e80a[_0x3392('0x1b')](_0x3392('0x11c'),express[_0x3392('0x116')](path[_0x3392('0x119')](config[_0x3392('0x117')],_0x3392('0x11d'))));_0x25e80a[_0x3392('0x11e')](_0x3392('0x11f'))[_0x3392('0x120')](errors[0x194]);_0x25e80a[_0x3392('0x11e')]('/*')[_0x3392('0x120')](function(_0xdc784f,_0x461fde){_0x461fde[_0x3392('0x121')](path[_0x3392('0x122')](_0x25e80a[_0x3392('0x120')](_0x3392('0x123'))+'/index.html'));});};var sensitiveFields=[_0x3392('0x124'),_0x3392('0x125'),'newPassword',_0x3392('0x126'),_0x3392('0x127'),'lastName',_0x3392('0x128'),_0x3392('0x129'),_0x3392('0x12a'),_0x3392('0x12b'),'email',_0x3392('0x12c'),_0x3392('0x12d'),_0x3392('0x12e'),'code',_0x3392('0x12f'),_0x3392('0x130'),_0x3392('0x131'),_0x3392('0x132'),_0x3392('0x133'),'accessTokenSecret',_0x3392('0x134'),_0x3392('0x135'),_0x3392('0x136'),_0x3392('0x137'),_0x3392('0x138'),'calleridnum',_0x3392('0x139'),_0x3392('0x13a'),'clientEmail','privateKey','accesskeyid',_0x3392('0x13b'),'key',_0x3392('0x17'),_0x3392('0x13c'),_0x3392('0x13d'),_0x3392('0x13e'),_0x3392('0x13f'),_0x3392('0x140'),_0x3392('0x141'),_0x3392('0x142')];function maskSensitiveData(_0x18118e){var _0x344bc1=/(?!^)[\s\S](?!$)/g;if(!_[_0x3392('0x143')](_0x18118e))return;for(var _0xfa45bd in _0x18118e){if(_[_0x3392('0x144')](_0x18118e[_0xfa45bd])){for(var _0x2609de=0x0;_0x2609de<_0x18118e[_0xfa45bd][_0x3392('0x145')];_0x2609de++){maskSensitiveData(_0x18118e[_0xfa45bd][_0x2609de]);}}else if(_[_0x3392('0x143')](_0x18118e[_0xfa45bd])){maskSensitiveData(_0x18118e[_0xfa45bd]);}else if(_[_0x3392('0x146')](_0x18118e[_0xfa45bd])){_0x18118e[_0xfa45bd]=_0x18118e[_0xfa45bd][_0x3392('0x147')](/{{{/g,_0x3392('0x148'))[_0x3392('0x147')](/}}}/g,_0x3392('0x149'))[_0x3392('0x147')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x3392('0x14a')](sensitiveFields,_0xfa45bd)){_0x18118e[_0xfa45bd]=_0x18118e[_0xfa45bd][_0x3392('0x147')](_0x344bc1,'*');}}}}
\ No newline at end of file
+var _0xc5ad=['./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./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/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/rpc','./api/rpc','/api/version','./api/version','./api/webbar','/apidoc','static','root','/www','join','/demo','snippet','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','localstationid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','}@@','includes','lodash','path','express','express-winston','util','./errors','./config/logger','api','auth','./safe-template','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','format','method','headers','x-forwarded-for','connection','responseTime','user','name','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)','remoteAddress','url','other','agent_name','test','use','/api/users','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc5ad,0xea));var _0xdc5a=function(_0x70852c,_0x4bc136){_0x70852c=_0x70852c-0x0;var _0x50cbf2=_0xc5ad[_0x70852c];return _0x50cbf2;};'use strict';var _=require(_0xdc5a('0x0'));var path=require(_0xdc5a('0x1'));var express=require(_0xdc5a('0x2'));var ewinston=require(_0xdc5a('0x3'));var util=require(_0xdc5a('0x4'));var errors=require(_0xdc5a('0x5'));var config=require('./config/environment');var logger=require(_0xdc5a('0x6'))(_0xdc5a('0x7'));var authLogger=require(_0xdc5a('0x6'))(_0xdc5a('0x8'));var safeTemplate=require(_0xdc5a('0x9'))['safeTemplate'];exports['default']=function(_0x3d25b4){_0x3d25b4['use'](ewinston[_0xdc5a('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2d5c13,_0x569891){var _0x384bee=_0xdc5a('0xb');if(!_['isEmpty'](_0x2d5c13[_0xdc5a('0xc')])){_0x384bee+='\x20body=%s';var _0x39e209=_0x2d5c13['body'];maskSensitiveData(_0x39e209);}return safeTemplate(util[_0xdc5a('0xd')](_0x384bee,_0x2d5c13[_0xdc5a('0xe')],_0x2d5c13['headers']['x-forwarded-for']?_0x2d5c13[_0xdc5a('0xf')][_0xdc5a('0x10')]:_0x2d5c13[_0xdc5a('0x11')]['remoteAddress']||_0x2d5c13['ip'],_0x2d5c13['url'],_0x569891['statusCode'],_0x569891[_0xdc5a('0x12')],_0x2d5c13['user']?_0x2d5c13[_0xdc5a('0x13')]['id']:null,_0x2d5c13['user']?_0x2d5c13[_0xdc5a('0x13')][_0xdc5a('0x14')]:null,_0x2d5c13[_0xdc5a('0x13')]?_0x2d5c13[_0xdc5a('0x13')][_0xdc5a('0x15')]:null,_0x39e209?util[_0xdc5a('0x16')](_0x39e209,![],null):''));}}));_0x3d25b4['use'](ewinston[_0xdc5a('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3fb244,_0x88321b){var _0x1017b9=_0xdc5a('0x17');if(_0x3fb244[_0xdc5a('0xc')]&&_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x18')]&&_0x3fb244['body'][_0xdc5a('0x19')]){_0x1017b9=_0xdc5a('0x1a');}return util[_0xdc5a('0xd')](_0x1017b9,_0x3fb244[_0xdc5a('0xe')],_0x3fb244['headers']['x-forwarded-for']?_0x3fb244['headers'][_0xdc5a('0x10')]:_0x3fb244[_0xdc5a('0x11')][_0xdc5a('0x1b')]||_0x3fb244['ip'],_0x3fb244[_0xdc5a('0x1c')],_0x88321b['statusCode'],_0x88321b[_0xdc5a('0x12')],_0x3fb244[_0xdc5a('0x13')]?_0x3fb244[_0xdc5a('0x13')]['id']:null,_0x3fb244['user']?_0x3fb244[_0xdc5a('0x13')]['name']:null,_0x3fb244[_0xdc5a('0x13')]?_0x3fb244[_0xdc5a('0x13')][_0xdc5a('0x15')]:null,_0x3fb244[_0xdc5a('0xc')]&&_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x18')]?_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x18')]:_0xdc5a('0x1d'),_0x3fb244[_0xdc5a('0xc')]&&_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x19')]?_0x3fb244['body'][_0xdc5a('0x19')]:'',_0x3fb244[_0xdc5a('0xc')]&&_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x1e')]?_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x1e')]:'');},'ignoreRoute':function(_0xbc0715){var _0x5b01fd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5b01fd[_0xdc5a('0x1f')](_0xbc0715[_0xdc5a('0x1c')]);}}));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x21'),require('./api/user'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x22'),require('./api/voiceChanSpy'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x23'),require(_0xdc5a('0x24')));_0x3d25b4['use']('/api/voice/extensions',require(_0xdc5a('0x25')));_0x3d25b4[_0xdc5a('0x20')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x26'),require('./api/voiceQueue'));_0x3d25b4[_0xdc5a('0x20')]('/api/voice/recordings',require(_0xdc5a('0x27')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x28'),require(_0xdc5a('0x29')));_0x3d25b4[_0xdc5a('0x20')]('/api/voice/mails',require(_0xdc5a('0x2a')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x2b'),require('./api/voiceMailMessage'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x2c'),require(_0xdc5a('0x2d')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x2e'),require('./api/voiceDialReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x2f'),require('./api/voiceAgentReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x30'),require(_0xdc5a('0x31')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x32'),require(_0xdc5a('0x33')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x34'),require('./api/trunk'));_0x3d25b4['use']('/api/voice/transfers/reports',require(_0xdc5a('0x35')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x36'),require(_0xdc5a('0x37')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x38'),require(_0xdc5a('0x39')));_0x3d25b4['use'](_0xdc5a('0x3a'),require(_0xdc5a('0x3b')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x3c'),require(_0xdc5a('0x3d')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x3e'),require(_0xdc5a('0x3f')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x40'),require(_0xdc5a('0x41')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x42'),require('./api/mailApplication'));_0x3d25b4[_0xdc5a('0x20')]('/api/mail/reports/queue',require(_0xdc5a('0x43')));_0x3d25b4[_0xdc5a('0x20')]('/api/dashboards',require(_0xdc5a('0x44')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x45'),require(_0xdc5a('0x46')));_0x3d25b4[_0xdc5a('0x20')]('/api/fax/accounts',require(_0xdc5a('0x47')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x48'),require(_0xdc5a('0x49')));_0x3d25b4['use'](_0xdc5a('0x4a'),require('./api/faxInteraction'));_0x3d25b4['use']('/api/fax/messages',require(_0xdc5a('0x4b')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x4c'),require('./api/faxQueue'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x4d'),require(_0xdc5a('0x4e')));_0x3d25b4['use']('/api/sms/accounts',require('./api/smsAccount'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x4f'),require(_0xdc5a('0x50')));_0x3d25b4['use'](_0xdc5a('0x51'),require('./api/smsInteraction'));_0x3d25b4['use'](_0xdc5a('0x52'),require(_0xdc5a('0x53')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x54'),require(_0xdc5a('0x55')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x56'),require(_0xdc5a('0x57')));_0x3d25b4[_0xdc5a('0x20')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x58'),require(_0xdc5a('0x59')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x5a'),require(_0xdc5a('0x5b')));_0x3d25b4[_0xdc5a('0x20')]('/api/openchannel/queues',require(_0xdc5a('0x5c')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x5d'),require('./api/chatWebsite'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x5e'),require(_0xdc5a('0x5f')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x60'),require(_0xdc5a('0x61')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x62'),require(_0xdc5a('0x63')));_0x3d25b4['use'](_0xdc5a('0x64'),require(_0xdc5a('0x65')));_0x3d25b4['use'](_0xdc5a('0x66'),require('./api/chatOfflineMessage'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x67'),require(_0xdc5a('0x68')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x69'),require(_0xdc5a('0x6a')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x6b'),require(_0xdc5a('0x6c')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x6d'),require(_0xdc5a('0x6e')));_0x3d25b4['use']('/api/cm/contacts',require(_0xdc5a('0x6f')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x70'),require(_0xdc5a('0x71')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x72'),require(_0xdc5a('0x73')));_0x3d25b4[_0xdc5a('0x20')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x3d25b4[_0xdc5a('0x20')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x3d25b4[_0xdc5a('0x20')]('/api/cm/custom_fields',require(_0xdc5a('0x74')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x75'),require(_0xdc5a('0x76')));_0x3d25b4['use'](_0xdc5a('0x77'),require('./api/automation'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x78'),require(_0xdc5a('0x79')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x7a'),require('./api/disposition'));_0x3d25b4[_0xdc5a('0x20')]('/api/conditions',require(_0xdc5a('0x7b')));_0x3d25b4[_0xdc5a('0x20')]('/api/intervals',require(_0xdc5a('0x7c')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x7d'),require(_0xdc5a('0x7e')));_0x3d25b4[_0xdc5a('0x20')]('/api/cdr',require(_0xdc5a('0x7f')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x80'),require(_0xdc5a('0x81')));_0x3d25b4[_0xdc5a('0x20')]('/api/schedules',require('./api/schedule'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x82'),require(_0xdc5a('0x83')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x84'),require('./api/tag'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x85'),require(_0xdc5a('0x86')));_0x3d25b4[_0xdc5a('0x20')]('/api/triggers',require(_0xdc5a('0x87')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x88'),require(_0xdc5a('0x89')));_0x3d25b4['use']('/api/integrations',require(_0xdc5a('0x8a')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x8b'),require('./api/integrationReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x8c'),require(_0xdc5a('0x8d')));_0x3d25b4['use'](_0xdc5a('0x8e'),require(_0xdc5a('0x8f')));_0x3d25b4['use'](_0xdc5a('0x90'),require(_0xdc5a('0x91')));_0x3d25b4[_0xdc5a('0x20')]('/api/analytics/metrics',require(_0xdc5a('0x92')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x93'),require('./api/analyticFieldReport'));_0x3d25b4['use'](_0xdc5a('0x94'),require(_0xdc5a('0x95')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x96'),require(_0xdc5a('0x97')));_0x3d25b4['use']('/api/integrations/salesforce/configurations',require(_0xdc5a('0x98')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x99'),require('./api/intSalesforceField'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x9a'),require(_0xdc5a('0x9b')));_0x3d25b4[_0xdc5a('0x20')]('/api/integrations/sugarcrm/configurations',require(_0xdc5a('0x9c')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x9d'),require(_0xdc5a('0x9e')));_0x3d25b4['use'](_0xdc5a('0x9f'),require(_0xdc5a('0xa0')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa1'),require(_0xdc5a('0xa2')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa3'),require(_0xdc5a('0xa4')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa5'),require(_0xdc5a('0xa6')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa7'),require(_0xdc5a('0xa8')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa9'),require(_0xdc5a('0xaa')));_0x3d25b4['use'](_0xdc5a('0xab'),require(_0xdc5a('0xac')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xad'),require('./api/intZendeskConfiguration'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xae'),require('./api/intZendeskField'));_0x3d25b4['use'](_0xdc5a('0xaf'),require(_0xdc5a('0xb0')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb1'),require(_0xdc5a('0xb2')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb3'),require('./api/intFreshdeskField'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb4'),require('./api/intVtigerAccount'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb5'),require('./api/intVtigerConfiguration'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb6'),require(_0xdc5a('0xb7')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb8'),require(_0xdc5a('0xb9')));_0x3d25b4['use'](_0xdc5a('0xba'),require(_0xdc5a('0xbb')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xbc'),require('./api/intServicenowField'));_0x3d25b4['use'](_0xdc5a('0xbd'),require(_0xdc5a('0xbe')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xbf'),require(_0xdc5a('0xc0')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xc1'),require(_0xdc5a('0xc2')));_0x3d25b4['use'](_0xdc5a('0xc3'),require(_0xdc5a('0xc4')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xc5'),require('./api/intFreshsalesConfiguration'));_0x3d25b4[_0xdc5a('0x20')]('/api/integrations/freshsales/fields',require(_0xdc5a('0xc6')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xc7'),require(_0xdc5a('0xc8')));_0x3d25b4[_0xdc5a('0x20')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xc9'),require(_0xdc5a('0xca')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xcb'),require('./api/jscriptyAnswerReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xcc'),require(_0xdc5a('0xcd')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xce'),require('./api/jscriptySessionReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xcf'),require(_0xdc5a('0xd0')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xd1'),require('./api/squareReport'));_0x3d25b4[_0xdc5a('0x20')]('/api/square/details/reports',require(_0xdc5a('0xd2')));_0x3d25b4[_0xdc5a('0x20')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xd3'),require(_0xdc5a('0xd4')));_0x3d25b4[_0xdc5a('0x20')]('/api/square/odbc',require(_0xdc5a('0xd5')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xd6'),require(_0xdc5a('0xd7')));_0x3d25b4['use']('/api/square/recordings',require('./api/squareRecording'));_0x3d25b4[_0xdc5a('0x20')]('/api/square/messages',require('./api/squareMessage'));_0x3d25b4['use'](_0xdc5a('0xd8'),require('./api/team'));_0x3d25b4['use'](_0xdc5a('0xd9'),require(_0xdc5a('0xda')));_0x3d25b4['use'](_0xdc5a('0xdb'),require('./api/campaign'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xdc'),require(_0xdc5a('0xdd')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xde'),require(_0xdc5a('0xdf')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xe0'),require(_0xdc5a('0xe1')));_0x3d25b4['use'](_0xdc5a('0xe2'),require(_0xdc5a('0xe3')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xe4'),require('./api/chatTransferReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xe5'),require(_0xdc5a('0xe6')));_0x3d25b4['use'](_0xdc5a('0xe7'),require(_0xdc5a('0xe8')));_0x3d25b4['use']('/api/sms/reports/transfer',require(_0xdc5a('0xe9')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xea'),require(_0xdc5a('0xeb')));_0x3d25b4[_0xdc5a('0x20')]('/api/voice/prefixes',require(_0xdc5a('0xec')));_0x3d25b4[_0xdc5a('0x20')]('/api/userProfiles',require(_0xdc5a('0xed')));_0x3d25b4[_0xdc5a('0x20')]('/api/userProfile/sections',require(_0xdc5a('0xee')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xef'),require('./api/userProfileResource'));_0x3d25b4['use'](_0xdc5a('0xf0'),require(_0xdc5a('0xf1')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xf2'),require('./api/whatsappAccount'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xf3'),require(_0xdc5a('0xf4')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xf5'),require(_0xdc5a('0xf6')));_0x3d25b4['use'](_0xdc5a('0xf7'),require(_0xdc5a('0xf8')));_0x3d25b4['use'](_0xdc5a('0xf9'),require(_0xdc5a('0xfa')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xfb'),require(_0xdc5a('0xfc')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xfd'),require('./api/whatsappQueue'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xfe'),require(_0xdc5a('0xff')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x100'),require(_0xdc5a('0x101')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x102'),require('./api/authLocal'));_0x3d25b4[_0xdc5a('0x20')]('/api/auth/google',require('./api/authGoogle'));_0x3d25b4['use']('/api/jira',require('./api/jira'));_0x3d25b4['use'](_0xdc5a('0x103'),require(_0xdc5a('0x104')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x105'),require(_0xdc5a('0x106')));_0x3d25b4[_0xdc5a('0x20')]('/api/system',require('./api/system'));_0x3d25b4['use']('/api/pm2',require('./api/pm2'));_0x3d25b4[_0xdc5a('0x20')]('/api/webbar',require(_0xdc5a('0x107')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x108'),express[_0xdc5a('0x109')](path['join'](config[_0xdc5a('0x10a')],_0xdc5a('0x108'))));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x10b'),express[_0xdc5a('0x109')](path[_0xdc5a('0x10c')](config[_0xdc5a('0x10a')],_0xdc5a('0x10b'))));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x10d'),express[_0xdc5a('0x109')](path['join'](config[_0xdc5a('0x10a')],_0xdc5a('0x10d'))));_0x3d25b4[_0xdc5a('0x20')]('/snippet',express[_0xdc5a('0x109')](path[_0xdc5a('0x10c')](config['root'],_0xdc5a('0x10e'),'3.0.0')));_0x3d25b4['use'](_0xdc5a('0x10f'),express[_0xdc5a('0x109')](path['join'](config[_0xdc5a('0x10a')],_0xdc5a('0x110'))));_0x3d25b4['route'](_0xdc5a('0x111'))[_0xdc5a('0x112')](errors[0x194]);_0x3d25b4[_0xdc5a('0x113')]('/*')['get'](function(_0x45d5c8,_0x8ea18b){_0x8ea18b[_0xdc5a('0x114')](path[_0xdc5a('0x115')](_0x3d25b4[_0xdc5a('0x112')](_0xdc5a('0x116'))+_0xdc5a('0x117')));});};var sensitiveFields=[_0xdc5a('0x118'),_0xdc5a('0x119'),_0xdc5a('0x11a'),_0xdc5a('0x11b'),_0xdc5a('0x11c'),_0xdc5a('0x11d'),'street',_0xdc5a('0x11e'),_0xdc5a('0x11f'),_0xdc5a('0x120'),_0xdc5a('0x121'),_0xdc5a('0x122'),_0xdc5a('0x123'),_0xdc5a('0x124'),_0xdc5a('0x125'),_0xdc5a('0x126'),_0xdc5a('0x127'),_0xdc5a('0x128'),_0xdc5a('0x129'),_0xdc5a('0x12a'),_0xdc5a('0x12b'),_0xdc5a('0x12c'),_0xdc5a('0x12d'),'consumerSecret','membername',_0xdc5a('0x12e'),_0xdc5a('0x12f'),'exten',_0xdc5a('0x130'),_0xdc5a('0x131'),_0xdc5a('0x132'),_0xdc5a('0x133'),_0xdc5a('0x134'),'key',_0xdc5a('0x13'),_0xdc5a('0x135'),'accountSid',_0xdc5a('0x136'),'dsn',_0xdc5a('0x137'),_0xdc5a('0x138'),_0xdc5a('0x139')];function maskSensitiveData(_0x5d558a){var _0x45681a=/(?!^)[\s\S](?!$)/g;if(!_[_0xdc5a('0x13a')](_0x5d558a))return;for(var _0x377056 in _0x5d558a){if(_[_0xdc5a('0x13b')](_0x5d558a[_0x377056])){for(var _0x3222fd=0x0;_0x3222fd<_0x5d558a[_0x377056][_0xdc5a('0x13c')];_0x3222fd++){maskSensitiveData(_0x5d558a[_0x377056][_0x3222fd]);}}else if(_[_0xdc5a('0x13a')](_0x5d558a[_0x377056])){maskSensitiveData(_0x5d558a[_0x377056]);}else if(_[_0xdc5a('0x13d')](_0x5d558a[_0x377056])){_0x5d558a[_0x377056]=_0x5d558a[_0x377056][_0xdc5a('0x13e')](/{{{/g,'@@{')['replace'](/}}}/g,_0xdc5a('0x13f'))[_0xdc5a('0x13e')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0xdc5a('0x140')](sensitiveFields,_0x377056)){_0x5d558a[_0x377056]=_0x5d558a[_0x377056][_0xdc5a('0x13e')](_0x45681a,'*');}}}}
\ No newline at end of file
index 86d335f..0bfafb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf673=['../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.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/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/cmContact/cmContact.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/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','rpc','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc'];(function(_0x25d8eb,_0x38346d){var _0x2e8639=function(_0x27cec3){while(--_0x27cec3){_0x25d8eb['push'](_0x25d8eb['shift']());}};_0x2e8639(++_0x38346d);}(_0xf673,0x1bf));var _0x3f67=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0xf673[_0x26721d];return _0x1035c5;};'use strict';var jayson=require(_0x3f67('0x0'));var BPromise=require(_0x3f67('0x1'));var _=require('lodash');var config=require(_0x3f67('0x2'));exports[_0x3f67('0x3')]=function(){return new BPromise(function(_0x3c47fc,_0x3a308f){var _0x5e7301={};_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x4')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x6')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x7')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x8')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x9')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0xa')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0xb')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0xc')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0xd')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0xe')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0xf')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x10')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x11')));_0x5e7301=_['merge'](_0x5e7301,require('../api/mailAccount/mailAccount.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x12')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x13')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x14')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x15')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x16')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x17')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x18')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x19')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x1a')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x1b')));_0x5e7301=_['merge'](_0x5e7301,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/smsAccount/smsAccount.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x1c')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x1d')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x1e')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x1f')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x20')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x21')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x22')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x23')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/chatMessage/chatMessage.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/chatQueue/chatQueue.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x24')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/cmHopper/cmHopper.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x25')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x26')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x27')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x28')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x29')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x2a')));_0x5e7301=_['merge'](_0x5e7301,require('../api/template/template.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x2b')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x2c')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x2d')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x2e')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x2f')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x30')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x31')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x32')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x33')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x34')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x35')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x36')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x37')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x38')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x39')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x3a')));_0x5e7301=_['merge'](_0x5e7301,require('../api/squareRecording/squareRecording.rpc'));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x3b')));_0x5e7301=_['merge'](_0x5e7301,require(_0x3f67('0x3c')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x3d')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x3e')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x3f')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x40')));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x41')));_0x5e7301=_['merge'](_0x5e7301,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5e7301=_[_0x3f67('0x5')](_0x5e7301,require(_0x3f67('0x42')));var _0x2d8e07=jayson[_0x3f67('0x43')](_0x5e7301)['http']();var _0x1bb844=config['rpc'][_0x3f67('0x44')]||config[_0x3f67('0x44')]+0x1;var _0x5e9bed=config[_0x3f67('0x45')]['ip']||_0x3f67('0x46');_0x2d8e07['on']('error',function(_0x3604c2){return _0x3a308f(_0x3604c2);});_0x2d8e07[_0x3f67('0x3')](_0x1bb844,_0x5e9bed,function(){console[_0x3f67('0x47')](_0x3f67('0x48'),_0x5e9bed,_0x1bb844);require(_0x3f67('0x49'))[_0x3f67('0x4a')]();return _0x3c47fc(_0x3f67('0x4b')+_0x5e9bed+':'+_0x1bb844);});});};
\ No newline at end of file
+var _0x5cf7=['merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','bluebird','../config/environment','../api/user/user.rpc'];(function(_0xe33eca,_0x332ee5){var _0x2184d6=function(_0x49d39a){while(--_0x49d39a){_0xe33eca['push'](_0xe33eca['shift']());}};_0x2184d6(++_0x332ee5);}(_0x5cf7,0x160));var _0x75cf=function(_0x501305,_0x55b0a0){_0x501305=_0x501305-0x0;var _0x2709ca=_0x5cf7[_0x501305];return _0x2709ca;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x75cf('0x0'));var _=require('lodash');var config=require(_0x75cf('0x1'));exports['listen']=function(){return new BPromise(function(_0x11eafd,_0x107191){var _0x48d7b7={};_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x2')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x4')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x5')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/voiceRecording/voiceRecording.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x6')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x7')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x8')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x9')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/trunk/trunk.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xa')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xb')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xc')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xd')));_0x48d7b7=_['merge'](_0x48d7b7,require('../api/mailQueue/mailQueue.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xe')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/mailMessage/mailMessage.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xf')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/faxAccount/faxAccount.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x10')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x11')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x12')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x13')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x14')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/smsAccount/smsAccount.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x15')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x16')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x17')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x18')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x19')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require('../api/chatInteraction/chatInteraction.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1a')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/chatQueue/chatQueue.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1b')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1c')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1d')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1e')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1f')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x20')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x21')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x22')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x23')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x24')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x25')));_0x48d7b7=_['merge'](_0x48d7b7,require('../api/variable/variable.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x26')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x27')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x28')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x29')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x2a')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x2b')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x2c')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x2d')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x2e')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x2f')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x30')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x31')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x32')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x33')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x34')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x35')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x36')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x37')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x38')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x39')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x3a')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x3b')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x3c')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x3d')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x3e')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x3f')));var _0x3f593d=jayson[_0x75cf('0x40')](_0x48d7b7)[_0x75cf('0x41')]();var _0x3bdcbf=config[_0x75cf('0x42')][_0x75cf('0x43')]||config[_0x75cf('0x43')]+0x1;var _0x5ba2aa=config['rpc']['ip']||'localhost';_0x3f593d['on']('error',function(_0x49a29b){return _0x107191(_0x49a29b);});_0x3f593d['listen'](_0x3bdcbf,_0x5ba2aa,function(){console['log'](_0x75cf('0x44'),_0x5ba2aa,_0x3bdcbf);require(_0x75cf('0x45'))['default']();return _0x11eafd(_0x75cf('0x46')+_0x5ba2aa+':'+_0x3bdcbf);});});};
\ No newline at end of file
index 7de29a4..111eb74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['\x20}\x20}','string','replace','map','isPlainObject','keys','exports','safeTemplate'];(function(_0x3b2be5,_0x9c01ae){var _0x14cd8=function(_0x5262be){while(--_0x5262be){_0x3b2be5['push'](_0x3b2be5['shift']());}};_0x14cd8(++_0x9c01ae);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x61c60c){return _0x61c60c==='{{'?'{\x20{\x20':_0x65f6('0x0');}function safeTemplate(_0x2f06ae){var _0x3461cd=_0x2f06ae;if(typeof _0x2f06ae===_0x65f6('0x1')){_0x3461cd=_0x2f06ae[_0x65f6('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x2f06ae)){_0x3461cd=_0x2f06ae[_0x65f6('0x3')](function(_0x5150c8){return safeTemplate(_0x5150c8);});}else if(_[_0x65f6('0x4')](_0x2f06ae)){_0x3461cd=Object[_0x65f6('0x5')](_0x2f06ae)['reduce'](function(_0x4ed98f,_0x1c0e12){_0x4ed98f[_0x1c0e12]=safeTemplate(_0x2f06ae[_0x1c0e12]);return _0x4ed98f;},{});}return _0x3461cd;}module[_0x65f6('0x6')][_0x65f6('0x7')]=safeTemplate;
\ No newline at end of file
+var _0xb62e=['map','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x4b964f,_0x688bee){var _0x4a8f98=function(_0x911a0d){while(--_0x911a0d){_0x4b964f['push'](_0x4b964f['shift']());}};_0x4a8f98(++_0x688bee);}(_0xb62e,0x1de));var _0xeb62=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb62e[_0x2d7f0e];return _0x110b07;};var _=require(_0xeb62('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x46335b){return _0x46335b==='{{'?_0xeb62('0x1'):_0xeb62('0x2');}function safeTemplate(_0x57a5ba){var _0x3dfdef=_0x57a5ba;if(typeof _0x57a5ba===_0xeb62('0x3')){_0x3dfdef=_0x57a5ba[_0xeb62('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb62('0x5')](_0x57a5ba)){_0x3dfdef=_0x57a5ba[_0xeb62('0x6')](function(_0x1ebdbb){return safeTemplate(_0x1ebdbb);});}else if(_['isPlainObject'](_0x57a5ba)){_0x3dfdef=Object[_0xeb62('0x7')](_0x57a5ba)[_0xeb62('0x8')](function(_0x31f5ea,_0x5e0dc4){_0x31f5ea[_0x5e0dc4]=safeTemplate(_0x57a5ba[_0x5e0dc4]);return _0x31f5ea;},{});}return _0x3dfdef;}module[_0xeb62('0x9')][_0xeb62('0xa')]=safeTemplate;
\ No newline at end of file
index 543d47b..0a025a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c2=['NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','E_AGI_SOCKET_TIMEOUT','write','inherits','command','prototype','answer','sendRequest','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s'];(function(_0xda8136,_0x5090bc){var _0x593b1b=function(_0x5ada7d){while(--_0x5ada7d){_0xda8136['push'](_0xda8136['shift']());}};_0x593b1b(++_0x5090bc);}(_0xe0c2,0x152));var _0x2e0c=function(_0x249d0a,_0x2da083){_0x249d0a=_0x249d0a-0x0;var _0x2182db=_0xe0c2[_0x249d0a];return _0x2182db;};'use strict';var util=require(_0x2e0c('0x0'));var _=require(_0x2e0c('0x1'));var EventEmitter=require(_0x2e0c('0x2'))[_0x2e0c('0x3')];var AGIReply=require(_0x2e0c('0x4'));var AGIError=require(_0x2e0c('0x5'));function AGIChannel(_0x4fc6fd){var _0x40d474=this,_0x3c0020=new AGIReply(),_0x42e600=![],_0x28fe67={};EventEmitter['call'](_0x40d474);_0x4fc6fd[_0x2e0c('0x6')](_0x2e0c('0x7'));_0x4fc6fd['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3c0020[_0x2e0c('0x6')](_0x2e0c('0x7'));_0x3c0020['on']('headers',function(_0x387d04){for(var _0x21f114 in _0x387d04){_0x40d474[_0x21f114]=_0x387d04[_0x21f114];}_0x40d474[_0x2e0c('0x8')](_0x2e0c('0x9'));});_0x3c0020['on']('line',function(_0x289e84){if(_0x289e84[_0x2e0c('0xa')]()==_0x2e0c('0xb')){_0x40d474[_0x2e0c('0x8')](_0x2e0c('0xb'));return;}if(_0x289e84[_0x2e0c('0xc')](0x0,0xb)==_0x2e0c('0xd')){_0x42e600=!![];}if(_0x42e600){_0x28fe67['rx']+=_0x289e84+'\x0a';if(_0x289e84[_0x2e0c('0xe')](_0x2e0c('0xf'))!=-0x1){_0x42e600=![];}}else{_0x28fe67['rx']=_0x289e84;}if(_0x42e600){return;}if(typeof _0x28fe67['cb']==_0x2e0c('0x10')){var _0x244bb5=_0x28fe67['rx'][_0x2e0c('0xc')](0x0,0x3),_0x504774=null,_0x51e349=null;_0x244bb5=parseInt(_0x244bb5);if(isNaN(_0x244bb5)){_0x28fe67['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2e0c('0x11')});return;}if(_0x244bb5!=0xc8){_0x28fe67['cb'](null,{'code':_0x244bb5,'result':-0x1,'extra':'KO'});return;}_0x504774=_0x28fe67['rx'][_0x2e0c('0xc')](0x4)['replace'](_0x2e0c('0x12'),'');if(_0x504774[_0x2e0c('0x13')]('\x20')!=-0x1){_0x504774=_0x504774['substr'](0x0,_0x504774[_0x2e0c('0x13')]('\x20'));}if(_[_0x2e0c('0x14')](_0x504774,'-1')){_0x504774=parseInt(_0x504774);}_0x51e349=_0x28fe67['rx']['split']('\x20');if(_0x51e349[_0x2e0c('0x15')]==0x3){_0x51e349=_0x51e349[0x2][_0x2e0c('0xc')](0x1,_0x51e349[0x2]['length']-0x1);}else if(_0x51e349[_0x2e0c('0x15')]>0x3){var _0x17d923=/\((.+)\)/;var _0x4ef21a=_0x28fe67['rx'][_0x2e0c('0x16')](_0x17d923);if(_0x4ef21a){_0x51e349=_0x4ef21a[0x1];}else{_0x51e349=null;}}else{_0x51e349=null;}_0x28fe67['cb'](null,{'code':_0x244bb5,'result':_0x504774,'extra':_0x51e349});}});_0x4fc6fd['on'](_0x2e0c('0x17'),function(_0x3d66a2){_0x40d474[_0x2e0c('0x8')](_0x2e0c('0x17'),new AGIError(_0x2e0c('0x18'),_0x3d66a2['code']));});_0x4fc6fd['on']('close',function(){_0x40d474[_0x2e0c('0x8')](_0x2e0c('0x19'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4fc6fd['on'](_0x2e0c('0x1a'),function(){_0x40d474[_0x2e0c('0x8')](_0x2e0c('0x1a'),new AGIError(_0x2e0c('0x1b')));_0x4fc6fd['destroy']();});_0x4fc6fd['pipe'](_0x3c0020);this['command']=function(_0x5b574f,_0x116685){var _0x5b574f=_0x5b574f||'',_0x116685=typeof _0x116685==_0x2e0c('0x10')?_0x116685:new Function();_0x28fe67={'tx':_0x5b574f,'rx':'','cb':_0x116685};_0x4fc6fd[_0x2e0c('0x1c')](_0x5b574f+'\x0a');},this[_0x2e0c('0x19')]=function(){_0x4fc6fd['destroy']();};}util[_0x2e0c('0x1d')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x2c2826){return this[_0x2e0c('0x1e')]['sync'](this,_0x2c2826);};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x20')]=function(){return this[_0x2e0c('0x21')]('ANSWER');};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x22')]=function(_0x1769bf,_0x5369a6,_0x5356a0){_0x1769bf=_0x1769bf===undefined?_0x2e0c('0x23'):_0x1769bf;_0x5369a6=_0x5369a6===undefined?'5':_0x5369a6;_0x5356a0=_0x5356a0===undefined?'1':_0x5356a0;return this['sendRequest'](util['format'](_0x2e0c('0x24'),_0x1769bf,_0x5369a6*0x3e8,_0x5356a0));};AGIChannel[_0x2e0c('0x1f')]['noop']=function(_0x39e197){_0x39e197=_0x39e197||_0x2e0c('0x25');return this[_0x2e0c('0x21')](util[_0x2e0c('0x26')](_0x2e0c('0x27'),_0x39e197));};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x28')]=function(_0x131b7,_0x14c86d){if(_[_0x2e0c('0x29')](_0x14c86d)){return this[_0x2e0c('0x21')](util['format'](_0x2e0c('0x2a'),_0x131b7,_0x14c86d[_0x2e0c('0x2b')](',')));}return this[_0x2e0c('0x21')](util[_0x2e0c('0x26')](_0x2e0c('0x2a'),_0x131b7,_0x14c86d));};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x2c')]=function(_0xa45f81){return this[_0x2e0c('0x21')](util['format'](_0x2e0c('0x2d'),_0xa45f81));};AGIChannel['prototype'][_0x2e0c('0x2e')]=function(_0x53cb40){return this['sendRequest'](util[_0x2e0c('0x26')](_0x2e0c('0x2f'),_0x53cb40));};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x30')]=function(_0x5c5932){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0x5c5932));};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0xb')]=function(){return this[_0x2e0c('0x21')](_0x2e0c('0x31'));};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x32')]=function(_0x49a8ee,_0x40526f){var _0x19d380=_[_0x2e0c('0x33')](_0x40526f)||_[_0x2e0c('0x34')](_0x40526f)?_0x40526f['toString']():_0x40526f;return this[_0x2e0c('0x21')](util['format'](_0x2e0c('0x35'),_0x49a8ee,_0x19d380?_0x19d380['toString']()[_0x2e0c('0x36')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x2e0c('0x37')]=function(_0x3a8d63,_0x124085){return this[_0x2e0c('0x21')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x3a8d63,_0x124085));};AGIChannel[_0x2e0c('0x1f')]['sayDigits']=function(_0x5d35e5,_0x5aeb79){return this[_0x2e0c('0x21')](util['format'](_0x2e0c('0x38'),_0x5d35e5,_0x5aeb79));};AGIChannel['prototype'][_0x2e0c('0x39')]=function(_0x5d495c,_0x274d0c){return this[_0x2e0c('0x21')](util[_0x2e0c('0x26')](_0x2e0c('0x3a'),_0x5d495c,_0x274d0c));};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x3b')]=function(_0xaebc29,_0x5a8ca2,_0x5eba35){_0x5a8ca2=_0x5a8ca2||this[_0x2e0c('0x3c')];_0x5eba35=_0x5eba35||0x1;this[_0x2e0c('0x2c')](_0xaebc29);this[_0x2e0c('0x2e')](_0x5a8ca2);this[_0x2e0c('0x30')](_0x5eba35);return this[_0x2e0c('0x3d')](util[_0x2e0c('0x26')](_0x2e0c('0x3e'),_0xaebc29,_0x5a8ca2,_0x5eba35));};AGIChannel['prototype']['getVariable']=function(_0x2f5d8a){return this['sendRequest'](util[_0x2e0c('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2f5d8a));};AGIChannel['prototype']['recordFile']=function(_0x3ccf87,_0x2bc618,_0x20b28e,_0x5c1e32,_0xa48c89,_0x8726b4){_0x2bc618=_0x2bc618||_0x2e0c('0x3f');_0x20b28e=_0x20b28e||'';_0x5c1e32=_0x5c1e32===undefined?-0x1:_0x5c1e32==='-1'?-0x1:_0x5c1e32*0x3e8;_0xa48c89=_0xa48c89===undefined?'':'s='+_0xa48c89;_0x8726b4=_0x8726b4?_0x2e0c('0x40'):'';return this[_0x2e0c('0x21')](util[_0x2e0c('0x26')](_0x2e0c('0x41'),_0x3ccf87,_0x2bc618,_0x20b28e,_0x5c1e32,_0x8726b4,_0xa48c89));};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x42')]=function(_0x1b4bcf,_0xcffcc3){_0xcffcc3=_0xcffcc3||'';return this[_0x2e0c('0x21')](util[_0x2e0c('0x26')](_0x2e0c('0x43'),_0x1b4bcf,_0xcffcc3));};AGIChannel['prototype'][_0x2e0c('0x44')]=function(_0xfbdb74){return this[_0x2e0c('0x28')](_0x2e0c('0x45'),_0xfbdb74);};AGIChannel[_0x2e0c('0x1f')][_0x2e0c('0x46')]=function(_0x22083d){return this[_0x2e0c('0x28')](_0x2e0c('0x47'),_0x22083d);};AGIChannel[_0x2e0c('0x1f')]['error']=function(_0x52a6fc,_0x3966da){this[_0x2e0c('0x3d')](util[_0x2e0c('0x26')](_0x2e0c('0x48'),_0x52a6fc['id'],_0x52a6fc[_0x2e0c('0x49')],_0x3966da));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2e0c('0x4a')]=AGIChannel;
\ No newline at end of file
+var _0x20de=['GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','emit','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','function','destroy','inherits','prototype','sendRequest','sync','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','exec','EXEC\x20%s\x20%s','join','setContext','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x20de,0x134));var _0xe20d=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x20de[_0x2b9b7f];return _0x4ed19a;};'use strict';var util=require(_0xe20d('0x0'));var _=require('lodash');var EventEmitter=require(_0xe20d('0x1'))[_0xe20d('0x2')];var AGIReply=require(_0xe20d('0x3'));var AGIError=require(_0xe20d('0x4'));function AGIChannel(_0x9a0b77){var _0x39a7f3=this,_0x31c533=new AGIReply(),_0x174186=![],_0x7b02d6={};EventEmitter[_0xe20d('0x5')](_0x39a7f3);_0x9a0b77[_0xe20d('0x6')]('utf8');_0x9a0b77[_0xe20d('0x7')](0x8*0x3c*0x3c*0x3e8);_0x31c533['setEncoding']('utf8');_0x31c533['on']('headers',function(_0x110ff5){for(var _0x164d5e in _0x110ff5){_0x39a7f3[_0x164d5e]=_0x110ff5[_0x164d5e];}_0x39a7f3[_0xe20d('0x8')]('ready');});_0x31c533['on'](_0xe20d('0x9'),function(_0x2df52b){if(_0x2df52b['toLowerCase']()==_0xe20d('0xa')){_0x39a7f3[_0xe20d('0x8')]('hangup');return;}if(_0x2df52b[_0xe20d('0xb')](0x0,0xb)==_0xe20d('0xc')){_0x174186=!![];}if(_0x174186){_0x7b02d6['rx']+=_0x2df52b+'\x0a';if(_0x2df52b[_0xe20d('0xd')](_0xe20d('0xe'))!=-0x1){_0x174186=![];}}else{_0x7b02d6['rx']=_0x2df52b;}if(_0x174186){return;}if(typeof _0x7b02d6['cb']=='function'){var _0x59a581=_0x7b02d6['rx'][_0xe20d('0xb')](0x0,0x3),_0x28d9c5=null,_0xdc395e=null;_0x59a581=parseInt(_0x59a581);if(isNaN(_0x59a581)){_0x7b02d6['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe20d('0xf')});return;}if(_0x59a581!=0xc8){_0x7b02d6['cb'](null,{'code':_0x59a581,'result':-0x1,'extra':'KO'});return;}_0x28d9c5=_0x7b02d6['rx'][_0xe20d('0xb')](0x4)[_0xe20d('0x10')](_0xe20d('0x11'),'');if(_0x28d9c5[_0xe20d('0x12')]('\x20')!=-0x1){_0x28d9c5=_0x28d9c5[_0xe20d('0x13')](0x0,_0x28d9c5['indexOf']('\x20'));}if(_[_0xe20d('0x14')](_0x28d9c5,'-1')){_0x28d9c5=parseInt(_0x28d9c5);}_0xdc395e=_0x7b02d6['rx']['split']('\x20');if(_0xdc395e[_0xe20d('0x15')]==0x3){_0xdc395e=_0xdc395e[0x2][_0xe20d('0xb')](0x1,_0xdc395e[0x2][_0xe20d('0x15')]-0x1);}else if(_0xdc395e['length']>0x3){var _0x1d6179=/\((.+)\)/;var _0x47fdd9=_0x7b02d6['rx'][_0xe20d('0x16')](_0x1d6179);if(_0x47fdd9){_0xdc395e=_0x47fdd9[0x1];}else{_0xdc395e=null;}}else{_0xdc395e=null;}_0x7b02d6['cb'](null,{'code':_0x59a581,'result':_0x28d9c5,'extra':_0xdc395e});}});_0x9a0b77['on'](_0xe20d('0x17'),function(_0x285916){_0x39a7f3['emit'](_0xe20d('0x17'),new AGIError(_0xe20d('0x18'),_0x285916[_0xe20d('0x19')]));});_0x9a0b77['on'](_0xe20d('0x1a'),function(){_0x39a7f3['emit'](_0xe20d('0x1a'),new AGIError(_0xe20d('0x1b')));});_0x9a0b77['on'](_0xe20d('0x1c'),function(){_0x39a7f3[_0xe20d('0x8')]('timeout',new AGIError(_0xe20d('0x1d')));_0x9a0b77['destroy']();});_0x9a0b77['pipe'](_0x31c533);this[_0xe20d('0x1e')]=function(_0x4045b3,_0x4baa28){var _0x4045b3=_0x4045b3||'',_0x4baa28=typeof _0x4baa28==_0xe20d('0x1f')?_0x4baa28:new Function();_0x7b02d6={'tx':_0x4045b3,'rx':'','cb':_0x4baa28};_0x9a0b77['write'](_0x4045b3+'\x0a');},this[_0xe20d('0x1a')]=function(){_0x9a0b77[_0xe20d('0x20')]();};}util[_0xe20d('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xe20d('0x22')][_0xe20d('0x23')]=function(_0x5de788){return this[_0xe20d('0x1e')][_0xe20d('0x24')](this,_0x5de788);};AGIChannel[_0xe20d('0x22')][_0xe20d('0x25')]=function(){return this[_0xe20d('0x23')]('ANSWER');};AGIChannel['prototype'][_0xe20d('0x26')]=function(_0x497726,_0x25772d,_0x20845d){_0x497726=_0x497726===undefined?_0xe20d('0x27'):_0x497726;_0x25772d=_0x25772d===undefined?'5':_0x25772d;_0x20845d=_0x20845d===undefined?'1':_0x20845d;return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x29'),_0x497726,_0x25772d*0x3e8,_0x20845d));};AGIChannel[_0xe20d('0x22')]['noop']=function(_0x8b7386){_0x8b7386=_0x8b7386||'NO\x20MESSAGE';return this['sendRequest'](util['format']('VERBOSE\x20\x22%s\x22',_0x8b7386));};AGIChannel['prototype'][_0xe20d('0x2a')]=function(_0x1387dd,_0x41e140){if(_['isArray'](_0x41e140)){return this['sendRequest'](util[_0xe20d('0x28')](_0xe20d('0x2b'),_0x1387dd,_0x41e140[_0xe20d('0x2c')](',')));}return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x2b'),_0x1387dd,_0x41e140));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x2d')]=function(_0x494df3){return this[_0xe20d('0x23')](util['format']('SET\x20CONTEXT\x20%s',_0x494df3));};AGIChannel[_0xe20d('0x22')]['setExtension']=function(_0x1da98b){return this[_0xe20d('0x23')](util['format']('SET\x20EXTENSION\x20%s',_0x1da98b));};AGIChannel['prototype'][_0xe20d('0x2e')]=function(_0x163704){return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x2f'),_0x163704));};AGIChannel[_0xe20d('0x22')]['hangup']=function(){return this[_0xe20d('0x23')](_0xe20d('0x30'));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x31')]=function(_0x5ef97c,_0x1da5bf){var _0x19b190=_[_0xe20d('0x32')](_0x1da5bf)||_[_0xe20d('0x33')](_0x1da5bf)?_0x1da5bf['toString']():_0x1da5bf;return this['sendRequest'](util[_0xe20d('0x28')](_0xe20d('0x34'),_0x5ef97c,_0x19b190?_0x19b190['toString']()[_0xe20d('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x35')]=function(_0x325827,_0x118f05){return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x36'),_0x325827,_0x118f05));};AGIChannel['prototype']['sayDigits']=function(_0x5f53dd,_0x1733e3){return this[_0xe20d('0x23')](util['format'](_0xe20d('0x37'),_0x5f53dd,_0x1733e3));};AGIChannel[_0xe20d('0x22')]['sayPhonetic']=function(_0x589980,_0x19db52){return this['sendRequest'](util[_0xe20d('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x589980,_0x19db52));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x38')]=function(_0x4d0716,_0x22a41d,_0x1b36ed){_0x22a41d=_0x22a41d||this[_0xe20d('0x39')];_0x1b36ed=_0x1b36ed||0x1;this['setContext'](_0x4d0716);this[_0xe20d('0x3a')](_0x22a41d);this[_0xe20d('0x2e')](_0x1b36ed);return this[_0xe20d('0x3b')](util[_0xe20d('0x28')](_0xe20d('0x3c'),_0x4d0716,_0x22a41d,_0x1b36ed));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x3d')]=function(_0x340c88){return this[_0xe20d('0x23')](util['format'](_0xe20d('0x3e'),_0x340c88));};AGIChannel['prototype'][_0xe20d('0x3f')]=function(_0x33896e,_0x1a01cc,_0x2f2253,_0x169cc4,_0x5d47c7,_0xfc9228){_0x1a01cc=_0x1a01cc||_0xe20d('0x40');_0x2f2253=_0x2f2253||'';_0x169cc4=_0x169cc4===undefined?-0x1:_0x169cc4==='-1'?-0x1:_0x169cc4*0x3e8;_0x5d47c7=_0x5d47c7===undefined?'':'s='+_0x5d47c7;_0xfc9228=_0xfc9228?_0xe20d('0x41'):'';return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x42'),_0x33896e,_0x1a01cc,_0x2f2253,_0x169cc4,_0xfc9228,_0x5d47c7));};AGIChannel['prototype'][_0xe20d('0x43')]=function(_0x366a74,_0x2cbaf8){_0x2cbaf8=_0x2cbaf8||'';return this[_0xe20d('0x23')](util[_0xe20d('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x366a74,_0x2cbaf8));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x44')]=function(_0x137dc0){return this['exec']('AGI',_0x137dc0);};AGIChannel[_0xe20d('0x22')][_0xe20d('0x45')]=function(_0x355dd8){return this[_0xe20d('0x2a')](_0xe20d('0x46'),_0x355dd8);};AGIChannel[_0xe20d('0x22')][_0xe20d('0x17')]=function(_0x4aa0b5,_0x1f37c1){this['noop'](util[_0xe20d('0x28')](_0xe20d('0x47'),_0x4aa0b5['id'],_0x4aa0b5[_0xe20d('0x48')],_0x1f37c1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe20d('0x49')]=AGIChannel;
\ No newline at end of file
index d9e789b..ff7cbbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95d2=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x95d2,0xf1));var _0x295d=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x95d2[_0x46e363];return _0x3fb059;};'use strict';var util=require(_0x295d('0x0'));var error={'E_AGI_UNDEFINED':_0x295d('0x1'),'E_AGI_ARGUMENT_PORT':_0x295d('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x295d('0x3'),'E_AGI_SOCKET_ERROR':_0x295d('0x4'),'E_AGI_SOCKET_CLOSE':_0x295d('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x295d('0x6'),'E_AGI_COMMAND_EMPTY':_0x295d('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x295d('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5ccdaf){var _0x5ccdaf=_0x5ccdaf||null,_0x4d7e99=_0x4d7e99||[],_0xd0df30=0x1,_0x133c2a='';if(!error[_0x5ccdaf]){_0x5ccdaf=_0x295d('0x9');}_0x4d7e99[_0x295d('0xa')](error[_0x5ccdaf]);while(arguments[_0xd0df30]){_0x4d7e99[_0x295d('0xa')](arguments[_0xd0df30]);_0xd0df30++;}_0x133c2a=util[_0x295d('0xb')][_0x295d('0xc')](util,_0x4d7e99);this[_0x295d('0xd')]=_0x133c2a;this[_0x295d('0xe')]=_0x5ccdaf;}module[_0x295d('0xf')]=AGIError;
\ No newline at end of file
+var _0xdd75=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x41e6c0,_0x4a56d4){var _0xc1411e=function(_0x10f797){while(--_0x10f797){_0x41e6c0['push'](_0x41e6c0['shift']());}};_0xc1411e(++_0x4a56d4);}(_0xdd75,0x1bd));var _0x5dd7=function(_0xc3f0cd,_0x3886a2){_0xc3f0cd=_0xc3f0cd-0x0;var _0x14a8c4=_0xdd75[_0xc3f0cd];return _0x14a8c4;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x5dd7('0x0'),'E_AGI_ARGUMENT_PORT':_0x5dd7('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x5dd7('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x5dd7('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x5dd7('0x4'),'E_AGI_SOCKET_ERROR':_0x5dd7('0x5'),'E_AGI_SOCKET_CLOSE':_0x5dd7('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x5dd7('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x5dd7('0x8')};function AGIError(_0x28c7a6){var _0x28c7a6=_0x28c7a6||null,_0x245f04=_0x245f04||[],_0x574969=0x1,_0x3197df='';if(!error[_0x28c7a6]){_0x28c7a6=_0x5dd7('0x9');}_0x245f04[_0x5dd7('0xa')](error[_0x28c7a6]);while(arguments[_0x574969]){_0x245f04['push'](arguments[_0x574969]);_0x574969++;}_0x3197df=util[_0x5dd7('0xb')]['apply'](util,_0x245f04);this[_0x5dd7('0xc')]=_0x3197df;this[_0x5dd7('0xd')]=_0x28c7a6;}module[_0x5dd7('0xe')]=AGIError;
\ No newline at end of file
index a9dcc57..1927193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcff=['split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','exports','lodash','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','vertices','addEdge','size','getVertex','traverseBFS','info','stop\x20traverse','no\x20edge/s\x20available','length','condition'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xfcff,0x1a8));var _0xffcf=function(_0x4588ef,_0x1a6597){_0x4588ef=_0x4588ef-0x0;var _0x582a91=_0xfcff[_0x4588ef];return _0x582a91;};'use strict';var _=require(_0xffcf('0x0'));var logger=require('../../../config/logger')(_0xffcf('0x1'));var verticesWithRetry=[_0xffcf('0x2'),_0xffcf('0x3'),_0xffcf('0x4')];var Graph=function(){this['vertices']={};this[_0xffcf('0x5')]={};this[_0xffcf('0x6')]=0x0;};Graph[_0xffcf('0x7')]['addVertex']=function(_0xcf3456){this[_0xffcf('0x8')][_0xcf3456['id']]=_0xcf3456;this['edges'][_0xcf3456['id']]=[];};Graph[_0xffcf('0x7')][_0xffcf('0x9')]=function(_0x45ff2d,_0x20f8de,_0x35a5af){this[_0xffcf('0x5')][_0x45ff2d]['push']({'target':_0x20f8de,'condition':_0x35a5af});this[_0xffcf('0x6')]+=0x1;};Graph['prototype'][_0xffcf('0xa')]=function(){return _[_0xffcf('0xa')](this[_0xffcf('0x8')]);};Graph[_0xffcf('0x7')]['relations']=function(){return this[_0xffcf('0x6')];};Graph['prototype'][_0xffcf('0xb')]=function(_0x4d2ae9){return this[_0xffcf('0x8')][_0x4d2ae9];};Graph['prototype'][_0xffcf('0xc')]=function(_0x3a5fc6,_0x5a2889){if(!this[_0xffcf('0x8')][_0x3a5fc6]){return logger['info']('no\x20vertex\x20found');}var _0x10b02c=_0x5a2889(this['vertices'][_0x3a5fc6]);if(!_0x10b02c){return logger[_0xffcf('0xd')](_0xffcf('0xe'));}if(this[_0xffcf('0x5')][_0x3a5fc6]['length']===0x0){return logger[_0xffcf('0xd')](_0xffcf('0xf'));}for(var _0x3772df=0x0,_0x22a5d2=[],_0x19611e=![];_0x3772df<this['edges'][_0x3a5fc6][_0xffcf('0x10')];_0x3772df+=0x1){if(this[_0xffcf('0x5')][_0x3a5fc6][_0x3772df]['condition']){_0x22a5d2=this[_0xffcf('0x5')][_0x3a5fc6][_0x3772df][_0xffcf('0x11')][_0xffcf('0x12')](',');for(var _0x32cc0d=0x0;_0x32cc0d<_0x22a5d2[_0xffcf('0x10')];_0x32cc0d+=0x1){if(this[_0xffcf('0x8')][_0x3a5fc6][_0xffcf('0x13')]===_0xffcf('0x14')&&_0x22a5d2[_0x32cc0d]==='-'){_0x19611e=this[_0xffcf('0x5')][_0x3a5fc6][_0x3772df][_0xffcf('0x15')];logger['info']('default',_0x22a5d2[_0x32cc0d],this['edges'][_0x3a5fc6][_0x3772df][_0xffcf('0x15')]);}else if(this[_0xffcf('0x8')][_0x3a5fc6][_0xffcf('0x13')]===_0xffcf('0x2')&&_0x22a5d2[_0x32cc0d]==='i'){_0x19611e=this[_0xffcf('0x5')][_0x3a5fc6][_0x3772df][_0xffcf('0x15')];logger[_0xffcf('0xd')](_0xffcf('0x16'),_0x22a5d2[_0x32cc0d],this[_0xffcf('0x5')][_0x3a5fc6][_0x3772df][_0xffcf('0x15')]);}if(_0x22a5d2[_0x32cc0d]===_0x10b02c){return this['traverseBFS'](this[_0xffcf('0x5')][_0x3a5fc6][_0x3772df][_0xffcf('0x15')],_0x5a2889);}}}else{return this[_0xffcf('0xc')](this[_0xffcf('0x5')][_0x3a5fc6][_0x3772df][_0xffcf('0x15')],_0x5a2889);}}if(_0x22a5d2[_0xffcf('0x10')]){if(this[_0xffcf('0x8')][_0x3a5fc6][_0xffcf('0x13')]===_0xffcf('0x14')){if(_0x19611e){return this[_0xffcf('0xc')](_0x19611e,_0x5a2889);}return logger[_0xffcf('0xd')](_0xffcf('0x17'));}else if(_[_0xffcf('0x18')](verticesWithRetry,this[_0xffcf('0x8')][_0x3a5fc6]['agicommand'])){if(_0x10b02c==='-'){return logger[_0xffcf('0xd')]('max\x20retry\x20reach');}if(_0x19611e&&_0x10b02c!=='t'){return this[_0xffcf('0xc')](_0x19611e,_0x5a2889);}return this[_0xffcf('0xc')](_0x3a5fc6,_0x5a2889);}return logger[_0xffcf('0xd')]('condition\x20not\x20found');}};module[_0xffcf('0x19')]=Graph;
\ No newline at end of file
+var _0x1d2b=['relations','traverseBFS','no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size'];(function(_0x17045c,_0x470ebe){var _0x844ac5=function(_0x1ce250){while(--_0x1ce250){_0x17045c['push'](_0x17045c['shift']());}};_0x844ac5(++_0x470ebe);}(_0x1d2b,0x15f));var _0xb1d2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1d2b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb1d2('0x0'));var logger=require(_0xb1d2('0x1'))(_0xb1d2('0x2'));var verticesWithRetry=[_0xb1d2('0x3'),_0xb1d2('0x4'),_0xb1d2('0x5')];var Graph=function(){this[_0xb1d2('0x6')]={};this[_0xb1d2('0x7')]={};this[_0xb1d2('0x8')]=0x0;};Graph[_0xb1d2('0x9')][_0xb1d2('0xa')]=function(_0x27f9cf){this[_0xb1d2('0x6')][_0x27f9cf['id']]=_0x27f9cf;this[_0xb1d2('0x7')][_0x27f9cf['id']]=[];};Graph[_0xb1d2('0x9')][_0xb1d2('0xb')]=function(_0xc5adb9,_0x5e1c70,_0x370da3){this[_0xb1d2('0x7')][_0xc5adb9]['push']({'target':_0x5e1c70,'condition':_0x370da3});this['numberOfEdges']+=0x1;};Graph[_0xb1d2('0x9')][_0xb1d2('0xc')]=function(){return _['size'](this[_0xb1d2('0x6')]);};Graph[_0xb1d2('0x9')][_0xb1d2('0xd')]=function(){return this['numberOfEdges'];};Graph[_0xb1d2('0x9')]['getVertex']=function(_0x428bf9){return this['vertices'][_0x428bf9];};Graph['prototype'][_0xb1d2('0xe')]=function(_0x1d06b7,_0x30f58e){if(!this[_0xb1d2('0x6')][_0x1d06b7]){return logger['info'](_0xb1d2('0xf'));}var _0x147329=_0x30f58e(this[_0xb1d2('0x6')][_0x1d06b7]);if(!_0x147329){return logger[_0xb1d2('0x10')]('stop\x20traverse');}if(this[_0xb1d2('0x7')][_0x1d06b7][_0xb1d2('0x11')]===0x0){return logger[_0xb1d2('0x10')](_0xb1d2('0x12'));}for(var _0xd2fa60=0x0,_0x48a2e4=[],_0xca21c7=![];_0xd2fa60<this[_0xb1d2('0x7')][_0x1d06b7][_0xb1d2('0x11')];_0xd2fa60+=0x1){if(this[_0xb1d2('0x7')][_0x1d06b7][_0xd2fa60][_0xb1d2('0x13')]){_0x48a2e4=this['edges'][_0x1d06b7][_0xd2fa60][_0xb1d2('0x13')][_0xb1d2('0x14')](',');for(var _0x21942e=0x0;_0x21942e<_0x48a2e4[_0xb1d2('0x11')];_0x21942e+=0x1){if(this[_0xb1d2('0x6')][_0x1d06b7][_0xb1d2('0x15')]===_0xb1d2('0x16')&&_0x48a2e4[_0x21942e]==='-'){_0xca21c7=this[_0xb1d2('0x7')][_0x1d06b7][_0xd2fa60]['target'];logger[_0xb1d2('0x10')]('default',_0x48a2e4[_0x21942e],this['edges'][_0x1d06b7][_0xd2fa60]['target']);}else if(this[_0xb1d2('0x6')][_0x1d06b7]['agicommand']===_0xb1d2('0x3')&&_0x48a2e4[_0x21942e]==='i'){_0xca21c7=this['edges'][_0x1d06b7][_0xd2fa60][_0xb1d2('0x17')];logger[_0xb1d2('0x10')](_0xb1d2('0x18'),_0x48a2e4[_0x21942e],this[_0xb1d2('0x7')][_0x1d06b7][_0xd2fa60][_0xb1d2('0x17')]);}if(_0x48a2e4[_0x21942e]===_0x147329){return this[_0xb1d2('0xe')](this['edges'][_0x1d06b7][_0xd2fa60]['target'],_0x30f58e);}}}else{return this[_0xb1d2('0xe')](this[_0xb1d2('0x7')][_0x1d06b7][_0xd2fa60][_0xb1d2('0x17')],_0x30f58e);}}if(_0x48a2e4[_0xb1d2('0x11')]){if(this[_0xb1d2('0x6')][_0x1d06b7][_0xb1d2('0x15')]===_0xb1d2('0x16')){if(_0xca21c7){return this[_0xb1d2('0xe')](_0xca21c7,_0x30f58e);}return logger[_0xb1d2('0x10')](_0xb1d2('0x19'));}else if(_['includes'](verticesWithRetry,this['vertices'][_0x1d06b7][_0xb1d2('0x15')])){if(_0x147329==='-'){return logger[_0xb1d2('0x10')]('max\x20retry\x20reach');}if(_0xca21c7&&_0x147329!=='t'){return this[_0xb1d2('0xe')](_0xca21c7,_0x30f58e);}return this[_0xb1d2('0xe')](_0x1d06b7,_0x30f58e);}return logger[_0xb1d2('0x10')](_0xb1d2('0x1a'));}};module[_0xb1d2('0x1b')]=Graph;
\ No newline at end of file
index cec5b6e..984c796 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf268=['moment','../../config/logger','../../config/license/util','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','agi','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','maxRetry','retry','addVertex','omit','length','source','addEdge','target','value','then','catch','createSquareReport','indexOf','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','finally','isUndefined','toString','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','connection','xml2json','syncho'];(function(_0x1a9860,_0x2e43fd){var _0x13c9d4=function(_0xb69550){while(--_0xb69550){_0x1a9860['push'](_0x1a9860['shift']());}};_0x13c9d4(++_0x2e43fd);}(_0xf268,0xa6));var _0x8f26=function(_0x560286,_0x17d496){_0x560286=_0x560286-0x0;var _0x1418aa=_0xf268[_0x560286];return _0x1418aa;};'use strict';var parser=require(_0x8f26('0x0'));var _=require('lodash');var syncho=require(_0x8f26('0x1'));var util=require('util');var moment=require(_0x8f26('0x2'));var config=require('../../config/environment');var logger=require(_0x8f26('0x3'))('agi');var utilLicense=require(_0x8f26('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x8f26('0x5'));var Graph=require(_0x8f26('0x6'));var Vertices=require(_0x8f26('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x8f26('0x8')](config['agi'],{'ip':_0x8f26('0x9'),'port':0x11dd});function connectionHandler(_0x35181d){process[_0x8f26('0xa')](function(){syncho(function(){try{setChannelVariables(_0x35181d);agiHandler(_0x35181d);}catch(_0x1f9555){logger[_0x8f26('0xb')](_0x1f9555[_0x8f26('0xc')]);}});});}function listeningHandler(){console[_0x8f26('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x8f26('0xe')][_0x8f26('0xf')]);logger['info'](util[_0x8f26('0x10')](_0x8f26('0x11'),config['agi']['ip'],config[_0x8f26('0xe')][_0x8f26('0xf')]));}function errorHandler(_0x4b17ae){if(_0x4b17ae&&_0x4b17ae[_0x8f26('0x12')]&&_0x4b17ae[_0x8f26('0x13')]){logger[_0x8f26('0xb')](util[_0x8f26('0x10')](_0x8f26('0x14'),_0x4b17ae[_0x8f26('0x12')],_0x4b17ae[_0x8f26('0x13')]));}else{logger[_0x8f26('0xb')](util[_0x8f26('0x10')]('[ERROR]\x20%s',_0x4b17ae[_0x8f26('0xc')]));}}function closeHandler(){logger[_0x8f26('0x15')](util[_0x8f26('0x10')](_0x8f26('0x16'),this[_0x8f26('0x17')],this[_0x8f26('0x18')],this[_0x8f26('0x19')],this[_0x8f26('0x1a')],this[_0x8f26('0x1b')]));try{createSquareReport(this);}catch(_0x45e9f8){logger[_0x8f26('0xb')](_0x45e9f8['stack']);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x8f26('0x18')],this[_0x8f26('0x19')],this[_0x8f26('0x1a')],this[_0x8f26('0x1b')]));}function hangupHandler(){logger[_0x8f26('0x15')](util[_0x8f26('0x10')](_0x8f26('0x1c'),this['arg_1'],this[_0x8f26('0x18')],this['callerid'],this[_0x8f26('0x1a')],this[_0x8f26('0x1b')]));this[_0x8f26('0x1d')]=!![];}function getRoot(_0x4bf66a){return parser[_0x8f26('0x1e')](_0x4bf66a,{'object':!![]})[_0x8f26('0x1f')][_0x8f26('0x20')];}function addVertex(_0x5551e6,_0x344fe7,_0x234f7e){_0x344fe7['agicommand']=_0x234f7e;if(_0x344fe7[_0x8f26('0x21')]('retry')){_0x344fe7[_0x8f26('0x22')]=parseInt(_0x344fe7[_0x8f26('0x23')],0xa);}_0x5551e6[_0x8f26('0x24')](_[_0x8f26('0x25')](_0x344fe7,'mxCell'));}function initGraph(_0x4f9e46,_0x125a04){var _0x1bffff=new Graph();for(var _0x39e636 in _0x4f9e46){if(_0x4f9e46[_0x8f26('0x21')](_0x39e636)){if(_['isArray'](_0x4f9e46[_0x39e636])){for(var _0x375234=0x0;_0x375234<_0x4f9e46[_0x39e636][_0x8f26('0x26')];_0x375234+=0x1){addVertex(_0x1bffff,_0x4f9e46[_0x39e636][_0x375234],_0x39e636);}}else{addVertex(_0x1bffff,_0x4f9e46[_0x39e636],_0x39e636);}}}for(var _0x5f087d=0x0;_0x5f087d<_0x125a04[_0x8f26('0x26')];_0x5f087d+=0x1){if(_0x125a04[_0x5f087d][_0x8f26('0x27')]&&_0x125a04[_0x5f087d]['target']){_0x1bffff[_0x8f26('0x28')](_0x125a04[_0x5f087d][_0x8f26('0x27')],_0x125a04[_0x5f087d][_0x8f26('0x29')],_0x125a04[_0x5f087d][_0x8f26('0x2a')]);}}return _0x1bffff;}function getSquareProject(_0x4b4140,_0x2ec187){rpc['getSquareProject'](_0x4b4140)[_0x8f26('0x2b')](function(_0x3b34eb){_0x2ec187(null,_0x3b34eb);})[_0x8f26('0x2c')](function(_0x19a1d0){_0x2ec187(null,_0x19a1d0);});}function createSquareReport(_0x31e0dd,_0x60bd88){rpc[_0x8f26('0x2d')](_0x31e0dd)[_0x8f26('0x2b')](function(_0x4478f1){if(_0x60bd88){_0x60bd88(null,_0x4478f1);}})[_0x8f26('0x2c')](function(_0x3d8b71){if(_0x60bd88){_0x60bd88(null,_0x3d8b71);}});}function setChannelVariables(_0x157f02){for(var _0x457347 in _0x157f02){if(_0x157f02[_0x8f26('0x21')](_0x457347)){if(_0x457347[_0x8f26('0x2e')](_0x8f26('0x2f'))===0x0){_0x157f02[_0x457347['substring'](0x4)]=_0x157f02[_0x457347];delete _0x157f02[_0x457347];}}}}function getLogFromObject(_0x1dfcc7){return util[_0x8f26('0x30')](_0x1dfcc7,{'showHidden':![],'depth':null});}function agiHandler(_0x2ae0c2){var _0x5cdeca,_0x28be47,_0x2f30e1,_0x57d3b0,_0x39ad01;logger[_0x8f26('0x31')](_0x8f26('0x32'),JSON[_0x8f26('0x33')](_0x2ae0c2,null,0x2));logger[_0x8f26('0x15')](util[_0x8f26('0x10')](_0x8f26('0x34'),_0x2ae0c2[_0x8f26('0x17')],_0x2ae0c2['calleridname'],_0x2ae0c2[_0x8f26('0x19')],_0x2ae0c2[_0x8f26('0x1a')],_0x2ae0c2['uniqueid']));_0x2ae0c2['on'](_0x8f26('0xb'),errorHandler);_0x2ae0c2['on'](_0x8f26('0x35'),closeHandler);_0x2ae0c2['on'](_0x8f26('0x36'),timeoutHandler);_0x2ae0c2['evtHangup']=![];_0x2ae0c2['on'](_0x8f26('0x37'),hangupHandler);var _0x205ffe=getSquareProject[_0x8f26('0x38')](null,_0x2ae0c2[_0x8f26('0x17')]);if(_0x205ffe){if(_0x205ffe[_0x8f26('0x39')]){_0x5cdeca=getRoot(_0x205ffe['production']);if(_0x5cdeca&&_0x5cdeca[_0x8f26('0x3a')]){logger['debug'](_0x8f26('0x20'),JSON['stringify'](_0x5cdeca,null,0x2));_0x2ae0c2['joinAt']=moment()['format'](_0x8f26('0x3b'));_0x28be47=initGraph(_['omit'](_0x5cdeca,_0x8f26('0x3c')),_0x5cdeca['mxCell']);_0x2f30e1=new Vertices(_0x2ae0c2,rpc,mailRpc);logger[_0x8f26('0x15')](util[_0x8f26('0x10')](_0x8f26('0x3d'),_0x2ae0c2[_0x8f26('0x17')],_0x2ae0c2[_0x8f26('0x18')],_0x2ae0c2['callerid'],_0x2ae0c2['dnid'],_0x2ae0c2['uniqueid']));_0x28be47[_0x8f26('0x3e')](_0x5cdeca[_0x8f26('0x3a')]['id'],function(_0x2b93e5){try{_0x2b93e5=_0x2f30e1['clear'](_0x2b93e5);logger[_0x8f26('0x31')](_0x8f26('0x3f'),JSON['stringify'](_0x2b93e5,null,0x2));if(_0x2b93e5[_0x8f26('0x40')]===_0x8f26('0x41')){logger[_0x8f26('0x15')](_0x8f26('0x42'));_0x2ae0c2['context']=_0x2b93e5[_0x8f26('0x43')]||_0x2ae0c2[_0x8f26('0x43')];_0x2ae0c2[_0x8f26('0x44')]=_0x2b93e5[_0x8f26('0x44')];_0x2ae0c2[_0x8f26('0x45')]=_0x2b93e5[_0x8f26('0x45')]?_0x2b93e5[_0x8f26('0x45')]-0x1:0x1;return null;}else if(_0x2b93e5&&_0x2f30e1[_0x2b93e5[_0x8f26('0x40')]]){_0x39ad01=_0x2f30e1[_0x2b93e5[_0x8f26('0x40')]](_0x2b93e5);logger[_0x8f26('0x15')](_0x8f26('0x46'),JSON['stringify'](_0x39ad01,null,0x2));if(_0x39ad01&&_0x39ad01['code']===AGI_CODE_SUCCESS&&_0x39ad01[_0x8f26('0x47')]!==AGI_RESULT_ERROR&&!_0x2ae0c2[_0x8f26('0x1d')]){logger[_0x8f26('0x31')](_0x8f26('0x46'),getLogFromObject(_0x39ad01));return _['isUndefined'](_0x39ad01[_0x8f26('0x47')])?null:_0x39ad01[_0x8f26('0x47')]['toString']();}else{logger[_0x8f26('0xb')](_0x8f26('0x46'),getLogFromObject(_0x39ad01));return null;}}else{logger[_0x8f26('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x1dd433){logger['error'](_0x1dd433['stack']);return null;}});if(_0x5cdeca[_0x8f26('0x48')]){logger[_0x8f26('0x15')](util[_0x8f26('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2ae0c2[_0x8f26('0x17')],_0x2ae0c2[_0x8f26('0x18')],_0x2ae0c2['callerid'],_0x2ae0c2[_0x8f26('0x1a')],_0x2ae0c2[_0x8f26('0x1b')]));_0x28be47[_0x8f26('0x3e')](_0x5cdeca[_0x8f26('0x48')]['id'],function(_0x545bab){try{_0x545bab=_0x2f30e1['clear'](_0x545bab);logger[_0x8f26('0x31')](_0x8f26('0x3f'),JSON[_0x8f26('0x33')](_0x545bab,null,0x2));if(_0x545bab&&_0x2f30e1[_0x545bab[_0x8f26('0x40')]]){_0x39ad01=_0x2f30e1[_0x545bab[_0x8f26('0x40')]](_0x545bab);if(_0x39ad01){logger[_0x8f26('0x31')](_0x8f26('0x46'),getLogFromObject(_0x39ad01));return _[_0x8f26('0x49')](_0x39ad01['result'])?null:_0x39ad01[_0x8f26('0x47')][_0x8f26('0x4a')]();}else{logger['error'](_0x8f26('0x46'),getLogFromObject(_0x39ad01));return null;}}else{logger[_0x8f26('0xb')](_0x8f26('0x4b'));return null;}}catch(_0x42b9cb){logger[_0x8f26('0xb')](_0x42b9cb[_0x8f26('0xc')]);return null;}});}logger['info'](util['format'](_0x8f26('0x4c'),_0x2ae0c2['arg_1'],_0x2ae0c2[_0x8f26('0x18')],_0x2ae0c2[_0x8f26('0x19')],_0x2ae0c2[_0x8f26('0x1a')],_0x2ae0c2[_0x8f26('0x1b')]));logger[_0x8f26('0x15')](util['format'](_0x8f26('0x4d'),_0x2ae0c2[_0x8f26('0x43')],_0x2ae0c2[_0x8f26('0x44')],parseInt(_0x2ae0c2[_0x8f26('0x45')],0xa)+0x1));_0x2ae0c2['continueAt'](_0x2ae0c2[_0x8f26('0x43')],_0x2ae0c2[_0x8f26('0x44')],parseInt(_0x2ae0c2['priority'],0xa)+0x1);_0x2ae0c2[_0x8f26('0x35')]();}}else{logger[_0x8f26('0xb')](util[_0x8f26('0x10')]('Project\x20%s\x20not\x20published',_0x2ae0c2[_0x8f26('0x17')]));_0x2ae0c2[_0x8f26('0x4e')](_0x2ae0c2[_0x8f26('0x43')],_0x2ae0c2[_0x8f26('0x44')],parseInt(_0x2ae0c2[_0x8f26('0x45')],0xa)+0x1);_0x2ae0c2[_0x8f26('0x35')]();}}else{logger[_0x8f26('0xb')](util[_0x8f26('0x10')](_0x8f26('0x4f'),_0x2ae0c2[_0x8f26('0x17')]));_0x2ae0c2['continueAt'](_0x2ae0c2['context'],_0x2ae0c2[_0x8f26('0x44')],parseInt(_0x2ae0c2[_0x8f26('0x45')],0xa)+0x1);_0x2ae0c2[_0x8f26('0x35')]();}}function main(){var _0x9a15a2;return utilLicense[_0x8f26('0x50')]()['then'](function(_0x34dcbc){if(_0x34dcbc){if(_0x34dcbc['voice']){if(_0x34dcbc['callysquare']&&_0x34dcbc[_0x8f26('0x51')]>0x0){logger[_0x8f26('0x15')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x34dcbc[_0x8f26('0x51')]));_0x9a15a2=_0x34dcbc['callysquare'];}else{logger[_0x8f26('0x15')](_0x8f26('0x52'));}}else{logger[_0x8f26('0x15')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x9a15a2=-0x1;}}})[_0x8f26('0x2c')](function(_0x3e868){logger[_0x8f26('0xb')]('[LICENSE]',_0x3e868['stack']);})[_0x8f26('0x48')](function(){var _0x1a5ec4=require('./server')(config['agi'][_0x8f26('0xf')],config['agi']['ip'],_0x9a15a2);_0x1a5ec4['on'](_0x8f26('0xb'),errorHandler);_0x1a5ec4['on']('listening',listeningHandler);_0x1a5ec4['on'](_0x8f26('0x53'),connectionHandler);_0x1a5ec4['on'](_0x8f26('0x35'),closeHandler);});}main();
\ No newline at end of file
+var _0xacba=['mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','catch','createSquareReport','then','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','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','clear','continueAt','Project\x20%s\x20not\x20published','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection','xml2json','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','error','message','[ERROR]\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson'];(function(_0x2c760e,_0x3ec654){var _0x167283=function(_0x2e3cb7){while(--_0x2e3cb7){_0x2c760e['push'](_0x2c760e['shift']());}};_0x167283(++_0x3ec654);}(_0xacba,0x1ab));var _0xaacb=function(_0x3160af,_0x484932){_0x3160af=_0x3160af-0x0;var _0x407748=_0xacba[_0x3160af];return _0x407748;};'use strict';var parser=require(_0xaacb('0x0'));var _=require(_0xaacb('0x1'));var syncho=require(_0xaacb('0x2'));var util=require(_0xaacb('0x3'));var moment=require('moment');var config=require(_0xaacb('0x4'));var logger=require(_0xaacb('0x5'))(_0xaacb('0x6'));var utilLicense=require(_0xaacb('0x7'));var rpc=require(_0xaacb('0x8'));var mailRpc=require(_0xaacb('0x9'));var Graph=require(_0xaacb('0xa'));var Vertices=require(_0xaacb('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xaacb('0x6')]=_[_0xaacb('0xc')](config[_0xaacb('0x6')],{'ip':_0xaacb('0xd'),'port':0x11dd});function connectionHandler(_0x3881fa){process[_0xaacb('0xe')](function(){syncho(function(){try{setChannelVariables(_0x3881fa);agiHandler(_0x3881fa);}catch(_0xc28160){logger['error'](_0xc28160[_0xaacb('0xf')]);}});});}function listeningHandler(){console['log'](_0xaacb('0x10'),config[_0xaacb('0x6')]['port']);logger[_0xaacb('0x11')](util[_0xaacb('0x12')](_0xaacb('0x13'),config[_0xaacb('0x6')]['ip'],config['agi']['port']));}function errorHandler(_0x3418df){if(_0x3418df&&_0x3418df[_0xaacb('0x14')]&&_0x3418df['message']){logger[_0xaacb('0x15')](util[_0xaacb('0x12')]('[%s]\x20%s',_0x3418df[_0xaacb('0x14')],_0x3418df[_0xaacb('0x16')]));}else{logger[_0xaacb('0x15')](util[_0xaacb('0x12')](_0xaacb('0x17'),_0x3418df[_0xaacb('0xf')]));}}function closeHandler(){logger[_0xaacb('0x11')](util[_0xaacb('0x12')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xaacb('0x18')],this['calleridname'],this[_0xaacb('0x19')],this[_0xaacb('0x1a')],this[_0xaacb('0x1b')]));try{createSquareReport(this);}catch(_0x157b07){logger[_0xaacb('0x15')](_0x157b07[_0xaacb('0xf')]);}}function timeoutHandler(){logger[_0xaacb('0x11')](util[_0xaacb('0x12')](_0xaacb('0x1c'),this[_0xaacb('0x18')],this[_0xaacb('0x1d')],this[_0xaacb('0x19')],this[_0xaacb('0x1a')],this[_0xaacb('0x1b')]));}function hangupHandler(){logger['info'](util[_0xaacb('0x12')](_0xaacb('0x1e'),this[_0xaacb('0x18')],this[_0xaacb('0x1d')],this[_0xaacb('0x19')],this[_0xaacb('0x1a')],this[_0xaacb('0x1b')]));this[_0xaacb('0x1f')]=!![];}function getRoot(_0x1cc673){return parser[_0xaacb('0x20')](_0x1cc673,{'object':!![]})[_0xaacb('0x21')][_0xaacb('0x22')];}function addVertex(_0x10742b,_0x4e085e,_0xf6b42c){_0x4e085e[_0xaacb('0x23')]=_0xf6b42c;if(_0x4e085e[_0xaacb('0x24')](_0xaacb('0x25'))){_0x4e085e[_0xaacb('0x26')]=parseInt(_0x4e085e['retry'],0xa);}_0x10742b[_0xaacb('0x27')](_[_0xaacb('0x28')](_0x4e085e,_0xaacb('0x29')));}function initGraph(_0xdf1c21,_0x484463){var _0x3bcace=new Graph();for(var _0x597c54 in _0xdf1c21){if(_0xdf1c21['hasOwnProperty'](_0x597c54)){if(_[_0xaacb('0x2a')](_0xdf1c21[_0x597c54])){for(var _0x1df8d7=0x0;_0x1df8d7<_0xdf1c21[_0x597c54][_0xaacb('0x2b')];_0x1df8d7+=0x1){addVertex(_0x3bcace,_0xdf1c21[_0x597c54][_0x1df8d7],_0x597c54);}}else{addVertex(_0x3bcace,_0xdf1c21[_0x597c54],_0x597c54);}}}for(var _0x3250ab=0x0;_0x3250ab<_0x484463[_0xaacb('0x2b')];_0x3250ab+=0x1){if(_0x484463[_0x3250ab]['source']&&_0x484463[_0x3250ab][_0xaacb('0x2c')]){_0x3bcace[_0xaacb('0x2d')](_0x484463[_0x3250ab][_0xaacb('0x2e')],_0x484463[_0x3250ab]['target'],_0x484463[_0x3250ab][_0xaacb('0x2f')]);}}return _0x3bcace;}function getSquareProject(_0x71626b,_0x3e614f){rpc[_0xaacb('0x30')](_0x71626b)['then'](function(_0x5c85dc){_0x3e614f(null,_0x5c85dc);})[_0xaacb('0x31')](function(_0x25caa9){_0x3e614f(null,_0x25caa9);});}function createSquareReport(_0x238d38,_0x2fec10){rpc[_0xaacb('0x32')](_0x238d38)[_0xaacb('0x33')](function(_0x11a960){if(_0x2fec10){_0x2fec10(null,_0x11a960);}})['catch'](function(_0x4b57a1){if(_0x2fec10){_0x2fec10(null,_0x4b57a1);}});}function setChannelVariables(_0x3fc514){for(var _0x2df2ce in _0x3fc514){if(_0x3fc514[_0xaacb('0x24')](_0x2df2ce)){if(_0x2df2ce['indexOf']('agi_')===0x0){_0x3fc514[_0x2df2ce['substring'](0x4)]=_0x3fc514[_0x2df2ce];delete _0x3fc514[_0x2df2ce];}}}}function getLogFromObject(_0x5b4e59){return util['inspect'](_0x5b4e59,{'showHidden':![],'depth':null});}function agiHandler(_0x3c22a4){var _0x54dd03,_0x5dbd68,_0x204b0e,_0x3688ac,_0x41fa10;logger[_0xaacb('0x34')](_0xaacb('0x35'),JSON[_0xaacb('0x36')](_0x3c22a4,null,0x2));logger['info'](util[_0xaacb('0x12')](_0xaacb('0x37'),_0x3c22a4['arg_1'],_0x3c22a4[_0xaacb('0x1d')],_0x3c22a4['callerid'],_0x3c22a4[_0xaacb('0x1a')],_0x3c22a4['uniqueid']));_0x3c22a4['on']('error',errorHandler);_0x3c22a4['on'](_0xaacb('0x38'),closeHandler);_0x3c22a4['on'](_0xaacb('0x39'),timeoutHandler);_0x3c22a4['evtHangup']=![];_0x3c22a4['on'](_0xaacb('0x3a'),hangupHandler);var _0x2c6f76=getSquareProject[_0xaacb('0x3b')](null,_0x3c22a4[_0xaacb('0x18')]);if(_0x2c6f76){if(_0x2c6f76['production']){_0x54dd03=getRoot(_0x2c6f76[_0xaacb('0x3c')]);if(_0x54dd03&&_0x54dd03['start']){logger[_0xaacb('0x34')]('root',JSON[_0xaacb('0x36')](_0x54dd03,null,0x2));_0x3c22a4[_0xaacb('0x3d')]=moment()[_0xaacb('0x12')](_0xaacb('0x3e'));_0x5dbd68=initGraph(_['omit'](_0x54dd03,'mxCell'),_0x54dd03[_0xaacb('0x29')]);_0x204b0e=new Vertices(_0x3c22a4,rpc,mailRpc);logger[_0xaacb('0x11')](util[_0xaacb('0x12')](_0xaacb('0x3f'),_0x3c22a4[_0xaacb('0x18')],_0x3c22a4[_0xaacb('0x1d')],_0x3c22a4['callerid'],_0x3c22a4['dnid'],_0x3c22a4[_0xaacb('0x1b')]));_0x5dbd68[_0xaacb('0x40')](_0x54dd03[_0xaacb('0x41')]['id'],function(_0x389baf){try{_0x389baf=_0x204b0e['clear'](_0x389baf);logger[_0xaacb('0x34')](_0xaacb('0x42'),JSON[_0xaacb('0x36')](_0x389baf,null,0x2));if(_0x389baf[_0xaacb('0x23')]==='gotoc'){logger[_0xaacb('0x11')](_0xaacb('0x43'));_0x3c22a4['context']=_0x389baf[_0xaacb('0x44')]||_0x3c22a4[_0xaacb('0x44')];_0x3c22a4[_0xaacb('0x45')]=_0x389baf[_0xaacb('0x45')];_0x3c22a4[_0xaacb('0x46')]=_0x389baf['priority']?_0x389baf[_0xaacb('0x46')]-0x1:0x1;return null;}else if(_0x389baf&&_0x204b0e[_0x389baf[_0xaacb('0x23')]]){_0x41fa10=_0x204b0e[_0x389baf[_0xaacb('0x23')]](_0x389baf);logger[_0xaacb('0x11')](_0xaacb('0x47'),JSON[_0xaacb('0x36')](_0x41fa10,null,0x2));if(_0x41fa10&&_0x41fa10['code']===AGI_CODE_SUCCESS&&_0x41fa10['result']!==AGI_RESULT_ERROR&&!_0x3c22a4[_0xaacb('0x1f')]){logger[_0xaacb('0x34')](_0xaacb('0x47'),getLogFromObject(_0x41fa10));return _[_0xaacb('0x48')](_0x41fa10['result'])?null:_0x41fa10[_0xaacb('0x49')][_0xaacb('0x4a')]();}else{logger[_0xaacb('0x15')]('response',getLogFromObject(_0x41fa10));return null;}}else{logger[_0xaacb('0x15')](_0xaacb('0x4b'));return null;}}catch(_0x5375f6){logger[_0xaacb('0x15')](_0x5375f6[_0xaacb('0xf')]);return null;}});if(_0x54dd03[_0xaacb('0x4c')]){logger[_0xaacb('0x11')](util[_0xaacb('0x12')](_0xaacb('0x4d'),_0x3c22a4[_0xaacb('0x18')],_0x3c22a4[_0xaacb('0x1d')],_0x3c22a4[_0xaacb('0x19')],_0x3c22a4[_0xaacb('0x1a')],_0x3c22a4[_0xaacb('0x1b')]));_0x5dbd68['traverseBFS'](_0x54dd03[_0xaacb('0x4c')]['id'],function(_0x336fd3){try{_0x336fd3=_0x204b0e[_0xaacb('0x4e')](_0x336fd3);logger['debug'](_0xaacb('0x42'),JSON[_0xaacb('0x36')](_0x336fd3,null,0x2));if(_0x336fd3&&_0x204b0e[_0x336fd3[_0xaacb('0x23')]]){_0x41fa10=_0x204b0e[_0x336fd3['agicommand']](_0x336fd3);if(_0x41fa10){logger[_0xaacb('0x34')](_0xaacb('0x47'),getLogFromObject(_0x41fa10));return _[_0xaacb('0x48')](_0x41fa10['result'])?null:_0x41fa10[_0xaacb('0x49')]['toString']();}else{logger[_0xaacb('0x15')](_0xaacb('0x47'),getLogFromObject(_0x41fa10));return null;}}else{logger[_0xaacb('0x15')](_0xaacb('0x4b'));return null;}}catch(_0x206fa1){logger[_0xaacb('0x15')](_0x206fa1[_0xaacb('0xf')]);return null;}});}logger[_0xaacb('0x11')](util[_0xaacb('0x12')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3c22a4[_0xaacb('0x18')],_0x3c22a4[_0xaacb('0x1d')],_0x3c22a4[_0xaacb('0x19')],_0x3c22a4[_0xaacb('0x1a')],_0x3c22a4[_0xaacb('0x1b')]));logger[_0xaacb('0x11')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3c22a4[_0xaacb('0x44')],_0x3c22a4[_0xaacb('0x45')],parseInt(_0x3c22a4[_0xaacb('0x46')],0xa)+0x1));_0x3c22a4[_0xaacb('0x4f')](_0x3c22a4[_0xaacb('0x44')],_0x3c22a4[_0xaacb('0x45')],parseInt(_0x3c22a4['priority'],0xa)+0x1);_0x3c22a4[_0xaacb('0x38')]();}}else{logger['error'](util[_0xaacb('0x12')](_0xaacb('0x50'),_0x3c22a4[_0xaacb('0x18')]));_0x3c22a4[_0xaacb('0x4f')](_0x3c22a4[_0xaacb('0x44')],_0x3c22a4[_0xaacb('0x45')],parseInt(_0x3c22a4[_0xaacb('0x46')],0xa)+0x1);_0x3c22a4['close']();}}else{logger[_0xaacb('0x15')](util[_0xaacb('0x12')]('Project\x20%s\x20not\x20found',_0x3c22a4[_0xaacb('0x18')]));_0x3c22a4[_0xaacb('0x4f')](_0x3c22a4[_0xaacb('0x44')],_0x3c22a4[_0xaacb('0x45')],parseInt(_0x3c22a4[_0xaacb('0x46')],0xa)+0x1);_0x3c22a4[_0xaacb('0x38')]();}}function main(){var _0x133ac5;return utilLicense[_0xaacb('0x51')]()['then'](function(_0xb3edbd){if(_0xb3edbd){if(_0xb3edbd[_0xaacb('0x52')]){if(_0xb3edbd['callysquare']&&_0xb3edbd['callysquare']>0x0){logger[_0xaacb('0x11')](util['format'](_0xaacb('0x53'),_0xb3edbd[_0xaacb('0x54')]));_0x133ac5=_0xb3edbd['callysquare'];}else{logger['info'](_0xaacb('0x55'));}}else{logger[_0xaacb('0x11')](_0xaacb('0x56'));_0x133ac5=-0x1;}}})[_0xaacb('0x31')](function(_0x2ad7e5){logger['error'](_0xaacb('0x57'),_0x2ad7e5[_0xaacb('0xf')]);})[_0xaacb('0x4c')](function(){var _0x481590=require(_0xaacb('0x58'))(config[_0xaacb('0x6')][_0xaacb('0x59')],config['agi']['ip'],_0x133ac5);_0x481590['on'](_0xaacb('0x15'),errorHandler);_0x481590['on'](_0xaacb('0x5a'),listeningHandler);_0x481590['on'](_0xaacb('0x5b'),connectionHandler);_0x481590['on'](_0xaacb('0x38'),closeHandler);});}main();
\ No newline at end of file
index 6ccf81b..83f0909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd194=['SendMail','client','http','request','then','error','message','result'];(function(_0x493985,_0xabbee5){var _0x532b94=function(_0x150fbc){while(--_0x150fbc){_0x493985['push'](_0x493985['shift']());}};_0x532b94(++_0xabbee5);}(_0xd194,0x89));var _0x4d19=function(_0x52d7ea,_0x19dd7b){_0x52d7ea=_0x52d7ea-0x0;var _0xeb8b16=_0xd194[_0x52d7ea];return _0xeb8b16;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x4d19('0x0')][_0x4d19('0x1')]({'port':0x232b});function request(_0x117e0f,_0x43aa8f){return new BPromise(function(_0x24ea41,_0x214fe4){return client[_0x4d19('0x2')](_0x117e0f,_0x43aa8f)[_0x4d19('0x3')](function(_0x5783f5){if(_0x5783f5[_0x4d19('0x4')]){return _0x214fe4(_0x5783f5[_0x4d19('0x4')][_0x4d19('0x5')]);}else{return _0x24ea41(_0x5783f5[_0x4d19('0x6')]);}})['catch'](function(_0x4e8caa){return _0x214fe4(_0x4e8caa);});});}exports['sendMailMessage']=function(_0xd8c277,_0x271e46){return request(_0x4d19('0x7'),{'account':_0xd8c277,'message':_0x271e46});};
\ No newline at end of file
+var _0x4f05=['message','catch','SendMail','jayson/promise','client','http','error'];(function(_0x2fc6cf,_0x2bb133){var _0xf2ade3=function(_0x522b04){while(--_0x522b04){_0x2fc6cf['push'](_0x2fc6cf['shift']());}};_0xf2ade3(++_0x2bb133);}(_0x4f05,0x1b5));var _0x54f0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4f05[_0x465a0c];return _0x1e202e;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x54f0('0x0'));var client=jayson[_0x54f0('0x1')][_0x54f0('0x2')]({'port':0x232b});function request(_0x343c29,_0xb5ef6){return new BPromise(function(_0x1942be,_0x38129d){return client['request'](_0x343c29,_0xb5ef6)['then'](function(_0x4f8e09){if(_0x4f8e09[_0x54f0('0x3')]){return _0x38129d(_0x4f8e09[_0x54f0('0x3')][_0x54f0('0x4')]);}else{return _0x1942be(_0x4f8e09['result']);}})[_0x54f0('0x5')](function(_0x1828c7){return _0x38129d(_0x1828c7);});});}exports['sendMailMessage']=function(_0x2460f7,_0x325b3b){return request(_0x54f0('0x6'),{'account':_0x2460f7,'message':_0x325b3b});};
\ No newline at end of file
index 578c98c..9842161 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80db=['toString','indexOf','substring','split','slice','trim','length','emit','_localBuffer','line','exports','util','stream','call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0x22a498,_0x5da540){var _0x373076=function(_0x40d536){while(--_0x40d536){_0x22a498['push'](_0x22a498['shift']());}};_0x373076(++_0x5da540);}(_0x80db,0x174));var _0xb80d=function(_0x3dfbe4,_0x3e7652){_0x3dfbe4=_0x3dfbe4-0x0;var _0x561731=_0x80db[_0x3dfbe4];return _0x561731;};'use strict';var util=require(_0xb80d('0x0'));var Transform=require(_0xb80d('0x1'))['Transform'];function AGIReply(_0x143be6){Transform[_0xb80d('0x2')](this,_0x143be6);this['_localBuffer']='';this[_0xb80d('0x3')]=![];}util[_0xb80d('0x4')](AGIReply,Transform);AGIReply[_0xb80d('0x5')][_0xb80d('0x6')]=function(_0x4323f3,_0x6755e9,_0x44e212){var _0x2ad3df='\x0a',_0x40bd8a=['\x0a\x0a',_0xb80d('0x7')],_0x50bb0d=-0x1,_0x6d08f8=-0x1,_0x26a38a='',_0x189662=0x0,_0x1483f7='',_0x170ff7='';this['_localBuffer']+=_0x4323f3[_0xb80d('0x8')]();_0x1483f7=this['_localBuffer'];if(!this[_0xb80d('0x3')]){_0x189662=0x0;while(_0x40bd8a[_0x189662]){while((_0x6d08f8=_0x1483f7[_0xb80d('0x9')](_0x40bd8a[_0x189662]))!=-0x1){_0x26a38a=_0x40bd8a[_0x189662];_0x170ff7=_0x1483f7[_0xb80d('0xa')](0x0,_0x6d08f8);_0x1483f7=_0x1483f7[_0xb80d('0xa')](_0x6d08f8+_0x26a38a['length']);var _0xa05d5a=_0x170ff7[_0xb80d('0xb')](_0x2ad3df),_0xb96722=0x0,_0x35408b={},_0x5a24ad='',_0x55852a='',_0x17c38a=-0x1;while(_0xa05d5a[_0xb96722]){_0x17c38a=_0xa05d5a[_0xb96722][_0xb80d('0x9')](':');if(_0x17c38a!=-0x1){_0x5a24ad=_0xa05d5a[_0xb96722][_0xb80d('0xc')](0x0,_0x17c38a)[_0xb80d('0xd')]();_0x55852a=_0xa05d5a[_0xb96722][_0xb80d('0xc')](_0x17c38a+0x1)['trim']();if(_0x5a24ad[_0xb80d('0xe')]>0x0){_0x35408b[_0x5a24ad]=_0x55852a;}}else{}_0xb96722++;}this[_0xb80d('0xf')]('headers',_0x35408b);this[_0xb80d('0x3')]=!![];}_0x189662++;}this[_0xb80d('0x10')]=_0x1483f7;}else{while((_0x50bb0d=_0x1483f7[_0xb80d('0x9')](_0x2ad3df))!=-0x1){_0x170ff7=_0x1483f7[_0xb80d('0xa')](0x0,_0x50bb0d);this[_0xb80d('0xf')](_0xb80d('0x11'),_0x170ff7);_0x1483f7=_0x1483f7[_0xb80d('0xa')](_0x50bb0d+_0x2ad3df['length']);}this['_localBuffer']=_0x1483f7;}_0x44e212();};module[_0xb80d('0x12')]=AGIReply;
\ No newline at end of file
+var _0x6de8=['length','split','slice','trim','emit','line','exports','util','Transform','call','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','_inBody','indexOf','substring'];(function(_0x2383c3,_0x4fd9de){var _0x2cadbc=function(_0x2d0810){while(--_0x2d0810){_0x2383c3['push'](_0x2383c3['shift']());}};_0x2cadbc(++_0x4fd9de);}(_0x6de8,0x183));var _0x86de=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x6de8[_0x1d50f2];return _0x3769b8;};'use strict';var util=require(_0x86de('0x0'));var Transform=require('stream')[_0x86de('0x1')];function AGIReply(_0xdc5a38){Transform[_0x86de('0x2')](this,_0xdc5a38);this['_localBuffer']='';this['_inBody']=![];}util[_0x86de('0x3')](AGIReply,Transform);AGIReply[_0x86de('0x4')][_0x86de('0x5')]=function(_0x382ede,_0x13d0dd,_0x3ee3c3){var _0x409bb5='\x0a',_0x1c0b62=['\x0a\x0a',_0x86de('0x6')],_0x4b3fca=-0x1,_0x49abd4=-0x1,_0x2613fd='',_0x6d2331=0x0,_0x15142a='',_0x4e14d6='';this['_localBuffer']+=_0x382ede[_0x86de('0x7')]();_0x15142a=this[_0x86de('0x8')];if(!this[_0x86de('0x9')]){_0x6d2331=0x0;while(_0x1c0b62[_0x6d2331]){while((_0x49abd4=_0x15142a[_0x86de('0xa')](_0x1c0b62[_0x6d2331]))!=-0x1){_0x2613fd=_0x1c0b62[_0x6d2331];_0x4e14d6=_0x15142a[_0x86de('0xb')](0x0,_0x49abd4);_0x15142a=_0x15142a[_0x86de('0xb')](_0x49abd4+_0x2613fd[_0x86de('0xc')]);var _0x3e8d18=_0x4e14d6[_0x86de('0xd')](_0x409bb5),_0x50cbbc=0x0,_0x2d4f57={},_0x17519c='',_0x2cc31a='',_0x5e99ba=-0x1;while(_0x3e8d18[_0x50cbbc]){_0x5e99ba=_0x3e8d18[_0x50cbbc]['indexOf'](':');if(_0x5e99ba!=-0x1){_0x17519c=_0x3e8d18[_0x50cbbc][_0x86de('0xe')](0x0,_0x5e99ba)['trim']();_0x2cc31a=_0x3e8d18[_0x50cbbc]['slice'](_0x5e99ba+0x1)[_0x86de('0xf')]();if(_0x17519c['length']>0x0){_0x2d4f57[_0x17519c]=_0x2cc31a;}}else{}_0x50cbbc++;}this[_0x86de('0x10')]('headers',_0x2d4f57);this['_inBody']=!![];}_0x6d2331++;}this[_0x86de('0x8')]=_0x15142a;}else{while((_0x4b3fca=_0x15142a['indexOf'](_0x409bb5))!=-0x1){_0x4e14d6=_0x15142a['substring'](0x0,_0x4b3fca);this[_0x86de('0x10')](_0x86de('0x11'),_0x4e14d6);_0x15142a=_0x15142a[_0x86de('0xb')](_0x4b3fca+_0x409bb5[_0x86de('0xc')]);}this[_0x86de('0x8')]=_0x15142a;}_0x3ee3c3();};module[_0x86de('0x12')]=AGIReply;
\ No newline at end of file
index 05f08d3..ac8aee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x574a=['CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','util','jayson/promise','http','then','error','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','getIntervalById','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x574a,0x1bb));var _0xa574=function(_0x1deba7,_0x30f270){_0x1deba7=_0x1deba7-0x0;var _0x2dcc31=_0x574a[_0x1deba7];return _0x2dcc31;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xa574('0x0'));var util=require(_0xa574('0x1'));var jayson=require(_0xa574('0x2'));var client=jayson['client'][_0xa574('0x3')]({'port':0x2329});function request(_0x32012c,_0x389312){return new BPromise(function(_0x28b324,_0x1e3ed3){return client['request'](_0x32012c,_0x389312)[_0xa574('0x4')](function(_0x40f44f){if(_0x40f44f[_0xa574('0x5')]){return _0x1e3ed3(_0x40f44f[_0xa574('0x5')]['message']);}else{return _0x28b324(_0x40f44f[_0xa574('0x6')]);}})[_0xa574('0x7')](function(_0x3e739c){return _0x1e3ed3(_0x3e739c);});});}exports[_0xa574('0x8')]=function(_0x39b284){return request(_0xa574('0x9'),{'options':{'raw':![],'where':{'name':_0x39b284},'attributes':['production']}});};exports[_0xa574('0xa')]=function(_0x592dad){return request(_0xa574('0xb'),{'options':{'raw':![],'where':{'id':_0x592dad},'include':[{'model':_0xa574('0xc'),'as':_0xa574('0xd')}],'attributes':['id',_0xa574('0xe'),_0xa574('0xf')]}});};exports[_0xa574('0x10')]=function(_0x2e4b79){return request('ShowSquareProject',{'options':{'where':{'id':_0x2e4b79},'attributes':[_0xa574('0xe')]}});};exports[_0xa574('0x11')]=function(_0x1ef8d2){return request(_0xa574('0x12'),{'options':{'where':{'id':_0x1ef8d2},'attributes':[_0xa574('0xe')]}});};exports[_0xa574('0x13')]=function(_0x13a40f){return request(_0xa574('0x14'),{'options':{'where':{'id':_0x13a40f},'attributes':['name']}});};exports[_0xa574('0x15')]=function(_0x532515){return request(_0xa574('0x16'),{'options':{'where':{'id':_0x532515},'attributes':[_0xa574('0x17')]}});};exports[_0xa574('0x18')]=function(_0x28b766){return request(_0xa574('0x19'),{'options':{'where':{'id':_0x28b766},'attributes':[_0xa574('0xe')]}});};exports[_0xa574('0x1a')]=function(_0x4b7c79){return request('ShowTrunk',{'options':{'where':{'id':_0x4b7c79},'attributes':['name']}});};exports[_0xa574('0x1b')]=function(_0x1fe89b){return request(_0xa574('0x1c'),{'options':{'where':{'id':_0x1fe89b},'attributes':['save_name']}});};exports[_0xa574('0x1d')]=function(_0x2467d3){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2467d3},'include':[{'model':_0xa574('0x1e'),'as':'Intervals'}]}});};exports[_0xa574('0x1f')]=function(_0x3a0ef8){return request(_0xa574('0x20'),{'options':{'where':{'id':_0x3a0ef8},'attributes':['id',_0xa574('0xe')]}});};exports[_0xa574('0x21')]=function(_0x5f2b48){return request('CreateSmsMessage',{'body':_0x5f2b48});};exports[_0xa574('0x22')]=function(_0xa16643){return request(_0xa574('0x23'),{'body':_0xa16643});};exports[_0xa574('0x24')]=function(_0x5e84e4){return request(_0xa574('0x25'),{'body':_[_0xa574('0x26')](_0x5e84e4,{'project_name':_0x5e84e4[_0xa574('0x27')],'prev_project_name':_0x5e84e4['arg_2']||'','is_subproject':_0x5e84e4[_0xa574('0x28')]?!![]:![],'leaveAt':moment()[_0xa574('0x29')](_0xa574('0x2a'))})});};exports[_0xa574('0x2b')]=function(_0x3ce4d2){return request('CreateSquareRecording',{'body':_0x3ce4d2});};exports[_0xa574('0x2c')]=function(_0x3be506){return request(_0xa574('0x2d'),{'body':_0x3be506});};exports[_0xa574('0x2e')]=function(_0x500135){return request(_0xa574('0x2f'),{'options':{'raw':![],'where':{'phone':_0x500135[_0xa574('0x30')],'ListId':_0x500135[_0xa574('0x31')]}}})[_0xa574('0x4')](function(_0x51ecac){if(_0x51ecac){return _0x51ecac;}return request(_0xa574('0x32'),{'body':_0x500135});});};exports[_0xa574('0x33')]=function(_0x4fdf8d){return request(_0xa574('0x34'),{'options':{'where':{'id':_0x4fdf8d},'attributes':['name']}});};exports[_0xa574('0x35')]=function(_0x4c4650,_0xe9a01e){return request(_0xa574('0x36'),{'body':{'interface':_0xe9a01e},'options':{'where':_0x4c4650}});};exports[_0xa574('0x37')]=function(_0x2dbb68,_0x442279,_0x505664){return request(_0xa574('0x38'),{'body':{'type':_0x442279,'uniqueid':_0x505664},'options':{'where':_0x2dbb68}});};exports[_0xa574('0x39')]=function(_0x22c17f){return request(_0xa574('0x3a'),{'body':{},'options':{'where':_0x22c17f}});};exports[_0xa574('0x3b')]=function(_0x5111d9){return request('LogoutUser',{'body':{},'options':{'where':_0x5111d9}});};
\ No newline at end of file
+var _0x9a86=['getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById'];(function(_0x55d01b,_0x369f1b){var _0x366b99=function(_0x5cd2cb){while(--_0x5cd2cb){_0x55d01b['push'](_0x55d01b['shift']());}};_0x366b99(++_0x369f1b);}(_0x9a86,0x13b));var _0x69a8=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x9a86[_0x3e7e96];return _0x13f6f0;};'use strict';var BPromise=require(_0x69a8('0x0'));var moment=require(_0x69a8('0x1'));var _=require(_0x69a8('0x2'));var util=require(_0x69a8('0x3'));var jayson=require(_0x69a8('0x4'));var client=jayson[_0x69a8('0x5')][_0x69a8('0x6')]({'port':0x2329});function request(_0x37299c,_0x3b43c8){return new BPromise(function(_0x1dd679,_0x2e8f1c){return client[_0x69a8('0x7')](_0x37299c,_0x3b43c8)[_0x69a8('0x8')](function(_0x86a41d){if(_0x86a41d[_0x69a8('0x9')]){return _0x2e8f1c(_0x86a41d[_0x69a8('0x9')][_0x69a8('0xa')]);}else{return _0x1dd679(_0x86a41d[_0x69a8('0xb')]);}})[_0x69a8('0xc')](function(_0x261070){return _0x2e8f1c(_0x261070);});});}exports[_0x69a8('0xd')]=function(_0x2c126b){return request(_0x69a8('0xe'),{'options':{'raw':![],'where':{'name':_0x2c126b},'attributes':['production']}});};exports[_0x69a8('0xf')]=function(_0x5ae902){return request(_0x69a8('0x10'),{'options':{'raw':![],'where':{'id':_0x5ae902},'include':[{'model':_0x69a8('0x11'),'as':_0x69a8('0x12')}],'attributes':['id',_0x69a8('0x13'),'email']}});};exports[_0x69a8('0x14')]=function(_0x36f417){return request(_0x69a8('0xe'),{'options':{'where':{'id':_0x36f417},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x15')]=function(_0x1d8f27){return request(_0x69a8('0x16'),{'options':{'where':{'id':_0x1d8f27},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x17')]=function(_0xf4f1e9){return request(_0x69a8('0x18'),{'options':{'where':{'id':_0xf4f1e9},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x19')]=function(_0x17dd62){return request(_0x69a8('0x1a'),{'options':{'where':{'id':_0x17dd62},'attributes':[_0x69a8('0x1b')]}});};exports['getUserById']=function(_0x2445d2){return request(_0x69a8('0x1c'),{'options':{'where':{'id':_0x2445d2},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x1d')]=function(_0x48a03c){return request(_0x69a8('0x1e'),{'options':{'where':{'id':_0x48a03c},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x1f')]=function(_0x3578ba){return request('ShowSound',{'options':{'where':{'id':_0x3578ba},'attributes':['save_name']}});};exports[_0x69a8('0x20')]=function(_0x1a374d){return request(_0x69a8('0x21'),{'options':{'raw':![],'where':{'id':_0x1a374d},'include':[{'model':_0x69a8('0x22'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x5108e9){return request(_0x69a8('0x23'),{'options':{'where':{'id':_0x5108e9},'attributes':['id',_0x69a8('0x13')]}});};exports[_0x69a8('0x24')]=function(_0x49c834){return request('CreateSmsMessage',{'body':_0x49c834});};exports['createSquareDetailsReport']=function(_0x49c022){return request(_0x69a8('0x25'),{'body':_0x49c022});};exports[_0x69a8('0x26')]=function(_0x171253){return request(_0x69a8('0x27'),{'body':_[_0x69a8('0x28')](_0x171253,{'project_name':_0x171253[_0x69a8('0x29')],'prev_project_name':_0x171253[_0x69a8('0x2a')]||'','is_subproject':_0x171253[_0x69a8('0x2a')]?!![]:![],'leaveAt':moment()[_0x69a8('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x19afcc){return request('CreateSquareRecording',{'body':_0x19afcc});};exports['createSquareMessage']=function(_0x287024){return request(_0x69a8('0x2c'),{'body':_0x287024});};exports[_0x69a8('0x2d')]=function(_0x73f9b2){return request(_0x69a8('0x2e'),{'options':{'raw':![],'where':{'phone':_0x73f9b2['phone'],'ListId':_0x73f9b2[_0x69a8('0x2f')]}}})['then'](function(_0x1eabef){if(_0x1eabef){return _0x1eabef;}return request('CreateCmContact',{'body':_0x73f9b2});});};exports[_0x69a8('0x30')]=function(_0x1e70eb){return request(_0x69a8('0x31'),{'options':{'where':{'id':_0x1e70eb},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x32')]=function(_0x1f9995,_0x5478f3){return request(_0x69a8('0x33'),{'body':{'interface':_0x5478f3},'options':{'where':_0x1f9995}});};exports[_0x69a8('0x34')]=function(_0x25db84,_0x545f59,_0x366bea){return request(_0x69a8('0x35'),{'body':{'type':_0x545f59,'uniqueid':_0x366bea},'options':{'where':_0x25db84}});};exports['agentUnpause']=function(_0x2e3acb){return request(_0x69a8('0x36'),{'body':{},'options':{'where':_0x2e3acb}});};exports[_0x69a8('0x37')]=function(_0x3ed8dd){return request('LogoutUser',{'body':{},'options':{'where':_0x3ed8dd}});};
\ No newline at end of file
index b22ec89..00eda53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x714c=['exports','./lex'];(function(_0xf27cfa,_0x3278d6){var _0x480617=function(_0x4dba95){while(--_0x4dba95){_0xf27cfa['push'](_0xf27cfa['shift']());}};_0x480617(++_0x3278d6);}(_0x714c,0x18d));var _0xc714=function(_0x4e0eb6,_0x240784){_0x4e0eb6=_0x4e0eb6-0x0;var _0x46e432=_0x714c[_0x4e0eb6];return _0x46e432;};var polly=require('./polly');var lex=require(_0xc714('0x0'));module[_0xc714('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x6657=['exports','./polly'];(function(_0x4e2430,_0x205543){var _0x53cce8=function(_0x5d9c7c){while(--_0x5d9c7c){_0x4e2430['push'](_0x4e2430['shift']());}};_0x53cce8(++_0x205543);}(_0x6657,0x17f));var _0x7665=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x6657[_0x513047];return _0x15b779;};var polly=require(_0x7665('0x0'));var lex=require('./lex');module[_0x7665('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index f5de74d..5ea547c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['exports'];(function(_0x42a17d,_0x3ea5be){var _0x29a66b=function(_0x507445){while(--_0x507445){_0x42a17d['push'](_0x42a17d['shift']());}};_0x29a66b(++_0x3ea5be);}(_0xb688,0xcf));var _0x8b68=function(_0x9f483c,_0x5647eb){_0x9f483c=_0x9f483c-0x0;var _0x33cdd3=_0xb688[_0x9f483c];return _0x33cdd3;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);};
\ No newline at end of file
+var _0xaa88=['exports','./lib/api'];(function(_0x475463,_0x1e1b77){var _0x490e41=function(_0x1a42bf){while(--_0x1a42bf){_0x475463['push'](_0x475463['shift']());}};_0x490e41(++_0x1e1b77);}(_0xaa88,0x137));var _0x8aa8=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0xaa88[_0x43a37c];return _0x5d1d40;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);};
\ No newline at end of file
index ec18741..bb35219 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x262059,_0x48130){var _0x1ddc71=function(_0x2bd03a){while(--_0x2bd03a){_0x262059['push'](_0x262059['shift']());}};_0x1ddc71(++_0x48130);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x1c2b4a,_0x596e55){var _0x519533=function(_0x33c054){while(--_0x33c054){_0x1c2b4a['push'](_0x1c2b4a['shift']());}};_0x519533(++_0x596e55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 7410875..de86fcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c36=['./lib/api','exports'];(function(_0x3fc71b,_0x1f8d60){var _0x26819e=function(_0x9efe83){while(--_0x9efe83){_0x3fc71b['push'](_0x3fc71b['shift']());}};_0x26819e(++_0x1f8d60);}(_0x3c36,0x10e));var _0x63c3=function(_0x44bbb5,_0x2c46f2){_0x44bbb5=_0x44bbb5-0x0;var _0x599808=_0x3c36[_0x44bbb5];return _0x599808;};'use strict';var polly=require(_0x63c3('0x0'));module[_0x63c3('0x1')]=function(_0x2b70e9,_0x11c094,_0xd61f26,_0x21d4d9,_0x463b23,_0x2b1c9d,_0x3f4e14){return polly(_0x2b70e9,_0x11c094,_0xd61f26,_0x21d4d9,_0x463b23,_0x2b1c9d,_0x3f4e14);};
\ No newline at end of file
+var _0x5572=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5572,0x7a));var _0x2557=function(_0x203fcb,_0x551c14){_0x203fcb=_0x203fcb-0x0;var _0x5c2be7=_0x5572[_0x203fcb];return _0x5c2be7;};'use strict';var polly=require('./lib/api');module[_0x2557('0x0')]=function(_0x19fd01,_0x532769,_0x585f16,_0x21675,_0x223575,_0x165fbe,_0x5a8f04){return polly(_0x19fd01,_0x532769,_0x585f16,_0x21675,_0x223575,_0x165fbe,_0x5a8f04);};
\ No newline at end of file
index 87be994..90a8291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccf7=['synthesizeSpeech','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird','randomstring'];(function(_0x4ce25b,_0x52f4a0){var _0x2ce92c=function(_0x3bee38){while(--_0x3bee38){_0x4ce25b['push'](_0x4ce25b['shift']());}};_0x2ce92c(++_0x52f4a0);}(_0xccf7,0x15b));var _0x7ccf=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0xccf7[_0x53a7a8];return _0x555f71;};'use strict';var fs=require('fs');var path=require(_0x7ccf('0x0'));var BPromise=require(_0x7ccf('0x1'));var rs=require(_0x7ccf('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x460f59,_0x2054d2,_0x24ba80){return new BPromise(function(_0x216c45,_0xbb203){_0x460f59[_0x7ccf('0x3')](_0x2054d2,function(_0x32d853,_0x48d6d0){if(_0x32d853){_0xbb203(_0x32d853);}else if(_0x48d6d0){if(_0x48d6d0['AudioStream']instanceof Buffer){fs[_0x7ccf('0x4')](_0x24ba80,_0x48d6d0['AudioStream'],function(_0x1f823b){if(_0x1f823b){_0xbb203(_0x1f823b);}else{_0x216c45();}});}else{_0xbb203(new Error(_0x7ccf('0x5')));}}else{_0xbb203(new Error(_0x7ccf('0x6')));}});});}module[_0x7ccf('0x7')]=function(_0x54c34e,_0x524cd2,_0x14f183,_0x4d6edc,_0x5d251f,_0x105d13,_0x52ad09){var _0x34e647=new AWS[(_0x7ccf('0x8'))]({'accessKeyId':_0x54c34e,'secretAccessKey':_0x524cd2,'region':_0x14f183});var _0x283b78={'Text':_0x5d251f,'TextType':_0x105d13||_0x7ccf('0x9'),'OutputFormat':'mp3','VoiceId':_0x4d6edc};return pollyResult(_0x34e647,_0x283b78,_0x52ad09);};
\ No newline at end of file
+var _0x1bb2=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird','randomstring'];(function(_0x15add5,_0x3b5673){var _0x551a4c=function(_0x1d748f){while(--_0x1d748f){_0x15add5['push'](_0x15add5['shift']());}};_0x551a4c(++_0x3b5673);}(_0x1bb2,0x177));var _0x21bb=function(_0x5e1593,_0x3c40ed){_0x5e1593=_0x5e1593-0x0;var _0x1b953f=_0x1bb2[_0x5e1593];return _0x1b953f;};'use strict';var fs=require('fs');var path=require(_0x21bb('0x0'));var BPromise=require(_0x21bb('0x1'));var rs=require(_0x21bb('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x337fb3,_0x15f90f,_0x4741e4){return new BPromise(function(_0x4d14c6,_0x49e335){_0x337fb3['synthesizeSpeech'](_0x15f90f,function(_0x515bb5,_0xf16e3e){if(_0x515bb5){_0x49e335(_0x515bb5);}else if(_0xf16e3e){if(_0xf16e3e['AudioStream']instanceof Buffer){fs['writeFile'](_0x4741e4,_0xf16e3e['AudioStream'],function(_0x3482c3){if(_0x3482c3){_0x49e335(_0x3482c3);}else{_0x4d14c6();}});}else{_0x49e335(new Error(_0x21bb('0x3')));}}else{_0x49e335(new Error(_0x21bb('0x4')));}});});}module[_0x21bb('0x5')]=function(_0x11aa3b,_0x541900,_0x5a13c1,_0xf7e50,_0x571a98,_0x18b472,_0x5a756f){var _0x74b365=new AWS['Polly']({'accessKeyId':_0x11aa3b,'secretAccessKey':_0x541900,'region':_0x5a13c1});var _0x2b3e29={'Text':_0x571a98,'TextType':_0x18b472||_0x21bb('0x6'),'OutputFormat':'mp3','VoiceId':_0xf7e50};return pollyResult(_0x74b365,_0x2b3e29,_0x5a756f);};
\ No newline at end of file
index d9f1bea..51449d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36a3=['exports','./lib/api'];(function(_0x886b04,_0x4598b3){var _0x18e6c2=function(_0x460dd5){while(--_0x460dd5){_0x886b04['push'](_0x886b04['shift']());}};_0x18e6c2(++_0x4598b3);}(_0x36a3,0x10b));var _0x336a=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x36a3[_0xa8883];return _0x479426;};'use strict';var asr=require(_0x336a('0x0'));module[_0x336a('0x1')]=function(_0x7610c2,_0x3b7618,_0x5fcd1b,_0x337345){return asr(_0x7610c2,_0x3b7618,_0x5fcd1b);};
\ No newline at end of file
+var _0x59d4=['exports','./lib/api'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x59d4,0x89));var _0x459d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x59d4[_0x122ef9];return _0x42fba0;};'use strict';var asr=require(_0x459d('0x0'));module[_0x459d('0x1')]=function(_0x44b935,_0x179b1e,_0x95a8bb,_0x413410){return asr(_0x44b935,_0x179b1e,_0x95a8bb);};
\ No newline at end of file
index 82a3337..2c776b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6b1=['LINEAR16','8000','url','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0xb6b1[_0x462fe4];return _0x82b23a;};'use strict';var url=require(_0x1b6b('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x1b6b('0x1');module['exports']=function(_0xede124,_0x29651a,_0x59b931){return new BPromise(function(_0x3f12e2,_0x5100e5){var _0x2a2c45;if(typeof _0xede124!==_0x1b6b('0x2')||_0xede124[_0x1b6b('0x3')]===0x0){return _0x5100e5(_0x1b6b('0x4'));}if(typeof _0x29651a!=='string'||_0x29651a[_0x1b6b('0x3')]===0x0){return _0x5100e5('key\x20should\x20be\x20a\x20string');}if(typeof _0x59b931!==_0x1b6b('0x5')&&(typeof _0x59b931!=='string'||_0x59b931[_0x1b6b('0x3')]===0x0)){return _0x5100e5(_0x1b6b('0x6'));}try{_0x2a2c45=fs[_0x1b6b('0x7')](_0xede124)[_0x1b6b('0x8')]('base64');}catch(_0x4c750a){return _0x5100e5(_0x4c750a);}return _0x3f12e2({'method':_0x1b6b('0x9'),'uri':host+_0x1b6b('0xa')+_0x29651a,'body':{'config':{'encoding':_0x1b6b('0xb'),'sampleRateHertz':_0x1b6b('0xc'),'languageCode':_0x59b931},'audio':{'content':_0x2a2c45}},'json':!![]});});};
\ No newline at end of file
+var _0x22fb=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','https://speech.googleapis.com'];(function(_0x218819,_0x4b151a){var _0x5d3a33=function(_0x4cd6af){while(--_0x4cd6af){_0x218819['push'](_0x218819['shift']());}};_0x5d3a33(++_0x4b151a);}(_0x22fb,0x192));var _0xb22f=function(_0x54b8ea,_0x1a4c77){_0x54b8ea=_0x54b8ea-0x0;var _0x6b73e7=_0x22fb[_0x54b8ea];return _0x6b73e7;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xb22f('0x0');module['exports']=function(_0x3f643d,_0x306b6e,_0x2221f1){return new BPromise(function(_0x10d2c4,_0x201512){var _0x50cdab;if(typeof _0x3f643d!==_0xb22f('0x1')||_0x3f643d[_0xb22f('0x2')]===0x0){return _0x201512(_0xb22f('0x3'));}if(typeof _0x306b6e!==_0xb22f('0x1')||_0x306b6e[_0xb22f('0x2')]===0x0){return _0x201512(_0xb22f('0x4'));}if(typeof _0x2221f1!=='undefined'&&(typeof _0x2221f1!==_0xb22f('0x1')||_0x2221f1[_0xb22f('0x2')]===0x0)){return _0x201512(_0xb22f('0x5'));}try{_0x50cdab=fs[_0xb22f('0x6')](_0x3f643d)[_0xb22f('0x7')](_0xb22f('0x8'));}catch(_0x188cea){return _0x201512(_0x188cea);}return _0x10d2c4({'method':_0xb22f('0x9'),'uri':host+_0xb22f('0xa')+_0x306b6e,'body':{'config':{'encoding':_0xb22f('0xb'),'sampleRateHertz':_0xb22f('0xc'),'languageCode':_0x2221f1},'audio':{'content':_0x50cdab}},'json':!![]});});};
\ No newline at end of file
index 10cb4be..4485d85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var asr=require('./asr');module['exports']={'asr':asr};
\ No newline at end of file
+var _0x1e68=['./asr'];(function(_0x5f5704,_0x4746bc){var _0x345bfe=function(_0x59d3c2){while(--_0x59d3c2){_0x5f5704['push'](_0x5f5704['shift']());}};_0x345bfe(++_0x4746bc);}(_0x1e68,0x1da));var _0x81e6=function(_0x474b2e,_0x2b19db){_0x474b2e=_0x474b2e-0x0;var _0x549ed5=_0x1e68[_0x474b2e];return _0x549ed5;};var asr=require(_0x81e6('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index 86eda3c..b55f916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5efe=['googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','resolvedQuery','action','fulfillment','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','length','queryResult','allRequiredParamsPresent','diagnosticInfo','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','asr','Tilde\x20ASR\x20confidence','.mp3','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','freeform=3','sestekNDA','text','channelData','CustomAction','Data','audiofile','dirName','apiai-promise','md5','path','querystring','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','info','close','unlink','download\x20error','end','https:','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','then','777','split','readFileSync','toString','base64','googleCloudTTS','?key=','input','voice','audioConfig','text:synthesize','resolve','writeFile','chmodSync','googleCloudTTS\x20path'];(function(_0x173d97,_0x1028d6){var _0x2ebce0=function(_0x58eae0){while(--_0x58eae0){_0x173d97['push'](_0x173d97['shift']());}};_0x2ebce0(++_0x1028d6);}(_0x5efe,0x148));var _0xe5ef=function(_0x42ba40,_0x508867){_0x42ba40=_0x42ba40-0x0;var _0x1515f7=_0x5efe[_0x42ba40];return _0x1515f7;};'use strict';var apiai=require(_0xe5ef('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0xe5ef('0x1'));var path=require(_0xe5ef('0x2'));var querystring=require(_0xe5ef('0x3'));var rp=require('request-promise');var rs=require(_0xe5ef('0x4'));var sox=require(_0xe5ef('0x5'));var tts=require(_0xe5ef('0x6'));var urlParse=require(_0xe5ef('0x7'))[_0xe5ef('0x8')];var util=require(_0xe5ef('0x9'));var aws=require(_0xe5ef('0xa'));var google=require(_0xe5ef('0xb'));var sestek=require(_0xe5ef('0xc'));var tilde=require('./tilde');var logger=require(_0xe5ef('0xd'))(_0xe5ef('0xe'));var ISPEECH_API=_0xe5ef('0xf');function downloadFile(_0x15f9c0,_0x3a9b3e){return new BPromise(function(_0xf91ea7,_0x49a6f4){var _0x3dba93=urlParse(_0x15f9c0);var _0x27c4f5=_0x3dba93[_0xe5ef('0x10')]==='https:'?https:http;var _0x141332={'host':_0x3dba93[_0xe5ef('0x11')],'path':_0x3dba93[_0xe5ef('0x2')],'headers':{'user-agent':_0xe5ef('0x12')}};_0x27c4f5[_0xe5ef('0x13')](_0x141332,function(_0x5216c2){if(_0x5216c2[_0xe5ef('0x14')]!==0xc8){logger[_0xe5ef('0x15')](_0xe5ef('0x16')+_0x15f9c0+_0xe5ef('0x17')+_0x5216c2['statusCode']+'\x20('+_0x5216c2[_0xe5ef('0x18')]+')');_0x49a6f4(new Error('request\x20to\x20'+_0x15f9c0+'\x20failed,\x20status\x20code\x20=\x20'+_0x5216c2['statusCode']+'\x20('+_0x5216c2[_0xe5ef('0x18')]+')'));return;}var _0x465276=fs['createWriteStream'](_0x3a9b3e);_0x465276['on']('finish',function(){logger[_0xe5ef('0x19')]('finish\x20download\x20file');_0x465276[_0xe5ef('0x1a')](_0xf91ea7);});_0x465276['on'](_0xe5ef('0x15'),function(_0x49c86b){fs[_0xe5ef('0x1b')](_0x3a9b3e);logger[_0xe5ef('0x15')](_0xe5ef('0x1c'),_0x49c86b);_0x49a6f4(_0x49c86b);});_0x5216c2['pipe'](_0x465276);})['on'](_0xe5ef('0x15'),function(_0x15bd03){logger[_0xe5ef('0x15')](_0x15bd03);_0x49a6f4(_0x15bd03);})[_0xe5ef('0x1d')]();});}function uploadFile(_0xcc4aa1){return new BPromise(function(_0x536ddf,_0x156dea){var _0x49f83f=urlParse(_0xcc4aa1);var _0x438837=_0x49f83f[_0xe5ef('0x10')]===_0xe5ef('0x1e')?https:http;var _0x201113={'host':_0x49f83f[_0xe5ef('0x11')],'path':_0x49f83f['path'],'headers':{'user-agent':_0xe5ef('0x12')}};_0x438837[_0xe5ef('0x13')](_0x201113,function(_0x4fa439){if(_0x4fa439['statusCode']!==0xc8){_0x156dea(new Error(_0xe5ef('0x16')+_0xcc4aa1+_0xe5ef('0x17')+_0x4fa439[_0xe5ef('0x14')]+'\x20('+_0x4fa439['statusMessage']+')'));return;}var _0x5f10a1='';_0x4fa439['on'](_0xe5ef('0x1f'),function(_0x497653){_0x5f10a1+=_0x497653;});_0x4fa439['on']('end',function(){_0x536ddf(_0x5f10a1);});})['on']('error',function(_0x48b857){_0x156dea(_0x48b857);})[_0xe5ef('0x1d')]();});}function convertFile(_0x55061e,_0x3c9ee1){return new BPromise(function(_0x414ea7,_0x4b7bb3){var _0x1c8cf7=sox[_0xe5ef('0x20')](_0x55061e,_0x3c9ee1,{'sampleRate':0x1f40,'format':_0xe5ef('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1c8cf7['on']('error',function(_0x6e2b27){logger[_0xe5ef('0x15')](_0xe5ef('0x22'),_0x6e2b27);_0x4b7bb3(_0x6e2b27);});_0x1c8cf7['on'](_0xe5ef('0x1d'),function(){logger[_0xe5ef('0x19')](_0xe5ef('0x23'));_0x414ea7();});_0x1c8cf7[_0xe5ef('0x24')]();});}function base64Decode(_0x33919e,_0x5994b8){var _0x3dead4=path['resolve'](__dirname,_0xe5ef('0x25'),rs[_0xe5ef('0x26')](0x4)+_0xe5ef('0x27'));fs['writeFileSync'](_0x3dead4,_0x33919e,'base64');return convertFile(_0x3dead4,_0x5994b8)[_0xe5ef('0x28')](function(){try{fs[_0xe5ef('0x1b')](_0x3dead4);fs['chmodSync'](_0x5994b8,_0xe5ef('0x29'));}catch(_0x492173){logger['error'](_0x492173);}return _0x5994b8[_0xe5ef('0x2a')]('.')[0x0];});}function base64Encode(_0x350d62){var _0x23c8aa=fs[_0xe5ef('0x2b')](_0x350d62);return new Buffer(_0x23c8aa)[_0xe5ef('0x2c')](_0xe5ef('0x2d'));}exports[_0xe5ef('0x2e')]=function(_0x167679,_0x24657a,_0x1d92a8,_0x3f1d8c,_0x4152c2,_0x1c53c5){var _0x554590,_0x201a47;var _0x3d4582='https://texttospeech.googleapis.com/v1/';var _0x18f00a=_0xe5ef('0x2f')+_0x167679;var _0x37d628={};if(_0x24657a==='ssml'){_0x37d628['input']={'ssml':_0x1d92a8};}else{_0x37d628[_0xe5ef('0x30')]={'text':_0x1d92a8};};_0x37d628[_0xe5ef('0x31')]={'languageCode':_0x3f1d8c,'ssmlGender':_0x4152c2};_0x37d628[_0xe5ef('0x32')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x9c036d={'url':_0x3d4582+_0xe5ef('0x33')+_0x18f00a,'method':'POST','json':!![],'body':_0x37d628};return rp(_0x9c036d)['then'](function(_0x4c7501){return new BPromise(function(_0x27cb81,_0x542e6b){_0x554590=path[_0xe5ef('0x34')](__dirname,_0xe5ef('0x25'),rs['generate'](0x4)+'.mp3');var _0x46edb2=Buffer['from'](_0x4c7501['audioContent'],'base64');return fs[_0xe5ef('0x35')](_0x554590,_0x46edb2,function(_0x272f10){_0x542e6b(_0x272f10);},function(_0x44dfc0){fs[_0xe5ef('0x36')](_0x554590,_0xe5ef('0x29'));_0x27cb81(_0x44dfc0);});});})[_0xe5ef('0x28')](function(_0x42cfe2){_0x201a47=path[_0xe5ef('0x34')](__dirname,_0xe5ef('0x25'),rs[_0xe5ef('0x26')](0x4)+_0xe5ef('0x27'));return convertFile(_0x554590,_0x201a47);})[_0xe5ef('0x28')](function(){try{fs['unlink'](_0x554590);fs['chmodSync'](_0x201a47,_0xe5ef('0x29'));}catch(_0x192be1){logger['error'](_0x192be1);}logger[_0xe5ef('0x19')](_0xe5ef('0x37'),_0x201a47[_0xe5ef('0x2a')]('.')[0x0]);return _0x201a47[_0xe5ef('0x2a')]('.')[0x0];});};exports[_0xe5ef('0x38')]=function(_0x36846b,_0x4e2bea){var _0x51c763=_0xe5ef('0x39');var _0x4b018c,_0x1c3998;var _0x3a29bd;var _0x2adf54={'encoding':_0xe5ef('0x3a'),'method':_0xe5ef('0x3b'),'timeout':0x2710,'url':_0x51c763,'headers':{'Content-Type':_0xe5ef('0x3c')},'body':'f.req='+encodeURIComponent(JSON[_0xe5ef('0x3d')]([[[_0xe5ef('0x3e'),JSON[_0xe5ef('0x3d')]([_0x36846b,_0x4e2bea||'en',![],_0xe5ef('0x3f')]),null,_0xe5ef('0x40')]]]))};return rp(_0x2adf54)['then'](function(_0x43e395){try{_0x3a29bd=eval(_0x43e395[_0xe5ef('0x41')](0x5))[0x0][0x2];}catch(_0x3785f2){throw new Error(_0xe5ef('0x42')+_0x43e395[_0xe5ef('0x1f')]);}if(!_0x3a29bd){if(_0x36846b['length']>0xc8){throw new Error(_0xe5ef('0x43'));}else{throw new Error(_0xe5ef('0x44')+_0x4e2bea+_0xe5ef('0x45'));}}try{_0x3a29bd=eval(_0x3a29bd)[0x0];}catch(_0x4b5770){throw new Error(_0xe5ef('0x42')+res[_0xe5ef('0x1f')]);}const _0x43415b=_0x3a29bd;_0x4b018c=path[_0xe5ef('0x34')](__dirname,_0xe5ef('0x25'),rs['generate'](0x4)+'.mp3');fs[_0xe5ef('0x46')](_0x4b018c,_0x3a29bd,{'encoding':_0xe5ef('0x2d')});_0x1c3998=path[_0xe5ef('0x34')](__dirname,_0xe5ef('0x25'),rs[_0xe5ef('0x26')](0x4)+_0xe5ef('0x27'));return convertFile(_0x4b018c,_0x1c3998);})[_0xe5ef('0x28')](function(){try{fs[_0xe5ef('0x1b')](_0x4b018c);fs[_0xe5ef('0x36')](_0x1c3998,_0xe5ef('0x29'));}catch(_0x57d764){logger[_0xe5ef('0x15')](_0x57d764);}logger[_0xe5ef('0x19')](_0xe5ef('0x47'),_0x1c3998[_0xe5ef('0x2a')]('.')[0x0]);return _0x1c3998[_0xe5ef('0x2a')]('.')[0x0];});};exports[_0xe5ef('0x48')]=function(_0x4879cb,_0x4f9f07,_0x520f0d){return google['asr'](_0x4879cb,_0x4f9f07,_0x520f0d)[_0xe5ef('0x28')](function(_0x5f337f){logger[_0xe5ef('0x19')](_0x5f337f['uri']);return rp(_0x5f337f);})['then'](function(_0x508ce){var _0x3ec44e='';var _0x26a9fa=0x0;try{fs[_0xe5ef('0x1b')](_0x4879cb);}catch(_0x2027cf){logger['error'](_0x2027cf);}if(_0x508ce&&_0x508ce[_0xe5ef('0x49')]){_0x3ec44e=_0x508ce[_0xe5ef('0x49')][_0xe5ef('0x4a')](function(_0x39551d){return _0x39551d&&_0x39551d[_0xe5ef('0x4b')][0x0]&&_0x39551d['alternatives'][0x0][_0xe5ef('0x4c')]?_0x39551d[_0xe5ef('0x4b')][0x0][_0xe5ef('0x4c')]:'';})['join']('\x0a');_0x26a9fa=_0x508ce[_0xe5ef('0x49')][_0xe5ef('0x4a')](function(_0x2d9c4e){return _0x2d9c4e&&_0x2d9c4e[_0xe5ef('0x4b')][0x0]&&_0x2d9c4e[_0xe5ef('0x4b')][0x0][_0xe5ef('0x4d')]?_0x2d9c4e[_0xe5ef('0x4b')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0xe5ef('0x19')](_0xe5ef('0x4e'),_0x3ec44e);logger[_0xe5ef('0x19')](_0xe5ef('0x4f'),_0x26a9fa);return{'transcript':_0x3ec44e,'confidence':_0x26a9fa};})[_0xe5ef('0x50')](function(_0x69c84a){logger['error'](_0xe5ef('0x51'),_0x69c84a[_0xe5ef('0x14')],_0x69c84a[_0xe5ef('0x52')],_0x69c84a[_0xe5ef('0x53')]);});};exports['googleDialogflow']=function(_0x20ec56,_0x49a8b4,_0x3682d6,_0x1fad01){var _0x18f65e=apiai(_0x49a8b4,{'language':_0x1fad01||'en'});return _0x18f65e[_0xe5ef('0x54')](_0x3682d6,{'sessionId':md5(_0x20ec56)})[_0xe5ef('0x28')](function(_0x595011){logger[_0xe5ef('0x19')](JSON[_0xe5ef('0x3d')](_0x595011));return{'source':_0x595011[_0xe5ef('0x55')]['source'],'resolvedQuery':_0x595011[_0xe5ef('0x55')][_0xe5ef('0x56')],'action':_0x595011[_0xe5ef('0x55')][_0xe5ef('0x57')],'actionIncomplete':_0x595011['result']['actionIncomplete'],'speech':_0x595011[_0xe5ef('0x55')][_0xe5ef('0x58')]['speech'],'score':_0x595011[_0xe5ef('0x55')][_0xe5ef('0x59')],'statusCode':_0x595011[_0xe5ef('0x5a')][_0xe5ef('0x5b')],'endConversation':_0x595011['result'][_0xe5ef('0x5c')]['endConversation']||![],'isFallbackIntent':_0x595011[_0xe5ef('0x55')][_0xe5ef('0x5c')][_0xe5ef('0x5d')]};});};exports[_0xe5ef('0x5e')]=function(_0x3740aa,_0x2c6973,_0x47de93,_0x154ebe,_0x1fd7d6,_0x184e44){var _0x45880a=_0x154ebe[_0xe5ef('0x5f')](/\\n/g,'\x0a');var _0x3bbd86={'credentials':{'private_key':_0x45880a,'client_email':_0x47de93}};var _0xcc3d20=new dialogflow['SessionsClient'](_0x3bbd86);var _0x40168b=_0xcc3d20[_0xe5ef('0x60')](_0x2c6973,md5(_0x3740aa));var _0x1eb82c={'session':_0x40168b,'queryInput':{'text':{'text':_0x1fd7d6,'languageCode':_0x184e44}}};return _0xcc3d20['detectIntent'](_0x1eb82c)[_0xe5ef('0x28')](function(_0x51a35e){if(_0x51a35e&&_0x51a35e[_0xe5ef('0x61')]){logger[_0xe5ef('0x19')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x51a35e));var _0x278b28=_0x51a35e[0x0];if(_0x278b28){var _0x28ad53={'action':_0x278b28[_0xe5ef('0x62')][_0xe5ef('0x57')],'allRequiredParamsPresent':_0x278b28['queryResult'][_0xe5ef('0x63')],'endConversation':_0x278b28['queryResult'][_0xe5ef('0x64')]&&_0x278b28[_0xe5ef('0x62')][_0xe5ef('0x64')]['fields']?_0x278b28[_0xe5ef('0x62')][_0xe5ef('0x64')]['fields'][_0xe5ef('0x65')][_0xe5ef('0x66')]:![],'fulfillmentText':_0x278b28[_0xe5ef('0x62')]['fulfillmentText'],'intentName':_0x278b28['queryResult']['intent']['name'],'intentDisplayName':_0x278b28[_0xe5ef('0x62')][_0xe5ef('0x67')][_0xe5ef('0x68')],'isFallbackIntent':_0x278b28[_0xe5ef('0x62')][_0xe5ef('0x67')][_0xe5ef('0x69')],'languageCode':_0x278b28[_0xe5ef('0x62')][_0xe5ef('0x6a')],'queryText':_0x278b28[_0xe5ef('0x62')][_0xe5ef('0x6b')],'responseId':_0x278b28[_0xe5ef('0x6c')],'score':_0x278b28[_0xe5ef('0x62')][_0xe5ef('0x6d')],'speech':_0x278b28['queryResult'][_0xe5ef('0x6e')],'providerResponse':JSON['stringify'](_0x51a35e)};return _0x28ad53;}}});};exports[_0xe5ef('0x6f')]=function(_0x476ea5,_0x39e277,_0x15def4,_0x2a5c24){return tilde[_0xe5ef('0x70')](_0x476ea5,_0x39e277,_0x15def4,_0x2a5c24)[_0xe5ef('0x28')](function(_0x16c469){try{fs['unlink'](_0x476ea5);}catch(_0x59f9de){logger[_0xe5ef('0x15')](_0x59f9de);}logger[_0xe5ef('0x19')]('Tilde\x20ASR\x20transcription',_0x16c469[_0xe5ef('0x4c')]);logger[_0xe5ef('0x19')](_0xe5ef('0x71'),_0x16c469['confidence']);return _0x16c469;});};exports['awsPolly']=function(_0x2b50c7,_0x45fde7,_0x231503,_0x3a9e77,_0x40f5f3,_0x109da0){var _0x3c75aa=path[_0xe5ef('0x34')](__dirname,_0xe5ef('0x25'),rs[_0xe5ef('0x26')](0x4)+_0xe5ef('0x72'));var _0xc04d3e;return aws['polly'](_0x2b50c7,_0x45fde7,_0x231503,_0x3a9e77,_0x40f5f3,_0x109da0,_0x3c75aa)[_0xe5ef('0x28')](function(){_0xc04d3e=path['resolve'](__dirname,_0xe5ef('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x3c75aa,_0xc04d3e);})[_0xe5ef('0x28')](function(){try{fs[_0xe5ef('0x1b')](_0x3c75aa);fs[_0xe5ef('0x36')](_0xc04d3e,_0xe5ef('0x29'));}catch(_0x521bea){logger[_0xe5ef('0x15')](_0x521bea);}return _0xc04d3e[_0xe5ef('0x2a')]('.')[0x0];});};exports[_0xe5ef('0x73')]=function(_0x20a9fb,_0x48743c,_0x102071,_0xf847d,_0xc96112,_0x4ea9b3){return aws[_0xe5ef('0x74')](_0x20a9fb,_0x48743c,_0x102071,_0xf847d,_0xc96112,_0x4ea9b3)[_0xe5ef('0x28')](function(_0x99c203){logger[_0xe5ef('0x19')](JSON[_0xe5ef('0x3d')](_0x99c203));return _0x99c203;});};exports[_0xe5ef('0x75')]=function(_0x477ce1,_0x20089f,_0x3ac8b4,_0x3a7cd0){var _0x2f3b08=util[_0xe5ef('0x76')](_0xe5ef('0x77'),ISPEECH_API,_0x477ce1,encodeURIComponent(_0x20089f),_0x3ac8b4,_0x3a7cd0);var _0x3380ef=path[_0xe5ef('0x34')](__dirname,_0xe5ef('0x25'),rs['generate'](0x4)+_0xe5ef('0x72'));var _0x3fb19b;return downloadFile(_0x2f3b08,_0x3380ef)[_0xe5ef('0x28')](function(){_0x3fb19b=path[_0xe5ef('0x34')](__dirname,'tmp',rs['generate'](0x4)+_0xe5ef('0x27'));return convertFile(_0x3380ef,_0x3fb19b);})[_0xe5ef('0x28')](function(){try{fs[_0xe5ef('0x1b')](_0x3380ef);fs['chmodSync'](_0x3fb19b,_0xe5ef('0x29'));}catch(_0x2534c6){logger[_0xe5ef('0x15')](_0x2534c6);}return _0x3fb19b[_0xe5ef('0x2a')]('.')[0x0];});};exports['ispeechASR']=function(_0x24d1ee,_0x421610,_0x431e7e,_0x25d70e){var _0x45f74b=util[_0xe5ef('0x76')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x421610,_0x431e7e,base64Encode(_0x24d1ee),_0x25d70e?util[_0xe5ef('0x76')]('model=%s',encodeURIComponent(_0x25d70e)):_0xe5ef('0x78'));return uploadFile(_0x45f74b)[_0xe5ef('0x28')](function(_0x42609f){return querystring['parse'](_0x42609f);});};exports[_0xe5ef('0x79')]=function(_0x3bb463,_0x55f082){return sestek['nda'](_0x3bb463,_0x55f082)['then'](function(_0x4ca6dd){logger[_0xe5ef('0x19')](JSON['stringify'](_0x4ca6dd));var _0x48c5a5={'speech':_0x4ca6dd[_0xe5ef('0x7a')],'action':_0x4ca6dd[_0xe5ef('0x7b')]?_0x4ca6dd[_0xe5ef('0x7b')][_0xe5ef('0x7c')]:undefined,'actiondata':_0x4ca6dd[_0xe5ef('0x7b')]?_0x4ca6dd[_0xe5ef('0x7b')]['CustomActionData']:undefined};if(_0x4ca6dd[_0xe5ef('0x7b')]&&_0x4ca6dd['channelData']['AudioFromTts']){return base64Decode(_0x4ca6dd['channelData']['AudioFromTts'][_0xe5ef('0x7d')],path['resolve'](__dirname,'tmp',rs[_0xe5ef('0x26')](0x4)+'.wav'))[_0xe5ef('0x28')](function(_0x5bd35b){_0x48c5a5[_0xe5ef('0x7e')]=_0x5bd35b;return _0x48c5a5;});}return _0x48c5a5;});};exports[_0xe5ef('0x7f')]=function(){return __dirname;};
\ No newline at end of file
+var _0xe7f1=['./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','path','WHAT_EVER','get','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','statusCode','createWriteStream','finish','info','finish\x20download\x20file','error','unlink','pipe','end','protocol','data','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','from','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','intent','isFallback','languageCode','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','polly','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','apiai-promise','bluebird','dialogflow','http','https','md5','querystring','randomstring','parse','util'];(function(_0x2030f0,_0x17465a){var _0x5d6873=function(_0x4fffb6){while(--_0x4fffb6){_0x2030f0['push'](_0x2030f0['shift']());}};_0x5d6873(++_0x17465a);}(_0xe7f1,0xfa));var _0x1e7f=function(_0x5524e9,_0x19b5fd){_0x5524e9=_0x5524e9-0x0;var _0x4f6a46=_0xe7f1[_0x5524e9];return _0x4f6a46;};'use strict';var apiai=require(_0x1e7f('0x0'));var BPromise=require(_0x1e7f('0x1'));var dialogflow=require(_0x1e7f('0x2'));var fs=require('fs');var http=require(_0x1e7f('0x3'));var https=require(_0x1e7f('0x4'));var md5=require(_0x1e7f('0x5'));var path=require('path');var querystring=require(_0x1e7f('0x6'));var rp=require('request-promise');var rs=require(_0x1e7f('0x7'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require('url')[_0x1e7f('0x8')];var util=require(_0x1e7f('0x9'));var aws=require(_0x1e7f('0xa'));var google=require(_0x1e7f('0xb'));var sestek=require(_0x1e7f('0xc'));var tilde=require('./tilde');var logger=require(_0x1e7f('0xd'))(_0x1e7f('0xe'));var ISPEECH_API=_0x1e7f('0xf');function downloadFile(_0x554c96,_0x2c0418){return new BPromise(function(_0x723762,_0x20e451){var _0x1bd763=urlParse(_0x554c96);var _0x33613b=_0x1bd763['protocol']===_0x1e7f('0x10')?https:http;var _0x1fa276={'host':_0x1bd763[_0x1e7f('0x11')],'path':_0x1bd763[_0x1e7f('0x12')],'headers':{'user-agent':_0x1e7f('0x13')}};_0x33613b[_0x1e7f('0x14')](_0x1fa276,function(_0x20394f){if(_0x20394f['statusCode']!==0xc8){logger['error'](_0x1e7f('0x15')+_0x554c96+'\x20failed,\x20status\x20code\x20=\x20'+_0x20394f['statusCode']+'\x20('+_0x20394f[_0x1e7f('0x16')]+')');_0x20e451(new Error(_0x1e7f('0x15')+_0x554c96+_0x1e7f('0x17')+_0x20394f[_0x1e7f('0x18')]+'\x20('+_0x20394f['statusMessage']+')'));return;}var _0x55d2da=fs[_0x1e7f('0x19')](_0x2c0418);_0x55d2da['on'](_0x1e7f('0x1a'),function(){logger[_0x1e7f('0x1b')](_0x1e7f('0x1c'));_0x55d2da['close'](_0x723762);});_0x55d2da['on'](_0x1e7f('0x1d'),function(_0x72167){fs[_0x1e7f('0x1e')](_0x2c0418);logger[_0x1e7f('0x1d')]('download\x20error',_0x72167);_0x20e451(_0x72167);});_0x20394f[_0x1e7f('0x1f')](_0x55d2da);})['on'](_0x1e7f('0x1d'),function(_0x438a99){logger[_0x1e7f('0x1d')](_0x438a99);_0x20e451(_0x438a99);})[_0x1e7f('0x20')]();});}function uploadFile(_0x2acf98){return new BPromise(function(_0x5b2d2a,_0x453a36){var _0x3ac77b=urlParse(_0x2acf98);var _0x312f35=_0x3ac77b[_0x1e7f('0x21')]==='https:'?https:http;var _0x43d69a={'host':_0x3ac77b[_0x1e7f('0x11')],'path':_0x3ac77b[_0x1e7f('0x12')],'headers':{'user-agent':_0x1e7f('0x13')}};_0x312f35[_0x1e7f('0x14')](_0x43d69a,function(_0x158137){if(_0x158137['statusCode']!==0xc8){_0x453a36(new Error(_0x1e7f('0x15')+_0x2acf98+_0x1e7f('0x17')+_0x158137['statusCode']+'\x20('+_0x158137[_0x1e7f('0x16')]+')'));return;}var _0x283dd1='';_0x158137['on'](_0x1e7f('0x22'),function(_0x59d778){_0x283dd1+=_0x59d778;});_0x158137['on'](_0x1e7f('0x20'),function(){_0x5b2d2a(_0x283dd1);});})['on']('error',function(_0x444ae3){_0x453a36(_0x444ae3);})[_0x1e7f('0x20')]();});}function convertFile(_0x38d2e7,_0x128c2a){return new BPromise(function(_0x40e0f2,_0x1b2014){var _0x116f04=sox['transcode'](_0x38d2e7,_0x128c2a,{'sampleRate':0x1f40,'format':_0x1e7f('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x116f04['on']('error',function(_0x5a20d7){logger[_0x1e7f('0x1d')](_0x1e7f('0x24'),_0x5a20d7);_0x1b2014(_0x5a20d7);});_0x116f04['on'](_0x1e7f('0x20'),function(){logger[_0x1e7f('0x1b')](_0x1e7f('0x25'));_0x40e0f2();});_0x116f04['start']();});}function base64Decode(_0x51f8de,_0x331c2d){var _0x352853=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+_0x1e7f('0x29'));fs[_0x1e7f('0x2a')](_0x352853,_0x51f8de,_0x1e7f('0x2b'));return convertFile(_0x352853,_0x331c2d)['then'](function(){try{fs[_0x1e7f('0x1e')](_0x352853);fs['chmodSync'](_0x331c2d,_0x1e7f('0x2c'));}catch(_0x1cb58a){logger['error'](_0x1cb58a);}return _0x331c2d[_0x1e7f('0x2d')]('.')[0x0];});}function base64Encode(_0x14a162){var _0xfc0ab=fs['readFileSync'](_0x14a162);return new Buffer(_0xfc0ab)[_0x1e7f('0x2e')](_0x1e7f('0x2b'));}exports[_0x1e7f('0x2f')]=function(_0x228a33,_0x262b53,_0x34a972,_0xb070ae,_0x163961,_0x4a84ba){var _0xbb41fb,_0x26d8a8;var _0x531418=_0x1e7f('0x30');var _0x67f481='?key='+_0x228a33;var _0x1bc7a0={};if(_0x262b53===_0x1e7f('0x31')){_0x1bc7a0[_0x1e7f('0x32')]={'ssml':_0x34a972};}else{_0x1bc7a0[_0x1e7f('0x32')]={'text':_0x34a972};};_0x1bc7a0[_0x1e7f('0x33')]={'languageCode':_0xb070ae,'ssmlGender':_0x163961};_0x1bc7a0[_0x1e7f('0x34')]={'audioEncoding':_0x1e7f('0x35'),'sampleRateHertz':0x1f40};var _0x3b4e8b={'url':_0x531418+_0x1e7f('0x36')+_0x67f481,'method':_0x1e7f('0x37'),'json':!![],'body':_0x1bc7a0};return rp(_0x3b4e8b)[_0x1e7f('0x38')](function(_0x418c5e){return new BPromise(function(_0x1691bb,_0x1733f2){_0xbb41fb=path['resolve'](__dirname,_0x1e7f('0x27'),rs['generate'](0x4)+'.mp3');var _0x80efd6=Buffer[_0x1e7f('0x39')](_0x418c5e[_0x1e7f('0x3a')],'base64');return fs[_0x1e7f('0x3b')](_0xbb41fb,_0x80efd6,function(_0x21d38b){_0x1733f2(_0x21d38b);},function(_0x3d0c12){fs[_0x1e7f('0x3c')](_0xbb41fb,'777');_0x1691bb(_0x3d0c12);});});})['then'](function(_0x1db924){_0x26d8a8=path['resolve'](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+'.wav');return convertFile(_0xbb41fb,_0x26d8a8);})[_0x1e7f('0x38')](function(){try{fs['unlink'](_0xbb41fb);fs[_0x1e7f('0x3c')](_0x26d8a8,_0x1e7f('0x2c'));}catch(_0x451ded){logger[_0x1e7f('0x1d')](_0x451ded);}logger['info'](_0x1e7f('0x3d'),_0x26d8a8[_0x1e7f('0x2d')]('.')[0x0]);return _0x26d8a8[_0x1e7f('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x170c5f,_0x366d9d){var _0x1468c5=_0x1e7f('0x3e');var _0x1dc3ab,_0x8d3a3b;var _0x182902;var _0x2af2ab={'encoding':_0x1e7f('0x3f'),'method':_0x1e7f('0x37'),'timeout':0x2710,'url':_0x1468c5,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x1e7f('0x40')]([_0x170c5f,_0x366d9d||'en',![],_0x1e7f('0x41')]),null,'generic']]]))};return rp(_0x2af2ab)[_0x1e7f('0x38')](function(_0x142efa){try{_0x182902=eval(_0x142efa[_0x1e7f('0x42')](0x5))[0x0][0x2];}catch(_0x449d5b){throw new Error(_0x1e7f('0x43')+_0x142efa[_0x1e7f('0x22')]);}if(!_0x182902){if(_0x170c5f[_0x1e7f('0x44')]>0xc8){throw new Error(_0x1e7f('0x45'));}else{throw new Error(_0x1e7f('0x46')+_0x366d9d+_0x1e7f('0x47'));}}try{_0x182902=eval(_0x182902)[0x0];}catch(_0x18fc34){throw new Error(_0x1e7f('0x43')+res[_0x1e7f('0x22')]);}const _0x413ee5=_0x182902;_0x1dc3ab=path['resolve'](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+'.mp3');fs['writeFileSync'](_0x1dc3ab,_0x182902,{'encoding':'base64'});_0x8d3a3b=path['resolve'](__dirname,_0x1e7f('0x27'),rs['generate'](0x4)+_0x1e7f('0x29'));return convertFile(_0x1dc3ab,_0x8d3a3b);})[_0x1e7f('0x38')](function(){try{fs[_0x1e7f('0x1e')](_0x1dc3ab);fs[_0x1e7f('0x3c')](_0x8d3a3b,_0x1e7f('0x2c'));}catch(_0x27f802){logger[_0x1e7f('0x1d')](_0x27f802);}logger[_0x1e7f('0x1b')](_0x1e7f('0x48'),_0x8d3a3b['split']('.')[0x0]);return _0x8d3a3b[_0x1e7f('0x2d')]('.')[0x0];});};exports[_0x1e7f('0x49')]=function(_0x2790fd,_0x502ec9,_0x5ef6b2){return google[_0x1e7f('0x4a')](_0x2790fd,_0x502ec9,_0x5ef6b2)[_0x1e7f('0x38')](function(_0x148929){logger[_0x1e7f('0x1b')](_0x148929[_0x1e7f('0x4b')]);return rp(_0x148929);})[_0x1e7f('0x38')](function(_0x58716f){var _0x25e5fb='';var _0x2f8f7c=0x0;try{fs[_0x1e7f('0x1e')](_0x2790fd);}catch(_0x5eda34){logger[_0x1e7f('0x1d')](_0x5eda34);}if(_0x58716f&&_0x58716f[_0x1e7f('0x4c')]){_0x25e5fb=_0x58716f[_0x1e7f('0x4c')][_0x1e7f('0x4d')](function(_0x1335dd){return _0x1335dd&&_0x1335dd['alternatives'][0x0]&&_0x1335dd[_0x1e7f('0x4e')][0x0][_0x1e7f('0x4f')]?_0x1335dd[_0x1e7f('0x4e')][0x0][_0x1e7f('0x4f')]:'';})[_0x1e7f('0x50')]('\x0a');_0x2f8f7c=_0x58716f['results']['map'](function(_0x48465e){return _0x48465e&&_0x48465e['alternatives'][0x0]&&_0x48465e['alternatives'][0x0][_0x1e7f('0x51')]?_0x48465e[_0x1e7f('0x4e')][0x0][_0x1e7f('0x51')]:0x0;})[_0x1e7f('0x50')]('\x0a');}logger[_0x1e7f('0x1b')](_0x1e7f('0x52'),_0x25e5fb);logger['info'](_0x1e7f('0x53'),_0x2f8f7c);return{'transcript':_0x25e5fb,'confidence':_0x2f8f7c};})[_0x1e7f('0x54')](function(_0x4e8287){logger[_0x1e7f('0x1d')](_0x1e7f('0x55'),_0x4e8287[_0x1e7f('0x18')],_0x4e8287[_0x1e7f('0x56')],_0x4e8287[_0x1e7f('0x57')]);});};exports[_0x1e7f('0x58')]=function(_0x33576d,_0x169813,_0xa17522,_0x409e66){var _0x4bf4b7=apiai(_0x169813,{'language':_0x409e66||'en'});return _0x4bf4b7[_0x1e7f('0x59')](_0xa17522,{'sessionId':md5(_0x33576d)})[_0x1e7f('0x38')](function(_0xd21202){logger[_0x1e7f('0x1b')](JSON[_0x1e7f('0x40')](_0xd21202));return{'source':_0xd21202[_0x1e7f('0x5a')]['source'],'resolvedQuery':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x5b')],'action':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x5c')],'actionIncomplete':_0xd21202['result'][_0x1e7f('0x5d')],'speech':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x5e')][_0x1e7f('0x5f')],'score':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x60')],'statusCode':_0xd21202[_0x1e7f('0x61')][_0x1e7f('0x62')],'endConversation':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x63')][_0x1e7f('0x64')]||![],'isFallbackIntent':_0xd21202[_0x1e7f('0x5a')]['metadata']['isFallbackIntent']};});};exports[_0x1e7f('0x65')]=function(_0x53d591,_0x1c9063,_0x24588b,_0x2624b6,_0x3b3a45,_0x554d6e){var _0x386807=_0x2624b6[_0x1e7f('0x66')](/\\n/g,'\x0a');var _0x1ed35b={'credentials':{'private_key':_0x386807,'client_email':_0x24588b}};var _0x5b752a=new dialogflow[(_0x1e7f('0x67'))](_0x1ed35b);var _0x3010a7=_0x5b752a['sessionPath'](_0x1c9063,md5(_0x53d591));var _0x56ab78={'session':_0x3010a7,'queryInput':{'text':{'text':_0x3b3a45,'languageCode':_0x554d6e}}};return _0x5b752a[_0x1e7f('0x68')](_0x56ab78)[_0x1e7f('0x38')](function(_0x1ee344){if(_0x1ee344&&_0x1ee344[_0x1e7f('0x44')]){logger[_0x1e7f('0x1b')](_0x1e7f('0x69'),JSON[_0x1e7f('0x40')](_0x1ee344));var _0x20ef3a=_0x1ee344[0x0];if(_0x20ef3a){var _0xf4d9be={'action':_0x20ef3a['queryResult'][_0x1e7f('0x5c')],'allRequiredParamsPresent':_0x20ef3a[_0x1e7f('0x6a')]['allRequiredParamsPresent'],'endConversation':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6b')]&&_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6b')][_0x1e7f('0x6c')]?_0x20ef3a['queryResult'][_0x1e7f('0x6b')][_0x1e7f('0x6c')][_0x1e7f('0x6d')]['boolValue']:![],'fulfillmentText':_0x20ef3a[_0x1e7f('0x6a')]['fulfillmentText'],'intentName':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6e')][_0x1e7f('0x56')],'intentDisplayName':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6e')]['displayName'],'isFallbackIntent':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6e')][_0x1e7f('0x6f')],'languageCode':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x70')],'queryText':_0x20ef3a[_0x1e7f('0x6a')]['queryText'],'responseId':_0x20ef3a['responseId'],'score':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x71')],'speech':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x72')],'providerResponse':JSON[_0x1e7f('0x40')](_0x1ee344)};return _0xf4d9be;}}});};exports[_0x1e7f('0x73')]=function(_0xac1db7,_0x4a3f01,_0x279327,_0x51c0fd){return tilde[_0x1e7f('0x4a')](_0xac1db7,_0x4a3f01,_0x279327,_0x51c0fd)[_0x1e7f('0x38')](function(_0x19377d){try{fs['unlink'](_0xac1db7);}catch(_0x49f68e){logger[_0x1e7f('0x1d')](_0x49f68e);}logger['info'](_0x1e7f('0x74'),_0x19377d[_0x1e7f('0x4f')]);logger[_0x1e7f('0x1b')](_0x1e7f('0x75'),_0x19377d[_0x1e7f('0x51')]);return _0x19377d;});};exports[_0x1e7f('0x76')]=function(_0x585e45,_0x2df3a4,_0x581e2d,_0x142234,_0x52956a,_0x397999){var _0x1a8df0=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+_0x1e7f('0x77'));var _0x5f1153;return aws[_0x1e7f('0x78')](_0x585e45,_0x2df3a4,_0x581e2d,_0x142234,_0x52956a,_0x397999,_0x1a8df0)[_0x1e7f('0x38')](function(){_0x5f1153=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+_0x1e7f('0x29'));return convertFile(_0x1a8df0,_0x5f1153);})['then'](function(){try{fs[_0x1e7f('0x1e')](_0x1a8df0);fs['chmodSync'](_0x5f1153,_0x1e7f('0x2c'));}catch(_0x2508d0){logger['error'](_0x2508d0);}return _0x5f1153[_0x1e7f('0x2d')]('.')[0x0];});};exports['awsLex']=function(_0x4af280,_0x471a1c,_0x43efe0,_0x20cef6,_0x36d4be,_0x1d4848){return aws['lex'](_0x4af280,_0x471a1c,_0x43efe0,_0x20cef6,_0x36d4be,_0x1d4848)[_0x1e7f('0x38')](function(_0x3ab4b7){logger[_0x1e7f('0x1b')](JSON[_0x1e7f('0x40')](_0x3ab4b7));return _0x3ab4b7;});};exports[_0x1e7f('0x79')]=function(_0x203ab4,_0x4dc01b,_0x115353,_0x2fd39d){var _0x5ea76d=util['format'](_0x1e7f('0x7a'),ISPEECH_API,_0x203ab4,encodeURIComponent(_0x4dc01b),_0x115353,_0x2fd39d);var _0x487c5c=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+'.mp3');var _0x4669a9;return downloadFile(_0x5ea76d,_0x487c5c)['then'](function(){_0x4669a9=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs['generate'](0x4)+_0x1e7f('0x29'));return convertFile(_0x487c5c,_0x4669a9);})[_0x1e7f('0x38')](function(){try{fs[_0x1e7f('0x1e')](_0x487c5c);fs[_0x1e7f('0x3c')](_0x4669a9,'777');}catch(_0x268ad4){logger[_0x1e7f('0x1d')](_0x268ad4);}return _0x4669a9[_0x1e7f('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x392b48,_0x4c7990,_0x4e5dbc,_0x54a77d){var _0x1e0c33=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4c7990,_0x4e5dbc,base64Encode(_0x392b48),_0x54a77d?util['format']('model=%s',encodeURIComponent(_0x54a77d)):'freeform=3');return uploadFile(_0x1e0c33)[_0x1e7f('0x38')](function(_0x1716a0){return querystring[_0x1e7f('0x8')](_0x1716a0);});};exports[_0x1e7f('0x7b')]=function(_0x1b0063,_0x592d34){return sestek[_0x1e7f('0x7c')](_0x1b0063,_0x592d34)['then'](function(_0x3ea76e){logger[_0x1e7f('0x1b')](JSON['stringify'](_0x3ea76e));var _0x4b4b56={'speech':_0x3ea76e['text'],'action':_0x3ea76e[_0x1e7f('0x7d')]?_0x3ea76e['channelData'][_0x1e7f('0x7e')]:undefined,'actiondata':_0x3ea76e[_0x1e7f('0x7d')]?_0x3ea76e[_0x1e7f('0x7d')][_0x1e7f('0x7f')]:undefined};if(_0x3ea76e['channelData']&&_0x3ea76e['channelData'][_0x1e7f('0x80')]){return base64Decode(_0x3ea76e['channelData'][_0x1e7f('0x80')][_0x1e7f('0x81')],path['resolve'](__dirname,_0x1e7f('0x27'),rs['generate'](0x4)+_0x1e7f('0x29')))[_0x1e7f('0x38')](function(_0x4a8685){_0x4b4b56['audiofile']=_0x4a8685;return _0x4b4b56;});}return _0x4b4b56;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
index 302513d..8f34e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb760=['exports'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xb760,0x124));var _0x0b76=function(_0x3f97ac,_0x10186a){_0x3f97ac=_0x3f97ac-0x0;var _0x3a5ea5=_0xb760[_0x3f97ac];return _0x3a5ea5;};var nda=require('./nda');module[_0x0b76('0x0')]={'nda':nda};
\ No newline at end of file
+var nda=require('./nda');module['exports']={'nda':nda};
\ No newline at end of file
index 6cedde5..03acfd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf257=['extension','text','Bearer\x20','access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','ndaactivity_type','message','callerid','dnid'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf257,0x82));var _0x7f25=function(_0x29a40a,_0x234214){_0x29a40a=_0x29a40a-0x0;var _0x6182e9=_0xf257[_0x29a40a];return _0x6182e9;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x7f25('0x0'))(_0x7f25('0x1'));module[_0x7f25('0x2')]=function(_0x22d4a9,_0x5c712c){var _0x159dd1={'method':_0x7f25('0x3'),'uri':url[_0x7f25('0x4')](_0x5c712c[_0x7f25('0x5')],_0x7f25('0x6')),'form':{'grant_type':_0x7f25('0x7'),'username':_0x5c712c[_0x7f25('0x8')],'password':_0x5c712c[_0x7f25('0x7')]},'json':!![]};return rp(_0x159dd1)[_0x7f25('0x9')](function(_0x16e278){var _0x31a5d8={'method':_0x7f25('0x3'),'uri':url[_0x7f25('0x4')](_0x5c712c[_0x7f25('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5c712c[_0x7f25('0xb')]||_0x7f25('0xc'),'channelId':'Nda','conversation':{'id':_0x22d4a9['uniqueid']},'from':{'id':_0x22d4a9[_0x7f25('0xd')],'name':_0x22d4a9['calleridname']},'recipient':{'id':_0x22d4a9[_0x7f25('0xe')],'name':_0x22d4a9[_0x7f25('0xf')]},'text':_0x5c712c[_0x7f25('0x10')],'channelData':{}},'headers':{'Authorization':_0x7f25('0x11')+_0x16e278[_0x7f25('0x12')]},'json':!![]};if(_0x5c712c[_0x7f25('0x13')]){_0x31a5d8[_0x7f25('0x14')]['channelData']['ProjectName']=_0x5c712c[_0x7f25('0x13')];}if(_0x5c712c['ndagenerate_audio']=='1'){_0x31a5d8[_0x7f25('0x14')][_0x7f25('0x15')][_0x7f25('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7f25('0x17')};}if(_0x5c712c[_0x7f25('0x18')]){_0x31a5d8['body']['channelData']['CustomAction']=_0x5c712c[_0x7f25('0x18')];if(_0x5c712c[_0x7f25('0x19')]){_0x31a5d8[_0x7f25('0x14')][_0x7f25('0x15')][_0x7f25('0x1a')]=_0x5c712c[_0x7f25('0x19')];}}logger[_0x7f25('0x1b')](JSON[_0x7f25('0x1c')](_0x31a5d8));return rp(_0x31a5d8);});};
\ No newline at end of file
+var _0x90db=['agi','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','access_token','body','channelData','ProjectName','project','ndagenerate_audio','audio/wav','custom_action','CustomActionData','custom_action_data','info','url','../../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90db,0x1c0));var _0xb90d=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x90db[_0x220dbb];return _0x2b77de;};'use strict';var rp=require('request-promise');var url=require(_0xb90d('0x0'));var logger=require(_0xb90d('0x1'))(_0xb90d('0x2'));module['exports']=function(_0x4fc4c2,_0x4faf3d){var _0x50a80e={'method':'POST','uri':url[_0xb90d('0x3')](_0x4faf3d[_0xb90d('0x4')],_0xb90d('0x5')),'form':{'grant_type':_0xb90d('0x6'),'username':_0x4faf3d[_0xb90d('0x7')],'password':_0x4faf3d[_0xb90d('0x6')]},'json':!![]};return rp(_0x50a80e)[_0xb90d('0x8')](function(_0x126e17){var _0x2ef5e6={'method':_0xb90d('0x9'),'uri':url[_0xb90d('0x3')](_0x4faf3d[_0xb90d('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x4faf3d[_0xb90d('0xb')]||_0xb90d('0xc'),'channelId':_0xb90d('0xd'),'conversation':{'id':_0x4fc4c2['uniqueid']},'from':{'id':_0x4fc4c2[_0xb90d('0xe')],'name':_0x4fc4c2[_0xb90d('0xf')]},'recipient':{'id':_0x4fc4c2[_0xb90d('0x10')],'name':_0x4fc4c2[_0xb90d('0x11')]},'text':_0x4faf3d[_0xb90d('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x126e17[_0xb90d('0x13')]},'json':!![]};if(_0x4faf3d['project']){_0x2ef5e6[_0xb90d('0x14')][_0xb90d('0x15')][_0xb90d('0x16')]=_0x4faf3d[_0xb90d('0x17')];}if(_0x4faf3d[_0xb90d('0x18')]=='1'){_0x2ef5e6[_0xb90d('0x14')][_0xb90d('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb90d('0x19')};}if(_0x4faf3d['custom_action']){_0x2ef5e6[_0xb90d('0x14')][_0xb90d('0x15')]['CustomAction']=_0x4faf3d[_0xb90d('0x1a')];if(_0x4faf3d['custom_action_data']){_0x2ef5e6[_0xb90d('0x14')][_0xb90d('0x15')][_0xb90d('0x1b')]=_0x4faf3d[_0xb90d('0x1c')];}}logger[_0xb90d('0x1d')](JSON['stringify'](_0x2ef5e6));return rp(_0x2ef5e6);});};
\ No newline at end of file
index 50c1583..2b9d296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d93=['exports'];(function(_0x18e1b4,_0x2b31c1){var _0x390d5a=function(_0x49747e){while(--_0x49747e){_0x18e1b4['push'](_0x18e1b4['shift']());}};_0x390d5a(++_0x2b31c1);}(_0x0d93,0x64));var _0x30d9=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0x0d93[_0x57db49];return _0xd0636f;};'use strict';var asr=require('./lib/api');module[_0x30d9('0x0')]=function(_0x3e2bf2,_0x3d5d74,_0x117f7a,_0x31b8c4){return asr(_0x3e2bf2,_0x3d5d74,_0x117f7a,_0x31b8c4);};
\ No newline at end of file
+var _0xc8b1=['./lib/api'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0xc8b1,0x1d0));var _0x1c8b=function(_0x581973,_0x42751e){_0x581973=_0x581973-0x0;var _0x5444b5=_0xc8b1[_0x581973];return _0x5444b5;};'use strict';var asr=require(_0x1c8b('0x0'));module['exports']=function(_0xb404d5,_0x7af16d,_0x1ee898,_0x212c08){return asr(_0xb404d5,_0x7af16d,_0x1ee898,_0x212c08);};
\ No newline at end of file
index a77acd2..984f393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcec4=['likelihood','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','lodash','moment','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','digest','unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript'];(function(_0x3a56de,_0x27a2e2){var _0x7e0c76=function(_0x56c01b){while(--_0x56c01b){_0x3a56de['push'](_0x3a56de['shift']());}};_0x7e0c76(++_0x27a2e2);}(_0xcec4,0x91));var _0x4cec=function(_0x36d992,_0x3d93e9){_0x36d992=_0x36d992-0x0;var _0x5bd87f=_0xcec4[_0x36d992];return _0x5bd87f;};'use strict';var BPromise=require('bluebird');var _=require(_0x4cec('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4cec('0x1'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x4cec('0x2'));module[_0x4cec('0x3')]=function(_0x276af6,_0x1a6290,_0x5b2a78,_0xbdf997){return new BPromise(function(_0x253d4f,_0x4b9896){logger[_0x4cec('0x4')](_0x4cec('0x5'),_0xbdf997||_0x4cec('0x6'));var _0x3ce0a4=new WebSocket(_0xbdf997||_0x4cec('0x6'),{'perMessageDeflate':![]});var _0x1b668d='';var _0x40c2a9='0';var _0x3d8990='1';var _0x518209=_0x4cec('0x7');function _0x3973a5(_0x1ef50e){var _0x224a08=crypto[_0x4cec('0x8')]('sha1');_0x224a08['update'](_0x1ef50e);return _0x224a08[_0x4cec('0x9')]('hex');}function _0x1d1bad(){try{logger[_0x4cec('0x4')]('Open\x20Tilde\x20ASR\x20socket');var _0x165a2a=moment()[_0x4cec('0xa')]();var _0x4de1d8=_0x3973a5(_0x165a2a+_0x1a6290+_0x5b2a78);_0x3ce0a4[_0x4cec('0xb')](JSON[_0x4cec('0xc')]({'appID':_0x1a6290,'timestamp':_0x165a2a,'appKey':_0x4de1d8}));var _0x332c5e=fs[_0x4cec('0xd')](_0x276af6);_0x332c5e['on'](_0x4cec('0xe'),function(_0x28e4e6){_0x3ce0a4['send'](_0x28e4e6);});_0x332c5e['on'](_0x4cec('0xf'),function(){_0x3ce0a4[_0x4cec('0xb')]('EOS');});}catch(_0xfd33b9){logger[_0x4cec('0x10')](_0x4cec('0x11'),JSON[_0x4cec('0xc')](_0xfd33b9));_0x3ce0a4[_0x4cec('0x12')]();}}function _0x2d1311(_0x382874){try{if(_0x382874){var _0x49122e=JSON[_0x4cec('0x13')](_0x382874);switch(_0x49122e[_0x4cec('0x14')]){case 0x0:if(_0x49122e[_0x4cec('0x15')]){if(_0x49122e[_0x4cec('0x15')][_0x4cec('0x16')]){logger[_0x4cec('0x4')]('Tilde\x20ASR\x20hypoteses',JSON[_0x4cec('0xc')](_0x49122e[_0x4cec('0x15')][_0x4cec('0x17')]));_0x1b668d=_0x49122e[_0x4cec('0x15')][_0x4cec('0x17')][0x0][_0x4cec('0x18')];_0x40c2a9=_0x49122e[_0x4cec('0x15')][_0x4cec('0x17')][0x0][_0x4cec('0x19')];_0x3d8990='0';_0x518209='Success.';_0x3ce0a4['terminate']();}}break;case 0x1:logger[_0x4cec('0x4')](_0x4cec('0x7'));_0x3d8990='1';_0x518209=_0x4cec('0x7');break;case 0x2:logger[_0x4cec('0x4')](_0x4cec('0x1a'));_0x3d8990='2';_0x518209=_0x4cec('0x1a');break;case 0x9:logger[_0x4cec('0x4')](_0x4cec('0x1b'));_0x3d8990='9';_0x518209=_0x4cec('0x1b');break;case 0xa:logger[_0x4cec('0x4')](_0x4cec('0x1c'));_0x3d8990='10';_0x518209=_0x4cec('0x1c');break;case 0xb:logger[_0x4cec('0x4')](_0x4cec('0x1d'));_0x3d8990='11';_0x518209=_0x4cec('0x1d');}}}catch(_0x1b094b){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0x4cec('0xc')](_0x1b094b));_0x3ce0a4['terminate']();}}function _0x3e972e(){logger[_0x4cec('0x4')](_0x4cec('0x1e'));_0x253d4f({'transcript':_0x1b668d,'confidence':_0x40c2a9,'status':_0x3d8990,'status_message':_0x518209});}function _0x151776(_0xa9c8d2){logger[_0x4cec('0x10')](_0x4cec('0x1f'));if(!_['isNil'](_0xa9c8d2)){logger[_0x4cec('0x10')](_[_0x4cec('0x20')](_0xa9c8d2)?JSON[_0x4cec('0xc')](_0xa9c8d2):_0xa9c8d2);}}_0x3ce0a4['on'](_0x4cec('0x21'),_0x1d1bad);_0x3ce0a4['on']('message',_0x2d1311);_0x3ce0a4['on']('close',_0x3e972e);_0x3ce0a4['on'](_0x4cec('0x10'),_0x151776);});};
\ No newline at end of file
+var _0x4a79=['open','message','bluebird','moment','crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject'];(function(_0x2efbc8,_0x15bb5e){var _0x5f1621=function(_0x8117b8){while(--_0x8117b8){_0x2efbc8['push'](_0x2efbc8['shift']());}};_0x5f1621(++_0x15bb5e);}(_0x4a79,0x10c));var _0x94a7=function(_0x212b03,_0x1f1b50){_0x212b03=_0x212b03-0x0;var _0x423115=_0x4a79[_0x212b03];return _0x423115;};'use strict';var BPromise=require(_0x94a7('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x94a7('0x1'));var crypto=require(_0x94a7('0x2'));var logger=require(_0x94a7('0x3'))('agi');module[_0x94a7('0x4')]=function(_0xa1636c,_0x2ea01f,_0x25a834,_0x57114f){return new BPromise(function(_0x4a9340,_0x4333a9){logger[_0x94a7('0x5')]('Tilde\x20URI',_0x57114f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x1e96cb=new WebSocket(_0x57114f||_0x94a7('0x6'),{'perMessageDeflate':![]});var _0x4e1ca5='';var _0x5280e4='0';var _0x398ddf='1';var _0x2b29c3='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4d6171(_0x2a80dd){var _0x429ae4=crypto[_0x94a7('0x7')]('sha1');_0x429ae4['update'](_0x2a80dd);return _0x429ae4['digest'](_0x94a7('0x8'));}function _0x2f4a86(){try{logger[_0x94a7('0x5')](_0x94a7('0x9'));var _0x3a6f23=moment()[_0x94a7('0xa')]();var _0x181dcf=_0x4d6171(_0x3a6f23+_0x2ea01f+_0x25a834);_0x1e96cb['send'](JSON[_0x94a7('0xb')]({'appID':_0x2ea01f,'timestamp':_0x3a6f23,'appKey':_0x181dcf}));var _0x12982d=fs[_0x94a7('0xc')](_0xa1636c);_0x12982d['on'](_0x94a7('0xd'),function(_0x2e58a1){_0x1e96cb[_0x94a7('0xe')](_0x2e58a1);});_0x12982d['on'](_0x94a7('0xf'),function(){_0x1e96cb[_0x94a7('0xe')](_0x94a7('0x10'));});}catch(_0x541c93){logger[_0x94a7('0x11')](_0x94a7('0x12'),JSON['stringify'](_0x541c93));_0x1e96cb[_0x94a7('0x13')]();}}function _0x54056e(_0x727ea){try{if(_0x727ea){var _0x301b4c=JSON[_0x94a7('0x14')](_0x727ea);switch(_0x301b4c[_0x94a7('0x15')]){case 0x0:if(_0x301b4c[_0x94a7('0x16')]){if(_0x301b4c[_0x94a7('0x16')]['final']){logger[_0x94a7('0x5')](_0x94a7('0x17'),JSON['stringify'](_0x301b4c['result']['hypotheses']));_0x4e1ca5=_0x301b4c[_0x94a7('0x16')][_0x94a7('0x18')][0x0]['transcript'];_0x5280e4=_0x301b4c[_0x94a7('0x16')][_0x94a7('0x18')][0x0][_0x94a7('0x19')];_0x398ddf='0';_0x2b29c3=_0x94a7('0x1a');_0x1e96cb[_0x94a7('0x13')]();}}break;case 0x1:logger[_0x94a7('0x5')](_0x94a7('0x1b'));_0x398ddf='1';_0x2b29c3=_0x94a7('0x1b');break;case 0x2:logger['info'](_0x94a7('0x1c'));_0x398ddf='2';_0x2b29c3='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x94a7('0x5')](_0x94a7('0x1d'));_0x398ddf='9';_0x2b29c3='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x94a7('0x5')](_0x94a7('0x1e'));_0x398ddf='10';_0x2b29c3=_0x94a7('0x1e');break;case 0xb:logger[_0x94a7('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x398ddf='11';_0x2b29c3=_0x94a7('0x1f');}}}catch(_0x6424bf){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x6424bf));_0x1e96cb[_0x94a7('0x13')]();}}function _0x100bd7(){logger[_0x94a7('0x5')](_0x94a7('0x20'));_0x4a9340({'transcript':_0x4e1ca5,'confidence':_0x5280e4,'status':_0x398ddf,'status_message':_0x2b29c3});}function _0x47f34f(_0x456aa8){logger[_0x94a7('0x11')](_0x94a7('0x21'));if(!_[_0x94a7('0x22')](_0x456aa8)){logger['error'](_[_0x94a7('0x23')](_0x456aa8)?JSON[_0x94a7('0xb')](_0x456aa8):_0x456aa8);}}_0x1e96cb['on'](_0x94a7('0x24'),_0x2f4a86);_0x1e96cb['on'](_0x94a7('0x25'),_0x54056e);_0x1e96cb['on'](_0x94a7('0xf'),_0x100bd7);_0x1e96cb['on'](_0x94a7('0x11'),_0x47f34f);});};
\ No newline at end of file
index e2443cc..ae27eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddb4=['./asr'];(function(_0x1bb5e2,_0x2bae82){var _0xd8fcc1=function(_0x25338e){while(--_0x25338e){_0x1bb5e2['push'](_0x1bb5e2['shift']());}};_0xd8fcc1(++_0x2bae82);}(_0xddb4,0x8f));var _0x4ddb=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0xddb4[_0x1b95a1];return _0x57aef1;};var asr=require(_0x4ddb('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0xfc79=['exports','./asr'];(function(_0xebf36a,_0x409910){var _0x2bdc5c=function(_0x38ea90){while(--_0x38ea90){_0xebf36a['push'](_0xebf36a['shift']());}};_0x2bdc5c(++_0x409910);}(_0xfc79,0x1e1));var _0x9fc7=function(_0x117113,_0x1a4d9d){_0x117113=_0x117113-0x0;var _0x32264d=_0xfc79[_0x117113];return _0x32264d;};var asr=require(_0x9fc7('0x0'));module[_0x9fc7('0x1')]={'asr':asr};
\ No newline at end of file
index 99b0277..394b03b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c1a=['util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','emit','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','exports'];(function(_0x1b2230,_0x49b7e4){var _0x55ba0f=function(_0x19281b){while(--_0x19281b){_0x1b2230['push'](_0x1b2230['shift']());}};_0x55ba0f(++_0x49b7e4);}(_0x2c1a,0x168));var _0xa2c1=function(_0x3cb249,_0x1723ea){_0x3cb249=_0x3cb249-0x0;var _0x397ac9=_0x2c1a[_0x3cb249];return _0x397ac9;};'use strict';var util=require(_0xa2c1('0x0'));var net=require(_0xa2c1('0x1'));var EventEmitter=require(_0xa2c1('0x2'))[_0xa2c1('0x3')];var AGIError=require(_0xa2c1('0x4'));var AGIChannel=require(_0xa2c1('0x5'));var AGIServer=function(_0x14a5ce,_0xe6aada,_0x2aa478){var _0x2eba2f=this,_0x14a5ce=_0x14a5ce||0x11dd,_0xe6aada=_0xe6aada||_0xa2c1('0x6'),_0x11c65f=null,_0x527f65=0x0;EventEmitter[_0xa2c1('0x7')](_0x2eba2f);function _0x14efa5(){if(!_0x14a5ce){_0x2eba2f['emit'](_0xa2c1('0x8'),new AGIError(_0xa2c1('0x9')));return![];}_0x11c65f=net[_0xa2c1('0xa')]();_0x11c65f[_0xa2c1('0xb')](_0x14a5ce,_0xe6aada);_0x11c65f['on']('listening',function(){_0x2eba2f[_0xa2c1('0xc')](_0xa2c1('0xd'));});_0x11c65f['on'](_0xa2c1('0xe'),function(_0xde29d9){_0x11c65f[_0xa2c1('0xf')](function(_0xd30d1b,_0x521af9){if(_0xd30d1b){_0x2eba2f[_0xa2c1('0xc')](_0xa2c1('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0xd30d1b));}else if(_0x2aa478&&_0x2aa478<0x0){_0x2eba2f[_0xa2c1('0xc')](_0xa2c1('0x8'),new AGIError(_0xa2c1('0x10')));_0xde29d9[_0xa2c1('0x11')]();}else if(_0x2aa478&&_0x2aa478>0x0&&_0x2aa478<_0x521af9){_0x527f65+=0x1;_0x2eba2f['emit'](_0xa2c1('0x8'),new AGIError(_0xa2c1('0x12'),_0x527f65));_0xde29d9[_0xa2c1('0x11')]();}else{var _0x1cf095=new AGIChannel(_0xde29d9);_0x1cf095['on'](_0xa2c1('0x13'),function(){_0x2eba2f[_0xa2c1('0xc')](_0xa2c1('0xe'),_0x1cf095);});}});});_0x11c65f['on'](_0xa2c1('0x8'),function(_0x183b9f){_0x2eba2f[_0xa2c1('0xc')](_0xa2c1('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x183b9f['code']));});_0x11c65f['on']('close',function(){_0x2eba2f[_0xa2c1('0xc')](_0xa2c1('0x14'),new AGIError(_0xa2c1('0x15')));});}process[_0xa2c1('0x16')](function(){_0x14efa5();});};util['inherits'](AGIServer,EventEmitter);module[_0xa2c1('0x17')]=function(_0x369b7b,_0x2c8815,_0x5d3ee6){return new AGIServer(_0x369b7b,_0x2c8815,_0x5d3ee6);};
\ No newline at end of file
+var _0x927e=['./error','127.0.0.1','emit','E_AGI_ARGUMENT_PORT','createServer','listening','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x927e,0xcb));var _0xe927=function(_0x27d020,_0x3e50af){_0x27d020=_0x27d020-0x0;var _0x14a24b=_0x927e[_0x27d020];return _0x14a24b;};'use strict';var util=require(_0xe927('0x0'));var net=require(_0xe927('0x1'));var EventEmitter=require(_0xe927('0x2'))[_0xe927('0x3')];var AGIError=require(_0xe927('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x3264b2,_0x187d56,_0x1e8581){var _0x432e04=this,_0x3264b2=_0x3264b2||0x11dd,_0x187d56=_0x187d56||_0xe927('0x5'),_0x40796f=null,_0x57ffba=0x0;EventEmitter['call'](_0x432e04);function _0x445312(){if(!_0x3264b2){_0x432e04[_0xe927('0x6')]('error',new AGIError(_0xe927('0x7')));return![];}_0x40796f=net[_0xe927('0x8')]();_0x40796f['listen'](_0x3264b2,_0x187d56);_0x40796f['on']('listening',function(){_0x432e04[_0xe927('0x6')](_0xe927('0x9'));});_0x40796f['on']('connection',function(_0x23dd5c){_0x40796f[_0xe927('0xa')](function(_0x15f339,_0x390fe3){if(_0x15f339){_0x432e04[_0xe927('0x6')](_0xe927('0xb'),new AGIError(_0xe927('0xc'),_0x15f339));}else if(_0x1e8581&&_0x1e8581<0x0){_0x432e04[_0xe927('0x6')](_0xe927('0xb'),new AGIError(_0xe927('0xd')));_0x23dd5c[_0xe927('0xe')]();}else if(_0x1e8581&&_0x1e8581>0x0&&_0x1e8581<_0x390fe3){_0x57ffba+=0x1;_0x432e04[_0xe927('0x6')](_0xe927('0xb'),new AGIError(_0xe927('0xf'),_0x57ffba));_0x23dd5c['destroy']();}else{var _0x4d394d=new AGIChannel(_0x23dd5c);_0x4d394d['on'](_0xe927('0x10'),function(){_0x432e04[_0xe927('0x6')](_0xe927('0x11'),_0x4d394d);});}});});_0x40796f['on'](_0xe927('0xb'),function(_0x533d80){_0x432e04[_0xe927('0x6')](_0xe927('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x533d80[_0xe927('0x12')]));});_0x40796f['on'](_0xe927('0x13'),function(){_0x432e04[_0xe927('0x6')](_0xe927('0x13'),new AGIError(_0xe927('0x14')));});}process[_0xe927('0x15')](function(){_0x445312();});};util['inherits'](AGIServer,EventEmitter);module[_0xe927('0x16')]=function(_0x2022da,_0x551d58,_0x37ddc7){return new AGIServer(_0x2022da,_0x551d58,_0x37ddc7);};
\ No newline at end of file
index f7f440c..cbe6d08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c28=['lodash','shelljs','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','getVoiceQueueById','catch','getSquareProject','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','dnid','file','createSquareMessage','createCmContact','random','isEmpty','lastName','isNil','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','PUT','toUpperCase','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','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','format','setVariable','%s.%s','split','replaceAll','getVariable','extra','result','info','retry','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','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','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','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','unlink','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','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','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','tildeASR','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','false','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','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','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','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','email','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x8c28,0x1c8));var _0x88c2=function(_0x3c731a,_0x536fc4){_0x3c731a=_0x3c731a-0x0;var _0x1cf916=_0x8c28[_0x3c731a];return _0x1cf916;};'use strict';var fs=require('fs');var path=require(_0x88c2('0x0'));var util=require(_0x88c2('0x1'));var _=require(_0x88c2('0x2'));var sh=require(_0x88c2('0x3'));var odbc=require('odbc')();var rs=require(_0x88c2('0x4'));var moment=require(_0x88c2('0x5'));var Mustache=require('mustache');var rp=require(_0x88c2('0x6'));var logger=require(_0x88c2('0x7'))(_0x88c2('0x8'));var config=require(_0x88c2('0x9'));var scripts=require(_0x88c2('0xa'));var FILES_PATH=_0x88c2('0xb');var recursiveMapAttributes=['rawHeaders',_0x88c2('0xc')];var verticesWithRetry=[_0x88c2('0xd'),_0x88c2('0xe'),_0x88c2('0xf')];var AGIVertices=function(_0x1896d6,_0x17d5ba,_0x350ba6){this[_0x88c2('0x10')]=_0x1896d6;this[_0x88c2('0x11')]=_0x17d5ba;this[_0x88c2('0x12')]=_0x350ba6;};AGIVertices[_0x88c2('0x13')]['getVariable']=function(_0x271ad3,_0x4ad278){this[_0x88c2('0x11')][_0x88c2('0x14')](_0x271ad3)[_0x88c2('0x15')](function(_0x31053e){_0x4ad278(null,_0x31053e?_0x31053e[_0x88c2('0x16')]:![]);})['catch'](function(_0x135354){_0x4ad278(_0x135354);});};AGIVertices[_0x88c2('0x13')]['getVoiceQueue']=function(_0x2465c5,_0xd8d181){this[_0x88c2('0x11')][_0x88c2('0x17')](_0x2465c5)[_0x88c2('0x15')](function(_0x3def84){_0xd8d181(null,_0x3def84?_0x3def84['name']:![]);})[_0x88c2('0x18')](function(_0x3eebc2){_0xd8d181(_0x3eebc2);});};AGIVertices['prototype'][_0x88c2('0x19')]=function(_0xf5bc9b,_0x46f0f4){this[_0x88c2('0x11')]['getSquareProjectById'](_0xf5bc9b)[_0x88c2('0x15')](function(_0x43943e){_0x46f0f4(null,_0x43943e?_0x43943e[_0x88c2('0x16')]:![]);})[_0x88c2('0x18')](function(_0xc1a91a){_0x46f0f4(_0xc1a91a);});};AGIVertices[_0x88c2('0x13')]['getSquareOdbc']=function(_0x430e70,_0xc5f0ab){this[_0x88c2('0x11')][_0x88c2('0x1a')](_0x430e70)[_0x88c2('0x15')](function(_0x25e651){_0xc5f0ab(null,_0x25e651?_0x25e651['dsn']:![]);})[_0x88c2('0x18')](function(_0x43b910){_0xc5f0ab(_0x43b910);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1b')]=function(_0x51ba9f,_0x1b1a4f){this[_0x88c2('0x11')][_0x88c2('0x1c')](_0x51ba9f)[_0x88c2('0x15')](function(_0x5aa6e4){_0x1b1a4f(null,_0x5aa6e4?_0x5aa6e4[_0x88c2('0x16')]:![]);})[_0x88c2('0x18')](function(_0x5c82b1){_0x1b1a4f(_0x5c82b1);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1d')]=function(_0x1c3a48,_0x50eabb){this[_0x88c2('0x11')][_0x88c2('0x1e')](_0x1c3a48)[_0x88c2('0x15')](function(_0x37f725){_0x50eabb(null,_0x37f725?_0x37f725[_0x88c2('0x16')]:![]);})[_0x88c2('0x18')](function(_0x3b049e){_0x50eabb(_0x3b049e);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1f')]=function(_0xb8718a,_0x379dac){var _0x18e3f4=this;this[_0x88c2('0x11')][_0x88c2('0x20')](_0xb8718a)[_0x88c2('0x15')](function(_0x157bc8){_0x379dac(null,_0x157bc8?_0x18e3f4[_0x88c2('0x21')](_0x157bc8[_0x88c2('0x22')]):![]);})[_0x88c2('0x18')](function(_0x3e00f9){_0x379dac(_0x3e00f9);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x23')]=function(_0x92cbad,_0x5e3ea6){this[_0x88c2('0x11')]['getMailAccountById'](_0x92cbad)[_0x88c2('0x15')](function(_0x4fb2cf){_0x5e3ea6(null,_0x4fb2cf?_0x4fb2cf:![]);})[_0x88c2('0x18')](function(_0x3abbfd){_0x5e3ea6(_0x3abbfd);});};AGIVertices[_0x88c2('0x13')]['sendMailMessage']=function(_0x526b79,_0x1a3841,_0x500f7b){this[_0x88c2('0x12')][_0x88c2('0x24')](_0x526b79,_0x1a3841)[_0x88c2('0x15')](function(){_0x500f7b(null);})[_0x88c2('0x18')](function(_0x47c11b){_0x500f7b(_0x47c11b);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x25')]=function(_0x29c7b8,_0x25532d){this[_0x88c2('0x11')][_0x88c2('0x26')](_0x29c7b8)[_0x88c2('0x15')](function(_0x3e8638){if(_0x3e8638){if(_0x3e8638[_0x88c2('0x27')]){_0x25532d(null,[_0x3e8638[_0x88c2('0x28')]]);}else{_0x25532d(null,_[_0x88c2('0x29')](_0x3e8638[_0x88c2('0x2a')],_0x88c2('0x28')));}}else{_0x25532d(null,![]);}})[_0x88c2('0x18')](function(_0x3aa4f4){_0x25532d(_0x3aa4f4);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x21')]=function(_0x12511b){return util['format'](_0x88c2('0x2b'),FILES_PATH,_0x12511b);};AGIVertices[_0x88c2('0x13')][_0x88c2('0x2c')]=function(_0x1c7803,_0x2c23ee,_0x86fc9b){odbc[_0x88c2('0x2d')](_0x1c7803,function(_0x3596f6){if(_0x3596f6){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x3596f6);_0x86fc9b(_0x3596f6);}else{logger['info'](_0x88c2('0x2e'));odbc[_0x88c2('0x2f')](_0x2c23ee,function(_0x4d178d,_0x5e8b4a){if(_0x4d178d){logger['info'](_0x88c2('0x30'),_0x2c23ee);_0x86fc9b(_0x4d178d);}else{logger['info'](_0x88c2('0x31'),_0x2c23ee);odbc[_0x88c2('0x32')](function(_0x537e15){if(_0x537e15){logger[_0x88c2('0x33')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x537e15);}_0x86fc9b(null,_0x5e8b4a);});}});}});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x34')]=function(_0x3a7a4b,_0x15c683){this[_0x88c2('0x11')]['getSmsAccountById'](_0x3a7a4b)[_0x88c2('0x15')](function(_0x469bcb){_0x15c683(null,_0x469bcb?_0x469bcb:![]);})[_0x88c2('0x18')](function(_0x37bb28){_0x15c683(_0x37bb28);});};AGIVertices['prototype']['createSmsMessage']=function(_0x5cef38,_0x6d3431){this[_0x88c2('0x11')][_0x88c2('0x35')](_0x5cef38)['then'](function(_0x43910e){_0x6d3431(null,_0x43910e);})['catch'](function(_0x110a3c){_0x6d3431(_0x110a3c);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x36')]=function(_0x2b06ef,_0x2de62a,_0x493731){this[_0x88c2('0x11')][_0x88c2('0x36')]({'uniqueid':this[_0x88c2('0x10')]['uniqueid'],'node':_0x2b06ef[_0x88c2('0x37')],'application':_0x2b06ef['agicommand'],'data':_0x2de62a||null,'project_name':this[_0x88c2('0x10')][_0x88c2('0x38')],'callerid':this[_0x88c2('0x10')][_0x88c2('0x39')]})[_0x88c2('0x15')](function(_0x52bc8e){if(_0x493731){_0x493731(null,_0x52bc8e);}})[_0x88c2('0x18')](function(_0x35be81){if(_0x493731){_0x493731(_0x35be81);}});};AGIVertices['prototype'][_0x88c2('0x3a')]=function(_0x1cb1db,_0x44268a,_0x45a852,_0x254652){this['rpc'][_0x88c2('0x3a')]({'uniqueid':this[_0x88c2('0x10')][_0x88c2('0x3b')],'callerid':this['channel'][_0x88c2('0x39')],'calleridname':this[_0x88c2('0x10')][_0x88c2('0x3c')],'context':this[_0x88c2('0x10')][_0x88c2('0x3d')],'extension':this[_0x88c2('0x10')]['extension'],'priority':this[_0x88c2('0x10')]['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0x88c2('0x10')][_0x88c2('0x3e')],'projectName':this[_0x88c2('0x10')][_0x88c2('0x38')],'saveName':_0x44268a,'filename':_0x1cb1db[_0x88c2('0x3f')]||_0x44268a,'savePath':_0x45a852})[_0x88c2('0x15')](function(_0x4d900f){_0x254652(null,_0x4d900f);})[_0x88c2('0x18')](function(_0x48d9d6){_0x254652(_0x48d9d6);});};AGIVertices['prototype'][_0x88c2('0x40')]=function(_0x229a88,_0x5457dc,_0x3c20a1,_0xc190e3,_0xbf5ba7){this[_0x88c2('0x11')][_0x88c2('0x40')]({'uniqueid':this[_0x88c2('0x10')][_0x88c2('0x3b')],'body':_0x229a88,'direction':_0x5457dc,'providerName':_0x3c20a1,'providerResponse':_0xc190e3})['then'](function(_0x195286){if(_0xbf5ba7){_0xbf5ba7(null,_0x195286);}})[_0x88c2('0x18')](function(_0x1d0a65){if(_0xbf5ba7){_0xbf5ba7(_0x1d0a65);}});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x41')]=function(_0x5e3d90,_0x5ca0fe){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x5e3d90[_0x88c2('0x16')])||_['isNil'](_0x5e3d90[_0x88c2('0x16')])?'callback_'+Math[_0x88c2('0x42')]():_0x5e3d90[_0x88c2('0x16')],'lastName':_[_0x88c2('0x43')](_0x5e3d90[_0x88c2('0x44')])||_[_0x88c2('0x45')](_0x5e3d90['lastName'])?null:_0x5e3d90[_0x88c2('0x44')],'phone':_0x5e3d90[_0x88c2('0x46')],'ListId':_0x5e3d90[_0x88c2('0x47')],'scheduledat':_0x5e3d90[_0x88c2('0x48')],'callbackUniqueid':this[_0x88c2('0x10')][_0x88c2('0x3b')],'tags':_0x88c2('0x49'),'description':_0x88c2('0x4a')+_0x5e3d90[_0x88c2('0x48')][_0x88c2('0x4b')](),'priority':_0x5e3d90[_0x88c2('0x4c')]})[_0x88c2('0x15')](function(_0x2257ba){_0x5ca0fe(null,_0x2257ba);})[_0x88c2('0x18')](function(_0x5c2a76){_0x5ca0fe(_0x5c2a76);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x4d')]=function(_0x3af3a0,_0xe9cac2){this[_0x88c2('0x11')][_0x88c2('0x4e')](_0x3af3a0)['then'](function(_0x2a03e8){_0xe9cac2(null,_0x2a03e8?_0x2a03e8[_0x88c2('0x16')]:![]);})['catch'](function(_0x6f31d0){_0xe9cac2(_0x6f31d0);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x4f')]=function(_0x298fe2,_0x4ef1e5,_0x5ad859){var _0x56ebcb={'role':_0x88c2('0x50')};_0x56ebcb[_0x298fe2]=this[_0x88c2('0x10')][_0x88c2('0x39')];this[_0x88c2('0x11')]['agentPause'](_0x56ebcb,_0x4ef1e5,this[_0x88c2('0x10')][_0x88c2('0x3b')])['then'](function(_0x24596a){_0x5ad859(null,_['isNil'](_0x24596a)?![]:!![]);})['catch'](function(_0x308631){logger[_0x88c2('0x33')](_0x308631);_0x5ad859(null,![]);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x51')]=function(_0x5de638,_0x21b94c){var _0x1eea29={'role':_0x88c2('0x50')};_0x1eea29[_0x5de638]=this['channel'][_0x88c2('0x39')];this[_0x88c2('0x11')][_0x88c2('0x51')](_0x1eea29)[_0x88c2('0x15')](function(_0x17e521){_0x21b94c(null,_[_0x88c2('0x45')](_0x17e521)?![]:!![]);})[_0x88c2('0x18')](function(_0x555376){logger[_0x88c2('0x33')](_0x555376);_0x21b94c(null,![]);});};AGIVertices['prototype'][_0x88c2('0x52')]=function(_0x44c31a,_0x5a574e){var _0x2d54eb={'role':_0x88c2('0x50')};_0x2d54eb[_0x44c31a]=this['channel'][_0x88c2('0x39')];this[_0x88c2('0x11')][_0x88c2('0x52')](_0x2d54eb)[_0x88c2('0x15')](function(_0x331930){_0x5a574e(null,_[_0x88c2('0x45')](_0x331930)?![]:!![]);})[_0x88c2('0x18')](function(_0x1656e4){logger['error'](_0x1656e4);_0x5a574e(null,![]);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x53')]=function(_0x533b83,_0x15ab33){var _0x54102a={'role':'agent'};_0x54102a[_0x533b83]=this[_0x88c2('0x10')][_0x88c2('0x39')];var _0x272ec7=_0x533b83!='internal'?util['format'](_0x88c2('0x54'),_0x88c2('0x55'),this[_0x88c2('0x10')]['callerid']):undefined;this[_0x88c2('0x11')][_0x88c2('0x53')](_0x54102a,_0x272ec7)[_0x88c2('0x15')](function(_0x218881){_0x15ab33(null,_[_0x88c2('0x45')](_0x218881)?![]:!![]);})[_0x88c2('0x18')](function(_0x1c27da){logger[_0x88c2('0x33')](_0x1c27da);_0x15ab33(null,![]);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x56')]=function(_0x32d0c1,_0x27ef7e){sh[_0x88c2('0x57')](_[_0x88c2('0x58')](_0x32d0c1),function(_0x49ed5d,_0x55ee96){var _0x306570=_0x55ee96[_0x88c2('0x59')](/(\r\n|\n|\r)/gm,'');_0x27ef7e(null,_0x306570);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x5a')]=function(_0x597181,_0x4e6627){scripts[_0x88c2('0x5a')](_0x597181[_0x88c2('0x5b')],_0x597181['google_cloud_tts_text_type']||_0x88c2('0x5c'),_0x597181[_0x88c2('0x5c')],_0x597181[_0x88c2('0x5d')]||_0x88c2('0x5e'),_0x597181[_0x88c2('0x5f')]||_0x88c2('0x60'),_0x597181[_0x88c2('0x61')]||_0x88c2('0x62'))['then'](function(_0x289ee1){_0x4e6627(null,_0x289ee1);})[_0x88c2('0x18')](function(_0x1bcc21){_0x4e6627(_0x1bcc21);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x63')]=function(_0x7a4b50,_0x10aaf6){scripts['googleTTS'](_0x7a4b50[_0x88c2('0x5c')],_0x7a4b50[_0x88c2('0x64')]||'en',0x1)[_0x88c2('0x15')](function(_0x56f017){_0x10aaf6(null,_0x56f017);})[_0x88c2('0x18')](function(_0x31124f){_0x10aaf6(_0x31124f);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x65')]=function(_0x495f05,_0x2096bb){var _0x59f466={'uri':_0x495f05['url'],'method':_0x495f05[_0x88c2('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x495f05[_0x88c2('0x67')])===_0x88c2('0x68')&&parseInt(_0x495f05[_0x88c2('0x67')])>=0x1?parseInt(_0x495f05[_0x88c2('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x88c2('0x69')]([_0x88c2('0x6a'),_0x88c2('0x6b')],_0x59f466[_0x88c2('0x66')][_0x88c2('0x6c')]())){try{_0x59f466[_0x88c2('0x6d')]=_0x495f05[_0x88c2('0xc')]?JSON[_0x88c2('0x6e')](_0x495f05[_0x88c2('0xc')]):{};}catch(_0x5162da){logger[_0x88c2('0x33')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5162da);}}try{_0x59f466[_0x88c2('0x6f')]=_0x495f05[_0x88c2('0x70')]?JSON['parse'](_0x495f05[_0x88c2('0x70')]):{};}catch(_0x2d4f31){logger[_0x88c2('0x33')](_0x88c2('0x71'),_0x2d4f31);}if(_0x495f05[_0x88c2('0x72')]){try{var _0x515d3c=require(_0x495f05['computedVariables'])[_0x88c2('0x73')](this,_0x59f466);_0x59f466[_0x88c2('0x74')]=Mustache[_0x88c2('0x75')](_0x495f05[_0x88c2('0x76')],_0x515d3c,{},['$$','$$']);if(_0x59f466[_0x88c2('0x6f')]){_0x59f466[_0x88c2('0x6f')]=JSON[_0x88c2('0x6e')](Mustache[_0x88c2('0x75')](JSON[_0x88c2('0x77')](_0x59f466[_0x88c2('0x6f')]),_0x515d3c,{},['$$','$$']));}if(_0x59f466[_0x88c2('0x6d')]){_0x59f466['body']=JSON['parse'](Mustache['render'](JSON[_0x88c2('0x77')](_0x59f466[_0x88c2('0x6d')]),_0x515d3c,{},['$$','$$']));}}catch(_0x5dff85){logger['error'](_0x88c2('0x78'),_0x5dff85);}}rp(_0x59f466)[_0x88c2('0x15')](function(_0x1b1439){var _0xaaf13b={'statusCode':_0x1b1439[_0x88c2('0x79')]||0xc8,'statusMessage':_0x1b1439['statusMessage']||'OK','headers':_0x1b1439[_0x88c2('0x6f')]||{},'body':_0x1b1439['body']||{}};_0x2096bb(null,_0xaaf13b);})[_0x88c2('0x18')](function(_0x4ca063){var _0x535254={'statusCode':_0x4ca063[_0x88c2('0x79')]||0x1f4,'statusMessage':_0x4ca063[_0x88c2('0x7a')]||_0x88c2('0x7b'),'headers':_0x4ca063[_0x88c2('0x7c')]['headers']||{},'body':_0x4ca063[_0x88c2('0x7c')]['body']||{}};_0x2096bb(null,_0x535254);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x7d')]=function(_0x4fda2f,_0x2b4b15){scripts['googleDialogflow'](this['channel'][_0x88c2('0x3b')],_0x4fda2f[_0x88c2('0x7e')],_0x4fda2f[_0x88c2('0x5c')],_0x4fda2f[_0x88c2('0x7f')]||'en')[_0x88c2('0x15')](function(_0x3ab3f9){_0x2b4b15(null,_0x3ab3f9);})[_0x88c2('0x18')](function(_0x35a2aa){_0x2b4b15(_0x35a2aa);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x80')]=function(_0x19195d,_0x457894){scripts[_0x88c2('0x80')](this['channel'][_0x88c2('0x3b')],_0x19195d[_0x88c2('0x81')],_0x19195d[_0x88c2('0x82')],_0x19195d[_0x88c2('0x83')],_0x19195d['text'],_0x19195d[_0x88c2('0x84')]||'en')[_0x88c2('0x15')](function(_0x3738a2){_0x457894(null,_0x3738a2);})[_0x88c2('0x18')](function(_0x35f63a){_0x457894(_0x35f63a);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x85')]=function(_0x551af0,_0x25201b){scripts[_0x88c2('0x85')](this[_0x88c2('0x10')],_0x551af0)['then'](function(_0x3cb683){_0x25201b(null,_0x3cb683);})['catch'](function(_0x113ccc){_0x25201b(_0x113ccc);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x86')]=function(_0x94b6b0,_0x10d209){scripts['ispeechTTS'](_0x94b6b0[_0x88c2('0x7e')],_0x94b6b0[_0x88c2('0x5c')],_0x94b6b0[_0x88c2('0x87')]||_0x88c2('0x5e'),_0x94b6b0['speed'])[_0x88c2('0x15')](function(_0x22b108){_0x10d209(null,_0x22b108);})[_0x88c2('0x18')](function(_0x54a455){_0x10d209(_0x54a455);});};AGIVertices['prototype'][_0x88c2('0x88')]=function(_0x1bdeee,_0x343df0,_0x49f763){scripts[_0x88c2('0x88')](_0x343df0,_0x1bdeee[_0x88c2('0x7e')],_0x1bdeee[_0x88c2('0x89')]||'en-US',this[_0x88c2('0x8a')](_0x1bdeee['model'])?_0x1bdeee[_0x88c2('0x8b')]:undefined)[_0x88c2('0x15')](function(_0x557b81){_0x49f763(null,_0x557b81);})[_0x88c2('0x18')](function(_0x44fc2f){_0x49f763(_0x44fc2f);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x8c')]=function(_0x4b4cb8,_0x3e617a){scripts[_0x88c2('0x8c')](_0x4b4cb8[_0x88c2('0x8d')],_0x4b4cb8['aws_secret_access_key'],_0x4b4cb8[_0x88c2('0x8e')],_0x4b4cb8[_0x88c2('0x8f')]||'Amy',_0x4b4cb8[_0x88c2('0x5c')],_0x4b4cb8[_0x88c2('0x90')]||_0x88c2('0x5c'))['then'](function(_0xd1d0c0){_0x3e617a(null,_0xd1d0c0);})['catch'](function(_0x14951f){_0x3e617a(_0x14951f);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x91')]=function(_0xe51122,_0x407a10){scripts['awsLex'](this[_0x88c2('0x10')][_0x88c2('0x3b')],_0xe51122[_0x88c2('0x8d')],_0xe51122[_0x88c2('0x92')],_0xe51122[_0x88c2('0x93')],_0xe51122[_0x88c2('0x5c')],_0xe51122[_0x88c2('0x94')])[_0x88c2('0x15')](function(_0x2d00ba){_0x407a10(null,_0x2d00ba);})[_0x88c2('0x18')](function(_0x3581d1){_0x407a10(_0x3581d1);});};AGIVertices[_0x88c2('0x13')][_0x88c2('0x95')]=function(_0x4d0e8c,_0x2f1f66,_0x3c604e){scripts['googleASR'](_0x2f1f66,_0x4d0e8c['key'],_0x4d0e8c[_0x88c2('0x96')]||_0x88c2('0x5e'))[_0x88c2('0x15')](function(_0xa290f1){_0x3c604e(null,_0xa290f1);})[_0x88c2('0x18')](function(_0x2e1982){_0x3c604e(_0x2e1982);});};AGIVertices[_0x88c2('0x13')]['tildeASR']=function(_0x299818,_0x9565c9,_0x2dc5f5){scripts['tildeASR'](_0x9565c9,_0x299818[_0x88c2('0x97')],_0x299818[_0x88c2('0x98')],_0x299818[_0x88c2('0x74')])[_0x88c2('0x15')](function(_0x38326c){_0x2dc5f5(null,_0x38326c);})[_0x88c2('0x18')](function(_0x745548){_0x2dc5f5(_0x745548);});};AGIVertices['prototype']['clear']=function(_0x5c1cf3){var _0x27b8c2=_['includes'](verticesWithRetry,_0x5c1cf3['agicommand'])?_0x5c1cf3:_[_0x88c2('0x99')](_0x5c1cf3);for(var _0x137bb6 in _0x27b8c2){if(_0x27b8c2[_0x88c2('0x9a')](_0x137bb6)){if(_0x27b8c2[_0x137bb6]&&_[_0x88c2('0x9b')](_0x27b8c2[_0x137bb6])){if(_[_0x88c2('0x69')](recursiveMapAttributes,_0x137bb6)){_0x27b8c2[_0x137bb6]=this[_0x88c2('0x9c')](_0x27b8c2[_0x137bb6]);}else{_0x27b8c2[_0x137bb6]=this[_0x88c2('0x9d')](_0x27b8c2[_0x137bb6]);}}}}return _0x27b8c2;};AGIVertices[_0x88c2('0x13')][_0x88c2('0x9e')]=function(_0x16608e){for(var _0x46f437 in _0x16608e){if(_0x16608e['hasOwnProperty'](_0x46f437)){if(_[_0x88c2('0x9f')](_0x16608e[_0x46f437])){this[_0x88c2('0x9e')](_0x16608e[_0x46f437]);}else if(_[_0x88c2('0xa0')](_0x16608e[_0x46f437])){for(var _0x20d299=0x0;_0x20d299<_0x16608e[_0x46f437][_0x88c2('0xa1')];_0x20d299++){this[_0x88c2('0x9e')](_0x16608e[_0x46f437][_0x20d299]);}}else if(_['isString'](_0x16608e[_0x46f437])){_0x16608e[_0x46f437]=this[_0x88c2('0x9d')](_0x16608e[_0x46f437]);}}}};AGIVertices[_0x88c2('0x13')][_0x88c2('0xa2')]=function(_0x191c07,_0xc9226c){for(var _0x16a45f in _0x191c07){if(_0x191c07['hasOwnProperty'](_0x16a45f)){if(_['isPlainObject'](_0x191c07[_0x16a45f])){if(!_[_0x88c2('0x43')](_0x191c07[_0x16a45f])){this[_0x88c2('0xa2')](_0x191c07[_0x16a45f],util[_0x88c2('0xa3')]('%s.%s',_0xc9226c,_0x16a45f));}}else if(_[_0x88c2('0xa0')](_0x191c07[_0x16a45f])){for(var _0x21b3c7=0x0;_0x21b3c7<_0x191c07[_0x16a45f][_0x88c2('0xa1')];_0x21b3c7++){this[_0x88c2('0xa2')](_0x191c07[_0x16a45f][_0x21b3c7],util[_0x88c2('0xa3')]('%s.%s',_0xc9226c,_0x16a45f+'['+_0x21b3c7+']'));}}else{if(!_[_0x88c2('0x45')](_0x191c07[_0x16a45f])){this[_0x88c2('0x10')][_0x88c2('0xa4')](util[_0x88c2('0xa3')](_0x88c2('0xa5'),_0xc9226c,_0x16a45f),_0x191c07[_0x16a45f]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x206486){try{var _0x20d11f=JSON['parse'](_0x206486);this['recursiveNodeIndex'](_0x20d11f);return JSON[_0x88c2('0x77')](_0x20d11f);}catch(_0x7114b4){return this[_0x88c2('0x9d')](_0x206486);}};AGIVertices[_0x88c2('0x13')][_0x88c2('0x9d')]=function(_0x3af59d){var _0x4623d2=_0x3af59d[_0x88c2('0xa6')]('{');for(var _0x4bef00=0x1;_0x4bef00<_0x4623d2['length'];_0x4bef00+=0x1){var _0x309644=_0x4623d2[_0x4bef00][_0x88c2('0xa6')]('}');if(_0x309644[_0x88c2('0xa1')]>0x1){_0x3af59d=_0x3af59d[_0x88c2('0xa7')]('{'+_0x309644[0x0]+'}',this[_0x88c2('0x10')][_0x88c2('0xa8')](_0x309644[0x0])[_0x88c2('0xa9')]||_0x309644[0x0]);}}if(_0x4623d2[_0x88c2('0xa1')]===0x1){return _0x3af59d[_0x88c2('0x4b')]();}return this[_0x88c2('0x9d')](_0x3af59d);};AGIVertices[_0x88c2('0x13')]['getAndSetVariable']=function(_0x492a20,_0x596c09){var _0x469221=this['channel'][_0x88c2('0xa8')](_0x492a20);if(_0x469221[_0x88c2('0xaa')]===-0x1){return _0x469221;}logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x596c09,_0x469221['extra']));return this[_0x88c2('0x10')][_0x88c2('0xa4')](_0x596c09,_0x469221[_0x88c2('0xa9')]);};AGIVertices[_0x88c2('0x13')]['isConfigured']=function(_0x247260){return _0x247260&&_0x247260!=='0'&&_0x247260!=='-1'&&_0x247260!=='';};AGIVertices['prototype']['maxRetry']=function(_0x27a74a){this['createSquareDetailsReport'][_0x88c2('0x73')](this,_0x27a74a,'-');_0x27a74a[_0x88c2('0xac')]=_0x27a74a[_0x88c2('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x88c2('0x13')][_0x88c2('0xae')]=function(_0x3651fc){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x3651fc[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x3651fc['text'])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xb0'));}var _0x42563a='\x22'+_0x3651fc[_0x88c2('0x5c')]+'\x22';if(this[_0x88c2('0x8a')](_0x3651fc[_0x88c2('0x7c')])){_0x42563a+=','+_0x3651fc[_0x88c2('0x7c')];}var _0x51c97d=this[_0x88c2('0x10')]['exec'](_0x88c2('0xb1'),_0x42563a);if(_0x51c97d[_0x88c2('0xaa')]===-0x1){return _0x51c97d;}return this[_0x88c2('0x10')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x42563a));};AGIVertices[_0x88c2('0x13')][_0x88c2('0xb2')]=function(_0x163752){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0xb3'),_0x163752['label']));if(!this[_0x88c2('0x8a')](_0x163752[_0x88c2('0xb4')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xb5'));}var _0x5bdfb3=_0x163752[_0x88c2('0xb4')];if(this[_0x88c2('0x8a')](_0x163752[_0x88c2('0x7c')])){_0x5bdfb3+=','+_0x163752[_0x88c2('0x7c')];}var _0x1adbc6=this[_0x88c2('0x10')][_0x88c2('0x57')](_0x88c2('0xb6'),_0x5bdfb3);if(_0x1adbc6[_0x88c2('0xaa')]===-0x1){return _0x1adbc6;}var _0x29a302=this[_0x88c2('0xb7')](_0x88c2('0xb8'),'MRCP_RECOG_CONFIDENCE');if(_0x29a302[_0x88c2('0xaa')]===-0x1){return _0x29a302;}var _0x5c5d92=this['getAndSetVariable'](_0x88c2('0xb9'),_0x88c2('0xba'));if(_0x5c5d92[_0x88c2('0xaa')]===-0x1){return _0x5c5d92;}var _0xc06a59=this[_0x88c2('0xb7')](_0x88c2('0xbb'),_0x88c2('0xbc'));if(_0xc06a59['result']===-0x1){return _0xc06a59;}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5bdfb3));};AGIVertices[_0x88c2('0x13')]['agi']=function(_0x39bfc3){logger['info'](util['format'](_0x88c2('0xbd'),_0x39bfc3[_0x88c2('0x37')]));return this[_0x88c2('0x10')][_0x88c2('0x8')]([_0x39bfc3[_0x88c2('0xbe')],_0x39bfc3['args']]);};AGIVertices['prototype'][_0x88c2('0xbf')]=function(_0x2896c1){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0xc0'),_0x2896c1[_0x88c2('0x37')]));if(this[_0x88c2('0x8a')](_0x2896c1[_0x88c2('0x67')])){logger['info'](util[_0x88c2('0xa3')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2896c1['timeout']));var _0x443a62=this[_0x88c2('0x10')][_0x88c2('0xc1')](_0x2896c1[_0x88c2('0x67')]);if(_0x443a62[_0x88c2('0xaa')]===-0x1){return _0x443a62;}}return this[_0x88c2('0x10')][_0x88c2('0xbf')]();};AGIVertices[_0x88c2('0x13')]['callback']=function(_0x56c5ea){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0xc2'),_0x56c5ea[_0x88c2('0x37')]));if(!this['isConfigured'](_0x56c5ea[_0x88c2('0x47')])){return this[_0x88c2('0x10')]['error'](_0x56c5ea,'no\x20list\x20selected');}_0x56c5ea[_0x88c2('0x48')]=moment();if(this['isConfigured'](_0x56c5ea[_0x88c2('0xc3')])){_0x56c5ea[_0x88c2('0x48')]=moment()[_0x88c2('0xc4')](_0x56c5ea[_0x88c2('0xc3')],'minutes');}if(!this[_0x88c2('0x8a')](_0x56c5ea[_0x88c2('0x4c')])){_0x56c5ea[_0x88c2('0x4c')]=0x2;}this[_0x88c2('0x41')]['sync'](this,_0x56c5ea);return this[_0x88c2('0x10')][_0x88c2('0xaf')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x56c5ea[_0x88c2('0x46')],_0x56c5ea[_0x88c2('0x47')],_0x56c5ea[_0x88c2('0x48')]));};AGIVertices[_0x88c2('0x13')][_0x88c2('0xc5')]=function(_0x20f06a){logger[_0x88c2('0xab')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x20f06a[_0x88c2('0x37')]));var _0x3daabe=this[_0x88c2('0x10')][_0x88c2('0x57')](_0x20f06a[_0x88c2('0xc6')],_0x20f06a['options']);if(_0x3daabe['result']===-0x1){return _0x3daabe;}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xc7'),_0x20f06a[_0x88c2('0xc6')],_0x20f06a[_0x88c2('0x7c')]));};AGIVertices['prototype'][_0x88c2('0xc8')]=function(_0xedbcfd){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0xc9'),_0xedbcfd['label']));if(!this[_0x88c2('0x8a')](_0xedbcfd[_0x88c2('0x5c')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')]('no\x20text\x20configured');}var _0x17ad79='\x22'+_0xedbcfd[_0x88c2('0x5c')]+'\x22';if(this['isConfigured'](_0xedbcfd[_0x88c2('0x7c')])){_0x17ad79+=','+_0xedbcfd[_0x88c2('0x7c')];}var _0x800e97=this['channel'][_0x88c2('0x57')](_0x88c2('0xb1'),_0x17ad79);if(_0x800e97['result']===-0x1){return _0x800e97;}return this[_0x88c2('0x10')]['noop'](util[_0x88c2('0xa3')](_0x88c2('0xca'),_0x17ad79));};AGIVertices['prototype'][_0x88c2('0xcb')]=function(_0x5a3c25){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5a3c25[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x5a3c25['text'])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0xb0'));}var _0x38d967='\x22'+_0x5a3c25[_0x88c2('0x5c')]+'\x22';if(this[_0x88c2('0x8a')](_0x5a3c25[_0x88c2('0x7c')])){_0x38d967+=','+_0x5a3c25['options'];}var _0x54ba97=this[_0x88c2('0x10')]['exec'](_0x88c2('0xb1'),_0x38d967);if(_0x54ba97[_0x88c2('0xaa')]===-0x1){return _0x54ba97;}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xca'),_0x38d967));};AGIVertices[_0x88c2('0x13')][_0x88c2('0xcc')]=function(_0x8ecb81){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0xcd'),_0x8ecb81['label']));if(!this[_0x88c2('0x8a')](_0x8ecb81[_0x88c2('0xb4')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')]('no\x20grammar\x20configured');}var _0x5b75bc=_0x8ecb81['grammar'];if(this[_0x88c2('0x8a')](_0x8ecb81[_0x88c2('0x7c')])){_0x5b75bc+=','+_0x8ecb81[_0x88c2('0x7c')];}var _0x1ec7b5=this[_0x88c2('0x10')][_0x88c2('0x57')](_0x88c2('0xb6'),_0x5b75bc);if(_0x1ec7b5[_0x88c2('0xaa')]===-0x1){return _0x1ec7b5;}var _0x38c506=this[_0x88c2('0xb7')](_0x88c2('0xb8'),'LUMENVOX_ASR_CONFIDENCE');if(_0x38c506[_0x88c2('0xaa')]===-0x1){return _0x38c506;}var _0x43a317=this[_0x88c2('0xb7')](_0x88c2('0xb9'),_0x88c2('0xce'));if(_0x43a317[_0x88c2('0xaa')]===-0x1){return _0x43a317;}var _0x6d0773=this[_0x88c2('0xb7')](_0x88c2('0xbb'),'LUMENVOX_ASR_INSTANCE');if(_0x6d0773[_0x88c2('0xaa')]===-0x1){return _0x6d0773;}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util['format'](_0x88c2('0xcf'),_0x5b75bc));};AGIVertices['prototype']['sestekasr']=function(_0x3e45fd){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0xd0'),_0x3e45fd['label']));if(!this[_0x88c2('0x8a')](_0x3e45fd[_0x88c2('0xb4')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0xb5'));}var _0x15cae2=_0x3e45fd[_0x88c2('0xb4')];if(this['isConfigured'](_0x3e45fd['options'])){_0x15cae2+=','+_0x3e45fd[_0x88c2('0x7c')];}var _0x308561=this[_0x88c2('0x10')][_0x88c2('0x57')]('MRCPRecog',_0x15cae2);if(_0x308561['result']===-0x1){return _0x308561;}var _0x141bea=this['getAndSetVariable'](_0x88c2('0xb8'),_0x88c2('0xd1'));if(_0x141bea[_0x88c2('0xaa')]===-0x1){return _0x141bea;}var _0x2b6159=this[_0x88c2('0xb7')](_0x88c2('0xb9'),_0x88c2('0xd2'));if(_0x2b6159[_0x88c2('0xaa')]===-0x1){return _0x2b6159;}var _0xfcc09e=this[_0x88c2('0xb7')](_0x88c2('0xbb'),_0x88c2('0xd3'));if(_0xfcc09e['result']===-0x1){return _0xfcc09e;}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util['format'](_0x88c2('0xcf'),_0x15cae2));};AGIVertices[_0x88c2('0x13')][_0x88c2('0xd4')]=function(_0x24ff42){logger['info'](util[_0x88c2('0xa3')](_0x88c2('0xd5'),_0x24ff42[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x24ff42['odbc_id'])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x24ff42,_0x88c2('0xd6'));}var _0x44beeb=this['getSquareOdbc'][_0x88c2('0x73')](this,_0x24ff42[_0x88c2('0xd7')]);if(!_0x44beeb){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x24ff42,_0x88c2('0xd8'));}if(!this['isConfigured'](_0x24ff42['query'])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x24ff42,_0x88c2('0xd9'));}var _0x5bf8ee=_0x24ff42[_0x88c2('0x2f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x88c2('0x10')]['noop'](util[_0x88c2('0xa3')]('query:\x20%s',_0x5bf8ee));var _0x11d9df=this[_0x88c2('0x2c')]['sync'](this,_0x44beeb,_0x5bf8ee);this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0x24ff42,_0x5bf8ee);if(!this['isConfigured'](_0x24ff42['variable_id'])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xda'));}var _0x1e9f71=this[_0x88c2('0xa8')][_0x88c2('0x73')](this,_0x24ff42[_0x88c2('0xdb')]);if(!_0x1e9f71){return this['channel']['error'](_0x24ff42,_0x88c2('0xdc'));}var _0x43605b=this;_0x11d9df[_0x88c2('0xdd')](function(_0x35dd47,_0x512a56){Object[_0x88c2('0xde')](_0x35dd47)[_0x88c2('0xdd')](function(_0x374844){_0x43605b[_0x88c2('0x10')][_0x88c2('0xa4')](util['format'](_0x88c2('0xdf'),_0x1e9f71,_0x512a56,_0x374844),_0x35dd47[_0x374844]);});});this[_0x88c2('0x10')]['setVariable'](util[_0x88c2('0xa3')](_0x88c2('0xe0'),_0x1e9f71),_0x11d9df[_0x88c2('0xa1')]);return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xe1'),_0x1e9f71));};AGIVertices[_0x88c2('0x13')][_0x88c2('0xe2')]=function(_0x20978d){logger[_0x88c2('0xe3')](util[_0x88c2('0xa3')](_0x88c2('0xe4'),_0x20978d[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x20978d['sip_id'])){return this[_0x88c2('0x10')]['error'](_0x20978d,_0x88c2('0xe5'));}var _0x5a143d=this[_0x88c2('0x1b')]['sync'](this,_0x20978d[_0x88c2('0xe6')]);if(!_0x5a143d){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x20978d,_0x88c2('0xe7'));}var _0x59308a=this[_0x88c2('0x10')][_0x88c2('0x57')](_0x88c2('0xe8'),[util[_0x88c2('0xa3')](_0x88c2('0xe9'),_0x5a143d),_0x20978d[_0x88c2('0x67')],_0x20978d[_0x88c2('0xea')],_0x20978d[_0x88c2('0x76')]]);if(_0x59308a[_0x88c2('0xaa')]===-0x1){return _0x59308a;}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xeb'),_0x88c2('0xe8')));};AGIVertices[_0x88c2('0x13')][_0x88c2('0xec')]=function(_0x425bd5){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x425bd5[_0x88c2('0x37')]));if(!this['isConfigured'](_0x425bd5[_0x88c2('0x7e')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0xed'));}if(!this['isConfigured'](_0x425bd5[_0x88c2('0x5c')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')]('no\x20text\x20configured');}this[_0x88c2('0x10')][_0x88c2('0xee')]=!![];this[_0x88c2('0x36')](_0x425bd5);this[_0x88c2('0x40')](_0x425bd5[_0x88c2('0x5c')],'in','','');this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('Trying\x20Dialogflow:\x20%s',_0x425bd5[_0x88c2('0x5c')]));var _0x3a1521=this[_0x88c2('0x7d')]['sync'](this,_0x425bd5);if(_0x3a1521){for(var _0x589186 in _0x3a1521){if(_0x3a1521[_0x88c2('0x9a')](_0x589186)){this[_0x88c2('0x10')][_0x88c2('0xa4')](util['format']('DIALOGFLOW_%s',_0x589186[_0x88c2('0x6c')]()),_0x3a1521[_0x589186]);}}this[_0x88c2('0x40')](_0x3a1521['speech'],_0x88c2('0xef'),'dialogflow','');return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('Dialogflow\x20Result\x20%s',_0x3a1521['speech']));}return this['channel']['error'](_0x425bd5,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x88c2('0x13')][_0x88c2('0xf0')]=function(_0x57ebff){logger[_0x88c2('0xab')](util['format'](_0x88c2('0xf1'),_0x57ebff[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x57ebff[_0x88c2('0x81')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0xf2'));}if(!this[_0x88c2('0x8a')](_0x57ebff[_0x88c2('0x82')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xf3'));}if(!this['isConfigured'](_0x57ebff['private_key'])){return this['channel'][_0x88c2('0xaf')](_0x88c2('0xf4'));}if(!this[_0x88c2('0x8a')](_0x57ebff['dialogflowV2_language'])){return this[_0x88c2('0x10')][_0x88c2('0xaf')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x57ebff['text'])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xb0'));}this[_0x88c2('0x10')][_0x88c2('0xee')]=!![];this['createSquareDetailsReport'](_0x57ebff);this[_0x88c2('0x40')](_0x57ebff[_0x88c2('0x5c')],'in','','');this['channel'][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xf5'),_0x57ebff[_0x88c2('0x5c')]));var _0x2f7ded=this[_0x88c2('0x80')][_0x88c2('0x73')](this,_0x57ebff);if(_0x2f7ded){for(var _0x40666b in _0x2f7ded){if(_0x2f7ded['hasOwnProperty'](_0x40666b)){if(_0x40666b!==_0x88c2('0xf6')){this['channel']['setVariable'](util[_0x88c2('0xa3')]('DIALOGFLOW_%s',_0x40666b['toUpperCase']()),_0x2f7ded[_0x40666b]);}}}this[_0x88c2('0x40')](_0x2f7ded[_0x88c2('0xf7')],'out',_0x88c2('0xf0'),_0x2f7ded[_0x88c2('0xf6')]);return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xf8'),_0x2f7ded[_0x88c2('0xf7')]));}return this['channel']['error'](_0x57ebff,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x88c2('0x13')][_0x88c2('0xf9')]=function(_0x10d819){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0xfa'),_0x10d819[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x10d819['ndauth_url'])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xfb'));}if(!this[_0x88c2('0x8a')](_0x10d819['username'])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xfc'));}if(!this[_0x88c2('0x8a')](_0x10d819[_0x88c2('0xfd')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0xfe'));}if(!this[_0x88c2('0x8a')](_0x10d819[_0x88c2('0xff')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xb0'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x10d819);this[_0x88c2('0x40')](_0x10d819[_0x88c2('0x5c')],'in','','');this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x100'),_0x10d819[_0x88c2('0x5c')]));var _0x2ca16c=this[_0x88c2('0x85')][_0x88c2('0x73')](this,_0x10d819);if(_0x2ca16c){for(var _0x2b7911 in _0x2ca16c){if(_0x2ca16c[_0x88c2('0x9a')](_0x2b7911)){this[_0x88c2('0x10')][_0x88c2('0xa4')](util['format'](_0x88c2('0x101'),_0x2b7911[_0x88c2('0x6c')]()),_0x2ca16c[_0x2b7911]);}}this[_0x88c2('0x40')](_0x2ca16c[_0x88c2('0xf7')],_0x88c2('0xef'),_0x88c2('0xf9'),'');if(_0x2ca16c[_0x88c2('0x102')]){this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x103'),_0x2ca16c[_0x88c2('0x102')]));var _0x87b38e=this[_0x88c2('0x10')][_0x88c2('0x104')](_0x2ca16c[_0x88c2('0x102')]);try{fs[_0x88c2('0x105')](_0x2ca16c[_0x88c2('0x102')]+_0x88c2('0x106'));}catch(_0x390cb5){logger['error'](_0x390cb5);}return _0x87b38e;}else{return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('SestekNDA\x20Result\x20%s',_0x2ca16c['speech']));}}return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x10d819,_0x88c2('0x107'));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x108')]=function(_0x1869ae){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20END\x20(%s)\x20block',_0x1869ae[_0x88c2('0x37')]));return this[_0x88c2('0x10')]['noop']('end');};AGIVertices[_0x88c2('0x13')][_0x88c2('0x109')]=function(_0x106939){logger[_0x88c2('0xab')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x106939[_0x88c2('0x37')]));var _0x9847d1='';if(_0x106939[_0x88c2('0x10a')]){if(!this[_0x88c2('0x8a')](_0x106939[_0x88c2('0x10a')])){return this['channel'][_0x88c2('0x33')](_0x106939,_0x88c2('0x10b'));}else{var _0xad329e=parseInt(_0x106939[_0x88c2('0x10a')],0xa);if(isNaN(_0xad329e)){_0x9847d1=_0x106939[_0x88c2('0x10a')];}else{_0x9847d1=this[_0x88c2('0x1d')][_0x88c2('0x73')](this,_0x106939[_0x88c2('0x10a')]);if(!_0x9847d1){return this['channel']['error'](_0x106939,_0x88c2('0x10c'));}}}}else if(_0x106939['trunk_name']){_0x9847d1=_0x106939[_0x88c2('0x10d')];}else{return this[_0x88c2('0x10')]['error'](_0x106939,_0x88c2('0x10b'));}var _0x416649=this['channel'][_0x88c2('0x57')](_0x88c2('0xe8'),[util['format'](_0x88c2('0x10e'),_0x9847d1,_0x106939['phone']),_0x106939['timeout'],_0x106939[_0x88c2('0xea')],_0x106939['url']]);if(_0x416649['result']===-0x1){return _0x416649;}return this['channel']['noop'](util[_0x88c2('0xa3')](_0x88c2('0xeb'),_0x88c2('0xe8')));};AGIVertices['prototype'][_0x88c2('0x10f')]=function(_0x49bc5d){logger[_0x88c2('0xab')](util['format'](_0x88c2('0x110'),_0x49bc5d[_0x88c2('0x37')]));return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x10f'));};AGIVertices['prototype']['getdigits']=function(_0x36f6d4){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x111'),_0x36f6d4['label']));if(_0x36f6d4[_0x88c2('0xac')]===0x0){return this['maxRetry'](_0x36f6d4);}_0x36f6d4['retry']-=0x1;if(!this[_0x88c2('0x8a')](_0x36f6d4[_0x88c2('0x112')])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x36f6d4,'no\x20file\x20audio\x20selected');}var _0x51eb29=this[_0x88c2('0x1f')][_0x88c2('0x73')](this,_0x36f6d4[_0x88c2('0x112')]);if(!_0x51eb29){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x36f6d4,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x36f6d4[_0x88c2('0xdb')])){return this[_0x88c2('0x10')][_0x88c2('0x33')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x149a6c=this[_0x88c2('0x10')]['getData'](_0x51eb29,_0x36f6d4[_0x88c2('0x113')],_0x36f6d4[_0x88c2('0x114')]);var _0x498772=_0x149a6c[_0x88c2('0xaa')]?_0x149a6c[_0x88c2('0xaa')][_0x88c2('0x4b')]():'';logger[_0x88c2('0xab')](_0x88c2('0x115'),JSON[_0x88c2('0x77')](_0x149a6c));if(_0x149a6c[_0x88c2('0xaa')]===-0x1){this[_0x88c2('0x36')]['sync'](this,_0x36f6d4,_0x498772);return _0x149a6c;}else if(_0x149a6c[_0x88c2('0xa9')]==='timeout'){_0x149a6c[_0x88c2('0xaa')]=_0x498772['length']>=parseInt(_0x36f6d4['mindigit'])?'x':'i';}else{_0x149a6c[_0x88c2('0xaa')]=_0x498772[_0x88c2('0xa1')]>=parseInt(_0x36f6d4['mindigit'])&&_0x498772[_0x88c2('0xa1')]<=parseInt(_0x36f6d4[_0x88c2('0x114')])?'x':'i';}var _0xb0651a=this[_0x88c2('0xa8')][_0x88c2('0x73')](this,_0x36f6d4['variable_id']);if(!_0xb0651a){return this['channel'][_0x88c2('0x33')](_0x36f6d4,_0x88c2('0xdc'));}this[_0x88c2('0x10')][_0x88c2('0xa4')](_0xb0651a,_0x498772);if(this['isConfigured'](_0x36f6d4[_0x88c2('0x116')])){var _0x6f13ec=parseInt(_0x36f6d4[_0x88c2('0x116')],0xa);var _0x5da2f7=rs[_0x88c2('0x117')]({'charset':'*','length':_0x6f13ec});var _0x487104=_0x498772[_0x88c2('0xa1')];if(_0x487104>0x0){if(_0x487104>_0x6f13ec){this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0x36f6d4,_0x36f6d4[_0x88c2('0x118')]===_0x88c2('0x119')?_0x5da2f7+_0x498772[_0x88c2('0x11a')](_0x6f13ec):_0x498772[_0x88c2('0x11a')](0x0,_0x487104-_0x6f13ec)+_0x5da2f7);}else{this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0x36f6d4,rs[_0x88c2('0x117')]({'charset':'*','length':_0x487104}));}}else{this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0x36f6d4,'');}}else{this['createSquareDetailsReport'][_0x88c2('0x73')](this,_0x36f6d4,_0x498772);}return _0x149a6c;};AGIVertices[_0x88c2('0x13')]['getsecretdigits']=function(_0x14ae73){logger[_0x88c2('0xab')](util['format'](_0x88c2('0x11b'),_0x14ae73[_0x88c2('0x37')]));return this['getdigits'](_0x14ae73);};AGIVertices['prototype'][_0x88c2('0x11c')]=function(_0x117434){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x117434[_0x88c2('0x37')]));this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0x117434,_0x117434[_0x88c2('0x11d')]);return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x11e'),_0x117434[_0x88c2('0x11d')]));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x11f')]=function(_0x52beda){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x120'),_0x52beda[_0x88c2('0x37')]));if(!this['isConfigured'](_0x52beda[_0x88c2('0x8d')])||!this[_0x88c2('0x8a')](_0x52beda[_0x88c2('0x92')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0x121'));}if(!this['isConfigured'](_0x52beda[_0x88c2('0x5c')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xb0'));}this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x122'),_0x52beda[_0x88c2('0x5c')]));var _0x4ad1f2=this[_0x88c2('0x8c')][_0x88c2('0x73')](this,_0x52beda);if(_0x4ad1f2){this[_0x88c2('0x10')][_0x88c2('0xaf')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x4ad1f2));var _0x31389c=this[_0x88c2('0x10')][_0x88c2('0x104')](_0x4ad1f2);try{fs[_0x88c2('0x105')](_0x4ad1f2+_0x88c2('0x106'));}catch(_0x449bc8){logger[_0x88c2('0x33')](_0x449bc8);}return _0x31389c;}return this[_0x88c2('0x10')]['error'](_0x52beda,_0x88c2('0x123'));};AGIVertices[_0x88c2('0x13')]['awslex']=function(_0x5686e9){logger[_0x88c2('0xab')](util['format'](_0x88c2('0x124'),_0x5686e9['label']));if(!this[_0x88c2('0x8a')](_0x5686e9['aws_access_key_id'])||!this[_0x88c2('0x8a')](_0x5686e9[_0x88c2('0x92')])){return this['channel'][_0x88c2('0xaf')](_0x88c2('0x121'));}if(!this[_0x88c2('0x8a')](_0x5686e9[_0x88c2('0x94')])){return this['channel'][_0x88c2('0xaf')](_0x88c2('0x125'));}if(!this['isConfigured'](_0x5686e9[_0x88c2('0x5c')])){return this['channel'][_0x88c2('0xaf')](_0x88c2('0xb0'));}this[_0x88c2('0x10')]['bot']=!![];this[_0x88c2('0x36')](_0x5686e9);this['createSquareMessage'](_0x5686e9[_0x88c2('0x5c')],'in','','');this['channel']['noop'](util[_0x88c2('0xa3')](_0x88c2('0x126'),_0x5686e9[_0x88c2('0x5c')]));var _0x2ae443=this[_0x88c2('0x91')][_0x88c2('0x73')](this,_0x5686e9);if(_0x2ae443){for(var _0x2f90ec in _0x2ae443){if(_0x2ae443[_0x88c2('0x9a')](_0x2f90ec)&&_[_0x88c2('0x9b')](_0x2ae443[_0x2f90ec])){this[_0x88c2('0x10')][_0x88c2('0xa4')](util[_0x88c2('0xa3')]('AWS_LEX_%s',_0x2f90ec['toUpperCase']()),_0x2ae443[_0x2f90ec]);}}if(_[_0x88c2('0x45')](_0x2ae443[_0x88c2('0x7a')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0x127'));}else{this[_0x88c2('0x40')](_0x2ae443['message'],_0x88c2('0xef'),_0x88c2('0x128'),'');return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('Amazon\x20Lex\x20Result\x20%s',_0x2ae443[_0x88c2('0x7a')]));}}return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x5686e9,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x88c2('0x13')][_0x88c2('0x129')]=function(_0x2f883f){logger['info'](util[_0x88c2('0xa3')](_0x88c2('0x12a'),_0x2f883f[_0x88c2('0x37')],_0x2f883f[_0x88c2('0x67')]));if(!this[_0x88c2('0x8a')](_0x2f883f[_0x88c2('0x7e')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0xed'));}var _0x579967=_0x88c2('0x12b');var _0x42cbb0=util[_0x88c2('0xa3')]('%s/recordings/%s',FILES_PATH,rs[_0x88c2('0x117')](0x4));var _0x13aa8b=util[_0x88c2('0xa3')](_0x88c2('0xa5'),_0x42cbb0,_0x579967);var _0x41d967=!![];if(_0x2f883f[_0x88c2('0x12c')]==='NOBEEP'){_0x41d967=![];}var _0x4cd76a=this[_0x88c2('0x10')][_0x88c2('0x12d')](_0x42cbb0,_0x579967,_0x2f883f[_0x88c2('0x12e')],_0x2f883f[_0x88c2('0x67')],undefined,_0x41d967);if(_0x4cd76a['result']!==-0x1){this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('google\x20%s\x20file\x20created',_0x13aa8b));var _0x35cbec=this[_0x88c2('0x95')][_0x88c2('0x73')](this,_0x2f883f,_0x13aa8b);if(_0x35cbec){for(var _0x2f17ef in _0x35cbec){if(_0x35cbec[_0x88c2('0x9a')](_0x2f17ef)){this[_0x88c2('0x10')][_0x88c2('0xa4')](util[_0x88c2('0xa3')](_0x88c2('0x12f'),_0x2f17ef[_0x88c2('0x6c')]()),_0x35cbec[_0x2f17ef]);}}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x130'),JSON[_0x88c2('0x77')](_0x35cbec)));}}return _0x4cd76a;};AGIVertices[_0x88c2('0x13')][_0x88c2('0x131')]=function(_0x57938f){logger['info'](util[_0x88c2('0xa3')](_0x88c2('0x132'),_0x57938f[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x57938f[_0x88c2('0x97')])){return this['channel'][_0x88c2('0xaf')](_0x88c2('0x133'));}if(!this[_0x88c2('0x8a')](_0x57938f[_0x88c2('0x98')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x134'));}var _0x325d5d=_0x88c2('0x12b');var _0x534519=util[_0x88c2('0xa3')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x1c4d0c=util['format'](_0x88c2('0xa5'),_0x534519,_0x325d5d);var _0x21b668=!![];if(_0x57938f['beep']===_0x88c2('0x135')){_0x21b668=![];}var _0x348188=this['channel']['recordFile'](_0x534519,_0x325d5d,_0x57938f['intKey'],_0x57938f[_0x88c2('0x67')],undefined,_0x21b668);if(_0x348188['result']!==-0x1){this['channel'][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x136'),_0x1c4d0c));var _0x2bfc59=this[_0x88c2('0x137')]['sync'](this,_0x57938f,_0x1c4d0c);if(_0x2bfc59){for(var _0x20d6c5 in _0x2bfc59){if(_0x2bfc59['hasOwnProperty'](_0x20d6c5)){this[_0x88c2('0x10')][_0x88c2('0xa4')](util[_0x88c2('0xa3')]('TILDE_ASR_%s',_0x20d6c5[_0x88c2('0x6c')]()),_0x2bfc59[_0x20d6c5]);}}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x138'),JSON[_0x88c2('0x77')](_0x2bfc59)));}}return _0x348188;};AGIVertices[_0x88c2('0x13')][_0x88c2('0x139')]=function(_0x15ad7c){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x13a'),_0x15ad7c[_0x88c2('0x37')]));return this[_0x88c2('0x10')][_0x88c2('0x13b')](_0x15ad7c['context'],_0x15ad7c[_0x88c2('0x13c')],_0x15ad7c[_0x88c2('0x13d')]);};AGIVertices[_0x88c2('0x13')][_0x88c2('0x13e')]=function(_0xa995d1){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x13f'),_0xa995d1[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0xa995d1['condition'])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0xa995d1,_0x88c2('0x140'));}try{var _0x535c3c=eval(_0xa995d1['condition'])?_0x88c2('0x141'):_0x88c2('0x142');this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('EVAL\x20CONDITION\x20%s\x20%s',_0xa995d1['condition'],_0x535c3c));return{'code':0xc8,'result':_0x535c3c};}catch(_0x53d555){return{'code':0xc8,'result':_0x88c2('0x142')};}};AGIVertices[_0x88c2('0x13')]['gotoiftime']=function(_0x4779fb){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x143'),_0x4779fb['label']));if(!this[_0x88c2('0x8a')](_0x4779fb[_0x88c2('0x144')])){return this['channel']['error'](_0x4779fb,_0x88c2('0x145'));}var _0x245b7e=this[_0x88c2('0x25')][_0x88c2('0x73')](this,_0x4779fb[_0x88c2('0x144')]);if(!_0x245b7e){return this['channel'][_0x88c2('0x33')](_0x4779fb,_0x88c2('0x146'));}for(var _0x2c5892=0x0;_0x2c5892<_0x245b7e['length'];_0x2c5892+=0x1){var _0x19f802=this[_0x88c2('0x10')]['getVariable'](util[_0x88c2('0xa3')](_0x88c2('0x147'),_0x245b7e[_0x2c5892]));if(_0x19f802[_0x88c2('0xaa')]===-0x1){return _0x19f802;}logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x245b7e[_0x2c5892],_0x19f802[_0x88c2('0xa9')]));if(_0x19f802[_0x88c2('0xa9')]==='true'){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x148'),_0x245b7e[_0x2c5892],_0x88c2('0x141')));this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x148'),_0x245b7e[_0x2c5892],'true'));return{'code':0xc8,'result':_0x88c2('0x141')};}else{logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x148'),_0x245b7e[_0x2c5892],_0x88c2('0x142')));this[_0x88c2('0x10')]['noop'](util['format']('IFTIME\x20%s\x20%s',_0x245b7e[_0x2c5892],'false'));}}return{'code':0xc8,'result':_0x88c2('0x142')};};AGIVertices['prototype']['hangup']=function(_0x3ceede){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x149'),_0x3ceede['label']));return this[_0x88c2('0x10')]['hangup']();};AGIVertices[_0x88c2('0x13')]['ispeechasr']=function(_0x22de1d){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x22de1d[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x22de1d[_0x88c2('0x7e')])){return this['channel'][_0x88c2('0xaf')]('no\x20key\x20configured');}var _0x3843d5='wav';var _0x40de7d=util[_0x88c2('0xa3')]('%s/recordings/%s',FILES_PATH,rs[_0x88c2('0x117')](0x4));var _0x427e70=util[_0x88c2('0xa3')](_0x88c2('0xa5'),_0x40de7d,_0x3843d5);var _0x12f34d=!![];if(_0x22de1d[_0x88c2('0x12c')]===_0x88c2('0x135')){_0x12f34d=![];}var _0x4d5c9f=this['channel']['recordFile'](_0x40de7d,_0x3843d5,_0x22de1d[_0x88c2('0x12e')],_0x22de1d[_0x88c2('0x67')],undefined,_0x12f34d);if(_0x4d5c9f['result']!==-0x1){this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x14a'),_0x427e70));var _0x53f3a1=this['ispeechASR'][_0x88c2('0x73')](this,_0x22de1d,_0x427e70);if(_0x53f3a1){for(var _0x202690 in _0x53f3a1){if(_0x53f3a1['hasOwnProperty'](_0x202690)){this[_0x88c2('0x10')][_0x88c2('0xa4')](util['format'](_0x88c2('0x14b'),_0x202690['toUpperCase']()),_0x53f3a1[_0x202690]);}}return this['channel'][_0x88c2('0xaf')](util['format'](_0x88c2('0x14c'),JSON[_0x88c2('0x77')](_0x53f3a1)));}}return _0x4d5c9f;};AGIVertices[_0x88c2('0x13')][_0x88c2('0x14d')]=function(_0x16e7f0){logger['info'](util[_0x88c2('0xa3')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x16e7f0['label']));if(!this[_0x88c2('0x8a')](_0x16e7f0[_0x88c2('0x7e')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0xed'));}if(!this[_0x88c2('0x8a')](_0x16e7f0[_0x88c2('0x5c')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')]('no\x20text\x20configured');}this[_0x88c2('0x10')]['noop'](util[_0x88c2('0xa3')](_0x88c2('0x14e'),_0x16e7f0[_0x88c2('0x5c')]));var _0x17b0a0=this[_0x88c2('0x86')][_0x88c2('0x73')](this,_0x16e7f0);if(_0x17b0a0){this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x14a'),_0x17b0a0));var _0x5ab429=this['channel'][_0x88c2('0x104')](_0x17b0a0,_0x16e7f0[_0x88c2('0x12e')]);try{fs[_0x88c2('0x105')](_0x17b0a0+_0x88c2('0x106'));}catch(_0x1aa636){logger['error'](_0x1aa636);}return _0x5ab429;}return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x16e7f0,_0x88c2('0x14f'));};AGIVertices['prototype']['login']=function(_0x4f5949){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x4f5949[_0x88c2('0x37')]));if(!this['isConfigured'](_0x4f5949[_0x88c2('0x150')])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x4f5949,_0x88c2('0x151'));}logger['info'](util['format'](_0x88c2('0x152'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x4f5949['findBy']));var _0x45f30c=this[_0x88c2('0x53')]['sync'](this,_0x4f5949['findBy']);if(_0x45f30c){logger[_0x88c2('0xab')](util['format'](_0x88c2('0x153'),this['channel'][_0x88c2('0x39')],_0x4f5949[_0x88c2('0x150')]));this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x153'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x4f5949['findBy']));return{'code':0xc8,'result':_0x88c2('0x154')};}else{logger['info'](util[_0x88c2('0xa3')](_0x88c2('0x155'),this[_0x88c2('0x10')]['callerid'],_0x4f5949[_0x88c2('0x150')]));this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x155'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x4f5949[_0x88c2('0x150')]));return{'code':0xc8,'result':_0x88c2('0x156')};}};AGIVertices[_0x88c2('0x13')]['logout']=function(_0x249c5e){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x157'),_0x249c5e[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x249c5e[_0x88c2('0x150')])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x249c5e,'no\x20find\x20by\x20configured');}logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x152'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x249c5e[_0x88c2('0x150')]));var _0x3761c0=this[_0x88c2('0x52')][_0x88c2('0x73')](this,_0x249c5e[_0x88c2('0x150')]);if(_0x3761c0){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x153'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x249c5e[_0x88c2('0x150')]));this[_0x88c2('0x10')]['noop'](util[_0x88c2('0xa3')](_0x88c2('0x153'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x249c5e[_0x88c2('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x155'),this['channel'][_0x88c2('0x39')],_0x249c5e[_0x88c2('0x150')]));this[_0x88c2('0x10')][_0x88c2('0xaf')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88c2('0x10')]['callerid'],_0x249c5e['findBy']));return{'code':0xc8,'result':_0x88c2('0x156')};}};AGIVertices[_0x88c2('0x13')][_0x88c2('0x158')]=function(_0x570010){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x159'),_0x570010[_0x88c2('0x37')]));if(!this['isConfigured'](_0x570010[_0x88c2('0x15a')])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x570010,'no\x20operation\x20configured');}this[_0x88c2('0x10')]['noop'](util[_0x88c2('0xa3')](_0x88c2('0x15b'),_0x570010[_0x88c2('0x15a')]));var _0x1ea7d6=eval(_0x570010[_0x88c2('0x15a')]);if(!this[_0x88c2('0x8a')](_0x570010[_0x88c2('0xdb')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0xda'));}var _0x459d9e=this['getVariable'][_0x88c2('0x73')](this,_0x570010[_0x88c2('0xdb')]);if(!_0x459d9e){return this[_0x88c2('0x10')]['error'](_0x570010,'no\x20variable\x20found');}if(_[_0x88c2('0xa0')](_0x1ea7d6)){var _0x5a061f=this;_0x1ea7d6['forEach'](function(_0x3c3dfa,_0x53702f){_0x5a061f[_0x88c2('0x10')][_0x88c2('0xa4')](util['format'](_0x88c2('0x15c'),_0x459d9e,_0x53702f),_0x3c3dfa);});return this['channel'][_0x88c2('0xaf')](util['format'](_0x88c2('0x15d'),_0x459d9e));}else{return this[_0x88c2('0x10')][_0x88c2('0xa4')](_0x459d9e,_0x1ea7d6);}};AGIVertices[_0x88c2('0x13')][_0x88c2('0xd')]=function(_0x58b583){logger['info'](util[_0x88c2('0xa3')](_0x88c2('0x15e'),_0x58b583['label']));if(_0x58b583[_0x88c2('0xac')]===0x0){return this[_0x88c2('0xad')](_0x58b583);}_0x58b583[_0x88c2('0xac')]-=0x1;if(!this['isConfigured'](_0x58b583[_0x88c2('0x112')])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x58b583,'no\x20file\x20audio\x20selected');}var _0x6992a0=this[_0x88c2('0x1f')]['sync'](this,_0x58b583[_0x88c2('0x112')]);if(!_0x6992a0){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x58b583,'no\x20file\x20audio\x20found');}var _0x753aa9=this[_0x88c2('0x10')][_0x88c2('0x15f')](_0x6992a0,_0x58b583['response'],_0x58b583[_0x88c2('0x160')]);var _0xcdea29=_0x753aa9[_0x88c2('0xaa')];if(_0x753aa9[_0x88c2('0xaa')]===-0x1){this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0x58b583,'-1');return _0x753aa9;}else if(_0x753aa9['extra']==='timeout'){_0x753aa9[_0x88c2('0xaa')]=_0x753aa9[_0x88c2('0xaa')][_0x88c2('0xa1')]>0x0?_0x753aa9[_0x88c2('0xaa')]:'t';}else if(_[_0x88c2('0x43')](_0x753aa9[_0x88c2('0xaa')])){_0x753aa9['result']='#';_0xcdea29='#';}if(!this[_0x88c2('0x8a')](_0x58b583[_0x88c2('0xdb')])){this['channel']['noop'](_0x88c2('0xda'));}else{var _0xd28c5=this[_0x88c2('0xa8')]['sync'](this,_0x58b583[_0x88c2('0xdb')]);if(!_0xd28c5){return this['channel'][_0x88c2('0x33')](_0x58b583,'no\x20variable\x20found');}this[_0x88c2('0x10')]['setVariable'](_0xd28c5,_0xcdea29);}this['createSquareDetailsReport'][_0x88c2('0x73')](this,_0x58b583,_0xcdea29);return _0x753aa9;};AGIVertices[_0x88c2('0x13')]['noop']=function(_0x5060e3){logger['info'](util[_0x88c2('0xa3')](_0x88c2('0x161'),_0x5060e3[_0x88c2('0x37')]));return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x5060e3[_0x88c2('0x162')]||_0x5060e3[_0x88c2('0x37')]);};AGIVertices[_0x88c2('0x13')]['pause']=function(_0x2664fb){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x163'),_0x2664fb[_0x88c2('0x37')]));if(!this['isConfigured'](_0x2664fb[_0x88c2('0x150')])){return this[_0x88c2('0x10')]['error'](_0x2664fb,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x88c2('0x10')][_0x88c2('0x39')],_0x2664fb[_0x88c2('0x150')]));var _0x3f87ac=this[_0x88c2('0x4d')]['sync'](this,_0x2664fb[_0x88c2('0x164')]);var _0x42d6e5=this[_0x88c2('0x4f')][_0x88c2('0x73')](this,_0x2664fb[_0x88c2('0x150')],_0x3f87ac);if(_0x42d6e5){logger[_0x88c2('0xab')](util['format'](_0x88c2('0x153'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x2664fb[_0x88c2('0x150')]));this['channel']['noop'](util['format'](_0x88c2('0x153'),this[_0x88c2('0x10')]['callerid'],_0x2664fb[_0x88c2('0x150')]));return{'code':0xc8,'result':_0x88c2('0x154')};}else{logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x155'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x2664fb['findBy']));this[_0x88c2('0x10')]['noop'](util[_0x88c2('0xa3')](_0x88c2('0x153'),this[_0x88c2('0x10')][_0x88c2('0x39')],_0x2664fb[_0x88c2('0x150')]));return{'code':0xc8,'result':_0x88c2('0x156')};}};AGIVertices[_0x88c2('0x13')]['playback']=function(_0x20747e){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x20747e[_0x88c2('0x37')]));if(!this['isConfigured'](_0x20747e['file_id'])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x20747e,_0x88c2('0x165'));}var _0x2c6efc=this[_0x88c2('0x1f')][_0x88c2('0x73')](this,_0x20747e[_0x88c2('0x112')]);if(!_0x2c6efc){return this[_0x88c2('0x10')]['error'](_0x20747e,_0x88c2('0x166'));}var _0xd02de8=this[_0x88c2('0x10')][_0x88c2('0x57')](_0x88c2('0x167'),[_0x2c6efc,_0x20747e[_0x88c2('0xea')]]);if(_0xd02de8[_0x88c2('0xaa')]===-0x1){return _0xd02de8;}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xc7'),_0x88c2('0x167'),_0x2c6efc));};AGIVertices['prototype'][_0x88c2('0x168')]=function(_0x56461e){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x169'),_0x56461e['label']));if(!this[_0x88c2('0x8a')](_0x56461e['queue_id'])){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x56461e,_0x88c2('0x16a'));}var _0x481cd9='';var _0x5b930d=parseInt(_0x56461e[_0x88c2('0x16b')],0xa);if(isNaN(_0x5b930d)){_0x481cd9=_0x56461e[_0x88c2('0x16b')];}else{_0x481cd9=this[_0x88c2('0x16c')][_0x88c2('0x73')](this,_0x56461e[_0x88c2('0x16b')]);if(!_0x481cd9){return this['channel'][_0x88c2('0x33')](_0x56461e,_0x88c2('0x16d'));}}var _0x5cfb2f='';if(this[_0x88c2('0x8a')](_0x56461e[_0x88c2('0x112')])){var _0x58b9f5=this[_0x88c2('0x1f')]['sync'](this,_0x56461e[_0x88c2('0x112')]);if(_0x58b9f5){_0x5cfb2f=_0x58b9f5;}}this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0x56461e,_0x481cd9);if(_0x56461e['opts'][_0x88c2('0x16e')]('x')<0x0){_0x56461e[_0x88c2('0xea')]+='x';}if(_0x56461e[_0x88c2('0xea')]['indexOf']('X')<0x0){_0x56461e['opts']+='X';}this['channel'][_0x88c2('0xa4')]('XMCS-QUEUE',_0x481cd9?_0x481cd9[_0x88c2('0x16f')]():'');var _0xc443d1=this[_0x88c2('0x10')][_0x88c2('0x57')]('QUEUE',[_0x481cd9,_0x56461e[_0x88c2('0xea')],_0x56461e[_0x88c2('0x76')],_0x5cfb2f,_0x56461e['timeout'],_0x56461e[_0x88c2('0x8')],_0x56461e[_0x88c2('0x170')],_0x56461e[_0x88c2('0x171')],'',_0x56461e[_0x88c2('0x172')]]);if(_0xc443d1[_0x88c2('0xaa')]===-0x1){return _0xc443d1;}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xc7'),_0x88c2('0x173'),_0x481cd9));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x174')]=function(_0x5983ad){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x175'),_0x5983ad['label']));var _0xf8ccd7=_0x5983ad[_0x88c2('0x176')]||'wav';var _0x407724=util[_0x88c2('0xa3')](_0x88c2('0x177'),this[_0x88c2('0x10')][_0x88c2('0x3b')],rs['generate'](0x5));var _0x9f4789=util['format'](_0x88c2('0x178'),FILES_PATH,_0x407724,_0xf8ccd7);var _0x335d68=util['format']('%s/recordings/%s',FILES_PATH,_0x407724);this[_0x88c2('0x3a')][_0x88c2('0x73')](this,_0x5983ad,_0x407724,_0x9f4789);this[_0x88c2('0x10')][_0x88c2('0xa4')](_0x88c2('0x179'),_0x407724);logger[_0x88c2('0xab')](_0x88c2('0x17a'),_0x335d68,_0xf8ccd7,_0x5983ad[_0x88c2('0x17b')],_0x5983ad[_0x88c2('0x67')]);return this[_0x88c2('0x10')]['recordFile'](_0x335d68,_0xf8ccd7,_0x5983ad[_0x88c2('0x17b')],_0x5983ad['timeout'],undefined,!![]);};AGIVertices[_0x88c2('0x13')]['restapi']=function(_0x309182){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x17c'),_0x309182['label']));if(!this[_0x88c2('0x8a')](_0x309182[_0x88c2('0x76')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x17d'));}var _0x363c7b=this['restAPI'][_0x88c2('0x73')](this,_0x309182);logger[_0x88c2('0xab')](util['format'](_0x88c2('0x17e'),util[_0x88c2('0x17f')](_0x363c7b,{'showHidden':![],'depth':null})));if(!this[_0x88c2('0x8a')](_0x309182[_0x88c2('0xdb')])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0x180'));}var _0x4cafef=this['getVariable'][_0x88c2('0x73')](this,_0x309182['variable_id']);if(!_0x4cafef){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x309182,'no\x20variable\x20found');}this[_0x88c2('0x10')]['setVariable'](util[_0x88c2('0xa3')]('%s_STATUS_CODE',_0x4cafef),_0x363c7b['statusCode']?_0x363c7b[_0x88c2('0x79')]:_0x88c2('0x181'));this[_0x88c2('0x10')]['setVariable'](util[_0x88c2('0xa3')](_0x88c2('0x182'),_0x4cafef),_0x363c7b[_0x88c2('0x183')]?_0x363c7b[_0x88c2('0x183')]:'OK');if(_0x363c7b[_0x88c2('0x6d')]){try{this[_0x88c2('0xa2')](_0x363c7b[_0x88c2('0x6d')],_0x4cafef);}catch(_0x3e661b){logger[_0x88c2('0x33')](util['format'](_0x88c2('0x184'),_0x4cafef));}}return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xe1'),_0x4cafef));};AGIVertices[_0x88c2('0x13')]['saydigits']=function(_0x59c0b2){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x185'),_0x59c0b2[_0x88c2('0x37')]));return this[_0x88c2('0x10')][_0x88c2('0x186')](_0x59c0b2[_0x88c2('0x187')][_0x88c2('0x59')](/\s+/g,''),_0x59c0b2[_0x88c2('0x17b')]);};AGIVertices['prototype'][_0x88c2('0x188')]=function(_0x46255f){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x189'),_0x46255f['label']));return this['channel']['sayNumber'](_0x46255f[_0x88c2('0x68')][_0x88c2('0x59')](/\s+/g,''),_0x46255f[_0x88c2('0x17b')]);};AGIVertices['prototype']['sayphonetic']=function(_0x209632){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x18a'),_0x209632[_0x88c2('0x37')]));return this[_0x88c2('0x10')]['sayPhonetic'](_0x209632[_0x88c2('0x5c')],_0x209632['escape_digits']);};AGIVertices[_0x88c2('0x13')][_0x88c2('0x18b')]=function(_0xbdba6c){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x18c'),_0xbdba6c[_0x88c2('0x37')]));if(!this['isConfigured'](_0xbdba6c[_0x88c2('0x18d')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x18e'));}var _0x2de6d9=this[_0x88c2('0x23')][_0x88c2('0x73')](this,_0xbdba6c[_0x88c2('0x18d')]);if(!_0x2de6d9||!_0x2de6d9[_0x88c2('0x18f')]){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0xbdba6c,'no\x20mail\x20account\x20found');}var _0x3c3db2={'from':util[_0x88c2('0xa3')]('\x22%s\x22\x20<%s>',_0x2de6d9[_0x88c2('0x16')],_0x2de6d9[_0x88c2('0x190')]||_0x2de6d9['Smtp']['user']),'to':_0xbdba6c['to']||'','cc':_0xbdba6c['cc']||'','bcc':_0xbdba6c['bcc']||'','subject':_0xbdba6c[_0x88c2('0x191')],'html':_0xbdba6c['text'],'text':_0xbdba6c[_0x88c2('0x5c')]};var _0x2783cb={'tls':{'rejectUnauthorized':![]}};if(_0x2de6d9[_0x88c2('0x18f')][_0x88c2('0x192')]){_0x2783cb['service']=_0x2de6d9[_0x88c2('0x18f')]['service'];}else{_0x2783cb[_0x88c2('0x193')]=_0x2de6d9[_0x88c2('0x18f')][_0x88c2('0x193')];_0x2783cb[_0x88c2('0x194')]=_0x2de6d9[_0x88c2('0x18f')][_0x88c2('0x194')];_0x2783cb[_0x88c2('0x195')]=_0x2de6d9[_0x88c2('0x18f')][_0x88c2('0x195')];}if(_0x2de6d9[_0x88c2('0x18f')][_0x88c2('0x196')]){_0x2783cb[_0x88c2('0x197')]={'user':_0x2de6d9[_0x88c2('0x18f')]['user'],'pass':_0x2de6d9[_0x88c2('0x18f')]['pass']};}if(this[_0x88c2('0x8a')](_0xbdba6c[_0x88c2('0x198')])){}logger[_0x88c2('0xe3')](_0x88c2('0x199'),JSON[_0x88c2('0x77')](_0x3c3db2));this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0xbdba6c,_0xbdba6c[_0x88c2('0x18d')]);this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x19a'),_0x2de6d9[_0x88c2('0x16')]));this[_0x88c2('0x24')][_0x88c2('0x73')](this,_0x2783cb,_0x3c3db2);return this[_0x88c2('0x10')][_0x88c2('0xaf')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x88c2('0x13')][_0x88c2('0x19b')]=function(_0xb7a973){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0xb7a973[_0x88c2('0x37')]));return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x19c'));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x19d')]=function(_0x3546b5){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3546b5['label']));if(!this['isConfigured'](_0x3546b5[_0x88c2('0x19e')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x19f'));}var _0x33b145=this[_0x88c2('0x34')][_0x88c2('0x73')](this,_0x3546b5[_0x88c2('0x19e')]);if(!_0x33b145){return this['channel']['error'](_0x3546b5,'no\x20sms\x20account\x20found');}var _0x934cde={'body':_0x3546b5[_0x88c2('0x1a0')],'phone':_0x3546b5['to']||'','SmsAccountId':_0x33b145['id']};logger[_0x88c2('0xe3')](_0x88c2('0x1a1'),JSON[_0x88c2('0x77')](_0x934cde));this[_0x88c2('0x36')]['sync'](this,_0x3546b5,_0x3546b5[_0x88c2('0x19e')]);this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x1a2'),_0x33b145['name']));this[_0x88c2('0x35')][_0x88c2('0x73')](this,_0x934cde);return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x1a3'));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1a4')]=function(_0x421069){logger['info'](util[_0x88c2('0xa3')](_0x88c2('0x1a5'),_0x421069['label']));if(!this[_0x88c2('0x8a')](_0x421069['variable_id'])){return this[_0x88c2('0x10')]['error'](_0x421069,_0x88c2('0x1a6'));}var _0x5d3c72=this[_0x88c2('0xa8')][_0x88c2('0x73')](this,_0x421069[_0x88c2('0xdb')]);if(!_0x5d3c72){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x421069,_0x88c2('0xdc'));}return this['channel'][_0x88c2('0xa4')](_0x5d3c72,_0x421069['variable_value']);};AGIVertices[_0x88c2('0x13')]['start']=function(_0x1c82c9){logger[_0x88c2('0xab')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x1c82c9['label']));this[_0x88c2('0x10')]['noop'](_0x88c2('0x1a7'));if(_0x1c82c9['answer']===_0x88c2('0x1a8')){this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x1a9'));return this[_0x88c2('0x10')][_0x88c2('0xbf')]();}return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x1aa'));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1ab')]=function(_0x2d2892){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x1ac'),_0x2d2892[_0x88c2('0x37')]));if(!this[_0x88c2('0x8a')](_0x2d2892[_0x88c2('0x1ad')])){return this[_0x88c2('0x10')]['error'](_0x2d2892,_0x88c2('0x1ae'));}var _0x1bf2c4=this['getSquareProject']['sync'](this,_0x2d2892['project_id']);if(!this[_0x88c2('0x8a')](_0x1bf2c4)){return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x2d2892,util[_0x88c2('0xa3')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2d2892[_0x88c2('0x1ad')]));}if(_0x1bf2c4===this[_0x88c2('0x10')][_0x88c2('0x38')]){return this[_0x88c2('0x10')]['error'](_0x2d2892,_0x88c2('0x1af'));}this['createSquareDetailsReport'][_0x88c2('0x73')](this,_0x2d2892,_0x1bf2c4);var _0x3be91b=this[_0x88c2('0x10')]['exec'](_0x88c2('0x1b0'),util[_0x88c2('0xa3')](_0x88c2('0x1b1'),config[_0x88c2('0x8')][_0x88c2('0x193')]||_0x88c2('0x1b2'),_0x1bf2c4,this[_0x88c2('0x10')][_0x88c2('0x38')]));if(_0x3be91b[_0x88c2('0xaa')]===-0x1){return _0x3be91b;}return this['channel'][_0x88c2('0xaf')](util['format'](_0x88c2('0xc7'),_0x88c2('0x1b0'),_0x1bf2c4));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1b3')]=function(_0x3cb44b){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x1b4'),_0x3cb44b[_0x88c2('0x37')]));var _0x57673f=this[_0x88c2('0x56')][_0x88c2('0x73')](this,_0x3cb44b[_0x88c2('0xbe')]);this[_0x88c2('0x36')][_0x88c2('0x73')](this,_0x3cb44b,_0x3cb44b[_0x88c2('0xbe')]);if(this[_0x88c2('0x8a')](_0x3cb44b[_0x88c2('0xdb')])){var _0x1c869e=this[_0x88c2('0xa8')][_0x88c2('0x73')](this,_0x3cb44b[_0x88c2('0xdb')]);if(_0x1c869e){this[_0x88c2('0x10')][_0x88c2('0xa4')](_0x1c869e,_0x57673f);return this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x1b5'),_0x3cb44b[_0x88c2('0xbe')],_0x1c869e));}}return this[_0x88c2('0x10')]['noop'](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3cb44b[_0x88c2('0xbe')]));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1b6')]=function(_0x205e2d){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x1b7'),_0x205e2d[_0x88c2('0x37')]));_0x205e2d[_0x88c2('0x5c')]=_0x205e2d['text'][_0x88c2('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x88c2('0x8a')](_0x205e2d[_0x88c2('0x5b')])){return this[_0x88c2('0x10')][_0x88c2('0xaf')](_0x88c2('0x1b8'));}if(!this[_0x88c2('0x8a')](_0x205e2d['text'])){return this[_0x88c2('0x10')]['noop'](_0x88c2('0xb0'));}this['channel'][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x1b9'),_0x205e2d[_0x88c2('0x5c')]));var _0x23ba46=this[_0x88c2('0x5a')][_0x88c2('0x73')](this,_0x205e2d);if(_0x23ba46){this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x1ba'),_0x23ba46));var _0x3814aa=this[_0x88c2('0x10')]['streamFile'](_0x23ba46);try{fs['unlink'](_0x23ba46+_0x88c2('0x106'));}catch(_0x4a7ff0){logger['error'](_0x4a7ff0);}return _0x3814aa;}return this[_0x88c2('0x10')][_0x88c2('0x33')](_0x205e2d,_0x88c2('0x1bb'));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1bc')]=function(_0xb5c96a){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x1bd'),_0xb5c96a[_0x88c2('0x37')]));_0xb5c96a[_0x88c2('0x5c')]=_0xb5c96a['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0xb5c96a['text'])){return this[_0x88c2('0x10')][_0x88c2('0xaf')]('no\x20text\x20configured');}this[_0x88c2('0x10')]['noop'](util['format'](_0x88c2('0x1be'),_0xb5c96a[_0x88c2('0x5c')]));var _0x113718=this[_0x88c2('0x63')][_0x88c2('0x73')](this,_0xb5c96a);if(_0x113718){this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('Google\x20TTS\x20%s\x20file\x20created',_0x113718));var _0x5760ff=this[_0x88c2('0x10')][_0x88c2('0x104')](_0x113718);try{fs[_0x88c2('0x105')](_0x113718+'.wav');}catch(_0x12b345){logger[_0x88c2('0x33')](_0x12b345);}return _0x5760ff;}return this[_0x88c2('0x10')][_0x88c2('0x33')](_0xb5c96a,_0x88c2('0x1bf'));};AGIVertices['prototype'][_0x88c2('0x1c0')]=function(_0x4e30c2){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x1c1'),_0x4e30c2['label']));if(!this[_0x88c2('0x8a')](_0x4e30c2[_0x88c2('0x150')])){return this['channel'][_0x88c2('0x33')](_0x4e30c2,'no\x20find\x20by\x20configured');}logger[_0x88c2('0xab')](util[_0x88c2('0xa3')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x88c2('0x39')],_0x4e30c2['findBy']));var _0x4faf66=this['agentUnpause']['sync'](this,_0x4e30c2[_0x88c2('0x150')]);if(_0x4faf66){logger['info'](util[_0x88c2('0xa3')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x88c2('0x39')],_0x4e30c2['findBy']));this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x88c2('0x10')][_0x88c2('0x39')],_0x4e30c2[_0x88c2('0x150')]));return{'code':0xc8,'result':_0x88c2('0x154')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88c2('0x10')][_0x88c2('0x39')],_0x4e30c2[_0x88c2('0x150')]));this[_0x88c2('0x10')][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0x155'),this['channel'][_0x88c2('0x39')],_0x4e30c2[_0x88c2('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1c2')]=function(_0x2ace76){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x1c3'),_0x2ace76[_0x88c2('0x37')]));var _0x24255a=this[_0x88c2('0x10')][_0x88c2('0x57')](_0x88c2('0x1c4'),[_0x2ace76['mailbox'],_0x2ace76[_0x88c2('0x7c')]]);if(_0x24255a[_0x88c2('0xaa')]===-0x1){return _0x24255a;}return this['channel'][_0x88c2('0xaf')](util[_0x88c2('0xa3')](_0x88c2('0xc7'),_0x88c2('0x1c4'),_0x2ace76[_0x88c2('0x1c5')]));};AGIVertices[_0x88c2('0x13')][_0x88c2('0x1c6')]=function(_0x3c3e54){logger[_0x88c2('0xab')](util[_0x88c2('0xa3')](_0x88c2('0x1c7'),_0x3c3e54[_0x88c2('0x37')]));if(!this['isConfigured'](_0x3c3e54[_0x88c2('0xdb')])){return this['channel'][_0x88c2('0x33')](_0x3c3e54,_0x88c2('0x1a6'));}var _0x428350=this[_0x88c2('0xa8')][_0x88c2('0x73')](this,_0x3c3e54[_0x88c2('0xdb')]);if(!_0x428350){return this['channel'][_0x88c2('0x33')](_0x3c3e54,_0x88c2('0xdc'));}var _0x4ed286=this[_0x88c2('0x10')][_0x88c2('0xa8')](_0x428350);return{'code':0xc8,'result':_0x4ed286['extra']?_0x4ed286['extra']:'-'};};String[_0x88c2('0x13')][_0x88c2('0xa7')]=function(_0xc5c82b,_0x1f54dd){return this[_0x88c2('0xa6')](_0xc5c82b)[_0x88c2('0x1c8')](_0x1f54dd);};module[_0x88c2('0x1c9')]=AGIVertices;
\ No newline at end of file
+var _0xf571=['%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','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_secret_access_key','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','clone','hasOwnProperty','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','sync','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','delay','add','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','speech','DialogflowV2\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','audiofile','unlink','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','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\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','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','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','Smtp','user','subject','service','host','port','secure','authentication','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','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','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','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','.wav','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','join','exports','path','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getSquareProjectById','dsn','getUserById','getTrunk','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format'];(function(_0x31bc19,_0x35b132){var _0xacc68=function(_0x450924){while(--_0x450924){_0x31bc19['push'](_0x31bc19['shift']());}};_0xacc68(++_0x35b132);}(_0xf571,0x1a2));var _0x1f57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf571[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x1f57('0x0'));var util=require('util');var _=require(_0x1f57('0x1'));var sh=require('shelljs');var odbc=require(_0x1f57('0x2'))();var rs=require(_0x1f57('0x3'));var moment=require(_0x1f57('0x4'));var Mustache=require(_0x1f57('0x5'));var rp=require(_0x1f57('0x6'));var logger=require(_0x1f57('0x7'))(_0x1f57('0x8'));var config=require(_0x1f57('0x9'));var scripts=require(_0x1f57('0xa'));var FILES_PATH=_0x1f57('0xb');var recursiveMapAttributes=[_0x1f57('0xc'),_0x1f57('0xd')];var verticesWithRetry=[_0x1f57('0xe'),_0x1f57('0xf'),'getsecretdigits'];var AGIVertices=function(_0xff4b93,_0x11e693,_0x4724ab){this[_0x1f57('0x10')]=_0xff4b93;this[_0x1f57('0x11')]=_0x11e693;this[_0x1f57('0x12')]=_0x4724ab;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x14')]=function(_0x31c5af,_0x48ec80){this['rpc'][_0x1f57('0x15')](_0x31c5af)[_0x1f57('0x16')](function(_0x354cbc){_0x48ec80(null,_0x354cbc?_0x354cbc[_0x1f57('0x17')]:![]);})[_0x1f57('0x18')](function(_0x2fded4){_0x48ec80(_0x2fded4);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x19')]=function(_0x5f5705,_0x111481){this[_0x1f57('0x11')]['getVoiceQueueById'](_0x5f5705)['then'](function(_0x216a48){_0x111481(null,_0x216a48?_0x216a48['name']:![]);})[_0x1f57('0x18')](function(_0x30f6dd){_0x111481(_0x30f6dd);});};AGIVertices[_0x1f57('0x13')]['getSquareProject']=function(_0xb2b61f,_0x4cb8f2){this[_0x1f57('0x11')][_0x1f57('0x1a')](_0xb2b61f)[_0x1f57('0x16')](function(_0x3613cb){_0x4cb8f2(null,_0x3613cb?_0x3613cb[_0x1f57('0x17')]:![]);})[_0x1f57('0x18')](function(_0x16fbb5){_0x4cb8f2(_0x16fbb5);});};AGIVertices[_0x1f57('0x13')]['getSquareOdbc']=function(_0x56865a,_0x348d20){this[_0x1f57('0x11')]['getSquareOdbcById'](_0x56865a)[_0x1f57('0x16')](function(_0x313d48){_0x348d20(null,_0x313d48?_0x313d48[_0x1f57('0x1b')]:![]);})[_0x1f57('0x18')](function(_0x233db6){_0x348d20(_0x233db6);});};AGIVertices[_0x1f57('0x13')]['getUser']=function(_0x2a8c2c,_0x1f539e){this[_0x1f57('0x11')][_0x1f57('0x1c')](_0x2a8c2c)[_0x1f57('0x16')](function(_0x42c926){_0x1f539e(null,_0x42c926?_0x42c926[_0x1f57('0x17')]:![]);})['catch'](function(_0x1b26fc){_0x1f539e(_0x1b26fc);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1d')]=function(_0xc57542,_0x1c0b0f){this[_0x1f57('0x11')]['getTrunkById'](_0xc57542)[_0x1f57('0x16')](function(_0xa5127b){_0x1c0b0f(null,_0xa5127b?_0xa5127b[_0x1f57('0x17')]:![]);})['catch'](function(_0x58c93d){_0x1c0b0f(_0x58c93d);});};AGIVertices[_0x1f57('0x13')]['getSound']=function(_0x4e5600,_0x5d0e45){var _0x46b70f=this;this[_0x1f57('0x11')]['getSoundById'](_0x4e5600)[_0x1f57('0x16')](function(_0x156296){_0x5d0e45(null,_0x156296?_0x46b70f[_0x1f57('0x1e')](_0x156296[_0x1f57('0x1f')]):![]);})['catch'](function(_0x51fadb){_0x5d0e45(_0x51fadb);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x20')]=function(_0x11af48,_0x364bb7){this[_0x1f57('0x11')][_0x1f57('0x21')](_0x11af48)[_0x1f57('0x16')](function(_0x366e9a){_0x364bb7(null,_0x366e9a?_0x366e9a:![]);})['catch'](function(_0x41d02d){_0x364bb7(_0x41d02d);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x22')]=function(_0x947b4f,_0x2d7528,_0x259bd4){this[_0x1f57('0x12')][_0x1f57('0x22')](_0x947b4f,_0x2d7528)[_0x1f57('0x16')](function(){_0x259bd4(null);})['catch'](function(_0x42a802){_0x259bd4(_0x42a802);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x23')]=function(_0xdc1625,_0x23640c){this[_0x1f57('0x11')][_0x1f57('0x24')](_0xdc1625)[_0x1f57('0x16')](function(_0x5b1850){if(_0x5b1850){if(_0x5b1850[_0x1f57('0x25')]){_0x23640c(null,[_0x5b1850[_0x1f57('0x26')]]);}else{_0x23640c(null,_[_0x1f57('0x27')](_0x5b1850[_0x1f57('0x28')],'interval'));}}else{_0x23640c(null,![]);}})[_0x1f57('0x18')](function(_0x330d5a){_0x23640c(_0x330d5a);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1e')]=function(_0x5ef737){return util[_0x1f57('0x29')](_0x1f57('0x2a'),FILES_PATH,_0x5ef737);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x2b')]=function(_0x2d0153,_0x5d0755,_0x2aa1f6){odbc[_0x1f57('0x2c')](_0x2d0153,function(_0x444665){if(_0x444665){logger[_0x1f57('0x2d')](_0x1f57('0x2e'),_0x444665);_0x2aa1f6(_0x444665);}else{logger[_0x1f57('0x2f')](_0x1f57('0x30'));odbc['query'](_0x5d0755,function(_0x20768e,_0x2fce1e){if(_0x20768e){logger[_0x1f57('0x2f')](_0x1f57('0x31'),_0x5d0755);_0x2aa1f6(_0x20768e);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x5d0755);odbc[_0x1f57('0x32')](function(_0x546a8c){if(_0x546a8c){logger['error'](_0x1f57('0x33'),_0x546a8c);}_0x2aa1f6(null,_0x2fce1e);});}});}});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x34')]=function(_0xa534f3,_0x1ff531){this[_0x1f57('0x11')][_0x1f57('0x35')](_0xa534f3)[_0x1f57('0x16')](function(_0x4993a9){_0x1ff531(null,_0x4993a9?_0x4993a9:![]);})[_0x1f57('0x18')](function(_0x148c7a){_0x1ff531(_0x148c7a);});};AGIVertices[_0x1f57('0x13')]['createSmsMessage']=function(_0xbedeb0,_0x533529){this['rpc'][_0x1f57('0x36')](_0xbedeb0)[_0x1f57('0x16')](function(_0x35e3c7){_0x533529(null,_0x35e3c7);})[_0x1f57('0x18')](function(_0x348788){_0x533529(_0x348788);});};AGIVertices[_0x1f57('0x13')]['createSquareDetailsReport']=function(_0x405411,_0x13b525,_0x204090){this['rpc'][_0x1f57('0x37')]({'uniqueid':this[_0x1f57('0x10')][_0x1f57('0x38')],'node':_0x405411[_0x1f57('0x39')],'application':_0x405411[_0x1f57('0x3a')],'data':_0x13b525||null,'project_name':this['channel'][_0x1f57('0x3b')],'callerid':this[_0x1f57('0x10')][_0x1f57('0x3c')]})[_0x1f57('0x16')](function(_0x3d6863){if(_0x204090){_0x204090(null,_0x3d6863);}})[_0x1f57('0x18')](function(_0x1b8f44){if(_0x204090){_0x204090(_0x1b8f44);}});};AGIVertices['prototype'][_0x1f57('0x3d')]=function(_0x4ad4c8,_0x35ee93,_0x2a5707,_0x56746b){this[_0x1f57('0x11')]['createSquareRecording']({'uniqueid':this[_0x1f57('0x10')][_0x1f57('0x38')],'callerid':this[_0x1f57('0x10')][_0x1f57('0x3c')],'calleridname':this[_0x1f57('0x10')][_0x1f57('0x3e')],'context':this[_0x1f57('0x10')][_0x1f57('0x3f')],'extension':this['channel']['extension'],'priority':this[_0x1f57('0x10')][_0x1f57('0x40')],'accountcode':this[_0x1f57('0x10')][_0x1f57('0x41')],'dnid':this[_0x1f57('0x10')][_0x1f57('0x42')],'projectName':this['channel'][_0x1f57('0x3b')],'saveName':_0x35ee93,'filename':_0x4ad4c8['file']||_0x35ee93,'savePath':_0x2a5707})['then'](function(_0x184187){_0x56746b(null,_0x184187);})[_0x1f57('0x18')](function(_0x22b173){_0x56746b(_0x22b173);});};AGIVertices[_0x1f57('0x13')]['createSquareMessage']=function(_0x16a29c,_0x59f6ed,_0x2c23d5,_0x5b6bb7,_0x51ee49){this['rpc'][_0x1f57('0x43')]({'uniqueid':this[_0x1f57('0x10')]['uniqueid'],'body':_0x16a29c,'direction':_0x59f6ed,'providerName':_0x2c23d5,'providerResponse':_0x5b6bb7})[_0x1f57('0x16')](function(_0x4dffb4){if(_0x51ee49){_0x51ee49(null,_0x4dffb4);}})[_0x1f57('0x18')](function(_0x3dd80b){if(_0x51ee49){_0x51ee49(_0x3dd80b);}});};AGIVertices[_0x1f57('0x13')]['createCmContact']=function(_0x33dbab,_0x3ccc36){this['rpc'][_0x1f57('0x44')]({'firstName':_[_0x1f57('0x45')](_0x33dbab[_0x1f57('0x17')])||_[_0x1f57('0x46')](_0x33dbab[_0x1f57('0x17')])?'callback_'+Math['random']():_0x33dbab['name'],'lastName':_[_0x1f57('0x45')](_0x33dbab[_0x1f57('0x47')])||_[_0x1f57('0x46')](_0x33dbab['lastName'])?null:_0x33dbab[_0x1f57('0x47')],'phone':_0x33dbab[_0x1f57('0x48')],'ListId':_0x33dbab[_0x1f57('0x49')],'scheduledat':_0x33dbab['scheduledAt'],'callbackUniqueid':this[_0x1f57('0x10')][_0x1f57('0x38')],'tags':_0x1f57('0x4a'),'description':_0x1f57('0x4b')+_0x33dbab[_0x1f57('0x4c')][_0x1f57('0x4d')](),'priority':_0x33dbab[_0x1f57('0x4e')]})['then'](function(_0x3358c4){_0x3ccc36(null,_0x3358c4);})[_0x1f57('0x18')](function(_0x5dd0dc){_0x3ccc36(_0x5dd0dc);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x4f')]=function(_0x1e35f2,_0x5ddf45){this['rpc'][_0x1f57('0x50')](_0x1e35f2)[_0x1f57('0x16')](function(_0x170a9d){_0x5ddf45(null,_0x170a9d?_0x170a9d[_0x1f57('0x17')]:![]);})[_0x1f57('0x18')](function(_0x32c892){_0x5ddf45(_0x32c892);});};AGIVertices['prototype'][_0x1f57('0x51')]=function(_0x4e435d,_0x5c56db,_0x17142b){var _0x535035={'role':'agent'};_0x535035[_0x4e435d]=this[_0x1f57('0x10')][_0x1f57('0x3c')];this['rpc'][_0x1f57('0x51')](_0x535035,_0x5c56db,this[_0x1f57('0x10')][_0x1f57('0x38')])[_0x1f57('0x16')](function(_0x82cd95){_0x17142b(null,_[_0x1f57('0x46')](_0x82cd95)?![]:!![]);})[_0x1f57('0x18')](function(_0x3bc59a){logger[_0x1f57('0x2d')](_0x3bc59a);_0x17142b(null,![]);});};AGIVertices[_0x1f57('0x13')]['agentUnpause']=function(_0x19c8d7,_0x4b1c6b){var _0x36f217={'role':_0x1f57('0x52')};_0x36f217[_0x19c8d7]=this[_0x1f57('0x10')][_0x1f57('0x3c')];this[_0x1f57('0x11')][_0x1f57('0x53')](_0x36f217)[_0x1f57('0x16')](function(_0x146490){_0x4b1c6b(null,_[_0x1f57('0x46')](_0x146490)?![]:!![]);})['catch'](function(_0x476206){logger[_0x1f57('0x2d')](_0x476206);_0x4b1c6b(null,![]);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x54')]=function(_0x36a50d,_0x94eba8){var _0x265a9b={'role':'agent'};_0x265a9b[_0x36a50d]=this[_0x1f57('0x10')]['callerid'];this[_0x1f57('0x11')]['agentLogout'](_0x265a9b)[_0x1f57('0x16')](function(_0x329f75){_0x94eba8(null,_['isNil'](_0x329f75)?![]:!![]);})['catch'](function(_0x35388c){logger['error'](_0x35388c);_0x94eba8(null,![]);});};AGIVertices['prototype'][_0x1f57('0x55')]=function(_0x28e06f,_0x4b267d){var _0x38e69e={'role':_0x1f57('0x52')};_0x38e69e[_0x28e06f]=this[_0x1f57('0x10')][_0x1f57('0x3c')];var _0x1b39b1=_0x28e06f!=_0x1f57('0x56')?util[_0x1f57('0x29')](_0x1f57('0x57'),_0x1f57('0x58'),this[_0x1f57('0x10')][_0x1f57('0x3c')]):undefined;this[_0x1f57('0x11')][_0x1f57('0x55')](_0x38e69e,_0x1b39b1)[_0x1f57('0x16')](function(_0x540b62){_0x4b267d(null,_[_0x1f57('0x46')](_0x540b62)?![]:!![]);})[_0x1f57('0x18')](function(_0x4a6c79){logger[_0x1f57('0x2d')](_0x4a6c79);_0x4b267d(null,![]);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x59')]=function(_0x5aa576,_0x4c97e5){sh[_0x1f57('0x5a')](_['trim'](_0x5aa576),function(_0x53519c,_0xe7fb3e){var _0x2acc99=_0xe7fb3e[_0x1f57('0x5b')](/(\r\n|\n|\r)/gm,'');_0x4c97e5(null,_0x2acc99);});};AGIVertices[_0x1f57('0x13')]['googleCloudTTS']=function(_0x42d978,_0xfa6b2e){scripts[_0x1f57('0x5c')](_0x42d978[_0x1f57('0x5d')],_0x42d978['google_cloud_tts_text_type']||_0x1f57('0x5e'),_0x42d978['text'],_0x42d978[_0x1f57('0x5f')]||_0x1f57('0x60'),_0x42d978[_0x1f57('0x61')]||_0x1f57('0x62'),_0x42d978[_0x1f57('0x63')]||_0x1f57('0x64'))[_0x1f57('0x16')](function(_0x27dede){_0xfa6b2e(null,_0x27dede);})[_0x1f57('0x18')](function(_0x22a1a8){_0xfa6b2e(_0x22a1a8);});};AGIVertices['prototype']['googleTTS']=function(_0x176a3d,_0x1a97fa){scripts[_0x1f57('0x65')](_0x176a3d[_0x1f57('0x5e')],_0x176a3d['google_tts_language']||'en',0x1)[_0x1f57('0x16')](function(_0x2af1a9){_0x1a97fa(null,_0x2af1a9);})[_0x1f57('0x18')](function(_0x304a8d){_0x1a97fa(_0x304a8d);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x66')]=function(_0x4ec814,_0x56f8bf){var _0x308834={'uri':_0x4ec814[_0x1f57('0x67')],'method':_0x4ec814[_0x1f57('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4ec814[_0x1f57('0x69')])===_0x1f57('0x6a')&&parseInt(_0x4ec814['timeout'])>=0x1?parseInt(_0x4ec814[_0x1f57('0x69')])*0x3e8:0x5*0x3e8};if(_[_0x1f57('0x6b')]([_0x1f57('0x6c'),_0x1f57('0x6d')],_0x308834[_0x1f57('0x68')][_0x1f57('0x6e')]())){try{_0x308834[_0x1f57('0x6f')]=_0x4ec814[_0x1f57('0xd')]?JSON[_0x1f57('0x70')](_0x4ec814['rawBody']):{};}catch(_0x245a99){logger['error'](_0x1f57('0x71'),_0x245a99);}}try{_0x308834[_0x1f57('0x72')]=_0x4ec814[_0x1f57('0xc')]?JSON[_0x1f57('0x70')](_0x4ec814[_0x1f57('0xc')]):{};}catch(_0x22f7a7){logger['error'](_0x1f57('0x73'),_0x22f7a7);}if(_0x4ec814['computedVariables']){try{var _0x4e8aa9=require(_0x4ec814['computedVariables'])['sync'](this,_0x308834);_0x308834['uri']=Mustache[_0x1f57('0x74')](_0x4ec814[_0x1f57('0x67')],_0x4e8aa9,{},['$$','$$']);if(_0x308834[_0x1f57('0x72')]){_0x308834[_0x1f57('0x72')]=JSON[_0x1f57('0x70')](Mustache['render'](JSON['stringify'](_0x308834['headers']),_0x4e8aa9,{},['$$','$$']));}if(_0x308834[_0x1f57('0x6f')]){_0x308834[_0x1f57('0x6f')]=JSON[_0x1f57('0x70')](Mustache[_0x1f57('0x74')](JSON[_0x1f57('0x75')](_0x308834[_0x1f57('0x6f')]),_0x4e8aa9,{},['$$','$$']));}}catch(_0x1bb928){logger[_0x1f57('0x2d')](_0x1f57('0x76'),_0x1bb928);}}rp(_0x308834)[_0x1f57('0x16')](function(_0x319880){var _0x157770={'statusCode':_0x319880['statusCode']||0xc8,'statusMessage':_0x319880[_0x1f57('0x77')]||'OK','headers':_0x319880[_0x1f57('0x72')]||{},'body':_0x319880[_0x1f57('0x6f')]||{}};_0x56f8bf(null,_0x157770);})[_0x1f57('0x18')](function(_0x13c2e4){var _0x1b74dd={'statusCode':_0x13c2e4[_0x1f57('0x78')]||0x1f4,'statusMessage':_0x13c2e4[_0x1f57('0x79')]||_0x1f57('0x7a'),'headers':_0x13c2e4['options'][_0x1f57('0x72')]||{},'body':_0x13c2e4[_0x1f57('0x7b')][_0x1f57('0x6f')]||{}};_0x56f8bf(null,_0x1b74dd);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x7c')]=function(_0x1e0581,_0x6806e6){scripts[_0x1f57('0x7c')](this[_0x1f57('0x10')][_0x1f57('0x38')],_0x1e0581[_0x1f57('0x7d')],_0x1e0581[_0x1f57('0x5e')],_0x1e0581[_0x1f57('0x7e')]||'en')[_0x1f57('0x16')](function(_0x25ae0f){_0x6806e6(null,_0x25ae0f);})[_0x1f57('0x18')](function(_0x454165){_0x6806e6(_0x454165);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x7f')]=function(_0x289a94,_0x1cc23d){scripts['googleDialogflowV2'](this[_0x1f57('0x10')][_0x1f57('0x38')],_0x289a94[_0x1f57('0x80')],_0x289a94[_0x1f57('0x81')],_0x289a94[_0x1f57('0x82')],_0x289a94['text'],_0x289a94['dialogflowV2_language']||'en')[_0x1f57('0x16')](function(_0x55b780){_0x1cc23d(null,_0x55b780);})['catch'](function(_0x5b1467){_0x1cc23d(_0x5b1467);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x83')]=function(_0x2fb87f,_0x6eea1b){scripts[_0x1f57('0x83')](this[_0x1f57('0x10')],_0x2fb87f)[_0x1f57('0x16')](function(_0x16e887){_0x6eea1b(null,_0x16e887);})[_0x1f57('0x18')](function(_0xb482a4){_0x6eea1b(_0xb482a4);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x84')]=function(_0x3bd29a,_0x27cbb4){scripts[_0x1f57('0x84')](_0x3bd29a[_0x1f57('0x7d')],_0x3bd29a['text'],_0x3bd29a[_0x1f57('0x85')]||_0x1f57('0x60'),_0x3bd29a[_0x1f57('0x86')])[_0x1f57('0x16')](function(_0x3068da){_0x27cbb4(null,_0x3068da);})[_0x1f57('0x18')](function(_0x479349){_0x27cbb4(_0x479349);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x87')]=function(_0x12894a,_0x21ccf5,_0x5603f9){scripts['ispeechASR'](_0x21ccf5,_0x12894a[_0x1f57('0x7d')],_0x12894a[_0x1f57('0x88')]||_0x1f57('0x60'),this[_0x1f57('0x89')](_0x12894a[_0x1f57('0x8a')])?_0x12894a[_0x1f57('0x8a')]:undefined)['then'](function(_0x15a41f){_0x5603f9(null,_0x15a41f);})[_0x1f57('0x18')](function(_0x2a2850){_0x5603f9(_0x2a2850);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x8b')]=function(_0x372f73,_0x875940){scripts[_0x1f57('0x8b')](_0x372f73['aws_access_key_id'],_0x372f73[_0x1f57('0x8c')],_0x372f73['aws_polly_region'],_0x372f73['aws_polly_voice']||_0x1f57('0x8d'),_0x372f73['text'],_0x372f73[_0x1f57('0x8e')]||_0x1f57('0x5e'))[_0x1f57('0x16')](function(_0x169af4){_0x875940(null,_0x169af4);})[_0x1f57('0x18')](function(_0x4385ca){_0x875940(_0x4385ca);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x8f')]=function(_0x25c355,_0x388ced){scripts[_0x1f57('0x8f')](this[_0x1f57('0x10')][_0x1f57('0x38')],_0x25c355['aws_access_key_id'],_0x25c355[_0x1f57('0x8c')],_0x25c355[_0x1f57('0x90')],_0x25c355[_0x1f57('0x5e')],_0x25c355[_0x1f57('0x91')])[_0x1f57('0x16')](function(_0x1c62c1){_0x388ced(null,_0x1c62c1);})[_0x1f57('0x18')](function(_0x4d3c3a){_0x388ced(_0x4d3c3a);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x92')]=function(_0x519748,_0xae1186,_0x3c9dff){scripts[_0x1f57('0x92')](_0xae1186,_0x519748['key'],_0x519748[_0x1f57('0x93')]||_0x1f57('0x60'))['then'](function(_0x4de9c8){_0x3c9dff(null,_0x4de9c8);})[_0x1f57('0x18')](function(_0x214bea){_0x3c9dff(_0x214bea);});};AGIVertices['prototype'][_0x1f57('0x94')]=function(_0x407668,_0x95b9cc,_0x340e8e){scripts[_0x1f57('0x94')](_0x95b9cc,_0x407668['appid'],_0x407668[_0x1f57('0x95')],_0x407668[_0x1f57('0x96')])['then'](function(_0x2d3775){_0x340e8e(null,_0x2d3775);})[_0x1f57('0x18')](function(_0x3955f6){_0x340e8e(_0x3955f6);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x97')]=function(_0x12e7c5){var _0x2571af=_[_0x1f57('0x6b')](verticesWithRetry,_0x12e7c5['agicommand'])?_0x12e7c5:_[_0x1f57('0x98')](_0x12e7c5);for(var _0x4a44b9 in _0x2571af){if(_0x2571af[_0x1f57('0x99')](_0x4a44b9)){if(_0x2571af[_0x4a44b9]&&_['isString'](_0x2571af[_0x4a44b9])){if(_['includes'](recursiveMapAttributes,_0x4a44b9)){_0x2571af[_0x4a44b9]=this['replaceObjectAllVariables'](_0x2571af[_0x4a44b9]);}else{_0x2571af[_0x4a44b9]=this[_0x1f57('0x9a')](_0x2571af[_0x4a44b9]);}}}}return _0x2571af;};AGIVertices[_0x1f57('0x13')]['recursiveNodeIndex']=function(_0x50f1aa){for(var _0x37b4d3 in _0x50f1aa){if(_0x50f1aa['hasOwnProperty'](_0x37b4d3)){if(_[_0x1f57('0x9b')](_0x50f1aa[_0x37b4d3])){this[_0x1f57('0x9c')](_0x50f1aa[_0x37b4d3]);}else if(_[_0x1f57('0x9d')](_0x50f1aa[_0x37b4d3])){for(var _0x1eab06=0x0;_0x1eab06<_0x50f1aa[_0x37b4d3][_0x1f57('0x9e')];_0x1eab06++){this[_0x1f57('0x9c')](_0x50f1aa[_0x37b4d3][_0x1eab06]);}}else if(_[_0x1f57('0x9f')](_0x50f1aa[_0x37b4d3])){_0x50f1aa[_0x37b4d3]=this[_0x1f57('0x9a')](_0x50f1aa[_0x37b4d3]);}}}};AGIVertices['prototype'][_0x1f57('0xa0')]=function(_0x271e6a,_0x3542e8){for(var _0x25e890 in _0x271e6a){if(_0x271e6a[_0x1f57('0x99')](_0x25e890)){if(_[_0x1f57('0x9b')](_0x271e6a[_0x25e890])){if(!_[_0x1f57('0x45')](_0x271e6a[_0x25e890])){this[_0x1f57('0xa0')](_0x271e6a[_0x25e890],util[_0x1f57('0x29')](_0x1f57('0xa1'),_0x3542e8,_0x25e890));}}else if(_[_0x1f57('0x9d')](_0x271e6a[_0x25e890])){for(var _0xfa3ce6=0x0;_0xfa3ce6<_0x271e6a[_0x25e890][_0x1f57('0x9e')];_0xfa3ce6++){this[_0x1f57('0xa0')](_0x271e6a[_0x25e890][_0xfa3ce6],util[_0x1f57('0x29')](_0x1f57('0xa1'),_0x3542e8,_0x25e890+'['+_0xfa3ce6+']'));}}else{if(!_[_0x1f57('0x46')](_0x271e6a[_0x25e890])){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0xa1'),_0x3542e8,_0x25e890),_0x271e6a[_0x25e890]);}}}}};AGIVertices['prototype'][_0x1f57('0xa3')]=function(_0x1487a9){try{var _0x1938fc=JSON['parse'](_0x1487a9);this[_0x1f57('0x9c')](_0x1938fc);return JSON[_0x1f57('0x75')](_0x1938fc);}catch(_0x161640){return this[_0x1f57('0x9a')](_0x1487a9);}};AGIVertices[_0x1f57('0x13')][_0x1f57('0x9a')]=function(_0x456040){var _0x1aa6a4=_0x456040['split']('{');for(var _0x4ed068=0x1;_0x4ed068<_0x1aa6a4['length'];_0x4ed068+=0x1){var _0x57e8c7=_0x1aa6a4[_0x4ed068][_0x1f57('0xa4')]('}');if(_0x57e8c7['length']>0x1){_0x456040=_0x456040['replaceAll']('{'+_0x57e8c7[0x0]+'}',this['channel'][_0x1f57('0x14')](_0x57e8c7[0x0])['extra']||_0x57e8c7[0x0]);}}if(_0x1aa6a4['length']===0x1){return _0x456040['toString']();}return this[_0x1f57('0x9a')](_0x456040);};AGIVertices[_0x1f57('0x13')]['getAndSetVariable']=function(_0x1c1201,_0x353ef5){var _0x1c2612=this[_0x1f57('0x10')]['getVariable'](_0x1c1201);if(_0x1c2612[_0x1f57('0xa5')]===-0x1){return _0x1c2612;}logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xa6'),_0x353ef5,_0x1c2612[_0x1f57('0xa7')]));return this[_0x1f57('0x10')][_0x1f57('0xa2')](_0x353ef5,_0x1c2612[_0x1f57('0xa7')]);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x89')]=function(_0x40c1ec){return _0x40c1ec&&_0x40c1ec!=='0'&&_0x40c1ec!=='-1'&&_0x40c1ec!=='';};AGIVertices[_0x1f57('0x13')][_0x1f57('0xa8')]=function(_0x29a123){this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x29a123,'-');_0x29a123[_0x1f57('0xaa')]=_0x29a123[_0x1f57('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1f57('0x13')]['mrcpsynth']=function(_0x59be09){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0xab'),_0x59be09[_0x1f57('0x39')]));if(!this['isConfigured'](_0x59be09[_0x1f57('0x5e')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xad'));}var _0x5ec10b='\x22'+_0x59be09['text']+'\x22';if(this[_0x1f57('0x89')](_0x59be09['options'])){_0x5ec10b+=','+_0x59be09[_0x1f57('0x7b')];}var _0x2a4567=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xae'),_0x5ec10b);if(_0x2a4567['result']===-0x1){return _0x2a4567;}return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5ec10b));};AGIVertices[_0x1f57('0x13')][_0x1f57('0xaf')]=function(_0x1a21fe){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1a21fe[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x1a21fe[_0x1f57('0xb0')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xb1'));}var _0xa2bd7b=_0x1a21fe['grammar'];if(this[_0x1f57('0x89')](_0x1a21fe[_0x1f57('0x7b')])){_0xa2bd7b+=','+_0x1a21fe[_0x1f57('0x7b')];}var _0x5e2668=this['channel'][_0x1f57('0x5a')](_0x1f57('0xb2'),_0xa2bd7b);if(_0x5e2668[_0x1f57('0xa5')]===-0x1){return _0x5e2668;}var _0x996a28=this[_0x1f57('0xb3')](_0x1f57('0xb4'),_0x1f57('0xb5'));if(_0x996a28['result']===-0x1){return _0x996a28;}var _0x51fd2f=this[_0x1f57('0xb3')](_0x1f57('0xb6'),_0x1f57('0xb7'));if(_0x51fd2f[_0x1f57('0xa5')]===-0x1){return _0x51fd2f;}var _0x1e374c=this[_0x1f57('0xb3')]('RECOG_INSTANCE()',_0x1f57('0xb8'));if(_0x1e374c[_0x1f57('0xa5')]===-0x1){return _0x1e374c;}return this[_0x1f57('0x10')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0xa2bd7b));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x8')]=function(_0x3baab7){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xb9'),_0x3baab7[_0x1f57('0x39')]));return this[_0x1f57('0x10')]['agi']([_0x3baab7['command'],_0x3baab7[_0x1f57('0xba')]]);};AGIVertices['prototype']['answer']=function(_0x599d9c){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xbb'),_0x599d9c[_0x1f57('0x39')]));if(this[_0x1f57('0x89')](_0x599d9c[_0x1f57('0x69')])){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0xbc'),_0x599d9c[_0x1f57('0x69')]));var _0x4de554=this[_0x1f57('0x10')][_0x1f57('0xbd')](_0x599d9c[_0x1f57('0x69')]);if(_0x4de554['result']===-0x1){return _0x4de554;}}return this[_0x1f57('0x10')]['answer']();};AGIVertices['prototype'][_0x1f57('0x4a')]=function(_0x3d53af){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x3d53af[_0x1f57('0x39')]));if(!this['isConfigured'](_0x3d53af[_0x1f57('0x49')])){return this['channel'][_0x1f57('0x2d')](_0x3d53af,'no\x20list\x20selected');}_0x3d53af[_0x1f57('0x4c')]=moment();if(this[_0x1f57('0x89')](_0x3d53af[_0x1f57('0xbe')])){_0x3d53af[_0x1f57('0x4c')]=moment()[_0x1f57('0xbf')](_0x3d53af[_0x1f57('0xbe')],'minutes');}if(!this['isConfigured'](_0x3d53af[_0x1f57('0x4e')])){_0x3d53af[_0x1f57('0x4e')]=0x2;}this[_0x1f57('0x44')][_0x1f57('0xa9')](this,_0x3d53af);return this['channel'][_0x1f57('0xac')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3d53af[_0x1f57('0x48')],_0x3d53af[_0x1f57('0x49')],_0x3d53af[_0x1f57('0x4c')]));};AGIVertices[_0x1f57('0x13')][_0x1f57('0xc0')]=function(_0x464376){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0xc1'),_0x464376['label']));var _0xd5c5ef=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x464376['application'],_0x464376[_0x1f57('0x7b')]);if(_0xd5c5ef['result']===-0x1){return _0xd5c5ef;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0xc2'),_0x464376['application'],_0x464376[_0x1f57('0x7b')]));};AGIVertices[_0x1f57('0x13')]['lumenvoxtts']=function(_0x191091){logger['info'](util[_0x1f57('0x29')](_0x1f57('0xc3'),_0x191091[_0x1f57('0x39')]));if(!this['isConfigured'](_0x191091[_0x1f57('0x5e')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}var _0x156321='\x22'+_0x191091[_0x1f57('0x5e')]+'\x22';if(this[_0x1f57('0x89')](_0x191091[_0x1f57('0x7b')])){_0x156321+=','+_0x191091[_0x1f57('0x7b')];}var _0x3ab72f=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xae'),_0x156321);if(_0x3ab72f['result']===-0x1){return _0x3ab72f;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x156321));};AGIVertices[_0x1f57('0x13')]['sestektts']=function(_0x3bbfc0){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xc4'),_0x3bbfc0[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x3bbfc0[_0x1f57('0x5e')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}var _0x33bdd8='\x22'+_0x3bbfc0[_0x1f57('0x5e')]+'\x22';if(this[_0x1f57('0x89')](_0x3bbfc0[_0x1f57('0x7b')])){_0x33bdd8+=','+_0x3bbfc0[_0x1f57('0x7b')];}var _0x25222a=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xae'),_0x33bdd8);if(_0x25222a['result']===-0x1){return _0x25222a;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xc5'),_0x33bdd8));};AGIVertices[_0x1f57('0x13')]['lumenvoxasr']=function(_0x2fde22){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xc6'),_0x2fde22['label']));if(!this[_0x1f57('0x89')](_0x2fde22[_0x1f57('0xb0')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xb1'));}var _0x5cde4d=_0x2fde22[_0x1f57('0xb0')];if(this[_0x1f57('0x89')](_0x2fde22[_0x1f57('0x7b')])){_0x5cde4d+=','+_0x2fde22['options'];}var _0x50d83d=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xb2'),_0x5cde4d);if(_0x50d83d['result']===-0x1){return _0x50d83d;}var _0x532af4=this[_0x1f57('0xb3')]('RECOG_CONFIDENCE()',_0x1f57('0xc7'));if(_0x532af4[_0x1f57('0xa5')]===-0x1){return _0x532af4;}var _0x320790=this['getAndSetVariable'](_0x1f57('0xb6'),_0x1f57('0xc8'));if(_0x320790['result']===-0x1){return _0x320790;}var _0x247b63=this['getAndSetVariable'](_0x1f57('0xc9'),_0x1f57('0xca'));if(_0x247b63[_0x1f57('0xa5')]===-0x1){return _0x247b63;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5cde4d));};AGIVertices['prototype']['sestekasr']=function(_0x1255fd){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xcb'),_0x1255fd['label']));if(!this[_0x1f57('0x89')](_0x1255fd[_0x1f57('0xb0')])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20grammar\x20configured');}var _0x3bdaec=_0x1255fd['grammar'];if(this['isConfigured'](_0x1255fd['options'])){_0x3bdaec+=','+_0x1255fd[_0x1f57('0x7b')];}var _0x232e42=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xb2'),_0x3bdaec);if(_0x232e42['result']===-0x1){return _0x232e42;}var _0x5d0357=this[_0x1f57('0xb3')](_0x1f57('0xb4'),_0x1f57('0xcc'));if(_0x5d0357[_0x1f57('0xa5')]===-0x1){return _0x5d0357;}var _0xc816ec=this['getAndSetVariable'](_0x1f57('0xb6'),_0x1f57('0xcd'));if(_0xc816ec['result']===-0x1){return _0xc816ec;}var _0x483977=this[_0x1f57('0xb3')](_0x1f57('0xc9'),_0x1f57('0xce'));if(_0x483977['result']===-0x1){return _0x483977;}return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0xcf'),_0x3bdaec));};AGIVertices[_0x1f57('0x13')]['database']=function(_0x457ae0){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0xd0'),_0x457ae0['label']));if(!this[_0x1f57('0x89')](_0x457ae0[_0x1f57('0xd1')])){return this[_0x1f57('0x10')]['error'](_0x457ae0,_0x1f57('0xd2'));}var _0x45124d=this[_0x1f57('0xd3')][_0x1f57('0xa9')](this,_0x457ae0[_0x1f57('0xd1')]);if(!_0x45124d){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x457ae0,_0x1f57('0xd4'));}if(!this[_0x1f57('0x89')](_0x457ae0[_0x1f57('0xd5')])){return this[_0x1f57('0x10')]['error'](_0x457ae0,_0x1f57('0xd6'));}var _0x5512cc=_0x457ae0[_0x1f57('0xd5')][_0x1f57('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xd7'),_0x5512cc));var _0x18d9f7=this['getQueryOdbc'][_0x1f57('0xa9')](this,_0x45124d,_0x5512cc);this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x457ae0,_0x5512cc);if(!this[_0x1f57('0x89')](_0x457ae0[_0x1f57('0xd8')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xd9'));}var _0x41be39=this[_0x1f57('0x14')][_0x1f57('0xa9')](this,_0x457ae0[_0x1f57('0xd8')]);if(!_0x41be39){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x457ae0,_0x1f57('0xda'));}var _0x41f9f4=this;_0x18d9f7['forEach'](function(_0x13ed5a,_0x557931){Object['keys'](_0x13ed5a)['forEach'](function(_0xd3398c){_0x41f9f4[_0x1f57('0x10')]['setVariable'](util['format'](_0x1f57('0xdb'),_0x41be39,_0x557931,_0xd3398c),_0x13ed5a[_0xd3398c]);});});this['channel'][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0xdc'),_0x41be39),_0x18d9f7[_0x1f57('0x9e')]);return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xdd'),_0x41be39));};AGIVertices[_0x1f57('0x13')]['dial']=function(_0x57022e){logger[_0x1f57('0xde')](util[_0x1f57('0x29')](_0x1f57('0xdf'),_0x57022e['label']));if(!this[_0x1f57('0x89')](_0x57022e[_0x1f57('0xe0')])){return this[_0x1f57('0x10')]['error'](_0x57022e,_0x1f57('0xe1'));}var _0x512a94=this[_0x1f57('0xe2')][_0x1f57('0xa9')](this,_0x57022e[_0x1f57('0xe0')]);if(!_0x512a94){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x57022e,_0x1f57('0xe3'));}var _0x32d5fc=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xe4'),[util[_0x1f57('0x29')](_0x1f57('0xe5'),_0x512a94),_0x57022e[_0x1f57('0x69')],_0x57022e[_0x1f57('0xe6')],_0x57022e['url']]);if(_0x32d5fc[_0x1f57('0xa5')]===-0x1){return _0x32d5fc;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0xe7'),_0x1f57('0xe4')));};AGIVertices[_0x1f57('0x13')]['dialogflow']=function(_0x38798b){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xe8'),_0x38798b[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x38798b['key'])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x38798b[_0x1f57('0x5e')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xad'));}this[_0x1f57('0x10')][_0x1f57('0xe9')]=!![];this['createSquareDetailsReport'](_0x38798b);this['createSquareMessage'](_0x38798b[_0x1f57('0x5e')],'in','','');this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0xea'),_0x38798b['text']));var _0x5ad99c=this['googleDialogflow'][_0x1f57('0xa9')](this,_0x38798b);if(_0x5ad99c){for(var _0x595f29 in _0x5ad99c){if(_0x5ad99c[_0x1f57('0x99')](_0x595f29)){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0xeb'),_0x595f29[_0x1f57('0x6e')]()),_0x5ad99c[_0x595f29]);}}this[_0x1f57('0x43')](_0x5ad99c['speech'],_0x1f57('0xec'),'dialogflow','');return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0xed'),_0x5ad99c['speech']));}return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x38798b,_0x1f57('0xee'));};AGIVertices['prototype'][_0x1f57('0xef')]=function(_0x4d12ea){logger['info'](util[_0x1f57('0x29')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x4d12ea[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x4d12ea[_0x1f57('0x80')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xf0'));}if(!this[_0x1f57('0x89')](_0x4d12ea[_0x1f57('0x81')])){return this['channel'][_0x1f57('0xac')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x4d12ea[_0x1f57('0x82')])){return this[_0x1f57('0x10')]['noop']('no\x20private_key\x20configured');}if(!this[_0x1f57('0x89')](_0x4d12ea[_0x1f57('0xf1')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xf2'));}if(!this[_0x1f57('0x89')](_0x4d12ea[_0x1f57('0x5e')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xad'));}this[_0x1f57('0x10')][_0x1f57('0xe9')]=!![];this['createSquareDetailsReport'](_0x4d12ea);this['createSquareMessage'](_0x4d12ea[_0x1f57('0x5e')],'in','','');this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x4d12ea[_0x1f57('0x5e')]));var _0xbbef26=this[_0x1f57('0x7f')]['sync'](this,_0x4d12ea);if(_0xbbef26){for(var _0x2753ce in _0xbbef26){if(_0xbbef26[_0x1f57('0x99')](_0x2753ce)){if(_0x2753ce!==_0x1f57('0xf3')){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')]('DIALOGFLOW_%s',_0x2753ce[_0x1f57('0x6e')]()),_0xbbef26[_0x2753ce]);}}}this[_0x1f57('0x43')](_0xbbef26[_0x1f57('0xf4')],'out',_0x1f57('0xef'),_0xbbef26[_0x1f57('0xf3')]);return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xf5'),_0xbbef26[_0x1f57('0xf4')]));}return this['channel']['error'](_0x4d12ea,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x1f57('0x13')]['sesteknda']=function(_0x315e89){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xf6'),_0x315e89['label']));if(!this[_0x1f57('0x89')](_0x315e89[_0x1f57('0xf7')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xf8'));}if(!this[_0x1f57('0x89')](_0x315e89['username'])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xf9'));}if(!this[_0x1f57('0x89')](_0x315e89[_0x1f57('0xfa')])){return this[_0x1f57('0x10')]['noop']('no\x20password\x20configured');}if(!this[_0x1f57('0x89')](_0x315e89[_0x1f57('0xfb')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}this['channel']['bot']=!![];this[_0x1f57('0x37')](_0x315e89);this['createSquareMessage'](_0x315e89[_0x1f57('0x5e')],'in','','');this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('Trying\x20SestekNDA:\x20%s',_0x315e89[_0x1f57('0x5e')]));var _0x1d5c95=this[_0x1f57('0x83')][_0x1f57('0xa9')](this,_0x315e89);if(_0x1d5c95){for(var _0x3ac505 in _0x1d5c95){if(_0x1d5c95[_0x1f57('0x99')](_0x3ac505)){this['channel']['setVariable'](util[_0x1f57('0x29')](_0x1f57('0xfc'),_0x3ac505[_0x1f57('0x6e')]()),_0x1d5c95[_0x3ac505]);}}this['createSquareMessage'](_0x1d5c95[_0x1f57('0xf4')],_0x1f57('0xec'),'sesteknda','');if(_0x1d5c95[_0x1f57('0xfd')]){this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1d5c95[_0x1f57('0xfd')]));var _0x51d2e3=this['channel']['streamFile'](_0x1d5c95['audiofile']);try{fs[_0x1f57('0xfe')](_0x1d5c95['audiofile']+'.wav');}catch(_0x12a76d){logger[_0x1f57('0x2d')](_0x12a76d);}return _0x51d2e3;}else{return this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')]('SestekNDA\x20Result\x20%s',_0x1d5c95[_0x1f57('0xf4')]));}}return this['channel'][_0x1f57('0x2d')](_0x315e89,_0x1f57('0xff'));};AGIVertices[_0x1f57('0x13')]['end']=function(_0x1486b){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x100'),_0x1486b[_0x1f57('0x39')]));return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x101'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x102')]=function(_0x16544f){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x16544f[_0x1f57('0x39')]));var _0x10505d='';if(_0x16544f[_0x1f57('0x103')]){if(!this[_0x1f57('0x89')](_0x16544f[_0x1f57('0x103')])){return this[_0x1f57('0x10')]['error'](_0x16544f,_0x1f57('0x104'));}else{var _0x2b12e0=parseInt(_0x16544f[_0x1f57('0x103')],0xa);if(isNaN(_0x2b12e0)){_0x10505d=_0x16544f[_0x1f57('0x103')];}else{_0x10505d=this[_0x1f57('0x1d')][_0x1f57('0xa9')](this,_0x16544f['trunk_id']);if(!_0x10505d){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x16544f,'no\x20trunk\x20found');}}}}else if(_0x16544f[_0x1f57('0x105')]){_0x10505d=_0x16544f[_0x1f57('0x105')];}else{return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x16544f,_0x1f57('0x104'));}var _0x2122a2=this[_0x1f57('0x10')]['exec'](_0x1f57('0xe4'),[util[_0x1f57('0x29')](_0x1f57('0x106'),_0x10505d,_0x16544f['phone']),_0x16544f[_0x1f57('0x69')],_0x16544f[_0x1f57('0xe6')],_0x16544f[_0x1f57('0x67')]]);if(_0x2122a2[_0x1f57('0xa5')]===-0x1){return _0x2122a2;}return this['channel']['noop'](util[_0x1f57('0x29')](_0x1f57('0xe7'),_0x1f57('0xe4')));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x107')]=function(_0x568678){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x108'),_0x568678['label']));return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x107'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0xf')]=function(_0xf477e7){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0xf477e7['label']));if(_0xf477e7[_0x1f57('0xaa')]===0x0){return this[_0x1f57('0xa8')](_0xf477e7);}_0xf477e7[_0x1f57('0xaa')]-=0x1;if(!this[_0x1f57('0x89')](_0xf477e7[_0x1f57('0x109')])){return this[_0x1f57('0x10')]['error'](_0xf477e7,_0x1f57('0x10a'));}var _0x5d5de2=this[_0x1f57('0x10b')][_0x1f57('0xa9')](this,_0xf477e7[_0x1f57('0x109')]);if(!_0x5d5de2){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0xf477e7,_0x1f57('0x10c'));}if(!this[_0x1f57('0x89')](_0xf477e7[_0x1f57('0xd8')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x1f57('0xd9'));}var _0x5ed332=this[_0x1f57('0x10')][_0x1f57('0x10d')](_0x5d5de2,_0xf477e7[_0x1f57('0x10e')],_0xf477e7[_0x1f57('0x10f')]);var _0x323625=_0x5ed332[_0x1f57('0xa5')]?_0x5ed332['result']['toString']():'';logger[_0x1f57('0x2f')](_0x1f57('0x110'),JSON[_0x1f57('0x75')](_0x5ed332));if(_0x5ed332[_0x1f57('0xa5')]===-0x1){this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,_0x323625);return _0x5ed332;}else if(_0x5ed332[_0x1f57('0xa7')]===_0x1f57('0x69')){_0x5ed332['result']=_0x323625['length']>=parseInt(_0xf477e7['mindigit'])?'x':'i';}else{_0x5ed332['result']=_0x323625[_0x1f57('0x9e')]>=parseInt(_0xf477e7['mindigit'])&&_0x323625[_0x1f57('0x9e')]<=parseInt(_0xf477e7['maxdigit'])?'x':'i';}var _0x5a122f=this[_0x1f57('0x14')]['sync'](this,_0xf477e7[_0x1f57('0xd8')]);if(!_0x5a122f){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0xf477e7,_0x1f57('0xda'));}this[_0x1f57('0x10')]['setVariable'](_0x5a122f,_0x323625);if(this['isConfigured'](_0xf477e7[_0x1f57('0x111')])){var _0x474c12=parseInt(_0xf477e7[_0x1f57('0x111')],0xa);var _0x4039e0=rs[_0x1f57('0x112')]({'charset':'*','length':_0x474c12});var _0x1a09ce=_0x323625[_0x1f57('0x9e')];if(_0x1a09ce>0x0){if(_0x1a09ce>_0x474c12){this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,_0xf477e7[_0x1f57('0x113')]===_0x1f57('0x114')?_0x4039e0+_0x323625[_0x1f57('0x115')](_0x474c12):_0x323625['substr'](0x0,_0x1a09ce-_0x474c12)+_0x4039e0);}else{this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,rs[_0x1f57('0x112')]({'charset':'*','length':_0x1a09ce}));}}else{this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,'');}}else{this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,_0x323625);}return _0x5ed332;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x116')]=function(_0x42d624){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x117'),_0x42d624[_0x1f57('0x39')]));return this[_0x1f57('0xf')](_0x42d624);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x118')]=function(_0x51d159){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x119'),_0x51d159['label']));this['createSquareDetailsReport'][_0x1f57('0xa9')](this,_0x51d159,_0x51d159[_0x1f57('0x11a')]);return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')]('GOAL\x20%s',_0x51d159[_0x1f57('0x11a')]));};AGIVertices['prototype'][_0x1f57('0x11b')]=function(_0x1ac737){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1ac737[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x1ac737[_0x1f57('0x11c')])||!this[_0x1f57('0x89')](_0x1ac737['aws_secret_access_key'])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x11d'));}if(!this['isConfigured'](_0x1ac737['text'])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20text\x20configured');}this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x11e'),_0x1ac737[_0x1f57('0x5e')]));var _0x482e5f=this[_0x1f57('0x8b')]['sync'](this,_0x1ac737);if(_0x482e5f){this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x482e5f));var _0xd56aa2=this['channel'][_0x1f57('0x11f')](_0x482e5f);try{fs[_0x1f57('0xfe')](_0x482e5f+'.wav');}catch(_0x45ab97){logger['error'](_0x45ab97);}return _0xd56aa2;}return this[_0x1f57('0x10')]['error'](_0x1ac737,_0x1f57('0x120'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x121')]=function(_0x1d1837){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x122'),_0x1d1837[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x1d1837[_0x1f57('0x11c')])||!this[_0x1f57('0x89')](_0x1d1837[_0x1f57('0x8c')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x11d'));}if(!this['isConfigured'](_0x1d1837['aws_bot_name'])){return this['channel'][_0x1f57('0xac')]('no\x20bot\x20name\x20configured');}if(!this[_0x1f57('0x89')](_0x1d1837[_0x1f57('0x5e')])){return this['channel'][_0x1f57('0xac')]('no\x20text\x20configured');}this[_0x1f57('0x10')][_0x1f57('0xe9')]=!![];this[_0x1f57('0x37')](_0x1d1837);this['createSquareMessage'](_0x1d1837[_0x1f57('0x5e')],'in','','');this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x123'),_0x1d1837['text']));var _0x602d62=this[_0x1f57('0x8f')]['sync'](this,_0x1d1837);if(_0x602d62){for(var _0x19e13d in _0x602d62){if(_0x602d62[_0x1f57('0x99')](_0x19e13d)&&_[_0x1f57('0x9f')](_0x602d62[_0x19e13d])){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x124'),_0x19e13d['toUpperCase']()),_0x602d62[_0x19e13d]);}}if(_[_0x1f57('0x46')](_0x602d62[_0x1f57('0x79')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0x125'));}else{this['createSquareMessage'](_0x602d62[_0x1f57('0x79')],_0x1f57('0xec'),_0x1f57('0x126'),'');return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x127'),_0x602d62['message']));}}return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x1d1837,_0x1f57('0x128'));};AGIVertices['prototype'][_0x1f57('0x129')]=function(_0x1864a4){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x12a'),_0x1864a4[_0x1f57('0x39')],_0x1864a4[_0x1f57('0x69')]));if(!this[_0x1f57('0x89')](_0x1864a4[_0x1f57('0x7d')])){return this['channel'][_0x1f57('0xac')]('no\x20key\x20configured');}var _0x1d11cf=_0x1f57('0x12b');var _0x486d17=util['format'](_0x1f57('0x12c'),FILES_PATH,rs[_0x1f57('0x112')](0x4));var _0x34ca3b=util[_0x1f57('0x29')]('%s.%s',_0x486d17,_0x1d11cf);var _0x2be412=!![];if(_0x1864a4[_0x1f57('0x12d')]===_0x1f57('0x12e')){_0x2be412=![];}var _0x569162=this[_0x1f57('0x10')]['recordFile'](_0x486d17,_0x1d11cf,_0x1864a4[_0x1f57('0x12f')],_0x1864a4[_0x1f57('0x69')],undefined,_0x2be412);if(_0x569162[_0x1f57('0xa5')]!==-0x1){this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x130'),_0x34ca3b));var _0x12e251=this['googleASR'][_0x1f57('0xa9')](this,_0x1864a4,_0x34ca3b);if(_0x12e251){for(var _0x56c490 in _0x12e251){if(_0x12e251[_0x1f57('0x99')](_0x56c490)){this['channel'][_0x1f57('0xa2')](util[_0x1f57('0x29')]('GOOGLE_ASR_%s',_0x56c490['toUpperCase']()),_0x12e251[_0x56c490]);}}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('GoogleASR\x20Result\x20%s',JSON[_0x1f57('0x75')](_0x12e251)));}}return _0x569162;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x131')]=function(_0x3990a5){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x132'),_0x3990a5[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x3990a5[_0x1f57('0x133')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x134'));}if(!this[_0x1f57('0x89')](_0x3990a5[_0x1f57('0x95')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0x135'));}var _0x581025=_0x1f57('0x12b');var _0xe0a71c=util['format'](_0x1f57('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x1db0a1=util[_0x1f57('0x29')](_0x1f57('0xa1'),_0xe0a71c,_0x581025);var _0x1612d4=!![];if(_0x3990a5[_0x1f57('0x12d')]===_0x1f57('0x12e')){_0x1612d4=![];}var _0x48de01=this['channel'][_0x1f57('0x136')](_0xe0a71c,_0x581025,_0x3990a5['intKey'],_0x3990a5[_0x1f57('0x69')],undefined,_0x1612d4);if(_0x48de01[_0x1f57('0xa5')]!==-0x1){this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x137'),_0x1db0a1));var _0x31f002=this[_0x1f57('0x94')][_0x1f57('0xa9')](this,_0x3990a5,_0x1db0a1);if(_0x31f002){for(var _0x134dc7 in _0x31f002){if(_0x31f002[_0x1f57('0x99')](_0x134dc7)){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x138'),_0x134dc7[_0x1f57('0x6e')]()),_0x31f002[_0x134dc7]);}}return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x139'),JSON[_0x1f57('0x75')](_0x31f002)));}}return _0x48de01;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x13a')]=function(_0x37fdf3){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x13b'),_0x37fdf3['label']));return this[_0x1f57('0x10')]['continueAt'](_0x37fdf3[_0x1f57('0x3f')],_0x37fdf3[_0x1f57('0x13c')],_0x37fdf3[_0x1f57('0x40')]);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x13d')]=function(_0x14ba56){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x13e'),_0x14ba56[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x14ba56['condition'])){return this[_0x1f57('0x10')]['error'](_0x14ba56,'no\x20condition\x20configured');}try{var _0x19ef2b=eval(_0x14ba56[_0x1f57('0x13f')])?_0x1f57('0x140'):_0x1f57('0x141');this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x142'),_0x14ba56['condition'],_0x19ef2b));return{'code':0xc8,'result':_0x19ef2b};}catch(_0x2138c0){return{'code':0xc8,'result':_0x1f57('0x141')};}};AGIVertices[_0x1f57('0x13')][_0x1f57('0x143')]=function(_0x2eb1e0){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x144'),_0x2eb1e0[_0x1f57('0x39')]));if(!this['isConfigured'](_0x2eb1e0['interval_id'])){return this[_0x1f57('0x10')]['error'](_0x2eb1e0,'no\x20interval\x20configured');}var _0x51d753=this['getIntervals'][_0x1f57('0xa9')](this,_0x2eb1e0[_0x1f57('0x145')]);if(!_0x51d753){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x2eb1e0,_0x1f57('0x146'));}for(var _0x39f9bd=0x0;_0x39f9bd<_0x51d753[_0x1f57('0x9e')];_0x39f9bd+=0x1){var _0x54ad31=this[_0x1f57('0x10')][_0x1f57('0x14')](util[_0x1f57('0x29')](_0x1f57('0x147'),_0x51d753[_0x39f9bd]));if(_0x54ad31[_0x1f57('0xa5')]===-0x1){return _0x54ad31;}logger['info'](util['format'](_0x1f57('0x148'),_0x51d753[_0x39f9bd],_0x54ad31[_0x1f57('0xa7')]));if(_0x54ad31[_0x1f57('0xa7')]==='true'){logger['info'](util['format'](_0x1f57('0x148'),_0x51d753[_0x39f9bd],'true'));this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x148'),_0x51d753[_0x39f9bd],'true'));return{'code':0xc8,'result':_0x1f57('0x140')};}else{logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('IFTIME\x20%s\x20%s',_0x51d753[_0x39f9bd],_0x1f57('0x141')));this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x148'),_0x51d753[_0x39f9bd],'false'));}}return{'code':0xc8,'result':_0x1f57('0x141')};};AGIVertices['prototype'][_0x1f57('0x149')]=function(_0x5f4920){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x14a'),_0x5f4920[_0x1f57('0x39')]));return this['channel']['hangup']();};AGIVertices[_0x1f57('0x13')][_0x1f57('0x14b')]=function(_0x346c2f){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x346c2f[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x346c2f[_0x1f57('0x7d')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x14c'));}var _0x4bcecc='wav';var _0x448438=util[_0x1f57('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0x1f57('0x112')](0x4));var _0x22bbea=util['format']('%s.%s',_0x448438,_0x4bcecc);var _0x4bdf56=!![];if(_0x346c2f[_0x1f57('0x12d')]===_0x1f57('0x12e')){_0x4bdf56=![];}var _0x152ae0=this[_0x1f57('0x10')][_0x1f57('0x136')](_0x448438,_0x4bcecc,_0x346c2f[_0x1f57('0x12f')],_0x346c2f[_0x1f57('0x69')],undefined,_0x4bdf56);if(_0x152ae0[_0x1f57('0xa5')]!==-0x1){this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x14d'),_0x22bbea));var _0x490f94=this[_0x1f57('0x87')]['sync'](this,_0x346c2f,_0x22bbea);if(_0x490f94){for(var _0x25fa6f in _0x490f94){if(_0x490f94['hasOwnProperty'](_0x25fa6f)){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x14e'),_0x25fa6f[_0x1f57('0x6e')]()),_0x490f94[_0x25fa6f]);}}return this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x14f'),JSON['stringify'](_0x490f94)));}}return _0x152ae0;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x150')]=function(_0x431457){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x151'),_0x431457[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x431457[_0x1f57('0x7d')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x14c'));}if(!this[_0x1f57('0x89')](_0x431457['text'])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20text\x20configured');}this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x152'),_0x431457['text']));var _0x13af24=this[_0x1f57('0x84')]['sync'](this,_0x431457);if(_0x13af24){this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('ispeech\x20%s\x20file\x20created',_0x13af24));var _0x25c980=this[_0x1f57('0x10')]['streamFile'](_0x13af24,_0x431457[_0x1f57('0x12f')]);try{fs['unlink'](_0x13af24+'.wav');}catch(_0x1ee827){logger[_0x1f57('0x2d')](_0x1ee827);}return _0x25c980;}return this['channel'][_0x1f57('0x2d')](_0x431457,_0x1f57('0x153'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x154')]=function(_0x5cc1a3){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x5cc1a3[_0x1f57('0x39')]));if(!this['isConfigured'](_0x5cc1a3['findBy'])){return this['channel'][_0x1f57('0x2d')](_0x5cc1a3,_0x1f57('0x155'));}logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x156'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x5cc1a3['findBy']));var _0x5bd8c5=this[_0x1f57('0x55')][_0x1f57('0xa9')](this,_0x5cc1a3[_0x1f57('0x157')]);if(_0x5bd8c5){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x158'),this['channel'][_0x1f57('0x3c')],_0x5cc1a3['findBy']));this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x158'),this['channel'][_0x1f57('0x3c')],_0x5cc1a3[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x159')};}else{logger['info'](util['format'](_0x1f57('0x15a'),this['channel']['callerid'],_0x5cc1a3[_0x1f57('0x157')]));this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x15a'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x5cc1a3[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x15b')};}};AGIVertices[_0x1f57('0x13')]['logout']=function(_0x2858cc){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2858cc[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x2858cc[_0x1f57('0x157')])){return this['channel']['error'](_0x2858cc,'no\x20find\x20by\x20configured');}logger[_0x1f57('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x2858cc['findBy']));var _0x5d4c3c=this['agentLogout'][_0x1f57('0xa9')](this,_0x2858cc['findBy']);if(_0x5d4c3c){logger['info'](util['format'](_0x1f57('0x158'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x2858cc[_0x1f57('0x157')]));this[_0x1f57('0x10')][_0x1f57('0xac')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x2858cc['findBy']));return{'code':0xc8,'result':_0x1f57('0x159')};}else{logger['info'](util['format'](_0x1f57('0x15a'),this['channel']['callerid'],_0x2858cc[_0x1f57('0x157')]));this['channel'][_0x1f57('0xac')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1f57('0x10')]['callerid'],_0x2858cc['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x1f57('0x13')][_0x1f57('0x15c')]=function(_0x1d4fb9){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x15d'),_0x1d4fb9['label']));if(!this[_0x1f57('0x89')](_0x1d4fb9[_0x1f57('0x15e')])){return this['channel'][_0x1f57('0x2d')](_0x1d4fb9,_0x1f57('0x15f'));}this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x160'),_0x1d4fb9[_0x1f57('0x15e')]));var _0x1f69fa=eval(_0x1d4fb9['operation']);if(!this[_0x1f57('0x89')](_0x1d4fb9['variable_id'])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5f1142=this[_0x1f57('0x14')][_0x1f57('0xa9')](this,_0x1d4fb9[_0x1f57('0xd8')]);if(!_0x5f1142){return this['channel'][_0x1f57('0x2d')](_0x1d4fb9,'no\x20variable\x20found');}if(_[_0x1f57('0x9d')](_0x1f69fa)){var _0xd4a894=this;_0x1f69fa[_0x1f57('0x161')](function(_0x2910e8,_0x506701){_0xd4a894[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x162'),_0x5f1142,_0x506701),_0x2910e8);});return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x163'),_0x5f1142));}else{return this[_0x1f57('0x10')][_0x1f57('0xa2')](_0x5f1142,_0x1f69fa);}};AGIVertices[_0x1f57('0x13')][_0x1f57('0xe')]=function(_0x294500){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x164'),_0x294500[_0x1f57('0x39')]));if(_0x294500[_0x1f57('0xaa')]===0x0){return this[_0x1f57('0xa8')](_0x294500);}_0x294500[_0x1f57('0xaa')]-=0x1;if(!this[_0x1f57('0x89')](_0x294500[_0x1f57('0x109')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x294500,'no\x20file\x20audio\x20selected');}var _0x527483=this[_0x1f57('0x10b')]['sync'](this,_0x294500[_0x1f57('0x109')]);if(!_0x527483){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x294500,_0x1f57('0x10c'));}var _0x49b8d8=this[_0x1f57('0x10')]['getData'](_0x527483,_0x294500[_0x1f57('0x10e')],_0x294500[_0x1f57('0x165')]);var _0x5ecb03=_0x49b8d8['result'];if(_0x49b8d8[_0x1f57('0xa5')]===-0x1){this[_0x1f57('0x37')]['sync'](this,_0x294500,'-1');return _0x49b8d8;}else if(_0x49b8d8[_0x1f57('0xa7')]===_0x1f57('0x69')){_0x49b8d8[_0x1f57('0xa5')]=_0x49b8d8['result'][_0x1f57('0x9e')]>0x0?_0x49b8d8[_0x1f57('0xa5')]:'t';}else if(_[_0x1f57('0x45')](_0x49b8d8[_0x1f57('0xa5')])){_0x49b8d8[_0x1f57('0xa5')]='#';_0x5ecb03='#';}if(!this[_0x1f57('0x89')](_0x294500[_0x1f57('0xd8')])){this[_0x1f57('0x10')]['noop'](_0x1f57('0xd9'));}else{var _0x203a59=this[_0x1f57('0x14')][_0x1f57('0xa9')](this,_0x294500[_0x1f57('0xd8')]);if(!_0x203a59){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x294500,_0x1f57('0xda'));}this[_0x1f57('0x10')]['setVariable'](_0x203a59,_0x5ecb03);}this['createSquareDetailsReport'][_0x1f57('0xa9')](this,_0x294500,_0x5ecb03);return _0x49b8d8;};AGIVertices['prototype'][_0x1f57('0xac')]=function(_0x389992){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x166'),_0x389992[_0x1f57('0x39')]));return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x389992['output']||_0x389992[_0x1f57('0x39')]);};AGIVertices[_0x1f57('0x13')]['pause']=function(_0x29df7b){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x167'),_0x29df7b[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x29df7b[_0x1f57('0x157')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x29df7b,'no\x20find\x20by\x20configured');}logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x156'),this['channel'][_0x1f57('0x3c')],_0x29df7b[_0x1f57('0x157')]));var _0x3682d6=this[_0x1f57('0x4f')]['sync'](this,_0x29df7b['pause_id']);var _0x216e1d=this['agentPause']['sync'](this,_0x29df7b['findBy'],_0x3682d6);if(_0x216e1d){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x158'),this[_0x1f57('0x10')]['callerid'],_0x29df7b['findBy']));this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x158'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x29df7b[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x159')};}else{logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x15a'),this[_0x1f57('0x10')]['callerid'],_0x29df7b[_0x1f57('0x157')]));this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x158'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x29df7b[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x15b')};}};AGIVertices[_0x1f57('0x13')][_0x1f57('0x168')]=function(_0x11f5f2){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x169'),_0x11f5f2['label']));if(!this[_0x1f57('0x89')](_0x11f5f2[_0x1f57('0x109')])){return this['channel'][_0x1f57('0x2d')](_0x11f5f2,_0x1f57('0x10a'));}var _0x5c87b4=this[_0x1f57('0x10b')]['sync'](this,_0x11f5f2[_0x1f57('0x109')]);if(!_0x5c87b4){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x11f5f2,_0x1f57('0x10c'));}var _0x50a3da=this['channel']['exec'](_0x1f57('0x16a'),[_0x5c87b4,_0x11f5f2[_0x1f57('0xe6')]]);if(_0x50a3da['result']===-0x1){return _0x50a3da;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xc2'),_0x1f57('0x16a'),_0x5c87b4));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x16b')]=function(_0x39d1ba){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x16c'),_0x39d1ba[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x39d1ba[_0x1f57('0x16d')])){return this['channel'][_0x1f57('0x2d')](_0x39d1ba,'no\x20queue\x20selected');}var _0x4891c2='';var _0x21c555=parseInt(_0x39d1ba['queue_id'],0xa);if(isNaN(_0x21c555)){_0x4891c2=_0x39d1ba[_0x1f57('0x16d')];}else{_0x4891c2=this[_0x1f57('0x19')]['sync'](this,_0x39d1ba[_0x1f57('0x16d')]);if(!_0x4891c2){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x39d1ba,_0x1f57('0x16e'));}}var _0x3455c6='';if(this[_0x1f57('0x89')](_0x39d1ba['file_id'])){var _0x790dc7=this['getSound'][_0x1f57('0xa9')](this,_0x39d1ba[_0x1f57('0x109')]);if(_0x790dc7){_0x3455c6=_0x790dc7;}}this[_0x1f57('0x37')]['sync'](this,_0x39d1ba,_0x4891c2);if(_0x39d1ba[_0x1f57('0xe6')][_0x1f57('0x16f')]('x')<0x0){_0x39d1ba[_0x1f57('0xe6')]+='x';}if(_0x39d1ba[_0x1f57('0xe6')]['indexOf']('X')<0x0){_0x39d1ba[_0x1f57('0xe6')]+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x4891c2?_0x4891c2[_0x1f57('0x170')]():'');var _0xe63ef=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0x171'),[_0x4891c2,_0x39d1ba['opts'],_0x39d1ba[_0x1f57('0x67')],_0x3455c6,_0x39d1ba['timeout'],_0x39d1ba[_0x1f57('0x8')],_0x39d1ba[_0x1f57('0x172')],_0x39d1ba['gosub'],'',_0x39d1ba[_0x1f57('0x173')]]);if(_0xe63ef[_0x1f57('0xa5')]===-0x1){return _0xe63ef;}return this[_0x1f57('0x10')]['noop'](util['format'](_0x1f57('0xc2'),_0x1f57('0x171'),_0x4891c2));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x174')]=function(_0x4a8258){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x175'),_0x4a8258[_0x1f57('0x39')]));var _0x43dd93=_0x4a8258[_0x1f57('0x176')]||_0x1f57('0x12b');var _0x3e8e21=util[_0x1f57('0x29')](_0x1f57('0x177'),this[_0x1f57('0x10')][_0x1f57('0x38')],rs[_0x1f57('0x112')](0x5));var _0x68caec=util['format'](_0x1f57('0x178'),FILES_PATH,_0x3e8e21,_0x43dd93);var _0x3f35b3=util[_0x1f57('0x29')](_0x1f57('0x12c'),FILES_PATH,_0x3e8e21);this[_0x1f57('0x3d')][_0x1f57('0xa9')](this,_0x4a8258,_0x3e8e21,_0x68caec);this[_0x1f57('0x10')][_0x1f57('0xa2')]('RECORDING_SAVENAME',_0x3e8e21);logger[_0x1f57('0x2f')](_0x1f57('0x179'),_0x3f35b3,_0x43dd93,_0x4a8258[_0x1f57('0x17a')],_0x4a8258[_0x1f57('0x69')]);return this[_0x1f57('0x10')][_0x1f57('0x136')](_0x3f35b3,_0x43dd93,_0x4a8258[_0x1f57('0x17a')],_0x4a8258[_0x1f57('0x69')],undefined,!![]);};AGIVertices[_0x1f57('0x13')]['restapi']=function(_0x217744){logger['info'](util['format'](_0x1f57('0x17b'),_0x217744['label']));if(!this['isConfigured'](_0x217744[_0x1f57('0x67')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x17c'));}var _0x598677=this[_0x1f57('0x66')]['sync'](this,_0x217744);logger['info'](util['format'](_0x1f57('0x17d'),util['inspect'](_0x598677,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x217744['variable_id'])){return this['channel']['noop'](_0x1f57('0x17e'));}var _0x2ba90e=this['getVariable'][_0x1f57('0xa9')](this,_0x217744[_0x1f57('0xd8')]);if(!_0x2ba90e){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x217744,_0x1f57('0xda'));}this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x17f'),_0x2ba90e),_0x598677['statusCode']?_0x598677[_0x1f57('0x78')]:_0x1f57('0x180'));this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x181'),_0x2ba90e),_0x598677[_0x1f57('0x77')]?_0x598677[_0x1f57('0x77')]:'OK');if(_0x598677[_0x1f57('0x6f')]){try{this[_0x1f57('0xa0')](_0x598677[_0x1f57('0x6f')],_0x2ba90e);}catch(_0x55009a){logger[_0x1f57('0x2d')](util[_0x1f57('0x29')](_0x1f57('0x182'),_0x2ba90e));}}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xdd'),_0x2ba90e));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x183')]=function(_0x1603ae){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x184'),_0x1603ae[_0x1f57('0x39')]));return this[_0x1f57('0x10')]['sayDigits'](_0x1603ae['digits'][_0x1f57('0x5b')](/\s+/g,''),_0x1603ae[_0x1f57('0x17a')]);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x185')]=function(_0xf25533){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x186'),_0xf25533[_0x1f57('0x39')]));return this['channel'][_0x1f57('0x187')](_0xf25533[_0x1f57('0x6a')][_0x1f57('0x5b')](/\s+/g,''),_0xf25533['escape_digits']);};AGIVertices['prototype'][_0x1f57('0x188')]=function(_0x42eb42){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x189'),_0x42eb42[_0x1f57('0x39')]));return this['channel'][_0x1f57('0x18a')](_0x42eb42[_0x1f57('0x5e')],_0x42eb42[_0x1f57('0x17a')]);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x18b')]=function(_0x30e41d){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x18c'),_0x30e41d[_0x1f57('0x39')]));if(!this['isConfigured'](_0x30e41d[_0x1f57('0x18d')])){return this['channel']['noop']('no\x20mail\x20account\x20configured');}var _0x4b7b63=this[_0x1f57('0x20')][_0x1f57('0xa9')](this,_0x30e41d['account_id']);if(!_0x4b7b63||!_0x4b7b63['Smtp']){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x30e41d,_0x1f57('0x18e'));}var _0x4bda85={'from':util[_0x1f57('0x29')]('\x22%s\x22\x20<%s>',_0x4b7b63[_0x1f57('0x17')],_0x4b7b63['email']||_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x190')]),'to':_0x30e41d['to']||'','cc':_0x30e41d['cc']||'','bcc':_0x30e41d['bcc']||'','subject':_0x30e41d[_0x1f57('0x191')],'html':_0x30e41d['text'],'text':_0x30e41d['text']};var _0x24d7b2={'tls':{'rejectUnauthorized':![]}};if(_0x4b7b63['Smtp'][_0x1f57('0x192')]){_0x24d7b2['service']=_0x4b7b63['Smtp'][_0x1f57('0x192')];}else{_0x24d7b2[_0x1f57('0x193')]=_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x193')];_0x24d7b2['port']=_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x194')];_0x24d7b2[_0x1f57('0x195')]=_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x195')];}if(_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x196')]){_0x24d7b2[_0x1f57('0x197')]={'user':_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x190')],'pass':_0x4b7b63[_0x1f57('0x18f')]['pass']};}if(this[_0x1f57('0x89')](_0x30e41d[_0x1f57('0x198')])){}logger[_0x1f57('0xde')]('sendMail\x20message',JSON['stringify'](_0x4bda85));this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x30e41d,_0x30e41d[_0x1f57('0x18d')]);this['channel']['noop'](util[_0x1f57('0x29')](_0x1f57('0x199'),_0x4b7b63['name']));this['sendMailMessage'][_0x1f57('0xa9')](this,_0x24d7b2,_0x4bda85);return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x19a'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x19b')]=function(_0xef0a77){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x19c'),_0xef0a77[_0x1f57('0x39')]));return this[_0x1f57('0x10')][_0x1f57('0xac')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype']['sendSMS']=function(_0x131ab5){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x19d'),_0x131ab5[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x131ab5[_0x1f57('0x19e')])){return this['channel'][_0x1f57('0xac')]('no\x20sms\x20account\x20configured');}var _0x2d72f7=this['getSmsAccount'][_0x1f57('0xa9')](this,_0x131ab5[_0x1f57('0x19e')]);if(!_0x2d72f7){return this[_0x1f57('0x10')]['error'](_0x131ab5,_0x1f57('0x19f'));}var _0x42e6f4={'body':_0x131ab5[_0x1f57('0x1a0')],'phone':_0x131ab5['to']||'','SmsAccountId':_0x2d72f7['id']};logger[_0x1f57('0xde')](_0x1f57('0x1a1'),JSON[_0x1f57('0x75')](_0x42e6f4));this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x131ab5,_0x131ab5['sms_account_id']);this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x2d72f7[_0x1f57('0x17')]));this['createSmsMessage'][_0x1f57('0xa9')](this,_0x42e6f4);return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x1a2'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1a3')]=function(_0x38ea6b){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x1a4'),_0x38ea6b[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x38ea6b[_0x1f57('0xd8')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x38ea6b,_0x1f57('0x1a5'));}var _0x500310=this[_0x1f57('0x14')]['sync'](this,_0x38ea6b['variable_id']);if(!_0x500310){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x38ea6b,_0x1f57('0xda'));}return this[_0x1f57('0x10')]['setVariable'](_0x500310,_0x38ea6b[_0x1f57('0x1a6')]);};AGIVertices['prototype'][_0x1f57('0x1a7')]=function(_0x1759a7){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x1a8'),_0x1759a7[_0x1f57('0x39')]));this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x1a9'));if(_0x1759a7[_0x1f57('0x1aa')]==='yes'){this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x1ab'));return this[_0x1f57('0x10')][_0x1f57('0x1aa')]();}return this[_0x1f57('0x10')][_0x1f57('0xac')]('Skipped\x20Answer');};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1ac')]=function(_0x332208){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x1ad'),_0x332208['label']));if(!this[_0x1f57('0x89')](_0x332208['project_id'])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x332208,'no\x20subproject\x20selected');}var _0x486fd1=this[_0x1f57('0x1ae')]['sync'](this,_0x332208[_0x1f57('0x1af')]);if(!this[_0x1f57('0x89')](_0x486fd1)){return this[_0x1f57('0x10')]['error'](_0x332208,util['format'](_0x1f57('0x1b0'),_0x332208[_0x1f57('0x1af')]));}if(_0x486fd1===this[_0x1f57('0x10')][_0x1f57('0x3b')]){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x332208,_0x1f57('0x1b1'));}this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x332208,_0x486fd1);var _0x42e88e=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0x1b2'),util[_0x1f57('0x29')](_0x1f57('0x1b3'),config[_0x1f57('0x8')][_0x1f57('0x193')]||_0x1f57('0x1b4'),_0x486fd1,this[_0x1f57('0x10')][_0x1f57('0x3b')]));if(_0x42e88e['result']===-0x1){return _0x42e88e;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xc2'),'AGI',_0x486fd1));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1b5')]=function(_0x43f421){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x1b6'),_0x43f421[_0x1f57('0x39')]));var _0x391e5e=this[_0x1f57('0x59')]['sync'](this,_0x43f421[_0x1f57('0x1b7')]);this[_0x1f57('0x37')]['sync'](this,_0x43f421,_0x43f421[_0x1f57('0x1b7')]);if(this[_0x1f57('0x89')](_0x43f421[_0x1f57('0xd8')])){var _0x73337f=this[_0x1f57('0x14')]['sync'](this,_0x43f421[_0x1f57('0xd8')]);if(_0x73337f){this['channel'][_0x1f57('0xa2')](_0x73337f,_0x391e5e);return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x1b8'),_0x43f421[_0x1f57('0x1b7')],_0x73337f));}}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x43f421[_0x1f57('0x1b7')]));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1b9')]=function(_0x157010){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x1ba'),_0x157010['label']));_0x157010[_0x1f57('0x5e')]=_0x157010[_0x1f57('0x5e')][_0x1f57('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x157010[_0x1f57('0x5d')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0x1bb'));}if(!this[_0x1f57('0x89')](_0x157010[_0x1f57('0x5e')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x1bc'),_0x157010[_0x1f57('0x5e')]));var _0xd1e36b=this[_0x1f57('0x5c')]['sync'](this,_0x157010);if(_0xd1e36b){this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x1bd'),_0xd1e36b));var _0x554dc2=this['channel'][_0x1f57('0x11f')](_0xd1e36b);try{fs[_0x1f57('0xfe')](_0xd1e36b+_0x1f57('0x1be'));}catch(_0x1d3453){logger[_0x1f57('0x2d')](_0x1d3453);}return _0x554dc2;}return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x157010,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1bf')]=function(_0x161ba4){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x1c0'),_0x161ba4['label']));_0x161ba4['text']=_0x161ba4[_0x1f57('0x5e')][_0x1f57('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1f57('0x89')](_0x161ba4[_0x1f57('0x5e')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x1c1'),_0x161ba4[_0x1f57('0x5e')]));var _0x374395=this[_0x1f57('0x65')][_0x1f57('0xa9')](this,_0x161ba4);if(_0x374395){this[_0x1f57('0x10')]['noop'](util['format'](_0x1f57('0x1c2'),_0x374395));var _0x3d89d7=this[_0x1f57('0x10')]['streamFile'](_0x374395);try{fs['unlink'](_0x374395+'.wav');}catch(_0x2a8769){logger['error'](_0x2a8769);}return _0x3d89d7;}return this[_0x1f57('0x10')]['error'](_0x161ba4,_0x1f57('0x1c3'));};AGIVertices[_0x1f57('0x13')]['unpause']=function(_0x225466){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x225466['label']));if(!this['isConfigured'](_0x225466[_0x1f57('0x157')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x225466,'no\x20find\x20by\x20configured');}logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x156'),this['channel'][_0x1f57('0x3c')],_0x225466[_0x1f57('0x157')]));var _0x39b78b=this[_0x1f57('0x53')][_0x1f57('0xa9')](this,_0x225466['findBy']);if(_0x39b78b){logger['info'](util['format'](_0x1f57('0x158'),this[_0x1f57('0x10')]['callerid'],_0x225466['findBy']));this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x158'),this['channel'][_0x1f57('0x3c')],_0x225466['findBy']));return{'code':0xc8,'result':_0x1f57('0x159')};}else{logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1f57('0x10')]['callerid'],_0x225466[_0x1f57('0x157')]));this[_0x1f57('0x10')]['noop'](util['format'](_0x1f57('0x15a'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x225466[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x15b')};}};AGIVertices['prototype'][_0x1f57('0x1c4')]=function(_0x25ab93){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x1c5'),_0x25ab93[_0x1f57('0x39')]));var _0x922318=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0x1c6'),[_0x25ab93[_0x1f57('0x1c7')],_0x25ab93[_0x1f57('0x7b')]]);if(_0x922318[_0x1f57('0xa5')]===-0x1){return _0x922318;}return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0xc2'),_0x1f57('0x1c6'),_0x25ab93['mailbox']));};AGIVertices['prototype'][_0x1f57('0x1c8')]=function(_0x2eabad){logger['info'](util[_0x1f57('0x29')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2eabad[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x2eabad[_0x1f57('0xd8')])){return this[_0x1f57('0x10')]['error'](_0x2eabad,_0x1f57('0x1a5'));}var _0x5b11bc=this[_0x1f57('0x14')][_0x1f57('0xa9')](this,_0x2eabad[_0x1f57('0xd8')]);if(!_0x5b11bc){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x2eabad,_0x1f57('0xda'));}var _0x58ba54=this[_0x1f57('0x10')]['getVariable'](_0x5b11bc);return{'code':0xc8,'result':_0x58ba54[_0x1f57('0xa7')]?_0x58ba54[_0x1f57('0xa7')]:'-'};};String['prototype'][_0x1f57('0x1c9')]=function(_0x311d57,_0x3ef717){return this[_0x1f57('0xa4')](_0x311d57)[_0x1f57('0x1ca')](_0x3ef717);};module[_0x1f57('0x1cb')]=AGIVertices;
\ No newline at end of file
index 0e4d8af..b0ff92a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc37=['[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','../ami','acw','../rpc/user','../rpc/voiceAgentReport','agents','timers','agentconnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','blindtransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','queue','voiceQueues','ACW','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','channels','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','timer','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','mandatoryDisposition','interface','uniqueid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid'];(function(_0x4efb72,_0x27bb97){var _0x544ac6=function(_0x1fb40f){while(--_0x1fb40f){_0x4efb72['push'](_0x4efb72['shift']());}};_0x544ac6(++_0x27bb97);}(_0xbc37,0x1f3));var _0x7bc3=function(_0xb14376,_0x5b0bf2){_0xb14376=_0xb14376-0x0;var _0x232f52=_0xbc37[_0xb14376];return _0x232f52;};'use strict';var util=require('util');var _=require(_0x7bc3('0x0'));var moment=require('moment');var ami=require(_0x7bc3('0x1'));var logger=require('../../../config/logger')(_0x7bc3('0x2'));var RpcUser=require(_0x7bc3('0x3'));var RpcVoiceAgentReport=require(_0x7bc3('0x4'));function Acw(_0x7d9d00){this['voiceQueues']=_0x7d9d00['voiceQueues'];this['agents']=_0x7d9d00[_0x7bc3('0x5')];this['timers']=_0x7d9d00[_0x7bc3('0x6')];this['channels']={};ami['on'](_0x7bc3('0x7'),this['syncAgentConnect']['bind'](this));ami['on'](_0x7bc3('0x8'),this[_0x7bc3('0x9')][_0x7bc3('0xa')](this));ami['on'](_0x7bc3('0xb'),this[_0x7bc3('0xc')][_0x7bc3('0xa')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x7bc3('0xa')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7bc3('0xa')](this));ami['on'](_0x7bc3('0xd'),this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x7bc3('0xe')][_0x7bc3('0xa')](this));}function getDiff(_0x3ce021){var _0xe322bf=moment()[_0x7bc3('0xf')](0x0);var _0x57d933=moment(_0x3ce021)[_0x7bc3('0xf')](0x0);return _0xe322bf['diff'](_0x57d933,_0x7bc3('0x10'));}Acw[_0x7bc3('0x11')]['startAcw']=function(_0x4e118c){try{var _0x3dfc52=this;var _0x4ead9b=this['channels'][_0x4e118c]['interface'];var _0x1d0e15=this['channels'][_0x4e118c][_0x7bc3('0x12')];var _0x4f2a8c=this[_0x7bc3('0x13')][_0x1d0e15];var _0x204aec=![];var _0x10a4e0=_0x7bc3('0x14');if(_0x4f2a8c['mandatoryDisposition']){if(_0x4f2a8c[_0x7bc3('0x15')][_0x7bc3('0x16')]){_0x204aec=!![];_0x10a4e0=_0x4f2a8c[_0x7bc3('0x15')][_0x7bc3('0x16')];}}ami[_0x7bc3('0x17')]({'action':'QueuePause','interface':_0x4ead9b,'paused':!![],'reason':_0x10a4e0})[_0x7bc3('0x18')](function(_0x1cfa35){if(_0x3dfc52[_0x7bc3('0x5')][_0x4ead9b]){return RpcUser[_0x7bc3('0x19')](_0x3dfc52[_0x7bc3('0x5')][_0x4ead9b]['id'])[_0x7bc3('0x18')](function(_0x408892){if(_0x408892&&!_0x408892[_0x7bc3('0x1a')]){logger[_0x7bc3('0x1b')](_0x7bc3('0x1c'),_0x4e118c,_0x4ead9b,_0x1d0e15);var _0x49344f=_0x3dfc52['channels'][_0x4e118c][_0x7bc3('0x1d')]&&_0x3dfc52[_0x7bc3('0x1e')][_0x4e118c]['destlinkedid']?_0x3dfc52[_0x7bc3('0x1e')][_0x4e118c][_0x7bc3('0x1f')]:_0x4e118c;return RpcUser[_0x7bc3('0x20')](_0x3dfc52[_0x7bc3('0x5')][_0x4ead9b],_0x10a4e0,_0x49344f)['then'](function(_0x3fef0e){if(!_0x204aec){_0x3dfc52[_0x7bc3('0x6')][_0x4ead9b]={};logger[_0x7bc3('0x1b')](_0x7bc3('0x21'),_0x4e118c,_0x3dfc52[_0x7bc3('0x13')][_0x1d0e15][_0x7bc3('0x22')],_0x4ead9b,_0x1d0e15);_0x3dfc52[_0x7bc3('0x6')][_0x4ead9b]['timer']=setTimeout(_0x3dfc52['stopAcw'][_0x7bc3('0xa')](_0x3dfc52,_0x4ead9b),_0x3dfc52[_0x7bc3('0x13')][_0x1d0e15]['acwTimeout']*0x3e8);_0x3dfc52['timers'][_0x4ead9b][_0x7bc3('0x23')]=moment()[_0x7bc3('0x24')](_0x7bc3('0x25'));_0x3dfc52['timers'][_0x4ead9b]['uniqueid']=_0x4e118c;_0x3dfc52[_0x7bc3('0x6')][_0x4ead9b]['queue']=_0x1d0e15;_0x3dfc52[_0x7bc3('0x6')][_0x4ead9b]['updateAcw']=function(){var _0x2d434f=getDiff(_0x3dfc52['timers'][_0x4ead9b][_0x7bc3('0x23')]);clearTimeout(_0x3dfc52[_0x7bc3('0x6')][_0x4ead9b]['timer']);_0x3dfc52[_0x7bc3('0x6')][_0x4ead9b][_0x7bc3('0x26')]=![];RpcVoiceAgentReport[_0x7bc3('0x27')]({'acwtime':_0x2d434f},_0x3dfc52[_0x7bc3('0x6')][_0x4ead9b]['uniqueid'],_0x4ead9b)[_0x7bc3('0x18')](function(_0x5c44a9){logger[_0x7bc3('0x1b')](_0x7bc3('0x28'),_0x4e118c,_0x2d434f,_0x5c44a9);})['catch'](function(_0x1d82be){logger[_0x7bc3('0x29')]('[%s][UPDATE][ERRORS:%s]',_0x4e118c,_0x1d82be);});delete _0x3dfc52[_0x7bc3('0x6')][_0x4ead9b];};}});}else{logger['info'](_0x7bc3('0x2a'),_0x4e118c,_0x4ead9b,_0x1d0e15);}});}})['catch'](function(_0x37f0d2){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4e118c,_0x3dfc52[_0x7bc3('0x13')][_0x1d0e15][_0x7bc3('0x22')],_0x4ead9b,_0x1d0e15);})[_0x7bc3('0x2b')](function(){delete _0x3dfc52[_0x7bc3('0x1e')][_0x4e118c];});}catch(_0x1d84c8){logger[_0x7bc3('0x29')]('[ACW][START]\x20%s',_0x1d84c8[_0x7bc3('0x2c')]);}};Acw[_0x7bc3('0x11')][_0x7bc3('0x2d')]=function(_0x289bf8){try{var _0x5e10f2=this;if(_0x5e10f2['timers'][_0x289bf8]){_0x5e10f2['timers'][_0x289bf8]['timer']=![];var _0x2a963a=_0x5e10f2[_0x7bc3('0x6')][_0x289bf8]['uniqueid'];var _0x5cae66=_0x5e10f2[_0x7bc3('0x6')][_0x289bf8][_0x7bc3('0x12')];var _0x56390d=_0x5e10f2[_0x7bc3('0x13')][_0x5cae66][_0x7bc3('0x22')];logger[_0x7bc3('0x1b')](_0x7bc3('0x2e'),_0x2a963a,_0x289bf8);RpcUser[_0x7bc3('0x2f')](this['agents'][_0x289bf8]);RpcVoiceAgentReport['update']({'acwtime':_0x56390d,'agentacw':!![]},_0x2a963a,_0x289bf8)['then'](function(_0x4ef250){logger[_0x7bc3('0x1b')]('[%s][UPDATE][ACWTIME:%s]',_0x2a963a,_0x56390d,_0x4ef250);})['catch'](function(_0x1de432){logger[_0x7bc3('0x29')]('[%s][UPDATE][ERRORS:%s]',_0x2a963a,_0x1de432);});}else{logger[_0x7bc3('0x29')](_0x7bc3('0x30'),_0x289bf8);if(_0x5e10f2[_0x7bc3('0x6')]){logger['info'](_0x7bc3('0x31'),JSON[_0x7bc3('0x32')](_0x5e10f2[_0x7bc3('0x6')]));}}}catch(_0x420a37){logger[_0x7bc3('0x29')](_0x7bc3('0x33'),_0x420a37['message']);}};Acw[_0x7bc3('0x11')][_0x7bc3('0x34')]=function(_0x50ca66){try{if(this[_0x7bc3('0x13')][_0x50ca66['queue']]&&(this['voiceQueues'][_0x50ca66[_0x7bc3('0x12')]][_0x7bc3('0x2')]||this[_0x7bc3('0x13')][_0x50ca66[_0x7bc3('0x12')]][_0x7bc3('0x35')])){if(this[_0x7bc3('0x5')][_0x50ca66[_0x7bc3('0x36')]]){this[_0x7bc3('0x1e')][_0x50ca66[_0x7bc3('0x37')]]={'queue':_0x50ca66[_0x7bc3('0x12')],'interface':_0x50ca66[_0x7bc3('0x36')],'destlinkedid':_0x50ca66[_0x7bc3('0x1f')]};}}}catch(_0x52e7ba){logger['error'](_0x7bc3('0x38'),_0x52e7ba[_0x7bc3('0x2c')]);}};Acw['prototype'][_0x7bc3('0xe')]=function(_0x38a284){try{if(this[_0x7bc3('0x13')][_0x38a284[_0x7bc3('0x12')]]&&(this[_0x7bc3('0x13')][_0x38a284[_0x7bc3('0x12')]][_0x7bc3('0x2')]||this['voiceQueues'][_0x38a284[_0x7bc3('0x12')]][_0x7bc3('0x35')])){if(this[_0x7bc3('0x5')][_0x38a284[_0x7bc3('0x36')]]){this[_0x7bc3('0x1e')][_0x38a284['uniqueid']]={'queue':_0x38a284['queue'],'interface':_0x38a284[_0x7bc3('0x36')]};}}}catch(_0xacc6da){logger['error'](_0x7bc3('0x39'),_0xacc6da[_0x7bc3('0x2c')]);}};Acw[_0x7bc3('0x11')][_0x7bc3('0x9')]=function(_0x40a9cf){try{if(this[_0x7bc3('0x1e')][_0x40a9cf[_0x7bc3('0x37')]]&&_[_0x7bc3('0x3a')](this[_0x7bc3('0x1e')][_0x40a9cf['uniqueid']][_0x7bc3('0x1d')])){logger['info'](_0x7bc3('0x3b'),_0x40a9cf['uniqueid']);this['startAcw'](_0x40a9cf['uniqueid']);}else if(this[_0x7bc3('0x1e')][_0x40a9cf['linkedid']]&&_[_0x7bc3('0x3a')](this[_0x7bc3('0x1e')][_0x40a9cf[_0x7bc3('0x3c')]][_0x7bc3('0x1d')])){logger[_0x7bc3('0x1b')]('[%s][HANGUP:LINKEDID]',_0x40a9cf[_0x7bc3('0x3c')]);this[_0x7bc3('0x3d')](_0x40a9cf['linkedid']);}}catch(_0x6b1d5a){logger['error'](_0x7bc3('0x3e'),_0x6b1d5a[_0x7bc3('0x2c')]);}};Acw[_0x7bc3('0x11')][_0x7bc3('0xc')]=function(_0x49d6ba){try{if(this[_0x7bc3('0x1e')][_0x49d6ba['uniqueid']]&&this[_0x7bc3('0x1e')][_0x49d6ba[_0x7bc3('0x37')]][_0x7bc3('0x1d')]){logger[_0x7bc3('0x1b')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x49d6ba[_0x7bc3('0x37')]);this['startAcw'](_0x49d6ba['uniqueid']);}else if(this[_0x7bc3('0x1e')][_0x49d6ba[_0x7bc3('0x3c')]]&&this[_0x7bc3('0x1e')][_0x49d6ba['linkedid']]['attended']){logger[_0x7bc3('0x1b')](_0x7bc3('0x3f'),_0x49d6ba[_0x7bc3('0x3c')]);this['startAcw'](_0x49d6ba[_0x7bc3('0x3c')]);}}catch(_0xae4cda){logger[_0x7bc3('0x29')](_0x7bc3('0x40'),_0xae4cda[_0x7bc3('0x2c')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x51c18a){try{if(!_['isNil'](this['channels'][_0x51c18a[_0x7bc3('0x41')]])){this[_0x7bc3('0x3d')](_0x51c18a[_0x7bc3('0x41')]);if(this[_0x7bc3('0x1e')][_0x51c18a[_0x7bc3('0x42')]]){this[_0x7bc3('0x1e')][_0x51c18a[_0x7bc3('0x42')]]['attended']=!![];this['channels'][_0x51c18a[_0x7bc3('0x43')]]=this[_0x7bc3('0x1e')][_0x51c18a['secondtransfereruniqueid']];delete this[_0x7bc3('0x1e')][_0x51c18a[_0x7bc3('0x42')]];}}else if(!_['isNil'](this[_0x7bc3('0x1e')][_0x51c18a[_0x7bc3('0x43')]])){this[_0x7bc3('0x3d')](_0x51c18a[_0x7bc3('0x43')]);if(this[_0x7bc3('0x1e')][_0x51c18a[_0x7bc3('0x44')]]){this[_0x7bc3('0x1e')][_0x51c18a[_0x7bc3('0x44')]][_0x7bc3('0x1d')]=!![];this[_0x7bc3('0x1e')][_0x51c18a[_0x7bc3('0x41')]]=this['channels'][_0x51c18a['origtransfereruniqueid']];delete this[_0x7bc3('0x1e')][_0x51c18a[_0x7bc3('0x44')]];}}}catch(_0x43ba30){logger[_0x7bc3('0x29')](_0x7bc3('0x45'),_0x43ba30['message']);}};Acw[_0x7bc3('0x11')][_0x7bc3('0x46')]=function(_0xd4ba89){try{if(this[_0x7bc3('0x1e')][_0xd4ba89[_0x7bc3('0x47')]]){logger[_0x7bc3('0x1b')](_0x7bc3('0x48'),JSON[_0x7bc3('0x32')](_0xd4ba89[_0x7bc3('0x47')]));this['startAcw'](_0xd4ba89[_0x7bc3('0x47')]);}else if(this[_0x7bc3('0x1e')][_0xd4ba89['transfererlinkedid']]){logger[_0x7bc3('0x1b')](_0x7bc3('0x49'),JSON[_0x7bc3('0x32')](_0xd4ba89['transfererlinkedid']));this[_0x7bc3('0x3d')](_0xd4ba89[_0x7bc3('0x4a')]);}}catch(_0x505a59){logger[_0x7bc3('0x29')](_0x7bc3('0x4b'),_0x505a59[_0x7bc3('0x2c')]);}};Acw[_0x7bc3('0x11')][_0x7bc3('0x4c')]=function(_0x38c578){try{if(this[_0x7bc3('0x13')][_0x38c578['queue']]&&this['voiceQueues'][_0x38c578[_0x7bc3('0x12')]][_0x7bc3('0x4d')]===_0x7bc3('0x4e')){if(this[_0x7bc3('0x5')][_0x38c578[_0x7bc3('0x36')]]){logger[_0x7bc3('0x1b')](_0x7bc3('0x4f'),_0x38c578['uniqueid'],_0x38c578[_0x7bc3('0x36')],_0x38c578[_0x7bc3('0x12')]);return RpcUser[_0x7bc3('0x20')](this[_0x7bc3('0x5')][_0x38c578[_0x7bc3('0x36')]],_0x7bc3('0x50'),_0x38c578[_0x7bc3('0x37')]);}}}catch(_0x57957d){logger[_0x7bc3('0x29')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x57957d[_0x7bc3('0x2c')]);}};module[_0x7bc3('0x51')]=Acw;
\ No newline at end of file
+var _0x5e1d=['[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','channels','bind','hanguprequest','syncHangup','agentringnoanswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','QueuePause','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid'];(function(_0x2724d5,_0x3a55cf){var _0x544dc6=function(_0x4a48ee){while(--_0x4a48ee){_0x2724d5['push'](_0x2724d5['shift']());}};_0x544dc6(++_0x3a55cf);}(_0x5e1d,0x1ab));var _0xd5e1=function(_0x431bd7,_0x47fdf6){_0x431bd7=_0x431bd7-0x0;var _0x356280=_0x5e1d[_0x431bd7];return _0x356280;};'use strict';var util=require('util');var _=require(_0xd5e1('0x0'));var moment=require('moment');var ami=require(_0xd5e1('0x1'));var logger=require(_0xd5e1('0x2'))(_0xd5e1('0x3'));var RpcUser=require(_0xd5e1('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5e0d7a){this['voiceQueues']=_0x5e0d7a[_0xd5e1('0x5')];this['agents']=_0x5e0d7a[_0xd5e1('0x6')];this['timers']=_0x5e0d7a['timers'];this[_0xd5e1('0x7')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xd5e1('0x8')](this));ami['on'](_0xd5e1('0x9'),this['syncHangupRequest'][_0xd5e1('0x8')](this));ami['on']('hangup',this[_0xd5e1('0xa')][_0xd5e1('0x8')](this));ami['on'](_0xd5e1('0xb'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xd5e1('0xc'),this['syncAttendedTransfer'][_0xd5e1('0x8')](this));ami['on']('blindtransfer',this[_0xd5e1('0xd')][_0xd5e1('0x8')](this));ami['on'](_0xd5e1('0xe'),this[_0xd5e1('0xf')][_0xd5e1('0x8')](this));}function getDiff(_0x1a188f){var _0x4461bd=moment()[_0xd5e1('0x10')](0x0);var _0x6dfdec=moment(_0x1a188f)[_0xd5e1('0x10')](0x0);return _0x4461bd['diff'](_0x6dfdec,_0xd5e1('0x11'));}Acw[_0xd5e1('0x12')][_0xd5e1('0x13')]=function(_0x13d353){try{var _0x15da12=this;var _0x49fe64=this[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x14')];var _0x1cd7b4=this[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x15')];var _0x4e9c0d=this['voiceQueues'][_0x1cd7b4];var _0x307d35=![];var _0x34ae29=_0xd5e1('0x16');if(_0x4e9c0d['mandatoryDisposition']){if(_0x4e9c0d[_0xd5e1('0x17')][_0xd5e1('0x18')]){_0x307d35=!![];_0x34ae29=_0x4e9c0d['mandatoryDispositionPause']['name'];}}ami['Action']({'action':_0xd5e1('0x19'),'interface':_0x49fe64,'paused':!![],'reason':_0x34ae29})[_0xd5e1('0x1a')](function(_0x36cd9c){if(_0x15da12['agents'][_0x49fe64]){return RpcUser['getAgent'](_0x15da12[_0xd5e1('0x6')][_0x49fe64]['id'])[_0xd5e1('0x1a')](function(_0x37bb54){if(_0x37bb54&&!_0x37bb54[_0xd5e1('0x1b')]){logger['info'](_0xd5e1('0x1c'),_0x13d353,_0x49fe64,_0x1cd7b4);var _0x2aaf4=_0x15da12[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x1d')]&&_0x15da12[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x1e')]?_0x15da12[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x1e')]:_0x13d353;return RpcUser['savePause'](_0x15da12['agents'][_0x49fe64],_0x34ae29,_0x2aaf4)['then'](function(_0x32db6f){if(!_0x307d35){_0x15da12[_0xd5e1('0x1f')][_0x49fe64]={};logger['info'](_0xd5e1('0x20'),_0x13d353,_0x15da12[_0xd5e1('0x5')][_0x1cd7b4][_0xd5e1('0x21')],_0x49fe64,_0x1cd7b4);_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x22')]=setTimeout(_0x15da12[_0xd5e1('0x23')][_0xd5e1('0x8')](_0x15da12,_0x49fe64),_0x15da12[_0xd5e1('0x5')][_0x1cd7b4][_0xd5e1('0x21')]*0x3e8);_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x24')]=moment()[_0xd5e1('0x25')](_0xd5e1('0x26'));_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x27')]=_0x13d353;_0x15da12[_0xd5e1('0x1f')][_0x49fe64]['queue']=_0x1cd7b4;_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x28')]=function(){var _0x2d4a92=getDiff(_0x15da12['timers'][_0x49fe64][_0xd5e1('0x24')]);clearTimeout(_0x15da12[_0xd5e1('0x1f')][_0x49fe64]['timer']);_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x22')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2d4a92},_0x15da12['timers'][_0x49fe64][_0xd5e1('0x27')],_0x49fe64)[_0xd5e1('0x1a')](function(_0x51bb0f){logger['info'](_0xd5e1('0x29'),_0x13d353,_0x2d4a92,_0x51bb0f);})[_0xd5e1('0x2a')](function(_0x320385){logger['error'](_0xd5e1('0x2b'),_0x13d353,_0x320385);});delete _0x15da12[_0xd5e1('0x1f')][_0x49fe64];};}});}else{logger[_0xd5e1('0x2c')](_0xd5e1('0x2d'),_0x13d353,_0x49fe64,_0x1cd7b4);}});}})[_0xd5e1('0x2a')](function(_0x11f1f1){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x13d353,_0x15da12[_0xd5e1('0x5')][_0x1cd7b4][_0xd5e1('0x21')],_0x49fe64,_0x1cd7b4);})[_0xd5e1('0x2e')](function(){delete _0x15da12['channels'][_0x13d353];});}catch(_0x32984e){logger[_0xd5e1('0x2f')](_0xd5e1('0x30'),_0x32984e['message']);}};Acw[_0xd5e1('0x12')][_0xd5e1('0x23')]=function(_0x599e82){try{var _0x52feae=this;if(_0x52feae[_0xd5e1('0x1f')][_0x599e82]){_0x52feae[_0xd5e1('0x1f')][_0x599e82]['timer']=![];var _0x1e07be=_0x52feae[_0xd5e1('0x1f')][_0x599e82][_0xd5e1('0x27')];var _0x23b789=_0x52feae['timers'][_0x599e82]['queue'];var _0x544c00=_0x52feae[_0xd5e1('0x5')][_0x23b789][_0xd5e1('0x21')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x1e07be,_0x599e82);RpcUser[_0xd5e1('0x31')](this[_0xd5e1('0x6')][_0x599e82]);RpcVoiceAgentReport['update']({'acwtime':_0x544c00,'agentacw':!![]},_0x1e07be,_0x599e82)[_0xd5e1('0x1a')](function(_0x3e6fe8){logger[_0xd5e1('0x2c')](_0xd5e1('0x29'),_0x1e07be,_0x544c00,_0x3e6fe8);})[_0xd5e1('0x2a')](function(_0x1d469d){logger[_0xd5e1('0x2f')](_0xd5e1('0x2b'),_0x1e07be,_0x1d469d);});}else{logger[_0xd5e1('0x2f')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x599e82);if(_0x52feae['timers']){logger['info'](_0xd5e1('0x32'),JSON[_0xd5e1('0x33')](_0x52feae[_0xd5e1('0x1f')]));}}}catch(_0x3a590e){logger[_0xd5e1('0x2f')](_0xd5e1('0x34'),_0x3a590e[_0xd5e1('0x35')]);}};Acw[_0xd5e1('0x12')][_0xd5e1('0x36')]=function(_0x27bd64){try{if(this[_0xd5e1('0x5')][_0x27bd64[_0xd5e1('0x15')]]&&(this[_0xd5e1('0x5')][_0x27bd64[_0xd5e1('0x15')]][_0xd5e1('0x3')]||this[_0xd5e1('0x5')][_0x27bd64[_0xd5e1('0x15')]]['mandatoryDisposition'])){if(this[_0xd5e1('0x6')][_0x27bd64[_0xd5e1('0x14')]]){this[_0xd5e1('0x7')][_0x27bd64[_0xd5e1('0x27')]]={'queue':_0x27bd64[_0xd5e1('0x15')],'interface':_0x27bd64['interface'],'destlinkedid':_0x27bd64[_0xd5e1('0x1e')]};}}}catch(_0x308ae1){logger['error'](_0xd5e1('0x37'),_0x308ae1[_0xd5e1('0x35')]);}};Acw[_0xd5e1('0x12')][_0xd5e1('0xf')]=function(_0x1f54f1){try{if(this['voiceQueues'][_0x1f54f1[_0xd5e1('0x15')]]&&(this[_0xd5e1('0x5')][_0x1f54f1[_0xd5e1('0x15')]]['acw']||this[_0xd5e1('0x5')][_0x1f54f1[_0xd5e1('0x15')]][_0xd5e1('0x38')])){if(this[_0xd5e1('0x6')][_0x1f54f1[_0xd5e1('0x14')]]){this[_0xd5e1('0x7')][_0x1f54f1['uniqueid']]={'queue':_0x1f54f1['queue'],'interface':_0x1f54f1['interface']};}}}catch(_0x552c48){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x552c48[_0xd5e1('0x35')]);}};Acw['prototype'][_0xd5e1('0x39')]=function(_0x109bd9){try{if(this[_0xd5e1('0x7')][_0x109bd9['uniqueid']]&&_[_0xd5e1('0x3a')](this['channels'][_0x109bd9['uniqueid']][_0xd5e1('0x1d')])){logger[_0xd5e1('0x2c')](_0xd5e1('0x3b'),_0x109bd9[_0xd5e1('0x27')]);this[_0xd5e1('0x13')](_0x109bd9[_0xd5e1('0x27')]);}else if(this[_0xd5e1('0x7')][_0x109bd9['linkedid']]&&_[_0xd5e1('0x3a')](this[_0xd5e1('0x7')][_0x109bd9[_0xd5e1('0x3c')]][_0xd5e1('0x1d')])){logger[_0xd5e1('0x2c')](_0xd5e1('0x3d'),_0x109bd9[_0xd5e1('0x3c')]);this[_0xd5e1('0x13')](_0x109bd9[_0xd5e1('0x3c')]);}}catch(_0x426a94){logger['error'](_0xd5e1('0x3e'),_0x426a94[_0xd5e1('0x35')]);}};Acw[_0xd5e1('0x12')]['syncHangup']=function(_0x556ff8){try{if(this['channels'][_0x556ff8[_0xd5e1('0x27')]]&&this[_0xd5e1('0x7')][_0x556ff8[_0xd5e1('0x27')]][_0xd5e1('0x1d')]){logger[_0xd5e1('0x2c')](_0xd5e1('0x3f'),_0x556ff8[_0xd5e1('0x27')]);this['startAcw'](_0x556ff8[_0xd5e1('0x27')]);}else if(this[_0xd5e1('0x7')][_0x556ff8['linkedid']]&&this[_0xd5e1('0x7')][_0x556ff8[_0xd5e1('0x3c')]][_0xd5e1('0x1d')]){logger[_0xd5e1('0x2c')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x556ff8['linkedid']);this[_0xd5e1('0x13')](_0x556ff8[_0xd5e1('0x3c')]);}}catch(_0xa09b76){logger[_0xd5e1('0x2f')](_0xd5e1('0x40'),_0xa09b76['message']);}};Acw['prototype'][_0xd5e1('0x41')]=function(_0xea756c){try{if(!_['isNil'](this['channels'][_0xea756c[_0xd5e1('0x42')]])){this['startAcw'](_0xea756c[_0xd5e1('0x42')]);if(this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x43')]]){this[_0xd5e1('0x7')][_0xea756c['secondtransfereruniqueid']]['attended']=!![];this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x44')]]=this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x43')]];delete this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x43')]];}}else if(!_[_0xd5e1('0x45')](this['channels'][_0xea756c[_0xd5e1('0x44')]])){this[_0xd5e1('0x13')](_0xea756c[_0xd5e1('0x44')]);if(this['channels'][_0xea756c[_0xd5e1('0x46')]]){this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x46')]][_0xd5e1('0x1d')]=!![];this['channels'][_0xea756c[_0xd5e1('0x42')]]=this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x46')]];delete this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x46')]];}}}catch(_0x1a92b5){logger['error'](_0xd5e1('0x47'),_0x1a92b5['message']);}};Acw[_0xd5e1('0x12')][_0xd5e1('0xd')]=function(_0x1ce65f){try{if(this[_0xd5e1('0x7')][_0x1ce65f[_0xd5e1('0x48')]]){logger[_0xd5e1('0x2c')](_0xd5e1('0x49'),JSON['stringify'](_0x1ce65f[_0xd5e1('0x48')]));this['startAcw'](_0x1ce65f[_0xd5e1('0x48')]);}else if(this[_0xd5e1('0x7')][_0x1ce65f[_0xd5e1('0x4a')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xd5e1('0x33')](_0x1ce65f['transfererlinkedid']));this['startAcw'](_0x1ce65f[_0xd5e1('0x4a')]);}}catch(_0x169220){logger['error'](_0xd5e1('0x4b'),_0x169220['message']);}};Acw[_0xd5e1('0x12')][_0xd5e1('0x4c')]=function(_0x30cbc2){try{if(this['voiceQueues'][_0x30cbc2[_0xd5e1('0x15')]]&&this[_0xd5e1('0x5')][_0x30cbc2[_0xd5e1('0x15')]][_0xd5e1('0x4d')]===_0xd5e1('0x4e')){if(this[_0xd5e1('0x6')][_0x30cbc2['interface']]){logger[_0xd5e1('0x2c')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x30cbc2['uniqueid'],_0x30cbc2[_0xd5e1('0x14')],_0x30cbc2[_0xd5e1('0x15')]);return RpcUser[_0xd5e1('0x4f')](this['agents'][_0x30cbc2[_0xd5e1('0x14')]],_0xd5e1('0x50'),_0x30cbc2[_0xd5e1('0x27')]);}}}catch(_0x34bf62){logger['error'](_0xd5e1('0x51'),_0x34bf62[_0xd5e1('0x35')]);}};module[_0xd5e1('0x52')]=Acw;
\ No newline at end of file
index 1457c4c..80b341e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec55=['actionSipPeerStatus','actionQueueSummary','log','exports','asterisk-manager','bluebird','util','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','devicestatelist','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList'];(function(_0x356a22,_0x241023){var _0x3b9add=function(_0x22fc24){while(--_0x22fc24){_0x356a22['push'](_0x356a22['shift']());}};_0x3b9add(++_0x241023);}(_0xec55,0x7f));var _0x5ec5=function(_0x5610b7,_0x5095be){_0x5610b7=_0x5610b7-0x0;var _0x1c0eef=_0xec55[_0x5610b7];return _0x1c0eef;};'use strict';var Manager=require(_0x5ec5('0x0'));var BPromise=require(_0x5ec5('0x1'));var moment=require('moment');var util=require(_0x5ec5('0x2'));var _=require('lodash');var logger=require('../../config/logger')(_0x5ec5('0x3'));var config=require(_0x5ec5('0x4'));var ami=new Manager(config[_0x5ec5('0x5')][_0x5ec5('0x6')],config[_0x5ec5('0x5')]['ip'],config[_0x5ec5('0x5')][_0x5ec5('0x7')],config[_0x5ec5('0x5')][_0x5ec5('0x8')],!![]);ami[_0x5ec5('0x9')]();ami[_0x5ec5('0xa')]=BPromise[_0x5ec5('0xb')](ami[_0x5ec5('0xc')]);function error(_0xb89e27){logger[_0x5ec5('0xd')](util[_0x5ec5('0xe')](_0x5ec5('0xf'),config[_0x5ec5('0x5')][_0x5ec5('0x7')],config[_0x5ec5('0x5')]['ip'],config[_0x5ec5('0x5')][_0x5ec5('0x6')],util[_0x5ec5('0x10')](_0xb89e27,![],null)));}function close(){logger['error'](util[_0x5ec5('0xe')](_0x5ec5('0x11'),config[_0x5ec5('0x5')][_0x5ec5('0x7')],config[_0x5ec5('0x5')]['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x5ec5('0xa')]({'action':_0x5ec5('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x5ec5('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x5ec5('0xa')]({'action':_0x5ec5('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x5ec5('0xa')]({'action':_0x5ec5('0x15')});};};ami[_0x5ec5('0x16')]=function(){return function(){return ami['Action']({'action':_0x5ec5('0x17')});};};function connect(_0x49ad43){logger[_0x5ec5('0x18')](util['format'](_0x5ec5('0x19'),config[_0x5ec5('0x5')][_0x5ec5('0x7')],config['asterisk']['ip'],config[_0x5ec5('0x5')][_0x5ec5('0x6')]));ami[_0x5ec5('0x1a')](_0x5ec5('0xd'),error);ami[_0x5ec5('0x1a')](_0x5ec5('0x1b'),close);}ami['on'](_0x5ec5('0x1c'),connect);ami['on'](_0x5ec5('0x1d'),function(_0x2f241e){logger[_0x5ec5('0x18')](util[_0x5ec5('0xe')](_0x5ec5('0x1e'),config[_0x5ec5('0x5')][_0x5ec5('0x7')],config[_0x5ec5('0x5')]['ip'],config[_0x5ec5('0x5')][_0x5ec5('0x6')],util['inspect'](_0x2f241e,![],null)));});ami['on'](_0x5ec5('0x1f'),function(_0x1aa725){logger[_0x5ec5('0x18')](util['format'](_0x5ec5('0x20'),config[_0x5ec5('0x5')][_0x5ec5('0x7')],config[_0x5ec5('0x5')]['ip'],config['asterisk'][_0x5ec5('0x6')]));return BPromise[_0x5ec5('0x21')]()[_0x5ec5('0x22')](ami[_0x5ec5('0x23')]())[_0x5ec5('0x22')](ami[_0x5ec5('0x24')]())[_0x5ec5('0x22')](ami[_0x5ec5('0x25')]())[_0x5ec5('0x22')](ami[_0x5ec5('0x26')]())['then'](ami[_0x5ec5('0x16')]())['catch'](function(_0xafd215){console[_0x5ec5('0x27')](_0xafd215);});});ami[_0x5ec5('0x1a')](_0x5ec5('0xd'),error);ami[_0x5ec5('0x1a')](_0x5ec5('0x1b'),close);module[_0x5ec5('0x28')]=ami;
\ No newline at end of file
+var _0xa37e=['error','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionSipShowRegistry','actionDeviceStateList','log','exports','bluebird','moment','../../config/logger','ami','asterisk','port','username','password','keepConnected','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect'];(function(_0x14d25e,_0x3fe395){var _0x364596=function(_0x11d247){while(--_0x11d247){_0x14d25e['push'](_0x14d25e['shift']());}};_0x364596(++_0x3fe395);}(_0xa37e,0x147));var _0xea37=function(_0x477f74,_0x218721){_0x477f74=_0x477f74-0x0;var _0x42995f=_0xa37e[_0x477f74];return _0x42995f;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xea37('0x0'));var moment=require(_0xea37('0x1'));var util=require('util');var _=require('lodash');var logger=require(_0xea37('0x2'))(_0xea37('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0xea37('0x4')][_0xea37('0x5')],config[_0xea37('0x4')]['ip'],config[_0xea37('0x4')][_0xea37('0x6')],config[_0xea37('0x4')][_0xea37('0x7')],!![]);ami[_0xea37('0x8')]();ami['Action']=BPromise[_0xea37('0x9')](ami['action']);function error(_0x1cb11e){logger['error'](util[_0xea37('0xa')](_0xea37('0xb'),config[_0xea37('0x4')][_0xea37('0x6')],config[_0xea37('0x4')]['ip'],config['asterisk'][_0xea37('0x5')],util[_0xea37('0xc')](_0x1cb11e,![],null)));}function close(){logger[_0xea37('0xd')](util[_0xea37('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xea37('0x4')]['username'],config['asterisk']['ip'],config[_0xea37('0x4')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xea37('0xe')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xea37('0xf')});};};ami[_0xea37('0x10')]=function(){return function(){return ami['Action']({'action':_0xea37('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xea37('0xe')]({'action':_0xea37('0x12')});};};ami[_0xea37('0x13')]=function(){return function(){return ami[_0xea37('0xe')]({'action':_0xea37('0x14')});};};function connect(_0x42422e){logger[_0xea37('0x15')](util[_0xea37('0xa')](_0xea37('0x16'),config[_0xea37('0x4')][_0xea37('0x6')],config['asterisk']['ip'],config[_0xea37('0x4')]['port']));ami['once'](_0xea37('0xd'),error);ami[_0xea37('0x17')](_0xea37('0x18'),close);}ami['on'](_0xea37('0x19'),connect);ami['on']('shutdown',function(_0xf3aa10){logger['info'](util['format'](_0xea37('0x1a'),config[_0xea37('0x4')][_0xea37('0x6')],config[_0xea37('0x4')]['ip'],config[_0xea37('0x4')][_0xea37('0x5')],util[_0xea37('0xc')](_0xf3aa10,![],null)));});ami['on'](_0xea37('0x1b'),function(_0x37e58a){logger[_0xea37('0x15')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xea37('0x4')]['username'],config[_0xea37('0x4')]['ip'],config[_0xea37('0x4')][_0xea37('0x5')]));return BPromise[_0xea37('0x1c')]()[_0xea37('0x1d')](ami[_0xea37('0x1e')]())[_0xea37('0x1d')](ami[_0xea37('0x1f')]())[_0xea37('0x1d')](ami[_0xea37('0x10')]())[_0xea37('0x1d')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0x21290d){console[_0xea37('0x20')](_0x21290d);});});ami[_0xea37('0x17')]('error',error);ami[_0xea37('0x17')](_0xea37('0x18'),close);module[_0xea37('0x21')]=ami;
\ No newline at end of file
index 762e32b..bda100d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x501d22,_0x120f6f){var _0x43d83f=function(_0x32054d){while(--_0x32054d){_0x501d22['push'](_0x501d22['shift']());}};_0x43d83f(++_0x120f6f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x116446,_0x216e95){_0x116446=_0x116446-0x0;var _0x57e73d=_0x9ffd[_0x116446];return _0x57e73d;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client;
\ No newline at end of file
+var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xe706,0xa3));var _0x6e70=function(_0x2ce715,_0x22e80c){_0x2ce715=_0x2ce715-0x0;var _0x41c7bb=_0xe706[_0x2ce715];return _0x41c7bb;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client;
\ No newline at end of file
index d8b9b9a..659465d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29f0=['callbackat','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','callback','callbackuniqueid'];(function(_0x1767d4,_0x12b9b5){var _0x187933=function(_0x4f0d7d){while(--_0x4f0d7d){_0x1767d4['push'](_0x1767d4['shift']());}};_0x187933(++_0x12b9b5);}(_0x29f0,0xb0));var _0x029f=function(_0x56cb8d,_0x557b16){_0x56cb8d=_0x56cb8d-0x0;var _0x55aa1a=_0x29f0[_0x56cb8d];return _0x55aa1a;};'use strict';var util=require(_0x029f('0x0'));var _=require(_0x029f('0x1'));var moment=require(_0x029f('0x2'));function checkNameSurname(_0x5cd45f,_0x5a5b89,_0x9d7ff8){var _0x37eedf='';if(!_[_0x029f('0x3')](_0x5a5b89)&&_0x029f('0x4')===typeof _0x5a5b89){_0x37eedf+=_0x5a5b89;}if(!_[_0x029f('0x3')](_0x9d7ff8)&&_0x029f('0x4')===typeof _0x9d7ff8){_0x37eedf+='\x20'+_0x9d7ff8;}if(_0x37eedf!==''){return _0x37eedf;}return _0x5cd45f;}function Action(_0x5049b8,_0xf81921,_0x546983){this[_0x029f('0x5')]=_0x5049b8;this[_0x029f('0x6')]=_0x546983||undefined;this[_0x029f('0x7')]=checkNameSurname(_0xf81921[_0x029f('0x8')]['phone'],_0xf81921['Contact']['firstName'],_0xf81921[_0x029f('0x8')][_0x029f('0x9')]);this[_0x029f('0xa')]=_0xf81921[_0x029f('0x8')]['phone'];this[_0x029f('0xb')]=_0x5049b8[_0x029f('0x7')];this[_0x029f('0xc')]=_0xf81921[_0x029f('0xc')]||![];this['type']=_0x5049b8[_0x029f('0xd')];this[_0x029f('0xe')]=_0x5049b8[_0x029f('0xe')]||0x3;this[_0x029f('0xf')]=_0xf81921[_0x029f('0xf')];this['countbusyretry']=_0xf81921[_0x029f('0x10')];this[_0x029f('0x11')]=_0xf81921[_0x029f('0x11')];this[_0x029f('0x12')]=_0xf81921['countnoanswerretry'];this[_0x029f('0x13')]=_0xf81921[_0x029f('0x13')];this[_0x029f('0x14')]=_0xf81921['countdropretry'];this[_0x029f('0x15')]=_0xf81921['countabandonedretry'];this['countmachineretry']=_0xf81921[_0x029f('0x16')];this['countagentrejectretry']=_0xf81921[_0x029f('0x17')];this[_0x029f('0x18')]=_0xf81921['ContactId'];this['ListId']=_0xf81921['ListId'];this['UserId']=_0xf81921[_0x029f('0x19')];this[_0x029f('0x1a')]=_0xf81921['VoiceQueueId'];this[_0x029f('0x1b')]=_0xf81921[_0x029f('0x1b')];this[_0x029f('0x1c')]=_0xf81921['id'];this[_0x029f('0x1d')]=_0xf81921[_0x029f('0x8')][_0x029f('0x1e')]||'';this['starttime']=moment()[_0x029f('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x029f('0x20')]=_0xf81921[_0x029f('0x20')];this[_0x029f('0x21')]=_0xf81921[_0x029f('0x21')];this['callbackat']=_0xf81921[_0x029f('0x22')];this[_0x029f('0x23')]=_0xf81921[_0x029f('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x029f('0x24')][_0x029f('0x25')]=function(){return util[_0x029f('0x1f')](_0x029f('0x26'),this[_0x029f('0x7')],this['voiceQueue'][_0x029f('0x27')]>0x0?this[_0x029f('0xa')]['substring'](this['voiceQueue']['dialCutDigit']):this[_0x029f('0xa')]);};Action[_0x029f('0x24')][_0x029f('0x28')]=function(){return this['queue'];};module[_0x029f('0x29')]=Action;
\ No newline at end of file
+var _0xa41a=['name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','exports','util','lodash','moment','string','voiceQueue','uniqueid'];(function(_0x3f4a28,_0x35156f){var _0x16532b=function(_0x3f787b){while(--_0x3f787b){_0x3f4a28['push'](_0x3f4a28['shift']());}};_0x16532b(++_0x35156f);}(_0xa41a,0x108));var _0xaa41=function(_0x321a0f,_0x216df5){_0x321a0f=_0x321a0f-0x0;var _0x225b0c=_0xa41a[_0x321a0f];return _0x225b0c;};'use strict';var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var moment=require(_0xaa41('0x2'));function checkNameSurname(_0x11a6e5,_0xd23b79,_0x3757a0){var _0xa950c0='';if(!_['isNil'](_0xd23b79)&&_0xaa41('0x3')===typeof _0xd23b79){_0xa950c0+=_0xd23b79;}if(!_['isNil'](_0x3757a0)&&_0xaa41('0x3')===typeof _0x3757a0){_0xa950c0+='\x20'+_0x3757a0;}if(_0xa950c0!==''){return _0xa950c0;}return _0x11a6e5;}function Action(_0x1b262e,_0x266aab,_0x6c6cc0){this[_0xaa41('0x4')]=_0x1b262e;this[_0xaa41('0x5')]=_0x6c6cc0||undefined;this[_0xaa41('0x6')]=checkNameSurname(_0x266aab[_0xaa41('0x7')][_0xaa41('0x8')],_0x266aab[_0xaa41('0x7')][_0xaa41('0x9')],_0x266aab['Contact'][_0xaa41('0xa')]);this[_0xaa41('0xb')]=_0x266aab[_0xaa41('0x7')][_0xaa41('0x8')];this[_0xaa41('0xc')]=_0x1b262e[_0xaa41('0x6')];this[_0xaa41('0xd')]=_0x266aab[_0xaa41('0xd')]||![];this[_0xaa41('0xe')]=_0x1b262e['type'];this[_0xaa41('0xf')]=_0x1b262e[_0xaa41('0xf')]||0x3;this[_0xaa41('0x10')]=_0x266aab[_0xaa41('0x10')];this[_0xaa41('0x11')]=_0x266aab[_0xaa41('0x11')];this[_0xaa41('0x12')]=_0x266aab[_0xaa41('0x12')];this[_0xaa41('0x13')]=_0x266aab[_0xaa41('0x13')];this['countnosuchnumberretry']=_0x266aab[_0xaa41('0x14')];this[_0xaa41('0x15')]=_0x266aab['countdropretry'];this[_0xaa41('0x16')]=_0x266aab['countabandonedretry'];this[_0xaa41('0x17')]=_0x266aab[_0xaa41('0x17')];this[_0xaa41('0x18')]=_0x266aab[_0xaa41('0x18')];this[_0xaa41('0x19')]=_0x266aab['ContactId'];this[_0xaa41('0x1a')]=_0x266aab[_0xaa41('0x1a')];this[_0xaa41('0x1b')]=_0x266aab[_0xaa41('0x1b')];this[_0xaa41('0x1c')]=_0x266aab[_0xaa41('0x1c')];this[_0xaa41('0x1d')]=_0x266aab[_0xaa41('0x1d')];this[_0xaa41('0x1e')]=_0x266aab['id'];this[_0xaa41('0x1f')]=_0x266aab[_0xaa41('0x7')][_0xaa41('0x9')]||'';this['starttime']=moment()['format'](_0xaa41('0x20'));this[_0xaa41('0x21')]=_0x266aab[_0xaa41('0x21')];this[_0xaa41('0x22')]=_0x266aab[_0xaa41('0x22')];this[_0xaa41('0x23')]=_0x266aab[_0xaa41('0x23')];this['recallme']=_0x266aab[_0xaa41('0x24')];this[_0xaa41('0x25')]='';this[_0xaa41('0x26')]='';}Action[_0xaa41('0x27')]['getCaller']=function(){return util[_0xaa41('0x28')](_0xaa41('0x29'),this['name'],this[_0xaa41('0x4')]['dialCutDigit']>0x0?this[_0xaa41('0xb')][_0xaa41('0x2a')](this[_0xaa41('0x4')][_0xaa41('0x2b')]):this[_0xaa41('0xb')]);};Action[_0xaa41('0x27')]['getQueue']=function(){return this[_0xaa41('0xc')];};module[_0xaa41('0x2c')]=Action;
\ No newline at end of file
index dd39e03..82c5f88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa777=['countabandonedretry','uniqueid','calleridname','name','starttime','responsetime','format','ringtime','holdtime','answertime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry'];(function(_0x345fdb,_0x4ea681){var _0x59522e=function(_0x4368ed){while(--_0x4368ed){_0x345fdb['push'](_0x345fdb['shift']());}};_0x59522e(++_0x4ea681);}(_0xa777,0x6b));var _0x7a77=function(_0x273830,_0x36fdd7){_0x273830=_0x273830-0x0;var _0x2fa706=_0xa777[_0x273830];return _0x2fa706;};'use strict';var util=require('util');var _=require(_0x7a77('0x0'));var moment=require(_0x7a77('0x1'));function getSeconds(_0x203248,_0x2d3ed4){var _0x4d594d=moment(_0x203248)['milliseconds'](0x0);var _0x4edf50=moment(_0x2d3ed4)[_0x7a77('0x2')](0x0);return _0x4d594d[_0x7a77('0x3')](_0x4edf50,'seconds');}function AgentComplete(_0x4eed7d,_0x18add4){this[_0x7a77('0x4')]=0x4;this[_0x7a77('0x5')]='Answer';this[_0x7a77('0x6')]=_0x4eed7d[_0x7a77('0x6')];this[_0x7a77('0x7')]=_0x4eed7d['type'];this[_0x7a77('0x8')]=_0x4eed7d[_0x7a77('0x7')]===_0x7a77('0x9')?_0x7a77('0xa'):_0x4eed7d['type'];this[_0x7a77('0xb')]=_0x4eed7d[_0x7a77('0xb')];this[_0x7a77('0xc')]=_0x4eed7d['countcongestionretry'];this[_0x7a77('0xd')]=_0x4eed7d[_0x7a77('0xd')];this[_0x7a77('0xe')]=_0x4eed7d['countbusyretry']+_0x4eed7d[_0x7a77('0xc')]+_0x4eed7d['countnoanswerretry']+_0x4eed7d[_0x7a77('0xf')]+_0x4eed7d[_0x7a77('0x10')]+_0x4eed7d['countabandonedretry']+_0x4eed7d[_0x7a77('0x11')]+_0x4eed7d[_0x7a77('0x12')];this['countnosuchnumberretry']=_0x4eed7d['countnosuchnumberretry'];this[_0x7a77('0x10')]=_0x4eed7d[_0x7a77('0x10')];this[_0x7a77('0x13')]=_0x4eed7d[_0x7a77('0x13')];this['countmachineretry']=_0x4eed7d['countmachineretry'];this[_0x7a77('0x12')]=_0x4eed7d[_0x7a77('0x12')];this[_0x7a77('0x14')]=_0x18add4[_0x7a77('0x14')];this[_0x7a77('0x15')]=_0x4eed7d[_0x7a77('0x16')];this['calleridnum']=_0x4eed7d['number'];this['starttime']=_0x4eed7d[_0x7a77('0x17')];this[_0x7a77('0x18')]=_0x4eed7d['responsetime'];this['answertime']=_0x4eed7d['answertime'];this['endtime']=moment()[_0x7a77('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7a77('0x1a')]=getSeconds(_0x4eed7d['responsetime'],_0x4eed7d[_0x7a77('0x17')]);this[_0x7a77('0x1b')]=getSeconds(_0x4eed7d[_0x7a77('0x1c')],_0x4eed7d[_0x7a77('0x18')]);this['talktime']=getSeconds(this[_0x7a77('0x1d')],_0x4eed7d[_0x7a77('0x1c')]);this['queue']=_0x18add4[_0x7a77('0xa')];this[_0x7a77('0x1e')]=_0x18add4[_0x7a77('0x1e')];this[_0x7a77('0x1f')]=_0x18add4[_0x7a77('0x1f')];this[_0x7a77('0x20')]=_0x4eed7d['callback'];this['callbackuniqueid']=_0x4eed7d[_0x7a77('0x21')];this[_0x7a77('0x22')]=_0x4eed7d[_0x7a77('0x22')];this[_0x7a77('0x23')]=_0x4eed7d[_0x7a77('0x23')];this['ContactId']=_0x4eed7d['ContactId'];this[_0x7a77('0x24')]=_0x4eed7d['ListId'];this['UserId']=_0x4eed7d[_0x7a77('0x25')];this[_0x7a77('0x26')]=_0x4eed7d[_0x7a77('0x26')];this[_0x7a77('0x27')]=_0x4eed7d['CampaignId'];this[_0x7a77('0x28')]=_0x4eed7d[_0x7a77('0x28')]||'';this['originatecalleridname']=_0x4eed7d[_0x7a77('0x29')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0x4217=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0x4217,0x18a));var _0x7421=function(_0x444f09,_0x932626){_0x444f09=_0x444f09-0x0;var _0x423deb=_0x4217[_0x444f09];return _0x423deb;};'use strict';var util=require(_0x7421('0x0'));var _=require(_0x7421('0x1'));var moment=require(_0x7421('0x2'));function getSeconds(_0x499130,_0x3516af){var _0x526463=moment(_0x499130)['milliseconds'](0x0);var _0x42817e=moment(_0x3516af)[_0x7421('0x3')](0x0);return _0x526463[_0x7421('0x4')](_0x42817e,_0x7421('0x5'));}function AgentComplete(_0x378403,_0x2ab2b0){this[_0x7421('0x6')]=0x4;this['statedesc']='Answer';this[_0x7421('0x7')]=_0x378403[_0x7421('0x7')];this['type']=_0x378403[_0x7421('0x8')];this['campaigntype']=_0x378403[_0x7421('0x8')]===_0x7421('0x9')?_0x7421('0xa'):_0x378403[_0x7421('0x8')];this[_0x7421('0xb')]=_0x378403[_0x7421('0xb')];this['countcongestionretry']=_0x378403['countcongestionretry'];this[_0x7421('0xc')]=_0x378403['countnoanswerretry'];this[_0x7421('0xd')]=_0x378403['countbusyretry']+_0x378403[_0x7421('0xe')]+_0x378403[_0x7421('0xc')]+_0x378403[_0x7421('0xf')]+_0x378403[_0x7421('0x10')]+_0x378403[_0x7421('0x11')]+_0x378403[_0x7421('0x12')]+_0x378403[_0x7421('0x13')];this[_0x7421('0xf')]=_0x378403[_0x7421('0xf')];this['countdropretry']=_0x378403['countdropretry'];this[_0x7421('0x11')]=_0x378403[_0x7421('0x11')];this['countmachineretry']=_0x378403['countmachineretry'];this[_0x7421('0x13')]=_0x378403['countagentrejectretry'];this[_0x7421('0x14')]=_0x2ab2b0['uniqueid'];this[_0x7421('0x15')]=_0x378403[_0x7421('0x16')];this[_0x7421('0x17')]=_0x378403[_0x7421('0x18')];this['starttime']=_0x378403[_0x7421('0x19')];this[_0x7421('0x1a')]=_0x378403[_0x7421('0x1a')];this[_0x7421('0x1b')]=_0x378403[_0x7421('0x1b')];this[_0x7421('0x1c')]=moment()[_0x7421('0x1d')](_0x7421('0x1e'));this[_0x7421('0x1f')]=getSeconds(_0x378403[_0x7421('0x1a')],_0x378403[_0x7421('0x19')]);this[_0x7421('0x20')]=getSeconds(_0x378403[_0x7421('0x1b')],_0x378403[_0x7421('0x1a')]);this[_0x7421('0x21')]=getSeconds(this[_0x7421('0x1c')],_0x378403[_0x7421('0x1b')]);this[_0x7421('0xa')]=_0x2ab2b0[_0x7421('0xa')];this['membername']=_0x2ab2b0[_0x7421('0x22')];this[_0x7421('0x23')]=_0x2ab2b0[_0x7421('0x23')];this[_0x7421('0x24')]=_0x378403[_0x7421('0x24')];this[_0x7421('0x25')]=_0x378403[_0x7421('0x25')];this[_0x7421('0x26')]=_0x378403[_0x7421('0x26')];this['recallme']=_0x378403[_0x7421('0x27')];this['ContactId']=_0x378403[_0x7421('0x28')];this[_0x7421('0x29')]=_0x378403[_0x7421('0x29')];this[_0x7421('0x2a')]=_0x378403[_0x7421('0x2a')];this[_0x7421('0x2b')]=_0x378403[_0x7421('0x2b')];this[_0x7421('0x2c')]=_0x378403[_0x7421('0x2c')];this[_0x7421('0x2d')]=_0x378403[_0x7421('0x2d')]||'';this[_0x7421('0x2e')]=_0x378403['originatecalleridname']||'';}module['exports']=AgentComplete;
\ No newline at end of file
index 4bf82f1..d4d3f6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2caf=['campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','seconds','uniqueid','scheduledat'];(function(_0xd27d87,_0x2937fd){var _0x125843=function(_0x3b22e4){while(--_0x3b22e4){_0xd27d87['push'](_0xd27d87['shift']());}};_0x125843(++_0x2937fd);}(_0x2caf,0x6a));var _0xf2ca=function(_0x1b544e,_0x2cd34e){_0x1b544e=_0x1b544e-0x0;var _0x167c06=_0x2caf[_0x1b544e];return _0x167c06;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x22932c,_0x53a64f){var _0x3b2612=moment(_0x22932c)[_0xf2ca('0x0')](0x0);var _0x43b96c=moment(_0x53a64f)[_0xf2ca('0x0')](0x0);return _0x3b2612[_0xf2ca('0x1')](_0x43b96c,_0xf2ca('0x2'));}function Final(_0x1a56cd){this['uniqueid']=_0x1a56cd[_0xf2ca('0x3')];this[_0xf2ca('0x4')]=_0x1a56cd[_0xf2ca('0x4')];this['type']=_0x1a56cd['type'];this[_0xf2ca('0x5')]=_0x1a56cd[_0xf2ca('0x6')]===_0xf2ca('0x7')?_0xf2ca('0x8'):_0x1a56cd[_0xf2ca('0x6')];this['countbusyretry']=_0x1a56cd[_0xf2ca('0x9')];this[_0xf2ca('0xa')]=_0x1a56cd[_0xf2ca('0xa')];this[_0xf2ca('0xb')]=_0x1a56cd[_0xf2ca('0xb')];this[_0xf2ca('0xc')]=_0x1a56cd['countbusyretry']+_0x1a56cd[_0xf2ca('0xa')]+_0x1a56cd[_0xf2ca('0xb')]+_0x1a56cd['countnosuchnumberretry']+_0x1a56cd[_0xf2ca('0xd')]+_0x1a56cd[_0xf2ca('0xe')]+_0x1a56cd['countmachineretry']+_0x1a56cd['countagentrejectretry'];this[_0xf2ca('0xf')]=_0x1a56cd['countnosuchnumberretry'];this[_0xf2ca('0xd')]=_0x1a56cd[_0xf2ca('0xd')];this[_0xf2ca('0xe')]=_0x1a56cd[_0xf2ca('0xe')];this[_0xf2ca('0x10')]=_0x1a56cd[_0xf2ca('0x10')];this[_0xf2ca('0x11')]=_0x1a56cd['countagentrejectretry'];this[_0xf2ca('0x8')]=_0x1a56cd['queue'];this[_0xf2ca('0x12')]=_0x1a56cd['calleridname'];this[_0xf2ca('0x13')]=_0x1a56cd[_0xf2ca('0x13')];this['starttime']=_0x1a56cd[_0xf2ca('0x14')];this[_0xf2ca('0x15')]=_0x1a56cd[_0xf2ca('0x15')];this[_0xf2ca('0x16')]=_0x1a56cd[_0xf2ca('0x15')];this[_0xf2ca('0x17')]=_0x1a56cd[_0xf2ca('0x17')]||0x0;this[_0xf2ca('0x18')]=_0x1a56cd[_0xf2ca('0x18')]||0x0;this[_0xf2ca('0x19')]=_0x1a56cd[_0xf2ca('0x19')]||0x0;this['callback']=_0x1a56cd[_0xf2ca('0x1a')];this[_0xf2ca('0x1b')]=_0x1a56cd[_0xf2ca('0x1b')];this[_0xf2ca('0x1c')]=_0x1a56cd[_0xf2ca('0x1c')];this[_0xf2ca('0x1d')]=_0x1a56cd[_0xf2ca('0x1d')];this[_0xf2ca('0x1e')]=_0x1a56cd['ContactId'];this[_0xf2ca('0x1f')]=_0x1a56cd[_0xf2ca('0x1f')];this['UserId']=_0x1a56cd[_0xf2ca('0x20')];this[_0xf2ca('0x21')]=_0x1a56cd[_0xf2ca('0x21')];this['CampaignId']=_0x1a56cd['CampaignId'];this[_0xf2ca('0x22')]=_0x1a56cd[_0xf2ca('0x22')]||'';this[_0xf2ca('0x23')]=_0x1a56cd[_0xf2ca('0x23')]||'';}module[_0xf2ca('0x24')]=Final;
\ No newline at end of file
+var _0x24ca=['countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x24ca,0x8c));var _0xa24c=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x24ca[_0x2f3794];return _0x1c9fbe;};'use strict';var util=require(_0xa24c('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1f4ee1,_0x4e90b0){var _0x155c49=moment(_0x1f4ee1)[_0xa24c('0x1')](0x0);var _0xe69cdd=moment(_0x4e90b0)['milliseconds'](0x0);return _0x155c49[_0xa24c('0x2')](_0xe69cdd,_0xa24c('0x3'));}function Final(_0x4707f9){this['uniqueid']=_0x4707f9['uniqueid'];this['scheduledat']=_0x4707f9[_0xa24c('0x4')];this[_0xa24c('0x5')]=_0x4707f9[_0xa24c('0x5')];this[_0xa24c('0x6')]=_0x4707f9[_0xa24c('0x5')]===_0xa24c('0x7')?'queue':_0x4707f9[_0xa24c('0x5')];this[_0xa24c('0x8')]=_0x4707f9[_0xa24c('0x8')];this['countcongestionretry']=_0x4707f9['countcongestionretry'];this[_0xa24c('0x9')]=_0x4707f9[_0xa24c('0x9')];this[_0xa24c('0xa')]=_0x4707f9[_0xa24c('0x8')]+_0x4707f9[_0xa24c('0xb')]+_0x4707f9[_0xa24c('0x9')]+_0x4707f9['countnosuchnumberretry']+_0x4707f9['countdropretry']+_0x4707f9['countabandonedretry']+_0x4707f9[_0xa24c('0xc')]+_0x4707f9[_0xa24c('0xd')];this[_0xa24c('0xe')]=_0x4707f9[_0xa24c('0xe')];this[_0xa24c('0xf')]=_0x4707f9['countdropretry'];this[_0xa24c('0x10')]=_0x4707f9['countabandonedretry'];this['countmachineretry']=_0x4707f9['countmachineretry'];this[_0xa24c('0xd')]=_0x4707f9[_0xa24c('0xd')];this[_0xa24c('0x11')]=_0x4707f9[_0xa24c('0x11')];this[_0xa24c('0x12')]=_0x4707f9[_0xa24c('0x12')];this[_0xa24c('0x13')]=_0x4707f9[_0xa24c('0x13')];this[_0xa24c('0x14')]=_0x4707f9[_0xa24c('0x14')];this[_0xa24c('0x15')]=_0x4707f9[_0xa24c('0x15')];this[_0xa24c('0x16')]=_0x4707f9[_0xa24c('0x15')];this['ringtime']=_0x4707f9[_0xa24c('0x17')]||0x0;this['holdtime']=_0x4707f9[_0xa24c('0x18')]||0x0;this[_0xa24c('0x19')]=_0x4707f9[_0xa24c('0x19')]||0x0;this[_0xa24c('0x1a')]=_0x4707f9[_0xa24c('0x1a')];this[_0xa24c('0x1b')]=_0x4707f9[_0xa24c('0x1b')];this[_0xa24c('0x1c')]=_0x4707f9[_0xa24c('0x1c')];this[_0xa24c('0x1d')]=_0x4707f9[_0xa24c('0x1d')];this['ContactId']=_0x4707f9['ContactId'];this[_0xa24c('0x1e')]=_0x4707f9[_0xa24c('0x1e')];this[_0xa24c('0x1f')]=_0x4707f9[_0xa24c('0x1f')];this[_0xa24c('0x20')]=_0x4707f9[_0xa24c('0x20')];this[_0xa24c('0x21')]=_0x4707f9[_0xa24c('0x21')];this[_0xa24c('0x22')]=_0x4707f9['originatecalleridnum']||'';this[_0xa24c('0x23')]=_0x4707f9['originatecalleridname']||'';}module[_0xa24c('0x24')]=Final;
\ No newline at end of file
index 974d206..8e5d7d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76dd=['membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','util','lodash','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','ringtime','talktime'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0x76dd,0xb4));var _0xd76d=function(_0x77ea31,_0x10817c){_0x77ea31=_0x77ea31-0x0;var _0x50fb58=_0x76dd[_0x77ea31];return _0x50fb58;};'use strict';var util=require(_0xd76d('0x0'));var _=require(_0xd76d('0x1'));var moment=require('moment');function getSeconds(_0x2c1b4b,_0x1d7823){var _0x29d553=moment(_0x2c1b4b)[_0xd76d('0x2')](0x0);var _0x17ce95=moment(_0x1d7823)[_0xd76d('0x2')](0x0);return _0x29d553[_0xd76d('0x3')](_0x17ce95,'seconds');}function Hangup(_0x564114,_0x173da5){this['state']=0x4;this[_0xd76d('0x4')]=_0xd76d('0x5');this['scheduledat']=_0x564114[_0xd76d('0x6')];this[_0xd76d('0x7')]=_0x564114[_0xd76d('0x7')];this[_0xd76d('0x8')]=_0x564114[_0xd76d('0x7')]===_0xd76d('0x9')?_0xd76d('0xa'):_0x564114[_0xd76d('0x7')];this[_0xd76d('0xb')]=_0x564114[_0xd76d('0xb')];this[_0xd76d('0xc')]=_0x564114[_0xd76d('0xc')];this[_0xd76d('0xd')]=_0x564114[_0xd76d('0xd')];this[_0xd76d('0xe')]=_0x564114[_0xd76d('0xb')]+_0x564114[_0xd76d('0xc')]+_0x564114[_0xd76d('0xd')]+_0x564114[_0xd76d('0xf')]+_0x564114[_0xd76d('0x10')]+_0x564114[_0xd76d('0x11')]+_0x564114['countmachineretry']+_0x564114[_0xd76d('0x12')];this[_0xd76d('0xf')]=_0x564114[_0xd76d('0xf')];this[_0xd76d('0x10')]=_0x564114[_0xd76d('0x10')];this[_0xd76d('0x11')]=_0x564114[_0xd76d('0x11')];this[_0xd76d('0x13')]=_0x564114[_0xd76d('0x13')];this['countagentrejectretry']=_0x564114['countagentrejectretry'];this[_0xd76d('0x14')]=_0x173da5[_0xd76d('0x14')];this[_0xd76d('0x15')]=_0x564114[_0xd76d('0x16')];this[_0xd76d('0x17')]=_0x564114['number'];this[_0xd76d('0x18')]=_0x564114[_0xd76d('0x18')];this[_0xd76d('0x19')]=_0x564114[_0xd76d('0x19')];this[_0xd76d('0x1a')]=moment()[_0xd76d('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd76d('0x1c')]=getSeconds(_0x564114[_0xd76d('0x19')],_0x564114[_0xd76d('0x18')]);this['holdtime']=0x0;this[_0xd76d('0x1d')]=getSeconds(this[_0xd76d('0x1a')],_0x564114[_0xd76d('0x19')]);this[_0xd76d('0xa')]=_0x564114[_0xd76d('0xa')];this[_0xd76d('0x1e')]='IVR';this[_0xd76d('0x1f')]=_0x173da5[_0xd76d('0x20')];this[_0xd76d('0x21')]=_0x564114[_0xd76d('0x21')];this[_0xd76d('0x22')]=_0x564114[_0xd76d('0x22')];this[_0xd76d('0x23')]=_0x564114[_0xd76d('0x23')];this['recallme']=_0x564114[_0xd76d('0x24')];this[_0xd76d('0x25')]=_0x564114[_0xd76d('0x25')];this[_0xd76d('0x26')]=_0x564114[_0xd76d('0x26')];this[_0xd76d('0x27')]=_0x564114['UserId'];this['VoiceQueueId']=_0x564114['VoiceQueueId'];this[_0xd76d('0x28')]=_0x564114['CampaignId'];}module[_0xd76d('0x29')]=Hangup;
\ No newline at end of file
+var _0x2f8c=['reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername'];(function(_0x4d1ba0,_0x35c4f8){var _0x241320=function(_0x5eb059){while(--_0x5eb059){_0x4d1ba0['push'](_0x4d1ba0['shift']());}};_0x241320(++_0x35c4f8);}(_0x2f8c,0xc0));var _0xc2f8=function(_0x45864f,_0x5292c5){_0x45864f=_0x45864f-0x0;var _0x290e82=_0x2f8c[_0x45864f];return _0x290e82;};'use strict';var util=require(_0xc2f8('0x0'));var _=require(_0xc2f8('0x1'));var moment=require(_0xc2f8('0x2'));function getSeconds(_0x57cfbe,_0xb88522){var _0x520500=moment(_0x57cfbe)['milliseconds'](0x0);var _0x30b74a=moment(_0xb88522)[_0xc2f8('0x3')](0x0);return _0x520500[_0xc2f8('0x4')](_0x30b74a,_0xc2f8('0x5'));}function Hangup(_0x51e5d1,_0x38ec9c){this[_0xc2f8('0x6')]=0x4;this['statedesc']=_0xc2f8('0x7');this[_0xc2f8('0x8')]=_0x51e5d1['scheduledat'];this[_0xc2f8('0x9')]=_0x51e5d1[_0xc2f8('0x9')];this['campaigntype']=_0x51e5d1['type']===_0xc2f8('0xa')?_0xc2f8('0xb'):_0x51e5d1['type'];this[_0xc2f8('0xc')]=_0x51e5d1[_0xc2f8('0xc')];this[_0xc2f8('0xd')]=_0x51e5d1[_0xc2f8('0xd')];this[_0xc2f8('0xe')]=_0x51e5d1[_0xc2f8('0xe')];this[_0xc2f8('0xf')]=_0x51e5d1[_0xc2f8('0xc')]+_0x51e5d1['countcongestionretry']+_0x51e5d1['countnoanswerretry']+_0x51e5d1[_0xc2f8('0x10')]+_0x51e5d1[_0xc2f8('0x11')]+_0x51e5d1[_0xc2f8('0x12')]+_0x51e5d1[_0xc2f8('0x13')]+_0x51e5d1[_0xc2f8('0x14')];this['countnosuchnumberretry']=_0x51e5d1['countnosuchnumberretry'];this['countdropretry']=_0x51e5d1['countdropretry'];this[_0xc2f8('0x12')]=_0x51e5d1[_0xc2f8('0x12')];this['countmachineretry']=_0x51e5d1[_0xc2f8('0x13')];this[_0xc2f8('0x14')]=_0x51e5d1[_0xc2f8('0x14')];this[_0xc2f8('0x15')]=_0x38ec9c[_0xc2f8('0x15')];this[_0xc2f8('0x16')]=_0x51e5d1[_0xc2f8('0x17')];this[_0xc2f8('0x18')]=_0x51e5d1['number'];this[_0xc2f8('0x19')]=_0x51e5d1['starttime'];this[_0xc2f8('0x1a')]=_0x51e5d1[_0xc2f8('0x1a')];this[_0xc2f8('0x1b')]=moment()[_0xc2f8('0x1c')](_0xc2f8('0x1d'));this['ringtime']=getSeconds(_0x51e5d1[_0xc2f8('0x1a')],_0x51e5d1[_0xc2f8('0x19')]);this[_0xc2f8('0x1e')]=0x0;this[_0xc2f8('0x1f')]=getSeconds(this[_0xc2f8('0x1b')],_0x51e5d1['responsetime']);this['queue']=_0x51e5d1['queue'];this[_0xc2f8('0x20')]='IVR';this[_0xc2f8('0x21')]=_0x38ec9c[_0xc2f8('0x22')];this[_0xc2f8('0x23')]=_0x51e5d1['callback'];this[_0xc2f8('0x24')]=_0x51e5d1[_0xc2f8('0x24')];this[_0xc2f8('0x25')]=_0x51e5d1[_0xc2f8('0x25')];this[_0xc2f8('0x26')]=_0x51e5d1[_0xc2f8('0x26')];this[_0xc2f8('0x27')]=_0x51e5d1[_0xc2f8('0x27')];this[_0xc2f8('0x28')]=_0x51e5d1[_0xc2f8('0x28')];this['UserId']=_0x51e5d1[_0xc2f8('0x29')];this[_0xc2f8('0x2a')]=_0x51e5d1[_0xc2f8('0x2a')];this[_0xc2f8('0x2b')]=_0x51e5d1[_0xc2f8('0x2b')];}module[_0xc2f8('0x2c')]=Hangup;
\ No newline at end of file
index e8fddaa..054776a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea54=['ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0xc0654c,_0x112308){var _0x4cc94b=function(_0x2f6df7){while(--_0x2f6df7){_0xc0654c['push'](_0xc0654c['shift']());}};_0x4cc94b(++_0x112308);}(_0xea54,0x142));var _0x4ea5=function(_0x4eb0f3,_0x406842){_0x4eb0f3=_0x4eb0f3-0x0;var _0x44ab8b=_0xea54[_0x4eb0f3];return _0x44ab8b;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4ea5('0x0'));function getSeconds(_0x4ff396,_0x578309){var _0x55bef0=moment(_0x4ff396)['milliseconds'](0x0);var _0x11285a=moment(_0x578309)['milliseconds'](0x0);return _0x55bef0[_0x4ea5('0x1')](_0x11285a,'seconds');}function History(_0x3f64b1){this[_0x4ea5('0x2')]=_0x3f64b1['uniqueid'];this[_0x4ea5('0x3')]=_0x3f64b1[_0x4ea5('0x3')]||undefined;this[_0x4ea5('0x4')]=_0x3f64b1['type'];this[_0x4ea5('0x5')]=_0x3f64b1[_0x4ea5('0x4')]===_0x4ea5('0x6')?_0x4ea5('0x7'):_0x3f64b1[_0x4ea5('0x4')];this['countbusyretry']=_0x3f64b1['countbusyretry'];this['countcongestionretry']=_0x3f64b1[_0x4ea5('0x8')];this[_0x4ea5('0x9')]=_0x3f64b1['countnoanswerretry'];this[_0x4ea5('0xa')]=_0x3f64b1[_0x4ea5('0xb')]+_0x3f64b1[_0x4ea5('0x8')]+_0x3f64b1[_0x4ea5('0x9')]+_0x3f64b1[_0x4ea5('0xc')]+_0x3f64b1[_0x4ea5('0xd')]+_0x3f64b1[_0x4ea5('0xe')]+_0x3f64b1[_0x4ea5('0xf')]+_0x3f64b1[_0x4ea5('0x10')];this[_0x4ea5('0xc')]=_0x3f64b1[_0x4ea5('0xc')];this[_0x4ea5('0xd')]=_0x3f64b1[_0x4ea5('0xd')];this[_0x4ea5('0xe')]=_0x3f64b1['countabandonedretry'];this[_0x4ea5('0xf')]=_0x3f64b1[_0x4ea5('0xf')];this['countagentrejectretry']=_0x3f64b1[_0x4ea5('0x10')];this[_0x4ea5('0x7')]=_0x3f64b1[_0x4ea5('0x7')];this[_0x4ea5('0x11')]=_0x3f64b1[_0x4ea5('0x12')];this['calleridnum']=_0x3f64b1[_0x4ea5('0x13')];this[_0x4ea5('0x14')]=_0x3f64b1[_0x4ea5('0x14')];this[_0x4ea5('0x15')]=_0x3f64b1[_0x4ea5('0x15')];this['endtime']=_0x3f64b1[_0x4ea5('0x15')];this['ringtime']=getSeconds(_0x3f64b1[_0x4ea5('0x15')],_0x3f64b1[_0x4ea5('0x14')]);this[_0x4ea5('0x16')]=0x0;this[_0x4ea5('0x17')]=0x0;this[_0x4ea5('0x18')]=_0x3f64b1[_0x4ea5('0x18')];this[_0x4ea5('0x19')]=_0x3f64b1['callbackuniqueid'];this[_0x4ea5('0x1a')]=_0x3f64b1[_0x4ea5('0x1a')];this[_0x4ea5('0x1b')]=_0x3f64b1[_0x4ea5('0x1b')];this[_0x4ea5('0x1c')]=_0x3f64b1[_0x4ea5('0x1c')];this['ListId']=_0x3f64b1['ListId'];this['UserId']=_0x3f64b1[_0x4ea5('0x1d')];this[_0x4ea5('0x1e')]=_0x3f64b1['VoiceQueueId'];this['CampaignId']=_0x3f64b1[_0x4ea5('0x1f')];this[_0x4ea5('0x20')]=_0x3f64b1[_0x4ea5('0x20')]||'';this[_0x4ea5('0x21')]=_0x3f64b1[_0x4ea5('0x21')]||'';}module[_0x4ea5('0x22')]=History;
\ No newline at end of file
+var _0xc2e8=['calleridnum','starttime','responsetime','talktime','callback','callbackuniqueid','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','uniqueid','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc2e8,0x70));var _0x8c2e=function(_0x5655ab,_0x4c3c6a){_0x5655ab=_0x5655ab-0x0;var _0x169dc7=_0xc2e8[_0x5655ab];return _0x169dc7;};'use strict';var util=require(_0x8c2e('0x0'));var _=require(_0x8c2e('0x1'));var moment=require('moment');function getSeconds(_0x539b74,_0xc6e001){var _0x4df201=moment(_0x539b74)[_0x8c2e('0x2')](0x0);var _0x3c074b=moment(_0xc6e001)[_0x8c2e('0x2')](0x0);return _0x4df201['diff'](_0x3c074b,_0x8c2e('0x3'));}function History(_0x24aa7b){this[_0x8c2e('0x4')]=_0x24aa7b['uniqueid'];this['scheduledat']=_0x24aa7b['scheduledat']||undefined;this['type']=_0x24aa7b['type'];this[_0x8c2e('0x5')]=_0x24aa7b[_0x8c2e('0x6')]===_0x8c2e('0x7')?_0x8c2e('0x8'):_0x24aa7b[_0x8c2e('0x6')];this[_0x8c2e('0x9')]=_0x24aa7b[_0x8c2e('0x9')];this[_0x8c2e('0xa')]=_0x24aa7b['countcongestionretry'];this[_0x8c2e('0xb')]=_0x24aa7b[_0x8c2e('0xb')];this[_0x8c2e('0xc')]=_0x24aa7b['countbusyretry']+_0x24aa7b['countcongestionretry']+_0x24aa7b['countnoanswerretry']+_0x24aa7b[_0x8c2e('0xd')]+_0x24aa7b[_0x8c2e('0xe')]+_0x24aa7b[_0x8c2e('0xf')]+_0x24aa7b[_0x8c2e('0x10')]+_0x24aa7b[_0x8c2e('0x11')];this[_0x8c2e('0xd')]=_0x24aa7b[_0x8c2e('0xd')];this['countdropretry']=_0x24aa7b['countdropretry'];this[_0x8c2e('0xf')]=_0x24aa7b[_0x8c2e('0xf')];this[_0x8c2e('0x10')]=_0x24aa7b[_0x8c2e('0x10')];this[_0x8c2e('0x11')]=_0x24aa7b[_0x8c2e('0x11')];this['queue']=_0x24aa7b[_0x8c2e('0x8')];this[_0x8c2e('0x12')]=_0x24aa7b[_0x8c2e('0x13')];this[_0x8c2e('0x14')]=_0x24aa7b['number'];this[_0x8c2e('0x15')]=_0x24aa7b[_0x8c2e('0x15')];this[_0x8c2e('0x16')]=_0x24aa7b['responsetime'];this['endtime']=_0x24aa7b[_0x8c2e('0x16')];this['ringtime']=getSeconds(_0x24aa7b[_0x8c2e('0x16')],_0x24aa7b[_0x8c2e('0x15')]);this['holdtime']=0x0;this[_0x8c2e('0x17')]=0x0;this[_0x8c2e('0x18')]=_0x24aa7b[_0x8c2e('0x18')];this[_0x8c2e('0x19')]=_0x24aa7b[_0x8c2e('0x19')];this['callbackat']=_0x24aa7b[_0x8c2e('0x1a')];this['recallme']=_0x24aa7b['recallme'];this[_0x8c2e('0x1b')]=_0x24aa7b[_0x8c2e('0x1b')];this['ListId']=_0x24aa7b['ListId'];this[_0x8c2e('0x1c')]=_0x24aa7b['UserId'];this[_0x8c2e('0x1d')]=_0x24aa7b[_0x8c2e('0x1d')];this[_0x8c2e('0x1e')]=_0x24aa7b['CampaignId'];this[_0x8c2e('0x1f')]=_0x24aa7b[_0x8c2e('0x1f')]||'';this[_0x8c2e('0x20')]=_0x24aa7b[_0x8c2e('0x20')]||'';}module['exports']=History;
\ No newline at end of file
index 05addf9..603767b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18a5=['[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','merge','pick','ContactId','ListId','UserId','CampaignId','[emptyContact]','isSuccess','Success','active','reachable','SIP/%s','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','outboundAnswerCallsDay','HangupInAMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','membername','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','AMD','[syncHangupInAMDIvr]','countcongestionretry','countagentrejectretry','dialMachineMaxRetry','add','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','syncQueueCallerAbandon','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','countglobal','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','idHopper','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','interval','content','true','command','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','dialMethod','progressive','handlePower','booked','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getVoiceQueueRtPauses','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','handleIvr','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','ACTIVE','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','util','lodash','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','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\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','prototype','clearZombieChannels','uniqueId','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','resolve','then','countReScheduled'];(function(_0x478946,_0x172058){var _0x110d96=function(_0x1b7a2e){while(--_0x1b7a2e){_0x478946['push'](_0x478946['shift']());}};_0x110d96(++_0x172058);}(_0x18a5,0x164));var _0x518a=function(_0x28e825,_0x2199ec){_0x28e825=_0x28e825-0x0;var _0x52d7cb=_0x18a5[_0x28e825];return _0x52d7cb;};'use strict';var util=require(_0x518a('0x0'));var _=require(_0x518a('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x518a('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x518a('0x3'));var ut=require(_0x518a('0x4'));var config=require(_0x518a('0x5'));var logger=require(_0x518a('0x6'))(_0x518a('0x7'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require('../../../config/logger')(_0x518a('0x8'));var loggerPredictiveCalls=require(_0x518a('0x6'))(_0x518a('0x9'));var loggerSyncQueueSummary=require(_0x518a('0x6'))(_0x518a('0xa'));var ami=require(_0x518a('0xb'));config[_0x518a('0xc')]=_[_0x518a('0xd')](config[_0x518a('0xc')],{'host':_0x518a('0xe'),'port':0x18eb});var io=require(_0x518a('0xf'))(new Redis(config[_0x518a('0xc')]));var cmHopper=require(_0x518a('0x10'));var cmHopperHistory=require(_0x518a('0x11'));var cmHopperBlack=require(_0x518a('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x518a('0x13'));var History=require('./history');var Final=require(_0x518a('0x14'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x518a('0x15'));var Hangup=require(_0x518a('0x16'));var ipAgi=process[_0x518a('0x17')][_0x518a('0x18')]||_0x518a('0x19');var strategy={'rrmemory':_0x518a('0x1a'),'roundrobin':_0x518a('0x1b')};var Sequence=function(){};Sequence['prototype'][_0x518a('0x1c')]=function(_0x7e2a04){this[_0x518a('0x1d')]=this['tail']?this[_0x518a('0x1d')][_0x518a('0x1e')](_0x7e2a04):_0x7e2a04();};function Dialer(_0x5c6bcc,_0x5c9421){this[_0x518a('0x1f')]=new Sequence();this['preview']=_0x5c9421;this[_0x518a('0x20')]=_0x5c6bcc[_0x518a('0x20')];this[_0x518a('0x21')]=_0x5c6bcc[_0x518a('0x21')];this[_0x518a('0x22')]=_0x5c6bcc[_0x518a('0x22')];this[_0x518a('0x23')]=_0x5c6bcc[_0x518a('0x23')];this[_0x518a('0x24')]=config[_0x518a('0x24')]||0x2;this[_0x518a('0x25')]={};this[_0x518a('0x26')]={};this[_0x518a('0x27')]={};this['uniqueId']={};this[_0x518a('0x28')]={};this['startPredictive']={};this[_0x518a('0x29')]={};this['ivrOriginated']={};this[_0x518a('0x2a')]={};this[_0x518a('0x2b')]={};ami['on'](_0x518a('0x2c'),this[_0x518a('0x2d')][_0x518a('0x2e')](this));ami['on'](_0x518a('0x2f'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x518a('0x30'),this[_0x518a('0x31')]['bind'](this));ami['on'](_0x518a('0x32'),this[_0x518a('0x33')][_0x518a('0x2e')](this));ami['on'](_0x518a('0x34'),this[_0x518a('0xa')][_0x518a('0x2e')](this));ami['on'](_0x518a('0x35'),this[_0x518a('0x36')][_0x518a('0x2e')](this));ami['on'](_0x518a('0x37'),this[_0x518a('0x38')][_0x518a('0x2e')](this));ami['on'](_0x518a('0x39'),this[_0x518a('0x3a')]['bind'](this));ami['on']('queuemember',this['syncQueueMember'][_0x518a('0x2e')](this));ami['on'](_0x518a('0x3b'),this[_0x518a('0x3c')]['bind'](this));this['loopCampaigns']();this[_0x518a('0x3d')]();}function isNotNull(_0x5ddae8){return _0x5ddae8!==null&&!_['isUndefined'](_0x5ddae8);}function checkIsLoggedIn(_0x249a5e,_0x45d5dd){return function(){if(_0x45d5dd<=0x0){_0x249a5e['message']='AGENTS_NOT_LOGGED';throw _0x249a5e[_0x518a('0x3e')]+_0x518a('0x3f');}};}function isActive(_0xcf49cf){return _0xcf49cf;}function checkIsActive(_0x1da4b1,_0x1bcc3e){return function(){if(!isActive(_0x1bcc3e)){_0x1da4b1[_0x518a('0x40')]=_0x518a('0x41');throw _0x1da4b1[_0x518a('0x3e')]+'\x20NOT\x20Active';}};}function checkInterval(_0x401283){return function(){if(!isNotNull(_0x401283[_0x518a('0x42')])){_0x401283['message']=_0x518a('0x43');throw _0x401283[_0x518a('0x3e')]+_0x518a('0x44');}if(!isNotNull(_0x401283[_0x518a('0x42')][_0x518a('0x45')])){_0x401283[_0x518a('0x40')]=_0x518a('0x43');throw _0x401283[_0x518a('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x518a('0x46')](_0x401283['Interval'][_0x518a('0x45')]))){_0x401283[_0x518a('0x40')]=_0x518a('0x43');throw _0x401283[_0x518a('0x3e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5bd848,_0x5da606,_0x5061f5){return{'action':_0x5bd848,'response':_0x5da606,'message':_0x5061f5,'stack':_0x5061f5};}function myreject(_0x537a38){return function(_0x26f06a){return _0x537a38(msgResponse(_0x518a('0x47'),_0x518a('0x48'),JSON[_0x518a('0x49')](_0x26f06a)));};}function getSeconds(_0xdb0bb5,_0x33243c){var _0x153bd6=moment(_0xdb0bb5)[_0x518a('0x4a')](0x0);var _0x11363c=moment(_0x33243c)[_0x518a('0x4a')](0x0);return _0x153bd6[_0x518a('0x4b')](_0x11363c,_0x518a('0x4c'));}function emit(_0x121dfe,_0x523a95,_0x208af1){io['to'](_0x121dfe)[_0x518a('0x4d')](_0x523a95,_0x208af1);}function emitVoiceQueueSummary(_0x22c361){if(_0x22c361[_0x518a('0x4e')]===_0x518a('0x4f')){var _0x1f5d4a={'id':_0x22c361['id'],'name':_0x22c361[_0x518a('0x3e')],'strategy':_0x22c361[_0x518a('0x50')],'answered':_0x22c361['answered'],'available':_0x22c361[_0x518a('0x51')],'loggedIn':_0x22c361[_0x518a('0x52')],'pTalking':_0x22c361[_0x518a('0x53')],'sumBillable':_0x22c361[_0x518a('0x54')],'sumDuration':_0x22c361[_0x518a('0x55')],'sumHoldTime':_0x22c361[_0x518a('0x56')]||0x0,'talking':_0x22c361[_0x518a('0x57')],'total':_0x22c361[_0x518a('0x58')],'type':_0x22c361[_0x518a('0x4e')],'unmanaged':_0x22c361[_0x518a('0x59')],'abandoned':_0x22c361[_0x518a('0x5a')],'waiting':_0x22c361['waiting'],'loggedInDb':_0x22c361[_0x518a('0x5b')],'dialActive':_0x22c361[_0x518a('0x5c')],'dialMethod':_0x22c361['dialMethod'],'dialOriginateCallerIdName':_0x22c361[_0x518a('0x5d')],'dialOriginateCallerIdNumber':_0x22c361[_0x518a('0x5e')],'dialOriginateTimeout':_0x22c361[_0x518a('0x5f')],'dialPrefix':_0x22c361['dialPrefix'],'outboundAnswerAgiCallsDay':_0x22c361[_0x518a('0x60')],'outboundAnswerCallsDay':_0x22c361['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x22c361[_0x518a('0x61')],'outboundBusyCallsDay':_0x22c361[_0x518a('0x62')],'outboundCongestionCallsDay':_0x22c361['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x22c361[_0x518a('0x63')],'outboundDropCallsDayCallersExit':_0x22c361['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x22c361['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x22c361[_0x518a('0x64')],'outboundNoSuchCallsDay':_0x22c361[_0x518a('0x65')],'outboundOriginateFailureCallsDay':_0x22c361[_0x518a('0x66')],'outboundReCallsDay':_0x22c361[_0x518a('0x67')],'outboundRejectCallsDay':_0x22c361[_0x518a('0x68')],'outboundUnknownCallsDay':_0x22c361['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x22c361[_0x518a('0x69')],'predictiveIntervalAvgHoldtime':_0x22c361['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x22c361['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x22c361[_0x518a('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x22c361[_0x518a('0x6b')],'predictiveIntervalErlangCalls':_0x22c361[_0x518a('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x22c361[_0x518a('0x6d')],'predictiveIntervalHitRate':_0x22c361[_0x518a('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x22c361[_0x518a('0x6f')],'predictiveIntervalPauses':_0x22c361['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x22c361[_0x518a('0x70')],'predictiveIntervalTotalCalls':_0x22c361[_0x518a('0x71')],'message':_0x22c361[_0x518a('0x40')],'originated':_0x22c361['originated'],'erlangCalls':_0x22c361[_0x518a('0x72')],'erlangCallToSecond':_0x22c361['erlangCallToSecond'],'erlangAbandonmentRate':_0x22c361[_0x518a('0x73')],'erlangBusyFactor':_0x22c361[_0x518a('0x74')],'startPredictive':_0x22c361[_0x518a('0x75')],'startProgressive':_0x22c361[_0x518a('0x29')]};if(_0x22c361[_0x518a('0x76')]){_0x1f5d4a['Trunk']={'id':_0x22c361[_0x518a('0x76')]['id'],'name':_0x22c361[_0x518a('0x76')]['name'],'active':_0x22c361[_0x518a('0x76')]['active'],'callerid':_0x22c361[_0x518a('0x76')]['callerid']};}if(_0x22c361['Interval']){_0x1f5d4a[_0x518a('0x42')]={'id':_0x22c361[_0x518a('0x42')]['id'],'name':_0x22c361[_0x518a('0x42')][_0x518a('0x3e')]};}var _0x38c0d0=md5(JSON[_0x518a('0x49')](_0x1f5d4a));if(_0x22c361['md5']!==_0x38c0d0){_0x22c361[_0x518a('0x77')]=_0x38c0d0;emit(util[_0x518a('0x78')](_0x518a('0x79'),_0x1f5d4a[_0x518a('0x3e')]),_0x518a('0x7a'),_0x1f5d4a);}}}function emitCampaignSummary(_0x1a4c00){if(_0x1a4c00['type']===_0x518a('0x7b')){emit(util[_0x518a('0x78')](_0x518a('0x7c'),_0x1a4c00[_0x518a('0x3e')]),'campaign:save',_0x1a4c00);}}function checkGetDataPredictive(_0x55dd86){if(isNotNull(_0x55dd86)&&!_[_0x518a('0x46')](_0x55dd86)){loggerPredictive[_0x518a('0x7d')](_0x518a('0x7e'));loggerPredictive['info'](_0x518a('0x7f'),_0x55dd86[_0x518a('0x71')]);loggerPredictive['info'](_0x518a('0x80'),_0x55dd86[_0x518a('0x69')]);loggerPredictive[_0x518a('0x7d')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x55dd86[_0x518a('0x6b')]);loggerPredictive[_0x518a('0x7d')](_0x518a('0x81'),_0x55dd86['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x518a('0x7d')](_0x518a('0x82'),_0x55dd86[_0x518a('0x83')]);loggerPredictive[_0x518a('0x7d')](_0x518a('0x84'),_0x55dd86[_0x518a('0x85')]);loggerPredictive[_0x518a('0x7d')]('---------------------------');if(_0x55dd86[_0x518a('0x71')]>0x0){if(!_[_0x518a('0x86')](_0x55dd86['predictiveIntervalAvgTalktime'])&&_0x55dd86['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x518a('0x86')](_0x55dd86['predictiveIntervalAvgHoldtime'])&&_0x55dd86[_0x518a('0x83')]>0x0){return!![];}loggerPredictive[_0x518a('0x7d')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x518a('0x7d')](_0x518a('0x87'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1e8185){return function(_0x5241c7){loggerPredictive[_0x518a('0x7d')](_0x518a('0x88'));loggerPredictive[_0x518a('0x7d')](_0x518a('0x89'),_0x5241c7['erlangCalls']);loggerPredictive[_0x518a('0x7d')](_0x518a('0x8a'),_0x5241c7[_0x518a('0x8b')]);loggerPredictive[_0x518a('0x7d')](_0x518a('0x8c'),_0x5241c7[_0x518a('0x73')]);loggerPredictive[_0x518a('0x7d')](_0x518a('0x8d'),_0x5241c7[_0x518a('0x74')]);loggerPredictive[_0x518a('0x7d')](_0x518a('0x8c'),_0x5241c7[_0x518a('0x73')]);loggerPredictive[_0x518a('0x7d')](_0x518a('0x8e'));_['merge'](_0x1e8185,_0x5241c7);};}function getDiff(_0x12ff81){var _0x2aa7c7=moment()[_0x518a('0x4a')](0x0);var _0x12efc6=moment(_0x12ff81)[_0x518a('0x4a')](0x0);return _0x2aa7c7[_0x518a('0x4b')](_0x12efc6,_0x518a('0x4c'));}function ifInterval(_0x895e75,_0x57ce74){if(_[_0x518a('0x86')](_0x57ce74)){return![];}return getDiff(_0x57ce74)<_0x895e75*0x3c;}function freeVariablesPredictive(_0x30ed8e){if(isNotNull(_0x30ed8e)){if(!_[_0x518a('0x86')](_0x30ed8e[_0x518a('0x29')])){_0x30ed8e[_0x518a('0x29')]=undefined;loggerPredictive[_0x518a('0x7d')](_0x30ed8e[_0x518a('0x3e')],_0x518a('0x8f'));}if(!_[_0x518a('0x86')](_0x30ed8e[_0x518a('0x75')])){_0x30ed8e[_0x518a('0x75')]=undefined;loggerPredictive[_0x518a('0x7d')](_0x30ed8e[_0x518a('0x3e')],_0x518a('0x90'));}if(!_[_0x518a('0x86')](_0x30ed8e['handlePredictive'])){clearInterval(_0x30ed8e[_0x518a('0x91')]);_0x30ed8e[_0x518a('0x91')]=undefined;loggerPredictive[_0x518a('0x7d')](_0x30ed8e[_0x518a('0x3e')],_0x518a('0x92'));}}}function erlangb(_0x7cbb43,_0x143737){if(_0x143737===0x0){return 0x0;}var _0x6a4a58=0x1;for(var _0x39813=0x1;_0x39813<=_0x143737;_0x39813+=0x1){_0x6a4a58=0x1+_0x6a4a58*_0x39813/_0x7cbb43;}return 0x1/_0x6a4a58;}function isVoiceQueueOutbound(_0xb2fe52){return _0xb2fe52===_0x518a('0x4f');}function isNotPreview(_0x5c2bcd){return _0x5c2bcd!==_0x518a('0x93');}function isCampaignIvr(_0x1bd576){return _0x1bd576==='ivr';}function getCallerId(_0x55ebca,_0x32b6f9,_0x14078f){if(!_[_0x518a('0x86')](_0x14078f)&&typeof _0x14078f===_0x518a('0x94')&&!_[_0x518a('0x46')](_0x14078f)){if(!_[_0x518a('0x86')](_0x32b6f9)&&typeof _0x32b6f9===_0x518a('0x94')&&!_['isEmpty'](_0x32b6f9)){return util[_0x518a('0x78')](_0x518a('0x95'),_0x32b6f9,_0x14078f);}return util[_0x518a('0x78')]('\x22%s\x22\x20<%s>',_0x14078f,_0x14078f);}if(!_['isUndefined'](_0x55ebca)&&typeof _0x55ebca===_0x518a('0x94')&&!_[_0x518a('0x46')](_0x55ebca)){return _0x55ebca;}return _0x518a('0x96');}function loggerCatchQueueSummary(_0x3d07b9,_0x2e0e23){return function(_0x4bfe94){freeVariablesPredictive(_0x2e0e23);emitVoiceQueueSummary(_0x2e0e23);emitCampaignSummary(_0x2e0e23);loggerSyncQueueSummary[_0x518a('0x97')](_0x3d07b9,util['inspect'](_0x4bfe94,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x525a2f,_0x508be1){return function(_0x1f9359){loggerPredictive['error'](_0x508be1['name'],_0x525a2f);loggerPredictive[_0x518a('0x97')](_0x1f9359[_0x518a('0x98')]);freeVariablesPredictive(_0x508be1);};}function loggerCatch(_0x3f3cae){return function(_0xe7909f){logger[_0x518a('0x97')](_0x3f3cae,util[_0x518a('0x99')](_0xe7909f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x23ccd3){return _0x23ccd3&&!_['isUndefined'](_0x23ccd3)&&_0x23ccd3['length']>0x0;}function decremetOriginate(_0x5f4ddb){if(!_['isUndefined'](_0x5f4ddb)&&_0x5f4ddb!==null){if(typeof _0x5f4ddb[_0x518a('0x9a')]!=='undefined'){if(_0x5f4ddb['originated']>0x0){_0x5f4ddb[_0x518a('0x9a')]-=0x1;}else{logger[_0x518a('0x97')](_0x518a('0x9b'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x4eca25,_0x4aabe4,_0x3d447e){if(_0x4aabe4>_0x3d447e){for(var _0x299a88=0x0;_0x299a88<_0x4aabe4-_0x3d447e;_0x299a88+=0x1){decremetOriginate(_0x4eca25);}}}function loggerGetContactDialer(_0xeed1c5,_0xc9e882,_0x3eec1f){return function(_0x4aab8c){checkContactLowerLimitOriginate(_0xc9e882,_0x3eec1f,0x0);logger['error'](_0xeed1c5,util[_0x518a('0x99')](_0x4aab8c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x41ce91){return function(_0x3e742d){if(isNotNull(_0x3e742d)&&isNotNull(_0x3e742d[0x0])){if(_0x3e742d[0x0][_0x518a('0x9c')]>0x0){_0x41ce91['message']=_0x518a('0x9d');logger[_0x518a('0x7d')](_0x518a('0x9e')+_0x41ce91['name'],_0x3e742d[0x0][_0x518a('0x9c')],_0x518a('0x9f'));}else{_0x41ce91[_0x518a('0x40')]=_0x518a('0xa0');logger['info'](_0x518a('0xa1')+_0x41ce91['name']);}}};}function notSendMessagesQueue(_0x153bdd){if(_0x153bdd[_0x518a('0xa2')]){freeVariablesPredictive(_0x153bdd);if(_0x153bdd[_0x518a('0x9a')]===0x0&&_0x153bdd[_0x518a('0x57')]===0x0&&_0x153bdd[_0x518a('0xa3')]===0x0&&(_0x153bdd['pTalking']||0x0)===0x0){_0x153bdd[_0x518a('0xa2')]=![];_0x153bdd['available']=0x0;_0x153bdd[_0x518a('0x40')]=_0x518a('0x41');loggerSyncQueueSummary[_0x518a('0x97')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x153bdd[_0x518a('0x3e')],_0x518a('0xa4'));}else{_0x153bdd[_0x518a('0x40')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x518a('0x97')](_0x518a('0xa5'),_0x153bdd[_0x518a('0x3e')],_0x518a('0xa6'));}emitVoiceQueueSummary(_0x153bdd);}}function notSendMessagesCampaign(_0x25c21b){if(_0x25c21b['sendMessageOneNotActive']){if(_0x25c21b[_0x518a('0x9a')]===0x0){_0x25c21b[_0x518a('0xa2')]=![];_0x25c21b[_0x518a('0x40')]=_0x518a('0x41');loggerSyncQueueSummary[_0x518a('0x97')](_0x518a('0xa7'),_0x25c21b[_0x518a('0x3e')],_0x518a('0xa4'));}else{_0x25c21b['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x518a('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x25c21b['name'],_0x518a('0xa6'));}emitCampaignSummary(_0x25c21b);}}function createObjHistory(_0x1b77b7,_0x26c384,_0x2b826d,_0x63d1e,_0x5563a5){_0x1b77b7[_0x518a('0x40')]=_0x2b826d;var _0x1a076f=new Action(_0x1b77b7,_0x26c384);var _0x155811=new History(_0x1a076f);_0x155811[_0x518a('0xa8')]=_0x63d1e;_0x155811[_0x518a('0xa9')]=_0x5563a5;_0x155811[_0x518a('0xaa')]=_0x1a076f[_0x518a('0xab')];return _0x155811;}Dialer[_0x518a('0xac')][_0x518a('0x3d')]=function(){var _0x59c55e=this;setInterval(function(){_0x59c55e[_0x518a('0xad')](_0x59c55e[_0x518a('0xae')],'[uniqueid]');_0x59c55e['clearZombieChannels'](_0x59c55e[_0x518a('0x26')],_0x518a('0xaf'));},0x32c8);};Dialer[_0x518a('0xac')]['clearZombieChannels']=function(_0x31a58d,_0x13655c){var _0x1c344a=this;for(var _0x4ba7f5 in _0x31a58d){if(typeof _0x31a58d[_0x4ba7f5]!=='undefined'){this['sequence']['enqueue'](function(){if(!_[_0x518a('0xb0')](_0x31a58d[_0x4ba7f5])){return ami[_0x518a('0xb1')]({'action':_0x518a('0xb2'),'channel':_0x31a58d[_0x4ba7f5][_0x518a('0xb3')]})[_0x518a('0xb4')](function(_0xd82399){if(_0xd82399[_0x518a('0x40')]===_0x518a('0xb5')){setTimeout(function(){if(_0x31a58d[_0x4ba7f5]&&_0x31a58d[_0x4ba7f5][_0x518a('0x4e')]!==_0x518a('0x7b')){_0x1c344a[_0x518a('0xb6')](_0x1c344a[_0x518a('0x20')][_0x31a58d[_0x4ba7f5][_0x518a('0xb7')]]);logger[_0x518a('0x97')](_0x518a('0xb8'),_0x13655c,_0x4ba7f5,_0x31a58d[_0x4ba7f5]['queue']);delete _0x31a58d[_0x4ba7f5];}if(_0x31a58d[_0x4ba7f5]&&_0x31a58d[_0x4ba7f5][_0x518a('0x4e')]==='ivr'){_0x1c344a[_0x518a('0xb6')](_0x1c344a[_0x518a('0x21')][_0x31a58d[_0x4ba7f5][_0x518a('0xb7')]]);logger[_0x518a('0x97')]('[Dialer][checkChannel][ivr]',_0x13655c,_0x4ba7f5,_0x31a58d[_0x4ba7f5][_0x518a('0xb7')]);delete _0x31a58d[_0x4ba7f5];}},0x2328);}});}});}}};Dialer[_0x518a('0xac')]['countReScheduled']=function(_0x405364){return BPromise[_0x518a('0xb9')]()[_0x518a('0xba')](cmHopper[_0x518a('0xbb')](_0x405364))['catch'](loggerCatch(_0x518a('0xbc')));};Dialer[_0x518a('0xac')][_0x518a('0xbd')]=function(_0x4ee722){return BPromise['resolve']()['then'](cmHopperBlack[_0x518a('0xbd')](_0x4ee722))[_0x518a('0xb4')](loggerCatch(_0x518a('0xbe')));};Dialer[_0x518a('0xac')][_0x518a('0xbf')]=function(_0x4219e4){return BPromise['resolve']()['then'](cmHopperBlack[_0x518a('0xbf')](_0x4219e4))[_0x518a('0xb4')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x518a('0xac')]['averageHandleTime']=function(_0x1164cc){return BPromise[_0x518a('0xb9')]()['then'](cmHopperHistory[_0x518a('0xc0')](_0x1164cc))[_0x518a('0xb4')](loggerCatch(_0x518a('0xc1')));};Dialer[_0x518a('0xac')]['rescheduleContact']=function(_0x100d82){return BPromise[_0x518a('0xb9')]()[_0x518a('0xba')](cmHopper[_0x518a('0xc2')](_0x100d82))['catch'](loggerCatch(_0x518a('0xc3')));};Dialer[_0x518a('0xac')][_0x518a('0xc4')]=function(_0x3e08ec,_0x36a22b,_0x5e091a){return BPromise['resolve']()[_0x518a('0xba')](cmHopper[_0x518a('0xc4')](_0x3e08ec,_0x36a22b,_0x5e091a))['catch'](loggerCatch(_0x518a('0xc5')));};Dialer[_0x518a('0xac')]['getContactDialer']=function(_0x37dea3,_0x8b6d77,_0x40ba47,_0x2a9b32,_0x5db650){return BPromise[_0x518a('0xb9')]()[_0x518a('0xba')](cmHopper[_0x518a('0xc6')](_0x37dea3,_0x8b6d77,_0x40ba47,_0x2a9b32))[_0x518a('0xb4')](function(_0x33faf1){_0x5db650[_0x518a('0xc7')]-=_0x40ba47;_0x5db650['temp']=_0x5db650['temp']>0x0?_0x5db650[_0x518a('0xc7')]:0x0;loggerCatch(_0x518a('0xc8'))(_0x33faf1);});};Dialer['prototype'][_0x518a('0xc9')]=function(_0x4ad1de,_0x3a6fe7,_0x139b38,_0x508ccb){return BPromise[_0x518a('0xb9')]()[_0x518a('0xba')](cmHopper[_0x518a('0xc9')](_0x4ad1de,_0x3a6fe7,_0x139b38))['catch'](function(_0x4aa50f){_0x508ccb[_0x518a('0xc7')]-=_0x3a6fe7;_0x508ccb['temp']=_0x508ccb['temp']>0x0?_0x508ccb[_0x518a('0xc7')]:0x0;loggerCatch(_0x518a('0xca'))(_0x4aa50f);});};Dialer[_0x518a('0xac')]['getVoiceQueueRtPauses']=function(_0x5c8aa9){return BPromise[_0x518a('0xb9')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x5c8aa9))[_0x518a('0xb4')](loggerCatch(_0x518a('0xcb')));};Dialer[_0x518a('0xac')][_0x518a('0xcc')]=function(_0x297c9b){return BPromise[_0x518a('0xb9')]()[_0x518a('0xba')](cmHopper[_0x518a('0xcc')](_0x297c9b))[_0x518a('0xb4')](loggerCatch(_0x518a('0xcd')));};Dialer[_0x518a('0xac')][_0x518a('0xce')]=function(_0x3e92dc){return BPromise['resolve']()[_0x518a('0xba')](cmHopperHistory[_0x518a('0xce')](_0x3e92dc))[_0x518a('0xb4')](loggerCatch(_0x518a('0xcf')));};Dialer[_0x518a('0xac')][_0x518a('0xb6')]=function(_0x587994){if(!_[_0x518a('0x86')](_0x587994)&&_0x587994!==null){if(typeof _0x587994[_0x518a('0x9a')]!==_0x518a('0xd0')){if(_0x587994[_0x518a('0x9a')]>0x0){_0x587994[_0x518a('0x9a')]-=0x1;}else{logger[_0x518a('0x97')](_0x518a('0xd1'));}}}else{logger[_0x518a('0x97')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x518a('0xac')][_0x518a('0xd2')]=function(_0x558022,_0x494cab){var _0x1a09b6=this;return function(_0x5e5da8){_0x1a09b6[_0x518a('0xb6')](_0x494cab);logger[_0x518a('0x97')](_0x558022,util['inspect'](_0x5e5da8,{'showHidden':![],'depth':null}));};};Dialer[_0x518a('0xac')][_0x518a('0xd3')]=function(_0x2f34ae,_0x1401b6,_0x3b9b2e){var _0x1f3023={'state':0x19,'statedesc':'notFound'};this[_0x518a('0xb6')](_0x1401b6);this[_0x518a('0xd4')](_[_0x518a('0xd5')](_0x1f3023,_[_0x518a('0xd6')](_0x3b9b2e,[_0x518a('0xd7'),_0x518a('0xd8'),_0x518a('0xd9'),'VoiceQueueId',_0x518a('0xda')])),'[emptyContact][createHistory]',_0x518a('0xdb'));logger[_0x518a('0x97')](_0x2f34ae);};Dialer[_0x518a('0xac')][_0x518a('0xdc')]=function(_0x3aa3b4){return _0x3aa3b4===_0x518a('0xdd');};Dialer['prototype']['isTrunkReachable']=function(_0x50a790){return!_[_0x518a('0x86')](_0x50a790)&&_0x50a790&&!_[_0x518a('0x86')](_0x50a790[_0x518a('0x3e')])&&!_[_0x518a('0x86')](_0x50a790[_0x518a('0xde')])&&_0x50a790['active']&&(this['trunks'][util[_0x518a('0x78')]('SIP/%s',_0x50a790['name'])][_0x518a('0xb2')]===_0x518a('0xdf')||this['trunks'][util[_0x518a('0x78')](_0x518a('0xe0'),_0x50a790[_0x518a('0x3e')])]['status']===_0x518a('0xe1'));};Dialer['prototype']['saveInDb']=function(_0x135511,_0xc1d843,_0x5b012b){this['createHistory'](_0x135511)[_0x518a('0xb4')](loggerCatch(_0xc1d843));this[_0x518a('0xcc')](_0x135511)[_0x518a('0xb4')](loggerCatch(_0x5b012b));};Dialer['prototype']['syncVarSet']=function(_0x388d32){var _0x48b0a4=this[_0x518a('0xae')][_0x388d32['uniqueid']];var _0x143393;if(!_['isNil'](_0x388d32)&&!_[_0x518a('0xb0')](_0x388d32[_0x518a('0xe2')])&&!_[_0x518a('0xb0')](_0x388d32['variable'][_0x518a('0xe3')])&&_0x388d32[_0x518a('0xe4')]===_0x518a('0xe5')&&_0x48b0a4){if(_0x48b0a4[_0x518a('0x4e')]!==_0x518a('0x7b')&&this[_0x518a('0x20')][_0x48b0a4[_0x518a('0xb7')]][_0x518a('0xe6')]&&_0x388d32[_0x518a('0xe7')]===_0x518a('0xe8')){delete this[_0x518a('0xae')][_0x388d32[_0x518a('0xe9')]];this[_0x518a('0xb6')](this['voiceQueues'][_0x48b0a4[_0x518a('0xb7')]]);this[_0x518a('0x20')][_0x48b0a4[_0x518a('0xb7')]][_0x518a('0xea')]+=0x1;this[_0x518a('0x20')][_0x48b0a4[_0x518a('0xb7')]][_0x518a('0x60')]+=0x1;_0x143393=new Hangup(_0x48b0a4,_0x388d32);_0x143393[_0x518a('0xa8')]=0x12;_0x143393[_0x518a('0xa9')]=_0x518a('0xeb');_0x143393['membername']='AMD';ami[_0x518a('0x4d')](_0x518a('0xec'),ut['buildObj'](_0x143393,_0x518a('0xed')));this[_0x518a('0xd4')](_0x143393,_0x518a('0xee'),_0x518a('0xef'));}if(_0x48b0a4[_0x518a('0x4e')]!==_0x518a('0x7b')&&this[_0x518a('0x20')][_0x48b0a4[_0x518a('0xb7')]][_0x518a('0xe6')]&&_0x388d32[_0x518a('0xe7')]===_0x518a('0xf0')){var _0xf6781=this;return new BPromise(function(_0x5a8b02,_0x296719){delete _0xf6781['uniqueId'][_0x388d32[_0x518a('0xe9')]];_0xf6781[_0x518a('0xb6')](_0xf6781[_0x518a('0x20')][_0x48b0a4['queue']]);_0xf6781[_0x518a('0x20')][_0x48b0a4[_0x518a('0xb7')]][_0x518a('0xea')]+=0x1;_0xf6781[_0x518a('0x20')][_0x48b0a4['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x538249=_0xf6781[_0x518a('0x20')][_0x48b0a4[_0x518a('0xb7')]];var _0x47b11e=new Hangup(_0x48b0a4,_0x388d32);_0x47b11e['state']=0x13;_0x47b11e['statedesc']=_0x518a('0xf1');_0x47b11e[_0x518a('0xf2')]='AMD';_0x47b11e[_0x518a('0xf3')]+=0x1;_0x47b11e['countglobal']+=0x1;_0x47b11e[_0x518a('0xed')]=!![];ami[_0x518a('0x4d')](_0x518a('0xec'),ut[_0x518a('0xf4')](_0x47b11e,_0x518a('0xed')));_0xf6781['createHistory'](_0x47b11e)[_0x518a('0xb4')](loggerCatch(_0x518a('0xf5')));if(_0x47b11e[_0x518a('0xf6')]+_0x47b11e['countcongestionretry']+_0x47b11e[_0x518a('0xf7')]+_0x47b11e[_0x518a('0xf8')]+_0x47b11e[_0x518a('0xf9')]+_0x47b11e[_0x518a('0xfa')]+_0x47b11e[_0x518a('0xf3')]+_0x47b11e['countagentrejectretry']>=_0x538249[_0x518a('0xfb')]){_0xf6781[_0x518a('0xfc')](_0x47b11e,_0x5a8b02,_0x296719,_0x518a('0xfd'));}else{if(_0x47b11e[_0x518a('0xf3')]>=_0x538249['dialMachineMaxRetry']){_0xf6781[_0x518a('0xfe')](_0x47b11e,_0x5a8b02,_0x296719,_0x518a('0xff'));}else{_0xf6781[_0x518a('0xc2')]({'active':![],'countmachineretry':_0x47b11e[_0x518a('0xf3')],'scheduledat':moment()['add'](_0x538249[_0x518a('0x100')],_0x518a('0x101'))[_0x518a('0x78')](_0x518a('0x102')),'ContactId':_0x47b11e[_0x518a('0xd7')],'ListId':_0x47b11e['ListId'],'VoiceQueueId':_0x47b11e[_0x518a('0x103')]||undefined,'CampaignId':_0x47b11e[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x104')));_0x5a8b02({'reschedule':0x1});}}});}if(_0x48b0a4[_0x518a('0x4e')]==='ivr'&&this[_0x518a('0x21')][_0x48b0a4[_0x518a('0xb7')]][_0x518a('0xe6')]&&_0x388d32[_0x518a('0xe7')]==='HANGUP'){delete this[_0x518a('0xae')][_0x388d32[_0x518a('0xe9')]];this[_0x518a('0xb6')](this[_0x518a('0x21')][_0x48b0a4[_0x518a('0xb7')]]);_0x143393=new Hangup(_0x48b0a4,_0x388d32);_0x143393[_0x518a('0xa8')]=0x12;_0x143393['statedesc']=_0x518a('0xeb');_0x143393[_0x518a('0xf2')]=_0x518a('0x105');ami['emit'](_0x518a('0xec'),ut[_0x518a('0xf4')](_0x143393,_0x518a('0xed')));this[_0x518a('0xd4')](_0x143393,'[syncHangupInAMDIvr][createHistory]',_0x518a('0x106'));}if(_0x48b0a4[_0x518a('0x4e')]===_0x518a('0x7b')&&this[_0x518a('0x21')][_0x48b0a4[_0x518a('0xb7')]][_0x518a('0xe6')]&&_0x388d32[_0x518a('0xe7')]===_0x518a('0xf0')){var _0xf6781=this;return new BPromise(function(_0x585ee9,_0x270073){delete _0xf6781[_0x518a('0xae')][_0x388d32[_0x518a('0xe9')]];_0xf6781['updateOriginated'](_0xf6781[_0x518a('0x21')][_0x48b0a4[_0x518a('0xb7')]]);_0xf6781['campaigns'][_0x48b0a4[_0x518a('0xb7')]][_0x518a('0xea')]+=0x1;_0xf6781[_0x518a('0x21')][_0x48b0a4[_0x518a('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x15abf1=_0xf6781[_0x518a('0x21')][_0x48b0a4[_0x518a('0xb7')]];var _0x5bb1ee=new Hangup(_0x48b0a4,_0x388d32);_0x5bb1ee[_0x518a('0xa8')]=0x13;_0x5bb1ee[_0x518a('0xa9')]=_0x518a('0xf1');_0x5bb1ee[_0x518a('0xf2')]='AMD';_0x5bb1ee['countmachineretry']+=0x1;_0x5bb1ee['countglobal']+=0x1;_0x5bb1ee['amd']=!![];ami[_0x518a('0x4d')]('custom:amd',ut[_0x518a('0xf4')](_0x5bb1ee,_0x518a('0xed')));_0xf6781[_0x518a('0xce')](_0x5bb1ee)[_0x518a('0xb4')](loggerCatch(_0x518a('0xf5')));if(_0x5bb1ee[_0x518a('0xf6')]+_0x5bb1ee[_0x518a('0x107')]+_0x5bb1ee[_0x518a('0xf7')]+_0x5bb1ee['countnosuchnumberretry']+_0x5bb1ee[_0x518a('0xf9')]+_0x5bb1ee[_0x518a('0xfa')]+_0x5bb1ee[_0x518a('0xf3')]+_0x5bb1ee[_0x518a('0x108')]>=_0x15abf1['dialGlobalMaxRetry']){_0xf6781[_0x518a('0xfc')](_0x5bb1ee,_0x585ee9,_0x270073,_0x518a('0xfd'));}else{if(_0x5bb1ee[_0x518a('0xf3')]>=_0x15abf1[_0x518a('0x109')]){_0xf6781['createStateFinal'](_0x5bb1ee,_0x585ee9,_0x270073,_0x518a('0xff'));}else{_0xf6781[_0x518a('0xc2')]({'active':![],'countmachineretry':_0x5bb1ee['countmachineretry'],'scheduledat':moment()[_0x518a('0x10a')](_0x15abf1[_0x518a('0x100')],_0x518a('0x101'))[_0x518a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5bb1ee[_0x518a('0xd7')],'ListId':_0x5bb1ee[_0x518a('0xd8')],'VoiceQueueId':_0x5bb1ee['VoiceQueueId']||undefined,'CampaignId':_0x5bb1ee[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x104')));_0x585ee9({'reschedule':0x1});}}});}}};Dialer[_0x518a('0xac')][_0x518a('0x36')]=function(_0x10b8f8){var _0x1b3820=this[_0x518a('0xae')][_0x10b8f8[_0x518a('0xe9')]];var _0x35e512=this;var _0x3736b1;if(_0x1b3820&&_0x1b3820[_0x518a('0x4e')]===_0x518a('0x7b')){delete this[_0x518a('0xae')][_0x10b8f8['uniqueid']];this['updateOriginated'](this[_0x518a('0x21')][_0x1b3820[_0x518a('0xb7')]]);this[_0x518a('0x21')][_0x1b3820['queue']]['ivrAnswerCallsDay']+=0x1;_0x3736b1=new Hangup(_0x1b3820,_0x10b8f8);this['createHistory'](_0x3736b1)[_0x518a('0xb4')](loggerCatch(_0x518a('0x10b')));this[_0x518a('0xcc')](_0x3736b1)[_0x518a('0xb4')](loggerCatch(_0x518a('0x10c')));}if(_0x1b3820&&_0x1b3820[_0x518a('0x4e')]!=='ivr'&&isNotNull(this[_0x518a('0x20')][_0x1b3820[_0x518a('0xb7')]][_0x518a('0x10d')])){delete this[_0x518a('0xae')][_0x10b8f8[_0x518a('0xe9')]];this['updateOriginated'](this[_0x518a('0x20')][_0x1b3820['queue']]);this[_0x518a('0x20')][_0x1b3820[_0x518a('0xb7')]][_0x518a('0xea')]+=0x1;this[_0x518a('0x20')][_0x1b3820[_0x518a('0xb7')]][_0x518a('0x60')]+=0x1;_0x3736b1=new Hangup(_0x1b3820,_0x10b8f8);_0x3736b1[_0x518a('0xa8')]=0x10;_0x3736b1['statedesc']=_0x518a('0x10e');_0x3736b1[_0x518a('0xf2')]=_0x518a('0x10f');this['createHistory'](_0x3736b1)[_0x518a('0xb4')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x518a('0xcc')](_0x3736b1)[_0x518a('0xb4')](loggerCatch(_0x518a('0x10c')));}if(_0x1b3820&&_0x1b3820['type']!==_0x518a('0x7b')&&!isNotNull(this[_0x518a('0x20')][_0x1b3820[_0x518a('0xb7')]]['dialQueueProject'])){delete this['uniqueId'][_0x10b8f8['uniqueid']];this[_0x518a('0xb6')](this[_0x518a('0x20')][_0x1b3820['queue']]);this[_0x518a('0x20')][_0x1b3820['queue']][_0x518a('0x110')]+=0x1;_0x3736b1=new Hangup(_0x1b3820,_0x10b8f8);_0x3736b1[_0x518a('0xa8')]=0xc;_0x3736b1['statedesc']=_0x10b8f8[_0x518a('0x111')];_0x3736b1[_0x518a('0xf2')]=_0x518a('0x112');this[_0x518a('0xce')](_0x3736b1)[_0x518a('0xb4')](loggerCatch(_0x518a('0x10b')));this['moveContactManagedDialer'](_0x3736b1)['catch'](loggerCatch(_0x518a('0x10c')));}};Dialer['prototype']['syncAgentComplete']=function(_0x384a6c){var _0x372eb9=this[_0x518a('0xae')][_0x384a6c[_0x518a('0xe9')]];var _0x5a0964=this;if(this[_0x518a('0x20')][_0x384a6c[_0x518a('0xb7')]]){if(_0x372eb9&&_0x372eb9[_0x518a('0x4e')]!==_0x518a('0x7b')){delete this['uniqueId'][_0x384a6c[_0x518a('0xe9')]];this[_0x518a('0x20')][_0x384a6c[_0x518a('0xb7')]][_0x518a('0xea')]+=0x1;var _0x3b3bca=new AgentComplete(_0x372eb9,_0x384a6c);if(_0x384a6c[_0x518a('0x113')]===_0x518a('0x114')){_0x3b3bca[_0x518a('0x115')]=this[_0x518a('0x20')][_0x384a6c[_0x518a('0xb7')]][_0x518a('0x116')]&&this[_0x518a('0x20')][_0x384a6c[_0x518a('0xb7')]]['dialAgiAfterHangupAgent']?moment()[_0x518a('0x78')](_0x518a('0x102')):undefined;}this[_0x518a('0xce')](_0x3b3bca)['catch'](loggerCatch(_0x518a('0x117')));this['moveContactManagedDialer'](_0x3b3bca)[_0x518a('0xb4')](loggerCatch(_0x518a('0x118')));}}};Dialer[_0x518a('0xac')][_0x518a('0x2d')]=function(_0x3d5f0c){if(this[_0x518a('0x20')][_0x3d5f0c['queue']]){if(this['uniqueId'][_0x3d5f0c[_0x518a('0xe9')]]&&this[_0x518a('0xae')][_0x3d5f0c[_0x518a('0xe9')]]['type']!==_0x518a('0x7b')){this[_0x518a('0xb6')](this[_0x518a('0x20')][_0x3d5f0c[_0x518a('0xb7')]]);this[_0x518a('0xae')][_0x3d5f0c['uniqueid']][_0x518a('0x119')]=moment()[_0x518a('0x78')](_0x518a('0x102'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x19d42a){this['createHistory'](_0x19d42a)['catch'](loggerCatch(_0x518a('0x117')));this['moveContactManagedDialer'](_0x19d42a)[_0x518a('0xb4')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x518a('0x11a')]=function(_0x3d9d21){var _0x22261c=this[_0x518a('0xae')][_0x3d9d21['uniqueid']];var _0x4a288e=this;if(this[_0x518a('0x20')][_0x3d9d21['queue']]){if(_0x22261c&&_0x22261c['type']!=='ivr'){delete this['uniqueId'][_0x3d9d21['uniqueid']];this[_0x518a('0xb6')](this[_0x518a('0x20')][_0x3d9d21[_0x518a('0xb7')]]);_0x22261c['droptime']=moment()[_0x518a('0x78')](_0x518a('0x102'));var _0x4a2145=new QueueCallerAbandon(_0x22261c,_0x3d9d21);if(getSeconds(_0x22261c['droptime'],_0x22261c[_0x518a('0x11b')])>=_0x22261c[_0x518a('0x11c')]){this[_0x518a('0x20')][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x6b')]+=0x1;this[_0x518a('0x20')][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x11d')]+=0x1;this[_0x518a('0x20')][_0x3d9d21['queue']][_0x518a('0x6d')]+=0x1;_0x4a2145[_0x518a('0xa8')]=0xa;_0x4a2145[_0x518a('0xa9')]=_0x518a('0x11e');_0x4a2145[_0x518a('0x11f')]='TIMEOUT';_0x4a2145[_0x518a('0x115')]=this[_0x518a('0x20')][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x116')]?moment()[_0x518a('0x78')](_0x518a('0x102')):undefined;_0x4a2145[_0x518a('0xf9')]+=0x1;_0x4a2145[_0x518a('0x120')]+=0x1;if(_0x4a2145['countdropretry']>=this['voiceQueues'][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x121')]){this[_0x518a('0x122')](_0x4a2145);}else{this[_0x518a('0xc2')]({'active':![],'countdropretry':_0x4a2145[_0x518a('0xf9')],'scheduledat':moment()['add'](this[_0x518a('0x20')][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x123')],_0x518a('0x101'))['format'](_0x518a('0x102')),'ContactId':_0x22261c[_0x518a('0xd7')],'ListId':_0x22261c[_0x518a('0xd8')],'VoiceQueueId':_0x22261c['VoiceQueueId']||undefined,'CampaignId':_0x22261c[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch('[rescheduleContact][Drop]'));var _0x29c726=new History(_0x4a2145);_0x29c726['state']=0xa;_0x29c726[_0x518a('0xa9')]=_0x518a('0x11e');_0x29c726[_0x518a('0xab')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x29c726[_0x518a('0xaa')]=_0x29c726[_0x518a('0xab')];_0x29c726[_0x518a('0x124')]=_0x4a2145[_0x518a('0x124')];_0x29c726[_0x518a('0x125')]=_0x4a2145[_0x518a('0x125')];this[_0x518a('0xce')](_0x29c726)[_0x518a('0xb4')](loggerCatch(_0x518a('0x126')));}}else{this['voiceQueues'][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x6a')]+=0x1;this[_0x518a('0x20')][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x127')]+=0x1;_0x4a2145[_0x518a('0xa8')]=0xb;_0x4a2145[_0x518a('0xa9')]='Abandoned';_0x4a2145['dropreason']='CALLEREXIT';_0x4a2145['countabandonedretry']+=0x1;_0x4a2145['countglobal']+=0x1;if(_0x4a2145[_0x518a('0xfa')]>=this['voiceQueues'][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x128')]){this['queueCallerAbandonCreateState'](_0x4a2145);}else{this[_0x518a('0xc2')]({'active':![],'countabandonedretry':_0x4a2145[_0x518a('0xfa')],'scheduledat':moment()['add'](this[_0x518a('0x20')][_0x3d9d21[_0x518a('0xb7')]][_0x518a('0x129')],_0x518a('0x101'))['format'](_0x518a('0x102')),'ContactId':_0x22261c[_0x518a('0xd7')],'ListId':_0x22261c[_0x518a('0xd8')],'VoiceQueueId':_0x22261c[_0x518a('0x103')]||undefined,'CampaignId':_0x22261c[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x12a')));var _0x29c726=new History(_0x4a2145);_0x29c726[_0x518a('0xa8')]=0xb;_0x29c726[_0x518a('0xa9')]=_0x518a('0x12b');_0x29c726[_0x518a('0xab')]=moment()[_0x518a('0x78')](_0x518a('0x102'));_0x29c726[_0x518a('0xaa')]=_0x29c726[_0x518a('0xab')];_0x29c726['calleridname']=_0x4a2145[_0x518a('0x124')];_0x29c726[_0x518a('0x125')]=_0x4a2145[_0x518a('0x125')];this[_0x518a('0xce')](_0x29c726)[_0x518a('0xb4')](loggerCatch(_0x518a('0x12c')));}}}}};Dialer['prototype'][_0x518a('0x38')]=function(_0x292606){if(this['actions'][_0x292606['uniqueid']]){this[_0x518a('0x26')][_0x292606[_0x518a('0xe9')]][_0x518a('0xb3')]=_0x292606[_0x518a('0xb3')];}if(this['uniqueId'][_0x292606[_0x518a('0xe9')]]){this[_0x518a('0xae')][_0x292606[_0x518a('0xe9')]]['channel']=_0x292606[_0x518a('0xb3')];}};Dialer['prototype'][_0x518a('0x12d')]=function(_0x246a4a){if(strategy[this[_0x518a('0x20')][this[_0x518a('0x26')][_0x246a4a[_0x518a('0x12e')]][_0x518a('0xb7')]]['strategy']]==='roundrobin'){if(this['actions'][_0x246a4a[_0x518a('0x12e')]]&&_[_0x518a('0xb0')](this[_0x518a('0x26')][_0x246a4a['actionid']][_0x518a('0x12f')])&&_0x246a4a[_0x518a('0xb2')]==='1'&&_0x246a4a[_0x518a('0x130')]==='0'){if(this[_0x518a('0x22')][_0x246a4a[_0x518a('0x131')]]){if(!this[_0x518a('0x22')][_0x246a4a[_0x518a('0x131')]][_0x518a('0x12f')]){this[_0x518a('0x22')][_0x246a4a[_0x518a('0x131')]][_0x518a('0x12f')]=!![];this['actions'][_0x246a4a['actionid']][_0x518a('0x12f')]=!![];this['actions'][_0x246a4a[_0x518a('0x12e')]][_0x518a('0x131')]=_0x246a4a[_0x518a('0x131')];}}}}else if((strategy[this[_0x518a('0x20')][this[_0x518a('0x26')][_0x246a4a[_0x518a('0x12e')]][_0x518a('0xb7')]][_0x518a('0x50')]]||_0x518a('0x1a'))===_0x518a('0x1a')){if(this['actions'][_0x246a4a[_0x518a('0x12e')]]){if(this[_0x518a('0x22')][_0x246a4a[_0x518a('0x131')]]){this['actions'][_0x246a4a[_0x518a('0x12e')]]['stateinterface']=_0x246a4a[_0x518a('0x131')];if(_['isNil'](this[_0x518a('0x2a')][this['actions'][_0x246a4a[_0x518a('0x12e')]]['queue']])){this[_0x518a('0x2a')][this[_0x518a('0x26')][_0x246a4a[_0x518a('0x12e')]][_0x518a('0xb7')]]=[];}this['queueBooked'][this['actions'][_0x246a4a['actionid']]['queue']][_0x518a('0x132')](_[_0x518a('0xd5')](_[_0x518a('0xd6')](this[_0x518a('0x26')][_0x246a4a[_0x518a('0x12e')]],['idHopper',_0x518a('0x131')]),{'status':_0x246a4a[_0x518a('0xb2')],'paused':_0x246a4a['paused']}));}}}};function unlockQueueStatus(_0x5e9430,_0x34479a){setTimeout(function(){if(_['isUndefined'](_0x5e9430[_0x518a('0x133')])){loggerBooked['error'](_0x518a('0x134'),_0x34479a);}_0x5e9430[_0x518a('0x133')]=!![];loggerBooked[_0x518a('0x7d')]('[booked][unlockQueueStatus]',_0x34479a,JSON[_0x518a('0x49')](_[_0x518a('0xd6')](_0x5e9430,[_0x518a('0x3e'),_0x518a('0x133')])));},0x1f3);}Dialer[_0x518a('0xac')][_0x518a('0x3c')]=function(_0x2a71f6){var _0x48749e=this;var _0x2af1d8=_0x48749e['voiceQueues'][_0x48749e[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]];if(strategy[this['voiceQueues'][this['actions'][_0x2a71f6[_0x518a('0x12e')]]['queue']]['strategy']]===_0x518a('0x1b')){if(this['actions'][_0x2a71f6[_0x518a('0x12e')]]&&this['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0x131')]){this['preview']['run'](this['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0x135')],this['actions'][_0x2a71f6[_0x518a('0x12e')]]['stateinterface'])[_0x518a('0xb4')](function(_0x267ccd){logger[_0x518a('0x97')](_0x518a('0x136'),util['inspect'](_0x267ccd,{'showHidden':![],'depth':null}));})[_0x518a('0x1e')](function(){_0x48749e[_0x518a('0xb6')](_0x48749e[_0x518a('0x20')][_0x48749e[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]);_0x48749e[_0x518a('0x22')][_0x48749e[_0x518a('0x26')][_0x2a71f6['actionid']][_0x518a('0x131')]][_0x518a('0x12f')]=![];delete _0x48749e[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]];unlockQueueStatus(_0x2af1d8);});}else{this[_0x518a('0xb6')](this[_0x518a('0x20')][this['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xd7')],'ListId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xd8')],'VoiceQueueId':this[_0x518a('0x26')][_0x2a71f6['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x2a71f6['actionid']];unlockQueueStatus(_0x2af1d8);}}else if((strategy[this[_0x518a('0x20')][this['actions'][_0x2a71f6['actionid']][_0x518a('0xb7')]][_0x518a('0x50')]]||_0x518a('0x1a'))===_0x518a('0x1a')){var _0x1974cf;if(this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]]&&!_['isEmpty'](this[_0x518a('0x2a')][this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]])){if(this['queueBookedRR'][_0x48749e[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]]['queue']]){this[_0x518a('0x2b')][_0x48749e['actions'][_0x2a71f6['actionid']][_0x518a('0xb7')]]=this[_0x518a('0x2b')][this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]]['queue']]?this[_0x518a('0x2b')][this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]]['queue']]:this[_0x518a('0x2a')][this['actions'][_0x2a71f6['actionid']][_0x518a('0xb7')]]?this[_0x518a('0x2a')][this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]][_0x518a('0x137')]||0x0:0x0;}this[_0x518a('0x2a')][this['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]][_0x518a('0x137')]=this[_0x518a('0x2b')][this[_0x518a('0x26')][_0x2a71f6['actionid']][_0x518a('0xb7')]];for(var _0x28eed7=0x0;_0x28eed7<this[_0x518a('0x2a')][this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]['length'];_0x28eed7+=0x1){_0x1974cf=rr(this['queueBooked'][this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]);this['queueBookedRR'][_0x48749e['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]=this[_0x518a('0x2a')][this['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]][_0x518a('0x137')];if(_0x1974cf[_0x518a('0xb2')]==='1'&&_0x1974cf[_0x518a('0x130')]==='0'){break;}}if(!_[_0x518a('0xb0')](_0x1974cf)){this[_0x518a('0x22')][_0x1974cf[_0x518a('0x131')]]['unlockRR']=_[_0x518a('0x86')](this['agents'][_0x1974cf[_0x518a('0x131')]]['unlockRR'])?!![]:this['agents'][_0x1974cf[_0x518a('0x131')]][_0x518a('0x138')];}loggerBooked[_0x518a('0x7d')](_0x518a('0x139'),_0x2a71f6['actionid'],_0x518a('0x13a'),JSON[_0x518a('0x49')](_['pick'](this[_0x518a('0x22')][_0x1974cf[_0x518a('0x131')]],[_0x518a('0x3e'),_0x518a('0x138')])),_0x518a('0x13b'),JSON[_0x518a('0x49')](_0x1974cf[_0x518a('0x135')]));if(!_[_0x518a('0xb0')](_0x1974cf)&&_0x1974cf['status']==='1'&&_0x1974cf[_0x518a('0x130')]==='0'&&this[_0x518a('0x22')][_0x1974cf[_0x518a('0x131')]]['unlockRR']){this['agents'][_0x1974cf[_0x518a('0x131')]]['unlockRR']=![];this[_0x518a('0x2a')][_0x48749e[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]=[];this['preview'][_0x518a('0x13c')](_0x1974cf[_0x518a('0x135')],_0x1974cf[_0x518a('0x131')])[_0x518a('0xb4')](function(_0x3662d0){logger[_0x518a('0x97')](_0x518a('0x136'),util[_0x518a('0x99')](_0x3662d0,{'showHidden':![],'depth':null}));})['finally'](function(){_0x48749e[_0x518a('0xb6')](_0x48749e[_0x518a('0x20')][_0x48749e['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]);setTimeout(function(){_0x48749e['agents'][_0x1974cf[_0x518a('0x131')]][_0x518a('0x138')]=!![];loggerBooked['info']('[booked][RR][finaly]',_0x2a71f6[_0x518a('0x12e')],'Agent:\x20',JSON['stringify'](_[_0x518a('0xd6')](_0x48749e[_0x518a('0x22')][_0x1974cf[_0x518a('0x131')]],[_0x518a('0x3e'),_0x518a('0x138')])),_0x518a('0x13b'),JSON[_0x518a('0x49')](_0x1974cf[_0x518a('0x135')]));},0xc7);delete _0x48749e[_0x518a('0x26')][_0x2a71f6['actionid']];unlockQueueStatus(_0x2af1d8,_0x2a71f6[_0x518a('0x12e')]);});}else{loggerBooked[_0x518a('0x7d')](_0x518a('0x13d'));this[_0x518a('0xb6')](this[_0x518a('0x20')][this[_0x518a('0x26')][_0x2a71f6['actionid']][_0x518a('0xb7')]]);this[_0x518a('0xc2')]({'active':![],'ContactId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xd7')],'ListId':this['actions'][_0x2a71f6['actionid']][_0x518a('0xd8')],'VoiceQueueId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x518a('0x26')][_0x2a71f6['actionid']][_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x13e')));delete this['actions'][_0x2a71f6[_0x518a('0x12e')]];unlockQueueStatus(_0x2af1d8);}}else{loggerBooked['info'](_0x518a('0x13f'));this[_0x518a('0xb6')](this[_0x518a('0x20')][this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xd7')],'ListId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xd8')],'VoiceQueueId':this[_0x518a('0x26')][_0x2a71f6['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xda')]||undefined})['catch'](loggerCatch(_0x518a('0x140')));delete this[_0x518a('0x26')][_0x2a71f6['actionid']];unlockQueueStatus(_0x2af1d8);}}else{loggerBooked[_0x518a('0x7d')](_0x518a('0x141'));this[_0x518a('0xb6')](this['voiceQueues'][this['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xb7')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xd7')],'ListId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xd8')],'VoiceQueueId':this['actions'][_0x2a71f6[_0x518a('0x12e')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x518a('0x26')][_0x2a71f6[_0x518a('0x12e')]][_0x518a('0xda')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this['actions'][_0x2a71f6[_0x518a('0x12e')]];unlockQueueStatus(_0x2af1d8);}};Dialer[_0x518a('0xac')]['loopCampaigns']=function(){var _0x4f0d4f=this;setInterval(function(){_0x4f0d4f['syncCampaigns']();},0x3e8);};Dialer[_0x518a('0xac')][_0x518a('0x142')]=function(_0x3e993b){var _0x2fc016=this;return function(){if(!_0x2fc016['isTrunkReachable'](_0x3e993b[_0x518a('0x76')])){if(!_0x2fc016[_0x518a('0x143')](_0x3e993b[_0x518a('0x144')])){_0x3e993b['message']=_0x518a('0x145');throw _0x3e993b[_0x518a('0x3e')]+_0x518a('0x146');}}};};Dialer[_0x518a('0xac')][_0x518a('0x147')]=function(_0x26c8fa,_0x56c8d7,_0x5490e6,_0x2adb92){var _0x1082de=this;return function(){var _0x59d35e=!![];return _0x1082de[_0x518a('0x148')](_0x26c8fa,_0x56c8d7,_0x5490e6,_0x2adb92,_0x59d35e);};};Dialer[_0x518a('0xac')][_0x518a('0x149')]=function(_0x384e47,_0x1ebb79,_0x364a52,_0x179443){var _0x140fce=this;return function(){var _0x32e677=![];return _0x140fce[_0x518a('0x148')](_0x384e47[_0x518a('0x45')],_0x1ebb79,_0x364a52,_0x179443,_0x32e677);};};Dialer[_0x518a('0xac')][_0x518a('0x148')]=function(_0x5e7236,_0x180ce5,_0x3e5d9,_0x2a8e66,_0x39b7be){var _0x3372e5=[];return new BPromise(function(_0x38238a,_0x1e1507){if(!isNotNull(_0x5e7236)){_0x2a8e66[_0x518a('0x40')]=_0x518a('0x43');return _0x1e1507(msgResponse(_0x518a('0x148'),_0x518a('0x14a'),_0x3e5d9+_0x518a('0x14b')));}if(_['isEmpty'](_0x5e7236)){_0x2a8e66[_0x518a('0x40')]=_0x518a('0x14c');return _0x1e1507(msgResponse(_0x518a('0x148'),'Failure',_0x3e5d9+_0x518a('0x14d')));}if(_0x180ce5&&_[_0x518a('0x86')](config[_0x518a('0x14e')][_0x180ce5])){_0x2a8e66[_0x518a('0x40')]=_0x518a('0x14f');return _0x1e1507(msgResponse(_0x518a('0x148'),'Failure',_0x3e5d9+_0x518a('0x150')+_0x180ce5));}if(_[_0x518a('0x151')](_0x5e7236)){for(var _0x489729=0x0;_0x489729<_0x5e7236[_0x518a('0x152')];_0x489729+=0x1){_0x3372e5[_0x518a('0x132')](ami[_0x518a('0xb1')]({'action':'command','command':util[_0x518a('0x78')]('iftime\x20%s,%s',_0x5e7236[_0x489729][_0x518a('0x153')],!_[_0x518a('0x86')](config[_0x518a('0x14e')][_0x180ce5])?_0x180ce5:'')})[_0x518a('0xba')](function(_0x215fdf){return _0x215fdf[_0x518a('0x154')]['indexOf'](_0x518a('0x155'))>=0x0;})[_0x518a('0xb4')](myreject(_0x1e1507)));}}else{_0x3372e5[_0x518a('0x132')](ami[_0x518a('0xb1')]({'action':_0x518a('0x156'),'command':util[_0x518a('0x78')]('iftime\x20%s,%s',_0x5e7236,!_['isUndefined'](config[_0x518a('0x14e')][_0x180ce5])?_0x180ce5:'')})[_0x518a('0xba')](function(_0x3ccf1a){return _0x3ccf1a['content'][_0x518a('0x157')]('true')>=0x0;})[_0x518a('0xb4')](myreject(_0x1e1507)));}BPromise[_0x518a('0x158')](_0x3372e5)[_0x518a('0xba')](function(_0x32abf3){var _0x2f15d3=_[_0x518a('0x159')](_0x32abf3);if(_0x2f15d3){return _0x38238a(_0x2f15d3);}else{_0x2a8e66[_0x518a('0x40')]=_0x39b7be?_0x518a('0x15a'):'INTERVAL_IS_OVERTIME';return _0x1e1507(msgResponse(_0x518a('0x15b'),_0x518a('0x14a'),'Global:\x20'+_0x39b7be+'\x20'+_0x3e5d9+_0x518a('0x15c')+util[_0x518a('0x99')](_0x5e7236,{'showHidden':![],'depth':null})+_0x518a('0x15d')+_0x180ce5));}})[_0x518a('0xb4')](function(_0x3d954e){return _0x1e1507(msgResponse(_0x518a('0x148'),_0x518a('0x14a'),JSON[_0x518a('0x49')](_0x3d954e)));});});};Dialer[_0x518a('0xac')]['checkDialMethod']=function(_0x3e4f23){var _0x1bc230=this;return function(){switch(_0x3e4f23[_0x518a('0x15e')]){case _0x518a('0x15f'):freeVariablesPredictive(_0x3e4f23);_0x1bc230[_0x518a('0x160')](_0x3e4f23,0x1);break;case'power':freeVariablesPredictive(_0x3e4f23);_0x1bc230['handlePower'](_0x3e4f23,_0x3e4f23['dialPowerLevel']);break;case _0x518a('0x8'):_0x1bc230[_0x518a('0x8')](_0x3e4f23);break;case _0x518a('0x161'):freeVariablesPredictive(_0x3e4f23);_0x1bc230[_0x518a('0x160')](_0x3e4f23,0x1);break;default:freeVariablesPredictive(_0x3e4f23);logger[_0x518a('0x97')](_0x518a('0x162'),_0x3e4f23[_0x518a('0x3e')],_0x518a('0x163'));}};};Dialer[_0x518a('0xac')][_0x518a('0x164')]=function(_0xfa0ebd){var _0x42e21e=this;return function(){_0x42e21e['handleIvr'](_0xfa0ebd);};};Dialer[_0x518a('0xac')][_0x518a('0xa')]=function(_0x3c3738){var _0xe90e8f=this;if(isNotPreview(_0x3c3738[_0x518a('0x15e')])){if(isVoiceQueueOutbound(_0x3c3738[_0x518a('0x4e')])&&isActive(_0x3c3738[_0x518a('0x5c')])){_0x3c3738[_0x518a('0xa2')]=!![];BPromise[_0x518a('0xb9')]()['then'](checkIsLoggedIn(_0x3c3738,_0x3c3738[_0x518a('0x52')]))[_0x518a('0xba')](checkIsActive(_0x3c3738,_0x3c3738['dialActive']))['then'](checkInterval(_0x3c3738))[_0x518a('0xba')](_0xe90e8f[_0x518a('0x142')](_0x3c3738))[_0x518a('0xba')](_0xe90e8f[_0x518a('0x147')](_0x3c3738[_0x518a('0x165')],_0x3c3738[_0x518a('0x166')],_0x3c3738['name'],_0x3c3738))['then'](_0xe90e8f['checkIfTimeIntervals'](_0x3c3738[_0x518a('0x42')],_0x3c3738[_0x518a('0x166')],_0x3c3738[_0x518a('0x3e')],_0x3c3738))[_0x518a('0xba')](_0xe90e8f[_0x518a('0x167')](_0x3c3738))[_0x518a('0xb4')](loggerCatchQueueSummary(_0x518a('0x168'),_0x3c3738));}else{notSendMessagesQueue(_0x3c3738);}}else{freeVariablesPredictive(_0x3c3738);}};Dialer['prototype'][_0x518a('0x169')]=function(){var _0x481efe=this;var _0x461668;for(var _0x4fdca0 in this[_0x518a('0x21')]){if(typeof this[_0x518a('0x21')][_0x4fdca0]!=='undefined'){_0x461668=this[_0x518a('0x21')][_0x4fdca0];if(isCampaignIvr(_0x461668[_0x518a('0x4e')])&&isActive(_0x461668[_0x518a('0xde')])){_0x461668[_0x518a('0xa2')]=!![];BPromise[_0x518a('0xb9')]()[_0x518a('0xba')](checkIsActive(_0x461668,_0x461668[_0x518a('0xde')]))[_0x518a('0xba')](checkInterval(_0x461668))[_0x518a('0xba')](_0x481efe[_0x518a('0x142')](_0x461668))[_0x518a('0xba')](_0x481efe[_0x518a('0x147')](_0x461668[_0x518a('0x165')],_0x461668['dialTimezone'],_0x461668[_0x518a('0x3e')],_0x461668))[_0x518a('0xba')](_0x481efe[_0x518a('0x149')](_0x461668[_0x518a('0x42')],_0x461668[_0x518a('0x166')],_0x461668['name'],_0x461668))[_0x518a('0xba')](_0x481efe[_0x518a('0x164')](_0x461668))[_0x518a('0xb4')](loggerCatchQueueSummary(_0x518a('0x16a'),_0x461668));}else{notSendMessagesCampaign(_0x461668);}}}};function getCallerIdRandom(_0x22678c,_0x15b59b){var _0x1ab4c0;var _0x101174;var _0x2778d7;if(_0x15b59b<=0x0){_0x15b59b=0x1;}_0x1ab4c0=new RegExp(_0x518a('0x16b')+_0x15b59b+'}$');_0x101174=Math[_0x518a('0x16c')](0xa,_0x15b59b-0x1);_0x2778d7=Math[_0x518a('0x16c')](0xa,_0x15b59b)-0x1;return util['format']('%s',_[_0x518a('0x16d')](_0x22678c,_0x1ab4c0,_[_0x518a('0x16e')](_0x101174,_0x2778d7)));}function extractCalleridName(_0x214c6b){var _0x2ec596=_0x214c6b[_0x518a('0x16f')](/"(.*?)"/);return _0x2ec596?_0x2ec596[0x1]:_0x214c6b;}function extractCalleridNumber(_0x40c76f){var _0x4c76d5=_0x40c76f[_0x518a('0x16f')](/<(.*?)>/);return _0x4c76d5?_0x4c76d5[0x1]:_0x40c76f;}Dialer['prototype'][_0x518a('0x170')]=function(_0x552464,_0x3b04cb){var _0x5de561=this;var _0x3d9584=uuid['v4']();this['actions'][_0x3d9584]=new Action(_0x552464,_0x3b04cb,_0x3d9584);return new BPromise(function(_0x40a68c,_0x1f2d3f){if(_['isUndefined'](_0x552464)&&typeof _0x552464!==_0x518a('0x171')){return _0x1f2d3f(msgResponse('originate',_0x518a('0x14a'),_0x518a('0x172')));}if(_[_0x518a('0x86')](_0x3b04cb[_0x518a('0x173')][_0x518a('0x174')])||_0x3b04cb[_0x518a('0x173')][_0x518a('0x174')]===null){return _0x1f2d3f(msgResponse(_0x518a('0x175'),_0x518a('0x14a'),_0x518a('0x176')));}var _0x4ab0f3={'XMD-CALLERID':_0x5de561[_0x518a('0x26')][_0x3d9584]['getCaller'](),'XMD-AGI':_0x552464['dialQueueProject']?util['format'](_0x518a('0x177'),ipAgi,_0x552464['dialQueueProject']):_0x518a('0x178'),'XMD-AGIAFTER':_0x552464[_0x518a('0x116')]?util[_0x518a('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0x552464['dialQueueProject2']):'NONE','XMD-QUEUE':_0x552464['type']===_0x518a('0x4f')?util['format']('\x22%s,%s%s,,,%s\x22',_0x552464[_0x518a('0x3e')],_0x552464[_0x518a('0x179')]||'',_0x552464[_0x518a('0x17a')]?'c':'',_0x552464[_0x518a('0x11c')]||0x3):_0x518a('0x178'),'XMD-CONTACTID':_0x3b04cb[_0x518a('0xd7')],'XMD-CDRTYPE':_0x518a('0x7'),'CALLERID(all)':_0x5de561[_0x518a('0x26')][_0x3d9584][_0x518a('0x17b')](),'XMD-AMD':_0x552464[_0x518a('0xe6')]?'ACTIVE':'NONE','XMD-DESTINATION':_0x518a('0xe5')};if(_0x552464[_0x518a('0xe6')]){_0x4ab0f3[_0x518a('0x17c')]=_0x552464[_0x518a('0x17d')]||0x9c4;_0x4ab0f3[_0x518a('0x17e')]=_0x552464['dialAMDGreeting']||0x5dc;_0x4ab0f3['XMD-AMDAFTERGREETINGSILENCE']=_0x552464[_0x518a('0x17f')]||0x320;_0x4ab0f3['XMD-AMDTOTALANALYSISTIME']=_0x552464[_0x518a('0x180')]||0x1388;_0x4ab0f3[_0x518a('0x181')]=_0x552464['dialAMDMinWordLength']||0x64;_0x4ab0f3[_0x518a('0x182')]=_0x552464[_0x518a('0x183')]||0x32;_0x4ab0f3['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x552464[_0x518a('0x184')]||0x3;_0x4ab0f3[_0x518a('0x185')]=_0x552464[_0x518a('0x186')]||0x100;_0x4ab0f3['XMD-AMDMAXIMUMWORDLENGTH']=_0x552464[_0x518a('0x187')]||0x1388;}if(_0x552464['type']===_0x518a('0x4f')){_0x4ab0f3[_0x518a('0x188')]=_0x3b04cb[_0x518a('0x103')];}else{_0x4ab0f3[_0x518a('0x189')]=_0x3b04cb[_0x518a('0xda')];}for(var _0x52d3d5 in _0x3b04cb[_0x518a('0x173')]){if(typeof _0x3b04cb['Contact'][_0x52d3d5]!==_0x518a('0xd0')){if(isNotNull(_0x3b04cb[_0x518a('0x173')][_0x52d3d5])&&_0x52d3d5!=='id'&&_0x52d3d5!=='tags'&&_0x52d3d5!==_0x518a('0x18a')&&_0x52d3d5!==_0x518a('0x18b')){_0x4ab0f3[util[_0x518a('0x78')](_0x518a('0x18c'),_0x518a('0x18d'),_['toUpper'](_0x52d3d5))]=_0x3b04cb[_0x518a('0x173')][_0x52d3d5];}}}var _0x434763=_0x5de561['isTrunkReachable'](_0x552464[_0x518a('0x76')])?getCallerId(_0x552464[_0x518a('0x76')][_0x518a('0x18e')],_0x552464[_0x518a('0x5d')],_0x552464['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x552464['dialOriginateCallerIdNumber'],_0x552464['dialRandomLastDigitCallerIdNumber']):_0x552464[_0x518a('0x5e')]):getCallerId(_[_0x518a('0xb0')](_0x552464[_0x518a('0x144')])?_0x552464['Trunk']['callerid']:_0x552464[_0x518a('0x144')]['callerid'],_0x552464[_0x518a('0x5d')],_0x552464[_0x518a('0x18f')]>0x0?getCallerIdRandom(_0x552464['dialOriginateCallerIdNumber'],_0x552464['dialRandomLastDigitCallerIdNumber']):_0x552464[_0x518a('0x5e')]);if(_0x434763){_0x4ab0f3[_0x518a('0x190')]=_0x5de561[_0x518a('0x26')][_0x3d9584]['originatecalleridname']=extractCalleridName(_0x434763);_0x4ab0f3['XMD-ORIGINATECALLERIDNUM']=_0x5de561['actions'][_0x3d9584][_0x518a('0x191')]=extractCalleridNumber(_0x434763);}return ami['Action']({'actionid':_0x3d9584,'action':_0x518a('0x175'),'channel':_0x5de561['isTrunkReachable'](_0x552464[_0x518a('0x76')])?util[_0x518a('0x78')]('SIP/%s/%s%s',_0x552464[_0x518a('0x76')][_0x518a('0x3e')],isNotNull(_0x552464[_0x518a('0x192')])?_0x552464[_0x518a('0x192')][_0x518a('0x193')]()||'':'',_0x552464[_0x518a('0x194')]>0x0?_0x3b04cb['Contact'][_0x518a('0x174')][_0x518a('0x195')](_0x552464[_0x518a('0x194')]):_0x3b04cb[_0x518a('0x173')][_0x518a('0x174')]):util[_0x518a('0x78')](_0x518a('0x196'),_[_0x518a('0xb0')](_0x552464[_0x518a('0x144')])?_0x552464['Trunk'][_0x518a('0x3e')]:_0x552464[_0x518a('0x144')][_0x518a('0x3e')],isNotNull(_0x552464[_0x518a('0x192')])?_0x552464[_0x518a('0x192')]['trim']()||'':'',_0x552464[_0x518a('0x194')]>0x0?_0x3b04cb[_0x518a('0x173')][_0x518a('0x174')][_0x518a('0x195')](_0x552464[_0x518a('0x194')]):_0x3b04cb[_0x518a('0x173')]['phone']),'callerid':_0x434763,'Exten':'xcally-motion-dialer','Context':_0x518a('0x197'),'Priority':'1','variable':_0x4ab0f3,'timeout':(_0x552464[_0x518a('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3d9584})['then'](function(_0x68d0db){return _0x40a68c(_0x68d0db);})['catch'](function(_0x366160){_0x552464[_0x518a('0x66')]+=0x1;var _0x3590e7=new History(_0x5de561[_0x518a('0x26')][_0x3d9584]);logger[_0x518a('0x97')](util[_0x518a('0x78')](_0x518a('0x198'),JSON[_0x518a('0x49')](_0x366160)));_0x3590e7['state']=0xe;_0x3590e7['statedesc']=_0x518a('0x199');_0x3590e7[_0x518a('0xab')]=moment()[_0x518a('0x78')](_0x518a('0x102'));_0x3590e7[_0x518a('0xaa')]=_0x3590e7[_0x518a('0xab')];_0x5de561['createHistory'](_0x3590e7)[_0x518a('0xb4')](loggerCatch(_0x518a('0x19a')));_0x5de561[_0x518a('0xcc')](_0x3590e7)[_0x518a('0xb4')](loggerCatch(_0x518a('0x19a')))['finally'](function(){delete _0x5de561[_0x518a('0x26')][_0x3d9584];return _0x1f2d3f(msgResponse(_0x518a('0x175'),_0x518a('0x48'),_0x518a('0x19b')));});});});};Dialer[_0x518a('0xac')][_0x518a('0x31')]=function(_0x4748e3){var _0x4cffa4=this[_0x518a('0x26')][_0x4748e3['actionid']];if(_0x4cffa4){delete this[_0x518a('0x26')][_0x4748e3['actionid']];_0x4cffa4[_0x518a('0x11b')]=moment()[_0x518a('0x78')](_0x518a('0x102'));var _0x42a2e5=_0x4cffa4['type']===_0x518a('0x7b')?this[_0x518a('0x21')][_0x4cffa4[_0x518a('0xb7')]]:this[_0x518a('0x20')][_0x4cffa4[_0x518a('0x19c')]()];if(!this[_0x518a('0xdc')](_0x4748e3[_0x518a('0x19d')])){this[_0x518a('0xb6')](_0x42a2e5);return this[_0x518a('0x19e')](_0x4cffa4,_0x42a2e5,_0x4748e3)[_0x518a('0xb4')](loggerCatch(_0x518a('0x19f')));}this[_0x518a('0xae')][_0x4748e3[_0x518a('0xe9')]]=_0x4cffa4;}};Dialer[_0x518a('0xac')][_0x518a('0x1a0')]=function(_0x3247ea,_0x341b1a,_0x48def9){var _0x504642=new History(_0x341b1a);if(_0x504642[_0x518a('0xf6')]+_0x504642['countcongestionretry']+_0x504642[_0x518a('0xf7')]+_0x504642[_0x518a('0xf8')]+_0x504642['countdropretry']+_0x504642['countabandonedretry']+_0x504642['countmachineretry']+_0x504642[_0x518a('0x108')]>=_0x48def9[_0x518a('0xfb')]-0x1){return!![];}switch(_0x3247ea){case 0x3:if(_0x504642[_0x518a('0xf7')]>=_0x48def9[_0x518a('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x504642[_0x518a('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x48def9[_0x518a('0x1a2')],'minutes')[_0x518a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x504642[_0x518a('0xd7')],'ListId':_0x504642[_0x518a('0xd8')],'VoiceQueueId':_0x504642[_0x518a('0x103')]||undefined,'CampaignId':_0x504642[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x504642[_0x518a('0xf6')]>=_0x48def9['dialBusyMaxRetry']-0x1){return!![];}this[_0x518a('0xc2')]({'active':![],'countbusyretry':_0x504642[_0x518a('0xf6')]+=0x1,'scheduledat':moment()[_0x518a('0x10a')](_0x48def9['dialBusyRetryFrequency'],_0x518a('0x101'))[_0x518a('0x78')](_0x518a('0x102')),'ContactId':_0x504642[_0x518a('0xd7')],'ListId':_0x504642[_0x518a('0xd8')],'VoiceQueueId':_0x504642['VoiceQueueId']||undefined,'CampaignId':_0x504642[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x504642['countcongestionretry']>=_0x48def9[_0x518a('0x1a3')]-0x1){return!![];}this[_0x518a('0xc2')]({'active':![],'countcongestionretry':_0x504642[_0x518a('0x107')]+=0x1,'scheduledat':moment()[_0x518a('0x10a')](_0x48def9[_0x518a('0x1a4')],_0x518a('0x101'))[_0x518a('0x78')](_0x518a('0x102')),'ContactId':_0x504642['ContactId'],'ListId':_0x504642[_0x518a('0xd8')],'VoiceQueueId':_0x504642[_0x518a('0x103')]||undefined,'CampaignId':_0x504642['CampaignId']||undefined})['catch'](loggerCatch(_0x518a('0x1a5')));break;case 0x0:if(_0x504642[_0x518a('0xf8')]>=_0x48def9[_0x518a('0x1a6')]-0x1){return!![];}else{this[_0x518a('0xc2')]({'active':![],'countnosuchnumberretry':_0x504642[_0x518a('0xf8')]+=0x1,'scheduledat':moment()[_0x518a('0x10a')](_0x48def9[_0x518a('0x1a7')],_0x518a('0x101'))[_0x518a('0x78')](_0x518a('0x102')),'ContactId':_0x504642[_0x518a('0xd7')],'ListId':_0x504642['ListId'],'VoiceQueueId':_0x504642[_0x518a('0x103')]||undefined,'CampaignId':_0x504642[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x1a8')));}break;case 0xa:if(_0x504642[_0x518a('0xf9')]>=_0x48def9['dialDropMaxRetry']-0x1){return!![];}this[_0x518a('0xc2')]({'active':![],'countdropretry':_0x504642['countdropretry']+=0x1,'scheduledat':moment()[_0x518a('0x10a')](_0x48def9[_0x518a('0x123')],_0x518a('0x101'))[_0x518a('0x78')](_0x518a('0x102')),'ContactId':_0x504642[_0x518a('0xd7')],'ListId':_0x504642[_0x518a('0xd8')],'VoiceQueueId':_0x504642['VoiceQueueId']||undefined,'CampaignId':_0x504642[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x1a9')));break;case 0xb:if(_0x504642[_0x518a('0xfa')]>=_0x48def9[_0x518a('0x128')]-0x1){return!![];}this[_0x518a('0xc2')]({'active':![],'countabandonedretry':_0x504642['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x48def9['dialAbandonedRetryFrequency'],_0x518a('0x101'))[_0x518a('0x78')](_0x518a('0x102')),'ContactId':_0x504642[_0x518a('0xd7')],'ListId':_0x504642['ListId'],'VoiceQueueId':_0x504642['VoiceQueueId']||undefined,'CampaignId':_0x504642[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x12a')));break;case 0x13:if(_0x504642[_0x518a('0xf3')]>=_0x48def9[_0x518a('0x109')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x504642[_0x518a('0xf3')]+=0x1,'scheduledat':moment()[_0x518a('0x10a')](_0x48def9['dialMachineRetryFrequency'],_0x518a('0x101'))[_0x518a('0x78')](_0x518a('0x102')),'ContactId':_0x504642[_0x518a('0xd7')],'ListId':_0x504642['ListId'],'VoiceQueueId':_0x504642[_0x518a('0x103')]||undefined,'CampaignId':_0x504642[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x104')));break;case 0x14:if(_0x504642[_0x518a('0x108')]>=_0x48def9[_0x518a('0x1aa')]-0x1){return!![];}this[_0x518a('0xc2')]({'active':![],'countagentrejectretry':_0x504642[_0x518a('0x108')]+=0x1,'scheduledat':moment()['add'](_0x48def9[_0x518a('0x1ab')],_0x518a('0x101'))['format'](_0x518a('0x102')),'ContactId':_0x504642[_0x518a('0xd7')],'ListId':_0x504642[_0x518a('0xd8')],'VoiceQueueId':_0x504642['VoiceQueueId']||undefined,'CampaignId':_0x504642['CampaignId']||undefined})[_0x518a('0xb4')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x518a('0x19e')]=function(_0x191c96,_0x3d89a0,_0x27f926){var _0x471515=this;var _0x33e7eb=new History(_0x191c96);return new BPromise(function(_0x21447b,_0x593f8d){if(_[_0x518a('0x86')](_0x3d89a0)&&typeof _0x3d89a0!=='object'){return _0x593f8d(msgResponse(_0x518a('0x1ac'),_0x518a('0x14a'),_0x518a('0x1ad')));}if(_[_0x518a('0x86')](_0x27f926)&&typeof _0x27f926!==_0x518a('0x171')){return _0x593f8d(msgResponse(_0x518a('0x1ac'),_0x518a('0x14a'),_0x518a('0x1ae')));}switch(_0x27f926[_0x518a('0x113')]){case'0':_0x3d89a0[_0x518a('0x65')]+=0x1;_0x33e7eb[_0x518a('0xa8')]=0x0;_0x33e7eb[_0x518a('0xa9')]=_0x518a('0x1af');_0x33e7eb[_0x518a('0xf8')]+=0x1;_0x33e7eb['countglobal']+=0x1;ami[_0x518a('0x4d')](_0x518a('0x1b0'),ut[_0x518a('0xf4')](_0x191c96,_0x518a('0x1b1')));_0x471515[_0x518a('0xce')](_0x33e7eb)[_0x518a('0xb4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x471515[_0x518a('0x1a0')](0x0,_0x191c96,_0x3d89a0)){if(_0x33e7eb[_0x518a('0xf8')]>=_0x3d89a0[_0x518a('0x1a6')]){_0x471515[_0x518a('0xfe')](_0x33e7eb,_0x21447b,_0x593f8d,_0x518a('0x1b2'));}else{_0x471515[_0x518a('0xfc')](_0x33e7eb,_0x21447b,_0x593f8d,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x3d89a0[_0x518a('0x64')]+=0x1;_0x33e7eb[_0x518a('0xa8')]=0x3;_0x33e7eb[_0x518a('0xa9')]=_0x518a('0x1b3');_0x33e7eb['countnoanswerretry']+=0x1;_0x33e7eb[_0x518a('0x120')]+=0x1;ami[_0x518a('0x4d')](_0x518a('0x1b4'),ut[_0x518a('0xf4')](_0x191c96,_0x518a('0x1b5')));_0x471515[_0x518a('0xce')](_0x33e7eb)[_0x518a('0xb4')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x471515['checkRetriveMax'](0x3,_0x191c96,_0x3d89a0)){if(_0x33e7eb['countnoanswerretry']>=_0x3d89a0['dialNoAnswerMaxRetry']){_0x471515[_0x518a('0xfe')](_0x33e7eb,_0x21447b,_0x593f8d,_0x518a('0x1b6'));}else{_0x471515['stateGlobal'](_0x33e7eb,_0x21447b,_0x593f8d,_0x518a('0x1b6'));}}break;case'5':_0x3d89a0[_0x518a('0x62')]+=0x1;_0x33e7eb[_0x518a('0xa8')]=0x5;_0x33e7eb[_0x518a('0xa9')]='Busy';_0x33e7eb[_0x518a('0xf6')]+=0x1;_0x33e7eb[_0x518a('0x120')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x518a('0xf4')](_0x191c96,'busy'));_0x471515[_0x518a('0xce')](_0x33e7eb)[_0x518a('0xb4')](loggerCatch(_0x518a('0x1b7')));if(_0x471515[_0x518a('0x1a0')](0x5,_0x191c96,_0x3d89a0)){if(_0x33e7eb['countbusyretry']>=_0x3d89a0['dialBusyMaxRetry']){_0x471515[_0x518a('0xfe')](_0x33e7eb,_0x21447b,_0x593f8d,_0x518a('0x1b8'));}else{_0x471515[_0x518a('0xfc')](_0x33e7eb,_0x21447b,_0x593f8d,_0x518a('0x1b8'));}}break;case'8':_0x3d89a0[_0x518a('0x1b9')]+=0x1;_0x33e7eb['state']=0x8;_0x33e7eb[_0x518a('0xa9')]=_0x518a('0x1ba');_0x33e7eb[_0x518a('0x107')]+=0x1;_0x33e7eb[_0x518a('0x120')]+=0x1;ami[_0x518a('0x4d')](_0x518a('0x1bb'),ut[_0x518a('0xf4')](_0x191c96,'congestion'));_0x471515[_0x518a('0xce')](_0x33e7eb)[_0x518a('0xb4')](loggerCatch(_0x518a('0x1bc')));if(_0x471515[_0x518a('0x1a0')](0x8,_0x191c96,_0x3d89a0)){if(_0x33e7eb[_0x518a('0x107')]>=_0x3d89a0['dialCongestionMaxRetry']){_0x471515[_0x518a('0xfe')](_0x33e7eb,_0x21447b,_0x593f8d,'reason\x208\x20congestion');}else{_0x471515[_0x518a('0xfc')](_0x33e7eb,_0x21447b,_0x593f8d,'reason\x208\x20congestion');}}break;case'11':_0x3d89a0[_0x518a('0x1bd')]+=0x1;_0x33e7eb[_0x518a('0xa8')]=0xb;_0x33e7eb[_0x518a('0xa9')]='Abandoned';_0x33e7eb[_0x518a('0xfa')]+=0x1;_0x33e7eb['countglobal']+=0x1;_0x471515[_0x518a('0xce')](_0x33e7eb)['catch'](loggerCatch(_0x518a('0x12c')));if(_0x471515[_0x518a('0x1a0')](0xb,_0x191c96,_0x3d89a0)){if(_0x33e7eb[_0x518a('0xfa')]>=_0x3d89a0[_0x518a('0x128')]){_0x471515['createStateFinal'](_0x33e7eb,_0x21447b,_0x593f8d,_0x518a('0x1be'));}else{_0x471515['stateGlobal'](_0x33e7eb,_0x21447b,_0x593f8d,_0x518a('0x1be'));}}break;case'20':_0x3d89a0[_0x518a('0x68')]+=0x1;_0x33e7eb[_0x518a('0xa8')]=0x14;_0x33e7eb['statedesc']=_0x518a('0x1bf');_0x33e7eb['countagentrejectretry']+=0x1;_0x33e7eb[_0x518a('0x120')]+=0x1;ami[_0x518a('0x4d')](_0x518a('0x1c0'),ut[_0x518a('0xf4')](_0x191c96,_0x518a('0x1c1')));_0x471515[_0x518a('0xce')](_0x33e7eb)[_0x518a('0xb4')](loggerCatch(_0x518a('0x1c2')));if(_0x471515['checkRetriveMax'](0x14,_0x191c96,_0x3d89a0)){if(_0x33e7eb[_0x518a('0x108')]>=_0x3d89a0[_0x518a('0x1aa')]){_0x471515[_0x518a('0xfe')](_0x33e7eb,_0x21447b,_0x593f8d,'reason\x2020\x20agentreject');}else{_0x471515[_0x518a('0xfc')](_0x33e7eb,_0x21447b,_0x593f8d,_0x518a('0x1c3'));}}break;default:_0x3d89a0[_0x518a('0x110')]+=0x1;_0x33e7eb[_0x518a('0xa8')]=0xc;_0x33e7eb[_0x518a('0xa9')]=_0x27f926[_0x518a('0x113')];_0x471515['createHistory'](_0x33e7eb)[_0x518a('0xb4')](loggerCatch(_0x518a('0x1c4')));if(_0x471515['checkRetriveMax'](_0x27f926['reason'],_0x191c96,_0x3d89a0)){if(_0x33e7eb['countbusyretry']+_0x33e7eb[_0x518a('0x107')]+_0x33e7eb[_0x518a('0xf7')]+_0x33e7eb[_0x518a('0xf8')]+_0x33e7eb['countdropretry']+_0x33e7eb['countabandonedretry']+_0x33e7eb['countmachineretry']+_0x33e7eb[_0x518a('0x108')]>=_0x3d89a0[_0x518a('0xfb')]){_0x471515[_0x518a('0xfc')](_0x33e7eb,_0x21447b,_0x593f8d,_0x27f926['reason']);}else{_0x471515[_0x518a('0xfe')](_0x33e7eb,_0x21447b,_0x593f8d,_0x27f926['reason']);}}}});};Dialer[_0x518a('0xac')]['stateGlobal']=function(_0x2cd800,_0x4def77,_0x370360,_0x50f210){var _0xdd1e2d=new Final(_0x2cd800);_0xdd1e2d[_0x518a('0xa8')]=0xf;_0xdd1e2d['statedesc']=_0x518a('0x1c5');this[_0x518a('0xfe')](_0xdd1e2d,_0x4def77,_0x370360,_0x50f210);};Dialer[_0x518a('0xac')]['createStateFinal']=function(_0x3abe58,_0x3eb802,_0x196ec5,_0x52f44f){this[_0x518a('0xcc')](_0x3abe58)[_0x518a('0xba')](function(){return _0x3eb802(msgResponse('[callProgressDetecting]',_0x518a('0xdd'),_0x52f44f));})[_0x518a('0xb4')](function(){return _0x196ec5(msgResponse(_0x518a('0x1c6'),_0x518a('0x14a'),_0x518a('0x1c7')));});};Dialer[_0x518a('0xac')]['predictive']=function(_0x371a9a){var _0x5356de=_0x371a9a[_0x518a('0x1c8')]/0x64;var _0x5c1599=_0x371a9a['outboundDropCallsDayTimeout']/(_0x371a9a[_0x518a('0x11d')]+_0x371a9a['outboundAnswerCallsDay']);var _0x106a68=Math[_0x518a('0x1c9')](_0x371a9a['predictiveIntervalAvailable']*(_0x371a9a[_0x518a('0x1ca')]/0x64));var _0x5ae5cd=Math[_0x518a('0x1c9')](_0x371a9a[_0x518a('0x70')]*(_0x371a9a['predictiveIntervalMinThreshold']/0x64));var _0x16a7d2=_0x371a9a[_0x518a('0x51')]+_0x371a9a[_0x518a('0x57')];var _0x213cab=Math[_0x518a('0x1cb')](_0x371a9a['erlangCalls']*_0x371a9a[_0x518a('0x73')]*_0x371a9a[_0x518a('0x6e')]*_0x371a9a[_0x518a('0x6f')]);if(_[_0x518a('0x86')](_0x371a9a[_0x518a('0x29')])){if(!_[_0x518a('0x86')](_0x371a9a[_0x518a('0x75')])){_0x371a9a['startPredictive']=undefined;loggerPredictive[_0x518a('0x97')](_0x518a('0x1cc'),_0x518a('0x1cd'));}if(!_[_0x518a('0x86')](_0x371a9a['handlePredictive'])){loggerPredictive[_0x518a('0x97')](_0x518a('0x1cc'),_0x518a('0x1ce'));clearInterval(_0x371a9a[_0x518a('0x91')]);_0x371a9a['handlePredictive']=undefined;}_0x371a9a[_0x518a('0x29')]=moment()[_0x518a('0x78')](_0x518a('0x102'));loggerPredictive[_0x518a('0x7d')](_0x371a9a[_0x518a('0x3e')],_0x518a('0x1cf'),_0x371a9a[_0x518a('0x29')]);this[_0x518a('0x160')](_0x371a9a,0x1);}else if(ifInterval(_0x371a9a[_0x518a('0x1d0')],_0x371a9a[_0x518a('0x29')])){this[_0x518a('0x160')](_0x371a9a,0x1);loggerPredictiveCalls[_0x518a('0x7d')](_0x518a('0x1d1'),_0x371a9a['startProgressive'],_0x371a9a[_0x518a('0x3e')]);_0x371a9a['erlangCalls']=0x0;_0x371a9a[_0x518a('0x6d')]=0x0;}else if(_0x5356de<_0x5c1599&&_0x371a9a[_0x518a('0x1d2')]===_0x518a('0x1d3')){freeVariablesPredictive(_0x371a9a);loggerPredictive[_0x518a('0x7d')](_0x518a('0x1d4'),_0x518a('0x1d5'),_0x5c1599,_0x518a('0x29'),_0x371a9a['name']);}else if(_0x213cab<_0x371a9a[_0x518a('0x6d')]&&_0x371a9a[_0x518a('0x1d2')]==='dropRate'){freeVariablesPredictive(_0x371a9a);loggerPredictive[_0x518a('0x7d')](_0x518a('0x1d6'),'Max\x20Drop\x20',_0x213cab,_0x518a('0x1d7'),_0x371a9a['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x371a9a[_0x518a('0x3e')]);}else if(!ifInterval(_0x371a9a[_0x518a('0x1d0')],_0x371a9a['startProgressive'])&&_[_0x518a('0x86')](_0x371a9a[_0x518a('0x75')])&&!_['isUndefined'](_0x371a9a[_0x518a('0x29')])){_0x371a9a[_0x518a('0x75')]=moment()[_0x518a('0x78')](_0x518a('0x102'));loggerPredictive[_0x518a('0x7d')](_0x371a9a[_0x518a('0x3e')],'started\x20in\x20predictive\x20at',_0x371a9a[_0x518a('0x75')]);this[_0x518a('0x1d8')](_0x371a9a['dialPredictiveInterval'])[_0x518a('0xba')](this[_0x518a('0x1d9')](_0x371a9a))[_0x518a('0xba')](mergeDataErlangB(_0x371a9a))['then'](this[_0x518a('0x1da')](_0x371a9a))[_0x518a('0xb4')](loggerCatchPredictive(_0x518a('0x1db'),_0x371a9a));}else if(!ifInterval(_0x371a9a[_0x518a('0x1d0')],_0x371a9a[_0x518a('0x75')])){_0x371a9a['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x371a9a['startPredictive']=moment()[_0x518a('0x78')](_0x518a('0x102'));loggerPredictive[_0x518a('0x7d')](_0x371a9a[_0x518a('0x3e')],_0x518a('0x1dc'),_0x371a9a['startPredictive']);clearInterval(_0x371a9a[_0x518a('0x91')]);_0x371a9a[_0x518a('0x91')]=undefined;this[_0x518a('0x1d8')](_0x371a9a[_0x518a('0x1d0')])[_0x518a('0xba')](this['getDataPredictive'](_0x371a9a))[_0x518a('0xba')](mergeDataErlangB(_0x371a9a))[_0x518a('0xba')](this['startMethodPredictive'](_0x371a9a))[_0x518a('0xb4')](loggerCatchPredictive(_0x518a('0x1dd'),_0x371a9a));}else if(_0x371a9a[_0x518a('0x70')]&&_0x16a7d2<_0x371a9a[_0x518a('0x70')]-_0x5ae5cd){freeVariablesPredictive(_0x371a9a);loggerPredictive[_0x518a('0x7d')](_0x371a9a[_0x518a('0x3e')],_0x518a('0x1de'),_0x16a7d2,')\x20are\x20less\x20than\x20threshold\x20(',_0x371a9a['predictiveIntervalAvailable'],'-',_0x5ae5cd,'=',_0x371a9a[_0x518a('0x70')]-_0x5ae5cd,')');}else if(_0x371a9a[_0x518a('0x70')]&&_0x16a7d2>_0x371a9a['predictiveIntervalAvailable']+_0x106a68){freeVariablesPredictive(_0x371a9a);loggerPredictive[_0x518a('0x7d')](_0x371a9a[_0x518a('0x3e')],_0x518a('0x1de'),_0x16a7d2,_0x518a('0x1df'),_0x371a9a[_0x518a('0x70')],'+',_0x106a68,'=',_0x371a9a[_0x518a('0x70')]+_0x106a68,')');}};Dialer[_0x518a('0xac')][_0x518a('0x1d9')]=function(_0x3092b0){var _0x40bc31=this;return function(_0x51a3bb){return new BPromise(function(_0x4dd952,_0x466475){_['merge'](_0x3092b0,_0x51a3bb[0x0]);if(checkGetDataPredictive(_0x51a3bb[0x0])){var _0x16bfe2=_0x3092b0[_0x518a('0x70')]=_0x3092b0[_0x518a('0x57')]+_0x3092b0[_0x518a('0x51')];var _0x565e6c=_0x3092b0['dialPredictiveInterval']*0x3c;var _0x48ecbd=_0x51a3bb[0x0][_0x518a('0x85')]+_0x51a3bb[0x0][_0x518a('0x83')];var _0xee2a6a=(_0x51a3bb[0x0][_0x518a('0x69')]+_0x51a3bb[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x51a3bb[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x51a3bb[0x0]['predictiveIntervalTotalCalls'];_0x3092b0[_0x518a('0x6e')]=_0xee2a6a>0x0?_0xee2a6a:0x1;switch(_0x3092b0[_0x518a('0x1d2')]){case'dropRate':var _0x207824=_0x3092b0[_0x518a('0x1c8')]/0x64;return _0x40bc31[_0x518a('0x1e0')](_0x16bfe2,_0x565e6c,_0x48ecbd,_0xee2a6a,_0x207824)[_0x518a('0xba')](function(_0x1856b3){return _0x4dd952(_0x1856b3);});case _0x518a('0x1e1'):var _0x5864a3=_0x3092b0[_0x518a('0x1c8')]/0x64;return _0x40bc31[_0x518a('0x1e2')](_0x16bfe2,_0x565e6c,_0x48ecbd,_0xee2a6a,_0x5864a3)[_0x518a('0xba')](function(_0x4e4cb6){return _0x4dd952(_0x4e4cb6);});default:return _0x466475(msgResponse(_0x518a('0x1e3'),_0x518a('0x14a'),_0x518a('0x1e4')));}}else{return _0x466475(msgResponse(_0x518a('0x1e3'),_0x518a('0x14a'),_0x518a('0x1e5')));}});};};Dialer[_0x518a('0xac')]['getDataPredictiveOld']=function(_0x30ee3a){var _0x35ab60=this;return function(_0x531622){return new BPromise(function(_0x4472e9,_0x1bc08c){_['merge'](_0x30ee3a,_0x531622[0x0]);if(checkGetDataPredictive(_0x531622[0x0])){loggerPredictive[_0x518a('0x7d')](JSON[_0x518a('0x49')](_0x531622[0x0]));if(_0x30ee3a[_0x518a('0x1d2')]===_0x518a('0x1d3')){return _0x35ab60[_0x518a('0x1e6')](_0x30ee3a['id'])[_0x518a('0xba')](function(_0xcf7129){var _0x36ccb2=_0x30ee3a['loggedIn']-_0xcf7129[0x0][_0x518a('0x1e7')];var _0x58f52e=_0x30ee3a[_0x518a('0x1d0')]*0x3c;var _0xc32c1f=_0x531622[0x0][_0x518a('0x85')]+_0x531622[0x0][_0x518a('0x83')];var _0x5b0c30=(_0x531622[0x0][_0x518a('0x69')]+_0x531622[0x0][_0x518a('0x6b')]+_0x531622[0x0][_0x518a('0x6a')])/_0x531622[0x0][_0x518a('0x71')];var _0x2427b1=_0x30ee3a[_0x518a('0x1c8')]/0x64;_0x30ee3a[_0x518a('0x1e8')]=_0xcf7129[0x0]['outboundQueuePauses']||0x0;_0x30ee3a[_0x518a('0x6e')]=_0x5b0c30>0x0?_0x5b0c30:0x1;return _0x35ab60[_0x518a('0x1e0')](_0x36ccb2,_0x58f52e,_0xc32c1f,_0x5b0c30,_0x2427b1);})[_0x518a('0xba')](function(_0x25c7c2){return _0x4472e9(_0x25c7c2);})[_0x518a('0xb4')](function(_0x4fdf8c){return _0x1bc08c(msgResponse(_0x518a('0x1e9'),_0x518a('0x14a'),JSON[_0x518a('0x49')](_0x4fdf8c)));});}if(_0x30ee3a[_0x518a('0x1d2')]==='agentBusyFactor'){return _0x35ab60[_0x518a('0x1e6')](_0x30ee3a['id'])['then'](function(_0x7bb57f){var _0x119c39=_0x30ee3a[_0x518a('0x52')]-_0x7bb57f[0x0][_0x518a('0x1e7')];var _0x12b66a=_0x30ee3a[_0x518a('0x1d0')]*0x3c;var _0x391d65=_0x531622[0x0]['predictiveIntervalAvgTalktime']+_0x531622[0x0]['predictiveIntervalAvgHoldtime'];var _0x1be896=(_0x531622[0x0][_0x518a('0x69')]+_0x531622[0x0][_0x518a('0x6b')]+_0x531622[0x0][_0x518a('0x6a')])/_0x531622[0x0][_0x518a('0x71')];var _0x31d4ae=_0x30ee3a[_0x518a('0x1c8')]/0x64;_0x30ee3a[_0x518a('0x1e8')]=_0x7bb57f[0x0][_0x518a('0x1e7')]||0x0;_0x30ee3a[_0x518a('0x6e')]=_0x1be896>0x0?_0x1be896:0x1;return _0x35ab60[_0x518a('0x1e2')](_0x119c39,_0x12b66a,_0x391d65,_0x1be896,_0x31d4ae);})['then'](function(_0x4366d9){return _0x4472e9(_0x4366d9);})['catch'](function(_0x1cc2b7){return _0x1bc08c(msgResponse(_0x518a('0x1e9'),'Failure',JSON[_0x518a('0x49')](_0x1cc2b7)));});}}else{return _0x1bc08c(msgResponse(_0x518a('0x1e3'),'Failure',_0x518a('0x1e5')));}});};};Dialer[_0x518a('0xac')][_0x518a('0x1da')]=function(_0x2f2883){var _0x276fa9=this;return function(){var _0x8b0d5a=0x0;var _0x24eb5b=Math[_0x518a('0x1cb')](_0x2f2883[_0x518a('0x8b')]*0x3e8);if(_0x24eb5b>0x0){_0x24eb5b=_0x24eb5b<0x64?0x64:_0x24eb5b;loggerPredictive[_0x518a('0x7d')](_0x2f2883['name'],_0x518a('0x1ea'),_0x24eb5b,_0x518a('0x4a'));_0x2f2883[_0x518a('0x91')]=setInterval(function(){_0x276fa9[_0x518a('0x91')](_0x2f2883);loggerPredictiveCalls[_0x518a('0x7d')](_0x518a('0x1eb'),_0x8b0d5a+=0x1);},_0x24eb5b);}else{loggerPredictive[_0x518a('0x7d')](_0x2f2883[_0x518a('0x3e')],_0x518a('0x1ec'));}};};Dialer['prototype'][_0x518a('0x1ed')]=function(_0x22c12a,_0x1f27f7){var _0x2df325=this;return function(_0x3c9053){if(_['isEmpty'](_0x3c9053)){if(_[_0x518a('0xb0')](_0x1f27f7[_0x518a('0xd9')])||!_0x1f27f7[_0x518a('0x1ee')]){if(_0x22c12a[_0x518a('0x15e')]===_0x518a('0x161')){_0x22c12a[_0x518a('0x133')]=_[_0x518a('0x86')](_0x22c12a[_0x518a('0x133')])?!![]:_0x22c12a[_0x518a('0x133')];var _0x1d7206=uuid['v4']();_0x2df325['actions'][_0x1d7206]=new Action(_0x22c12a,_0x1f27f7,_0x1d7206);loggerBooked[_0x518a('0x7d')](_0x518a('0x1ef'),_0x1d7206,_0x518a('0x1f0'),JSON['stringify'](_0x22c12a['queueStatusComplete']),_0x518a('0x1f1'),_0x22c12a[_0x518a('0x3e')]);if(_0x22c12a[_0x518a('0x133')]){_0x22c12a[_0x518a('0x133')]=![];_0x2df325[_0x518a('0x2a')][_0x2df325[_0x518a('0x26')][_0x1d7206]['queue']]=[];ami[_0x518a('0xb1')]({'actionid':_0x1d7206,'action':'queuestatus','queue':_0x22c12a[_0x518a('0x3e')]})[_0x518a('0xb4')](function(){_0x2df325[_0x518a('0xb6')](_0x22c12a);_0x2df325['rescheduleContact']({'active':![],'ContactId':_0x2df325[_0x518a('0x26')][_0x1d7206][_0x518a('0xd7')],'ListId':_0x2df325[_0x518a('0x26')][_0x1d7206]['ListId'],'VoiceQueueId':_0x2df325[_0x518a('0x26')][_0x1d7206][_0x518a('0x103')]||undefined,'CampaignId':_0x2df325[_0x518a('0x26')][_0x1d7206][_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2df325['actions'][_0x1d7206];});}else{loggerBooked[_0x518a('0x7d')](_0x518a('0x1f2'),JSON[_0x518a('0x49')](_0x22c12a[_0x518a('0x133')]),_0x518a('0x1f1'),_0x22c12a['name']);_0x2df325[_0x518a('0xb6')](_0x22c12a);_0x2df325[_0x518a('0xc2')]({'active':![],'ContactId':_0x2df325[_0x518a('0x26')][_0x1d7206]['ContactId'],'ListId':_0x2df325[_0x518a('0x26')][_0x1d7206]['ListId'],'VoiceQueueId':_0x2df325[_0x518a('0x26')][_0x1d7206][_0x518a('0x103')]||undefined,'CampaignId':_0x2df325['actions'][_0x1d7206][_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x1f3')));delete _0x2df325['actions'][_0x1d7206];}}else{return _0x2df325['actionOriginate'](_0x22c12a,_0x1f27f7);}}else{if(getDiff(_0x1f27f7['scheduledat'])<_0x22c12a['dialRecallMeTimeout']*0x3c){if(_0x1f27f7[_0x518a('0x1f4')]&&!_0x1f27f7[_0x518a('0x1f4')][_0x518a('0x1f5')]){_0x2df325[_0x518a('0x93')]['run'](_0x1f27f7['id'])['finally'](function(){_0x2df325[_0x518a('0xb6')](_0x22c12a);});}else{_0x2df325['unlockContact']({'active':![]},_0x1f27f7['id'],0x1)['finally'](function(){_0x2df325[_0x518a('0xb6')](_0x22c12a);});}}else{_0x22c12a[_0x518a('0x67')]+=0x1;_0x2df325[_0x518a('0xb6')](_0x22c12a);if(_0x22c12a[_0x518a('0x1f6')]){_0x2df325[_0x518a('0xc2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1f27f7[_0x518a('0xd7')],'ListId':_0x1f27f7[_0x518a('0xd8')],'VoiceQueueId':_0x1f27f7[_0x518a('0x103')]||undefined,'CampaignId':_0x1f27f7[_0x518a('0xda')]||undefined})[_0x518a('0xb4')](loggerCatch(_0x518a('0x1f7')));_0x2df325['createHistory'](createObjHistory(_0x22c12a,_0x1f27f7,_0x518a('0x1f8'),0x17,_0x518a('0x1f9')))['catch'](loggerCatch(_0x518a('0x1fa')));}else{_0x2df325[_0x518a('0xd4')](createObjHistory(_0x22c12a,_0x1f27f7,'RECALLFAILEDTIMEOUT',0x16,_0x518a('0x1fb')),_0x518a('0x1fc'),_0x518a('0x1fd'));}}}}else{_0x22c12a['outboundBlacklistCallsDay']+=0x1;_0x2df325[_0x518a('0xd4')](createObjHistory(_0x22c12a,_0x1f27f7,_0x518a('0x1fe'),0xd,_0x518a('0x1ff')),_0x518a('0x200'),'[Originate][MoveBlacklist]');throw _0x518a('0x201');}};};Dialer[_0x518a('0xac')][_0x518a('0x202')]=function(_0x517ee9){var _0x37f0c1=this;var _0x141a94=_0x517ee9['limitCalls']-_0x517ee9[_0x518a('0x9a')]-_0x517ee9[_0x518a('0xc7')];emitCampaignSummary(_0x517ee9);if(_0x141a94>0x0){if(_0x141a94>this['maxNumberOriginate']){_0x141a94=this[_0x518a('0x24')];}_0x517ee9[_0x518a('0xc7')]+=_0x141a94;this['getContactDialerIvr'](_0x517ee9['id'],_0x141a94,_0x517ee9[_0x518a('0x203')],_0x517ee9)[_0x518a('0xba')](function(_0x2635b7){_0x517ee9[_0x518a('0xc7')]-=_0x141a94;_0x517ee9[_0x518a('0xc7')]=_0x517ee9[_0x518a('0xc7')]>0x0?_0x517ee9[_0x518a('0xc7')]:0x0;if(!checkContactEmpty(_0x2635b7)){_0x517ee9['message']=_0x518a('0xa0');logger[_0x518a('0x7d')](_0x518a('0x204')+_0x517ee9[_0x518a('0x3e')]);}else{_0x517ee9[_0x518a('0x9a')]+=_0x2635b7['length'];_0x517ee9[_0x518a('0x40')]=_0x518a('0x205');for(var _0x2984da=0x0;_0x2984da<_0x2635b7['length'];_0x2984da+=0x1){_0x517ee9[_0x518a('0x206')]+=0x1;if(_[_0x518a('0xb0')](_0x2635b7[_0x2984da])||_[_0x518a('0xb0')](_0x2635b7[_0x2984da]['Contact'])||_[_0x518a('0xb0')](_0x2635b7[_0x2984da][_0x518a('0x173')]['phone'])){_0x37f0c1[_0x518a('0xd3')](_0x518a('0x207'),_0x517ee9,_0x2635b7[_0x2984da]);}else{_0x37f0c1['checkIsBlackListIvr'](_[_0x518a('0xd6')](_0x2635b7[_0x2984da],[_0x518a('0xda'),'Contact.phone']))[_0x518a('0xba')](_0x37f0c1[_0x518a('0x1ed')](_0x517ee9,_0x2635b7[_0x2984da]))['catch'](_0x37f0c1['loggerHandler'](_0x518a('0x208'),_0x517ee9));}}}})[_0x518a('0xb4')](loggerGetContactDialer(_0x518a('0x209'),_0x517ee9,_0x141a94));}};Dialer['prototype'][_0x518a('0x160')]=function(_0x109d6d,_0x50a1c5){var _0xeabf76=this;var _0x24aa88=[];var _0x1c8058=_0x50a1c5>=0x1?_0x50a1c5:0x1;if(_0x109d6d['dialMethod']==='booked'){_0x1c8058=0x1;}var _0xa57166=Math[_0x518a('0x1cb')](_0x109d6d['available']*_0x1c8058)-_0x109d6d[_0x518a('0x9a')]-_0x109d6d[_0x518a('0xc7')];emitVoiceQueueSummary(_0x109d6d);if(_0x109d6d['dialLimitQueue']>0x0){var _0x250439=_0x109d6d[_0x518a('0x20a')]-_0x109d6d['originated']-_0x109d6d[_0x518a('0x57')]-_0x109d6d['temp']-_0x109d6d[_0x518a('0x53')];if(_0xa57166>_0x250439){_0xa57166=_0x250439;}}if(_0xa57166>0x0){if(_0x109d6d['dialMethod']===_0x518a('0x161')){_0xa57166=0x1;}if(_0xa57166>this['maxNumberOriginate']){_0xa57166=this[_0x518a('0x24')];}_0x109d6d[_0x518a('0xc7')]+=_0xa57166;for(var _0x470d28 in this[_0x518a('0x22')]){if(typeof this[_0x518a('0x22')][_0x470d28]!==_0x518a('0xd0')){if(this[_0x518a('0x22')][_0x470d28][_0x518a('0xa8')]===_0x518a('0x20b')&&this[_0x518a('0x22')][_0x470d28][_0x518a('0xb2')]===_0x518a('0xdf')){_0x24aa88[_0x518a('0x132')](this[_0x518a('0x22')][_0x470d28]['id']);}}}this[_0x518a('0xc6')](_0x109d6d['id'],_0x24aa88,_0xa57166,_0x109d6d[_0x518a('0x203')],_0x109d6d)[_0x518a('0xba')](function(_0x2911f8){_0x109d6d[_0x518a('0xc7')]-=_0xa57166;_0x109d6d[_0x518a('0xc7')]=_0x109d6d[_0x518a('0xc7')]>0x0?_0x109d6d[_0x518a('0xc7')]:0x0;if(!checkContactEmpty(_0x2911f8)){_0xeabf76[_0x518a('0xbb')](_0x109d6d)[_0x518a('0xba')](sendMessageReschedule(_0x109d6d))['catch'](loggerCatch(_0x518a('0xbc')));}else{_0x109d6d[_0x518a('0x9a')]+=_0x2911f8[_0x518a('0x152')];_0x109d6d[_0x518a('0x40')]=_0x109d6d[_0x518a('0x15e')]==='booked'?_0x518a('0x20c'):'RUNNING';for(var _0x4b94f3=0x0;_0x4b94f3<_0x2911f8[_0x518a('0x152')];_0x4b94f3+=0x1){if(_[_0x518a('0xb0')](_0x2911f8[_0x4b94f3])||_['isNil'](_0x2911f8[_0x4b94f3]['Contact'])||_[_0x518a('0xb0')](_0x2911f8[_0x4b94f3]['Contact'][_0x518a('0x174')])){_0xeabf76[_0x518a('0xd3')](_0x518a('0x207'),_0x109d6d,_0x2911f8[_0x4b94f3]);}else{_0xeabf76[_0x518a('0xbd')](_[_0x518a('0xd6')](_0x2911f8[_0x4b94f3],[_0x518a('0x103'),_0x518a('0x20d')]))[_0x518a('0xba')](_0xeabf76[_0x518a('0x1ed')](_0x109d6d,_0x2911f8[_0x4b94f3]))[_0x518a('0xb4')](_0xeabf76['loggerHandler'](_0x518a('0x207'),_0x109d6d));}}}})[_0x518a('0xb4')](loggerGetContactDialer(_0x518a('0x20e'),_0x109d6d,_0xa57166));}};Dialer[_0x518a('0xac')]['handlePredictive']=function(_0x4da3fb){if(_0x4da3fb[_0x518a('0x20a')]>0x0){var _0x4874e7=_0x4da3fb[_0x518a('0x20a')]-_0x4da3fb[_0x518a('0x9a')]-_0x4da3fb['talking'];if(_0x4874e7>0x0){this[_0x518a('0x20f')](_0x4da3fb);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x518a('0x20f')](_0x4da3fb);}};Dialer[_0x518a('0xac')][_0x518a('0x20f')]=function(_0x5bd62c){var _0x3c914f=this;var _0x2993a1=[];_0x5bd62c[_0x518a('0x9a')]+=0x1;for(var _0x47d058 in this[_0x518a('0x22')]){if(typeof this['agents'][_0x47d058]!==_0x518a('0xd0')){if(this[_0x518a('0x22')][_0x47d058][_0x518a('0xa8')]==='not_inuse'&&this[_0x518a('0x22')][_0x47d058][_0x518a('0xb2')]==='reachable'){_0x2993a1[_0x518a('0x132')](this[_0x518a('0x22')][_0x47d058]['id']);}}}this[_0x518a('0xc6')](_0x5bd62c['id'],_0x2993a1,0x1,_0x5bd62c[_0x518a('0x203')],_0x5bd62c)['then'](function(_0x5a4bbc){if(!checkContactEmpty(_0x5a4bbc)){checkContactLowerLimitOriginate(_0x5bd62c,0x1,0x0);_0x3c914f[_0x518a('0xbb')](_0x5bd62c)[_0x518a('0xba')](sendMessageReschedule(_0x5bd62c))[_0x518a('0xb4')](loggerCatch(_0x518a('0xbc')));}else{_0x5bd62c[_0x518a('0x40')]=_0x518a('0x205');if(_[_0x518a('0xb0')](_0x5a4bbc[0x0])||_[_0x518a('0xb0')](_0x5a4bbc[0x0][_0x518a('0x173')])||_[_0x518a('0xb0')](_0x5a4bbc[0x0]['Contact']['phone'])){_0x3c914f['emptyContact'](_0x518a('0x207'),_0x5bd62c,_0x5a4bbc[0x0]);}else{_0x3c914f['checkIsBlackList'](_[_0x518a('0xd6')](_0x5a4bbc[0x0],[_0x518a('0x103'),_0x518a('0x20d')]))[_0x518a('0xba')](_0x3c914f[_0x518a('0x1ed')](_0x5bd62c,_0x5a4bbc[0x0]))[_0x518a('0xb4')](_0x3c914f[_0x518a('0xd2')](_0x518a('0x210'),_0x5bd62c));}}})['catch'](loggerGetContactDialer(_0x518a('0x211'),_0x5bd62c,0x1));emitVoiceQueueSummary(_0x5bd62c);};Dialer[_0x518a('0xac')][_0x518a('0x1e0')]=function(_0x202d53,_0x1137ba,_0x1e066a,_0x2e08f7,_0x2c44e1,_0x374da1){loggerPredictive[_0x518a('0x7d')](_0x518a('0x212'));loggerPredictive[_0x518a('0x7d')](_0x518a('0x213'),_0x202d53);loggerPredictive['info'](_0x518a('0x214'),_0x1137ba);loggerPredictive[_0x518a('0x7d')](_0x518a('0x215'),_0x1e066a);loggerPredictive[_0x518a('0x7d')](_0x518a('0x216'),_0x2e08f7);loggerPredictive[_0x518a('0x7d')](_0x518a('0x217'),_0x2c44e1);loggerPredictive[_0x518a('0x7d')](_0x518a('0x8e'));return new BPromise(function(_0x34c396,_0x574405){if(_0x202d53<=0x0||isNaN(_0x202d53)){return _0x574405(msgResponse(_0x518a('0x218'),_0x518a('0x48'),_0x518a('0x219')+_0x202d53));}if(_0x1e066a<=0x0||isNaN(_0x1e066a)){return _0x574405(msgResponse(_0x518a('0x218'),_0x518a('0x48'),_0x518a('0x21a')+_0x1e066a));}if(_0x2e08f7<=0x0||isNaN(_0x2e08f7)){return _0x574405(msgResponse(_0x518a('0x218'),_0x518a('0x48'),_0x518a('0x21b')+_0x2e08f7));}if(_0x1137ba<=0x0||isNaN(_0x1137ba)){return _0x574405(msgResponse(_0x518a('0x218'),_0x518a('0x48'),_0x518a('0x21c')+_0x1137ba));}if(_0x2c44e1<=0x0||isNaN(_0x2c44e1)){return _0x574405(msgResponse(_0x518a('0x218'),_0x518a('0x48'),'Amax\x20=\x20'+_0x2c44e1));}_0x374da1=_0x374da1||0x0;var _0x432075=0x1/_0x1e066a;var _0x261d94=0x0;var _0x2c8e9c=0x0;var _0x4610ba=0x0;var _0x13b1b6=0x0;for(var _0x5252f9=0x0;_0x4610ba<_0x2c44e1;_0x5252f9+=0x1){_0x2c8e9c=_0x5252f9/_0x1137ba;_0x261d94=(_0x2e08f7*_0x2c8e9c+_0x374da1)/_0x432075;_0x4610ba=erlangb(_0x261d94,_0x202d53);_0x13b1b6=_0x261d94/_0x202d53*(0x1-erlangb(_0x261d94,_0x202d53));}return _0x34c396({'erlangCalls':_0x5252f9,'erlangCallToSecond':_0x1137ba/_0x5252f9,'erlangAbandonmentRate':_0x4610ba,'erlangBusyFactor':_0x13b1b6});});};Dialer[_0x518a('0xac')][_0x518a('0x1e2')]=function(_0x258b84,_0x2fb5b0,_0x35579c,_0x4d83b8,_0x460fb3,_0x56cfb7){loggerPredictive['info'](_0x518a('0x21d'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x258b84);loggerPredictive[_0x518a('0x7d')](_0x518a('0x214'),_0x2fb5b0);loggerPredictive[_0x518a('0x7d')](_0x518a('0x215'),_0x35579c);loggerPredictive[_0x518a('0x7d')]('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',_0x4d83b8);loggerPredictive['info'](_0x518a('0x21e'),_0x460fb3);loggerPredictive['info'](_0x518a('0x8e'));return new BPromise(function(_0x3e2b57,_0x2b2cd3){if(_0x258b84<=0x0||isNaN(_0x258b84)){return _0x2b2cd3(msgResponse(_0x518a('0x21f'),_0x518a('0x48'),_0x518a('0x219')+_0x258b84));}if(_0x35579c<=0x0||isNaN(_0x35579c)){return _0x2b2cd3(msgResponse(_0x518a('0x21f'),_0x518a('0x48'),_0x518a('0x21a')+_0x35579c));}if(_0x4d83b8<=0x0||isNaN(_0x4d83b8)){return _0x2b2cd3(msgResponse(_0x518a('0x21f'),_0x518a('0x48'),_0x518a('0x21b')+_0x4d83b8));}if(_0x2fb5b0<=0x0||isNaN(_0x2fb5b0)){return _0x2b2cd3(msgResponse('[busyFactor]',_0x518a('0x48'),_0x518a('0x21c')+_0x2fb5b0));}if(_0x460fb3<=0x0||isNaN(_0x460fb3)){return _0x2b2cd3(msgResponse(_0x518a('0x21f'),_0x518a('0x48'),'Umin\x20=\x20'+_0x460fb3));}_0x56cfb7=_0x56cfb7||0x0;var _0xc64e37=0x1/_0x35579c;var _0x4f27ee=0x0;var _0x2c617d=0x0;var _0x2226eb=0x0;var _0x4b5b59=0x0;for(var _0x450100=0x0;_0x4b5b59<_0x460fb3;_0x450100+=0x1){_0x2c617d=_0x450100/_0x2fb5b0;_0x4f27ee=(_0x4d83b8*_0x2c617d+_0x56cfb7)/_0xc64e37;_0x2226eb=erlangb(_0x4f27ee,_0x258b84);_0x4b5b59=_0x4f27ee/_0x258b84*(0x1-erlangb(_0x4f27ee,_0x258b84));}return _0x3e2b57({'erlangCalls':_0x450100,'erlangCallToSecond':_0x2fb5b0/_0x450100,'erlangAbandonmentRate':_0x2226eb,'erlangBusyFactor':_0x4b5b59});});};module['exports']=Dialer;
\ No newline at end of file
+var _0xd73a=['actions','[actions]','enqueue','isNil','status','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','merge','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','syncVarSet','variable','exten','dialAMDActive','uniqueid','HangupInAMD','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','value','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','countbusyretry','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','cause-txt','[syncHangupIvr][createHistory]','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','VoiceQueueId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','strategy','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','indexOf','true','Action','all','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','loggedIn','checkIfTime','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','phone','substring','SIP/%s/%s%s','dialCutDigit','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','predictiveIntervalDroppedCallsCallersExit','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','busyFactor','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','defaults','redis','localhost','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','queuemember','loopCampaigns','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','available','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice_queue:save','ivr','campaign:ivr:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','sendMessageOneNotActive','pTalking','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','starttime','clearZombieChannels','[uniqueid]'];(function(_0x3f4c7c,_0x1459be){var _0x4f7dfb=function(_0x2db7cc){while(--_0x2db7cc){_0x3f4c7c['push'](_0x3f4c7c['shift']());}};_0x4f7dfb(++_0x1459be);}(_0xd73a,0x171));var _0xad73=function(_0x364a3f,_0x47aee8){_0x364a3f=_0x364a3f-0x0;var _0x2271dd=_0xd73a[_0x364a3f];return _0x2271dd;};'use strict';var util=require(_0xad73('0x0'));var _=require(_0xad73('0x1'));var BPromise=require(_0xad73('0x2'));var uuid=require(_0xad73('0x3'));var moment=require(_0xad73('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0xad73('0x5'));var config=require(_0xad73('0x6'));var logger=require(_0xad73('0x7'))(_0xad73('0x8'));var loggerBooked=require(_0xad73('0x7'))(_0xad73('0x9'));var loggerPredictive=require(_0xad73('0x7'))(_0xad73('0xa'));var loggerPredictiveCalls=require(_0xad73('0x7'))(_0xad73('0xb'));var loggerSyncQueueSummary=require(_0xad73('0x7'))('syncQueueSummary');var ami=require(_0xad73('0xc'));config['redis']=_[_0xad73('0xd')](config[_0xad73('0xe')],{'host':_0xad73('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad73('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xad73('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xad73('0x11'));var Action=require(_0xad73('0x12'));var History=require(_0xad73('0x13'));var Final=require('./final');var AgentComplete=require(_0xad73('0x14'));var QueueCallerAbandon=require(_0xad73('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0xad73('0x16')][_0xad73('0x17')]||_0xad73('0x18');var strategy={'rrmemory':_0xad73('0x19'),'roundrobin':_0xad73('0x1a')};var Sequence=function(){};Sequence[_0xad73('0x1b')]['enqueue']=function(_0x3b5e73){this[_0xad73('0x1c')]=this[_0xad73('0x1c')]?this[_0xad73('0x1c')][_0xad73('0x1d')](_0x3b5e73):_0x3b5e73();};function Dialer(_0x9de467,_0x3fa4dc){this[_0xad73('0x1e')]=new Sequence();this[_0xad73('0x1f')]=_0x3fa4dc;this[_0xad73('0x20')]=_0x9de467['voiceQueues'];this[_0xad73('0x21')]=_0x9de467['campaigns'];this['agents']=_0x9de467[_0xad73('0x22')];this[_0xad73('0x23')]=_0x9de467[_0xad73('0x23')];this['maxNumberOriginate']=config[_0xad73('0x24')]||0x2;this[_0xad73('0x25')]={};this['actions']={};this[_0xad73('0x26')]={};this[_0xad73('0x27')]={};this[_0xad73('0x28')]={};this[_0xad73('0x29')]={};this[_0xad73('0x2a')]={};this[_0xad73('0x2b')]={};this[_0xad73('0x2c')]={};this['queueBookedRR']={};ami['on'](_0xad73('0x2d'),this[_0xad73('0x2e')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x30'),this[_0xad73('0x31')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x32'),this[_0xad73('0x33')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x34'),this[_0xad73('0x35')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x36'),this[_0xad73('0x37')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x38'),this[_0xad73('0x39')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x3a'),this[_0xad73('0x3b')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0xad73('0x2f')](this));ami['on'](_0xad73('0x3c'),this['syncQueueMember'][_0xad73('0x2f')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xad73('0x2f')](this));this[_0xad73('0x3d')]();this[_0xad73('0x3e')]();}function isNotNull(_0x428dec){return _0x428dec!==null&&!_['isUndefined'](_0x428dec);}function checkIsLoggedIn(_0xdf45e8,_0x3fab83){return function(){if(_0x3fab83<=0x0){_0xdf45e8[_0xad73('0x3f')]='AGENTS_NOT_LOGGED';throw _0xdf45e8[_0xad73('0x40')]+_0xad73('0x41');}};}function isActive(_0xe63ff8){return _0xe63ff8;}function checkIsActive(_0x1ddeec,_0x6cc7dc){return function(){if(!isActive(_0x6cc7dc)){_0x1ddeec['message']='NOT_ACTIVE';throw _0x1ddeec['name']+_0xad73('0x42');}};}function checkInterval(_0x54d8fe){return function(){if(!isNotNull(_0x54d8fe[_0xad73('0x43')])){_0x54d8fe['message']=_0xad73('0x44');throw _0x54d8fe[_0xad73('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x54d8fe['Interval'][_0xad73('0x45')])){_0x54d8fe[_0xad73('0x3f')]='INTERVAL_IS_NULL';throw _0x54d8fe['name']+_0xad73('0x46');}if(!isNotNull(_['isEmpty'](_0x54d8fe[_0xad73('0x43')][_0xad73('0x45')]))){_0x54d8fe['message']=_0xad73('0x44');throw _0x54d8fe['name']+_0xad73('0x46');}};}function msgResponse(_0x4c0f8b,_0x41f470,_0x430578){return{'action':_0x4c0f8b,'response':_0x41f470,'message':_0x430578,'stack':_0x430578};}function myreject(_0x2e7cf6){return function(_0xb96ed5){return _0x2e7cf6(msgResponse(_0xad73('0x47'),_0xad73('0x48'),JSON[_0xad73('0x49')](_0xb96ed5)));};}function getSeconds(_0x4cb85b,_0x37e863){var _0x3db333=moment(_0x4cb85b)['milliseconds'](0x0);var _0x221d3d=moment(_0x37e863)[_0xad73('0x4a')](0x0);return _0x3db333[_0xad73('0x4b')](_0x221d3d,_0xad73('0x4c'));}function emit(_0x45210f,_0x21fa48,_0x2b2f7d){io['to'](_0x45210f)[_0xad73('0x4d')](_0x21fa48,_0x2b2f7d);}function emitVoiceQueueSummary(_0x18e9ec){if(_0x18e9ec['type']===_0xad73('0x4e')){var _0x390c2a={'id':_0x18e9ec['id'],'name':_0x18e9ec[_0xad73('0x40')],'strategy':_0x18e9ec['strategy'],'answered':_0x18e9ec['answered'],'available':_0x18e9ec[_0xad73('0x4f')],'loggedIn':_0x18e9ec['loggedIn'],'pTalking':_0x18e9ec['pTalking'],'sumBillable':_0x18e9ec[_0xad73('0x50')],'sumDuration':_0x18e9ec[_0xad73('0x51')],'sumHoldTime':_0x18e9ec[_0xad73('0x52')]||0x0,'talking':_0x18e9ec[_0xad73('0x53')],'total':_0x18e9ec['total'],'type':_0x18e9ec[_0xad73('0x54')],'unmanaged':_0x18e9ec[_0xad73('0x55')],'abandoned':_0x18e9ec['abandoned'],'waiting':_0x18e9ec[_0xad73('0x56')],'loggedInDb':_0x18e9ec[_0xad73('0x57')],'dialActive':_0x18e9ec['dialActive'],'dialMethod':_0x18e9ec[_0xad73('0x58')],'dialOriginateCallerIdName':_0x18e9ec[_0xad73('0x59')],'dialOriginateCallerIdNumber':_0x18e9ec[_0xad73('0x5a')],'dialOriginateTimeout':_0x18e9ec['dialOriginateTimeout'],'dialPrefix':_0x18e9ec[_0xad73('0x5b')],'outboundAnswerAgiCallsDay':_0x18e9ec[_0xad73('0x5c')],'outboundAnswerCallsDay':_0x18e9ec[_0xad73('0x5d')],'outboundBlacklistCallsDay':_0x18e9ec[_0xad73('0x5e')],'outboundBusyCallsDay':_0x18e9ec[_0xad73('0x5f')],'outboundCongestionCallsDay':_0x18e9ec['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x18e9ec['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x18e9ec['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x18e9ec[_0xad73('0x60')],'outboundNoAnswerCallsDay':_0x18e9ec[_0xad73('0x61')],'outboundNoSuchCallsDay':_0x18e9ec[_0xad73('0x62')],'outboundOriginateFailureCallsDay':_0x18e9ec[_0xad73('0x63')],'outboundReCallsDay':_0x18e9ec[_0xad73('0x64')],'outboundRejectCallsDay':_0x18e9ec[_0xad73('0x65')],'outboundUnknownCallsDay':_0x18e9ec[_0xad73('0x66')],'predictiveIntervalAnsweredCalls':_0x18e9ec['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x18e9ec[_0xad73('0x67')],'predictiveIntervalAvgTalktime':_0x18e9ec[_0xad73('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x18e9ec['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x18e9ec['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x18e9ec[_0xad73('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x18e9ec[_0xad73('0x6a')],'predictiveIntervalHitRate':_0x18e9ec[_0xad73('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x18e9ec[_0xad73('0x6c')],'predictiveIntervalPauses':_0x18e9ec['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x18e9ec[_0xad73('0x6d')],'predictiveIntervalTotalCalls':_0x18e9ec[_0xad73('0x6e')],'message':_0x18e9ec[_0xad73('0x3f')],'originated':_0x18e9ec['originated'],'erlangCalls':_0x18e9ec[_0xad73('0x6f')],'erlangCallToSecond':_0x18e9ec[_0xad73('0x70')],'erlangAbandonmentRate':_0x18e9ec[_0xad73('0x71')],'erlangBusyFactor':_0x18e9ec[_0xad73('0x72')],'startPredictive':_0x18e9ec['startPredictive'],'startProgressive':_0x18e9ec['startProgressive']};if(_0x18e9ec[_0xad73('0x73')]){_0x390c2a[_0xad73('0x73')]={'id':_0x18e9ec[_0xad73('0x73')]['id'],'name':_0x18e9ec[_0xad73('0x73')][_0xad73('0x40')],'active':_0x18e9ec[_0xad73('0x73')][_0xad73('0x74')],'callerid':_0x18e9ec[_0xad73('0x73')][_0xad73('0x75')]};}if(_0x18e9ec['Interval']){_0x390c2a['Interval']={'id':_0x18e9ec[_0xad73('0x43')]['id'],'name':_0x18e9ec[_0xad73('0x43')][_0xad73('0x40')]};}var _0x5b6e41=md5(JSON[_0xad73('0x49')](_0x390c2a));if(_0x18e9ec[_0xad73('0x76')]!==_0x5b6e41){_0x18e9ec[_0xad73('0x76')]=_0x5b6e41;emit(util[_0xad73('0x77')]('voice:queue:%s',_0x390c2a[_0xad73('0x40')]),_0xad73('0x78'),_0x390c2a);}}}function emitCampaignSummary(_0x2d3c38){if(_0x2d3c38['type']===_0xad73('0x79')){emit(util[_0xad73('0x77')](_0xad73('0x7a'),_0x2d3c38[_0xad73('0x40')]),'campaign:save',_0x2d3c38);}}function checkGetDataPredictive(_0x49d91d){if(isNotNull(_0x49d91d)&&!_[_0xad73('0x7b')](_0x49d91d)){loggerPredictive[_0xad73('0x7c')](_0xad73('0x7d'));loggerPredictive['info'](_0xad73('0x7e'),_0x49d91d[_0xad73('0x6e')]);loggerPredictive[_0xad73('0x7c')](_0xad73('0x7f'),_0x49d91d[_0xad73('0x80')]);loggerPredictive[_0xad73('0x7c')](_0xad73('0x81'),_0x49d91d[_0xad73('0x82')]);loggerPredictive['info'](_0xad73('0x83'),_0x49d91d['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xad73('0x7c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49d91d['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xad73('0x7c')](_0xad73('0x84'),_0x49d91d['predictiveIntervalAvgTalktime']);loggerPredictive[_0xad73('0x7c')](_0xad73('0x85'));if(_0x49d91d[_0xad73('0x6e')]>0x0){if(!_[_0xad73('0x86')](_0x49d91d[_0xad73('0x68')])&&_0x49d91d[_0xad73('0x68')]>0x0){return!![];}loggerPredictive[_0xad73('0x7c')](_0xad73('0x87'));if(!_[_0xad73('0x86')](_0x49d91d[_0xad73('0x67')])&&_0x49d91d['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xad73('0x7c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xad73('0x7c')](_0xad73('0x88'));}}else{loggerPredictive[_0xad73('0x7c')](_0xad73('0x89'));}return![];}function mergeDataErlangB(_0x4a73d1){return function(_0x404a21){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xad73('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404a21[_0xad73('0x6f')]);loggerPredictive['info'](_0xad73('0x8a'),_0x404a21[_0xad73('0x70')]);loggerPredictive[_0xad73('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404a21[_0xad73('0x71')]);loggerPredictive[_0xad73('0x7c')](_0xad73('0x8b'),_0x404a21['erlangBusyFactor']);loggerPredictive[_0xad73('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404a21['erlangAbandonmentRate']);loggerPredictive[_0xad73('0x7c')](_0xad73('0x85'));_['merge'](_0x4a73d1,_0x404a21);};}function getDiff(_0x581a82){var _0x2fc49a=moment()[_0xad73('0x4a')](0x0);var _0x5adba1=moment(_0x581a82)['milliseconds'](0x0);return _0x2fc49a[_0xad73('0x4b')](_0x5adba1,_0xad73('0x4c'));}function ifInterval(_0x3c90e0,_0x1177d6){if(_[_0xad73('0x86')](_0x1177d6)){return![];}return getDiff(_0x1177d6)<_0x3c90e0*0x3c;}function freeVariablesPredictive(_0x58899e){if(isNotNull(_0x58899e)){if(!_['isUndefined'](_0x58899e[_0xad73('0x2a')])){_0x58899e[_0xad73('0x2a')]=undefined;loggerPredictive[_0xad73('0x7c')](_0x58899e[_0xad73('0x40')],_0xad73('0x8c'));}if(!_[_0xad73('0x86')](_0x58899e[_0xad73('0x29')])){_0x58899e[_0xad73('0x29')]=undefined;loggerPredictive[_0xad73('0x7c')](_0x58899e[_0xad73('0x40')],_0xad73('0x8d'));}if(!_['isUndefined'](_0x58899e[_0xad73('0x8e')])){clearInterval(_0x58899e[_0xad73('0x8e')]);_0x58899e[_0xad73('0x8e')]=undefined;loggerPredictive[_0xad73('0x7c')](_0x58899e[_0xad73('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4e10d5,_0x441f49){if(_0x441f49===0x0){return 0x0;}var _0x30f659=0x1;for(var _0x29662f=0x1;_0x29662f<=_0x441f49;_0x29662f+=0x1){_0x30f659=0x1+_0x30f659*_0x29662f/_0x4e10d5;}return 0x1/_0x30f659;}function isVoiceQueueOutbound(_0x394978){return _0x394978===_0xad73('0x4e');}function isNotPreview(_0x1fa90f){return _0x1fa90f!==_0xad73('0x1f');}function isCampaignIvr(_0x3d8ae2){return _0x3d8ae2===_0xad73('0x79');}function getCallerId(_0xcf6163,_0x130544,_0x4e543f){if(!_[_0xad73('0x86')](_0x4e543f)&&typeof _0x4e543f===_0xad73('0x8f')&&!_[_0xad73('0x7b')](_0x4e543f)){if(!_[_0xad73('0x86')](_0x130544)&&typeof _0x130544===_0xad73('0x8f')&&!_[_0xad73('0x7b')](_0x130544)){return util[_0xad73('0x77')]('\x22%s\x22\x20<%s>',_0x130544,_0x4e543f);}return util[_0xad73('0x77')](_0xad73('0x90'),_0x4e543f,_0x4e543f);}if(!_[_0xad73('0x86')](_0xcf6163)&&typeof _0xcf6163===_0xad73('0x8f')&&!_[_0xad73('0x7b')](_0xcf6163)){return _0xcf6163;}return _0xad73('0x91');}function loggerCatchQueueSummary(_0x50002b,_0x356100){return function(_0x2444ad){freeVariablesPredictive(_0x356100);emitVoiceQueueSummary(_0x356100);emitCampaignSummary(_0x356100);loggerSyncQueueSummary[_0xad73('0x92')](_0x50002b,util[_0xad73('0x93')](_0x2444ad,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x255011,_0x585c76){return function(_0x3741cb){loggerPredictive[_0xad73('0x92')](_0x585c76[_0xad73('0x40')],_0x255011);loggerPredictive[_0xad73('0x92')](_0x3741cb[_0xad73('0x94')]);freeVariablesPredictive(_0x585c76);};}function loggerCatch(_0x6c438){return function(_0x58c8ad){logger[_0xad73('0x92')](_0x6c438,util[_0xad73('0x93')](_0x58c8ad,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x362401){return _0x362401&&!_[_0xad73('0x86')](_0x362401)&&_0x362401[_0xad73('0x95')]>0x0;}function decremetOriginate(_0xec1025){if(!_[_0xad73('0x86')](_0xec1025)&&_0xec1025!==null){if(typeof _0xec1025[_0xad73('0x96')]!=='undefined'){if(_0xec1025[_0xad73('0x96')]>0x0){_0xec1025['originated']-=0x1;}else{logger[_0xad73('0x92')](_0xad73('0x97'));}}}else{logger[_0xad73('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2f9958,_0x2f33f9,_0x28259f){if(_0x2f33f9>_0x28259f){for(var _0x4f650f=0x0;_0x4f650f<_0x2f33f9-_0x28259f;_0x4f650f+=0x1){decremetOriginate(_0x2f9958);}}}function loggerGetContactDialer(_0xc7b161,_0xe1f948,_0x2fb2fc){return function(_0x340fce){checkContactLowerLimitOriginate(_0xe1f948,_0x2fb2fc,0x0);logger[_0xad73('0x92')](_0xc7b161,util['inspect'](_0x340fce,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x6131d){return function(_0x3341ea){if(isNotNull(_0x3341ea)&&isNotNull(_0x3341ea[0x0])){if(_0x3341ea[0x0][_0xad73('0x98')]>0x0){_0x6131d['message']=_0xad73('0x99');logger[_0xad73('0x7c')](_0xad73('0x9a')+_0x6131d[_0xad73('0x40')],_0x3341ea[0x0][_0xad73('0x98')],_0xad73('0x9b'));}else{_0x6131d[_0xad73('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xad73('0x7c')]('[getContactDialer2][Empty]'+_0x6131d[_0xad73('0x40')]);}}};}function notSendMessagesQueue(_0x2d823a){if(_0x2d823a[_0xad73('0x9c')]){freeVariablesPredictive(_0x2d823a);if(_0x2d823a[_0xad73('0x96')]===0x0&&_0x2d823a[_0xad73('0x53')]===0x0&&_0x2d823a[_0xad73('0x56')]===0x0&&(_0x2d823a[_0xad73('0x9d')]||0x0)===0x0){_0x2d823a['sendMessageOneNotActive']=![];_0x2d823a[_0xad73('0x4f')]=0x0;_0x2d823a[_0xad73('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xad73('0x92')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2d823a[_0xad73('0x40')],_0xad73('0x9e'));}else{_0x2d823a[_0xad73('0x3f')]=_0xad73('0x9f');loggerSyncQueueSummary[_0xad73('0x92')](_0xad73('0xa0'),_0x2d823a[_0xad73('0x40')],_0xad73('0xa1'));}emitVoiceQueueSummary(_0x2d823a);}}function notSendMessagesCampaign(_0x2d5321){if(_0x2d5321[_0xad73('0x9c')]){if(_0x2d5321[_0xad73('0x96')]===0x0){_0x2d5321['sendMessageOneNotActive']=![];_0x2d5321['message']=_0xad73('0xa2');loggerSyncQueueSummary[_0xad73('0x92')](_0xad73('0xa3'),_0x2d5321[_0xad73('0x40')],_0xad73('0x9e'));}else{_0x2d5321[_0xad73('0x3f')]=_0xad73('0x9f');loggerSyncQueueSummary[_0xad73('0x92')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2d5321['name'],_0xad73('0xa1'));}emitCampaignSummary(_0x2d5321);}}function createObjHistory(_0x570eda,_0x488b1d,_0x5833fd,_0x6ec611,_0x13b1e4){_0x570eda[_0xad73('0x3f')]=_0x5833fd;var _0x339b1e=new Action(_0x570eda,_0x488b1d);var _0x329d83=new History(_0x339b1e);_0x329d83[_0xad73('0xa4')]=_0x6ec611;_0x329d83[_0xad73('0xa5')]=_0x13b1e4;_0x329d83['endtime']=_0x339b1e[_0xad73('0xa6')];return _0x329d83;}Dialer[_0xad73('0x1b')][_0xad73('0x3e')]=function(){var _0x243db2=this;setInterval(function(){_0x243db2[_0xad73('0xa7')](_0x243db2['uniqueId'],_0xad73('0xa8'));_0x243db2[_0xad73('0xa7')](_0x243db2[_0xad73('0xa9')],_0xad73('0xaa'));},0x32c8);};Dialer['prototype'][_0xad73('0xa7')]=function(_0x56f3ea,_0x2389d4){var _0x239c62=this;for(var _0x4e1a69 in _0x56f3ea){if(typeof _0x56f3ea[_0x4e1a69]!=='undefined'){this[_0xad73('0x1e')][_0xad73('0xab')](function(){if(!_[_0xad73('0xac')](_0x56f3ea[_0x4e1a69])){return ami['Action']({'action':_0xad73('0xad'),'channel':_0x56f3ea[_0x4e1a69]['channel']})[_0xad73('0xae')](function(_0x1a0ebd){if(_0x1a0ebd[_0xad73('0x3f')]===_0xad73('0xaf')){setTimeout(function(){if(_0x56f3ea[_0x4e1a69]&&_0x56f3ea[_0x4e1a69]['type']!==_0xad73('0x79')){_0x239c62[_0xad73('0xb0')](_0x239c62[_0xad73('0x20')][_0x56f3ea[_0x4e1a69]['queue']]);logger[_0xad73('0x92')](_0xad73('0xb1'),_0x2389d4,_0x4e1a69,_0x56f3ea[_0x4e1a69]['queue']);delete _0x56f3ea[_0x4e1a69];}if(_0x56f3ea[_0x4e1a69]&&_0x56f3ea[_0x4e1a69]['type']==='ivr'){_0x239c62[_0xad73('0xb0')](_0x239c62[_0xad73('0x21')][_0x56f3ea[_0x4e1a69][_0xad73('0xb2')]]);logger[_0xad73('0x92')](_0xad73('0xb3'),_0x2389d4,_0x4e1a69,_0x56f3ea[_0x4e1a69]['queue']);delete _0x56f3ea[_0x4e1a69];}},0x2328);}});}});}}};Dialer[_0xad73('0x1b')][_0xad73('0xb4')]=function(_0x4ae716){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xb4')](_0x4ae716))['catch'](loggerCatch(_0xad73('0xb7')));};Dialer[_0xad73('0x1b')]['checkIsBlackList']=function(_0x4375dd){return BPromise[_0xad73('0xb5')]()['then'](cmHopperBlack['checkIsBlackList'](_0x4375dd))['catch'](loggerCatch(_0xad73('0xb8')));};Dialer[_0xad73('0x1b')][_0xad73('0xb9')]=function(_0x424682){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopperBlack['checkIsBlackListIvr'](_0x424682))[_0xad73('0xae')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype']['averageHandleTime']=function(_0x294c5e){return BPromise[_0xad73('0xb5')]()['then'](cmHopperHistory[_0xad73('0xba')](_0x294c5e))[_0xad73('0xae')](loggerCatch(_0xad73('0xbb')));};Dialer[_0xad73('0x1b')][_0xad73('0xbc')]=function(_0x1f3113){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xbc')](_0x1f3113))[_0xad73('0xae')](loggerCatch(_0xad73('0xbd')));};Dialer['prototype'][_0xad73('0xbe')]=function(_0x1cb68e,_0x5c0fa6,_0x5db32d){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xbe')](_0x1cb68e,_0x5c0fa6,_0x5db32d))[_0xad73('0xae')](loggerCatch(_0xad73('0xbf')));};Dialer['prototype']['getContactDialer']=function(_0x311bf9,_0x193f73,_0x5c0ddc,_0x1715d3,_0x570e02){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper['getContactDialer'](_0x311bf9,_0x193f73,_0x5c0ddc,_0x1715d3))['catch'](function(_0x1930f1){_0x570e02[_0xad73('0xc0')]-=_0x5c0ddc;_0x570e02[_0xad73('0xc0')]=_0x570e02['temp']>0x0?_0x570e02[_0xad73('0xc0')]:0x0;loggerCatch(_0xad73('0xc1'))(_0x1930f1);});};Dialer[_0xad73('0x1b')]['getContactDialerIvr']=function(_0x49f647,_0x32df0f,_0x29fbad,_0x3ea944){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xc2')](_0x49f647,_0x32df0f,_0x29fbad))[_0xad73('0xae')](function(_0xa2f743){_0x3ea944['temp']-=_0x32df0f;_0x3ea944['temp']=_0x3ea944[_0xad73('0xc0')]>0x0?_0x3ea944[_0xad73('0xc0')]:0x0;loggerCatch(_0xad73('0xc3'))(_0xa2f743);});};Dialer[_0xad73('0x1b')][_0xad73('0xc4')]=function(_0x451146){return BPromise['resolve']()[_0xad73('0xb6')](voiceQueueRt[_0xad73('0xc4')](_0x451146))['catch'](loggerCatch(_0xad73('0xc5')));};Dialer[_0xad73('0x1b')][_0xad73('0xc6')]=function(_0x17b487){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xc6')](_0x17b487))[_0xad73('0xae')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xad73('0x1b')][_0xad73('0xc7')]=function(_0x518dca){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopperHistory[_0xad73('0xc7')](_0x518dca))[_0xad73('0xae')](loggerCatch(_0xad73('0xc8')));};Dialer['prototype'][_0xad73('0xb0')]=function(_0x1a9ad0){if(!_['isUndefined'](_0x1a9ad0)&&_0x1a9ad0!==null){if(typeof _0x1a9ad0[_0xad73('0x96')]!==_0xad73('0xc9')){if(_0x1a9ad0['originated']>0x0){_0x1a9ad0[_0xad73('0x96')]-=0x1;}else{logger['error'](_0xad73('0xca'));}}}else{logger[_0xad73('0x92')](_0xad73('0xcb'));}};Dialer['prototype'][_0xad73('0xcc')]=function(_0x1b87ef,_0x59bac4){var _0x222498=this;return function(_0x1befe0){_0x222498[_0xad73('0xb0')](_0x59bac4);logger[_0xad73('0x92')](_0x1b87ef,util['inspect'](_0x1befe0,{'showHidden':![],'depth':null}));};};Dialer[_0xad73('0x1b')][_0xad73('0xcd')]=function(_0x3930e1,_0x3ef100,_0x3a058f){var _0x195f6a={'state':0x19,'statedesc':'notFound'};this[_0xad73('0xb0')](_0x3ef100);this[_0xad73('0xce')](_[_0xad73('0xcf')](_0x195f6a,_[_0xad73('0xd0')](_0x3a058f,[_0xad73('0xd1'),_0xad73('0xd2'),_0xad73('0xd3'),'VoiceQueueId',_0xad73('0xd4')])),_0xad73('0xd5'),'[emptyContact]');logger[_0xad73('0x92')](_0x3930e1);};Dialer['prototype'][_0xad73('0xd6')]=function(_0x434250){return _0x434250==='Success';};Dialer[_0xad73('0x1b')][_0xad73('0xd7')]=function(_0x34db8b){return!_[_0xad73('0x86')](_0x34db8b)&&_0x34db8b&&!_[_0xad73('0x86')](_0x34db8b[_0xad73('0x40')])&&!_[_0xad73('0x86')](_0x34db8b['active'])&&_0x34db8b[_0xad73('0x74')]&&(this[_0xad73('0x23')][util[_0xad73('0x77')](_0xad73('0xd8'),_0x34db8b['name'])][_0xad73('0xad')]===_0xad73('0xd9')||this['trunks'][util[_0xad73('0x77')](_0xad73('0xd8'),_0x34db8b[_0xad73('0x40')])][_0xad73('0xad')]===_0xad73('0xda'));};Dialer[_0xad73('0x1b')][_0xad73('0xce')]=function(_0x29e4f1,_0x309f9d,_0x26eac9){this[_0xad73('0xc7')](_0x29e4f1)['catch'](loggerCatch(_0x309f9d));this[_0xad73('0xc6')](_0x29e4f1)[_0xad73('0xae')](loggerCatch(_0x26eac9));};Dialer[_0xad73('0x1b')][_0xad73('0xdb')]=function(_0x15ca6b){var _0x5a5310=this[_0xad73('0x27')][_0x15ca6b['uniqueid']];var _0x4691bd;if(!_['isNil'](_0x15ca6b)&&!_['isNil'](_0x15ca6b[_0xad73('0xdc')])&&!_[_0xad73('0xac')](_0x15ca6b[_0xad73('0xdc')]['amdstatus'])&&_0x15ca6b[_0xad73('0xdd')]==='xcally-motion-dialer'&&_0x5a5310){if(_0x5a5310['type']!=='ivr'&&this['voiceQueues'][_0x5a5310['queue']][_0xad73('0xde')]&&_0x15ca6b['value']==='HANGUP'){delete this[_0xad73('0x27')][_0x15ca6b[_0xad73('0xdf')]];this['updateOriginated'](this[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]]);this['voiceQueues'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;this[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]][_0xad73('0x5c')]+=0x1;_0x4691bd=new Hangup(_0x5a5310,_0x15ca6b);_0x4691bd['state']=0x12;_0x4691bd[_0xad73('0xa5')]=_0xad73('0xe0');_0x4691bd['membername']=_0xad73('0xe1');ami['emit'](_0xad73('0xe2'),ut['buildObj'](_0x4691bd,_0xad73('0xe3')));this[_0xad73('0xce')](_0x4691bd,_0xad73('0xe4'),'[syncHangupInAMD]');}if(_0x5a5310[_0xad73('0x54')]!==_0xad73('0x79')&&this['voiceQueues'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0xde')]&&_0x15ca6b[_0xad73('0xe5')]==='MACHINE'){var _0x5ed223=this;return new BPromise(function(_0x2cbdbf,_0x404a2a){delete _0x5ed223[_0xad73('0x27')][_0x15ca6b[_0xad73('0xdf')]];_0x5ed223['updateOriginated'](_0x5ed223[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]]);_0x5ed223[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;_0x5ed223['voiceQueues'][_0x5a5310[_0xad73('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x516e14=_0x5ed223[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]];var _0x1afb8c=new Hangup(_0x5a5310,_0x15ca6b);_0x1afb8c[_0xad73('0xa4')]=0x13;_0x1afb8c[_0xad73('0xa5')]='Machine';_0x1afb8c['membername']=_0xad73('0xe1');_0x1afb8c[_0xad73('0xe6')]+=0x1;_0x1afb8c[_0xad73('0xe7')]+=0x1;_0x1afb8c[_0xad73('0xe3')]=!![];ami[_0xad73('0x4d')]('custom:amd',ut[_0xad73('0xe8')](_0x1afb8c,_0xad73('0xe3')));_0x5ed223[_0xad73('0xc7')](_0x1afb8c)[_0xad73('0xae')](loggerCatch(_0xad73('0xe9')));if(_0x1afb8c['countbusyretry']+_0x1afb8c[_0xad73('0xea')]+_0x1afb8c[_0xad73('0xeb')]+_0x1afb8c[_0xad73('0xec')]+_0x1afb8c[_0xad73('0xed')]+_0x1afb8c[_0xad73('0xee')]+_0x1afb8c[_0xad73('0xe6')]+_0x1afb8c[_0xad73('0xef')]>=_0x516e14[_0xad73('0xf0')]){_0x5ed223[_0xad73('0xf1')](_0x1afb8c,_0x2cbdbf,_0x404a2a,_0xad73('0xf2'));}else{if(_0x1afb8c['countmachineretry']>=_0x516e14[_0xad73('0xf3')]){_0x5ed223[_0xad73('0xf4')](_0x1afb8c,_0x2cbdbf,_0x404a2a,'reason\x2019\x20machine....');}else{_0x5ed223[_0xad73('0xbc')]({'active':![],'countmachineretry':_0x1afb8c[_0xad73('0xe6')],'scheduledat':moment()[_0xad73('0xf5')](_0x516e14[_0xad73('0xf6')],_0xad73('0xf7'))[_0xad73('0x77')](_0xad73('0xf8')),'ContactId':_0x1afb8c[_0xad73('0xd1')],'ListId':_0x1afb8c[_0xad73('0xd2')],'VoiceQueueId':_0x1afb8c['VoiceQueueId']||undefined,'CampaignId':_0x1afb8c[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0xf9')));_0x2cbdbf({'reschedule':0x1});}}});}if(_0x5a5310[_0xad73('0x54')]===_0xad73('0x79')&&this['campaigns'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0xde')]&&_0x15ca6b[_0xad73('0xe5')]==='HANGUP'){delete this[_0xad73('0x27')][_0x15ca6b[_0xad73('0xdf')]];this[_0xad73('0xb0')](this['campaigns'][_0x5a5310['queue']]);_0x4691bd=new Hangup(_0x5a5310,_0x15ca6b);_0x4691bd['state']=0x12;_0x4691bd[_0xad73('0xa5')]=_0xad73('0xe0');_0x4691bd[_0xad73('0xfa')]=_0xad73('0xe1');ami[_0xad73('0x4d')]('custom:amd',ut['buildObj'](_0x4691bd,_0xad73('0xe3')));this['saveInDb'](_0x4691bd,_0xad73('0xfb'),_0xad73('0xfc'));}if(_0x5a5310[_0xad73('0x54')]==='ivr'&&this['campaigns'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0xde')]&&_0x15ca6b['value']===_0xad73('0xfd')){var _0x5ed223=this;return new BPromise(function(_0x10f3ac,_0x17b014){delete _0x5ed223[_0xad73('0x27')][_0x15ca6b[_0xad73('0xdf')]];_0x5ed223[_0xad73('0xb0')](_0x5ed223[_0xad73('0x21')][_0x5a5310[_0xad73('0xb2')]]);_0x5ed223['campaigns'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;_0x5ed223[_0xad73('0x21')][_0x5a5310['queue']][_0xad73('0x5c')]+=0x1;var _0x27c18c=_0x5ed223[_0xad73('0x21')][_0x5a5310[_0xad73('0xb2')]];var _0x74a682=new Hangup(_0x5a5310,_0x15ca6b);_0x74a682[_0xad73('0xa4')]=0x13;_0x74a682['statedesc']=_0xad73('0xfe');_0x74a682[_0xad73('0xfa')]='AMD';_0x74a682[_0xad73('0xe6')]+=0x1;_0x74a682[_0xad73('0xe7')]+=0x1;_0x74a682[_0xad73('0xe3')]=!![];ami[_0xad73('0x4d')](_0xad73('0xe2'),ut[_0xad73('0xe8')](_0x74a682,_0xad73('0xe3')));_0x5ed223[_0xad73('0xc7')](_0x74a682)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x74a682[_0xad73('0xff')]+_0x74a682[_0xad73('0xea')]+_0x74a682['countnoanswerretry']+_0x74a682[_0xad73('0xec')]+_0x74a682[_0xad73('0xed')]+_0x74a682[_0xad73('0xee')]+_0x74a682[_0xad73('0xe6')]+_0x74a682[_0xad73('0xef')]>=_0x27c18c['dialGlobalMaxRetry']){_0x5ed223[_0xad73('0xf1')](_0x74a682,_0x10f3ac,_0x17b014,_0xad73('0xf2'));}else{if(_0x74a682[_0xad73('0xe6')]>=_0x27c18c['dialMachineMaxRetry']){_0x5ed223[_0xad73('0xf4')](_0x74a682,_0x10f3ac,_0x17b014,'reason\x2019\x20machine....');}else{_0x5ed223[_0xad73('0xbc')]({'active':![],'countmachineretry':_0x74a682[_0xad73('0xe6')],'scheduledat':moment()[_0xad73('0xf5')](_0x27c18c['dialMachineRetryFrequency'],_0xad73('0xf7'))['format'](_0xad73('0xf8')),'ContactId':_0x74a682['ContactId'],'ListId':_0x74a682[_0xad73('0xd2')],'VoiceQueueId':_0x74a682['VoiceQueueId']||undefined,'CampaignId':_0x74a682[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0xf9')));_0x10f3ac({'reschedule':0x1});}}});}}};Dialer[_0xad73('0x1b')][_0xad73('0x39')]=function(_0x4aabc2){var _0x4e3dc4=this[_0xad73('0x27')][_0x4aabc2[_0xad73('0xdf')]];var _0x62c5e1=this;var _0xaeeeb6;if(_0x4e3dc4&&_0x4e3dc4['type']==='ivr'){delete this['uniqueId'][_0x4aabc2['uniqueid']];this[_0xad73('0xb0')](this[_0xad73('0x21')][_0x4e3dc4['queue']]);this[_0xad73('0x21')][_0x4e3dc4['queue']][_0xad73('0x100')]+=0x1;_0xaeeeb6=new Hangup(_0x4e3dc4,_0x4aabc2);this[_0xad73('0xc7')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xad73('0xc6')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch(_0xad73('0x101')));}if(_0x4e3dc4&&_0x4e3dc4[_0xad73('0x54')]!==_0xad73('0x79')&&isNotNull(this[_0xad73('0x20')][_0x4e3dc4[_0xad73('0xb2')]]['dialQueueProject'])){delete this[_0xad73('0x27')][_0x4aabc2[_0xad73('0xdf')]];this[_0xad73('0xb0')](this[_0xad73('0x20')][_0x4e3dc4['queue']]);this[_0xad73('0x20')][_0x4e3dc4[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;this['voiceQueues'][_0x4e3dc4[_0xad73('0xb2')]][_0xad73('0x5c')]+=0x1;_0xaeeeb6=new Hangup(_0x4e3dc4,_0x4aabc2);_0xaeeeb6[_0xad73('0xa4')]=0x10;_0xaeeeb6[_0xad73('0xa5')]=_0xad73('0x102');_0xaeeeb6[_0xad73('0xfa')]=_0xad73('0x103');this[_0xad73('0xc7')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xad73('0xc6')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch(_0xad73('0x101')));}if(_0x4e3dc4&&_0x4e3dc4[_0xad73('0x54')]!==_0xad73('0x79')&&!isNotNull(this[_0xad73('0x20')][_0x4e3dc4[_0xad73('0xb2')]]['dialQueueProject'])){delete this[_0xad73('0x27')][_0x4aabc2[_0xad73('0xdf')]];this[_0xad73('0xb0')](this[_0xad73('0x20')][_0x4e3dc4[_0xad73('0xb2')]]);this[_0xad73('0x20')][_0x4e3dc4['queue']][_0xad73('0x66')]+=0x1;_0xaeeeb6=new Hangup(_0x4e3dc4,_0x4aabc2);_0xaeeeb6[_0xad73('0xa4')]=0xc;_0xaeeeb6['statedesc']=_0x4aabc2[_0xad73('0x104')];_0xaeeeb6['membername']='Unknow';this['createHistory'](_0xaeeeb6)['catch'](loggerCatch(_0xad73('0x105')));this[_0xad73('0xc6')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch(_0xad73('0x101')));}};Dialer[_0xad73('0x1b')][_0xad73('0x35')]=function(_0x149485){var _0x552802=this[_0xad73('0x27')][_0x149485['uniqueid']];var _0x2b6370=this;if(this['voiceQueues'][_0x149485[_0xad73('0xb2')]]){if(_0x552802&&_0x552802[_0xad73('0x54')]!==_0xad73('0x79')){delete this[_0xad73('0x27')][_0x149485[_0xad73('0xdf')]];this[_0xad73('0x20')][_0x149485[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;var _0x4aa571=new AgentComplete(_0x552802,_0x149485);if(_0x149485[_0xad73('0x106')]===_0xad73('0x107')){_0x4aa571[_0xad73('0x108')]=this[_0xad73('0x20')][_0x149485[_0xad73('0xb2')]][_0xad73('0x109')]&&this[_0xad73('0x20')][_0x149485[_0xad73('0xb2')]][_0xad73('0x10a')]?moment()['format'](_0xad73('0xf8')):undefined;}this['createHistory'](_0x4aa571)[_0xad73('0xae')](loggerCatch(_0xad73('0x10b')));this[_0xad73('0xc6')](_0x4aa571)['catch'](loggerCatch(_0xad73('0x10c')));}}};Dialer[_0xad73('0x1b')][_0xad73('0x2e')]=function(_0x5147ca){if(this[_0xad73('0x20')][_0x5147ca[_0xad73('0xb2')]]){if(this[_0xad73('0x27')][_0x5147ca[_0xad73('0xdf')]]&&this[_0xad73('0x27')][_0x5147ca[_0xad73('0xdf')]][_0xad73('0x54')]!=='ivr'){this['updateOriginated'](this[_0xad73('0x20')][_0x5147ca[_0xad73('0xb2')]]);this[_0xad73('0x27')][_0x5147ca[_0xad73('0xdf')]][_0xad73('0x10d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xad73('0x10e')]=function(_0x39a49c){this[_0xad73('0xc7')](_0x39a49c)[_0xad73('0xae')](loggerCatch(_0xad73('0x10b')));this['moveContactManagedDialer'](_0x39a49c)[_0xad73('0xae')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xad73('0x1b')][_0xad73('0x31')]=function(_0x35324f){var _0x1875bb=this[_0xad73('0x27')][_0x35324f[_0xad73('0xdf')]];var _0x59327f=this;if(this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]){if(_0x1875bb&&_0x1875bb[_0xad73('0x54')]!=='ivr'){delete this[_0xad73('0x27')][_0x35324f[_0xad73('0xdf')]];this[_0xad73('0xb0')](this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]);_0x1875bb[_0xad73('0x10f')]=moment()[_0xad73('0x77')](_0xad73('0xf8'));var _0x259842=new QueueCallerAbandon(_0x1875bb,_0x35324f);if(getSeconds(_0x1875bb[_0xad73('0x10f')],_0x1875bb[_0xad73('0x110')])>=_0x1875bb['dialQueueTimeout']){this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xad73('0x20')][_0x35324f['queue']][_0xad73('0x6a')]+=0x1;_0x259842[_0xad73('0xa4')]=0xa;_0x259842[_0xad73('0xa5')]='Drop';_0x259842[_0xad73('0x111')]=_0xad73('0x112');_0x259842[_0xad73('0x108')]=this['voiceQueues'][_0x35324f[_0xad73('0xb2')]][_0xad73('0x109')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x259842['countdropretry']+=0x1;_0x259842[_0xad73('0xe7')]+=0x1;if(_0x259842[_0xad73('0xed')]>=this[_0xad73('0x20')][_0x35324f['queue']][_0xad73('0x113')]){this[_0xad73('0x10e')](_0x259842);}else{this[_0xad73('0xbc')]({'active':![],'countdropretry':_0x259842[_0xad73('0xed')],'scheduledat':moment()['add'](this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]][_0xad73('0x114')],_0xad73('0xf7'))['format'](_0xad73('0xf8')),'ContactId':_0x1875bb[_0xad73('0xd1')],'ListId':_0x1875bb[_0xad73('0xd2')],'VoiceQueueId':_0x1875bb[_0xad73('0x115')]||undefined,'CampaignId':_0x1875bb['CampaignId']||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x116')));var _0x5c22cc=new History(_0x259842);_0x5c22cc[_0xad73('0xa4')]=0xa;_0x5c22cc[_0xad73('0xa5')]=_0xad73('0x117');_0x5c22cc[_0xad73('0xa6')]=moment()[_0xad73('0x77')](_0xad73('0xf8'));_0x5c22cc['endtime']=_0x5c22cc['starttime'];_0x5c22cc[_0xad73('0x118')]=_0x259842[_0xad73('0x118')];_0x5c22cc[_0xad73('0x119')]=_0x259842[_0xad73('0x119')];this['createHistory'](_0x5c22cc)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x35324f['queue']][_0xad73('0x11a')]+=0x1;_0x259842['state']=0xb;_0x259842[_0xad73('0xa5')]=_0xad73('0x11b');_0x259842[_0xad73('0x111')]=_0xad73('0x11c');_0x259842[_0xad73('0xee')]+=0x1;_0x259842['countglobal']+=0x1;if(_0x259842['countabandonedretry']>=this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]][_0xad73('0x11d')]){this[_0xad73('0x10e')](_0x259842);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x259842['countabandonedretry'],'scheduledat':moment()[_0xad73('0xf5')](this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]][_0xad73('0x11e')],_0xad73('0xf7'))['format'](_0xad73('0xf8')),'ContactId':_0x1875bb[_0xad73('0xd1')],'ListId':_0x1875bb[_0xad73('0xd2')],'VoiceQueueId':_0x1875bb['VoiceQueueId']||undefined,'CampaignId':_0x1875bb['CampaignId']||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x11f')));var _0x5c22cc=new History(_0x259842);_0x5c22cc[_0xad73('0xa4')]=0xb;_0x5c22cc[_0xad73('0xa5')]=_0xad73('0x11b');_0x5c22cc[_0xad73('0xa6')]=moment()[_0xad73('0x77')](_0xad73('0xf8'));_0x5c22cc['endtime']=_0x5c22cc[_0xad73('0xa6')];_0x5c22cc[_0xad73('0x118')]=_0x259842[_0xad73('0x118')];_0x5c22cc[_0xad73('0x119')]=_0x259842[_0xad73('0x119')];this['createHistory'](_0x5c22cc)[_0xad73('0xae')](loggerCatch(_0xad73('0x120')));}}}}};Dialer[_0xad73('0x1b')][_0xad73('0x3b')]=function(_0x367c89){if(this[_0xad73('0xa9')][_0x367c89['uniqueid']]){this[_0xad73('0xa9')][_0x367c89[_0xad73('0xdf')]][_0xad73('0x121')]=_0x367c89['channel'];}if(this[_0xad73('0x27')][_0x367c89[_0xad73('0xdf')]]){this['uniqueId'][_0x367c89['uniqueid']][_0xad73('0x121')]=_0x367c89[_0xad73('0x121')];}};Dialer[_0xad73('0x1b')][_0xad73('0x122')]=function(_0x272ab7){if(strategy[this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]]['queue']][_0xad73('0x124')]]===_0xad73('0x1a')){if(this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]]&&_[_0xad73('0xac')](this[_0xad73('0xa9')][_0x272ab7['actionid']][_0xad73('0x125')])&&_0x272ab7[_0xad73('0xad')]==='1'&&_0x272ab7[_0xad73('0x126')]==='0'){if(this[_0xad73('0x22')][_0x272ab7[_0xad73('0x127')]]){if(!this[_0xad73('0x22')][_0x272ab7[_0xad73('0x127')]][_0xad73('0x125')]){this[_0xad73('0x22')][_0x272ab7['stateinterface']][_0xad73('0x125')]=!![];this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]][_0xad73('0x125')]=!![];this[_0xad73('0xa9')][_0x272ab7['actionid']][_0xad73('0x127')]=_0x272ab7[_0xad73('0x127')];}}}}else if((strategy[this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]][_0xad73('0xb2')]][_0xad73('0x124')]]||_0xad73('0x19'))===_0xad73('0x19')){if(this['actions'][_0x272ab7[_0xad73('0x123')]]){if(this[_0xad73('0x22')][_0x272ab7['stateinterface']]){this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]][_0xad73('0x127')]=_0x272ab7[_0xad73('0x127')];if(_[_0xad73('0xac')](this['queueBooked'][this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]][_0xad73('0xb2')]])){this['queueBooked'][this['actions'][_0x272ab7[_0xad73('0x123')]][_0xad73('0xb2')]]=[];}this[_0xad73('0x2c')][this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]]['queue']][_0xad73('0x128')](_['merge'](_[_0xad73('0xd0')](this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]],[_0xad73('0x129'),_0xad73('0x127')]),{'status':_0x272ab7[_0xad73('0xad')],'paused':_0x272ab7[_0xad73('0x126')]}));}}}};function unlockQueueStatus(_0x226ebe,_0xb440ae){setTimeout(function(){if(_[_0xad73('0x86')](_0x226ebe[_0xad73('0x12a')])){loggerBooked['error'](_0xad73('0x12b'),_0xb440ae);}_0x226ebe[_0xad73('0x12a')]=!![];loggerBooked[_0xad73('0x7c')](_0xad73('0x12c'),_0xb440ae,JSON['stringify'](_[_0xad73('0xd0')](_0x226ebe,[_0xad73('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x42fe47){var _0x5e20b1=this;var _0x4a2b54=_0x5e20b1[_0xad73('0x20')][_0x5e20b1[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]];if(strategy[this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]][_0xad73('0x124')]]===_0xad73('0x1a')){if(this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]&&this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0x127')]){this[_0xad73('0x1f')][_0xad73('0x12d')](this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0x129')],this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0x127')])[_0xad73('0xae')](function(_0x1b5cd4){logger[_0xad73('0x92')](_0xad73('0x12e'),util['inspect'](_0x1b5cd4,{'showHidden':![],'depth':null}));})[_0xad73('0x1d')](function(){_0x5e20b1[_0xad73('0xb0')](_0x5e20b1['voiceQueues'][_0x5e20b1[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]]);_0x5e20b1['agents'][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['stateinterface']][_0xad73('0x125')]=![];delete _0x5e20b1[_0xad73('0xa9')][_0x42fe47['actionid']];unlockQueueStatus(_0x4a2b54);});}else{this['updateOriginated'](this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]]);this[_0xad73('0xbc')]({'active':![],'ContactId':this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xd1')],'ListId':this['actions'][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd2')],'VoiceQueueId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0x115')]||undefined,'CampaignId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x12f')));delete this[_0xad73('0xa9')][_0x42fe47['actionid']];unlockQueueStatus(_0x4a2b54);}}else if((strategy[this['voiceQueues'][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']][_0xad73('0x124')]]||_0xad73('0x19'))===_0xad73('0x19')){var _0x5560a3;if(this['actions'][_0x42fe47[_0xad73('0x123')]]&&!_[_0xad73('0x7b')](this[_0xad73('0x2c')][this['actions'][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]])){if(this['queueBookedRR'][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]]){this[_0xad73('0x130')][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']]=this['queueBookedRR'][this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]]?this[_0xad73('0x130')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']]:this[_0xad73('0x2c')][this['actions'][_0x42fe47[_0xad73('0x123')]]['queue']]?this['queueBooked'][this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]][_0xad73('0x131')]||0x0:0x0;}this[_0xad73('0x2c')][this['actions'][_0x42fe47['actionid']][_0xad73('0xb2')]]['_rr']=this[_0xad73('0x130')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]];for(var _0x5cdeb8=0x0;_0x5cdeb8<this[_0xad73('0x2c')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']]['length'];_0x5cdeb8+=0x1){_0x5560a3=rr(this[_0xad73('0x2c')][this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]]);this[_0xad73('0x130')][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]]=this[_0xad73('0x2c')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]][_0xad73('0x131')];if(_0x5560a3[_0xad73('0xad')]==='1'&&_0x5560a3[_0xad73('0x126')]==='0'){break;}}if(!_[_0xad73('0xac')](_0x5560a3)){this[_0xad73('0x22')][_0x5560a3[_0xad73('0x127')]][_0xad73('0x132')]=_[_0xad73('0x86')](this[_0xad73('0x22')][_0x5560a3['stateinterface']][_0xad73('0x132')])?!![]:this[_0xad73('0x22')][_0x5560a3[_0xad73('0x127')]]['unlockRR'];}loggerBooked[_0xad73('0x7c')](_0xad73('0x133'),_0x42fe47[_0xad73('0x123')],_0xad73('0x134'),JSON['stringify'](_['pick'](this[_0xad73('0x22')][_0x5560a3[_0xad73('0x127')]],[_0xad73('0x40'),_0xad73('0x132')])),_0xad73('0x135'),JSON['stringify'](_0x5560a3[_0xad73('0x129')]));if(!_[_0xad73('0xac')](_0x5560a3)&&_0x5560a3[_0xad73('0xad')]==='1'&&_0x5560a3[_0xad73('0x126')]==='0'&&this[_0xad73('0x22')][_0x5560a3[_0xad73('0x127')]][_0xad73('0x132')]){this['agents'][_0x5560a3[_0xad73('0x127')]][_0xad73('0x132')]=![];this['queueBooked'][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']]=[];this['preview'][_0xad73('0x12d')](_0x5560a3[_0xad73('0x129')],_0x5560a3[_0xad73('0x127')])[_0xad73('0xae')](function(_0x350116){logger[_0xad73('0x92')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xad73('0x93')](_0x350116,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5e20b1[_0xad73('0xb0')](_0x5e20b1['voiceQueues'][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]]);setTimeout(function(){_0x5e20b1[_0xad73('0x22')][_0x5560a3[_0xad73('0x127')]][_0xad73('0x132')]=!![];loggerBooked[_0xad73('0x7c')](_0xad73('0x136'),_0x42fe47[_0xad73('0x123')],_0xad73('0x134'),JSON[_0xad73('0x49')](_[_0xad73('0xd0')](_0x5e20b1[_0xad73('0x22')][_0x5560a3[_0xad73('0x127')]],[_0xad73('0x40'),'unlockRR'])),_0xad73('0x135'),JSON['stringify'](_0x5560a3[_0xad73('0x129')]));},0xc7);delete _0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]];unlockQueueStatus(_0x4a2b54,_0x42fe47['actionid']);});}else{loggerBooked[_0xad73('0x7c')](_0xad73('0x137'));this[_0xad73('0xb0')](this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]]);this[_0xad73('0xbc')]({'active':![],'ContactId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['ContactId'],'ListId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd2')],'VoiceQueueId':this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0x115')]||undefined,'CampaignId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x12f')));delete this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]];unlockQueueStatus(_0x4a2b54);}}else{loggerBooked['info'](_0xad73('0x138'));this[_0xad73('0xb0')](this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']]);this[_0xad73('0xbc')]({'active':![],'ContactId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['ContactId'],'ListId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd2')],'VoiceQueueId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0x115')]||undefined,'CampaignId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]];unlockQueueStatus(_0x4a2b54);}}else{loggerBooked[_0xad73('0x7c')]('[booked][unlock3]');this['updateOriginated'](this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd1')],'ListId':this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xd2')],'VoiceQueueId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0x115')]||undefined,'CampaignId':this[_0xad73('0xa9')][_0x42fe47['actionid']]['CampaignId']||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x139')));delete this[_0xad73('0xa9')][_0x42fe47['actionid']];unlockQueueStatus(_0x4a2b54);}};Dialer[_0xad73('0x1b')][_0xad73('0x3d')]=function(){var _0x473a17=this;setInterval(function(){_0x473a17[_0xad73('0x13a')]();},0x3e8);};Dialer[_0xad73('0x1b')][_0xad73('0x13b')]=function(_0x35fdeb){var _0x1a0e88=this;return function(){if(!_0x1a0e88['isTrunkReachable'](_0x35fdeb[_0xad73('0x73')])){if(!_0x1a0e88[_0xad73('0xd7')](_0x35fdeb[_0xad73('0x13c')])){_0x35fdeb[_0xad73('0x3f')]=_0xad73('0x13d');throw _0x35fdeb[_0xad73('0x40')]+_0xad73('0x13e');}}};};Dialer['prototype']['checkIfTime']=function(_0x11b14b,_0x151708,_0x4ea513,_0x32f732){var _0x19fc34=this;return function(){var _0x1e4d32=!![];return _0x19fc34[_0xad73('0x13f')](_0x11b14b,_0x151708,_0x4ea513,_0x32f732,_0x1e4d32);};};Dialer[_0xad73('0x1b')][_0xad73('0x140')]=function(_0x12bec9,_0x38b28c,_0x116401,_0x4d0915){var _0x3d3835=this;return function(){var _0x239606=![];return _0x3d3835[_0xad73('0x13f')](_0x12bec9[_0xad73('0x45')],_0x38b28c,_0x116401,_0x4d0915,_0x239606);};};Dialer['prototype'][_0xad73('0x13f')]=function(_0x313962,_0x4da109,_0x18fed5,_0x20e7f8,_0xfc14e1){var _0x307b4d=[];return new BPromise(function(_0x36fa7b,_0x560e91){if(!isNotNull(_0x313962)){_0x20e7f8['message']='INTERVAL_IS_NULL';return _0x560e91(msgResponse('ifTime',_0xad73('0x141'),_0x18fed5+_0xad73('0x142')));}if(_[_0xad73('0x7b')](_0x313962)){_0x20e7f8[_0xad73('0x3f')]=_0xad73('0x143');return _0x560e91(msgResponse(_0xad73('0x13f'),_0xad73('0x141'),_0x18fed5+_0xad73('0x144')));}if(_0x4da109&&_['isUndefined'](config[_0xad73('0x145')][_0x4da109])){_0x20e7f8['message']=_0xad73('0x146');return _0x560e91(msgResponse(_0xad73('0x13f'),_0xad73('0x141'),_0x18fed5+'\x20Timezone\x20unknow\x20'+_0x4da109));}if(_['isArray'](_0x313962)){for(var _0x3f0be8=0x0;_0x3f0be8<_0x313962[_0xad73('0x95')];_0x3f0be8+=0x1){_0x307b4d['push'](ami['Action']({'action':_0xad73('0x147'),'command':util[_0xad73('0x77')](_0xad73('0x148'),_0x313962[_0x3f0be8][_0xad73('0x149')],!_[_0xad73('0x86')](config[_0xad73('0x145')][_0x4da109])?_0x4da109:'')})['then'](function(_0x39a519){return _0x39a519[_0xad73('0x14a')][_0xad73('0x14b')](_0xad73('0x14c'))>=0x0;})[_0xad73('0xae')](myreject(_0x560e91)));}}else{_0x307b4d[_0xad73('0x128')](ami[_0xad73('0x14d')]({'action':'command','command':util['format'](_0xad73('0x148'),_0x313962,!_[_0xad73('0x86')](config[_0xad73('0x145')][_0x4da109])?_0x4da109:'')})[_0xad73('0xb6')](function(_0x40f699){return _0x40f699['content'][_0xad73('0x14b')](_0xad73('0x14c'))>=0x0;})['catch'](myreject(_0x560e91)));}BPromise[_0xad73('0x14e')](_0x307b4d)[_0xad73('0xb6')](function(_0x4532fd){var _0x1e7f0e=_[_0xad73('0x14f')](_0x4532fd);if(_0x1e7f0e){return _0x36fa7b(_0x1e7f0e);}else{_0x20e7f8[_0xad73('0x3f')]=_0xfc14e1?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x560e91(msgResponse(_0xad73('0x150'),_0xad73('0x141'),_0xad73('0x151')+_0xfc14e1+'\x20'+_0x18fed5+_0xad73('0x152')+util['inspect'](_0x313962,{'showHidden':![],'depth':null})+_0xad73('0x153')+_0x4da109));}})[_0xad73('0xae')](function(_0x56457c){return _0x560e91(msgResponse('ifTime',_0xad73('0x141'),JSON[_0xad73('0x49')](_0x56457c)));});});};Dialer[_0xad73('0x1b')]['checkDialMethod']=function(_0x5d8d72){var _0x2207d0=this;return function(){switch(_0x5d8d72[_0xad73('0x58')]){case'progressive':freeVariablesPredictive(_0x5d8d72);_0x2207d0['handlePower'](_0x5d8d72,0x1);break;case _0xad73('0x154'):freeVariablesPredictive(_0x5d8d72);_0x2207d0[_0xad73('0x155')](_0x5d8d72,_0x5d8d72[_0xad73('0x156')]);break;case'predictive':_0x2207d0[_0xad73('0xa')](_0x5d8d72);break;case _0xad73('0x9'):freeVariablesPredictive(_0x5d8d72);_0x2207d0[_0xad73('0x155')](_0x5d8d72,0x1);break;default:freeVariablesPredictive(_0x5d8d72);logger['error'](_0xad73('0x157'),_0x5d8d72['name'],_0xad73('0x158'));}};};Dialer[_0xad73('0x1b')][_0xad73('0x159')]=function(_0x2f206e){var _0x4903b9=this;return function(){_0x4903b9[_0xad73('0x15a')](_0x2f206e);};};Dialer['prototype']['syncQueueSummary']=function(_0x26675f){var _0x13e23e=this;if(isNotPreview(_0x26675f[_0xad73('0x58')])){if(isVoiceQueueOutbound(_0x26675f[_0xad73('0x54')])&&isActive(_0x26675f[_0xad73('0x15b')])){_0x26675f[_0xad73('0x9c')]=!![];BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](checkIsLoggedIn(_0x26675f,_0x26675f[_0xad73('0x15c')]))['then'](checkIsActive(_0x26675f,_0x26675f[_0xad73('0x15b')]))[_0xad73('0xb6')](checkInterval(_0x26675f))['then'](_0x13e23e[_0xad73('0x13b')](_0x26675f))[_0xad73('0xb6')](_0x13e23e[_0xad73('0x15d')](_0x26675f[_0xad73('0x15e')],_0x26675f['dialTimezone'],_0x26675f[_0xad73('0x40')],_0x26675f))[_0xad73('0xb6')](_0x13e23e[_0xad73('0x140')](_0x26675f['Interval'],_0x26675f[_0xad73('0x15f')],_0x26675f[_0xad73('0x40')],_0x26675f))['then'](_0x13e23e[_0xad73('0x160')](_0x26675f))[_0xad73('0xae')](loggerCatchQueueSummary(_0xad73('0x161'),_0x26675f));}else{notSendMessagesQueue(_0x26675f);}}else{freeVariablesPredictive(_0x26675f);}};Dialer[_0xad73('0x1b')][_0xad73('0x13a')]=function(){var _0x31e06b=this;var _0x413423;for(var _0x243bf8 in this['campaigns']){if(typeof this[_0xad73('0x21')][_0x243bf8]!==_0xad73('0xc9')){_0x413423=this[_0xad73('0x21')][_0x243bf8];if(isCampaignIvr(_0x413423[_0xad73('0x54')])&&isActive(_0x413423[_0xad73('0x74')])){_0x413423[_0xad73('0x9c')]=!![];BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](checkIsActive(_0x413423,_0x413423['active']))[_0xad73('0xb6')](checkInterval(_0x413423))[_0xad73('0xb6')](_0x31e06b[_0xad73('0x13b')](_0x413423))[_0xad73('0xb6')](_0x31e06b[_0xad73('0x15d')](_0x413423[_0xad73('0x15e')],_0x413423[_0xad73('0x15f')],_0x413423['name'],_0x413423))[_0xad73('0xb6')](_0x31e06b['checkIfTimeIntervals'](_0x413423[_0xad73('0x43')],_0x413423['dialTimezone'],_0x413423[_0xad73('0x40')],_0x413423))[_0xad73('0xb6')](_0x31e06b[_0xad73('0x159')](_0x413423))[_0xad73('0xae')](loggerCatchQueueSummary(_0xad73('0x162'),_0x413423));}else{notSendMessagesCampaign(_0x413423);}}}};function getCallerIdRandom(_0x762349,_0x244be1){var _0x4e997e;var _0x3cc7e7;var _0x529761;if(_0x244be1<=0x0){_0x244be1=0x1;}_0x4e997e=new RegExp(_0xad73('0x163')+_0x244be1+'}$');_0x3cc7e7=Math['pow'](0xa,_0x244be1-0x1);_0x529761=Math[_0xad73('0x164')](0xa,_0x244be1)-0x1;return util[_0xad73('0x77')]('%s',_[_0xad73('0x165')](_0x762349,_0x4e997e,_[_0xad73('0x166')](_0x3cc7e7,_0x529761)));}function extractCalleridName(_0x294247){var _0x138247=_0x294247[_0xad73('0x167')](/"(.*?)"/);return _0x138247?_0x138247[0x1]:_0x294247;}function extractCalleridNumber(_0x59758c){var _0x34a491=_0x59758c[_0xad73('0x167')](/<(.*?)>/);return _0x34a491?_0x34a491[0x1]:_0x59758c;}Dialer['prototype'][_0xad73('0x168')]=function(_0x46b900,_0x8a0338){var _0xdc7c29=this;var _0x3af27d=uuid['v4']();this[_0xad73('0xa9')][_0x3af27d]=new Action(_0x46b900,_0x8a0338,_0x3af27d);return new BPromise(function(_0x1ae46a,_0x57cf87){if(_[_0xad73('0x86')](_0x46b900)&&typeof _0x46b900!==_0xad73('0x169')){return _0x57cf87(msgResponse(_0xad73('0x16a'),_0xad73('0x141'),_0xad73('0x16b')));}if(_[_0xad73('0x86')](_0x8a0338[_0xad73('0x16c')]['phone'])||_0x8a0338[_0xad73('0x16c')]['phone']===null){return _0x57cf87(msgResponse('originate','Failure','contact\x20is\x20undefine'));}var _0xcdca47={'XMD-CALLERID':_0xdc7c29['actions'][_0x3af27d][_0xad73('0x16d')](),'XMD-AGI':_0x46b900[_0xad73('0x16e')]?util[_0xad73('0x77')](_0xad73('0x16f'),ipAgi,_0x46b900[_0xad73('0x16e')]):_0xad73('0x170'),'XMD-AGIAFTER':_0x46b900[_0xad73('0x109')]?util[_0xad73('0x77')](_0xad73('0x16f'),ipAgi,_0x46b900['dialQueueProject2']):_0xad73('0x170'),'XMD-QUEUE':_0x46b900[_0xad73('0x54')]===_0xad73('0x4e')?util['format'](_0xad73('0x171'),_0x46b900['name'],_0x46b900['dialQueueOptions']||'',_0x46b900[_0xad73('0x10a')]?'c':'',_0x46b900[_0xad73('0x172')]||0x3):_0xad73('0x170'),'XMD-CONTACTID':_0x8a0338[_0xad73('0xd1')],'XMD-CDRTYPE':_0xad73('0x8'),'CALLERID(all)':_0xdc7c29[_0xad73('0xa9')][_0x3af27d][_0xad73('0x16d')](),'XMD-AMD':_0x46b900[_0xad73('0xde')]?_0xad73('0x173'):_0xad73('0x170'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x46b900[_0xad73('0xde')]){_0xcdca47['XMD-AMDINITIALSILENCE']=_0x46b900['dialAMDInitialSilence']||0x9c4;_0xcdca47['XMD-AMDGREETING']=_0x46b900[_0xad73('0x174')]||0x5dc;_0xcdca47[_0xad73('0x175')]=_0x46b900[_0xad73('0x176')]||0x320;_0xcdca47[_0xad73('0x177')]=_0x46b900[_0xad73('0x178')]||0x1388;_0xcdca47[_0xad73('0x179')]=_0x46b900[_0xad73('0x17a')]||0x64;_0xcdca47[_0xad73('0x17b')]=_0x46b900[_0xad73('0x17c')]||0x32;_0xcdca47['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x46b900['dialAMDMaximumNumberOfWords']||0x3;_0xcdca47[_0xad73('0x17d')]=_0x46b900[_0xad73('0x17e')]||0x100;_0xcdca47['XMD-AMDMAXIMUMWORDLENGTH']=_0x46b900[_0xad73('0x17f')]||0x1388;}if(_0x46b900[_0xad73('0x54')]===_0xad73('0x4e')){_0xcdca47[_0xad73('0x180')]=_0x8a0338['VoiceQueueId'];}else{_0xcdca47[_0xad73('0x181')]=_0x8a0338['CampaignId'];}for(var _0x357715 in _0x8a0338['Contact']){if(typeof _0x8a0338[_0xad73('0x16c')][_0x357715]!==_0xad73('0xc9')){if(isNotNull(_0x8a0338[_0xad73('0x16c')][_0x357715])&&_0x357715!=='id'&&_0x357715!==_0xad73('0x182')&&_0x357715!==_0xad73('0x183')&&_0x357715!==_0xad73('0x184')){_0xcdca47[util['format'](_0xad73('0x185'),_0xad73('0x186'),_['toUpper'](_0x357715))]=_0x8a0338['Contact'][_0x357715];}}}var _0x51f652=_0xdc7c29[_0xad73('0xd7')](_0x46b900[_0xad73('0x73')])?getCallerId(_0x46b900[_0xad73('0x73')]['callerid'],_0x46b900[_0xad73('0x59')],_0x46b900[_0xad73('0x187')]>0x0?getCallerIdRandom(_0x46b900[_0xad73('0x5a')],_0x46b900[_0xad73('0x187')]):_0x46b900[_0xad73('0x5a')]):getCallerId(_[_0xad73('0xac')](_0x46b900['TrunkBackup'])?_0x46b900[_0xad73('0x73')][_0xad73('0x75')]:_0x46b900[_0xad73('0x13c')][_0xad73('0x75')],_0x46b900['dialOriginateCallerIdName'],_0x46b900['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x46b900[_0xad73('0x5a')],_0x46b900[_0xad73('0x187')]):_0x46b900['dialOriginateCallerIdNumber']);if(_0x51f652){_0xcdca47[_0xad73('0x188')]=_0xdc7c29[_0xad73('0xa9')][_0x3af27d]['originatecalleridname']=extractCalleridName(_0x51f652);_0xcdca47[_0xad73('0x189')]=_0xdc7c29[_0xad73('0xa9')][_0x3af27d][_0xad73('0x18a')]=extractCalleridNumber(_0x51f652);}return ami['Action']({'actionid':_0x3af27d,'action':_0xad73('0x16a'),'channel':_0xdc7c29[_0xad73('0xd7')](_0x46b900[_0xad73('0x73')])?util[_0xad73('0x77')]('SIP/%s/%s%s',_0x46b900['Trunk'][_0xad73('0x40')],isNotNull(_0x46b900['dialPrefix'])?_0x46b900[_0xad73('0x5b')][_0xad73('0x18b')]()||'':'',_0x46b900['dialCutDigit']>0x0?_0x8a0338[_0xad73('0x16c')][_0xad73('0x18c')][_0xad73('0x18d')](_0x46b900['dialCutDigit']):_0x8a0338['Contact'][_0xad73('0x18c')]):util[_0xad73('0x77')](_0xad73('0x18e'),_['isNil'](_0x46b900[_0xad73('0x13c')])?_0x46b900[_0xad73('0x73')][_0xad73('0x40')]:_0x46b900[_0xad73('0x13c')][_0xad73('0x40')],isNotNull(_0x46b900[_0xad73('0x5b')])?_0x46b900[_0xad73('0x5b')]['trim']()||'':'',_0x46b900[_0xad73('0x18f')]>0x0?_0x8a0338[_0xad73('0x16c')]['phone'][_0xad73('0x18d')](_0x46b900['dialCutDigit']):_0x8a0338[_0xad73('0x16c')][_0xad73('0x18c')]),'callerid':_0x51f652,'Exten':'xcally-motion-dialer','Context':_0xad73('0x190'),'Priority':'1','variable':_0xcdca47,'timeout':(_0x46b900[_0xad73('0x191')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3af27d})[_0xad73('0xb6')](function(_0x5d8aae){return _0x1ae46a(_0x5d8aae);})['catch'](function(_0xd4221b){_0x46b900[_0xad73('0x63')]+=0x1;var _0x3fcb6f=new History(_0xdc7c29[_0xad73('0xa9')][_0x3af27d]);logger[_0xad73('0x92')](util[_0xad73('0x77')](_0xad73('0x192'),JSON['stringify'](_0xd4221b)));_0x3fcb6f[_0xad73('0xa4')]=0xe;_0x3fcb6f[_0xad73('0xa5')]=_0xad73('0x193');_0x3fcb6f[_0xad73('0xa6')]=moment()['format'](_0xad73('0xf8'));_0x3fcb6f['endtime']=_0x3fcb6f[_0xad73('0xa6')];_0xdc7c29[_0xad73('0xc7')](_0x3fcb6f)[_0xad73('0xae')](loggerCatch('[originate][error]'));_0xdc7c29['moveContactManagedDialer'](_0x3fcb6f)[_0xad73('0xae')](loggerCatch(_0xad73('0x194')))['finally'](function(){delete _0xdc7c29[_0xad73('0xa9')][_0x3af27d];return _0x57cf87(msgResponse('originate',_0xad73('0x48'),_0xad73('0x195')));});});});};Dialer[_0xad73('0x1b')][_0xad73('0x33')]=function(_0x303627){var _0x22bf7a=this[_0xad73('0xa9')][_0x303627['actionid']];if(_0x22bf7a){delete this[_0xad73('0xa9')][_0x303627[_0xad73('0x123')]];_0x22bf7a[_0xad73('0x110')]=moment()[_0xad73('0x77')](_0xad73('0xf8'));var _0x564a9d=_0x22bf7a[_0xad73('0x54')]===_0xad73('0x79')?this[_0xad73('0x21')][_0x22bf7a[_0xad73('0xb2')]]:this['voiceQueues'][_0x22bf7a[_0xad73('0x196')]()];if(!this[_0xad73('0xd6')](_0x303627[_0xad73('0x197')])){this[_0xad73('0xb0')](_0x564a9d);return this[_0xad73('0x198')](_0x22bf7a,_0x564a9d,_0x303627)['catch'](loggerCatch(_0xad73('0x199')));}this[_0xad73('0x27')][_0x303627[_0xad73('0xdf')]]=_0x22bf7a;}};Dialer[_0xad73('0x1b')][_0xad73('0x19a')]=function(_0x459ed8,_0x350c80,_0x5c585d){var _0x595421=new History(_0x350c80);if(_0x595421[_0xad73('0xff')]+_0x595421[_0xad73('0xea')]+_0x595421[_0xad73('0xeb')]+_0x595421['countnosuchnumberretry']+_0x595421[_0xad73('0xed')]+_0x595421[_0xad73('0xee')]+_0x595421[_0xad73('0xe6')]+_0x595421[_0xad73('0xef')]>=_0x5c585d['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x459ed8){case 0x3:if(_0x595421[_0xad73('0xeb')]>=_0x5c585d[_0xad73('0x19b')]-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countnoanswerretry':_0x595421[_0xad73('0xeb')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0x19c')],_0xad73('0xf7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x595421['ContactId'],'ListId':_0x595421['ListId'],'VoiceQueueId':_0x595421[_0xad73('0x115')]||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x19d')));break;case 0x5:if(_0x595421[_0xad73('0xff')]>=_0x5c585d[_0xad73('0x19e')]-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countbusyretry':_0x595421['countbusyretry']+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d['dialBusyRetryFrequency'],_0xad73('0xf7'))[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x595421[_0xad73('0xd1')],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421['VoiceQueueId']||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})['catch'](loggerCatch(_0xad73('0x19f')));break;case 0x8:if(_0x595421[_0xad73('0xea')]>=_0x5c585d['dialCongestionMaxRetry']-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countcongestionretry':_0x595421[_0xad73('0xea')]+=0x1,'scheduledat':moment()['add'](_0x5c585d[_0xad73('0x1a0')],_0xad73('0xf7'))[_0xad73('0x77')](_0xad73('0xf8')),'ContactId':_0x595421[_0xad73('0xd1')],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421['VoiceQueueId']||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x595421[_0xad73('0xec')]>=_0x5c585d[_0xad73('0x1a1')]-0x1){return!![];}else{this[_0xad73('0xbc')]({'active':![],'countnosuchnumberretry':_0x595421[_0xad73('0xec')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0x1a2')],_0xad73('0xf7'))['format'](_0xad73('0xf8')),'ContactId':_0x595421['ContactId'],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421['VoiceQueueId']||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})['catch'](loggerCatch(_0xad73('0x1a3')));}break;case 0xa:if(_0x595421[_0xad73('0xed')]>=_0x5c585d['dialDropMaxRetry']-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countdropretry':_0x595421[_0xad73('0xed')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0x114')],'minutes')[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x595421[_0xad73('0xd1')],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421['VoiceQueueId']||undefined,'CampaignId':_0x595421['CampaignId']||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x116')));break;case 0xb:if(_0x595421['countabandonedretry']>=_0x5c585d[_0xad73('0x11d')]-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countabandonedretry':_0x595421[_0xad73('0xee')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0x11e')],_0xad73('0xf7'))[_0xad73('0x77')](_0xad73('0xf8')),'ContactId':_0x595421[_0xad73('0xd1')],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421[_0xad73('0x115')]||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x11f')));break;case 0x13:if(_0x595421[_0xad73('0xe6')]>=_0x5c585d[_0xad73('0xf3')]-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countmachineretry':_0x595421['countmachineretry']+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0xf6')],_0xad73('0xf7'))[_0xad73('0x77')](_0xad73('0xf8')),'ContactId':_0x595421['ContactId'],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421[_0xad73('0x115')]||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0xf9')));break;case 0x14:if(_0x595421[_0xad73('0xef')]>=_0x5c585d['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countagentrejectretry':_0x595421[_0xad73('0xef')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d['dialAgentRejectRetryFrequency'],'minutes')[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x595421['ContactId'],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421[_0xad73('0x115')]||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x1a4')));break;default:return!![];}};Dialer[_0xad73('0x1b')][_0xad73('0x198')]=function(_0x29995c,_0x43c8af,_0x45fb4e){var _0x3e661d=this;var _0x2741e6=new History(_0x29995c);return new BPromise(function(_0x18f53c,_0x33778d){if(_[_0xad73('0x86')](_0x43c8af)&&typeof _0x43c8af!==_0xad73('0x169')){return _0x33778d(msgResponse(_0xad73('0x1a5'),_0xad73('0x141'),_0xad73('0x1a6')));}if(_['isUndefined'](_0x45fb4e)&&typeof _0x45fb4e!==_0xad73('0x169')){return _0x33778d(msgResponse(_0xad73('0x1a5'),_0xad73('0x141'),_0xad73('0x1a7')));}switch(_0x45fb4e[_0xad73('0x106')]){case'0':_0x43c8af['outboundNoSuchCallsDay']+=0x1;_0x2741e6[_0xad73('0xa4')]=0x0;_0x2741e6[_0xad73('0xa5')]=_0xad73('0x1a8');_0x2741e6[_0xad73('0xec')]+=0x1;_0x2741e6['countglobal']+=0x1;ami[_0xad73('0x4d')](_0xad73('0x1a9'),ut[_0xad73('0xe8')](_0x29995c,_0xad73('0x1aa')));_0x3e661d['createHistory'](_0x2741e6)[_0xad73('0xae')](loggerCatch(_0xad73('0xe9')));if(_0x3e661d[_0xad73('0x19a')](0x0,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xec')]>=_0x43c8af['dialNoSuchNumberMaxRetry']){_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1ab'));}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1ab'));}}break;case'3':_0x43c8af['outboundNoAnswerCallsDay']+=0x1;_0x2741e6[_0xad73('0xa4')]=0x3;_0x2741e6[_0xad73('0xa5')]=_0xad73('0x1ac');_0x2741e6[_0xad73('0xeb')]+=0x1;_0x2741e6[_0xad73('0xe7')]+=0x1;ami['emit'](_0xad73('0x1ad'),ut[_0xad73('0xe8')](_0x29995c,_0xad73('0x1ae')));_0x3e661d['createHistory'](_0x2741e6)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3e661d[_0xad73('0x19a')](0x3,_0x29995c,_0x43c8af)){if(_0x2741e6['countnoanswerretry']>=_0x43c8af[_0xad73('0x19b')]){_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1af'));}else{_0x3e661d['stateGlobal'](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1af'));}}break;case'5':_0x43c8af[_0xad73('0x5f')]+=0x1;_0x2741e6[_0xad73('0xa4')]=0x5;_0x2741e6['statedesc']=_0xad73('0x1b0');_0x2741e6[_0xad73('0xff')]+=0x1;_0x2741e6['countglobal']+=0x1;ami[_0xad73('0x4d')](_0xad73('0x1b1'),ut['buildObj'](_0x29995c,_0xad73('0x1b2')));_0x3e661d[_0xad73('0xc7')](_0x2741e6)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3e661d[_0xad73('0x19a')](0x5,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xff')]>=_0x43c8af[_0xad73('0x19e')]){_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,'reason\x205\x20busy');}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,'reason\x205\x20busy');}}break;case'8':_0x43c8af[_0xad73('0x1b3')]+=0x1;_0x2741e6[_0xad73('0xa4')]=0x8;_0x2741e6[_0xad73('0xa5')]=_0xad73('0x1b4');_0x2741e6[_0xad73('0xea')]+=0x1;_0x2741e6[_0xad73('0xe7')]+=0x1;ami[_0xad73('0x4d')](_0xad73('0x1b5'),ut['buildObj'](_0x29995c,_0xad73('0x1b6')));_0x3e661d[_0xad73('0xc7')](_0x2741e6)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x3e661d['checkRetriveMax'](0x8,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xea')]>=_0x43c8af[_0xad73('0x1b7')]){_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1b8'));}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1b8'));}}break;case'11':_0x43c8af[_0xad73('0x1b9')]+=0x1;_0x2741e6[_0xad73('0xa4')]=0xb;_0x2741e6[_0xad73('0xa5')]=_0xad73('0x11b');_0x2741e6[_0xad73('0xee')]+=0x1;_0x2741e6[_0xad73('0xe7')]+=0x1;_0x3e661d['createHistory'](_0x2741e6)[_0xad73('0xae')](loggerCatch(_0xad73('0x120')));if(_0x3e661d[_0xad73('0x19a')](0xb,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xee')]>=_0x43c8af[_0xad73('0x11d')]){_0x3e661d['createStateFinal'](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1ba'));}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1ba'));}}break;case'20':_0x43c8af[_0xad73('0x65')]+=0x1;_0x2741e6['state']=0x14;_0x2741e6[_0xad73('0xa5')]='AgentReject';_0x2741e6[_0xad73('0xef')]+=0x1;_0x2741e6[_0xad73('0xe7')]+=0x1;ami[_0xad73('0x4d')](_0xad73('0x1bb'),ut[_0xad73('0xe8')](_0x29995c,'agentreject'));_0x3e661d[_0xad73('0xc7')](_0x2741e6)[_0xad73('0xae')](loggerCatch(_0xad73('0x1bc')));if(_0x3e661d[_0xad73('0x19a')](0x14,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xef')]>=_0x43c8af['dialAgentRejectMaxRetry']){_0x3e661d['createStateFinal'](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1bd'));}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1bd'));}}break;default:_0x43c8af[_0xad73('0x66')]+=0x1;_0x2741e6[_0xad73('0xa4')]=0xc;_0x2741e6[_0xad73('0xa5')]=_0x45fb4e[_0xad73('0x106')];_0x3e661d['createHistory'](_0x2741e6)[_0xad73('0xae')](loggerCatch(_0xad73('0x1be')));if(_0x3e661d[_0xad73('0x19a')](_0x45fb4e[_0xad73('0x106')],_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xff')]+_0x2741e6[_0xad73('0xea')]+_0x2741e6[_0xad73('0xeb')]+_0x2741e6[_0xad73('0xec')]+_0x2741e6[_0xad73('0xed')]+_0x2741e6[_0xad73('0xee')]+_0x2741e6[_0xad73('0xe6')]+_0x2741e6[_0xad73('0xef')]>=_0x43c8af[_0xad73('0xf0')]){_0x3e661d['stateGlobal'](_0x2741e6,_0x18f53c,_0x33778d,_0x45fb4e[_0xad73('0x106')]);}else{_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,_0x45fb4e['reason']);}}}});};Dialer['prototype']['stateGlobal']=function(_0x3105e2,_0x1562eb,_0x2f4784,_0x2d2dad){var _0x36f1fb=new Final(_0x3105e2);_0x36f1fb[_0xad73('0xa4')]=0xf;_0x36f1fb[_0xad73('0xa5')]=_0xad73('0x1bf');this[_0xad73('0xf4')](_0x36f1fb,_0x1562eb,_0x2f4784,_0x2d2dad);};Dialer[_0xad73('0x1b')][_0xad73('0xf4')]=function(_0x3823ac,_0x513d5f,_0x1b9ce0,_0x331ce8){this['moveContactManagedDialer'](_0x3823ac)['then'](function(){return _0x513d5f(msgResponse(_0xad73('0x1a5'),_0xad73('0x1c0'),_0x331ce8));})[_0xad73('0xae')](function(){return _0x1b9ce0(msgResponse('[moveContactManagedDialer][0]',_0xad73('0x141'),_0xad73('0x1c1')));});};Dialer['prototype'][_0xad73('0xa')]=function(_0x2c4af1){var _0x94cdc8=_0x2c4af1[_0xad73('0x1c2')]/0x64;var _0x23815c=_0x2c4af1[_0xad73('0x60')]/(_0x2c4af1[_0xad73('0x60')]+_0x2c4af1[_0xad73('0x5d')]);var _0x57555a=Math[_0xad73('0x1c3')](_0x2c4af1[_0xad73('0x6d')]*(_0x2c4af1[_0xad73('0x1c4')]/0x64));var _0x1819d5=Math[_0xad73('0x1c3')](_0x2c4af1['predictiveIntervalAvailable']*(_0x2c4af1[_0xad73('0x1c5')]/0x64));var _0x4ecd4d=_0x2c4af1['available']+_0x2c4af1['talking'];var _0x5a5312=Math[_0xad73('0x1c6')](_0x2c4af1[_0xad73('0x6f')]*_0x2c4af1[_0xad73('0x71')]*_0x2c4af1[_0xad73('0x6b')]*_0x2c4af1[_0xad73('0x6c')]);if(_[_0xad73('0x86')](_0x2c4af1[_0xad73('0x2a')])){if(!_[_0xad73('0x86')](_0x2c4af1[_0xad73('0x29')])){_0x2c4af1[_0xad73('0x29')]=undefined;loggerPredictive[_0xad73('0x92')](_0xad73('0x1c7'),_0xad73('0x1c8'));}if(!_[_0xad73('0x86')](_0x2c4af1[_0xad73('0x8e')])){loggerPredictive[_0xad73('0x92')]('[startMethodPredictive][StartProgressive]',_0xad73('0x1c9'));clearInterval(_0x2c4af1['handlePredictive']);_0x2c4af1[_0xad73('0x8e')]=undefined;}_0x2c4af1[_0xad73('0x2a')]=moment()[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xad73('0x7c')](_0x2c4af1[_0xad73('0x40')],_0xad73('0x1ca'),_0x2c4af1[_0xad73('0x2a')]);this[_0xad73('0x155')](_0x2c4af1,0x1);}else if(ifInterval(_0x2c4af1[_0xad73('0x1cb')],_0x2c4af1[_0xad73('0x2a')])){this[_0xad73('0x155')](_0x2c4af1,0x1);loggerPredictiveCalls[_0xad73('0x7c')](_0xad73('0x1cc'),_0x2c4af1[_0xad73('0x2a')],_0x2c4af1[_0xad73('0x40')]);_0x2c4af1['erlangCalls']=0x0;_0x2c4af1[_0xad73('0x6a')]=0x0;}else if(_0x94cdc8<_0x23815c&&_0x2c4af1[_0xad73('0x1cd')]===_0xad73('0x1ce')){freeVariablesPredictive(_0x2c4af1);loggerPredictive[_0xad73('0x7c')](_0xad73('0x1cf'),'Dropped\x20calls\x20day',_0x23815c,_0xad73('0x2a'),_0x2c4af1[_0xad73('0x40')]);}else if(_0x5a5312<_0x2c4af1[_0xad73('0x6a')]&&_0x2c4af1[_0xad73('0x1cd')]==='dropRate'){freeVariablesPredictive(_0x2c4af1);loggerPredictive[_0xad73('0x7c')](_0xad73('0x1d0'),_0xad73('0x1d1'),_0x5a5312,_0xad73('0x1d2'),_0x2c4af1[_0xad73('0x6a')],_0xad73('0x2a'),_0x2c4af1[_0xad73('0x40')]);}else if(!ifInterval(_0x2c4af1['dialPredictiveInterval'],_0x2c4af1[_0xad73('0x2a')])&&_[_0xad73('0x86')](_0x2c4af1[_0xad73('0x29')])&&!_[_0xad73('0x86')](_0x2c4af1['startProgressive'])){_0x2c4af1[_0xad73('0x29')]=moment()['format'](_0xad73('0xf8'));loggerPredictive[_0xad73('0x7c')](_0x2c4af1['name'],'started\x20in\x20predictive\x20at',_0x2c4af1[_0xad73('0x29')]);this[_0xad73('0x1d3')](_0x2c4af1[_0xad73('0x1cb')])['then'](this[_0xad73('0x1d4')](_0x2c4af1))[_0xad73('0xb6')](mergeDataErlangB(_0x2c4af1))[_0xad73('0xb6')](this[_0xad73('0x1d5')](_0x2c4af1))[_0xad73('0xae')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2c4af1));}else if(!ifInterval(_0x2c4af1[_0xad73('0x1cb')],_0x2c4af1['startPredictive'])){_0x2c4af1['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2c4af1[_0xad73('0x29')]=moment()[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xad73('0x7c')](_0x2c4af1[_0xad73('0x40')],'recalculate\x20predictive\x20at',_0x2c4af1['startPredictive']);clearInterval(_0x2c4af1[_0xad73('0x8e')]);_0x2c4af1['handlePredictive']=undefined;this[_0xad73('0x1d3')](_0x2c4af1[_0xad73('0x1cb')])[_0xad73('0xb6')](this[_0xad73('0x1d4')](_0x2c4af1))[_0xad73('0xb6')](mergeDataErlangB(_0x2c4af1))['then'](this[_0xad73('0x1d5')](_0x2c4af1))[_0xad73('0xae')](loggerCatchPredictive(_0xad73('0x1d6'),_0x2c4af1));}else if(_0x2c4af1['predictiveIntervalAvailable']&&_0x4ecd4d<_0x2c4af1[_0xad73('0x6d')]-_0x1819d5){freeVariablesPredictive(_0x2c4af1);loggerPredictive['info'](_0x2c4af1[_0xad73('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4ecd4d,_0xad73('0x1d7'),_0x2c4af1[_0xad73('0x6d')],'-',_0x1819d5,'=',_0x2c4af1[_0xad73('0x6d')]-_0x1819d5,')');}else if(_0x2c4af1['predictiveIntervalAvailable']&&_0x4ecd4d>_0x2c4af1['predictiveIntervalAvailable']+_0x57555a){freeVariablesPredictive(_0x2c4af1);loggerPredictive[_0xad73('0x7c')](_0x2c4af1[_0xad73('0x40')],_0xad73('0x1d8'),_0x4ecd4d,')\x20are\x20more\x20than\x20threshold\x20(',_0x2c4af1[_0xad73('0x6d')],'+',_0x57555a,'=',_0x2c4af1['predictiveIntervalAvailable']+_0x57555a,')');}};Dialer['prototype'][_0xad73('0x1d4')]=function(_0x46b324){var _0x156250=this;return function(_0x13de36){return new BPromise(function(_0x530ecb,_0x4fa2da){_[_0xad73('0xcf')](_0x46b324,_0x13de36[0x0]);if(checkGetDataPredictive(_0x13de36[0x0])){var _0x1654a8=_0x46b324[_0xad73('0x6d')]=_0x46b324[_0xad73('0x53')]+_0x46b324[_0xad73('0x4f')];var _0xbc469c=_0x46b324['dialPredictiveInterval']*0x3c;var _0x176f09=_0x13de36[0x0][_0xad73('0x68')]+_0x13de36[0x0]['predictiveIntervalAvgHoldtime'];var _0x3b22d5=(_0x13de36[0x0]['predictiveIntervalAnsweredCalls']+_0x13de36[0x0][_0xad73('0x82')]+_0x13de36[0x0][_0xad73('0x1d9')])/_0x13de36[0x0]['predictiveIntervalTotalCalls'];_0x46b324['predictiveIntervalHitRate']=_0x3b22d5>0x0?_0x3b22d5:0x1;switch(_0x46b324['dialPredictiveOptimization']){case _0xad73('0x1ce'):var _0x1c35ef=_0x46b324[_0xad73('0x1c2')]/0x64;return _0x156250['abandonmentRate'](_0x1654a8,_0xbc469c,_0x176f09,_0x3b22d5,_0x1c35ef)['then'](function(_0x4b5b4e){return _0x530ecb(_0x4b5b4e);});case'agentBusyFactor':var _0x13049b=_0x46b324[_0xad73('0x1c2')]/0x64;return _0x156250['busyFactor'](_0x1654a8,_0xbc469c,_0x176f09,_0x3b22d5,_0x13049b)[_0xad73('0xb6')](function(_0x505c93){return _0x530ecb(_0x505c93);});default:return _0x4fa2da(msgResponse('[getDataPredictive]',_0xad73('0x141'),_0xad73('0x1da')));}}else{return _0x4fa2da(msgResponse(_0xad73('0x1db'),'Failure',_0xad73('0x1dc')));}});};};Dialer[_0xad73('0x1b')][_0xad73('0x1dd')]=function(_0x2bea18){var _0xfaee6c=this;return function(_0x3cd54b){return new BPromise(function(_0x1d580f,_0xaab6d){_['merge'](_0x2bea18,_0x3cd54b[0x0]);if(checkGetDataPredictive(_0x3cd54b[0x0])){loggerPredictive['info'](JSON[_0xad73('0x49')](_0x3cd54b[0x0]));if(_0x2bea18[_0xad73('0x1cd')]===_0xad73('0x1ce')){return _0xfaee6c[_0xad73('0xc4')](_0x2bea18['id'])[_0xad73('0xb6')](function(_0x2212bf){var _0x42e3dd=_0x2bea18['loggedIn']-_0x2212bf[0x0][_0xad73('0x1de')];var _0x98a15e=_0x2bea18[_0xad73('0x1cb')]*0x3c;var _0x23e812=_0x3cd54b[0x0][_0xad73('0x68')]+_0x3cd54b[0x0]['predictiveIntervalAvgHoldtime'];var _0xe5c291=(_0x3cd54b[0x0][_0xad73('0x80')]+_0x3cd54b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3cd54b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3cd54b[0x0]['predictiveIntervalTotalCalls'];var _0x14c30b=_0x2bea18[_0xad73('0x1c2')]/0x64;_0x2bea18[_0xad73('0x1df')]=_0x2212bf[0x0][_0xad73('0x1de')]||0x0;_0x2bea18[_0xad73('0x6b')]=_0xe5c291>0x0?_0xe5c291:0x1;return _0xfaee6c['abandonmentRate'](_0x42e3dd,_0x98a15e,_0x23e812,_0xe5c291,_0x14c30b);})['then'](function(_0x153c9b){return _0x1d580f(_0x153c9b);})[_0xad73('0xae')](function(_0x27e6d5){return _0xaab6d(msgResponse(_0xad73('0x1e0'),_0xad73('0x141'),JSON[_0xad73('0x49')](_0x27e6d5)));});}if(_0x2bea18[_0xad73('0x1cd')]===_0xad73('0x1e1')){return _0xfaee6c['getVoiceQueueRtPauses'](_0x2bea18['id'])[_0xad73('0xb6')](function(_0x337f12){var _0x2085a1=_0x2bea18[_0xad73('0x15c')]-_0x337f12[0x0]['outboundQueuePauses'];var _0x226199=_0x2bea18[_0xad73('0x1cb')]*0x3c;var _0x3cc43f=_0x3cd54b[0x0]['predictiveIntervalAvgTalktime']+_0x3cd54b[0x0][_0xad73('0x67')];var _0x4d6d5d=(_0x3cd54b[0x0][_0xad73('0x80')]+_0x3cd54b[0x0][_0xad73('0x82')]+_0x3cd54b[0x0][_0xad73('0x1d9')])/_0x3cd54b[0x0][_0xad73('0x6e')];var _0x4e5ea2=_0x2bea18[_0xad73('0x1c2')]/0x64;_0x2bea18[_0xad73('0x1df')]=_0x337f12[0x0][_0xad73('0x1de')]||0x0;_0x2bea18[_0xad73('0x6b')]=_0x4d6d5d>0x0?_0x4d6d5d:0x1;return _0xfaee6c[_0xad73('0x1e2')](_0x2085a1,_0x226199,_0x3cc43f,_0x4d6d5d,_0x4e5ea2);})['then'](function(_0x1c2540){return _0x1d580f(_0x1c2540);})[_0xad73('0xae')](function(_0x1f397e){return _0xaab6d(msgResponse(_0xad73('0x1e0'),_0xad73('0x141'),JSON[_0xad73('0x49')](_0x1f397e)));});}}else{return _0xaab6d(msgResponse(_0xad73('0x1db'),_0xad73('0x141'),_0xad73('0x1dc')));}});};};Dialer[_0xad73('0x1b')][_0xad73('0x1d5')]=function(_0x44af94){var _0x25877b=this;return function(){var _0x16c937=0x0;var _0x45bfb2=Math[_0xad73('0x1c6')](_0x44af94[_0xad73('0x70')]*0x3e8);if(_0x45bfb2>0x0){_0x45bfb2=_0x45bfb2<0x64?0x64:_0x45bfb2;loggerPredictive[_0xad73('0x7c')](_0x44af94[_0xad73('0x40')],'one\x20call\x20every:',_0x45bfb2,_0xad73('0x4a'));_0x44af94[_0xad73('0x8e')]=setInterval(function(){_0x25877b[_0xad73('0x8e')](_0x44af94);loggerPredictiveCalls[_0xad73('0x7c')](_0xad73('0x1e3'),_0x16c937+=0x1);},_0x45bfb2);}else{loggerPredictive['info'](_0x44af94[_0xad73('0x40')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xad73('0x1e4')]=function(_0x102107,_0x1459a2){var _0x110479=this;return function(_0x360ea6){if(_[_0xad73('0x7b')](_0x360ea6)){if(_[_0xad73('0xac')](_0x1459a2['UserId'])||!_0x1459a2[_0xad73('0x1e5')]){if(_0x102107[_0xad73('0x58')]===_0xad73('0x9')){_0x102107[_0xad73('0x12a')]=_[_0xad73('0x86')](_0x102107['queueStatusComplete'])?!![]:_0x102107[_0xad73('0x12a')];var _0xcd3bfe=uuid['v4']();_0x110479['actions'][_0xcd3bfe]=new Action(_0x102107,_0x1459a2,_0xcd3bfe);loggerBooked[_0xad73('0x7c')](_0xad73('0x1e6'),_0xcd3bfe,_0xad73('0x1e7'),JSON[_0xad73('0x49')](_0x102107['queueStatusComplete']),'Queue:\x20',_0x102107[_0xad73('0x40')]);if(_0x102107[_0xad73('0x12a')]){_0x102107['queueStatusComplete']=![];_0x110479[_0xad73('0x2c')][_0x110479[_0xad73('0xa9')][_0xcd3bfe]['queue']]=[];ami['Action']({'actionid':_0xcd3bfe,'action':'queuestatus','queue':_0x102107[_0xad73('0x40')]})['catch'](function(){_0x110479[_0xad73('0xb0')](_0x102107);_0x110479[_0xad73('0xbc')]({'active':![],'ContactId':_0x110479[_0xad73('0xa9')][_0xcd3bfe]['ContactId'],'ListId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0xd2')],'VoiceQueueId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0x115')]||undefined,'CampaignId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0xd4')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x110479[_0xad73('0xa9')][_0xcd3bfe];});}else{loggerBooked[_0xad73('0x7c')](_0xad73('0x1e8'),JSON[_0xad73('0x49')](_0x102107[_0xad73('0x12a')]),_0xad73('0x1e9'),_0x102107[_0xad73('0x40')]);_0x110479[_0xad73('0xb0')](_0x102107);_0x110479[_0xad73('0xbc')]({'active':![],'ContactId':_0x110479[_0xad73('0xa9')][_0xcd3bfe]['ContactId'],'ListId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0xd2')],'VoiceQueueId':_0x110479[_0xad73('0xa9')][_0xcd3bfe]['VoiceQueueId']||undefined,'CampaignId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x110479[_0xad73('0xa9')][_0xcd3bfe];}}else{return _0x110479['actionOriginate'](_0x102107,_0x1459a2);}}else{if(getDiff(_0x1459a2[_0xad73('0x1ea')])<_0x102107[_0xad73('0x1eb')]*0x3c){if(_0x1459a2[_0xad73('0x1ec')]&&!_0x1459a2['Agent']['voicePause']){_0x110479[_0xad73('0x1f')][_0xad73('0x12d')](_0x1459a2['id'])[_0xad73('0x1d')](function(){_0x110479[_0xad73('0xb0')](_0x102107);});}else{_0x110479[_0xad73('0xbe')]({'active':![]},_0x1459a2['id'],0x1)[_0xad73('0x1d')](function(){_0x110479[_0xad73('0xb0')](_0x102107);});}}else{_0x102107[_0xad73('0x64')]+=0x1;_0x110479[_0xad73('0xb0')](_0x102107);if(_0x102107[_0xad73('0x1ed')]){_0x110479[_0xad73('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1459a2['ContactId'],'ListId':_0x1459a2[_0xad73('0xd2')],'VoiceQueueId':_0x1459a2[_0xad73('0x115')]||undefined,'CampaignId':_0x1459a2[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x1ee')));_0x110479['createHistory'](createObjHistory(_0x102107,_0x1459a2,_0xad73('0x1ef'),0x17,_0xad73('0x1f0')))['catch'](loggerCatch(_0xad73('0x1f1')));}else{_0x110479['saveInDb'](createObjHistory(_0x102107,_0x1459a2,_0xad73('0x1f2'),0x16,_0xad73('0x1f3')),_0xad73('0x1f4'),_0xad73('0x1f5'));}}}}else{_0x102107[_0xad73('0x5e')]+=0x1;_0x110479[_0xad73('0xce')](createObjHistory(_0x102107,_0x1459a2,_0xad73('0x1f6'),0xd,_0xad73('0x1f7')),'[Originate][historyBlacklist]',_0xad73('0x1f8'));throw _0xad73('0x1f9');}};};Dialer[_0xad73('0x1b')][_0xad73('0x15a')]=function(_0xa3102f){var _0x43c234=this;var _0x520681=_0xa3102f['limitCalls']-_0xa3102f['originated']-_0xa3102f[_0xad73('0xc0')];emitCampaignSummary(_0xa3102f);if(_0x520681>0x0){if(_0x520681>this[_0xad73('0x24')]){_0x520681=this['maxNumberOriginate'];}_0xa3102f[_0xad73('0xc0')]+=_0x520681;this[_0xad73('0xc2')](_0xa3102f['id'],_0x520681,_0xa3102f[_0xad73('0x1fa')],_0xa3102f)[_0xad73('0xb6')](function(_0x5d9cd6){_0xa3102f[_0xad73('0xc0')]-=_0x520681;_0xa3102f[_0xad73('0xc0')]=_0xa3102f[_0xad73('0xc0')]>0x0?_0xa3102f[_0xad73('0xc0')]:0x0;if(!checkContactEmpty(_0x5d9cd6)){_0xa3102f[_0xad73('0x3f')]=_0xad73('0x1fb');logger['info'](_0xad73('0x1fc')+_0xa3102f[_0xad73('0x40')]);}else{_0xa3102f[_0xad73('0x96')]+=_0x5d9cd6[_0xad73('0x95')];_0xa3102f[_0xad73('0x3f')]=_0xad73('0x1fd');for(var _0x1de075=0x0;_0x1de075<_0x5d9cd6[_0xad73('0x95')];_0x1de075+=0x1){_0xa3102f[_0xad73('0x1fe')]+=0x1;if(_[_0xad73('0xac')](_0x5d9cd6[_0x1de075])||_[_0xad73('0xac')](_0x5d9cd6[_0x1de075][_0xad73('0x16c')])||_[_0xad73('0xac')](_0x5d9cd6[_0x1de075][_0xad73('0x16c')]['phone'])){_0x43c234['emptyContact']('[actionOriginate]\x20',_0xa3102f,_0x5d9cd6[_0x1de075]);}else{_0x43c234['checkIsBlackListIvr'](_[_0xad73('0xd0')](_0x5d9cd6[_0x1de075],[_0xad73('0xd4'),_0xad73('0x1ff')]))[_0xad73('0xb6')](_0x43c234[_0xad73('0x1e4')](_0xa3102f,_0x5d9cd6[_0x1de075]))['catch'](_0x43c234[_0xad73('0xcc')](_0xad73('0x200'),_0xa3102f));}}}})[_0xad73('0xae')](loggerGetContactDialer(_0xad73('0x201'),_0xa3102f,_0x520681));}};Dialer[_0xad73('0x1b')][_0xad73('0x155')]=function(_0x5e03b7,_0x4b3c68){var _0x5ca48f=this;var _0x233ab4=[];var _0x56cbf5=_0x4b3c68>=0x1?_0x4b3c68:0x1;if(_0x5e03b7[_0xad73('0x58')]===_0xad73('0x9')){_0x56cbf5=0x1;}var _0x397109=Math[_0xad73('0x1c6')](_0x5e03b7[_0xad73('0x4f')]*_0x56cbf5)-_0x5e03b7['originated']-_0x5e03b7[_0xad73('0xc0')];emitVoiceQueueSummary(_0x5e03b7);if(_0x5e03b7[_0xad73('0x202')]>0x0){var _0x5e5823=_0x5e03b7[_0xad73('0x202')]-_0x5e03b7['originated']-_0x5e03b7[_0xad73('0x53')]-_0x5e03b7[_0xad73('0xc0')]-_0x5e03b7[_0xad73('0x9d')];if(_0x397109>_0x5e5823){_0x397109=_0x5e5823;}}if(_0x397109>0x0){if(_0x5e03b7[_0xad73('0x58')]===_0xad73('0x9')){_0x397109=0x1;}if(_0x397109>this[_0xad73('0x24')]){_0x397109=this[_0xad73('0x24')];}_0x5e03b7[_0xad73('0xc0')]+=_0x397109;for(var _0x30557b in this[_0xad73('0x22')]){if(typeof this[_0xad73('0x22')][_0x30557b]!=='undefined'){if(this['agents'][_0x30557b][_0xad73('0xa4')]==='not_inuse'&&this[_0xad73('0x22')][_0x30557b][_0xad73('0xad')]===_0xad73('0xd9')){_0x233ab4[_0xad73('0x128')](this['agents'][_0x30557b]['id']);}}}this['getContactDialer'](_0x5e03b7['id'],_0x233ab4,_0x397109,_0x5e03b7['dialOrderByScheduledAt'],_0x5e03b7)[_0xad73('0xb6')](function(_0x4cd973){_0x5e03b7[_0xad73('0xc0')]-=_0x397109;_0x5e03b7[_0xad73('0xc0')]=_0x5e03b7[_0xad73('0xc0')]>0x0?_0x5e03b7[_0xad73('0xc0')]:0x0;if(!checkContactEmpty(_0x4cd973)){_0x5ca48f[_0xad73('0xb4')](_0x5e03b7)['then'](sendMessageReschedule(_0x5e03b7))[_0xad73('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0x5e03b7[_0xad73('0x96')]+=_0x4cd973[_0xad73('0x95')];_0x5e03b7[_0xad73('0x3f')]=_0x5e03b7[_0xad73('0x58')]===_0xad73('0x9')?_0xad73('0x173'):_0xad73('0x1fd');for(var _0x3006ba=0x0;_0x3006ba<_0x4cd973['length'];_0x3006ba+=0x1){if(_[_0xad73('0xac')](_0x4cd973[_0x3006ba])||_['isNil'](_0x4cd973[_0x3006ba][_0xad73('0x16c')])||_[_0xad73('0xac')](_0x4cd973[_0x3006ba][_0xad73('0x16c')][_0xad73('0x18c')])){_0x5ca48f[_0xad73('0xcd')](_0xad73('0x203'),_0x5e03b7,_0x4cd973[_0x3006ba]);}else{_0x5ca48f[_0xad73('0x204')](_[_0xad73('0xd0')](_0x4cd973[_0x3006ba],['VoiceQueueId','Contact.phone']))[_0xad73('0xb6')](_0x5ca48f[_0xad73('0x1e4')](_0x5e03b7,_0x4cd973[_0x3006ba]))[_0xad73('0xae')](_0x5ca48f[_0xad73('0xcc')](_0xad73('0x203'),_0x5e03b7));}}}})[_0xad73('0xae')](loggerGetContactDialer(_0xad73('0x205'),_0x5e03b7,_0x397109));}};Dialer['prototype'][_0xad73('0x8e')]=function(_0x586ddb){if(_0x586ddb[_0xad73('0x202')]>0x0){var _0x246eb0=_0x586ddb[_0xad73('0x202')]-_0x586ddb[_0xad73('0x96')]-_0x586ddb['talking'];if(_0x246eb0>0x0){this[_0xad73('0x206')](_0x586ddb);}else{loggerPredictiveCalls[_0xad73('0x7c')]('[handlePredictive][limitChannel]');}}else{this[_0xad73('0x206')](_0x586ddb);}};Dialer[_0xad73('0x1b')][_0xad73('0x206')]=function(_0x10869b){var _0x301343=this;var _0x7da01f=[];_0x10869b[_0xad73('0x96')]+=0x1;for(var _0x23ca8f in this[_0xad73('0x22')]){if(typeof this[_0xad73('0x22')][_0x23ca8f]!=='undefined'){if(this[_0xad73('0x22')][_0x23ca8f][_0xad73('0xa4')]===_0xad73('0x207')&&this['agents'][_0x23ca8f][_0xad73('0xad')]===_0xad73('0xd9')){_0x7da01f['push'](this['agents'][_0x23ca8f]['id']);}}}this['getContactDialer'](_0x10869b['id'],_0x7da01f,0x1,_0x10869b[_0xad73('0x1fa')],_0x10869b)[_0xad73('0xb6')](function(_0x164fb7){if(!checkContactEmpty(_0x164fb7)){checkContactLowerLimitOriginate(_0x10869b,0x1,0x0);_0x301343[_0xad73('0xb4')](_0x10869b)[_0xad73('0xb6')](sendMessageReschedule(_0x10869b))[_0xad73('0xae')](loggerCatch(_0xad73('0xb7')));}else{_0x10869b[_0xad73('0x3f')]=_0xad73('0x1fd');if(_[_0xad73('0xac')](_0x164fb7[0x0])||_[_0xad73('0xac')](_0x164fb7[0x0][_0xad73('0x16c')])||_['isNil'](_0x164fb7[0x0]['Contact'][_0xad73('0x18c')])){_0x301343['emptyContact'](_0xad73('0x203'),_0x10869b,_0x164fb7[0x0]);}else{_0x301343[_0xad73('0x204')](_[_0xad73('0xd0')](_0x164fb7[0x0],[_0xad73('0x115'),'Contact.phone']))[_0xad73('0xb6')](_0x301343[_0xad73('0x1e4')](_0x10869b,_0x164fb7[0x0]))[_0xad73('0xae')](_0x301343[_0xad73('0xcc')](_0xad73('0x208'),_0x10869b));}}})[_0xad73('0xae')](loggerGetContactDialer(_0xad73('0x209'),_0x10869b,0x1));emitVoiceQueueSummary(_0x10869b);};Dialer['prototype'][_0xad73('0x20a')]=function(_0x4a16ac,_0x240f60,_0x13949e,_0x1c16ea,_0x54bb57,_0x3bbf3e){loggerPredictive[_0xad73('0x7c')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xad73('0x7c')]('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',_0x4a16ac);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20b'),_0x240f60);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20c'),_0x13949e);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20d'),_0x1c16ea);loggerPredictive['info'](_0xad73('0x20e'),_0x54bb57);loggerPredictive[_0xad73('0x7c')](_0xad73('0x85'));return new BPromise(function(_0x3ebf1c,_0x41a64f){if(_0x4a16ac<=0x0||isNaN(_0x4a16ac)){return _0x41a64f(msgResponse(_0xad73('0x20f'),_0xad73('0x48'),_0xad73('0x210')+_0x4a16ac));}if(_0x13949e<=0x0||isNaN(_0x13949e)){return _0x41a64f(msgResponse(_0xad73('0x20f'),'Error',_0xad73('0x211')+_0x13949e));}if(_0x1c16ea<=0x0||isNaN(_0x1c16ea)){return _0x41a64f(msgResponse('[abandonmentRate]',_0xad73('0x48'),_0xad73('0x212')+_0x1c16ea));}if(_0x240f60<=0x0||isNaN(_0x240f60)){return _0x41a64f(msgResponse(_0xad73('0x20f'),_0xad73('0x48'),'interval\x20=\x20'+_0x240f60));}if(_0x54bb57<=0x0||isNaN(_0x54bb57)){return _0x41a64f(msgResponse(_0xad73('0x20f'),_0xad73('0x48'),_0xad73('0x213')+_0x54bb57));}_0x3bbf3e=_0x3bbf3e||0x0;var _0x39ef57=0x1/_0x13949e;var _0x8a8a15=0x0;var _0x35d1e2=0x0;var _0x541cff=0x0;var _0x570145=0x0;for(var _0x22d761=0x0;_0x541cff<_0x54bb57;_0x22d761+=0x1){_0x35d1e2=_0x22d761/_0x240f60;_0x8a8a15=(_0x1c16ea*_0x35d1e2+_0x3bbf3e)/_0x39ef57;_0x541cff=erlangb(_0x8a8a15,_0x4a16ac);_0x570145=_0x8a8a15/_0x4a16ac*(0x1-erlangb(_0x8a8a15,_0x4a16ac));}return _0x3ebf1c({'erlangCalls':_0x22d761,'erlangCallToSecond':_0x240f60/_0x22d761,'erlangAbandonmentRate':_0x541cff,'erlangBusyFactor':_0x570145});});};Dialer[_0xad73('0x1b')][_0xad73('0x1e2')]=function(_0x282cb7,_0x57fb3b,_0x23db2d,_0x52f404,_0x4b6f80,_0x59b00f){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xad73('0x7c')](_0xad73('0x214'),_0x282cb7);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20b'),_0x57fb3b);loggerPredictive[_0xad73('0x7c')]('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',_0x23db2d);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20d'),_0x52f404);loggerPredictive[_0xad73('0x7c')](_0xad73('0x215'),_0x4b6f80);loggerPredictive[_0xad73('0x7c')](_0xad73('0x85'));return new BPromise(function(_0x7cc7dc,_0xa965be){if(_0x282cb7<=0x0||isNaN(_0x282cb7)){return _0xa965be(msgResponse('[busyFactor]',_0xad73('0x48'),_0xad73('0x210')+_0x282cb7));}if(_0x23db2d<=0x0||isNaN(_0x23db2d)){return _0xa965be(msgResponse(_0xad73('0x216'),'Error',_0xad73('0x211')+_0x23db2d));}if(_0x52f404<=0x0||isNaN(_0x52f404)){return _0xa965be(msgResponse(_0xad73('0x216'),_0xad73('0x48'),_0xad73('0x212')+_0x52f404));}if(_0x57fb3b<=0x0||isNaN(_0x57fb3b)){return _0xa965be(msgResponse(_0xad73('0x216'),'Error',_0xad73('0x217')+_0x57fb3b));}if(_0x4b6f80<=0x0||isNaN(_0x4b6f80)){return _0xa965be(msgResponse('[busyFactor]',_0xad73('0x48'),_0xad73('0x218')+_0x4b6f80));}_0x59b00f=_0x59b00f||0x0;var _0x21c3d8=0x1/_0x23db2d;var _0x45912b=0x0;var _0x357d8d=0x0;var _0x655dba=0x0;var _0x3a339c=0x0;for(var _0x4d67fc=0x0;_0x3a339c<_0x4b6f80;_0x4d67fc+=0x1){_0x357d8d=_0x4d67fc/_0x57fb3b;_0x45912b=(_0x52f404*_0x357d8d+_0x59b00f)/_0x21c3d8;_0x655dba=erlangb(_0x45912b,_0x282cb7);_0x3a339c=_0x45912b/_0x282cb7*(0x1-erlangb(_0x45912b,_0x282cb7));}return _0x7cc7dc({'erlangCalls':_0x4d67fc,'erlangCallToSecond':_0x57fb3b/_0x4d67fc,'erlangAbandonmentRate':_0x655dba,'erlangBusyFactor':_0x3a339c});});};module[_0xad73('0x219')]=Dialer;
\ No newline at end of file
index 1c57eb7..bc26a41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1911=['countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry'];(function(_0x5a2250,_0x4483c5){var _0x443f28=function(_0x4fe54b){while(--_0x4fe54b){_0x5a2250['push'](_0x5a2250['shift']());}};_0x443f28(++_0x4483c5);}(_0x1911,0x1ea));var _0x1191=function(_0x356e42,_0x3e1b42){_0x356e42=_0x356e42-0x0;var _0x4591ec=_0x1911[_0x356e42];return _0x4591ec;};'use strict';var util=require(_0x1191('0x0'));var _=require('lodash');var moment=require(_0x1191('0x1'));function getSeconds(_0x3134d2,_0x2a3f96){var _0x3805d2=moment(_0x3134d2)[_0x1191('0x2')](0x0);var _0x3e626c=moment(_0x2a3f96)[_0x1191('0x2')](0x0);return _0x3805d2[_0x1191('0x3')](_0x3e626c,'seconds');}function QueueCallerAbandon(_0x57aff1,_0x11c025){this[_0x1191('0x4')]=_0x57aff1['scheduledat'];this[_0x1191('0x5')]=_0x57aff1[_0x1191('0x5')];this[_0x1191('0x6')]=_0x57aff1[_0x1191('0x5')]===_0x1191('0x7')?_0x1191('0x8'):_0x57aff1['type'];this[_0x1191('0x9')]=_0x57aff1[_0x1191('0x9')];this[_0x1191('0xa')]=_0x57aff1[_0x1191('0xa')];this[_0x1191('0xb')]=_0x57aff1[_0x1191('0xb')];this[_0x1191('0xc')]=_0x57aff1['countbusyretry']+_0x57aff1['countcongestionretry']+_0x57aff1[_0x1191('0xb')]+_0x57aff1['countnosuchnumberretry']+_0x57aff1['countdropretry']+_0x57aff1['countabandonedretry']+_0x57aff1[_0x1191('0xd')]+_0x57aff1[_0x1191('0xe')];this[_0x1191('0xf')]=_0x57aff1[_0x1191('0xf')];this['countdropretry']=_0x57aff1[_0x1191('0x10')];this[_0x1191('0x11')]=_0x57aff1[_0x1191('0x11')];this['countmachineretry']=_0x57aff1[_0x1191('0xd')];this[_0x1191('0xe')]=_0x57aff1[_0x1191('0xe')];this[_0x1191('0x12')]=_0x11c025[_0x1191('0x12')];this[_0x1191('0x13')]=_0x57aff1[_0x1191('0x14')];this[_0x1191('0x15')]=_0x57aff1[_0x1191('0x16')];this[_0x1191('0x17')]=_0x57aff1[_0x1191('0x17')];this[_0x1191('0x18')]=_0x57aff1[_0x1191('0x18')];this[_0x1191('0x19')]=_0x57aff1['droptime'];this[_0x1191('0x1a')]=this['droptime'];this[_0x1191('0x1b')]=getSeconds(_0x57aff1['responsetime'],_0x57aff1[_0x1191('0x17')]);this[_0x1191('0x1c')]=getSeconds(this['droptime'],_0x57aff1[_0x1191('0x18')]);this[_0x1191('0x1d')]=0x0;this['queue']=_0x11c025[_0x1191('0x8')];this[_0x1191('0x1e')]=_0x11c025['connectedlinename'];this['reason']=_0x11c025[_0x1191('0x1f')];this[_0x1191('0x20')]=_0x57aff1[_0x1191('0x20')];this[_0x1191('0x21')]=_0x57aff1['callbackuniqueid'];this[_0x1191('0x22')]=_0x57aff1[_0x1191('0x22')];this['recallme']=_0x57aff1[_0x1191('0x23')];this['ContactId']=_0x57aff1['ContactId'];this[_0x1191('0x24')]=_0x57aff1[_0x1191('0x24')];this[_0x1191('0x25')]=_0x57aff1[_0x1191('0x25')];this[_0x1191('0x26')]=_0x57aff1[_0x1191('0x26')];this[_0x1191('0x27')]=_0x57aff1[_0x1191('0x27')];this['originatecalleridnum']=_0x57aff1['originatecalleridnum']||'';this[_0x1191('0x28')]=_0x57aff1['originatecalleridname']||'';}module[_0x1191('0x29')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x1bc2=['CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId'];(function(_0x2fccdd,_0x3ad67a){var _0x4085f0=function(_0x358ad4){while(--_0x358ad4){_0x2fccdd['push'](_0x2fccdd['shift']());}};_0x4085f0(++_0x3ad67a);}(_0x1bc2,0x1e8));var _0x21bc=function(_0x37f781,_0x36e364){_0x37f781=_0x37f781-0x0;var _0x1bdcf8=_0x1bc2[_0x37f781];return _0x1bdcf8;};'use strict';var util=require('util');var _=require(_0x21bc('0x0'));var moment=require(_0x21bc('0x1'));function getSeconds(_0x1c845b,_0x128d77){var _0xd106c3=moment(_0x1c845b)['milliseconds'](0x0);var _0x3474e4=moment(_0x128d77)[_0x21bc('0x2')](0x0);return _0xd106c3[_0x21bc('0x3')](_0x3474e4,_0x21bc('0x4'));}function QueueCallerAbandon(_0x211b67,_0x13566c){this[_0x21bc('0x5')]=_0x211b67[_0x21bc('0x5')];this[_0x21bc('0x6')]=_0x211b67[_0x21bc('0x6')];this[_0x21bc('0x7')]=_0x211b67[_0x21bc('0x6')]===_0x21bc('0x8')?'queue':_0x211b67[_0x21bc('0x6')];this[_0x21bc('0x9')]=_0x211b67[_0x21bc('0x9')];this['countcongestionretry']=_0x211b67[_0x21bc('0xa')];this[_0x21bc('0xb')]=_0x211b67[_0x21bc('0xb')];this[_0x21bc('0xc')]=_0x211b67[_0x21bc('0x9')]+_0x211b67[_0x21bc('0xa')]+_0x211b67[_0x21bc('0xb')]+_0x211b67[_0x21bc('0xd')]+_0x211b67[_0x21bc('0xe')]+_0x211b67[_0x21bc('0xf')]+_0x211b67[_0x21bc('0x10')]+_0x211b67[_0x21bc('0x11')];this[_0x21bc('0xd')]=_0x211b67[_0x21bc('0xd')];this[_0x21bc('0xe')]=_0x211b67[_0x21bc('0xe')];this[_0x21bc('0xf')]=_0x211b67[_0x21bc('0xf')];this['countmachineretry']=_0x211b67[_0x21bc('0x10')];this[_0x21bc('0x11')]=_0x211b67[_0x21bc('0x11')];this[_0x21bc('0x12')]=_0x13566c['uniqueid'];this[_0x21bc('0x13')]=_0x211b67[_0x21bc('0x14')];this[_0x21bc('0x15')]=_0x211b67[_0x21bc('0x16')];this[_0x21bc('0x17')]=_0x211b67[_0x21bc('0x17')];this[_0x21bc('0x18')]=_0x211b67[_0x21bc('0x18')];this[_0x21bc('0x19')]=_0x211b67[_0x21bc('0x19')];this[_0x21bc('0x1a')]=this[_0x21bc('0x19')];this[_0x21bc('0x1b')]=getSeconds(_0x211b67[_0x21bc('0x18')],_0x211b67['starttime']);this[_0x21bc('0x1c')]=getSeconds(this[_0x21bc('0x19')],_0x211b67['responsetime']);this['talktime']=0x0;this[_0x21bc('0x1d')]=_0x13566c[_0x21bc('0x1d')];this[_0x21bc('0x1e')]=_0x13566c[_0x21bc('0x1f')];this[_0x21bc('0x20')]=_0x13566c['reason'];this['callback']=_0x211b67[_0x21bc('0x21')];this[_0x21bc('0x22')]=_0x211b67[_0x21bc('0x22')];this[_0x21bc('0x23')]=_0x211b67[_0x21bc('0x23')];this[_0x21bc('0x24')]=_0x211b67[_0x21bc('0x24')];this[_0x21bc('0x25')]=_0x211b67[_0x21bc('0x25')];this[_0x21bc('0x26')]=_0x211b67[_0x21bc('0x26')];this['UserId']=_0x211b67['UserId'];this[_0x21bc('0x27')]=_0x211b67[_0x21bc('0x27')];this[_0x21bc('0x28')]=_0x211b67[_0x21bc('0x28')];this[_0x21bc('0x29')]=_0x211b67['originatecalleridnum']||'';this['originatecalleridname']=_0x211b67[_0x21bc('0x2a')]||'';}module[_0x21bc('0x2b')]=QueueCallerAbandon;
\ No newline at end of file
index c5f8c61..380997e 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(_0x4a199e,_0x1c30ff){var _0x3aaab5=function(_0x4b6858){while(--_0x4b6858){_0x4a199e['push'](_0x4a199e['shift']());}};_0x3aaab5(++_0x1c30ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x4deedb,_0x46b5e0){var _0x495ad8=function(_0x23b8f5){while(--_0x23b8f5){_0x4deedb['push'](_0x4deedb['shift']());}};_0x495ad8(++_0x46b5e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 25eed7f..56c1e1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0255=['util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','FaxAccountId','Fax\x20received','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports'];(function(_0x2dd73e,_0x900d14){var _0x39b50d=function(_0x243894){while(--_0x243894){_0x2dd73e['push'](_0x2dd73e['shift']());}};_0x39b50d(++_0x900d14);}(_0x0255,0xf2));var _0x5025=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0255[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x5025('0x0'));var _=require(_0x5025('0x1'));var BPromise=require(_0x5025('0x2'));var uuid=require(_0x5025('0x3'));var moment=require(_0x5025('0x4'));var path=require(_0x5025('0x5'));var tiff2pdf=require(_0x5025('0x6'));var gs=require(_0x5025('0x7'));var logger=require(_0x5025('0x8'))(_0x5025('0x9'));var ami=require(_0x5025('0xa'));var rpcDb=require(_0x5025('0xb'));var Channel=require(_0x5025('0xc'));var ut=require('./util/util');var Action=require(_0x5025('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x5025('0xe'));var faxMessage=require(_0x5025('0xf'));function Fax(_0x324968){this[_0x5025('0x10')]={};this[_0x5025('0x11')]=_0x324968[_0x5025('0x11')];this[_0x5025('0x12')]=_0x324968[_0x5025('0x12')];this[_0x5025('0x13')]={};ami['on'](_0x5025('0x14'),this[_0x5025('0x15')][_0x5025('0x16')](this));ami['on']('varset',this[_0x5025('0x17')][_0x5025('0x16')](this));ami['on'](_0x5025('0x18'),this['syncNewState']['bind'](this));ami['on'](_0x5025('0x19'),this[_0x5025('0x1a')][_0x5025('0x16')](this));ami['on'](_0x5025('0x1b'),this[_0x5025('0x1c')][_0x5025('0x16')](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x5025('0x1d'),this[_0x5025('0x1e')][_0x5025('0x16')](this));ami['on'](_0x5025('0x1f'),this[_0x5025('0x20')]['bind'](this));}Fax[_0x5025('0x21')][_0x5025('0x15')]=function(_0xe77cd8){if(_0xe77cd8['context']==='from-voip-provider'){for(var _0xa91cae in this[_0x5025('0x11')]){if(this[_0x5025('0x11')][_0x5025('0x22')](_0xa91cae)){if(_0xe77cd8[_0x5025('0x23')]===this[_0x5025('0x11')][_0xa91cae][_0x5025('0x24')]){this[_0x5025('0x10')][_0xe77cd8[_0x5025('0x25')]]={};this[_0x5025('0x10')][_0xe77cd8[_0x5025('0x25')]][_0x5025('0x26')]=_0xe77cd8[_0x5025('0x26')];this['channels'][_0xe77cd8[_0x5025('0x25')]]['id']=this[_0x5025('0x11')][_0xa91cae]['id'];this[_0x5025('0x10')][_0xe77cd8[_0x5025('0x25')]][_0x5025('0x27')]=this['faxAccounts'][_0xa91cae][_0x5025('0x27')];logger[_0x5025('0x28')](_0xe77cd8[_0x5025('0x25')],_0x5025('0x29'));}}}}if(this['actions'][_0xe77cd8[_0x5025('0x25')]]){this[_0x5025('0x10')][_0xe77cd8[_0x5025('0x25')]]={};this[_0x5025('0x10')][_0xe77cd8[_0x5025('0x25')]][_0x5025('0x26')]=_0xe77cd8[_0x5025('0x26')];logger['info'](_0xe77cd8[_0x5025('0x25')],_0x5025('0x29'));}};Fax[_0x5025('0x21')]['syncVarSet']=function(_0xcd6149){if(this[_0x5025('0x10')][_0xcd6149[_0x5025('0x25')]]){for(var _0x2bf062 in _0xcd6149[_0x5025('0x2a')]){if(_0xcd6149['variable'][_0x5025('0x22')](_0x2bf062)){this[_0x5025('0x10')][_0xcd6149[_0x5025('0x25')]][_0x2bf062]=_0xcd6149['value'];}}}};Fax[_0x5025('0x21')][_0x5025('0x2b')]=function(_0x1af242){if(this[_0x5025('0x10')][_0x1af242[_0x5025('0x25')]]){this[_0x5025('0x10')][_0x1af242['uniqueid']][_0x5025('0x2c')]=_0x1af242[_0x5025('0x2c')];this[_0x5025('0x10')][_0x1af242[_0x5025('0x25')]][_0x5025('0x2d')]=_0x1af242[_0x5025('0x2d')];}};Fax[_0x5025('0x21')]['syncNewExten']=function(_0x4324e0){if(this['channels'][_0x4324e0[_0x5025('0x25')]]){for(var _0x3d9743 in _0x4324e0[_0x5025('0x2a')]){if(_0x4324e0[_0x5025('0x2a')]['hasOwnProperty'](_0x3d9743)){this[_0x5025('0x10')][_0x4324e0[_0x5025('0x25')]][_0x3d9743]=_0x4324e0['value'];}}}};Fax['prototype'][_0x5025('0x1c')]=function(_0x454524){if(this[_0x5025('0x10')][_0x454524['uniqueid']]){this[_0x5025('0x10')][_0x454524[_0x5025('0x25')]]['operation']=_0x454524[_0x5025('0x2e')];this['channels'][_0x454524[_0x5025('0x25')]][_0x5025('0x2f')]=_0x454524['status'];this['channels'][_0x454524[_0x5025('0x25')]][_0x5025('0x24')]=_0x454524[_0x5025('0x24')];this['channels'][_0x454524['uniqueid']]['filename']=_0x454524[_0x5025('0x30')];logger[_0x5025('0x28')](_0x454524[_0x5025('0x25')],_0x5025('0x31'));}};Fax[_0x5025('0x21')][_0x5025('0x32')]=function(_0x33f4e1){var _0x31a3b3=this;if(this[_0x5025('0x10')][_0x33f4e1[_0x5025('0x25')]]){var _0x14d7fa=this[_0x5025('0x10')][_0x33f4e1[_0x5025('0x25')]]['id'];this[_0x5025('0x10')][_0x33f4e1[_0x5025('0x25')]][_0x5025('0x33')]=_0x33f4e1[_0x5025('0x33')];this[_0x5025('0x10')][_0x33f4e1['uniqueid']][_0x5025('0x34')]=_0x33f4e1[_0x5025('0x34')];this['channels'][_0x33f4e1['uniqueid']][_0x5025('0x24')]=_0x33f4e1[_0x5025('0x24')];this[_0x5025('0x10')][_0x33f4e1[_0x5025('0x25')]][_0x5025('0x35')]=_0x33f4e1[_0x5025('0x35')];this[_0x5025('0x10')][_0x33f4e1['uniqueid']][_0x5025('0x36')]=_0x33f4e1[_0x5025('0x36')];this[_0x5025('0x10')][_0x33f4e1[_0x5025('0x25')]]['filename']=_0x33f4e1[_0x5025('0x30')];this[_0x5025('0x10')][_0x33f4e1[_0x5025('0x25')]]['calleridnum']=_0x33f4e1[_0x5025('0x37')];if(this[_0x5025('0x10')][_0x33f4e1[_0x5025('0x25')]][_0x5025('0x34')]>0x0){tiff2pdf(_0x33f4e1[_0x5025('0x30')],_0x5025('0x38'),function(_0x4eb23e){logger[_0x5025('0x28')](_0x33f4e1[_0x5025('0x25')],_0x5025('0x39'),_0x4eb23e[_0x5025('0x3a')]);attachment[_0x5025('0x3b')]({'name':path[_0x5025('0x3c')](_0x33f4e1[_0x5025('0x30')])[_0x5025('0x27')],'basename':path[_0x5025('0x3c')](_0x33f4e1[_0x5025('0x30')])[_0x5025('0x27')]+_0x5025('0x3d'),'type':_0x5025('0x3e')})[_0x5025('0x3f')](function(_0x5c4d64){faxAccount[_0x5025('0x40')](_0x14d7fa,{'from':_0x33f4e1[_0x5025('0x37')],'mapKey':_0x5025('0x9'),'body':path[_0x5025('0x3c')](_0x33f4e1[_0x5025('0x30')])['name']+_0x5025('0x3d'),'AttachmentId':_0x5c4d64['id']})[_0x5025('0x41')](function(_0x48b5ab){logger['error'](_0x33f4e1[_0x5025('0x25')],_0x5025('0x42'),JSON[_0x5025('0x43')](_0x48b5ab));});})[_0x5025('0x41')](function(_0x313a97){logger[_0x5025('0x44')](_0x33f4e1[_0x5025('0x25')],'\x20receiveFax\x20',JSON[_0x5025('0x43')](_0x313a97));});});}logger[_0x5025('0x28')](_0x33f4e1[_0x5025('0x25')],_0x5025('0x45'));}};Fax['prototype']['syncOriginateResponse']=function(_0x38b86e){if(this[_0x5025('0x13')][_0x38b86e['uniqueid']]){_[_0x5025('0x46')](this[_0x5025('0x10')][_0x38b86e['uniqueid']],_['pick'](_0x38b86e,[_0x5025('0x47'),_0x5025('0x48')]));}};function updateStatus(_0x2b7ebc){if(_0x2b7ebc[_0x5025('0x49')]){faxMessage[_0x5025('0x4a')](_0x2b7ebc[_0x5025('0x49')],{'failMessage':_0x5025('0x4b')})[_0x5025('0x3f')](function(_0xfae9d5){ut[_0x5025('0x4c')](_0x5025('0x4d'),_0xfae9d5);})['catch'](function(_0x13a751){ut['logger'](_0x5025('0x4e'),_0x13a751);});}else{ut[_0x5025('0x4c')](_0x5025('0x4f'));}}Fax[_0x5025('0x21')][_0x5025('0x50')]=function(_0x32fd9c,_0x356d5e,_0x86dfc4){var _0x3f9ede=this;var _0x983340={};if(_0x356d5e){_0x983340={'read':_0x356d5e};}else{_0x983340={'failMessage':_0x86dfc4};}if(this[_0x5025('0x13')][_0x32fd9c]['AttachmentId']){faxMessage[_0x5025('0x4a')](this[_0x5025('0x13')][_0x32fd9c][_0x5025('0x49')],_0x983340)['then'](function(_0xa0dae2){ut[_0x5025('0x4c')](_0x5025('0x51'),_0xa0dae2);})['catch'](function(_0x1846a0){ut['logger'](_0x5025('0x52'),_0x1846a0);})[_0x5025('0x53')](function(){delete _0x3f9ede['channels'][_0x32fd9c];delete _0x3f9ede['actions'][_0x32fd9c];});}else{ut['logger'](_0x5025('0x54'));delete this[_0x5025('0x10')][_0x32fd9c];delete this[_0x5025('0x13')][_0x32fd9c];}};Fax['prototype'][_0x5025('0x1e')]=function(_0x5b29c4){var _0x57b3d7=this;if(this[_0x5025('0x10')][_0x5b29c4[_0x5025('0x25')]]){if(this[_0x5025('0x13')][_0x5b29c4[_0x5025('0x25')]]){this[_0x5025('0x10')][_0x5b29c4[_0x5025('0x25')]]['id']=this['actions'][_0x5b29c4[_0x5025('0x25')]]['id'];this['channels'][_0x5b29c4['uniqueid']]['name']=this['actions'][_0x5b29c4['uniqueid']][_0x5025('0x27')];}logger['info'](_0x5b29c4[_0x5025('0x25')],this[_0x5025('0x13')][_0x5b29c4['uniqueid']]?_0x5025('0x55'):_0x5025('0x56'),JSON['stringify'](this[_0x5025('0x10')][_0x5b29c4[_0x5025('0x25')]]));if(this['actions'][_0x5b29c4[_0x5025('0x25')]]){if(this[_0x5025('0x10')][_0x5b29c4[_0x5025('0x25')]][_0x5025('0x57')]>0x0&&this['channels'][_0x5b29c4['uniqueid']][_0x5025('0x1b')]===_0x5025('0x58')){this[_0x5025('0x50')](_0x5b29c4[_0x5025('0x25')],!![]);}else{this[_0x5025('0x50')](_0x5b29c4['uniqueid'],![],this[_0x5025('0x10')][_0x5b29c4['uniqueid']][_0x5025('0x59')]?_0x5025('0x5a')+this['channels'][_0x5b29c4[_0x5025('0x25')]][_0x5025('0x59')]:_0x5025('0x5b'));}}}};Fax['prototype']['send']=function(_0x485905){var _0x1e1d70=this;return new BPromise(function(_0x489777,_0x260b00){_0x1e1d70['execOriginate'](_0x485905,_0x1e1d70['faxAccounts'][_0x485905[_0x5025('0x5c')]])[_0x5025('0x3f')](function(_0x6feb3){ut[_0x5025('0x4c')]('[Fax][execOriginate][success]',_0x6feb3);_0x489777(ut[_0x5025('0x3a')](_0x5025('0x5d')));})['catch'](function(_0x301190){ut['logger']('[Fax][execOriginate][failure]',_0x301190);updateStatus(_0x485905);_0x260b00(ut['message']('Fax\x20failed'));});});};Fax[_0x5025('0x21')]['checkAfterSend']=function(_0x1c4994){var _0x143e4b=this;return new BPromise(function(_0x15f0ca,_0x39f441){var _0x1a2fa3=_0x143e4b[_0x5025('0x5e')](_0x143e4b[_0x5025('0x11')][_0x1c4994[_0x5025('0x5c')]]['Trunk'],_0x1c4994);if(_0x1a2fa3[_0x5025('0x5f')]){_0x15f0ca(ut[_0x5025('0x3a')](_0x5025('0x60')));}else{_0x39f441(ut[_0x5025('0x3a')](_0x1a2fa3['message']));}});};function originate(_0x1c96e3,_0x4620de,_0xd1cab){return new BPromise(function(_0x3512c3,_0x76d618){if(_0xd1cab){var _0x293c20=util[_0x5025('0x61')](_0x5025('0x62'),path[_0x5025('0x3c')](_0x1c96e3[_0x5025('0x5')])[_0x5025('0x27')],_0x1c96e3[_0x5025('0x5')]);gs[_0x5025('0x63')](_0x293c20)[_0x5025('0x3f')](function(){_0x1c96e3[_0x5025('0x5')]=util[_0x5025('0x61')](_0x5025('0x64'),path[_0x5025('0x3c')](_0x1c96e3[_0x5025('0x5')])[_0x5025('0x65')],path[_0x5025('0x3c')](_0x1c96e3[_0x5025('0x5')])[_0x5025('0x27')]);_0x4620de[_0x5025('0x66')]=_0x1c96e3['path'];ut[_0x5025('0x4c')](_0x5025('0x67'),'');ami[_0x5025('0x68')](ut[_0x5025('0x69')](_0x1c96e3,_0x4620de))[_0x5025('0x3f')](function(_0x555d8b){_0x3512c3(_0x555d8b);})[_0x5025('0x41')](function(_0x5b3370){_0x76d618(_0x5b3370);});})[_0x5025('0x41')](function(_0x361d1a){_0x76d618(_0x361d1a);});}else{ami[_0x5025('0x68')](ut[_0x5025('0x69')](_0x1c96e3,_0x4620de))[_0x5025('0x3f')](function(_0x271123){_0x3512c3(_0x271123);})[_0x5025('0x41')](function(_0x14a4fb){_0x76d618(_0x14a4fb);});}});}Fax[_0x5025('0x21')]['execOriginate']=function(_0x16626d,_0x629a0a){var _0x3c5fc0=this;return new BPromise(function(_0x2bbfdd,_0x1e644c){var _0x3095ea=uuid['v4']();var _0x4defd9=ut[_0x5025('0x6a')](_0x16626d,_0x629a0a);_0x3c5fc0[_0x5025('0x13')][_0x3095ea]=new Action(_0x3095ea,_0x629a0a,_0x16626d);var _0x584e36=_0x3c5fc0[_0x5025('0x13')][_0x3095ea];if(path[_0x5025('0x3c')](_0x16626d[_0x5025('0x5')])['ext']==='.pdf'){originate(_0x584e36,_0x4defd9,!![])[_0x5025('0x3f')](function(_0x121730){_0x2bbfdd(_0x121730);})[_0x5025('0x41')](function(_0x1d56d8){_0x1e644c(_0x1d56d8);});}else{originate(_0x584e36,_0x4defd9,![])[_0x5025('0x3f')](function(_0x1cfbb5){_0x2bbfdd(_0x1cfbb5);})[_0x5025('0x41')](function(_0x325c6f){_0x1e644c(_0x325c6f);});}});};Fax[_0x5025('0x21')][_0x5025('0x6b')]=function(_0x58efbe){return!_[_0x5025('0x6c')](_0x58efbe)&&!_['isNil'](_0x58efbe[_0x5025('0x27')])&&!_[_0x5025('0x6c')](_0x58efbe['active'])&&_0x58efbe['active']&&!_[_0x5025('0x6c')](this[_0x5025('0x12')][util[_0x5025('0x61')](_0x5025('0x6d'),_0x58efbe['name'])])&&!_['isNil'](this[_0x5025('0x12')][util['format']('SIP/%s',_0x58efbe['name'])][_0x5025('0x2f')])&&(this['trunks'][util['format'](_0x5025('0x6d'),_0x58efbe[_0x5025('0x27')])][_0x5025('0x2f')]===_0x5025('0x6e')||this['trunks'][util[_0x5025('0x61')](_0x5025('0x6d'),_0x58efbe[_0x5025('0x27')])][_0x5025('0x2f')]===_0x5025('0x6f'));};Fax[_0x5025('0x21')][_0x5025('0x5e')]=function(_0x4918cc,_0x53060f){if(!this[_0x5025('0x6b')](_0x4918cc)){ut[_0x5025('0x4c')](_0x5025('0x70'),_[_0x5025('0x6c')](_0x4918cc)?'':_0x4918cc[_0x5025('0x27')]+_0x5025('0x71'));return{'isValid':![],'message':_0x5025('0x72')};}if(_[_0x5025('0x6c')](_0x53060f[_0x5025('0x9')])){ut['logger'](_0x5025('0x73'),JSON[_0x5025('0x43')](_0x53060f));return{'isValid':![],'message':_0x5025('0x74')};}if(_[_0x5025('0x6c')](_0x53060f[_0x5025('0x5')])){ut['logger'](_0x5025('0x75'),JSON[_0x5025('0x43')](_0x53060f));return{'isValid':![],'message':_0x5025('0x76')};}return{'isValid':!![],'message':_0x5025('0x77')};};module[_0x5025('0x78')]=Fax;
\ No newline at end of file
+var _0xc7a2=['AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','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','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','reason'];(function(_0x16e2da,_0xc1bba9){var _0x2d9246=function(_0xf9a0d4){while(--_0xf9a0d4){_0x16e2da['push'](_0x16e2da['shift']());}};_0x2d9246(++_0xc1bba9);}(_0xc7a2,0xa4));var _0x2c7a=function(_0x4f7b43,_0x119c22){_0x4f7b43=_0x4f7b43-0x0;var _0x2fcdf3=_0xc7a2[_0x4f7b43];return _0x2fcdf3;};'use strict';var util=require(_0x2c7a('0x0'));var _=require(_0x2c7a('0x1'));var BPromise=require(_0x2c7a('0x2'));var uuid=require(_0x2c7a('0x3'));var moment=require(_0x2c7a('0x4'));var path=require('path');var tiff2pdf=require(_0x2c7a('0x5'));var gs=require(_0x2c7a('0x6'));var logger=require(_0x2c7a('0x7'))(_0x2c7a('0x8'));var ami=require('../ami');var rpcDb=require(_0x2c7a('0x9'));var Channel=require('./channel');var ut=require(_0x2c7a('0xa'));var Action=require(_0x2c7a('0xb'));var faxAccount=require(_0x2c7a('0xc'));var attachment=require(_0x2c7a('0xd'));var faxMessage=require(_0x2c7a('0xe'));function Fax(_0x120010){this[_0x2c7a('0xf')]={};this['faxAccounts']=_0x120010[_0x2c7a('0x10')];this[_0x2c7a('0x11')]=_0x120010['trunks'];this[_0x2c7a('0x12')]={};ami['on'](_0x2c7a('0x13'),this[_0x2c7a('0x14')]['bind'](this));ami['on'](_0x2c7a('0x15'),this[_0x2c7a('0x16')][_0x2c7a('0x17')](this));ami['on'](_0x2c7a('0x18'),this[_0x2c7a('0x19')][_0x2c7a('0x17')](this));ami['on'](_0x2c7a('0x1a'),this[_0x2c7a('0x1b')][_0x2c7a('0x17')](this));ami['on'](_0x2c7a('0x1c'),this[_0x2c7a('0x1d')][_0x2c7a('0x17')](this));ami['on']('receivefax',this[_0x2c7a('0x1e')]['bind'](this));ami['on'](_0x2c7a('0x1f'),this[_0x2c7a('0x20')][_0x2c7a('0x17')](this));ami['on'](_0x2c7a('0x21'),this[_0x2c7a('0x22')][_0x2c7a('0x17')](this));}Fax[_0x2c7a('0x23')][_0x2c7a('0x14')]=function(_0x25435c){if(_0x25435c[_0x2c7a('0x24')]===_0x2c7a('0x25')){for(var _0x185141 in this[_0x2c7a('0x10')]){if(this['faxAccounts'][_0x2c7a('0x26')](_0x185141)){if(_0x25435c[_0x2c7a('0x27')]===this[_0x2c7a('0x10')][_0x185141][_0x2c7a('0x28')]){this['channels'][_0x25435c[_0x2c7a('0x29')]]={};this[_0x2c7a('0xf')][_0x25435c[_0x2c7a('0x29')]]['channel']=_0x25435c[_0x2c7a('0x2a')];this[_0x2c7a('0xf')][_0x25435c[_0x2c7a('0x29')]]['id']=this[_0x2c7a('0x10')][_0x185141]['id'];this[_0x2c7a('0xf')][_0x25435c[_0x2c7a('0x29')]]['name']=this['faxAccounts'][_0x185141][_0x2c7a('0x2b')];logger[_0x2c7a('0x2c')](_0x25435c[_0x2c7a('0x29')],_0x2c7a('0x2d'));}}}}if(this[_0x2c7a('0x12')][_0x25435c[_0x2c7a('0x29')]]){this['channels'][_0x25435c[_0x2c7a('0x29')]]={};this[_0x2c7a('0xf')][_0x25435c[_0x2c7a('0x29')]][_0x2c7a('0x2a')]=_0x25435c[_0x2c7a('0x2a')];logger[_0x2c7a('0x2c')](_0x25435c['uniqueid'],_0x2c7a('0x2d'));}};Fax[_0x2c7a('0x23')]['syncVarSet']=function(_0xc46c2b){if(this[_0x2c7a('0xf')][_0xc46c2b[_0x2c7a('0x29')]]){for(var _0x206161 in _0xc46c2b[_0x2c7a('0x2e')]){if(_0xc46c2b['variable'][_0x2c7a('0x26')](_0x206161)){this[_0x2c7a('0xf')][_0xc46c2b[_0x2c7a('0x29')]][_0x206161]=_0xc46c2b['value'];}}}};Fax[_0x2c7a('0x23')][_0x2c7a('0x19')]=function(_0x1f2635){if(this[_0x2c7a('0xf')][_0x1f2635[_0x2c7a('0x29')]]){this[_0x2c7a('0xf')][_0x1f2635[_0x2c7a('0x29')]][_0x2c7a('0x2f')]=_0x1f2635[_0x2c7a('0x2f')];this[_0x2c7a('0xf')][_0x1f2635[_0x2c7a('0x29')]]['channelstatedesc']=_0x1f2635['channelstatedesc'];}};Fax['prototype']['syncNewExten']=function(_0xbc04a2){if(this['channels'][_0xbc04a2['uniqueid']]){for(var _0x2a7b57 in _0xbc04a2[_0x2c7a('0x2e')]){if(_0xbc04a2['variable'][_0x2c7a('0x26')](_0x2a7b57)){this[_0x2c7a('0xf')][_0xbc04a2[_0x2c7a('0x29')]][_0x2a7b57]=_0xbc04a2['value'];}}}};Fax[_0x2c7a('0x23')][_0x2c7a('0x1d')]=function(_0x29b320){if(this[_0x2c7a('0xf')][_0x29b320[_0x2c7a('0x29')]]){this['channels'][_0x29b320[_0x2c7a('0x29')]][_0x2c7a('0x30')]=_0x29b320['operation'];this[_0x2c7a('0xf')][_0x29b320['uniqueid']][_0x2c7a('0x31')]=_0x29b320[_0x2c7a('0x31')];this[_0x2c7a('0xf')][_0x29b320[_0x2c7a('0x29')]][_0x2c7a('0x28')]=_0x29b320[_0x2c7a('0x28')];this[_0x2c7a('0xf')][_0x29b320[_0x2c7a('0x29')]][_0x2c7a('0x32')]=_0x29b320[_0x2c7a('0x32')];logger['info'](_0x29b320[_0x2c7a('0x29')],'\x20syncFaxStatus\x20');}};Fax[_0x2c7a('0x23')][_0x2c7a('0x1e')]=function(_0x39c211){var _0x271570=this;if(this[_0x2c7a('0xf')][_0x39c211['uniqueid']]){var _0x48c027=this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]]['id'];this[_0x2c7a('0xf')][_0x39c211['uniqueid']]['remotestationid']=_0x39c211[_0x2c7a('0x33')];this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x34')]=_0x39c211[_0x2c7a('0x34')];this[_0x2c7a('0xf')][_0x39c211['uniqueid']][_0x2c7a('0x28')]=_0x39c211['localstationid'];this['channels'][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x35')]=_0x39c211[_0x2c7a('0x35')];this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x36')]=_0x39c211[_0x2c7a('0x36')];this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x32')]=_0x39c211[_0x2c7a('0x32')];this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]]['calleridnum']=_0x39c211[_0x2c7a('0x37')];if(this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x34')]>0x0){tiff2pdf(_0x39c211[_0x2c7a('0x32')],_0x2c7a('0x38'),function(_0xfb486d){logger[_0x2c7a('0x2c')](_0x39c211[_0x2c7a('0x29')],'\x20result\x20conversion\x20file\x20',_0xfb486d[_0x2c7a('0x39')]);attachment[_0x2c7a('0x3a')]({'name':path[_0x2c7a('0x3b')](_0x39c211[_0x2c7a('0x32')])['name'],'basename':path[_0x2c7a('0x3b')](_0x39c211[_0x2c7a('0x32')])['name']+_0x2c7a('0x3c'),'type':_0x2c7a('0x3d')})[_0x2c7a('0x3e')](function(_0x2876e0){faxAccount['notify'](_0x48c027,{'from':_0x39c211[_0x2c7a('0x37')],'mapKey':'fax','body':path[_0x2c7a('0x3b')](_0x39c211[_0x2c7a('0x32')])['name']+_0x2c7a('0x3c'),'AttachmentId':_0x2876e0['id']})[_0x2c7a('0x3f')](function(_0x25d21c){logger[_0x2c7a('0x40')](_0x39c211[_0x2c7a('0x29')],_0x2c7a('0x41'),JSON[_0x2c7a('0x42')](_0x25d21c));});})[_0x2c7a('0x3f')](function(_0x180ea1){logger['error'](_0x39c211[_0x2c7a('0x29')],_0x2c7a('0x43'),JSON['stringify'](_0x180ea1));});});}logger[_0x2c7a('0x2c')](_0x39c211['uniqueid'],'\x20receiveFax\x20');}};Fax[_0x2c7a('0x23')]['syncOriginateResponse']=function(_0x827378){if(this[_0x2c7a('0x12')][_0x827378[_0x2c7a('0x29')]]){_[_0x2c7a('0x44')](this[_0x2c7a('0xf')][_0x827378[_0x2c7a('0x29')]],_['pick'](_0x827378,['response',_0x2c7a('0x45')]));}};function updateStatus(_0x5db1cf){if(_0x5db1cf[_0x2c7a('0x46')]){faxMessage[_0x2c7a('0x47')](_0x5db1cf[_0x2c7a('0x46')],{'failMessage':_0x2c7a('0x48')})[_0x2c7a('0x3e')](function(_0x5242a6){ut[_0x2c7a('0x49')]('[Fax][Message][Error][Updated]',_0x5242a6);})['catch'](function(_0x23d0a0){ut[_0x2c7a('0x49')](_0x2c7a('0x4a'),_0x23d0a0);});}else{ut['logger'](_0x2c7a('0x4b'));}}Fax[_0x2c7a('0x23')][_0x2c7a('0x4c')]=function(_0x47f52f,_0x5889f8,_0x3b9a72){var _0x1cd6f8=this;var _0x522351={};if(_0x5889f8){_0x522351={'read':_0x5889f8};}else{_0x522351={'failMessage':_0x3b9a72};}if(this[_0x2c7a('0x12')][_0x47f52f]['AttachmentId']){faxMessage[_0x2c7a('0x47')](this[_0x2c7a('0x12')][_0x47f52f][_0x2c7a('0x46')],_0x522351)[_0x2c7a('0x3e')](function(_0x35b0c0){ut[_0x2c7a('0x49')](_0x2c7a('0x4d'),_0x35b0c0);})[_0x2c7a('0x3f')](function(_0x403b98){ut['logger'](_0x2c7a('0x4e'),_0x403b98);})[_0x2c7a('0x4f')](function(){delete _0x1cd6f8[_0x2c7a('0xf')][_0x47f52f];delete _0x1cd6f8[_0x2c7a('0x12')][_0x47f52f];});}else{ut['logger'](_0x2c7a('0x50'));delete this[_0x2c7a('0xf')][_0x47f52f];delete this[_0x2c7a('0x12')][_0x47f52f];}};Fax[_0x2c7a('0x23')][_0x2c7a('0x20')]=function(_0x1a53ca){var _0x14d697=this;if(this[_0x2c7a('0xf')][_0x1a53ca['uniqueid']]){if(this['actions'][_0x1a53ca[_0x2c7a('0x29')]]){this[_0x2c7a('0xf')][_0x1a53ca[_0x2c7a('0x29')]]['id']=this[_0x2c7a('0x12')][_0x1a53ca[_0x2c7a('0x29')]]['id'];this[_0x2c7a('0xf')][_0x1a53ca[_0x2c7a('0x29')]][_0x2c7a('0x2b')]=this[_0x2c7a('0x12')][_0x1a53ca[_0x2c7a('0x29')]][_0x2c7a('0x2b')];}logger[_0x2c7a('0x2c')](_0x1a53ca[_0x2c7a('0x29')],this['actions'][_0x1a53ca['uniqueid']]?_0x2c7a('0x51'):_0x2c7a('0x52'),JSON[_0x2c7a('0x42')](this['channels'][_0x1a53ca['uniqueid']]));if(this[_0x2c7a('0x12')][_0x1a53ca['uniqueid']]){if(this[_0x2c7a('0xf')][_0x1a53ca[_0x2c7a('0x29')]][_0x2c7a('0x53')]>0x0&&this['channels'][_0x1a53ca['uniqueid']][_0x2c7a('0x1c')]==='SUCCESS'){this[_0x2c7a('0x4c')](_0x1a53ca[_0x2c7a('0x29')],!![]);}else{this[_0x2c7a('0x4c')](_0x1a53ca[_0x2c7a('0x29')],![],this[_0x2c7a('0xf')][_0x1a53ca['uniqueid']][_0x2c7a('0x54')]?_0x2c7a('0x55')+this[_0x2c7a('0xf')][_0x1a53ca[_0x2c7a('0x29')]][_0x2c7a('0x54')]:_0x2c7a('0x56'));}}}};Fax['prototype'][_0x2c7a('0x57')]=function(_0x4d5498){var _0x3da5a9=this;return new BPromise(function(_0x335d82,_0x475fe8){_0x3da5a9[_0x2c7a('0x58')](_0x4d5498,_0x3da5a9[_0x2c7a('0x10')][_0x4d5498[_0x2c7a('0x59')]])[_0x2c7a('0x3e')](function(_0x57c053){ut[_0x2c7a('0x49')](_0x2c7a('0x5a'),_0x57c053);_0x335d82(ut[_0x2c7a('0x39')](_0x2c7a('0x5b')));})[_0x2c7a('0x3f')](function(_0x399de7){ut['logger']('[Fax][execOriginate][failure]',_0x399de7);updateStatus(_0x4d5498);_0x475fe8(ut[_0x2c7a('0x39')](_0x2c7a('0x5c')));});});};Fax[_0x2c7a('0x23')][_0x2c7a('0x5d')]=function(_0xf12463){var _0x24f2e4=this;return new BPromise(function(_0x22894f,_0x62a313){var _0x1b678f=_0x24f2e4[_0x2c7a('0x5e')](_0x24f2e4[_0x2c7a('0x10')][_0xf12463['FaxAccountId']][_0x2c7a('0x5f')],_0xf12463);if(_0x1b678f[_0x2c7a('0x60')]){_0x22894f(ut[_0x2c7a('0x39')](_0x2c7a('0x61')));}else{_0x62a313(ut[_0x2c7a('0x39')](_0x1b678f[_0x2c7a('0x39')]));}});};function originate(_0x4a08d6,_0x2090cd,_0x27e5eb){return new BPromise(function(_0x19b86b,_0x105358){if(_0x27e5eb){var _0x3f1d1d=util[_0x2c7a('0x62')](_0x2c7a('0x63'),path['parse'](_0x4a08d6[_0x2c7a('0x64')])[_0x2c7a('0x2b')],_0x4a08d6[_0x2c7a('0x64')]);gs[_0x2c7a('0x65')](_0x3f1d1d)[_0x2c7a('0x3e')](function(){_0x4a08d6[_0x2c7a('0x64')]=util[_0x2c7a('0x62')]('%s/%s.tif',path['parse'](_0x4a08d6['path'])['dir'],path[_0x2c7a('0x3b')](_0x4a08d6[_0x2c7a('0x64')])[_0x2c7a('0x2b')]);_0x2090cd[_0x2c7a('0x66')]=_0x4a08d6[_0x2c7a('0x64')];ut[_0x2c7a('0x49')](_0x2c7a('0x67'),'');ami[_0x2c7a('0x68')](ut[_0x2c7a('0x69')](_0x4a08d6,_0x2090cd))['then'](function(_0x52de0e){_0x19b86b(_0x52de0e);})[_0x2c7a('0x3f')](function(_0x5dbbe0){_0x105358(_0x5dbbe0);});})[_0x2c7a('0x3f')](function(_0x53fc5c){_0x105358(_0x53fc5c);});}else{ami[_0x2c7a('0x68')](ut['variablesAction'](_0x4a08d6,_0x2090cd))['then'](function(_0x25a9df){_0x19b86b(_0x25a9df);})[_0x2c7a('0x3f')](function(_0x4ceee4){_0x105358(_0x4ceee4);});}});}Fax[_0x2c7a('0x23')][_0x2c7a('0x58')]=function(_0x9e3368,_0x286bf1){var _0x3d1f87=this;return new BPromise(function(_0x3c81c8,_0x241d19){var _0x5f3ad3=uuid['v4']();var _0x185a29=ut['addVariables'](_0x9e3368,_0x286bf1);_0x3d1f87[_0x2c7a('0x12')][_0x5f3ad3]=new Action(_0x5f3ad3,_0x286bf1,_0x9e3368);var _0x50ada8=_0x3d1f87[_0x2c7a('0x12')][_0x5f3ad3];if(path[_0x2c7a('0x3b')](_0x9e3368[_0x2c7a('0x64')])[_0x2c7a('0x6a')]===_0x2c7a('0x3c')){originate(_0x50ada8,_0x185a29,!![])[_0x2c7a('0x3e')](function(_0x1f690f){_0x3c81c8(_0x1f690f);})[_0x2c7a('0x3f')](function(_0x33621e){_0x241d19(_0x33621e);});}else{originate(_0x50ada8,_0x185a29,![])[_0x2c7a('0x3e')](function(_0x1dc96d){_0x3c81c8(_0x1dc96d);})[_0x2c7a('0x3f')](function(_0x575bc2){_0x241d19(_0x575bc2);});}});};Fax[_0x2c7a('0x23')][_0x2c7a('0x6b')]=function(_0x381748){return!_[_0x2c7a('0x6c')](_0x381748)&&!_[_0x2c7a('0x6c')](_0x381748['name'])&&!_[_0x2c7a('0x6c')](_0x381748[_0x2c7a('0x6d')])&&_0x381748[_0x2c7a('0x6d')]&&!_[_0x2c7a('0x6c')](this[_0x2c7a('0x11')][util[_0x2c7a('0x62')](_0x2c7a('0x6e'),_0x381748[_0x2c7a('0x2b')])])&&!_[_0x2c7a('0x6c')](this['trunks'][util[_0x2c7a('0x62')](_0x2c7a('0x6e'),_0x381748['name'])][_0x2c7a('0x31')])&&(this[_0x2c7a('0x11')][util[_0x2c7a('0x62')]('SIP/%s',_0x381748[_0x2c7a('0x2b')])][_0x2c7a('0x31')]===_0x2c7a('0x6f')||this[_0x2c7a('0x11')][util[_0x2c7a('0x62')]('SIP/%s',_0x381748[_0x2c7a('0x2b')])][_0x2c7a('0x31')]==='unmonitored');};Fax[_0x2c7a('0x23')]['checkTrunk']=function(_0xf00a9c,_0x11bdd2){if(!this[_0x2c7a('0x6b')](_0xf00a9c)){ut['logger'](_0x2c7a('0x70'),_[_0x2c7a('0x6c')](_0xf00a9c)?'':_0xf00a9c[_0x2c7a('0x2b')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x2c7a('0x71')};}if(_['isNil'](_0x11bdd2[_0x2c7a('0x8')])){ut[_0x2c7a('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x11bdd2));return{'isValid':![],'message':_0x2c7a('0x72')};}if(_[_0x2c7a('0x6c')](_0x11bdd2[_0x2c7a('0x64')])){ut[_0x2c7a('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x11bdd2));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x2c7a('0x73')};};module[_0x2c7a('0x74')]=Fax;
\ No newline at end of file
index a8aaa0c..33fdbad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f7c=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','resolve','then','notify','catch','util'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x3f7c,0x1ee));var _0xc3f7=function(_0x14a3f6,_0x207995){_0x14a3f6=_0x14a3f6-0x0;var _0x4d782e=_0x3f7c[_0x14a3f6];return _0x4d782e;};'use strict';var util=require(_0xc3f7('0x0'));var BPromise=require(_0xc3f7('0x1'));var logger=require(_0xc3f7('0x2'))(_0xc3f7('0x3'));var _=require(_0xc3f7('0x4'));var faxAccount=require(_0xc3f7('0x5'));function loggerCatch(_0x5456f3){return function(_0x81a52){logger[_0xc3f7('0x6')](_0x5456f3,util['inspect'](_0x81a52,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x3cc5d6,_0x1b412a){return BPromise[_0xc3f7('0x7')]()[_0xc3f7('0x8')](faxAccount[_0xc3f7('0x9')](_0x3cc5d6,_0x1b412a))[_0xc3f7('0xa')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0x2f9c=['../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x429ecf,_0x1f5871){var _0x5920fb=function(_0xefffce){while(--_0xefffce){_0x429ecf['push'](_0x429ecf['shift']());}};_0x5920fb(++_0x1f5871);}(_0x2f9c,0x11a));var _0xc2f9=function(_0x4c535c,_0x24320e){_0x4c535c=_0x4c535c-0x0;var _0x19985c=_0x2f9c[_0x4c535c];return _0x19985c;};'use strict';var util=require(_0xc2f9('0x0'));var BPromise=require(_0xc2f9('0x1'));var logger=require(_0xc2f9('0x2'))(_0xc2f9('0x3'));var _=require('lodash');var faxAccount=require(_0xc2f9('0x4'));function loggerCatch(_0x16aa25){return function(_0x207bd1){logger[_0xc2f9('0x5')](_0x16aa25,util[_0xc2f9('0x6')](_0x207bd1,{'showHidden':![],'depth':null}));};}exports[_0xc2f9('0x7')]=function(_0x3a5b2e,_0x5323d3){return BPromise[_0xc2f9('0x8')]()[_0xc2f9('0x9')](faxAccount[_0xc2f9('0x7')](_0x3a5b2e,_0x5323d3))['catch'](loggerCatch(_0xc2f9('0xa')));};
\ No newline at end of file
index 70fdebd..e68dcd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d75=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird'];(function(_0x45f9b3,_0x57d488){var _0xc76708=function(_0x1923d7){while(--_0x1923d7){_0x45f9b3['push'](_0x45f9b3['shift']());}};_0xc76708(++_0x57d488);}(_0x0d75,0x12f));var _0x50d7=function(_0x479f43,_0x5822a9){_0x479f43=_0x479f43-0x0;var _0x3f26e8=_0x0d75[_0x479f43];return _0x3f26e8;};'use strict';var util=require('util');var logger=require(_0x50d7('0x0'))(_0x50d7('0x1'));var BPromise=require(_0x50d7('0x2'));var exec=require('child_process')[_0x50d7('0x3')];exports[_0x50d7('0x4')]=function(_0x45e05d){return new BPromise(function(_0x3f5436,_0x663ed7){exec(_0x45e05d,function(_0x25f4e7,_0x4bb69d,_0x1a2be9){logger[_0x50d7('0x5')](_0x50d7('0x6'),_0x4bb69d);if(_0x25f4e7){logger[_0x50d7('0x5')]('Exec\x20gs',_0x50d7('0x7'),util[_0x50d7('0x8')](_0x25f4e7,{'showHidden':![],'depth':null}),_0x4bb69d,_0x1a2be9);_0x663ed7(_0x25f4e7);}_0x3f5436(_0x4bb69d);});});};
\ No newline at end of file
+var _0xa62d=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','exec','execute','info','Exec\x20gs'];(function(_0x1a19e7,_0x2a1baf){var _0x9c31ee=function(_0x4f40f9){while(--_0x4f40f9){_0x1a19e7['push'](_0x1a19e7['shift']());}};_0x9c31ee(++_0x2a1baf);}(_0xa62d,0x134));var _0xda62=function(_0x2bac4c,_0x31126d){_0x2bac4c=_0x2bac4c-0x0;var _0x3852bd=_0xa62d[_0x2bac4c];return _0x3852bd;};'use strict';var util=require(_0xda62('0x0'));var logger=require(_0xda62('0x1'))(_0xda62('0x2'));var BPromise=require('bluebird');var exec=require('child_process')[_0xda62('0x3')];exports[_0xda62('0x4')]=function(_0x2c6cc1){return new BPromise(function(_0xe2be98,_0x5553f1){exec(_0x2c6cc1,function(_0xd9a2a6,_0x1777f1,_0x5cc818){logger[_0xda62('0x5')](_0xda62('0x6'),_0x1777f1);if(_0xd9a2a6){logger[_0xda62('0x5')](_0xda62('0x6'),_0xda62('0x7'),util[_0xda62('0x8')](_0xd9a2a6,{'showHidden':![],'depth':null}),_0x1777f1,_0x5cc818);_0x5553f1(_0xd9a2a6);}_0xe2be98(_0x1777f1);});});};
\ No newline at end of file
index d9a9277..67af6a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7961=['format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','message','logger','info','ecm','headerinfo','minrate'];(function(_0x4558bb,_0x43c43c){var _0x116fc5=function(_0x32fd87){while(--_0x32fd87){_0x4558bb['push'](_0x4558bb['shift']());}};_0x116fc5(++_0x43c43c);}(_0x7961,0x199));var _0x1796=function(_0x41c418,_0x2d0224){_0x41c418=_0x41c418-0x0;var _0x34c4f3=_0x7961[_0x41c418];return _0x34c4f3;};'use strict';var util=require('util');var _=require(_0x1796('0x0'));var moment=require(_0x1796('0x1'));var logger=require(_0x1796('0x2'))('fax');exports[_0x1796('0x3')]=function(_0xfd891d){return{'message':_0xfd891d};};exports[_0x1796('0x4')]=function(_0x49a321,_0x5be45a){logger[_0x1796('0x5')](_0x49a321,util['inspect'](_0x5be45a,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2cd518,_0x4f5083){var _0x5bbf2a={'XMF-ECM':_0x4f5083[_0x1796('0x6')],'XMF-HEADERINFO':_0x4f5083[_0x1796('0x7')],'XMF-MINRATE':_0x4f5083[_0x1796('0x8')],'XMF-MAXRATE':_0x4f5083['maxrate'],'XMF-MODEM':util[_0x1796('0x9')](_0x1796('0xa'),_0x4f5083[_0x1796('0xb')]),'XMF-GATEWAY':_0x4f5083[_0x1796('0xc')],'XMF-FAXDETECT':_0x4f5083[_0x1796('0xd')],'XMF-T38TIMEOUT':_0x4f5083['t38timeout'],'XMF-LOCALSTATIONID':_0x4f5083[_0x1796('0xe')],'XMF-PATH':_0x2cd518[_0x1796('0xf')]};return _0x5bbf2a;};exports[_0x1796('0x10')]=function(_0x463aa3,_0x2815f0){return{'actionid':_0x463aa3[_0x1796('0x11')],'action':_0x1796('0x12'),'channel':_0x463aa3[_0x1796('0x13')],'Exten':_0x1796('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0x1796('0x9')](_0x1796('0x15'),_0x463aa3['headerinfo']?_0x463aa3[_0x1796('0x7')]:'',_0x463aa3[_0x1796('0xe')]),'variable':_0x2815f0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x463aa3[_0x1796('0x11')]};};
\ No newline at end of file
+var _0x4571=['channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','lodash','moment','../../../../config/logger','logger','info','inspect','addVariables','maxrate','format','modem','faxdetect','t38timeout','localstationid','path','variablesAction'];(function(_0x1dd4de,_0x189290){var _0xf23408=function(_0x1b47e2){while(--_0x1b47e2){_0x1dd4de['push'](_0x1dd4de['shift']());}};_0xf23408(++_0x189290);}(_0x4571,0xe1));var _0x1457=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x4571[_0x26b8b5];return _0x2150a9;};'use strict';var util=require('util');var _=require(_0x1457('0x0'));var moment=require(_0x1457('0x1'));var logger=require(_0x1457('0x2'))('fax');exports['message']=function(_0x5237d8){return{'message':_0x5237d8};};exports[_0x1457('0x3')]=function(_0x4d7bed,_0x3eb20e){logger[_0x1457('0x4')](_0x4d7bed,util[_0x1457('0x5')](_0x3eb20e,{'showHidden':![],'depth':null}));};exports[_0x1457('0x6')]=function(_0x2d7311,_0x5126a6){var _0x3928d1={'XMF-ECM':_0x5126a6['ecm'],'XMF-HEADERINFO':_0x5126a6['headerinfo'],'XMF-MINRATE':_0x5126a6['minrate'],'XMF-MAXRATE':_0x5126a6[_0x1457('0x7')],'XMF-MODEM':util[_0x1457('0x8')]('\x22%s\x22',_0x5126a6[_0x1457('0x9')]),'XMF-GATEWAY':_0x5126a6['gateway'],'XMF-FAXDETECT':_0x5126a6[_0x1457('0xa')],'XMF-T38TIMEOUT':_0x5126a6[_0x1457('0xb')],'XMF-LOCALSTATIONID':_0x5126a6[_0x1457('0xc')],'XMF-PATH':_0x2d7311[_0x1457('0xd')]};return _0x3928d1;};exports[_0x1457('0xe')]=function(_0x493788,_0x28fd27){return{'actionid':_0x493788['uniqueid'],'action':'originate','channel':_0x493788[_0x1457('0xf')],'Exten':_0x1457('0x10'),'Context':_0x1457('0x11'),'Priority':'1','callerid':util[_0x1457('0x8')](_0x1457('0x12'),_0x493788[_0x1457('0x13')]?_0x493788[_0x1457('0x13')]:'',_0x493788[_0x1457('0xc')]),'variable':_0x28fd27,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x493788['uniqueid']};};
\ No newline at end of file
index 75c67ff..6b4585f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f6a=['initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts'];(function(_0x2eb123,_0x25954f){var _0x8e101=function(_0xc37060){while(--_0xc37060){_0x2eb123['push'](_0x2eb123['shift']());}};_0x8e101(++_0x25954f);}(_0x2f6a,0x12c));var _0xa2f6=function(_0x440935,_0x28fe12){_0x440935=_0x440935-0x0;var _0x629c2c=_0x2f6a[_0x440935];return _0x629c2c;};'use strict';var BPromise=require(_0xa2f6('0x0'));var util=require(_0xa2f6('0x1'));var moment=require(_0xa2f6('0x2'));var server=require(_0xa2f6('0x3'));var Realtime=require(_0xa2f6('0x4'));var Report=require('./report');var Acw=require(_0xa2f6('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xa2f6('0x6'));var Preview=require('./preview');var Fax=require(_0xa2f6('0x7'));var user=require(_0xa2f6('0x8'));var voiceQueue=require(_0xa2f6('0x9'));var voiceQueueReport=require(_0xa2f6('0xa'));var voiceCallReport=require(_0xa2f6('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0xa2f6('0xc'));var template=require(_0xa2f6('0xd'));var cmHopperHistory=require(_0xa2f6('0xe'));var campaign=require(_0xa2f6('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xa2f6('0x10'));var zendesk=require(_0xa2f6('0x11'));var salesforce=require(_0xa2f6('0x12'));var sugarcrm=require(_0xa2f6('0x13'));var freshdesk=require(_0xa2f6('0x14'));var desk=require(_0xa2f6('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xa2f6('0x16'));var freshsales=require(_0xa2f6('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xa2f6('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa2f6('0x19')](_0xa2f6('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa2f6('0x19')](_0xa2f6('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xa2f6('0x1b')]()[_0xa2f6('0x1c')](user[_0xa2f6('0x1d')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x1e')]())[_0xa2f6('0x1c')](user[_0xa2f6('0x1f')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x20')]())[_0xa2f6('0x1c')](trunk[_0xa2f6('0x21')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x22')]())[_0xa2f6('0x1c')](voiceQueue[_0xa2f6('0x23')]())['then'](realtime[_0xa2f6('0x24')]())['then'](trigger[_0xa2f6('0x25')]())['then'](realtime[_0xa2f6('0x26')]())['then'](template[_0xa2f6('0x27')]())['then'](realtime[_0xa2f6('0x28')]())['then'](zendesk[_0xa2f6('0x29')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x2a')]())[_0xa2f6('0x1c')](salesforce[_0xa2f6('0x2b')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x2c')]())[_0xa2f6('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x2d')]())[_0xa2f6('0x1c')](freshdesk[_0xa2f6('0x2e')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x2f')]())['then'](desk[_0xa2f6('0x30')]())['then'](realtime[_0xa2f6('0x31')]())[_0xa2f6('0x1c')](zoho[_0xa2f6('0x32')]())['then'](realtime[_0xa2f6('0x33')]())[_0xa2f6('0x1c')](vtiger[_0xa2f6('0x34')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x35')]())[_0xa2f6('0x1c')](freshsales[_0xa2f6('0x36')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x37')]())['then'](servicenow['getServicenowAccounts']())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x38')]())[_0xa2f6('0x1c')](dynamics365[_0xa2f6('0x39')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x3a')]())[_0xa2f6('0x1c')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0xa2f6('0x1c')](voiceExtension[_0xa2f6('0x3b')]())[_0xa2f6('0x1c')](realtime['initVoiceExtensions']())[_0xa2f6('0x1c')](faxAccount[_0xa2f6('0x3c')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x3d')]())[_0xa2f6('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xa2f6('0x1b')]()[_0xa2f6('0x1c')](voiceQueueReport[_0xa2f6('0x3e')]())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x3f')]())[_0xa2f6('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x40')]())[_0xa2f6('0x1c')](cmHopperHistory[_0xa2f6('0x41')]())[_0xa2f6('0x1c')](realtime['initCampaignHopperHistory']())[_0xa2f6('0x1c')](voiceCallReport['getVoiceCallReports']())[_0xa2f6('0x1c')](realtime[_0xa2f6('0x42')]())[_0xa2f6('0x1c')](function(_0x39e49b){})[_0xa2f6('0x43')](function(_0x316e4d){console[_0xa2f6('0x44')](_0x316e4d);});}function main(){return server[_0xa2f6('0x45')](realtime,preview,fax)[_0xa2f6('0x1c')](function(_0x14cf35){return initRealtime();})[_0xa2f6('0x1c')](function(){return initParams();})[_0xa2f6('0x1c')](function(){report[_0xa2f6('0x46')]();setInterval(initRealtime,0x1388);})[_0xa2f6('0x43')](function(_0x5d8c2d){console[_0xa2f6('0x44')](_0x5d8c2d);});}main();
\ No newline at end of file
+var _0x817e=['./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','resolve','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','sync','log','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger'];(function(_0x2811e2,_0x582de7){var _0x53dcd7=function(_0x5485ce){while(--_0x5485ce){_0x2811e2['push'](_0x2811e2['shift']());}};_0x53dcd7(++_0x582de7);}(_0x817e,0x16e));var _0xe817=function(_0xc982fa,_0x4bd27c){_0xc982fa=_0xc982fa-0x0;var _0x46d26b=_0x817e[_0xc982fa];return _0x46d26b;};'use strict';var BPromise=require(_0xe817('0x0'));var util=require(_0xe817('0x1'));var moment=require(_0xe817('0x2'));var server=require(_0xe817('0x3'));var Realtime=require(_0xe817('0x4'));var Report=require(_0xe817('0x5'));var Acw=require(_0xe817('0x6'));var Trigger=require(_0xe817('0x7'));var Dialer=require(_0xe817('0x8'));var Preview=require(_0xe817('0x9'));var Fax=require(_0xe817('0xa'));var user=require(_0xe817('0xb'));var voiceQueue=require(_0xe817('0xc'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xe817('0xd'));var trunk=require('./rpc/trunk');var trigger=require(_0xe817('0xe'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xe817('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xe817('0x10'));var zendesk=require(_0xe817('0x11'));var salesforce=require(_0xe817('0x12'));var sugarcrm=require(_0xe817('0x13'));var freshdesk=require(_0xe817('0x14'));var desk=require(_0xe817('0x15'));var zoho=require(_0xe817('0x16'));var vtiger=require(_0xe817('0x17'));var freshsales=require(_0xe817('0x18'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xe817('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe817('0x1a')](_0xe817('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe817('0x1a')](_0xe817('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xe817('0x1c')](user[_0xe817('0x1d')]())[_0xe817('0x1c')](realtime[_0xe817('0x1e')]())[_0xe817('0x1c')](user['getTelephones']())['then'](realtime['initTelephones']())['then'](trunk['getTrunks']())['then'](realtime[_0xe817('0x1f')]())[_0xe817('0x1c')](voiceQueue[_0xe817('0x20')]())['then'](realtime[_0xe817('0x21')]())['then'](trigger[_0xe817('0x22')]())[_0xe817('0x1c')](realtime[_0xe817('0x23')]())[_0xe817('0x1c')](template[_0xe817('0x24')]())[_0xe817('0x1c')](realtime[_0xe817('0x25')]())[_0xe817('0x1c')](zendesk[_0xe817('0x26')]())[_0xe817('0x1c')](realtime[_0xe817('0x27')]())[_0xe817('0x1c')](salesforce['getSalesforceAccounts']())[_0xe817('0x1c')](realtime[_0xe817('0x28')]())[_0xe817('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0xe817('0x1c')](realtime[_0xe817('0x29')]())[_0xe817('0x1c')](freshdesk[_0xe817('0x2a')]())[_0xe817('0x1c')](realtime[_0xe817('0x2b')]())[_0xe817('0x1c')](desk['getDeskAccounts']())['then'](realtime[_0xe817('0x2c')]())[_0xe817('0x1c')](zoho[_0xe817('0x2d')]())['then'](realtime[_0xe817('0x2e')]())[_0xe817('0x1c')](vtiger[_0xe817('0x2f')]())[_0xe817('0x1c')](realtime[_0xe817('0x30')]())[_0xe817('0x1c')](freshsales[_0xe817('0x31')]())[_0xe817('0x1c')](realtime[_0xe817('0x32')]())[_0xe817('0x1c')](servicenow['getServicenowAccounts']())[_0xe817('0x1c')](realtime[_0xe817('0x33')]())['then'](dynamics365[_0xe817('0x34')]())['then'](realtime['initDynamics365Accounts']())[_0xe817('0x1c')](campaign[_0xe817('0x35')]())[_0xe817('0x1c')](realtime['initCampaigns']())[_0xe817('0x1c')](voiceExtension[_0xe817('0x36')]())[_0xe817('0x1c')](realtime['initVoiceExtensions']())[_0xe817('0x1c')](faxAccount['getFaxAccounts']())[_0xe817('0x1c')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xe817('0x37')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0xe817('0x1c')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xe817('0x38')]())['then'](realtime[_0xe817('0x39')]())[_0xe817('0x1c')](cmHopperHistory[_0xe817('0x3a')]())[_0xe817('0x1c')](realtime[_0xe817('0x3b')]())[_0xe817('0x1c')](voiceCallReport[_0xe817('0x3c')]())[_0xe817('0x1c')](realtime[_0xe817('0x3d')]())[_0xe817('0x1c')](function(_0x3a1f26){})[_0xe817('0x3e')](function(_0x5108ff){console['log'](_0x5108ff);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x506f12){return initRealtime();})[_0xe817('0x1c')](function(){return initParams();})[_0xe817('0x1c')](function(){report[_0xe817('0x3f')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x535e23){console[_0xe817('0x40')](_0x535e23);});}main();
\ No newline at end of file
index 66faed2..f4900f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x25adae,_0x11762d){var _0x1d2953=function(_0x465ee9){while(--_0x465ee9){_0x25adae['push'](_0x25adae['shift']());}};_0x1d2953(++_0x11762d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0xcb91[_0x4d7379];return _0x46d7cf;};'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
+var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x390621,_0x19a53b){var _0xf8b114=function(_0x152282){while(--_0x152282){_0x390621['push'](_0x390621['shift']());}};_0xf8b114(++_0x19a53b);}(_0x70e0,0x17b));var _0x070e=function(_0x285a56,_0x5f2c8f){_0x285a56=_0x285a56-0x0;var _0x2c925f=_0x70e0[_0x285a56];return _0x2c925f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent;
\ No newline at end of file
index c058054..ee4395e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ea5=['dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x14f5af,_0x40fc1f){var _0x274c72=function(_0x292ce8){while(--_0x292ce8){_0x14f5af['push'](_0x14f5af['shift']());}};_0x274c72(++_0x40fc1f);}(_0x2ea5,0x1ad));var _0x52ea=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2ea5[_0x167cc1];return _0x10bc4b;};'use strict';function Campaign(_0x933008){this['id']=_0x933008['id']||0x0;this['name']=_0x933008['name']||'';this[_0x52ea('0x0')]=_0x933008[_0x52ea('0x0')]||_0x52ea('0x1');this[_0x52ea('0x2')]=0x0;this[_0x52ea('0x3')]=0x0;this[_0x52ea('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x52ea('0x5')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x933008[_0x52ea('0x6')];this[_0x52ea('0x7')]=_0x933008['limitCalls'];this[_0x52ea('0x8')]=_0x933008[_0x52ea('0x8')]||null;this[_0x52ea('0x9')]=_0x933008[_0x52ea('0x9')]?_0x933008[_0x52ea('0x9')]:null;this[_0x52ea('0xa')]=_0x933008['dialOriginateCallerIdName'];this[_0x52ea('0xb')]=_0x933008[_0x52ea('0xb')];this[_0x52ea('0xc')]=_0x933008[_0x52ea('0xc')]||0x1e;this[_0x52ea('0xd')]=_0x933008['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x933008[_0x52ea('0xe')];this[_0x52ea('0xf')]=_0x933008[_0x52ea('0xf')];this[_0x52ea('0x10')]=_0x933008[_0x52ea('0x10')];this[_0x52ea('0x11')]=_0x933008[_0x52ea('0x11')];this[_0x52ea('0x12')]=_0x933008['dialNoAnswerRetryFrequency'];this[_0x52ea('0x13')]=_0x933008[_0x52ea('0x13')];this[_0x52ea('0x14')]=_0x933008[_0x52ea('0x14')]||0x3;this[_0x52ea('0x15')]=_0x933008[_0x52ea('0x15')]||0x96;this['dialDropMaxRetry']=_0x933008[_0x52ea('0x16')]||0x3;this[_0x52ea('0x17')]=_0x933008[_0x52ea('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x933008[_0x52ea('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x933008[_0x52ea('0x19')]||0x96;this[_0x52ea('0x1a')]=_0x933008[_0x52ea('0x1a')]||0x3;this[_0x52ea('0x1b')]=_0x933008[_0x52ea('0x1b')]||0x96;this[_0x52ea('0x1c')]=_0x933008['dialAgentRejectMaxRetry']||0x3;this[_0x52ea('0x1d')]=_0x933008[_0x52ea('0x1d')]||0x96;this[_0x52ea('0x1e')]=_0x933008[_0x52ea('0x1e')]||_0x52ea('0x1f');this[_0x52ea('0x20')]=_0x933008['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x933008['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x52ea('0x21')]=_0x933008[_0x52ea('0x21')]||undefined;this[_0x52ea('0x22')]=_0x933008[_0x52ea('0x22')]?_0x933008[_0x52ea('0x22')]:undefined;this[_0x52ea('0x23')]=_0x933008[_0x52ea('0x23')]?_0x933008[_0x52ea('0x23')]:undefined;this[_0x52ea('0x24')]=_0x933008[_0x52ea('0x24')]?_0x933008[_0x52ea('0x24')]:undefined;this['SquareProject']=_0x933008[_0x52ea('0x25')]?_0x933008['SquareProject']:undefined;this[_0x52ea('0x26')]=_0x933008[_0x52ea('0x25')]?_0x933008[_0x52ea('0x25')][_0x52ea('0x27')]:undefined;this['dialAMDActive']=_0x933008[_0x52ea('0x28')]||![];this['dialAMDInitialSilence']=_0x933008[_0x52ea('0x29')];this[_0x52ea('0x2a')]=_0x933008[_0x52ea('0x2a')];this[_0x52ea('0x2b')]=_0x933008[_0x52ea('0x2b')];this[_0x52ea('0x2c')]=_0x933008['dialAMDTotalAnalysisTime'];this[_0x52ea('0x2d')]=_0x933008[_0x52ea('0x2d')];this[_0x52ea('0x2e')]=_0x933008['dialAMDBetweenWordsSilence'];this[_0x52ea('0x2f')]=_0x933008[_0x52ea('0x2f')];this[_0x52ea('0x30')]=_0x933008['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x933008[_0x52ea('0x31')];}module[_0x52ea('0x32')]=Campaign;
\ No newline at end of file
+var _0x5b3d=['name','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x109c37,_0x5afc46){var _0x99f16d=function(_0x1ab179){while(--_0x1ab179){_0x109c37['push'](_0x109c37['shift']());}};_0x99f16d(++_0x5afc46);}(_0x5b3d,0xf5));var _0xd5b3=function(_0x101383,_0x5bd543){_0x101383=_0x101383-0x0;var _0x46cfe9=_0x5b3d[_0x101383];return _0x46cfe9;};'use strict';function Campaign(_0x3a075b){this['id']=_0x3a075b['id']||0x0;this[_0xd5b3('0x0')]=_0x3a075b[_0xd5b3('0x0')]||'';this['type']=_0x3a075b['type']||_0xd5b3('0x1');this['originated']=0x0;this[_0xd5b3('0x2')]=0x0;this[_0xd5b3('0x3')]=0x0;this[_0xd5b3('0x4')]=0x0;this[_0xd5b3('0x5')]='';this[_0xd5b3('0x6')]=!![];this['active']=_0x3a075b[_0xd5b3('0x7')];this[_0xd5b3('0x8')]=_0x3a075b['limitCalls'];this[_0xd5b3('0x9')]=_0x3a075b[_0xd5b3('0x9')]||null;this['dialGlobalInterval']=_0x3a075b[_0xd5b3('0xa')]?_0x3a075b['dialGlobalInterval']:null;this[_0xd5b3('0xb')]=_0x3a075b[_0xd5b3('0xb')];this[_0xd5b3('0xc')]=_0x3a075b['dialOriginateCallerIdNumber'];this[_0xd5b3('0xd')]=_0x3a075b[_0xd5b3('0xd')]||0x1e;this[_0xd5b3('0xe')]=_0x3a075b[_0xd5b3('0xe')];this[_0xd5b3('0xf')]=_0x3a075b[_0xd5b3('0xf')];this[_0xd5b3('0x10')]=_0x3a075b[_0xd5b3('0x10')];this[_0xd5b3('0x11')]=_0x3a075b[_0xd5b3('0x11')];this[_0xd5b3('0x12')]=_0x3a075b[_0xd5b3('0x12')];this[_0xd5b3('0x13')]=_0x3a075b['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x3a075b['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x3a075b[_0xd5b3('0x14')]||0x3;this[_0xd5b3('0x15')]=_0x3a075b[_0xd5b3('0x15')]||0x96;this[_0xd5b3('0x16')]=_0x3a075b['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x3a075b[_0xd5b3('0x17')]||0x96;this[_0xd5b3('0x18')]=_0x3a075b['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x3a075b[_0xd5b3('0x19')]||0x96;this[_0xd5b3('0x1a')]=_0x3a075b[_0xd5b3('0x1a')]||0x3;this[_0xd5b3('0x1b')]=_0x3a075b[_0xd5b3('0x1b')]||0x96;this[_0xd5b3('0x1c')]=_0x3a075b[_0xd5b3('0x1c')]||0x3;this[_0xd5b3('0x1d')]=_0x3a075b['dialAgentRejectRetryFrequency']||0x96;this[_0xd5b3('0x1e')]=_0x3a075b['dialOrderByScheduledAt']||'DESC';this[_0xd5b3('0x1f')]=_0x3a075b[_0xd5b3('0x1f')]||undefined;this[_0xd5b3('0x20')]=_0x3a075b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xd5b3('0x21')]=_0x3a075b['dialCutDigit']||undefined;this[_0xd5b3('0x22')]=_0x3a075b[_0xd5b3('0x22')]?_0x3a075b[_0xd5b3('0x22')]:undefined;this[_0xd5b3('0x23')]=_0x3a075b['Trunk']?_0x3a075b['Trunk']:undefined;this[_0xd5b3('0x24')]=_0x3a075b['Interval']?_0x3a075b[_0xd5b3('0x24')]:undefined;this['SquareProject']=_0x3a075b[_0xd5b3('0x25')]?_0x3a075b['SquareProject']:undefined;this[_0xd5b3('0x26')]=_0x3a075b[_0xd5b3('0x25')]?_0x3a075b['SquareProject'][_0xd5b3('0x0')]:undefined;this['dialAMDActive']=_0x3a075b[_0xd5b3('0x27')]||![];this[_0xd5b3('0x28')]=_0x3a075b[_0xd5b3('0x28')];this[_0xd5b3('0x29')]=_0x3a075b[_0xd5b3('0x29')];this[_0xd5b3('0x2a')]=_0x3a075b['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x3a075b[_0xd5b3('0x2b')];this[_0xd5b3('0x2c')]=_0x3a075b[_0xd5b3('0x2c')];this['dialAMDBetweenWordsSilence']=_0x3a075b[_0xd5b3('0x2d')];this[_0xd5b3('0x2e')]=_0x3a075b['dialAMDMaximumNumberOfWords'];this[_0xd5b3('0x2f')]=_0x3a075b[_0xd5b3('0x2f')];this[_0xd5b3('0x30')]=_0x3a075b[_0xd5b3('0x30')];}module['exports']=Campaign;
\ No newline at end of file
index 697b2e2..1519f82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd844=['uniqueid','linkedid','answered','unmanaged','lastdata','duration','holdtime','tag','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','calleridnum','calleridname','accountcode','context'];(function(_0x4fc347,_0x25a767){var _0x35aee1=function(_0x7f9260){while(--_0x7f9260){_0x4fc347['push'](_0x4fc347['shift']());}};_0x35aee1(++_0x25a767);}(_0xd844,0x6d));var _0x4d84=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd844[_0x122ef9];return _0x42fba0;};'use strict';function Channel(){this[_0x4d84('0x0')]=null;this[_0x4d84('0x1')]='';this['destinationchannel']='';this[_0x4d84('0x2')]=0x0;this[_0x4d84('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x4d84('0x4')]=0x0;this[_0x4d84('0x5')]='';this[_0x4d84('0x6')]=0x0;this[_0x4d84('0x7')]=0x0;this['exten']=0x0;this[_0x4d84('0x8')]=![];this['answertime']=null;this['endtime']=null;this[_0x4d84('0x9')]=![];this['abandoned']=![];this['lastapplication']='';this[_0x4d84('0xa')]='';this[_0x4d84('0xb')]=0x0;this['billableseconds']=0x0;this[_0x4d84('0xc')]=0x0;this['type']=null;this[_0x4d84('0xd')]=null;this[_0x4d84('0xe')]=null;this[_0x4d84('0xf')]=![];this['monitorFilename']=null;this[_0x4d84('0x10')]=null;this[_0x4d84('0x11')]=[];this[_0x4d84('0x12')]=undefined;this[_0x4d84('0x13')]=undefined;this[_0x4d84('0x14')]=undefined;this[_0x4d84('0x15')]=0x0;}module[_0x4d84('0x16')]=Channel;
\ No newline at end of file
+var _0x4813=['transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','destinationchannel','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitors'];(function(_0x5d95b9,_0x353b84){var _0x3cd101=function(_0x334f76){while(--_0x334f76){_0x5d95b9['push'](_0x5d95b9['shift']());}};_0x3cd101(++_0x353b84);}(_0x4813,0xdc));var _0x3481=function(_0x5634a8,_0x3c2e56){_0x5634a8=_0x5634a8-0x0;var _0x3b6aa8=_0x4813[_0x5634a8];return _0x3b6aa8;};'use strict';function Channel(){this[_0x3481('0x0')]=null;this['channel']='';this[_0x3481('0x1')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x3481('0x2')]=undefined;this[_0x3481('0x3')]=undefined;this['accountcode']=0x0;this[_0x3481('0x4')]='';this[_0x3481('0x5')]=0x0;this[_0x3481('0x6')]=0x0;this[_0x3481('0x7')]=0x0;this[_0x3481('0x8')]=![];this[_0x3481('0x9')]=null;this[_0x3481('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x3481('0xb')]='';this['lastdata']='';this[_0x3481('0xc')]=0x0;this[_0x3481('0xd')]=0x0;this[_0x3481('0xe')]=0x0;this[_0x3481('0xf')]=null;this[_0x3481('0x10')]=null;this[_0x3481('0x11')]=null;this[_0x3481('0x12')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x3481('0x13')]=[];this[_0x3481('0x14')]=undefined;this[_0x3481('0x15')]=undefined;this[_0x3481('0x16')]=undefined;this[_0x3481('0x17')]=0x0;}module['exports']=Channel;
\ No newline at end of file
index 027b5ee..aa7c068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82dd=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x1e2939,_0x1f1ddc){var _0x1a1028=function(_0x28220a){while(--_0x28220a){_0x1e2939['push'](_0x1e2939['shift']());}};_0x1a1028(++_0x1f1ddc);}(_0x82dd,0x195));var _0xd82d=function(_0x544cd7,_0x20f588){_0x544cd7=_0x544cd7-0x0;var _0x43c000=_0x82dd[_0x544cd7];return _0x43c000;};'use strict';function DeskAccount(_0x11a4d5){this['id']=_0x11a4d5['id']||0x0;this['name']=_0x11a4d5[_0xd82d('0x0')]||'';this[_0xd82d('0x1')]=_0x11a4d5[_0xd82d('0x1')]||'';this[_0xd82d('0x2')]=_0x11a4d5['remoteUri']||'';this[_0xd82d('0x3')]=_0x11a4d5['authType']||'';this[_0xd82d('0x4')]=_0x11a4d5['password']||'';this[_0xd82d('0x5')]=_0x11a4d5['consumerKey']||'';this['consumerSecret']=_0x11a4d5[_0xd82d('0x6')]||'';this[_0xd82d('0x7')]=_0x11a4d5['token']||'';this[_0xd82d('0x8')]=_0x11a4d5['tokenSecret']||'';this[_0xd82d('0x9')]=_0x11a4d5['type']||'';this['serverUrl']=_0x11a4d5[_0xd82d('0xa')]||'';this['Configurations']=_0x11a4d5[_0xd82d('0xb')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x2091=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','type'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2091,0x120));var _0x1209=function(_0x45d850,_0x1f8c16){_0x45d850=_0x45d850-0x0;var _0x372ba0=_0x2091[_0x45d850];return _0x372ba0;};'use strict';function DeskAccount(_0x15fd03){this['id']=_0x15fd03['id']||0x0;this[_0x1209('0x0')]=_0x15fd03[_0x1209('0x0')]||'';this[_0x1209('0x1')]=_0x15fd03[_0x1209('0x1')]||'';this[_0x1209('0x2')]=_0x15fd03[_0x1209('0x2')]||'';this['authType']=_0x15fd03[_0x1209('0x3')]||'';this['password']=_0x15fd03[_0x1209('0x4')]||'';this['consumerKey']=_0x15fd03[_0x1209('0x5')]||'';this[_0x1209('0x6')]=_0x15fd03[_0x1209('0x6')]||'';this['token']=_0x15fd03['token']||'';this[_0x1209('0x7')]=_0x15fd03[_0x1209('0x7')]||'';this[_0x1209('0x8')]=_0x15fd03[_0x1209('0x8')]||'';this['serverUrl']=_0x15fd03['serverUrl']||'';this[_0x1209('0x9')]=_0x15fd03[_0x1209('0x9')]||{};}module[_0x1209('0xa')]=DeskAccount;
\ No newline at end of file
index 810f7f4..7f13441 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x17876c,_0x17c9e3){var _0x26844b=function(_0x497029){while(--_0x497029){_0x17876c['push'](_0x17876c['shift']());}};_0x26844b(++_0x17c9e3);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x54c739,_0x9ccf9d){_0x54c739=_0x54c739-0x0;var _0x1554ec=_0x6f7a[_0x54c739];return _0x1554ec;};'use strict';function Dynamics365Account(_0x31411a){this['id']=_0x31411a['id']||0x0;this[_0xa6f7('0x0')]=_0x31411a[_0xa6f7('0x0')]||'';this[_0xa6f7('0x1')]=_0x31411a['username']||'';this[_0xa6f7('0x2')]=_0x31411a[_0xa6f7('0x2')]||'';this[_0xa6f7('0x3')]=_0x31411a[_0xa6f7('0x3')]||'';this[_0xa6f7('0x4')]=_0x31411a[_0xa6f7('0x4')]||'';this[_0xa6f7('0x5')]=_0x31411a[_0xa6f7('0x5')]||'';this[_0xa6f7('0x6')]=_0x31411a[_0xa6f7('0x6')]||{};this[_0xa6f7('0x7')]=_0x31411a['serverUrl']||'';this['Configurations']=_0x31411a[_0xa6f7('0x8')]||{};}module[_0xa6f7('0x9')]=Dynamics365Account;
\ No newline at end of file
+var _0xe5b5=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xe5b5[_0x4ed1d4];return _0x28e363;};'use strict';function Dynamics365Account(_0x16118d){this['id']=_0x16118d['id']||0x0;this[_0x5e5b('0x0')]=_0x16118d[_0x5e5b('0x0')]||'';this[_0x5e5b('0x1')]=_0x16118d[_0x5e5b('0x1')]||'';this[_0x5e5b('0x2')]=_0x16118d[_0x5e5b('0x2')]||'';this[_0x5e5b('0x3')]=_0x16118d[_0x5e5b('0x3')]||'';this[_0x5e5b('0x4')]=_0x16118d[_0x5e5b('0x4')]||'';this[_0x5e5b('0x5')]=_0x16118d[_0x5e5b('0x5')]||'';this[_0x5e5b('0x6')]=_0x16118d[_0x5e5b('0x6')]||{};this[_0x5e5b('0x7')]=_0x16118d[_0x5e5b('0x7')]||'';this[_0x5e5b('0x8')]=_0x16118d[_0x5e5b('0x8')]||{};}module[_0x5e5b('0x9')]=Dynamics365Account;
\ No newline at end of file
index f6a024c..b141487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd196=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid'];(function(_0x44825b,_0x714b3a){var _0x4b08e7=function(_0x2a3fe3){while(--_0x2a3fe3){_0x44825b['push'](_0x44825b['shift']());}};_0x4b08e7(++_0x714b3a);}(_0xd196,0x1a4));var _0x6d19=function(_0x5a42d9,_0x2d397e){_0x5a42d9=_0x5a42d9-0x0;var _0x190cf2=_0xd196[_0x5a42d9];return _0x190cf2;};'use strict';function FaxAccount(_0x3757e7){this['id']=_0x3757e7['id']||0x0;this['name']=_0x3757e7[_0x6d19('0x0')]||'';this[_0x6d19('0x1')]=_0x3757e7['description'];this[_0x6d19('0x2')]=_0x3757e7[_0x6d19('0x2')];this[_0x6d19('0x3')]=_0x3757e7[_0x6d19('0x3')];this[_0x6d19('0x4')]=_0x3757e7[_0x6d19('0x4')];this['minrate']=_0x3757e7[_0x6d19('0x5')]||0x960;this[_0x6d19('0x6')]=_0x3757e7[_0x6d19('0x6')]||0x3840;this[_0x6d19('0x7')]=_0x3757e7[_0x6d19('0x7')]||_0x6d19('0x8');this[_0x6d19('0x9')]=_0x3757e7[_0x6d19('0x9')]||'no';this[_0x6d19('0xa')]=_0x3757e7[_0x6d19('0xa')]||'no';this['t38timeout']=_0x3757e7[_0x6d19('0xb')]||0x1388;this[_0x6d19('0xc')]=_0x3757e7[_0x6d19('0xc')]||_0x6d19('0xd');this[_0x6d19('0xe')]=_0x3757e7[_0x6d19('0xe')]?_0x3757e7[_0x6d19('0xe')]:undefined;this[_0x6d19('0xf')]=_0x3757e7[_0x6d19('0xf')];this[_0x6d19('0x10')]=_0x3757e7[_0x6d19('0x10')];}module['exports']=FaxAccount;
\ No newline at end of file
+var _0xd64b=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway'];(function(_0x2fc6cf,_0x2bb133){var _0xf2ade3=function(_0x522b04){while(--_0x522b04){_0x2fc6cf['push'](_0x2fc6cf['shift']());}};_0xf2ade3(++_0x2bb133);}(_0xd64b,0x18f));var _0xbd64=function(_0x3f5880,_0x2beec0){_0x3f5880=_0x3f5880-0x0;var _0x1cc879=_0xd64b[_0x3f5880];return _0x1cc879;};'use strict';function FaxAccount(_0x12a918){this['id']=_0x12a918['id']||0x0;this[_0xbd64('0x0')]=_0x12a918[_0xbd64('0x0')]||'';this[_0xbd64('0x1')]=_0x12a918[_0xbd64('0x1')];this[_0xbd64('0x2')]=_0x12a918['ecm'];this['headerinfo']=_0x12a918[_0xbd64('0x3')];this[_0xbd64('0x4')]=_0x12a918[_0xbd64('0x4')];this['minrate']=_0x12a918['minrate']||0x960;this[_0xbd64('0x5')]=_0x12a918[_0xbd64('0x5')]||0x3840;this[_0xbd64('0x6')]=_0x12a918['modem']||_0xbd64('0x7');this[_0xbd64('0x8')]=_0x12a918[_0xbd64('0x8')]||'no';this[_0xbd64('0x9')]=_0x12a918[_0xbd64('0x9')]||'no';this[_0xbd64('0xa')]=_0x12a918[_0xbd64('0xa')]||0x1388;this[_0xbd64('0xb')]=_0x12a918[_0xbd64('0xb')]||_0xbd64('0xc');this[_0xbd64('0xd')]=_0x12a918[_0xbd64('0xd')]?_0x12a918['Trunk']:undefined;this[_0xbd64('0xe')]=_0x12a918[_0xbd64('0xe')];this[_0xbd64('0xf')]=_0x12a918[_0xbd64('0xf')];}module[_0xbd64('0x10')]=FaxAccount;
\ No newline at end of file
index 47a5634..9614dbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9d6=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x41d7b8,_0x3248dc){var _0x72847b=function(_0x897340){while(--_0x897340){_0x41d7b8['push'](_0x41d7b8['shift']());}};_0x72847b(++_0x3248dc);}(_0xe9d6,0x184));var _0x6e9d=function(_0x2d51d8,_0x1104e1){_0x2d51d8=_0x2d51d8-0x0;var _0x35a19a=_0xe9d6[_0x2d51d8];return _0x35a19a;};'use strict';function FreshdeskAccount(_0x3f5d0f){this['id']=_0x3f5d0f['id']||0x0;this[_0x6e9d('0x0')]=_0x3f5d0f[_0x6e9d('0x0')]||'';this['username']=_0x3f5d0f[_0x6e9d('0x1')]||'';this[_0x6e9d('0x2')]=_0x3f5d0f[_0x6e9d('0x3')]||'';this[_0x6e9d('0x4')]=_0x3f5d0f[_0x6e9d('0x4')]||'';this[_0x6e9d('0x5')]=_0x3f5d0f[_0x6e9d('0x5')]||'';this['Configurations']=_0x3f5d0f[_0x6e9d('0x6')]||{};}module[_0x6e9d('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0x1caa=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1caa,0x75));var _0xa1ca=function(_0x1ac209,_0x5c9477){_0x1ac209=_0x1ac209-0x0;var _0x5d21a5=_0x1caa[_0x1ac209];return _0x5d21a5;};'use strict';function FreshdeskAccount(_0x1910f7){this['id']=_0x1910f7['id']||0x0;this[_0xa1ca('0x0')]=_0x1910f7[_0xa1ca('0x0')]||'';this[_0xa1ca('0x1')]=_0x1910f7[_0xa1ca('0x1')]||'';this[_0xa1ca('0x2')]=_0x1910f7[_0xa1ca('0x3')]||'';this[_0xa1ca('0x4')]=_0x1910f7['remoteUri']||'';this[_0xa1ca('0x5')]=_0x1910f7[_0xa1ca('0x5')]||'';this[_0xa1ca('0x6')]=_0x1910f7['Configurations']||{};}module[_0xa1ca('0x7')]=FreshdeskAccount;
\ No newline at end of file
index ba18d17..2944a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f3f=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x36a2ed,_0x3815d4){var _0x2b7be4=function(_0x19a0e4){while(--_0x19a0e4){_0x36a2ed['push'](_0x36a2ed['shift']());}};_0x2b7be4(++_0x3815d4);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0xadd417,_0x207028){_0xadd417=_0xadd417-0x0;var _0x5c79e7=_0x7f3f[_0xadd417];return _0x5c79e7;};'use strict';function FreshsalesAccount(_0x598520){this['id']=_0x598520['id']||0x0;this[_0xf7f3('0x0')]=_0x598520['name']||'';this[_0xf7f3('0x1')]=_0x598520[_0xf7f3('0x1')]||'';this[_0xf7f3('0x2')]=_0x598520[_0xf7f3('0x3')]||'';this[_0xf7f3('0x4')]=_0x598520['remoteUri']||'';this[_0xf7f3('0x5')]=_0x598520[_0xf7f3('0x5')]||'';this['Configurations']=_0x598520[_0xf7f3('0x6')]||{};}module[_0xf7f3('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0xff3c=['serverUrl','Configurations','name','username','remoteUri'];(function(_0x1221fc,_0x26199a){var _0x5b3aa0=function(_0x30acc6){while(--_0x30acc6){_0x1221fc['push'](_0x1221fc['shift']());}};_0x5b3aa0(++_0x26199a);}(_0xff3c,0x179));var _0xcff3=function(_0x43bc9,_0x232809){_0x43bc9=_0x43bc9-0x0;var _0x8a7a29=_0xff3c[_0x43bc9];return _0x8a7a29;};'use strict';function FreshsalesAccount(_0x316a7c){this['id']=_0x316a7c['id']||0x0;this[_0xcff3('0x0')]=_0x316a7c['name']||'';this[_0xcff3('0x1')]=_0x316a7c[_0xcff3('0x1')]||'';this['apiKey']=_0x316a7c['token']||'';this[_0xcff3('0x2')]=_0x316a7c[_0xcff3('0x2')]||'';this[_0xcff3('0x3')]=_0x316a7c[_0xcff3('0x3')]||'';this[_0xcff3('0x4')]=_0x316a7c[_0xcff3('0x4')]||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
index 7e06dff..3bd3446 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x493a=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','originalposition','channel','connectedlinenum','accountcode','exten','priority','holdtime','assigned','voice','mohtime','variables','exports','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position'];(function(_0x117ff5,_0x53da28){var _0x25ebba=function(_0x33693d){while(--_0x33693d){_0x117ff5['push'](_0x117ff5['shift']());}};_0x25ebba(++_0x53da28);}(_0x493a,0x1dc));var _0xa493=function(_0x526fb1,_0x1d0359){_0x526fb1=_0x526fb1-0x0;var _0x33582f=_0x493a[_0x526fb1];return _0x33582f;};'use strict';function QueueReport(){this['type']=_0xa493('0x0');this[_0xa493('0x1')]='';this['calleridnum']='';this[_0xa493('0x2')]='';this[_0xa493('0x3')]='';this[_0xa493('0x4')]=null;this[_0xa493('0x5')]=null;this[_0xa493('0x6')]=0x1;this['count']=0x1;this[_0xa493('0x7')]=![];this[_0xa493('0x8')]=null;this[_0xa493('0x9')]=![];this[_0xa493('0xa')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0xa493('0xb')]=0x1;this[_0xa493('0xc')]='';this[_0xa493('0xd')]='';this['connectedlinename']='';this[_0xa493('0xe')]='';this['context']='';this[_0xa493('0xf')]='';this[_0xa493('0x10')]='';this[_0xa493('0x11')]=0x0;this[_0xa493('0x12')]=![];this['lastAssignedTo']='';this['motionChannel']=_0xa493('0x13');this[_0xa493('0x14')]=0x0;this[_0xa493('0x15')]={};}module[_0xa493('0x16')]=QueueReport;
\ No newline at end of file
+var _0xb4dd=['calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','motionChannel','voice','mohtime','variables','exports','inbound','uniqueid'];(function(_0x5842ed,_0x3d858c){var _0x5312c7=function(_0x294df3){while(--_0x294df3){_0x5842ed['push'](_0x5842ed['shift']());}};_0x5312c7(++_0x3d858c);}(_0xb4dd,0xce));var _0xdb4d=function(_0x132d34,_0x1370d1){_0x132d34=_0x132d34-0x0;var _0x39ea7f=_0xb4dd[_0x132d34];return _0x39ea7f;};'use strict';function QueueReport(){this['type']=_0xdb4d('0x0');this[_0xdb4d('0x1')]='';this[_0xdb4d('0x2')]='';this[_0xdb4d('0x3')]='';this['queue']='';this[_0xdb4d('0x4')]=null;this[_0xdb4d('0x5')]=null;this[_0xdb4d('0x6')]=0x1;this[_0xdb4d('0x7')]=0x1;this[_0xdb4d('0x8')]=![];this[_0xdb4d('0x9')]=null;this[_0xdb4d('0xa')]=![];this[_0xdb4d('0xb')]=null;this[_0xdb4d('0xc')]=![];this[_0xdb4d('0xd')]=null;this['originalposition']=0x1;this['channel']='';this[_0xdb4d('0xe')]='';this[_0xdb4d('0xf')]='';this[_0xdb4d('0x10')]='';this[_0xdb4d('0x11')]='';this[_0xdb4d('0x12')]='';this[_0xdb4d('0x13')]='';this[_0xdb4d('0x14')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xdb4d('0x15')]=_0xdb4d('0x16');this[_0xdb4d('0x17')]=0x0;this[_0xdb4d('0x18')]={};}module[_0xdb4d('0x19')]=QueueReport;
\ No newline at end of file
index 5de270a..2300472 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf43=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username'];(function(_0x4fa349,_0x1cd7db){var _0x42aa18=function(_0x28aabb){while(--_0x28aabb){_0x4fa349['push'](_0x4fa349['shift']());}};_0x42aa18(++_0x1cd7db);}(_0xdf43,0x6c));var _0x3df4=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xdf43[_0x2261ce];return _0x524640;};'use strict';function SalesforceAccount(_0x12740e){this['id']=_0x12740e['id']||0x0;this['name']=_0x12740e[_0x3df4('0x0')]||'';this[_0x3df4('0x1')]=_0x12740e[_0x3df4('0x1')]||'';this[_0x3df4('0x2')]=_0x12740e[_0x3df4('0x2')]||'';this[_0x3df4('0x3')]=_0x12740e[_0x3df4('0x3')]||'';this['clientId']=_0x12740e[_0x3df4('0x4')]||'';this[_0x3df4('0x5')]=_0x12740e[_0x3df4('0x5')]||'';this[_0x3df4('0x6')]=_0x12740e['securityToken']||'';this[_0x3df4('0x7')]=_0x12740e[_0x3df4('0x7')]||_0x3df4('0x8');this['serverUrl']=_0x12740e[_0x3df4('0x9')]||'';this[_0x3df4('0xa')]=_0x12740e[_0x3df4('0xa')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
+var _0xfbff=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','remoteUri'];(function(_0x1eb40e,_0x262694){var _0x9ea754=function(_0x45f493){while(--_0x45f493){_0x1eb40e['push'](_0x1eb40e['shift']());}};_0x9ea754(++_0x262694);}(_0xfbff,0x18e));var _0xffbf=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xfbff[_0xfedc72];return _0x2c7c78;};'use strict';function SalesforceAccount(_0x3c7ef8){this['id']=_0x3c7ef8['id']||0x0;this[_0xffbf('0x0')]=_0x3c7ef8[_0xffbf('0x0')]||'';this['username']=_0x3c7ef8['username']||'';this[_0xffbf('0x1')]=_0x3c7ef8[_0xffbf('0x1')]||'';this[_0xffbf('0x2')]=_0x3c7ef8[_0xffbf('0x2')]||'';this[_0xffbf('0x3')]=_0x3c7ef8['clientId']||'';this[_0xffbf('0x4')]=_0x3c7ef8['clientSecret']||'';this[_0xffbf('0x5')]=_0x3c7ef8[_0xffbf('0x5')]||'';this[_0xffbf('0x6')]=_0x3c7ef8['type']||_0xffbf('0x7');this[_0xffbf('0x8')]=_0x3c7ef8[_0xffbf('0x8')]||'';this['Configurations']=_0x3c7ef8[_0xffbf('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
index a8e7ba9..a5dcf4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bb1=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x3e4eec,_0x55e243){var _0x4f28cc=function(_0x4ccc4d){while(--_0x4ccc4d){_0x3e4eec['push'](_0x3e4eec['shift']());}};_0x4f28cc(++_0x55e243);}(_0x8bb1,0x177));var _0x18bb=function(_0x3fd3c2,_0x4e5379){_0x3fd3c2=_0x3fd3c2-0x0;var _0x851d9e=_0x8bb1[_0x3fd3c2];return _0x851d9e;};'use strict';function ServicenowAccount(_0x561b66){this['id']=_0x561b66['id']||0x0;this[_0x18bb('0x0')]=_0x561b66[_0x18bb('0x0')]||'';this[_0x18bb('0x1')]=_0x561b66[_0x18bb('0x1')]||'';this[_0x18bb('0x2')]=_0x561b66['password']||'';this[_0x18bb('0x3')]=_0x561b66['remoteUri']||'';this[_0x18bb('0x4')]=_0x561b66[_0x18bb('0x4')]||'';this[_0x18bb('0x5')]=_0x561b66['Configurations']||{};}module[_0x18bb('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xa99b=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x56622d,_0x229a5a){var _0x26d1da=function(_0x20f2af){while(--_0x20f2af){_0x56622d['push'](_0x56622d['shift']());}};_0x26d1da(++_0x229a5a);}(_0xa99b,0x17b));var _0xba99=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa99b[_0x1b828b];return _0x98da1a;};'use strict';function ServicenowAccount(_0x273f7a){this['id']=_0x273f7a['id']||0x0;this[_0xba99('0x0')]=_0x273f7a['name']||'';this[_0xba99('0x1')]=_0x273f7a['username']||'';this[_0xba99('0x2')]=_0x273f7a[_0xba99('0x2')]||'';this[_0xba99('0x3')]=_0x273f7a[_0xba99('0x3')]||'';this[_0xba99('0x4')]=_0x273f7a['serverUrl']||'';this[_0xba99('0x5')]=_0x273f7a[_0xba99('0x5')]||{};}module[_0xba99('0x6')]=ServicenowAccount;
\ No newline at end of file
index e9c31ed..4fa4aa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087b=['username','password','remoteUri','Configurations','exports'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x087b,0xa0));var _0xb087=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x087b[_0x1477ef];return _0x164acd;};'use strict';function SugarcrmAccount(_0x40244b){this['id']=_0x40244b['id']||0x0;this['name']=_0x40244b['name']||'';this['username']=_0x40244b[_0xb087('0x0')]||'';this[_0xb087('0x1')]=_0x40244b[_0xb087('0x1')]||'';this[_0xb087('0x2')]=_0x40244b[_0xb087('0x2')]||'';this['serverUrl']=_0x40244b['serverUrl']||'';this[_0xb087('0x3')]=_0x40244b[_0xb087('0x3')]||{};}module[_0xb087('0x4')]=SugarcrmAccount;
\ No newline at end of file
+var _0x48e3=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x48e3,0xe9));var _0x348e=function(_0x2b1137,_0x155b22){_0x2b1137=_0x2b1137-0x0;var _0x3e0119=_0x48e3[_0x2b1137];return _0x3e0119;};'use strict';function SugarcrmAccount(_0x52f8e9){this['id']=_0x52f8e9['id']||0x0;this[_0x348e('0x0')]=_0x52f8e9['name']||'';this[_0x348e('0x1')]=_0x52f8e9['username']||'';this['password']=_0x52f8e9[_0x348e('0x2')]||'';this[_0x348e('0x3')]=_0x52f8e9[_0x348e('0x3')]||'';this[_0x348e('0x4')]=_0x52f8e9['serverUrl']||'';this[_0x348e('0x5')]=_0x52f8e9['Configurations']||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index 9621dfb..d3cf85d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91c5=['name','accountcode','unknown','address'];(function(_0x29b613,_0x1d7a76){var _0x1d0751=function(_0x3caa0b){while(--_0x3caa0b){_0x29b613['push'](_0x29b613['shift']());}};_0x1d0751(++_0x1d7a76);}(_0x91c5,0x124));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';function Telephone(_0x241651){this['id']=_0x241651['id']||0x0;this[_0x591c('0x0')]=_0x241651['name']||'';this['accountcode']=_0x241651[_0x591c('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this['status']=_0x591c('0x2');this[_0x591c('0x3')]='';}module['exports']=Telephone;
\ No newline at end of file
+var _0x7d98=['stateTime','status','address','name','accountcode','state'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d98,0xe7));var _0x87d9=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x7d98[_0x550d12];return _0x12103d;};'use strict';function Telephone(_0x20137c){this['id']=_0x20137c['id']||0x0;this['name']=_0x20137c[_0x87d9('0x0')]||'';this[_0x87d9('0x1')]=_0x20137c[_0x87d9('0x1')]||'';this[_0x87d9('0x2')]='unknown';this[_0x87d9('0x3')]=0x0;this[_0x87d9('0x4')]='unknown';this[_0x87d9('0x5')]='';}module['exports']=Telephone;
\ No newline at end of file
index f09edc0..e2b70fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','html'];(function(_0x3756f4,_0x59e6ab){var _0x4f7ce5=function(_0x248aa3){while(--_0x248aa3){_0x3756f4['push'](_0x3756f4['shift']());}};_0x4f7ce5(++_0x59e6ab);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e2c70,_0x108e64){_0x5e2c70=_0x5e2c70-0x0;var _0x1e6cbc=_0xb10b[_0x5e2c70];return _0x1e6cbc;};'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(_0x4e15c7,_0x2fa1a3){var _0x205589=function(_0x4fb604){while(--_0x4fb604){_0x4e15c7['push'](_0x4e15c7['shift']());}};_0x205589(++_0x2fa1a3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1865d4,_0x569a81){_0x1865d4=_0x1865d4-0x0;var _0x1f0e1c=_0xb10b[_0x1865d4];return _0x1f0e1c;};'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 664c20c..164a852 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(_0x5a9fdd,_0x19e969){var _0x2db29f=function(_0x583658){while(--_0x583658){_0x5a9fdd['push'](_0x5a9fdd['shift']());}};_0x2db29f(++_0x19e969);}(_0x2032,0xd9));var _0x2203=function(_0x344bb7,_0x511663){_0x344bb7=_0x344bb7-0x0;var _0x4f27ce=_0x2032[_0x344bb7];return _0x4f27ce;};'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 _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x1db225,_0x4c1d7e){var _0xfc29ba=function(_0x2a3694){while(--_0x2a3694){_0x1db225['push'](_0x1db225['shift']());}};_0xfc29ba(++_0x4c1d7e);}(_0x8603,0x190));var _0x3860=function(_0x3c9ae6,_0x33582a){_0x3c9ae6=_0x3c9ae6-0x0;var _0x2d0e6c=_0x8603[_0x3c9ae6];return _0x2d0e6c;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger;
\ No newline at end of file
index ee6675d..329f05d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacb0=['address','defaultuser','exports','active','name','state','stateTime','status','registry','split','host','port','domain','domainport','refresh','stateRegistry','unknown','registrationtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacb0,0x1c5));var _0x0acb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xacb0[_0x20a584];return _0x4b41a8;};'use strict';function Trunk(_0x469cc2){this['id']=_0x469cc2['id']||0x0;this['active']=_0x469cc2[_0x0acb('0x0')]||![];this[_0x0acb('0x1')]=_0x469cc2[_0x0acb('0x1')]||'';this[_0x0acb('0x2')]='unknown';this[_0x0acb('0x3')]=0x0;this[_0x0acb('0x4')]='unknown';this['registry']=_0x469cc2[_0x0acb('0x5')]&&_0x469cc2[_0x0acb('0x5')]['indexOf'](':')?_0x469cc2[_0x0acb('0x5')][_0x0acb('0x6')](':')[0x0]:'';this[_0x0acb('0x7')]='';this[_0x0acb('0x8')]='';this[_0x0acb('0x9')]='';this[_0x0acb('0xa')]='';this[_0x0acb('0xb')]='';this[_0x0acb('0xc')]=_0x0acb('0xd');this[_0x0acb('0xe')]='';this[_0x0acb('0xf')]='';this[_0x0acb('0x10')]=_0x469cc2[_0x0acb('0x10')]||'';}module[_0x0acb('0x11')]=Trunk;
\ No newline at end of file
+var _0x0060=['unknown','registry','split','host','port','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','stateTime','status'];(function(_0x4f33ff,_0x4cc52d){var _0x40e19c=function(_0x4cf92e){while(--_0x4cf92e){_0x4f33ff['push'](_0x4f33ff['shift']());}};_0x40e19c(++_0x4cc52d);}(_0x0060,0xfa));var _0x0006=function(_0x1a78f0,_0x398b53){_0x1a78f0=_0x1a78f0-0x0;var _0x3704e5=_0x0060[_0x1a78f0];return _0x3704e5;};'use strict';function Trunk(_0x168f74){this['id']=_0x168f74['id']||0x0;this[_0x0006('0x0')]=_0x168f74['active']||![];this[_0x0006('0x1')]=_0x168f74[_0x0006('0x1')]||'';this[_0x0006('0x2')]='unknown';this[_0x0006('0x3')]=0x0;this[_0x0006('0x4')]=_0x0006('0x5');this[_0x0006('0x6')]=_0x168f74[_0x0006('0x6')]&&_0x168f74[_0x0006('0x6')]['indexOf'](':')?_0x168f74[_0x0006('0x6')][_0x0006('0x7')](':')[0x0]:'';this[_0x0006('0x8')]='';this[_0x0006('0x9')]='';this['domain']='';this[_0x0006('0xa')]='';this[_0x0006('0xb')]='';this[_0x0006('0xc')]=_0x0006('0x5');this[_0x0006('0xd')]='';this[_0x0006('0xe')]='';this[_0x0006('0xf')]=_0x168f74['defaultuser']||'';}module[_0x0006('0x10')]=Trunk;
\ No newline at end of file
index ba0887a..5967554 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0f7=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0xca847c,_0x1774c0){var _0x2274fe=function(_0x387170){while(--_0x387170){_0xca847c['push'](_0xca847c['shift']());}};_0x2274fe(++_0x1774c0);}(_0xd0f7,0xe0));var _0x7d0f=function(_0x57c091,_0x620e4f){_0x57c091=_0x57c091-0x0;var _0x1790cb=_0xd0f7[_0x57c091];return _0x1790cb;};'use strict';function voiceExtension(_0x8d5926){this['id']=_0x8d5926['id']||0x0;this[_0x7d0f('0x0')]=_0x8d5926['exten']||'';this[_0x7d0f('0x1')]=_0x8d5926[_0x7d0f('0x1')]||_0x7d0f('0x2');this[_0x7d0f('0x3')]=_0x8d5926[_0x7d0f('0x3')]||![];}module[_0x7d0f('0x4')]=voiceExtension;
\ No newline at end of file
+var _0xdba5=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0xdba5,0x165));var _0x5dba=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xdba5[_0x28f1de];return _0x5b5dad;};'use strict';function voiceExtension(_0x52fc0a){this['id']=_0x52fc0a['id']||0x0;this['exten']=_0x52fc0a[_0x5dba('0x0')]||'';this['recordingFormat']=_0x52fc0a[_0x5dba('0x1')]||_0x5dba('0x2');this['mandatoryDisposition']=_0x52fc0a[_0x5dba('0x3')]||![];}module[_0x5dba('0x4')]=voiceExtension;
\ No newline at end of file
index e9bb3ab..d4dbbd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x484b=['predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold'];(function(_0x81ac6c,_0x1cf87c){var _0x442c04=function(_0x5f38b7){while(--_0x5f38b7){_0x81ac6c['push'](_0x81ac6c['shift']());}};_0x442c04(++_0x1cf87c);}(_0x484b,0x81));var _0xb484=function(_0x53f92c,_0x47ab05){_0x53f92c=_0x53f92c-0x0;var _0x209027=_0x484b[_0x53f92c];return _0x209027;};'use strict';var statusDesc=[_0xb484('0x0'),_0xb484('0x1'),_0xb484('0x2'),'busy','invalid',_0xb484('0x3'),_0xb484('0x4'),_0xb484('0x5'),'onhold'];var monitorFormat={'wav':_0xb484('0x6'),'wav49':_0xb484('0x7'),'gsm':_0xb484('0x8')};var strategy={'rrmemory':_0xb484('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x5ab3c2){this['id']=_0x5ab3c2['id']||0x0;this['name']=_0x5ab3c2[_0xb484('0xa')]||'';this[_0xb484('0xb')]=_0x5ab3c2[_0xb484('0xb')]||'';this[_0xb484('0xc')]=_0x5ab3c2[_0xb484('0xc')]||_0xb484('0xd');this[_0xb484('0xe')]=0x0;this[_0xb484('0xf')]=0x0;this[_0xb484('0x10')]=0x0;this['answered']=0x0;this[_0xb484('0x11')]=0x0;this[_0xb484('0x12')]=0x0;this['sumBillable']=0x0;this[_0xb484('0x13')]=0x0;this[_0xb484('0x14')]=0x0;this[_0xb484('0x15')]=0x0;this[_0xb484('0x16')]=0x0;this['acw']=_0x5ab3c2[_0xb484('0x17')]||![];this[_0xb484('0x18')]=_0x5ab3c2[_0xb484('0x18')]||0xa;this[_0xb484('0x19')]=_0x5ab3c2[_0xb484('0x19')]||'no';this['sendMessageOneNotActive']=!![];this[_0xb484('0x1a')]='';this['originated']=0x0;this[_0xb484('0x1b')]=0x0;this[_0xb484('0x1c')]=_0x5ab3c2[_0xb484('0x1c')]||null;this['dialGlobalInterval']=_0x5ab3c2[_0xb484('0x1d')]?_0x5ab3c2['dialGlobalInterval']:null;this[_0xb484('0x1e')]=_0x5ab3c2[_0xb484('0x1e')];this[_0xb484('0x1f')]=_0x5ab3c2[_0xb484('0x1f')]||_0xb484('0x20');this[_0xb484('0x21')]=_0x5ab3c2['dialLimitChannel']||0x0;this[_0xb484('0x22')]=_0x5ab3c2[_0xb484('0x22')]||0x0;this['dialPowerLevel']=_0x5ab3c2['dialPowerLevel']||0x1;this[_0xb484('0x23')]=_0x5ab3c2['dialPredictiveOptimization']||_0xb484('0x24');this[_0xb484('0x25')]=_0x5ab3c2[_0xb484('0x25')]||0.03;this[_0xb484('0x26')]=_0x5ab3c2[_0xb484('0x26')]||0x258;this[_0xb484('0x27')]=_0x5ab3c2[_0xb484('0x27')]||'anonymous';this[_0xb484('0x28')]=_0x5ab3c2['dialOriginateCallerIdNumber']||_0xb484('0x29');this[_0xb484('0x2a')]=_0x5ab3c2[_0xb484('0x2a')]||0x1e;this[_0xb484('0x2b')]=_0x5ab3c2['dialQueueOptions']||_0xb484('0x2c');this[_0xb484('0x2d')]=_0x5ab3c2[_0xb484('0x2d')]||0x3;this[_0xb484('0x2e')]=_0x5ab3c2[_0xb484('0x2e')]||undefined;this[_0xb484('0x2f')]=_0x5ab3c2[_0xb484('0x2f')]||0x3;this['dialCongestionRetryFrequency']=_0x5ab3c2['dialCongestionRetryFrequency']||0x96;this[_0xb484('0x30')]=_0x5ab3c2['dialBusyMaxRetry']||0x3;this[_0xb484('0x31')]=_0x5ab3c2[_0xb484('0x31')]||0x96;this[_0xb484('0x32')]=_0x5ab3c2[_0xb484('0x32')]||0x3;this[_0xb484('0x33')]=_0x5ab3c2['dialNoAnswerRetryFrequency']||0x96;this[_0xb484('0x34')]=_0x5ab3c2[_0xb484('0x34')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5ab3c2[_0xb484('0x35')]||0x96;this['dialDropMaxRetry']=_0x5ab3c2[_0xb484('0x36')]||0x3;this[_0xb484('0x37')]=_0x5ab3c2['dialDropRetryFrequency']||0x96;this[_0xb484('0x38')]=_0x5ab3c2['dialAbandonedMaxRetry']||0x3;this[_0xb484('0x39')]=_0x5ab3c2[_0xb484('0x39')]||0x96;this['dialMachineMaxRetry']=_0x5ab3c2['dialMachineMaxRetry']||0x3;this[_0xb484('0x3a')]=_0x5ab3c2[_0xb484('0x3a')]||0x96;this[_0xb484('0x3b')]=_0x5ab3c2['dialAgentRejectMaxRetry']||0x3;this[_0xb484('0x3c')]=_0x5ab3c2[_0xb484('0x3c')]||0x96;this[_0xb484('0x3d')]=_0x5ab3c2['dialGlobalMaxRetry']||0x4;this[_0xb484('0x3e')]=_0x5ab3c2['Trunk']?_0x5ab3c2['Trunk']:undefined;this[_0xb484('0x3f')]=_0x5ab3c2[_0xb484('0x3f')]?_0x5ab3c2['TrunkBackup']:undefined;this['dialPrefix']=_0x5ab3c2['dialPrefix']||undefined;this[_0xb484('0x40')]=_0x5ab3c2['Interval']?_0x5ab3c2[_0xb484('0x40')]:undefined;this[_0xb484('0x41')]=_0x5ab3c2['dialOrderByScheduledAt']||'DESC';this[_0xb484('0x42')]=_0x5ab3c2['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xb484('0x43')]=_0x5ab3c2[_0xb484('0x43')]||undefined;this[_0xb484('0x44')]=strategy[_0x5ab3c2[_0xb484('0x44')]]||'rrmemory';this[_0xb484('0x45')]=!![];this[_0xb484('0x46')]=_0x5ab3c2[_0xb484('0x46')]||![];this[_0xb484('0x47')]=_0x5ab3c2[_0xb484('0x47')];this[_0xb484('0x48')]=_0x5ab3c2[_0xb484('0x48')];this[_0xb484('0x49')]=_0x5ab3c2[_0xb484('0x49')];this['dialAMDTotalAnalysisTime']=_0x5ab3c2[_0xb484('0x4a')];this['dialAMDMinWordLength']=_0x5ab3c2[_0xb484('0x4b')];this[_0xb484('0x4c')]=_0x5ab3c2['dialAMDBetweenWordsSilence'];this[_0xb484('0x4d')]=_0x5ab3c2[_0xb484('0x4d')];this[_0xb484('0x4e')]=_0x5ab3c2['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x5ab3c2[_0xb484('0x4f')];this[_0xb484('0x50')]=0x0;this['pTalking']=0x0;this['timeout']=_0x5ab3c2[_0xb484('0x51')];this[_0xb484('0x52')]=0x0;this[_0xb484('0x53')]=0x0;this[_0xb484('0x54')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xb484('0x55')]=0x0;this[_0xb484('0x56')]=0x0;this[_0xb484('0x57')]=0x0;this[_0xb484('0x58')]=0x0;this[_0xb484('0x59')]=0x0;this[_0xb484('0x5a')]=0x0;this[_0xb484('0x5b')]=0x0;this[_0xb484('0x5c')]=0x0;this[_0xb484('0x5d')]=0x0;this[_0xb484('0x5e')]=0x0;this[_0xb484('0x5f')]=undefined;this[_0xb484('0x60')]=undefined;this['handlePredictive']=undefined;this[_0xb484('0x61')]=1.05;this[_0xb484('0x62')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xb484('0x63')]=0x0;this[_0xb484('0x64')]=0x0;this['predictiveIntervalMaxThreshold']=_0x5ab3c2['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xb484('0x65')]=_0x5ab3c2[_0xb484('0x66')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xb484('0x67')]=0x0;this[_0xb484('0x68')]=0x1;this[_0xb484('0x69')]=0x0;this[_0xb484('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xb484('0x6b')]=0x0;this[_0xb484('0x6c')]=_0x5ab3c2[_0xb484('0x6c')]||0x1e;this[_0xb484('0x6d')]=_0x5ab3c2[_0xb484('0x6d')]||![];this[_0xb484('0x6e')]=_0x5ab3c2['dialQueueProject2']||undefined;this[_0xb484('0x6f')]=_0x5ab3c2[_0xb484('0x6f')]||![];this[_0xb484('0x70')]=_0x5ab3c2['dialAgiAfterHangupAgent']||![];this[_0xb484('0xb')]=monitorFormat[_0x5ab3c2[_0xb484('0xb')]]?monitorFormat[_0x5ab3c2[_0xb484('0xb')]]:undefined;this[_0xb484('0x71')]=_0x5ab3c2[_0xb484('0x71')]||![];this[_0xb484('0x72')]=_0x5ab3c2[_0xb484('0x72')]?_0x5ab3c2[_0xb484('0x72')]:undefined;}module[_0xb484('0x73')]=VoiceQueue;
\ No newline at end of file
+var _0x4f11=['dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization'];(function(_0x2611dd,_0x1ab093){var _0x288bb4=function(_0x1553ac){while(--_0x1553ac){_0x2611dd['push'](_0x2611dd['shift']());}};_0x288bb4(++_0x1ab093);}(_0x4f11,0xcd));var _0x14f1=function(_0x3d6f94,_0x49d87f){_0x3d6f94=_0x3d6f94-0x0;var _0x2c1119=_0x4f11[_0x3d6f94];return _0x2c1119;};'use strict';var statusDesc=[_0x14f1('0x0'),_0x14f1('0x1'),_0x14f1('0x2'),_0x14f1('0x3'),_0x14f1('0x4'),'unavailable',_0x14f1('0x5'),_0x14f1('0x6'),_0x14f1('0x7')];var monitorFormat={'wav':_0x14f1('0x8'),'wav49':_0x14f1('0x9'),'gsm':_0x14f1('0xa')};var strategy={'rrmemory':_0x14f1('0xb'),'roundrobin':'roundrobin'};function VoiceQueue(_0x2dd330){this['id']=_0x2dd330['id']||0x0;this['name']=_0x2dd330[_0x14f1('0xc')]||'';this[_0x14f1('0xd')]=_0x2dd330[_0x14f1('0xd')]||'';this[_0x14f1('0xe')]=_0x2dd330[_0x14f1('0xe')]||_0x14f1('0xf');this[_0x14f1('0x10')]=0x0;this['talking']=0x0;this[_0x14f1('0x11')]=0x0;this[_0x14f1('0x12')]=0x0;this[_0x14f1('0x13')]=0x0;this[_0x14f1('0x14')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x14f1('0x15')]=0x0;this[_0x14f1('0x16')]=0x0;this['acw']=_0x2dd330[_0x14f1('0x17')]||![];this[_0x14f1('0x18')]=_0x2dd330[_0x14f1('0x18')]||0xa;this[_0x14f1('0x19')]=_0x2dd330[_0x14f1('0x19')]||'no';this[_0x14f1('0x1a')]=!![];this[_0x14f1('0x1b')]='';this[_0x14f1('0x1c')]=0x0;this[_0x14f1('0x1d')]=0x0;this[_0x14f1('0x1e')]=_0x2dd330[_0x14f1('0x1e')]||null;this[_0x14f1('0x1f')]=_0x2dd330[_0x14f1('0x1f')]?_0x2dd330[_0x14f1('0x1f')]:null;this[_0x14f1('0x20')]=_0x2dd330[_0x14f1('0x20')];this[_0x14f1('0x21')]=_0x2dd330['dialMethod']||_0x14f1('0x22');this[_0x14f1('0x23')]=_0x2dd330[_0x14f1('0x23')]||0x0;this[_0x14f1('0x24')]=_0x2dd330[_0x14f1('0x24')]||0x0;this[_0x14f1('0x25')]=_0x2dd330[_0x14f1('0x25')]||0x1;this[_0x14f1('0x26')]=_0x2dd330['dialPredictiveOptimization']||_0x14f1('0x27');this[_0x14f1('0x28')]=_0x2dd330[_0x14f1('0x28')]||0.03;this[_0x14f1('0x29')]=_0x2dd330[_0x14f1('0x29')]||0x258;this[_0x14f1('0x2a')]=_0x2dd330[_0x14f1('0x2a')]||_0x14f1('0x2b');this[_0x14f1('0x2c')]=_0x2dd330['dialOriginateCallerIdNumber']||_0x14f1('0x2b');this['dialOriginateTimeout']=_0x2dd330[_0x14f1('0x2d')]||0x1e;this['dialQueueOptions']=_0x2dd330[_0x14f1('0x2e')]||'tTxX';this['dialQueueTimeout']=_0x2dd330[_0x14f1('0x2f')]||0x3;this[_0x14f1('0x30')]=_0x2dd330[_0x14f1('0x30')]||undefined;this[_0x14f1('0x31')]=_0x2dd330['dialCongestionMaxRetry']||0x3;this[_0x14f1('0x32')]=_0x2dd330[_0x14f1('0x32')]||0x96;this['dialBusyMaxRetry']=_0x2dd330[_0x14f1('0x33')]||0x3;this[_0x14f1('0x34')]=_0x2dd330['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x2dd330['dialNoAnswerMaxRetry']||0x3;this[_0x14f1('0x35')]=_0x2dd330[_0x14f1('0x35')]||0x96;this[_0x14f1('0x36')]=_0x2dd330[_0x14f1('0x36')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2dd330[_0x14f1('0x37')]||0x96;this[_0x14f1('0x38')]=_0x2dd330['dialDropMaxRetry']||0x3;this[_0x14f1('0x39')]=_0x2dd330[_0x14f1('0x39')]||0x96;this[_0x14f1('0x3a')]=_0x2dd330['dialAbandonedMaxRetry']||0x3;this[_0x14f1('0x3b')]=_0x2dd330[_0x14f1('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x2dd330[_0x14f1('0x3c')]||0x3;this[_0x14f1('0x3d')]=_0x2dd330[_0x14f1('0x3d')]||0x96;this[_0x14f1('0x3e')]=_0x2dd330[_0x14f1('0x3e')]||0x3;this[_0x14f1('0x3f')]=_0x2dd330[_0x14f1('0x3f')]||0x96;this[_0x14f1('0x40')]=_0x2dd330[_0x14f1('0x40')]||0x4;this['Trunk']=_0x2dd330[_0x14f1('0x41')]?_0x2dd330[_0x14f1('0x41')]:undefined;this['TrunkBackup']=_0x2dd330[_0x14f1('0x42')]?_0x2dd330[_0x14f1('0x42')]:undefined;this['dialPrefix']=_0x2dd330[_0x14f1('0x43')]||undefined;this[_0x14f1('0x44')]=_0x2dd330['Interval']?_0x2dd330[_0x14f1('0x44')]:undefined;this['dialOrderByScheduledAt']=_0x2dd330[_0x14f1('0x45')]||_0x14f1('0x46');this['dialRandomLastDigitCallerIdNumber']=_0x2dd330['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x14f1('0x47')]=_0x2dd330['dialCutDigit']||undefined;this['strategy']=strategy[_0x2dd330[_0x14f1('0x48')]]||_0x14f1('0xb');this[_0x14f1('0x49')]=!![];this[_0x14f1('0x4a')]=_0x2dd330[_0x14f1('0x4a')]||![];this[_0x14f1('0x4b')]=_0x2dd330[_0x14f1('0x4b')];this['dialAMDGreeting']=_0x2dd330[_0x14f1('0x4c')];this[_0x14f1('0x4d')]=_0x2dd330[_0x14f1('0x4d')];this[_0x14f1('0x4e')]=_0x2dd330[_0x14f1('0x4e')];this[_0x14f1('0x4f')]=_0x2dd330['dialAMDMinWordLength'];this[_0x14f1('0x50')]=_0x2dd330['dialAMDBetweenWordsSilence'];this[_0x14f1('0x51')]=_0x2dd330[_0x14f1('0x51')];this['dialAMDSilenceThreshold']=_0x2dd330['dialAMDSilenceThreshold'];this[_0x14f1('0x52')]=_0x2dd330[_0x14f1('0x52')];this[_0x14f1('0x53')]=0x0;this[_0x14f1('0x54')]=0x0;this[_0x14f1('0x55')]=_0x2dd330[_0x14f1('0x55')];this['outboundAnswerCallsDay']=0x0;this[_0x14f1('0x56')]=0x0;this[_0x14f1('0x57')]=0x0;this[_0x14f1('0x58')]=0x0;this[_0x14f1('0x59')]=0x0;this[_0x14f1('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x14f1('0x5b')]=0x0;this[_0x14f1('0x5c')]=0x0;this[_0x14f1('0x5d')]=0x0;this[_0x14f1('0x5e')]=0x0;this[_0x14f1('0x5f')]=0x0;this[_0x14f1('0x60')]=0x0;this[_0x14f1('0x61')]=0x0;this[_0x14f1('0x62')]=undefined;this['startPredictive']=undefined;this[_0x14f1('0x63')]=undefined;this[_0x14f1('0x64')]=1.05;this[_0x14f1('0x65')]=0x0;this[_0x14f1('0x66')]=0x0;this[_0x14f1('0x67')]=0x0;this[_0x14f1('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x14f1('0x69')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x14f1('0x6a')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2dd330[_0x14f1('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x2dd330['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x14f1('0x6c')]=0x0;this[_0x14f1('0x6d')]=0x0;this[_0x14f1('0x6e')]=0x1;this[_0x14f1('0x6f')]=0x0;this[_0x14f1('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x14f1('0x71')]=0x0;this[_0x14f1('0x72')]=_0x2dd330[_0x14f1('0x72')]||0x1e;this[_0x14f1('0x73')]=_0x2dd330['dialRecallInQueue']||![];this['dialQueueProject2']=_0x2dd330[_0x14f1('0x74')]||undefined;this[_0x14f1('0x75')]=_0x2dd330[_0x14f1('0x75')]||![];this['dialAgiAfterHangupAgent']=_0x2dd330[_0x14f1('0x76')]||![];this[_0x14f1('0xd')]=monitorFormat[_0x2dd330[_0x14f1('0xd')]]?monitorFormat[_0x2dd330[_0x14f1('0xd')]]:undefined;this['mandatoryDisposition']=_0x2dd330[_0x14f1('0x77')]||![];this['mandatoryDispositionPause']=_0x2dd330[_0x14f1('0x78')]?_0x2dd330[_0x14f1('0x78')]:undefined;}module[_0x14f1('0x79')]=VoiceQueue;
\ No newline at end of file
index a39a8f6..a9d7f28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4d7=['accessKey','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x6a5c20,_0x5e66cd){var _0x150981=function(_0x172847){while(--_0x172847){_0x6a5c20['push'](_0x6a5c20['shift']());}};_0x150981(++_0x5e66cd);}(_0xb4d7,0x71));var _0x7b4d=function(_0x35b0ec,_0x1f7e14){_0x35b0ec=_0x35b0ec-0x0;var _0x2dc55a=_0xb4d7[_0x35b0ec];return _0x2dc55a;};'use strict';function VtigerAccount(_0x510319){this['id']=_0x510319['id']||0x0;this['name']=_0x510319['name']||'';this['username']=_0x510319[_0x7b4d('0x0')]||'';this[_0x7b4d('0x1')]=_0x510319[_0x7b4d('0x1')]||'';this[_0x7b4d('0x2')]=_0x510319[_0x7b4d('0x2')]||'';this[_0x7b4d('0x3')]=_0x510319[_0x7b4d('0x3')]||'';this[_0x7b4d('0x4')]=_0x510319[_0x7b4d('0x4')]||{};}module[_0x7b4d('0x5')]=VtigerAccount;
\ No newline at end of file
+var _0xb028=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x56d49d,_0x114e94){var _0x5a70fa=function(_0x318a06){while(--_0x318a06){_0x56d49d['push'](_0x56d49d['shift']());}};_0x5a70fa(++_0x114e94);}(_0xb028,0xfb));var _0x8b02=function(_0x3452ce,_0x124927){_0x3452ce=_0x3452ce-0x0;var _0xee20c5=_0xb028[_0x3452ce];return _0xee20c5;};'use strict';function VtigerAccount(_0x514163){this['id']=_0x514163['id']||0x0;this[_0x8b02('0x0')]=_0x514163['name']||'';this[_0x8b02('0x1')]=_0x514163[_0x8b02('0x1')]||'';this[_0x8b02('0x2')]=_0x514163[_0x8b02('0x2')]||'';this['remoteUri']=_0x514163[_0x8b02('0x3')]||'';this[_0x8b02('0x4')]=_0x514163[_0x8b02('0x4')]||'';this[_0x8b02('0x5')]=_0x514163[_0x8b02('0x5')]||{};}module[_0x8b02('0x6')]=VtigerAccount;
\ No newline at end of file
index 7787e01..6d7efe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cb0=['type','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x4b5c7d,_0x28c473){var _0x1ed572=function(_0x2521fa){while(--_0x2521fa){_0x4b5c7d['push'](_0x4b5c7d['shift']());}};_0x1ed572(++_0x28c473);}(_0x9cb0,0x13e));var _0x09cb=function(_0x1e1082,_0x264907){_0x1e1082=_0x1e1082-0x0;var _0x10a267=_0x9cb0[_0x1e1082];return _0x10a267;};'use strict';function ZendeskAccount(_0x1c0be5){this['id']=_0x1c0be5['id']||0x0;this[_0x09cb('0x0')]=_0x1c0be5[_0x09cb('0x0')]||'';this[_0x09cb('0x1')]=_0x1c0be5[_0x09cb('0x1')]||'';this[_0x09cb('0x2')]=_0x1c0be5[_0x09cb('0x2')]||'';this['token']=_0x1c0be5['token']||'';this[_0x09cb('0x3')]=_0x1c0be5[_0x09cb('0x3')]||'';this['authType']=_0x1c0be5['authType']||'';this[_0x09cb('0x4')]=_0x1c0be5[_0x09cb('0x4')]||'integrationTab';this[_0x09cb('0x5')]=_0x1c0be5[_0x09cb('0x5')]||'';this['Configurations']=_0x1c0be5[_0x09cb('0x6')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
+var _0xe795=['Configurations','exports','name','password','token','remoteUri','authType','type','integrationTab'];(function(_0x18914c,_0x29e77a){var _0x3616d8=function(_0x44dd39){while(--_0x44dd39){_0x18914c['push'](_0x18914c['shift']());}};_0x3616d8(++_0x29e77a);}(_0xe795,0x14f));var _0x5e79=function(_0x1d4700,_0x1caa10){_0x1d4700=_0x1d4700-0x0;var _0x43ea9d=_0xe795[_0x1d4700];return _0x43ea9d;};'use strict';function ZendeskAccount(_0x3d5ca5){this['id']=_0x3d5ca5['id']||0x0;this[_0x5e79('0x0')]=_0x3d5ca5['name']||'';this['username']=_0x3d5ca5['username']||'';this[_0x5e79('0x1')]=_0x3d5ca5['password']||'';this[_0x5e79('0x2')]=_0x3d5ca5[_0x5e79('0x2')]||'';this[_0x5e79('0x3')]=_0x3d5ca5[_0x5e79('0x3')]||'';this[_0x5e79('0x4')]=_0x3d5ca5['authType']||'';this[_0x5e79('0x5')]=_0x3d5ca5[_0x5e79('0x5')]||_0x5e79('0x6');this['serverUrl']=_0x3d5ca5['serverUrl']||'';this[_0x5e79('0x7')]=_0x3d5ca5['Configurations']||{};}module[_0x5e79('0x8')]=ZendeskAccount;
\ No newline at end of file
index 002c799..af22141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ccc=['refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x699323,_0x590e85){var _0x486087=function(_0x566af4){while(--_0x566af4){_0x699323['push'](_0x699323['shift']());}};_0x486087(++_0x590e85);}(_0x1ccc,0xca));var _0xc1cc=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x1ccc[_0x3c504b];return _0x2e5354;};'use strict';function ZohoAccount(_0x705fc8){this['id']=_0x705fc8['id']||0x0;this[_0xc1cc('0x0')]=_0x705fc8[_0xc1cc('0x0')]||'';this[_0xc1cc('0x1')]=_0x705fc8[_0xc1cc('0x1')]||'';this[_0xc1cc('0x2')]=_0x705fc8['host']||'';this[_0xc1cc('0x3')]=_0x705fc8[_0xc1cc('0x3')]||'';this[_0xc1cc('0x4')]=_0x705fc8[_0xc1cc('0x4')]||'';this[_0xc1cc('0x5')]=_0x705fc8['clientSecret']||'';this[_0xc1cc('0x6')]=_0x705fc8[_0xc1cc('0x6')]||'';this['code']=_0x705fc8[_0xc1cc('0x7')]||'';this[_0xc1cc('0x8')]=_0x705fc8['refreshToken']||'';this[_0xc1cc('0x9')]=_0x705fc8[_0xc1cc('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0xfbc3=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0xfef430,_0x1b5e4f){var _0x42455b=function(_0xfef59b){while(--_0xfef59b){_0xfef430['push'](_0xfef430['shift']());}};_0x42455b(++_0x1b5e4f);}(_0xfbc3,0xe0));var _0x3fbc=function(_0x4dc13a,_0x493f4e){_0x4dc13a=_0x4dc13a-0x0;var _0x5b2b77=_0xfbc3[_0x4dc13a];return _0x5b2b77;};'use strict';function ZohoAccount(_0x52d607){this['id']=_0x52d607['id']||0x0;this[_0x3fbc('0x0')]=_0x52d607[_0x3fbc('0x0')]||'';this[_0x3fbc('0x1')]=_0x52d607['description']||'';this[_0x3fbc('0x2')]=_0x52d607[_0x3fbc('0x2')]||'';this[_0x3fbc('0x3')]=_0x52d607[_0x3fbc('0x3')]||'';this[_0x3fbc('0x4')]=_0x52d607[_0x3fbc('0x4')]||'';this[_0x3fbc('0x5')]=_0x52d607[_0x3fbc('0x5')]||'';this[_0x3fbc('0x6')]=_0x52d607[_0x3fbc('0x6')]||'';this['code']=_0x52d607[_0x3fbc('0x7')]||'';this['refreshToken']=_0x52d607[_0x3fbc('0x8')]||'';this[_0x3fbc('0x9')]=_0x52d607['Configurations']||{};}module[_0x3fbc('0xa')]=ZohoAccount;
\ No newline at end of file
index 7674901..1eff01f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbda1=['UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','queue','type','campaigntype','dialAnswer','membername','Agent','name','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackat','recallme','ContactId','ListId'];(function(_0x36ccc5,_0x472c9a){var _0x5da2e0=function(_0x4ef0fa){while(--_0x4ef0fa){_0x36ccc5['push'](_0x36ccc5['shift']());}};_0x5da2e0(++_0x472c9a);}(_0xbda1,0x1c2));var _0x1bda=function(_0x44aa11,_0x34202b){_0x44aa11=_0x44aa11-0x0;var _0x59e6fa=_0xbda1[_0x44aa11];return _0x59e6fa;};'use strict';var util=require(_0x1bda('0x0'));var _=require(_0x1bda('0x1'));var moment=require(_0x1bda('0x2'));function checkNameSurname(_0xd8ef2b,_0x4aa01f,_0x19ae07){var _0x408aa0='';if(!_[_0x1bda('0x3')](_0x4aa01f)&&_0x1bda('0x4')===typeof _0x4aa01f){_0x408aa0+=_0x4aa01f;}if(!_[_0x1bda('0x3')](_0x19ae07)&&'string'===typeof _0x19ae07){_0x408aa0+='\x20'+_0x19ae07;}if(_0x408aa0!==''){return _0x408aa0;}return _0xd8ef2b;}function Action(_0x12ebfa,_0x2720c0,_0x2590f0,_0xa4f9c1,_0x3e426d){this[_0x1bda('0x5')]=_0x2590f0||undefined;this['idContact']=_0x12ebfa['id'];this[_0x1bda('0x6')]=_0x2720c0['name'];this['type']=_0x2720c0[_0x1bda('0x7')];this[_0x1bda('0x8')]=_0x1bda('0x6');this[_0x1bda('0x9')]=![];this[_0x1bda('0xa')]=_['isNil'](_0x12ebfa['Agent'])?undefined:_0x12ebfa[_0x1bda('0xb')][_0x1bda('0xc')];this['channelAgent']=this[_0x1bda('0xa')]?util['format']('SIP/%s',this[_0x1bda('0xa')]):_0xa4f9c1||undefined;this[_0x1bda('0xd')]=checkNameSurname(_0x12ebfa[_0x1bda('0xe')][_0x1bda('0xf')],_0x12ebfa['Contact'][_0x1bda('0x10')],_0x12ebfa['Contact']['lastName']);this[_0x1bda('0x11')]=_0x12ebfa[_0x1bda('0x11')]||![];this[_0x1bda('0x12')]=_0x12ebfa['Contact']['phone'];this[_0x1bda('0x13')]=_0x12ebfa['scheduledat'];this[_0x1bda('0x14')]=_0x12ebfa[_0x1bda('0x14')]||0x0;this['countcongestionretry']=_0x12ebfa[_0x1bda('0x15')]||0x0;this[_0x1bda('0x16')]=_0x12ebfa[_0x1bda('0x16')]||0x0;this[_0x1bda('0x17')]=(_0x12ebfa[_0x1bda('0x14')]||0x0)+(_0x12ebfa['countcongestionretry']||0x0)+(_0x12ebfa[_0x1bda('0x16')]||0x0)+(_0x12ebfa[_0x1bda('0x18')]||0x0)+(_0x12ebfa['countdropretry']||0x0)+(_0x12ebfa[_0x1bda('0x19')]||0x0)+(_0x12ebfa['countmachineretry']||0x0)+(_0x12ebfa[_0x1bda('0x1a')]||0x0);this['countnosuchnumberretry']=_0x12ebfa['countnosuchnumberretry']||0x0;this[_0x1bda('0x1b')]=_0x12ebfa[_0x1bda('0x1b')]||0x0;this[_0x1bda('0x19')]=_0x12ebfa[_0x1bda('0x19')]||0x0;this[_0x1bda('0x1c')]=_0x12ebfa[_0x1bda('0x1c')]||0x0;this[_0x1bda('0x1a')]=_0x12ebfa[_0x1bda('0x1a')]||0x0;this['callback']=_0x12ebfa[_0x1bda('0x1d')];this['callbackuniqueid']=_0x12ebfa['callbackuniqueid'];this[_0x1bda('0x1e')]=_0x12ebfa[_0x1bda('0x1e')];this[_0x1bda('0x1f')]=_0x12ebfa[_0x1bda('0x1f')];this[_0x1bda('0x20')]=_0x12ebfa[_0x1bda('0x20')];this['ListId']=_0x12ebfa[_0x1bda('0x21')];this[_0x1bda('0x22')]=_[_0x1bda('0x3')](_0x12ebfa[_0x1bda('0xb')])?_0x12ebfa[_0x1bda('0x22')]:_0x12ebfa[_0x1bda('0xb')]['id'];this['VoiceQueueId']=_0x12ebfa[_0x1bda('0x23')];this[_0x1bda('0x24')]='';this[_0x1bda('0x25')]='';}Action[_0x1bda('0x26')][_0x1bda('0x27')]=function(){return util[_0x1bda('0x28')](_0x1bda('0x29'),this[_0x1bda('0xd')],this[_0x1bda('0x2a')]);};module[_0x1bda('0x2b')]=Action;
\ No newline at end of file
+var _0x6c22=['calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','isNil','string','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x6c22,0x100));var _0x26c2=function(_0x2401d2,_0x57caea){_0x2401d2=_0x2401d2-0x0;var _0x17c81f=_0x6c22[_0x2401d2];return _0x17c81f;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x3e2019,_0x5b2d54,_0x32c84c){var _0x50cd9a='';if(!_['isNil'](_0x5b2d54)&&'string'===typeof _0x5b2d54){_0x50cd9a+=_0x5b2d54;}if(!_[_0x26c2('0x0')](_0x32c84c)&&_0x26c2('0x1')===typeof _0x32c84c){_0x50cd9a+='\x20'+_0x32c84c;}if(_0x50cd9a!==''){return _0x50cd9a;}return _0x3e2019;}function Action(_0x16dd7e,_0x34942c,_0x48181b,_0x1f50b2,_0x547f3d){this['uniqueid']=_0x48181b||undefined;this['idContact']=_0x16dd7e['id'];this[_0x26c2('0x2')]=_0x34942c[_0x26c2('0x3')];this['type']=_0x34942c['type'];this[_0x26c2('0x4')]='queue';this[_0x26c2('0x5')]=![];this[_0x26c2('0x6')]=_['isNil'](_0x16dd7e['Agent'])?undefined:_0x16dd7e[_0x26c2('0x7')][_0x26c2('0x3')];this[_0x26c2('0x8')]=this[_0x26c2('0x6')]?util[_0x26c2('0x9')]('SIP/%s',this[_0x26c2('0x6')]):_0x1f50b2||undefined;this[_0x26c2('0xa')]=checkNameSurname(_0x16dd7e[_0x26c2('0xb')][_0x26c2('0xc')],_0x16dd7e[_0x26c2('0xb')][_0x26c2('0xd')],_0x16dd7e[_0x26c2('0xb')][_0x26c2('0xe')]);this['active']=_0x16dd7e[_0x26c2('0xf')]||![];this['calleridnum']=_0x16dd7e[_0x26c2('0xb')][_0x26c2('0xc')];this[_0x26c2('0x10')]=_0x16dd7e['scheduledat'];this[_0x26c2('0x11')]=_0x16dd7e[_0x26c2('0x11')]||0x0;this[_0x26c2('0x12')]=_0x16dd7e[_0x26c2('0x12')]||0x0;this['countnoanswerretry']=_0x16dd7e[_0x26c2('0x13')]||0x0;this[_0x26c2('0x14')]=(_0x16dd7e[_0x26c2('0x11')]||0x0)+(_0x16dd7e[_0x26c2('0x12')]||0x0)+(_0x16dd7e[_0x26c2('0x13')]||0x0)+(_0x16dd7e[_0x26c2('0x15')]||0x0)+(_0x16dd7e['countdropretry']||0x0)+(_0x16dd7e[_0x26c2('0x16')]||0x0)+(_0x16dd7e[_0x26c2('0x17')]||0x0)+(_0x16dd7e['countagentrejectretry']||0x0);this[_0x26c2('0x15')]=_0x16dd7e[_0x26c2('0x15')]||0x0;this['countdropretry']=_0x16dd7e['countdropretry']||0x0;this[_0x26c2('0x16')]=_0x16dd7e['countabandonedretry']||0x0;this[_0x26c2('0x17')]=_0x16dd7e[_0x26c2('0x17')]||0x0;this['countagentrejectretry']=_0x16dd7e[_0x26c2('0x18')]||0x0;this[_0x26c2('0x19')]=_0x16dd7e[_0x26c2('0x19')];this[_0x26c2('0x1a')]=_0x16dd7e[_0x26c2('0x1a')];this[_0x26c2('0x1b')]=_0x16dd7e[_0x26c2('0x1b')];this[_0x26c2('0x1c')]=_0x16dd7e[_0x26c2('0x1c')];this[_0x26c2('0x1d')]=_0x16dd7e[_0x26c2('0x1d')];this[_0x26c2('0x1e')]=_0x16dd7e[_0x26c2('0x1e')];this['UserId']=_[_0x26c2('0x0')](_0x16dd7e[_0x26c2('0x7')])?_0x16dd7e[_0x26c2('0x1f')]:_0x16dd7e[_0x26c2('0x7')]['id'];this['VoiceQueueId']=_0x16dd7e[_0x26c2('0x20')];this[_0x26c2('0x21')]='';this[_0x26c2('0x22')]='';}Action['prototype'][_0x26c2('0x23')]=function(){return util['format'](_0x26c2('0x24'),this['calleridname'],this[_0x26c2('0x25')]);};module['exports']=Action;
\ No newline at end of file
index f363b4b..330dc78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x740a=['custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','reason','[originated][decrement][callProgressDetectingAgent]','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','starttime','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','isFailure','disableContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncDialEnd','destlinkedid','addVariable','variables','syncVarSet','filterKey','keys','variable','error','[syncVarSet][Preview]','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','localhost','redis','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','newexten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','loggedIn','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','info','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','buildObj','complete','outboundAnswerCallsDay','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','unlockAgent','NOANSWER','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x740a,0x1dd));var _0xa740=function(_0x328545,_0x140881){_0x328545=_0x328545-0x0;var _0x5a7526=_0x740a[_0x328545];return _0x5a7526;};'use strict';var util=require(_0xa740('0x0'));var _=require(_0xa740('0x1'));var BPromise=require(_0xa740('0x2'));var uuid=require(_0xa740('0x3'));var moment=require('moment');var md5=require(_0xa740('0x4'));var Redis=require(_0xa740('0x5'));var config=require(_0xa740('0x6'));var logger=require(_0xa740('0x7'))(_0xa740('0x8'));var loggerAction=require(_0xa740('0x7'))(_0xa740('0x9'));var ami=require(_0xa740('0xa'));var rpcDb=require(_0xa740('0xb'));var Action=require(_0xa740('0xc'));var ut=require(_0xa740('0xd'));config['redis']=_[_0xa740('0xe')](config['redis'],{'host':_0xa740('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa740('0x10')]));var Sequence=function(){};Sequence['prototype'][_0xa740('0x11')]=function(_0x36298b){this[_0xa740('0x12')]=this['tail']?this['tail'][_0xa740('0x13')](_0x36298b):_0x36298b();};function Preview(_0x2a8a98){this[_0xa740('0x14')]=new Sequence();this[_0xa740('0x15')]=_0x2a8a98['voiceQueues'];this[_0xa740('0x16')]=_0x2a8a98['trunks'];this[_0xa740('0x17')]={};this['agents']=_0x2a8a98[_0xa740('0x18')];this[_0xa740('0x19')]=0x0;ami['on'](_0xa740('0x1a'),this[_0xa740('0x1b')]['bind'](this));ami['on']('hangup',this[_0xa740('0x1c')][_0xa740('0x1d')](this));ami['on'](_0xa740('0x1e'),this[_0xa740('0x1f')][_0xa740('0x1d')](this));ami['on'](_0xa740('0x20'),this['syncDialEnd']['bind'](this));ami['on'](_0xa740('0x21'),this['syncNewExten'][_0xa740('0x1d')](this));ami['on'](_0xa740('0x22'),this['syncVarSet'][_0xa740('0x1d')](this));ami['on'](_0xa740('0x23'),this['syncAttendedTransfer'][_0xa740('0x1d')](this));ami['on'](_0xa740('0x24'),this[_0xa740('0x25')]['bind'](this));this[_0xa740('0x26')](this['campaignsPreview']);}function emit(_0x45bc60,_0x380ff0,_0x17f36a){io['to'](_0x45bc60)[_0xa740('0x27')](_0x380ff0,_0x17f36a);}function emitCampaignPreview(_0x139235){if(_0x139235[_0xa740('0x28')]===_0xa740('0x29')){var _0x4ea029={'id':_0x139235['id'],'name':_0x139235[_0xa740('0x2a')],'strategy':_0x139235[_0xa740('0x2b')],'answered':_0x139235['answered'],'available':_0x139235['available'],'loggedIn':_0x139235[_0xa740('0x2c')],'pTalking':_0x139235['pTalking'],'sumBillable':_0x139235['sumBillable'],'sumDuration':_0x139235['sumDuration'],'sumHoldTime':_0x139235[_0xa740('0x2d')]||0x0,'talking':_0x139235['talking'],'total':_0x139235[_0xa740('0x2e')],'type':_0x139235[_0xa740('0x28')],'unmanaged':_0x139235['unmanaged'],'abandoned':_0x139235[_0xa740('0x2f')],'waiting':_0x139235[_0xa740('0x30')],'loggedInDb':_0x139235[_0xa740('0x31')],'dialActive':_0x139235[_0xa740('0x32')],'dialMethod':_0x139235[_0xa740('0x33')],'dialOriginateCallerIdName':_0x139235[_0xa740('0x34')],'dialOriginateCallerIdNumber':_0x139235[_0xa740('0x35')],'dialOriginateTimeout':_0x139235['dialOriginateTimeout'],'dialPrefix':_0x139235['dialPrefix'],'outboundAnswerAgiCallsDay':_0x139235[_0xa740('0x36')],'outboundAnswerCallsDay':_0x139235['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x139235[_0xa740('0x37')],'outboundBusyCallsDay':_0x139235[_0xa740('0x38')],'outboundCongestionCallsDay':_0x139235[_0xa740('0x39')],'outboundDropCallsDayACS':_0x139235[_0xa740('0x3a')],'outboundDropCallsDayCallersExit':_0x139235[_0xa740('0x3b')],'outboundDropCallsDayTimeout':_0x139235['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x139235[_0xa740('0x3c')],'outboundNoSuchCallsDay':_0x139235[_0xa740('0x3d')],'outboundOriginateFailureCallsDay':_0x139235[_0xa740('0x3e')],'outboundReCallsDay':_0x139235[_0xa740('0x3f')],'outboundRejectCallsDay':_0x139235[_0xa740('0x40')],'outboundUnknownCallsDay':_0x139235['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x139235[_0xa740('0x41')],'predictiveIntervalAnsweredCalls':_0x139235[_0xa740('0x42')],'predictiveIntervalAvgHoldtime':_0x139235['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x139235[_0xa740('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x139235[_0xa740('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x139235[_0xa740('0x45')],'predictiveIntervalErlangCalls':_0x139235[_0xa740('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x139235['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x139235[_0xa740('0x47')],'predictiveIntervalMultiplicativeFactor':_0x139235[_0xa740('0x48')],'predictiveIntervalPauses':_0x139235[_0xa740('0x49')],'predictiveIntervalAvailable':_0x139235[_0xa740('0x4a')],'predictiveIntervalTotalCalls':_0x139235[_0xa740('0x4b')],'message':_0x139235[_0xa740('0x4c')],'originated':_0x139235[_0xa740('0x4d')],'erlangCalls':_0x139235[_0xa740('0x4e')],'erlangCallToSecond':_0x139235[_0xa740('0x4f')],'erlangAbandonmentRate':_0x139235[_0xa740('0x50')],'erlangBusyFactor':_0x139235[_0xa740('0x51')],'startPredictive':_0x139235[_0xa740('0x52')],'startProgressive':_0x139235[_0xa740('0x53')]};if(_0x139235[_0xa740('0x54')]){_0x4ea029[_0xa740('0x54')]={'id':_0x139235[_0xa740('0x54')]['id'],'name':_0x139235[_0xa740('0x54')]['name'],'active':_0x139235[_0xa740('0x54')][_0xa740('0x55')],'callerid':_0x139235[_0xa740('0x54')][_0xa740('0x56')]};}if(_0x139235[_0xa740('0x57')]){_0x4ea029[_0xa740('0x57')]={'id':_0x139235[_0xa740('0x57')]['id'],'name':_0x139235[_0xa740('0x57')][_0xa740('0x2a')]};}var _0x3308a7=md5(JSON[_0xa740('0x58')](_0x4ea029));if(_0x139235['md5']!==_0x3308a7){_0x139235[_0xa740('0x4')]=_0x3308a7;emit(util['format'](_0xa740('0x59'),_0x4ea029['name']),_0xa740('0x5a'),_0x4ea029);}}}function emitVoiceQueueChannelRemove(_0x2960d6){logger['info'](_0xa740('0x5b'),JSON[_0xa740('0x58')](_0x2960d6));emit(util[_0xa740('0x5c')](_0xa740('0x59'),_0x2960d6['name']),_0xa740('0x5d'),_0x2960d6);io[_0xa740('0x27')]('voice_queue_presence:remove',_0x2960d6);}function notSendMessagesQueue(_0x13e7f2){if(_0x13e7f2[_0xa740('0x5e')]){if(_0x13e7f2[_0xa740('0x4d')]===0x0&&_0x13e7f2[_0xa740('0x5f')]===0x0){_0x13e7f2[_0xa740('0x5e')]=![];_0x13e7f2[_0xa740('0x60')]=0x0;_0x13e7f2[_0xa740('0x61')]=0x0;_0x13e7f2['message']=_0xa740('0x62');ut[_0xa740('0x63')](_0xa740('0x64'),_0x13e7f2[_0xa740('0x2a')]+'\x20is\x20not\x20active');}else{_0x13e7f2[_0xa740('0x4c')]=_0xa740('0x65');ut[_0xa740('0x63')](_0xa740('0x64'),_0x13e7f2[_0xa740('0x2a')]+'\x20is\x20disactive');}emitCampaignPreview(_0x13e7f2);}}Preview[_0xa740('0x66')][_0xa740('0x26')]=function(){var _0x533ab0=this;setInterval(function(){_0x533ab0['syncCampaigns']();},0x7cf);};Preview[_0xa740('0x66')][_0xa740('0x67')]=function(){var _0x4996e2=this['campaignsPreview'];this[_0xa740('0x19')]+=0x1;for(var _0x4b0bbc in _0x4996e2){if(_0x4996e2[_0xa740('0x68')](_0x4b0bbc)&&(_0x4996e2[_0x4b0bbc]['dialMethod']===_0xa740('0x8')||_0x4996e2[_0x4b0bbc]['dialMethod']===_0xa740('0x69'))&&_0x4996e2[_0x4b0bbc]['type']===_0xa740('0x29')){if(this[_0xa740('0x19')]>0x7){this[_0xa740('0x19')]=0x0;this[_0xa740('0x6a')]();}}if(_0x4996e2[_0xa740('0x68')](_0x4b0bbc)&&_0x4996e2[_0x4b0bbc][_0xa740('0x33')]===_0xa740('0x8')&&_0x4996e2[_0x4b0bbc]['type']==='outbound'){if(_0x4996e2[_0x4b0bbc]['dialActive']){this[_0xa740('0x6b')](_0x4996e2[_0x4b0bbc]);this[_0xa740('0x6c')](_0x4996e2[_0x4b0bbc]);}else{notSendMessagesQueue(_0x4996e2[_0x4b0bbc]);}}}};Preview[_0xa740('0x66')]['clearZombieChannel']=function(_0x7fdcea){var _0x3ad279=this;this[_0xa740('0x14')][_0xa740('0x11')](function(){if(!_[_0xa740('0x6d')](_0x3ad279[_0xa740('0x17')][_0x7fdcea])){loggerAction['info']('[clearZombieChannels][talking]',_0x7fdcea,_0xa740('0x6e'),_0x3ad279[_0xa740('0x17')][_0x7fdcea][_0xa740('0x6f')],_0xa740('0x70'),JSON[_0xa740('0x58')](_0x3ad279[_0xa740('0x15')][_0x3ad279[_0xa740('0x17')][_0x7fdcea]['queue']][_0xa740('0x4d')]),_0xa740('0x71'),JSON[_0xa740('0x58')](_0x3ad279[_0xa740('0x15')][_0x3ad279[_0xa740('0x17')][_0x7fdcea]['queue']]['pTalking']),JSON[_0xa740('0x58')](_0x3ad279[_0xa740('0x17')][_0x7fdcea][_0xa740('0x72')]),JSON['stringify'](_[_0xa740('0x73')](_0x3ad279[_0xa740('0x17')][_0x7fdcea],[_0xa740('0x74'),_0xa740('0x75'),'VoiceQueueId','ListId'])));return ami[_0xa740('0x76')]({'action':_0xa740('0x77'),'channel':_0x3ad279[_0xa740('0x17')][_0x7fdcea][_0xa740('0x78')]})[_0xa740('0x79')](function(_0x2d31c3){if(_0x2d31c3[_0xa740('0x4c')]===_0xa740('0x7a')){setTimeout(function(){if(_0x3ad279[_0xa740('0x17')][_0x7fdcea]){ut[_0xa740('0x7b')](_0x3ad279[_0xa740('0x15')][_0x3ad279[_0xa740('0x17')][_0x7fdcea]['queue']],_0xa740('0x7c'));if(_0x3ad279[_0xa740('0x17')][_0x7fdcea][_0xa740('0x72')]===!![]){ut[_0xa740('0x7d')](_0x3ad279['campaignsPreview'][_0x3ad279['actions'][_0x7fdcea][_0xa740('0x6f')]],_0xa740('0x7c'));ut[_0xa740('0x7e')](_0xa740('0x7f')+_0x7fdcea,_0x3ad279[_0xa740('0x17')][_0x7fdcea][_0xa740('0x6f')]);}ut[_0xa740('0x7e')](_0xa740('0x80')+_0x7fdcea,_0x3ad279[_0xa740('0x17')][_0x7fdcea][_0xa740('0x6f')]);delete _0x3ad279[_0xa740('0x17')][_0x7fdcea];}},0x2328);}});}});};Preview[_0xa740('0x66')][_0xa740('0x6a')]=function(){var _0x431b8d=this;loggerAction[_0xa740('0x81')]('[action]',_[_0xa740('0x82')](this[_0xa740('0x17')]));for(var _0xf68628 in this[_0xa740('0x17')]){if(_0x431b8d[_0xa740('0x17')][_0xa740('0x68')](_0xf68628)){_0x431b8d['clearZombieChannel'](_0xf68628);}}};Preview[_0xa740('0x66')][_0xa740('0x6c')]=function(_0x1cfcb9){var _0x2ecfac=this;rpcDb[_0xa740('0x83')](_0x1cfcb9['id'],ut[_0xa740('0x84')](this[_0xa740('0x18')]))[_0xa740('0x85')](function(_0x10a2ce){if(!_[_0xa740('0x6d')](_0x10a2ce)){for(var _0x2382b0=0x0;_0x2382b0<_0x10a2ce[_0xa740('0x86')];_0x2382b0+=0x1){if(ut[_0xa740('0x87')](_0x10a2ce[_0x2382b0][_0xa740('0x88')])<_0x1cfcb9[_0xa740('0x89')]*0x3c){if(_0x10a2ce[_0x2382b0][_0xa740('0x8a')]&&!_0x10a2ce[_0x2382b0]['Agent']['voicePause']){_0x2ecfac[_0xa740('0x8b')](_0x10a2ce[_0x2382b0]['id'])[_0xa740('0x85')](ut[_0xa740('0x8c')]('[RecallMe]'))[_0xa740('0x79')](ut['logger2'](_0xa740('0x8d')));}else{rpcDb['disableContact'](_0x10a2ce[_0x2382b0]['id']);}}else{var _0x38c1bc=new Action(_0x10a2ce[_0x2382b0],_0x1cfcb9);_0x38c1bc['starttime']=moment()[_0xa740('0x5c')](_0xa740('0x8e'));_0x1cfcb9[_0xa740('0x3f')]+=0x1;ut[_0xa740('0x8f')](_0x38c1bc,0x17,_0xa740('0x90'));if(_0x1cfcb9[_0xa740('0x91')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x10a2ce[_0x2382b0]));rpcDb[_0xa740('0x92')](_0x38c1bc,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x38c1bc,0x16,_0xa740('0x93'));rpcDb[_0xa740('0x92')](_0x38c1bc,_0xa740('0x94'));rpcDb[_0xa740('0x95')](_0x38c1bc,_0xa740('0x94'));}}}}})[_0xa740('0x79')](ut['logger2'](_0xa740('0x96')));};Preview['prototype'][_0xa740('0x6b')]=function(_0x62d5ba){_0x62d5ba['sendMessageOneNotActive']=!![];if(ut[_0xa740('0x97')](_0x62d5ba[_0xa740('0x2c')])){_0x62d5ba['message']=_0xa740('0x98');}else if(!ut[_0xa740('0x99')](_0x62d5ba[_0xa740('0x32')])){_0x62d5ba[_0xa740('0x4c')]='NOT_ACTIVE';}else if(!this[_0xa740('0x9a')](_0x62d5ba['Trunk'])){if(!this[_0xa740('0x9a')](_0x62d5ba[_0xa740('0x9b')])){_0x62d5ba[_0xa740('0x4c')]=_0xa740('0x9c');}else{_0x62d5ba['message']='ACTIVE';}}else{_0x62d5ba[_0xa740('0x4c')]='ACTIVE';}emitCampaignPreview(_0x62d5ba);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x9338ec,_0x5d5886,_0x5b7e25){var _0x5d539a=this;var _0x8d61f5=this['actions'][_0x5d5886];var _0x268465=this['campaignsPreview'][_0x8d61f5[_0xa740('0x6f')]];var _0x56cc67;if(_0x268465){switch(_0x5b7e25){case'1':_0x268465[_0xa740('0x3d')]+=0x1;_0x8d61f5[_0xa740('0x9d')]+=0x1;_0x8d61f5[_0xa740('0x9e')]=ut['totalGlobal'](_0x8d61f5);ut[_0xa740('0x8f')](_0x8d61f5,0x0,_0xa740('0x9f'));ami[_0xa740('0x27')](_0xa740('0xa0'),ut['buildObj'](_0x8d61f5,_0xa740('0xa1')));rpcDb[_0xa740('0x92')](_0x8d61f5,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xa740('0xa2')](_0x8d61f5)>=_0x268465[_0xa740('0xa3')]){_0x56cc67=ut[_0xa740('0xa4')](_0x8d61f5,0xf,_0xa740('0xa5'));rpcDb[_0xa740('0x95')](_0x56cc67,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x8d61f5[_0xa740('0x9d')]>=_0x268465[_0xa740('0xa6')]){rpcDb[_0xa740('0x95')](_0x8d61f5,_0xa740('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0xa740('0xa8')](_0x8d61f5,_0xa740('0x9d'),_0x268465[_0xa740('0xa9')]),_0x8d61f5['unlockAgent'],_0x8d61f5[_0xa740('0xaa')]);}}delete this[_0xa740('0x17')][_0x9338ec['linkedid']];break;case _0xa740('0xab'):var _0x3f1679=moment()[_0xa740('0x5c')](_0xa740('0x8e'));_0x8d61f5[_0xa740('0xac')]=_0x3f1679;_0x8d61f5[_0xa740('0xad')]=_0x3f1679;_0x8d61f5[_0xa740('0x72')]=!![];_0x268465[_0xa740('0x5f')]+=0x1;logger[_0xa740('0x81')](_0xa740('0xae'),_0x8d61f5[_0xa740('0xaf')],_0xa740('0xb0'),_0x268465[_0xa740('0x2a')],_0xa740('0x71'),_0x268465[_0xa740('0x5f')]);ami[_0xa740('0x27')](_0xa740('0xb1'),ut['buildObj'](_0x8d61f5,_0xa740('0xb2'),this['campaignsPreview'][_0x8d61f5[_0xa740('0x6f')]]));if(_0x268465[_0xa740('0xb3')]){ami[_0xa740('0x27')](_0xa740('0xb4'),ut[_0xa740('0xb5')](_0x8d61f5));}break;case'16':ami[_0xa740('0x27')]('custom:agentcomplete',ut[_0xa740('0xb6')](_0x8d61f5,_0xa740('0xb7'),this[_0xa740('0x15')][_0x8d61f5['queue']]));emitVoiceQueueChannelRemove(ut[_0xa740('0xb6')](_0x8d61f5,_0xa740('0xb7')));_0x268465[_0xa740('0xb8')]+=0x1;_0x268465[_0xa740('0x2e')]+=0x1;_0x268465[_0xa740('0xb9')]+=0x1;ut[_0xa740('0x7d')](_0x268465,'[16]');_0x8d61f5[_0xa740('0x9e')]=ut[_0xa740('0xa2')](_0x8d61f5);ut['logCustomer'](_0x8d61f5,0x4,_0xa740('0xba'));rpcDb[_0xa740('0x92')](_0x8d61f5,_0xa740('0xbb'));rpcDb[_0xa740('0x95')](_0x8d61f5,_0xa740('0xbc'));rpcDb['crateCustomerReportQueue'](_0x8d61f5);_0x268465[_0xa740('0xbd')]+=_0x8d61f5[_0xa740('0xbe')];_0x268465[_0xa740('0xbf')]+=_0x8d61f5[_0xa740('0xbe')];logger['info'](_0xa740('0xc0'),_0x8d61f5['uniqueid'],_0xa740('0xb0'),_0x268465['name'],_0xa740('0x71'),_0x268465[_0xa740('0x5f')]);delete this[_0xa740('0x17')][_0x9338ec[_0xa740('0xc1')]];break;case _0xa740('0xc2'):_0x268465[_0xa740('0x38')]+=0x1;_0x8d61f5[_0xa740('0xc3')]+=0x1;_0x8d61f5['countglobal']=ut['totalGlobal'](_0x8d61f5);ut['logCustomer'](_0x8d61f5,0x5,_0xa740('0xc4'));ami['emit'](_0xa740('0xc5'),ut[_0xa740('0xb6')](_0x8d61f5,_0xa740('0xc6')));rpcDb[_0xa740('0x92')](_0x8d61f5,_0xa740('0xc7'));if(ut[_0xa740('0xa2')](_0x8d61f5)>=_0x268465['dialGlobalMaxRetry']){_0x56cc67=ut['cloneAction'](_0x8d61f5,0xf,_0xa740('0xa5'));rpcDb['createCustomerFinal'](_0x56cc67,_0xa740('0xc8'));}else{if(_0x8d61f5['countbusyretry']>=_0x268465[_0xa740('0xc9')]){rpcDb['createCustomerFinal'](_0x8d61f5,_0xa740('0xc7'));}else{rpcDb[_0xa740('0xca')](ut[_0xa740('0xa8')](_0x8d61f5,_0xa740('0xc3'),_0x268465[_0xa740('0xcb')]),_0x8d61f5[_0xa740('0xcc')],_0x8d61f5['activeContact']);}}break;case _0xa740('0xcd'):_0x268465['outboundNoAnswerCallsDay']+=0x1;_0x8d61f5['countnoanswerretry']+=0x1;_0x8d61f5['countglobal']=ut['totalGlobal'](_0x8d61f5);ut['logCustomer'](_0x8d61f5,0x3,_0xa740('0xce'));ami[_0xa740('0x27')](_0xa740('0xcf'),ut[_0xa740('0xb6')](_0x8d61f5,'noanswer'));rpcDb[_0xa740('0x92')](_0x8d61f5,_0xa740('0xd0'));if(ut[_0xa740('0xa2')](_0x8d61f5)>=_0x268465[_0xa740('0xa3')]){_0x56cc67=ut[_0xa740('0xa4')](_0x8d61f5,0xf,_0xa740('0xa5'));rpcDb[_0xa740('0x95')](_0x56cc67,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x8d61f5[_0xa740('0xd1')]>=_0x268465[_0xa740('0xd2')]){rpcDb[_0xa740('0x95')](_0x8d61f5,_0xa740('0xd0'));}else{rpcDb['rescheduleContact'](ut[_0xa740('0xa8')](_0x8d61f5,'countnoanswerretry',_0x268465[_0xa740('0xd3')]),_0x8d61f5[_0xa740('0xcc')],_0x8d61f5[_0xa740('0xaa')]);}}break;case _0xa740('0xd4'):_0x268465[_0xa740('0x39')]+=0x1;_0x8d61f5[_0xa740('0xd5')]+=0x1;_0x8d61f5[_0xa740('0x9e')]=ut[_0xa740('0xa2')](_0x8d61f5);ut[_0xa740('0x8f')](_0x8d61f5,0x8,_0xa740('0xd6'));ami[_0xa740('0x27')](_0xa740('0xd7'),ut[_0xa740('0xb6')](_0x8d61f5,'congestion'));rpcDb[_0xa740('0x92')](_0x8d61f5,_0xa740('0xd8'));if(ut['totalGlobal'](_0x8d61f5)>=_0x268465[_0xa740('0xa3')]){_0x56cc67=ut['cloneAction'](_0x8d61f5,0xf,_0xa740('0xa5'));rpcDb[_0xa740('0x95')](_0x56cc67,_0xa740('0xd9'));}else{if(_0x8d61f5[_0xa740('0xd5')]>=_0x268465['dialCongestionMaxRetry']){rpcDb[_0xa740('0x95')](_0x8d61f5,_0xa740('0xd8'));}else{rpcDb[_0xa740('0xca')](ut['scheduledAt'](_0x8d61f5,'countcongestionretry',_0x268465['dialBusyRetryFrequency']),_0x8d61f5[_0xa740('0xcc')],_0x8d61f5[_0xa740('0xaa')]);}}break;case _0xa740('0xda'):_0x268465[_0xa740('0x40')]+=0x1;_0x8d61f5['countagentrejectretry']+=0x1;_0x8d61f5['countglobal']=ut[_0xa740('0xa2')](_0x8d61f5);ut[_0xa740('0x8f')](_0x8d61f5,0x14,_0xa740('0xdb'));ami[_0xa740('0x27')](_0xa740('0xdc'),ut[_0xa740('0xb6')](_0x8d61f5,_0xa740('0xdd')));rpcDb[_0xa740('0x92')](_0x8d61f5,_0xa740('0xde'));if(ut[_0xa740('0xa2')](_0x8d61f5)>=_0x268465[_0xa740('0xa3')]){_0x56cc67=ut[_0xa740('0xa4')](_0x8d61f5,0x14,_0xa740('0xdb'));rpcDb[_0xa740('0x95')](_0x56cc67,_0xa740('0xdf'));}else{if(_0x8d61f5[_0xa740('0xe0')]>=_0x268465[_0xa740('0xe1')]){rpcDb[_0xa740('0x95')](_0x8d61f5,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xa740('0xca')](ut[_0xa740('0xa8')](_0x8d61f5,'countagentrejectretry',_0x268465[_0xa740('0xe2')]),_0x8d61f5[_0xa740('0xcc')],_0x8d61f5[_0xa740('0xaa')]);}}break;case _0xa740('0xe3'):_0x268465['outboundAbandonedCallsDay']+=0x1;_0x8d61f5[_0xa740('0xe4')]+=0x1;_0x8d61f5[_0xa740('0x9e')]=ut[_0xa740('0xa2')](_0x8d61f5);ut[_0xa740('0x8f')](_0x8d61f5,0xb,_0xa740('0xe5'));rpcDb['createCustomerHistory'](_0x8d61f5,_0xa740('0xe6'));if(ut[_0xa740('0xa2')](_0x8d61f5)>=_0x268465[_0xa740('0xa3')]){_0x56cc67=ut['cloneAction'](_0x8d61f5,0xf,_0xa740('0xa5'));rpcDb[_0xa740('0x95')](_0x56cc67,_0xa740('0xe6'));}else{if(_0x8d61f5['countabandonedetry']>=_0x268465[_0xa740('0xe7')]){rpcDb[_0xa740('0x95')](_0x8d61f5,_0xa740('0xe6'));}else{rpcDb[_0xa740('0xca')](ut['scheduledAt'](_0x8d61f5,_0xa740('0xe4'),_0x268465[_0xa740('0xe8')]),_0x8d61f5[_0xa740('0xcc')],_0x8d61f5[_0xa740('0xaa')]);}}break;case'18':_0x268465[_0xa740('0xe9')]+=0x1;_0x8d61f5[_0xa740('0xea')]+=0x1;_0x8d61f5['countglobal']=ut[_0xa740('0xa2')](_0x8d61f5);ut[_0xa740('0x8f')](_0x8d61f5,0x12,_0x9338ec[_0xa740('0xeb')]||_0x9338ec[_0xa740('0xec')]);ami[_0xa740('0x27')](_0xa740('0xed'),ut[_0xa740('0xb6')](_0x8d61f5,'amd'));rpcDb[_0xa740('0x92')](_0x8d61f5,_0xa740('0xee'));if(ut['totalGlobal'](_0x8d61f5)>=_0x268465[_0xa740('0xa3')]){_0x56cc67=ut[_0xa740('0xa4')](_0x8d61f5,0xf,_0xa740('0xa5'));rpcDb[_0xa740('0x95')](_0x56cc67,_0xa740('0xee'));}else{rpcDb['createCustomerFinal'](_0x8d61f5,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xa740('0x17')][_0x9338ec['linkedid']];break;case'19':_0x268465[_0xa740('0xe9')]+=0x1;_0x8d61f5['countglobal']=ut[_0xa740('0xa2')](_0x8d61f5);ut[_0xa740('0x8f')](_0x8d61f5,0x13,_0x9338ec[_0xa740('0xeb')]||_0x9338ec[_0xa740('0xec')]);ami[_0xa740('0x27')](_0xa740('0xed'),ut[_0xa740('0xb6')](_0x8d61f5,_0xa740('0xef')));rpcDb[_0xa740('0x92')](_0x8d61f5,_0xa740('0xf0'));if(ut[_0xa740('0xa2')](_0x8d61f5)>=_0x268465['dialGlobalMaxRetry']){_0x56cc67=ut[_0xa740('0xa4')](_0x8d61f5,0xf,_0xa740('0xa5'));rpcDb[_0xa740('0x95')](_0x56cc67,_0xa740('0xf0'));}else{rpcDb[_0xa740('0x95')](_0x8d61f5,_0xa740('0xf0'));}delete this[_0xa740('0x17')][_0x9338ec['linkedid']];break;default:if(_0x8d61f5[_0xa740('0x72')]){ut[_0xa740('0x7d')](_0x268465,_0xa740('0xf1'));ut[_0xa740('0x7e')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x268465[_0xa740('0x2a')],_0x9338ec);}_0x268465[_0xa740('0xe9')]+=0x1;_0x8d61f5[_0xa740('0x9e')]=ut['totalGlobal'](_0x8d61f5);ut[_0xa740('0x8f')](_0x8d61f5,0xc,_0x9338ec[_0xa740('0xeb')]||_0x9338ec['dialstatus']);rpcDb[_0xa740('0x92')](_0x8d61f5,_0xa740('0xf2'));if(ut[_0xa740('0xa2')](_0x8d61f5)>=_0x268465[_0xa740('0xa3')]){_0x56cc67=ut[_0xa740('0xa4')](_0x8d61f5,0xf,'Global');rpcDb['createCustomerFinal'](_0x56cc67,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xa740('0x95')](_0x8d61f5,_0xa740('0xf3'));}delete this[_0xa740('0x17')][_0x9338ec[_0xa740('0xc1')]];}if(!(_0x8d61f5[_0xa740('0x72')]&&_0x5b7e25==='16')){ut[_0xa740('0x7b')](_0x268465,'[callProgressDetectingCustomer]');logger[_0xa740('0x81')](_0xa740('0xf4'),_0x8d61f5[_0xa740('0xaf')],_0xa740('0xb0'),_0x268465[_0xa740('0x2a')],_0xa740('0x70'),_0x268465[_0xa740('0x4d')]);}if(_0x5b7e25!==_0xa740('0xab')){delete this['actions'][_0x9338ec['linkedid']];delete this[_0xa740('0x17')][_0x9338ec['destlinkedid']];}}};Preview[_0xa740('0x66')][_0xa740('0xf5')]=function(_0x1f0fa0,_0x272d68,_0x4dd556){if(_[_0xa740('0xf6')](_0x272d68)&&'object'!==typeof _0x272d68){return;}if(_[_0xa740('0xf6')](_0x4dd556)&&_0xa740('0xf7')!==typeof _0x4dd556){return;}switch(_0x4dd556['reason']){case'0':ut[_0xa740('0xf8')](_0x1f0fa0,0x0,_0xa740('0x9f'));rpcDb['createAgentHistory'](_0x1f0fa0,_0xa740('0xf9'));break;case'3':ut[_0xa740('0xf8')](_0x1f0fa0,0x3,_0xa740('0xce'));rpcDb[_0xa740('0xfa')](_0x1f0fa0,_0xa740('0xfb'));break;case'5':ut['logAgent'](_0x1f0fa0,0x5,_0xa740('0xc4'));rpcDb['createAgentHistory'](_0x1f0fa0,_0xa740('0xfc'));break;case'8':ut[_0xa740('0xf8')](_0x1f0fa0,0x8,_0xa740('0xd6'));rpcDb[_0xa740('0xfa')](_0x1f0fa0,_0xa740('0xfd'));break;case'22':ut['logAgent'](_0x1f0fa0,0x16,'AnswerAGI');rpcDb[_0xa740('0xfa')](_0x1f0fa0,_0xa740('0xfe'));break;default:ut[_0xa740('0xf8')](_0x1f0fa0,0xc,_0x4dd556[_0xa740('0xff')]);rpcDb['createAgentHistory'](_0x1f0fa0,_0xa740('0xfd'));}ut[_0xa740('0x7b')](_0x272d68,'[callProgressDetectingAgent]');logger['info'](_0xa740('0x100'),_0x1f0fa0[_0xa740('0xaf')],_0xa740('0xb0'),_0x272d68[_0xa740('0x2a')],_0xa740('0x70'),_0x272d68[_0xa740('0x4d')]);delete this[_0xa740('0x17')][_0x1f0fa0[_0xa740('0xaf')]];};Preview[_0xa740('0x66')]['checkInBlack']=function(_0x34edaa,_0x3e258c,_0xb1e090,_0x19352b,_0x22248d){var _0x560828=this;return new BPromise(function(_0x47d43c,_0x6faefb){if(_[_0xa740('0x6d')](_0x3e258c)||_['isNil'](_0x3e258c['Contact'])||_[_0xa740('0x6d')](_0x3e258c[_0xa740('0x101')][_0xa740('0x102')])||_[_0xa740('0x6d')](_0x3e258c[_0xa740('0x103')])){_0x6faefb(ut[_0xa740('0x4c')](_0xa740('0x104'),_0x19352b,_0x22248d));return;}var _0x24986b=uuid['v4']();var _0x288f4e=_0x560828[_0xa740('0x15')][_0x3e258c['Queue']['name']];var _0x146de0=_0xb1e090?_0x560828[_0xa740('0x18')][_0xb1e090]['id']:undefined;_0x560828[_0xa740('0x17')][_0x24986b]=new Action(_0x3e258c,_0x288f4e,_0x24986b,_0xb1e090,_0x146de0);var _0x20c5d9=_0x560828[_0xa740('0x17')][_0x24986b];_0x20c5d9[_0xa740('0xcc')]=_0x19352b;_0x20c5d9[_0xa740('0xaa')]=_0x22248d;_0x20c5d9[_0xa740('0x105')]=_0xb1e090;if(_[_0xa740('0x106')](_0x34edaa)){_0x560828['execCall'](_0x20c5d9,_0x288f4e,_0x3e258c,_0xb1e090)[_0xa740('0x85')](function(_0x53fea5){logger['info'](_0xa740('0x107'),_0xa740('0x108')+_0x20c5d9[_0xa740('0x6f')]+_0xa740('0x109')+_0x20c5d9[_0xa740('0x10a')],JSON[_0xa740('0x58')](_0x53fea5));ami[_0xa740('0x27')]('custom:agentcalled',ut[_0xa740('0xb6')](_0x20c5d9,_0xa740('0x10b'),_0x560828[_0xa740('0x15')][_0x20c5d9[_0xa740('0x6f')]]));_0x47d43c(ut[_0xa740('0x4c')](_0xa740('0x10c')));})[_0xa740('0x79')](function(_0x354244){ut['logger'](_0xa740('0x10d'),_0x354244);_0x6faefb(ut['message'](_0xa740('0x10e'),_0x19352b,_0x22248d));});}else{_0x288f4e[_0xa740('0x37')]+=0x1;ut[_0xa740('0x10f')](_0x20c5d9);rpcDb['createHistory'](_0x20c5d9,'[Blacklist][error]');delete _0x560828['actions'][_0x24986b];_0x6faefb(ut[_0xa740('0x4c')](_0xa740('0x110'),_0x19352b,_0x22248d));}});};Preview[_0xa740('0x66')][_0xa740('0x9a')]=function(_0x2bcf34){return!_[_0xa740('0x6d')](_0x2bcf34)&&!_[_0xa740('0x6d')](_0x2bcf34['name'])&&!_['isNil'](_0x2bcf34[_0xa740('0x55')])&&_0x2bcf34[_0xa740('0x55')]&&!_[_0xa740('0x6d')](this[_0xa740('0x16')][util['format'](_0xa740('0x111'),_0x2bcf34[_0xa740('0x2a')])])&&!_[_0xa740('0x6d')](this[_0xa740('0x16')][util[_0xa740('0x5c')](_0xa740('0x111'),_0x2bcf34[_0xa740('0x2a')])]['status'])&&(this[_0xa740('0x16')][util[_0xa740('0x5c')]('SIP/%s',_0x2bcf34[_0xa740('0x2a')])][_0xa740('0x77')]===_0xa740('0x112')||this[_0xa740('0x16')][util[_0xa740('0x5c')](_0xa740('0x111'),_0x2bcf34[_0xa740('0x2a')])][_0xa740('0x77')]===_0xa740('0x113'));};Preview[_0xa740('0x66')][_0xa740('0x8b')]=function(_0x5f507f,_0x3528e7){var _0x534de2=this;return new BPromise(function(_0x424bb0,_0x215d5c){_0x534de2[_0xa740('0x114')](_0x5f507f,_0x3528e7)[_0xa740('0x85')](function(_0x509404){_0x424bb0(_[_0xa740('0x73')](_0x509404,[_0xa740('0x4c')]));})[_0xa740('0x79')](function(_0x1c38c6){if(_0x1c38c6['unlock']){rpcDb[_0xa740('0x115')](_0x5f507f);}if(_0x1c38c6[_0xa740('0x55')]){rpcDb['disableContact'](_0x5f507f);}_0x215d5c(_[_0xa740('0x73')](_0x1c38c6,[_0xa740('0x4c')]));});});};Preview[_0xa740('0x66')][_0xa740('0x114')]=function(_0x37a13c,_0x476b19){var _0x9f598=this;return new BPromise(function(_0x3b0549,_0x4efd2a){var _0x320c7f,_0xf6c22c;rpcDb[_0xa740('0x116')](_0x37a13c)[_0xa740('0x85')](function(_0x39d959){if(!_[_0xa740('0x6d')](_0x39d959[0x0])){_0xf6c22c=_0x39d959[0x0][_0xa740('0x117')]?![]:!![];_0x320c7f=_0x39d959[0x0][_0xa740('0x117')]?!![]:![];_0x320c7f=_0x476b19?!![]:_0x320c7f;}var _0x5232ad=_0x9f598[_0xa740('0x118')](_0x39d959);if(_0x5232ad[_0xa740('0x119')]){rpcDb['checkIsBlackList'](_[_0xa740('0x73')](_0x39d959[0x0],[_0xa740('0x103'),_0xa740('0x11a')]))[_0xa740('0x85')](function(_0x2116e1){_0x9f598['checkInBlack'](_0x2116e1,_0x39d959[0x0],_0x476b19,_0xf6c22c,_0x320c7f)['then'](function(_0x321656){_0x3b0549(_0x321656);})['catch'](function(_0x546844){_0x4efd2a(_0x546844);});})['catch'](function(_0x179bb3){ut[_0xa740('0x63')](_0xa740('0x11b'),_0x179bb3);_0x4efd2a(ut[_0xa740('0x4c')]('Call\x20unsuccessful',_0xf6c22c,_0x320c7f));});}else{_0x4efd2a(ut[_0xa740('0x4c')](_0x5232ad[_0xa740('0x4c')],_0xf6c22c,_0x320c7f));}})['catch'](function(_0x4e2bd4){ut['logger']('[Preview][getContactPreview]',_0x4e2bd4);_0x4efd2a(ut[_0xa740('0x4c')](_0xa740('0x11c'),![],!![]));});});};Preview[_0xa740('0x66')][_0xa740('0x118')]=function(_0x14f654){if(_[_0xa740('0x6d')](_0x14f654)||_[_0xa740('0x106')](_0x14f654)||!_[_0xa740('0x6d')](_0x14f654[0x0][_0xa740('0x8a')])&&_[_0xa740('0x6d')](_0x14f654[0x0][_0xa740('0x8a')][_0xa740('0x2a')])){ut[_0xa740('0x63')](_0xa740('0x11d'),_0x14f654);return{'isValid':![],'message':_0xa740('0x11e')};}var _0x47bad5=this[_0xa740('0x15')][_0x14f654[0x0][_0xa740('0x6e')][_0xa740('0x2a')]];_0x47bad5[_0xa740('0x4c')]=_0xa740('0x11f');if(_[_0xa740('0x6d')](_0x47bad5)){ut[_0xa740('0x63')]('[Preview][validateContact][Empty\x20Campaign]',_0x47bad5);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x47bad5[_0xa740('0x54')])){ut[_0xa740('0x63')](_0xa740('0x120'),'campaign\x20Name:\x20'+_0x47bad5[_0xa740('0x2a')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xa740('0x9a')](_0x47bad5[_0xa740('0x9b')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x47bad5[_0xa740('0x2a')]+_0xa740('0x121'));return{'isValid':![],'message':_0xa740('0x122')};}}if(!ut[_0xa740('0x99')](_0x47bad5[_0xa740('0x32')])){ut[_0xa740('0x63')](_0xa740('0x123'),_0x47bad5['name']+_0xa740('0x124'));return{'isValid':![],'message':_0xa740('0x125')+_0x47bad5[_0xa740('0x2a')]+_0xa740('0x124')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xa740('0x66')][_0xa740('0x126')]=function(_0x40f034,_0xf7fe84,_0x15a323,_0x1e647){var _0x3fc4d3=this;return new BPromise(function(_0x368764,_0x89ec16){var _0x163bf0=_0x40f034[_0xa740('0xaf')];var _0x257b5e=_0x3fc4d3[_0xa740('0x9a')](_0xf7fe84[_0xa740('0x54')])?util[_0xa740('0x5c')](_0xa740('0x127'),_0xf7fe84['Trunk'][_0xa740('0x2a')],_[_0xa740('0x6d')](_0xf7fe84['dialPrefix'])?'':_0xf7fe84[_0xa740('0x128')][_0xa740('0x129')]()||'',_0xf7fe84[_0xa740('0x12a')]>0x0?_0x15a323[_0xa740('0x101')][_0xa740('0x102')][_0xa740('0x12b')](_0xf7fe84[_0xa740('0x12a')]):_0x15a323[_0xa740('0x101')]['phone']):util[_0xa740('0x5c')](_0xa740('0x127'),_[_0xa740('0x6d')](_0xf7fe84[_0xa740('0x9b')])?_0xf7fe84[_0xa740('0x54')]['name']:_0xf7fe84[_0xa740('0x9b')][_0xa740('0x2a')],_[_0xa740('0x6d')](_0xf7fe84[_0xa740('0x128')])?'':_0xf7fe84[_0xa740('0x128')][_0xa740('0x129')]()||'',_0xf7fe84['dialCutDigit']>0x0?_0x15a323['Contact'][_0xa740('0x102')][_0xa740('0x12b')](_0xf7fe84['dialCutDigit']):_0x15a323['Contact'][_0xa740('0x102')]);var _0x3f3f04=_0x3fc4d3[_0xa740('0x9a')](_0xf7fe84[_0xa740('0x54')])?ut[_0xa740('0x12c')](_0xf7fe84[_0xa740('0x54')][_0xa740('0x56')],_0xf7fe84[_0xa740('0x34')],_0xf7fe84[_0xa740('0x12d')]>0x0?ut[_0xa740('0x12e')](_0xf7fe84[_0xa740('0x35')],_0xf7fe84[_0xa740('0x12d')]):_0xf7fe84[_0xa740('0x35')]):ut['getCallerId'](_['isNil'](_0xf7fe84['TrunkBackup'])?_0xf7fe84[_0xa740('0x54')]['callerid']:_0xf7fe84[_0xa740('0x9b')]['callerid'],_0xf7fe84[_0xa740('0x34')],_0xf7fe84[_0xa740('0x12d')]>0x0?ut[_0xa740('0x12e')](_0xf7fe84[_0xa740('0x35')],_0xf7fe84[_0xa740('0x12d')]):_0xf7fe84['dialOriginateCallerIdNumber']);if(_0x3f3f04){_0x40f034[_0xa740('0x12f')]=ut['extractCalleridName'](_0x3f3f04);_0x40f034[_0xa740('0x130')]=ut[_0xa740('0x131')](_0x3f3f04);}var _0x589dcf=ut['addVariables'](_0xf7fe84,_0x15a323,_0x257b5e,_0x3f3f04,_0x163bf0,_0x40f034);_[_0xa740('0x132')](_0x40f034,ut[_0xa740('0x133')](_0x589dcf));_0x40f034[_0xa740('0x134')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0xa740('0x76')](ut[_0xa740('0x135')](_0x40f034,_0xf7fe84,_0x589dcf,_0x40f034[_0xa740('0xaa')],_0x1e647))[_0xa740('0x85')](function(_0x35600b){var _0x20b4ea=_0x40f034[_0xa740('0x136')];if(!_[_0xa740('0x6d')](_0x20b4ea)){if(!_['isNil'](_0x3fc4d3[_0xa740('0x18')][_0x20b4ea])){_0x3fc4d3[_0xa740('0x18')][_0x20b4ea][_0xa740('0x137')]=_0x40f034[_0xa740('0x138')];emit(util[_0xa740('0x5c')](_0xa740('0x139'),_0x3fc4d3['agents'][_0x20b4ea][_0xa740('0x2a')]),_0xa740('0x13a'),{'destaccountcode':_0x3fc4d3[_0xa740('0x18')][_0x20b4ea]['accountcode'],'destconnectedlinenum':_0x40f034[_0xa740('0x138')]});}}_0xf7fe84[_0xa740('0x4d')]+=0x1;logger[_0xa740('0x81')](_0xa740('0x13b'),_0x163bf0,'\x20Queue',_0xf7fe84[_0xa740('0x2a')],_0xa740('0x70'),_0xf7fe84['originated']);_0x368764(_0x35600b);})[_0xa740('0x79')](function(_0x20dce5){ut[_0xa740('0xf8')](_0x40f034,0xe,_0xa740('0x13c'));rpcDb['createAgentHistory'](_0x40f034,_0xa740('0x13d'));_0x89ec16(_0x20dce5);});});};Preview['prototype'][_0xa740('0x13e')]=function(_0x4fb8a4){if(this['actions'][_0x4fb8a4[_0xa740('0xc1')]]){this[_0xa740('0x17')][_0x4fb8a4[_0xa740('0xc1')]][_0xa740('0x78')]=_0x4fb8a4['channel'];}};Preview[_0xa740('0x66')][_0xa740('0x1b')]=function(_0x34548e){var _0x308263=this;var _0x4f6799=this['actions'][_0x34548e[_0xa740('0x13f')]];if(_0x4f6799){if(_0x4f6799[_0xa740('0x105')]&&this[_0xa740('0x18')][_0x4f6799['lookAgent']]){ut['logLookAgent'](_0x4f6799,this['agents'][_0x4f6799['lookAgent']][_0xa740('0x2a')],this[_0xa740('0x18')][_0x4f6799[_0xa740('0x105')]]['id']);}var _0x4dd3c6=_['clone'](_0x4f6799);_0x4dd3c6['responsetime']=moment()[_0xa740('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4caef6=_0x308263[_0xa740('0x15')][_0x4f6799[_0xa740('0x6f')]];if(ut[_0xa740('0x140')](_0x34548e['response'])){if(_0x4f6799[_0xa740('0xcc')]){rpcDb[_0xa740('0x115')](_0x4f6799[_0xa740('0x10a')]);}if(_0x4f6799['activeContact']){rpcDb[_0xa740('0x141')](_0x4f6799['idContact']);}ami[_0xa740('0x27')](_0xa740('0x142'),ut[_0xa740('0xb6')](_0x4f6799,'rejected',this[_0xa740('0x15')][_0x4f6799[_0xa740('0x6f')]]));this[_0xa740('0xf5')](_0x4dd3c6,_0x4caef6,_0x34548e);}else{_0x4f6799[_0xa740('0x134')]=moment()[_0xa740('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xa740('0xf8')](_0x4dd3c6,0x4,'Answer');rpcDb[_0xa740('0xfa')](_0x4dd3c6,_0xa740('0x143'));}}};Preview[_0xa740('0x66')][_0xa740('0x1c')]=function(_0xd1b004){var _0x461fd1=this;var _0x5a83f8=this[_0xa740('0x17')][_0xd1b004[_0xa740('0xc1')]];var _0x17ee26;if(_0x5a83f8){_0x17ee26=this[_0xa740('0x15')][_0x5a83f8[_0xa740('0x6f')]];logger['info'](_0xa740('0x144'),_0xd1b004[_0xa740('0xc1')],_0xa740('0xb0'),_0x17ee26['name'],'pTalking:\x20',_0x17ee26['pTalking']);}if(this['actions'][_0xd1b004[_0xa740('0xc1')]]&&_0xd1b004['linkedid']!==_0xd1b004[_0xa740('0xaf')]){if(_0xd1b004['cause']==='16'&&this[_0xa740('0x17')][_0xd1b004[_0xa740('0xc1')]]['dialAnswer']){this[_0xa740('0x145')](_0xd1b004,_0xd1b004[_0xa740('0xc1')],_0xd1b004[_0xa740('0x146')]);}else if(this['actions'][_0xd1b004['linkedid']]['dialAnswer']){logger['info'](_0xa740('0x147'),_0xd1b004[_0xa740('0xc1')],_0xd1b004[_0xa740('0x146')],_0xa740('0xb0'),_0x17ee26[_0xa740('0x2a')],'pTalking:\x20',_0x17ee26['pTalking']);this[_0xa740('0x145')](_0xd1b004,_0xd1b004[_0xa740('0xc1')],_0xd1b004['cause']);}}else if(_0x5a83f8&&_[_0xa740('0x6d')](_0x5a83f8[_0xa740('0x148')])&&_0x17ee26[_0xa740('0x149')]&&_0xd1b004[_0xa740('0xc1')]===_0xd1b004[_0xa740('0xaf')]&&_['isNil'](_0xd1b004['reason'])&&_0xd1b004['cause']==='16'&&_0xd1b004['channelstate']==='6'&&_['isUndefined'](_0x5a83f8[_0xa740('0x14a')])){if(_0x5a83f8['unlockAgent']){rpcDb[_0xa740('0x115')](_0x5a83f8[_0xa740('0x10a')]);}if(_0x5a83f8[_0xa740('0xaa')]){rpcDb[_0xa740('0x141')](_0x5a83f8[_0xa740('0x10a')]);}_0xd1b004[_0xa740('0xff')]='22';this[_0xa740('0xf5')](_0x5a83f8,_0x17ee26,_0xd1b004);}else if(_0x5a83f8&&_0x5a83f8[_0xa740('0x14a')]){if(_0xd1b004[_0xa740('0x146')]==='16'&&this[_0xa740('0x17')][_0xd1b004[_0xa740('0xc1')]][_0xa740('0x72')]){logger[_0xa740('0x81')](_0xa740('0x14b'),_0xd1b004[_0xa740('0xc1')],_0xd1b004['cause'],_0xa740('0xb0'),_0x17ee26[_0xa740('0x2a')],_0xa740('0x71'),_0x17ee26[_0xa740('0x5f')]);this[_0xa740('0x145')](_0xd1b004,_0xd1b004[_0xa740('0xc1')],_0xd1b004[_0xa740('0x146')]);}else if(this['actions'][_0xd1b004[_0xa740('0xc1')]][_0xa740('0x72')]){logger[_0xa740('0x81')]('[syncHangup][talking][cause]',_0xd1b004[_0xa740('0xc1')],_0xd1b004[_0xa740('0x146')],_0xa740('0xb0'),_0x17ee26[_0xa740('0x2a')],_0xa740('0x71'),_0x17ee26[_0xa740('0x5f')]);this['callProgressDetectingCustomer'](_0xd1b004,_0xd1b004[_0xa740('0xc1')],_0xd1b004[_0xa740('0x146')]);}}};Preview[_0xa740('0x66')][_0xa740('0x14c')]=function(_0x1f2514){if(this[_0xa740('0x17')][_0x1f2514[_0xa740('0x14d')]]&&_0x1f2514['destlinkedid']!==_0x1f2514['destuniqueid']){this[_0xa740('0x145')](_0x1f2514,_0x1f2514['destlinkedid'],_0x1f2514[_0xa740('0xec')]);}};Preview[_0xa740('0x66')]['syncHangupRequest']=function(_0x3623e8){if(this[_0xa740('0x17')][_0x3623e8[_0xa740('0xc1')]]&&_0x3623e8['linkedid']!==_0x3623e8['uniqueid']&&!this[_0xa740('0x17')][_0x3623e8[_0xa740('0xc1')]][_0xa740('0x72')]){if(_0x3623e8[_0xa740('0x146')]==='1'){this[_0xa740('0x145')](_0x3623e8,_0x3623e8[_0xa740('0xc1')],_0x3623e8['cause']);}}};Preview['prototype'][_0xa740('0x14e')]=function(_0x39aa6d,_0x2f9e76,_0x513d25){if(this[_0xa740('0x17')][_0x39aa6d]){if(_[_0xa740('0x6d')](this[_0xa740('0x17')][_0x39aa6d]['variables'])){this[_0xa740('0x17')][_0x39aa6d][_0xa740('0x14f')]={};}this[_0xa740('0x17')][_0x39aa6d][_0xa740('0x14f')][_0x2f9e76]=_0x513d25;}};Preview['prototype'][_0xa740('0x150')]=function(_0x2d98f6){try{if(!_[_0xa740('0x6d')](_0x2d98f6)){if(ut[_0xa740('0x151')](_[_0xa740('0x152')](_0x2d98f6['variable'])[0x0])){this[_0xa740('0x14e')](_0x2d98f6[_0xa740('0xaf')],_[_0xa740('0x152')](_0x2d98f6[_0xa740('0x153')])[0x0],_0x2d98f6['value']);}}}catch(_0x2af78e){logger[_0xa740('0x154')](_0xa740('0x155'),util['inspect'](_0x2af78e,{'showHidden':![],'depth':null}));}};Preview[_0xa740('0x66')][_0xa740('0x156')]=function(_0x28b404){if(_0x28b404){if(this[_0xa740('0x17')][_0x28b404[_0xa740('0x157')]]){this[_0xa740('0x17')][_0x28b404[_0xa740('0x157')]]['transfer']=!![];}}};Preview['prototype'][_0xa740('0x25')]=function(_0x47b1a4){if(_0x47b1a4){if(this[_0xa740('0x17')][_0x47b1a4[_0xa740('0x158')]]){this['actions'][_0x47b1a4[_0xa740('0x158')]][_0xa740('0x14a')]=!![];}}};module[_0xa740('0x159')]=Preview;
\ No newline at end of file
+var _0x818e=['[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countagentrejectretry','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','[Blacklist][error]','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialCutDigit','phone','trim','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','user:%s','accountcode','calleridnum','[originated][increment]','actionid','logLookAgent','clone','isFailure','unlockContact','callProgressDetectingAgent','starttime','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncDialEnd','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','preview','../ami','./rpcDb','./action','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangupRequest','dialend','newexten','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','outbound','name','strategy','answered','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','loopCampaigns','syncCampaigns','booked','type','clearZombieChannels','hasOwnProperty','dialActive','setMessage','recallMe','actions','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','pick','contactId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','isNil','length','getDiff','Agent','voicePause','run','then','[RecallMe]','logger2','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','outboundBusyCallsDay','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject'];(function(_0x5df05c,_0x56e167){var _0x4d3f47=function(_0x2c2ee7){while(--_0x2c2ee7){_0x5df05c['push'](_0x5df05c['shift']());}};_0x4d3f47(++_0x56e167);}(_0x818e,0x79));var _0xe818=function(_0x385944,_0xfef129){_0x385944=_0x385944-0x0;var _0x55bd81=_0x818e[_0x385944];return _0x55bd81;};'use strict';var util=require(_0xe818('0x0'));var _=require('lodash');var BPromise=require(_0xe818('0x1'));var uuid=require(_0xe818('0x2'));var moment=require(_0xe818('0x3'));var md5=require(_0xe818('0x4'));var Redis=require(_0xe818('0x5'));var config=require(_0xe818('0x6'));var logger=require('../../../config/logger')(_0xe818('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0xe818('0x8'));var rpcDb=require(_0xe818('0x9'));var Action=require(_0xe818('0xa'));var ut=require('./util/util');config[_0xe818('0xb')]=_['defaults'](config[_0xe818('0xb')],{'host':_0xe818('0xc'),'port':0x18eb});var io=require(_0xe818('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xe818('0xe')][_0xe818('0xf')]=function(_0x39c5cd){this[_0xe818('0x10')]=this[_0xe818('0x10')]?this['tail'][_0xe818('0x11')](_0x39c5cd):_0x39c5cd();};function Preview(_0x1e2f42){this[_0xe818('0x12')]=new Sequence();this[_0xe818('0x13')]=_0x1e2f42[_0xe818('0x14')];this[_0xe818('0x15')]=_0x1e2f42['trunks'];this['actions']={};this[_0xe818('0x16')]=_0x1e2f42[_0xe818('0x16')];this[_0xe818('0x17')]=0x0;ami['on'](_0xe818('0x18'),this[_0xe818('0x19')][_0xe818('0x1a')](this));ami['on']('hangup',this['syncHangup'][_0xe818('0x1a')](this));ami['on']('hanguprequest',this[_0xe818('0x1b')][_0xe818('0x1a')](this));ami['on'](_0xe818('0x1c'),this['syncDialEnd']['bind'](this));ami['on'](_0xe818('0x1d'),this[_0xe818('0x1e')]['bind'](this));ami['on']('varset',this[_0xe818('0x1f')][_0xe818('0x1a')](this));ami['on']('attendedtransfer',this[_0xe818('0x20')][_0xe818('0x1a')](this));ami['on'](_0xe818('0x21'),this[_0xe818('0x22')][_0xe818('0x1a')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0xd5a353,_0x2f3037,_0x60664b){io['to'](_0xd5a353)[_0xe818('0x23')](_0x2f3037,_0x60664b);}function emitCampaignPreview(_0x534c87){if(_0x534c87['type']===_0xe818('0x24')){var _0x534a70={'id':_0x534c87['id'],'name':_0x534c87[_0xe818('0x25')],'strategy':_0x534c87[_0xe818('0x26')],'answered':_0x534c87[_0xe818('0x27')],'available':_0x534c87['available'],'loggedIn':_0x534c87['loggedIn'],'pTalking':_0x534c87['pTalking'],'sumBillable':_0x534c87[_0xe818('0x28')],'sumDuration':_0x534c87[_0xe818('0x29')],'sumHoldTime':_0x534c87[_0xe818('0x2a')]||0x0,'talking':_0x534c87[_0xe818('0x2b')],'total':_0x534c87['total'],'type':_0x534c87['type'],'unmanaged':_0x534c87[_0xe818('0x2c')],'abandoned':_0x534c87['abandoned'],'waiting':_0x534c87[_0xe818('0x2d')],'loggedInDb':_0x534c87[_0xe818('0x2e')],'dialActive':_0x534c87['dialActive'],'dialMethod':_0x534c87[_0xe818('0x2f')],'dialOriginateCallerIdName':_0x534c87[_0xe818('0x30')],'dialOriginateCallerIdNumber':_0x534c87['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x534c87[_0xe818('0x31')],'dialPrefix':_0x534c87[_0xe818('0x32')],'outboundAnswerAgiCallsDay':_0x534c87[_0xe818('0x33')],'outboundAnswerCallsDay':_0x534c87[_0xe818('0x34')],'outboundBlacklistCallsDay':_0x534c87['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x534c87['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x534c87['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x534c87[_0xe818('0x35')],'outboundDropCallsDayCallersExit':_0x534c87[_0xe818('0x36')],'outboundDropCallsDayTimeout':_0x534c87[_0xe818('0x37')],'outboundNoAnswerCallsDay':_0x534c87[_0xe818('0x38')],'outboundNoSuchCallsDay':_0x534c87[_0xe818('0x39')],'outboundOriginateFailureCallsDay':_0x534c87[_0xe818('0x3a')],'outboundReCallsDay':_0x534c87[_0xe818('0x3b')],'outboundRejectCallsDay':_0x534c87['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x534c87[_0xe818('0x3c')],'outboundAbandonedCallsDay':_0x534c87[_0xe818('0x3d')],'predictiveIntervalAnsweredCalls':_0x534c87[_0xe818('0x3e')],'predictiveIntervalAvgHoldtime':_0x534c87['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x534c87[_0xe818('0x3f')],'predictiveIntervalDroppedCallsCallersExit':_0x534c87[_0xe818('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x534c87[_0xe818('0x41')],'predictiveIntervalErlangCalls':_0x534c87[_0xe818('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x534c87['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x534c87[_0xe818('0x43')],'predictiveIntervalMultiplicativeFactor':_0x534c87['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x534c87[_0xe818('0x44')],'predictiveIntervalAvailable':_0x534c87[_0xe818('0x45')],'predictiveIntervalTotalCalls':_0x534c87['predictiveIntervalTotalCalls'],'message':_0x534c87[_0xe818('0x46')],'originated':_0x534c87[_0xe818('0x47')],'erlangCalls':_0x534c87[_0xe818('0x48')],'erlangCallToSecond':_0x534c87[_0xe818('0x49')],'erlangAbandonmentRate':_0x534c87[_0xe818('0x4a')],'erlangBusyFactor':_0x534c87[_0xe818('0x4b')],'startPredictive':_0x534c87['startPredictive'],'startProgressive':_0x534c87[_0xe818('0x4c')]};if(_0x534c87[_0xe818('0x4d')]){_0x534a70[_0xe818('0x4d')]={'id':_0x534c87[_0xe818('0x4d')]['id'],'name':_0x534c87[_0xe818('0x4d')]['name'],'active':_0x534c87[_0xe818('0x4d')][_0xe818('0x4e')],'callerid':_0x534c87[_0xe818('0x4d')][_0xe818('0x4f')]};}if(_0x534c87[_0xe818('0x50')]){_0x534a70['Interval']={'id':_0x534c87[_0xe818('0x50')]['id'],'name':_0x534c87[_0xe818('0x50')]['name']};}var _0x5d4206=md5(JSON['stringify'](_0x534a70));if(_0x534c87[_0xe818('0x4')]!==_0x5d4206){_0x534c87[_0xe818('0x4')]=_0x5d4206;emit(util[_0xe818('0x51')]('voice:queue:%s',_0x534a70[_0xe818('0x25')]),'voice_queue:save',_0x534a70);}}}function emitVoiceQueueChannelRemove(_0x352eba){logger[_0xe818('0x52')](_0xe818('0x53'),JSON[_0xe818('0x54')](_0x352eba));emit(util[_0xe818('0x51')](_0xe818('0x55'),_0x352eba[_0xe818('0x25')]),_0xe818('0x56'),_0x352eba);io[_0xe818('0x23')]('voice_queue_presence:remove',_0x352eba);}function notSendMessagesQueue(_0x344fd3){if(_0x344fd3[_0xe818('0x57')]){if(_0x344fd3[_0xe818('0x47')]===0x0&&_0x344fd3[_0xe818('0x58')]===0x0){_0x344fd3[_0xe818('0x57')]=![];_0x344fd3['available']=0x0;_0x344fd3[_0xe818('0x59')]=0x0;_0x344fd3[_0xe818('0x46')]=_0xe818('0x5a');ut[_0xe818('0x5b')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x344fd3[_0xe818('0x25')]+_0xe818('0x5c'));}else{_0x344fd3[_0xe818('0x46')]=_0xe818('0x5d');ut['logger'](_0xe818('0x5e'),_0x344fd3[_0xe818('0x25')]+_0xe818('0x5f'));}emitCampaignPreview(_0x344fd3);}}Preview[_0xe818('0xe')][_0xe818('0x60')]=function(){var _0x4d7f49=this;setInterval(function(){_0x4d7f49[_0xe818('0x61')]();},0x7cf);};Preview[_0xe818('0xe')][_0xe818('0x61')]=function(){var _0x832d1f=this[_0xe818('0x13')];this[_0xe818('0x17')]+=0x1;for(var _0x5ce950 in _0x832d1f){if(_0x832d1f['hasOwnProperty'](_0x5ce950)&&(_0x832d1f[_0x5ce950][_0xe818('0x2f')]===_0xe818('0x7')||_0x832d1f[_0x5ce950]['dialMethod']===_0xe818('0x62'))&&_0x832d1f[_0x5ce950][_0xe818('0x63')]==='outbound'){if(this[_0xe818('0x17')]>0x7){this[_0xe818('0x17')]=0x0;this[_0xe818('0x64')]();}}if(_0x832d1f[_0xe818('0x65')](_0x5ce950)&&_0x832d1f[_0x5ce950][_0xe818('0x2f')]===_0xe818('0x7')&&_0x832d1f[_0x5ce950][_0xe818('0x63')]==='outbound'){if(_0x832d1f[_0x5ce950][_0xe818('0x66')]){this[_0xe818('0x67')](_0x832d1f[_0x5ce950]);this[_0xe818('0x68')](_0x832d1f[_0x5ce950]);}else{notSendMessagesQueue(_0x832d1f[_0x5ce950]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x518a3a){var _0x20e3ec=this;this['sequence']['enqueue'](function(){if(!_['isNil'](_0x20e3ec[_0xe818('0x69')][_0x518a3a])){loggerAction['info'](_0xe818('0x6a'),_0x518a3a,_0xe818('0x6b'),_0x20e3ec[_0xe818('0x69')][_0x518a3a][_0xe818('0x6c')],'originated:\x20',JSON[_0xe818('0x54')](_0x20e3ec['campaignsPreview'][_0x20e3ec[_0xe818('0x69')][_0x518a3a][_0xe818('0x6c')]][_0xe818('0x47')]),_0xe818('0x6d'),JSON[_0xe818('0x54')](_0x20e3ec[_0xe818('0x13')][_0x20e3ec[_0xe818('0x69')][_0x518a3a][_0xe818('0x6c')]][_0xe818('0x58')]),JSON[_0xe818('0x54')](_0x20e3ec[_0xe818('0x69')][_0x518a3a]['dialAnswer']),JSON[_0xe818('0x54')](_[_0xe818('0x6e')](_0x20e3ec['actions'][_0x518a3a],[_0xe818('0x6f'),'UserId',_0xe818('0x70'),'ListId'])));return ami[_0xe818('0x71')]({'action':_0xe818('0x72'),'channel':_0x20e3ec['actions'][_0x518a3a][_0xe818('0x73')]})[_0xe818('0x74')](function(_0x7f1b03){if(_0x7f1b03['message']===_0xe818('0x75')){setTimeout(function(){if(_0x20e3ec[_0xe818('0x69')][_0x518a3a]){ut[_0xe818('0x76')](_0x20e3ec[_0xe818('0x13')][_0x20e3ec['actions'][_0x518a3a][_0xe818('0x6c')]],_0xe818('0x77'));if(_0x20e3ec['actions'][_0x518a3a][_0xe818('0x78')]===!![]){ut[_0xe818('0x79')](_0x20e3ec[_0xe818('0x13')][_0x20e3ec['actions'][_0x518a3a][_0xe818('0x6c')]],'[clearZombieChannel]');ut[_0xe818('0x7a')](_0xe818('0x7b')+_0x518a3a,_0x20e3ec[_0xe818('0x69')][_0x518a3a]['queue']);}ut[_0xe818('0x7a')](_0xe818('0x7c')+_0x518a3a,_0x20e3ec[_0xe818('0x69')][_0x518a3a]['queue']);delete _0x20e3ec['actions'][_0x518a3a];}},0x2328);}});}});};Preview[_0xe818('0xe')][_0xe818('0x64')]=function(){var _0x46b9ee=this;loggerAction['info'](_0xe818('0x7d'),_[_0xe818('0x7e')](this[_0xe818('0x69')]));for(var _0x47057b in this[_0xe818('0x69')]){if(_0x46b9ee['actions'][_0xe818('0x65')](_0x47057b)){_0x46b9ee['clearZombieChannel'](_0x47057b);}}};Preview[_0xe818('0xe')][_0xe818('0x68')]=function(_0x2a3f46){var _0x16caa9=this;rpcDb[_0xe818('0x7f')](_0x2a3f46['id'],ut[_0xe818('0x80')](this[_0xe818('0x16')]))['then'](function(_0x432754){if(!_[_0xe818('0x81')](_0x432754)){for(var _0x28d1b1=0x0;_0x28d1b1<_0x432754[_0xe818('0x82')];_0x28d1b1+=0x1){if(ut[_0xe818('0x83')](_0x432754[_0x28d1b1]['scheduledat'])<_0x2a3f46['dialRecallMeTimeout']*0x3c){if(_0x432754[_0x28d1b1][_0xe818('0x84')]&&!_0x432754[_0x28d1b1][_0xe818('0x84')][_0xe818('0x85')]){_0x16caa9[_0xe818('0x86')](_0x432754[_0x28d1b1]['id'])[_0xe818('0x87')](ut['logger2'](_0xe818('0x88')))[_0xe818('0x74')](ut[_0xe818('0x89')]('[RecallMe]'));}else{rpcDb[_0xe818('0x8a')](_0x432754[_0x28d1b1]['id']);}}else{var _0x3d5147=new Action(_0x432754[_0x28d1b1],_0x2a3f46);_0x3d5147['starttime']=moment()['format'](_0xe818('0x8b'));_0x2a3f46[_0xe818('0x3b')]+=0x1;ut[_0xe818('0x8c')](_0x3d5147,0x17,_0xe818('0x8d'));if(_0x2a3f46[_0xe818('0x8e')]){rpcDb[_0xe818('0x8f')](ut['createBody'](_0x432754[_0x28d1b1]));rpcDb['createCustomerHistory'](_0x3d5147,_0xe818('0x90'));}else{ut[_0xe818('0x8c')](_0x3d5147,0x16,_0xe818('0x91'));rpcDb[_0xe818('0x92')](_0x3d5147,_0xe818('0x93'));rpcDb[_0xe818('0x94')](_0x3d5147,_0xe818('0x93'));}}}}})[_0xe818('0x74')](ut[_0xe818('0x89')](_0xe818('0x95')));};Preview['prototype'][_0xe818('0x67')]=function(_0xaebb4c){_0xaebb4c['sendMessageOneNotActive']=!![];if(ut[_0xe818('0x96')](_0xaebb4c['loggedIn'])){_0xaebb4c[_0xe818('0x46')]=_0xe818('0x97');}else if(!ut[_0xe818('0x98')](_0xaebb4c[_0xe818('0x66')])){_0xaebb4c[_0xe818('0x46')]=_0xe818('0x5a');}else if(!this['isTrunkReachable'](_0xaebb4c[_0xe818('0x4d')])){if(!this[_0xe818('0x99')](_0xaebb4c[_0xe818('0x9a')])){_0xaebb4c[_0xe818('0x46')]=_0xe818('0x9b');}else{_0xaebb4c[_0xe818('0x46')]=_0xe818('0x9c');}}else{_0xaebb4c[_0xe818('0x46')]='ACTIVE';}emitCampaignPreview(_0xaebb4c);};Preview[_0xe818('0xe')][_0xe818('0x9d')]=function(_0x247a8f,_0xee87c5,_0x12d380){var _0x4cdf4f=this;var _0xbf139d=this[_0xe818('0x69')][_0xee87c5];var _0x1df7d3=this[_0xe818('0x13')][_0xbf139d['queue']];var _0x35161d;if(_0x1df7d3){switch(_0x12d380){case'1':_0x1df7d3[_0xe818('0x39')]+=0x1;_0xbf139d['countnosuchnumberretry']+=0x1;_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x0,_0xe818('0xa0'));ami[_0xe818('0x23')](_0xe818('0xa1'),ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xa3')));rpcDb[_0xe818('0x92')](_0xbf139d,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3['dialGlobalMaxRetry']){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xa6'));}else{if(_0xbf139d[_0xe818('0xa7')]>=_0x1df7d3['dialNoSuchNumberMaxRetry']){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xa6'));}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xa7'),_0x1df7d3[_0xe818('0xaa')]),_0xbf139d['unlockAgent'],_0xbf139d[_0xe818('0xab')]);}}delete this[_0xe818('0x69')][_0x247a8f['linkedid']];break;case _0xe818('0xac'):var _0x3dd89d=moment()[_0xe818('0x51')](_0xe818('0x8b'));_0xbf139d[_0xe818('0xad')]=_0x3dd89d;_0xbf139d[_0xe818('0xae')]=_0x3dd89d;_0xbf139d[_0xe818('0x78')]=!![];_0x1df7d3[_0xe818('0x58')]+=0x1;logger['info'](_0xe818('0xaf'),_0xbf139d[_0xe818('0xb0')],_0xe818('0xb1'),_0x1df7d3[_0xe818('0x25')],_0xe818('0x6d'),_0x1df7d3[_0xe818('0x58')]);ami[_0xe818('0x23')](_0xe818('0xb2'),ut[_0xe818('0xa2')](_0xbf139d,'connect',this['campaignsPreview'][_0xbf139d['queue']]));if(_0x1df7d3[_0xe818('0xb3')]){ami[_0xe818('0x23')]('custom:agentConnectPreview',ut['buildAcw'](_0xbf139d));}break;case'16':ami[_0xe818('0x23')](_0xe818('0xb4'),ut['buildObj'](_0xbf139d,_0xe818('0xb5'),this[_0xe818('0x13')][_0xbf139d[_0xe818('0x6c')]]));emitVoiceQueueChannelRemove(ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xb5')));_0x1df7d3['outboundAnswerCallsDay']+=0x1;_0x1df7d3['total']+=0x1;_0x1df7d3['answered']+=0x1;ut['decrementTalkink'](_0x1df7d3,_0xe818('0xb6'));_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x4,_0xe818('0xb7'));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xb8'));rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xb9'));rpcDb[_0xe818('0xba')](_0xbf139d);_0x1df7d3['sumDuration']+=_0xbf139d[_0xe818('0xbb')];_0x1df7d3['sumBillable']+=_0xbf139d[_0xe818('0xbb')];logger[_0xe818('0x52')](_0xe818('0xbc'),_0xbf139d['uniqueid'],_0xe818('0xb1'),_0x1df7d3['name'],'pTalking:\x20',_0x1df7d3[_0xe818('0x58')]);delete this[_0xe818('0x69')][_0x247a8f[_0xe818('0xbd')]];break;case'BUSY':_0x1df7d3[_0xe818('0xbe')]+=0x1;_0xbf139d[_0xe818('0xbf')]+=0x1;_0xbf139d['countglobal']=ut['totalGlobal'](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x5,_0xe818('0xc0'));ami[_0xe818('0x23')]('custom:agentbusy',ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xc1')));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xc2'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xc4'));}else{if(_0xbf139d[_0xe818('0xbf')]>=_0x1df7d3[_0xe818('0xc5')]){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xc2'));}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xbf'),_0x1df7d3[_0xe818('0xc6')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d[_0xe818('0xab')]);}}break;case'NOANSWER':_0x1df7d3[_0xe818('0x38')]+=0x1;_0xbf139d[_0xe818('0xc8')]+=0x1;_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut['logCustomer'](_0xbf139d,0x3,_0xe818('0xc9'));ami['emit'](_0xe818('0xca'),ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xcb')));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xcc'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut['cloneAction'](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb[_0xe818('0x94')](_0x35161d,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0xbf139d['countnoanswerretry']>=_0x1df7d3[_0xe818('0xcd')]){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xcc'));}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xc8'),_0x1df7d3[_0xe818('0xce')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d[_0xe818('0xab')]);}}break;case'CONGESTION':_0x1df7d3[_0xe818('0xcf')]+=0x1;_0xbf139d[_0xe818('0xd0')]+=0x1;_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x8,_0xe818('0xd1'));ami[_0xe818('0x23')](_0xe818('0xd2'),ut[_0xe818('0xa2')](_0xbf139d,'congestion'));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xd3'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb['createCustomerFinal'](_0x35161d,_0xe818('0xd4'));}else{if(_0xbf139d['countcongestionretry']>=_0x1df7d3[_0xe818('0xd5')]){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xd3'));}else{rpcDb['rescheduleContact'](ut[_0xe818('0xa9')](_0xbf139d,'countcongestionretry',_0x1df7d3[_0xe818('0xc6')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d['activeContact']);}}break;case'CANCEL':_0x1df7d3[_0xe818('0xd6')]+=0x1;_0xbf139d['countagentrejectretry']+=0x1;_0xbf139d['countglobal']=ut[_0xe818('0x9f')](_0xbf139d);ut['logCustomer'](_0xbf139d,0x14,_0xe818('0xd7'));ami['emit'](_0xe818('0xd8'),ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xd9')));rpcDb['createCustomerHistory'](_0xbf139d,_0xe818('0xda'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3['dialGlobalMaxRetry']){_0x35161d=ut['cloneAction'](_0xbf139d,0x14,'AgentReject');rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xdb'));}else{if(_0xbf139d['countagentrejectretry']>=_0x1df7d3[_0xe818('0xdc')]){rpcDb[_0xe818('0x94')](_0xbf139d,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xdd'),_0x1df7d3[_0xe818('0xde')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d[_0xe818('0xab')]);}}break;case _0xe818('0xdf'):_0x1df7d3[_0xe818('0x3d')]+=0x1;_0xbf139d['countabandonedretry']+=0x1;_0xbf139d[_0xe818('0x9e')]=ut['totalGlobal'](_0xbf139d);ut['logCustomer'](_0xbf139d,0xb,_0xe818('0xe0'));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xe1'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3['dialGlobalMaxRetry']){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,'Global');rpcDb['createCustomerFinal'](_0x35161d,_0xe818('0xe1'));}else{if(_0xbf139d[_0xe818('0xe2')]>=_0x1df7d3[_0xe818('0xe3')]){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xe1'));}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xe4'),_0x1df7d3[_0xe818('0xe5')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d[_0xe818('0xab')]);}}break;case'18':_0x1df7d3['outboundUnknownCallsDay']+=0x1;_0xbf139d[_0xe818('0xe6')]+=0x1;_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x12,_0x247a8f['cause-txt']||_0x247a8f[_0xe818('0xe7')]);ami['emit']('custom:amd',ut['buildObj'](_0xbf139d,_0xe818('0xe8')));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xe9'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut['cloneAction'](_0xbf139d,0xf,'Global');rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xe9'));}else{rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xe9'));}delete this[_0xe818('0x69')][_0x247a8f[_0xe818('0xbd')]];break;case'19':_0x1df7d3[_0xe818('0x3c')]+=0x1;_0xbf139d['countglobal']=ut['totalGlobal'](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x13,_0x247a8f[_0xe818('0xea')]||_0x247a8f[_0xe818('0xe7')]);ami[_0xe818('0x23')](_0xe818('0xeb'),ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xe8')));rpcDb[_0xe818('0x92')](_0xbf139d,'[callProgressDetectingCustomer][machine]');if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xec'));}else{rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xec'));}delete this[_0xe818('0x69')][_0x247a8f['linkedid']];break;default:if(_0xbf139d['dialAnswer']){ut[_0xe818('0x79')](_0x1df7d3,_0xe818('0xed'));ut[_0xe818('0x7a')](_0xe818('0xee')+_0x1df7d3[_0xe818('0x25')],_0x247a8f);}_0x1df7d3['outboundUnknownCallsDay']+=0x1;_0xbf139d[_0xe818('0x9e')]=ut['totalGlobal'](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0xc,_0x247a8f[_0xe818('0xea')]||_0x247a8f[_0xe818('0xe7')]);rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xef'));if(ut['totalGlobal'](_0xbf139d)>=_0x1df7d3['dialGlobalMaxRetry']){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,'Global');rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xf0'));}else{rpcDb[_0xe818('0x94')](_0xbf139d,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xe818('0x69')][_0x247a8f[_0xe818('0xbd')]];}if(!(_0xbf139d[_0xe818('0x78')]&&_0x12d380==='16')){ut[_0xe818('0x76')](_0x1df7d3,_0xe818('0xf1'));logger[_0xe818('0x52')]('[originated][decrement][callProgressDetectingCustomer]',_0xbf139d['uniqueid'],_0xe818('0xb1'),_0x1df7d3[_0xe818('0x25')],_0xe818('0xf2'),_0x1df7d3['originated']);}if(_0x12d380!==_0xe818('0xac')){delete this[_0xe818('0x69')][_0x247a8f[_0xe818('0xbd')]];delete this[_0xe818('0x69')][_0x247a8f['destlinkedid']];}}};Preview[_0xe818('0xe')]['callProgressDetectingAgent']=function(_0x2370f8,_0x3dc9f4,_0x57b47d){if(_['isUndefined'](_0x3dc9f4)&&_0xe818('0xf3')!==typeof _0x3dc9f4){return;}if(_[_0xe818('0xf4')](_0x57b47d)&&_0xe818('0xf3')!==typeof _0x57b47d){return;}switch(_0x57b47d[_0xe818('0xf5')]){case'0':ut[_0xe818('0xf6')](_0x2370f8,0x0,'NoSuchNumber');rpcDb[_0xe818('0xf7')](_0x2370f8,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x2370f8,0x3,'NoAnswer');rpcDb[_0xe818('0xf7')](_0x2370f8,_0xe818('0xf8'));break;case'5':ut[_0xe818('0xf6')](_0x2370f8,0x5,'Busy');rpcDb[_0xe818('0xf7')](_0x2370f8,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xe818('0xf6')](_0x2370f8,0x8,_0xe818('0xd1'));rpcDb['createAgentHistory'](_0x2370f8,_0xe818('0xf9'));break;case'22':ut[_0xe818('0xf6')](_0x2370f8,0x16,'AnswerAGI');rpcDb[_0xe818('0xf7')](_0x2370f8,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x2370f8,0xc,_0x57b47d[_0xe818('0xf5')]);rpcDb[_0xe818('0xf7')](_0x2370f8,_0xe818('0xf9'));}ut[_0xe818('0x76')](_0x3dc9f4,_0xe818('0xfa'));logger[_0xe818('0x52')](_0xe818('0xfb'),_0x2370f8['uniqueid'],_0xe818('0xb1'),_0x3dc9f4['name'],'originated:\x20',_0x3dc9f4[_0xe818('0x47')]);delete this[_0xe818('0x69')][_0x2370f8['uniqueid']];};Preview[_0xe818('0xe')][_0xe818('0xfc')]=function(_0x27bb09,_0x489ebe,_0x5ea488,_0x5801c5,_0x57960f){var _0x1f302c=this;return new BPromise(function(_0x263d35,_0x27cb8a){if(_[_0xe818('0x81')](_0x489ebe)||_[_0xe818('0x81')](_0x489ebe[_0xe818('0xfd')])||_[_0xe818('0x81')](_0x489ebe[_0xe818('0xfd')]['phone'])||_['isNil'](_0x489ebe[_0xe818('0x70')])){_0x27cb8a(ut[_0xe818('0x46')]('Contact\x20is\x20undefined',_0x5801c5,_0x57960f));return;}var _0xb2baca=uuid['v4']();var _0x432f9e=_0x1f302c['campaignsPreview'][_0x489ebe[_0xe818('0x6b')][_0xe818('0x25')]];var _0x1e3ca9=_0x5ea488?_0x1f302c[_0xe818('0x16')][_0x5ea488]['id']:undefined;_0x1f302c[_0xe818('0x69')][_0xb2baca]=new Action(_0x489ebe,_0x432f9e,_0xb2baca,_0x5ea488,_0x1e3ca9);var _0x51877f=_0x1f302c[_0xe818('0x69')][_0xb2baca];_0x51877f[_0xe818('0xc7')]=_0x5801c5;_0x51877f[_0xe818('0xab')]=_0x57960f;_0x51877f[_0xe818('0xfe')]=_0x5ea488;if(_[_0xe818('0xff')](_0x27bb09)){_0x1f302c['execCall'](_0x51877f,_0x432f9e,_0x489ebe,_0x5ea488)[_0xe818('0x87')](function(_0x40ccd8){logger[_0xe818('0x52')](_0xe818('0x100'),_0xe818('0x101')+_0x51877f['queue']+_0xe818('0x102')+_0x51877f[_0xe818('0x103')],JSON['stringify'](_0x40ccd8));ami['emit'](_0xe818('0x104'),ut[_0xe818('0xa2')](_0x51877f,_0xe818('0x105'),_0x1f302c[_0xe818('0x13')][_0x51877f['queue']]));_0x263d35(ut[_0xe818('0x46')](_0xe818('0x106')));})[_0xe818('0x74')](function(_0x5445d7){ut[_0xe818('0x5b')](_0xe818('0x107'),_0x5445d7);_0x27cb8a(ut[_0xe818('0x46')]('Call\x20failed',_0x5801c5,_0x57960f));});}else{_0x432f9e[_0xe818('0x108')]+=0x1;ut['logBlacklist'](_0x51877f);rpcDb['createHistory'](_0x51877f,_0xe818('0x109'));delete _0x1f302c['actions'][_0xb2baca];_0x27cb8a(ut[_0xe818('0x46')]('Contact\x20in\x20black\x20List',_0x5801c5,_0x57960f));}});};Preview['prototype']['isTrunkReachable']=function(_0x1aa48e){return!_[_0xe818('0x81')](_0x1aa48e)&&!_[_0xe818('0x81')](_0x1aa48e[_0xe818('0x25')])&&!_[_0xe818('0x81')](_0x1aa48e[_0xe818('0x4e')])&&_0x1aa48e[_0xe818('0x4e')]&&!_[_0xe818('0x81')](this[_0xe818('0x15')][util[_0xe818('0x51')](_0xe818('0x10a'),_0x1aa48e['name'])])&&!_[_0xe818('0x81')](this[_0xe818('0x15')][util[_0xe818('0x51')](_0xe818('0x10a'),_0x1aa48e[_0xe818('0x25')])][_0xe818('0x72')])&&(this[_0xe818('0x15')][util[_0xe818('0x51')](_0xe818('0x10a'),_0x1aa48e[_0xe818('0x25')])]['status']==='reachable'||this[_0xe818('0x15')][util[_0xe818('0x51')](_0xe818('0x10a'),_0x1aa48e[_0xe818('0x25')])][_0xe818('0x72')]===_0xe818('0x10b'));};Preview[_0xe818('0xe')][_0xe818('0x86')]=function(_0xf9e6c4,_0x10fbf5){var _0x4aa632=this;return new BPromise(function(_0xb5b85b,_0x50fe6a){_0x4aa632[_0xe818('0x10c')](_0xf9e6c4,_0x10fbf5)[_0xe818('0x87')](function(_0x3220fe){_0xb5b85b(_['pick'](_0x3220fe,[_0xe818('0x46')]));})['catch'](function(_0xd64c13){if(_0xd64c13[_0xe818('0x10d')]){rpcDb['unlockContact'](_0xf9e6c4);}if(_0xd64c13['active']){rpcDb[_0xe818('0x8a')](_0xf9e6c4);}_0x50fe6a(_['pick'](_0xd64c13,[_0xe818('0x46')]));});});};Preview[_0xe818('0xe')][_0xe818('0x10c')]=function(_0x17e80d,_0x21d970){var _0x48126b=this;return new BPromise(function(_0x28749b,_0x515f80){var _0x2db5d1,_0x27dec7;rpcDb[_0xe818('0x10e')](_0x17e80d)[_0xe818('0x87')](function(_0x12cc76){if(!_[_0xe818('0x81')](_0x12cc76[0x0])){_0x27dec7=_0x12cc76[0x0][_0xe818('0x10f')]?![]:!![];_0x2db5d1=_0x12cc76[0x0][_0xe818('0x10f')]?!![]:![];_0x2db5d1=_0x21d970?!![]:_0x2db5d1;}var _0x436961=_0x48126b[_0xe818('0x110')](_0x12cc76);if(_0x436961[_0xe818('0x111')]){rpcDb[_0xe818('0x112')](_[_0xe818('0x6e')](_0x12cc76[0x0],[_0xe818('0x70'),'Contact.phone']))[_0xe818('0x87')](function(_0x3d0753){_0x48126b[_0xe818('0xfc')](_0x3d0753,_0x12cc76[0x0],_0x21d970,_0x27dec7,_0x2db5d1)[_0xe818('0x87')](function(_0x186caf){_0x28749b(_0x186caf);})[_0xe818('0x74')](function(_0x11d851){_0x515f80(_0x11d851);});})[_0xe818('0x74')](function(_0x1b0bbc){ut[_0xe818('0x5b')](_0xe818('0x113'),_0x1b0bbc);_0x515f80(ut[_0xe818('0x46')]('Call\x20unsuccessful',_0x27dec7,_0x2db5d1));});}else{_0x515f80(ut[_0xe818('0x46')](_0x436961[_0xe818('0x46')],_0x27dec7,_0x2db5d1));}})[_0xe818('0x74')](function(_0x388fdc){ut['logger'](_0xe818('0x114'),_0x388fdc);_0x515f80(ut[_0xe818('0x46')](_0xe818('0x115'),![],!![]));});});};Preview['prototype'][_0xe818('0x110')]=function(_0x2d9b7f){if(_['isNil'](_0x2d9b7f)||_[_0xe818('0xff')](_0x2d9b7f)||!_[_0xe818('0x81')](_0x2d9b7f[0x0][_0xe818('0x84')])&&_[_0xe818('0x81')](_0x2d9b7f[0x0][_0xe818('0x84')][_0xe818('0x25')])){ut['logger'](_0xe818('0x116'),_0x2d9b7f);return{'isValid':![],'message':_0xe818('0x117')};}var _0x3374e4=this[_0xe818('0x13')][_0x2d9b7f[0x0]['Queue']['name']];_0x3374e4['message']=_0xe818('0x9c');if(_[_0xe818('0x81')](_0x3374e4)){ut[_0xe818('0x5b')](_0xe818('0x118'),_0x3374e4);return{'isValid':![],'message':_0xe818('0x119')};}if(!this['isTrunkReachable'](_0x3374e4[_0xe818('0x4d')])){ut[_0xe818('0x5b')](_0xe818('0x11a'),_0xe818('0x11b')+_0x3374e4[_0xe818('0x25')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xe818('0x99')](_0x3374e4[_0xe818('0x9a')])){ut['logger'](_0xe818('0x11a'),_0x3374e4['name']+_0xe818('0x11c'));return{'isValid':![],'message':_0xe818('0x11d')};}}if(!ut[_0xe818('0x98')](_0x3374e4[_0xe818('0x66')])){ut[_0xe818('0x5b')](_0xe818('0x11e'),_0x3374e4['name']+_0xe818('0x11f'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3374e4[_0xe818('0x25')]+_0xe818('0x11f')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype']['execCall']=function(_0x4ff31e,_0x398b8a,_0x1666f3,_0x2ba955){var _0x3cb1db=this;return new BPromise(function(_0x3cc12a,_0x7a7374){var _0x5b43c6=_0x4ff31e[_0xe818('0xb0')];var _0x35641e=_0x3cb1db['isTrunkReachable'](_0x398b8a[_0xe818('0x4d')])?util[_0xe818('0x51')](_0xe818('0x120'),_0x398b8a['Trunk']['name'],_[_0xe818('0x81')](_0x398b8a['dialPrefix'])?'':_0x398b8a[_0xe818('0x32')]['trim']()||'',_0x398b8a[_0xe818('0x121')]>0x0?_0x1666f3['Contact'][_0xe818('0x122')]['substring'](_0x398b8a[_0xe818('0x121')]):_0x1666f3[_0xe818('0xfd')]['phone']):util[_0xe818('0x51')](_0xe818('0x120'),_[_0xe818('0x81')](_0x398b8a['TrunkBackup'])?_0x398b8a[_0xe818('0x4d')][_0xe818('0x25')]:_0x398b8a[_0xe818('0x9a')][_0xe818('0x25')],_['isNil'](_0x398b8a[_0xe818('0x32')])?'':_0x398b8a[_0xe818('0x32')][_0xe818('0x123')]()||'',_0x398b8a[_0xe818('0x121')]>0x0?_0x1666f3[_0xe818('0xfd')][_0xe818('0x122')][_0xe818('0x124')](_0x398b8a[_0xe818('0x121')]):_0x1666f3[_0xe818('0xfd')]['phone']);var _0x5def9d=_0x3cb1db[_0xe818('0x99')](_0x398b8a['Trunk'])?ut[_0xe818('0x125')](_0x398b8a['Trunk'][_0xe818('0x4f')],_0x398b8a['dialOriginateCallerIdName'],_0x398b8a[_0xe818('0x126')]>0x0?ut[_0xe818('0x127')](_0x398b8a[_0xe818('0x128')],_0x398b8a[_0xe818('0x126')]):_0x398b8a['dialOriginateCallerIdNumber']):ut[_0xe818('0x125')](_[_0xe818('0x81')](_0x398b8a[_0xe818('0x9a')])?_0x398b8a[_0xe818('0x4d')][_0xe818('0x4f')]:_0x398b8a[_0xe818('0x9a')][_0xe818('0x4f')],_0x398b8a[_0xe818('0x30')],_0x398b8a[_0xe818('0x126')]>0x0?ut[_0xe818('0x127')](_0x398b8a['dialOriginateCallerIdNumber'],_0x398b8a[_0xe818('0x126')]):_0x398b8a[_0xe818('0x128')]);if(_0x5def9d){_0x4ff31e[_0xe818('0x129')]=ut['extractCalleridName'](_0x5def9d);_0x4ff31e[_0xe818('0x12a')]=ut[_0xe818('0x12b')](_0x5def9d);}var _0x263cb9=ut[_0xe818('0x12c')](_0x398b8a,_0x1666f3,_0x35641e,_0x5def9d,_0x5b43c6,_0x4ff31e);_[_0xe818('0x12d')](_0x4ff31e,ut[_0xe818('0x12e')](_0x263cb9));_0x4ff31e['starttime']=moment()[_0xe818('0x51')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0xe818('0x12f')](_0x4ff31e,_0x398b8a,_0x263cb9,_0x4ff31e[_0xe818('0xab')],_0x2ba955))[_0xe818('0x87')](function(_0x4d68c9){var _0x576444=_0x4ff31e['channelAgent'];if(!_[_0xe818('0x81')](_0x576444)){if(!_[_0xe818('0x81')](_0x3cb1db[_0xe818('0x16')][_0x576444])){_0x3cb1db[_0xe818('0x16')][_0x576444]['destconnectedlinenum']=_0x4ff31e['calleridnum'];emit(util[_0xe818('0x51')](_0xe818('0x130'),_0x3cb1db[_0xe818('0x16')][_0x576444]['name']),'user:agentconnect',{'destaccountcode':_0x3cb1db[_0xe818('0x16')][_0x576444][_0xe818('0x131')],'destconnectedlinenum':_0x4ff31e[_0xe818('0x132')]});}}_0x398b8a[_0xe818('0x47')]+=0x1;logger[_0xe818('0x52')](_0xe818('0x133'),_0x5b43c6,'\x20Queue',_0x398b8a[_0xe818('0x25')],_0xe818('0xf2'),_0x398b8a[_0xe818('0x47')]);_0x3cc12a(_0x4d68c9);})[_0xe818('0x74')](function(_0x1d4c82){ut['logAgent'](_0x4ff31e,0xe,'OriginateError');rpcDb[_0xe818('0xf7')](_0x4ff31e,'[originateFailure][logOriginateFailure]');_0x7a7374(_0x1d4c82);});});};Preview[_0xe818('0xe')]['syncNewExten']=function(_0x5ce4ff){if(this[_0xe818('0x69')][_0x5ce4ff[_0xe818('0xbd')]]){this[_0xe818('0x69')][_0x5ce4ff['linkedid']][_0xe818('0x73')]=_0x5ce4ff[_0xe818('0x73')];}};Preview[_0xe818('0xe')][_0xe818('0x19')]=function(_0x15c24b){var _0x15cc06=this;var _0x33a368=this[_0xe818('0x69')][_0x15c24b[_0xe818('0x134')]];if(_0x33a368){if(_0x33a368[_0xe818('0xfe')]&&this[_0xe818('0x16')][_0x33a368[_0xe818('0xfe')]]){ut[_0xe818('0x135')](_0x33a368,this[_0xe818('0x16')][_0x33a368['lookAgent']][_0xe818('0x25')],this[_0xe818('0x16')][_0x33a368['lookAgent']]['id']);}var _0x2e9a3c=_[_0xe818('0x136')](_0x33a368);_0x2e9a3c['responsetime']=moment()[_0xe818('0x51')](_0xe818('0x8b'));var _0x3a67f0=_0x15cc06[_0xe818('0x13')][_0x33a368[_0xe818('0x6c')]];if(ut[_0xe818('0x137')](_0x15c24b['response'])){if(_0x33a368[_0xe818('0xc7')]){rpcDb[_0xe818('0x138')](_0x33a368['idContact']);}if(_0x33a368['activeContact']){rpcDb['disableContact'](_0x33a368[_0xe818('0x103')]);}ami[_0xe818('0x23')]('custom:agentringnoanswer',ut['buildObj'](_0x33a368,'rejected',this[_0xe818('0x13')][_0x33a368['queue']]));this[_0xe818('0x139')](_0x2e9a3c,_0x3a67f0,_0x15c24b);}else{_0x33a368[_0xe818('0x13a')]=moment()[_0xe818('0x51')](_0xe818('0x8b'));ut['logAgent'](_0x2e9a3c,0x4,_0xe818('0xb7'));rpcDb[_0xe818('0xf7')](_0x2e9a3c,_0xe818('0x13b'));}}};Preview['prototype'][_0xe818('0x13c')]=function(_0x2854a3){var _0x233cf2=this;var _0x2efba2=this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]];var _0x15a5b7;if(_0x2efba2){_0x15a5b7=this[_0xe818('0x13')][_0x2efba2[_0xe818('0x6c')]];logger['info'](_0xe818('0x13d'),_0x2854a3['linkedid'],_0xe818('0xb1'),_0x15a5b7[_0xe818('0x25')],_0xe818('0x6d'),_0x15a5b7[_0xe818('0x58')]);}if(this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]]&&_0x2854a3[_0xe818('0xbd')]!==_0x2854a3[_0xe818('0xb0')]){if(_0x2854a3[_0xe818('0x13e')]==='16'&&this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]][_0xe818('0x78')]){this[_0xe818('0x9d')](_0x2854a3,_0x2854a3[_0xe818('0xbd')],_0x2854a3[_0xe818('0x13e')]);}else if(this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]][_0xe818('0x78')]){logger[_0xe818('0x52')](_0xe818('0x13f'),_0x2854a3['linkedid'],_0x2854a3[_0xe818('0x13e')],_0xe818('0xb1'),_0x15a5b7[_0xe818('0x25')],_0xe818('0x6d'),_0x15a5b7[_0xe818('0x58')]);this[_0xe818('0x9d')](_0x2854a3,_0x2854a3['linkedid'],_0x2854a3['cause']);}}else if(_0x2efba2&&_[_0xe818('0x81')](_0x2efba2[_0xe818('0x140')])&&_0x15a5b7[_0xe818('0x141')]&&_0x2854a3[_0xe818('0xbd')]===_0x2854a3[_0xe818('0xb0')]&&_[_0xe818('0x81')](_0x2854a3[_0xe818('0xf5')])&&_0x2854a3[_0xe818('0x13e')]==='16'&&_0x2854a3['channelstate']==='6'&&_[_0xe818('0xf4')](_0x2efba2[_0xe818('0x142')])){if(_0x2efba2[_0xe818('0xc7')]){rpcDb['unlockContact'](_0x2efba2[_0xe818('0x103')]);}if(_0x2efba2[_0xe818('0xab')]){rpcDb['disableContact'](_0x2efba2[_0xe818('0x103')]);}_0x2854a3[_0xe818('0xf5')]='22';this[_0xe818('0x139')](_0x2efba2,_0x15a5b7,_0x2854a3);}else if(_0x2efba2&&_0x2efba2[_0xe818('0x142')]){if(_0x2854a3[_0xe818('0x13e')]==='16'&&this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]][_0xe818('0x78')]){logger[_0xe818('0x52')](_0xe818('0x143'),_0x2854a3[_0xe818('0xbd')],_0x2854a3[_0xe818('0x13e')],_0xe818('0xb1'),_0x15a5b7[_0xe818('0x25')],_0xe818('0x6d'),_0x15a5b7[_0xe818('0x58')]);this['callProgressDetectingCustomer'](_0x2854a3,_0x2854a3[_0xe818('0xbd')],_0x2854a3[_0xe818('0x13e')]);}else if(this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]][_0xe818('0x78')]){logger[_0xe818('0x52')](_0xe818('0x13f'),_0x2854a3[_0xe818('0xbd')],_0x2854a3[_0xe818('0x13e')],_0xe818('0xb1'),_0x15a5b7['name'],_0xe818('0x6d'),_0x15a5b7[_0xe818('0x58')]);this[_0xe818('0x9d')](_0x2854a3,_0x2854a3['linkedid'],_0x2854a3[_0xe818('0x13e')]);}}};Preview[_0xe818('0xe')][_0xe818('0x144')]=function(_0xdad8d4){if(this['actions'][_0xdad8d4[_0xe818('0x145')]]&&_0xdad8d4[_0xe818('0x145')]!==_0xdad8d4[_0xe818('0x146')]){this[_0xe818('0x9d')](_0xdad8d4,_0xdad8d4['destlinkedid'],_0xdad8d4[_0xe818('0xe7')]);}};Preview[_0xe818('0xe')]['syncHangupRequest']=function(_0x55d9ac){if(this['actions'][_0x55d9ac[_0xe818('0xbd')]]&&_0x55d9ac[_0xe818('0xbd')]!==_0x55d9ac[_0xe818('0xb0')]&&!this[_0xe818('0x69')][_0x55d9ac[_0xe818('0xbd')]][_0xe818('0x78')]){if(_0x55d9ac['cause']==='1'){this[_0xe818('0x9d')](_0x55d9ac,_0x55d9ac[_0xe818('0xbd')],_0x55d9ac[_0xe818('0x13e')]);}}};Preview['prototype'][_0xe818('0x147')]=function(_0x171c5d,_0xf855ea,_0x49f619){if(this[_0xe818('0x69')][_0x171c5d]){if(_[_0xe818('0x81')](this[_0xe818('0x69')][_0x171c5d][_0xe818('0x148')])){this[_0xe818('0x69')][_0x171c5d]['variables']={};}this[_0xe818('0x69')][_0x171c5d][_0xe818('0x148')][_0xf855ea]=_0x49f619;}};Preview['prototype']['syncVarSet']=function(_0x4849ac){try{if(!_[_0xe818('0x81')](_0x4849ac)){if(ut[_0xe818('0x149')](_[_0xe818('0x14a')](_0x4849ac[_0xe818('0x14b')])[0x0])){this[_0xe818('0x147')](_0x4849ac[_0xe818('0xb0')],_[_0xe818('0x14a')](_0x4849ac[_0xe818('0x14b')])[0x0],_0x4849ac[_0xe818('0x14c')]);}}}catch(_0x232aee){logger[_0xe818('0x14d')](_0xe818('0x14e'),util[_0xe818('0x14f')](_0x232aee,{'showHidden':![],'depth':null}));}};Preview[_0xe818('0xe')][_0xe818('0x20')]=function(_0x53028f){if(_0x53028f){if(this[_0xe818('0x69')][_0x53028f[_0xe818('0x150')]]){this[_0xe818('0x69')][_0x53028f['transfertargetlinkedid']][_0xe818('0x142')]=!![];}}};Preview[_0xe818('0xe')][_0xe818('0x22')]=function(_0x42eb5b){if(_0x42eb5b){if(this[_0xe818('0x69')][_0x42eb5b[_0xe818('0x151')]]){this[_0xe818('0x69')][_0x42eb5b[_0xe818('0x151')]][_0xe818('0x142')]=!![];}}};module[_0xe818('0x152')]=Preview;
\ No newline at end of file
index d62e1de..f83d29f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d3c=['../rpc/voiceQueueRt','../rpc/agentReportPreview','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercompleteAt','connectedlinename','membername','from-sip','exten','holdtime','assigned','queuecallerexitreason','COMPLETED','create','getContactRecallMe','rescheduleContactInQueue','bluebird','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack'];(function(_0x7d3dfa,_0x10b9cb){var _0x2a5a05=function(_0x4795ea){while(--_0x4795ea){_0x7d3dfa['push'](_0x7d3dfa['shift']());}};_0x2a5a05(++_0x10b9cb);}(_0x5d3c,0x8c));var _0xc5d3=function(_0x47e37d,_0x241d76){_0x47e37d=_0x47e37d-0x0;var _0xf9075d=_0x5d3c[_0x47e37d];return _0xf9075d;};'use strict';var util=require('util');var BPromise=require(_0xc5d3('0x0'));var logger=require('../../../config/logger')('preview');var _=require(_0xc5d3('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xc5d3('0x2'));var cmHopperBlack=require(_0xc5d3('0x3'));var voiceQueueRt=require(_0xc5d3('0x4'));var agentReportPreview=require(_0xc5d3('0x5'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0xb835fc){return function(_0x2af273){logger['error'](_0xb835fc,util[_0xc5d3('0x6')](_0x2af273,{'showHidden':![],'depth':null}));};}function create(_0x24d050){return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](cmHopperHistory[_0xc5d3('0x9')](_0x24d050))[_0xc5d3('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x9eec6b){return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](agentReportPreview['createHistory'](_0x9eec6b))[_0xc5d3('0xa')](loggerCatch(_0xc5d3('0xb')));}function moveContact(_0x272477){return BPromise['resolve']()['then'](cmHopper[_0xc5d3('0xc')](_0x272477,!![]))[_0xc5d3('0xa')](loggerCatch(_0xc5d3('0xd')));}exports[_0xc5d3('0xe')]=function(_0x37dc6b){return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](cmHopperBlack['checkIsBlackList'](_0x37dc6b))['catch'](loggerCatch(_0xc5d3('0xf')));};exports[_0xc5d3('0x10')]=function(_0x7ecb6b){return BPromise[_0xc5d3('0x7')]()['then'](cmHopper['getContactPreview'](_0x7ecb6b))['catch'](loggerCatch(_0xc5d3('0x11')));};exports[_0xc5d3('0x9')]=function(_0x3112ae,_0x186616){create(_0x3112ae)['catch'](loggerCatch(_0x186616));moveContact(_0x3112ae)[_0xc5d3('0xa')](loggerCatch(_0x186616));};exports['createAgentHistory']=function(_0x4c7a19,_0x4a0332){createAgent(_0x4c7a19)[_0xc5d3('0xa')](loggerCatch(_0x4a0332));};exports[_0xc5d3('0x12')]=function(_0x39d49d,_0x58ba70){create(_0x39d49d)[_0xc5d3('0xa')](loggerCatch(_0x58ba70));};exports[_0xc5d3('0x13')]=function(_0x3a75e1,_0x339a1d){moveContact(_0x3a75e1)[_0xc5d3('0xa')](loggerCatch(_0x339a1d));};exports['rescheduleContact']=function(_0x319e16,_0x1bb9d1,_0x5e44fb){if(_0x1bb9d1){_0x319e16[_0xc5d3('0x14')]=null;}if(_0x5e44fb){_0x319e16['active']=![];}return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](cmHopper[_0xc5d3('0x15')](_0x319e16))['catch'](loggerCatch(_0xc5d3('0x16')));};exports[_0xc5d3('0x17')]=function(_0x45d6ed){return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](cmHopper['countReScheduled'](_0x45d6ed))['catch'](loggerCatch(_0xc5d3('0x18')));};exports[_0xc5d3('0x19')]=function(_0x4e2c8c){return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](cmHopper[_0xc5d3('0x19')]({'UserId':null},_0x4e2c8c,0x1))['catch'](loggerCatch(_0xc5d3('0x1a')));};exports['disableContact']=function(_0x35bd61){return BPromise[_0xc5d3('0x7')]()['then'](cmHopper[_0xc5d3('0x19')]({'active':![]},_0x35bd61,0x1))[_0xc5d3('0xa')](loggerCatch(_0xc5d3('0x1b')));};exports[_0xc5d3('0x1c')]=function(_0x38dc69){var _0xe0bd77={};_0xe0bd77[_0xc5d3('0x1d')]=_0x38dc69[_0xc5d3('0x1d')];_0xe0bd77[_0xc5d3('0x1e')]=_0x38dc69[_0xc5d3('0x1e')];_0xe0bd77[_0xc5d3('0x1f')]=_0x38dc69[_0xc5d3('0x1f')];_0xe0bd77[_0xc5d3('0x20')]=_0x38dc69[_0xc5d3('0x20')];_0xe0bd77[_0xc5d3('0x21')]=_0x38dc69[_0xc5d3('0x21')];_0xe0bd77['queuecallerjoinAt']=_0x38dc69[_0xc5d3('0x22')];_0xe0bd77[_0xc5d3('0x23')]=_0x38dc69[_0xc5d3('0x22')];_0xe0bd77['queuecallercomplete']=0x1;_0xe0bd77[_0xc5d3('0x24')]=_0x38dc69['endtime'];_0xe0bd77[_0xc5d3('0x25')]=_0x38dc69[_0xc5d3('0x26')];_0xe0bd77['context']=_0xc5d3('0x27');_0xe0bd77[_0xc5d3('0x28')]='xcally-motion-preview';_0xe0bd77[_0xc5d3('0x29')]=0x0;_0xe0bd77[_0xc5d3('0x2a')]=0x1;_0xe0bd77['lastAssignedTo']=_0x38dc69[_0xc5d3('0x26')];_0xe0bd77[_0xc5d3('0x2b')]=_0xc5d3('0x2c');return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](voiceQueueReport[_0xc5d3('0x2d')](_0xe0bd77))[_0xc5d3('0xa')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xc5d3('0x2e')]=function(_0xe1dd9e,_0x4d73aa){return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](cmHopper[_0xc5d3('0x2e')](_0xe1dd9e,_0x4d73aa))[_0xc5d3('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xc5d3('0x2f')]=function(_0x5426ab){return BPromise[_0xc5d3('0x7')]()[_0xc5d3('0x8')](cmHopper[_0xc5d3('0x15')](_0x5426ab,!![],!![]))[_0xc5d3('0xa')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0xa631=['active','countReScheduled','unlockContact','disableContact','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId'];(function(_0x457f4e,_0x2d1d0a){var _0x241e9a=function(_0x5d81e8){while(--_0x5d81e8){_0x457f4e['push'](_0x457f4e['shift']());}};_0x241e9a(++_0x2d1d0a);}(_0xa631,0x1ef));var _0x1a63=function(_0x5db7f6,_0xc69015){_0x5db7f6=_0x5db7f6-0x0;var _0x36cbd6=_0xa631[_0x5db7f6];return _0x36cbd6;};'use strict';var util=require(_0x1a63('0x0'));var BPromise=require(_0x1a63('0x1'));var logger=require(_0x1a63('0x2'))(_0x1a63('0x3'));var _=require('lodash');var cmHopper=require(_0x1a63('0x4'));var cmHopperFinal=require(_0x1a63('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x1a63('0x6'));var agentReportPreview=require(_0x1a63('0x7'));var voiceQueueReport=require(_0x1a63('0x8'));function loggerCatch(_0xd9b6eb){return function(_0x279bc8){logger[_0x1a63('0x9')](_0xd9b6eb,util[_0x1a63('0xa')](_0x279bc8,{'showHidden':![],'depth':null}));};}function create(_0x48bdb4){return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopperHistory[_0x1a63('0xd')](_0x48bdb4))[_0x1a63('0xe')](loggerCatch(_0x1a63('0xf')));}function createAgent(_0xaa7510){return BPromise[_0x1a63('0xb')]()['then'](agentReportPreview['createHistory'](_0xaa7510))[_0x1a63('0xe')](loggerCatch(_0x1a63('0xf')));}function moveContact(_0x39e315){return BPromise['resolve']()[_0x1a63('0xc')](cmHopper['moveContactManagedDialer'](_0x39e315,!![]))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x10')));}exports[_0x1a63('0x11')]=function(_0x4d28bf){return BPromise[_0x1a63('0xb')]()['then'](cmHopperBlack[_0x1a63('0x11')](_0x4d28bf))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x12')));};exports['getContactPreview']=function(_0x3d6c3a){return BPromise['resolve']()[_0x1a63('0xc')](cmHopper[_0x1a63('0x13')](_0x3d6c3a))['catch'](loggerCatch(_0x1a63('0x14')));};exports[_0x1a63('0xd')]=function(_0x4b7ee9,_0x1cf3cd){create(_0x4b7ee9)[_0x1a63('0xe')](loggerCatch(_0x1cf3cd));moveContact(_0x4b7ee9)[_0x1a63('0xe')](loggerCatch(_0x1cf3cd));};exports['createAgentHistory']=function(_0x1e6428,_0x3c9bd4){createAgent(_0x1e6428)[_0x1a63('0xe')](loggerCatch(_0x3c9bd4));};exports[_0x1a63('0x15')]=function(_0x1eb95d,_0x20bc38){create(_0x1eb95d)['catch'](loggerCatch(_0x20bc38));};exports[_0x1a63('0x16')]=function(_0x5363db,_0x4918ea){moveContact(_0x5363db)[_0x1a63('0xe')](loggerCatch(_0x4918ea));};exports[_0x1a63('0x17')]=function(_0x22038c,_0x45839d,_0x13cf68){if(_0x45839d){_0x22038c[_0x1a63('0x18')]=null;}if(_0x13cf68){_0x22038c[_0x1a63('0x19')]=![];}return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopper[_0x1a63('0x17')](_0x22038c))[_0x1a63('0xe')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x1a63('0x1a')]=function(_0x12c394){return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopper[_0x1a63('0x1a')](_0x12c394))[_0x1a63('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x1a63('0x1b')]=function(_0x22f243){return BPromise[_0x1a63('0xb')]()['then'](cmHopper[_0x1a63('0x1b')]({'UserId':null},_0x22f243,0x1))[_0x1a63('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x1a63('0x1c')]=function(_0x3a5972){return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopper[_0x1a63('0x1b')]({'active':![]},_0x3a5972,0x1))[_0x1a63('0xe')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x3ed830){var _0xa41330={};_0xa41330[_0x1a63('0x1d')]=_0x3ed830['type'];_0xa41330[_0x1a63('0x1e')]=_0x3ed830[_0x1a63('0x1e')];_0xa41330[_0x1a63('0x1f')]=_0x3ed830[_0x1a63('0x1f')];_0xa41330[_0x1a63('0x20')]=_0x3ed830[_0x1a63('0x20')];_0xa41330[_0x1a63('0x21')]=_0x3ed830[_0x1a63('0x21')];_0xa41330['queuecallerjoinAt']=_0x3ed830[_0x1a63('0x22')];_0xa41330[_0x1a63('0x23')]=_0x3ed830['answertime'];_0xa41330[_0x1a63('0x24')]=0x1;_0xa41330['queuecallercompleteAt']=_0x3ed830[_0x1a63('0x25')];_0xa41330[_0x1a63('0x26')]=_0x3ed830[_0x1a63('0x27')];_0xa41330[_0x1a63('0x28')]=_0x1a63('0x29');_0xa41330['exten']='xcally-motion-preview';_0xa41330[_0x1a63('0x2a')]=0x0;_0xa41330[_0x1a63('0x2b')]=0x1;_0xa41330['lastAssignedTo']=_0x3ed830['membername'];_0xa41330[_0x1a63('0x2c')]=_0x1a63('0x2d');return BPromise[_0x1a63('0xb')]()['then'](voiceQueueReport[_0x1a63('0x2e')](_0xa41330))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x2f')));};exports[_0x1a63('0x30')]=function(_0x51970a,_0xd8115b){return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopper[_0x1a63('0x30')](_0x51970a,_0xd8115b))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x31')));};exports[_0x1a63('0x32')]=function(_0x22fb3a){return BPromise[_0x1a63('0xb')]()['then'](cmHopper['rescheduleContact'](_0x22fb3a,!![],!![]))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x33')));};
\ No newline at end of file
index 57eb4c9..7e81cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75c7=['xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','extractCalleridName','match','util','lodash','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','logger','info','inspect','loggerError','error','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','addVariables','Queue','name','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','scheduledat','countnoanswerretry','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x75c7,0xa7));var _0x775c=function(_0x40d4f0,_0x20e4a1){_0x40d4f0=_0x40d4f0-0x0;var _0x45f7ea=_0x75c7[_0x40d4f0];return _0x45f7ea;};'use strict';var util=require(_0x775c('0x0'));var _=require(_0x775c('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x775c('0x2'));var ipAgi=process[_0x775c('0x3')]['XCALLY_IP_AGI']||_0x775c('0x4');function getSeconds(_0x3a6a42,_0x184cb7){var _0x276cb2=moment(_0x3a6a42)[_0x775c('0x5')](0x0);var _0x4674c8=moment(_0x184cb7)[_0x775c('0x5')](0x0);return _0x276cb2[_0x775c('0x6')](_0x4674c8,_0x775c('0x7'));}exports[_0x775c('0x8')]=function(_0x916c15){return function(_0xbf3e25){logger['error'](_0x916c15,util['inspect'](_0xbf3e25,{'showHidden':![],'depth':null}));};};exports[_0x775c('0x9')]=function(_0x4a07eb,_0x160b35){logger[_0x775c('0xa')](_0x4a07eb,util[_0x775c('0xb')](_0x160b35,{'showHidden':![],'depth':null}));};exports[_0x775c('0xc')]=function(_0x4e3bf9,_0x5aef71){logger[_0x775c('0xd')](_0x4e3bf9,util['inspect'](_0x5aef71,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x45845f){return function(_0x3ad747){logger[_0x775c('0xa')](_0x45845f,util[_0x775c('0xb')](_0x3ad747,{'showHidden':![],'depth':null}));};};exports[_0x775c('0xe')]=function(_0x11051b,_0x43a7a0,_0x1e7d6c){return{'message':_0x11051b,'unlock':_0x43a7a0,'active':_0x1e7d6c};};exports['getCallerId']=function(_0x507f1d,_0x5a9591,_0x10121e){if(!_[_0x775c('0xf')](_0x10121e)&&_0x775c('0x10')===typeof _0x10121e&&!_[_0x775c('0x11')](_0x10121e)){if(!_[_0x775c('0xf')](_0x5a9591)&&_0x775c('0x10')===typeof _0x5a9591&&!_[_0x775c('0x11')](_0x5a9591)){return util[_0x775c('0x12')](_0x775c('0x13'),_0x5a9591,_0x10121e);}return util[_0x775c('0x12')](_0x775c('0x13'),_0x10121e,_0x10121e);}if(!_[_0x775c('0xf')](_0x507f1d)&&_0x775c('0x10')===typeof _0x507f1d&&!_['isEmpty'](_0x507f1d)){return _0x507f1d;}return'\x22\x22\x20<>';};exports[_0x775c('0x14')]=function(_0x804280){if(_['isNil'](_0x804280)){return![];}return _0x804280;};exports[_0x775c('0x15')]=function(_0x4cf693,_0x37779e,_0x1750e6,_0x287756,_0x218dd7,_0x3c8d6f){var _0x4253d1={'XMD-QUEUE':_0x37779e[_0x775c('0x16')]?_0x37779e[_0x775c('0x16')][_0x775c('0x17')]:'','XMD-CALLERID':_0x287756,'XMD-CALLERID-PREVIEW':_0x3c8d6f?util[_0x775c('0x12')](_0x775c('0x13'),_0x3c8d6f['calleridname'],_0x3c8d6f[_0x775c('0x18')]):_0x287756,'XMD-DIALID':_0x218dd7,'XMD-CONTACTID':_0x37779e[_0x775c('0x19')],'XMD-CDRTYPE':_0x775c('0x1a'),'CALLERID(all)':_0x287756,'XMD-VOICEQUEUEID':_0x37779e['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1750e6,'XMD-DIALTIMEOUT':_0x4cf693[_0x775c('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x775c('0x12')](_0x775c('0x1c'),_0x4cf693[_0x775c('0x1d')]?'g':'',_['isEmpty'](_0x4cf693[_0x775c('0x1e')])?'':_0x775c('0x1f')),'XMD-DIALURL':_0x4cf693['dialPreviewUrl']||'','XMD-AGI':_0x4cf693[_0x775c('0x20')]?util[_0x775c('0x12')](_0x775c('0x21'),ipAgi,_0x4cf693['dialQueueProject']):_0x775c('0x22'),'XMD-AGIAFTER':_0x4cf693['dialQueueProject2']?util[_0x775c('0x12')](_0x775c('0x21'),ipAgi,_0x4cf693[_0x775c('0x1d')]):_0x775c('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x3c8d6f?_0x3c8d6f[_0x775c('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x3c8d6f?_0x3c8d6f[_0x775c('0x24')]:'','XMD-DESTINATION':_0x775c('0x25')};if(!_[_0x775c('0x11')](_0x4cf693[_0x775c('0x1e')])){_0x4253d1[util[_0x775c('0x12')]('%s',_0x775c('0x26'))]=_0x4cf693['monitor_format'];_0x4253d1[util['format']('%s',_0x775c('0x27'))]=_0x218dd7;}if(_0x37779e&&_0x37779e[_0x775c('0x28')]){for(var _0x3a770e in _0x37779e['Contact']){if(_0x37779e['Contact'][_0x775c('0x29')](_0x3a770e)){if(!_[_0x775c('0x2a')](_0x37779e[_0x775c('0x28')][_0x3a770e])&&_0x3a770e!=='id'&&_0x3a770e!==_0x775c('0x2b')&&_0x3a770e!==_0x775c('0x2c')&&_0x3a770e!==_0x775c('0x2d')){_0x4253d1[util['format'](_0x775c('0x2e'),_0x775c('0x2f'),_[_0x775c('0x30')](_0x3a770e))]=_0x37779e[_0x775c('0x28')][_0x3a770e];}}}}return _0x4253d1;};exports['toLowerVariables']=function(_0x44da66){var _0x83540f={};for(var _0x4ed573 in _0x44da66){if(_0x44da66[_0x775c('0x29')](_0x4ed573)){_0x83540f[util['format']('%s',_[_0x775c('0x31')](_0x4ed573))]=_0x44da66[_0x4ed573];}}return{'variables':_0x83540f};};exports['updateOriginated']=function(_0xe9a6c8,_0x54cd0a){if(!_['isNil'](_0xe9a6c8)){if(_0xe9a6c8[_0x775c('0x29')](_0x775c('0x32'))){if(_0xe9a6c8[_0x775c('0x32')]>0x0){_0xe9a6c8[_0x775c('0x32')]-=0x1;}else{logger[_0x775c('0xd')](_0x775c('0x33'),_0x54cd0a);}}}else{logger[_0x775c('0xd')](_0x775c('0x34'),_0x54cd0a);}};exports[_0x775c('0x35')]=function(_0x2be70b){var _0x4b8e7e=moment()[_0x775c('0x12')](_0x775c('0x36'));_0x2be70b[_0x775c('0x37')]=0xd;_0x2be70b[_0x775c('0x38')]=_0x775c('0x39');_0x2be70b[_0x775c('0x3a')]=_0x4b8e7e;_0x2be70b[_0x775c('0x3b')]=_0x4b8e7e;_0x2be70b[_0x775c('0x3c')]=_0x4b8e7e;};exports[_0x775c('0x3d')]=function(_0x33d4c2,_0x2fc148,_0xd23fba){var _0x5cf4cc=moment()[_0x775c('0x12')](_0x775c('0x36'));_0x33d4c2['state']=_0x2fc148;_0x33d4c2[_0x775c('0x38')]=_0xd23fba;_0x33d4c2[_0x775c('0x3b')]=_0x5cf4cc;_0x33d4c2[_0x775c('0x3e')]=getSeconds(_0x33d4c2[_0x775c('0x3b')],_0x33d4c2[_0x775c('0x3a')]);};exports[_0x775c('0x3f')]=function(_0xc6e7de,_0x4eb5a1,_0x19d671){_0xc6e7de[_0x775c('0x40')]=_0x4eb5a1;_0xc6e7de[_0x775c('0x41')]=_0x19d671;};exports[_0x775c('0x42')]=function(_0x3bcc50,_0x58d605,_0x115431){var _0x21c451=moment()['format'](_0x775c('0x36'));_0x3bcc50[_0x775c('0x37')]=_0x58d605;_0x3bcc50[_0x775c('0x38')]=_0x115431;_0x3bcc50[_0x775c('0x3b')]=_0x3bcc50[_0x775c('0x3b')]?_0x3bcc50['responsetime']:_0x21c451;_0x3bcc50[_0x775c('0x3c')]=_0x3bcc50[_0x775c('0x3c')]?_0x3bcc50['endtime']:_0x21c451;_0x3bcc50[_0x775c('0x3e')]=getSeconds(_0x3bcc50[_0x775c('0x3b')]||0x0,_0x3bcc50[_0x775c('0x3a')]||0x0);_0x3bcc50[_0x775c('0x43')]=_0x3bcc50[_0x775c('0x44')]?getSeconds(_0x3bcc50[_0x775c('0x3c')],_0x3bcc50[_0x775c('0x44')]):0x0;};exports[_0x775c('0x45')]=function(_0x1fe333){return _0x1fe333==='Failure';};exports[_0x775c('0x46')]=function(_0x1ce226,_0x10afbb,_0x8dec77,_0x452d8d,_0x511842){var _0x30ce86=_0x452d8d?_0x775c('0x47'):_0x1ce226[_0x775c('0x48')];_0x30ce86=_0x511842?_0x775c('0x49'):_0x30ce86;return{'actionid':_0x1ce226[_0x775c('0x4a')],'action':'originate','channel':_0x1ce226[_0x775c('0x4b')],'callerid':util[_0x775c('0x12')](_0x775c('0x13'),_0x30ce86,_0x1ce226[_0x775c('0x18')]),'Exten':_0x775c('0x25'),'Context':'from-sip','Priority':'1','variable':_0x8dec77,'timeout':(_0x10afbb[_0x775c('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1ce226[_0x775c('0x4a')]};};exports[_0x775c('0x4d')]=function(_0x30250b){return _0x30250b[_0x775c('0x4e')]+_0x30250b[_0x775c('0x4f')]+_0x30250b['countnoanswerretry']+_0x30250b[_0x775c('0x50')]+_0x30250b[_0x775c('0x51')];};exports[_0x775c('0x52')]=function(_0x26bca6){var _0x8eecbf=_[_0x775c('0x53')](_0x26bca6);_0x8eecbf[_0x775c('0x37')]=0xf;_0x8eecbf[_0x775c('0x38')]=_0x775c('0x54');return _0x8eecbf;};exports[_0x775c('0x55')]=function(_0x426a70,_0x1b1e63,_0x36ce88){var _0x24f8ad={};_0x24f8ad[_0x1b1e63]=_0x426a70[_0x1b1e63];_0x24f8ad['active']=![];_0x24f8ad['scheduledat']=moment()['add'](_0x36ce88,_0x775c('0x56'))['format'](_0x775c('0x36'));_0x24f8ad[_0x775c('0x19')]=_0x426a70['ContactId'];_0x24f8ad[_0x775c('0x57')]=_0x426a70[_0x775c('0x57')];_0x24f8ad[_0x775c('0x58')]=_0x426a70['VoiceQueueId']||undefined;return _0x24f8ad;};exports[_0x775c('0x59')]=function(_0x2e6250,_0x3c95ca){if(!_[_0x775c('0x2a')](_0x2e6250)){if(_0x2e6250['pTalking']>0x0){_0x2e6250[_0x775c('0x5a')]-=0x1;}else{logger[_0x775c('0xd')](_0x3c95ca,_0x775c('0x5b'));}}else{logger[_0x775c('0xd')](_0x3c95ca,_0x775c('0x5c'));}};exports[_0x775c('0x5d')]=function(_0x34c51b){if(_0x34c51b<=0x0){return!![];}return![];};exports[_0x775c('0x5e')]=function(_0x30d7b8,_0x2777d6,_0x16c6ca){_0x30d7b8['lastevent']=_0x2777d6;_0x30d7b8[_0x775c('0x17')]=_0x30d7b8['queue'];_0x30d7b8[_0x775c('0x5f')]=_0x30d7b8['channelAgent'];_0x30d7b8[_0x775c('0x60')]=_0x775c('0x61');if(_0x16c6ca){_0x30d7b8[_0x775c('0x62')]=_0x16c6ca['mandatoryDisposition'];}return _0x30d7b8;};exports[_0x775c('0x63')]=function(_0x5d3508){var _0x5ed4fa={};_0x5ed4fa[_0x775c('0x64')]=_0x5d3508[_0x775c('0x64')];_0x5ed4fa['interface']=_0x5d3508[_0x775c('0x4b')];_0x5ed4fa[_0x775c('0x4a')]=_0x5d3508[_0x775c('0x4a')];return _0x5ed4fa;};exports[_0x775c('0x65')]=function(_0x5195b4){var _0x5ddde1=[];for(var _0x2e5cdb in _0x5195b4){if(_0x5195b4[_0x775c('0x29')](_0x2e5cdb)){if(!_[_0x775c('0x2a')](_0x5195b4[_0x2e5cdb])&&_0x5195b4[_0x2e5cdb]['state']===_0x775c('0x66')&&_0x5195b4[_0x2e5cdb][_0x775c('0x67')]===_0x775c('0x68')){_0x5ddde1[_0x775c('0x69')](_0x5195b4[_0x2e5cdb]['id']);}}}return _0x5ddde1;};exports[_0x775c('0x6a')]=function(_0x25618e){var _0x2cb9e6=moment()[_0x775c('0x5')](0x0);var _0x1549b3=moment(_0x25618e)['milliseconds'](0x0);return _0x2cb9e6[_0x775c('0x6')](_0x1549b3,_0x775c('0x7'));};exports['createBody']=function(_0x35cf84){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x35cf84[_0x775c('0x19')],'ListId':_0x35cf84['ListId'],'VoiceQueueId':_0x35cf84['VoiceQueueId']||undefined,'CampaignId':_0x35cf84[_0x775c('0x6b')]||undefined};};exports[_0x775c('0x6c')]=function(_0xb034b9){if(_0xb034b9==='uniqueid'||_0xb034b9===_0x775c('0x6d')||_0xb034b9===_0x775c('0x64')||_0xb034b9===_0x775c('0x6e')||_0xb034b9===_0x775c('0x6f')||_0xb034b9===_0x775c('0x70')||_0xb034b9===_0x775c('0x40')||_0xb034b9===_0x775c('0x4b')||_0xb034b9==='calleridname'||_0xb034b9===_0x775c('0x71')||_0xb034b9===_0x775c('0x18')||_0xb034b9===_0x775c('0x72')||_0xb034b9===_0x775c('0x4e')||_0xb034b9==='countcongestionretry'||_0xb034b9===_0x775c('0x73')||_0xb034b9==='countglobal'||_0xb034b9===_0x775c('0x74')||_0xb034b9===_0x775c('0x75')||_0xb034b9===_0x775c('0x76')||_0xb034b9===_0x775c('0x77')||_0xb034b9===_0x775c('0x19')||_0xb034b9===_0x775c('0x57')||_0xb034b9==='UserId'||_0xb034b9===_0x775c('0x58')||_0xb034b9===_0x775c('0x78')||_0xb034b9===_0x775c('0x79')||_0xb034b9===_0x775c('0x7a')||_0xb034b9===_0x775c('0x7b')||_0xb034b9===_0x775c('0x7c')||_0xb034b9===_0x775c('0x7d')||_0xb034b9===_0x775c('0x7e')||_0xb034b9===_0x775c('0x7f')||_0xb034b9==='xmd-dialid'||_0xb034b9===_0x775c('0x80')||_0xb034b9===_0x775c('0x81')||_0xb034b9===_0x775c('0x82')||_0xb034b9===_0x775c('0x83')||_0xb034b9==='xmd-agiafter'||_0xb034b9==='xmd-agi'||_0xb034b9===_0x775c('0x84')||_0xb034b9===_0x775c('0x85')||_0xb034b9===_0x775c('0x86')||_0xb034b9===_0x775c('0x87')||_0xb034b9==='rtpaudioqosloss'||_0xb034b9===_0x775c('0x88')||_0xb034b9===_0x775c('0x89')||_0xb034b9===_0x775c('0x8a')||_0xb034b9==='rtpaudioqos'||_0xb034b9===_0x775c('0x85')||_0xb034b9==='rtpaudioqosjitter'||_0xb034b9===_0x775c('0x87')||_0xb034b9===_0x775c('0x8b')||_0xb034b9===_0x775c('0x88')||_0xb034b9===_0x775c('0x89')||_0xb034b9===_0x775c('0x8a')||_0xb034b9===_0x775c('0x8c')||_0xb034b9===_0x775c('0x8d')||_0xb034b9===_0x775c('0x37')||_0xb034b9===_0x775c('0x38')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x146b74,_0x38083f){var _0x57de9e,_0x3d5938,_0x34b060;if(_0x38083f<=0x0){_0x38083f=0x1;}_0x57de9e=new RegExp(_0x775c('0x8e')+_0x38083f+'}$');_0x3d5938=Math[_0x775c('0x8f')](0xa,_0x38083f-0x1);_0x34b060=Math['pow'](0xa,_0x38083f)-0x1;return util[_0x775c('0x12')]('%s',_['replace'](_0x146b74,_0x57de9e,_['random'](_0x3d5938,_0x34b060)));};exports[_0x775c('0x90')]=function(_0xfdc4a8){var _0x548b37=_0xfdc4a8[_0x775c('0x91')](/"(.*?)"/);return _0x548b37?_0x548b37[0x1]:_0xfdc4a8;};exports['extractCalleridNumber']=function(_0x557e18){var _0x46b0e6=_0x557e18[_0x775c('0x91')](/<(.*?)>/);return _0x46b0e6?_0x46b0e6[0x1]:_0x557e18;};
\ No newline at end of file
+var _0xb253=['xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','pow','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','UserId','state','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','status','getDiff','createBody','CampaignId','type','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone'];(function(_0x1dbc19,_0x2f9325){var _0x27a824=function(_0x470249){while(--_0x470249){_0x1dbc19['push'](_0x1dbc19['shift']());}};_0x27a824(++_0x2f9325);}(_0xb253,0xa1));var _0x3b25=function(_0x1ccf4f,_0x18ce33){_0x1ccf4f=_0x1ccf4f-0x0;var _0x3f747c=_0xb253[_0x1ccf4f];return _0x3f747c;};'use strict';var util=require(_0x3b25('0x0'));var _=require(_0x3b25('0x1'));var moment=require(_0x3b25('0x2'));var logger=require(_0x3b25('0x3'))('preview');var ipAgi=process[_0x3b25('0x4')][_0x3b25('0x5')]||_0x3b25('0x6');function getSeconds(_0x36c78f,_0x5cde59){var _0x230f03=moment(_0x36c78f)[_0x3b25('0x7')](0x0);var _0x3afa5e=moment(_0x5cde59)['milliseconds'](0x0);return _0x230f03[_0x3b25('0x8')](_0x3afa5e,_0x3b25('0x9'));}exports[_0x3b25('0xa')]=function(_0x27001f){return function(_0x583aee){logger[_0x3b25('0xb')](_0x27001f,util[_0x3b25('0xc')](_0x583aee,{'showHidden':![],'depth':null}));};};exports[_0x3b25('0xd')]=function(_0x2c3ef9,_0x17a96f){logger[_0x3b25('0xe')](_0x2c3ef9,util['inspect'](_0x17a96f,{'showHidden':![],'depth':null}));};exports[_0x3b25('0xf')]=function(_0x28cac5,_0x46341d){logger[_0x3b25('0xb')](_0x28cac5,util['inspect'](_0x46341d,{'showHidden':![],'depth':null}));};exports[_0x3b25('0x10')]=function(_0x242a9b){return function(_0x4cafe9){logger[_0x3b25('0xe')](_0x242a9b,util[_0x3b25('0xc')](_0x4cafe9,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x54f3e5,_0x353b7a,_0x2be187){return{'message':_0x54f3e5,'unlock':_0x353b7a,'active':_0x2be187};};exports[_0x3b25('0x11')]=function(_0xf79525,_0x160b39,_0xd5c5bd){if(!_[_0x3b25('0x12')](_0xd5c5bd)&&_0x3b25('0x13')===typeof _0xd5c5bd&&!_['isEmpty'](_0xd5c5bd)){if(!_['isUndefined'](_0x160b39)&&_0x3b25('0x13')===typeof _0x160b39&&!_[_0x3b25('0x14')](_0x160b39)){return util['format'](_0x3b25('0x15'),_0x160b39,_0xd5c5bd);}return util[_0x3b25('0x16')](_0x3b25('0x15'),_0xd5c5bd,_0xd5c5bd);}if(!_['isUndefined'](_0xf79525)&&'string'===typeof _0xf79525&&!_[_0x3b25('0x14')](_0xf79525)){return _0xf79525;}return _0x3b25('0x17');};exports[_0x3b25('0x18')]=function(_0x42c475){if(_[_0x3b25('0x19')](_0x42c475)){return![];}return _0x42c475;};exports[_0x3b25('0x1a')]=function(_0x222c16,_0x2940fc,_0x17337e,_0x32bf0b,_0x374445,_0x2cd207){var _0x5bf272={'XMD-QUEUE':_0x2940fc[_0x3b25('0x1b')]?_0x2940fc['Queue'][_0x3b25('0x1c')]:'','XMD-CALLERID':_0x32bf0b,'XMD-CALLERID-PREVIEW':_0x2cd207?util[_0x3b25('0x16')]('\x22%s\x22\x20<%s>',_0x2cd207[_0x3b25('0x1d')],_0x2cd207[_0x3b25('0x1e')]):_0x32bf0b,'XMD-DIALID':_0x374445,'XMD-CONTACTID':_0x2940fc[_0x3b25('0x1f')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x32bf0b,'XMD-VOICEQUEUEID':_0x2940fc[_0x3b25('0x20')],'XMD-DIALCHANNEL':_0x17337e,'XMD-DIALTIMEOUT':_0x222c16[_0x3b25('0x21')]||0x1e,'XMD-DIALOPTIONS':util[_0x3b25('0x16')](_0x3b25('0x22'),_0x222c16[_0x3b25('0x23')]?'g':'',_[_0x3b25('0x14')](_0x222c16[_0x3b25('0x24')])?'':_0x3b25('0x25')),'XMD-DIALURL':_0x222c16['dialPreviewUrl']||'','XMD-AGI':_0x222c16[_0x3b25('0x26')]?util[_0x3b25('0x16')](_0x3b25('0x27'),ipAgi,_0x222c16[_0x3b25('0x26')]):_0x3b25('0x28'),'XMD-AGIAFTER':_0x222c16['dialQueueProject2']?util[_0x3b25('0x16')](_0x3b25('0x27'),ipAgi,_0x222c16[_0x3b25('0x23')]):_0x3b25('0x28'),'XMD-ORIGINATECALLERIDNUM':_0x2cd207?_0x2cd207[_0x3b25('0x29')]:'','XMD-ORIGINATECALLERIDNAME':_0x2cd207?_0x2cd207[_0x3b25('0x2a')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x3b25('0x14')](_0x222c16[_0x3b25('0x24')])){_0x5bf272[util[_0x3b25('0x16')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x222c16[_0x3b25('0x24')];_0x5bf272[util[_0x3b25('0x16')]('%s',_0x3b25('0x2b'))]=_0x374445;}if(_0x2940fc&&_0x2940fc[_0x3b25('0x2c')]){for(var _0x4c9f9c in _0x2940fc[_0x3b25('0x2c')]){if(_0x2940fc[_0x3b25('0x2c')]['hasOwnProperty'](_0x4c9f9c)){if(!_[_0x3b25('0x19')](_0x2940fc[_0x3b25('0x2c')][_0x4c9f9c])&&_0x4c9f9c!=='id'&&_0x4c9f9c!==_0x3b25('0x2d')&&_0x4c9f9c!==_0x3b25('0x2e')&&_0x4c9f9c!==_0x3b25('0x2f')){_0x5bf272[util[_0x3b25('0x16')](_0x3b25('0x30'),_0x3b25('0x31'),_['toUpper'](_0x4c9f9c))]=_0x2940fc[_0x3b25('0x2c')][_0x4c9f9c];}}}}return _0x5bf272;};exports['toLowerVariables']=function(_0x4d180a){var _0x26429d={};for(var _0x3d2cd3 in _0x4d180a){if(_0x4d180a[_0x3b25('0x32')](_0x3d2cd3)){_0x26429d[util[_0x3b25('0x16')]('%s',_[_0x3b25('0x33')](_0x3d2cd3))]=_0x4d180a[_0x3d2cd3];}}return{'variables':_0x26429d};};exports[_0x3b25('0x34')]=function(_0x53b4d4,_0x307245){if(!_[_0x3b25('0x19')](_0x53b4d4)){if(_0x53b4d4[_0x3b25('0x32')](_0x3b25('0x35'))){if(_0x53b4d4['originated']>0x0){_0x53b4d4['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x307245);}}}else{logger[_0x3b25('0xb')](_0x3b25('0x36'),_0x307245);}};exports[_0x3b25('0x37')]=function(_0x471f2c){var _0x3590a4=moment()[_0x3b25('0x16')]('YYYY-MM-DD\x20HH:mm:ss');_0x471f2c['state']=0xd;_0x471f2c[_0x3b25('0x38')]='Blacklist';_0x471f2c[_0x3b25('0x39')]=_0x3590a4;_0x471f2c[_0x3b25('0x3a')]=_0x3590a4;_0x471f2c[_0x3b25('0x3b')]=_0x3590a4;};exports[_0x3b25('0x3c')]=function(_0x213b41,_0x35ce06,_0x269a80){var _0x3d88d0=moment()[_0x3b25('0x16')](_0x3b25('0x3d'));_0x213b41['state']=_0x35ce06;_0x213b41['statedesc']=_0x269a80;_0x213b41[_0x3b25('0x3a')]=_0x3d88d0;_0x213b41[_0x3b25('0x3e')]=getSeconds(_0x213b41[_0x3b25('0x3a')],_0x213b41[_0x3b25('0x39')]);};exports['logLookAgent']=function(_0x12fa64,_0x12812b,_0x492902){_0x12fa64[_0x3b25('0x3f')]=_0x12812b;_0x12fa64[_0x3b25('0x40')]=_0x492902;};exports['logCustomer']=function(_0x165c90,_0x5e6164,_0xb1b5be){var _0x529f89=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x165c90[_0x3b25('0x41')]=_0x5e6164;_0x165c90[_0x3b25('0x38')]=_0xb1b5be;_0x165c90[_0x3b25('0x3a')]=_0x165c90[_0x3b25('0x3a')]?_0x165c90[_0x3b25('0x3a')]:_0x529f89;_0x165c90[_0x3b25('0x3b')]=_0x165c90[_0x3b25('0x3b')]?_0x165c90[_0x3b25('0x3b')]:_0x529f89;_0x165c90[_0x3b25('0x3e')]=getSeconds(_0x165c90[_0x3b25('0x3a')]||0x0,_0x165c90['starttime']||0x0);_0x165c90[_0x3b25('0x42')]=_0x165c90['answertime']?getSeconds(_0x165c90[_0x3b25('0x3b')],_0x165c90[_0x3b25('0x43')]):0x0;};exports[_0x3b25('0x44')]=function(_0x2fba11){return _0x2fba11===_0x3b25('0x45');};exports[_0x3b25('0x46')]=function(_0x157976,_0x4a53d9,_0x48167d,_0x17f10b,_0x3e4ab2){var _0x264d28=_0x17f10b?'RECALL':_0x157976[_0x3b25('0x1d')];_0x264d28=_0x3e4ab2?'BOOKED':_0x264d28;return{'actionid':_0x157976[_0x3b25('0x47')],'action':_0x3b25('0x48'),'channel':_0x157976[_0x3b25('0x49')],'callerid':util[_0x3b25('0x16')](_0x3b25('0x15'),_0x264d28,_0x157976[_0x3b25('0x1e')]),'Exten':'xcally-motion-preview','Context':_0x3b25('0x4a'),'Priority':'1','variable':_0x48167d,'timeout':(_0x4a53d9['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x157976[_0x3b25('0x47')]};};exports[_0x3b25('0x4b')]=function(_0x311c49){return _0x311c49[_0x3b25('0x4c')]+_0x311c49['countcongestionretry']+_0x311c49['countnoanswerretry']+_0x311c49[_0x3b25('0x4d')]+_0x311c49[_0x3b25('0x4e')];};exports[_0x3b25('0x4f')]=function(_0x1d6b08){var _0x23951b=_[_0x3b25('0x50')](_0x1d6b08);_0x23951b[_0x3b25('0x41')]=0xf;_0x23951b[_0x3b25('0x38')]=_0x3b25('0x51');return _0x23951b;};exports[_0x3b25('0x52')]=function(_0x4a2cc2,_0xd0f4b7,_0x4949b3){var _0x4e973f={};_0x4e973f[_0xd0f4b7]=_0x4a2cc2[_0xd0f4b7];_0x4e973f['active']=![];_0x4e973f[_0x3b25('0x53')]=moment()[_0x3b25('0x54')](_0x4949b3,'minutes')[_0x3b25('0x16')](_0x3b25('0x3d'));_0x4e973f[_0x3b25('0x1f')]=_0x4a2cc2[_0x3b25('0x1f')];_0x4e973f[_0x3b25('0x55')]=_0x4a2cc2[_0x3b25('0x55')];_0x4e973f['VoiceQueueId']=_0x4a2cc2['VoiceQueueId']||undefined;return _0x4e973f;};exports[_0x3b25('0x56')]=function(_0x18858c,_0x1853e4){if(!_[_0x3b25('0x19')](_0x18858c)){if(_0x18858c[_0x3b25('0x57')]>0x0){_0x18858c['pTalking']-=0x1;}else{logger[_0x3b25('0xb')](_0x1853e4,_0x3b25('0x58'));}}else{logger['error'](_0x1853e4,_0x3b25('0x59'));}};exports[_0x3b25('0x5a')]=function(_0x2cc33d){if(_0x2cc33d<=0x0){return!![];}return![];};exports[_0x3b25('0x5b')]=function(_0x380fb8,_0xf96456,_0x5dfd24){_0x380fb8[_0x3b25('0x5c')]=_0xf96456;_0x380fb8['name']=_0x380fb8[_0x3b25('0x5d')];_0x380fb8['interface']=_0x380fb8[_0x3b25('0x49')];_0x380fb8[_0x3b25('0x5e')]=_0x3b25('0x5f');if(_0x5dfd24){_0x380fb8[_0x3b25('0x60')]=_0x5dfd24[_0x3b25('0x60')];}return _0x380fb8;};exports[_0x3b25('0x61')]=function(_0x179fc1){var _0x502f81={};_0x502f81[_0x3b25('0x5d')]=_0x179fc1[_0x3b25('0x5d')];_0x502f81[_0x3b25('0x62')]=_0x179fc1[_0x3b25('0x49')];_0x502f81[_0x3b25('0x47')]=_0x179fc1['uniqueid'];return _0x502f81;};exports[_0x3b25('0x63')]=function(_0x19f52f){var _0x77e97e=[];for(var _0x30948a in _0x19f52f){if(_0x19f52f[_0x3b25('0x32')](_0x30948a)){if(!_[_0x3b25('0x19')](_0x19f52f[_0x30948a])&&_0x19f52f[_0x30948a][_0x3b25('0x41')]===_0x3b25('0x64')&&_0x19f52f[_0x30948a][_0x3b25('0x65')]==='reachable'){_0x77e97e['push'](_0x19f52f[_0x30948a]['id']);}}}return _0x77e97e;};exports[_0x3b25('0x66')]=function(_0x366278){var _0x4c2a84=moment()[_0x3b25('0x7')](0x0);var _0x586e3f=moment(_0x366278)[_0x3b25('0x7')](0x0);return _0x4c2a84[_0x3b25('0x8')](_0x586e3f,'seconds');};exports[_0x3b25('0x67')]=function(_0x293626){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x293626[_0x3b25('0x1f')],'ListId':_0x293626[_0x3b25('0x55')],'VoiceQueueId':_0x293626[_0x3b25('0x20')]||undefined,'CampaignId':_0x293626[_0x3b25('0x68')]||undefined};};exports['filterKey']=function(_0x389681){if(_0x389681===_0x3b25('0x47')||_0x389681==='idContact'||_0x389681===_0x3b25('0x5d')||_0x389681===_0x3b25('0x69')||_0x389681==='campaigntype'||_0x389681==='dialAnswer'||_0x389681===_0x3b25('0x3f')||_0x389681===_0x3b25('0x49')||_0x389681===_0x3b25('0x1d')||_0x389681==='active'||_0x389681==='calleridnum'||_0x389681===_0x3b25('0x53')||_0x389681===_0x3b25('0x4c')||_0x389681===_0x3b25('0x6a')||_0x389681===_0x3b25('0x6b')||_0x389681===_0x3b25('0x6c')||_0x389681===_0x3b25('0x6d')||_0x389681===_0x3b25('0x6e')||_0x389681===_0x3b25('0x6f')||_0x389681==='recallme'||_0x389681===_0x3b25('0x1f')||_0x389681===_0x3b25('0x55')||_0x389681==='UserId'||_0x389681==='VoiceQueueId'||_0x389681===_0x3b25('0x70')||_0x389681==='xmd-voicequeueid'||_0x389681===_0x3b25('0x71')||_0x389681===_0x3b25('0x72')||_0x389681==='xmd-listid'||_0x389681===_0x3b25('0x73')||_0x389681===_0x3b25('0x74')||_0x389681===_0x3b25('0x75')||_0x389681===_0x3b25('0x76')||_0x389681===_0x3b25('0x77')||_0x389681===_0x3b25('0x78')||_0x389681===_0x3b25('0x79')||_0x389681==='xmd-callerid'||_0x389681===_0x3b25('0x7a')||_0x389681===_0x3b25('0x7b')||_0x389681===_0x3b25('0x7c')||_0x389681===_0x3b25('0x7d')||_0x389681===_0x3b25('0x7e')||_0x389681===_0x3b25('0x7f')||_0x389681===_0x3b25('0x80')||_0x389681===_0x3b25('0x81')||_0x389681===_0x3b25('0x82')||_0x389681===_0x3b25('0x83')||_0x389681===_0x3b25('0x7c')||_0x389681===_0x3b25('0x7d')||_0x389681===_0x3b25('0x7e')||_0x389681===_0x3b25('0x7f')||_0x389681===_0x3b25('0x80')||_0x389681===_0x3b25('0x81')||_0x389681===_0x3b25('0x82')||_0x389681===_0x3b25('0x83')||_0x389681===_0x3b25('0x84')||_0x389681===_0x3b25('0x85')||_0x389681===_0x3b25('0x41')||_0x389681===_0x3b25('0x38')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x55b3d1,_0x257695){var _0x16b558,_0x5cac28,_0x5b5c54;if(_0x257695<=0x0){_0x257695=0x1;}_0x16b558=new RegExp('\x5cw{0,'+_0x257695+'}$');_0x5cac28=Math[_0x3b25('0x86')](0xa,_0x257695-0x1);_0x5b5c54=Math[_0x3b25('0x86')](0xa,_0x257695)-0x1;return util[_0x3b25('0x16')]('%s',_['replace'](_0x55b3d1,_0x16b558,_[_0x3b25('0x87')](_0x5cac28,_0x5b5c54)));};exports[_0x3b25('0x88')]=function(_0x37038f){var _0x39e1bf=_0x37038f[_0x3b25('0x89')](/"(.*?)"/);return _0x39e1bf?_0x39e1bf[0x1]:_0x37038f;};exports['extractCalleridNumber']=function(_0x131e8b){var _0x25980a=_0x131e8b[_0x3b25('0x89')](/<(.*?)>/);return _0x25980a?_0x25980a[0x1]:_0x131e8b;};
\ No newline at end of file
index 24fb5a1..bac47d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x500d=['number','queuepause','boolean','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x500d,0xf7));var _0xd500=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x500d[_0x507ac5];return _0x12c1bc;};'use strict';exports['queueadd']={'queue':{'type':_0xd500('0x0'),'required':!![]},'interface':{'type':_0xd500('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xd500('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xd500('0x0'),'required':!![]},'interface':{'type':_0xd500('0x0'),'required':!![]}};exports[_0xd500('0x2')]={'interface':{'type':_0xd500('0x0'),'required':!![]},'paused':{'type':_0xd500('0x3')},'reason':{'type':_0xd500('0x0'),'required':![]}};exports[_0xd500('0x4')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xd500('0x0'),'required':!![]}};exports[_0xd500('0x5')]={'uniqueid':{'type':_0xd500('0x0'),'required':!![]},'filename':{'type':_0xd500('0x0')},'format':{'type':_0xd500('0x0')},'mixmonitorid':{'type':_0xd500('0x0')}};exports[_0xd500('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xd500('0x7')]={'uniqueid':{'type':_0xd500('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xd500('0x0')}};
\ No newline at end of file
+var _0x175e=['queuepause','boolean','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string','number'];(function(_0x421b7b,_0x566ee9){var _0x2c472c=function(_0x4649b0){while(--_0x4649b0){_0x421b7b['push'](_0x421b7b['shift']());}};_0x2c472c(++_0x566ee9);}(_0x175e,0xd5));var _0xe175=function(_0x4d60a3,_0x466dcd){_0x4d60a3=_0x4d60a3-0x0;var _0xeb2bc8=_0x175e[_0x4d60a3];return _0xeb2bc8;};'use strict';exports[_0xe175('0x0')]={'queue':{'type':_0xe175('0x1'),'required':!![]},'interface':{'type':_0xe175('0x1'),'required':!![]},'membername':{'type':_0xe175('0x1'),'required':!![]},'penalty':{'type':_0xe175('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xe175('0x1'),'required':!![]}};exports[_0xe175('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xe175('0x4')},'reason':{'type':_0xe175('0x1'),'required':![]}};exports[_0xe175('0x5')]={'module':{'type':_0xe175('0x1'),'required':![]}};exports[_0xe175('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xe175('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xe175('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xe175('0x7')]={'uniqueid':{'type':_0xe175('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xe175('0x1'),'required':!![]},'exten':{'type':_0xe175('0x1'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
index 8c7e9c5..d352ad6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef1b=['initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','sumDuration','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isUndefined','mergeFromDatabase','initTrunks','initVoiceQueues','initTriggers','initTemplates','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','merge','abandoned','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject'];(function(_0x48e730,_0x13101f){var _0x18e99e=function(_0x598462){while(--_0x598462){_0x48e730['push'](_0x48e730['shift']());}};_0x18e99e(++_0x13101f);}(_0xef1b,0x6b));var _0xbef1=function(_0x47090a,_0x242312){_0x47090a=_0x47090a-0x0;var _0x309715=_0xef1b[_0x47090a];return _0x309715;};'use strict';var BPromise=require('bluebird');var util=require(_0xbef1('0x0'));var _=require('lodash');var moment=require(_0xbef1('0x1'));var Agent=require(_0xbef1('0x2'));var Telephone=require(_0xbef1('0x3'));var Trunk=require(_0xbef1('0x4'));var VoiceQueue=require(_0xbef1('0x5'));var Trigger=require(_0xbef1('0x6'));var Template=require(_0xbef1('0x7'));var Campaign=require(_0xbef1('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xbef1('0x9'));var SalesforceAccount=require(_0xbef1('0xa'));var FreshdeskAccount=require(_0xbef1('0xb'));var SugarcrmAccount=require(_0xbef1('0xc'));var ZohoAccount=require(_0xbef1('0xd'));var DeskAccount=require(_0xbef1('0xe'));var VtigerAccount=require(_0xbef1('0xf'));var ServicenowAccount=require(_0xbef1('0x10'));var Dynamics365Account=require(_0xbef1('0x11'));var FreshsalesAccount=require(_0xbef1('0x12'));var FaxAccount=require(_0xbef1('0x13'));var Realtime=function(){this[_0xbef1('0x14')]={};this[_0xbef1('0x15')]={};this[_0xbef1('0x16')]={};this[_0xbef1('0x17')]={};this[_0xbef1('0x18')]={};this[_0xbef1('0x19')]={};this[_0xbef1('0x1a')]={};this[_0xbef1('0x1b')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xbef1('0x1c')]={};this[_0xbef1('0x1d')]={};this[_0xbef1('0x1e')]={};this[_0xbef1('0x1f')]={};this['settings']={};this[_0xbef1('0x20')]={};this[_0xbef1('0x21')]={};this[_0xbef1('0x22')]={};this['freshdeskAccounts']={};this[_0xbef1('0x23')]={};this['deskAccounts']={};this[_0xbef1('0x24')]={};this[_0xbef1('0x25')]={};this[_0xbef1('0x26')]={};this[_0xbef1('0x27')]={};this[_0xbef1('0x28')]={};};function freeIsNotKey(_0x42544a,_0x4cbccb,_0x3348f2){var _0xab6e7f=_[_0xbef1('0x29')](_0x42544a,function(_0x5378a0,_0x7432b4){return _0x5378a0[_0x3348f2];});for(var _0x29a79c in _0x4cbccb){if(_0x4cbccb[_0xbef1('0x2a')](_0x29a79c)){if(!_0xab6e7f[_0x29a79c]){delete _0x4cbccb[_0x29a79c];}}}}function freeIsNotKeySip(_0x12e64e,_0x5b3fc5){var _0x3a9b7a=_[_0xbef1('0x29')](_0x12e64e,function(_0x573a8d,_0x2cc88d){return util[_0xbef1('0x2b')](_0xbef1('0x2c'),_0x573a8d[_0xbef1('0x2d')]);});for(var _0x1bb838 in _0x5b3fc5){if(_0x5b3fc5['hasOwnProperty'](_0x1bb838)){if(!_0x3a9b7a[_0x1bb838]){delete _0x5b3fc5[_0x1bb838];}}}}function freeIsNotKeyAgent(_0x462bdb,_0x5d2d7f){var _0x19a5a3=_[_0xbef1('0x29')](_0x462bdb,function(_0x390e36,_0x8f787a){var _0x5b507e=_['isNil'](_0x390e36['interface'])?util['format'](_0xbef1('0x2c'),_0x390e36['name']):_0x390e36[_0xbef1('0x2e')];return _0x5b507e;});for(var _0x606783 in _0x5d2d7f){if(_0x5d2d7f[_0xbef1('0x2a')](_0x606783)){if(!_0x19a5a3[_0x606783]){delete _0x5d2d7f[_0x606783];}}}}function clearVoiceCallReports(_0x20fcc4){_0x20fcc4[_0xbef1('0x2f')]=0x0;_0x20fcc4[_0xbef1('0x30')]=0x0;_0x20fcc4[_0xbef1('0x31')]=0x0;_0x20fcc4['sumDuration']=0x0;_0x20fcc4[_0xbef1('0x32')]=0x0;}function clearCampaigns(_0x258605){if(!_[_0xbef1('0x33')](_0x258605)){for(var _0x68e710 in _0x258605){if(_0x258605['hasOwnProperty'](_0x68e710)){_0x258605[_0x68e710][_0xbef1('0x34')]=0x0;_0x258605[_0x68e710]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x70a2c8){if(!_[_0xbef1('0x33')](_0x70a2c8)){for(var _0x4e7222 in _0x70a2c8){if(_0x70a2c8[_0xbef1('0x2a')](_0x4e7222)){_0x70a2c8[_0x4e7222]['total']=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x30')]=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x35')]=0x0;_0x70a2c8[_0x4e7222]['abandoned']=0x0;_0x70a2c8[_0x4e7222]['sumHoldTime']=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x36')]=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x32')]=0x0;_0x70a2c8[_0x4e7222]['outboundAnswerAgiCallsDay']=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x37')]=0x0;_0x70a2c8[_0x4e7222]['outboundBusyCallsDay']=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x38')]=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x39')]=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x3a')]=0x0;_0x70a2c8[_0x4e7222]['outboundDropCallsDayTimeout']=0x0;_0x70a2c8[_0x4e7222]['outboundDropCallsDayCallersExit']=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x3b')]=0x0;_0x70a2c8[_0x4e7222]['outboundOriginateFailureCallsDay']=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x3c')]=0x0;_0x70a2c8[_0x4e7222]['outboundReCallsDay']=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x3d')]=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x3e')]=0x0;_0x70a2c8[_0x4e7222][_0xbef1('0x3f')]=!![];}}}}Realtime[_0xbef1('0x40')]['mergeFromDatabase']=function(_0xd105b2,_0x3cca53){for(var _0x580e4f in _0x3cca53){if(_0xd105b2[_0xbef1('0x2a')](_0x580e4f)){_0xd105b2[_0x580e4f]=_0x3cca53[_0x580e4f];}}};Realtime[_0xbef1('0x40')][_0xbef1('0x41')]=function(){var _0xf8747c=this;return function(_0x4e81a3){if(_0x4e81a3){freeIsNotKeyAgent(_0x4e81a3,_0xf8747c[_0xbef1('0x14')]);for(var _0x3db6b4=0x0,_0x521602={},_0x3069c0={};_0x3db6b4<_0x4e81a3[_0xbef1('0x42')];_0x3db6b4+=0x1){_0x521602=_0x4e81a3[_0x3db6b4];var _0x3ed61b=_['isNil'](_0x521602[_0xbef1('0x2e')])?util[_0xbef1('0x2b')](_0xbef1('0x2c'),_0x521602[_0xbef1('0x2d')]):_0x521602[_0xbef1('0x2e')];if(_[_0xbef1('0x43')](_0xf8747c[_0xbef1('0x14')][_0x3ed61b])){_0xf8747c['agents'][_0x3ed61b]=new Agent(_0x521602);}else{_0xf8747c[_0xbef1('0x44')](_0xf8747c[_0xbef1('0x14')][_0x3ed61b],_0x521602);}}}return _0xf8747c['agents'];};};Realtime[_0xbef1('0x40')]['initTelephones']=function(){var _0x435f2f=this;return function(_0x54eeda){if(_0x54eeda){freeIsNotKeySip(_0x54eeda,_0x435f2f[_0xbef1('0x15')]);for(var _0x147136=0x0,_0x491145={},_0xe6d08f={};_0x147136<_0x54eeda[_0xbef1('0x42')];_0x147136+=0x1){_0x491145=_0x54eeda[_0x147136];if(_[_0xbef1('0x43')](_0x435f2f[_0xbef1('0x15')][util[_0xbef1('0x2b')](_0xbef1('0x2c'),_0x491145[_0xbef1('0x2d')])])){_0x435f2f[_0xbef1('0x15')][util[_0xbef1('0x2b')]('SIP/%s',_0x491145['name'])]=new Telephone(_0x491145);}else{_0x435f2f[_0xbef1('0x44')](_0x435f2f['telephones'][util['format']('SIP/%s',_0x491145['name'])],_0x491145);}}}return _0x435f2f[_0xbef1('0x15')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x45')]=function(){var _0x243fb3=this;return function(_0x1aca28){if(_0x1aca28){freeIsNotKeySip(_0x1aca28,_0x243fb3[_0xbef1('0x16')]);for(var _0x6eca0b=0x0,_0x3cc8c5={},_0x46e63a={};_0x6eca0b<_0x1aca28[_0xbef1('0x42')];_0x6eca0b+=0x1){_0x3cc8c5=_0x1aca28[_0x6eca0b];if(_[_0xbef1('0x43')](_0x243fb3[_0xbef1('0x16')][util[_0xbef1('0x2b')](_0xbef1('0x2c'),_0x3cc8c5[_0xbef1('0x2d')])])){_0x243fb3[_0xbef1('0x16')][util[_0xbef1('0x2b')]('SIP/%s',_0x3cc8c5[_0xbef1('0x2d')])]=new Trunk(_0x3cc8c5);}else{_0x243fb3[_0xbef1('0x44')](_0x243fb3[_0xbef1('0x16')][util[_0xbef1('0x2b')]('SIP/%s',_0x3cc8c5['name'])],_0x3cc8c5);}}}return _0x243fb3[_0xbef1('0x16')];};};Realtime['prototype'][_0xbef1('0x46')]=function(){var _0x1636d4=this;return function(_0x28ff30){if(_0x28ff30){freeIsNotKey(_0x28ff30,_0x1636d4[_0xbef1('0x17')],'name');for(var _0x440015=0x0,_0x41e89c={},_0x1ca5d7={};_0x440015<_0x28ff30[_0xbef1('0x42')];_0x440015+=0x1){_0x41e89c=_0x28ff30[_0x440015];if(_['isUndefined'](_0x1636d4['voiceQueues'][_0x41e89c[_0xbef1('0x2d')]])){_0x1636d4[_0xbef1('0x17')][_0x41e89c[_0xbef1('0x2d')]]=new VoiceQueue(_0x41e89c);}else{_0x1636d4[_0xbef1('0x44')](_0x1636d4['voiceQueues'][_0x41e89c[_0xbef1('0x2d')]],_0x41e89c);}}}return _0x1636d4[_0xbef1('0x17')];};};Realtime['prototype'][_0xbef1('0x47')]=function(){var _0x3a4598=this;return function(_0x335ef0){if(_0x335ef0){freeIsNotKey(_0x335ef0,_0x3a4598[_0xbef1('0x18')],'id');for(var _0xbc62e1=0x0,_0x475667={},_0x16f8fe={};_0xbc62e1<_0x335ef0[_0xbef1('0x42')];_0xbc62e1+=0x1){_0x475667=_0x335ef0[_0xbc62e1];if(_['isUndefined'](_0x3a4598[_0xbef1('0x18')][_0x475667['id']])){_0x3a4598['triggers'][_0x475667['id']]=new Trigger(_0x475667);}else{_0x3a4598[_0xbef1('0x44')](_0x3a4598[_0xbef1('0x18')][_0x475667['id']],_0x475667);}}}return _0x3a4598[_0xbef1('0x18')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x48')]=function(){var _0x5a4a9b=this;return function(_0xbc9fd0){if(_0xbc9fd0){freeIsNotKey(_0xbc9fd0,_0x5a4a9b[_0xbef1('0x1a')],'id');for(var _0x6be715=0x0,_0x17271e={},_0x354568={};_0x6be715<_0xbc9fd0[_0xbef1('0x42')];_0x6be715+=0x1){_0x17271e=_0xbc9fd0[_0x6be715];if(_[_0xbef1('0x43')](_0x5a4a9b['templates'][_0x17271e['id']])){_0x5a4a9b[_0xbef1('0x1a')][_0x17271e['id']]=new Template(_0x17271e);}else{_0x5a4a9b['mergeFromDatabase'](_0x5a4a9b['templates'][_0x17271e['id']],_0x17271e);}}}return _0x5a4a9b['templates'];};};Realtime[_0xbef1('0x40')]['initZendeskAccounts']=function(){var _0x2dfb6d=this;return function(_0x3b3c58){if(_0x3b3c58){freeIsNotKey(_0x3b3c58,_0x2dfb6d[_0xbef1('0x20')],'id');for(var _0x56ad0e=0x0,_0x500af1={},_0x2d0f6e={};_0x56ad0e<_0x3b3c58[_0xbef1('0x42')];_0x56ad0e+=0x1){_0x500af1=_0x3b3c58[_0x56ad0e];if(_[_0xbef1('0x43')](_0x2dfb6d[_0xbef1('0x20')][_0x500af1['id']])){_0x2dfb6d[_0xbef1('0x20')][_0x500af1['id']]=new ZendeskAccount(_0x500af1);}else{_0x2dfb6d[_0xbef1('0x44')](_0x2dfb6d[_0xbef1('0x20')][_0x500af1['id']],_0x500af1);}}}return _0x2dfb6d[_0xbef1('0x20')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x49')]=function(){var _0xa300b=this;return function(_0xc956ef){if(_0xc956ef){freeIsNotKey(_0xc956ef,_0xa300b['salesforceAccounts'],'id');for(var _0x3162e2=0x0,_0x3c1170={},_0x17cfa6={};_0x3162e2<_0xc956ef[_0xbef1('0x42')];_0x3162e2+=0x1){_0x3c1170=_0xc956ef[_0x3162e2];if(_[_0xbef1('0x43')](_0xa300b['salesforceAccounts'][_0x3c1170['id']])){_0xa300b[_0xbef1('0x21')][_0x3c1170['id']]=new SalesforceAccount(_0x3c1170);}else{_0xa300b[_0xbef1('0x44')](_0xa300b[_0xbef1('0x21')][_0x3c1170['id']],_0x3c1170);}}}return _0xa300b['salesforceAccounts'];};};Realtime['prototype'][_0xbef1('0x4a')]=function(){var _0x3b989a=this;return function(_0x3c0d92){if(_0x3c0d92){freeIsNotKey(_0x3c0d92,_0x3b989a['freshdeskAccounts'],'id');for(var _0x990dff=0x0,_0x21bdf3={},_0x5a1e02={};_0x990dff<_0x3c0d92[_0xbef1('0x42')];_0x990dff+=0x1){_0x21bdf3=_0x3c0d92[_0x990dff];if(_['isUndefined'](_0x3b989a[_0xbef1('0x4b')][_0x21bdf3['id']])){_0x3b989a[_0xbef1('0x4b')][_0x21bdf3['id']]=new FreshdeskAccount(_0x21bdf3);}else{_0x3b989a['mergeFromDatabase'](_0x3b989a['freshdeskAccounts'][_0x21bdf3['id']],_0x21bdf3);}}}return _0x3b989a[_0xbef1('0x4b')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x4c')]=function(){var _0xfa3d50=this;return function(_0x2d76db){if(_0x2d76db){freeIsNotKey(_0x2d76db,_0xfa3d50[_0xbef1('0x23')],'id');for(var _0x562f59=0x0,_0x1c64b2={},_0x2bfc6c={};_0x562f59<_0x2d76db[_0xbef1('0x42')];_0x562f59+=0x1){_0x1c64b2=_0x2d76db[_0x562f59];if(_[_0xbef1('0x43')](_0xfa3d50[_0xbef1('0x23')][_0x1c64b2['id']])){_0xfa3d50[_0xbef1('0x23')][_0x1c64b2['id']]=new ZohoAccount(_0x1c64b2);}else{_0xfa3d50[_0xbef1('0x44')](_0xfa3d50[_0xbef1('0x23')][_0x1c64b2['id']],_0x1c64b2);}}}return _0xfa3d50['zohoAccounts'];};};Realtime[_0xbef1('0x40')]['initDeskAccounts']=function(){var _0x400fd4=this;return function(_0x124bcc){if(_0x124bcc){freeIsNotKey(_0x124bcc,_0x400fd4[_0xbef1('0x4d')],'id');for(var _0x5e5063=0x0,_0x711c02={},_0x192b53={};_0x5e5063<_0x124bcc[_0xbef1('0x42')];_0x5e5063+=0x1){_0x711c02=_0x124bcc[_0x5e5063];if(_[_0xbef1('0x43')](_0x400fd4[_0xbef1('0x4d')][_0x711c02['id']])){_0x400fd4[_0xbef1('0x4d')][_0x711c02['id']]=new DeskAccount(_0x711c02);}else{_0x400fd4[_0xbef1('0x44')](_0x400fd4[_0xbef1('0x4d')][_0x711c02['id']],_0x711c02);}}}return _0x400fd4[_0xbef1('0x4d')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x4e')]=function(){var _0x419be6=this;return function(_0x264760){if(_0x264760){freeIsNotKey(_0x264760,_0x419be6[_0xbef1('0x22')],'id');for(var _0x2531d8=0x0,_0x14e534={},_0x420945={};_0x2531d8<_0x264760[_0xbef1('0x42')];_0x2531d8+=0x1){_0x14e534=_0x264760[_0x2531d8];if(_[_0xbef1('0x43')](_0x419be6['sugarcrmAccounts'][_0x14e534['id']])){_0x419be6[_0xbef1('0x22')][_0x14e534['id']]=new SugarcrmAccount(_0x14e534);}else{_0x419be6[_0xbef1('0x44')](_0x419be6['sugarcrmAccounts'][_0x14e534['id']],_0x14e534);}}}return _0x419be6[_0xbef1('0x22')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x4f')]=function(){var _0x56ced9=this;return function(_0x2b215c){if(_0x2b215c){freeIsNotKey(_0x2b215c,_0x56ced9[_0xbef1('0x24')],'id');for(var _0x4ffe94=0x0,_0x198ac6={},_0x51f430={};_0x4ffe94<_0x2b215c[_0xbef1('0x42')];_0x4ffe94+=0x1){_0x198ac6=_0x2b215c[_0x4ffe94];if(_[_0xbef1('0x43')](_0x56ced9[_0xbef1('0x24')][_0x198ac6['id']])){_0x56ced9[_0xbef1('0x24')][_0x198ac6['id']]=new VtigerAccount(_0x198ac6);}else{_0x56ced9[_0xbef1('0x44')](_0x56ced9[_0xbef1('0x24')][_0x198ac6['id']],_0x198ac6);}}}return _0x56ced9[_0xbef1('0x24')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x50')]=function(){var _0x1d5cc0=this;return function(_0x289aa5){if(_0x289aa5){freeIsNotKey(_0x289aa5,_0x1d5cc0[_0xbef1('0x25')],'id');for(var _0x157ec8=0x0,_0x527033={},_0x5e7749={};_0x157ec8<_0x289aa5[_0xbef1('0x42')];_0x157ec8+=0x1){_0x527033=_0x289aa5[_0x157ec8];if(_[_0xbef1('0x43')](_0x1d5cc0['servicenowAccounts'][_0x527033['id']])){_0x1d5cc0[_0xbef1('0x25')][_0x527033['id']]=new ServicenowAccount(_0x527033);}else{_0x1d5cc0[_0xbef1('0x44')](_0x1d5cc0[_0xbef1('0x25')][_0x527033['id']],_0x527033);}}}return _0x1d5cc0[_0xbef1('0x25')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x51')]=function(){var _0x594c5d=this;return function(_0x17d65c){if(_0x17d65c){freeIsNotKey(_0x17d65c,_0x594c5d['dynamics365Accounts'],'id');for(var _0x375be8=0x0,_0x2eec70={},_0x78a61e={};_0x375be8<_0x17d65c[_0xbef1('0x42')];_0x375be8+=0x1){_0x2eec70=_0x17d65c[_0x375be8];if(_['isUndefined'](_0x594c5d[_0xbef1('0x26')][_0x2eec70['id']])){_0x594c5d['dynamics365Accounts'][_0x2eec70['id']]=new Dynamics365Account(_0x2eec70);}else{_0x594c5d[_0xbef1('0x44')](_0x594c5d['dynamics365Accounts'][_0x2eec70['id']],_0x2eec70);}}}return _0x594c5d[_0xbef1('0x26')];};};Realtime[_0xbef1('0x40')]['initFreshsalesAccounts']=function(){var _0x1a8afc=this;return function(_0x33135b){if(_0x33135b){freeIsNotKey(_0x33135b,_0x1a8afc[_0xbef1('0x27')],'id');for(var _0x4881=0x0,_0x3fc799={},_0x3cfb0f={};_0x4881<_0x33135b['length'];_0x4881+=0x1){_0x3fc799=_0x33135b[_0x4881];if(_['isUndefined'](_0x1a8afc[_0xbef1('0x27')][_0x3fc799['id']])){_0x1a8afc[_0xbef1('0x27')][_0x3fc799['id']]=new FreshsalesAccount(_0x3fc799);}else{_0x1a8afc[_0xbef1('0x44')](_0x1a8afc['freshsalesAccounts'][_0x3fc799['id']],_0x3fc799);}}}return _0x1a8afc[_0xbef1('0x27')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x2ee2a0=this;return function(_0x443643){for(var _0x166f91=0x0;_0x166f91<_0x443643[_0xbef1('0x42')];_0x166f91+=0x1){_[_0xbef1('0x52')](_0x2ee2a0[_0xbef1('0x17')][_0x443643[_0x166f91]['name']],_0x443643[_0x166f91]);}return _0x2ee2a0[_0xbef1('0x17')];};};Realtime[_0xbef1('0x40')]['initVoiceQueueReports']=function(){var _0x502954=this;return function(_0x4ee705){clearVoiceQueues(_0x502954['voiceQueues']);if(_0x4ee705){_0x4ee705=_['groupBy'](_0x4ee705,'uniqueid');for(var _0x468f6d in _0x4ee705){if(_0x4ee705['hasOwnProperty'](_0x468f6d)){var _0x178700={};for(var _0x33f561=0x0;_0x33f561<_0x4ee705[_0x468f6d][_0xbef1('0x42')];_0x33f561+=0x1){var _0x5f3842=_0x4ee705[_0x468f6d][_0x33f561]['queue'];if(_0x502954[_0xbef1('0x17')][_0x5f3842]){if(_0x4ee705[_0x468f6d][_0x33f561]['queuecallerexit']){_0x502954[_0xbef1('0x17')][_0x5f3842][_0xbef1('0x35')]+=0x1;}if(_0x4ee705[_0x468f6d][_0x33f561]['queuecallerabandon']){_0x502954[_0xbef1('0x17')][_0x5f3842][_0xbef1('0x53')]+=0x1;}_0x502954[_0xbef1('0x17')][_0x5f3842]['sumHoldTime']+=moment(_0x4ee705[_0x468f6d][_0x33f561][_0xbef1('0x54')])['diff'](moment(_0x4ee705[_0x468f6d][_0x33f561][_0xbef1('0x55')]),_0xbef1('0x56'))||0x0;if(_0x33f561===_0x4ee705[_0x468f6d][_0xbef1('0x42')]-0x1){_0x502954['voiceQueues'][_0x5f3842][_0xbef1('0x36')]+=moment(_0x4ee705[_0x468f6d][_0x33f561]['queuecallercompleteAt']||_0x4ee705[_0x468f6d][_0x33f561][_0xbef1('0x57')]||_0x4ee705[_0x468f6d][_0x33f561][_0xbef1('0x58')])[_0xbef1('0x59')](moment(_0x4ee705[_0x468f6d][_0x33f561][_0xbef1('0x55')]),_0xbef1('0x56'))||0x0;_0x502954[_0xbef1('0x17')][_0x5f3842][_0xbef1('0x2f')]+=0x1;if(_0x4ee705[_0x468f6d][_0x33f561][_0xbef1('0x5a')]){_0x502954[_0xbef1('0x17')][_0x5f3842][_0xbef1('0x30')]+=0x1;_0x502954['voiceQueues'][_0x5f3842][_0xbef1('0x32')]+=moment(_0x4ee705[_0x468f6d][_0x33f561][_0xbef1('0x5b')])[_0xbef1('0x59')](moment(_0x4ee705[_0x468f6d][_0x33f561][_0xbef1('0x54')]),_0xbef1('0x56'))||0x0;}}else{_0x502954[_0xbef1('0x17')][_0x5f3842][_0xbef1('0x36')]+=_0x502954[_0xbef1('0x17')][_0x5f3842][_0xbef1('0x31')]||0x0;}}}}}}return _0x502954[_0xbef1('0x17')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x5c')]=function(){var _0x3122da=this;return function(_0x161899){clearVoiceCallReports(_0x3122da[_0xbef1('0x1b')]);if(_0x161899){for(var _0x2a627a=0x0;_0x2a627a<_0x161899[_0xbef1('0x42')];_0x2a627a+=0x1){_0x3122da['outbound'][_0xbef1('0x2f')]+=0x1;_0x3122da[_0xbef1('0x1b')][_0xbef1('0x36')]+=_0x161899[_0x2a627a][_0xbef1('0x5d')];if(_0x161899[_0x2a627a][_0xbef1('0x5e')]===_0xbef1('0x5f')){_0x3122da[_0xbef1('0x1b')][_0xbef1('0x30')]+=0x1;_0x3122da[_0xbef1('0x1b')][_0xbef1('0x31')]+=_0x161899[_0x2a627a][_0xbef1('0x5d')]-_0x161899[_0x2a627a][_0xbef1('0x60')]||0x0;_0x3122da[_0xbef1('0x1b')][_0xbef1('0x32')]+=_0x161899[_0x2a627a][_0xbef1('0x60')];}}}return _0x3122da[_0xbef1('0x1b')];};};Realtime['prototype'][_0xbef1('0x61')]=function(){var _0x5c7c8b=this;return function(_0x2dc767){if(_0x2dc767){freeIsNotKey(_0x2dc767,_0x5c7c8b[_0xbef1('0x19')],_0xbef1('0x2d'));for(var _0x36435b=0x0,_0x1ed052={};_0x36435b<_0x2dc767[_0xbef1('0x42')];_0x36435b+=0x1){_0x1ed052=_0x2dc767[_0x36435b];if(_[_0xbef1('0x43')](_0x5c7c8b[_0xbef1('0x19')][_0x1ed052[_0xbef1('0x2d')]])){_0x5c7c8b[_0xbef1('0x19')][_0x1ed052[_0xbef1('0x2d')]]=new Campaign(_0x1ed052);}else{_0x5c7c8b[_0xbef1('0x44')](_0x5c7c8b['campaigns'][_0x1ed052[_0xbef1('0x2d')]],_0x1ed052);_0x5c7c8b[_0xbef1('0x19')][_0x1ed052[_0xbef1('0x2d')]]['dialQueueProject']=_0x1ed052['SquareProject']?_0x1ed052[_0xbef1('0x62')][_0xbef1('0x2d')]:undefined;}}}return _0x5c7c8b[_0xbef1('0x19')];};};Realtime['prototype'][_0xbef1('0x63')]=function(){var _0x1db70c=this;return function(_0x2f8e73){if(_0x2f8e73){freeIsNotKey(_0x2f8e73,_0x1db70c[_0xbef1('0x64')],'id');for(var _0x42b384=0x0,_0x590d3b={};_0x42b384<_0x2f8e73[_0xbef1('0x42')];_0x42b384+=0x1){_0x590d3b=_0x2f8e73[_0x42b384];if(_['isUndefined'](_0x1db70c['voiceExtensions'][_0x590d3b['id']])){_0x1db70c[_0xbef1('0x64')][_0x590d3b['id']]=new VoiceExtension(_0x590d3b);}else{_0x1db70c[_0xbef1('0x44')](_0x1db70c['voiceExtensions'][_0x590d3b['id']],_0x590d3b);}}}return _0x1db70c['voiceExtensions'];};};Realtime[_0xbef1('0x40')][_0xbef1('0x65')]=function(){var _0x587701=this;return function(_0x37f574){clearCampaigns(_0x587701['campaigns']);for(var _0x53bade=0x0;_0x53bade<_0x37f574[_0xbef1('0x42')];_0x53bade+=0x1){_[_0xbef1('0x52')](_0x587701[_0xbef1('0x19')][_0x37f574[_0x53bade][_0xbef1('0x2d')]],_0x37f574[_0x53bade]);}return _0x587701[_0xbef1('0x19')];};};Realtime[_0xbef1('0x40')][_0xbef1('0x66')]=function(){var _0x55d569=this;return function(_0x1cbcd5){if(_0x1cbcd5){freeIsNotKey(_0x1cbcd5,_0x55d569[_0xbef1('0x28')],'id');for(var _0x1090d7=0x0,_0x3c5cb0={},_0x221057={};_0x1090d7<_0x1cbcd5[_0xbef1('0x42')];_0x1090d7+=0x1){_0x3c5cb0=_0x1cbcd5[_0x1090d7];if(_['isUndefined'](_0x55d569[_0xbef1('0x28')][_0x3c5cb0['id']])){_0x55d569[_0xbef1('0x28')][_0x3c5cb0['id']]=new FaxAccount(_0x3c5cb0);}else{_0x55d569[_0xbef1('0x44')](_0x55d569['faxAccounts'][_0x3c5cb0['id']],_0x3c5cb0);}}}return _0x55d569[_0xbef1('0x28')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xd103=['outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','prototype','initAgents','length','SIP/%s','agents','mergeFromDatabase','telephones','isUndefined','initTrunks','initVoiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/telephone','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','trunks','voiceQueues','triggers','campaigns','templates','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','isNil','interface','format','name','answered','sumHoldTime','sumDuration','isEmpty','ivrAnswerCallsDay','total','unmanaged','abandoned','sumBillable','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay'];(function(_0x1988f1,_0x290a23){var _0x3c848e=function(_0x3600e7){while(--_0x3600e7){_0x1988f1['push'](_0x1988f1['shift']());}};_0x3c848e(++_0x290a23);}(_0xd103,0x1ee));var _0x3d10=function(_0x194ba5,_0x24a39a){_0x194ba5=_0x194ba5-0x0;var _0x468d21=_0xd103[_0x194ba5];return _0x468d21;};'use strict';var BPromise=require(_0x3d10('0x0'));var util=require(_0x3d10('0x1'));var _=require(_0x3d10('0x2'));var moment=require(_0x3d10('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x3d10('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x3d10('0x5'));var Trigger=require('../model/trigger');var Template=require(_0x3d10('0x6'));var Campaign=require(_0x3d10('0x7'));var VoiceExtension=require(_0x3d10('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x3d10('0x9'));var FreshdeskAccount=require(_0x3d10('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x3d10('0xb'));var VtigerAccount=require(_0x3d10('0xc'));var ServicenowAccount=require(_0x3d10('0xd'));var Dynamics365Account=require(_0x3d10('0xe'));var FreshsalesAccount=require(_0x3d10('0xf'));var FaxAccount=require(_0x3d10('0x10'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0x3d10('0x11')]={};this[_0x3d10('0x12')]={};this[_0x3d10('0x13')]={};this[_0x3d10('0x14')]={};this[_0x3d10('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0x3d10('0x16')]={};this[_0x3d10('0x17')]={};this[_0x3d10('0x18')]={};this[_0x3d10('0x19')]={};this['sugarcrmAccounts']={};this[_0x3d10('0x1a')]={};this[_0x3d10('0x1b')]={};this['deskAccounts']={};this[_0x3d10('0x1c')]={};this[_0x3d10('0x1d')]={};this[_0x3d10('0x1e')]={};this[_0x3d10('0x1f')]={};this[_0x3d10('0x20')]={};};function freeIsNotKey(_0xadc567,_0x4ee845,_0xb1bca1){var _0x471ab7=_['mapKeys'](_0xadc567,function(_0x32bac8,_0x4791ce){return _0x32bac8[_0xb1bca1];});for(var _0x359615 in _0x4ee845){if(_0x4ee845['hasOwnProperty'](_0x359615)){if(!_0x471ab7[_0x359615]){delete _0x4ee845[_0x359615];}}}}function freeIsNotKeySip(_0x2c8ffb,_0x5bdd43){var _0x306b9b=_[_0x3d10('0x21')](_0x2c8ffb,function(_0x4da797,_0x5df740){return util['format']('SIP/%s',_0x4da797['name']);});for(var _0x484953 in _0x5bdd43){if(_0x5bdd43[_0x3d10('0x22')](_0x484953)){if(!_0x306b9b[_0x484953]){delete _0x5bdd43[_0x484953];}}}}function freeIsNotKeyAgent(_0x3d148d,_0x278bda){var _0x5424b6=_['mapKeys'](_0x3d148d,function(_0x415c39,_0x427665){var _0x469f0c=_[_0x3d10('0x23')](_0x415c39[_0x3d10('0x24')])?util[_0x3d10('0x25')]('SIP/%s',_0x415c39[_0x3d10('0x26')]):_0x415c39[_0x3d10('0x24')];return _0x469f0c;});for(var _0x5dd4cc in _0x278bda){if(_0x278bda[_0x3d10('0x22')](_0x5dd4cc)){if(!_0x5424b6[_0x5dd4cc]){delete _0x278bda[_0x5dd4cc];}}}}function clearVoiceCallReports(_0x52d783){_0x52d783['total']=0x0;_0x52d783[_0x3d10('0x27')]=0x0;_0x52d783[_0x3d10('0x28')]=0x0;_0x52d783[_0x3d10('0x29')]=0x0;_0x52d783['sumBillable']=0x0;}function clearCampaigns(_0x26ad06){if(!_[_0x3d10('0x2a')](_0x26ad06)){for(var _0x4b6e8f in _0x26ad06){if(_0x26ad06[_0x3d10('0x22')](_0x4b6e8f)){_0x26ad06[_0x4b6e8f]['ivrTotalCallsDays']=0x0;_0x26ad06[_0x4b6e8f][_0x3d10('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x9605f4){if(!_[_0x3d10('0x2a')](_0x9605f4)){for(var _0x2d90e0 in _0x9605f4){if(_0x9605f4[_0x3d10('0x22')](_0x2d90e0)){_0x9605f4[_0x2d90e0][_0x3d10('0x2c')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x27')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x2d')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x2e')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x28')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x29')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x2f')]=0x0;_0x9605f4[_0x2d90e0]['outboundAnswerAgiCallsDay']=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x30')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x31')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x32')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x33')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x34')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x35')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x36')]=0x0;_0x9605f4[_0x2d90e0]['outboundBlacklistCallsDay']=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x37')]=0x0;_0x9605f4[_0x2d90e0]['outboundRejectCallsDay']=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x38')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x39')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x3a')]=0x0;_0x9605f4[_0x2d90e0]['queueStatusComplete']=!![];}}}}Realtime[_0x3d10('0x3b')]['mergeFromDatabase']=function(_0x4a963e,_0x661d95){for(var _0x25345d in _0x661d95){if(_0x4a963e[_0x3d10('0x22')](_0x25345d)){_0x4a963e[_0x25345d]=_0x661d95[_0x25345d];}}};Realtime[_0x3d10('0x3b')][_0x3d10('0x3c')]=function(){var _0x38aaa4=this;return function(_0x102a96){if(_0x102a96){freeIsNotKeyAgent(_0x102a96,_0x38aaa4['agents']);for(var _0x59f701=0x0,_0x34ae62={},_0x865245={};_0x59f701<_0x102a96[_0x3d10('0x3d')];_0x59f701+=0x1){_0x34ae62=_0x102a96[_0x59f701];var _0x49c7ba=_['isNil'](_0x34ae62[_0x3d10('0x24')])?util['format'](_0x3d10('0x3e'),_0x34ae62[_0x3d10('0x26')]):_0x34ae62[_0x3d10('0x24')];if(_['isUndefined'](_0x38aaa4[_0x3d10('0x3f')][_0x49c7ba])){_0x38aaa4[_0x3d10('0x3f')][_0x49c7ba]=new Agent(_0x34ae62);}else{_0x38aaa4[_0x3d10('0x40')](_0x38aaa4[_0x3d10('0x3f')][_0x49c7ba],_0x34ae62);}}}return _0x38aaa4[_0x3d10('0x3f')];};};Realtime[_0x3d10('0x3b')]['initTelephones']=function(){var _0x2d76b1=this;return function(_0x5a7219){if(_0x5a7219){freeIsNotKeySip(_0x5a7219,_0x2d76b1[_0x3d10('0x41')]);for(var _0x4cb04f=0x0,_0x184224={},_0x373fa6={};_0x4cb04f<_0x5a7219[_0x3d10('0x3d')];_0x4cb04f+=0x1){_0x184224=_0x5a7219[_0x4cb04f];if(_[_0x3d10('0x42')](_0x2d76b1['telephones'][util[_0x3d10('0x25')](_0x3d10('0x3e'),_0x184224[_0x3d10('0x26')])])){_0x2d76b1['telephones'][util[_0x3d10('0x25')](_0x3d10('0x3e'),_0x184224[_0x3d10('0x26')])]=new Telephone(_0x184224);}else{_0x2d76b1['mergeFromDatabase'](_0x2d76b1['telephones'][util['format'](_0x3d10('0x3e'),_0x184224[_0x3d10('0x26')])],_0x184224);}}}return _0x2d76b1['telephones'];};};Realtime['prototype'][_0x3d10('0x43')]=function(){var _0x490741=this;return function(_0x362d84){if(_0x362d84){freeIsNotKeySip(_0x362d84,_0x490741['trunks']);for(var _0x1ac861=0x0,_0x229811={},_0x1b3211={};_0x1ac861<_0x362d84['length'];_0x1ac861+=0x1){_0x229811=_0x362d84[_0x1ac861];if(_[_0x3d10('0x42')](_0x490741[_0x3d10('0x11')][util[_0x3d10('0x25')](_0x3d10('0x3e'),_0x229811[_0x3d10('0x26')])])){_0x490741[_0x3d10('0x11')][util[_0x3d10('0x25')]('SIP/%s',_0x229811['name'])]=new Trunk(_0x229811);}else{_0x490741[_0x3d10('0x40')](_0x490741[_0x3d10('0x11')][util[_0x3d10('0x25')]('SIP/%s',_0x229811[_0x3d10('0x26')])],_0x229811);}}}return _0x490741[_0x3d10('0x11')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x44')]=function(){var _0x4b54cf=this;return function(_0x133106){if(_0x133106){freeIsNotKey(_0x133106,_0x4b54cf[_0x3d10('0x12')],_0x3d10('0x26'));for(var _0x20f6b9=0x0,_0x560d5a={},_0x29225a={};_0x20f6b9<_0x133106[_0x3d10('0x3d')];_0x20f6b9+=0x1){_0x560d5a=_0x133106[_0x20f6b9];if(_[_0x3d10('0x42')](_0x4b54cf[_0x3d10('0x12')][_0x560d5a[_0x3d10('0x26')]])){_0x4b54cf['voiceQueues'][_0x560d5a[_0x3d10('0x26')]]=new VoiceQueue(_0x560d5a);}else{_0x4b54cf['mergeFromDatabase'](_0x4b54cf[_0x3d10('0x12')][_0x560d5a[_0x3d10('0x26')]],_0x560d5a);}}}return _0x4b54cf[_0x3d10('0x12')];};};Realtime[_0x3d10('0x3b')]['initTriggers']=function(){var _0x29ca82=this;return function(_0x244758){if(_0x244758){freeIsNotKey(_0x244758,_0x29ca82[_0x3d10('0x13')],'id');for(var _0xd9edd5=0x0,_0x5639f6={},_0x2939d2={};_0xd9edd5<_0x244758['length'];_0xd9edd5+=0x1){_0x5639f6=_0x244758[_0xd9edd5];if(_[_0x3d10('0x42')](_0x29ca82[_0x3d10('0x13')][_0x5639f6['id']])){_0x29ca82[_0x3d10('0x13')][_0x5639f6['id']]=new Trigger(_0x5639f6);}else{_0x29ca82[_0x3d10('0x40')](_0x29ca82[_0x3d10('0x13')][_0x5639f6['id']],_0x5639f6);}}}return _0x29ca82[_0x3d10('0x13')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x45')]=function(){var _0x56f06f=this;return function(_0x2a438f){if(_0x2a438f){freeIsNotKey(_0x2a438f,_0x56f06f[_0x3d10('0x15')],'id');for(var _0xbc2541=0x0,_0x499ba4={},_0x2f3cf5={};_0xbc2541<_0x2a438f[_0x3d10('0x3d')];_0xbc2541+=0x1){_0x499ba4=_0x2a438f[_0xbc2541];if(_['isUndefined'](_0x56f06f[_0x3d10('0x15')][_0x499ba4['id']])){_0x56f06f['templates'][_0x499ba4['id']]=new Template(_0x499ba4);}else{_0x56f06f[_0x3d10('0x40')](_0x56f06f[_0x3d10('0x15')][_0x499ba4['id']],_0x499ba4);}}}return _0x56f06f[_0x3d10('0x15')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x46')]=function(){var _0x41f41a=this;return function(_0x3f6eb5){if(_0x3f6eb5){freeIsNotKey(_0x3f6eb5,_0x41f41a[_0x3d10('0x18')],'id');for(var _0x5e63d5=0x0,_0xfa3f01={},_0x4d4e37={};_0x5e63d5<_0x3f6eb5[_0x3d10('0x3d')];_0x5e63d5+=0x1){_0xfa3f01=_0x3f6eb5[_0x5e63d5];if(_[_0x3d10('0x42')](_0x41f41a[_0x3d10('0x18')][_0xfa3f01['id']])){_0x41f41a[_0x3d10('0x18')][_0xfa3f01['id']]=new ZendeskAccount(_0xfa3f01);}else{_0x41f41a[_0x3d10('0x40')](_0x41f41a['zendeskAccounts'][_0xfa3f01['id']],_0xfa3f01);}}}return _0x41f41a[_0x3d10('0x18')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x47')]=function(){var _0x3c906e=this;return function(_0x13611a){if(_0x13611a){freeIsNotKey(_0x13611a,_0x3c906e[_0x3d10('0x19')],'id');for(var _0x5089a4=0x0,_0xccaede={},_0x9ec26b={};_0x5089a4<_0x13611a['length'];_0x5089a4+=0x1){_0xccaede=_0x13611a[_0x5089a4];if(_[_0x3d10('0x42')](_0x3c906e[_0x3d10('0x19')][_0xccaede['id']])){_0x3c906e[_0x3d10('0x19')][_0xccaede['id']]=new SalesforceAccount(_0xccaede);}else{_0x3c906e[_0x3d10('0x40')](_0x3c906e[_0x3d10('0x19')][_0xccaede['id']],_0xccaede);}}}return _0x3c906e[_0x3d10('0x19')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x48')]=function(){var _0x109e57=this;return function(_0x39062b){if(_0x39062b){freeIsNotKey(_0x39062b,_0x109e57[_0x3d10('0x1a')],'id');for(var _0x1b6bf5=0x0,_0x441414={},_0x5d53ed={};_0x1b6bf5<_0x39062b['length'];_0x1b6bf5+=0x1){_0x441414=_0x39062b[_0x1b6bf5];if(_[_0x3d10('0x42')](_0x109e57[_0x3d10('0x1a')][_0x441414['id']])){_0x109e57[_0x3d10('0x1a')][_0x441414['id']]=new FreshdeskAccount(_0x441414);}else{_0x109e57[_0x3d10('0x40')](_0x109e57[_0x3d10('0x1a')][_0x441414['id']],_0x441414);}}}return _0x109e57[_0x3d10('0x1a')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x49')]=function(){var _0x2a49d1=this;return function(_0x2a062e){if(_0x2a062e){freeIsNotKey(_0x2a062e,_0x2a49d1[_0x3d10('0x1b')],'id');for(var _0x413330=0x0,_0x4d58f1={},_0xc0933a={};_0x413330<_0x2a062e[_0x3d10('0x3d')];_0x413330+=0x1){_0x4d58f1=_0x2a062e[_0x413330];if(_['isUndefined'](_0x2a49d1[_0x3d10('0x1b')][_0x4d58f1['id']])){_0x2a49d1['zohoAccounts'][_0x4d58f1['id']]=new ZohoAccount(_0x4d58f1);}else{_0x2a49d1[_0x3d10('0x40')](_0x2a49d1[_0x3d10('0x1b')][_0x4d58f1['id']],_0x4d58f1);}}}return _0x2a49d1[_0x3d10('0x1b')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x4a')]=function(){var _0x2d0a40=this;return function(_0x311e21){if(_0x311e21){freeIsNotKey(_0x311e21,_0x2d0a40[_0x3d10('0x4b')],'id');for(var _0x2c798b=0x0,_0x63f6f5={},_0x47d561={};_0x2c798b<_0x311e21[_0x3d10('0x3d')];_0x2c798b+=0x1){_0x63f6f5=_0x311e21[_0x2c798b];if(_[_0x3d10('0x42')](_0x2d0a40['deskAccounts'][_0x63f6f5['id']])){_0x2d0a40[_0x3d10('0x4b')][_0x63f6f5['id']]=new DeskAccount(_0x63f6f5);}else{_0x2d0a40['mergeFromDatabase'](_0x2d0a40[_0x3d10('0x4b')][_0x63f6f5['id']],_0x63f6f5);}}}return _0x2d0a40['deskAccounts'];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x4c')]=function(){var _0x5b4d9c=this;return function(_0x454857){if(_0x454857){freeIsNotKey(_0x454857,_0x5b4d9c['sugarcrmAccounts'],'id');for(var _0x5af0c7=0x0,_0x2feb13={},_0x27f33b={};_0x5af0c7<_0x454857[_0x3d10('0x3d')];_0x5af0c7+=0x1){_0x2feb13=_0x454857[_0x5af0c7];if(_['isUndefined'](_0x5b4d9c['sugarcrmAccounts'][_0x2feb13['id']])){_0x5b4d9c[_0x3d10('0x4d')][_0x2feb13['id']]=new SugarcrmAccount(_0x2feb13);}else{_0x5b4d9c[_0x3d10('0x40')](_0x5b4d9c[_0x3d10('0x4d')][_0x2feb13['id']],_0x2feb13);}}}return _0x5b4d9c[_0x3d10('0x4d')];};};Realtime['prototype'][_0x3d10('0x4e')]=function(){var _0x1fc72b=this;return function(_0x586cb6){if(_0x586cb6){freeIsNotKey(_0x586cb6,_0x1fc72b[_0x3d10('0x1c')],'id');for(var _0x42d7d0=0x0,_0x3735ea={},_0x335b4c={};_0x42d7d0<_0x586cb6[_0x3d10('0x3d')];_0x42d7d0+=0x1){_0x3735ea=_0x586cb6[_0x42d7d0];if(_[_0x3d10('0x42')](_0x1fc72b[_0x3d10('0x1c')][_0x3735ea['id']])){_0x1fc72b[_0x3d10('0x1c')][_0x3735ea['id']]=new VtigerAccount(_0x3735ea);}else{_0x1fc72b['mergeFromDatabase'](_0x1fc72b[_0x3d10('0x1c')][_0x3735ea['id']],_0x3735ea);}}}return _0x1fc72b[_0x3d10('0x1c')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x4f')]=function(){var _0x130f57=this;return function(_0x191960){if(_0x191960){freeIsNotKey(_0x191960,_0x130f57[_0x3d10('0x1d')],'id');for(var _0x47e550=0x0,_0x28a1d6={},_0x17b83f={};_0x47e550<_0x191960[_0x3d10('0x3d')];_0x47e550+=0x1){_0x28a1d6=_0x191960[_0x47e550];if(_[_0x3d10('0x42')](_0x130f57[_0x3d10('0x1d')][_0x28a1d6['id']])){_0x130f57['servicenowAccounts'][_0x28a1d6['id']]=new ServicenowAccount(_0x28a1d6);}else{_0x130f57['mergeFromDatabase'](_0x130f57['servicenowAccounts'][_0x28a1d6['id']],_0x28a1d6);}}}return _0x130f57[_0x3d10('0x1d')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x50')]=function(){var _0x276f8a=this;return function(_0x3d1cc4){if(_0x3d1cc4){freeIsNotKey(_0x3d1cc4,_0x276f8a['dynamics365Accounts'],'id');for(var _0x9c13c0=0x0,_0x2f4a33={},_0x5dd519={};_0x9c13c0<_0x3d1cc4['length'];_0x9c13c0+=0x1){_0x2f4a33=_0x3d1cc4[_0x9c13c0];if(_['isUndefined'](_0x276f8a[_0x3d10('0x1e')][_0x2f4a33['id']])){_0x276f8a[_0x3d10('0x1e')][_0x2f4a33['id']]=new Dynamics365Account(_0x2f4a33);}else{_0x276f8a[_0x3d10('0x40')](_0x276f8a[_0x3d10('0x1e')][_0x2f4a33['id']],_0x2f4a33);}}}return _0x276f8a['dynamics365Accounts'];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x51')]=function(){var _0x431797=this;return function(_0x2461fa){if(_0x2461fa){freeIsNotKey(_0x2461fa,_0x431797[_0x3d10('0x1f')],'id');for(var _0x5d22f9=0x0,_0xf8b22a={},_0x46691d={};_0x5d22f9<_0x2461fa['length'];_0x5d22f9+=0x1){_0xf8b22a=_0x2461fa[_0x5d22f9];if(_[_0x3d10('0x42')](_0x431797[_0x3d10('0x1f')][_0xf8b22a['id']])){_0x431797[_0x3d10('0x1f')][_0xf8b22a['id']]=new FreshsalesAccount(_0xf8b22a);}else{_0x431797['mergeFromDatabase'](_0x431797[_0x3d10('0x1f')][_0xf8b22a['id']],_0xf8b22a);}}}return _0x431797[_0x3d10('0x1f')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x52')]=function(){var _0x160f32=this;return function(_0x173759){for(var _0x51d476=0x0;_0x51d476<_0x173759['length'];_0x51d476+=0x1){_[_0x3d10('0x53')](_0x160f32['voiceQueues'][_0x173759[_0x51d476]['name']],_0x173759[_0x51d476]);}return _0x160f32['voiceQueues'];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x54')]=function(){var _0x3a33c7=this;return function(_0x2b2d59){clearVoiceQueues(_0x3a33c7[_0x3d10('0x12')]);if(_0x2b2d59){_0x2b2d59=_[_0x3d10('0x55')](_0x2b2d59,_0x3d10('0x56'));for(var _0x7c3a64 in _0x2b2d59){if(_0x2b2d59[_0x3d10('0x22')](_0x7c3a64)){var _0x174285={};for(var _0x1251c6=0x0;_0x1251c6<_0x2b2d59[_0x7c3a64][_0x3d10('0x3d')];_0x1251c6+=0x1){var _0x2a78ac=_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x57')];if(_0x3a33c7[_0x3d10('0x12')][_0x2a78ac]){if(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x58')]){_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x2d')]+=0x1;}if(_0x2b2d59[_0x7c3a64][_0x1251c6]['queuecallerabandon']){_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x2e')]+=0x1;}_0x3a33c7['voiceQueues'][_0x2a78ac]['sumHoldTime']+=moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x59')])['diff'](moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5a')]),_0x3d10('0x5b'))||0x0;if(_0x1251c6===_0x2b2d59[_0x7c3a64][_0x3d10('0x3d')]-0x1){_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x29')]+=moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5c')]||_0x2b2d59[_0x7c3a64][_0x1251c6]['queuecallerabandonAt']||_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5d')])[_0x3d10('0x5e')](moment(_0x2b2d59[_0x7c3a64][_0x1251c6]['queuecallerjoinAt']),_0x3d10('0x5b'))||0x0;_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x2c')]+=0x1;if(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5f')]){_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x27')]+=0x1;_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x2f')]+=moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5c')])['diff'](moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x59')]),'seconds')||0x0;}}else{_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x29')]+=_0x3a33c7[_0x3d10('0x12')][_0x2a78ac]['sumHoldTime']||0x0;}}}}}}return _0x3a33c7[_0x3d10('0x12')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x60')]=function(){var _0x26b187=this;return function(_0x2a35f8){clearVoiceCallReports(_0x26b187[_0x3d10('0x61')]);if(_0x2a35f8){for(var _0x10b70b=0x0;_0x10b70b<_0x2a35f8[_0x3d10('0x3d')];_0x10b70b+=0x1){_0x26b187[_0x3d10('0x61')][_0x3d10('0x2c')]+=0x1;_0x26b187[_0x3d10('0x61')][_0x3d10('0x29')]+=_0x2a35f8[_0x10b70b][_0x3d10('0x62')];if(_0x2a35f8[_0x10b70b][_0x3d10('0x63')]===_0x3d10('0x64')){_0x26b187['outbound']['answered']+=0x1;_0x26b187[_0x3d10('0x61')][_0x3d10('0x28')]+=_0x2a35f8[_0x10b70b][_0x3d10('0x62')]-_0x2a35f8[_0x10b70b][_0x3d10('0x65')]||0x0;_0x26b187[_0x3d10('0x61')]['sumBillable']+=_0x2a35f8[_0x10b70b][_0x3d10('0x65')];}}}return _0x26b187[_0x3d10('0x61')];};};Realtime['prototype'][_0x3d10('0x66')]=function(){var _0x35dc44=this;return function(_0x1ac1e5){if(_0x1ac1e5){freeIsNotKey(_0x1ac1e5,_0x35dc44[_0x3d10('0x14')],'name');for(var _0x5ac851=0x0,_0x1d05dc={};_0x5ac851<_0x1ac1e5[_0x3d10('0x3d')];_0x5ac851+=0x1){_0x1d05dc=_0x1ac1e5[_0x5ac851];if(_[_0x3d10('0x42')](_0x35dc44['campaigns'][_0x1d05dc[_0x3d10('0x26')]])){_0x35dc44[_0x3d10('0x14')][_0x1d05dc[_0x3d10('0x26')]]=new Campaign(_0x1d05dc);}else{_0x35dc44[_0x3d10('0x40')](_0x35dc44['campaigns'][_0x1d05dc[_0x3d10('0x26')]],_0x1d05dc);_0x35dc44['campaigns'][_0x1d05dc[_0x3d10('0x26')]][_0x3d10('0x67')]=_0x1d05dc[_0x3d10('0x68')]?_0x1d05dc[_0x3d10('0x68')][_0x3d10('0x26')]:undefined;}}}return _0x35dc44['campaigns'];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x69')]=function(){var _0x4ccf2f=this;return function(_0x3a39d3){if(_0x3a39d3){freeIsNotKey(_0x3a39d3,_0x4ccf2f[_0x3d10('0x6a')],'id');for(var _0x70c0c8=0x0,_0x3e311b={};_0x70c0c8<_0x3a39d3[_0x3d10('0x3d')];_0x70c0c8+=0x1){_0x3e311b=_0x3a39d3[_0x70c0c8];if(_[_0x3d10('0x42')](_0x4ccf2f[_0x3d10('0x6a')][_0x3e311b['id']])){_0x4ccf2f[_0x3d10('0x6a')][_0x3e311b['id']]=new VoiceExtension(_0x3e311b);}else{_0x4ccf2f[_0x3d10('0x40')](_0x4ccf2f[_0x3d10('0x6a')][_0x3e311b['id']],_0x3e311b);}}}return _0x4ccf2f[_0x3d10('0x6a')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x6b')]=function(){var _0x21bd51=this;return function(_0x30dd91){clearCampaigns(_0x21bd51['campaigns']);for(var _0x547dc4=0x0;_0x547dc4<_0x30dd91[_0x3d10('0x3d')];_0x547dc4+=0x1){_[_0x3d10('0x53')](_0x21bd51[_0x3d10('0x14')][_0x30dd91[_0x547dc4][_0x3d10('0x26')]],_0x30dd91[_0x547dc4]);}return _0x21bd51[_0x3d10('0x14')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x6c')]=function(){var _0x2ccd0b=this;return function(_0x430e1d){if(_0x430e1d){freeIsNotKey(_0x430e1d,_0x2ccd0b[_0x3d10('0x20')],'id');for(var _0x29828b=0x0,_0x2776e4={},_0x388b23={};_0x29828b<_0x430e1d[_0x3d10('0x3d')];_0x29828b+=0x1){_0x2776e4=_0x430e1d[_0x29828b];if(_[_0x3d10('0x42')](_0x2ccd0b[_0x3d10('0x20')][_0x2776e4['id']])){_0x2ccd0b['faxAccounts'][_0x2776e4['id']]=new FaxAccount(_0x2776e4);}else{_0x2ccd0b['mergeFromDatabase'](_0x2ccd0b[_0x3d10('0x20')][_0x2776e4['id']],_0x2776e4);}}}return _0x2ccd0b[_0x3d10('0x20')];};};module[_0x3d10('0x6d')]=Realtime;
\ No newline at end of file
index b08175f..221dce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3de=['createdAt','connectedlinename','membername','create','Local','substring','indexOf','mobile','phone','lastIndexOf','SIP/%s','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','find','name','interface','format','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','voiceQueueReport','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','callerid','calleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','filename'];(function(_0x32b76d,_0x3c759d){var _0x3c4cee=function(_0x4cd54d){while(--_0x4cd54d){_0x32b76d['push'](_0x32b76d['shift']());}};_0x3c4cee(++_0x3c759d);}(_0xf3de,0x1c3));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef3d('0x0'));var moment=require(_0xef3d('0x1'));var util=require(_0xef3d('0x2'));var config=require('../../../config/environment');var ami=require(_0xef3d('0x3'));var RpcVoiceAgentReport=require(_0xef3d('0x4'));var RpcVoiceCallReport=require(_0xef3d('0x5'));var RpcVoiceDialReport=require(_0xef3d('0x6'));var RpcMemberReport=require(_0xef3d('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xef3d('0x8'));var VoiceQueueReport=require(_0xef3d('0x9'));var VoiceCallReport=require(_0xef3d('0xa'));var VoiceAgentReport=require(_0xef3d('0xb'));var VoiceDialReport=require(_0xef3d('0xc'));var UserReport=require(_0xef3d('0xd'));function Report(_0x2d4a77){this['realtime']=_0x2d4a77;this[_0xef3d('0xe')]=_0x2d4a77[_0xef3d('0xe')];this['telephones']=_0x2d4a77[_0xef3d('0xf')];}Report[_0xef3d('0x10')][_0xef3d('0x11')]=function(_0x68f05){var _0x99303=new VoiceQueueReport(this['realtime']);var _0x38155a=new VoiceAgentReport(this[_0xef3d('0x12')]);var _0x5e3632=new VoiceDialReport(this[_0xef3d('0x12')]);var _0x44f2c7=new VoiceCallReport(this['realtime']);var _0x223a40=new UserReport(this[_0xef3d('0x12')]);if(config[_0xef3d('0x13')]&&config[_0xef3d('0x13')][_0xef3d('0x14')]){ami['on'](_0xef3d('0x15'),this['voiceQueueReport'][_0xef3d('0x16')](this));ami['on'](_0xef3d('0x17'),this['voiceCallReport'][_0xef3d('0x16')](this));ami['on'](_0xef3d('0x18'),this[_0xef3d('0x19')][_0xef3d('0x16')](this));ami['on'](_0xef3d('0x1a'),this[_0xef3d('0x1b')][_0xef3d('0x16')](this));ami['on'](_0xef3d('0x1c'),this[_0xef3d('0x1d')][_0xef3d('0x16')](this));ami['on'](_0xef3d('0x1e'),this[_0xef3d('0x1f')]['bind'](this));}};Report[_0xef3d('0x10')][_0xef3d('0x20')]=function(_0x3dc7c1){var _0x383448;_0x383448=_['find'](this[_0xef3d('0xe')],function(_0x16b722){return _0x16b722[_0xef3d('0x21')]==_0x3dc7c1||_0x16b722['name']==_0x3dc7c1;});if(_['isNil'](_0x383448)){var _0x5cf1ff=_[_0xef3d('0x22')](this[_0xef3d('0xf')],function(_0x13e3cc){return _0x13e3cc[_0xef3d('0x21')]==_0x3dc7c1||_0x13e3cc[_0xef3d('0x23')]==_0x3dc7c1;});if(_0x5cf1ff){_0x383448=_[_0xef3d('0x22')](this['agents'],function(_0x2df3ac){return _0x2df3ac[_0xef3d('0x24')]==util[_0xef3d('0x25')]('SIP/%s',_0x5cf1ff[_0xef3d('0x23')]);});}}return _0x383448;};Report[_0xef3d('0x10')]['voiceQueueReport']=function(_0x2c9a9b){for(var _0x568e9a=0x0;_0x568e9a<_0x2c9a9b[_0xef3d('0x26')];_0x568e9a+=0x1){var _0x5e8a0d=this[_0xef3d('0x20')](_0x2c9a9b[_0x568e9a][_0xef3d('0x27')]);if(_0x5e8a0d){_0x2c9a9b[_0x568e9a]['accountcode']=_0x5e8a0d[_0xef3d('0x21')];_0x2c9a9b[_0x568e9a][_0xef3d('0x28')]=!![];_0x2c9a9b[_0x568e9a][_0xef3d('0x29')]=_0x5e8a0d[_0xef3d('0x23')];_0x2c9a9b[_0x568e9a][_0xef3d('0x24')]=_[_0xef3d('0x2a')](_0x5e8a0d[_0xef3d('0x24')])?util[_0xef3d('0x25')]('SIP/%s',_0x5e8a0d[_0xef3d('0x23')]):_0x5e8a0d['interface'];if(_0x2c9a9b[_0x568e9a][_0xef3d('0x2b')]){_0x2c9a9b[_0x568e9a][_0xef3d('0x2c')]=moment()[_0xef3d('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2c9a9b[_0x568e9a][_0xef3d('0x2d')]){_0x2c9a9b[_0x568e9a][_0xef3d('0x2e')]=moment()[_0xef3d('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xef3d('0x2f')](_0x2c9a9b[_0x568e9a]);}RpcVoiceQueueReport['create'](_0x2c9a9b[_0x568e9a]);}};function extractCalleridNumber(_0x36d356){var _0x24876e=_0x36d356['match'](/<(.*?)>/);return _0x24876e?_0x24876e[0x1]:_0x36d356;}Report[_0xef3d('0x10')][_0xef3d('0x30')]=function(_0x44ddb8){_0x44ddb8[_0xef3d('0x31')]=_0x44ddb8['destination']||_0x44ddb8[_0xef3d('0x32')];if(_0x44ddb8[_0xef3d('0x33')]==_0xef3d('0x34')){_0x44ddb8[_0xef3d('0x35')]=_0xef3d('0x36');_0x44ddb8[_0xef3d('0x37')]=_0x44ddb8[_0xef3d('0x36')];if(_0x44ddb8[_0xef3d('0x38')]==_0xef3d('0x39')){_0x44ddb8[_0xef3d('0x21')]='';_0x44ddb8[_0xef3d('0x31')]=extractCalleridNumber(_0x44ddb8['callerid']);}else if(_0x44ddb8[_0xef3d('0x38')]==_0xef3d('0x3a')){if(_0x44ddb8['destination']==_0xef3d('0x3b')){_0x44ddb8[_0xef3d('0x31')]=extractCalleridNumber(_0x44ddb8[_0xef3d('0x3c')]);_0x44ddb8['calleridnum']=_0x44ddb8[_0xef3d('0x3d')];_0x44ddb8[_0xef3d('0x3e')]=[_0x44ddb8[_0xef3d('0x3f')],_0x44ddb8[_0xef3d('0x3f')]=_0x44ddb8['destinationchannel']][0x0];_0x44ddb8[_0xef3d('0x40')]=_0x44ddb8[_0xef3d('0x3c')];}else{_0x44ddb8['destination']=_0x44ddb8[_0xef3d('0x41')];_0x44ddb8['calleridnum']=_0x44ddb8[_0xef3d('0x3d')];if(_0x44ddb8['disposition']==_0xef3d('0x42')){_0x44ddb8['accountcode']=_0x44ddb8['connectedlinenum'];}else{_0x44ddb8['accountcode']='';}}}}else{_0x44ddb8[_0xef3d('0x40')]=util[_0xef3d('0x25')](_0xef3d('0x43'),_0x44ddb8[_0xef3d('0x44')],_0x44ddb8[_0xef3d('0x41')]);}if(RpcVoiceTransferReport[_0xef3d('0x45')][_0x44ddb8[_0xef3d('0x46')]]){var _0x5a8e88=RpcVoiceTransferReport[_0xef3d('0x45')][_0x44ddb8[_0xef3d('0x46')]];_0x5a8e88[_0xef3d('0x47')]=_0x44ddb8[_0xef3d('0x48')];RpcVoiceTransferReport[_0xef3d('0x1d')](_0x5a8e88);delete RpcVoiceTransferReport[_0xef3d('0x45')][_0x44ddb8[_0xef3d('0x46')]];}RpcVoiceCallReport['create'](_0x44ddb8);if(_0x44ddb8[_0xef3d('0x49')]){for(var _0x3c7bda=0x0;_0x3c7bda<_0x44ddb8[_0xef3d('0x4a')][_0xef3d('0x26')];_0x3c7bda+=0x1){_0x44ddb8[_0xef3d('0x4b')]=_0x44ddb8['monitors'][_0x3c7bda][_0xef3d('0x4c')];_0x44ddb8[_0xef3d('0x4d')]=_0x44ddb8[_0xef3d('0x4a')][_0x3c7bda]['createdAt'];if(_0x44ddb8[_0xef3d('0x32')]==_0xef3d('0x3b')){_0x44ddb8['calleridnum']=_0x44ddb8['connectedlinenum'];_0x44ddb8[_0xef3d('0x44')]=_0x44ddb8[_0xef3d('0x4e')];_0x44ddb8[_0xef3d('0x27')]=_0x44ddb8[_0xef3d('0x21')];_0x44ddb8[_0xef3d('0x4e')]=_0x44ddb8[_0xef3d('0x4f')];_0x44ddb8[_0xef3d('0x32')]=_0x44ddb8[_0xef3d('0x3d')];}else if(_0x44ddb8[_0xef3d('0x32')]=='xcally-motion-dialer'){_0x44ddb8[_0xef3d('0x41')]=_0x44ddb8[_0xef3d('0x31')];_0x44ddb8[_0xef3d('0x32')]=_0x44ddb8['originatecalleridnum'];}RpcVoiceRecording[_0xef3d('0x50')](_0x44ddb8);}}};Report[_0xef3d('0x10')][_0xef3d('0x19')]=function(_0x1d5db3){if(_['isArray'](_0x1d5db3)){_0x1d5db3['forEach'](function(_0x333f6e){RpcVoiceAgentReport['create'](_0x333f6e);});}else{RpcVoiceAgentReport[_0xef3d('0x50')](_0x1d5db3);}};Report[_0xef3d('0x10')][_0xef3d('0x1b')]=function(_0x5191b8){RpcVoiceDialReport[_0xef3d('0x50')](_0x5191b8);var _0x640ffa;var _0x42a700;var _0x14e96d=_0x5191b8[_0xef3d('0x3f')];if(_['startsWith'](_0x14e96d,_0xef3d('0x51'))){_0x42a700=_0x14e96d[_0xef3d('0x52')](_0x14e96d[_0xef3d('0x53')]('/')+0x1,_0x14e96d[_0xef3d('0x53')]('@'));_0x640ffa=_['find'](this['agents'],function(_0x42a476){return _0x42a476[_0xef3d('0x54')]==_0x42a700||_0x42a476[_0xef3d('0x55')]==_0x42a700||_0x42a476['accountcode']==_0x42a700;});}else{_0x42a700=_0x14e96d[_0xef3d('0x52')](_0x14e96d[_0xef3d('0x53')]('/')+0x1,_0x14e96d[_0xef3d('0x56')]('-'));_0x640ffa=this[_0xef3d('0x20')](_0x42a700);}if(_0x640ffa){_0x5191b8[_0xef3d('0x24')]=_[_0xef3d('0x2a')](_0x640ffa[_0xef3d('0x24')])?util[_0xef3d('0x25')](_0xef3d('0x57'),_0x640ffa[_0xef3d('0x23')]):_0x640ffa[_0xef3d('0x24')];_0x5191b8[_0xef3d('0x4f')]=_0x640ffa[_0xef3d('0x23')];_0x5191b8[_0xef3d('0x21')]=_0x640ffa[_0xef3d('0x21')];RpcMemberReport[_0xef3d('0x1b')](_0x5191b8);}};Report[_0xef3d('0x10')][_0xef3d('0x1d')]=function(_0x408748){RpcVoiceTransferReport[_0xef3d('0x45')][_0x408748['transfererlinkedid']]=_0x408748;};Report['prototype']['attendedTransfer']=function(_0xbec8c4){RpcVoiceTransferReport['attendedTransfer'](_0xbec8c4);};module['exports']=Report;
\ No newline at end of file
+var _0x48b9=['xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','accountcode','name','isNil','find','format','SIP/%s','length','connectedlinenum','interface','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','lastapplication','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','monitor','monitors','filename','createdAt','xcally-motion-preview','calleridname','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime'];(function(_0x4b12ae,_0xf2b3b){var _0x16957b=function(_0x51932c){while(--_0x51932c){_0x4b12ae['push'](_0x4b12ae['shift']());}};_0x16957b(++_0xf2b3b);}(_0x48b9,0x1a7));var _0x948b=function(_0x211448,_0x333996){_0x211448=_0x211448-0x0;var _0x162266=_0x48b9[_0x211448];return _0x162266;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x948b('0x0'));var config=require(_0x948b('0x1'));var ami=require(_0x948b('0x2'));var RpcVoiceAgentReport=require(_0x948b('0x3'));var RpcVoiceCallReport=require(_0x948b('0x4'));var RpcVoiceDialReport=require(_0x948b('0x5'));var RpcMemberReport=require(_0x948b('0x6'));var RpcVoiceQueueReport=require(_0x948b('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x948b('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x948b('0x9'));var VoiceAgentReport=require(_0x948b('0xa'));var VoiceDialReport=require(_0x948b('0xb'));var UserReport=require(_0x948b('0xc'));function Report(_0x3bfce6){this['realtime']=_0x3bfce6;this['agents']=_0x3bfce6[_0x948b('0xd')];this['telephones']=_0x3bfce6[_0x948b('0xe')];}Report['prototype'][_0x948b('0xf')]=function(_0x4df830){var _0x43a797=new VoiceQueueReport(this[_0x948b('0x10')]);var _0x25ac45=new VoiceAgentReport(this[_0x948b('0x10')]);var _0x3fd5ab=new VoiceDialReport(this[_0x948b('0x10')]);var _0x1ca671=new VoiceCallReport(this[_0x948b('0x10')]);var _0x586f19=new UserReport(this['realtime']);if(config[_0x948b('0x11')]&&config[_0x948b('0x11')]['disabled']){ami['on'](_0x948b('0x12'),this[_0x948b('0x13')][_0x948b('0x14')](this));ami['on'](_0x948b('0x15'),this[_0x948b('0x16')][_0x948b('0x14')](this));ami['on'](_0x948b('0x17'),this['voiceAgentReport'][_0x948b('0x14')](this));ami['on'](_0x948b('0x18'),this[_0x948b('0x19')]['bind'](this));ami['on'](_0x948b('0x1a'),this['blindTransfer'][_0x948b('0x14')](this));ami['on'](_0x948b('0x1b'),this[_0x948b('0x1c')]['bind'](this));}};Report[_0x948b('0x1d')][_0x948b('0x1e')]=function(_0x1d2508){var _0x2d9e54;_0x2d9e54=_['find'](this['agents'],function(_0x25d90e){return _0x25d90e[_0x948b('0x1f')]==_0x1d2508||_0x25d90e[_0x948b('0x20')]==_0x1d2508;});if(_[_0x948b('0x21')](_0x2d9e54)){var _0x43b0d8=_[_0x948b('0x22')](this[_0x948b('0xe')],function(_0x10ab6f){return _0x10ab6f[_0x948b('0x1f')]==_0x1d2508||_0x10ab6f['name']==_0x1d2508;});if(_0x43b0d8){_0x2d9e54=_['find'](this[_0x948b('0xd')],function(_0x68a133){return _0x68a133['interface']==util[_0x948b('0x23')](_0x948b('0x24'),_0x43b0d8[_0x948b('0x20')]);});}}return _0x2d9e54;};Report['prototype'][_0x948b('0x13')]=function(_0x5b5997){for(var _0x34b737=0x0;_0x34b737<_0x5b5997[_0x948b('0x25')];_0x34b737+=0x1){var _0xd04c52=this[_0x948b('0x1e')](_0x5b5997[_0x34b737][_0x948b('0x26')]);if(_0xd04c52){_0x5b5997[_0x34b737][_0x948b('0x1f')]=_0xd04c52[_0x948b('0x1f')];_0x5b5997[_0x34b737]['assigned']=!![];_0x5b5997[_0x34b737]['lastAssignedTo']=_0xd04c52[_0x948b('0x20')];_0x5b5997[_0x34b737][_0x948b('0x27')]=_[_0x948b('0x21')](_0xd04c52['interface'])?util['format'](_0x948b('0x24'),_0xd04c52[_0x948b('0x20')]):_0xd04c52[_0x948b('0x27')];if(_0x5b5997[_0x34b737][_0x948b('0x28')]){_0x5b5997[_0x34b737]['queuecallercompleteAt']=moment()[_0x948b('0x23')](_0x948b('0x29'));}if(_0x5b5997[_0x34b737][_0x948b('0x2a')]){_0x5b5997[_0x34b737][_0x948b('0x2b')]=moment()[_0x948b('0x23')](_0x948b('0x29'));}RpcMemberReport['voiceQueueReport'](_0x5b5997[_0x34b737]);}RpcVoiceQueueReport[_0x948b('0x2c')](_0x5b5997[_0x34b737]);}};function extractCalleridNumber(_0x1bf13f){var _0x169939=_0x1bf13f[_0x948b('0x2d')](/<(.*?)>/);return _0x169939?_0x169939[0x1]:_0x1bf13f;}Report['prototype'][_0x948b('0x16')]=function(_0x4be730){_0x4be730[_0x948b('0x2e')]=_0x4be730[_0x948b('0x2e')]||_0x4be730[_0x948b('0x2f')];if(_0x4be730[_0x948b('0x30')]=='dialer'){_0x4be730[_0x948b('0x31')]='queue';_0x4be730[_0x948b('0x32')]=_0x4be730['queue'];if(_0x4be730[_0x948b('0x33')]==_0x948b('0x34')){_0x4be730[_0x948b('0x1f')]='';_0x4be730['destination']=extractCalleridNumber(_0x4be730[_0x948b('0x35')]);}else if(_0x4be730['context']==_0x948b('0x36')){if(_0x4be730[_0x948b('0x2e')]=='xcally-motion-preview'){_0x4be730['destination']=extractCalleridNumber(_0x4be730[_0x948b('0x37')]);_0x4be730[_0x948b('0x38')]=_0x4be730[_0x948b('0x39')];_0x4be730[_0x948b('0x3a')]=[_0x4be730[_0x948b('0x3b')],_0x4be730[_0x948b('0x3b')]=_0x4be730[_0x948b('0x3a')]][0x0];_0x4be730['callerid']=_0x4be730[_0x948b('0x37')];}else{_0x4be730['destination']=_0x4be730['calleridnum'];_0x4be730['calleridnum']=_0x4be730[_0x948b('0x39')];if(_0x4be730[_0x948b('0x3c')]==_0x948b('0x3d')){_0x4be730[_0x948b('0x1f')]=_0x4be730[_0x948b('0x26')];}else{_0x4be730[_0x948b('0x1f')]='';}}}}else{_0x4be730['callerid']=util['format'](_0x948b('0x3e'),_0x4be730['calleridname'],_0x4be730[_0x948b('0x38')]);}if(RpcVoiceTransferReport[_0x948b('0x3f')][_0x4be730[_0x948b('0x40')]]){var _0x2041f0=RpcVoiceTransferReport[_0x948b('0x3f')][_0x4be730['linkedid']];_0x2041f0[_0x948b('0x41')]=_0x4be730[_0x948b('0x42')];RpcVoiceTransferReport[_0x948b('0x43')](_0x2041f0);delete RpcVoiceTransferReport[_0x948b('0x3f')][_0x4be730[_0x948b('0x40')]];}RpcVoiceCallReport[_0x948b('0x2c')](_0x4be730);if(_0x4be730[_0x948b('0x44')]){for(var _0x1134b0=0x0;_0x1134b0<_0x4be730['monitors']['length'];_0x1134b0+=0x1){_0x4be730['monitorFilename']=_0x4be730[_0x948b('0x45')][_0x1134b0][_0x948b('0x46')];_0x4be730[_0x948b('0x47')]=_0x4be730[_0x948b('0x45')][_0x1134b0][_0x948b('0x47')];if(_0x4be730[_0x948b('0x2f')]==_0x948b('0x48')){_0x4be730[_0x948b('0x38')]=_0x4be730[_0x948b('0x26')];_0x4be730[_0x948b('0x49')]=_0x4be730['connectedlinename'];_0x4be730[_0x948b('0x26')]=_0x4be730['accountcode'];_0x4be730[_0x948b('0x4a')]=_0x4be730[_0x948b('0x4b')];_0x4be730[_0x948b('0x2f')]=_0x4be730[_0x948b('0x39')];}else if(_0x4be730[_0x948b('0x2f')]==_0x948b('0x4c')){_0x4be730['calleridnum']=_0x4be730[_0x948b('0x2e')];_0x4be730[_0x948b('0x2f')]=_0x4be730[_0x948b('0x39')];}RpcVoiceRecording['create'](_0x4be730);}}};Report[_0x948b('0x1d')][_0x948b('0x4d')]=function(_0x38cd22){if(_[_0x948b('0x4e')](_0x38cd22)){_0x38cd22['forEach'](function(_0x3d4e4d){RpcVoiceAgentReport[_0x948b('0x2c')](_0x3d4e4d);});}else{RpcVoiceAgentReport[_0x948b('0x2c')](_0x38cd22);}};Report[_0x948b('0x1d')][_0x948b('0x19')]=function(_0xe4067b){RpcVoiceDialReport[_0x948b('0x2c')](_0xe4067b);var _0x57a25b;var _0x2cb105;var _0xc5f758=_0xe4067b[_0x948b('0x3b')];if(_[_0x948b('0x4f')](_0xc5f758,_0x948b('0x50'))){_0x2cb105=_0xc5f758[_0x948b('0x51')](_0xc5f758[_0x948b('0x52')]('/')+0x1,_0xc5f758[_0x948b('0x52')]('@'));_0x57a25b=_[_0x948b('0x22')](this[_0x948b('0xd')],function(_0x2b19d0){return _0x2b19d0[_0x948b('0x53')]==_0x2cb105||_0x2b19d0[_0x948b('0x54')]==_0x2cb105||_0x2b19d0[_0x948b('0x1f')]==_0x2cb105;});}else{_0x2cb105=_0xc5f758[_0x948b('0x51')](_0xc5f758[_0x948b('0x52')]('/')+0x1,_0xc5f758[_0x948b('0x55')]('-'));_0x57a25b=this['findAgent'](_0x2cb105);}if(_0x57a25b){_0xe4067b[_0x948b('0x27')]=_['isNil'](_0x57a25b['interface'])?util[_0x948b('0x23')](_0x948b('0x24'),_0x57a25b['name']):_0x57a25b[_0x948b('0x27')];_0xe4067b[_0x948b('0x4b')]=_0x57a25b[_0x948b('0x20')];_0xe4067b[_0x948b('0x1f')]=_0x57a25b['accountcode'];RpcMemberReport['voiceDialReport'](_0xe4067b);}};Report[_0x948b('0x1d')][_0x948b('0x43')]=function(_0x2ea2e2){RpcVoiceTransferReport[_0x948b('0x3f')][_0x2ea2e2[_0x948b('0x56')]]=_0x2ea2e2;};Report[_0x948b('0x1d')][_0x948b('0x1c')]=function(_0x17fcfd){RpcVoiceTransferReport[_0x948b('0x1c')](_0x17fcfd);};module[_0x948b('0x57')]=Report;
\ No newline at end of file
index 92b3ba9..5c2584f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac3f=['[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','isNotNull','isUndefined','prototype','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','username','merge','omit','event','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','inuse','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','Local','substring','indexOf','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status'];(function(_0xbd4eb7,_0x527b62){var _0x1bf52c=function(_0x599786){while(--_0x599786){_0xbd4eb7['push'](_0xbd4eb7['shift']());}};_0x1bf52c(++_0x527b62);}(_0xac3f,0x98));var _0xfac3=function(_0x161f59,_0x42e9ff){_0x161f59=_0x161f59-0x0;var _0x3ffa0e=_0xac3f[_0x161f59];return _0x3ffa0e;};'use strict';var _=require(_0xfac3('0x0'));var moment=require(_0xfac3('0x1'));var util=require('util');var Redis=require('ioredis');var BPromise=require(_0xfac3('0x2'));var config=require(_0xfac3('0x3'));var logger=require('../../../config/logger')(_0xfac3('0x4'));var ami=require(_0xfac3('0x5'));config[_0xfac3('0x6')]=_[_0xfac3('0x7')](config['redis'],{'host':_0xfac3('0x8'),'port':0x18eb});var io=require(_0xfac3('0x9'))(new Redis(config['redis']));function UserReport(_0x3e724d){this[_0xfac3('0xa')]=_0x3e724d[_0xfac3('0xa')];this[_0xfac3('0xb')]=_0x3e724d[_0xfac3('0xb')];this[_0xfac3('0xc')]=_0x3e724d[_0xfac3('0xc')];ami['on'](_0xfac3('0xd'),this[_0xfac3('0xe')]['bind'](this));ami['on']('registry',this[_0xfac3('0xe')][_0xfac3('0xf')](this));ami['on'](_0xfac3('0x10'),this[_0xfac3('0x11')][_0xfac3('0xf')](this));ami['on'](_0xfac3('0x12'),this['syncPeerStatus'][_0xfac3('0xf')](this));return this[_0xfac3('0x13')]();}function showSipRegistrations(){Promise[_0xfac3('0x14')]()[_0xfac3('0x15')](ami[_0xfac3('0x16')]())[_0xfac3('0x17')](function(_0x242eeb){logger[_0xfac3('0x18')](_0xfac3('0x19'),util[_0xfac3('0x1a')](_0x242eeb,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xfac3('0x14')]()[_0xfac3('0x15')](ami[_0xfac3('0x1b')]())[_0xfac3('0x17')](function(_0x592ce8){logger[_0xfac3('0x18')](_0xfac3('0x1c'),util[_0xfac3('0x1a')](_0x592ce8,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xfac3('0x14')]()['then'](ami[_0xfac3('0x1d')]())['catch'](function(_0x45a353){logger['error'](_0xfac3('0x1e'),util[_0xfac3('0x1a')](_0x45a353,{'showHidden':![],'depth':null}));});}UserReport['prototype']['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0xfac3('0x15')](showSipRegistrations())[_0xfac3('0x15')](listDeviceStates())[_0xfac3('0x15')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xfac3('0x1f')]=function(_0x280c2e){return _0x280c2e!==null&&!_[_0xfac3('0x20')](_0x280c2e);};UserReport[_0xfac3('0x21')][_0xfac3('0x22')]=function(_0xa9fdc4,_0x3e417d,_0x838a5d){io['to'](_0xa9fdc4)['emit'](_0x3e417d,_0x838a5d);};UserReport[_0xfac3('0x21')]['syncRegistry']=function(_0x5f5d9b){try{if(this[_0xfac3('0x1f')](_0x5f5d9b)){logger[_0xfac3('0x23')](_0xfac3('0x24'),_0x5f5d9b['username'],_0x5f5d9b[_0xfac3('0x25')]);logger[_0xfac3('0x26')](_0xfac3('0x27'),util[_0xfac3('0x1a')](_0x5f5d9b,{'showHidden':![],'depth':null}));var _0x4ac093=_['find'](this[_0xfac3('0xa')],{'defaultuser':_0x5f5d9b[_0xfac3('0x28')]});if(_0x4ac093){_0x5f5d9b['stateRegistry']=_0x5f5d9b[_0xfac3('0x25')];_[_0xfac3('0x29')](_0x4ac093,_[_0xfac3('0x2a')](_0x5f5d9b,[_0xfac3('0x2b'),'actionid','username',_0xfac3('0x25')]));logger[_0xfac3('0x26')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xfac3('0x1a')](_0x4ac093,{'showHidden':![],'depth':null}));this['emit'](util[_0xfac3('0x2c')](_0xfac3('0x2d'),_0x4ac093[_0xfac3('0x2e')]),_0xfac3('0x2f'),_0x4ac093);}}}catch(_0x4593bd){logger['error'](_0xfac3('0x27'),util[_0xfac3('0x1a')](_0x4593bd,{'showHidden':![],'depth':null}));}};UserReport[_0xfac3('0x21')]['syncDeviceState']=function(_0x203d19){try{if(this[_0xfac3('0x1f')](_0x203d19)){logger['info'](_0xfac3('0x30'),_0x203d19[_0xfac3('0x31')],_0x203d19[_0xfac3('0x25')]);logger[_0xfac3('0x26')](_0xfac3('0x32'),util[_0xfac3('0x1a')](_0x203d19,{'showHidden':![],'depth':null}));if(this[_0xfac3('0xb')][_0x203d19[_0xfac3('0x31')]]){if(!this[_0xfac3('0xb')][_0x203d19[_0xfac3('0x31')]]['local']||_0x203d19[_0xfac3('0x25')]['toLowerCase']()==_0xfac3('0x33')){this[_0xfac3('0xb')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x34')]=![];if(this[_0xfac3('0xb')][_0x203d19[_0xfac3('0x31')]]['state']!==_0x203d19[_0xfac3('0x25')][_0xfac3('0x35')]()){this[_0xfac3('0xb')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x36')]=_[_0xfac3('0x37')](moment()[_0xfac3('0x2c')]('x'));}this[_0xfac3('0xb')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x25')]=_0x203d19[_0xfac3('0x25')][_0xfac3('0x35')]();this[_0xfac3('0xb')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x38')](_0x203d19);}}else if(this[_0xfac3('0xc')][_0x203d19[_0xfac3('0x31')]]){if(this[_0xfac3('0xc')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x25')]!==_0x203d19[_0xfac3('0x25')][_0xfac3('0x35')]()){this[_0xfac3('0xc')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x36')]=_[_0xfac3('0x37')](moment()[_0xfac3('0x2c')]('x'));}this[_0xfac3('0xc')][_0x203d19['device']][_0xfac3('0x25')]=_0x203d19[_0xfac3('0x25')][_0xfac3('0x35')]();logger[_0xfac3('0x26')](_0xfac3('0x39'),util[_0xfac3('0x1a')](this['telephones'][_0x203d19['device']],{'showHidden':![],'depth':null}));this[_0xfac3('0x22')](util[_0xfac3('0x2c')]('telephone:%s',this[_0xfac3('0xc')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x2e')]),_0xfac3('0x3a'),this[_0xfac3('0xc')][_0x203d19[_0xfac3('0x31')]]);}else if(this['trunks'][_0x203d19[_0xfac3('0x31')]]){if(this[_0xfac3('0xa')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x25')]!==_0x203d19[_0xfac3('0x25')][_0xfac3('0x35')]()){this[_0xfac3('0xa')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x36')]=_[_0xfac3('0x37')](moment()['format']('x'));}this[_0xfac3('0xa')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x25')]=_0x203d19[_0xfac3('0x25')][_0xfac3('0x35')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0xfac3('0xa')][_0x203d19[_0xfac3('0x31')]],{'showHidden':![],'depth':null}));this[_0xfac3('0x22')](util[_0xfac3('0x2c')](_0xfac3('0x2d'),this[_0xfac3('0xa')][_0x203d19[_0xfac3('0x31')]][_0xfac3('0x2e')]),_0xfac3('0x2f'),this[_0xfac3('0xa')][_0x203d19['device']]);}else if(_['startsWith'](_0x203d19['device'],_0xfac3('0x3b'))){var _0x3714f6=_0x203d19[_0xfac3('0x31')];var _0x453d8d=_0x3714f6[_0xfac3('0x3c')](_0x3714f6[_0xfac3('0x3d')]('/')+0x1,_0x3714f6[_0xfac3('0x3d')]('@'));var _0xf747c7=_['find'](this[_0xfac3('0xb')],function(_0xa51670){return _0xa51670[_0xfac3('0x3e')]==_0x453d8d||_0xa51670[_0xfac3('0x3f')]==_0x453d8d||_0xa51670[_0xfac3('0x40')]==_0x453d8d;});if(_0xf747c7){if(_0xf747c7['state']!==_0x203d19['state'][_0xfac3('0x35')]()){_0xf747c7['stateTime']=_[_0xfac3('0x37')](moment()[_0xfac3('0x2c')]('x'));}_0xf747c7['state']=_0x203d19[_0xfac3('0x25')][_0xfac3('0x35')]();_0xf747c7['local']=!![];_0xf747c7[_0xfac3('0x38')](_0x203d19);}}}}catch(_0x712cb1){logger[_0xfac3('0x18')](_0xfac3('0x32'),util[_0xfac3('0x1a')](_0x712cb1,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x26874a){try{if(this[_0xfac3('0x1f')](_0x26874a)&&this['isNotNull'](_0x26874a[_0xfac3('0x12')])){logger[_0xfac3('0x23')](_0xfac3('0x41'),_0x26874a[_0xfac3('0x42')],_0x26874a[_0xfac3('0x43')],_0x26874a[_0xfac3('0x12')]);logger[_0xfac3('0x26')](_0xfac3('0x44'),util[_0xfac3('0x1a')](_0x26874a,{'showHidden':![],'depth':null}));if(this['agents'][_0x26874a[_0xfac3('0x42')]]){if(!this[_0xfac3('0xb')][_0x26874a['peer']][_0xfac3('0x34')]||_0x26874a[_0xfac3('0x12')][_0xfac3('0x35')]()=='registered'){this[_0xfac3('0xb')][_0x26874a[_0xfac3('0x42')]][_0xfac3('0x34')]=![];this[_0xfac3('0xb')][_0x26874a[_0xfac3('0x42')]][_0xfac3('0x45')]=_0x26874a[_0xfac3('0x12')][_0xfac3('0x35')]();this[_0xfac3('0xb')][_0x26874a[_0xfac3('0x42')]]['address']=_0x26874a['address'];this[_0xfac3('0xb')][_0x26874a[_0xfac3('0x42')]][_0xfac3('0x38')](_0x26874a);}}else if(this['telephones'][_0x26874a[_0xfac3('0x42')]]){this[_0xfac3('0xc')][_0x26874a[_0xfac3('0x42')]][_0xfac3('0x45')]=_0x26874a[_0xfac3('0x12')][_0xfac3('0x35')]();this[_0xfac3('0xc')][_0x26874a['peer']][_0xfac3('0x43')]=_0x26874a[_0xfac3('0x43')];logger[_0xfac3('0x26')](_0xfac3('0x46'),util[_0xfac3('0x1a')](this[_0xfac3('0xc')][_0x26874a[_0xfac3('0x42')]],{'showHidden':![],'depth':null}));this[_0xfac3('0x22')](util[_0xfac3('0x2c')](_0xfac3('0x47'),this[_0xfac3('0xc')][_0x26874a[_0xfac3('0x42')]][_0xfac3('0x2e')]),_0xfac3('0x3a'),this[_0xfac3('0xc')][_0x26874a[_0xfac3('0x42')]]);}else if(this[_0xfac3('0xa')][_0x26874a['peer']]){this[_0xfac3('0xa')][_0x26874a[_0xfac3('0x42')]][_0xfac3('0x45')]=_0x26874a['peerstatus'][_0xfac3('0x35')]();this[_0xfac3('0xa')][_0x26874a[_0xfac3('0x42')]][_0xfac3('0x43')]=_0x26874a['address'];logger[_0xfac3('0x26')](_0xfac3('0x48'),util[_0xfac3('0x1a')](this['trunks'][_0x26874a[_0xfac3('0x42')]],{'showHidden':![],'depth':null}));this[_0xfac3('0x22')](util[_0xfac3('0x2c')](_0xfac3('0x2d'),this['trunks'][_0x26874a[_0xfac3('0x42')]]['name']),_0xfac3('0x2f'),this[_0xfac3('0xa')][_0x26874a[_0xfac3('0x42')]]);}}}catch(_0x345957){logger['error'](_0xfac3('0x44'),util['inspect'](_0x345957,{'showHidden':![],'depth':null}));}};module[_0xfac3('0x49')]=UserReport;
\ No newline at end of file
+var _0xdc54=['syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','util','bluebird','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','peerstatus','resolve','then','actionSipShowRegistry','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','merge','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','trunk:save','startsWith','substring','phone','accountcode','updateStatusRealtime','[userReport][devicestatechange]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc54,0xda));var _0x4dc5=function(_0x5881c4,_0x2294c0){_0x5881c4=_0x5881c4-0x0;var _0xb759b6=_0xdc54[_0x5881c4];return _0xb759b6;};'use strict';var _=require(_0x4dc5('0x0'));var moment=require('moment');var util=require(_0x4dc5('0x1'));var Redis=require('ioredis');var BPromise=require(_0x4dc5('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x4dc5('0x3'));config[_0x4dc5('0x4')]=_[_0x4dc5('0x5')](config[_0x4dc5('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4dc5('0x6'))(new Redis(config[_0x4dc5('0x4')]));function UserReport(_0x59bccf){this[_0x4dc5('0x7')]=_0x59bccf[_0x4dc5('0x7')];this[_0x4dc5('0x8')]=_0x59bccf['agents'];this[_0x4dc5('0x9')]=_0x59bccf['telephones'];ami['on'](_0x4dc5('0xa'),this[_0x4dc5('0xb')][_0x4dc5('0xc')](this));ami['on'](_0x4dc5('0xd'),this['syncRegistry']['bind'](this));ami['on']('devicestatechange',this[_0x4dc5('0xe')][_0x4dc5('0xc')](this));ami['on'](_0x4dc5('0xf'),this['syncPeerStatus'][_0x4dc5('0xc')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x4dc5('0x10')]()[_0x4dc5('0x11')](ami[_0x4dc5('0x12')]())[_0x4dc5('0x13')](function(_0x113cd1){logger[_0x4dc5('0x14')]('[userReport][sipshowregistry]',util[_0x4dc5('0x15')](_0x113cd1,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x4dc5('0x11')](ami[_0x4dc5('0x16')]())['catch'](function(_0x21004b){logger[_0x4dc5('0x14')](_0x4dc5('0x17'),util[_0x4dc5('0x15')](_0x21004b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x4dc5('0x11')](ami[_0x4dc5('0x18')]())[_0x4dc5('0x13')](function(_0xd5ec72){logger['error'](_0x4dc5('0x19'),util['inspect'](_0xd5ec72,{'showHidden':![],'depth':null}));});}UserReport[_0x4dc5('0x1a')][_0x4dc5('0x1b')]=function(){setInterval(function(){BPromise[_0x4dc5('0x10')]()[_0x4dc5('0x11')](showSipRegistrations())[_0x4dc5('0x11')](listDeviceStates())[_0x4dc5('0x11')](showPeersStatus());},0x32c8);};UserReport[_0x4dc5('0x1a')][_0x4dc5('0x1c')]=function(_0x5ab238){return _0x5ab238!==null&&!_[_0x4dc5('0x1d')](_0x5ab238);};UserReport[_0x4dc5('0x1a')][_0x4dc5('0x1e')]=function(_0x45b0a3,_0xd6f4cf,_0x4bfd7a){io['to'](_0x45b0a3)[_0x4dc5('0x1e')](_0xd6f4cf,_0x4bfd7a);};UserReport[_0x4dc5('0x1a')]['syncRegistry']=function(_0x392732){try{if(this['isNotNull'](_0x392732)){logger[_0x4dc5('0x1f')](_0x4dc5('0x20'),_0x392732[_0x4dc5('0x21')],_0x392732[_0x4dc5('0x22')]);logger[_0x4dc5('0x23')](_0x4dc5('0x24'),util[_0x4dc5('0x15')](_0x392732,{'showHidden':![],'depth':null}));var _0x1b24f8=_[_0x4dc5('0x25')](this[_0x4dc5('0x7')],{'defaultuser':_0x392732['username']});if(_0x1b24f8){_0x392732[_0x4dc5('0x26')]=_0x392732[_0x4dc5('0x22')];_[_0x4dc5('0x27')](_0x1b24f8,_['omit'](_0x392732,[_0x4dc5('0x28'),'actionid',_0x4dc5('0x21'),_0x4dc5('0x22')]));logger['debug'](_0x4dc5('0x29'),util[_0x4dc5('0x15')](_0x1b24f8,{'showHidden':![],'depth':null}));this[_0x4dc5('0x1e')](util[_0x4dc5('0x2a')](_0x4dc5('0x2b'),_0x1b24f8['name']),'trunk:save',_0x1b24f8);}}}catch(_0x16c76a){logger['error'](_0x4dc5('0x24'),util[_0x4dc5('0x15')](_0x16c76a,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x4d81c3){try{if(this['isNotNull'](_0x4d81c3)){logger[_0x4dc5('0x1f')](_0x4dc5('0x2c'),_0x4d81c3['device'],_0x4d81c3[_0x4dc5('0x22')]);logger['debug']('[userReport][devicestatechange]',util[_0x4dc5('0x15')](_0x4d81c3,{'showHidden':![],'depth':null}));if(this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]]){if(!this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x2e')]||_0x4d81c3[_0x4dc5('0x22')][_0x4dc5('0x2f')]()==_0x4dc5('0x30')){this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]]['local']=![];if(this['agents'][_0x4d81c3[_0x4dc5('0x2d')]]['state']!==_0x4d81c3[_0x4dc5('0x22')][_0x4dc5('0x2f')]()){this[_0x4dc5('0x8')][_0x4d81c3['device']][_0x4dc5('0x31')]=_[_0x4dc5('0x32')](moment()['format']('x'));}this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x22')]=_0x4d81c3['state']['toLowerCase']();this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]]['updateStatusRealtime'](_0x4d81c3);}}else if(this[_0x4dc5('0x9')][_0x4d81c3['device']]){if(this['telephones'][_0x4d81c3[_0x4dc5('0x2d')]]['state']!==_0x4d81c3[_0x4dc5('0x22')]['toLowerCase']()){this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x31')]=_[_0x4dc5('0x32')](moment()[_0x4dc5('0x2a')]('x'));}this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x22')]=_0x4d81c3[_0x4dc5('0x22')][_0x4dc5('0x2f')]();logger[_0x4dc5('0x23')](_0x4dc5('0x33'),util['inspect'](this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x4dc5('0x2a')](_0x4dc5('0x34'),this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x35')]),_0x4dc5('0x36'),this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]]);}else if(this['trunks'][_0x4d81c3[_0x4dc5('0x2d')]]){if(this[_0x4dc5('0x7')][_0x4d81c3['device']][_0x4dc5('0x22')]!==_0x4d81c3[_0x4dc5('0x22')][_0x4dc5('0x2f')]()){this[_0x4dc5('0x7')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x31')]=_[_0x4dc5('0x32')](moment()[_0x4dc5('0x2a')]('x'));}this['trunks'][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x22')]=_0x4d81c3['state'][_0x4dc5('0x2f')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x4dc5('0x7')][_0x4d81c3[_0x4dc5('0x2d')]],{'showHidden':![],'depth':null}));this[_0x4dc5('0x1e')](util['format'](_0x4dc5('0x2b'),this[_0x4dc5('0x7')][_0x4d81c3['device']]['name']),_0x4dc5('0x37'),this['trunks'][_0x4d81c3[_0x4dc5('0x2d')]]);}else if(_[_0x4dc5('0x38')](_0x4d81c3[_0x4dc5('0x2d')],'Local')){var _0x421406=_0x4d81c3['device'];var _0x464d77=_0x421406[_0x4dc5('0x39')](_0x421406['indexOf']('/')+0x1,_0x421406['indexOf']('@'));var _0x2252d7=_[_0x4dc5('0x25')](this['agents'],function(_0x46f389){return _0x46f389['mobile']==_0x464d77||_0x46f389[_0x4dc5('0x3a')]==_0x464d77||_0x46f389[_0x4dc5('0x3b')]==_0x464d77;});if(_0x2252d7){if(_0x2252d7[_0x4dc5('0x22')]!==_0x4d81c3['state'][_0x4dc5('0x2f')]()){_0x2252d7[_0x4dc5('0x31')]=_['toNumber'](moment()[_0x4dc5('0x2a')]('x'));}_0x2252d7['state']=_0x4d81c3[_0x4dc5('0x22')]['toLowerCase']();_0x2252d7['local']=!![];_0x2252d7[_0x4dc5('0x3c')](_0x4d81c3);}}}}catch(_0x444223){logger[_0x4dc5('0x14')](_0x4dc5('0x3d'),util[_0x4dc5('0x15')](_0x444223,{'showHidden':![],'depth':null}));}};UserReport[_0x4dc5('0x1a')][_0x4dc5('0x3e')]=function(_0x10849a){try{if(this['isNotNull'](_0x10849a)&&this[_0x4dc5('0x1c')](_0x10849a['peerstatus'])){logger[_0x4dc5('0x1f')](_0x4dc5('0x3f'),_0x10849a[_0x4dc5('0x40')],_0x10849a[_0x4dc5('0x41')],_0x10849a[_0x4dc5('0xf')]);logger[_0x4dc5('0x23')]('[userReport][peerstatus]',util[_0x4dc5('0x15')](_0x10849a,{'showHidden':![],'depth':null}));if(this[_0x4dc5('0x8')][_0x10849a[_0x4dc5('0x40')]]){if(!this[_0x4dc5('0x8')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x2e')]||_0x10849a['peerstatus']['toLowerCase']()==_0x4dc5('0x42')){this[_0x4dc5('0x8')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x2e')]=![];this[_0x4dc5('0x8')][_0x10849a['peer']][_0x4dc5('0x43')]=_0x10849a[_0x4dc5('0xf')]['toLowerCase']();this[_0x4dc5('0x8')][_0x10849a[_0x4dc5('0x40')]]['address']=_0x10849a[_0x4dc5('0x41')];this[_0x4dc5('0x8')][_0x10849a['peer']][_0x4dc5('0x3c')](_0x10849a);}}else if(this[_0x4dc5('0x9')][_0x10849a[_0x4dc5('0x40')]]){this['telephones'][_0x10849a['peer']][_0x4dc5('0x43')]=_0x10849a[_0x4dc5('0xf')][_0x4dc5('0x2f')]();this[_0x4dc5('0x9')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x41')]=_0x10849a['address'];logger[_0x4dc5('0x23')](_0x4dc5('0x44'),util[_0x4dc5('0x15')](this[_0x4dc5('0x9')][_0x10849a[_0x4dc5('0x40')]],{'showHidden':![],'depth':null}));this[_0x4dc5('0x1e')](util[_0x4dc5('0x2a')](_0x4dc5('0x34'),this[_0x4dc5('0x9')][_0x10849a['peer']]['name']),'telephone:save',this[_0x4dc5('0x9')][_0x10849a[_0x4dc5('0x40')]]);}else if(this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]]){this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x43')]=_0x10849a[_0x4dc5('0xf')]['toLowerCase']();this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x41')]=_0x10849a[_0x4dc5('0x41')];logger['debug']('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x4dc5('0x7')][_0x10849a['peer']],{'showHidden':![],'depth':null}));this[_0x4dc5('0x1e')](util[_0x4dc5('0x2a')](_0x4dc5('0x2b'),this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x35')]),_0x4dc5('0x37'),this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]]);}}}catch(_0x16a507){logger[_0x4dc5('0x14')]('[userReport][peerstatus]',util[_0x4dc5('0x15')](_0x16a507,{'showHidden':![],'depth':null}));}};module[_0x4dc5('0x45')]=UserReport;
\ No newline at end of file
index 5435fba..8b3224f 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(_0x353816,_0x2ee519){var _0x2940e6=function(_0x116272){while(--_0x116272){_0x353816['push'](_0x353816['shift']());}};_0x2940e6(++_0x2ee519);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x4e1e5f,_0x106ce7){var _0x502c52=function(_0x3e722d){while(--_0x3e722d){_0x4e1e5f['push'](_0x4e1e5f['shift']());}};_0x502c52(++_0x106ce7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 6ddba56..ec1599b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b0e=['prototype','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','inspect','linkedid','merge','pick','keys','context','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','channel','name','user:agentconnect','accountcode','syncNewChannel','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','applicationdata','startsWith','CDR(routeAlias)','appdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','seconds','includes','lastapplication','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','connectedlinename','destinationchannel','UserId','membername','from-sip','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','push','rec','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-callerid','[%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','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','diff','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','then','undefined','isEmpty','getSettings','resolve','StopMixMonitor','catch','Action','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','ioredis','../../../config/environment','ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','defaults','redis','localhost','channels','agents','blindTransfers','syncNewExten','bind','newexten','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0x8b0e,0x166));var _0xe8b0=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0x8b0e[_0x581249];return _0x284bae;};'use strict';var _=require(_0xe8b0('0x0'));var moment=require(_0xe8b0('0x1'));var util=require(_0xe8b0('0x2'));var path=require(_0xe8b0('0x3'));var Redis=require(_0xe8b0('0x4'));var config=require(_0xe8b0('0x5'));var logger=require('../../../config/logger')(_0xe8b0('0x6'));var ami=require('../ami');var Channel=require(_0xe8b0('0x7'));var RpcSetting=require(_0xe8b0('0x8'));var applications=[_0xe8b0('0x9'),_0xe8b0('0xa'),_0xe8b0('0xb'),_0xe8b0('0xc'),_0xe8b0('0xd'),_0xe8b0('0xe')];var dispositions=['NO\x20ANSWER',_0xe8b0('0xf'),_0xe8b0('0xf'),_0xe8b0('0x10'),_0xe8b0('0x10'),_0xe8b0('0x10'),_0xe8b0('0x11'),_0xe8b0('0x12'),_0xe8b0('0xf'),_0xe8b0('0xf'),'FAILED'];config['redis']=_[_0xe8b0('0x13')](config[_0xe8b0('0x14')],{'host':_0xe8b0('0x15'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe8b0('0x14')]));function VoiceCallReport(_0x41633d){this[_0xe8b0('0x16')]=_0x41633d[_0xe8b0('0x16')];this[_0xe8b0('0x17')]=_0x41633d[_0xe8b0('0x17')];this[_0xe8b0('0x18')]={};ami['on']('coreshowchannel',this[_0xe8b0('0x19')][_0xe8b0('0x1a')](this));ami['on'](_0xe8b0('0x1b'),this['syncNewExten'][_0xe8b0('0x1a')](this));ami['on']('newchannel',this['syncNewChannel']['bind'](this));ami['on'](_0xe8b0('0x1c'),this[_0xe8b0('0x1d')]['bind'](this));ami['on'](_0xe8b0('0x1e'),this[_0xe8b0('0x1f')][_0xe8b0('0x1a')](this));ami['on'](_0xe8b0('0x20'),this[_0xe8b0('0x21')][_0xe8b0('0x1a')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0xe8b0('0x1a')](this));ami['on'](_0xe8b0('0x22'),this[_0xe8b0('0x23')][_0xe8b0('0x1a')](this));ami['on'](_0xe8b0('0x24'),this[_0xe8b0('0x25')][_0xe8b0('0x1a')](this));ami['on'](_0xe8b0('0x26'),this[_0xe8b0('0x27')][_0xe8b0('0x1a')](this));ami['on'](_0xe8b0('0x28'),this['syncMusicOnHoldStop'][_0xe8b0('0x1a')](this));try{logger[_0xe8b0('0x29')](_0xe8b0('0x2a'));ami[_0xe8b0('0x2b')]();}catch(_0x52072e){logger[_0xe8b0('0x2c')](_0xe8b0('0x2d'),util['inspect'](_0x52072e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x2f')]=function(_0x77c4b5){return _0x77c4b5!==null&&!_[_0xe8b0('0x30')](_0x77c4b5);};VoiceCallReport['prototype'][_0xe8b0('0x31')]=function(_0x317495,_0x35f599,_0x298d09){io['to'](_0x317495)[_0xe8b0('0x31')](_0x35f599,_0x298d09);};VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x32')]=function(_0x12b2bf){try{if(this[_0xe8b0('0x2f')](_0x12b2bf)){logger[_0xe8b0('0x29')](_0xe8b0('0x33'),_0x12b2bf['uniqueid'],_0x12b2bf['calleridname'],_0x12b2bf[_0xe8b0('0x34')]);logger[_0xe8b0('0x35')](_0xe8b0('0x36'),_0x12b2bf[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x12b2bf,{'showHidden':![],'depth':null}));if(_0x12b2bf['uniqueid']===_0x12b2bf[_0xe8b0('0x39')]){if(!_['isUndefined'](this[_0xe8b0('0x16')][_0x12b2bf[_0xe8b0('0x37')]])){_[_0xe8b0('0x3a')](this[_0xe8b0('0x16')][_0x12b2bf['uniqueid']],_[_0xe8b0('0x3b')](_0x12b2bf,_[_0xe8b0('0x3c')](this[_0xe8b0('0x16')][_0x12b2bf[_0xe8b0('0x37')]])));}}if(_0x12b2bf[_0xe8b0('0x3d')]==='from-sip'){if(this[_0xe8b0('0x17')][_0x12b2bf['channel'][_0xe8b0('0x3e')]('-')[0x0]]){if(_0x12b2bf[_0xe8b0('0x3f')]==_0xe8b0('0x40')){this[_0xe8b0('0x17')][_0x12b2bf['channel'][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x41')]=_0x12b2bf[_0xe8b0('0x42')];this[_0xe8b0('0x31')](util[_0xe8b0('0x43')](_0xe8b0('0x44'),this[_0xe8b0('0x17')][_0x12b2bf[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x46')]),_0xe8b0('0x47'),{'destaccountcode':this[_0xe8b0('0x17')][_0x12b2bf[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x48')],'destconnectedlinenum':_0x12b2bf['connectedlinenum']});}}}}}catch(_0x3f1bb7){logger[_0xe8b0('0x2c')]('[%s][voiceCallReport][newcallerid]',_0x12b2bf[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x3f1bb7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x49')]=function(_0x4cb101){try{if(this['isNotNull'](_0x4cb101)){logger[_0xe8b0('0x35')]('[%s][voiceCallReport][newchannel]\x20event:',_0x4cb101[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x4cb101,{'showHidden':![],'depth':null}));if(_0x4cb101['uniqueid']===_0x4cb101[_0xe8b0('0x39')]&&_0x4cb101[_0xe8b0('0x45')]!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0xe8b0('0x16')][_0x4cb101['uniqueid']])){logger[_0xe8b0('0x29')](_0xe8b0('0x4a'),_0x4cb101[_0xe8b0('0x37')],_0x4cb101[_0xe8b0('0x3d')],_0x4cb101[_0xe8b0('0x3f')]);this[_0xe8b0('0x16')][_0x4cb101['uniqueid']]=new Channel();this[_0xe8b0('0x16')][_0x4cb101[_0xe8b0('0x37')]]['starttime']=moment()[_0xe8b0('0x43')](_0xe8b0('0x4b'));this[_0xe8b0('0x16')][_0x4cb101[_0xe8b0('0x37')]][_0xe8b0('0x4c')]=dispositions[_[_0xe8b0('0x4d')](_0x4cb101[_0xe8b0('0x4e')])];_[_0xe8b0('0x3a')](this[_0xe8b0('0x16')][_0x4cb101['uniqueid']],_[_0xe8b0('0x3b')](_0x4cb101,_[_0xe8b0('0x3c')](this[_0xe8b0('0x16')][_0x4cb101[_0xe8b0('0x37')]])));if(_0x4cb101[_0xe8b0('0x3d')]==='from-sip'){if(this['agents'][_0x4cb101[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]]){if(_[_0xe8b0('0x30')](this[_0xe8b0('0x17')][_0x4cb101[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x41')])){this[_0xe8b0('0x17')][_0x4cb101['channel']['split']('-')[0x0]][_0xe8b0('0x41')]=_0x4cb101[_0xe8b0('0x3f')];logger['debug'](_0xe8b0('0x4f'),_0x4cb101['uniqueid'],util[_0xe8b0('0x38')]({'id':this[_0xe8b0('0x17')][_0x4cb101[_0xe8b0('0x45')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xe8b0('0x17')][_0x4cb101['channel']['split']('-')[0x0]][_0xe8b0('0x48')],'destconnectedlinenum':_0x4cb101['exten']},{'showHidden':![],'depth':null}));this[_0xe8b0('0x31')](util['format']('user:%s',this['agents'][_0x4cb101[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x46')]),_0xe8b0('0x47'),{'id':this[_0xe8b0('0x17')][_0x4cb101[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4cb101[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x48')],'destconnectedlinenum':_0x4cb101['exten']});}}}}}}}catch(_0x3f650b){logger['error'](_0xe8b0('0x50'),_0x4cb101[_0xe8b0('0x37')],util['inspect'](_0x3f650b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x19')]=function(_0x138171){try{if(this[_0xe8b0('0x2f')](_0x138171)){logger['debug'](_0xe8b0('0x51'),_0x138171[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x138171,{'showHidden':![],'depth':null}));if(_0x138171[_0xe8b0('0x37')]===_0x138171['linkedid']&&_0x138171[_0xe8b0('0x3f')]!='h'&&_0x138171['channel']!=_0xe8b0('0x52')){_0x138171['application']=_0x138171[_0xe8b0('0x53')]['toLowerCase']();_0x138171[_0xe8b0('0x54')]=_0x138171['appdata']&&_0x138171['appdata'][_0xe8b0('0x55')](_0xe8b0('0x56'))?_0x138171['appdata']:(_0x138171[_0xe8b0('0x57')]||_0x138171[_0xe8b0('0x54')])[_0xe8b0('0x58')]();logger[_0xe8b0('0x29')](_0xe8b0('0x59'),_0x138171[_0xe8b0('0x37')],_0x138171['application'],_0x138171['applicationdata']);if(_[_0xe8b0('0x30')](this['channels'][_0x138171[_0xe8b0('0x37')]])){this['channels'][_0x138171[_0xe8b0('0x37')]]=new Channel();this['channels'][_0x138171[_0xe8b0('0x37')]][_0xe8b0('0x5a')]=_0x138171[_0xe8b0('0x5b')]?moment()['subtract'](moment[_0xe8b0('0x5b')](_0x138171[_0xe8b0('0x5b')])[_0xe8b0('0x5c')](),_0xe8b0('0x5c'))['format'](_0xe8b0('0x4b')):moment()['format'](_0xe8b0('0x4b'));this[_0xe8b0('0x16')][_0x138171[_0xe8b0('0x37')]][_0xe8b0('0x4c')]=_0xe8b0('0x10');}_[_0xe8b0('0x3a')](this[_0xe8b0('0x16')][_0x138171[_0xe8b0('0x37')]],_[_0xe8b0('0x3b')](_0x138171,_[_0xe8b0('0x3c')](this[_0xe8b0('0x16')][_0x138171[_0xe8b0('0x37')]])));if(_[_0xe8b0('0x5d')](applications,_0x138171['application'])){this[_0xe8b0('0x16')][_0x138171[_0xe8b0('0x37')]][_0xe8b0('0x5e')]=_0x138171[_0xe8b0('0x53')];this[_0xe8b0('0x16')][_0x138171[_0xe8b0('0x37')]]['lastdata']=_0x138171[_0xe8b0('0x54')];if(_0x138171[_0xe8b0('0x53')]===_0xe8b0('0x9')&&_['startsWith'](_0x138171[_0xe8b0('0x54')][_0xe8b0('0x58')](),'cdr(')){var _0x4b3a7a=_0x138171[_0xe8b0('0x54')][_0xe8b0('0x3e')]('=');var _0x5e537a=_0x4b3a7a[0x0][_0xe8b0('0x58')]()['match'](/cdr\((.*)\)/);if(_0x5e537a){this[_0xe8b0('0x16')][_0x138171[_0xe8b0('0x37')]][_0x5e537a[0x1]]=_0x4b3a7a[0x1];}}else if(_0x138171['application']===_0xe8b0('0xa')){this[_0xe8b0('0x16')][_0x138171[_0xe8b0('0x37')]][_0xe8b0('0xa')]=_0x138171[_0xe8b0('0x54')][_0xe8b0('0x3e')](',')[0x0];}}}}}catch(_0x30f96e){logger[_0xe8b0('0x2c')](_0xe8b0('0x5f'),_0x138171[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x30f96e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x1d')]=function(_0x5bfd81){try{if(this['isNotNull'](_0x5bfd81)){logger['info'](_0xe8b0('0x60'),_0x5bfd81[_0xe8b0('0x37')],_0x5bfd81['linkedid'],_0x5bfd81[_0xe8b0('0x61')],_0x5bfd81[_0xe8b0('0x34')]);logger[_0xe8b0('0x35')](_0xe8b0('0x62'),_0x5bfd81[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x5bfd81,{'showHidden':![],'depth':null}));if(_0x5bfd81[_0xe8b0('0x37')]!==_0x5bfd81['linkedid']){if(this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x39')]]){if(_0x5bfd81[_0xe8b0('0x4e')]==='6'){if(!this[_0xe8b0('0x16')][_0x5bfd81['linkedid']][_0xe8b0('0x63')]){var _0x4a0a91=moment();this['channels'][_0x5bfd81['linkedid']][_0xe8b0('0x63')]=!![];this['channels'][_0x5bfd81[_0xe8b0('0x39')]][_0xe8b0('0x64')]=_0x4a0a91[_0xe8b0('0x43')](_0xe8b0('0x4b'));if(this[_0xe8b0('0x16')][_0x5bfd81['linkedid']][_0xe8b0('0x5a')]){this['channels'][_0x5bfd81[_0xe8b0('0x39')]]['holdtime']=_0x4a0a91['diff'](this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x39')]][_0xe8b0('0x5a')],_0xe8b0('0x5c'));}}this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x39')]][_0xe8b0('0x39')]=_0x5bfd81[_0xe8b0('0x37')];if(_0x5bfd81[_0xe8b0('0x34')]!=='xcally-motion-preview'){this['channels'][_0x5bfd81['linkedid']][_0xe8b0('0x42')]=_0x5bfd81[_0xe8b0('0x34')];}this[_0xe8b0('0x16')][_0x5bfd81['linkedid']][_0xe8b0('0x65')]=_0x5bfd81[_0xe8b0('0x61')];this[_0xe8b0('0x16')][_0x5bfd81['linkedid']][_0xe8b0('0x66')]=_0x5bfd81[_0xe8b0('0x45')];this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x39')]]['disposition']=dispositions[_[_0xe8b0('0x4d')](_0x5bfd81['channelstate'])];if(this[_0xe8b0('0x17')][_0x5bfd81['channel']['split']('-')[0x0]]){this['channels'][_0x5bfd81[_0xe8b0('0x39')]][_0xe8b0('0x67')]=this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]]['id'];this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x39')]][_0xe8b0('0x68')]=this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x46')];}}}}else{if(this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x37')]]){if(_0x5bfd81['channelstate']==='6'){if(this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')]['split']('-')[0x0]]){this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x37')]][_0xe8b0('0x67')]=this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')]['split']('-')[0x0]]['id'];this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x37')]]['membername']=this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x46')];}}}}if(_0x5bfd81[_0xe8b0('0x4e')]==='6'&&_0x5bfd81['context']===_0xe8b0('0x69')){if(this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]]){this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x41')]=_0x5bfd81[_0xe8b0('0x3f')];var _0x4c6764,_0x2c4f3a;if(this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x37')]]){_0x4c6764=this['channels'][_0x5bfd81[_0xe8b0('0x37')]][_0xe8b0('0x6a')];_0x2c4f3a=this[_0xe8b0('0x16')][_0x5bfd81['uniqueid']][_0xe8b0('0xa')];}else if(this[_0xe8b0('0x16')][_0x5bfd81['linkedid']]){_0x4c6764=this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x39')]][_0xe8b0('0x6a')];_0x2c4f3a=this[_0xe8b0('0x16')][_0x5bfd81[_0xe8b0('0x39')]][_0xe8b0('0xa')];}logger[_0xe8b0('0x35')](_0xe8b0('0x6b'),_0x5bfd81[_0xe8b0('0x37')],util[_0xe8b0('0x38')]({'id':this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]]['id'],'destaccountcode':this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')]['split']('-')[0x0]][_0xe8b0('0x48')],'destconnectedlinenum':_0x5bfd81[_0xe8b0('0x3f')],'routealias':_0x4c6764,'queue':_0x2c4f3a||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0xe8b0('0x43')](_0xe8b0('0x44'),this['agents'][_0x5bfd81[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x46')]),'user:agentconnect',{'id':this[_0xe8b0('0x17')][_0x5bfd81['channel']['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xe8b0('0x17')][_0x5bfd81[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5bfd81[_0xe8b0('0x3f')],'routealias':_0x4c6764,'queue':_0x2c4f3a||undefined});}}}}catch(_0x11ad17){logger[_0xe8b0('0x2c')](_0xe8b0('0x6c'),_0x5bfd81[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x11ad17,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x6d')]=function(_0x764df3,_0x329956){try{if(this[_0xe8b0('0x16')][_0x764df3]){logger[_0xe8b0('0x29')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x764df3,_0x329956);this[_0xe8b0('0x16')][_0x764df3][_0xe8b0('0x6e')]=!![];if(_[_0xe8b0('0x6f')](_0x329956,_0xe8b0('0x70'))){_0x329956=_0x329956[_0xe8b0('0x71')](_0xe8b0('0x70'),_0xe8b0('0x72'));}this[_0xe8b0('0x16')][_0x764df3][_0xe8b0('0x73')]=_0x329956;var _0x26e42a=_[_0xe8b0('0x74')](this['channels'][_0x764df3]['monitors'],{'filename':_0x329956});if(_[_0xe8b0('0x75')](_0x26e42a)){this[_0xe8b0('0x16')][_0x764df3][_0xe8b0('0x76')][_0xe8b0('0x77')]({'filename':_0x329956,'createdAt':moment()[_0xe8b0('0x43')](_0xe8b0('0x4b')),'mixmonitorid':'','status':_0xe8b0('0x78')});}}}catch(_0x1956b1){logger[_0xe8b0('0x2c')]('[%s][voiceCallReport][mixMonitorFilename]',_0x764df3,util[_0xe8b0('0x38')](_0x1956b1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x1f')]=function(_0x40f19e){try{if(this[_0xe8b0('0x2f')](_0x40f19e)){logger[_0xe8b0('0x35')]('[%s][voiceCallReport][varset]\x20event:',_0x40f19e[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x40f19e,{'showHidden':![],'depth':null}));if(this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x37')]]&&_0x40f19e['channel']!=_0xe8b0('0x52')){if(this['isNotNull'](_0x40f19e['variable'])){if(this['isNotNull'](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x7a')])){logger[_0xe8b0('0x29')](_0xe8b0('0x7b'),_0x40f19e['uniqueid'],_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x6d')](_0x40f19e[_0xe8b0('0x37')],_0x40f19e['value']);}else if(this[_0xe8b0('0x2f')](_0x40f19e[_0xe8b0('0x79')]['xmd-phone'])){logger[_0xe8b0('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x40f19e[_0xe8b0('0x37')],_0x40f19e[_0xe8b0('0x7c')]);this['channels'][_0x40f19e[_0xe8b0('0x37')]][_0xe8b0('0x34')]=_0x40f19e[_0xe8b0('0x7c')];}else if(this[_0xe8b0('0x2f')](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x7d')])){logger[_0xe8b0('0x29')](_0xe8b0('0x7e'),_0x40f19e[_0xe8b0('0x37')],_0x40f19e[_0xe8b0('0x7c')]);this['channels'][_0x40f19e[_0xe8b0('0x37')]][_0xe8b0('0x7f')]=_0x40f19e[_0xe8b0('0x7c')];}else if(this[_0xe8b0('0x2f')](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x80')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x40f19e['uniqueid'],_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x37')]][_0xe8b0('0x81')]=_0x40f19e['value'];}else if(this[_0xe8b0('0x2f')](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x82')])){logger[_0xe8b0('0x29')](_0xe8b0('0x83'),_0x40f19e[_0xe8b0('0x37')],_0x40f19e['value'][_0xe8b0('0x3e')](',')[0x0]);this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x37')]][_0xe8b0('0xa')]=_0x40f19e['value'][_0xe8b0('0x3e')](',')[0x0];}else if(this['isNotNull'](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x84')])){logger[_0xe8b0('0x29')](_0xe8b0('0x85'),_0x40f19e[_0xe8b0('0x37')],_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x16')][_0x40f19e['uniqueid']][_0xe8b0('0x86')]=_0x40f19e[_0xe8b0('0x7c')];}else if(this['isNotNull'](_0x40f19e['variable'][_0xe8b0('0x87')])){logger[_0xe8b0('0x29')](_0xe8b0('0x88'),_0x40f19e[_0xe8b0('0x37')],_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x37')]][_0xe8b0('0x89')]=_0x40f19e[_0xe8b0('0x7c')];}else if(this['isNotNull'](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x8a')])){logger[_0xe8b0('0x29')](_0xe8b0('0x8b'),_0x40f19e[_0xe8b0('0x37')],_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x37')]][_0xe8b0('0x8c')]=_0x40f19e[_0xe8b0('0x7c')];}else if(this['isNotNull'](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x8d')])){logger[_0xe8b0('0x29')](_0xe8b0('0x8e'),_0x40f19e[_0xe8b0('0x37')],_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x37')]][_0xe8b0('0xa')]=_0x40f19e[_0xe8b0('0x7c')];}else if(this['isNotNull'](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x8f')])){logger[_0xe8b0('0x29')](_0xe8b0('0x90'),_0x40f19e['uniqueid'],_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x37')]][_0xe8b0('0x91')]=_0x40f19e['value'];}}}else if(this[_0xe8b0('0x2f')](_0x40f19e['variable'][_0xe8b0('0x7a')])){if(_0x40f19e[_0xe8b0('0x7c')]){var _0x192383=path[_0xe8b0('0x92')](_0x40f19e[_0xe8b0('0x7c')])['name'];logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x192383,_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x6d')](_0x192383,_0x40f19e[_0xe8b0('0x7c')]);}}else if(this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x39')]]){if(this[_0xe8b0('0x2f')](_0x40f19e[_0xe8b0('0x79')])){if(this[_0xe8b0('0x2f')](_0x40f19e[_0xe8b0('0x79')][_0xe8b0('0x8f')])){logger[_0xe8b0('0x29')](_0xe8b0('0x90'),_0x40f19e[_0xe8b0('0x39')],_0x40f19e[_0xe8b0('0x7c')]);this[_0xe8b0('0x16')][_0x40f19e[_0xe8b0('0x39')]]['sipcalllinkedid']=_0x40f19e[_0xe8b0('0x7c')];}}}}}catch(_0x5cc6a9){logger[_0xe8b0('0x2c')](_0xe8b0('0x93'),_0x40f19e[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x5cc6a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')]['syncHangup']=function(_0x57b6a){try{if(this[_0xe8b0('0x2f')](_0x57b6a)){logger[_0xe8b0('0x35')](_0xe8b0('0x94'),_0x57b6a[_0xe8b0('0x37')],util['inspect'](_0x57b6a,{'showHidden':![],'depth':null}));if(this[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]]){logger[_0xe8b0('0x29')](_0xe8b0('0x95'),_0x57b6a['uniqueid'],_0x57b6a[_0xe8b0('0x96')]);var _0x59b881=moment();this[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]][_0xe8b0('0x97')]=_0x59b881[_0xe8b0('0x43')](_0xe8b0('0x4b'));this[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]]['duration']=_0x59b881[_0xe8b0('0x98')](this[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]]['starttime'],_0xe8b0('0x5c'));if(this['channels'][_0x57b6a[_0xe8b0('0x37')]][_0xe8b0('0x63')]){this[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]][_0xe8b0('0x99')]=_0x59b881['diff'](this[_0xe8b0('0x16')][_0x57b6a['uniqueid']][_0xe8b0('0x64')],_0xe8b0('0x5c'));this[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]][_0xe8b0('0x9a')]=this[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]]['duration']-this[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]]['billableseconds'];}if(_0x57b6a[_0xe8b0('0x3d')]===_0xe8b0('0x69')){if(this['agents'][_0x57b6a[_0xe8b0('0x45')]['split']('-')[0x0]]){this['agents'][_0x57b6a[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]]=_[_0xe8b0('0x9b')](this[_0xe8b0('0x17')][_0x57b6a[_0xe8b0('0x45')]['split']('-')[0x0]],[_0xe8b0('0x41')]);logger[_0xe8b0('0x35')](_0xe8b0('0x9c'),_0x57b6a[_0xe8b0('0x37')],util[_0xe8b0('0x38')]({'id':this[_0xe8b0('0x17')][_0x57b6a['channel'][_0xe8b0('0x3e')]('-')[0x0]]['id'],'destaccountcode':this[_0xe8b0('0x17')][_0x57b6a[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0xe8b0('0x43')](_0xe8b0('0x44'),this[_0xe8b0('0x17')][_0x57b6a[_0xe8b0('0x45')][_0xe8b0('0x3e')]('-')[0x0]][_0xe8b0('0x46')]),_0xe8b0('0x9d'),{'id':this['agents'][_0x57b6a[_0xe8b0('0x45')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xe8b0('0x17')][_0x57b6a['channel']['split']('-')[0x0]][_0xe8b0('0x48')]});for(var _0x43bad4=0x0;_0x43bad4<Object[_0xe8b0('0x3c')](this[_0xe8b0('0x17')])['length'];_0x43bad4++){var _0x358436=Object['keys'](this[_0xe8b0('0x17')])[_0x43bad4];var _0xfcf860=this[_0xe8b0('0x17')][_0x358436];if(_0xfcf860['accountcode']===Number(_0x57b6a['connectedlinenum'])){this['emit'](util['format']('user:%s',_0xfcf860[_0xe8b0('0x46')]),_0xe8b0('0x9d'),{'id':_0xfcf860['id'],'destaccountcode':_0xfcf860['accountcode']});break;}}}}var _0x11038b=this;Promise['resolve']()[_0xe8b0('0x9e')](function(){var _0x3dceab=_0x11038b['channels'][_0x57b6a[_0xe8b0('0x37')]];if(typeof _0x3dceab['transferType']===_0xe8b0('0x9f'))return;if(_[_0xe8b0('0xa0')](_0x3dceab['monitors']))return;return RpcSetting[_0xe8b0('0xa1')]()['then'](function(_0x3dae24){if(!_0x3dae24['stopRecordingOnTransfer'])return;return Promise[_0xe8b0('0xa2')]()[_0xe8b0('0x9e')](function(){return ami['Action']({'action':_0xe8b0('0xa3'),'channel':_0x3dceab['channel']})[_0xe8b0('0xa4')](function(){});})[_0xe8b0('0x9e')](function(){return ami[_0xe8b0('0xa5')]({'action':_0xe8b0('0xa3'),'channel':_0x3dceab[_0xe8b0('0x66')]})[_0xe8b0('0xa4')](function(){})['finally'](function(){var _0x422a14=_0x11038b[_0xe8b0('0x17')][_0x3dceab['destinationchannel'][_0xe8b0('0x3e')]('-')[0x0]];if(!_0x422a14)return;io['emit'](_0xe8b0('0xa6'),{'agentId':_0x422a14['id'],'uniqueid':_0x3dceab[_0xe8b0('0x37')]});});});});})[_0xe8b0('0x9e')](function(){if(_0x57b6a['event']===_0xe8b0('0xa7')){_0x11038b[_0xe8b0('0x18')][_0x57b6a[_0xe8b0('0x37')]]=_0x11038b['channels'][_0x57b6a['uniqueid']];}else{if(_0x11038b['channels'][_0x57b6a[_0xe8b0('0x37')]]['type']===_0xe8b0('0xa8')&&_0x11038b['blindTransfers'][_0x57b6a[_0xe8b0('0x37')]]){_0x11038b[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]]['uniqueid']=[_0x11038b[_0xe8b0('0x16')][_0x57b6a['uniqueid']][_0xe8b0('0x39')],_0x11038b['channels'][_0x57b6a[_0xe8b0('0x37')]][_0xe8b0('0x39')]=_0x11038b[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]]['uniqueid']][0x0];delete _0x11038b[_0xe8b0('0x18')][_0x57b6a[_0xe8b0('0x37')]];}}logger[_0xe8b0('0x35')](_0xe8b0('0xa9'),_0x57b6a[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x11038b[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]],{'showHidden':![],'depth':null}));ami[_0xe8b0('0x31')](_0xe8b0('0xaa'),_0x11038b[_0xe8b0('0x16')][_0x57b6a[_0xe8b0('0x37')]]);delete _0x11038b['channels'][_0x57b6a[_0xe8b0('0x37')]];});}}}catch(_0x4913b5){logger[_0xe8b0('0x2c')](_0xe8b0('0xab'),_0x57b6a[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x4913b5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x23')]=function(_0x1d7cec){try{if(this[_0xe8b0('0x2f')](_0x1d7cec)){logger[_0xe8b0('0x29')](_0xe8b0('0xac'),_0x1d7cec[_0xe8b0('0x37')],_0x1d7cec[_0xe8b0('0xad')],_0x1d7cec[_0xe8b0('0xae')]);logger['debug'](_0xe8b0('0xaf'),_0x1d7cec[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x1d7cec,{'showHidden':![],'depth':null}));var _0x5ba946;if(this[_0xe8b0('0x16')][_0x1d7cec['transfereeuniqueid']]){this['channels'][_0x1d7cec[_0xe8b0('0xb0')]][_0xe8b0('0xb1')]=_0x1d7cec[_0xe8b0('0xad')];this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb0')]][_0xe8b0('0xb2')]=_0x1d7cec[_0xe8b0('0xae')];if(this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb3')]]){_0x5ba946=this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb3')]];this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb3')]]=this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb0')]];this['channels'][_0x1d7cec[_0xe8b0('0xb0')]]=_0x5ba946;}}else if(this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb4')]]){this['channels'][_0x1d7cec[_0xe8b0('0xb4')]][_0xe8b0('0xb1')]=_0x1d7cec[_0xe8b0('0xad')];this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb4')]][_0xe8b0('0xb2')]=_0x1d7cec['transfertargetcalleridnum'];if(this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb5')]]){_0x5ba946=this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb5')]];this['channels'][_0x1d7cec[_0xe8b0('0xb5')]]=this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb4')]];this[_0xe8b0('0x16')][_0x1d7cec['transfertargetuniqueid']]=_0x5ba946;}}if((this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb5')]]||this['channels'][_0x1d7cec[_0xe8b0('0xb6')]])&&this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb3')]]){var _0xe079b8=_[_0xe8b0('0xb7')]([this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb5')]],this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb6')]],this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb3')]]],function(_0x1ce22d){return _0x1ce22d&&_0x1ce22d[_0xe8b0('0x81')]===_0xe8b0('0xa8')&&_0x1ce22d['routeid'];});if(_0xe079b8){if(this[_0xe8b0('0x16')][_0x1d7cec['origtransfereruniqueid']])this['channels'][_0x1d7cec[_0xe8b0('0xb5')]][_0xe8b0('0xb8')]=_0xe8b0('0xb9');if(this[_0xe8b0('0x16')][_0x1d7cec[_0xe8b0('0xb6')]])this['channels'][_0x1d7cec['origtransfererlinkedid']][_0xe8b0('0xb8')]='ATTENDED';this[_0xe8b0('0x16')][_0x1d7cec['secondtransfereruniqueid']]['transferType']=_0xe8b0('0xb9');}}}}catch(_0x369ea4){logger['error'](_0xe8b0('0xba'),_0x1d7cec[_0xe8b0('0x37')],util['inspect'](_0x369ea4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')][_0xe8b0('0x25')]=function(_0x4812fb){try{if(this['isNotNull'](_0x4812fb)){logger[_0xe8b0('0x29')](_0xe8b0('0xbb'),_0x4812fb['uniqueid'],_0x4812fb[_0xe8b0('0xbc')],_0x4812fb[_0xe8b0('0xbd')]);logger[_0xe8b0('0x35')](_0xe8b0('0xbe'),_0x4812fb[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x4812fb,{'showHidden':![],'depth':null}));if(this[_0xe8b0('0x16')][_0x4812fb['transfereeuniqueid']]){this[_0xe8b0('0x16')][_0x4812fb[_0xe8b0('0xb0')]]['transfercalleridnum']=_0x4812fb[_0xe8b0('0xbc')];this['channels'][_0x4812fb['transfereeuniqueid']][_0xe8b0('0xb2')]=_0x4812fb[_0xe8b0('0xbd')];this[_0xe8b0('0x16')][_0x4812fb[_0xe8b0('0xb0')]][_0xe8b0('0xb8')]=_0xe8b0('0xbf');this[_0xe8b0('0x21')]({'event':_0xe8b0('0xa7'),'uniqueid':_0x4812fb[_0xe8b0('0xb0')],'context':_0x4812fb[_0xe8b0('0x3d')],'channel':_0x4812fb['transfererchannel']});}else{this[_0xe8b0('0x16')][_0x4812fb[_0xe8b0('0xc0')]][_0xe8b0('0xb8')]='BLIND';}}}catch(_0x1344d8){logger[_0xe8b0('0x2c')](_0xe8b0('0xc1'),_0x4812fb[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x1344d8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe8b0('0x2e')]['syncMusicOnHoldStart']=function(_0x5e00e4){try{if(this[_0xe8b0('0x2f')](_0x5e00e4)){logger['debug']('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x5e00e4[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x5e00e4,{'showHidden':![],'depth':null}));if(this[_0xe8b0('0x16')][_0x5e00e4[_0xe8b0('0x37')]]){if(!_[_0xe8b0('0x75')](this[_0xe8b0('0x16')][_0x5e00e4[_0xe8b0('0x37')]]['answertime'])){this[_0xe8b0('0x16')][_0x5e00e4[_0xe8b0('0x37')]]['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xe8b0('0x29')](_0xe8b0('0xc2'),_0x5e00e4[_0xe8b0('0x37')],this[_0xe8b0('0x16')][_0x5e00e4[_0xe8b0('0x37')]][_0xe8b0('0xc3')]);}}}}catch(_0x1d7f5f){logger[_0xe8b0('0x2c')](_0xe8b0('0xc4'),_0x5e00e4[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x1d7f5f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xe8b0('0xc5')]=function(_0x1fc554){try{if(this[_0xe8b0('0x2f')](_0x1fc554)){logger['debug'](_0xe8b0('0xc6'),_0x1fc554[_0xe8b0('0x37')],util['inspect'](_0x1fc554,{'showHidden':![],'depth':null}));if(this[_0xe8b0('0x16')][_0x1fc554[_0xe8b0('0x37')]]){if(!_[_0xe8b0('0x75')](this['channels'][_0x1fc554[_0xe8b0('0x37')]][_0xe8b0('0xc3')])){this[_0xe8b0('0x16')][_0x1fc554[_0xe8b0('0x37')]][_0xe8b0('0xc7')]+=moment()['milliseconds'](0x0)[_0xe8b0('0x98')](this[_0xe8b0('0x16')][_0x1fc554['uniqueid']][_0xe8b0('0xc3')],_0xe8b0('0x5c'));logger[_0xe8b0('0x29')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x1fc554['uniqueid'],this[_0xe8b0('0x16')][_0x1fc554[_0xe8b0('0x37')]][_0xe8b0('0xc7')]);delete this['channels'][_0x1fc554[_0xe8b0('0x37')]][_0xe8b0('0xc3')];}}}}catch(_0x242af1){logger[_0xe8b0('0x2c')](_0xe8b0('0xc8'),_0x1fc554[_0xe8b0('0x37')],util[_0xe8b0('0x38')](_0x242af1,{'showHidden':![],'depth':null}));}};module[_0xe8b0('0xc9')]=VoiceCallReport;
\ No newline at end of file
+var _0x2a14=['UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','.WAV','monitorFilename','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','answertime','user:agentcomplete','length','then','transferType','undefined','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','lodash','moment','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','inspect','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','keys','context','from-sip','channel','split','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','accountcode','error','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','diff','seconds','xcally-motion-preview','connectedlinename'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2a14,0x123));var _0x42a1=function(_0xf405ad,_0x1afcdf){_0xf405ad=_0xf405ad-0x0;var _0x45c5a7=_0x2a14[_0xf405ad];return _0x45c5a7;};'use strict';var _=require(_0x42a1('0x0'));var moment=require(_0x42a1('0x1'));var util=require('util');var path=require(_0x42a1('0x2'));var Redis=require(_0x42a1('0x3'));var config=require(_0x42a1('0x4'));var logger=require(_0x42a1('0x5'))(_0x42a1('0x6'));var ami=require(_0x42a1('0x7'));var Channel=require(_0x42a1('0x8'));var RpcSetting=require(_0x42a1('0x9'));var applications=[_0x42a1('0xa'),_0x42a1('0xb'),_0x42a1('0xc'),_0x42a1('0xd'),'playback',_0x42a1('0xe')];var dispositions=[_0x42a1('0xf'),'FAILED',_0x42a1('0x10'),_0x42a1('0xf'),_0x42a1('0xf'),'NO\x20ANSWER',_0x42a1('0x11'),_0x42a1('0x12'),'FAILED','FAILED',_0x42a1('0x10')];config[_0x42a1('0x13')]=_[_0x42a1('0x14')](config[_0x42a1('0x13')],{'host':_0x42a1('0x15'),'port':0x18eb});var io=require(_0x42a1('0x16'))(new Redis(config[_0x42a1('0x13')]));function VoiceCallReport(_0x170f8e){this[_0x42a1('0x17')]=_0x170f8e[_0x42a1('0x17')];this[_0x42a1('0x18')]=_0x170f8e['agents'];this[_0x42a1('0x19')]={};ami['on'](_0x42a1('0x1a'),this[_0x42a1('0x1b')][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x1d'),this[_0x42a1('0x1b')]['bind'](this));ami['on']('newchannel',this['syncNewChannel'][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x1e'),this[_0x42a1('0x1f')]['bind'](this));ami['on']('varset',this[_0x42a1('0x20')]['bind'](this));ami['on'](_0x42a1('0x21'),this[_0x42a1('0x22')][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x23'),this['syncNewCallerId'][_0x42a1('0x1c')](this));ami['on']('attendedtransfer',this[_0x42a1('0x24')][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x25'),this[_0x42a1('0x26')]['bind'](this));ami['on'](_0x42a1('0x27'),this[_0x42a1('0x28')][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x29'),this['syncMusicOnHoldStop'][_0x42a1('0x1c')](this));try{logger[_0x42a1('0x2a')](_0x42a1('0x2b'));ami['actionCoreShowChannels']();}catch(_0xd044d4){logger['error']('[voiceCallReport][coreshowchannels]',util[_0x42a1('0x2c')](_0xd044d4,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x2e')]=function(_0x4b87df){return _0x4b87df!==null&&!_['isUndefined'](_0x4b87df);};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x2f')]=function(_0x404e21,_0x5c6116,_0x16ca6f){io['to'](_0x404e21)[_0x42a1('0x2f')](_0x5c6116,_0x16ca6f);};VoiceCallReport[_0x42a1('0x2d')]['syncNewCallerId']=function(_0x449b99){try{if(this[_0x42a1('0x2e')](_0x449b99)){logger[_0x42a1('0x2a')](_0x42a1('0x30'),_0x449b99[_0x42a1('0x31')],_0x449b99['calleridname'],_0x449b99['calleridnum']);logger['debug'](_0x42a1('0x32'),_0x449b99[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x449b99,{'showHidden':![],'depth':null}));if(_0x449b99[_0x42a1('0x31')]===_0x449b99[_0x42a1('0x33')]){if(!_[_0x42a1('0x34')](this[_0x42a1('0x17')][_0x449b99['uniqueid']])){_[_0x42a1('0x35')](this[_0x42a1('0x17')][_0x449b99[_0x42a1('0x31')]],_[_0x42a1('0x36')](_0x449b99,_[_0x42a1('0x37')](this[_0x42a1('0x17')][_0x449b99[_0x42a1('0x31')]])));}}if(_0x449b99[_0x42a1('0x38')]===_0x42a1('0x39')){if(this['agents'][_0x449b99[_0x42a1('0x3a')]['split']('-')[0x0]]){if(_0x449b99['exten']=='xcally-motion-preview'){this[_0x42a1('0x18')][_0x449b99[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x3c')]=_0x449b99[_0x42a1('0x3d')];this[_0x42a1('0x2f')](util[_0x42a1('0x3e')](_0x42a1('0x3f'),this['agents'][_0x449b99[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['name']),_0x42a1('0x40'),{'destaccountcode':this[_0x42a1('0x18')][_0x449b99['channel']['split']('-')[0x0]][_0x42a1('0x41')],'destconnectedlinenum':_0x449b99['connectedlinenum']});}}}}}catch(_0x58c60d){logger[_0x42a1('0x42')]('[%s][voiceCallReport][newcallerid]',_0x449b99[_0x42a1('0x31')],util['inspect'](_0x58c60d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x43')]=function(_0x4f5542){try{if(this[_0x42a1('0x2e')](_0x4f5542)){logger[_0x42a1('0x44')](_0x42a1('0x45'),_0x4f5542[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x4f5542,{'showHidden':![],'depth':null}));if(_0x4f5542[_0x42a1('0x31')]===_0x4f5542[_0x42a1('0x33')]&&_0x4f5542[_0x42a1('0x3a')]!=_0x42a1('0x46')){if(_[_0x42a1('0x34')](this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]])){logger[_0x42a1('0x2a')](_0x42a1('0x47'),_0x4f5542[_0x42a1('0x31')],_0x4f5542[_0x42a1('0x38')],_0x4f5542[_0x42a1('0x48')]);this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]]=new Channel();this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]]['starttime']=moment()[_0x42a1('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4f5542[_0x42a1('0x31')]][_0x42a1('0x49')]=dispositions[_[_0x42a1('0x4a')](_0x4f5542[_0x42a1('0x4b')])];_[_0x42a1('0x35')](this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]],_[_0x42a1('0x36')](_0x4f5542,_[_0x42a1('0x37')](this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]])));if(_0x4f5542[_0x42a1('0x38')]===_0x42a1('0x39')){if(this['agents'][_0x4f5542['channel']['split']('-')[0x0]]){if(_[_0x42a1('0x34')](this[_0x42a1('0x18')][_0x4f5542[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x3c')])){this[_0x42a1('0x18')][_0x4f5542[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x3c')]=_0x4f5542['exten'];logger[_0x42a1('0x44')](_0x42a1('0x4c'),_0x4f5542[_0x42a1('0x31')],util[_0x42a1('0x2c')]({'id':this[_0x42a1('0x18')][_0x4f5542[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4f5542[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x41')],'destconnectedlinenum':_0x4f5542[_0x42a1('0x48')]},{'showHidden':![],'depth':null}));this[_0x42a1('0x2f')](util['format']('user:%s',this[_0x42a1('0x18')][_0x4f5542['channel'][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x4d')]),_0x42a1('0x40'),{'id':this['agents'][_0x4f5542[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0x42a1('0x18')][_0x4f5542[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x41')],'destconnectedlinenum':_0x4f5542[_0x42a1('0x48')]});}}}}}}}catch(_0x212f01){logger[_0x42a1('0x42')](_0x42a1('0x4e'),_0x4f5542['uniqueid'],util[_0x42a1('0x2c')](_0x212f01,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')]['syncNewExten']=function(_0x1eea9b){try{if(this[_0x42a1('0x2e')](_0x1eea9b)){logger['debug'](_0x42a1('0x4f'),_0x1eea9b[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x1eea9b,{'showHidden':![],'depth':null}));if(_0x1eea9b['uniqueid']===_0x1eea9b[_0x42a1('0x33')]&&_0x1eea9b[_0x42a1('0x48')]!='h'&&_0x1eea9b['channel']!=_0x42a1('0x46')){_0x1eea9b[_0x42a1('0x50')]=_0x1eea9b[_0x42a1('0x50')][_0x42a1('0x51')]();_0x1eea9b[_0x42a1('0x52')]=_0x1eea9b[_0x42a1('0x53')]&&_0x1eea9b[_0x42a1('0x53')][_0x42a1('0x54')](_0x42a1('0x55'))?_0x1eea9b[_0x42a1('0x53')]:(_0x1eea9b[_0x42a1('0x53')]||_0x1eea9b[_0x42a1('0x52')])[_0x42a1('0x51')]();logger['info'](_0x42a1('0x56'),_0x1eea9b['uniqueid'],_0x1eea9b['application'],_0x1eea9b[_0x42a1('0x52')]);if(_[_0x42a1('0x34')](this[_0x42a1('0x17')][_0x1eea9b[_0x42a1('0x31')]])){this[_0x42a1('0x17')][_0x1eea9b[_0x42a1('0x31')]]=new Channel();this[_0x42a1('0x17')][_0x1eea9b['uniqueid']][_0x42a1('0x57')]=_0x1eea9b[_0x42a1('0x58')]?moment()[_0x42a1('0x59')](moment[_0x42a1('0x58')](_0x1eea9b[_0x42a1('0x58')])['seconds'](),'seconds')[_0x42a1('0x3e')](_0x42a1('0x5a')):moment()['format'](_0x42a1('0x5a'));this['channels'][_0x1eea9b['uniqueid']][_0x42a1('0x49')]=_0x42a1('0xf');}_[_0x42a1('0x35')](this[_0x42a1('0x17')][_0x1eea9b['uniqueid']],_[_0x42a1('0x36')](_0x1eea9b,_[_0x42a1('0x37')](this['channels'][_0x1eea9b['uniqueid']])));if(_[_0x42a1('0x5b')](applications,_0x1eea9b['application'])){this[_0x42a1('0x17')][_0x1eea9b['uniqueid']][_0x42a1('0x5c')]=_0x1eea9b[_0x42a1('0x50')];this[_0x42a1('0x17')][_0x1eea9b[_0x42a1('0x31')]][_0x42a1('0x5d')]=_0x1eea9b['applicationdata'];if(_0x1eea9b['application']===_0x42a1('0xa')&&_[_0x42a1('0x54')](_0x1eea9b[_0x42a1('0x52')][_0x42a1('0x51')](),'cdr(')){var _0x2870cf=_0x1eea9b[_0x42a1('0x52')][_0x42a1('0x3b')]('=');var _0x4ba624=_0x2870cf[0x0][_0x42a1('0x51')]()[_0x42a1('0x5e')](/cdr\((.*)\)/);if(_0x4ba624){this[_0x42a1('0x17')][_0x1eea9b[_0x42a1('0x31')]][_0x4ba624[0x1]]=_0x2870cf[0x1];}}else if(_0x1eea9b[_0x42a1('0x50')]===_0x42a1('0xb')){this['channels'][_0x1eea9b[_0x42a1('0x31')]][_0x42a1('0xb')]=_0x1eea9b['applicationdata'][_0x42a1('0x3b')](',')[0x0];}}}}}catch(_0x273e49){logger[_0x42a1('0x42')]('[%s][voiceCallReport][newexten]',_0x1eea9b['uniqueid'],util[_0x42a1('0x2c')](_0x273e49,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x42a1('0x1f')]=function(_0x3b55b5){try{if(this['isNotNull'](_0x3b55b5)){logger['info'](_0x42a1('0x5f'),_0x3b55b5[_0x42a1('0x31')],_0x3b55b5['linkedid'],_0x3b55b5[_0x42a1('0x60')],_0x3b55b5[_0x42a1('0x61')]);logger[_0x42a1('0x44')](_0x42a1('0x62'),_0x3b55b5['uniqueid'],util['inspect'](_0x3b55b5,{'showHidden':![],'depth':null}));if(_0x3b55b5[_0x42a1('0x31')]!==_0x3b55b5['linkedid']){if(this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]]){if(_0x3b55b5[_0x42a1('0x4b')]==='6'){if(!this['channels'][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x63')]){var _0x12303c=moment();this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x63')]=!![];this[_0x42a1('0x17')][_0x3b55b5['linkedid']]['answertime']=_0x12303c[_0x42a1('0x3e')](_0x42a1('0x5a'));if(this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x57')]){this['channels'][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x64')]=_0x12303c[_0x42a1('0x65')](this[_0x42a1('0x17')][_0x3b55b5['linkedid']][_0x42a1('0x57')],_0x42a1('0x66'));}}this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x33')]=_0x3b55b5[_0x42a1('0x31')];if(_0x3b55b5['calleridnum']!==_0x42a1('0x67')){this['channels'][_0x3b55b5[_0x42a1('0x33')]]['connectedlinenum']=_0x3b55b5[_0x42a1('0x61')];}this['channels'][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x68')]=_0x3b55b5[_0x42a1('0x60')];this['channels'][_0x3b55b5[_0x42a1('0x33')]]['destinationchannel']=_0x3b55b5[_0x42a1('0x3a')];this[_0x42a1('0x17')][_0x3b55b5['linkedid']][_0x42a1('0x49')]=dispositions[_[_0x42a1('0x4a')](_0x3b55b5[_0x42a1('0x4b')])];if(this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]){this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x69')]=this['agents'][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'];this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x6a')]=this['agents'][_0x3b55b5['channel'][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x4d')];}}}}else{if(this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x31')]]){if(_0x3b55b5[_0x42a1('0x4b')]==='6'){if(this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]){this[_0x42a1('0x17')][_0x3b55b5['uniqueid']][_0x42a1('0x69')]=this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'];this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x31')]][_0x42a1('0x6a')]=this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x4d')];}}}}if(_0x3b55b5[_0x42a1('0x4b')]==='6'&&_0x3b55b5[_0x42a1('0x38')]===_0x42a1('0x39')){if(this[_0x42a1('0x18')][_0x3b55b5['channel']['split']('-')[0x0]]){this['agents'][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x3c')]=_0x3b55b5[_0x42a1('0x48')];var _0x14c29f,_0x4bcbb7;if(this['channels'][_0x3b55b5[_0x42a1('0x31')]]){_0x14c29f=this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x31')]][_0x42a1('0x6b')];_0x4bcbb7=this[_0x42a1('0x17')][_0x3b55b5['uniqueid']][_0x42a1('0xb')];}else if(this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]]){_0x14c29f=this[_0x42a1('0x17')][_0x3b55b5['linkedid']]['routealias'];_0x4bcbb7=this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]]['queue'];}logger['debug'](_0x42a1('0x6c'),_0x3b55b5[_0x42a1('0x31')],util[_0x42a1('0x2c')]({'id':this['agents'][_0x3b55b5[_0x42a1('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3b55b5[_0x42a1('0x48')],'routealias':_0x14c29f,'queue':_0x4bcbb7||undefined},{'showHidden':![],'depth':null}));this[_0x42a1('0x2f')](util[_0x42a1('0x3e')](_0x42a1('0x3f'),this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x4d')]),_0x42a1('0x40'),{'id':this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x3b55b5['channel'][_0x42a1('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3b55b5[_0x42a1('0x48')],'routealias':_0x14c29f,'queue':_0x4bcbb7||undefined});}}}}catch(_0x4ada9f){logger[_0x42a1('0x42')](_0x42a1('0x6d'),_0x3b55b5['uniqueid'],util[_0x42a1('0x2c')](_0x4ada9f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x6e')]=function(_0x342dc1,_0x76824e){try{if(this[_0x42a1('0x17')][_0x342dc1]){logger['info'](_0x42a1('0x6f'),_0x342dc1,_0x76824e);this[_0x42a1('0x17')][_0x342dc1]['monitor']=!![];if(_[_0x42a1('0x70')](_0x76824e,_0x42a1('0x71'))){_0x76824e=_0x76824e['replace'](_0x42a1('0x71'),_0x42a1('0x72'));}this[_0x42a1('0x17')][_0x342dc1][_0x42a1('0x73')]=_0x76824e;var _0x5f097a=_['find'](this[_0x42a1('0x17')][_0x342dc1]['monitors'],{'filename':_0x76824e});if(_['isNil'](_0x5f097a)){this[_0x42a1('0x17')][_0x342dc1][_0x42a1('0x74')][_0x42a1('0x75')]({'filename':_0x76824e,'createdAt':moment()[_0x42a1('0x3e')](_0x42a1('0x5a')),'mixmonitorid':'','status':_0x42a1('0x76')});}}}catch(_0x3505cb){logger['error'](_0x42a1('0x77'),_0x342dc1,util[_0x42a1('0x2c')](_0x3505cb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x42a1('0x20')]=function(_0x27059a){try{if(this[_0x42a1('0x2e')](_0x27059a)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x27059a['uniqueid'],util['inspect'](_0x27059a,{'showHidden':![],'depth':null}));if(this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]]&&_0x27059a[_0x42a1('0x3a')]!='OutgoingSpoolFailed'){if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')])){if(this['isNotNull'](_0x27059a['variable'][_0x42a1('0x79')])){logger[_0x42a1('0x2a')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x6e')](_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);}else if(this[_0x42a1('0x2e')](_0x27059a['variable'][_0x42a1('0x7b')])){logger[_0x42a1('0x2a')](_0x42a1('0x7c'),_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x61')]=_0x27059a['value'];}else if(this['isNotNull'](_0x27059a[_0x42a1('0x78')][_0x42a1('0x7d')])){logger[_0x42a1('0x2a')](_0x42a1('0x7e'),_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a['uniqueid']][_0x42a1('0x7f')]=_0x27059a['value'];}else if(this[_0x42a1('0x2e')](_0x27059a['variable']['xmd-cdrtype'])){logger['info'](_0x42a1('0x80'),_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this['channels'][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x81')]=_0x27059a[_0x42a1('0x7a')];}else if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')][_0x42a1('0x82')])){logger[_0x42a1('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x27059a[_0x42a1('0x31')],_0x27059a['value'][_0x42a1('0x3b')](',')[0x0]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0xb')]=_0x27059a[_0x42a1('0x7a')][_0x42a1('0x3b')](',')[0x0];}else if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')][_0x42a1('0x83')])){logger[_0x42a1('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x84')]=_0x27059a[_0x42a1('0x7a')];}else if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')][_0x42a1('0x85')])){logger[_0x42a1('0x2a')](_0x42a1('0x86'),_0x27059a['uniqueid'],_0x27059a[_0x42a1('0x7a')]);this['channels'][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x87')]=_0x27059a[_0x42a1('0x7a')];}else if(this['isNotNull'](_0x27059a[_0x42a1('0x78')][_0x42a1('0x88')])){logger[_0x42a1('0x2a')](_0x42a1('0x89'),_0x27059a['uniqueid'],_0x27059a['value']);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]]['calleridpreview']=_0x27059a[_0x42a1('0x7a')];}else if(this[_0x42a1('0x2e')](_0x27059a['variable']['xmcs-queue'])){logger[_0x42a1('0x2a')](_0x42a1('0x8a'),_0x27059a['uniqueid'],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0xb')]=_0x27059a['value'];}else if(this[_0x42a1('0x2e')](_0x27059a['variable'][_0x42a1('0x8b')])){logger[_0x42a1('0x2a')](_0x42a1('0x8c'),_0x27059a['uniqueid'],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x8d')]=_0x27059a[_0x42a1('0x7a')];}}}else if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')][_0x42a1('0x79')])){if(_0x27059a[_0x42a1('0x7a')]){var _0x524b88=path[_0x42a1('0x8e')](_0x27059a[_0x42a1('0x7a')])[_0x42a1('0x4d')];logger[_0x42a1('0x2a')](_0x42a1('0x8f'),_0x524b88,_0x27059a['value']);this[_0x42a1('0x6e')](_0x524b88,_0x27059a[_0x42a1('0x7a')]);}}else if(this['channels'][_0x27059a['linkedid']]){if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')])){if(this['isNotNull'](_0x27059a[_0x42a1('0x78')][_0x42a1('0x8b')])){logger[_0x42a1('0x2a')](_0x42a1('0x8c'),_0x27059a['linkedid'],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x33')]][_0x42a1('0x90')]=_0x27059a['value'];}}}}}catch(_0x508a32){logger[_0x42a1('0x42')](_0x42a1('0x91'),_0x27059a[_0x42a1('0x31')],util['inspect'](_0x508a32,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x22')]=function(_0x1c41e2){try{if(this[_0x42a1('0x2e')](_0x1c41e2)){logger[_0x42a1('0x44')](_0x42a1('0x92'),_0x1c41e2[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x1c41e2,{'showHidden':![],'depth':null}));if(this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]]){logger[_0x42a1('0x2a')](_0x42a1('0x93'),_0x1c41e2[_0x42a1('0x31')],_0x1c41e2[_0x42a1('0x94')]);var _0xf29828=moment();this[_0x42a1('0x17')][_0x1c41e2['uniqueid']]['endtime']=_0xf29828[_0x42a1('0x3e')](_0x42a1('0x5a'));this[_0x42a1('0x17')][_0x1c41e2['uniqueid']]['duration']=_0xf29828[_0x42a1('0x65')](this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x57')],'seconds');if(this['channels'][_0x1c41e2['uniqueid']][_0x42a1('0x63')]){this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x95')]=_0xf29828[_0x42a1('0x65')](this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x96')],_0x42a1('0x66'));this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x64')]=this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x58')]-this['channels'][_0x1c41e2[_0x42a1('0x31')]]['billableseconds'];}if(_0x1c41e2[_0x42a1('0x38')]===_0x42a1('0x39')){if(this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]){this[_0x42a1('0x18')][_0x1c41e2['channel'][_0x42a1('0x3b')]('-')[0x0]]=_['omit'](this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]],[_0x42a1('0x3c')]);logger[_0x42a1('0x44')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x1c41e2[_0x42a1('0x31')],util[_0x42a1('0x2c')]({'id':this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x42a1('0x18')][_0x1c41e2['channel'][_0x42a1('0x3b')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0x42a1('0x3e')](_0x42a1('0x3f'),this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x4d')]),_0x42a1('0x97'),{'id':this[_0x42a1('0x18')][_0x1c41e2['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x41')]});for(var _0x50746b=0x0;_0x50746b<Object[_0x42a1('0x37')](this[_0x42a1('0x18')])[_0x42a1('0x98')];_0x50746b++){var _0x1b82c0=Object['keys'](this['agents'])[_0x50746b];var _0x261264=this[_0x42a1('0x18')][_0x1b82c0];if(_0x261264[_0x42a1('0x41')]===Number(_0x1c41e2[_0x42a1('0x3d')])){this[_0x42a1('0x2f')](util['format'](_0x42a1('0x3f'),_0x261264[_0x42a1('0x4d')]),'user:agentcomplete',{'id':_0x261264['id'],'destaccountcode':_0x261264['accountcode']});break;}}}}var _0xe64c8b=this;Promise['resolve']()[_0x42a1('0x99')](function(){var _0x374e1f=_0xe64c8b[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]];if(typeof _0x374e1f[_0x42a1('0x9a')]===_0x42a1('0x9b'))return;if(_['isEmpty'](_0x374e1f[_0x42a1('0x74')]))return;return RpcSetting[_0x42a1('0x9c')]()[_0x42a1('0x99')](function(_0x5c8465){if(!_0x5c8465[_0x42a1('0x9d')])return;return Promise[_0x42a1('0x9e')]()[_0x42a1('0x99')](function(){return ami[_0x42a1('0x9f')]({'action':_0x42a1('0xa0'),'channel':_0x374e1f['channel']})[_0x42a1('0xa1')](function(){});})['then'](function(){return ami[_0x42a1('0x9f')]({'action':_0x42a1('0xa0'),'channel':_0x374e1f['destinationchannel']})[_0x42a1('0xa1')](function(){})[_0x42a1('0xa2')](function(){var _0x47db37=_0xe64c8b[_0x42a1('0x18')][_0x374e1f['destinationchannel'][_0x42a1('0x3b')]('-')[0x0]];if(!_0x47db37)return;io[_0x42a1('0x2f')](_0x42a1('0xa3'),{'agentId':_0x47db37['id'],'uniqueid':_0x374e1f['uniqueid']});});});});})[_0x42a1('0x99')](function(){if(_0x1c41e2[_0x42a1('0xa4')]==='BlindTransfer'){_0xe64c8b[_0x42a1('0x19')][_0x1c41e2['uniqueid']]=_0xe64c8b[_0x42a1('0x17')][_0x1c41e2['uniqueid']];}else{if(_0xe64c8b[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]]['type']===_0x42a1('0xa5')&&_0xe64c8b['blindTransfers'][_0x1c41e2[_0x42a1('0x31')]]){_0xe64c8b['channels'][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x31')]=[_0xe64c8b[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x33')],_0xe64c8b[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x33')]=_0xe64c8b[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x31')]][0x0];delete _0xe64c8b[_0x42a1('0x19')][_0x1c41e2[_0x42a1('0x31')]];}}logger[_0x42a1('0x44')](_0x42a1('0xa6'),_0x1c41e2[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0xe64c8b['channels'][_0x1c41e2['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x42a1('0x2f')](_0x42a1('0xa7'),_0xe64c8b[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]]);delete _0xe64c8b[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]];});}}}catch(_0x35d52b){logger[_0x42a1('0x42')](_0x42a1('0xa8'),_0x1c41e2[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x35d52b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')]['syncAttendedTransfer']=function(_0x4ac6d0){try{if(this[_0x42a1('0x2e')](_0x4ac6d0)){logger[_0x42a1('0x2a')](_0x42a1('0xa9'),_0x4ac6d0['uniqueid'],_0x4ac6d0[_0x42a1('0xaa')],_0x4ac6d0[_0x42a1('0xab')]);logger[_0x42a1('0x44')](_0x42a1('0xac'),_0x4ac6d0[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x4ac6d0,{'showHidden':![],'depth':null}));var _0xc78ff1;if(this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xad')]]){this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xad')]][_0x42a1('0xae')]=_0x4ac6d0['origtransferercalleridnum'];this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xad')]][_0x42a1('0xaf')]=_0x4ac6d0[_0x42a1('0xab')];if(this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb0')]]){_0xc78ff1=this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb0')]];this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb0')]]=this[_0x42a1('0x17')][_0x4ac6d0['transfereeuniqueid']];this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xad')]]=_0xc78ff1;}}else if(this[_0x42a1('0x17')][_0x4ac6d0['transfertargetuniqueid']]){this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb1')]][_0x42a1('0xae')]=_0x4ac6d0[_0x42a1('0xaa')];this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb1')]][_0x42a1('0xaf')]=_0x4ac6d0[_0x42a1('0xab')];if(this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb2')]]){_0xc78ff1=this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb2')]];this['channels'][_0x4ac6d0[_0x42a1('0xb2')]]=this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb1')]];this['channels'][_0x4ac6d0['transfertargetuniqueid']]=_0xc78ff1;}}if((this[_0x42a1('0x17')][_0x4ac6d0['origtransfereruniqueid']]||this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb3')]])&&this['channels'][_0x4ac6d0[_0x42a1('0xb0')]]){var _0x307e92=_[_0x42a1('0xb4')]([this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb2')]],this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb3')]],this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb0')]]],function(_0x2fb6cc){return _0x2fb6cc&&_0x2fb6cc[_0x42a1('0x81')]===_0x42a1('0xa5')&&_0x2fb6cc['routeid'];});if(_0x307e92){if(this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb2')]])this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb2')]][_0x42a1('0x9a')]=_0x42a1('0xb5');if(this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb3')]])this[_0x42a1('0x17')][_0x4ac6d0['origtransfererlinkedid']][_0x42a1('0x9a')]=_0x42a1('0xb5');this[_0x42a1('0x17')][_0x4ac6d0[_0x42a1('0xb0')]]['transferType']='ATTENDED';}}}}catch(_0x5e32d2){logger[_0x42a1('0x42')]('[%s][voiceCallReport][attendedtransfer]',_0x4ac6d0[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x5e32d2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x42a1('0x26')]=function(_0x354385){try{if(this[_0x42a1('0x2e')](_0x354385)){logger[_0x42a1('0x2a')](_0x42a1('0xb6'),_0x354385['uniqueid'],_0x354385[_0x42a1('0xb7')],_0x354385[_0x42a1('0xb8')]);logger[_0x42a1('0x44')](_0x42a1('0xb9'),_0x354385[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x354385,{'showHidden':![],'depth':null}));if(this[_0x42a1('0x17')][_0x354385['transfereeuniqueid']]){this['channels'][_0x354385['transfereeuniqueid']][_0x42a1('0xae')]=_0x354385[_0x42a1('0xb7')];this[_0x42a1('0x17')][_0x354385[_0x42a1('0xad')]]['transferconnectedlinenum']=_0x354385[_0x42a1('0xb8')];this['channels'][_0x354385[_0x42a1('0xad')]][_0x42a1('0x9a')]=_0x42a1('0xba');this[_0x42a1('0x22')]({'event':'BlindTransfer','uniqueid':_0x354385[_0x42a1('0xad')],'context':_0x354385[_0x42a1('0x38')],'channel':_0x354385['transfererchannel']});}else{this[_0x42a1('0x17')][_0x354385[_0x42a1('0xbb')]][_0x42a1('0x9a')]=_0x42a1('0xba');}}}catch(_0x2246a3){logger[_0x42a1('0x42')]('[%s][voiceCallReport][blindtransfer]',_0x354385[_0x42a1('0x31')],util['inspect'](_0x2246a3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x28')]=function(_0x496a1b){try{if(this[_0x42a1('0x2e')](_0x496a1b)){logger[_0x42a1('0x44')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x496a1b['uniqueid'],util[_0x42a1('0x2c')](_0x496a1b,{'showHidden':![],'depth':null}));if(this[_0x42a1('0x17')][_0x496a1b[_0x42a1('0x31')]]){if(!_[_0x42a1('0xbc')](this[_0x42a1('0x17')][_0x496a1b[_0x42a1('0x31')]]['answertime'])){this[_0x42a1('0x17')][_0x496a1b['uniqueid']][_0x42a1('0xbd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['info'](_0x42a1('0xbe'),_0x496a1b[_0x42a1('0x31')],this[_0x42a1('0x17')][_0x496a1b[_0x42a1('0x31')]][_0x42a1('0xbd')]);}}}}catch(_0x2721d7){logger[_0x42a1('0x42')](_0x42a1('0xbf'),_0x496a1b[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x2721d7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x42a1('0xc0')]=function(_0x361bbd){try{if(this[_0x42a1('0x2e')](_0x361bbd)){logger['debug'](_0x42a1('0xc1'),_0x361bbd[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x361bbd,{'showHidden':![],'depth':null}));if(this['channels'][_0x361bbd['uniqueid']]){if(!_[_0x42a1('0xbc')](this['channels'][_0x361bbd[_0x42a1('0x31')]]['mohstarttime'])){this[_0x42a1('0x17')][_0x361bbd[_0x42a1('0x31')]][_0x42a1('0xc2')]+=moment()[_0x42a1('0xc3')](0x0)[_0x42a1('0x65')](this[_0x42a1('0x17')][_0x361bbd[_0x42a1('0x31')]]['mohstarttime'],_0x42a1('0x66'));logger['info'](_0x42a1('0xc4'),_0x361bbd[_0x42a1('0x31')],this[_0x42a1('0x17')][_0x361bbd[_0x42a1('0x31')]][_0x42a1('0xc2')]);delete this[_0x42a1('0x17')][_0x361bbd[_0x42a1('0x31')]][_0x42a1('0xbd')];}}}}catch(_0x54c33e){logger[_0x42a1('0x42')](_0x42a1('0xc5'),_0x361bbd[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x54c33e,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 9d55291..4da9bb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f96=['[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','voice','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','duration','endtime','starttime','total','answered','holdtime','diff','seconds','sumBillable','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','applicationdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','lodash','util','ioredis','../../../config/logger','ami','../ami','redis','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','hangup','isNotNull','isUndefined','emit','prototype','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','lastIndexOf','channel','omit','event','privilege','info'];(function(_0x364450,_0xd81db8){var _0x3d9c5e=function(_0x447374){while(--_0x447374){_0x364450['push'](_0x364450['shift']());}};_0x3d9c5e(++_0xd81db8);}(_0x0f96,0x1b4));var _0x60f9=function(_0x1b5680,_0x449953){_0x1b5680=_0x1b5680-0x0;var _0x293cc3=_0x0f96[_0x1b5680];return _0x293cc3;};'use strict';var _=require(_0x60f9('0x0'));var moment=require('moment');var util=require(_0x60f9('0x1'));var Redis=require(_0x60f9('0x2'));var config=require('../../../config/environment');var logger=require(_0x60f9('0x3'))(_0x60f9('0x4'));var ami=require(_0x60f9('0x5'));config['redis']=_['defaults'](config[_0x60f9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x60f9('0x7'))(new Redis(config[_0x60f9('0x6')]));function VoiceDialReport(_0xd271ca){this[_0x60f9('0x8')]=_0xd271ca[_0x60f9('0x9')];this[_0x60f9('0xa')]=_0xd271ca['outbound'];this['applications']={};this[_0x60f9('0xb')]={};ami['on'](_0x60f9('0xc'),this[_0x60f9('0xd')][_0x60f9('0xe')](this));ami['on'](_0x60f9('0xf'),this[_0x60f9('0x10')][_0x60f9('0xe')](this));ami['on'](_0x60f9('0x11'),this[_0x60f9('0x12')]['bind'](this));ami['on'](_0x60f9('0x13'),this[_0x60f9('0x14')][_0x60f9('0xe')](this));ami['on'](_0x60f9('0x15'),this['syncHangup'][_0x60f9('0xe')](this));}VoiceDialReport['prototype'][_0x60f9('0x16')]=function(_0x4c5d97){return _0x4c5d97!==null&&!_[_0x60f9('0x17')](_0x4c5d97);};VoiceDialReport['prototype']['emit']=function(_0x292514,_0x3c3969,_0x54f04c){io['to'](_0x292514)[_0x60f9('0x18')](_0x3c3969,_0x54f04c);};VoiceDialReport[_0x60f9('0x19')][_0x60f9('0xd')]=function(_0x29e948){try{if(this[_0x60f9('0x16')](_0x29e948)){logger['debug'](_0x60f9('0x1a'),_0x29e948[_0x60f9('0x1b')],util[_0x60f9('0x1c')](_0x29e948,{'showHidden':![],'depth':null}));if(this[_0x60f9('0x8')][_0x29e948['uniqueid']]){_[_0x60f9('0x1d')](this[_0x60f9('0x8')][_0x29e948['uniqueid']],{'starttime':moment()[_0x60f9('0x1e')](_0x60f9('0x1f')),'lastevent':_0x60f9('0x20'),'interface':_0x29e948['channel'][_0x60f9('0x21')](0x0,_0x29e948['channel'][_0x60f9('0x22')]('-')),'membername':_0x29e948[_0x60f9('0x23')][_0x60f9('0x21')](_0x29e948[_0x60f9('0x23')][_0x60f9('0x22')]('/')+0x1,_0x29e948[_0x60f9('0x23')][_0x60f9('0x22')]('-'))},_[_0x60f9('0x24')](_0x29e948,[_0x60f9('0x25'),_0x60f9('0x26')]));logger[_0x60f9('0x27')](_0x60f9('0x28'),_0x29e948[_0x60f9('0x1b')],this[_0x60f9('0x8')][_0x29e948[_0x60f9('0x1b')]][_0x60f9('0x29')],this[_0x60f9('0x8')][_0x29e948['uniqueid']][_0x60f9('0x2a')]);logger[_0x60f9('0x2b')](_0x60f9('0x2c'),_0x29e948[_0x60f9('0x1b')],util[_0x60f9('0x1c')](this[_0x60f9('0x8')][_0x29e948[_0x60f9('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x60f9('0x2d')][_0x29e948[_0x60f9('0x1b')]])_[_0x60f9('0x1d')](this[_0x60f9('0x8')][_0x29e948[_0x60f9('0x1b')]],this[_0x60f9('0x2d')][_0x29e948[_0x60f9('0x1b')]]);this['emit'](_0x60f9('0x2e'),_0x60f9('0x2f'),this[_0x60f9('0x8')][_0x29e948[_0x60f9('0x1b')]]);logger[_0x60f9('0x2b')](_0x60f9('0x30'),_0x29e948[_0x60f9('0x1b')],util[_0x60f9('0x1c')](this[_0x60f9('0x8')][_0x29e948[_0x60f9('0x1b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialbegin',this[_0x60f9('0x8')][_0x29e948[_0x60f9('0x1b')]]);}}}catch(_0x3137cd){logger[_0x60f9('0x31')](_0x60f9('0x32'),_0x29e948[_0x60f9('0x1b')],util['inspect'](_0x3137cd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x60f9('0x19')]['syncDialEnd']=function(_0x4b6df8){try{if(this['isNotNull'](_0x4b6df8)){logger['debug'](_0x60f9('0x33'),_0x4b6df8['uniqueid'],util[_0x60f9('0x1c')](_0x4b6df8,{'showHidden':![],'depth':null}));if(this[_0x60f9('0x8')][_0x4b6df8[_0x60f9('0x1b')]]){this[_0x60f9('0x8')][_0x4b6df8[_0x60f9('0x1b')]][_0x60f9('0x34')]=_0x4b6df8[_0x60f9('0x34')];if(_0x4b6df8[_0x60f9('0x34')]===_0x60f9('0x35')){this['channels'][_0x4b6df8[_0x60f9('0x1b')]][_0x60f9('0x36')]=_0x4b6df8[_0x60f9('0x36')];this[_0x60f9('0x8')][_0x4b6df8[_0x60f9('0x1b')]][_0x60f9('0x37')]=_0x4b6df8[_0x60f9('0x37')];this[_0x60f9('0x8')][_0x4b6df8[_0x60f9('0x1b')]][_0x60f9('0x38')]=moment()[_0x60f9('0x1e')](_0x60f9('0x1f'));this[_0x60f9('0x8')][_0x4b6df8[_0x60f9('0x1b')]][_0x60f9('0x39')]=_0x60f9('0x3a');logger[_0x60f9('0x27')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x4b6df8[_0x60f9('0x1b')],_0x4b6df8[_0x60f9('0x23')][_0x60f9('0x21')](_0x4b6df8['channel'][_0x60f9('0x22')]('/')+0x1,_0x4b6df8['channel'][_0x60f9('0x22')]('-')));logger[_0x60f9('0x2b')](_0x60f9('0x3b'),_0x4b6df8[_0x60f9('0x1b')],util[_0x60f9('0x1c')](this['channels'][_0x4b6df8[_0x60f9('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x60f9('0x18')](_0x60f9('0x3c'),this['channels'][_0x4b6df8[_0x60f9('0x1b')]]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4b6df8[_0x60f9('0x1b')],util['inspect'](this[_0x60f9('0x8')][_0x4b6df8['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x60f9('0x2e'),_0x60f9('0x2f'),this[_0x60f9('0x8')][_0x4b6df8[_0x60f9('0x1b')]]);}}}catch(_0x288f26){logger['error'](_0x60f9('0x3d'),_0x4b6df8['uniqueid'],util[_0x60f9('0x1c')](_0x288f26,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x60f9('0x19')][_0x60f9('0x12')]=function(_0x1df883){try{if(this[_0x60f9('0x16')](_0x1df883)){logger[_0x60f9('0x2b')](_0x60f9('0x3e'),_0x1df883[_0x60f9('0x1b')],util[_0x60f9('0x1c')](_0x1df883,{'showHidden':![],'depth':null}));this[_0x60f9('0x3f')](_0x1df883[_0x60f9('0x1b')],_[_0x60f9('0x40')](_0x1df883['variable'])[0x0],_0x1df883[_0x60f9('0x41')]);if(this[_0x60f9('0x16')](_0x1df883[_0x60f9('0x42')])&&this[_0x60f9('0x16')](_0x1df883[_0x60f9('0x42')]['outboundrouteid'])){if(_[_0x60f9('0x17')](this[_0x60f9('0x8')][_0x1df883[_0x60f9('0x1b')]])){this[_0x60f9('0x8')][_0x1df883[_0x60f9('0x1b')]]={'routeId':_0x1df883['value'],'variables':this[_0x60f9('0xb')][_0x1df883['uniqueid']],'motionChannel':_0x60f9('0x43')};logger['info']('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x1df883['uniqueid'],_0x1df883[_0x60f9('0x42')][_0x60f9('0x44')],_[_0x60f9('0x40')](_0x1df883[_0x60f9('0x42')])[0x0],_0x1df883['value']);logger[_0x60f9('0x2b')](_0x60f9('0x45'),_0x1df883[_0x60f9('0x1b')],util[_0x60f9('0x1c')](this[_0x60f9('0x8')][_0x1df883[_0x60f9('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x60f9('0x2f'),this[_0x60f9('0x8')][_0x1df883['uniqueid']]);}}}}catch(_0x5c9ec1){logger[_0x60f9('0x31')](_0x60f9('0x46'),_0x1df883[_0x60f9('0x1b')],util['inspect'](_0x5c9ec1,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x5cff74,_0x90fc31,_0x93e7be){var _0x48ef5e=[_0x60f9('0x47'),_0x60f9('0x48'),_0x60f9('0x49'),_0x60f9('0x4a'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x60f9('0x4b'),_0x60f9('0x4c'),'sipcallid',_0x60f9('0x4d'),'bridgepeer',_0x60f9('0x4e'),_0x60f9('0x4f'),_0x60f9('0x50'),_0x60f9('0x51'),_0x60f9('0x52'),_0x60f9('0x29'),_0x60f9('0x53'),'memberrealtime'];if(!_['isNil'](_0x90fc31)&&!_[_0x60f9('0x54')](_0x48ef5e,_0x90fc31)){if(_[_0x60f9('0x17')](this[_0x60f9('0xb')][_0x5cff74])){this[_0x60f9('0xb')][_0x5cff74]={};}this[_0x60f9('0xb')][_0x5cff74][_0x90fc31]=_0x93e7be;}};VoiceDialReport['prototype'][_0x60f9('0x55')]=function(_0x289a08){try{if(this['isNotNull'](_0x289a08)){logger[_0x60f9('0x2b')](_0x60f9('0x56'),_0x289a08[_0x60f9('0x1b')],util[_0x60f9('0x1c')](_0x289a08,{'showHidden':![],'depth':null}));if(this['channels'][_0x289a08[_0x60f9('0x1b')]]){logger[_0x60f9('0x27')](_0x60f9('0x57'),_0x289a08[_0x60f9('0x1b')],_0x289a08['cause-txt']);this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]]['endtime']=moment()[_0x60f9('0x1e')](_0x60f9('0x1f'));this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x58')]=moment(this['channels'][_0x289a08['uniqueid']][_0x60f9('0x59')])['diff'](this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x5a')],'seconds');this[_0x60f9('0x8')][_0x289a08['uniqueid']][_0x60f9('0x39')]='complete';this[_0x60f9('0xa')][_0x60f9('0x5b')]+=0x1;if(this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x38')]){this[_0x60f9('0xa')][_0x60f9('0x5c')]+=0x1;this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x5d')]=moment(this['channels'][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x38')])[_0x60f9('0x5e')](this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x5a')],_0x60f9('0x5f'));this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]]['billableseconds']=moment(this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x59')])[_0x60f9('0x5e')](this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x38')],_0x60f9('0x5f'));this[_0x60f9('0xa')]['sumHoldTime']+=this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x5d')]||0x0;this[_0x60f9('0xa')][_0x60f9('0x60')]+=this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x61')];}this[_0x60f9('0xa')][_0x60f9('0x62')]+=this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]][_0x60f9('0x58')];logger[_0x60f9('0x2b')](_0x60f9('0x63'),_0x289a08[_0x60f9('0x1b')],util[_0x60f9('0x1c')](this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x60f9('0x18')]('custom:voiceDialReport',this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]]);logger['debug'](_0x60f9('0x64'),_0x289a08[_0x60f9('0x1b')],util[_0x60f9('0x1c')](this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x60f9('0x18')](_0x60f9('0x65'),this[_0x60f9('0x8')][_0x289a08['uniqueid']]);logger['debug'](_0x60f9('0x66'),_0x289a08[_0x60f9('0x1b')],util[_0x60f9('0x1c')](this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]],{'showHidden':![],'depth':null}));this[_0x60f9('0x18')]('voice:outbound',_0x60f9('0x67'),this[_0x60f9('0xa')]);logger[_0x60f9('0x27')](_0x60f9('0x68'),JSON[_0x60f9('0x69')](this['channels'][_0x289a08[_0x60f9('0x1b')]]));logger[_0x60f9('0x2b')](_0x60f9('0x6a'),_0x289a08[_0x60f9('0x1b')],util[_0x60f9('0x1c')](this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]],{'showHidden':![],'depth':null}));this[_0x60f9('0x18')](_0x60f9('0x2e'),'voice_outbound_channel:remove',this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x1b')]]);delete this['channels'][_0x289a08[_0x60f9('0x1b')]];}else if(this[_0x60f9('0x8')][_0x289a08['linkedid']]){this[_0x60f9('0x8')][_0x289a08['linkedid']][_0x60f9('0x1b')]=this[_0x60f9('0x8')][_0x289a08[_0x60f9('0x6b')]]['destuniqueid'];}if(this[_0x60f9('0xb')][_0x289a08[_0x60f9('0x1b')]]){delete this[_0x60f9('0xb')][_0x289a08[_0x60f9('0x1b')]];}}}catch(_0x34b13f){logger['error'](_0x60f9('0x6c'),_0x289a08[_0x60f9('0x1b')],util[_0x60f9('0x1c')](_0x34b13f,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x60f9('0x14')]=function(_0x2e8096){try{if(this['isNotNull'](_0x2e8096)){logger[_0x60f9('0x2b')](_0x60f9('0x6d'),_0x2e8096[_0x60f9('0x1b')],util[_0x60f9('0x1c')](_0x2e8096,{'showHidden':![],'depth':null}));if(_0x2e8096[_0x60f9('0x6e')]['toLowerCase']()==='set'){_0x2e8096[_0x60f9('0x6f')]=(_0x2e8096['appdata']||_0x2e8096[_0x60f9('0x6f')])[_0x60f9('0x70')]();if(_[_0x60f9('0x71')](_0x2e8096['applicationdata'],_0x60f9('0x72'))){if(_[_0x60f9('0x17')](this[_0x60f9('0x2d')][_0x2e8096[_0x60f9('0x1b')]]))this[_0x60f9('0x2d')][_0x2e8096[_0x60f9('0x1b')]]={};logger[_0x60f9('0x27')](_0x60f9('0x73'),_0x2e8096['uniqueid'],_0x2e8096['application'],_0x2e8096[_0x60f9('0x6f')]);var _0xd71fcc=_0x2e8096[_0x60f9('0x6f')][_0x60f9('0x74')]('=');var _0x4883ea=_0xd71fcc[0x0][_0x60f9('0x75')](/cdr\((.*)\)/);if(_0x4883ea)this['applications'][_0x2e8096[_0x60f9('0x1b')]][_0x4883ea[0x1]]=_0xd71fcc[0x1];}}}}catch(_0x403f1c){logger['error'](_0x60f9('0x76'),_0x2e8096[_0x60f9('0x1b')],util[_0x60f9('0x1c')](_0x403f1c,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0x7632=['sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','YYYY-MM-DD\x20HH:mm:ss','duration','endtime','diff','starttime','seconds','complete','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','startsWith','split','match','exports','lodash','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','syncDialEnd','syncVarSet','newexten','syncNewExten','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','channel','substring','lastIndexOf','event','privilege','info','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%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:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','value','variable','outboundrouteid','voice','[%s][voiceDialReport][varset]','addVariable','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged'];(function(_0x5de1d2,_0x3ed732){var _0x327771=function(_0x493188){while(--_0x493188){_0x5de1d2['push'](_0x5de1d2['shift']());}};_0x327771(++_0x3ed732);}(_0x7632,0x175));var _0x2763=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0x7632[_0x146837];return _0x3d7e60;};'use strict';var _=require(_0x2763('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x2763('0x1'));var config=require(_0x2763('0x2'));var logger=require(_0x2763('0x3'))('ami');var ami=require('../ami');config['redis']=_['defaults'](config[_0x2763('0x4')],{'host':_0x2763('0x5'),'port':0x18eb});var io=require(_0x2763('0x6'))(new Redis(config[_0x2763('0x4')]));function VoiceDialReport(_0x3c90c1){this[_0x2763('0x7')]=_0x3c90c1[_0x2763('0x8')];this[_0x2763('0x9')]=_0x3c90c1[_0x2763('0x9')];this[_0x2763('0xa')]={};this[_0x2763('0xb')]={};ami['on'](_0x2763('0xc'),this[_0x2763('0xd')][_0x2763('0xe')](this));ami['on']('dialend',this[_0x2763('0xf')][_0x2763('0xe')](this));ami['on']('varset',this[_0x2763('0x10')][_0x2763('0xe')](this));ami['on'](_0x2763('0x11'),this[_0x2763('0x12')][_0x2763('0xe')](this));ami['on']('hangup',this[_0x2763('0x13')][_0x2763('0xe')](this));}VoiceDialReport[_0x2763('0x14')][_0x2763('0x15')]=function(_0x1fc073){return _0x1fc073!==null&&!_[_0x2763('0x16')](_0x1fc073);};VoiceDialReport[_0x2763('0x14')]['emit']=function(_0x1ba294,_0x33a87b,_0x4d6f4e){io['to'](_0x1ba294)[_0x2763('0x17')](_0x33a87b,_0x4d6f4e);};VoiceDialReport[_0x2763('0x14')]['syncDialBegin']=function(_0x4f3bd9){try{if(this[_0x2763('0x15')](_0x4f3bd9)){logger[_0x2763('0x18')](_0x2763('0x19'),_0x4f3bd9[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x4f3bd9,{'showHidden':![],'depth':null}));if(this[_0x2763('0x7')][_0x4f3bd9[_0x2763('0x1a')]]){_[_0x2763('0x1c')](this[_0x2763('0x7')][_0x4f3bd9[_0x2763('0x1a')]],{'starttime':moment()[_0x2763('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x4f3bd9[_0x2763('0x1e')][_0x2763('0x1f')](0x0,_0x4f3bd9[_0x2763('0x1e')][_0x2763('0x20')]('-')),'membername':_0x4f3bd9['channel'][_0x2763('0x1f')](_0x4f3bd9[_0x2763('0x1e')]['lastIndexOf']('/')+0x1,_0x4f3bd9[_0x2763('0x1e')][_0x2763('0x20')]('-'))},_['omit'](_0x4f3bd9,[_0x2763('0x21'),_0x2763('0x22')]));logger[_0x2763('0x23')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x4f3bd9[_0x2763('0x1a')],this[_0x2763('0x7')][_0x4f3bd9[_0x2763('0x1a')]][_0x2763('0x24')],this[_0x2763('0x7')][_0x4f3bd9[_0x2763('0x1a')]]['interface']);logger['debug'](_0x2763('0x25'),_0x4f3bd9[_0x2763('0x1a')],util[_0x2763('0x1b')](this[_0x2763('0x7')][_0x4f3bd9['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x2763('0xa')][_0x4f3bd9['uniqueid']])_[_0x2763('0x1c')](this['channels'][_0x4f3bd9[_0x2763('0x1a')]],this[_0x2763('0xa')][_0x4f3bd9[_0x2763('0x1a')]]);this[_0x2763('0x17')](_0x2763('0x26'),_0x2763('0x27'),this['channels'][_0x4f3bd9[_0x2763('0x1a')]]);logger['debug'](_0x2763('0x28'),_0x4f3bd9[_0x2763('0x1a')],util[_0x2763('0x1b')](this['channels'][_0x4f3bd9[_0x2763('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x2763('0x17')](_0x2763('0x29'),this[_0x2763('0x7')][_0x4f3bd9[_0x2763('0x1a')]]);}}}catch(_0x2a10bd){logger[_0x2763('0x2a')]('[%s][voiceDialReport][dialbegin]',_0x4f3bd9[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x2a10bd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2763('0x14')][_0x2763('0xf')]=function(_0x5a91cc){try{if(this[_0x2763('0x15')](_0x5a91cc)){logger['debug'](_0x2763('0x2b'),_0x5a91cc[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x5a91cc,{'showHidden':![],'depth':null}));if(this[_0x2763('0x7')][_0x5a91cc[_0x2763('0x1a')]]){this['channels'][_0x5a91cc[_0x2763('0x1a')]]['dialstatus']=_0x5a91cc[_0x2763('0x2c')];if(_0x5a91cc['dialstatus']===_0x2763('0x2d')){this[_0x2763('0x7')][_0x5a91cc[_0x2763('0x1a')]][_0x2763('0x2e')]=_0x5a91cc[_0x2763('0x2e')];this['channels'][_0x5a91cc[_0x2763('0x1a')]][_0x2763('0x2f')]=_0x5a91cc[_0x2763('0x2f')];this['channels'][_0x5a91cc['uniqueid']][_0x2763('0x30')]=moment()[_0x2763('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5a91cc[_0x2763('0x1a')]][_0x2763('0x31')]=_0x2763('0x32');logger['info'](_0x2763('0x33'),_0x5a91cc['uniqueid'],_0x5a91cc[_0x2763('0x1e')][_0x2763('0x1f')](_0x5a91cc['channel'][_0x2763('0x20')]('/')+0x1,_0x5a91cc[_0x2763('0x1e')][_0x2763('0x20')]('-')));logger[_0x2763('0x18')](_0x2763('0x34'),_0x5a91cc[_0x2763('0x1a')],util[_0x2763('0x1b')](this[_0x2763('0x7')][_0x5a91cc[_0x2763('0x1a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x2763('0x35'),this[_0x2763('0x7')][_0x5a91cc[_0x2763('0x1a')]]);}logger[_0x2763('0x18')](_0x2763('0x36'),_0x5a91cc[_0x2763('0x1a')],util[_0x2763('0x1b')](this[_0x2763('0x7')][_0x5a91cc['uniqueid']],{'showHidden':![],'depth':null}));this[_0x2763('0x17')](_0x2763('0x26'),_0x2763('0x27'),this[_0x2763('0x7')][_0x5a91cc['uniqueid']]);}}}catch(_0x3b1462){logger['error'](_0x2763('0x37'),_0x5a91cc[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x3b1462,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2763('0x14')]['syncVarSet']=function(_0x175c15){try{if(this[_0x2763('0x15')](_0x175c15)){logger[_0x2763('0x18')](_0x2763('0x38'),_0x175c15[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x175c15,{'showHidden':![],'depth':null}));this['addVariable'](_0x175c15[_0x2763('0x1a')],_[_0x2763('0x39')](_0x175c15['variable'])[0x0],_0x175c15[_0x2763('0x3a')]);if(this['isNotNull'](_0x175c15[_0x2763('0x3b')])&&this[_0x2763('0x15')](_0x175c15[_0x2763('0x3b')][_0x2763('0x3c')])){if(_[_0x2763('0x16')](this['channels'][_0x175c15['uniqueid']])){this[_0x2763('0x7')][_0x175c15[_0x2763('0x1a')]]={'routeId':_0x175c15[_0x2763('0x3a')],'variables':this[_0x2763('0xb')][_0x175c15[_0x2763('0x1a')]],'motionChannel':_0x2763('0x3d')};logger[_0x2763('0x23')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x175c15['uniqueid'],_0x175c15[_0x2763('0x3b')][_0x2763('0x3c')],_[_0x2763('0x39')](_0x175c15[_0x2763('0x3b')])[0x0],_0x175c15['value']);logger[_0x2763('0x18')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x175c15[_0x2763('0x1a')],util['inspect'](this[_0x2763('0x7')][_0x175c15['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x2763('0x26'),_0x2763('0x27'),this[_0x2763('0x7')][_0x175c15[_0x2763('0x1a')]]);}}}}catch(_0x5cc0c3){logger['error'](_0x2763('0x3e'),_0x175c15['uniqueid'],util[_0x2763('0x1b')](_0x5cc0c3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2763('0x14')][_0x2763('0x3f')]=function(_0x4fbf4a,_0x48afd9,_0x9d2adf){var _0x3e63fe=['rtpaudioqos','rtpaudioqosbridged',_0x2763('0x40'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x2763('0x41'),'rtpaudioqosrtt',_0x2763('0x42'),'sipcallid',_0x2763('0x43'),_0x2763('0x44'),_0x2763('0x45'),_0x2763('0x46'),_0x2763('0x47'),_0x2763('0x48'),_0x2763('0x49'),_0x2763('0x24'),_0x2763('0x4a'),_0x2763('0x4b')];if(!_[_0x2763('0x4c')](_0x48afd9)&&!_['includes'](_0x3e63fe,_0x48afd9)){if(_[_0x2763('0x16')](this[_0x2763('0xb')][_0x4fbf4a])){this[_0x2763('0xb')][_0x4fbf4a]={};}this[_0x2763('0xb')][_0x4fbf4a][_0x48afd9]=_0x9d2adf;}};VoiceDialReport[_0x2763('0x14')][_0x2763('0x13')]=function(_0x10b0a6){try{if(this[_0x2763('0x15')](_0x10b0a6)){logger[_0x2763('0x18')]('[%s][voiceDialReport][hangup]\x20event:',_0x10b0a6[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x10b0a6,{'showHidden':![],'depth':null}));if(this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]]){logger[_0x2763('0x23')](_0x2763('0x4d'),_0x10b0a6[_0x2763('0x1a')],_0x10b0a6['cause-txt']);this[_0x2763('0x7')][_0x10b0a6['uniqueid']]['endtime']=moment()[_0x2763('0x1d')](_0x2763('0x4e'));this['channels'][_0x10b0a6['uniqueid']][_0x2763('0x4f')]=moment(this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]][_0x2763('0x50')])[_0x2763('0x51')](this[_0x2763('0x7')][_0x10b0a6['uniqueid']][_0x2763('0x52')],_0x2763('0x53'));this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]][_0x2763('0x31')]=_0x2763('0x54');this[_0x2763('0x9')]['total']+=0x1;if(this['channels'][_0x10b0a6[_0x2763('0x1a')]][_0x2763('0x30')]){this[_0x2763('0x9')][_0x2763('0x55')]+=0x1;this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]][_0x2763('0x56')]=moment(this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]]['answertime'])['diff'](this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]][_0x2763('0x52')],_0x2763('0x53'));this[_0x2763('0x7')][_0x10b0a6['uniqueid']][_0x2763('0x57')]=moment(this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]][_0x2763('0x50')])[_0x2763('0x51')](this[_0x2763('0x7')][_0x10b0a6['uniqueid']][_0x2763('0x30')],_0x2763('0x53'));this[_0x2763('0x9')][_0x2763('0x58')]+=this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]][_0x2763('0x56')]||0x0;this['outbound'][_0x2763('0x59')]+=this[_0x2763('0x7')][_0x10b0a6['uniqueid']][_0x2763('0x57')];}this['outbound'][_0x2763('0x5a')]+=this['channels'][_0x10b0a6['uniqueid']][_0x2763('0x4f')];logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x10b0a6['uniqueid'],util[_0x2763('0x1b')](this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this['channels'][_0x10b0a6[_0x2763('0x1a')]]);logger[_0x2763('0x18')](_0x2763('0x5b'),_0x10b0a6[_0x2763('0x1a')],util[_0x2763('0x1b')](this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x2763('0x17')](_0x2763('0x5c'),this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]]);logger[_0x2763('0x18')](_0x2763('0x5d'),_0x10b0a6['uniqueid'],util[_0x2763('0x1b')](this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0x2763('0x26'),_0x2763('0x5e'),this[_0x2763('0x9')]);logger[_0x2763('0x23')](_0x2763('0x5f'),JSON['stringify'](this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]]));logger[_0x2763('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x10b0a6['uniqueid'],util[_0x2763('0x1b')](this['channels'][_0x10b0a6[_0x2763('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0x2763('0x26'),_0x2763('0x60'),this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]]);delete this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x1a')]];}else if(this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x61')]]){this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x61')]][_0x2763('0x1a')]=this[_0x2763('0x7')][_0x10b0a6[_0x2763('0x61')]][_0x2763('0x62')];}if(this[_0x2763('0xb')][_0x10b0a6[_0x2763('0x1a')]]){delete this[_0x2763('0xb')][_0x10b0a6[_0x2763('0x1a')]];}}}catch(_0x1cbc7a){logger['error'](_0x2763('0x63'),_0x10b0a6[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x1cbc7a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2763('0x14')]['syncNewExten']=function(_0x2e6225){try{if(this[_0x2763('0x15')](_0x2e6225)){logger['debug'](_0x2763('0x64'),_0x2e6225[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x2e6225,{'showHidden':![],'depth':null}));if(_0x2e6225[_0x2763('0x65')]['toLowerCase']()===_0x2763('0x66')){_0x2e6225[_0x2763('0x67')]=(_0x2e6225[_0x2763('0x68')]||_0x2e6225['applicationdata'])[_0x2763('0x69')]();if(_[_0x2763('0x6a')](_0x2e6225[_0x2763('0x67')],'cdr(')){if(_[_0x2763('0x16')](this[_0x2763('0xa')][_0x2e6225[_0x2763('0x1a')]]))this[_0x2763('0xa')][_0x2e6225[_0x2763('0x1a')]]={};logger[_0x2763('0x23')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x2e6225[_0x2763('0x1a')],_0x2e6225[_0x2763('0x65')],_0x2e6225[_0x2763('0x67')]);var _0x9da5a0=_0x2e6225[_0x2763('0x67')][_0x2763('0x6b')]('=');var _0x44425a=_0x9da5a0[0x0][_0x2763('0x6c')](/cdr\((.*)\)/);if(_0x44425a)this[_0x2763('0xa')][_0x2e6225[_0x2763('0x1a')]][_0x44425a[0x1]]=_0x9da5a0[0x1];}}}}catch(_0x207259){logger[_0x2763('0x2a')]('[%s][voiceDialReport][newexten]',_0x2e6225[_0x2763('0x1a')],util[_0x2763('0x1b')](_0x207259,{'showHidden':![],'depth':null}));}};module[_0x2763('0x6d')]=VoiceDialReport;
\ No newline at end of file
index 5d1930b..929ace9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49a=['syncNewExten','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','lodash','moment','util','md5','ioredis','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','musiconholdstart','musiconholdstop','syncAttendedTransfer','blindtransfer','loopQueueShow','hasOwnProperty','originated','isEmpty','talking','pTalking','queueStatusComplete','clearZombieChannels','sequence','isNil','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice_queue_presence:save','emitVoiceQueueChannelRemove','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','name','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isNotNull','isUndefined','Action','queues','[voiceQueueReport][queues]','loopQueueSummary','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','inbound','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','channel','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','syncVarSet','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','[%s][voiceQueueReport][hangup]','length','diff','queuecallerjoinAt','milliseconds','answered','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s'];(function(_0x556c78,_0x23b5db){var _0x557d44=function(_0x1f2fa4){while(--_0x1f2fa4){_0x556c78['push'](_0x556c78['shift']());}};_0x557d44(++_0x23b5db);}(_0xb49a,0xfb));var _0xab49=function(_0x5dfe9b,_0x318b85){_0x5dfe9b=_0x5dfe9b-0x0;var _0x3bb0f4=_0xb49a[_0x5dfe9b];return _0x3bb0f4;};'use strict';var _=require(_0xab49('0x0'));var moment=require(_0xab49('0x1'));var util=require(_0xab49('0x2'));var md5=require(_0xab49('0x3'));var Redis=require(_0xab49('0x4'));var config=require('../../../config/environment');var logger=require(_0xab49('0x5'))(_0xab49('0x6'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0xab49('0x7')]=_[_0xab49('0x8')](config[_0xab49('0x7')],{'host':_0xab49('0x9'),'port':0x18eb});var io=require(_0xab49('0xa'))(new Redis(config[_0xab49('0x7')]));var Sequence=function(){};Sequence[_0xab49('0xb')]['enqueue']=function(_0x15f259){this[_0xab49('0xc')]=this[_0xab49('0xc')]?this[_0xab49('0xc')][_0xab49('0xd')](_0x15f259):_0x15f259();};function VoiceQueueReport(_0x592215){this['sequence']=new Sequence();this[_0xab49('0xe')]={};this[_0xab49('0xf')]=_0x592215[_0xab49('0xf')];this[_0xab49('0x10')]=_0x592215[_0xab49('0x11')];this['voiceQueues']=_0x592215[_0xab49('0x12')];this[_0xab49('0x13')]=!![];this[_0xab49('0x14')]=_0x592215[_0xab49('0x14')];this[_0xab49('0x15')]={};ami['on'](_0xab49('0x16'),this[_0xab49('0x17')][_0xab49('0x18')](this));ami['on'](_0xab49('0x19'),this[_0xab49('0x1a')][_0xab49('0x18')](this));ami['on']('queuecallerjoin',this[_0xab49('0x1b')][_0xab49('0x18')](this));ami['on'](_0xab49('0x1c'),this[_0xab49('0x1d')][_0xab49('0x18')](this));ami['on']('queuecallerleave',this[_0xab49('0x1e')][_0xab49('0x18')](this));ami['on'](_0xab49('0x1f'),this[_0xab49('0x20')][_0xab49('0x18')](this));ami['on']('agentconnect',this[_0xab49('0x21')][_0xab49('0x18')](this));ami['on'](_0xab49('0x22'),this['syncVarSet']['bind'](this));ami['on'](_0xab49('0x23'),this[_0xab49('0x24')]['bind'](this));ami['on'](_0xab49('0x25'),this[_0xab49('0x26')]['bind'](this));ami['on'](_0xab49('0x27'),this['syncNewExten'][_0xab49('0x18')](this));ami['on'](_0xab49('0x28'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xab49('0x29'),this['syncMusicOnHoldStop'][_0xab49('0x18')](this));ami['on']('attendedtransfer',this[_0xab49('0x2a')][_0xab49('0x18')](this));ami['on'](_0xab49('0x2b'),this['syncBlindTransfer'][_0xab49('0x18')](this));this['loopQueueSummary']();this[_0xab49('0x2c')]();}function clearChannels(_0xeb6d91){if(!_['isEmpty'](_0xeb6d91)){for(var _0x29096f in _0xeb6d91){if(_0xeb6d91[_0xab49('0x2d')](_0x29096f)){delete _0xeb6d91[_0x29096f];}}}}function clearCampaigns(_0x4f1364){if(!_['isEmpty'](_0x4f1364)){for(var _0x11446b in _0x4f1364){if(_0x4f1364[_0xab49('0x2d')](_0x11446b)){_0x4f1364[_0x11446b][_0xab49('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x5b7c22){if(!_[_0xab49('0x2f')](_0x5b7c22)){for(var _0x237273 in _0x5b7c22){if(_0x5b7c22['hasOwnProperty'](_0x237273)){_0x5b7c22[_0x237273][_0xab49('0x2e')]=0x0;_0x5b7c22[_0x237273][_0xab49('0x30')]=0x0;_0x5b7c22[_0x237273][_0xab49('0x31')]=0x0;_0x5b7c22[_0x237273]['waiting']=0x0;_0x5b7c22[_0x237273][_0xab49('0x32')]=!![];}}}}function clearAgentBooked(_0x550f06){if(!_[_0xab49('0x2f')](_0x550f06)){for(var _0x53ec05 in _0x550f06){if(_0x550f06[_0xab49('0x2d')](_0x53ec05)){_0x550f06[_0x53ec05]['unlockRR']=!![];}}}}VoiceQueueReport[_0xab49('0xb')][_0xab49('0x33')]=function(){var _0x1c48ef=this;for(var _0x211be2 in this['channels']){if(this[_0xab49('0x10')][_0xab49('0x2d')](_0x211be2)&&!this[_0xab49('0x10')][_0x211be2]['switch']){this[_0xab49('0x34')]['enqueue'](function(){if(!_[_0xab49('0x35')](_0x1c48ef['channels'][_0x211be2])){return ami['Action']({'action':'status','channel':_0x1c48ef[_0xab49('0x10')][_0x211be2]['channel']})[_0xab49('0x36')](function(_0x2e013f){if(_0x2e013f[_0xab49('0x37')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1c48ef[_0xab49('0x10')][_0x211be2]){delete _0x1c48ef[_0xab49('0x10')][_0x211be2];logger[_0xab49('0x38')](_0xab49('0x39'),_0x211be2,util[_0xab49('0x3a')](_0x2e013f,{'showHidden':![],'depth':null}));}if(_0x1c48ef['queueReports'][_0x211be2]){delete _0x1c48ef[_0xab49('0xe')][_0x211be2];logger[_0xab49('0x38')]('[%s][voiceQueueReport][checkQueueReport]',_0x211be2,util['inspect'](_0x2e013f,{'showHidden':![],'depth':null}));}if(_0x1c48ef[_0xab49('0x15')][_0x211be2]){delete _0x1c48ef[_0xab49('0x15')][_0x211be2];logger[_0xab49('0x38')](_0xab49('0x3b'),_0x211be2,util[_0xab49('0x3a')](_0x2e013f,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x26')]=function(){logger[_0xab49('0x38')](_0xab49('0x3c'));clearChannels(this[_0xab49('0x10')]);this[_0xab49('0x3d')](this[_0xab49('0xe')]);clearAgentBooked(this[_0xab49('0xf')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xab49('0x14')]);};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x3d')]=function(_0x46e359){var _0x3c8155=this;if(!_['isEmpty'](_0x46e359)){for(var _0x2ec3ac in _0x46e359){if(_0x46e359['hasOwnProperty'](_0x2ec3ac)){_0x3c8155['emitVoiceQueueChannelRemove'](_0x46e359[_0x2ec3ac],_0xab49('0x3e'));delete _0x46e359[_0x2ec3ac];}}}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x3f')]=function(_0x7d8f77,_0x26d1eb,_0x538422){io['to'](_0x7d8f77)[_0xab49('0x3f')](_0x26d1eb,_0x538422);};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x40')]=function(_0x46e02f,_0x212041){logger['debug']('[%s][voiceQueueReport]['+_0x212041+_0xab49('0x41'),_0x46e02f[_0xab49('0x42')],util[_0xab49('0x3a')](_0x46e02f,{'showHidden':![],'depth':null}));this['emit'](util[_0xab49('0x43')]('voice:queue:%s',_0x46e02f['name']),'voice_queue_channel:save',_0x46e02f);io['emit'](_0xab49('0x44'),_0x46e02f);};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x45')]=function(_0x1aa993,_0x2133b3){logger[_0xab49('0x46')](_0xab49('0x47')+_0x2133b3+_0xab49('0x48'),_0x1aa993[_0xab49('0x42')],util[_0xab49('0x3a')](_0x1aa993,{'showHidden':![],'depth':null}));this['emit'](util[_0xab49('0x43')](_0xab49('0x49'),_0x1aa993['name']),_0xab49('0x4a'),_0x1aa993);io[_0xab49('0x3f')](_0xab49('0x4b'),_0x1aa993);};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x4c')]=function(_0x2a671a,_0x17fc84){if(_0x2a671a[_0xab49('0x4d')]==='inbound'){var _0x30d52a={'id':_0x2a671a['id'],'name':_0x2a671a[_0xab49('0x4e')],'strategy':_0x2a671a[_0xab49('0x4f')],'answered':_0x2a671a['answered'],'available':_0x2a671a[_0xab49('0x50')],'loggedIn':_0x2a671a[_0xab49('0x51')],'pTalking':_0x2a671a[_0xab49('0x31')],'sumBillable':_0x2a671a[_0xab49('0x52')],'sumDuration':_0x2a671a[_0xab49('0x53')],'sumHoldTime':_0x2a671a[_0xab49('0x54')]||0x0,'talking':_0x2a671a['talking'],'total':_0x2a671a[_0xab49('0x55')],'type':_0x2a671a[_0xab49('0x4d')],'unmanaged':_0x2a671a[_0xab49('0x56')],'abandoned':_0x2a671a[_0xab49('0x57')],'waiting':_0x2a671a[_0xab49('0x58')]};if(_0x2a671a[_0xab49('0x59')]){_0x30d52a['Trunk']={'id':_0x2a671a[_0xab49('0x59')]['id'],'name':_0x2a671a[_0xab49('0x59')][_0xab49('0x4e')],'active':_0x2a671a[_0xab49('0x59')][_0xab49('0x5a')],'callerid':_0x2a671a[_0xab49('0x59')][_0xab49('0x5b')]};}if(_0x2a671a[_0xab49('0x5c')]){_0x30d52a[_0xab49('0x5c')]={'id':_0x2a671a[_0xab49('0x5c')]['id'],'name':_0x2a671a[_0xab49('0x5c')][_0xab49('0x4e')]};}var _0x5103a5=md5(JSON[_0xab49('0x5d')](_0x30d52a));if(_0x2a671a[_0xab49('0x3')]!==_0x5103a5){_0x2a671a[_0xab49('0x3')]=_0x5103a5;logger[_0xab49('0x46')](_0xab49('0x5e')+_0x17fc84+_0xab49('0x5f'),util[_0xab49('0x3a')](_0x30d52a,{'showHidden':![],'depth':null}));this['emit'](util[_0xab49('0x43')]('voice:queue:%s',_0x30d52a[_0xab49('0x4e')]),'voice_queue:save',_0x30d52a);}}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x60')]=function(_0x4bc6cf){return _0x4bc6cf!==null&&!_[_0xab49('0x61')](_0x4bc6cf);};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x2c')]=function(){var _0x2b9d6f=this;setInterval(function(){_0x2b9d6f[_0xab49('0x33')]();ami[_0xab49('0x62')]({'action':_0xab49('0x63')})[_0xab49('0x36')](function(_0x37cf42){logger[_0xab49('0x38')](_0xab49('0x64'),util[_0xab49('0x3a')](_0x37cf42,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x65')]=function(){var _0x235ba8=this;setInterval(function(){if(_0x235ba8[_0xab49('0x13')]){return ami[_0xab49('0x62')]({'action':'queuesummary'})[_0xab49('0x66')](function(_0x2a609e){_0x235ba8[_0xab49('0x13')]=![];})[_0xab49('0x36')](function(_0x45af7e){logger['error'](_0xab49('0x67'),util[_0xab49('0x3a')](_0x45af7e,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x17')]=function(_0x3cf211){try{if(this[_0xab49('0x60')](_0x3cf211)&&this['isNotNull'](_0x3cf211[_0xab49('0x68')])){logger[_0xab49('0x46')](_0xab49('0x69'),util[_0xab49('0x3a')](_0x3cf211,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x3cf211['queue']]){logger[_0xab49('0x6a')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3cf211[_0xab49('0x68')]);var _0x139705=_[_0xab49('0x6b')](this[_0xab49('0x10')],_0xab49('0x68'))[_0x3cf211[_0xab49('0x68')]]||0x0;var _0x1ba368=_0x139705-_0x3cf211[_0xab49('0x6c')];if(this['voiceQueues'][_0x3cf211[_0xab49('0x68')]][_0xab49('0x58')]!==_[_0xab49('0x6d')](_0x3cf211[_0xab49('0x6c')])||this[_0xab49('0x12')][_0x3cf211['queue']][_0xab49('0x51')]!==_[_0xab49('0x6d')](_0x3cf211[_0xab49('0x6e')])||this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]][_0xab49('0x50')]!==_[_0xab49('0x6d')](_0x3cf211[_0xab49('0x50')])||this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]][_0xab49('0x30')]!==_0x1ba368){this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]]['waiting']=_[_0xab49('0x6d')](_0x3cf211[_0xab49('0x6c')]);this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]][_0xab49('0x51')]=_[_0xab49('0x6d')](_0x3cf211[_0xab49('0x6e')]);this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]][_0xab49('0x50')]=_['toNumber'](_0x3cf211[_0xab49('0x50')]);this[_0xab49('0x12')][_0x3cf211['queue']][_0xab49('0x30')]=_0x1ba368>0x0?_0x1ba368:0x0;this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]]['talking']=this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]]['talking']>_['toNumber'](_0x3cf211[_0xab49('0x6e')])?_[_0xab49('0x6d')](_0x3cf211[_0xab49('0x6e')]):this['voiceQueues'][_0x3cf211['queue']][_0xab49('0x30')];this[_0xab49('0x4c')](this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]],_0xab49('0x16'));}logger[_0xab49('0x46')](_0xab49('0x6f'),util[_0xab49('0x3a')](this['voiceQueues'][_0x3cf211['queue']],{'showHidden':![],'depth':null}));ami[_0xab49('0x3f')](_0xab49('0x70'),this[_0xab49('0x12')][_0x3cf211[_0xab49('0x68')]]);}}}catch(_0x7b5fa1){logger[_0xab49('0x38')](_0xab49('0x67'),util[_0xab49('0x3a')](_0x7b5fa1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x1a')]=function(_0x47d36d){logger[_0xab49('0x46')](_0xab49('0x71'),util[_0xab49('0x3a')](_0x47d36d,{'showHidden':![],'depth':null}));this[_0xab49('0x13')]=!![];};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x1b')]=function(_0x394bb6){try{if(this[_0xab49('0x60')](_0x394bb6)){logger['debug'](_0xab49('0x72'),_0x394bb6['uniqueid'],util[_0xab49('0x3a')](_0x394bb6,{'showHidden':![],'depth':null}));if(_[_0xab49('0x61')](this[_0xab49('0xe')][_0x394bb6['uniqueid']]))this[_0xab49('0xe')][_0x394bb6[_0xab49('0x42')]]=[];if(_['isUndefined'](this[_0xab49('0x10')][_0x394bb6[_0xab49('0x42')]]))this[_0xab49('0x10')][_0x394bb6[_0xab49('0x42')]]={};var _0x4702c1=new QueueReport();_0x4702c1[_0xab49('0x4e')]=_0x394bb6[_0xab49('0x68')];_0x4702c1[_0xab49('0x4d')]=this[_0xab49('0x12')][_0x4702c1[_0xab49('0x4e')]]&&this[_0xab49('0x12')][_0x4702c1[_0xab49('0x4e')]][_0xab49('0x4d')]?this['voiceQueues'][_0x4702c1[_0xab49('0x4e')]][_0xab49('0x4d')]||_0xab49('0x73'):'inbound';_0x4702c1[_0xab49('0x68')]=_0x394bb6[_0xab49('0x68')];_0x4702c1['queuecallerjoinAt']=moment()[_0xab49('0x43')](_0xab49('0x74'));_0x4702c1['position']=_0x394bb6[_0xab49('0x75')];_0x4702c1[_0xab49('0x76')]=_0x394bb6[_0xab49('0x76')];_0x4702c1[_0xab49('0x42')]=_0x394bb6[_0xab49('0x42')];_0x4702c1[_0xab49('0x77')]=this[_0xab49('0x10')][_0x394bb6[_0xab49('0x42')]]['routealias'];logger['info'](_0xab49('0x78'),_0x4702c1[_0xab49('0x4e')],_0x4702c1[_0xab49('0x4d')]);_[_0xab49('0x79')](_0x4702c1,_[_0xab49('0x7a')](_0x394bb6,_[_0xab49('0x7b')](_0x4702c1)));this[_0xab49('0xe')][_0x394bb6[_0xab49('0x42')]]['push'](_0x4702c1);this[_0xab49('0x10')][_0x394bb6['uniqueid']]=_0x4702c1;this[_0xab49('0x40')](_0x4702c1,_0xab49('0x7c'));}}catch(_0x32b405){logger[_0xab49('0x38')](_0xab49('0x72'),_0x394bb6[_0xab49('0x42')],util[_0xab49('0x3a')](_0x32b405,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0x1d')]=function(_0x40e622){try{if(this[_0xab49('0x60')](_0x40e622)){logger[_0xab49('0x46')](_0xab49('0x7d'),_0x40e622[_0xab49('0x42')],util[_0xab49('0x3a')](_0x40e622,{'showHidden':![],'depth':null}));if(this[_0xab49('0xe')][_0x40e622['uniqueid']]){var _0x4a67e4=_[_0xab49('0x7e')](this[_0xab49('0xe')][_0x40e622[_0xab49('0x42')]]);_0x4a67e4[_0xab49('0x7f')]=![];_0x4a67e4[_0xab49('0x80')]=null;_0x4a67e4[_0xab49('0x81')]=_0x40e622['holdtime'];_0x4a67e4[_0xab49('0x82')]=_0x40e622['originalposition'];_0x4a67e4['queuecallerabandon']=!![];_0x4a67e4[_0xab49('0x83')]=moment()['format'](_0xab49('0x74'));_0x4a67e4[_0xab49('0x84')]='ABANDONED';_0x4a67e4[_0xab49('0x85')]=null;logger[_0xab49('0x6a')](_0xab49('0x86'),_0x4a67e4['name'],_0x4a67e4['type']);this[_0xab49('0x10')][_0x40e622[_0xab49('0x42')]]=_0x4a67e4;this[_0xab49('0x45')](_0x4a67e4,_0xab49('0x1c'));}}}catch(_0x2c1125){logger[_0xab49('0x38')]('[%s][voiceQueueReport][queuecallerabandon]',_0x40e622[_0xab49('0x42')],util['inspect'](_0x2c1125,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')]['syncQueueCallerLeave']=function(_0xf69bf9){try{if(this[_0xab49('0x60')](_0xf69bf9)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0xf69bf9[_0xab49('0x42')],util[_0xab49('0x3a')](_0xf69bf9,{'showHidden':![],'depth':null}));if(this[_0xab49('0xe')][_0xf69bf9[_0xab49('0x42')]]){var _0x2967d9=_[_0xab49('0x7e')](this[_0xab49('0xe')][_0xf69bf9['uniqueid']]);_0x2967d9['queuecallerleaveAt']=moment()[_0xab49('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x2967d9['connectedlinenum']=_0xf69bf9[_0xab49('0x87')];_0x2967d9[_0xab49('0x88')]=_0xf69bf9[_0xab49('0x88')];logger[_0xab49('0x6a')](_0xab49('0x89'),_0x2967d9['name'],_0x2967d9[_0xab49('0x4d')],_0xf69bf9[_0xab49('0x87')],_0xf69bf9[_0xab49('0x88')]);this[_0xab49('0x10')][_0xf69bf9[_0xab49('0x42')]]=_0x2967d9;this[_0xab49('0x40')](_0x2967d9,_0xab49('0x8a'));}}}catch(_0x285e38){logger['error'](_0xab49('0x8b'),_0xf69bf9[_0xab49('0x42')],util['inspect'](_0x285e38,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x44b056){try{if(this[_0xab49('0x60')](_0x44b056)){logger[_0xab49('0x46')](_0xab49('0x8c'),_0x44b056[_0xab49('0x42')],util[_0xab49('0x3a')](_0x44b056,{'showHidden':![],'depth':null}));if(this[_0xab49('0xe')][_0x44b056['uniqueid']]){var _0x25434c=_[_0xab49('0x7e')](this[_0xab49('0xe')][_0x44b056[_0xab49('0x42')]]);_0x25434c[_0xab49('0x7f')]=!![];_0x25434c['queuecallerexitreason']=_0xab49('0x8d');logger[_0xab49('0x6a')](_0xab49('0x8e'),_0x25434c[_0xab49('0x4e')],_0x25434c['type']);}}}catch(_0x4745d4){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x44b056[_0xab49('0x42')],util[_0xab49('0x3a')](_0x4745d4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')]['syncAgentComplete']=function(_0x2fa485){try{if(this[_0xab49('0x60')](_0x2fa485)){logger[_0xab49('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x2fa485['uniqueid'],util[_0xab49('0x3a')](_0x2fa485,{'showHidden':![],'depth':null}));if(this[_0xab49('0xe')][_0x2fa485['uniqueid']]){var _0x151935=_[_0xab49('0x7e')](this['queueReports'][_0x2fa485[_0xab49('0x42')]]);_0x151935['queuecallerabandon']=![];_0x151935['queuecallerabandonAt']=null;_0x151935[_0xab49('0x8f')]=!![];_0x151935[_0xab49('0x85')]=_0x2fa485['membername'];_0x151935[_0xab49('0x81')]=_0x2fa485[_0xab49('0x81')];_0x151935[_0xab49('0x7f')]=!![];_0x151935[_0xab49('0x90')]=![];_0x151935[_0xab49('0x91')]=null;if(!_0x151935[_0xab49('0x92')]){if(_0x2fa485[_0xab49('0x93')]==_0xab49('0x92')){_0x151935[_0xab49('0x84')]=_0xab49('0x94');logger['info'](_0xab49('0x95'),_0x151935[_0xab49('0x4e')],_0x151935[_0xab49('0x4d')]);}else{if(_['startsWith'](_0x2fa485[_0xab49('0x96')][_0xab49('0x97')](),_0xab49('0x98'))){if(this['queueReports'][_0x2fa485[_0xab49('0x99')]]){var _0x5d6529=_['last'](this[_0xab49('0xe')][_0x2fa485['linkedid']]);_0x5d6529[_0xab49('0x7f')]=![];_0x5d6529[_0xab49('0x90')]=!![];_0x5d6529[_0xab49('0x91')]=moment(_0x151935['queuecallerjoinAt'])[_0xab49('0x9a')](_0x2fa485[_0xab49('0x81')],_0xab49('0x9b'))[_0xab49('0x43')](_0xab49('0x74'));_0x5d6529[_0xab49('0x84')]=_0xab49('0x9c');_0x5d6529[_0xab49('0x92')]=!![];_0x5d6529[_0xab49('0x9d')]=_0xab49('0x9e');_0x5d6529[_0xab49('0x9f')]=_0x2fa485[_0xab49('0xa0')];_0x5d6529['transferuniqueid']=_0x2fa485[_0xab49('0x42')];logger[_0xab49('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x5d6529['name'],_0x5d6529[_0xab49('0x4d')]);var _0x3b6e3d=this[_0xab49('0xe')][_0x2fa485[_0xab49('0x99')]];this[_0xab49('0xe')][_0x2fa485['linkedid']]=this[_0xab49('0xe')][_0x2fa485['uniqueid']];this['queueReports'][_0x2fa485[_0xab49('0x42')]]=_0x3b6e3d;}}else{_0x151935[_0xab49('0x84')]=_0xab49('0xa1')+_0x2fa485[_0xab49('0x93')][_0xab49('0xa2')]();logger[_0xab49('0x6a')](_0xab49('0xa3'),_0x151935[_0xab49('0x4e')],_0x151935[_0xab49('0x4d')],_0x151935[_0xab49('0x84')]);}}}this['channels'][_0x2fa485['uniqueid']]=_0x151935;this[_0xab49('0x45')](_0x151935,_0xab49('0x1f'));}}}catch(_0x35fb7a){logger['error'](_0xab49('0xa4'),_0x2fa485[_0xab49('0x42')],util[_0xab49('0x3a')](_0x35fb7a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0xa5')]=function(_0x16bb4b){try{if(this[_0xab49('0x60')](_0x16bb4b)){logger[_0xab49('0x46')]('[%s][voiceQueueReport][varset]',_0x16bb4b['uniqueid'],util[_0xab49('0x3a')](_0x16bb4b,{'showHidden':![],'depth':null}));this['addVariable'](_0x16bb4b[_0xab49('0x42')],_['keys'](_0x16bb4b[_0xab49('0xa6')])[0x0],_0x16bb4b[_0xab49('0xa7')]);if(this[_0xab49('0xe')][_0x16bb4b['uniqueid']]){var _0x57b455=_[_0xab49('0x7e')](this[_0xab49('0xe')][_0x16bb4b[_0xab49('0x42')]]);if(_0x57b455){if(this[_0xab49('0x60')](_0x16bb4b[_0xab49('0xa6')])&&this['isNotNull'](_0x16bb4b[_0xab49('0xa6')][_0xab49('0xa8')])){switch(_0x16bb4b[_0xab49('0xa7')]){case _0xab49('0xa9'):_0x57b455[_0xab49('0x90')]=![];_0x57b455['queuecallerexitAt']=null;break;case _0xab49('0xaa'):_0x57b455[_0xab49('0xab')]=_0xab49('0xac');_0x57b455[_0xab49('0x90')]=!![];_0x57b455[_0xab49('0x91')]=moment()[_0xab49('0x43')](_0xab49('0x74'));_0x57b455[_0xab49('0xad')]=moment()[_0xab49('0x43')](_0xab49('0x74'));logger[_0xab49('0x46')](_0xab49('0xae'),_0x16bb4b[_0xab49('0x42')],util[_0xab49('0x3a')](_0x57b455,{'showHidden':![],'depth':null}));ami[_0xab49('0x3f')](_0xab49('0xaf'),_0x57b455);break;default:_0x57b455[_0xab49('0x90')]=!![];_0x57b455['queuecallerexitAt']=moment()[_0xab49('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x57b455['queuecallerleaveAt']=moment()[_0xab49('0x43')](_0xab49('0x74'));}_0x57b455['queuecallerabandon']=![];_0x57b455[_0xab49('0x83')]=null;_0x57b455['queuecallerexitreason']=_0x16bb4b[_0xab49('0xa7')];this[_0xab49('0x10')][_0x16bb4b[_0xab49('0x42')]]=_0x57b455;this[_0xab49('0x45')](_0x57b455,'varset');}else if(this[_0xab49('0x60')](_0x16bb4b[_0xab49('0xa6')])&&this[_0xab49('0x60')](_0x16bb4b[_0xab49('0xa6')][_0xab49('0xb0')])){if(!_0x57b455['queuecallerabandon']){_0x57b455['queuecallerexit']=!![];_0x57b455[_0xab49('0x91')]=moment()[_0xab49('0x43')](_0xab49('0x74'));_0x57b455[_0xab49('0x84')]=_0xab49('0xb1');_0x57b455[_0xab49('0xad')]=moment()[_0xab49('0x43')](_0xab49('0x74'));this[_0xab49('0x10')][_0x16bb4b['uniqueid']]=_0x57b455;}}logger[_0xab49('0x6a')](_0xab49('0xb2'),_0x16bb4b[_0xab49('0x42')],_0x57b455[_0xab49('0x4e')],_0x57b455['type'],_[_0xab49('0x7b')](_0x16bb4b[_0xab49('0xa6')])[0x0],_0x16bb4b[_0xab49('0xa7')]);_0x57b455[_0xab49('0x15')]=this[_0xab49('0x15')][_0x16bb4b[_0xab49('0x42')]];}}}}catch(_0x4a8946){logger[_0xab49('0x38')](_0xab49('0xb3'),_0x16bb4b[_0xab49('0x42')],util[_0xab49('0x3a')](_0x4a8946,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0xb4')]=function(_0x2e2248,_0x25fedc,_0xb39f79){var _0x134d14=[_0xab49('0xb5'),_0xab49('0xb6'),_0xab49('0xb7'),_0xab49('0xb8'),_0xab49('0xb9'),_0xab49('0xba'),_0xab49('0xbb'),_0xab49('0xbc'),'sipcallid',_0xab49('0xbd'),'bridgepeer',_0xab49('0xbe'),_0xab49('0xbf'),_0xab49('0xc0'),'memberinterface',_0xab49('0xc1'),_0xab49('0xc2'),_0xab49('0xc3'),_0xab49('0xc4')];if(!_['isNil'](_0x25fedc)&&!_['includes'](_0x134d14,_0x25fedc)){if(_[_0xab49('0x61')](this[_0xab49('0x15')][_0x2e2248])){this[_0xab49('0x15')][_0x2e2248]={};}this[_0xab49('0x15')][_0x2e2248][_0x25fedc]=_0xb39f79;}};VoiceQueueReport['prototype'][_0xab49('0x24')]=function(_0x1c97a1){try{if(this[_0xab49('0x60')](_0x1c97a1)){logger[_0xab49('0x46')](_0xab49('0xc5'),_0x1c97a1[_0xab49('0x42')],util[_0xab49('0x3a')](_0x1c97a1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1c97a1[_0xab49('0x42')]]){for(var _0x841d11=0x0,_0x289959={};_0x841d11<this[_0xab49('0xe')][_0x1c97a1[_0xab49('0x42')]][_0xab49('0xc6')];_0x841d11+=0x1){_0x289959=this[_0xab49('0xe')][_0x1c97a1[_0xab49('0x42')]][_0x841d11];if(this[_0xab49('0x12')][_0x289959[_0xab49('0x68')]]){if(_0x289959[_0xab49('0x90')]&&_0x289959[_0xab49('0x92')]!=!![]){this[_0xab49('0x12')][_0x289959[_0xab49('0x68')]][_0xab49('0x56')]+=0x1;}if(_0x289959[_0xab49('0x1c')]){this[_0xab49('0x12')][_0x289959[_0xab49('0x68')]][_0xab49('0x57')]+=0x1;}this[_0xab49('0x12')][_0x289959[_0xab49('0x68')]][_0xab49('0x54')]+=moment(_0x289959[_0xab49('0xad')])[_0xab49('0xc7')](_0x289959[_0xab49('0xc8')],_0xab49('0x9b'))||0x0;if(_0x841d11===this['queueReports'][_0x1c97a1[_0xab49('0x42')]][_0xab49('0xc6')]-0x1){this['voiceQueues'][_0x289959['queue']]['sumDuration']+=moment()[_0xab49('0xc9')](0x0)[_0xab49('0xc7')](_0x289959[_0xab49('0xc8')],'seconds');this[_0xab49('0x12')][_0x289959[_0xab49('0x68')]][_0xab49('0x55')]+=0x1;if(_0x289959[_0xab49('0x7f')]){this[_0xab49('0x12')][_0x289959[_0xab49('0x68')]][_0xab49('0xca')]+=0x1;this[_0xab49('0x12')][_0x289959['queue']][_0xab49('0x52')]+=moment()[_0xab49('0xc9')](0x0)[_0xab49('0xc7')](_0x289959[_0xab49('0xad')],_0xab49('0x9b'));_0x289959['queuecallercompleteAt']=moment()[_0xab49('0x43')](_0xab49('0x74'));_0x289959['queuecallerexit']=![];_0x289959[_0xab49('0x91')]=null;}if(_0x289959[_0xab49('0x90')]&&_0x289959[_0xab49('0x92')]!=!![]){_0x289959['lastevent']=_0xab49('0x56');logger[_0xab49('0x46')](_0xab49('0xcb'),_0x1c97a1[_0xab49('0x42')],util[_0xab49('0x3a')](_0x289959,{'showHidden':![],'depth':null}));ami['emit'](_0xab49('0xcc'),_0x289959);}if(_0x289959['queuecallerabandon']){_0x289959[_0xab49('0xab')]=_0xab49('0x57');logger[_0xab49('0x46')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x1c97a1[_0xab49('0x42')],util[_0xab49('0x3a')](_0x289959,{'showHidden':![],'depth':null}));ami[_0xab49('0x3f')](_0xab49('0xcd'),_0x289959);}}else{this[_0xab49('0x12')][_0x289959['queue']][_0xab49('0x53')]+=this['voiceQueues'][_0x289959['queue']]['sumHoldTime'];}logger[_0xab49('0x6a')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x1c97a1['uniqueid'],_0x289959['name'],_0x289959[_0xab49('0x4d')],_0x1c97a1['cause-txt']);this['channels'][_0x1c97a1['uniqueid']]=_0x289959;this[_0xab49('0x45')](_0x289959,_0xab49('0x23'));this['emitVoiceQueueSummary'](this[_0xab49('0x12')][_0x289959['queue']],_0xab49('0x23'));}}logger['debug'](_0xab49('0xce'),_0x1c97a1[_0xab49('0x42')],util['inspect'](this[_0xab49('0xe')][_0x1c97a1[_0xab49('0x42')]],{'showHidden':![],'depth':null}));ami[_0xab49('0x3f')](_0xab49('0xcf'),this[_0xab49('0xe')][_0x1c97a1[_0xab49('0x42')]]);delete this[_0xab49('0xe')][_0x1c97a1[_0xab49('0x42')]];delete this[_0xab49('0x10')][_0x1c97a1[_0xab49('0x42')]];}if(this[_0xab49('0x15')][_0x1c97a1[_0xab49('0x42')]]){delete this[_0xab49('0x15')][_0x1c97a1[_0xab49('0x42')]];}}}catch(_0x1db3a5){logger[_0xab49('0x38')](_0xab49('0xc5'),_0x1c97a1['uniqueid'],util['inspect'](_0x1db3a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')]['syncAttendedTransfer']=function(_0x5945d8){try{if(this[_0xab49('0x60')](_0x5945d8)){logger[_0xab49('0x46')](_0xab49('0xd0'),_0x5945d8[_0xab49('0x42')],util[_0xab49('0x3a')](_0x5945d8,{'showHidden':![],'depth':null}));var _0x1542a8;if(this[_0xab49('0xe')][_0x5945d8['transfereeuniqueid']]){_0x1542a8=_['last'](this['queueReports'][_0x5945d8[_0xab49('0xd1')]]);_0x1542a8[_0xab49('0x9f')]=_0x5945d8[_0xab49('0xd2')];_0x1542a8[_0xab49('0xd3')]=_0x5945d8[_0xab49('0xd4')];_0x1542a8['queuecallerexitreason']=_0xab49('0xd5');_0x1542a8['transfer']=!![];_0x1542a8[_0xab49('0x9d')]=_0xab49('0xd6');if(this[_0xab49('0xe')][_0x5945d8[_0xab49('0xd4')]]){var _0x51e8a1=this[_0xab49('0xe')][_0x5945d8['secondtransfereruniqueid']];this[_0xab49('0xe')][_0x5945d8[_0xab49('0xd4')]]=this[_0xab49('0xe')][_0x5945d8[_0xab49('0xd1')]];this[_0xab49('0xe')][_0x5945d8[_0xab49('0xd1')]]=_0x51e8a1;var _0x558f23=_['last'](this[_0xab49('0xe')][_0x5945d8[_0xab49('0xd1')]]);_0x558f23[_0xab49('0xd7')]=!![];}logger['info'](_0xab49('0xd8'),_0x5945d8[_0xab49('0x42')],_0x1542a8['name'],_0x1542a8[_0xab49('0x4d')],_0x1542a8['transferexten'],_0x1542a8[_0xab49('0xd3')]);}else if(this[_0xab49('0xe')][_0x5945d8[_0xab49('0xd9')]]){_0x1542a8=_[_0xab49('0x7e')](this[_0xab49('0xe')][_0x5945d8[_0xab49('0xd9')]]);_0x1542a8[_0xab49('0x9f')]=_0x5945d8['origtransfererexten'];_0x1542a8[_0xab49('0xd3')]=_0x5945d8['origtransfereruniqueid'];_0x1542a8[_0xab49('0x84')]=_0xab49('0xd5');_0x1542a8[_0xab49('0x92')]=!![];_0x1542a8[_0xab49('0x9d')]='ATTENDED';if(this['queueReports'][_0x5945d8[_0xab49('0xda')]]){var _0x51e8a1=this[_0xab49('0xe')][_0x5945d8[_0xab49('0xda')]];this['queueReports'][_0x5945d8[_0xab49('0xda')]]=this['queueReports'][_0x5945d8[_0xab49('0xd9')]];this[_0xab49('0xe')][_0x5945d8[_0xab49('0xd9')]]=_0x51e8a1;var _0x558f23=_['last'](this['queueReports'][_0x5945d8[_0xab49('0xd9')]]);_0x558f23[_0xab49('0xd7')]=!![];}logger[_0xab49('0x6a')](_0xab49('0xd8'),_0x5945d8[_0xab49('0x42')],_0x1542a8[_0xab49('0x4e')],_0x1542a8[_0xab49('0x4d')],_0x1542a8[_0xab49('0x9f')],_0x1542a8['transferuniqueid']);}}}catch(_0x1cc022){logger[_0xab49('0x38')](_0xab49('0xd0'),_0x5945d8[_0xab49('0x42')],util[_0xab49('0x3a')](_0x1cc022,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0xdb')]=function(_0x1cef25){try{if(this[_0xab49('0x60')](_0x1cef25)){logger[_0xab49('0x46')](_0xab49('0xdc'),_0x1cef25[_0xab49('0x42')],util[_0xab49('0x3a')](_0x1cef25,{'showHidden':![],'depth':null}));if(this[_0xab49('0xe')][_0x1cef25['transfereeuniqueid']]){var _0x36b47e=_[_0xab49('0x7e')](this[_0xab49('0xe')][_0x1cef25[_0xab49('0xd1')]]);_0x36b47e[_0xab49('0x84')]=_0xab49('0xdd');_0x36b47e[_0xab49('0x92')]=!![];_0x36b47e['transfertype']=_0xab49('0xde');_0x36b47e[_0xab49('0x9f')]=_0x1cef25[_0xab49('0xdf')];_0x36b47e[_0xab49('0xd3')]=_0x1cef25[_0xab49('0xd1')];logger['info'](_0xab49('0xe0'),_0x1cef25['uniqueid'],_0x36b47e['name'],_0x36b47e[_0xab49('0x4d')],_0x36b47e[_0xab49('0x9f')],_0x36b47e['transferuniqueid']);this[_0xab49('0x24')]({'event':_0xab49('0xe1'),'uniqueid':_0x1cef25[_0xab49('0xd1')],'context':_0x1cef25[_0xab49('0xe2')],'channel':_0x1cef25[_0xab49('0xe3')]});}}}catch(_0x42bc65){logger[_0xab49('0x38')](_0xab49('0xdc'),_0x1cef25[_0xab49('0x42')],util['inspect'](_0x42bc65,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')][_0xab49('0xe4')]=function(_0x4437b3){try{if(this[_0xab49('0x60')](_0x4437b3)){logger['debug'](_0xab49('0xe5'),_0x4437b3[_0xab49('0x42')],util[_0xab49('0x3a')](_0x4437b3,{'showHidden':![],'depth':null}));if(this[_0xab49('0xe')][_0x4437b3['uniqueid']]){var _0x58d013=_[_0xab49('0x7e')](this[_0xab49('0xe')][_0x4437b3[_0xab49('0x42')]]);if(!_[_0xab49('0x35')](_0x58d013[_0xab49('0xad')])){_0x58d013['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xab49('0x6a')](_0xab49('0xe6'),_0x4437b3[_0xab49('0x42')],_0x58d013[_0xab49('0xe7')]);}}}}catch(_0x57324d){logger[_0xab49('0x38')](_0xab49('0xe5'),_0x4437b3[_0xab49('0x42')],util[_0xab49('0x3a')](_0x57324d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xab49('0xb')]['syncMusicOnHoldStop']=function(_0xe5786e){try{if(this[_0xab49('0x60')](_0xe5786e)){logger['debug'](_0xab49('0xe8'),_0xe5786e['uniqueid'],util[_0xab49('0x3a')](_0xe5786e,{'showHidden':![],'depth':null}));if(this[_0xab49('0xe')][_0xe5786e[_0xab49('0x42')]]){var _0x543b1d=_['last'](this[_0xab49('0xe')][_0xe5786e[_0xab49('0x42')]]);if(!_[_0xab49('0x35')](_0x543b1d[_0xab49('0xe7')])){_0x543b1d[_0xab49('0xe9')]+=moment()[_0xab49('0xc9')](0x0)[_0xab49('0xc7')](_0x543b1d[_0xab49('0xe7')],_0xab49('0x9b'));logger[_0xab49('0x6a')](_0xab49('0xea'),_0xe5786e[_0xab49('0x42')],_0x543b1d['mohtime']);delete _0x543b1d[_0xab49('0xe7')];}}}}catch(_0x14ab52){logger[_0xab49('0x38')](_0xab49('0xe8'),_0xe5786e[_0xab49('0x42')],util[_0xab49('0x3a')](_0x14ab52,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xab49('0xeb')]=function(_0x2cf1dd){try{if(this['isNotNull'](_0x2cf1dd)){logger[_0xab49('0x46')]('[%s][voiceQueueReport][newexten]\x20event:',_0x2cf1dd[_0xab49('0x42')],util[_0xab49('0x3a')](_0x2cf1dd,{'showHidden':![],'depth':null}));if(_0x2cf1dd['application'][_0xab49('0x97')]()===_0xab49('0xec')){_0x2cf1dd[_0xab49('0xed')]=_0x2cf1dd[_0xab49('0xee')]&&_0x2cf1dd['appdata'][_0xab49('0xef')]('CDR(routeAlias)')?_0x2cf1dd[_0xab49('0xee')]:(_0x2cf1dd['appdata']||_0x2cf1dd[_0xab49('0xed')])[_0xab49('0x97')]();if(_[_0xab49('0xef')](_0x2cf1dd['applicationdata']['toLowerCase'](),_0xab49('0xf0'))){logger[_0xab49('0x6a')](_0xab49('0xf1'),_0x2cf1dd[_0xab49('0x42')],_0x2cf1dd['application'],_0x2cf1dd['applicationdata']);if(_[_0xab49('0x61')](this['channels'][_0x2cf1dd['uniqueid']]))this[_0xab49('0x10')][_0x2cf1dd[_0xab49('0x42')]]={};var _0x3e6b35=_0x2cf1dd[_0xab49('0xed')]['split']('=');var _0x4d5add=_0x3e6b35[0x0]['toLowerCase']()[_0xab49('0xf2')](/cdr\((.*)\)/);if(_0x4d5add)this[_0xab49('0x10')][_0x2cf1dd[_0xab49('0x42')]][_0x4d5add[0x1]]=_0x3e6b35[0x1];}}}}catch(_0x34ade4){logger['error']('[%s][voiceQueueReport][newexten]',_0x2cf1dd['uniqueid'],util[_0xab49('0x3a')](_0x34ade4,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0xaa88=['toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','length','sumHoldTime','sumDuration','milliseconds','diff','seconds','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transferuniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','transfertype','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','appdata','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','localhost','prototype','enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','varset','hangup','syncHangup','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','waiting','unlockRR','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_presence:remove','emitVoiceQueueSummary','type','strategy','answered','available','loggedIn','pTalking','sumBillable','talking','total','unmanaged','abandoned','Trunk','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','info','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[%s][voiceQueueReport][queuecallerjoin]','inbound','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','syncAgentComplete','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','queuecallerexitAt','queuecallerjoinAt','add','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0xaa88,0x137));var _0x8aa8=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xaa88[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x8aa8('0x0'));var moment=require(_0x8aa8('0x1'));var util=require(_0x8aa8('0x2'));var md5=require(_0x8aa8('0x3'));var Redis=require('ioredis');var config=require(_0x8aa8('0x4'));var logger=require(_0x8aa8('0x5'))(_0x8aa8('0x6'));var ami=require(_0x8aa8('0x7'));var QueueReport=require(_0x8aa8('0x8'));config[_0x8aa8('0x9')]=_['defaults'](config['redis'],{'host':_0x8aa8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8aa8('0x9')]));var Sequence=function(){};Sequence[_0x8aa8('0xb')][_0x8aa8('0xc')]=function(_0x40826f){this['tail']=this[_0x8aa8('0xd')]?this[_0x8aa8('0xd')][_0x8aa8('0xe')](_0x40826f):_0x40826f();};function VoiceQueueReport(_0x5c94d4){this[_0x8aa8('0xf')]=new Sequence();this[_0x8aa8('0x10')]={};this[_0x8aa8('0x11')]=_0x5c94d4[_0x8aa8('0x11')];this['channels']=_0x5c94d4[_0x8aa8('0x12')];this[_0x8aa8('0x13')]=_0x5c94d4['voiceQueues'];this[_0x8aa8('0x14')]=!![];this[_0x8aa8('0x15')]=_0x5c94d4[_0x8aa8('0x15')];this['variables']={};ami['on'](_0x8aa8('0x16'),this[_0x8aa8('0x17')][_0x8aa8('0x18')](this));ami['on']('queuesummarycomplete',this[_0x8aa8('0x19')]['bind'](this));ami['on']('queuecallerjoin',this[_0x8aa8('0x1a')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x1b'),this[_0x8aa8('0x1c')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x1d'),this[_0x8aa8('0x1e')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x1f'),this['syncAgentComplete']['bind'](this));ami['on'](_0x8aa8('0x20'),this['syncAgentConnect']['bind'](this));ami['on'](_0x8aa8('0x21'),this['syncVarSet'][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x22'),this[_0x8aa8('0x23')][_0x8aa8('0x18')](this));ami['on']('fullybooted',this[_0x8aa8('0x24')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x25'),this[_0x8aa8('0x26')][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x27'),this['syncMusicOnHoldStart'][_0x8aa8('0x18')](this));ami['on']('musiconholdstop',this[_0x8aa8('0x28')]['bind'](this));ami['on'](_0x8aa8('0x29'),this['syncAttendedTransfer'][_0x8aa8('0x18')](this));ami['on'](_0x8aa8('0x2a'),this[_0x8aa8('0x2b')]['bind'](this));this[_0x8aa8('0x2c')]();this[_0x8aa8('0x2d')]();}function clearChannels(_0x15b235){if(!_['isEmpty'](_0x15b235)){for(var _0x57acd2 in _0x15b235){if(_0x15b235[_0x8aa8('0x2e')](_0x57acd2)){delete _0x15b235[_0x57acd2];}}}}function clearCampaigns(_0x44e2d8){if(!_[_0x8aa8('0x2f')](_0x44e2d8)){for(var _0x3a3c7a in _0x44e2d8){if(_0x44e2d8[_0x8aa8('0x2e')](_0x3a3c7a)){_0x44e2d8[_0x3a3c7a]['originated']=0x0;}}}}function clearVoiceQueues(_0x2bc34a){if(!_['isEmpty'](_0x2bc34a)){for(var _0x2a0ff2 in _0x2bc34a){if(_0x2bc34a[_0x8aa8('0x2e')](_0x2a0ff2)){_0x2bc34a[_0x2a0ff2][_0x8aa8('0x30')]=0x0;_0x2bc34a[_0x2a0ff2]['talking']=0x0;_0x2bc34a[_0x2a0ff2]['pTalking']=0x0;_0x2bc34a[_0x2a0ff2][_0x8aa8('0x31')]=0x0;_0x2bc34a[_0x2a0ff2]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x385208){if(!_[_0x8aa8('0x2f')](_0x385208)){for(var _0x39e892 in _0x385208){if(_0x385208[_0x8aa8('0x2e')](_0x39e892)){_0x385208[_0x39e892][_0x8aa8('0x32')]=!![];}}}}VoiceQueueReport['prototype'][_0x8aa8('0x33')]=function(){var _0x3003e5=this;for(var _0x4b67f5 in this[_0x8aa8('0x34')]){if(this[_0x8aa8('0x34')][_0x8aa8('0x2e')](_0x4b67f5)&&!this['channels'][_0x4b67f5][_0x8aa8('0x35')]){this[_0x8aa8('0xf')][_0x8aa8('0xc')](function(){if(!_[_0x8aa8('0x36')](_0x3003e5[_0x8aa8('0x34')][_0x4b67f5])){return ami[_0x8aa8('0x37')]({'action':_0x8aa8('0x38'),'channel':_0x3003e5[_0x8aa8('0x34')][_0x4b67f5][_0x8aa8('0x39')]})[_0x8aa8('0x3a')](function(_0x3e069a){if(_0x3e069a['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x3003e5[_0x8aa8('0x34')][_0x4b67f5]){delete _0x3003e5[_0x8aa8('0x34')][_0x4b67f5];logger[_0x8aa8('0x3b')](_0x8aa8('0x3c'),_0x4b67f5,util[_0x8aa8('0x3d')](_0x3e069a,{'showHidden':![],'depth':null}));}if(_0x3003e5[_0x8aa8('0x10')][_0x4b67f5]){delete _0x3003e5['queueReports'][_0x4b67f5];logger['error'](_0x8aa8('0x3e'),_0x4b67f5,util['inspect'](_0x3e069a,{'showHidden':![],'depth':null}));}if(_0x3003e5[_0x8aa8('0x3f')][_0x4b67f5]){delete _0x3003e5[_0x8aa8('0x3f')][_0x4b67f5];logger[_0x8aa8('0x3b')]('[%s][voiceQueueReport][checkVariables]',_0x4b67f5,util[_0x8aa8('0x3d')](_0x3e069a,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x24')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x8aa8('0x34')]);this[_0x8aa8('0x40')](this['queueReports']);clearAgentBooked(this[_0x8aa8('0x11')]);clearVoiceQueues(this[_0x8aa8('0x13')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x8aa8('0xb')]['clearQueueReport']=function(_0x530a66){var _0x2f8f19=this;if(!_['isEmpty'](_0x530a66)){for(var _0x4161e5 in _0x530a66){if(_0x530a66[_0x8aa8('0x2e')](_0x4161e5)){_0x2f8f19[_0x8aa8('0x41')](_0x530a66[_0x4161e5],_0x8aa8('0x42'));delete _0x530a66[_0x4161e5];}}}};VoiceQueueReport['prototype'][_0x8aa8('0x43')]=function(_0x32abfc,_0x4962a4,_0x40867c){io['to'](_0x32abfc)[_0x8aa8('0x43')](_0x4962a4,_0x40867c);};VoiceQueueReport['prototype'][_0x8aa8('0x44')]=function(_0x3c6115,_0x103a74){logger[_0x8aa8('0x45')](_0x8aa8('0x46')+_0x103a74+_0x8aa8('0x47'),_0x3c6115[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x3c6115,{'showHidden':![],'depth':null}));this[_0x8aa8('0x43')](util[_0x8aa8('0x49')](_0x8aa8('0x4a'),_0x3c6115[_0x8aa8('0x4b')]),_0x8aa8('0x4c'),_0x3c6115);io[_0x8aa8('0x43')](_0x8aa8('0x4d'),_0x3c6115);};VoiceQueueReport[_0x8aa8('0xb')]['emitVoiceQueueChannelRemove']=function(_0x1aade0,_0x5cdba4){logger['debug']('[%s][voiceQueueReport]['+_0x5cdba4+_0x8aa8('0x4e'),_0x1aade0['uniqueid'],util['inspect'](_0x1aade0,{'showHidden':![],'depth':null}));this[_0x8aa8('0x43')](util['format'](_0x8aa8('0x4a'),_0x1aade0['name']),'voice_queue_channel:remove',_0x1aade0);io[_0x8aa8('0x43')](_0x8aa8('0x4f'),_0x1aade0);};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x50')]=function(_0x1f841f,_0x34f440){if(_0x1f841f[_0x8aa8('0x51')]==='inbound'){var _0x32289d={'id':_0x1f841f['id'],'name':_0x1f841f['name'],'strategy':_0x1f841f[_0x8aa8('0x52')],'answered':_0x1f841f[_0x8aa8('0x53')],'available':_0x1f841f[_0x8aa8('0x54')],'loggedIn':_0x1f841f[_0x8aa8('0x55')],'pTalking':_0x1f841f[_0x8aa8('0x56')],'sumBillable':_0x1f841f[_0x8aa8('0x57')],'sumDuration':_0x1f841f['sumDuration'],'sumHoldTime':_0x1f841f['sumHoldTime']||0x0,'talking':_0x1f841f[_0x8aa8('0x58')],'total':_0x1f841f[_0x8aa8('0x59')],'type':_0x1f841f['type'],'unmanaged':_0x1f841f[_0x8aa8('0x5a')],'abandoned':_0x1f841f[_0x8aa8('0x5b')],'waiting':_0x1f841f[_0x8aa8('0x31')]};if(_0x1f841f['Trunk']){_0x32289d['Trunk']={'id':_0x1f841f['Trunk']['id'],'name':_0x1f841f['Trunk'][_0x8aa8('0x4b')],'active':_0x1f841f[_0x8aa8('0x5c')]['active'],'callerid':_0x1f841f[_0x8aa8('0x5c')][_0x8aa8('0x5d')]};}if(_0x1f841f[_0x8aa8('0x5e')]){_0x32289d[_0x8aa8('0x5e')]={'id':_0x1f841f[_0x8aa8('0x5e')]['id'],'name':_0x1f841f[_0x8aa8('0x5e')]['name']};}var _0x4da826=md5(JSON[_0x8aa8('0x5f')](_0x32289d));if(_0x1f841f['md5']!==_0x4da826){_0x1f841f[_0x8aa8('0x3')]=_0x4da826;logger['debug'](_0x8aa8('0x60')+_0x34f440+_0x8aa8('0x61'),util[_0x8aa8('0x3d')](_0x32289d,{'showHidden':![],'depth':null}));this[_0x8aa8('0x43')](util[_0x8aa8('0x49')](_0x8aa8('0x4a'),_0x32289d[_0x8aa8('0x4b')]),_0x8aa8('0x62'),_0x32289d);}}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x63')]=function(_0x1b2eae){return _0x1b2eae!==null&&!_[_0x8aa8('0x64')](_0x1b2eae);};VoiceQueueReport['prototype'][_0x8aa8('0x2d')]=function(){var _0x548b6f=this;setInterval(function(){_0x548b6f['clearZombieChannels']();ami['Action']({'action':_0x8aa8('0x65')})['catch'](function(_0x1de402){logger[_0x8aa8('0x3b')](_0x8aa8('0x66'),util['inspect'](_0x1de402,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x2c')]=function(){var _0x23612a=this;setInterval(function(){if(_0x23612a[_0x8aa8('0x14')]){return ami['Action']({'action':'queuesummary'})[_0x8aa8('0x67')](function(_0x2e1940){_0x23612a[_0x8aa8('0x14')]=![];})[_0x8aa8('0x3a')](function(_0x4e7ea0){logger['error'](_0x8aa8('0x68'),util[_0x8aa8('0x3d')](_0x4e7ea0,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x8aa8('0xb')]['syncQueueSummary']=function(_0x33e9ae){try{if(this[_0x8aa8('0x63')](_0x33e9ae)&&this['isNotNull'](_0x33e9ae['queue'])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util[_0x8aa8('0x3d')](_0x33e9ae,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x33e9ae[_0x8aa8('0x69')]]){logger[_0x8aa8('0x6a')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x33e9ae['queue']);var _0x2725c5=_[_0x8aa8('0x6b')](this['channels'],'queue')[_0x33e9ae['queue']]||0x0;var _0x3d2076=_0x2725c5-_0x33e9ae[_0x8aa8('0x6c')];if(this['voiceQueues'][_0x33e9ae['queue']][_0x8aa8('0x31')]!==_[_0x8aa8('0x6d')](_0x33e9ae['callers'])||this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]]['loggedIn']!==_[_0x8aa8('0x6d')](_0x33e9ae['loggedin'])||this[_0x8aa8('0x13')][_0x33e9ae['queue']][_0x8aa8('0x54')]!==_[_0x8aa8('0x6d')](_0x33e9ae[_0x8aa8('0x54')])||this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]]['talking']!==_0x3d2076){this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]][_0x8aa8('0x31')]=_[_0x8aa8('0x6d')](_0x33e9ae['callers']);this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]]['loggedIn']=_[_0x8aa8('0x6d')](_0x33e9ae[_0x8aa8('0x6e')]);this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]][_0x8aa8('0x54')]=_[_0x8aa8('0x6d')](_0x33e9ae[_0x8aa8('0x54')]);this['voiceQueues'][_0x33e9ae['queue']]['talking']=_0x3d2076>0x0?_0x3d2076:0x0;this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]][_0x8aa8('0x58')]=this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]][_0x8aa8('0x58')]>_[_0x8aa8('0x6d')](_0x33e9ae[_0x8aa8('0x6e')])?_[_0x8aa8('0x6d')](_0x33e9ae[_0x8aa8('0x6e')]):this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]][_0x8aa8('0x58')];this[_0x8aa8('0x50')](this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]],_0x8aa8('0x16'));}logger[_0x8aa8('0x45')](_0x8aa8('0x6f'),util['inspect'](this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]],{'showHidden':![],'depth':null}));ami[_0x8aa8('0x43')](_0x8aa8('0x70'),this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]]);}}}catch(_0x127c03){logger[_0x8aa8('0x3b')](_0x8aa8('0x68'),util['inspect'](_0x127c03,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x19')]=function(_0x4f29ca){logger[_0x8aa8('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x8aa8('0x3d')](_0x4f29ca,{'showHidden':![],'depth':null}));this[_0x8aa8('0x14')]=!![];};VoiceQueueReport['prototype'][_0x8aa8('0x1a')]=function(_0x16036a){try{if(this[_0x8aa8('0x63')](_0x16036a)){logger[_0x8aa8('0x45')](_0x8aa8('0x71'),_0x16036a[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x16036a,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x8aa8('0x10')][_0x16036a[_0x8aa8('0x48')]]))this[_0x8aa8('0x10')][_0x16036a[_0x8aa8('0x48')]]=[];if(_['isUndefined'](this['channels'][_0x16036a[_0x8aa8('0x48')]]))this[_0x8aa8('0x34')][_0x16036a[_0x8aa8('0x48')]]={};var _0x39505e=new QueueReport();_0x39505e['name']=_0x16036a['queue'];_0x39505e['type']=this[_0x8aa8('0x13')][_0x39505e[_0x8aa8('0x4b')]]&&this[_0x8aa8('0x13')][_0x39505e[_0x8aa8('0x4b')]][_0x8aa8('0x51')]?this[_0x8aa8('0x13')][_0x39505e[_0x8aa8('0x4b')]][_0x8aa8('0x51')]||_0x8aa8('0x72'):'inbound';_0x39505e[_0x8aa8('0x69')]=_0x16036a['queue'];_0x39505e['queuecallerjoinAt']=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x39505e[_0x8aa8('0x74')]=_0x16036a['position'];_0x39505e[_0x8aa8('0x75')]=_0x16036a['count'];_0x39505e[_0x8aa8('0x48')]=_0x16036a[_0x8aa8('0x48')];_0x39505e[_0x8aa8('0x76')]=this[_0x8aa8('0x34')][_0x16036a[_0x8aa8('0x48')]]['routealias'];logger['info'](_0x8aa8('0x77'),_0x39505e[_0x8aa8('0x4b')],_0x39505e[_0x8aa8('0x51')]);_[_0x8aa8('0x78')](_0x39505e,_[_0x8aa8('0x79')](_0x16036a,_[_0x8aa8('0x7a')](_0x39505e)));this[_0x8aa8('0x10')][_0x16036a[_0x8aa8('0x48')]]['push'](_0x39505e);this[_0x8aa8('0x34')][_0x16036a[_0x8aa8('0x48')]]=_0x39505e;this['emitVoiceQueueChannelSave'](_0x39505e,'queuecallerjoin');}}catch(_0x202b9c){logger[_0x8aa8('0x3b')]('[%s][voiceQueueReport][queuecallerjoin]',_0x16036a[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x202b9c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')]['syncQueueCallerAbandon']=function(_0x4d213b){try{if(this['isNotNull'](_0x4d213b)){logger[_0x8aa8('0x45')](_0x8aa8('0x7b'),_0x4d213b[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x4d213b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4d213b[_0x8aa8('0x48')]]){var _0x5ed97b=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x4d213b['uniqueid']]);_0x5ed97b[_0x8aa8('0x7d')]=![];_0x5ed97b['queuecallercompleteAt']=null;_0x5ed97b['holdtime']=_0x4d213b[_0x8aa8('0x7e')];_0x5ed97b['originalposition']=_0x4d213b[_0x8aa8('0x7f')];_0x5ed97b[_0x8aa8('0x1b')]=!![];_0x5ed97b[_0x8aa8('0x80')]=moment()['format'](_0x8aa8('0x73'));_0x5ed97b[_0x8aa8('0x81')]=_0x8aa8('0x82');_0x5ed97b[_0x8aa8('0x83')]=null;logger[_0x8aa8('0x6a')](_0x8aa8('0x84'),_0x5ed97b['name'],_0x5ed97b['type']);this[_0x8aa8('0x34')][_0x4d213b['uniqueid']]=_0x5ed97b;this['emitVoiceQueueChannelRemove'](_0x5ed97b,'queuecallerabandon');}}}catch(_0x4bf532){logger['error'](_0x8aa8('0x7b'),_0x4d213b[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x4bf532,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x1e')]=function(_0xb9fb0){try{if(this[_0x8aa8('0x63')](_0xb9fb0)){logger[_0x8aa8('0x45')](_0x8aa8('0x85'),_0xb9fb0[_0x8aa8('0x48')],util['inspect'](_0xb9fb0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xb9fb0[_0x8aa8('0x48')]]){var _0x3f72cb=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0xb9fb0[_0x8aa8('0x48')]]);_0x3f72cb[_0x8aa8('0x86')]=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x3f72cb['connectedlinenum']=_0xb9fb0[_0x8aa8('0x87')];_0x3f72cb[_0x8aa8('0x88')]=_0xb9fb0[_0x8aa8('0x88')];logger['info'](_0x8aa8('0x89'),_0x3f72cb[_0x8aa8('0x4b')],_0x3f72cb['type'],_0xb9fb0[_0x8aa8('0x87')],_0xb9fb0[_0x8aa8('0x88')]);this[_0x8aa8('0x34')][_0xb9fb0[_0x8aa8('0x48')]]=_0x3f72cb;this[_0x8aa8('0x44')](_0x3f72cb,'queuecallerleave');}}}catch(_0x1e23fe){logger[_0x8aa8('0x3b')](_0x8aa8('0x85'),_0xb9fb0['uniqueid'],util[_0x8aa8('0x3d')](_0x1e23fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x8a')]=function(_0x1710b4){try{if(this[_0x8aa8('0x63')](_0x1710b4)){logger[_0x8aa8('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x1710b4[_0x8aa8('0x48')],util['inspect'](_0x1710b4,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x10')][_0x1710b4[_0x8aa8('0x48')]]){var _0x18f62c=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x1710b4['uniqueid']]);_0x18f62c[_0x8aa8('0x7d')]=!![];_0x18f62c[_0x8aa8('0x81')]=_0x8aa8('0x8b');logger[_0x8aa8('0x6a')](_0x8aa8('0x8c'),_0x18f62c[_0x8aa8('0x4b')],_0x18f62c[_0x8aa8('0x51')]);}}}catch(_0x54361a){logger['error'](_0x8aa8('0x8d'),_0x1710b4[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x54361a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x8e')]=function(_0x270120){try{if(this[_0x8aa8('0x63')](_0x270120)){logger[_0x8aa8('0x45')]('[%s][voiceQueueReport][agentcomplete]',_0x270120[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x270120,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x270120[_0x8aa8('0x48')]]){var _0x5edf3e=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x48')]]);_0x5edf3e[_0x8aa8('0x1b')]=![];_0x5edf3e[_0x8aa8('0x80')]=null;_0x5edf3e[_0x8aa8('0x8f')]=!![];_0x5edf3e['lastAssignedTo']=_0x270120[_0x8aa8('0x90')];_0x5edf3e[_0x8aa8('0x7e')]=_0x270120[_0x8aa8('0x7e')];_0x5edf3e[_0x8aa8('0x7d')]=!![];_0x5edf3e[_0x8aa8('0x91')]=![];_0x5edf3e['queuecallerexitAt']=null;if(!_0x5edf3e[_0x8aa8('0x92')]){if(_0x270120[_0x8aa8('0x93')]==_0x8aa8('0x92')){_0x5edf3e[_0x8aa8('0x81')]=_0x8aa8('0x94');logger[_0x8aa8('0x6a')](_0x8aa8('0x95'),_0x5edf3e[_0x8aa8('0x4b')],_0x5edf3e[_0x8aa8('0x51')]);}else{if(_[_0x8aa8('0x96')](_0x270120['channel']['toLowerCase'](),_0x8aa8('0x97'))){if(this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x98')]]){var _0x31a1de=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x270120['linkedid']]);_0x31a1de[_0x8aa8('0x7d')]=![];_0x31a1de['queuecallerexit']=!![];_0x31a1de[_0x8aa8('0x99')]=moment(_0x5edf3e[_0x8aa8('0x9a')])[_0x8aa8('0x9b')](_0x270120[_0x8aa8('0x7e')],'seconds')[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x31a1de['queuecallerexitreason']='FORWARDTRANSFER';_0x31a1de[_0x8aa8('0x92')]=!![];_0x31a1de['transfertype']='FORWARD';_0x31a1de[_0x8aa8('0x9c')]=_0x270120[_0x8aa8('0x9d')];_0x31a1de['transferuniqueid']=_0x270120[_0x8aa8('0x48')];logger[_0x8aa8('0x6a')](_0x8aa8('0x9e'),_0x31a1de[_0x8aa8('0x4b')],_0x31a1de['type']);var _0x124887=this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x98')]];this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x98')]]=this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x48')]];this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x48')]]=_0x124887;}}else{_0x5edf3e[_0x8aa8('0x81')]='COMPLETEDBY'+_0x270120[_0x8aa8('0x93')][_0x8aa8('0x9f')]();logger[_0x8aa8('0x6a')](_0x8aa8('0xa0'),_0x5edf3e['name'],_0x5edf3e[_0x8aa8('0x51')],_0x5edf3e[_0x8aa8('0x81')]);}}}this[_0x8aa8('0x34')][_0x270120[_0x8aa8('0x48')]]=_0x5edf3e;this['emitVoiceQueueChannelRemove'](_0x5edf3e,_0x8aa8('0x1f'));}}}catch(_0xb8456e){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x270120[_0x8aa8('0x48')],util['inspect'](_0xb8456e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')]['syncVarSet']=function(_0x5802ec){try{if(this[_0x8aa8('0x63')](_0x5802ec)){logger[_0x8aa8('0x45')](_0x8aa8('0xa1'),_0x5802ec[_0x8aa8('0x48')],util['inspect'](_0x5802ec,{'showHidden':![],'depth':null}));this[_0x8aa8('0xa2')](_0x5802ec[_0x8aa8('0x48')],_[_0x8aa8('0x7a')](_0x5802ec[_0x8aa8('0xa3')])[0x0],_0x5802ec[_0x8aa8('0xa4')]);if(this[_0x8aa8('0x10')][_0x5802ec['uniqueid']]){var _0x52095b=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x5802ec[_0x8aa8('0x48')]]);if(_0x52095b){if(this[_0x8aa8('0x63')](_0x5802ec[_0x8aa8('0xa3')])&&this['isNotNull'](_0x5802ec['variable']['queuestatus'])){switch(_0x5802ec['value']){case _0x8aa8('0xa5'):_0x52095b[_0x8aa8('0x91')]=![];_0x52095b['queuecallerexitAt']=null;break;case _0x8aa8('0xa6'):_0x52095b[_0x8aa8('0xa7')]=_0x8aa8('0xa8');_0x52095b['queuecallerexit']=!![];_0x52095b['queuecallerexitAt']=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x52095b[_0x8aa8('0x86')]=moment()['format'](_0x8aa8('0x73'));logger['debug'](_0x8aa8('0xa9'),_0x5802ec[_0x8aa8('0x48')],util['inspect'](_0x52095b,{'showHidden':![],'depth':null}));ami[_0x8aa8('0x43')](_0x8aa8('0xaa'),_0x52095b);break;default:_0x52095b[_0x8aa8('0x91')]=!![];_0x52095b[_0x8aa8('0x99')]=moment()['format'](_0x8aa8('0x73'));_0x52095b['queuecallerleaveAt']=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));}_0x52095b[_0x8aa8('0x1b')]=![];_0x52095b['queuecallerabandonAt']=null;_0x52095b['queuecallerexitreason']=_0x5802ec[_0x8aa8('0xa4')];this[_0x8aa8('0x34')][_0x5802ec[_0x8aa8('0x48')]]=_0x52095b;this[_0x8aa8('0x41')](_0x52095b,_0x8aa8('0x21'));}else if(this['isNotNull'](_0x5802ec[_0x8aa8('0xa3')])&&this[_0x8aa8('0x63')](_0x5802ec[_0x8aa8('0xa3')][_0x8aa8('0xab')])){if(!_0x52095b[_0x8aa8('0x1b')]){_0x52095b[_0x8aa8('0x91')]=!![];_0x52095b[_0x8aa8('0x99')]=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x52095b[_0x8aa8('0x81')]=_0x8aa8('0xac');_0x52095b['queuecallerleaveAt']=moment()[_0x8aa8('0x49')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8aa8('0x34')][_0x5802ec[_0x8aa8('0x48')]]=_0x52095b;}}logger[_0x8aa8('0x6a')](_0x8aa8('0xad'),_0x5802ec[_0x8aa8('0x48')],_0x52095b[_0x8aa8('0x4b')],_0x52095b['type'],_['keys'](_0x5802ec['variable'])[0x0],_0x5802ec[_0x8aa8('0xa4')]);_0x52095b[_0x8aa8('0x3f')]=this[_0x8aa8('0x3f')][_0x5802ec[_0x8aa8('0x48')]];}}}}catch(_0x5b4a32){logger[_0x8aa8('0x3b')](_0x8aa8('0xa1'),_0x5802ec[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x5b4a32,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')]['addVariable']=function(_0x281d46,_0x1e1e11,_0x40584a){var _0x235ed0=[_0x8aa8('0xae'),_0x8aa8('0xaf'),'rtpaudioqosjitter',_0x8aa8('0xb0'),_0x8aa8('0xb1'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x8aa8('0xb2'),'sipcallid','sipuri','bridgepeer',_0x8aa8('0xb3'),'membercalls','memberdynamic',_0x8aa8('0xb4'),_0x8aa8('0xb5'),_0x8aa8('0x90'),_0x8aa8('0xb6'),_0x8aa8('0xb7')];if(!_[_0x8aa8('0x36')](_0x1e1e11)&&!_[_0x8aa8('0xb8')](_0x235ed0,_0x1e1e11)){if(_[_0x8aa8('0x64')](this['variables'][_0x281d46])){this[_0x8aa8('0x3f')][_0x281d46]={};}this[_0x8aa8('0x3f')][_0x281d46][_0x1e1e11]=_0x40584a;}};VoiceQueueReport[_0x8aa8('0xb')]['syncHangup']=function(_0x272872){try{if(this[_0x8aa8('0x63')](_0x272872)){logger[_0x8aa8('0x45')]('[%s][voiceQueueReport][hangup]',_0x272872[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x272872,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x10')][_0x272872[_0x8aa8('0x48')]]){for(var _0x1d072e=0x0,_0x5d7b0d={};_0x1d072e<this['queueReports'][_0x272872[_0x8aa8('0x48')]][_0x8aa8('0xb9')];_0x1d072e+=0x1){_0x5d7b0d=this['queueReports'][_0x272872[_0x8aa8('0x48')]][_0x1d072e];if(this[_0x8aa8('0x13')][_0x5d7b0d[_0x8aa8('0x69')]]){if(_0x5d7b0d[_0x8aa8('0x91')]&&_0x5d7b0d[_0x8aa8('0x92')]!=!![]){this[_0x8aa8('0x13')][_0x5d7b0d['queue']][_0x8aa8('0x5a')]+=0x1;}if(_0x5d7b0d[_0x8aa8('0x1b')]){this['voiceQueues'][_0x5d7b0d[_0x8aa8('0x69')]]['abandoned']+=0x1;}this[_0x8aa8('0x13')][_0x5d7b0d[_0x8aa8('0x69')]][_0x8aa8('0xba')]+=moment(_0x5d7b0d['queuecallerleaveAt'])['diff'](_0x5d7b0d['queuecallerjoinAt'],'seconds')||0x0;if(_0x1d072e===this[_0x8aa8('0x10')][_0x272872[_0x8aa8('0x48')]]['length']-0x1){this[_0x8aa8('0x13')][_0x5d7b0d['queue']][_0x8aa8('0xbb')]+=moment()[_0x8aa8('0xbc')](0x0)[_0x8aa8('0xbd')](_0x5d7b0d[_0x8aa8('0x9a')],'seconds');this[_0x8aa8('0x13')][_0x5d7b0d['queue']][_0x8aa8('0x59')]+=0x1;if(_0x5d7b0d['queuecallercomplete']){this[_0x8aa8('0x13')][_0x5d7b0d['queue']][_0x8aa8('0x53')]+=0x1;this[_0x8aa8('0x13')][_0x5d7b0d['queue']]['sumBillable']+=moment()['milliseconds'](0x0)[_0x8aa8('0xbd')](_0x5d7b0d[_0x8aa8('0x86')],_0x8aa8('0xbe'));_0x5d7b0d[_0x8aa8('0xbf')]=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x5d7b0d[_0x8aa8('0x91')]=![];_0x5d7b0d['queuecallerexitAt']=null;}if(_0x5d7b0d[_0x8aa8('0x91')]&&_0x5d7b0d[_0x8aa8('0x92')]!=!![]){_0x5d7b0d[_0x8aa8('0xa7')]=_0x8aa8('0x5a');logger[_0x8aa8('0x45')](_0x8aa8('0xc0'),_0x272872[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x5d7b0d,{'showHidden':![],'depth':null}));ami[_0x8aa8('0x43')](_0x8aa8('0xc1'),_0x5d7b0d);}if(_0x5d7b0d[_0x8aa8('0x1b')]){_0x5d7b0d[_0x8aa8('0xa7')]=_0x8aa8('0x5b');logger[_0x8aa8('0x45')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x272872[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x5d7b0d,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerabandon',_0x5d7b0d);}}else{this['voiceQueues'][_0x5d7b0d[_0x8aa8('0x69')]][_0x8aa8('0xbb')]+=this[_0x8aa8('0x13')][_0x5d7b0d['queue']][_0x8aa8('0xba')];}logger[_0x8aa8('0x6a')](_0x8aa8('0xc2'),_0x272872[_0x8aa8('0x48')],_0x5d7b0d[_0x8aa8('0x4b')],_0x5d7b0d[_0x8aa8('0x51')],_0x272872[_0x8aa8('0xc3')]);this[_0x8aa8('0x34')][_0x272872[_0x8aa8('0x48')]]=_0x5d7b0d;this[_0x8aa8('0x41')](_0x5d7b0d,_0x8aa8('0x22'));this[_0x8aa8('0x50')](this[_0x8aa8('0x13')][_0x5d7b0d[_0x8aa8('0x69')]],_0x8aa8('0x22'));}}logger['debug'](_0x8aa8('0xc4'),_0x272872['uniqueid'],util[_0x8aa8('0x3d')](this[_0x8aa8('0x10')][_0x272872['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x8aa8('0x43')]('custom:voiceQueueReport',this[_0x8aa8('0x10')][_0x272872[_0x8aa8('0x48')]]);delete this[_0x8aa8('0x10')][_0x272872['uniqueid']];delete this[_0x8aa8('0x34')][_0x272872[_0x8aa8('0x48')]];}if(this['variables'][_0x272872['uniqueid']]){delete this['variables'][_0x272872['uniqueid']];}}}catch(_0x168044){logger[_0x8aa8('0x3b')](_0x8aa8('0xc5'),_0x272872[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x168044,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')]['syncAttendedTransfer']=function(_0xbb19c4){try{if(this[_0x8aa8('0x63')](_0xbb19c4)){logger[_0x8aa8('0x45')](_0x8aa8('0xc6'),_0xbb19c4['uniqueid'],util['inspect'](_0xbb19c4,{'showHidden':![],'depth':null}));var _0x47a0fa;if(this[_0x8aa8('0x10')][_0xbb19c4[_0x8aa8('0xc7')]]){_0x47a0fa=_[_0x8aa8('0x7c')](this['queueReports'][_0xbb19c4['transfereeuniqueid']]);_0x47a0fa[_0x8aa8('0x9c')]=_0xbb19c4[_0x8aa8('0xc8')];_0x47a0fa['transferuniqueid']=_0xbb19c4[_0x8aa8('0xc9')];_0x47a0fa[_0x8aa8('0x81')]=_0x8aa8('0xca');_0x47a0fa[_0x8aa8('0x92')]=!![];_0x47a0fa['transfertype']=_0x8aa8('0xcb');if(this['queueReports'][_0xbb19c4[_0x8aa8('0xc9')]]){var _0x3c5751=this['queueReports'][_0xbb19c4[_0x8aa8('0xc9')]];this[_0x8aa8('0x10')][_0xbb19c4[_0x8aa8('0xc9')]]=this['queueReports'][_0xbb19c4[_0x8aa8('0xc7')]];this['queueReports'][_0xbb19c4[_0x8aa8('0xc7')]]=_0x3c5751;var _0x5877c3=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0xbb19c4[_0x8aa8('0xc7')]]);_0x5877c3[_0x8aa8('0x35')]=!![];}logger['info'](_0x8aa8('0xcc'),_0xbb19c4[_0x8aa8('0x48')],_0x47a0fa[_0x8aa8('0x4b')],_0x47a0fa[_0x8aa8('0x51')],_0x47a0fa['transferexten'],_0x47a0fa[_0x8aa8('0xcd')]);}else if(this['queueReports'][_0xbb19c4[_0x8aa8('0xce')]]){_0x47a0fa=_['last'](this['queueReports'][_0xbb19c4[_0x8aa8('0xce')]]);_0x47a0fa[_0x8aa8('0x9c')]=_0xbb19c4[_0x8aa8('0xcf')];_0x47a0fa[_0x8aa8('0xcd')]=_0xbb19c4[_0x8aa8('0xd0')];_0x47a0fa['queuecallerexitreason']=_0x8aa8('0xca');_0x47a0fa[_0x8aa8('0x92')]=!![];_0x47a0fa[_0x8aa8('0xd1')]=_0x8aa8('0xcb');if(this[_0x8aa8('0x10')][_0xbb19c4[_0x8aa8('0xd0')]]){var _0x3c5751=this[_0x8aa8('0x10')][_0xbb19c4[_0x8aa8('0xd0')]];this[_0x8aa8('0x10')][_0xbb19c4[_0x8aa8('0xd0')]]=this['queueReports'][_0xbb19c4[_0x8aa8('0xce')]];this['queueReports'][_0xbb19c4[_0x8aa8('0xce')]]=_0x3c5751;var _0x5877c3=_[_0x8aa8('0x7c')](this['queueReports'][_0xbb19c4[_0x8aa8('0xce')]]);_0x5877c3[_0x8aa8('0x35')]=!![];}logger[_0x8aa8('0x6a')](_0x8aa8('0xcc'),_0xbb19c4[_0x8aa8('0x48')],_0x47a0fa[_0x8aa8('0x4b')],_0x47a0fa[_0x8aa8('0x51')],_0x47a0fa[_0x8aa8('0x9c')],_0x47a0fa['transferuniqueid']);}}}catch(_0x323e7d){logger['error'](_0x8aa8('0xc6'),_0xbb19c4[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x323e7d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x2b')]=function(_0x47b5aa){try{if(this[_0x8aa8('0x63')](_0x47b5aa)){logger[_0x8aa8('0x45')](_0x8aa8('0xd2'),_0x47b5aa['uniqueid'],util[_0x8aa8('0x3d')](_0x47b5aa,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x10')][_0x47b5aa[_0x8aa8('0xc7')]]){var _0x1efa54=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x47b5aa[_0x8aa8('0xc7')]]);_0x1efa54[_0x8aa8('0x81')]=_0x8aa8('0xd3');_0x1efa54[_0x8aa8('0x92')]=!![];_0x1efa54[_0x8aa8('0xd1')]=_0x8aa8('0xd4');_0x1efa54['transferexten']=_0x47b5aa[_0x8aa8('0xd5')];_0x1efa54['transferuniqueid']=_0x47b5aa[_0x8aa8('0xc7')];logger['info'](_0x8aa8('0xd6'),_0x47b5aa[_0x8aa8('0x48')],_0x1efa54[_0x8aa8('0x4b')],_0x1efa54[_0x8aa8('0x51')],_0x1efa54[_0x8aa8('0x9c')],_0x1efa54[_0x8aa8('0xcd')]);this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x47b5aa[_0x8aa8('0xc7')],'context':_0x47b5aa[_0x8aa8('0xd7')],'channel':_0x47b5aa[_0x8aa8('0xd8')]});}}}catch(_0x520ec6){logger['error'](_0x8aa8('0xd2'),_0x47b5aa[_0x8aa8('0x48')],util['inspect'](_0x520ec6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0xd9')]=function(_0x3455d9){try{if(this[_0x8aa8('0x63')](_0x3455d9)){logger[_0x8aa8('0x45')](_0x8aa8('0xda'),_0x3455d9[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x3455d9,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x10')][_0x3455d9[_0x8aa8('0x48')]]){var _0xd2c1c4=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x3455d9[_0x8aa8('0x48')]]);if(!_['isNil'](_0xd2c1c4[_0x8aa8('0x86')])){_0xd2c1c4['mohstarttime']=moment()[_0x8aa8('0x49')]('YYYY-MM-DD\x20HH:mm:ss');logger['info'](_0x8aa8('0xdb'),_0x3455d9['uniqueid'],_0xd2c1c4[_0x8aa8('0xdc')]);}}}}catch(_0x306bce){logger[_0x8aa8('0x3b')](_0x8aa8('0xda'),_0x3455d9['uniqueid'],util[_0x8aa8('0x3d')](_0x306bce,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8aa8('0x28')]=function(_0x5afe54){try{if(this[_0x8aa8('0x63')](_0x5afe54)){logger[_0x8aa8('0x45')](_0x8aa8('0xdd'),_0x5afe54[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x5afe54,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5afe54[_0x8aa8('0x48')]]){var _0x2e17bd=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x5afe54['uniqueid']]);if(!_[_0x8aa8('0x36')](_0x2e17bd['mohstarttime'])){_0x2e17bd['mohtime']+=moment()[_0x8aa8('0xbc')](0x0)['diff'](_0x2e17bd[_0x8aa8('0xdc')],_0x8aa8('0xbe'));logger[_0x8aa8('0x6a')](_0x8aa8('0xde'),_0x5afe54[_0x8aa8('0x48')],_0x2e17bd[_0x8aa8('0xdf')]);delete _0x2e17bd['mohstarttime'];}}}}catch(_0xf28e4d){logger[_0x8aa8('0x3b')]('[%s][voiceQueueReport][musiconholdstop]',_0x5afe54[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0xf28e4d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x26')]=function(_0x196a44){try{if(this[_0x8aa8('0x63')](_0x196a44)){logger[_0x8aa8('0x45')](_0x8aa8('0xe0'),_0x196a44[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x196a44,{'showHidden':![],'depth':null}));if(_0x196a44[_0x8aa8('0xe1')][_0x8aa8('0xe2')]()==='set'){_0x196a44['applicationdata']=_0x196a44[_0x8aa8('0xe3')]&&_0x196a44[_0x8aa8('0xe3')][_0x8aa8('0x96')]('CDR(routeAlias)')?_0x196a44[_0x8aa8('0xe3')]:(_0x196a44[_0x8aa8('0xe3')]||_0x196a44[_0x8aa8('0xe4')])[_0x8aa8('0xe2')]();if(_[_0x8aa8('0x96')](_0x196a44[_0x8aa8('0xe4')][_0x8aa8('0xe2')](),_0x8aa8('0xe5'))){logger['info'](_0x8aa8('0xe6'),_0x196a44[_0x8aa8('0x48')],_0x196a44['application'],_0x196a44[_0x8aa8('0xe4')]);if(_['isUndefined'](this[_0x8aa8('0x34')][_0x196a44['uniqueid']]))this['channels'][_0x196a44[_0x8aa8('0x48')]]={};var _0xdce1d6=_0x196a44[_0x8aa8('0xe4')][_0x8aa8('0xe7')]('=');var _0x48b774=_0xdce1d6[0x0][_0x8aa8('0xe2')]()[_0x8aa8('0xe8')](/cdr\((.*)\)/);if(_0x48b774)this[_0x8aa8('0x34')][_0x196a44[_0x8aa8('0x48')]][_0x48b774[0x1]]=_0xdce1d6[0x1];}}}}catch(_0x58b16e){logger[_0x8aa8('0x3b')](_0x8aa8('0xe9'),_0x196a44[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x58b16e,{'showHidden':![],'depth':null}));}};module[_0x8aa8('0xea')]=VoiceQueueReport;
\ No newline at end of file
index cd28b14..479b293 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b5a=['campaign','queue','CreateReportAgentPreview','../client','createHistory'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x3b5a,0x1c5));var _0xa3b5=function(_0x29a728,_0x352bf8){_0x29a728=_0x29a728-0x0;var _0x405405=_0x3b5a[_0x29a728];return _0x405405;};'use strict';var client=require(_0xa3b5('0x0'));exports[_0xa3b5('0x1')]=function(_0x4e3a6f){return function(){_0x4e3a6f[_0xa3b5('0x2')]=_0x4e3a6f[_0xa3b5('0x3')];return client['Request'](_0xa3b5('0x4'),{'body':_0x4e3a6f,'log':_0xa3b5('0x4')});};};
\ No newline at end of file
+var _0xed73=['queue','Request','CreateReportAgentPreview','createHistory'];(function(_0x2198f9,_0x3f06b0){var _0x59e147=function(_0x317213){while(--_0x317213){_0x2198f9['push'](_0x2198f9['shift']());}};_0x59e147(++_0x3f06b0);}(_0xed73,0x73));var _0x3ed7=function(_0x4007ad,_0x4d1553){_0x4007ad=_0x4007ad-0x0;var _0x2fe391=_0xed73[_0x4007ad];return _0x2fe391;};'use strict';var client=require('../client');exports[_0x3ed7('0x0')]=function(_0x3e3a52){return function(){_0x3e3a52['campaign']=_0x3e3a52[_0x3ed7('0x1')];return client[_0x3ed7('0x2')](_0x3ed7('0x3'),{'body':_0x3e3a52,'log':_0x3ed7('0x3')});};};
\ No newline at end of file
index 2d3c3b3..f2f0cfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a41=['CreateAttachment','../client'];(function(_0x50fa03,_0x478e7d){var _0x236958=function(_0x4beced){while(--_0x4beced){_0x50fa03['push'](_0x50fa03['shift']());}};_0x236958(++_0x478e7d);}(_0x6a41,0x71));var _0x16a4=function(_0x5759e5,_0x58122c){_0x5759e5=_0x5759e5-0x0;var _0x7beea4=_0x6a41[_0x5759e5];return _0x7beea4;};'use strict';var client=require(_0x16a4('0x0'));exports['create']=function(_0x423a86){return client['Request'](_0x16a4('0x1'),{'body':_0x423a86,'log':_0x16a4('0x1')});};
\ No newline at end of file
+var _0x4e94=['CreateAttachment','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e94,0x155));var _0x44e9=function(_0x580cf8,_0x26751e){_0x580cf8=_0x580cf8-0x0;var _0xcc9a9e=_0x4e94[_0x580cf8];return _0xcc9a9e;};'use strict';var client=require(_0x44e9('0x0'));exports[_0x44e9('0x1')]=function(_0x589882){return client[_0x44e9('0x2')](_0x44e9('0x3'),{'body':_0x589882,'log':'CreateAttachment'});};
\ No newline at end of file
index a2d7197..deee3c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialCutDigit','Trunk','callerid','active','TrunkBackup','Interval','SquareProject','getCampaign','getCampaigns','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength'];(function(_0x9d4622,_0x52dca8){var _0x186d3f=function(_0x2f0d13){while(--_0x2f0d13){_0x9d4622['push'](_0x9d4622['shift']());}};_0x186d3f(++_0x52dca8);}(_0xadb5,0xad));var _0x5adb=function(_0x5d60d7,_0x11def7){_0x5d60d7=_0x5d60d7-0x0;var _0x21441e=_0xadb5[_0x5d60d7];return _0x21441e;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(){return function(){return client['Request'](_0x5adb('0x1'),{'options':{'raw':![],'attributes':['id',_0x5adb('0x2'),_0x5adb('0x3'),'active',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'dialOriginateTimeout',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'dialAMDActive',_0x5adb('0x18'),'dialAMDGreeting',_0x5adb('0x19'),'dialAMDTotalAnalysisTime',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'dialAMDSilenceThreshold',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'dialRandomLastDigitCallerIdNumber',_0x5adb('0x20')],'include':[{'model':'Trunk','as':_0x5adb('0x21'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':_0x5adb('0x21'),'as':_0x5adb('0x24'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':'Interval','as':_0x5adb('0x25'),'attributes':['id','name'],'include':[{'model':_0x5adb('0x25'),'as':'Intervals','attributes':['id',_0x5adb('0x2'),'interval']}]},{'model':'SquareProject','as':_0x5adb('0x26'),'attributes':['id',_0x5adb('0x2')]}]},'log':_0x5adb('0x27')});};};
\ No newline at end of file
+var _0xc4aa=['Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x43ed38,_0x507af1){var _0x181497=function(_0x153d8e){while(--_0x153d8e){_0x43ed38['push'](_0x43ed38['shift']());}};_0x181497(++_0x507af1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'active','limitCalls','dialOriginateCallerIdName',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'dialGlobalMaxRetry','dialNoSuchNumberMaxRetry',_0xac4a('0xe'),_0xac4a('0xf'),_0xac4a('0x10'),'dialAbandonedMaxRetry',_0xac4a('0x11'),_0xac4a('0x12'),_0xac4a('0x13'),'dialAgentRejectMaxRetry',_0xac4a('0x14'),'dialTimezone',_0xac4a('0x15'),'dialAMDActive',_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x18'),'dialAMDTotalAnalysisTime',_0xac4a('0x19'),_0xac4a('0x1a'),_0xac4a('0x1b'),_0xac4a('0x1c'),_0xac4a('0x1d'),_0xac4a('0x1e'),_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21')],'include':[{'model':_0xac4a('0x22'),'as':_0xac4a('0x22'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0x23')]},{'model':_0xac4a('0x22'),'as':_0xac4a('0x24'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x25'),_0xac4a('0x23')]},{'model':_0xac4a('0x26'),'as':_0xac4a('0x26'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xac4a('0x27'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x28')]}]},{'model':'SquareProject','as':_0xac4a('0x29'),'attributes':['id',_0xac4a('0x4')]}]},'log':_0xac4a('0x2a')});};};
\ No newline at end of file
index 4d2cb78..f036416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6b7=['CreateCmContact','getContacts','GetCmContact','../client','createContact','Request'];(function(_0x13257b,_0x5c6dc2){var _0x4bff9e=function(_0x14d62b){while(--_0x14d62b){_0x13257b['push'](_0x13257b['shift']());}};_0x4bff9e(++_0x5c6dc2);}(_0xe6b7,0xdb));var _0x7e6b=function(_0x71e9e4,_0x2b8f91){_0x71e9e4=_0x71e9e4-0x0;var _0x44f29d=_0xe6b7[_0x71e9e4];return _0x44f29d;};'use strict';var client=require(_0x7e6b('0x0'));exports[_0x7e6b('0x1')]=function(_0x454435){return function(){return client[_0x7e6b('0x2')](_0x7e6b('0x3'),{'body':_0x454435,'log':_0x7e6b('0x3')});};};exports[_0x7e6b('0x4')]=function(_0x1f750b){return function(){return client[_0x7e6b('0x2')](_0x7e6b('0x5'),{'options':_0x1f750b,'log':_0x7e6b('0x5')});};};
\ No newline at end of file
+var _0xb59d=['CreateCmContact','GetCmContact','../client','createContact','Request'];(function(_0x512c0c,_0x42df6a){var _0xdab067=function(_0x136439){while(--_0x136439){_0x512c0c['push'](_0x512c0c['shift']());}};_0xdab067(++_0x42df6a);}(_0xb59d,0x142));var _0xdb59=function(_0x11e967,_0x1cb5fc){_0x11e967=_0x11e967-0x0;var _0x288251=_0xb59d[_0x11e967];return _0x288251;};'use strict';var client=require(_0xdb59('0x0'));exports[_0xdb59('0x1')]=function(_0x25ad10){return function(){return client[_0xdb59('0x2')](_0xdb59('0x3'),{'body':_0x25ad10,'log':'CreateCmContact'});};};exports['getContacts']=function(_0x613f05){return function(){return client['Request'](_0xdb59('0x4'),{'options':_0x613f05,'log':_0xdb59('0x4')});};};
\ No newline at end of file
index 71cbd9a..9144c60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6373=['campaign','queue','MoveContactManagedDialer','VoiceQueueId','countReScheduled','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','getContactRecallMe','GetContactRecallMe','Contact','db.CmHopper.UserId','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','getCmHopper','updateContacts','UpdateCmHopper','format','rescheduleContact','ContactId','ListId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat','GetContactDialer','getContactDialerIvr','ASC','GetContactDialerIvr','moveContactManagedDialer'];(function(_0x145db1,_0x1724d5){var _0x5eff0a=function(_0x426ff4){while(--_0x426ff4){_0x145db1['push'](_0x145db1['shift']());}};_0x5eff0a(++_0x1724d5);}(_0x6373,0x1b3));var _0x3637=function(_0x5f0fae,_0x17d971){_0x5f0fae=_0x5f0fae-0x0;var _0x540f22=_0x6373[_0x5f0fae];return _0x540f22;};'use strict';var client=require(_0x3637('0x0'));var moment=require(_0x3637('0x1'));var _=require(_0x3637('0x2'));exports[_0x3637('0x3')]=function(_0x3d98b6,_0x524b44){return function(){return client[_0x3637('0x4')](_0x3637('0x5'),{'options':{'where':{'VoiceQueueId':_0x3d98b6},'include':[{'model':_0x3637('0x6'),'as':'Contact'}],'limit':_0x524b44,'raw':![]},'log':_0x3637('0x7')});};};exports[_0x3637('0x8')]=function(_0x3221ff,_0x990a21,_0x2d8b57){return function(){return client[_0x3637('0x4')](_0x3637('0x9'),{'body':_0x3221ff,'options':{'where':{'VoiceQueueId':_0x990a21,'scheduledat':{'$lte':moment()[_0x3637('0xa')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x2d8b57},'log':_0x3637('0x9')});};};exports[_0x3637('0xb')]=function(_0x56a26d){return function(){return client[_0x3637('0x4')]('UpdateCmHopper',{'body':_0x56a26d,'options':{'where':{'ContactId':_0x56a26d[_0x3637('0xc')],'ListId':_0x56a26d[_0x3637('0xd')],'VoiceQueueId':_0x56a26d['VoiceQueueId'],'CampaignId':_0x56a26d[_0x3637('0xe')]}},'log':'rescheduleContact'});};};exports[_0x3637('0xf')]=function(_0x2cfe95,_0x22690b,_0x1c631f){return function(){return client[_0x3637('0x4')](_0x3637('0x10'),{'options':{'where':{'VoiceQueueId':_0x2cfe95,'ListId':_0x22690b,'ContactId':_0x1c631f}},'log':_0x3637('0x10')});};};exports[_0x3637('0x11')]=function(_0x104578,_0x24714a,_0x2b1e2a,_0x2401f9){return function(){return client[_0x3637('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x104578,'active':![],'scheduledat':{'$lte':moment()['format'](_0x3637('0x12'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x24714a}}]},'order':[[_0x3637('0x13'),_0x3637('0x14')],[_0x3637('0x15'),_0x2401f9],['id','ASC']],'raw':!![],'limit':_0x2b1e2a},'log':_0x3637('0x16')});};};exports[_0x3637('0x17')]=function(_0x11978f,_0x5b1986,_0x168eaf){return function(){return client[_0x3637('0x4')](_0x3637('0x16'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x11978f,'active':![],'scheduledat':{'$lte':moment()[_0x3637('0xa')](_0x3637('0x12'))}},'include':[{'model':_0x3637('0x6'),'as':'Contact'}],'order':[[_0x3637('0x13'),'DESC'],[_0x3637('0x15'),_0x168eaf],['id',_0x3637('0x18')]],'raw':!![],'limit':_0x5b1986},'log':_0x3637('0x19')});};};exports[_0x3637('0x1a')]=function(_0x5a795c,_0xe22edb){return function(){_0x5a795c[_0x3637('0x1b')]=_0x5a795c[_0x3637('0x1c')];return client[_0x3637('0x4')](_0x3637('0x1d'),{'body':_0x5a795c,'options':{'where':{'ContactId':_0x5a795c[_0x3637('0xc')],'ListId':_0x5a795c[_0x3637('0xd')],'VoiceQueueId':_0x5a795c[_0x3637('0x1e')],'CampaignId':_0x5a795c[_0x3637('0xe')],'active':_0xe22edb?undefined:!![]}},'log':_0x3637('0x1d')});};};exports[_0x3637('0x1f')]=function(_0x5db6e3){return function(){return client[_0x3637('0x4')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x5db6e3['id']?_0x5db6e3['id']||null:null}},'log':_0x3637('0x1f')});};};exports['getContactPreview']=function(_0x406b88){return function(){return client[_0x3637('0x4')](_0x3637('0x20'),{'options':{'where':{'id':_0x406b88},'include':[{'model':_0x3637('0x6'),'as':'Contact'},{'model':_0x3637('0x21'),'as':_0x3637('0x22'),'attributes':['id',_0x3637('0x23')]},{'model':_0x3637('0x24'),'as':_0x3637('0x25'),'attributes':['id','name']}],'raw':!![]},'log':_0x3637('0x7')});};};exports['unlockContact']=function(_0x55f552,_0x5922b1,_0x16d147){return function(){return client['Request'](_0x3637('0x9'),{'body':_0x55f552,'options':{'where':{'id':_0x5922b1},'limit':_0x16d147},'log':'UpdateCmHopper'});};};exports[_0x3637('0x26')]=function(_0x1785fa,_0x122b0b){return function(){return client[_0x3637('0x4')](_0x3637('0x27'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1785fa,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x3637('0xa')](_0x3637('0x12'))},'UserId':{'$in':_0x122b0b}},'order':[['priority',_0x3637('0x14')],[_0x3637('0x15'),_0x3637('0x14')],['id',_0x3637('0x18')]],'include':[{'model':_0x3637('0x6'),'as':_0x3637('0x28')},{'model':_0x3637('0x21'),'as':'Agent','attributes':['id',_0x3637('0x23'),'voicePause']}],'group':_0x3637('0x29'),'raw':!![]},'log':_0x3637('0x16')});};};
\ No newline at end of file
+var _0x3a6b=['Request','GetCmHopper','CmContact','Contact','updateContacts','UpdateCmHopper','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','format','priority','DESC','ASC','GetContactDialerIvr','campaign','MoveContactManagedDialer','countReScheduled','CountReScheduled','GetCmHopperPreview','User','Agent','Queue','name','getCmHopper','unlockContact','getContactRecallMe','GetContactRecallMe','scheduledat','db.CmHopper.UserId','../client','moment'];(function(_0x27e916,_0x490784){var _0x582985=function(_0x42cc67){while(--_0x42cc67){_0x27e916['push'](_0x27e916['shift']());}};_0x582985(++_0x490784);}(_0x3a6b,0x70));var _0xb3a6=function(_0x4e46a4,_0x176f9e){_0x4e46a4=_0x4e46a4-0x0;var _0x1c9140=_0x3a6b[_0x4e46a4];return _0x1c9140;};'use strict';var client=require(_0xb3a6('0x0'));var moment=require(_0xb3a6('0x1'));var _=require('lodash');exports['getContacts']=function(_0x553ca2,_0x6758f6){return function(){return client[_0xb3a6('0x2')](_0xb3a6('0x3'),{'options':{'where':{'VoiceQueueId':_0x553ca2},'include':[{'model':_0xb3a6('0x4'),'as':_0xb3a6('0x5')}],'limit':_0x6758f6,'raw':![]},'log':'getCmHopper'});};};exports[_0xb3a6('0x6')]=function(_0x431a50,_0x3f35ea,_0x1dda19){return function(){return client[_0xb3a6('0x2')](_0xb3a6('0x7'),{'body':_0x431a50,'options':{'where':{'VoiceQueueId':_0x3f35ea,'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x1dda19},'log':_0xb3a6('0x7')});};};exports[_0xb3a6('0x8')]=function(_0x4f1957){return function(){return client[_0xb3a6('0x2')]('UpdateCmHopper',{'body':_0x4f1957,'options':{'where':{'ContactId':_0x4f1957[_0xb3a6('0x9')],'ListId':_0x4f1957[_0xb3a6('0xa')],'VoiceQueueId':_0x4f1957[_0xb3a6('0xb')],'CampaignId':_0x4f1957[_0xb3a6('0xc')]}},'log':'rescheduleContact'});};};exports[_0xb3a6('0xd')]=function(_0x183d4f,_0x4da6ac,_0x4cd986){return function(){return client[_0xb3a6('0x2')](_0xb3a6('0xe'),{'options':{'where':{'VoiceQueueId':_0x183d4f,'ListId':_0x4da6ac,'ContactId':_0x4cd986}},'log':_0xb3a6('0xe')});};};exports[_0xb3a6('0xf')]=function(_0xf2f24c,_0x4b6799,_0x57cf14,_0x34cc21){return function(){return client[_0xb3a6('0x2')](_0xb3a6('0x10'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0xf2f24c,'active':![],'scheduledat':{'$lte':moment()['format'](_0xb3a6('0x11'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x4b6799}}]},'order':[['priority','DESC'],['scheduledat',_0x34cc21],['id','ASC']],'raw':!![],'limit':_0x57cf14},'log':_0xb3a6('0x10')});};};exports['getContactDialerIvr']=function(_0xd1296d,_0x48918a,_0x3d97ae){return function(){return client[_0xb3a6('0x2')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0xd1296d,'active':![],'scheduledat':{'$lte':moment()[_0xb3a6('0x12')](_0xb3a6('0x11'))}},'include':[{'model':_0xb3a6('0x4'),'as':_0xb3a6('0x5')}],'order':[[_0xb3a6('0x13'),_0xb3a6('0x14')],['scheduledat',_0x3d97ae],['id',_0xb3a6('0x15')]],'raw':!![],'limit':_0x48918a},'log':_0xb3a6('0x16')});};};exports['moveContactManagedDialer']=function(_0x4e1602,_0x24f751){return function(){_0x4e1602[_0xb3a6('0x17')]=_0x4e1602['queue'];return client[_0xb3a6('0x2')](_0xb3a6('0x18'),{'body':_0x4e1602,'options':{'where':{'ContactId':_0x4e1602['ContactId'],'ListId':_0x4e1602[_0xb3a6('0xa')],'VoiceQueueId':_0x4e1602['VoiceQueueId'],'CampaignId':_0x4e1602[_0xb3a6('0xc')],'active':_0x24f751?undefined:!![]}},'log':_0xb3a6('0x18')});};};exports[_0xb3a6('0x19')]=function(_0x2523b4){return function(){return client[_0xb3a6('0x2')](_0xb3a6('0x1a'),{'options':{'where':{'VoiceQueueId':_0x2523b4['id']?_0x2523b4['id']||null:null}},'log':_0xb3a6('0x19')});};};exports['getContactPreview']=function(_0x56514f){return function(){return client[_0xb3a6('0x2')](_0xb3a6('0x1b'),{'options':{'where':{'id':_0x56514f},'include':[{'model':_0xb3a6('0x4'),'as':_0xb3a6('0x5')},{'model':_0xb3a6('0x1c'),'as':_0xb3a6('0x1d'),'attributes':['id','name']},{'model':'VoiceQueue','as':_0xb3a6('0x1e'),'attributes':['id',_0xb3a6('0x1f')]}],'raw':!![]},'log':_0xb3a6('0x20')});};};exports[_0xb3a6('0x21')]=function(_0x69df2f,_0x10c112,_0x5d3cd0){return function(){return client[_0xb3a6('0x2')](_0xb3a6('0x7'),{'body':_0x69df2f,'options':{'where':{'id':_0x10c112},'limit':_0x5d3cd0},'log':_0xb3a6('0x7')});};};exports[_0xb3a6('0x22')]=function(_0x517c2e,_0x35de23){return function(){return client[_0xb3a6('0x2')](_0xb3a6('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x517c2e,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xb3a6('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x35de23}},'order':[[_0xb3a6('0x13'),_0xb3a6('0x14')],[_0xb3a6('0x24'),_0xb3a6('0x14')],['id','ASC']],'include':[{'model':_0xb3a6('0x4'),'as':_0xb3a6('0x5')},{'model':_0xb3a6('0x1c'),'as':'Agent','attributes':['id',_0xb3a6('0x1f'),'voicePause']}],'group':_0xb3a6('0x25'),'raw':!![]},'log':_0xb3a6('0x10')});};};
\ No newline at end of file
index 0b08572..b424e76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe511=['checkIsBlackList','Request','VoiceQueueId','Contact','GetCmHopperBlack','checkIsBlackListIvr','CampaignId','../client'];(function(_0x5e1da4,_0x24a60d){var _0x579fd3=function(_0x4639e1){while(--_0x4639e1){_0x5e1da4['push'](_0x5e1da4['shift']());}};_0x579fd3(++_0x24a60d);}(_0xe511,0x16f));var _0x1e51=function(_0x82d015,_0x523e8b){_0x82d015=_0x82d015-0x0;var _0x5c5851=_0xe511[_0x82d015];return _0x5c5851;};'use strict';var client=require(_0x1e51('0x0'));exports[_0x1e51('0x1')]=function(_0x49cbdc){return function(){return client[_0x1e51('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x49cbdc[_0x1e51('0x3')],'phone':_0x49cbdc[_0x1e51('0x4')]['phone']},'raw':![]},'log':_0x1e51('0x5')});};};exports[_0x1e51('0x6')]=function(_0x204da7){return function(){return client[_0x1e51('0x2')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x204da7[_0x1e51('0x7')],'phone':_0x204da7[_0x1e51('0x4')]['phone']},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
+var _0x1399=['phone','GetCmHopperBlack','checkIsBlackListIvr','CampaignId','../client','checkIsBlackList','Request','VoiceQueueId','Contact'];(function(_0xcf9351,_0xcf7e21){var _0x8b8da4=function(_0x584905){while(--_0x584905){_0xcf9351['push'](_0xcf9351['shift']());}};_0x8b8da4(++_0xcf7e21);}(_0x1399,0x16c));var _0x9139=function(_0x5ad4cf,_0x212ffb){_0x5ad4cf=_0x5ad4cf-0x0;var _0x530aba=_0x1399[_0x5ad4cf];return _0x530aba;};'use strict';var client=require(_0x9139('0x0'));exports[_0x9139('0x1')]=function(_0x5740a9){return function(){return client[_0x9139('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x5740a9[_0x9139('0x3')],'phone':_0x5740a9[_0x9139('0x4')][_0x9139('0x5')]},'raw':![]},'log':_0x9139('0x6')});};};exports[_0x9139('0x7')]=function(_0x2acb38){return function(){return client['Request']('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x2acb38[_0x9139('0x8')],'phone':_0x2acb38[_0x9139('0x4')][_0x9139('0x5')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index 3da1a8a..74a463d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c6a=['../client','campaign','queue','CreateCmHopperFinal'];(function(_0x4b9750,_0x538cbf){var _0x4470b0=function(_0x204609){while(--_0x204609){_0x4b9750['push'](_0x4b9750['shift']());}};_0x4470b0(++_0x538cbf);}(_0x2c6a,0x94));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa2c6('0x0'));exports['createContact']=function(_0x55eb39){return function(){_0x55eb39[_0xa2c6('0x1')]=_0x55eb39[_0xa2c6('0x2')];return client['Request'](_0xa2c6('0x3'),{'body':_0x55eb39,'log':_0xa2c6('0x3')});};};
\ No newline at end of file
+var _0x5f00=['Request','CreateCmHopperFinal','../client','queue'];(function(_0x4b6c8a,_0x4df030){var _0x13db07=function(_0x2e6360){while(--_0x2e6360){_0x4b6c8a['push'](_0x4b6c8a['shift']());}};_0x13db07(++_0x4df030);}(_0x5f00,0x1ca));var _0x05f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f00[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x05f0('0x0'));exports['createContact']=function(_0x2eff4e){return function(){_0x2eff4e['campaign']=_0x2eff4e[_0x05f0('0x1')];return client[_0x05f0('0x2')]('CreateCmHopperFinal',{'body':_0x2eff4e,'log':_0x05f0('0x3')});};};
\ No newline at end of file
index 63549c2..ab24d7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfadf=['ivr','../client','moment','createHistory','Request','CreateCmHopperHistory','AvgHandleTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf','day','endOf','queue','GetVoiceQueueHopperHistory','GetCampaignHopperHistory'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xfadf,0x145));var _0xffad=function(_0xc73ce6,_0x48ca1c){_0xc73ce6=_0xc73ce6-0x0;var _0x4b8d9f=_0xfadf[_0xc73ce6];return _0x4b8d9f;};'use strict';var client=require(_0xffad('0x0'));var moment=require(_0xffad('0x1'));exports[_0xffad('0x2')]=function(_0x3399b5){return function(){_0x3399b5['campaign']=_0x3399b5['queue'];return client[_0xffad('0x3')](_0xffad('0x4'),{'body':_0x3399b5,'log':_0xffad('0x4')});};};exports['avgHandleTime']=function(_0x1267e4){return function(){return client[_0xffad('0x3')](_0xffad('0x5'),{'options':{'where':{'endtime':{'$between':[moment()[_0xffad('0x6')](_0x1267e4,'minutes')[_0xffad('0x7')](_0xffad('0x8')),moment()[_0xffad('0x7')]('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0xffad('0x9')});};};exports[_0xffad('0xa')]=function(_0x2b5d08){return function(){return client['Request']('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xffad('0xb')](_0xffad('0xc'))[_0xffad('0x7')](_0xffad('0x8')),moment()[_0xffad('0xd')](_0xffad('0xc'))[_0xffad('0x7')](_0xffad('0x8'))]},'campaigntype':_0xffad('0xe')},'raw':![]},'log':_0xffad('0xf')});};};exports['getCampaignHopperHistory']=function(_0x3534cb){return function(){return client[_0xffad('0x3')](_0xffad('0x10'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xffad('0xb')](_0xffad('0xc'))[_0xffad('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xffad('0xd')]('day')['format'](_0xffad('0x8'))]},'campaigntype':_0xffad('0x11')},'raw':![]},'log':_0xffad('0x10')});};};
\ No newline at end of file
+var _0xdf6a=['endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','moment','createHistory','queue','Request','CreateCmHopperHistory','avgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','format','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf','day'];(function(_0x478fa9,_0xcf81ab){var _0x5b19c4=function(_0x219e31){while(--_0x219e31){_0x478fa9['push'](_0x478fa9['shift']());}};_0x5b19c4(++_0xcf81ab);}(_0xdf6a,0xdc));var _0xadf6=function(_0x4b2def,_0x3fb77e){_0x4b2def=_0x4b2def-0x0;var _0x571026=_0xdf6a[_0x4b2def];return _0x571026;};'use strict';var client=require('../client');var moment=require(_0xadf6('0x0'));exports[_0xadf6('0x1')]=function(_0x25eb8d){return function(){_0x25eb8d['campaign']=_0x25eb8d[_0xadf6('0x2')];return client[_0xadf6('0x3')](_0xadf6('0x4'),{'body':_0x25eb8d,'log':_0xadf6('0x4')});};};exports[_0xadf6('0x5')]=function(_0x134184){return function(){return client[_0xadf6('0x3')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0xadf6('0x6')](_0x134184,_0xadf6('0x7'))['format'](_0xadf6('0x8')),moment()[_0xadf6('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0xadf6('0xa')});};};exports[_0xadf6('0xb')]=function(_0x15eb3e){return function(){return client[_0xadf6('0x3')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xadf6('0xc')](_0xadf6('0xd'))[_0xadf6('0x9')](_0xadf6('0x8')),moment()[_0xadf6('0xe')](_0xadf6('0xd'))[_0xadf6('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xadf6('0x2')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0xadf6('0xf')]=function(_0x1bade9){return function(){return client[_0xadf6('0x3')](_0xadf6('0x10'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xadf6('0xc')](_0xadf6('0xd'))['format'](_0xadf6('0x8')),moment()['endOf'](_0xadf6('0xd'))[_0xadf6('0x9')](_0xadf6('0x8'))]},'campaigntype':_0xadf6('0x11')},'raw':![]},'log':_0xadf6('0x10')});};};
\ No newline at end of file
index d1a2a7a..9ad677e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c4a=['ListId','key','Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','name','description','ecm','headerinfo','minrate','modem','gateway','tech'];(function(_0x1b3e85,_0x3c9fe8){var _0x1c8379=function(_0x4fa819){while(--_0x4fa819){_0x1b3e85['push'](_0x1b3e85['shift']());}};_0x1c8379(++_0x3c9fe8);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x1a8c08,_0xf283e6){_0x1a8c08=_0x1a8c08-0x0;var _0x360aeb=_0x4c4a[_0x1a8c08];return _0x360aeb;};'use strict';var client=require(_0xa4c4('0x0'));exports[_0xa4c4('0x1')]=function(){return function(){return client[_0xa4c4('0x2')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0xa4c4('0x3'),_0xa4c4('0x4'),_0xa4c4('0x5'),_0xa4c4('0x6'),'localstationid',_0xa4c4('0x7'),'maxrate',_0xa4c4('0x8'),_0xa4c4('0x9'),'faxdetect','t38timeout',_0xa4c4('0xa'),'TrunkId',_0xa4c4('0xb'),_0xa4c4('0xc')],'include':[{'model':_0xa4c4('0xd'),'as':'Trunk','attributes':['id','name',_0xa4c4('0xe'),_0xa4c4('0xf')]}]},'log':_0xa4c4('0x10')});};};exports[_0xa4c4('0x11')]=function(_0x1bd3d2,_0x54588b){return client[_0xa4c4('0x2')]('NotifyFaxAccount',{'account':{'id':_0x1bd3d2},'body':_0x54588b,'log':_0xa4c4('0x12')});};
\ No newline at end of file
+var _0x84c6=['ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','Trunk','callerid','getFaxAccount','notify','Request','GetFaxAccount','name'];(function(_0x471f2c,_0xdb832b){var _0x56bf4d=function(_0x198c57){while(--_0x198c57){_0x471f2c['push'](_0x471f2c['shift']());}};_0x56bf4d(++_0xdb832b);}(_0x84c6,0xe7));var _0x684c=function(_0x4662be,_0x506d6d){_0x4662be=_0x4662be-0x0;var _0x4c4e07=_0x84c6[_0x4662be];return _0x4c4e07;};'use strict';var client=require('../client');exports['getFaxAccounts']=function(){return function(){return client[_0x684c('0x0')](_0x684c('0x1'),{'options':{'raw':![],'attributes':['id',_0x684c('0x2'),'description',_0x684c('0x3'),'headerinfo',_0x684c('0x4'),_0x684c('0x5'),_0x684c('0x6'),_0x684c('0x7'),_0x684c('0x8'),_0x684c('0x9'),_0x684c('0xa'),_0x684c('0xb'),_0x684c('0xc'),_0x684c('0xd'),'key'],'include':[{'model':_0x684c('0xe'),'as':_0x684c('0xe'),'attributes':['id','name',_0x684c('0xf'),'active']}]},'log':_0x684c('0x10')});};};exports[_0x684c('0x11')]=function(_0x25af75,_0x29d5a8){return client[_0x684c('0x0')]('NotifyFaxAccount',{'account':{'id':_0x25af75},'body':_0x29d5a8,'log':'NotifyFaxAccount'});};
\ No newline at end of file
index 54cfc35..fc27f3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a53=['Request','UpdateFaxMessage','update'];(function(_0x4a3dfc,_0x1d71d4){var _0x3268c9=function(_0x5e0019){while(--_0x5e0019){_0x4a3dfc['push'](_0x4a3dfc['shift']());}};_0x3268c9(++_0x1d71d4);}(_0x1a53,0xb6));var _0x31a5=function(_0x3661a3,_0x20b177){_0x3661a3=_0x3661a3-0x0;var _0x463e3f=_0x1a53[_0x3661a3];return _0x463e3f;};'use strict';var client=require('../client');exports[_0x31a5('0x0')]=function(_0x4aa84d,_0x45d54b){return client[_0x31a5('0x1')](_0x31a5('0x2'),{'body':_0x45d54b,'options':{'where':{'AttachmentId':_0x4aa84d}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0x3bc1=['UpdateFaxMessage','update','Request'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x3bc1,0xdf));var _0x13bc=function(_0x26fb3a,_0x891727){_0x26fb3a=_0x26fb3a-0x0;var _0x5b67d1=_0x3bc1[_0x26fb3a];return _0x5b67d1;};'use strict';var client=require('../client');exports[_0x13bc('0x0')]=function(_0xf9952c,_0x3f22f9){return client[_0x13bc('0x1')](_0x13bc('0x2'),{'body':_0x3f22f9,'options':{'where':{'AttachmentId':_0xf9952c}},'log':_0x13bc('0x2')});};
\ No newline at end of file
index fdc99a1..a4b83d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f82=['serverUrl','DeskConfiguration','DeskField','Subjects','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','Tag','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','type'];(function(_0x16893b,_0x5b36be){var _0x15b7f6=function(_0x15aeec){while(--_0x15aeec){_0x16893b['push'](_0x16893b['shift']());}};_0x15b7f6(++_0x5b36be);}(_0x4f82,0xfa));var _0x24f8=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4f82[_0x465a0c];return _0x1e202e;};'use strict';var client=require('../../client');exports[_0x24f8('0x0')]=function(){return function(_0x3a1109){return client[_0x24f8('0x1')](_0x24f8('0x2'),{'options':{'raw':![],'attributes':['id',_0x24f8('0x3'),_0x24f8('0x4'),_0x24f8('0x5'),_0x24f8('0x6'),_0x24f8('0x7'),_0x24f8('0x8'),_0x24f8('0x9'),_0x24f8('0xa')],'include':[{'model':_0x24f8('0xb'),'as':'Configurations','attributes':['id',_0x24f8('0x3')],'include':[{'model':_0x24f8('0xc'),'as':_0x24f8('0xd'),'attributes':['id','type',_0x24f8('0xe'),_0x24f8('0xf')],'include':[{'model':_0x24f8('0x10'),'as':_0x24f8('0x10'),'attributes':['id',_0x24f8('0x3')]}]},{'model':'DeskField','as':_0x24f8('0x11'),'attributes':['id',_0x24f8('0x9'),_0x24f8('0xe'),_0x24f8('0x12'),_0x24f8('0x13'),_0x24f8('0x14'),_0x24f8('0xf')],'include':[{'model':_0x24f8('0x10'),'as':_0x24f8('0x10'),'attributes':['id',_0x24f8('0x3')]}]},{'model':_0x24f8('0xc'),'as':_0x24f8('0x15'),'attributes':['id',_0x24f8('0x9'),_0x24f8('0xe'),_0x24f8('0x16'),_0x24f8('0x17'),_0x24f8('0x18'),_0x24f8('0xf')],'include':[{'model':_0x24f8('0x10'),'as':'Variable','attributes':['id',_0x24f8('0x3')]}]},{'model':_0x24f8('0x19'),'as':'Tags','attributes':['id',_0x24f8('0x3')]}]}]},'log':_0x24f8('0x2')});};};
\ No newline at end of file
+var _0xaeb4=['type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','nameField','Tags','GetDeskAccount','getDeskAccounts','name','description','username','remoteUri'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xaeb4,0x119));var _0x4aeb=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xaeb4[_0x36ed3c];return _0x52a2e0;};'use strict';var client=require('../../client');exports[_0x4aeb('0x0')]=function(){return function(_0x4023f2){return client['Request']('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x4aeb('0x1'),_0x4aeb('0x2'),_0x4aeb('0x3'),'password',_0x4aeb('0x4'),'authType',_0x4aeb('0x5'),_0x4aeb('0x6')],'include':[{'model':_0x4aeb('0x7'),'as':_0x4aeb('0x8'),'attributes':['id','name'],'include':[{'model':_0x4aeb('0x9'),'as':_0x4aeb('0xa'),'attributes':['id',_0x4aeb('0x5'),_0x4aeb('0xb'),_0x4aeb('0xc')],'include':[{'model':_0x4aeb('0xd'),'as':_0x4aeb('0xd'),'attributes':['id',_0x4aeb('0x1')]}]},{'model':_0x4aeb('0x9'),'as':_0x4aeb('0xe'),'attributes':['id',_0x4aeb('0x5'),_0x4aeb('0xb'),_0x4aeb('0xf'),_0x4aeb('0x10'),_0x4aeb('0x11'),_0x4aeb('0xc')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x4aeb('0x1')]}]},{'model':'DeskField','as':_0x4aeb('0x12'),'attributes':['id',_0x4aeb('0x5'),'content','idField',_0x4aeb('0x13'),'customField','variableName'],'include':[{'model':_0x4aeb('0xd'),'as':_0x4aeb('0xd'),'attributes':['id','name']}]},{'model':'Tag','as':_0x4aeb('0x14'),'attributes':['id','name']}]}]},'log':_0x4aeb('0x15')});};};
\ No newline at end of file
index d2e2ee1..a7550e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34dc=['type','Variable','Descriptions','content','key','keyType','variableName','Fields','idField','nameField','customField','GetDynamics365Account','getDynamics365Accounts','Request','name','username','password','remoteUri','tenantId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','ticketType','Dynamics365Field'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0x34dc,0x110));var _0xc34d=function(_0x57ed76,_0x3d0ac9){_0x57ed76=_0x57ed76-0x0;var _0x1e852b=_0x34dc[_0x57ed76];return _0x1e852b;};'use strict';var client=require('../../client');exports[_0xc34d('0x0')]=function(){return function(_0x222527){return client[_0xc34d('0x1')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0xc34d('0x2'),_0xc34d('0x3'),_0xc34d('0x4'),_0xc34d('0x5'),_0xc34d('0x6'),'clientId',_0xc34d('0x7'),_0xc34d('0x8'),_0xc34d('0x9')],'include':[{'model':_0xc34d('0xa'),'as':_0xc34d('0xb'),'attributes':['id','name',_0xc34d('0xc')],'include':[{'model':_0xc34d('0xd'),'as':'Subjects','attributes':['id',_0xc34d('0xe'),'content','variableName'],'include':[{'model':_0xc34d('0xf'),'as':_0xc34d('0xf'),'attributes':['id',_0xc34d('0x2')]}]},{'model':_0xc34d('0xd'),'as':_0xc34d('0x10'),'attributes':['id',_0xc34d('0xe'),_0xc34d('0x11'),_0xc34d('0x12'),_0xc34d('0x13'),'keyContent',_0xc34d('0x14')],'include':[{'model':_0xc34d('0xf'),'as':_0xc34d('0xf'),'attributes':['id',_0xc34d('0x2')]}]},{'model':'Dynamics365Field','as':_0xc34d('0x15'),'attributes':['id',_0xc34d('0xe'),'content',_0xc34d('0x16'),_0xc34d('0x17'),_0xc34d('0x18'),_0xc34d('0x14')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xc34d('0x2')]}]}]}]},'log':_0xc34d('0x19')});};};
\ No newline at end of file
+var _0x8a1e=['clientSecret','serverUrl','Dynamics365Configuration','Configurations','ticketType','Subjects','type','content','variableName','Variable','key','keyType','Dynamics365Field','Fields','idField','nameField','customField','../../client','getDynamics365Accounts','Request','GetDynamics365Account','name','username','password','clientId'];(function(_0x311759,_0x3f6680){var _0x595844=function(_0x401533){while(--_0x401533){_0x311759['push'](_0x311759['shift']());}};_0x595844(++_0x3f6680);}(_0x8a1e,0xc0));var _0xe8a1=function(_0x114fa7,_0x13c005){_0x114fa7=_0x114fa7-0x0;var _0x54815d=_0x8a1e[_0x114fa7];return _0x54815d;};'use strict';var client=require(_0xe8a1('0x0'));exports[_0xe8a1('0x1')]=function(){return function(_0x692a93){return client[_0xe8a1('0x2')](_0xe8a1('0x3'),{'options':{'raw':![],'attributes':['id',_0xe8a1('0x4'),_0xe8a1('0x5'),_0xe8a1('0x6'),'remoteUri','tenantId',_0xe8a1('0x7'),_0xe8a1('0x8'),_0xe8a1('0x9'),'description'],'include':[{'model':_0xe8a1('0xa'),'as':_0xe8a1('0xb'),'attributes':['id',_0xe8a1('0x4'),_0xe8a1('0xc')],'include':[{'model':'Dynamics365Field','as':_0xe8a1('0xd'),'attributes':['id',_0xe8a1('0xe'),_0xe8a1('0xf'),_0xe8a1('0x10')],'include':[{'model':_0xe8a1('0x11'),'as':'Variable','attributes':['id',_0xe8a1('0x4')]}]},{'model':'Dynamics365Field','as':'Descriptions','attributes':['id',_0xe8a1('0xe'),_0xe8a1('0xf'),_0xe8a1('0x12'),_0xe8a1('0x13'),'keyContent','variableName'],'include':[{'model':_0xe8a1('0x11'),'as':_0xe8a1('0x11'),'attributes':['id',_0xe8a1('0x4')]}]},{'model':_0xe8a1('0x14'),'as':_0xe8a1('0x15'),'attributes':['id',_0xe8a1('0xe'),_0xe8a1('0xf'),_0xe8a1('0x16'),_0xe8a1('0x17'),_0xe8a1('0x18'),_0xe8a1('0x10')],'include':[{'model':_0xe8a1('0x11'),'as':_0xe8a1('0x11'),'attributes':['id',_0xe8a1('0x4')]}]}]}]},'log':_0xe8a1('0x3')});};};
\ No newline at end of file
index 8978ff5..5547dd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fee=['keyContent','Variable','idField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','apiKey','remoteUri','serverUrl','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName'];(function(_0x532764,_0x133e88){var _0x92bb38=function(_0x39ad18){while(--_0x39ad18){_0x532764['push'](_0x532764['shift']());}};_0x92bb38(++_0x133e88);}(_0x7fee,0x1a6));var _0xe7fe=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x7fee[_0x223461];return _0x4dbe0a;};'use strict';var client=require(_0xe7fe('0x0'));exports[_0xe7fe('0x1')]=function(){return function(_0x2a117c){return client[_0xe7fe('0x2')](_0xe7fe('0x3'),{'options':{'raw':![],'attributes':['id',_0xe7fe('0x4'),'username',_0xe7fe('0x5'),_0xe7fe('0x6'),_0xe7fe('0x7')],'include':[{'model':'FreshdeskConfiguration','as':_0xe7fe('0x8'),'attributes':['id','name'],'include':[{'model':_0xe7fe('0x9'),'attributes':['id',_0xe7fe('0x4')]},{'model':_0xe7fe('0xa'),'as':_0xe7fe('0xb'),'attributes':['id',_0xe7fe('0xc'),_0xe7fe('0xd'),_0xe7fe('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0xe7fe('0xa'),'as':'Descriptions','attributes':['id',_0xe7fe('0xc'),_0xe7fe('0xd'),'key','keyType',_0xe7fe('0xf'),_0xe7fe('0xe')],'include':[{'model':'Variable','as':_0xe7fe('0x10'),'attributes':['id',_0xe7fe('0x4')]}]},{'model':_0xe7fe('0xa'),'as':'Fields','attributes':['id',_0xe7fe('0xc'),_0xe7fe('0xd'),_0xe7fe('0x11'),'nameField',_0xe7fe('0x12'),_0xe7fe('0xe')],'include':[{'model':_0xe7fe('0x10'),'as':_0xe7fe('0x10'),'attributes':['id',_0xe7fe('0x4')]}]}]}]},'log':_0xe7fe('0x3')});};};
\ No newline at end of file
+var _0xa596=['idField','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Tag','FreshdeskField','Subjects','type','variableName','Variable','Descriptions','content','keyType','keyContent','Fields'];(function(_0x45567f,_0x8d2f0b){var _0x38e662=function(_0x15fbcb){while(--_0x15fbcb){_0x45567f['push'](_0x45567f['shift']());}};_0x38e662(++_0x8d2f0b);}(_0xa596,0x7b));var _0x6a59=function(_0x434e3f,_0x22c5f0){_0x434e3f=_0x434e3f-0x0;var _0x83e63c=_0xa596[_0x434e3f];return _0x83e63c;};'use strict';var client=require(_0x6a59('0x0'));exports[_0x6a59('0x1')]=function(){return function(_0x5b127f){return client[_0x6a59('0x2')](_0x6a59('0x3'),{'options':{'raw':![],'attributes':['id',_0x6a59('0x4'),_0x6a59('0x5'),_0x6a59('0x6'),_0x6a59('0x7'),_0x6a59('0x8')],'include':[{'model':_0x6a59('0x9'),'as':'Configurations','attributes':['id',_0x6a59('0x4')],'include':[{'model':_0x6a59('0xa'),'attributes':['id',_0x6a59('0x4')]},{'model':_0x6a59('0xb'),'as':_0x6a59('0xc'),'attributes':['id',_0x6a59('0xd'),'content',_0x6a59('0xe')],'include':[{'model':'Variable','as':_0x6a59('0xf'),'attributes':['id','name']}]},{'model':'FreshdeskField','as':_0x6a59('0x10'),'attributes':['id',_0x6a59('0xd'),_0x6a59('0x11'),'key',_0x6a59('0x12'),_0x6a59('0x13'),'variableName'],'include':[{'model':_0x6a59('0xf'),'as':'Variable','attributes':['id',_0x6a59('0x4')]}]},{'model':_0x6a59('0xb'),'as':_0x6a59('0x14'),'attributes':['id',_0x6a59('0xd'),_0x6a59('0x11'),_0x6a59('0x15'),_0x6a59('0x16'),_0x6a59('0x17'),_0x6a59('0xe')],'include':[{'model':_0x6a59('0xf'),'as':_0x6a59('0xf'),'attributes':['id','name']}]}]}]},'log':_0x6a59('0x3')});};};
\ No newline at end of file
index ead3b75..a8fb461 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69d=['keyContent','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','name','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xf69d,0xd3));var _0xdf69=function(_0x42d97b,_0x232b57){_0x42d97b=_0x42d97b-0x0;var _0x8bca63=_0xf69d[_0x42d97b];return _0x8bca63;};'use strict';var client=require(_0xdf69('0x0'));exports[_0xdf69('0x1')]=function(){return function(_0x32d6ba){return client[_0xdf69('0x2')](_0xdf69('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdf69('0x4'),_0xdf69('0x5'),_0xdf69('0x6'),_0xdf69('0x7')],'include':[{'model':_0xdf69('0x8'),'as':_0xdf69('0x9'),'attributes':['id',_0xdf69('0xa')],'include':[{'model':_0xdf69('0xb'),'as':_0xdf69('0xc'),'attributes':['id',_0xdf69('0xd'),_0xdf69('0xe'),_0xdf69('0xf')],'include':[{'model':_0xdf69('0x10'),'as':_0xdf69('0x10'),'attributes':['id',_0xdf69('0xa')]}]},{'model':_0xdf69('0xb'),'as':_0xdf69('0x11'),'attributes':['id','type',_0xdf69('0xe'),_0xdf69('0x12'),_0xdf69('0x13'),_0xdf69('0x14'),_0xdf69('0xf')],'include':[{'model':_0xdf69('0x10'),'as':'Variable','attributes':['id','name']}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
+var _0x3e24=['getFreshsalesAccounts','Request','GetFreshsalesAccount','username','apiKey','serverUrl','FreshsalesConfiguration','Configurations','name','FreshsalesField','Subjects','type','variableName','Variable','content','keyType','GetFreshsalesccount','../../client'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0x3e24,0x167));var _0x43e2=function(_0x229d39,_0x52ffbd){_0x229d39=_0x229d39-0x0;var _0x282743=_0x3e24[_0x229d39];return _0x282743;};'use strict';var client=require(_0x43e2('0x0'));exports[_0x43e2('0x1')]=function(){return function(_0x760b07){return client[_0x43e2('0x2')](_0x43e2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x43e2('0x4'),_0x43e2('0x5'),'remoteUri',_0x43e2('0x6')],'include':[{'model':_0x43e2('0x7'),'as':_0x43e2('0x8'),'attributes':['id',_0x43e2('0x9')],'include':[{'model':_0x43e2('0xa'),'as':_0x43e2('0xb'),'attributes':['id',_0x43e2('0xc'),'content',_0x43e2('0xd')],'include':[{'model':_0x43e2('0xe'),'as':'Variable','attributes':['id',_0x43e2('0x9')]}]},{'model':_0x43e2('0xa'),'as':'Descriptions','attributes':['id',_0x43e2('0xc'),_0x43e2('0xf'),'key',_0x43e2('0x10'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0x43e2('0xe'),'attributes':['id',_0x43e2('0x9')]}]}]}]},'log':_0x43e2('0x11')});};};
\ No newline at end of file
index f905d59..887ee02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x881e=['Subjects','Variable','SalesforceField','Descriptions','Fields','GetSalesforceAccount','Request','name','password','remoteUri','clientId','clientSecret','serverUrl','type','Configurations','moduleSearch','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead'];(function(_0x39b407,_0x34d797){var _0x325adf=function(_0x3b27e5){while(--_0x3b27e5){_0x39b407['push'](_0x39b407['shift']());}};_0x325adf(++_0x34d797);}(_0x881e,0x146));var _0xe881=function(_0x30749f,_0x49aec6){_0x30749f=_0x30749f-0x0;var _0x5ae840=_0x881e[_0x30749f];return _0x5ae840;};'use strict';var client=require('../../client');exports['getSalesforceAccounts']=function(){return function(_0x4342f6){return client[_0xe881('0x0')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0xe881('0x1'),'username',_0xe881('0x2'),_0xe881('0x3'),_0xe881('0x4'),_0xe881('0x5'),'securityToken',_0xe881('0x6'),_0xe881('0x7')],'include':[{'model':'SalesforceConfiguration','as':_0xe881('0x8'),'attributes':['id',_0xe881('0x1'),_0xe881('0x9'),'moduleCreate','ticketType',_0xe881('0xa'),_0xe881('0xb'),_0xe881('0xc'),_0xe881('0xd')],'include':[{'model':'SalesforceField','as':_0xe881('0xe'),'include':[{'model':'Variable','as':_0xe881('0xf'),'attributes':['id',_0xe881('0x1')]}]},{'model':_0xe881('0x10'),'as':_0xe881('0x11'),'include':[{'model':_0xe881('0xf'),'as':_0xe881('0xf'),'attributes':['id',_0xe881('0x1')]}]},{'model':'SalesforceField','as':_0xe881('0x12'),'include':[{'model':_0xe881('0xf'),'as':_0xe881('0xf'),'attributes':['id','name']}]}]}]},'log':_0xe881('0x13')});};};
\ No newline at end of file
+var _0x9782=['additionalSearchLead','Subjects','Variable','SalesforceField','Descriptions','GetSalesforceAccount','../../client','getSalesforceAccounts','Request','username','password','remoteUri','clientId','clientSecret','securityToken','serverUrl','SalesforceConfiguration','name','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchContact'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x9782,0xf6));var _0x2978=function(_0x2f5e81,_0x49c319){_0x2f5e81=_0x2f5e81-0x0;var _0x5e4f0e=_0x9782[_0x2f5e81];return _0x5e4f0e;};'use strict';var client=require(_0x2978('0x0'));exports[_0x2978('0x1')]=function(){return function(_0x518961){return client[_0x2978('0x2')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id','name',_0x2978('0x3'),_0x2978('0x4'),_0x2978('0x5'),_0x2978('0x6'),_0x2978('0x7'),_0x2978('0x8'),_0x2978('0x9'),'type'],'include':[{'model':_0x2978('0xa'),'as':'Configurations','attributes':['id',_0x2978('0xb'),_0x2978('0xc'),_0x2978('0xd'),_0x2978('0xe'),_0x2978('0xf'),_0x2978('0x10'),_0x2978('0x11'),_0x2978('0x12')],'include':[{'model':'SalesforceField','as':_0x2978('0x13'),'include':[{'model':_0x2978('0x14'),'as':_0x2978('0x14'),'attributes':['id',_0x2978('0xb')]}]},{'model':_0x2978('0x15'),'as':_0x2978('0x16'),'include':[{'model':_0x2978('0x14'),'as':_0x2978('0x14'),'attributes':['id','name']}]},{'model':'SalesforceField','as':'Fields','include':[{'model':'Variable','as':'Variable','attributes':['id',_0x2978('0xb')]}]}]}]},'log':_0x2978('0x17')});};};
\ No newline at end of file
index 0d67023..950232a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['remoteUri','Subjects','type','content','variableName','Variable','ServicenowField','Descriptions','key','keyType','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','GetServicenowAccount','name','description','username','email'];(function(_0x43b5c4,_0x342b51){var _0x18f8e6=function(_0x1e4c10){while(--_0x1e4c10){_0x43b5c4['push'](_0x43b5c4['shift']());}};_0x18f8e6(++_0x342b51);}(_0x31f0,0xb7));var _0x031f=function(_0x1ee1b0,_0x2d34b0){_0x1ee1b0=_0x1ee1b0-0x0;var _0x30b8dd=_0x31f0[_0x1ee1b0];return _0x30b8dd;};'use strict';var client=require(_0x031f('0x0'));exports['getServicenowAccounts']=function(){return function(_0xc4ca54){return client['Request'](_0x031f('0x1'),{'options':{'raw':![],'attributes':['id',_0x031f('0x2'),_0x031f('0x3'),_0x031f('0x4'),'password',_0x031f('0x5'),_0x031f('0x6'),'serverUrl'],'include':[{'model':'ServicenowConfiguration','as':'Configurations','attributes':['id',_0x031f('0x2')],'include':[{'model':'ServicenowField','as':_0x031f('0x7'),'attributes':['id',_0x031f('0x8'),_0x031f('0x9'),_0x031f('0xa')],'include':[{'model':'Variable','as':_0x031f('0xb'),'attributes':['id',_0x031f('0x2')]}]},{'model':_0x031f('0xc'),'as':_0x031f('0xd'),'attributes':['id',_0x031f('0x8'),_0x031f('0x9'),_0x031f('0xe'),_0x031f('0xf'),'keyContent',_0x031f('0xa')],'include':[{'model':_0x031f('0xb'),'as':_0x031f('0xb'),'attributes':['id',_0x031f('0x2')]}]},{'model':_0x031f('0xc'),'as':_0x031f('0x10'),'attributes':['id',_0x031f('0x8'),'content',_0x031f('0x11'),_0x031f('0x12'),_0x031f('0x13'),_0x031f('0xa')],'include':[{'model':_0x031f('0xb'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x031f('0x14')});};};
\ No newline at end of file
+var _0x0295=['name','content','Variable','Descriptions','type','keyType','keyContent','variableName','idField','nameField','customField','GetServicenowkAccount','../../client','Request','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations'];(function(_0x551f70,_0x21460e){var _0x1de80d=function(_0x140510){while(--_0x140510){_0x551f70['push'](_0x551f70['shift']());}};_0x1de80d(++_0x21460e);}(_0x0295,0x1f0));var _0x5029=function(_0x299d27,_0x4cbc19){_0x299d27=_0x299d27-0x0;var _0x5692a1=_0x0295[_0x299d27];return _0x5692a1;};'use strict';var client=require(_0x5029('0x0'));exports['getServicenowAccounts']=function(){return function(_0x5e71d0){return client[_0x5029('0x1')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id','name',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7')],'include':[{'model':_0x5029('0x8'),'as':_0x5029('0x9'),'attributes':['id',_0x5029('0xa')],'include':[{'model':'ServicenowField','as':'Subjects','attributes':['id','type',_0x5029('0xb'),'variableName'],'include':[{'model':_0x5029('0xc'),'as':'Variable','attributes':['id',_0x5029('0xa')]}]},{'model':'ServicenowField','as':_0x5029('0xd'),'attributes':['id',_0x5029('0xe'),_0x5029('0xb'),'key',_0x5029('0xf'),_0x5029('0x10'),_0x5029('0x11')],'include':[{'model':'Variable','as':_0x5029('0xc'),'attributes':['id',_0x5029('0xa')]}]},{'model':'ServicenowField','as':'Fields','attributes':['id','type','content',_0x5029('0x12'),_0x5029('0x13'),_0x5029('0x14'),_0x5029('0x11')],'include':[{'model':_0x5029('0xc'),'as':_0x5029('0xc'),'attributes':['id',_0x5029('0xa')]}]}]}]},'log':_0x5029('0x15')});};};
\ No newline at end of file
index 50de1ff..7a10120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0x424329,_0x1a3e61){var _0x324625=function(_0x3e2ce2){while(--_0x3e2ce2){_0x424329['push'](_0x424329['shift']());}};_0x324625(++_0x1a3e61);}(_0xda2d,0x102));var _0xdda2=function(_0x5c3585,_0x14dbd3){_0x5c3585=_0x5c3585-0x0;var _0x219614=_0xda2d[_0x5c3585];return _0x219614;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
+var _0x1967=['serverUrl','SugarcrmConfiguration','SugarcrmField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','remoteUri'];(function(_0x496de0,_0x371e30){var _0x26d18c=function(_0x195718){while(--_0x195718){_0x496de0['push'](_0x496de0['shift']());}};_0x26d18c(++_0x371e30);}(_0x1967,0x173));var _0x7196=function(_0x2719b9,_0x48f502){_0x2719b9=_0x2719b9-0x0;var _0x2f60c2=_0x1967[_0x2719b9];return _0x2f60c2;};'use strict';var client=require('../../client');exports[_0x7196('0x0')]=function(){return function(_0xdb72bb){return client[_0x7196('0x1')](_0x7196('0x2'),{'options':{'raw':![],'attributes':['id',_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7')],'include':[{'model':_0x7196('0x8'),'as':'Configurations','attributes':['id',_0x7196('0x3')],'include':[{'model':_0x7196('0x9'),'as':_0x7196('0xa'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd')],'include':[{'model':'Variable','as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0xb'),'content','key',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0x9'),'as':_0x7196('0x12'),'attributes':['id',_0x7196('0xb'),_0x7196('0xc'),_0x7196('0x13'),'nameField',_0x7196('0x14'),_0x7196('0xd')],'include':[{'model':_0x7196('0xe'),'as':_0x7196('0xe'),'attributes':['id','name']}]}]}]},'log':_0x7196('0x2')});};};
\ No newline at end of file
index 6e6344d..c936c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0e0=['Subjects','type','content','Variable','Descriptions','key','keyContent','variableName','Fields','nameField','customField','../../client','getVtigerAccounts','GetVtigerAccount','description','username','accessKey','remoteUri','VtigerConfiguration','Configurations','name','VtigerField'];(function(_0x8a10f5,_0xec92f3){var _0x446f82=function(_0x2f17b4){while(--_0x2f17b4){_0x8a10f5['push'](_0x8a10f5['shift']());}};_0x446f82(++_0xec92f3);}(_0xa0e0,0x16b));var _0x0a0e=function(_0x467279,_0x689afb){_0x467279=_0x467279-0x0;var _0x163868=_0xa0e0[_0x467279];return _0x163868;};'use strict';var client=require(_0x0a0e('0x0'));exports[_0x0a0e('0x1')]=function(){return function(_0x34ea43){return client['Request'](_0x0a0e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a0e('0x3'),_0x0a0e('0x4'),_0x0a0e('0x5'),_0x0a0e('0x6'),'serverUrl'],'include':[{'model':_0x0a0e('0x7'),'as':_0x0a0e('0x8'),'attributes':['id',_0x0a0e('0x9')],'include':[{'model':_0x0a0e('0xa'),'as':_0x0a0e('0xb'),'attributes':['id',_0x0a0e('0xc'),_0x0a0e('0xd'),'variableName'],'include':[{'model':'Variable','as':_0x0a0e('0xe'),'attributes':['id',_0x0a0e('0x9')]}]},{'model':_0x0a0e('0xa'),'as':_0x0a0e('0xf'),'attributes':['id',_0x0a0e('0xc'),_0x0a0e('0xd'),_0x0a0e('0x10'),'keyType',_0x0a0e('0x11'),_0x0a0e('0x12')],'include':[{'model':_0x0a0e('0xe'),'as':_0x0a0e('0xe'),'attributes':['id',_0x0a0e('0x9')]}]},{'model':_0x0a0e('0xa'),'as':_0x0a0e('0x13'),'attributes':['id',_0x0a0e('0xc'),_0x0a0e('0xd'),'idField',_0x0a0e('0x14'),_0x0a0e('0x15'),_0x0a0e('0x12')],'include':[{'model':_0x0a0e('0xe'),'as':_0x0a0e('0xe'),'attributes':['id',_0x0a0e('0x9')]}]}]}]},'log':_0x0a0e('0x2')});};};
\ No newline at end of file
+var _0x7bc1=['nameField','customField','variableName','../../client','getVtigerAccounts','Request','GetVtigerAccount','description','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','VtigerField','Subjects','Variable','name','Descriptions','type','content','key','keyContent','Fields','idField'];(function(_0x4d6fa6,_0x1a16ce){var _0x10c8c6=function(_0x242303){while(--_0x242303){_0x4d6fa6['push'](_0x4d6fa6['shift']());}};_0x10c8c6(++_0x1a16ce);}(_0x7bc1,0xab));var _0x17bc=function(_0x247932,_0x11c953){_0x247932=_0x247932-0x0;var _0x47cc0b=_0x7bc1[_0x247932];return _0x47cc0b;};'use strict';var client=require(_0x17bc('0x0'));exports[_0x17bc('0x1')]=function(){return function(_0x4ba929){return client[_0x17bc('0x2')](_0x17bc('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x17bc('0x4'),_0x17bc('0x5'),_0x17bc('0x6'),_0x17bc('0x7'),_0x17bc('0x8')],'include':[{'model':_0x17bc('0x9'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0x17bc('0xa'),'as':_0x17bc('0xb'),'attributes':['id','type','content','variableName'],'include':[{'model':'Variable','as':_0x17bc('0xc'),'attributes':['id',_0x17bc('0xd')]}]},{'model':_0x17bc('0xa'),'as':_0x17bc('0xe'),'attributes':['id',_0x17bc('0xf'),_0x17bc('0x10'),_0x17bc('0x11'),'keyType',_0x17bc('0x12'),'variableName'],'include':[{'model':'Variable','as':_0x17bc('0xc'),'attributes':['id',_0x17bc('0xd')]}]},{'model':'VtigerField','as':_0x17bc('0x13'),'attributes':['id','type',_0x17bc('0x10'),_0x17bc('0x14'),_0x17bc('0x15'),_0x17bc('0x16'),_0x17bc('0x17')],'include':[{'model':_0x17bc('0xc'),'as':_0x17bc('0xc'),'attributes':['id',_0x17bc('0xd')]}]}]}]},'log':_0x17bc('0x3')});};};
\ No newline at end of file
index cacaf26..bcec7f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11d8=['../../client','Request','name','username','password','token','remoteUri','serverUrl','type','Configurations','variableName','Variable','ZendeskField','content','key','keyType','keyContent','Fields','idField','nameField','customField','GetZendeskAccount'];(function(_0x456bba,_0x2dac38){var _0x1ddb0a=function(_0x2f8648){while(--_0x2f8648){_0x456bba['push'](_0x456bba['shift']());}};_0x1ddb0a(++_0x2dac38);}(_0x11d8,0x108));var _0x811d=function(_0x1762d,_0x3976d6){_0x1762d=_0x1762d-0x0;var _0x390ff0=_0x11d8[_0x1762d];return _0x390ff0;};'use strict';var client=require(_0x811d('0x0'));exports['getZendeskAccounts']=function(){return function(_0x3283f8){return client[_0x811d('0x1')]('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0x811d('0x2'),_0x811d('0x3'),_0x811d('0x4'),_0x811d('0x5'),_0x811d('0x6'),'authType',_0x811d('0x7'),_0x811d('0x8')],'include':[{'model':'ZendeskConfiguration','as':_0x811d('0x9'),'attributes':['id','name'],'include':[{'model':'Tag','attributes':['id',_0x811d('0x2')]},{'model':'ZendeskField','as':'Subjects','attributes':['id',_0x811d('0x8'),'content',_0x811d('0xa')],'include':[{'model':_0x811d('0xb'),'as':_0x811d('0xb'),'attributes':['id',_0x811d('0x2')]}]},{'model':_0x811d('0xc'),'as':'Descriptions','attributes':['id','type',_0x811d('0xd'),_0x811d('0xe'),_0x811d('0xf'),_0x811d('0x10'),_0x811d('0xa')],'include':[{'model':_0x811d('0xb'),'as':_0x811d('0xb'),'attributes':['id','name']}]},{'model':'ZendeskField','as':_0x811d('0x11'),'attributes':['id',_0x811d('0x8'),_0x811d('0xd'),_0x811d('0x12'),_0x811d('0x13'),_0x811d('0x14'),_0x811d('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x811d('0x2')]}]}]}]},'log':_0x811d('0x15')});};};
\ No newline at end of file
+var _0xf16d=['password','token','remoteUri','authType','type','ZendeskConfiguration','Subjects','content','Variable','Descriptions','key','keyType','keyContent','variableName','ZendeskField','Fields','customField','GetZendeskAccount','getZendeskAccounts','name','username'];(function(_0x28174e,_0x4c7533){var _0x2f0cf9=function(_0x36e562){while(--_0x36e562){_0x28174e['push'](_0x28174e['shift']());}};_0x2f0cf9(++_0x4c7533);}(_0xf16d,0x66));var _0xdf16=function(_0x1f539b,_0x1fb8ed){_0x1f539b=_0x1f539b-0x0;var _0x1ca404=_0xf16d[_0x1f539b];return _0x1ca404;};'use strict';var client=require('../../client');exports[_0xdf16('0x0')]=function(){return function(_0xdc397a){return client['Request']('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0xdf16('0x1'),_0xdf16('0x2'),_0xdf16('0x3'),_0xdf16('0x4'),_0xdf16('0x5'),_0xdf16('0x6'),'serverUrl',_0xdf16('0x7')],'include':[{'model':_0xdf16('0x8'),'as':'Configurations','attributes':['id',_0xdf16('0x1')],'include':[{'model':'Tag','attributes':['id','name']},{'model':'ZendeskField','as':_0xdf16('0x9'),'attributes':['id',_0xdf16('0x7'),_0xdf16('0xa'),'variableName'],'include':[{'model':_0xdf16('0xb'),'as':_0xdf16('0xb'),'attributes':['id',_0xdf16('0x1')]}]},{'model':'ZendeskField','as':_0xdf16('0xc'),'attributes':['id','type',_0xdf16('0xa'),_0xdf16('0xd'),_0xdf16('0xe'),_0xdf16('0xf'),_0xdf16('0x10')],'include':[{'model':'Variable','as':_0xdf16('0xb'),'attributes':['id',_0xdf16('0x1')]}]},{'model':_0xdf16('0x11'),'as':_0xdf16('0x12'),'attributes':['id',_0xdf16('0x7'),'content','idField','nameField',_0xdf16('0x13'),_0xdf16('0x10')],'include':[{'model':'Variable','as':_0xdf16('0xb'),'attributes':['id',_0xdf16('0x1')]}]}]}]},'log':_0xdf16('0x14')});};};
\ No newline at end of file
index 0a62adb..340c043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e5a=['host','clientSecret','serverUrl','refreshToken','Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','content','variableName','Variable','keyType','keyContent','Fields','type','idField','nameField','GetZohoAccount','getZohoAccounts','Request','name','description'];(function(_0x2ad184,_0x121448){var _0xbc8b66=function(_0x5dc1d4){while(--_0x5dc1d4){_0x2ad184['push'](_0x2ad184['shift']());}};_0xbc8b66(++_0x121448);}(_0x6e5a,0x1c8));var _0xa6e5=function(_0x3337f2,_0x1eeb3c){_0x3337f2=_0x3337f2-0x0;var _0x30e015=_0x6e5a[_0x3337f2];return _0x30e015;};'use strict';var client=require('../../client');exports[_0xa6e5('0x0')]=function(){return function(_0xead8b1){return client[_0xa6e5('0x1')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0xa6e5('0x2'),_0xa6e5('0x3'),_0xa6e5('0x4'),'zone','clientId',_0xa6e5('0x5'),_0xa6e5('0x6'),'code',_0xa6e5('0x7')],'include':[{'model':'ZohoConfiguration','as':_0xa6e5('0x8'),'attributes':['id',_0xa6e5('0x2'),_0xa6e5('0x9'),_0xa6e5('0xa'),_0xa6e5('0x3')],'include':[{'model':_0xa6e5('0xb'),'as':_0xa6e5('0xc'),'attributes':['id','type',_0xa6e5('0xd'),_0xa6e5('0xe')],'include':[{'model':_0xa6e5('0xf'),'as':_0xa6e5('0xf'),'attributes':['id','name']}]},{'model':_0xa6e5('0xb'),'as':'Descriptions','attributes':['id','type',_0xa6e5('0xd'),'key',_0xa6e5('0x10'),_0xa6e5('0x11'),_0xa6e5('0xe')],'include':[{'model':_0xa6e5('0xf'),'as':_0xa6e5('0xf'),'attributes':['id',_0xa6e5('0x2')]}]},{'model':_0xa6e5('0xb'),'as':_0xa6e5('0x12'),'attributes':['id',_0xa6e5('0x13'),_0xa6e5('0xd'),_0xa6e5('0x14'),_0xa6e5('0x15'),'customField',_0xa6e5('0xe')],'include':[{'model':_0xa6e5('0xf'),'as':_0xa6e5('0xf'),'attributes':['id',_0xa6e5('0x2')]}]}]}]},'log':_0xa6e5('0x16')});};};
\ No newline at end of file
+var _0xc33f=['Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','type','variableName','Variable','Descriptions','content','keyType','keyContent','Fields','idField','../../client','Request','GetZohoAccount','name','description','host','zone','clientSecret','code','refreshToken'];(function(_0x1cd849,_0x23980c){var _0x4baf46=function(_0x2e508f){while(--_0x2e508f){_0x1cd849['push'](_0x1cd849['shift']());}};_0x4baf46(++_0x23980c);}(_0xc33f,0x6e));var _0xfc33=function(_0x58ccec,_0x176ed2){_0x58ccec=_0x58ccec-0x0;var _0x33e59a=_0xc33f[_0x58ccec];return _0x33e59a;};'use strict';var client=require(_0xfc33('0x0'));exports['getZohoAccounts']=function(){return function(_0x403e3b){return client[_0xfc33('0x1')](_0xfc33('0x2'),{'options':{'raw':![],'attributes':['id',_0xfc33('0x3'),_0xfc33('0x4'),_0xfc33('0x5'),_0xfc33('0x6'),'clientId',_0xfc33('0x7'),'serverUrl',_0xfc33('0x8'),_0xfc33('0x9')],'include':[{'model':'ZohoConfiguration','as':_0xfc33('0xa'),'attributes':['id','name',_0xfc33('0xb'),_0xfc33('0xc'),_0xfc33('0x4')],'include':[{'model':_0xfc33('0xd'),'as':_0xfc33('0xe'),'attributes':['id',_0xfc33('0xf'),'content',_0xfc33('0x10')],'include':[{'model':_0xfc33('0x11'),'as':_0xfc33('0x11'),'attributes':['id',_0xfc33('0x3')]}]},{'model':_0xfc33('0xd'),'as':_0xfc33('0x12'),'attributes':['id',_0xfc33('0xf'),_0xfc33('0x13'),'key',_0xfc33('0x14'),_0xfc33('0x15'),'variableName'],'include':[{'model':'Variable','as':_0xfc33('0x11'),'attributes':['id',_0xfc33('0x3')]}]},{'model':_0xfc33('0xd'),'as':_0xfc33('0x16'),'attributes':['id',_0xfc33('0xf'),_0xfc33('0x13'),_0xfc33('0x17'),'nameField','customField',_0xfc33('0x10')],'include':[{'model':_0xfc33('0x11'),'as':_0xfc33('0x11'),'attributes':['id',_0xfc33('0x3')]}]}]}]},'log':_0xfc33('0x2')});};};
\ No newline at end of file
index d2e011d..d03b2a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd82b=['toNumber','uniqueid','voiceDialReport','voice','membername','starttime','endtime','outbound','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','SIP/%s','TALKING','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd82b,0xbd));var _0xbd82=function(_0x437d6a,_0x4a45ae){_0x437d6a=_0x437d6a-0x0;var _0x189aed=_0xd82b[_0x437d6a];return _0x189aed;};'use strict';var moment=require(_0xbd82('0x0'));var _=require(_0xbd82('0x1'));var util=require(_0xbd82('0x2'));var client=require(_0xbd82('0x3'));exports[_0xbd82('0x4')]=function(_0x386b6a){var _0x16e35c=_0x386b6a[_0xbd82('0x5')]||_0x386b6a['queuecallerexitAt'];return client[_0xbd82('0x6')](_0xbd82('0x7'),{'body':{'channel':'voice','membername':_0x386b6a[_0xbd82('0x8')],'interface':_[_0xbd82('0x9')](_0x386b6a[_0xbd82('0xa')])?util['format'](_0xbd82('0xb'),_0x386b6a['lastAssignedTo']):_0x386b6a[_0xbd82('0xa')],'type':_0xbd82('0xc'),'enterAt':_0x386b6a['queuecallerleaveAt'],'exitAt':_0x16e35c,'duration':moment(_0x16e35c)[_0xbd82('0xd')](_0x386b6a['queuecallerleaveAt'],_0xbd82('0xe')),'data1':_0xbd82('0xf'),'data2':_0x386b6a[_0xbd82('0x10')],'data3':_0x386b6a[_0xbd82('0x11')],'data4':null,'data5':_0x386b6a[_0xbd82('0x12')],'role':_0xbd82('0x13'),'internal':_0x386b6a[_0xbd82('0x14')]?_[_0xbd82('0x15')](_0x386b6a[_0xbd82('0x14')]):undefined,'uniqueid':_0x386b6a[_0xbd82('0x16')]},'log':_0xbd82('0x7')});};exports[_0xbd82('0x17')]=function(_0x36846b){return client[_0xbd82('0x6')](_0xbd82('0x7'),{'body':{'channel':_0xbd82('0x18'),'membername':_0x36846b[_0xbd82('0x19')],'interface':_0x36846b['interface'],'type':'TALKING','enterAt':_0x36846b[_0xbd82('0x1a')],'exitAt':_0x36846b[_0xbd82('0x1b')],'duration':moment(_0x36846b[_0xbd82('0x1b')])['diff'](_0x36846b[_0xbd82('0x1a')],_0xbd82('0xe'))>=0x0?moment(_0x36846b[_0xbd82('0x1b')])[_0xbd82('0xd')](_0x36846b[_0xbd82('0x1a')],_0xbd82('0xe')):null,'data1':_0xbd82('0x1c'),'data2':_0x36846b[_0xbd82('0x14')],'data3':_0x36846b[_0xbd82('0x11')],'data4':_0x36846b[_0xbd82('0x1d')]||null,'role':_0xbd82('0x13'),'internal':_0x36846b['accountcode']?_[_0xbd82('0x15')](_0x36846b[_0xbd82('0x14')]):undefined,'uniqueid':_0x36846b[_0xbd82('0x16')]},'log':_0xbd82('0x7')});};
\ No newline at end of file
+var _0xbaf8=['inbound','calleridnum','exten','queue','agent','accountcode','CreateMemberReport','membername','starttime','endtime','seconds','outbound','toNumber','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff'];(function(_0x3b5856,_0x13f4f2){var _0x5d3866=function(_0x37a1b9){while(--_0x37a1b9){_0x3b5856['push'](_0x3b5856['shift']());}};_0x5d3866(++_0x13f4f2);}(_0xbaf8,0x193));var _0x8baf=function(_0x37dc21,_0x2bae86){_0x37dc21=_0x37dc21-0x0;var _0x34dc9e=_0xbaf8[_0x37dc21];return _0x34dc9e;};'use strict';var moment=require(_0x8baf('0x0'));var _=require(_0x8baf('0x1'));var util=require(_0x8baf('0x2'));var client=require(_0x8baf('0x3'));exports[_0x8baf('0x4')]=function(_0x1ceeb1){var _0x9f9629=_0x1ceeb1[_0x8baf('0x5')]||_0x1ceeb1[_0x8baf('0x6')];return client[_0x8baf('0x7')]('CreateMemberReport',{'body':{'channel':_0x8baf('0x8'),'membername':_0x1ceeb1[_0x8baf('0x9')],'interface':_[_0x8baf('0xa')](_0x1ceeb1[_0x8baf('0xb')])?util[_0x8baf('0xc')](_0x8baf('0xd'),_0x1ceeb1[_0x8baf('0x9')]):_0x1ceeb1['interface'],'type':_0x8baf('0xe'),'enterAt':_0x1ceeb1[_0x8baf('0xf')],'exitAt':_0x9f9629,'duration':moment(_0x9f9629)[_0x8baf('0x10')](_0x1ceeb1['queuecallerleaveAt'],'seconds'),'data1':_0x8baf('0x11'),'data2':_0x1ceeb1[_0x8baf('0x12')],'data3':_0x1ceeb1[_0x8baf('0x13')],'data4':null,'data5':_0x1ceeb1[_0x8baf('0x14')],'role':_0x8baf('0x15'),'internal':_0x1ceeb1['accountcode']?_['toNumber'](_0x1ceeb1[_0x8baf('0x16')]):undefined,'uniqueid':_0x1ceeb1['uniqueid']},'log':_0x8baf('0x17')});};exports['voiceDialReport']=function(_0x3bc576){return client['Request']('CreateMemberReport',{'body':{'channel':_0x8baf('0x8'),'membername':_0x3bc576[_0x8baf('0x18')],'interface':_0x3bc576[_0x8baf('0xb')],'type':_0x8baf('0xe'),'enterAt':_0x3bc576[_0x8baf('0x19')],'exitAt':_0x3bc576[_0x8baf('0x1a')],'duration':moment(_0x3bc576[_0x8baf('0x1a')])[_0x8baf('0x10')](_0x3bc576[_0x8baf('0x19')],'seconds')>=0x0?moment(_0x3bc576[_0x8baf('0x1a')])[_0x8baf('0x10')](_0x3bc576['starttime'],_0x8baf('0x1b')):null,'data1':_0x8baf('0x1c'),'data2':_0x3bc576[_0x8baf('0x16')],'data3':_0x3bc576[_0x8baf('0x13')],'data4':_0x3bc576['dialstring']||null,'role':_0x8baf('0x15'),'internal':_0x3bc576[_0x8baf('0x16')]?_[_0x8baf('0x1d')](_0x3bc576[_0x8baf('0x16')]):undefined,'uniqueid':_0x3bc576['uniqueid']},'log':_0x8baf('0x17')});};
\ No newline at end of file
index 3d2d7a8..da9e142 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b96=['ShowSetting','GetSettings','Request'];(function(_0x68c4d9,_0x419b3c){var _0x62da93=function(_0x51ae9a){while(--_0x51ae9a){_0x68c4d9['push'](_0x68c4d9['shift']());}};_0x62da93(++_0x419b3c);}(_0x0b96,0xc2));var _0x60b9=function(_0x349a6a,_0x291b2a){_0x349a6a=_0x349a6a-0x0;var _0x3f6577=_0x0b96[_0x349a6a];return _0x3f6577;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x60b9('0x0')](_0x60b9('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x60b9('0x2')});};
\ No newline at end of file
+var _0xceb0=['stopRecordingOnTransfer'];(function(_0x54bcd0,_0x511a7e){var _0x25729f=function(_0xb28f7b){while(--_0xb28f7b){_0x54bcd0['push'](_0x54bcd0['shift']());}};_0x25729f(++_0x511a7e);}(_0xceb0,0x173));var _0x0ceb=function(_0x496727,_0x4faac1){_0x496727=_0x496727-0x0;var _0x2d922f=_0xceb0[_0x496727];return _0x2d922f;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0ceb('0x0')]},'log':'GetSettings'});};
\ No newline at end of file
index 6ab27f2..9008159 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x093c=['../client','Request','GetTemplate'];(function(_0x339595,_0x4c6507){var _0xb435a7=function(_0x5cbbab){while(--_0x5cbbab){_0x339595['push'](_0x339595['shift']());}};_0xb435a7(++_0x4c6507);}(_0x093c,0xde));var _0xc093=function(_0x2b6c91,_0x34c301){_0x2b6c91=_0x2b6c91-0x0;var _0x5a7c40=_0x093c[_0x2b6c91];return _0x5a7c40;};'use strict';var client=require(_0xc093('0x0'));exports['getTemplates']=function(_0x4e2228){return function(_0x22ca2e){return client[_0xc093('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0xc093('0x2')});};};
\ No newline at end of file
+var _0xb286=['GetTemplate','../client','getTemplates'];(function(_0x4b7db1,_0x2ebc27){var _0x107be0=function(_0x4f23c4){while(--_0x4f23c4){_0x4b7db1['push'](_0x4b7db1['shift']());}};_0x107be0(++_0x2ebc27);}(_0xb286,0x151));var _0x6b28=function(_0x419e35,_0x4ccde1){_0x419e35=_0x419e35-0x0;var _0x28b158=_0xb286[_0x419e35];return _0x28b158;};'use strict';var client=require(_0x6b28('0x0'));exports[_0x6b28('0x1')]=function(_0x561c87){return function(_0x503c1c){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x6b28('0x2')});};};
\ No newline at end of file
index 84be252..68db8c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fba=['data2','data4','data5','data7','GetTrigger','../client','getTriggers','Request','name','channel','status','Condition','field','operator','value','Action','Actions','data1'];(function(_0x443bd6,_0x2141a3){var _0x358b4e=function(_0x19bb58){while(--_0x19bb58){_0x443bd6['push'](_0x443bd6['shift']());}};_0x358b4e(++_0x2141a3);}(_0x8fba,0x1eb));var _0xa8fb=function(_0x450147,_0x3c166d){_0x450147=_0x450147-0x0;var _0x2431b1=_0x8fba[_0x450147];return _0x2431b1;};'use strict';var client=require(_0xa8fb('0x0'));exports[_0xa8fb('0x1')]=function(_0x16f8eb){return function(_0x1a5b62){return client[_0xa8fb('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xa8fb('0x3'),_0xa8fb('0x4'),_0xa8fb('0x5')],'include':[{'model':_0xa8fb('0x6'),'as':'AllConditions','attributes':['id',_0xa8fb('0x7'),_0xa8fb('0x8'),'value']},{'model':_0xa8fb('0x6'),'as':'AnyConditions','attributes':['id',_0xa8fb('0x7'),_0xa8fb('0x8'),_0xa8fb('0x9')]},{'model':_0xa8fb('0xa'),'as':_0xa8fb('0xb'),'attributes':['id','action',_0xa8fb('0xc'),_0xa8fb('0xd'),'data3',_0xa8fb('0xe'),_0xa8fb('0xf'),'data6',_0xa8fb('0x10')]}]},'log':_0xa8fb('0x11')});};};
\ No newline at end of file
+var _0x43ce=['action','data1','data2','data3','data4','data5','data6','data7','GetTrigger','../client','getTriggers','Request','Condition','AllConditions','field','operator','AnyConditions','value','Action'];(function(_0x27889f,_0x4809b9){var _0x201713=function(_0x5e5c1e){while(--_0x5e5c1e){_0x27889f['push'](_0x27889f['shift']());}};_0x201713(++_0x4809b9);}(_0x43ce,0x113));var _0xe43c=function(_0x3c8619,_0x331ad2){_0x3c8619=_0x3c8619-0x0;var _0x528d18=_0x43ce[_0x3c8619];return _0x528d18;};'use strict';var client=require(_0xe43c('0x0'));exports[_0xe43c('0x1')]=function(_0x2c1623){return function(_0x56a7d4){return client[_0xe43c('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name','channel','status'],'include':[{'model':_0xe43c('0x3'),'as':_0xe43c('0x4'),'attributes':['id',_0xe43c('0x5'),_0xe43c('0x6'),'value']},{'model':_0xe43c('0x3'),'as':_0xe43c('0x7'),'attributes':['id',_0xe43c('0x5'),'operator',_0xe43c('0x8')]},{'model':_0xe43c('0x9'),'as':'Actions','attributes':['id',_0xe43c('0xa'),_0xe43c('0xb'),_0xe43c('0xc'),_0xe43c('0xd'),_0xe43c('0xe'),_0xe43c('0xf'),_0xe43c('0x10'),_0xe43c('0x11')]}]},'log':_0xe43c('0x12')});};};
\ No newline at end of file
index ff1479c..e5ce418 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032a=['getTrunks','Request','GetTrunk','name','registry','defaultuser'];(function(_0x12bfb0,_0x1a8526){var _0x15faef=function(_0x3f45ce){while(--_0x3f45ce){_0x12bfb0['push'](_0x12bfb0['shift']());}};_0x15faef(++_0x1a8526);}(_0x032a,0xf0));var _0xa032=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0x032a[_0x1ae8ab];return _0x1ad705;};'use strict';var client=require('../client');exports[_0xa032('0x0')]=function(_0x591b65){return function(_0xb3b072){return client[_0xa032('0x1')](_0xa032('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa032('0x3'),_0xa032('0x4'),_0xa032('0x5')]},'log':_0xa032('0x2')});};};
\ No newline at end of file
+var _0x5b26=['../client','Request','GetTrunk','name','registry'];(function(_0x46d6c4,_0x4158fa){var _0x245800=function(_0x4bca44){while(--_0x4bca44){_0x46d6c4['push'](_0x46d6c4['shift']());}};_0x245800(++_0x4158fa);}(_0x5b26,0x172));var _0x65b2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5b26[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x65b2('0x0'));exports['getTrunks']=function(_0x595460){return function(_0x223b70){return client[_0x65b2('0x1')](_0x65b2('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x65b2('0x3'),_0x65b2('0x4'),'defaultuser']},'log':'GetTrunk'});};};
\ No newline at end of file
index fc622b1..9f96fee 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(_0x183e25,_0x2bfe5b){var _0x24e0ac=function(_0x38d43a){while(--_0x38d43a){_0x183e25['push'](_0x183e25['shift']());}};_0x24e0ac(++_0x2bfe5b);}(_0x70e0,0x17b));var _0x070e=function(_0x5521b7,_0x5429f4){_0x5521b7=_0x5521b7-0x0;var _0x7b93f0=_0x70e0[_0x5521b7];return _0x7b93f0;};'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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x2a7acf,_0x2dfca1){var _0x520072=function(_0x5f499f){while(--_0x5f499f){_0x2a7acf['push'](_0x2a7acf['shift']());}};_0x520072(++_0x2dfca1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xcb91[_0x3f6b1b];return _0x4a3d2b;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});};
\ No newline at end of file
index 48bc8ca..899119b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ca6=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x9a13ce,_0x5f2015){var _0x1fe6a5=function(_0x49fabc){while(--_0x49fabc){_0x9a13ce['push'](_0x9a13ce['shift']());}};_0x1fe6a5(++_0x5f2015);}(_0x7ca6,0x1f1));var _0x67ca=function(_0x35b4c0,_0x1bdb9f){_0x35b4c0=_0x35b4c0-0x0;var _0x3c6747=_0x7ca6[_0x35b4c0];return _0x3c6747;};'use strict';var client=require(_0x67ca('0x0'));exports['create']=function(_0xb8eb16){return client[_0x67ca('0x1')](_0x67ca('0x2'),{'body':_0xb8eb16,'log':_0x67ca('0x2')});};exports[_0x67ca('0x3')]=function(_0x2b8a3a,_0x310d66,_0x5be2f9){return client[_0x67ca('0x1')](_0x67ca('0x4'),{'body':_0x2b8a3a,'options':{'where':{'uniqueid':_0x310d66,'interface':_0x5be2f9,'agentcomplete':!![]}},'log':_0x67ca('0x4')});};
\ No newline at end of file
+var _0xae1c=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xae1c,0x18c));var _0xcae1=function(_0x1bbd0a,_0x238ae1){_0x1bbd0a=_0x1bbd0a-0x0;var _0x454b2d=_0xae1c[_0x1bbd0a];return _0x454b2d;};'use strict';var client=require('../client');exports['create']=function(_0x115445){return client[_0xcae1('0x0')](_0xcae1('0x1'),{'body':_0x115445,'log':'CreateVoiceAgentReport'});};exports[_0xcae1('0x2')]=function(_0x5dafd5,_0x5505fa,_0x1243ab){return client[_0xcae1('0x0')](_0xcae1('0x3'),{'body':_0x5dafd5,'options':{'where':{'uniqueid':_0x5505fa,'interface':_0x1243ab,'agentcomplete':!![]}},'log':_0xcae1('0x3')});};
\ No newline at end of file
index c465be8..d67a030 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e1e=['type','disposition','duration','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x37b313,_0x9d327f){var _0xbf91c8=function(_0x12bf5f){while(--_0x12bf5f){_0x37b313['push'](_0x37b313['shift']());}};_0xbf91c8(++_0x9d327f);}(_0x7e1e,0x115));var _0xe7e1=function(_0x53643b,_0x11c9b1){_0x53643b=_0x53643b-0x0;var _0x176c80=_0x7e1e[_0x53643b];return _0x176c80;};'use strict';var moment=require('moment');var util=require(_0xe7e1('0x0'));var _=require(_0xe7e1('0x1'));var client=require(_0xe7e1('0x2'));exports[_0xe7e1('0x3')]=function(_0x2faff3){return client[_0xe7e1('0x4')](_0xe7e1('0x5'),{'body':_[_0xe7e1('0x6')](_0x2faff3,{'source':_0x2faff3[_0xe7e1('0x7')],'destinationcontext':_0x2faff3[_0xe7e1('0x8')],'callerid':_0x2faff3[_0xe7e1('0x9')],'amaflags':_0xe7e1('0xa')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0xe7e1('0x4')](_0xe7e1('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xe7e1('0xc')](_0xe7e1('0xd'))[_0xe7e1('0xe')](_0xe7e1('0xf')),moment()[_0xe7e1('0x10')](_0xe7e1('0xd'))[_0xe7e1('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xe7e1('0x11'),_0xe7e1('0x12'),_0xe7e1('0x13'),'billableseconds']},'log':_0xe7e1('0x14')});};};
\ No newline at end of file
+var _0x83f0=['type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','Request','outbound','day','YYYY-MM-DD\x20HH:mm:ss','format'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x83f0,0xa5));var _0x083f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x83f0[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0x083f('0x0'));var util=require(_0x083f('0x1'));var _=require(_0x083f('0x2'));var client=require(_0x083f('0x3'));exports['create']=function(_0x269eb5){return client['Request'](_0x083f('0x4'),{'body':_[_0x083f('0x5')](_0x269eb5,{'source':_0x269eb5[_0x083f('0x6')],'destinationcontext':_0x269eb5[_0x083f('0x7')],'callerid':_0x269eb5[_0x083f('0x8')],'amaflags':_0x083f('0x9')}),'log':_0x083f('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x083f('0xa')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x083f('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x083f('0xc'))['format'](_0x083f('0xd')),moment()['endOf']('day')[_0x083f('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x083f('0xf'),_0x083f('0x10'),_0x083f('0x11'),_0x083f('0x12')]},'log':_0x083f('0x13')});};};
\ No newline at end of file
index 8e44566..f73400a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x991d=['../client','Request','CreateVoiceDialReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x991d,0xb7));var _0xd991=function(_0x83c8bc,_0x502a87){_0x83c8bc=_0x83c8bc-0x0;var _0x525370=_0x991d[_0x83c8bc];return _0x525370;};'use strict';var client=require(_0xd991('0x0'));exports['create']=function(_0x908ea6){return client[_0xd991('0x1')](_0xd991('0x2'),{'body':_0x908ea6,'log':_0xd991('0x2')});};
\ No newline at end of file
+var _0xaae4=['create','Request','CreateVoiceDialReport'];(function(_0x3bba37,_0x37f7f6){var _0x506a7f=function(_0x29e598){while(--_0x29e598){_0x3bba37['push'](_0x3bba37['shift']());}};_0x506a7f(++_0x37f7f6);}(_0xaae4,0xf0));var _0x4aae=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xaae4[_0x4b369d];return _0x571a98;};'use strict';var client=require('../client');exports[_0x4aae('0x0')]=function(_0x28cb32){return client[_0x4aae('0x1')](_0x4aae('0x2'),{'body':_0x28cb32,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
index c636a07..2bcbcbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda65=['getVoiceExtensions','Request','exten','recordingFormat','../client'];(function(_0x547bb6,_0x2d6f27){var _0x1a9154=function(_0x18080f){while(--_0x18080f){_0x547bb6['push'](_0x547bb6['shift']());}};_0x1a9154(++_0x2d6f27);}(_0xda65,0x1d0));var _0x5da6=function(_0x2a4e80,_0x5aebd2){_0x2a4e80=_0x2a4e80-0x0;var _0x1c1e16=_0xda65[_0x2a4e80];return _0x1c1e16;};'use strict';var client=require(_0x5da6('0x0'));exports[_0x5da6('0x1')]=function(){return function(){return client[_0x5da6('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x5da6('0x3'),_0x5da6('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x5da6('0x1')});};};
\ No newline at end of file
+var _0x222f=['../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x48a5f0,_0x3a7cdf){var _0x3bae07=function(_0x5249c8){while(--_0x5249c8){_0x48a5f0['push'](_0x48a5f0['shift']());}};_0x3bae07(++_0x3a7cdf);}(_0x222f,0x1a4));var _0xf222=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0x222f[_0x36bff5];return _0x80ade5;};'use strict';var client=require(_0xf222('0x0'));exports[_0xf222('0x1')]=function(){return function(){return client[_0xf222('0x2')](_0xf222('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xf222('0x1')});};};
\ No newline at end of file
index 9e4f840..153b910 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf66b=['TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','autopause','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','active','Pause','mandatoryDispositionPause'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0xf66b,0x1b7));var _0xbf66=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xf66b[_0x50007c];return _0x5c1ec7;};'use strict';var client=require('../client');exports[_0xbf66('0x0')]=function(){return function(){return client[_0xbf66('0x1')](_0xbf66('0x2'),{'options':{'raw':![],'attributes':['id',_0xbf66('0x3'),'acw','acwTimeout',_0xbf66('0x4'),'monitor_format','type',_0xbf66('0x5'),_0xbf66('0x6'),_0xbf66('0x7'),_0xbf66('0x8'),'dialPowerLevel',_0xbf66('0x9'),_0xbf66('0xa'),'dialPredictiveInterval',_0xbf66('0xb'),_0xbf66('0xc'),_0xbf66('0xd'),_0xbf66('0xe'),'dialQueueTimeout',_0xbf66('0xf'),_0xbf66('0x10'),_0xbf66('0x11'),_0xbf66('0x12'),_0xbf66('0x13'),_0xbf66('0x14'),_0xbf66('0x15'),'dialGlobalMaxRetry',_0xbf66('0x16'),_0xbf66('0x17'),'dialPrefix',_0xbf66('0x18'),_0xbf66('0x19'),'dialAMDInitialSilence',_0xbf66('0x1a'),_0xbf66('0x1b'),_0xbf66('0x1c'),_0xbf66('0x1d'),'dialAMDBetweenWordsSilence',_0xbf66('0x1e'),_0xbf66('0x1f'),_0xbf66('0x20'),_0xbf66('0x21'),_0xbf66('0x22'),_0xbf66('0x23'),_0xbf66('0x24'),_0xbf66('0x25'),_0xbf66('0x26'),_0xbf66('0x27'),_0xbf66('0x28'),_0xbf66('0x29'),_0xbf66('0x2a'),_0xbf66('0x2b'),_0xbf66('0x2c'),_0xbf66('0x2d'),'dialDropMaxRetry',_0xbf66('0x2e'),_0xbf66('0x2f'),_0xbf66('0x30'),'dialMachineMaxRetry',_0xbf66('0x31'),_0xbf66('0x32'),'dialAgentRejectRetryFrequency',_0xbf66('0x33'),_0xbf66('0x34'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xbf66('0x35'),'as':'Trunk','attributes':['id',_0xbf66('0x3'),'callerid',_0xbf66('0x36')]},{'model':_0xbf66('0x37'),'as':_0xbf66('0x38'),'attributes':['id',_0xbf66('0x3')]},{'model':_0xbf66('0x35'),'as':_0xbf66('0x39'),'attributes':['id','name',_0xbf66('0x3a'),_0xbf66('0x36')]},{'model':'Interval','as':'Interval','attributes':['id','name'],'include':[{'model':_0xbf66('0x3b'),'as':_0xbf66('0x3c'),'attributes':['id',_0xbf66('0x3'),_0xbf66('0x3d')]}]}]},'log':_0xbf66('0x0')});};};
\ No newline at end of file
+var _0xca7b=['dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','active','Pause','mandatoryDispositionPause','name','Trunk','callerid','Interval','interval','getVoiceQueues','../client','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPowerLevel'];(function(_0x13ed6b,_0x1ea5e3){var _0x820c26=function(_0x2cad7c){while(--_0x2cad7c){_0x13ed6b['push'](_0x13ed6b['shift']());}};_0x820c26(++_0x1ea5e3);}(_0xca7b,0xb0));var _0xbca7=function(_0xb56805,_0xbda62e){_0xb56805=_0xb56805-0x0;var _0xdf28da=_0xca7b[_0xb56805];return _0xdf28da;};'use strict';var client=require(_0xbca7('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0xbca7('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xbca7('0x2'),_0xbca7('0x3'),_0xbca7('0x4'),_0xbca7('0x5'),'type',_0xbca7('0x6'),_0xbca7('0x7'),_0xbca7('0x8'),'dialLimitQueue',_0xbca7('0x9'),_0xbca7('0xa'),_0xbca7('0xb'),'dialPredictiveInterval','dialOriginateCallerIdName',_0xbca7('0xc'),'dialOriginateTimeout',_0xbca7('0xd'),_0xbca7('0xe'),_0xbca7('0xf'),_0xbca7('0x10'),'dialCongestionRetryFrequency',_0xbca7('0x11'),_0xbca7('0x12'),_0xbca7('0x13'),_0xbca7('0x14'),_0xbca7('0x15'),_0xbca7('0x16'),_0xbca7('0x17'),_0xbca7('0x18'),_0xbca7('0x19'),'dialAMDActive',_0xbca7('0x1a'),_0xbca7('0x1b'),_0xbca7('0x1c'),_0xbca7('0x1d'),_0xbca7('0x1e'),_0xbca7('0x1f'),'dialAMDMaximumNumberOfWords',_0xbca7('0x20'),_0xbca7('0x21'),_0xbca7('0x22'),'dialRecallMeTimeout',_0xbca7('0x23'),_0xbca7('0x24'),_0xbca7('0x25'),_0xbca7('0x26'),_0xbca7('0x27'),'monitor_format',_0xbca7('0x28'),_0xbca7('0x29'),_0xbca7('0x2a'),_0xbca7('0x2b'),_0xbca7('0x2c'),'dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry',_0xbca7('0x2d'),_0xbca7('0x2e'),_0xbca7('0x2f'),_0xbca7('0x30'),_0xbca7('0x31'),_0xbca7('0x32'),_0xbca7('0x33'),_0xbca7('0x34')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id','name','callerid',_0xbca7('0x35')]},{'model':_0xbca7('0x36'),'as':_0xbca7('0x37'),'attributes':['id',_0xbca7('0x38')]},{'model':_0xbca7('0x39'),'as':'TrunkBackup','attributes':['id',_0xbca7('0x38'),_0xbca7('0x3a'),'active']},{'model':'Interval','as':_0xbca7('0x3b'),'attributes':['id',_0xbca7('0x38')],'include':[{'model':_0xbca7('0x3b'),'as':'Intervals','attributes':['id','name',_0xbca7('0x3c')]}]}]},'log':_0xbca7('0x3d')});};};
\ No newline at end of file
index 6063614..5bb601e 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(_0x51a375,_0x245561){var _0x57b226=function(_0x3960d7){while(--_0x3960d7){_0x51a375['push'](_0x51a375['shift']());}};_0x57b226(++_0x245561);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x3ec66f,_0x2653d0){var _0x4671e5=function(_0x338e03){while(--_0x338e03){_0x3ec66f['push'](_0x3ec66f['shift']());}};_0x4671e5(++_0x2653d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 d3111ea..a973266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eb8=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x53db06,_0x133b7f){var _0x4d350f=function(_0x20a29d){while(--_0x20a29d){_0x53db06['push'](_0x53db06['shift']());}};_0x4d350f(++_0x133b7f);}(_0x9eb8,0x18a));var _0x89eb=function(_0x2bded4,_0x214d15){_0x2bded4=_0x2bded4-0x0;var _0x18a444=_0x9eb8[_0x2bded4];return _0x18a444;};'use strict';var client=require(_0x89eb('0x0'));exports[_0x89eb('0x1')]=function(_0xe8b9f5){return function(){return client[_0x89eb('0x2')](_0x89eb('0x3'),{'options':{'where':{'VoiceQueueId':_0xe8b9f5,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
+var _0x292d=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x1511e7,_0x2be8e2){var _0x1eab02=function(_0x5aafd8){while(--_0x5aafd8){_0x1511e7['push'](_0x1511e7['shift']());}};_0x1eab02(++_0x2be8e2);}(_0x292d,0x140));var _0xd292=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x292d[_0x390a19];return _0x5d8230;};'use strict';var client=require(_0xd292('0x0'));exports[_0xd292('0x1')]=function(_0xfacca0){return function(){return client[_0xd292('0x2')](_0xd292('0x3'),{'options':{'where':{'VoiceQueueId':_0xfacca0,'paused':!![]},'raw':!![]},'log':_0xd292('0x1')});};};
\ No newline at end of file
index 370f26b..0356b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1dcf62,_0x32bf8b){var _0x415089=function(_0x58d957){while(--_0x58d957){_0x1dcf62['push'](_0x1dcf62['shift']());}};_0x415089(++_0x32bf8b);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x47ce15,_0x5adc97){var _0x3ab001=function(_0x432588){while(--_0x432588){_0x47ce15['push'](_0x47ce15['shift']());}};_0x3ab001(++_0x5adc97);}(_0x7a54,0x106));var _0x47a5=function(_0x4f4526,_0x75d2b4){_0x4f4526=_0x4f4526-0x0;var _0x3962d1=_0x7a54[_0x4f4526];return _0x3962d1;};'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 871bc45..014f26d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d46=['transfereeaccountcode','transfereeexten','isexternal','context','extension','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename'];(function(_0x4f0b8e,_0x49e21c){var _0xce493c=function(_0x459b3e){while(--_0x459b3e){_0x4f0b8e['push'](_0x4f0b8e['shift']());}};_0xce493c(++_0x49e21c);}(_0x4d46,0xd4));var _0x64d4=function(_0x51b345,_0x1747bc){_0x51b345=_0x51b345-0x0;var _0x3fd8d5=_0x4d46[_0x51b345];return _0x3fd8d5;};'use strict';var client=require(_0x64d4('0x0'));exports[_0x64d4('0x1')]={};exports['blindTransfer']=function(_0x41de8d){return client[_0x64d4('0x2')](_0x64d4('0x3'),{'body':{'result':_0x41de8d['result'],'transfererchannel':_0x41de8d[_0x64d4('0x4')],'transferercalleridnum':_0x41de8d[_0x64d4('0x5')],'transferercalleridname':_0x41de8d['transferercalleridname'],'transfererconnectedlinenum':_0x41de8d[_0x64d4('0x6')],'transfererconnectedlinename':_0x41de8d[_0x64d4('0x7')],'transfereraccountcode':_0x41de8d[_0x64d4('0x8')],'transferercontext':_0x41de8d['transferercontext'],'transfererexten':_0x41de8d[_0x64d4('0x9')],'transfererlinkedid':_0x41de8d[_0x64d4('0xa')],'transfereechannel':_0x41de8d[_0x64d4('0xb')],'transfereecalleridnum':_0x41de8d[_0x64d4('0xc')],'transfereecalleridname':_0x41de8d[_0x64d4('0xd')],'transfereeconnectedlinenum':_0x41de8d[_0x64d4('0xe')],'transfereeconnectedlinename':_0x41de8d[_0x64d4('0xf')],'transfereeaccountcode':_0x41de8d[_0x64d4('0x10')],'transfereecontext':_0x41de8d['transfereecontext'],'transfereeexten':_0x41de8d[_0x64d4('0x11')],'transfereelinkedid':_0x41de8d['transfereelinkedid'],'isexternal':_0x41de8d[_0x64d4('0x12')],'context':_0x41de8d[_0x64d4('0x13')],'extension':_0x41de8d[_0x64d4('0x14')],'type':'blind'},'log':_0x64d4('0x3')});};exports['attendedTransfer']=function(_0x1ae960){return client['Request'](_0x64d4('0x3'),{'body':{'result':_0x1ae960['result'],'transfererchannel':_0x1ae960[_0x64d4('0x15')],'transferercalleridnum':_0x1ae960[_0x64d4('0x16')],'transferercalleridname':_0x1ae960[_0x64d4('0x17')],'transfererconnectedlinenum':_0x1ae960[_0x64d4('0x18')],'transfererconnectedlinename':_0x1ae960[_0x64d4('0x19')],'transfereraccountcode':_0x1ae960[_0x64d4('0x1a')],'transferercontext':_0x1ae960['secondtransferercontext'],'transfererexten':_0x1ae960['secondtransfererexten'],'transfererlinkedid':_0x1ae960[_0x64d4('0x1b')],'transfereechannel':_0x1ae960[_0x64d4('0x1c')],'transfereecalleridnum':_0x1ae960[_0x64d4('0x1d')],'transfereecalleridname':_0x1ae960[_0x64d4('0x1e')],'transfereeconnectedlinenum':_0x1ae960['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1ae960[_0x64d4('0x1f')],'transfereeaccountcode':_0x1ae960[_0x64d4('0x20')],'transfereecontext':_0x1ae960['transfertargetcontext'],'transfereeexten':_0x1ae960[_0x64d4('0x21')],'transfereelinkedid':_0x1ae960[_0x64d4('0x22')],'isexternal':_0x1ae960['isexternal'],'context':_0x1ae960[_0x64d4('0x23')],'extension':_0x1ae960[_0x64d4('0x24')],'type':_0x64d4('0x25')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0x8598=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x8598,0x118));var _0x8859=function(_0x2e81f4,_0x44f46a){_0x2e81f4=_0x2e81f4-0x0;var _0x198f70=_0x8598[_0x2e81f4];return _0x198f70;};'use strict';var client=require(_0x8859('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x14183b){return client['Request'](_0x8859('0x1'),{'body':{'result':_0x14183b[_0x8859('0x2')],'transfererchannel':_0x14183b[_0x8859('0x3')],'transferercalleridnum':_0x14183b[_0x8859('0x4')],'transferercalleridname':_0x14183b[_0x8859('0x5')],'transfererconnectedlinenum':_0x14183b[_0x8859('0x6')],'transfererconnectedlinename':_0x14183b['transfererconnectedlinename'],'transfereraccountcode':_0x14183b[_0x8859('0x7')],'transferercontext':_0x14183b['transferercontext'],'transfererexten':_0x14183b['transfererexten'],'transfererlinkedid':_0x14183b[_0x8859('0x8')],'transfereechannel':_0x14183b[_0x8859('0x9')],'transfereecalleridnum':_0x14183b[_0x8859('0xa')],'transfereecalleridname':_0x14183b[_0x8859('0xb')],'transfereeconnectedlinenum':_0x14183b[_0x8859('0xc')],'transfereeconnectedlinename':_0x14183b[_0x8859('0xd')],'transfereeaccountcode':_0x14183b[_0x8859('0xe')],'transfereecontext':_0x14183b[_0x8859('0xf')],'transfereeexten':_0x14183b[_0x8859('0x10')],'transfereelinkedid':_0x14183b[_0x8859('0x11')],'isexternal':_0x14183b[_0x8859('0x12')],'context':_0x14183b[_0x8859('0x13')],'extension':_0x14183b['extension'],'type':_0x8859('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0x8859('0x15')]=function(_0x48ebeb){return client[_0x8859('0x16')]('CreateVoiceTransferReport',{'body':{'result':_0x48ebeb['result'],'transfererchannel':_0x48ebeb[_0x8859('0x17')],'transferercalleridnum':_0x48ebeb[_0x8859('0x18')],'transferercalleridname':_0x48ebeb[_0x8859('0x19')],'transfererconnectedlinenum':_0x48ebeb[_0x8859('0x1a')],'transfererconnectedlinename':_0x48ebeb[_0x8859('0x1b')],'transfereraccountcode':_0x48ebeb['origtransfereraccountcode'],'transferercontext':_0x48ebeb[_0x8859('0x1c')],'transfererexten':_0x48ebeb['secondtransfererexten'],'transfererlinkedid':_0x48ebeb[_0x8859('0x1d')],'transfereechannel':_0x48ebeb['transfertargetchannel'],'transfereecalleridnum':_0x48ebeb['transfertargetcalleridnum'],'transfereecalleridname':_0x48ebeb[_0x8859('0x1e')],'transfereeconnectedlinenum':_0x48ebeb[_0x8859('0x1f')],'transfereeconnectedlinename':_0x48ebeb[_0x8859('0x20')],'transfereeaccountcode':_0x48ebeb[_0x8859('0x21')],'transfereecontext':_0x48ebeb['transfertargetcontext'],'transfereeexten':_0x48ebeb[_0x8859('0x22')],'transfereelinkedid':_0x48ebeb[_0x8859('0x23')],'isexternal':_0x48ebeb[_0x8859('0x12')],'context':_0x48ebeb[_0x8859('0x24')],'extension':_0x48ebeb[_0x8859('0x25')],'type':_0x8859('0x26')},'log':_0x8859('0x1')});};
\ No newline at end of file
index 098a5ea..89d050e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf40b=['startProgressive','Trunk','callerid','Interval','length','find','undefined','values','voicechannel','map','channels','channel','%s.%s','filename','uniqueid','wav','MixMonitor','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','outboundChannels','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive'];(function(_0x2f6ae4,_0x1a41cb){var _0x3b3e40=function(_0x210516){while(--_0x210516){_0x2f6ae4['push'](_0x2f6ae4['shift']());}};_0x3b3e40(++_0x1a41cb);}(_0xf40b,0xb0));var _0xbf40=function(_0x49f19e,_0x1c3aa3){_0x49f19e=_0x49f19e-0x0;var _0x280b5a=_0xf40b[_0x49f19e];return _0x280b5a;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var jayson=require(_0xbf40('0x1'));var schema=require(_0xbf40('0x2'));var BPromise=require(_0xbf40('0x3'));var moment=require('moment');var config=require(_0xbf40('0x4'));var properties=require(_0xbf40('0x5'));var ami=require(_0xbf40('0x6'));exports[_0xbf40('0x7')]=function(_0x1a1c6f,_0x5e37ce,_0x2e74b5){return new BPromise(function(_0xbe1c47,_0x1c6e1b){var _0xe360e1={'QueuePause':function(_0x1d5add){return new Promise(function(_0x4c0875,_0x5f525c){var _0x31cd41=util[_0xbf40('0x8')](_0xbf40('0x9'),_0xbf40('0xa'),_0x1d5add[_0xbf40('0xb')]);if(_0x1a1c6f[_0xbf40('0xc')]&&_0x1a1c6f[_0xbf40('0xc')][_0x31cd41]&&_0x1a1c6f['timers'][_0x31cd41][_0xbf40('0xd')]){_0x1a1c6f[_0xbf40('0xc')][_0x31cd41][_0xbf40('0xe')]();}if(_0x1a1c6f[_0xbf40('0xf')][_0x31cd41]){_0x1a1c6f[_0xbf40('0xf')][_0x31cd41][_0xbf40('0x10')]({'statePause':_0x1d5add[_0xbf40('0x11')]?!![]:![]});}_0x4c0875({'code':0xc8,'message':_0xbf40('0x12')});});},'Reload':function(_0x52c58c){var _0x592293=this;return new Promise(function(_0x6e3496,_0x3f86b5){if(ami[_0xbf40('0x13')]()==![]){return _0x3f86b5(_0x592293[_0xbf40('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbf40('0x15')][_0xbf40('0x16')],_0xbf40('0x17')][_0xbf40('0x18')]('\x20')));}_0x52c58c=_[_0xbf40('0x19')](_0x52c58c,_[_0xbf40('0x1a')](properties[_0xbf40('0x1b')]));_0x52c58c[_0xbf40('0x1c')]='Reload';return ami[_0xbf40('0x1d')](_0x52c58c)[_0xbf40('0x1e')](function(_0x28b9e1){_0x6e3496({'code':0xc8,'message':_0x28b9e1[_0xbf40('0x1f')]});})[_0xbf40('0x20')](function(_0x414123){_0x3f86b5(_0x592293[_0xbf40('0x14')](0x1f5,_0x414123[_0xbf40('0x1f')]));});});},'Command':function(_0x5979da){var _0x2c8af5=this;return new Promise(function(_0x6aa551,_0x3af762){if(ami[_0xbf40('0x13')]()==![]){return _0x3af762(_0x2c8af5['error'](0x1f4,[config[_0xbf40('0x15')]['ip'],config[_0xbf40('0x15')][_0xbf40('0x16')],_0xbf40('0x17')][_0xbf40('0x18')]('\x20')));}_0x5979da=_[_0xbf40('0x19')](_0x5979da,_0xbf40('0x21'));_0x5979da[_0xbf40('0x1c')]=_0xbf40('0x22');return ami[_0xbf40('0x1d')](_0x5979da)[_0xbf40('0x1e')](function(_0x1487d0){_0x6aa551({'code':0xc8,'message':_0x1487d0[_0xbf40('0x23')]});})[_0xbf40('0x20')](function(_0x2ead11){_0x3af762(_0x2c8af5[_0xbf40('0x14')](0x1f5,_0x2ead11['message']));});});},'VoiceQueues':function(_0x2df7a8){return new Promise(function(_0x1a4b48,_0x2890e7){var _0xb9adcd=[];for(var _0x2d3936 in _0x1a1c6f[_0xbf40('0x24')]){if(_0x1a1c6f[_0xbf40('0x24')][_0xbf40('0x25')](_0x2d3936)){var _0x40f563=_0x1a1c6f[_0xbf40('0x24')][_0x2d3936];var _0x2faef5={'id':_0x40f563['id'],'name':_0x40f563[_0xbf40('0xb')],'strategy':_0x40f563[_0xbf40('0x26')],'answered':_0x40f563[_0xbf40('0x27')],'available':_0x40f563['available'],'loggedIn':_0x40f563[_0xbf40('0x28')],'pTalking':_0x40f563['pTalking'],'sumBillable':_0x40f563[_0xbf40('0x29')],'sumDuration':_0x40f563[_0xbf40('0x2a')],'sumHoldTime':_0x40f563[_0xbf40('0x2b')]||0x0,'talking':_0x40f563['talking'],'total':_0x40f563[_0xbf40('0x2c')],'type':_0x40f563[_0xbf40('0x2d')],'unmanaged':_0x40f563[_0xbf40('0x2e')],'abandoned':_0x40f563['abandoned'],'waiting':_0x40f563[_0xbf40('0x2f')],'loggedInDb':_0x40f563['loggedInDb']};if(_0x40f563[_0xbf40('0x2d')]===_0xbf40('0x30')){_0x2faef5[_0xbf40('0x31')]=_0x40f563['dialActive'];_0x2faef5[_0xbf40('0x32')]=_0x40f563[_0xbf40('0x32')];_0x2faef5[_0xbf40('0x33')]=_0x40f563[_0xbf40('0x33')];_0x2faef5[_0xbf40('0x34')]=_0x40f563[_0xbf40('0x34')];_0x2faef5[_0xbf40('0x35')]=_0x40f563[_0xbf40('0x35')];_0x2faef5[_0xbf40('0x36')]=_0x40f563['dialPrefix'];_0x2faef5[_0xbf40('0x37')]=_0x40f563[_0xbf40('0x37')];_0x2faef5[_0xbf40('0x38')]=_0x40f563[_0xbf40('0x38')];_0x2faef5['outboundAnswerCallsDay']=_0x40f563[_0xbf40('0x39')];_0x2faef5['outboundBlacklistCallsDay']=_0x40f563[_0xbf40('0x3a')];_0x2faef5[_0xbf40('0x3b')]=_0x40f563[_0xbf40('0x3b')];_0x2faef5['outboundCongestionCallsDay']=_0x40f563[_0xbf40('0x3c')];_0x2faef5[_0xbf40('0x3d')]=_0x40f563[_0xbf40('0x3d')];_0x2faef5[_0xbf40('0x3e')]=_0x40f563[_0xbf40('0x3e')];_0x2faef5['outboundDropCallsDayTimeout']=_0x40f563[_0xbf40('0x3f')];_0x2faef5[_0xbf40('0x40')]=_0x40f563[_0xbf40('0x40')];_0x2faef5['outboundNoSuchCallsDay']=_0x40f563[_0xbf40('0x41')];_0x2faef5[_0xbf40('0x42')]=_0x40f563[_0xbf40('0x42')];_0x2faef5['outboundReCallsDay']=_0x40f563[_0xbf40('0x43')];_0x2faef5[_0xbf40('0x44')]=_0x40f563[_0xbf40('0x44')];_0x2faef5[_0xbf40('0x45')]=_0x40f563[_0xbf40('0x45')];_0x2faef5[_0xbf40('0x46')]=_0x40f563[_0xbf40('0x46')];_0x2faef5[_0xbf40('0x47')]=_0x40f563[_0xbf40('0x47')];_0x2faef5[_0xbf40('0x48')]=_0x40f563[_0xbf40('0x48')];_0x2faef5[_0xbf40('0x49')]=_0x40f563[_0xbf40('0x49')];_0x2faef5[_0xbf40('0x4a')]=_0x40f563['predictiveIntervalDroppedCallsTimeout'];_0x2faef5[_0xbf40('0x4b')]=_0x40f563['predictiveIntervalErlangCalls'];_0x2faef5[_0xbf40('0x4c')]=_0x40f563[_0xbf40('0x4c')];_0x2faef5[_0xbf40('0x4d')]=_0x40f563[_0xbf40('0x4d')];_0x2faef5[_0xbf40('0x4e')]=_0x40f563['predictiveIntervalMultiplicativeFactor'];_0x2faef5[_0xbf40('0x4f')]=_0x40f563[_0xbf40('0x4f')];_0x2faef5['predictiveIntervalAvailable']=_0x40f563[_0xbf40('0x50')];_0x2faef5['predictiveIntervalTotalCalls']=_0x40f563[_0xbf40('0x51')];_0x2faef5[_0xbf40('0x1f')]=_0x40f563[_0xbf40('0x1f')];_0x2faef5[_0xbf40('0x52')]=_0x40f563[_0xbf40('0x52')];_0x2faef5[_0xbf40('0x53')]=_0x40f563[_0xbf40('0x53')];_0x2faef5['erlangCallToSecond']=_0x40f563[_0xbf40('0x54')];_0x2faef5[_0xbf40('0x55')]=_0x40f563[_0xbf40('0x55')];_0x2faef5[_0xbf40('0x56')]=_0x40f563[_0xbf40('0x56')];_0x2faef5[_0xbf40('0x57')]=_0x40f563[_0xbf40('0x57')];_0x2faef5[_0xbf40('0x58')]=_0x40f563['startProgressive'];}if(_0x40f563[_0xbf40('0x59')]){_0x2faef5['Trunk']={'id':_0x40f563[_0xbf40('0x59')]['id'],'name':_0x40f563[_0xbf40('0x59')][_0xbf40('0xb')],'active':_0x40f563[_0xbf40('0x59')]['active'],'callerid':_0x40f563['Trunk'][_0xbf40('0x5a')]};}if(_0x40f563[_0xbf40('0x5b')]){_0x2faef5[_0xbf40('0x5b')]={'id':_0x40f563['Interval']['id'],'name':_0x40f563['Interval'][_0xbf40('0xb')]};}_0xb9adcd['push'](_0x2faef5);}}_0x1a4b48({'count':_0xb9adcd[_0xbf40('0x5c')],'rows':_0xb9adcd});});},'UpdateVoiceQueue':function(_0x59af4d){return new Promise(function(_0x18758d,_0x420cd9){var _0x5c9901=_[_0xbf40('0x5d')](_0x1a1c6f[_0xbf40('0x24')],{'id':parseInt(_0x59af4d['id'])});var _0x5af296=_['omit'](_0x59af4d,['id']);if(_0x5c9901){for(var _0x1d7bb1 in _0x5af296){if(typeof _0x5af296[_0x1d7bb1]!==_0xbf40('0x5e')&&typeof _0x5c9901[_0x1d7bb1]!=='undefined'){_0x5c9901[_0x1d7bb1]=_0x5af296[_0x1d7bb1];}}_0x18758d(_0x5c9901);}else{_0x420cd9();}});},'VoiceChannels':function(_0x150fed){return new Promise(function(_0x2712ba,_0x272b22){var _0x379977=_[_0xbf40('0x5f')](_0x1a1c6f['channels']);_0x2712ba({'count':_0x379977[_0xbf40('0x5c')],'rows':_0x379977});});},'VoiceChannelMixMonitor':function(_0x30fcfe){var _0x3f56e9=this;return new Promise(function(_0x2ccb9d,_0x16be53){if(ami[_0xbf40('0x13')]()==![]){return _0x16be53(_0x3f56e9[_0xbf40('0x14')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xbf40('0x16')],_0xbf40('0x17')]['join']('\x20')));}var _0x1df034=schema(properties[_0xbf40('0x60')])[_0xbf40('0x2')](_0x30fcfe);if(_0x1df034['length']>0x0){return _0x16be53(_0x3f56e9[_0xbf40('0x14')](0x1f4,_[_0xbf40('0x61')](_0x1df034,_0xbf40('0x1f'))['join'](',\x20')));}var _0x155f38=_['find'](_0x1a1c6f[_0xbf40('0x62')],{'uniqueid':_0x30fcfe['uniqueid']});if(_0x155f38&&_0x155f38[_0xbf40('0x63')]){var _0x48bf44=util[_0xbf40('0x8')](_0xbf40('0x64'),_0x30fcfe[_0xbf40('0x65')]||_0x30fcfe[_0xbf40('0x66')],_0x30fcfe[_0xbf40('0x8')]||_0xbf40('0x67'));return ami[_0xbf40('0x1d')]({'action':_0xbf40('0x68'),'channel':_0x155f38[_0xbf40('0x63')],'file':_0x48bf44,'options':'ai(mixmonitorid)'})[_0xbf40('0x1e')](function(_0x504a5c){var _0x5f03a7=_[_0xbf40('0x5d')](_0x155f38['monitors'],{'filename':_0xbf40('0x69')+_0x48bf44[_0xbf40('0x6a')]()});if(_[_0xbf40('0x6b')](_0x5f03a7)){_0x155f38[_0xbf40('0x6c')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x48bf44[_0xbf40('0x6a')](),'createdAt':moment()[_0xbf40('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x504a5c[_0xbf40('0x6d')],'status':'rec'});}else{_0x5f03a7[_0xbf40('0x6d')]=_0x504a5c['mixmonitorid'];_0x5f03a7['status']='rec';}_0x2ccb9d({'code':0xc8,'message':[_0x30fcfe['uniqueid'],'MixMonitor\x20Success',_0x504a5c[_0xbf40('0x6d')]][_0xbf40('0x18')]('\x20'),'mixmonitorid':_0x504a5c[_0xbf40('0x6d')]});})[_0xbf40('0x20')](function(_0x212b88){_0x16be53(_0x3f56e9['error'](0x1f5,[_0x30fcfe[_0xbf40('0x66')],_0x212b88[_0xbf40('0x1f')][_0xbf40('0x6a')]()][_0xbf40('0x18')]('\x20')));});}else{return _0x16be53(_0x3f56e9[_0xbf40('0x14')](0x1f5,_0xbf40('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x3bf438){var _0x5d7316=this;return new Promise(function(_0x177cd0,_0xe2bed9){if(ami['isConnected']()==![]){return _0xe2bed9(_0x5d7316['error'](0x1f4,[config[_0xbf40('0x15')]['ip'],config[_0xbf40('0x15')][_0xbf40('0x16')],_0xbf40('0x17')][_0xbf40('0x18')]('\x20')));}var _0x47a1c6=schema(properties[_0xbf40('0x60')])[_0xbf40('0x2')](_0x3bf438);if(_0x47a1c6[_0xbf40('0x5c')]>0x0){return _0xe2bed9(_0x5d7316[_0xbf40('0x14')](0x1f4,_[_0xbf40('0x61')](_0x47a1c6,_0xbf40('0x1f'))[_0xbf40('0x18')](',\x20')));}var _0x59e21e=_[_0xbf40('0x5d')](_0x1a1c6f[_0xbf40('0x62')],{'uniqueid':_0x3bf438[_0xbf40('0x66')]});if(_0x59e21e){return BPromise['resolve']()[_0xbf40('0x1e')](function(){if(_0x59e21e[_0xbf40('0x63')]){return ami[_0xbf40('0x1d')]({'action':_0xbf40('0x6f'),'channel':_0x59e21e[_0xbf40('0x63')],'mixmonitorid':_0x3bf438[_0xbf40('0x6d')]})[_0xbf40('0x20')](function(_0x57a514){});}})['then'](function(){if(_0x59e21e[_0xbf40('0x70')]){return ami[_0xbf40('0x1d')]({'action':'StopMixMonitor','channel':_0x59e21e[_0xbf40('0x70')],'mixmonitorid':_0x3bf438[_0xbf40('0x6d')]})[_0xbf40('0x20')](function(_0x37355a){});}})[_0xbf40('0x1e')](function(_0x4fb6f9){var _0x413e28=_[_0xbf40('0x5d')](_0x59e21e['monitors'],{'mixmonitorid':_0x3bf438[_0xbf40('0x6d')]});if(_0x413e28){_0x413e28[_0xbf40('0x71')]=_0xbf40('0x72');}})[_0xbf40('0x1e')](function(){var _0x148fca=util[_0xbf40('0x8')](_0xbf40('0x64'),_0x3bf438[_0xbf40('0x65')]||_0x3bf438[_0xbf40('0x66')],_0x3bf438[_0xbf40('0x8')]||_0xbf40('0x67'));var _0x100e5b=_['find'](_0x59e21e['monitors'],{'filename':_0xbf40('0x69')+_0x148fca[_0xbf40('0x6a')]()});if(_0x100e5b){_0x100e5b[_0xbf40('0x71')]=_0xbf40('0x72');}})[_0xbf40('0x1e')](function(){_0x177cd0({'code':0xc8,'message':[_0x3bf438[_0xbf40('0x66')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbf40('0x20')](function(_0x53b251){_0xe2bed9(_0x5d7316[_0xbf40('0x14')](0x1f5,[_0x3bf438[_0xbf40('0x66')],_0x53b251['message']['toLowerCase']()][_0xbf40('0x18')]('\x20')));});}else{return _0xe2bed9(_0x5d7316[_0xbf40('0x14')](0x1f5,_0xbf40('0x6e')));}});},'VoiceQueuesChannels':function(_0x3cc014){return new Promise(function(_0x5540ea,_0x1960f6){var _0x3013b5=_['values'](_0x1a1c6f[_0xbf40('0x73')]);_0x5540ea({'count':_0x3013b5['length'],'rows':_0x3013b5});});},'VoiceQueuesChannel':function(_0x86c63c){var _0x437b60=this;return new Promise(function(_0x12af9b,_0x2f3784){var _0xa00812=schema(properties[_0xbf40('0x74')])[_0xbf40('0x2')](_0x86c63c);if(_0xa00812[_0xbf40('0x5c')]>0x0){return _0x2f3784(_0x437b60[_0xbf40('0x14')](0x1f4,_[_0xbf40('0x61')](_0xa00812,'message')['join'](',\x20')));}var _0x3a2e4d=_[_0xbf40('0x5d')](_0x1a1c6f['queueChannels'],{'uniqueid':_0x86c63c[_0xbf40('0x66')]});if(_0x3a2e4d){_0x12af9b(_0x3a2e4d);}else{return _0x2f3784(_0x437b60[_0xbf40('0x14')](0x1f5,_0xbf40('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x50c557){var _0x3bd127=this;return new Promise(function(_0x4172a7,_0x814351){if(ami[_0xbf40('0x13')]()==![]){return _0x814351(_0x3bd127['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xbf40('0x16')],'ami\x20disconnected'][_0xbf40('0x18')]('\x20')));}var _0x211964=schema(properties[_0xbf40('0x75')])[_0xbf40('0x2')](_0x50c557);if(_0x211964[_0xbf40('0x5c')]>0x0){return _0x814351(_0x3bd127[_0xbf40('0x14')](0x1f4,_[_0xbf40('0x61')](_0x211964,_0xbf40('0x1f'))[_0xbf40('0x18')](',\x20')));}var _0x2a832d=_[_0xbf40('0x5d')](_0x1a1c6f[_0xbf40('0x73')],{'uniqueid':_0x50c557['uniqueid']});if(_0x2a832d&&_0x2a832d[_0xbf40('0x63')]){return ami[_0xbf40('0x1d')]({'action':'Hangup','channel':_0x2a832d[_0xbf40('0x63')]})['then'](function(_0x2aa9e5){_0x4172a7({'code':0xc8,'message':[_0x50c557[_0xbf40('0x66')],_0x2aa9e5[_0xbf40('0x1f')][_0xbf40('0x6a')]()][_0xbf40('0x18')]('\x20')});})[_0xbf40('0x20')](function(_0x32dec1){_0x814351(_0x3bd127[_0xbf40('0x14')](0x1f5,[_0x50c557[_0xbf40('0x66')],_0x32dec1['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x814351(_0x3bd127[_0xbf40('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0xe1e68f){var _0x2dc75e=this;return new Promise(function(_0x4142f0,_0x4f027a){if(ami[_0xbf40('0x13')]()==![]){return _0x4f027a(_0x2dc75e[_0xbf40('0x14')](0x1f4,[config[_0xbf40('0x15')]['ip'],config['asterisk'][_0xbf40('0x16')],_0xbf40('0x17')]['join']('\x20')));}var _0x380da3=schema(properties[_0xbf40('0x76')])[_0xbf40('0x2')](_0xe1e68f);if(_0x380da3[_0xbf40('0x5c')]>0x0){return _0x4f027a(_0x2dc75e[_0xbf40('0x14')](0x1f4,_[_0xbf40('0x61')](_0x380da3,_0xbf40('0x1f'))[_0xbf40('0x18')](',\x20')));}var _0x3f67de=_[_0xbf40('0x5d')](_0x1a1c6f['queueChannels'],{'uniqueid':_0xe1e68f[_0xbf40('0x66')]});if(_0x3f67de&&_0x3f67de[_0xbf40('0x63')]){return ami[_0xbf40('0x1d')]({'action':_0xbf40('0x77'),'channel':_0x3f67de[_0xbf40('0x63')],'exten':_0xe1e68f[_0xbf40('0x78')],'context':_0xe1e68f[_0xbf40('0x79')]||_0x3f67de[_0xbf40('0x79')],'priority':0x1})['then'](function(_0x1f7219){_0x4142f0({'code':0xc8,'message':[_0xe1e68f[_0xbf40('0x66')],_0x1f7219[_0xbf40('0x1f')][_0xbf40('0x6a')]()][_0xbf40('0x18')]('\x20')});})[_0xbf40('0x20')](function(_0x5a7049){_0x4f027a(_0x2dc75e[_0xbf40('0x14')](0x1f5,[_0xe1e68f[_0xbf40('0x66')],_0x5a7049[_0xbf40('0x1f')][_0xbf40('0x6a')]()][_0xbf40('0x18')]('\x20')));});}else{return _0x4f027a(_0x2dc75e[_0xbf40('0x14')](0x1f5,_0xbf40('0x6e')));}});},'Agents':function(_0x30964b){return new Promise(function(_0x337acb,_0x1181a9){var _0x4e64cf=_[_0xbf40('0x5f')](_0x1a1c6f[_0xbf40('0xf')]);_0x337acb({'count':_0x4e64cf[_0xbf40('0x5c')],'rows':_0x4e64cf});});},'Telephones':function(_0x52cb55){return new Promise(function(_0x437529,_0x1fa173){var _0x40574a=_[_0xbf40('0x5f')](_0x1a1c6f['telephones']);_0x437529({'count':_0x40574a[_0xbf40('0x5c')],'rows':_0x40574a});});},'Trunks':function(_0x3f388e){return new Promise(function(_0x21bf94,_0x3e7e20){var _0x2bba49=_[_0xbf40('0x5f')](_0x1a1c6f['trunks']);_0x21bf94({'count':_0x2bba49['length'],'rows':_0x2bba49});});},'OutboundChannels':function(_0x585305){return new Promise(function(_0xa170c5,_0x4db674){var _0x46aba9=_[_0xbf40('0x5f')](_0x1a1c6f[_0xbf40('0x7a')]);_0xa170c5({'count':_0x46aba9[_0xbf40('0x5c')],'rows':_0x46aba9});});},'Outbound':function(_0x1302bc){return new Promise(function(_0x15ded9,_0x475978){_0x15ded9(_0x1a1c6f['outbound']);});},'Campaigns':function(_0x46c91d){return new Promise(function(_0x1601b7,_0x3425d0){var _0x45917d=_['values'](_0x1a1c6f['campaigns']);_0x1601b7({'count':_0x45917d[_0xbf40('0x5c')],'rows':_0x45917d});});},'VoiceQueuesPreview':function(_0x2bfd10){var _0x81ac6a=this;return new Promise(function(_0x2802ff,_0x2bb098){_0x5e37ce['run'](_0x2bfd10['id'])[_0xbf40('0x1e')](function(_0x6c3415){_0x2802ff({'code':0xc8,'message':_0x6c3415['message']});})[_0xbf40('0x20')](function(_0x123a8f){_0x2bb098(_0x81ac6a['error'](0x1f4,_0x123a8f[_0xbf40('0x1f')]));});});},'EventManager':function(_0x19ab36){var _0x1e1449=this;return new Promise(function(_0x462c2f,_0xff7025){if(!_0x19ab36['event']){return _0xff7025(_0x1e1449[_0xbf40('0x14')](0x1f4,_0xbf40('0x7b')));}ami['emit'](_0xbf40('0x7c')+_0x19ab36['event'],_0x19ab36[_0xbf40('0x1f')]);_0x462c2f({'code':0xc8,'message':_0x19ab36});});},'FaxAccounts':function(_0x277ab0){return new Promise(function(_0x28700c,_0x5ccc71){var _0x3e17b3=_[_0xbf40('0x5f')](_0x1a1c6f[_0xbf40('0x7d')]);_0x28700c({'count':_0x3e17b3[_0xbf40('0x5c')],'rows':_0x3e17b3});});},'SendFax':function(_0x494f32){var _0x1a3532=this;return new Promise(function(_0x18fa20,_0x36c6b5){_0x2e74b5[_0xbf40('0x7e')](_0x494f32)['then'](function(_0x1c6562){_0x18fa20({'code':0xc8,'message':_0x1c6562[_0xbf40('0x1f')]});})['catch'](function(_0xbd3f35){_0x36c6b5(_0x1a3532[_0xbf40('0x14')](0x1f4,_0xbd3f35[_0xbf40('0x1f')]));});});},'CheckAfterSend':function(_0xc9a4cd){var _0x55909f=this;return new Promise(function(_0x1bd745,_0x43f54b){_0x2e74b5['checkAfterSend'](_0xc9a4cd)[_0xbf40('0x1e')](function(_0x485428){_0x1bd745({'code':0xc8,'message':_0x485428[_0xbf40('0x1f')]});})[_0xbf40('0x20')](function(_0x1ea21f){_0x43f54b(_0x55909f[_0xbf40('0x14')](0x1f4,_0x1ea21f[_0xbf40('0x1f')]));});});}};var _0x4e229c=jayson[_0xbf40('0x7f')](_0xe360e1)[_0xbf40('0x80')]();_0x4e229c['on'](_0xbf40('0x14'),function(_0x1ba816){return _0x1c6e1b(_0x1ba816);});_0x4e229c[_0xbf40('0x7')](0x232a,_0xbf40('0x81'),function(){console[_0xbf40('0x82')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xbe1c47(_0xbf40('0x83')+0x232a);});});};
\ No newline at end of file
+var _0x1967=['outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','length','find','omit','undefined','ami\x20disconnected','map','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','channels','resolve','destinationchannel','stop','wav','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','hasOwnProperty','voiceQueues','strategy','answered','available','pTalking','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay'];(function(_0x5755bf,_0x5a50ba){var _0x156408=function(_0x432024){while(--_0x432024){_0x5755bf['push'](_0x5755bf['shift']());}};_0x156408(++_0x5a50ba);}(_0x1967,0x173));var _0x7196=function(_0xf92bc4,_0xc7ac43){_0xf92bc4=_0xf92bc4-0x0;var _0x41b75e=_0x1967[_0xf92bc4];return _0x41b75e;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var jayson=require(_0x7196('0x1'));var schema=require(_0x7196('0x2'));var BPromise=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var config=require(_0x7196('0x5'));var properties=require(_0x7196('0x6'));var ami=require(_0x7196('0x7'));exports[_0x7196('0x8')]=function(_0x3ae43f,_0x5c128f,_0x36b01e){return new BPromise(function(_0x186175,_0x194746){var _0x40e0af={'QueuePause':function(_0x266a6e){return new Promise(function(_0xad78a,_0x510c72){var _0x218520=util[_0x7196('0x9')](_0x7196('0xa'),_0x7196('0xb'),_0x266a6e[_0x7196('0xc')]);if(_0x3ae43f['timers']&&_0x3ae43f['timers'][_0x218520]&&_0x3ae43f[_0x7196('0xd')][_0x218520][_0x7196('0xe')]){_0x3ae43f[_0x7196('0xd')][_0x218520][_0x7196('0xf')]();}if(_0x3ae43f[_0x7196('0x10')][_0x218520]){_0x3ae43f[_0x7196('0x10')][_0x218520][_0x7196('0x11')]({'statePause':_0x266a6e[_0x7196('0x12')]?!![]:![]});}_0xad78a({'code':0xc8,'message':_0x7196('0x13')});});},'Reload':function(_0xba707b){var _0x154101=this;return new Promise(function(_0x4e8c4c,_0x26a1ef){if(ami[_0x7196('0x14')]()==![]){return _0x26a1ef(_0x154101[_0x7196('0x15')](0x1f4,[config[_0x7196('0x16')]['ip'],config['asterisk'][_0x7196('0x17')],'ami\x20disconnected'][_0x7196('0x18')]('\x20')));}_0xba707b=_[_0x7196('0x19')](_0xba707b,_[_0x7196('0x1a')](properties[_0x7196('0x1b')]));_0xba707b[_0x7196('0x1c')]=_0x7196('0x1d');return ami[_0x7196('0x1e')](_0xba707b)[_0x7196('0x1f')](function(_0x3e4e69){_0x4e8c4c({'code':0xc8,'message':_0x3e4e69[_0x7196('0x20')]});})[_0x7196('0x21')](function(_0x5b716a){_0x26a1ef(_0x154101['error'](0x1f5,_0x5b716a[_0x7196('0x20')]));});});},'Command':function(_0x26b447){var _0x40418d=this;return new Promise(function(_0x517a3e,_0x39b944){if(ami['isConnected']()==![]){return _0x39b944(_0x40418d['error'](0x1f4,[config[_0x7196('0x16')]['ip'],config[_0x7196('0x16')][_0x7196('0x17')],'ami\x20disconnected']['join']('\x20')));}_0x26b447=_[_0x7196('0x19')](_0x26b447,_0x7196('0x22'));_0x26b447['action']=_0x7196('0x23');return ami[_0x7196('0x1e')](_0x26b447)[_0x7196('0x1f')](function(_0x18d389){_0x517a3e({'code':0xc8,'message':_0x18d389[_0x7196('0x24')]});})['catch'](function(_0x3f8178){_0x39b944(_0x40418d['error'](0x1f5,_0x3f8178[_0x7196('0x20')]));});});},'VoiceQueues':function(_0x1b1f4b){return new Promise(function(_0x2e15c7,_0xa69810){var _0x70aa65=[];for(var _0x43f6a2 in _0x3ae43f['voiceQueues']){if(_0x3ae43f['voiceQueues'][_0x7196('0x25')](_0x43f6a2)){var _0x2d284f=_0x3ae43f[_0x7196('0x26')][_0x43f6a2];var _0x4e878f={'id':_0x2d284f['id'],'name':_0x2d284f['name'],'strategy':_0x2d284f[_0x7196('0x27')],'answered':_0x2d284f[_0x7196('0x28')],'available':_0x2d284f[_0x7196('0x29')],'loggedIn':_0x2d284f['loggedIn'],'pTalking':_0x2d284f[_0x7196('0x2a')],'sumBillable':_0x2d284f['sumBillable'],'sumDuration':_0x2d284f[_0x7196('0x2b')],'sumHoldTime':_0x2d284f['sumHoldTime']||0x0,'talking':_0x2d284f[_0x7196('0x2c')],'total':_0x2d284f[_0x7196('0x2d')],'type':_0x2d284f[_0x7196('0x2e')],'unmanaged':_0x2d284f['unmanaged'],'abandoned':_0x2d284f[_0x7196('0x2f')],'waiting':_0x2d284f[_0x7196('0x30')],'loggedInDb':_0x2d284f[_0x7196('0x31')]};if(_0x2d284f[_0x7196('0x2e')]==='outbound'){_0x4e878f[_0x7196('0x32')]=_0x2d284f[_0x7196('0x32')];_0x4e878f[_0x7196('0x33')]=_0x2d284f[_0x7196('0x33')];_0x4e878f[_0x7196('0x34')]=_0x2d284f[_0x7196('0x34')];_0x4e878f[_0x7196('0x35')]=_0x2d284f[_0x7196('0x35')];_0x4e878f[_0x7196('0x36')]=_0x2d284f[_0x7196('0x36')];_0x4e878f[_0x7196('0x37')]=_0x2d284f['dialPrefix'];_0x4e878f[_0x7196('0x38')]=_0x2d284f['temp'];_0x4e878f[_0x7196('0x39')]=_0x2d284f['outboundAnswerAgiCallsDay'];_0x4e878f[_0x7196('0x3a')]=_0x2d284f[_0x7196('0x3a')];_0x4e878f['outboundBlacklistCallsDay']=_0x2d284f[_0x7196('0x3b')];_0x4e878f[_0x7196('0x3c')]=_0x2d284f[_0x7196('0x3c')];_0x4e878f[_0x7196('0x3d')]=_0x2d284f[_0x7196('0x3d')];_0x4e878f['outboundDropCallsDayACS']=_0x2d284f[_0x7196('0x3e')];_0x4e878f[_0x7196('0x3f')]=_0x2d284f[_0x7196('0x3f')];_0x4e878f[_0x7196('0x40')]=_0x2d284f[_0x7196('0x40')];_0x4e878f[_0x7196('0x41')]=_0x2d284f['outboundNoAnswerCallsDay'];_0x4e878f[_0x7196('0x42')]=_0x2d284f[_0x7196('0x42')];_0x4e878f[_0x7196('0x43')]=_0x2d284f['outboundOriginateFailureCallsDay'];_0x4e878f[_0x7196('0x44')]=_0x2d284f[_0x7196('0x44')];_0x4e878f[_0x7196('0x45')]=_0x2d284f[_0x7196('0x45')];_0x4e878f[_0x7196('0x46')]=_0x2d284f[_0x7196('0x46')];_0x4e878f[_0x7196('0x47')]=_0x2d284f[_0x7196('0x47')];_0x4e878f[_0x7196('0x48')]=_0x2d284f[_0x7196('0x48')];_0x4e878f['predictiveIntervalAvgTalktime']=_0x2d284f[_0x7196('0x49')];_0x4e878f[_0x7196('0x4a')]=_0x2d284f['predictiveIntervalDroppedCallsCallersExit'];_0x4e878f[_0x7196('0x4b')]=_0x2d284f['predictiveIntervalDroppedCallsTimeout'];_0x4e878f['predictiveIntervalErlangCalls']=_0x2d284f[_0x7196('0x4c')];_0x4e878f[_0x7196('0x4d')]=_0x2d284f['predictiveIntervalErlangCallsDroppedCalls'];_0x4e878f['predictiveIntervalHitRate']=_0x2d284f[_0x7196('0x4e')];_0x4e878f[_0x7196('0x4f')]=_0x2d284f[_0x7196('0x4f')];_0x4e878f['predictiveIntervalPauses']=_0x2d284f[_0x7196('0x50')];_0x4e878f[_0x7196('0x51')]=_0x2d284f[_0x7196('0x51')];_0x4e878f[_0x7196('0x52')]=_0x2d284f[_0x7196('0x52')];_0x4e878f[_0x7196('0x20')]=_0x2d284f[_0x7196('0x20')];_0x4e878f[_0x7196('0x53')]=_0x2d284f['originated'];_0x4e878f[_0x7196('0x54')]=_0x2d284f[_0x7196('0x54')];_0x4e878f['erlangCallToSecond']=_0x2d284f[_0x7196('0x55')];_0x4e878f[_0x7196('0x56')]=_0x2d284f['erlangAbandonmentRate'];_0x4e878f[_0x7196('0x57')]=_0x2d284f[_0x7196('0x57')];_0x4e878f[_0x7196('0x58')]=_0x2d284f['startPredictive'];_0x4e878f[_0x7196('0x59')]=_0x2d284f[_0x7196('0x59')];}if(_0x2d284f['Trunk']){_0x4e878f[_0x7196('0x5a')]={'id':_0x2d284f[_0x7196('0x5a')]['id'],'name':_0x2d284f['Trunk'][_0x7196('0xc')],'active':_0x2d284f['Trunk']['active'],'callerid':_0x2d284f['Trunk']['callerid']};}if(_0x2d284f['Interval']){_0x4e878f[_0x7196('0x5b')]={'id':_0x2d284f['Interval']['id'],'name':_0x2d284f[_0x7196('0x5b')][_0x7196('0xc')]};}_0x70aa65[_0x7196('0x5c')](_0x4e878f);}}_0x2e15c7({'count':_0x70aa65[_0x7196('0x5d')],'rows':_0x70aa65});});},'UpdateVoiceQueue':function(_0x522fbd){return new Promise(function(_0x3f3171,_0x56ffdd){var _0x12ee76=_[_0x7196('0x5e')](_0x3ae43f[_0x7196('0x26')],{'id':parseInt(_0x522fbd['id'])});var _0x5e34e8=_[_0x7196('0x5f')](_0x522fbd,['id']);if(_0x12ee76){for(var _0x44d8e5 in _0x5e34e8){if(typeof _0x5e34e8[_0x44d8e5]!==_0x7196('0x60')&&typeof _0x12ee76[_0x44d8e5]!=='undefined'){_0x12ee76[_0x44d8e5]=_0x5e34e8[_0x44d8e5];}}_0x3f3171(_0x12ee76);}else{_0x56ffdd();}});},'VoiceChannels':function(_0x4e2aad){return new Promise(function(_0x1faa7b,_0x5a7896){var _0x29c7e8=_['values'](_0x3ae43f['channels']);_0x1faa7b({'count':_0x29c7e8[_0x7196('0x5d')],'rows':_0x29c7e8});});},'VoiceChannelMixMonitor':function(_0x5de6f2){var _0x48f5e7=this;return new Promise(function(_0x516825,_0x2299e2){if(ami['isConnected']()==![]){return _0x2299e2(_0x48f5e7['error'](0x1f4,[config[_0x7196('0x16')]['ip'],config[_0x7196('0x16')][_0x7196('0x17')],_0x7196('0x61')]['join']('\x20')));}var _0x50cc66=schema(properties['voicechannel'])[_0x7196('0x2')](_0x5de6f2);if(_0x50cc66[_0x7196('0x5d')]>0x0){return _0x2299e2(_0x48f5e7['error'](0x1f4,_[_0x7196('0x62')](_0x50cc66,_0x7196('0x20'))[_0x7196('0x18')](',\x20')));}var _0x4fa18f=_[_0x7196('0x5e')](_0x3ae43f['channels'],{'uniqueid':_0x5de6f2[_0x7196('0x63')]});if(_0x4fa18f&&_0x4fa18f[_0x7196('0x64')]){var _0x179815=util[_0x7196('0x9')](_0x7196('0x65'),_0x5de6f2[_0x7196('0x66')]||_0x5de6f2[_0x7196('0x63')],_0x5de6f2[_0x7196('0x9')]||'wav');return ami['Action']({'action':_0x7196('0x67'),'channel':_0x4fa18f[_0x7196('0x64')],'file':_0x179815,'options':_0x7196('0x68')})[_0x7196('0x1f')](function(_0x4ebcd7){var _0x76b189=_[_0x7196('0x5e')](_0x4fa18f[_0x7196('0x69')],{'filename':_0x7196('0x6a')+_0x179815[_0x7196('0x6b')]()});if(_[_0x7196('0x6c')](_0x76b189)){_0x4fa18f[_0x7196('0x69')][_0x7196('0x5c')]({'filename':_0x7196('0x6a')+_0x179815[_0x7196('0x6b')](),'createdAt':moment()[_0x7196('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x4ebcd7[_0x7196('0x6d')],'status':_0x7196('0x6e')});}else{_0x76b189[_0x7196('0x6d')]=_0x4ebcd7['mixmonitorid'];_0x76b189[_0x7196('0x6f')]='rec';}_0x516825({'code':0xc8,'message':[_0x5de6f2[_0x7196('0x63')],_0x7196('0x70'),_0x4ebcd7[_0x7196('0x6d')]][_0x7196('0x18')]('\x20'),'mixmonitorid':_0x4ebcd7[_0x7196('0x6d')]});})['catch'](function(_0x3ece9f){_0x2299e2(_0x48f5e7['error'](0x1f5,[_0x5de6f2['uniqueid'],_0x3ece9f['message'][_0x7196('0x6b')]()][_0x7196('0x18')]('\x20')));});}else{return _0x2299e2(_0x48f5e7[_0x7196('0x15')](0x1f5,_0x7196('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0x105a3f){var _0x41fa94=this;return new Promise(function(_0x2d8b3d,_0x560ddb){if(ami[_0x7196('0x14')]()==![]){return _0x560ddb(_0x41fa94[_0x7196('0x15')](0x1f4,[config[_0x7196('0x16')]['ip'],config[_0x7196('0x16')][_0x7196('0x17')],'ami\x20disconnected']['join']('\x20')));}var _0xa7ecfb=schema(properties[_0x7196('0x72')])[_0x7196('0x2')](_0x105a3f);if(_0xa7ecfb[_0x7196('0x5d')]>0x0){return _0x560ddb(_0x41fa94[_0x7196('0x15')](0x1f4,_[_0x7196('0x62')](_0xa7ecfb,_0x7196('0x20'))[_0x7196('0x18')](',\x20')));}var _0x13e9d0=_[_0x7196('0x5e')](_0x3ae43f[_0x7196('0x73')],{'uniqueid':_0x105a3f['uniqueid']});if(_0x13e9d0){return BPromise[_0x7196('0x74')]()[_0x7196('0x1f')](function(){if(_0x13e9d0[_0x7196('0x64')]){return ami[_0x7196('0x1e')]({'action':'StopMixMonitor','channel':_0x13e9d0[_0x7196('0x64')],'mixmonitorid':_0x105a3f[_0x7196('0x6d')]})[_0x7196('0x21')](function(_0x38d0a0){});}})[_0x7196('0x1f')](function(){if(_0x13e9d0[_0x7196('0x75')]){return ami[_0x7196('0x1e')]({'action':'StopMixMonitor','channel':_0x13e9d0[_0x7196('0x75')],'mixmonitorid':_0x105a3f[_0x7196('0x6d')]})[_0x7196('0x21')](function(_0x3fb671){});}})['then'](function(_0x418a7a){var _0x3809c4=_[_0x7196('0x5e')](_0x13e9d0[_0x7196('0x69')],{'mixmonitorid':_0x105a3f[_0x7196('0x6d')]});if(_0x3809c4){_0x3809c4[_0x7196('0x6f')]=_0x7196('0x76');}})['then'](function(){var _0x56b2eb=util['format'](_0x7196('0x65'),_0x105a3f['filename']||_0x105a3f[_0x7196('0x63')],_0x105a3f[_0x7196('0x9')]||_0x7196('0x77'));var _0x37c7d4=_[_0x7196('0x5e')](_0x13e9d0[_0x7196('0x69')],{'filename':_0x7196('0x6a')+_0x56b2eb[_0x7196('0x6b')]()});if(_0x37c7d4){_0x37c7d4[_0x7196('0x6f')]='stop';}})['then'](function(){_0x2d8b3d({'code':0xc8,'message':[_0x105a3f[_0x7196('0x63')],_0x7196('0x78')][_0x7196('0x18')]('\x20')});})[_0x7196('0x21')](function(_0x30ddb6){_0x560ddb(_0x41fa94[_0x7196('0x15')](0x1f5,[_0x105a3f[_0x7196('0x63')],_0x30ddb6[_0x7196('0x20')]['toLowerCase']()]['join']('\x20')));});}else{return _0x560ddb(_0x41fa94[_0x7196('0x15')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x30d114){return new Promise(function(_0x52f532,_0x18efc7){var _0x2ffe1f=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x7a')]);_0x52f532({'count':_0x2ffe1f['length'],'rows':_0x2ffe1f});});},'VoiceQueuesChannel':function(_0x5a786a){var _0x33d301=this;return new Promise(function(_0x5328c5,_0x3d2bee){var _0x326f61=schema(properties[_0x7196('0x7b')])[_0x7196('0x2')](_0x5a786a);if(_0x326f61[_0x7196('0x5d')]>0x0){return _0x3d2bee(_0x33d301[_0x7196('0x15')](0x1f4,_['map'](_0x326f61,_0x7196('0x20'))[_0x7196('0x18')](',\x20')));}var _0x41208b=_[_0x7196('0x5e')](_0x3ae43f[_0x7196('0x7a')],{'uniqueid':_0x5a786a[_0x7196('0x63')]});if(_0x41208b){_0x5328c5(_0x41208b);}else{return _0x3d2bee(_0x33d301[_0x7196('0x15')](0x1f5,_0x7196('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x13cbe2){var _0xa20de8=this;return new Promise(function(_0x3d3768,_0x2181f5){if(ami['isConnected']()==![]){return _0x2181f5(_0xa20de8[_0x7196('0x15')](0x1f4,[config[_0x7196('0x16')]['ip'],config['asterisk']['username'],_0x7196('0x61')][_0x7196('0x18')]('\x20')));}var _0x71c062=schema(properties['voicequeuechannelhangup'])[_0x7196('0x2')](_0x13cbe2);if(_0x71c062['length']>0x0){return _0x2181f5(_0xa20de8[_0x7196('0x15')](0x1f4,_[_0x7196('0x62')](_0x71c062,'message')[_0x7196('0x18')](',\x20')));}var _0x59f5ac=_['find'](_0x3ae43f[_0x7196('0x7a')],{'uniqueid':_0x13cbe2[_0x7196('0x63')]});if(_0x59f5ac&&_0x59f5ac[_0x7196('0x64')]){return ami['Action']({'action':_0x7196('0x7c'),'channel':_0x59f5ac['channel']})[_0x7196('0x1f')](function(_0x36b828){_0x3d3768({'code':0xc8,'message':[_0x13cbe2[_0x7196('0x63')],_0x36b828[_0x7196('0x20')][_0x7196('0x6b')]()]['join']('\x20')});})[_0x7196('0x21')](function(_0x13c8c0){_0x2181f5(_0xa20de8[_0x7196('0x15')](0x1f5,[_0x13cbe2[_0x7196('0x63')],_0x13c8c0[_0x7196('0x20')][_0x7196('0x6b')]()][_0x7196('0x18')]('\x20')));});}else{return _0x2181f5(_0xa20de8[_0x7196('0x15')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2be199){var _0x1919d8=this;return new Promise(function(_0x28a29d,_0x2b899d){if(ami['isConnected']()==![]){return _0x2b899d(_0x1919d8[_0x7196('0x15')](0x1f4,[config[_0x7196('0x16')]['ip'],config['asterisk'][_0x7196('0x17')],'ami\x20disconnected'][_0x7196('0x18')]('\x20')));}var _0x5318c1=schema(properties[_0x7196('0x7d')])[_0x7196('0x2')](_0x2be199);if(_0x5318c1['length']>0x0){return _0x2b899d(_0x1919d8[_0x7196('0x15')](0x1f4,_[_0x7196('0x62')](_0x5318c1,_0x7196('0x20'))['join'](',\x20')));}var _0x548ac9=_[_0x7196('0x5e')](_0x3ae43f['queueChannels'],{'uniqueid':_0x2be199['uniqueid']});if(_0x548ac9&&_0x548ac9[_0x7196('0x64')]){return ami[_0x7196('0x1e')]({'action':_0x7196('0x7e'),'channel':_0x548ac9['channel'],'exten':_0x2be199[_0x7196('0x7f')],'context':_0x2be199[_0x7196('0x80')]||_0x548ac9[_0x7196('0x80')],'priority':0x1})[_0x7196('0x1f')](function(_0x3392d1){_0x28a29d({'code':0xc8,'message':[_0x2be199[_0x7196('0x63')],_0x3392d1[_0x7196('0x20')][_0x7196('0x6b')]()][_0x7196('0x18')]('\x20')});})[_0x7196('0x21')](function(_0x173fe5){_0x2b899d(_0x1919d8['error'](0x1f5,[_0x2be199['uniqueid'],_0x173fe5[_0x7196('0x20')]['toLowerCase']()]['join']('\x20')));});}else{return _0x2b899d(_0x1919d8[_0x7196('0x15')](0x1f5,_0x7196('0x71')));}});},'Agents':function(_0x2f686c){return new Promise(function(_0x3fe7fd,_0x4c9a66){var _0x50f2c4=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x10')]);_0x3fe7fd({'count':_0x50f2c4[_0x7196('0x5d')],'rows':_0x50f2c4});});},'Telephones':function(_0x247b15){return new Promise(function(_0x4bcaa3,_0x4d8b8e){var _0x4afbee=_['values'](_0x3ae43f[_0x7196('0x81')]);_0x4bcaa3({'count':_0x4afbee[_0x7196('0x5d')],'rows':_0x4afbee});});},'Trunks':function(_0x1e14da){return new Promise(function(_0x494418,_0x400aa5){var _0x40d4c3=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x82')]);_0x494418({'count':_0x40d4c3[_0x7196('0x5d')],'rows':_0x40d4c3});});},'OutboundChannels':function(_0x3e06c4){return new Promise(function(_0x214ec2,_0x3e729a){var _0x5de550=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x83')]);_0x214ec2({'count':_0x5de550[_0x7196('0x5d')],'rows':_0x5de550});});},'Outbound':function(_0x408760){return new Promise(function(_0x1a1c82,_0x4faf7b){_0x1a1c82(_0x3ae43f[_0x7196('0x84')]);});},'Campaigns':function(_0x11d823){return new Promise(function(_0x446eb8,_0x5a8c14){var _0x123e8c=_['values'](_0x3ae43f['campaigns']);_0x446eb8({'count':_0x123e8c[_0x7196('0x5d')],'rows':_0x123e8c});});},'VoiceQueuesPreview':function(_0x25d323){var _0x5b85f7=this;return new Promise(function(_0x200721,_0x40eb16){_0x5c128f['run'](_0x25d323['id'])[_0x7196('0x1f')](function(_0xdd5f69){_0x200721({'code':0xc8,'message':_0xdd5f69[_0x7196('0x20')]});})[_0x7196('0x21')](function(_0x441ca1){_0x40eb16(_0x5b85f7[_0x7196('0x15')](0x1f4,_0x441ca1['message']));});});},'EventManager':function(_0x3639be){var _0x460e51=this;return new Promise(function(_0x1ee49a,_0x5b09a1){if(!_0x3639be['event']){return _0x5b09a1(_0x460e51['error'](0x1f4,_0x7196('0x85')));}ami[_0x7196('0x86')](_0x7196('0x87')+_0x3639be['event'],_0x3639be[_0x7196('0x20')]);_0x1ee49a({'code':0xc8,'message':_0x3639be});});},'FaxAccounts':function(_0x503d1f){return new Promise(function(_0x15395f,_0x4e22df){var _0x389b5b=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x88')]);_0x15395f({'count':_0x389b5b[_0x7196('0x5d')],'rows':_0x389b5b});});},'SendFax':function(_0x37290e){var _0x10b628=this;return new Promise(function(_0x43e7d5,_0x48608b){_0x36b01e[_0x7196('0x89')](_0x37290e)['then'](function(_0x58fd39){_0x43e7d5({'code':0xc8,'message':_0x58fd39['message']});})['catch'](function(_0x4cf635){_0x48608b(_0x10b628[_0x7196('0x15')](0x1f4,_0x4cf635[_0x7196('0x20')]));});});},'CheckAfterSend':function(_0x3fe3f5){var _0x5bab25=this;return new Promise(function(_0x3e7195,_0x49bf7e){_0x36b01e['checkAfterSend'](_0x3fe3f5)['then'](function(_0x42b45d){_0x3e7195({'code':0xc8,'message':_0x42b45d['message']});})[_0x7196('0x21')](function(_0x2fe382){_0x49bf7e(_0x5bab25[_0x7196('0x15')](0x1f4,_0x2fe382[_0x7196('0x20')]));});});}};var _0x1cdb13=jayson[_0x7196('0x8a')](_0x40e0af)[_0x7196('0x8b')]();_0x1cdb13['on'](_0x7196('0x15'),function(_0x49d494){return _0x194746(_0x49d494);});_0x1cdb13[_0x7196('0x8')](0x232a,_0x7196('0x8c'),function(){console[_0x7196('0x8d')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x186175(_0x7196('0x8e')+0x232a);});});};
\ No newline at end of file
index 99e200a..bb42149 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ea=['scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','firstName','calleridname','<unknown>','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','format','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName'];(function(_0x536f9f,_0x50116a){var _0x2012bc=function(_0x18256a){while(--_0x18256a){_0x536f9f['push'](_0x536f9f['shift']());}};_0x2012bc(++_0x50116a);}(_0xd2ea,0x15f));var _0xad2e=function(_0x580fe5,_0x5a7b4a){_0x580fe5=_0x580fe5-0x0;var _0x5a8770=_0xd2ea[_0x580fe5];return _0x5a8770;};'use strict';var _=require(_0xad2e('0x0'));var BPromise=require(_0xad2e('0x1'));var Redis=require(_0xad2e('0x2'));var util=require(_0xad2e('0x3'));var config=require(_0xad2e('0x4'));var logger=require('../../../../config/logger')(_0xad2e('0x5'));var cmContactRpc=require(_0xad2e('0x6'));config[_0xad2e('0x7')]=_[_0xad2e('0x8')](config[_0xad2e('0x7')],{'host':_0xad2e('0x9'),'port':0x18eb});var io=require(_0xad2e('0xa'))(new Redis(config['redis']));function emit(_0x3b5170,_0x3e3d1f,_0x2ff7b2,_0x5710ac,_0x1e0e9e){logger[_0xad2e('0xb')]('[CM][%s][%s]',_0x3b5170,_0x3e3d1f['id'],_0x2ff7b2,_0x5710ac,JSON[_0xad2e('0xc')](_0x1e0e9e));io['to'](_0x2ff7b2)['emit'](_0x5710ac,_0x1e0e9e);}exports[_0xad2e('0xd')]=function(_0x415a41,_0x9879f2,_0x24c5da,_0x489f25){var _0x7df3c6,_0x5707a5;var _0x42d2ac={};var _0x347559=Number(_0x24c5da[_0xad2e('0xe')]);var _0x42e2f2=_0x24c5da['data2']?Boolean(Number(_0x24c5da[_0xad2e('0xf')])):![];var _0x59201f;var _0x1a91ce=![];if(!_['isNil'](_0x24c5da['data5'])){if(_0x24c5da['data5']=='1')_0x1a91ce=!![];}if(!_0x1a91ce){if(_0x489f25['xmd-contactid']){_0x42d2ac['id']=_0x489f25[_0xad2e('0x10')];}}if(!_0x42d2ac['id']){_0x42d2ac[_0xad2e('0x11')]=_0x347559;_0x59201f=_0x24c5da[_0xad2e('0x12')]&&_0x24c5da[_0xad2e('0x12')]!=='0'?_0x24c5da[_0xad2e('0x12')][_0xad2e('0x13')](','):[_0xad2e('0x14')];_0x42d2ac[_0xad2e('0x15')]=_[_0xad2e('0x16')](_0x59201f,function(_0xbc6df0){var _0x2af208={};_0x2af208[_0xbc6df0]=_0x489f25[_0xad2e('0x17')]?_0x489f25[_0xad2e('0x18')]:_0x489f25[_0xad2e('0x19')];return _0x2af208;});}var _0x163e83=['id','firstName',_0xad2e('0x1a'),_0xad2e('0x14'),'mobile','fax','ListId','createdAt',_0xad2e('0x1b'),_0xad2e('0x1c')];var _0x5549db=_[_0xad2e('0x1d')](_0x163e83,_0x59201f);BPromise[_0xad2e('0x1e')]()[_0xad2e('0x1f')](cmContactRpc[_0xad2e('0x20')]({'attributes':_0x5549db,'where':_0x42d2ac}))[_0xad2e('0x1f')](function(_0x102169){_0x5707a5=_0x102169;if(!_[_0xad2e('0x21')](_0x5707a5)){if(_0x5707a5[_0xad2e('0x22')]===0x1){_0x7df3c6=_0x5707a5[0x0];logger[_0xad2e('0xb')](_0xad2e('0x23'),_0x489f25[_0xad2e('0x24')],_0x9879f2['id'],_0x7df3c6['id']);}else{logger[_0xad2e('0xb')](_0xad2e('0x25'),_0x489f25['uniqueid'],_0x9879f2['id'],_[_0xad2e('0x16')](_0x5707a5,'id')[_0xad2e('0x26')](','));}return;}else{logger[_0xad2e('0xb')](_0xad2e('0x27'),_0x489f25[_0xad2e('0x24')],_0x9879f2['id']);var _0x58acc8={'ListId':_0x347559};var _0x1161d5=_0x24c5da[_0xad2e('0x28')]&&_0x24c5da[_0xad2e('0x28')]!=='0'?_0x24c5da['data4']:_0xad2e('0x14');if(_0x42e2f2){logger['info'](_0xad2e('0x29'),_0x489f25[_0xad2e('0x24')],_0x9879f2['id']);_0x58acc8[_0x1161d5]=_[_0xad2e('0x2a')](_0x489f25[_0xad2e('0x17')])?_0x489f25[_0xad2e('0x19')]:_0x489f25[_0xad2e('0x18')];if(_[_0xad2e('0x2a')](_0x489f25[_0xad2e('0x17')])){_0x58acc8[_0xad2e('0x2b')]=_0x489f25[_0xad2e('0x2c')]&&_0x489f25['calleridname']!==_0xad2e('0x2d')?_0x489f25[_0xad2e('0x2c')]:_0xad2e('0x2e');}else{_0x58acc8[_0xad2e('0x2b')]=_0x489f25[_0xad2e('0x2f')]&&_0x489f25[_0xad2e('0x2f')]!==_0xad2e('0x2d')?_0x489f25[_0xad2e('0x2f')]:_0xad2e('0x2e');}return BPromise[_0xad2e('0x1e')]()[_0xad2e('0x1f')](cmContactRpc['createContact'](_0x58acc8))[_0xad2e('0x1f')](function(_0x55e1dc){_0x7df3c6=_0x55e1dc;_0x5707a5[_0xad2e('0x30')](_0x55e1dc);if(_0x7df3c6){logger[_0xad2e('0xb')](_0xad2e('0x31'),_0x489f25[_0xad2e('0x24')],_0x9879f2['id'],_0x7df3c6['id']);}return;});}else{logger[_0xad2e('0xb')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x489f25[_0xad2e('0x24')],_0x9879f2['id']);_0x58acc8[_0x1161d5]=_[_0xad2e('0x2a')](_0x489f25['routeId'])?_0x489f25[_0xad2e('0x19')]:_0x489f25[_0xad2e('0x18')];if(_['isNil'](_0x489f25[_0xad2e('0x17')])){_0x58acc8[_0xad2e('0x2b')]=_0x489f25[_0xad2e('0x2c')]&&_0x489f25[_0xad2e('0x2c')]!==_0xad2e('0x2d')?_0x489f25[_0xad2e('0x2c')]:_0xad2e('0x2e');}else{_0x58acc8['firstName']=_0x489f25[_0xad2e('0x2f')]&&_0x489f25[_0xad2e('0x2f')]!=='<unknown>'?_0x489f25[_0xad2e('0x2f')]:_0xad2e('0x2e');}_0x7df3c6=_0x58acc8;_0x5707a5[_0xad2e('0x30')](_0x58acc8);return;}}})[_0xad2e('0x1f')](function(){if(_0x415a41){emit(_0x489f25[_0xad2e('0x24')],_0x9879f2,util[_0xad2e('0x32')]('user:%s',_0x415a41['name']),util[_0xad2e('0x32')]('trigger:%s',_0x24c5da[_0xad2e('0x33')][_0xad2e('0x34')]()),{'evt':_[_0xad2e('0x35')](_0x489f25,{'autoCreate':_0x42e2f2}),'contact':_0x7df3c6===undefined?{}:_0x7df3c6,'contacts':_0x5707a5[_0xad2e('0x22')]===0x0?undefined:_0x5707a5});}});};
\ No newline at end of file
+var _0xb458=['redis','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','format','user:%s','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xb458,0x103));var _0x8b45=function(_0x535ad6,_0x22b56c){_0x535ad6=_0x535ad6-0x0;var _0x12d4f6=_0xb458[_0x535ad6];return _0x12d4f6;};'use strict';var _=require(_0x8b45('0x0'));var BPromise=require(_0x8b45('0x1'));var Redis=require(_0x8b45('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x8b45('0x3'))(_0x8b45('0x4'));var cmContactRpc=require(_0x8b45('0x5'));config[_0x8b45('0x6')]=_['defaults'](config[_0x8b45('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b45('0x6')]));function emit(_0x12bd05,_0x2daa9a,_0x3a8ccb,_0x32342f,_0x4d1718){logger[_0x8b45('0x7')](_0x8b45('0x8'),_0x12bd05,_0x2daa9a['id'],_0x3a8ccb,_0x32342f,JSON[_0x8b45('0x9')](_0x4d1718));io['to'](_0x3a8ccb)[_0x8b45('0xa')](_0x32342f,_0x4d1718);}exports[_0x8b45('0xb')]=function(_0x499899,_0x2a4c83,_0x7cc49b,_0x57faf9){var _0x5316af,_0x5bb708;var _0x4e28bb={};var _0x43a4c3=Number(_0x7cc49b[_0x8b45('0xc')]);var _0x37c220=_0x7cc49b['data2']?Boolean(Number(_0x7cc49b[_0x8b45('0xd')])):![];var _0x455ecf;var _0x42bb72=![];if(!_[_0x8b45('0xe')](_0x7cc49b[_0x8b45('0xf')])){if(_0x7cc49b[_0x8b45('0xf')]=='1')_0x42bb72=!![];}if(!_0x42bb72){if(_0x57faf9['xmd-contactid']){_0x4e28bb['id']=_0x57faf9['xmd-contactid'];}}if(!_0x4e28bb['id']){_0x4e28bb[_0x8b45('0x10')]=_0x43a4c3;_0x455ecf=_0x7cc49b[_0x8b45('0x11')]&&_0x7cc49b[_0x8b45('0x11')]!=='0'?_0x7cc49b[_0x8b45('0x11')][_0x8b45('0x12')](','):[_0x8b45('0x13')];_0x4e28bb[_0x8b45('0x14')]=_[_0x8b45('0x15')](_0x455ecf,function(_0x33102e){var _0x391d1e={};_0x391d1e[_0x33102e]=_0x57faf9[_0x8b45('0x16')]?_0x57faf9[_0x8b45('0x17')]:_0x57faf9[_0x8b45('0x18')];return _0x391d1e;});}var _0x43ffb7=['id',_0x8b45('0x19'),_0x8b45('0x1a'),_0x8b45('0x13'),_0x8b45('0x1b'),'fax',_0x8b45('0x10'),_0x8b45('0x1c'),_0x8b45('0x1d'),_0x8b45('0x1e')];var _0x3e1438=_[_0x8b45('0x1f')](_0x43ffb7,_0x455ecf);BPromise[_0x8b45('0x20')]()[_0x8b45('0x21')](cmContactRpc['getContacts']({'attributes':_0x3e1438,'where':_0x4e28bb}))['then'](function(_0x41154a){_0x5bb708=_0x41154a;if(!_['isEmpty'](_0x5bb708)){if(_0x5bb708[_0x8b45('0x22')]===0x1){_0x5316af=_0x5bb708[0x0];logger[_0x8b45('0x7')](_0x8b45('0x23'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_0x5316af['id']);}else{logger[_0x8b45('0x7')](_0x8b45('0x25'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_['map'](_0x5bb708,'id')['join'](','));}return;}else{logger[_0x8b45('0x7')](_0x8b45('0x26'),_0x57faf9['uniqueid'],_0x2a4c83['id']);var _0x5723a2={'ListId':_0x43a4c3};var _0x129c35=_0x7cc49b[_0x8b45('0x27')]&&_0x7cc49b[_0x8b45('0x27')]!=='0'?_0x7cc49b[_0x8b45('0x27')]:'phone';if(_0x37c220){logger[_0x8b45('0x7')](_0x8b45('0x28'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id']);_0x5723a2[_0x129c35]=_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])?_0x57faf9[_0x8b45('0x18')]:_0x57faf9[_0x8b45('0x17')];if(_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])){_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x29')]&&_0x57faf9[_0x8b45('0x29')]!==_0x8b45('0x2a')?_0x57faf9['calleridname']:_0x8b45('0x2b');}else{_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x2c')]&&_0x57faf9[_0x8b45('0x2c')]!==_0x8b45('0x2a')?_0x57faf9[_0x8b45('0x2c')]:_0x8b45('0x2b');}return BPromise[_0x8b45('0x20')]()['then'](cmContactRpc[_0x8b45('0x2d')](_0x5723a2))[_0x8b45('0x21')](function(_0x50302){_0x5316af=_0x50302;_0x5bb708[_0x8b45('0x2e')](_0x50302);if(_0x5316af){logger[_0x8b45('0x7')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_0x5316af['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id']);_0x5723a2[_0x129c35]=_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])?_0x57faf9[_0x8b45('0x18')]:_0x57faf9[_0x8b45('0x17')];if(_[_0x8b45('0xe')](_0x57faf9['routeId'])){_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x29')]&&_0x57faf9[_0x8b45('0x29')]!==_0x8b45('0x2a')?_0x57faf9['calleridname']:_0x8b45('0x2b');}else{_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x2c')]&&_0x57faf9['destcalleridname']!==_0x8b45('0x2a')?_0x57faf9[_0x8b45('0x2c')]:_0x8b45('0x2b');}_0x5316af=_0x5723a2;_0x5bb708['push'](_0x5723a2);return;}}})[_0x8b45('0x21')](function(){if(_0x499899){emit(_0x57faf9[_0x8b45('0x24')],_0x2a4c83,util[_0x8b45('0x2f')](_0x8b45('0x30'),_0x499899['name']),util[_0x8b45('0x2f')](_0x8b45('0x31'),_0x7cc49b[_0x8b45('0x32')][_0x8b45('0x33')]()),{'evt':_[_0x8b45('0x34')](_0x57faf9,{'autoCreate':_0x37c220}),'contact':_0x5316af===undefined?{}:_0x5316af,'contacts':_0x5bb708[_0x8b45('0x22')]===0x0?undefined:_0x5bb708});}});};
\ No newline at end of file
index eecf936..d4ef5d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd2d=['data3','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','winApplication','format','user:%s','trigger:%s:%s','data1','jscripty','name','trigger:%s','exec','integration','queue','urlforward','script','parse','query','channel','AllConditions','length','every','checkConditions','AnyConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','membername','lastevent','routeId','lodash','url','mustache','ioredis','./urlforward','./cmContact','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:amd','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','TemplateId','html','data2','render','uri','isNil'];(function(_0x2a153b,_0x2d5c66){var _0x37d930=function(_0x1e3bb8){while(--_0x1e3bb8){_0x2a153b['push'](_0x2a153b['shift']());}};_0x37d930(++_0x2d5c66);}(_0xfd2d,0x17d));var _0xdfd2=function(_0x3492f1,_0x1a3170){_0x3492f1=_0x3492f1-0x0;var _0x3a094c=_0xfd2d[_0x3492f1];return _0x3a094c;};'use strict';var util=require('util');var _=require(_0xdfd2('0x0'));var url=require(_0xdfd2('0x1'));var Mustache=require(_0xdfd2('0x2'));var Redis=require(_0xdfd2('0x3'));var urlforward=require(_0xdfd2('0x4'));var integration=require('./integration');var cmContact=require(_0xdfd2('0x5'));var script=require('./script');var config=require(_0xdfd2('0x6'));var logger=require(_0xdfd2('0x7'))('trigger');var ami=require(_0xdfd2('0x8'));config[_0xdfd2('0x9')]=_[_0xdfd2('0xa')](config[_0xdfd2('0x9')],{'host':_0xdfd2('0xb'),'port':0x18eb});var io=require(_0xdfd2('0xc'))(new Redis(config[_0xdfd2('0x9')]));var operators={'equals':function(_0x180cc4,_0xc7f336){return _0x180cc4==_0xc7f336;},'not_equals':function(_0x407dae,_0x1819c1){return _0x407dae!=_0x1819c1;}};var barAndWebActions=['popup',_0xdfd2('0x1'),_0xdfd2('0xd')];function Trigger(_0x13b226){this[_0xdfd2('0xe')]=_0x13b226[_0xdfd2('0xe')];this[_0xdfd2('0xf')]=_0x13b226[_0xdfd2('0xf')];this[_0xdfd2('0x10')]=_0x13b226[_0xdfd2('0x10')];this[_0xdfd2('0x11')]=_0x13b226[_0xdfd2('0x11')];this[_0xdfd2('0x12')]=_0x13b226[_0xdfd2('0x12')];this[_0xdfd2('0x13')]=_0x13b226[_0xdfd2('0x13')];this[_0xdfd2('0x14')]=_0x13b226[_0xdfd2('0x14')];this[_0xdfd2('0x15')]=_0x13b226[_0xdfd2('0x15')];this[_0xdfd2('0x16')]=_0x13b226['sugarcrmAccounts'];this[_0xdfd2('0x17')]=_0x13b226[_0xdfd2('0x17')];this[_0xdfd2('0x18')]=_0x13b226[_0xdfd2('0x18')];this['vtigerAccounts']=_0x13b226[_0xdfd2('0x19')];this[_0xdfd2('0x1a')]=_0x13b226[_0xdfd2('0x1a')];this[_0xdfd2('0x1b')]=_0x13b226[_0xdfd2('0x1b')];this[_0xdfd2('0x1c')]=_0x13b226[_0xdfd2('0x1c')];this[_0xdfd2('0x1d')]={'zendesk':this[_0xdfd2('0x13')],'salesforce':this[_0xdfd2('0x15')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xdfd2('0x16')],'zoho':this[_0xdfd2('0x17')],'desk':this[_0xdfd2('0x18')],'vtiger':this[_0xdfd2('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xdfd2('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0xdfd2('0x1e'),this['syncCustomEvent'][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x20'),this[_0xdfd2('0x21')]['bind'](this));ami['on'](_0xdfd2('0x22'),this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x23'),this[_0xdfd2('0x21')]['bind'](this));ami['on'](_0xdfd2('0x24'),this[_0xdfd2('0x21')]['bind'](this));ami['on']('custom:agentnoanswer',this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));ami['on']('custom:agentbusy',this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0xdfd2('0x1f')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x25'),this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x26'),this[_0xdfd2('0x21')]['bind'](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0xdfd2('0x1f')](this));ami['on']('custom:dialbegin',this[_0xdfd2('0x27')]['bind'](this));ami['on'](_0xdfd2('0x28'),this['syncAgentDial'][_0xdfd2('0x1f')](this));ami['on']('custom:dialend',this[_0xdfd2('0x27')][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x29'),this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x2a'),this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));ami['on']('custom:substatus',this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x2b'),this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x2c'),this['syncCustomEvent'][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x2d'),this['syncCustomEvent'][_0xdfd2('0x1f')](this));ami['on'](_0xdfd2('0x2e'),this[_0xdfd2('0x21')][_0xdfd2('0x1f')](this));}Trigger[_0xdfd2('0x2f')][_0xdfd2('0x30')]=function(_0x279127,_0x2fe5cb,_0x56b9a1){logger['info'](_0x279127,_0x2fe5cb,JSON[_0xdfd2('0x31')](_0x56b9a1));io['to'](_0x279127)[_0xdfd2('0x30')](_0x2fe5cb,_0x56b9a1);};Trigger[_0xdfd2('0x2f')][_0xdfd2('0x21')]=function(_0xd8e5c3){var _0x30c1f2=_[_0xdfd2('0x32')](_0xd8e5c3);if(typeof _0x30c1f2[_0xdfd2('0x33')]==='undefined'){_0x30c1f2[_0xdfd2('0x33')]=_0xdfd2('0x34');}this[_0xdfd2('0x35')](_0x30c1f2);};Trigger['prototype'][_0xdfd2('0x27')]=function(_0xd64aba){if(this['agents'][_0xd64aba[_0xdfd2('0x36')]]){this[_0xdfd2('0x21')](_0xd64aba);}};Trigger[_0xdfd2('0x2f')][_0xdfd2('0x35')]=function(_0x5f4d4c){var _0x58583b;for(var _0x2da7e in this['triggers']){if(this[_0xdfd2('0xe')][_0xdfd2('0x37')](_0x2da7e)){if(this[_0xdfd2('0xe')][_0x2da7e][_0xdfd2('0x38')]){_0x58583b=this[_0xdfd2('0x39')](this[_0xdfd2('0xe')][_0x2da7e],_0x5f4d4c);if(_0x58583b){_[_0xdfd2('0x3a')](_0x5f4d4c,_0x5f4d4c[_0xdfd2('0x3b')]);for(var _0xad8373=0x0,_0x1bd945,_0x194758,_0x27fa54;_0xad8373<this[_0xdfd2('0xe')][_0x2da7e][_0xdfd2('0x3c')]['length'];_0xad8373+=0x1){_0x1bd945=this[_0xdfd2('0xe')][_0x2da7e][_0xdfd2('0x3c')][_0xad8373];if(this[_0xdfd2('0xf')][_0x5f4d4c['interface']]){switch(_0x1bd945[_0xdfd2('0x3d')][_0xdfd2('0x3e')]()){case _0xdfd2('0x3f'):break;case _0xdfd2('0x40'):case'browser':var _0x20bf3c={};switch(barAndWebActions[_0x1bd945['data1']]){case'popup':_0x20bf3c[_0xdfd2('0x41')]=_0x1bd945['data2'];_0x20bf3c[_0xdfd2('0x42')]=this[_0xdfd2('0x11')][_0x1bd945[_0xdfd2('0x43')]]?Mustache[_0xdfd2('0x44')](this[_0xdfd2('0x11')][_0x1bd945['data2']][_0xdfd2('0x42')],_0x5f4d4c):'template\x20not\x20found';break;case _0xdfd2('0x1'):_0x20bf3c[_0xdfd2('0x45')]=this['buildUri'](_0x1bd945[_0xdfd2('0x43')],_0x5f4d4c,_[_0xdfd2('0x46')](_0x1bd945['data3'])?!![]:parseInt(_0x1bd945[_0xdfd2('0x47')],0xa));if(_[_0xdfd2('0x46')](_0x1bd945[_0xdfd2('0x48')])){_0x20bf3c['location']='0';}else{_0x20bf3c[_0xdfd2('0x49')]=_0x1bd945[_0xdfd2('0x48')];_0x20bf3c[_0xdfd2('0x4a')]=_[_0xdfd2('0x46')](_0x1bd945[_0xdfd2('0x4b')])?_0xdfd2('0x4c'):_0x1bd945[_0xdfd2('0x4b')];_0x20bf3c[_0xdfd2('0x4d')]=_[_0xdfd2('0x46')](_0x1bd945[_0xdfd2('0x4e')])?'600':_0x1bd945[_0xdfd2('0x4e')];}break;case _0xdfd2('0xd'):_0x20bf3c[_0xdfd2('0x4f')]=_0x1bd945[_0xdfd2('0x43')]?Mustache['render'](_0x1bd945[_0xdfd2('0x43')],_0x5f4d4c):'';_0x20bf3c['winArguments']=_0x1bd945[_0xdfd2('0x47')]?Mustache[_0xdfd2('0x44')](_0x1bd945[_0xdfd2('0x47')],_0x5f4d4c):'';break;}this[_0xdfd2('0x30')](util[_0xdfd2('0x50')](_0xdfd2('0x51'),this['agents'][_0x5f4d4c['interface']]['name']),util['format'](_0xdfd2('0x52'),_0x1bd945[_0xdfd2('0x3d')][_0xdfd2('0x3e')](),barAndWebActions[_0x1bd945[_0xdfd2('0x53')]]),_[_0xdfd2('0x3a')](_0x20bf3c,_0x5f4d4c));break;case _0xdfd2('0x54'):this[_0xdfd2('0x30')](util['format'](_0xdfd2('0x51'),this[_0xdfd2('0xf')][_0x5f4d4c['interface']][_0xdfd2('0x55')]),util[_0xdfd2('0x50')](_0xdfd2('0x56'),_0x1bd945[_0xdfd2('0x3d')]['toLowerCase']()),_[_0xdfd2('0x3a')]({'ProjectId':parseInt(_0x1bd945[_0xdfd2('0x53')],0xa)},_0x5f4d4c));break;default:this[_0xdfd2('0x30')](util['format'](_0xdfd2('0x51'),this['agents'][_0x5f4d4c[_0xdfd2('0x36')]][_0xdfd2('0x55')]),util['format']('trigger:%s',_0x1bd945[_0xdfd2('0x3d')]['toLowerCase']()),_[_0xdfd2('0x3a')]({},_0x1bd945,_0x5f4d4c));}}switch(_0x1bd945[_0xdfd2('0x3d')][_0xdfd2('0x3e')]()){case _0xdfd2('0x3f'):cmContact[_0xdfd2('0x57')](this[_0xdfd2('0xf')][_0x5f4d4c[_0xdfd2('0x36')]],this[_0xdfd2('0xe')][_0x2da7e],_0x1bd945,_0x5f4d4c);break;case _0xdfd2('0x58'):integration['exec'](_0x1bd945,_0x5f4d4c,this[_0xdfd2('0x1d')],this['agents'][_0x5f4d4c[_0xdfd2('0x36')]],this[_0xdfd2('0x10')][_0x5f4d4c[_0xdfd2('0x59')]],this[_0xdfd2('0x12')][_0x5f4d4c['routeId']]);break;case _0xdfd2('0x5a'):urlforward[_0xdfd2('0x57')](_0x1bd945,_0x5f4d4c);break;case _0xdfd2('0x5b'):script[_0xdfd2('0x57')](_0x1bd945,_0x5f4d4c);break;}}}}}}};Trigger['prototype']['buildUri']=function(_0x5911d1,_0x50b9c8,_0x2f6472){var _0x2108ce=url[_0xdfd2('0x5c')](Mustache[_0xdfd2('0x44')](_0x5911d1,_0x50b9c8),!![]);if(_0x2f6472){_[_0xdfd2('0x3a')](_0x2108ce[_0xdfd2('0x5d')],_0x50b9c8);}delete _0x2108ce['search'];var _0x21c0fd=url['format'](_0x2108ce);_0x21c0fd=_0x21c0fd['replace'](/\/\?/g,'?');return _0x21c0fd;};Trigger[_0xdfd2('0x2f')][_0xdfd2('0x39')]=function(_0x324952,_0x579122){var _0x9a1c75=!![];var _0x1d5a7f=!![];var _0x34ad62=![];if(_0x324952[_0xdfd2('0x5e')]===_0x579122[_0xdfd2('0x33')]){_0x34ad62=!![];}if(_0x324952[_0xdfd2('0x5f')][_0xdfd2('0x60')]){_0x9a1c75=_[_0xdfd2('0x61')](_0x324952[_0xdfd2('0x5f')],this[_0xdfd2('0x62')](_0x579122,_0x324952[_0xdfd2('0x5e')]));}if(_0x324952[_0xdfd2('0x63')]['length']){_0x1d5a7f=_['some'](_0x324952[_0xdfd2('0x63')],this[_0xdfd2('0x62')](_0x579122,_0x324952[_0xdfd2('0x5e')]));}return _0x34ad62&&_0x9a1c75&&_0x1d5a7f;};Trigger['prototype'][_0xdfd2('0x62')]=function(_0x13253f,_0x16449e){return function(_0x5975dc){switch(_0x5975dc[_0xdfd2('0x64')]){case _0xdfd2('0x65'):if(_0x13253f[_0xdfd2('0x5e')]===_0x16449e){if(_0x16449e===_0xdfd2('0x66')){return _0x13253f[_0xdfd2('0x67')]?operators[_0x5975dc[_0xdfd2('0x68')]](Number(_0x5975dc[_0xdfd2('0x69')]),_0x13253f[_0xdfd2('0x67')]):![];}else{return _0x13253f[_[_0xdfd2('0x6a')](_0x16449e)+_0xdfd2('0x6b')]?operators[_0x5975dc['operator']](Number(_0x5975dc['value']),_0x13253f[_['upperFirst'](_0x16449e)+_0xdfd2('0x6b')]):![];}}break;case'interaction':case _0xdfd2('0x6c'):if(_0x13253f[_0xdfd2('0x5e')]===_0x16449e){return _0x13253f['event']?operators[_0x5975dc['operator']](_0x5975dc[_0xdfd2('0x69')],_0x13253f[_0xdfd2('0x6d')]):![];}break;case _0xdfd2('0x59'):return _0x13253f[_0xdfd2('0x59')]?operators[_0x5975dc[_0xdfd2('0x68')]](_0x5975dc[_0xdfd2('0x69')],_0x13253f[_0xdfd2('0x59')]):![];case'agent':return _0x13253f[_0xdfd2('0x6e')]?operators[_0x5975dc[_0xdfd2('0x68')]](_0x5975dc[_0xdfd2('0x69')],_0x13253f[_0xdfd2('0x6e')]):![];case'lastevent':return _0x13253f[_0xdfd2('0x6f')]?operators[_0x5975dc['operator']](_0x5975dc['value'],_0x13253f['lastevent']):![];case _0xdfd2('0x70'):return _0x13253f['routeId']?operators[_0x5975dc['operator']](_0x5975dc[_0xdfd2('0x69')],_0x13253f[_0xdfd2('0x70')]):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x6718=['../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','freshsalesAccounts','accounts','servicenowAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','motionChannel','voice','checkTriggers','hasOwnProperty','status','checkTrigger','Actions','length','interface','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','600','format','user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','action','exec','integration','queue','routeId','script','query','search','channel','AllConditions','every','AnyConditions','some','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','membername','lastevent','util','lodash','url','mustache','./urlforward','./cmContact','./script','../../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6718,0xde));var _0x8671=function(_0x49c653,_0x390195){_0x49c653=_0x49c653-0x0;var _0x31e169=_0x6718[_0x49c653];return _0x31e169;};'use strict';var util=require(_0x8671('0x0'));var _=require(_0x8671('0x1'));var url=require(_0x8671('0x2'));var Mustache=require(_0x8671('0x3'));var Redis=require('ioredis');var urlforward=require(_0x8671('0x4'));var integration=require('./integration');var cmContact=require(_0x8671('0x5'));var script=require(_0x8671('0x6'));var config=require(_0x8671('0x7'));var logger=require(_0x8671('0x8'))(_0x8671('0x9'));var ami=require(_0x8671('0xa'));config[_0x8671('0xb')]=_[_0x8671('0xc')](config[_0x8671('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x8671('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0x5f5b5d,_0x44d410){return _0x5f5b5d==_0x44d410;},'not_equals':function(_0x33bb97,_0x23ecd6){return _0x33bb97!=_0x23ecd6;}};var barAndWebActions=[_0x8671('0xe'),_0x8671('0x2'),_0x8671('0xf')];function Trigger(_0x11f6ac){this[_0x8671('0x10')]=_0x11f6ac[_0x8671('0x10')];this[_0x8671('0x11')]=_0x11f6ac[_0x8671('0x11')];this['voiceQueues']=_0x11f6ac[_0x8671('0x12')];this['templates']=_0x11f6ac[_0x8671('0x13')];this[_0x8671('0x14')]=_0x11f6ac['voiceExtensions'];this[_0x8671('0x15')]=_0x11f6ac[_0x8671('0x15')];this[_0x8671('0x16')]=_0x11f6ac[_0x8671('0x16')];this[_0x8671('0x17')]=_0x11f6ac['salesforceAccounts'];this[_0x8671('0x18')]=_0x11f6ac[_0x8671('0x18')];this[_0x8671('0x19')]=_0x11f6ac[_0x8671('0x19')];this[_0x8671('0x1a')]=_0x11f6ac[_0x8671('0x1a')];this['vtigerAccounts']=_0x11f6ac[_0x8671('0x1b')];this['servicenowAccounts']=_0x11f6ac['servicenowAccounts'];this['dynamics365Accounts']=_0x11f6ac['dynamics365Accounts'];this[_0x8671('0x1c')]=_0x11f6ac['freshsalesAccounts'];this[_0x8671('0x1d')]={'zendesk':this[_0x8671('0x15')],'salesforce':this[_0x8671('0x17')],'freshdesk':this[_0x8671('0x16')],'sugarcrm':this[_0x8671('0x18')],'zoho':this['zohoAccounts'],'desk':this[_0x8671('0x1a')],'vtiger':this[_0x8671('0x1b')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x8671('0x1c')],'servicenow':this[_0x8671('0x1e')]};ami['on']('custom:agentcalled',this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x21'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x22'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x23'),this[_0x8671('0x1f')]['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x24'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x25'),this[_0x8671('0x1f')]['bind'](this));ami['on'](_0x8671('0x26'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x27'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x28'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x29'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x2a'),this['syncCustomEvent'][_0x8671('0x20')](this));ami['on'](_0x8671('0x2b'),this[_0x8671('0x2c')]['bind'](this));ami['on'](_0x8671('0x2d'),this['syncAgentDial'][_0x8671('0x20')](this));ami['on'](_0x8671('0x2e'),this[_0x8671('0x2c')]['bind'](this));ami['on'](_0x8671('0x2f'),this[_0x8671('0x1f')]['bind'](this));ami['on'](_0x8671('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0x8671('0x31'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x32'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x33'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x34'),this[_0x8671('0x1f')][_0x8671('0x20')](this));}Trigger[_0x8671('0x35')][_0x8671('0x36')]=function(_0x1f7d8d,_0x164170,_0x1cb139){logger['info'](_0x1f7d8d,_0x164170,JSON['stringify'](_0x1cb139));io['to'](_0x1f7d8d)[_0x8671('0x36')](_0x164170,_0x1cb139);};Trigger[_0x8671('0x35')]['syncCustomEvent']=function(_0xad76c2){var _0x1395f1=_['clone'](_0xad76c2);if(typeof _0x1395f1[_0x8671('0x37')]==='undefined'){_0x1395f1[_0x8671('0x37')]=_0x8671('0x38');}this[_0x8671('0x39')](_0x1395f1);};Trigger[_0x8671('0x35')]['syncAgentDial']=function(_0x33ab9a){if(this[_0x8671('0x11')][_0x33ab9a['interface']]){this[_0x8671('0x1f')](_0x33ab9a);}};Trigger[_0x8671('0x35')][_0x8671('0x39')]=function(_0x838ed7){var _0x38b453;for(var _0x329719 in this[_0x8671('0x10')]){if(this[_0x8671('0x10')][_0x8671('0x3a')](_0x329719)){if(this['triggers'][_0x329719][_0x8671('0x3b')]){_0x38b453=this[_0x8671('0x3c')](this[_0x8671('0x10')][_0x329719],_0x838ed7);if(_0x38b453){_['merge'](_0x838ed7,_0x838ed7['variables']);for(var _0x2147ef=0x0,_0x5c3589,_0x44f0ac,_0x36fb32;_0x2147ef<this[_0x8671('0x10')][_0x329719][_0x8671('0x3d')][_0x8671('0x3e')];_0x2147ef+=0x1){_0x5c3589=this[_0x8671('0x10')][_0x329719]['Actions'][_0x2147ef];if(this['agents'][_0x838ed7[_0x8671('0x3f')]]){switch(_0x5c3589['action'][_0x8671('0x40')]()){case _0x8671('0x41'):break;case _0x8671('0x42'):case _0x8671('0x43'):var _0x5b47e2={};switch(barAndWebActions[_0x5c3589[_0x8671('0x44')]]){case _0x8671('0xe'):_0x5b47e2[_0x8671('0x45')]=_0x5c3589[_0x8671('0x46')];_0x5b47e2[_0x8671('0x47')]=this['templates'][_0x5c3589[_0x8671('0x46')]]?Mustache[_0x8671('0x48')](this['templates'][_0x5c3589[_0x8671('0x46')]]['html'],_0x838ed7):'template\x20not\x20found';break;case _0x8671('0x2'):_0x5b47e2[_0x8671('0x49')]=this[_0x8671('0x4a')](_0x5c3589[_0x8671('0x46')],_0x838ed7,_[_0x8671('0x4b')](_0x5c3589[_0x8671('0x4c')])?!![]:parseInt(_0x5c3589[_0x8671('0x4c')],0xa));if(_[_0x8671('0x4b')](_0x5c3589[_0x8671('0x4d')])){_0x5b47e2['location']='0';}else{_0x5b47e2[_0x8671('0x4e')]=_0x5c3589[_0x8671('0x4d')];_0x5b47e2[_0x8671('0x4f')]=_[_0x8671('0x4b')](_0x5c3589[_0x8671('0x50')])?'800':_0x5c3589['data5'];_0x5b47e2['windowHeight']=_['isNil'](_0x5c3589['data6'])?_0x8671('0x51'):_0x5c3589['data6'];}break;case _0x8671('0xf'):_0x5b47e2['winApplication']=_0x5c3589[_0x8671('0x46')]?Mustache['render'](_0x5c3589['data2'],_0x838ed7):'';_0x5b47e2['winArguments']=_0x5c3589[_0x8671('0x4c')]?Mustache[_0x8671('0x48')](_0x5c3589[_0x8671('0x4c')],_0x838ed7):'';break;}this['emit'](util[_0x8671('0x52')](_0x8671('0x53'),this['agents'][_0x838ed7[_0x8671('0x3f')]][_0x8671('0x54')]),util[_0x8671('0x52')](_0x8671('0x55'),_0x5c3589['action']['toLowerCase'](),barAndWebActions[_0x5c3589[_0x8671('0x44')]]),_[_0x8671('0x56')](_0x5b47e2,_0x838ed7));break;case _0x8671('0x57'):this[_0x8671('0x36')](util[_0x8671('0x52')](_0x8671('0x53'),this[_0x8671('0x11')][_0x838ed7[_0x8671('0x3f')]][_0x8671('0x54')]),util['format'](_0x8671('0x58'),_0x5c3589[_0x8671('0x59')]['toLowerCase']()),_[_0x8671('0x56')]({'ProjectId':parseInt(_0x5c3589[_0x8671('0x44')],0xa)},_0x838ed7));break;default:this[_0x8671('0x36')](util[_0x8671('0x52')](_0x8671('0x53'),this[_0x8671('0x11')][_0x838ed7[_0x8671('0x3f')]][_0x8671('0x54')]),util[_0x8671('0x52')](_0x8671('0x58'),_0x5c3589[_0x8671('0x59')][_0x8671('0x40')]()),_[_0x8671('0x56')]({},_0x5c3589,_0x838ed7));}}switch(_0x5c3589[_0x8671('0x59')][_0x8671('0x40')]()){case _0x8671('0x41'):cmContact[_0x8671('0x5a')](this[_0x8671('0x11')][_0x838ed7['interface']],this[_0x8671('0x10')][_0x329719],_0x5c3589,_0x838ed7);break;case _0x8671('0x5b'):integration[_0x8671('0x5a')](_0x5c3589,_0x838ed7,this[_0x8671('0x1d')],this['agents'][_0x838ed7[_0x8671('0x3f')]],this['voiceQueues'][_0x838ed7[_0x8671('0x5c')]],this[_0x8671('0x14')][_0x838ed7[_0x8671('0x5d')]]);break;case'urlforward':urlforward[_0x8671('0x5a')](_0x5c3589,_0x838ed7);break;case _0x8671('0x5e'):script[_0x8671('0x5a')](_0x5c3589,_0x838ed7);break;}}}}}}};Trigger[_0x8671('0x35')][_0x8671('0x4a')]=function(_0x1dd6a5,_0x6c5c91,_0x55753c){var _0x2a4eda=url['parse'](Mustache[_0x8671('0x48')](_0x1dd6a5,_0x6c5c91),!![]);if(_0x55753c){_[_0x8671('0x56')](_0x2a4eda[_0x8671('0x5f')],_0x6c5c91);}delete _0x2a4eda[_0x8671('0x60')];var _0x168da1=url[_0x8671('0x52')](_0x2a4eda);_0x168da1=_0x168da1['replace'](/\/\?/g,'?');return _0x168da1;};Trigger[_0x8671('0x35')]['checkTrigger']=function(_0xc3f8d8,_0x1efaca){var _0x120ad2=!![];var _0x302ebe=!![];var _0x13dd17=![];if(_0xc3f8d8[_0x8671('0x61')]===_0x1efaca[_0x8671('0x37')]){_0x13dd17=!![];}if(_0xc3f8d8[_0x8671('0x62')][_0x8671('0x3e')]){_0x120ad2=_[_0x8671('0x63')](_0xc3f8d8[_0x8671('0x62')],this['checkConditions'](_0x1efaca,_0xc3f8d8['channel']));}if(_0xc3f8d8[_0x8671('0x64')]['length']){_0x302ebe=_[_0x8671('0x65')](_0xc3f8d8[_0x8671('0x64')],this[_0x8671('0x66')](_0x1efaca,_0xc3f8d8[_0x8671('0x61')]));}return _0x13dd17&&_0x120ad2&&_0x302ebe;};Trigger['prototype']['checkConditions']=function(_0x35278b,_0x516175){return function(_0x5a650a){switch(_0x5a650a[_0x8671('0x67')]){case _0x8671('0x68'):if(_0x35278b[_0x8671('0x61')]===_0x516175){if(_0x516175===_0x8671('0x69')){return _0x35278b[_0x8671('0x6a')]?operators[_0x5a650a[_0x8671('0x6b')]](Number(_0x5a650a[_0x8671('0x6c')]),_0x35278b[_0x8671('0x6a')]):![];}else{return _0x35278b[_[_0x8671('0x6d')](_0x516175)+_0x8671('0x6e')]?operators[_0x5a650a[_0x8671('0x6b')]](Number(_0x5a650a[_0x8671('0x6c')]),_0x35278b[_[_0x8671('0x6d')](_0x516175)+_0x8671('0x6e')]):![];}}break;case _0x8671('0x6f'):case _0x8671('0x70'):if(_0x35278b['channel']===_0x516175){return _0x35278b['event']?operators[_0x5a650a[_0x8671('0x6b')]](_0x5a650a[_0x8671('0x6c')],_0x35278b['event']):![];}break;case _0x8671('0x5c'):return _0x35278b[_0x8671('0x5c')]?operators[_0x5a650a[_0x8671('0x6b')]](_0x5a650a['value'],_0x35278b[_0x8671('0x5c')]):![];case'agent':return _0x35278b[_0x8671('0x71')]?operators[_0x5a650a[_0x8671('0x6b')]](_0x5a650a[_0x8671('0x6c')],_0x35278b[_0x8671('0x71')]):![];case _0x8671('0x72'):return _0x35278b[_0x8671('0x72')]?operators[_0x5a650a[_0x8671('0x6b')]](_0x5a650a[_0x8671('0x6c')],_0x35278b[_0x8671('0x72')]):![];case'routeId':return _0x35278b[_0x8671('0x5d')]?operators[_0x5a650a[_0x8671('0x6b')]](_0x5a650a['value'],_0x35278b[_0x8671('0x5d')]):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
index 3168916..a4c2fba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','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','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x5beaf0,_0x35895d){var _0x2ce2fb=function(_0xc0bc99){while(--_0xc0bc99){_0x5beaf0['push'](_0x5beaf0['shift']());}};_0x2ce2fb(++_0x35895d);}(_0x7217,0x19e));var _0x7721=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x7217[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});};
\ No newline at end of file
+var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x22ea1e,_0x228500){var _0xc6323d=function(_0x493227){while(--_0x493227){_0x22ea1e['push'](_0x22ea1e['shift']());}};_0xc6323d(++_0x228500);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});};
\ No newline at end of file
index 663c9ec..131fc19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0cd=['lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','defaults','redis','socket.io-emitter','clientId','remoteUri','username','clientSecret','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','then','GET','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','info','systemuserid','userId','catch','toLowerCase','outbound','POST','contacts','/systemusers(','4.0','headers','substring','lastIndexOf','enduserId','message','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b',']\x20Enduser\x20created!','forEach','includes','string','customField','idField','indexOf','ticketType','incidents','getString','Subjects','Descriptions','/contacts(','phonecalls','assign','callDirection','queue','Fields','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect'];(function(_0x2dbf0d,_0x51f951){var _0x34d44e=function(_0xb74b91){while(--_0xb74b91){_0x2dbf0d['push'](_0x2dbf0d['shift']());}};_0x34d44e(++_0x51f951);}(_0xf0cd,0x174));var _0xdf0c=function(_0x3ae642,_0x3c14cb){_0x3ae642=_0x3ae642-0x0;var _0x3e6417=_0xf0cd[_0x3ae642];return _0x3e6417;};'use strict';var _=require(_0xdf0c('0x0'));var BPromise=require('bluebird');var rp=require(_0xdf0c('0x1'));var util=require(_0xdf0c('0x2'));var intUtil=require(_0xdf0c('0x3'));var md5=require(_0xdf0c('0x4'));var Redis=require(_0xdf0c('0x5'));var logger=require(_0xdf0c('0x6'))(_0xdf0c('0x7'));var config=require('../../../../config/environment');config['redis']=_[_0xdf0c('0x8')](config[_0xdf0c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xdf0c('0xa'))(new Redis(config[_0xdf0c('0x9')]));function getAuthToken(_0x56284c,_0x14ffd1,_0x5a36b9){var _0x3b8229={'method':'POST','uri':_0x14ffd1,'form':{'client_id':_0x56284c[_0xdf0c('0xb')],'resource':_0x56284c[_0xdf0c('0xc')],'username':_0x56284c[_0xdf0c('0xd')],'password':_0x56284c['password'],'grant_type':'password','client_secret':_0x56284c[_0xdf0c('0xe')]},'json':!![]};return rp(_0x3b8229)['then'](function(_0x3d3299){return _0x3d3299[_0xdf0c('0xf')];})['catch'](function(_0x395c29){logger[_0xdf0c('0x10')]('['+[_0x5a36b9[_0xdf0c('0x11')]()]+_0xdf0c('0x12'));return _0x395c29['message'];});}function getUser(_0x4f1cc1,_0x31029f,_0xd0e91d,_0x1e786b,_0x4947f7,_0x3bed29){return new BPromise(function(_0x189888,_0x499ae1){return getAuthToken(_0x31029f,_0x1e786b,_0x3bed29)[_0xdf0c('0x13')](function(_0x147bf5){var _0x3682f2={'method':_0xdf0c('0x14'),'uri':_0x4947f7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xdf0c('0x15')+_0x147bf5,'OData-Version':'4.0'},'json':!![]};return rp(_0x3682f2);})[_0xdf0c('0x13')](function(_0x2c94cf){var _0x4b15f4=_0x2c94cf[_0xdf0c('0x16')];var _0x413df4=![];var _0xc61ae3=null;if(!_[_0xdf0c('0x17')](_0xd0e91d)){if(intUtil[_0xdf0c('0x18')](_0xd0e91d[_0xdf0c('0x19')])){_0x4f1cc1[_0xdf0c('0x1a')]=_0xd0e91d[_0xdf0c('0x19')];for(_0xc61ae3=0x0;_0xc61ae3<_0x4b15f4[_0xdf0c('0x1b')];_0xc61ae3++){if(_0x4b15f4[_0xc61ae3][_0xdf0c('0x1c')]===_0xd0e91d['email']&&!_0x4b15f4[_0xc61ae3]['isdisabled']){_0x413df4=!![];logger[_0xdf0c('0x1d')]('['+[_0x3bed29[_0xdf0c('0x11')]()]+']\x20Agent\x20found\x20'+_0x4b15f4[_0xc61ae3][_0xdf0c('0x1e')]+'!');_0x4f1cc1['userId']=_0x4b15f4[_0xc61ae3][_0xdf0c('0x1e')];}}}}if(!_0x413df4){logger[_0xdf0c('0x1d')]('['+[_0x3bed29[_0xdf0c('0x11')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4f1cc1[_0xdf0c('0x1a')]=_0x31029f[_0xdf0c('0xd')];for(_0xc61ae3=0x0;_0xc61ae3<_0x4b15f4[_0xdf0c('0x1b')];_0xc61ae3++){if(_0x4b15f4[_0xc61ae3][_0xdf0c('0x1c')]===_0x31029f[_0xdf0c('0xd')]){_0x4f1cc1[_0xdf0c('0x1f')]=_0x4b15f4[_0xc61ae3][_0xdf0c('0x1e')];}}}_0x189888(_0x4f1cc1);})[_0xdf0c('0x20')](function(_0x4fd9c5){_0x499ae1(_0x4fd9c5['message']);});});}function createEndUser(_0x18b922,_0x1463aa,_0x2dae19,_0x11587d,_0x34b202,_0x54ced6){return new BPromise(function(_0x353f63,_0x245342){return getAuthToken(_0x1463aa,_0x2dae19,_0x54ced6)[_0xdf0c('0x13')](function(_0x7f1104){var _0x5ccbc8=_0x54ced6[_0xdf0c('0x21')]()===_0xdf0c('0x22')?_0x34b202['destcalleridnum']:_0x34b202['calleridnum'];var _0x12a31a={'method':_0xdf0c('0x23'),'uri':_0x11587d+_0xdf0c('0x24'),'body':{'telephone1':_0x5ccbc8,'fullname':_0x5ccbc8,'firstname':_0x5ccbc8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xdf0c('0x25')+_0x18b922[_0xdf0c('0x1f')]+')'},'headers':{'Authorization':_0xdf0c('0x15')+_0x7f1104,'OData-Version':_0xdf0c('0x26')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x12a31a);})[_0xdf0c('0x13')](function(_0x1e3a42){var _0x5258b4=_0x1e3a42[_0xdf0c('0x27')]['odata-entityid'];var _0xa688c1=_0x5258b4[_0xdf0c('0x28')](_0x5258b4[_0xdf0c('0x29')]('(')+0x1,_0x5258b4[_0xdf0c('0x29')](')'));_0x18b922[_0xdf0c('0x2a')]=_0xa688c1;_0x353f63(_0x18b922);})[_0xdf0c('0x20')](function(_0x263265){_0x245342(_0x263265[_0xdf0c('0x2b')]);});});}function getEndUser(_0x4b8913,_0x39145d,_0x381da7,_0x389094,_0x326146,_0x3b28d8){return new BPromise(function(_0x55ca1c,_0x13d0ca){var _0x355480=_0x3b28d8[_0xdf0c('0x21')]()==='outbound'?_0x326146['destcalleridnum']:_0x326146[_0xdf0c('0x2c')];return getAuthToken(_0x39145d,_0x381da7,_0x3b28d8)[_0xdf0c('0x13')](function(_0xcd49f8){var _0x1f3dcc={'method':_0xdf0c('0x14'),'uri':_0x389094+_0xdf0c('0x2d')+_0x355480[_0xdf0c('0x2e')]('+',_0xdf0c('0x2f'))+'\x27','headers':{'Authorization':_0xdf0c('0x15')+_0xcd49f8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1f3dcc);})[_0xdf0c('0x13')](function(_0x4d215a){var _0x2fa0f8=null;if(_0x4d215a){var _0x2fe489=_0x4d215a[_0xdf0c('0x16')];var _0x19bab7=![];for(_0x2fa0f8=0x0;_0x2fa0f8<_0x2fe489[_0xdf0c('0x1b')];_0x2fa0f8++){if(_0x2fe489[_0x2fa0f8]['telephone1']===_0x355480){_0x19bab7=!![];_0x4b8913[_0xdf0c('0x2a')]=_0x2fe489[_0x2fa0f8]['contactid'];}}if(_0x19bab7){_0x55ca1c(_0x4b8913);}else{return createEndUser(_0x4b8913,_0x39145d,_0x381da7,_0x389094,_0x326146,_0x3b28d8)[_0xdf0c('0x13')](function(_0x458d19){logger[_0xdf0c('0x1d')]('['+[_0x3b28d8[_0xdf0c('0x11')]()]+_0xdf0c('0x30'),_0x458d19[_0xdf0c('0x2a')]);_0x55ca1c(_0x458d19);});}}else{return createEndUser(_0x4b8913,_0x39145d,_0x381da7,_0x389094,_0x326146,_0x3b28d8)[_0xdf0c('0x13')](function(_0x47a3ce){logger[_0xdf0c('0x1d')]('['+[_0x3b28d8[_0xdf0c('0x11')]()]+']\x20Enduser\x20Created!',_0x47a3ce[_0xdf0c('0x2a')]);_0x55ca1c(_0x47a3ce);});}});});}function getCustomFields(_0x169259,_0x2a8fe4,_0x4589a3){var _0x3776d6={};if(_0x169259[_0xdf0c('0x1b')]>0x0){_[_0xdf0c('0x31')](_0x169259,function(_0x4a24bd){if(_[_0xdf0c('0x32')]([_0xdf0c('0x33'),'picklist'],_0x4a24bd['type'])&&_0x4a24bd['nameField']&&!_0x4a24bd[_0xdf0c('0x34')]){var _0x119cfb=_0x4a24bd[_0xdf0c('0x35')]['toLowerCase']();var _0x20c87f=_0x119cfb['substring'](0x0,_0x119cfb[_0xdf0c('0x36')]('_'));var _0x13593d=_0x119cfb[_0xdf0c('0x28')](_0x119cfb[_0xdf0c('0x36')]('_')+0x1);if(_0x20c87f===_0x4589a3){_0x3776d6[_0x13593d]=_0x4a24bd['content'];}}});}return _0x3776d6;}function getTicket(_0x3dc8a0,_0x3fdbc6,_0x5655f8,_0x18bf18,_0x11d377,_0x2e22d7,_0x3011aa){return new BPromise(function(_0x5c4d72,_0xcfafb6){var _0x32cac1;return getAuthToken(_0x3fdbc6,_0x5655f8,_0x3011aa)[_0xdf0c('0x13')](function(_0x16730b){if(_0x2e22d7[_0xdf0c('0x37')]==='incident'){_0x32cac1={'method':_0xdf0c('0x23'),'uri':_0x18bf18+_0xdf0c('0x38'),'body':Object['assign']({},{'title':intUtil[_0xdf0c('0x39')](_0x2e22d7[_0xdf0c('0x3a')],_0x11d377,'\x20'),'description':intUtil['getString'](_0x2e22d7[_0xdf0c('0x3b')],_0x11d377,'\x0a'),'customerid_contact@odata.bind':_0xdf0c('0x3c')+_0x3dc8a0['enduserId']+')','ownerid@odata.bind':_0xdf0c('0x25')+_0x3dc8a0[_0xdf0c('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x2e22d7['Fields'],_0x11d377,_0x2e22d7[_0xdf0c('0x37')])),'headers':{'Authorization':'Bearer\x20'+_0x16730b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2e22d7[_0xdf0c('0x37')]==='phonecall'){_0x32cac1={'method':_0xdf0c('0x23'),'uri':_0x18bf18+_0xdf0c('0x3d'),'body':Object[_0xdf0c('0x3e')]({},{'subject':intUtil['getString'](_0x2e22d7[_0xdf0c('0x3a')],_0x11d377,'\x20'),'phonenumber':String(_0x11d377[_0xdf0c('0x2c')]),'description':intUtil[_0xdf0c('0x39')](_0x2e22d7['Descriptions'],_0x11d377,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x3dc8a0['enduserId']+')','ownerid@odata.bind':_0xdf0c('0x25')+_0x3dc8a0['userId']+')','directioncode':_0x3dc8a0[_0xdf0c('0x3f')]===_0xdf0c('0x40')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xdf0c('0x25')+_0x3dc8a0[_0xdf0c('0x1f')]+')','participationtypemask':_0x3dc8a0[_0xdf0c('0x3f')]===_0xdf0c('0x40')?0x2:0x1},{'partyid_contact@odata.bind':_0xdf0c('0x3c')+_0x3dc8a0[_0xdf0c('0x2a')]+')','participationtypemask':_0x3dc8a0[_0xdf0c('0x3f')]==='queue'?0x1:0x2}]},getCustomFields(_0x2e22d7[_0xdf0c('0x41')],_0x11d377,_0x2e22d7[_0xdf0c('0x37')])),'headers':{'Authorization':_0xdf0c('0x15')+_0x16730b,'OData-Version':_0xdf0c('0x26')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x32cac1);})[_0xdf0c('0x13')](function(_0x328244){var _0x5e9704=_0x328244[_0xdf0c('0x27')][_0xdf0c('0x42')];var _0x12ba7c=_0x5e9704['substring'](_0x5e9704[_0xdf0c('0x29')]('(')+0x1,_0x5e9704[_0xdf0c('0x29')](')'));_0x3dc8a0[_0xdf0c('0x43')]=_0x12ba7c;_0x5c4d72(_0x3dc8a0);})['catch'](function(_0x55fa09){_0xcfafb6(_0x55fa09[_0xdf0c('0x2b')]);});});}function emit(_0x5341aa,_0x2249bd,_0x5bf384,_0x73d1f4){var _0x2fbe56={'uri':util[_0xdf0c('0x44')](_0xdf0c('0x45'),_0x5341aa,_0x5bf384,_0x73d1f4)};io['to'](util[_0xdf0c('0x44')](_0xdf0c('0x46'),_0x2249bd))[_0xdf0c('0x47')]('trigger:browser:url',_0x2fbe56);}exports['cs']=function(_0x59ac22,_0x4257af,_0x2db22a,_0x81978a,_0x4ca581,_0x1a0fb7,_0xab32cf,_0x3a1ed3){var _0x57127f={};_0x1a0fb7[_0xdf0c('0xc')]=intUtil['stripTrailingSlash'](_0x1a0fb7[_0xdf0c('0xc')]);_0x1a0fb7[_0xdf0c('0x48')]=intUtil[_0xdf0c('0x49')](_0x1a0fb7['serverUrl']);_0x57127f[_0xdf0c('0x3f')]=_0x3a1ed3==='queue'||_0x3a1ed3===_0xdf0c('0x4a')?'queue':_0xdf0c('0x22');var _0x288f81=util['format'](_0xdf0c('0x4b'),_0x1a0fb7[_0xdf0c('0xc')]);var _0x254bd5=util[_0xdf0c('0x44')](_0xdf0c('0x4c'),_0x1a0fb7[_0xdf0c('0x4d')]);var _0xe60d71=util[_0xdf0c('0x44')](_0xdf0c('0x4e'),_0x1a0fb7[_0xdf0c('0x48')],_0x4257af[_0xdf0c('0x4f')],md5(_0x4257af[_0xdf0c('0x4f')]));if(_0x4ca581&&_0x4ca581['monitor_format']){logger[_0xdf0c('0x1d')](_0xdf0c('0x50'),_0xdf0c('0x51'));_0x4257af[_0xdf0c('0x52')]=_0xe60d71;}else if(_0xab32cf&&_0xab32cf[_0xdf0c('0x53')]&&_0xab32cf[_0xdf0c('0x53')]!==_0xdf0c('0x54')){logger[_0xdf0c('0x1d')]('[OUTBOUND]',_0xdf0c('0x51'));_0x4257af[_0xdf0c('0x52')]=_0xe60d71;}else{_0x4257af[_0xdf0c('0x52')]='';}return getUser(_0x57127f,_0x1a0fb7,_0x81978a,_0x254bd5,_0x288f81,_0x3a1ed3)['then'](function(_0x191d5f){logger[_0xdf0c('0x1d')]('['+_0x3a1ed3[_0xdf0c('0x11')]()+']\x20The\x20User\x20ID\x20is:',_0x191d5f[_0xdf0c('0x1f')]);logger[_0xdf0c('0x1d')]('['+_0x3a1ed3[_0xdf0c('0x11')]()+_0xdf0c('0x55'),_0x191d5f[_0xdf0c('0x1a')]);return getEndUser(_0x191d5f,_0x1a0fb7,_0x254bd5,_0x288f81,_0x4257af,_0x3a1ed3);})['then'](function(_0x38b3e6){logger[_0xdf0c('0x1d')]('['+_0x3a1ed3['toUpperCase']()+_0xdf0c('0x56'),_0x38b3e6[_0xdf0c('0x2a')]);logger['info']('['+_0x3a1ed3[_0xdf0c('0x11')]()+_0xdf0c('0x57'),_0x4257af['calleridnum']);return getTicket(_0x38b3e6,_0x1a0fb7,_0x254bd5,_0x288f81,_0x4257af,_0x2db22a,_0x3a1ed3);})[_0xdf0c('0x13')](function(_0x5e3ee6){logger[_0xdf0c('0x1d')](util[_0xdf0c('0x44')]('['+_0x3a1ed3['toUpperCase']()+_0xdf0c('0x58'),_0x2db22a[_0xdf0c('0x37')],_0x5e3ee6['ticketId']));logger[_0xdf0c('0x1d')](util['format']('['+_0x3a1ed3[_0xdf0c('0x11')]()+_0xdf0c('0x59'),_0x3a1ed3));if(_0x3a1ed3!=='unmanaged'){logger[_0xdf0c('0x1d')]('['+_0x3a1ed3[_0xdf0c('0x11')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1a0fb7[_0xdf0c('0xc')],_0x81978a[_0xdf0c('0x5a')],_0x2db22a[_0xdf0c('0x37')],_0x5e3ee6[_0xdf0c('0x43')]);}})['catch'](function(_0x2dca77){logger['error']('['+_0x3a1ed3[_0xdf0c('0x11')]()+_0xdf0c('0x5b'),util[_0xdf0c('0x5c')](_0x2dca77,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xa80f=['ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Recording\x20is\x20enabled!','recordingFormat','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','name','inspect','lodash','bluebird','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','catch','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','enduserId','contactid',']\x20Enduser\x20Created!','forEach','includes','string','type','customField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','calleridnum','queue','callDirection'];(function(_0x251995,_0x3ea489){var _0x22cb8d=function(_0x406b9b){while(--_0x406b9b){_0x251995['push'](_0x251995['shift']());}};_0x22cb8d(++_0x3ea489);}(_0xa80f,0x193));var _0xfa80=function(_0x57fda8,_0x5e80a0){_0x57fda8=_0x57fda8-0x0;var _0x11c895=_0xa80f[_0x57fda8];return _0x11c895;};'use strict';var _=require(_0xfa80('0x0'));var BPromise=require(_0xfa80('0x1'));var rp=require(_0xfa80('0x2'));var util=require('util');var intUtil=require(_0xfa80('0x3'));var md5=require(_0xfa80('0x4'));var Redis=require(_0xfa80('0x5'));var logger=require(_0xfa80('0x6'))(_0xfa80('0x7'));var config=require('../../../../config/environment');config[_0xfa80('0x8')]=_['defaults'](config[_0xfa80('0x8')],{'host':_0xfa80('0x9'),'port':0x18eb});var io=require(_0xfa80('0xa'))(new Redis(config[_0xfa80('0x8')]));function getAuthToken(_0x4e4df9,_0x237094,_0x15a44a){var _0x58e59b={'method':_0xfa80('0xb'),'uri':_0x237094,'form':{'client_id':_0x4e4df9[_0xfa80('0xc')],'resource':_0x4e4df9['remoteUri'],'username':_0x4e4df9[_0xfa80('0xd')],'password':_0x4e4df9[_0xfa80('0xe')],'grant_type':_0xfa80('0xe'),'client_secret':_0x4e4df9[_0xfa80('0xf')]},'json':!![]};return rp(_0x58e59b)[_0xfa80('0x10')](function(_0x3c06b8){return _0x3c06b8['access_token'];})['catch'](function(_0x260274){logger[_0xfa80('0x11')]('['+[_0x15a44a[_0xfa80('0x12')]()]+']\x20Wrong\x20credentials!');return _0x260274[_0xfa80('0x13')];});}function getUser(_0x36fc8a,_0x405fc1,_0x41df4c,_0x67478d,_0x4986e4,_0x4dd3b6){return new BPromise(function(_0x270249,_0x274273){return getAuthToken(_0x405fc1,_0x67478d,_0x4dd3b6)[_0xfa80('0x10')](function(_0x8a0d99){var _0x38a408={'method':_0xfa80('0x14'),'uri':_0x4986e4+_0xfa80('0x15'),'headers':{'Authorization':'Bearer\x20'+_0x8a0d99,'OData-Version':_0xfa80('0x16')},'json':!![]};return rp(_0x38a408);})[_0xfa80('0x10')](function(_0x67832f){var _0x2fe466=_0x67832f[_0xfa80('0x17')];var _0x17ac8b=![];var _0x174b9a=null;if(!_[_0xfa80('0x18')](_0x41df4c)){if(intUtil[_0xfa80('0x19')](_0x41df4c[_0xfa80('0x1a')])){_0x36fc8a[_0xfa80('0x1b')]=_0x41df4c[_0xfa80('0x1a')];for(_0x174b9a=0x0;_0x174b9a<_0x2fe466[_0xfa80('0x1c')];_0x174b9a++){if(_0x2fe466[_0x174b9a][_0xfa80('0x1d')]===_0x41df4c['email']&&!_0x2fe466[_0x174b9a][_0xfa80('0x1e')]){_0x17ac8b=!![];logger[_0xfa80('0x1f')]('['+[_0x4dd3b6[_0xfa80('0x12')]()]+']\x20Agent\x20found\x20'+_0x2fe466[_0x174b9a][_0xfa80('0x20')]+'!');_0x36fc8a[_0xfa80('0x21')]=_0x2fe466[_0x174b9a]['systemuserid'];}}}}if(!_0x17ac8b){logger[_0xfa80('0x1f')]('['+[_0x4dd3b6['toUpperCase']()]+_0xfa80('0x22'));_0x36fc8a[_0xfa80('0x1b')]=_0x405fc1[_0xfa80('0xd')];for(_0x174b9a=0x0;_0x174b9a<_0x2fe466[_0xfa80('0x1c')];_0x174b9a++){if(_0x2fe466[_0x174b9a][_0xfa80('0x1d')]===_0x405fc1[_0xfa80('0xd')]){_0x36fc8a[_0xfa80('0x21')]=_0x2fe466[_0x174b9a][_0xfa80('0x20')];}}}_0x270249(_0x36fc8a);})['catch'](function(_0x2919d3){_0x274273(_0x2919d3[_0xfa80('0x13')]);});});}function createEndUser(_0x3d6e86,_0x1205f2,_0x292d0b,_0x57e5ce,_0x3a588a,_0x398817){return new BPromise(function(_0x3984e8,_0x53dfa6){return getAuthToken(_0x1205f2,_0x292d0b,_0x398817)[_0xfa80('0x10')](function(_0x2664af){var _0x215968=_0x398817[_0xfa80('0x23')]()===_0xfa80('0x24')?_0x3a588a[_0xfa80('0x25')]:_0x3a588a['calleridnum'];var _0x25de0e={'method':_0xfa80('0xb'),'uri':_0x57e5ce+'contacts','body':{'telephone1':_0x215968,'fullname':_0x215968,'firstname':_0x215968,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfa80('0x26')+_0x3d6e86[_0xfa80('0x21')]+')'},'headers':{'Authorization':_0xfa80('0x27')+_0x2664af,'OData-Version':_0xfa80('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x25de0e);})[_0xfa80('0x10')](function(_0x18f784){var _0x171676=_0x18f784[_0xfa80('0x28')][_0xfa80('0x29')];var _0x3eb530=_0x171676[_0xfa80('0x2a')](_0x171676[_0xfa80('0x2b')]('(')+0x1,_0x171676['lastIndexOf'](')'));_0x3d6e86['enduserId']=_0x3eb530;_0x3984e8(_0x3d6e86);})[_0xfa80('0x2c')](function(_0xd7a353){_0x53dfa6(_0xd7a353[_0xfa80('0x13')]);});});}function getEndUser(_0x3b5e0f,_0x4b3627,_0x54e5b7,_0x1f050e,_0x317507,_0x31121d){return new BPromise(function(_0x514284,_0x4d88fa){var _0x19d2fb=_0x31121d[_0xfa80('0x23')]()===_0xfa80('0x24')?_0x317507[_0xfa80('0x25')]:_0x317507['calleridnum'];return getAuthToken(_0x4b3627,_0x54e5b7,_0x31121d)[_0xfa80('0x10')](function(_0x1447b0){var _0x1f891d={'method':_0xfa80('0x14'),'uri':_0x1f050e+_0xfa80('0x2d')+_0x19d2fb[_0xfa80('0x2e')]('+',_0xfa80('0x2f'))+'\x27','headers':{'Authorization':_0xfa80('0x27')+_0x1447b0,'If-None-Match':null,'OData-Version':_0xfa80('0x16')},'json':!![]};return rp(_0x1f891d);})[_0xfa80('0x10')](function(_0x1c1497){var _0x140328=null;if(_0x1c1497){var _0x441439=_0x1c1497['value'];var _0x4475f6=![];for(_0x140328=0x0;_0x140328<_0x441439[_0xfa80('0x1c')];_0x140328++){if(_0x441439[_0x140328]['telephone1']===_0x19d2fb){_0x4475f6=!![];_0x3b5e0f[_0xfa80('0x30')]=_0x441439[_0x140328][_0xfa80('0x31')];}}if(_0x4475f6){_0x514284(_0x3b5e0f);}else{return createEndUser(_0x3b5e0f,_0x4b3627,_0x54e5b7,_0x1f050e,_0x317507,_0x31121d)[_0xfa80('0x10')](function(_0x3b7cc6){logger[_0xfa80('0x1f')]('['+[_0x31121d[_0xfa80('0x12')]()]+']\x20Enduser\x20created!',_0x3b7cc6[_0xfa80('0x30')]);_0x514284(_0x3b7cc6);});}}else{return createEndUser(_0x3b5e0f,_0x4b3627,_0x54e5b7,_0x1f050e,_0x317507,_0x31121d)[_0xfa80('0x10')](function(_0x9ea717){logger['info']('['+[_0x31121d['toUpperCase']()]+_0xfa80('0x32'),_0x9ea717['enduserId']);_0x514284(_0x9ea717);});}});});}function getCustomFields(_0x1a174c,_0x39cff6,_0x3c10c6){var _0x5b9618={};if(_0x1a174c[_0xfa80('0x1c')]>0x0){_[_0xfa80('0x33')](_0x1a174c,function(_0xc7dff4){if(_[_0xfa80('0x34')]([_0xfa80('0x35'),'picklist'],_0xc7dff4[_0xfa80('0x36')])&&_0xc7dff4['nameField']&&!_0xc7dff4[_0xfa80('0x37')]){var _0x18de09=_0xc7dff4['idField']['toLowerCase']();var _0x5a1b02=_0x18de09[_0xfa80('0x2a')](0x0,_0x18de09[_0xfa80('0x38')]('_'));var _0x58397f=_0x18de09[_0xfa80('0x2a')](_0x18de09['indexOf']('_')+0x1);if(_0x5a1b02===_0x3c10c6){_0x5b9618[_0x58397f]=_0xc7dff4[_0xfa80('0x39')];}}});}return _0x5b9618;}function getTicket(_0x297947,_0x4e1cf9,_0x22762e,_0x2b1e20,_0x5dd793,_0x39a3da,_0x231473){return new BPromise(function(_0x3fee60,_0x19d139){var _0x18dd1c;return getAuthToken(_0x4e1cf9,_0x22762e,_0x231473)[_0xfa80('0x10')](function(_0x32e413){if(_0x39a3da['ticketType']===_0xfa80('0x3a')){_0x18dd1c={'method':_0xfa80('0xb'),'uri':_0x2b1e20+_0xfa80('0x3b'),'body':Object[_0xfa80('0x3c')]({},{'title':intUtil[_0xfa80('0x3d')](_0x39a3da[_0xfa80('0x3e')],_0x5dd793,'\x20'),'description':intUtil[_0xfa80('0x3d')](_0x39a3da[_0xfa80('0x3f')],_0x5dd793,'\x0a'),'customerid_contact@odata.bind':_0xfa80('0x40')+_0x297947['enduserId']+')','ownerid@odata.bind':_0xfa80('0x26')+_0x297947[_0xfa80('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x39a3da[_0xfa80('0x41')],_0x5dd793,_0x39a3da['ticketType'])),'headers':{'Authorization':_0xfa80('0x27')+_0x32e413,'OData-Version':_0xfa80('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x39a3da[_0xfa80('0x42')]===_0xfa80('0x43')){_0x18dd1c={'method':'POST','uri':_0x2b1e20+_0xfa80('0x44'),'body':Object['assign']({},{'subject':intUtil[_0xfa80('0x3d')](_0x39a3da[_0xfa80('0x3e')],_0x5dd793,'\x20'),'phonenumber':String(_0x5dd793[_0xfa80('0x45')]),'description':intUtil[_0xfa80('0x3d')](_0x39a3da[_0xfa80('0x3f')],_0x5dd793,'\x0a'),'regardingobjectid_contact@odata.bind':_0xfa80('0x40')+_0x297947['enduserId']+')','ownerid@odata.bind':_0xfa80('0x26')+_0x297947[_0xfa80('0x21')]+')','directioncode':_0x297947['callDirection']===_0xfa80('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xfa80('0x26')+_0x297947[_0xfa80('0x21')]+')','participationtypemask':_0x297947[_0xfa80('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x297947[_0xfa80('0x30')]+')','participationtypemask':_0x297947[_0xfa80('0x47')]===_0xfa80('0x46')?0x1:0x2}]},getCustomFields(_0x39a3da[_0xfa80('0x41')],_0x5dd793,_0x39a3da[_0xfa80('0x42')])),'headers':{'Authorization':_0xfa80('0x27')+_0x32e413,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x18dd1c);})[_0xfa80('0x10')](function(_0x54cbf3){var _0x1a1635=_0x54cbf3[_0xfa80('0x28')][_0xfa80('0x29')];var _0x3970a6=_0x1a1635['substring'](_0x1a1635[_0xfa80('0x2b')]('(')+0x1,_0x1a1635[_0xfa80('0x2b')](')'));_0x297947[_0xfa80('0x48')]=_0x3970a6;_0x3fee60(_0x297947);})[_0xfa80('0x2c')](function(_0x67616e){_0x19d139(_0x67616e[_0xfa80('0x13')]);});});}function emit(_0x2dca40,_0x50ab14,_0x376fa1,_0x207e1a){var _0x3f22e0={'uri':util[_0xfa80('0x49')](_0xfa80('0x4a'),_0x2dca40,_0x376fa1,_0x207e1a)};io['to'](util[_0xfa80('0x49')](_0xfa80('0x4b'),_0x50ab14))[_0xfa80('0x4c')](_0xfa80('0x4d'),_0x3f22e0);}exports['cs']=function(_0x2d188e,_0x16fa44,_0x180548,_0x4fe10c,_0x5a93b7,_0x5c2d98,_0xf13c4d,_0x5169f1){var _0x5877ec={};_0x5c2d98[_0xfa80('0x4e')]=intUtil[_0xfa80('0x4f')](_0x5c2d98[_0xfa80('0x4e')]);_0x5c2d98['serverUrl']=intUtil['stripTrailingSlash'](_0x5c2d98['serverUrl']);_0x5877ec[_0xfa80('0x47')]=_0x5169f1===_0xfa80('0x46')||_0x5169f1==='unmanaged'?_0xfa80('0x46'):_0xfa80('0x24');var _0x11978e=util['format']('%s/api/data/v9.0/',_0x5c2d98[_0xfa80('0x4e')]);var _0x1469a4=util[_0xfa80('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5c2d98[_0xfa80('0x50')]);var _0x51ddc4=util[_0xfa80('0x49')](_0xfa80('0x51'),_0x5c2d98[_0xfa80('0x52')],_0x16fa44[_0xfa80('0x53')],md5(_0x16fa44[_0xfa80('0x53')]));if(_0x5a93b7&&_0x5a93b7['monitor_format']){logger[_0xfa80('0x1f')]('[QUEUE]',_0xfa80('0x54'));_0x16fa44['recordingURL']=_0x51ddc4;}else if(_0xf13c4d&&_0xf13c4d[_0xfa80('0x55')]&&_0xf13c4d[_0xfa80('0x55')]!=='none'){logger[_0xfa80('0x1f')]('[OUTBOUND]',_0xfa80('0x54'));_0x16fa44['recordingURL']=_0x51ddc4;}else{_0x16fa44[_0xfa80('0x56')]='';}return getUser(_0x5877ec,_0x5c2d98,_0x4fe10c,_0x1469a4,_0x11978e,_0x5169f1)[_0xfa80('0x10')](function(_0x203cd9){logger[_0xfa80('0x1f')]('['+_0x5169f1[_0xfa80('0x12')]()+_0xfa80('0x57'),_0x203cd9[_0xfa80('0x21')]);logger['info']('['+_0x5169f1[_0xfa80('0x12')]()+_0xfa80('0x58'),_0x203cd9[_0xfa80('0x1b')]);return getEndUser(_0x203cd9,_0x5c2d98,_0x1469a4,_0x11978e,_0x16fa44,_0x5169f1);})[_0xfa80('0x10')](function(_0x26ebcb){logger['info']('['+_0x5169f1['toUpperCase']()+_0xfa80('0x59'),_0x26ebcb[_0xfa80('0x30')]);logger['info']('['+_0x5169f1[_0xfa80('0x12')]()+_0xfa80('0x5a'),_0x16fa44[_0xfa80('0x45')]);return getTicket(_0x26ebcb,_0x5c2d98,_0x1469a4,_0x11978e,_0x16fa44,_0x180548,_0x5169f1);})[_0xfa80('0x10')](function(_0x40dd76){logger[_0xfa80('0x1f')](util[_0xfa80('0x49')]('['+_0x5169f1[_0xfa80('0x12')]()+_0xfa80('0x5b'),_0x180548[_0xfa80('0x42')],_0x40dd76['ticketId']));logger[_0xfa80('0x1f')](util[_0xfa80('0x49')]('['+_0x5169f1[_0xfa80('0x12')]()+']\x20Call\x20direction:\x20%s',_0x5169f1));if(_0x5169f1!==_0xfa80('0x5c')){logger['info']('['+_0x5169f1[_0xfa80('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5c2d98['remoteUri'],_0x4fe10c[_0xfa80('0x5d')],_0x180548[_0xfa80('0x42')],_0x40dd76[_0xfa80('0x48')]);}})[_0xfa80('0x2c')](function(_0x1643ed){logger[_0xfa80('0x11')]('['+_0x5169f1[_0xfa80('0x12')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xfa80('0x5e')](_0x1643ed,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 181cc32..2802017 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d67=['freshdesk','redis','localhost','socket.io-emitter','application/json','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','<br>','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','stringify','forEach','includes','picklist','nameField','customField','content','type','idField','push','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','error','lastevent','toUpperCase','lodash','request-promise','util','../../../../config/environment','../../../../config/logger'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x4d67,0xab));var _0x74d6=function(_0x1ab035,_0x476f65){_0x1ab035=_0x1ab035-0x0;var _0x41bca3=_0x4d67[_0x1ab035];return _0x41bca3;};'use strict';var _=require(_0x74d6('0x0'));var rp=require(_0x74d6('0x1'));var md5=require('md5');var util=require(_0x74d6('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x74d6('0x3'));var logger=require(_0x74d6('0x4'))(_0x74d6('0x5'));config[_0x74d6('0x6')]=_['defaults'](config[_0x74d6('0x6')],{'host':_0x74d6('0x7'),'port':0x18eb});var io=require(_0x74d6('0x8'))(new Redis(config[_0x74d6('0x6')]));var headers={'Content-Type':_0x74d6('0x9'),'Accept':_0x74d6('0x9')};function emit(_0x2d0223,_0x516986,_0x5780a2){io['to'](_0x2d0223)['emit'](_0x516986,_0x5780a2);}function getTicket(_0x454525,_0x4c2587,_0x2bda1d,_0x305a1d,_0x11962b){logger['info']('Creating\x20new\x20ticket...');var _0x24c6ac=_[_0x74d6('0xa')]({'responder_id':_0x4c2587['id'],'requester_id':_0x2bda1d['id'],'name':util[_0x74d6('0xb')](_0x74d6('0xc'),_0x11962b[_0x74d6('0xd')]),'phone':_0x11962b[_0x74d6('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x305a1d[_0x74d6('0xf')],_0x11962b,'\x20'),'description':intUtil[_0x74d6('0x10')](_0x305a1d[_0x74d6('0x11')],_0x11962b,_0x74d6('0x12')),'tags':getTags(_0x305a1d[_0x74d6('0x13')],_0x74d6('0x14'))},getCustomFields(_0x305a1d[_0x74d6('0x15')],_0x11962b));_0x24c6ac[_0x74d6('0x16')]=_[_0x74d6('0x17')](_[_0x74d6('0x18')](_0x24c6ac[_0x74d6('0x16')],'id'),_0x74d6('0x19'));return request({'uri':util[_0x74d6('0xb')](_0x74d6('0x1a'),_0x454525['remoteUri']),'method':_0x74d6('0x1b'),'body':_0x24c6ac})[_0x74d6('0x1c')](function(_0x50a9c6){logger[_0x74d6('0x1d')](_0x74d6('0x1e'));return _0x50a9c6;});}function getUser(_0x131924,_0x39117a){if(intUtil[_0x74d6('0x1f')](_0x39117a)){return request({'uri':util[_0x74d6('0xb')](_0x74d6('0x20'),_0x131924[_0x74d6('0x21')]),'qs':{'email':_0x39117a}})[_0x74d6('0x1c')](function(_0x560e7f){if(_0x560e7f['length']){logger[_0x74d6('0x1d')]('Agent\x20found!');return _[_0x74d6('0x22')](_0x560e7f,function(_0x2b648a){return _0x2b648a[_0x74d6('0x23')]['email']===_0x39117a;});}else{logger[_0x74d6('0x1d')](_0x74d6('0x24'));return request({'uri':util[_0x74d6('0xb')](_0x74d6('0x25'),_0x131924[_0x74d6('0x21')])})[_0x74d6('0x1c')](function(_0x4b73d9){logger[_0x74d6('0x1d')]('Admin\x20account\x20selected.');return _0x4b73d9;});}});}else{logger[_0x74d6('0x1d')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x74d6('0xb')]('%s/api/v2/agents/me',_0x131924['remoteUri'])})[_0x74d6('0x1c')](function(_0x14868d){logger[_0x74d6('0x1d')](_0x74d6('0x26'));return _0x14868d;});}}function getEndUser(_0x443978,_0x4145f3,_0x188782){logger[_0x74d6('0x1d')]('Searching\x20enduser\x20with\x20phone',_0x188782);return request({'uri':util['format']('%s/api/v2/contacts',_0x443978[_0x74d6('0x21')]),'qs':{'phone':_0x188782}})[_0x74d6('0x1c')](function(_0x349cb9){if(_0x349cb9[_0x74d6('0x27')]){logger[_0x74d6('0x1d')](_0x74d6('0x28'));return _[_0x74d6('0x22')](_0x349cb9,{'phone':_0x188782});}else{logger[_0x74d6('0x1d')](_0x74d6('0x29'));return request({'uri':util[_0x74d6('0xb')]('%s/api/v2/contacts',_0x443978[_0x74d6('0x21')]),'method':'POST','body':{'name':_0x4145f3,'phone':_0x188782}})[_0x74d6('0x1c')](function(_0x12e648){logger[_0x74d6('0x1d')](_0x74d6('0x2a'));return _0x12e648;});}});}function getAuth(_0x2872c2){return util['format'](_0x74d6('0x2b'),new Buffer(_0x2872c2[_0x74d6('0x2c')]+':X')[_0x74d6('0x2d')]('base64'));}function request(_0x408d8f){logger['debug']('[HTTP]',JSON[_0x74d6('0x2e')](_0x408d8f));return rp(_['defaults'](_0x408d8f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x8a926a,_0xcf0823){var _0x2afaef=[];if(_0x8a926a&&_0x8a926a[_0x74d6('0x27')]>0x0){_0x2afaef=_['map'](_0x8a926a,_0xcf0823);}return _0x2afaef;}function getCustomFields(_0x221a24,_0x45d409){var _0x5b5dbf=[];var _0x10037e={'custom_fields':[]};if(_0x221a24[_0x74d6('0x27')]>0x0){_[_0x74d6('0x2f')](_0x221a24,function(_0x1cf4d7){if(_[_0x74d6('0x30')](['string',_0x74d6('0x31')],_0x1cf4d7['type'])&&_0x1cf4d7[_0x74d6('0x32')]&&!_0x1cf4d7[_0x74d6('0x33')]){_0x10037e[_0x1cf4d7[_0x74d6('0x32')]['toLowerCase']()]=_0x1cf4d7[_0x74d6('0x34')]['toString']();}else if(_[_0x74d6('0x30')](['string',_0x74d6('0x31')],_0x1cf4d7[_0x74d6('0x35')])&&_0x1cf4d7[_0x74d6('0x36')]&&_0x1cf4d7[_0x74d6('0x33')]){_0x10037e[_0x74d6('0x16')][_0x74d6('0x37')]({'id':_0x1cf4d7[_0x74d6('0x36')],'value':_0x1cf4d7[_0x74d6('0x34')][_0x74d6('0x2d')]()});}else if(_0x1cf4d7[_0x74d6('0x35')]===_0x74d6('0x38')&&_0x1cf4d7[_0x74d6('0x39')]&&_0x1cf4d7[_0x74d6('0x36')]&&_0x1cf4d7[_0x74d6('0x33')]){_0x45d409[_0x1cf4d7[_0x74d6('0x39')]]&&_0x10037e[_0x74d6('0x16')][_0x74d6('0x37')]({'id':_0x1cf4d7[_0x74d6('0x36')],'value':_0x45d409[_0x1cf4d7[_0x74d6('0x39')]][_0x74d6('0x2d')]()});}else if(_0x1cf4d7['type']==='customVariable'&&_0x1cf4d7[_0x74d6('0x3a')]&&_0x1cf4d7[_0x74d6('0x3a')]['name']&&_0x1cf4d7['idField']&&_0x1cf4d7[_0x74d6('0x33')]){_0x45d409[_0x1cf4d7[_0x74d6('0x3a')][_0x74d6('0x14')][_0x74d6('0x3b')]()]&&_0x10037e[_0x74d6('0x16')][_0x74d6('0x37')]({'id':_0x1cf4d7[_0x74d6('0x36')],'value':_0x45d409[_0x1cf4d7[_0x74d6('0x3a')][_0x74d6('0x14')]['toLowerCase']()][_0x74d6('0x2d')]()});}});}return _0x10037e;}exports[_0x74d6('0x3c')]=function(_0x38feb8,_0x12b14d,_0x30a17e,_0x2a44e1,_0x1aee73,_0x3989dc){var _0x5aea13,_0x3bf14a;_0x3989dc['remoteUri']=intUtil[_0x74d6('0x3d')](_0x3989dc['remoteUri']);_0x3989dc[_0x74d6('0x3e')]=intUtil[_0x74d6('0x3d')](_0x3989dc['serverUrl']);if(_0x1aee73&&_0x1aee73[_0x74d6('0x3f')]){logger[_0x74d6('0x1d')](_0x74d6('0x40'),_0x74d6('0x41'));_0x12b14d[_0x74d6('0x42')]=util[_0x74d6('0xb')](_0x74d6('0x43'),_0x3989dc[_0x74d6('0x3e')],_0x12b14d[_0x74d6('0x44')],md5(_0x12b14d[_0x74d6('0x44')]));}else{_0x12b14d['recordingURL']='';}headers[_0x74d6('0x45')]=getAuth(_0x3989dc);return getUser(_0x3989dc,_0x2a44e1[_0x74d6('0x46')])[_0x74d6('0x1c')](function(_0x37c260){_0x5aea13=_0x37c260;logger[_0x74d6('0x1d')](_0x74d6('0x47'),_0x5aea13['id']);return getEndUser(_0x3989dc,_0x12b14d['calleridname'],_0x12b14d[_0x74d6('0xe')]);})['then'](function(_0x351c61){_0x3bf14a=_0x351c61;logger['info'](_0x74d6('0x48'),_0x3bf14a['id']);return getTicket(_0x3989dc,_0x5aea13,_0x3bf14a,_0x30a17e,_0x12b14d);})[_0x74d6('0x1c')](function(_0x1aaaae){if(_0x1aaaae&&_0x1aaaae['id']){logger['info'](_0x74d6('0x1e'));logger[_0x74d6('0x1d')](_0x74d6('0x49'),_0x1aaaae['id']);logger[_0x74d6('0x1d')](_0x74d6('0x40'),_0x74d6('0x4a'));emit(util['format']('user:%s',_0x2a44e1[_0x74d6('0x14')]),_0x74d6('0x4b'),{'uri':util[_0x74d6('0xb')](_0x74d6('0x4c'),_0x3989dc[_0x74d6('0x21')],_0x1aaaae['id'])});}})[_0x74d6('0x4d')](function(_0x46ddc0){logger['error'](_0x74d6('0x40'),JSON['stringify'](_0x46ddc0));});};exports[_0x74d6('0x4e')]=function(_0x1cd377,_0x30666d,_0x351c10,_0x219bb4,_0x57e9f3,_0x5f3f5b,_0x558f38){var _0x5a0861,_0x84df90;_0x5f3f5b[_0x74d6('0x21')]=intUtil[_0x74d6('0x3d')](_0x5f3f5b['remoteUri']);_0x5f3f5b[_0x74d6('0x3e')]=intUtil[_0x74d6('0x3d')](_0x5f3f5b[_0x74d6('0x3e')]);if(_0x558f38&&_0x558f38[_0x74d6('0x4f')]&&_0x558f38['recordingFormat']!==_0x74d6('0x50')){logger[_0x74d6('0x1d')](_0x74d6('0x51'),_0x74d6('0x41'));_0x30666d[_0x74d6('0x42')]=util[_0x74d6('0xb')](_0x74d6('0x43'),_0x5f3f5b['serverUrl'],_0x30666d[_0x74d6('0x44')],md5(_0x30666d[_0x74d6('0x44')]));}headers[_0x74d6('0x45')]=getAuth(_0x5f3f5b);return getUser(_0x5f3f5b,_0x219bb4[_0x74d6('0x46')])[_0x74d6('0x1c')](function(_0x125d9f){_0x5a0861=_0x125d9f;logger[_0x74d6('0x1d')](_0x74d6('0x47'),_0x5a0861['id']);return getEndUser(_0x5f3f5b,_0x30666d[_0x74d6('0x52')],_0x30666d[_0x74d6('0x53')]);})[_0x74d6('0x1c')](function(_0x4e0bfe){_0x84df90=_0x4e0bfe;logger[_0x74d6('0x1d')](_0x74d6('0x48'),_0x84df90['id']);return getTicket(_0x5f3f5b,_0x5a0861,_0x84df90,_0x351c10,_0x30666d);})[_0x74d6('0x1c')](function(_0x5e3809){if(_0x5e3809&&_0x5e3809['id']){logger['info']('Ticket\x20created!');logger[_0x74d6('0x1d')](_0x74d6('0x49'),_0x5e3809['id']);logger[_0x74d6('0x1d')](_0x74d6('0x51'),_0x74d6('0x4a'));emit(util[_0x74d6('0xb')](_0x74d6('0x54'),_0x219bb4[_0x74d6('0x14')]),_0x74d6('0x4b'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x5f3f5b[_0x74d6('0x21')],_0x5e3809['id'])});}})[_0x74d6('0x4d')](function(_0x4e1c2a){logger[_0x74d6('0x55')]('[OUTBOUND]',JSON[_0x74d6('0x2e')](_0x4e1c2a));});};exports['unmanaged']=function(_0x529b6e,_0x27a9c6,_0x1025c8,_0x581a14,_0x241fe9,_0x373740){var _0x52cc51,_0x4bec16;_0x373740[_0x74d6('0x21')]=intUtil['stripTrailingSlash'](_0x373740[_0x74d6('0x21')]);_0x373740[_0x74d6('0x3e')]=intUtil[_0x74d6('0x3d')](_0x373740[_0x74d6('0x3e')]);if(_0x241fe9&&_0x241fe9[_0x74d6('0x3f')]){logger[_0x74d6('0x1d')]('['+_0x27a9c6[_0x74d6('0x56')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x27a9c6['recordingURL']=util[_0x74d6('0xb')](_0x74d6('0x43'),_0x373740[_0x74d6('0x3e')],_0x27a9c6[_0x74d6('0x44')],md5(_0x27a9c6[_0x74d6('0x44')]));}else{_0x27a9c6['recordingURL']='';}headers[_0x74d6('0x45')]=getAuth(_0x373740);return getUser(_0x373740,'')[_0x74d6('0x1c')](function(_0x274436){_0x52cc51=_0x274436;logger[_0x74d6('0x1d')](_0x74d6('0x47'),_0x52cc51['id']);return getEndUser(_0x373740,_0x27a9c6[_0x74d6('0xd')],_0x27a9c6[_0x74d6('0xe')]);})['then'](function(_0x2ba418){_0x4bec16=_0x2ba418;logger[_0x74d6('0x1d')](_0x74d6('0x48'),_0x4bec16['id']);return getTicket(_0x373740,_0x52cc51,_0x4bec16,_0x1025c8,_0x27a9c6);})[_0x74d6('0x1c')](function(_0x300976){if(_0x300976){logger[_0x74d6('0x1d')](_0x74d6('0x1e'));logger[_0x74d6('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x300976['id']);}})[_0x74d6('0x4d')](function(_0x27a9b2){logger[_0x74d6('0x55')]('['+_0x27a9c6[_0x74d6('0x56')][_0x74d6('0x57')]()+']',JSON['stringify'](_0x27a9b2));});};
\ No newline at end of file
+var _0x355a=['./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','info','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','Tags','Fields','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','idField','customField','content','variable','variableName','push','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Authorization','lastevent','toUpperCase','util','ioredis'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x355a,0xbe));var _0xa355=function(_0x167100,_0x1405ee){_0x167100=_0x167100-0x0;var _0x2114c0=_0x355a[_0x167100];return _0x2114c0;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xa355('0x0'));var Redis=require(_0xa355('0x1'));var intUtil=require(_0xa355('0x2'));var config=require(_0xa355('0x3'));var logger=require(_0xa355('0x4'))(_0xa355('0x5'));config[_0xa355('0x6')]=_[_0xa355('0x7')](config[_0xa355('0x6')],{'host':_0xa355('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa355('0x6')]));var headers={'Content-Type':_0xa355('0x9'),'Accept':_0xa355('0x9')};function emit(_0xffb5c,_0x59a79a,_0x3cde45){io['to'](_0xffb5c)[_0xa355('0xa')](_0x59a79a,_0x3cde45);}function getTicket(_0x36b5d3,_0x5817d3,_0x3d27d9,_0x473933,_0x234df8){logger[_0xa355('0xb')]('Creating\x20new\x20ticket...');var _0x510cd5=_[_0xa355('0xc')]({'responder_id':_0x5817d3['id'],'requester_id':_0x3d27d9['id'],'name':util['format'](_0xa355('0xd'),_0x234df8[_0xa355('0xe')]),'phone':_0x234df8[_0xa355('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa355('0x10')](_0x473933[_0xa355('0x11')],_0x234df8,'\x20'),'description':intUtil['getString'](_0x473933[_0xa355('0x12')],_0x234df8,_0xa355('0x13')),'tags':getTags(_0x473933[_0xa355('0x14')],'name')},getCustomFields(_0x473933[_0xa355('0x15')],_0x234df8));_0x510cd5[_0xa355('0x16')]=_[_0xa355('0x17')](_[_0xa355('0x18')](_0x510cd5[_0xa355('0x16')],'id'),'value');return request({'uri':util[_0xa355('0x19')](_0xa355('0x1a'),_0x36b5d3['remoteUri']),'method':_0xa355('0x1b'),'body':_0x510cd5})[_0xa355('0x1c')](function(_0x49851a){logger[_0xa355('0xb')](_0xa355('0x1d'));return _0x49851a;});}function getUser(_0x5460dd,_0x441630){if(intUtil[_0xa355('0x1e')](_0x441630)){return request({'uri':util['format'](_0xa355('0x1f'),_0x5460dd[_0xa355('0x20')]),'qs':{'email':_0x441630}})[_0xa355('0x1c')](function(_0x1cc6c6){if(_0x1cc6c6[_0xa355('0x21')]){logger[_0xa355('0xb')](_0xa355('0x22'));return _[_0xa355('0x23')](_0x1cc6c6,function(_0x5e58fd){return _0x5e58fd[_0xa355('0x24')][_0xa355('0x25')]===_0x441630;});}else{logger['info'](_0xa355('0x26'));return request({'uri':util['format'](_0xa355('0x27'),_0x5460dd[_0xa355('0x20')])})[_0xa355('0x1c')](function(_0x1f37c4){logger['info'](_0xa355('0x28'));return _0x1f37c4;});}});}else{logger[_0xa355('0xb')](_0xa355('0x29'));return request({'uri':util['format'](_0xa355('0x27'),_0x5460dd[_0xa355('0x20')])})[_0xa355('0x1c')](function(_0x3d51d7){logger[_0xa355('0xb')](_0xa355('0x28'));return _0x3d51d7;});}}function getEndUser(_0x43bec8,_0x171338,_0xfc90cd){logger['info'](_0xa355('0x2a'),_0xfc90cd);return request({'uri':util[_0xa355('0x19')](_0xa355('0x2b'),_0x43bec8['remoteUri']),'qs':{'phone':_0xfc90cd}})['then'](function(_0x172256){if(_0x172256[_0xa355('0x21')]){logger[_0xa355('0xb')](_0xa355('0x2c'));return _[_0xa355('0x23')](_0x172256,{'phone':_0xfc90cd});}else{logger[_0xa355('0xb')](_0xa355('0x2d'));return request({'uri':util[_0xa355('0x19')]('%s/api/v2/contacts',_0x43bec8[_0xa355('0x20')]),'method':_0xa355('0x1b'),'body':{'name':_0x171338,'phone':_0xfc90cd}})[_0xa355('0x1c')](function(_0xf505b8){logger['info']('Enduser\x20created.');return _0xf505b8;});}});}function getAuth(_0x3fb641){return util[_0xa355('0x19')]('Basic\x20%s',new Buffer(_0x3fb641[_0xa355('0x2e')]+':X')[_0xa355('0x2f')](_0xa355('0x30')));}function request(_0x48a4a8){logger[_0xa355('0x31')](_0xa355('0x32'),JSON[_0xa355('0x33')](_0x48a4a8));return rp(_['defaults'](_0x48a4a8,{'method':_0xa355('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x5f4008,_0x167a24){var _0xe48647=[];if(_0x5f4008&&_0x5f4008['length']>0x0){_0xe48647=_[_0xa355('0x35')](_0x5f4008,_0x167a24);}return _0xe48647;}function getCustomFields(_0x56dfe6,_0x208dc6){var _0x4b2034=[];var _0x89e6b5={'custom_fields':[]};if(_0x56dfe6[_0xa355('0x21')]>0x0){_[_0xa355('0x36')](_0x56dfe6,function(_0x4844cf){if(_[_0xa355('0x37')]([_0xa355('0x38'),_0xa355('0x39')],_0x4844cf[_0xa355('0x3a')])&&_0x4844cf[_0xa355('0x3b')]&&!_0x4844cf['customField']){_0x89e6b5[_0x4844cf[_0xa355('0x3b')]['toLowerCase']()]=_0x4844cf['content'][_0xa355('0x2f')]();}else if(_[_0xa355('0x37')](['string',_0xa355('0x39')],_0x4844cf[_0xa355('0x3a')])&&_0x4844cf[_0xa355('0x3c')]&&_0x4844cf[_0xa355('0x3d')]){_0x89e6b5['custom_fields']['push']({'id':_0x4844cf[_0xa355('0x3c')],'value':_0x4844cf[_0xa355('0x3e')][_0xa355('0x2f')]()});}else if(_0x4844cf[_0xa355('0x3a')]===_0xa355('0x3f')&&_0x4844cf[_0xa355('0x40')]&&_0x4844cf[_0xa355('0x3c')]&&_0x4844cf[_0xa355('0x3d')]){_0x208dc6[_0x4844cf['variableName']]&&_0x89e6b5[_0xa355('0x16')][_0xa355('0x41')]({'id':_0x4844cf['idField'],'value':_0x208dc6[_0x4844cf[_0xa355('0x40')]][_0xa355('0x2f')]()});}else if(_0x4844cf[_0xa355('0x3a')]===_0xa355('0x42')&&_0x4844cf[_0xa355('0x43')]&&_0x4844cf[_0xa355('0x43')][_0xa355('0x44')]&&_0x4844cf[_0xa355('0x3c')]&&_0x4844cf[_0xa355('0x3d')]){_0x208dc6[_0x4844cf[_0xa355('0x43')][_0xa355('0x44')][_0xa355('0x45')]()]&&_0x89e6b5[_0xa355('0x16')]['push']({'id':_0x4844cf[_0xa355('0x3c')],'value':_0x208dc6[_0x4844cf['Variable'][_0xa355('0x44')]['toLowerCase']()]['toString']()});}});}return _0x89e6b5;}exports[_0xa355('0x46')]=function(_0x274f69,_0x4ca395,_0x224d5c,_0x1abab3,_0x516807,_0x4cfba1){var _0x14a0d9,_0xe83353;_0x4cfba1[_0xa355('0x20')]=intUtil[_0xa355('0x47')](_0x4cfba1['remoteUri']);_0x4cfba1[_0xa355('0x48')]=intUtil[_0xa355('0x47')](_0x4cfba1[_0xa355('0x48')]);if(_0x516807&&_0x516807[_0xa355('0x49')]){logger[_0xa355('0xb')]('[QUEUE]',_0xa355('0x4a'));_0x4ca395['recordingURL']=util['format'](_0xa355('0x4b'),_0x4cfba1['serverUrl'],_0x4ca395['uniqueid'],md5(_0x4ca395[_0xa355('0x4c')]));}else{_0x4ca395['recordingURL']='';}headers['Authorization']=getAuth(_0x4cfba1);return getUser(_0x4cfba1,_0x1abab3[_0xa355('0x25')])['then'](function(_0x174bf4){_0x14a0d9=_0x174bf4;logger['info'](_0xa355('0x4d'),_0x14a0d9['id']);return getEndUser(_0x4cfba1,_0x4ca395[_0xa355('0xe')],_0x4ca395[_0xa355('0xf')]);})[_0xa355('0x1c')](function(_0x11d409){_0xe83353=_0x11d409;logger[_0xa355('0xb')](_0xa355('0x4e'),_0xe83353['id']);return getTicket(_0x4cfba1,_0x14a0d9,_0xe83353,_0x224d5c,_0x4ca395);})[_0xa355('0x1c')](function(_0x55ab92){if(_0x55ab92&&_0x55ab92['id']){logger['info'](_0xa355('0x1d'));logger[_0xa355('0xb')](_0xa355('0x4f'),_0x55ab92['id']);logger[_0xa355('0xb')](_0xa355('0x50'),_0xa355('0x51'));emit(util['format'](_0xa355('0x52'),_0x1abab3[_0xa355('0x44')]),_0xa355('0x53'),{'uri':util[_0xa355('0x19')](_0xa355('0x54'),_0x4cfba1[_0xa355('0x20')],_0x55ab92['id'])});}})[_0xa355('0x55')](function(_0x1bd8bb){logger[_0xa355('0x56')](_0xa355('0x50'),JSON[_0xa355('0x33')](_0x1bd8bb));});};exports['outbound']=function(_0x275aa8,_0x20eebc,_0x2bb774,_0x35b4f9,_0x52792a,_0x24dfb4,_0x17baa6){var _0xce4b6c,_0xc15c66;_0x24dfb4[_0xa355('0x20')]=intUtil[_0xa355('0x47')](_0x24dfb4['remoteUri']);_0x24dfb4[_0xa355('0x48')]=intUtil[_0xa355('0x47')](_0x24dfb4['serverUrl']);if(_0x17baa6&&_0x17baa6[_0xa355('0x57')]&&_0x17baa6[_0xa355('0x57')]!==_0xa355('0x58')){logger[_0xa355('0xb')](_0xa355('0x59'),_0xa355('0x4a'));_0x20eebc[_0xa355('0x5a')]=util[_0xa355('0x19')](_0xa355('0x4b'),_0x24dfb4[_0xa355('0x48')],_0x20eebc[_0xa355('0x4c')],md5(_0x20eebc['uniqueid']));}headers['Authorization']=getAuth(_0x24dfb4);return getUser(_0x24dfb4,_0x35b4f9[_0xa355('0x25')])['then'](function(_0x47303a){_0xce4b6c=_0x47303a;logger[_0xa355('0xb')](_0xa355('0x4d'),_0xce4b6c['id']);return getEndUser(_0x24dfb4,_0x20eebc[_0xa355('0x5b')],_0x20eebc[_0xa355('0x5c')]);})[_0xa355('0x1c')](function(_0x1510d0){_0xc15c66=_0x1510d0;logger[_0xa355('0xb')](_0xa355('0x4e'),_0xc15c66['id']);return getTicket(_0x24dfb4,_0xce4b6c,_0xc15c66,_0x2bb774,_0x20eebc);})[_0xa355('0x1c')](function(_0x573eaf){if(_0x573eaf&&_0x573eaf['id']){logger[_0xa355('0xb')](_0xa355('0x1d'));logger['info'](_0xa355('0x4f'),_0x573eaf['id']);logger[_0xa355('0xb')](_0xa355('0x59'),_0xa355('0x51'));emit(util['format']('user:%s',_0x35b4f9[_0xa355('0x44')]),'trigger:browser:url',{'uri':util[_0xa355('0x19')](_0xa355('0x54'),_0x24dfb4[_0xa355('0x20')],_0x573eaf['id'])});}})[_0xa355('0x55')](function(_0x25c0b6){logger[_0xa355('0x56')](_0xa355('0x59'),JSON[_0xa355('0x33')](_0x25c0b6));});};exports['unmanaged']=function(_0x495738,_0x442b56,_0x541c42,_0x2f07bc,_0x3e29c6,_0x42326c){var _0x2e56e3,_0x22b403;_0x42326c['remoteUri']=intUtil[_0xa355('0x47')](_0x42326c['remoteUri']);_0x42326c[_0xa355('0x48')]=intUtil['stripTrailingSlash'](_0x42326c[_0xa355('0x48')]);if(_0x3e29c6&&_0x3e29c6[_0xa355('0x49')]){logger[_0xa355('0xb')]('['+_0x442b56['lastevent']['toUpperCase']()+']',_0xa355('0x4a'));_0x442b56[_0xa355('0x5a')]=util[_0xa355('0x19')](_0xa355('0x4b'),_0x42326c[_0xa355('0x48')],_0x442b56[_0xa355('0x4c')],md5(_0x442b56[_0xa355('0x4c')]));}else{_0x442b56['recordingURL']='';}headers[_0xa355('0x5d')]=getAuth(_0x42326c);return getUser(_0x42326c,'')['then'](function(_0x5d4da8){_0x2e56e3=_0x5d4da8;logger[_0xa355('0xb')](_0xa355('0x4d'),_0x2e56e3['id']);return getEndUser(_0x42326c,_0x442b56[_0xa355('0xe')],_0x442b56[_0xa355('0xf')]);})[_0xa355('0x1c')](function(_0x5b7c6e){_0x22b403=_0x5b7c6e;logger[_0xa355('0xb')](_0xa355('0x4e'),_0x22b403['id']);return getTicket(_0x42326c,_0x2e56e3,_0x22b403,_0x541c42,_0x442b56);})['then'](function(_0xea6c95){if(_0xea6c95){logger[_0xa355('0xb')]('Ticket\x20created!');logger[_0xa355('0xb')]('The\x20Ticket\x20ID\x20is:',_0xea6c95['id']);}})[_0xa355('0x55')](function(_0x3785e4){logger[_0xa355('0x56')]('['+_0x442b56[_0xa355('0x5e')][_0xa355('0x5f')]()+']',JSON['stringify'](_0x3785e4));});};
\ No newline at end of file
index b5c10b2..f73ae27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bb4=['catch','error','/api/lookup?q=','&f=','&entities=contact','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','email','adminId','Admin\x20found:','toUpperCase','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','length','userId','User\x20found:','userEmail','adminEmail','Requested\x20Resource\x20not\x20Found'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x5bb4,0xd5));var _0x45bb=function(_0x463c4c,_0x137362){_0x463c4c=_0x463c4c-0x0;var _0x2b3fae=_0x5bb4[_0x463c4c];return _0x2b3fae;};'use strict';var _=require(_0x45bb('0x0'));var rp=require(_0x45bb('0x1'));var md5=require(_0x45bb('0x2'));var util=require(_0x45bb('0x3'));var moment=require(_0x45bb('0x4'));var Promise=require(_0x45bb('0x5'));var Redis=require(_0x45bb('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('freshsales');config[_0x45bb('0x7')]=_['defaults'](config[_0x45bb('0x7')],{'host':_0x45bb('0x8'),'port':0x18eb});var io=require(_0x45bb('0x9'))(new Redis(config[_0x45bb('0x7')]));function getAdminId(_0x37890b,_0x29e9c2,_0x4d5b7d,_0x46d110){return new Promise(function(_0x386853,_0x4e98ac){var _0xcf34f0=![];var _0x58d893={'method':_0x45bb('0xa'),'uri':_0x46d110+_0x45bb('0xb'),'json':!![]};_0x58d893[_0x45bb('0xc')]=_0x4d5b7d;logger[_0x45bb('0xd')]('Getting\x20admin\x20information');return rp(_0x58d893)[_0x45bb('0xe')](function(_0x4ebee6){if(_0x4ebee6){var _0x11f3d0=_0x4ebee6[_0x45bb('0xf')];var _0x3202b6=null;for(_0x3202b6=0x0;_0x3202b6<_0x11f3d0['length'];_0x3202b6++){if(_0x11f3d0[_0x3202b6][_0x45bb('0x10')]===_0x37890b['adminEmail']){_0x37890b[_0x45bb('0x11')]=_0x11f3d0[_0x3202b6]['id'];_0xcf34f0=!![];}}if(_0xcf34f0){logger['info'](_0x45bb('0x12'),_0x37890b[_0x45bb('0x11')]);_0x386853(_0x37890b);}else{_0x4e98ac({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4e98ac({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x4ea19f){logger['error']('['+[_0x29e9c2[_0x45bb('0x13')]()]+']',_0x4ea19f[_0x45bb('0x14')]);_0x4e98ac(_0x4ea19f);});});}function getUser(_0x583e8b,_0x19f1dd,_0x5c3e5b){return function(_0x5e3bda){return new Promise(function(_0x49f173,_0x4b499c){var _0x347137={'method':_0x45bb('0xa'),'uri':_0x5c3e5b+_0x45bb('0xb'),'json':!![]};_0x347137[_0x45bb('0xc')]=_0x19f1dd;logger[_0x45bb('0xd')](_0x45bb('0x15'));return rp(_0x347137)['then'](function(_0x32fbfc){if(_0x32fbfc){var _0x320a53=_0x32fbfc[_0x45bb('0xf')];var _0x105921=![];var _0x5eb4e1=null;if(_0x5e3bda['agentEmail']!==null){logger[_0x45bb('0xd')](_0x45bb('0x16'),_0x5e3bda['agentEmail']);_0x5e3bda['userEmail']=_0x5e3bda[_0x45bb('0x17')];for(_0x5eb4e1=0x0;_0x5eb4e1<_0x320a53[_0x45bb('0x18')];_0x5eb4e1++){if(_0x320a53[_0x5eb4e1][_0x45bb('0x10')]===_0x5e3bda['agentEmail']){_0x105921=!![];_0x5e3bda[_0x45bb('0x19')]=_0x320a53[_0x5eb4e1]['id'];logger[_0x45bb('0xd')](_0x45bb('0x1a'),_0x5e3bda[_0x45bb('0x19')]);}}}if(!_0x105921){logger[_0x45bb('0xd')]('Admin\x20selected');_0x5e3bda[_0x45bb('0x1b')]=_0x5e3bda[_0x45bb('0x1c')];_0x5e3bda[_0x45bb('0x19')]=_0x5e3bda[_0x45bb('0x11')];_0x105921=!![];}if(_0x105921){_0x49f173(_0x5e3bda);}else{_0x4b499c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4b499c({'statusCode':0x194,'message':_0x45bb('0x1d')});}})[_0x45bb('0x1e')](function(_0x36b66e){logger[_0x45bb('0x1f')]('['+[_0x583e8b[_0x45bb('0x13')]()]+']',_0x36b66e[_0x45bb('0x14')]);_0x4b499c(_0x36b66e);});});};}function searchContact(_0x2f885c,_0x2857ba,_0x57d0de,_0x99dae3){return new Promise(function(_0x2f08f8,_0x1035f2){var _0x4c1740={'method':_0x45bb('0xa'),'headers':_0x2857ba,'uri':_0x2f885c+_0x45bb('0x20')+_0x99dae3+_0x45bb('0x21')+_0x57d0de+_0x45bb('0x22'),'json':!![]};rp(_0x4c1740)[_0x45bb('0xe')](function(_0x18645b){var _0x1f5f29=_['find'](_0x18645b['contacts']['contacts'],[_0x57d0de,_0x99dae3]);_0x2f08f8(_0x1f5f29);})[_0x45bb('0x1e')](function(_0x5db9b0){_0x1035f2(_0x5db9b0);});});}function getEndUser(_0x5ef351,_0x3aec46,_0x42a563){return function(_0x5f8276){return new Promise(function(_0x42c609,_0x37213b){logger['info'](util[_0x45bb('0x23')](_0x45bb('0x24'),_0x5f8276[_0x45bb('0x25')]));searchContact(_0x42a563,_0x3aec46,_0x45bb('0x26'),_0x5f8276['contactNumber'])[_0x45bb('0xe')](function(_0x15f5f9){if(_0x15f5f9){_0x5f8276['endUserId']=_0x15f5f9['id'];logger[_0x45bb('0xd')](_0x45bb('0x27'),_0x5f8276[_0x45bb('0x28')]);return _0x42c609(_0x5f8276);}searchContact(_0x42a563,_0x3aec46,'work_number',_0x5f8276['contactNumber'])['then'](function(_0xb727dc){if(_0xb727dc){_0x5f8276[_0x45bb('0x28')]=_0xb727dc['id'];logger[_0x45bb('0xd')](_0x45bb('0x29'),_0x5f8276[_0x45bb('0x28')]);return _0x42c609(_0x5f8276);}createEndUser(_0x5f8276,_0x5ef351,_0x3aec46,_0x42a563)[_0x45bb('0xe')](function(_0xab3623){logger[_0x45bb('0xd')](_0x45bb('0x2a'),_0xab3623['endUserId']);return _0x42c609(_0xab3623);});});})[_0x45bb('0x1e')](function(_0x3ae986){_0x37213b(_0x3ae986);});});};}function createEndUser(_0x2f8330,_0x2d5d91,_0x2bab59,_0x3f0bf1){return new Promise(function(_0x199fdc,_0x1ac329){var _0x309523=moment();var _0x4216aa={'method':'POST','uri':_0x3f0bf1+_0x45bb('0x2b'),'body':{'contact':{'last_name':_0x2f8330[_0x45bb('0x25')],'work_number':_0x2f8330['contactNumber'],'mobile_number':_0x2f8330[_0x45bb('0x25')],'owner_id':_0x2f8330['userId'],'created_at':_0x309523['format'](_0x45bb('0x2c'))}},'json':!![]};_0x4216aa[_0x45bb('0xc')]=_0x2bab59;logger[_0x45bb('0xd')](_0x45bb('0x2d'));return rp(_0x4216aa)[_0x45bb('0xe')](function(_0x1443ca){_0x2f8330[_0x45bb('0x28')]=_0x1443ca['contact']['id'];_0x199fdc(_0x2f8330);})[_0x45bb('0x1e')](function(_0x47a385){logger['error']('['+[_0x2d5d91['toUpperCase']()]+']',_0x47a385[_0x45bb('0x14')]);_0x1ac329(_0x47a385[_0x45bb('0x14')]);});});}function getTicket(_0x4d00f4,_0x44922a,_0x13525e,_0x2bfa6b,_0xa54599){return function(_0x40df7c){logger[_0x45bb('0xd')](_0x45bb('0x2e'));return new Promise(function(_0x376bf4,_0x7b9532){var _0x5c4d3f=moment();var _0x4c893a={'method':'POST','uri':_0x13525e+_0x45bb('0x2f'),'body':{'title':intUtil[_0x45bb('0x30')](_0x2bfa6b[_0x45bb('0x31')],_0xa54599,'\x20'),'description':intUtil[_0x45bb('0x30')](_0x2bfa6b[_0x45bb('0x32')],_0xa54599,'\x0a'),'owner_id':_0x40df7c[_0x45bb('0x19')],'creater_id':_0x40df7c['adminId'],'targetable_id':_0x40df7c[_0x45bb('0x28')],'targetable_type':_0x45bb('0x33'),'created_at':_0x5c4d3f[_0x45bb('0x23')](_0x45bb('0x2c')),'due_date':_0x5c4d3f[_0x45bb('0x34')](0x1e,'m')[_0x45bb('0x23')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x4c893a['headers']=_0x44922a;return rp(_0x4c893a)[_0x45bb('0xe')](function(_0x3e1c78){_0x40df7c['ticketId']=_0x3e1c78['task']['id'];logger['info'](_0x45bb('0x35'),_0x40df7c[_0x45bb('0x36')]);_0x376bf4(_0x40df7c);})['catch'](function(_0x139c6c){logger[_0x45bb('0x1f')]('['+[_0x4d00f4[_0x45bb('0x13')]()]+']',_0x139c6c[_0x45bb('0x14')]);_0x7b9532(_0x139c6c[_0x45bb('0x14')]);});});};}function emit(_0x5c9883,_0x26ee21,_0x1b5243){var _0x22764a={'uri':_0x5c9883+_0x45bb('0x37')+_0x1b5243};io['to'](util['format'](_0x45bb('0x38'),_0x26ee21))[_0x45bb('0x39')](_0x45bb('0x3a'),_0x22764a);}exports['cs']=function(_0x151992,_0x4105e5,_0x58a76c,_0x16f62d,_0xa6fe5,_0x1e76a3,_0x147877,_0x410490){var _0x3c22e4={};var _0x57cfe4={'Authorization':_0x45bb('0x3b')+_0x1e76a3[_0x45bb('0x3c')]};_0x1e76a3['remoteUri']=intUtil[_0x45bb('0x3d')](_0x1e76a3['remoteUri']);_0x1e76a3[_0x45bb('0x3e')]=intUtil[_0x45bb('0x3d')](_0x1e76a3[_0x45bb('0x3e')]);var _0x3a347e=_0x1e76a3['remoteUri'];_0x3c22e4[_0x45bb('0x1c')]=_0x1e76a3[_0x45bb('0x3f')];_0x3c22e4[_0x45bb('0x25')]=_0x410490[_0x45bb('0x40')]()===_0x45bb('0x41')?_0x4105e5['destcalleridnum']:_0x4105e5[_0x45bb('0x42')];_0x3c22e4['callDirection']=_0x410490==='queue'||_0x410490===_0x45bb('0x43')?'queue':_0x45bb('0x41');if(_0x16f62d){_0x3c22e4['agentEmail']=_0x16f62d[_0x45bb('0x10')];}var _0x30a9a4=util[_0x45bb('0x23')](_0x45bb('0x44'),_0x1e76a3[_0x45bb('0x3e')],_0x4105e5[_0x45bb('0x45')],md5(_0x4105e5[_0x45bb('0x45')]));if(_0xa6fe5&&_0xa6fe5[_0x45bb('0x46')]){logger[_0x45bb('0xd')](_0x45bb('0x47'),_0x45bb('0x48'));_0x4105e5[_0x45bb('0x49')]=_0x30a9a4;}else if(_0x147877&&_0x147877[_0x45bb('0x4a')]&&_0x147877[_0x45bb('0x4a')]!==_0x45bb('0x4b')){logger[_0x45bb('0xd')](_0x45bb('0x4c'),'Recording\x20is\x20enabled!');_0x4105e5['recordingURL']=_0x30a9a4;}else{_0x4105e5[_0x45bb('0x49')]='';}return getAdminId(_0x3c22e4,_0x410490,_0x57cfe4,_0x3a347e)[_0x45bb('0xe')](getUser(_0x410490,_0x57cfe4,_0x3a347e))[_0x45bb('0xe')](getEndUser(_0x410490,_0x57cfe4,_0x3a347e))['then'](getTicket(_0x410490,_0x57cfe4,_0x3a347e,_0x58a76c,_0x4105e5))[_0x45bb('0xe')](function(_0x1abcb4){logger['info'](util['format'](_0x45bb('0x4d'),_0x1abcb4[_0x45bb('0x36')]));if(_0x410490!==_0x45bb('0x43')){logger[_0x45bb('0xd')]('['+[_0x410490['toUpperCase']()]+']',_0x45bb('0x4e'));emit(_0x3a347e,_0x16f62d['name'],_0x1abcb4[_0x45bb('0x28')]);}})['catch'](function(_0x4474d6){logger[_0x45bb('0x1f')]('['+[_0x410490['toUpperCase']()]+_0x45bb('0x4f'),util[_0x45bb('0x50')](_0x4474d6,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xc8d1=['Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','/api/tasks','getString','Subjects','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','then','Getting\x20user\x20with\x20email','agentEmail','email','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&entities=contact','find','contacts','format'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xc8d1,0x11f));var _0x1c8d=function(_0x11ee99,_0xa743ed){_0x11ee99=_0x11ee99-0x0;var _0x469072=_0xc8d1[_0x11ee99];return _0x469072;};'use strict';var _=require(_0x1c8d('0x0'));var rp=require('request-promise');var md5=require(_0x1c8d('0x1'));var util=require(_0x1c8d('0x2'));var moment=require(_0x1c8d('0x3'));var Promise=require(_0x1c8d('0x4'));var Redis=require('ioredis');var intUtil=require(_0x1c8d('0x5'));var config=require(_0x1c8d('0x6'));var logger=require(_0x1c8d('0x7'))('freshsales');config[_0x1c8d('0x8')]=_[_0x1c8d('0x9')](config[_0x1c8d('0x8')],{'host':_0x1c8d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1c8d('0x8')]));function getAdminId(_0x58db67,_0x2004ed,_0x6933c4,_0x4d0308){return new Promise(function(_0xffd704,_0x60ec0a){var _0x541962=![];var _0x57cb67={'method':_0x1c8d('0xb'),'uri':_0x4d0308+_0x1c8d('0xc'),'json':!![]};_0x57cb67[_0x1c8d('0xd')]=_0x6933c4;logger[_0x1c8d('0xe')](_0x1c8d('0xf'));return rp(_0x57cb67)['then'](function(_0x42d3b9){if(_0x42d3b9){var _0x32da8b=_0x42d3b9['users'];var _0xe7aaf6=null;for(_0xe7aaf6=0x0;_0xe7aaf6<_0x32da8b[_0x1c8d('0x10')];_0xe7aaf6++){if(_0x32da8b[_0xe7aaf6]['email']===_0x58db67[_0x1c8d('0x11')]){_0x58db67[_0x1c8d('0x12')]=_0x32da8b[_0xe7aaf6]['id'];_0x541962=!![];}}if(_0x541962){logger[_0x1c8d('0xe')](_0x1c8d('0x13'),_0x58db67[_0x1c8d('0x12')]);_0xffd704(_0x58db67);}else{_0x60ec0a({'statusCode':0x194,'message':_0x1c8d('0x14')});}}else{_0x60ec0a({'statusCode':0x194,'message':_0x1c8d('0x14')});}})[_0x1c8d('0x15')](function(_0x79e42){logger[_0x1c8d('0x16')]('['+[_0x2004ed[_0x1c8d('0x17')]()]+']',_0x79e42[_0x1c8d('0x18')]);_0x60ec0a(_0x79e42);});});}function getUser(_0x3ac010,_0x48a0f9,_0x1ed524){return function(_0x2dceb1){return new Promise(function(_0xb3ffe0,_0x61bab){var _0x13c1d8={'method':_0x1c8d('0xb'),'uri':_0x1ed524+_0x1c8d('0xc'),'json':!![]};_0x13c1d8[_0x1c8d('0xd')]=_0x48a0f9;logger[_0x1c8d('0xe')]('Getting\x20user\x20list');return rp(_0x13c1d8)[_0x1c8d('0x19')](function(_0x41d005){if(_0x41d005){var _0x400bdd=_0x41d005['users'];var _0x35b228=![];var _0x480d68=null;if(_0x2dceb1['agentEmail']!==null){logger['info'](_0x1c8d('0x1a'),_0x2dceb1[_0x1c8d('0x1b')]);_0x2dceb1['userEmail']=_0x2dceb1['agentEmail'];for(_0x480d68=0x0;_0x480d68<_0x400bdd[_0x1c8d('0x10')];_0x480d68++){if(_0x400bdd[_0x480d68][_0x1c8d('0x1c')]===_0x2dceb1[_0x1c8d('0x1b')]){_0x35b228=!![];_0x2dceb1[_0x1c8d('0x1d')]=_0x400bdd[_0x480d68]['id'];logger[_0x1c8d('0xe')](_0x1c8d('0x1e'),_0x2dceb1[_0x1c8d('0x1d')]);}}}if(!_0x35b228){logger['info'](_0x1c8d('0x1f'));_0x2dceb1['userEmail']=_0x2dceb1['adminEmail'];_0x2dceb1[_0x1c8d('0x1d')]=_0x2dceb1[_0x1c8d('0x12')];_0x35b228=!![];}if(_0x35b228){_0xb3ffe0(_0x2dceb1);}else{_0x61bab({'statusCode':0x194,'message':_0x1c8d('0x14')});}}else{_0x61bab({'statusCode':0x194,'message':_0x1c8d('0x14')});}})[_0x1c8d('0x15')](function(_0x2185e8){logger[_0x1c8d('0x16')]('['+[_0x3ac010[_0x1c8d('0x17')]()]+']',_0x2185e8[_0x1c8d('0x18')]);_0x61bab(_0x2185e8);});});};}function searchContact(_0x543b3a,_0x1804e4,_0xa5ba76,_0xcafe13){return new Promise(function(_0x127e14,_0x652e3f){var _0x1d44a0={'method':_0x1c8d('0xb'),'headers':_0x1804e4,'uri':_0x543b3a+_0x1c8d('0x20')+_0xcafe13+'&f='+_0xa5ba76+_0x1c8d('0x21'),'json':!![]};rp(_0x1d44a0)['then'](function(_0x13c933){var _0x98dd99=_[_0x1c8d('0x22')](_0x13c933[_0x1c8d('0x23')]['contacts'],[_0xa5ba76,_0xcafe13]);_0x127e14(_0x98dd99);})[_0x1c8d('0x15')](function(_0x47045b){_0x652e3f(_0x47045b);});});}function getEndUser(_0x3c97d3,_0x2b45a0,_0x42e830){return function(_0x83e3d7){return new Promise(function(_0x579a50,_0x5e446a){logger[_0x1c8d('0xe')](util[_0x1c8d('0x24')](_0x1c8d('0x25'),_0x83e3d7['contactNumber']));searchContact(_0x42e830,_0x2b45a0,_0x1c8d('0x26'),_0x83e3d7['contactNumber'])[_0x1c8d('0x19')](function(_0x92e3b3){if(_0x92e3b3){_0x83e3d7[_0x1c8d('0x27')]=_0x92e3b3['id'];logger[_0x1c8d('0xe')](_0x1c8d('0x28'),_0x83e3d7[_0x1c8d('0x27')]);return _0x579a50(_0x83e3d7);}searchContact(_0x42e830,_0x2b45a0,_0x1c8d('0x29'),_0x83e3d7[_0x1c8d('0x2a')])[_0x1c8d('0x19')](function(_0xb137ed){if(_0xb137ed){_0x83e3d7[_0x1c8d('0x27')]=_0xb137ed['id'];logger[_0x1c8d('0xe')](_0x1c8d('0x2b'),_0x83e3d7[_0x1c8d('0x27')]);return _0x579a50(_0x83e3d7);}createEndUser(_0x83e3d7,_0x3c97d3,_0x2b45a0,_0x42e830)['then'](function(_0xc6690a){logger[_0x1c8d('0xe')](_0x1c8d('0x2c'),_0xc6690a[_0x1c8d('0x27')]);return _0x579a50(_0xc6690a);});});})['catch'](function(_0x81b0c5){_0x5e446a(_0x81b0c5);});});};}function createEndUser(_0x4954c1,_0x203c3a,_0xb1c0c4,_0x433409){return new Promise(function(_0x32dd93,_0x3fd130){var _0x5906b2=moment();var _0x3b7f18={'method':_0x1c8d('0x2d'),'uri':_0x433409+_0x1c8d('0x2e'),'body':{'contact':{'last_name':_0x4954c1[_0x1c8d('0x2a')],'work_number':_0x4954c1[_0x1c8d('0x2a')],'mobile_number':_0x4954c1[_0x1c8d('0x2a')],'owner_id':_0x4954c1[_0x1c8d('0x1d')],'created_at':_0x5906b2['format'](_0x1c8d('0x2f'))}},'json':!![]};_0x3b7f18[_0x1c8d('0xd')]=_0xb1c0c4;logger[_0x1c8d('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3b7f18)[_0x1c8d('0x19')](function(_0x23dc58){_0x4954c1['endUserId']=_0x23dc58['contact']['id'];_0x32dd93(_0x4954c1);})['catch'](function(_0x30536e){logger[_0x1c8d('0x16')]('['+[_0x203c3a[_0x1c8d('0x17')]()]+']',_0x30536e[_0x1c8d('0x18')]);_0x3fd130(_0x30536e[_0x1c8d('0x18')]);});});}function getTicket(_0x4cd0d2,_0x38c652,_0x333f4f,_0x434caf,_0x1c79b4){return function(_0x1216e9){logger[_0x1c8d('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x5e0d53,_0x23e2cf){var _0x5ecc85=moment();var _0x4381ab={'method':_0x1c8d('0x2d'),'uri':_0x333f4f+_0x1c8d('0x30'),'body':{'title':intUtil[_0x1c8d('0x31')](_0x434caf[_0x1c8d('0x32')],_0x1c79b4,'\x20'),'description':intUtil[_0x1c8d('0x31')](_0x434caf['Descriptions'],_0x1c79b4,'\x0a'),'owner_id':_0x1216e9[_0x1c8d('0x1d')],'creater_id':_0x1216e9[_0x1c8d('0x12')],'targetable_id':_0x1216e9['endUserId'],'targetable_type':'Contact','created_at':_0x5ecc85[_0x1c8d('0x24')](_0x1c8d('0x2f')),'due_date':_0x5ecc85[_0x1c8d('0x33')](0x1e,'m')[_0x1c8d('0x24')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x4381ab[_0x1c8d('0xd')]=_0x38c652;return rp(_0x4381ab)['then'](function(_0x2bcbdc){_0x1216e9[_0x1c8d('0x34')]=_0x2bcbdc[_0x1c8d('0x35')]['id'];logger[_0x1c8d('0xe')](_0x1c8d('0x36'),_0x1216e9[_0x1c8d('0x34')]);_0x5e0d53(_0x1216e9);})[_0x1c8d('0x15')](function(_0x10cc58){logger[_0x1c8d('0x16')]('['+[_0x4cd0d2['toUpperCase']()]+']',_0x10cc58[_0x1c8d('0x18')]);_0x23e2cf(_0x10cc58[_0x1c8d('0x18')]);});});};}function emit(_0x39c66a,_0x361c1c,_0x36daa3){var _0xa23d6e={'uri':_0x39c66a+_0x1c8d('0x37')+_0x36daa3};io['to'](util[_0x1c8d('0x24')](_0x1c8d('0x38'),_0x361c1c))['emit'](_0x1c8d('0x39'),_0xa23d6e);}exports['cs']=function(_0x167283,_0x39b89,_0x1d954c,_0xcea3d4,_0x5e7147,_0x3a2ccd,_0x181e4a,_0x428ff2){var _0x5487ea={};var _0x5afc24={'Authorization':_0x1c8d('0x3a')+_0x3a2ccd[_0x1c8d('0x3b')]};_0x3a2ccd[_0x1c8d('0x3c')]=intUtil[_0x1c8d('0x3d')](_0x3a2ccd[_0x1c8d('0x3c')]);_0x3a2ccd['serverUrl']=intUtil[_0x1c8d('0x3d')](_0x3a2ccd[_0x1c8d('0x3e')]);var _0x27e1ce=_0x3a2ccd[_0x1c8d('0x3c')];_0x5487ea['adminEmail']=_0x3a2ccd[_0x1c8d('0x3f')];_0x5487ea[_0x1c8d('0x2a')]=_0x428ff2['toLowerCase']()===_0x1c8d('0x40')?_0x39b89[_0x1c8d('0x41')]:_0x39b89[_0x1c8d('0x42')];_0x5487ea[_0x1c8d('0x43')]=_0x428ff2==='queue'||_0x428ff2==='unmanaged'?'queue':'outbound';if(_0xcea3d4){_0x5487ea[_0x1c8d('0x1b')]=_0xcea3d4[_0x1c8d('0x1c')];}var _0x34e406=util['format'](_0x1c8d('0x44'),_0x3a2ccd['serverUrl'],_0x39b89[_0x1c8d('0x45')],md5(_0x39b89[_0x1c8d('0x45')]));if(_0x5e7147&&_0x5e7147[_0x1c8d('0x46')]){logger['info'](_0x1c8d('0x47'),'Recording\x20is\x20enabled!');_0x39b89['recordingURL']=_0x34e406;}else if(_0x181e4a&&_0x181e4a['recordingFormat']&&_0x181e4a['recordingFormat']!==_0x1c8d('0x48')){logger['info'](_0x1c8d('0x49'),_0x1c8d('0x4a'));_0x39b89['recordingURL']=_0x34e406;}else{_0x39b89['recordingURL']='';}return getAdminId(_0x5487ea,_0x428ff2,_0x5afc24,_0x27e1ce)[_0x1c8d('0x19')](getUser(_0x428ff2,_0x5afc24,_0x27e1ce))['then'](getEndUser(_0x428ff2,_0x5afc24,_0x27e1ce))[_0x1c8d('0x19')](getTicket(_0x428ff2,_0x5afc24,_0x27e1ce,_0x1d954c,_0x39b89))[_0x1c8d('0x19')](function(_0x363c64){logger[_0x1c8d('0xe')](util['format'](_0x1c8d('0x4b'),_0x363c64[_0x1c8d('0x34')]));if(_0x428ff2!==_0x1c8d('0x4c')){logger['info']('['+[_0x428ff2[_0x1c8d('0x17')]()]+']',_0x1c8d('0x4d'));emit(_0x27e1ce,_0xcea3d4[_0x1c8d('0x4e')],_0x363c64['endUserId']);}})[_0x1c8d('0x15')](function(_0x5b2bfe){logger[_0x1c8d('0x16')]('['+[_0x428ff2[_0x1c8d('0x17')]()]+_0x1c8d('0x4f'),util[_0x1c8d('0x50')](_0x5b2bfe,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index f155635..eebabb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x825d=['./sugarcrm','./desk','./dynamics365','./freshsales','zendesk','sugarcrm','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','zoho','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./zendesk'];(function(_0x4bc573,_0x53f84f){var _0x1b322a=function(_0xaba30){while(--_0xaba30){_0x4bc573['push'](_0x4bc573['shift']());}};_0x1b322a(++_0x53f84f);}(_0x825d,0xca));var _0xd825=function(_0x5f5b7a,_0x4418ed){_0x5f5b7a=_0x5f5b7a-0x0;var _0x1eb4c7=_0x825d[_0x5f5b7a];return _0x1eb4c7;};'use strict';var _=require('lodash');var util=require(_0xd825('0x0'));var zendesk=require(_0xd825('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0xd825('0x2'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0xd825('0x3'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xd825('0x4'));var freshsales=require(_0xd825('0x5'));var integrations=[_0xd825('0x6'),'salesforce',_0xd825('0x7'),'freshdesk','zoho',_0xd825('0x8'),_0xd825('0x9'),_0xd825('0xa'),'freshsales',_0xd825('0xb')];exports[_0xd825('0xc')]=function(_0x379a47,_0x582a11,_0x39a7e4,_0x4bd8f2,_0x119820,_0x594b71){if(_0x39a7e4){if(_[_0xd825('0xd')](integrations,_0x379a47[_0xd825('0xe')][_0xd825('0xf')]())){try{var _0x24b5af=null;var _0x1e4432='';var _0x5e2d1a=_0x39a7e4[_0x379a47[_0xd825('0xe')][_0xd825('0xf')]()];if(_0x5e2d1a){var _0x410da5=_0x5e2d1a[_0x379a47[_0xd825('0x10')]];if(_0x410da5){var _0x32a3c8=_[_0xd825('0x11')](_0x410da5['Configurations'],{'id':parseInt(_0x379a47[_0xd825('0x12')],0xa)});if(_0x32a3c8){if(_0x4bd8f2){if(_0x119820&&_0x582a11[_0xd825('0x13')]){_0x1e4432='queue';}else if(_0x582a11[_0xd825('0x14')]){_0x1e4432=_0xd825('0x15');}else{console[_0xd825('0x16')](_0xd825('0x17'),_0x582a11);}}else{_0x1e4432=_0xd825('0x18');}switch(_0x379a47[_0xd825('0xe')][_0xd825('0xf')]()){case'zendesk':zendesk[_0x1e4432](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71);break;case _0xd825('0x19'):salesforce[_0x1e4432](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71);break;case'sugarcrm':sugarcrm[_0x1e4432](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71);break;case'freshdesk':freshdesk[_0x1e4432](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71);break;case _0xd825('0x1a'):zoho[_0x1e4432](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71);break;case'desk':desk[_0x1e4432](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71);break;case _0xd825('0x9'):vtiger[_0x1e4432](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71);break;case'freshsales':freshsales['cs'](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71,_0x1e4432);break;case _0xd825('0xb'):servicenow['cs'](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71,_0x1e4432);break;case _0xd825('0xa'):dynamics365['cs'](_0x379a47,_0x582a11,_0x32a3c8,_0x4bd8f2,_0x119820,_0x410da5,_0x594b71,_0x1e4432);break;default:console['log'](_0xd825('0x1b'));}}else{_0x24b5af=require('../../../../config/logger')(_0x379a47[_0xd825('0xe')][_0xd825('0xf')]());_0x24b5af[_0xd825('0x1c')](_0xd825('0x1d'),util[_0xd825('0x1e')](_0xd825('0x1f'),_0x379a47[_0xd825('0xe')][_0xd825('0xf')](),_0x379a47[_0xd825('0x12')]));}}else{_0x24b5af=require(_0xd825('0x20'))(_0x379a47[_0xd825('0xe')][_0xd825('0xf')]());_0x24b5af['error'](_0xd825('0x1d'),util[_0xd825('0x1e')](_0xd825('0x21'),_0x379a47[_0xd825('0xe')][_0xd825('0xf')](),_0x379a47[_0xd825('0x10')]));}}else{}}catch(_0x4d40f0){console['error'](_0x4d40f0);}}}};
\ No newline at end of file
+var _0x90e6=['./zoho','./desk','./vtiger','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','zoho','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x90e6,0xe3));var _0x690e=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x90e6[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x690e('0x0'));var util=require(_0x690e('0x1'));var zendesk=require(_0x690e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x690e('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x690e('0x4'));var desk=require(_0x690e('0x5'));var vtiger=require(_0x690e('0x6'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x690e('0x7'));var integrations=[_0x690e('0x8'),_0x690e('0x9'),_0x690e('0xa'),_0x690e('0xb'),'zoho',_0x690e('0xc'),_0x690e('0xd'),_0x690e('0xe'),_0x690e('0xf'),_0x690e('0x10')];exports[_0x690e('0x11')]=function(_0x4c7da0,_0x12af70,_0x5416a5,_0x35e5f9,_0x3a06a1,_0x55a39a){if(_0x5416a5){if(_['includes'](integrations,_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')]())){try{var _0x19ff34=null;var _0xc37e0='';var _0x1e9f75=_0x5416a5[_0x4c7da0[_0x690e('0x12')]['toLowerCase']()];if(_0x1e9f75){var _0x4978db=_0x1e9f75[_0x4c7da0[_0x690e('0x14')]];if(_0x4978db){var _0x54f238=_[_0x690e('0x15')](_0x4978db['Configurations'],{'id':parseInt(_0x4c7da0['data3'],0xa)});if(_0x54f238){if(_0x35e5f9){if(_0x3a06a1&&_0x12af70[_0x690e('0x16')]){_0xc37e0='queue';}else if(_0x12af70['routeId']){_0xc37e0=_0x690e('0x17');}else{console[_0x690e('0x18')](_0x690e('0x19'),_0x12af70);}}else{_0xc37e0=_0x690e('0x1a');}switch(_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')]()){case _0x690e('0x8'):zendesk[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0x9'):salesforce[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xa'):sugarcrm[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xb'):freshdesk[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0x1b'):zoho[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xc'):desk[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xd'):vtiger[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xf'):freshsales['cs'](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a,_0xc37e0);break;case _0x690e('0x10'):servicenow['cs'](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a,_0xc37e0);break;case _0x690e('0xe'):dynamics365['cs'](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a,_0xc37e0);break;default:console[_0x690e('0x18')](_0x690e('0x1c'));}}else{_0x19ff34=require('../../../../config/logger')(_0x4c7da0['data1']['toLowerCase']());_0x19ff34[_0x690e('0x1d')]('[EXEC]',util[_0x690e('0x1e')](_0x690e('0x1f'),_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')](),_0x4c7da0['data3']));}}else{_0x19ff34=require('../../../../config/logger')(_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')]());_0x19ff34[_0x690e('0x1d')]('[EXEC]',util[_0x690e('0x1e')](_0x690e('0x20'),_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')](),_0x4c7da0[_0x690e('0x14')]));}}else{}}catch(_0x187047){console['error'](_0x187047);}}}};
\ No newline at end of file
index cf8cf9a..e4546d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c88=['LastName','<unknown>','format','Company','No\x20Company','Caller\x20-\x20%s','forEach','includes','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','remoteUri','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','defaults','redis','localhost','socket.io-emitter','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','account','WhatId','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','then','length','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','cloneDeep','$or','Contact','additionalSearchLead','additionalSearchAccount','merge','Account','execute','additionalSearchContact','Lead','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0x3c88,0x12a));var _0x83c8=function(_0x152f26,_0x507035){_0x152f26=_0x152f26-0x0;var _0x31a05d=_0x3c88[_0x152f26];return _0x31a05d;};'use strict';var _=require('lodash');var rp=require(_0x83c8('0x0'));var moment=require(_0x83c8('0x1'));var BPromise=require(_0x83c8('0x2'));var md5=require(_0x83c8('0x3'));var jsforce=require(_0x83c8('0x4'));var util=require(_0x83c8('0x5'));var Redis=require(_0x83c8('0x6'));var intUtil=require(_0x83c8('0x7'));var config=require(_0x83c8('0x8'));var logger=require('../../../../config/logger')(_0x83c8('0x9'));config['redis']=_[_0x83c8('0xa')](config[_0x83c8('0xb')],{'host':_0x83c8('0xc'),'port':0x18eb});var io=require(_0x83c8('0xd'))(new Redis(config[_0x83c8('0xb')]));function emit(_0x28ac18,_0x1a7a8c,_0x54b7bf){io['to'](_0x28ac18)['emit'](_0x1a7a8c,_0x54b7bf);}function getTicket(_0x52e7f3,_0x19c569,_0x2db7b0,_0x4a60cf,_0x5068d1,_0x201e38,_0x157ce6,_0x20f50c){var _0x25d9f9=Object['assign']({},{'OwnerId':_0x19c569['id'],'Subject':intUtil[_0x83c8('0xe')](_0x4a60cf[_0x83c8('0xf')],_0x5068d1,'\x20'),'Description':intUtil[_0x83c8('0xe')](_0x4a60cf[_0x83c8('0x10')],_0x5068d1,'\x0a')},getCustomFields(_0x201e38,_0x5068d1));if(_0x2db7b0){if(_0x4a60cf[_0x83c8('0x11')]===_0x83c8('0x12')){_0x25d9f9[_0x83c8('0x13')]=moment[_0x83c8('0x14')]();_0x25d9f9[_0x83c8('0x15')]=![];_0x25d9f9[_0x83c8('0x16')]=![];if(_0x2db7b0[_0x83c8('0x17')]===_0x83c8('0x18')||_0x2db7b0[_0x83c8('0x17')]==='lead'){_0x25d9f9['WhoId']=_0x2db7b0['id'];}else if(_0x2db7b0[_0x83c8('0x17')]===_0x83c8('0x19')){_0x25d9f9[_0x83c8('0x1a')]=_0x2db7b0['id'];}}else if(_0x4a60cf[_0x83c8('0x11')]==='Case'){if(_0x2db7b0[_0x83c8('0x17')]==='contact'){_0x25d9f9[_0x83c8('0x1b')]=_0x2db7b0['id'];}else if(_0x2db7b0['endUserType']===_0x83c8('0x19')){_0x25d9f9[_0x83c8('0x1c')]=_0x2db7b0['id'];}else if(_0x2db7b0[_0x83c8('0x17')]===_0x83c8('0x1d')&&_0x4a60cf[_0x83c8('0x1e')]){_0x25d9f9[_0x4a60cf[_0x83c8('0x1e')]]=_0x2db7b0['id'];}else{logger[_0x83c8('0x1f')](_0x83c8('0x20'));}}}return _0x157ce6[_0x83c8('0x21')](_0x4a60cf[_0x83c8('0x11')])[_0x83c8('0x22')](_0x25d9f9);}function getUser(_0x1ea069,_0x50f666,_0x387548){if(!_[_0x83c8('0x23')](_0x50f666)&&intUtil[_0x83c8('0x24')](_0x50f666)){var _0x31f7d3={'Email':_0x50f666};var _0x5d1f10={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x387548[_0x83c8('0x21')]('User')[_0x83c8('0x25')](_0x31f7d3,_0x5d1f10)['execute']()[_0x83c8('0x26')](function(_0x59b84c){if(_0x59b84c[_0x83c8('0x27')]){var _0xb7805a=_[_0x83c8('0x25')](_0x59b84c,function(_0x3e5142){return _0x3e5142['Email']===_0x50f666;});if(_0xb7805a){logger['info']('Agent\x20%s\x20found.',_0x50f666);return BPromise[_0x83c8('0x28')]({'id':_0xb7805a['Id'],'name':_0xb7805a[_0x83c8('0x29')]});}}else{logger[_0x83c8('0x1f')](_0x83c8('0x2a'),_0x50f666);return _0x387548[_0x83c8('0x2b')]()[_0x83c8('0x26')](function(_0x187c20){return BPromise[_0x83c8('0x28')]({'id':_0x187c20[_0x83c8('0x2c')],'name':_0x187c20[_0x83c8('0x2d')]});});}});}else{logger[_0x83c8('0x1f')](_0x83c8('0x2a'),_0x50f666);return _0x387548[_0x83c8('0x2b')]()[_0x83c8('0x26')](function(_0x29aa49){return BPromise['resolve']({'id':_0x29aa49['user_id'],'name':_0x29aa49[_0x83c8('0x2d')]});});}}function getEndUser(_0x5c1d0c,_0x59c36b,_0x2b432b,_0x1bf44a,_0x1f917e){var _0x3afc70={'$or':{'Phone':_0x1bf44a}};var _0x52b106={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x83c8('0x28')]()[_0x83c8('0x26')](function(){logger[_0x83c8('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x1bf44a,_0x59c36b[_0x83c8('0x2e')]);switch(_0x59c36b[_0x83c8('0x2e')]){case'contact_lead':var _0x2afc9b=_[_0x83c8('0x2f')](_0x3afc70);if(_0x59c36b['additionalSearchContact']){var _0x190681={};_0x190681[_0x59c36b['additionalSearchContact']]=_0x1bf44a;_['merge'](_0x2afc9b[_0x83c8('0x30')],_0x190681);}return _0x1f917e[_0x83c8('0x21')](_0x83c8('0x31'))[_0x83c8('0x25')](_0x2afc9b,_0x52b106)['execute']()[_0x83c8('0x26')](function(_0x423bf8){if(_0x423bf8&&_0x423bf8[_0x83c8('0x27')]){return _0x423bf8;}else{var _0x1e20a0=_[_0x83c8('0x2f')](_0x3afc70);if(_0x59c36b[_0x83c8('0x32')]){var _0x3766c5={};_0x3766c5[_0x59c36b[_0x83c8('0x32')]]=_0x1bf44a;_['merge'](_0x1e20a0[_0x83c8('0x30')],_0x3766c5);}return _0x1f917e[_0x83c8('0x21')]('Lead')[_0x83c8('0x25')](_0x1e20a0,_0x52b106);}});case'account_contact_lead':var _0xe8b530=_[_0x83c8('0x2f')](_0x3afc70);if(_0x59c36b[_0x83c8('0x33')]){var _0x190681={};_0x190681[_0x59c36b['additionalSearchAccount']]=_0x1bf44a;_[_0x83c8('0x34')](_0xe8b530[_0x83c8('0x30')],_0x190681);}return _0x1f917e[_0x83c8('0x21')](_0x83c8('0x35'))[_0x83c8('0x25')](_0xe8b530,_0x52b106)[_0x83c8('0x36')]()[_0x83c8('0x26')](function(_0x3ae406){if(_0x3ae406&&_0x3ae406[_0x83c8('0x27')]){return _0x3ae406;}else{var _0x574f39=_[_0x83c8('0x2f')](_0x3afc70);if(_0x59c36b['additionalSearchContact']){var _0x565818={};_0x565818[_0x59c36b[_0x83c8('0x37')]]=_0x1bf44a;_['merge'](_0x574f39[_0x83c8('0x30')],_0x565818);}return _0x1f917e[_0x83c8('0x21')](_0x83c8('0x31'))[_0x83c8('0x25')](_0x574f39,_0x52b106)[_0x83c8('0x26')](function(_0x17bb06){if(_0x17bb06&&_0x17bb06[_0x83c8('0x27')]){return _0x17bb06;}else{var _0x361a6f=_[_0x83c8('0x2f')](_0x3afc70);if(_0x59c36b[_0x83c8('0x32')]){var _0x53c93b={};_0x53c93b[_0x59c36b['additionalSearchLead']]=_0x1bf44a;_[_0x83c8('0x34')](_0x361a6f[_0x83c8('0x30')],_0x53c93b);}return _0x1f917e[_0x83c8('0x21')](_0x83c8('0x38'))[_0x83c8('0x25')](_0x361a6f,_0x52b106);}});}});case'contact':var _0x2afc9b=_['cloneDeep'](_0x3afc70);if(_0x59c36b[_0x83c8('0x37')]){var _0x190681={};_0x190681[_0x59c36b[_0x83c8('0x37')]]=_0x1bf44a;_[_0x83c8('0x34')](_0x2afc9b['$or'],_0x190681);}return _0x1f917e['sobject'](_0x83c8('0x31'))[_0x83c8('0x25')](_0x2afc9b,_0x52b106)[_0x83c8('0x36')]();case _0x83c8('0x1d'):var _0x47672d=_[_0x83c8('0x2f')](_0x3afc70);if(_0x59c36b[_0x83c8('0x32')]){var _0x190681={};_0x190681[_0x59c36b['additionalSearchLead']]=_0x1bf44a;_[_0x83c8('0x34')](_0x47672d['$or'],_0x190681);}return _0x1f917e[_0x83c8('0x21')](_0x83c8('0x38'))[_0x83c8('0x25')](_0x47672d,_0x52b106);case _0x83c8('0x19'):var _0xe8b530=_['cloneDeep'](_0x3afc70);if(_0x59c36b[_0x83c8('0x33')]){var _0x190681={};_0x190681[_0x59c36b['additionalSearchAccount']]=_0x1bf44a;_['merge'](_0xe8b530[_0x83c8('0x30')],_0x190681);}return _0x1f917e['sobject'](_0x83c8('0x35'))[_0x83c8('0x25')](_0xe8b530,_0x52b106);default:return null;}})[_0x83c8('0x26')](function(_0xf73617){if(_0xf73617&&_0xf73617[_0x83c8('0x27')]){var _0x1cf489=_[_0x83c8('0x39')](_0xf73617);if(_0x1cf489){return BPromise[_0x83c8('0x28')]({'id':_0x1cf489['Id'],'name':_0x1cf489[_0x83c8('0x29')],'phone':_0x1cf489[_0x83c8('0x3a')],'endUserType':_0x1cf489['attributes'][_0x83c8('0x3b')][_0x83c8('0x3c')]()});}}})[_0x83c8('0x26')](function(_0x1ff865){if(_0x1ff865){logger[_0x83c8('0x1f')](_0x83c8('0x3d'),_0x1ff865[_0x83c8('0x17')],_0x1bf44a);return BPromise[_0x83c8('0x28')](_0x1ff865);}else{logger['info'](_0x83c8('0x3e'),_0x1bf44a);var _0x56af88={'Phone':_0x1bf44a};if(_0x59c36b['moduleCreate']){if(_0x59c36b[_0x83c8('0x3f')]===_0x83c8('0x18')){logger[_0x83c8('0x1f')](_0x83c8('0x40'),_0x1bf44a,_0x59c36b[_0x83c8('0x3f')]);_0x56af88[_0x83c8('0x41')]=_0x2b432b!==_0x83c8('0x42')?_0x2b432b:util[_0x83c8('0x43')]('Caller\x20-\x20%s',_0x1bf44a);}else if(_0x59c36b[_0x83c8('0x3f')]===_0x83c8('0x1d')){logger[_0x83c8('0x1f')](_0x83c8('0x40'),_0x1bf44a,_0x59c36b['moduleCreate']);_0x56af88[_0x83c8('0x41')]=_0x2b432b!==_0x83c8('0x42')?_0x2b432b:util['format']('Caller\x20-\x20%s',_0x1bf44a);_0x56af88[_0x83c8('0x44')]=_0x83c8('0x45');}else if(_0x59c36b[_0x83c8('0x3f')]==='account'){logger['info'](_0x83c8('0x40'),_0x1bf44a,_0x59c36b['moduleCreate']);_0x56af88['Name']=_0x2b432b!==_0x83c8('0x42')?_0x2b432b:util[_0x83c8('0x43')](_0x83c8('0x46'),_0x1bf44a);}else{return null;}}return _0x1f917e[_0x83c8('0x21')](_['upperFirst'](_0x59c36b['moduleCreate']))[_0x83c8('0x22')](_0x56af88)[_0x83c8('0x26')](function(_0x8bf5ac){return BPromise[_0x83c8('0x28')]({'id':_0x8bf5ac['id'],'endUserType':_0x59c36b['moduleCreate']});});}});}function getCustomFields(_0x48ff8a,_0x435e80){var _0x1d2d2c={};if(_0x48ff8a[_0x83c8('0x27')]>0x0){_[_0x83c8('0x47')](_0x48ff8a,function(_0x17be43){if(_[_0x83c8('0x48')](['string',_0x83c8('0x49')],_0x17be43[_0x83c8('0x3b')])&&_0x17be43[_0x83c8('0x4a')]){_0x1d2d2c[_0x17be43[_0x83c8('0x4a')]]=_0x17be43[_0x83c8('0x4b')][_0x83c8('0x4c')]();}else if(_0x17be43['type']===_0x83c8('0x4d')&&_0x17be43[_0x83c8('0x4e')]&&_0x17be43[_0x83c8('0x4a')]){_0x435e80[_0x17be43['variableName']]&&(_0x1d2d2c[_0x17be43[_0x83c8('0x4a')]]=_0x435e80[_0x17be43[_0x83c8('0x4e')]]['toString']());}else if(_0x17be43[_0x83c8('0x3b')]===_0x83c8('0x4f')&&_0x17be43[_0x83c8('0x50')]&&_0x17be43[_0x83c8('0x50')][_0x83c8('0x51')]&&_0x17be43['idField']){_0x435e80[_0x17be43[_0x83c8('0x50')][_0x83c8('0x51')][_0x83c8('0x3c')]()]&&(_0x1d2d2c[_0x17be43[_0x83c8('0x4a')]]=_0x435e80[_0x17be43[_0x83c8('0x50')]['name'][_0x83c8('0x3c')]()][_0x83c8('0x4c')]());}});}return _0x1d2d2c;}function getConnection(_0x559a74){var _0x1b87af=_0x559a74['password'][_0x83c8('0x52')](_0x559a74['securityToken']);var _0x2fd688=new jsforce['Connection']({'oauth2':{'loginUrl':_0x559a74[_0x83c8('0x53')]||'https://login.salesforce.com','clientId':_0x559a74['clientId'],'clientSecret':_0x559a74['clientSecret']}});return _0x2fd688['login'](_0x559a74['username'],_0x1b87af)['then'](function(){logger['info']('Connection\x20established.');return _0x2fd688;});}exports[_0x83c8('0x54')]=function(_0xa0507a,_0x12042d,_0x11de80,_0x56d55e,_0x377e2d,_0x14570a){var _0x38b479,_0x282b67,_0xe41623,_0x346777;_0x14570a[_0x83c8('0x55')]=intUtil[_0x83c8('0x56')](_0x14570a['serverUrl']);_0x14570a[_0x83c8('0x53')]=intUtil[_0x83c8('0x56')](_0x14570a['remoteUri']);if(_0x377e2d&&_0x377e2d[_0x83c8('0x57')]){logger['info'](_0x83c8('0x58'),_0x83c8('0x59'));_0x12042d[_0x83c8('0x5a')]=util[_0x83c8('0x43')](_0x83c8('0x5b'),_0x14570a[_0x83c8('0x55')],_0x12042d['uniqueid'],md5(_0x12042d[_0x83c8('0x5c')]));}else{_0x12042d[_0x83c8('0x5a')]='';}return getConnection(_0x14570a)['then'](function(_0x22a9e1){_0x346777=_0x22a9e1;return getUser(_0x14570a,_0x56d55e[_0x83c8('0x5d')],_0x346777);})[_0x83c8('0x26')](function(_0x33ce88){_0x38b479=_0x33ce88;return getEndUser(_0x14570a,_0x11de80,_0x12042d[_0x83c8('0x5e')],_0x12042d[_0x83c8('0x5f')],_0x346777);})['then'](function(_0xad4e77){_0x282b67=_0xad4e77;return getTicket(_0x14570a,_0x38b479,_0x282b67,_0x11de80,_0x12042d,_0x11de80[_0x83c8('0x60')],_0x346777,_0x83c8('0x54'));})[_0x83c8('0x26')](function(_0x55ab14){_0xe41623=_0x55ab14;logger[_0x83c8('0x1f')](_0x83c8('0x61'),_0xe41623['id']);logger[_0x83c8('0x1f')](_0x83c8('0x62'),_0xe41623['id'],_0x56d55e[_0x83c8('0x51')],_0x14570a[_0x83c8('0x3b')]);switch(_0x14570a[_0x83c8('0x3b')]){case _0x83c8('0x63'):emit(util[_0x83c8('0x43')]('user:%s',_0x56d55e[_0x83c8('0x51')]),_0x83c8('0x64'),{'recordId':_0xe41623['id']});break;case _0x83c8('0x65'):emit(util[_0x83c8('0x43')](_0x83c8('0x66'),_0x56d55e[_0x83c8('0x51')]),'trigger:browser:url',{'uri':util[_0x83c8('0x43')](_0x83c8('0x67'),_0x346777[_0x83c8('0x68')],_0xe41623['id'])});break;default:logger[_0x83c8('0x69')](_0x83c8('0x6a'));}})[_0x83c8('0x6b')](function(_0x1d4894){logger[_0x83c8('0x69')](_0x83c8('0x58'),_0x1d4894);});};exports[_0x83c8('0x6c')]=function(_0x546301,_0x5930a3,_0x2382d5,_0xcb5556,_0x372803,_0x4a86ce,_0x3dcccd){var _0xceedfd,_0x3dd0f6,_0x2df7d5,_0x230c6f;_0x4a86ce[_0x83c8('0x55')]=intUtil[_0x83c8('0x56')](_0x4a86ce[_0x83c8('0x55')]);_0x4a86ce['remoteUri']=intUtil['stripTrailingSlash'](_0x4a86ce['remoteUri']);if(_0x3dcccd&&_0x3dcccd[_0x83c8('0x6d')]&&_0x3dcccd[_0x83c8('0x6d')]!==_0x83c8('0x6e')){logger[_0x83c8('0x1f')](_0x83c8('0x6f'),_0x83c8('0x59'));_0x5930a3[_0x83c8('0x5a')]=util[_0x83c8('0x43')](_0x83c8('0x5b'),_0x4a86ce[_0x83c8('0x55')],_0x5930a3['uniqueid'],md5(_0x5930a3['uniqueid']));}return getConnection(_0x4a86ce)[_0x83c8('0x26')](function(_0x32d39d){_0x230c6f=_0x32d39d;return getUser(_0x4a86ce,_0xcb5556[_0x83c8('0x5d')],_0x230c6f);})[_0x83c8('0x26')](function(_0x38c67d){_0xceedfd=_0x38c67d;return getEndUser(_0x4a86ce,_0x2382d5,_0x5930a3[_0x83c8('0x70')],_0x5930a3[_0x83c8('0x71')],_0x230c6f);})[_0x83c8('0x26')](function(_0xaf581e){_0x3dd0f6=_0xaf581e;return getTicket(_0x4a86ce,_0xceedfd,_0x3dd0f6,_0x2382d5,_0x5930a3,_0x2382d5[_0x83c8('0x60')],_0x230c6f,_0x83c8('0x6c'));})[_0x83c8('0x26')](function(_0x5b9094){_0x2df7d5=_0x5b9094;logger['info'](_0x83c8('0x72'),_0x2df7d5['id']);logger[_0x83c8('0x1f')](_0x83c8('0x73'),_0x2df7d5['id'],_0xcb5556[_0x83c8('0x51')],_0x4a86ce['type']);switch(_0x4a86ce[_0x83c8('0x3b')]){case _0x83c8('0x63'):emit(util[_0x83c8('0x43')](_0x83c8('0x66'),_0xcb5556[_0x83c8('0x51')]),_0x83c8('0x64'),{'recordId':_0x2df7d5['id']});break;case'newTab':emit(util[_0x83c8('0x43')](_0x83c8('0x66'),_0xcb5556[_0x83c8('0x51')]),'trigger:browser:url',{'uri':util['format'](_0x83c8('0x67'),_0x230c6f[_0x83c8('0x68')],_0x2df7d5['id'])});break;default:logger[_0x83c8('0x69')]('[OUTBOUND]',_0x83c8('0x74'));}})['catch'](function(_0x51ce63){logger['error'](_0x83c8('0x6f'),_0x51ce63);});};exports[_0x83c8('0x75')]=function(_0x1018da,_0xe2ae8c,_0x10534e,_0x40483b,_0x91c168,_0x43f22e){var _0x4f5cc6,_0x47caa6,_0x45e2cb,_0x1ab4ce;_0x43f22e['serverUrl']=intUtil['stripTrailingSlash'](_0x43f22e[_0x83c8('0x55')]);_0x43f22e['remoteUri']=intUtil[_0x83c8('0x56')](_0x43f22e[_0x83c8('0x53')]);if(_0x91c168&&_0x91c168[_0x83c8('0x57')]){logger[_0x83c8('0x1f')]('['+_0xe2ae8c['lastevent'][_0x83c8('0x76')]()+']',_0x83c8('0x59'));_0xe2ae8c[_0x83c8('0x5a')]=util[_0x83c8('0x43')](_0x83c8('0x5b'),_0x43f22e['serverUrl'],_0xe2ae8c[_0x83c8('0x5c')],md5(_0xe2ae8c[_0x83c8('0x5c')]));}else{_0xe2ae8c['recordingURL']='';}return getConnection(_0x43f22e)['then'](function(_0x18309e){_0x1ab4ce=_0x18309e;if(!_[_0x83c8('0x23')](_0x40483b)){return getUser(_0x43f22e,_0x40483b['name'],_0x1ab4ce);}else{return getUser(_0x43f22e,null,_0x1ab4ce);}})[_0x83c8('0x26')](function(_0x2946fd){_0x4f5cc6=_0x2946fd;return getEndUser(_0x43f22e,_0x10534e,_0xe2ae8c[_0x83c8('0x5e')],_0xe2ae8c[_0x83c8('0x5f')],_0x1ab4ce);})[_0x83c8('0x26')](function(_0x5b240){_0x47caa6=_0x5b240;return getTicket(_0x43f22e,_0x4f5cc6,_0x47caa6,_0x10534e,_0xe2ae8c,_0x10534e['Fields'],_0x1ab4ce);})[_0x83c8('0x26')](function(_0x2950ff){_0x45e2cb=_0x2950ff;logger[_0x83c8('0x1f')]('['+_0xe2ae8c['lastevent'][_0x83c8('0x76')]()+']\x20Ticket\x20%s\x20created.',_0x45e2cb['id']);logger[_0x83c8('0x1f')]('['+_0xe2ae8c[_0x83c8('0x77')][_0x83c8('0x76')]()+_0x83c8('0x78'),_0x43f22e[_0x83c8('0x3b')]);})[_0x83c8('0x6b')](function(_0x389fc0){logger[_0x83c8('0x69')]('['+_0xe2ae8c[_0x83c8('0x77')][_0x83c8('0x76')]()+']',_0x389fc0);});};
\ No newline at end of file
+var _0xcd0b=[']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Task','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','WhatId','ticketType','Case','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','execute','length','find','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','Contact','additionalSearchLead','merge','$or','Lead','additionalSearchAccount','additionalSearchContact','account','Account','first','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','toString','variableName','Variable','name','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','lastevent','toUpperCase'];(function(_0xfa97d0,_0x181f38){var _0x4f7149=function(_0x4fc731){while(--_0x4fc731){_0xfa97d0['push'](_0xfa97d0['shift']());}};_0x4f7149(++_0x181f38);}(_0xcd0b,0xfa));var _0xbcd0=function(_0x16fbe9,_0x4feb10){_0x16fbe9=_0x16fbe9-0x0;var _0x12fcb2=_0xcd0b[_0x16fbe9];return _0x12fcb2;};'use strict';var _=require(_0xbcd0('0x0'));var rp=require(_0xbcd0('0x1'));var moment=require(_0xbcd0('0x2'));var BPromise=require(_0xbcd0('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xbcd0('0x4'));var Redis=require(_0xbcd0('0x5'));var intUtil=require(_0xbcd0('0x6'));var config=require(_0xbcd0('0x7'));var logger=require(_0xbcd0('0x8'))(_0xbcd0('0x9'));config[_0xbcd0('0xa')]=_[_0xbcd0('0xb')](config[_0xbcd0('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xbcd0('0xc'))(new Redis(config['redis']));function emit(_0x34abea,_0x2e3562,_0x396e17){io['to'](_0x34abea)[_0xbcd0('0xd')](_0x2e3562,_0x396e17);}function getTicket(_0x27165e,_0x421015,_0x2d92ee,_0x2c18dd,_0x5a9ea4,_0x16d2b2,_0x5dc4a6,_0x340ec8){var _0x278e91=Object[_0xbcd0('0xe')]({},{'OwnerId':_0x421015['id'],'Subject':intUtil[_0xbcd0('0xf')](_0x2c18dd['Subjects'],_0x5a9ea4,'\x20'),'Description':intUtil[_0xbcd0('0xf')](_0x2c18dd['Descriptions'],_0x5a9ea4,'\x0a')},getCustomFields(_0x16d2b2,_0x5a9ea4));if(_0x2d92ee){if(_0x2c18dd['ticketType']===_0xbcd0('0x10')){_0x278e91[_0xbcd0('0x11')]=moment[_0xbcd0('0x12')]();_0x278e91[_0xbcd0('0x13')]=![];_0x278e91['IsRecurrence']=![];if(_0x2d92ee[_0xbcd0('0x14')]===_0xbcd0('0x15')||_0x2d92ee['endUserType']===_0xbcd0('0x16')){_0x278e91[_0xbcd0('0x17')]=_0x2d92ee['id'];}else if(_0x2d92ee['endUserType']==='account'){_0x278e91[_0xbcd0('0x18')]=_0x2d92ee['id'];}}else if(_0x2c18dd[_0xbcd0('0x19')]===_0xbcd0('0x1a')){if(_0x2d92ee[_0xbcd0('0x14')]==='contact'){_0x278e91['ContactId']=_0x2d92ee['id'];}else if(_0x2d92ee[_0xbcd0('0x14')]==='account'){_0x278e91[_0xbcd0('0x1b')]=_0x2d92ee['id'];}else if(_0x2d92ee[_0xbcd0('0x14')]===_0xbcd0('0x16')&&_0x2c18dd[_0xbcd0('0x1c')]){_0x278e91[_0x2c18dd['leadId']]=_0x2d92ee['id'];}else{logger['info'](_0xbcd0('0x1d'));}}}return _0x5dc4a6[_0xbcd0('0x1e')](_0x2c18dd[_0xbcd0('0x19')])[_0xbcd0('0x1f')](_0x278e91);}function getUser(_0x52a603,_0x331e32,_0x4bb299){if(!_[_0xbcd0('0x20')](_0x331e32)&&intUtil[_0xbcd0('0x21')](_0x331e32)){var _0x1cf409={'Email':_0x331e32};var _0x2cb1a6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4bb299[_0xbcd0('0x1e')]('User')['find'](_0x1cf409,_0x2cb1a6)[_0xbcd0('0x22')]()['then'](function(_0x30cb2b){if(_0x30cb2b[_0xbcd0('0x23')]){var _0x545160=_[_0xbcd0('0x24')](_0x30cb2b,function(_0x22e084){return _0x22e084[_0xbcd0('0x25')]===_0x331e32;});if(_0x545160){logger[_0xbcd0('0x26')](_0xbcd0('0x27'),_0x331e32);return BPromise[_0xbcd0('0x28')]({'id':_0x545160['Id'],'name':_0x545160[_0xbcd0('0x29')]});}}else{logger[_0xbcd0('0x26')](_0xbcd0('0x2a'),_0x331e32);return _0x4bb299[_0xbcd0('0x2b')]()[_0xbcd0('0x2c')](function(_0x4e7309){return BPromise[_0xbcd0('0x28')]({'id':_0x4e7309[_0xbcd0('0x2d')],'name':_0x4e7309[_0xbcd0('0x2e')]});});}});}else{logger[_0xbcd0('0x26')](_0xbcd0('0x2a'),_0x331e32);return _0x4bb299[_0xbcd0('0x2b')]()[_0xbcd0('0x2c')](function(_0x5ebd44){return BPromise[_0xbcd0('0x28')]({'id':_0x5ebd44['user_id'],'name':_0x5ebd44[_0xbcd0('0x2e')]});});}}function getEndUser(_0x1bfd60,_0x13abd2,_0x1a427f,_0x443b77,_0x4f4b8a){var _0x1ec98f={'$or':{'Phone':_0x443b77}};var _0x3f5c1a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbcd0('0x28')]()[_0xbcd0('0x2c')](function(){logger[_0xbcd0('0x26')](_0xbcd0('0x2f'),_0x443b77,_0x13abd2[_0xbcd0('0x30')]);switch(_0x13abd2['moduleSearch']){case _0xbcd0('0x31'):var _0x43544b=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2['additionalSearchContact']){var _0x28e61e={};_0x28e61e[_0x13abd2['additionalSearchContact']]=_0x443b77;_['merge'](_0x43544b['$or'],_0x28e61e);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x33'))[_0xbcd0('0x24')](_0x43544b,_0x3f5c1a)[_0xbcd0('0x22')]()[_0xbcd0('0x2c')](function(_0x1ea90b){if(_0x1ea90b&&_0x1ea90b[_0xbcd0('0x23')]){return _0x1ea90b;}else{var _0x3820a4=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2[_0xbcd0('0x34')]){var _0x326a34={};_0x326a34[_0x13abd2[_0xbcd0('0x34')]]=_0x443b77;_[_0xbcd0('0x35')](_0x3820a4[_0xbcd0('0x36')],_0x326a34);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x37'))[_0xbcd0('0x24')](_0x3820a4,_0x3f5c1a);}});case'account_contact_lead':var _0x40fc0a=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2[_0xbcd0('0x38')]){var _0x28e61e={};_0x28e61e[_0x13abd2[_0xbcd0('0x38')]]=_0x443b77;_[_0xbcd0('0x35')](_0x40fc0a[_0xbcd0('0x36')],_0x28e61e);}return _0x4f4b8a[_0xbcd0('0x1e')]('Account')[_0xbcd0('0x24')](_0x40fc0a,_0x3f5c1a)[_0xbcd0('0x22')]()[_0xbcd0('0x2c')](function(_0x25cad0){if(_0x25cad0&&_0x25cad0[_0xbcd0('0x23')]){return _0x25cad0;}else{var _0x522eab=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2[_0xbcd0('0x39')]){var _0x2d6aed={};_0x2d6aed[_0x13abd2[_0xbcd0('0x39')]]=_0x443b77;_[_0xbcd0('0x35')](_0x522eab[_0xbcd0('0x36')],_0x2d6aed);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x33'))[_0xbcd0('0x24')](_0x522eab,_0x3f5c1a)[_0xbcd0('0x2c')](function(_0x4cebf7){if(_0x4cebf7&&_0x4cebf7['length']){return _0x4cebf7;}else{var _0x2e6271=_['cloneDeep'](_0x1ec98f);if(_0x13abd2['additionalSearchLead']){var _0x301b55={};_0x301b55[_0x13abd2[_0xbcd0('0x34')]]=_0x443b77;_[_0xbcd0('0x35')](_0x2e6271[_0xbcd0('0x36')],_0x301b55);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x37'))[_0xbcd0('0x24')](_0x2e6271,_0x3f5c1a);}});}});case'contact':var _0x43544b=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2['additionalSearchContact']){var _0x28e61e={};_0x28e61e[_0x13abd2[_0xbcd0('0x39')]]=_0x443b77;_[_0xbcd0('0x35')](_0x43544b[_0xbcd0('0x36')],_0x28e61e);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x33'))['find'](_0x43544b,_0x3f5c1a)[_0xbcd0('0x22')]();case'lead':var _0x44cb35=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2['additionalSearchLead']){var _0x28e61e={};_0x28e61e[_0x13abd2[_0xbcd0('0x34')]]=_0x443b77;_[_0xbcd0('0x35')](_0x44cb35['$or'],_0x28e61e);}return _0x4f4b8a['sobject'](_0xbcd0('0x37'))[_0xbcd0('0x24')](_0x44cb35,_0x3f5c1a);case _0xbcd0('0x3a'):var _0x40fc0a=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2[_0xbcd0('0x38')]){var _0x28e61e={};_0x28e61e[_0x13abd2[_0xbcd0('0x38')]]=_0x443b77;_['merge'](_0x40fc0a[_0xbcd0('0x36')],_0x28e61e);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x3b'))[_0xbcd0('0x24')](_0x40fc0a,_0x3f5c1a);default:return null;}})['then'](function(_0x3e889f){if(_0x3e889f&&_0x3e889f[_0xbcd0('0x23')]){var _0x52842a=_[_0xbcd0('0x3c')](_0x3e889f);if(_0x52842a){return BPromise[_0xbcd0('0x28')]({'id':_0x52842a['Id'],'name':_0x52842a[_0xbcd0('0x29')],'phone':_0x52842a['Phone'],'endUserType':_0x52842a['attributes'][_0xbcd0('0x3d')][_0xbcd0('0x3e')]()});}}})['then'](function(_0x5b669a){if(_0x5b669a){logger[_0xbcd0('0x26')](_0xbcd0('0x3f'),_0x5b669a[_0xbcd0('0x14')],_0x443b77);return BPromise[_0xbcd0('0x28')](_0x5b669a);}else{logger['info'](_0xbcd0('0x40'),_0x443b77);var _0x557f58={'Phone':_0x443b77};if(_0x13abd2[_0xbcd0('0x41')]){if(_0x13abd2['moduleCreate']===_0xbcd0('0x15')){logger[_0xbcd0('0x26')](_0xbcd0('0x42'),_0x443b77,_0x13abd2[_0xbcd0('0x41')]);_0x557f58[_0xbcd0('0x43')]=_0x1a427f!==_0xbcd0('0x44')?_0x1a427f:util[_0xbcd0('0x45')](_0xbcd0('0x46'),_0x443b77);}else if(_0x13abd2[_0xbcd0('0x41')]===_0xbcd0('0x16')){logger[_0xbcd0('0x26')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x443b77,_0x13abd2[_0xbcd0('0x41')]);_0x557f58[_0xbcd0('0x43')]=_0x1a427f!==_0xbcd0('0x44')?_0x1a427f:util['format'](_0xbcd0('0x46'),_0x443b77);_0x557f58[_0xbcd0('0x47')]=_0xbcd0('0x48');}else if(_0x13abd2[_0xbcd0('0x41')]===_0xbcd0('0x3a')){logger[_0xbcd0('0x26')](_0xbcd0('0x42'),_0x443b77,_0x13abd2[_0xbcd0('0x41')]);_0x557f58[_0xbcd0('0x29')]=_0x1a427f!==_0xbcd0('0x44')?_0x1a427f:util[_0xbcd0('0x45')](_0xbcd0('0x46'),_0x443b77);}else{return null;}}return _0x4f4b8a['sobject'](_[_0xbcd0('0x49')](_0x13abd2[_0xbcd0('0x41')]))[_0xbcd0('0x1f')](_0x557f58)['then'](function(_0x4b7a18){return BPromise['resolve']({'id':_0x4b7a18['id'],'endUserType':_0x13abd2[_0xbcd0('0x41')]});});}});}function getCustomFields(_0x39f769,_0x315571){var _0x1b901c={};if(_0x39f769[_0xbcd0('0x23')]>0x0){_[_0xbcd0('0x4a')](_0x39f769,function(_0x3a36ec){if(_[_0xbcd0('0x4b')](['string',_0xbcd0('0x4c')],_0x3a36ec['type'])&&_0x3a36ec[_0xbcd0('0x4d')]){_0x1b901c[_0x3a36ec[_0xbcd0('0x4d')]]=_0x3a36ec['content'][_0xbcd0('0x4e')]();}else if(_0x3a36ec[_0xbcd0('0x3d')]==='variable'&&_0x3a36ec[_0xbcd0('0x4f')]&&_0x3a36ec[_0xbcd0('0x4d')]){_0x315571[_0x3a36ec[_0xbcd0('0x4f')]]&&(_0x1b901c[_0x3a36ec[_0xbcd0('0x4d')]]=_0x315571[_0x3a36ec[_0xbcd0('0x4f')]][_0xbcd0('0x4e')]());}else if(_0x3a36ec[_0xbcd0('0x3d')]==='customVariable'&&_0x3a36ec[_0xbcd0('0x50')]&&_0x3a36ec[_0xbcd0('0x50')][_0xbcd0('0x51')]&&_0x3a36ec[_0xbcd0('0x4d')]){_0x315571[_0x3a36ec['Variable'][_0xbcd0('0x51')][_0xbcd0('0x3e')]()]&&(_0x1b901c[_0x3a36ec[_0xbcd0('0x4d')]]=_0x315571[_0x3a36ec[_0xbcd0('0x50')][_0xbcd0('0x51')][_0xbcd0('0x3e')]()]['toString']());}});}return _0x1b901c;}function getConnection(_0x441f88){var _0x3db35d=_0x441f88['password']['concat'](_0x441f88[_0xbcd0('0x52')]);var _0x3c3198=new jsforce['Connection']({'oauth2':{'loginUrl':_0x441f88[_0xbcd0('0x53')]||_0xbcd0('0x54'),'clientId':_0x441f88[_0xbcd0('0x55')],'clientSecret':_0x441f88[_0xbcd0('0x56')]}});return _0x3c3198[_0xbcd0('0x57')](_0x441f88[_0xbcd0('0x58')],_0x3db35d)[_0xbcd0('0x2c')](function(){logger[_0xbcd0('0x26')](_0xbcd0('0x59'));return _0x3c3198;});}exports[_0xbcd0('0x5a')]=function(_0x49dd6e,_0x1329aa,_0x5c8c3c,_0x3bd442,_0xc18f29,_0x4ef3bb){var _0x56a263,_0x160873,_0x35be48,_0x10be98;_0x4ef3bb['serverUrl']=intUtil[_0xbcd0('0x5b')](_0x4ef3bb[_0xbcd0('0x5c')]);_0x4ef3bb[_0xbcd0('0x53')]=intUtil['stripTrailingSlash'](_0x4ef3bb[_0xbcd0('0x53')]);if(_0xc18f29&&_0xc18f29[_0xbcd0('0x5d')]){logger[_0xbcd0('0x26')](_0xbcd0('0x5e'),_0xbcd0('0x5f'));_0x1329aa[_0xbcd0('0x60')]=util[_0xbcd0('0x45')](_0xbcd0('0x61'),_0x4ef3bb[_0xbcd0('0x5c')],_0x1329aa[_0xbcd0('0x62')],md5(_0x1329aa['uniqueid']));}else{_0x1329aa['recordingURL']='';}return getConnection(_0x4ef3bb)['then'](function(_0x5a29f2){_0x10be98=_0x5a29f2;return getUser(_0x4ef3bb,_0x3bd442['email'],_0x10be98);})[_0xbcd0('0x2c')](function(_0x2e04d0){_0x56a263=_0x2e04d0;return getEndUser(_0x4ef3bb,_0x5c8c3c,_0x1329aa[_0xbcd0('0x63')],_0x1329aa[_0xbcd0('0x64')],_0x10be98);})[_0xbcd0('0x2c')](function(_0x3376a7){_0x160873=_0x3376a7;return getTicket(_0x4ef3bb,_0x56a263,_0x160873,_0x5c8c3c,_0x1329aa,_0x5c8c3c[_0xbcd0('0x65')],_0x10be98,_0xbcd0('0x5a'));})[_0xbcd0('0x2c')](function(_0x384372){_0x35be48=_0x384372;logger[_0xbcd0('0x26')](_0xbcd0('0x66'),_0x35be48['id']);logger['info'](_0xbcd0('0x67'),_0x35be48['id'],_0x3bd442['name'],_0x4ef3bb[_0xbcd0('0x3d')]);switch(_0x4ef3bb['type']){case _0xbcd0('0x68'):emit(util[_0xbcd0('0x45')](_0xbcd0('0x69'),_0x3bd442[_0xbcd0('0x51')]),'trigger:salesforce:display',{'recordId':_0x35be48['id']});break;case _0xbcd0('0x6a'):emit(util[_0xbcd0('0x45')](_0xbcd0('0x69'),_0x3bd442['name']),'trigger:browser:url',{'uri':util['format'](_0xbcd0('0x6b'),_0x10be98[_0xbcd0('0x6c')],_0x35be48['id'])});break;default:logger[_0xbcd0('0x6d')](_0xbcd0('0x6e'));}})[_0xbcd0('0x6f')](function(_0x746580){logger[_0xbcd0('0x6d')]('[QUEUE]',_0x746580);});};exports['outbound']=function(_0x59353c,_0x30ff92,_0x7d87eb,_0x563a27,_0x92f30b,_0x113505,_0x6543f3){var _0x61bd5b,_0x2c691,_0x3b4901,_0x483c51;_0x113505[_0xbcd0('0x5c')]=intUtil[_0xbcd0('0x5b')](_0x113505['serverUrl']);_0x113505[_0xbcd0('0x53')]=intUtil['stripTrailingSlash'](_0x113505[_0xbcd0('0x53')]);if(_0x6543f3&&_0x6543f3[_0xbcd0('0x70')]&&_0x6543f3['recordingFormat']!==_0xbcd0('0x71')){logger[_0xbcd0('0x26')](_0xbcd0('0x72'),_0xbcd0('0x5f'));_0x30ff92['recordingURL']=util[_0xbcd0('0x45')](_0xbcd0('0x61'),_0x113505['serverUrl'],_0x30ff92[_0xbcd0('0x62')],md5(_0x30ff92[_0xbcd0('0x62')]));}return getConnection(_0x113505)['then'](function(_0x44713d){_0x483c51=_0x44713d;return getUser(_0x113505,_0x563a27['email'],_0x483c51);})[_0xbcd0('0x2c')](function(_0x2011f3){_0x61bd5b=_0x2011f3;return getEndUser(_0x113505,_0x7d87eb,_0x30ff92[_0xbcd0('0x73')],_0x30ff92[_0xbcd0('0x74')],_0x483c51);})['then'](function(_0x3e4287){_0x2c691=_0x3e4287;return getTicket(_0x113505,_0x61bd5b,_0x2c691,_0x7d87eb,_0x30ff92,_0x7d87eb[_0xbcd0('0x65')],_0x483c51,'outbound');})['then'](function(_0x3fc089){_0x3b4901=_0x3fc089;logger[_0xbcd0('0x26')](_0xbcd0('0x75'),_0x3b4901['id']);logger['info'](_0xbcd0('0x76'),_0x3b4901['id'],_0x563a27[_0xbcd0('0x51')],_0x113505[_0xbcd0('0x3d')]);switch(_0x113505[_0xbcd0('0x3d')]){case _0xbcd0('0x68'):emit(util[_0xbcd0('0x45')](_0xbcd0('0x69'),_0x563a27[_0xbcd0('0x51')]),'trigger:salesforce:display',{'recordId':_0x3b4901['id']});break;case'newTab':emit(util['format'](_0xbcd0('0x69'),_0x563a27['name']),_0xbcd0('0x77'),{'uri':util[_0xbcd0('0x45')](_0xbcd0('0x6b'),_0x483c51['instanceUrl'],_0x3b4901['id'])});break;default:logger[_0xbcd0('0x6d')](_0xbcd0('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xbcd0('0x6f')](function(_0x2cce2f){logger[_0xbcd0('0x6d')](_0xbcd0('0x72'),_0x2cce2f);});};exports['unmanaged']=function(_0x3ff9cc,_0x149ec4,_0x158549,_0x276f9d,_0x42949b,_0xce4457){var _0x5f0983,_0x263561,_0x5c45a5,_0x5642fa;_0xce4457[_0xbcd0('0x5c')]=intUtil[_0xbcd0('0x5b')](_0xce4457[_0xbcd0('0x5c')]);_0xce4457[_0xbcd0('0x53')]=intUtil['stripTrailingSlash'](_0xce4457['remoteUri']);if(_0x42949b&&_0x42949b[_0xbcd0('0x5d')]){logger[_0xbcd0('0x26')]('['+_0x149ec4[_0xbcd0('0x78')]['toUpperCase']()+']',_0xbcd0('0x5f'));_0x149ec4[_0xbcd0('0x60')]=util['format'](_0xbcd0('0x61'),_0xce4457[_0xbcd0('0x5c')],_0x149ec4['uniqueid'],md5(_0x149ec4[_0xbcd0('0x62')]));}else{_0x149ec4[_0xbcd0('0x60')]='';}return getConnection(_0xce4457)[_0xbcd0('0x2c')](function(_0x42efa6){_0x5642fa=_0x42efa6;if(!_['isNil'](_0x276f9d)){return getUser(_0xce4457,_0x276f9d[_0xbcd0('0x51')],_0x5642fa);}else{return getUser(_0xce4457,null,_0x5642fa);}})[_0xbcd0('0x2c')](function(_0x2f1315){_0x5f0983=_0x2f1315;return getEndUser(_0xce4457,_0x158549,_0x149ec4['calleridname'],_0x149ec4[_0xbcd0('0x64')],_0x5642fa);})[_0xbcd0('0x2c')](function(_0x46fe17){_0x263561=_0x46fe17;return getTicket(_0xce4457,_0x5f0983,_0x263561,_0x158549,_0x149ec4,_0x158549['Fields'],_0x5642fa);})[_0xbcd0('0x2c')](function(_0x1ccf3e){_0x5c45a5=_0x1ccf3e;logger[_0xbcd0('0x26')]('['+_0x149ec4['lastevent'][_0xbcd0('0x79')]()+_0xbcd0('0x7a'),_0x5c45a5['id']);logger[_0xbcd0('0x26')]('['+_0x149ec4[_0xbcd0('0x78')][_0xbcd0('0x79')]()+_0xbcd0('0x7b'),_0xce4457['type']);})[_0xbcd0('0x6f')](function(_0x51a22d){logger['error']('['+_0x149ec4[_0xbcd0('0x78')][_0xbcd0('0x79')]()+']',_0x51a22d);});};
\ No newline at end of file
index 5bb3670..bb49bd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7f8=['user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','md5','ioredis','./util','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','type','customField','toLowerCase','content','toString','string','picklist','idField','variable','variableName','customVariable','Variable','name','outbound','POST','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format'];(function(_0x1c72e1,_0x3bd758){var _0x3fc0ee=function(_0x3f8839){while(--_0x3f8839){_0x1c72e1['push'](_0x1c72e1['shift']());}};_0x3fc0ee(++_0x3bd758);}(_0xd7f8,0xf6));var _0x8d7f=function(_0x4afe81,_0x10d261){_0x4afe81=_0x4afe81-0x0;var _0x184773=_0xd7f8[_0x4afe81];return _0x184773;};'use strict';var _=require(_0x8d7f('0x0'));var Promise=require(_0x8d7f('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0x8d7f('0x2'));var Redis=require(_0x8d7f('0x3'));var intUtil=require(_0x8d7f('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x8d7f('0x5'));config[_0x8d7f('0x6')]=_[_0x8d7f('0x7')](config['redis'],{'host':_0x8d7f('0x8'),'port':0x18eb});var io=require(_0x8d7f('0x9'))(new Redis(config['redis']));function getAdminUser(_0x5a48f8,_0x825647,_0x61744a,_0x3ab885,_0x3bb6e7,_0x13b930){return new Promise(function(_0x552fb9,_0x197dc7){var _0x266cb6={'method':'GET','uri':_0x3ab885+_0x8d7f('0xa')+'&'+_0x3bb6e7+'&'+_0x13b930,'auth':_0x825647,'json':!![]};return rp(_0x266cb6)[_0x8d7f('0xb')](function(_0x14dcf0){if(_0x14dcf0[_0x8d7f('0xc')][_0x8d7f('0xd')]>0x0){_0x61744a[_0x8d7f('0xe')]=_0x14dcf0[_0x8d7f('0xc')][0x0][_0x8d7f('0xf')];}logger[_0x8d7f('0x10')]('['+[_0x5a48f8['toUpperCase']()]+_0x8d7f('0x11'),_0x61744a);_0x552fb9(_0x61744a);})[_0x8d7f('0x12')](function(_0x55f45d){logger[_0x8d7f('0x13')]('['+[_0x5a48f8[_0x8d7f('0x14')]()]+']',_0x55f45d['message']);_0x197dc7(_0x55f45d[_0x8d7f('0x15')]);});});}function getUser(_0x3819ce,_0x16bbc9,_0xf43e7d,_0x1d6ce1,_0xcea77b){return function(_0x55773f){logger['info']('['+[_0x3819ce['toUpperCase']()]+_0x8d7f('0x16'),_0x55773f);return new Promise(function(_0x2a64fc,_0x3f8152){if(intUtil[_0x8d7f('0x17')](_0x55773f[_0x8d7f('0x18')])){var _0x534008={'method':_0x8d7f('0x19'),'uri':_0xf43e7d+_0x8d7f('0x1a')+_0x55773f[_0x8d7f('0x18')]+'&'+_0x1d6ce1+'&'+_0xcea77b,'auth':_0x16bbc9,'json':!![]};logger[_0x8d7f('0x10')]('['+[_0x3819ce[_0x8d7f('0x14')]()]+_0x8d7f('0x1b'),_0x534008);return rp(_0x534008)['then'](function(_0x44af67){logger[_0x8d7f('0x10')]('['+[_0x3819ce['toUpperCase']()]+_0x8d7f('0x1c'),_0x44af67);if(_0x44af67[_0x8d7f('0xc')][_0x8d7f('0xd')]>0x0&&String(_0x44af67[_0x8d7f('0xc')][0x0]['active'])===_0x8d7f('0x1d')){_0x55773f[_0x8d7f('0x1e')]=_0x44af67[_0x8d7f('0xc')][0x0][_0x8d7f('0xf')];}else{_0x55773f[_0x8d7f('0x1e')]=_0x55773f[_0x8d7f('0xe')];_0x55773f[_0x8d7f('0x18')]=_0x55773f[_0x8d7f('0x1f')];}logger[_0x8d7f('0x10')]('['+[_0x3819ce[_0x8d7f('0x14')]()]+_0x8d7f('0x20'),_0x55773f);_0x2a64fc(_0x55773f);})[_0x8d7f('0x12')](function(_0x2d984e){logger['error']('['+[_0x3819ce['toUpperCase']()]+']',_0x2d984e[_0x8d7f('0x15')]);_0x3f8152(_0x2d984e[_0x8d7f('0x15')]);});}else{logger[_0x8d7f('0x10')]('['+[_0x3819ce[_0x8d7f('0x14')]()]+_0x8d7f('0x21'));_0x55773f[_0x8d7f('0x1e')]=_0x55773f[_0x8d7f('0xe')];_0x55773f[_0x8d7f('0x18')]=_0x55773f['adminEmail'];_0x2a64fc(_0x55773f);}});};}function createEndUser(_0x141ab9,_0x39529d,_0x509afc,_0x3bd8ae,_0x5a3e58){logger[_0x8d7f('0x10')]('['+[_0x141ab9[_0x8d7f('0x14')]()]+_0x8d7f('0x22'),_0x509afc);return new Promise(function(_0x20f96b,_0x20319f){var _0x4857d2={'method':'POST','uri':_0x3bd8ae+_0x8d7f('0x23')+_0x5a3e58,'body':{'user_name':_0x509afc[_0x8d7f('0x24')],'roles':'user','first_name':_0x509afc['endUserNumber'],'active':_0x8d7f('0x1d'),'date_format':_0x8d7f('0x25'),'phone':_0x509afc[_0x8d7f('0x24')]},'auth':_0x39529d,'json':!![]};return rp(_0x4857d2)['then'](function(_0x4e60ed){logger[_0x8d7f('0x10')]('['+[_0x141ab9[_0x8d7f('0x14')]()]+'],\x20EndUser\x20schema',_0x4e60ed[_0x8d7f('0xc')]);_0x509afc[_0x8d7f('0x26')]=_0x4e60ed[_0x8d7f('0xc')][_0x8d7f('0xf')];_0x20f96b(_0x509afc);})[_0x8d7f('0x12')](function(_0x3b655c){logger[_0x8d7f('0x13')]('['+[_0x141ab9[_0x8d7f('0x14')]()]+']',_0x3b655c[_0x8d7f('0x15')]);_0x20319f(_0x3b655c['message']);});});}function getEndUser(_0x593cb4,_0x5ecdc0,_0x4835c6,_0x372df8,_0x2cc894){return function(_0x49a58c){logger[_0x8d7f('0x10')]('['+[_0x593cb4[_0x8d7f('0x14')]()]+_0x8d7f('0x27'),_0x49a58c);return new Promise(function(_0x1f0eba,_0x82bfa1){var _0x56a0c0={'method':_0x8d7f('0x19'),'uri':_0x4835c6+'sys_user?sysparm_query=phone%3D'+_0x49a58c[_0x8d7f('0x24')]+'&'+_0x372df8+'&'+_0x2cc894,'auth':_0x5ecdc0,'json':!![]};return rp(_0x56a0c0)[_0x8d7f('0xb')](function(_0xc90307){if(_0xc90307[_0x8d7f('0xc')]['length']>0x0){_0x49a58c[_0x8d7f('0x26')]=_0xc90307[_0x8d7f('0xc')][0x0][_0x8d7f('0xf')];logger[_0x8d7f('0x10')]('['+[_0x593cb4['toUpperCase']()]+_0x8d7f('0x28'),_0x49a58c);_0x1f0eba(_0x49a58c);}else{return createEndUser(_0x593cb4,_0x5ecdc0,_0x49a58c,_0x4835c6,_0x372df8)['then'](function(_0x589111){logger[_0x8d7f('0x10')]('['+[_0x593cb4[_0x8d7f('0x14')]()]+_0x8d7f('0x29'),_0x589111);_0x1f0eba(_0x589111);});}})[_0x8d7f('0x12')](function(_0x1c4972){logger[_0x8d7f('0x13')]('['+[_0x593cb4[_0x8d7f('0x14')]()]+']',_0x1c4972['message']);_0x82bfa1(_0x1c4972[_0x8d7f('0x15')]);});});};}function getCustomFields(_0x2a388a,_0x252006){var _0x1f9c41={};if(_0x2a388a['length']>0x0){_[_0x8d7f('0x2a')](_0x2a388a,function(_0x17c854){if(_[_0x8d7f('0x2b')](['string','picklist'],_0x17c854[_0x8d7f('0x2c')])&&_0x17c854['nameField']&&!_0x17c854[_0x8d7f('0x2d')]){_0x1f9c41[_0x17c854['nameField'][_0x8d7f('0x2e')]()]=_0x17c854[_0x8d7f('0x2f')][_0x8d7f('0x30')]();}else if(_[_0x8d7f('0x2b')]([_0x8d7f('0x31'),_0x8d7f('0x32')],_0x17c854[_0x8d7f('0x2c')])&&_0x17c854[_0x8d7f('0x33')]&&_0x17c854[_0x8d7f('0x2d')]){_0x1f9c41[_0x17c854[_0x8d7f('0x33')][_0x8d7f('0x2e')]()]=_0x17c854[_0x8d7f('0x2f')]['toString']();}else if(_0x17c854[_0x8d7f('0x2c')]===_0x8d7f('0x34')&&_0x17c854[_0x8d7f('0x35')]&&_0x17c854[_0x8d7f('0x33')]&&_0x17c854[_0x8d7f('0x2d')]){_0x1f9c41[_0x17c854[_0x8d7f('0x33')][_0x8d7f('0x2e')]()]=_0x252006[_0x17c854[_0x8d7f('0x35')]][_0x8d7f('0x30')]();}else if(_0x17c854[_0x8d7f('0x2c')]===_0x8d7f('0x36')&&_0x17c854[_0x8d7f('0x37')]&&_0x17c854[_0x8d7f('0x37')][_0x8d7f('0x38')]&&_0x17c854[_0x8d7f('0x33')]&&_0x17c854[_0x8d7f('0x2d')]){_0x1f9c41[_0x17c854[_0x8d7f('0x33')][_0x8d7f('0x2e')]()]=_0x252006[_0x17c854['Variable'][_0x8d7f('0x38')][_0x8d7f('0x2e')]()][_0x8d7f('0x30')]();}});}return _0x1f9c41;}function getTicket(_0x398adb,_0x149bce,_0x334507,_0x3181c1,_0x248fc0,_0x4c3ad7){return function(_0x7b6702){logger[_0x8d7f('0x10')]('['+[_0x398adb['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x7b6702);return new Promise(function(_0x294e4f,_0x1940b1){var _0x1e47d6=_0x398adb[_0x8d7f('0x2e')]()===_0x8d7f('0x39')?_0x7b6702['userId']:_0x7b6702['endUserId'];var _0x239b1f={'method':_0x8d7f('0x3a'),'uri':_0x334507+_0x8d7f('0x3b')+'?'+_0x4c3ad7,'body':Object[_0x8d7f('0x3c')]({},{'active':_0x8d7f('0x1d'),'caller_id':_0x1e47d6,'assigned_to':_0x7b6702['userId'],'short_description':intUtil['getString'](_0x3181c1['Subjects'],_0x248fc0,'\x20'),'description':intUtil[_0x8d7f('0x3d')](_0x3181c1[_0x8d7f('0x3e')],_0x248fc0,'\x0a')},getCustomFields(_0x3181c1[_0x8d7f('0x3f')],_0x248fc0)),'auth':_0x149bce,'json':!![]};return rp(_0x239b1f)['then'](function(_0x387ff9){logger['info']('['+[_0x398adb[_0x8d7f('0x14')]()]+_0x8d7f('0x40'),_0x387ff9[_0x8d7f('0xc')]);_0x7b6702[_0x8d7f('0x41')]=_0x387ff9[_0x8d7f('0xc')][_0x8d7f('0xf')];_0x7b6702[_0x8d7f('0x42')]=_0x387ff9['result'][_0x8d7f('0x43')];logger[_0x8d7f('0x10')]('['+[_0x398adb[_0x8d7f('0x14')]()]+_0x8d7f('0x44'),_0x7b6702);_0x294e4f(_0x7b6702);})[_0x8d7f('0x12')](function(_0x372db0){logger[_0x8d7f('0x13')]('['+[_0x398adb['toUpperCase']()]+']',_0x372db0[_0x8d7f('0x15')]);_0x1940b1(_0x372db0[_0x8d7f('0x15')]);});});};}function createRemoteTag(_0x56facd,_0x19d1b5,_0x235d5c,_0x415019){return new Promise(function(_0x4f6562,_0x4d6c6b){var _0x18e9c7={'method':_0x8d7f('0x3a'),'uri':_0x235d5c+_0x8d7f('0x45')+'?'+_0x415019,'body':{'short_description':_0x56facd,'global':!![],'active':!![],'name':_0x56facd},'auth':_0x19d1b5,'json':!![]};return rp(_0x18e9c7)['then'](function(_0x1ddc7f){var _0x28176f=_0x1ddc7f['result'][_0x8d7f('0xf')];_0x4f6562(_0x28176f);});});}function getRemoteTag(_0x405153,_0x48cf3f,_0x4785e0,_0x2b84eb,_0x3a7987){return new Promise(function(_0x556d5e,_0x5172af){var _0x281e5f={'method':_0x8d7f('0x19'),'uri':_0x4785e0+_0x8d7f('0x45')+'?sysparm_query=name%3D'+_0x405153+'&'+_0x2b84eb,'auth':_0x48cf3f,'json':!![]};return rp(_0x281e5f)['then'](function(_0x20b307){if(_0x20b307[_0x8d7f('0xc')][_0x8d7f('0xd')]>0x0){var _0xbafdb2=_0x20b307[_0x8d7f('0xc')][0x0][_0x8d7f('0xf')];_0x556d5e(_0xbafdb2);}else{return createRemoteTag(_0x405153,_0x48cf3f,_0x4785e0,_0x2b84eb)['then'](function(_0x38310c){_0x556d5e(_0x38310c);});}});});}function assignTagToIncident(_0x526da6,_0x313953,_0x53d518,_0x54000e,_0x343df3){return new Promise(function(_0x92ed72,_0x2062ea){var _0x20aba9={'method':_0x8d7f('0x3a'),'uri':_0x53d518+_0x8d7f('0x46')+'?'+_0x343df3,'body':{'label':_0x526da6,'table':_0x8d7f('0x3b'),'id_type':_0x8d7f('0x47'),'table_key':_0x54000e[_0x8d7f('0x41')],'title':'Incident\x20-\x20'+_0x54000e[_0x8d7f('0x42')],'id_display':_0x54000e['ticketNumber']},'auth':_0x313953,'json':!![]};return rp(_0x20aba9)['then'](function(_0x1bb417){_0x92ed72();})[_0x8d7f('0x12')](function(){_0x92ed72();});});}function manageTags(_0x286dc0,_0x563ce6,_0x4799a4,_0x2502bc,_0x369067,_0x343e60,_0x80f154){return new Promise(function(_0x433d81,_0x32d434){var _0x5df9e8=[];_0x563ce6[_0x8d7f('0x2a')](function(_0x5863c2){_0x5df9e8[_0x8d7f('0x48')](getRemoteTag(_0x5863c2,_0x4799a4,_0x2502bc,_0x343e60,_0x80f154));});return Promise['all'](_0x5df9e8)[_0x8d7f('0xb')](function(_0x7a07ad){if(_0x7a07ad[_0x8d7f('0xd')]){logger['info']('['+[_0x286dc0[_0x8d7f('0x14')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x7a07ad);var _0x31d367=[];_0x7a07ad[_0x8d7f('0x2a')](function(_0x572b76){_0x31d367[_0x8d7f('0x48')](assignTagToIncident(_0x572b76,_0x4799a4,_0x2502bc,_0x369067,_0x343e60));});return Promise[_0x8d7f('0x49')](_0x31d367)[_0x8d7f('0xb')](function(){_0x433d81();})['catch'](function(){_0x433d81();});}else{_0x433d81();}});});}function getTags(_0x2d47d1,_0x488b10,_0x401c32,_0x4e37b2,_0xddaaeb,_0x1d0f73){return function(_0x548021){return new Promise(function(_0x129dce,_0x53152b){var _0x1460d5=[];var _0x27da88=_0x4e37b2[_0x8d7f('0x4a')];if(_0x27da88&&_0x27da88[_0x8d7f('0xd')]>0x0){_0x1460d5=_[_0x8d7f('0x4b')](_0x27da88,'name');}if(_0x1460d5['length']>0x0){return manageTags(_0x2d47d1,_0x1460d5,_0x488b10,_0x401c32,_0x548021,_0xddaaeb,_0x1d0f73)[_0x8d7f('0xb')](function(){_0x129dce(_0x548021);});}else{_0x129dce(_0x548021);}});};}function emit(_0x3b66ca,_0x5bd50a,_0x1231cc){var _0x1800fa=_0x8d7f('0x4c')+_0x8d7f('0x4d')+_0x8d7f('0x4e')+_0x8d7f('0x4f');var _0x39a56f={'uri':_0x3b66ca+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x1231cc+_0x1800fa};io['to'](util[_0x8d7f('0x50')](_0x8d7f('0x51'),_0x5bd50a))[_0x8d7f('0x52')](_0x8d7f('0x53'),_0x39a56f);}exports['cs']=function(_0x23911f,_0x372d71,_0x574179,_0x338f9e,_0xb1924,_0x4ff7cd,_0x10616c,_0x1c4259){var _0x14a0a5={};var _0x4cb247={'user':_0x4ff7cd[_0x8d7f('0x54')],'pass':_0x4ff7cd[_0x8d7f('0x55')]};var _0x41c5ae=_0x8d7f('0x56');var _0x125bcc=_0x8d7f('0x57');_0x4ff7cd[_0x8d7f('0x58')]=intUtil[_0x8d7f('0x59')](_0x4ff7cd[_0x8d7f('0x58')]);_0x4ff7cd[_0x8d7f('0x5a')]=intUtil['stripTrailingSlash'](_0x4ff7cd[_0x8d7f('0x5a')]);var _0x177665=util[_0x8d7f('0x50')](_0x8d7f('0x5b'),_0x4ff7cd[_0x8d7f('0x58')]);_0x14a0a5[_0x8d7f('0x18')]=!_[_0x8d7f('0x5c')](_0x338f9e)?_0x338f9e[_0x8d7f('0x5d')]:null;_0x14a0a5[_0x8d7f('0x1f')]=_0x4ff7cd[_0x8d7f('0x5d')];_0x14a0a5['endUserNumber']=_0x1c4259['toLowerCase']()==='outbound'?_0x372d71[_0x8d7f('0x5e')]:_0x372d71[_0x8d7f('0x5f')];_0x14a0a5[_0x8d7f('0x60')]=_0x1c4259===_0x8d7f('0x61')||_0x1c4259===_0x8d7f('0x62')?_0x8d7f('0x61'):_0x8d7f('0x39');var _0x384522=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ff7cd[_0x8d7f('0x5a')],_0x372d71['uniqueid'],md5(_0x372d71[_0x8d7f('0x63')]));if(_0xb1924&&_0xb1924[_0x8d7f('0x64')]){logger[_0x8d7f('0x10')]('[QUEUE]',_0x8d7f('0x65'));_0x372d71[_0x8d7f('0x66')]=_0x384522;}else if(_0x10616c&&_0x10616c[_0x8d7f('0x67')]&&_0x10616c['recordingFormat']!==_0x8d7f('0x68')){logger[_0x8d7f('0x10')]('[OUTBOUND]',_0x8d7f('0x65'));_0x372d71['recordingURL']=_0x384522;}else{_0x372d71['recordingURL']='';}return getAdminUser(_0x1c4259,_0x4cb247,_0x14a0a5,_0x177665,_0x125bcc,_0x41c5ae)[_0x8d7f('0xb')](getUser(_0x1c4259,_0x4cb247,_0x177665,_0x125bcc,_0x41c5ae))[_0x8d7f('0xb')](getEndUser(_0x1c4259,_0x4cb247,_0x177665,_0x125bcc,_0x41c5ae))[_0x8d7f('0xb')](getTicket(_0x1c4259,_0x4cb247,_0x177665,_0x574179,_0x372d71,_0x125bcc))[_0x8d7f('0xb')](function(_0x4e4317){logger['info'](util['format'](_0x8d7f('0x69'),_0x4e4317[_0x8d7f('0x41')]));logger['info'](util['format']('call\x20direction:\x20%s',_0x1c4259));if(_0x1c4259!==_0x8d7f('0x62')){logger[_0x8d7f('0x10')]('['+[_0x1c4259['toUpperCase']()]+']',_0x8d7f('0x6a'));emit(_0x4ff7cd[_0x8d7f('0x58')],_0x338f9e['name'],_0x4e4317['ticketId']);}})['catch'](function(_0x55b318){logger['error']('['+[_0x1c4259['toUpperCase']()]+_0x8d7f('0x6b'),util[_0x8d7f('0x6c')](_0x55b318,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xa1a7=['label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm'];(function(_0x237278,_0x39feaa){var _0x5ab67b=function(_0x58a76e){while(--_0x58a76e){_0x237278['push'](_0x237278['shift']());}};_0x5ab67b(++_0x39feaa);}(_0xa1a7,0x1ce));var _0x7a1a=function(_0x168478,_0x323a27){_0x168478=_0x168478-0x0;var _0x29c2f8=_0xa1a7[_0x168478];return _0x29c2f8;};'use strict';var _=require(_0x7a1a('0x0'));var Promise=require('bluebird');var rp=require(_0x7a1a('0x1'));var util=require('util');var md5=require(_0x7a1a('0x2'));var Redis=require(_0x7a1a('0x3'));var intUtil=require(_0x7a1a('0x4'));var config=require(_0x7a1a('0x5'));var logger=require(_0x7a1a('0x6'))(_0x7a1a('0x7'));config[_0x7a1a('0x8')]=_[_0x7a1a('0x9')](config[_0x7a1a('0x8')],{'host':_0x7a1a('0xa'),'port':0x18eb});var io=require(_0x7a1a('0xb'))(new Redis(config[_0x7a1a('0x8')]));function getAdminUser(_0x5d41f0,_0x3580ac,_0x39ac92,_0x534a94,_0x3924fc,_0x232f4a){return new Promise(function(_0x5c024d,_0x1b0286){var _0x1f8c03={'method':_0x7a1a('0xc'),'uri':_0x534a94+_0x7a1a('0xd')+'&'+_0x3924fc+'&'+_0x232f4a,'auth':_0x3580ac,'json':!![]};return rp(_0x1f8c03)['then'](function(_0x4d3e3f){if(_0x4d3e3f[_0x7a1a('0xe')][_0x7a1a('0xf')]>0x0){_0x39ac92[_0x7a1a('0x10')]=_0x4d3e3f[_0x7a1a('0xe')][0x0][_0x7a1a('0x11')];}logger[_0x7a1a('0x12')]('['+[_0x5d41f0[_0x7a1a('0x13')]()]+_0x7a1a('0x14'),_0x39ac92);_0x5c024d(_0x39ac92);})[_0x7a1a('0x15')](function(_0x5cbe07){logger['error']('['+[_0x5d41f0[_0x7a1a('0x13')]()]+']',_0x5cbe07[_0x7a1a('0x16')]);_0x1b0286(_0x5cbe07[_0x7a1a('0x16')]);});});}function getUser(_0x18b527,_0x3c8501,_0x341fb8,_0x11b585,_0x4ce405){return function(_0x4c11c1){logger[_0x7a1a('0x12')]('['+[_0x18b527[_0x7a1a('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x4c11c1);return new Promise(function(_0xcbcf02,_0x1e648d){if(intUtil[_0x7a1a('0x17')](_0x4c11c1[_0x7a1a('0x18')])){var _0x10cd19={'method':'GET','uri':_0x341fb8+_0x7a1a('0x19')+_0x4c11c1[_0x7a1a('0x18')]+'&'+_0x11b585+'&'+_0x4ce405,'auth':_0x3c8501,'json':!![]};logger['info']('['+[_0x18b527[_0x7a1a('0x13')]()]+_0x7a1a('0x1a'),_0x10cd19);return rp(_0x10cd19)[_0x7a1a('0x1b')](function(_0x41efc6){logger[_0x7a1a('0x12')]('['+[_0x18b527[_0x7a1a('0x13')]()]+'],\x20getUser\x20entity',_0x41efc6);if(_0x41efc6[_0x7a1a('0xe')]['length']>0x0&&String(_0x41efc6[_0x7a1a('0xe')][0x0]['active'])===_0x7a1a('0x1c')){_0x4c11c1[_0x7a1a('0x1d')]=_0x41efc6[_0x7a1a('0xe')][0x0][_0x7a1a('0x11')];}else{_0x4c11c1[_0x7a1a('0x1d')]=_0x4c11c1[_0x7a1a('0x10')];_0x4c11c1[_0x7a1a('0x18')]=_0x4c11c1[_0x7a1a('0x1e')];}logger['info']('['+[_0x18b527[_0x7a1a('0x13')]()]+_0x7a1a('0x1f'),_0x4c11c1);_0xcbcf02(_0x4c11c1);})[_0x7a1a('0x15')](function(_0x100143){logger[_0x7a1a('0x20')]('['+[_0x18b527[_0x7a1a('0x13')]()]+']',_0x100143['message']);_0x1e648d(_0x100143[_0x7a1a('0x16')]);});}else{logger['info']('['+[_0x18b527[_0x7a1a('0x13')]()]+_0x7a1a('0x21'));_0x4c11c1[_0x7a1a('0x1d')]=_0x4c11c1[_0x7a1a('0x10')];_0x4c11c1[_0x7a1a('0x18')]=_0x4c11c1[_0x7a1a('0x1e')];_0xcbcf02(_0x4c11c1);}});};}function createEndUser(_0x5c2024,_0x44bd8e,_0x30dd41,_0x199643,_0x15207d){logger['info']('['+[_0x5c2024[_0x7a1a('0x13')]()]+_0x7a1a('0x22'),_0x30dd41);return new Promise(function(_0x518827,_0xea4fda){var _0x4ba726={'method':_0x7a1a('0x23'),'uri':_0x199643+_0x7a1a('0x24')+_0x15207d,'body':{'user_name':_0x30dd41[_0x7a1a('0x25')],'roles':_0x7a1a('0x26'),'first_name':_0x30dd41['endUserNumber'],'active':_0x7a1a('0x1c'),'date_format':_0x7a1a('0x27'),'phone':_0x30dd41[_0x7a1a('0x25')]},'auth':_0x44bd8e,'json':!![]};return rp(_0x4ba726)[_0x7a1a('0x1b')](function(_0x4b94f9){logger['info']('['+[_0x5c2024[_0x7a1a('0x13')]()]+_0x7a1a('0x28'),_0x4b94f9[_0x7a1a('0xe')]);_0x30dd41[_0x7a1a('0x29')]=_0x4b94f9[_0x7a1a('0xe')]['sys_id'];_0x518827(_0x30dd41);})['catch'](function(_0x44fa5a){logger[_0x7a1a('0x20')]('['+[_0x5c2024[_0x7a1a('0x13')]()]+']',_0x44fa5a[_0x7a1a('0x16')]);_0xea4fda(_0x44fa5a[_0x7a1a('0x16')]);});});}function getEndUser(_0x461011,_0x183ecb,_0xa08e2e,_0xaeb217,_0x4f42c8){return function(_0x274521){logger['info']('['+[_0x461011[_0x7a1a('0x13')]()]+_0x7a1a('0x2a'),_0x274521);return new Promise(function(_0x1cb9ed,_0x1d66dd){var _0x465306={'method':_0x7a1a('0xc'),'uri':_0xa08e2e+_0x7a1a('0x2b')+_0x274521['endUserNumber']+'&'+_0xaeb217+'&'+_0x4f42c8,'auth':_0x183ecb,'json':!![]};return rp(_0x465306)[_0x7a1a('0x1b')](function(_0x285575){if(_0x285575['result'][_0x7a1a('0xf')]>0x0){_0x274521[_0x7a1a('0x29')]=_0x285575[_0x7a1a('0xe')][0x0]['sys_id'];logger[_0x7a1a('0x12')]('['+[_0x461011[_0x7a1a('0x13')]()]+_0x7a1a('0x2c'),_0x274521);_0x1cb9ed(_0x274521);}else{return createEndUser(_0x461011,_0x183ecb,_0x274521,_0xa08e2e,_0xaeb217)[_0x7a1a('0x1b')](function(_0x37d2be){logger[_0x7a1a('0x12')]('['+[_0x461011['toUpperCase']()]+_0x7a1a('0x2d'),_0x37d2be);_0x1cb9ed(_0x37d2be);});}})[_0x7a1a('0x15')](function(_0x1bb417){logger[_0x7a1a('0x20')]('['+[_0x461011['toUpperCase']()]+']',_0x1bb417[_0x7a1a('0x16')]);_0x1d66dd(_0x1bb417[_0x7a1a('0x16')]);});});};}function getCustomFields(_0x1681c0,_0x431faf){var _0xb40740={};if(_0x1681c0['length']>0x0){_[_0x7a1a('0x2e')](_0x1681c0,function(_0x142caf){if(_[_0x7a1a('0x2f')]([_0x7a1a('0x30'),'picklist'],_0x142caf[_0x7a1a('0x31')])&&_0x142caf[_0x7a1a('0x32')]&&!_0x142caf[_0x7a1a('0x33')]){_0xb40740[_0x142caf[_0x7a1a('0x32')][_0x7a1a('0x34')]()]=_0x142caf[_0x7a1a('0x35')][_0x7a1a('0x36')]();}else if(_[_0x7a1a('0x2f')]([_0x7a1a('0x30'),_0x7a1a('0x37')],_0x142caf['type'])&&_0x142caf[_0x7a1a('0x38')]&&_0x142caf[_0x7a1a('0x33')]){_0xb40740[_0x142caf['idField'][_0x7a1a('0x34')]()]=_0x142caf['content'][_0x7a1a('0x36')]();}else if(_0x142caf['type']===_0x7a1a('0x39')&&_0x142caf['variableName']&&_0x142caf[_0x7a1a('0x38')]&&_0x142caf[_0x7a1a('0x33')]){_0xb40740[_0x142caf[_0x7a1a('0x38')][_0x7a1a('0x34')]()]=_0x431faf[_0x142caf[_0x7a1a('0x3a')]]['toString']();}else if(_0x142caf[_0x7a1a('0x31')]==='customVariable'&&_0x142caf[_0x7a1a('0x3b')]&&_0x142caf[_0x7a1a('0x3b')]['name']&&_0x142caf[_0x7a1a('0x38')]&&_0x142caf[_0x7a1a('0x33')]){_0xb40740[_0x142caf[_0x7a1a('0x38')][_0x7a1a('0x34')]()]=_0x431faf[_0x142caf[_0x7a1a('0x3b')][_0x7a1a('0x3c')]['toLowerCase']()][_0x7a1a('0x36')]();}});}return _0xb40740;}function getTicket(_0x3bf0a1,_0x3dae8c,_0xf2b9bf,_0x33eb5d,_0x4d18d3,_0x27ab01){return function(_0x4dc902){logger[_0x7a1a('0x12')]('['+[_0x3bf0a1[_0x7a1a('0x13')]()]+_0x7a1a('0x3d'),_0x4dc902);return new Promise(function(_0x80a1c,_0x55958c){var _0x5ee789=_0x3bf0a1[_0x7a1a('0x34')]()===_0x7a1a('0x3e')?_0x4dc902[_0x7a1a('0x1d')]:_0x4dc902[_0x7a1a('0x29')];var _0x1123fc={'method':'POST','uri':_0xf2b9bf+_0x7a1a('0x3f')+'?'+_0x27ab01,'body':Object[_0x7a1a('0x40')]({},{'active':_0x7a1a('0x1c'),'caller_id':_0x5ee789,'assigned_to':_0x4dc902[_0x7a1a('0x1d')],'short_description':intUtil[_0x7a1a('0x41')](_0x33eb5d[_0x7a1a('0x42')],_0x4d18d3,'\x20'),'description':intUtil[_0x7a1a('0x41')](_0x33eb5d[_0x7a1a('0x43')],_0x4d18d3,'\x0a')},getCustomFields(_0x33eb5d[_0x7a1a('0x44')],_0x4d18d3)),'auth':_0x3dae8c,'json':!![]};return rp(_0x1123fc)['then'](function(_0x208129){logger['info']('['+[_0x3bf0a1[_0x7a1a('0x13')]()]+_0x7a1a('0x45'),_0x208129[_0x7a1a('0xe')]);_0x4dc902[_0x7a1a('0x46')]=_0x208129[_0x7a1a('0xe')][_0x7a1a('0x11')];_0x4dc902[_0x7a1a('0x47')]=_0x208129[_0x7a1a('0xe')]['number'];logger[_0x7a1a('0x12')]('['+[_0x3bf0a1[_0x7a1a('0x13')]()]+_0x7a1a('0x48'),_0x4dc902);_0x80a1c(_0x4dc902);})['catch'](function(_0x1cc620){logger[_0x7a1a('0x20')]('['+[_0x3bf0a1[_0x7a1a('0x13')]()]+']',_0x1cc620['message']);_0x55958c(_0x1cc620['message']);});});};}function createRemoteTag(_0x5118bf,_0x34626c,_0x10bd43,_0x18e9fd){return new Promise(function(_0x445c4f,_0x2b463a){var _0x11bedb={'method':_0x7a1a('0x23'),'uri':_0x10bd43+_0x7a1a('0x49')+'?'+_0x18e9fd,'body':{'short_description':_0x5118bf,'global':!![],'active':!![],'name':_0x5118bf},'auth':_0x34626c,'json':!![]};return rp(_0x11bedb)[_0x7a1a('0x1b')](function(_0x5e0959){var _0x285ed7=_0x5e0959[_0x7a1a('0xe')][_0x7a1a('0x11')];_0x445c4f(_0x285ed7);});});}function getRemoteTag(_0x214135,_0x15864a,_0x31559e,_0x5decc2,_0x262748){return new Promise(function(_0x2f5ff2,_0x546333){var _0x33757a={'method':_0x7a1a('0xc'),'uri':_0x31559e+_0x7a1a('0x49')+_0x7a1a('0x4a')+_0x214135+'&'+_0x5decc2,'auth':_0x15864a,'json':!![]};return rp(_0x33757a)['then'](function(_0x3b6fec){if(_0x3b6fec[_0x7a1a('0xe')][_0x7a1a('0xf')]>0x0){var _0x894373=_0x3b6fec['result'][0x0][_0x7a1a('0x11')];_0x2f5ff2(_0x894373);}else{return createRemoteTag(_0x214135,_0x15864a,_0x31559e,_0x5decc2)['then'](function(_0x531bec){_0x2f5ff2(_0x531bec);});}});});}function assignTagToIncident(_0x35c5ea,_0x3d17f4,_0x113451,_0x3d594d,_0x4a846d){return new Promise(function(_0x3a80eb,_0x39b416){var _0x355886={'method':_0x7a1a('0x23'),'uri':_0x113451+_0x7a1a('0x4b')+'?'+_0x4a846d,'body':{'label':_0x35c5ea,'table':_0x7a1a('0x3f'),'id_type':_0x7a1a('0x4c'),'table_key':_0x3d594d[_0x7a1a('0x46')],'title':_0x7a1a('0x4d')+_0x3d594d[_0x7a1a('0x47')],'id_display':_0x3d594d[_0x7a1a('0x47')]},'auth':_0x3d17f4,'json':!![]};return rp(_0x355886)[_0x7a1a('0x1b')](function(_0x4d5238){_0x3a80eb();})[_0x7a1a('0x15')](function(){_0x3a80eb();});});}function manageTags(_0x1205f8,_0x5e5bb3,_0x1c783a,_0x1531e8,_0x5e5b6e,_0x4b0044,_0x498e28){return new Promise(function(_0x18c82c,_0x15b9cd){var _0x38a59a=[];_0x5e5bb3[_0x7a1a('0x2e')](function(_0x300be9){_0x38a59a[_0x7a1a('0x4e')](getRemoteTag(_0x300be9,_0x1c783a,_0x1531e8,_0x4b0044,_0x498e28));});return Promise[_0x7a1a('0x4f')](_0x38a59a)[_0x7a1a('0x1b')](function(_0x26cf4c){if(_0x26cf4c[_0x7a1a('0xf')]){logger[_0x7a1a('0x12')]('['+[_0x1205f8[_0x7a1a('0x13')]()]+_0x7a1a('0x50'),_0x26cf4c);var _0x102d12=[];_0x26cf4c[_0x7a1a('0x2e')](function(_0x1b6cb9){_0x102d12[_0x7a1a('0x4e')](assignTagToIncident(_0x1b6cb9,_0x1c783a,_0x1531e8,_0x5e5b6e,_0x4b0044));});return Promise['all'](_0x102d12)[_0x7a1a('0x1b')](function(){_0x18c82c();})[_0x7a1a('0x15')](function(){_0x18c82c();});}else{_0x18c82c();}});});}function getTags(_0x4d84cc,_0x57e6a1,_0x5a9428,_0x15ff8b,_0x242787,_0x52455e){return function(_0xac81f){return new Promise(function(_0x5bbcb4,_0x46bedc){var _0x4facc3=[];var _0x347f9a=_0x15ff8b[_0x7a1a('0x51')];if(_0x347f9a&&_0x347f9a[_0x7a1a('0xf')]>0x0){_0x4facc3=_['map'](_0x347f9a,_0x7a1a('0x3c'));}if(_0x4facc3[_0x7a1a('0xf')]>0x0){return manageTags(_0x4d84cc,_0x4facc3,_0x57e6a1,_0x5a9428,_0xac81f,_0x242787,_0x52455e)['then'](function(){_0x5bbcb4(_0xac81f);});}else{_0x5bbcb4(_0xac81f);}});};}function emit(_0x5cd527,_0x1d04f1,_0x481e2d){var _0x522610='%26sysparm_record_target%3Dincident'+_0x7a1a('0x52')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x236987={'uri':_0x5cd527+_0x7a1a('0x53')+_0x481e2d+_0x522610};io['to'](util[_0x7a1a('0x54')](_0x7a1a('0x55'),_0x1d04f1))[_0x7a1a('0x56')](_0x7a1a('0x57'),_0x236987);}exports['cs']=function(_0x41fa89,_0x183585,_0x326e26,_0x336e6e,_0x96006f,_0x2be9a9,_0x168c3a,_0x268eae){var _0x38225e={};var _0x3d1ec7={'user':_0x2be9a9['username'],'pass':_0x2be9a9['password']};var _0x905ba7='sysparm_limit=1';var _0x532473=_0x7a1a('0x58');_0x2be9a9[_0x7a1a('0x59')]=intUtil[_0x7a1a('0x5a')](_0x2be9a9['remoteUri']);_0x2be9a9['serverUrl']=intUtil[_0x7a1a('0x5a')](_0x2be9a9[_0x7a1a('0x5b')]);var _0x34b0ea=util[_0x7a1a('0x54')]('%s/api/now/table/',_0x2be9a9[_0x7a1a('0x59')]);_0x38225e[_0x7a1a('0x18')]=!_['isNil'](_0x336e6e)?_0x336e6e['email']:null;_0x38225e['adminEmail']=_0x2be9a9['email'];_0x38225e[_0x7a1a('0x25')]=_0x268eae[_0x7a1a('0x34')]()===_0x7a1a('0x3e')?_0x183585[_0x7a1a('0x5c')]:_0x183585[_0x7a1a('0x5d')];_0x38225e[_0x7a1a('0x5e')]=_0x268eae==='queue'||_0x268eae===_0x7a1a('0x5f')?_0x7a1a('0x60'):_0x7a1a('0x3e');var _0x3557e5=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2be9a9['serverUrl'],_0x183585[_0x7a1a('0x61')],md5(_0x183585[_0x7a1a('0x61')]));if(_0x96006f&&_0x96006f['monitor_format']){logger[_0x7a1a('0x12')](_0x7a1a('0x62'),'Recording\x20is\x20enabled!');_0x183585[_0x7a1a('0x63')]=_0x3557e5;}else if(_0x168c3a&&_0x168c3a[_0x7a1a('0x64')]&&_0x168c3a['recordingFormat']!=='none'){logger[_0x7a1a('0x12')](_0x7a1a('0x65'),_0x7a1a('0x66'));_0x183585[_0x7a1a('0x63')]=_0x3557e5;}else{_0x183585[_0x7a1a('0x63')]='';}return getAdminUser(_0x268eae,_0x3d1ec7,_0x38225e,_0x34b0ea,_0x532473,_0x905ba7)[_0x7a1a('0x1b')](getUser(_0x268eae,_0x3d1ec7,_0x34b0ea,_0x532473,_0x905ba7))[_0x7a1a('0x1b')](getEndUser(_0x268eae,_0x3d1ec7,_0x34b0ea,_0x532473,_0x905ba7))[_0x7a1a('0x1b')](getTicket(_0x268eae,_0x3d1ec7,_0x34b0ea,_0x326e26,_0x183585,_0x532473))[_0x7a1a('0x1b')](function(_0x5549f7){logger[_0x7a1a('0x12')](util[_0x7a1a('0x54')](_0x7a1a('0x67'),_0x5549f7['ticketId']));logger['info'](util[_0x7a1a('0x54')](_0x7a1a('0x68'),_0x268eae));if(_0x268eae!==_0x7a1a('0x5f')){logger[_0x7a1a('0x12')]('['+[_0x268eae['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2be9a9[_0x7a1a('0x59')],_0x336e6e[_0x7a1a('0x3c')],_0x5549f7['ticketId']);}})['catch'](function(_0x23b944){logger[_0x7a1a('0x20')]('['+[_0x268eae[_0x7a1a('0x13')]()]+_0x7a1a('0x69'),util[_0x7a1a('0x6a')](_0x23b944,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 057692c..3fa21d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb143=['Getting\x20agent\x20with\x20name','stringify','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','entry_list','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','debug','[HTTP]','map','forEach','type','nameField','toLowerCase','content','string','customField','custom_fields','variable','Variable','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','none','destcalleridnum','users','version','[OUTBOUND]','unmanaged','lastevent','toUpperCase','isNil','lodash','bluebird','md5','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','variableName','push','idField','JSON','Calls','apiKey','toString','base64','get_server_info'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb143,0x131));var _0x3b14=function(_0x5dbdc4,_0x26c990){_0x5dbdc4=_0x5dbdc4-0x0;var _0x35634e=_0xb143[_0x5dbdc4];return _0x35634e;};'use strict';var _=require(_0x3b14('0x0'));var rp=require('request-promise');var BPromise=require(_0x3b14('0x1'));var md5=require(_0x3b14('0x2'));var util=require('util');var Redis=require(_0x3b14('0x3'));var intUtil=require(_0x3b14('0x4'));var config=require('../../../../config/environment');var logger=require(_0x3b14('0x5'))(_0x3b14('0x6'));config[_0x3b14('0x7')]=_[_0x3b14('0x8')](config[_0x3b14('0x7')],{'host':_0x3b14('0x9'),'port':0x18eb});var io=require(_0x3b14('0xa'))(new Redis(config[_0x3b14('0x7')]));var def={'method':_0x3b14('0xb'),'json':!![]};function emit(_0x3c1ddc,_0x16a9ad,_0x1cebd0){io['to'](_0x3c1ddc)['emit'](_0x16a9ad,_0x1cebd0);}function getTicket(_0x3565fb,_0x3fdb93,_0x43a14e,_0x580f25,_0x522d0d,_0x5df536,_0x2157b3,_0x18f569){logger[_0x3b14('0xc')](_0x3b14('0xd'));var _0x169538=new Date();var _0x569d36=[{'name':_0x3b14('0xe'),'value':intUtil[_0x3b14('0xf')](_0x580f25['Subjects'],_0x522d0d,'\x20')},{'name':_0x3b14('0x10'),'value':_0x3fdb93['id']},{'name':'created_by','value':_0x3fdb93['id']},{'name':'description','value':intUtil[_0x3b14('0xf')](_0x580f25[_0x3b14('0x11')],_0x522d0d,'\x0a')},{'name':_0x3b14('0x12'),'value':_0x169538[_0x3b14('0x13')]()[_0x3b14('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0x3b14('0x15'),'value':'0'},{'name':_0x3b14('0x16'),'value':'15'},{'name':_0x3b14('0x17'),'value':_0x43a14e['id']},{'name':_0x3b14('0x18'),'value':_0x3b14('0x19')},{'name':'parent_name','value':_0x43a14e[_0x3b14('0xe')]},{'name':_0x3b14('0x1a'),'value':_0x18f569}];if(_0x5df536[_0x3b14('0x1b')]){_['forEach'](_0x5df536,function(_0x2a777e){if(_0x522d0d[_0x2a777e[_0x3b14('0x1c')]]){_0x569d36[_0x3b14('0x1d')]({'name':_0x2a777e[_0x3b14('0x1e')],'value':_0x522d0d[_0x2a777e[_0x3b14('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x3b14('0x1f'),'response_type':_0x3b14('0x1f'),'rest_data':JSON['stringify']({'session':_0x2157b3['id'],'module_name':_0x3b14('0x20'),'name_value_list':_0x569d36})}});}function getAuth(_0x11a322){return util['format']('Basic\x20%s',new Buffer(_0x11a322[_0x3b14('0x21')]+':X')[_0x3b14('0x22')](_0x3b14('0x23')));}function getServerInfo(_0x438066){return request({'form':{'method':_0x3b14('0x24'),'input_type':_0x3b14('0x1f'),'response_type':_0x3b14('0x1f'),'rest_data':JSON['stringify']({'session':_0x438066['id']})}});}function getUser(_0x44a057,_0x20a8b9,_0x42af98){if(!_['isNil'](_0x20a8b9)){logger[_0x3b14('0xc')](_0x3b14('0x25'),_0x20a8b9);return request({'form':{'method':'get_entry_list','input_type':_0x3b14('0x1f'),'response_type':'JSON','rest_data':JSON[_0x3b14('0x26')]({'session':_0x42af98['id'],'module_name':'Employees','query':util[_0x3b14('0x27')](_0x3b14('0x28'),_0x20a8b9),'order_by':'','offset':'0','select_fields':['id','name',_0x3b14('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3b14('0x2a')](function(_0xe11220){if(_0xe11220['entry_list'][_0x3b14('0x1b')]){var _0x609c87=_[_0x3b14('0x2b')](_0xe11220['entry_list'],function(_0x5137e4){return _0x5137e4[_0x3b14('0x2c')]['user_name'][_0x3b14('0x2d')]===_0x20a8b9;});if(_0x609c87){logger['info'](_0x3b14('0x2e'));return BPromise[_0x3b14('0x2f')]({'id':_0x609c87[_0x3b14('0x2c')]['id'][_0x3b14('0x2d')],'name':_0x609c87['name_value_list'][_0x3b14('0xe')][_0x3b14('0x2d')]});}}logger[_0x3b14('0xc')](_0x3b14('0x30'));return BPromise[_0x3b14('0x2f')]({'id':_0x42af98[_0x3b14('0x2c')][_0x3b14('0x31')][_0x3b14('0x2d')],'name':_0x42af98[_0x3b14('0x2c')][_0x3b14('0x29')]['value']});});}else{logger['info'](_0x3b14('0x32'));return BPromise[_0x3b14('0x2f')]({'id':_0x42af98[_0x3b14('0x2c')][_0x3b14('0x31')]['value'],'name':_0x42af98['name_value_list']['user_name']['value']});}}function getEndUser(_0x221c21,_0x3a64f3,_0x208850,_0x22c633){logger[_0x3b14('0xc')](_0x3b14('0x33'),_0x208850);return request({'form':{'method':'get_entry_list','input_type':_0x3b14('0x1f'),'response_type':_0x3b14('0x1f'),'rest_data':JSON[_0x3b14('0x26')]({'session':_0x22c633['id'],'module_name':_0x3b14('0x19'),'query':util[_0x3b14('0x27')](_0x3b14('0x34'),_0x208850),'order_by':'','offset':'0','select_fields':['id','name',_0x3b14('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3b14('0x2a')](function(_0x552988){if(_0x552988[_0x3b14('0x36')][_0x3b14('0x1b')]){var _0x25bde3=_[_0x3b14('0x2b')](_0x552988['entry_list'],function(_0x4d4bfa){return _0x4d4bfa[_0x3b14('0x2c')]['phone_home'][_0x3b14('0x2d')]===_0x208850;});if(_0x25bde3){logger[_0x3b14('0xc')](_0x3b14('0x37'));return BPromise[_0x3b14('0x2f')]({'id':_0x25bde3['name_value_list']['id'][_0x3b14('0x2d')],'name':_0x25bde3[_0x3b14('0x2c')][_0x3b14('0xe')][_0x3b14('0x2d')],'phone':_0x25bde3[_0x3b14('0x2c')][_0x3b14('0x35')]['value']});}}else{logger[_0x3b14('0xc')](_0x3b14('0x38'));return request({'form':{'method':_0x3b14('0x39'),'input_type':_0x3b14('0x1f'),'response_type':_0x3b14('0x1f'),'rest_data':JSON[_0x3b14('0x26')]({'session':_0x22c633['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3b14('0x3a'),'value':_0x3a64f3!==_0x3b14('0x3b')?_0x3a64f3:util[_0x3b14('0x27')]('Caller\x20-\x20%s',_0x208850)},{'name':'phone_home','value':_0x208850}]})}})['then'](function(_0x58d109){logger['info']('Enduser\x20created.');return BPromise[_0x3b14('0x2f')]({'id':_0x58d109['id'],'name':_0x58d109['entry_list']['first_name'][_0x3b14('0x2d')],'phone':_0x58d109[_0x3b14('0x36')]['phone_home'][_0x3b14('0x2d')]});});}});}function request(_0x1b87e2){logger[_0x3b14('0x3c')](_0x3b14('0x3d'),JSON['stringify'](_0x1b87e2));return rp(_['merge'](def,_0x1b87e2));}function getTags(_0x27bbc0,_0x3abc2a){var _0x55e6a4=[];if(_0x27bbc0&&_0x27bbc0[_0x3b14('0x1b')]>0x0){_0x55e6a4=_[_0x3b14('0x3e')](_0x27bbc0,_0x3abc2a);}return _0x55e6a4;}function getCustomFields(_0x29bac5,_0x30bde0){var _0x48cb87=[];var _0x1676ac={'custom_fields':[]};if(_0x29bac5['length']>0x0){_[_0x3b14('0x3f')](_0x29bac5,function(_0x1f2eae){if(_0x1f2eae[_0x3b14('0x40')]==='string'&&_0x1f2eae[_0x3b14('0x41')]&&!_0x1f2eae['customField']){_0x1676ac[_0x1f2eae[_0x3b14('0x41')][_0x3b14('0x42')]()]=_0x1f2eae[_0x3b14('0x43')][_0x3b14('0x22')]();}else if(_0x1f2eae[_0x3b14('0x40')]===_0x3b14('0x44')&&_0x1f2eae[_0x3b14('0x1e')]&&_0x1f2eae[_0x3b14('0x45')]){_0x1676ac[_0x3b14('0x46')]['push']({'id':_0x1f2eae[_0x3b14('0x1e')],'value':_0x1f2eae[_0x3b14('0x43')][_0x3b14('0x22')]()});}else if(_0x1f2eae[_0x3b14('0x40')]===_0x3b14('0x47')&&_0x1f2eae['variableName']&&_0x1f2eae[_0x3b14('0x1e')]&&_0x1f2eae[_0x3b14('0x45')]){_0x30bde0[_0x1f2eae[_0x3b14('0x1c')]]&&_0x1676ac[_0x3b14('0x46')][_0x3b14('0x1d')]({'id':_0x1f2eae['idField'],'value':_0x30bde0[_0x1f2eae[_0x3b14('0x1c')]][_0x3b14('0x22')]()});}else if(_0x1f2eae[_0x3b14('0x40')]==='customVariable'&&_0x1f2eae[_0x3b14('0x48')]&&_0x1f2eae[_0x3b14('0x48')][_0x3b14('0xe')]&&_0x1f2eae[_0x3b14('0x1e')]&&_0x1f2eae[_0x3b14('0x45')]){_0x30bde0[_0x1f2eae[_0x3b14('0x48')][_0x3b14('0xe')]['toLowerCase']()]&&_0x1676ac[_0x3b14('0x46')]['push']({'id':_0x1f2eae[_0x3b14('0x1e')],'value':_0x30bde0[_0x1f2eae[_0x3b14('0x48')][_0x3b14('0xe')][_0x3b14('0x42')]()][_0x3b14('0x22')]()});}});}return _0x1676ac;}function getConnection(_0x382365){return request({'method':_0x3b14('0xb'),'form':{'method':'login','input_type':_0x3b14('0x1f'),'response_type':_0x3b14('0x1f'),'rest_data':JSON[_0x3b14('0x26')]({'user_auth':{'user_name':_0x382365['username'],'password':_0x382365['password'],'encryption':_0x3b14('0x49')},'application':_0x3b14('0x4a')})}})[_0x3b14('0x2a')](function(_0x31473b){var _0x39ffc3=_0x31473b;if(_0x39ffc3['id']){def[_0x3b14('0x4b')]=_0x39ffc3['id'];return BPromise[_0x3b14('0x2f')](_0x39ffc3);}else{throw new Error(util[_0x3b14('0x27')]('Account\x20%d\x20is\x20not\x20valid',_0x382365['id']));}});}function setRelationship(_0x3d3e04,_0x40144e,_0x32169d,_0x35746e){return request({'form':{'method':_0x3b14('0x4c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3b14('0x26')]({'session':_0x3d3e04['id'],'module_name':_0x3b14('0x20'),'module_id':_0x32169d['id'],'link_field_name':_0x35746e,'related_ids':[_0x40144e['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3b95f3,_0x27f8c4,_0x3a54ce,_0x59c3cc,_0x271bfb,_0x32a614){var _0x34297c,_0xcf6ad,_0x398066,_0x27d214;_0x32a614[_0x3b14('0x4d')]=intUtil['stripTrailingSlash'](_0x32a614['remoteUri']);_0x32a614['serverUrl']=intUtil[_0x3b14('0x4e')](_0x32a614[_0x3b14('0x4f')]);def[_0x3b14('0x50')]=util[_0x3b14('0x27')]('%s/service/v4_1/rest.php',_0x32a614[_0x3b14('0x4d')]);if(_0x271bfb&&_0x271bfb[_0x3b14('0x51')]){logger[_0x3b14('0xc')]('[QUEUE]',_0x3b14('0x52'));_0x27f8c4[_0x3b14('0x53')]=util[_0x3b14('0x27')](_0x3b14('0x54'),_0x32a614[_0x3b14('0x4f')],_0x27f8c4[_0x3b14('0x55')],md5(_0x27f8c4['uniqueid']));}else{_0x27f8c4['recordingURL']='';}return getConnection(_0x32a614)[_0x3b14('0x2a')](function(_0x584977){_0x27d214=_0x584977;return getUser(_0x32a614,_0x59c3cc['name'],_0x27d214);})[_0x3b14('0x2a')](function(_0x2c5940){_0x34297c=_0x2c5940;logger['info'](_0x3b14('0x56'),_0x34297c['id']);return getEndUser(_0x32a614,_0x27f8c4[_0x3b14('0x57')],_0x27f8c4[_0x3b14('0x58')],_0x27d214);})[_0x3b14('0x2a')](function(_0x4fae8b){_0xcf6ad=_0x4fae8b;logger[_0x3b14('0xc')](_0x3b14('0x59'),_0xcf6ad['id']);return getTicket(_0x32a614,_0x34297c,_0xcf6ad,_0x3a54ce,_0x27f8c4,_0x3a54ce[_0x3b14('0x5a')],_0x27d214,_0x3b14('0x5b'));})[_0x3b14('0x2a')](function(_0x31a5b7){_0x398066=_0x31a5b7;logger[_0x3b14('0xc')](_0x3b14('0x5c'));logger[_0x3b14('0xc')](_0x3b14('0x5d'),_0x398066['id']);return setRelationship(_0x27d214,_0x34297c,_0x398066,'users');})[_0x3b14('0x2a')](function(){return setRelationship(_0x27d214,_0xcf6ad,_0x398066,_0x3b14('0x5e'));})[_0x3b14('0x2a')](function(){return getServerInfo(_0x27d214);})[_0x3b14('0x2a')](function(_0x206b01){var _0x3feb94=parseInt(_0x206b01['version'][_0x3b14('0x5f')](0x0));var _0x9bb0b2=util[_0x3b14('0x27')](_0x3b14('0x60'),_0x32a614[_0x3b14('0x4d')],_0x398066['id']);if(_0x3feb94>0x6){_0x9bb0b2=util[_0x3b14('0x27')](_0x3b14('0x61'),_0x32a614[_0x3b14('0x4d')],_0x398066['id']);}logger[_0x3b14('0xc')](_0x3b14('0x62'),_0x3b14('0x63'));emit(util[_0x3b14('0x27')](_0x3b14('0x64'),_0x59c3cc['name']),_0x3b14('0x65'),{'uri':_0x9bb0b2});})[_0x3b14('0x66')](function(_0x2c087e){logger[_0x3b14('0x67')](_0x3b14('0x62'),JSON[_0x3b14('0x26')](_0x2c087e));});};exports[_0x3b14('0x68')]=function(_0x213d4c,_0x27eeee,_0x484341,_0x5a7098,_0x292c53,_0x336834,_0x462ae8){var _0x30b691,_0x3d17dc,_0x3acfe9,_0x518d5a;_0x336834[_0x3b14('0x4d')]=intUtil[_0x3b14('0x4e')](_0x336834['remoteUri']);_0x336834['serverUrl']=intUtil[_0x3b14('0x4e')](_0x336834['serverUrl']);def[_0x3b14('0x50')]=util[_0x3b14('0x27')]('%s/service/v4_1/rest.php',_0x336834['remoteUri']);if(_0x462ae8&&_0x462ae8['recordingFormat']&&_0x462ae8['recordingFormat']!==_0x3b14('0x69')){logger['info']('[OUTBOUND]',_0x3b14('0x52'));_0x27eeee[_0x3b14('0x53')]=util[_0x3b14('0x27')](_0x3b14('0x54'),_0x336834[_0x3b14('0x4f')],_0x27eeee[_0x3b14('0x55')],md5(_0x27eeee[_0x3b14('0x55')]));}return getConnection(_0x336834)[_0x3b14('0x2a')](function(_0x447ae2){_0x518d5a=_0x447ae2;return getUser(_0x336834,_0x5a7098[_0x3b14('0xe')],_0x518d5a);})[_0x3b14('0x2a')](function(_0x4dc0ca){_0x30b691=_0x4dc0ca;logger[_0x3b14('0xc')](_0x3b14('0x56'),_0x30b691['id']);return getEndUser(_0x336834,_0x27eeee['destcalleridname'],_0x27eeee[_0x3b14('0x6a')],_0x518d5a);})[_0x3b14('0x2a')](function(_0x12c950){_0x3d17dc=_0x12c950;logger['info'](_0x3b14('0x59'),_0x3d17dc['id']);return getTicket(_0x336834,_0x30b691,_0x3d17dc,_0x484341,_0x27eeee,_0x484341[_0x3b14('0x5a')],_0x518d5a,'Outbound');})[_0x3b14('0x2a')](function(_0x58195a){_0x3acfe9=_0x58195a;logger[_0x3b14('0xc')]('Ticket\x20created!');logger[_0x3b14('0xc')](_0x3b14('0x5d'),_0x3acfe9['id']);return setRelationship(_0x518d5a,_0x30b691,_0x3acfe9,_0x3b14('0x6b'));})['then'](function(){return setRelationship(_0x518d5a,_0x3d17dc,_0x3acfe9,_0x3b14('0x5e'));})[_0x3b14('0x2a')](function(){return getServerInfo(_0x518d5a);})['then'](function(_0x4d681d){var _0x4dcc0c=parseInt(_0x4d681d[_0x3b14('0x6c')][_0x3b14('0x5f')](0x0));var _0x74ccf1=util[_0x3b14('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x336834[_0x3b14('0x4d')],_0x3acfe9['id']);if(_0x4dcc0c>0x6){_0x74ccf1=util['format'](_0x3b14('0x61'),_0x336834[_0x3b14('0x4d')],_0x3acfe9['id']);}logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x3b14('0x64'),_0x5a7098[_0x3b14('0xe')]),_0x3b14('0x65'),{'uri':_0x74ccf1});})[_0x3b14('0x66')](function(_0x4a171f){logger[_0x3b14('0x67')](_0x3b14('0x6d'),JSON[_0x3b14('0x26')](_0x4a171f));});};exports[_0x3b14('0x6e')]=function(_0x41e83e,_0x44078d,_0x199efe,_0x44ba7a,_0x5bf0c1,_0x2852b2){var _0x54508e,_0x50a07e,_0x2b5815,_0x4bf8e2;_0x2852b2[_0x3b14('0x4d')]=intUtil['stripTrailingSlash'](_0x2852b2[_0x3b14('0x4d')]);_0x2852b2['serverUrl']=intUtil['stripTrailingSlash'](_0x2852b2[_0x3b14('0x4f')]);def[_0x3b14('0x50')]=util[_0x3b14('0x27')]('%s/service/v4_1/rest.php',_0x2852b2['remoteUri']);if(_0x5bf0c1&&_0x5bf0c1[_0x3b14('0x51')]){logger[_0x3b14('0xc')]('['+_0x44078d[_0x3b14('0x6f')][_0x3b14('0x70')]()+']',_0x3b14('0x52'));_0x44078d[_0x3b14('0x53')]=util[_0x3b14('0x27')](_0x3b14('0x54'),_0x2852b2[_0x3b14('0x4f')],_0x44078d['uniqueid'],md5(_0x44078d[_0x3b14('0x55')]));}else{_0x44078d[_0x3b14('0x53')]='';}return getConnection(_0x2852b2)[_0x3b14('0x2a')](function(_0xad18cd){_0x4bf8e2=_0xad18cd;if(!_[_0x3b14('0x71')](_0x44ba7a)){return getUser(_0x2852b2,_0x44ba7a[_0x3b14('0xe')],_0x4bf8e2);}else{return getUser(_0x2852b2,null,_0x4bf8e2);}})[_0x3b14('0x2a')](function(_0x9cc648){_0x54508e=_0x9cc648;logger[_0x3b14('0xc')]('The\x20User\x20ID\x20is:',_0x54508e['id']);return getEndUser(_0x2852b2,_0x44078d['calleridname'],_0x44078d[_0x3b14('0x58')],_0x4bf8e2);})['then'](function(_0x588078){_0x50a07e=_0x588078;logger['info'](_0x3b14('0x59'),_0x50a07e['id']);return getTicket(_0x2852b2,_0x54508e,_0x50a07e,_0x199efe,_0x44078d,_0x199efe['Fields'],_0x4bf8e2,_0x3b14('0x5b'));})[_0x3b14('0x2a')](function(_0x5d6b96){_0x2b5815=_0x5d6b96;logger[_0x3b14('0xc')](_0x3b14('0x5c'));logger[_0x3b14('0xc')](_0x3b14('0x5d'),_0x2b5815['id']);return setRelationship(_0x4bf8e2,_0x54508e,_0x2b5815,_0x3b14('0x6b'));})[_0x3b14('0x2a')](function(){return setRelationship(_0x4bf8e2,_0x50a07e,_0x2b5815,'contacts');})[_0x3b14('0x2a')](function(){return getServerInfo(_0x4bf8e2);})['catch'](function(_0x27d4a2){logger['error']('['+_0x44078d[_0x3b14('0x6f')]['toUpperCase']()+']',JSON[_0x3b14('0x26')](_0x27d4a2));});};
\ No newline at end of file
+var _0xbe22=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','trigger:browser:url','error','outbound','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Outbound','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','lastevent','isNil','The\x20User\x20ID\x20is:','calleridname','Fields','toUpperCase','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','debug','merge','map','type','string','customField','nameField','toLowerCase','custom_fields','content','variable','customVariable','Variable','POST','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s'];(function(_0xe809fd,_0x1a654b){var _0x5a24bd=function(_0xf08894){while(--_0xf08894){_0xe809fd['push'](_0xe809fd['shift']());}};_0x5a24bd(++_0x1a654b);}(_0xbe22,0x189));var _0x2be2=function(_0x2036a3,_0x10ce5a){_0x2036a3=_0x2036a3-0x0;var _0xf7f65e=_0xbe22[_0x2036a3];return _0xf7f65e;};'use strict';var _=require('lodash');var rp=require(_0x2be2('0x0'));var BPromise=require(_0x2be2('0x1'));var md5=require('md5');var util=require(_0x2be2('0x2'));var Redis=require(_0x2be2('0x3'));var intUtil=require(_0x2be2('0x4'));var config=require(_0x2be2('0x5'));var logger=require(_0x2be2('0x6'))('sugarcrm');config[_0x2be2('0x7')]=_[_0x2be2('0x8')](config[_0x2be2('0x7')],{'host':_0x2be2('0x9'),'port':0x18eb});var io=require(_0x2be2('0xa'))(new Redis(config[_0x2be2('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x3bb958,_0x15730f,_0x5bddf0){io['to'](_0x3bb958)[_0x2be2('0xb')](_0x15730f,_0x5bddf0);}function getTicket(_0x1904e1,_0x3f6435,_0x5b92e8,_0x5e65e7,_0x33b46e,_0x87495b,_0x9888e1,_0xbc70ec){logger[_0x2be2('0xc')](_0x2be2('0xd'));var _0x37ad71=new Date();var _0x454b88=[{'name':_0x2be2('0xe'),'value':intUtil[_0x2be2('0xf')](_0x5e65e7['Subjects'],_0x33b46e,'\x20')},{'name':_0x2be2('0x10'),'value':_0x3f6435['id']},{'name':_0x2be2('0x11'),'value':_0x3f6435['id']},{'name':_0x2be2('0x12'),'value':intUtil[_0x2be2('0xf')](_0x5e65e7[_0x2be2('0x13')],_0x33b46e,'\x0a')},{'name':_0x2be2('0x14'),'value':_0x37ad71[_0x2be2('0x15')]()['slice'](0x0,0x13)[_0x2be2('0x16')]('T','\x20')},{'name':_0x2be2('0x17'),'value':'0'},{'name':_0x2be2('0x18'),'value':'15'},{'name':_0x2be2('0x19'),'value':_0x5b92e8['id']},{'name':_0x2be2('0x1a'),'value':'Contacts'},{'name':_0x2be2('0x1b'),'value':_0x5b92e8[_0x2be2('0xe')]},{'name':_0x2be2('0x1c'),'value':_0xbc70ec}];if(_0x87495b[_0x2be2('0x1d')]){_[_0x2be2('0x1e')](_0x87495b,function(_0x558dd4){if(_0x33b46e[_0x558dd4[_0x2be2('0x1f')]]){_0x454b88[_0x2be2('0x20')]({'name':_0x558dd4[_0x2be2('0x21')],'value':_0x33b46e[_0x558dd4[_0x2be2('0x1f')]]});}});}return request({'form':{'method':_0x2be2('0x22'),'input_type':_0x2be2('0x23'),'response_type':_0x2be2('0x23'),'rest_data':JSON[_0x2be2('0x24')]({'session':_0x9888e1['id'],'module_name':_0x2be2('0x25'),'name_value_list':_0x454b88})}});}function getAuth(_0x50c464){return util['format'](_0x2be2('0x26'),new Buffer(_0x50c464[_0x2be2('0x27')]+':X')[_0x2be2('0x28')](_0x2be2('0x29')));}function getServerInfo(_0x502d21){return request({'form':{'method':_0x2be2('0x2a'),'input_type':_0x2be2('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x502d21['id']})}});}function getUser(_0x20023a,_0xeb6d8f,_0x31d924){if(!_['isNil'](_0xeb6d8f)){logger[_0x2be2('0xc')](_0x2be2('0x2b'),_0xeb6d8f);return request({'form':{'method':_0x2be2('0x2c'),'input_type':_0x2be2('0x23'),'response_type':_0x2be2('0x23'),'rest_data':JSON[_0x2be2('0x24')]({'session':_0x31d924['id'],'module_name':_0x2be2('0x2d'),'query':util[_0x2be2('0x2e')](_0x2be2('0x2f'),_0xeb6d8f),'order_by':'','offset':'0','select_fields':['id','name',_0x2be2('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2be2('0x31')](function(_0x4147c2){if(_0x4147c2[_0x2be2('0x32')][_0x2be2('0x1d')]){var _0x2d395f=_[_0x2be2('0x33')](_0x4147c2[_0x2be2('0x32')],function(_0x492247){return _0x492247[_0x2be2('0x34')][_0x2be2('0x30')][_0x2be2('0x35')]===_0xeb6d8f;});if(_0x2d395f){logger['info'](_0x2be2('0x36'));return BPromise[_0x2be2('0x37')]({'id':_0x2d395f['name_value_list']['id'][_0x2be2('0x35')],'name':_0x2d395f[_0x2be2('0x34')]['name'][_0x2be2('0x35')]});}}logger[_0x2be2('0xc')](_0x2be2('0x38'));return BPromise[_0x2be2('0x37')]({'id':_0x31d924[_0x2be2('0x34')]['user_id'][_0x2be2('0x35')],'name':_0x31d924[_0x2be2('0x34')][_0x2be2('0x30')][_0x2be2('0x35')]});});}else{logger[_0x2be2('0xc')](_0x2be2('0x39'));return BPromise[_0x2be2('0x37')]({'id':_0x31d924[_0x2be2('0x34')]['user_id'][_0x2be2('0x35')],'name':_0x31d924[_0x2be2('0x34')][_0x2be2('0x30')][_0x2be2('0x35')]});}}function getEndUser(_0x3fc591,_0x4db8ae,_0x4888b4,_0x30c4e7){logger['info'](_0x2be2('0x3a'),_0x4888b4);return request({'form':{'method':_0x2be2('0x2c'),'input_type':_0x2be2('0x23'),'response_type':_0x2be2('0x23'),'rest_data':JSON[_0x2be2('0x24')]({'session':_0x30c4e7['id'],'module_name':_0x2be2('0x3b'),'query':util[_0x2be2('0x2e')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x4888b4),'order_by':'','offset':'0','select_fields':['id','name',_0x2be2('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2be2('0x31')](function(_0x5ec5b3){if(_0x5ec5b3[_0x2be2('0x32')]['length']){var _0x27d771=_['find'](_0x5ec5b3[_0x2be2('0x32')],function(_0x514e30){return _0x514e30[_0x2be2('0x34')]['phone_home'][_0x2be2('0x35')]===_0x4888b4;});if(_0x27d771){logger[_0x2be2('0xc')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x27d771[_0x2be2('0x34')]['id'][_0x2be2('0x35')],'name':_0x27d771[_0x2be2('0x34')][_0x2be2('0xe')][_0x2be2('0x35')],'phone':_0x27d771['name_value_list'][_0x2be2('0x3c')]['value']});}}else{logger[_0x2be2('0xc')](_0x2be2('0x3d'));return request({'form':{'method':_0x2be2('0x22'),'input_type':_0x2be2('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x30c4e7['id'],'module_name':_0x2be2('0x3b'),'name_value_list':[{'name':_0x2be2('0x3e'),'value':_0x4db8ae!==_0x2be2('0x3f')?_0x4db8ae:util[_0x2be2('0x2e')](_0x2be2('0x40'),_0x4888b4)},{'name':_0x2be2('0x3c'),'value':_0x4888b4}]})}})[_0x2be2('0x31')](function(_0x633ea1){logger[_0x2be2('0xc')]('Enduser\x20created.');return BPromise[_0x2be2('0x37')]({'id':_0x633ea1['id'],'name':_0x633ea1['entry_list']['first_name'][_0x2be2('0x35')],'phone':_0x633ea1[_0x2be2('0x32')][_0x2be2('0x3c')][_0x2be2('0x35')]});});}});}function request(_0x17ca9f){logger[_0x2be2('0x41')]('[HTTP]',JSON[_0x2be2('0x24')](_0x17ca9f));return rp(_[_0x2be2('0x42')](def,_0x17ca9f));}function getTags(_0x5316e7,_0x1b99a0){var _0x141f5f=[];if(_0x5316e7&&_0x5316e7[_0x2be2('0x1d')]>0x0){_0x141f5f=_[_0x2be2('0x43')](_0x5316e7,_0x1b99a0);}return _0x141f5f;}function getCustomFields(_0x424107,_0x849d7f){var _0x500d04=[];var _0x605490={'custom_fields':[]};if(_0x424107[_0x2be2('0x1d')]>0x0){_[_0x2be2('0x1e')](_0x424107,function(_0x12e212){if(_0x12e212[_0x2be2('0x44')]===_0x2be2('0x45')&&_0x12e212['nameField']&&!_0x12e212[_0x2be2('0x46')]){_0x605490[_0x12e212[_0x2be2('0x47')][_0x2be2('0x48')]()]=_0x12e212['content'][_0x2be2('0x28')]();}else if(_0x12e212[_0x2be2('0x44')]===_0x2be2('0x45')&&_0x12e212['idField']&&_0x12e212[_0x2be2('0x46')]){_0x605490[_0x2be2('0x49')][_0x2be2('0x20')]({'id':_0x12e212['idField'],'value':_0x12e212[_0x2be2('0x4a')][_0x2be2('0x28')]()});}else if(_0x12e212[_0x2be2('0x44')]===_0x2be2('0x4b')&&_0x12e212[_0x2be2('0x1f')]&&_0x12e212['idField']&&_0x12e212[_0x2be2('0x46')]){_0x849d7f[_0x12e212[_0x2be2('0x1f')]]&&_0x605490['custom_fields']['push']({'id':_0x12e212[_0x2be2('0x21')],'value':_0x849d7f[_0x12e212[_0x2be2('0x1f')]][_0x2be2('0x28')]()});}else if(_0x12e212['type']===_0x2be2('0x4c')&&_0x12e212[_0x2be2('0x4d')]&&_0x12e212[_0x2be2('0x4d')][_0x2be2('0xe')]&&_0x12e212[_0x2be2('0x21')]&&_0x12e212[_0x2be2('0x46')]){_0x849d7f[_0x12e212[_0x2be2('0x4d')]['name'][_0x2be2('0x48')]()]&&_0x605490[_0x2be2('0x49')][_0x2be2('0x20')]({'id':_0x12e212['idField'],'value':_0x849d7f[_0x12e212[_0x2be2('0x4d')][_0x2be2('0xe')][_0x2be2('0x48')]()][_0x2be2('0x28')]()});}});}return _0x605490;}function getConnection(_0x2518ce){return request({'method':_0x2be2('0x4e'),'form':{'method':_0x2be2('0x4f'),'input_type':_0x2be2('0x23'),'response_type':_0x2be2('0x23'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2518ce[_0x2be2('0x50')],'password':_0x2518ce['password'],'encryption':_0x2be2('0x51')},'application':_0x2be2('0x52')})}})[_0x2be2('0x31')](function(_0x5a0422){var _0x3947c9=_0x5a0422;if(_0x3947c9['id']){def[_0x2be2('0x53')]=_0x3947c9['id'];return BPromise['resolve'](_0x3947c9);}else{throw new Error(util[_0x2be2('0x2e')]('Account\x20%d\x20is\x20not\x20valid',_0x2518ce['id']));}});}function setRelationship(_0xad5e58,_0x251f93,_0x2c63af,_0x16f18d){return request({'form':{'method':_0x2be2('0x54'),'input_type':'JSON','response_type':_0x2be2('0x23'),'rest_data':JSON[_0x2be2('0x24')]({'session':_0xad5e58['id'],'module_name':_0x2be2('0x25'),'module_id':_0x2c63af['id'],'link_field_name':_0x16f18d,'related_ids':[_0x251f93['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2be2('0x55')]=function(_0x2428d8,_0x180d0b,_0x55b2d7,_0x5e3aca,_0x10c658,_0x38d773){var _0x5c0bac,_0x594fb9,_0x392fe2,_0x28a9ad;_0x38d773['remoteUri']=intUtil[_0x2be2('0x56')](_0x38d773[_0x2be2('0x57')]);_0x38d773['serverUrl']=intUtil[_0x2be2('0x56')](_0x38d773[_0x2be2('0x58')]);def['uri']=util['format'](_0x2be2('0x59'),_0x38d773[_0x2be2('0x57')]);if(_0x10c658&&_0x10c658[_0x2be2('0x5a')]){logger[_0x2be2('0xc')]('[QUEUE]',_0x2be2('0x5b'));_0x180d0b[_0x2be2('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38d773['serverUrl'],_0x180d0b['uniqueid'],md5(_0x180d0b[_0x2be2('0x5d')]));}else{_0x180d0b[_0x2be2('0x5c')]='';}return getConnection(_0x38d773)['then'](function(_0x48b16e){_0x28a9ad=_0x48b16e;return getUser(_0x38d773,_0x5e3aca[_0x2be2('0xe')],_0x28a9ad);})[_0x2be2('0x31')](function(_0x51e69a){_0x5c0bac=_0x51e69a;logger['info']('The\x20User\x20ID\x20is:',_0x5c0bac['id']);return getEndUser(_0x38d773,_0x180d0b['calleridname'],_0x180d0b[_0x2be2('0x5e')],_0x28a9ad);})[_0x2be2('0x31')](function(_0x52ef07){_0x594fb9=_0x52ef07;logger[_0x2be2('0xc')](_0x2be2('0x5f'),_0x594fb9['id']);return getTicket(_0x38d773,_0x5c0bac,_0x594fb9,_0x55b2d7,_0x180d0b,_0x55b2d7['Fields'],_0x28a9ad,_0x2be2('0x60'));})['then'](function(_0x260aad){_0x392fe2=_0x260aad;logger[_0x2be2('0xc')]('Ticket\x20created!');logger[_0x2be2('0xc')](_0x2be2('0x61'),_0x392fe2['id']);return setRelationship(_0x28a9ad,_0x5c0bac,_0x392fe2,_0x2be2('0x62'));})[_0x2be2('0x31')](function(){return setRelationship(_0x28a9ad,_0x594fb9,_0x392fe2,_0x2be2('0x63'));})[_0x2be2('0x31')](function(){return getServerInfo(_0x28a9ad);})[_0x2be2('0x31')](function(_0x5169d8){var _0x1837c9=parseInt(_0x5169d8[_0x2be2('0x64')][_0x2be2('0x65')](0x0));var _0x577842=util[_0x2be2('0x2e')](_0x2be2('0x66'),_0x38d773['remoteUri'],_0x392fe2['id']);if(_0x1837c9>0x6){_0x577842=util[_0x2be2('0x2e')](_0x2be2('0x67'),_0x38d773['remoteUri'],_0x392fe2['id']);}logger[_0x2be2('0xc')](_0x2be2('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2be2('0x2e')](_0x2be2('0x69'),_0x5e3aca[_0x2be2('0xe')]),_0x2be2('0x6a'),{'uri':_0x577842});})['catch'](function(_0x1a4623){logger[_0x2be2('0x6b')](_0x2be2('0x68'),JSON['stringify'](_0x1a4623));});};exports[_0x2be2('0x6c')]=function(_0x2a0775,_0xd69259,_0x2cffcb,_0x423b8d,_0x476d8f,_0x186777,_0x3378a0){var _0x31ecd7,_0x659870,_0x57ff25,_0x289959;_0x186777['remoteUri']=intUtil[_0x2be2('0x56')](_0x186777[_0x2be2('0x57')]);_0x186777[_0x2be2('0x58')]=intUtil[_0x2be2('0x56')](_0x186777[_0x2be2('0x58')]);def[_0x2be2('0x6d')]=util['format']('%s/service/v4_1/rest.php',_0x186777[_0x2be2('0x57')]);if(_0x3378a0&&_0x3378a0[_0x2be2('0x6e')]&&_0x3378a0[_0x2be2('0x6e')]!==_0x2be2('0x6f')){logger['info'](_0x2be2('0x70'),'Recording\x20is\x20enabled!');_0xd69259[_0x2be2('0x5c')]=util[_0x2be2('0x2e')](_0x2be2('0x71'),_0x186777[_0x2be2('0x58')],_0xd69259['uniqueid'],md5(_0xd69259[_0x2be2('0x5d')]));}return getConnection(_0x186777)[_0x2be2('0x31')](function(_0x423ef2){_0x289959=_0x423ef2;return getUser(_0x186777,_0x423b8d['name'],_0x289959);})['then'](function(_0x4812bd){_0x31ecd7=_0x4812bd;logger['info']('The\x20User\x20ID\x20is:',_0x31ecd7['id']);return getEndUser(_0x186777,_0xd69259[_0x2be2('0x72')],_0xd69259['destcalleridnum'],_0x289959);})[_0x2be2('0x31')](function(_0x546968){_0x659870=_0x546968;logger[_0x2be2('0xc')](_0x2be2('0x5f'),_0x659870['id']);return getTicket(_0x186777,_0x31ecd7,_0x659870,_0x2cffcb,_0xd69259,_0x2cffcb['Fields'],_0x289959,_0x2be2('0x73'));})['then'](function(_0x22fad2){_0x57ff25=_0x22fad2;logger[_0x2be2('0xc')]('Ticket\x20created!');logger[_0x2be2('0xc')](_0x2be2('0x61'),_0x57ff25['id']);return setRelationship(_0x289959,_0x31ecd7,_0x57ff25,_0x2be2('0x62'));})['then'](function(){return setRelationship(_0x289959,_0x659870,_0x57ff25,'contacts');})[_0x2be2('0x31')](function(){return getServerInfo(_0x289959);})[_0x2be2('0x31')](function(_0x2cef5d){var _0x4310ba=parseInt(_0x2cef5d[_0x2be2('0x64')]['charAt'](0x0));var _0x41ad04=util[_0x2be2('0x2e')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x186777[_0x2be2('0x57')],_0x57ff25['id']);if(_0x4310ba>0x6){_0x41ad04=util[_0x2be2('0x2e')](_0x2be2('0x67'),_0x186777[_0x2be2('0x57')],_0x57ff25['id']);}logger[_0x2be2('0xc')](_0x2be2('0x70'),_0x2be2('0x74'));emit(util[_0x2be2('0x2e')]('user:%s',_0x423b8d[_0x2be2('0xe')]),_0x2be2('0x6a'),{'uri':_0x41ad04});})[_0x2be2('0x75')](function(_0x2550d1){logger[_0x2be2('0x6b')](_0x2be2('0x70'),JSON['stringify'](_0x2550d1));});};exports['unmanaged']=function(_0x28aeaa,_0x5c01cb,_0x45975a,_0xb7f80a,_0x33bd9b,_0xa5aae6){var _0x1d626f,_0xde7f79,_0x1d5363,_0x2f1f5e;_0xa5aae6[_0x2be2('0x57')]=intUtil[_0x2be2('0x56')](_0xa5aae6[_0x2be2('0x57')]);_0xa5aae6[_0x2be2('0x58')]=intUtil['stripTrailingSlash'](_0xa5aae6[_0x2be2('0x58')]);def[_0x2be2('0x6d')]=util['format'](_0x2be2('0x59'),_0xa5aae6['remoteUri']);if(_0x33bd9b&&_0x33bd9b[_0x2be2('0x5a')]){logger[_0x2be2('0xc')]('['+_0x5c01cb[_0x2be2('0x76')]['toUpperCase']()+']',_0x2be2('0x5b'));_0x5c01cb[_0x2be2('0x5c')]=util[_0x2be2('0x2e')](_0x2be2('0x71'),_0xa5aae6['serverUrl'],_0x5c01cb[_0x2be2('0x5d')],md5(_0x5c01cb[_0x2be2('0x5d')]));}else{_0x5c01cb[_0x2be2('0x5c')]='';}return getConnection(_0xa5aae6)[_0x2be2('0x31')](function(_0x164892){_0x2f1f5e=_0x164892;if(!_[_0x2be2('0x77')](_0xb7f80a)){return getUser(_0xa5aae6,_0xb7f80a[_0x2be2('0xe')],_0x2f1f5e);}else{return getUser(_0xa5aae6,null,_0x2f1f5e);}})[_0x2be2('0x31')](function(_0x220565){_0x1d626f=_0x220565;logger[_0x2be2('0xc')](_0x2be2('0x78'),_0x1d626f['id']);return getEndUser(_0xa5aae6,_0x5c01cb[_0x2be2('0x79')],_0x5c01cb[_0x2be2('0x5e')],_0x2f1f5e);})['then'](function(_0x5a3e54){_0xde7f79=_0x5a3e54;logger[_0x2be2('0xc')](_0x2be2('0x5f'),_0xde7f79['id']);return getTicket(_0xa5aae6,_0x1d626f,_0xde7f79,_0x45975a,_0x5c01cb,_0x45975a[_0x2be2('0x7a')],_0x2f1f5e,_0x2be2('0x60'));})[_0x2be2('0x31')](function(_0x315b91){_0x1d5363=_0x315b91;logger[_0x2be2('0xc')]('Ticket\x20created!');logger[_0x2be2('0xc')](_0x2be2('0x61'),_0x1d5363['id']);return setRelationship(_0x2f1f5e,_0x1d626f,_0x1d5363,'users');})[_0x2be2('0x31')](function(){return setRelationship(_0x2f1f5e,_0xde7f79,_0x1d5363,_0x2be2('0x63'));})['then'](function(){return getServerInfo(_0x2f1f5e);})['catch'](function(_0x296ef8){logger[_0x2be2('0x6b')]('['+_0x5c01cb[_0x2be2('0x76')][_0x2be2('0x7b')]()+']',JSON[_0x2be2('0x24')](_0x296ef8));});};
\ No newline at end of file
index 2c3d7ae..5939141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dc9=['key','%s:\x20%s','keyContent','format','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x7dc9,0x177));var _0x97dc=function(_0x53ad08,_0x5e4b26){_0x53ad08=_0x53ad08-0x0;var _0x1986f7=_0x7dc9[_0x53ad08];return _0x1986f7;};'use strict';var _=require(_0x97dc('0x0'));var util=require(_0x97dc('0x1'));exports[_0x97dc('0x2')]=function(_0x2f3f9b,_0x3fc240,_0x554926){var _0xed4371=[];if(_0x2f3f9b[_0x97dc('0x3')]>0x0){var _0xa7fd12=_[_0x97dc('0x4')](_0x2f3f9b,['id']);for(var _0x4753b5=0x0;_0x4753b5<_0xa7fd12['length'];_0x4753b5++){var _0x4fcdd8=_0xa7fd12[_0x4753b5];if(_0x4fcdd8[_0x97dc('0x5')]===_0x97dc('0x6')){_0xed4371['push'](_0x4fcdd8['content']);}else if(_0x4fcdd8[_0x97dc('0x5')]===_0x97dc('0x7')&&_0x4fcdd8['variableName']){_0x3fc240[_0x4fcdd8[_0x97dc('0x8')]]&&_0xed4371[_0x97dc('0x9')](_0x3fc240[_0x4fcdd8[_0x97dc('0x8')]][_0x97dc('0xa')]());}else if(_0x4fcdd8[_0x97dc('0x5')]===_0x97dc('0xb')&&_0x4fcdd8['Variable']&&_0x4fcdd8[_0x97dc('0xc')][_0x97dc('0xd')]){_0x3fc240[_0x4fcdd8[_0x97dc('0xc')]['name'][_0x97dc('0xe')]()]&&_0xed4371[_0x97dc('0x9')](_0x3fc240[_0x4fcdd8[_0x97dc('0xc')][_0x97dc('0xd')][_0x97dc('0xe')]()][_0x97dc('0xa')]());}else if(_0x4fcdd8[_0x97dc('0x5')]===_0x97dc('0xf')){if(_0x4fcdd8[_0x97dc('0x10')]===_0x97dc('0x6')&&_0x4fcdd8[_0x97dc('0x11')]){_0xed4371[_0x97dc('0x9')](util['format'](_0x97dc('0x12'),_0x4fcdd8[_0x97dc('0x11')],_0x4fcdd8[_0x97dc('0x13')]));}else if(_0x4fcdd8[_0x97dc('0x10')]===_0x97dc('0x7')&&_0x4fcdd8[_0x97dc('0x8')]&&_0x4fcdd8[_0x97dc('0x11')]){_0x3fc240[_0x4fcdd8['variableName']]&&_0xed4371[_0x97dc('0x9')](util[_0x97dc('0x14')](_0x97dc('0x12'),_0x4fcdd8['key'],_0x3fc240[_0x4fcdd8[_0x97dc('0x8')]]));}else if(_0x4fcdd8[_0x97dc('0x10')]===_0x97dc('0xb')&&_0x4fcdd8[_0x97dc('0xc')]&&_0x4fcdd8[_0x97dc('0xc')]['name']&&_0x4fcdd8[_0x97dc('0x11')]){_0x3fc240[_0x4fcdd8['Variable'][_0x97dc('0xd')][_0x97dc('0xe')]()]&&_0xed4371['push'](util[_0x97dc('0x14')](_0x97dc('0x12'),_0x4fcdd8[_0x97dc('0x11')],_0x3fc240[_0x4fcdd8['Variable'][_0x97dc('0xd')][_0x97dc('0xe')]()]));}}}}return _0xed4371[_0x97dc('0x15')](_0x554926);};exports[_0x97dc('0x16')]=function(_0x1f3c1d){var _0x51f303=_0x1f3c1d[_0x97dc('0x17')](-0x1);if(_0x51f303==='/'){_0x1f3c1d=_0x1f3c1d[_0x97dc('0x18')](0x0,_0x1f3c1d['lastIndexOf'](_0x51f303));}return _0x1f3c1d;};exports[_0x97dc('0x19')]=function(_0x242773){if(!_[_0x97dc('0x1a')](_0x242773)&&_0x242773!==''){var _0x578994=/^(([^<>()\[\]\\.,;:\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 _0x578994[_0x97dc('0x1b')](String(_0x242773)[_0x97dc('0xe')]());}else{return![];}};
\ No newline at end of file
+var _0x0172=['length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','name','toLowerCase','Variable','keyType','key','format','%s:\x20%s','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString'];(function(_0x5bb549,_0x4d0e9a){var _0x62015=function(_0x3c1d44){while(--_0x3c1d44){_0x5bb549['push'](_0x5bb549['shift']());}};_0x62015(++_0x4d0e9a);}(_0x0172,0x15c));var _0x2017=function(_0xc438cf,_0x4d8eb9){_0xc438cf=_0xc438cf-0x0;var _0x354569=_0x0172[_0xc438cf];return _0x354569;};'use strict';var _=require(_0x2017('0x0'));var util=require(_0x2017('0x1'));exports[_0x2017('0x2')]=function(_0x2c6c6e,_0x928a52,_0xf14210){var _0x324681=[];if(_0x2c6c6e[_0x2017('0x3')]>0x0){var _0x353db0=_[_0x2017('0x4')](_0x2c6c6e,['id']);for(var _0x47a732=0x0;_0x47a732<_0x353db0[_0x2017('0x3')];_0x47a732++){var _0x52c2de=_0x353db0[_0x47a732];if(_0x52c2de[_0x2017('0x5')]===_0x2017('0x6')){_0x324681[_0x2017('0x7')](_0x52c2de[_0x2017('0x8')]);}else if(_0x52c2de[_0x2017('0x5')]===_0x2017('0x9')&&_0x52c2de[_0x2017('0xa')]){_0x928a52[_0x52c2de[_0x2017('0xa')]]&&_0x324681[_0x2017('0x7')](_0x928a52[_0x52c2de[_0x2017('0xa')]][_0x2017('0xb')]());}else if(_0x52c2de[_0x2017('0x5')]===_0x2017('0xc')&&_0x52c2de['Variable']&&_0x52c2de['Variable'][_0x2017('0xd')]){_0x928a52[_0x52c2de['Variable'][_0x2017('0xd')][_0x2017('0xe')]()]&&_0x324681[_0x2017('0x7')](_0x928a52[_0x52c2de[_0x2017('0xf')][_0x2017('0xd')][_0x2017('0xe')]()][_0x2017('0xb')]());}else if(_0x52c2de[_0x2017('0x5')]==='keyValue'){if(_0x52c2de[_0x2017('0x10')]===_0x2017('0x6')&&_0x52c2de[_0x2017('0x11')]){_0x324681['push'](util[_0x2017('0x12')](_0x2017('0x13'),_0x52c2de[_0x2017('0x11')],_0x52c2de['keyContent']));}else if(_0x52c2de[_0x2017('0x10')]===_0x2017('0x9')&&_0x52c2de[_0x2017('0xa')]&&_0x52c2de[_0x2017('0x11')]){_0x928a52[_0x52c2de[_0x2017('0xa')]]&&_0x324681[_0x2017('0x7')](util[_0x2017('0x12')](_0x2017('0x13'),_0x52c2de[_0x2017('0x11')],_0x928a52[_0x52c2de['variableName']]));}else if(_0x52c2de['keyType']===_0x2017('0xc')&&_0x52c2de[_0x2017('0xf')]&&_0x52c2de['Variable'][_0x2017('0xd')]&&_0x52c2de['key']){_0x928a52[_0x52c2de[_0x2017('0xf')]['name'][_0x2017('0xe')]()]&&_0x324681[_0x2017('0x7')](util['format'](_0x2017('0x13'),_0x52c2de[_0x2017('0x11')],_0x928a52[_0x52c2de[_0x2017('0xf')][_0x2017('0xd')][_0x2017('0xe')]()]));}}}}return _0x324681[_0x2017('0x14')](_0xf14210);};exports['stripTrailingSlash']=function(_0x3fee3f){var _0x1634ee=_0x3fee3f[_0x2017('0x15')](-0x1);if(_0x1634ee==='/'){_0x3fee3f=_0x3fee3f[_0x2017('0x16')](0x0,_0x3fee3f[_0x2017('0x17')](_0x1634ee));}return _0x3fee3f;};exports[_0x2017('0x18')]=function(_0x14cedb){if(!_[_0x2017('0x19')](_0x14cedb)&&_0x14cedb!==''){var _0x377b9f=/^(([^<>()\[\]\\.,;:\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 _0x377b9f[_0x2017('0x1a')](String(_0x14cedb)[_0x2017('0xe')]());}else{return![];}};
\ No newline at end of file
index 4725422..18874ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x4f1a18,_0x5e26cd){var _0x158bd7=function(_0x2bde23){while(--_0x2bde23){_0x4f1a18['push'](_0x4f1a18['shift']());}};_0x158bd7(++_0x5e26cd);}(_0xe706,0xa3));var _0x6e70=function(_0x134b6e,_0x21b5ca){_0x134b6e=_0x134b6e-0x0;var _0x2229a9=_0xe706[_0x134b6e];return _0x2229a9;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
+var _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(_0x3e3f0a,_0x13dd45){var _0x470ae4=function(_0x441c47){while(--_0x441c47){_0x3e3f0a['push'](_0x3e3f0a['shift']());}};_0x470ae4(++_0x13dd45);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'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
index a6cd657..fefcf94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64ab=['then','Ticket\x20created!','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','includes','string','picklist','nameField','customField','toLowerCase','type','idField','push','variable','variableName','custom_fields','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','calleridname','The\x20Enduser\x20ID\x20is:','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','merge','Tags','name','Subjects','getString','Descriptions','Fields'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x64ab,0xc9));var _0xb64a=function(_0x4ebed2,_0x326b31){_0x4ebed2=_0x4ebed2-0x0;var _0xb217ad=_0x64ab[_0x4ebed2];return _0xb217ad;};'use strict';var _=require(_0xb64a('0x0'));var rp=require('request-promise');var md5=require(_0xb64a('0x1'));var util=require(_0xb64a('0x2'));var Redis=require(_0xb64a('0x3'));var intUtil=require('./util');var config=require(_0xb64a('0x4'));var logger=require(_0xb64a('0x5'))(_0xb64a('0x6'));config[_0xb64a('0x7')]=_[_0xb64a('0x8')](config[_0xb64a('0x7')],{'host':_0xb64a('0x9'),'port':0x18eb});var io=require(_0xb64a('0xa'))(new Redis(config[_0xb64a('0x7')]));function emit(_0x2e6410,_0x49d45e,_0x30fe8b){io['to'](_0x2e6410)[_0xb64a('0xb')](_0x49d45e,_0x30fe8b);}var headers={'Content-Type':_0xb64a('0xc'),'Accept':_0xb64a('0xc')};function getTicket(_0x4befa4,_0x17617a,_0x46f4cb,_0x2e14a9,_0x25deb5){logger['info'](_0xb64a('0xd'));return request({'uri':util[_0xb64a('0xe')](_0xb64a('0xf'),_0x4befa4['remoteUri']),'method':'POST','body':{'ticket':_[_0xb64a('0x10')]({'requester_id':_0x46f4cb['id'],'submitter_id':_0x17617a?_0x17617a['id']:undefined,'assignee_id':_0x17617a?_0x17617a['id']:undefined,'tags':getTags(_0x2e14a9[_0xb64a('0x11')],_0xb64a('0x12')),'subject':intUtil['getString'](_0x2e14a9[_0xb64a('0x13')],_0x25deb5,'\x20'),'description':intUtil[_0xb64a('0x14')](_0x2e14a9[_0xb64a('0x15')],_0x25deb5,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb64a('0x14')](_0x2e14a9['Descriptions'],_0x25deb5,'\x0a')}},getCustomFields(_0x2e14a9[_0xb64a('0x16')],_0x25deb5))}})[_0xb64a('0x17')](function(_0x51ec40){logger['info'](_0xb64a('0x18'));return _0x51ec40[_0xb64a('0x19')];});}function getUser(_0x2c6119,_0x4c489c){if(intUtil[_0xb64a('0x1a')](_0x4c489c)){logger[_0xb64a('0x1b')](_0xb64a('0x1c'),_0x4c489c);return request({'uri':util[_0xb64a('0xe')](_0xb64a('0x1d'),_0x2c6119[_0xb64a('0x1e')]),'qs':{'query':util[_0xb64a('0xe')](_0xb64a('0x1f'),_0x4c489c)}})[_0xb64a('0x17')](function(_0x3655f){if(_0x3655f[_0xb64a('0x20')]){logger[_0xb64a('0x1b')](_0xb64a('0x21'));return _['find'](_0x3655f[_0xb64a('0x22')],{'email':_0x4c489c,'role':_0xb64a('0x23')});}else{logger[_0xb64a('0x1b')](_0xb64a('0x24'));return request({'uri':util[_0xb64a('0xe')](_0xb64a('0x25'),_0x2c6119['remoteUri'])})['then'](function(_0x45cbcf){logger[_0xb64a('0x1b')](_0xb64a('0x26'));return _0x45cbcf['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb64a('0xe')](_0xb64a('0x25'),_0x2c6119[_0xb64a('0x1e')])})[_0xb64a('0x17')](function(_0x2595c2){logger[_0xb64a('0x1b')]('Admin\x20account\x20selected.');return _0x2595c2[_0xb64a('0x27')];});}}function getEndUser(_0xe0b742,_0x1553fc,_0x365185){logger[_0xb64a('0x1b')](_0xb64a('0x28'),_0x365185);return request({'uri':util[_0xb64a('0xe')]('%s/search.json',_0xe0b742[_0xb64a('0x1e')]),'qs':{'query':util[_0xb64a('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x365185)}})[_0xb64a('0x17')](function(_0x42d9cb){var _0x5936a5;if(_0x42d9cb[_0xb64a('0x22')][_0xb64a('0x29')]){_0x42d9cb['results']=_[_0xb64a('0x2a')](_0x42d9cb[_0xb64a('0x22')],{'suspended':![],'role':_0xb64a('0x2b')});if(_0x42d9cb[_0xb64a('0x22')][_0xb64a('0x29')]){_0x5936a5=_[_0xb64a('0x2c')](_0x42d9cb[_0xb64a('0x22')]);}}if(_0x5936a5){logger[_0xb64a('0x1b')](_0xb64a('0x2d'));return _0x5936a5;}else{logger['info'](_0xb64a('0x2e'));return request({'uri':util[_0xb64a('0xe')]('%s/users.json',_0xe0b742['remoteUri']),'method':_0xb64a('0x2f'),'body':{'user':{'role':_0xb64a('0x2b'),'name':util[_0xb64a('0xe')](_0xb64a('0x30'),_0x1553fc||_0x365185),'phone':_0x365185}}})['then'](function(_0x70672e){logger[_0xb64a('0x1b')](_0xb64a('0x31'));return _0x70672e['user'];});}});}function getAuth(_0x287855){var _0x11fe8b;if(_0x287855[_0xb64a('0x32')]===_0xb64a('0x33')){_0x11fe8b=util[_0xb64a('0xe')](_0xb64a('0x34'),_0x287855['username'],_0x287855[_0xb64a('0x33')]);}else if(_0x287855[_0xb64a('0x32')]===_0xb64a('0x35')){_0x11fe8b=util[_0xb64a('0xe')](_0xb64a('0x36'),_0x287855['username'],_0x287855['token']);}return util[_0xb64a('0xe')](_0xb64a('0x37'),new Buffer(_0x11fe8b)[_0xb64a('0x38')]('base64'));}function request(_0x58f91d){logger[_0xb64a('0x39')](_0xb64a('0x3a'),JSON[_0xb64a('0x3b')](_0x58f91d));return rp(_['defaults'](_0x58f91d,{'method':_0xb64a('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x567bf9,_0x27c469){var _0x19ddcd=[];if(_0x567bf9&&_0x567bf9[_0xb64a('0x29')]>0x0){_0x19ddcd=_[_0xb64a('0x3d')](_0x567bf9,_0x27c469);}return _0x19ddcd;}function getCustomFields(_0x2d0909,_0x4124b4){var _0x2c6a0e=[];var _0x3bc14d={'custom_fields':[]};if(_0x2d0909['length']>0x0){_['forEach'](_0x2d0909,function(_0x384030){if(_[_0xb64a('0x3e')]([_0xb64a('0x3f'),_0xb64a('0x40')],_0x384030['type'])&&_0x384030[_0xb64a('0x41')]&&!_0x384030[_0xb64a('0x42')]){_0x3bc14d[_0x384030[_0xb64a('0x41')][_0xb64a('0x43')]()]=_0x384030['content'][_0xb64a('0x38')]();}else if(_['includes']([_0xb64a('0x3f'),_0xb64a('0x40')],_0x384030[_0xb64a('0x44')])&&_0x384030[_0xb64a('0x45')]&&_0x384030[_0xb64a('0x42')]){_0x3bc14d['custom_fields'][_0xb64a('0x46')]({'id':_0x384030['idField'],'value':_0x384030['content']['toString']()});}else if(_0x384030['type']===_0xb64a('0x47')&&_0x384030[_0xb64a('0x48')]&&_0x384030[_0xb64a('0x45')]&&_0x384030[_0xb64a('0x42')]){_0x4124b4[_0x384030[_0xb64a('0x48')]]&&_0x3bc14d[_0xb64a('0x49')]['push']({'id':_0x384030[_0xb64a('0x45')],'value':_0x4124b4[_0x384030['variableName']][_0xb64a('0x38')]()});}else if(_0x384030[_0xb64a('0x44')]==='customVariable'&&_0x384030[_0xb64a('0x4a')]&&_0x384030[_0xb64a('0x4a')][_0xb64a('0x12')]&&_0x384030[_0xb64a('0x45')]&&_0x384030[_0xb64a('0x42')]){_0x4124b4[_0x384030[_0xb64a('0x4a')][_0xb64a('0x12')][_0xb64a('0x43')]()]&&_0x3bc14d['custom_fields'][_0xb64a('0x46')]({'id':_0x384030[_0xb64a('0x45')],'value':_0x4124b4[_0x384030[_0xb64a('0x4a')][_0xb64a('0x12')]['toLowerCase']()][_0xb64a('0x38')]()});}});}return _0x3bc14d;}exports[_0xb64a('0x4b')]=function(_0xe9b396,_0x240350,_0x5340e9,_0x11b6f7,_0x24ce0a,_0x178496){var _0x5c6a1a,_0x474f61;_0x178496['remoteUri']=intUtil[_0xb64a('0x4c')](_0x178496[_0xb64a('0x1e')]);_0x178496['serverUrl']=intUtil[_0xb64a('0x4c')](_0x178496[_0xb64a('0x4d')]);if(_0x24ce0a&&_0x24ce0a[_0xb64a('0x4e')]){logger['info'](_0xb64a('0x4f'),'Recording\x20is\x20enabled!');_0x240350['recordingURL']=util['format'](_0xb64a('0x50'),_0x178496[_0xb64a('0x4d')],_0x240350['uniqueid'],md5(_0x240350[_0xb64a('0x51')]));}else{_0x240350[_0xb64a('0x52')]='';}headers[_0xb64a('0x53')]=getAuth(_0x178496);return getUser(_0x178496,_0x11b6f7['email'])[_0xb64a('0x17')](function(_0x4c3e51){_0x5c6a1a=_0x4c3e51;logger[_0xb64a('0x1b')](_0xb64a('0x54'),_0x5c6a1a['id']);return getEndUser(_0x178496,_0x240350['calleridname'],_0x240350[_0xb64a('0x55')]);})['then'](function(_0x2da243){_0x474f61=_0x2da243;logger[_0xb64a('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x474f61['id']);return getTicket(_0x178496,_0x5c6a1a,_0x474f61,_0x5340e9,_0x240350);})['then'](function(_0x3f6fc5){if(_0x3f6fc5){logger[_0xb64a('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x3f6fc5['id']);switch(_0x178496[_0xb64a('0x44')]){case'integrationTab':logger['info'](_0xb64a('0x4f'),_0xb64a('0x56'));return request({'uri':util[_0xb64a('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x178496[_0xb64a('0x1e')],_0x5c6a1a['id'],_0x3f6fc5['id']),'method':_0xb64a('0x2f')});case'newTab':logger[_0xb64a('0x1b')](_0xb64a('0x4f'),_0xb64a('0x57'));emit(util['format']('user:%s',_0x11b6f7['name']),_0xb64a('0x58'),{'uri':util[_0xb64a('0xe')](_0xb64a('0x59'),_0x178496[_0xb64a('0x1e')][_0xb64a('0x5a')](_0xb64a('0x5b'),''),_0x3f6fc5['id'])});break;default:logger['error']('[QUEUE]',_0xb64a('0x5c'));}}})[_0xb64a('0x5d')](function(_0x20f209){logger[_0xb64a('0x5e')](_0xb64a('0x5f'),util[_0xb64a('0x60')](_0x20f209,{'showHidden':!![],'depth':null}));});};exports[_0xb64a('0x61')]=function(_0x1677b9,_0x15f70b,_0xc53574,_0x49e09d,_0xa3d057,_0xb91f8,_0x11f1ae){var _0x5c5b4b,_0x50c51d;_0xb91f8[_0xb64a('0x1e')]=intUtil['stripTrailingSlash'](_0xb91f8[_0xb64a('0x1e')]);_0xb91f8[_0xb64a('0x4d')]=intUtil['stripTrailingSlash'](_0xb91f8['serverUrl']);if(_0x11f1ae&&_0x11f1ae[_0xb64a('0x62')]&&_0x11f1ae['recordingFormat']!==_0xb64a('0x63')){logger[_0xb64a('0x1b')](_0xb64a('0x64'),_0xb64a('0x65'));_0x15f70b[_0xb64a('0x52')]=util[_0xb64a('0xe')](_0xb64a('0x50'),_0xb91f8[_0xb64a('0x4d')],_0x15f70b[_0xb64a('0x51')],md5(_0x15f70b[_0xb64a('0x51')]));}headers[_0xb64a('0x53')]=getAuth(_0xb91f8);return getUser(_0xb91f8,_0x49e09d[_0xb64a('0x66')])[_0xb64a('0x17')](function(_0x10e6c6){_0x5c5b4b=_0x10e6c6;logger[_0xb64a('0x1b')](_0xb64a('0x54'),_0x5c5b4b['id']);return getEndUser(_0xb91f8,_0x15f70b['destcalleridname'],_0x15f70b['destcalleridnum']);})[_0xb64a('0x17')](function(_0x3ae99a){_0x50c51d=_0x3ae99a;logger[_0xb64a('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x50c51d['id']);return getTicket(_0xb91f8,_0x5c5b4b,_0x50c51d,_0xc53574,_0x15f70b);})[_0xb64a('0x17')](function(_0x549fed){if(_0x549fed){logger[_0xb64a('0x1b')](_0xb64a('0x67'),_0x549fed['id']);switch(_0xb91f8[_0xb64a('0x44')]){case'integrationTab':logger[_0xb64a('0x1b')](_0xb64a('0x64'),_0xb64a('0x56'));return request({'uri':util['format'](_0xb64a('0x68'),_0xb91f8[_0xb64a('0x1e')],_0x5c5b4b['id'],_0x549fed['id']),'method':_0xb64a('0x2f')});case _0xb64a('0x69'):logger['info'](_0xb64a('0x64'),_0xb64a('0x57'));emit(util[_0xb64a('0xe')]('user:%s',_0x49e09d['name']),_0xb64a('0x58'),{'uri':util['format'](_0xb64a('0x59'),_0xb91f8['remoteUri'][_0xb64a('0x5a')](_0xb64a('0x5b'),''),_0x549fed['id'])});break;default:logger['error'](_0xb64a('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xb64a('0x5d')](function(_0x335374){logger[_0xb64a('0x5e')](_0xb64a('0x6a'),util['inspect'](_0x335374,{'showHidden':!![],'depth':null}));});};exports[_0xb64a('0x6b')]=function(_0x1afd21,_0x51b532,_0x439ab2,_0x304ded,_0x2f9405,_0x22b808){var _0x4c6251,_0x2ad208;_0x22b808[_0xb64a('0x1e')]=intUtil[_0xb64a('0x4c')](_0x22b808[_0xb64a('0x1e')]);_0x22b808[_0xb64a('0x4d')]=intUtil['stripTrailingSlash'](_0x22b808[_0xb64a('0x4d')]);if(_0x2f9405&&_0x2f9405[_0xb64a('0x4e')]){logger[_0xb64a('0x1b')]('['+_0x51b532['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x51b532[_0xb64a('0x52')]=util['format'](_0xb64a('0x50'),_0x22b808['serverUrl'],_0x51b532[_0xb64a('0x51')],md5(_0x51b532[_0xb64a('0x51')]));}else{_0x51b532[_0xb64a('0x52')]='';}headers[_0xb64a('0x53')]=getAuth(_0x22b808);return getUser(_0x22b808)[_0xb64a('0x17')](function(_0x403678){_0x4c6251=_0x403678;logger[_0xb64a('0x1b')](_0xb64a('0x54'),_0x4c6251['id']);return getEndUser(_0x22b808,_0x51b532[_0xb64a('0x6c')],_0x51b532[_0xb64a('0x55')]);})[_0xb64a('0x17')](function(_0x40aabf){_0x2ad208=_0x40aabf;logger[_0xb64a('0x1b')](_0xb64a('0x6d'),_0x2ad208['id']);return getTicket(_0x22b808,_0x4c6251,_0x2ad208,_0x439ab2,_0x51b532);})[_0xb64a('0x17')](function(_0x18faf5){if(_0x18faf5){logger[_0xb64a('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x18faf5['id']);}})[_0xb64a('0x5d')](function(_0x4580ac){logger['error']('['+_0x51b532['lastevent'][_0xb64a('0x6e')]()+']'+_0xb64a('0x6f'),util[_0xb64a('0x60')](_0x4580ac,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x2baf=['content','toString','picklist','idField','customField','push','variable','variableName','Variable','toLowerCase','custom_fields','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','recordingURL','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','remoteUri','POST','merge','name','Subjects','getString','Fields','Ticket\x20created!','format','type:user\x20role:agent\x20email:%s','then','count','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','%s/search.json','length','results','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','username','Basic\x20%s','base64','[HTTP]','stringify','map','forEach','includes','string','type','nameField'];(function(_0x5bf4b,_0x11bdfa){var _0x17868d=function(_0x18f857){while(--_0x18f857){_0x5bf4b['push'](_0x5bf4b['shift']());}};_0x17868d(++_0x11bdfa);}(_0x2baf,0xfd));var _0xf2ba=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x2baf[_0x218972];return _0x1bb1a8;};'use strict';var _=require(_0xf2ba('0x0'));var rp=require('request-promise');var md5=require(_0xf2ba('0x1'));var util=require(_0xf2ba('0x2'));var Redis=require(_0xf2ba('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xf2ba('0x4'))('zendesk');config[_0xf2ba('0x5')]=_[_0xf2ba('0x6')](config[_0xf2ba('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf2ba('0x7'))(new Redis(config[_0xf2ba('0x5')]));function emit(_0x404223,_0x86a77b,_0xa4c258){io['to'](_0x404223)[_0xf2ba('0x8')](_0x86a77b,_0xa4c258);}var headers={'Content-Type':_0xf2ba('0x9'),'Accept':_0xf2ba('0x9')};function getTicket(_0x499566,_0x3ce8ae,_0x12d992,_0x5c70fa,_0x3b9093){logger[_0xf2ba('0xa')](_0xf2ba('0xb'));return request({'uri':util['format']('%s/tickets.json',_0x499566[_0xf2ba('0xc')]),'method':_0xf2ba('0xd'),'body':{'ticket':_[_0xf2ba('0xe')]({'requester_id':_0x12d992['id'],'submitter_id':_0x3ce8ae?_0x3ce8ae['id']:undefined,'assignee_id':_0x3ce8ae?_0x3ce8ae['id']:undefined,'tags':getTags(_0x5c70fa['Tags'],_0xf2ba('0xf')),'subject':intUtil['getString'](_0x5c70fa[_0xf2ba('0x10')],_0x3b9093,'\x20'),'description':intUtil['getString'](_0x5c70fa['Descriptions'],_0x3b9093,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf2ba('0x11')](_0x5c70fa['Descriptions'],_0x3b9093,'\x0a')}},getCustomFields(_0x5c70fa[_0xf2ba('0x12')],_0x3b9093))}})['then'](function(_0x98cae6){logger[_0xf2ba('0xa')](_0xf2ba('0x13'));return _0x98cae6['ticket'];});}function getUser(_0x5d32ba,_0x4631ce){if(intUtil['validateEmail'](_0x4631ce)){logger[_0xf2ba('0xa')]('Getting\x20agent\x20with\x20email',_0x4631ce);return request({'uri':util[_0xf2ba('0x14')]('%s/search.json',_0x5d32ba[_0xf2ba('0xc')]),'qs':{'query':util[_0xf2ba('0x14')](_0xf2ba('0x15'),_0x4631ce)}})[_0xf2ba('0x16')](function(_0x546369){if(_0x546369[_0xf2ba('0x17')]){logger[_0xf2ba('0xa')]('Agent\x20found!');return _['find'](_0x546369['results'],{'email':_0x4631ce,'role':_0xf2ba('0x18')});}else{logger['info'](_0xf2ba('0x19'));return request({'uri':util[_0xf2ba('0x14')](_0xf2ba('0x1a'),_0x5d32ba[_0xf2ba('0xc')])})['then'](function(_0x391d0d){logger[_0xf2ba('0xa')]('Admin\x20account\x20selected.');return _0x391d0d[_0xf2ba('0x1b')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x5d32ba['remoteUri'])})[_0xf2ba('0x16')](function(_0x2031e2){logger[_0xf2ba('0xa')](_0xf2ba('0x1c'));return _0x2031e2[_0xf2ba('0x1b')];});}}function getEndUser(_0x49f74b,_0x4e1ab1,_0x48efc1){logger['info']('Searching\x20enduser\x20with\x20phone',_0x48efc1);return request({'uri':util[_0xf2ba('0x14')](_0xf2ba('0x1d'),_0x49f74b[_0xf2ba('0xc')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x48efc1)}})[_0xf2ba('0x16')](function(_0x34e96c){var _0xa90963;if(_0x34e96c['results'][_0xf2ba('0x1e')]){_0x34e96c[_0xf2ba('0x1f')]=_[_0xf2ba('0x20')](_0x34e96c[_0xf2ba('0x1f')],{'suspended':![],'role':'end-user'});if(_0x34e96c['results'][_0xf2ba('0x1e')]){_0xa90963=_[_0xf2ba('0x21')](_0x34e96c[_0xf2ba('0x1f')]);}}if(_0xa90963){logger[_0xf2ba('0xa')](_0xf2ba('0x22'));return _0xa90963;}else{logger[_0xf2ba('0xa')](_0xf2ba('0x23'));return request({'uri':util[_0xf2ba('0x14')]('%s/users.json',_0x49f74b['remoteUri']),'method':'POST','body':{'user':{'role':'end-user','name':util['format'](_0xf2ba('0x24'),_0x4e1ab1||_0x48efc1),'phone':_0x48efc1}}})[_0xf2ba('0x16')](function(_0xa74b56){logger[_0xf2ba('0xa')](_0xf2ba('0x25'));return _0xa74b56[_0xf2ba('0x1b')];});}});}function getAuth(_0x46e56f){var _0x465bda;if(_0x46e56f[_0xf2ba('0x26')]===_0xf2ba('0x27')){_0x465bda=util[_0xf2ba('0x14')](_0xf2ba('0x28'),_0x46e56f['username'],_0x46e56f['password']);}else if(_0x46e56f[_0xf2ba('0x26')]===_0xf2ba('0x29')){_0x465bda=util[_0xf2ba('0x14')]('%s/token:%s',_0x46e56f[_0xf2ba('0x2a')],_0x46e56f[_0xf2ba('0x29')]);}return util['format'](_0xf2ba('0x2b'),new Buffer(_0x465bda)['toString'](_0xf2ba('0x2c')));}function request(_0x5b8b72){logger['debug'](_0xf2ba('0x2d'),JSON[_0xf2ba('0x2e')](_0x5b8b72));return rp(_['defaults'](_0x5b8b72,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x461984,_0x23c0dc){var _0x4d7034=[];if(_0x461984&&_0x461984['length']>0x0){_0x4d7034=_[_0xf2ba('0x2f')](_0x461984,_0x23c0dc);}return _0x4d7034;}function getCustomFields(_0x2d7bd9,_0xe0a695){var _0x3db9ce=[];var _0x5f043c={'custom_fields':[]};if(_0x2d7bd9[_0xf2ba('0x1e')]>0x0){_[_0xf2ba('0x30')](_0x2d7bd9,function(_0x58d52b){if(_[_0xf2ba('0x31')]([_0xf2ba('0x32'),'picklist'],_0x58d52b[_0xf2ba('0x33')])&&_0x58d52b['nameField']&&!_0x58d52b['customField']){_0x5f043c[_0x58d52b[_0xf2ba('0x34')]['toLowerCase']()]=_0x58d52b[_0xf2ba('0x35')][_0xf2ba('0x36')]();}else if(_[_0xf2ba('0x31')](['string',_0xf2ba('0x37')],_0x58d52b[_0xf2ba('0x33')])&&_0x58d52b[_0xf2ba('0x38')]&&_0x58d52b[_0xf2ba('0x39')]){_0x5f043c['custom_fields'][_0xf2ba('0x3a')]({'id':_0x58d52b[_0xf2ba('0x38')],'value':_0x58d52b[_0xf2ba('0x35')][_0xf2ba('0x36')]()});}else if(_0x58d52b[_0xf2ba('0x33')]===_0xf2ba('0x3b')&&_0x58d52b[_0xf2ba('0x3c')]&&_0x58d52b[_0xf2ba('0x38')]&&_0x58d52b[_0xf2ba('0x39')]){_0xe0a695[_0x58d52b[_0xf2ba('0x3c')]]&&_0x5f043c['custom_fields']['push']({'id':_0x58d52b['idField'],'value':_0xe0a695[_0x58d52b[_0xf2ba('0x3c')]][_0xf2ba('0x36')]()});}else if(_0x58d52b[_0xf2ba('0x33')]==='customVariable'&&_0x58d52b[_0xf2ba('0x3d')]&&_0x58d52b[_0xf2ba('0x3d')][_0xf2ba('0xf')]&&_0x58d52b['idField']&&_0x58d52b[_0xf2ba('0x39')]){_0xe0a695[_0x58d52b[_0xf2ba('0x3d')][_0xf2ba('0xf')][_0xf2ba('0x3e')]()]&&_0x5f043c[_0xf2ba('0x3f')][_0xf2ba('0x3a')]({'id':_0x58d52b[_0xf2ba('0x38')],'value':_0xe0a695[_0x58d52b[_0xf2ba('0x3d')][_0xf2ba('0xf')][_0xf2ba('0x3e')]()]['toString']()});}});}return _0x5f043c;}exports['queue']=function(_0x4e14b5,_0x166c73,_0x3b5e7a,_0x491058,_0x315b1a,_0x51580b){var _0x33d83e,_0x3a2ce0;_0x51580b['remoteUri']=intUtil[_0xf2ba('0x40')](_0x51580b[_0xf2ba('0xc')]);_0x51580b[_0xf2ba('0x41')]=intUtil['stripTrailingSlash'](_0x51580b[_0xf2ba('0x41')]);if(_0x315b1a&&_0x315b1a[_0xf2ba('0x42')]){logger['info'](_0xf2ba('0x43'),'Recording\x20is\x20enabled!');_0x166c73['recordingURL']=util[_0xf2ba('0x14')](_0xf2ba('0x44'),_0x51580b[_0xf2ba('0x41')],_0x166c73['uniqueid'],md5(_0x166c73[_0xf2ba('0x45')]));}else{_0x166c73['recordingURL']='';}headers['Authorization']=getAuth(_0x51580b);return getUser(_0x51580b,_0x491058[_0xf2ba('0x46')])[_0xf2ba('0x16')](function(_0x1ee78e){_0x33d83e=_0x1ee78e;logger['info'](_0xf2ba('0x47'),_0x33d83e['id']);return getEndUser(_0x51580b,_0x166c73['calleridname'],_0x166c73['calleridnum']);})['then'](function(_0x2e8dfa){_0x3a2ce0=_0x2e8dfa;logger['info'](_0xf2ba('0x48'),_0x3a2ce0['id']);return getTicket(_0x51580b,_0x33d83e,_0x3a2ce0,_0x3b5e7a,_0x166c73);})[_0xf2ba('0x16')](function(_0x5c3104){if(_0x5c3104){logger[_0xf2ba('0xa')](_0xf2ba('0x49'),_0x5c3104['id']);switch(_0x51580b[_0xf2ba('0x33')]){case _0xf2ba('0x4a'):logger[_0xf2ba('0xa')](_0xf2ba('0x43'),_0xf2ba('0x4b'));return request({'uri':util['format'](_0xf2ba('0x4c'),_0x51580b[_0xf2ba('0xc')],_0x33d83e['id'],_0x5c3104['id']),'method':_0xf2ba('0xd')});case _0xf2ba('0x4d'):logger[_0xf2ba('0xa')](_0xf2ba('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf2ba('0x14')](_0xf2ba('0x4e'),_0x491058[_0xf2ba('0xf')]),_0xf2ba('0x4f'),{'uri':util[_0xf2ba('0x14')](_0xf2ba('0x50'),_0x51580b[_0xf2ba('0xc')][_0xf2ba('0x51')](_0xf2ba('0x52'),''),_0x5c3104['id'])});break;default:logger[_0xf2ba('0x53')]('[QUEUE]',_0xf2ba('0x54'));}}})[_0xf2ba('0x55')](function(_0x5c0f22){logger['error'](_0xf2ba('0x56'),util[_0xf2ba('0x57')](_0x5c0f22,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x44ad99,_0x4336e7,_0x2a7973,_0x27b1f7,_0x3bb58d,_0x273939,_0x42e6bf){var _0x10b788,_0x4137a0;_0x273939[_0xf2ba('0xc')]=intUtil['stripTrailingSlash'](_0x273939[_0xf2ba('0xc')]);_0x273939[_0xf2ba('0x41')]=intUtil[_0xf2ba('0x40')](_0x273939[_0xf2ba('0x41')]);if(_0x42e6bf&&_0x42e6bf[_0xf2ba('0x58')]&&_0x42e6bf[_0xf2ba('0x58')]!==_0xf2ba('0x59')){logger[_0xf2ba('0xa')](_0xf2ba('0x5a'),_0xf2ba('0x5b'));_0x4336e7['recordingURL']=util[_0xf2ba('0x14')](_0xf2ba('0x44'),_0x273939[_0xf2ba('0x41')],_0x4336e7['uniqueid'],md5(_0x4336e7[_0xf2ba('0x45')]));}headers[_0xf2ba('0x5c')]=getAuth(_0x273939);return getUser(_0x273939,_0x27b1f7[_0xf2ba('0x46')])['then'](function(_0x54a0f8){_0x10b788=_0x54a0f8;logger[_0xf2ba('0xa')](_0xf2ba('0x47'),_0x10b788['id']);return getEndUser(_0x273939,_0x4336e7['destcalleridname'],_0x4336e7[_0xf2ba('0x5d')]);})[_0xf2ba('0x16')](function(_0x165c62){_0x4137a0=_0x165c62;logger[_0xf2ba('0xa')](_0xf2ba('0x48'),_0x4137a0['id']);return getTicket(_0x273939,_0x10b788,_0x4137a0,_0x2a7973,_0x4336e7);})['then'](function(_0x19d9e9){if(_0x19d9e9){logger[_0xf2ba('0xa')](_0xf2ba('0x49'),_0x19d9e9['id']);switch(_0x273939['type']){case _0xf2ba('0x4a'):logger[_0xf2ba('0xa')](_0xf2ba('0x5a'),_0xf2ba('0x4b'));return request({'uri':util[_0xf2ba('0x14')](_0xf2ba('0x4c'),_0x273939[_0xf2ba('0xc')],_0x10b788['id'],_0x19d9e9['id']),'method':_0xf2ba('0xd')});case _0xf2ba('0x4d'):logger[_0xf2ba('0xa')](_0xf2ba('0x5a'),_0xf2ba('0x5e'));emit(util['format']('user:%s',_0x27b1f7['name']),_0xf2ba('0x4f'),{'uri':util[_0xf2ba('0x14')]('%s/agent/tickets/%s',_0x273939['remoteUri'][_0xf2ba('0x51')](_0xf2ba('0x52'),''),_0x19d9e9['id'])});break;default:logger['error'](_0xf2ba('0x5a'),_0xf2ba('0x54'));}}})['catch'](function(_0x2776c4){logger[_0xf2ba('0x53')](_0xf2ba('0x5f'),util['inspect'](_0x2776c4,{'showHidden':!![],'depth':null}));});};exports[_0xf2ba('0x60')]=function(_0x33267c,_0x4507ed,_0x13df88,_0x1b740b,_0x478679,_0x28d8a9){var _0x4350ba,_0x26b256;_0x28d8a9[_0xf2ba('0xc')]=intUtil[_0xf2ba('0x40')](_0x28d8a9[_0xf2ba('0xc')]);_0x28d8a9[_0xf2ba('0x41')]=intUtil[_0xf2ba('0x40')](_0x28d8a9['serverUrl']);if(_0x478679&&_0x478679['monitor_format']){logger[_0xf2ba('0xa')]('['+_0x4507ed[_0xf2ba('0x61')][_0xf2ba('0x62')]()+']',_0xf2ba('0x5b'));_0x4507ed['recordingURL']=util[_0xf2ba('0x14')](_0xf2ba('0x44'),_0x28d8a9['serverUrl'],_0x4507ed['uniqueid'],md5(_0x4507ed[_0xf2ba('0x45')]));}else{_0x4507ed[_0xf2ba('0x63')]='';}headers[_0xf2ba('0x5c')]=getAuth(_0x28d8a9);return getUser(_0x28d8a9)[_0xf2ba('0x16')](function(_0xf018a1){_0x4350ba=_0xf018a1;logger[_0xf2ba('0xa')]('The\x20User\x20ID\x20is:',_0x4350ba['id']);return getEndUser(_0x28d8a9,_0x4507ed['calleridname'],_0x4507ed[_0xf2ba('0x64')]);})['then'](function(_0x1c45d9){_0x26b256=_0x1c45d9;logger['info'](_0xf2ba('0x48'),_0x26b256['id']);return getTicket(_0x28d8a9,_0x4350ba,_0x26b256,_0x13df88,_0x4507ed);})[_0xf2ba('0x16')](function(_0x268cf2){if(_0x268cf2){logger[_0xf2ba('0xa')](_0xf2ba('0x49'),_0x268cf2['id']);}})[_0xf2ba('0x55')](function(_0x32ea08){logger[_0xf2ba('0x53')]('['+_0x4507ed[_0xf2ba('0x61')][_0xf2ba('0x62')]()+']'+_0xf2ba('0x65'),util[_0xf2ba('0x57')](_0x32ea08,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 7525127..321190e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x851f=['Abandoned','Timeout','Call_Start_Time','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','stack','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','lodash','request-promise','md5','util','moment','ioredis','bluebird','zoho','defaults','redis','localhost','emit','[HTTP]','length','forEach','includes','string','picklist','idField','content','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','add','catch','error','Search\x20user','format','ActiveUsers','then','users','findIndex','info','Administrator','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','GET','Zoho-oauthtoken\x20','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','Subject','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','Called','Call_Result','rejected','Rejected','abandoned'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x851f,0xbb));var _0xf851=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x851f[_0x587fb5];return _0x551105;};'use strict';var _=require(_0xf851('0x0'));var rp=require(_0xf851('0x1'));var md5=require(_0xf851('0x2'));var util=require(_0xf851('0x3'));var intUtil=require('./util');var moment=require(_0xf851('0x4'));var Redis=require(_0xf851('0x5'));var BPromise=require(_0xf851('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xf851('0x7'));config['redis']=_[_0xf851('0x8')](config[_0xf851('0x9')],{'host':_0xf851('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf851('0x9')]));function emit(_0x5e70f5,_0x3e1c39,_0x41ee80){io['to'](_0x5e70f5)[_0xf851('0xb')](_0x3e1c39,_0x41ee80);}function request(_0x3d404b){logger['debug'](_0xf851('0xc'),JSON['stringify'](_0x3d404b));return rp(_0x3d404b);}function getCustomFields(_0x4e32d7,_0x387bea){var _0x5f5171={};if(_0x4e32d7[_0xf851('0xd')]>0x0){_[_0xf851('0xe')](_0x4e32d7,function(_0x2a4b8f){if(_[_0xf851('0xf')]([_0xf851('0x10'),_0xf851('0x11')],_0x2a4b8f['type'])&&_0x2a4b8f['idField']){_0x5f5171[_0x2a4b8f[_0xf851('0x12')]]=_0x2a4b8f[_0xf851('0x13')]['toString']();}else if(_0x2a4b8f[_0xf851('0x14')]===_0xf851('0x15')&&_0x2a4b8f[_0xf851('0x16')]&&_0x2a4b8f['idField']&&_0x387bea[_0x2a4b8f[_0xf851('0x16')]]){_0x5f5171[_0x2a4b8f[_0xf851('0x12')]]=_0x387bea[_0x2a4b8f[_0xf851('0x16')]]['toString']();}else if(_0x2a4b8f[_0xf851('0x14')]===_0xf851('0x17')&&_0x2a4b8f['Variable']&&_0x2a4b8f[_0xf851('0x18')][_0xf851('0x19')]&&_0x2a4b8f['idField']&&_0x387bea[_0x2a4b8f['Variable']['name'][_0xf851('0x1a')]()]){_0x5f5171[_0x2a4b8f[_0xf851('0x12')]]=_0x387bea[_0x2a4b8f[_0xf851('0x18')][_0xf851('0x19')][_0xf851('0x1a')]()]['toString']();}});}return _0x5f5171;}function getName(_0x1c1360){if(_0x1c1360[_0xf851('0x1b')]('\x20')>0x0){var _0x16b057=_0x1c1360[_0xf851('0x1c')](/ (.+)/);if(_0x16b057[0x1]){return _0x16b057;}}return[_0x1c1360,_0x1c1360];}var accountsTokens={};function getAccessToken(_0xb924d2){return new Promise(function(_0x1afac1,_0x28c41c){if(!_[_0xf851('0x1d')](accountsTokens[_0xb924d2['id']])&&!_[_0xf851('0x1d')](accountsTokens[_0xb924d2['id']]['access_token'])){if(moment()[_0xf851('0x1e')](accountsTokens[_0xb924d2['id']][_0xf851('0x1f')])){_0x1afac1(accountsTokens[_0xb924d2['id']]['access_token']);}}var _0xa5100c;switch(_0xb924d2[_0xf851('0x20')]){case'US':_0xa5100c=_0xf851('0x21');break;case'AU':_0xa5100c='https://accounts.zoho.com.au';break;case'EU':_0xa5100c=_0xf851('0x22');break;case'IN':_0xa5100c='https://accounts.zoho.in';break;case'CN':_0xa5100c='https://accounts.zoho.com.cn';break;default:_0xa5100c=_0xf851('0x22');break;}var _0x5e4157={'method':_0xf851('0x23'),'uri':_0xa5100c+_0xf851('0x24'),'qs':{'refresh_token':_0xb924d2[_0xf851('0x25')],'client_id':_0xb924d2[_0xf851('0x26')],'client_secret':_0xb924d2['clientSecret'],'grant_type':_0xf851('0x27')},'json':!![]};return rp(_0x5e4157)['then'](function(_0x23f06b){accountsTokens[_0xb924d2['id']]={'access_token':_0x23f06b[_0xf851('0x28')],'expires_in':moment()[_0xf851('0x29')](_0x23f06b[_0xf851('0x1f')],'seconds')};_0x1afac1(_0x23f06b['access_token']);})[_0xf851('0x2a')](function(_0x7284c1){logger[_0xf851('0x2b')]('Failing\x20creating\x20the\x20access_token',_0x7284c1['stack']);_0x28c41c(_0x7284c1);});});}function getUser(_0x776fa8,_0x21664f,_0x12a4ae,_0xc56115){logger['info'](_0xf851('0x2c'));return request({'method':'GET','uri':util[_0xf851('0x2d')]('https://www.zohoapis.%s/crm/v2/users',_0x21664f),'qs':{'type':_0xf851('0x2e')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x776fa8},'json':!![]})[_0xf851('0x2f')](function(_0x1f7d41){if(_0x1f7d41['users']){var _0x5a86b1=-0x1;if(_['isArrayLikeObject'](_0x1f7d41[_0xf851('0x30')])){if(!_['isNil'](_0xc56115)){_0x5a86b1=_[_0xf851('0x31')](_0x1f7d41[_0xf851('0x30')],function(_0x4b7b50){return _0x4b7b50['email']===_0xc56115;});}if(_0x5a86b1>=0x0){logger[_0xf851('0x32')]('Agent\x20found!');}else{logger[_0xf851('0x32')]('Using\x20the\x20admin\x20account!');_0x5a86b1=_[_0xf851('0x31')](_0x1f7d41[_0xf851('0x30')],function(_0x1628c5){return _0x1628c5['profile']['name']===_0xf851('0x33');});}return _0x1f7d41[_0xf851('0x30')][_0x5a86b1];}else{if(_0x1f7d41['user'][_0xf851('0x34')][_0xf851('0x19')]===_0xf851('0x33')){logger['info'](_0xf851('0x35'));user=_0x1f7d41['user'];return user;}else{logger[_0xf851('0x2b')](_0xf851('0x36'),JSON['stringify'](_0x1f7d41));throw new Error(_0xf851('0x37')+JSON[_0xf851('0x38')](_0x1f7d41));}}}else{logger[_0xf851('0x2b')](_0xf851('0x36'),JSON['stringify'](_0x1f7d41));throw new Error(_0xf851('0x37')+JSON[_0xf851('0x38')](_0x1f7d41));}})['catch'](function(_0x778cc0){console[_0xf851('0x2b')](_0x778cc0);});}function getZohoUser(_0x18ad81,_0x22cb9d){return new BPromise(function(_0x50b732,_0x5649b0){request(_0x18ad81)['then'](function(_0x227bd4){var _0x3401aa=null;if(_0x227bd4){_0x3401aa=_0x227bd4[_0xf851('0x39')][0x0];_0x3401aa[_0xf851('0x3a')]=_0x22cb9d;}_0x50b732(_0x3401aa);})[_0xf851('0x2a')](function(_0x3db1e1){_0x5649b0(_0x3db1e1);});});}function createEndUser(_0x1ff8a7,_0x49a51c,_0x6d85b1,_0x3e4e,_0x1d3fe8,_0x3625b8){var _0x6d85b1=getName(_0x6d85b1);return request({'method':'POST','uri':_0xf851('0x3b')+_0x49a51c+_0xf851('0x3c')+_[_0xf851('0x3d')](_0x3625b8[_0xf851('0x3e')])+'s','body':{'data':[{'Last_Name':_0x6d85b1[0x1],'First_Name':_0x6d85b1[0x0],'Phone':_0x3e4e,'Owner':{'name':!_[_0xf851('0x1d')](_0x1d3fe8['role'][_0xf851('0x19')])?_0x1d3fe8[_0xf851('0x3f')]['name']:!_[_0xf851('0x1d')](_0x1d3fe8['first_name'])?_0x1d3fe8[_0xf851('0x40')]+'\x20'+_0x1d3fe8['last_name']:_0x1d3fe8[_0xf851('0x41')],'id':_0x1d3fe8['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1ff8a7},'json':!![]})[_0xf851('0x2f')](function(_0x2e4986){if(_0x2e4986&&_0x2e4986[_0xf851('0x39')][0x0]['code']===_0xf851('0x42')){var _0x4a2386=_0x2e4986[_0xf851('0x39')][0x0][_0xf851('0x43')];_0x4a2386[_0xf851('0x3a')]=_[_0xf851('0x3d')](_0x3625b8['moduleCreate'])+'s';return _0x4a2386;}logger[_0xf851('0x2b')](_0xf851('0x36'),JSON['stringify'](data));throw new Error(_0xf851('0x44')+JSON['stringify'](data));})[_0xf851('0x2a')](function(_0x218966){console[_0xf851('0x45')](_0xf851('0x46'),_0x218966);});}function getEndUser(_0x394075,_0x4f7d47,_0x1a4ee4,_0x42a6f7,_0x202f1,_0x3fa7a5,_0x5f33d6){var _0xa2a031={'method':_0xf851('0x47'),'uri':'','headers':{'Authorization':_0xf851('0x48')+_0x394075},'json':!![]};switch(_0x5f33d6[_0xf851('0x49')]){case _0xf851('0x4a'):_0xa2a031['uri']=_0xf851('0x3b')+_0x4f7d47+_0xf851('0x4b')+_0x202f1+'))';return getZohoUser(_0xa2a031,_0xf851('0x4c'))[_0xf851('0x2f')](function(_0x3af2e4){if(_0x3af2e4)return _0x3af2e4;_0xa2a031[_0xf851('0x4d')]=_0xf851('0x3b')+_0x4f7d47+_0xf851('0x4e')+_0x202f1+'))';return getZohoUser(_0xa2a031,_0xf851('0x4f'))[_0xf851('0x2f')](function(_0x29823b){if(_0x29823b)return _0x29823b;if(_0x5f33d6['moduleCreate']!=_0xf851('0x50')){return createEndUser(_0x394075,_0x4f7d47,_0x42a6f7,_0x202f1,_0x3fa7a5,_0x5f33d6);}else{return{};}});});break;case'contact':_0xa2a031[_0xf851('0x4d')]=_0xf851('0x3b')+_0x4f7d47+_0xf851('0x4b')+_0x202f1+'))';return getZohoUser(_0xa2a031,_0xf851('0x4c'))[_0xf851('0x2f')](function(_0x591a38){if(_0x591a38)return _0x591a38;if(_0x5f33d6[_0xf851('0x3e')]!='nothing'){return createEndUser(_0x394075,_0x4f7d47,_0x42a6f7,_0x202f1,_0x3fa7a5,_0x5f33d6);}else{return{};}});break;case _0xf851('0x51'):_0xa2a031[_0xf851('0x4d')]='https://www.zohoapis.'+_0x4f7d47+_0xf851('0x4e')+_0x202f1+'))';return getZohoUser(_0xa2a031,_0xf851('0x4f'))[_0xf851('0x2f')](function(_0x17d3a7){if(_0x17d3a7)return _0x17d3a7;if(_0x5f33d6[_0xf851('0x3e')]!=_0xf851('0x50')){return createEndUser(_0x394075,_0x4f7d47,_0x42a6f7,_0x202f1,_0x3fa7a5,_0x5f33d6);}else{return{};}});break;}}function getCall(_0x29909e,_0x4fad86,_0x353b00,_0x499ade,_0x12a976,_0x5e70ad,_0xaeabc,_0xa556e5){logger[_0xf851('0x32')](_0xf851('0x52'));var _0x508d78={};_0x508d78[_0xf851('0x53')]={'name':!_['isNil'](_0x499ade[_0xf851('0x3f')][_0xf851('0x19')])&&!_[_0xf851('0x1d')](_0x499ade[_0xf851('0x34')][_0xf851('0x19')])&&_0x499ade[_0xf851('0x34')][_0xf851('0x19')]==='administrator'?_0x499ade['role']['name']:!_[_0xf851('0x1d')](_0x499ade[_0xf851('0x40')])?_0x499ade['first_name']+'\x20'+_0x499ade['last_name']:_0x499ade[_0xf851('0x41')],'id':_0x499ade['id']};_0x508d78[_0xf851('0x54')]=intUtil[_0xf851('0x55')](_0x5e70ad['Subjects'],_0xaeabc,'\x20');_0x508d78[_0xf851('0x56')]=intUtil[_0xf851('0x55')](_0x5e70ad['Descriptions'],_0xaeabc,'\x0a');if(_0x12a976[_0xf851('0x3a')]==='Contacts'){_0x508d78[_0xf851('0x57')]={'name':!_[_0xf851('0x1d')](_0x12a976[_0xf851('0x58')])?_0x12a976['Full_Name']:!_[_0xf851('0x1d')](_0x12a976[_0xf851('0x59')])?_0x12a976[_0xf851('0x59')]+'\x20'+_0x12a976[_0xf851('0x5a')]:_0x12a976[_0xf851('0x5a')],'id':_0x12a976['id']};}if(_0x12a976['enduserType']==='Leads'){_0x508d78[_0xf851('0x5b')]={'name':!_['isNil'](_0x12a976[_0xf851('0x58')])?_0x12a976[_0xf851('0x58')]:!_[_0xf851('0x1d')](_0x12a976[_0xf851('0x59')])?_0x12a976[_0xf851('0x59')]+'\x20'+_0x12a976[_0xf851('0x5a')]:_0x12a976[_0xf851('0x5a')],'id':_0x12a976['id']};_0x508d78['$se_module']=_[_0xf851('0x3d')](_0x12a976[_0xf851('0x3a')]);}if(_0xaeabc[_0xf851('0x5c')]){_0x508d78[_0xf851('0x5d')]=moment[_0xf851('0x5e')](parseInt(_0xaeabc[_0xf851('0x5c')])*0x3e8)[_0xf851('0x2d')](_0xf851('0x5f'));}else if(_0xaeabc[_0xf851('0x60')]&&_0xaeabc['endtime']){_0x508d78[_0xf851('0x5d')]=moment[_0xf851('0x5e')](moment(_0xaeabc[_0xf851('0x61')],'YYYY-MM-DDTHH:mm:ss')[_0xf851('0x62')](moment(_0xaeabc[_0xf851('0x63')],_0xf851('0x64'))))[_0xf851('0x2d')](_0xf851('0x5f'));}switch(_0xaeabc[_0xf851('0x65')]){case'called':_0x508d78['Call_Result']=_0xf851('0x66');break;case'complete':case'connect':_0x508d78[_0xf851('0x67')]='Answered';break;case _0xf851('0x68'):_0x508d78[_0xf851('0x67')]=_0xf851('0x69');break;case _0xf851('0x6a'):_0x508d78[_0xf851('0x67')]=_0xf851('0x6b');break;case'timeout':_0x508d78[_0xf851('0x67')]=_0xf851('0x6c');default:}_0x508d78[_0xf851('0x6d')]=(_0xa556e5==='outbound'?moment(_0xaeabc[_0xf851('0x63')])[_0xf851('0x2d')]('YYYY-MM-DDTHH:mm:ss'):moment(_0xaeabc['agentcalledAt'])[_0xf851('0x2d')](_0xf851('0x64')))||moment()[_0xf851('0x2d')](_0xf851('0x64'));_0x508d78[_0xf851('0x6e')]=_0xa556e5||_0xf851('0x6f');_0x508d78=_[_0xf851('0x70')](_0x508d78,getCustomFields(_0x5e70ad['Fields'],_0xaeabc));return request({'method':_0xf851('0x23'),'uri':_0xf851('0x3b')+_0x4fad86+_0xf851('0x71'),'headers':{'Authorization':_0xf851('0x48')+_0x29909e},'body':{'data':[_0x508d78]},'json':!![]})[_0xf851('0x2f')](function(_0x3fa899){if(_0x3fa899&&_0x3fa899[_0xf851('0x39')][0x0]['code']===_0xf851('0x42')){logger['info'](_0xf851('0x72'));return{'id':_0x3fa899[_0xf851('0x39')][0x0][_0xf851('0x43')]['id']};}})[_0xf851('0x2a')](function(_0x49f9d7){logger[_0xf851('0x32')](_0xf851('0x73'),_0x49f9d7[_0xf851('0x74')]);console[_0xf851('0x45')]('err',_0x49f9d7);});}exports['queue']=function(_0x1bad81,_0x5616df,_0x3b6aae,_0xf65535,_0x358516,_0x5d0011){var _0x264350,_0x848ce5,_0x4e9d13;_0x5d0011[_0xf851('0x75')]=intUtil[_0xf851('0x76')](_0x5d0011[_0xf851('0x75')]);_0x5d0011[_0xf851('0x77')]=intUtil[_0xf851('0x76')](_0x5d0011[_0xf851('0x77')]);if(_0x358516&&_0x358516[_0xf851('0x78')]){logger['info'](_0xf851('0x79'),_0xf851('0x7a'));_0x5616df[_0xf851('0x7b')]=_0x5d0011[_0xf851('0x77')]+_0xf851('0x7c')+_0x5616df[_0xf851('0x7d')]+_0xf851('0x7e')+md5(_0x5616df[_0xf851('0x7d')]);}else{_0x5616df['recordingURL']='';}var _0x119512=_0x5d0011[_0xf851('0x75')]===_0xf851('0x7f')?'eu':_0xf851('0x80');return getAccessToken(_0x5d0011)[_0xf851('0x2f')](function(_0x43799a){_0x4e9d13=_0x43799a;return getUser(_0x4e9d13,_0x119512,_0x5d0011,_0xf65535[_0xf851('0x81')]);})[_0xf851('0x2f')](function(_0x5b9931){_0x264350=_0x5b9931;logger[_0xf851('0x32')](_0xf851('0x82'),_0x264350['id']);return getEndUser(_0x4e9d13,_0x119512,_0x5d0011,_0x5616df[_0xf851('0x83')],_0x5616df[_0xf851('0x84')],_0x264350,_0x3b6aae);})[_0xf851('0x2f')](function(_0x227dd7){_0x848ce5=_0x227dd7;return getCall(_0x4e9d13,_0x119512,_0x5d0011,_0x264350,_0x848ce5,_0x3b6aae,_0x5616df,_0xf851('0x6f'));})[_0xf851('0x2f')](function(_0x2348d9){if(_0x2348d9){logger[_0xf851('0x32')](_0xf851('0x85'),_0x2348d9['id']);logger['info']('[QUEUE]',_0xf851('0x86'));emit(util[_0xf851('0x2d')]('user:%s',_0xf65535[_0xf851('0x19')]),_0xf851('0x87'),{'uri':'https://crm.'+_0x5d0011['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x2348d9['id']});}})['catch'](function(_0x3851fc){logger[_0xf851('0x2b')](_0xf851('0x79'),JSON[_0xf851('0x38')](_0x3851fc));});};exports[_0xf851('0x88')]=function(_0x47f1a4,_0x52a2fc,_0x24f4b3,_0x45725a,_0x41cd6a,_0x12ec6a,_0x3b0f85){var _0x56df2b,_0x58d93f,_0x3fae13;_0x12ec6a['host']=intUtil['stripTrailingSlash'](_0x12ec6a[_0xf851('0x75')]);_0x12ec6a[_0xf851('0x77')]=intUtil[_0xf851('0x76')](_0x12ec6a[_0xf851('0x77')]);if(_0x3b0f85&&_0x3b0f85[_0xf851('0x89')]&&_0x3b0f85[_0xf851('0x89')]!==_0xf851('0x8a')){logger[_0xf851('0x32')](_0xf851('0x8b'),_0xf851('0x7a'));_0x52a2fc[_0xf851('0x7b')]=_0x12ec6a['serverUrl']+'/api/voice/recordings/'+_0x52a2fc[_0xf851('0x7d')]+'/downloads?type=uniqueid&token='+md5(_0x52a2fc[_0xf851('0x7d')]);}var _0x281ac7=_0x12ec6a[_0xf851('0x75')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x12ec6a)[_0xf851('0x2f')](function(_0x5c0d42){_0x3fae13=_0x5c0d42;return getUser(_0x3fae13,_0x281ac7,_0x12ec6a,_0x45725a['email']);})[_0xf851('0x2f')](function(_0x535262){_0x56df2b=_0x535262;logger[_0xf851('0x32')](_0xf851('0x82'),_0x56df2b['id']);return getEndUser(_0x3fae13,_0x281ac7,_0x12ec6a,_0x52a2fc[_0xf851('0x8c')],_0x52a2fc[_0xf851('0x8d')],_0x56df2b,_0x24f4b3);})[_0xf851('0x2f')](function(_0x2f8800){_0x58d93f=_0x2f8800;return getCall(_0x3fae13,_0x281ac7,_0x12ec6a,_0x56df2b,_0x58d93f,_0x24f4b3,_0x52a2fc,_0xf851('0x8e'));})['then'](function(_0x36b8d6){if(_0x36b8d6){logger[_0xf851('0x32')](_0xf851('0x85'),_0x36b8d6['id']);logger[_0xf851('0x32')](_0xf851('0x8b'),_0xf851('0x86'));emit(util[_0xf851('0x2d')](_0xf851('0x8f'),_0x45725a['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x12ec6a[_0xf851('0x75')]+_0xf851('0x90')+_0x36b8d6['id']});}})['catch'](function(_0x3d69fc){logger['error'](_0xf851('0x8b'),JSON['stringify'](_0x3d69fc));});};exports[_0xf851('0x91')]=function(_0x265be4,_0x24a3c7,_0x3d9e7c,_0xadbeeb,_0x39ef12,_0x4b66fe){var _0x904a51,_0x2bbf87,_0x28dde4;_0x4b66fe[_0xf851('0x75')]=intUtil[_0xf851('0x76')](_0x4b66fe[_0xf851('0x75')]);_0x4b66fe[_0xf851('0x77')]=intUtil[_0xf851('0x76')](_0x4b66fe[_0xf851('0x77')]);if(_0x39ef12&&_0x39ef12['monitor_format']){logger['info']('['+_0x24a3c7[_0xf851('0x65')]['toUpperCase']()+']',_0xf851('0x7a'));_0x24a3c7[_0xf851('0x7b')]=_0x4b66fe[_0xf851('0x77')]+'/api/voice/recordings/'+_0x24a3c7[_0xf851('0x7d')]+'/downloads?type=uniqueid&token='+md5(_0x24a3c7[_0xf851('0x7d')]);}else{_0x24a3c7[_0xf851('0x7b')]='';}var _0x135a46=_0x4b66fe['host']===_0xf851('0x7f')?'eu':_0xf851('0x80');return getAccessToken(_0x4b66fe)['then'](function(_0x3f8157){_0x28dde4=_0x3f8157;return getUser(_0x28dde4,_0x135a46,_0x4b66fe);})[_0xf851('0x2f')](function(_0x1d741b){_0x904a51=_0x1d741b;logger['info'](_0xf851('0x82'),_0x904a51['id']);return getEndUser(_0x28dde4,_0x135a46,_0x4b66fe,_0x24a3c7[_0xf851('0x83')],_0x24a3c7[_0xf851('0x84')],_0x904a51,_0x3d9e7c);})[_0xf851('0x2f')](function(_0x2e0b1d){_0x2bbf87=_0x2e0b1d;return getCall(_0x28dde4,_0x135a46,_0x4b66fe,_0x904a51,_0x2bbf87,_0x3d9e7c,_0x24a3c7,_0xf851('0x6f'));})['then'](function(_0x4ec041){if(_0x4ec041){logger['info']('The\x20Call\x20ID\x20is:',_0x4ec041['id']);}})[_0xf851('0x2a')](function(_0x56609d){logger[_0xf851('0x2b')]('['+_0x24a3c7[_0xf851('0x65')][_0xf851('0x92')]()+']',JSON['stringify'](_0x56609d));});};
\ No newline at end of file
+var _0x950a=['Contacts','Who_Id','Full_Name','First_Name','Last_Name','$se_module','Call_Duration','utc','talktime','format','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','Call_Result','Called','connect','Answered','Rejected','abandoned','Abandoned','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','email','The\x20User\x20ID\x20is:','calleridname','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]','Recording\x20is\x20enabled!','zoho.eu','destcalleridname','destcalleridnum','Outbound','lastevent','toUpperCase','lodash','request-promise','md5','./util','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','[HTTP]','stringify','length','forEach','includes','string','idField','content','toString','variable','variableName','type','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','findIndex','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description'];(function(_0x89183e,_0x42fc4c){var _0x2a5f6b=function(_0x312487){while(--_0x312487){_0x89183e['push'](_0x89183e['shift']());}};_0x2a5f6b(++_0x42fc4c);}(_0x950a,0x174));var _0xa950=function(_0x5c6598,_0x48eec0){_0x5c6598=_0x5c6598-0x0;var _0x44a531=_0x950a[_0x5c6598];return _0x44a531;};'use strict';var _=require(_0xa950('0x0'));var rp=require(_0xa950('0x1'));var md5=require(_0xa950('0x2'));var util=require('util');var intUtil=require(_0xa950('0x3'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xa950('0x4'));var config=require(_0xa950('0x5'));var logger=require(_0xa950('0x6'))(_0xa950('0x7'));config[_0xa950('0x8')]=_[_0xa950('0x9')](config[_0xa950('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa950('0xa'))(new Redis(config[_0xa950('0x8')]));function emit(_0x13f2de,_0x713f2b,_0x11cf7a){io['to'](_0x13f2de)['emit'](_0x713f2b,_0x11cf7a);}function request(_0x595a04){logger['debug'](_0xa950('0xb'),JSON[_0xa950('0xc')](_0x595a04));return rp(_0x595a04);}function getCustomFields(_0x7b8429,_0xf1ac95){var _0x389a82={};if(_0x7b8429[_0xa950('0xd')]>0x0){_[_0xa950('0xe')](_0x7b8429,function(_0x2cccf8){if(_[_0xa950('0xf')]([_0xa950('0x10'),'picklist'],_0x2cccf8['type'])&&_0x2cccf8['idField']){_0x389a82[_0x2cccf8[_0xa950('0x11')]]=_0x2cccf8[_0xa950('0x12')][_0xa950('0x13')]();}else if(_0x2cccf8['type']===_0xa950('0x14')&&_0x2cccf8['variableName']&&_0x2cccf8[_0xa950('0x11')]&&_0xf1ac95[_0x2cccf8['variableName']]){_0x389a82[_0x2cccf8[_0xa950('0x11')]]=_0xf1ac95[_0x2cccf8[_0xa950('0x15')]][_0xa950('0x13')]();}else if(_0x2cccf8[_0xa950('0x16')]==='customVariable'&&_0x2cccf8[_0xa950('0x17')]&&_0x2cccf8['Variable'][_0xa950('0x18')]&&_0x2cccf8['idField']&&_0xf1ac95[_0x2cccf8[_0xa950('0x17')][_0xa950('0x18')][_0xa950('0x19')]()]){_0x389a82[_0x2cccf8['idField']]=_0xf1ac95[_0x2cccf8[_0xa950('0x17')][_0xa950('0x18')][_0xa950('0x19')]()][_0xa950('0x13')]();}});}return _0x389a82;}function getName(_0x4dc704){if(_0x4dc704['indexOf']('\x20')>0x0){var _0x137f27=_0x4dc704[_0xa950('0x1a')](/ (.+)/);if(_0x137f27[0x1]){return _0x137f27;}}return[_0x4dc704,_0x4dc704];}var accountsTokens={};function getAccessToken(_0x255dfc){return new Promise(function(_0x36291c,_0x5ec0cd){if(!_[_0xa950('0x1b')](accountsTokens[_0x255dfc['id']])&&!_[_0xa950('0x1b')](accountsTokens[_0x255dfc['id']][_0xa950('0x1c')])){if(moment()[_0xa950('0x1d')](accountsTokens[_0x255dfc['id']][_0xa950('0x1e')])){_0x36291c(accountsTokens[_0x255dfc['id']][_0xa950('0x1c')]);}}var _0x34eb49;switch(_0x255dfc['zone']){case'US':_0x34eb49=_0xa950('0x1f');break;case'AU':_0x34eb49='https://accounts.zoho.com.au';break;case'EU':_0x34eb49=_0xa950('0x20');break;case'IN':_0x34eb49=_0xa950('0x21');break;case'CN':_0x34eb49=_0xa950('0x22');break;default:_0x34eb49='https://accounts.zoho.eu';break;}var _0x5a21fb={'method':_0xa950('0x23'),'uri':_0x34eb49+_0xa950('0x24'),'qs':{'refresh_token':_0x255dfc[_0xa950('0x25')],'client_id':_0x255dfc[_0xa950('0x26')],'client_secret':_0x255dfc[_0xa950('0x27')],'grant_type':_0xa950('0x28')},'json':!![]};return rp(_0x5a21fb)['then'](function(_0x48e7bc){accountsTokens[_0x255dfc['id']]={'access_token':_0x48e7bc['access_token'],'expires_in':moment()[_0xa950('0x29')](_0x48e7bc[_0xa950('0x1e')],'seconds')};_0x36291c(_0x48e7bc[_0xa950('0x1c')]);})[_0xa950('0x2a')](function(_0xe06d3a){logger[_0xa950('0x2b')](_0xa950('0x2c'),_0xe06d3a[_0xa950('0x2d')]);_0x5ec0cd(_0xe06d3a);});});}function getUser(_0x48a711,_0x1f332c,_0x6d5632,_0x25f351){logger['info']('Search\x20user');return request({'method':_0xa950('0x2e'),'uri':util['format'](_0xa950('0x2f'),_0x1f332c),'qs':{'type':_0xa950('0x30')},'headers':{'Authorization':_0xa950('0x31')+_0x48a711},'json':!![]})[_0xa950('0x32')](function(_0x21e674){if(_0x21e674['users']){var _0x46f615=-0x1;if(_['isArrayLikeObject'](_0x21e674[_0xa950('0x33')])){if(!_[_0xa950('0x1b')](_0x25f351)){_0x46f615=_[_0xa950('0x34')](_0x21e674['users'],function(_0xd254e0){return _0xd254e0['email']===_0x25f351;});}if(_0x46f615>=0x0){logger['info'](_0xa950('0x35'));}else{logger[_0xa950('0x36')](_0xa950('0x37'));_0x46f615=_[_0xa950('0x34')](_0x21e674[_0xa950('0x33')],function(_0x30e1ff){return _0x30e1ff[_0xa950('0x38')][_0xa950('0x18')]===_0xa950('0x39');});}return _0x21e674[_0xa950('0x33')][_0x46f615];}else{if(_0x21e674[_0xa950('0x3a')]['profile'][_0xa950('0x18')]===_0xa950('0x39')){logger[_0xa950('0x36')]('Using\x20the\x20admin\x20account!');user=_0x21e674[_0xa950('0x3a')];return user;}else{logger[_0xa950('0x2b')](_0xa950('0x3b'),JSON[_0xa950('0xc')](_0x21e674));throw new Error(_0xa950('0x3c')+JSON[_0xa950('0xc')](_0x21e674));}}}else{logger[_0xa950('0x2b')](_0xa950('0x3b'),JSON[_0xa950('0xc')](_0x21e674));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x21e674));}})[_0xa950('0x2a')](function(_0x32541a){console[_0xa950('0x2b')](_0x32541a);});}function getZohoUser(_0x47b7bd,_0x5ed179){return new BPromise(function(_0x5252d1,_0x4ae8cb){request(_0x47b7bd)[_0xa950('0x32')](function(_0x29a59f){var _0x4a539f=null;if(_0x29a59f){_0x4a539f=_0x29a59f[_0xa950('0x3d')][0x0];_0x4a539f[_0xa950('0x3e')]=_0x5ed179;}_0x5252d1(_0x4a539f);})[_0xa950('0x2a')](function(_0x3c32e6){_0x4ae8cb(_0x3c32e6);});});}function createEndUser(_0x524d01,_0x2e5e41,_0x2ef4c8,_0x53c0a9,_0x5d625c,_0x2f634e){var _0x2ef4c8=getName(_0x2ef4c8);return request({'method':_0xa950('0x23'),'uri':_0xa950('0x3f')+_0x2e5e41+'/crm/v2/'+_['startCase'](_0x2f634e[_0xa950('0x40')])+'s','body':{'data':[{'Last_Name':_0x2ef4c8[0x1],'First_Name':_0x2ef4c8[0x0],'Phone':_0x53c0a9,'Owner':{'name':!_[_0xa950('0x1b')](_0x5d625c[_0xa950('0x41')][_0xa950('0x18')])?_0x5d625c['role'][_0xa950('0x18')]:!_['isNil'](_0x5d625c[_0xa950('0x42')])?_0x5d625c['first_name']+'\x20'+_0x5d625c['last_name']:_0x5d625c[_0xa950('0x43')],'id':_0x5d625c['id']}}]},'headers':{'Authorization':_0xa950('0x31')+_0x524d01},'json':!![]})[_0xa950('0x32')](function(_0x481b9e){if(_0x481b9e&&_0x481b9e[_0xa950('0x3d')][0x0][_0xa950('0x44')]===_0xa950('0x45')){var _0x221eab=_0x481b9e[_0xa950('0x3d')][0x0][_0xa950('0x46')];_0x221eab[_0xa950('0x3e')]=_[_0xa950('0x47')](_0x2f634e[_0xa950('0x40')])+'s';return _0x221eab;}logger[_0xa950('0x2b')](_0xa950('0x3b'),JSON['stringify'](data));throw new Error(_0xa950('0x48')+JSON[_0xa950('0xc')](data));})[_0xa950('0x2a')](function(_0x609ea){console['log'](_0xa950('0x49'),_0x609ea);});}function getEndUser(_0x45d79e,_0x4112c5,_0x1c864c,_0x142413,_0x5ed791,_0x29e1e0,_0x5ec742){var _0x5522b8={'method':_0xa950('0x2e'),'uri':'','headers':{'Authorization':_0xa950('0x31')+_0x45d79e},'json':!![]};switch(_0x5ec742[_0xa950('0x4a')]){case _0xa950('0x4b'):_0x5522b8[_0xa950('0x4c')]=_0xa950('0x3f')+_0x4112c5+_0xa950('0x4d')+_0x5ed791+'))';return getZohoUser(_0x5522b8,'Contacts')[_0xa950('0x32')](function(_0x4d0829){if(_0x4d0829)return _0x4d0829;_0x5522b8[_0xa950('0x4c')]=_0xa950('0x3f')+_0x4112c5+_0xa950('0x4e')+_0x5ed791+'))';return getZohoUser(_0x5522b8,'Leads')[_0xa950('0x32')](function(_0x44fc78){if(_0x44fc78)return _0x44fc78;if(_0x5ec742[_0xa950('0x40')]!='nothing'){return createEndUser(_0x45d79e,_0x4112c5,_0x142413,_0x5ed791,_0x29e1e0,_0x5ec742);}else{return{};}});});break;case _0xa950('0x4f'):_0x5522b8[_0xa950('0x4c')]=_0xa950('0x3f')+_0x4112c5+_0xa950('0x4d')+_0x5ed791+'))';return getZohoUser(_0x5522b8,'Contacts')['then'](function(_0xd35fc0){if(_0xd35fc0)return _0xd35fc0;if(_0x5ec742[_0xa950('0x40')]!=_0xa950('0x50')){return createEndUser(_0x45d79e,_0x4112c5,_0x142413,_0x5ed791,_0x29e1e0,_0x5ec742);}else{return{};}});break;case _0xa950('0x51'):_0x5522b8[_0xa950('0x4c')]=_0xa950('0x3f')+_0x4112c5+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5ed791+'))';return getZohoUser(_0x5522b8,_0xa950('0x52'))[_0xa950('0x32')](function(_0x3573f3){if(_0x3573f3)return _0x3573f3;if(_0x5ec742['moduleCreate']!=_0xa950('0x50')){return createEndUser(_0x45d79e,_0x4112c5,_0x142413,_0x5ed791,_0x29e1e0,_0x5ec742);}else{return{};}});break;}}function getCall(_0x5f42ed,_0x114f0d,_0x54da3a,_0xa5f66e,_0x59cb18,_0x25628f,_0x1cfdbf,_0x5b6f1b){logger[_0xa950('0x36')](_0xa950('0x53'));var _0x3a4f73={};_0x3a4f73[_0xa950('0x54')]={'name':!_['isNil'](_0xa5f66e['role']['name'])&&!_[_0xa950('0x1b')](_0xa5f66e[_0xa950('0x38')][_0xa950('0x18')])&&_0xa5f66e[_0xa950('0x38')][_0xa950('0x18')]===_0xa950('0x55')?_0xa5f66e[_0xa950('0x41')][_0xa950('0x18')]:!_['isNil'](_0xa5f66e['first_name'])?_0xa5f66e['first_name']+'\x20'+_0xa5f66e[_0xa950('0x43')]:_0xa5f66e[_0xa950('0x43')],'id':_0xa5f66e['id']};_0x3a4f73[_0xa950('0x56')]=intUtil[_0xa950('0x57')](_0x25628f[_0xa950('0x58')],_0x1cfdbf,'\x20');_0x3a4f73[_0xa950('0x59')]=intUtil[_0xa950('0x57')](_0x25628f['Descriptions'],_0x1cfdbf,'\x0a');if(_0x59cb18[_0xa950('0x3e')]===_0xa950('0x5a')){_0x3a4f73[_0xa950('0x5b')]={'name':!_[_0xa950('0x1b')](_0x59cb18[_0xa950('0x5c')])?_0x59cb18['Full_Name']:!_[_0xa950('0x1b')](_0x59cb18[_0xa950('0x5d')])?_0x59cb18['First_Name']+'\x20'+_0x59cb18[_0xa950('0x5e')]:_0x59cb18[_0xa950('0x5e')],'id':_0x59cb18['id']};}if(_0x59cb18[_0xa950('0x3e')]==='Leads'){_0x3a4f73['What_Id']={'name':!_['isNil'](_0x59cb18[_0xa950('0x5c')])?_0x59cb18['Full_Name']:!_[_0xa950('0x1b')](_0x59cb18[_0xa950('0x5d')])?_0x59cb18[_0xa950('0x5d')]+'\x20'+_0x59cb18[_0xa950('0x5e')]:_0x59cb18[_0xa950('0x5e')],'id':_0x59cb18['id']};_0x3a4f73[_0xa950('0x5f')]=_[_0xa950('0x47')](_0x59cb18[_0xa950('0x3e')]);}if(_0x1cfdbf['talktime']){_0x3a4f73[_0xa950('0x60')]=moment[_0xa950('0x61')](parseInt(_0x1cfdbf[_0xa950('0x62')])*0x3e8)[_0xa950('0x63')]('mm:ss');}else if(_0x1cfdbf[_0xa950('0x64')]&&_0x1cfdbf[_0xa950('0x65')]){_0x3a4f73[_0xa950('0x60')]=moment[_0xa950('0x61')](moment(_0x1cfdbf[_0xa950('0x65')],_0xa950('0x66'))['diff'](moment(_0x1cfdbf[_0xa950('0x67')],_0xa950('0x66'))))['format'](_0xa950('0x68'));}switch(_0x1cfdbf['lastevent']){case'called':_0x3a4f73[_0xa950('0x69')]=_0xa950('0x6a');break;case'complete':case _0xa950('0x6b'):_0x3a4f73[_0xa950('0x69')]=_0xa950('0x6c');break;case'rejected':_0x3a4f73['Call_Result']=_0xa950('0x6d');break;case _0xa950('0x6e'):_0x3a4f73[_0xa950('0x69')]=_0xa950('0x6f');break;case'timeout':_0x3a4f73[_0xa950('0x69')]=_0xa950('0x70');default:}_0x3a4f73['Call_Start_Time']=(_0x5b6f1b===_0xa950('0x71')?moment(_0x1cfdbf['starttime'])[_0xa950('0x63')](_0xa950('0x66')):moment(_0x1cfdbf[_0xa950('0x72')])[_0xa950('0x63')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xa950('0x63')]('YYYY-MM-DDTHH:mm:ss');_0x3a4f73[_0xa950('0x73')]=_0x5b6f1b||_0xa950('0x74');_0x3a4f73=_[_0xa950('0x75')](_0x3a4f73,getCustomFields(_0x25628f[_0xa950('0x76')],_0x1cfdbf));return request({'method':'POST','uri':_0xa950('0x3f')+_0x114f0d+_0xa950('0x77'),'headers':{'Authorization':_0xa950('0x31')+_0x5f42ed},'body':{'data':[_0x3a4f73]},'json':!![]})[_0xa950('0x32')](function(_0x30ba01){if(_0x30ba01&&_0x30ba01[_0xa950('0x3d')][0x0][_0xa950('0x44')]==='SUCCESS'){logger['info'](_0xa950('0x78'));return{'id':_0x30ba01[_0xa950('0x3d')][0x0]['details']['id']};}})['catch'](function(_0x538f01){logger[_0xa950('0x36')]('err',_0x538f01['stack']);console[_0xa950('0x79')](_0xa950('0x7a'),_0x538f01);});}exports[_0xa950('0x7b')]=function(_0x41e012,_0x3a783b,_0x2f60ec,_0x57e9e9,_0x225aed,_0x5a3a6e){var _0x1eb8b7,_0x235e30,_0xd416c7;_0x5a3a6e[_0xa950('0x7c')]=intUtil[_0xa950('0x7d')](_0x5a3a6e['host']);_0x5a3a6e[_0xa950('0x7e')]=intUtil[_0xa950('0x7d')](_0x5a3a6e[_0xa950('0x7e')]);if(_0x225aed&&_0x225aed[_0xa950('0x7f')]){logger[_0xa950('0x36')](_0xa950('0x80'),'Recording\x20is\x20enabled!');_0x3a783b[_0xa950('0x81')]=_0x5a3a6e[_0xa950('0x7e')]+_0xa950('0x82')+_0x3a783b[_0xa950('0x83')]+_0xa950('0x84')+md5(_0x3a783b['uniqueid']);}else{_0x3a783b['recordingURL']='';}var _0x5dccd8=_0x5a3a6e[_0xa950('0x7c')]==='zoho.eu'?'eu':_0xa950('0x85');return getAccessToken(_0x5a3a6e)[_0xa950('0x32')](function(_0x2c6baa){_0xd416c7=_0x2c6baa;return getUser(_0xd416c7,_0x5dccd8,_0x5a3a6e,_0x57e9e9[_0xa950('0x86')]);})[_0xa950('0x32')](function(_0x57c792){_0x1eb8b7=_0x57c792;logger['info'](_0xa950('0x87'),_0x1eb8b7['id']);return getEndUser(_0xd416c7,_0x5dccd8,_0x5a3a6e,_0x3a783b[_0xa950('0x88')],_0x3a783b[_0xa950('0x89')],_0x1eb8b7,_0x2f60ec);})[_0xa950('0x32')](function(_0x4018cd){_0x235e30=_0x4018cd;return getCall(_0xd416c7,_0x5dccd8,_0x5a3a6e,_0x1eb8b7,_0x235e30,_0x2f60ec,_0x3a783b,'Inbound');})[_0xa950('0x32')](function(_0x23e2fd){if(_0x23e2fd){logger['info'](_0xa950('0x8a'),_0x23e2fd['id']);logger[_0xa950('0x36')](_0xa950('0x80'),_0xa950('0x8b'));emit(util['format'](_0xa950('0x8c'),_0x57e9e9['name']),_0xa950('0x8d'),{'uri':_0xa950('0x8e')+_0x5a3a6e[_0xa950('0x7c')]+_0xa950('0x8f')+_0x23e2fd['id']});}})['catch'](function(_0x356e16){logger[_0xa950('0x2b')](_0xa950('0x80'),JSON['stringify'](_0x356e16));});};exports[_0xa950('0x71')]=function(_0x50cfca,_0x5c4ed2,_0x4c011f,_0x4b066e,_0x3dba70,_0x3b26d5,_0x431118){var _0x18d886,_0x567d1b,_0x2e4ff6;_0x3b26d5[_0xa950('0x7c')]=intUtil[_0xa950('0x7d')](_0x3b26d5[_0xa950('0x7c')]);_0x3b26d5[_0xa950('0x7e')]=intUtil['stripTrailingSlash'](_0x3b26d5[_0xa950('0x7e')]);if(_0x431118&&_0x431118[_0xa950('0x90')]&&_0x431118[_0xa950('0x90')]!==_0xa950('0x91')){logger[_0xa950('0x36')](_0xa950('0x92'),_0xa950('0x93'));_0x5c4ed2[_0xa950('0x81')]=_0x3b26d5[_0xa950('0x7e')]+'/api/voice/recordings/'+_0x5c4ed2[_0xa950('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x5c4ed2[_0xa950('0x83')]);}var _0x582c1c=_0x3b26d5[_0xa950('0x7c')]===_0xa950('0x94')?'eu':'com';return getAccessToken(_0x3b26d5)[_0xa950('0x32')](function(_0x1c24c6){_0x2e4ff6=_0x1c24c6;return getUser(_0x2e4ff6,_0x582c1c,_0x3b26d5,_0x4b066e['email']);})[_0xa950('0x32')](function(_0x26b8c8){_0x18d886=_0x26b8c8;logger[_0xa950('0x36')](_0xa950('0x87'),_0x18d886['id']);return getEndUser(_0x2e4ff6,_0x582c1c,_0x3b26d5,_0x5c4ed2[_0xa950('0x95')],_0x5c4ed2[_0xa950('0x96')],_0x18d886,_0x4c011f);})['then'](function(_0x4a0071){_0x567d1b=_0x4a0071;return getCall(_0x2e4ff6,_0x582c1c,_0x3b26d5,_0x18d886,_0x567d1b,_0x4c011f,_0x5c4ed2,_0xa950('0x97'));})[_0xa950('0x32')](function(_0x32e0d8){if(_0x32e0d8){logger[_0xa950('0x36')](_0xa950('0x8a'),_0x32e0d8['id']);logger[_0xa950('0x36')](_0xa950('0x92'),_0xa950('0x8b'));emit(util[_0xa950('0x63')](_0xa950('0x8c'),_0x4b066e[_0xa950('0x18')]),_0xa950('0x8d'),{'uri':'https://crm.'+_0x3b26d5[_0xa950('0x7c')]+_0xa950('0x8f')+_0x32e0d8['id']});}})[_0xa950('0x2a')](function(_0x55bff8){logger['error']('[OUTBOUND]',JSON[_0xa950('0xc')](_0x55bff8));});};exports['unmanaged']=function(_0x8231ed,_0xa85073,_0xd38c71,_0x3ec4fe,_0x313212,_0x1c1329){var _0x4bea36,_0x17af6b,_0x41c585;_0x1c1329['host']=intUtil[_0xa950('0x7d')](_0x1c1329[_0xa950('0x7c')]);_0x1c1329['serverUrl']=intUtil[_0xa950('0x7d')](_0x1c1329['serverUrl']);if(_0x313212&&_0x313212[_0xa950('0x7f')]){logger[_0xa950('0x36')]('['+_0xa85073[_0xa950('0x98')][_0xa950('0x99')]()+']',_0xa950('0x93'));_0xa85073[_0xa950('0x81')]=_0x1c1329[_0xa950('0x7e')]+_0xa950('0x82')+_0xa85073[_0xa950('0x83')]+'/downloads?type=uniqueid&token='+md5(_0xa85073['uniqueid']);}else{_0xa85073[_0xa950('0x81')]='';}var _0x4adc2d=_0x1c1329[_0xa950('0x7c')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x1c1329)[_0xa950('0x32')](function(_0x2dedeb){_0x41c585=_0x2dedeb;return getUser(_0x41c585,_0x4adc2d,_0x1c1329);})['then'](function(_0x262954){_0x4bea36=_0x262954;logger[_0xa950('0x36')](_0xa950('0x87'),_0x4bea36['id']);return getEndUser(_0x41c585,_0x4adc2d,_0x1c1329,_0xa85073[_0xa950('0x88')],_0xa85073[_0xa950('0x89')],_0x4bea36,_0xd38c71);})['then'](function(_0x27c6a4){_0x17af6b=_0x27c6a4;return getCall(_0x41c585,_0x4adc2d,_0x1c1329,_0x4bea36,_0x17af6b,_0xd38c71,_0xa85073,_0xa950('0x74'));})[_0xa950('0x32')](function(_0x46a02f){if(_0x46a02f){logger[_0xa950('0x36')]('The\x20Call\x20ID\x20is:',_0x46a02f['id']);}})['catch'](function(_0x35f73b){logger['error']('['+_0xa85073['lastevent'][_0xa950('0x99')]()+']',JSON[_0xa950('0xc')](_0x35f73b));});};
\ No newline at end of file
index 4c03929..83b3e85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b65=['shelljs','mustache','../../../../config/logger','data2','Script','data3','exec','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x41b01e,_0x40b15e){var _0xaaff27=function(_0x24bcb8){while(--_0x24bcb8){_0x41b01e['push'](_0x41b01e['shift']());}};_0xaaff27(++_0x40b15e);}(_0x8b65,0xa7));var _0x58b6=function(_0x591759,_0x597d1a){_0x591759=_0x591759-0x0;var _0x1b9669=_0x8b65[_0x591759];return _0x1b9669;};'use strict';var util=require(_0x58b6('0x0'));var sh=require(_0x58b6('0x1'));var Mustache=require(_0x58b6('0x2'));var logger=require(_0x58b6('0x3'))('trigger');exports['exec']=function(_0x32c316,_0x515bbc){var _0x283b3f=_0x32c316['data2']?_0x32c316[_0x58b6('0x4')]:_0x58b6('0x5');var _0x2e4bfc=_0x32c316[_0x58b6('0x6')]?Mustache['render'](_0x32c316['data3'],_0x515bbc):_0x515bbc;sh[_0x58b6('0x7')](_0x2e4bfc,function(_0x912011,_0x50cf09,_0x3f180c){if(_0x912011!==0x0){logger[_0x58b6('0x8')](util[_0x58b6('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x283b3f,_0x2e4bfc,_0x912011,_0x3f180c));}else{logger[_0x58b6('0xa')](util[_0x58b6('0x9')](_0x58b6('0xb'),_0x283b3f,_0x2e4bfc,_0x50cf09));}});};
\ No newline at end of file
+var _0x3468=['trigger','exec','data2','Script','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','shelljs','../../../../config/logger'];(function(_0x5a0070,_0x60e798){var _0xb3205a=function(_0x34409d){while(--_0x34409d){_0x5a0070['push'](_0x5a0070['shift']());}};_0xb3205a(++_0x60e798);}(_0x3468,0x13d));var _0x8346=function(_0x1afa40,_0x9d7427){_0x1afa40=_0x1afa40-0x0;var _0x26d8e9=_0x3468[_0x1afa40];return _0x26d8e9;};'use strict';var util=require('util');var sh=require(_0x8346('0x0'));var Mustache=require('mustache');var logger=require(_0x8346('0x1'))(_0x8346('0x2'));exports[_0x8346('0x3')]=function(_0x263f5d,_0x12a00f){var _0x527b80=_0x263f5d[_0x8346('0x4')]?_0x263f5d['data2']:_0x8346('0x5');var _0x1453bf=_0x263f5d['data3']?Mustache['render'](_0x263f5d['data3'],_0x12a00f):_0x12a00f;sh[_0x8346('0x3')](_0x1453bf,function(_0x396894,_0x2a2ea7,_0x9baf67){if(_0x396894!==0x0){logger[_0x8346('0x6')](util[_0x8346('0x7')](_0x8346('0x8'),_0x527b80,_0x1453bf,_0x396894,_0x9baf67));}else{logger[_0x8346('0x9')](util[_0x8346('0x7')](_0x8346('0xa'),_0x527b80,_0x1453bf,_0x2a2ea7));}});};
\ No newline at end of file
index fd12bd3..ab97a34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x448e=['data1','render','data2','data5','parse','error','stack','toUpperCase','GET','DELETE','POST','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','lodash','mustache','../../../../config/logger','trigger','exec'];(function(_0x3af87b,_0x1dbf74){var _0x1dc8f3=function(_0x2220a3){while(--_0x2220a3){_0x3af87b['push'](_0x3af87b['shift']());}};_0x1dc8f3(++_0x1dbf74);}(_0x448e,0xc1));var _0xe448=function(_0x449acc,_0x416458){_0x449acc=_0x449acc-0x0;var _0x15d15d=_0x448e[_0x449acc];return _0x15d15d;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0xe448('0x0'));var Mustache=require(_0xe448('0x1'));var logger=require(_0xe448('0x2'))(_0xe448('0x3'));exports[_0xe448('0x4')]=function(_0xaae21b,_0x54302b){var _0x1615db,_0x5abfdb;var _0x415ef0={'method':_0xaae21b[_0xe448('0x5')]['toUpperCase'](),'uri':Mustache[_0xe448('0x6')](_0xaae21b[_0xe448('0x7')],_0x54302b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xaae21b[_0xe448('0x8')])==='number'&&parseInt(_0xaae21b[_0xe448('0x8')])>=0x1&&parseInt(_0xaae21b[_0xe448('0x8')])<=0xa?parseInt(_0xaae21b[_0xe448('0x8')])*0x3e8:0x5*0x3e8};try{_0x415ef0['headers']=_0xaae21b['data6']?JSON[_0xe448('0x9')](Mustache[_0xe448('0x6')](_0xaae21b['data6'],_0x54302b)):{};}catch(_0x85e773){logger[_0xe448('0xa')](_0x85e773[_0xe448('0xb')]);}switch(_0xaae21b[_0xe448('0x5')][_0xe448('0xc')]()){case _0xe448('0xd'):case _0xe448('0xe'):_0x1615db=null;_0x415ef0['qs']=_0x54302b;break;case _0xe448('0xf'):case _0xe448('0x10'):if(_0xaae21b['data7']){try{_0x1615db=JSON['parse'](Mustache[_0xe448('0x6')](_0xaae21b[_0xe448('0x11')],_0x54302b));_0x415ef0[_0xe448('0x12')]=_0x1615db;}catch(_0x4f485c){logger[_0xe448('0xa')](_0x4f485c[_0xe448('0xb')]);logger[_0xe448('0xa')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x1615db=_0x54302b;_0x415ef0[_0xe448('0x12')]=_0x1615db;}break;}logger[_0xe448('0x13')](util[_0xe448('0x14')](_0xe448('0x15'),_0xaae21b['data1'],_0xaae21b[_0xe448('0x7')],JSON['stringify'](_0x415ef0)));rp(_0x415ef0)[_0xe448('0x16')](function(_0x55c1c6){_0x1615db=!_[_0xe448('0x17')](_0x1615db)?_0xe448('0x18')+_0x1615db:'';_0x5abfdb=typeof _0x55c1c6['body']===_0xe448('0x19')?JSON[_0xe448('0x1a')](_0x55c1c6['body']):_0x55c1c6[_0xe448('0x12')];logger['info'](util[_0xe448('0x14')](_0xe448('0x1b'),_0xaae21b[_0xe448('0x5')],_0xaae21b['data2'],_0x55c1c6[_0xe448('0x1c')],_0x5abfdb));})[_0xe448('0x1d')](function(_0x592a8d){logger[_0xe448('0xa')](util[_0xe448('0x14')](_0xe448('0x1e'),_0xaae21b[_0xe448('0x5')],_0xaae21b[_0xe448('0x7')],_0x592a8d['statusCode'],_0x592a8d[_0xe448('0x1f')],_0x592a8d[_0xe448('0x20')]));});};
\ No newline at end of file
+var _0xc0c3=['parse','error','GET','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0xc0c3,0x12c));var _0x3c0c=function(_0xb6d7b9,_0x2ad427){_0xb6d7b9=_0xb6d7b9-0x0;var _0xdbfd51=_0xc0c3[_0xb6d7b9];return _0xdbfd51;};'use strict';var rp=require(_0x3c0c('0x0'));var util=require(_0x3c0c('0x1'));var _=require(_0x3c0c('0x2'));var Mustache=require(_0x3c0c('0x3'));var logger=require(_0x3c0c('0x4'))(_0x3c0c('0x5'));exports[_0x3c0c('0x6')]=function(_0x4391cd,_0x20de14){var _0x1dee70,_0x343081;var _0x4d7345={'method':_0x4391cd[_0x3c0c('0x7')][_0x3c0c('0x8')](),'uri':Mustache[_0x3c0c('0x9')](_0x4391cd[_0x3c0c('0xa')],_0x20de14),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4391cd[_0x3c0c('0xb')])===_0x3c0c('0xc')&&parseInt(_0x4391cd[_0x3c0c('0xb')])>=0x1&&parseInt(_0x4391cd[_0x3c0c('0xb')])<=0xa?parseInt(_0x4391cd[_0x3c0c('0xb')])*0x3e8:0x5*0x3e8};try{_0x4d7345[_0x3c0c('0xd')]=_0x4391cd[_0x3c0c('0xe')]?JSON[_0x3c0c('0xf')](Mustache[_0x3c0c('0x9')](_0x4391cd[_0x3c0c('0xe')],_0x20de14)):{};}catch(_0x5cfccd){logger[_0x3c0c('0x10')](_0x5cfccd['stack']);}switch(_0x4391cd[_0x3c0c('0x7')][_0x3c0c('0x8')]()){case _0x3c0c('0x11'):case'DELETE':_0x1dee70=null;_0x4d7345['qs']=_0x20de14;break;case'POST':case _0x3c0c('0x12'):if(_0x4391cd[_0x3c0c('0x13')]){try{_0x1dee70=JSON['parse'](Mustache[_0x3c0c('0x9')](_0x4391cd['data7'],_0x20de14));_0x4d7345[_0x3c0c('0x14')]=_0x1dee70;}catch(_0x25e8a9){logger[_0x3c0c('0x10')](_0x25e8a9[_0x3c0c('0x15')]);logger[_0x3c0c('0x10')](_0x3c0c('0x16'));}}else{_0x1dee70=_0x20de14;_0x4d7345[_0x3c0c('0x14')]=_0x1dee70;}break;}logger[_0x3c0c('0x17')](util[_0x3c0c('0x18')](_0x3c0c('0x19'),_0x4391cd[_0x3c0c('0x7')],_0x4391cd[_0x3c0c('0xa')],JSON[_0x3c0c('0x1a')](_0x4d7345)));rp(_0x4d7345)['then'](function(_0xd258a0){_0x1dee70=!_[_0x3c0c('0x1b')](_0x1dee70)?',\x20request\x20body:\x20'+_0x1dee70:'';_0x343081=typeof _0xd258a0['body']===_0x3c0c('0x1c')?JSON['stringify'](_0xd258a0[_0x3c0c('0x14')]):_0xd258a0[_0x3c0c('0x14')];logger[_0x3c0c('0x17')](util[_0x3c0c('0x18')](_0x3c0c('0x1d'),_0x4391cd[_0x3c0c('0x7')],_0x4391cd['data2'],_0xd258a0[_0x3c0c('0x1e')],_0x343081));})[_0x3c0c('0x1f')](function(_0x32fea1){logger[_0x3c0c('0x10')](util['format'](_0x3c0c('0x20'),_0x4391cd[_0x3c0c('0x7')],_0x4391cd['data2'],_0x32fea1['statusCode'],_0x32fea1[_0x3c0c('0x21')],_0x32fea1[_0x3c0c('0x22')]));});};
\ No newline at end of file
index 1089826..e807709 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5903=['result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','debug','rpc','error','message'];(function(_0x58fb28,_0x3699fe){var _0x1b99bc=function(_0x4fc7bd){while(--_0x4fc7bd){_0x58fb28['push'](_0x58fb28['shift']());}};_0x1b99bc(++_0x3699fe);}(_0x5903,0x148));var _0x3590=function(_0x1f4da0,_0x33a12d){_0x1f4da0=_0x1f4da0-0x0;var _0x578a16=_0x5903[_0x1f4da0];return _0x578a16;};'use strict';var jayson=require(_0x3590('0x0'));var BPromise=require('bluebird');var logger=require(_0x3590('0x1'))(_0x3590('0x2'));var client=jayson[_0x3590('0x3')][_0x3590('0x4')]({'port':0x2329});client[_0x3590('0x5')]=function(_0x91a03,_0x4ccf7b){return new BPromise(function(_0x237b39,_0xbfed04){return client['request'](_0x91a03,_0x4ccf7b)['then'](function(_0x5afa2f){logger[_0x3590('0x6')](_0x3590('0x7'),'routing',_0x91a03,_0x4ccf7b,_0x5afa2f);if(_0x5afa2f['error']){logger[_0x3590('0x8')](_0x3590('0x7'),_0x3590('0x2'),_0x91a03,_0x5afa2f['error'][_0x3590('0x9')],_0x4ccf7b);return _0xbfed04(_0x5afa2f[_0x3590('0x8')][_0x3590('0x9')]);}else{return _0x237b39(_0x5afa2f[_0x3590('0xa')]);}})[_0x3590('0xb')](function(_0x5bf9e4){logger[_0x3590('0x8')](_0x3590('0x7'),_0x3590('0x2'),_0x91a03,_0x5bf9e4,_0x4ccf7b);return _0xbfed04(_0x5bf9e4);});});};module[_0x3590('0xc')]=client;
\ No newline at end of file
+var _0x4b25=['catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error','message'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x4b25,0x1d4));var _0x54b2=function(_0x29bbef,_0xd6db96){_0x29bbef=_0x29bbef-0x0;var _0x2845b4=_0x4b25[_0x29bbef];return _0x2845b4;};'use strict';var jayson=require(_0x54b2('0x0'));var BPromise=require(_0x54b2('0x1'));var logger=require(_0x54b2('0x2'))(_0x54b2('0x3'));var client=jayson[_0x54b2('0x4')][_0x54b2('0x5')]({'port':0x2329});client[_0x54b2('0x6')]=function(_0x391e70,_0x268b6a){return new BPromise(function(_0x4b66e6,_0x392813){return client[_0x54b2('0x7')](_0x391e70,_0x268b6a)[_0x54b2('0x8')](function(_0x57f6d0){logger[_0x54b2('0x9')]('rpc',_0x54b2('0x3'),_0x391e70,_0x268b6a,_0x57f6d0);if(_0x57f6d0[_0x54b2('0xa')]){logger[_0x54b2('0xa')]('rpc',_0x54b2('0x3'),_0x391e70,_0x57f6d0[_0x54b2('0xa')][_0x54b2('0xb')],_0x268b6a);return _0x392813(_0x57f6d0[_0x54b2('0xa')][_0x54b2('0xb')]);}else{return _0x4b66e6(_0x57f6d0['result']);}})[_0x54b2('0xc')](function(_0x2e5834){logger[_0x54b2('0xa')](_0x54b2('0xd'),_0x54b2('0x3'),_0x391e70,_0x2e5834,_0x268b6a);return _0x392813(_0x2e5834);});});};module[_0x54b2('0xe')]=client;
\ No newline at end of file
index 9b020b7..79153f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a9e=['getSettings','loginMailFrequency','catch','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','refresh','mailAccounts','listen'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3a9e,0x162));var _0xe3a9=function(_0x4e7f3f,_0x5c57da){_0x4e7f3f=_0x4e7f3f-0x0;var _0x441fd2=_0x3a9e[_0x4e7f3f];return _0x441fd2;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xe3a9('0x0'));var EmailChannel=require(_0xe3a9('0x1'));var mailAccount=require(_0xe3a9('0x2'));var setting=require(_0xe3a9('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xe3a9('0x4')]()[_0xe3a9('0x5')](mailAccount[_0xe3a9('0x6')]())[_0xe3a9('0x5')](realtime['initMailAccounts']())[_0xe3a9('0x5')](function(){email[_0xe3a9('0x7')](realtime[_0xe3a9('0x8')]);return realtime;});}function main(){return server[_0xe3a9('0x9')](realtime,email)[_0xe3a9('0x5')](function(){return initRealtime();})[_0xe3a9('0x5')](function(){return setting[_0xe3a9('0xa')]();})[_0xe3a9('0x5')](function(_0x279337){return setInterval(initRealtime,_0x279337[_0xe3a9('0xb')]*0x3e8);})[_0xe3a9('0xc')](function(_0x5b4dba){console['log'](_0x5b4dba);});}main();
\ No newline at end of file
+var _0xfdb5=['listen','loginMailFrequency','catch','bluebird','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','mailAccounts'];(function(_0x31bd8b,_0x56fa02){var _0x1506e4=function(_0x51e54d){while(--_0x51e54d){_0x31bd8b['push'](_0x31bd8b['shift']());}};_0x1506e4(++_0x56fa02);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xfdb5[_0x59d89e];return _0x554e93;};'use strict';var BPromise=require(_0x5fdb('0x0'));var server=require('./server');var Realtime=require(_0x5fdb('0x1'));var EmailChannel=require(_0x5fdb('0x2'));var mailAccount=require(_0x5fdb('0x3'));var setting=require(_0x5fdb('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x5fdb('0x5')]()[_0x5fdb('0x6')](mailAccount[_0x5fdb('0x7')]())[_0x5fdb('0x6')](realtime['initMailAccounts']())[_0x5fdb('0x6')](function(){email['refresh'](realtime[_0x5fdb('0x8')]);return realtime;});}function main(){return server[_0x5fdb('0x9')](realtime,email)[_0x5fdb('0x6')](function(){return initRealtime();})[_0x5fdb('0x6')](function(){return setting['getSettings']();})[_0x5fdb('0x6')](function(_0x53cef8){return setInterval(initRealtime,_0x53cef8[_0x5fdb('0xa')]*0x3e8);})[_0x5fdb('0xb')](function(_0xf41999){console['log'](_0xf41999);});}main();
\ No newline at end of file
index dda1c64..5953784 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8f6=['../../../config/environment','email','redis','defaults','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','prototype','refresh','hasOwnProperty','bind','handleImapEmail','end','handleImapEnd','handleImapError','isNil','disabled','handleImapBox','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','info','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','Smtp','smtp','verify','verified','catch','exports','lodash','moment','bluebird','md5','ioredis'];(function(_0x48ada8,_0x578d35){var _0x178ad1=function(_0x27ed35){while(--_0x27ed35){_0x48ada8['push'](_0x48ada8['shift']());}};_0x178ad1(++_0x578d35);}(_0xb8f6,0xa0));var _0x6b8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6b8f('0x0'));var moment=require(_0x6b8f('0x1'));var BPromise=require(_0x6b8f('0x2'));var md5=require(_0x6b8f('0x3'));var Redis=require(_0x6b8f('0x4'));var config=require(_0x6b8f('0x5'));var logger=require('../../../config/logger')(_0x6b8f('0x6'));config[_0x6b8f('0x7')]=_[_0x6b8f('0x8')](config[_0x6b8f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6b8f('0x9'))(new Redis(config[_0x6b8f('0x7')]));var EmailImap=require(_0x6b8f('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x6b8f('0xb'));var md5Accounts={};function EmailChannel(_0x15f42d){logger['info'](_0x6b8f('0xc'));this[_0x6b8f('0xd')]=_0x15f42d[_0x6b8f('0xd')];this[_0x6b8f('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x6b8f('0xf')]=function(_0x4d6999){var _0x43fd65=this[_0x6b8f('0xd')][_0x4d6999];var _0x3bfbea={'id':_0x43fd65['id'],'name':_0x43fd65[_0x6b8f('0x10')],'key':_0x43fd65[_0x6b8f('0x11')],'active':_0x43fd65[_0x6b8f('0x12')],'Imap':{'status':_0x43fd65[_0x6b8f('0x13')][_0x6b8f('0x14')],'messageStatus':_0x43fd65[_0x6b8f('0x13')][_0x6b8f('0x15')],'total':_0x43fd65['Imap'][_0x6b8f('0x16')]}};if(_['isNil'](md5Accounts[_0x4d6999])){md5Accounts[_0x4d6999]={};}var _0x1d5d82=md5(JSON['stringify'](_0x3bfbea));if(md5Accounts[_0x4d6999][_0x6b8f('0x3')]!==_0x1d5d82){md5Accounts[_0x4d6999]['md5']=_0x1d5d82;io['emit'](_0x6b8f('0x17'),_0x3bfbea);}};EmailChannel[_0x6b8f('0x18')][_0x6b8f('0x19')]=function(_0x29ecbf){for(var _0x51f3c0 in _0x29ecbf){if(_0x29ecbf[_0x6b8f('0x1a')](_0x51f3c0)){if(_0x29ecbf[_0x51f3c0][_0x6b8f('0x13')]&&_0x29ecbf[_0x51f3c0][_0x6b8f('0x12')]){var _0x4c5476=_0x29ecbf[_0x51f3c0]['Imap'];if(!this[_0x6b8f('0xe')][_0x6b8f('0x1a')](_0x4c5476['id'])){this[_0x6b8f('0xe')][_0x4c5476['id']]=new EmailImap(_0x4c5476,_0x29ecbf[_0x51f3c0]['email']);this[_0x6b8f('0xe')][_0x4c5476['id']]['on']('box',this['handleImapBox'][_0x6b8f('0x1b')](this,_0x51f3c0));this[_0x6b8f('0xe')][_0x4c5476['id']]['on'](_0x6b8f('0x6'),this[_0x6b8f('0x1c')][_0x6b8f('0x1b')](this,_0x51f3c0));this[_0x6b8f('0xe')][_0x4c5476['id']]['on'](_0x6b8f('0x1d'),this[_0x6b8f('0x1e')][_0x6b8f('0x1b')](this,_0x51f3c0));this[_0x6b8f('0xe')][_0x4c5476['id']]['on']('error',this[_0x6b8f('0x1f')]['bind'](this,_0x51f3c0));}}else{if(_[_0x6b8f('0x20')](this[_0x6b8f('0xd')][_0x51f3c0]['Imap'])){this[_0x6b8f('0xd')][_0x51f3c0]['Imap']={};}this['mailAccounts'][_0x51f3c0][_0x6b8f('0x13')][_0x6b8f('0x14')]=_0x6b8f('0x21');this[_0x6b8f('0xd')][_0x51f3c0][_0x6b8f('0x13')]['messageStatus']='';this[_0x6b8f('0xf')](_0x51f3c0);}}}};EmailChannel[_0x6b8f('0x18')][_0x6b8f('0x22')]=function(_0x3c0182,_0x285768){if(this[_0x6b8f('0xd')][_0x3c0182]){this['mailAccounts'][_0x3c0182]['Imap'][_0x6b8f('0x14')]='connected';this[_0x6b8f('0xd')][_0x3c0182][_0x6b8f('0x13')][_0x6b8f('0x15')]=_0x285768[_0x6b8f('0x10')];if(_0x285768[_0x6b8f('0x23')]){this[_0x6b8f('0xd')][_0x3c0182][_0x6b8f('0x13')][_0x6b8f('0x16')]=_0x285768[_0x6b8f('0x23')][_0x6b8f('0x16')];}return this[_0x6b8f('0xf')](_0x3c0182);}};EmailChannel[_0x6b8f('0x18')]['handleImapEmail']=function(_0x33329d,_0x508458){logger['info'](_0x6b8f('0x24'),_0x508458[_0x6b8f('0x25')],_0x508458[_0x6b8f('0x26')],_0x508458[_0x6b8f('0x27')],_0x33329d);if(this[_0x6b8f('0xd')][_0x33329d]){return mailAccount[_0x6b8f('0x28')](_0x33329d,_0x508458)[_0x6b8f('0x29')](function(_0x21e674){if(_0x21e674){logger[_0x6b8f('0x2a')](_0x6b8f('0x2b'));}})['catch'](function(_0x94b197){logger[_0x6b8f('0x2c')](_0x6b8f('0x2d'),JSON['stringify'](_0x94b197));});}};EmailChannel[_0x6b8f('0x18')][_0x6b8f('0x1e')]=function(_0x440633){if(this[_0x6b8f('0xd')][_0x440633]&&this[_0x6b8f('0xd')][_0x440633][_0x6b8f('0x13')]){if(this[_0x6b8f('0xe')][this[_0x6b8f('0xd')][_0x440633][_0x6b8f('0x13')]['id']]){delete this[_0x6b8f('0xe')][this[_0x6b8f('0xd')][_0x440633][_0x6b8f('0x13')]['id']];}this[_0x6b8f('0xd')][_0x440633][_0x6b8f('0x13')][_0x6b8f('0x2e')]=moment();this['emit'](_0x440633);}};EmailChannel['prototype'][_0x6b8f('0x1f')]=function(_0x596e70,_0x305e21){if(this[_0x6b8f('0xd')][_0x596e70]){this['mailAccounts'][_0x596e70][_0x6b8f('0x13')][_0x6b8f('0x14')]='error';this[_0x6b8f('0xd')][_0x596e70][_0x6b8f('0x13')][_0x6b8f('0x15')]=_0x305e21;return this[_0x6b8f('0xf')](_0x596e70);}};EmailChannel[_0x6b8f('0x18')][_0x6b8f('0x2f')]=function(_0x1023fd,_0x3094c0){return this['smtp'][_0x6b8f('0x30')](_0x1023fd,_0x3094c0);};EmailChannel['prototype']['verifySmtp']=function(_0x39c248){var _0x339e90=this;if(this[_0x6b8f('0xd')][_0x39c248['id']]){if(_[_0x6b8f('0x20')](this[_0x6b8f('0xd')][_0x39c248['id']]['Smtp'])){this[_0x6b8f('0xd')][_0x39c248['id']][_0x6b8f('0x31')]={};}this[_0x6b8f('0xd')][_0x39c248['id']]['Smtp'][_0x6b8f('0x2e')]=moment();return new BPromise(function(_0xf32f21,_0x4bdbf7){return _0x339e90[_0x6b8f('0x32')][_0x6b8f('0x33')](_0x39c248)[_0x6b8f('0x29')](function(_0x53e872){_0x339e90[_0x6b8f('0xd')][_0x39c248['id']]['Smtp']['status']=_0x6b8f('0x34');_0x339e90['mailAccounts'][_0x39c248['id']][_0x6b8f('0x31')][_0x6b8f('0x15')]='';_0x339e90[_0x6b8f('0xf')](_0x39c248['id']);_0xf32f21(_0x53e872);})[_0x6b8f('0x35')](function(_0x47ade9){_0x339e90[_0x6b8f('0xd')][_0x39c248['id']]['Smtp'][_0x6b8f('0x14')]='error';_0x339e90[_0x6b8f('0xd')][_0x39c248['id']][_0x6b8f('0x31')][_0x6b8f('0x15')]=_0x47ade9;_0x339e90[_0x6b8f('0xf')](_0x39c248['id']);_0x4bdbf7(_0x47ade9);});});}return this[_0x6b8f('0x32')][_0x6b8f('0x33')](_0x39c248);};module[_0x6b8f('0x36')]=EmailChannel;
\ No newline at end of file
+var _0x3b17=['localhost','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','status','disabled','name','messages','info','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','lastSync','sendMail','send','Smtp','verify','verified','catch','exports','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults'];(function(_0x148bf4,_0x31b21e){var _0x1a98f4=function(_0x142935){while(--_0x142935){_0x148bf4['push'](_0x148bf4['shift']());}};_0x1a98f4(++_0x31b21e);}(_0x3b17,0x198));var _0x73b1=function(_0x2729b2,_0x5bd950){_0x2729b2=_0x2729b2-0x0;var _0x59d65f=_0x3b17[_0x2729b2];return _0x59d65f;};'use strict';var _=require('lodash');var moment=require(_0x73b1('0x0'));var BPromise=require(_0x73b1('0x1'));var md5=require(_0x73b1('0x2'));var Redis=require(_0x73b1('0x3'));var config=require('../../../config/environment');var logger=require(_0x73b1('0x4'))(_0x73b1('0x5'));config[_0x73b1('0x6')]=_[_0x73b1('0x7')](config['redis'],{'host':_0x73b1('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x73b1('0x6')]));var EmailImap=require(_0x73b1('0x9'));var EmailSmtp=require(_0x73b1('0xa'));var mailAccount=require(_0x73b1('0xb'));var md5Accounts={};function EmailChannel(_0x4ce5d3){logger['info'](_0x73b1('0xc'));this[_0x73b1('0xd')]=_0x4ce5d3['mailAccounts'];this[_0x73b1('0xe')]={};this[_0x73b1('0xf')]=new EmailSmtp();}EmailChannel[_0x73b1('0x10')][_0x73b1('0x11')]=function(_0x307b86){var _0x3551fe=this['mailAccounts'][_0x307b86];var _0xf0b4ac={'id':_0x3551fe['id'],'name':_0x3551fe['name'],'key':_0x3551fe['key'],'active':_0x3551fe[_0x73b1('0x12')],'Imap':{'status':_0x3551fe['Imap']['status'],'messageStatus':_0x3551fe[_0x73b1('0x13')][_0x73b1('0x14')],'total':_0x3551fe[_0x73b1('0x13')][_0x73b1('0x15')]}};if(_[_0x73b1('0x16')](md5Accounts[_0x307b86])){md5Accounts[_0x307b86]={};}var _0x36da2d=md5(JSON[_0x73b1('0x17')](_0xf0b4ac));if(md5Accounts[_0x307b86][_0x73b1('0x2')]!==_0x36da2d){md5Accounts[_0x307b86][_0x73b1('0x2')]=_0x36da2d;io[_0x73b1('0x11')](_0x73b1('0x18'),_0xf0b4ac);}};EmailChannel[_0x73b1('0x10')][_0x73b1('0x19')]=function(_0x38841d){for(var _0x5c3775 in _0x38841d){if(_0x38841d[_0x73b1('0x1a')](_0x5c3775)){if(_0x38841d[_0x5c3775][_0x73b1('0x13')]&&_0x38841d[_0x5c3775]['active']){var _0x581ea5=_0x38841d[_0x5c3775][_0x73b1('0x13')];if(!this[_0x73b1('0xe')][_0x73b1('0x1a')](_0x581ea5['id'])){this[_0x73b1('0xe')][_0x581ea5['id']]=new EmailImap(_0x581ea5,_0x38841d[_0x5c3775][_0x73b1('0x5')]);this[_0x73b1('0xe')][_0x581ea5['id']]['on']('box',this[_0x73b1('0x1b')]['bind'](this,_0x5c3775));this[_0x73b1('0xe')][_0x581ea5['id']]['on'](_0x73b1('0x5'),this[_0x73b1('0x1c')][_0x73b1('0x1d')](this,_0x5c3775));this[_0x73b1('0xe')][_0x581ea5['id']]['on'](_0x73b1('0x1e'),this[_0x73b1('0x1f')][_0x73b1('0x1d')](this,_0x5c3775));this[_0x73b1('0xe')][_0x581ea5['id']]['on'](_0x73b1('0x20'),this[_0x73b1('0x21')][_0x73b1('0x1d')](this,_0x5c3775));}}else{if(_[_0x73b1('0x16')](this['mailAccounts'][_0x5c3775]['Imap'])){this['mailAccounts'][_0x5c3775][_0x73b1('0x13')]={};}this[_0x73b1('0xd')][_0x5c3775][_0x73b1('0x13')][_0x73b1('0x22')]=_0x73b1('0x23');this[_0x73b1('0xd')][_0x5c3775][_0x73b1('0x13')][_0x73b1('0x14')]='';this[_0x73b1('0x11')](_0x5c3775);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x354c17,_0x20c712){if(this['mailAccounts'][_0x354c17]){this[_0x73b1('0xd')][_0x354c17]['Imap'][_0x73b1('0x22')]='connected';this[_0x73b1('0xd')][_0x354c17][_0x73b1('0x13')][_0x73b1('0x14')]=_0x20c712[_0x73b1('0x24')];if(_0x20c712[_0x73b1('0x25')]){this[_0x73b1('0xd')][_0x354c17][_0x73b1('0x13')]['total']=_0x20c712[_0x73b1('0x25')]['total'];}return this[_0x73b1('0x11')](_0x354c17);}};EmailChannel['prototype'][_0x73b1('0x1c')]=function(_0x318c2e,_0x2fcfa8){logger[_0x73b1('0x26')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2fcfa8[_0x73b1('0x27')],_0x2fcfa8[_0x73b1('0x28')],_0x2fcfa8[_0x73b1('0x29')],_0x318c2e);if(this[_0x73b1('0xd')][_0x318c2e]){return mailAccount['notify'](_0x318c2e,_0x2fcfa8)[_0x73b1('0x2a')](function(_0x3be1de){if(_0x3be1de){logger['info'](_0x73b1('0x2b'));}})['catch'](function(_0x410e3d){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x73b1('0x17')](_0x410e3d));});}};EmailChannel['prototype'][_0x73b1('0x1f')]=function(_0x493a28){if(this[_0x73b1('0xd')][_0x493a28]&&this[_0x73b1('0xd')][_0x493a28][_0x73b1('0x13')]){if(this[_0x73b1('0xe')][this[_0x73b1('0xd')][_0x493a28]['Imap']['id']]){delete this[_0x73b1('0xe')][this[_0x73b1('0xd')][_0x493a28][_0x73b1('0x13')]['id']];}this[_0x73b1('0xd')][_0x493a28][_0x73b1('0x13')][_0x73b1('0x2c')]=moment();this['emit'](_0x493a28);}};EmailChannel['prototype'][_0x73b1('0x21')]=function(_0x1d2473,_0x5efc0b){if(this[_0x73b1('0xd')][_0x1d2473]){this[_0x73b1('0xd')][_0x1d2473][_0x73b1('0x13')]['status']=_0x73b1('0x20');this[_0x73b1('0xd')][_0x1d2473][_0x73b1('0x13')]['messageStatus']=_0x5efc0b;return this[_0x73b1('0x11')](_0x1d2473);}};EmailChannel[_0x73b1('0x10')][_0x73b1('0x2d')]=function(_0x835f54,_0x2439b6){return this[_0x73b1('0xf')][_0x73b1('0x2e')](_0x835f54,_0x2439b6);};EmailChannel['prototype']['verifySmtp']=function(_0x690bc1){var _0x1fe108=this;if(this[_0x73b1('0xd')][_0x690bc1['id']]){if(_[_0x73b1('0x16')](this[_0x73b1('0xd')][_0x690bc1['id']]['Smtp'])){this['mailAccounts'][_0x690bc1['id']][_0x73b1('0x2f')]={};}this['mailAccounts'][_0x690bc1['id']][_0x73b1('0x2f')][_0x73b1('0x2c')]=moment();return new BPromise(function(_0x32d98a,_0x59a159){return _0x1fe108[_0x73b1('0xf')][_0x73b1('0x30')](_0x690bc1)['then'](function(_0x4d19df){_0x1fe108[_0x73b1('0xd')][_0x690bc1['id']][_0x73b1('0x2f')][_0x73b1('0x22')]=_0x73b1('0x31');_0x1fe108['mailAccounts'][_0x690bc1['id']][_0x73b1('0x2f')]['messageStatus']='';_0x1fe108[_0x73b1('0x11')](_0x690bc1['id']);_0x32d98a(_0x4d19df);})[_0x73b1('0x32')](function(_0x2379aa){_0x1fe108['mailAccounts'][_0x690bc1['id']][_0x73b1('0x2f')][_0x73b1('0x22')]=_0x73b1('0x20');_0x1fe108[_0x73b1('0xd')][_0x690bc1['id']]['Smtp'][_0x73b1('0x14')]=_0x2379aa;_0x1fe108[_0x73b1('0x11')](_0x690bc1['id']);_0x59a159(_0x2379aa);});});}return this[_0x73b1('0xf')][_0x73b1('0x30')](_0x690bc1);};module[_0x73b1('0x33')]=EmailChannel;
\ No newline at end of file
index f6d8fd7..9ad3bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4be8=['handleOpenBox','emit','box','handleCloseBox','readUnseen','UNSEEN','handleReadUnseen','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','stringify','textCode','hasOwnProperty','path','util','imap','lodash','randomstring','mailparser','simpleParser','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','once','ready','handleReady','end','bind','error','handleError','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','prototype'];(function(_0x31d1f9,_0x3cb9bb){var _0x3fd1ae=function(_0x449458){while(--_0x449458){_0x31d1f9['push'](_0x31d1f9['shift']());}};_0x3fd1ae(++_0x3cb9bb);}(_0x4be8,0x17f));var _0x84be=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x4be8[_0x4c440b];return _0x2d48cf;};'use strict';var fs=require('fs');var path=require(_0x84be('0x0'));var util=require(_0x84be('0x1'));var Imap=require(_0x84be('0x2'));var _=require(_0x84be('0x3'));var rs=require(_0x84be('0x4'));var simpleParser=require(_0x84be('0x5'))[_0x84be('0x6')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x84be('0x7'))[_0x84be('0x8')];var utils=require(_0x84be('0x9'));var logger=require(_0x84be('0xa'))(_0x84be('0xb'));function EmailImap(_0x13629a,_0x47fcfd){this[_0x84be('0xc')]=_0x84be('0xd');this['account']=this[_0x84be('0xe')](_0x13629a,_0x47fcfd);this[_0x84be('0x2')]=new Imap(this['account']);this[_0x84be('0x2')][_0x84be('0xf')](_0x84be('0x10'),this[_0x84be('0x11')]['bind'](this));this[_0x84be('0x2')][_0x84be('0xf')](_0x84be('0x12'),this['handleEnd'][_0x84be('0x13')](this));this['imap']['on'](_0x84be('0x14'),this[_0x84be('0x15')][_0x84be('0x13')](this));this[_0x84be('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x84be('0xe')]=function(_0x3d84af,_0x22d557){var _0x87aa41={'connTimeout':_0x3d84af['connTimeout']?_0x3d84af[_0x84be('0x16')]*0x3e8:0x2710,'authTimeout':_0x3d84af[_0x84be('0x17')]?_0x3d84af[_0x84be('0x17')]*0x3e8:0x1388};if(_[_0x84be('0x18')](_0x3d84af[_0x84be('0x19')])){if(_0x3d84af[_0x84be('0x1a')]){_0x87aa41[_0x84be('0x1b')]=_0x3d84af['user'];_0x87aa41['password']=_0x3d84af[_0x84be('0x1c')];}_0x87aa41['host']=_0x3d84af[_0x84be('0x1d')];_0x87aa41['port']=_0x3d84af[_0x84be('0x1e')]||0x3e1;if(_0x3d84af['tls']){_0x87aa41[_0x84be('0x1f')]=!![];}else{_0x87aa41[_0x84be('0x1f')]=![];_0x87aa41[_0x84be('0x20')]=_0x84be('0x21');}}else{_0x87aa41[_0x84be('0x1b')]=_0x3d84af[_0x84be('0x1b')];_0x87aa41['password']=_0x3d84af['password'];_0x87aa41[_0x84be('0x1d')]=utils[_0x84be('0x22')](_0x3d84af['service']);_0x87aa41[_0x84be('0x1e')]=0x3e1;_0x87aa41['tls']=!![];}_0x87aa41['email']=_0x22d557||_0x3d84af[_0x84be('0x1b')]||_0x84be('0x23');return _0x87aa41;};EmailImap[_0x84be('0x24')][_0x84be('0x11')]=function(){this[_0x84be('0x2')]['openBox'](this[_0x84be('0xc')],![],this[_0x84be('0x25')][_0x84be('0x13')](this));};EmailImap[_0x84be('0x24')][_0x84be('0x25')]=function(_0x252fe8,_0x5691fe){if(_0x252fe8){this[_0x84be('0x15')](_0x252fe8,!![]);}else{this[_0x84be('0x26')](_0x84be('0x27'),_0x5691fe);this['readUnseen']();}};EmailImap['prototype'][_0x84be('0x28')]=function(_0x53f05){if(_0x53f05){this[_0x84be('0x15')](_0x53f05,!![]);}else{this['imap'][_0x84be('0x12')]();}};EmailImap[_0x84be('0x24')][_0x84be('0x29')]=function(){this[_0x84be('0x2')]['search']([_0x84be('0x2a')],this[_0x84be('0x2b')]['bind'](this));};EmailImap[_0x84be('0x24')]['handleReadUnseen']=function(_0x67943b,_0xc97501){if(_0x67943b){this[_0x84be('0x15')](_0x67943b,!![]);}else{if(_0xc97501['length']){try{var _0xdf4dde=this[_0x84be('0x2')]['fetch'](_0xc97501,{'bodies':'','markSeen':!![]});_0xdf4dde['on'](_0x84be('0x2c'),this[_0x84be('0x2d')]['bind'](this));_0xdf4dde[_0x84be('0xf')](_0x84be('0x14'),this[_0x84be('0x2e')][_0x84be('0x13')](this));_0xdf4dde[_0x84be('0xf')](_0x84be('0x12'),this[_0x84be('0x2f')][_0x84be('0x13')](this));}catch(_0x2a89f8){logger[_0x84be('0x14')](_0x2a89f8);}}else{this[_0x84be('0x2')][_0x84be('0x30')](!![],this[_0x84be('0x28')][_0x84be('0x13')](this));}}};EmailImap[_0x84be('0x24')][_0x84be('0x2d')]=function(_0x347e71,_0xb40ffc){_0x347e71['on'](_0x84be('0x31'),this[_0x84be('0x32')][_0x84be('0x13')](this));_0x347e71[_0x84be('0xf')](_0x84be('0x33'),this[_0x84be('0x34')][_0x84be('0x13')](this));_0x347e71[_0x84be('0xf')]('end',this[_0x84be('0x35')][_0x84be('0x13')](this));};EmailImap[_0x84be('0x24')][_0x84be('0x32')]=function(_0x51f27c,_0x3beb2d){simpleParser(_0x51f27c,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x84be('0x24')][_0x84be('0x34')]=function(_0x297b2b){};EmailImap['prototype'][_0x84be('0x35')]=function(){};EmailImap[_0x84be('0x24')][_0x84be('0x36')]=function(_0x566b8f,_0x51a772){if(_0x566b8f){logger[_0x84be('0x14')](_0x566b8f);}else{var _0x2cf498=this;utils[_0x84be('0x37')](this[_0x84be('0x38')],_0x51a772,function(_0x739923){_0x2cf498[_0x84be('0x26')]('email',_0x739923);});}};EmailImap[_0x84be('0x24')]['handleFetchEnd']=function(){this[_0x84be('0x2')][_0x84be('0x30')](!![],this[_0x84be('0x28')]['bind'](this));};EmailImap[_0x84be('0x24')]['handleFetchError']=function(_0x500e37){this[_0x84be('0x15')](_0x500e37);this[_0x84be('0x2')]['closeBox'](!![],this[_0x84be('0x28')][_0x84be('0x13')](this));};EmailImap[_0x84be('0x24')]['handleEnd']=function(){this['emit']('end');};EmailImap['prototype'][_0x84be('0x15')]=function(_0x2973ba,_0x407b9d){logger[_0x84be('0x14')]('handleError',this[_0x84be('0x38')][_0x84be('0xb')],JSON[_0x84be('0x39')](_0x2973ba));var _0x10a79c='';if(_0x2973ba){if(_0x2973ba[_0x84be('0x3a')]){_0x10a79c=_0x2973ba[_0x84be('0x3a')];}else{for(var _0xf6f94b in _0x2973ba){if(_0x2973ba[_0x84be('0x3b')](_0xf6f94b)){_0x10a79c+=_['upperFirst'](_0xf6f94b)+':\x20'+_0x2973ba[_0xf6f94b]+'\x0a';}}}}if(_0x407b9d){this[_0x84be('0x2')][_0x84be('0x12')]();}else{this[_0x84be('0x26')](_0x84be('0x14'),_0x10a79c);this[_0x84be('0x26')](_0x84be('0x12'));}};module['exports']=EmailImap;
\ No newline at end of file
+var _0x16d2=['handleCloseBox','search','UNSEEN','handleReadUnseen','handleError','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','emit','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','account','once','ready','bind','end','handleEnd','error','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','prototype','handleReady','openBox','handleOpenBox','box','readUnseen'];(function(_0x16aa70,_0x5b1f73){var _0x11875f=function(_0x18c7be){while(--_0x18c7be){_0x16aa70['push'](_0x16aa70['shift']());}};_0x11875f(++_0x5b1f73);}(_0x16d2,0x123));var _0x216d=function(_0x520d3b,_0x1ed797){_0x520d3b=_0x520d3b-0x0;var _0x32fb1f=_0x16d2[_0x520d3b];return _0x32fb1f;};'use strict';var fs=require('fs');var path=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var Imap=require(_0x216d('0x2'));var _=require(_0x216d('0x3'));var rs=require(_0x216d('0x4'));var simpleParser=require(_0x216d('0x5'))[_0x216d('0x6')];var Iconv=require(_0x216d('0x7'))[_0x216d('0x8')];var EventEmitter=require('events')[_0x216d('0x9')];var utils=require(_0x216d('0xa'));var logger=require(_0x216d('0xb'))(_0x216d('0xc'));function EmailImap(_0x1dd8e2,_0x24c831){this[_0x216d('0xd')]=_0x216d('0xe');this['account']=this[_0x216d('0xf')](_0x1dd8e2,_0x24c831);this[_0x216d('0x2')]=new Imap(this[_0x216d('0x10')]);this[_0x216d('0x2')][_0x216d('0x11')](_0x216d('0x12'),this['handleReady'][_0x216d('0x13')](this));this['imap'][_0x216d('0x11')](_0x216d('0x14'),this[_0x216d('0x15')][_0x216d('0x13')](this));this[_0x216d('0x2')]['on'](_0x216d('0x16'),this['handleError'][_0x216d('0x13')](this));this['imap'][_0x216d('0x17')]();}util[_0x216d('0x18')](EmailImap,EventEmitter);EmailImap['prototype'][_0x216d('0xf')]=function(_0x322e4b,_0x54a816){var _0x1b3215={'connTimeout':_0x322e4b['connTimeout']?_0x322e4b[_0x216d('0x19')]*0x3e8:0x2710,'authTimeout':_0x322e4b[_0x216d('0x1a')]?_0x322e4b[_0x216d('0x1a')]*0x3e8:0x1388};if(_[_0x216d('0x1b')](_0x322e4b[_0x216d('0x1c')])){if(_0x322e4b[_0x216d('0x1d')]){_0x1b3215[_0x216d('0x1e')]=_0x322e4b[_0x216d('0x1e')];_0x1b3215[_0x216d('0x1f')]=_0x322e4b['password'];}_0x1b3215[_0x216d('0x20')]=_0x322e4b['host'];_0x1b3215['port']=_0x322e4b[_0x216d('0x21')]||0x3e1;if(_0x322e4b[_0x216d('0x22')]){_0x1b3215['tls']=!![];}else{_0x1b3215[_0x216d('0x22')]=![];_0x1b3215[_0x216d('0x23')]='required';}}else{_0x1b3215[_0x216d('0x1e')]=_0x322e4b[_0x216d('0x1e')];_0x1b3215[_0x216d('0x1f')]=_0x322e4b[_0x216d('0x1f')];_0x1b3215['host']=utils[_0x216d('0x24')](_0x322e4b[_0x216d('0x1c')]);_0x1b3215[_0x216d('0x21')]=0x3e1;_0x1b3215[_0x216d('0x22')]=!![];}_0x1b3215[_0x216d('0xc')]=_0x54a816||_0x322e4b['user']||_0x216d('0x25');return _0x1b3215;};EmailImap[_0x216d('0x26')][_0x216d('0x27')]=function(){this[_0x216d('0x2')][_0x216d('0x28')](this['mailbox'],![],this[_0x216d('0x29')][_0x216d('0x13')](this));};EmailImap[_0x216d('0x26')]['handleOpenBox']=function(_0x4ec8a7,_0x56460f){if(_0x4ec8a7){this['handleError'](_0x4ec8a7,!![]);}else{this['emit'](_0x216d('0x2a'),_0x56460f);this[_0x216d('0x2b')]();}};EmailImap[_0x216d('0x26')][_0x216d('0x2c')]=function(_0x46d0ef){if(_0x46d0ef){this['handleError'](_0x46d0ef,!![]);}else{this['imap'][_0x216d('0x14')]();}};EmailImap['prototype'][_0x216d('0x2b')]=function(){this[_0x216d('0x2')][_0x216d('0x2d')]([_0x216d('0x2e')],this[_0x216d('0x2f')][_0x216d('0x13')](this));};EmailImap[_0x216d('0x26')][_0x216d('0x2f')]=function(_0x169cfa,_0x28f56a){if(_0x169cfa){this[_0x216d('0x30')](_0x169cfa,!![]);}else{if(_0x28f56a[_0x216d('0x31')]){try{var _0x4537fd=this['imap'][_0x216d('0x32')](_0x28f56a,{'bodies':'','markSeen':!![]});_0x4537fd['on'](_0x216d('0x33'),this[_0x216d('0x34')]['bind'](this));_0x4537fd[_0x216d('0x11')](_0x216d('0x16'),this[_0x216d('0x35')][_0x216d('0x13')](this));_0x4537fd['once'](_0x216d('0x14'),this[_0x216d('0x36')][_0x216d('0x13')](this));}catch(_0x18ffec){logger[_0x216d('0x16')](_0x18ffec);}}else{this[_0x216d('0x2')][_0x216d('0x37')](!![],this[_0x216d('0x2c')][_0x216d('0x13')](this));}}};EmailImap[_0x216d('0x26')][_0x216d('0x34')]=function(_0x4a2caa,_0xcb9f8a){_0x4a2caa['on'](_0x216d('0x38'),this[_0x216d('0x39')]['bind'](this));_0x4a2caa[_0x216d('0x11')](_0x216d('0x3a'),this['handleMessageAttributes'][_0x216d('0x13')](this));_0x4a2caa['once']('end',this[_0x216d('0x3b')][_0x216d('0x13')](this));};EmailImap[_0x216d('0x26')][_0x216d('0x39')]=function(_0x5c3f7c,_0x4fd477){simpleParser(_0x5c3f7c,{'Iconv':Iconv},this['handleSimpleParser'][_0x216d('0x13')](this));};EmailImap[_0x216d('0x26')]['handleMessageAttributes']=function(_0x3ff9a0){};EmailImap[_0x216d('0x26')]['handleMessageEnd']=function(){};EmailImap[_0x216d('0x26')][_0x216d('0x3c')]=function(_0x2476a0,_0x474fab){if(_0x2476a0){logger[_0x216d('0x16')](_0x2476a0);}else{var _0x2e857e=this;utils[_0x216d('0x3d')](this[_0x216d('0x10')],_0x474fab,function(_0x54937b){_0x2e857e['emit'](_0x216d('0xc'),_0x54937b);});}};EmailImap[_0x216d('0x26')]['handleFetchEnd']=function(){this[_0x216d('0x2')][_0x216d('0x37')](!![],this[_0x216d('0x2c')]['bind'](this));};EmailImap[_0x216d('0x26')][_0x216d('0x35')]=function(_0x13d787){this[_0x216d('0x30')](_0x13d787);this['imap'][_0x216d('0x37')](!![],this[_0x216d('0x2c')]['bind'](this));};EmailImap[_0x216d('0x26')][_0x216d('0x15')]=function(){this['emit']('end');};EmailImap[_0x216d('0x26')][_0x216d('0x30')]=function(_0x3c491e,_0x498efe){logger[_0x216d('0x16')]('handleError',this['account'][_0x216d('0xc')],JSON[_0x216d('0x3e')](_0x3c491e));var _0xac81f='';if(_0x3c491e){if(_0x3c491e['textCode']){_0xac81f=_0x3c491e[_0x216d('0x3f')];}else{for(var _0x488de3 in _0x3c491e){if(_0x3c491e[_0x216d('0x40')](_0x488de3)){_0xac81f+=_[_0x216d('0x41')](_0x488de3)+':\x20'+_0x3c491e[_0x488de3]+'\x0a';}}}}if(_0x498efe){this[_0x216d('0x2')]['end']();}else{this[_0x216d('0x42')](_0x216d('0x16'),_0xac81f);this[_0x216d('0x42')](_0x216d('0x14'));}};module['exports']=EmailImap;
\ No newline at end of file
index bab9119..839fcaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29d3=['toString','Not\x20verifired','exports','bluebird','prototype','send','use','sendMail','verify','createTransport'];(function(_0x10f8fe,_0xa9d2c3){var _0x4d173c=function(_0x42a47c){while(--_0x42a47c){_0x10f8fe['push'](_0x10f8fe['shift']());}};_0x4d173c(++_0xa9d2c3);}(_0x29d3,0x107));var _0x329d=function(_0x48c25e,_0x1fd81c){_0x48c25e=_0x48c25e-0x0;var _0x1d393f=_0x29d3[_0x48c25e];return _0x1d393f;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x329d('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x329d('0x1')][_0x329d('0x2')]=function(_0x4b2e63,_0x13efa6){return new BPromise(function(_0x1de2b3,_0x5ae44a){var _0x31ee50=nodemailer['createTransport'](_0x4b2e63);_0x31ee50[_0x329d('0x3')]('compile',inlineBase64());_0x31ee50[_0x329d('0x4')](_0x13efa6,function(_0xa3e6f4,_0x4e8620){if(_0xa3e6f4){_0x5ae44a(_0xa3e6f4['toString']());}else{_0x1de2b3(_0x4e8620);}});});};EmailSmtp[_0x329d('0x1')][_0x329d('0x5')]=function(_0x976d5d){return new BPromise(function(_0x5c6075,_0x246362){var _0x3728e0=nodemailer[_0x329d('0x6')](_0x976d5d);_0x3728e0[_0x329d('0x5')](function(_0x3c159f,_0x2b43a1){if(_0x3c159f){_0x246362(_0x3c159f[_0x329d('0x7')]());}else{if(_0x2b43a1){_0x5c6075(_0x2b43a1);}else{_0x246362(_0x329d('0x8'));}}});});};module[_0x329d('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0x9195=['nodemailer','bluebird','nodemailer-plugin-inline-base64','compile','sendMail','toString','prototype','verify','createTransport','Not\x20verifired','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9195,0x129));var _0x5919=function(_0x617ec7,_0x2297cf){_0x617ec7=_0x617ec7-0x0;var _0x1b6f02=_0x9195[_0x617ec7];return _0x1b6f02;};'use strict';var nodemailer=require(_0x5919('0x0'));var BPromise=require(_0x5919('0x1'));var inlineBase64=require(_0x5919('0x2'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x1dbaa9,_0x1ddef4){return new BPromise(function(_0x3e09f6,_0x10906b){var _0x2b1ab6=nodemailer['createTransport'](_0x1dbaa9);_0x2b1ab6['use'](_0x5919('0x3'),inlineBase64());_0x2b1ab6[_0x5919('0x4')](_0x1ddef4,function(_0x2bba36,_0x855e31){if(_0x2bba36){_0x10906b(_0x2bba36[_0x5919('0x5')]());}else{_0x3e09f6(_0x855e31);}});});};EmailSmtp[_0x5919('0x6')][_0x5919('0x7')]=function(_0x21661f){return new BPromise(function(_0x122a24,_0xed3f58){var _0x33d3b4=nodemailer[_0x5919('0x8')](_0x21661f);_0x33d3b4[_0x5919('0x7')](function(_0xafc5a3,_0xcb25a5){if(_0xafc5a3){_0xed3f58(_0xafc5a3[_0x5919('0x5')]());}else{if(_0xcb25a5){_0x122a24(_0xcb25a5);}else{_0xed3f58(_0x5919('0x9'));}}});});};module[_0x5919('0xa')]=EmailSmtp;
\ No newline at end of file
index d720b20..28dcf50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab8=['length','slice','Anonymous','isEmpty','html','test','replace','includes','<img','attachments','filename','_SRC','_IMG','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originCc','originTo','attach','attachment','%s-%s','join','root','server/files/attachments/','content','push','contentType','headerLines','Precedence:\x20auto_reply','line','parser','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','Attachments','Title','Data','getHost','gmail','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','indexOf','split'];(function(_0x4075df,_0x391dec){var _0x1c55b9=function(_0x415db2){while(--_0x415db2){_0x4075df['push'](_0x4075df['shift']());}};_0x1c55b9(++_0x391dec);}(_0x9ab8,0x81));var _0x89ab=function(_0x4b9a3c,_0x546d16){_0x4b9a3c=_0x4b9a3c-0x0;var _0x114603=_0x9ab8[_0x4b9a3c];return _0x114603;};'use strict';var _=require(_0x89ab('0x0'));var moment=require(_0x89ab('0x1'));var random=require(_0x89ab('0x2'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x89ab('0x3'));var logger=require('../../../config/logger')(_0x89ab('0x4'));var config=require(_0x89ab('0x5'));function getAddress(_0x50b72d){var _0x19fc7e=_[_0x89ab('0x6')](_0x50b72d[_0x89ab('0x7')]);return _0x19fc7e&&_0x19fc7e[_0x89ab('0x8')]?_0x19fc7e[_0x89ab('0x8')]:_0x89ab('0x9')+random[_0x89ab('0xa')](0x6)+_0x89ab('0xb');}function getFirstName(_0x42da87){var _0x254add=_[_0x89ab('0x6')](_0x42da87[_0x89ab('0x7')]);if(_0x254add&&_0x254add['name']){if(_0x254add['name']==_0x254add['address']){return _0x254add['name']['substring'](0x0,_0x254add[_0x89ab('0xc')][_0x89ab('0xd')]('@'));}var _0x6b8ccb=_0x254add[_0x89ab('0xc')][_0x89ab('0xe')](/\s+/);return _0x6b8ccb[_0x89ab('0xf')]>0x1?_0x6b8ccb[_0x89ab('0x10')](0x0,-0x1)['join']('\x20'):_0x254add[_0x89ab('0xc')];}return _0x89ab('0x11');}function getLastName(_0x39d4ad){var _0x356c8f=_[_0x89ab('0x6')](_0x39d4ad['value']);if(_0x356c8f&&_0x356c8f[_0x89ab('0xc')]){var _0x241140=_0x356c8f['name']['split'](/\s+/);return _0x241140['length']>0x1?_0x241140['pop']():'';}return'';}function getMails(_0x4fd002,_0x49a104){var _0x24d866='';for(var _0x1ce918=0x0;_0x1ce918<_0x49a104[_0x89ab('0x7')][_0x89ab('0xf')];_0x1ce918+=0x1){if(_0x49a104[_0x89ab('0x7')][_0x1ce918][_0x89ab('0x8')]!==_0x4fd002){if(!_[_0x89ab('0x12')](_0x24d866)){_0x24d866+=',';}_0x24d866+=_0x49a104[_0x89ab('0x7')][_0x1ce918][_0x89ab('0xc')]||_0x49a104['value'][_0x1ce918][_0x89ab('0x8')]||'';_0x24d866+='\x20<';_0x24d866+=_0x49a104[_0x89ab('0x7')][_0x1ce918]['address']?_0x49a104['value'][_0x1ce918][_0x89ab('0x8')]:_0x89ab('0x9')+random['generate'](0x6)+_0x89ab('0xb');_0x24d866+='>';}}return _0x24d866;}function parseEmail(_0xe34016,_0x2a5b01,_0x1e0c5f){if(_0x2a5b01[_0x89ab('0x13')]){var _0x419363=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x419363[_0x89ab('0x14')](_0x2a5b01[_0x89ab('0x13')])){_0x2a5b01[_0x89ab('0x13')]=_0x2a5b01[_0x89ab('0x13')][_0x89ab('0x15')](_0x419363,'');}if(_0x2a5b01[_0x89ab('0x13')][_0x89ab('0x16')](_0x89ab('0x17'))){var _0x3bbde1=[];_0x2a5b01[_0x89ab('0x18')]['forEach'](_0x42ce5b=>{_0x3bbde1['push'](_0x42ce5b[_0x89ab('0x19')]);});var _0x599422=/<img.*? _SRC(.*?)[^>]+>/g;var _0x5b2c3d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xd22b9c=_0x2a5b01['html']['replace'](_0x5b2c3d,_0x89ab('0x1a'));var _0x3ff78a=_0xd22b9c[_0x89ab('0x15')](_0x599422,_0x89ab('0x1b'));for(let _0x54b1a4=0x0;_0x54b1a4<_0x3bbde1[_0x89ab('0xf')];_0x54b1a4++){var _0x2535c7=_0x3ff78a[_0x89ab('0x15')](_0x89ab('0x1b'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x3bbde1[_0x54b1a4]+_0x89ab('0x1c'));_0x3ff78a=_0x2535c7;}_0x2a5b01[_0x89ab('0x13')]=_0x3ff78a;}_0x1e0c5f[_0x89ab('0x1d')]=_0x2a5b01[_0x89ab('0x13')];}else{_0x1e0c5f[_0x89ab('0x1d')]=_0x2a5b01[_0x89ab('0x1e')];}if(_0x1e0c5f[_0x89ab('0x1d')]){_0x1e0c5f[_0x89ab('0x1d')]=_0x1e0c5f[_0x89ab('0x1d')][_0x89ab('0x15')](/<a\s+/gi,_0x89ab('0x1f'));}if(_0x2a5b01['to']){_0x1e0c5f[_0x89ab('0x20')]['originTo']=getMails(null,_0x2a5b01['to']);var _0x25015f=getMails(_0xe34016[_0x89ab('0x4')],_0x2a5b01['to']);if(!_['isEmpty'](_0x25015f)){_0x1e0c5f[_0x89ab('0x20')]['cc']+=_0x25015f;}}if(_0x2a5b01['cc']){_0x1e0c5f['message'][_0x89ab('0x21')]=getMails(null,_0x2a5b01['cc']);var _0x59df12=getMails(_0xe34016[_0x89ab('0x4')],_0x2a5b01['cc']);if(!_[_0x89ab('0x12')](_0x59df12)){if(!_[_0x89ab('0x12')](_0x1e0c5f[_0x89ab('0x20')]['cc'])){_0x1e0c5f['message']['cc']+=',';}_0x1e0c5f[_0x89ab('0x20')]['cc']+=_0x59df12;}}if(!_[_0x89ab('0x16')](_0x1e0c5f['message'][_0x89ab('0x22')],_0xe34016[_0x89ab('0x4')])&&!_['includes'](_0x1e0c5f[_0x89ab('0x20')][_0x89ab('0x21')],_0xe34016[_0x89ab('0x4')])){_0x1e0c5f[_0x89ab('0x20')]['bcc']=_0xe34016['email'];}if(_0x2a5b01[_0x89ab('0x18')]&&_0x2a5b01[_0x89ab('0x18')][_0x89ab('0xf')]){_0x1e0c5f['message'][_0x89ab('0x23')]=_0x2a5b01['attachments'][_0x89ab('0xf')];for(var _0xfe089d=0x0,_0x38afa2,_0x5c0882,_0x3cf9e4;_0xfe089d<_0x2a5b01[_0x89ab('0x18')][_0x89ab('0xf')];_0xfe089d+=0x1){if(_0x2a5b01[_0x89ab('0x18')][_0xfe089d]['type']===_0x89ab('0x24')){_0x3cf9e4=_0x2a5b01[_0x89ab('0x18')][_0xfe089d][_0x89ab('0x19')]||'attachment-'+_0xfe089d;_0x38afa2=util['format'](_0x89ab('0x25'),Date['now'](),_0x3cf9e4);_0x5c0882=path[_0x89ab('0x26')](config[_0x89ab('0x27')],_0x89ab('0x28'),_0x38afa2);fs['writeFileSync'](_0x5c0882,_0x2a5b01[_0x89ab('0x18')][_0xfe089d][_0x89ab('0x29')]);_0x1e0c5f['message'][_0x89ab('0x18')][_0x89ab('0x2a')]({'name':_0x3cf9e4,'basename':_0x38afa2,'type':_0x2a5b01[_0x89ab('0x18')][_0xfe089d][_0x89ab('0x2b')],'filepath':_0x5c0882});}}}if(_0x2a5b01[_0x89ab('0x2c')]&&_0x2a5b01[_0x89ab('0x2c')][_0x89ab('0xf')]>0x0){var _0x1a9ccb=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All',_0x89ab('0x2d')];for(var _0x387102=0x0;_0x387102<_0x2a5b01[_0x89ab('0x2c')][_0x89ab('0xf')];_0x387102++){var _0x417419=_['indexOf'](_0x1a9ccb,_0x2a5b01[_0x89ab('0x2c')][_0x387102][_0x89ab('0x2e')]);if(_0x417419>=0x0){_0x1e0c5f['isAutoreply']=!![];}}}return _0x1e0c5f;}exports[_0x89ab('0x2f')]=function(_0x295834,_0x15b0c2,_0x45fac9){var _0x1ea611={'from':getAddress(_0x15b0c2['from']),'firstName':getFirstName(_0x15b0c2[_0x89ab('0x30')]),'lastName':getLastName(_0x15b0c2['from']),'mapKey':_0x89ab('0x4'),'message':{'from':getMails(_0x295834[_0x89ab('0x4')],_0x15b0c2[_0x89ab('0x30')]),'to':_0x295834[_0x89ab('0x4')],'cc':'','subject':_0x15b0c2[_0x89ab('0x31')]||'','messageId':_0x15b0c2[_0x89ab('0x32')],'inReplyTo':_0x15b0c2[_0x89ab('0x33')],'sentAt':moment(_0x15b0c2[_0x89ab('0x34')])[_0x89ab('0x35')](_0x89ab('0x36')),'attach':![],'attachments':[]}};if(!_0x15b0c2[_0x89ab('0x13')]&&!_0x15b0c2[_0x89ab('0x1e')]){var _0x7bba31=_[_0x89ab('0x37')](_0x15b0c2[_0x89ab('0x18')],{'contentType':_0x89ab('0x38')});if(_0x7bba31[_0x89ab('0xf')]){logger[_0x89ab('0x39')](util[_0x89ab('0x35')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x15b0c2[_0x89ab('0x32')]));tnef[_0x89ab('0x3a')](_[_0x89ab('0x3b')](_0x7bba31)[_0x89ab('0x29')],function(_0x145bb9,_0x21839d){if(_0x21839d){_0x15b0c2[_0x89ab('0x13')]=_0x21839d[_0x89ab('0x3c')]||'<p>Empty\x20message</p>';if(_0x21839d[_0x89ab('0x3d')]){for(var _0x37e163=0x0;_0x37e163<_0x21839d['Attachments'][_0x89ab('0xf')];_0x37e163++){var _0x18308f=_0x21839d[_0x89ab('0x3d')][_0x37e163];_0x1ea611[_0x89ab('0x20')]['attachments']['push']({'filename':_0x18308f[_0x89ab('0x3e')],'content':Buffer[_0x89ab('0x30')](_0x18308f[_0x89ab('0x3f')])});}}}_0x45fac9(parseEmail(_0x295834,_0x15b0c2,_0x1ea611));});}else{_0x15b0c2[_0x89ab('0x13')]='<p>Empty\x20message</p>';_0x45fac9(parseEmail(_0x295834,_0x15b0c2,_0x1ea611));}}else{_0x45fac9(parseEmail(_0x295834,_0x15b0c2,_0x1ea611));}};exports[_0x89ab('0x40')]=function(_0x1af3a){switch(_0x1af3a){case _0x89ab('0x41'):return _0x89ab('0x42');case'yahoo':return'imap.mail.yahoo.com';case _0x89ab('0x43'):return _0x89ab('0x44');case _0x89ab('0x45'):return _0x89ab('0x46');}return _0x89ab('0x47');};
\ No newline at end of file
+var _0x5430=['originTo','originCc','email','includes','bcc','attach','attachment','attachment-','format','now','root','server/files/attachments/','writeFileSync','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','parseBuffer','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','path','util','node-tnef','../../../config/environment','head','value','address','anonymous','@xcally.com','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','generate','html','test','<img','attachments','forEach','push','filename','replace','_IMG','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message'];(function(_0x1ca907,_0x318ca2){var _0x4eb2c1=function(_0x1c0de3){while(--_0x1c0de3){_0x1ca907['push'](_0x1ca907['shift']());}};_0x4eb2c1(++_0x318ca2);}(_0x5430,0x10c));var _0x0543=function(_0x232cd0,_0x24a720){_0x232cd0=_0x232cd0-0x0;var _0xda01e0=_0x5430[_0x232cd0];return _0xda01e0;};'use strict';var _=require(_0x0543('0x0'));var moment=require(_0x0543('0x1'));var random=require(_0x0543('0x2'));var fs=require('fs');var path=require(_0x0543('0x3'));var util=require(_0x0543('0x4'));var tnef=require(_0x0543('0x5'));var logger=require('../../../config/logger')('email');var config=require(_0x0543('0x6'));function getAddress(_0x4ee416){var _0x523f3d=_[_0x0543('0x7')](_0x4ee416[_0x0543('0x8')]);return _0x523f3d&&_0x523f3d[_0x0543('0x9')]?_0x523f3d[_0x0543('0x9')]:_0x0543('0xa')+random['generate'](0x6)+_0x0543('0xb');}function getFirstName(_0x7b8280){var _0x2955ea=_[_0x0543('0x7')](_0x7b8280[_0x0543('0x8')]);if(_0x2955ea&&_0x2955ea[_0x0543('0xc')]){if(_0x2955ea['name']==_0x2955ea[_0x0543('0x9')]){return _0x2955ea[_0x0543('0xc')]['substring'](0x0,_0x2955ea[_0x0543('0xc')][_0x0543('0xd')]('@'));}var _0x2bb810=_0x2955ea[_0x0543('0xc')][_0x0543('0xe')](/\s+/);return _0x2bb810[_0x0543('0xf')]>0x1?_0x2bb810[_0x0543('0x10')](0x0,-0x1)[_0x0543('0x11')]('\x20'):_0x2955ea[_0x0543('0xc')];}return _0x0543('0x12');}function getLastName(_0x4204db){var _0x509afa=_['head'](_0x4204db[_0x0543('0x8')]);if(_0x509afa&&_0x509afa[_0x0543('0xc')]){var _0x4d2a27=_0x509afa['name'][_0x0543('0xe')](/\s+/);return _0x4d2a27[_0x0543('0xf')]>0x1?_0x4d2a27[_0x0543('0x13')]():'';}return'';}function getMails(_0x1cfadf,_0x38a32e){var _0x50d504='';for(var _0xe69a3d=0x0;_0xe69a3d<_0x38a32e[_0x0543('0x8')][_0x0543('0xf')];_0xe69a3d+=0x1){if(_0x38a32e[_0x0543('0x8')][_0xe69a3d][_0x0543('0x9')]!==_0x1cfadf){if(!_[_0x0543('0x14')](_0x50d504)){_0x50d504+=',';}_0x50d504+=_0x38a32e[_0x0543('0x8')][_0xe69a3d]['name']||_0x38a32e[_0x0543('0x8')][_0xe69a3d]['address']||'';_0x50d504+='\x20<';_0x50d504+=_0x38a32e['value'][_0xe69a3d][_0x0543('0x9')]?_0x38a32e[_0x0543('0x8')][_0xe69a3d][_0x0543('0x9')]:'anonymous'+random[_0x0543('0x15')](0x6)+'@xcally.com';_0x50d504+='>';}}return _0x50d504;}function parseEmail(_0x401da5,_0x411ec2,_0x543677){if(_0x411ec2[_0x0543('0x16')]){var _0x333c72=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x333c72[_0x0543('0x17')](_0x411ec2[_0x0543('0x16')])){_0x411ec2[_0x0543('0x16')]=_0x411ec2[_0x0543('0x16')]['replace'](_0x333c72,'');}if(_0x411ec2['html']['includes'](_0x0543('0x18'))){var _0x25b3a1=[];_0x411ec2[_0x0543('0x19')][_0x0543('0x1a')](_0x2b1425=>{_0x25b3a1[_0x0543('0x1b')](_0x2b1425[_0x0543('0x1c')]);});var _0x17a3de=/<img.*? _SRC(.*?)[^>]+>/g;var _0x1fca8a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xf1eccf=_0x411ec2[_0x0543('0x16')][_0x0543('0x1d')](_0x1fca8a,'_SRC');var _0x25e6f1=_0xf1eccf[_0x0543('0x1d')](_0x17a3de,_0x0543('0x1e'));for(let _0x4f2592=0x0;_0x4f2592<_0x25b3a1[_0x0543('0xf')];_0x4f2592++){var _0x27031f=_0x25e6f1[_0x0543('0x1d')](_0x0543('0x1e'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x25b3a1[_0x4f2592]+_0x0543('0x1f'));_0x25e6f1=_0x27031f;}_0x411ec2[_0x0543('0x16')]=_0x25e6f1;}_0x543677['body']=_0x411ec2['html'];}else{_0x543677[_0x0543('0x20')]=_0x411ec2[_0x0543('0x21')];}if(_0x543677['body']){_0x543677[_0x0543('0x20')]=_0x543677[_0x0543('0x20')][_0x0543('0x1d')](/<a\s+/gi,_0x0543('0x22'));}if(_0x411ec2['to']){_0x543677[_0x0543('0x23')][_0x0543('0x24')]=getMails(null,_0x411ec2['to']);var _0x164bbf=getMails(_0x401da5['email'],_0x411ec2['to']);if(!_[_0x0543('0x14')](_0x164bbf)){_0x543677['message']['cc']+=_0x164bbf;}}if(_0x411ec2['cc']){_0x543677[_0x0543('0x23')][_0x0543('0x25')]=getMails(null,_0x411ec2['cc']);var _0x3b8da0=getMails(_0x401da5[_0x0543('0x26')],_0x411ec2['cc']);if(!_[_0x0543('0x14')](_0x3b8da0)){if(!_['isEmpty'](_0x543677[_0x0543('0x23')]['cc'])){_0x543677['message']['cc']+=',';}_0x543677[_0x0543('0x23')]['cc']+=_0x3b8da0;}}if(!_[_0x0543('0x27')](_0x543677[_0x0543('0x23')][_0x0543('0x24')],_0x401da5['email'])&&!_[_0x0543('0x27')](_0x543677['message'][_0x0543('0x25')],_0x401da5[_0x0543('0x26')])){_0x543677[_0x0543('0x23')][_0x0543('0x28')]=_0x401da5[_0x0543('0x26')];}if(_0x411ec2[_0x0543('0x19')]&&_0x411ec2[_0x0543('0x19')][_0x0543('0xf')]){_0x543677[_0x0543('0x23')][_0x0543('0x29')]=_0x411ec2['attachments'][_0x0543('0xf')];for(var _0x2d76d6=0x0,_0x591ce0,_0x96745b,_0x4b9c1f;_0x2d76d6<_0x411ec2[_0x0543('0x19')][_0x0543('0xf')];_0x2d76d6+=0x1){if(_0x411ec2['attachments'][_0x2d76d6]['type']===_0x0543('0x2a')){_0x4b9c1f=_0x411ec2[_0x0543('0x19')][_0x2d76d6]['filename']||_0x0543('0x2b')+_0x2d76d6;_0x591ce0=util[_0x0543('0x2c')]('%s-%s',Date[_0x0543('0x2d')](),_0x4b9c1f);_0x96745b=path[_0x0543('0x11')](config[_0x0543('0x2e')],_0x0543('0x2f'),_0x591ce0);fs[_0x0543('0x30')](_0x96745b,_0x411ec2['attachments'][_0x2d76d6]['content']);_0x543677['message'][_0x0543('0x19')][_0x0543('0x1b')]({'name':_0x4b9c1f,'basename':_0x591ce0,'type':_0x411ec2[_0x0543('0x19')][_0x2d76d6][_0x0543('0x31')],'filepath':_0x96745b});}}}if(_0x411ec2['headerLines']&&_0x411ec2[_0x0543('0x32')][_0x0543('0xf')]>0x0){var _0xe3936f=[_0x0543('0x33'),_0x0543('0x34'),_0x0543('0x35')];for(var _0x40f941=0x0;_0x40f941<_0x411ec2['headerLines'][_0x0543('0xf')];_0x40f941++){var _0x32d031=_[_0x0543('0xd')](_0xe3936f,_0x411ec2[_0x0543('0x32')][_0x40f941][_0x0543('0x36')]);if(_0x32d031>=0x0){_0x543677[_0x0543('0x37')]=!![];}}}return _0x543677;}exports['parser']=function(_0x53dfb8,_0x44116a,_0x30556f){var _0x1e4818={'from':getAddress(_0x44116a[_0x0543('0x38')]),'firstName':getFirstName(_0x44116a[_0x0543('0x38')]),'lastName':getLastName(_0x44116a[_0x0543('0x38')]),'mapKey':_0x0543('0x26'),'message':{'from':getMails(_0x53dfb8[_0x0543('0x26')],_0x44116a[_0x0543('0x38')]),'to':_0x53dfb8['email'],'cc':'','subject':_0x44116a['subject']||'','messageId':_0x44116a[_0x0543('0x39')],'inReplyTo':_0x44116a[_0x0543('0x3a')],'sentAt':moment(_0x44116a['date'])['format'](_0x0543('0x3b')),'attach':![],'attachments':[]}};if(!_0x44116a[_0x0543('0x16')]&&!_0x44116a['textAsHtml']){var _0x350ca8=_['filter'](_0x44116a[_0x0543('0x19')],{'contentType':_0x0543('0x3c')});if(_0x350ca8['length']){logger['info'](util[_0x0543('0x2c')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x44116a[_0x0543('0x39')]));tnef[_0x0543('0x3d')](_[_0x0543('0x3e')](_0x350ca8)[_0x0543('0x3f')],function(_0x158536,_0x310da4){if(_0x310da4){_0x44116a['html']=_0x310da4[_0x0543('0x40')]||_0x0543('0x41');if(_0x310da4[_0x0543('0x42')]){for(var _0xf0a28f=0x0;_0xf0a28f<_0x310da4[_0x0543('0x42')]['length'];_0xf0a28f++){var _0x29840e=_0x310da4['Attachments'][_0xf0a28f];_0x1e4818[_0x0543('0x23')][_0x0543('0x19')][_0x0543('0x1b')]({'filename':_0x29840e[_0x0543('0x43')],'content':Buffer[_0x0543('0x38')](_0x29840e[_0x0543('0x44')])});}}}_0x30556f(parseEmail(_0x53dfb8,_0x44116a,_0x1e4818));});}else{_0x44116a['html']='<p>Empty\x20message</p>';_0x30556f(parseEmail(_0x53dfb8,_0x44116a,_0x1e4818));}}else{_0x30556f(parseEmail(_0x53dfb8,_0x44116a,_0x1e4818));}};exports['getHost']=function(_0xc832e2){switch(_0xc832e2){case _0x0543('0x45'):return'imap.gmail.com';case _0x0543('0x46'):return _0x0543('0x47');case _0x0543('0x48'):return _0x0543('0x49');case _0x0543('0x4a'):return _0x0543('0x4b');}return'127.0.0.1';};
\ No newline at end of file
index b26fe85..4955fed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe251=['Imap','Smtp','exports','lodash','name','Service','key','SERV','active'];(function(_0x40c98f,_0x538320){var _0x2380b5=function(_0xb737d2){while(--_0xb737d2){_0x40c98f['push'](_0x40c98f['shift']());}};_0x2380b5(++_0x538320);}(_0xe251,0x12c));var _0x1e25=function(_0x15da77,_0x10872e){_0x15da77=_0x15da77-0x0;var _0x49642c=_0xe251[_0x15da77];return _0x49642c;};'use strict';var _=require(_0x1e25('0x0'));function MailAccount(_0x2af866){this['id']=_0x2af866['id']||0x0;this[_0x1e25('0x1')]=_0x2af866['name']||_0x1e25('0x2');this[_0x1e25('0x3')]=_0x2af866[_0x1e25('0x3')]||_0x1e25('0x4');this['active']=_0x2af866[_0x1e25('0x5')]||![];this[_0x1e25('0x6')]=_0x2af866[_0x1e25('0x6')]||[];this[_0x1e25('0x7')]=_0x2af866[_0x1e25('0x7')]||[];}module[_0x1e25('0x8')]=MailAccount;
\ No newline at end of file
+var _0xa65b=['name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa65b,0x188));var _0xba65=function(_0x145f8d,_0xe79610){_0x145f8d=_0x145f8d-0x0;var _0x16d2f2=_0xa65b[_0x145f8d];return _0x16d2f2;};'use strict';var _=require('lodash');function MailAccount(_0x3a448b){this['id']=_0x3a448b['id']||0x0;this[_0xba65('0x0')]=_0x3a448b[_0xba65('0x0')]||_0xba65('0x1');this['key']=_0x3a448b[_0xba65('0x2')]||_0xba65('0x3');this['active']=_0x3a448b[_0xba65('0x4')]||![];this[_0xba65('0x5')]=_0x3a448b[_0xba65('0x5')]||[];this[_0xba65('0x6')]=_0x3a448b[_0xba65('0x6')]||[];}module[_0xba65('0x7')]=MailAccount;
\ No newline at end of file
index e3b9321..33aad63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x424b=['merge','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined'];(function(_0x5e82fd,_0x4ebf1f){var _0x2e98a8=function(_0x4706a3){while(--_0x4706a3){_0x5e82fd['push'](_0x5e82fd['shift']());}};_0x2e98a8(++_0x4ebf1f);}(_0x424b,0xdd));var _0xb424=function(_0x5c85c8,_0x16110b){_0x5c85c8=_0x5c85c8-0x0;var _0x42d66f=_0x424b[_0x5c85c8];return _0x42d66f;};'use strict';var _=require(_0xb424('0x0'));var MailAccount=require(_0xb424('0x1'));var Realtime=function(){this[_0xb424('0x2')]={};};function freeIsNotKey(_0x2d8d1b,_0x5c4bdd,_0x24ecd4){var _0x53c0d7=_[_0xb424('0x3')](_0x2d8d1b,function(_0x3820f8,_0x49acb7){return _0x3820f8[_0x24ecd4];});for(var _0x901139 in _0x5c4bdd){if(_0x5c4bdd[_0xb424('0x4')](_0x901139)){if(!_0x53c0d7[_0x901139]){delete _0x5c4bdd[_0x901139];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x1e164d,_0x370679){for(var _0x371494 in _0x370679){if(_0x1e164d['hasOwnProperty'](_0x371494)){_0x1e164d[_0x371494]=_0x370679[_0x371494];}}};Realtime[_0xb424('0x5')][_0xb424('0x6')]=function(){var _0x31588e=this;return function(_0x58fcc1){if(_0x58fcc1){freeIsNotKey(_0x58fcc1,_0x31588e[_0xb424('0x2')],'id');for(var _0x489fcb=0x0,_0x2c81a3={},_0x567473={};_0x489fcb<_0x58fcc1[_0xb424('0x7')];_0x489fcb+=0x1){_0x2c81a3=_0x58fcc1[_0x489fcb];if(_[_0xb424('0x8')](_0x31588e[_0xb424('0x2')][_0x2c81a3['id']])){_0x31588e[_0xb424('0x2')][_0x2c81a3['id']]=new MailAccount(_0x2c81a3);}else{_[_0xb424('0x9')](_0x31588e[_0xb424('0x2')][_0x2c81a3['id']],_0x2c81a3);}}}return _0x31588e[_0xb424('0x2')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0x0a6a=['mergeFromDatabase','initMailAccounts','merge','lodash','../model/mailAccount','mailAccounts','prototype'];(function(_0x44cf49,_0x372e1d){var _0x2eec97=function(_0x5782c5){while(--_0x5782c5){_0x44cf49['push'](_0x44cf49['shift']());}};_0x2eec97(++_0x372e1d);}(_0x0a6a,0x14c));var _0xa0a6=function(_0x5bf35e,_0x24dd1b){_0x5bf35e=_0x5bf35e-0x0;var _0x533fa1=_0x0a6a[_0x5bf35e];return _0x533fa1;};'use strict';var _=require(_0xa0a6('0x0'));var MailAccount=require(_0xa0a6('0x1'));var Realtime=function(){this[_0xa0a6('0x2')]={};};function freeIsNotKey(_0x376c39,_0x393786,_0x735834){var _0x3c42b5=_['mapKeys'](_0x376c39,function(_0x4c33a5,_0x2e1a96){return _0x4c33a5[_0x735834];});for(var _0x12b680 in _0x393786){if(_0x393786['hasOwnProperty'](_0x12b680)){if(!_0x3c42b5[_0x12b680]){delete _0x393786[_0x12b680];}}}}Realtime[_0xa0a6('0x3')][_0xa0a6('0x4')]=function(_0x5b0d94,_0xaa2b2d){for(var _0x1ae009 in _0xaa2b2d){if(_0x5b0d94['hasOwnProperty'](_0x1ae009)){_0x5b0d94[_0x1ae009]=_0xaa2b2d[_0x1ae009];}}};Realtime[_0xa0a6('0x3')][_0xa0a6('0x5')]=function(){var _0x31f382=this;return function(_0x59a2b0){if(_0x59a2b0){freeIsNotKey(_0x59a2b0,_0x31f382[_0xa0a6('0x2')],'id');for(var _0x59ccf5=0x0,_0x5db2dd={},_0x48a8c4={};_0x59ccf5<_0x59a2b0['length'];_0x59ccf5+=0x1){_0x5db2dd=_0x59a2b0[_0x59ccf5];if(_['isUndefined'](_0x31f382[_0xa0a6('0x2')][_0x5db2dd['id']])){_0x31f382[_0xa0a6('0x2')][_0x5db2dd['id']]=new MailAccount(_0x5db2dd);}else{_[_0xa0a6('0x6')](_0x31f382[_0xa0a6('0x2')][_0x5db2dd['id']],_0x5db2dd);}}}return _0x31f382[_0xa0a6('0x2')];};};module['exports']=Realtime;
\ No newline at end of file
index 3fba445..0af8575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bec=['active','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','Request','name','service','email'];(function(_0x430e4d,_0x2532d1){var _0x1840ef=function(_0x258ba2){while(--_0x258ba2){_0x430e4d['push'](_0x430e4d['shift']());}};_0x1840ef(++_0x2532d1);}(_0x1bec,0x168));var _0xc1be=function(_0x15e6fe,_0x1a5c39){_0x15e6fe=_0x15e6fe-0x0;var _0x34894d=_0x1bec[_0x15e6fe];return _0x34894d;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0xc1be('0x0')]('GetMailAccount',{'options':{'attributes':['id',_0xc1be('0x1'),_0xc1be('0x2'),_0xc1be('0x3'),_0xc1be('0x4'),'key',_0xc1be('0x5'),_0xc1be('0x6')],'raw':![],'include':[{'model':_0xc1be('0x7'),'as':_0xc1be('0x8')},{'model':_0xc1be('0x9'),'as':_0xc1be('0xa')}]},'log':_0xc1be('0xb')});};};exports[_0xc1be('0xc')]=function(_0x2b8db3,_0x358894){return client['Request'](_0xc1be('0xd'),{'account':{'id':_0x2b8db3},'body':_0x358894,'log':_0xc1be('0xd')});};
\ No newline at end of file
+var _0x23c7=['Imap','MailServerOut','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','service','active','key','ListId','MailServerIn'];(function(_0x96690f,_0x2e3b8a){var _0x411260=function(_0x19bd3a){while(--_0x19bd3a){_0x96690f['push'](_0x96690f['shift']());}};_0x411260(++_0x2e3b8a);}(_0x23c7,0x86));var _0x723c=function(_0x10e84d,_0x27dd02){_0x10e84d=_0x10e84d-0x0;var _0x30cc2b=_0x23c7[_0x10e84d];return _0x30cc2b;};'use strict';var client=require(_0x723c('0x0'));exports[_0x723c('0x1')]=function(){return function(){return client[_0x723c('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x723c('0x3'),_0x723c('0x4'),'email',_0x723c('0x5'),_0x723c('0x6'),_0x723c('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0x723c('0x8'),'as':_0x723c('0x9')},{'model':_0x723c('0xa'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0x723c('0xb')]=function(_0x5efad1,_0x5e9f8f){return client[_0x723c('0x2')](_0x723c('0xc'),{'account':{'id':_0x5efad1},'body':_0x5e9f8f,'log':_0x723c('0xc')});};
\ No newline at end of file
index e8d9f56..4710074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0f3=['../client','Request','ShowSetting','loginMailFrequency'];(function(_0x43bce5,_0x2007d4){var _0x16643e=function(_0x305374){while(--_0x305374){_0x43bce5['push'](_0x43bce5['shift']());}};_0x16643e(++_0x2007d4);}(_0xb0f3,0x110));var _0x3b0f=function(_0x1a7a1b,_0x518846){_0x1a7a1b=_0x1a7a1b-0x0;var _0x350750=_0xb0f3[_0x1a7a1b];return _0x350750;};'use strict';var client=require(_0x3b0f('0x0'));exports['getSettings']=function(){return client[_0x3b0f('0x1')](_0x3b0f('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3b0f('0x3')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0x3d0c=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x59edc0,_0x19ebb0){var _0x2bfadd=function(_0x3fb386){while(--_0x3fb386){_0x59edc0['push'](_0x59edc0['shift']());}};_0x2bfadd(++_0x19ebb0);}(_0x3d0c,0x11a));var _0xc3d0=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x3d0c[_0x96f74c];return _0x379222;};'use strict';var client=require(_0xc3d0('0x0'));exports[_0xc3d0('0x1')]=function(){return client[_0xc3d0('0x2')](_0xc3d0('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc3d0('0x4')]},'log':_0xc3d0('0x5')});};
\ No newline at end of file
index 384f48f..487a38f 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 8856c2a..5f92a50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ff2=['sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','exports','lodash'];(function(_0x18eb0b,_0x11077e){var _0x1ddc58=function(_0x42dffa){while(--_0x42dffa){_0x18eb0b['push'](_0x18eb0b['shift']());}};_0x1ddc58(++_0x11077e);}(_0x7ff2,0x68));var _0x27ff=function(_0x55b6bc,_0x35d6d8){_0x55b6bc=_0x55b6bc-0x0;var _0x368132=_0x7ff2[_0x55b6bc];return _0x368132;};'use strict';var _=require(_0x27ff('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x27ff('0x1'));var Redis=require(_0x27ff('0x2'));var config=require(_0x27ff('0x3'));var app=express();var server=http[_0x27ff('0x4')](app);server[_0x27ff('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x27ff('0x6')])){var socketio=require(_0x27ff('0x7'))(server,{'transports':['websocket','polling']});config[_0x27ff('0x8')]=_[_0x27ff('0x9')](config[_0x27ff('0x8')],{'host':_0x27ff('0xa'),'port':0x18eb});socketio['adapter'](require(_0x27ff('0xb'))({'pubClient':new Redis(config[_0x27ff('0x8')]),'subClient':new Redis(config['redis'])}));require(_0x27ff('0xc'))[_0x27ff('0xd')]();require(_0x27ff('0xe'))[_0x27ff('0xd')](socketio);require(_0x27ff('0xf'))[_0x27ff('0xd')](app);require(_0x27ff('0x10'))[_0x27ff('0xd')](app);}else{server[_0x27ff('0x11')](_0x27ff('0x12'),function(){console[_0x27ff('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x27ff('0x6')]);});}exports=module[_0x27ff('0x14')]=app;
\ No newline at end of file
+var _0xcd7b=['express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','socket.io-redis','../../config/triggers','../../config/socketio','default','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http'];(function(_0x144725,_0x2ad835){var _0x516c96=function(_0x16d03c){while(--_0x16d03c){_0x144725['push'](_0x144725['shift']());}};_0x516c96(++_0x2ad835);}(_0xcd7b,0x12a));var _0xbcd7=function(_0xe5bad9,_0x50ef4d){_0xe5bad9=_0xe5bad9-0x0;var _0xcac47a=_0xcd7b[_0xe5bad9];return _0xcac47a;};'use strict';var _=require('lodash');var http=require(_0xbcd7('0x0'));var express=require(_0xbcd7('0x1'));var sticky=require(_0xbcd7('0x2'));var Redis=require(_0xbcd7('0x3'));var config=require(_0xbcd7('0x4'));var app=express();var server=http[_0xbcd7('0x5')](app);server[_0xbcd7('0x6')]=0xdbba0;if(sticky[_0xbcd7('0x7')](server,config[_0xbcd7('0x8')])){var socketio=require(_0xbcd7('0x9'))(server,{'transports':[_0xbcd7('0xa'),_0xbcd7('0xb')]});config[_0xbcd7('0xc')]=_[_0xbcd7('0xd')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0xbcd7('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xbcd7('0xc')])}));require(_0xbcd7('0xf'))['default']();require(_0xbcd7('0x10'))['default'](socketio);require('../../config/express')[_0xbcd7('0x11')](app);require(_0xbcd7('0x12'))[_0xbcd7('0x11')](app);}else{server[_0xbcd7('0x13')]('listening',function(){console[_0xbcd7('0x14')](_0xbcd7('0x15'),config[_0xbcd7('0x8')]);});}exports=module[_0xbcd7('0x16')]=app;
\ No newline at end of file
index 3ade7c1..1d882e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x448e=['Request','request','then','debug','error','message','exports','jayson/promise','bluebird','../../config/logger','routing','http'];(function(_0x1a4225,_0x4a6d0b){var _0x44eb83=function(_0x6a4925){while(--_0x6a4925){_0x1a4225['push'](_0x1a4225['shift']());}};_0x44eb83(++_0x4a6d0b);}(_0x448e,0x13f));var _0xe448=function(_0x5d3903,_0x3d6c3e){_0x5d3903=_0x5d3903-0x0;var _0x4b8bc9=_0x448e[_0x5d3903];return _0x4b8bc9;};'use strict';var jayson=require(_0xe448('0x0'));var BPromise=require(_0xe448('0x1'));var logger=require(_0xe448('0x2'))(_0xe448('0x3'));var client=jayson['client'][_0xe448('0x4')]({'port':0x2329});client[_0xe448('0x5')]=function(_0x5bfa2f,_0x2242b4){return new BPromise(function(_0x520998,_0x542fb0){return client[_0xe448('0x6')](_0x5bfa2f,_0x2242b4)[_0xe448('0x7')](function(_0x36d8cf){logger[_0xe448('0x8')]('rpc',_0xe448('0x3'),_0x5bfa2f,_0x2242b4,_0x36d8cf);if(_0x36d8cf['error']){logger[_0xe448('0x9')]('rpc',_0xe448('0x3'),_0x5bfa2f,_0x36d8cf[_0xe448('0x9')][_0xe448('0xa')],_0x2242b4);return _0x542fb0(_0x36d8cf[_0xe448('0x9')][_0xe448('0xa')]);}else{return _0x520998(_0x36d8cf['result']);}})['catch'](function(_0x17401a){logger[_0xe448('0x9')]('rpc','routing',_0x5bfa2f,_0x17401a,_0x2242b4);return _0x542fb0(_0x17401a);});});};module[_0xe448('0xb')]=client;
\ No newline at end of file
+var _0x7994=['debug','rpc','error','message','routing','exports','jayson/promise','../../config/logger','client','http','Request','request','then'];(function(_0x27ec50,_0x1d8698){var _0x2da0f5=function(_0x206a3e){while(--_0x206a3e){_0x27ec50['push'](_0x27ec50['shift']());}};_0x2da0f5(++_0x1d8698);}(_0x7994,0x1da));var _0x4799=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7994[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x4799('0x0'));var BPromise=require('bluebird');var logger=require(_0x4799('0x1'))('routing');var client=jayson[_0x4799('0x2')][_0x4799('0x3')]({'port':0x2329});client[_0x4799('0x4')]=function(_0xf67dfc,_0x58ee89){return new BPromise(function(_0x50898e,_0x316212){return client[_0x4799('0x5')](_0xf67dfc,_0x58ee89)[_0x4799('0x6')](function(_0x5bf717){logger[_0x4799('0x7')](_0x4799('0x8'),'routing',_0xf67dfc,_0x58ee89,_0x5bf717);if(_0x5bf717['error']){logger[_0x4799('0x9')](_0x4799('0x8'),'routing',_0xf67dfc,_0x5bf717[_0x4799('0x9')][_0x4799('0xa')],_0x58ee89);return _0x316212(_0x5bf717[_0x4799('0x9')][_0x4799('0xa')]);}else{return _0x50898e(_0x5bf717['result']);}})['catch'](function(_0x5aac83){logger[_0x4799('0x9')](_0x4799('0x8'),_0x4799('0xb'),_0xf67dfc,_0x5aac83,_0x58ee89);return _0x316212(_0x5aac83);});});};module[_0x4799('0xc')]=client;
\ No newline at end of file
index 12cbcce..0265c1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2925=['getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues'];(function(_0x577747,_0x41bd05){var _0x3dbc0e=function(_0x56c0d9){while(--_0x56c0d9){_0x577747['push'](_0x577747['shift']());}};_0x3dbc0e(++_0x41bd05);}(_0x2925,0x1a7));var _0x5292=function(_0xdf9bf3,_0x47b495){_0xdf9bf3=_0xdf9bf3-0x0;var _0x3d69db=_0x2925[_0xdf9bf3];return _0x3d69db;};'use strict';var BPromise=require(_0x5292('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0x5292('0x1'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x5292('0x2'));var smsQueue=require(_0x5292('0x3'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x5292('0x4'));var whatsappQueue=require(_0x5292('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x5292('0x6')](user[_0x5292('0x7')]())[_0x5292('0x6')](realtime['initAgents']())['then'](interval[_0x5292('0x8')]())['then'](realtime[_0x5292('0x9')]())[_0x5292('0x6')](openchannelQueue[_0x5292('0xa')]())['then'](realtime[_0x5292('0xb')]())[_0x5292('0x6')](chatQueue[_0x5292('0xc')]())[_0x5292('0x6')](realtime[_0x5292('0xd')]())[_0x5292('0x6')](smsQueue[_0x5292('0xe')]())[_0x5292('0x6')](realtime[_0x5292('0xf')]())[_0x5292('0x6')](mailQueue[_0x5292('0x10')]())[_0x5292('0x6')](realtime[_0x5292('0x11')]())[_0x5292('0x6')](faxQueue['getFaxQueues']())['then'](realtime['initFaxQueues']())['then'](whatsappQueue[_0x5292('0x12')]())['then'](realtime[_0x5292('0x13')]())[_0x5292('0x6')](function(){return realtime;});}function main(){return server[_0x5292('0x14')](realtime)[_0x5292('0x6')](function(_0x23b60f){return initRealtime();})['then'](function(_0x3ab8f3){return setInterval(initRealtime,0x1388);})[_0x5292('0x15')](function(_0x40ec94){console[_0x5292('0x16')](_0x40ec94);});}main();
\ No newline at end of file
+var _0x6d96=['./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','getWhatsappQueues','listen','./server'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x6d96,0x71));var _0x66d9=function(_0x51eb77,_0x436673){_0x51eb77=_0x51eb77-0x0;var _0x4b26fe=_0x6d96[_0x51eb77];return _0x4b26fe;};'use strict';var BPromise=require('bluebird');var server=require(_0x66d9('0x0'));var Realtime=require(_0x66d9('0x1'));var user=require(_0x66d9('0x2'));var interval=require(_0x66d9('0x3'));var openchannelQueue=require(_0x66d9('0x4'));var chatQueue=require(_0x66d9('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x66d9('0x6'));var faxQueue=require(_0x66d9('0x7'));var whatsappQueue=require(_0x66d9('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x66d9('0x9')]()[_0x66d9('0xa')](user['getAgents']())[_0x66d9('0xa')](realtime[_0x66d9('0xb')]())[_0x66d9('0xa')](interval['getIntervals']())[_0x66d9('0xa')](realtime['initIntervals']())[_0x66d9('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x66d9('0xa')](realtime['initOpenchannelQueues']())[_0x66d9('0xa')](chatQueue[_0x66d9('0xc')]())[_0x66d9('0xa')](realtime['initChatQueues']())['then'](smsQueue[_0x66d9('0xd')]())[_0x66d9('0xa')](realtime[_0x66d9('0xe')]())[_0x66d9('0xa')](mailQueue[_0x66d9('0xf')]())[_0x66d9('0xa')](realtime['initMailQueues']())[_0x66d9('0xa')](faxQueue[_0x66d9('0x10')]())[_0x66d9('0xa')](realtime['initFaxQueues']())[_0x66d9('0xa')](whatsappQueue[_0x66d9('0x11')]())[_0x66d9('0xa')](realtime['initWhatsappQueues']())[_0x66d9('0xa')](function(){return realtime;});}function main(){return server[_0x66d9('0x12')](realtime)[_0x66d9('0xa')](function(_0x457ee3){return initRealtime();})[_0x66d9('0xa')](function(_0x5aa6f0){return setInterval(initRealtime,0x1388);})['catch'](function(_0x46e514){console['log'](_0x46e514);});}main();
\ No newline at end of file
index 6e100bf..6b767a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x1d8604,_0x30962d){var _0x7267e3=function(_0x22aae6){while(--_0x22aae6){_0x1d8604['push'](_0x1d8604['shift']());}};_0x7267e3(++_0x30962d);}(_0x7a54,0x106));var _0x47a5=function(_0x70692a,_0x5658a5){_0x70692a=_0x70692a-0x0;var _0x237cca=_0x7a54[_0x70692a];return _0x237cca;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=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(_0x1cb2c5,_0x2589dc){var _0x1e373c=function(_0x55121a){while(--_0x55121a){_0x1cb2c5['push'](_0x1cb2c5['shift']());}};_0x1e373c(++_0x2589dc);}(_0x326f,0xd1));var _0xf326=function(_0x2a090b,_0x393a7d){_0x2a090b=_0x2a090b-0x0;var _0x27807f=_0x326f[_0x2a090b];return _0x27807f;};'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 c6be4a7..1f957cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9d3=['then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x3c08e8,_0x19812a){var _0x332ce1=function(_0x46b2ee){while(--_0x46b2ee){_0x3c08e8['push'](_0x3c08e8['shift']());}};_0x332ce1(++_0x19812a);}(_0xe9d3,0x15a));var _0x3e9d=function(_0x37ef2e,_0xb7ceca){_0x37ef2e=_0x37ef2e-0x0;var _0x374e72=_0xe9d3[_0x37ef2e];return _0x374e72;};'use strict';var BPromise=require(_0x3e9d('0x0'));var jayson=require(_0x3e9d('0x1'));var client=jayson[_0x3e9d('0x2')][_0x3e9d('0x3')]({'port':0x232b});function request(_0x648d3a,_0x5d850a){return new BPromise(function(_0x8cf8b4,_0x4b04bc){return client['request'](_0x648d3a,_0x5d850a)[_0x3e9d('0x4')](function(_0x85f176){if(_0x85f176[_0x3e9d('0x5')]){return _0x4b04bc(_0x85f176['error'][_0x3e9d('0x6')]);}else{return _0x8cf8b4(_0x85f176['result']);}})[_0x3e9d('0x7')](function(_0x27b9b6){return _0x4b04bc(_0x27b9b6);});});}exports[_0x3e9d('0x8')]=function(_0x1e373d,_0x4c45c0){return request(_0x3e9d('0x9'),{'account':_0x1e373d,'message':_0x4c45c0});};
\ No newline at end of file
+var _0xddf9=['sendMailMessage','bluebird','jayson/promise','client','request','then','error','result'];(function(_0x527a92,_0x25805d){var _0x5611f9=function(_0x4fcbd4){while(--_0x4fcbd4){_0x527a92['push'](_0x527a92['shift']());}};_0x5611f9(++_0x25805d);}(_0xddf9,0x1a1));var _0x9ddf=function(_0x4c2b80,_0x2d9078){_0x4c2b80=_0x4c2b80-0x0;var _0x21ecf9=_0xddf9[_0x4c2b80];return _0x21ecf9;};'use strict';var BPromise=require(_0x9ddf('0x0'));var jayson=require(_0x9ddf('0x1'));var client=jayson[_0x9ddf('0x2')]['http']({'port':0x232b});function request(_0x217b2b,_0x2218db){return new BPromise(function(_0x254f32,_0x15bcd2){return client[_0x9ddf('0x3')](_0x217b2b,_0x2218db)[_0x9ddf('0x4')](function(_0x1959df){if(_0x1959df[_0x9ddf('0x5')]){return _0x15bcd2(_0x1959df[_0x9ddf('0x5')]['message']);}else{return _0x254f32(_0x1959df[_0x9ddf('0x6')]);}})['catch'](function(_0x302123){return _0x15bcd2(_0x302123);});});}exports[_0x9ddf('0x7')]=function(_0x28f3c0,_0x337249){return request('SendMail',{'account':_0x28f3c0,'message':_0x337249});};
\ No newline at end of file
index 5a5173d..75df551 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe323=['ioredis','redis','defaults','localhost','socket.io-emitter','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity','busyQueue','md5','updateRealtime','prototype','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','name','mailCurrentCapacity','faxStatus','smsStatusTime','whatsappStatusTime','openchannelStatus','openchannelStatusTime','openchannelCurrentCapacity','busy','stringify','user:save','exports','lodash','moment'];(function(_0x3f01dc,_0x5a9e42){var _0x37be52=function(_0xcea4d1){while(--_0xcea4d1){_0x3f01dc['push'](_0x3f01dc['shift']());}};_0x37be52(++_0x5a9e42);}(_0xe323,0x16c));var _0x3e32=function(_0x125c3a,_0x2d86ca){_0x125c3a=_0x125c3a-0x0;var _0x5dec85=_0xe323[_0x125c3a];return _0x5dec85;};'use strict';var _=require(_0x3e32('0x0'));var moment=require(_0x3e32('0x1'));var md5=require('md5');var Redis=require(_0x3e32('0x2'));var config=require('../../../config/environment');config[_0x3e32('0x3')]=_[_0x3e32('0x4')](config[_0x3e32('0x3')],{'host':_0x3e32('0x5'),'port':0x18eb});var io=require(_0x3e32('0x6'))(new Redis(config[_0x3e32('0x3')]));function Agent(_0x209dec){this['id']=_0x209dec['id']||0x0;this['name']=_0x209dec['name']||'';this[_0x3e32('0x7')]=_0x209dec[_0x3e32('0x7')]||!![];this[_0x3e32('0x8')]=_0x209dec['voicePause']||![];this['chatPause']=_0x209dec[_0x3e32('0x9')]||![];this[_0x3e32('0xa')]=_0x209dec[_0x3e32('0xa')]||![];this['faxPause']=_0x209dec[_0x3e32('0xb')]||![];this[_0x3e32('0xc')]=_0x209dec[_0x3e32('0xc')]||![];this[_0x3e32('0xd')]=_0x209dec[_0x3e32('0xd')]||![];this[_0x3e32('0xe')]=_0x3e32('0xf');this[_0x3e32('0x10')]=0x0;this[_0x3e32('0x11')]=_0x209dec['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x3e32('0x12')]=_0x3e32('0xf');this[_0x3e32('0x13')]=0x0;this[_0x3e32('0x14')]=_0x209dec[_0x3e32('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x3e32('0xf');this[_0x3e32('0x15')]=0x0;this['faxCapacity']=_0x209dec[_0x3e32('0x16')]||0x0;this[_0x3e32('0x17')]=0x0;this[_0x3e32('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0x3e32('0x19')]=_0x209dec[_0x3e32('0x19')]||0x0;this[_0x3e32('0x1a')]=0x0;this['whatsappStatus']=_0x3e32('0xf');this['whatsappStatusTime']=0x0;this[_0x3e32('0x1b')]=_0x209dec['whatsappCapacity']||0x0;this[_0x3e32('0x1c')]=0x0;this['openchannelStatus']='unknown';this['openchannelStatusTime']=0x0;this[_0x3e32('0x1d')]=_0x209dec[_0x3e32('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x3e32('0x1e')]=undefined;this[_0x3e32('0x1f')]='';this[_0x3e32('0x20')]();}Agent[_0x3e32('0x21')]['getChannelStatus']=function(_0x20726f){if(this[_0x20726f+_0x3e32('0x22')]>0x0){if(this[_0x20726f+_0x3e32('0x23')]>0x0&&this[_0x20726f+_0x3e32('0x22')]>=this[_0x20726f+'Capacity']){return'maxcapacity';}else{return _0x3e32('0x24');}}else{return _0x3e32('0x25');}};Agent['prototype'][_0x3e32('0x20')]=function(){var _0x3bb094=[_0x3e32('0x26'),_0x3e32('0x27'),_0x3e32('0x28'),_0x3e32('0x29'),_0x3e32('0x2a'),_0x3e32('0x2b')];for(var _0xca18c1=0x0;_0xca18c1<_0x3bb094[_0x3e32('0x2c')];_0xca18c1+=0x1){var _0x549498=this['getChannelStatus'](_0x3bb094[_0xca18c1]);if(this[_0x3bb094[_0xca18c1]+_0x3e32('0x2d')]!==_0x549498){this[_0x3bb094[_0xca18c1]+_0x3e32('0x2e')]=_[_0x3e32('0x2f')](moment()[_0x3e32('0x30')]('x'));}this[_0x3bb094[_0xca18c1]+_0x3e32('0x2d')]=_0x549498;}var _0x5c4daf={'id':this['id'],'name':this[_0x3e32('0x31')],'online':this[_0x3e32('0x7')],'voicePause':this[_0x3e32('0x8')],'chatPause':this[_0x3e32('0x9')],'mailPause':this[_0x3e32('0xa')],'smsPause':this[_0x3e32('0xc')],'faxPause':this[_0x3e32('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x3e32('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x3e32('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x3e32('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x3e32('0x14')],'mailCurrentCapacity':this[_0x3e32('0x32')],'faxStatus':this[_0x3e32('0x33')],'faxStatusTime':this[_0x3e32('0x15')],'faxCapacity':this[_0x3e32('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x3e32('0x18')],'smsStatusTime':this[_0x3e32('0x34')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x3e32('0x1a')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x3e32('0x35')],'whatsappCapacity':this[_0x3e32('0x1b')],'whatsappCurrentCapacity':this[_0x3e32('0x1c')],'openchannelStatus':this[_0x3e32('0x36')],'openchannelStatusTime':this[_0x3e32('0x37')],'openchannelCapacity':this[_0x3e32('0x1d')],'openchannelCurrentCapacity':this[_0x3e32('0x38')],'busy':this[_0x3e32('0x39')],'busyQueue':this['busyQueue']};var _0x1774a4=md5(JSON[_0x3e32('0x3a')](_0x5c4daf));if(this[_0x3e32('0x1f')]!==_0x1774a4){this[_0x3e32('0x1f')]=_0x1774a4;io['emit'](_0x3e32('0x3b'),_0x5c4daf);}};module[_0x3e32('0x3c')]=Agent;
\ No newline at end of file
+var _0x4a55=['openchannel','whatsapp','length','Status','StatusTime','toNumber','online','mailCurrentCapacity','whatsappCurrentCapacity','stringify','emit','user:save','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime'];(function(_0x1fbebb,_0x328bda){var _0x2543f1=function(_0x2e07f7){while(--_0x2e07f7){_0x1fbebb['push'](_0x1fbebb['shift']());}};_0x2543f1(++_0x328bda);}(_0x4a55,0x124));var _0x54a5=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x4a55[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x54a5('0x0'));var moment=require('moment');var md5=require(_0x54a5('0x1'));var Redis=require(_0x54a5('0x2'));var config=require(_0x54a5('0x3'));config['redis']=_[_0x54a5('0x4')](config[_0x54a5('0x5')],{'host':_0x54a5('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x2a6a73){this['id']=_0x2a6a73['id']||0x0;this[_0x54a5('0x7')]=_0x2a6a73['name']||'';this['online']=_0x2a6a73['online']||!![];this[_0x54a5('0x8')]=_0x2a6a73[_0x54a5('0x8')]||![];this[_0x54a5('0x9')]=_0x2a6a73[_0x54a5('0x9')]||![];this[_0x54a5('0xa')]=_0x2a6a73[_0x54a5('0xa')]||![];this['faxPause']=_0x2a6a73[_0x54a5('0xb')]||![];this['smsPause']=_0x2a6a73[_0x54a5('0xc')]||![];this[_0x54a5('0xd')]=_0x2a6a73[_0x54a5('0xd')]||![];this[_0x54a5('0xe')]='unknown';this['chatStatusTime']=0x0;this[_0x54a5('0xf')]=_0x2a6a73[_0x54a5('0xf')]||0x0;this[_0x54a5('0x10')]=0x0;this[_0x54a5('0x11')]=_0x54a5('0x12');this[_0x54a5('0x13')]=0x0;this[_0x54a5('0x14')]=_0x2a6a73[_0x54a5('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x54a5('0x15')]='unknown';this[_0x54a5('0x16')]=0x0;this[_0x54a5('0x17')]=_0x2a6a73[_0x54a5('0x17')]||0x0;this[_0x54a5('0x18')]=0x0;this['smsStatus']='unknown';this[_0x54a5('0x19')]=0x0;this[_0x54a5('0x1a')]=_0x2a6a73[_0x54a5('0x1a')]||0x0;this[_0x54a5('0x1b')]=0x0;this[_0x54a5('0x1c')]='unknown';this[_0x54a5('0x1d')]=0x0;this['whatsappCapacity']=_0x2a6a73[_0x54a5('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x54a5('0x1f')]=_0x54a5('0x12');this[_0x54a5('0x20')]=0x0;this[_0x54a5('0x21')]=_0x2a6a73['openchannelCapacity']||0x0;this[_0x54a5('0x22')]=0x0;this[_0x54a5('0x23')]=![];this[_0x54a5('0x24')]=undefined;this[_0x54a5('0x1')]='';this['updateRealtime']();}Agent[_0x54a5('0x25')][_0x54a5('0x26')]=function(_0x5c5ecd){if(this[_0x5c5ecd+'CurrentCapacity']>0x0){if(this[_0x5c5ecd+'Capacity']>0x0&&this[_0x5c5ecd+_0x54a5('0x27')]>=this[_0x5c5ecd+_0x54a5('0x28')]){return'maxcapacity';}else{return _0x54a5('0x29');}}else{return _0x54a5('0x2a');}};Agent[_0x54a5('0x25')][_0x54a5('0x2b')]=function(){var _0x114e71=['mail','chat',_0x54a5('0x2c'),'fax','sms',_0x54a5('0x2d')];for(var _0x5344f2=0x0;_0x5344f2<_0x114e71[_0x54a5('0x2e')];_0x5344f2+=0x1){var _0x447a69=this[_0x54a5('0x26')](_0x114e71[_0x5344f2]);if(this[_0x114e71[_0x5344f2]+_0x54a5('0x2f')]!==_0x447a69){this[_0x114e71[_0x5344f2]+_0x54a5('0x30')]=_[_0x54a5('0x31')](moment()['format']('x'));}this[_0x114e71[_0x5344f2]+_0x54a5('0x2f')]=_0x447a69;}var _0xc12073={'id':this['id'],'name':this[_0x54a5('0x7')],'online':this[_0x54a5('0x32')],'voicePause':this[_0x54a5('0x8')],'chatPause':this[_0x54a5('0x9')],'mailPause':this[_0x54a5('0xa')],'smsPause':this[_0x54a5('0xc')],'faxPause':this[_0x54a5('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x54a5('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x54a5('0xf')],'chatCurrentCapacity':this[_0x54a5('0x10')],'mailStatus':this[_0x54a5('0x11')],'mailStatusTime':this[_0x54a5('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x54a5('0x33')],'faxStatus':this[_0x54a5('0x15')],'faxStatusTime':this[_0x54a5('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x54a5('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x54a5('0x19')],'smsCapacity':this[_0x54a5('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x54a5('0x1c')],'whatsappStatusTime':this[_0x54a5('0x1d')],'whatsappCapacity':this[_0x54a5('0x1e')],'whatsappCurrentCapacity':this[_0x54a5('0x34')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x54a5('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x54a5('0x22')],'busy':this['busy'],'busyQueue':this[_0x54a5('0x24')]};var _0x1561d6=md5(JSON[_0x54a5('0x35')](_0xc12073));if(this['md5']!==_0x1561d6){this['md5']=_0x1561d6;io[_0x54a5('0x36')](_0x54a5('0x37'),_0xc12073);}};module['exports']=Agent;
\ No newline at end of file
index 2da000f..56a1502 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d6e=['mapAgentsId','_rr','map','loggedIn','paused','length','online','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents','updateRouting','updateRealtime','prototype'];(function(_0x349c9f,_0x137804){var _0x393b81=function(_0x26f6f9){while(--_0x26f6f9){_0x349c9f['push'](_0x349c9f['shift']());}};_0x393b81(++_0x137804);}(_0x4d6e,0x126));var _0xe4d6=function(_0x4427a0,_0x39edb4){_0x4427a0=_0x4427a0-0x0;var _0x2a9ccf=_0x4d6e[_0x4427a0];return _0x2a9ccf;};'use strict';var _=require(_0xe4d6('0x0'));var md5=require(_0xe4d6('0x1'));var util=require(_0xe4d6('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xe4d6('0x3')](config['redis'],{'host':_0xe4d6('0x4'),'port':0x18eb});var io=require(_0xe4d6('0x5'))(new Redis(config[_0xe4d6('0x6')]));function ChatQueue(_0x2f9c82){this['id']=_0x2f9c82['id']||0x0;this['name']=_0x2f9c82[_0xe4d6('0x7')]||'';this[_0xe4d6('0x8')]=_0x2f9c82['timeout']||0xa;this['strategy']=_0x2f9c82[_0xe4d6('0x9')]||'beepall';this[_0xe4d6('0xa')]=_0x2f9c82['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xe4d6('0x1')]='';this[_0xe4d6('0xb')]();this[_0xe4d6('0xc')]();}ChatQueue[_0xe4d6('0xd')][_0xe4d6('0xb')]=function(){var _0x351987=this[_0xe4d6('0xe')][_0xe4d6('0xf')];this[_0xe4d6('0xe')]=_[_0xe4d6('0x10')](this[_0xe4d6('0xa')],'id');this[_0xe4d6('0xe')]['_rr']=_0x351987;};ChatQueue[_0xe4d6('0xd')][_0xe4d6('0xc')]=function(){this[_0xe4d6('0x11')]=0x0;this[_0xe4d6('0x12')]=0x0;for(var _0x4571f1=0x0;_0x4571f1<this[_0xe4d6('0xa')][_0xe4d6('0x13')];_0x4571f1+=0x1){if(this['Agents'][_0x4571f1][_0xe4d6('0x14')]){this[_0xe4d6('0x11')]+=0x1;}if(this[_0xe4d6('0xa')][_0x4571f1]['chatPause']){this[_0xe4d6('0x12')]+=0x1;}}this[_0xe4d6('0x15')]=this[_0xe4d6('0x11')]-this[_0xe4d6('0x12')];this[_0xe4d6('0x15')]=this[_0xe4d6('0x15')]>=0x0?this[_0xe4d6('0x15')]:0x0;var _0x1c6c5b={'id':this['id'],'available':this[_0xe4d6('0x15')],'loggedIn':this[_0xe4d6('0x11')],'name':this[_0xe4d6('0x7')],'paused':this[_0xe4d6('0x12')],'waiting':this[_0xe4d6('0x16')]};var _0x308b8f=md5(JSON[_0xe4d6('0x17')](_0x1c6c5b));if(this[_0xe4d6('0x1')]!==_0x308b8f){this[_0xe4d6('0x1')]=_0x308b8f;io['to'](util[_0xe4d6('0x18')](_0xe4d6('0x19'),_0x1c6c5b[_0xe4d6('0x7')]))[_0xe4d6('0x1a')](_0xe4d6('0x1b'),_0x1c6c5b);}};module['exports']=ChatQueue;
\ No newline at end of file
+var _0xc1c0=['paused','online','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn'];(function(_0x5c3514,_0x18e281){var _0x56e259=function(_0x4914e3){while(--_0x4914e3){_0x5c3514['push'](_0x5c3514['shift']());}};_0x56e259(++_0x18e281);}(_0xc1c0,0x167));var _0x0c1c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c1c('0x0'));var md5=require(_0x0c1c('0x1'));var util=require(_0x0c1c('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x0c1c('0x3')],{'host':_0x0c1c('0x4'),'port':0x18eb});var io=require(_0x0c1c('0x5'))(new Redis(config[_0x0c1c('0x3')]));function ChatQueue(_0x4d6fd3){this['id']=_0x4d6fd3['id']||0x0;this['name']=_0x4d6fd3[_0x0c1c('0x6')]||'';this[_0x0c1c('0x7')]=_0x4d6fd3['timeout']||0xa;this[_0x0c1c('0x8')]=_0x4d6fd3[_0x0c1c('0x8')]||_0x0c1c('0x9');this['Agents']=_0x4d6fd3[_0x0c1c('0xa')];this[_0x0c1c('0xb')]={};this['waiting']=0x0;this[_0x0c1c('0x1')]='';this[_0x0c1c('0xc')]();this[_0x0c1c('0xd')]();}ChatQueue['prototype'][_0x0c1c('0xc')]=function(){var _0x2e1022=this[_0x0c1c('0xb')][_0x0c1c('0xe')];this['mapAgentsId']=_[_0x0c1c('0xf')](this[_0x0c1c('0xa')],'id');this[_0x0c1c('0xb')][_0x0c1c('0xe')]=_0x2e1022;};ChatQueue[_0x0c1c('0x10')][_0x0c1c('0xd')]=function(){this[_0x0c1c('0x11')]=0x0;this[_0x0c1c('0x12')]=0x0;for(var _0x288f19=0x0;_0x288f19<this[_0x0c1c('0xa')]['length'];_0x288f19+=0x1){if(this['Agents'][_0x288f19][_0x0c1c('0x13')]){this[_0x0c1c('0x11')]+=0x1;}if(this[_0x0c1c('0xa')][_0x288f19][_0x0c1c('0x14')]){this[_0x0c1c('0x12')]+=0x1;}}this[_0x0c1c('0x15')]=this['loggedIn']-this[_0x0c1c('0x12')];this[_0x0c1c('0x15')]=this[_0x0c1c('0x15')]>=0x0?this[_0x0c1c('0x15')]:0x0;var _0x5ceb7f={'id':this['id'],'available':this[_0x0c1c('0x15')],'loggedIn':this[_0x0c1c('0x11')],'name':this[_0x0c1c('0x6')],'paused':this[_0x0c1c('0x12')],'waiting':this[_0x0c1c('0x16')]};var _0xc21a48=md5(JSON[_0x0c1c('0x17')](_0x5ceb7f));if(this[_0x0c1c('0x1')]!==_0xc21a48){this[_0x0c1c('0x1')]=_0xc21a48;io['to'](util[_0x0c1c('0x18')](_0x0c1c('0x19'),_0x5ceb7f['name']))[_0x0c1c('0x1a')](_0x0c1c('0x1b'),_0x5ceb7f);}};module[_0x0c1c('0x1c')]=ChatQueue;
\ No newline at end of file
index 8a98134..0ef8f73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ed2=['Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','online','faxPause','paused','available','stringify','format','fax:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x47abe8,_0x4e612d){var _0x17abbb=function(_0x55545b){while(--_0x55545b){_0x47abe8['push'](_0x47abe8['shift']());}};_0x17abbb(++_0x4e612d);}(_0x4ed2,0xec));var _0x24ed=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4ed2[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x24ed('0x0'));var md5=require('md5');var util=require(_0x24ed('0x1'));var Redis=require(_0x24ed('0x2'));var config=require(_0x24ed('0x3'));config[_0x24ed('0x4')]=_[_0x24ed('0x5')](config[_0x24ed('0x4')],{'host':_0x24ed('0x6'),'port':0x18eb});var io=require(_0x24ed('0x7'))(new Redis(config['redis']));function FaxQueue(_0x220110){this['id']=_0x220110['id']||0x0;this['name']=_0x220110[_0x24ed('0x8')]||'';this[_0x24ed('0x9')]=_0x220110[_0x24ed('0x9')]||0xa;this[_0x24ed('0xa')]=_0x220110[_0x24ed('0xa')]||_0x24ed('0xb');this[_0x24ed('0xc')]=_0x220110[_0x24ed('0xc')];this['mapAgentsId']={};this[_0x24ed('0xd')]=0x0;this[_0x24ed('0xe')]='';this[_0x24ed('0xf')]();this[_0x24ed('0x10')]();}FaxQueue[_0x24ed('0x11')][_0x24ed('0xf')]=function(){var _0x5ef55d=this[_0x24ed('0x12')][_0x24ed('0x13')];this[_0x24ed('0x12')]=_[_0x24ed('0x14')](this[_0x24ed('0xc')],'id');this['mapAgentsId']['_rr']=_0x5ef55d;};FaxQueue[_0x24ed('0x11')][_0x24ed('0x10')]=function(){this[_0x24ed('0x15')]=0x0;this['paused']=0x0;for(var _0x433c25=0x0;_0x433c25<this['Agents']['length'];_0x433c25+=0x1){if(this[_0x24ed('0xc')][_0x433c25][_0x24ed('0x16')]){this[_0x24ed('0x15')]+=0x1;}if(this[_0x24ed('0xc')][_0x433c25][_0x24ed('0x17')]){this[_0x24ed('0x18')]+=0x1;}}this['available']=this[_0x24ed('0x15')]-this['paused'];this[_0x24ed('0x19')]=this[_0x24ed('0x19')]>=0x0?this['available']:0x0;var _0x5703a7={'id':this['id'],'available':this[_0x24ed('0x19')],'loggedIn':this[_0x24ed('0x15')],'name':this[_0x24ed('0x8')],'paused':this[_0x24ed('0x18')],'waiting':this[_0x24ed('0xd')]};var _0xa9782=md5(JSON[_0x24ed('0x1a')](_0x5703a7));if(this['md5']!==_0xa9782){this[_0x24ed('0xe')]=_0xa9782;io['to'](util[_0x24ed('0x1b')](_0x24ed('0x1c'),_0x5703a7[_0x24ed('0x8')]))[_0x24ed('0x1d')]('fax_queue:save',_0x5703a7);}};module[_0x24ed('0x1e')]=FaxQueue;
\ No newline at end of file
+var _0xd154=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','faxPause','available','waiting','stringify','format','fax:queue:%s','emit','exports','lodash','md5','util','ioredis'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xd154,0x10a));var _0x4d15=function(_0x1a5f3c,_0x3c699f){_0x1a5f3c=_0x1a5f3c-0x0;var _0x27dbaa=_0xd154[_0x1a5f3c];return _0x27dbaa;};'use strict';var _=require(_0x4d15('0x0'));var md5=require(_0x4d15('0x1'));var util=require(_0x4d15('0x2'));var Redis=require(_0x4d15('0x3'));var config=require('../../../config/environment');config[_0x4d15('0x4')]=_['defaults'](config[_0x4d15('0x4')],{'host':_0x4d15('0x5'),'port':0x18eb});var io=require(_0x4d15('0x6'))(new Redis(config[_0x4d15('0x4')]));function FaxQueue(_0x3d009c){this['id']=_0x3d009c['id']||0x0;this[_0x4d15('0x7')]=_0x3d009c[_0x4d15('0x7')]||'';this[_0x4d15('0x8')]=_0x3d009c['timeout']||0xa;this[_0x4d15('0x9')]=_0x3d009c[_0x4d15('0x9')]||_0x4d15('0xa');this[_0x4d15('0xb')]=_0x3d009c[_0x4d15('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x4d15('0x1')]='';this[_0x4d15('0xc')]();this[_0x4d15('0xd')]();}FaxQueue[_0x4d15('0xe')][_0x4d15('0xc')]=function(){var _0x19b407=this[_0x4d15('0xf')][_0x4d15('0x10')];this[_0x4d15('0xf')]=_[_0x4d15('0x11')](this[_0x4d15('0xb')],'id');this[_0x4d15('0xf')][_0x4d15('0x10')]=_0x19b407;};FaxQueue['prototype'][_0x4d15('0xd')]=function(){this['loggedIn']=0x0;this[_0x4d15('0x12')]=0x0;for(var _0x32ada9=0x0;_0x32ada9<this[_0x4d15('0xb')][_0x4d15('0x13')];_0x32ada9+=0x1){if(this[_0x4d15('0xb')][_0x32ada9][_0x4d15('0x14')]){this[_0x4d15('0x15')]+=0x1;}if(this[_0x4d15('0xb')][_0x32ada9][_0x4d15('0x16')]){this['paused']+=0x1;}}this[_0x4d15('0x17')]=this[_0x4d15('0x15')]-this['paused'];this[_0x4d15('0x17')]=this['available']>=0x0?this[_0x4d15('0x17')]:0x0;var _0x23a428={'id':this['id'],'available':this['available'],'loggedIn':this[_0x4d15('0x15')],'name':this[_0x4d15('0x7')],'paused':this[_0x4d15('0x12')],'waiting':this[_0x4d15('0x18')]};var _0x1789fc=md5(JSON[_0x4d15('0x19')](_0x23a428));if(this[_0x4d15('0x1')]!==_0x1789fc){this[_0x4d15('0x1')]=_0x1789fc;io['to'](util[_0x4d15('0x1a')](_0x4d15('0x1b'),_0x23a428['name']))[_0x4d15('0x1c')]('fax_queue:save',_0x23a428);}};module[_0x4d15('0x1d')]=FaxQueue;
\ No newline at end of file
index b2b0b58..75f0e23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x804f=['name','Intervals'];(function(_0x45c9d2,_0x96b578){var _0x2c317b=function(_0x1ff3d2){while(--_0x1ff3d2){_0x45c9d2['push'](_0x45c9d2['shift']());}};_0x2c317b(++_0x96b578);}(_0x804f,0x1a0));var _0xf804=function(_0x16d230,_0x284c22){_0x16d230=_0x16d230-0x0;var _0x5a97ce=_0x804f[_0x16d230];return _0x5a97ce;};'use strict';function Interval(_0x45c90a){this['id']=_0x45c90a['id']||0x0;this[_0xf804('0x0')]=_0x45c90a[_0xf804('0x0')]||'';this[_0xf804('0x1')]=_0x45c90a[_0xf804('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
+var _0x8fb4=['Intervals','exports','name'];(function(_0x3064a3,_0x20e71a){var _0x4319b6=function(_0x2e5240){while(--_0x2e5240){_0x3064a3['push'](_0x3064a3['shift']());}};_0x4319b6(++_0x20e71a);}(_0x8fb4,0x128));var _0x48fb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fb4[_0x19e35c];return _0x3e1fe8;};'use strict';function Interval(_0x2b2924){this['id']=_0x2b2924['id']||0x0;this['name']=_0x2b2924[_0x48fb('0x0')]||'';this[_0x48fb('0x1')]=_0x2b2924['Intervals']||{};}module[_0x48fb('0x2')]=Interval;
\ No newline at end of file
index 3c75b14..eb82102 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f5f=['online','loggedIn','mailPause','available','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','redis','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','paused','length'];(function(_0x36f9fc,_0x10b9e3){var _0xa748e6=function(_0x2d84d2){while(--_0x2d84d2){_0x36f9fc['push'](_0x36f9fc['shift']());}};_0xa748e6(++_0x10b9e3);}(_0x9f5f,0x17f));var _0xf9f5=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9f5f[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xf9f5('0x0'));var md5=require('md5');var util=require(_0xf9f5('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xf9f5('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xf9f5('0x3'))(new Redis(config['redis']));function MailQueue(_0x4a4ffe){this['id']=_0x4a4ffe['id']||0x0;this[_0xf9f5('0x4')]=_0x4a4ffe['name']||'';this['timeout']=_0x4a4ffe['timeout']||0xa;this['strategy']=_0x4a4ffe[_0xf9f5('0x5')]||_0xf9f5('0x6');this[_0xf9f5('0x7')]=_0x4a4ffe[_0xf9f5('0x7')];this[_0xf9f5('0x8')]={};this[_0xf9f5('0x9')]=0x0;this[_0xf9f5('0xa')]='';this[_0xf9f5('0xb')]();this[_0xf9f5('0xc')]();}MailQueue[_0xf9f5('0xd')][_0xf9f5('0xb')]=function(){var _0x7d9249=this['mapAgentsId']['_rr'];this[_0xf9f5('0x8')]=_[_0xf9f5('0xe')](this['Agents'],'id');this[_0xf9f5('0x8')]['_rr']=_0x7d9249;};MailQueue[_0xf9f5('0xd')][_0xf9f5('0xc')]=function(){this['loggedIn']=0x0;this[_0xf9f5('0xf')]=0x0;for(var _0x5084ce=0x0;_0x5084ce<this[_0xf9f5('0x7')][_0xf9f5('0x10')];_0x5084ce+=0x1){if(this[_0xf9f5('0x7')][_0x5084ce][_0xf9f5('0x11')]){this[_0xf9f5('0x12')]+=0x1;}if(this[_0xf9f5('0x7')][_0x5084ce][_0xf9f5('0x13')]){this['paused']+=0x1;}}this[_0xf9f5('0x14')]=this[_0xf9f5('0x12')]-this[_0xf9f5('0xf')];this[_0xf9f5('0x14')]=this[_0xf9f5('0x14')]>=0x0?this['available']:0x0;var _0x771012={'id':this['id'],'available':this[_0xf9f5('0x14')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xf9f5('0xf')],'waiting':this[_0xf9f5('0x9')]};var _0x579df3=md5(JSON['stringify'](_0x771012));if(this['md5']!==_0x579df3){this[_0xf9f5('0xa')]=_0x579df3;io['to'](util['format'](_0xf9f5('0x15'),_0x771012[_0xf9f5('0x4')]))[_0xf9f5('0x16')](_0xf9f5('0x17'),_0x771012);}};module[_0xf9f5('0x18')]=MailQueue;
\ No newline at end of file
+var _0xa8cb=['updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','length','online','loggedIn','mailPause','paused','available','waiting','md5','format','mail:queue:%s','emit','mail_queue:save','exports','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x4a8a49,_0x5b6583){var _0x2a4955=function(_0x3c0b1b){while(--_0x3c0b1b){_0x4a8a49['push'](_0x4a8a49['shift']());}};_0x2a4955(++_0x5b6583);}(_0xa8cb,0x17b));var _0xba8c=function(_0x5c5f2f,_0x4325f3){_0x5c5f2f=_0x5c5f2f-0x0;var _0x4ecef=_0xa8cb[_0x5c5f2f];return _0x4ecef;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xba8c('0x0'));var Redis=require(_0xba8c('0x1'));var config=require(_0xba8c('0x2'));config['redis']=_[_0xba8c('0x3')](config[_0xba8c('0x4')],{'host':_0xba8c('0x5'),'port':0x18eb});var io=require(_0xba8c('0x6'))(new Redis(config[_0xba8c('0x4')]));function MailQueue(_0x39848a){this['id']=_0x39848a['id']||0x0;this[_0xba8c('0x7')]=_0x39848a['name']||'';this['timeout']=_0x39848a[_0xba8c('0x8')]||0xa;this['strategy']=_0x39848a[_0xba8c('0x9')]||'beepall';this['Agents']=_0x39848a[_0xba8c('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xba8c('0xb')]();this[_0xba8c('0xc')]();}MailQueue[_0xba8c('0xd')][_0xba8c('0xb')]=function(){var _0x3332a0=this['mapAgentsId'][_0xba8c('0xe')];this[_0xba8c('0xf')]=_[_0xba8c('0x10')](this[_0xba8c('0xa')],'id');this[_0xba8c('0xf')]['_rr']=_0x3332a0;};MailQueue['prototype'][_0xba8c('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x267773=0x0;_0x267773<this[_0xba8c('0xa')][_0xba8c('0x11')];_0x267773+=0x1){if(this[_0xba8c('0xa')][_0x267773][_0xba8c('0x12')]){this[_0xba8c('0x13')]+=0x1;}if(this[_0xba8c('0xa')][_0x267773][_0xba8c('0x14')]){this[_0xba8c('0x15')]+=0x1;}}this['available']=this['loggedIn']-this['paused'];this[_0xba8c('0x16')]=this[_0xba8c('0x16')]>=0x0?this['available']:0x0;var _0x22b0e2={'id':this['id'],'available':this['available'],'loggedIn':this[_0xba8c('0x13')],'name':this[_0xba8c('0x7')],'paused':this['paused'],'waiting':this[_0xba8c('0x17')]};var _0x20faeb=md5(JSON['stringify'](_0x22b0e2));if(this[_0xba8c('0x18')]!==_0x20faeb){this[_0xba8c('0x18')]=_0x20faeb;io['to'](util[_0xba8c('0x19')](_0xba8c('0x1a'),_0x22b0e2['name']))[_0xba8c('0x1b')](_0xba8c('0x1c'),_0x22b0e2);}};module[_0xba8c('0x1d')]=MailQueue;
\ No newline at end of file
index 84fdc66..e56b09b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x326f,0xd1));var _0xf326=function(_0x43de7f,_0x1eeed1){_0x43de7f=_0x43de7f-0x0;var _0x17dadc=_0x326f[_0x43de7f];return _0x17dadc;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483<this[_0xf326('0xf')]['length'];_0x5c8483+=0x1){if(this['Agents'][_0x5c8483][_0xf326('0x13')]){this[_0xf326('0x11')]+=0x1;}if(this[_0xf326('0xf')][_0x5c8483][_0xf326('0x14')]){this[_0xf326('0x12')]+=0x1;}}this[_0xf326('0x15')]=this[_0xf326('0x11')]-this[_0xf326('0x12')];this['available']=this[_0xf326('0x15')]>=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue;
\ No newline at end of file
+var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x36bab3,_0x19ce33){var _0x2d3989=function(_0x2a4f60){while(--_0x2a4f60){_0x36bab3['push'](_0x36bab3['shift']());}};_0x2d3989(++_0x19ce33);}(_0xadb5,0xad));var _0x5adb=function(_0x5920ee,_0x1af0fb){_0x5920ee=_0x5920ee-0x0;var _0x40ec96=_0xadb5[_0x5920ee];return _0x40ec96;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c<this[_0x5adb('0xa')]['length'];_0x34af2c+=0x1){if(this[_0x5adb('0xa')][_0x34af2c]['online']){this[_0x5adb('0x12')]+=0x1;}if(this[_0x5adb('0xa')][_0x34af2c][_0x5adb('0x13')]){this[_0x5adb('0x11')]+=0x1;}}this[_0x5adb('0x14')]=this[_0x5adb('0x12')]-this[_0x5adb('0x11')];this[_0x5adb('0x14')]=this[_0x5adb('0x14')]>=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
index 66ac1f9..e54fd70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e35=['smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online'];(function(_0x5783cf,_0xd9b3f){var _0x40f788=function(_0x1c5206){while(--_0x1c5206){_0x5783cf['push'](_0x5783cf['shift']());}};_0x40f788(++_0xd9b3f);}(_0x0e35,0xc2));var _0x50e3=function(_0x29e7b2,_0x279aa9){_0x29e7b2=_0x29e7b2-0x0;var _0x31a4e5=_0x0e35[_0x29e7b2];return _0x31a4e5;};'use strict';var _=require(_0x50e3('0x0'));var md5=require(_0x50e3('0x1'));var util=require(_0x50e3('0x2'));var Redis=require(_0x50e3('0x3'));var config=require(_0x50e3('0x4'));config[_0x50e3('0x5')]=_[_0x50e3('0x6')](config[_0x50e3('0x5')],{'host':_0x50e3('0x7'),'port':0x18eb});var io=require(_0x50e3('0x8'))(new Redis(config['redis']));function SmsQueue(_0x86283e){this['id']=_0x86283e['id']||0x0;this[_0x50e3('0x9')]=_0x86283e['name']||'';this['timeout']=_0x86283e[_0x50e3('0xa')]||0xa;this[_0x50e3('0xb')]=_0x86283e['strategy']||'beepall';this[_0x50e3('0xc')]=_0x86283e[_0x50e3('0xc')];this[_0x50e3('0xd')]={};this[_0x50e3('0xe')]=0x0;this[_0x50e3('0x1')]='';this[_0x50e3('0xf')]();this[_0x50e3('0x10')]();}SmsQueue[_0x50e3('0x11')][_0x50e3('0xf')]=function(){var _0x35b58b=this[_0x50e3('0xd')][_0x50e3('0x12')];this[_0x50e3('0xd')]=_['map'](this[_0x50e3('0xc')],'id');this[_0x50e3('0xd')][_0x50e3('0x12')]=_0x35b58b;};SmsQueue[_0x50e3('0x11')]['updateRealtime']=function(){this[_0x50e3('0x13')]=0x0;this[_0x50e3('0x14')]=0x0;for(var _0x4b4d6f=0x0;_0x4b4d6f<this[_0x50e3('0xc')][_0x50e3('0x15')];_0x4b4d6f+=0x1){if(this[_0x50e3('0xc')][_0x4b4d6f][_0x50e3('0x16')]){this[_0x50e3('0x13')]+=0x1;}if(this['Agents'][_0x4b4d6f][_0x50e3('0x17')]){this['paused']+=0x1;}}this[_0x50e3('0x18')]=this[_0x50e3('0x13')]-this[_0x50e3('0x14')];this['available']=this[_0x50e3('0x18')]>=0x0?this[_0x50e3('0x18')]:0x0;var _0x1b4279={'id':this['id'],'available':this[_0x50e3('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x50e3('0x14')],'waiting':this['waiting']};var _0x3ffe22=md5(JSON[_0x50e3('0x19')](_0x1b4279));if(this['md5']!==_0x3ffe22){this['md5']=_0x3ffe22;io['to'](util[_0x50e3('0x1a')](_0x50e3('0x1b'),_0x1b4279['name']))[_0x50e3('0x1c')](_0x50e3('0x1d'),_0x1b4279);}};module[_0x50e3('0x1e')]=SmsQueue;
\ No newline at end of file
+var _0x073e=['map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr'];(function(_0x427e9b,_0x71ca84){var _0x36af37=function(_0x5aadd4){while(--_0x5aadd4){_0x427e9b['push'](_0x427e9b['shift']());}};_0x36af37(++_0x71ca84);}(_0x073e,0x181));var _0xe073=function(_0x2134e8,_0x2b3c8d){_0x2134e8=_0x2134e8-0x0;var _0x42451d=_0x073e[_0x2134e8];return _0x42451d;};'use strict';var _=require(_0xe073('0x0'));var md5=require(_0xe073('0x1'));var util=require(_0xe073('0x2'));var Redis=require(_0xe073('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xe073('0x4')],{'host':_0xe073('0x5'),'port':0x18eb});var io=require(_0xe073('0x6'))(new Redis(config['redis']));function SmsQueue(_0x5b9324){this['id']=_0x5b9324['id']||0x0;this['name']=_0x5b9324[_0xe073('0x7')]||'';this[_0xe073('0x8')]=_0x5b9324[_0xe073('0x8')]||0xa;this[_0xe073('0x9')]=_0x5b9324[_0xe073('0x9')]||_0xe073('0xa');this['Agents']=_0x5b9324[_0xe073('0xb')];this[_0xe073('0xc')]={};this[_0xe073('0xd')]=0x0;this[_0xe073('0x1')]='';this['updateRouting']();this[_0xe073('0xe')]();}SmsQueue[_0xe073('0xf')][_0xe073('0x10')]=function(){var _0x1f5a22=this[_0xe073('0xc')][_0xe073('0x11')];this['mapAgentsId']=_[_0xe073('0x12')](this['Agents'],'id');this[_0xe073('0xc')]['_rr']=_0x1f5a22;};SmsQueue[_0xe073('0xf')]['updateRealtime']=function(){this[_0xe073('0x13')]=0x0;this[_0xe073('0x14')]=0x0;for(var _0x47828d=0x0;_0x47828d<this[_0xe073('0xb')][_0xe073('0x15')];_0x47828d+=0x1){if(this[_0xe073('0xb')][_0x47828d][_0xe073('0x16')]){this[_0xe073('0x13')]+=0x1;}if(this[_0xe073('0xb')][_0x47828d][_0xe073('0x17')]){this[_0xe073('0x14')]+=0x1;}}this['available']=this['loggedIn']-this['paused'];this[_0xe073('0x18')]=this[_0xe073('0x18')]>=0x0?this[_0xe073('0x18')]:0x0;var _0x16eaa6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe073('0x13')],'name':this[_0xe073('0x7')],'paused':this[_0xe073('0x14')],'waiting':this['waiting']};var _0x21c02e=md5(JSON[_0xe073('0x19')](_0x16eaa6));if(this[_0xe073('0x1')]!==_0x21c02e){this[_0xe073('0x1')]=_0x21c02e;io['to'](util[_0xe073('0x1a')](_0xe073('0x1b'),_0x16eaa6[_0xe073('0x7')]))[_0xe073('0x1c')](_0xe073('0x1d'),_0x16eaa6);}};module[_0xe073('0x1e')]=SmsQueue;
\ No newline at end of file
index 4d672a5..51cee2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7ae=['loggedIn','online','paused','available','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xa7ae,0x190));var _0xea7a=function(_0x4a095b,_0x26f004){_0x4a095b=_0x4a095b-0x0;var _0xa2b7f8=_0xa7ae[_0x4a095b];return _0xa2b7f8;};'use strict';var _=require(_0xea7a('0x0'));var md5=require(_0xea7a('0x1'));var util=require('util');var Redis=require(_0xea7a('0x2'));var config=require(_0xea7a('0x3'));config['redis']=_[_0xea7a('0x4')](config['redis'],{'host':_0xea7a('0x5'),'port':0x18eb});var io=require(_0xea7a('0x6'))(new Redis(config[_0xea7a('0x7')]));function WhatsappQueue(_0x41d9e5){this['id']=_0x41d9e5['id']||0x0;this['name']=_0x41d9e5[_0xea7a('0x8')]||'';this[_0xea7a('0x9')]=_0x41d9e5['timeout']||0xa;this[_0xea7a('0xa')]=_0x41d9e5['strategy']||_0xea7a('0xb');this['Agents']=_0x41d9e5['Agents'];this[_0xea7a('0xc')]={};this[_0xea7a('0xd')]=0x0;this[_0xea7a('0x1')]='';this[_0xea7a('0xe')]();this[_0xea7a('0xf')]();}WhatsappQueue[_0xea7a('0x10')]['updateRouting']=function(){var _0x499ca6=this[_0xea7a('0xc')][_0xea7a('0x11')];this[_0xea7a('0xc')]=_[_0xea7a('0x12')](this[_0xea7a('0x13')],'id');this['mapAgentsId'][_0xea7a('0x11')]=_0x499ca6;};WhatsappQueue[_0xea7a('0x10')][_0xea7a('0xf')]=function(){this[_0xea7a('0x14')]=0x0;this['paused']=0x0;for(var _0x5ba8ab=0x0;_0x5ba8ab<this[_0xea7a('0x13')]['length'];_0x5ba8ab+=0x1){if(this[_0xea7a('0x13')][_0x5ba8ab][_0xea7a('0x15')]){this[_0xea7a('0x14')]+=0x1;}if(this[_0xea7a('0x13')][_0x5ba8ab]['whatsappPause']){this[_0xea7a('0x16')]+=0x1;}}this[_0xea7a('0x17')]=this['loggedIn']-this[_0xea7a('0x16')];this[_0xea7a('0x17')]=this[_0xea7a('0x17')]>=0x0?this['available']:0x0;var _0x3bb1a4={'id':this['id'],'available':this['available'],'loggedIn':this[_0xea7a('0x14')],'name':this[_0xea7a('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x34959b=md5(JSON['stringify'](_0x3bb1a4));if(this['md5']!==_0x34959b){this[_0xea7a('0x1')]=_0x34959b;io['to'](util[_0xea7a('0x18')](_0xea7a('0x19'),_0x3bb1a4[_0xea7a('0x8')]))['emit'](_0xea7a('0x1a'),_0x3bb1a4);}};module[_0xea7a('0x1b')]=WhatsappQueue;
\ No newline at end of file
+var _0x2cf3=['md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','length','loggedIn','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','exports'];(function(_0x5e6b1a,_0x5a65bf){var _0x5e90bb=function(_0x235626){while(--_0x235626){_0x5e6b1a['push'](_0x5e6b1a['shift']());}};_0x5e90bb(++_0x5a65bf);}(_0x2cf3,0x138));var _0x32cf=function(_0x2dcc2d,_0xbec8e7){_0x2dcc2d=_0x2dcc2d-0x0;var _0x225297=_0x2cf3[_0x2dcc2d];return _0x225297;};'use strict';var _=require('lodash');var md5=require(_0x32cf('0x0'));var util=require(_0x32cf('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x32cf('0x2')]=_['defaults'](config[_0x32cf('0x2')],{'host':_0x32cf('0x3'),'port':0x18eb});var io=require(_0x32cf('0x4'))(new Redis(config[_0x32cf('0x2')]));function WhatsappQueue(_0x3fc484){this['id']=_0x3fc484['id']||0x0;this[_0x32cf('0x5')]=_0x3fc484['name']||'';this[_0x32cf('0x6')]=_0x3fc484[_0x32cf('0x6')]||0xa;this[_0x32cf('0x7')]=_0x3fc484['strategy']||_0x32cf('0x8');this[_0x32cf('0x9')]=_0x3fc484['Agents'];this['mapAgentsId']={};this[_0x32cf('0xa')]=0x0;this[_0x32cf('0x0')]='';this[_0x32cf('0xb')]();this[_0x32cf('0xc')]();}WhatsappQueue[_0x32cf('0xd')][_0x32cf('0xb')]=function(){var _0x27a6a8=this[_0x32cf('0xe')][_0x32cf('0xf')];this[_0x32cf('0xe')]=_[_0x32cf('0x10')](this[_0x32cf('0x9')],'id');this[_0x32cf('0xe')][_0x32cf('0xf')]=_0x27a6a8;};WhatsappQueue[_0x32cf('0xd')][_0x32cf('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x5ac664=0x0;_0x5ac664<this[_0x32cf('0x9')][_0x32cf('0x11')];_0x5ac664+=0x1){if(this[_0x32cf('0x9')][_0x5ac664]['online']){this[_0x32cf('0x12')]+=0x1;}if(this[_0x32cf('0x9')][_0x5ac664][_0x32cf('0x13')]){this[_0x32cf('0x14')]+=0x1;}}this[_0x32cf('0x15')]=this[_0x32cf('0x12')]-this['paused'];this[_0x32cf('0x15')]=this['available']>=0x0?this[_0x32cf('0x15')]:0x0;var _0x213739={'id':this['id'],'available':this[_0x32cf('0x15')],'loggedIn':this[_0x32cf('0x12')],'name':this['name'],'paused':this[_0x32cf('0x14')],'waiting':this['waiting']};var _0x4798f7=md5(JSON[_0x32cf('0x16')](_0x213739));if(this[_0x32cf('0x0')]!==_0x4798f7){this[_0x32cf('0x0')]=_0x4798f7;io['to'](util[_0x32cf('0x17')](_0x32cf('0x18'),_0x213739[_0x32cf('0x5')]))['emit']('whatsapp_queue:save',_0x213739);}};module[_0x32cf('0x19')]=WhatsappQueue;
\ No newline at end of file
index a338e80..30973e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
index 43a29d7..2506ee6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44b9=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x4e55aa,_0x48bfd2){var _0x2f48d6=function(_0x29b734){while(--_0x29b734){_0x4e55aa['push'](_0x4e55aa['shift']());}};_0x2f48d6(++_0x48bfd2);}(_0x44b9,0x109));var _0x944b=function(_0x5099e0,_0x51bdf7){_0x5099e0=_0x5099e0-0x0;var _0x444005=_0x44b9[_0x5099e0];return _0x444005;};'use strict';var client=require(_0x944b('0x0'));exports[_0x944b('0x1')]=function(_0x5abcc1,_0x440823){return client[_0x944b('0x2')](_0x944b('0x3'),{'body':_0x440823,'options':{'where':{'id':_0x5abcc1}},'log':_0x944b('0x4')});};exports[_0x944b('0x5')]=function(_0x61b131,_0x34a524){return client[_0x944b('0x2')](_0x944b('0x6'),{'body':_0x34a524,'options':{'where':{'id':_0x61b131}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x4b45=['addTagsToChatInteraction','../client','update','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x34226f,_0x1cd113){var _0x1bf7dc=function(_0x145ecd){while(--_0x145ecd){_0x34226f['push'](_0x34226f['shift']());}};_0x1bf7dc(++_0x1cd113);}(_0x4b45,0x190));var _0x54b4=function(_0x593e5f,_0x5a769e){_0x593e5f=_0x593e5f-0x0;var _0x2674e1=_0x4b45[_0x593e5f];return _0x2674e1;};'use strict';var client=require(_0x54b4('0x0'));exports[_0x54b4('0x1')]=function(_0x38b9c6,_0x49ca10){return client['Request']('UpdateChatInteraction',{'body':_0x49ca10,'options':{'where':{'id':_0x38b9c6}},'log':_0x54b4('0x2')});};exports[_0x54b4('0x3')]=function(_0x2720c5,_0x340ab2){return client[_0x54b4('0x4')](_0x54b4('0x5'),{'body':_0x340ab2,'options':{'where':{'id':_0x2720c5}},'log':_0x54b4('0x6')});};
\ No newline at end of file
index a67816a..f078cab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb815=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xb815,0x15d));var _0x5b81=function(_0x17abcb,_0x12fc34){_0x17abcb=_0x17abcb-0x0;var _0x1bfa1a=_0xb815[_0x17abcb];return _0x1bfa1a;};'use strict';var client=require(_0x5b81('0x0'));exports[_0x5b81('0x1')]=function(_0x15a6f1){return client[_0x5b81('0x2')](_0x5b81('0x3'),{'body':_0x15a6f1,'log':_0x5b81('0x4')});};
\ No newline at end of file
+var _0x2863=['createChatMessage','../client'];(function(_0xe25de7,_0x42e03f){var _0x19e45b=function(_0x43769b){while(--_0x43769b){_0xe25de7['push'](_0xe25de7['shift']());}};_0x19e45b(++_0x42e03f);}(_0x2863,0x1df));var _0x3286=function(_0x4bf4cf,_0x3ff119){_0x4bf4cf=_0x4bf4cf-0x0;var _0x278726=_0x2863[_0x4bf4cf];return _0x278726;};'use strict';var client=require(_0x3286('0x0'));exports['create']=function(_0x529a25){return client['Request']('CreateChatMessage',{'body':_0x529a25,'log':_0x3286('0x1')});};
\ No newline at end of file
index 2e7e2c7..7e0d16d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x872a=['Agents','name','online','chatPause','../client','getChatQueues','Request','GetChatQueue','User'];(function(_0xedbc3a,_0xd4b90d){var _0x5a09b4=function(_0xd84c09){while(--_0xd84c09){_0xedbc3a['push'](_0xedbc3a['shift']());}};_0x5a09b4(++_0xd4b90d);}(_0x872a,0x100));var _0xa872=function(_0x5e65fd,_0x46506d){_0x5e65fd=_0x5e65fd-0x0;var _0x52e83f=_0x872a[_0x5e65fd];return _0x52e83f;};'use strict';var client=require(_0xa872('0x0'));exports[_0xa872('0x1')]=function(){return function(){return client[_0xa872('0x2')](_0xa872('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xa872('0x4'),'as':_0xa872('0x5'),'attributes':['id',_0xa872('0x6'),_0xa872('0x7'),_0xa872('0x8')]}]},'log':_0xa872('0x1')});};};
\ No newline at end of file
+var _0x078c=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','timeout','strategy'];(function(_0x2875ee,_0x241b96){var _0x91c01e=function(_0x8b46ad){while(--_0x8b46ad){_0x2875ee['push'](_0x2875ee['shift']());}};_0x91c01e(++_0x241b96);}(_0x078c,0x19f));var _0xc078=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x078c[_0x2a6d45];return _0x295253;};'use strict';var client=require(_0xc078('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xc078('0x1')](_0xc078('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc078('0x3'),_0xc078('0x4')],'include':[{'model':_0xc078('0x5'),'as':_0xc078('0x6'),'attributes':['id','name',_0xc078('0x7'),_0xc078('0x8')]}]},'log':_0xc078('0x9')});};};
\ No newline at end of file
index 40efbe8..0cd6f1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x919e=['Request','UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport'];(function(_0x5d8694,_0x12b8c2){var _0x442111=function(_0x52f1eb){while(--_0x52f1eb){_0x5d8694['push'](_0x5d8694['shift']());}};_0x442111(++_0x12b8c2);}(_0x919e,0x1d7));var _0xe919=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x919e[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xe919('0x0'));exports[_0xe919('0x1')]=function(_0x24d2f4){return client['Request'](_0xe919('0x2'),{'body':_0x24d2f4,'log':'CreateChatQueueReport'});};exports['update']=function(_0x455cff,_0x3a1192){return client[_0xe919('0x3')](_0xe919('0x4'),{'body':_0x3a1192,'options':{'where':{'uniqueid':_0x455cff},'order':[['id',_0xe919('0x5')]],'limit':0x1},'log':_0xe919('0x4')});};
\ No newline at end of file
+var _0xe13e=['UpdateChatQueueReport','DESC','Request','CreateChatQueueReport','update'];(function(_0x3de30d,_0x48bc95){var _0xd020d3=function(_0x1c3dff){while(--_0x1c3dff){_0x3de30d['push'](_0x3de30d['shift']());}};_0xd020d3(++_0x48bc95);}(_0xe13e,0xde));var _0xee13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe13e[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports['create']=function(_0x4df8d5){return client[_0xee13('0x0')](_0xee13('0x1'),{'body':_0x4df8d5,'log':_0xee13('0x1')});};exports[_0xee13('0x2')]=function(_0x2513f3,_0x7a275f){return client[_0xee13('0x0')](_0xee13('0x3'),{'body':_0x7a275f,'options':{'where':{'uniqueid':_0x2513f3},'order':[['id',_0xee13('0x4')]],'limit':0x1},'log':_0xee13('0x3')});};
\ No newline at end of file
index 1d72941..aef1549 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x5047e4,_0x521ffc){var _0x235cc0=function(_0x531acd){while(--_0x531acd){_0x5047e4['push'](_0x5047e4['shift']());}};_0x235cc0(++_0x521ffc);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x7a54,0x106));var _0x47a5=function(_0x4498fc,_0xc16c0){_0x4498fc=_0x4498fc-0x0;var _0x1a5d10=_0x7a54[_0x4498fc];return _0x1a5d10;};'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 db91e8b..f072c72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fe8=['Request','CreateFaxMessage','../client'];(function(_0x570496,_0x26a150){var _0x1d4204=function(_0x4176cd){while(--_0x4176cd){_0x570496['push'](_0x570496['shift']());}};_0x1d4204(++_0x26a150);}(_0x3fe8,0x1a3));var _0x83fe=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x3fe8[_0x319cb9];return _0x1735fc;};'use strict';var client=require(_0x83fe('0x0'));exports['create']=function(_0x1b4351){return client[_0x83fe('0x1')](_0x83fe('0x2'),{'body':_0x1b4351,'log':'createFaxMessage'});};
\ No newline at end of file
+var _0x03c0=['Request','createFaxMessage','../client','create'];(function(_0x53a911,_0x14b553){var _0x1e7bd7=function(_0x183dde){while(--_0x183dde){_0x53a911['push'](_0x53a911['shift']());}};_0x1e7bd7(++_0x14b553);}(_0x03c0,0xb6));var _0x003c=function(_0x171b64,_0x1dc8e2){_0x171b64=_0x171b64-0x0;var _0x359757=_0x03c0[_0x171b64];return _0x359757;};'use strict';var client=require(_0x003c('0x0'));exports[_0x003c('0x1')]=function(_0x26e216){return client[_0x003c('0x2')]('CreateFaxMessage',{'body':_0x26e216,'log':_0x003c('0x3')});};
\ No newline at end of file
index 0fa692b..3a83abf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1685=['timeout','strategy','User','Agents','getFaxQueues','../client','Request','name'];(function(_0xc929a2,_0x4475fc){var _0x145a2b=function(_0x728f65){while(--_0x728f65){_0xc929a2['push'](_0xc929a2['shift']());}};_0x145a2b(++_0x4475fc);}(_0x1685,0x13d));var _0x5168=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x1685[_0x12f688];return _0x59c3de;};'use strict';var client=require(_0x5168('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x5168('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x5168('0x2'),_0x5168('0x3'),_0x5168('0x4')],'include':[{'model':_0x5168('0x5'),'as':_0x5168('0x6'),'attributes':['id',_0x5168('0x2'),'online','faxPause']}]},'log':_0x5168('0x7')});};};
\ No newline at end of file
+var _0xe6b3=['online','faxPause','../client','GetFaxQueue','timeout','strategy','Agents','name'];(function(_0x2e890b,_0x153090){var _0x17f0b9=function(_0x35c6e5){while(--_0x35c6e5){_0x2e890b['push'](_0x2e890b['shift']());}};_0x17f0b9(++_0x153090);}(_0xe6b3,0x14a));var _0x3e6b=function(_0x3dbb47,_0x464018){_0x3dbb47=_0x3dbb47-0x0;var _0x9d7882=_0xe6b3[_0x3dbb47];return _0x9d7882;};'use strict';var client=require(_0x3e6b('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x3e6b('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x3e6b('0x2'),_0x3e6b('0x3')],'include':[{'model':'User','as':_0x3e6b('0x4'),'attributes':['id',_0x3e6b('0x5'),_0x3e6b('0x6'),_0x3e6b('0x7')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
index 7dfcdca..892e278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedb1=['../client','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xedb1,0x18b));var _0x1edb=function(_0x3cacf8,_0x2715a4){_0x3cacf8=_0x3cacf8-0x0;var _0x5d4200=_0xedb1[_0x3cacf8];return _0x5d4200;};'use strict';var client=require(_0x1edb('0x0'));exports['create']=function(_0x4e5316){return client['Request']('CreateFaxQueueReport',{'body':_0x4e5316,'log':_0x1edb('0x1')});};exports[_0x1edb('0x2')]=function(_0x2c22a9,_0x3a05de){return client['Request'](_0x1edb('0x3'),{'body':_0x3a05de,'options':{'where':{'uniqueid':_0x2c22a9},'order':[['id',_0x1edb('0x4')]],'limit':0x1},'log':_0x1edb('0x3')});};
\ No newline at end of file
+var _0x8750=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x419859,_0x5771e8){var _0x18c6c2=function(_0x53dcf7){while(--_0x53dcf7){_0x419859['push'](_0x419859['shift']());}};_0x18c6c2(++_0x5771e8);}(_0x8750,0x110));var _0x0875=function(_0x3a2d9c,_0x255b45){_0x3a2d9c=_0x3a2d9c-0x0;var _0x2d81af=_0x8750[_0x3a2d9c];return _0x2d81af;};'use strict';var client=require(_0x0875('0x0'));exports[_0x0875('0x1')]=function(_0x55d41d){return client[_0x0875('0x2')](_0x0875('0x3'),{'body':_0x55d41d,'log':_0x0875('0x3')});};exports[_0x0875('0x4')]=function(_0x3e2e7b,_0x1febfe){return client[_0x0875('0x2')](_0x0875('0x5'),{'body':_0x1febfe,'options':{'where':{'uniqueid':_0x3e2e7b},'order':[['id',_0x0875('0x6')]],'limit':0x1},'log':_0x0875('0x5')});};
\ No newline at end of file
index 7c633d4..e920383 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a71=['GetInterval','name','interval','getIntervals','../client'];(function(_0x78477b,_0xf3eaa9){var _0x27e108=function(_0x2d8e13){while(--_0x2d8e13){_0x78477b['push'](_0x78477b['shift']());}};_0x27e108(++_0xf3eaa9);}(_0x6a71,0x130));var _0x16a7=function(_0x5ed69e,_0x2dcf4f){_0x5ed69e=_0x5ed69e-0x0;var _0x2ccce9=_0x6a71[_0x5ed69e];return _0x2ccce9;};'use strict';var client=require(_0x16a7('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x16a7('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x16a7('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x16a7('0x2'),_0x16a7('0x3')]}]},'log':_0x16a7('0x4')});};};
\ No newline at end of file
+var _0x94f7=['name','Interval','Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0xa464fd,_0x100df5){var _0x2003df=function(_0x3dba9f){while(--_0x3dba9f){_0xa464fd['push'](_0xa464fd['shift']());}};_0x2003df(++_0x100df5);}(_0x94f7,0x19c));var _0x794f=function(_0x1b0509,_0x42d979){_0x1b0509=_0x1b0509-0x0;var _0x1c1eda=_0x94f7[_0x1b0509];return _0x1c1eda;};'use strict';var client=require(_0x794f('0x0'));exports[_0x794f('0x1')]=function(){return function(){return client[_0x794f('0x2')](_0x794f('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x794f('0x4')],'include':[{'model':_0x794f('0x5'),'as':_0x794f('0x6'),'attributes':['id',_0x794f('0x4'),_0x794f('0x7')]}]},'log':_0x794f('0x1')});};};
\ No newline at end of file
index 99ec75b..aa5f237 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ee=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','Request','UpdateMailInteraction'];(function(_0x26fa5d,_0x444817){var _0x349db1=function(_0x37a8fd){while(--_0x37a8fd){_0x26fa5d['push'](_0x26fa5d['shift']());}};_0x349db1(++_0x444817);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var client=require('../client');exports['update']=function(_0x34e33c,_0x521ff3){return client[_0xe36e('0x0')](_0xe36e('0x1'),{'body':_0x521ff3,'options':{'where':{'id':_0x34e33c}},'log':_0xe36e('0x2')});};exports[_0xe36e('0x3')]=function(_0x567a84,_0x1118af){return client[_0xe36e('0x0')](_0xe36e('0x4'),{'body':_0x1118af,'options':{'where':{'id':_0x567a84}},'log':_0xe36e('0x5')});};
\ No newline at end of file
+var _0x0120=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x5429d6,_0x47122d){var _0x266b0c=function(_0x399f3a){while(--_0x399f3a){_0x5429d6['push'](_0x5429d6['shift']());}};_0x266b0c(++_0x47122d);}(_0x0120,0x6f));var _0x0012=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0120[_0x46aff0];return _0x9d78cf;};'use strict';var client=require(_0x0012('0x0'));exports[_0x0012('0x1')]=function(_0x3d23e7,_0xb8d57c){return client[_0x0012('0x2')](_0x0012('0x3'),{'body':_0xb8d57c,'options':{'where':{'id':_0x3d23e7}},'log':_0x0012('0x4')});};exports[_0x0012('0x5')]=function(_0x357f77,_0x302029){return client[_0x0012('0x2')](_0x0012('0x6'),{'body':_0x302029,'options':{'where':{'id':_0x357f77}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 67c89e6..f2e6675 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3b3=['create','CreateMailMessage','createMailMessage'];(function(_0x1e374b,_0x43ba65){var _0x3df66d=function(_0x36da84){while(--_0x36da84){_0x1e374b['push'](_0x1e374b['shift']());}};_0x3df66d(++_0x43ba65);}(_0xd3b3,0x1d1));var _0x3d3b=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0xd3b3[_0xfbdff6];return _0x4cb9be;};'use strict';var client=require('../client');exports[_0x3d3b('0x0')]=function(_0x137be4){return client['Request'](_0x3d3b('0x1'),{'body':_0x137be4,'log':_0x3d3b('0x2')});};
\ No newline at end of file
+var _0xe0af=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x1d9293,_0x553af4){var _0x43dbf9=function(_0x5ebdb7){while(--_0x5ebdb7){_0x1d9293['push'](_0x1d9293['shift']());}};_0x43dbf9(++_0x553af4);}(_0xe0af,0x1ce));var _0xfe0a=function(_0x1865d4,_0x569a81){_0x1865d4=_0x1865d4-0x0;var _0x1f0e1c=_0xe0af[_0x1865d4];return _0x1f0e1c;};'use strict';var client=require(_0xfe0a('0x0'));exports[_0xfe0a('0x1')]=function(_0x3dd2ba){return client[_0xfe0a('0x2')](_0xfe0a('0x3'),{'body':_0x3dd2ba,'log':_0xfe0a('0x4')});};
\ No newline at end of file
index 125c9da..c89844a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f91=['../client','getMailQueues','GetMailQueue','name','timeout','strategy','Agents','online','mailPause'];(function(_0x1b3ace,_0x78a222){var _0x50df87=function(_0x5112b4){while(--_0x5112b4){_0x1b3ace['push'](_0x1b3ace['shift']());}};_0x50df87(++_0x78a222);}(_0x9f91,0x1c2));var _0x19f9=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x9f91[_0x31b5a5];return _0x364cc9;};'use strict';var client=require(_0x19f9('0x0'));exports[_0x19f9('0x1')]=function(){return function(){return client['Request'](_0x19f9('0x2'),{'options':{'raw':![],'attributes':['id',_0x19f9('0x3'),_0x19f9('0x4'),_0x19f9('0x5')],'include':[{'model':'User','as':_0x19f9('0x6'),'attributes':['id','name',_0x19f9('0x7'),_0x19f9('0x8')]}]},'log':_0x19f9('0x1')});};};
\ No newline at end of file
+var _0x7eb7=['User','online','mailPause','../client','getMailQueues','GetMailQueue','name','strategy'];(function(_0x1d638a,_0x2c4d2b){var _0x59a099=function(_0x33aa18){while(--_0x33aa18){_0x1d638a['push'](_0x1d638a['shift']());}};_0x59a099(++_0x2c4d2b);}(_0x7eb7,0x1cb));var _0x77eb=function(_0x435eef,_0x6a0078){_0x435eef=_0x435eef-0x0;var _0x527f4b=_0x7eb7[_0x435eef];return _0x527f4b;};'use strict';var client=require(_0x77eb('0x0'));exports[_0x77eb('0x1')]=function(){return function(){return client['Request'](_0x77eb('0x2'),{'options':{'raw':![],'attributes':['id',_0x77eb('0x3'),'timeout',_0x77eb('0x4')],'include':[{'model':_0x77eb('0x5'),'as':'Agents','attributes':['id',_0x77eb('0x3'),_0x77eb('0x6'),_0x77eb('0x7')]}]},'log':_0x77eb('0x1')});};};
\ No newline at end of file
index 7ad4487..dc119d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51fd=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','Request'];(function(_0x2ff5c6,_0x248fe2){var _0x5605f2=function(_0xc4a69){while(--_0xc4a69){_0x2ff5c6['push'](_0x2ff5c6['shift']());}};_0x5605f2(++_0x248fe2);}(_0x51fd,0xdc));var _0xd51f=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x51fd[_0x51020b];return _0x371e47;};'use strict';var client=require(_0xd51f('0x0'));exports['create']=function(_0x24ec1a){return client[_0xd51f('0x1')]('CreateMailQueueReport',{'body':_0x24ec1a,'log':_0xd51f('0x2')});};exports[_0xd51f('0x3')]=function(_0x429c38,_0x26006c){return client[_0xd51f('0x1')](_0xd51f('0x4'),{'body':_0x26006c,'options':{'where':{'uniqueid':_0x429c38},'order':[['id',_0xd51f('0x5')]],'limit':0x1},'log':_0xd51f('0x4')});};
\ No newline at end of file
+var _0xaf70=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0xc82d1a,_0x145c50){var _0x32fad2=function(_0x232731){while(--_0x232731){_0xc82d1a['push'](_0xc82d1a['shift']());}};_0x32fad2(++_0x145c50);}(_0xaf70,0x16d));var _0x0af7=function(_0x534138,_0x2c7c0a){_0x534138=_0x534138-0x0;var _0x29b2c1=_0xaf70[_0x534138];return _0x29b2c1;};'use strict';var client=require(_0x0af7('0x0'));exports[_0x0af7('0x1')]=function(_0x2e7679){return client[_0x0af7('0x2')](_0x0af7('0x3'),{'body':_0x2e7679,'log':_0x0af7('0x3')});};exports[_0x0af7('0x4')]=function(_0xe9f65c,_0x3ab8c7){return client[_0x0af7('0x2')](_0x0af7('0x5'),{'body':_0x3ab8c7,'options':{'where':{'uniqueid':_0xe9f65c},'order':[['id',_0x0af7('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
index be989b6..ac33a2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2258=['Request','update'];(function(_0xbc0b4d,_0x48d139){var _0x5920d7=function(_0x280edb){while(--_0x280edb){_0xbc0b4d['push'](_0xbc0b4d['shift']());}};_0x5920d7(++_0x48d139);}(_0x2258,0x133));var _0x8225=function(_0x583aa7,_0x23765c){_0x583aa7=_0x583aa7-0x0;var _0x6c16a5=_0x2258[_0x583aa7];return _0x6c16a5;};'use strict';var client=require('../client');exports[_0x8225('0x0')]=function(_0x244be9,_0x34f68b){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x34f68b,'options':{'where':{'id':_0x244be9}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x589752,_0x3bc2a0){return client[_0x8225('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x3bc2a0,'options':{'where':{'id':_0x589752}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0xafb7=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','update'];(function(_0x527733,_0x16051c){var _0x5400ba=function(_0x265d39){while(--_0x265d39){_0x527733['push'](_0x527733['shift']());}};_0x5400ba(++_0x16051c);}(_0xafb7,0xad));var _0x7afb=function(_0x3b0bd6,_0x519077){_0x3b0bd6=_0x3b0bd6-0x0;var _0x3cba32=_0xafb7[_0x3b0bd6];return _0x3cba32;};'use strict';var client=require('../client');exports[_0x7afb('0x0')]=function(_0x365d51,_0x36f001){return client[_0x7afb('0x1')](_0x7afb('0x2'),{'body':_0x36f001,'options':{'where':{'id':_0x365d51}},'log':_0x7afb('0x3')});};exports[_0x7afb('0x4')]=function(_0x4ea5ca,_0xb9ab18){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0xb9ab18,'options':{'where':{'id':_0x4ea5ca}},'log':_0x7afb('0x5')});};
\ No newline at end of file
index e8106a0..88ba346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fb6=['Request','CreateOpenchannelMessage','../client','create'];(function(_0x399d54,_0x2291cd){var _0x6e17a7=function(_0x42af9f){while(--_0x42af9f){_0x399d54['push'](_0x399d54['shift']());}};_0x6e17a7(++_0x2291cd);}(_0x2fb6,0x19e));var _0x62fb=function(_0x505050,_0x2fe2d0){_0x505050=_0x505050-0x0;var _0x1b905f=_0x2fb6[_0x505050];return _0x1b905f;};'use strict';var client=require(_0x62fb('0x0'));exports[_0x62fb('0x1')]=function(_0x1f05cb){return client[_0x62fb('0x2')](_0x62fb('0x3'),{'body':_0x1f05cb,'log':'createOpenchannelMessage'});};
\ No newline at end of file
+var _0x1fc6=['CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x47244e,_0x2e3f80){var _0x588f97=function(_0x51a993){while(--_0x51a993){_0x47244e['push'](_0x47244e['shift']());}};_0x588f97(++_0x2e3f80);}(_0x1fc6,0x101));var _0x61fc=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x1fc6[_0x39fd11];return _0x302799;};'use strict';var client=require('../client');exports[_0x61fc('0x0')]=function(_0x5b9d99){return client['Request'](_0x61fc('0x1'),{'body':_0x5b9d99,'log':_0x61fc('0x2')});};
\ No newline at end of file
index 2707483..1566f99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63eb=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0x63eb,0x90));var _0xb63e=function(_0x535aa7,_0xbf1f5){_0x535aa7=_0x535aa7-0x0;var _0x5bc143=_0x63eb[_0x535aa7];return _0x5bc143;};'use strict';var client=require(_0xb63e('0x0'));exports[_0xb63e('0x1')]=function(){return function(){return client[_0xb63e('0x2')](_0xb63e('0x3'),{'options':{'raw':![],'attributes':['id',_0xb63e('0x4'),_0xb63e('0x5'),_0xb63e('0x6')],'include':[{'model':_0xb63e('0x7'),'as':_0xb63e('0x8'),'attributes':['id',_0xb63e('0x4'),_0xb63e('0x9'),_0xb63e('0xa')]}]},'log':_0xb63e('0x1')});};};
\ No newline at end of file
+var _0x1a1f=['getOpenchannelQueues','GetOpenchannelQueue','name','timeout','User','Agents','online','openchannelPause'];(function(_0x1dc462,_0xddde2){var _0x57feb2=function(_0x1440c8){while(--_0x1440c8){_0x1dc462['push'](_0x1dc462['shift']());}};_0x57feb2(++_0xddde2);}(_0x1a1f,0x180));var _0xf1a1=function(_0x947156,_0x38c8bb){_0x947156=_0x947156-0x0;var _0x594b25=_0x1a1f[_0x947156];return _0x594b25;};'use strict';var client=require('../client');exports[_0xf1a1('0x0')]=function(){return function(){return client['Request'](_0xf1a1('0x1'),{'options':{'raw':![],'attributes':['id',_0xf1a1('0x2'),_0xf1a1('0x3'),'strategy'],'include':[{'model':_0xf1a1('0x4'),'as':_0xf1a1('0x5'),'attributes':['id',_0xf1a1('0x2'),_0xf1a1('0x6'),_0xf1a1('0x7')]}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
index 2416de8..9ffe8a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1619=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x4b15ea,_0x3a3ef4){var _0x457d26=function(_0x272247){while(--_0x272247){_0x4b15ea['push'](_0x4b15ea['shift']());}};_0x457d26(++_0x3a3ef4);}(_0x1619,0x189));var _0x9161=function(_0x43929f,_0xff28f2){_0x43929f=_0x43929f-0x0;var _0x5b7db9=_0x1619[_0x43929f];return _0x5b7db9;};'use strict';var client=require('../client');exports['create']=function(_0x84b42c){return client['Request'](_0x9161('0x0'),{'body':_0x84b42c,'log':_0x9161('0x0')});};exports[_0x9161('0x1')]=function(_0x5a98de,_0x1a123e){return client['Request'](_0x9161('0x2'),{'body':_0x1a123e,'options':{'where':{'uniqueid':_0x5a98de},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
+var _0x8856=['UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport','update','Request'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0x8856,0xe2));var _0x6885=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8856[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x6885('0x0'));exports[_0x6885('0x1')]=function(_0x4ebc1a){return client['Request'](_0x6885('0x2'),{'body':_0x4ebc1a,'log':_0x6885('0x2')});};exports[_0x6885('0x3')]=function(_0x492311,_0x58d1de){return client[_0x6885('0x4')](_0x6885('0x5'),{'body':_0x58d1de,'options':{'where':{'uniqueid':_0x492311},'order':[['id',_0x6885('0x6')]],'limit':0x1},'log':_0x6885('0x5')});};
\ No newline at end of file
index 6a10274..2fbfd4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c22=['../client','update','Request','updateSmsInteraction','addTags','addTagsToSmsInteraction'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x7c22,0x6c));var _0x27c2=function(_0x64d19f,_0x2fd9bd){_0x64d19f=_0x64d19f-0x0;var _0xffc432=_0x7c22[_0x64d19f];return _0xffc432;};'use strict';var client=require(_0x27c2('0x0'));exports[_0x27c2('0x1')]=function(_0x4b2191,_0x45a700){return client[_0x27c2('0x2')]('UpdateSmsInteraction',{'body':_0x45a700,'options':{'where':{'id':_0x4b2191}},'log':_0x27c2('0x3')});};exports[_0x27c2('0x4')]=function(_0x59004d,_0x4ce950){return client[_0x27c2('0x2')]('AddTagsToSmsInteraction',{'body':_0x4ce950,'options':{'where':{'id':_0x59004d}},'log':_0x27c2('0x5')});};
\ No newline at end of file
+var _0x7b83=['addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction'];(function(_0x3033a,_0x481c8e){var _0x10c4a7=function(_0x485c0b){while(--_0x485c0b){_0x3033a['push'](_0x3033a['shift']());}};_0x10c4a7(++_0x481c8e);}(_0x7b83,0xa1));var _0x37b8=function(_0x20db31,_0x1937a4){_0x20db31=_0x20db31-0x0;var _0x1faf7e=_0x7b83[_0x20db31];return _0x1faf7e;};'use strict';var client=require(_0x37b8('0x0'));exports[_0x37b8('0x1')]=function(_0xf4ecfb,_0x56c392){return client['Request'](_0x37b8('0x2'),{'body':_0x56c392,'options':{'where':{'id':_0xf4ecfb}},'log':_0x37b8('0x3')});};exports[_0x37b8('0x4')]=function(_0x48aaa1,_0x420271){return client[_0x37b8('0x5')](_0x37b8('0x6'),{'body':_0x420271,'options':{'where':{'id':_0x48aaa1}},'log':_0x37b8('0x7')});};
\ No newline at end of file
index 6c1dedb..9989916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0c3=['create','CreateSmsMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf0c3,0x9c));var _0x3f0c=function(_0x3746c2,_0x192612){_0x3746c2=_0x3746c2-0x0;var _0x3f7d10=_0xf0c3[_0x3746c2];return _0x3f7d10;};'use strict';var client=require('../client');exports[_0x3f0c('0x0')]=function(_0x134593){return client['Request'](_0x3f0c('0x1'),{'body':_0x134593,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0xa92e=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x4e431b,_0x1db856){var _0x2e1e59=function(_0x56767a){while(--_0x56767a){_0x4e431b['push'](_0x4e431b['shift']());}};_0x2e1e59(++_0x1db856);}(_0xa92e,0x12b));var _0xea92=function(_0x314db6,_0x5bad04){_0x314db6=_0x314db6-0x0;var _0x144b8e=_0xa92e[_0x314db6];return _0x144b8e;};'use strict';var client=require(_0xea92('0x0'));exports[_0xea92('0x1')]=function(_0xb30efb){return client[_0xea92('0x2')](_0xea92('0x3'),{'body':_0xb30efb,'log':_0xea92('0x4')});};
\ No newline at end of file
index 183e92d..d8f3437 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(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x6a1bc7,_0x10c2bb){var _0x584e6a=function(_0x18d808){while(--_0x18d808){_0x6a1bc7['push'](_0x6a1bc7['shift']());}};_0x584e6a(++_0x10c2bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
index 7e92d23..4f541cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x1a69c9,_0x41aa39){var _0xb16c28=function(_0x54b538){while(--_0x54b538){_0x1a69c9['push'](_0x1a69c9['shift']());}};_0xb16c28(++_0x41aa39);}(_0x55ca,0x126));var _0xa55c=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x55ca[_0x170772];return _0x3ef69c;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});};
\ No newline at end of file
+var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0xedd9,0xfc));var _0x9edd=function(_0x26d0e8,_0x42951c){_0x26d0e8=_0x26d0e8-0x0;var _0x3ebfa0=_0xedd9[_0x26d0e8];return _0x3ebfa0;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});};
\ No newline at end of file
index 07a711c..8d715d1 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(_0x134ed7,_0x483c2c){var _0x5eb9ee=function(_0x564a45){while(--_0x564a45){_0x134ed7['push'](_0x134ed7['shift']());}};_0x5eb9ee(++_0x483c2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x328021,_0x498364){var _0x5c0f74=function(_0x52d3ea){while(--_0x52d3ea){_0x328021['push'](_0x328021['shift']());}};_0x5c0f74(++_0x498364);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 f9b61e1..b10e44c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f9d=['updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction'];(function(_0x38b514,_0x846b73){var _0x1c63a5=function(_0x26085c){while(--_0x26085c){_0x38b514['push'](_0x38b514['shift']());}};_0x1c63a5(++_0x846b73);}(_0x8f9d,0x93));var _0xd8f9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f9d[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xd8f9('0x0'));exports['update']=function(_0xb507ea,_0x54a94a){return client[_0xd8f9('0x1')](_0xd8f9('0x2'),{'body':_0x54a94a,'options':{'where':{'id':_0xb507ea}},'log':_0xd8f9('0x3')});};exports[_0xd8f9('0x4')]=function(_0x1f9331,_0x1b82b8){return client[_0xd8f9('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x1b82b8,'options':{'where':{'id':_0x1f9331}},'log':_0xd8f9('0x5')});};
\ No newline at end of file
+var _0xa23f=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x120e86,_0x1876ae){var _0x361cb2=function(_0x217269){while(--_0x217269){_0x120e86['push'](_0x120e86['shift']());}};_0x361cb2(++_0x1876ae);}(_0xa23f,0x7c));var _0xfa23=function(_0x36a288,_0x3a385d){_0x36a288=_0x36a288-0x0;var _0x2bb4bb=_0xa23f[_0x36a288];return _0x2bb4bb;};'use strict';var client=require(_0xfa23('0x0'));exports[_0xfa23('0x1')]=function(_0x56a4e3,_0x48fd46){return client[_0xfa23('0x2')](_0xfa23('0x3'),{'body':_0x48fd46,'options':{'where':{'id':_0x56a4e3}},'log':_0xfa23('0x4')});};exports[_0xfa23('0x5')]=function(_0x5643b1,_0x86778e){return client['Request'](_0xfa23('0x6'),{'body':_0x86778e,'options':{'where':{'id':_0x5643b1}},'log':_0xfa23('0x7')});};
\ No newline at end of file
index d63dcc1..3d75695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21e7=['../client','CreateWhatsappMessage'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0x21e7,0x7e));var _0x721e=function(_0x445749,_0x1ad010){_0x445749=_0x445749-0x0;var _0x112476=_0x21e7[_0x445749];return _0x112476;};'use strict';var client=require(_0x721e('0x0'));exports['create']=function(_0x5a752f){return client['Request'](_0x721e('0x1'),{'body':_0x5a752f,'log':'createWhatsappMessage'});};
\ No newline at end of file
+var _0x6080=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x290a32,_0xcf7aa5){var _0x284249=function(_0x665fd1){while(--_0x665fd1){_0x290a32['push'](_0x290a32['shift']());}};_0x284249(++_0xcf7aa5);}(_0x6080,0xbb));var _0x0608=function(_0x268fa6,_0x5c9a1a){_0x268fa6=_0x268fa6-0x0;var _0x33bb6e=_0x6080[_0x268fa6];return _0x33bb6e;};'use strict';var client=require(_0x0608('0x0'));exports[_0x0608('0x1')]=function(_0x588477){return client[_0x0608('0x2')](_0x0608('0x3'),{'body':_0x588477,'log':_0x0608('0x4')});};
\ No newline at end of file
index cbab47c..2926d85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x870b=['whatsappPause','getWhatsappQueues','Request','name','timeout','strategy','User','Agents','online'];(function(_0x54afcf,_0x32330b){var _0x5e286d=function(_0x5b4772){while(--_0x5b4772){_0x54afcf['push'](_0x54afcf['shift']());}};_0x5e286d(++_0x32330b);}(_0x870b,0x12a));var _0xb870=function(_0x5b1c46,_0x444a42){_0x5b1c46=_0x5b1c46-0x0;var _0x47deb8=_0x870b[_0x5b1c46];return _0x47deb8;};'use strict';var client=require('../client');exports[_0xb870('0x0')]=function(){return function(){return client[_0xb870('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xb870('0x2'),_0xb870('0x3'),_0xb870('0x4')],'include':[{'model':_0xb870('0x5'),'as':_0xb870('0x6'),'attributes':['id',_0xb870('0x2'),_0xb870('0x7'),_0xb870('0x8')]}]},'log':_0xb870('0x0')});};};
\ No newline at end of file
+var _0xa0d6=['name','timeout','strategy','User','Agents','online','whatsappPause'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa0d6,0x9a));var _0x6a0d=function(_0xe5feb8,_0x2a95a6){_0xe5feb8=_0xe5feb8-0x0;var _0x31c304=_0xa0d6[_0xe5feb8];return _0x31c304;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x6a0d('0x0'),_0x6a0d('0x1'),_0x6a0d('0x2')],'include':[{'model':_0x6a0d('0x3'),'as':_0x6a0d('0x4'),'attributes':['id',_0x6a0d('0x0'),_0x6a0d('0x5'),_0x6a0d('0x6')]}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
index ec0bfc7..7294497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5861=['Request','DESC','UpdateWhatsappQueueReport','../client','create','CreateWhatsappQueueReport','update'];(function(_0x35922f,_0x1d334c){var _0x2e52d8=function(_0xbc6240){while(--_0xbc6240){_0x35922f['push'](_0x35922f['shift']());}};_0x2e52d8(++_0x1d334c);}(_0x5861,0x1a0));var _0x1586=function(_0x5235c8,_0x514cbe){_0x5235c8=_0x5235c8-0x0;var _0x447b21=_0x5861[_0x5235c8];return _0x447b21;};'use strict';var client=require(_0x1586('0x0'));exports[_0x1586('0x1')]=function(_0x1ea6d6){return client['Request'](_0x1586('0x2'),{'body':_0x1ea6d6,'log':_0x1586('0x2')});};exports[_0x1586('0x3')]=function(_0x2468cb,_0x3a04df){return client[_0x1586('0x4')]('UpdateWhatsappQueueReport',{'body':_0x3a04df,'options':{'where':{'uniqueid':_0x2468cb},'order':[['id',_0x1586('0x5')]],'limit':0x1},'log':_0x1586('0x6')});};
\ No newline at end of file
+var _0xb96a=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','create','Request'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb96a,0x136));var _0xab96=function(_0x29b9ad,_0x243a93){_0x29b9ad=_0x29b9ad-0x0;var _0x52ecd6=_0xb96a[_0x29b9ad];return _0x52ecd6;};'use strict';var client=require('../client');exports[_0xab96('0x0')]=function(_0x467212){return client[_0xab96('0x1')](_0xab96('0x2'),{'body':_0x467212,'log':_0xab96('0x2')});};exports[_0xab96('0x3')]=function(_0x24fe4d,_0x24c1ff){return client[_0xab96('0x1')](_0xab96('0x4'),{'body':_0x24c1ff,'options':{'where':{'uniqueid':_0x24fe4d},'order':[['id',_0xab96('0x5')]],'limit':0x1},'log':_0xab96('0x4')});};
\ No newline at end of file
index 531eadf..804394d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2e9=['START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','routing','string','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','channel'];(function(_0x3bfead,_0x569ba6){var _0x6fabb4=function(_0x3d1641){while(--_0x3d1641){_0x3bfead['push'](_0x3bfead['shift']());}};_0x6fabb4(++_0x569ba6);}(_0xb2e9,0x1a2));var _0x9b2e=function(_0x1cece7,_0x77f59b){_0x1cece7=_0x1cece7-0x0;var _0x3e3ebf=_0xb2e9[_0x1cece7];return _0x3e3ebf;};'use strict';var schema=require('validate');var _=require(_0x9b2e('0x0'));var util=require(_0x9b2e('0x1'));var seqqueue=require(_0x9b2e('0x2'));var logger=require('../../../../config/logger')(_0x9b2e('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x9b2e('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x9b2e('0x5'),'message':_0x9b2e('0x6')}});function writeLog(_0x42f26b,_0x4cfb15,_0x37c042){return logger[_0x9b2e('0x7')](util[_0x9b2e('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x42f26b,_0x4cfb15[_0x9b2e('0x9')],_0x37c042));}function handleFindAgent(_0x30fe01){return function(_0x465b76){return _0x465b76[_0x9b2e('0x9')][_0x9b2e('0xa')]()===_0x30fe01['toLowerCase']();};}exports[_0x9b2e('0xb')]=function(_0x259e2a,_0x56fe7b,_0x4d05c6,_0x5a6fbe){return function(_0x3e6707){try{var _0x35eb5a={'name':_0x56fe7b[0x0],'timeout':_0x56fe7b[0x1]};var _0x26deb1=queue[_0x9b2e('0xc')](_0x35eb5a,{'typecast':!![]});if(_0x26deb1[_0x9b2e('0xd')]){logger[_0x9b2e('0xe')](_0x9b2e('0xf'),_0x259e2a,_[_0x9b2e('0x10')](_0x26deb1,_0x9b2e('0x11'))[_0x9b2e('0x12')](',\x20'));_0x3e6707[_0x9b2e('0x13')]();}else{var _0x397524=_[_0x9b2e('0x14')](_0x4d05c6[_0x9b2e('0x15')],handleFindAgent(_0x35eb5a['name']));if(_0x397524){var _0x321bc1=(_0x35eb5a['timeout']||0xa)*0x3e8;var _0x5023e9,_0x4a2753;var _0x5b8df3=seqqueue[_0x9b2e('0x16')](_0x321bc1);_0x5b8df3['id']=_0x259e2a;_0x5b8df3['atimeout']=_0x321bc1;_0x5b8df3[_0x9b2e('0x17')]=_0x5a6fbe[_0x9b2e('0x17')];writeLog(_0x259e2a,_0x397524,util['format'](_0x9b2e('0x18'),_0x321bc1));_0x4d05c6[_0x9b2e('0x19')][_0x259e2a]['on']('end',function(){logger[_0x9b2e('0x7')](_0x9b2e('0x1a'),_0x259e2a);clearTimeout(_0x4a2753);_0x4a2753=undefined;_0x5b8df3[_0x9b2e('0x1b')]();if(_0x4d05c6[_0x9b2e('0x19')][_0x259e2a]){delete _0x4d05c6[_0x9b2e('0x19')][_0x259e2a];}_0x3e6707['stop']();});_0x4d05c6[_0x9b2e('0x19')][_0x259e2a]['on'](_0x9b2e('0x1c'),function(){if(_0x4d05c6['rules'][_0x259e2a]){delete _0x4d05c6[_0x9b2e('0x19')][_0x259e2a];}});_0x4a2753=setTimeout(function(){logger[_0x9b2e('0x7')](_0x9b2e('0x1d'),_0x259e2a);clearTimeout(_0x4a2753);_0x5b8df3[_0x9b2e('0x1b')]();_0x3e6707['next']();},_0x321bc1);strategy['agent'](_0x5b8df3,_0x397524,_0x4d05c6,_0x5a6fbe);}else{logger[_0x9b2e('0xe')](_0x9b2e('0x1e'),_0x259e2a,_0x35eb5a[_0x9b2e('0x9')]);_0x3e6707['stop']();}}}catch(_0x41108f){console[_0x9b2e('0x1f')](_0x41108f);logger[_0x9b2e('0xe')](_0x9b2e('0x20'),_0x259e2a,_0x41108f[_0x9b2e('0x21')]);_0x3e6707[_0x9b2e('0x13')]();}};};
\ No newline at end of file
+var _0xdb8f=['stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','info','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0xdb8f,0xfd));var _0xfdb8=function(_0x1ad68e,_0x16562f){_0x1ad68e=_0x1ad68e-0x0;var _0x82d21e=_0xdb8f[_0x1ad68e];return _0x82d21e;};'use strict';var schema=require(_0xfdb8('0x0'));var _=require(_0xfdb8('0x1'));var util=require(_0xfdb8('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xfdb8('0x3'))(_0xfdb8('0x4'));var strategy=require(_0xfdb8('0x5'));var queue=schema({'name':{'type':_0xfdb8('0x6'),'required':!![],'message':_0xfdb8('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4eb422,_0x3930ec,_0xddb3d5){return logger['info'](util[_0xfdb8('0x8')](_0xfdb8('0x9'),_0x4eb422,_0x3930ec[_0xfdb8('0xa')],_0xddb3d5));}function handleFindAgent(_0x21cfc0){return function(_0x4d3143){return _0x4d3143[_0xfdb8('0xa')][_0xfdb8('0xb')]()===_0x21cfc0[_0xfdb8('0xb')]();};}exports['consequence']=function(_0x1c5178,_0x4aeec9,_0x1f70e8,_0x3469da){return function(_0x2459ac){try{var _0x3ee4e7={'name':_0x4aeec9[0x0],'timeout':_0x4aeec9[0x1]};var _0xb905c5=queue[_0xfdb8('0x0')](_0x3ee4e7,{'typecast':!![]});if(_0xb905c5['length']){logger[_0xfdb8('0xc')](_0xfdb8('0xd'),_0x1c5178,_[_0xfdb8('0xe')](_0xb905c5,_0xfdb8('0xf'))[_0xfdb8('0x10')](',\x20'));_0x2459ac[_0xfdb8('0x11')]();}else{var _0xdbd323=_[_0xfdb8('0x12')](_0x1f70e8[_0xfdb8('0x13')],handleFindAgent(_0x3ee4e7['name']));if(_0xdbd323){var _0x1214eb=(_0x3ee4e7[_0xfdb8('0x14')]||0xa)*0x3e8;var _0x290cc6,_0x377022;var _0x3156a2=seqqueue[_0xfdb8('0x15')](_0x1214eb);_0x3156a2['id']=_0x1c5178;_0x3156a2[_0xfdb8('0x16')]=_0x1214eb;_0x3156a2['channel']=_0x3469da[_0xfdb8('0x17')];writeLog(_0x1c5178,_0xdbd323,util[_0xfdb8('0x8')]('START:%s',_0x1214eb));_0x1f70e8['rules'][_0x1c5178]['on'](_0xfdb8('0x18'),function(){logger['info'](_0xfdb8('0x19'),_0x1c5178);clearTimeout(_0x377022);_0x377022=undefined;_0x3156a2[_0xfdb8('0x1a')]();if(_0x1f70e8[_0xfdb8('0x1b')][_0x1c5178]){delete _0x1f70e8[_0xfdb8('0x1b')][_0x1c5178];}_0x2459ac[_0xfdb8('0x11')]();});_0x1f70e8[_0xfdb8('0x1b')][_0x1c5178]['on'](_0xfdb8('0x1c'),function(){if(_0x1f70e8[_0xfdb8('0x1b')][_0x1c5178]){delete _0x1f70e8[_0xfdb8('0x1b')][_0x1c5178];}});_0x377022=setTimeout(function(){logger[_0xfdb8('0x1d')](_0xfdb8('0x1e'),_0x1c5178);clearTimeout(_0x377022);_0x3156a2[_0xfdb8('0x1a')]();_0x2459ac['next']();},_0x1214eb);strategy[_0xfdb8('0x1f')](_0x3156a2,_0xdbd323,_0x1f70e8,_0x3469da);}else{logger[_0xfdb8('0xc')](_0xfdb8('0x20'),_0x1c5178,_0x3ee4e7[_0xfdb8('0xa')]);_0x2459ac[_0xfdb8('0x11')]();}}}catch(_0xa2bd1d){console[_0xfdb8('0x21')](_0xa2bd1d);logger[_0xfdb8('0xc')](_0xfdb8('0x22'),_0x1c5178,_0xa2bd1d[_0xfdb8('0x23')]);_0x2459ac[_0xfdb8('0x11')]();}};};
\ No newline at end of file
index 95dd118..4e1d422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa717=['stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','postText','message','amazonlex','providerName','providerResponse','stringify','dialogState','catch','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x422371,_0x366eed){var _0x4c058a=function(_0x4f60eb){while(--_0x4f60eb){_0x422371['push'](_0x422371['shift']());}};_0x4c058a(++_0x366eed);}(_0xa717,0x101));var _0x7a71=function(_0x111d01,_0x506e2f){_0x111d01=_0x111d01-0x0;var _0x1857d8=_0xa717[_0x111d01];return _0x1857d8;};'use strict';var _=require(_0x7a71('0x0'));var moment=require(_0x7a71('0x1'));var AWS=require('aws-sdk');var utils=require(_0x7a71('0x2'));var logger=require('../../../../config/logger')(_0x7a71('0x3'));var rpc={'chatMessage':require(_0x7a71('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7a71('0x5')),'smsMessage':require(_0x7a71('0x6')),'faxMessage':require(_0x7a71('0x7')),'whatsappMessage':require(_0x7a71('0x8'))};exports[_0x7a71('0x9')]=function(_0x3879e8,_0x26442c){return function(_0x203d9c){try{if(!_[_0x7a71('0xa')](this[_0x7a71('0xb')][_0x7a71('0xc')])){logger[_0x7a71('0xd')](_0x7a71('0xe'),_0x3879e8,_0x7a71('0xf'));return _0x203d9c[_0x7a71('0x10')]();}var _0x416239={'ContactId':this[_0x7a71('0x11')]['id'],'sentAt':moment()['format'](_0x7a71('0x12')),'direction':_0x7a71('0x13')};if(this[_0x7a71('0x14')]==='sms'||this[_0x7a71('0x14')]===_0x7a71('0x15')){_0x416239[_0x7a71('0x16')]=this[_0x7a71('0xb')][_0x7a71('0x16')];}var _0x93dca2=this[_0x7a71('0x14')];if(_0x93dca2===_0x7a71('0x17')){_0x416239['ChatWebsiteId']=this['account']['id'];}else{_0x416239[_[_0x7a71('0x18')](_0x93dca2)+_0x7a71('0x19')]=this[_0x7a71('0x1a')]['id'];}_0x416239[_[_0x7a71('0x18')](_0x93dca2)+_0x7a71('0x1b')]=this[_0x7a71('0xb')]['id'];if(this[_0x7a71('0xb')][_0x7a71('0x1c')]){var _0x24e803=_0x26442c[0x4];if(!_[_0x7a71('0x1d')](_0x24e803)){_0x416239[_0x7a71('0x1e')]=utils[_0x7a71('0x1f')](_0x24e803,this);return rpc[_0x93dca2+_0x7a71('0x20')]['create'](_0x416239)[_0x7a71('0x21')](function(_0x3b40f9){logger[_0x7a71('0xd')](_0x7a71('0xe'),_0x3879e8,_0x416239[_0x7a71('0x1e')]);})['catch'](function(_0x3a81fe){logger[_0x7a71('0x22')](_0x7a71('0xe'),_0x3879e8,JSON['stringify'](_0x3a81fe));})[_0x7a71('0x23')](function(){logger[_0x7a71('0xd')](_0x7a71('0x24'),_0x3879e8);_0x203d9c[_0x7a71('0x25')]();});}else{logger[_0x7a71('0xd')](_0x7a71('0x26'),_0x3879e8);_0x203d9c[_0x7a71('0x25')]();}}else{var _0x311740=this;var _0x107cac=new AWS[(_0x7a71('0x27'))]({'accessKeyId':_0x26442c[0x0],'secretAccessKey':_0x26442c[0x1],'region':_0x26442c[0x2]});var _0x2b00b3={'botAlias':_0x7a71('0x28'),'botName':_0x26442c[0x3],'inputText':this['message'][_0x7a71('0x1e')],'userId':this[_0x7a71('0x14')]+':'+this['interaction']['id']['toString']()};_0x107cac[_0x7a71('0x29')](_0x2b00b3,function(_0x1c3ce8,_0x2fdb96){if(_0x1c3ce8){logger[_0x7a71('0x22')](_0x7a71('0xe'),_0x3879e8,_0x1c3ce8['message']);_0x203d9c[_0x7a71('0x10')]();}else if(_0x2fdb96&&_0x2fdb96[_0x7a71('0x2a')]){_0x311740[_0x7a71('0x1e')][_0x7a71('0x2b')]=_0x2fdb96;_0x416239[_0x7a71('0x1e')]=_0x2fdb96['message'];_0x416239[_0x7a71('0x2c')]=_0x7a71('0x2b');_0x416239[_0x7a71('0x2d')]=JSON[_0x7a71('0x2e')](_0x2fdb96);return rpc[_0x93dca2+'Message']['create'](_0x416239)[_0x7a71('0x21')](function(_0x4b86c1){logger[_0x7a71('0xd')](_0x7a71('0xe'),_0x3879e8,_0x416239[_0x7a71('0x1e')]);if(_0x2fdb96[_0x7a71('0x2f')]=='Failed'){_0x203d9c[_0x7a71('0x10')]();}else{_0x203d9c[_0x7a71('0x25')]();}})[_0x7a71('0x30')](function(_0x1697e0){logger[_0x7a71('0x22')](_0x7a71('0xe'),_0x3879e8,JSON['stringify'](_0x1697e0));_0x203d9c[_0x7a71('0x10')]();});}else{_0x203d9c['next']();}});}}catch(_0x4901b0){logger[_0x7a71('0x22')]('[%s][AMAZONLEX]\x20%s',_0x3879e8,JSON[_0x7a71('0x2e')](_0x4901b0));_0x203d9c[_0x7a71('0x25')]();}};};
\ No newline at end of file
+var _0x445d=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','create','then','Failed','catch','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','info','error'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x445d,0xa1));var _0xd445=function(_0x21dd3d,_0x26b32e){_0x21dd3d=_0x21dd3d-0x0;var _0x364ed0=_0x445d[_0x21dd3d];return _0x364ed0;};'use strict';var _=require('lodash');var moment=require(_0xd445('0x0'));var AWS=require('aws-sdk');var utils=require(_0xd445('0x1'));var logger=require(_0xd445('0x2'))(_0xd445('0x3'));var rpc={'chatMessage':require(_0xd445('0x4')),'openchannelMessage':require(_0xd445('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd445('0x6')),'whatsappMessage':require(_0xd445('0x7'))};exports[_0xd445('0x8')]=function(_0x2a52fd,_0x4705f9){return function(_0x4b6102){try{if(!_[_0xd445('0x9')](this[_0xd445('0xa')][_0xd445('0xb')])){logger['info'](_0xd445('0xc'),_0x2a52fd,_0xd445('0xd'));return _0x4b6102[_0xd445('0xe')]();}var _0x23de8b={'ContactId':this[_0xd445('0xf')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd445('0x10')};if(this[_0xd445('0x11')]==='sms'||this[_0xd445('0x11')]===_0xd445('0x12')){_0x23de8b['phone']=this[_0xd445('0xa')][_0xd445('0x13')];}var _0x1be41c=this[_0xd445('0x11')];if(_0x1be41c===_0xd445('0x14')){_0x23de8b[_0xd445('0x15')]=this[_0xd445('0x16')]['id'];}else{_0x23de8b[_['upperFirst'](_0x1be41c)+'AccountId']=this[_0xd445('0x16')]['id'];}_0x23de8b[_[_0xd445('0x17')](_0x1be41c)+'InteractionId']=this[_0xd445('0xa')]['id'];if(this['interaction'][_0xd445('0x18')]){var _0x4ec4ff=_0x4705f9[0x4];if(!_[_0xd445('0x19')](_0x4ec4ff)){_0x23de8b[_0xd445('0x1a')]=utils[_0xd445('0x1b')](_0x4ec4ff,this);return rpc[_0x1be41c+_0xd445('0x1c')]['create'](_0x23de8b)['then'](function(_0x3f2d7f){logger[_0xd445('0x1d')](_0xd445('0xc'),_0x2a52fd,_0x23de8b[_0xd445('0x1a')]);})['catch'](function(_0x1a29d1){logger[_0xd445('0x1e')](_0xd445('0xc'),_0x2a52fd,JSON[_0xd445('0x1f')](_0x1a29d1));})[_0xd445('0x20')](function(){logger['info'](_0xd445('0x21'),_0x2a52fd);_0x4b6102[_0xd445('0x22')]();});}else{logger[_0xd445('0x1d')](_0xd445('0x23'),_0x2a52fd);_0x4b6102[_0xd445('0x22')]();}}else{var _0x268a7a=this;var _0x16bb0b=new AWS[(_0xd445('0x24'))]({'accessKeyId':_0x4705f9[0x0],'secretAccessKey':_0x4705f9[0x1],'region':_0x4705f9[0x2]});var _0x12c421={'botAlias':_0xd445('0x25'),'botName':_0x4705f9[0x3],'inputText':this[_0xd445('0x26')][_0xd445('0x1a')],'userId':this[_0xd445('0x11')]+':'+this[_0xd445('0xa')]['id'][_0xd445('0x27')]()};_0x16bb0b[_0xd445('0x28')](_0x12c421,function(_0x58af2a,_0x976faf){if(_0x58af2a){logger['error'](_0xd445('0xc'),_0x2a52fd,_0x58af2a[_0xd445('0x26')]);_0x4b6102[_0xd445('0xe')]();}else if(_0x976faf&&_0x976faf['message']){_0x268a7a[_0xd445('0x1a')][_0xd445('0x29')]=_0x976faf;_0x23de8b['body']=_0x976faf[_0xd445('0x26')];_0x23de8b[_0xd445('0x2a')]=_0xd445('0x29');_0x23de8b[_0xd445('0x2b')]=JSON[_0xd445('0x1f')](_0x976faf);return rpc[_0x1be41c+_0xd445('0x1c')][_0xd445('0x2c')](_0x23de8b)[_0xd445('0x2d')](function(_0x5b3025){logger[_0xd445('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x2a52fd,_0x23de8b[_0xd445('0x1a')]);if(_0x976faf['dialogState']==_0xd445('0x2e')){_0x4b6102['next']();}else{_0x4b6102['stop']();}})[_0xd445('0x2f')](function(_0x43ebff){logger[_0xd445('0x1e')](_0xd445('0xc'),_0x2a52fd,JSON['stringify'](_0x43ebff));_0x4b6102[_0xd445('0xe')]();});}else{_0x4b6102['next']();}});}}catch(_0x51e4ba){logger[_0xd445('0x1e')](_0xd445('0xc'),_0x2a52fd,JSON[_0xd445('0x1f')](_0x51e4ba));_0x4b6102[_0xd445('0x22')]();}};};
\ No newline at end of file
index cdfcd1f..14fbd28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0701=['Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','account','upperFirst','AccountId','InteractionId','Smtp','service','host','port','secure','auth','user','pass','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created'];(function(_0x2936cc,_0x1f7952){var _0xc23035=function(_0x40e58e){while(--_0x40e58e){_0x2936cc['push'](_0x2936cc['shift']());}};_0xc23035(++_0x1f7952);}(_0x0701,0xc5));var _0x1070=function(_0x5e79b0,_0x26f961){_0x5e79b0=_0x5e79b0-0x0;var _0x41cd59=_0x0701[_0x5e79b0];return _0x41cd59;};'use strict';var _=require(_0x1070('0x0'));var moment=require('moment');var utils=require(_0x1070('0x1'));var logger=require(_0x1070('0x2'))(_0x1070('0x3'));var rpc={'chatMessage':require(_0x1070('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1070('0x5')),'faxMessage':require(_0x1070('0x6')),'whatsappMessage':require(_0x1070('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x1070('0x8')),'whatsappInteraction':require(_0x1070('0x9'))};var mailRpc=require(_0x1070('0xa'));exports[_0x1070('0xb')]=function(_0x46d3ce,_0x1013ee,_0x3d7592,_0x3bce25){return function(_0x557c61){try{var _0x90fa21=this['channel'];if(_0x90fa21===_0x1070('0xc')&&_0x3bce25[_0x1070('0xd')][_0x1070('0xe')]){logger[_0x1070('0xf')](_0x1070('0x10'),_0x46d3ce,_0x1070('0x11'));return _0x557c61[_0x1070('0x12')]();}if(_0x1013ee[0x0]==='1'&&(_[_0x1070('0x13')](this[_0x1070('0x14')][_0x1070('0x15')])||!this[_0x1070('0x14')][_0x1070('0x15')])){logger[_0x1070('0xf')](_0x1070('0x10'),_0x46d3ce,_0x1070('0x16'));return _0x557c61['next']();}if(_0x1013ee[0x0]==='2'&&this[_0x1070('0x14')]['autoreplyExecuted']){logger[_0x1070('0xf')](_0x1070('0x17'),_0x46d3ce,_0x1070('0x18'));return _0x557c61['next']();}var _0x444d78={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x1070('0x19')),'direction':_0x1070('0x1a')};if(this[_0x1070('0x1b')]===_0x1070('0xc')){_0x444d78[_0x1070('0xd')]=utils[_0x1070('0x1c')](_0x1013ee[0x2],this);}else{_0x444d78[_0x1070('0xd')]=utils[_0x1070('0x1c')](_0x1013ee[0x1],this);}if(this[_0x1070('0x1d')]){_0x444d78['to']=this[_0x1070('0x1d')][_0x1070('0x1e')]||'';if(this[_0x1070('0x1b')]==='mail'&&_0x1013ee[0x1]==='1'){_0x444d78['cc']=this[_0x1070('0x1d')]['cc']||'';}_0x444d78[_0x1070('0x1e')]=this[_0x1070('0x1d')]['to']||'';_0x444d78[_0x1070('0x1f')]=this[_0x1070('0x1d')][_0x1070('0x1f')]||'';_0x444d78[_0x1070('0x20')]=!![];if(this[_0x1070('0x1d')][_0x1070('0x21')]){_0x444d78[_0x1070('0x21')]='';_0x444d78[_0x1070('0x21')]+=_['startsWith'](this[_0x1070('0x1d')][_0x1070('0x21')],_0x1070('0x22'))?'':_0x1070('0x23');_0x444d78[_0x1070('0x21')]+=this['message']['subject'];}}if(this[_0x1070('0x1b')]==='chat'){_0x444d78['ChatWebsiteId']=this[_0x1070('0x24')]['id'];}else{_0x444d78[_[_0x1070('0x25')](this[_0x1070('0x1b')])+_0x1070('0x26')]=this['account']['id'];}_0x444d78[_['upperFirst'](this[_0x1070('0x1b')])+_0x1070('0x27')]=this[_0x1070('0x14')]['id'];var _0x51739a=this[_0x1070('0x14')];if(rpc[this[_0x1070('0x1b')]+'Message']){if(this[_0x1070('0x1b')]===_0x1070('0xc')){var _0x4d86da={'tls':{'rejectUnauthorized':![]}};if(this[_0x1070('0x24')][_0x1070('0x28')][_0x1070('0x29')]){_0x4d86da[_0x1070('0x29')]=this[_0x1070('0x24')]['Smtp'][_0x1070('0x29')];}else{_0x4d86da[_0x1070('0x2a')]=this[_0x1070('0x24')][_0x1070('0x28')][_0x1070('0x2a')];_0x4d86da[_0x1070('0x2b')]=this[_0x1070('0x24')][_0x1070('0x28')][_0x1070('0x2b')];_0x4d86da[_0x1070('0x2c')]=this[_0x1070('0x24')][_0x1070('0x28')][_0x1070('0x2c')];}if(this[_0x1070('0x24')][_0x1070('0x28')]['authentication']){_0x4d86da[_0x1070('0x2d')]={'user':this['account'][_0x1070('0x28')][_0x1070('0x2e')],'pass':this[_0x1070('0x24')][_0x1070('0x28')][_0x1070('0x2f')]};}_0x444d78['inReplyTo']=this['message']['messageId'];_0x444d78[_0x1070('0x30')]=_0x1070('0x31')+_[_0x1070('0x32')](_0x444d78[_0x1070('0xd')],_0x1070('0x33'),_0x1070('0x34'))+_0x1070('0x35');_0x444d78['headers']={'Auto-Submitted':_0x1070('0x36'),'X-Auto-Response-Suppress':_0x1070('0x37'),'Precedence':_0x1070('0x38')};return mailRpc[_0x1070('0x39')](_0x4d86da,_0x444d78)['then'](function(_0x3560f4){logger[_0x1070('0xf')](_0x1070('0x3a'),_0x46d3ce);_0x444d78[_0x1070('0x3b')]=_0x3560f4[_0x1070('0x1d')][_0x1070('0x3b')];return rpc[_0x90fa21+_0x1070('0x3c')][_0x1070('0x3d')](_0x444d78);})[_0x1070('0x3e')](function(_0x47ef84){logger[_0x1070('0xf')](_0x1070('0x10'),_0x46d3ce,JSON[_0x1070('0x3f')](_0x47ef84));})[_0x1070('0x40')](function(_0x33db9d){logger[_0x1070('0x41')](_0x1070('0x42'),_0x46d3ce,JSON[_0x1070('0x3f')](_0x33db9d));})[_0x1070('0x43')](function(){Promise[_0x1070('0x44')]()[_0x1070('0x3e')](function(){if(_0x1013ee[0x0]!=='2'||_0x51739a['autoreplyExecuted'])return;return rpc[_0x90fa21+'Interaction'][_0x1070('0x45')](_0x51739a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x13b40e){logger['info'](_0x1070('0x17'),_0x46d3ce,JSON[_0x1070('0x3f')](_0x13b40e));})[_0x1070('0x40')](function(_0x216fde){logger[_0x1070('0x41')](_0x1070('0x46'),_0x46d3ce,JSON[_0x1070('0x3f')](_0x216fde));});})['then'](function(){_0x557c61['next']();});});}else{return rpc[this[_0x1070('0x1b')]+_0x1070('0x3c')][_0x1070('0x3d')](_0x444d78)[_0x1070('0x3e')](function(_0x2c35a2){logger[_0x1070('0xf')](_0x1070('0x10'),_0x46d3ce,_0x444d78['body']);})[_0x1070('0x40')](function(_0x4e7cce){logger[_0x1070('0x41')](_0x1070('0x10'),_0x46d3ce,JSON[_0x1070('0x3f')](_0x4e7cce));})[_0x1070('0x43')](function(){Promise[_0x1070('0x44')]()[_0x1070('0x3e')](function(){if(_0x1013ee[0x0]!=='2'||_0x51739a['autoreplyExecuted'])return;return rpc[_0x90fa21+_0x1070('0x47')][_0x1070('0x45')](_0x51739a['id'],{'autoreplyExecuted':!![]})[_0x1070('0x3e')](function(_0x56854b){logger[_0x1070('0xf')](_0x1070('0x17'),_0x46d3ce,JSON[_0x1070('0x3f')](_0x56854b));})[_0x1070('0x40')](function(_0x55ae6d){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x46d3ce,JSON[_0x1070('0x3f')](_0x55ae6d));});})[_0x1070('0x3e')](function(){_0x557c61[_0x1070('0x12')]();});});}}}catch(_0x14bdce){logger[_0x1070('0x41')](_0x1070('0x10'),_0x46d3ce,JSON[_0x1070('0x3f')](_0x14bdce));_0x557c61[_0x1070('0x48')]();}};};
\ No newline at end of file
+var _0x1503=['messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','channel','read','subject','startsWith','Re:','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','auth','pass','inReplyTo'];(function(_0x381ed8,_0x1a1279){var _0x10415c=function(_0x31ec1f){while(--_0x31ec1f){_0x381ed8['push'](_0x381ed8['shift']());}};_0x10415c(++_0x1a1279);}(_0x1503,0x19a));var _0x3150=function(_0x2a5637,_0x2589c2){_0x2a5637=_0x2a5637-0x0;var _0x6e5a23=_0x1503[_0x2a5637];return _0x6e5a23;};'use strict';var _=require(_0x3150('0x0'));var moment=require(_0x3150('0x1'));var utils=require(_0x3150('0x2'));var logger=require(_0x3150('0x3'))(_0x3150('0x4'));var rpc={'chatMessage':require(_0x3150('0x5')),'openchannelMessage':require(_0x3150('0x6')),'mailMessage':require(_0x3150('0x7')),'smsMessage':require(_0x3150('0x8')),'faxMessage':require(_0x3150('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x3150('0xa')),'openchannelInteraction':require(_0x3150('0xb')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x3150('0xc')),'faxInteraction':require(_0x3150('0xd')),'whatsappInteraction':require(_0x3150('0xe'))};var mailRpc=require(_0x3150('0xf'));exports['consequence']=function(_0x54dd24,_0x979d67,_0x50c61f,_0x445ef1){return function(_0x493572){try{var _0x318082=this['channel'];if(_0x318082===_0x3150('0x10')&&_0x445ef1[_0x3150('0x11')][_0x3150('0x12')]){logger[_0x3150('0x13')](_0x3150('0x14'),_0x54dd24,_0x3150('0x15'));return _0x493572['next']();}if(_0x979d67[0x0]==='1'&&(_[_0x3150('0x16')](this[_0x3150('0x17')][_0x3150('0x18')])||!this['interaction'][_0x3150('0x18')])){logger[_0x3150('0x13')](_0x3150('0x14'),_0x54dd24,_0x3150('0x19'));return _0x493572[_0x3150('0x1a')]();}if(_0x979d67[0x0]==='2'&&this['interaction'][_0x3150('0x1b')]){logger[_0x3150('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x54dd24,_0x3150('0x1c'));return _0x493572[_0x3150('0x1a')]();}var _0x11b8fb={'ContactId':this[_0x3150('0x1d')]['id'],'sentAt':moment()['format'](_0x3150('0x1e')),'direction':'out'};if(this['channel']===_0x3150('0x10')){_0x11b8fb['body']=utils[_0x3150('0x1f')](_0x979d67[0x2],this);}else{_0x11b8fb[_0x3150('0x11')]=utils[_0x3150('0x1f')](_0x979d67[0x1],this);}if(this[_0x3150('0x20')]){_0x11b8fb['to']=this[_0x3150('0x20')][_0x3150('0x21')]||'';if(this[_0x3150('0x22')]==='mail'&&_0x979d67[0x1]==='1'){_0x11b8fb['cc']=this[_0x3150('0x20')]['cc']||'';}_0x11b8fb[_0x3150('0x21')]=this[_0x3150('0x20')]['to']||'';_0x11b8fb['phone']=this[_0x3150('0x20')]['phone']||'';_0x11b8fb[_0x3150('0x23')]=!![];if(this[_0x3150('0x20')]['subject']){_0x11b8fb[_0x3150('0x24')]='';_0x11b8fb[_0x3150('0x24')]+=_[_0x3150('0x25')](this[_0x3150('0x20')]['subject'],_0x3150('0x26'))?'':'Re:\x20';_0x11b8fb[_0x3150('0x24')]+=this[_0x3150('0x20')]['subject'];}}if(this[_0x3150('0x22')]==='chat'){_0x11b8fb['ChatWebsiteId']=this[_0x3150('0x27')]['id'];}else{_0x11b8fb[_[_0x3150('0x28')](this[_0x3150('0x22')])+_0x3150('0x29')]=this[_0x3150('0x27')]['id'];}_0x11b8fb[_[_0x3150('0x28')](this[_0x3150('0x22')])+_0x3150('0x2a')]=this[_0x3150('0x17')]['id'];var _0x74f289=this[_0x3150('0x17')];if(rpc[this[_0x3150('0x22')]+_0x3150('0x2b')]){if(this[_0x3150('0x22')]===_0x3150('0x10')){var _0x40117e={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x3150('0x2c')][_0x3150('0x2d')]){_0x40117e[_0x3150('0x2d')]=this['account'][_0x3150('0x2c')]['service'];}else{_0x40117e[_0x3150('0x2e')]=this[_0x3150('0x27')][_0x3150('0x2c')]['host'];_0x40117e[_0x3150('0x2f')]=this['account'][_0x3150('0x2c')][_0x3150('0x2f')];_0x40117e[_0x3150('0x30')]=this[_0x3150('0x27')][_0x3150('0x2c')][_0x3150('0x30')];}if(this['account'][_0x3150('0x2c')]['authentication']){_0x40117e[_0x3150('0x31')]={'user':this[_0x3150('0x27')][_0x3150('0x2c')]['user'],'pass':this[_0x3150('0x27')][_0x3150('0x2c')][_0x3150('0x32')]};}_0x11b8fb[_0x3150('0x33')]=this[_0x3150('0x20')][_0x3150('0x34')];_0x11b8fb[_0x3150('0x35')]=_0x3150('0x36')+_[_0x3150('0x37')](_0x11b8fb[_0x3150('0x11')],_0x3150('0x38'),'<div')+_0x3150('0x39');_0x11b8fb[_0x3150('0x3a')]={'Auto-Submitted':_0x3150('0x3b'),'X-Auto-Response-Suppress':_0x3150('0x3c'),'Precedence':_0x3150('0x3d')};return mailRpc[_0x3150('0x3e')](_0x40117e,_0x11b8fb)[_0x3150('0x3f')](function(_0x218582){logger[_0x3150('0x13')](_0x3150('0x40'),_0x54dd24);_0x11b8fb['messageId']=_0x218582[_0x3150('0x20')][_0x3150('0x34')];return rpc[_0x318082+_0x3150('0x2b')][_0x3150('0x41')](_0x11b8fb);})[_0x3150('0x3f')](function(_0x248627){logger['info'](_0x3150('0x14'),_0x54dd24,JSON[_0x3150('0x42')](_0x248627));})['catch'](function(_0xbc0aee){logger[_0x3150('0x43')](_0x3150('0x44'),_0x54dd24,JSON['stringify'](_0xbc0aee));})[_0x3150('0x45')](function(){Promise[_0x3150('0x46')]()[_0x3150('0x3f')](function(){if(_0x979d67[0x0]!=='2'||_0x74f289[_0x3150('0x1b')])return;return rpc[_0x318082+_0x3150('0x47')][_0x3150('0x48')](_0x74f289['id'],{'autoreplyExecuted':!![]})['then'](function(_0x101e4a){logger[_0x3150('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x54dd24,JSON[_0x3150('0x42')](_0x101e4a));})[_0x3150('0x49')](function(_0x4701cb){logger[_0x3150('0x43')](_0x3150('0x4a'),_0x54dd24,JSON[_0x3150('0x42')](_0x4701cb));});})['then'](function(){_0x493572[_0x3150('0x1a')]();});});}else{return rpc[this[_0x3150('0x22')]+_0x3150('0x2b')][_0x3150('0x41')](_0x11b8fb)[_0x3150('0x3f')](function(_0x125620){logger[_0x3150('0x13')](_0x3150('0x14'),_0x54dd24,_0x11b8fb[_0x3150('0x11')]);})[_0x3150('0x49')](function(_0x5934a9){logger[_0x3150('0x43')](_0x3150('0x14'),_0x54dd24,JSON['stringify'](_0x5934a9));})[_0x3150('0x45')](function(){Promise[_0x3150('0x46')]()[_0x3150('0x3f')](function(){if(_0x979d67[0x0]!=='2'||_0x74f289[_0x3150('0x1b')])return;return rpc[_0x318082+_0x3150('0x47')][_0x3150('0x48')](_0x74f289['id'],{'autoreplyExecuted':!![]})['then'](function(_0x4397f8){logger['info'](_0x3150('0x4b'),_0x54dd24,JSON['stringify'](_0x4397f8));})[_0x3150('0x49')](function(_0x17ea68){logger[_0x3150('0x43')](_0x3150('0x4a'),_0x54dd24,JSON[_0x3150('0x42')](_0x17ea68));});})[_0x3150('0x3f')](function(){_0x493572[_0x3150('0x1a')]();});});}}}catch(_0x5b9348){logger[_0x3150('0x43')](_0x3150('0x14'),_0x54dd24,JSON[_0x3150('0x42')](_0x5b9348));_0x493572[_0x3150('0x4c')]();}};};
\ No newline at end of file
index 4de8676..5f7151a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c0e=['Interaction','channel','interaction','then','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4c0e,0x73));var _0xe4c0=function(_0x383158,_0x415e43){_0x383158=_0x383158-0x0;var _0x507985=_0x4c0e[_0x383158];return _0x507985;};'use strict';var moment=require('moment');var logger=require(_0xe4c0('0x0'))(_0xe4c0('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xe4c0('0x2')),'smsInteraction':require(_0xe4c0('0x3')),'mailInteraction':require(_0xe4c0('0x4')),'faxInteraction':require(_0xe4c0('0x5')),'whatsappInteraction':require(_0xe4c0('0x6'))};exports[_0xe4c0('0x7')]=function(_0x18ae7b,_0x3a94a7,_0x306d35,_0x4c2aec){return function(_0x45080e){try{logger[_0xe4c0('0x8')](_0xe4c0('0x9'),_0x18ae7b,_0x3a94a7[0x0]);var _0x213cd1={'closed':0x1,'closedAt':moment()['format'](_0xe4c0('0xa')),'closeReason':'system','disposition':_0x3a94a7[0x0]};if(rpc[_0x4c2aec['channel']+_0xe4c0('0xb')]){rpc[_0x4c2aec[_0xe4c0('0xc')]+_0xe4c0('0xb')]['update'](_0x4c2aec[_0xe4c0('0xd')]['id'],_0x213cd1)[_0xe4c0('0xe')](function(_0x3658e9){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x18ae7b,_0x4c2aec[_0xe4c0('0xd')]['id']);})[_0xe4c0('0xf')](function(_0x3892ef){logger[_0xe4c0('0x10')](_0xe4c0('0x11'),_0x18ae7b,JSON['stringify'](_0x3892ef));})[_0xe4c0('0x12')](function(){_0x45080e[_0xe4c0('0x13')]();});}}catch(_0x325f1d){logger[_0xe4c0('0x10')]('[%s][CLOSE]\x20%s',_0x18ae7b,JSON[_0xe4c0('0x14')](_0x325f1d));_0x45080e[_0xe4c0('0x13')]();}};};
\ No newline at end of file
+var _0x652a=['interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','Interaction','channel','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x652a,0x1eb));var _0xa652=function(_0x4626ad,_0x43f817){_0x4626ad=_0x4626ad-0x0;var _0x2b8b0d=_0x652a[_0x4626ad];return _0x2b8b0d;};'use strict';var moment=require(_0xa652('0x0'));var logger=require(_0xa652('0x1'))(_0xa652('0x2'));var rpc={'chatInteraction':require(_0xa652('0x3')),'openchannelInteraction':require(_0xa652('0x4')),'smsInteraction':require(_0xa652('0x5')),'mailInteraction':require(_0xa652('0x6')),'faxInteraction':require(_0xa652('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xa652('0x8')]=function(_0x2fc2d1,_0x85bbe6,_0x24b895,_0x25f25a){return function(_0x10d2e6){try{logger[_0xa652('0x9')](_0xa652('0xa'),_0x2fc2d1,_0x85bbe6[0x0]);var _0x38086d={'closed':0x1,'closedAt':moment()[_0xa652('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x85bbe6[0x0]};if(rpc[_0x25f25a['channel']+_0xa652('0xc')]){rpc[_0x25f25a[_0xa652('0xd')]+'Interaction'][_0xa652('0xe')](_0x25f25a[_0xa652('0xf')]['id'],_0x38086d)[_0xa652('0x10')](function(_0x2dda4a){logger[_0xa652('0x9')](_0xa652('0x11'),_0x2fc2d1,_0x25f25a[_0xa652('0xf')]['id']);})[_0xa652('0x12')](function(_0x16c2a9){logger[_0xa652('0x13')](_0xa652('0x14'),_0x2fc2d1,JSON['stringify'](_0x16c2a9));})['finally'](function(){_0x10d2e6['stop']();});}}catch(_0x2aefaa){logger[_0xa652('0x13')](_0xa652('0x14'),_0x2fc2d1,JSON[_0xa652('0x15')](_0x2aefaa));_0x10d2e6['stop']();}};};
\ No newline at end of file
index c5aa458..636dc34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc051=['isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','catch','error','stringify','finally','stop','message','then','dialogflow','result','fulfillment','speech','providerResponse','next','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x235e00,_0x225208){var _0x4e9b9a=function(_0x5d462b){while(--_0x5d462b){_0x235e00['push'](_0x235e00['shift']());}};_0x4e9b9a(++_0x225208);}(_0xc051,0xb5));var _0x1c05=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0xc051[_0x867b0a];return _0x137438;};'use strict';var _=require(_0x1c05('0x0'));var moment=require(_0x1c05('0x1'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0x1c05('0x2'));var logger=require(_0x1c05('0x3'))(_0x1c05('0x4'));var rpc={'chatMessage':require(_0x1c05('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1c05('0x6')),'smsMessage':require(_0x1c05('0x7')),'faxMessage':require(_0x1c05('0x8')),'whatsappMessage':require(_0x1c05('0x9'))};exports[_0x1c05('0xa')]=function(_0x28a978,_0x3a9ba8){return function(_0x44d233){try{if(!_[_0x1c05('0xb')](this['interaction'][_0x1c05('0xc')])){logger[_0x1c05('0xd')](_0x1c05('0xe'),_0x28a978,_0x1c05('0xf'));return _0x44d233['next']();}var _0x25afe5={'ContactId':this[_0x1c05('0x10')]['id'],'sentAt':moment()[_0x1c05('0x11')](_0x1c05('0x12')),'direction':'out'};if(this[_0x1c05('0x13')]==='sms'||this[_0x1c05('0x13')]===_0x1c05('0x14')){_0x25afe5[_0x1c05('0x15')]=this[_0x1c05('0x16')][_0x1c05('0x15')];}var _0x388a1a=this[_0x1c05('0x13')];if(_0x388a1a===_0x1c05('0x17')){_0x25afe5[_0x1c05('0x18')]=this[_0x1c05('0x19')]['id'];}else{_0x25afe5[_[_0x1c05('0x1a')](_0x388a1a)+_0x1c05('0x1b')]=this['account']['id'];}_0x25afe5[_[_0x1c05('0x1a')](_0x388a1a)+_0x1c05('0x1c')]=this[_0x1c05('0x16')]['id'];if(this['interaction'][_0x1c05('0x1d')]){var _0x49b538=_0x3a9ba8[0x2];if(!_[_0x1c05('0x1e')](_0x49b538)){_0x25afe5[_0x1c05('0x1f')]=utils[_0x1c05('0x20')](_0x49b538,this);return rpc[_0x388a1a+_0x1c05('0x21')][_0x1c05('0x22')](_0x25afe5)['then'](function(_0x6ec656){logger[_0x1c05('0xd')](_0x1c05('0xe'),_0x28a978,_0x25afe5['body']);})[_0x1c05('0x23')](function(_0x1171b2){logger[_0x1c05('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x28a978,JSON[_0x1c05('0x25')](_0x1171b2));})[_0x1c05('0x26')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x28a978);_0x44d233[_0x1c05('0x27')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x28a978);_0x44d233['stop']();}}else{var _0x31beae=this;var _0xcce64e=apiai(_0x3a9ba8[0x0],{'language':_0x3a9ba8[0x1]||'en'});return _0xcce64e['textRequest'](this[_0x1c05('0x28')][_0x1c05('0x1f')],{'sessionId':md5(this[_0x1c05('0x16')]['id'])})[_0x1c05('0x29')](function(_0x5f4a4c){_0x31beae[_0x1c05('0x1f')][_0x1c05('0x2a')]=_0x5f4a4c;_0x25afe5[_0x1c05('0x1f')]=_0x5f4a4c[_0x1c05('0x2b')][_0x1c05('0x2c')][_0x1c05('0x2d')];_0x25afe5['providerName']=_0x1c05('0x2a');_0x25afe5[_0x1c05('0x2e')]=JSON[_0x1c05('0x25')](_0x5f4a4c);return rpc[_0x388a1a+_0x1c05('0x21')][_0x1c05('0x22')](_0x25afe5)[_0x1c05('0x29')](function(_0x190987){logger['info'](_0x1c05('0xe'),_0x28a978,_0x25afe5[_0x1c05('0x1f')]);if(_0x5f4a4c[_0x1c05('0x2b')]['metadata']['endConversation']){_0x44d233[_0x1c05('0x2f')]();}else{_0x44d233[_0x1c05('0x27')]();}})[_0x1c05('0x23')](function(_0x404b36){logger[_0x1c05('0x24')](_0x1c05('0xe'),_0x28a978,JSON[_0x1c05('0x25')](_0x404b36));_0x44d233[_0x1c05('0x2f')]();});})[_0x1c05('0x23')](function(_0x3a9abb){logger[_0x1c05('0x24')](_0x1c05('0xe'),_0x28a978,_0x3a9abb[_0x1c05('0x28')]);_0x44d233[_0x1c05('0x2f')]();});}}catch(_0x5aab6b){logger[_0x1c05('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x28a978,JSON['stringify'](_0x5aab6b));_0x44d233[_0x1c05('0x27')]();}};};
\ No newline at end of file
+var _0x687b=['providerName','providerResponse','metadata','endConversation','error','catch','lodash','moment','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','body','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','result','fulfillment','speech'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x687b,0x14a));var _0xb687=function(_0x4a423e,_0x59ba7b){_0x4a423e=_0x4a423e-0x0;var _0x4ad91f=_0x687b[_0x4a423e];return _0x4ad91f;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var apiai=require(_0xb687('0x2'));var md5=require(_0xb687('0x3'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xb687('0x4'));var rpc={'chatMessage':require(_0xb687('0x5')),'openchannelMessage':require(_0xb687('0x6')),'mailMessage':require(_0xb687('0x7')),'smsMessage':require(_0xb687('0x8')),'faxMessage':require(_0xb687('0x9')),'whatsappMessage':require(_0xb687('0xa'))};exports[_0xb687('0xb')]=function(_0x47ffea,_0x27b750){return function(_0x48942b){try{if(!_[_0xb687('0xc')](this[_0xb687('0xd')]['UserId'])){logger[_0xb687('0xe')](_0xb687('0xf'),_0x47ffea,_0xb687('0x10'));return _0x48942b[_0xb687('0x11')]();}var _0x404fdb={'ContactId':this[_0xb687('0x12')]['id'],'sentAt':moment()[_0xb687('0x13')](_0xb687('0x14')),'direction':_0xb687('0x15')};if(this['channel']===_0xb687('0x16')||this[_0xb687('0x17')]===_0xb687('0x18')){_0x404fdb[_0xb687('0x19')]=this['interaction']['phone'];}var _0x3e85b3=this[_0xb687('0x17')];if(_0x3e85b3==='chat'){_0x404fdb[_0xb687('0x1a')]=this[_0xb687('0x1b')]['id'];}else{_0x404fdb[_[_0xb687('0x1c')](_0x3e85b3)+_0xb687('0x1d')]=this[_0xb687('0x1b')]['id'];}_0x404fdb[_[_0xb687('0x1c')](_0x3e85b3)+_0xb687('0x1e')]=this[_0xb687('0xd')]['id'];if(this[_0xb687('0xd')][_0xb687('0x1f')]){var _0x25124a=_0x27b750[0x2];if(!_[_0xb687('0x20')](_0x25124a)){_0x404fdb['body']=utils[_0xb687('0x21')](_0x25124a,this);return rpc[_0x3e85b3+_0xb687('0x22')][_0xb687('0x23')](_0x404fdb)['then'](function(_0x48958d){logger[_0xb687('0xe')](_0xb687('0xf'),_0x47ffea,_0x404fdb[_0xb687('0x24')]);})['catch'](function(_0x42cdd2){logger['error'](_0xb687('0xf'),_0x47ffea,JSON[_0xb687('0x25')](_0x42cdd2));})[_0xb687('0x26')](function(){logger[_0xb687('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x47ffea);_0x48942b[_0xb687('0x27')]();});}else{logger['info'](_0xb687('0x28'),_0x47ffea);_0x48942b[_0xb687('0x27')]();}}else{var _0x274241=this;var _0x546fde=apiai(_0x27b750[0x0],{'language':_0x27b750[0x1]||'en'});return _0x546fde[_0xb687('0x29')](this[_0xb687('0x2a')][_0xb687('0x24')],{'sessionId':md5(this[_0xb687('0xd')]['id'])})[_0xb687('0x2b')](function(_0x38866c){_0x274241[_0xb687('0x24')][_0xb687('0x2c')]=_0x38866c;_0x404fdb['body']=_0x38866c[_0xb687('0x2d')][_0xb687('0x2e')][_0xb687('0x2f')];_0x404fdb[_0xb687('0x30')]=_0xb687('0x2c');_0x404fdb[_0xb687('0x31')]=JSON[_0xb687('0x25')](_0x38866c);return rpc[_0x3e85b3+_0xb687('0x22')][_0xb687('0x23')](_0x404fdb)[_0xb687('0x2b')](function(_0x4a61ec){logger[_0xb687('0xe')](_0xb687('0xf'),_0x47ffea,_0x404fdb[_0xb687('0x24')]);if(_0x38866c[_0xb687('0x2d')][_0xb687('0x32')][_0xb687('0x33')]){_0x48942b['next']();}else{_0x48942b[_0xb687('0x27')]();}})['catch'](function(_0x360429){logger[_0xb687('0x34')](_0xb687('0xf'),_0x47ffea,JSON[_0xb687('0x25')](_0x360429));_0x48942b[_0xb687('0x11')]();});})[_0xb687('0x35')](function(_0xf1f0dd){logger['error'](_0xb687('0xf'),_0x47ffea,_0xf1f0dd[_0xb687('0x2a')]);_0x48942b[_0xb687('0x11')]();});}}catch(_0x22cd1d){logger[_0xb687('0x34')](_0xb687('0xf'),_0x47ffea,JSON[_0xb687('0x25')](_0x22cd1d));_0x48942b[_0xb687('0x27')]();}};};
\ No newline at end of file
index c778c95..1b63d4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe105=['allRequiredParamsPresent','fields','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','stringify','push','fulfillmentText','error','lodash','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','Message','info','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT'];(function(_0x4753f3,_0xfa186e){var _0x124353=function(_0x43a04a){while(--_0x43a04a){_0x4753f3['push'](_0x4753f3['shift']());}};_0x124353(++_0xfa186e);}(_0xe105,0xef));var _0x5e10=function(_0x44ee42,_0x1aba69){_0x44ee42=_0x44ee42-0x0;var _0x51e7b8=_0xe105[_0x44ee42];return _0x51e7b8;};'use strict';var _=require(_0x5e10('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require('moment');var Promise=require('bluebird');var logger=require(_0x5e10('0x1'))(_0x5e10('0x2'));var utils=require(_0x5e10('0x3'));var rpc={'chatMessage':require(_0x5e10('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5e10('0x5')),'smsMessage':require(_0x5e10('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5e10('0x7'))};function createMessage(_0x508131,_0x59af7d,_0x375cbd,_0x3e8317){return new Promise(function(_0x5ce6bd,_0x54e0d1){var _0x219f31=_[_0x5e10('0x8')](_0x375cbd);_0x219f31[_0x5e10('0x9')]=_0x3e8317;return rpc[_0x59af7d+'Message'][_0x5e10('0xa')](_0x219f31)[_0x5e10('0xb')](function(){logger['info'](_0x5e10('0xc'),_0x508131,_0x219f31[_0x5e10('0x9')]);_0x5ce6bd();})[_0x5e10('0xd')](function(_0x2323a7){logger['error'](_0x5e10('0xc'),_0x508131,JSON['stringify'](_0x2323a7));_0x54e0d1(_0x2323a7);});});}exports[_0x5e10('0xe')]=function(_0x40c429,_0x467411){return function(_0xff9745){try{if(!_[_0x5e10('0xf')](this[_0x5e10('0x10')][_0x5e10('0x11')])){logger['info'](_0x5e10('0xc'),_0x40c429,_0x5e10('0x12'));return _0xff9745[_0x5e10('0x13')]();}var _0x2f13e8={'ContactId':this[_0x5e10('0x14')]['id'],'sentAt':moment()['format'](_0x5e10('0x15')),'direction':_0x5e10('0x16')};if(this[_0x5e10('0x17')]===_0x5e10('0x18')||this[_0x5e10('0x17')]===_0x5e10('0x19')){_0x2f13e8[_0x5e10('0x1a')]=this['interaction'][_0x5e10('0x1a')];}var _0x47dfc5=this[_0x5e10('0x17')];if(_0x47dfc5===_0x5e10('0x1b')){_0x2f13e8[_0x5e10('0x1c')]=this['account']['id'];}else{_0x2f13e8[_[_0x5e10('0x1d')](_0x47dfc5)+_0x5e10('0x1e')]=this[_0x5e10('0x1f')]['id'];}_0x2f13e8[_[_0x5e10('0x1d')](_0x47dfc5)+_0x5e10('0x20')]=this[_0x5e10('0x10')]['id'];if(this[_0x5e10('0x10')][_0x5e10('0x21')]){var _0x138172=_0x467411[0x4];if(!_[_0x5e10('0x22')](_0x138172)){_0x2f13e8['body']=utils['getMustacheRender'](_0x138172,this);return rpc[_0x47dfc5+_0x5e10('0x23')]['create'](_0x2f13e8)[_0x5e10('0xb')](function(_0x37e351){logger[_0x5e10('0x24')](_0x5e10('0xc'),_0x40c429,_0x2f13e8[_0x5e10('0x9')]);})[_0x5e10('0xd')](function(_0x4fe280){logger['error'](_0x5e10('0xc'),_0x40c429,JSON['stringify'](_0x4fe280));})[_0x5e10('0x25')](function(){logger[_0x5e10('0x24')](_0x5e10('0x26'),_0x40c429);_0xff9745[_0x5e10('0x27')]();});}else{logger[_0x5e10('0x24')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x40c429);_0xff9745['stop']();}}else{var _0x3f7f85=this;var _0xb14be0=_0x467411[0x2][_0x5e10('0x28')](/\\n/g,'\x0a');var _0x3ffc82={'credentials':{'private_key':_0xb14be0,'client_email':_0x467411[0x1]}};var _0xb06b17=new dialogflow[(_0x5e10('0x29'))](_0x3ffc82);var _0x4281c1=_0xb06b17[_0x5e10('0x2a')](_0x467411[0x0],md5(_0x3f7f85[_0x5e10('0x10')]['id']));var _0x368057={'session':_0x4281c1,'queryInput':{'text':{'text':_0x3f7f85[_0x5e10('0x2b')][_0x5e10('0x9')],'languageCode':_0x467411[0x3]||'en'}}};return _0xb06b17[_0x5e10('0x2c')](_0x368057)[_0x5e10('0xb')](function(_0x147dcd){if(_0x147dcd&&_0x147dcd[_0x5e10('0x2d')]){_0x3f7f85['body'][_0x5e10('0x2e')]=_0x147dcd;var _0x1df970=_0x147dcd[0x0];var _0x31e32b=_0x1df970[_0x5e10('0x2f')]['diagnosticInfo']&&_0x1df970[_0x5e10('0x2f')][_0x5e10('0x30')]['fields']?_0x1df970[_0x5e10('0x2f')]['diagnosticInfo']['fields']['end_conversation'][_0x5e10('0x31')]:![];_0x3f7f85[_0x5e10('0x9')][_0x5e10('0x32')]=_0x1df970[_0x5e10('0x2f')][_0x5e10('0x33')];_0x3f7f85[_0x5e10('0x9')][_0x5e10('0x34')]=_0x1df970['queryResult'][_0x5e10('0x35')];_0x3f7f85[_0x5e10('0x9')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x1df970[_0x5e10('0x2f')]['diagnosticInfo']&&_0x1df970[_0x5e10('0x2f')][_0x5e10('0x30')][_0x5e10('0x36')]?_0x1df970[_0x5e10('0x2f')][_0x5e10('0x30')][_0x5e10('0x36')]['end_conversation']['boolValue']:![];_0x3f7f85['body'][_0x5e10('0x37')]=_0x1df970['queryResult'][_0x5e10('0x38')][_0x5e10('0x39')];_0x3f7f85['body'][_0x5e10('0x3a')]=_0x1df970[_0x5e10('0x2f')]['intent'][_0x5e10('0x3b')];_0x3f7f85[_0x5e10('0x9')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x1df970[_0x5e10('0x2f')]['intent'][_0x5e10('0x3c')];_0x3f7f85[_0x5e10('0x9')][_0x5e10('0x3d')]=_0x1df970[_0x5e10('0x2f')][_0x5e10('0x3e')];_0x3f7f85[_0x5e10('0x9')][_0x5e10('0x3f')]=_0x1df970['queryResult'][_0x5e10('0x40')];_0x3f7f85[_0x5e10('0x9')][_0x5e10('0x41')]=_0x1df970[_0x5e10('0x2f')][_0x5e10('0x42')];_0x2f13e8[_0x5e10('0x43')]='dialogflowV2';_0x2f13e8[_0x5e10('0x44')]=JSON[_0x5e10('0x45')](_0x147dcd);var _0x5b3bb1=[];for(var _0x305464=0x0;_0x305464<_0x147dcd[_0x5e10('0x2d')];_0x305464++){var _0x2d0159=_0x147dcd[_0x305464];if(_0x2d0159&&_0x2d0159[_0x5e10('0x2f')]&&_0x2d0159[_0x5e10('0x2f')]['fulfillmentText']){_0x5b3bb1[_0x5e10('0x46')](createMessage(_0x40c429,_0x47dfc5,_0x2f13e8,_0x2d0159[_0x5e10('0x2f')][_0x5e10('0x47')]));}}return Promise['all'](_0x5b3bb1)[_0x5e10('0xb')](function(){if(_0x31e32b){_0xff9745[_0x5e10('0x13')]();}else{_0xff9745[_0x5e10('0x27')]();}})[_0x5e10('0xd')](function(_0x2fe3fb){logger[_0x5e10('0x48')](_0x5e10('0xc'),_0x40c429,JSON['stringify'](_0x2fe3fb));_0xff9745[_0x5e10('0x13')]();});}})['catch'](function(_0x59b1d4){logger['error'](_0x5e10('0xc'),_0x40c429,_0x59b1d4[_0x5e10('0x2b')]);_0xff9745['next']();});}}catch(_0xcd45c5){logger[_0x5e10('0x48')](_0x5e10('0xc'),_0x40c429,JSON[_0x5e10('0x45')](_0xcd45c5));_0xff9745[_0x5e10('0x27')]();}};};
\ No newline at end of file
+var _0xd7ce=['body','consequence','interaction','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','InteractionId','isEmpty','getMustacheRender','catch','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','detectIntent','length','queryResult','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','diagnosticInfo','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','dialogflowV2','fulfillmentText','all','error','message','lodash','dialogflow','md5','moment','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd7ce,0x16b));var _0xed7c=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0xd7ce[_0x1bb58c];return _0x277586;};'use strict';var _=require(_0xed7c('0x0'));var dialogflow=require(_0xed7c('0x1'));var md5=require(_0xed7c('0x2'));var moment=require(_0xed7c('0x3'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0xed7c('0x4'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xed7c('0x5')),'smsMessage':require(_0xed7c('0x6')),'faxMessage':require(_0xed7c('0x7')),'whatsappMessage':require(_0xed7c('0x8'))};function createMessage(_0x34bbd7,_0x43a9e7,_0x41afb9,_0x270db6){return new Promise(function(_0x190af8,_0x46586d){var _0x22f9aa=_[_0xed7c('0x9')](_0x41afb9);_0x22f9aa['body']=_0x270db6;return rpc[_0x43a9e7+_0xed7c('0xa')][_0xed7c('0xb')](_0x22f9aa)[_0xed7c('0xc')](function(){logger[_0xed7c('0xd')](_0xed7c('0xe'),_0x34bbd7,_0x22f9aa[_0xed7c('0xf')]);_0x190af8();})['catch'](function(_0x3bcf7a){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x34bbd7,JSON['stringify'](_0x3bcf7a));_0x46586d(_0x3bcf7a);});});}exports[_0xed7c('0x10')]=function(_0x24a769,_0x52cf82){return function(_0x4c6bb8){try{if(!_['isNil'](this[_0xed7c('0x11')]['UserId'])){logger[_0xed7c('0xd')](_0xed7c('0xe'),_0x24a769,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4c6bb8[_0xed7c('0x12')]();}var _0x2b0c33={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xed7c('0x13')),'direction':_0xed7c('0x14')};if(this[_0xed7c('0x15')]==='sms'||this['channel']===_0xed7c('0x16')){_0x2b0c33[_0xed7c('0x17')]=this[_0xed7c('0x11')][_0xed7c('0x17')];}var _0x2f3d6b=this[_0xed7c('0x15')];if(_0x2f3d6b===_0xed7c('0x18')){_0x2b0c33[_0xed7c('0x19')]=this[_0xed7c('0x1a')]['id'];}else{_0x2b0c33[_['upperFirst'](_0x2f3d6b)+'AccountId']=this[_0xed7c('0x1a')]['id'];}_0x2b0c33[_['upperFirst'](_0x2f3d6b)+_0xed7c('0x1b')]=this[_0xed7c('0x11')]['id'];if(this[_0xed7c('0x11')]['created']){var _0x45aed7=_0x52cf82[0x4];if(!_[_0xed7c('0x1c')](_0x45aed7)){_0x2b0c33[_0xed7c('0xf')]=utils[_0xed7c('0x1d')](_0x45aed7,this);return rpc[_0x2f3d6b+_0xed7c('0xa')][_0xed7c('0xb')](_0x2b0c33)[_0xed7c('0xc')](function(_0x2ec187){logger[_0xed7c('0xd')](_0xed7c('0xe'),_0x24a769,_0x2b0c33[_0xed7c('0xf')]);})[_0xed7c('0x1e')](function(_0x50f970){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x24a769,JSON[_0xed7c('0x1f')](_0x50f970));})[_0xed7c('0x20')](function(){logger[_0xed7c('0xd')](_0xed7c('0x21'),_0x24a769);_0x4c6bb8[_0xed7c('0x22')]();});}else{logger[_0xed7c('0xd')](_0xed7c('0x23'),_0x24a769);_0x4c6bb8[_0xed7c('0x22')]();}}else{var _0x183874=this;var _0x46c6b5=_0x52cf82[0x2][_0xed7c('0x24')](/\\n/g,'\x0a');var _0x56af94={'credentials':{'private_key':_0x46c6b5,'client_email':_0x52cf82[0x1]}};var _0x43b842=new dialogflow[(_0xed7c('0x25'))](_0x56af94);var _0xfd8117=_0x43b842[_0xed7c('0x26')](_0x52cf82[0x0],md5(_0x183874[_0xed7c('0x11')]['id']));var _0x4fec61={'session':_0xfd8117,'queryInput':{'text':{'text':_0x183874['message'][_0xed7c('0xf')],'languageCode':_0x52cf82[0x3]||'en'}}};return _0x43b842[_0xed7c('0x27')](_0x4fec61)['then'](function(_0x1a35a6){if(_0x1a35a6&&_0x1a35a6[_0xed7c('0x28')]){_0x183874['body']['dialogflowV2']=_0x1a35a6;var _0x16c4fc=_0x1a35a6[0x0];var _0xbae85b=_0x16c4fc[_0xed7c('0x29')]['diagnosticInfo']&&_0x16c4fc[_0xed7c('0x29')]['diagnosticInfo'][_0xed7c('0x2a')]?_0x16c4fc[_0xed7c('0x29')]['diagnosticInfo'][_0xed7c('0x2a')]['end_conversation'][_0xed7c('0x2b')]:![];_0x183874[_0xed7c('0xf')][_0xed7c('0x2c')]=_0x16c4fc[_0xed7c('0x29')][_0xed7c('0x2d')];_0x183874[_0xed7c('0xf')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x16c4fc[_0xed7c('0x29')]['allRequiredParamsPresent'];_0x183874['body'][_0xed7c('0x2e')]=_0x16c4fc['queryResult'][_0xed7c('0x2f')]&&_0x16c4fc[_0xed7c('0x29')][_0xed7c('0x2f')]['fields']?_0x16c4fc[_0xed7c('0x29')][_0xed7c('0x2f')][_0xed7c('0x2a')][_0xed7c('0x30')]['boolValue']:![];_0x183874[_0xed7c('0xf')][_0xed7c('0x31')]=_0x16c4fc[_0xed7c('0x29')][_0xed7c('0x32')]['name'];_0x183874[_0xed7c('0xf')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x16c4fc[_0xed7c('0x29')][_0xed7c('0x32')][_0xed7c('0x33')];_0x183874[_0xed7c('0xf')][_0xed7c('0x34')]=_0x16c4fc[_0xed7c('0x29')][_0xed7c('0x32')]['isFallback'];_0x183874['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x16c4fc[_0xed7c('0x29')][_0xed7c('0x35')];_0x183874[_0xed7c('0xf')][_0xed7c('0x36')]=_0x16c4fc[_0xed7c('0x29')][_0xed7c('0x37')];_0x183874[_0xed7c('0xf')]['DIALOGFLOWV2_SCORE']=_0x16c4fc['queryResult'][_0xed7c('0x38')];_0x2b0c33[_0xed7c('0x39')]=_0xed7c('0x3a');_0x2b0c33['providerResponse']=JSON['stringify'](_0x1a35a6);var _0xe540ff=[];for(var _0x966ac6=0x0;_0x966ac6<_0x1a35a6['length'];_0x966ac6++){var _0x376393=_0x1a35a6[_0x966ac6];if(_0x376393&&_0x376393['queryResult']&&_0x376393[_0xed7c('0x29')][_0xed7c('0x3b')]){_0xe540ff['push'](createMessage(_0x24a769,_0x2f3d6b,_0x2b0c33,_0x376393[_0xed7c('0x29')]['fulfillmentText']));}}return Promise[_0xed7c('0x3c')](_0xe540ff)[_0xed7c('0xc')](function(){if(_0xbae85b){_0x4c6bb8[_0xed7c('0x12')]();}else{_0x4c6bb8['stop']();}})[_0xed7c('0x1e')](function(_0x84278c){logger[_0xed7c('0x3d')](_0xed7c('0xe'),_0x24a769,JSON[_0xed7c('0x1f')](_0x84278c));_0x4c6bb8[_0xed7c('0x12')]();});}})[_0xed7c('0x1e')](function(_0x17ae37){logger[_0xed7c('0x3d')](_0xed7c('0xe'),_0x24a769,_0x17ae37[_0xed7c('0x3e')]);_0x4c6bb8[_0xed7c('0x12')]();});}}catch(_0x506edd){logger[_0xed7c('0x3d')](_0xed7c('0xe'),_0x24a769,JSON['stringify'](_0x506edd));_0x4c6bb8['stop']();}};};
\ No newline at end of file
index 0abbbf1..adb7d62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6d7=['replace','validate','length','error','stop','condition','priorityTrue','priorityFalse','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender'];(function(_0x3931d7,_0x34c702){var _0x2ec3f3=function(_0x2c1507){while(--_0x2c1507){_0x3931d7['push'](_0x3931d7['shift']());}};_0x2ec3f3(++_0x34c702);}(_0xe6d7,0x1dc));var _0x7e6d=function(_0x2815b3,_0x5e085a){_0x2815b3=_0x2815b3-0x0;var _0x4c6510=_0xe6d7[_0x2815b3];return _0x4c6510;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x7e6d('0x0'));var utils=require(_0x7e6d('0x1'));var logger=require(_0x7e6d('0x2'))(_0x7e6d('0x3'));var gotoif=schema({'condition':{'type':_0x7e6d('0x4'),'required':!![],'message':_0x7e6d('0x5')},'priorityTrue':{'type':_0x7e6d('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x7e6d('0x6'),'message':_0x7e6d('0x7')}});exports[_0x7e6d('0x8')]=function(_0x2cd182,_0x33dc8c){return function(_0x6bf8d1){try{var _0x38ae57={'condition':htmlToText['fromString'](utils[_0x7e6d('0x9')](_0x33dc8c[0x0],this),{'wordwrap':![]})[_0x7e6d('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x33dc8c[0x1],'priorityFalse':_0x33dc8c[0x2]};var _0x50f36e=gotoif[_0x7e6d('0xb')](_0x38ae57,{'typecast':!![]});if(_0x50f36e[_0x7e6d('0xc')]){logger[_0x7e6d('0xd')]('[%s][GOTOIF]\x20%s',_0x2cd182,_['map'](_0x50f36e,'message')['join'](',\x20'));_0x6bf8d1[_0x7e6d('0xe')]();}else{try{var _0x534104=eval('('+_0x38ae57[_0x7e6d('0xf')]+')');var _0xfcb9ef=_0x534104?_0x38ae57[_0x7e6d('0x10')]:_0x38ae57[_0x7e6d('0x11')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2cd182,_0x38ae57[_0x7e6d('0xf')],_0x534104,_0xfcb9ef||_0x7e6d('0x12'));if(_0xfcb9ef){var _0x149ef8=_[_0x7e6d('0x13')](_0x6bf8d1[_0x7e6d('0x14')](),{'p':_0xfcb9ef});if(_0x149ef8>=0x0){logger[_0x7e6d('0x15')](_0x7e6d('0x16'),_0x2cd182,_0xfcb9ef||_0x7e6d('0x12'),_0x149ef8);_0x6bf8d1[_0x7e6d('0x12')](_0x149ef8);}else{logger[_0x7e6d('0x15')](_0x7e6d('0x17'),_0x2cd182,_0xfcb9ef||_0x7e6d('0x12'));_0x6bf8d1[_0x7e6d('0xe')]();}}else{_0x6bf8d1['next']();}}catch(_0x367cf8){logger['error'](_0x7e6d('0x18'),_0x2cd182,_0x367cf8[_0x7e6d('0x19')]);_0x6bf8d1[_0x7e6d('0xe')]();}}}catch(_0x10563d){logger[_0x7e6d('0xd')](_0x7e6d('0x1a'),_0x2cd182,JSON['stringify'](_0x10563d));_0x6bf8d1['stop']();}};};
\ No newline at end of file
+var _0x9c3b=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','map','join','priorityFalse','info','condition','findIndex','rules'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0x9c3b,0x77));var _0xb9c3=function(_0x34ab65,_0x356d84){_0x34ab65=_0x34ab65-0x0;var _0x31532c=_0x9c3b[_0x34ab65];return _0x31532c;};'use strict';var schema=require(_0xb9c3('0x0'));var _=require(_0xb9c3('0x1'));var htmlToText=require(_0xb9c3('0x2'));var utils=require(_0xb9c3('0x3'));var logger=require(_0xb9c3('0x4'))('routing');var gotoif=schema({'condition':{'type':_0xb9c3('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0xb9c3('0x6')},'priorityFalse':{'type':_0xb9c3('0x7'),'message':_0xb9c3('0x8')}});exports[_0xb9c3('0x9')]=function(_0x3ab676,_0x1c11e0){return function(_0x485001){try{var _0x410317={'condition':htmlToText[_0xb9c3('0xa')](utils[_0xb9c3('0xb')](_0x1c11e0[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1c11e0[0x1],'priorityFalse':_0x1c11e0[0x2]};var _0x55cc3f=gotoif[_0xb9c3('0x0')](_0x410317,{'typecast':!![]});if(_0x55cc3f[_0xb9c3('0xc')]){logger[_0xb9c3('0xd')]('[%s][GOTOIF]\x20%s',_0x3ab676,_[_0xb9c3('0xe')](_0x55cc3f,'message')[_0xb9c3('0xf')](',\x20'));_0x485001['stop']();}else{try{var _0x2f6a20=eval('('+_0x410317['condition']+')');var _0x27c268=_0x2f6a20?_0x410317['priorityTrue']:_0x410317[_0xb9c3('0x10')];logger[_0xb9c3('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x3ab676,_0x410317[_0xb9c3('0x12')],_0x2f6a20,_0x27c268||'next');if(_0x27c268){var _0x13bbe7=_[_0xb9c3('0x13')](_0x485001[_0xb9c3('0x14')](),{'p':_0x27c268});if(_0x13bbe7>=0x0){logger[_0xb9c3('0x11')](_0xb9c3('0x15'),_0x3ab676,_0x27c268||'next',_0x13bbe7);_0x485001[_0xb9c3('0x16')](_0x13bbe7);}else{logger[_0xb9c3('0x11')](_0xb9c3('0x17'),_0x3ab676,_0x27c268||_0xb9c3('0x16'));_0x485001[_0xb9c3('0x18')]();}}else{_0x485001['next']();}}catch(_0x385e53){logger[_0xb9c3('0xd')](_0xb9c3('0x19'),_0x3ab676,_0x385e53['message']);_0x485001['stop']();}}}catch(_0x30f452){logger[_0xb9c3('0xd')](_0xb9c3('0x1a'),_0x3ab676,JSON[_0xb9c3('0x1b')](_0x30f452));_0x485001[_0xb9c3('0x18')]();}};};
\ No newline at end of file
index 221b9c3..4093cf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a5b=['[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','error'];(function(_0x3b1a8a,_0x3c4177){var _0x4f8b9e=function(_0x128031){while(--_0x128031){_0x3b1a8a['push'](_0x3b1a8a['shift']());}};_0x4f8b9e(++_0x3c4177);}(_0x0a5b,0x15d));var _0xb0a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a5b[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require('validate');var _=require(_0xb0a5('0x0'));var logger=require(_0xb0a5('0x1'))(_0xb0a5('0x2'));var gotop=schema({'priority':{'type':_0xb0a5('0x3'),'required':!![],'message':_0xb0a5('0x4')}});exports[_0xb0a5('0x5')]=function(_0x257c43,_0xcaeede){return function(_0x5b6a4f){try{var _0x3de35e={'priority':_0xcaeede[0x0]};var _0x39a943=gotop[_0xb0a5('0x6')](_0x3de35e,{'typecast':!![]});if(_0x39a943['length']){logger[_0xb0a5('0x7')](_0xb0a5('0x8'),_0x257c43,_[_0xb0a5('0x9')](_0x39a943,_0xb0a5('0xa'))['join'](',\x20'));_0x5b6a4f[_0xb0a5('0xb')]();}else{logger[_0xb0a5('0xc')](_0xb0a5('0xd'),_0x257c43,_0x3de35e[_0xb0a5('0xe')]);if(_0x3de35e[_0xb0a5('0xe')]){var _0x66b077=_[_0xb0a5('0xf')](_0x5b6a4f[_0xb0a5('0x10')](),{'p':_0x3de35e[_0xb0a5('0xe')]});if(_0x66b077>=0x0){logger[_0xb0a5('0xc')](_0xb0a5('0x11'),_0x257c43,_0x3de35e['priority']||'next',_0x66b077);_0x5b6a4f[_0xb0a5('0x12')](_0x66b077);}else{logger[_0xb0a5('0xc')](_0xb0a5('0x13'),_0x257c43,_0x3de35e[_0xb0a5('0xe')]||_0xb0a5('0x12'));_0x5b6a4f[_0xb0a5('0xb')]();}}else{_0x5b6a4f['next']();}}}catch(_0x14e2d1){logger[_0xb0a5('0x7')](_0xb0a5('0x8'),_0x257c43,JSON[_0xb0a5('0x14')](_0x14e2d1));_0x5b6a4f['stop']();}};};
\ No newline at end of file
+var _0xa2e9=['length','error','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number'];(function(_0x2cbff5,_0x4a9277){var _0x5a0e5d=function(_0xea3337){while(--_0xea3337){_0x2cbff5['push'](_0x2cbff5['shift']());}};_0x5a0e5d(++_0x4a9277);}(_0xa2e9,0x1b0));var _0x9a2e=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xa2e9[_0x56e4e7];return _0x383618;};'use strict';var schema=require(_0x9a2e('0x0'));var _=require(_0x9a2e('0x1'));var logger=require(_0x9a2e('0x2'))(_0x9a2e('0x3'));var gotop=schema({'priority':{'type':_0x9a2e('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x4d4a8f,_0x53b083){return function(_0x4760eb){try{var _0x53898a={'priority':_0x53b083[0x0]};var _0x2ca23d=gotop[_0x9a2e('0x0')](_0x53898a,{'typecast':!![]});if(_0x2ca23d[_0x9a2e('0x5')]){logger[_0x9a2e('0x6')](_0x9a2e('0x7'),_0x4d4a8f,_[_0x9a2e('0x8')](_0x2ca23d,'message')[_0x9a2e('0x9')](',\x20'));_0x4760eb['stop']();}else{logger[_0x9a2e('0xa')](_0x9a2e('0xb'),_0x4d4a8f,_0x53898a[_0x9a2e('0xc')]);if(_0x53898a[_0x9a2e('0xc')]){var _0x12b197=_[_0x9a2e('0xd')](_0x4760eb[_0x9a2e('0xe')](),{'p':_0x53898a['priority']});if(_0x12b197>=0x0){logger[_0x9a2e('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4d4a8f,_0x53898a[_0x9a2e('0xc')]||'next',_0x12b197);_0x4760eb[_0x9a2e('0xf')](_0x12b197);}else{logger[_0x9a2e('0xa')](_0x9a2e('0x10'),_0x4d4a8f,_0x53898a['priority']||_0x9a2e('0xf'));_0x4760eb[_0x9a2e('0x11')]();}}else{_0x4760eb[_0x9a2e('0xf')]();}}}catch(_0x136537){logger[_0x9a2e('0x6')](_0x9a2e('0x7'),_0x4d4a8f,JSON[_0x9a2e('0x12')](_0x136537));_0x4760eb[_0x9a2e('0x11')]();}};};
\ No newline at end of file
index 6276011..8399494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ee=['getMustacheRender','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','next','error','stringify','stop','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x384a78,_0x5ba914){var _0xf4933b=function(_0x550e1c){while(--_0x550e1c){_0x384a78['push'](_0x384a78['shift']());}};_0xf4933b(++_0x5ba914);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0xe36e('0x0'))('routing');var rpc={'chatMessage':require(_0xe36e('0x1')),'openchannelMessage':require(_0xe36e('0x2')),'mailMessage':require(_0xe36e('0x3')),'smsMessage':require(_0xe36e('0x4')),'faxMessage':require(_0xe36e('0x5')),'whatsappMessage':require(_0xe36e('0x6'))};exports[_0xe36e('0x7')]=function(_0x3f29e1,_0x25a07d){return function(_0x190404){try{var _0x21be0b={'body':utils[_0xe36e('0x8')](_0x25a07d[0x0],this),'ContactId':this['contact']['id']};if(this[_0xe36e('0x9')]==='chat'){_0x21be0b[_0xe36e('0xa')]=this[_0xe36e('0xb')]['id'];}else{_0x21be0b[_[_0xe36e('0xc')](this['channel'])+_0xe36e('0xd')]=this['account']['id'];}_0x21be0b[_[_0xe36e('0xc')](this[_0xe36e('0x9')])+_0xe36e('0xe')]=this[_0xe36e('0xf')]['id'];if(rpc[this[_0xe36e('0x9')]+_0xe36e('0x10')]){return rpc[this[_0xe36e('0x9')]+_0xe36e('0x10')]['create'](_0x21be0b)[_0xe36e('0x11')](function(_0x27841e){logger[_0xe36e('0x12')](_0xe36e('0x13'),_0x3f29e1,_0x21be0b['body']);_0x190404[_0xe36e('0x14')]();})['catch'](function(_0x525155){logger[_0xe36e('0x15')](_0xe36e('0x13'),_0x3f29e1,JSON[_0xe36e('0x16')](_0x525155));_0x190404[_0xe36e('0x17')]();});}}catch(_0xd6828e){logger[_0xe36e('0x15')](_0xe36e('0x13'),_0x3f29e1,JSON[_0xe36e('0x16')](_0xd6828e));_0x190404[_0xe36e('0x17')]();}};};
\ No newline at end of file
+var _0xe7e8=['[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','ChatWebsiteId','account','AccountId','interaction','Message','create'];(function(_0x5a2601,_0x3fd7d1){var _0x27ab50=function(_0x53f6ca){while(--_0x53f6ca){_0x5a2601['push'](_0x5a2601['shift']());}};_0x27ab50(++_0x3fd7d1);}(_0xe7e8,0xe3));var _0x8e7e=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xe7e8[_0x277721];return _0x286051;};'use strict';var _=require('lodash');var utils=require(_0x8e7e('0x0'));var logger=require(_0x8e7e('0x1'))(_0x8e7e('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8e7e('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8e7e('0x4')),'whatsappMessage':require(_0x8e7e('0x5'))};exports[_0x8e7e('0x6')]=function(_0x6227b9,_0x2ff8db){return function(_0x11183f){try{var _0x11cdd0={'body':utils[_0x8e7e('0x7')](_0x2ff8db[0x0],this),'ContactId':this['contact']['id']};if(this[_0x8e7e('0x8')]==='chat'){_0x11cdd0[_0x8e7e('0x9')]=this[_0x8e7e('0xa')]['id'];}else{_0x11cdd0[_['upperFirst'](this[_0x8e7e('0x8')])+_0x8e7e('0xb')]=this[_0x8e7e('0xa')]['id'];}_0x11cdd0[_['upperFirst'](this[_0x8e7e('0x8')])+'InteractionId']=this[_0x8e7e('0xc')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x8e7e('0x8')]+_0x8e7e('0xd')][_0x8e7e('0xe')](_0x11cdd0)['then'](function(_0x31aec8){logger['info'](_0x8e7e('0xf'),_0x6227b9,_0x11cdd0[_0x8e7e('0x10')]);_0x11183f[_0x8e7e('0x11')]();})[_0x8e7e('0x12')](function(_0x56c596){logger[_0x8e7e('0x13')]('[%s][MESSAGE]\x20%s',_0x6227b9,JSON[_0x8e7e('0x14')](_0x56c596));_0x11183f[_0x8e7e('0x15')]();});}}catch(_0x377c83){logger[_0x8e7e('0x13')](_0x8e7e('0xf'),_0x6227b9,JSON[_0x8e7e('0x14')](_0x377c83));_0x11183f['stop']();}};};
\ No newline at end of file
index 58c19d5..a518aff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16e6=['../../../../config/logger','routing','info','[%s][NOOP]\x20%s','error','stop'];(function(_0x12baef,_0x353849){var _0x11914f=function(_0x356a90){while(--_0x356a90){_0x12baef['push'](_0x12baef['shift']());}};_0x11914f(++_0x353849);}(_0x16e6,0x10e));var _0x616e=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x16e6[_0x2850c0];return _0x21e830;};'use strict';var utils=require('./utils');var logger=require(_0x616e('0x0'))(_0x616e('0x1'));exports['consequence']=function(_0x51dc43,_0x265250){return function(_0x175987){try{logger[_0x616e('0x2')](_0x616e('0x3'),_0x51dc43,utils['getMustacheRender'](_0x265250[0x0],this));_0x175987['next']();}catch(_0x46d3bd){logger[_0x616e('0x4')](_0x616e('0x3'),_0x51dc43,JSON['stringify'](_0x46d3bd));_0x175987[_0x616e('0x5')]();}};};
\ No newline at end of file
+var _0xd61b=['./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stop'];(function(_0xe03ab4,_0x4e2a7c){var _0x1a0b54=function(_0x4e27ed){while(--_0x4e27ed){_0xe03ab4['push'](_0xe03ab4['shift']());}};_0x1a0b54(++_0x4e2a7c);}(_0xd61b,0xbd));var _0xbd61=function(_0x1d6dfb,_0x2d08e5){_0x1d6dfb=_0x1d6dfb-0x0;var _0x1a8fbb=_0xd61b[_0x1d6dfb];return _0x1a8fbb;};'use strict';var utils=require(_0xbd61('0x0'));var logger=require(_0xbd61('0x1'))('routing');exports[_0xbd61('0x2')]=function(_0xd76d63,_0x2e8a77){return function(_0x9a0d71){try{logger[_0xbd61('0x3')](_0xbd61('0x4'),_0xd76d63,utils[_0xbd61('0x5')](_0x2e8a77[0x0],this));_0x9a0d71[_0xbd61('0x6')]();}catch(_0x2c7dd6){logger[_0xbd61('0x7')](_0xbd61('0x4'),_0xd76d63,JSON['stringify'](_0x2c7dd6));_0x9a0d71[_0xbd61('0x8')]();}};};
\ No newline at end of file
index b8540ad..351c967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6efa=['validate','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','stop','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','localhost','redis','queue_id','account','queue','from','joinAt','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','interaction','upperFirst','channel','MessageId','message','chat','info','name','QueueReport','create','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x6efa,0x1f0));var _0xa6ef=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6efa[_0x20a584];return _0x4b41a8;};'use strict';var schema=require('validate');var _=require(_0xa6ef('0x0'));var util=require(_0xa6ef('0x1'));var seqqueue=require(_0xa6ef('0x2'));var moment=require(_0xa6ef('0x3'));var Redis=require('ioredis');var config=require(_0xa6ef('0x4'));var logger=require(_0xa6ef('0x5'))(_0xa6ef('0x6'));var strategy=require(_0xa6ef('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0xa6ef('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa6ef('0x9')]));var attributes=['id',_0xa6ef('0xa'),_0xa6ef('0xb'),_0xa6ef('0xc'),_0xa6ef('0xd'),_0xa6ef('0xe')];function emit(_0x354573,_0x5c2108,_0x3e7666){io['to'](_0x354573)['emit'](_0x5c2108,_0x3e7666);}function emitChannelQueueInteraction(_0x1769ab,_0x13619e,_0x16deea,_0x5058b8,_0x52e84c,_0x23daf9,_0x265dad,_0x3ace96){var _0x273966=_[_0xa6ef('0xf')](_0x16deea);_0x273966[_0xa6ef('0xa')]=_0x3ace96;_0x273966[_0xa6ef('0xc')]=_0x13619e;_0x273966[_0xa6ef('0xb')]=_0x5058b8;_0x273966['id']=_0x52e84c;if(_0x23daf9){_0x265dad[util[_0xa6ef('0x10')](_0xa6ef('0x11'),_0x1769ab)][_0x52e84c]=_[_0xa6ef('0x12')](_0x273966,attributes);}else{delete _0x265dad[util[_0xa6ef('0x10')](_0xa6ef('0x11'),_0x1769ab)][_0x52e84c];}emit(util[_0xa6ef('0x10')](_0xa6ef('0x13'),_0x1769ab,_0x13619e),util['format'](_0xa6ef('0x14'),_0x1769ab,_0x23daf9?_0xa6ef('0x15'):_0xa6ef('0x16')),_['pick'](_0x273966,attributes));}var rpc={'openchannelQueueReport':require(_0xa6ef('0x17')),'mailQueueReport':require(_0xa6ef('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xa6ef('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa6ef('0x1a'))};var queue=schema({'name':{'type':_0xa6ef('0x1b'),'required':!![],'message':_0xa6ef('0x1c')},'timeout':{'type':_0xa6ef('0x1d'),'message':_0xa6ef('0x1e')}});function startRouting(_0x572d93,_0x2ff5df,_0x3158e1,_0x789ce0){if(_0x572d93&&_0x2ff5df&&_0x3158e1){_0x2ff5df[_0xa6ef('0x1f')]+=0x1;var _0x2f6340={'uniqueid':_0x572d93,'from':_0x3158e1[_0xa6ef('0x20')]?_0x3158e1[_0xa6ef('0x20')]['from']:'','joinAt':moment()['format'](_0xa6ef('0x21')),'ContactId':_0x3158e1['contact']?_0x3158e1[_0xa6ef('0x22')]['id']:null,'ListId':_0x3158e1[_0xa6ef('0x23')]?_0x3158e1[_0xa6ef('0x23')]['id']:null};_0x2f6340[_['upperFirst'](_0x3158e1['channel'])+_0xa6ef('0x24')]=_0x2ff5df['id']||null;_0x2f6340[_['upperFirst'](_0x3158e1['channel'])+'InteractionId']=_0x3158e1['interaction']?_0x3158e1[_0xa6ef('0x25')]['id']:null;_0x2f6340[_[_0xa6ef('0x26')](_0x3158e1[_0xa6ef('0x27')])+_0xa6ef('0x28')]=_0x3158e1[_0xa6ef('0x29')]?_0x3158e1[_0xa6ef('0x29')]['id']:null;_0x2f6340[_[_0xa6ef('0x26')](_0x3158e1[_0xa6ef('0x27')])+(_0x3158e1[_0xa6ef('0x27')]!==_0xa6ef('0x2a')?'AccountId':'WebsiteId')]=_0x3158e1[_0xa6ef('0xb')]?_0x3158e1[_0xa6ef('0xb')]['id']:null;logger[_0xa6ef('0x2b')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x572d93,_0x2ff5df['name']));emitChannelQueueInteraction(_0x3158e1[_0xa6ef('0x27')],_0x2ff5df[_0xa6ef('0x2c')],_0x2f6340,_0x3158e1[_0xa6ef('0xb')][_0xa6ef('0x2c')],_0x3158e1[_0xa6ef('0x29')]['id'],!![],_0x789ce0,_0x2ff5df['id']);if(rpc[_0x3158e1['channel']+_0xa6ef('0x2d')]){return rpc[_0x3158e1['channel']+_0xa6ef('0x2d')][_0xa6ef('0x2e')](_0x2f6340)['catch'](function(_0x3a17f2){logger[_0xa6ef('0x2f')](_0xa6ef('0x30'));});}}}function stopRouting(_0x18c538,_0x54b4df,_0x392174,_0x4f0904){if(_0x18c538&&_0x54b4df){_0x54b4df['waiting']-=0x1;var _0x16f418={'leaveAt':moment()['format'](_0xa6ef('0x21')),'acceptAt':moment()[_0xa6ef('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0xa6ef('0x2b')](util[_0xa6ef('0x10')](_0xa6ef('0x31'),_0x18c538,_0x54b4df[_0xa6ef('0x2c')]));emitChannelQueueInteraction(_0x392174[_0xa6ef('0x27')],_0x54b4df['name'],_0x392174[_0xa6ef('0x20')],_0x392174[_0xa6ef('0xb')][_0xa6ef('0x2c')],_0x392174['message']['id'],![],_0x4f0904,_0x54b4df['id']);if(rpc[_0x392174['channel']+_0xa6ef('0x2d')]){return rpc[_0x392174['channel']+_0xa6ef('0x2d')]['update'](_0x18c538,_0x16f418)[_0xa6ef('0x32')](function(_0x2d0a3f){logger[_0xa6ef('0x2f')](_0xa6ef('0x33'));});}}}function endRouting(_0x40a4c9,_0x575504,_0x2b9cae,_0xb55f82){if(_0x40a4c9&&_0x575504){_0x575504[_0xa6ef('0x1f')]-=0x1;var _0x128575={'leaveAt':moment()[_0xa6ef('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xa6ef('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa6ef('0x34')};logger[_0xa6ef('0x2b')](util[_0xa6ef('0x10')](_0xa6ef('0x35'),_0x40a4c9,_0x575504[_0xa6ef('0x2c')]));emitChannelQueueInteraction(_0x2b9cae[_0xa6ef('0x27')],_0x575504[_0xa6ef('0x2c')],_0x2b9cae['body'],_0x2b9cae[_0xa6ef('0xb')]['name'],_0x2b9cae[_0xa6ef('0x29')]['id'],![],_0xb55f82);if(rpc[_0x2b9cae['channel']+_0xa6ef('0x2d')]){return rpc[_0x2b9cae[_0xa6ef('0x27')]+_0xa6ef('0x2d')][_0xa6ef('0x36')](_0x40a4c9,_0x128575)[_0xa6ef('0x32')](function(_0x4af2f8){logger[_0xa6ef('0x2f')](_0xa6ef('0x33'));});}}}function handleFindQueue(_0x1b437b){return function(_0x28c0cd){return _0x28c0cd[_0xa6ef('0x2c')][_0xa6ef('0x37')]()===_0x1b437b[_0xa6ef('0x37')]();};}exports[_0xa6ef('0x38')]=function(_0x5967d3,_0x2d10af,_0x337dd3,_0x473a0b){return function(_0x12596c){try{var _0x1ecffc={'name':_0x2d10af[0x0],'timeout':_0x2d10af[0x1]};var _0x19c437=queue[_0xa6ef('0x39')](_0x1ecffc,{'typecast':!![]});if(_0x19c437[_0xa6ef('0x3a')]){logger['error'](_0xa6ef('0x3b'),_0x5967d3,_[_0xa6ef('0x3c')](_0x19c437,_0xa6ef('0x29'))[_0xa6ef('0x3d')](',\x20'));_0x12596c['stop']();}else{var _0xb8f4d7=_[_0xa6ef('0x3e')](_0x337dd3[_0x473a0b['channel']+_0xa6ef('0x3f')],handleFindQueue(_0x1ecffc[_0xa6ef('0x2c')]));if(_0xb8f4d7){startRouting(_0x5967d3,_0xb8f4d7,_0x473a0b,_0x337dd3);var _0x2915aa=(_0xb8f4d7[_0xa6ef('0x34')]||0xa)*0x3e8;var _0x4d08ac=(_0x1ecffc[_0xa6ef('0x34')]||0x14)*0x3e8;var _0x2df148,_0x3c5c1a;if(_0x2915aa>_0x4d08ac){_0x4d08ac=_0x2915aa;}var _0x1d6aa1=seqqueue[_0xa6ef('0x40')](_0x2915aa);_0x1d6aa1['id']=_0x5967d3;_0x1d6aa1['atimeout']=_0x2915aa;_0x1d6aa1[_0xa6ef('0x41')]=_0x4d08ac;_0x1d6aa1[_0xa6ef('0x27')]=_0x473a0b[_0xa6ef('0x27')];_0x337dd3['rules'][_0x5967d3]['on'](_0xa6ef('0x42'),function(){logger[_0xa6ef('0x2b')](_0xa6ef('0x43'),_0x5967d3);stopRouting(_0x5967d3,_0xb8f4d7,_0x473a0b,_0x337dd3);clearTimeout(_0x2df148);_0x2df148=undefined;_0x1d6aa1[_0xa6ef('0x44')](!![]);if(_0x337dd3[_0xa6ef('0x45')][_0x5967d3]){delete _0x337dd3[_0xa6ef('0x45')][_0x5967d3];}_0x12596c['stop']();});_0x337dd3[_0xa6ef('0x45')][_0x5967d3]['on'](_0xa6ef('0x46'),function(){if(_0x337dd3[_0xa6ef('0x45')][_0x5967d3]){delete _0x337dd3[_0xa6ef('0x45')][_0x5967d3];}});_0x2df148=setTimeout(function(){logger[_0xa6ef('0x2b')](_0xa6ef('0x47'),_0x5967d3);endRouting(_0x5967d3,_0xb8f4d7,_0x473a0b,_0x337dd3);clearTimeout(_0x2df148);_0x1d6aa1['close'](!![]);_0x12596c['next']();},_0x4d08ac);switch(_0xb8f4d7[_0xa6ef('0x48')]){case _0xa6ef('0x49'):strategy[_0xa6ef('0x49')](_0x1d6aa1,_0xb8f4d7,_0x337dd3,_0x473a0b);break;default:strategy[_0xa6ef('0x4a')](_0x1d6aa1,_0xb8f4d7,_0x337dd3,_0x473a0b);}}else{logger['error'](_0xa6ef('0x4b'),_0x5967d3,_0x1ecffc[_0xa6ef('0x2c')]);_0x12596c['stop']();}}}catch(_0x3f2ab3){console[_0xa6ef('0x4c')](_0x3f2ab3);logger['error']('[%s][QUEUE]\x20%s',_0x5967d3,_0x3f2ab3[_0xa6ef('0x4d')]);_0x12596c[_0xa6ef('0x4e')]();}};};
\ No newline at end of file
+var _0xe66d=['number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','interaction','MessageId','message','channel','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','consequence','[%s][QUEUE]\x20%s','map','stop','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','defaults','localhost','socket.io-emitter','redis','account','from','emit','clone','pick','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string'];(function(_0x5650cf,_0x2b8f11){var _0x460b10=function(_0x1091bc){while(--_0x1091bc){_0x5650cf['push'](_0x5650cf['shift']());}};_0x460b10(++_0x2b8f11);}(_0xe66d,0x14b));var _0xde66=function(_0x203387,_0x25ee77){_0x203387=_0x203387-0x0;var _0x358e6b=_0xe66d[_0x203387];return _0x358e6b;};'use strict';var schema=require(_0xde66('0x0'));var _=require(_0xde66('0x1'));var util=require('util');var seqqueue=require(_0xde66('0x2'));var moment=require(_0xde66('0x3'));var Redis=require(_0xde66('0x4'));var config=require(_0xde66('0x5'));var logger=require(_0xde66('0x6'))(_0xde66('0x7'));var strategy=require('./strategy');config['redis']=_[_0xde66('0x8')](config['redis'],{'host':_0xde66('0x9'),'port':0x18eb});var io=require(_0xde66('0xa'))(new Redis(config[_0xde66('0xb')]));var attributes=['id','queue_id',_0xde66('0xc'),'queue',_0xde66('0xd'),'joinAt'];function emit(_0x5d59ae,_0x478f30,_0x24996c){io['to'](_0x5d59ae)[_0xde66('0xe')](_0x478f30,_0x24996c);}function emitChannelQueueInteraction(_0x451f31,_0x36fbdf,_0x4359c6,_0x2abb32,_0xda12fd,_0x495777,_0x42bb45,_0x16befc){var _0x29db54=_[_0xde66('0xf')](_0x4359c6);_0x29db54['queue_id']=_0x16befc;_0x29db54['queue']=_0x36fbdf;_0x29db54[_0xde66('0xc')]=_0x2abb32;_0x29db54['id']=_0xda12fd;if(_0x495777){_0x42bb45[util['format']('%sQueuesWaitingInteractions',_0x451f31)][_0xda12fd]=_[_0xde66('0x10')](_0x29db54,attributes);}else{delete _0x42bb45[util[_0xde66('0x11')](_0xde66('0x12'),_0x451f31)][_0xda12fd];}emit(util[_0xde66('0x11')](_0xde66('0x13'),_0x451f31,_0x36fbdf),util['format'](_0xde66('0x14'),_0x451f31,_0x495777?_0xde66('0x15'):_0xde66('0x16')),_[_0xde66('0x10')](_0x29db54,attributes));}var rpc={'openchannelQueueReport':require(_0xde66('0x17')),'mailQueueReport':require(_0xde66('0x18')),'chatQueueReport':require(_0xde66('0x19')),'smsQueueReport':require(_0xde66('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xde66('0x1b'))};var queue=schema({'name':{'type':_0xde66('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xde66('0x1d'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x23b55e,_0xf41bb4,_0x511eb8,_0x1358b9){if(_0x23b55e&&_0xf41bb4&&_0x511eb8){_0xf41bb4[_0xde66('0x1e')]+=0x1;var _0x2d7c52={'uniqueid':_0x23b55e,'from':_0x511eb8[_0xde66('0x1f')]?_0x511eb8[_0xde66('0x1f')][_0xde66('0xd')]:'','joinAt':moment()[_0xde66('0x11')](_0xde66('0x20')),'ContactId':_0x511eb8['contact']?_0x511eb8[_0xde66('0x21')]['id']:null,'ListId':_0x511eb8['list']?_0x511eb8[_0xde66('0x22')]['id']:null};_0x2d7c52[_[_0xde66('0x23')](_0x511eb8['channel'])+_0xde66('0x24')]=_0xf41bb4['id']||null;_0x2d7c52[_[_0xde66('0x23')](_0x511eb8['channel'])+'InteractionId']=_0x511eb8[_0xde66('0x25')]?_0x511eb8[_0xde66('0x25')]['id']:null;_0x2d7c52[_[_0xde66('0x23')](_0x511eb8['channel'])+_0xde66('0x26')]=_0x511eb8[_0xde66('0x27')]?_0x511eb8['message']['id']:null;_0x2d7c52[_[_0xde66('0x23')](_0x511eb8[_0xde66('0x28')])+(_0x511eb8[_0xde66('0x28')]!=='chat'?_0xde66('0x29'):_0xde66('0x2a'))]=_0x511eb8[_0xde66('0xc')]?_0x511eb8[_0xde66('0xc')]['id']:null;logger[_0xde66('0x2b')](util[_0xde66('0x11')](_0xde66('0x2c'),_0x23b55e,_0xf41bb4[_0xde66('0x2d')]));emitChannelQueueInteraction(_0x511eb8[_0xde66('0x28')],_0xf41bb4[_0xde66('0x2d')],_0x2d7c52,_0x511eb8[_0xde66('0xc')][_0xde66('0x2d')],_0x511eb8[_0xde66('0x27')]['id'],!![],_0x1358b9,_0xf41bb4['id']);if(rpc[_0x511eb8[_0xde66('0x28')]+_0xde66('0x2e')]){return rpc[_0x511eb8[_0xde66('0x28')]+'QueueReport']['create'](_0x2d7c52)[_0xde66('0x2f')](function(_0x466a65){logger[_0xde66('0x30')](_0xde66('0x31'));});}}}function stopRouting(_0x2834c6,_0x1e8b3c,_0x15b1c0,_0x136745){if(_0x2834c6&&_0x1e8b3c){_0x1e8b3c[_0xde66('0x1e')]-=0x1;var _0x58d030={'leaveAt':moment()['format'](_0xde66('0x20')),'acceptAt':moment()[_0xde66('0x11')](_0xde66('0x20')),'reason':_0xde66('0x32')};logger[_0xde66('0x2b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x2834c6,_0x1e8b3c[_0xde66('0x2d')]));emitChannelQueueInteraction(_0x15b1c0[_0xde66('0x28')],_0x1e8b3c[_0xde66('0x2d')],_0x15b1c0[_0xde66('0x1f')],_0x15b1c0[_0xde66('0xc')][_0xde66('0x2d')],_0x15b1c0[_0xde66('0x27')]['id'],![],_0x136745,_0x1e8b3c['id']);if(rpc[_0x15b1c0['channel']+_0xde66('0x2e')]){return rpc[_0x15b1c0[_0xde66('0x28')]+_0xde66('0x2e')][_0xde66('0x33')](_0x2834c6,_0x58d030)[_0xde66('0x2f')](function(_0x5f201a){logger[_0xde66('0x30')](_0xde66('0x34'));});}}}function endRouting(_0x23b25b,_0x166ffb,_0xafea4,_0x41527e){if(_0x23b25b&&_0x166ffb){_0x166ffb[_0xde66('0x1e')]-=0x1;var _0x51afa3={'leaveAt':moment()[_0xde66('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xde66('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xde66('0x35')};logger[_0xde66('0x2b')](util[_0xde66('0x11')](_0xde66('0x36'),_0x23b25b,_0x166ffb[_0xde66('0x2d')]));emitChannelQueueInteraction(_0xafea4['channel'],_0x166ffb[_0xde66('0x2d')],_0xafea4[_0xde66('0x1f')],_0xafea4[_0xde66('0xc')][_0xde66('0x2d')],_0xafea4[_0xde66('0x27')]['id'],![],_0x41527e);if(rpc[_0xafea4[_0xde66('0x28')]+'QueueReport']){return rpc[_0xafea4[_0xde66('0x28')]+_0xde66('0x2e')][_0xde66('0x33')](_0x23b25b,_0x51afa3)[_0xde66('0x2f')](function(_0x5016c8){logger[_0xde66('0x30')](_0xde66('0x34'));});}}}function handleFindQueue(_0x4f71ae){return function(_0x144845){return _0x144845[_0xde66('0x2d')]['toLowerCase']()===_0x4f71ae['toLowerCase']();};}exports[_0xde66('0x37')]=function(_0x2c9483,_0x4c797e,_0x10390d,_0x44c99a){return function(_0x1c537b){try{var _0x2d9ee3={'name':_0x4c797e[0x0],'timeout':_0x4c797e[0x1]};var _0x395b6d=queue[_0xde66('0x0')](_0x2d9ee3,{'typecast':!![]});if(_0x395b6d['length']){logger[_0xde66('0x30')](_0xde66('0x38'),_0x2c9483,_[_0xde66('0x39')](_0x395b6d,_0xde66('0x27'))['join'](',\x20'));_0x1c537b[_0xde66('0x3a')]();}else{var _0x4c54c8=_['find'](_0x10390d[_0x44c99a[_0xde66('0x28')]+_0xde66('0x3b')],handleFindQueue(_0x2d9ee3[_0xde66('0x2d')]));if(_0x4c54c8){startRouting(_0x2c9483,_0x4c54c8,_0x44c99a,_0x10390d);var _0x47a9dc=(_0x4c54c8['timeout']||0xa)*0x3e8;var _0x28338c=(_0x2d9ee3[_0xde66('0x35')]||0x14)*0x3e8;var _0x6c39fb,_0x4bd4ac;if(_0x47a9dc>_0x28338c){_0x28338c=_0x47a9dc;}var _0x3e3726=seqqueue[_0xde66('0x3c')](_0x47a9dc);_0x3e3726['id']=_0x2c9483;_0x3e3726[_0xde66('0x3d')]=_0x47a9dc;_0x3e3726[_0xde66('0x3e')]=_0x28338c;_0x3e3726[_0xde66('0x28')]=_0x44c99a['channel'];_0x10390d[_0xde66('0x3f')][_0x2c9483]['on'](_0xde66('0x40'),function(){logger[_0xde66('0x2b')](_0xde66('0x41'),_0x2c9483);stopRouting(_0x2c9483,_0x4c54c8,_0x44c99a,_0x10390d);clearTimeout(_0x6c39fb);_0x6c39fb=undefined;_0x3e3726[_0xde66('0x42')](!![]);if(_0x10390d['rules'][_0x2c9483]){delete _0x10390d[_0xde66('0x3f')][_0x2c9483];}_0x1c537b[_0xde66('0x3a')]();});_0x10390d['rules'][_0x2c9483]['on'](_0xde66('0x43'),function(){if(_0x10390d[_0xde66('0x3f')][_0x2c9483]){delete _0x10390d[_0xde66('0x3f')][_0x2c9483];}});_0x6c39fb=setTimeout(function(){logger[_0xde66('0x2b')](_0xde66('0x44'),_0x2c9483);endRouting(_0x2c9483,_0x4c54c8,_0x44c99a,_0x10390d);clearTimeout(_0x6c39fb);_0x3e3726['close'](!![]);_0x1c537b['next']();},_0x28338c);switch(_0x4c54c8['strategy']){case _0xde66('0x45'):strategy['rrmemory'](_0x3e3726,_0x4c54c8,_0x10390d,_0x44c99a);break;default:strategy['beepall'](_0x3e3726,_0x4c54c8,_0x10390d,_0x44c99a);}}else{logger[_0xde66('0x30')](_0xde66('0x46'),_0x2c9483,_0x2d9ee3[_0xde66('0x2d')]);_0x1c537b['stop']();}}}catch(_0x45c8d5){console[_0xde66('0x47')](_0x45c8d5);logger[_0xde66('0x30')](_0xde66('0x38'),_0x2c9483,_0x45c8d5['stack']);_0x1c537b['stop']();}};};
\ No newline at end of file
index 8ed8b7d..0dcda22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaba8=['handleTimeout','timeout','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','push','forcedOwnership','channel','busy','busyQueue','showNotification','notificationId','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','./util','agent','realtime','routing','squeue','bind'];(function(_0x5580bc,_0x3c2504){var _0x38c8c0=function(_0x37ad09){while(--_0x37ad09){_0x5580bc['push'](_0x5580bc['shift']());}};_0x38c8c0(++_0x3c2504);}(_0xaba8,0x6e));var _0x8aba=function(_0x537bed,_0x4abbd0){_0x537bed=_0x537bed-0x0;var _0x54d04a=_0xaba8[_0x537bed];return _0x54d04a;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x8aba('0x0'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x382fcc,_0x2403af,_0x3da0cc,_0x342b4e){this['notificationId']=uuid['v4']();this['squeue']=_0x382fcc;this[_0x8aba('0x1')]=_0x2403af;this[_0x8aba('0x2')]=_0x3da0cc;this[_0x8aba('0x3')]=_0x342b4e;this[_0x8aba('0x4')]['push'](this['handleRun'][_0x8aba('0x5')](this),this[_0x8aba('0x6')]['bind'](this));this['squeue']['on'](_0x8aba('0x7'),this[_0x8aba('0x6')][_0x8aba('0x5')](this));this[_0x8aba('0x4')]['on']('drained',this[_0x8aba('0x8')][_0x8aba('0x5')](this));};Agent[_0x8aba('0x9')]['push']=function(){this[_0x8aba('0x4')]['push'](this[_0x8aba('0xa')]['bind'](this),this[_0x8aba('0x6')]['bind'](this));};Agent['prototype'][_0x8aba('0x8')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x8aba('0xa')]=function(_0x1a415){logger[_0x8aba('0xb')](_0x8aba('0xc'),this['squeue']['id'],this['agent']['id']);if(_[_0x8aba('0xd')](this[_0x8aba('0x2')][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']])){logger[_0x8aba('0xb')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x8aba('0x4')]['id'],this[_0x8aba('0x1')]['id']);setTimeout(this[_0x8aba('0xf')][_0x8aba('0x5')](this),0x3e8);}else{if(this['routing'][_0x8aba('0x10')]||util['isAgentAvailable'](this[_0x8aba('0x4')]['id'],this['realtime'][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']],this[_0x8aba('0x4')][_0x8aba('0x11')],![])){this[_0x8aba('0x2')][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']][_0x8aba('0x12')]=!![];this[_0x8aba('0x2')][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']][_0x8aba('0x13')]=undefined;util[_0x8aba('0x14')](this[_0x8aba('0x15')],this[_0x8aba('0x4')]['id'],this[_0x8aba('0x2')][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']],null,this[_0x8aba('0x3')]);util[_0x8aba('0x16')](this[_0x8aba('0x4')]['id'],this['realtime'][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']],'RINGING'+(this['routing'][_0x8aba('0x10')]?_0x8aba('0x17'):''));}else{logger['info'](_0x8aba('0x18'),this[_0x8aba('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x8aba('0xf')][_0x8aba('0x5')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x44a5f5){if(_[_0x8aba('0xd')](this[_0x8aba('0x2')][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']])){return logger[_0x8aba('0xb')](_0x8aba('0x19'),this[_0x8aba('0x4')]['id'],this[_0x8aba('0x1')]['id']);}else{logger['info'](_0x8aba('0x1a'),this['squeue']['id'],this[_0x8aba('0x1')]['id']);util[_0x8aba('0x1b')](this['notificationId'],this['squeue']['id'],this[_0x8aba('0x2')][_0x8aba('0xe')][this['agent']['id']],null,this['routing']);this[_0x8aba('0x2')][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']][_0x8aba('0x12')]=![];this['realtime'][_0x8aba('0xe')][this[_0x8aba('0x1')]['id']]['busyQueue']=undefined;util[_0x8aba('0x16')](this[_0x8aba('0x4')]['id'],this[_0x8aba('0x2')][_0x8aba('0xe')][this['agent']['id']],_0x44a5f5?_0x8aba('0x1c'):'TIMEOUT');}if(!_0x44a5f5){setTimeout(this[_0x8aba('0xf')][_0x8aba('0x5')](this),0x3e8);}};function agent(_0x58c87e,_0x8c0efd,_0x12dd29,_0x12519f){return new Agent(_0x58c87e,_0x8c0efd,_0x12dd29,_0x12519f);}module['exports']=agent;
\ No newline at end of file
+var _0xc6cf=['showNotification','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','busy','busyQueue'];(function(_0x4b3bda,_0x537a06){var _0x2fa4aa=function(_0x39836c){while(--_0x39836c){_0x4b3bda['push'](_0x4b3bda['shift']());}};_0x2fa4aa(++_0x537a06);}(_0xc6cf,0xaa));var _0xfc6c=function(_0x123822,_0x3132bc){_0x123822=_0x123822-0x0;var _0x308cb3=_0xc6cf[_0x123822];return _0x308cb3;};'use strict';var _=require(_0xfc6c('0x0'));var uuid=require(_0xfc6c('0x1'));var util=require(_0xfc6c('0x2'));var logger=require('../../../../../config/logger')(_0xfc6c('0x3'));var Agent=function(_0x2130ad,_0x351dc3,_0x32a7d1,_0x385725){this[_0xfc6c('0x4')]=uuid['v4']();this[_0xfc6c('0x5')]=_0x2130ad;this['agent']=_0x351dc3;this[_0xfc6c('0x6')]=_0x32a7d1;this[_0xfc6c('0x3')]=_0x385725;this[_0xfc6c('0x5')][_0xfc6c('0x7')](this[_0xfc6c('0x8')][_0xfc6c('0x9')](this),this[_0xfc6c('0xa')][_0xfc6c('0x9')](this));this['squeue']['on'](_0xfc6c('0xb'),this[_0xfc6c('0xa')][_0xfc6c('0x9')](this));this[_0xfc6c('0x5')]['on'](_0xfc6c('0xc'),this[_0xfc6c('0xd')][_0xfc6c('0x9')](this));};Agent['prototype'][_0xfc6c('0x7')]=function(){this[_0xfc6c('0x5')][_0xfc6c('0x7')](this['handleRun']['bind'](this),this[_0xfc6c('0xa')][_0xfc6c('0x9')](this));};Agent[_0xfc6c('0xe')][_0xfc6c('0xd')]=function(){this[_0xfc6c('0xa')](!![]);};Agent['prototype'][_0xfc6c('0x8')]=function(_0x162b21){logger[_0xfc6c('0xf')](_0xfc6c('0x10'),this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);if(_[_0xfc6c('0x12')](this[_0xfc6c('0x6')]['agents'][this['agent']['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);setTimeout(this[_0xfc6c('0x7')][_0xfc6c('0x9')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util['isAgentAvailable'](this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x6')][_0xfc6c('0x13')][this['agent']['id']],this[_0xfc6c('0x5')]['channel'],![])){this[_0xfc6c('0x6')][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']][_0xfc6c('0x14')]=!![];this[_0xfc6c('0x6')][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']][_0xfc6c('0x15')]=undefined;util[_0xfc6c('0x16')](this[_0xfc6c('0x4')],this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x6')]['agents'][this['agent']['id']],null,this[_0xfc6c('0x3')]);util[_0xfc6c('0x17')](this['squeue']['id'],this[_0xfc6c('0x6')][_0xfc6c('0x13')][this['agent']['id']],_0xfc6c('0x18')+(this[_0xfc6c('0x3')][_0xfc6c('0x19')]?_0xfc6c('0x1a'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);setTimeout(this[_0xfc6c('0x7')][_0xfc6c('0x9')](this),0x3e8);}}};Agent[_0xfc6c('0xe')][_0xfc6c('0xa')]=function(_0x39fcfc){if(_[_0xfc6c('0x12')](this['realtime'][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']])){return logger[_0xfc6c('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);}else{logger[_0xfc6c('0xf')](_0xfc6c('0x1b'),this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);util[_0xfc6c('0x1c')](this[_0xfc6c('0x4')],this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x6')]['agents'][this[_0xfc6c('0x11')]['id']],null,this[_0xfc6c('0x3')]);this['realtime'][_0xfc6c('0x13')][this['agent']['id']][_0xfc6c('0x14')]=![];this[_0xfc6c('0x6')][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']][_0xfc6c('0x15')]=undefined;util['writeLog'](this['squeue']['id'],this['realtime'][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']],_0x39fcfc?_0xfc6c('0x1d'):_0xfc6c('0x1e'));}if(!_0x39fcfc){setTimeout(this[_0xfc6c('0x7')][_0xfc6c('0x9')](this),0x3e8);}};function agent(_0x543e3e,_0x531f96,_0x5a6c74,_0x433db0){return new Agent(_0x543e3e,_0x531f96,_0x5a6c74,_0x433db0);}module[_0xfc6c('0x1f')]=agent;
\ No newline at end of file
index df09d17..caf5e38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8ca=['RINGING','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','uuid','./util','routing','notificationId','squeue','queue','realtime','handleRun','handleTimeout','bind','timeout','prototype','push','handleDrained','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog'];(function(_0x26a51d,_0x5aaa3a){var _0x1d8bef=function(_0x3335dd){while(--_0x3335dd){_0x26a51d['push'](_0x26a51d['shift']());}};_0x1d8bef(++_0x5aaa3a);}(_0xb8ca,0x89));var _0xab8c=function(_0x5bc2e2,_0x294e93){_0x5bc2e2=_0x5bc2e2-0x0;var _0x4c6811=_0xb8ca[_0x5bc2e2];return _0x4c6811;};'use strict';var _=require(_0xab8c('0x0'));var uuid=require(_0xab8c('0x1'));var util=require(_0xab8c('0x2'));var logger=require('../../../../../config/logger')(_0xab8c('0x3'));var Beepall=function(_0x1a2b0a,_0x534d74,_0x4bf8af,_0x40c0b4){this[_0xab8c('0x4')]=uuid['v4']();this[_0xab8c('0x5')]=_0x1a2b0a;this[_0xab8c('0x6')]=_0x534d74;this[_0xab8c('0x7')]=_0x4bf8af;this[_0xab8c('0x3')]=_0x40c0b4;this[_0xab8c('0x5')]['push'](this[_0xab8c('0x8')]['bind'](this),this[_0xab8c('0x9')][_0xab8c('0xa')](this));this[_0xab8c('0x5')]['on'](_0xab8c('0xb'),this[_0xab8c('0x9')]['bind'](this));this[_0xab8c('0x5')]['on']('drained',this['handleDrained']['bind'](this));};Beepall[_0xab8c('0xc')][_0xab8c('0xd')]=function(){this[_0xab8c('0x5')][_0xab8c('0xd')](this[_0xab8c('0x8')][_0xab8c('0xa')](this),this[_0xab8c('0x9')][_0xab8c('0xa')](this));};Beepall[_0xab8c('0xc')][_0xab8c('0xe')]=function(_0x29484d){this[_0xab8c('0x9')](!![]);};Beepall[_0xab8c('0xc')][_0xab8c('0x8')]=function(_0x2dd9b6){var _0x55a0e7=!![];if(!_['isNil'](this[_0xab8c('0x6')])&&!_[_0xab8c('0xf')](this['queue'][_0xab8c('0x10')])&&this[_0xab8c('0x6')][_0xab8c('0x10')][_0xab8c('0x11')]>0x0){for(var _0x1ead6f=0x0,_0x43dffa;_0x1ead6f<this[_0xab8c('0x6')][_0xab8c('0x10')][_0xab8c('0x11')];_0x1ead6f+=0x1){_0x43dffa=this['queue'][_0xab8c('0x10')][_0x1ead6f]['id'];if(_[_0xab8c('0xf')](this[_0xab8c('0x7')][_0xab8c('0x12')][_0x43dffa])){logger[_0xab8c('0x13')](_0xab8c('0x14'),this['squeue']['id'],_0x43dffa);}else{if(util[_0xab8c('0x15')](this[_0xab8c('0x5')]['id'],this[_0xab8c('0x7')][_0xab8c('0x12')][_0x43dffa],this['squeue']['channel'],!![])){_0x55a0e7=![];util[_0xab8c('0x16')](this['squeue']['id'],this[_0xab8c('0x7')][_0xab8c('0x12')][_0x43dffa],_0xab8c('0x17'));this[_0xab8c('0x7')]['agents'][_0x43dffa]['busy']=!![];this[_0xab8c('0x7')][_0xab8c('0x12')][_0x43dffa][_0xab8c('0x18')]=this[_0xab8c('0x6')][_0xab8c('0x19')];util['showNotification'](this['notificationId'],this[_0xab8c('0x5')]['id'],this[_0xab8c('0x7')][_0xab8c('0x12')][_0x43dffa],this['queue'],this[_0xab8c('0x3')]);}}}if(_0x55a0e7){logger['info'](_0xab8c('0x1a'),this[_0xab8c('0x5')]['id']);setTimeout(this[_0xab8c('0xd')]['bind'](this),0x3e8);}}else{logger[_0xab8c('0x13')]('[%s][QUEUE]\x20EMPTY',this[_0xab8c('0x5')]['id']);setTimeout(this['push'][_0xab8c('0xa')](this),0x3e8);}};Beepall['prototype'][_0xab8c('0x9')]=function(_0x27971f){if(!_[_0xab8c('0xf')](this[_0xab8c('0x6')])&&!_[_0xab8c('0xf')](this[_0xab8c('0x6')][_0xab8c('0x10')])){for(var _0x1f8b0f=0x0,_0x3298ed;_0x1f8b0f<this[_0xab8c('0x6')][_0xab8c('0x10')]['length'];_0x1f8b0f+=0x1){_0x3298ed=this['queue'][_0xab8c('0x10')][_0x1f8b0f]['id'];if(_[_0xab8c('0xf')](this[_0xab8c('0x7')]['agents'][_0x3298ed])){logger[_0xab8c('0x13')](_0xab8c('0x14'),this[_0xab8c('0x5')]['id'],_0x3298ed);}else{util[_0xab8c('0x1b')](this[_0xab8c('0x4')],this['squeue']['id'],this['realtime'][_0xab8c('0x12')][_0x3298ed],this[_0xab8c('0x6')],this['routing']);util['writeLog'](this[_0xab8c('0x5')]['id'],this['realtime']['agents'][_0x3298ed],_0x27971f?_0xab8c('0x1c'):_0xab8c('0x1d'));this[_0xab8c('0x7')][_0xab8c('0x12')][_0x3298ed][_0xab8c('0x1e')]=![];this[_0xab8c('0x7')][_0xab8c('0x12')][_0x3298ed][_0xab8c('0x18')]=undefined;}}}if(!_0x27971f){setTimeout(this[_0xab8c('0xd')][_0xab8c('0xa')](this),0x3e8);}};function beepall(_0x51d449,_0x16cb8b,_0x1818ef,_0x24093a){return new Beepall(_0x51d449,_0x16cb8b,_0x1818ef,_0x24093a);}module[_0xab8c('0x1f')]=beepall;
\ No newline at end of file
+var _0x70e9=['showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','uuid','./util','routing','notificationId','squeue','queue','realtime','push','handleTimeout','bind','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','RINGING','busy','busyQueue','name'];(function(_0x38530b,_0x5c9245){var _0x163dd3=function(_0x536b84){while(--_0x536b84){_0x38530b['push'](_0x38530b['shift']());}};_0x163dd3(++_0x5c9245);}(_0x70e9,0x193));var _0x970e=function(_0x3128a8,_0x12de68){_0x3128a8=_0x3128a8-0x0;var _0x3e8ce3=_0x70e9[_0x3128a8];return _0x3e8ce3;};'use strict';var _=require('lodash');var uuid=require(_0x970e('0x0'));var util=require(_0x970e('0x1'));var logger=require('../../../../../config/logger')(_0x970e('0x2'));var Beepall=function(_0x39c55a,_0x50eebd,_0x7d5b70,_0x50df5a){this[_0x970e('0x3')]=uuid['v4']();this[_0x970e('0x4')]=_0x39c55a;this[_0x970e('0x5')]=_0x50eebd;this[_0x970e('0x6')]=_0x7d5b70;this[_0x970e('0x2')]=_0x50df5a;this[_0x970e('0x4')][_0x970e('0x7')](this['handleRun']['bind'](this),this[_0x970e('0x8')][_0x970e('0x9')](this));this['squeue']['on'](_0x970e('0xa'),this[_0x970e('0x8')][_0x970e('0x9')](this));this['squeue']['on'](_0x970e('0xb'),this[_0x970e('0xc')][_0x970e('0x9')](this));};Beepall[_0x970e('0xd')][_0x970e('0x7')]=function(){this[_0x970e('0x4')]['push'](this[_0x970e('0xe')][_0x970e('0x9')](this),this[_0x970e('0x8')][_0x970e('0x9')](this));};Beepall[_0x970e('0xd')][_0x970e('0xc')]=function(_0x308191){this[_0x970e('0x8')](!![]);};Beepall['prototype'][_0x970e('0xe')]=function(_0x389a08){var _0x580dc0=!![];if(!_[_0x970e('0xf')](this[_0x970e('0x5')])&&!_[_0x970e('0xf')](this[_0x970e('0x5')]['Agents'])&&this[_0x970e('0x5')][_0x970e('0x10')][_0x970e('0x11')]>0x0){for(var _0x4244a2=0x0,_0x47885b;_0x4244a2<this['queue'][_0x970e('0x10')][_0x970e('0x11')];_0x4244a2+=0x1){_0x47885b=this[_0x970e('0x5')]['Agents'][_0x4244a2]['id'];if(_[_0x970e('0xf')](this[_0x970e('0x6')][_0x970e('0x12')][_0x47885b])){logger[_0x970e('0x13')](_0x970e('0x14'),this['squeue']['id'],_0x47885b);}else{if(util['isAgentAvailable'](this[_0x970e('0x4')]['id'],this['realtime'][_0x970e('0x12')][_0x47885b],this[_0x970e('0x4')][_0x970e('0x15')],!![])){_0x580dc0=![];util['writeLog'](this['squeue']['id'],this[_0x970e('0x6')][_0x970e('0x12')][_0x47885b],_0x970e('0x16'));this[_0x970e('0x6')][_0x970e('0x12')][_0x47885b][_0x970e('0x17')]=!![];this['realtime'][_0x970e('0x12')][_0x47885b][_0x970e('0x18')]=this['queue'][_0x970e('0x19')];util[_0x970e('0x1a')](this[_0x970e('0x3')],this[_0x970e('0x4')]['id'],this[_0x970e('0x6')][_0x970e('0x12')][_0x47885b],this[_0x970e('0x5')],this[_0x970e('0x2')]);}}}if(_0x580dc0){logger['info'](_0x970e('0x1b'),this[_0x970e('0x4')]['id']);setTimeout(this[_0x970e('0x7')][_0x970e('0x9')](this),0x3e8);}}else{logger[_0x970e('0x13')](_0x970e('0x1c'),this[_0x970e('0x4')]['id']);setTimeout(this[_0x970e('0x7')]['bind'](this),0x3e8);}};Beepall['prototype'][_0x970e('0x8')]=function(_0x16d9b3){if(!_[_0x970e('0xf')](this[_0x970e('0x5')])&&!_[_0x970e('0xf')](this['queue'][_0x970e('0x10')])){for(var _0x240ca9=0x0,_0x4d4288;_0x240ca9<this[_0x970e('0x5')][_0x970e('0x10')][_0x970e('0x11')];_0x240ca9+=0x1){_0x4d4288=this[_0x970e('0x5')][_0x970e('0x10')][_0x240ca9]['id'];if(_[_0x970e('0xf')](this['realtime'][_0x970e('0x12')][_0x4d4288])){logger[_0x970e('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x970e('0x4')]['id'],_0x4d4288);}else{util[_0x970e('0x1d')](this['notificationId'],this[_0x970e('0x4')]['id'],this[_0x970e('0x6')]['agents'][_0x4d4288],this['queue'],this[_0x970e('0x2')]);util['writeLog'](this[_0x970e('0x4')]['id'],this['realtime'][_0x970e('0x12')][_0x4d4288],_0x16d9b3?_0x970e('0x1e'):_0x970e('0x1f'));this[_0x970e('0x6')][_0x970e('0x12')][_0x4d4288][_0x970e('0x17')]=![];this['realtime'][_0x970e('0x12')][_0x4d4288][_0x970e('0x18')]=undefined;}}}if(!_0x16d9b3){setTimeout(this[_0x970e('0x7')][_0x970e('0x9')](this),0x3e8);}};function beepall(_0xfa5a19,_0x4f06d6,_0x350ff8,_0x440ca1){return new Beepall(_0xfa5a19,_0x4f06d6,_0x350ff8,_0x440ca1);}module[_0x970e('0x20')]=beepall;
\ No newline at end of file
index 6e28a90..a5ce771 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x588d=['exports','./rrmemory','./beepall','./agent'];(function(_0x35d755,_0x3df57b){var _0x451fcf=function(_0x3b362a){while(--_0x3b362a){_0x35d755['push'](_0x35d755['shift']());}};_0x451fcf(++_0x3df57b);}(_0x588d,0x1a0));var _0xd588=function(_0x269036,_0x4f23e1){_0x269036=_0x269036-0x0;var _0x174640=_0x588d[_0x269036];return _0x174640;};'use strict';module[_0xd588('0x0')]={'rrmemory':require(_0xd588('0x1')),'beepall':require(_0xd588('0x2')),'agent':require(_0xd588('0x3'))};
\ No newline at end of file
+var _0x8a7f=['./agent','./rrmemory'];(function(_0x26e702,_0x3dc8d6){var _0x55c498=function(_0x5b8542){while(--_0x5b8542){_0x26e702['push'](_0x26e702['shift']());}};_0x55c498(++_0x3dc8d6);}(_0x8a7f,0xd9));var _0xf8a7=function(_0x491b86,_0x57f4a8){_0x491b86=_0x491b86-0x0;var _0x7be875=_0x8a7f[_0x491b86];return _0x7be875;};'use strict';module['exports']={'rrmemory':require(_0xf8a7('0x0')),'beepall':require('./beepall'),'agent':require(_0xf8a7('0x1'))};
\ No newline at end of file
index b9b14cd..26d6687 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x543b=['name','showNotification','writeLog','RINGING','handleCheckReject','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','lodash','uuid','./util','routing','notificationId','squeue','queue','push','handleRun','bind','handleTimeout','module','timeout','drained','prototype','handleDrained','isAgentAvailable','realtime','agentId','channel','[%s][QUEUE]\x20available\x20again\x20%s','intervals','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','busy','busyQueue'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x543b,0xcb));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var rr=require('rr');var _=require(_0xb543('0x0'));var uuid=require(_0xb543('0x1'));var util=require(_0xb543('0x2'));var logger=require('../../../../../config/logger')(_0xb543('0x3'));var RRMemory=function(_0x24e83f,_0x154b5a,_0xde4ff7,_0x5cbd48){this[_0xb543('0x4')]=uuid['v4']();this[_0xb543('0x5')]=_0x24e83f;this[_0xb543('0x6')]=_0x154b5a;this['realtime']=_0xde4ff7;this[_0xb543('0x3')]=_0x5cbd48;this['intervals']={};this[_0xb543('0x5')][_0xb543('0x7')](this[_0xb543('0x8')][_0xb543('0x9')](this),this[_0xb543('0xa')][_0xb543('0x9')](this),this[_0xb543('0xb')]);this['squeue']['on'](_0xb543('0xc'),this[_0xb543('0xa')][_0xb543('0x9')](this));this[_0xb543('0x5')]['on'](_0xb543('0xd'),this['handleDrained'][_0xb543('0x9')](this));};RRMemory[_0xb543('0xe')][_0xb543('0x7')]=function(){this[_0xb543('0x5')]['push'](this[_0xb543('0x8')][_0xb543('0x9')](this),this['handleTimeout'][_0xb543('0x9')](this));};RRMemory[_0xb543('0xe')][_0xb543('0xf')]=function(_0x24903c){this['handleTimeout'](!![]);};RRMemory[_0xb543('0xe')]['handleCheckReject']=function(_0x5a508c){if(util[_0xb543('0x10')](this['squeue']['id'],this[_0xb543('0x11')]['agents'][this[_0xb543('0x12')]],this[_0xb543('0x5')][_0xb543('0x13')],!![])){logger['info'](_0xb543('0x14'),this[_0xb543('0x5')]['id'],this['agentId']);clearInterval(this[_0xb543('0x15')][this[_0xb543('0x12')]]);_0x5a508c[_0xb543('0x16')]();setTimeout(this[_0xb543('0x7')][_0xb543('0x9')](this),0x3e8);}};RRMemory[_0xb543('0xe')][_0xb543('0x8')]=function(_0x3671d9){this[_0xb543('0x12')]=rr(this['queue'][_0xb543('0x17')]);logger['info'](_0xb543('0x18'),this['squeue']['id'],this[_0xb543('0x12')]);if(_[_0xb543('0x19')](this[_0xb543('0x11')]['agents'][this['agentId']])){logger[_0xb543('0x1a')](_0xb543('0x1b'),this['squeue']['id'],this['agentId']);_0x3671d9[_0xb543('0x16')]();setTimeout(this[_0xb543('0x7')][_0xb543('0x9')](this),0x3e8);}else{if(util[_0xb543('0x10')](this['squeue']['id'],this[_0xb543('0x11')][_0xb543('0x1c')][this[_0xb543('0x12')]],this[_0xb543('0x5')][_0xb543('0x13')],!![])){this[_0xb543('0x11')][_0xb543('0x1c')][this['agentId']][_0xb543('0x1d')]=!![];this[_0xb543('0x11')]['agents'][this['agentId']][_0xb543('0x1e')]=this[_0xb543('0x6')][_0xb543('0x1f')];util[_0xb543('0x20')](this['notificationId'],this[_0xb543('0x5')]['id'],this['realtime']['agents'][this[_0xb543('0x12')]],this[_0xb543('0x6')],this[_0xb543('0x3')]);util[_0xb543('0x21')](this[_0xb543('0x5')]['id'],this[_0xb543('0x11')][_0xb543('0x1c')][this[_0xb543('0x12')]],_0xb543('0x22'));this['intervals'][this[_0xb543('0x12')]]=setInterval(this[_0xb543('0x23')][_0xb543('0x9')](this,_0x3671d9),0x3e8);}else{logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0xb543('0x5')]['id'],this[_0xb543('0x12')]);_0x3671d9[_0xb543('0x16')]();setTimeout(this[_0xb543('0x7')][_0xb543('0x9')](this),0x3e8);}}};RRMemory[_0xb543('0xe')][_0xb543('0xa')]=function(_0x1d9dec){logger[_0xb543('0x1a')](_0xb543('0x24'),this['squeue']['id'],this[_0xb543('0x12')]);if(_[_0xb543('0x19')](this['realtime'][_0xb543('0x1c')][this['agentId']])){logger[_0xb543('0x1a')](_0xb543('0x1b'),this[_0xb543('0x5')]['id'],this[_0xb543('0x12')]);}else{clearInterval(this[_0xb543('0x15')][this[_0xb543('0x12')]]);util[_0xb543('0x25')](this[_0xb543('0x4')],this[_0xb543('0x5')]['id'],this[_0xb543('0x11')][_0xb543('0x1c')][this['agentId']],this['queue'],this[_0xb543('0x3')]);util[_0xb543('0x21')](this['squeue']['id'],this[_0xb543('0x11')]['agents'][this[_0xb543('0x12')]],_0xb543('0x26'));this['realtime'][_0xb543('0x1c')][this['agentId']][_0xb543('0x1d')]=![];this[_0xb543('0x11')][_0xb543('0x1c')][this['agentId']][_0xb543('0x1e')]=undefined;}if(!_0x1d9dec){setTimeout(this[_0xb543('0x7')][_0xb543('0x9')](this),0x3e8);}};function rrmemory(_0xc49df1,_0x268c61,_0x5261d8,_0x1bdd3f){return new RRMemory(_0xc49df1,_0x268c61,_0x5261d8,_0x1bdd3f);}module['exports']=rrmemory;
\ No newline at end of file
+var _0x41ce=['done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','busyQueue','writeLog','info','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','intervals','hideNotification','TIMEOUT','exports','lodash','uuid','./util','notificationId','squeue','queue','realtime','routing','handleRun','bind','handleTimeout','module','drained','handleDrained','prototype','push','isAgentAvailable','agents','[%s][QUEUE]\x20available\x20again\x20%s','agentId'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x41ce,0x130));var _0xe41c=function(_0x158919,_0x299fe2){_0x158919=_0x158919-0x0;var _0x4990f4=_0x41ce[_0x158919];return _0x4990f4;};'use strict';var rr=require('rr');var _=require(_0xe41c('0x0'));var uuid=require(_0xe41c('0x1'));var util=require(_0xe41c('0x2'));var logger=require('../../../../../config/logger')('routing');var RRMemory=function(_0x57c188,_0x198a4e,_0x9d27be,_0x47bf5c){this[_0xe41c('0x3')]=uuid['v4']();this[_0xe41c('0x4')]=_0x57c188;this[_0xe41c('0x5')]=_0x198a4e;this[_0xe41c('0x6')]=_0x9d27be;this[_0xe41c('0x7')]=_0x47bf5c;this['intervals']={};this[_0xe41c('0x4')]['push'](this[_0xe41c('0x8')][_0xe41c('0x9')](this),this[_0xe41c('0xa')][_0xe41c('0x9')](this),this[_0xe41c('0xb')]);this['squeue']['on']('timeout',this[_0xe41c('0xa')][_0xe41c('0x9')](this));this[_0xe41c('0x4')]['on'](_0xe41c('0xc'),this[_0xe41c('0xd')][_0xe41c('0x9')](this));};RRMemory[_0xe41c('0xe')][_0xe41c('0xf')]=function(){this['squeue'][_0xe41c('0xf')](this[_0xe41c('0x8')][_0xe41c('0x9')](this),this[_0xe41c('0xa')][_0xe41c('0x9')](this));};RRMemory['prototype'][_0xe41c('0xd')]=function(_0x27a2ff){this[_0xe41c('0xa')](!![]);};RRMemory['prototype']['handleCheckReject']=function(_0x132980){if(util[_0xe41c('0x10')](this[_0xe41c('0x4')]['id'],this['realtime'][_0xe41c('0x11')][this['agentId']],this[_0xe41c('0x4')]['channel'],!![])){logger['info'](_0xe41c('0x12'),this[_0xe41c('0x4')]['id'],this[_0xe41c('0x13')]);clearInterval(this['intervals'][this[_0xe41c('0x13')]]);_0x132980[_0xe41c('0x14')]();setTimeout(this[_0xe41c('0xf')][_0xe41c('0x9')](this),0x3e8);}};RRMemory[_0xe41c('0xe')][_0xe41c('0x8')]=function(_0x331ca6){this[_0xe41c('0x13')]=rr(this['queue'][_0xe41c('0x15')]);logger['info'](_0xe41c('0x16'),this['squeue']['id'],this['agentId']);if(_[_0xe41c('0x17')](this[_0xe41c('0x6')][_0xe41c('0x11')][this[_0xe41c('0x13')]])){logger['info'](_0xe41c('0x18'),this[_0xe41c('0x4')]['id'],this[_0xe41c('0x13')]);_0x331ca6['done']();setTimeout(this[_0xe41c('0xf')][_0xe41c('0x9')](this),0x3e8);}else{if(util[_0xe41c('0x10')](this[_0xe41c('0x4')]['id'],this[_0xe41c('0x6')][_0xe41c('0x11')][this[_0xe41c('0x13')]],this['squeue'][_0xe41c('0x19')],!![])){this[_0xe41c('0x6')]['agents'][this[_0xe41c('0x13')]][_0xe41c('0x1a')]=!![];this[_0xe41c('0x6')]['agents'][this[_0xe41c('0x13')]][_0xe41c('0x1b')]=this[_0xe41c('0x5')]['name'];util['showNotification'](this[_0xe41c('0x3')],this['squeue']['id'],this[_0xe41c('0x6')][_0xe41c('0x11')][this[_0xe41c('0x13')]],this[_0xe41c('0x5')],this[_0xe41c('0x7')]);util[_0xe41c('0x1c')](this['squeue']['id'],this[_0xe41c('0x6')][_0xe41c('0x11')][this['agentId']],'RINGING');this['intervals'][this[_0xe41c('0x13')]]=setInterval(this['handleCheckReject']['bind'](this,_0x331ca6),0x3e8);}else{logger[_0xe41c('0x1d')](_0xe41c('0x1e'),this[_0xe41c('0x4')]['id'],this[_0xe41c('0x13')]);_0x331ca6['done']();setTimeout(this[_0xe41c('0xf')]['bind'](this),0x3e8);}}};RRMemory[_0xe41c('0xe')][_0xe41c('0xa')]=function(_0xb52ae7){logger['info'](_0xe41c('0x1f'),this['squeue']['id'],this['agentId']);if(_[_0xe41c('0x17')](this[_0xe41c('0x6')][_0xe41c('0x11')][this[_0xe41c('0x13')]])){logger[_0xe41c('0x1d')](_0xe41c('0x18'),this[_0xe41c('0x4')]['id'],this[_0xe41c('0x13')]);}else{clearInterval(this[_0xe41c('0x20')][this[_0xe41c('0x13')]]);util[_0xe41c('0x21')](this[_0xe41c('0x3')],this[_0xe41c('0x4')]['id'],this[_0xe41c('0x6')]['agents'][this[_0xe41c('0x13')]],this[_0xe41c('0x5')],this[_0xe41c('0x7')]);util[_0xe41c('0x1c')](this[_0xe41c('0x4')]['id'],this[_0xe41c('0x6')]['agents'][this[_0xe41c('0x13')]],_0xe41c('0x22'));this[_0xe41c('0x6')]['agents'][this[_0xe41c('0x13')]][_0xe41c('0x1a')]=![];this[_0xe41c('0x6')][_0xe41c('0x11')][this[_0xe41c('0x13')]][_0xe41c('0x1b')]=undefined;}if(!_0xb52ae7){setTimeout(this[_0xe41c('0xf')][_0xe41c('0x9')](this),0x3e8);}};function rrmemory(_0x3870d7,_0x51d572,_0x2b2aaf,_0x580550){return new RRMemory(_0x3870d7,_0x51d572,_0x2b2aaf,_0x580550);}module[_0xe41c('0x23')]=rrmemory;
\ No newline at end of file
index bd52fbf..b9b2f66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fdc=['user:%s','name','emit','user:save','split','account','notificationSound','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','info','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format'];(function(_0x3b4497,_0x1fb935){var _0x1f54db=function(_0x4418db){while(--_0x4418db){_0x3b4497['push'](_0x3b4497['shift']());}};_0x1f54db(++_0x1fb935);}(_0x5fdc,0x127));var _0xc5fd=function(_0x3cb32a,_0x575e89){_0x3cb32a=_0x3cb32a-0x0;var _0x51b97c=_0x5fdc[_0x3cb32a];return _0x51b97c;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var utils=require(_0xc5fd('0x2'));var Mustache=require(_0xc5fd('0x3'));var Redis=require(_0xc5fd('0x4'));var config=require(_0xc5fd('0x5'));var logger=require(_0xc5fd('0x6'))(_0xc5fd('0x7'));config[_0xc5fd('0x8')]=_[_0xc5fd('0x9')](config[_0xc5fd('0x8')],{'host':_0xc5fd('0xa'),'port':0x18eb});var io=require(_0xc5fd('0xb'))(new Redis(config[_0xc5fd('0x8')]));function emit(_0x15ffe7,_0x5a2eb4,_0x5d86e5){io['to'](_0x15ffe7)['emit'](_0x5a2eb4,_0x5d86e5);}function sendNotification(_0x224801,_0x46bce3,_0x158e58,_0x45c91f,_0x4e6d35,_0x4e1e94){io['to'](util[_0xc5fd('0xc')](_0xc5fd('0xd'),_0x45c91f[_0xc5fd('0xe')]))[_0xc5fd('0xf')](_0xc5fd('0x10'),_0x45c91f);var _0x368c80=_0x4e1e94||{};var _0x484bbd=_0x158e58[_0xc5fd('0x11')]('.');var _0x5c3577={'uniqueid':_0x46bce3,'channel':_0x484bbd[0x0],'id':_0x484bbd[0x1],'title':_0x484bbd[0x0]+'\x20interaction','interactionId':_0x484bbd[0x2],'queue':_0x4e6d35?_0x4e6d35[_0xc5fd('0xe')]:null,'sound':_0x368c80[_0xc5fd('0x12')][_0xc5fd('0x13')],'shake':_0x368c80[_0xc5fd('0x12')][_0xc5fd('0x14')]};try{if(!_0x368c80[_0xc5fd('0x15')]){_0x368c80[_0xc5fd('0x15')]={};}if(_0x4e6d35){_0x368c80[_0xc5fd('0x15')]['queue']=_0x4e6d35;}else if(_0x368c80[_0xc5fd('0x15')][_0xc5fd('0x16')]){delete _0x368c80[_0xc5fd('0x15')][_0xc5fd('0x16')];}_0x5c3577['msg']=utils['getMustacheRender'](_0x368c80['account']['notificationTemplate'],_0x368c80);}catch(_0x508539){_0x5c3577[_0xc5fd('0x17')]=_0xc5fd('0x18');logger[_0xc5fd('0x19')](util[_0xc5fd('0xc')](_0xc5fd('0x1a'),_0x46bce3,_0x508539[_0xc5fd('0x1b')]));}io['to'](util[_0xc5fd('0xc')]('user:%s',_0x45c91f[_0xc5fd('0xe')]))[_0xc5fd('0xf')](util[_0xc5fd('0xc')](_0xc5fd('0x1c'),_0x224801?_0xc5fd('0x1d'):'remove'),_0x5c3577);}function writeLog(_0x3966a2,_0x24e5e9,_0x18048e){return logger[_0xc5fd('0x1e')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x3966a2,_0x24e5e9[_0xc5fd('0xe')],_0x18048e));}exports[_0xc5fd('0x1f')]=function(_0x3d7211,_0x42d7f4,_0x334401,_0x311952){if(_0x42d7f4['busy']){writeLog(_0x3d7211,_0x42d7f4,_0xc5fd('0x20'));return![];}if(!_0x42d7f4[_0xc5fd('0x21')]){writeLog(_0x3d7211,_0x42d7f4,_0xc5fd('0x22'));return![];}if(_0x42d7f4[_0x334401+_0xc5fd('0x23')]){writeLog(_0x3d7211,_0x42d7f4,_0xc5fd('0x24'));return![];}if(_0x311952&&_0x42d7f4[_0xc5fd('0x25')](_0x334401+_0xc5fd('0x26'))&&_0x42d7f4['hasOwnProperty'](_0x334401+_0xc5fd('0x27'))){if(_0x42d7f4[_0x334401+'Capacity']>0x0&&_0x42d7f4[_0x334401+_0xc5fd('0x27')]>=_0x42d7f4[_0x334401+_0xc5fd('0x26')]){writeLog(_0x3d7211,_0x42d7f4,_0x334401[_0xc5fd('0x28')]()+_0xc5fd('0x29'));return![];}}return!![];};exports['showNotification']=function(_0x176313,_0x1bbdc4,_0x19c4a0,_0x42cbf0,_0x19df33){return sendNotification(!![],_0x176313,_0x1bbdc4,_0x19c4a0,_0x42cbf0,_0x19df33);};exports[_0xc5fd('0x2a')]=function(_0x541c12,_0x412ef7,_0x5d4f70,_0x4859f7,_0x12a962){return sendNotification(![],_0x541c12,_0x412ef7,_0x5d4f70,_0x4859f7,_0x12a962);};exports[_0xc5fd('0x2b')]=writeLog;
\ No newline at end of file
+var _0x326f=['CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','info','isAgentAvailable','busy','BUSY','online','OFFLINE','Capacity','hasOwnProperty'];(function(_0x49b78f,_0x1ccdf7){var _0x544d2=function(_0x396757){while(--_0x396757){_0x49b78f['push'](_0x49b78f['shift']());}};_0x544d2(++_0x1ccdf7);}(_0x326f,0xd1));var _0xf326=function(_0x55de6b,_0x143da5){_0x55de6b=_0x55de6b-0x0;var _0x45d5bd=_0x326f[_0x55de6b];return _0x45d5bd;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var config=require(_0xf326('0x3'));var logger=require(_0xf326('0x4'))(_0xf326('0x5'));config[_0xf326('0x6')]=_[_0xf326('0x7')](config[_0xf326('0x6')],{'host':_0xf326('0x8'),'port':0x18eb});var io=require(_0xf326('0x9'))(new Redis(config['redis']));function emit(_0x3c254d,_0x3851eb,_0x165f95){io['to'](_0x3c254d)[_0xf326('0xa')](_0x3851eb,_0x165f95);}function sendNotification(_0x515bfa,_0x4c206c,_0x592975,_0x3bacf2,_0x1fc80e,_0x163416){io['to'](util[_0xf326('0xb')](_0xf326('0xc'),_0x3bacf2['name']))[_0xf326('0xa')]('user:save',_0x3bacf2);var _0x1cf441=_0x163416||{};var _0x4aaf3a=_0x592975[_0xf326('0xd')]('.');var _0x518ab5={'uniqueid':_0x4c206c,'channel':_0x4aaf3a[0x0],'id':_0x4aaf3a[0x1],'title':_0x4aaf3a[0x0]+_0xf326('0xe'),'interactionId':_0x4aaf3a[0x2],'queue':_0x1fc80e?_0x1fc80e[_0xf326('0xf')]:null,'sound':_0x1cf441['account'][_0xf326('0x10')],'shake':_0x1cf441[_0xf326('0x11')][_0xf326('0x12')]};try{if(!_0x1cf441[_0xf326('0x13')]){_0x1cf441['body']={};}if(_0x1fc80e){_0x1cf441[_0xf326('0x13')]['queue']=_0x1fc80e;}else if(_0x1cf441['body'][_0xf326('0x14')]){delete _0x1cf441[_0xf326('0x13')][_0xf326('0x14')];}_0x518ab5[_0xf326('0x15')]=utils[_0xf326('0x16')](_0x1cf441[_0xf326('0x11')][_0xf326('0x17')],_0x1cf441);}catch(_0x2cf2ca){_0x518ab5['msg']=_0xf326('0x18');logger[_0xf326('0x19')](util[_0xf326('0xb')](_0xf326('0x1a'),_0x4c206c,_0x2cf2ca[_0xf326('0x1b')]));}io['to'](util[_0xf326('0xb')]('user:%s',_0x3bacf2['name']))['emit'](util[_0xf326('0xb')](_0xf326('0x1c'),_0x515bfa?'save':'remove'),_0x518ab5);}function writeLog(_0x128c68,_0x4dfa76,_0x5b6d3c){return logger[_0xf326('0x1d')](util[_0xf326('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x128c68,_0x4dfa76['name'],_0x5b6d3c));}exports[_0xf326('0x1e')]=function(_0xb1efcf,_0x5f21a2,_0x337ed5,_0x1b9039){if(_0x5f21a2[_0xf326('0x1f')]){writeLog(_0xb1efcf,_0x5f21a2,_0xf326('0x20'));return![];}if(!_0x5f21a2[_0xf326('0x21')]){writeLog(_0xb1efcf,_0x5f21a2,_0xf326('0x22'));return![];}if(_0x5f21a2[_0x337ed5+'Pause']){writeLog(_0xb1efcf,_0x5f21a2,'PAUSE');return![];}if(_0x1b9039&&_0x5f21a2['hasOwnProperty'](_0x337ed5+_0xf326('0x23'))&&_0x5f21a2[_0xf326('0x24')](_0x337ed5+_0xf326('0x25'))){if(_0x5f21a2[_0x337ed5+_0xf326('0x23')]>0x0&&_0x5f21a2[_0x337ed5+_0xf326('0x25')]>=_0x5f21a2[_0x337ed5+_0xf326('0x23')]){writeLog(_0xb1efcf,_0x5f21a2,_0x337ed5['toUpperCase']()+_0xf326('0x26'));return![];}}return!![];};exports[_0xf326('0x27')]=function(_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf){return sendNotification(!![],_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf);};exports[_0xf326('0x28')]=function(_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500){return sendNotification(![],_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500);};exports['writeLog']=writeLog;
\ No newline at end of file
index 2fb146e..5087d42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7024=['lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','validate','shelljs'];(function(_0x1e20ef,_0x145409){var _0x100270=function(_0x2dc2a4){while(--_0x2dc2a4){_0x1e20ef['push'](_0x1e20ef['shift']());}};_0x100270(++_0x145409);}(_0x7024,0x139));var _0x4702=function(_0x2cf612,_0x3598d7){_0x2cf612=_0x2cf612-0x0;var _0x1164ee=_0x7024[_0x2cf612];return _0x1164ee;};'use strict';var schema=require(_0x4702('0x0'));var sh=require(_0x4702('0x1'));var _=require(_0x4702('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x4702('0x3'));var system=schema({'command':{'type':_0x4702('0x4'),'required':!![],'message':_0x4702('0x5')}});exports[_0x4702('0x6')]=function(_0x26c88a,_0x8243c6){return function(_0x2baf43){try{var _0xd9377c={'command':_0x8243c6[0x0]};var _0x56b83b=system[_0x4702('0x0')](_0xd9377c,{'typecast':!![]});if(_0x56b83b['length']){logger[_0x4702('0x7')](_0x4702('0x8'),_0x26c88a,_['map'](_0x56b83b,_0x4702('0x9'))[_0x4702('0xa')](',\x20'));logger['info'](_0x4702('0xb'),_0x26c88a);_0x2baf43[_0x4702('0xc')]();}else{var _0x2b3f66=this;var _0x149443=utils[_0x4702('0xd')](_0x8243c6[0x0],this);logger[_0x4702('0xe')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x26c88a,_0x149443);sh[_0x4702('0xf')](_[_0x4702('0x10')](_0x149443),function(_0x1d84b1,_0x3cc817){logger['info'](_0x4702('0x11'),_0x26c88a,_0x1d84b1);if(_0x1d84b1==0x0){var _0x57301e=_0x3cc817['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x8243c6[0x1])||_[_0x4702('0x12')](_0x8243c6[0x1])){logger[_0x4702('0xe')]('[%s][SYSTEM]\x20no\x20variable',_0x26c88a);_0x2b3f66[_0x4702('0x13')][_0x8243c6[0x1]]=_0x57301e;}else{logger[_0x4702('0xe')](_0x4702('0x14'),_0x26c88a,_0x8243c6[0x1],_0x57301e);_0x2b3f66[_0x4702('0x13')][_0x8243c6[0x1]]=_0x57301e;}}_0x2baf43[_0x4702('0xc')]();});}}catch(_0x3da114){logger['error'](_0x4702('0x8'),_0x26c88a,_['isObject'](_0x3da114)?JSON['stringify'](_0x3da114):_0x3da114);logger[_0x4702('0xe')](_0x4702('0xb'),_0x26c88a);_0x2baf43['next']();}};};
\ No newline at end of file
+var _0xdb76=['../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','validate','shelljs','lodash','./utils'];(function(_0x5d5f46,_0x38974b){var _0x43203c=function(_0x5479ae){while(--_0x5479ae){_0x5d5f46['push'](_0x5d5f46['shift']());}};_0x43203c(++_0x38974b);}(_0xdb76,0x1be));var _0x6db7=function(_0xd9f60b,_0x1c73eb){_0xd9f60b=_0xd9f60b-0x0;var _0x3bdb98=_0xdb76[_0xd9f60b];return _0x3bdb98;};'use strict';var schema=require(_0x6db7('0x0'));var sh=require(_0x6db7('0x1'));var _=require(_0x6db7('0x2'));var utils=require(_0x6db7('0x3'));var logger=require(_0x6db7('0x4'))('routing');var system=schema({'command':{'type':_0x6db7('0x5'),'required':!![],'message':_0x6db7('0x6')}});exports[_0x6db7('0x7')]=function(_0x40f6ce,_0x57a095){return function(_0x117f1c){try{var _0x7bba2d={'command':_0x57a095[0x0]};var _0x8a8fe2=system[_0x6db7('0x0')](_0x7bba2d,{'typecast':!![]});if(_0x8a8fe2[_0x6db7('0x8')]){logger['error'](_0x6db7('0x9'),_0x40f6ce,_[_0x6db7('0xa')](_0x8a8fe2,'message')[_0x6db7('0xb')](',\x20'));logger[_0x6db7('0xc')](_0x6db7('0xd'),_0x40f6ce);_0x117f1c[_0x6db7('0xe')]();}else{var _0x1d2841=this;var _0x1abae4=utils['getMustacheRender'](_0x57a095[0x0],this);logger['info'](_0x6db7('0xf'),_0x40f6ce,_0x1abae4);sh[_0x6db7('0x10')](_['trim'](_0x1abae4),function(_0x3573ae,_0x129708){logger[_0x6db7('0xc')](_0x6db7('0x11'),_0x40f6ce,_0x3573ae);if(_0x3573ae==0x0){var _0x375f4a=_0x129708[_0x6db7('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x57a095[0x1])||_['isEmpty'](_0x57a095[0x1])){logger[_0x6db7('0xc')](_0x6db7('0x13'),_0x40f6ce);_0x1d2841[_0x6db7('0x14')][_0x57a095[0x1]]=_0x375f4a;}else{logger[_0x6db7('0xc')](_0x6db7('0x15'),_0x40f6ce,_0x57a095[0x1],_0x375f4a);_0x1d2841[_0x6db7('0x14')][_0x57a095[0x1]]=_0x375f4a;}}_0x117f1c[_0x6db7('0xe')]();});}}catch(_0x43f66c){logger[_0x6db7('0x16')](_0x6db7('0x9'),_0x40f6ce,_[_0x6db7('0x17')](_0x43f66c)?JSON[_0x6db7('0x18')](_0x43f66c):_0x43f66c);logger['info'](_0x6db7('0xd'),_0x40f6ce);_0x117f1c[_0x6db7('0xe')]();}};};
\ No newline at end of file
index 47ea9c4..a46da72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1bc=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xb1bc,0x15b));var _0xcb1b=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0xb1bc[_0x21205e];return _0x136ebb;};'use strict';var schema=require(_0xcb1b('0x0'));var _=require(_0xcb1b('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xcb1b('0x2')),'smsInteraction':require(_0xcb1b('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xcb1b('0x4'))};var logger=require(_0xcb1b('0x5'))(_0xcb1b('0x6'));var tag=schema({'tag':{'type':_0xcb1b('0x7'),'required':!![],'message':_0xcb1b('0x8')}});exports[_0xcb1b('0x9')]=function(_0x4fb8ca,_0x52da3b,_0x2b016d,_0x35ce9f){return function(_0x582069){try{var _0x1442f7={'tag':_0x52da3b[0x0]};var _0x516db6=tag['validate'](_0x1442f7,{'typecast':!![]});if(_0x516db6[_0xcb1b('0xa')]){logger[_0xcb1b('0xb')](_0xcb1b('0xc'),_0x4fb8ca,_[_0xcb1b('0xd')](_0x516db6,_0xcb1b('0xe'))[_0xcb1b('0xf')](',\x20'));logger[_0xcb1b('0x10')](_0xcb1b('0x11'),_0x4fb8ca);_0x582069[_0xcb1b('0x12')]();}else{var _0x458325={'ids':[_0x52da3b[0x0]]};if(rpc[_0x35ce9f[_0xcb1b('0x13')]+_0xcb1b('0x14')]){rpc[_0x35ce9f['channel']+_0xcb1b('0x14')]['addTags'](_0x35ce9f[_0xcb1b('0x15')]['id'],_0x458325)[_0xcb1b('0x16')](function(_0x7f3174){logger[_0xcb1b('0x10')](_0xcb1b('0x17'),_0x4fb8ca,_0x52da3b[0x1],_0x35ce9f[_0xcb1b('0x13')],_0x35ce9f[_0xcb1b('0x15')]['id']);})[_0xcb1b('0x18')](function(_0x25d156){logger[_0xcb1b('0xb')](_0xcb1b('0xc'),_0x4fb8ca,JSON[_0xcb1b('0x19')](_0x25d156));logger['info'](_0xcb1b('0x11'),_0x4fb8ca);})['finally'](function(){_0x582069[_0xcb1b('0x12')]();});}}}catch(_0x384a30){logger[_0xcb1b('0xb')](_0xcb1b('0xc'),_0x4fb8ca,_[_0xcb1b('0x1a')](_0x384a30)?JSON[_0xcb1b('0x19')](_0x384a30):_0x384a30);logger['info'](_0xcb1b('0x11'),_0x4fb8ca);_0x582069['next']();}};};
\ No newline at end of file
+var _0x52e1=['next','channel','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','error','isObject','validate','lodash','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x3a2764,_0x16654){var _0x39071e=function(_0x53f638){while(--_0x53f638){_0x3a2764['push'](_0x3a2764['shift']());}};_0x39071e(++_0x16654);}(_0x52e1,0x189));var _0x152e=function(_0x420781,_0x99f6db){_0x420781=_0x420781-0x0;var _0xa1e054=_0x52e1[_0x420781];return _0xa1e054;};'use strict';var schema=require(_0x152e('0x0'));var _=require(_0x152e('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x152e('0x2')),'faxInteraction':require(_0x152e('0x3')),'whatsappInteraction':require(_0x152e('0x4'))};var logger=require(_0x152e('0x5'))(_0x152e('0x6'));var tag=schema({'tag':{'type':_0x152e('0x7'),'required':!![],'message':_0x152e('0x8')}});exports['consequence']=function(_0x3b4b88,_0xd36228,_0x5a2102,_0x30c0ae){return function(_0x5f3bc6){try{var _0x337d73={'tag':_0xd36228[0x0]};var _0x2512a4=tag[_0x152e('0x0')](_0x337d73,{'typecast':!![]});if(_0x2512a4[_0x152e('0x9')]){logger['error'](_0x152e('0xa'),_0x3b4b88,_['map'](_0x2512a4,_0x152e('0xb'))[_0x152e('0xc')](',\x20'));logger[_0x152e('0xd')](_0x152e('0xe'),_0x3b4b88);_0x5f3bc6[_0x152e('0xf')]();}else{var _0x18a715={'ids':[_0xd36228[0x0]]};if(rpc[_0x30c0ae[_0x152e('0x10')]+'Interaction']){rpc[_0x30c0ae['channel']+'Interaction'][_0x152e('0x11')](_0x30c0ae[_0x152e('0x12')]['id'],_0x18a715)['then'](function(_0x386244){logger[_0x152e('0xd')](_0x152e('0x13'),_0x3b4b88,_0xd36228[0x1],_0x30c0ae[_0x152e('0x10')],_0x30c0ae[_0x152e('0x12')]['id']);})['catch'](function(_0x118f2d){logger['error']('[%s][TAG]\x20%s',_0x3b4b88,JSON[_0x152e('0x14')](_0x118f2d));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3b4b88);})[_0x152e('0x15')](function(){_0x5f3bc6[_0x152e('0xf')]();});}}}catch(_0x33657e){logger[_0x152e('0x16')](_0x152e('0xa'),_0x3b4b88,_[_0x152e('0x17')](_0x33657e)?JSON[_0x152e('0x14')](_0x33657e):_0x33657e);logger[_0x152e('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3b4b88);_0x5f3bc6['next']();}};};
\ No newline at end of file
index d810785..9b0ef75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x572c5f,_0x3ebba6){var _0x2d023e=function(_0x2783c6){while(--_0x2783c6){_0x572c5f['push'](_0x572c5f['shift']());}};_0x2d023e(++_0x3ebba6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
+var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0xdced13,_0x3de9ad){var _0x3170f4=function(_0xe51054){while(--_0xe51054){_0xdced13['push'](_0xdced13['shift']());}};_0x3170f4(++_0x3de9ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 bed33d0..8f33662 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb726=['emit','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','message\x20is\x20empty','stack','end','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','.js','app','toLowerCase','autoreply','appdata','channel','mail','push','slice','join','split','dialogflowv2','amazonlex','TagId','format','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed'];(function(_0x4349e6,_0x92758e){var _0x4caae0=function(_0x5cb21a){while(--_0x5cb21a){_0x4349e6['push'](_0x4349e6['shift']());}};_0x4caae0(++_0x92758e);}(_0xb726,0xe4));var _0x6b72=function(_0x515966,_0x2177a5){_0x515966=_0x515966-0x0;var _0x5bdbd9=_0xb726[_0x515966];return _0x5bdbd9;};'use strict';var _=require(_0x6b72('0x0'));var util=require('util');var path=require(_0x6b72('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x6b72('0x2'));var uuid=require(_0x6b72('0x3'));var config=require(_0x6b72('0x4'));var logger=require(_0x6b72('0x5'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x6b72('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x6b72('0x7')),'whatsappQueueReport':require(_0x6b72('0x8'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x3b864c,_0x102634,_0x44ae7b){return util['format'](_0x6b72('0x9'),_0x3b864c,_0x102634||0x0,_0x44ae7b||0x0);}function getIntervals(_0x570a32,_0x54911c){var _0xcb4841=[];if(!_[_0x6b72('0xa')](_0x54911c[_0x6b72('0xb')])&&!_[_0x6b72('0xa')](_0x570a32[_0x54911c[_0x6b72('0xb')]])&&!_[_0x6b72('0xa')](_0x570a32[_0x54911c['IntervalId']][_0x6b72('0xc')])){_0xcb4841=_[_0x6b72('0xd')](_0x570a32[_0x54911c[_0x6b72('0xb')]]['Intervals'],_0x6b72('0xe'));}else if(!_[_0x6b72('0xa')](_0x54911c[_0x6b72('0xe')])){_0xcb4841=[_0x54911c[_0x6b72('0xe')]];}return _0xcb4841;}exports[_0x6b72('0xf')]=function(_0x45e35d){_0x45e35d[_0x6b72('0x10')]={};return new BPromise(function(_0xd30abb,_0x4e93a2){var _0x948ac={'Start':function(_0x3c1644){var _0x40d913=this;return new Promise(function(_0xef0282,_0x1001c7){if(_0x3c1644){try{var _0x29723a=[];var _0x4f462d=getId(_0x3c1644['channel'],_0x3c1644['message']?_0x3c1644[_0x6b72('0x11')]['id']:0x0,_0x3c1644['interaction']?_0x3c1644[_0x6b72('0x12')]['id']:0x0);if(_0x3c1644[_0x6b72('0x13')]&&_[_0x6b72('0x14')](_0x3c1644[_0x6b72('0x13')])&&_0x3c1644[_0x6b72('0x13')]['length']){for(var _0x22d7d6=0x0;_0x22d7d6<_0x3c1644[_0x6b72('0x13')][_0x6b72('0x15')];_0x22d7d6+=0x1){var _0x6f0212=_0x3c1644[_0x6b72('0x13')][_0x22d7d6];if(fs[_0x6b72('0x16')](path['join'](__dirname,_0x6b72('0x13'),_0x6f0212['app']+_0x6b72('0x17')))){var _0x4a09aa=[];switch(_0x6f0212[_0x6b72('0x18')][_0x6b72('0x19')]()){case _0x6b72('0x1a'):var _0x239962=_0x6f0212[_0x6b72('0x1b')]['split'](',');if(_0x3c1644[_0x6b72('0x1c')]===_0x6b72('0x1d')){_0x4a09aa['push'](_0x239962[0x0]);_0x4a09aa[_0x6b72('0x1e')](_0x239962[0x1]);_0x4a09aa[_0x6b72('0x1e')](_0x239962[_0x6b72('0x1f')](0x2,_0x239962[_0x6b72('0x15')])[_0x6b72('0x20')](','));}else{_0x4a09aa['push'](_0x239962[0x0]);_0x4a09aa['push'](_0x239962[_0x6b72('0x1f')](0x1,_0x239962[_0x6b72('0x15')])[_0x6b72('0x20')](','));}break;case'dialogflow':var _0x491e29=_0x6f0212[_0x6b72('0x1b')][_0x6b72('0x21')](',');_0x4a09aa['push'](_0x491e29[0x0]);_0x4a09aa['push'](_0x491e29[0x1]);_0x4a09aa[_0x6b72('0x1e')](_0x491e29[_0x6b72('0x1f')](0x2,_0x491e29[_0x6b72('0x15')])[_0x6b72('0x20')](','));break;case _0x6b72('0x22'):var _0x1e300c=_0x6f0212[_0x6b72('0x1b')][_0x6b72('0x21')](',');_0x4a09aa[_0x6b72('0x1e')](_0x1e300c[0x0]);_0x4a09aa['push'](_0x1e300c[0x1]);_0x4a09aa[_0x6b72('0x1e')](_0x1e300c[0x2]);_0x4a09aa[_0x6b72('0x1e')](_0x1e300c[0x3]);_0x4a09aa['push'](_0x1e300c[_0x6b72('0x1f')](0x4,_0x1e300c[_0x6b72('0x15')])[_0x6b72('0x20')](','));break;case _0x6b72('0x23'):var _0x1340e3=_0x6f0212['appdata'][_0x6b72('0x21')](',');_0x4a09aa['push'](_0x1340e3[0x0]);_0x4a09aa[_0x6b72('0x1e')](_0x1340e3[0x1]);_0x4a09aa[_0x6b72('0x1e')](_0x1340e3[0x2]);_0x4a09aa[_0x6b72('0x1e')](_0x1340e3[0x3]);_0x4a09aa[_0x6b72('0x1e')](_0x1340e3[_0x6b72('0x1f')](0x4,_0x1340e3['length'])[_0x6b72('0x20')](','));break;case'message':_0x4a09aa[_0x6b72('0x1e')](_0x6f0212['appdata']);break;case'tag':_0x4a09aa[_0x6b72('0x1e')](_0x6f0212[_0x6b72('0x24')]);_0x4a09aa[_0x6b72('0x1e')](_0x6f0212['appdata']);break;default:_0x4a09aa=_['isNil'](_0x6f0212[_0x6b72('0x1b')])?[]:_0x6f0212[_0x6b72('0x1b')][_0x6b72('0x21')](',');}var _0x153100={'id':util[_0x6b72('0x25')]('%s:%s:%s',_0x4f462d,_0x6f0212['id'],_0x6f0212[_0x6b72('0x18')]),'condition':require(_0x6b72('0x26'))[_0x6b72('0x27')](_0x4f462d,getIntervals(_0x45e35d[_0x6b72('0x28')],_0x6f0212),_0x45e35d),'consequence':require(_0x6b72('0x29')+_0x6f0212['app'])[_0x6b72('0x2a')](_0x4f462d,_0x4a09aa,_0x45e35d,_0x3c1644),'p':_0x6f0212[_0x6b72('0x2b')]||0x0};logger[_0x6b72('0x2c')](_0x6b72('0x2d'),_0x153100['id'],_0x6b72('0x2e'),getIntervals(_0x45e35d[_0x6b72('0x28')],_0x6f0212)[_0x6b72('0x20')](_0x6b72('0x2f')));_0x29723a['push'](_0x153100);}else{logger['error'](_0x6b72('0x30'),path['join'](__dirname,_0x6b72('0x13'),_0x6f0212[_0x6b72('0x18')]+'.js'));}}_0x45e35d[_0x6b72('0x10')][_0x4f462d]=new RuleEngine(_0x29723a);_0x45e35d[_0x6b72('0x10')][_0x4f462d][_0x6b72('0x31')](_0x3c1644,function(_0x1cfd01){logger[_0x6b72('0x2c')](_0x6b72('0x32'),JSON['stringify'](_0x1cfd01['matchPath']));if(_0x45e35d[_0x6b72('0x10')][_0x4f462d]){_0x45e35d[_0x6b72('0x10')][_0x4f462d][_0x6b72('0x33')]('complete');}});return _0xef0282({'code':0xc8,'message':_0x3c1644});}else{logger[_0x6b72('0x2c')](_0x6b72('0x34'));return _0xef0282({'code':0xc8,'message':_0x3c1644});}}catch(_0xa32ba4){logger[_0x6b72('0x35')](_0xa32ba4['stack']);return _0x1001c7(_0x40d913[_0x6b72('0x35')](0x1f4,_0xa32ba4));}}return _0x1001c7(_0x6b72('0x36'));});},'AcceptMessage':function(_0x5346f0){var _0x18b411=this;return new Promise(function(_0x3cf91d,_0xd852c3){if(_0x5346f0[_0x6b72('0x37')]&&_0x5346f0[_0x6b72('0x37')]['id']){if(_0x45e35d[_0x6b72('0x38')][_0x5346f0[_0x6b72('0x37')]['id']]){_0x45e35d[_0x6b72('0x38')][_0x5346f0[_0x6b72('0x37')]['id']][_0x6b72('0x39')]=![];_0x45e35d[_0x6b72('0x38')][_0x5346f0['agent']['id']][_0x6b72('0x3a')]=undefined;}}if(_0x5346f0[_0x6b72('0x11')]&&_0x5346f0[_0x6b72('0x11')]['id']){try{var _0x24ffde=getId(_0x5346f0[_0x6b72('0x1c')],_0x5346f0[_0x6b72('0x11')]?_0x5346f0[_0x6b72('0x11')]['id']:0x0,_0x5346f0[_0x6b72('0x12')]?_0x5346f0[_0x6b72('0x12')]['id']:0x0);if(_0x45e35d[_0x6b72('0x10')][_0x24ffde]){_0x45e35d[_0x6b72('0x10')][_0x24ffde]['emit']('end');if(rpc[_0x5346f0[_0x6b72('0x1c')]+_0x6b72('0x3b')]){rpc[_0x5346f0['channel']+_0x6b72('0x3b')][_0x6b72('0x3c')](_0x24ffde,{'UserId':_0x5346f0[_0x6b72('0x11')][_0x6b72('0x3d')]})[_0x6b72('0x3e')](function(_0x3556e6){logger[_0x6b72('0x35')]('error\x20update\x20queue\x20report');});}}return _0x3cf91d({'code':0xc8,'message':_0x5346f0});}catch(_0x357dd0){logger[_0x6b72('0x35')](_0x357dd0['stack']);return _0xd852c3(_0x18b411[_0x6b72('0x35')](0x1f4,_0x357dd0));}}logger[_0x6b72('0x35')](_0x6b72('0x3f'));return _0xd852c3(_0x18b411[_0x6b72('0x35')](0x1f4,_0x6b72('0x3f')));});},'RejectMessage':function(_0x58c7c7){var _0x44bd25=this;return new Promise(function(_0x11168f,_0x4ed7b4){if(_0x58c7c7[_0x6b72('0x37')]&&_0x58c7c7['agent']['id']){try{if(_0x45e35d[_0x6b72('0x38')][_0x58c7c7[_0x6b72('0x37')]['id']]){_0x45e35d['agents'][_0x58c7c7[_0x6b72('0x37')]['id']][_0x6b72('0x39')]=![];_0x45e35d['agents'][_0x58c7c7[_0x6b72('0x37')]['id']][_0x6b72('0x3a')]=undefined;}return _0x11168f({'code':0xc8,'message':_0x58c7c7});}catch(_0x2f25a3){logger[_0x6b72('0x35')](_0x2f25a3[_0x6b72('0x40')]);return _0x4ed7b4(_0x44bd25[_0x6b72('0x35')](0x1f4,_0x2f25a3));}}logger[_0x6b72('0x35')](_0x6b72('0x3f'));return _0x4ed7b4(_0x44bd25['error'](0x1f4,_0x6b72('0x3f')));});},'AbandonInteraction':function(_0x256f0c){var _0x5bd579=this;return new Promise(function(_0x1756e6,_0x527075){if(_0x256f0c[_0x6b72('0x1c')]&&_0x256f0c[_0x6b72('0x12')]&&_0x256f0c[_0x6b72('0x12')]['id']){try{var _0x2c253f=getId(_0x256f0c['channel'],_0x256f0c[_0x6b72('0x11')]?_0x256f0c[_0x6b72('0x11')]['id']:0x0,_0x256f0c[_0x6b72('0x12')]?_0x256f0c[_0x6b72('0x12')]['id']:0x0);if(_0x45e35d[_0x6b72('0x10')][_0x2c253f]){_0x45e35d[_0x6b72('0x10')][_0x2c253f][_0x6b72('0x33')](_0x6b72('0x41'));}return _0x1756e6({'code':0xc8,'message':_0x256f0c});}catch(_0x587688){logger['error'](_0x587688[_0x6b72('0x40')]);return _0x527075(_0x5bd579[_0x6b72('0x35')](0x1f4,_0x587688));}}logger[_0x6b72('0x35')](_0x6b72('0x3f'));return _0x527075(_0x5bd579[_0x6b72('0x35')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0xab1175){var _0x5e83bf=this;return new Promise(function(_0x704bed,_0x1f009e){if(_0x45e35d[_0x6b72('0x38')]['hasOwnProperty'](_0xab1175['id'])){for(var _0x13de38 in _0xab1175['capacity']){if(_0xab1175['capacity'][_0x6b72('0x42')](_0x13de38)){if(_0x45e35d[_0x6b72('0x38')][_0xab1175['id']][_0x6b72('0x42')](_0x13de38+_0x6b72('0x43'))){_0x45e35d[_0x6b72('0x38')][_0xab1175['id']][_0x13de38+_0x6b72('0x43')]=parseInt(_0xab1175['capacity'][_0x13de38],0xa);}}}_0x45e35d[_0x6b72('0x38')][_0xab1175['id']][_0x6b72('0x44')]();return _0x704bed({'code':0xc8,'message':_0x45e35d['agents'][_0xab1175['id']]});}else{return _0x1f009e(_0x5e83bf[_0x6b72('0x35')](0x1f4,_0x6b72('0x45')));}});},'Agents':function(_0x23e36e){return new Promise(function(_0x28eb8d,_0x2671a1){var _0x1a60b4=_[_0x6b72('0x46')](_0x45e35d[_0x6b72('0x38')]);_0x28eb8d({'count':_0x1a60b4[_0x6b72('0x15')],'rows':_0x1a60b4});});},'ChatQueues':function(_0x31cbaa){return new Promise(function(_0x223d53,_0x3c5ed){var _0x5be48e=[];for(var _0x580e46 in _0x45e35d[_0x6b72('0x47')]){if(_0x45e35d[_0x6b72('0x47')][_0x6b72('0x42')](_0x580e46)){var _0x2d6356=_0x45e35d[_0x6b72('0x47')][_0x580e46];var _0x3bd865={'id':_0x2d6356['id'],'available':_0x2d6356[_0x6b72('0x48')],'loggedIn':_0x2d6356[_0x6b72('0x49')],'name':_0x2d6356[_0x6b72('0x4a')],'paused':_0x2d6356[_0x6b72('0x4b')],'waiting':_0x2d6356[_0x6b72('0x4c')]};_0x5be48e[_0x6b72('0x1e')](_0x3bd865);}}_0x223d53({'count':_0x5be48e[_0x6b72('0x15')],'rows':_0x5be48e});});},'MailQueues':function(_0x3d3c46){return new Promise(function(_0xbac301,_0x2878c2){var _0x53d9cd=[];for(var _0x1a903d in _0x45e35d[_0x6b72('0x4d')]){if(_0x45e35d[_0x6b72('0x4d')]['hasOwnProperty'](_0x1a903d)){var _0x2563b0=_0x45e35d[_0x6b72('0x4d')][_0x1a903d];var _0x1ae4cc={'id':_0x2563b0['id'],'available':_0x2563b0[_0x6b72('0x48')],'loggedIn':_0x2563b0[_0x6b72('0x49')],'name':_0x2563b0[_0x6b72('0x4a')],'paused':_0x2563b0[_0x6b72('0x4b')],'waiting':_0x2563b0[_0x6b72('0x4c')]};_0x53d9cd['push'](_0x1ae4cc);}}_0xbac301({'count':_0x53d9cd[_0x6b72('0x15')],'rows':_0x53d9cd});});},'OpenchannelQueues':function(_0x56bc4f){return new Promise(function(_0x3334ff,_0x75aca4){var _0x27b6f0=[];for(var _0x2bf297 in _0x45e35d['openchannelQueues']){if(_0x45e35d[_0x6b72('0x4e')][_0x6b72('0x42')](_0x2bf297)){var _0xdefdb1=_0x45e35d[_0x6b72('0x4e')][_0x2bf297];var _0x361f79={'id':_0xdefdb1['id'],'available':_0xdefdb1[_0x6b72('0x48')],'loggedIn':_0xdefdb1[_0x6b72('0x49')],'name':_0xdefdb1[_0x6b72('0x4a')],'paused':_0xdefdb1['paused'],'waiting':_0xdefdb1[_0x6b72('0x4c')]};_0x27b6f0[_0x6b72('0x1e')](_0x361f79);}}_0x3334ff({'count':_0x27b6f0[_0x6b72('0x15')],'rows':_0x27b6f0});});},'SmsQueues':function(_0x1c2794){return new Promise(function(_0x474dd5,_0x49917c){var _0x13a60a=[];for(var _0x443ab4 in _0x45e35d['smsQueues']){if(_0x45e35d[_0x6b72('0x4f')][_0x6b72('0x42')](_0x443ab4)){var _0x588b61=_0x45e35d['smsQueues'][_0x443ab4];var _0x5e7d58={'id':_0x588b61['id'],'available':_0x588b61[_0x6b72('0x48')],'loggedIn':_0x588b61[_0x6b72('0x49')],'name':_0x588b61[_0x6b72('0x4a')],'paused':_0x588b61[_0x6b72('0x4b')],'waiting':_0x588b61[_0x6b72('0x4c')]};_0x13a60a[_0x6b72('0x1e')](_0x5e7d58);}}_0x474dd5({'count':_0x13a60a[_0x6b72('0x15')],'rows':_0x13a60a});});},'FaxQueues':function(_0x2bfe40){return new Promise(function(_0x1bee65,_0x3a01fb){var _0x1e3d7c=[];for(var _0x3b8a5d in _0x45e35d['faxQueues']){if(_0x45e35d['faxQueues'][_0x6b72('0x42')](_0x3b8a5d)){var _0x57f7a8=_0x45e35d[_0x6b72('0x50')][_0x3b8a5d];var _0x32d4f3={'id':_0x57f7a8['id'],'available':_0x57f7a8[_0x6b72('0x48')],'loggedIn':_0x57f7a8['loggedIn'],'name':_0x57f7a8[_0x6b72('0x4a')],'paused':_0x57f7a8[_0x6b72('0x4b')],'waiting':_0x57f7a8[_0x6b72('0x4c')]};_0x1e3d7c['push'](_0x32d4f3);}}_0x1bee65({'count':_0x1e3d7c['length'],'rows':_0x1e3d7c});});},'WhatsappQueues':function(_0x2d937c){return new Promise(function(_0x173017,_0x4b0643){var _0x464d46=[];for(var _0x517fb1 in _0x45e35d[_0x6b72('0x51')]){if(_0x45e35d[_0x6b72('0x51')][_0x6b72('0x42')](_0x517fb1)){var _0x288220=_0x45e35d[_0x6b72('0x51')][_0x517fb1];var _0x400327={'id':_0x288220['id'],'available':_0x288220['available'],'loggedIn':_0x288220[_0x6b72('0x49')],'name':_0x288220[_0x6b72('0x4a')],'paused':_0x288220[_0x6b72('0x4b')],'waiting':_0x288220[_0x6b72('0x4c')]};_0x464d46[_0x6b72('0x1e')](_0x400327);}}_0x173017({'count':_0x464d46[_0x6b72('0x15')],'rows':_0x464d46});});},'ChatQueuesWaitingInteractions':function(_0x34ccd8){return new Promise(function(_0x15203a,_0x59351c){var _0x3b01f0=_[_0x6b72('0x46')](_0x45e35d[_0x6b72('0x52')]);_0x15203a({'count':_0x3b01f0['length'],'rows':_0x3b01f0});});},'MailQueuesWaitingInteractions':function(_0x3bd3d5){return new Promise(function(_0x41f569,_0x268234){var _0x19e052=_['values'](_0x45e35d[_0x6b72('0x53')]);_0x41f569({'count':_0x19e052[_0x6b72('0x15')],'rows':_0x19e052});});},'OpenchannelQueuesWaitingInteractions':function(_0xa64bd5){return new Promise(function(_0x3566a9,_0x460577){var _0x25447f=_[_0x6b72('0x46')](_0x45e35d['openchannelQueuesWaitingInteractions']);_0x3566a9({'count':_0x25447f[_0x6b72('0x15')],'rows':_0x25447f});});},'SmsQueuesWaitingInteractions':function(_0x4e9e4f){return new Promise(function(_0x4120f4,_0x5dacbc){var _0x3d94e0=_[_0x6b72('0x46')](_0x45e35d[_0x6b72('0x54')]);_0x4120f4({'count':_0x3d94e0[_0x6b72('0x15')],'rows':_0x3d94e0});});},'FaxQueuesWaitingInteractions':function(_0x52548f){return new Promise(function(_0x31c268,_0xede7e0){var _0x3f82df=_[_0x6b72('0x46')](_0x45e35d[_0x6b72('0x55')]);_0x31c268({'count':_0x3f82df[_0x6b72('0x15')],'rows':_0x3f82df});});},'WhatsappQueuesWaitingInteractions':function(_0x38fccf){return new Promise(function(_0x3dbfb5,_0x48c72a){var _0x224d83=_[_0x6b72('0x46')](_0x45e35d[_0x6b72('0x56')]);_0x3dbfb5({'count':_0x224d83[_0x6b72('0x15')],'rows':_0x224d83});});}};var _0x440eb1=jayson[_0x6b72('0x57')](_0x948ac)[_0x6b72('0x58')]();_0x440eb1['on'](_0x6b72('0x35'),function(_0x104415){logger[_0x6b72('0x35')](JSON[_0x6b72('0x59')](_0x104415));return _0x4e93a2(_0x104415);});_0x440eb1[_0x6b72('0xf')](0x232c,_0x6b72('0x5a'),function(){console[_0x6b72('0x5b')](_0x6b72('0x5c'),0x232c);return _0xd30abb('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0x5af8=['http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','tag','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','Push\x20new\x20rule','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','info','Applications\x20executed','stringify','complete','No\x20applications\x20to\x20execute','stack','error','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','emit','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions'];(function(_0x2f2ed0,_0x1c6435){var _0x250b0d=function(_0x1909c1){while(--_0x1909c1){_0x2f2ed0['push'](_0x2f2ed0['shift']());}};_0x250b0d(++_0x1c6435);}(_0x5af8,0x119));var _0x85af=function(_0x5926fd,_0x2a52a6){_0x5926fd=_0x5926fd-0x0;var _0x697f6d=_0x5af8[_0x5926fd];return _0x697f6d;};'use strict';var _=require(_0x85af('0x0'));var util=require('util');var path=require(_0x85af('0x1'));var fs=require('fs');var jayson=require(_0x85af('0x2'));var BPromise=require(_0x85af('0x3'));var uuid=require(_0x85af('0x4'));var config=require(_0x85af('0x5'));var logger=require(_0x85af('0x6'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x85af('0x7')),'chatQueueReport':require(_0x85af('0x8')),'smsQueueReport':require(_0x85af('0x9')),'faxQueueReport':require(_0x85af('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x85af('0xb'));function getId(_0x2a4396,_0x38d60e,_0x579af8){return util[_0x85af('0xc')](_0x85af('0xd'),_0x2a4396,_0x38d60e||0x0,_0x579af8||0x0);}function getIntervals(_0x38e15d,_0x4282e1){var _0x52455a=[];if(!_[_0x85af('0xe')](_0x4282e1[_0x85af('0xf')])&&!_[_0x85af('0xe')](_0x38e15d[_0x4282e1['IntervalId']])&&!_[_0x85af('0xe')](_0x38e15d[_0x4282e1[_0x85af('0xf')]][_0x85af('0x10')])){_0x52455a=_[_0x85af('0x11')](_0x38e15d[_0x4282e1['IntervalId']][_0x85af('0x10')],_0x85af('0x12'));}else if(!_[_0x85af('0xe')](_0x4282e1[_0x85af('0x12')])){_0x52455a=[_0x4282e1['interval']];}return _0x52455a;}exports['listen']=function(_0x3373ea){_0x3373ea[_0x85af('0x13')]={};return new BPromise(function(_0x550bb7,_0x21b6dd){var _0x30a041={'Start':function(_0x43e6b8){var _0x4df341=this;return new Promise(function(_0x3ee108,_0x2a7cfd){if(_0x43e6b8){try{var _0x1f6e75=[];var _0x24d561=getId(_0x43e6b8[_0x85af('0x14')],_0x43e6b8[_0x85af('0x15')]?_0x43e6b8[_0x85af('0x15')]['id']:0x0,_0x43e6b8[_0x85af('0x16')]?_0x43e6b8[_0x85af('0x16')]['id']:0x0);if(_0x43e6b8[_0x85af('0x17')]&&_[_0x85af('0x18')](_0x43e6b8[_0x85af('0x17')])&&_0x43e6b8[_0x85af('0x17')][_0x85af('0x19')]){for(var _0x2624f1=0x0;_0x2624f1<_0x43e6b8['applications'][_0x85af('0x19')];_0x2624f1+=0x1){var _0x36d38f=_0x43e6b8[_0x85af('0x17')][_0x2624f1];if(fs[_0x85af('0x1a')](path[_0x85af('0x1b')](__dirname,_0x85af('0x17'),_0x36d38f[_0x85af('0x1c')]+'.js'))){var _0x2ca1fa=[];switch(_0x36d38f['app'][_0x85af('0x1d')]()){case _0x85af('0x1e'):var _0x1e9ebe=_0x36d38f[_0x85af('0x1f')][_0x85af('0x20')](',');if(_0x43e6b8[_0x85af('0x14')]===_0x85af('0x21')){_0x2ca1fa['push'](_0x1e9ebe[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x1e9ebe[0x1]);_0x2ca1fa[_0x85af('0x22')](_0x1e9ebe['slice'](0x2,_0x1e9ebe[_0x85af('0x19')])['join'](','));}else{_0x2ca1fa[_0x85af('0x22')](_0x1e9ebe[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x1e9ebe[_0x85af('0x23')](0x1,_0x1e9ebe[_0x85af('0x19')])[_0x85af('0x1b')](','));}break;case'dialogflow':var _0x13addd=_0x36d38f[_0x85af('0x1f')]['split'](',');_0x2ca1fa['push'](_0x13addd[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x13addd[0x1]);_0x2ca1fa['push'](_0x13addd[_0x85af('0x23')](0x2,_0x13addd[_0x85af('0x19')])[_0x85af('0x1b')](','));break;case _0x85af('0x24'):var _0x73bdcd=_0x36d38f[_0x85af('0x1f')]['split'](',');_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[0x1]);_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[0x2]);_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[0x3]);_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[_0x85af('0x23')](0x4,_0x73bdcd['length'])[_0x85af('0x1b')](','));break;case'amazonlex':var _0x3ccbb6=_0x36d38f[_0x85af('0x1f')][_0x85af('0x20')](',');_0x2ca1fa[_0x85af('0x22')](_0x3ccbb6[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x3ccbb6[0x1]);_0x2ca1fa['push'](_0x3ccbb6[0x2]);_0x2ca1fa[_0x85af('0x22')](_0x3ccbb6[0x3]);_0x2ca1fa[_0x85af('0x22')](_0x3ccbb6[_0x85af('0x23')](0x4,_0x3ccbb6['length'])['join'](','));break;case _0x85af('0x15'):_0x2ca1fa[_0x85af('0x22')](_0x36d38f[_0x85af('0x1f')]);break;case _0x85af('0x25'):_0x2ca1fa[_0x85af('0x22')](_0x36d38f['TagId']);_0x2ca1fa[_0x85af('0x22')](_0x36d38f[_0x85af('0x1f')]);break;default:_0x2ca1fa=_[_0x85af('0xe')](_0x36d38f[_0x85af('0x1f')])?[]:_0x36d38f[_0x85af('0x1f')][_0x85af('0x20')](',');}var _0x2d290b={'id':util[_0x85af('0xc')](_0x85af('0x26'),_0x24d561,_0x36d38f['id'],_0x36d38f['app']),'condition':require(_0x85af('0x27'))[_0x85af('0x28')](_0x24d561,getIntervals(_0x3373ea[_0x85af('0x29')],_0x36d38f),_0x3373ea),'consequence':require(_0x85af('0x2a')+_0x36d38f[_0x85af('0x1c')])[_0x85af('0x2b')](_0x24d561,_0x2ca1fa,_0x3373ea,_0x43e6b8),'p':_0x36d38f['priority']||0x0};logger['info'](_0x85af('0x2c'),_0x2d290b['id'],'on\x20interval',getIntervals(_0x3373ea[_0x85af('0x29')],_0x36d38f)['join'](_0x85af('0x2d')));_0x1f6e75[_0x85af('0x22')](_0x2d290b);}else{logger['error'](_0x85af('0x2e'),path[_0x85af('0x1b')](__dirname,_0x85af('0x17'),_0x36d38f['app']+'.js'));}}_0x3373ea[_0x85af('0x13')][_0x24d561]=new RuleEngine(_0x1f6e75);_0x3373ea[_0x85af('0x13')][_0x24d561]['execute'](_0x43e6b8,function(_0x1deef6){logger[_0x85af('0x2f')](_0x85af('0x30'),JSON[_0x85af('0x31')](_0x1deef6['matchPath']));if(_0x3373ea[_0x85af('0x13')][_0x24d561]){_0x3373ea[_0x85af('0x13')][_0x24d561]['emit'](_0x85af('0x32'));}});return _0x3ee108({'code':0xc8,'message':_0x43e6b8});}else{logger['info'](_0x85af('0x33'));return _0x3ee108({'code':0xc8,'message':_0x43e6b8});}}catch(_0x380700){logger['error'](_0x380700[_0x85af('0x34')]);return _0x2a7cfd(_0x4df341[_0x85af('0x35')](0x1f4,_0x380700));}}return _0x2a7cfd('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2bc682){var _0x3554c4=this;return new Promise(function(_0x420090,_0x4c499f){if(_0x2bc682['agent']&&_0x2bc682[_0x85af('0x36')]['id']){if(_0x3373ea[_0x85af('0x37')][_0x2bc682[_0x85af('0x36')]['id']]){_0x3373ea[_0x85af('0x37')][_0x2bc682['agent']['id']][_0x85af('0x38')]=![];_0x3373ea[_0x85af('0x37')][_0x2bc682[_0x85af('0x36')]['id']][_0x85af('0x39')]=undefined;}}if(_0x2bc682[_0x85af('0x15')]&&_0x2bc682['message']['id']){try{var _0x23e580=getId(_0x2bc682[_0x85af('0x14')],_0x2bc682[_0x85af('0x15')]?_0x2bc682[_0x85af('0x15')]['id']:0x0,_0x2bc682[_0x85af('0x16')]?_0x2bc682[_0x85af('0x16')]['id']:0x0);if(_0x3373ea['rules'][_0x23e580]){_0x3373ea['rules'][_0x23e580]['emit']('end');if(rpc[_0x2bc682[_0x85af('0x14')]+_0x85af('0x3a')]){rpc[_0x2bc682[_0x85af('0x14')]+_0x85af('0x3a')][_0x85af('0x3b')](_0x23e580,{'UserId':_0x2bc682[_0x85af('0x15')][_0x85af('0x3c')]})[_0x85af('0x3d')](function(_0x59866d){logger[_0x85af('0x35')](_0x85af('0x3e'));});}}return _0x420090({'code':0xc8,'message':_0x2bc682});}catch(_0x7143ee){logger[_0x85af('0x35')](_0x7143ee[_0x85af('0x34')]);return _0x4c499f(_0x3554c4['error'](0x1f4,_0x7143ee));}}logger['error'](_0x85af('0x3f'));return _0x4c499f(_0x3554c4[_0x85af('0x35')](0x1f4,_0x85af('0x3f')));});},'RejectMessage':function(_0x379739){var _0x2b1a2b=this;return new Promise(function(_0x153023,_0x32316f){if(_0x379739[_0x85af('0x36')]&&_0x379739[_0x85af('0x36')]['id']){try{if(_0x3373ea[_0x85af('0x37')][_0x379739[_0x85af('0x36')]['id']]){_0x3373ea['agents'][_0x379739[_0x85af('0x36')]['id']][_0x85af('0x38')]=![];_0x3373ea['agents'][_0x379739[_0x85af('0x36')]['id']][_0x85af('0x39')]=undefined;}return _0x153023({'code':0xc8,'message':_0x379739});}catch(_0x15b67b){logger[_0x85af('0x35')](_0x15b67b[_0x85af('0x34')]);return _0x32316f(_0x2b1a2b[_0x85af('0x35')](0x1f4,_0x15b67b));}}logger[_0x85af('0x35')](_0x85af('0x3f'));return _0x32316f(_0x2b1a2b[_0x85af('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x454964){var _0x416039=this;return new Promise(function(_0x284074,_0x476161){if(_0x454964['channel']&&_0x454964['interaction']&&_0x454964[_0x85af('0x16')]['id']){try{var _0x217ee3=getId(_0x454964[_0x85af('0x14')],_0x454964[_0x85af('0x15')]?_0x454964['message']['id']:0x0,_0x454964['interaction']?_0x454964[_0x85af('0x16')]['id']:0x0);if(_0x3373ea[_0x85af('0x13')][_0x217ee3]){_0x3373ea['rules'][_0x217ee3][_0x85af('0x40')](_0x85af('0x41'));}return _0x284074({'code':0xc8,'message':_0x454964});}catch(_0x440430){logger[_0x85af('0x35')](_0x440430[_0x85af('0x34')]);return _0x476161(_0x416039['error'](0x1f4,_0x440430));}}logger[_0x85af('0x35')](_0x85af('0x3f'));return _0x476161(_0x416039[_0x85af('0x35')](0x1f4,_0x85af('0x3f')));});},'AgentCapacity':function(_0x2be6ca){var _0xd31c23=this;return new Promise(function(_0x27e045,_0x120872){if(_0x3373ea['agents'][_0x85af('0x42')](_0x2be6ca['id'])){for(var _0x3f1007 in _0x2be6ca[_0x85af('0x43')]){if(_0x2be6ca[_0x85af('0x43')][_0x85af('0x42')](_0x3f1007)){if(_0x3373ea[_0x85af('0x37')][_0x2be6ca['id']][_0x85af('0x42')](_0x3f1007+'CurrentCapacity')){_0x3373ea[_0x85af('0x37')][_0x2be6ca['id']][_0x3f1007+_0x85af('0x44')]=parseInt(_0x2be6ca[_0x85af('0x43')][_0x3f1007],0xa);}}}_0x3373ea[_0x85af('0x37')][_0x2be6ca['id']][_0x85af('0x45')]();return _0x27e045({'code':0xc8,'message':_0x3373ea[_0x85af('0x37')][_0x2be6ca['id']]});}else{return _0x120872(_0xd31c23[_0x85af('0x35')](0x1f4,_0x85af('0x46')));}});},'Agents':function(_0x1ced41){return new Promise(function(_0x1f6a6d,_0x4b12ed){var _0x13a81c=_[_0x85af('0x47')](_0x3373ea['agents']);_0x1f6a6d({'count':_0x13a81c[_0x85af('0x19')],'rows':_0x13a81c});});},'ChatQueues':function(_0x5b83cc){return new Promise(function(_0x5ab712,_0x4f97f9){var _0x1e8e95=[];for(var _0x25c6ad in _0x3373ea[_0x85af('0x48')]){if(_0x3373ea['chatQueues']['hasOwnProperty'](_0x25c6ad)){var _0x1a727d=_0x3373ea[_0x85af('0x48')][_0x25c6ad];var _0x41d014={'id':_0x1a727d['id'],'available':_0x1a727d[_0x85af('0x49')],'loggedIn':_0x1a727d[_0x85af('0x4a')],'name':_0x1a727d[_0x85af('0x4b')],'paused':_0x1a727d['paused'],'waiting':_0x1a727d[_0x85af('0x4c')]};_0x1e8e95[_0x85af('0x22')](_0x41d014);}}_0x5ab712({'count':_0x1e8e95[_0x85af('0x19')],'rows':_0x1e8e95});});},'MailQueues':function(_0x414d3b){return new Promise(function(_0x3e2e5c,_0x39c97c){var _0x28f50d=[];for(var _0x502620 in _0x3373ea[_0x85af('0x4d')]){if(_0x3373ea['mailQueues'][_0x85af('0x42')](_0x502620)){var _0x2fcee1=_0x3373ea[_0x85af('0x4d')][_0x502620];var _0x3a8c0f={'id':_0x2fcee1['id'],'available':_0x2fcee1[_0x85af('0x49')],'loggedIn':_0x2fcee1['loggedIn'],'name':_0x2fcee1[_0x85af('0x4b')],'paused':_0x2fcee1[_0x85af('0x4e')],'waiting':_0x2fcee1[_0x85af('0x4c')]};_0x28f50d['push'](_0x3a8c0f);}}_0x3e2e5c({'count':_0x28f50d[_0x85af('0x19')],'rows':_0x28f50d});});},'OpenchannelQueues':function(_0x2b9e38){return new Promise(function(_0x3b31f5,_0x33cc14){var _0xb0e152=[];for(var _0x718f22 in _0x3373ea[_0x85af('0x4f')]){if(_0x3373ea['openchannelQueues'][_0x85af('0x42')](_0x718f22)){var _0x52d9d0=_0x3373ea[_0x85af('0x4f')][_0x718f22];var _0x2a7ac8={'id':_0x52d9d0['id'],'available':_0x52d9d0['available'],'loggedIn':_0x52d9d0[_0x85af('0x4a')],'name':_0x52d9d0[_0x85af('0x4b')],'paused':_0x52d9d0[_0x85af('0x4e')],'waiting':_0x52d9d0[_0x85af('0x4c')]};_0xb0e152[_0x85af('0x22')](_0x2a7ac8);}}_0x3b31f5({'count':_0xb0e152[_0x85af('0x19')],'rows':_0xb0e152});});},'SmsQueues':function(_0xee54ce){return new Promise(function(_0x18770e,_0x5b3086){var _0xd5576a=[];for(var _0xdee267 in _0x3373ea[_0x85af('0x50')]){if(_0x3373ea['smsQueues'][_0x85af('0x42')](_0xdee267)){var _0xe1db96=_0x3373ea['smsQueues'][_0xdee267];var _0x8744aa={'id':_0xe1db96['id'],'available':_0xe1db96[_0x85af('0x49')],'loggedIn':_0xe1db96[_0x85af('0x4a')],'name':_0xe1db96[_0x85af('0x4b')],'paused':_0xe1db96[_0x85af('0x4e')],'waiting':_0xe1db96[_0x85af('0x4c')]};_0xd5576a['push'](_0x8744aa);}}_0x18770e({'count':_0xd5576a[_0x85af('0x19')],'rows':_0xd5576a});});},'FaxQueues':function(_0x4a5868){return new Promise(function(_0x1f343d,_0x4a7b61){var _0x13adde=[];for(var _0x43bd43 in _0x3373ea[_0x85af('0x51')]){if(_0x3373ea[_0x85af('0x51')][_0x85af('0x42')](_0x43bd43)){var _0x4a87e6=_0x3373ea[_0x85af('0x51')][_0x43bd43];var _0x57dc74={'id':_0x4a87e6['id'],'available':_0x4a87e6['available'],'loggedIn':_0x4a87e6[_0x85af('0x4a')],'name':_0x4a87e6[_0x85af('0x4b')],'paused':_0x4a87e6[_0x85af('0x4e')],'waiting':_0x4a87e6['waiting']};_0x13adde[_0x85af('0x22')](_0x57dc74);}}_0x1f343d({'count':_0x13adde[_0x85af('0x19')],'rows':_0x13adde});});},'WhatsappQueues':function(_0x54d7fe){return new Promise(function(_0x38a2a7,_0x437982){var _0x58feab=[];for(var _0x549c44 in _0x3373ea[_0x85af('0x52')]){if(_0x3373ea[_0x85af('0x52')][_0x85af('0x42')](_0x549c44)){var _0x23e8c9=_0x3373ea['whatsappQueues'][_0x549c44];var _0x116703={'id':_0x23e8c9['id'],'available':_0x23e8c9[_0x85af('0x49')],'loggedIn':_0x23e8c9[_0x85af('0x4a')],'name':_0x23e8c9['name'],'paused':_0x23e8c9['paused'],'waiting':_0x23e8c9['waiting']};_0x58feab[_0x85af('0x22')](_0x116703);}}_0x38a2a7({'count':_0x58feab['length'],'rows':_0x58feab});});},'ChatQueuesWaitingInteractions':function(_0x46e83c){return new Promise(function(_0x4a5c85,_0xebea8d){var _0x358b3d=_[_0x85af('0x47')](_0x3373ea[_0x85af('0x53')]);_0x4a5c85({'count':_0x358b3d['length'],'rows':_0x358b3d});});},'MailQueuesWaitingInteractions':function(_0x55ab02){return new Promise(function(_0x1aa1e2,_0x168d83){var _0x4c46bb=_['values'](_0x3373ea[_0x85af('0x54')]);_0x1aa1e2({'count':_0x4c46bb[_0x85af('0x19')],'rows':_0x4c46bb});});},'OpenchannelQueuesWaitingInteractions':function(_0x491285){return new Promise(function(_0x3166e3,_0x26815f){var _0x460e7f=_[_0x85af('0x47')](_0x3373ea[_0x85af('0x55')]);_0x3166e3({'count':_0x460e7f[_0x85af('0x19')],'rows':_0x460e7f});});},'SmsQueuesWaitingInteractions':function(_0x22f168){return new Promise(function(_0x4154c6,_0xd6e592){var _0x560669=_[_0x85af('0x47')](_0x3373ea['smsQueuesWaitingInteractions']);_0x4154c6({'count':_0x560669[_0x85af('0x19')],'rows':_0x560669});});},'FaxQueuesWaitingInteractions':function(_0x43f8eb){return new Promise(function(_0x3f9940,_0x37227c){var _0x250e83=_['values'](_0x3373ea['faxQueuesWaitingInteractions']);_0x3f9940({'count':_0x250e83['length'],'rows':_0x250e83});});},'WhatsappQueuesWaitingInteractions':function(_0x4efd83){return new Promise(function(_0x413c18,_0x361c9f){var _0x47f6bd=_['values'](_0x3373ea[_0x85af('0x56')]);_0x413c18({'count':_0x47f6bd[_0x85af('0x19')],'rows':_0x47f6bd});});}};var _0x2e79ba=jayson['server'](_0x30a041)[_0x85af('0x57')]();_0x2e79ba['on'](_0x85af('0x35'),function(_0x4f9e3a){logger[_0x85af('0x35')](JSON[_0x85af('0x31')](_0x4f9e3a));return _0x21b6dd(_0x4f9e3a);});_0x2e79ba['listen'](0x232c,_0x85af('0x58'),function(){console[_0x85af('0x59')](_0x85af('0x5a'),0x232c);return _0x550bb7(_0x85af('0x5b')+0x232c);});});};
\ No newline at end of file
index c072d6c..c465c94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb78=['push','Command','format','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','log','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','then','error','message','result','catch','condition','rules','info','stop'];(function(_0x19f375,_0x230202){var _0x381c27=function(_0xf58a3f){while(--_0xf58a3f){_0x19f375['push'](_0x19f375['shift']());}};_0x381c27(++_0x230202);}(_0xfb78,0xba));var _0x8fb7=function(_0x232eb7,_0x199b07){_0x232eb7=_0x232eb7-0x0;var _0xd7fb8=_0xfb78[_0x232eb7];return _0xd7fb8;};'use strict';var util=require(_0x8fb7('0x0'));var BPromise=require(_0x8fb7('0x1'));var jayson=require(_0x8fb7('0x2'));var _=require(_0x8fb7('0x3'));var logger=require(_0x8fb7('0x4'))(_0x8fb7('0x5'));var client=jayson[_0x8fb7('0x6')][_0x8fb7('0x7')]({'port':0x232a});function request(_0xa030ed,_0x4be879){return new BPromise(function(_0x454cf0,_0x45172a){return client['request'](_0xa030ed,_0x4be879)[_0x8fb7('0x8')](function(_0x4104c7){if(_0x4104c7[_0x8fb7('0x9')]){return _0x45172a(_0x4104c7[_0x8fb7('0x9')][_0x8fb7('0xa')]);}else{return _0x454cf0(_0x4104c7[_0x8fb7('0xb')]);}})[_0x8fb7('0xc')](function(_0x2e544c){return _0x45172a(_0x2e544c);});});}exports[_0x8fb7('0xd')]=function(_0x3f53f9,_0x4ac783,_0x44f03e){return function(_0x460101){if(_0x44f03e['rules']&&!_0x44f03e[_0x8fb7('0xe')][_0x3f53f9]){logger[_0x8fb7('0xf')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3f53f9);return _0x460101[_0x8fb7('0x10')]();}var _0x593fc6=[];for(var _0x2570cb=0x0;_0x2570cb<_0x4ac783['length'];_0x2570cb+=0x1){_0x593fc6[_0x8fb7('0x11')](request(_0x8fb7('0x12'),{'command':util[_0x8fb7('0x13')]('iftime\x20%s',_0x4ac783[_0x2570cb])})[_0x8fb7('0x8')](function(_0x4ee397){return _0x4ee397&&_0x4ee397[_0x8fb7('0xa')]&&_0x4ee397[_0x8fb7('0xa')][_0x8fb7('0x14')](_0x8fb7('0x15'))>=0x0?!![]:![];})['catch'](function(_0x370ea4){logger[_0x8fb7('0x9')]('[%s][INTERVAL]\x20%s',_0x3f53f9,_0x4ac783[_0x2570cb]);}));}BPromise[_0x8fb7('0x16')](_0x593fc6)['then'](function(_0x11f2ae){var _0x2ed4ae=_[_0x8fb7('0x17')](_0x11f2ae);logger[_0x8fb7('0xf')](_0x8fb7('0x18'),_0x3f53f9,_0x4ac783[_0x8fb7('0x19')]('\x20|\x20'),_0x2ed4ae);_0x460101['when'](_0x2ed4ae);})[_0x8fb7('0xc')](function(_0x15f3c4){console[_0x8fb7('0x1a')](_0x15f3c4);logger[_0x8fb7('0x9')](_0x8fb7('0x18'),_0x3f53f9,_0x4ac783[_0x8fb7('0x19')](_0x8fb7('0x1b')),_0x15f3c4[_0x8fb7('0x1c')]);_0x460101[_0x8fb7('0x10')]();});};};
\ No newline at end of file
+var _0xcf3a=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','join','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','util','bluebird','jayson/promise','lodash','routing','http','request','then','error','message','result','catch','rules'];(function(_0x366762,_0x124a0b){var _0x1e11d8=function(_0x4a6812){while(--_0x4a6812){_0x366762['push'](_0x366762['shift']());}};_0x1e11d8(++_0x124a0b);}(_0xcf3a,0xb7));var _0xacf3=function(_0x2ebb2e,_0x48fa55){_0x2ebb2e=_0x2ebb2e-0x0;var _0x11c5b3=_0xcf3a[_0x2ebb2e];return _0x11c5b3;};'use strict';var util=require(_0xacf3('0x0'));var BPromise=require(_0xacf3('0x1'));var jayson=require(_0xacf3('0x2'));var _=require(_0xacf3('0x3'));var logger=require('../../../config/logger')(_0xacf3('0x4'));var client=jayson['client'][_0xacf3('0x5')]({'port':0x232a});function request(_0x3175dd,_0x140579){return new BPromise(function(_0x224c09,_0x503d2d){return client[_0xacf3('0x6')](_0x3175dd,_0x140579)[_0xacf3('0x7')](function(_0x1218a1){if(_0x1218a1[_0xacf3('0x8')]){return _0x503d2d(_0x1218a1[_0xacf3('0x8')][_0xacf3('0x9')]);}else{return _0x224c09(_0x1218a1[_0xacf3('0xa')]);}})[_0xacf3('0xb')](function(_0x457219){return _0x503d2d(_0x457219);});});}exports['condition']=function(_0xf58112,_0x168e19,_0x2c30e1){return function(_0x226964){if(_0x2c30e1['rules']&&!_0x2c30e1[_0xacf3('0xc')][_0xf58112]){logger['info'](_0xacf3('0xd'),_0xf58112);return _0x226964[_0xacf3('0xe')]();}var _0x444d15=[];for(var _0x347f00=0x0;_0x347f00<_0x168e19[_0xacf3('0xf')];_0x347f00+=0x1){_0x444d15[_0xacf3('0x10')](request('Command',{'command':util[_0xacf3('0x11')](_0xacf3('0x12'),_0x168e19[_0x347f00])})[_0xacf3('0x7')](function(_0x2f474f){return _0x2f474f&&_0x2f474f['message']&&_0x2f474f['message'][_0xacf3('0x13')](_0xacf3('0x14'))>=0x0?!![]:![];})[_0xacf3('0xb')](function(_0x5c76ef){logger[_0xacf3('0x8')](_0xacf3('0x15'),_0xf58112,_0x168e19[_0x347f00]);}));}BPromise[_0xacf3('0x16')](_0x444d15)['then'](function(_0xaa6b7a){var _0x39d696=_[_0xacf3('0x17')](_0xaa6b7a);logger[_0xacf3('0x18')]('[%s][INTERVAL]\x20%s\x20%s',_0xf58112,_0x168e19[_0xacf3('0x19')]('\x20|\x20'),_0x39d696);_0x226964['when'](_0x39d696);})['catch'](function(_0x4966ed){console['log'](_0x4966ed);logger[_0xacf3('0x8')](_0xacf3('0x1a'),_0xf58112,_0x168e19[_0xacf3('0x19')](_0xacf3('0x1b')),_0x4966ed['stack']);_0x226964[_0xacf3('0xe')]();});};};
\ No newline at end of file
index e31a854..6049bdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c81=['CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinename','info','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','isNil','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request'];(function(_0x4be4e9,_0x23019a){var _0xf64d56=function(_0x5262ff){while(--_0x5262ff){_0x4be4e9['push'](_0x4be4e9['shift']());}};_0xf64d56(++_0x23019a);}(_0x3c81,0x102));var _0x13c8=function(_0x5a82be,_0x45fa34){_0x5a82be=_0x5a82be-0x0;var _0x4afba8=_0x3c81[_0x5a82be];return _0x4afba8;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x252f26,_0x131d0b){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x252f26['uniqueid'],_0x252f26[_0x13c8('0x2')],_0x252f26[_0x13c8('0x3')],_0x252f26[_0x13c8('0x4')],_0x252f26[_0x13c8('0x5')],_0x252f26[_0x13c8('0x6')],_0x252f26[_0x13c8('0x7')],_0x252f26[_0x13c8('0x8')]));if(_0x252f26['queue']){utils[_0x13c8('0x9')](_0x252f26['queue'])[_0x13c8('0xa')](function(_0x296463){if(_0x296463){_0x252f26[_0x13c8('0xb')]=_0x296463[_0x13c8('0xb')];_0x252f26[_0x13c8('0xc')]=_0x252f26[_0x13c8('0xd')]?_0x296463[_0x13c8('0xe')]:![];_0x252f26[_0x13c8('0xf')]=_0x252f26[_0x13c8('0xc')]?_0x296463[_0x13c8('0x10')]:0x0;}utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);});}else{utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);}if(_0x131d0b){delete transfers[_0x252f26['uniqueid']];}else{delete agents[_0x252f26[_0x13c8('0x13')]];}}exports[_0x13c8('0x14')]=function(_0x2304b5){try{utils[_0x13c8('0x15')](util['format'](_0x13c8('0x16'),_0x2304b5['uniqueid']),_0x2304b5);agents[_0x2304b5['destuniqueid']]=_0x2304b5;agents[_0x2304b5['destuniqueid']][_0x13c8('0x17')]=utils['now']();agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x18');agents[_0x2304b5[_0x13c8('0x13')]]['connectedlinenum']=null;agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x19')]=null;utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x1c'),_0x2304b5[_0x13c8('0x1d')],agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x4')],_0x2304b5[_0x13c8('0x13')]));}catch(_0x31d122){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x16'),_0x2304b5[_0x13c8('0x1d')]),_0x31d122);}};exports[_0x13c8('0x1f')]=function(_0x313ea3){try{if(!_['isNil'](agents[_0x313ea3[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x313ea3);utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x21'),_0x313ea3[_0x13c8('0x1d')],agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x4')],_0x313ea3['destuniqueid']));agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x1f')]=!![];agents[_0x313ea3['destuniqueid']]['agentringnoanswerAt']=utils[_0x13c8('0x22')]();agents[_0x313ea3[_0x13c8('0x13')]]['lastevent']='timeout';agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x23')]='timeout';agents[_0x313ea3['destuniqueid']][_0x13c8('0x24')]=_0x313ea3['ringtime']?parseInt(_0x313ea3['ringtime'])/0x3e8:0x0;agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x25')]=0x0;unanswered[_0x13c8('0x26')](_0x313ea3['destuniqueid']);}}catch(_0x5ef2f7){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x5ef2f7);}};exports[_0x13c8('0x27')]=function(_0x220d40){try{_[_0x13c8('0x28')](agents,function(_0x4a1b9c,_0x109cb8){if(_0x4a1b9c[_0x13c8('0x1d')]==_0x220d40['uniqueid']&&!_['includes'](unanswered,_0x4a1b9c[_0x13c8('0x13')])){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x220d40);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2a'),_0x220d40[_0x13c8('0x1d')],_0x4a1b9c[_0x13c8('0x4')],_0x4a1b9c[_0x13c8('0x13')]));_0x4a1b9c[_0x13c8('0x1f')]=!![];_0x4a1b9c[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x4a1b9c['lastevent']='abandoned';_0x4a1b9c[_0x13c8('0x23')]=_0x13c8('0x2c');_0x4a1b9c['holdtime']=_0x220d40[_0x13c8('0x24')];_0x4a1b9c['talktime']=0x0;writeDB(_0x4a1b9c);}});}catch(_0x1fdf7d){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x1fdf7d);}};exports[_0x13c8('0x2d')]=function(_0x2039e7){try{if(agents[_0x2039e7[_0x13c8('0x13')]]){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0x2039e7);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2f'),_0x2039e7[_0x13c8('0x1d')],agents[_0x2039e7['destuniqueid']]['membername'],_0x2039e7['destuniqueid']));agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x7')]=_0x2039e7[_0x13c8('0x7')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x19')]=_0x2039e7[_0x13c8('0x19')];agents[_0x2039e7['destuniqueid']]['holdtime']=_0x2039e7[_0x13c8('0x31')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x32');_['forIn'](agents,function(_0x35e1e7,_0x4bd627){if(_0x35e1e7[_0x13c8('0x13')]!=_0x2039e7[_0x13c8('0x13')]&&_0x35e1e7[_0x13c8('0x1d')]==_0x2039e7[_0x13c8('0x1d')]){_0x35e1e7[_0x13c8('0x25')]=0x0;_0x35e1e7[_0x13c8('0x24')]=_0x2039e7[_0x13c8('0x31')];_0x35e1e7[_0x13c8('0x1f')]=!![];_0x35e1e7[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x35e1e7[_0x13c8('0x8')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x23')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x34')]=_0x2039e7[_0x13c8('0x13')];_0x35e1e7[_0x13c8('0x35')]=_0x2039e7[_0x13c8('0x4')];writeDB(_0x35e1e7);}});}}catch(_0xc5eb86){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0xc5eb86);}};exports[_0x13c8('0xd')]=function(_0x44ee66){try{if(!_['isNil'](agents[_0x44ee66[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x44ee66);utils['info'](util['format'](_0x13c8('0x37'),_0x44ee66[_0x13c8('0x1d')],agents[_0x44ee66[_0x13c8('0x13')]]['membername'],_0x44ee66['destuniqueid']));agents[_0x44ee66['destuniqueid']][_0x13c8('0xd')]=!![];agents[_0x44ee66['destuniqueid']][_0x13c8('0x38')]=utils['now']();agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x25')]=utils[_0x13c8('0x39')](agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x38')],agents[_0x44ee66[_0x13c8('0x13')]]['agentconnectAt']);agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x23')]=_0x44ee66['reason'];agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x3a');writeDB(agents[_0x44ee66[_0x13c8('0x13')]]);}}catch(_0x38486a){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x38486a);}};exports[_0x13c8('0x3b')]=function(_0x185d18){try{if(!_['isNil'](agents[_0x185d18[_0x13c8('0x3c')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18[_0x13c8('0x1d')]),_0x185d18);utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x3e'),_0x185d18[_0x13c8('0x1d')],agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x4')],agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')]));agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x3f')]=!![];agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x40')]=_0x13c8('0x41');agents[_0x185d18['transfereruniqueid']][_0x13c8('0x42')]=_0x185d18[_0x13c8('0x43')];agents[_0x185d18[_0x13c8('0x3c')]]['transferuniqueid']=agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')];}}catch(_0x14a738){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18['uniqueid']),_0x14a738);}};exports[_0x13c8('0x44')]=function(_0x554792){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792['origtransfereruniqueid']),_0x554792);if(_0x554792[_0x13c8('0x46')]==_0x554792[_0x13c8('0x47')]){if(!_['isNil'](agents[_0x554792[_0x13c8('0x48')]])){utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4')]));agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x554792['secondtransfereruniqueid']]['transferexten']=_0x554792[_0x13c8('0x4a')];agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x46')];}if(_0x554792[_0x13c8('0x4c')]&&agents[_0x554792[_0x13c8('0x4c')]]){agents[_0x554792[_0x13c8('0x4c')]]['agententerreason']=0x1;transfers[_0x554792['transfereeuniqueid']]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x4c')]]);transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4e')]=agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x4e')];transfers[_0x554792[_0x13c8('0x4c')]]['agentcalledAt']=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4f')]=0x2;}}else if(_0x554792[_0x13c8('0x48')]==_0x554792[_0x13c8('0x50')]){if(!_[_0x13c8('0x51')](agents[_0x554792[_0x13c8('0x46')]])){utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x4')]));agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792[_0x13c8('0x46')]]['transfertype']=_0x13c8('0x52');agents[_0x554792[_0x13c8('0x46')]]['transferexten']=_0x554792[_0x13c8('0x53')];agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x48')];}if(_0x554792[_0x13c8('0x54')]&&agents[_0x554792[_0x13c8('0x54')]]){agents[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x1;transfers[_0x554792[_0x13c8('0x54')]]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x54')]]);transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4e')]=agents[_0x554792[_0x13c8('0x46')]]['calleridname'];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x17')]=utils[_0x13c8('0x22')]();transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x2;}}}catch(_0x55e5ba){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792[_0x13c8('0x46')]),_0x55e5ba);}};exports['hangup']=function(_0x16b409){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x55'),_0x16b409[_0x13c8('0x1d')]),_0x16b409);if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409[_0x13c8('0x1d')]]['reason']===_0x13c8('0x56')){if(_0x16b409[_0x13c8('0x57')]==='21'){agents[_0x16b409[_0x13c8('0x1d')]]['reason']=_0x13c8('0x58');agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']='rejected';}utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x59'),_0x16b409['uniqueid'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);var _0x2d8dfe=unanswered['indexOf'](_0x16b409[_0x13c8('0x1d')]);if(_0x2d8dfe>-0x1){unanswered[_0x13c8('0x5a')](_0x2d8dfe,0x1);}}if(transfers[_0x16b409[_0x13c8('0x1d')]]){transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0xd')]=!![];transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x25')]=utils['diffTime'](transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')],transfers[_0x16b409['uniqueid']]['agentconnectAt']);transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=_0x13c8('0x5b');transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]=_0x13c8('0x3a');utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x59'),_0x16b409[_0x13c8('0x1d')],transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],transfers[_0x16b409['uniqueid']][_0x13c8('0x23')],transfers[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(transfers[_0x16b409[_0x13c8('0x1d')]],!![]);}if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409['uniqueid']][_0x13c8('0x30')]){agents[_0x16b409['uniqueid']][_0x13c8('0xd')]=!![];agents[_0x16b409['uniqueid']][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();agents[_0x16b409[_0x13c8('0x1d')]]['talktime']=utils[_0x13c8('0x39')](agents[_0x16b409['uniqueid']]['agentcompleteAt'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x30')]);agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=agents[_0x16b409['uniqueid']]['transfer']?_0x13c8('0x3f'):'agent';agents[_0x16b409['uniqueid']][_0x13c8('0x8')]=_0x13c8('0x3a');utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x16b409[_0x13c8('0x1d')],agents[_0x16b409['uniqueid']]['membername'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);}}catch(_0x551563){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x55'),_0x16b409['uniqueid']),_0x551563);}};
\ No newline at end of file
+var _0x4483=['agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw'];(function(_0x33ca78,_0x5442d7){var _0x5debda=function(_0x1f9bb9){while(--_0x1f9bb9){_0x33ca78['push'](_0x33ca78['shift']());}};_0x5debda(++_0x5442d7);}(_0x4483,0x1a3));var _0x3448=function(_0xb8f0a9,_0x313293){_0xb8f0a9=_0xb8f0a9-0x0;var _0x4ab1f8=_0x4483[_0xb8f0a9];return _0x4ab1f8;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var utils=require(_0x3448('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x481d0c,_0x202d3d){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x5'),_0x481d0c[_0x3448('0x6')],_0x481d0c['channel'],_0x481d0c[_0x3448('0x7')],_0x481d0c[_0x3448('0x8')],_0x481d0c[_0x3448('0x9')],_0x481d0c[_0x3448('0xa')],_0x481d0c[_0x3448('0xb')],_0x481d0c[_0x3448('0xc')]));if(_0x481d0c[_0x3448('0x7')]){utils[_0x3448('0xd')](_0x481d0c['queue'])['then'](function(_0x46b1ee){if(_0x46b1ee){_0x481d0c[_0x3448('0xe')]=_0x46b1ee[_0x3448('0xe')];_0x481d0c[_0x3448('0xf')]=_0x481d0c[_0x3448('0x10')]?_0x46b1ee[_0x3448('0x11')]:![];_0x481d0c[_0x3448('0x12')]=_0x481d0c[_0x3448('0xf')]?_0x46b1ee[_0x3448('0x13')]:0x0;}utils[_0x3448('0x14')](_0x3448('0x15'),_0x481d0c);});}else{utils['request']('CreateVoiceAgentReport',_0x481d0c);}if(_0x202d3d){delete transfers[_0x481d0c[_0x3448('0x6')]];}else{delete agents[_0x481d0c[_0x3448('0x16')]];}}exports['agentcalled']=function(_0x2661e1){try{utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][agentcalled]',_0x2661e1[_0x3448('0x6')]),_0x2661e1);agents[_0x2661e1[_0x3448('0x16')]]=_0x2661e1;agents[_0x2661e1['destuniqueid']][_0x3448('0x18')]=utils[_0x3448('0x19')]();agents[_0x2661e1[_0x3448('0x16')]]['lastevent']=_0x3448('0x1a');agents[_0x2661e1[_0x3448('0x16')]][_0x3448('0xb')]=null;agents[_0x2661e1[_0x3448('0x16')]][_0x3448('0x1b')]=null;utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x1c'),_0x2661e1['uniqueid'],agents[_0x2661e1[_0x3448('0x16')]]['membername'],_0x2661e1['destuniqueid']));}catch(_0x53f8e7){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x1e'),_0x2661e1['uniqueid']),_0x53f8e7);}};exports[_0x3448('0x1f')]=function(_0x392c8d){try{if(!_[_0x3448('0x20')](agents[_0x392c8d[_0x3448('0x16')]])){utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][agentringnoanswer]',_0x392c8d['uniqueid']),_0x392c8d);utils['info'](util[_0x3448('0x4')](_0x3448('0x21'),_0x392c8d['uniqueid'],agents[_0x392c8d['destuniqueid']][_0x3448('0x8')],_0x392c8d[_0x3448('0x16')]));agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0x1f')]=!![];agents[_0x392c8d[_0x3448('0x16')]]['agentringnoanswerAt']=utils[_0x3448('0x19')]();agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x22');agents[_0x392c8d[_0x3448('0x16')]]['reason']=_0x3448('0x22');agents[_0x392c8d[_0x3448('0x16')]]['holdtime']=_0x392c8d[_0x3448('0x23')]?parseInt(_0x392c8d[_0x3448('0x23')])/0x3e8:0x0;agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0x24')]=0x0;unanswered[_0x3448('0x25')](_0x392c8d[_0x3448('0x16')]);}}catch(_0x31be64){utils[_0x3448('0x1d')](util['format'](_0x3448('0x26'),_0x392c8d[_0x3448('0x6')]),_0x31be64);}};exports[_0x3448('0x27')]=function(_0x52c09d){try{_[_0x3448('0x28')](agents,function(_0x5dfdf7,_0x486f2c){if(_0x5dfdf7['uniqueid']==_0x52c09d[_0x3448('0x6')]&&!_[_0x3448('0x29')](unanswered,_0x5dfdf7['destuniqueid'])){utils['debug'](util[_0x3448('0x4')](_0x3448('0x2a'),_0x52c09d[_0x3448('0x6')]),_0x52c09d);utils[_0x3448('0x3')](util['format'](_0x3448('0x2b'),_0x52c09d[_0x3448('0x6')],_0x5dfdf7[_0x3448('0x8')],_0x5dfdf7['destuniqueid']));_0x5dfdf7[_0x3448('0x1f')]=!![];_0x5dfdf7[_0x3448('0x2c')]=utils['now']();_0x5dfdf7['lastevent']=_0x3448('0x2d');_0x5dfdf7[_0x3448('0x2e')]=_0x3448('0x2d');_0x5dfdf7[_0x3448('0x2f')]=_0x52c09d['holdtime'];_0x5dfdf7[_0x3448('0x24')]=0x0;writeDB(_0x5dfdf7);}});}catch(_0x36291e){utils[_0x3448('0x1d')](util[_0x3448('0x4')]('[%s][agents][queuecallerabandon]',_0x52c09d[_0x3448('0x6')]),_0x36291e);}};exports[_0x3448('0x30')]=function(_0x5ea47c){try{if(agents[_0x5ea47c[_0x3448('0x16')]]){utils[_0x3448('0x17')](util[_0x3448('0x4')](_0x3448('0x31'),_0x5ea47c[_0x3448('0x6')]),_0x5ea47c);utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x32'),_0x5ea47c[_0x3448('0x6')],agents[_0x5ea47c['destuniqueid']]['membername'],_0x5ea47c[_0x3448('0x16')]));agents[_0x5ea47c['destuniqueid']][_0x3448('0x33')]=utils[_0x3448('0x19')]();agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0xb')]=_0x5ea47c['connectedlinenum'];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0x1b')]=_0x5ea47c[_0x3448('0x1b')];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0x2f')]=_0x5ea47c[_0x3448('0x23')];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x34');_['forIn'](agents,function(_0x39b22e,_0x3c92e2){if(_0x39b22e[_0x3448('0x16')]!=_0x5ea47c[_0x3448('0x16')]&&_0x39b22e[_0x3448('0x6')]==_0x5ea47c['uniqueid']){_0x39b22e[_0x3448('0x24')]=0x0;_0x39b22e[_0x3448('0x2f')]=_0x5ea47c[_0x3448('0x23')];_0x39b22e[_0x3448('0x1f')]=!![];_0x39b22e[_0x3448('0x2c')]=utils[_0x3448('0x19')]();_0x39b22e[_0x3448('0xc')]=_0x3448('0x35');_0x39b22e['reason']=_0x3448('0x35');_0x39b22e[_0x3448('0x36')]=_0x5ea47c[_0x3448('0x16')];_0x39b22e['answeredelsewheremembername']=_0x5ea47c[_0x3448('0x8')];writeDB(_0x39b22e);}});}}catch(_0x1d2a7c){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x31'),_0x5ea47c[_0x3448('0x6')]),_0x1d2a7c);}};exports[_0x3448('0x10')]=function(_0x4f54e7){try{if(!_[_0x3448('0x20')](agents[_0x4f54e7[_0x3448('0x16')]])){utils[_0x3448('0x17')](util[_0x3448('0x4')](_0x3448('0x37'),_0x4f54e7[_0x3448('0x6')]),_0x4f54e7);utils['info'](util[_0x3448('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4f54e7['uniqueid'],agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x8')],_0x4f54e7['destuniqueid']));agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x10')]=!![];agents[_0x4f54e7['destuniqueid']][_0x3448('0x38')]=utils[_0x3448('0x19')]();agents[_0x4f54e7['destuniqueid']][_0x3448('0x24')]=utils[_0x3448('0x39')](agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x38')],agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x33')]);agents[_0x4f54e7[_0x3448('0x16')]]['reason']=_0x4f54e7['reason'];agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x3a');writeDB(agents[_0x4f54e7[_0x3448('0x16')]]);}}catch(_0x527259){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x37'),_0x4f54e7[_0x3448('0x6')]),_0x527259);}};exports[_0x3448('0x3b')]=function(_0x5d942b){try{if(!_[_0x3448('0x20')](agents[_0x5d942b['transfereruniqueid']])){utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][blindtransfer]',_0x5d942b[_0x3448('0x6')]),_0x5d942b);utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x3c'),_0x5d942b[_0x3448('0x6')],agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x8')],agents[_0x5d942b['transfereruniqueid']][_0x3448('0x6')]));agents[_0x5d942b[_0x3448('0x3d')]]['transfer']=!![];agents[_0x5d942b['transfereruniqueid']][_0x3448('0x3e')]=_0x3448('0x3f');agents[_0x5d942b['transfereruniqueid']]['transferexten']=_0x5d942b[_0x3448('0x40')];agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x41')]=agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x6')];}}catch(_0x39db50){utils[_0x3448('0x1d')](util['format']('[%s][agents][blindtransfer]',_0x5d942b['uniqueid']),_0x39db50);}};exports[_0x3448('0x42')]=function(_0x3c734a){try{utils['debug'](util[_0x3448('0x4')](_0x3448('0x43'),_0x3c734a['origtransfereruniqueid']),_0x3c734a);if(_0x3c734a[_0x3448('0x44')]==_0x3c734a[_0x3448('0x45')]){if(!_['isNil'](agents[_0x3c734a[_0x3448('0x46')]])){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x47'),_0x3c734a[_0x3448('0x44')],agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x8')]));agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x48')]=!![];agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0x3e')]='ATTENDED';agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x49')]=_0x3c734a[_0x3448('0x4a')];agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x41')]=_0x3c734a[_0x3448('0x44')];}if(_0x3c734a['transfereeuniqueid']&&agents[_0x3c734a[_0x3448('0x4b')]]){agents[_0x3c734a['transfereeuniqueid']][_0x3448('0x4c')]=0x1;transfers[_0x3c734a[_0x3448('0x4b')]]=_[_0x3448('0x4d')](agents[_0x3c734a[_0x3448('0x4b')]]);transfers[_0x3c734a[_0x3448('0x4b')]]['calleridnum']=agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0xa')];transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x4e')]=agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0x4e')];transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x18')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x33')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x2f')]=0x0;transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x4c')]=0x2;}}else if(_0x3c734a[_0x3448('0x46')]==_0x3c734a[_0x3448('0x4f')]){if(!_[_0x3448('0x20')](agents[_0x3c734a[_0x3448('0x44')]])){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x47'),_0x3c734a['origtransfereruniqueid'],agents[_0x3c734a[_0x3448('0x44')]]['membername']));agents[_0x3c734a[_0x3448('0x44')]]['transfer']=!![];agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x3e')]='ATTENDED';agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x49')]=_0x3c734a['secondtransfererexten'];agents[_0x3c734a['origtransfereruniqueid']][_0x3448('0x41')]=_0x3c734a['secondtransfereruniqueid'];}if(_0x3c734a['transfertargetuniqueid']&&agents[_0x3c734a[_0x3448('0x50')]]){agents[_0x3c734a[_0x3448('0x50')]]['agententerreason']=0x1;transfers[_0x3c734a['transfertargetuniqueid']]=_[_0x3448('0x4d')](agents[_0x3c734a[_0x3448('0x50')]]);transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0xa')]=agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0xa')];transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x4e')]=agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x4e')];transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x18')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x50')]]['agentconnectAt']=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x50')]]['holdtime']=0x0;transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x4c')]=0x2;}}}catch(_0x543959){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x43'),_0x3c734a['origtransfereruniqueid']),_0x543959);}};exports['hangup']=function(_0x41d459){try{utils['debug'](util[_0x3448('0x4')](_0x3448('0x51'),_0x41d459[_0x3448('0x6')]),_0x41d459);if(agents[_0x41d459['uniqueid']]&&agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x2e')]===_0x3448('0x22')){if(_0x41d459['cause']==='21'){agents[_0x41d459['uniqueid']][_0x3448('0x2e')]=_0x3448('0x52');agents[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]=_0x3448('0x52');}utils[_0x3448('0x3')](util['format'](_0x3448('0x53'),_0x41d459['uniqueid'],agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x8')],agents[_0x41d459['uniqueid']][_0x3448('0x2e')],agents[_0x41d459[_0x3448('0x6')]]['lastevent']));writeDB(agents[_0x41d459['uniqueid']]);var _0x188f98=unanswered[_0x3448('0x54')](_0x41d459[_0x3448('0x6')]);if(_0x188f98>-0x1){unanswered[_0x3448('0x55')](_0x188f98,0x1);}}if(transfers[_0x41d459[_0x3448('0x6')]]){transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x10')]=!![];transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x38')]=utils[_0x3448('0x19')]();transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x24')]=utils[_0x3448('0x39')](transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x38')],transfers[_0x41d459[_0x3448('0x6')]]['agentconnectAt']);transfers[_0x41d459['uniqueid']][_0x3448('0x2e')]='agent';transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]='complete';utils[_0x3448('0x3')](util['format'](_0x3448('0x53'),_0x41d459[_0x3448('0x6')],transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x8')],transfers[_0x41d459[_0x3448('0x6')]]['reason'],transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]));writeDB(transfers[_0x41d459[_0x3448('0x6')]],!![]);}if(agents[_0x41d459['uniqueid']]&&agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x33')]){agents[_0x41d459[_0x3448('0x6')]]['agentcomplete']=!![];agents[_0x41d459[_0x3448('0x6')]]['agentcompleteAt']=utils['now']();agents[_0x41d459[_0x3448('0x6')]]['talktime']=utils[_0x3448('0x39')](agents[_0x41d459['uniqueid']][_0x3448('0x38')],agents[_0x41d459[_0x3448('0x6')]]['agentconnectAt']);agents[_0x41d459['uniqueid']][_0x3448('0x2e')]=agents[_0x41d459[_0x3448('0x6')]]['transfer']?_0x3448('0x48'):_0x3448('0x56');agents[_0x41d459['uniqueid']][_0x3448('0xc')]=_0x3448('0x3a');utils[_0x3448('0x3')](util[_0x3448('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x41d459[_0x3448('0x6')],agents[_0x41d459['uniqueid']][_0x3448('0x8')],agents[_0x41d459['uniqueid']][_0x3448('0x2e')],agents[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]));writeDB(agents[_0x41d459['uniqueid']]);}}catch(_0x17ebc9){utils[_0x3448('0x1d')](util['format'](_0x3448('0x51'),_0x41d459['uniqueid']),_0x17ebc9);}};
\ No newline at end of file
index e7d35e8..afa847e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25f2=['calleridnum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','error','newstate','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','now','disposition','toNumber','ANSWERED','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','interface'];(function(_0x30e819,_0x4c9cb7){var _0x576ec4=function(_0x42f84e){while(--_0x42f84e){_0x30e819['push'](_0x30e819['shift']());}};_0x576ec4(++_0x4c9cb7);}(_0x25f2,0x19d));var _0x225f=function(_0x752b79,_0x3f67ce){_0x752b79=_0x752b79-0x0;var _0x4190ac=_0x25f2[_0x752b79];return _0x4190ac;};'use strict';var _=require(_0x225f('0x0'));var util=require(_0x225f('0x1'));var utils=require(_0x225f('0x2'));var transfers=require(_0x225f('0x3'));var dispositions=[_0x225f('0x4'),_0x225f('0x5'),'FAILED',_0x225f('0x4'),_0x225f('0x4'),_0x225f('0x4'),'ANSWERED',_0x225f('0x6'),_0x225f('0x5'),_0x225f('0x5'),_0x225f('0x5')];var channels={};function writeDB(_0x1e1b89){var _0x124b46;if(transfers[_0x225f('0x7')][_0x1e1b89[_0x225f('0x8')]]){_0x124b46=_0x1e1b89[_0x225f('0x8')];_0x1e1b89[_0x225f('0x8')]=transfers[_0x225f('0x7')][_0x1e1b89[_0x225f('0x8')]][_0x225f('0x9')];}utils[_0x225f('0xa')](util[_0x225f('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1e1b89['uniqueid'],_0x1e1b89[_0x225f('0xc')],_0x1e1b89[_0x225f('0xd')],_0x1e1b89['membername'],_0x1e1b89[_0x225f('0xe')],_0x1e1b89[_0x225f('0xf')],_0x1e1b89['connectedlinenum'],_0x1e1b89[_0x225f('0x10')]));if(_0x1e1b89['accountcode']){utils['getUserByInternal'](_0x1e1b89[_0x225f('0x11')])['then'](function(_0x6a893c){if(_0x6a893c){_0x1e1b89[_0x225f('0x12')]=_0x6a893c['id'];}utils[_0x225f('0x13')](_0x225f('0x14'),_0x1e1b89);});}else{utils[_0x225f('0x13')](_0x225f('0x14'),_0x1e1b89);}if(channels[_0x1e1b89['uniqueid']]){delete channels[_0x1e1b89[_0x225f('0x8')]];}else if(_0x124b46&&channels[_0x124b46]){delete transfers[_0x225f('0x7')][_0x124b46];delete channels[_0x124b46];}}exports[_0x225f('0x15')]=function(_0x209123){try{utils[_0x225f('0x16')](util[_0x225f('0xb')](_0x225f('0x17'),_0x209123[_0x225f('0x8')]),_0x209123);if(_0x209123[_0x225f('0x8')]==_0x209123[_0x225f('0x18')]&&_0x209123[_0x225f('0xc')]!=_0x225f('0x19')){utils[_0x225f('0xa')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x209123[_0x225f('0x8')],_0x209123[_0x225f('0x1a')],_0x209123[_0x225f('0x1b')]));channels[_0x209123[_0x225f('0x8')]]={'uniqueid':_0x209123['uniqueid'],'accountcode':_0x209123[_0x225f('0x11')],'source':_0x209123['calleridnum'],'destination':_0x209123[_0x225f('0x1b')],'destinationcontext':_0x209123['context'],'channel':_0x209123[_0x225f('0xc')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x225f('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x22167b){utils[_0x225f('0x1c')](util['format']('[%s][calls][newchannel]',_0x209123['uniqueid']),_0x22167b);}};exports[_0x225f('0x1d')]=function(_0x2b0cf1){try{utils[_0x225f('0x16')](util[_0x225f('0xb')]('[%s][calls][newstate]',_0x2b0cf1[_0x225f('0x8')]),_0x2b0cf1);if(!_[_0x225f('0x1e')](channels[_0x2b0cf1[_0x225f('0x8')]])&&_0x2b0cf1['channelstate']==0x6){utils[_0x225f('0xa')](util[_0x225f('0xb')](_0x225f('0x1f'),_0x2b0cf1[_0x225f('0x8')],_0x2b0cf1[_0x225f('0x1a')],_0x2b0cf1[_0x225f('0xc')]));if(_[_0x225f('0x1e')](channels[_0x2b0cf1[_0x225f('0x8')]][_0x225f('0x20')])){channels[_0x2b0cf1['uniqueid']][_0x225f('0x20')]=utils['now']();}}else if(!_[_0x225f('0x1e')](channels[_0x2b0cf1['linkedid']])&&_0x2b0cf1[_0x225f('0x21')]==0x6&&_0x2b0cf1[_0x225f('0x1a')]!='transfer'){utils['info'](util['format'](_0x225f('0x22'),_0x2b0cf1[_0x225f('0x8')],_0x2b0cf1[_0x225f('0x18')],_0x2b0cf1[_0x225f('0x1a')],_0x2b0cf1['channel']));channels[_0x2b0cf1[_0x225f('0x18')]][_0x225f('0x11')]=_0x2b0cf1[_0x225f('0x11')];channels[_0x2b0cf1[_0x225f('0x18')]][_0x225f('0x23')]=_0x2b0cf1['channel'];if(_[_0x225f('0x1e')](channels[_0x2b0cf1[_0x225f('0x18')]][_0x225f('0x24')])){channels[_0x2b0cf1[_0x225f('0x18')]][_0x225f('0x24')]=utils[_0x225f('0x25')]();}channels[_0x2b0cf1[_0x225f('0x18')]][_0x225f('0x26')]=dispositions[_[_0x225f('0x27')](_0x2b0cf1[_0x225f('0x21')])]||_0x225f('0x28');}}catch(_0x3a05d7){utils[_0x225f('0x1c')](util[_0x225f('0xb')](_0x225f('0x29'),_0x2b0cf1[_0x225f('0x8')]),_0x3a05d7);}};exports[_0x225f('0x2a')]=function(_0xd84cae){try{if(!_['isNil'](channels[_0xd84cae[_0x225f('0x8')]])){utils['debug'](util[_0x225f('0xb')](_0x225f('0x2b'),_0xd84cae[_0x225f('0x8')]),_0xd84cae);if(_[_0x225f('0x1e')](channels[_0xd84cae[_0x225f('0x8')]][_0x225f('0x2c')])){channels[_0xd84cae[_0x225f('0x8')]]['callerid']=_0xd84cae[_0x225f('0x2d')]+'\x20<'+_0xd84cae[_0x225f('0xf')]+'>';}utils[_0x225f('0xa')](util['format'](_0x225f('0x2e'),_0xd84cae[_0x225f('0x8')],channels[_0xd84cae[_0x225f('0x8')]][_0x225f('0x2c')],_0xd84cae[_0x225f('0x2f')]));channels[_0xd84cae[_0x225f('0x8')]]['endtime']=utils['now']();channels[_0xd84cae[_0x225f('0x8')]][_0x225f('0x30')]=utils[_0x225f('0x31')](channels[_0xd84cae['uniqueid']][_0x225f('0x32')],channels[_0xd84cae[_0x225f('0x8')]]['starttime']);channels[_0xd84cae[_0x225f('0x8')]][_0x225f('0x33')]=channels[_0xd84cae[_0x225f('0x8')]][_0x225f('0x24')]?utils[_0x225f('0x31')](channels[_0xd84cae['uniqueid']]['endtime'],channels[_0xd84cae[_0x225f('0x8')]][_0x225f('0x24')]):0x0;writeDB(channels[_0xd84cae['uniqueid']]);}}catch(_0xef63ae){utils[_0x225f('0x1c')](util['format'](_0x225f('0x2b'),_0xd84cae[_0x225f('0x8')]),_0xef63ae);}};exports[_0x225f('0x34')]=function(_0x31900d){try{if(!_['isNil'](channels[_0x31900d[_0x225f('0x35')]])){utils[_0x225f('0x16')](util[_0x225f('0xb')]('[%s][calls][attendedtransfer]',_0x31900d[_0x225f('0x36')]),_0x31900d);if(channels[_0x31900d[_0x225f('0x35')]][_0x225f('0xc')]==_0x31900d[_0x225f('0x37')]){utils[_0x225f('0xa')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x31900d['origtransfereruniqueid'],_0x31900d[_0x225f('0x35')],_0x31900d[_0x225f('0x38')]));channels[_0x31900d['localtwolinkedid']]['destinationchannel']=_0x31900d[_0x225f('0x38')];channels[_0x31900d[_0x225f('0x35')]]['userfield']=_0x225f('0x39');}else if(channels[_0x31900d[_0x225f('0x35')]]['channel']=_0x31900d['transfertargetchannel']){utils[_0x225f('0xa')](util[_0x225f('0xb')](_0x225f('0x3a'),_0x31900d['origtransfereruniqueid'],_0x31900d[_0x225f('0x35')],_0x31900d[_0x225f('0x3b')]));channels[_0x31900d[_0x225f('0x35')]][_0x225f('0x23')]=_0x31900d[_0x225f('0x3b')];channels[_0x31900d[_0x225f('0x35')]][_0x225f('0x3c')]='_attended';}}}catch(_0x49f4fe){utils[_0x225f('0x1c')](util[_0x225f('0xb')]('[%s][calls][attendedtransfer]',_0x31900d['origtransfereruniqueid']),_0x49f4fe);}};exports['musiconholdstart']=function(_0x1a1355){try{if(!_[_0x225f('0x1e')](channels[_0x1a1355['uniqueid']])){utils[_0x225f('0x16')](util[_0x225f('0xb')](_0x225f('0x3d'),_0x1a1355[_0x225f('0x8')]),_0x1a1355);channels[_0x1a1355[_0x225f('0x8')]][_0x225f('0x3e')]=utils[_0x225f('0x25')]();utils[_0x225f('0xa')](util[_0x225f('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1a1355['uniqueid'],channels[_0x1a1355[_0x225f('0x8')]][_0x225f('0x3e')]));}}catch(_0x486745){utils[_0x225f('0x1c')](util['format']('[%s][calls][musiconholdstart]',_0x1a1355[_0x225f('0x8')]),_0x486745);}};exports[_0x225f('0x3f')]=function(_0x316f78){try{if(!_[_0x225f('0x1e')](channels[_0x316f78[_0x225f('0x8')]])){utils['debug'](util[_0x225f('0xb')](_0x225f('0x40'),_0x316f78[_0x225f('0x8')]),_0x316f78);if(!_[_0x225f('0x1e')](channels[_0x316f78[_0x225f('0x8')]][_0x225f('0x3e')])){channels[_0x316f78[_0x225f('0x8')]][_0x225f('0x41')]+=utils['diffTime'](utils[_0x225f('0x25')](),channels[_0x316f78['uniqueid']]['musiconholdstartAt']);utils[_0x225f('0xa')](util[_0x225f('0xb')](_0x225f('0x42'),_0x316f78[_0x225f('0x8')],channels[_0x316f78[_0x225f('0x8')]]['mohtime']));delete channels[_0x316f78['uniqueid']][_0x225f('0x3e')];}}}catch(_0xb4ec8f){utils[_0x225f('0x1c')](util[_0x225f('0xb')](_0x225f('0x40'),_0x316f78[_0x225f('0x8')]),_0xb4ec8f);}};exports[_0x225f('0x43')]=function(_0x42bcf1){try{if(!_[_0x225f('0x1e')](channels[_0x42bcf1[_0x225f('0x8')]])){utils[_0x225f('0x16')](util[_0x225f('0xb')](_0x225f('0x44'),_0x42bcf1[_0x225f('0x8')]),_0x42bcf1);if(!_[_0x225f('0x1e')](_0x42bcf1['variable']['xmd-originatecalleridnum'])){utils[_0x225f('0xa')](util[_0x225f('0xb')](_0x225f('0x45'),_0x42bcf1['uniqueid'],_0x42bcf1[_0x225f('0x46')]));channels[_0x42bcf1[_0x225f('0x8')]]['source']=_0x42bcf1['value'];}if(!_[_0x225f('0x1e')](_0x42bcf1[_0x225f('0x47')][_0x225f('0x48')])){utils[_0x225f('0xa')](util[_0x225f('0xb')](_0x225f('0x49'),_0x42bcf1[_0x225f('0x8')],_0x42bcf1['value']));channels[_0x42bcf1[_0x225f('0x8')]][_0x225f('0x4a')]=_0x42bcf1[_0x225f('0x46')];channels[_0x42bcf1['uniqueid']][_0x225f('0x2c')]='\x22'+_0x42bcf1[_0x225f('0x46')]+_0x225f('0x4b')+_0x42bcf1[_0x225f('0x46')]+'>';}if(!_[_0x225f('0x1e')](_0x42bcf1[_0x225f('0x47')][_0x225f('0x4c')])||!_[_0x225f('0x1e')](_0x42bcf1[_0x225f('0x47')]['xmd-callerid'])){utils[_0x225f('0xa')](util[_0x225f('0xb')](_0x225f('0x4d'),_0x42bcf1['uniqueid'],!_[_0x225f('0x1e')](_0x42bcf1['variable'][_0x225f('0x4c')])?_0x225f('0x4c'):_0x225f('0x4e'),_0x42bcf1[_0x225f('0x46')]));channels[_0x42bcf1['uniqueid']]['callerid']=_0x42bcf1[_0x225f('0x46')];}if(!_['isNil'](_0x42bcf1[_0x225f('0x47')][_0x225f('0x4f')])||!_[_0x225f('0x1e')](_0x42bcf1['variable'][_0x225f('0x50')])){utils[_0x225f('0xa')](util[_0x225f('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x42bcf1[_0x225f('0x8')],!_[_0x225f('0x1e')](_0x42bcf1[_0x225f('0x47')][_0x225f('0x4f')])?'xmd-queue':'xmcs-queue',_0x42bcf1['value']));channels[_0x42bcf1[_0x225f('0x8')]][_0x225f('0x51')]=_0x225f('0x52');channels[_0x42bcf1['uniqueid']]['lastdata']=_0x42bcf1[_0x225f('0x46')];channels[_0x42bcf1[_0x225f('0x8')]][_0x225f('0xd')]=!![];}if(!_[_0x225f('0x1e')](_0x42bcf1['variable'][_0x225f('0x53')])){utils[_0x225f('0xa')](util[_0x225f('0xb')](_0x225f('0x54'),_0x42bcf1['uniqueid'],_0x42bcf1[_0x225f('0x46')]));channels[_0x42bcf1[_0x225f('0x8')]][_0x225f('0x55')]=_0x42bcf1[_0x225f('0x46')];}if(!_['isNil'](_0x42bcf1[_0x225f('0x47')][_0x225f('0x56')])){utils[_0x225f('0xa')](util[_0x225f('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x42bcf1[_0x225f('0x8')],_0x42bcf1[_0x225f('0x46')]));channels[_0x42bcf1[_0x225f('0x8')]][_0x225f('0x57')]=_0x42bcf1[_0x225f('0x46')];}if(!_[_0x225f('0x1e')](_0x42bcf1[_0x225f('0x47')][_0x225f('0x58')])){utils[_0x225f('0xa')](util[_0x225f('0xb')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x42bcf1[_0x225f('0x8')],_0x42bcf1[_0x225f('0x46')]));channels[_0x42bcf1[_0x225f('0x8')]][_0x225f('0x59')]=_0x42bcf1['value'];}if(!_[_0x225f('0x1e')](_0x42bcf1[_0x225f('0x47')][_0x225f('0x5a')])){utils[_0x225f('0xa')](util['format'](_0x225f('0x5b'),_0x42bcf1['uniqueid'],_0x42bcf1[_0x225f('0x46')]));channels[_0x42bcf1['uniqueid']]['sipcallid']=_0x42bcf1[_0x225f('0x46')];}}}catch(_0x4b7627){utils[_0x225f('0x1c')](util[_0x225f('0xb')](_0x225f('0x44'),_0x42bcf1[_0x225f('0x8')]),_0x4b7627);}};exports['newexten']=function(_0xb4f954){try{if(!_['isNil'](channels[_0xb4f954['uniqueid']])){utils['debug'](util[_0x225f('0xb')](_0x225f('0x5c'),_0xb4f954[_0x225f('0x8')]),_0xb4f954);utils[_0x225f('0xa')](util[_0x225f('0xb')](_0x225f('0x5d'),_0xb4f954['uniqueid'],_0xb4f954['application'],_0xb4f954[_0x225f('0x5e')]));if(_0xb4f954[_0x225f('0x5f')][_0x225f('0x60')]()==_0x225f('0x61')&&_['startsWith'](_0xb4f954[_0x225f('0x5e')][_0x225f('0x60')](),_0x225f('0x62'))){var _0x5dfac8=_0xb4f954['appdata'][_0x225f('0x63')]('=');var _0x577d79=_0x5dfac8[0x0][_0x225f('0x64')](_0x5dfac8[0x0]['lastIndexOf']('(')+0x1,_0x5dfac8[0x0][_0x225f('0x65')](')'));var _0x5bb262=_0x5dfac8[0x1];channels[_0xb4f954[_0x225f('0x8')]][_0x577d79]=_0x5bb262;}if(!_[_0x225f('0x66')]([_0x225f('0x2a'),_0x225f('0x67'),_0x225f('0x68'),_0x225f('0x61'),_0x225f('0x69')],_0xb4f954[_0x225f('0x5f')][_0x225f('0x60')]())){channels[_0xb4f954[_0x225f('0x8')]][_0x225f('0x51')]=_0xb4f954['application'];channels[_0xb4f954[_0x225f('0x8')]][_0x225f('0x6a')]=_0xb4f954[_0x225f('0x5e')];}}}catch(_0x5946fe){utils[_0x225f('0x1c')](util[_0x225f('0xb')](_0x225f('0x5c'),_0xb4f954['uniqueid']),_0x5946fe);}};
\ No newline at end of file
+var _0x68aa=['value','xmd-phone','destination','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','substring','lastIndexOf','noop','execif','set','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','hangup','callerid','calleridname','endtime','duration','starttime','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x68aa,0x8b));var _0xa68a=function(_0x34cff0,_0x4c659e){_0x34cff0=_0x34cff0-0x0;var _0x4a8dc4=_0x68aa[_0x34cff0];return _0x4a8dc4;};'use strict';var _=require(_0xa68a('0x0'));var util=require(_0xa68a('0x1'));var utils=require(_0xa68a('0x2'));var transfers=require(_0xa68a('0x3'));var dispositions=[_0xa68a('0x4'),_0xa68a('0x5'),'FAILED',_0xa68a('0x4'),_0xa68a('0x4'),_0xa68a('0x4'),'ANSWERED',_0xa68a('0x6'),'FAILED','FAILED',_0xa68a('0x5')];var channels={};function writeDB(_0x5e54b8){var _0xe349a4;if(transfers[_0xa68a('0x7')][_0x5e54b8[_0xa68a('0x8')]]){_0xe349a4=_0x5e54b8[_0xa68a('0x8')];_0x5e54b8[_0xa68a('0x8')]=transfers[_0xa68a('0x7')][_0x5e54b8[_0xa68a('0x8')]][_0xa68a('0x9')];}utils['info'](util[_0xa68a('0xa')](_0xa68a('0xb'),_0x5e54b8['uniqueid'],_0x5e54b8[_0xa68a('0xc')],_0x5e54b8['queue'],_0x5e54b8[_0xa68a('0xd')],_0x5e54b8[_0xa68a('0xe')],_0x5e54b8[_0xa68a('0xf')],_0x5e54b8['connectedlinenum'],_0x5e54b8[_0xa68a('0x10')]));if(_0x5e54b8['accountcode']){utils[_0xa68a('0x11')](_0x5e54b8[_0xa68a('0x12')])[_0xa68a('0x13')](function(_0x43beca){if(_0x43beca){_0x5e54b8[_0xa68a('0x14')]=_0x43beca['id'];}utils[_0xa68a('0x15')](_0xa68a('0x16'),_0x5e54b8);});}else{utils[_0xa68a('0x15')]('CreateVoiceCallReport',_0x5e54b8);}if(channels[_0x5e54b8[_0xa68a('0x8')]]){delete channels[_0x5e54b8[_0xa68a('0x8')]];}else if(_0xe349a4&&channels[_0xe349a4]){delete transfers['blinds'][_0xe349a4];delete channels[_0xe349a4];}}exports[_0xa68a('0x17')]=function(_0x30c79d){try{utils[_0xa68a('0x18')](util[_0xa68a('0xa')]('[%s][calls][newchannel]',_0x30c79d[_0xa68a('0x8')]),_0x30c79d);if(_0x30c79d[_0xa68a('0x8')]==_0x30c79d[_0xa68a('0x19')]&&_0x30c79d[_0xa68a('0xc')]!=_0xa68a('0x1a')){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')](_0xa68a('0x1c'),_0x30c79d[_0xa68a('0x8')],_0x30c79d[_0xa68a('0x1d')],_0x30c79d['exten']));channels[_0x30c79d['uniqueid']]={'uniqueid':_0x30c79d[_0xa68a('0x8')],'accountcode':_0x30c79d[_0xa68a('0x12')],'source':_0x30c79d['calleridnum'],'destination':_0x30c79d[_0xa68a('0x1e')],'destinationcontext':_0x30c79d[_0xa68a('0x1d')],'channel':_0x30c79d[_0xa68a('0xc')],'starttime':utils[_0xa68a('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa68a('0x4'),'amaflags':_0xa68a('0x20')};}}catch(_0x436123){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x22'),_0x30c79d[_0xa68a('0x8')]),_0x436123);}};exports['newstate']=function(_0x29cc2f){try{utils[_0xa68a('0x18')](util[_0xa68a('0xa')](_0xa68a('0x23'),_0x29cc2f['uniqueid']),_0x29cc2f);if(!_[_0xa68a('0x24')](channels[_0x29cc2f[_0xa68a('0x8')]])&&_0x29cc2f[_0xa68a('0x25')]==0x6){utils['info'](util[_0xa68a('0xa')](_0xa68a('0x26'),_0x29cc2f[_0xa68a('0x8')],_0x29cc2f[_0xa68a('0x1d')],_0x29cc2f[_0xa68a('0xc')]));if(_[_0xa68a('0x24')](channels[_0x29cc2f[_0xa68a('0x8')]]['systemanswertime'])){channels[_0x29cc2f[_0xa68a('0x8')]][_0xa68a('0x27')]=utils[_0xa68a('0x1f')]();}}else if(!_[_0xa68a('0x24')](channels[_0x29cc2f[_0xa68a('0x19')]])&&_0x29cc2f[_0xa68a('0x25')]==0x6&&_0x29cc2f['context']!='transfer'){utils[_0xa68a('0x1b')](util['format'](_0xa68a('0x28'),_0x29cc2f['uniqueid'],_0x29cc2f[_0xa68a('0x19')],_0x29cc2f['context'],_0x29cc2f['channel']));channels[_0x29cc2f[_0xa68a('0x19')]][_0xa68a('0x12')]=_0x29cc2f[_0xa68a('0x12')];channels[_0x29cc2f[_0xa68a('0x19')]][_0xa68a('0x29')]=_0x29cc2f[_0xa68a('0xc')];if(_[_0xa68a('0x24')](channels[_0x29cc2f[_0xa68a('0x19')]]['answertime'])){channels[_0x29cc2f[_0xa68a('0x19')]][_0xa68a('0x2a')]=utils[_0xa68a('0x1f')]();}channels[_0x29cc2f[_0xa68a('0x19')]][_0xa68a('0x2b')]=dispositions[_[_0xa68a('0x2c')](_0x29cc2f[_0xa68a('0x25')])]||_0xa68a('0x2d');}}catch(_0x37912c){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x23'),_0x29cc2f['uniqueid']),_0x37912c);}};exports[_0xa68a('0x2e')]=function(_0x231747){try{if(!_[_0xa68a('0x24')](channels[_0x231747[_0xa68a('0x8')]])){utils['debug'](util[_0xa68a('0xa')]('[%s][calls][hangup]',_0x231747[_0xa68a('0x8')]),_0x231747);if(_[_0xa68a('0x24')](channels[_0x231747['uniqueid']][_0xa68a('0x2f')])){channels[_0x231747['uniqueid']][_0xa68a('0x2f')]=_0x231747[_0xa68a('0x30')]+'\x20<'+_0x231747[_0xa68a('0xf')]+'>';}utils[_0xa68a('0x1b')](util[_0xa68a('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x231747[_0xa68a('0x8')],channels[_0x231747['uniqueid']]['callerid'],_0x231747['cause-txt']));channels[_0x231747['uniqueid']][_0xa68a('0x31')]=utils[_0xa68a('0x1f')]();channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x32')]=utils['diffTime'](channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x31')],channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x33')]);channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x34')]=channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x2a')]?utils[_0xa68a('0x35')](channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x31')],channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x2a')]):0x0;writeDB(channels[_0x231747[_0xa68a('0x8')]]);}}catch(_0x547514){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x36'),_0x231747[_0xa68a('0x8')]),_0x547514);}};exports[_0xa68a('0x37')]=function(_0x53ee79){try{if(!_[_0xa68a('0x24')](channels[_0x53ee79[_0xa68a('0x38')]])){utils['debug'](util['format'](_0xa68a('0x39'),_0x53ee79[_0xa68a('0x3a')]),_0x53ee79);if(channels[_0x53ee79['localtwolinkedid']][_0xa68a('0xc')]==_0x53ee79[_0xa68a('0x3b')]){utils[_0xa68a('0x1b')](util['format'](_0xa68a('0x3c'),_0x53ee79[_0xa68a('0x3a')],_0x53ee79[_0xa68a('0x38')],_0x53ee79['secondtransfererchannel']));channels[_0x53ee79[_0xa68a('0x38')]][_0xa68a('0x29')]=_0x53ee79[_0xa68a('0x3d')];channels[_0x53ee79[_0xa68a('0x38')]][_0xa68a('0x3e')]=_0xa68a('0x3f');}else if(channels[_0x53ee79[_0xa68a('0x38')]]['channel']=_0x53ee79[_0xa68a('0x40')]){utils['info'](util[_0xa68a('0xa')](_0xa68a('0x3c'),_0x53ee79[_0xa68a('0x3a')],_0x53ee79[_0xa68a('0x38')],_0x53ee79[_0xa68a('0x41')]));channels[_0x53ee79[_0xa68a('0x38')]][_0xa68a('0x29')]=_0x53ee79[_0xa68a('0x41')];channels[_0x53ee79[_0xa68a('0x38')]][_0xa68a('0x3e')]='_attended';}}}catch(_0x5c40ea){utils[_0xa68a('0x21')](util[_0xa68a('0xa')]('[%s][calls][attendedtransfer]',_0x53ee79[_0xa68a('0x3a')]),_0x5c40ea);}};exports['musiconholdstart']=function(_0x1ff16b){try{if(!_[_0xa68a('0x24')](channels[_0x1ff16b[_0xa68a('0x8')]])){utils['debug'](util[_0xa68a('0xa')](_0xa68a('0x42'),_0x1ff16b[_0xa68a('0x8')]),_0x1ff16b);channels[_0x1ff16b['uniqueid']][_0xa68a('0x43')]=utils[_0xa68a('0x1f')]();utils[_0xa68a('0x1b')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1ff16b[_0xa68a('0x8')],channels[_0x1ff16b['uniqueid']][_0xa68a('0x43')]));}}catch(_0x57e51a){utils[_0xa68a('0x21')](util['format'](_0xa68a('0x42'),_0x1ff16b[_0xa68a('0x8')]),_0x57e51a);}};exports[_0xa68a('0x44')]=function(_0x40001d){try{if(!_['isNil'](channels[_0x40001d['uniqueid']])){utils[_0xa68a('0x18')](util['format'](_0xa68a('0x45'),_0x40001d[_0xa68a('0x8')]),_0x40001d);if(!_[_0xa68a('0x24')](channels[_0x40001d[_0xa68a('0x8')]][_0xa68a('0x43')])){channels[_0x40001d[_0xa68a('0x8')]][_0xa68a('0x46')]+=utils[_0xa68a('0x35')](utils[_0xa68a('0x1f')](),channels[_0x40001d[_0xa68a('0x8')]][_0xa68a('0x43')]);utils[_0xa68a('0x1b')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x40001d[_0xa68a('0x8')],channels[_0x40001d['uniqueid']][_0xa68a('0x46')]));delete channels[_0x40001d['uniqueid']][_0xa68a('0x43')];}}}catch(_0x4a76e3){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x45'),_0x40001d[_0xa68a('0x8')]),_0x4a76e3);}};exports[_0xa68a('0x47')]=function(_0x38dccb){try{if(!_['isNil'](channels[_0x38dccb[_0xa68a('0x8')]])){utils['debug'](util[_0xa68a('0xa')](_0xa68a('0x48'),_0x38dccb[_0xa68a('0x8')]),_0x38dccb);if(!_[_0xa68a('0x24')](_0x38dccb['variable'][_0xa68a('0x49')])){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')](_0xa68a('0x4a'),_0x38dccb[_0xa68a('0x8')],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb['uniqueid']]['source']=_0x38dccb[_0xa68a('0x4b')];}if(!_['isNil'](_0x38dccb['variable'][_0xa68a('0x4c')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x38dccb['uniqueid'],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x4d')]=_0x38dccb[_0xa68a('0x4b')];channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x2f')]='\x22'+_0x38dccb[_0xa68a('0x4b')]+_0xa68a('0x4e')+_0x38dccb['value']+'>';}if(!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x50')])||!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x51')])){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')](_0xa68a('0x52'),_0x38dccb[_0xa68a('0x8')],!_['isNil'](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x50')])?_0xa68a('0x50'):_0xa68a('0x51'),_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]]['callerid']=_0x38dccb['value'];}if(!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x53')])||!_['isNil'](_0x38dccb[_0xa68a('0x4f')]['xmcs-queue'])){utils['info'](util[_0xa68a('0xa')](_0xa68a('0x52'),_0x38dccb['uniqueid'],!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x53')])?_0xa68a('0x53'):_0xa68a('0x54'),_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb['uniqueid']][_0xa68a('0x55')]=_0xa68a('0x56');channels[_0x38dccb[_0xa68a('0x8')]]['lastdata']=_0x38dccb[_0xa68a('0x4b')];channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x57')]=!![];}if(!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x58')])){utils['info'](util[_0xa68a('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x38dccb['uniqueid'],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x59')]=_0x38dccb[_0xa68a('0x4b')];}if(!_['isNil'](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x5a')])){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')](_0xa68a('0x5b'),_0x38dccb[_0xa68a('0x8')],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x5c')]=_0x38dccb[_0xa68a('0x4b')];}if(!_['isNil'](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x5d')])){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x38dccb[_0xa68a('0x8')],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]]['routeid']=_0x38dccb['value'];}if(!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x5e')])){utils['info'](util[_0xa68a('0xa')](_0xa68a('0x5f'),_0x38dccb['uniqueid'],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x5e')]=_0x38dccb['value'];}}}catch(_0x2aacf0){utils[_0xa68a('0x21')](util['format'](_0xa68a('0x48'),_0x38dccb['uniqueid']),_0x2aacf0);}};exports[_0xa68a('0x60')]=function(_0x211797){try{if(!_[_0xa68a('0x24')](channels[_0x211797['uniqueid']])){utils['debug'](util[_0xa68a('0xa')](_0xa68a('0x61'),_0x211797[_0xa68a('0x8')]),_0x211797);utils[_0xa68a('0x1b')](util[_0xa68a('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x211797[_0xa68a('0x8')],_0x211797[_0xa68a('0x62')],_0x211797[_0xa68a('0x63')]));if(_0x211797['application']['toLowerCase']()=='set'&&_['startsWith'](_0x211797[_0xa68a('0x63')][_0xa68a('0x64')](),'cdr')){var _0x350d09=_0x211797[_0xa68a('0x63')]['split']('=');var _0x21e9c4=_0x350d09[0x0][_0xa68a('0x65')](_0x350d09[0x0][_0xa68a('0x66')]('(')+0x1,_0x350d09[0x0]['lastIndexOf'](')'));var _0x1e73b6=_0x350d09[0x1];channels[_0x211797[_0xa68a('0x8')]][_0x21e9c4]=_0x1e73b6;}if(!_['includes'](['hangup',_0xa68a('0x67'),_0xa68a('0x68'),_0xa68a('0x69'),'gotoif'],_0x211797[_0xa68a('0x62')][_0xa68a('0x64')]())){channels[_0x211797[_0xa68a('0x8')]][_0xa68a('0x55')]=_0x211797[_0xa68a('0x62')];channels[_0x211797['uniqueid']][_0xa68a('0x6a')]=_0x211797[_0xa68a('0x63')];}}}catch(_0x5ec98f){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x61'),_0x211797[_0xa68a('0x8')]),_0x5ec98f);}};
\ No newline at end of file
index 3610c71..063a8e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe18b=['error','[core]\x20error','close','[core]\x20close','managerevent','./utils','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xe18b,0x7e));var _0xbe18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18b[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xbe18('0x0'));exports['connect']=function(){utils[_0xbe18('0x1')](_0xbe18('0x2'));};exports[_0xbe18('0x3')]=function(){utils[_0xbe18('0x1')]('[core]\x20shutdown');};exports[_0xbe18('0x4')]=function(){utils['info'](_0xbe18('0x5'));};exports[_0xbe18('0x6')]=function(_0x319dbe){utils[_0xbe18('0x6')](_0xbe18('0x7'),_0x319dbe);};exports[_0xbe18('0x8')]=function(){utils['info'](_0xbe18('0x9'));};exports[_0xbe18('0xa')]=function(_0x13eaae){};
\ No newline at end of file
+var _0x8653=['./utils','info','shutdown','[core]\x20shutdown','[core]\x20fullybooted','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x440988,_0x377d5a){var _0x5500a1=function(_0x1d537d){while(--_0x1d537d){_0x440988['push'](_0x440988['shift']());}};_0x5500a1(++_0x377d5a);}(_0x8653,0x117));var _0x3865=function(_0x47cb73,_0xf4e045){_0x47cb73=_0x47cb73-0x0;var _0x459cec=_0x8653[_0x47cb73];return _0x459cec;};'use strict';var utils=require(_0x3865('0x0'));exports['connect']=function(){utils[_0x3865('0x1')]('[core]\x20connected');};exports[_0x3865('0x2')]=function(){utils['info'](_0x3865('0x3'));};exports['fullybooted']=function(){utils[_0x3865('0x1')](_0x3865('0x4'));};exports['error']=function(_0x59caba){utils['error'](_0x3865('0x5'),_0x59caba);};exports[_0x3865('0x6')]=function(){utils['info'](_0x3865('0x7'));};exports[_0x3865('0x8')]=function(_0x41db7d){};
\ No newline at end of file
index 4864a12..45ea1cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb103=['appdata','toLowerCase','cdr(routeid)','error','varset','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','holdtime','billableseconds','endtime','lodash','util','./utils','info','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x7b707c,_0x206242){var _0x2f8f35=function(_0x3e840b){while(--_0x3e840b){_0x7b707c['push'](_0x7b707c['shift']());}};_0x2f8f35(++_0x206242);}(_0xb103,0x15b));var _0x3b10=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0xb103[_0x34325b];return _0x3da348;};'use strict';var _=require(_0x3b10('0x0'));var util=require(_0x3b10('0x1'));var utils=require(_0x3b10('0x2'));var dials={};function writeDB(_0x5550f3){utils[_0x3b10('0x3')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x5550f3[_0x3b10('0x4')],_0x5550f3['channel'],_0x5550f3[_0x3b10('0x5')],_0x5550f3[_0x3b10('0x6')],_0x5550f3[_0x3b10('0x7')],_0x5550f3[_0x3b10('0x8')]));utils[_0x3b10('0x9')](_0x3b10('0xa'),_0x5550f3);delete dials[_0x5550f3[_0x3b10('0x4')]];}exports[_0x3b10('0xb')]=function(_0x473257){try{utils[_0x3b10('0xc')](util[_0x3b10('0xd')](_0x3b10('0xe'),_0x473257[_0x3b10('0x4')]),_0x473257);utils[_0x3b10('0x3')](util[_0x3b10('0xd')](_0x3b10('0xf'),_0x473257[_0x3b10('0x4')],_0x473257[_0x3b10('0x10')],_0x473257[_0x3b10('0x11')]));if(_0x473257[_0x3b10('0x10')][_0x3b10('0x12')]()=='set'&&_['startsWith'](_0x473257[_0x3b10('0x11')]['toLowerCase'](),_0x3b10('0x13'))){var _0xdba632=_0x473257[_0x3b10('0x11')]['split']('=');dials[_0x473257[_0x3b10('0x4')]]={'routeId':_0xdba632[0x1]};}}catch(_0x21ff8f){utils[_0x3b10('0x14')](util[_0x3b10('0xd')](_0x3b10('0xe'),_0x473257[_0x3b10('0x4')]),_0x21ff8f);}};exports[_0x3b10('0x15')]=function(_0x114d84){try{utils[_0x3b10('0xc')](util['format']('[%s][dials][varset]',_0x114d84[_0x3b10('0x4')]),_0x114d84);if(!_['isNil'](_0x114d84['variable'][_0x3b10('0x16')])){utils[_0x3b10('0x3')](util[_0x3b10('0xd')](_0x3b10('0x17'),_0x114d84[_0x3b10('0x4')],_0x114d84['value']));dials[_0x114d84[_0x3b10('0x4')]]={'routeId':_0x114d84[_0x3b10('0x18')]};}}catch(_0x3f4dcd){utils[_0x3b10('0x14')](util[_0x3b10('0xd')](_0x3b10('0x19'),_0x114d84[_0x3b10('0x4')]),_0x3f4dcd);}};exports[_0x3b10('0x1a')]=function(_0x5b4717){try{if(!_[_0x3b10('0x1b')](dials[_0x5b4717[_0x3b10('0x4')]])){utils['debug'](util['format'](_0x3b10('0x1c'),_0x5b4717[_0x3b10('0x4')]),_0x5b4717);dials[_0x5b4717['uniqueid']]=_[_0x3b10('0x1d')](dials[_0x5b4717['uniqueid']],_0x5b4717);dials[_0x5b4717['uniqueid']][_0x3b10('0x1e')]=utils[_0x3b10('0x1f')]();dials[_0x5b4717['uniqueid']][_0x3b10('0x20')]='called';utils[_0x3b10('0x3')](util[_0x3b10('0xd')](_0x3b10('0x21'),_0x5b4717['uniqueid'],dials[_0x5b4717[_0x3b10('0x4')]][_0x3b10('0x1e')]));}}catch(_0x3000a8){utils['error'](util[_0x3b10('0xd')](_0x3b10('0x1c'),_0x5b4717[_0x3b10('0x4')]),_0x3000a8);}};exports[_0x3b10('0x22')]=function(_0x1a1cfd){try{if(!_[_0x3b10('0x1b')](dials[_0x1a1cfd[_0x3b10('0x4')]])){utils[_0x3b10('0xc')](util[_0x3b10('0xd')](_0x3b10('0x23'),_0x1a1cfd[_0x3b10('0x4')]),_0x1a1cfd);dials[_0x1a1cfd['uniqueid']]['dialstatus']=_0x1a1cfd[_0x3b10('0x8')];if(_0x1a1cfd[_0x3b10('0x8')]==_0x3b10('0x24')){dials[_0x1a1cfd[_0x3b10('0x4')]]=_['assign'](dials[_0x1a1cfd[_0x3b10('0x4')]],_0x1a1cfd);dials[_0x1a1cfd[_0x3b10('0x4')]][_0x3b10('0x25')]=utils[_0x3b10('0x1f')]();dials[_0x1a1cfd[_0x3b10('0x4')]][_0x3b10('0x20')]=_0x3b10('0x26');utils[_0x3b10('0x3')](util[_0x3b10('0xd')](_0x3b10('0x27'),_0x1a1cfd['uniqueid'],_0x1a1cfd[_0x3b10('0x8')],dials[_0x1a1cfd['uniqueid']][_0x3b10('0x25')]));}else{utils[_0x3b10('0x3')](util[_0x3b10('0xd')](_0x3b10('0x28'),_0x1a1cfd['uniqueid'],_0x1a1cfd['dialstatus']));}}}catch(_0xb63020){utils[_0x3b10('0x14')](util[_0x3b10('0xd')](_0x3b10('0x23'),_0x1a1cfd[_0x3b10('0x4')]),_0xb63020);}};exports[_0x3b10('0x29')]=function(_0x702e3c){try{if(!_[_0x3b10('0x1b')](dials[_0x702e3c[_0x3b10('0x4')]])){utils[_0x3b10('0xc')](util[_0x3b10('0xd')](_0x3b10('0x2a'),_0x702e3c[_0x3b10('0x4')]),_0x702e3c);utils[_0x3b10('0x3')](util[_0x3b10('0xd')](_0x3b10('0x2b'),_0x702e3c[_0x3b10('0x4')],_0x702e3c[_0x3b10('0x6')],_0x702e3c[_0x3b10('0x2c')],_0x702e3c[_0x3b10('0x2d')]));dials[_0x702e3c[_0x3b10('0x4')]]=_[_0x3b10('0x1d')](dials[_0x702e3c[_0x3b10('0x4')]],{'endtime':utils[_0x3b10('0x1f')](),'lastevent':_0x3b10('0x2e')});dials[_0x702e3c[_0x3b10('0x4')]][_0x3b10('0x2f')]=utils[_0x3b10('0x30')](dials[_0x702e3c['uniqueid']]['endtime'],dials[_0x702e3c['uniqueid']][_0x3b10('0x1e')]);dials[_0x702e3c[_0x3b10('0x4')]][_0x3b10('0x31')]=utils[_0x3b10('0x30')](dials[_0x702e3c[_0x3b10('0x4')]][_0x3b10('0x25')]||dials[_0x702e3c[_0x3b10('0x4')]]['endtime'],dials[_0x702e3c[_0x3b10('0x4')]][_0x3b10('0x1e')]);dials[_0x702e3c[_0x3b10('0x4')]][_0x3b10('0x32')]=dials[_0x702e3c[_0x3b10('0x4')]][_0x3b10('0x25')]?utils[_0x3b10('0x30')](dials[_0x702e3c['uniqueid']][_0x3b10('0x33')],dials[_0x702e3c[_0x3b10('0x4')]][_0x3b10('0x25')]):0x0;writeDB(dials[_0x702e3c[_0x3b10('0x4')]]);}}catch(_0x17bac1){utils[_0x3b10('0x14')](util[_0x3b10('0xd')](_0x3b10('0x2a'),_0x702e3c[_0x3b10('0x4')]),_0x17bac1);}};
\ No newline at end of file
+var _0x7085=['connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','appdata','application','toLowerCase','startsWith','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','answertime','lastevent'];(function(_0x5a630b,_0x1add18){var _0x3ba7cb=function(_0x3d9105){while(--_0x3d9105){_0x5a630b['push'](_0x5a630b['shift']());}};_0x3ba7cb(++_0x1add18);}(_0x7085,0x146));var _0x5708=function(_0x2958f8,_0x1b8fda){_0x2958f8=_0x2958f8-0x0;var _0x1a02c0=_0x7085[_0x2958f8];return _0x1a02c0;};'use strict';var _=require('lodash');var util=require(_0x5708('0x0'));var utils=require(_0x5708('0x1'));var dials={};function writeDB(_0x563618){utils[_0x5708('0x2')](util[_0x5708('0x3')](_0x5708('0x4'),_0x563618['uniqueid'],_0x563618[_0x5708('0x5')],_0x563618[_0x5708('0x6')],_0x563618[_0x5708('0x7')],_0x563618[_0x5708('0x8')],_0x563618[_0x5708('0x9')]));utils[_0x5708('0xa')](_0x5708('0xb'),_0x563618);delete dials[_0x563618[_0x5708('0xc')]];}exports[_0x5708('0xd')]=function(_0x3cfa4d){try{utils[_0x5708('0xe')](util['format'](_0x5708('0xf'),_0x3cfa4d[_0x5708('0xc')]),_0x3cfa4d);utils[_0x5708('0x2')](util[_0x5708('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x3cfa4d[_0x5708('0xc')],_0x3cfa4d['application'],_0x3cfa4d[_0x5708('0x10')]));if(_0x3cfa4d[_0x5708('0x11')][_0x5708('0x12')]()=='set'&&_[_0x5708('0x13')](_0x3cfa4d[_0x5708('0x10')]['toLowerCase'](),'cdr(routeid)')){var _0x2031a4=_0x3cfa4d[_0x5708('0x10')]['split']('=');dials[_0x3cfa4d[_0x5708('0xc')]]={'routeId':_0x2031a4[0x1]};}}catch(_0x4b8ca9){utils['error'](util[_0x5708('0x3')](_0x5708('0xf'),_0x3cfa4d[_0x5708('0xc')]),_0x4b8ca9);}};exports[_0x5708('0x14')]=function(_0x321102){try{utils[_0x5708('0xe')](util['format'](_0x5708('0x15'),_0x321102[_0x5708('0xc')]),_0x321102);if(!_[_0x5708('0x16')](_0x321102[_0x5708('0x17')][_0x5708('0x18')])){utils[_0x5708('0x2')](util['format'](_0x5708('0x19'),_0x321102[_0x5708('0xc')],_0x321102['value']));dials[_0x321102[_0x5708('0xc')]]={'routeId':_0x321102['value']};}}catch(_0x33a138){utils[_0x5708('0x1a')](util['format']('[%s][dials][varset]',_0x321102['uniqueid']),_0x33a138);}};exports[_0x5708('0x1b')]=function(_0x415f52){try{if(!_[_0x5708('0x16')](dials[_0x415f52[_0x5708('0xc')]])){utils[_0x5708('0xe')](util[_0x5708('0x3')](_0x5708('0x1c'),_0x415f52['uniqueid']),_0x415f52);dials[_0x415f52['uniqueid']]=_[_0x5708('0x1d')](dials[_0x415f52['uniqueid']],_0x415f52);dials[_0x415f52[_0x5708('0xc')]][_0x5708('0x1e')]=utils[_0x5708('0x1f')]();dials[_0x415f52[_0x5708('0xc')]]['lastevent']=_0x5708('0x20');utils['info'](util[_0x5708('0x3')](_0x5708('0x21'),_0x415f52[_0x5708('0xc')],dials[_0x415f52[_0x5708('0xc')]][_0x5708('0x1e')]));}}catch(_0xeb5412){utils['error'](util[_0x5708('0x3')](_0x5708('0x1c'),_0x415f52['uniqueid']),_0xeb5412);}};exports[_0x5708('0x22')]=function(_0x37c495){try{if(!_['isNil'](dials[_0x37c495[_0x5708('0xc')]])){utils[_0x5708('0xe')](util[_0x5708('0x3')]('[%s][dials][dialend]',_0x37c495['uniqueid']),_0x37c495);dials[_0x37c495[_0x5708('0xc')]][_0x5708('0x9')]=_0x37c495[_0x5708('0x9')];if(_0x37c495['dialstatus']==_0x5708('0x23')){dials[_0x37c495[_0x5708('0xc')]]=_[_0x5708('0x1d')](dials[_0x37c495[_0x5708('0xc')]],_0x37c495);dials[_0x37c495['uniqueid']][_0x5708('0x24')]=utils['now']();dials[_0x37c495[_0x5708('0xc')]][_0x5708('0x25')]=_0x5708('0x26');utils[_0x5708('0x2')](util[_0x5708('0x3')](_0x5708('0x27'),_0x37c495['uniqueid'],_0x37c495['dialstatus'],dials[_0x37c495[_0x5708('0xc')]][_0x5708('0x24')]));}else{utils['info'](util['format'](_0x5708('0x28'),_0x37c495['uniqueid'],_0x37c495[_0x5708('0x9')]));}}}catch(_0xd6ccad){utils[_0x5708('0x1a')](util[_0x5708('0x3')](_0x5708('0x29'),_0x37c495['uniqueid']),_0xd6ccad);}};exports['hangup']=function(_0xc1d866){try{if(!_[_0x5708('0x16')](dials[_0xc1d866[_0x5708('0xc')]])){utils[_0x5708('0xe')](util[_0x5708('0x3')](_0x5708('0x2a'),_0xc1d866[_0x5708('0xc')]),_0xc1d866);utils[_0x5708('0x2')](util['format'](_0x5708('0x2b'),_0xc1d866[_0x5708('0xc')],_0xc1d866[_0x5708('0x7')],_0xc1d866[_0x5708('0x2c')],_0xc1d866[_0x5708('0x2d')]));dials[_0xc1d866['uniqueid']]=_[_0x5708('0x1d')](dials[_0xc1d866[_0x5708('0xc')]],{'endtime':utils[_0x5708('0x1f')](),'lastevent':_0x5708('0x2e')});dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x2f')]=utils[_0x5708('0x30')](dials[_0xc1d866['uniqueid']][_0x5708('0x31')],dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x1e')]);dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x32')]=utils['diffTime'](dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x24')]||dials[_0xc1d866['uniqueid']]['endtime'],dials[_0xc1d866['uniqueid']][_0x5708('0x1e')]);dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x33')]=dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x24')]?utils[_0x5708('0x30')](dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x31')],dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x24')]):0x0;writeDB(dials[_0xc1d866[_0x5708('0xc')]]);}}catch(_0x163a1b){utils[_0x5708('0x1a')](util[_0x5708('0x3')](_0x5708('0x2a'),_0xc1d866[_0x5708('0xc')]),_0x163a1b);}};
\ No newline at end of file
index 760e9ad..ab069d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f4e=['hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','format','device','debug','uniqueid','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]'];(function(_0x32805f,_0xa54a2e){var _0x534e39=function(_0x49ff44){while(--_0x49ff44){_0x32805f['push'](_0x32805f['shift']());}};_0x534e39(++_0xa54a2e);}(_0x3f4e,0x1b7));var _0xe3f4=function(_0x161f59,_0x42e9ff){_0x161f59=_0x161f59-0x0;var _0x3ffa0e=_0x3f4e[_0x161f59];return _0x3ffa0e;};var AsteriskManager=require(_0xe3f4('0x0'));var config=require(_0xe3f4('0x1'));var utils=require(_0xe3f4('0x2'));var util=require(_0xe3f4('0x3'));var ami=new AsteriskManager(config[_0xe3f4('0x4')][_0xe3f4('0x5')],config['asterisk']['ip'],config[_0xe3f4('0x4')][_0xe3f4('0x6')],config[_0xe3f4('0x4')][_0xe3f4('0x7')],!![]);ami[_0xe3f4('0x8')]();if(config[_0xe3f4('0x9')]&&config[_0xe3f4('0x9')][_0xe3f4('0xa')]){utils[_0xe3f4('0xb')](_0xe3f4('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0xe3f4('0xd'));var queues=require(_0xe3f4('0xe'));var recordings=require(_0xe3f4('0xf'));var members=require(_0xe3f4('0x10'));var dials=require(_0xe3f4('0x11'));var transfers=require('./transfers.controller');var core=require(_0xe3f4('0x12'));ami['on']('connect',core[_0xe3f4('0x13')]);ami['on'](_0xe3f4('0x14'),core[_0xe3f4('0x14')]);ami['on'](_0xe3f4('0x15'),core[_0xe3f4('0x15')]);ami['on'](_0xe3f4('0x16'),core[_0xe3f4('0x16')]);ami['on']('close',core[_0xe3f4('0x17')]);ami['on'](_0xe3f4('0x18'),core[_0xe3f4('0x18')]);ami['on'](_0xe3f4('0x19'),function(_0x52ecfb){try{utils['debug'](util['format'](_0xe3f4('0x1a'),_0x52ecfb['device']),_0x52ecfb);members[_0xe3f4('0x19')](_0x52ecfb);}catch(_0x4c152d){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')]('[%s][index][devicestatechange]',_0x52ecfb[_0xe3f4('0x1c')]),_0x4c152d);}});ami['on']('agentcalled',function(_0x2769ed){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')]('[%s][index][agentcalled]',_0x2769ed[_0xe3f4('0x1e')]),_0x2769ed);agents[_0xe3f4('0x1f')](_0x2769ed);}catch(_0x21e667){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')](_0xe3f4('0x20'),_0x2769ed['uniqueid']),_0x21e667);}});ami['on'](_0xe3f4('0x21'),function(_0x2deed3){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x22'),_0x2deed3[_0xe3f4('0x1e')]),_0x2deed3);agents[_0xe3f4('0x21')](_0x2deed3);}catch(_0x97b4b7){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')](_0xe3f4('0x22'),_0x2deed3[_0xe3f4('0x1e')]),_0x97b4b7);}});ami['on']('agentconnect',function(_0x5197a9){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x23'),_0x5197a9['uniqueid']),_0x5197a9);agents[_0xe3f4('0x24')](_0x5197a9);queues['agentconnect'](_0x5197a9);}catch(_0xab358d){utils[_0xe3f4('0x16')](util['format'](_0xe3f4('0x23'),_0x5197a9[_0xe3f4('0x1e')]),_0xab358d);}});ami['on'](_0xe3f4('0x25'),function(_0x2849f3){try{utils['debug'](util[_0xe3f4('0x1b')]('[%s][index][agentcomplete]',_0x2849f3[_0xe3f4('0x1e')]),_0x2849f3);agents[_0xe3f4('0x25')](_0x2849f3);queues[_0xe3f4('0x25')](_0x2849f3);members['agentcomplete'](_0x2849f3);}catch(_0x1e16ad){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')](_0xe3f4('0x26'),_0x2849f3[_0xe3f4('0x1e')]),_0x1e16ad);}});ami['on'](_0xe3f4('0x27'),function(_0x598e9e){try{utils['debug'](util[_0xe3f4('0x1b')]('[%s][index][queuecallerabandon]',_0x598e9e[_0xe3f4('0x1e')]),_0x598e9e);agents[_0xe3f4('0x27')](_0x598e9e);queues[_0xe3f4('0x27')](_0x598e9e);}catch(_0x156bba){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')](_0xe3f4('0x28'),_0x598e9e[_0xe3f4('0x1e')]),_0x156bba);}});ami['on']('queuecallerjoin',function(_0x159f8f){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x29'),_0x159f8f[_0xe3f4('0x1e')]),_0x159f8f);queues['queuecallerjoin'](_0x159f8f);recordings[_0xe3f4('0x2a')](_0x159f8f);}catch(_0x3ddaa){utils[_0xe3f4('0x16')](util['format'](_0xe3f4('0x29'),_0x159f8f[_0xe3f4('0x1e')]),_0x3ddaa);}});ami['on']('queuecallerleave',function(_0x171363){try{utils[_0xe3f4('0x1d')](util['format'](_0xe3f4('0x2b'),_0x171363[_0xe3f4('0x1e')]),_0x171363);queues[_0xe3f4('0x2c')](_0x171363);}catch(_0x3ff395){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')](_0xe3f4('0x2b'),_0x171363['uniqueid']),_0x3ff395);}});ami['on'](_0xe3f4('0x2d'),function(_0x1a0c65){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x2e'),_0x1a0c65['uniqueid']),_0x1a0c65);queues[_0xe3f4('0x2d')](_0x1a0c65);calls[_0xe3f4('0x2d')](_0x1a0c65);}catch(_0x3c6302){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x1a0c65[_0xe3f4('0x1e')]),_0x3c6302);}});ami['on'](_0xe3f4('0x2f'),function(_0x82c4bf){try{utils['debug'](util[_0xe3f4('0x1b')](_0xe3f4('0x30'),_0x82c4bf['uniqueid']),_0x82c4bf);queues['musiconholdstop'](_0x82c4bf);calls[_0xe3f4('0x2f')](_0x82c4bf);}catch(_0x338896){utils[_0xe3f4('0x16')](util['format'](_0xe3f4('0x30'),_0x82c4bf[_0xe3f4('0x1e')]),_0x338896);}});ami['on'](_0xe3f4('0x31'),function(_0x22e986){try{utils[_0xe3f4('0x1d')](util['format'](_0xe3f4('0x32'),_0x22e986[_0xe3f4('0x1e')]),_0x22e986);calls['newstate'](_0x22e986);recordings[_0xe3f4('0x31')](_0x22e986);}catch(_0x126cef){utils[_0xe3f4('0x16')](util['format'](_0xe3f4('0x32'),_0x22e986[_0xe3f4('0x1e')]),_0x126cef);}});ami['on'](_0xe3f4('0x33'),function(_0x1e34ed){try{utils['debug'](util[_0xe3f4('0x1b')](_0xe3f4('0x34'),_0x1e34ed['uniqueid']),_0x1e34ed);calls['hangup'](_0x1e34ed);recordings[_0xe3f4('0x33')](_0x1e34ed);dials[_0xe3f4('0x33')](_0x1e34ed);agents['hangup'](_0x1e34ed);queues[_0xe3f4('0x33')](_0x1e34ed);}catch(_0x305f76){utils[_0xe3f4('0x16')](util['format'](_0xe3f4('0x34'),_0x1e34ed['uniqueid']),_0x305f76);}});ami['on'](_0xe3f4('0x35'),function(_0x423bb5){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x36'),_0x423bb5[_0xe3f4('0x1e')]),_0x423bb5);members[_0xe3f4('0x35')](_0x423bb5);}catch(_0x2dc2d0){utils[_0xe3f4('0x16')](util['format']('[%s][index][cdr]',_0x423bb5['uniqueid']),_0x2dc2d0);}});ami['on']('blindtransfer',function(_0x13925b){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x37'),_0x13925b[_0xe3f4('0x1e')]),_0x13925b);queues[_0xe3f4('0x38')](_0x13925b);agents[_0xe3f4('0x38')](_0x13925b);transfers['blindtransfer'](_0x13925b);}catch(_0x752ad0){utils['error'](util[_0xe3f4('0x1b')]('[%s][index][blindtransfer]',_0x13925b['uniqueid']),_0x752ad0);}});ami['on'](_0xe3f4('0x39'),function(_0x823588){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')]('[%s][index][attendedtransfer]',_0x823588[_0xe3f4('0x3a')]),_0x823588);queues['attendedtransfer'](_0x823588);transfers[_0xe3f4('0x39')](_0x823588);agents[_0xe3f4('0x39')](_0x823588);calls[_0xe3f4('0x39')](_0x823588);}catch(_0x4fe95e){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')](_0xe3f4('0x3b'),_0x823588[_0xe3f4('0x3a')]),_0x4fe95e);}});ami['on'](_0xe3f4('0x3c'),function(_0x13fe28){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x3d'),_0x13fe28[_0xe3f4('0x1e')]),_0x13fe28);queues[_0xe3f4('0x3c')](_0x13fe28);recordings[_0xe3f4('0x3c')](_0x13fe28);calls[_0xe3f4('0x3c')](_0x13fe28);dials[_0xe3f4('0x3c')](_0x13fe28);}catch(_0x95e9e9){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')]('[%s][index][varset]',_0x13fe28[_0xe3f4('0x1e')]),_0x95e9e9);}});ami['on'](_0xe3f4('0x3e'),function(_0x3fc28d){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x3f'),_0x3fc28d[_0xe3f4('0x1e')]),_0x3fc28d);calls[_0xe3f4('0x3e')](_0x3fc28d);recordings['newexten'](_0x3fc28d);dials[_0xe3f4('0x3e')](_0x3fc28d);}catch(_0x32fbba){utils[_0xe3f4('0x16')](util['format']('[%s][index][newexten]',_0x3fc28d[_0xe3f4('0x1e')]),_0x32fbba);}});ami['on'](_0xe3f4('0x40'),function(_0x19c68f){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x41'),_0x19c68f[_0xe3f4('0x1e')]),_0x19c68f);calls[_0xe3f4('0x40')](_0x19c68f);recordings['newchannel'](_0x19c68f);}catch(_0x3d5398){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')](_0xe3f4('0x41'),_0x19c68f[_0xe3f4('0x1e')]),_0x3d5398);}});ami['on'](_0xe3f4('0x42'),function(_0x142725){try{utils['debug'](util[_0xe3f4('0x1b')](_0xe3f4('0x43'),_0x142725[_0xe3f4('0x1e')]),_0x142725);dials[_0xe3f4('0x42')](_0x142725);}catch(_0x33ed84){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')]('[%s]dialbegin',_0x142725[_0xe3f4('0x1e')]),_0x33ed84);}});ami['on'](_0xe3f4('0x44'),function(_0x4ce386){try{utils[_0xe3f4('0x1d')](util[_0xe3f4('0x1b')](_0xe3f4('0x45'),_0x4ce386[_0xe3f4('0x1e')]),_0x4ce386);dials[_0xe3f4('0x44')](_0x4ce386);}catch(_0x3a7937){utils[_0xe3f4('0x16')](util[_0xe3f4('0x1b')]('[%s][index][dialend]',_0x4ce386[_0xe3f4('0x1e')]),_0x3a7937);}});}
\ No newline at end of file
+var _0x2280=['[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','username','keepConnected','xdr','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','[%s][index][devicestatechange]','device','devicestatechange','format','agentcalled','debug'];(function(_0x58a474,_0x43e84d){var _0x76da16=function(_0x309faa){while(--_0x309faa){_0x58a474['push'](_0x58a474['shift']());}};_0x76da16(++_0x43e84d);}(_0x2280,0x1e6));var _0x0228=function(_0x833f58,_0x480fa6){_0x833f58=_0x833f58-0x0;var _0x36a3a6=_0x2280[_0x833f58];return _0x36a3a6;};var AsteriskManager=require(_0x0228('0x0'));var config=require(_0x0228('0x1'));var utils=require('./utils');var util=require(_0x0228('0x2'));var ami=new AsteriskManager(config[_0x0228('0x3')]['port'],config['asterisk']['ip'],config[_0x0228('0x3')][_0x0228('0x4')],config['asterisk']['password'],!![]);ami[_0x0228('0x5')]();if(config['xdr']&&config[_0x0228('0x6')]['disabled']){utils['info'](_0x0228('0x7'));}else{var agents=require('./agents.controller');var calls=require(_0x0228('0x8'));var queues=require(_0x0228('0x9'));var recordings=require(_0x0228('0xa'));var members=require(_0x0228('0xb'));var dials=require(_0x0228('0xc'));var transfers=require(_0x0228('0xd'));var core=require('./core.controller');ami['on'](_0x0228('0xe'),core[_0x0228('0xe')]);ami['on'](_0x0228('0xf'),core[_0x0228('0xf')]);ami['on'](_0x0228('0x10'),core[_0x0228('0x10')]);ami['on'](_0x0228('0x11'),core['error']);ami['on'](_0x0228('0x12'),core[_0x0228('0x12')]);ami['on'](_0x0228('0x13'),core[_0x0228('0x13')]);ami['on']('devicestatechange',function(_0x44506f){try{utils['debug'](util['format'](_0x0228('0x14'),_0x44506f[_0x0228('0x15')]),_0x44506f);members[_0x0228('0x16')](_0x44506f);}catch(_0x5e27a7){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x14'),_0x44506f[_0x0228('0x15')]),_0x5e27a7);}});ami['on'](_0x0228('0x18'),function(_0x224162){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x1a'),_0x224162['uniqueid']),_0x224162);agents[_0x0228('0x18')](_0x224162);}catch(_0x5443f1){utils['error'](util[_0x0228('0x17')](_0x0228('0x1a'),_0x224162[_0x0228('0x1b')]),_0x5443f1);}});ami['on'](_0x0228('0x1c'),function(_0x585139){try{utils['debug'](util[_0x0228('0x17')](_0x0228('0x1d'),_0x585139[_0x0228('0x1b')]),_0x585139);agents[_0x0228('0x1c')](_0x585139);}catch(_0x51053e){utils['error'](util[_0x0228('0x17')]('[%s][index][agentringnoanswer]',_0x585139['uniqueid']),_0x51053e);}});ami['on'](_0x0228('0x1e'),function(_0x2bdfb4){try{utils[_0x0228('0x19')](util['format'](_0x0228('0x1f'),_0x2bdfb4['uniqueid']),_0x2bdfb4);agents['agentconnect'](_0x2bdfb4);queues[_0x0228('0x1e')](_0x2bdfb4);}catch(_0x2e61c8){utils['error'](util['format'](_0x0228('0x1f'),_0x2bdfb4[_0x0228('0x1b')]),_0x2e61c8);}});ami['on'](_0x0228('0x20'),function(_0x1df31c){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x21'),_0x1df31c[_0x0228('0x1b')]),_0x1df31c);agents[_0x0228('0x20')](_0x1df31c);queues['agentcomplete'](_0x1df31c);members[_0x0228('0x20')](_0x1df31c);}catch(_0x44dc17){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x21'),_0x1df31c[_0x0228('0x1b')]),_0x44dc17);}});ami['on']('queuecallerabandon',function(_0x1dc0e7){try{utils['debug'](util[_0x0228('0x17')](_0x0228('0x22'),_0x1dc0e7['uniqueid']),_0x1dc0e7);agents[_0x0228('0x23')](_0x1dc0e7);queues[_0x0228('0x23')](_0x1dc0e7);}catch(_0x39be9e){utils['error'](util[_0x0228('0x17')](_0x0228('0x22'),_0x1dc0e7[_0x0228('0x1b')]),_0x39be9e);}});ami['on'](_0x0228('0x24'),function(_0x30898d){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x25'),_0x30898d[_0x0228('0x1b')]),_0x30898d);queues[_0x0228('0x24')](_0x30898d);recordings[_0x0228('0x24')](_0x30898d);}catch(_0x4ef317){utils['error'](util[_0x0228('0x17')](_0x0228('0x25'),_0x30898d[_0x0228('0x1b')]),_0x4ef317);}});ami['on'](_0x0228('0x26'),function(_0x100249){try{utils[_0x0228('0x19')](util['format'](_0x0228('0x27'),_0x100249[_0x0228('0x1b')]),_0x100249);queues[_0x0228('0x26')](_0x100249);}catch(_0x4967b7){utils[_0x0228('0x11')](util['format']('[%s][index][queuecallerleave]',_0x100249[_0x0228('0x1b')]),_0x4967b7);}});ami['on'](_0x0228('0x28'),function(_0x5744f7){try{utils['debug'](util[_0x0228('0x17')](_0x0228('0x29'),_0x5744f7['uniqueid']),_0x5744f7);queues['musiconholdstart'](_0x5744f7);calls[_0x0228('0x28')](_0x5744f7);}catch(_0x48770a){utils[_0x0228('0x11')](util['format']('[%s][index][musiconholdstart]',_0x5744f7[_0x0228('0x1b')]),_0x48770a);}});ami['on'](_0x0228('0x2a'),function(_0x452e0c){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x2b'),_0x452e0c['uniqueid']),_0x452e0c);queues[_0x0228('0x2a')](_0x452e0c);calls[_0x0228('0x2a')](_0x452e0c);}catch(_0x4b5374){utils['error'](util['format'](_0x0228('0x2b'),_0x452e0c[_0x0228('0x1b')]),_0x4b5374);}});ami['on'](_0x0228('0x2c'),function(_0x2da60d){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x2d'),_0x2da60d[_0x0228('0x1b')]),_0x2da60d);calls['newstate'](_0x2da60d);recordings[_0x0228('0x2c')](_0x2da60d);}catch(_0x4d581c){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x2d'),_0x2da60d[_0x0228('0x1b')]),_0x4d581c);}});ami['on'](_0x0228('0x2e'),function(_0x57322f){try{utils[_0x0228('0x19')](util[_0x0228('0x17')]('[%s][index][hangup]',_0x57322f[_0x0228('0x1b')]),_0x57322f);calls[_0x0228('0x2e')](_0x57322f);recordings['hangup'](_0x57322f);dials[_0x0228('0x2e')](_0x57322f);agents[_0x0228('0x2e')](_0x57322f);queues['hangup'](_0x57322f);}catch(_0x27cce7){utils['error'](util[_0x0228('0x17')](_0x0228('0x2f'),_0x57322f['uniqueid']),_0x27cce7);}});ami['on'](_0x0228('0x30'),function(_0x411d59){try{utils[_0x0228('0x19')](util['format'](_0x0228('0x31'),_0x411d59[_0x0228('0x1b')]),_0x411d59);members[_0x0228('0x30')](_0x411d59);}catch(_0x1dccd4){utils[_0x0228('0x11')](util[_0x0228('0x17')]('[%s][index][cdr]',_0x411d59['uniqueid']),_0x1dccd4);}});ami['on'](_0x0228('0x32'),function(_0x4925f3){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x33'),_0x4925f3[_0x0228('0x1b')]),_0x4925f3);queues[_0x0228('0x32')](_0x4925f3);agents[_0x0228('0x32')](_0x4925f3);transfers[_0x0228('0x32')](_0x4925f3);}catch(_0x4c3532){utils['error'](util['format'](_0x0228('0x33'),_0x4925f3[_0x0228('0x1b')]),_0x4c3532);}});ami['on']('attendedtransfer',function(_0x57f3b1){try{utils[_0x0228('0x19')](util[_0x0228('0x17')]('[%s][index][attendedtransfer]',_0x57f3b1[_0x0228('0x34')]),_0x57f3b1);queues[_0x0228('0x35')](_0x57f3b1);transfers[_0x0228('0x35')](_0x57f3b1);agents[_0x0228('0x35')](_0x57f3b1);calls[_0x0228('0x35')](_0x57f3b1);}catch(_0x287b6b){utils['error'](util[_0x0228('0x17')]('[%s][index][attendedtransfer]',_0x57f3b1[_0x0228('0x34')]),_0x287b6b);}});ami['on'](_0x0228('0x36'),function(_0x38dc08){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x37'),_0x38dc08[_0x0228('0x1b')]),_0x38dc08);queues[_0x0228('0x36')](_0x38dc08);recordings[_0x0228('0x36')](_0x38dc08);calls[_0x0228('0x36')](_0x38dc08);dials[_0x0228('0x36')](_0x38dc08);}catch(_0x1ff3f9){utils[_0x0228('0x11')](util['format'](_0x0228('0x37'),_0x38dc08[_0x0228('0x1b')]),_0x1ff3f9);}});ami['on'](_0x0228('0x38'),function(_0x2d637a){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x39'),_0x2d637a[_0x0228('0x1b')]),_0x2d637a);calls[_0x0228('0x38')](_0x2d637a);recordings[_0x0228('0x38')](_0x2d637a);dials[_0x0228('0x38')](_0x2d637a);}catch(_0x2adec8){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x39'),_0x2d637a['uniqueid']),_0x2adec8);}});ami['on'](_0x0228('0x3a'),function(_0x5e9268){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x3b'),_0x5e9268[_0x0228('0x1b')]),_0x5e9268);calls[_0x0228('0x3a')](_0x5e9268);recordings[_0x0228('0x3a')](_0x5e9268);}catch(_0x5bf8cb){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x3b'),_0x5e9268[_0x0228('0x1b')]),_0x5bf8cb);}});ami['on']('dialbegin',function(_0x3047e7){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x3c'),_0x3047e7[_0x0228('0x1b')]),_0x3047e7);dials[_0x0228('0x3d')](_0x3047e7);}catch(_0x385bc3){utils['error'](util[_0x0228('0x17')](_0x0228('0x3e'),_0x3047e7[_0x0228('0x1b')]),_0x385bc3);}});ami['on']('dialend',function(_0x57c3ab){try{utils['debug'](util['format'](_0x0228('0x3f'),_0x57c3ab[_0x0228('0x1b')]),_0x57c3ab);dials['dialend'](_0x57c3ab);}catch(_0x583961){utils[_0x0228('0x11')](util['format']('[%s][index][dialend]',_0x57c3ab[_0x0228('0x1b')]),_0x583961);}});}
\ No newline at end of file
index d4b405d..4f833cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ca7=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','duration','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','isNil','exitAt','[%s][members][cdr]','lodash','Queue:','info','format'];(function(_0x59ea7d,_0xc0b37b){var _0x318157=function(_0x578d4f){while(--_0x578d4f){_0x59ea7d['push'](_0x59ea7d['shift']());}};_0x318157(++_0xc0b37b);}(_0x8ca7,0x9b));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78ca('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0x78ca('0x1')];function writeDB(_0x26ee57){utils[_0x78ca('0x2')](util[_0x78ca('0x3')](_0x78ca('0x4'),_0x26ee57[_0x78ca('0x5')],_0x26ee57['interface'],_0x26ee57[_0x78ca('0x6')],_0x26ee57[_0x78ca('0x7')],_0x26ee57[_0x78ca('0x8')],_0x26ee57[_0x78ca('0x9')]));if(_0x26ee57[_0x78ca('0xa')]){utils[_0x78ca('0xb')](_0x26ee57[_0x78ca('0xa')])[_0x78ca('0xc')](function(_0x260d0e){if(_0x260d0e){_0x26ee57[_0x78ca('0x8')]=_0x260d0e[_0x78ca('0xd')];_0x26ee57[_0x78ca('0xe')]=_0x260d0e[_0x78ca('0xe')];utils[_0x78ca('0xf')](_0x78ca('0x10'),_0x26ee57);}else{utils[_0x78ca('0x11')](_0x26ee57[_0x78ca('0xa')][_0x78ca('0x12')]('/')[0x1])['then'](function(_0x5db085){if(_0x5db085){_0x26ee57[_0x78ca('0x8')]=_0x5db085[_0x78ca('0xd')];_0x26ee57[_0x78ca('0xe')]=_0x5db085[_0x78ca('0xe')];utils[_0x78ca('0xf')](_0x78ca('0x10'),_0x26ee57);}});}})[_0x78ca('0x13')](function(_0x4322a2){utils[_0x78ca('0x14')](util[_0x78ca('0x3')](_0x78ca('0x15'),_0x26ee57['uniqueid']),_0x4322a2);});}delete members[_0x26ee57['interface']];}function startsWith(_0x1781f0,_0x78fc7b){return _[_0x78ca('0x16')](_0x1781f0,function(_0x3ead02){return _[_0x78ca('0x17')](_0x78fc7b,_0x3ead02);});}exports[_0x78ca('0x18')]=function(_0x52bea9){try{utils[_0x78ca('0x19')](util[_0x78ca('0x3')](_0x78ca('0x1a'),members[_0x52bea9[_0x78ca('0x1b')]]?members[_0x52bea9[_0x78ca('0x1b')]][_0x78ca('0x5')]:_0x52bea9[_0x78ca('0x1b')]),_0x52bea9);utils[_0x78ca('0x2')](util[_0x78ca('0x3')](_0x78ca('0x1c'),members[_0x52bea9['device']]?members[_0x52bea9[_0x78ca('0x1b')]][_0x78ca('0x5')]:_0x52bea9[_0x78ca('0x1b')],_0x52bea9['state'],_0x52bea9[_0x78ca('0x1b')]));switch(_0x52bea9[_0x78ca('0x1d')]){case _0x78ca('0x1e'):case _0x78ca('0x1f'):if(!startsWith(exclude,_0x52bea9[_0x78ca('0x1b')])){members[_0x52bea9[_0x78ca('0x1b')]]={'channel':_0x78ca('0x20'),'interface':_0x52bea9[_0x78ca('0x1b')],'type':_0x78ca('0x21'),'enterAt':utils[_0x78ca('0x22')](),'role':_0x78ca('0x23')};}break;case _0x78ca('0x24'):if(!_['isNil'](members[_0x52bea9[_0x78ca('0x1b')]])){members[_0x52bea9[_0x78ca('0x1b')]]['exitAt']=utils[_0x78ca('0x22')]();members[_0x52bea9['device']][_0x78ca('0x25')]=utils['diffTime'](members[_0x52bea9['device']]['exitAt'],members[_0x52bea9['device']][_0x78ca('0x26')]);if(members[_0x52bea9[_0x78ca('0x1b')]][_0x78ca('0x5')]){writeDB(members[_0x52bea9[_0x78ca('0x1b')]]);}}break;default:break;}}catch(_0x24c450){utils[_0x78ca('0x14')](util[_0x78ca('0x3')](_0x78ca('0x1a'),members[_0x52bea9[_0x78ca('0x1b')]]?members[_0x52bea9[_0x78ca('0x1b')]]['uniqueid']:_0x52bea9[_0x78ca('0x1b')]),_0x24c450);}};exports[_0x78ca('0x27')]=function(_0x42a0e3){try{if(!_['isNil'](members[_0x42a0e3[_0x78ca('0xa')]])){utils[_0x78ca('0x19')](util[_0x78ca('0x3')](_0x78ca('0x28'),_0x42a0e3[_0x78ca('0x5')]),_0x42a0e3);utils[_0x78ca('0x2')](util[_0x78ca('0x3')](_0x78ca('0x29'),_0x42a0e3[_0x78ca('0x5')],_0x42a0e3['interface'],_0x42a0e3[_0x78ca('0x2a')]));members[_0x42a0e3[_0x78ca('0xa')]]=_[_0x78ca('0x2b')](members[_0x42a0e3[_0x78ca('0xa')]],{'data4':_0x42a0e3['queue'],'uniqueid':_0x42a0e3[_0x78ca('0x5')]});}}catch(_0x577a20){utils[_0x78ca('0x14')](util[_0x78ca('0x3')](_0x78ca('0x28'),_0x42a0e3[_0x78ca('0x5')]),_0x577a20);}};exports[_0x78ca('0x2c')]=function(_0x40788c){try{utils[_0x78ca('0x19')](util[_0x78ca('0x3')]('[%s][members][cdr]',_0x40788c['uniqueid']),_0x40788c);if(_0x40788c[_0x78ca('0x6')]){var _0xcab354=_0x40788c['channel'][_0x78ca('0x12')]('-')[0x0];if(!_['isNil'](members[_0xcab354])){members[_0xcab354]=_[_0x78ca('0x2b')](members[_0xcab354],{'data1':members[_0xcab354]['data1']||_0x40788c[_0x78ca('0x9')],'data2':members[_0xcab354][_0x78ca('0x7')]||_0x40788c[_0x78ca('0x2d')],'data3':members[_0xcab354][_0x78ca('0x2e')]||_0x40788c['destination'],'uniqueid':members[_0xcab354][_0x78ca('0x5')]||_0x40788c[_0x78ca('0x5')]});utils['info'](util[_0x78ca('0x3')](_0x78ca('0x2f'),_0x40788c['uniqueid'],members[_0xcab354][_0x78ca('0x30')],members[_0xcab354][_0x78ca('0x7')],members[_0xcab354][_0x78ca('0x2e')]));if(members[_0xcab354]['exitAt']){writeDB(members[_0xcab354]);}}}if(_0x40788c[_0x78ca('0x31')]){var _0x37da83=_0x40788c[_0x78ca('0x31')][_0x78ca('0x12')]('-')[0x0];if(!_[_0x78ca('0x32')](members[_0x37da83])){members[_0x37da83]=_[_0x78ca('0x2b')](members[_0x37da83],{'data1':members[_0x37da83][_0x78ca('0x30')]||_0x40788c[_0x78ca('0x9')],'data2':members[_0x37da83][_0x78ca('0x7')]||_0x40788c['source'],'data3':members[_0x37da83]['data3']||_0x40788c['destination'],'uniqueid':members[_0x37da83][_0x78ca('0x5')]||_0x40788c['uniqueid']});utils[_0x78ca('0x2')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x40788c[_0x78ca('0x5')],members[_0x37da83][_0x78ca('0x30')],members[_0x37da83][_0x78ca('0x7')],members[_0x37da83][_0x78ca('0x2e')]));if(members[_0x37da83][_0x78ca('0x33')]){writeDB(members[_0x37da83]);}}}}catch(_0x564af4){utils[_0x78ca('0x14')](util[_0x78ca('0x3')](_0x78ca('0x34'),_0x40788c[_0x78ca('0x5')]),_0x564af4);}};
\ No newline at end of file
+var _0x1acc=['assign','data1','type','source','data3','destination','data2','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','membername','getUserByInterface','then','internal','request','getUserByName','split','name','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','[%s][members][devicestatechange]','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','device','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','agentcomplete','debug','queue','cdr','[%s][members][cdr]','channel'];(function(_0x535f00,_0x4a958f){var _0x1f0026=function(_0x3bc568){while(--_0x3bc568){_0x535f00['push'](_0x535f00['shift']());}};_0x1f0026(++_0x4a958f);}(_0x1acc,0x15f));var _0xc1ac=function(_0xc35c14,_0x4663cd){_0xc35c14=_0xc35c14-0x0;var _0x3a853e=_0x1acc[_0xc35c14];return _0x3a853e;};'use strict';var _=require('lodash');var util=require(_0xc1ac('0x0'));var utils=require('./utils');var members={};var exclude=[_0xc1ac('0x1'),_0xc1ac('0x2')];function writeDB(_0x4d1eb5){utils[_0xc1ac('0x3')](util[_0xc1ac('0x4')](_0xc1ac('0x5'),_0x4d1eb5['uniqueid'],_0x4d1eb5[_0xc1ac('0x6')],_0x4d1eb5['channel'],_0x4d1eb5['data2'],_0x4d1eb5[_0xc1ac('0x7')],_0x4d1eb5['type']));if(_0x4d1eb5[_0xc1ac('0x6')]){utils[_0xc1ac('0x8')](_0x4d1eb5[_0xc1ac('0x6')])[_0xc1ac('0x9')](function(_0x336d32){if(_0x336d32){_0x4d1eb5['membername']=_0x336d32['name'];_0x4d1eb5[_0xc1ac('0xa')]=_0x336d32[_0xc1ac('0xa')];utils[_0xc1ac('0xb')]('CreateMemberReport',_0x4d1eb5);}else{utils[_0xc1ac('0xc')](_0x4d1eb5[_0xc1ac('0x6')][_0xc1ac('0xd')]('/')[0x1])[_0xc1ac('0x9')](function(_0x14167c){if(_0x14167c){_0x4d1eb5[_0xc1ac('0x7')]=_0x14167c[_0xc1ac('0xe')];_0x4d1eb5[_0xc1ac('0xa')]=_0x14167c[_0xc1ac('0xa')];utils[_0xc1ac('0xb')](_0xc1ac('0xf'),_0x4d1eb5);}});}})[_0xc1ac('0x10')](function(_0x501a08){utils[_0xc1ac('0x11')](util[_0xc1ac('0x4')](_0xc1ac('0x12'),_0x4d1eb5[_0xc1ac('0x13')]),_0x501a08);});}delete members[_0x4d1eb5['interface']];}function startsWith(_0x27f2c7,_0x138019){return _[_0xc1ac('0x14')](_0x27f2c7,function(_0x2b51c6){return _[_0xc1ac('0x15')](_0x138019,_0x2b51c6);});}exports['devicestatechange']=function(_0x34f75a){try{utils['debug'](util[_0xc1ac('0x4')](_0xc1ac('0x16'),members[_0x34f75a['device']]?members[_0x34f75a['device']][_0xc1ac('0x13')]:_0x34f75a['device']),_0x34f75a);utils[_0xc1ac('0x3')](util[_0xc1ac('0x4')](_0xc1ac('0x17'),members[_0x34f75a[_0xc1ac('0x18')]]?members[_0x34f75a[_0xc1ac('0x18')]]['uniqueid']:_0x34f75a[_0xc1ac('0x18')],_0x34f75a[_0xc1ac('0x19')],_0x34f75a[_0xc1ac('0x18')]));switch(_0x34f75a[_0xc1ac('0x19')]){case _0xc1ac('0x1a'):case _0xc1ac('0x1b'):if(!startsWith(exclude,_0x34f75a[_0xc1ac('0x18')])){members[_0x34f75a[_0xc1ac('0x18')]]={'channel':_0xc1ac('0x1c'),'interface':_0x34f75a[_0xc1ac('0x18')],'type':_0xc1ac('0x1d'),'enterAt':utils[_0xc1ac('0x1e')](),'role':'agent'};}break;case _0xc1ac('0x1f'):if(!_[_0xc1ac('0x20')](members[_0x34f75a['device']])){members[_0x34f75a['device']][_0xc1ac('0x21')]=utils[_0xc1ac('0x1e')]();members[_0x34f75a[_0xc1ac('0x18')]][_0xc1ac('0x22')]=utils['diffTime'](members[_0x34f75a[_0xc1ac('0x18')]][_0xc1ac('0x21')],members[_0x34f75a[_0xc1ac('0x18')]]['enterAt']);if(members[_0x34f75a[_0xc1ac('0x18')]][_0xc1ac('0x13')]){writeDB(members[_0x34f75a[_0xc1ac('0x18')]]);}}break;default:break;}}catch(_0x323568){utils[_0xc1ac('0x11')](util[_0xc1ac('0x4')](_0xc1ac('0x16'),members[_0x34f75a['device']]?members[_0x34f75a['device']][_0xc1ac('0x13')]:_0x34f75a[_0xc1ac('0x18')]),_0x323568);}};exports[_0xc1ac('0x23')]=function(_0x39e1ea){try{if(!_[_0xc1ac('0x20')](members[_0x39e1ea[_0xc1ac('0x6')]])){utils[_0xc1ac('0x24')](util[_0xc1ac('0x4')]('[%s][members][agentcomplete]',_0x39e1ea[_0xc1ac('0x13')]),_0x39e1ea);utils[_0xc1ac('0x3')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x39e1ea['uniqueid'],_0x39e1ea[_0xc1ac('0x6')],_0x39e1ea[_0xc1ac('0x25')]));members[_0x39e1ea[_0xc1ac('0x6')]]=_['assign'](members[_0x39e1ea['interface']],{'data4':_0x39e1ea['queue'],'uniqueid':_0x39e1ea[_0xc1ac('0x13')]});}}catch(_0x1e522f){utils['error'](util[_0xc1ac('0x4')]('[%s][members][agentcomplete]',_0x39e1ea[_0xc1ac('0x13')]),_0x1e522f);}};exports[_0xc1ac('0x26')]=function(_0x54302e){try{utils['debug'](util[_0xc1ac('0x4')](_0xc1ac('0x27'),_0x54302e[_0xc1ac('0x13')]),_0x54302e);if(_0x54302e[_0xc1ac('0x28')]){var _0x5ce7ea=_0x54302e['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x5ce7ea])){members[_0x5ce7ea]=_[_0xc1ac('0x29')](members[_0x5ce7ea],{'data1':members[_0x5ce7ea][_0xc1ac('0x2a')]||_0x54302e[_0xc1ac('0x2b')],'data2':members[_0x5ce7ea]['data2']||_0x54302e[_0xc1ac('0x2c')],'data3':members[_0x5ce7ea][_0xc1ac('0x2d')]||_0x54302e[_0xc1ac('0x2e')],'uniqueid':members[_0x5ce7ea][_0xc1ac('0x13')]||_0x54302e[_0xc1ac('0x13')]});utils['info'](util[_0xc1ac('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x54302e[_0xc1ac('0x13')],members[_0x5ce7ea][_0xc1ac('0x2a')],members[_0x5ce7ea][_0xc1ac('0x2f')],members[_0x5ce7ea]['data3']));if(members[_0x5ce7ea][_0xc1ac('0x21')]){writeDB(members[_0x5ce7ea]);}}}if(_0x54302e['destinationchannel']){var _0x110637=_0x54302e['destinationchannel']['split']('-')[0x0];if(!_[_0xc1ac('0x20')](members[_0x110637])){members[_0x110637]=_[_0xc1ac('0x29')](members[_0x110637],{'data1':members[_0x110637][_0xc1ac('0x2a')]||_0x54302e['type'],'data2':members[_0x110637][_0xc1ac('0x2f')]||_0x54302e[_0xc1ac('0x2c')],'data3':members[_0x110637][_0xc1ac('0x2d')]||_0x54302e[_0xc1ac('0x2e')],'uniqueid':members[_0x110637][_0xc1ac('0x13')]||_0x54302e[_0xc1ac('0x13')]});utils['info'](util[_0xc1ac('0x4')](_0xc1ac('0x30'),_0x54302e[_0xc1ac('0x13')],members[_0x110637][_0xc1ac('0x2a')],members[_0x110637][_0xc1ac('0x2f')],members[_0x110637][_0xc1ac('0x2d')]));if(members[_0x110637][_0xc1ac('0x21')]){writeDB(members[_0x110637]);}}}}catch(_0x9f9e19){utils[_0xc1ac('0x11')](util[_0xc1ac('0x4')]('[%s][members][cdr]',_0x54302e[_0xc1ac('0x13')]),_0x9f9e19);}};
\ No newline at end of file
index 9fad5e3..2b4663a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc198=['blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%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]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','position','assign','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','accountcode','membername','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s'];(function(_0x4cf19f,_0x4e3c2b){var _0xd7eaf6=function(_0x1a0199){while(--_0x1a0199){_0x4cf19f['push'](_0x4cf19f['shift']());}};_0xd7eaf6(++_0x4e3c2b);}(_0xc198,0x1c7));var _0x8c19=function(_0x38c77b,_0x31f931){_0x38c77b=_0x38c77b-0x0;var _0xaa6b27=_0xc198[_0x38c77b];return _0xaa6b27;};'use strict';var _=require(_0x8c19('0x0'));var util=require('util');var utils=require(_0x8c19('0x1'));var queues={};function writeDB(_0x51fcca){utils[_0x8c19('0x2')](util['format'](_0x8c19('0x3'),_0x51fcca[_0x8c19('0x4')],_0x51fcca[_0x8c19('0x5')],_0x51fcca[_0x8c19('0x6')],_0x51fcca[_0x8c19('0x7')],_0x51fcca[_0x8c19('0x8')],_0x51fcca['accountcode'],_0x51fcca[_0x8c19('0x9')]));if(_0x51fcca['queue']){utils['getVoiceQueueByName'](_0x51fcca[_0x8c19('0x6')])[_0x8c19('0xa')](function(_0x3748a0){if(_0x3748a0){_0x51fcca[_0x8c19('0xb')]=_0x3748a0[_0x8c19('0xb')];}utils['request'](_0x8c19('0xc'),_0x51fcca);});}else{utils[_0x8c19('0xd')](_0x8c19('0xc'),_0x51fcca);}if(_0x51fcca[_0x8c19('0xe')]){delete queues[_0x51fcca['transfereduniqueid']];}else{delete queues[_0x51fcca['uniqueid']];}}exports[_0x8c19('0xf')]=function(_0x1ae798){try{utils[_0x8c19('0x10')](util['format'](_0x8c19('0x11'),_0x1ae798[_0x8c19('0x4')]),_0x1ae798);utils['info'](util[_0x8c19('0x12')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x1ae798[_0x8c19('0x4')],_0x1ae798['queue'],_0x1ae798[_0x8c19('0x13')]));queues[_0x1ae798[_0x8c19('0x4')]]=_[_0x8c19('0x14')](_0x1ae798,{'originalposition':_0x1ae798[_0x8c19('0x13')],'queuecallerjoinAt':utils[_0x8c19('0x15')](),'mohtime':0x0});}catch(_0x3ce157){utils['error'](util[_0x8c19('0x12')](_0x8c19('0x11'),_0x1ae798[_0x8c19('0x4')]),_0x3ce157);}};exports[_0x8c19('0x16')]=function(_0x1c51ea){try{if(!_[_0x8c19('0x17')](queues[_0x1c51ea[_0x8c19('0x4')]])){utils[_0x8c19('0x10')](util['format']('[%s][queues][hangup]',_0x1c51ea[_0x8c19('0x4')]),_0x1c51ea);if(queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0x18')]){if(!queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0x19')]&&!queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0x1a')]){queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0x1b')]=!![];queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0x1c')]=utils[_0x8c19('0x15')]();queues[_0x1c51ea[_0x8c19('0x4')]]['queuecallerexitreason']=_0x8c19('0x1d');}utils[_0x8c19('0x2')](util[_0x8c19('0x12')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x1c51ea[_0x8c19('0x4')],queues[_0x1c51ea['uniqueid']][_0x8c19('0x1e')],queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0x9')]));writeDB(queues[_0x1c51ea['uniqueid']]);}else if(queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0xe')]){utils[_0x8c19('0x2')](util[_0x8c19('0x12')](_0x8c19('0x1f'),_0x1c51ea['uniqueid'],queues[_0x1c51ea['uniqueid']]['name'],queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0xe')]));queues[queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0xe')]]=queues[_0x1c51ea[_0x8c19('0x4')]];queues[queues[_0x1c51ea[_0x8c19('0x4')]][_0x8c19('0xe')]][_0x8c19('0x20')]=0x2;delete queues[_0x1c51ea[_0x8c19('0x4')]];}}}catch(_0x1542ee){utils[_0x8c19('0x21')](util[_0x8c19('0x12')](_0x8c19('0x22'),_0x1c51ea[_0x8c19('0x4')]),_0x1542ee);}};exports[_0x8c19('0x23')]=function(_0x41918c){try{utils[_0x8c19('0x10')](util['format'](_0x8c19('0x24'),_0x41918c['uniqueid']),_0x41918c);if(!_[_0x8c19('0x17')](_0x41918c[_0x8c19('0x25')]['queuestatus'])&&_0x41918c['value'][_0x8c19('0x26')]()!==_0x8c19('0x27')){if(!_['isNil'](queues[_0x41918c[_0x8c19('0x4')]])){queues[_0x41918c[_0x8c19('0x4')]]['queuecallerabandon']=![];queues[_0x41918c[_0x8c19('0x4')]][_0x8c19('0x28')]=null;queues[_0x41918c[_0x8c19('0x4')]][_0x8c19('0x1a')]=!![];queues[_0x41918c['uniqueid']][_0x8c19('0x29')]=utils[_0x8c19('0x15')]();queues[_0x41918c['uniqueid']][_0x8c19('0x9')]=_0x41918c[_0x8c19('0x2a')][_0x8c19('0x26')]();utils['info'](util[_0x8c19('0x12')](_0x8c19('0x2b'),_0x41918c[_0x8c19('0x4')],queues[_0x41918c[_0x8c19('0x4')]][_0x8c19('0x1e')],_0x41918c[_0x8c19('0x2a')],queues[_0x41918c['uniqueid']][_0x8c19('0x9')]));writeDB(queues[_0x41918c['uniqueid']]);}}else if(!_[_0x8c19('0x17')](_0x41918c[_0x8c19('0x25')][_0x8c19('0x2c')])){if(!_[_0x8c19('0x17')](queues[_0x41918c[_0x8c19('0x4')]])&&!queues[_0x41918c[_0x8c19('0x4')]][_0x8c19('0x19')]){queues[_0x41918c['uniqueid']][_0x8c19('0x19')]=![];queues[_0x41918c[_0x8c19('0x4')]][_0x8c19('0x28')]=null;queues[_0x41918c['uniqueid']][_0x8c19('0x1a')]=!![];queues[_0x41918c['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x41918c[_0x8c19('0x4')]]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util[_0x8c19('0x12')](_0x8c19('0x2d'),_0x41918c['uniqueid'],queues[_0x41918c[_0x8c19('0x4')]][_0x8c19('0x1e')],_0x41918c[_0x8c19('0x2a')],queues[_0x41918c[_0x8c19('0x4')]][_0x8c19('0x9')]));}}}catch(_0xa4d71e){utils['error'](util[_0x8c19('0x12')](_0x8c19('0x24'),_0x41918c[_0x8c19('0x4')]),_0xa4d71e);}};exports[_0x8c19('0x19')]=function(_0x14eefe){try{if(!_[_0x8c19('0x17')](queues[_0x14eefe['uniqueid']])){utils[_0x8c19('0x10')](util[_0x8c19('0x12')](_0x8c19('0x2e'),_0x14eefe[_0x8c19('0x4')]),_0x14eefe);queues[_0x14eefe['uniqueid']][_0x8c19('0x1a')]=![];queues[_0x14eefe[_0x8c19('0x4')]][_0x8c19('0x29')]=null;queues[_0x14eefe[_0x8c19('0x4')]]['queuecallerabandon']=!![];queues[_0x14eefe[_0x8c19('0x4')]][_0x8c19('0x28')]=utils['now']();queues[_0x14eefe[_0x8c19('0x4')]][_0x8c19('0x9')]=_0x8c19('0x2f');utils[_0x8c19('0x2')](util[_0x8c19('0x12')](_0x8c19('0x30'),_0x14eefe[_0x8c19('0x4')],queues[_0x14eefe[_0x8c19('0x4')]][_0x8c19('0x1e')],queues[_0x14eefe[_0x8c19('0x4')]][_0x8c19('0x9')]));}}catch(_0x250f68){utils[_0x8c19('0x21')](util['format']('[%s][queues][queuecallerabandon]',_0x14eefe[_0x8c19('0x4')]),_0x250f68);}};exports[_0x8c19('0x31')]=function(_0x12c810){try{if(!_['isNil'](queues[_0x12c810[_0x8c19('0x4')]])){utils[_0x8c19('0x10')](util[_0x8c19('0x12')](_0x8c19('0x32'),_0x12c810['uniqueid']),_0x12c810);utils[_0x8c19('0x2')](util[_0x8c19('0x12')](_0x8c19('0x33'),_0x12c810[_0x8c19('0x4')],queues[_0x12c810[_0x8c19('0x4')]][_0x8c19('0x1e')],_0x12c810['connectedlinenum'],_0x12c810[_0x8c19('0x34')]));queues[_0x12c810['uniqueid']][_0x8c19('0x31')]=!![];queues[_0x12c810['uniqueid']][_0x8c19('0x18')]=utils[_0x8c19('0x15')]();queues[_0x12c810[_0x8c19('0x4')]][_0x8c19('0x35')]=utils['diffTime'](queues[_0x12c810[_0x8c19('0x4')]][_0x8c19('0x18')],queues[_0x12c810[_0x8c19('0x4')]][_0x8c19('0x36')]);queues[_0x12c810[_0x8c19('0x4')]][_0x8c19('0x13')]=_0x12c810['position'];queues[_0x12c810['uniqueid']]['count']=_0x12c810[_0x8c19('0x37')];queues[_0x12c810[_0x8c19('0x4')]][_0x8c19('0x38')]=_0x12c810[_0x8c19('0x38')];queues[_0x12c810['uniqueid']]['connectedlinename']=_0x12c810['connectedlinename'];}}catch(_0x169d93){utils[_0x8c19('0x21')](util[_0x8c19('0x12')](_0x8c19('0x32'),_0x12c810[_0x8c19('0x4')]),_0x169d93);}};exports[_0x8c19('0x39')]=function(_0x47a0f4){try{if(!_[_0x8c19('0x17')](queues[_0x47a0f4[_0x8c19('0x4')]])){utils[_0x8c19('0x10')](util['format'](_0x8c19('0x3a'),_0x47a0f4[_0x8c19('0x4')]),_0x47a0f4);utils[_0x8c19('0x2')](util['format'](_0x8c19('0x3b'),_0x47a0f4[_0x8c19('0x4')],queues[_0x47a0f4[_0x8c19('0x4')]][_0x8c19('0x1e')],_0x47a0f4['membername'],_0x47a0f4[_0x8c19('0x3c')]));queues[_0x47a0f4[_0x8c19('0x4')]][_0x8c19('0x19')]=![];queues[_0x47a0f4[_0x8c19('0x4')]][_0x8c19('0x19')]=![];queues[_0x47a0f4['uniqueid']][_0x8c19('0x28')]=null;queues[_0x47a0f4[_0x8c19('0x4')]][_0x8c19('0x1a')]=![];queues[_0x47a0f4[_0x8c19('0x4')]]['queuecallerexitreason']=null;queues[_0x47a0f4['uniqueid']][_0x8c19('0x29')]=null;queues[_0x47a0f4['uniqueid']][_0x8c19('0x3d')]=!![];queues[_0x47a0f4[_0x8c19('0x4')]][_0x8c19('0x3e')]=_0x47a0f4[_0x8c19('0x3c')];queues[_0x47a0f4[_0x8c19('0x4')]][_0x8c19('0x7')]=_0x47a0f4[_0x8c19('0x3f')];}}catch(_0x482b20){utils['error'](util['format'](_0x8c19('0x3a'),_0x47a0f4[_0x8c19('0x4')]),_0x482b20);}};exports['agentcomplete']=function(_0x3581db){try{if(!_[_0x8c19('0x17')](queues[_0x3581db[_0x8c19('0x4')]])){if(queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x18')]){utils['debug'](util[_0x8c19('0x12')](_0x8c19('0x40'),_0x3581db['uniqueid']),_0x3581db);queues[_0x3581db[_0x8c19('0x4')]]['queuecallerabandon']=![];queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x19')]=![];queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x28')]=null;queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x1a')]=![];queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x29')]=null;queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x3d')]=!![];queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x7')]=_0x3581db[_0x8c19('0x3f')];queues[_0x3581db['uniqueid']]['queuecallercomplete']=!![];queues[_0x3581db[_0x8c19('0x4')]]['queuecallercompleteAt']=utils['now']();if(_0x3581db[_0x8c19('0x41')]==_0x8c19('0x42')){if(!queues[_0x3581db['uniqueid']][_0x8c19('0x42')]){queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x9')]=_0x8c19('0x43');}}else{queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x9')]=_0x8c19('0x44')+_0x3581db[_0x8c19('0x41')]['toUpperCase']();}utils[_0x8c19('0x2')](util[_0x8c19('0x12')](_0x8c19('0x45'),_0x3581db[_0x8c19('0x4')],queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x1e')],_0x3581db['membername'],queues[_0x3581db[_0x8c19('0x4')]][_0x8c19('0x9')]));writeDB(queues[_0x3581db[_0x8c19('0x4')]]);}}}catch(_0x386f44){utils[_0x8c19('0x21')](util[_0x8c19('0x12')](_0x8c19('0x40'),_0x3581db[_0x8c19('0x4')]),_0x386f44);}};exports[_0x8c19('0x46')]=function(_0x54310f){try{if(!_[_0x8c19('0x17')](queues[_0x54310f[_0x8c19('0x47')]])){utils[_0x8c19('0x10')](util[_0x8c19('0x12')](_0x8c19('0x48'),_0x54310f[_0x8c19('0x4')]),_0x54310f);queues[_0x54310f['transfereeuniqueid']]['transfer']=!![];queues[_0x54310f[_0x8c19('0x47')]][_0x8c19('0x49')]='BLIND';queues[_0x54310f[_0x8c19('0x47')]][_0x8c19('0x4a')]=_0x54310f[_0x8c19('0x4b')];queues[_0x54310f[_0x8c19('0x47')]][_0x8c19('0x4c')]=_0x54310f['transfereeuniqueid'];queues[_0x54310f['transfereeuniqueid']][_0x8c19('0x9')]=_0x8c19('0x4d');utils['info'](util[_0x8c19('0x12')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x54310f[_0x8c19('0x4')],queues[_0x54310f[_0x8c19('0x47')]][_0x8c19('0x1e')],_0x54310f[_0x8c19('0x47')],_0x54310f['extension']));}}catch(_0xc3ed0e){utils[_0x8c19('0x21')](util[_0x8c19('0x12')](_0x8c19('0x48'),_0x54310f[_0x8c19('0x4')]),_0xc3ed0e);}};exports['attendedtransfer']=function(_0x3fcb28){try{utils[_0x8c19('0x10')](util[_0x8c19('0x12')](_0x8c19('0x4e'),_0x3fcb28['origtransfereruniqueid']),_0x3fcb28);if(_0x3fcb28[_0x8c19('0x4f')]==_0x3fcb28[_0x8c19('0x50')]){if(!_['isNil'](queues[_0x3fcb28['secondtransfererlinkedid']])){utils['info'](util[_0x8c19('0x12')](_0x8c19('0x51'),_0x3fcb28['origtransfereruniqueid'],queues[_0x3fcb28['secondtransfererlinkedid']][_0x8c19('0x1e')],_0x3fcb28[_0x8c19('0x52')]));queues[_0x3fcb28['secondtransfererlinkedid']][_0x8c19('0x42')]=!![];queues[_0x3fcb28[_0x8c19('0x53')]][_0x8c19('0x49')]=_0x8c19('0x54');queues[_0x3fcb28['secondtransfererlinkedid']][_0x8c19('0x4a')]=_0x3fcb28[_0x8c19('0x52')];queues[_0x3fcb28['secondtransfererlinkedid']][_0x8c19('0x4c')]=_0x3fcb28[_0x8c19('0x4f')];queues[_0x3fcb28[_0x8c19('0x53')]][_0x8c19('0x9')]=_0x8c19('0x55');}if(!_[_0x8c19('0x17')](queues[_0x3fcb28[_0x8c19('0x50')]])){if(_0x3fcb28[_0x8c19('0x56')]&&queues[_0x3fcb28['transfereelinkedid']]){queues[_0x3fcb28[_0x8c19('0x56')]][_0x8c19('0x20')]=0x1;queues[_0x3fcb28[_0x8c19('0x47')]]=_[_0x8c19('0x57')](queues[_0x3fcb28[_0x8c19('0x56')]]);queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0xe')]=_0x3fcb28[_0x8c19('0x58')];queues[_0x3fcb28['transfereeuniqueid']][_0x8c19('0x20')]=0x2;queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0x8')]=queues[_0x3fcb28[_0x8c19('0x53')]][_0x8c19('0x8')];queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0x59')]=queues[_0x3fcb28[_0x8c19('0x53')]][_0x8c19('0x59')];queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0x36')]=utils['now']();queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0x18')]=utils[_0x8c19('0x15')]();queues[_0x3fcb28['transfereeuniqueid']][_0x8c19('0x35')]=0x0;queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0x5a')]=0x0;utils[_0x8c19('0x2')](util[_0x8c19('0x12')](_0x8c19('0x5b'),_0x3fcb28['origtransfereruniqueid'],queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0x1e')],queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0x8')],queues[_0x3fcb28[_0x8c19('0x47')]][_0x8c19('0x59')]));}else{utils['info'](util['format'](_0x8c19('0x5c'),_0x3fcb28[_0x8c19('0x4f')],queues[_0x3fcb28[_0x8c19('0x50')]][_0x8c19('0x1e')],_0x3fcb28[_0x8c19('0x53')]));queues[_0x3fcb28[_0x8c19('0x50')]][_0x8c19('0xe')]=_0x3fcb28['secondtransfererlinkedid'];}}}else if(_0x3fcb28[_0x8c19('0x5d')]==_0x3fcb28[_0x8c19('0x53')]){if(!_[_0x8c19('0x17')](queues[_0x3fcb28['origtransfererlinkedid']])){utils[_0x8c19('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3fcb28[_0x8c19('0x4f')],queues[_0x3fcb28['origtransfererlinkedid']][_0x8c19('0x1e')],_0x3fcb28[_0x8c19('0x5d')],_0x3fcb28[_0x8c19('0x5e')]));queues[_0x3fcb28['origtransfererlinkedid']][_0x8c19('0x42')]=!![];queues[_0x3fcb28[_0x8c19('0x50')]][_0x8c19('0x49')]='ATTENDED';queues[_0x3fcb28[_0x8c19('0x50')]][_0x8c19('0x4a')]=_0x3fcb28[_0x8c19('0x5e')];queues[_0x3fcb28[_0x8c19('0x50')]][_0x8c19('0x4c')]=_0x3fcb28[_0x8c19('0x5d')];queues[_0x3fcb28['origtransfererlinkedid']][_0x8c19('0x9')]=_0x8c19('0x55');}if(!_[_0x8c19('0x17')](queues[_0x3fcb28['secondtransfererlinkedid']])){if(_0x3fcb28[_0x8c19('0x5f')]&&queues[_0x3fcb28['transfertargetlinkedid']]){queues[_0x3fcb28[_0x8c19('0x5f')]][_0x8c19('0x20')]=0x1;queues[_0x3fcb28['transfertargetuniqueid']]=_[_0x8c19('0x57')](queues[_0x3fcb28[_0x8c19('0x5f')]]);queues[_0x3fcb28[_0x8c19('0x58')]][_0x8c19('0xe')]=_0x3fcb28['transfertargetuniqueid'];queues[_0x3fcb28[_0x8c19('0x58')]][_0x8c19('0x20')]=0x2;queues[_0x3fcb28[_0x8c19('0x58')]][_0x8c19('0x8')]=queues[_0x3fcb28[_0x8c19('0x50')]][_0x8c19('0x8')];queues[_0x3fcb28[_0x8c19('0x58')]]['calleridname']=queues[_0x3fcb28[_0x8c19('0x50')]][_0x8c19('0x59')];queues[_0x3fcb28[_0x8c19('0x58')]][_0x8c19('0x36')]=utils['now']();queues[_0x3fcb28[_0x8c19('0x58')]]['queuecallerleaveAt']=utils[_0x8c19('0x15')]();queues[_0x3fcb28[_0x8c19('0x58')]]['holdtime']=0x0;queues[_0x3fcb28[_0x8c19('0x58')]][_0x8c19('0x5a')]=0x0;utils[_0x8c19('0x2')](util[_0x8c19('0x12')](_0x8c19('0x60'),_0x3fcb28[_0x8c19('0x4f')],queues[_0x3fcb28[_0x8c19('0x58')]]['name'],queues[_0x3fcb28[_0x8c19('0x58')]]['transfereduniqueid'],queues[_0x3fcb28[_0x8c19('0x58')]]['calleridnum'],queues[_0x3fcb28[_0x8c19('0x58')]]['calleridname']));}else{utils[_0x8c19('0x2')](util[_0x8c19('0x12')](_0x8c19('0x5c'),_0x3fcb28[_0x8c19('0x4f')],queues[_0x3fcb28[_0x8c19('0x53')]][_0x8c19('0x1e')],_0x3fcb28[_0x8c19('0x50')]));queues[_0x3fcb28[_0x8c19('0x53')]][_0x8c19('0xe')]=_0x3fcb28['origtransfererlinkedid'];}}}}catch(_0x216454){utils[_0x8c19('0x21')](util['format'](_0x8c19('0x4e'),_0x3fcb28['origtransfereruniqueid']),_0x216454);}};exports[_0x8c19('0x61')]=function(_0xf1f57b){try{if(!_[_0x8c19('0x17')](queues[_0xf1f57b['uniqueid']])){utils[_0x8c19('0x10')](util[_0x8c19('0x12')](_0x8c19('0x62'),_0xf1f57b[_0x8c19('0x4')]),_0xf1f57b);queues[_0xf1f57b[_0x8c19('0x4')]][_0x8c19('0x63')]=utils[_0x8c19('0x15')]();utils[_0x8c19('0x2')](util[_0x8c19('0x12')](_0x8c19('0x64'),_0xf1f57b[_0x8c19('0x4')],queues[_0xf1f57b['uniqueid']]['name'],queues[_0xf1f57b['uniqueid']]['musiconholdstartAt']));}}catch(_0x56141d){utils['error'](util[_0x8c19('0x12')](_0x8c19('0x62'),_0xf1f57b[_0x8c19('0x4')]),_0x56141d);}};exports[_0x8c19('0x65')]=function(_0x4835d9){try{if(!_['isNil'](queues[_0x4835d9['uniqueid']])){if(!_[_0x8c19('0x17')](queues[_0x4835d9[_0x8c19('0x4')]]['musiconholdstartAt'])){utils[_0x8c19('0x10')](util[_0x8c19('0x12')](_0x8c19('0x66'),_0x4835d9[_0x8c19('0x4')]),_0x4835d9);queues[_0x4835d9[_0x8c19('0x4')]][_0x8c19('0x5a')]+=utils[_0x8c19('0x67')](utils['now'](),queues[_0x4835d9[_0x8c19('0x4')]][_0x8c19('0x63')]);utils['info'](util[_0x8c19('0x12')](_0x8c19('0x68'),_0x4835d9[_0x8c19('0x4')],queues[_0x4835d9['uniqueid']]['name'],queues[_0x4835d9[_0x8c19('0x4')]][_0x8c19('0x5a')]));delete queues[_0x4835d9[_0x8c19('0x4')]]['musiconholdstartAt'];}}}catch(_0x4a7c65){utils['error'](util[_0x8c19('0x12')]('[%s][queues][musiconholdstop]',_0x4835d9['uniqueid']),_0x4a7c65);}};
\ No newline at end of file
+var _0x80c7=['transferuniqueid','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','uniqueid','queue','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','hangup','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','varset','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','now','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','lastAssignedTo','membername','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten'];(function(_0x9b70aa,_0x2c4cee){var _0x18d9eb=function(_0x198415){while(--_0x198415){_0x9b70aa['push'](_0x9b70aa['shift']());}};_0x18d9eb(++_0x2c4cee);}(_0x80c7,0x83));var _0x780c=function(_0x1c029f,_0x351f4d){_0x1c029f=_0x1c029f-0x0;var _0x554863=_0x80c7[_0x1c029f];return _0x554863;};'use strict';var _=require(_0x780c('0x0'));var util=require('util');var utils=require(_0x780c('0x1'));var queues={};function writeDB(_0x352c94){utils[_0x780c('0x2')](util[_0x780c('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x352c94[_0x780c('0x4')],_0x352c94['channel'],_0x352c94[_0x780c('0x5')],_0x352c94['lastAssignedTo'],_0x352c94['calleridnum'],_0x352c94[_0x780c('0x6')],_0x352c94[_0x780c('0x7')]));if(_0x352c94[_0x780c('0x5')]){utils[_0x780c('0x8')](_0x352c94[_0x780c('0x5')])[_0x780c('0x9')](function(_0x96d8bc){if(_0x96d8bc){_0x352c94[_0x780c('0xa')]=_0x96d8bc[_0x780c('0xa')];}utils[_0x780c('0xb')](_0x780c('0xc'),_0x352c94);});}else{utils['request']('CreateVoiceQueueReport',_0x352c94);}if(_0x352c94[_0x780c('0xd')]){delete queues[_0x352c94[_0x780c('0xd')]];}else{delete queues[_0x352c94[_0x780c('0x4')]];}}exports[_0x780c('0xe')]=function(_0x543fd8){try{utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x10'),_0x543fd8[_0x780c('0x4')]),_0x543fd8);utils['info'](util[_0x780c('0x3')](_0x780c('0x11'),_0x543fd8[_0x780c('0x4')],_0x543fd8[_0x780c('0x5')],_0x543fd8['position']));queues[_0x543fd8[_0x780c('0x4')]]=_[_0x780c('0x12')](_0x543fd8,{'originalposition':_0x543fd8[_0x780c('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x562d26){utils['error'](util[_0x780c('0x3')]('[%s][queues][queuecallerjoin]',_0x543fd8[_0x780c('0x4')]),_0x562d26);}};exports[_0x780c('0x14')]=function(_0x199806){try{if(!_['isNil'](queues[_0x199806[_0x780c('0x4')]])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x15'),_0x199806[_0x780c('0x4')]),_0x199806);if(queues[_0x199806['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x199806[_0x780c('0x4')]][_0x780c('0x16')]&&!queues[_0x199806[_0x780c('0x4')]][_0x780c('0x17')]){queues[_0x199806[_0x780c('0x4')]][_0x780c('0x18')]=!![];queues[_0x199806['uniqueid']][_0x780c('0x19')]=utils['now']();queues[_0x199806[_0x780c('0x4')]][_0x780c('0x7')]=_0x780c('0x1a');}utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x1b'),_0x199806[_0x780c('0x4')],queues[_0x199806[_0x780c('0x4')]]['name'],queues[_0x199806[_0x780c('0x4')]][_0x780c('0x7')]));writeDB(queues[_0x199806['uniqueid']]);}else if(queues[_0x199806[_0x780c('0x4')]][_0x780c('0xd')]){utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x1c'),_0x199806[_0x780c('0x4')],queues[_0x199806[_0x780c('0x4')]][_0x780c('0x1d')],queues[_0x199806[_0x780c('0x4')]][_0x780c('0xd')]));queues[queues[_0x199806[_0x780c('0x4')]][_0x780c('0xd')]]=queues[_0x199806[_0x780c('0x4')]];queues[queues[_0x199806[_0x780c('0x4')]][_0x780c('0xd')]][_0x780c('0x1e')]=0x2;delete queues[_0x199806[_0x780c('0x4')]];}}}catch(_0x3e77bc){utils[_0x780c('0x1f')](util['format'](_0x780c('0x15'),_0x199806[_0x780c('0x4')]),_0x3e77bc);}};exports[_0x780c('0x20')]=function(_0x4b716e){try{utils[_0x780c('0xf')](util['format']('[%s][queues][varset]',_0x4b716e['uniqueid']),_0x4b716e);if(!_[_0x780c('0x21')](_0x4b716e[_0x780c('0x22')][_0x780c('0x23')])&&_0x4b716e[_0x780c('0x24')][_0x780c('0x25')]()!==_0x780c('0x26')){if(!_[_0x780c('0x21')](queues[_0x4b716e[_0x780c('0x4')]])){queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x16')]=![];queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x27')]=null;queues[_0x4b716e['uniqueid']][_0x780c('0x17')]=!![];queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x28')]=utils[_0x780c('0x29')]();queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x7')]=_0x4b716e[_0x780c('0x24')][_0x780c('0x25')]();utils['info'](util['format'](_0x780c('0x2a'),_0x4b716e[_0x780c('0x4')],queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x1d')],_0x4b716e['value'],queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x7')]));writeDB(queues[_0x4b716e[_0x780c('0x4')]]);}}else if(!_[_0x780c('0x21')](_0x4b716e[_0x780c('0x22')][_0x780c('0x2b')])){if(!_[_0x780c('0x21')](queues[_0x4b716e[_0x780c('0x4')]])&&!queues[_0x4b716e['uniqueid']][_0x780c('0x16')]){queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x16')]=![];queues[_0x4b716e['uniqueid']][_0x780c('0x27')]=null;queues[_0x4b716e['uniqueid']][_0x780c('0x17')]=!![];queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x28')]=utils['now']();queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x7')]=_0x780c('0x2c');utils['info'](util[_0x780c('0x3')](_0x780c('0x2d'),_0x4b716e[_0x780c('0x4')],queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x1d')],_0x4b716e[_0x780c('0x24')],queues[_0x4b716e['uniqueid']][_0x780c('0x7')]));}}}catch(_0x292c32){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x2e'),_0x4b716e[_0x780c('0x4')]),_0x292c32);}};exports[_0x780c('0x16')]=function(_0x515ecb){try{if(!_[_0x780c('0x21')](queues[_0x515ecb[_0x780c('0x4')]])){utils[_0x780c('0xf')](util['format'](_0x780c('0x2f'),_0x515ecb[_0x780c('0x4')]),_0x515ecb);queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x17')]=![];queues[_0x515ecb['uniqueid']]['queuecallerexitAt']=null;queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x16')]=!![];queues[_0x515ecb[_0x780c('0x4')]]['queuecallerabandonAt']=utils['now']();queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x7')]=_0x780c('0x30');utils['info'](util[_0x780c('0x3')](_0x780c('0x31'),_0x515ecb[_0x780c('0x4')],queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x1d')],queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x7')]));}}catch(_0x506ac8){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x2f'),_0x515ecb['uniqueid']),_0x506ac8);}};exports[_0x780c('0x32')]=function(_0x449e6d){try{if(!_[_0x780c('0x21')](queues[_0x449e6d[_0x780c('0x4')]])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x33'),_0x449e6d[_0x780c('0x4')]),_0x449e6d);utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x34'),_0x449e6d['uniqueid'],queues[_0x449e6d[_0x780c('0x4')]]['name'],_0x449e6d[_0x780c('0x35')],_0x449e6d[_0x780c('0x36')]));queues[_0x449e6d[_0x780c('0x4')]][_0x780c('0x32')]=!![];queues[_0x449e6d['uniqueid']][_0x780c('0x37')]=utils['now']();queues[_0x449e6d[_0x780c('0x4')]]['holdtime']=utils['diffTime'](queues[_0x449e6d[_0x780c('0x4')]][_0x780c('0x37')],queues[_0x449e6d[_0x780c('0x4')]][_0x780c('0x38')]);queues[_0x449e6d[_0x780c('0x4')]]['position']=_0x449e6d[_0x780c('0x13')];queues[_0x449e6d[_0x780c('0x4')]]['count']=_0x449e6d[_0x780c('0x39')];queues[_0x449e6d['uniqueid']][_0x780c('0x35')]=_0x449e6d[_0x780c('0x35')];queues[_0x449e6d[_0x780c('0x4')]]['connectedlinename']=_0x449e6d[_0x780c('0x36')];}}catch(_0x50f48c){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x33'),_0x449e6d[_0x780c('0x4')]),_0x50f48c);}};exports['agentconnect']=function(_0xed886a){try{if(!_[_0x780c('0x21')](queues[_0xed886a['uniqueid']])){utils['debug'](util[_0x780c('0x3')](_0x780c('0x3a'),_0xed886a[_0x780c('0x4')]),_0xed886a);utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x3b'),_0xed886a['uniqueid'],queues[_0xed886a['uniqueid']][_0x780c('0x1d')],_0xed886a['membername'],_0xed886a[_0x780c('0x3c')]));queues[_0xed886a['uniqueid']][_0x780c('0x16')]=![];queues[_0xed886a['uniqueid']][_0x780c('0x16')]=![];queues[_0xed886a[_0x780c('0x4')]]['queuecallerabandonAt']=null;queues[_0xed886a[_0x780c('0x4')]]['queuecallerexit']=![];queues[_0xed886a[_0x780c('0x4')]][_0x780c('0x7')]=null;queues[_0xed886a[_0x780c('0x4')]][_0x780c('0x28')]=null;queues[_0xed886a[_0x780c('0x4')]][_0x780c('0x3d')]=!![];queues[_0xed886a[_0x780c('0x4')]]['accountcode']=_0xed886a[_0x780c('0x3c')];queues[_0xed886a[_0x780c('0x4')]][_0x780c('0x3e')]=_0xed886a[_0x780c('0x3f')];}}catch(_0x1c8470){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x3a'),_0xed886a['uniqueid']),_0x1c8470);}};exports[_0x780c('0x40')]=function(_0x1a6cf6){try{if(!_[_0x780c('0x21')](queues[_0x1a6cf6[_0x780c('0x4')]])){if(queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x37')]){utils['debug'](util[_0x780c('0x3')](_0x780c('0x41'),_0x1a6cf6[_0x780c('0x4')]),_0x1a6cf6);queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x16')]=![];queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x16')]=![];queues[_0x1a6cf6[_0x780c('0x4')]]['queuecallerabandonAt']=null;queues[_0x1a6cf6[_0x780c('0x4')]]['queuecallerexit']=![];queues[_0x1a6cf6[_0x780c('0x4')]]['queuecallerexitAt']=null;queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x3d')]=!![];queues[_0x1a6cf6['uniqueid']][_0x780c('0x3e')]=_0x1a6cf6[_0x780c('0x3f')];queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x18')]=!![];queues[_0x1a6cf6['uniqueid']][_0x780c('0x19')]=utils[_0x780c('0x29')]();if(_0x1a6cf6['reason']==_0x780c('0x42')){if(!queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x42')]){queues[_0x1a6cf6['uniqueid']]['queuecallerexitreason']=_0x780c('0x43');}}else{queues[_0x1a6cf6['uniqueid']][_0x780c('0x7')]='COMPLETEDBY'+_0x1a6cf6[_0x780c('0x44')][_0x780c('0x25')]();}utils['info'](util[_0x780c('0x3')](_0x780c('0x45'),_0x1a6cf6[_0x780c('0x4')],queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x1d')],_0x1a6cf6[_0x780c('0x3f')],queues[_0x1a6cf6['uniqueid']][_0x780c('0x7')]));writeDB(queues[_0x1a6cf6['uniqueid']]);}}}catch(_0x428cc5){utils[_0x780c('0x1f')](util[_0x780c('0x3')]('[%s][queues][agentcomplete]',_0x1a6cf6[_0x780c('0x4')]),_0x428cc5);}};exports[_0x780c('0x46')]=function(_0x574b74){try{if(!_[_0x780c('0x21')](queues[_0x574b74['transfereeuniqueid']])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x47'),_0x574b74[_0x780c('0x4')]),_0x574b74);queues[_0x574b74['transfereeuniqueid']][_0x780c('0x42')]=!![];queues[_0x574b74[_0x780c('0x48')]][_0x780c('0x49')]='BLIND';queues[_0x574b74[_0x780c('0x48')]][_0x780c('0x4a')]=_0x574b74['extension'];queues[_0x574b74['transfereeuniqueid']][_0x780c('0x4b')]=_0x574b74[_0x780c('0x48')];queues[_0x574b74['transfereeuniqueid']][_0x780c('0x7')]='BLINDTRANSFER';utils[_0x780c('0x2')](util[_0x780c('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x574b74[_0x780c('0x4')],queues[_0x574b74['transfereeuniqueid']][_0x780c('0x1d')],_0x574b74[_0x780c('0x48')],_0x574b74[_0x780c('0x4c')]));}}catch(_0x5afcbb){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x47'),_0x574b74[_0x780c('0x4')]),_0x5afcbb);}};exports[_0x780c('0x4d')]=function(_0x2d66fc){try{utils[_0x780c('0xf')](util[_0x780c('0x3')]('[%s][queues][attendedtransfer]',_0x2d66fc['origtransfereruniqueid']),_0x2d66fc);if(_0x2d66fc[_0x780c('0x4e')]==_0x2d66fc[_0x780c('0x4f')]){if(!_['isNil'](queues[_0x2d66fc[_0x780c('0x50')]])){utils['info'](util[_0x780c('0x3')](_0x780c('0x51'),_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc[_0x780c('0x50')]][_0x780c('0x1d')],_0x2d66fc[_0x780c('0x52')]));queues[_0x2d66fc[_0x780c('0x50')]]['transfer']=!![];queues[_0x2d66fc['secondtransfererlinkedid']][_0x780c('0x49')]=_0x780c('0x53');queues[_0x2d66fc['secondtransfererlinkedid']][_0x780c('0x4a')]=_0x2d66fc[_0x780c('0x52')];queues[_0x2d66fc['secondtransfererlinkedid']][_0x780c('0x4b')]=_0x2d66fc[_0x780c('0x4e')];queues[_0x2d66fc[_0x780c('0x50')]][_0x780c('0x7')]=_0x780c('0x54');}if(!_['isNil'](queues[_0x2d66fc[_0x780c('0x4f')]])){if(_0x2d66fc[_0x780c('0x55')]&&queues[_0x2d66fc[_0x780c('0x55')]]){queues[_0x2d66fc['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x2d66fc[_0x780c('0x48')]]=_[_0x780c('0x56')](queues[_0x2d66fc[_0x780c('0x55')]]);queues[_0x2d66fc[_0x780c('0x48')]]['transfereduniqueid']=_0x2d66fc[_0x780c('0x57')];queues[_0x2d66fc['transfereeuniqueid']][_0x780c('0x1e')]=0x2;queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x58')]=queues[_0x2d66fc[_0x780c('0x50')]][_0x780c('0x58')];queues[_0x2d66fc[_0x780c('0x48')]]['calleridname']=queues[_0x2d66fc[_0x780c('0x50')]]['calleridname'];queues[_0x2d66fc[_0x780c('0x48')]]['queuecallerjoinAt']=utils[_0x780c('0x29')]();queues[_0x2d66fc['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x780c('0x29')]();queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x59')]=0x0;queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x5a')]=0x0;utils['info'](util[_0x780c('0x3')](_0x780c('0x5b'),_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x1d')],queues[_0x2d66fc['transfereeuniqueid']][_0x780c('0x58')],queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x5c')]));}else{utils[_0x780c('0x2')](util[_0x780c('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc['origtransfererlinkedid']][_0x780c('0x1d')],_0x2d66fc[_0x780c('0x50')]));queues[_0x2d66fc[_0x780c('0x4f')]][_0x780c('0xd')]=_0x2d66fc[_0x780c('0x50')];}}}else if(_0x2d66fc[_0x780c('0x5d')]==_0x2d66fc[_0x780c('0x50')]){if(!_[_0x780c('0x21')](queues[_0x2d66fc[_0x780c('0x4f')]])){utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x5e'),_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc[_0x780c('0x4f')]][_0x780c('0x1d')],_0x2d66fc[_0x780c('0x5d')],_0x2d66fc['secondtransfererexten']));queues[_0x2d66fc[_0x780c('0x4f')]]['transfer']=!![];queues[_0x2d66fc[_0x780c('0x4f')]][_0x780c('0x49')]='ATTENDED';queues[_0x2d66fc[_0x780c('0x4f')]][_0x780c('0x4a')]=_0x2d66fc['secondtransfererexten'];queues[_0x2d66fc['origtransfererlinkedid']][_0x780c('0x4b')]=_0x2d66fc[_0x780c('0x5d')];queues[_0x2d66fc[_0x780c('0x4f')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x780c('0x21')](queues[_0x2d66fc[_0x780c('0x50')]])){if(_0x2d66fc[_0x780c('0x5f')]&&queues[_0x2d66fc['transfertargetlinkedid']]){queues[_0x2d66fc[_0x780c('0x5f')]][_0x780c('0x1e')]=0x1;queues[_0x2d66fc[_0x780c('0x57')]]=_[_0x780c('0x56')](queues[_0x2d66fc[_0x780c('0x5f')]]);queues[_0x2d66fc['transfertargetuniqueid']][_0x780c('0xd')]=_0x2d66fc[_0x780c('0x57')];queues[_0x2d66fc['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x58')]=queues[_0x2d66fc[_0x780c('0x4f')]]['calleridnum'];queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x5c')]=queues[_0x2d66fc['origtransfererlinkedid']][_0x780c('0x5c')];queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x38')]=utils[_0x780c('0x29')]();queues[_0x2d66fc['transfertargetuniqueid']][_0x780c('0x37')]=utils[_0x780c('0x29')]();queues[_0x2d66fc[_0x780c('0x57')]]['holdtime']=0x0;queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x5a')]=0x0;utils['info'](util[_0x780c('0x3')](_0x780c('0x60'),_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x1d')],queues[_0x2d66fc[_0x780c('0x57')]]['transfereduniqueid'],queues[_0x2d66fc['transfertargetuniqueid']]['calleridnum'],queues[_0x2d66fc[_0x780c('0x57')]]['calleridname']));}else{utils['info'](util['format'](_0x780c('0x61'),_0x2d66fc['origtransfereruniqueid'],queues[_0x2d66fc[_0x780c('0x50')]][_0x780c('0x1d')],_0x2d66fc['origtransfererlinkedid']));queues[_0x2d66fc[_0x780c('0x50')]]['transfereduniqueid']=_0x2d66fc['origtransfererlinkedid'];}}}}catch(_0x5dd25d){utils['error'](util[_0x780c('0x3')]('[%s][queues][attendedtransfer]',_0x2d66fc[_0x780c('0x4e')]),_0x5dd25d);}};exports['musiconholdstart']=function(_0x17af76){try{if(!_[_0x780c('0x21')](queues[_0x17af76[_0x780c('0x4')]])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x62'),_0x17af76['uniqueid']),_0x17af76);queues[_0x17af76[_0x780c('0x4')]][_0x780c('0x63')]=utils[_0x780c('0x29')]();utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x64'),_0x17af76[_0x780c('0x4')],queues[_0x17af76[_0x780c('0x4')]][_0x780c('0x1d')],queues[_0x17af76[_0x780c('0x4')]][_0x780c('0x63')]));}}catch(_0x32a92f){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x62'),_0x17af76[_0x780c('0x4')]),_0x32a92f);}};exports['musiconholdstop']=function(_0xcd68a9){try{if(!_[_0x780c('0x21')](queues[_0xcd68a9[_0x780c('0x4')]])){if(!_[_0x780c('0x21')](queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x63')])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x65'),_0xcd68a9[_0x780c('0x4')]),_0xcd68a9);queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x5a')]+=utils['diffTime'](utils[_0x780c('0x29')](),queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x63')]);utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x66'),_0xcd68a9[_0x780c('0x4')],queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x1d')],queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x5a')]));delete queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x63')];}}}catch(_0x51c360){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x65'),_0xcd68a9['uniqueid']),_0x51c360);}};
\ No newline at end of file
index fc62f50..820b144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd11=['[%s][recordings][writeDB]','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','exten','context','channel','newstate','isNil','channelstate','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format'];(function(_0x4f6c26,_0x5c2c54){var _0x4809a0=function(_0x1b30a9){while(--_0x1b30a9){_0x4f6c26['push'](_0x4f6c26['shift']());}};_0x4809a0(++_0x5c2c54);}(_0xbd11,0xc5));var _0x1bd1=function(_0x261038,_0x2fab28){_0x261038=_0x261038-0x0;var _0x2fd230=_0xbd11[_0x261038];return _0x2fd230;};'use strict';var _=require(_0x1bd1('0x0'));var util=require(_0x1bd1('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x2590c7){utils[_0x1bd1('0x2')](util[_0x1bd1('0x3')](_0x1bd1('0x4'),_0x2590c7['uniqueid']));if(_0x2590c7['accountcode']){utils[_0x1bd1('0x5')](_0x2590c7[_0x1bd1('0x6')])[_0x1bd1('0x7')](function(_0x1dfcb2){if(_0x1dfcb2){_0x2590c7[_0x1bd1('0x8')]=_0x1dfcb2[_0x1bd1('0x9')];_0x2590c7[_0x1bd1('0xa')]=_0x1dfcb2['id'];}utils[_0x1bd1('0xb')](_0x1bd1('0xc'),_0x2590c7);});}else{utils[_0x1bd1('0xb')]('CreateVoiceRecording',_0x2590c7);}}exports[_0x1bd1('0xd')]=function(_0x1c55b5){try{utils[_0x1bd1('0xe')](util[_0x1bd1('0x3')](_0x1bd1('0xf'),_0x1c55b5[_0x1bd1('0x10')]),_0x1c55b5);if(_0x1c55b5[_0x1bd1('0x10')]==_0x1c55b5['linkedid']){utils[_0x1bd1('0x2')](util[_0x1bd1('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x1c55b5['uniqueid'],_0x1c55b5['context'],_0x1c55b5[_0x1bd1('0x11')]));recordings[_0x1c55b5[_0x1bd1('0x10')]]={'uniqueid':_0x1c55b5[_0x1bd1('0x10')],'accountcode':_0x1c55b5[_0x1bd1('0x6')],'exten':_0x1c55b5[_0x1bd1('0x11')],'context':_0x1c55b5[_0x1bd1('0x12')],'channel':_0x1c55b5[_0x1bd1('0x13')],'monitors':[]};}}catch(_0x2311f6){utils['error'](util[_0x1bd1('0x3')](_0x1bd1('0xf'),_0x1c55b5['uniqueid']),_0x2311f6);}};exports[_0x1bd1('0x14')]=function(_0x3aa1b0){try{utils[_0x1bd1('0xe')](util[_0x1bd1('0x3')]('[%s][recordings][newstate]',_0x3aa1b0['uniqueid']),_0x3aa1b0);if(!_[_0x1bd1('0x15')](recordings[_0x3aa1b0['uniqueid']])&&_0x3aa1b0[_0x1bd1('0x16')]==0x6){utils[_0x1bd1('0x2')](util[_0x1bd1('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3aa1b0[_0x1bd1('0x10')],_0x3aa1b0[_0x1bd1('0x12')],_0x3aa1b0['channel']));}else if(!_[_0x1bd1('0x15')](recordings[_0x3aa1b0[_0x1bd1('0x17')]])&&_0x3aa1b0[_0x1bd1('0x16')]==0x6&&_0x3aa1b0['context']!='transfer'){utils[_0x1bd1('0x2')](util[_0x1bd1('0x3')](_0x1bd1('0x18'),_0x3aa1b0[_0x1bd1('0x10')],_0x3aa1b0['linkedid'],_0x3aa1b0['context'],_0x3aa1b0[_0x1bd1('0x13')]));recordings[_0x3aa1b0[_0x1bd1('0x17')]][_0x1bd1('0x6')]=_0x3aa1b0[_0x1bd1('0x6')];}}catch(_0x1df103){utils[_0x1bd1('0x19')](util[_0x1bd1('0x3')]('[%s][recordings][newstate]',_0x3aa1b0[_0x1bd1('0x10')]),_0x1df103);}};exports[_0x1bd1('0x1a')]=function(_0x506be7){try{if(!_[_0x1bd1('0x15')](_0x506be7[_0x1bd1('0x1b')])&&!_[_0x1bd1('0x15')](_0x506be7[_0x1bd1('0x1b')][_0x1bd1('0x1c')])){utils[_0x1bd1('0xe')](util[_0x1bd1('0x3')](_0x1bd1('0x1d'),_0x506be7[_0x1bd1('0x10')]),_0x506be7);utils['info'](util[_0x1bd1('0x3')](_0x1bd1('0x1e'),_0x506be7['uniqueid'],_0x506be7['variable'],_0x506be7[_0x1bd1('0x1f')]));if(_[_0x1bd1('0x20')](_0x506be7['value'],_0x1bd1('0x21'))){_0x506be7[_0x1bd1('0x1f')]=_0x506be7[_0x1bd1('0x1f')][_0x1bd1('0x22')](_0x1bd1('0x21'),_0x1bd1('0x23'));}if(recordings[_0x506be7[_0x1bd1('0x17')]]){var _0x4a1ad1=_[_0x1bd1('0x24')](recordings[_0x506be7[_0x1bd1('0x17')]][_0x1bd1('0x25')],{'value':_0x506be7[_0x1bd1('0x1f')]});if(_[_0x1bd1('0x15')](_0x4a1ad1)){recordings[_0x506be7['linkedid']]['monitors'][_0x1bd1('0x26')]({'value':_0x506be7[_0x1bd1('0x1f')]});}}}}catch(_0x4e89b8){utils[_0x1bd1('0x19')](util[_0x1bd1('0x3')](_0x1bd1('0x1d'),_0x506be7[_0x1bd1('0x10')]),_0x4e89b8);}};exports[_0x1bd1('0x27')]=function(_0x3fb6a5){try{if(!_[_0x1bd1('0x15')](recordings[_0x3fb6a5[_0x1bd1('0x10')]])){utils[_0x1bd1('0xe')](util[_0x1bd1('0x3')](_0x1bd1('0x28'),_0x3fb6a5['uniqueid']),_0x3fb6a5);utils['info'](util['format'](_0x1bd1('0x29'),_0x3fb6a5['uniqueid'],_0x3fb6a5[_0x1bd1('0x2a')],_0x3fb6a5[_0x1bd1('0x2b')],_0x3fb6a5[_0x1bd1('0x2c')]));recordings[_0x3fb6a5[_0x1bd1('0x10')]][_0x1bd1('0x2a')]=_0x3fb6a5['calleridnum'];recordings[_0x3fb6a5[_0x1bd1('0x10')]][_0x1bd1('0x2b')]=_0x3fb6a5[_0x1bd1('0x2b')];recordings[_0x3fb6a5[_0x1bd1('0x10')]][_0x1bd1('0x2d')]=_0x3fb6a5['connectedlinenum'];recordings[_0x3fb6a5['uniqueid']][_0x1bd1('0x2e')]=_0x3fb6a5[_0x1bd1('0x2e')];if(recordings[_0x3fb6a5['uniqueid']][_0x1bd1('0x2f')]==_0x1bd1('0x30')&&recordings[_0x3fb6a5[_0x1bd1('0x10')]][_0x1bd1('0x6')]){recordings[_0x3fb6a5['uniqueid']][_0x1bd1('0x2d')]=recordings[_0x3fb6a5[_0x1bd1('0x10')]][_0x1bd1('0x6')];recordings[_0x3fb6a5[_0x1bd1('0x10')]][_0x1bd1('0x2e')]='';}recordings[_0x3fb6a5[_0x1bd1('0x10')]][_0x1bd1('0x25')][_0x1bd1('0x31')](function(_0x10a043){var _0x3b3a5b=_[_0x1bd1('0x32')](recordings[_0x3fb6a5['uniqueid']]);_0x3b3a5b[_0x1bd1('0x1f')]=_0x10a043[_0x1bd1('0x1f')];writeDB(_0x3b3a5b);});delete recordings[_0x3fb6a5[_0x1bd1('0x10')]];}}catch(_0x15591f){utils[_0x1bd1('0x19')](util[_0x1bd1('0x3')](_0x1bd1('0x28'),_0x3fb6a5[_0x1bd1('0x10')]),_0x15591f);}};exports[_0x1bd1('0x33')]=function(_0x32dcb9){try{if(!_[_0x1bd1('0x15')](recordings[_0x32dcb9['uniqueid']])){utils['debug'](util[_0x1bd1('0x3')](_0x1bd1('0x34'),_0x32dcb9[_0x1bd1('0x10')]),_0x32dcb9);utils[_0x1bd1('0x2')](util[_0x1bd1('0x3')](_0x1bd1('0x35'),_0x32dcb9['uniqueid'],_0x32dcb9[_0x1bd1('0x36')],_0x32dcb9['appdata']));if(_0x32dcb9['application']['toLowerCase']()==_0x1bd1('0x37')&&_[_0x1bd1('0x38')](_0x32dcb9[_0x1bd1('0x39')][_0x1bd1('0x3a')](),_0x1bd1('0x3b'))){var _0x20b3d9=_0x32dcb9[_0x1bd1('0x39')][_0x1bd1('0x3c')]('=');var _0x37a9b7=_0x20b3d9[0x0][_0x1bd1('0x3d')](_0x20b3d9[0x0]['lastIndexOf']('(')+0x1,_0x20b3d9[0x0][_0x1bd1('0x3e')](')'));var _0x319726=_0x20b3d9[0x1];recordings[_0x32dcb9[_0x1bd1('0x10')]][_0x37a9b7]=_0x319726;}}}catch(_0x30e6d1){utils[_0x1bd1('0x19')](util['format'](_0x1bd1('0x34'),_0x32dcb9[_0x1bd1('0x10')]),_0x30e6d1);}};exports[_0x1bd1('0x3f')]=function(_0x120f46){try{if(!_[_0x1bd1('0x15')](recordings[_0x120f46[_0x1bd1('0x10')]])){utils['debug'](util[_0x1bd1('0x3')](_0x1bd1('0x40'),_0x120f46['uniqueid']),_0x120f46);utils[_0x1bd1('0x2')](util[_0x1bd1('0x3')](_0x1bd1('0x41'),_0x120f46[_0x1bd1('0x10')],_0x120f46[_0x1bd1('0x42')]));recordings[_0x120f46['uniqueid']][_0x1bd1('0x42')]=_0x120f46['queue'];}}catch(_0x215e0d){utils[_0x1bd1('0x19')](util[_0x1bd1('0x3')](_0x1bd1('0x40'),_0x120f46[_0x1bd1('0x10')]),_0x215e0d);}};
\ No newline at end of file
+var _0x23c6=['util','./utils','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','isNil','channelstate','error','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','.WAV','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash'];(function(_0x5e76d3,_0x5bf618){var _0x4a0790=function(_0x24530b){while(--_0x24530b){_0x5e76d3['push'](_0x5e76d3['shift']());}};_0x4a0790(++_0x5bf618);}(_0x23c6,0x19c));var _0x623c=function(_0x3d92e4,_0x53a178){_0x3d92e4=_0x3d92e4-0x0;var _0x1f97ce=_0x23c6[_0x3d92e4];return _0x1f97ce;};'use strict';var _=require(_0x623c('0x0'));var util=require(_0x623c('0x1'));var utils=require(_0x623c('0x2'));var recordings={};function writeDB(_0x245c4c){utils[_0x623c('0x3')](util[_0x623c('0x4')](_0x623c('0x5'),_0x245c4c['uniqueid']));if(_0x245c4c[_0x623c('0x6')]){utils[_0x623c('0x7')](_0x245c4c[_0x623c('0x6')])['then'](function(_0x343e51){if(_0x343e51){_0x245c4c[_0x623c('0x8')]=_0x343e51[_0x623c('0x9')];_0x245c4c[_0x623c('0xa')]=_0x343e51['id'];}utils[_0x623c('0xb')](_0x623c('0xc'),_0x245c4c);});}else{utils[_0x623c('0xb')](_0x623c('0xc'),_0x245c4c);}}exports[_0x623c('0xd')]=function(_0x531d8d){try{utils[_0x623c('0xe')](util[_0x623c('0x4')](_0x623c('0xf'),_0x531d8d[_0x623c('0x10')]),_0x531d8d);if(_0x531d8d[_0x623c('0x10')]==_0x531d8d[_0x623c('0x11')]){utils['info'](util['format'](_0x623c('0x12'),_0x531d8d['uniqueid'],_0x531d8d[_0x623c('0x13')],_0x531d8d['exten']));recordings[_0x531d8d[_0x623c('0x10')]]={'uniqueid':_0x531d8d[_0x623c('0x10')],'accountcode':_0x531d8d[_0x623c('0x6')],'exten':_0x531d8d[_0x623c('0x14')],'context':_0x531d8d[_0x623c('0x13')],'channel':_0x531d8d[_0x623c('0x15')],'monitors':[]};}}catch(_0xf478bc){utils['error'](util[_0x623c('0x4')](_0x623c('0xf'),_0x531d8d[_0x623c('0x10')]),_0xf478bc);}};exports[_0x623c('0x16')]=function(_0x47b2cb){try{utils[_0x623c('0xe')](util[_0x623c('0x4')]('[%s][recordings][newstate]',_0x47b2cb[_0x623c('0x10')]),_0x47b2cb);if(!_[_0x623c('0x17')](recordings[_0x47b2cb['uniqueid']])&&_0x47b2cb['channelstate']==0x6){utils[_0x623c('0x3')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x47b2cb['uniqueid'],_0x47b2cb['context'],_0x47b2cb[_0x623c('0x15')]));}else if(!_['isNil'](recordings[_0x47b2cb[_0x623c('0x11')]])&&_0x47b2cb[_0x623c('0x18')]==0x6&&_0x47b2cb[_0x623c('0x13')]!='transfer'){utils[_0x623c('0x3')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x47b2cb[_0x623c('0x10')],_0x47b2cb[_0x623c('0x11')],_0x47b2cb[_0x623c('0x13')],_0x47b2cb[_0x623c('0x15')]));recordings[_0x47b2cb[_0x623c('0x11')]][_0x623c('0x6')]=_0x47b2cb[_0x623c('0x6')];}}catch(_0x4e38ff){utils[_0x623c('0x19')](util[_0x623c('0x4')](_0x623c('0x1a'),_0x47b2cb[_0x623c('0x10')]),_0x4e38ff);}};exports[_0x623c('0x1b')]=function(_0x2113d2){try{if(!_[_0x623c('0x17')](_0x2113d2[_0x623c('0x1c')])&&!_[_0x623c('0x17')](_0x2113d2['variable'][_0x623c('0x1d')])){utils['debug'](util[_0x623c('0x4')](_0x623c('0x1e'),_0x2113d2[_0x623c('0x10')]),_0x2113d2);utils[_0x623c('0x3')](util[_0x623c('0x4')](_0x623c('0x1f'),_0x2113d2['uniqueid'],_0x2113d2[_0x623c('0x1c')],_0x2113d2[_0x623c('0x20')]));if(_['endsWith'](_0x2113d2[_0x623c('0x20')],'.wav49')){_0x2113d2[_0x623c('0x20')]=_0x2113d2[_0x623c('0x20')][_0x623c('0x21')](_0x623c('0x22'),_0x623c('0x23'));}if(recordings[_0x2113d2[_0x623c('0x11')]]){var _0x4ad44a=_['find'](recordings[_0x2113d2['linkedid']][_0x623c('0x24')],{'value':_0x2113d2[_0x623c('0x20')]});if(_['isNil'](_0x4ad44a)){recordings[_0x2113d2[_0x623c('0x11')]]['monitors'][_0x623c('0x25')]({'value':_0x2113d2[_0x623c('0x20')]});}}}}catch(_0x5c033f){utils[_0x623c('0x19')](util[_0x623c('0x4')](_0x623c('0x1e'),_0x2113d2[_0x623c('0x10')]),_0x5c033f);}};exports[_0x623c('0x26')]=function(_0x3b47d7){try{if(!_[_0x623c('0x17')](recordings[_0x3b47d7[_0x623c('0x10')]])){utils[_0x623c('0xe')](util[_0x623c('0x4')](_0x623c('0x27'),_0x3b47d7[_0x623c('0x10')]),_0x3b47d7);utils[_0x623c('0x3')](util[_0x623c('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3b47d7['uniqueid'],_0x3b47d7[_0x623c('0x28')],_0x3b47d7['calleridname'],_0x3b47d7[_0x623c('0x29')]));recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x28')]=_0x3b47d7[_0x623c('0x28')];recordings[_0x3b47d7[_0x623c('0x10')]]['calleridname']=_0x3b47d7[_0x623c('0x2a')];recordings[_0x3b47d7[_0x623c('0x10')]]['connectedlinenum']=_0x3b47d7[_0x623c('0x2b')];recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x2c')]=_0x3b47d7[_0x623c('0x2c')];if(recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x2d')]=='outbound'&&recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x6')]){recordings[_0x3b47d7['uniqueid']][_0x623c('0x2b')]=recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x6')];recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x2c')]='';}recordings[_0x3b47d7['uniqueid']][_0x623c('0x24')][_0x623c('0x2e')](function(_0x12f2b9){var _0xd3b71f=_[_0x623c('0x2f')](recordings[_0x3b47d7[_0x623c('0x10')]]);_0xd3b71f['value']=_0x12f2b9[_0x623c('0x20')];writeDB(_0xd3b71f);});delete recordings[_0x3b47d7['uniqueid']];}}catch(_0x107602){utils['error'](util[_0x623c('0x4')](_0x623c('0x27'),_0x3b47d7['uniqueid']),_0x107602);}};exports['newexten']=function(_0x3f05d1){try{if(!_['isNil'](recordings[_0x3f05d1[_0x623c('0x10')]])){utils['debug'](util['format'](_0x623c('0x30'),_0x3f05d1[_0x623c('0x10')]),_0x3f05d1);utils[_0x623c('0x3')](util[_0x623c('0x4')](_0x623c('0x31'),_0x3f05d1[_0x623c('0x10')],_0x3f05d1[_0x623c('0x32')],_0x3f05d1[_0x623c('0x33')]));if(_0x3f05d1[_0x623c('0x32')][_0x623c('0x34')]()=='set'&&_['startsWith'](_0x3f05d1[_0x623c('0x33')][_0x623c('0x34')](),_0x623c('0x35'))){var _0x3405a8=_0x3f05d1[_0x623c('0x33')][_0x623c('0x36')]('=');var _0x96a38a=_0x3405a8[0x0]['substring'](_0x3405a8[0x0][_0x623c('0x37')]('(')+0x1,_0x3405a8[0x0]['lastIndexOf'](')'));var _0x10f31b=_0x3405a8[0x1];recordings[_0x3f05d1[_0x623c('0x10')]][_0x96a38a]=_0x10f31b;}}}catch(_0x5b5d02){utils['error'](util['format'](_0x623c('0x30'),_0x3f05d1[_0x623c('0x10')]),_0x5b5d02);}};exports[_0x623c('0x38')]=function(_0x2c88cb){try{if(!_['isNil'](recordings[_0x2c88cb[_0x623c('0x10')]])){utils[_0x623c('0xe')](util[_0x623c('0x4')](_0x623c('0x39'),_0x2c88cb[_0x623c('0x10')]),_0x2c88cb);utils['info'](util[_0x623c('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x2c88cb[_0x623c('0x10')],_0x2c88cb[_0x623c('0x3a')]));recordings[_0x2c88cb[_0x623c('0x10')]][_0x623c('0x3a')]=_0x2c88cb['queue'];}}catch(_0x1eb32f){utils[_0x623c('0x19')](util[_0x623c('0x4')]('[%s][recordings][queuecallerjoin]',_0x2c88cb[_0x623c('0x10')]),_0x1eb32f);}};
\ No newline at end of file
index 61d57b7..d6afe92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b80=['assign','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','util','./utils','info','format','attended','origtransfereruniqueid','type','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel'];(function(_0x40672d,_0x316df5){var _0x731e51=function(_0x103e27){while(--_0x103e27){_0x40672d['push'](_0x40672d['shift']());}};_0x731e51(++_0x316df5);}(_0x4b80,0xa4));var _0x04b8=function(_0x5abc07,_0x440f8b){_0x5abc07=_0x5abc07-0x0;var _0x5e9662=_0x4b80[_0x5abc07];return _0x5e9662;};'use strict';var _=require('lodash');var util=require(_0x04b8('0x0'));var utils=require(_0x04b8('0x1'));function writeDB(_0x14cc0b){utils[_0x04b8('0x2')](util[_0x04b8('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x14cc0b['type']===_0x04b8('0x4')?_0x14cc0b[_0x04b8('0x5')]:_0x14cc0b['uniqueid'],_0x14cc0b[_0x04b8('0x6')]));utils['request'](_0x04b8('0x7'),_0x14cc0b);}exports['blinds']={};exports[_0x04b8('0x8')]=function(_0x129d68){try{utils[_0x04b8('0x9')](util[_0x04b8('0x3')](_0x04b8('0xa'),_0x129d68[_0x04b8('0xb')]),_0x129d68);utils[_0x04b8('0x2')](util[_0x04b8('0x3')](_0x04b8('0xc'),_0x129d68[_0x04b8('0xb')],_0x129d68['transferercalleridnum'],_0x129d68[_0x04b8('0xd')],_0x129d68[_0x04b8('0xe')],_0x129d68['transfereecalleridname']));_0x129d68['type']=_0x04b8('0xf');exports[_0x04b8('0x10')][_0x129d68[_0x04b8('0x11')]]=_0x129d68;writeDB(_0x129d68);}catch(_0x28e429){utils[_0x04b8('0x12')](util[_0x04b8('0x3')](_0x04b8('0xa'),_0x129d68[_0x04b8('0xb')]),_0x28e429);}};exports[_0x04b8('0x13')]=function(_0x3a7181){try{utils['debug'](util[_0x04b8('0x3')]('[%s][transfers][attendedtransfer]',_0x3a7181[_0x04b8('0x5')]),_0x3a7181);utils[_0x04b8('0x2')](util[_0x04b8('0x3')](_0x04b8('0x14'),_0x3a7181[_0x04b8('0x5')],_0x3a7181['origtransferercalleridnum'],_0x3a7181[_0x04b8('0x15')],_0x3a7181['transfertargetcalleridnum'],_0x3a7181[_0x04b8('0x16')]));_0x3a7181=_['assign'](_0x3a7181,{'transfererchannel':_0x3a7181[_0x04b8('0x17')],'transferercalleridnum':_0x3a7181['origtransferercalleridnum'],'transferercalleridname':_0x3a7181['origtransferercalleridname'],'transfererconnectedlinenum':_0x3a7181['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3a7181[_0x04b8('0x18')],'transfereraccountcode':_0x3a7181[_0x04b8('0x19')],'transferercontext':_0x3a7181[_0x04b8('0x1a')],'transfererexten':_0x3a7181['secondtransfererexten'],'transfererlinkedid':_0x3a7181[_0x04b8('0x1b')],'context':_0x3a7181[_0x04b8('0x1c')],'extension':_0x3a7181['origtransfererexten'],'type':_0x04b8('0x4')});if(_[_0x04b8('0x1d')](_0x3a7181[_0x04b8('0x1e')])){_0x3a7181=_[_0x04b8('0x1f')](_0x3a7181,{'transfereechannel':_0x3a7181[_0x04b8('0x20')],'transfereecalleridnum':_0x3a7181[_0x04b8('0x21')],'transfereecalleridname':_0x3a7181[_0x04b8('0x16')],'transfereeconnectedlinenum':_0x3a7181[_0x04b8('0x22')],'transfereeconnectedlinename':_0x3a7181[_0x04b8('0x23')],'transfereeaccountcode':_0x3a7181['transfertargetaccountcode'],'transfereecontext':_0x3a7181['transfertargetcontext'],'transfereeexten':_0x3a7181[_0x04b8('0x24')],'transfereelinkedid':_0x3a7181[_0x04b8('0x25')]});}writeDB(_0x3a7181);}catch(_0x12c561){utils['error'](util[_0x04b8('0x3')](_0x04b8('0x26'),_0x3a7181['origtransfereruniqueid']),_0x12c561);}};
\ No newline at end of file
+var _0xc996=['error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridnum','blind','transfereruniqueid'];(function(_0x2d8a9d,_0x2b39fc){var _0x1b924d=function(_0x24800c){while(--_0x24800c){_0x2d8a9d['push'](_0x2d8a9d['shift']());}};_0x1b924d(++_0x2b39fc);}(_0xc996,0x171));var _0x6c99=function(_0x2ba904,_0x5585c4){_0x2ba904=_0x2ba904-0x0;var _0x4641a9=_0xc996[_0x2ba904];return _0x4641a9;};'use strict';var _=require(_0x6c99('0x0'));var util=require(_0x6c99('0x1'));var utils=require(_0x6c99('0x2'));function writeDB(_0x3e8815){utils[_0x6c99('0x3')](util[_0x6c99('0x4')](_0x6c99('0x5'),_0x3e8815[_0x6c99('0x6')]===_0x6c99('0x7')?_0x3e8815['origtransfereruniqueid']:_0x3e8815[_0x6c99('0x8')],_0x3e8815[_0x6c99('0x6')]));utils['request'](_0x6c99('0x9'),_0x3e8815);}exports[_0x6c99('0xa')]={};exports[_0x6c99('0xb')]=function(_0x54204e){try{utils[_0x6c99('0xc')](util['format'](_0x6c99('0xd'),_0x54204e['uniqueid']),_0x54204e);utils['info'](util[_0x6c99('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x54204e[_0x6c99('0x8')],_0x54204e[_0x6c99('0xe')],_0x54204e['transferercalleridname'],_0x54204e[_0x6c99('0xf')],_0x54204e['transfereecalleridname']));_0x54204e[_0x6c99('0x6')]=_0x6c99('0x10');exports['blinds'][_0x54204e[_0x6c99('0x11')]]=_0x54204e;writeDB(_0x54204e);}catch(_0x4d7e0b){utils[_0x6c99('0x12')](util[_0x6c99('0x4')](_0x6c99('0xd'),_0x54204e[_0x6c99('0x8')]),_0x4d7e0b);}};exports[_0x6c99('0x13')]=function(_0x57be22){try{utils[_0x6c99('0xc')](util[_0x6c99('0x4')](_0x6c99('0x14'),_0x57be22[_0x6c99('0x15')]),_0x57be22);utils[_0x6c99('0x3')](util[_0x6c99('0x4')](_0x6c99('0x16'),_0x57be22['origtransfereruniqueid'],_0x57be22[_0x6c99('0x17')],_0x57be22[_0x6c99('0x18')],_0x57be22[_0x6c99('0x19')],_0x57be22['transfertargetcalleridname']));_0x57be22=_[_0x6c99('0x1a')](_0x57be22,{'transfererchannel':_0x57be22[_0x6c99('0x1b')],'transferercalleridnum':_0x57be22[_0x6c99('0x17')],'transferercalleridname':_0x57be22[_0x6c99('0x18')],'transfererconnectedlinenum':_0x57be22[_0x6c99('0x1c')],'transfererconnectedlinename':_0x57be22[_0x6c99('0x1d')],'transfereraccountcode':_0x57be22[_0x6c99('0x1e')],'transferercontext':_0x57be22[_0x6c99('0x1f')],'transfererexten':_0x57be22[_0x6c99('0x20')],'transfererlinkedid':_0x57be22[_0x6c99('0x21')],'context':_0x57be22[_0x6c99('0x22')],'extension':_0x57be22[_0x6c99('0x23')],'type':_0x6c99('0x7')});if(_[_0x6c99('0x24')](_0x57be22['transfereechannel'])){_0x57be22=_[_0x6c99('0x1a')](_0x57be22,{'transfereechannel':_0x57be22['transfertargetchannel'],'transfereecalleridnum':_0x57be22['transfertargetcalleridnum'],'transfereecalleridname':_0x57be22['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x57be22[_0x6c99('0x25')],'transfereeconnectedlinename':_0x57be22[_0x6c99('0x26')],'transfereeaccountcode':_0x57be22[_0x6c99('0x27')],'transfereecontext':_0x57be22[_0x6c99('0x28')],'transfereeexten':_0x57be22[_0x6c99('0x29')],'transfereelinkedid':_0x57be22[_0x6c99('0x2a')]});}writeDB(_0x57be22);}catch(_0x28e967){utils[_0x6c99('0x12')](util[_0x6c99('0x4')](_0x6c99('0x14'),_0x57be22[_0x6c99('0x15')]),_0x28e967);}};
\ No newline at end of file
index c895f38..458886a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f95=['YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','util','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','catch','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','found','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','add','seconds'];(function(_0x3a4bad,_0x215d44){var _0x579140=function(_0x3a37e7){while(--_0x3a37e7){_0x3a4bad['push'](_0x3a4bad['shift']());}};_0x579140(++_0x215d44);}(_0x0f95,0x11d));var _0x50f9=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0x0f95[_0x4536a4];return _0x4fd1c1;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x50f9('0x0'));var moment=require('moment');var util=require(_0x50f9('0x1'));var client=jayson[_0x50f9('0x2')][_0x50f9('0x3')]({'port':0x2329});var logger=require(_0x50f9('0x4'))('xdr');exports[_0x50f9('0x5')]=function(_0x270ee9,_0x557523){logger['info'](_0x270ee9,_0x557523?util[_0x50f9('0x6')](_0x557523,{'showHidden':![],'depth':null}):'');};exports[_0x50f9('0x7')]=function(_0x54261e,_0xc1473c){logger[_0x50f9('0x7')](_0x54261e,_0xc1473c?util[_0x50f9('0x6')](_0xc1473c,{'showHidden':![],'depth':null}):'');};exports[_0x50f9('0x8')]=function(_0x21f5ee,_0x11cfc9){logger[_0x50f9('0x8')](_0x21f5ee,_0x11cfc9?util['inspect'](_0x11cfc9,{'showHidden':![],'depth':null}):'');};exports[_0x50f9('0x9')]=function(_0x399d33,_0x2a5959){return client[_0x50f9('0x9')](_0x399d33,{'body':_0x2a5959})[_0x50f9('0xa')](function(_0x513d2e){logger['debug']('[utils][request]\x20name:%s',_0x399d33,_0x513d2e?util['inspect'](_0x513d2e,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x3339c0){logger[_0x50f9('0x8')](_0x50f9('0xb'),_0x399d33,_0x3339c0?util[_0x50f9('0x6')](_0x3339c0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x15156d){return client[_0x50f9('0x9')](_0x50f9('0xc'),{'options':{'raw':!![],'attributes':['id',_0x50f9('0xd'),_0x50f9('0xe'),_0x50f9('0xf')],'where':_0x15156d,'limit':0x1}})[_0x50f9('0xa')](function(_0x26e70e){logger[_0x50f9('0x7')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x15156d),_0x26e70e?util[_0x50f9('0x6')](_0x26e70e,{'showHidden':![],'depth':null}):'');return _0x26e70e[_0x50f9('0x10')][_0x50f9('0x11')]?_0x26e70e[_0x50f9('0x10')][0x0]:null;});}exports[_0x50f9('0x12')]=function(_0x2b9217){return new BPromise(function(_0x4d465d,_0x53afb5){if(_0x2b9217){return getUser({'internal':_0x2b9217})['then'](function(_0x171515){logger[_0x50f9('0x5')](_0x50f9('0x13'),_0x2b9217,_0x171515?'found':_0x50f9('0x14'));return _0x4d465d(_0x171515);})['catch'](function(_0x24381b){logger[_0x50f9('0x8')](_0x50f9('0x15'),_0x24381b?util[_0x50f9('0x6')](_0x24381b,{'showHidden':![],'depth':null}):'');return _0x4d465d(null);});}return _0x4d465d(null);});};exports[_0x50f9('0x16')]=function(_0x14d499){return new BPromise(function(_0x51eddc,_0x1920dd){if(_0x14d499){return getUser({'interface':_0x14d499})['then'](function(_0x14ef8c){logger['info'](_0x50f9('0x17'),_0x14d499,_0x14ef8c?'found':_0x50f9('0x14'));return _0x51eddc(_0x14ef8c);})[_0x50f9('0x18')](function(_0x5349e3){logger[_0x50f9('0x8')](_0x50f9('0x19'),_0x5349e3?util['inspect'](_0x5349e3,{'showHidden':![],'depth':null}):'');return _0x51eddc(null);});}return _0x51eddc(null);});};exports[_0x50f9('0x1a')]=function(_0x386973){return new BPromise(function(_0x5bd30a,_0x117213){if(_0x386973){return getUser({'name':_0x386973})['then'](function(_0x4b9a77){logger[_0x50f9('0x5')](_0x50f9('0x1b'),_0x386973,_0x4b9a77?_0x50f9('0x1c'):'notfound');return _0x5bd30a(_0x4b9a77);})[_0x50f9('0x18')](function(_0x2bda6c){logger[_0x50f9('0x8')](_0x50f9('0x1d'),_0x2bda6c?util['inspect'](_0x2bda6c,{'showHidden':![],'depth':null}):'');return _0x5bd30a(null);});}return _0x5bd30a(null);});};exports[_0x50f9('0x1e')]=function(_0x3b0143){return new BPromise(function(_0x50e609,_0x5d5e18){if(_0x3b0143){return client[_0x50f9('0x9')](_0x50f9('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0x50f9('0x20'),'acw',_0x50f9('0x21')],'where':{'name':_0x3b0143},'limit':0x1}})[_0x50f9('0xa')](function(_0x19576e){logger[_0x50f9('0x7')](_0x50f9('0x22'),_0x3b0143,_0x19576e?util['inspect'](_0x19576e,{'showHidden':![],'depth':null}):'');logger[_0x50f9('0x5')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x3b0143,_0x19576e?'found':_0x50f9('0x14'));return _0x50e609(_0x19576e[_0x50f9('0x10')][_0x50f9('0x11')]?_0x19576e[_0x50f9('0x10')][0x0]:null);})[_0x50f9('0x18')](function(_0x52677c){logger[_0x50f9('0x8')]('[utils][getVoiceQueueByName]',_0x52677c?util['inspect'](_0x52677c,{'showHidden':![],'depth':null}):'');return _0x50e609(null);});}return _0x50e609(null);});};exports['addTime']=function(_0x570650,_0xc0d2a6){return moment(_0x570650)[_0x50f9('0x23')](_0xc0d2a6,_0x50f9('0x24'))['format'](_0x50f9('0x25'));};exports[_0x50f9('0x26')]=function(_0x836252,_0x4a5aa2){return moment(_0x836252)['subtract'](_0x4a5aa2,_0x50f9('0x24'))[_0x50f9('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x50f9('0x28')]=function(_0x54d2e3,_0x43e7f9){return moment(_0x54d2e3)[_0x50f9('0x29')](moment(_0x43e7f9),_0x50f9('0x24'));};exports[_0x50f9('0x2a')]=function(_0x1fd5df,_0x5d6359){return parseInt(_0x1fd5df,0xa)+parseInt(_0x5d6359,0xa);};exports[_0x50f9('0x2b')]=function(){return moment()[_0x50f9('0x27')](_0x50f9('0x25'));};exports[_0x50f9('0x2c')]=function(_0x533e08,_0x45b1c6){if(_0x45b1c6){return moment(_0x533e08)[_0x50f9('0x2c')](_0x45b1c6);}return!![];};exports[_0x50f9('0x2d')]=function(_0x1c7f38,_0x450ce1){if(_0x450ce1){return moment(_0x1c7f38)[_0x50f9('0x2d')](_0x450ce1);}else if(_0x1c7f38){return!![];}return![];};
\ No newline at end of file
+var _0xacf6=['getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff','sumTime','format','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','then','[utils][request]\x20name:%s','catch','request','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xacf6,0x6d));var _0x6acf=function(_0x2f386b,_0x1ff02d){_0x2f386b=_0x2f386b-0x0;var _0x2b3eea=_0xacf6[_0x2f386b];return _0x2b3eea;};'use strict';var BPromise=require(_0x6acf('0x0'));var jayson=require(_0x6acf('0x1'));var moment=require(_0x6acf('0x2'));var util=require(_0x6acf('0x3'));var client=jayson[_0x6acf('0x4')][_0x6acf('0x5')]({'port':0x2329});var logger=require(_0x6acf('0x6'))('xdr');exports[_0x6acf('0x7')]=function(_0x49996a,_0x4de83e){logger[_0x6acf('0x7')](_0x49996a,_0x4de83e?util[_0x6acf('0x8')](_0x4de83e,{'showHidden':![],'depth':null}):'');};exports[_0x6acf('0x9')]=function(_0x346df5,_0xa0b349){logger['debug'](_0x346df5,_0xa0b349?util['inspect'](_0xa0b349,{'showHidden':![],'depth':null}):'');};exports[_0x6acf('0xa')]=function(_0x3fc6ba,_0x46502a){logger[_0x6acf('0xa')](_0x3fc6ba,_0x46502a?util[_0x6acf('0x8')](_0x46502a,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x108a1f,_0x4e9b4e){return client['request'](_0x108a1f,{'body':_0x4e9b4e})[_0x6acf('0xb')](function(_0x3f3150){logger[_0x6acf('0x9')](_0x6acf('0xc'),_0x108a1f,_0x3f3150?util[_0x6acf('0x8')](_0x3f3150,{'showHidden':![],'depth':null}):'');})[_0x6acf('0xd')](function(_0x3eafdd){logger['error']('[utils][request]\x20name:%s',_0x108a1f,_0x3eafdd?util[_0x6acf('0x8')](_0x3eafdd,{'showHidden':![],'depth':null}):'');});};function getUser(_0x31f239){return client[_0x6acf('0xe')](_0x6acf('0xf'),{'options':{'raw':!![],'attributes':['id',_0x6acf('0x10'),_0x6acf('0x11'),_0x6acf('0x12')],'where':_0x31f239,'limit':0x1}})[_0x6acf('0xb')](function(_0x2c14b3){logger[_0x6acf('0x9')](_0x6acf('0x13'),JSON[_0x6acf('0x14')](_0x31f239),_0x2c14b3?util[_0x6acf('0x8')](_0x2c14b3,{'showHidden':![],'depth':null}):'');return _0x2c14b3[_0x6acf('0x15')][_0x6acf('0x16')]?_0x2c14b3[_0x6acf('0x15')][0x0]:null;});}exports[_0x6acf('0x17')]=function(_0x28e745){return new BPromise(function(_0xd32daf,_0x41d028){if(_0x28e745){return getUser({'internal':_0x28e745})[_0x6acf('0xb')](function(_0x34717d){logger[_0x6acf('0x7')](_0x6acf('0x18'),_0x28e745,_0x34717d?_0x6acf('0x19'):_0x6acf('0x1a'));return _0xd32daf(_0x34717d);})[_0x6acf('0xd')](function(_0x30ea7f){logger[_0x6acf('0xa')](_0x6acf('0x1b'),_0x30ea7f?util[_0x6acf('0x8')](_0x30ea7f,{'showHidden':![],'depth':null}):'');return _0xd32daf(null);});}return _0xd32daf(null);});};exports[_0x6acf('0x1c')]=function(_0x4fb1b2){return new BPromise(function(_0x50d896,_0x294d81){if(_0x4fb1b2){return getUser({'interface':_0x4fb1b2})[_0x6acf('0xb')](function(_0x21294d){logger[_0x6acf('0x7')](_0x6acf('0x1d'),_0x4fb1b2,_0x21294d?_0x6acf('0x19'):_0x6acf('0x1a'));return _0x50d896(_0x21294d);})['catch'](function(_0x219d0c){logger[_0x6acf('0xa')]('[utils][getUserByInterface]',_0x219d0c?util[_0x6acf('0x8')](_0x219d0c,{'showHidden':![],'depth':null}):'');return _0x50d896(null);});}return _0x50d896(null);});};exports['getUserByName']=function(_0x4297a6){return new BPromise(function(_0xca014d,_0x555aee){if(_0x4297a6){return getUser({'name':_0x4297a6})[_0x6acf('0xb')](function(_0x34a842){logger[_0x6acf('0x7')](_0x6acf('0x1e'),_0x4297a6,_0x34a842?_0x6acf('0x19'):_0x6acf('0x1a'));return _0xca014d(_0x34a842);})[_0x6acf('0xd')](function(_0x57bc99){logger[_0x6acf('0xa')](_0x6acf('0x1f'),_0x57bc99?util[_0x6acf('0x8')](_0x57bc99,{'showHidden':![],'depth':null}):'');return _0xca014d(null);});}return _0xca014d(null);});};exports[_0x6acf('0x20')]=function(_0x349704){return new BPromise(function(_0x41a83d,_0x64217b){if(_0x349704){return client[_0x6acf('0xe')](_0x6acf('0x21'),{'options':{'raw':!![],'attributes':['id','name',_0x6acf('0x22'),'acw','acwTimeout'],'where':{'name':_0x349704},'limit':0x1}})[_0x6acf('0xb')](function(_0x6fe279){logger[_0x6acf('0x9')](_0x6acf('0x23'),_0x349704,_0x6fe279?util[_0x6acf('0x8')](_0x6fe279,{'showHidden':![],'depth':null}):'');logger[_0x6acf('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x349704,_0x6fe279?_0x6acf('0x19'):_0x6acf('0x1a'));return _0x41a83d(_0x6fe279['result']['length']?_0x6fe279[_0x6acf('0x15')][0x0]:null);})[_0x6acf('0xd')](function(_0x515630){logger[_0x6acf('0xa')](_0x6acf('0x24'),_0x515630?util['inspect'](_0x515630,{'showHidden':![],'depth':null}):'');return _0x41a83d(null);});}return _0x41a83d(null);});};exports[_0x6acf('0x25')]=function(_0x7b8130,_0x47e7ab){return moment(_0x7b8130)['add'](_0x47e7ab,'seconds')['format'](_0x6acf('0x26'));};exports[_0x6acf('0x27')]=function(_0x83a28c,_0x4bff63){return moment(_0x83a28c)['subtract'](_0x4bff63,_0x6acf('0x28'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x6acf('0x29')]=function(_0x28b21e,_0x339c23){return moment(_0x28b21e)[_0x6acf('0x2a')](moment(_0x339c23),_0x6acf('0x28'));};exports[_0x6acf('0x2b')]=function(_0x33fa30,_0x13ea16){return parseInt(_0x33fa30,0xa)+parseInt(_0x13ea16,0xa);};exports['now']=function(){return moment()[_0x6acf('0x2c')](_0x6acf('0x26'));};exports[_0x6acf('0x2d')]=function(_0x430164,_0x333ade){if(_0x333ade){return moment(_0x430164)[_0x6acf('0x2d')](_0x333ade);}return!![];};exports[_0x6acf('0x2e')]=function(_0xeea76,_0x29e763){if(_0x29e763){return moment(_0xeea76)[_0x6acf('0x2e')](_0x29e763);}else if(_0xeea76){return!![];}return![];};
\ No newline at end of file